@voidable/ui 0.6.1 → 0.8.0
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/README.md +168 -9
- package/dist/angular/index.d.ts +20 -0
- package/dist/angular/index.js +78 -0
- package/dist/autoloader-core.d.ts +45 -0
- package/dist/autoloader-table.generated.d.ts +5 -0
- package/dist/autoloader.d.ts +13 -0
- package/dist/autoloader.js +229 -0
- package/dist/base.d.ts +173 -2
- package/dist/base.js +2 -9
- package/dist/chunks/base-CMruMbxC.js +824 -0
- package/dist/chunks/disclosure-Bj_49GcC.js +23 -0
- package/dist/chunks/dismiss-Drsy_dE5.js +37 -0
- package/dist/chunks/form-control-C0vH6gii.js +300 -0
- package/dist/chunks/keyboard-MQpfTX5I.js +46 -0
- package/dist/chunks/keyboard-activation-CV0m4hkn.js +29 -0
- package/dist/chunks/modal-D_YVy2vg.js +71 -0
- package/dist/chunks/overlay-BywGMcDW.js +467 -0
- package/dist/chunks/parts-D30c8OoG.js +229 -0
- package/dist/chunks/{shape-FJvZa8FW.js → shape-C_LW7EjG.js} +12 -4
- package/dist/components/accordion.d.ts +38 -10
- package/dist/components/accordion.js +51 -53
- package/dist/components/action-input.d.ts +64 -6
- package/dist/components/action-input.js +84 -41
- package/dist/components/alert.d.ts +24 -10
- package/dist/components/alert.js +26 -27
- package/dist/components/avatar.d.ts +8 -2
- package/dist/components/avatar.js +3 -3
- package/dist/components/badge.d.ts +8 -3
- package/dist/components/badge.js +2 -2
- package/dist/components/banner.d.ts +21 -10
- package/dist/components/banner.js +27 -27
- package/dist/components/bar-chart.d.ts +30 -6
- package/dist/components/bar-chart.js +29 -39
- package/dist/components/breadcrumbs.d.ts +19 -6
- package/dist/components/breadcrumbs.js +16 -22
- package/dist/components/button.d.ts +64 -10
- package/dist/components/button.js +70 -26
- package/dist/components/calendar.d.ts +65 -10
- package/dist/components/calendar.js +157 -106
- package/dist/components/card.d.ts +14 -9
- package/dist/components/card.js +8 -22
- package/dist/components/carousel.d.ts +65 -14
- package/dist/components/carousel.js +84 -93
- package/dist/components/charts/scale.d.ts +0 -1
- package/dist/components/charts/shape.d.ts +0 -1
- package/dist/components/checkbox-group.d.ts +38 -5
- package/dist/components/checkbox-group.js +61 -20
- package/dist/components/checkbox.d.ts +53 -7
- package/dist/components/checkbox.js +66 -29
- package/dist/components/collapsible.d.ts +29 -9
- package/dist/components/collapsible.js +42 -44
- package/dist/components/color-picker.d.ts +20 -4
- package/dist/components/color-picker.js +35 -29
- package/dist/components/combobox.d.ts +84 -10
- package/dist/components/combobox.js +142 -45
- package/dist/components/compose-input.d.ts +8 -1
- package/dist/components/compose-input.js +9 -3
- package/dist/components/dialog.d.ts +24 -20
- package/dist/components/dialog.js +8 -57
- package/dist/components/divider.d.ts +8 -1
- package/dist/components/divider.js +3 -3
- package/dist/components/donut-chart.d.ts +28 -5
- package/dist/components/donut-chart.js +55 -54
- package/dist/components/drawer.d.ts +19 -18
- package/dist/components/drawer.js +9 -53
- package/dist/components/dropdown-menu.d.ts +62 -7
- package/dist/components/dropdown-menu.js +124 -33
- package/dist/components/editable.d.ts +37 -3
- package/dist/components/editable.js +45 -24
- package/dist/components/error-fallback.d.ts +36 -5
- package/dist/components/error-fallback.js +73 -23
- package/dist/components/field.d.ts +38 -4
- package/dist/components/field.js +63 -21
- package/dist/components/file-upload.d.ts +23 -2
- package/dist/components/file-upload.js +47 -24
- package/dist/components/gauge.d.ts +48 -9
- package/dist/components/gauge.js +57 -55
- package/dist/components/hamburger.d.ts +19 -4
- package/dist/components/hamburger.js +28 -19
- package/dist/components/hover-card.d.ts +40 -14
- package/dist/components/hover-card.js +76 -59
- package/dist/components/indicator.d.ts +18 -7
- package/dist/components/indicator.js +16 -18
- package/dist/components/input.d.ts +70 -5
- package/dist/components/input.js +83 -20
- package/dist/components/line-chart.d.ts +27 -5
- package/dist/components/line-chart.js +19 -21
- package/dist/components/list.d.ts +10 -1
- package/dist/components/list.js +3 -3
- package/dist/components/menu.d.ts +67 -21
- package/dist/components/menu.js +116 -115
- package/dist/components/multiselect.d.ts +108 -13
- package/dist/components/multiselect.js +207 -70
- package/dist/components/nav-bar.d.ts +12 -7
- package/dist/components/nav-bar.js +11 -21
- package/dist/components/nav-menu.d.ts +52 -12
- package/dist/components/nav-menu.js +68 -70
- package/dist/components/number-input.d.ts +76 -8
- package/dist/components/number-input.js +117 -51
- package/dist/components/pagination.d.ts +19 -1
- package/dist/components/pagination.js +68 -7
- package/dist/components/panel.d.ts +16 -8
- package/dist/components/panel.js +20 -20
- package/dist/components/pin-input.d.ts +41 -4
- package/dist/components/pin-input.js +45 -27
- package/dist/components/popover.d.ts +29 -11
- package/dist/components/popover.js +47 -35
- package/dist/components/progress.d.ts +7 -3
- package/dist/components/progress.js +3 -3
- package/dist/components/radio-group.d.ts +30 -5
- package/dist/components/radio-group.js +56 -19
- package/dist/components/radio.d.ts +47 -7
- package/dist/components/radio.js +68 -29
- package/dist/components/scroll-area.d.ts +8 -5
- package/dist/components/scroll-area.js +19 -20
- package/dist/components/segmented-control.d.ts +52 -8
- package/dist/components/segmented-control.js +66 -36
- package/dist/components/select.d.ts +59 -12
- package/dist/components/select.js +96 -46
- package/dist/components/sidebar.d.ts +22 -3
- package/dist/components/sidebar.js +20 -10
- package/dist/components/skeleton.d.ts +5 -2
- package/dist/components/skeleton.js +4 -4
- package/dist/components/slider.d.ts +27 -5
- package/dist/components/slider.js +29 -17
- package/dist/components/spinner.d.ts +6 -2
- package/dist/components/spinner.js +3 -3
- package/dist/components/stat.d.ts +21 -4
- package/dist/components/stat.js +7 -3
- package/dist/components/status-dot.d.ts +4 -1
- package/dist/components/status-dot.js +3 -3
- package/dist/components/stepper.d.ts +5 -1
- package/dist/components/stepper.js +2 -2
- package/dist/components/switch.d.ts +24 -5
- package/dist/components/switch.js +37 -19
- package/dist/components/table.d.ts +51 -2
- package/dist/components/table.js +157 -8
- package/dist/components/tabs.d.ts +49 -17
- package/dist/components/tabs.js +85 -54
- package/dist/components/tag.d.ts +17 -7
- package/dist/components/tag.js +19 -21
- package/dist/components/tags-input.d.ts +33 -4
- package/dist/components/tags-input.js +40 -30
- package/dist/components/textarea.d.ts +61 -5
- package/dist/components/textarea.js +58 -21
- package/dist/components/toast.d.ts +89 -15
- package/dist/components/toast.js +105 -30
- package/dist/components/toggle-group.d.ts +30 -3
- package/dist/components/toggle-group.js +43 -16
- package/dist/components/toggle.d.ts +25 -4
- package/dist/components/toggle.js +28 -18
- package/dist/components/tooltip.d.ts +31 -12
- package/dist/components/tooltip.js +62 -28
- package/dist/components.json +1518 -0
- package/dist/custom-elements.json +31817 -0
- package/dist/dev/index.d.ts +40 -0
- package/dist/dev/rules.d.ts +46 -0
- package/dist/dev/table.generated.d.ts +8 -0
- package/dist/dev/types.d.ts +113 -0
- package/dist/dev.js +3364 -0
- package/dist/disclosure.d.ts +30 -0
- package/dist/dismiss.d.ts +20 -0
- package/dist/form-control.d.ts +92 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +24 -24
- package/dist/keyboard-activation.d.ts +31 -0
- package/dist/keyboard.d.ts +32 -0
- package/dist/modal.d.ts +44 -0
- package/dist/overlay.d.ts +249 -0
- package/dist/parts.d.ts +171 -0
- package/dist/projection.d.ts +370 -0
- package/dist/types/elements.d.ts +648 -0
- package/dist/types/react.d.ts +163 -0
- package/dist/types/solid.d.ts +164 -0
- package/dist/types/solid2.d.ts +161 -0
- package/dist/types/svelte.d.ts +154 -0
- package/dist/types/vue.d.ts +156 -0
- package/dist/vscode.html-custom-data.json +6004 -0
- package/dist/web-types.json +8365 -0
- package/package.json +113 -21
- package/dist/base.d.ts.map +0 -1
- package/dist/components/accordion.d.ts.map +0 -1
- package/dist/components/action-input.d.ts.map +0 -1
- package/dist/components/alert.d.ts.map +0 -1
- package/dist/components/avatar.d.ts.map +0 -1
- package/dist/components/badge.d.ts.map +0 -1
- package/dist/components/banner.d.ts.map +0 -1
- package/dist/components/bar-chart.d.ts.map +0 -1
- package/dist/components/breadcrumbs.d.ts.map +0 -1
- package/dist/components/button.d.ts.map +0 -1
- package/dist/components/calendar.d.ts.map +0 -1
- package/dist/components/card.d.ts.map +0 -1
- package/dist/components/carousel.d.ts.map +0 -1
- package/dist/components/charts/scale.d.ts.map +0 -1
- package/dist/components/charts/shape.d.ts.map +0 -1
- package/dist/components/checkbox-group.d.ts.map +0 -1
- package/dist/components/checkbox.d.ts.map +0 -1
- package/dist/components/collapsible.d.ts.map +0 -1
- package/dist/components/color-picker.d.ts.map +0 -1
- package/dist/components/combobox.d.ts.map +0 -1
- package/dist/components/compose-input.d.ts.map +0 -1
- package/dist/components/dialog.d.ts.map +0 -1
- package/dist/components/divider.d.ts.map +0 -1
- package/dist/components/donut-chart.d.ts.map +0 -1
- package/dist/components/drawer.d.ts.map +0 -1
- package/dist/components/dropdown-menu.d.ts.map +0 -1
- package/dist/components/editable.d.ts.map +0 -1
- package/dist/components/error-fallback.d.ts.map +0 -1
- package/dist/components/field.d.ts.map +0 -1
- package/dist/components/file-upload.d.ts.map +0 -1
- package/dist/components/gauge.d.ts.map +0 -1
- package/dist/components/hamburger.d.ts.map +0 -1
- package/dist/components/hover-card.d.ts.map +0 -1
- package/dist/components/indicator.d.ts.map +0 -1
- package/dist/components/input.d.ts.map +0 -1
- package/dist/components/line-chart.d.ts.map +0 -1
- package/dist/components/list.d.ts.map +0 -1
- package/dist/components/menu.d.ts.map +0 -1
- package/dist/components/multiselect.d.ts.map +0 -1
- package/dist/components/nav-bar.d.ts.map +0 -1
- package/dist/components/nav-menu.d.ts.map +0 -1
- package/dist/components/number-input.d.ts.map +0 -1
- package/dist/components/pagination.d.ts.map +0 -1
- package/dist/components/panel.d.ts.map +0 -1
- package/dist/components/pin-input.d.ts.map +0 -1
- package/dist/components/popover.d.ts.map +0 -1
- package/dist/components/progress.d.ts.map +0 -1
- package/dist/components/radio-group.d.ts.map +0 -1
- package/dist/components/radio.d.ts.map +0 -1
- package/dist/components/scroll-area.d.ts.map +0 -1
- package/dist/components/segmented-control.d.ts.map +0 -1
- package/dist/components/select.d.ts.map +0 -1
- package/dist/components/sidebar.d.ts.map +0 -1
- package/dist/components/skeleton.d.ts.map +0 -1
- package/dist/components/slider.d.ts.map +0 -1
- package/dist/components/spinner.d.ts.map +0 -1
- package/dist/components/stat.d.ts.map +0 -1
- package/dist/components/status-dot.d.ts.map +0 -1
- package/dist/components/stepper.d.ts.map +0 -1
- package/dist/components/switch.d.ts.map +0 -1
- package/dist/components/table.d.ts.map +0 -1
- package/dist/components/tabs.d.ts.map +0 -1
- package/dist/components/tag.d.ts.map +0 -1
- package/dist/components/tags-input.d.ts.map +0 -1
- package/dist/components/textarea.d.ts.map +0 -1
- package/dist/components/toast.d.ts.map +0 -1
- package/dist/components/toggle-group.d.ts.map +0 -1
- package/dist/components/toggle.d.ts.map +0 -1
- package/dist/components/tooltip.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
|
@@ -1,56 +1,100 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as e } from "../chunks/base-CMruMbxC.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import {
|
|
3
|
+
import { t as n } from "../chunks/keyboard-activation-CV0m4hkn.js";
|
|
4
|
+
import { i as r, r as i } from "../chunks/form-control-C0vH6gii.js";
|
|
5
|
+
import { property as a } from "lit/decorators.js";
|
|
4
6
|
//#region src/components/button.ts
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
this.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
var o = class extends e {
|
|
8
|
+
constructor(...e) {
|
|
9
|
+
super(...e), this.variant = "outline", this.color = "default", this.disabled = !1, this.type = "button", this.size = "md", this._unwatch = null, this._inert = null, this._observer = null, this._syncQueued = !1, this._activation = new n(this, {
|
|
10
|
+
disabled: () => this.formDisabled,
|
|
11
|
+
enter: () => !this._control,
|
|
12
|
+
space: () => !this._control
|
|
13
|
+
}), this._blockDisabledControl = (e) => {
|
|
14
|
+
e.target === this || !this.formDisabled || !this._control || (e.preventDefault(), e.stopImmediatePropagation());
|
|
15
|
+
}, this._handleClick = (e) => {
|
|
16
|
+
if (this.formDisabled) {
|
|
17
|
+
e.preventDefault(), e.stopImmediatePropagation();
|
|
13
18
|
return;
|
|
14
19
|
}
|
|
15
20
|
this.type === "submit" ? this._form?.requestSubmit() : this.type === "reset" && this._form?.reset(), this.dispatchEvent(new CustomEvent("void-click", {
|
|
16
21
|
bubbles: !0,
|
|
17
22
|
composed: !0
|
|
18
23
|
}));
|
|
19
|
-
}, this._handleKeydown = (e) => {
|
|
20
|
-
(e.key === "Enter" || e.key === " ") && !this.disabled && (e.preventDefault(), this._handleClick(e));
|
|
21
24
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
}
|
|
26
|
+
get _control() {
|
|
27
|
+
return this.querySelector(":scope > a[href], :scope > button");
|
|
25
28
|
}
|
|
26
29
|
get _form() {
|
|
27
|
-
return this.
|
|
30
|
+
return this.closest("form");
|
|
28
31
|
}
|
|
29
32
|
connectedCallback() {
|
|
30
|
-
super.connectedCallback(), this.
|
|
33
|
+
super.connectedCallback(), this.addEventListener("click", this._handleClick), this.addEventListener("click", this._blockDisabledControl, !0), this._syncDisabledState(this.formDisabled), this._unwatch = r(this, () => this._syncDisabledState(this.formDisabled)), this._observer ??= new MutationObserver((e) => {
|
|
34
|
+
e.some((e) => e.type === "childList" || e.target !== this) && this._requestSync();
|
|
35
|
+
}), this._observer.observe(this, {
|
|
36
|
+
childList: !0,
|
|
37
|
+
subtree: !0,
|
|
38
|
+
attributes: !0,
|
|
39
|
+
attributeFilter: [
|
|
40
|
+
"href",
|
|
41
|
+
"aria-disabled",
|
|
42
|
+
"tabindex",
|
|
43
|
+
"disabled"
|
|
44
|
+
]
|
|
45
|
+
});
|
|
31
46
|
}
|
|
32
47
|
disconnectedCallback() {
|
|
33
|
-
super.disconnectedCallback(), this.removeEventListener("click", this._handleClick), this.removeEventListener("
|
|
48
|
+
super.disconnectedCallback(), this.removeEventListener("click", this._handleClick), this.removeEventListener("click", this._blockDisabledControl, !0), this._unwatch?.(), this._unwatch = null, this._observer?.disconnect();
|
|
34
49
|
}
|
|
35
50
|
updated(e) {
|
|
36
|
-
e.has("disabled") &&
|
|
51
|
+
e.has("disabled") && this._syncDisabledState(this.formDisabled);
|
|
52
|
+
}
|
|
53
|
+
get formDisabled() {
|
|
54
|
+
return this.disabled || i(this);
|
|
55
|
+
}
|
|
56
|
+
_requestSync() {
|
|
57
|
+
this._syncQueued || (this._syncQueued = !0, queueMicrotask(() => {
|
|
58
|
+
this._syncQueued = !1, this.isConnected && this._syncDisabledState(this.formDisabled);
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
_syncDisabledState(e) {
|
|
62
|
+
let t = this._control;
|
|
63
|
+
if (t) {
|
|
64
|
+
this.setHostAttribute("role", null), this.setHostAttribute("tabindex", null), this.setHostAttribute("aria-disabled", null), (!e || this._inert?.el !== t) && this._release(), e && this._disableControl(t);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
this._release(), this.setHostAttribute("role", "button"), this.setHostAttribute("aria-disabled", e ? "true" : null), this.setHostAttribute("tabindex", e ? "-1" : "0");
|
|
68
|
+
}
|
|
69
|
+
_disableControl(e) {
|
|
70
|
+
let t = this._inert?.el === e ? this._inert : {
|
|
71
|
+
el: e,
|
|
72
|
+
aria: !1,
|
|
73
|
+
tabindex: !1,
|
|
74
|
+
disabled: !1
|
|
75
|
+
};
|
|
76
|
+
e instanceof HTMLButtonElement ? e.disabled || (e.disabled = !0, t.disabled = !0) : (e.hasAttribute("aria-disabled") || (e.setAttribute("aria-disabled", "true"), t.aria = !0), e.hasAttribute("tabindex") || (e.setAttribute("tabindex", "-1"), t.tabindex = !0)), this._inert = t;
|
|
77
|
+
}
|
|
78
|
+
_release() {
|
|
79
|
+
let e = this._inert;
|
|
80
|
+
e && (this._inert = null, e.el instanceof HTMLButtonElement ? e.disabled && (e.el.disabled = !1) : (e.aria && e.el.removeAttribute("aria-disabled"), e.tabindex && e.el.removeAttribute("tabindex")));
|
|
37
81
|
}
|
|
38
82
|
};
|
|
39
|
-
t([
|
|
83
|
+
t([a({
|
|
40
84
|
type: String,
|
|
41
85
|
reflect: !0
|
|
42
|
-
})],
|
|
86
|
+
})], o.prototype, "variant", void 0), t([a({
|
|
43
87
|
type: String,
|
|
44
88
|
reflect: !0
|
|
45
|
-
})],
|
|
89
|
+
})], o.prototype, "color", void 0), t([a({
|
|
46
90
|
type: Boolean,
|
|
47
91
|
reflect: !0
|
|
48
|
-
})],
|
|
92
|
+
})], o.prototype, "disabled", void 0), t([a({
|
|
49
93
|
type: String,
|
|
50
94
|
reflect: !0
|
|
51
|
-
})],
|
|
95
|
+
})], o.prototype, "type", void 0), t([a({
|
|
52
96
|
type: String,
|
|
53
97
|
reflect: !0
|
|
54
|
-
})],
|
|
98
|
+
})], o.prototype, "size", void 0), customElements.get("void-button") || customElements.define("void-button", o);
|
|
55
99
|
//#endregion
|
|
56
|
-
export {
|
|
100
|
+
export { o as VoidButton };
|
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
import { VoidElement } from '../base.js';
|
|
2
|
+
import { OverlayController } from '../overlay.js';
|
|
3
|
+
declare const VoidCalendar_base: (new (...args: any[]) => import('../form-control.js').VoidInternalsFormControl) & typeof VoidElement;
|
|
2
4
|
/** Date selection for booking flows, scheduling UIs, and form fields with locale-aware formatting and min/max constraints. */
|
|
3
|
-
export declare class VoidCalendar extends
|
|
5
|
+
export declare class VoidCalendar extends VoidCalendar_base {
|
|
6
|
+
/**
|
|
7
|
+
* Selected date as an ISO `YYYY-MM-DD` string. Empty means no selection. It is what the form submits
|
|
8
|
+
* and the reset target; picking a day updates it and fires `void-change`.
|
|
9
|
+
*/
|
|
4
10
|
value: string;
|
|
11
|
+
/** Earliest selectable date, as `YYYY-MM-DD`. Earlier days are disabled. */
|
|
5
12
|
min: string;
|
|
13
|
+
/** Latest selectable date, as `YYYY-MM-DD`. Later days are disabled. */
|
|
6
14
|
max: string;
|
|
15
|
+
/** Stop the calendar reacting and exclude the value from the form submission. */
|
|
7
16
|
disabled: boolean;
|
|
17
|
+
/** Size step: `sm`, `md` (default) or `lg`. */
|
|
8
18
|
size: 'sm' | 'md' | 'lg';
|
|
19
|
+
/**
|
|
20
|
+
* BCP 47 language tag for month and weekday names and the long date announced for each day, such as
|
|
21
|
+
* `de-DE`. Defaults to `en-US`.
|
|
22
|
+
*/
|
|
9
23
|
locale: string;
|
|
24
|
+
/** Day the week starts on, as a number from 0 (Sunday, the default) to 6 (Saturday). Use 1 for Monday. */
|
|
10
25
|
firstDay: number;
|
|
11
26
|
private _viewYear;
|
|
12
27
|
private _viewMonth;
|
|
@@ -20,6 +35,7 @@ export declare class VoidCalendar extends VoidElement {
|
|
|
20
35
|
private _syncViewToValue;
|
|
21
36
|
render(): import('lit').TemplateResult<1>;
|
|
22
37
|
private _renderDays;
|
|
38
|
+
private _formatFullDate;
|
|
23
39
|
private _getDayNames;
|
|
24
40
|
private _getMonthName;
|
|
25
41
|
private _buildDayCells;
|
|
@@ -35,6 +51,8 @@ export declare class VoidCalendar extends VoidElement {
|
|
|
35
51
|
private _showMonths;
|
|
36
52
|
private _showYears;
|
|
37
53
|
private _pickMonth;
|
|
54
|
+
/** Move the roving-tabindex day into the visible month, keeping the day-of-month where possible. */
|
|
55
|
+
private _syncFocusToView;
|
|
38
56
|
private _pickYear;
|
|
39
57
|
private _selectDate;
|
|
40
58
|
private _onDayKeydown;
|
|
@@ -44,27 +62,64 @@ declare global {
|
|
|
44
62
|
'void-calendar': VoidCalendar;
|
|
45
63
|
}
|
|
46
64
|
}
|
|
47
|
-
|
|
48
|
-
|
|
65
|
+
declare const VoidDatePicker_base: (new (...args: any[]) => import('../form-control.js').VoidInternalsFormControl) & typeof VoidElement;
|
|
66
|
+
/**
|
|
67
|
+
* Input-anchored date picker that combines a text field with a VoidCalendar dropdown for form date selection.
|
|
68
|
+
*
|
|
69
|
+
* The calendar opens in a non-modal popup dialog in the top layer, placed under the input with CSS anchor
|
|
70
|
+
* positioning (flipping above near the bottom of the viewport). A click on the field opens it and leaves focus
|
|
71
|
+
* in the field (ArrowDown then moves into the calendar); the calendar button, Enter, Space or ArrowDown on the
|
|
72
|
+
* field open it with focus on the selected (or current) day. Choosing a day, Escape, or a press outside closes
|
|
73
|
+
* it and focus returns to the input.
|
|
74
|
+
*
|
|
75
|
+
* @fires {CustomEvent<{ reason: 'trigger' | 'focus' | 'keyboard' | 'api' }>} void-open - The calendar popup
|
|
76
|
+
* opened: `trigger` from the calendar button, `focus` from a click on the field, `keyboard` from a key.
|
|
77
|
+
* @fires {CustomEvent<{ reason: 'trigger' | 'select' | 'escape' | 'outside' | 'blur' | 'parent' | 'api' }>} void-close -
|
|
78
|
+
* The calendar popup is closing. Cancelable when the user caused it.
|
|
79
|
+
*/
|
|
80
|
+
export declare class VoidDatePicker extends VoidDatePicker_base {
|
|
81
|
+
/** The host's `aria-label` / `aria-labelledby` name the inner control. */
|
|
82
|
+
static labelTarget: string;
|
|
83
|
+
/**
|
|
84
|
+
* Selected date as an ISO `YYYY-MM-DD` string, whatever `format` shows. It is what the form submits
|
|
85
|
+
* and the reset target.
|
|
86
|
+
*/
|
|
49
87
|
value: string;
|
|
88
|
+
/** Earliest selectable date, as `YYYY-MM-DD`. */
|
|
50
89
|
min: string;
|
|
90
|
+
/** Latest selectable date, as `YYYY-MM-DD`. */
|
|
51
91
|
max: string;
|
|
92
|
+
/** Stop the field and its calendar reacting and exclude the value from the form submission. */
|
|
52
93
|
disabled: boolean;
|
|
94
|
+
/** Size step: `sm`, `md` (default) or `lg`. */
|
|
53
95
|
size: 'sm' | 'md' | 'lg';
|
|
96
|
+
/**
|
|
97
|
+
* BCP 47 language tag for the calendar's month and weekday names, such as `de-DE`. Defaults to
|
|
98
|
+
* `en-US`. It does not change `format`.
|
|
99
|
+
*/
|
|
54
100
|
locale: string;
|
|
101
|
+
/** Day the calendar week starts on, as a number from 0 (Sunday, the default) to 6 (Saturday). */
|
|
55
102
|
firstDay: number;
|
|
103
|
+
/** Whether the calendar dropdown is showing. Clicking the field or button toggles it; Escape closes it. */
|
|
56
104
|
open: boolean;
|
|
105
|
+
/** Hint shown in the field while no date is chosen. Defaults to `Select date`. */
|
|
57
106
|
placeholder: string;
|
|
107
|
+
/**
|
|
108
|
+
* How the chosen date is written in the field, using `YYYY`, `MM` and `DD`. Defaults to `MM/DD/YYYY`.
|
|
109
|
+
* Display only; the value stays `YYYY-MM-DD`.
|
|
110
|
+
*/
|
|
58
111
|
format: string;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
112
|
+
/** Status colour of the field: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. */
|
|
113
|
+
color: 'default' | 'error' | 'warning' | 'caution' | 'success' | 'info' | 'notice' | 'highlight';
|
|
114
|
+
/** The calendar popup, controlled by the input (APG date picker combobox). */
|
|
115
|
+
private readonly _dropdownId;
|
|
116
|
+
protected readonly _overlay: OverlayController;
|
|
117
|
+
/** Focus the calendar's roving day once it has rendered. */
|
|
118
|
+
private _focusDay;
|
|
63
119
|
render(): import('lit').TemplateResult<1>;
|
|
64
120
|
private _toggle;
|
|
121
|
+
private _onInputClick;
|
|
65
122
|
private _onCalendarChange;
|
|
66
|
-
private _onDocumentClick;
|
|
67
|
-
private _onDocumentKeydown;
|
|
68
123
|
private _onInputKeydown;
|
|
69
124
|
}
|
|
70
125
|
declare global {
|
|
@@ -72,4 +127,4 @@ declare global {
|
|
|
72
127
|
'void-date-picker': VoidDatePicker;
|
|
73
128
|
}
|
|
74
129
|
}
|
|
75
|
-
|
|
130
|
+
export {};
|