@golemui/gui-lit 1.2.0 → 1.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 +31 -0
- package/{accordion.element-BIgxl5e9.js → accordion.element-C9GzfKrY.js} +29 -30
- package/alert.element-CHn49Yaf.js +55 -0
- package/button.element-C9fHivSw.js +59 -0
- package/{calendar.element-Cv3RBphf.js → calendar.element-XkojKTJk.js} +30 -31
- package/checkbox.element-DU_tVMXu.js +66 -0
- package/currency.element-BmAH5KS_.js +73 -0
- package/date-picker.element-Bg3rF95F.js +94 -0
- package/{date-time-calendar.element-DlbWZjoe.js → date-time-calendar.element-sywQCeQQ.js} +24 -24
- package/date-time-picker.element-HHpwjWTQ.js +107 -0
- package/{date-time.element-CLLxM2nV.js → date-time.element-ucETvSTC.js} +26 -26
- package/{date.element-B8ZHK9KJ.js → date.element-BEHGxRFF.js} +27 -27
- package/default-list-item-renderer-CuPJ9jUD.js +24 -0
- package/{dropdown.element-DMZ7oL5n.js → dropdown.element-DUqG_p1x.js} +85 -84
- package/{flex.element-DG4Uaj_X.js → flex.element-pwba7621.js} +27 -28
- package/{grid.element-DCZsh-3J.js → grid.element-C8K7_Qi3.js} +29 -30
- package/index.js +1316 -3883
- package/index.umd.cjs +117 -2132
- package/{list.element-ADtUK2na.js → list.element-ZtEMKE2x.js} +41 -40
- package/markdown-text.element-DDm36qD0.js +54 -0
- package/markdown.element-DWz3U9rG.js +84 -0
- package/number.element-VkG5wScD.js +71 -0
- package/package.json +6 -6
- package/password.element-C5vQHq5P.js +72 -0
- package/radiogroup.element-CKdO9HwO.js +69 -0
- package/{range-calendar.element-D5eb2f7p.js → range-calendar.element-BznGrej5.js} +23 -24
- package/{range-date-input.element-C35grlYo.js → range-date-input.element-BloTHRDl.js} +24 -24
- package/range-date-picker.element-DKhwFasW.js +98 -0
- package/{range-date-time-calendar.element-BV0J96Gu.js → range-date-time-calendar.element-CZCET-sb.js} +26 -26
- package/{range-date-time-input.element-CzgRbR9F.js → range-date-time-input.element-Dr2VrYhG.js} +24 -24
- package/range-date-time-picker.element-CYeIMWLp.js +109 -0
- package/{range-time-input.element-BOHLUO8z.js → range-time-input.element-7OZhPQqx.js} +23 -23
- package/range-time-picker.element-D0mRFZkK.js +96 -0
- package/renderer.element-DbsFoBba.js +48 -0
- package/{repeater.element-Da8YN1Vy.js → repeater.element-DGEbwvhY.js} +54 -65
- package/select.element-Bb_9jAVB.js +76 -0
- package/{tabs.element-CvcIA8P3.js → tabs.element-BYDNF_pm.js} +49 -50
- package/tags.element-BSN3i9Gx.js +73 -0
- package/textarea.element-Dl1ZEOqO.js +71 -0
- package/textinput.element-C5Vbbkxq.js +68 -0
- package/{time-picker.element-C3oR0EkQ.js → time-picker.element-Crmj9YDy.js} +26 -26
- package/{time.element-X286nthD.js → time.element-DfSeAZp4.js} +29 -29
- package/toggle.element-ORsprZ2M.js +66 -0
- package/alert.element-DPWq9-0F.js +0 -56
- package/button.element-CJay43iR.js +0 -132
- package/calendar-DleRbmvP.js +0 -267
- package/checkbox.element-CpmrzdH0.js +0 -200
- package/currency.element-Cezgzbbs.js +0 -276
- package/date-DBuYpvcO.js +0 -849
- package/date-input-B3yHsn-g.js +0 -204
- package/date-picker.element-ByZefznr.js +0 -357
- package/date-time-calendar-CB5cNoOX.js +0 -374
- package/date-time-input-DrY68YDX.js +0 -246
- package/date-time-picker.element-CYwmumfq.js +0 -440
- package/day-status-ljexnwEO.js +0 -554
- package/errors-Bs_vYN-_.js +0 -110
- package/focus-leave.controller-2gV0pQd5.js +0 -73
- package/list-D730tmGN.js +0 -297
- package/markdown-text-X-BRJT6K.js +0 -30
- package/markdown-text.element-B8TfVLIO.js +0 -55
- package/markdown.element-D5zcxAUS.js +0 -693
- package/number.element-DEY5tR_y.js +0 -291
- package/numeric-jmOOKz30.js +0 -12
- package/one-of-anKkm7mD.js +0 -50
- package/part-templates-VORbpgs2.js +0 -691
- package/password.element-C1aQh_iz.js +0 -240
- package/pill-ranges-DpvWwP-3.js +0 -48
- package/pills-BDMO2NiR.js +0 -348
- package/popup.controller-B33OvX_y.js +0 -86
- package/radiogroup.element-B2G-XyGx.js +0 -235
- package/range-calendar-D7sG24Kx.js +0 -466
- package/range-commit-8-MmYUyo.js +0 -14
- package/range-date-input-BChaoBC1.js +0 -311
- package/range-date-picker.element-Do5YsL5V.js +0 -434
- package/range-date-time-calendar-DulGK2EQ.js +0 -734
- package/range-date-time-input-8ggqckP7.js +0 -353
- package/range-date-time-picker.element-hi5KdopZ.js +0 -472
- package/range-selection-CU3hxLJE.js +0 -25
- package/range-time-input-D7GFdDeA.js +0 -348
- package/range-time-picker.element-DDNQMA_u.js +0 -470
- package/renderer.element-CNyMn2Lu.js +0 -49
- package/select.element-SDxBhGjz.js +0 -266
- package/tabs-DzSCq_98.js +0 -13
- package/tags.element-Bnhfevp3.js +0 -369
- package/templates-Df7abEkB.js +0 -92
- package/textarea.element-Dx7eYEnl.js +0 -239
- package/textinput.element-BnIoDRmY.js +0 -205
- package/time-input-Kk4EX6at.js +0 -201
- package/time-list-DLcq8BAp.js +0 -217
- package/time-picker-DLj1rhOf.js +0 -299
- package/toggle.element-Dokdat_o.js +0 -203
package/date-input-B3yHsn-g.js
DELETED
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
import { LitElement as u, nothing as p, html as h } from "lit";
|
|
2
|
-
import { property as i, customElement as c } from "lit/decorators.js";
|
|
3
|
-
import { classMap as g } from "lit/directives/class-map.js";
|
|
4
|
-
import { G as y, b as m, c as b } from "./templates-Df7abEkB.js";
|
|
5
|
-
import { n as v, G as D, r as f, q as E, P as A } from "./part-templates-VORbpgs2.js";
|
|
6
|
-
import { a as C, d as S } from "./date-DBuYpvcO.js";
|
|
7
|
-
var w = Object.defineProperty, P = Object.getOwnPropertyDescriptor, e = (s, a, l, r) => {
|
|
8
|
-
for (var o = r > 1 ? void 0 : r ? P(a, l) : a, d = s.length - 1, n; d >= 0; d--)
|
|
9
|
-
(n = s[d]) && (o = (r ? n(a, l, o) : n(o)) || o);
|
|
10
|
-
return r && o && w(a, l, o), o;
|
|
11
|
-
};
|
|
12
|
-
let t = class extends u {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(...arguments), this.uid = void 0, this.label = void 0, this.localeId = void 0, this.errors = [], this.showErrors = !0, this.touched = !1, this.required = !1, this.disabled = !1, this.readOnly = !1, this.icon = "", this.hint = void 0, this.dayAriaLabel = void 0, this.monthAriaLabel = void 0, this.yearAriaLabel = void 0, this.value = void 0, this.invalidDateMessage = void 0, this.minDate = void 0, this.maxDate = void 0, this.minDateMessage = void 0, this.maxDateMessage = void 0, this.inputBlockClass = "gui-date-input", this.groups = ["default"], this.partDescriptors = v(), this._parts = new D(this, {
|
|
15
|
-
blockClass: this.inputBlockClass,
|
|
16
|
-
groups: this.groups,
|
|
17
|
-
getDescriptor: (s) => this.getPartDescriptor(s),
|
|
18
|
-
commitGroup: (s) => this.validateAndEmit(s),
|
|
19
|
-
isReadonly: () => !!this.readOnly,
|
|
20
|
-
isDisabled: () => !!this.disabled,
|
|
21
|
-
onEmptyPartBlur: () => this.dispatchEvent(new CustomEvent("change", { detail: { value: null }, bubbles: !0 }))
|
|
22
|
-
}), this.ariaController = new y(this, {
|
|
23
|
-
getTargets: () => this.querySelectorAll(`.${this.inputBlockClass}`),
|
|
24
|
-
getState: () => ({
|
|
25
|
-
uid: this.uid,
|
|
26
|
-
templateData: {
|
|
27
|
-
hint: this.hint,
|
|
28
|
-
errors: this.errors,
|
|
29
|
-
readonly: this.readOnly,
|
|
30
|
-
disabled: this.disabled,
|
|
31
|
-
touched: this.touched,
|
|
32
|
-
required: this.required
|
|
33
|
-
}
|
|
34
|
-
})
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
createRenderRoot() {
|
|
38
|
-
return this;
|
|
39
|
-
}
|
|
40
|
-
connectedCallback() {
|
|
41
|
-
super.connectedCallback(), this.classList.add("gui-field");
|
|
42
|
-
}
|
|
43
|
-
getPartDescriptor(s) {
|
|
44
|
-
return this.partDescriptors[s];
|
|
45
|
-
}
|
|
46
|
-
willUpdate(s) {
|
|
47
|
-
s.has("value") && this._parts.setGroupFromISO("default", this.value ?? "", "date");
|
|
48
|
-
}
|
|
49
|
-
render() {
|
|
50
|
-
const s = {
|
|
51
|
-
uid: this.uid,
|
|
52
|
-
label: this.label,
|
|
53
|
-
errors: this.errors,
|
|
54
|
-
touched: this.touched,
|
|
55
|
-
required: this.required,
|
|
56
|
-
disabled: this.disabled,
|
|
57
|
-
readonly: this.readOnly,
|
|
58
|
-
value: this.value,
|
|
59
|
-
icon: this.icon,
|
|
60
|
-
hint: this.hint
|
|
61
|
-
}, a = {
|
|
62
|
-
blockClass: this.inputBlockClass,
|
|
63
|
-
groups: this.groups,
|
|
64
|
-
formatParts: C(this.localeId),
|
|
65
|
-
getDescriptor: (r) => this.getPartDescriptor(r),
|
|
66
|
-
getDisplayValue: this._parts.getPartDisplay,
|
|
67
|
-
getPartAriaLabel: (r, o) => ({
|
|
68
|
-
day: this.dayAriaLabel,
|
|
69
|
-
month: this.monthAriaLabel,
|
|
70
|
-
year: this.yearAriaLabel
|
|
71
|
-
})[o] ?? A[o],
|
|
72
|
-
disabled: this.disabled,
|
|
73
|
-
partsReadonly: !!this.readOnly
|
|
74
|
-
}, l = {
|
|
75
|
-
"gui-widget-icon": !0,
|
|
76
|
-
[this.icon]: !0
|
|
77
|
-
};
|
|
78
|
-
return h`
|
|
79
|
-
${this.label ? m(this.uid, s, !1, void 0, !1) : p}
|
|
80
|
-
|
|
81
|
-
<div class="gui-widget">
|
|
82
|
-
<div
|
|
83
|
-
id=${this.uid}
|
|
84
|
-
class="gui-widget-input gui-parts gui-parts-ring gui-date-input ${this.icon ? "gui-calendar--icon" : ""}"
|
|
85
|
-
role="group"
|
|
86
|
-
aria-labelledby=${`${this.uid}_label`}
|
|
87
|
-
>
|
|
88
|
-
${f("default", a, this._parts)}
|
|
89
|
-
</div>
|
|
90
|
-
${this.icon ? h`<span
|
|
91
|
-
class=${g(l)}
|
|
92
|
-
data-icon=${this.icon}
|
|
93
|
-
aria-hidden="true"
|
|
94
|
-
></span>` : p}
|
|
95
|
-
</div>
|
|
96
|
-
|
|
97
|
-
${this.showErrors && this.errors?.length ? b(this.uid, s) : p}
|
|
98
|
-
`;
|
|
99
|
-
}
|
|
100
|
-
validateAndEmit(s) {
|
|
101
|
-
const { result: a, writeBacks: l } = E(this._parts.values[s] ?? {}, {
|
|
102
|
-
descriptors: this.partDescriptors,
|
|
103
|
-
invalidDateMessage: this.invalidDateMessage
|
|
104
|
-
});
|
|
105
|
-
if (this._parts.applyWriteBacks(s, l), a.kind === "invalid")
|
|
106
|
-
this.dispatchEvent(
|
|
107
|
-
new CustomEvent("inputError", {
|
|
108
|
-
detail: { message: a.message },
|
|
109
|
-
bubbles: !0
|
|
110
|
-
})
|
|
111
|
-
);
|
|
112
|
-
else if (a.kind === "valid") {
|
|
113
|
-
const r = S(a.iso, this.minDate, this.maxDate, void 0, {
|
|
114
|
-
minDateMessage: this.minDateMessage,
|
|
115
|
-
maxDateMessage: this.maxDateMessage
|
|
116
|
-
});
|
|
117
|
-
if (r) {
|
|
118
|
-
this.dispatchEvent(
|
|
119
|
-
new CustomEvent("change", {
|
|
120
|
-
detail: { value: a.iso },
|
|
121
|
-
bubbles: !0
|
|
122
|
-
})
|
|
123
|
-
), this.dispatchEvent(
|
|
124
|
-
new CustomEvent("inputError", {
|
|
125
|
-
detail: { message: r },
|
|
126
|
-
bubbles: !0
|
|
127
|
-
})
|
|
128
|
-
), this.requestUpdate();
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
this.value = a.iso, this.dispatchEvent(
|
|
132
|
-
new CustomEvent("change", {
|
|
133
|
-
detail: { value: this.value },
|
|
134
|
-
bubbles: !0
|
|
135
|
-
})
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
this.requestUpdate();
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
e([
|
|
142
|
-
i({ type: String })
|
|
143
|
-
], t.prototype, "uid", 2);
|
|
144
|
-
e([
|
|
145
|
-
i({ type: String })
|
|
146
|
-
], t.prototype, "label", 2);
|
|
147
|
-
e([
|
|
148
|
-
i({ type: String, attribute: "locale-id" })
|
|
149
|
-
], t.prototype, "localeId", 2);
|
|
150
|
-
e([
|
|
151
|
-
i({ type: Array })
|
|
152
|
-
], t.prototype, "errors", 2);
|
|
153
|
-
e([
|
|
154
|
-
i({ type: Boolean })
|
|
155
|
-
], t.prototype, "showErrors", 2);
|
|
156
|
-
e([
|
|
157
|
-
i({ type: Boolean })
|
|
158
|
-
], t.prototype, "touched", 2);
|
|
159
|
-
e([
|
|
160
|
-
i({ type: Boolean })
|
|
161
|
-
], t.prototype, "required", 2);
|
|
162
|
-
e([
|
|
163
|
-
i({ type: Boolean })
|
|
164
|
-
], t.prototype, "disabled", 2);
|
|
165
|
-
e([
|
|
166
|
-
i({ type: Boolean, attribute: "readonly" })
|
|
167
|
-
], t.prototype, "readOnly", 2);
|
|
168
|
-
e([
|
|
169
|
-
i({ type: String })
|
|
170
|
-
], t.prototype, "icon", 2);
|
|
171
|
-
e([
|
|
172
|
-
i({ type: String })
|
|
173
|
-
], t.prototype, "hint", 2);
|
|
174
|
-
e([
|
|
175
|
-
i({ type: String })
|
|
176
|
-
], t.prototype, "dayAriaLabel", 2);
|
|
177
|
-
e([
|
|
178
|
-
i({ type: String })
|
|
179
|
-
], t.prototype, "monthAriaLabel", 2);
|
|
180
|
-
e([
|
|
181
|
-
i({ type: String })
|
|
182
|
-
], t.prototype, "yearAriaLabel", 2);
|
|
183
|
-
e([
|
|
184
|
-
i({ type: String })
|
|
185
|
-
], t.prototype, "value", 2);
|
|
186
|
-
e([
|
|
187
|
-
i({ type: String, attribute: "invalid-date-message" })
|
|
188
|
-
], t.prototype, "invalidDateMessage", 2);
|
|
189
|
-
e([
|
|
190
|
-
i({ type: String, attribute: "min-date" })
|
|
191
|
-
], t.prototype, "minDate", 2);
|
|
192
|
-
e([
|
|
193
|
-
i({ type: String, attribute: "max-date" })
|
|
194
|
-
], t.prototype, "maxDate", 2);
|
|
195
|
-
e([
|
|
196
|
-
i({ type: String, attribute: "min-date-message" })
|
|
197
|
-
], t.prototype, "minDateMessage", 2);
|
|
198
|
-
e([
|
|
199
|
-
i({ type: String, attribute: "max-date-message" })
|
|
200
|
-
], t.prototype, "maxDateMessage", 2);
|
|
201
|
-
t = e([
|
|
202
|
-
c("gui-date")
|
|
203
|
-
], t);
|
|
204
|
-
typeof customElements < "u" && !customElements.get("gui-date") && customElements.define("gui-date", t);
|
|
@@ -1,357 +0,0 @@
|
|
|
1
|
-
import { InputWidgetAdapter as g, formContext as m, inputContext as y } from "@golemui/lit";
|
|
2
|
-
import { LitElement as c, html as h, nothing as $ } from "lit";
|
|
3
|
-
import { property as a, customElement as b } from "lit/decorators.js";
|
|
4
|
-
import { classMap as v } from "lit/directives/class-map.js";
|
|
5
|
-
import "./date-input-B3yHsn-g.js";
|
|
6
|
-
import "./calendar-DleRbmvP.js";
|
|
7
|
-
import { G as M } from "./popup.controller-B33OvX_y.js";
|
|
8
|
-
import { d as f } from "./date-DBuYpvcO.js";
|
|
9
|
-
import { a as A, b as D, c as L } from "./templates-Df7abEkB.js";
|
|
10
|
-
import { consume as x, provide as w } from "@lit/context";
|
|
11
|
-
import "rxjs";
|
|
12
|
-
var _ = Object.defineProperty, C = Object.getOwnPropertyDescriptor, i = (e, r, n, s) => {
|
|
13
|
-
for (var o = s > 1 ? void 0 : s ? C(r, n) : r, l = e.length - 1, d; l >= 0; l--)
|
|
14
|
-
(d = e[l]) && (o = (s ? d(r, n, o) : d(o)) || o);
|
|
15
|
-
return s && o && _(r, n, o), o;
|
|
16
|
-
};
|
|
17
|
-
let t = class extends c {
|
|
18
|
-
constructor() {
|
|
19
|
-
super(...arguments), this.uid = void 0, this.label = void 0, this.hint = void 0, this.icon = "", this.toggleAriaLabel = void 0, this.dayAriaLabel = void 0, this.monthAriaLabel = void 0, this.yearAriaLabel = void 0, this.errors = [], this.showErrors = !0, this.touched = !1, this.required = !1, this.disabled = !1, this.readOnly = !1, this.localeId = void 0, this.value = void 0, this.prevMonthIcon = "", this.nextMonthIcon = "", this.prevMonthAriaLabel = void 0, this.nextMonthAriaLabel = void 0, this.selectYearAriaLabel = void 0, this.yearGridAriaLabel = void 0, this.dayFormat = void 0, this.weekdayFormat = void 0, this.monthFormat = void 0, this.minDate = void 0, this.maxDate = void 0, this.disabledRanges = void 0, this.numberOfMonths = void 0, this.invalidDateMessage = void 0, this.minDateMessage = void 0, this.maxDateMessage = void 0, this.disabledDateRangeMessage = void 0, this._popup = new M(this, {
|
|
20
|
-
focusRestoreSelector: "gui-date input",
|
|
21
|
-
focusPopupSelector: '.gui-calendar__day-button[tabindex="0"]',
|
|
22
|
-
isDisabled: () => !!this.disabled,
|
|
23
|
-
clickIntent: (e) => e.closest(".gui-calendar__day-button") ? "ignore" : e.closest(".gui-date-input__part") || e.closest("gui-calendar") ? "open" : "toggle",
|
|
24
|
-
keyToggleMode: "toggle"
|
|
25
|
-
}), this.onToggleClick = (e) => {
|
|
26
|
-
e.stopPropagation(), this._popup.open ? this._popup.close() : this._popup.openAndFocus();
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
createRenderRoot() {
|
|
30
|
-
return this;
|
|
31
|
-
}
|
|
32
|
-
render() {
|
|
33
|
-
const e = A("datePicker", { icon: this.icon }), r = this._popup.open ? h`<gui-calendar
|
|
34
|
-
id=${`${this.uid}_popup`}
|
|
35
|
-
role="dialog"
|
|
36
|
-
aria-label=${this.label ?? "Calendar"}
|
|
37
|
-
.uid=${this.uid}
|
|
38
|
-
.hint=${this.hint}
|
|
39
|
-
?touched=${this.touched}
|
|
40
|
-
?required=${this.required}
|
|
41
|
-
?disabled=${this.disabled}
|
|
42
|
-
?readonly=${this.readOnly}
|
|
43
|
-
.value=${this.value}
|
|
44
|
-
.prevMonthIcon=${this.prevMonthIcon}
|
|
45
|
-
.nextMonthIcon=${this.nextMonthIcon}
|
|
46
|
-
.prevMonthAriaLabel=${this.prevMonthAriaLabel}
|
|
47
|
-
.nextMonthAriaLabel=${this.nextMonthAriaLabel}
|
|
48
|
-
.selectYearAriaLabel=${this.selectYearAriaLabel}
|
|
49
|
-
.yearGridAriaLabel=${this.yearGridAriaLabel}
|
|
50
|
-
.dayFormat=${this.dayFormat}
|
|
51
|
-
.weekdayFormat=${this.weekdayFormat}
|
|
52
|
-
.monthFormat=${this.monthFormat}
|
|
53
|
-
.minDate=${this.minDate}
|
|
54
|
-
.maxDate=${this.maxDate}
|
|
55
|
-
.disabledRanges=${this.disabledRanges}
|
|
56
|
-
.numberOfMonths=${this.numberOfMonths}
|
|
57
|
-
.localeId=${this.localeId}
|
|
58
|
-
@blur=${this.onCalendarBlur}
|
|
59
|
-
@change=${this.onCalendarChange}
|
|
60
|
-
></gui-calendar>` : $;
|
|
61
|
-
return h`
|
|
62
|
-
${D(
|
|
63
|
-
this.uid ?? "",
|
|
64
|
-
{
|
|
65
|
-
label: this.label,
|
|
66
|
-
hint: this.hint,
|
|
67
|
-
required: this.required
|
|
68
|
-
},
|
|
69
|
-
!1,
|
|
70
|
-
void 0,
|
|
71
|
-
!1
|
|
72
|
-
)}
|
|
73
|
-
|
|
74
|
-
<div
|
|
75
|
-
class="gui-widget"
|
|
76
|
-
@keydown=${this._popup.onAnchorKeyDown}
|
|
77
|
-
@click=${this._popup.onAnchorClick}
|
|
78
|
-
>
|
|
79
|
-
<gui-date
|
|
80
|
-
id="date-input"
|
|
81
|
-
class=${v(e.widgetClasses)}
|
|
82
|
-
.uid=${this.uid}
|
|
83
|
-
.hint=${this.hint}
|
|
84
|
-
.showErrors=${!1}
|
|
85
|
-
.errors=${this.errors}
|
|
86
|
-
?touched=${this.touched}
|
|
87
|
-
?required=${this.required}
|
|
88
|
-
?disabled=${this.disabled}
|
|
89
|
-
?readonly=${this.readOnly}
|
|
90
|
-
.value=${this.value}
|
|
91
|
-
.icon=${this.icon}
|
|
92
|
-
.localeId=${this.localeId}
|
|
93
|
-
.dayAriaLabel=${this.dayAriaLabel}
|
|
94
|
-
.monthAriaLabel=${this.monthAriaLabel}
|
|
95
|
-
.yearAriaLabel=${this.yearAriaLabel}
|
|
96
|
-
.invalidDateMessage=${this.invalidDateMessage}
|
|
97
|
-
@blur=${this.onDateBlur}
|
|
98
|
-
@focus=${this._popup.show}
|
|
99
|
-
@change=${this.onDateChange}
|
|
100
|
-
></gui-date>
|
|
101
|
-
<button
|
|
102
|
-
type="button"
|
|
103
|
-
class="gui-date-picker__arrow"
|
|
104
|
-
aria-label=${this.toggleAriaLabel ?? "Show calendar"}
|
|
105
|
-
aria-haspopup="dialog"
|
|
106
|
-
aria-expanded=${this._popup.open ? "true" : "false"}
|
|
107
|
-
aria-controls=${`${this.uid}_popup`}
|
|
108
|
-
?disabled=${this.disabled}
|
|
109
|
-
@click=${this.onToggleClick}
|
|
110
|
-
>
|
|
111
|
-
<svg
|
|
112
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
113
|
-
width="16"
|
|
114
|
-
height="16"
|
|
115
|
-
viewBox="0 0 256 256"
|
|
116
|
-
aria-hidden="true"
|
|
117
|
-
>
|
|
118
|
-
<path
|
|
119
|
-
d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
|
|
120
|
-
></path>
|
|
121
|
-
</svg>
|
|
122
|
-
</button>
|
|
123
|
-
|
|
124
|
-
${r}
|
|
125
|
-
</div>
|
|
126
|
-
|
|
127
|
-
${this.showErrors ? L(this.uid ?? "", { errors: this.errors, touched: this.touched }) : ""}
|
|
128
|
-
`;
|
|
129
|
-
}
|
|
130
|
-
onDateChange(e) {
|
|
131
|
-
e.stopPropagation(), this.commitValue(e.detail.value);
|
|
132
|
-
}
|
|
133
|
-
onDateBlur() {
|
|
134
|
-
this.dispatchEvent(new CustomEvent("blur"));
|
|
135
|
-
}
|
|
136
|
-
onCalendarChange(e) {
|
|
137
|
-
e.stopPropagation(), this.commitValue(e.detail.value), this._popup.close();
|
|
138
|
-
}
|
|
139
|
-
commitValue(e) {
|
|
140
|
-
this.value = e ?? void 0;
|
|
141
|
-
const r = this.validateBounds(this.value);
|
|
142
|
-
this.dispatchEvent(
|
|
143
|
-
new CustomEvent("change", {
|
|
144
|
-
detail: { value: e ?? null },
|
|
145
|
-
bubbles: !0,
|
|
146
|
-
composed: !0
|
|
147
|
-
})
|
|
148
|
-
), r && this.dispatchEvent(
|
|
149
|
-
new CustomEvent("inputError", {
|
|
150
|
-
detail: { message: r },
|
|
151
|
-
bubbles: !0,
|
|
152
|
-
composed: !0
|
|
153
|
-
})
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
validateBounds(e) {
|
|
157
|
-
return e ? f(e, this.minDate, this.maxDate, this.disabledRanges, {
|
|
158
|
-
minDateMessage: this.minDateMessage,
|
|
159
|
-
maxDateMessage: this.maxDateMessage,
|
|
160
|
-
disabledDateRangeMessage: this.disabledDateRangeMessage
|
|
161
|
-
}) : null;
|
|
162
|
-
}
|
|
163
|
-
onCalendarBlur() {
|
|
164
|
-
this._popup.closeOnFocusLeave();
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
i([
|
|
168
|
-
a({ type: String })
|
|
169
|
-
], t.prototype, "uid", 2);
|
|
170
|
-
i([
|
|
171
|
-
a({ type: String })
|
|
172
|
-
], t.prototype, "label", 2);
|
|
173
|
-
i([
|
|
174
|
-
a({ type: String })
|
|
175
|
-
], t.prototype, "hint", 2);
|
|
176
|
-
i([
|
|
177
|
-
a({ type: String })
|
|
178
|
-
], t.prototype, "icon", 2);
|
|
179
|
-
i([
|
|
180
|
-
a({ type: String, attribute: "toggle-aria-label" })
|
|
181
|
-
], t.prototype, "toggleAriaLabel", 2);
|
|
182
|
-
i([
|
|
183
|
-
a({ type: String })
|
|
184
|
-
], t.prototype, "dayAriaLabel", 2);
|
|
185
|
-
i([
|
|
186
|
-
a({ type: String })
|
|
187
|
-
], t.prototype, "monthAriaLabel", 2);
|
|
188
|
-
i([
|
|
189
|
-
a({ type: String })
|
|
190
|
-
], t.prototype, "yearAriaLabel", 2);
|
|
191
|
-
i([
|
|
192
|
-
a({ type: Array })
|
|
193
|
-
], t.prototype, "errors", 2);
|
|
194
|
-
i([
|
|
195
|
-
a({ type: Boolean })
|
|
196
|
-
], t.prototype, "showErrors", 2);
|
|
197
|
-
i([
|
|
198
|
-
a({ type: Boolean })
|
|
199
|
-
], t.prototype, "touched", 2);
|
|
200
|
-
i([
|
|
201
|
-
a({ type: Boolean })
|
|
202
|
-
], t.prototype, "required", 2);
|
|
203
|
-
i([
|
|
204
|
-
a({ type: Boolean })
|
|
205
|
-
], t.prototype, "disabled", 2);
|
|
206
|
-
i([
|
|
207
|
-
a({ type: Boolean, attribute: "readonly" })
|
|
208
|
-
], t.prototype, "readOnly", 2);
|
|
209
|
-
i([
|
|
210
|
-
a({ type: String, attribute: "locale-id" })
|
|
211
|
-
], t.prototype, "localeId", 2);
|
|
212
|
-
i([
|
|
213
|
-
a({ type: String })
|
|
214
|
-
], t.prototype, "value", 2);
|
|
215
|
-
i([
|
|
216
|
-
a({ type: String, attribute: "prev-month-icon" })
|
|
217
|
-
], t.prototype, "prevMonthIcon", 2);
|
|
218
|
-
i([
|
|
219
|
-
a({ type: String, attribute: "next-month-icon" })
|
|
220
|
-
], t.prototype, "nextMonthIcon", 2);
|
|
221
|
-
i([
|
|
222
|
-
a({ type: String, attribute: "prev-month-aria-label" })
|
|
223
|
-
], t.prototype, "prevMonthAriaLabel", 2);
|
|
224
|
-
i([
|
|
225
|
-
a({ type: String, attribute: "next-month-aria-label" })
|
|
226
|
-
], t.prototype, "nextMonthAriaLabel", 2);
|
|
227
|
-
i([
|
|
228
|
-
a({ type: String, attribute: "select-year-aria-label" })
|
|
229
|
-
], t.prototype, "selectYearAriaLabel", 2);
|
|
230
|
-
i([
|
|
231
|
-
a({ type: String, attribute: "year-grid-aria-label" })
|
|
232
|
-
], t.prototype, "yearGridAriaLabel", 2);
|
|
233
|
-
i([
|
|
234
|
-
a({ type: String, attribute: "day-format" })
|
|
235
|
-
], t.prototype, "dayFormat", 2);
|
|
236
|
-
i([
|
|
237
|
-
a({ type: String, attribute: "weekday-format" })
|
|
238
|
-
], t.prototype, "weekdayFormat", 2);
|
|
239
|
-
i([
|
|
240
|
-
a({ type: String, attribute: "month-format" })
|
|
241
|
-
], t.prototype, "monthFormat", 2);
|
|
242
|
-
i([
|
|
243
|
-
a({ type: String, attribute: "min-date" })
|
|
244
|
-
], t.prototype, "minDate", 2);
|
|
245
|
-
i([
|
|
246
|
-
a({ type: String, attribute: "max-date" })
|
|
247
|
-
], t.prototype, "maxDate", 2);
|
|
248
|
-
i([
|
|
249
|
-
a({ type: Array, attribute: "disabled-ranges" })
|
|
250
|
-
], t.prototype, "disabledRanges", 2);
|
|
251
|
-
i([
|
|
252
|
-
a({ type: Number, attribute: "number-of-months" })
|
|
253
|
-
], t.prototype, "numberOfMonths", 2);
|
|
254
|
-
i([
|
|
255
|
-
a({ type: String, attribute: "invalid-date-message" })
|
|
256
|
-
], t.prototype, "invalidDateMessage", 2);
|
|
257
|
-
i([
|
|
258
|
-
a({ type: String, attribute: "min-date-message" })
|
|
259
|
-
], t.prototype, "minDateMessage", 2);
|
|
260
|
-
i([
|
|
261
|
-
a({ type: String, attribute: "max-date-message" })
|
|
262
|
-
], t.prototype, "maxDateMessage", 2);
|
|
263
|
-
i([
|
|
264
|
-
a({ type: String, attribute: "disabled-date-range-message" })
|
|
265
|
-
], t.prototype, "disabledDateRangeMessage", 2);
|
|
266
|
-
t = i([
|
|
267
|
-
b("gui-date-picker")
|
|
268
|
-
], t);
|
|
269
|
-
typeof customElements < "u" && !customElements.get("gui-date-picker") && customElements.define("gui-date-picker", t);
|
|
270
|
-
var S = Object.defineProperty, I = Object.getOwnPropertyDescriptor, u = (e, r, n, s) => {
|
|
271
|
-
for (var o = s > 1 ? void 0 : s ? I(r, n) : r, l = e.length - 1, d; l >= 0; l--)
|
|
272
|
-
(d = e[l]) && (o = (s ? d(r, n, o) : d(o)) || o);
|
|
273
|
-
return s && o && S(r, n, o), o;
|
|
274
|
-
};
|
|
275
|
-
let p = class extends c {
|
|
276
|
-
constructor() {
|
|
277
|
-
super(...arguments), this.adapter = new g(), this.subscriptions = [];
|
|
278
|
-
}
|
|
279
|
-
createRenderRoot() {
|
|
280
|
-
return this;
|
|
281
|
-
}
|
|
282
|
-
updated(e) {
|
|
283
|
-
super.updated(e);
|
|
284
|
-
const r = this.adapter.templateData.size;
|
|
285
|
-
r ? this.style.flex = String(r) : this.style.removeProperty("flex");
|
|
286
|
-
}
|
|
287
|
-
connectedCallback() {
|
|
288
|
-
super.connectedCallback(), this.classList.add("gui-date-picker", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
289
|
-
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
290
|
-
);
|
|
291
|
-
}
|
|
292
|
-
render() {
|
|
293
|
-
super.render();
|
|
294
|
-
const e = this.adapter.templateData;
|
|
295
|
-
return h`
|
|
296
|
-
<gui-date-picker
|
|
297
|
-
.uid=${this.widget.uid}
|
|
298
|
-
.label=${e.label}
|
|
299
|
-
.hint=${e.hint}
|
|
300
|
-
.errors=${e.errors}
|
|
301
|
-
?touched=${e.touched}
|
|
302
|
-
?required=${e.validator?.required}
|
|
303
|
-
?disabled=${e.disabled}
|
|
304
|
-
?readonly=${e.readonly}
|
|
305
|
-
.value=${e.value}
|
|
306
|
-
.icon=${e.icon}
|
|
307
|
-
.localeId=${e.lang}
|
|
308
|
-
.toggleAriaLabel=${e.toggleAriaLabel}
|
|
309
|
-
.dayAriaLabel=${e.dayAriaLabel}
|
|
310
|
-
.monthAriaLabel=${e.monthAriaLabel}
|
|
311
|
-
.yearAriaLabel=${e.yearAriaLabel}
|
|
312
|
-
.prevMonthIcon=${e.prevMonthIcon}
|
|
313
|
-
.nextMonthIcon=${e.nextMonthIcon}
|
|
314
|
-
.prevMonthAriaLabel=${e.prevMonthAriaLabel}
|
|
315
|
-
.nextMonthAriaLabel=${e.nextMonthAriaLabel}
|
|
316
|
-
.selectYearAriaLabel=${e.selectYearAriaLabel}
|
|
317
|
-
.yearGridAriaLabel=${e.yearGridAriaLabel}
|
|
318
|
-
.dayFormat=${e.dayFormat}
|
|
319
|
-
.weekdayFormat=${e.weekdayFormat}
|
|
320
|
-
.monthFormat=${e.monthFormat}
|
|
321
|
-
.minDate=${e.minDate}
|
|
322
|
-
.maxDate=${e.maxDate}
|
|
323
|
-
.disabledRanges=${e.disabledRanges}
|
|
324
|
-
.numberOfMonths=${e.numberOfMonths}
|
|
325
|
-
.invalidDateMessage=${e.invalidDateMessage}
|
|
326
|
-
.minDateMessage=${e.minDateMessage}
|
|
327
|
-
.maxDateMessage=${e.maxDateMessage}
|
|
328
|
-
.disabledDateRangeMessage=${e.disabledDateRangeMessage}
|
|
329
|
-
@inputError=${this.onInputError}
|
|
330
|
-
@blur=${() => this.adapter.onBlur()}
|
|
331
|
-
@change=${this.valueChanged}
|
|
332
|
-
></gui-date-picker>
|
|
333
|
-
`;
|
|
334
|
-
}
|
|
335
|
-
valueChanged(e) {
|
|
336
|
-
this.adapter.injectValidationIssues(null), this.adapter.valueChanged(e.detail.value);
|
|
337
|
-
}
|
|
338
|
-
onInputError(e) {
|
|
339
|
-
this.adapter.injectValidationIssues([e.detail.message]);
|
|
340
|
-
}
|
|
341
|
-
disconnectedCallback() {
|
|
342
|
-
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((e) => e.unsubscribe());
|
|
343
|
-
}
|
|
344
|
-
};
|
|
345
|
-
u([
|
|
346
|
-
x({ context: m }),
|
|
347
|
-
a({ attribute: !1 })
|
|
348
|
-
], p.prototype, "formContext", 2);
|
|
349
|
-
u([
|
|
350
|
-
w({ context: y })
|
|
351
|
-
], p.prototype, "adapter", 2);
|
|
352
|
-
p = u([
|
|
353
|
-
b("gui-date-picker-input")
|
|
354
|
-
], p);
|
|
355
|
-
export {
|
|
356
|
-
p as DatePickerElement
|
|
357
|
-
};
|