@golemui/gui-lit 1.0.2 → 1.1.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/CHANGELOG.md +15 -0
- package/calendar-BuJgwvZx.js +254 -0
- package/{calendar.element-MubSE1bx.js → calendar.element-M5MPJmap.js} +1 -1
- package/{currency.element-BHXWcOEu.js → currency.element-CfFrAtrr.js} +20 -14
- package/{date-DTYg8sog.js → date-Bj9mI3GU.js} +106 -50
- package/date-input-cJDkNnVw.js +184 -0
- package/date-picker.element-va_-LGZD.js +312 -0
- package/date-time-calendar-BzRfkLKU.js +361 -0
- package/date-time-calendar.element-DC4NK0y1.js +93 -0
- package/date-time-input-BXxsfuyZ.js +214 -0
- package/date-time-picker.element-Dy-8cb-_.js +380 -0
- package/date-time.element-Bv4XdzMi.js +87 -0
- package/{date.element-BtVJSIRk.js → date.element-Consgsbb.js} +32 -27
- package/day-status-0-hJHrI7.js +530 -0
- package/{dropdown.element-DqzC6aXR.js → dropdown.element-WsD61Qel.js} +57 -48
- package/focus-leave.controller-2gV0pQd5.js +73 -0
- package/index.js +1209 -981
- package/index.umd.cjs +1574 -519
- package/lib/components/date-picker.element.d.ts +0 -11
- package/lib/components/date-time-calendar.element.d.ts +18 -0
- package/lib/components/date-time-picker.element.d.ts +18 -0
- package/lib/components/date-time.element.d.ts +18 -0
- package/lib/components/dropdown.element.d.ts +2 -0
- package/lib/components/range-calendar.element.d.ts +2 -1
- package/lib/components/range-date-picker.element.d.ts +0 -15
- package/lib/components/range-date-time-calendar.element.d.ts +18 -0
- package/lib/components/range-date-time-input.element.d.ts +18 -0
- package/lib/components/range-date-time-picker.element.d.ts +18 -0
- package/lib/components/range-time-input.element.d.ts +18 -0
- package/lib/components/range-time-picker.element.d.ts +18 -0
- package/lib/components/time-picker.element.d.ts +18 -0
- package/lib/components/time.element.d.ts +18 -0
- package/{list-D1oKnH89.js → list-CrLIL4by.js} +76 -61
- package/{list.element-Co3V3Cn5.js → list.element-DV82YxnJ.js} +22 -22
- package/{number.element-BhEyoOtc.js → number.element-CBr47IiY.js} +18 -16
- package/numeric-jmOOKz30.js +12 -0
- package/package.json +6 -6
- package/part-templates-Db871PS3.js +677 -0
- package/pill-ranges-DCqDmpkk.js +48 -0
- package/{pills-B66qz_KX.js → pills-Be1UrLgq.js} +4 -1
- package/popup.controller-eUDxE6jD.js +71 -0
- package/range-calendar-CKPYeSGt.js +452 -0
- package/{range-calendar.element-QTE6vGNP.js → range-calendar.element-D6KYq18B.js} +24 -20
- package/range-commit-8-MmYUyo.js +14 -0
- package/range-date-input-D--AqBMv.js +292 -0
- package/{range-date-input.element-Dj29D_OQ.js → range-date-input.element-D4nIXJbw.js} +8 -7
- package/range-date-picker.element-dhxPAAE6.js +386 -0
- package/range-date-time-calendar-yksWrR7b.js +720 -0
- package/range-date-time-calendar.element-C00aDefZ.js +95 -0
- package/range-date-time-input-B37TUoM3.js +322 -0
- package/range-date-time-input.element-DUnbv4ed.js +81 -0
- package/range-date-time-picker.element-Cbps6s_G.js +412 -0
- package/range-selection-CU3hxLJE.js +25 -0
- package/range-time-input-3lhqR1Ku.js +329 -0
- package/range-time-input.element-dU2iBdmJ.js +81 -0
- package/range-time-picker.element-v6nQsIPw.js +429 -0
- package/{select.element-jcDF1h-g.js → select.element-C0V-Bv3L.js} +94 -90
- package/{tags.element-CX3vQL8L.js → tags.element-DvwEpxpK.js} +1 -1
- package/time-input-BOhlBGJZ.js +181 -0
- package/time-list-Czo48bZm.js +217 -0
- package/time-picker-bFJ63ky8.js +261 -0
- package/time-picker.element-CYZVXgRS.js +85 -0
- package/time.element-fK3oLi49.js +82 -0
- package/abstract-calendar-BoqKPRmS.js +0 -545
- package/calendar-DTYKVYc3.js +0 -96
- package/date-input-BeQvyfln.js +0 -268
- package/date-picker.element-DabW_-0-.js +0 -166
- package/range-calendar-9skwbwlB.js +0 -255
- package/range-date-input-Uy8134vi.js +0 -395
- package/range-date-picker.element-CuKIBkIO.js +0 -182
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { InputWidgetAdapter as
|
|
1
|
+
import { InputWidgetAdapter as m, formContext as b, inputContext as y } from "@golemui/lit";
|
|
2
2
|
import { LitElement as v, html as n, nothing as u } from "lit";
|
|
3
3
|
import { repeat as f } from "lit-html/directives/repeat.js";
|
|
4
|
-
import { property as
|
|
4
|
+
import { property as i, customElement as g } from "lit/decorators.js";
|
|
5
5
|
import { classMap as $ } from "lit/directives/class-map.js";
|
|
6
|
-
import { G as C, a as D, b as w, c as
|
|
7
|
-
import { u as
|
|
8
|
-
import { consume as
|
|
6
|
+
import { G as C, a as D, b as w, c as O } from "./templates-Dk1jxLwS.js";
|
|
7
|
+
import { u as E, i as S } from "./one-of-C0ur6b_n.js";
|
|
8
|
+
import { consume as F, provide as x } from "@lit/context";
|
|
9
9
|
import "rxjs";
|
|
10
|
-
var _ = Object.defineProperty,
|
|
11
|
-
for (var o =
|
|
12
|
-
(
|
|
13
|
-
return
|
|
10
|
+
var _ = Object.defineProperty, M = Object.getOwnPropertyDescriptor, s = (t, a, r, l) => {
|
|
11
|
+
for (var o = l > 1 ? void 0 : l ? M(a, r) : a, p = t.length - 1, d; p >= 0; p--)
|
|
12
|
+
(d = t[p]) && (o = (l ? d(a, r, o) : d(o)) || o);
|
|
13
|
+
return l && o && _(a, r, o), o;
|
|
14
14
|
};
|
|
15
|
-
let
|
|
15
|
+
let e = class extends v {
|
|
16
16
|
constructor() {
|
|
17
|
-
super(...arguments), this.uid = void 0, this.label = void 0, this.localeId = "en", this.errors = [], this.touched = !1, this.required = !1, this.disabled = !1, this.readOnly = !1, this.value = void 0, this.hint = void 0, this.icon = void 0, this.autocomplete = void 0, this.options = [], this.placeholder = void 0, this.labelField = void 0, this.valueField = void 0, this.optionsLoading = !1, this.hasMatchingValue = !1, this.ariaController = new C(this, {
|
|
17
|
+
super(...arguments), this.uid = void 0, this.label = void 0, this.localeId = "en", this.errors = [], this.touched = !1, this.required = !1, this.disabled = !1, this.readOnly = !1, this.value = void 0, this.hint = void 0, this.icon = void 0, this.autocomplete = void 0, this.options = [], this.placeholder = void 0, this.invalidOptionMessage = void 0, this.labelField = void 0, this.valueField = void 0, this.optionsLoading = !1, this.hasMatchingValue = !1, this.ariaController = new C(this, {
|
|
18
18
|
getTargets: () => this.querySelectorAll(`select[id="${this.uid}"]`),
|
|
19
19
|
getState: () => ({
|
|
20
20
|
uid: this.uid,
|
|
@@ -52,23 +52,23 @@ let a = class extends v {
|
|
|
52
52
|
placeholder: this.placeholder,
|
|
53
53
|
labelField: this.labelField,
|
|
54
54
|
valueField: this.valueField
|
|
55
|
-
},
|
|
56
|
-
this.options =
|
|
55
|
+
}, a = D("select", t);
|
|
56
|
+
this.options = E(this.options, {
|
|
57
57
|
labelField: this.labelField,
|
|
58
58
|
valueField: this.valueField
|
|
59
|
-
}), this.hasMatchingValue = this.options?.length ? this.options.find(({ value:
|
|
59
|
+
}), this.hasMatchingValue = this.options?.length ? this.options.find(({ value: l }) => l === this.value) !== void 0 : !1;
|
|
60
60
|
const r = this.optionsLoading ? n`<span>Loading...</span>` : n`
|
|
61
61
|
<option value="" disabled selected=${this.hasMatchingValue ? u : ""}>
|
|
62
62
|
${this.placeholder ?? "Select an option"}
|
|
63
63
|
</option>
|
|
64
64
|
${f(
|
|
65
65
|
this.options || [],
|
|
66
|
-
(
|
|
67
|
-
(
|
|
68
|
-
value=${
|
|
69
|
-
selected=${this.hasMatchingValue &&
|
|
66
|
+
(l) => l?.value,
|
|
67
|
+
(l) => n`<option
|
|
68
|
+
value=${l.value}
|
|
69
|
+
selected=${this.hasMatchingValue && l.value === this.value ? "" : u}
|
|
70
70
|
>
|
|
71
|
-
${
|
|
71
|
+
${l.label}
|
|
72
72
|
</option>`
|
|
73
73
|
)}
|
|
74
74
|
`;
|
|
@@ -80,7 +80,7 @@ let a = class extends v {
|
|
|
80
80
|
id=${this.uid}
|
|
81
81
|
tabindex="0"
|
|
82
82
|
data-cy=${`${this.uid}_select`}
|
|
83
|
-
class=${$({ "gui-widget-input": !0, ...
|
|
83
|
+
class=${$({ "gui-widget-input": !0, ...a.widgetClasses })}
|
|
84
84
|
?required=${t.required}
|
|
85
85
|
?disabled=${t.disabled || t.readonly}
|
|
86
86
|
autocomplete=${this.autocomplete || u}
|
|
@@ -95,17 +95,17 @@ let a = class extends v {
|
|
|
95
95
|
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"
|
|
96
96
|
></path></svg
|
|
97
97
|
></span>
|
|
98
|
-
${
|
|
98
|
+
${a.html}
|
|
99
99
|
</div>
|
|
100
100
|
|
|
101
|
-
${
|
|
101
|
+
${O(this.uid, t)}
|
|
102
102
|
`;
|
|
103
103
|
}
|
|
104
104
|
updated(t) {
|
|
105
105
|
t.has("value") && !this.hasMatchingValue && this.value && this.dispatchEvent(
|
|
106
106
|
new CustomEvent("inputError", {
|
|
107
107
|
detail: {
|
|
108
|
-
message:
|
|
108
|
+
message: (this.invalidOptionMessage ?? "Invalid selection: '{value}' is not a valid option.").replace("{value}", String(this.value))
|
|
109
109
|
},
|
|
110
110
|
bubbles: !0
|
|
111
111
|
})
|
|
@@ -113,10 +113,10 @@ let a = class extends v {
|
|
|
113
113
|
}
|
|
114
114
|
valueChanged(t) {
|
|
115
115
|
if (t.stopPropagation(), !this.readOnly) {
|
|
116
|
-
const
|
|
116
|
+
const a = t.target;
|
|
117
117
|
this.dispatchEvent(
|
|
118
118
|
new CustomEvent("change", {
|
|
119
|
-
detail: { value: S(
|
|
119
|
+
detail: { value: S(a.value, this.options) },
|
|
120
120
|
bubbles: !0,
|
|
121
121
|
composed: !0
|
|
122
122
|
})
|
|
@@ -132,74 +132,77 @@ let a = class extends v {
|
|
|
132
132
|
);
|
|
133
133
|
}
|
|
134
134
|
};
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
],
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
],
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
],
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
],
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
],
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
],
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
],
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
],
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
],
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
],
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
],
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
],
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
],
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
],
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
],
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
],
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
],
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
135
|
+
s([
|
|
136
|
+
i({ type: String })
|
|
137
|
+
], e.prototype, "uid", 2);
|
|
138
|
+
s([
|
|
139
|
+
i({ type: String })
|
|
140
|
+
], e.prototype, "label", 2);
|
|
141
|
+
s([
|
|
142
|
+
i({ type: String, attribute: "locale-id" })
|
|
143
|
+
], e.prototype, "localeId", 2);
|
|
144
|
+
s([
|
|
145
|
+
i({ type: Array })
|
|
146
|
+
], e.prototype, "errors", 2);
|
|
147
|
+
s([
|
|
148
|
+
i({ type: Boolean })
|
|
149
|
+
], e.prototype, "touched", 2);
|
|
150
|
+
s([
|
|
151
|
+
i({ type: Boolean })
|
|
152
|
+
], e.prototype, "required", 2);
|
|
153
|
+
s([
|
|
154
|
+
i({ type: Boolean })
|
|
155
|
+
], e.prototype, "disabled", 2);
|
|
156
|
+
s([
|
|
157
|
+
i({ type: Boolean, attribute: "readonly" })
|
|
158
|
+
], e.prototype, "readOnly", 2);
|
|
159
|
+
s([
|
|
160
|
+
i({ type: String })
|
|
161
|
+
], e.prototype, "value", 2);
|
|
162
|
+
s([
|
|
163
|
+
i({ type: String })
|
|
164
|
+
], e.prototype, "hint", 2);
|
|
165
|
+
s([
|
|
166
|
+
i({ type: String })
|
|
167
|
+
], e.prototype, "icon", 2);
|
|
168
|
+
s([
|
|
169
|
+
i({ type: String })
|
|
170
|
+
], e.prototype, "autocomplete", 2);
|
|
171
|
+
s([
|
|
172
|
+
i({ type: Array })
|
|
173
|
+
], e.prototype, "options", 2);
|
|
174
|
+
s([
|
|
175
|
+
i({ type: String })
|
|
176
|
+
], e.prototype, "placeholder", 2);
|
|
177
|
+
s([
|
|
178
|
+
i({ type: String, attribute: "invalid-option-message" })
|
|
179
|
+
], e.prototype, "invalidOptionMessage", 2);
|
|
180
|
+
s([
|
|
181
|
+
i({ type: String })
|
|
182
|
+
], e.prototype, "labelField", 2);
|
|
183
|
+
s([
|
|
184
|
+
i({ type: String })
|
|
185
|
+
], e.prototype, "valueField", 2);
|
|
186
|
+
e = s([
|
|
187
|
+
g("gui-select")
|
|
188
|
+
], e);
|
|
189
|
+
typeof customElements < "u" && !customElements.get("gui-select") && customElements.define("gui-select", e);
|
|
190
|
+
var q = Object.defineProperty, I = Object.getOwnPropertyDescriptor, c = (t, a, r, l) => {
|
|
191
|
+
for (var o = l > 1 ? void 0 : l ? I(a, r) : a, p = t.length - 1, d; p >= 0; p--)
|
|
192
|
+
(d = t[p]) && (o = (l ? d(a, r, o) : d(o)) || o);
|
|
193
|
+
return l && o && q(a, r, o), o;
|
|
191
194
|
};
|
|
192
195
|
let h = class extends v {
|
|
193
196
|
constructor() {
|
|
194
|
-
super(...arguments), this.adapter = new
|
|
197
|
+
super(...arguments), this.adapter = new m(), this.subscriptions = [];
|
|
195
198
|
}
|
|
196
199
|
createRenderRoot() {
|
|
197
200
|
return this;
|
|
198
201
|
}
|
|
199
202
|
updated(t) {
|
|
200
203
|
super.updated(t);
|
|
201
|
-
const
|
|
202
|
-
|
|
204
|
+
const a = this.adapter.templateData.size;
|
|
205
|
+
a ? this.style.flex = String(a) : this.style.removeProperty("flex");
|
|
203
206
|
}
|
|
204
207
|
connectedCallback() {
|
|
205
208
|
super.connectedCallback(), this.classList.add("gui-select", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
@@ -224,6 +227,7 @@ let h = class extends v {
|
|
|
224
227
|
.options=${this.adapter.templateData.options}
|
|
225
228
|
.labelField=${this.adapter.templateData.labelField}
|
|
226
229
|
.valueField=${this.adapter.templateData.valueField}
|
|
230
|
+
.invalidOptionMessage=${this.adapter.templateData.invalidOptionMessage}
|
|
227
231
|
@change=${this.valueChanged}
|
|
228
232
|
@inputError=${this.onInputError}
|
|
229
233
|
@blur=${() => this.adapter.onBlur()}
|
|
@@ -231,8 +235,8 @@ let h = class extends v {
|
|
|
231
235
|
`;
|
|
232
236
|
}
|
|
233
237
|
valueChanged(t) {
|
|
234
|
-
const
|
|
235
|
-
this.adapter.valueChanged(
|
|
238
|
+
const a = t.detail.value;
|
|
239
|
+
this.adapter.valueChanged(a);
|
|
236
240
|
}
|
|
237
241
|
onInputError(t) {
|
|
238
242
|
this.adapter.injectValidationIssues([t.detail.message]);
|
|
@@ -242,14 +246,14 @@ let h = class extends v {
|
|
|
242
246
|
}
|
|
243
247
|
};
|
|
244
248
|
c([
|
|
245
|
-
|
|
246
|
-
|
|
249
|
+
F({ context: b }),
|
|
250
|
+
i({ attribute: !1 })
|
|
247
251
|
], h.prototype, "formContext", 2);
|
|
248
252
|
c([
|
|
249
|
-
|
|
253
|
+
x({ context: y })
|
|
250
254
|
], h.prototype, "adapter", 2);
|
|
251
255
|
h = c([
|
|
252
|
-
|
|
256
|
+
g("gui-select-input")
|
|
253
257
|
], h);
|
|
254
258
|
export {
|
|
255
259
|
h as SelectElement
|
|
@@ -3,7 +3,7 @@ import { LitElement as y, nothing as c, html as m } from "lit";
|
|
|
3
3
|
import { property as o, customElement as v } from "lit/decorators.js";
|
|
4
4
|
import { classMap as f } from "lit/directives/class-map.js";
|
|
5
5
|
import { G as A, b as P, c as S } from "./templates-Dk1jxLwS.js";
|
|
6
|
-
import "./pills-
|
|
6
|
+
import "./pills-Be1UrLgq.js";
|
|
7
7
|
import { styleMap as _ } from "lit-html/directives/style-map.js";
|
|
8
8
|
import { consume as E, provide as O } from "@lit/context";
|
|
9
9
|
import "rxjs";
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { LitElement as d, nothing as h, html as p } from "lit";
|
|
2
|
+
import { property as s, customElement as m } from "lit/decorators.js";
|
|
3
|
+
import { classMap as c } from "lit/directives/class-map.js";
|
|
4
|
+
import { G as g, b as y, c as v } from "./templates-Dk1jxLwS.js";
|
|
5
|
+
import { G as b, g as f, u as E, r as D, v as T, w } from "./part-templates-Db871PS3.js";
|
|
6
|
+
var C = Object.defineProperty, S = Object.getOwnPropertyDescriptor, e = (i, o, l, r) => {
|
|
7
|
+
for (var a = r > 1 ? void 0 : r ? S(o, l) : o, u = i.length - 1, n; u >= 0; u--)
|
|
8
|
+
(n = i[u]) && (a = (r ? n(o, l, a) : n(a)) || a);
|
|
9
|
+
return r && a && C(o, l, a), a;
|
|
10
|
+
};
|
|
11
|
+
let t = class extends d {
|
|
12
|
+
constructor() {
|
|
13
|
+
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.value = void 0, this.hourFormat = void 0, this.minuteStep = 1, this.minTime = void 0, this.maxTime = void 0, this.minTimeMessage = void 0, this.maxTimeMessage = void 0, this.inputBlockClass = "gui-time-input", this.groups = ["default"], this._parts = new b(this, {
|
|
14
|
+
blockClass: this.inputBlockClass,
|
|
15
|
+
groups: this.groups,
|
|
16
|
+
getDescriptor: (i) => this.getPartDescriptor(i),
|
|
17
|
+
commitGroup: (i) => this.validateAndEmit(i),
|
|
18
|
+
isReadonly: () => !!this.readOnly,
|
|
19
|
+
isDisabled: () => !!this.disabled,
|
|
20
|
+
onEmptyPartBlur: () => this.dispatchEvent(new CustomEvent("change", { detail: { value: null }, bubbles: !0 })),
|
|
21
|
+
getHourFormat: () => this.timeLocaleData.effectiveHourFormat,
|
|
22
|
+
getDayPeriodLabels: () => this.timeLocaleData.dayPeriodLabels
|
|
23
|
+
}), this.ariaController = new g(this, {
|
|
24
|
+
getTargets: () => this.querySelectorAll(`.${this.inputBlockClass}`),
|
|
25
|
+
getState: () => ({
|
|
26
|
+
uid: this.uid,
|
|
27
|
+
templateData: {
|
|
28
|
+
hint: this.hint,
|
|
29
|
+
errors: this.errors,
|
|
30
|
+
readonly: this.readOnly,
|
|
31
|
+
disabled: this.disabled,
|
|
32
|
+
touched: this.touched
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
createRenderRoot() {
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
connectedCallback() {
|
|
41
|
+
super.connectedCallback(), this.classList.add("gui-field");
|
|
42
|
+
}
|
|
43
|
+
get timeLocaleData() {
|
|
44
|
+
return f(this.localeId, this.hourFormat, this.minuteStep);
|
|
45
|
+
}
|
|
46
|
+
getPartDescriptor(i) {
|
|
47
|
+
return this.timeLocaleData.descriptors[i];
|
|
48
|
+
}
|
|
49
|
+
willUpdate(i) {
|
|
50
|
+
(!this.hasUpdated || i.has("value") || i.has("hourFormat") || i.has("localeId")) && this._parts.setGroupFromISO(
|
|
51
|
+
"default",
|
|
52
|
+
this.value ?? "",
|
|
53
|
+
"time",
|
|
54
|
+
this.timeLocaleData.effectiveHourFormat
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
const i = {
|
|
59
|
+
uid: this.uid,
|
|
60
|
+
label: this.label,
|
|
61
|
+
errors: this.errors,
|
|
62
|
+
touched: this.touched,
|
|
63
|
+
required: this.required,
|
|
64
|
+
disabled: this.disabled,
|
|
65
|
+
readonly: this.readOnly,
|
|
66
|
+
value: this.value,
|
|
67
|
+
icon: this.icon,
|
|
68
|
+
hint: this.hint
|
|
69
|
+
}, o = {
|
|
70
|
+
blockClass: this.inputBlockClass,
|
|
71
|
+
groups: this.groups,
|
|
72
|
+
formatParts: E(this.localeId, this.timeLocaleData.effectiveHourFormat),
|
|
73
|
+
getDescriptor: (r) => this.getPartDescriptor(r),
|
|
74
|
+
getDisplayValue: this._parts.getPartDisplay,
|
|
75
|
+
required: this.required,
|
|
76
|
+
disabled: this.disabled,
|
|
77
|
+
partsReadonly: !!this.readOnly
|
|
78
|
+
}, l = {
|
|
79
|
+
"gui-widget-icon": !0,
|
|
80
|
+
[this.icon]: !0
|
|
81
|
+
};
|
|
82
|
+
return p`
|
|
83
|
+
${this.label ? y(this.uid, i) : h}
|
|
84
|
+
|
|
85
|
+
<div class="gui-widget">
|
|
86
|
+
<div
|
|
87
|
+
class="gui-widget-input gui-parts gui-parts-ring gui-time-input ${this.icon ? "gui-calendar--icon" : ""}"
|
|
88
|
+
role="group"
|
|
89
|
+
>
|
|
90
|
+
${D("default", o, this._parts)}
|
|
91
|
+
</div>
|
|
92
|
+
${this.icon ? p`<span class=${c(l)} data-icon=${this.icon}></span>` : h}
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
${this.showErrors && this.errors?.length ? v(this.uid, i) : h}
|
|
96
|
+
`;
|
|
97
|
+
}
|
|
98
|
+
validateAndEmit(i) {
|
|
99
|
+
const { effectiveHourFormat: o, descriptors: l } = this.timeLocaleData, { result: r, writeBacks: a } = T(this._parts.values[i] ?? {}, {
|
|
100
|
+
hourFormat: o,
|
|
101
|
+
descriptors: l
|
|
102
|
+
});
|
|
103
|
+
if (this._parts.applyWriteBacks(i, a), r.kind !== "valid") {
|
|
104
|
+
this.requestUpdate();
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const u = w(r.iso, {
|
|
108
|
+
minTime: this.minTime,
|
|
109
|
+
maxTime: this.maxTime,
|
|
110
|
+
minTimeMessage: this.minTimeMessage,
|
|
111
|
+
maxTimeMessage: this.maxTimeMessage
|
|
112
|
+
});
|
|
113
|
+
if (u) {
|
|
114
|
+
this.dispatchEvent(
|
|
115
|
+
new CustomEvent("change", { detail: { value: r.iso }, bubbles: !0 })
|
|
116
|
+
), this.dispatchEvent(
|
|
117
|
+
new CustomEvent("inputError", { detail: { message: u }, bubbles: !0 })
|
|
118
|
+
), this.requestUpdate();
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
this.value = r.iso, this.dispatchEvent(new CustomEvent("change", { detail: { value: this.value }, bubbles: !0 })), this.requestUpdate();
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
e([
|
|
125
|
+
s({ type: String })
|
|
126
|
+
], t.prototype, "uid", 2);
|
|
127
|
+
e([
|
|
128
|
+
s({ type: String })
|
|
129
|
+
], t.prototype, "label", 2);
|
|
130
|
+
e([
|
|
131
|
+
s({ type: String, attribute: "locale-id" })
|
|
132
|
+
], t.prototype, "localeId", 2);
|
|
133
|
+
e([
|
|
134
|
+
s({ type: Array })
|
|
135
|
+
], t.prototype, "errors", 2);
|
|
136
|
+
e([
|
|
137
|
+
s({ type: Boolean })
|
|
138
|
+
], t.prototype, "showErrors", 2);
|
|
139
|
+
e([
|
|
140
|
+
s({ type: Boolean })
|
|
141
|
+
], t.prototype, "touched", 2);
|
|
142
|
+
e([
|
|
143
|
+
s({ type: Boolean })
|
|
144
|
+
], t.prototype, "required", 2);
|
|
145
|
+
e([
|
|
146
|
+
s({ type: Boolean })
|
|
147
|
+
], t.prototype, "disabled", 2);
|
|
148
|
+
e([
|
|
149
|
+
s({ type: Boolean, attribute: "readonly" })
|
|
150
|
+
], t.prototype, "readOnly", 2);
|
|
151
|
+
e([
|
|
152
|
+
s({ type: String })
|
|
153
|
+
], t.prototype, "icon", 2);
|
|
154
|
+
e([
|
|
155
|
+
s({ type: String })
|
|
156
|
+
], t.prototype, "hint", 2);
|
|
157
|
+
e([
|
|
158
|
+
s({ type: String })
|
|
159
|
+
], t.prototype, "value", 2);
|
|
160
|
+
e([
|
|
161
|
+
s({ type: String, attribute: "hour-format" })
|
|
162
|
+
], t.prototype, "hourFormat", 2);
|
|
163
|
+
e([
|
|
164
|
+
s({ type: Number, attribute: "minute-step" })
|
|
165
|
+
], t.prototype, "minuteStep", 2);
|
|
166
|
+
e([
|
|
167
|
+
s({ type: String, attribute: "min-time" })
|
|
168
|
+
], t.prototype, "minTime", 2);
|
|
169
|
+
e([
|
|
170
|
+
s({ type: String, attribute: "max-time" })
|
|
171
|
+
], t.prototype, "maxTime", 2);
|
|
172
|
+
e([
|
|
173
|
+
s({ type: String, attribute: "min-time-message" })
|
|
174
|
+
], t.prototype, "minTimeMessage", 2);
|
|
175
|
+
e([
|
|
176
|
+
s({ type: String, attribute: "max-time-message" })
|
|
177
|
+
], t.prototype, "maxTimeMessage", 2);
|
|
178
|
+
t = e([
|
|
179
|
+
m("gui-time")
|
|
180
|
+
], t);
|
|
181
|
+
typeof customElements < "u" && !customElements.get("gui-time") && customElements.define("gui-time", t);
|