Compare commits
6 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e09cbb27a | ||
|
|
57ce184761 | ||
|
|
0c7dbbaa57 | ||
|
|
1c8d3d0725 | ||
|
|
7a5aeb3ff3 | ||
|
|
bb33ff66b3 |
85
lib/plankton/plankton.d.ts
vendored
85
lib/plankton/plankton.d.ts
vendored
|
|
@ -1,11 +1,11 @@
|
||||||
/**
|
/**
|
||||||
* @author fenris
|
* @author fenris
|
||||||
*/
|
*/
|
||||||
declare type int = number;
|
type int = number;
|
||||||
/**
|
/**
|
||||||
* @author fenris
|
* @author fenris
|
||||||
*/
|
*/
|
||||||
declare type float = number;
|
type float = number;
|
||||||
declare class Buffer {
|
declare class Buffer {
|
||||||
constructor(x: string, modifier?: string);
|
constructor(x: string, modifier?: string);
|
||||||
toString(modifier?: string): string;
|
toString(modifier?: string): string;
|
||||||
|
|
@ -19,7 +19,7 @@ declare namespace lib_plankton.base {
|
||||||
/**
|
/**
|
||||||
* @author fenris
|
* @author fenris
|
||||||
*/
|
*/
|
||||||
declare type type_pseudopointer<type_value> = {
|
type type_pseudopointer<type_value> = {
|
||||||
value: type_value;
|
value: type_value;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
|
|
@ -2002,7 +2002,7 @@ declare namespace lib_plankton.storage.memory {
|
||||||
clear(): Promise<void>;
|
clear(): Promise<void>;
|
||||||
write(key: any, value: any): Promise<boolean>;
|
write(key: any, value: any): Promise<boolean>;
|
||||||
delete(key: any): Promise<void>;
|
delete(key: any): Promise<void>;
|
||||||
read(key: any): Promise<type_item>;
|
read(key: any): Promise<Awaited<type_item>>;
|
||||||
search(term: any): Promise<{
|
search(term: any): Promise<{
|
||||||
key: string;
|
key: string;
|
||||||
preview: string;
|
preview: string;
|
||||||
|
|
@ -3861,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
|
||||||
*
|
*
|
||||||
|
|
@ -4309,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 {
|
||||||
|
|
@ -4359,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 {
|
||||||
|
|
@ -4402,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 {
|
||||||
|
|
@ -4453,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 {
|
||||||
|
|
@ -4495,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 {
|
||||||
|
|
@ -4555,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 {
|
||||||
|
|
@ -4597,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 {
|
||||||
|
|
@ -4647,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 {
|
||||||
|
|
@ -4690,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 {
|
||||||
|
|
@ -4740,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 {
|
||||||
|
|
@ -4807,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 {};
|
||||||
}
|
}
|
||||||
|
|
@ -4855,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 {
|
||||||
|
|
@ -4911,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 {
|
||||||
|
|
@ -4959,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 {
|
||||||
|
|
@ -5011,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 {
|
||||||
|
|
@ -5050,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 {
|
||||||
|
|
@ -5087,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 {
|
||||||
|
|
@ -5124,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 {
|
||||||
|
|
@ -5240,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 {};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2241,7 +2241,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||||
function step(op) {
|
function step(op) {
|
||||||
if (f) throw new TypeError("Generator is already executing.");
|
if (f) throw new TypeError("Generator is already executing.");
|
||||||
while (_) try {
|
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
||||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||||
switch (op[0]) {
|
switch (op[0]) {
|
||||||
|
|
@ -9970,6 +9970,12 @@ var lib_plankton;
|
||||||
* @author fenris
|
* @author fenris
|
||||||
*/
|
*/
|
||||||
class class_relation {
|
class class_relation {
|
||||||
|
/**
|
||||||
|
* @author fenris
|
||||||
|
*/
|
||||||
|
check(value, reference) {
|
||||||
|
return this.predicate(value, reference);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @author fenris
|
* @author fenris
|
||||||
*/
|
*/
|
||||||
|
|
@ -9979,12 +9985,6 @@ var lib_plankton;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.predicate = predicate;
|
this.predicate = predicate;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* @author fenris
|
|
||||||
*/
|
|
||||||
check(value, reference) {
|
|
||||||
return this.predicate(value, reference);
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* @author fenris
|
* @author fenris
|
||||||
*/
|
*/
|
||||||
|
|
@ -11654,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
|
||||||
*
|
*
|
||||||
|
|
@ -11751,8 +11740,7 @@ var lib_plankton;
|
||||||
"time": ((datetime.time === null)
|
"time": ((datetime.time === null)
|
||||||
?
|
?
|
||||||
null
|
null
|
||||||
:
|
: datetime_shifted.time)
|
||||||
datetime_shifted.time)
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -13307,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 = {}));
|
||||||
|
|
@ -13382,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 = {}));
|
||||||
|
|
@ -13510,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 = {}));
|
||||||
|
|
@ -13587,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 = {}));
|
||||||
|
|
@ -13746,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 = {}));
|
||||||
|
|
@ -13863,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 = {}));
|
||||||
|
|
@ -13988,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 = {}));
|
||||||
|
|
@ -14078,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 = {}));
|
||||||
|
|
@ -14196,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 = {}));
|
||||||
|
|
@ -14381,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 = {}));
|
||||||
|
|
@ -14498,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 = {}));
|
||||||
|
|
@ -14622,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 = {}));
|
||||||
|
|
@ -14721,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 = {}));
|
||||||
|
|
@ -14909,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 = {}));
|
||||||
|
|
@ -14995,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 = {}));
|
||||||
|
|
@ -15088,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 = {}));
|
||||||
|
|
@ -15204,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 = {}));
|
||||||
|
|
@ -15557,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,8 +283,7 @@ namespace _dali.helpers
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function datetime_input(
|
export function datetime_input(
|
||||||
)
|
) : lib_plankton.zoo_input.interface_input<lib_plankton.pit.type_datetime>
|
||||||
: lib_plankton.zoo_input.interface_input<lib_plankton.pit.type_datetime>
|
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
_dali.conf.get().misc.use_central_europe_specific_datetime_inputs
|
_dali.conf.get().misc.use_central_europe_specific_datetime_inputs
|
||||||
|
|
@ -386,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(
|
||||||
);
|
);
|
||||||
|
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
@ -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
|
||||||
|
|
@ -323,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",
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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