@zeyos/zx 2.1.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -0
- package/README.md +15 -0
- package/dist/types/compat/base.d.ts +156 -0
- package/dist/types/compat/globals.d.ts +20 -0
- package/dist/types/compat/index.d.ts +128 -0
- package/dist/types/compat/map/basic.d.ts +175 -0
- package/dist/types/compat/map/data.d.ts +102 -0
- package/dist/types/compat/map/date-time.d.ts +80 -0
- package/dist/types/compat/map/factory.d.ts +9 -0
- package/dist/types/compat/map/form.d.ts +98 -0
- package/dist/types/compat/map/helpers.d.ts +12 -0
- package/dist/types/compat/map/http.d.ts +36 -0
- package/dist/types/compat/map/layout.d.ts +106 -0
- package/dist/types/compat/map/options.d.ts +80 -0
- package/dist/types/compat/map/select.d.ts +95 -0
- package/dist/types/compat/map/stubs.d.ts +32 -0
- package/dist/types/compat/map/utilities.d.ts +37 -0
- package/dist/types/compat-entry.d.ts +5 -0
- package/dist/types/components/badge/badge.d.ts +46 -0
- package/dist/types/components/breadcrumb/breadcrumb.d.ts +200 -0
- package/dist/types/components/button/button.d.ts +42 -0
- package/dist/types/components/check-button/check-button.d.ts +98 -0
- package/dist/types/components/checklist/checklist.d.ts +143 -0
- package/dist/types/components/checklist/field-adapter.d.ts +5 -0
- package/dist/types/components/context-menu/context-menu.d.ts +130 -0
- package/dist/types/components/copy/copy-button.d.ts +48 -0
- package/dist/types/components/copy/copy-input.d.ts +91 -0
- package/dist/types/components/data-filter/data-filter.d.ts +250 -0
- package/dist/types/components/data-filter/filter-core.d.ts +52 -0
- package/dist/types/components/date-picker/date-picker.d.ts +137 -0
- package/dist/types/components/date-picker/date-range-picker.d.ts +350 -0
- package/dist/types/components/date-picker/field-adapter.d.ts +6 -0
- package/dist/types/components/date-picker/month-picker.d.ts +75 -0
- package/dist/types/components/date-picker/range-field-adapter.d.ts +7 -0
- package/dist/types/components/date-picker/time-picker.d.ts +127 -0
- package/dist/types/components/datebox/date-range-box.d.ts +218 -0
- package/dist/types/components/datebox/datebox.d.ts +160 -0
- package/dist/types/components/datebox/field-adapter.d.ts +5 -0
- package/dist/types/components/dialog/dialog.d.ts +284 -0
- package/dist/types/components/dropdown/dropdown.d.ts +118 -0
- package/dist/types/components/empty-state/empty-state.d.ts +38 -0
- package/dist/types/components/field/field.d.ts +231 -0
- package/dist/types/components/field-upload/field-adapter.d.ts +5 -0
- package/dist/types/components/field-upload/field-upload.d.ts +213 -0
- package/dist/types/components/fieldset/fieldset.d.ts +125 -0
- package/dist/types/components/finder/finder.d.ts +252 -0
- package/dist/types/components/form/form.d.ts +194 -0
- package/dist/types/components/groupbox/groupbox.d.ts +89 -0
- package/dist/types/components/layout/layout.d.ts +132 -0
- package/dist/types/components/loading/inline-loading.d.ts +86 -0
- package/dist/types/components/loading/progress-bar.d.ts +168 -0
- package/dist/types/components/loading/spinner.d.ts +34 -0
- package/dist/types/components/master-panel/master-panel.d.ts +112 -0
- package/dist/types/components/menu-button/menu-button.d.ts +142 -0
- package/dist/types/components/message/message.d.ts +212 -0
- package/dist/types/components/modal/modal.d.ts +105 -0
- package/dist/types/components/multi-value-editor/field-adapter.d.ts +5 -0
- package/dist/types/components/multi-value-editor/multi-value-editor.d.ts +66 -0
- package/dist/types/components/navigation-bar/navigation-bar.d.ts +229 -0
- package/dist/types/components/number-field/field-adapter.d.ts +5 -0
- package/dist/types/components/number-field/number-field.d.ts +292 -0
- package/dist/types/components/pagination/pagination.d.ts +267 -0
- package/dist/types/components/panel/panel.d.ts +194 -0
- package/dist/types/components/permission/permission.d.ts +93 -0
- package/dist/types/components/rating/field-adapter.d.ts +5 -0
- package/dist/types/components/rating/rating.d.ts +213 -0
- package/dist/types/components/search/search.d.ts +98 -0
- package/dist/types/components/select/field-adapter.d.ts +5 -0
- package/dist/types/components/select/filter.d.ts +11 -0
- package/dist/types/components/select/select.d.ts +235 -0
- package/dist/types/components/skeleton/skeleton.d.ts +97 -0
- package/dist/types/components/slider/field-adapter.d.ts +5 -0
- package/dist/types/components/slider/slider.d.ts +216 -0
- package/dist/types/components/split-view/split-view.d.ts +335 -0
- package/dist/types/components/stepper/stepper.d.ts +314 -0
- package/dist/types/components/stepper/steps.d.ts +131 -0
- package/dist/types/components/tabbox/tabbox.d.ts +230 -0
- package/dist/types/components/table/sort.d.ts +49 -0
- package/dist/types/components/table/table.d.ts +872 -0
- package/dist/types/components/tag-picker/field-adapter.d.ts +5 -0
- package/dist/types/components/tag-picker/tag-picker.d.ts +375 -0
- package/dist/types/components/timebox/field-adapter.d.ts +5 -0
- package/dist/types/components/timebox/timebox.d.ts +121 -0
- package/dist/types/components/toggle/field-adapter.d.ts +5 -0
- package/dist/types/components/toggle/toggle.d.ts +94 -0
- package/dist/types/components/toolbar/toolbar.d.ts +230 -0
- package/dist/types/components/tooltip/tooltip.d.ts +183 -0
- package/dist/types/components/tree/hierarchy.d.ts +113 -0
- package/dist/types/components/tree/tree.d.ts +383 -0
- package/dist/types/components/truncate/truncate.d.ts +61 -0
- package/dist/types/components/value-list/field-adapter.d.ts +5 -0
- package/dist/types/components/value-list/value-list.d.ts +143 -0
- package/dist/types/core/breakpoint.d.ts +68 -0
- package/dist/types/core/component.d.ts +115 -0
- package/dist/types/core/date.d.ts +50 -0
- package/dist/types/core/dom.d.ts +86 -0
- package/dist/types/core/export.d.ts +70 -0
- package/dist/types/core/fontawesome.d.ts +107 -0
- package/dist/types/core/format.d.ts +107 -0
- package/dist/types/core/http.d.ts +122 -0
- package/dist/types/core/i18n.d.ts +35 -0
- package/dist/types/core/icons.d.ts +137 -0
- package/dist/types/core/keyboard.d.ts +72 -0
- package/dist/types/core/position.d.ts +45 -0
- package/dist/types/core/storage.d.ts +46 -0
- package/dist/types/core/util.d.ts +117 -0
- package/dist/types/elements/define.d.ts +73 -0
- package/dist/types/elements/reflect.d.ts +27 -0
- package/dist/types/index.d.ts +79 -0
- package/dist/types/zeyos/connect.d.ts +65 -0
- package/dist/types/zeyos/form.d.ts +140 -0
- package/dist/types/zeyos/icons.d.ts +104 -0
- package/dist/types/zeyos/index.d.ts +12 -0
- package/dist/types/zeyos/modules.d.ts +110 -0
- package/dist/types/zeyos/query.d.ts +157 -0
- package/dist/types/zeyos/schema.d.ts +79 -0
- package/dist/types/zeyos/select.d.ts +167 -0
- package/dist/types/zeyos/table.d.ts +205 -0
- package/dist/zx-compat.esm.js +375 -39
- package/dist/zx-compat.esm.min.js +1 -1
- package/dist/zx-compat.global.js +372 -73
- package/dist/zx-compat.global.min.js +3 -3
- package/dist/zx-zeyos.esm.js +355 -49
- package/dist/zx-zeyos.esm.min.js +1 -1
- package/dist/zx.css +68 -6
- package/dist/zx.esm.js +359 -73
- package/dist/zx.esm.min.js +3 -3
- package/dist/zx.global.js +359 -73
- package/dist/zx.global.min.js +3 -3
- package/dist/zx.min.css +1 -1
- package/docs/api.json +48 -2
- package/docs/llms.md +31 -0
- package/package.json +37 -9
- package/src/compat/base.js +291 -0
- package/src/compat/globals.js +165 -0
- package/src/compat/index.js +84 -0
- package/src/compat/map/basic.js +464 -0
- package/src/compat/map/data.js +232 -0
- package/src/compat/map/date-time.js +177 -0
- package/src/compat/map/factory.js +45 -0
- package/src/compat/map/form.js +330 -0
- package/src/compat/map/helpers.js +46 -0
- package/src/compat/map/http.js +117 -0
- package/src/compat/map/layout.js +256 -0
- package/src/compat/map/options.js +267 -0
- package/src/compat/map/select.js +198 -0
- package/src/compat/map/stubs.js +26 -0
- package/src/compat/map/utilities.js +113 -0
- package/src/compat-entry.js +11 -0
- package/src/components/badge/badge.css +147 -0
- package/src/components/badge/badge.js +92 -0
- package/src/components/breadcrumb/breadcrumb.css +105 -0
- package/src/components/breadcrumb/breadcrumb.js +331 -0
- package/src/components/button/button.css +104 -0
- package/src/components/button/button.js +76 -0
- package/src/components/check-button/check-button.css +66 -0
- package/src/components/check-button/check-button.js +167 -0
- package/src/components/checklist/checklist.css +65 -0
- package/src/components/checklist/checklist.js +282 -0
- package/src/components/checklist/field-adapter.js +46 -0
- package/src/components/context-menu/context-menu.css +54 -0
- package/src/components/context-menu/context-menu.js +334 -0
- package/src/components/copy/copy-button.css +27 -0
- package/src/components/copy/copy-button.js +78 -0
- package/src/components/copy/copy-input.css +59 -0
- package/src/components/copy/copy-input.js +123 -0
- package/src/components/data-filter/data-filter.css +53 -0
- package/src/components/data-filter/data-filter.js +400 -0
- package/src/components/data-filter/filter-core.js +128 -0
- package/src/components/date-picker/date-picker.css +181 -0
- package/src/components/date-picker/date-picker.js +500 -0
- package/src/components/date-picker/date-range-picker.css +264 -0
- package/src/components/date-picker/date-range-picker.js +990 -0
- package/src/components/date-picker/field-adapter.js +36 -0
- package/src/components/date-picker/month-picker.js +223 -0
- package/src/components/date-picker/range-field-adapter.js +31 -0
- package/src/components/date-picker/time-picker.css +191 -0
- package/src/components/date-picker/time-picker.js +406 -0
- package/src/components/datebox/date-range-box.css +128 -0
- package/src/components/datebox/date-range-box.js +492 -0
- package/src/components/datebox/datebox.css +108 -0
- package/src/components/datebox/datebox.js +358 -0
- package/src/components/datebox/field-adapter.js +34 -0
- package/src/components/dialog/dialog.css +74 -0
- package/src/components/dialog/dialog.js +450 -0
- package/src/components/dropdown/dropdown.css +24 -0
- package/src/components/dropdown/dropdown.js +288 -0
- package/src/components/empty-state/empty-state.css +80 -0
- package/src/components/empty-state/empty-state.js +92 -0
- package/src/components/field/field.css +127 -0
- package/src/components/field/field.js +605 -0
- package/src/components/field-upload/field-adapter.js +21 -0
- package/src/components/field-upload/field-upload.css +108 -0
- package/src/components/field-upload/field-upload.js +475 -0
- package/src/components/fieldset/fieldset.css +37 -0
- package/src/components/fieldset/fieldset.js +307 -0
- package/src/components/finder/finder.css +98 -0
- package/src/components/finder/finder.js +509 -0
- package/src/components/form/form.css +32 -0
- package/src/components/form/form.js +302 -0
- package/src/components/groupbox/groupbox.css +51 -0
- package/src/components/groupbox/groupbox.js +199 -0
- package/src/components/layout/layout.css +117 -0
- package/src/components/layout/layout.js +136 -0
- package/src/components/loading/inline-loading.css +34 -0
- package/src/components/loading/inline-loading.js +140 -0
- package/src/components/loading/progress-bar.css +115 -0
- package/src/components/loading/progress-bar.js +259 -0
- package/src/components/loading/spinner.css +58 -0
- package/src/components/loading/spinner.js +57 -0
- package/src/components/master-panel/master-panel.css +51 -0
- package/src/components/master-panel/master-panel.js +203 -0
- package/src/components/menu-button/menu-button.css +49 -0
- package/src/components/menu-button/menu-button.js +294 -0
- package/src/components/message/message.css +122 -0
- package/src/components/message/message.js +499 -0
- package/src/components/modal/modal.css +47 -0
- package/src/components/modal/modal.js +203 -0
- package/src/components/multi-value-editor/field-adapter.js +44 -0
- package/src/components/multi-value-editor/multi-value-editor.css +56 -0
- package/src/components/multi-value-editor/multi-value-editor.js +170 -0
- package/src/components/navigation-bar/navigation-bar.css +130 -0
- package/src/components/navigation-bar/navigation-bar.js +450 -0
- package/src/components/number-field/field-adapter.js +40 -0
- package/src/components/number-field/number-field.css +77 -0
- package/src/components/number-field/number-field.js +545 -0
- package/src/components/pagination/pagination.css +95 -0
- package/src/components/pagination/pagination.js +481 -0
- package/src/components/panel/panel.css +123 -0
- package/src/components/panel/panel.js +336 -0
- package/src/components/permission/permission.css +47 -0
- package/src/components/permission/permission.js +198 -0
- package/src/components/rating/field-adapter.js +34 -0
- package/src/components/rating/rating.css +97 -0
- package/src/components/rating/rating.js +395 -0
- package/src/components/search/search.css +70 -0
- package/src/components/search/search.js +193 -0
- package/src/components/select/field-adapter.js +24 -0
- package/src/components/select/filter.js +39 -0
- package/src/components/select/select.css +180 -0
- package/src/components/select/select.js +663 -0
- package/src/components/skeleton/skeleton.css +76 -0
- package/src/components/skeleton/skeleton.js +139 -0
- package/src/components/slider/field-adapter.js +36 -0
- package/src/components/slider/slider.css +181 -0
- package/src/components/slider/slider.js +399 -0
- package/src/components/split-view/split-view.css +139 -0
- package/src/components/split-view/split-view.js +806 -0
- package/src/components/stepper/stepper.css +234 -0
- package/src/components/stepper/stepper.js +459 -0
- package/src/components/stepper/steps.js +131 -0
- package/src/components/tabbox/tabbox.css +281 -0
- package/src/components/tabbox/tabbox.js +484 -0
- package/src/components/table/sort.js +85 -0
- package/src/components/table/table.css +364 -0
- package/src/components/table/table.js +1711 -0
- package/src/components/tag-picker/field-adapter.js +35 -0
- package/src/components/tag-picker/tag-picker.css +169 -0
- package/src/components/tag-picker/tag-picker.js +837 -0
- package/src/components/timebox/field-adapter.js +24 -0
- package/src/components/timebox/timebox.css +51 -0
- package/src/components/timebox/timebox.js +276 -0
- package/src/components/toggle/field-adapter.js +24 -0
- package/src/components/toggle/toggle.css +66 -0
- package/src/components/toggle/toggle.js +150 -0
- package/src/components/toolbar/toolbar.css +81 -0
- package/src/components/toolbar/toolbar.js +511 -0
- package/src/components/tooltip/tooltip.css +36 -0
- package/src/components/tooltip/tooltip.js +420 -0
- package/src/components/tree/hierarchy.js +151 -0
- package/src/components/tree/tree.css +99 -0
- package/src/components/tree/tree.js +784 -0
- package/src/components/truncate/truncate.css +20 -0
- package/src/components/truncate/truncate.js +92 -0
- package/src/components/value-list/field-adapter.js +24 -0
- package/src/components/value-list/value-list.css +108 -0
- package/src/components/value-list/value-list.js +336 -0
- package/src/core/breakpoint.js +150 -0
- package/src/core/component.js +292 -0
- package/src/core/date.js +216 -0
- package/src/core/dom.js +260 -0
- package/src/core/export.js +204 -0
- package/src/core/fontawesome.js +177 -0
- package/src/core/format.js +283 -0
- package/src/core/http.js +246 -0
- package/src/core/i18n.js +83 -0
- package/src/core/icons.js +283 -0
- package/src/core/keyboard.js +240 -0
- package/src/core/position.js +177 -0
- package/src/core/storage.js +175 -0
- package/src/core/util.js +336 -0
- package/src/elements/define.js +715 -0
- package/src/elements/reflect.js +79 -0
- package/src/index.js +131 -0
- package/src/zeyos/connect.js +142 -0
- package/src/zeyos/form.js +254 -0
- package/src/zeyos/icons.js +92 -0
- package/src/zeyos/index.js +21 -0
- package/src/zeyos/modules.js +269 -0
- package/src/zeyos/query.js +199 -0
- package/src/zeyos/schema.js +474 -0
- package/src/zeyos/select.js +175 -0
- package/src/zeyos/table.js +272 -0
- package/styles/base.css +124 -0
- package/styles/icons.css +34 -0
- package/styles/tokens/dark.css +84 -0
- package/styles/tokens/density.css +9 -0
- package/styles/tokens/global.css +80 -0
- package/styles/tokens/modules.css +109 -0
- package/styles/tokens/semantic.css +49 -0
- package/styles/zx.css +61 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { Component } from '../../core/component.js';
|
|
2
|
+
import { DateRangePicker } from '../date-picker/date-range-picker.js';
|
|
3
|
+
export type DateRange = import('../date-picker/date-range-picker.js').DateRange;
|
|
4
|
+
export type DateRangePreset = import('../date-picker/date-range-picker.js').DateRangePreset;
|
|
5
|
+
export type DateRangeSeconds = {
|
|
6
|
+
start: number | null;
|
|
7
|
+
end: number | null;
|
|
8
|
+
};
|
|
9
|
+
export type DateRangeInput = Date | number | string | null;
|
|
10
|
+
export type DateRangeBoxOptions = {
|
|
11
|
+
/**
|
|
12
|
+
* Initial start: Date, Unix seconds, or formatted text.
|
|
13
|
+
*/
|
|
14
|
+
start?: Date | number | string | null;
|
|
15
|
+
/**
|
|
16
|
+
* Initial end: Date, Unix seconds, or formatted text.
|
|
17
|
+
*/
|
|
18
|
+
end?: Date | number | string | null;
|
|
19
|
+
/**
|
|
20
|
+
* Kernel date format used for both endpoints.
|
|
21
|
+
*/
|
|
22
|
+
format?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Text placed between the two formatted dates.
|
|
25
|
+
*/
|
|
26
|
+
separator?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Input placeholder; null derives one from the format.
|
|
29
|
+
*/
|
|
30
|
+
placeholder?: string | null;
|
|
31
|
+
/**
|
|
32
|
+
* Show a clear button while a range is present.
|
|
33
|
+
*/
|
|
34
|
+
clearable?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Earliest selectable local calendar day.
|
|
37
|
+
*/
|
|
38
|
+
min?: Date | null;
|
|
39
|
+
/**
|
|
40
|
+
* Latest selectable local calendar day.
|
|
41
|
+
*/
|
|
42
|
+
max?: Date | null;
|
|
43
|
+
/**
|
|
44
|
+
* Month panels in the popover; narrow ones show only the first.
|
|
45
|
+
*/
|
|
46
|
+
months?: number;
|
|
47
|
+
/**
|
|
48
|
+
* First weekday, from 0 (Sunday) through 6 (Saturday).
|
|
49
|
+
*/
|
|
50
|
+
weekStart?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Show ISO week numbers.
|
|
53
|
+
*/
|
|
54
|
+
showWeekNumbers?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Smallest number of nights a complete range may span.
|
|
57
|
+
*/
|
|
58
|
+
minNights?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Largest number of nights a complete range may span.
|
|
61
|
+
*/
|
|
62
|
+
maxNights?: number | null;
|
|
63
|
+
/**
|
|
64
|
+
* Preset buttons, or `true` for the built-in set.
|
|
65
|
+
*/
|
|
66
|
+
presets?: DateRangePreset[] | boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Disable all controls.
|
|
69
|
+
*/
|
|
70
|
+
disabled?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Change listener.
|
|
73
|
+
*/
|
|
74
|
+
onchange?: (event: CustomEvent<DateRange>) => void;
|
|
75
|
+
/**
|
|
76
|
+
* Invalid-input listener.
|
|
77
|
+
*/
|
|
78
|
+
oninvalid?: (event: CustomEvent<{
|
|
79
|
+
text: string;
|
|
80
|
+
}>) => void;
|
|
81
|
+
/**
|
|
82
|
+
* Open listener.
|
|
83
|
+
*/
|
|
84
|
+
onopen?: (event: CustomEvent<Record<string, never>>) => void;
|
|
85
|
+
/**
|
|
86
|
+
* Close listener.
|
|
87
|
+
*/
|
|
88
|
+
onclose?: (event: CustomEvent<Record<string, never>>) => void;
|
|
89
|
+
};
|
|
90
|
+
export type DateRangeBoxSetOptions = {
|
|
91
|
+
silent?: boolean;
|
|
92
|
+
};
|
|
93
|
+
export type DateRangeBoxUnit = 'date' | 'seconds';
|
|
94
|
+
/**
|
|
95
|
+
* Parses `"<start><separator><end>"` into a range. A lone date is read as a one-day range, and a
|
|
96
|
+
* trailing separator as a start-only range, so a half-typed value is not thrown away.
|
|
97
|
+
* @param {string} text Input text.
|
|
98
|
+
* @param {string} format Kernel date format for each endpoint.
|
|
99
|
+
* @param {string} separator Separator between the two dates; surrounding spaces are optional.
|
|
100
|
+
* @returns {DateRange|null} The parsed range, or null when the text does not match.
|
|
101
|
+
*/
|
|
102
|
+
export declare function parseRangeText(text: string, format: string, separator: string): DateRange | null;
|
|
103
|
+
/**
|
|
104
|
+
* Renders a range as `"<start><separator><end>"`. An incomplete range yields the endpoint it has.
|
|
105
|
+
* @param {DateRange|null} range Range to render.
|
|
106
|
+
* @param {string} format Kernel date format for each endpoint.
|
|
107
|
+
* @param {string} separator Separator between the two dates.
|
|
108
|
+
* @returns {string}
|
|
109
|
+
*/
|
|
110
|
+
export declare function formatRangeText(range: DateRange | null, format: string, separator: string): string;
|
|
111
|
+
/**
|
|
112
|
+
* Formatted date-range input with an anchored two-month range calendar.
|
|
113
|
+
* @fires DateRangeBox#change
|
|
114
|
+
* @fires DateRangeBox#invalid
|
|
115
|
+
* @fires DateRangeBox#open
|
|
116
|
+
* @fires DateRangeBox#close
|
|
117
|
+
* @extends {Component<DateRangeBoxOptions>}
|
|
118
|
+
*/
|
|
119
|
+
export declare class DateRangeBox extends Component<DateRangeBoxOptions> {
|
|
120
|
+
_originalState: string;
|
|
121
|
+
_originalAriaDisabled: string;
|
|
122
|
+
_format: string;
|
|
123
|
+
_separator: string;
|
|
124
|
+
_disabled: boolean;
|
|
125
|
+
_open: boolean;
|
|
126
|
+
_position: import("../../core/position.js").PositionController;
|
|
127
|
+
_range: import("../date-picker/date-range-picker.js").DateRange | {
|
|
128
|
+
start: unknown;
|
|
129
|
+
end: unknown;
|
|
130
|
+
};
|
|
131
|
+
_content: HTMLElement;
|
|
132
|
+
_picker: DateRangePicker;
|
|
133
|
+
static cssName: string;
|
|
134
|
+
/** @type {DateRangeBoxOptions} */
|
|
135
|
+
static defaults: DateRangeBoxOptions;
|
|
136
|
+
/** @returns {HTMLElement} */
|
|
137
|
+
render(): HTMLElement;
|
|
138
|
+
/**
|
|
139
|
+
* Returns the selected range as dates or as Unix timestamps.
|
|
140
|
+
* @param {DateRangeBoxUnit} [unit='date'] Return unit.
|
|
141
|
+
* @returns {DateRange|DateRangeSeconds}
|
|
142
|
+
*/
|
|
143
|
+
get(unit?: DateRangeBoxUnit): DateRange | DateRangeSeconds;
|
|
144
|
+
/**
|
|
145
|
+
* Sets a range. Each endpoint may be a Date, Unix seconds, or text in the configured format;
|
|
146
|
+
* a whole formatted range string and `null` are accepted too.
|
|
147
|
+
* @param {DateRange|{start: DateRangeInput, end: DateRangeInput}|string|null} range New range.
|
|
148
|
+
* @param {DateRangeBoxSetOptions} [options={}] Update behavior.
|
|
149
|
+
* @returns {this}
|
|
150
|
+
* @fires DateRangeBox#change
|
|
151
|
+
*/
|
|
152
|
+
set(range: DateRange | {
|
|
153
|
+
start: DateRangeInput;
|
|
154
|
+
end: DateRangeInput;
|
|
155
|
+
} | string | null, { silent }?: DateRangeBoxSetOptions): this;
|
|
156
|
+
/**
|
|
157
|
+
* Clears the selection.
|
|
158
|
+
* @param {DateRangeBoxSetOptions} [options={}] Update behavior.
|
|
159
|
+
* @returns {this}
|
|
160
|
+
* @fires DateRangeBox#change
|
|
161
|
+
*/
|
|
162
|
+
clear({ silent }?: DateRangeBoxSetOptions): this;
|
|
163
|
+
/**
|
|
164
|
+
* Opens and positions the range calendar, then moves focus into its grid.
|
|
165
|
+
* @returns {this}
|
|
166
|
+
* @fires DateRangeBox#open
|
|
167
|
+
*/
|
|
168
|
+
open(): this;
|
|
169
|
+
/**
|
|
170
|
+
* Closes the range calendar.
|
|
171
|
+
* @returns {this}
|
|
172
|
+
* @fires DateRangeBox#close
|
|
173
|
+
*/
|
|
174
|
+
close(): this;
|
|
175
|
+
/** Enables the box. @returns {this} */
|
|
176
|
+
enable(): this;
|
|
177
|
+
/** Disables the box and closes its popover. @returns {this} */
|
|
178
|
+
disable(): this;
|
|
179
|
+
/** Moves focus to the text input. @returns {this} */
|
|
180
|
+
focus(): this;
|
|
181
|
+
/** Cleans up the open popover, child picker, and generated host content. @returns {void} */
|
|
182
|
+
destroy(): void;
|
|
183
|
+
/**
|
|
184
|
+
* Stores a range, optionally pushing it back into the picker, and reports it.
|
|
185
|
+
* @param {DateRange} range Already-coerced range.
|
|
186
|
+
* @param {{silent?: boolean, push?: boolean}} [options={}] Update behavior.
|
|
187
|
+
* @returns {void}
|
|
188
|
+
* @fires DateRangeBox#change
|
|
189
|
+
*/
|
|
190
|
+
_apply(range: DateRange, { silent, push }?: {
|
|
191
|
+
silent?: boolean;
|
|
192
|
+
push?: boolean;
|
|
193
|
+
}): void;
|
|
194
|
+
/** @param {KeyboardEvent} event @returns {void} */
|
|
195
|
+
_onInputKeydown(event: KeyboardEvent): void;
|
|
196
|
+
/** @returns {void} */
|
|
197
|
+
_commitText(): void;
|
|
198
|
+
/**
|
|
199
|
+
* Coerces any accepted input shape into a bounded range of local dates.
|
|
200
|
+
* @param {unknown} value Range-ish input.
|
|
201
|
+
* @returns {DateRange}
|
|
202
|
+
*/
|
|
203
|
+
_coerce(value: unknown): DateRange;
|
|
204
|
+
/** @param {unknown} value @returns {Date|null} */
|
|
205
|
+
_toDate(value: unknown): Date | null;
|
|
206
|
+
/** @param {DateRange} range @returns {DateRange} */
|
|
207
|
+
_clamp(range: DateRange): DateRange;
|
|
208
|
+
/** @returns {string} */
|
|
209
|
+
_placeholder(): string;
|
|
210
|
+
/** @returns {void} */
|
|
211
|
+
_syncDisplay(): void;
|
|
212
|
+
/** @returns {void} */
|
|
213
|
+
_syncDisabled(): void;
|
|
214
|
+
/** @returns {void} */
|
|
215
|
+
_setValid(): void;
|
|
216
|
+
/** @param {boolean} returnFocus @returns {void} */
|
|
217
|
+
_close(returnFocus: boolean): void;
|
|
218
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { Component } from '../../core/component.js';
|
|
2
|
+
import { DatePicker } from '../date-picker/date-picker.js';
|
|
3
|
+
export type DateboxOptions = {
|
|
4
|
+
/**
|
|
5
|
+
* Date, Unix seconds, or formatted string.
|
|
6
|
+
*/
|
|
7
|
+
value?: Date | number | string | null;
|
|
8
|
+
/**
|
|
9
|
+
* Kernel date format.
|
|
10
|
+
*/
|
|
11
|
+
format?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Append `%H:%M` and show time controls.
|
|
14
|
+
*/
|
|
15
|
+
time?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Earliest selectable date.
|
|
18
|
+
*/
|
|
19
|
+
min?: Date | null;
|
|
20
|
+
/**
|
|
21
|
+
* Latest selectable date.
|
|
22
|
+
*/
|
|
23
|
+
max?: Date | null;
|
|
24
|
+
/**
|
|
25
|
+
* Input placeholder; null derives one from the format.
|
|
26
|
+
*/
|
|
27
|
+
placeholder?: string | null;
|
|
28
|
+
/**
|
|
29
|
+
* Show a clear button when a value is present.
|
|
30
|
+
*/
|
|
31
|
+
clearable?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Disable all controls.
|
|
34
|
+
*/
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Change listener.
|
|
38
|
+
*/
|
|
39
|
+
onchange?: (event: CustomEvent<{
|
|
40
|
+
date: Date | null;
|
|
41
|
+
}>) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Invalid-input listener.
|
|
44
|
+
*/
|
|
45
|
+
oninvalid?: (event: CustomEvent<{
|
|
46
|
+
text: string;
|
|
47
|
+
}>) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Open listener.
|
|
50
|
+
*/
|
|
51
|
+
onopen?: (event: CustomEvent<Record<string, never>>) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Close listener.
|
|
54
|
+
*/
|
|
55
|
+
onclose?: (event: CustomEvent<Record<string, never>>) => void;
|
|
56
|
+
};
|
|
57
|
+
export type DateboxSetOptions = {
|
|
58
|
+
silent?: boolean;
|
|
59
|
+
};
|
|
60
|
+
export type DateboxUnit = 'date' | 'seconds';
|
|
61
|
+
/**
|
|
62
|
+
* @typedef {Object} DateboxOptions
|
|
63
|
+
* @property {Date|number|string|null} [value=null] Date, Unix seconds, or formatted string.
|
|
64
|
+
* @property {string} [format='%d.%m.%Y'] Kernel date format.
|
|
65
|
+
* @property {boolean} [time=false] Append `%H:%M` and show time controls.
|
|
66
|
+
* @property {Date|null} [min=null] Earliest selectable date.
|
|
67
|
+
* @property {Date|null} [max=null] Latest selectable date.
|
|
68
|
+
* @property {string|null} [placeholder=null] Input placeholder; null derives one from the format.
|
|
69
|
+
* @property {boolean} [clearable=true] Show a clear button when a value is present.
|
|
70
|
+
* @property {boolean} [disabled=false] Disable all controls.
|
|
71
|
+
* @property {(event: CustomEvent<{date: Date|null}>) => void} [onchange] Change listener.
|
|
72
|
+
* @property {(event: CustomEvent<{text: string}>) => void} [oninvalid] Invalid-input listener.
|
|
73
|
+
* @property {(event: CustomEvent<Record<string, never>>) => void} [onopen] Open listener.
|
|
74
|
+
* @property {(event: CustomEvent<Record<string, never>>) => void} [onclose] Close listener.
|
|
75
|
+
*/
|
|
76
|
+
/** @typedef {{silent?: boolean}} DateboxSetOptions */
|
|
77
|
+
/** @typedef {'date'|'seconds'} DateboxUnit */
|
|
78
|
+
/**
|
|
79
|
+
* Formatted date input with an anchored calendar popover.
|
|
80
|
+
* @fires Datebox#change
|
|
81
|
+
* @fires Datebox#invalid
|
|
82
|
+
* @fires Datebox#open
|
|
83
|
+
* @fires Datebox#close
|
|
84
|
+
* @extends {Component<DateboxOptions>}
|
|
85
|
+
*/
|
|
86
|
+
export declare class Datebox extends Component<DateboxOptions> {
|
|
87
|
+
_originalState: string;
|
|
88
|
+
_originalAriaDisabled: string;
|
|
89
|
+
_format: string;
|
|
90
|
+
_disabled: boolean;
|
|
91
|
+
_open: boolean;
|
|
92
|
+
_position: import("../../core/position.js").PositionController;
|
|
93
|
+
_min: Date;
|
|
94
|
+
_max: Date;
|
|
95
|
+
_value: Date;
|
|
96
|
+
_content: HTMLElement;
|
|
97
|
+
_picker: DatePicker;
|
|
98
|
+
static cssName: string;
|
|
99
|
+
/** @type {DateboxOptions} */
|
|
100
|
+
static defaults: DateboxOptions;
|
|
101
|
+
/** @returns {HTMLElement} */
|
|
102
|
+
render(): HTMLElement;
|
|
103
|
+
/**
|
|
104
|
+
* Returns the selected date or Unix timestamp.
|
|
105
|
+
* @param {DateboxUnit} [unit='date'] Return unit.
|
|
106
|
+
* @returns {Date|number|null}
|
|
107
|
+
*/
|
|
108
|
+
get(unit?: DateboxUnit): Date | number | null;
|
|
109
|
+
/**
|
|
110
|
+
* Sets a Date, Unix-seconds number, formatted string, or null.
|
|
111
|
+
* @param {Date|number|string|null} value Value to set.
|
|
112
|
+
* @param {DateboxSetOptions} [options={}] Update behavior.
|
|
113
|
+
* @returns {this}
|
|
114
|
+
* @fires Datebox#change
|
|
115
|
+
*/
|
|
116
|
+
set(value: Date | number | string | null, { silent }?: DateboxSetOptions): this;
|
|
117
|
+
/**
|
|
118
|
+
* Opens and positions the calendar popover, then moves focus into its grid.
|
|
119
|
+
* @returns {this}
|
|
120
|
+
* @fires Datebox#open
|
|
121
|
+
*/
|
|
122
|
+
open(): this;
|
|
123
|
+
/**
|
|
124
|
+
* Closes the calendar popover.
|
|
125
|
+
* @returns {this}
|
|
126
|
+
* @fires Datebox#close
|
|
127
|
+
*/
|
|
128
|
+
close(): this;
|
|
129
|
+
/** Enables the datebox. @returns {this} */
|
|
130
|
+
enable(): this;
|
|
131
|
+
/** Disables the datebox and closes its popover. @returns {this} */
|
|
132
|
+
disable(): this;
|
|
133
|
+
/** Moves focus to the text input. @returns {this} */
|
|
134
|
+
focus(): this;
|
|
135
|
+
/** Cleans up the open popover, child picker, and generated host content. @returns {void} */
|
|
136
|
+
destroy(): void;
|
|
137
|
+
/** @param {KeyboardEvent} event @returns {void} */
|
|
138
|
+
_onInputKeydown(event: KeyboardEvent): void;
|
|
139
|
+
/** @returns {void} */
|
|
140
|
+
_commitText(): void;
|
|
141
|
+
/** @param {Date|number|string|null|unknown} value @returns {Date|null} */
|
|
142
|
+
_normalizeValue(value: Date | number | string | null | unknown): Date | null;
|
|
143
|
+
/** @returns {void} */
|
|
144
|
+
_syncDisplay(): void;
|
|
145
|
+
/** @returns {void} */
|
|
146
|
+
_syncDisabled(): void;
|
|
147
|
+
/** @returns {void} */
|
|
148
|
+
_setValid(): void;
|
|
149
|
+
/** @param {boolean} returnFocus @returns {void} */
|
|
150
|
+
_close(returnFocus: boolean): void;
|
|
151
|
+
/** @returns {Date|null} */
|
|
152
|
+
_copyValue(): Date | null;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Datebox factory with time selection enabled. It is callable with or without `new`.
|
|
156
|
+
* @param {Element|string|null} target Existing component root, selector, or null.
|
|
157
|
+
* @param {DateboxOptions} [options={}] Datebox options; `time` is always enabled.
|
|
158
|
+
* @returns {Datebox}
|
|
159
|
+
*/
|
|
160
|
+
export declare const DateTimeBox: (target: Element | string | null, options?: DateboxOptions) => Datebox;
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { Modal } from '../modal/modal.js';
|
|
2
|
+
export type DialogButtonKind = 'default' | 'primary' | 'danger' | 'ghost';
|
|
3
|
+
export type DialogButton = {
|
|
4
|
+
/**
|
|
5
|
+
* Button label.
|
|
6
|
+
*/
|
|
7
|
+
label: string;
|
|
8
|
+
/**
|
|
9
|
+
* Visual button kind.
|
|
10
|
+
*/
|
|
11
|
+
kind?: DialogButtonKind;
|
|
12
|
+
/**
|
|
13
|
+
* Button action.
|
|
14
|
+
*/
|
|
15
|
+
action?: 'close' | 'cancel' | ((dialog: Dialog) => void);
|
|
16
|
+
/**
|
|
17
|
+
* Whether this button receives initial focus.
|
|
18
|
+
*/
|
|
19
|
+
autofocus?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type DialogOptions = {
|
|
22
|
+
/**
|
|
23
|
+
* Dialog title.
|
|
24
|
+
*/
|
|
25
|
+
title?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Preset or pixel width.
|
|
28
|
+
*/
|
|
29
|
+
size?: 'sm' | 'md' | 'lg' | number;
|
|
30
|
+
/**
|
|
31
|
+
* Footer buttons.
|
|
32
|
+
*/
|
|
33
|
+
buttons?: DialogButton[];
|
|
34
|
+
/**
|
|
35
|
+
* Whether Escape and the header button may close the dialog.
|
|
36
|
+
*/
|
|
37
|
+
closable?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Body content.
|
|
40
|
+
*/
|
|
41
|
+
content?: Node | string | number | {
|
|
42
|
+
toElement: () => Node | null;
|
|
43
|
+
} | null;
|
|
44
|
+
/**
|
|
45
|
+
* Open event listener.
|
|
46
|
+
*/
|
|
47
|
+
onopen?: (event: CustomEvent<Record<string, never>>) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Close event listener.
|
|
50
|
+
*/
|
|
51
|
+
onclose?: (event: CustomEvent<{
|
|
52
|
+
result: unknown;
|
|
53
|
+
}>) => void;
|
|
54
|
+
/**
|
|
55
|
+
* Cancel event listener.
|
|
56
|
+
*/
|
|
57
|
+
oncancel?: (event: CustomEvent<Record<string, never>>) => void;
|
|
58
|
+
};
|
|
59
|
+
export type DialogViewOptions = {
|
|
60
|
+
/**
|
|
61
|
+
* View content.
|
|
62
|
+
*/
|
|
63
|
+
content: Node | string | number | {
|
|
64
|
+
toElement: () => Node | null;
|
|
65
|
+
} | null;
|
|
66
|
+
/**
|
|
67
|
+
* View-specific footer buttons.
|
|
68
|
+
*/
|
|
69
|
+
buttons?: DialogButton[];
|
|
70
|
+
/**
|
|
71
|
+
* View-specific title.
|
|
72
|
+
*/
|
|
73
|
+
title?: string;
|
|
74
|
+
};
|
|
75
|
+
export type DialogView = {
|
|
76
|
+
/**
|
|
77
|
+
* View key.
|
|
78
|
+
*/
|
|
79
|
+
key: string;
|
|
80
|
+
/**
|
|
81
|
+
* View content container.
|
|
82
|
+
*/
|
|
83
|
+
content: HTMLElement;
|
|
84
|
+
/**
|
|
85
|
+
* View-specific buttons, or null to use dialog buttons.
|
|
86
|
+
*/
|
|
87
|
+
buttons: DialogButton[] | null;
|
|
88
|
+
/**
|
|
89
|
+
* View-specific title, or null to use the dialog title.
|
|
90
|
+
*/
|
|
91
|
+
title: string | null;
|
|
92
|
+
};
|
|
93
|
+
export type AlertOptions = {
|
|
94
|
+
/**
|
|
95
|
+
* Alert title.
|
|
96
|
+
*/
|
|
97
|
+
title?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Alert message.
|
|
100
|
+
*/
|
|
101
|
+
message?: Node | string | number | null;
|
|
102
|
+
/**
|
|
103
|
+
* Confirmation label.
|
|
104
|
+
*/
|
|
105
|
+
okLabel?: string;
|
|
106
|
+
};
|
|
107
|
+
export type ConfirmOptions = {
|
|
108
|
+
/**
|
|
109
|
+
* Confirmation title.
|
|
110
|
+
*/
|
|
111
|
+
title?: string;
|
|
112
|
+
/**
|
|
113
|
+
* Confirmation message.
|
|
114
|
+
*/
|
|
115
|
+
message?: Node | string | number | null;
|
|
116
|
+
/**
|
|
117
|
+
* Confirmation label.
|
|
118
|
+
*/
|
|
119
|
+
okLabel?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Cancellation label.
|
|
122
|
+
*/
|
|
123
|
+
cancelLabel?: string;
|
|
124
|
+
/**
|
|
125
|
+
* Whether the confirmation action is dangerous.
|
|
126
|
+
*/
|
|
127
|
+
danger?: boolean;
|
|
128
|
+
};
|
|
129
|
+
export type PromptOptions = {
|
|
130
|
+
/**
|
|
131
|
+
* Prompt title.
|
|
132
|
+
*/
|
|
133
|
+
title?: string;
|
|
134
|
+
/**
|
|
135
|
+
* Prompt message.
|
|
136
|
+
*/
|
|
137
|
+
message?: Node | string | number | null;
|
|
138
|
+
/**
|
|
139
|
+
* Initial input value.
|
|
140
|
+
*/
|
|
141
|
+
value?: string;
|
|
142
|
+
/**
|
|
143
|
+
* Input placeholder.
|
|
144
|
+
*/
|
|
145
|
+
placeholder?: string;
|
|
146
|
+
};
|
|
147
|
+
/** @typedef {'default'|'primary'|'danger'|'ghost'} DialogButtonKind */
|
|
148
|
+
/**
|
|
149
|
+
* @typedef {Object} DialogButton
|
|
150
|
+
* @property {string} label Button label.
|
|
151
|
+
* @property {DialogButtonKind} [kind='default'] Visual button kind.
|
|
152
|
+
* @property {'close'|'cancel'|((dialog: Dialog) => void)} [action='close'] Button action.
|
|
153
|
+
* @property {boolean} [autofocus=false] Whether this button receives initial focus.
|
|
154
|
+
*/
|
|
155
|
+
/**
|
|
156
|
+
* @typedef {Object} DialogOptions
|
|
157
|
+
* @property {string} [title=''] Dialog title.
|
|
158
|
+
* @property {'sm'|'md'|'lg'|number} [size='md'] Preset or pixel width.
|
|
159
|
+
* @property {DialogButton[]} [buttons=[]] Footer buttons.
|
|
160
|
+
* @property {boolean} [closable=true] Whether Escape and the header button may close the dialog.
|
|
161
|
+
* @property {Node|string|number|{toElement: () => Node|null}|null} [content=null] Body content.
|
|
162
|
+
* @property {(event: CustomEvent<Record<string, never>>) => void} [onopen] Open event listener.
|
|
163
|
+
* @property {(event: CustomEvent<{result: unknown}>) => void} [onclose] Close event listener.
|
|
164
|
+
* @property {(event: CustomEvent<Record<string, never>>) => void} [oncancel] Cancel event listener.
|
|
165
|
+
*/
|
|
166
|
+
/**
|
|
167
|
+
* @typedef {Object} DialogViewOptions
|
|
168
|
+
* @property {Node|string|number|{toElement: () => Node|null}|null} content View content.
|
|
169
|
+
* @property {DialogButton[]} [buttons] View-specific footer buttons.
|
|
170
|
+
* @property {string} [title] View-specific title.
|
|
171
|
+
*/
|
|
172
|
+
/**
|
|
173
|
+
* @typedef {Object} DialogView
|
|
174
|
+
* @property {string} key View key.
|
|
175
|
+
* @property {HTMLElement} content View content container.
|
|
176
|
+
* @property {DialogButton[]|null} buttons View-specific buttons, or null to use dialog buttons.
|
|
177
|
+
* @property {string|null} title View-specific title, or null to use the dialog title.
|
|
178
|
+
*/
|
|
179
|
+
/**
|
|
180
|
+
* @typedef {Object} AlertOptions
|
|
181
|
+
* @property {string} [title=''] Alert title.
|
|
182
|
+
* @property {Node|string|number|null} [message=''] Alert message.
|
|
183
|
+
* @property {string} [okLabel='OK'] Confirmation label.
|
|
184
|
+
*/
|
|
185
|
+
/**
|
|
186
|
+
* @typedef {Object} ConfirmOptions
|
|
187
|
+
* @property {string} [title=''] Confirmation title.
|
|
188
|
+
* @property {Node|string|number|null} [message=''] Confirmation message.
|
|
189
|
+
* @property {string} [okLabel='OK'] Confirmation label.
|
|
190
|
+
* @property {string} [cancelLabel='Cancel'] Cancellation label.
|
|
191
|
+
* @property {boolean} [danger=false] Whether the confirmation action is dangerous.
|
|
192
|
+
*/
|
|
193
|
+
/**
|
|
194
|
+
* @typedef {Object} PromptOptions
|
|
195
|
+
* @property {string} [title=''] Prompt title.
|
|
196
|
+
* @property {Node|string|number|null} [message=''] Prompt message.
|
|
197
|
+
* @property {string} [value=''] Initial input value.
|
|
198
|
+
* @property {string} [placeholder=''] Input placeholder.
|
|
199
|
+
*/
|
|
200
|
+
/**
|
|
201
|
+
* Structured modal with a title, body, footer actions, and switchable views.
|
|
202
|
+
* @fires Modal#open
|
|
203
|
+
* @fires Modal#close
|
|
204
|
+
* @fires Modal#cancel
|
|
205
|
+
*/
|
|
206
|
+
export declare class Dialog extends Modal {
|
|
207
|
+
#private;
|
|
208
|
+
static cssName: string;
|
|
209
|
+
/** @type {Readonly<DialogOptions>} */
|
|
210
|
+
static defaults: Readonly<DialogOptions>;
|
|
211
|
+
/**
|
|
212
|
+
* Creates a structured dialog appended to `document.body`.
|
|
213
|
+
* @param {Element|string|null} [_target=null] Ignored; Dialog always owns its root.
|
|
214
|
+
* @param {DialogOptions} [options={}] Dialog options.
|
|
215
|
+
*/
|
|
216
|
+
constructor(_target?: Element | string | null, options?: DialogOptions);
|
|
217
|
+
/**
|
|
218
|
+
* Creates the structured native dialog.
|
|
219
|
+
* @returns {HTMLDialogElement}
|
|
220
|
+
*/
|
|
221
|
+
render(): HTMLDialogElement;
|
|
222
|
+
/**
|
|
223
|
+
* Opens the dialog and focuses its autofocus control or first focusable descendant.
|
|
224
|
+
* @returns {this}
|
|
225
|
+
*/
|
|
226
|
+
open(): this;
|
|
227
|
+
/**
|
|
228
|
+
* Sets the title shown in the dialog header.
|
|
229
|
+
* @param {string} title Title text.
|
|
230
|
+
* @returns {this}
|
|
231
|
+
*/
|
|
232
|
+
setTitle(title: string): this;
|
|
233
|
+
/**
|
|
234
|
+
* Replaces the body content and clears any registered views.
|
|
235
|
+
* @param {Node|string|number|{toElement: () => Node|null}|null} content Body content.
|
|
236
|
+
* @returns {this}
|
|
237
|
+
*/
|
|
238
|
+
setContent(content: Node | string | number | {
|
|
239
|
+
toElement: () => Node | null;
|
|
240
|
+
} | null): this;
|
|
241
|
+
/**
|
|
242
|
+
* Replaces the default footer buttons.
|
|
243
|
+
* @param {DialogButton[]} list Button definitions.
|
|
244
|
+
* @returns {this}
|
|
245
|
+
*/
|
|
246
|
+
setButtons(list: DialogButton[]): this;
|
|
247
|
+
/**
|
|
248
|
+
* Adds or replaces a named dialog view. The first view is shown immediately.
|
|
249
|
+
* @param {string} key View key.
|
|
250
|
+
* @param {DialogViewOptions} options View options.
|
|
251
|
+
* @returns {DialogView}
|
|
252
|
+
*/
|
|
253
|
+
addView(key: string, options: DialogViewOptions): DialogView;
|
|
254
|
+
/**
|
|
255
|
+
* Shows one registered view and applies its title and buttons.
|
|
256
|
+
* @param {string} key View key.
|
|
257
|
+
* @returns {DialogView}
|
|
258
|
+
*/
|
|
259
|
+
showView(key: string): DialogView;
|
|
260
|
+
/**
|
|
261
|
+
* Returns a registered view.
|
|
262
|
+
* @param {string} key View key.
|
|
263
|
+
* @returns {DialogView|null}
|
|
264
|
+
*/
|
|
265
|
+
getView(key: string): DialogView | null;
|
|
266
|
+
/**
|
|
267
|
+
* Opens an alert and resolves after it is dismissed.
|
|
268
|
+
* @param {AlertOptions} [options={}] Alert options.
|
|
269
|
+
* @returns {Promise<void>}
|
|
270
|
+
*/
|
|
271
|
+
static alert({ title, message, okLabel }?: AlertOptions): Promise<void>;
|
|
272
|
+
/**
|
|
273
|
+
* Opens a confirmation dialog.
|
|
274
|
+
* @param {ConfirmOptions} [options={}] Confirmation options.
|
|
275
|
+
* @returns {Promise<boolean>}
|
|
276
|
+
*/
|
|
277
|
+
static confirm({ title, message, okLabel, cancelLabel, danger }?: ConfirmOptions): Promise<boolean>;
|
|
278
|
+
/**
|
|
279
|
+
* Opens a single-line text prompt.
|
|
280
|
+
* @param {PromptOptions} [options={}] Prompt options.
|
|
281
|
+
* @returns {Promise<string|null>}
|
|
282
|
+
*/
|
|
283
|
+
static prompt({ title, message, value, placeholder }?: PromptOptions): Promise<string | null>;
|
|
284
|
+
}
|