[int]
This commit is contained in:
parent
1d4ee08b06
commit
9cc1cfe6a0
|
|
@ -35,8 +35,8 @@
|
||||||
.widget-menu-platform:not(.widget-menu-platform-collapsed)
|
.widget-menu-platform:not(.widget-menu-platform-collapsed)
|
||||||
{
|
{
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 32px;
|
top: 50px;
|
||||||
right: 32px;
|
right: 20px;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -49,8 +49,7 @@
|
||||||
|
|
||||||
.widget-menu-entry
|
.widget-menu-entry
|
||||||
{
|
{
|
||||||
margin: 12px 16px;
|
margin: 8px;
|
||||||
padding: 8px;
|
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -60,9 +59,9 @@
|
||||||
color: hsl(var(--hue), 0%, 100%);
|
color: hsl(var(--hue), 0%, 100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.widget-menu-entry:hover::after
|
.widget-menu-entry:hover::before
|
||||||
{
|
{
|
||||||
content: " «";
|
content: "» ";
|
||||||
/*
|
/*
|
||||||
background-color: hsl(var(--hue), 0%, 50%);
|
background-color: hsl(var(--hue), 0%, 50%);
|
||||||
color: hsl(var(--hue), 0%, 100%);
|
color: hsl(var(--hue), 0%, 100%);
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,12 @@ namespace _dali.widgets.weekview
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [state]
|
||||||
|
*/
|
||||||
|
private vertical : boolean;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [state]
|
* [state]
|
||||||
*/
|
*/
|
||||||
|
|
@ -105,6 +111,7 @@ namespace _dali.widgets.weekview
|
||||||
{
|
{
|
||||||
"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) => {}),
|
||||||
|
"vertical": vertical = false,
|
||||||
"initial_year": initial_year = null,
|
"initial_year": initial_year = null,
|
||||||
"initial_week": initial_week = null,
|
"initial_week": initial_week = null,
|
||||||
"initial_count": initial_count = 5,
|
"initial_count": initial_count = 5,
|
||||||
|
|
@ -596,6 +603,13 @@ namespace _dali.widgets.weekview
|
||||||
const context : Element = this.container;
|
const context : Element = this.container;
|
||||||
// structure
|
// structure
|
||||||
{
|
{
|
||||||
|
type type_row_data = Array<
|
||||||
|
{
|
||||||
|
week : int;
|
||||||
|
day_pits : Array<lib_plankton.pit.type_pit>;
|
||||||
|
}
|
||||||
|
>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo als Variable?
|
* @todo als Variable?
|
||||||
*/
|
*/
|
||||||
|
|
@ -603,52 +617,67 @@ namespace _dali.widgets.weekview
|
||||||
const now_pit : lib_plankton.pit.type_pit = lib_plankton.pit.now();
|
const now_pit : lib_plankton.pit.type_pit = lib_plankton.pit.now();
|
||||||
const today_begin_pit : lib_plankton.pit.type_pit = lib_plankton.pit.trunc_day(now_pit);
|
const today_begin_pit : lib_plankton.pit.type_pit = lib_plankton.pit.trunc_day(now_pit);
|
||||||
const today_end_pit : lib_plankton.pit.type_pit = lib_plankton.pit.shift_day(today_begin_pit, 1);
|
const today_end_pit : lib_plankton.pit.type_pit = lib_plankton.pit.shift_day(today_begin_pit, 1);
|
||||||
const row_data : Array<
|
const row_data_original : type_row_data = (
|
||||||
{
|
|
||||||
week : int;
|
|
||||||
data : Array<
|
|
||||||
{
|
|
||||||
pit : lib_plankton.pit.type_pit;
|
|
||||||
today : boolean;
|
|
||||||
}
|
|
||||||
>;
|
|
||||||
}
|
|
||||||
> = (
|
|
||||||
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);
|
||||||
return {
|
return {
|
||||||
"week": week,
|
"week": week,
|
||||||
"data": (
|
"day_pits": (
|
||||||
lib_plankton.list.sequence(7)
|
lib_plankton.list.sequence(7)
|
||||||
.map(
|
.map(
|
||||||
day => {
|
day => lib_plankton.pit.from_ywd(
|
||||||
const day_pit : lib_plankton.pit.type_pit = lib_plankton.pit.from_ywd(
|
|
||||||
{
|
{
|
||||||
"year": this.year,
|
"year": this.year,
|
||||||
"week": week,
|
"week": week,
|
||||||
"day": (day + 1),
|
"day": (1 + day),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timezone_shift": timezone_shift,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
const row_data_alternative : type_row_data = (
|
||||||
|
lib_plankton.list.sequence(7)
|
||||||
|
.map(
|
||||||
|
day_of_week => {
|
||||||
|
return {
|
||||||
|
/*"day_of_week"*/"week": day_of_week,
|
||||||
|
/*"week_pits"*/"day_pits": (
|
||||||
|
lib_plankton.list.sequence(this.count)
|
||||||
|
.map(
|
||||||
|
offset => {
|
||||||
|
const week : int = (this.week + offset);
|
||||||
|
return lib_plankton.pit.from_ywd(
|
||||||
|
{
|
||||||
|
"year": this.year,
|
||||||
|
"week": week,
|
||||||
|
"day": (1 + day_of_week),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"timezone_shift": timezone_shift,
|
"timezone_shift": timezone_shift,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
return {
|
}
|
||||||
"pit": day_pit,
|
)
|
||||||
"today": lib_plankton.pit.is_between(
|
)
|
||||||
day_pit,
|
|
||||||
today_begin_pit,
|
|
||||||
today_end_pit
|
|
||||||
),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
)
|
|
||||||
),
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
const row_data : type_row_data = (
|
||||||
|
false
|
||||||
|
?
|
||||||
|
row_data_original
|
||||||
|
:
|
||||||
|
row_data_alternative
|
||||||
|
);
|
||||||
context.querySelector(".weekview-table tbody").innerHTML = (
|
context.querySelector(".weekview-table tbody").innerHTML = (
|
||||||
await _dali.helpers.promise_row<string>(
|
await _dali.helpers.promise_row<string>(
|
||||||
row_data
|
row_data
|
||||||
|
|
@ -660,19 +689,25 @@ namespace _dali.widgets.weekview
|
||||||
"week": row.week.toFixed(0).padStart(2, "0"),
|
"week": row.week.toFixed(0).padStart(2, "0"),
|
||||||
"cells": (
|
"cells": (
|
||||||
await _dali.helpers.promise_row<string>(
|
await _dali.helpers.promise_row<string>(
|
||||||
row.data
|
row.day_pits
|
||||||
.map(
|
.map(
|
||||||
(cell) => async () => _dali.helpers.template_coin(
|
(day_pit) => async () => {
|
||||||
|
const is_today : boolean = lib_plankton.pit.is_between(
|
||||||
|
day_pit,
|
||||||
|
today_begin_pit,
|
||||||
|
today_end_pit
|
||||||
|
);
|
||||||
|
return _dali.helpers.template_coin(
|
||||||
"widget-weekview",
|
"widget-weekview",
|
||||||
"tableview-cell",
|
"tableview-cell",
|
||||||
{
|
{
|
||||||
"extra_classes": (
|
"extra_classes": (
|
||||||
[""]
|
[""]
|
||||||
.concat(cell.today ? ["weekview-cell-today"] : [])
|
.concat(is_today ? ["weekview-cell-today"] : [])
|
||||||
.join(" ")
|
.join(" ")
|
||||||
),
|
),
|
||||||
"title": lib_plankton.call.convey(
|
"title": lib_plankton.call.convey(
|
||||||
cell.pit,
|
day_pit,
|
||||||
[
|
[
|
||||||
lib_plankton.pit.to_datetime_ce,
|
lib_plankton.pit.to_datetime_ce,
|
||||||
(x : lib_plankton.pit.type_datetime) => lib_plankton.string.coin(
|
(x : lib_plankton.pit.type_datetime) => lib_plankton.string.coin(
|
||||||
|
|
@ -686,7 +721,7 @@ namespace _dali.widgets.weekview
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
"day": lib_plankton.call.convey(
|
"day": lib_plankton.call.convey(
|
||||||
cell.pit,
|
day_pit,
|
||||||
[
|
[
|
||||||
lib_plankton.pit.to_datetime_ce,
|
lib_plankton.pit.to_datetime_ce,
|
||||||
(x : lib_plankton.pit.type_datetime) => lib_plankton.string.coin(
|
(x : lib_plankton.pit.type_datetime) => lib_plankton.string.coin(
|
||||||
|
|
@ -700,7 +735,7 @@ namespace _dali.widgets.weekview
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
"rel": lib_plankton.call.convey(
|
"rel": lib_plankton.call.convey(
|
||||||
cell.pit,
|
day_pit,
|
||||||
[
|
[
|
||||||
lib_plankton.pit.to_datetime_ce,
|
lib_plankton.pit.to_datetime_ce,
|
||||||
(x : lib_plankton.pit.type_datetime) => lib_plankton.string.coin(
|
(x : lib_plankton.pit.type_datetime) => lib_plankton.string.coin(
|
||||||
|
|
@ -715,7 +750,8 @@ namespace _dali.widgets.weekview
|
||||||
),
|
),
|
||||||
"entries": ""
|
"entries": ""
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
).join(""),
|
).join(""),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue