Compare commits

..

6 commits

Author SHA1 Message Date
fenris 4e09cbb27a Merge remote-tracking branch 'origin/main' into task-419 2025-10-28 11:39:53 +01:00
fenris 57ce184761 [task-419] [int] 2025-10-28 11:38:58 +01:00
fenris 0c7dbbaa57 [task-419] [int] 2025-10-28 09:08:05 +01:00
fenris 1c8d3d0725 [task-419] [int] 2025-10-28 00:25:20 +01:00
fenris 7a5aeb3ff3 [task-419] [int] 2025-10-27 23:11:28 +01:00
fenris bb33ff66b3 [task-419] [int] 2025-10-27 17:22:13 +01:00
21 changed files with 173 additions and 397 deletions

View file

@ -4306,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 {
@ -4356,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 {
@ -4399,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 {
@ -4450,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 {
@ -4492,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 {
@ -4552,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 {
@ -4594,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 {
@ -4644,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 {
@ -4687,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 {
@ -4737,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 {
@ -4804,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 {};
} }
@ -4852,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 {
@ -4908,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 {
@ -4956,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 {
@ -5008,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 {
@ -5047,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 {
@ -5084,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 {
@ -5121,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 {
@ -5237,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 {};
} }

View file

@ -13295,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 = {}));
@ -13370,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 = {}));
@ -13498,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 = {}));
@ -13575,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 = {}));
@ -13734,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 = {}));
@ -13851,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 = {}));
@ -13976,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 = {}));
@ -14066,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 = {}));
@ -14184,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 = {}));
@ -14369,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 = {}));
@ -14486,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 = {}));
@ -14610,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 = {}));
@ -14709,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 = {}));
@ -14897,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 = {}));
@ -14983,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 = {}));
@ -15076,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 = {}));
@ -15192,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 = {}));
@ -15545,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 = {}));

View file

@ -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});
} }
} }

9
source/style/hacks.css Normal file
View file

@ -0,0 +1,9 @@
.plankton_input_group_field[rel="resource"]
{
display: none;
}
.weekview-control-count
{
display: none !important;
}

View file

@ -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;

View file

@ -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;
}

View file

@ -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);
} }

View file

@ -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();
} }
} }

View file

@ -1,4 +0,0 @@
.widget-calendar_edit .plankton_input_group_field[rel="resource"]
{
display: none;
}

View file

@ -1,2 +0,0 @@
<div class="widget-calendar_edit">
</div>

View file

@ -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();
} }
} }

View file

@ -1,2 +0,0 @@
<div class="widget-event_edit">
</div>

View file

@ -157,7 +157,6 @@ namespace _dali.widgets
"password": "", "password": "",
} }
); );
form.input_focus();
} }
} }

View file

@ -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);
} }
} }

View file

@ -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;

View file

@ -1,3 +0,0 @@
<li class="widget-menu-entry" rel="{{rel}}">
<span>{{label}}</span>
</li>

View file

@ -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>

View file

@ -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",

View file

@ -91,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",
{ {
@ -99,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
@ -122,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))
@ -137,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))
@ -154,12 +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"));
} }
} }

View file

@ -384,7 +384,8 @@ 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",
{ {
@ -399,6 +400,7 @@ namespace _dali.widgets
), ),
} }
); );
const dom_entry : HTMLElement = dom_dummy.querySelector(".weekview-event_entry");
// listener // listener
dom_entry.addEventListener( dom_entry.addEventListener(
@ -936,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 () => {
@ -955,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");

View file

@ -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/*)