Merge branch 'temp-20251021'
This commit is contained in:
commit
b3a25c42d7
353
lib/plankton/plankton.d.ts
vendored
353
lib/plankton/plankton.d.ts
vendored
|
|
@ -226,9 +226,10 @@ declare namespace lib_plankton.base {
|
|||
function object_merge(core: Record<string, any>, mantle: Record<string, any>): Record<string, any>;
|
||||
/**
|
||||
*/
|
||||
function buffer_show(buffer: Buffer, { "block_size": option_block_size, "break_char": option_break_char, }?: {
|
||||
function buffer_show(buffer: Buffer, { "block_size": option_block_size, "break_char": option_break_char, "render_readable_characters": render_readable_characters, }?: {
|
||||
block_size?: int;
|
||||
break_char?: string;
|
||||
render_readable_characters?: boolean;
|
||||
}): string;
|
||||
}
|
||||
declare module lib_plankton.pod {
|
||||
|
|
@ -4224,6 +4225,59 @@ declare namespace lib_plankton.zoo_input {
|
|||
/**
|
||||
*/
|
||||
write(value: type_value): Promise<void>;
|
||||
/**
|
||||
*/
|
||||
lock(mode: boolean): Promise<void>;
|
||||
/**
|
||||
*/
|
||||
hook_change(action: (() => void)): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare namespace lib_plankton.zoo_input {
|
||||
/**
|
||||
* @author fenris
|
||||
*/
|
||||
abstract class class_input_simple<type_value> implements interface_input<type_value> {
|
||||
/**
|
||||
*/
|
||||
private dom_input;
|
||||
/**
|
||||
*/
|
||||
private type;
|
||||
/**
|
||||
*/
|
||||
private decode;
|
||||
/**
|
||||
*/
|
||||
private encode;
|
||||
/**
|
||||
*/
|
||||
private additional_attributes?;
|
||||
/**
|
||||
*/
|
||||
constructor(type: string, decode: ((representation: string) => type_value), encode: ((value: type_value) => string), { "additional_attributes": additional_attributes, }?: {
|
||||
additional_attributes?: Record<string, (null | string)>;
|
||||
});
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
setup(parent: HTMLElement): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
read(): Promise<type_value>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
write(value: type_value): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
lock(mode: boolean): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
hook_change(action: (() => void)): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare namespace lib_plankton.zoo_input {
|
||||
|
|
@ -4255,6 +4309,14 @@ declare namespace lib_plankton.zoo_input {
|
|||
* [implementation]
|
||||
*/
|
||||
write(value: type_value_outer): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
lock(mode: boolean): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
hook_change(action: (() => void)): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare namespace lib_plankton.zoo_input {
|
||||
|
|
@ -4262,6 +4324,9 @@ declare namespace lib_plankton.zoo_input {
|
|||
* @author fenris
|
||||
*/
|
||||
class class_input_soft<type_value_core> implements interface_input<(null | type_value_core)> {
|
||||
/**
|
||||
*/
|
||||
private read_only;
|
||||
/**
|
||||
*/
|
||||
private core;
|
||||
|
|
@ -4273,7 +4338,9 @@ declare namespace lib_plankton.zoo_input {
|
|||
private dom_wrapper;
|
||||
/**
|
||||
*/
|
||||
constructor(core: interface_input<type_value_core>, options?: {});
|
||||
constructor(core: interface_input<type_value_core>, { "read_only": read_only, }?: {
|
||||
read_only?: boolean;
|
||||
});
|
||||
/**
|
||||
*/
|
||||
private toggle;
|
||||
|
|
@ -4289,6 +4356,14 @@ declare namespace lib_plankton.zoo_input {
|
|||
* [implementation]
|
||||
*/
|
||||
write(value: (null | type_value_core)): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
lock(mode: boolean): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
hook_change(action: (() => void)): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare namespace lib_plankton.zoo_input {
|
||||
|
|
@ -4304,7 +4379,7 @@ declare namespace lib_plankton.zoo_input {
|
|||
private value;
|
||||
/**
|
||||
*/
|
||||
constructor(options?: {
|
||||
constructor({ "initial_value": initial_value, }?: {
|
||||
initial_value?: any;
|
||||
});
|
||||
/**
|
||||
|
|
@ -4319,6 +4394,14 @@ declare namespace lib_plankton.zoo_input {
|
|||
* [implementation]
|
||||
*/
|
||||
write(value: any): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
lock(mode: boolean): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
hook_change(action: (() => void)): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare namespace lib_plankton.zoo_input {
|
||||
|
|
@ -4326,61 +4409,22 @@ declare namespace lib_plankton.zoo_input {
|
|||
* @author fenris
|
||||
* @todo abstract
|
||||
*/
|
||||
class class_input_text implements interface_input<string> {
|
||||
class class_input_text extends class_input_simple<string> implements interface_input<string> {
|
||||
/**
|
||||
*/
|
||||
private read_only;
|
||||
/**
|
||||
*/
|
||||
private pattern;
|
||||
/**
|
||||
*/
|
||||
/**
|
||||
*/
|
||||
private dom_input;
|
||||
/**
|
||||
*/
|
||||
constructor(options?: {
|
||||
read_only?: boolean;
|
||||
constructor({ "pattern": pattern, }?: {
|
||||
pattern?: (null | string);
|
||||
});
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
setup(parent: HTMLElement): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
read(): Promise<string>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
write(value: string): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare namespace lib_plankton.zoo_input {
|
||||
/**
|
||||
* @author fenris
|
||||
*/
|
||||
class class_input_email implements interface_input<string> {
|
||||
/**
|
||||
*/
|
||||
private dom_input;
|
||||
class class_input_email extends class_input_simple<string> implements interface_input<string> {
|
||||
/**
|
||||
*/
|
||||
constructor();
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
setup(parent: HTMLElement): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
read(): Promise<string>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
write(value: string): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare namespace lib_plankton.zoo_input {
|
||||
|
|
@ -4406,6 +4450,14 @@ declare namespace lib_plankton.zoo_input {
|
|||
* [implementation]
|
||||
*/
|
||||
write(value: string): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
lock(mode: boolean): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
hook_change(action: (() => void)): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare namespace lib_plankton.zoo_input {
|
||||
|
|
@ -4421,7 +4473,7 @@ declare namespace lib_plankton.zoo_input {
|
|||
private dom_input;
|
||||
/**
|
||||
*/
|
||||
constructor(options?: {
|
||||
constructor({ "required": required, }?: {
|
||||
required?: boolean;
|
||||
});
|
||||
/**
|
||||
|
|
@ -4436,6 +4488,14 @@ declare namespace lib_plankton.zoo_input {
|
|||
* [implementation]
|
||||
*/
|
||||
write(value: (null | lib_plankton.pit.type_date)): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
lock(mode: boolean): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
hook_change(action: (() => void)): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare namespace lib_plankton.zoo_input {
|
||||
|
|
@ -4443,34 +4503,12 @@ declare namespace lib_plankton.zoo_input {
|
|||
* @author fenris
|
||||
* @todo abstract
|
||||
*/
|
||||
class class_input_number implements interface_input<number> {
|
||||
class class_input_number extends class_input_simple<number> implements interface_input<number> {
|
||||
/**
|
||||
*/
|
||||
private read_only;
|
||||
/**
|
||||
*/
|
||||
private step;
|
||||
/**
|
||||
*/
|
||||
private dom_input;
|
||||
/**
|
||||
*/
|
||||
constructor(options?: {
|
||||
read_only?: boolean;
|
||||
constructor({ "step": step, }?: {
|
||||
step?: (null | float);
|
||||
});
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
setup(parent: HTMLElement): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
read(): Promise<number>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
write(value: number): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare namespace lib_plankton.zoo_input {
|
||||
|
|
@ -4478,21 +4516,12 @@ declare namespace lib_plankton.zoo_input {
|
|||
* @author fenris
|
||||
*/
|
||||
class class_input_checkbox implements interface_input<boolean> {
|
||||
/**
|
||||
*/
|
||||
private read_only;
|
||||
/**
|
||||
*/
|
||||
private dom_input;
|
||||
/**
|
||||
*/
|
||||
private hooks_change;
|
||||
/**
|
||||
*/
|
||||
constructor(options?: {
|
||||
read_only?: boolean;
|
||||
hooks_change?: Array<((value: boolean) => void)>;
|
||||
});
|
||||
constructor();
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
|
|
@ -4505,6 +4534,14 @@ declare namespace lib_plankton.zoo_input {
|
|||
* [implementation]
|
||||
*/
|
||||
write(value: boolean): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
lock(mode: boolean): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
hook_change(action: (() => void)): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare namespace lib_plankton.zoo_input {
|
||||
|
|
@ -4536,13 +4573,27 @@ declare namespace lib_plankton.zoo_input {
|
|||
* [implementation]
|
||||
*/
|
||||
write(value: string): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
lock(mode: boolean): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
hook_change(action: (() => void)): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare namespace lib_plankton.zoo_input {
|
||||
/**
|
||||
* @author fenris
|
||||
*/
|
||||
class class_input_enumeration implements interface_input<string> {
|
||||
class class_input_enumeration<type_value> implements interface_input<type_value> {
|
||||
/**
|
||||
*/
|
||||
private encode_value;
|
||||
/**
|
||||
*/
|
||||
private decode_value;
|
||||
/**
|
||||
*/
|
||||
private options;
|
||||
|
|
@ -4551,8 +4602,8 @@ declare namespace lib_plankton.zoo_input {
|
|||
private dom_inputs;
|
||||
/**
|
||||
*/
|
||||
constructor(options: Array<{
|
||||
value: string;
|
||||
constructor(encode_value: ((value: type_value) => string), decode_value: ((representation: string) => type_value), options: Array<{
|
||||
value: type_value;
|
||||
label: string;
|
||||
}>);
|
||||
/**
|
||||
|
|
@ -4563,11 +4614,19 @@ declare namespace lib_plankton.zoo_input {
|
|||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
read(): Promise<string>;
|
||||
read(): Promise<type_value>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
write(value: string): Promise<void>;
|
||||
write(value: type_value): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
lock(mode: boolean): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
hook_change(action: (() => void)): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare namespace lib_plankton.zoo_input {
|
||||
|
|
@ -4598,7 +4657,10 @@ declare namespace lib_plankton.zoo_input {
|
|||
private translations;
|
||||
/**
|
||||
*/
|
||||
constructor(element_input_factory: (() => interface_input<type_element>), options?: {
|
||||
private locked;
|
||||
/**
|
||||
*/
|
||||
constructor(element_input_factory: (() => interface_input<type_element>), { "read_only": read_only, "translations": translations, }?: {
|
||||
read_only?: boolean;
|
||||
translations?: type_translations;
|
||||
});
|
||||
|
|
@ -4620,6 +4682,14 @@ declare namespace lib_plankton.zoo_input {
|
|||
* [implementation]
|
||||
*/
|
||||
write(value: Array<type_element>): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
lock(mode: boolean): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
hook_change(action: (() => void)): Promise<void>;
|
||||
}
|
||||
export {};
|
||||
}
|
||||
|
|
@ -4656,6 +4726,14 @@ declare namespace lib_plankton.zoo_input {
|
|||
* [implementation]
|
||||
*/
|
||||
write(value: Set<string>): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
lock(mode: boolean): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
hook_change(action: (() => void)): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare namespace lib_plankton.zoo_input {
|
||||
|
|
@ -4700,6 +4778,14 @@ declare namespace lib_plankton.zoo_input {
|
|||
* [implementation]
|
||||
*/
|
||||
write(value: string): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
lock(mode: boolean): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
hook_change(action: (() => void)): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare namespace lib_plankton.zoo_input {
|
||||
|
|
@ -4715,7 +4801,15 @@ declare namespace lib_plankton.zoo_input {
|
|||
private value;
|
||||
/**
|
||||
*/
|
||||
constructor();
|
||||
private symbols;
|
||||
/**
|
||||
*/
|
||||
constructor({ "symbols": symbols, }?: {
|
||||
symbols?: {
|
||||
yes: string;
|
||||
no: string;
|
||||
};
|
||||
});
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
|
|
@ -4728,31 +4822,24 @@ declare namespace lib_plankton.zoo_input {
|
|||
* [implementation]
|
||||
*/
|
||||
write(value: boolean): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
lock(mode: boolean): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
hook_change(action: (() => void)): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare namespace lib_plankton.zoo_input {
|
||||
/**
|
||||
* @author fenris
|
||||
*/
|
||||
class class_input_time implements interface_input<(null | lib_plankton.pit.type_time)> {
|
||||
/**
|
||||
*/
|
||||
private dom_input;
|
||||
class class_input_time extends class_input_simple<(null | lib_plankton.pit.type_time)> implements interface_input<(null | lib_plankton.pit.type_time)> {
|
||||
/**
|
||||
*/
|
||||
constructor();
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
setup(parent: HTMLElement): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
read(): Promise<(null | lib_plankton.pit.type_time)>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
write(value: (null | lib_plankton.pit.type_time)): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare namespace lib_plankton.zoo_input {
|
||||
|
|
@ -4783,12 +4870,20 @@ declare namespace lib_plankton.zoo_input {
|
|||
* [implementation]
|
||||
*/
|
||||
write(value: type_record): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
lock(mode: boolean): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
hook_change(action: (() => void)): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare namespace lib_plankton.zoo_input {
|
||||
/**
|
||||
*/
|
||||
class class_input_hashmap<type_key, type_value> implements lib_plankton.zoo_input.interface_input<lib_plankton.map.type_map<type_key, type_value>> {
|
||||
class class_input_hashmap<type_key, type_value> implements interface_input<lib_plankton.map.type_map<type_key, type_value>> {
|
||||
/**
|
||||
*/
|
||||
private hash_key;
|
||||
|
|
@ -4797,7 +4892,7 @@ declare namespace lib_plankton.zoo_input {
|
|||
private core;
|
||||
/**
|
||||
*/
|
||||
constructor(hash_key: ((key: type_key) => string), key_input_factory: (() => lib_plankton.zoo_input.interface_input<type_key>), value_input_factory: (() => lib_plankton.zoo_input.interface_input<type_value>));
|
||||
constructor(hash_key: ((key: type_key) => string), key_input_factory: (() => interface_input<type_key>), value_input_factory: (() => interface_input<type_value>));
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
|
|
@ -4810,6 +4905,14 @@ declare namespace lib_plankton.zoo_input {
|
|||
* [implementation]
|
||||
*/
|
||||
write(map: lib_plankton.map.type_map<type_key, type_value>): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
lock(mode: boolean): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
hook_change(action: (() => void)): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare namespace lib_plankton.zoo_input {
|
||||
|
|
@ -4835,6 +4938,14 @@ declare namespace lib_plankton.zoo_input {
|
|||
/**
|
||||
*/
|
||||
write(value: lib_plankton.pit.type_datetime): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
lock(mode: boolean): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
hook_change(action: (() => void)): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare namespace lib_plankton.zoo_input {
|
||||
|
|
@ -4847,7 +4958,7 @@ declare namespace lib_plankton.zoo_input {
|
|||
private core;
|
||||
/**
|
||||
*/
|
||||
constructor(options?: {
|
||||
constructor({ "label_date": label_date, "label_time": label_time, }?: {
|
||||
label_date?: string;
|
||||
label_time?: string;
|
||||
});
|
||||
|
|
@ -4860,30 +4971,23 @@ declare namespace lib_plankton.zoo_input {
|
|||
/**
|
||||
*/
|
||||
write(value: lib_plankton.pit.type_datetime): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
lock(mode: boolean): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
hook_change(action: (() => void)): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare namespace lib_plankton.zoo_input {
|
||||
/**
|
||||
*/
|
||||
class class_input_color implements interface_input<(null | lib_plankton.color.type_color)> {
|
||||
/**
|
||||
*/
|
||||
private dom_input;
|
||||
class class_input_color extends class_input_simple<(null | lib_plankton.color.type_color)> implements interface_input<(null | lib_plankton.color.type_color)> {
|
||||
/**
|
||||
*/
|
||||
constructor();
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
setup(parent: HTMLElement): Promise<void>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
read(): Promise<(null | lib_plankton.color.type_color)>;
|
||||
/**
|
||||
* [implementation]
|
||||
*/
|
||||
write(value: (null | lib_plankton.color.type_color)): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare namespace lib_plankton.zoo_input {
|
||||
|
|
@ -4919,7 +5023,7 @@ declare namespace lib_plankton.zoo_form {
|
|||
name: string;
|
||||
type: string;
|
||||
label?: (null | string);
|
||||
}>, encode: ((value: type_value) => Record<string, string>), decode: ((raw: Record<string, string>) => type_value), options?: {
|
||||
}>, encode: ((value: type_value) => Record<string, string>), decode: ((raw: Record<string, string>) => type_value), { "class_prefix": class_prefix, }?: {
|
||||
class_prefix?: string;
|
||||
}): type_form<type_value>;
|
||||
/**
|
||||
|
|
@ -4984,6 +5088,9 @@ declare namespace lib_plankton.zoo_form {
|
|||
/**
|
||||
*/
|
||||
input_write(value: type_value): Promise<void>;
|
||||
/**
|
||||
*/
|
||||
input_lock(mode: boolean): Promise<void>;
|
||||
}
|
||||
export {};
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -36,13 +36,18 @@ namespace _dali.pages.overview
|
|||
}
|
||||
|
||||
/**
|
||||
* @todo add return type
|
||||
*/
|
||||
async function get_available_calendars(
|
||||
)
|
||||
: Promise<
|
||||
Array<
|
||||
_dali.type_calendar_object_reduced_with_id
|
||||
>
|
||||
>
|
||||
{
|
||||
return (
|
||||
(await _dali.model.calendar_list())
|
||||
/*
|
||||
.filter(
|
||||
(entry) => (
|
||||
(entry.access_level === _dali.enum_access_level.edit)
|
||||
|
|
@ -50,6 +55,7 @@ namespace _dali.pages.overview
|
|||
(entry.access_level === _dali.enum_access_level.admin)
|
||||
)
|
||||
)
|
||||
*/
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -131,6 +137,29 @@ namespace _dali.pages.overview
|
|||
{
|
||||
const widget = new _dali.widgets.calendar_edit.class_widget_calendar_edit(
|
||||
await _dali.model.user_list(),
|
||||
{
|
||||
"name": "",
|
||||
"hue": lib_plankton.random.generate_unit(),
|
||||
"access": {
|
||||
"public": false,
|
||||
"default_level": _dali.enum_access_level.view,
|
||||
"attributed": lib_plankton.map.hashmap.implementation_map<
|
||||
_dali.type_user_id,
|
||||
_dali.enum_access_level
|
||||
>(
|
||||
lib_plankton.map.hashmap.make<
|
||||
_dali.type_user_id,
|
||||
_dali.enum_access_level
|
||||
>(
|
||||
user_id => user_id.toFixed(0),
|
||||
)
|
||||
),
|
||||
},
|
||||
/**
|
||||
* @todo
|
||||
*/
|
||||
"resource_id": 0,
|
||||
},
|
||||
{
|
||||
"read_only": false,
|
||||
"action_cancel": () => {
|
||||
|
|
@ -155,7 +184,6 @@ namespace _dali.pages.overview
|
|||
}
|
||||
);
|
||||
},
|
||||
"initial_value": null,
|
||||
}
|
||||
);
|
||||
_dali.overlay.clear();
|
||||
|
|
@ -163,6 +191,88 @@ namespace _dali.pages.overview
|
|||
await widget.load(_dali.overlay.get_content_element());
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async function action_edit_calendar(
|
||||
calendar_object_reduced_with_id : type_calendar_object_reduced_with_id
|
||||
)
|
||||
: Promise<void>
|
||||
{
|
||||
const read_only : boolean = (() => {
|
||||
switch (calendar_object_reduced_with_id.access_level)
|
||||
{
|
||||
case _dali.enum_access_level.none:
|
||||
{
|
||||
throw (new Error("this event should not be visible"));
|
||||
break;
|
||||
}
|
||||
case _dali.enum_access_level.edit:
|
||||
case _dali.enum_access_level.view:
|
||||
{
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
case _dali.enum_access_level.admin:
|
||||
{
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}) ();
|
||||
if (read_only)
|
||||
{
|
||||
lib_plankton.log.notice(
|
||||
"dali.overview.may_not_edit_calendar",
|
||||
{
|
||||
"calendar_id": calendar_object_reduced_with_id.id,
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
const calendar_id : _dali.type_calendar_id = calendar_object_reduced_with_id.id;
|
||||
const calendar_object : _dali.type_calendar_object = await _dali.model.calendar_get(
|
||||
calendar_id
|
||||
);
|
||||
const widget = new _dali.widgets.calendar_edit.class_widget_calendar_edit(
|
||||
await _dali.model.user_list(),
|
||||
calendar_object,
|
||||
{
|
||||
"read_only": read_only,
|
||||
"action_cancel": () => {
|
||||
_dali.overlay.toggle({"mode": false});
|
||||
},
|
||||
"action_change": (data) => {
|
||||
_dali.model.calendar_change(
|
||||
calendar_id,
|
||||
data
|
||||
)
|
||||
.then(
|
||||
() => {
|
||||
update_sources_and_entries();
|
||||
_dali.overlay.toggle({"mode": false});
|
||||
}
|
||||
);
|
||||
},
|
||||
"action_remove": (data) => {
|
||||
_dali.model.calendar_remove(
|
||||
calendar_id
|
||||
)
|
||||
.then(
|
||||
() => {
|
||||
update_sources_and_entries();
|
||||
_dali.overlay.toggle({"mode": false});
|
||||
}
|
||||
);
|
||||
},
|
||||
}
|
||||
);
|
||||
_dali.overlay.clear();
|
||||
_dali.overlay.toggle({"mode": true});
|
||||
await widget.load(_dali.overlay.get_content_element());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @todo unterschiedliches Verhalten bei Anmeldung?
|
||||
*/
|
||||
|
|
@ -253,118 +363,102 @@ namespace _dali.pages.overview
|
|||
|
||||
/**
|
||||
*/
|
||||
async function action_select_event
|
||||
async function action_edit_event
|
||||
(
|
||||
event_key : _dali.type_event_key
|
||||
)
|
||||
: Promise<void>
|
||||
{
|
||||
const event_object_extended : _dali.type_event_object_extended = await _dali.model.event_get(event_key);
|
||||
const calendar_id = event_object_extended.calendar_id;
|
||||
const access_level = event_object_extended.access_level;
|
||||
const event_id = event_object_extended.event_id;
|
||||
/*
|
||||
if (! _dali.is_logged_in())
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
*/
|
||||
let read_only : boolean;
|
||||
switch (access_level)
|
||||
{
|
||||
case _dali.enum_access_level.none:
|
||||
const read_only : boolean = (() => {
|
||||
switch (event_object_extended.access_level)
|
||||
{
|
||||
throw (new Error("this event should not be visible"));
|
||||
break;
|
||||
}
|
||||
case _dali.enum_access_level.view:
|
||||
{
|
||||
read_only = true;
|
||||
break;
|
||||
}
|
||||
case _dali.enum_access_level.edit:
|
||||
case _dali.enum_access_level.admin:
|
||||
{
|
||||
read_only = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
(async () => {
|
||||
const event_object : _dali.type_event_object = await _dali.backend.calendar_event_get(
|
||||
calendar_id,
|
||||
event_id
|
||||
);
|
||||
const widget = new _dali.widgets.event_edit.class_widget_event_edit(
|
||||
(await get_available_calendars()),
|
||||
case _dali.enum_access_level.none:
|
||||
{
|
||||
"calendar_id": calendar_id,
|
||||
"event_name": event_object.name,
|
||||
"event_begin": event_object.begin,
|
||||
"event_end": event_object.end,
|
||||
"event_location": event_object.location,
|
||||
"event_link": event_object.link,
|
||||
"event_description": event_object.description,
|
||||
},
|
||||
{
|
||||
"read_only": read_only,
|
||||
"action_cancel": () => {
|
||||
_dali.overlay.toggle({"mode": false});
|
||||
},
|
||||
"action_change": (data) => {
|
||||
_dali.model.event_change(
|
||||
event_key,
|
||||
{
|
||||
"name": data.event_name,
|
||||
"begin": data.event_begin,
|
||||
"end": data.event_end,
|
||||
"location": data.event_location,
|
||||
"link": data.event_link,
|
||||
"description": data.event_description,
|
||||
}
|
||||
)
|
||||
.then(
|
||||
() => {
|
||||
update_entries();
|
||||
_dali.overlay.toggle({"mode": false});
|
||||
}
|
||||
)
|
||||
.catch(
|
||||
(reason) => {
|
||||
lib_plankton.log.warning(
|
||||
"dali.overview.event_change.error",
|
||||
{"reason": String(reason)}
|
||||
);
|
||||
}
|
||||
);
|
||||
},
|
||||
"action_remove": () => {
|
||||
_dali.model.event_remove(
|
||||
event_key
|
||||
)
|
||||
.then(
|
||||
() => {
|
||||
update_entries();
|
||||
_dali.overlay.toggle({"mode": false});
|
||||
}
|
||||
)
|
||||
.catch(
|
||||
(reason) => {
|
||||
lib_plankton.log.warning(
|
||||
"dali.overview.event_remove_error",
|
||||
{"reason": String(reason)}
|
||||
);
|
||||
}
|
||||
);
|
||||
},
|
||||
throw (new Error("this event should not be visible"));
|
||||
break;
|
||||
}
|
||||
);
|
||||
_dali.overlay.clear();
|
||||
_dali.overlay.toggle({"mode": true});
|
||||
await widget.load(_dali.overlay.get_content_element());
|
||||
case _dali.enum_access_level.view:
|
||||
{
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
case _dali.enum_access_level.edit:
|
||||
case _dali.enum_access_level.admin:
|
||||
{
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}) ();
|
||||
const widget = new _dali.widgets.event_edit.class_widget_event_edit(
|
||||
(await get_available_calendars()),
|
||||
{
|
||||
"calendar_id": event_object_extended.calendar_id,
|
||||
"event_name": event_object_extended.event_object.name,
|
||||
"event_begin": event_object_extended.event_object.begin,
|
||||
"event_end": event_object_extended.event_object.end,
|
||||
"event_location": event_object_extended.event_object.location,
|
||||
"event_link": event_object_extended.event_object.link,
|
||||
"event_description": event_object_extended.event_object.description,
|
||||
},
|
||||
{
|
||||
"read_only": read_only,
|
||||
"action_cancel": () => {
|
||||
_dali.overlay.toggle({"mode": false});
|
||||
},
|
||||
"action_change": (data) => {
|
||||
_dali.model.event_change(
|
||||
event_key,
|
||||
{
|
||||
"name": data.event_name,
|
||||
"begin": data.event_begin,
|
||||
"end": data.event_end,
|
||||
"location": data.event_location,
|
||||
"link": data.event_link,
|
||||
"description": data.event_description,
|
||||
}
|
||||
)
|
||||
.then(
|
||||
() => {
|
||||
update_entries();
|
||||
_dali.overlay.toggle({"mode": false});
|
||||
}
|
||||
)
|
||||
.catch(
|
||||
(reason) => {
|
||||
lib_plankton.log.warning(
|
||||
"dali.overview.event_change.error",
|
||||
{"reason": String(reason)}
|
||||
);
|
||||
}
|
||||
);
|
||||
},
|
||||
"action_remove": () => {
|
||||
_dali.model.event_remove(
|
||||
event_key
|
||||
)
|
||||
.then(
|
||||
() => {
|
||||
update_entries();
|
||||
_dali.overlay.toggle({"mode": false});
|
||||
}
|
||||
)
|
||||
.catch(
|
||||
(reason) => {
|
||||
lib_plankton.log.warning(
|
||||
"dali.overview.event_remove_error",
|
||||
{"reason": String(reason)}
|
||||
);
|
||||
}
|
||||
);
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
_dali.overlay.clear();
|
||||
_dali.overlay.toggle({"mode": true});
|
||||
await widget.load(_dali.overlay.get_content_element());
|
||||
}
|
||||
|
||||
// hint
|
||||
|
|
@ -412,72 +506,9 @@ namespace _dali.pages.overview
|
|||
_dali.model.calendar_list,
|
||||
{
|
||||
"initial_priviliged": _dali.is_logged_in(),
|
||||
"action_create": action_create_calendar,
|
||||
"action_open": (entry) => {
|
||||
let read_only : boolean;
|
||||
switch (entry.access_level)
|
||||
{
|
||||
case _dali.enum_access_level.none:
|
||||
{
|
||||
throw (new Error("this event should not be visible"));
|
||||
break;
|
||||
}
|
||||
case _dali.enum_access_level.edit:
|
||||
case _dali.enum_access_level.view:
|
||||
{
|
||||
read_only = true;
|
||||
break;
|
||||
}
|
||||
case _dali.enum_access_level.admin:
|
||||
{
|
||||
read_only = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
(async () => {
|
||||
const calendar_id : _dali.type_calendar_id = entry.id;
|
||||
const calendar_object : _dali.type_calendar_object = await _dali.model.calendar_get(
|
||||
calendar_id
|
||||
);
|
||||
const widget = new _dali.widgets.calendar_edit.class_widget_calendar_edit(
|
||||
await _dali.model.user_list(),
|
||||
{
|
||||
"read_only": read_only,
|
||||
"action_cancel": () => {
|
||||
_dali.overlay.toggle({"mode": false});
|
||||
},
|
||||
"action_change": (data) => {
|
||||
_dali.model.calendar_change(
|
||||
calendar_id,
|
||||
data
|
||||
)
|
||||
.then(
|
||||
() => {
|
||||
update_sources_and_entries();
|
||||
_dali.overlay.toggle({"mode": false});
|
||||
}
|
||||
);
|
||||
},
|
||||
"action_remove": (data) => {
|
||||
_dali.model.calendar_remove(
|
||||
calendar_id
|
||||
)
|
||||
.then(
|
||||
() => {
|
||||
update_sources_and_entries();
|
||||
_dali.overlay.toggle({"mode": false});
|
||||
}
|
||||
);
|
||||
},
|
||||
"initial_value": calendar_object,
|
||||
}
|
||||
);
|
||||
_dali.overlay.clear();
|
||||
_dali.overlay.toggle({"mode": true});
|
||||
await widget.load(_dali.overlay.get_content_element());
|
||||
}) ();
|
||||
},
|
||||
"action_toggle_visibility": (entry, mode) => {
|
||||
"action_add": action_create_calendar,
|
||||
"action_select": (entry) => action_edit_calendar(entry),
|
||||
"action_toggle": (entry, mode) => {
|
||||
widget_weekview.toggle_visibility(entry.id, {"mode": mode});
|
||||
widget_listview.toggle_visibility(entry.id, {"mode": mode});
|
||||
},
|
||||
|
|
@ -492,7 +523,7 @@ namespace _dali.pages.overview
|
|||
new _dali.widgets.weekview.class_widget_weekview(
|
||||
get_entries,
|
||||
{
|
||||
"action_select_event": (event_key) => action_select_event(event_key),
|
||||
"action_select_event": (event_key) => action_edit_event(event_key),
|
||||
"action_select_day": (date) => action_create_event({"date": date}),
|
||||
}
|
||||
)
|
||||
|
|
@ -506,7 +537,7 @@ namespace _dali.pages.overview
|
|||
new _dali.widgets.listview.class_widget_listview(
|
||||
get_entries,
|
||||
{
|
||||
"action_select": (event_key) => action_select_event(event_key),
|
||||
"action_select": (event_key) => action_edit_event(event_key),
|
||||
"action_add": () => action_create_event(),
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -39,20 +39,20 @@ namespace _dali.widgets.calendar_edit
|
|||
|
||||
/**
|
||||
*/
|
||||
private initial_value : (null | _dali.type_calendar_object);
|
||||
private initial_value : _dali.type_calendar_object;
|
||||
|
||||
|
||||
/**
|
||||
*/
|
||||
public constructor(
|
||||
users : Array<{id : _dali.type_user_id; name : string;}>,
|
||||
initial_value : _dali.type_calendar_object,
|
||||
{
|
||||
"read_only": read_only = false,
|
||||
"action_cancel": action_cancel = null,
|
||||
"action_add": action_add = null,
|
||||
"action_change": action_change = null,
|
||||
"action_remove": action_remove = null,
|
||||
"initial_value": initial_value = null,
|
||||
}
|
||||
:
|
||||
{
|
||||
|
|
@ -61,7 +61,6 @@ namespace _dali.widgets.calendar_edit
|
|||
action_add ?: (null | ((value : _dali.type_calendar_object) => void))
|
||||
action_change ?: (null | ((value : _dali.type_calendar_object) => void));
|
||||
action_remove ?: (null | ((value : _dali.type_calendar_object) => void));
|
||||
initial_value ?: (null | _dali.type_calendar_object);
|
||||
}
|
||||
=
|
||||
{
|
||||
|
|
@ -69,12 +68,12 @@ namespace _dali.widgets.calendar_edit
|
|||
)
|
||||
{
|
||||
this.users = users;
|
||||
this.initial_value = initial_value;
|
||||
this.read_only = read_only;
|
||||
this.action_cancel = action_cancel;
|
||||
this.action_add = action_add;
|
||||
this.action_change = action_change;
|
||||
this.action_remove = action_remove;
|
||||
this.initial_value = initial_value;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -213,35 +212,8 @@ namespace _dali.widgets.calendar_edit
|
|||
)
|
||||
);
|
||||
await form.setup(target_element);
|
||||
await form.input_write(
|
||||
(! (this.initial_value === null))
|
||||
?
|
||||
this.initial_value
|
||||
:
|
||||
{
|
||||
"name": "",
|
||||
"hue": lib_plankton.random.generate_unit(),
|
||||
"access": {
|
||||
"public": false,
|
||||
"default_level": _dali.enum_access_level.view,
|
||||
"attributed": lib_plankton.map.hashmap.implementation_map<
|
||||
_dali.type_user_id,
|
||||
_dali.enum_access_level
|
||||
>(
|
||||
lib_plankton.map.hashmap.make<
|
||||
_dali.type_user_id,
|
||||
_dali.enum_access_level
|
||||
>(
|
||||
user_id => user_id.toFixed(0),
|
||||
)
|
||||
),
|
||||
},
|
||||
/**
|
||||
* @todo
|
||||
*/
|
||||
"resource_id": 0,
|
||||
}
|
||||
);
|
||||
await form.input_lock(this.read_only);
|
||||
await form.input_write(this.initial_value);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -184,13 +184,15 @@ namespace _dali.widgets.event_edit
|
|||
},
|
||||
{
|
||||
"name": "event_begin",
|
||||
"input": _dali.helpers.datetime_input(),
|
||||
"input": _dali.helpers.datetime_input(
|
||||
),
|
||||
"label": lib_plankton.translate.get("event.begin")
|
||||
},
|
||||
{
|
||||
"name": "event_end",
|
||||
"input": new lib_plankton.zoo_input.class_input_soft<lib_plankton.pit.type_datetime>(
|
||||
_dali.helpers.datetime_input()
|
||||
_dali.helpers.datetime_input(
|
||||
)
|
||||
),
|
||||
"label": lib_plankton.translate.get("event.end")
|
||||
},
|
||||
|
|
@ -295,6 +297,7 @@ namespace _dali.widgets.event_edit
|
|||
)
|
||||
);
|
||||
await form.setup(target_element);
|
||||
await form.input_lock(this.read_only);
|
||||
await form.input_write(this.initial_value);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,19 +25,19 @@ namespace _dali.widgets.sources
|
|||
/**
|
||||
* [hook]
|
||||
*/
|
||||
private action_open : ((entry : type_entry) => void);
|
||||
private action_toggle : ((entry : type_entry, mode : boolean) => void);
|
||||
|
||||
|
||||
/**
|
||||
* [hook]
|
||||
*/
|
||||
private action_toggle_visibility : ((entry : type_entry, mode : boolean) => void);
|
||||
private action_select : ((entry : type_entry) => void);
|
||||
|
||||
|
||||
/**
|
||||
* [hook]
|
||||
*/
|
||||
private action_create : (() => void);
|
||||
private action_add : (() => void);
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -57,16 +57,16 @@ namespace _dali.widgets.sources
|
|||
public constructor(
|
||||
get_entries : (() => Promise<Array<type_entry>>),
|
||||
{
|
||||
"action_open": action_open = ((calendar_id) => {}),
|
||||
"action_toggle_visibility": action_toggle_visibility = ((calendar_id, mode) => {}),
|
||||
"action_create": action_create = (() => {}),
|
||||
"action_select": action_select = ((calendar_id) => {}),
|
||||
"action_toggle": action_toggle = ((calendar_id, mode) => {}),
|
||||
"action_add": action_add = (() => {}),
|
||||
"initial_priviliged": initial_priviliged = false,
|
||||
}
|
||||
:
|
||||
{
|
||||
action_open ?: ((entry : type_entry) => void);
|
||||
action_toggle_visibility ?: ((entry : type_entry, mode : boolean) => void);
|
||||
action_create ?: (() => void);
|
||||
action_select ?: ((entry : type_entry) => void);
|
||||
action_toggle ?: ((entry : type_entry, mode : boolean) => void);
|
||||
action_add ?: (() => void);
|
||||
initial_priviliged ?: boolean;
|
||||
}
|
||||
=
|
||||
|
|
@ -78,9 +78,9 @@ namespace _dali.widgets.sources
|
|||
this.get_entries = get_entries;
|
||||
|
||||
// hooks
|
||||
this.action_open = action_open;
|
||||
this.action_toggle_visibility = action_toggle_visibility;
|
||||
this.action_create = action_create;
|
||||
this.action_select = action_select;
|
||||
this.action_toggle = action_toggle;
|
||||
this.action_add = action_add;
|
||||
|
||||
// state
|
||||
this.priviliged = initial_priviliged;
|
||||
|
|
@ -191,7 +191,7 @@ namespace _dali.widgets.sources
|
|||
"click",
|
||||
(event) => {
|
||||
event.preventDefault();
|
||||
this.action_create();
|
||||
this.action_add();
|
||||
}
|
||||
);
|
||||
this.container.querySelectorAll(".sources-entry-visibility").forEach(
|
||||
|
|
@ -204,7 +204,7 @@ namespace _dali.widgets.sources
|
|||
const calendar_id : _dali.type_calendar_id = class_widget_sources.id_decode(key_encoded);
|
||||
const entry : type_entry = data.get(calendar_id);
|
||||
element.parentElement.classList.toggle("sources-entry-hidden", (! mode));
|
||||
this.action_toggle_visibility(entry, mode);
|
||||
this.action_toggle(entry, mode);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
@ -223,7 +223,7 @@ namespace _dali.widgets.sources
|
|||
const key_encoded : string = element.getAttribute("rel");
|
||||
const calendar_id : _dali.type_calendar_id = class_widget_sources.id_decode(key_encoded);
|
||||
const entry : type_entry = data.get(calendar_id);
|
||||
this.action_open(entry);
|
||||
this.action_select(entry);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -366,10 +366,13 @@ namespace _dali.widgets.weekview
|
|||
"tableview-cell-entry",
|
||||
{
|
||||
"color": _dali.helpers.event_color(entry.hue),
|
||||
/*
|
||||
"title": class_widget_weekview.event_generate_tooltip(
|
||||
entry.calendar_name,
|
||||
entry.event_object
|
||||
),
|
||||
*/
|
||||
"title": "",
|
||||
"name": entry.event_object.name,
|
||||
"rel": entry.key,
|
||||
"additional_classes": lib_plankton.string.coin(
|
||||
|
|
|
|||
Loading…
Reference in a new issue