[task-419] [int]

This commit is contained in:
fenris 2025-10-28 09:08:05 +01:00
parent 1c8d3d0725
commit 0c7dbbaa57
5 changed files with 61 additions and 40 deletions

View file

@ -100,7 +100,7 @@ namespace _dali.widgets
}
);
const dom_input : HTMLInputElement = (dom_dummy.querySelector(".widget-special_number_input-input > input") as HTMLInputElement);
const dom_input : HTMLInputElement = (dom_dummy.querySelector(".widget-special_number_input-input") as HTMLInputElement);
// listeners
{

View file

@ -0,0 +1,34 @@
.widget-special_number_input-controls
{
white-space: nowrap;
}
.widget-special_number_input-controls > *
{
display: inline-block;
}
.widget-special_number_input-button
{
padding: 4px 4px;
margin: 0;
cursor: pointer;
}
.widget-special_number_input-label
{
display: block;
font-size: 0.75em;
/*
text-transform: uppercase;
*/
}
.widget-special_number_input-input
{
max-width: 40px;
margin: 0;
text-align: center;
}

View file

@ -1,8 +1,8 @@
<div class="widget-special_number_input">
<label class="widget-special_number_input-label">{{label}}</label>
<div class="widget-special_number_input-input">
<button class="widget-special_number_input-prev">&#x25C2;</button>
<input type="text" pattern="-?[0-9]+"/>
<button class="widget-special_number_input-next">&#x25B8;</button>
<div class="widget-special_number_input-controls">
<div class="widget-special_number_input-button widget-special_number_input-prev">&#x25C2;</div>
<input type="text" class="widget-special_number_input-input" pattern="-?[0-9]+"/>
<div class="widget-special_number_input-button widget-special_number_input-next">&#x25B8;</div>
</div>
</div>

View file

@ -192,7 +192,8 @@ namespace _dali.widgets.weekview
*/
private static entry_hash(
entry : _dali.type_event_object_extended
) : string
)
: string
{
return lib_plankton.call.convey(
{
@ -214,7 +215,8 @@ namespace _dali.widgets.weekview
private static event_generate_tooltip(
calendar_name : string,
event_object : _dali.type_event_object
) : string
)
: string
{
return (
lib_plankton.string.coin(
@ -360,7 +362,8 @@ namespace _dali.widgets.weekview
*/
private async entry_insert(
entry : _dali.type_event_object_extended
) : Promise<(null | HTMLElement)>
)
: Promise<(null | HTMLElement)>
{
const selector : string = lib_plankton.string.coin(
".weekview-cell[rel=\"{{rel}}\"] > .weekview-events",
@ -423,7 +426,8 @@ namespace _dali.widgets.weekview
*/
private async entry_add(
entry : _dali.type_event_object_extended
) : Promise<void>
)
: Promise<void>
{
const dom_entry : (null | HTMLElement) = await this.entry_insert(entry);
if (dom_entry === null)
@ -448,7 +452,8 @@ namespace _dali.widgets.weekview
private async entry_update(
key : _dali.type_event_key,
entry : _dali.type_event_object_extended
) : Promise<void>
)
: Promise<void>
{
if (! this.event_map.has(key))
{
@ -504,7 +509,8 @@ namespace _dali.widgets.weekview
*/
private async entry_remove(
key : _dali.type_event_key
) : Promise<void>
)
: Promise<void>
{
if (! this.event_map.has(key))
{
@ -533,7 +539,8 @@ namespace _dali.widgets.weekview
/**
*/
public async update_entries(
) : Promise<void>
)
: Promise<void>
{
const entries : Array<_dali.type_event_object_extended> = await this.get_entries_wrapped(
);
@ -574,7 +581,8 @@ namespace _dali.widgets.weekview
/**
*/
private async update_table(
) : Promise<void>
)
: Promise<void>
{
/**
* @todo avoid?
@ -834,7 +842,8 @@ namespace _dali.widgets.weekview
=
{
}
) : void
)
: void
{
this.container.querySelectorAll(".weekview-event_entry").forEach(
(element) => {
@ -862,7 +871,8 @@ namespace _dali.widgets.weekview
*/
public async load(
target_element : Element
) : Promise<void>
)
: Promise<void>
{
target_element.innerHTML = await _dali.helpers.template_coin(
"widget-weekview",

View file

@ -10,29 +10,16 @@
text-align: center;
}
.weekview-control
.weekview-controls > *
{
flex-basis: 0;
flex-grow: 0;
flex-shrink: 1;
min-width: 80px;
margin: 0 0 0 8px;
}
.weekview-controls .widget-special_number_input
{
flex-basis: 0;
flex-grow: 0;
flex-shrink: 1;
min-width: 140px;
margin: 0 0 0 8px;
margin: 0 0 0 16px;
}
.weekview-control-label
,
.weekview-controls .widget-special_number_input-label
{
display: block;
@ -42,16 +29,6 @@
*/
}
.weekview-control-input > *
{
display: inline-block;
}
.weekview-controls .widget-special_number_input input
{
max-width: 40px;
}
.weekview-table table
{
width: 100%;