Compare commits
6 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e09cbb27a | ||
|
|
57ce184761 | ||
|
|
0c7dbbaa57 | ||
|
|
1c8d3d0725 | ||
|
|
7a5aeb3ff3 | ||
|
|
bb33ff66b3 |
154
lib/plankton/plankton.d.ts
vendored
154
lib/plankton/plankton.d.ts
vendored
|
|
@ -1444,8 +1444,8 @@ declare namespace lib_plankton.list {
|
||||||
/**
|
/**
|
||||||
* retrieves the element and its index of the list, which has the maximum value
|
* retrieves the element and its index of the list, which has the maximum value
|
||||||
*/
|
*/
|
||||||
function max<type_element, type_value>(list: Array<type_element>, target_function: ((element: type_element) => type_value), { "compare_value": compare_value, }?: {
|
function max<type_element, type_value>(list: Array<type_element>, target_function: ((element: type_element) => type_value), options: {
|
||||||
compare_value?: ((value1: type_value, value2: type_value) => boolean);
|
compare_value: ((value1: type_value, value2: type_value) => boolean);
|
||||||
}): type_result_max<type_element, type_value>;
|
}): type_result_max<type_element, type_value>;
|
||||||
/**
|
/**
|
||||||
* retrieves the element and its index of the list, which has the mininum value
|
* retrieves the element and its index of the list, which has the mininum value
|
||||||
|
|
@ -3793,9 +3793,6 @@ declare namespace lib_plankton.pit {
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
function to_date_object(pit: type_pit): Date;
|
function to_date_object(pit: type_pit): Date;
|
||||||
/**
|
|
||||||
*/
|
|
||||||
function from_date_object(date_object: Date): type_pit;
|
|
||||||
/**
|
/**
|
||||||
* @todo test
|
* @todo test
|
||||||
*/
|
*/
|
||||||
|
|
@ -3817,12 +3814,6 @@ declare namespace lib_plankton.pit {
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
function is_between(pit: type_pit, reference_left: type_pit, reference_right: type_pit): boolean;
|
function is_between(pit: type_pit, reference_left: type_pit, reference_right: type_pit): boolean;
|
||||||
/**
|
|
||||||
*/
|
|
||||||
function shift_second(pit: type_pit, increment: int): type_pit;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
function shift_minute(pit: type_pit, increment: int): type_pit;
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
function shift_hour(pit: type_pit, increment: int): type_pit;
|
function shift_hour(pit: type_pit, increment: int): type_pit;
|
||||||
|
|
@ -3870,9 +3861,6 @@ declare namespace lib_plankton.pit {
|
||||||
function to_ywd(pit: type_pit, { "timezone_shift": option_timezone_shift, }?: {
|
function to_ywd(pit: type_pit, { "timezone_shift": option_timezone_shift, }?: {
|
||||||
timezone_shift?: int;
|
timezone_shift?: int;
|
||||||
}): type_ywd;
|
}): type_ywd;
|
||||||
/**
|
|
||||||
*/
|
|
||||||
function number_of_weeks(year: int): int;
|
|
||||||
/**
|
/**
|
||||||
* computes the point in time for switching to central european summer time
|
* computes the point in time for switching to central european summer time
|
||||||
*
|
*
|
||||||
|
|
@ -3904,15 +3892,14 @@ declare namespace lib_plankton.pit {
|
||||||
function timezone_shift_format(timezone_shift: int): string;
|
function timezone_shift_format(timezone_shift: int): string;
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
function date_format(date: type_date, { "short": short, }?: {
|
function date_format(date: type_date): string;
|
||||||
short?: boolean;
|
|
||||||
}): string;
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
function time_format(time: type_time, { "show_seconds": option_show_seconds, }?: {
|
function time_format(time: type_time, { "show_seconds": option_show_seconds, }?: {
|
||||||
show_seconds?: boolean;
|
show_seconds?: boolean;
|
||||||
}): string;
|
}): string;
|
||||||
/**
|
/**
|
||||||
|
* @todo show timezone
|
||||||
*/
|
*/
|
||||||
function datetime_format(datetime: (null | type_datetime), { "timezone_indicator": option_timezone_indicator, "show_timezone": option_show_timezone, "adjust_to_ce": option_adjust_to_ce, "omit_date": option_omit_date, }?: {
|
function datetime_format(datetime: (null | type_datetime), { "timezone_indicator": option_timezone_indicator, "show_timezone": option_show_timezone, "adjust_to_ce": option_adjust_to_ce, "omit_date": option_omit_date, }?: {
|
||||||
timezone_indicator?: string;
|
timezone_indicator?: string;
|
||||||
|
|
@ -3922,15 +3909,11 @@ declare namespace lib_plankton.pit {
|
||||||
}): string;
|
}): string;
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
function timespan_format(from: (null | type_datetime), to: (null | type_datetime), { "timezone_indicator": timezone_indicator, "show_timezone": show_timezone, "adjust_to_ce": adjust_to_ce, "omit_date": omit_date, "indicator_open_both": indicator_open_both, "indicator_open_right": indicator_open_right, "indicator_open_left": indicator_open_left, "indicator_closed": indicator_closed, }?: {
|
function timespan_format(from: type_datetime, to: (null | type_datetime), { "timezone_indicator": option_timezone_indicator, "show_timezone": option_show_timezone, "adjust_to_ce": option_adjust_to_ce, "omit_date": option_omit_date, }?: {
|
||||||
timezone_indicator?: string;
|
timezone_indicator?: string;
|
||||||
show_timezone?: boolean;
|
show_timezone?: boolean;
|
||||||
adjust_to_ce?: boolean;
|
adjust_to_ce?: boolean;
|
||||||
omit_date?: boolean;
|
omit_date?: boolean;
|
||||||
indicator_open_both?: string;
|
|
||||||
indicator_open_right?: string;
|
|
||||||
indicator_open_left?: string;
|
|
||||||
indicator_closed?: string;
|
|
||||||
}): string;
|
}): string;
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.translate {
|
declare namespace lib_plankton.translate {
|
||||||
|
|
@ -4323,9 +4306,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
hook_change(action: (() => void)): Promise<void>;
|
||||||
/**
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4373,10 +4353,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
hook_change(action: (() => void)): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4416,10 +4392,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
hook_change(action: (() => void)): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4467,10 +4439,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
hook_change(action: (() => void)): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4509,10 +4477,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
hook_change(action: (() => void)): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4523,9 +4487,8 @@ declare namespace lib_plankton.zoo_input {
|
||||||
class class_input_text extends class_input_simple<string> implements interface_input<string> {
|
class class_input_text extends class_input_simple<string> implements interface_input<string> {
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
constructor({ "pattern": pattern, "placeholder": placeholder, }?: {
|
constructor({ "pattern": pattern, }?: {
|
||||||
pattern?: (null | string);
|
pattern?: (null | string);
|
||||||
placeholder?: (null | string);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4570,10 +4533,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
hook_change(action: (() => void)): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4612,10 +4571,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
hook_change(action: (() => void)): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4662,10 +4617,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
hook_change(action: (() => void)): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4705,10 +4656,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
hook_change(action: (() => void)): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4755,10 +4702,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
hook_change(action: (() => void)): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4822,10 +4765,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
hook_change(action: (() => void)): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
}
|
}
|
||||||
|
|
@ -4870,10 +4809,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
hook_change(action: (() => void)): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4926,10 +4861,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
hook_change(action: (() => void)): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4974,10 +4905,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
hook_change(action: (() => void)): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -5026,10 +4953,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
hook_change(action: (() => void)): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -5065,10 +4988,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
hook_change(action: (() => void)): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -5102,10 +5021,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
hook_change(action: (() => void)): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -5139,10 +5054,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
hook_change(action: (() => void)): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -5163,56 +5074,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
constructor();
|
constructor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
|
||||||
/**
|
|
||||||
* @author fenris
|
|
||||||
*/
|
|
||||||
class class_input_file implements interface_input<(null | string | ArrayBuffer)> {
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private required;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private mime_type;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private capture;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private dom_input;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
constructor({ "required": required, "mime_type": mime_type, "capture": capture, }?: {
|
|
||||||
required?: boolean;
|
|
||||||
mime_type?: (null | string);
|
|
||||||
capture?: boolean;
|
|
||||||
});
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
setup(parent: HTMLElement): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
read(): Promise<(null | string | ArrayBuffer)>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
write(value: (null | string | ArrayBuffer)): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
lock(mode: boolean): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare namespace lib_plankton.zoo_form {
|
declare namespace lib_plankton.zoo_form {
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
|
|
@ -5305,9 +5166,6 @@ declare namespace lib_plankton.zoo_form {
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
input_lock(mode: boolean): Promise<void>;
|
input_lock(mode: boolean): Promise<void>;
|
||||||
/**
|
|
||||||
*/
|
|
||||||
input_focus(): void;
|
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3849,8 +3849,10 @@ var lib_plankton;
|
||||||
/**
|
/**
|
||||||
* retrieves the element and its index of the list, which has the maximum value
|
* retrieves the element and its index of the list, which has the maximum value
|
||||||
*/
|
*/
|
||||||
function max(list, target_function, _a) {
|
function max(list, target_function, options) {
|
||||||
var _b = _a === void 0 ? {} : _a, _c = _b["compare_value"], compare_value = _c === void 0 ? (function (x, y) { return (x <= y); }) : _c;
|
options = Object.assign({
|
||||||
|
"compare_value": instance_compare
|
||||||
|
}, options);
|
||||||
/*if (is_empty<type_element>(list)) {
|
/*if (is_empty<type_element>(list)) {
|
||||||
throw (new Error("the max-arg of an empty list is not defined"));
|
throw (new Error("the max-arg of an empty list is not defined"));
|
||||||
}
|
}
|
||||||
|
|
@ -3860,7 +3862,7 @@ var lib_plankton;
|
||||||
var value = target_function(element);
|
var value = target_function(element);
|
||||||
if ((result == null)
|
if ((result == null)
|
||||||
||
|
||
|
||||||
(!compare_value(value, result.value))) {
|
(!options.compare_value(value, result.value))) {
|
||||||
return { "index": index, "element": element, "value": value };
|
return { "index": index, "element": element, "value": value };
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -11388,7 +11390,6 @@ var lib_plankton;
|
||||||
function from_date_object(date_object) {
|
function from_date_object(date_object) {
|
||||||
return Math.round(date_object.getTime() / 1000);
|
return Math.round(date_object.getTime() / 1000);
|
||||||
}
|
}
|
||||||
pit_1.from_date_object = from_date_object;
|
|
||||||
/**
|
/**
|
||||||
* @todo test
|
* @todo test
|
||||||
*/
|
*/
|
||||||
|
|
@ -11459,18 +11460,6 @@ var lib_plankton;
|
||||||
is_before(pit, reference_right));
|
is_before(pit, reference_right));
|
||||||
}
|
}
|
||||||
pit_1.is_between = is_between;
|
pit_1.is_between = is_between;
|
||||||
/**
|
|
||||||
*/
|
|
||||||
function shift_second(pit, increment) {
|
|
||||||
return (pit + (increment));
|
|
||||||
}
|
|
||||||
pit_1.shift_second = shift_second;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
function shift_minute(pit, increment) {
|
|
||||||
return (pit + (60 * increment));
|
|
||||||
}
|
|
||||||
pit_1.shift_minute = shift_minute;
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
function shift_hour(pit, increment) {
|
function shift_hour(pit, increment) {
|
||||||
|
|
@ -11665,17 +11654,6 @@ var lib_plankton;
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
pit_1.to_ywd = to_ywd;
|
pit_1.to_ywd = to_ywd;
|
||||||
/**
|
|
||||||
*/
|
|
||||||
function number_of_weeks(year) {
|
|
||||||
return lib_plankton.call.convey(year, [
|
|
||||||
x => from_ywd({ "year": (x + 1), "week": 1, "day": 6 }),
|
|
||||||
x => shift_week(x, -1),
|
|
||||||
to_ywd,
|
|
||||||
x => x.week,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
pit_1.number_of_weeks = number_of_weeks;
|
|
||||||
/**
|
/**
|
||||||
* computes the point in time for switching to central european summer time
|
* computes the point in time for switching to central european summer time
|
||||||
*
|
*
|
||||||
|
|
@ -11762,8 +11740,7 @@ var lib_plankton;
|
||||||
"time": ((datetime.time === null)
|
"time": ((datetime.time === null)
|
||||||
?
|
?
|
||||||
null
|
null
|
||||||
:
|
: datetime_shifted.time)
|
||||||
datetime_shifted.time)
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -11794,9 +11771,8 @@ var lib_plankton;
|
||||||
pit_1.timezone_shift_format = timezone_shift_format;
|
pit_1.timezone_shift_format = timezone_shift_format;
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
function date_format(date, { "short": short = false, } = {}) {
|
function date_format(date) {
|
||||||
return lib_plankton.string.coin("{{year}}{{separator}}{{month}}{{separator}}{{day}}", {
|
return lib_plankton.string.coin("{{year}}-{{month}}-{{day}}", {
|
||||||
"separator": (short ? "" : "-"),
|
|
||||||
"year": date.year.toFixed(0).padStart(4, "0"),
|
"year": date.year.toFixed(0).padStart(4, "0"),
|
||||||
"month": date.month.toFixed(0).padStart(2, "0"),
|
"month": date.month.toFixed(0).padStart(2, "0"),
|
||||||
"day": date.day.toFixed(0).padStart(2, "0"),
|
"day": date.day.toFixed(0).padStart(2, "0"),
|
||||||
|
|
@ -11818,6 +11794,7 @@ var lib_plankton;
|
||||||
}
|
}
|
||||||
pit_1.time_format = time_format;
|
pit_1.time_format = time_format;
|
||||||
/**
|
/**
|
||||||
|
* @todo show timezone
|
||||||
*/
|
*/
|
||||||
function datetime_format(datetime, { "timezone_indicator": option_timezone_indicator = "", "show_timezone": option_show_timezone = false, "adjust_to_ce": option_adjust_to_ce = false, "omit_date": option_omit_date = false, } = {}) {
|
function datetime_format(datetime, { "timezone_indicator": option_timezone_indicator = "", "show_timezone": option_show_timezone = false, "adjust_to_ce": option_adjust_to_ce = false, "omit_date": option_omit_date = false, } = {}) {
|
||||||
if (datetime === null) {
|
if (datetime === null) {
|
||||||
|
|
@ -11860,77 +11837,49 @@ var lib_plankton;
|
||||||
pit_1.datetime_format = datetime_format;
|
pit_1.datetime_format = datetime_format;
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
function timespan_format(from, to, { "timezone_indicator": timezone_indicator = "", "show_timezone": show_timezone = false, "adjust_to_ce": adjust_to_ce = false, "omit_date": omit_date = false, "indicator_open_both": indicator_open_both = "?", "indicator_open_right": indicator_open_right = "> ", "indicator_open_left": indicator_open_left = "< ", "indicator_closed": indicator_closed = " — ", } = {}) {
|
function timespan_format(from, to, { "timezone_indicator": option_timezone_indicator = "", "show_timezone": option_show_timezone = false, "adjust_to_ce": option_adjust_to_ce = false, "omit_date": option_omit_date = false, } = {}) {
|
||||||
const from_adjusted = ((from === null)
|
const from_adjusted = (option_adjust_to_ce
|
||||||
?
|
|
||||||
null
|
|
||||||
:
|
|
||||||
(adjust_to_ce
|
|
||||||
?
|
?
|
||||||
datetime_translate_ce(from)
|
datetime_translate_ce(from)
|
||||||
:
|
:
|
||||||
from));
|
from);
|
||||||
const to_adjusted = ((to === null)
|
const to_adjusted = ((to === null)
|
||||||
?
|
?
|
||||||
null
|
null
|
||||||
:
|
:
|
||||||
(adjust_to_ce
|
(option_adjust_to_ce
|
||||||
?
|
?
|
||||||
datetime_translate_ce(to)
|
datetime_translate_ce(to)
|
||||||
:
|
:
|
||||||
to));
|
to));
|
||||||
return (((to_adjusted === null)
|
return lib_plankton.string.coin("{{from}}{{to_macro}}{{macro_timezone}}", {
|
||||||
&&
|
"from": datetime_format(from_adjusted, {
|
||||||
(from_adjusted === null))
|
|
||||||
?
|
|
||||||
indicator_open_both
|
|
||||||
:
|
|
||||||
lib_plankton.string.coin("{{prefix}}{{from_macro}}{{interfix}}{{to_macro}}{{macro_timezone}}", {
|
|
||||||
"prefix": ((to_adjusted === null)
|
|
||||||
?
|
|
||||||
indicator_open_right
|
|
||||||
:
|
|
||||||
""),
|
|
||||||
"from_macro": ((from_adjusted === null)
|
|
||||||
?
|
|
||||||
""
|
|
||||||
:
|
|
||||||
datetime_format(from_adjusted, {
|
|
||||||
"show_timezone": false,
|
"show_timezone": false,
|
||||||
"adjust_to_ce": false,
|
"adjust_to_ce": false,
|
||||||
"omit_date": omit_date,
|
"omit_date": option_omit_date,
|
||||||
})),
|
}),
|
||||||
"interfix": ((from_adjusted === null)
|
|
||||||
?
|
|
||||||
indicator_open_left
|
|
||||||
:
|
|
||||||
((to_adjusted === null)
|
|
||||||
?
|
|
||||||
""
|
|
||||||
:
|
|
||||||
indicator_closed)),
|
|
||||||
"to_macro": ((to_adjusted === null)
|
"to_macro": ((to_adjusted === null)
|
||||||
?
|
?
|
||||||
""
|
""
|
||||||
:
|
:
|
||||||
datetime_format(to_adjusted, {
|
lib_plankton.string.coin(" - {{to}}", {
|
||||||
"omit_date": ((from_adjusted !== null)
|
"to": datetime_format(to_adjusted, {
|
||||||
&&
|
"omit_date": ((from_adjusted.date.year === to_adjusted.date.year)
|
||||||
((from_adjusted.date.year === to_adjusted.date.year)
|
|
||||||
&&
|
&&
|
||||||
(from_adjusted.date.month === to_adjusted.date.month)
|
(from_adjusted.date.month === to_adjusted.date.month)
|
||||||
&&
|
&&
|
||||||
(from_adjusted.date.day === to_adjusted.date.day)))
|
(from_adjusted.date.day === to_adjusted.date.day))
|
||||||
|
}),
|
||||||
})),
|
})),
|
||||||
"macro_timezone": (show_timezone
|
"macro_timezone": (option_show_timezone
|
||||||
?
|
?
|
||||||
lib_plankton.string.coin(" [{{timezone_indicator}}{{timezone_value}}]", {
|
lib_plankton.string.coin(" [{{timezone_indicator}}{{timezone_value}}]", {
|
||||||
"timezone_indicator": timezone_indicator,
|
"timezone_indicator": option_timezone_indicator,
|
||||||
"timezone_value": timezone_shift_format(from_adjusted.timezone_shift),
|
"timezone_value": timezone_shift_format(from_adjusted.timezone_shift),
|
||||||
})
|
})
|
||||||
:
|
:
|
||||||
""),
|
""),
|
||||||
}));
|
});
|
||||||
}
|
}
|
||||||
pit_1.timespan_format = timespan_format;
|
pit_1.timespan_format = timespan_format;
|
||||||
})(pit = lib_plankton.pit || (lib_plankton.pit = {}));
|
})(pit = lib_plankton.pit || (lib_plankton.pit = {}));
|
||||||
|
|
@ -13346,12 +13295,6 @@ var lib_plankton;
|
||||||
});
|
});
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus() {
|
|
||||||
this.dom_input.focus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
zoo_input.class_input_simple = class_input_simple;
|
zoo_input.class_input_simple = class_input_simple;
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
||||||
|
|
@ -13421,12 +13364,6 @@ var lib_plankton;
|
||||||
hook_change(action) {
|
hook_change(action) {
|
||||||
return this.core.hook_change(action);
|
return this.core.hook_change(action);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus() {
|
|
||||||
this.core.focus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
zoo_input.class_input_wrapped = class_input_wrapped;
|
zoo_input.class_input_wrapped = class_input_wrapped;
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
||||||
|
|
@ -13549,12 +13486,6 @@ var lib_plankton;
|
||||||
});
|
});
|
||||||
await this.core.hook_change(action);
|
await this.core.hook_change(action);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus() {
|
|
||||||
this.dom_set.focus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
zoo_input.class_input_soft = class_input_soft;
|
zoo_input.class_input_soft = class_input_soft;
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
||||||
|
|
@ -13626,11 +13557,6 @@ var lib_plankton;
|
||||||
hook_change(action) {
|
hook_change(action) {
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus() {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
zoo_input.class_input_hidden = class_input_hidden;
|
zoo_input.class_input_hidden = class_input_hidden;
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
||||||
|
|
@ -13664,13 +13590,12 @@ var lib_plankton;
|
||||||
class class_input_text extends zoo_input.class_input_simple {
|
class class_input_text extends zoo_input.class_input_simple {
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
constructor({ "pattern": pattern = null, "placeholder": placeholder = null,
|
constructor({ "pattern": pattern = null,
|
||||||
// "autocompletion_list": autocompletion_list = null,
|
// "autocompletion_list": autocompletion_list = null,
|
||||||
} = {}) {
|
} = {}) {
|
||||||
super("text", representation => representation, value => value, {
|
super("text", representation => representation, value => value, {
|
||||||
"additional_attributes": {
|
"additional_attributes": {
|
||||||
"pattern": pattern,
|
"pattern": pattern,
|
||||||
"placeholder": placeholder,
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -13786,12 +13711,6 @@ var lib_plankton;
|
||||||
});
|
});
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus() {
|
|
||||||
this.dom_textarea.focus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
zoo_input.class_input_textarea = class_input_textarea;
|
zoo_input.class_input_textarea = class_input_textarea;
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
||||||
|
|
@ -13903,12 +13822,6 @@ var lib_plankton;
|
||||||
});
|
});
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus() {
|
|
||||||
this.dom_input.focus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
zoo_input.class_input_date = class_input_date;
|
zoo_input.class_input_date = class_input_date;
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
||||||
|
|
@ -14028,12 +13941,6 @@ var lib_plankton;
|
||||||
});
|
});
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus() {
|
|
||||||
this.dom_input.focus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
zoo_input.class_input_checkbox = class_input_checkbox;
|
zoo_input.class_input_checkbox = class_input_checkbox;
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
||||||
|
|
@ -14118,12 +14025,6 @@ var lib_plankton;
|
||||||
});
|
});
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus() {
|
|
||||||
this.dom_select.focus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
zoo_input.class_input_selection = class_input_selection;
|
zoo_input.class_input_selection = class_input_selection;
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
||||||
|
|
@ -14236,12 +14137,6 @@ var lib_plankton;
|
||||||
});
|
});
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus() {
|
|
||||||
this.dom_inputs[0].focus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
zoo_input.class_input_enumeration = class_input_enumeration;
|
zoo_input.class_input_enumeration = class_input_enumeration;
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
||||||
|
|
@ -14421,12 +14316,6 @@ var lib_plankton;
|
||||||
await element.input.hook_change(action);
|
await element.input.hook_change(action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus() {
|
|
||||||
lib_plankton.log.notice("plankton.zoo_input.list.focus.dummy_implementation");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
zoo_input.class_input_list = class_input_list;
|
zoo_input.class_input_list = class_input_list;
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
||||||
|
|
@ -14538,12 +14427,6 @@ var lib_plankton;
|
||||||
});
|
});
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus() {
|
|
||||||
this.checkboxes[0].focus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
zoo_input.class_input_set = class_input_set;
|
zoo_input.class_input_set = class_input_set;
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
||||||
|
|
@ -14662,12 +14545,6 @@ var lib_plankton;
|
||||||
});
|
});
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus() {
|
|
||||||
this.dom_input.focus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
zoo_input.class_input_password = class_input_password;
|
zoo_input.class_input_password = class_input_password;
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
||||||
|
|
@ -14761,12 +14638,6 @@ var lib_plankton;
|
||||||
});
|
});
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus() {
|
|
||||||
this.dom_element.focus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
zoo_input.class_input_switch = class_input_switch;
|
zoo_input.class_input_switch = class_input_switch;
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
||||||
|
|
@ -14949,12 +14820,6 @@ var lib_plankton;
|
||||||
});
|
});
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus() {
|
|
||||||
this.fields[0].input.focus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
zoo_input.class_input_group = class_input_group;
|
zoo_input.class_input_group = class_input_group;
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
||||||
|
|
@ -15035,12 +14900,6 @@ var lib_plankton;
|
||||||
hook_change(action) {
|
hook_change(action) {
|
||||||
return this.core.hook_change(action);
|
return this.core.hook_change(action);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus() {
|
|
||||||
this.core.focus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
zoo_input.class_input_hashmap = class_input_hashmap;
|
zoo_input.class_input_hashmap = class_input_hashmap;
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
||||||
|
|
@ -15128,12 +14987,6 @@ var lib_plankton;
|
||||||
hook_change(action) {
|
hook_change(action) {
|
||||||
return this.core.hook_change(action);
|
return this.core.hook_change(action);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus() {
|
|
||||||
this.core.focus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
zoo_input.class_input_datetime = class_input_datetime;
|
zoo_input.class_input_datetime = class_input_datetime;
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
||||||
|
|
@ -15244,12 +15097,6 @@ var lib_plankton;
|
||||||
hook_change(action) {
|
hook_change(action) {
|
||||||
return this.core.hook_change(action);
|
return this.core.hook_change(action);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus() {
|
|
||||||
this.core.focus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
zoo_input.class_input_datetime_central_europe = class_input_datetime_central_europe;
|
zoo_input.class_input_datetime_central_europe = class_input_datetime_central_europe;
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
||||||
|
|
@ -15345,138 +15192,6 @@ var lib_plankton;
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
||||||
})(lib_plankton || (lib_plankton = {}));
|
})(lib_plankton || (lib_plankton = {}));
|
||||||
/*
|
/*
|
||||||
This file is part of »bacterio-plankton:zoo-input«.
|
|
||||||
|
|
||||||
Copyright 2016-2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»bacterio-plankton:zoo-input« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»bacterio-plankton:zoo-input« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »bacterio-plankton:zoo-input«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
var lib_plankton;
|
|
||||||
(function (lib_plankton) {
|
|
||||||
var zoo_input;
|
|
||||||
(function (zoo_input) {
|
|
||||||
/**
|
|
||||||
* @author fenris
|
|
||||||
*/
|
|
||||||
class class_input_file {
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
constructor({ "required": required = false, "mime_type": mime_type = null, "capture": capture = false, } = {}) {
|
|
||||||
this.required = required;
|
|
||||||
this.mime_type = mime_type;
|
|
||||||
this.capture = capture;
|
|
||||||
this.dom_input = null;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
setup(parent) {
|
|
||||||
this.dom_input = document.createElement("input");
|
|
||||||
this.dom_input.setAttribute("type", "file");
|
|
||||||
if (this.mime_type === null) {
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.dom_input.setAttribute("accept", this.mime_type);
|
|
||||||
}
|
|
||||||
if (!this.capture) {
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.dom_input.setAttribute("capture", "capture");
|
|
||||||
}
|
|
||||||
if (!this.required) {
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.dom_input.setAttribute("required", "required");
|
|
||||||
}
|
|
||||||
parent.appendChild(this.dom_input);
|
|
||||||
return Promise.resolve(undefined);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
read() {
|
|
||||||
if (this.required && (!this.dom_input.reportValidity())) {
|
|
||||||
return Promise.reject("required");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return (new Promise((resolve, reject) => {
|
|
||||||
if (this.dom_input.files.length <= 0) {
|
|
||||||
resolve(null);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
const file = this.dom_input.files[0];
|
|
||||||
const reader = new FileReader();
|
|
||||||
reader.onerror = () => {
|
|
||||||
reader.abort();
|
|
||||||
reject(new Error());
|
|
||||||
};
|
|
||||||
reader.onload = (event) => {
|
|
||||||
resolve(reader.result);
|
|
||||||
};
|
|
||||||
// reader.readAsDataURL(file);
|
|
||||||
reader.readAsArrayBuffer(file);
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
write(value) {
|
|
||||||
if (value === null) {
|
|
||||||
this.dom_input.value = null;
|
|
||||||
return Promise.resolve(undefined);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return Promise.reject(new Error("not implemented (might even be impossible)"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
lock(mode) {
|
|
||||||
if (mode) {
|
|
||||||
this.dom_input.setAttribute("disabled", "disabled");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.dom_input.removeAttribute("disabled");
|
|
||||||
}
|
|
||||||
return Promise.resolve(undefined);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
hook_change(action) {
|
|
||||||
this.dom_input.addEventListener("change", () => {
|
|
||||||
action();
|
|
||||||
});
|
|
||||||
return Promise.resolve(undefined);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus() {
|
|
||||||
this.dom_input.focus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
zoo_input.class_input_file = class_input_file;
|
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
|
||||||
})(lib_plankton || (lib_plankton = {}));
|
|
||||||
/*
|
|
||||||
This file is part of »bacterio-plankton:zoo-form«.
|
This file is part of »bacterio-plankton:zoo-form«.
|
||||||
|
|
||||||
Copyright 2016-2025 'kcf' <fenris@folksprak.org>
|
Copyright 2016-2025 'kcf' <fenris@folksprak.org>
|
||||||
|
|
@ -15729,11 +15444,6 @@ var lib_plankton;
|
||||||
input_lock(mode) {
|
input_lock(mode) {
|
||||||
return this.input.lock(mode);
|
return this.input.lock(mode);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
*/
|
|
||||||
input_focus() {
|
|
||||||
return this.input.focus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
zoo_form.class_form = class_form;
|
zoo_form.class_form = class_form;
|
||||||
})(zoo_form = lib_plankton.zoo_form || (lib_plankton.zoo_form = {}));
|
})(zoo_form = lib_plankton.zoo_form || (lib_plankton.zoo_form = {}));
|
||||||
|
|
|
||||||
|
|
@ -145,37 +145,4 @@ namespace _dali
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export var general_cache : lib_plankton.cache.type_subject<unknown> = lib_plankton.cache.make<unknown>(
|
|
||||||
/*
|
|
||||||
lib_plankton.storage.memory.implementation_chest(
|
|
||||||
{
|
|
||||||
}
|
|
||||||
)
|
|
||||||
*/
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export async function number_of_weeks(
|
|
||||||
year : int
|
|
||||||
) : Promise<int>
|
|
||||||
{
|
|
||||||
const value_raw : unknown = await lib_plankton.cache.get<unknown>(
|
|
||||||
_dali.general_cache,
|
|
||||||
lib_plankton.string.coin(
|
|
||||||
"number_of_weeks_{{year}}",
|
|
||||||
{
|
|
||||||
"year": year.toFixed(0),
|
|
||||||
}
|
|
||||||
),
|
|
||||||
null,
|
|
||||||
() => Promise.resolve<int>(lib_plankton.pit.number_of_weeks(year))
|
|
||||||
);
|
|
||||||
return (value_raw as int);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -138,25 +138,6 @@ namespace _dali.helpers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export async function element_from_template(
|
|
||||||
group : string,
|
|
||||||
name : string,
|
|
||||||
data : Record<string, string>
|
|
||||||
)
|
|
||||||
: Promise<HTMLElement>
|
|
||||||
{
|
|
||||||
const dom_dummy = document.createElement("div");
|
|
||||||
dom_dummy.innerHTML = await _dali.helpers.template_coin(
|
|
||||||
group,
|
|
||||||
name,
|
|
||||||
data
|
|
||||||
);
|
|
||||||
return (dom_dummy.children[0] as HTMLElement);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo outsource
|
* @todo outsource
|
||||||
*/
|
*/
|
||||||
|
|
@ -164,8 +145,7 @@ namespace _dali.helpers
|
||||||
members : Array<
|
members : Array<
|
||||||
() => Promise<type_result>
|
() => Promise<type_result>
|
||||||
>
|
>
|
||||||
)
|
) : Promise<
|
||||||
: Promise<
|
|
||||||
Array<
|
Array<
|
||||||
type_result
|
type_result
|
||||||
>
|
>
|
||||||
|
|
@ -182,8 +162,7 @@ namespace _dali.helpers
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function input_access_level(
|
export function input_access_level(
|
||||||
)
|
) : lib_plankton.zoo_input.interface_input<_dali.enum_access_level>
|
||||||
: lib_plankton.zoo_input.interface_input<_dali.enum_access_level>
|
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
new lib_plankton.zoo_input.class_input_wrapped<
|
new lib_plankton.zoo_input.class_input_wrapped<
|
||||||
|
|
@ -304,139 +283,9 @@ namespace _dali.helpers
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function datetime_input(
|
export function datetime_input(
|
||||||
use_fallback : boolean
|
) : lib_plankton.zoo_input.interface_input<lib_plankton.pit.type_datetime>
|
||||||
)
|
|
||||||
: lib_plankton.zoo_input.interface_input<lib_plankton.pit.type_datetime>
|
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
use_fallback
|
|
||||||
?
|
|
||||||
new lib_plankton.zoo_input.class_input_wrapped<
|
|
||||||
{
|
|
||||||
date : string;
|
|
||||||
time : string;
|
|
||||||
},
|
|
||||||
(
|
|
||||||
null
|
|
||||||
|
|
|
||||||
lib_plankton.pit.type_datetime
|
|
||||||
)
|
|
||||||
>(
|
|
||||||
new lib_plankton.zoo_input.class_input_group(
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"name": "date",
|
|
||||||
"input": new lib_plankton.zoo_input.class_input_text(
|
|
||||||
{
|
|
||||||
"pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}",
|
|
||||||
"placeholder": "YYYY-MM-DD",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
"label": lib_plankton.translate.get("common.date"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "time",
|
|
||||||
"input": new lib_plankton.zoo_input.class_input_text(
|
|
||||||
{
|
|
||||||
"pattern": "[0-9]{2}:[0-9]{2}",
|
|
||||||
"placeholder": "HH:MM",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
"label": lib_plankton.translate.get("common.time"),
|
|
||||||
},
|
|
||||||
]
|
|
||||||
),
|
|
||||||
(inner) => {
|
|
||||||
if (inner === null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const date_parts : Array<string> = ((inner.date === "") ? null : inner.date.split("-"));
|
|
||||||
const time_parts : (null | Array<string>) = ((inner.time === "") ? null : inner.time.split(":"));
|
|
||||||
const datetime_raw : (null | lib_plankton.pit.type_datetime) = (
|
|
||||||
(date_parts === null)
|
|
||||||
?
|
|
||||||
null
|
|
||||||
:
|
|
||||||
{
|
|
||||||
"timezone_shift": 0,
|
|
||||||
"date": {
|
|
||||||
"year": parseInt(date_parts[0]),
|
|
||||||
"month": parseInt(date_parts[1]),
|
|
||||||
"day": parseInt(date_parts[2]),
|
|
||||||
},
|
|
||||||
"time": (
|
|
||||||
(time_parts === null)
|
|
||||||
?
|
|
||||||
null
|
|
||||||
:
|
|
||||||
{
|
|
||||||
"hour": parseInt(time_parts[0]),
|
|
||||||
"minute": parseInt(time_parts[1]),
|
|
||||||
"second": 0,
|
|
||||||
}
|
|
||||||
),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
return (
|
|
||||||
(datetime_raw === null)
|
|
||||||
?
|
|
||||||
null
|
|
||||||
:
|
|
||||||
{
|
|
||||||
"timezone_shift": (
|
|
||||||
_dali.conf.get().misc.use_central_europe_specific_datetime_inputs
|
|
||||||
?
|
|
||||||
lib_plankton.pit.timezone_shift_ce(lib_plankton.pit.from_datetime(datetime_raw))
|
|
||||||
:
|
|
||||||
0
|
|
||||||
),
|
|
||||||
"date": datetime_raw.date,
|
|
||||||
"time": datetime_raw.time,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
(outer) => {
|
|
||||||
if (outer === null)
|
|
||||||
{
|
|
||||||
return {
|
|
||||||
"date": "",
|
|
||||||
"time": "",
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return {
|
|
||||||
"date": lib_plankton.string.coin(
|
|
||||||
"{{year}}-{{month}}-{{day}}",
|
|
||||||
{
|
|
||||||
"year": outer.date.year.toFixed(0).padStart(4, "0"),
|
|
||||||
"month": outer.date.month.toFixed(0).padStart(2, "0"),
|
|
||||||
"day": outer.date.day.toFixed(0).padStart(2, "0"),
|
|
||||||
}
|
|
||||||
),
|
|
||||||
"time": (
|
|
||||||
(outer.time === null)
|
|
||||||
?
|
|
||||||
""
|
|
||||||
:
|
|
||||||
lib_plankton.string.coin(
|
|
||||||
"{{hour}}:{{minute}}",
|
|
||||||
{
|
|
||||||
"hour": outer.time.hour.toFixed(0).padStart(2, "0"),
|
|
||||||
"minute": outer.time.minute.toFixed(0).padStart(2, "0"),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
:
|
|
||||||
(
|
|
||||||
_dali.conf.get().misc.use_central_europe_specific_datetime_inputs
|
_dali.conf.get().misc.use_central_europe_specific_datetime_inputs
|
||||||
?
|
?
|
||||||
new lib_plankton.zoo_input.class_input_datetime_central_europe(
|
new lib_plankton.zoo_input.class_input_datetime_central_europe(
|
||||||
|
|
@ -453,7 +302,6 @@ namespace _dali.helpers
|
||||||
"label_time": lib_plankton.translate.get("common.time"),
|
"label_time": lib_plankton.translate.get("common.time"),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -516,7 +364,7 @@ namespace _dali.helpers
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dali.overlay.get_content_element().innerHTML = ". . .";
|
_dali.overlay.get_content_element().innerHTML = "[...]";
|
||||||
_dali.overlay.toggle({"mode": true});
|
_dali.overlay.toggle({"mode": true});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -80,8 +80,6 @@ namespace _dali
|
||||||
await _dali.backend.initialize(
|
await _dali.backend.initialize(
|
||||||
_dali.conf.get()["backend"]
|
_dali.conf.get()["backend"]
|
||||||
);
|
);
|
||||||
// init:general cache
|
|
||||||
lib_plankton.cache.init(_dali.general_cache);
|
|
||||||
// init:model
|
// init:model
|
||||||
await _dali.model.initialize(
|
await _dali.model.initialize(
|
||||||
);
|
);
|
||||||
|
|
@ -198,11 +196,11 @@ namespace _dali
|
||||||
);
|
);
|
||||||
if (status.logged_in)
|
if (status.logged_in)
|
||||||
{
|
{
|
||||||
await _dali.notify_login(status.name);
|
_dali.notify_login(status.name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await _dali.notify_logout();
|
_dali.notify_logout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,10 +36,6 @@ namespace _dali.model
|
||||||
name : string;
|
name : string;
|
||||||
}
|
}
|
||||||
>;
|
>;
|
||||||
settings : {
|
|
||||||
use_fallback_for_date_and_time_inputs : boolean;
|
|
||||||
weekview_vertical_default : boolean;
|
|
||||||
};
|
|
||||||
calendars : (
|
calendars : (
|
||||||
null
|
null
|
||||||
|
|
|
|
||||||
|
|
@ -174,18 +170,6 @@ namespace _dali.model
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export async function settings(
|
|
||||||
)
|
|
||||||
: Promise<
|
|
||||||
_dali.type_user_settings
|
|
||||||
>
|
|
||||||
{
|
|
||||||
return Promise.resolve(_state.settings);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
async function sync_calendars(
|
async function sync_calendars(
|
||||||
|
|
@ -653,10 +637,6 @@ namespace _dali.model
|
||||||
_state = {
|
_state = {
|
||||||
"groups": [],
|
"groups": [],
|
||||||
"users": [],
|
"users": [],
|
||||||
"settings": {
|
|
||||||
"use_fallback_for_date_and_time_inputs": false,
|
|
||||||
"weekview_vertical_default": false,
|
|
||||||
},
|
|
||||||
"calendars": lib_plankton.map.hashmap.implementation_map(
|
"calendars": lib_plankton.map.hashmap.implementation_map(
|
||||||
lib_plankton.map.hashmap.make(
|
lib_plankton.map.hashmap.make(
|
||||||
calendar_id => calendar_id.toFixed(0)
|
calendar_id => calendar_id.toFixed(0)
|
||||||
|
|
@ -688,7 +668,6 @@ namespace _dali.model
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
_state.users = await _dali.backend.user_list();
|
_state.users = await _dali.backend.user_list();
|
||||||
_state.settings = (await _dali.backend.user_get()).settings;
|
|
||||||
await sync_calendars();
|
await sync_calendars();
|
||||||
lib_plankton.map.clear(_state.events);
|
lib_plankton.map.clear(_state.events);
|
||||||
lib_plankton.set.clear(_state.covered_dates);
|
lib_plankton.set.clear(_state.covered_dates);
|
||||||
|
|
|
||||||
|
|
@ -421,41 +421,6 @@ namespace _dali.backend
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export function user_get(
|
|
||||||
)
|
|
||||||
: Promise<
|
|
||||||
{
|
|
||||||
name : string;
|
|
||||||
groups : Array<
|
|
||||||
int
|
|
||||||
>;
|
|
||||||
email_address : (
|
|
||||||
null
|
|
||||||
|
|
|
||||||
string
|
|
||||||
);
|
|
||||||
dav_token : (
|
|
||||||
null
|
|
||||||
|
|
|
||||||
string
|
|
||||||
);
|
|
||||||
settings : {
|
|
||||||
use_fallback_for_date_and_time_inputs : boolean;
|
|
||||||
weekview_vertical_default : boolean;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{
|
|
||||||
return call(
|
|
||||||
lib_plankton.http.enum_method.get,
|
|
||||||
"/user",
|
|
||||||
null
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function user_dav_conf(
|
export function user_dav_conf(
|
||||||
|
|
|
||||||
9
source/style/hacks.css
Normal file
9
source/style/hacks.css
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
.plankton_input_group_field[rel="resource"]
|
||||||
|
{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.weekview-control-count
|
||||||
|
{
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
@ -20,6 +20,72 @@ header
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#overlay
|
||||||
|
{
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background-color: hsla(var(--hue), 0%, 0%, 0.75);
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
#overlay_content
|
||||||
|
{
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
|
||||||
|
transform: translate(-50%,-50%);
|
||||||
|
-ms-transform: translate(-50%,-50%);
|
||||||
|
|
||||||
|
padding: 32px;
|
||||||
|
|
||||||
|
background-color: hsl(0, 0%, 12.5%);
|
||||||
|
color: hsl(0, 0%, 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
#overlay:not(.overlay_active)
|
||||||
|
{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav > ul
|
||||||
|
{
|
||||||
|
list-style-type: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav > ul > li
|
||||||
|
{
|
||||||
|
display: inline-block;
|
||||||
|
margin: 8px;
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav > ul > li:not(.active)
|
||||||
|
{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav a
|
||||||
|
{
|
||||||
|
padding: 8px;
|
||||||
|
text-decoration: none;
|
||||||
|
color: hsl(var(--hue), 0%, 87.5%);
|
||||||
|
}
|
||||||
|
|
||||||
|
nav a:hover
|
||||||
|
{
|
||||||
|
color: hsl(var(--hue), 0%, 100%);
|
||||||
|
border-bottom: 2px solid hsl(0, 0%, 100%);
|
||||||
|
transition: 1s ease color;
|
||||||
|
}
|
||||||
|
|
||||||
a
|
a
|
||||||
{
|
{
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
@ -35,7 +101,7 @@ a:hover
|
||||||
|
|
||||||
button
|
button
|
||||||
{
|
{
|
||||||
padding: 8px 12px;
|
padding: 4px 8px;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
#overlay
|
|
||||||
{
|
|
||||||
position: fixed;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
background-color: hsla(var(--hue), 0%, 0%, 0.75);
|
|
||||||
z-index: 2;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
#overlay_content
|
|
||||||
{
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
|
|
||||||
transform: translate(-50%,-50%);
|
|
||||||
-ms-transform: translate(-50%,-50%);
|
|
||||||
|
|
||||||
padding: 32px;
|
|
||||||
|
|
||||||
background-color: hsl(0, 0%, 12.5%);
|
|
||||||
color: hsl(0, 0%, 100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
#overlay:not(.overlay_active)
|
|
||||||
{
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
@ -52,14 +52,6 @@ namespace _dali
|
||||||
export type type_user_id = int;
|
export type type_user_id = int;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export type type_user_settings = {
|
|
||||||
use_fallback_for_date_and_time_inputs : boolean;
|
|
||||||
weekview_vertical_default : boolean;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export type type_user_object = {
|
export type type_user_object = {
|
||||||
|
|
@ -70,7 +62,6 @@ namespace _dali
|
||||||
|
|
|
|
||||||
string
|
string
|
||||||
);
|
);
|
||||||
settings : type_user_settings;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -159,10 +159,6 @@ namespace _dali.widgets
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// init
|
|
||||||
{
|
|
||||||
(target_element.querySelector(".widget-caldav-close") as HTMLElement).focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
return Promise.resolve<void>(undefined);
|
return Promise.resolve<void>(undefined);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -111,13 +111,6 @@ namespace _dali.widgets
|
||||||
target_element : HTMLElement
|
target_element : HTMLElement
|
||||||
) : Promise<void>
|
) : Promise<void>
|
||||||
{
|
{
|
||||||
const dom_root = await _dali.helpers.element_from_template(
|
|
||||||
"widget-calendar_edit",
|
|
||||||
"main",
|
|
||||||
{
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
const form : lib_plankton.zoo_form.class_form<
|
const form : lib_plankton.zoo_form.class_form<
|
||||||
_dali.type_calendar_object,
|
_dali.type_calendar_object,
|
||||||
_dali.type_calendar_object
|
_dali.type_calendar_object
|
||||||
|
|
@ -250,12 +243,9 @@ namespace _dali.widgets
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
await form.setup(dom_root);
|
await form.setup(target_element);
|
||||||
await form.input_lock(this.read_only);
|
await form.input_lock(this.read_only);
|
||||||
await form.input_write(this.initial_value);
|
await form.input_write(this.initial_value);
|
||||||
|
|
||||||
target_element.appendChild(dom_root);
|
|
||||||
form.input_focus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
.widget-calendar_edit .plankton_input_group_field[rel="resource"]
|
|
||||||
{
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
<div class="widget-calendar_edit">
|
|
||||||
</div>
|
|
||||||
|
|
@ -154,13 +154,6 @@ namespace _dali.widgets
|
||||||
target_element : HTMLElement
|
target_element : HTMLElement
|
||||||
) : Promise<void>
|
) : Promise<void>
|
||||||
{
|
{
|
||||||
const dom_root = await _dali.helpers.element_from_template(
|
|
||||||
"widget-event_edit",
|
|
||||||
"main",
|
|
||||||
{
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
const form : lib_plankton.zoo_form.class_form<
|
const form : lib_plankton.zoo_form.class_form<
|
||||||
type_value,
|
type_value,
|
||||||
type_representation
|
type_representation
|
||||||
|
|
@ -212,7 +205,6 @@ namespace _dali.widgets
|
||||||
{
|
{
|
||||||
"name": "event_begin",
|
"name": "event_begin",
|
||||||
"input": _dali.helpers.datetime_input(
|
"input": _dali.helpers.datetime_input(
|
||||||
(await _dali.model.settings()).use_fallback_for_date_and_time_inputs
|
|
||||||
),
|
),
|
||||||
"label": lib_plankton.translate.get("event.begin")
|
"label": lib_plankton.translate.get("event.begin")
|
||||||
},
|
},
|
||||||
|
|
@ -220,7 +212,6 @@ namespace _dali.widgets
|
||||||
"name": "event_end",
|
"name": "event_end",
|
||||||
"input": new lib_plankton.zoo_input.class_input_soft<lib_plankton.pit.type_datetime>(
|
"input": new lib_plankton.zoo_input.class_input_soft<lib_plankton.pit.type_datetime>(
|
||||||
_dali.helpers.datetime_input(
|
_dali.helpers.datetime_input(
|
||||||
(await _dali.model.settings()).use_fallback_for_date_and_time_inputs
|
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
"label": lib_plankton.translate.get("event.end")
|
"label": lib_plankton.translate.get("event.end")
|
||||||
|
|
@ -325,12 +316,9 @@ namespace _dali.widgets
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
await form.setup(dom_root);
|
await form.setup(target_element);
|
||||||
await form.input_lock(this.read_only);
|
await form.input_lock(this.read_only);
|
||||||
await form.input_write(this.initial_value);
|
await form.input_write(this.initial_value);
|
||||||
|
|
||||||
target_element.appendChild(dom_root);
|
|
||||||
form.input_focus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
<div class="widget-event_edit">
|
|
||||||
</div>
|
|
||||||
|
|
@ -157,7 +157,6 @@ namespace _dali.widgets
|
||||||
"password": "",
|
"password": "",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
form.input_focus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,12 @@ namespace _dali.widgets
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
private entries : Array<type_entry_data>;
|
private entries : Array<
|
||||||
|
{
|
||||||
|
data : type_entry_data;
|
||||||
|
element : (null | HTMLElement);
|
||||||
|
}
|
||||||
|
>;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -58,7 +63,7 @@ namespace _dali.widgets
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public constructor(
|
public constructor(
|
||||||
entries : Array<type_entry_data>,
|
entry_data_list : Array<type_entry_data>,
|
||||||
{
|
{
|
||||||
"initial_groups": initial_groups = [],
|
"initial_groups": initial_groups = [],
|
||||||
"initial_label": initial_label = "",
|
"initial_label": initial_label = "",
|
||||||
|
|
@ -73,7 +78,14 @@ namespace _dali.widgets
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this.entries = entries;
|
this.entries = entry_data_list.map(
|
||||||
|
entry_data => (
|
||||||
|
{
|
||||||
|
"data": entry_data,
|
||||||
|
"element": null,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
);
|
||||||
this.initial_groups = initial_groups;
|
this.initial_groups = initial_groups;
|
||||||
this.label = initial_label;
|
this.label = initial_label;
|
||||||
this.container = null;
|
this.container = null;
|
||||||
|
|
@ -88,20 +100,17 @@ namespace _dali.widgets
|
||||||
: void
|
: void
|
||||||
{
|
{
|
||||||
this.entries.forEach(
|
this.entries.forEach(
|
||||||
(entry, index) => {
|
entry => {
|
||||||
const active : boolean = groups.some(group => entry.groups.includes(group));
|
const active : boolean = groups.some(group => entry.data.groups.includes(group));
|
||||||
const rel : string = index.toFixed(0);
|
entry.element.classList.toggle("widget-menu-entry-hidden", (! active));
|
||||||
const dom_entry = this.container.querySelector(".widget-menu-entry[rel=\"" + rel + "\"]");
|
|
||||||
dom_entry.classList.toggle("widget-menu-entry-hidden", (! active));
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public set_label(
|
public set_label(
|
||||||
label : (null | string)
|
label ?: string
|
||||||
)
|
)
|
||||||
: void
|
: void
|
||||||
{
|
{
|
||||||
|
|
@ -144,69 +153,56 @@ namespace _dali.widgets
|
||||||
)
|
)
|
||||||
: Promise<void>
|
: Promise<void>
|
||||||
{
|
{
|
||||||
// structure
|
// container
|
||||||
this.container = await _dali.helpers.element_from_template(
|
|
||||||
"widget-menu",
|
|
||||||
"main",
|
|
||||||
{
|
{
|
||||||
"entries": (
|
const dom_container : HTMLElement = document.createElement("div");
|
||||||
(
|
dom_container.classList.add("widget-menu");
|
||||||
await lib_plankton.call.promise_condense(
|
// button
|
||||||
this.entries.map(
|
|
||||||
(entry, index) => () => _dali.helpers.template_coin(
|
|
||||||
"widget-menu",
|
|
||||||
"entry",
|
|
||||||
{
|
{
|
||||||
"label": entry.label,
|
const dom_button : HTMLElement = document.createElement("button");
|
||||||
"rel": index.toFixed(0),
|
dom_button.textContent = "[" + this.label + "]";
|
||||||
}
|
dom_button.classList.add("widget-menu-button");
|
||||||
)
|
dom_button.addEventListener(
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.join("")
|
|
||||||
),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
// logic
|
|
||||||
{
|
|
||||||
// collapser
|
|
||||||
{
|
|
||||||
this.container.querySelector(".widget-menu-button").addEventListener(
|
|
||||||
"click",
|
"click",
|
||||||
() => {
|
() => {
|
||||||
this.toggle_collapsed();
|
this.toggle_collapsed();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
dom_container.classList.toggle("widget-menu-collapsed", true);
|
||||||
|
dom_container.appendChild(dom_button);
|
||||||
}
|
}
|
||||||
// entries
|
// platform
|
||||||
{
|
{
|
||||||
this.container.querySelectorAll(".widget-menu-entry").forEach(
|
const dom_platform : HTMLElement = document.createElement("div");
|
||||||
dom_entry => {
|
dom_platform.classList.add("widget-menu-platform");
|
||||||
|
{
|
||||||
|
const dom_list : HTMLElement = document.createElement("ul");
|
||||||
|
dom_list.classList.add("widget-menu-entries");
|
||||||
|
this.entries.forEach(
|
||||||
|
entry => {
|
||||||
|
const dom_entry : HTMLElement = document.createElement("li");
|
||||||
|
dom_entry.classList.add("widget-menu-entry");
|
||||||
|
dom_entry.textContent = entry.data.label;
|
||||||
dom_entry.addEventListener(
|
dom_entry.addEventListener(
|
||||||
"click",
|
"click",
|
||||||
() => {
|
() => {
|
||||||
const index : int = parseInt(dom_entry.getAttribute("rel"));
|
|
||||||
const entry : type_entry_data = this.entries[index];
|
|
||||||
this.toggle_collapsed({"mode": true});
|
this.toggle_collapsed({"mode": true});
|
||||||
entry.action();
|
entry.data.action();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
dom_list.appendChild(dom_entry);
|
||||||
|
entry.element = dom_entry;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
dom_platform.appendChild(dom_list);
|
||||||
}
|
}
|
||||||
|
dom_container.appendChild(dom_platform);
|
||||||
|
}
|
||||||
|
target_element.appendChild(dom_container);
|
||||||
|
this.container = dom_container;
|
||||||
}
|
}
|
||||||
|
|
||||||
// init
|
|
||||||
{
|
|
||||||
this.toggle_collapsed({"mode": true});
|
|
||||||
this.set_groups(this.initial_groups);
|
this.set_groups(this.initial_groups);
|
||||||
this.set_label(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
// finish
|
|
||||||
target_element.appendChild(this.container);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,7 @@
|
||||||
|
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
|
|
||||||
/*
|
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.widget-menu-platform:not(.widget-menu-platform-collapsed)
|
.widget-menu-platform:not(.widget-menu-platform-collapsed)
|
||||||
|
|
@ -55,20 +53,31 @@
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
background-color: hsl(var(--hue), 0%, 25%);
|
background-color: hsl(var(--hue), 0%, 25%);
|
||||||
color: hsl(var(--hue), 0%, 100%);
|
color: hsl(var(--hue), 0%, 100%);
|
||||||
}
|
|
||||||
|
|
||||||
.widget-menu-entry:not(:hover) > span
|
|
||||||
{
|
|
||||||
border-bottom: 2px solid hsl(0, 0%, 25%);
|
border-bottom: 2px solid hsl(0, 0%, 25%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.widget-menu-entry:hover > span
|
.widget-menu-entry:hover
|
||||||
{
|
{
|
||||||
|
color: hsl(var(--hue), 0%, 100%);
|
||||||
border-bottom: 2px solid hsl(0, 0%, 100%);
|
border-bottom: 2px solid hsl(0, 0%, 100%);
|
||||||
|
|
||||||
transition: 1s ease color;
|
transition: 1s ease color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
.widget-menu-entry
|
||||||
|
{
|
||||||
|
margin: 8px;
|
||||||
|
text-transform: capitalize;
|
||||||
|
}
|
||||||
|
|
||||||
|
.widget-menu-entry:not(:hover)
|
||||||
|
{
|
||||||
|
background-color: hsl(var(--hue), 0%, 25%);
|
||||||
|
color: hsl(var(--hue), 0%, 100%);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
.widget-menu-entry.widget-menu-entry-hidden
|
.widget-menu-entry.widget-menu-entry-hidden
|
||||||
{
|
{
|
||||||
display: none;
|
display: none;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
<li class="widget-menu-entry" rel="{{rel}}">
|
|
||||||
<span>{{label}}</span>
|
|
||||||
</li>
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
<div class="widget-menu">
|
|
||||||
<button class="widget-menu-button"></button>
|
|
||||||
<div class="widget-menu-platform">
|
|
||||||
<ul class="widget-menu-entries">
|
|
||||||
{{entries}}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
@ -78,8 +78,7 @@ namespace _dali.widgets
|
||||||
*/
|
*/
|
||||||
public async load(
|
public async load(
|
||||||
target_element : Element
|
target_element : Element
|
||||||
)
|
) : Promise<void>
|
||||||
: Promise<void>
|
|
||||||
{
|
{
|
||||||
target_element.innerHTML = await _dali.helpers.template_coin(
|
target_element.innerHTML = await _dali.helpers.template_coin(
|
||||||
"widget-mode_switcher",
|
"widget-mode_switcher",
|
||||||
|
|
|
||||||
|
|
@ -569,11 +569,7 @@ namespace _dali.widgets
|
||||||
this.get_entries,
|
this.get_entries,
|
||||||
{
|
{
|
||||||
"initial_view_mode": view_mode,
|
"initial_view_mode": view_mode,
|
||||||
"weekview_initial_vertical": (
|
"weekview_initial_vertical": (view_kind === _dali.enum_view_kind.touch),
|
||||||
(await _dali.model.settings()).weekview_vertical_default
|
|
||||||
||
|
|
||||||
(view_kind === _dali.enum_view_kind.touch)
|
|
||||||
),
|
|
||||||
"action_create_event": this.action_create_event,
|
"action_create_event": this.action_create_event,
|
||||||
"action_edit_event": this.action_edit_event,
|
"action_edit_event": this.action_edit_event,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,11 +52,6 @@ namespace _dali.widgets
|
||||||
private value : int;
|
private value : int;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private dom_root : (null | HTMLElement);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public constructor(
|
public constructor(
|
||||||
|
|
@ -85,19 +80,6 @@ namespace _dali.widgets
|
||||||
this.maximum = maximum;
|
this.maximum = maximum;
|
||||||
this.value = initial_value;
|
this.value = initial_value;
|
||||||
this.action_change = action_change;
|
this.action_change = action_change;
|
||||||
this.dom_root = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public set_value(
|
|
||||||
value : int
|
|
||||||
) : void
|
|
||||||
{
|
|
||||||
this.value = value;
|
|
||||||
const dom_input : HTMLInputElement = (this.dom_root.querySelector(".widget-special_number_input-input") as HTMLInputElement);
|
|
||||||
dom_input.value = value.toFixed(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -109,7 +91,8 @@ namespace _dali.widgets
|
||||||
)
|
)
|
||||||
: Promise<void>
|
: Promise<void>
|
||||||
{
|
{
|
||||||
const dom_root = await _dali.helpers.element_from_template(
|
const dom_dummy = document.createElement("div");
|
||||||
|
dom_dummy.innerHTML = await _dali.helpers.template_coin(
|
||||||
"widget-special_number_input",
|
"widget-special_number_input",
|
||||||
"main",
|
"main",
|
||||||
{
|
{
|
||||||
|
|
@ -117,21 +100,20 @@ namespace _dali.widgets
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const dom_input : HTMLInputElement = (dom_root.querySelector(".widget-special_number_input-input") as HTMLInputElement);
|
const dom_input : HTMLInputElement = (dom_dummy.querySelector(".widget-special_number_input-input") as HTMLInputElement);
|
||||||
|
|
||||||
// listeners
|
// listeners
|
||||||
{
|
{
|
||||||
dom_input.addEventListener(
|
dom_input.addEventListener(
|
||||||
"change",
|
"change",
|
||||||
() => {
|
() => {
|
||||||
const value : int = parseInt(dom_input.value);
|
this.value = parseInt(dom_input.value);
|
||||||
if (
|
if (
|
||||||
((this.minimum === null) || (value >= this.minimum))
|
((this.minimum === null) || (this.value >= this.minimum))
|
||||||
&&
|
&&
|
||||||
((this.maximum === null) || (value <= this.maximum))
|
((this.maximum === null) || (this.value <= this.maximum))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this.value = value;
|
|
||||||
this.action_change(this.value);
|
this.action_change(this.value);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -140,7 +122,7 @@ namespace _dali.widgets
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
dom_root.querySelector(".widget-special_number_input-prev").addEventListener(
|
dom_dummy.querySelector(".widget-special_number_input-prev").addEventListener(
|
||||||
"click",
|
"click",
|
||||||
() => {
|
() => {
|
||||||
if ((this.minimum === null) || (this.value > this.minimum))
|
if ((this.minimum === null) || (this.value > this.minimum))
|
||||||
|
|
@ -155,7 +137,7 @@ namespace _dali.widgets
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
dom_root.querySelector(".widget-special_number_input-next").addEventListener(
|
dom_dummy.querySelector(".widget-special_number_input-next").addEventListener(
|
||||||
"click",
|
"click",
|
||||||
() => {
|
() => {
|
||||||
if ((this.maximum === null) || (this.value < this.maximum))
|
if ((this.maximum === null) || (this.value < this.maximum))
|
||||||
|
|
@ -172,13 +154,9 @@ namespace _dali.widgets
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// content
|
|
||||||
{
|
|
||||||
dom_input.value = this.value.toFixed(0);
|
dom_input.value = this.value.toFixed(0);
|
||||||
}
|
|
||||||
|
|
||||||
target_element.appendChild(dom_root);
|
target_element.appendChild(dom_dummy.querySelector(".widget-special_number_input"));
|
||||||
this.dom_root = dom_root;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,12 +70,6 @@ namespace _dali.widgets
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* [setting]
|
|
||||||
*/
|
|
||||||
private show_begin_time : boolean;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [state]
|
* [state]
|
||||||
*/
|
*/
|
||||||
|
|
@ -125,7 +119,6 @@ namespace _dali.widgets
|
||||||
{
|
{
|
||||||
"action_select_day": action_select_day = ((date) => {}),
|
"action_select_day": action_select_day = ((date) => {}),
|
||||||
"action_select_event": action_select_event = ((event_key) => {}),
|
"action_select_event": action_select_event = ((event_key) => {}),
|
||||||
"show_begin_time": show_begin_time = true,
|
|
||||||
"vertical": vertical = false,
|
"vertical": vertical = false,
|
||||||
"initial_year": initial_year = null,
|
"initial_year": initial_year = null,
|
||||||
"initial_week": initial_week = null,
|
"initial_week": initial_week = null,
|
||||||
|
|
@ -147,7 +140,6 @@ namespace _dali.widgets
|
||||||
=>
|
=>
|
||||||
void
|
void
|
||||||
);
|
);
|
||||||
show_begin_time ?: boolean;
|
|
||||||
vertical ?: boolean;
|
vertical ?: boolean;
|
||||||
initial_year ?: (null | int);
|
initial_year ?: (null | int);
|
||||||
initial_week ?: (null | int);
|
initial_week ?: (null | int);
|
||||||
|
|
@ -164,29 +156,18 @@ namespace _dali.widgets
|
||||||
this.action_select_day = action_select_day;
|
this.action_select_day = action_select_day;
|
||||||
this.action_select_event = action_select_event;
|
this.action_select_event = action_select_event;
|
||||||
|
|
||||||
// settings
|
|
||||||
this.show_begin_time = show_begin_time;
|
|
||||||
|
|
||||||
// state
|
// state
|
||||||
// const ywd_now : lib_plankton.pit.type_ywd = lib_plankton.pit.to_ywd(lib_plankton.pit.now());
|
const ywd_now : lib_plankton.pit.type_ywd = lib_plankton.pit.to_ywd(lib_plankton.pit.now());
|
||||||
const ywd_begin : lib_plankton.pit.type_ywd = lib_plankton.call.convey(
|
|
||||||
lib_plankton.pit.now(),
|
|
||||||
[
|
|
||||||
x => lib_plankton.pit.shift_week(x, -1),
|
|
||||||
lib_plankton.pit.to_ywd,
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
this.vertical = vertical;
|
this.vertical = vertical;
|
||||||
this.year = (
|
this.year = (
|
||||||
initial_year
|
initial_year
|
||||||
??
|
??
|
||||||
ywd_begin.year
|
ywd_now.year
|
||||||
);
|
);
|
||||||
this.week = (
|
this.week = (
|
||||||
initial_week
|
initial_week
|
||||||
??
|
??
|
||||||
ywd_begin.week
|
Math.max(0, (ywd_now.week - 1))
|
||||||
);
|
);
|
||||||
this.count = initial_count;
|
this.count = initial_count;
|
||||||
this.event_map = lib_plankton.map.hashmap.implementation_map(
|
this.event_map = lib_plankton.map.hashmap.implementation_map(
|
||||||
|
|
@ -368,8 +349,8 @@ namespace _dali.widgets
|
||||||
);
|
);
|
||||||
entries.sort(
|
entries.sort(
|
||||||
(entry1, entry2) => {
|
(entry1, entry2) => {
|
||||||
const b1 : lib_plankton.pit.type_pit = lib_plankton.pit.from_datetime(entry1.event_object.begin);
|
const b1 : string = lib_plankton.pit.datetime_format(entry1.event_object.begin);
|
||||||
const b2 : lib_plankton.pit.type_pit = lib_plankton.pit.from_datetime(entry2.event_object.begin);
|
const b2 : string = lib_plankton.pit.datetime_format(entry2.event_object.begin);
|
||||||
return ((b1 <= b2) ? -1 : +1);
|
return ((b1 <= b2) ? -1 : +1);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -403,37 +384,13 @@ namespace _dali.widgets
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const dom_entry = await _dali.helpers.element_from_template(
|
let dom_dummy : HTMLElement = document.createElement("div");
|
||||||
|
dom_dummy.innerHTML = await _dali.helpers.template_coin(
|
||||||
"widget-weekview",
|
"widget-weekview",
|
||||||
"tableview-cell-entry",
|
"tableview-cell-entry",
|
||||||
{
|
{
|
||||||
"color": _dali.helpers.event_color(entry.hue),
|
"color": _dali.helpers.event_color(entry.hue),
|
||||||
"content": lib_plankton.string.coin(
|
|
||||||
(
|
|
||||||
(
|
|
||||||
this.show_begin_time
|
|
||||||
&&
|
|
||||||
(entry.event_object.begin.time === null)
|
|
||||||
)
|
|
||||||
?
|
|
||||||
"{{name}}"
|
|
||||||
:
|
|
||||||
"{{begin}} | {{name}}"
|
|
||||||
),
|
|
||||||
{
|
|
||||||
"begin": (
|
|
||||||
(entry.event_object.begin.time === null)
|
|
||||||
?
|
|
||||||
null
|
|
||||||
:
|
|
||||||
lib_plankton.pit.time_format(
|
|
||||||
entry.event_object.begin.time,
|
|
||||||
{"show_seconds": false}
|
|
||||||
)
|
|
||||||
),
|
|
||||||
"name": entry.event_object.name,
|
"name": entry.event_object.name,
|
||||||
}
|
|
||||||
),
|
|
||||||
"rel": entry.key,
|
"rel": entry.key,
|
||||||
"additional_classes": lib_plankton.string.coin(
|
"additional_classes": lib_plankton.string.coin(
|
||||||
" access_level-{{access_level}}",
|
" access_level-{{access_level}}",
|
||||||
|
|
@ -443,6 +400,7 @@ namespace _dali.widgets
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
const dom_entry : HTMLElement = dom_dummy.querySelector(".weekview-event_entry");
|
||||||
|
|
||||||
// listener
|
// listener
|
||||||
dom_entry.addEventListener(
|
dom_entry.addEventListener(
|
||||||
|
|
@ -635,8 +593,8 @@ namespace _dali.widgets
|
||||||
{
|
{
|
||||||
type type_row_data = Array<
|
type type_row_data = Array<
|
||||||
{
|
{
|
||||||
head : int;
|
week : int;
|
||||||
pits : Array<lib_plankton.pit.type_pit>;
|
day_pits : Array<lib_plankton.pit.type_pit>;
|
||||||
}
|
}
|
||||||
>;
|
>;
|
||||||
|
|
||||||
|
|
@ -656,23 +614,14 @@ namespace _dali.widgets
|
||||||
lib_plankton.translate.get("common.weekday.saturday"),
|
lib_plankton.translate.get("common.weekday.saturday"),
|
||||||
lib_plankton.translate.get("common.weekday.sunday"),
|
lib_plankton.translate.get("common.weekday.sunday"),
|
||||||
];
|
];
|
||||||
const row_data_horizontal : type_row_data = (
|
const row_data_original : type_row_data = (
|
||||||
lib_plankton.list.sequence(this.count)
|
lib_plankton.list.sequence(this.count)
|
||||||
.map(
|
.map(
|
||||||
offset => {
|
offset => {
|
||||||
const week : int = (this.week + offset);
|
const week : int = (this.week + offset);
|
||||||
const week_adjusted : int = lib_plankton.call.convey(
|
|
||||||
this.week,
|
|
||||||
[
|
|
||||||
x => lib_plankton.pit.from_ywd({"year": this.year, "week": x, "day": 2}),
|
|
||||||
x => lib_plankton.pit.shift_week(x, offset),
|
|
||||||
lib_plankton.pit.to_ywd,
|
|
||||||
x => x.week
|
|
||||||
]
|
|
||||||
);
|
|
||||||
return {
|
return {
|
||||||
"head": week_adjusted,
|
"week": week,
|
||||||
"pits": (
|
"day_pits": (
|
||||||
lib_plankton.list.sequence(7)
|
lib_plankton.list.sequence(7)
|
||||||
.map(
|
.map(
|
||||||
day => lib_plankton.pit.from_ywd(
|
day => lib_plankton.pit.from_ywd(
|
||||||
|
|
@ -691,13 +640,13 @@ namespace _dali.widgets
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
const row_data_vertical : type_row_data = (
|
const row_data_alternative : type_row_data = (
|
||||||
lib_plankton.list.sequence(7)
|
lib_plankton.list.sequence(7)
|
||||||
.map(
|
.map(
|
||||||
day_of_week => {
|
day_of_week => {
|
||||||
return {
|
return {
|
||||||
"head": day_of_week,
|
/*"day_of_week"*/"week": day_of_week,
|
||||||
"pits": (
|
/*"week_pits"*/"day_pits": (
|
||||||
lib_plankton.list.sequence(this.count)
|
lib_plankton.list.sequence(this.count)
|
||||||
.map(
|
.map(
|
||||||
offset => {
|
offset => {
|
||||||
|
|
@ -722,9 +671,9 @@ namespace _dali.widgets
|
||||||
const row_data : type_row_data = (
|
const row_data : type_row_data = (
|
||||||
(! this.vertical)
|
(! this.vertical)
|
||||||
?
|
?
|
||||||
row_data_horizontal
|
row_data_original
|
||||||
:
|
:
|
||||||
row_data_vertical
|
row_data_alternative
|
||||||
);
|
);
|
||||||
// head
|
// head
|
||||||
{
|
{
|
||||||
|
|
@ -766,16 +715,7 @@ namespace _dali.widgets
|
||||||
const dom_th = document.createElement("th");
|
const dom_th = document.createElement("th");
|
||||||
dom_th.classList.add("weekview-cell");
|
dom_th.classList.add("weekview-cell");
|
||||||
dom_th.classList.add("weekview-cell-day");
|
dom_th.classList.add("weekview-cell-day");
|
||||||
const week : int = lib_plankton.call.convey(
|
dom_th.textContent = (this.week + offset).toFixed(0).padStart(2, "0");
|
||||||
this.week,
|
|
||||||
[
|
|
||||||
x => lib_plankton.pit.from_ywd({"year": this.year, "week": x, "day": 2}),
|
|
||||||
x => lib_plankton.pit.shift_week(x, offset),
|
|
||||||
lib_plankton.pit.to_ywd,
|
|
||||||
x => x.week
|
|
||||||
]
|
|
||||||
);
|
|
||||||
dom_th.textContent = week.toFixed(0).padStart(2, "0");
|
|
||||||
dom_tr.appendChild(dom_th);
|
dom_tr.appendChild(dom_th);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -798,13 +738,13 @@ namespace _dali.widgets
|
||||||
"week": (
|
"week": (
|
||||||
(! this.vertical)
|
(! this.vertical)
|
||||||
?
|
?
|
||||||
row.head.toFixed(0).padStart(2, "0")
|
row.week.toFixed(0).padStart(2, "0")
|
||||||
:
|
:
|
||||||
day_names[index]
|
day_names[index]
|
||||||
),
|
),
|
||||||
"cells": (
|
"cells": (
|
||||||
await _dali.helpers.promise_row<string>(
|
await _dali.helpers.promise_row<string>(
|
||||||
row.pits
|
row.day_pits
|
||||||
.map(
|
.map(
|
||||||
(day_pit) => async () => {
|
(day_pit) => async () => {
|
||||||
const is_today : boolean = lib_plankton.pit.is_between(
|
const is_today : boolean = lib_plankton.pit.is_between(
|
||||||
|
|
@ -940,75 +880,42 @@ namespace _dali.widgets
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
let input_year : _dali.widgets.class_widget_special_number_input;
|
|
||||||
let input_week : _dali.widgets.class_widget_special_number_input;
|
|
||||||
// control:year
|
// control:year
|
||||||
{
|
{
|
||||||
input_year = new _dali.widgets.class_widget_special_number_input(
|
const widget : lib_plankton.zoo_widget.interface_widget = new _dali.widgets.class_widget_special_number_input(
|
||||||
{
|
{
|
||||||
"label": lib_plankton.translate.get("widget.weekview.controls.year"),
|
"label": lib_plankton.translate.get("widget.weekview.controls.year"),
|
||||||
"minimum": 1900,
|
"minimum": 1900,
|
||||||
"maximum": 2500,
|
"maximum": 2500,
|
||||||
"initial_value": this.year,
|
"initial_value": this.year,
|
||||||
"action_change": async (year_raw) => {
|
"action_change": async (value) => {
|
||||||
// model
|
this.year = value;
|
||||||
const number_of_weeks : int = await _dali.number_of_weeks(year_raw);
|
|
||||||
if (this.week > number_of_weeks)
|
|
||||||
{
|
|
||||||
this.year = year_raw;
|
|
||||||
this.week = number_of_weeks;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.year = year_raw;
|
|
||||||
// this.week = this.week;
|
|
||||||
}
|
|
||||||
|
|
||||||
// view
|
|
||||||
input_week.set_value(this.week);
|
|
||||||
await this.update_table();
|
await this.update_table();
|
||||||
await this.update_entries();
|
await this.update_entries();
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
await input_year.load(target_element.querySelector(".weekview-controls"));
|
await widget.load(target_element.querySelector(".weekview-controls"));
|
||||||
}
|
}
|
||||||
// control:week
|
// control:week
|
||||||
{
|
{
|
||||||
input_week = new _dali.widgets.class_widget_special_number_input(
|
const widget : lib_plankton.zoo_widget.interface_widget = new _dali.widgets.class_widget_special_number_input(
|
||||||
{
|
{
|
||||||
"label": lib_plankton.translate.get("widget.weekview.controls.week"),
|
"label": lib_plankton.translate.get("widget.weekview.controls.week"),
|
||||||
|
"minimum": 1,
|
||||||
|
/**
|
||||||
|
* @todo correct
|
||||||
|
*/
|
||||||
|
"maximum": 53,
|
||||||
"initial_value": this.week,
|
"initial_value": this.week,
|
||||||
"action_change": async (week_raw) => {
|
"action_change": async (value) => {
|
||||||
// model
|
this.week = value;
|
||||||
if (week_raw < 1)
|
|
||||||
{
|
|
||||||
this.year = (this.year - 1);
|
|
||||||
this.week = await _dali.number_of_weeks(this.year);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (week_raw > await _dali.number_of_weeks(this.year))
|
|
||||||
{
|
|
||||||
this.year = (this.year + 1);
|
|
||||||
this.week = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// this.year = this.year;
|
|
||||||
this.week = week_raw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// view
|
|
||||||
input_year.set_value(this.year);
|
|
||||||
input_week.set_value(this.week);
|
|
||||||
await this.update_table();
|
await this.update_table();
|
||||||
await this.update_entries();
|
await this.update_entries();
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
await input_week.load(target_element.querySelector(".weekview-controls"));
|
await widget.load(target_element.querySelector(".weekview-controls"));
|
||||||
}
|
}
|
||||||
// control:count
|
// control:count
|
||||||
/*
|
/*
|
||||||
|
|
@ -1031,14 +938,15 @@ namespace _dali.widgets
|
||||||
*/
|
*/
|
||||||
// control:vertical
|
// control:vertical
|
||||||
{
|
{
|
||||||
const dom_control = await _dali.helpers.element_from_template(
|
const dom_dummy : HTMLElement = document.createElement("div");
|
||||||
|
dom_dummy.innerHTML = await _dali.helpers.template_coin(
|
||||||
"widget-weekview",
|
"widget-weekview",
|
||||||
"control-vertical",
|
"control-vertical",
|
||||||
{
|
{
|
||||||
"label": lib_plankton.translate.get("widget.weekview.controls.vertical"),
|
"label": lib_plankton.translate.get("widget.weekview.controls.vertical"),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const dom_input : HTMLInputElement = (dom_control.querySelector("input") as HTMLInputElement);
|
const dom_input : HTMLInputElement = (dom_dummy.querySelector("input") as HTMLInputElement);
|
||||||
dom_input.addEventListener(
|
dom_input.addEventListener(
|
||||||
"change",
|
"change",
|
||||||
async () => {
|
async () => {
|
||||||
|
|
@ -1050,7 +958,7 @@ namespace _dali.widgets
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
dom_input.checked = this.vertical;
|
dom_input.checked = this.vertical;
|
||||||
target_element.querySelector(".weekview-controls").appendChild(dom_control);
|
target_element.querySelector(".weekview-controls").appendChild(dom_dummy.querySelector(".weekview-control-vertical"));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.container = target_element.querySelector(".weekview");
|
this.container = target_element.querySelector(".weekview");
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
<li class="weekview-event_entry{{additional_classes}}" style="background-color: {{color}};" rel="{{rel}}">
|
<li class="weekview-event_entry{{additional_classes}}" style="background-color: {{color}};" rel="{{rel}}">
|
||||||
{{content}}
|
{{name}}
|
||||||
</li>
|
</li>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
dir_lib := lib
|
dir_lib := lib
|
||||||
dir_source := source
|
dir_source := source
|
||||||
dir_temp := /tmp/dali-temp
|
dir_temp := /tmp/zeitbild-frontend-web-temp
|
||||||
dir_build := build
|
dir_build := build
|
||||||
dir_tools := tools
|
dir_tools := tools
|
||||||
|
|
||||||
|
|
@ -32,10 +32,7 @@ ${dir_build}/index.html: \
|
||||||
templates: \
|
templates: \
|
||||||
templates-widgets-special_number_input \
|
templates-widgets-special_number_input \
|
||||||
templates-widgets-login_oidc \
|
templates-widgets-login_oidc \
|
||||||
templates-widgets-menu \
|
|
||||||
templates-widgets-sources \
|
templates-widgets-sources \
|
||||||
templates-widgets-calendar_edit \
|
|
||||||
templates-widgets-event_edit \
|
|
||||||
templates-widgets-caldav \
|
templates-widgets-caldav \
|
||||||
templates-widgets-listview \
|
templates-widgets-listview \
|
||||||
templates-widgets-weekview \
|
templates-widgets-weekview \
|
||||||
|
|
@ -56,13 +53,6 @@ templates-widgets-login_oidc: \
|
||||||
@ ${cmd_mkdir} ${dir_build}/templates/widget-login_oidc
|
@ ${cmd_mkdir} ${dir_build}/templates/widget-login_oidc
|
||||||
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/login_oidc/templates/* ${dir_build}/templates/widget-login_oidc/
|
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/login_oidc/templates/* ${dir_build}/templates/widget-login_oidc/
|
||||||
|
|
||||||
.PHONY: templates-widgets-menu
|
|
||||||
templates-widgets-menu: \
|
|
||||||
$(wildcard ${dir_source}/widgets/menu/templates/*)
|
|
||||||
@ ${cmd_log} "templates:widget:menu …"
|
|
||||||
@ ${cmd_mkdir} ${dir_build}/templates/widget-menu
|
|
||||||
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/menu/templates/* ${dir_build}/templates/widget-menu/
|
|
||||||
|
|
||||||
.PHONY: templates-widgets-sources
|
.PHONY: templates-widgets-sources
|
||||||
templates-widgets-sources: \
|
templates-widgets-sources: \
|
||||||
$(wildcard ${dir_source}/widgets/sources/templates/*)
|
$(wildcard ${dir_source}/widgets/sources/templates/*)
|
||||||
|
|
@ -70,20 +60,6 @@ templates-widgets-sources: \
|
||||||
@ ${cmd_mkdir} ${dir_build}/templates/widget-sources
|
@ ${cmd_mkdir} ${dir_build}/templates/widget-sources
|
||||||
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/sources/templates/* ${dir_build}/templates/widget-sources/
|
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/sources/templates/* ${dir_build}/templates/widget-sources/
|
||||||
|
|
||||||
.PHONY: templates-widgets-calendar_edit
|
|
||||||
templates-widgets-calendar_edit: \
|
|
||||||
$(wildcard ${dir_source}/widgets/calendar_edit/templates/*)
|
|
||||||
@ ${cmd_log} "templates:widget:calendar_edit …"
|
|
||||||
@ ${cmd_mkdir} ${dir_build}/templates/widget-calendar_edit
|
|
||||||
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/calendar_edit/templates/* ${dir_build}/templates/widget-calendar_edit/
|
|
||||||
|
|
||||||
.PHONY: templates-widgets-event_edit
|
|
||||||
templates-widgets-event_edit: \
|
|
||||||
$(wildcard ${dir_source}/widgets/event_edit/templates/*)
|
|
||||||
@ ${cmd_log} "templates:widget:event_edit …"
|
|
||||||
@ ${cmd_mkdir} ${dir_build}/templates/widget-event_edit
|
|
||||||
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/event_edit/templates/* ${dir_build}/templates/widget-event_edit/
|
|
||||||
|
|
||||||
.PHONY: templates-widgets-caldav
|
.PHONY: templates-widgets-caldav
|
||||||
templates-widgets-caldav: \
|
templates-widgets-caldav: \
|
||||||
$(wildcard ${dir_source}/widgets/caldav/templates/*)
|
$(wildcard ${dir_source}/widgets/caldav/templates/*)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue