@record-evolution/widget-form 1.0.32 → 1.0.33
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/dist/widget-form.js +560 -521
- package/dist/widget-form.js.map +1 -1
- package/package.json +1 -1
- package/src/widget-form.ts +79 -1
package/dist/widget-form.js
CHANGED
|
@@ -9,200 +9,200 @@ import "@material/web/checkbox/checkbox.js";
|
|
|
9
9
|
import "@material/web/select/outlined-select.js";
|
|
10
10
|
import "@material/web/select/select-option.js";
|
|
11
11
|
const R = globalThis, W = R.ShadowRoot && (R.ShadyCSS === void 0 || R.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, K = /* @__PURE__ */ Symbol(), Y = /* @__PURE__ */ new WeakMap();
|
|
12
|
-
let
|
|
13
|
-
constructor(
|
|
14
|
-
if (this._$cssResult$ = !0,
|
|
15
|
-
this.cssText =
|
|
12
|
+
let me = class {
|
|
13
|
+
constructor(e, s, i) {
|
|
14
|
+
if (this._$cssResult$ = !0, i !== K) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
15
|
+
this.cssText = e, this.t = s;
|
|
16
16
|
}
|
|
17
17
|
get styleSheet() {
|
|
18
|
-
let
|
|
19
|
-
const
|
|
20
|
-
if (W &&
|
|
21
|
-
const
|
|
22
|
-
|
|
18
|
+
let e = this.o;
|
|
19
|
+
const s = this.t;
|
|
20
|
+
if (W && e === void 0) {
|
|
21
|
+
const i = s !== void 0 && s.length === 1;
|
|
22
|
+
i && (e = Y.get(s)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && Y.set(s, e));
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return e;
|
|
25
25
|
}
|
|
26
26
|
toString() {
|
|
27
27
|
return this.cssText;
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
const
|
|
31
|
-
const
|
|
30
|
+
const Ae = (t) => new me(typeof t == "string" ? t : t + "", void 0, K), xe = (t, ...e) => {
|
|
31
|
+
const s = t.length === 1 ? t[0] : e.reduce(((i, r, o) => i + ((n) => {
|
|
32
32
|
if (n._$cssResult$ === !0) return n.cssText;
|
|
33
33
|
if (typeof n == "number") return n;
|
|
34
34
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + n + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
35
|
-
})(
|
|
36
|
-
return new
|
|
37
|
-
},
|
|
38
|
-
if (W)
|
|
39
|
-
else for (const
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
let
|
|
45
|
-
for (const
|
|
46
|
-
return
|
|
47
|
-
})(
|
|
48
|
-
const { is:
|
|
49
|
-
switch (
|
|
35
|
+
})(r) + t[o + 1]), t[0]);
|
|
36
|
+
return new me(s, t, K);
|
|
37
|
+
}, we = (t, e) => {
|
|
38
|
+
if (W) t.adoptedStyleSheets = e.map(((s) => s instanceof CSSStyleSheet ? s : s.styleSheet));
|
|
39
|
+
else for (const s of e) {
|
|
40
|
+
const i = document.createElement("style"), r = R.litNonce;
|
|
41
|
+
r !== void 0 && i.setAttribute("nonce", r), i.textContent = s.cssText, t.appendChild(i);
|
|
42
|
+
}
|
|
43
|
+
}, ee = W ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => {
|
|
44
|
+
let s = "";
|
|
45
|
+
for (const i of e.cssRules) s += i.cssText;
|
|
46
|
+
return Ae(s);
|
|
47
|
+
})(t) : t;
|
|
48
|
+
const { is: Se, defineProperty: Ee, getOwnPropertyDescriptor: Ce, getOwnPropertyNames: De, getOwnPropertySymbols: ke, getPrototypeOf: Pe } = Object, N = globalThis, te = N.trustedTypes, Ve = te ? te.emptyScript : "", Fe = N.reactiveElementPolyfillSupport, V = (t, e) => t, H = { toAttribute(t, e) {
|
|
49
|
+
switch (e) {
|
|
50
50
|
case Boolean:
|
|
51
|
-
|
|
51
|
+
t = t ? Ve : null;
|
|
52
52
|
break;
|
|
53
53
|
case Object:
|
|
54
54
|
case Array:
|
|
55
|
-
|
|
55
|
+
t = t == null ? t : JSON.stringify(t);
|
|
56
56
|
}
|
|
57
|
-
return
|
|
58
|
-
}, fromAttribute(
|
|
59
|
-
let
|
|
60
|
-
switch (
|
|
57
|
+
return t;
|
|
58
|
+
}, fromAttribute(t, e) {
|
|
59
|
+
let s = t;
|
|
60
|
+
switch (e) {
|
|
61
61
|
case Boolean:
|
|
62
|
-
|
|
62
|
+
s = t !== null;
|
|
63
63
|
break;
|
|
64
64
|
case Number:
|
|
65
|
-
|
|
65
|
+
s = t === null ? null : Number(t);
|
|
66
66
|
break;
|
|
67
67
|
case Object:
|
|
68
68
|
case Array:
|
|
69
69
|
try {
|
|
70
|
-
|
|
70
|
+
s = JSON.parse(t);
|
|
71
71
|
} catch {
|
|
72
|
-
|
|
72
|
+
s = null;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
return
|
|
76
|
-
} }, Z = (
|
|
75
|
+
return s;
|
|
76
|
+
} }, Z = (t, e) => !Se(t, e), se = { attribute: !0, type: String, converter: H, reflect: !1, useDefault: !1, hasChanged: Z };
|
|
77
77
|
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), N.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
78
78
|
let E = class extends HTMLElement {
|
|
79
|
-
static addInitializer(
|
|
80
|
-
this._$Ei(), (this.l ??= []).push(
|
|
79
|
+
static addInitializer(e) {
|
|
80
|
+
this._$Ei(), (this.l ??= []).push(e);
|
|
81
81
|
}
|
|
82
82
|
static get observedAttributes() {
|
|
83
83
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
84
84
|
}
|
|
85
|
-
static createProperty(
|
|
86
|
-
if (
|
|
87
|
-
const
|
|
88
|
-
|
|
85
|
+
static createProperty(e, s = se) {
|
|
86
|
+
if (s.state && (s.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((s = Object.create(s)).wrapped = !0), this.elementProperties.set(e, s), !s.noAccessor) {
|
|
87
|
+
const i = /* @__PURE__ */ Symbol(), r = this.getPropertyDescriptor(e, i, s);
|
|
88
|
+
r !== void 0 && Ee(this.prototype, e, r);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
static getPropertyDescriptor(
|
|
92
|
-
const { get:
|
|
93
|
-
return this[
|
|
91
|
+
static getPropertyDescriptor(e, s, i) {
|
|
92
|
+
const { get: r, set: o } = Ce(this.prototype, e) ?? { get() {
|
|
93
|
+
return this[s];
|
|
94
94
|
}, set(n) {
|
|
95
|
-
this[
|
|
95
|
+
this[s] = n;
|
|
96
96
|
} };
|
|
97
|
-
return { get:
|
|
98
|
-
const
|
|
99
|
-
o?.call(this, n), this.requestUpdate(
|
|
97
|
+
return { get: r, set(n) {
|
|
98
|
+
const c = r?.call(this);
|
|
99
|
+
o?.call(this, n), this.requestUpdate(e, c, i);
|
|
100
100
|
}, configurable: !0, enumerable: !0 };
|
|
101
101
|
}
|
|
102
|
-
static getPropertyOptions(
|
|
103
|
-
return this.elementProperties.get(
|
|
102
|
+
static getPropertyOptions(e) {
|
|
103
|
+
return this.elementProperties.get(e) ?? se;
|
|
104
104
|
}
|
|
105
105
|
static _$Ei() {
|
|
106
106
|
if (this.hasOwnProperty(V("elementProperties"))) return;
|
|
107
|
-
const
|
|
108
|
-
|
|
107
|
+
const e = Pe(this);
|
|
108
|
+
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
109
109
|
}
|
|
110
110
|
static finalize() {
|
|
111
111
|
if (this.hasOwnProperty(V("finalized"))) return;
|
|
112
112
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(V("properties"))) {
|
|
113
|
-
const
|
|
114
|
-
for (const
|
|
113
|
+
const s = this.properties, i = [...De(s), ...ke(s)];
|
|
114
|
+
for (const r of i) this.createProperty(r, s[r]);
|
|
115
115
|
}
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
const
|
|
119
|
-
if (
|
|
116
|
+
const e = this[Symbol.metadata];
|
|
117
|
+
if (e !== null) {
|
|
118
|
+
const s = litPropertyMetadata.get(e);
|
|
119
|
+
if (s !== void 0) for (const [i, r] of s) this.elementProperties.set(i, r);
|
|
120
120
|
}
|
|
121
121
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
122
|
-
for (const [
|
|
123
|
-
const
|
|
124
|
-
|
|
122
|
+
for (const [s, i] of this.elementProperties) {
|
|
123
|
+
const r = this._$Eu(s, i);
|
|
124
|
+
r !== void 0 && this._$Eh.set(r, s);
|
|
125
125
|
}
|
|
126
126
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
127
127
|
}
|
|
128
|
-
static finalizeStyles(
|
|
129
|
-
const
|
|
130
|
-
if (Array.isArray(
|
|
131
|
-
const
|
|
132
|
-
for (const
|
|
133
|
-
} else
|
|
134
|
-
return
|
|
128
|
+
static finalizeStyles(e) {
|
|
129
|
+
const s = [];
|
|
130
|
+
if (Array.isArray(e)) {
|
|
131
|
+
const i = new Set(e.flat(1 / 0).reverse());
|
|
132
|
+
for (const r of i) s.unshift(ee(r));
|
|
133
|
+
} else e !== void 0 && s.push(ee(e));
|
|
134
|
+
return s;
|
|
135
135
|
}
|
|
136
|
-
static _$Eu(
|
|
137
|
-
const
|
|
138
|
-
return
|
|
136
|
+
static _$Eu(e, s) {
|
|
137
|
+
const i = s.attribute;
|
|
138
|
+
return i === !1 ? void 0 : typeof i == "string" ? i : typeof e == "string" ? e.toLowerCase() : void 0;
|
|
139
139
|
}
|
|
140
140
|
constructor() {
|
|
141
141
|
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
142
142
|
}
|
|
143
143
|
_$Ev() {
|
|
144
|
-
this._$ES = new Promise(((
|
|
144
|
+
this._$ES = new Promise(((e) => this.enableUpdating = e)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((e) => e(this)));
|
|
145
145
|
}
|
|
146
|
-
addController(
|
|
147
|
-
(this._$EO ??= /* @__PURE__ */ new Set()).add(
|
|
146
|
+
addController(e) {
|
|
147
|
+
(this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.();
|
|
148
148
|
}
|
|
149
|
-
removeController(
|
|
150
|
-
this._$EO?.delete(
|
|
149
|
+
removeController(e) {
|
|
150
|
+
this._$EO?.delete(e);
|
|
151
151
|
}
|
|
152
152
|
_$E_() {
|
|
153
|
-
const
|
|
154
|
-
for (const
|
|
155
|
-
|
|
153
|
+
const e = /* @__PURE__ */ new Map(), s = this.constructor.elementProperties;
|
|
154
|
+
for (const i of s.keys()) this.hasOwnProperty(i) && (e.set(i, this[i]), delete this[i]);
|
|
155
|
+
e.size > 0 && (this._$Ep = e);
|
|
156
156
|
}
|
|
157
157
|
createRenderRoot() {
|
|
158
|
-
const
|
|
159
|
-
return
|
|
158
|
+
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
159
|
+
return we(e, this.constructor.elementStyles), e;
|
|
160
160
|
}
|
|
161
161
|
connectedCallback() {
|
|
162
|
-
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((
|
|
162
|
+
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((e) => e.hostConnected?.()));
|
|
163
163
|
}
|
|
164
|
-
enableUpdating(
|
|
164
|
+
enableUpdating(e) {
|
|
165
165
|
}
|
|
166
166
|
disconnectedCallback() {
|
|
167
|
-
this._$EO?.forEach(((
|
|
167
|
+
this._$EO?.forEach(((e) => e.hostDisconnected?.()));
|
|
168
168
|
}
|
|
169
|
-
attributeChangedCallback(
|
|
170
|
-
this._$AK(
|
|
169
|
+
attributeChangedCallback(e, s, i) {
|
|
170
|
+
this._$AK(e, i);
|
|
171
171
|
}
|
|
172
|
-
_$ET(
|
|
173
|
-
const
|
|
174
|
-
if (
|
|
175
|
-
const o = (
|
|
176
|
-
this._$Em =
|
|
172
|
+
_$ET(e, s) {
|
|
173
|
+
const i = this.constructor.elementProperties.get(e), r = this.constructor._$Eu(e, i);
|
|
174
|
+
if (r !== void 0 && i.reflect === !0) {
|
|
175
|
+
const o = (i.converter?.toAttribute !== void 0 ? i.converter : H).toAttribute(s, i.type);
|
|
176
|
+
this._$Em = e, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
_$AK(
|
|
180
|
-
const
|
|
181
|
-
if (
|
|
182
|
-
const o =
|
|
183
|
-
this._$Em =
|
|
179
|
+
_$AK(e, s) {
|
|
180
|
+
const i = this.constructor, r = i._$Eh.get(e);
|
|
181
|
+
if (r !== void 0 && this._$Em !== r) {
|
|
182
|
+
const o = i.getPropertyOptions(r), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : H;
|
|
183
|
+
this._$Em = r, this[r] = n.fromAttribute(s, o.type) ?? this._$Ej?.get(r) ?? null, this._$Em = null;
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
-
requestUpdate(
|
|
187
|
-
if (
|
|
188
|
-
const
|
|
189
|
-
if (
|
|
190
|
-
this.C(
|
|
186
|
+
requestUpdate(e, s, i) {
|
|
187
|
+
if (e !== void 0) {
|
|
188
|
+
const r = this.constructor, o = this[e];
|
|
189
|
+
if (i ??= r.getPropertyOptions(e), !((i.hasChanged ?? Z)(o, s) || i.useDefault && i.reflect && o === this._$Ej?.get(e) && !this.hasAttribute(r._$Eu(e, i)))) return;
|
|
190
|
+
this.C(e, s, i);
|
|
191
191
|
}
|
|
192
192
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
193
193
|
}
|
|
194
|
-
C(
|
|
195
|
-
|
|
194
|
+
C(e, s, { useDefault: i, reflect: r, wrapped: o }, n) {
|
|
195
|
+
i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, n ?? s ?? this[e]), o !== !0 || n !== void 0) || (this._$AL.has(e) || (this.hasUpdated || i || (s = void 0), this._$AL.set(e, s)), r === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
|
|
196
196
|
}
|
|
197
197
|
async _$EP() {
|
|
198
198
|
this.isUpdatePending = !0;
|
|
199
199
|
try {
|
|
200
200
|
await this._$ES;
|
|
201
|
-
} catch (
|
|
202
|
-
Promise.reject(
|
|
201
|
+
} catch (s) {
|
|
202
|
+
Promise.reject(s);
|
|
203
203
|
}
|
|
204
|
-
const
|
|
205
|
-
return
|
|
204
|
+
const e = this.scheduleUpdate();
|
|
205
|
+
return e != null && await e, !this.isUpdatePending;
|
|
206
206
|
}
|
|
207
207
|
scheduleUpdate() {
|
|
208
208
|
return this.performUpdate();
|
|
@@ -211,28 +211,28 @@ let E = class extends HTMLElement {
|
|
|
211
211
|
if (!this.isUpdatePending) return;
|
|
212
212
|
if (!this.hasUpdated) {
|
|
213
213
|
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
214
|
-
for (const [
|
|
214
|
+
for (const [r, o] of this._$Ep) this[r] = o;
|
|
215
215
|
this._$Ep = void 0;
|
|
216
216
|
}
|
|
217
|
-
const
|
|
218
|
-
if (
|
|
219
|
-
const { wrapped: n } = o,
|
|
220
|
-
n !== !0 || this._$AL.has(
|
|
217
|
+
const i = this.constructor.elementProperties;
|
|
218
|
+
if (i.size > 0) for (const [r, o] of i) {
|
|
219
|
+
const { wrapped: n } = o, c = this[r];
|
|
220
|
+
n !== !0 || this._$AL.has(r) || c === void 0 || this.C(r, void 0, o, c);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
let
|
|
224
|
-
const
|
|
223
|
+
let e = !1;
|
|
224
|
+
const s = this._$AL;
|
|
225
225
|
try {
|
|
226
|
-
|
|
227
|
-
} catch (
|
|
228
|
-
throw
|
|
226
|
+
e = this.shouldUpdate(s), e ? (this.willUpdate(s), this._$EO?.forEach(((i) => i.hostUpdate?.())), this.update(s)) : this._$EM();
|
|
227
|
+
} catch (i) {
|
|
228
|
+
throw e = !1, this._$EM(), i;
|
|
229
229
|
}
|
|
230
|
-
|
|
230
|
+
e && this._$AE(s);
|
|
231
231
|
}
|
|
232
|
-
willUpdate(
|
|
232
|
+
willUpdate(e) {
|
|
233
233
|
}
|
|
234
|
-
_$AE(
|
|
235
|
-
this._$EO?.forEach(((
|
|
234
|
+
_$AE(e) {
|
|
235
|
+
this._$EO?.forEach(((s) => s.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
|
|
236
236
|
}
|
|
237
237
|
_$EM() {
|
|
238
238
|
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
@@ -243,83 +243,83 @@ let E = class extends HTMLElement {
|
|
|
243
243
|
getUpdateComplete() {
|
|
244
244
|
return this._$ES;
|
|
245
245
|
}
|
|
246
|
-
shouldUpdate(
|
|
246
|
+
shouldUpdate(e) {
|
|
247
247
|
return !0;
|
|
248
248
|
}
|
|
249
|
-
update(
|
|
250
|
-
this._$Eq &&= this._$Eq.forEach(((
|
|
249
|
+
update(e) {
|
|
250
|
+
this._$Eq &&= this._$Eq.forEach(((s) => this._$ET(s, this[s]))), this._$EM();
|
|
251
251
|
}
|
|
252
|
-
updated(
|
|
252
|
+
updated(e) {
|
|
253
253
|
}
|
|
254
|
-
firstUpdated(
|
|
254
|
+
firstUpdated(e) {
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
|
-
E.elementStyles = [], E.shadowRootOptions = { mode: "open" }, E[V("elementProperties")] = /* @__PURE__ */ new Map(), E[V("finalized")] = /* @__PURE__ */ new Map(),
|
|
258
|
-
const J = globalThis, B = J.trustedTypes,
|
|
259
|
-
\f\r]`,
|
|
260
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
261
|
-
function
|
|
262
|
-
if (!Q(
|
|
263
|
-
return
|
|
257
|
+
E.elementStyles = [], E.shadowRootOptions = { mode: "open" }, E[V("elementProperties")] = /* @__PURE__ */ new Map(), E[V("finalized")] = /* @__PURE__ */ new Map(), Fe?.({ ReactiveElement: E }), (N.reactiveElementVersions ??= []).push("2.1.0");
|
|
258
|
+
const J = globalThis, B = J.trustedTypes, ie = B ? B.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, fe = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, $e = "?" + _, Oe = `<${$e}>`, w = document, O = () => w.createComment(""), T = (t) => t === null || typeof t != "object" && typeof t != "function", Q = Array.isArray, Te = (t) => Q(t) || typeof t?.[Symbol.iterator] == "function", I = `[
|
|
259
|
+
\f\r]`, k = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, re = /-->/g, oe = />/g, v = RegExp(`>|${I}(?:([^\\s"'>=/]+)(${I}*=${I}*(?:[^
|
|
260
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), ne = /'/g, le = /"/g, be = /^(?:script|style|textarea|title)$/i, Ue = (t) => (e, ...s) => ({ _$litType$: t, strings: e, values: s }), $ = Ue(1), S = /* @__PURE__ */ Symbol.for("lit-noChange"), d = /* @__PURE__ */ Symbol.for("lit-nothing"), ae = /* @__PURE__ */ new WeakMap(), x = w.createTreeWalker(w, 129);
|
|
261
|
+
function ge(t, e) {
|
|
262
|
+
if (!Q(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
263
|
+
return ie !== void 0 ? ie.createHTML(e) : e;
|
|
264
264
|
}
|
|
265
|
-
const
|
|
266
|
-
const
|
|
267
|
-
let
|
|
268
|
-
for (let
|
|
269
|
-
const l =
|
|
265
|
+
const Me = (t, e) => {
|
|
266
|
+
const s = t.length - 1, i = [];
|
|
267
|
+
let r, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", n = k;
|
|
268
|
+
for (let c = 0; c < s; c++) {
|
|
269
|
+
const l = t[c];
|
|
270
270
|
let u, m, a = -1, p = 0;
|
|
271
|
-
for (; p < l.length && (n.lastIndex = p, m = n.exec(l), m !== null); ) p = n.lastIndex, n ===
|
|
272
|
-
const
|
|
273
|
-
o += n ===
|
|
271
|
+
for (; p < l.length && (n.lastIndex = p, m = n.exec(l), m !== null); ) p = n.lastIndex, n === k ? m[1] === "!--" ? n = re : m[1] !== void 0 ? n = oe : m[2] !== void 0 ? (be.test(m[2]) && (r = RegExp("</" + m[2], "g")), n = v) : m[3] !== void 0 && (n = v) : n === v ? m[0] === ">" ? (n = r ?? k, a = -1) : m[1] === void 0 ? a = -2 : (a = n.lastIndex - m[2].length, u = m[1], n = m[3] === void 0 ? v : m[3] === '"' ? le : ne) : n === le || n === ne ? n = v : n === re || n === oe ? n = k : (n = v, r = void 0);
|
|
272
|
+
const h = n === v && t[c + 1].startsWith("/>") ? " " : "";
|
|
273
|
+
o += n === k ? l + Oe : a >= 0 ? (i.push(u), l.slice(0, a) + fe + l.slice(a) + _ + h) : l + _ + (a === -2 ? c : h);
|
|
274
274
|
}
|
|
275
|
-
return [
|
|
275
|
+
return [ge(t, o + (t[s] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), i];
|
|
276
276
|
};
|
|
277
277
|
class U {
|
|
278
|
-
constructor({ strings:
|
|
279
|
-
let
|
|
278
|
+
constructor({ strings: e, _$litType$: s }, i) {
|
|
279
|
+
let r;
|
|
280
280
|
this.parts = [];
|
|
281
281
|
let o = 0, n = 0;
|
|
282
|
-
const
|
|
283
|
-
if (this.el = U.createElement(u,
|
|
282
|
+
const c = e.length - 1, l = this.parts, [u, m] = Me(e, s);
|
|
283
|
+
if (this.el = U.createElement(u, i), x.currentNode = this.el.content, s === 2 || s === 3) {
|
|
284
284
|
const a = this.el.content.firstChild;
|
|
285
285
|
a.replaceWith(...a.childNodes);
|
|
286
286
|
}
|
|
287
|
-
for (; (
|
|
288
|
-
if (
|
|
289
|
-
if (
|
|
290
|
-
const p = m[n++],
|
|
291
|
-
l.push({ type: 1, index: o, name: f[2], strings:
|
|
292
|
-
} else a.startsWith(_) && (l.push({ type: 6, index: o }),
|
|
293
|
-
if (
|
|
294
|
-
const a =
|
|
287
|
+
for (; (r = x.nextNode()) !== null && l.length < c; ) {
|
|
288
|
+
if (r.nodeType === 1) {
|
|
289
|
+
if (r.hasAttributes()) for (const a of r.getAttributeNames()) if (a.endsWith(fe)) {
|
|
290
|
+
const p = m[n++], h = r.getAttribute(a).split(_), f = /([.?@])?(.*)/.exec(p);
|
|
291
|
+
l.push({ type: 1, index: o, name: f[2], strings: h, ctor: f[1] === "." ? He : f[1] === "?" ? Be : f[1] === "@" ? Ne : j }), r.removeAttribute(a);
|
|
292
|
+
} else a.startsWith(_) && (l.push({ type: 6, index: o }), r.removeAttribute(a));
|
|
293
|
+
if (be.test(r.tagName)) {
|
|
294
|
+
const a = r.textContent.split(_), p = a.length - 1;
|
|
295
295
|
if (p > 0) {
|
|
296
|
-
|
|
297
|
-
for (let
|
|
298
|
-
|
|
296
|
+
r.textContent = B ? B.emptyScript : "";
|
|
297
|
+
for (let h = 0; h < p; h++) r.append(a[h], O()), x.nextNode(), l.push({ type: 2, index: ++o });
|
|
298
|
+
r.append(a[p], O());
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
|
-
} else if (
|
|
301
|
+
} else if (r.nodeType === 8) if (r.data === $e) l.push({ type: 2, index: o });
|
|
302
302
|
else {
|
|
303
303
|
let a = -1;
|
|
304
|
-
for (; (a =
|
|
304
|
+
for (; (a = r.data.indexOf(_, a + 1)) !== -1; ) l.push({ type: 7, index: o }), a += _.length - 1;
|
|
305
305
|
}
|
|
306
306
|
o++;
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
static createElement(
|
|
310
|
-
const
|
|
311
|
-
return
|
|
309
|
+
static createElement(e, s) {
|
|
310
|
+
const i = w.createElement("template");
|
|
311
|
+
return i.innerHTML = e, i;
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
|
-
function C(
|
|
315
|
-
if (
|
|
316
|
-
let
|
|
317
|
-
const o = T(
|
|
318
|
-
return
|
|
314
|
+
function C(t, e, s = t, i) {
|
|
315
|
+
if (e === S) return e;
|
|
316
|
+
let r = i !== void 0 ? s._$Co?.[i] : s._$Cl;
|
|
317
|
+
const o = T(e) ? void 0 : e._$litDirective$;
|
|
318
|
+
return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(t), r._$AT(t, s, i)), i !== void 0 ? (s._$Co ??= [])[i] = r : s._$Cl = r), r !== void 0 && (e = C(t, r._$AS(t, e.values), r, i)), e;
|
|
319
319
|
}
|
|
320
|
-
let
|
|
321
|
-
constructor(
|
|
322
|
-
this._$AV = [], this._$AN = void 0, this._$AD =
|
|
320
|
+
let Re = class {
|
|
321
|
+
constructor(e, s) {
|
|
322
|
+
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = s;
|
|
323
323
|
}
|
|
324
324
|
get parentNode() {
|
|
325
325
|
return this._$AM.parentNode;
|
|
@@ -327,35 +327,35 @@ let Ut = class {
|
|
|
327
327
|
get _$AU() {
|
|
328
328
|
return this._$AM._$AU;
|
|
329
329
|
}
|
|
330
|
-
u(
|
|
331
|
-
const { el: { content:
|
|
332
|
-
x.currentNode =
|
|
333
|
-
let o = x.nextNode(), n = 0,
|
|
330
|
+
u(e) {
|
|
331
|
+
const { el: { content: s }, parts: i } = this._$AD, r = (e?.creationScope ?? w).importNode(s, !0);
|
|
332
|
+
x.currentNode = r;
|
|
333
|
+
let o = x.nextNode(), n = 0, c = 0, l = i[0];
|
|
334
334
|
for (; l !== void 0; ) {
|
|
335
335
|
if (n === l.index) {
|
|
336
336
|
let u;
|
|
337
|
-
l.type === 2 ? u = new
|
|
337
|
+
l.type === 2 ? u = new D(o, o.nextSibling, this, e) : l.type === 1 ? u = new l.ctor(o, l.name, l.strings, this, e) : l.type === 6 && (u = new je(o, this, e)), this._$AV.push(u), l = i[++c];
|
|
338
338
|
}
|
|
339
339
|
n !== l?.index && (o = x.nextNode(), n++);
|
|
340
340
|
}
|
|
341
|
-
return x.currentNode = w,
|
|
341
|
+
return x.currentNode = w, r;
|
|
342
342
|
}
|
|
343
|
-
p(
|
|
344
|
-
let
|
|
345
|
-
for (const
|
|
343
|
+
p(e) {
|
|
344
|
+
let s = 0;
|
|
345
|
+
for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(e, i, s), s += i.strings.length - 2) : i._$AI(e[s])), s++;
|
|
346
346
|
}
|
|
347
347
|
};
|
|
348
|
-
class
|
|
348
|
+
class D {
|
|
349
349
|
get _$AU() {
|
|
350
350
|
return this._$AM?._$AU ?? this._$Cv;
|
|
351
351
|
}
|
|
352
|
-
constructor(
|
|
353
|
-
this.type = 2, this._$AH = d, this._$AN = void 0, this._$AA =
|
|
352
|
+
constructor(e, s, i, r) {
|
|
353
|
+
this.type = 2, this._$AH = d, this._$AN = void 0, this._$AA = e, this._$AB = s, this._$AM = i, this.options = r, this._$Cv = r?.isConnected ?? !0;
|
|
354
354
|
}
|
|
355
355
|
get parentNode() {
|
|
356
|
-
let
|
|
357
|
-
const
|
|
358
|
-
return
|
|
356
|
+
let e = this._$AA.parentNode;
|
|
357
|
+
const s = this._$AM;
|
|
358
|
+
return s !== void 0 && e?.nodeType === 11 && (e = s.parentNode), e;
|
|
359
359
|
}
|
|
360
360
|
get startNode() {
|
|
361
361
|
return this._$AA;
|
|
@@ -363,45 +363,45 @@ class k {
|
|
|
363
363
|
get endNode() {
|
|
364
364
|
return this._$AB;
|
|
365
365
|
}
|
|
366
|
-
_$AI(
|
|
367
|
-
|
|
366
|
+
_$AI(e, s = this) {
|
|
367
|
+
e = C(this, e, s), T(e) ? e === d || e == null || e === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : e !== this._$AH && e !== S && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Te(e) ? this.k(e) : this._(e);
|
|
368
368
|
}
|
|
369
|
-
O(
|
|
370
|
-
return this._$AA.parentNode.insertBefore(
|
|
369
|
+
O(e) {
|
|
370
|
+
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
371
371
|
}
|
|
372
|
-
T(
|
|
373
|
-
this._$AH !==
|
|
372
|
+
T(e) {
|
|
373
|
+
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
374
374
|
}
|
|
375
|
-
_(
|
|
376
|
-
this._$AH !== d && T(this._$AH) ? this._$AA.nextSibling.data =
|
|
375
|
+
_(e) {
|
|
376
|
+
this._$AH !== d && T(this._$AH) ? this._$AA.nextSibling.data = e : this.T(w.createTextNode(e)), this._$AH = e;
|
|
377
377
|
}
|
|
378
|
-
$(
|
|
379
|
-
const { values:
|
|
380
|
-
if (this._$AH?._$AD ===
|
|
378
|
+
$(e) {
|
|
379
|
+
const { values: s, _$litType$: i } = e, r = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = U.createElement(ge(i.h, i.h[0]), this.options)), i);
|
|
380
|
+
if (this._$AH?._$AD === r) this._$AH.p(s);
|
|
381
381
|
else {
|
|
382
|
-
const o = new
|
|
383
|
-
o.p(
|
|
382
|
+
const o = new Re(r, this), n = o.u(this.options);
|
|
383
|
+
o.p(s), this.T(n), this._$AH = o;
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
|
-
_$AC(
|
|
387
|
-
let
|
|
388
|
-
return
|
|
386
|
+
_$AC(e) {
|
|
387
|
+
let s = ae.get(e.strings);
|
|
388
|
+
return s === void 0 && ae.set(e.strings, s = new U(e)), s;
|
|
389
389
|
}
|
|
390
|
-
k(
|
|
390
|
+
k(e) {
|
|
391
391
|
Q(this._$AH) || (this._$AH = [], this._$AR());
|
|
392
|
-
const
|
|
393
|
-
let
|
|
394
|
-
for (const o of
|
|
395
|
-
|
|
396
|
-
}
|
|
397
|
-
_$AR(
|
|
398
|
-
for (this._$AP?.(!1, !0,
|
|
399
|
-
const
|
|
400
|
-
|
|
392
|
+
const s = this._$AH;
|
|
393
|
+
let i, r = 0;
|
|
394
|
+
for (const o of e) r === s.length ? s.push(i = new D(this.O(O()), this.O(O()), this, this.options)) : i = s[r], i._$AI(o), r++;
|
|
395
|
+
r < s.length && (this._$AR(i && i._$AB.nextSibling, r), s.length = r);
|
|
396
|
+
}
|
|
397
|
+
_$AR(e = this._$AA.nextSibling, s) {
|
|
398
|
+
for (this._$AP?.(!1, !0, s); e && e !== this._$AB; ) {
|
|
399
|
+
const i = e.nextSibling;
|
|
400
|
+
e.remove(), e = i;
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
|
-
setConnected(
|
|
404
|
-
this._$AM === void 0 && (this._$Cv =
|
|
403
|
+
setConnected(e) {
|
|
404
|
+
this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
407
|
class j {
|
|
@@ -411,74 +411,74 @@ class j {
|
|
|
411
411
|
get _$AU() {
|
|
412
412
|
return this._$AM._$AU;
|
|
413
413
|
}
|
|
414
|
-
constructor(
|
|
415
|
-
this.type = 1, this._$AH = d, this._$AN = void 0, this.element =
|
|
414
|
+
constructor(e, s, i, r, o) {
|
|
415
|
+
this.type = 1, this._$AH = d, this._$AN = void 0, this.element = e, this.name = s, this._$AM = r, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = d;
|
|
416
416
|
}
|
|
417
|
-
_$AI(
|
|
417
|
+
_$AI(e, s = this, i, r) {
|
|
418
418
|
const o = this.strings;
|
|
419
419
|
let n = !1;
|
|
420
|
-
if (o === void 0)
|
|
420
|
+
if (o === void 0) e = C(this, e, s, 0), n = !T(e) || e !== this._$AH && e !== S, n && (this._$AH = e);
|
|
421
421
|
else {
|
|
422
|
-
const
|
|
422
|
+
const c = e;
|
|
423
423
|
let l, u;
|
|
424
|
-
for (
|
|
424
|
+
for (e = o[0], l = 0; l < o.length - 1; l++) u = C(this, c[i + l], s, l), u === S && (u = this._$AH[l]), n ||= !T(u) || u !== this._$AH[l], u === d ? e = d : e !== d && (e += (u ?? "") + o[l + 1]), this._$AH[l] = u;
|
|
425
425
|
}
|
|
426
|
-
n && !
|
|
426
|
+
n && !r && this.j(e);
|
|
427
427
|
}
|
|
428
|
-
j(
|
|
429
|
-
|
|
428
|
+
j(e) {
|
|
429
|
+
e === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
|
-
class
|
|
432
|
+
class He extends j {
|
|
433
433
|
constructor() {
|
|
434
434
|
super(...arguments), this.type = 3;
|
|
435
435
|
}
|
|
436
|
-
j(
|
|
437
|
-
this.element[this.name] =
|
|
436
|
+
j(e) {
|
|
437
|
+
this.element[this.name] = e === d ? void 0 : e;
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
class
|
|
440
|
+
class Be extends j {
|
|
441
441
|
constructor() {
|
|
442
442
|
super(...arguments), this.type = 4;
|
|
443
443
|
}
|
|
444
|
-
j(
|
|
445
|
-
this.element.toggleAttribute(this.name, !!
|
|
444
|
+
j(e) {
|
|
445
|
+
this.element.toggleAttribute(this.name, !!e && e !== d);
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
|
-
class
|
|
449
|
-
constructor(
|
|
450
|
-
super(
|
|
448
|
+
class Ne extends j {
|
|
449
|
+
constructor(e, s, i, r, o) {
|
|
450
|
+
super(e, s, i, r, o), this.type = 5;
|
|
451
451
|
}
|
|
452
|
-
_$AI(
|
|
453
|
-
if ((
|
|
454
|
-
const
|
|
455
|
-
|
|
452
|
+
_$AI(e, s = this) {
|
|
453
|
+
if ((e = C(this, e, s, 0) ?? d) === S) return;
|
|
454
|
+
const i = this._$AH, r = e === d && i !== d || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, o = e !== d && (i === d || r);
|
|
455
|
+
r && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
456
456
|
}
|
|
457
|
-
handleEvent(
|
|
458
|
-
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element,
|
|
457
|
+
handleEvent(e) {
|
|
458
|
+
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
class
|
|
462
|
-
constructor(
|
|
463
|
-
this.element =
|
|
461
|
+
class je {
|
|
462
|
+
constructor(e, s, i) {
|
|
463
|
+
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = s, this.options = i;
|
|
464
464
|
}
|
|
465
465
|
get _$AU() {
|
|
466
466
|
return this._$AM._$AU;
|
|
467
467
|
}
|
|
468
|
-
_$AI(
|
|
469
|
-
C(this,
|
|
468
|
+
_$AI(e) {
|
|
469
|
+
C(this, e);
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
const
|
|
473
|
-
|
|
474
|
-
const
|
|
475
|
-
const
|
|
476
|
-
let
|
|
477
|
-
if (
|
|
478
|
-
const o =
|
|
479
|
-
|
|
480
|
-
}
|
|
481
|
-
return
|
|
472
|
+
const ze = { I: D }, qe = J.litHtmlPolyfillSupport;
|
|
473
|
+
qe?.(U, D), (J.litHtmlVersions ??= []).push("3.3.0");
|
|
474
|
+
const Ie = (t, e, s) => {
|
|
475
|
+
const i = s?.renderBefore ?? e;
|
|
476
|
+
let r = i._$litPart$;
|
|
477
|
+
if (r === void 0) {
|
|
478
|
+
const o = s?.renderBefore ?? null;
|
|
479
|
+
i._$litPart$ = r = new D(e.insertBefore(O(), o), o, void 0, s ?? {});
|
|
480
|
+
}
|
|
481
|
+
return r._$AI(t), r;
|
|
482
482
|
};
|
|
483
483
|
const G = globalThis;
|
|
484
484
|
let F = class extends E {
|
|
@@ -486,12 +486,12 @@ let F = class extends E {
|
|
|
486
486
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
487
487
|
}
|
|
488
488
|
createRenderRoot() {
|
|
489
|
-
const
|
|
490
|
-
return this.renderOptions.renderBefore ??=
|
|
489
|
+
const e = super.createRenderRoot();
|
|
490
|
+
return this.renderOptions.renderBefore ??= e.firstChild, e;
|
|
491
491
|
}
|
|
492
|
-
update(
|
|
493
|
-
const
|
|
494
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(
|
|
492
|
+
update(e) {
|
|
493
|
+
const s = this.render();
|
|
494
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Ie(s, this.renderRoot, this.renderOptions);
|
|
495
495
|
}
|
|
496
496
|
connectedCallback() {
|
|
497
497
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -504,176 +504,215 @@ let F = class extends E {
|
|
|
504
504
|
}
|
|
505
505
|
};
|
|
506
506
|
F._$litElement$ = !0, F.finalized = !0, G.litElementHydrateSupport?.({ LitElement: F });
|
|
507
|
-
const
|
|
508
|
-
|
|
507
|
+
const Le = G.litElementPolyfillSupport;
|
|
508
|
+
Le?.({ LitElement: F });
|
|
509
509
|
(G.litElementVersions ??= []).push("4.2.0");
|
|
510
|
-
const
|
|
511
|
-
let
|
|
512
|
-
constructor(
|
|
510
|
+
const We = { CHILD: 2 }, ye = (t) => (...e) => ({ _$litDirective$: t, values: e });
|
|
511
|
+
let _e = class {
|
|
512
|
+
constructor(e) {
|
|
513
513
|
}
|
|
514
514
|
get _$AU() {
|
|
515
515
|
return this._$AM._$AU;
|
|
516
516
|
}
|
|
517
|
-
_$AT(
|
|
518
|
-
this._$Ct =
|
|
517
|
+
_$AT(e, s, i) {
|
|
518
|
+
this._$Ct = e, this._$AM = s, this._$Ci = i;
|
|
519
519
|
}
|
|
520
|
-
_$AS(
|
|
521
|
-
return this.update(
|
|
520
|
+
_$AS(e, s) {
|
|
521
|
+
return this.update(e, s);
|
|
522
522
|
}
|
|
523
|
-
update(
|
|
524
|
-
return this.render(...
|
|
523
|
+
update(e, s) {
|
|
524
|
+
return this.render(...s);
|
|
525
525
|
}
|
|
526
526
|
};
|
|
527
|
-
const { I:
|
|
528
|
-
const
|
|
529
|
-
if (
|
|
530
|
-
const o =
|
|
531
|
-
|
|
527
|
+
const { I: Ke } = ze, ce = () => document.createComment(""), P = (t, e, s) => {
|
|
528
|
+
const i = t._$AA.parentNode, r = e === void 0 ? t._$AB : e._$AA;
|
|
529
|
+
if (s === void 0) {
|
|
530
|
+
const o = i.insertBefore(ce(), r), n = i.insertBefore(ce(), r);
|
|
531
|
+
s = new Ke(o, n, t, t.options);
|
|
532
532
|
} else {
|
|
533
|
-
const o =
|
|
534
|
-
if (
|
|
533
|
+
const o = s._$AB.nextSibling, n = s._$AM, c = n !== t;
|
|
534
|
+
if (c) {
|
|
535
535
|
let l;
|
|
536
|
-
|
|
536
|
+
s._$AQ?.(t), s._$AM = t, s._$AP !== void 0 && (l = t._$AU) !== n._$AU && s._$AP(l);
|
|
537
537
|
}
|
|
538
|
-
if (o !==
|
|
539
|
-
let l =
|
|
538
|
+
if (o !== r || c) {
|
|
539
|
+
let l = s._$AA;
|
|
540
540
|
for (; l !== o; ) {
|
|
541
541
|
const u = l.nextSibling;
|
|
542
|
-
|
|
542
|
+
i.insertBefore(l, r), l = u;
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
|
-
return
|
|
547
|
-
}, A = (
|
|
548
|
-
|
|
549
|
-
let
|
|
550
|
-
const
|
|
551
|
-
for (;
|
|
552
|
-
const
|
|
553
|
-
|
|
546
|
+
return s;
|
|
547
|
+
}, A = (t, e, s = t) => (t._$AI(e, s), t), Ze = {}, ve = (t, e = Ze) => t._$AH = e, Je = (t) => t._$AH, L = (t) => {
|
|
548
|
+
t._$AP?.(!1, !0);
|
|
549
|
+
let e = t._$AA;
|
|
550
|
+
const s = t._$AB.nextSibling;
|
|
551
|
+
for (; e !== s; ) {
|
|
552
|
+
const i = e.nextSibling;
|
|
553
|
+
e.remove(), e = i;
|
|
554
554
|
}
|
|
555
555
|
};
|
|
556
|
-
const
|
|
557
|
-
const
|
|
558
|
-
for (let
|
|
559
|
-
return
|
|
560
|
-
},
|
|
561
|
-
constructor(
|
|
562
|
-
if (super(
|
|
556
|
+
const he = (t, e, s) => {
|
|
557
|
+
const i = /* @__PURE__ */ new Map();
|
|
558
|
+
for (let r = e; r <= s; r++) i.set(t[r], r);
|
|
559
|
+
return i;
|
|
560
|
+
}, ue = ye(class extends _e {
|
|
561
|
+
constructor(t) {
|
|
562
|
+
if (super(t), t.type !== We.CHILD) throw Error("repeat() can only be used in text expressions");
|
|
563
563
|
}
|
|
564
|
-
dt(
|
|
565
|
-
let
|
|
566
|
-
|
|
567
|
-
const
|
|
564
|
+
dt(t, e, s) {
|
|
565
|
+
let i;
|
|
566
|
+
s === void 0 ? s = e : e !== void 0 && (i = e);
|
|
567
|
+
const r = [], o = [];
|
|
568
568
|
let n = 0;
|
|
569
|
-
for (const
|
|
570
|
-
return { values: o, keys:
|
|
571
|
-
}
|
|
572
|
-
render(
|
|
573
|
-
return this.dt(
|
|
574
|
-
}
|
|
575
|
-
update(
|
|
576
|
-
const
|
|
577
|
-
if (!Array.isArray(
|
|
578
|
-
const
|
|
579
|
-
let u, m, a = 0, p =
|
|
580
|
-
for (; a <= p &&
|
|
581
|
-
else if (
|
|
582
|
-
else if (
|
|
583
|
-
else if (
|
|
584
|
-
else if (
|
|
585
|
-
else if (
|
|
586
|
-
else if (u === void 0 && (u =
|
|
587
|
-
const y = m.get(n[
|
|
569
|
+
for (const c of t) r[n] = i ? i(c, n) : n, o[n] = s(c, n), n++;
|
|
570
|
+
return { values: o, keys: r };
|
|
571
|
+
}
|
|
572
|
+
render(t, e, s) {
|
|
573
|
+
return this.dt(t, e, s).values;
|
|
574
|
+
}
|
|
575
|
+
update(t, [e, s, i]) {
|
|
576
|
+
const r = Je(t), { values: o, keys: n } = this.dt(e, s, i);
|
|
577
|
+
if (!Array.isArray(r)) return this.ut = n, o;
|
|
578
|
+
const c = this.ut ??= [], l = [];
|
|
579
|
+
let u, m, a = 0, p = r.length - 1, h = 0, f = o.length - 1;
|
|
580
|
+
for (; a <= p && h <= f; ) if (r[a] === null) a++;
|
|
581
|
+
else if (r[p] === null) p--;
|
|
582
|
+
else if (c[a] === n[h]) l[h] = A(r[a], o[h]), a++, h++;
|
|
583
|
+
else if (c[p] === n[f]) l[f] = A(r[p], o[f]), p--, f--;
|
|
584
|
+
else if (c[a] === n[f]) l[f] = A(r[a], o[f]), P(t, l[f + 1], r[a]), a++, f--;
|
|
585
|
+
else if (c[p] === n[h]) l[h] = A(r[p], o[h]), P(t, r[a], r[p]), p--, h++;
|
|
586
|
+
else if (u === void 0 && (u = he(n, h, f), m = he(c, a, p)), u.has(c[a])) if (u.has(c[p])) {
|
|
587
|
+
const y = m.get(n[h]), q = y !== void 0 ? r[y] : null;
|
|
588
588
|
if (q === null) {
|
|
589
|
-
const X = P(
|
|
590
|
-
A(X, o[
|
|
591
|
-
} else l[
|
|
592
|
-
|
|
593
|
-
} else L(
|
|
594
|
-
else L(
|
|
595
|
-
for (;
|
|
596
|
-
const y = P(
|
|
597
|
-
A(y, o[
|
|
589
|
+
const X = P(t, r[a]);
|
|
590
|
+
A(X, o[h]), l[h] = X;
|
|
591
|
+
} else l[h] = A(q, o[h]), P(t, r[a], q), r[y] = null;
|
|
592
|
+
h++;
|
|
593
|
+
} else L(r[p]), p--;
|
|
594
|
+
else L(r[a]), a++;
|
|
595
|
+
for (; h <= f; ) {
|
|
596
|
+
const y = P(t, l[f + 1]);
|
|
597
|
+
A(y, o[h]), l[h++] = y;
|
|
598
598
|
}
|
|
599
599
|
for (; a <= p; ) {
|
|
600
|
-
const y =
|
|
600
|
+
const y = r[a++];
|
|
601
601
|
y !== null && L(y);
|
|
602
602
|
}
|
|
603
|
-
return this.ut = n,
|
|
603
|
+
return this.ut = n, ve(t, l), S;
|
|
604
604
|
}
|
|
605
605
|
});
|
|
606
|
-
const
|
|
606
|
+
const Qe = ye(class extends _e {
|
|
607
607
|
constructor() {
|
|
608
608
|
super(...arguments), this.key = d;
|
|
609
609
|
}
|
|
610
|
-
render(
|
|
611
|
-
return this.key =
|
|
610
|
+
render(t, e) {
|
|
611
|
+
return this.key = t, e;
|
|
612
612
|
}
|
|
613
|
-
update(
|
|
614
|
-
return
|
|
613
|
+
update(t, [e, s]) {
|
|
614
|
+
return e !== this.key && (ve(t), this.key = e), s;
|
|
615
615
|
}
|
|
616
616
|
});
|
|
617
|
-
const
|
|
618
|
-
|
|
619
|
-
customElements.define(
|
|
620
|
-
})) : customElements.define(
|
|
617
|
+
const Ge = (t) => (e, s) => {
|
|
618
|
+
s !== void 0 ? s.addInitializer((() => {
|
|
619
|
+
customElements.define(t, e);
|
|
620
|
+
})) : customElements.define(t, e);
|
|
621
621
|
};
|
|
622
|
-
const
|
|
623
|
-
const { kind:
|
|
624
|
-
let o = globalThis.litPropertyMetadata.get(
|
|
625
|
-
if (o === void 0 && globalThis.litPropertyMetadata.set(
|
|
626
|
-
const { name: n } =
|
|
627
|
-
return { set(
|
|
628
|
-
const l =
|
|
629
|
-
|
|
630
|
-
}, init(
|
|
631
|
-
return
|
|
622
|
+
const Xe = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged: Z }, Ye = (t = Xe, e, s) => {
|
|
623
|
+
const { kind: i, metadata: r } = s;
|
|
624
|
+
let o = globalThis.litPropertyMetadata.get(r);
|
|
625
|
+
if (o === void 0 && globalThis.litPropertyMetadata.set(r, o = /* @__PURE__ */ new Map()), i === "setter" && ((t = Object.create(t)).wrapped = !0), o.set(s.name, t), i === "accessor") {
|
|
626
|
+
const { name: n } = s;
|
|
627
|
+
return { set(c) {
|
|
628
|
+
const l = e.get.call(this);
|
|
629
|
+
e.set.call(this, c), this.requestUpdate(n, l, t);
|
|
630
|
+
}, init(c) {
|
|
631
|
+
return c !== void 0 && this.C(n, void 0, t, c), c;
|
|
632
632
|
} };
|
|
633
633
|
}
|
|
634
|
-
if (
|
|
635
|
-
const { name: n } =
|
|
636
|
-
return function(
|
|
634
|
+
if (i === "setter") {
|
|
635
|
+
const { name: n } = s;
|
|
636
|
+
return function(c) {
|
|
637
637
|
const l = this[n];
|
|
638
|
-
|
|
638
|
+
e.call(this, c), this.requestUpdate(n, l, t);
|
|
639
639
|
};
|
|
640
640
|
}
|
|
641
|
-
throw Error("Unsupported decorator location: " +
|
|
641
|
+
throw Error("Unsupported decorator location: " + i);
|
|
642
642
|
};
|
|
643
|
-
function z(
|
|
644
|
-
return (
|
|
645
|
-
const n =
|
|
646
|
-
return
|
|
647
|
-
})(
|
|
643
|
+
function z(t) {
|
|
644
|
+
return (e, s) => typeof s == "object" ? Ye(t, e, s) : ((i, r, o) => {
|
|
645
|
+
const n = r.hasOwnProperty(o);
|
|
646
|
+
return r.constructor.createProperty(o, i), n ? Object.getOwnPropertyDescriptor(r, o) : void 0;
|
|
647
|
+
})(t, e, s);
|
|
648
648
|
}
|
|
649
|
-
function M(
|
|
650
|
-
return z({ ...
|
|
649
|
+
function M(t) {
|
|
650
|
+
return z({ ...t, state: !0, attribute: !1 });
|
|
651
651
|
}
|
|
652
|
-
const
|
|
653
|
-
function
|
|
654
|
-
return (i, r
|
|
655
|
-
const o = (n) => n.renderRoot?.querySelector(
|
|
656
|
-
return
|
|
652
|
+
const et = (t, e, s) => (s.configurable = !0, s.enumerable = !0, Reflect.decorate && typeof e != "object" && Object.defineProperty(t, e, s), s);
|
|
653
|
+
function tt(t, e) {
|
|
654
|
+
return (s, i, r) => {
|
|
655
|
+
const o = (n) => n.renderRoot?.querySelector(t) ?? null;
|
|
656
|
+
return et(s, i, { get() {
|
|
657
657
|
return o(this);
|
|
658
658
|
} });
|
|
659
659
|
};
|
|
660
660
|
}
|
|
661
|
-
var
|
|
662
|
-
for (var
|
|
663
|
-
(n =
|
|
664
|
-
return
|
|
661
|
+
var st = Object.defineProperty, it = Object.getOwnPropertyDescriptor, g = (t, e, s, i) => {
|
|
662
|
+
for (var r = i > 1 ? void 0 : i ? it(e, s) : e, o = t.length - 1, n; o >= 0; o--)
|
|
663
|
+
(n = t[o]) && (r = (i ? n(e, s, r) : n(r)) || r);
|
|
664
|
+
return i && r && st(e, s, r), r;
|
|
665
|
+
};
|
|
666
|
+
const rt = /* @__PURE__ */ new Set(["(", ")", "[", "{", "}", "/", "|"]), ot = (t) => {
|
|
667
|
+
let e = "", s = !1, i = 0;
|
|
668
|
+
for (let r = 0; r < t.length; r++) {
|
|
669
|
+
const o = t[r];
|
|
670
|
+
if (o === "\\")
|
|
671
|
+
e += o + (t[r + 1] ?? ""), r++;
|
|
672
|
+
else if (!s)
|
|
673
|
+
o === "[" && (s = !0, i = t[r + 1] === "^" ? r + 2 : r + 1), e += o;
|
|
674
|
+
else if (o === "]")
|
|
675
|
+
s = !1, e += o;
|
|
676
|
+
else if (o === "-") {
|
|
677
|
+
const n = r > i && r < t.length - 1 && t[r + 1] !== "]";
|
|
678
|
+
e += n ? o : "\\-";
|
|
679
|
+
} else
|
|
680
|
+
e += rt.has(o) ? "\\" + o : o;
|
|
681
|
+
}
|
|
682
|
+
return e;
|
|
683
|
+
}, de = (t) => {
|
|
684
|
+
try {
|
|
685
|
+
return new RegExp("^(?:" + t + ")$", "v"), !0;
|
|
686
|
+
} catch {
|
|
687
|
+
return !1;
|
|
688
|
+
}
|
|
689
|
+
}, pe = /* @__PURE__ */ new Map(), nt = (t) => {
|
|
690
|
+
const e = t?.trim();
|
|
691
|
+
if (!e) return "";
|
|
692
|
+
const s = pe.get(e);
|
|
693
|
+
if (s !== void 0) return s;
|
|
694
|
+
let i = "";
|
|
695
|
+
if (de(e))
|
|
696
|
+
i = e;
|
|
697
|
+
else {
|
|
698
|
+
const r = ot(e);
|
|
699
|
+
de(r) ? i = r : console.warn(
|
|
700
|
+
`widget-form: ignoring validation regex "${e}" — it is not a valid regular expression under the "v" flag the HTML pattern attribute uses.`
|
|
701
|
+
);
|
|
702
|
+
}
|
|
703
|
+
return pe.set(e, i), i;
|
|
665
704
|
};
|
|
666
705
|
let b = class extends F {
|
|
667
706
|
constructor() {
|
|
668
|
-
super(...arguments), this.dialogOpen = !1, this.formKey = 0, this.fieldValues = {}, this.version = "1.0.
|
|
707
|
+
super(...arguments), this.dialogOpen = !1, this.formKey = 0, this.fieldValues = {}, this.version = "1.0.33", this.dialogScrimPatched = !1;
|
|
669
708
|
}
|
|
670
|
-
update(
|
|
671
|
-
|
|
709
|
+
update(t) {
|
|
710
|
+
t.has("theme") && this.registerTheme(this.theme), super.update(t);
|
|
672
711
|
}
|
|
673
|
-
firstUpdated(
|
|
712
|
+
firstUpdated(t) {
|
|
674
713
|
this.registerTheme(this.theme);
|
|
675
714
|
}
|
|
676
|
-
updated(
|
|
715
|
+
updated(t) {
|
|
677
716
|
this.patchDialogScrim(), this.toggleAttribute("fab-mode", !!this.inputData?.formButton);
|
|
678
717
|
}
|
|
679
718
|
/**
|
|
@@ -689,10 +728,10 @@ let b = class extends F {
|
|
|
689
728
|
*/
|
|
690
729
|
patchDialogScrim() {
|
|
691
730
|
if (this.dialogScrimPatched) return;
|
|
692
|
-
const
|
|
693
|
-
if (!
|
|
694
|
-
const
|
|
695
|
-
|
|
731
|
+
const t = this.dialog?.shadowRoot;
|
|
732
|
+
if (!t) return;
|
|
733
|
+
const e = new CSSStyleSheet();
|
|
734
|
+
e.replaceSync(`
|
|
696
735
|
dialog::backdrop {
|
|
697
736
|
background: var(--md-sys-color-scrim, #000);
|
|
698
737
|
opacity: 0.32;
|
|
@@ -700,18 +739,18 @@ let b = class extends F {
|
|
|
700
739
|
.scrim {
|
|
701
740
|
display: none !important;
|
|
702
741
|
}
|
|
703
|
-
`),
|
|
742
|
+
`), t.adoptedStyleSheets = [...t.adoptedStyleSheets, e], this.dialogScrimPatched = !0;
|
|
704
743
|
}
|
|
705
|
-
registerTheme(
|
|
706
|
-
const
|
|
707
|
-
this.themeBgColor =
|
|
744
|
+
registerTheme(t) {
|
|
745
|
+
const e = getComputedStyle(this).getPropertyValue("--re-text-color").trim(), s = getComputedStyle(this).getPropertyValue("--re-tile-background-color").trim();
|
|
746
|
+
this.themeBgColor = s || this.theme?.theme_object?.backgroundColor, this.themeTitleColor = e || this.theme?.theme_object?.title?.textStyle?.color;
|
|
708
747
|
}
|
|
709
748
|
openFormDialog() {
|
|
710
749
|
this.dialogOpen = !0;
|
|
711
750
|
}
|
|
712
|
-
handleFormSubmit(
|
|
713
|
-
|
|
714
|
-
const
|
|
751
|
+
handleFormSubmit(t) {
|
|
752
|
+
t.preventDefault();
|
|
753
|
+
const s = t.submitter?.getAttribute("value") ?? "submit", i = t.target, r = new FormData(i), o = this.inputData?.formFields?.map((n, c) => {
|
|
715
754
|
const l = {
|
|
716
755
|
swarm_app_databackend_key: n.targetColumn?.swarm_app_databackend_key,
|
|
717
756
|
table_name: n.targetColumn?.tablename,
|
|
@@ -719,21 +758,21 @@ let b = class extends F {
|
|
|
719
758
|
};
|
|
720
759
|
if (!n.hiddenField && !this.isFieldVisible(n))
|
|
721
760
|
return { ...l, value: null };
|
|
722
|
-
const u = this.currentRawValue(n,
|
|
761
|
+
const u = this.currentRawValue(n, c, r);
|
|
723
762
|
return { ...l, value: this.formatValue(u, n.type ?? "textfield") };
|
|
724
763
|
});
|
|
725
764
|
if (this.inputData?.deleteFlagColumn && o?.push({
|
|
726
765
|
swarm_app_databackend_key: this.inputData?.deleteFlagColumn?.swarm_app_databackend_key,
|
|
727
766
|
table_name: this.inputData?.deleteFlagColumn?.tablename,
|
|
728
767
|
column_name: this.inputData?.deleteFlagColumn?.column,
|
|
729
|
-
value:
|
|
768
|
+
value: s === "delete"
|
|
730
769
|
}), this.dispatchEvent(
|
|
731
770
|
new CustomEvent("data-submit", {
|
|
732
771
|
detail: o,
|
|
733
772
|
bubbles: !1,
|
|
734
773
|
composed: !1
|
|
735
774
|
})
|
|
736
|
-
),
|
|
775
|
+
), s === "delete") {
|
|
737
776
|
const n = this.resolveRoute({
|
|
738
777
|
route: this.inputData?.deleteNavigationRoute,
|
|
739
778
|
variables: this.inputData?.variables
|
|
@@ -755,23 +794,23 @@ let b = class extends F {
|
|
|
755
794
|
// and fall back to the single-line key so fields configured before the split
|
|
756
795
|
// keep their values. A value lingering in a hidden twin key after a type
|
|
757
796
|
// switch is ignored.
|
|
758
|
-
effectivePreFilledValue(
|
|
759
|
-
return
|
|
797
|
+
effectivePreFilledValue(t) {
|
|
798
|
+
return t.type === "textarea" ? t.preFilledValueMultiline ?? t.preFilledValue : t.type === "checkbox" && t.preFilledValueBoolean != null ? String(t.preFilledValueBoolean) : t.preFilledValue;
|
|
760
799
|
}
|
|
761
|
-
effectiveDefaultValue(
|
|
762
|
-
return
|
|
800
|
+
effectiveDefaultValue(t) {
|
|
801
|
+
return t.type === "textarea" ? t.defaultValueMultiline ?? t.defaultValue : t.type === "checkbox" && t.defaultValueBoolean != null ? String(t.defaultValueBoolean) : t.defaultValue;
|
|
763
802
|
}
|
|
764
|
-
formatValue(
|
|
765
|
-
switch (
|
|
803
|
+
formatValue(t, e) {
|
|
804
|
+
switch (e) {
|
|
766
805
|
case "numberfield": {
|
|
767
|
-
if (
|
|
768
|
-
const
|
|
769
|
-
return Number.isNaN(
|
|
806
|
+
if (t === "" || t === null || t === void 0) return null;
|
|
807
|
+
const s = parseFloat(t);
|
|
808
|
+
return Number.isNaN(s) ? null : s;
|
|
770
809
|
}
|
|
771
810
|
case "checkbox":
|
|
772
|
-
return
|
|
811
|
+
return t === "on" || t === "true";
|
|
773
812
|
default:
|
|
774
|
-
return
|
|
813
|
+
return t;
|
|
775
814
|
}
|
|
776
815
|
}
|
|
777
816
|
// Resolve a field's current raw (string) value, applying the same
|
|
@@ -779,119 +818,119 @@ let b = class extends F {
|
|
|
779
818
|
// submission agree. Checkbox is normalized to 'true'/'false' (matching the
|
|
780
819
|
// literals designers use in a condition list); a field absent from the DOM
|
|
781
820
|
// (hidden by its own condition) yields its effective default value.
|
|
782
|
-
currentRawValue(
|
|
783
|
-
const
|
|
784
|
-
if (
|
|
785
|
-
return this.effectivePreFilledValue(
|
|
786
|
-
if (
|
|
787
|
-
const
|
|
788
|
-
return
|
|
821
|
+
currentRawValue(t, e, s) {
|
|
822
|
+
const i = `column-${e}`;
|
|
823
|
+
if (t.hiddenField)
|
|
824
|
+
return this.effectivePreFilledValue(t) ?? this.effectiveDefaultValue(t) ?? "";
|
|
825
|
+
if (t.type === "checkbox") return s.has(i) ? "true" : "false";
|
|
826
|
+
const r = s.get(i);
|
|
827
|
+
return r === null || r === "" ? this.effectiveDefaultValue(t) ?? "" : String(r);
|
|
789
828
|
}
|
|
790
829
|
// Rebuild the label→value map on every input/change so conditional-display
|
|
791
830
|
// rules re-evaluate live. A single delegated listener on the <form> catches
|
|
792
831
|
// all field types (Material components bubble input/change within this root).
|
|
793
|
-
handleFieldChange(
|
|
794
|
-
const
|
|
795
|
-
if (!
|
|
796
|
-
const
|
|
797
|
-
this.inputData?.formFields?.forEach((
|
|
798
|
-
|
|
799
|
-
}), this.fieldValues =
|
|
832
|
+
handleFieldChange(t) {
|
|
833
|
+
const e = t.currentTarget;
|
|
834
|
+
if (!e) return;
|
|
835
|
+
const s = new FormData(e), i = {};
|
|
836
|
+
this.inputData?.formFields?.forEach((r, o) => {
|
|
837
|
+
r.label && (i[r.label] = this.currentRawValue(r, o, s));
|
|
838
|
+
}), this.fieldValues = i;
|
|
800
839
|
}
|
|
801
840
|
// A field is visible unless it declares a conditional-display rule whose
|
|
802
841
|
// controlling field (referenced by label) does not currently hold one of the
|
|
803
842
|
// listed values. Fail-open on misconfiguration (unknown field / empty list)
|
|
804
843
|
// so a half-configured rule never silently hides a field and its data.
|
|
805
|
-
isFieldVisible(
|
|
806
|
-
const
|
|
807
|
-
if (!
|
|
808
|
-
const
|
|
809
|
-
if (
|
|
810
|
-
const
|
|
811
|
-
if (!
|
|
812
|
-
const
|
|
813
|
-
return
|
|
814
|
-
}
|
|
815
|
-
renderTextField(
|
|
844
|
+
isFieldVisible(t) {
|
|
845
|
+
const e = t.conditionalDisplay?.conditionField?.trim();
|
|
846
|
+
if (!e) return !0;
|
|
847
|
+
const s = (t.conditionalDisplay?.conditionValues ?? "").split(",").map((o) => o.trim()).filter((o) => o !== "");
|
|
848
|
+
if (s.length === 0) return !0;
|
|
849
|
+
const i = this.inputData?.formFields?.find((o) => o.label === e);
|
|
850
|
+
if (!i) return !0;
|
|
851
|
+
const r = this.fieldValues[e] ?? this.effectivePreFilledValue(i) ?? this.effectiveDefaultValue(i) ?? "";
|
|
852
|
+
return s.includes(String(r));
|
|
853
|
+
}
|
|
854
|
+
renderTextField(t, e) {
|
|
816
855
|
return $`
|
|
817
856
|
<md-outlined-text-field
|
|
818
|
-
.name="column-${
|
|
819
|
-
.label="${
|
|
820
|
-
.type="${
|
|
821
|
-
.value="${
|
|
822
|
-
.placeholder="${
|
|
823
|
-
.pattern="${
|
|
824
|
-
supporting-text=${
|
|
825
|
-
validation-message="${
|
|
826
|
-
?required=${
|
|
857
|
+
.name="column-${e}"
|
|
858
|
+
.label="${t.label ?? ""}"
|
|
859
|
+
.type="${t.type === "numberfield" ? "number" : "text"}"
|
|
860
|
+
.value="${t.preFilledValue ?? ""}"
|
|
861
|
+
.placeholder="${t.defaultValue ?? ""}"
|
|
862
|
+
.pattern="${nt(t.validation)}"
|
|
863
|
+
supporting-text=${t.description ?? ""}
|
|
864
|
+
validation-message="${t.validationMessage ?? "Invalid input"}"
|
|
865
|
+
?required=${t.required && !t.defaultValue && !t.preFilledValue}
|
|
827
866
|
></md-outlined-text-field>
|
|
828
867
|
`;
|
|
829
868
|
}
|
|
830
|
-
renderNumberField(
|
|
869
|
+
renderNumberField(t, e) {
|
|
831
870
|
return $`
|
|
832
871
|
<md-outlined-text-field
|
|
833
|
-
.name="column-${
|
|
834
|
-
.label="${
|
|
872
|
+
.name="column-${e}"
|
|
873
|
+
.label="${t.label ?? ""}"
|
|
835
874
|
style="width: 200px;"
|
|
836
875
|
type="number"
|
|
837
|
-
.value="${
|
|
838
|
-
.placeholder="${
|
|
876
|
+
.value="${t.preFilledValue ?? ""}"
|
|
877
|
+
.placeholder="${t.defaultValue ?? ""}"
|
|
839
878
|
step="any"
|
|
840
|
-
min=${
|
|
841
|
-
max=${
|
|
842
|
-
supporting-text=${
|
|
843
|
-
?required=${
|
|
879
|
+
min=${t.min ?? ""}
|
|
880
|
+
max=${t.max ?? ""}
|
|
881
|
+
supporting-text=${t.description ?? ""}
|
|
882
|
+
?required=${t.required && !t.defaultValue && !t.preFilledValue}
|
|
844
883
|
></md-outlined-text-field>
|
|
845
884
|
`;
|
|
846
885
|
}
|
|
847
|
-
renderCheckbox(
|
|
848
|
-
const
|
|
886
|
+
renderCheckbox(t, e) {
|
|
887
|
+
const s = this.effectivePreFilledValue(t), i = this.effectiveDefaultValue(t);
|
|
849
888
|
return $`
|
|
850
889
|
<div class="checkbox-container">
|
|
851
890
|
<md-checkbox
|
|
852
|
-
name="column-${
|
|
853
|
-
aria-label=${
|
|
854
|
-
?checked=${String(
|
|
855
|
-
?required=${
|
|
891
|
+
name="column-${e}"
|
|
892
|
+
aria-label=${t.label ?? ""}
|
|
893
|
+
?checked=${String(s ?? i) === "true"}
|
|
894
|
+
?required=${t.required && !i && !s}
|
|
856
895
|
></md-checkbox>
|
|
857
896
|
<label class="label">
|
|
858
|
-
${
|
|
859
|
-
${
|
|
897
|
+
${t.label}
|
|
898
|
+
${t.description ? $`<span class="supporting-text">${t.description}</span>` : d}
|
|
860
899
|
</label>
|
|
861
900
|
</div>
|
|
862
901
|
`;
|
|
863
902
|
}
|
|
864
|
-
renderTextArea(
|
|
865
|
-
const
|
|
903
|
+
renderTextArea(t, e) {
|
|
904
|
+
const s = this.effectivePreFilledValue(t), i = this.effectiveDefaultValue(t);
|
|
866
905
|
return $`
|
|
867
906
|
<md-outlined-text-field
|
|
868
|
-
.name="column-${
|
|
869
|
-
.label="${
|
|
907
|
+
.name="column-${e}"
|
|
908
|
+
.label="${t.label ?? ""}"
|
|
870
909
|
type="textarea"
|
|
871
|
-
.value="${
|
|
872
|
-
.placeholder="${
|
|
910
|
+
.value="${s ?? ""}"
|
|
911
|
+
.placeholder="${i ?? ""}"
|
|
873
912
|
rows="3"
|
|
874
|
-
?required=${
|
|
875
|
-
supporting-text=${
|
|
913
|
+
?required=${t.required && !i && !s}
|
|
914
|
+
supporting-text=${t.description ?? ""}
|
|
876
915
|
></md-outlined-text-field>
|
|
877
916
|
`;
|
|
878
917
|
}
|
|
879
|
-
renderDropdown(
|
|
918
|
+
renderDropdown(t, e) {
|
|
880
919
|
return $`
|
|
881
920
|
<label class="label">
|
|
882
|
-
${
|
|
921
|
+
${t.label}
|
|
883
922
|
<md-outlined-select
|
|
884
|
-
name="column-${
|
|
885
|
-
.value=${
|
|
886
|
-
supporting-text=${
|
|
887
|
-
?required=${
|
|
923
|
+
name="column-${e}"
|
|
924
|
+
.value=${t.preFilledValue ?? t.defaultValue ?? ""}
|
|
925
|
+
supporting-text=${t.description ?? ""}
|
|
926
|
+
?required=${t.required && !t.defaultValue && !t.preFilledValue}
|
|
888
927
|
>
|
|
889
|
-
${
|
|
890
|
-
|
|
891
|
-
(
|
|
892
|
-
(
|
|
893
|
-
<md-select-option .value="${
|
|
894
|
-
${
|
|
928
|
+
${ue(
|
|
929
|
+
t.values ?? [],
|
|
930
|
+
(s) => s.value,
|
|
931
|
+
(s) => $`
|
|
932
|
+
<md-select-option .value="${s.value ?? ""}">
|
|
933
|
+
${s.displayLabel}
|
|
895
934
|
</md-select-option>
|
|
896
935
|
`
|
|
897
936
|
)}
|
|
@@ -899,57 +938,57 @@ let b = class extends F {
|
|
|
899
938
|
</label>
|
|
900
939
|
`;
|
|
901
940
|
}
|
|
902
|
-
renderDateTimeField(
|
|
941
|
+
renderDateTimeField(t, e) {
|
|
903
942
|
return $`
|
|
904
943
|
<md-outlined-text-field
|
|
905
|
-
.name="column-${
|
|
944
|
+
.name="column-${e}"
|
|
906
945
|
style="width: 200px;"
|
|
907
|
-
.label="${
|
|
946
|
+
.label="${t.label ?? ""}"
|
|
908
947
|
type="datetime-local"
|
|
909
|
-
.value="${
|
|
910
|
-
supporting-text=${
|
|
911
|
-
?required=${
|
|
948
|
+
.value="${t.preFilledValue ?? t.defaultValue ?? ""}"
|
|
949
|
+
supporting-text=${t.description ?? ""}
|
|
950
|
+
?required=${t.required && !t.defaultValue && !t.preFilledValue}
|
|
912
951
|
></md-outlined-text-field>
|
|
913
952
|
`;
|
|
914
953
|
}
|
|
915
954
|
resetForm() {
|
|
916
955
|
this.formKey++, this.fieldValues = {};
|
|
917
956
|
}
|
|
918
|
-
resolveRoute(
|
|
919
|
-
let
|
|
920
|
-
if (
|
|
921
|
-
if (
|
|
922
|
-
for (const
|
|
923
|
-
|
|
924
|
-
if (
|
|
925
|
-
const
|
|
926
|
-
for (let
|
|
927
|
-
r
|
|
928
|
-
|
|
957
|
+
resolveRoute(t) {
|
|
958
|
+
let e = t?.route ?? "";
|
|
959
|
+
if (e) {
|
|
960
|
+
if (t?.variables)
|
|
961
|
+
for (const s of t.variables)
|
|
962
|
+
s.label && (e = e.split(`{{${s.label}}}`).join(encodeURIComponent(String(s.value ?? ""))));
|
|
963
|
+
if (e.includes("*")) {
|
|
964
|
+
const s = (this.route || "").split("/").filter(Boolean), i = e.split("/").filter(Boolean);
|
|
965
|
+
for (let r = 0; r < i.length; r++)
|
|
966
|
+
i[r] === "*" && (i[r] = s[r] ?? "");
|
|
967
|
+
e = (e.startsWith("/") ? "/" : "") + i.filter(Boolean).join("/");
|
|
929
968
|
}
|
|
930
|
-
return
|
|
969
|
+
return e;
|
|
931
970
|
}
|
|
932
971
|
}
|
|
933
|
-
cancelEdit(
|
|
972
|
+
cancelEdit(t) {
|
|
934
973
|
this.resetForm(), this.dialogOpen = !1;
|
|
935
974
|
}
|
|
936
975
|
render() {
|
|
937
|
-
const
|
|
976
|
+
const t = this.themeTitleColor, e = this.themeBgColor, s = e?.startsWith("rgba") ? e.replace(/rgba\(([^)]+),\s*[\d.]+\)/, "rgb($1)") : e?.startsWith("#") && e.length === 9 ? e.substring(0, 7) : e?.startsWith("#") && e.length === 5 ? e.substring(0, 4) : e;
|
|
938
977
|
return $`
|
|
939
978
|
<style>
|
|
940
979
|
:host {
|
|
941
|
-
--md-sys-color-on-surface: ${
|
|
942
|
-
--md-sys-color-on-surface-variant: ${
|
|
943
|
-
--md-sys-color-outline: ${
|
|
944
|
-
--md-sys-color-surface-container: ${
|
|
980
|
+
--md-sys-color-on-surface: ${t};
|
|
981
|
+
--md-sys-color-on-surface-variant: ${t};
|
|
982
|
+
--md-sys-color-outline: ${t};
|
|
983
|
+
--md-sys-color-surface-container: ${s};
|
|
945
984
|
/* Dialog container and select dropdown panel always use the
|
|
946
985
|
alpha-stripped color so they stay fully opaque regardless of
|
|
947
986
|
the theme's (possibly translucent) background. */
|
|
948
|
-
--md-dialog-container-color: ${
|
|
949
|
-
--md-menu-container-color: ${
|
|
950
|
-
--md-menu-item-selected-container-color: ${
|
|
951
|
-
--md-menu-item-selected-label-text-color: ${
|
|
952
|
-
color: ${
|
|
987
|
+
--md-dialog-container-color: ${s};
|
|
988
|
+
--md-menu-container-color: ${s};
|
|
989
|
+
--md-menu-item-selected-container-color: ${s};
|
|
990
|
+
--md-menu-item-selected-label-text-color: ${t};
|
|
991
|
+
color: ${t};
|
|
953
992
|
}
|
|
954
993
|
</style>
|
|
955
994
|
<div class="header">
|
|
@@ -980,11 +1019,11 @@ let b = class extends F {
|
|
|
980
1019
|
class="form"
|
|
981
1020
|
quick
|
|
982
1021
|
?open=${this.dialogOpen}
|
|
983
|
-
@cancel=${(
|
|
984
|
-
|
|
1022
|
+
@cancel=${(i) => {
|
|
1023
|
+
i.preventDefault();
|
|
985
1024
|
}}
|
|
986
|
-
@keydown=${(
|
|
987
|
-
|
|
1025
|
+
@keydown=${(i) => {
|
|
1026
|
+
i.key === "Escape" && i.preventDefault();
|
|
988
1027
|
}}
|
|
989
1028
|
@closed=${() => this.dialogOpen = !1}
|
|
990
1029
|
>
|
|
@@ -1026,7 +1065,7 @@ let b = class extends F {
|
|
|
1026
1065
|
`;
|
|
1027
1066
|
}
|
|
1028
1067
|
renderForm() {
|
|
1029
|
-
return
|
|
1068
|
+
return Qe(
|
|
1030
1069
|
this.formKey,
|
|
1031
1070
|
$`
|
|
1032
1071
|
<form
|
|
@@ -1038,24 +1077,24 @@ let b = class extends F {
|
|
|
1038
1077
|
@input=${this.handleFieldChange}
|
|
1039
1078
|
@change=${this.handleFieldChange}
|
|
1040
1079
|
>
|
|
1041
|
-
${
|
|
1080
|
+
${ue(
|
|
1042
1081
|
this.inputData?.formFields ?? [],
|
|
1043
|
-
(
|
|
1044
|
-
(
|
|
1045
|
-
if (
|
|
1046
|
-
switch (
|
|
1082
|
+
(t, e) => e,
|
|
1083
|
+
(t, e) => {
|
|
1084
|
+
if (t.hiddenField || !this.isFieldVisible(t)) return d;
|
|
1085
|
+
switch (t.type) {
|
|
1047
1086
|
case "textfield":
|
|
1048
|
-
return this.renderTextField(
|
|
1087
|
+
return this.renderTextField(t, e);
|
|
1049
1088
|
case "numberfield":
|
|
1050
|
-
return this.renderNumberField(
|
|
1089
|
+
return this.renderNumberField(t, e);
|
|
1051
1090
|
case "datetime":
|
|
1052
|
-
return this.renderDateTimeField(
|
|
1091
|
+
return this.renderDateTimeField(t, e);
|
|
1053
1092
|
case "textarea":
|
|
1054
|
-
return this.renderTextArea(
|
|
1093
|
+
return this.renderTextArea(t, e);
|
|
1055
1094
|
case "dropdown":
|
|
1056
|
-
return this.renderDropdown(
|
|
1095
|
+
return this.renderDropdown(t, e);
|
|
1057
1096
|
case "checkbox":
|
|
1058
|
-
return this.renderCheckbox(
|
|
1097
|
+
return this.renderCheckbox(t, e);
|
|
1059
1098
|
}
|
|
1060
1099
|
}
|
|
1061
1100
|
)}
|
|
@@ -1064,7 +1103,7 @@ let b = class extends F {
|
|
|
1064
1103
|
);
|
|
1065
1104
|
}
|
|
1066
1105
|
};
|
|
1067
|
-
b.styles =
|
|
1106
|
+
b.styles = xe`
|
|
1068
1107
|
:host {
|
|
1069
1108
|
display: flex;
|
|
1070
1109
|
flex-direction: column;
|
|
@@ -1249,7 +1288,7 @@ g([
|
|
|
1249
1288
|
M()
|
|
1250
1289
|
], b.prototype, "dialogOpen", 2);
|
|
1251
1290
|
g([
|
|
1252
|
-
|
|
1291
|
+
tt("md-dialog")
|
|
1253
1292
|
], b.prototype, "dialog", 2);
|
|
1254
1293
|
g([
|
|
1255
1294
|
M()
|
|
@@ -1258,7 +1297,7 @@ g([
|
|
|
1258
1297
|
M()
|
|
1259
1298
|
], b.prototype, "fieldValues", 2);
|
|
1260
1299
|
b = g([
|
|
1261
|
-
|
|
1300
|
+
Ge("widget-form-1.0.33")
|
|
1262
1301
|
], b);
|
|
1263
1302
|
export {
|
|
1264
1303
|
b as WidgetForm
|