@record-evolution/widget-form 1.0.25 → 1.0.27
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.d.ts +6 -0
- package/dist/widget-form.js +456 -405
- package/dist/widget-form.js.map +1 -1
- package/package.json +1 -1
- package/src/default-data.json +5 -1
- package/src/definition-schema.d.ts +41 -0
- package/src/definition-schema.json +76 -5
- package/src/widget-form.ts +105 -20
package/dist/widget-form.js
CHANGED
|
@@ -8,18 +8,18 @@ import "@material/web/textfield/outlined-text-field.js";
|
|
|
8
8
|
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
|
-
const
|
|
12
|
-
let
|
|
13
|
-
constructor(t,
|
|
14
|
-
if (this._$cssResult$ = !0,
|
|
15
|
-
this.cssText = t, this.t =
|
|
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 dt = class {
|
|
13
|
+
constructor(t, r, i) {
|
|
14
|
+
if (this._$cssResult$ = !0, i !== K) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
15
|
+
this.cssText = t, this.t = r;
|
|
16
16
|
}
|
|
17
17
|
get styleSheet() {
|
|
18
18
|
let t = this.o;
|
|
19
|
-
const
|
|
19
|
+
const r = this.t;
|
|
20
20
|
if (W && t === void 0) {
|
|
21
|
-
const
|
|
22
|
-
|
|
21
|
+
const i = r !== void 0 && r.length === 1;
|
|
22
|
+
i && (t = Y.get(r)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && Y.set(r, t));
|
|
23
23
|
}
|
|
24
24
|
return t;
|
|
25
25
|
}
|
|
@@ -27,25 +27,25 @@ let ut = class {
|
|
|
27
27
|
return this.cssText;
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
const yt = (e) => new
|
|
31
|
-
const
|
|
32
|
-
if (
|
|
33
|
-
if (typeof
|
|
34
|
-
throw Error("Value passed to 'css' function must be a 'css' function result: " +
|
|
35
|
-
})(
|
|
36
|
-
return new
|
|
30
|
+
const yt = (e) => new dt(typeof e == "string" ? e : e + "", void 0, K), vt = (e, ...t) => {
|
|
31
|
+
const r = e.length === 1 ? e[0] : t.reduce(((i, s, o) => i + ((n) => {
|
|
32
|
+
if (n._$cssResult$ === !0) return n.cssText;
|
|
33
|
+
if (typeof n == "number") return n;
|
|
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
|
+
})(s) + e[o + 1]), e[0]);
|
|
36
|
+
return new dt(r, e, K);
|
|
37
37
|
}, At = (e, t) => {
|
|
38
|
-
if (W) e.adoptedStyleSheets = t.map(((
|
|
39
|
-
else for (const
|
|
40
|
-
const
|
|
41
|
-
|
|
38
|
+
if (W) e.adoptedStyleSheets = t.map(((r) => r instanceof CSSStyleSheet ? r : r.styleSheet));
|
|
39
|
+
else for (const r of t) {
|
|
40
|
+
const i = document.createElement("style"), s = R.litNonce;
|
|
41
|
+
s !== void 0 && i.setAttribute("nonce", s), i.textContent = r.cssText, e.appendChild(i);
|
|
42
42
|
}
|
|
43
43
|
}, tt = W ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
|
|
44
|
-
let
|
|
45
|
-
for (const
|
|
46
|
-
return yt(
|
|
44
|
+
let r = "";
|
|
45
|
+
for (const i of t.cssRules) r += i.cssText;
|
|
46
|
+
return yt(r);
|
|
47
47
|
})(e) : e;
|
|
48
|
-
const { is: xt, defineProperty: wt, getOwnPropertyDescriptor: St, getOwnPropertyNames: Et, getOwnPropertySymbols: Ct, getPrototypeOf:
|
|
48
|
+
const { is: xt, defineProperty: wt, getOwnPropertyDescriptor: St, getOwnPropertyNames: Et, getOwnPropertySymbols: Ct, getPrototypeOf: Dt } = Object, N = globalThis, et = N.trustedTypes, Pt = et ? et.emptyScript : "", kt = N.reactiveElementPolyfillSupport, V = (e, t) => e, H = { toAttribute(e, t) {
|
|
49
49
|
switch (t) {
|
|
50
50
|
case Boolean:
|
|
51
51
|
e = e ? Pt : null;
|
|
@@ -56,24 +56,24 @@ const { is: xt, defineProperty: wt, getOwnPropertyDescriptor: St, getOwnProperty
|
|
|
56
56
|
}
|
|
57
57
|
return e;
|
|
58
58
|
}, fromAttribute(e, t) {
|
|
59
|
-
let
|
|
59
|
+
let r = e;
|
|
60
60
|
switch (t) {
|
|
61
61
|
case Boolean:
|
|
62
|
-
|
|
62
|
+
r = e !== null;
|
|
63
63
|
break;
|
|
64
64
|
case Number:
|
|
65
|
-
|
|
65
|
+
r = e === null ? null : Number(e);
|
|
66
66
|
break;
|
|
67
67
|
case Object:
|
|
68
68
|
case Array:
|
|
69
69
|
try {
|
|
70
|
-
|
|
70
|
+
r = JSON.parse(e);
|
|
71
71
|
} catch {
|
|
72
|
-
|
|
72
|
+
r = null;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
return
|
|
76
|
-
} }, Z = (e, t) => !xt(e, t),
|
|
75
|
+
return r;
|
|
76
|
+
} }, Z = (e, t) => !xt(e, t), rt = { 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
79
|
static addInitializer(t) {
|
|
@@ -82,60 +82,60 @@ let E = class extends HTMLElement {
|
|
|
82
82
|
static get observedAttributes() {
|
|
83
83
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
84
84
|
}
|
|
85
|
-
static createProperty(t,
|
|
86
|
-
if (
|
|
87
|
-
const
|
|
88
|
-
|
|
85
|
+
static createProperty(t, r = rt) {
|
|
86
|
+
if (r.state && (r.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((r = Object.create(r)).wrapped = !0), this.elementProperties.set(t, r), !r.noAccessor) {
|
|
87
|
+
const i = /* @__PURE__ */ Symbol(), s = this.getPropertyDescriptor(t, i, r);
|
|
88
|
+
s !== void 0 && wt(this.prototype, t, s);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
static getPropertyDescriptor(t,
|
|
92
|
-
const { get:
|
|
93
|
-
return this[
|
|
94
|
-
}, set(
|
|
95
|
-
this[
|
|
91
|
+
static getPropertyDescriptor(t, r, i) {
|
|
92
|
+
const { get: s, set: o } = St(this.prototype, t) ?? { get() {
|
|
93
|
+
return this[r];
|
|
94
|
+
}, set(n) {
|
|
95
|
+
this[r] = n;
|
|
96
96
|
} };
|
|
97
|
-
return { get:
|
|
98
|
-
const h =
|
|
99
|
-
|
|
97
|
+
return { get: s, set(n) {
|
|
98
|
+
const h = s?.call(this);
|
|
99
|
+
o?.call(this, n), this.requestUpdate(t, h, i);
|
|
100
100
|
}, configurable: !0, enumerable: !0 };
|
|
101
101
|
}
|
|
102
102
|
static getPropertyOptions(t) {
|
|
103
|
-
return this.elementProperties.get(t) ??
|
|
103
|
+
return this.elementProperties.get(t) ?? rt;
|
|
104
104
|
}
|
|
105
105
|
static _$Ei() {
|
|
106
|
-
if (this.hasOwnProperty(
|
|
107
|
-
const t =
|
|
106
|
+
if (this.hasOwnProperty(V("elementProperties"))) return;
|
|
107
|
+
const t = Dt(this);
|
|
108
108
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
109
109
|
}
|
|
110
110
|
static finalize() {
|
|
111
|
-
if (this.hasOwnProperty(
|
|
112
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
113
|
-
const
|
|
114
|
-
for (const
|
|
111
|
+
if (this.hasOwnProperty(V("finalized"))) return;
|
|
112
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(V("properties"))) {
|
|
113
|
+
const r = this.properties, i = [...Et(r), ...Ct(r)];
|
|
114
|
+
for (const s of i) this.createProperty(s, r[s]);
|
|
115
115
|
}
|
|
116
116
|
const t = this[Symbol.metadata];
|
|
117
117
|
if (t !== null) {
|
|
118
|
-
const
|
|
119
|
-
if (
|
|
118
|
+
const r = litPropertyMetadata.get(t);
|
|
119
|
+
if (r !== void 0) for (const [i, s] of r) this.elementProperties.set(i, s);
|
|
120
120
|
}
|
|
121
121
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
122
|
-
for (const [
|
|
123
|
-
const
|
|
124
|
-
|
|
122
|
+
for (const [r, i] of this.elementProperties) {
|
|
123
|
+
const s = this._$Eu(r, i);
|
|
124
|
+
s !== void 0 && this._$Eh.set(s, r);
|
|
125
125
|
}
|
|
126
126
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
127
127
|
}
|
|
128
128
|
static finalizeStyles(t) {
|
|
129
|
-
const
|
|
129
|
+
const r = [];
|
|
130
130
|
if (Array.isArray(t)) {
|
|
131
|
-
const
|
|
132
|
-
for (const
|
|
133
|
-
} else t !== void 0 &&
|
|
134
|
-
return
|
|
131
|
+
const i = new Set(t.flat(1 / 0).reverse());
|
|
132
|
+
for (const s of i) r.unshift(tt(s));
|
|
133
|
+
} else t !== void 0 && r.push(tt(t));
|
|
134
|
+
return r;
|
|
135
135
|
}
|
|
136
|
-
static _$Eu(t,
|
|
137
|
-
const
|
|
138
|
-
return
|
|
136
|
+
static _$Eu(t, r) {
|
|
137
|
+
const i = r.attribute;
|
|
138
|
+
return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.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();
|
|
@@ -150,8 +150,8 @@ let E = class extends HTMLElement {
|
|
|
150
150
|
this._$EO?.delete(t);
|
|
151
151
|
}
|
|
152
152
|
_$E_() {
|
|
153
|
-
const t = /* @__PURE__ */ new Map(),
|
|
154
|
-
for (const
|
|
153
|
+
const t = /* @__PURE__ */ new Map(), r = this.constructor.elementProperties;
|
|
154
|
+
for (const i of r.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
|
|
155
155
|
t.size > 0 && (this._$Ep = t);
|
|
156
156
|
}
|
|
157
157
|
createRenderRoot() {
|
|
@@ -166,40 +166,40 @@ let E = class extends HTMLElement {
|
|
|
166
166
|
disconnectedCallback() {
|
|
167
167
|
this._$EO?.forEach(((t) => t.hostDisconnected?.()));
|
|
168
168
|
}
|
|
169
|
-
attributeChangedCallback(t,
|
|
170
|
-
this._$AK(t,
|
|
169
|
+
attributeChangedCallback(t, r, i) {
|
|
170
|
+
this._$AK(t, i);
|
|
171
171
|
}
|
|
172
|
-
_$ET(t,
|
|
173
|
-
const
|
|
174
|
-
if (
|
|
175
|
-
const
|
|
176
|
-
this._$Em = t,
|
|
172
|
+
_$ET(t, r) {
|
|
173
|
+
const i = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, i);
|
|
174
|
+
if (s !== void 0 && i.reflect === !0) {
|
|
175
|
+
const o = (i.converter?.toAttribute !== void 0 ? i.converter : H).toAttribute(r, i.type);
|
|
176
|
+
this._$Em = t, o == null ? this.removeAttribute(s) : this.setAttribute(s, o), this._$Em = null;
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
_$AK(t,
|
|
180
|
-
const
|
|
181
|
-
if (
|
|
182
|
-
const
|
|
183
|
-
this._$Em =
|
|
179
|
+
_$AK(t, r) {
|
|
180
|
+
const i = this.constructor, s = i._$Eh.get(t);
|
|
181
|
+
if (s !== void 0 && this._$Em !== s) {
|
|
182
|
+
const o = i.getPropertyOptions(s), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : H;
|
|
183
|
+
this._$Em = s, this[s] = n.fromAttribute(r, o.type) ?? this._$Ej?.get(s) ?? null, this._$Em = null;
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
-
requestUpdate(t,
|
|
186
|
+
requestUpdate(t, r, i) {
|
|
187
187
|
if (t !== void 0) {
|
|
188
|
-
const
|
|
189
|
-
if (
|
|
190
|
-
this.C(t,
|
|
188
|
+
const s = this.constructor, o = this[t];
|
|
189
|
+
if (i ??= s.getPropertyOptions(t), !((i.hasChanged ?? Z)(o, r) || i.useDefault && i.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(s._$Eu(t, i)))) return;
|
|
190
|
+
this.C(t, r, i);
|
|
191
191
|
}
|
|
192
192
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
193
193
|
}
|
|
194
|
-
C(t,
|
|
195
|
-
|
|
194
|
+
C(t, r, { useDefault: i, reflect: s, wrapped: o }, n) {
|
|
195
|
+
i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, n ?? r ?? this[t]), o !== !0 || n !== void 0) || (this._$AL.has(t) || (this.hasUpdated || i || (r = void 0), this._$AL.set(t, r)), s === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
|
|
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 (r) {
|
|
202
|
+
Promise.reject(r);
|
|
203
203
|
}
|
|
204
204
|
const t = this.scheduleUpdate();
|
|
205
205
|
return t != null && await t, !this.isUpdatePending;
|
|
@@ -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 [s, o] of this._$Ep) this[s] = o;
|
|
215
215
|
this._$Ep = void 0;
|
|
216
216
|
}
|
|
217
|
-
const
|
|
218
|
-
if (
|
|
219
|
-
const { wrapped:
|
|
220
|
-
|
|
217
|
+
const i = this.constructor.elementProperties;
|
|
218
|
+
if (i.size > 0) for (const [s, o] of i) {
|
|
219
|
+
const { wrapped: n } = o, h = this[s];
|
|
220
|
+
n !== !0 || this._$AL.has(s) || h === void 0 || this.C(s, void 0, o, h);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
let t = !1;
|
|
224
|
-
const
|
|
224
|
+
const r = this._$AL;
|
|
225
225
|
try {
|
|
226
|
-
t = this.shouldUpdate(
|
|
227
|
-
} catch (
|
|
228
|
-
throw t = !1, this._$EM(),
|
|
226
|
+
t = this.shouldUpdate(r), t ? (this.willUpdate(r), this._$EO?.forEach(((i) => i.hostUpdate?.())), this.update(r)) : this._$EM();
|
|
227
|
+
} catch (i) {
|
|
228
|
+
throw t = !1, this._$EM(), i;
|
|
229
229
|
}
|
|
230
|
-
t && this._$AE(
|
|
230
|
+
t && this._$AE(r);
|
|
231
231
|
}
|
|
232
232
|
willUpdate(t) {
|
|
233
233
|
}
|
|
234
234
|
_$AE(t) {
|
|
235
|
-
this._$EO?.forEach(((
|
|
235
|
+
this._$EO?.forEach(((r) => r.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
236
236
|
}
|
|
237
237
|
_$EM() {
|
|
238
238
|
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
@@ -247,79 +247,79 @@ let E = class extends HTMLElement {
|
|
|
247
247
|
return !0;
|
|
248
248
|
}
|
|
249
249
|
update(t) {
|
|
250
|
-
this._$Eq &&= this._$Eq.forEach(((
|
|
250
|
+
this._$Eq &&= this._$Eq.forEach(((r) => this._$ET(r, this[r]))), this._$EM();
|
|
251
251
|
}
|
|
252
252
|
updated(t) {
|
|
253
253
|
}
|
|
254
254
|
firstUpdated(t) {
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
|
-
E.elementStyles = [], E.shadowRootOptions = { mode: "open" }, E[
|
|
258
|
-
const J = globalThis,
|
|
259
|
-
\f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
260
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), nt = /'/g,
|
|
261
|
-
function
|
|
257
|
+
E.elementStyles = [], E.shadowRootOptions = { mode: "open" }, E[V("elementProperties")] = /* @__PURE__ */ new Map(), E[V("finalized")] = /* @__PURE__ */ new Map(), kt?.({ ReactiveElement: E }), (N.reactiveElementVersions ??= []).push("2.1.0");
|
|
258
|
+
const J = globalThis, B = J.trustedTypes, it = B ? B.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, pt = "$lit$", y = `lit$${Math.random().toFixed(9).slice(2)}$`, mt = "?" + y, Vt = `<${mt}>`, w = document, O = () => w.createComment(""), T = (e) => e === null || typeof e != "object" && typeof e != "function", Q = Array.isArray, Ft = (e) => Q(e) || typeof e?.[Symbol.iterator] == "function", I = `[
|
|
259
|
+
\f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, st = /-->/g, ot = />/g, v = RegExp(`>|${I}(?:([^\\s"'>=/]+)(${I}*=${I}*(?:[^
|
|
260
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), nt = /'/g, lt = /"/g, ft = /^(?:script|style|textarea|title)$/i, Ot = (e) => (t, ...r) => ({ _$litType$: e, strings: t, values: r }), $ = Ot(1), S = /* @__PURE__ */ Symbol.for("lit-noChange"), p = /* @__PURE__ */ Symbol.for("lit-nothing"), at = /* @__PURE__ */ new WeakMap(), x = w.createTreeWalker(w, 129);
|
|
261
|
+
function $t(e, t) {
|
|
262
262
|
if (!Q(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
263
|
-
return
|
|
263
|
+
return it !== void 0 ? it.createHTML(t) : t;
|
|
264
264
|
}
|
|
265
|
-
const
|
|
266
|
-
const
|
|
267
|
-
let
|
|
268
|
-
for (let h = 0; h <
|
|
269
|
-
const
|
|
270
|
-
let c, m,
|
|
271
|
-
for (;
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
return [
|
|
265
|
+
const Tt = (e, t) => {
|
|
266
|
+
const r = e.length - 1, i = [];
|
|
267
|
+
let s, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = P;
|
|
268
|
+
for (let h = 0; h < r; h++) {
|
|
269
|
+
const l = e[h];
|
|
270
|
+
let c, m, a = -1, d = 0;
|
|
271
|
+
for (; d < l.length && (n.lastIndex = d, m = n.exec(l), m !== null); ) d = n.lastIndex, n === P ? m[1] === "!--" ? n = st : m[1] !== void 0 ? n = ot : m[2] !== void 0 ? (ft.test(m[2]) && (s = RegExp("</" + m[2], "g")), n = v) : m[3] !== void 0 && (n = v) : n === v ? m[0] === ">" ? (n = s ?? P, a = -1) : m[1] === void 0 ? a = -2 : (a = n.lastIndex - m[2].length, c = m[1], n = m[3] === void 0 ? v : m[3] === '"' ? lt : nt) : n === lt || n === nt ? n = v : n === st || n === ot ? n = P : (n = v, s = void 0);
|
|
272
|
+
const u = n === v && e[h + 1].startsWith("/>") ? " " : "";
|
|
273
|
+
o += n === P ? l + Vt : a >= 0 ? (i.push(c), l.slice(0, a) + pt + l.slice(a) + y + u) : l + y + (a === -2 ? h : u);
|
|
274
|
+
}
|
|
275
|
+
return [$t(e, o + (e[r] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
|
|
276
276
|
};
|
|
277
|
-
class
|
|
278
|
-
constructor({ strings: t, _$litType$:
|
|
279
|
-
let
|
|
277
|
+
class U {
|
|
278
|
+
constructor({ strings: t, _$litType$: r }, i) {
|
|
279
|
+
let s;
|
|
280
280
|
this.parts = [];
|
|
281
|
-
let
|
|
282
|
-
const h = t.length - 1,
|
|
283
|
-
if (this.el =
|
|
284
|
-
const
|
|
285
|
-
|
|
281
|
+
let o = 0, n = 0;
|
|
282
|
+
const h = t.length - 1, l = this.parts, [c, m] = Tt(t, r);
|
|
283
|
+
if (this.el = U.createElement(c, i), x.currentNode = this.el.content, r === 2 || r === 3) {
|
|
284
|
+
const a = this.el.content.firstChild;
|
|
285
|
+
a.replaceWith(...a.childNodes);
|
|
286
286
|
}
|
|
287
|
-
for (; (
|
|
288
|
-
if (
|
|
289
|
-
if (
|
|
290
|
-
const
|
|
291
|
-
|
|
292
|
-
} else
|
|
293
|
-
if (
|
|
294
|
-
const
|
|
295
|
-
if (
|
|
296
|
-
|
|
297
|
-
for (let
|
|
298
|
-
|
|
287
|
+
for (; (s = x.nextNode()) !== null && l.length < h; ) {
|
|
288
|
+
if (s.nodeType === 1) {
|
|
289
|
+
if (s.hasAttributes()) for (const a of s.getAttributeNames()) if (a.endsWith(pt)) {
|
|
290
|
+
const d = m[n++], u = s.getAttribute(a).split(y), f = /([.?@])?(.*)/.exec(d);
|
|
291
|
+
l.push({ type: 1, index: o, name: f[2], strings: u, ctor: f[1] === "." ? Mt : f[1] === "?" ? Rt : f[1] === "@" ? Ht : j }), s.removeAttribute(a);
|
|
292
|
+
} else a.startsWith(y) && (l.push({ type: 6, index: o }), s.removeAttribute(a));
|
|
293
|
+
if (ft.test(s.tagName)) {
|
|
294
|
+
const a = s.textContent.split(y), d = a.length - 1;
|
|
295
|
+
if (d > 0) {
|
|
296
|
+
s.textContent = B ? B.emptyScript : "";
|
|
297
|
+
for (let u = 0; u < d; u++) s.append(a[u], O()), x.nextNode(), l.push({ type: 2, index: ++o });
|
|
298
|
+
s.append(a[d], O());
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
|
-
} else if (
|
|
301
|
+
} else if (s.nodeType === 8) if (s.data === mt) l.push({ type: 2, index: o });
|
|
302
302
|
else {
|
|
303
|
-
let
|
|
304
|
-
for (; (
|
|
303
|
+
let a = -1;
|
|
304
|
+
for (; (a = s.data.indexOf(y, a + 1)) !== -1; ) l.push({ type: 7, index: o }), a += y.length - 1;
|
|
305
305
|
}
|
|
306
|
-
|
|
306
|
+
o++;
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
static createElement(t,
|
|
310
|
-
const
|
|
311
|
-
return
|
|
309
|
+
static createElement(t, r) {
|
|
310
|
+
const i = w.createElement("template");
|
|
311
|
+
return i.innerHTML = t, i;
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
|
-
function C(e, t,
|
|
314
|
+
function C(e, t, r = e, i) {
|
|
315
315
|
if (t === S) return t;
|
|
316
|
-
let
|
|
317
|
-
const
|
|
318
|
-
return
|
|
316
|
+
let s = i !== void 0 ? r._$Co?.[i] : r._$Cl;
|
|
317
|
+
const o = T(t) ? void 0 : t._$litDirective$;
|
|
318
|
+
return s?.constructor !== o && (s?._$AO?.(!1), o === void 0 ? s = void 0 : (s = new o(e), s._$AT(e, r, i)), i !== void 0 ? (r._$Co ??= [])[i] = s : r._$Cl = s), s !== void 0 && (t = C(e, s._$AS(e, t.values), s, i)), t;
|
|
319
319
|
}
|
|
320
|
-
let
|
|
321
|
-
constructor(t,
|
|
322
|
-
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM =
|
|
320
|
+
let Ut = class {
|
|
321
|
+
constructor(t, r) {
|
|
322
|
+
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = r;
|
|
323
323
|
}
|
|
324
324
|
get parentNode() {
|
|
325
325
|
return this._$AM.parentNode;
|
|
@@ -328,34 +328,34 @@ let Ft = class {
|
|
|
328
328
|
return this._$AM._$AU;
|
|
329
329
|
}
|
|
330
330
|
u(t) {
|
|
331
|
-
const { el: { content:
|
|
332
|
-
x.currentNode =
|
|
333
|
-
let
|
|
334
|
-
for (;
|
|
335
|
-
if (
|
|
331
|
+
const { el: { content: r }, parts: i } = this._$AD, s = (t?.creationScope ?? w).importNode(r, !0);
|
|
332
|
+
x.currentNode = s;
|
|
333
|
+
let o = x.nextNode(), n = 0, h = 0, l = i[0];
|
|
334
|
+
for (; l !== void 0; ) {
|
|
335
|
+
if (n === l.index) {
|
|
336
336
|
let c;
|
|
337
|
-
|
|
337
|
+
l.type === 2 ? c = new D(o, o.nextSibling, this, t) : l.type === 1 ? c = new l.ctor(o, l.name, l.strings, this, t) : l.type === 6 && (c = new Bt(o, this, t)), this._$AV.push(c), l = i[++h];
|
|
338
338
|
}
|
|
339
|
-
|
|
339
|
+
n !== l?.index && (o = x.nextNode(), n++);
|
|
340
340
|
}
|
|
341
|
-
return x.currentNode = w,
|
|
341
|
+
return x.currentNode = w, s;
|
|
342
342
|
}
|
|
343
343
|
p(t) {
|
|
344
|
-
let
|
|
345
|
-
for (const
|
|
344
|
+
let r = 0;
|
|
345
|
+
for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, r), r += i.strings.length - 2) : i._$AI(t[r])), r++;
|
|
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(t,
|
|
353
|
-
this.type = 2, this._$AH = p, this._$AN = void 0, this._$AA = t, this._$AB =
|
|
352
|
+
constructor(t, r, i, s) {
|
|
353
|
+
this.type = 2, this._$AH = p, this._$AN = void 0, this._$AA = t, this._$AB = r, this._$AM = i, this.options = s, this._$Cv = s?.isConnected ?? !0;
|
|
354
354
|
}
|
|
355
355
|
get parentNode() {
|
|
356
356
|
let t = this._$AA.parentNode;
|
|
357
|
-
const
|
|
358
|
-
return
|
|
357
|
+
const r = this._$AM;
|
|
358
|
+
return r !== void 0 && t?.nodeType === 11 && (t = r.parentNode), t;
|
|
359
359
|
}
|
|
360
360
|
get startNode() {
|
|
361
361
|
return this._$AA;
|
|
@@ -363,8 +363,8 @@ class k {
|
|
|
363
363
|
get endNode() {
|
|
364
364
|
return this._$AB;
|
|
365
365
|
}
|
|
366
|
-
_$AI(t,
|
|
367
|
-
t = C(this, t,
|
|
366
|
+
_$AI(t, r = this) {
|
|
367
|
+
t = C(this, t, r), T(t) ? t === p || t == null || t === "" ? (this._$AH !== p && this._$AR(), this._$AH = p) : t !== this._$AH && t !== S && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Ft(t) ? this.k(t) : this._(t);
|
|
368
368
|
}
|
|
369
369
|
O(t) {
|
|
370
370
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -373,63 +373,63 @@ class k {
|
|
|
373
373
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
374
374
|
}
|
|
375
375
|
_(t) {
|
|
376
|
-
this._$AH !== p &&
|
|
376
|
+
this._$AH !== p && T(this._$AH) ? this._$AA.nextSibling.data = t : this.T(w.createTextNode(t)), this._$AH = t;
|
|
377
377
|
}
|
|
378
378
|
$(t) {
|
|
379
|
-
const { values:
|
|
380
|
-
if (this._$AH?._$AD ===
|
|
379
|
+
const { values: r, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = U.createElement($t(i.h, i.h[0]), this.options)), i);
|
|
380
|
+
if (this._$AH?._$AD === s) this._$AH.p(r);
|
|
381
381
|
else {
|
|
382
|
-
const
|
|
383
|
-
|
|
382
|
+
const o = new Ut(s, this), n = o.u(this.options);
|
|
383
|
+
o.p(r), this.T(n), this._$AH = o;
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
386
|
_$AC(t) {
|
|
387
|
-
let
|
|
388
|
-
return
|
|
387
|
+
let r = at.get(t.strings);
|
|
388
|
+
return r === void 0 && at.set(t.strings, r = new U(t)), r;
|
|
389
389
|
}
|
|
390
390
|
k(t) {
|
|
391
391
|
Q(this._$AH) || (this._$AH = [], this._$AR());
|
|
392
|
-
const
|
|
393
|
-
let
|
|
394
|
-
for (const
|
|
395
|
-
|
|
396
|
-
}
|
|
397
|
-
_$AR(t = this._$AA.nextSibling,
|
|
398
|
-
for (this._$AP?.(!1, !0,
|
|
399
|
-
const
|
|
400
|
-
t.remove(), t =
|
|
392
|
+
const r = this._$AH;
|
|
393
|
+
let i, s = 0;
|
|
394
|
+
for (const o of t) s === r.length ? r.push(i = new D(this.O(O()), this.O(O()), this, this.options)) : i = r[s], i._$AI(o), s++;
|
|
395
|
+
s < r.length && (this._$AR(i && i._$AB.nextSibling, s), r.length = s);
|
|
396
|
+
}
|
|
397
|
+
_$AR(t = this._$AA.nextSibling, r) {
|
|
398
|
+
for (this._$AP?.(!1, !0, r); t && t !== this._$AB; ) {
|
|
399
|
+
const i = t.nextSibling;
|
|
400
|
+
t.remove(), t = i;
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
403
|
setConnected(t) {
|
|
404
404
|
this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
|
-
class
|
|
407
|
+
class j {
|
|
408
408
|
get tagName() {
|
|
409
409
|
return this.element.tagName;
|
|
410
410
|
}
|
|
411
411
|
get _$AU() {
|
|
412
412
|
return this._$AM._$AU;
|
|
413
413
|
}
|
|
414
|
-
constructor(t,
|
|
415
|
-
this.type = 1, this._$AH = p, this._$AN = void 0, this.element = t, this.name =
|
|
414
|
+
constructor(t, r, i, s, o) {
|
|
415
|
+
this.type = 1, this._$AH = p, this._$AN = void 0, this.element = t, this.name = r, this._$AM = s, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = p;
|
|
416
416
|
}
|
|
417
|
-
_$AI(t,
|
|
418
|
-
const
|
|
419
|
-
let
|
|
420
|
-
if (
|
|
417
|
+
_$AI(t, r = this, i, s) {
|
|
418
|
+
const o = this.strings;
|
|
419
|
+
let n = !1;
|
|
420
|
+
if (o === void 0) t = C(this, t, r, 0), n = !T(t) || t !== this._$AH && t !== S, n && (this._$AH = t);
|
|
421
421
|
else {
|
|
422
422
|
const h = t;
|
|
423
|
-
let
|
|
424
|
-
for (t =
|
|
423
|
+
let l, c;
|
|
424
|
+
for (t = o[0], l = 0; l < o.length - 1; l++) c = C(this, h[i + l], r, l), c === S && (c = this._$AH[l]), n ||= !T(c) || c !== this._$AH[l], c === p ? t = p : t !== p && (t += (c ?? "") + o[l + 1]), this._$AH[l] = c;
|
|
425
425
|
}
|
|
426
|
-
|
|
426
|
+
n && !s && this.j(t);
|
|
427
427
|
}
|
|
428
428
|
j(t) {
|
|
429
429
|
t === p ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
|
-
class
|
|
432
|
+
class Mt extends j {
|
|
433
433
|
constructor() {
|
|
434
434
|
super(...arguments), this.type = 3;
|
|
435
435
|
}
|
|
@@ -437,7 +437,7 @@ class Ht extends B {
|
|
|
437
437
|
this.element[this.name] = t === p ? void 0 : t;
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
class Rt extends
|
|
440
|
+
class Rt extends j {
|
|
441
441
|
constructor() {
|
|
442
442
|
super(...arguments), this.type = 4;
|
|
443
443
|
}
|
|
@@ -445,22 +445,22 @@ class Rt extends B {
|
|
|
445
445
|
this.element.toggleAttribute(this.name, !!t && t !== p);
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
|
-
class
|
|
449
|
-
constructor(t,
|
|
450
|
-
super(t,
|
|
448
|
+
class Ht extends j {
|
|
449
|
+
constructor(t, r, i, s, o) {
|
|
450
|
+
super(t, r, i, s, o), this.type = 5;
|
|
451
451
|
}
|
|
452
|
-
_$AI(t,
|
|
453
|
-
if ((t = C(this, t,
|
|
454
|
-
const
|
|
455
|
-
|
|
452
|
+
_$AI(t, r = this) {
|
|
453
|
+
if ((t = C(this, t, r, 0) ?? p) === S) return;
|
|
454
|
+
const i = this._$AH, s = t === p && i !== p || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, o = t !== p && (i === p || s);
|
|
455
|
+
s && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
456
456
|
}
|
|
457
457
|
handleEvent(t) {
|
|
458
458
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
class
|
|
462
|
-
constructor(t,
|
|
463
|
-
this.element = t, this.type = 6, this._$AN = void 0, this._$AM =
|
|
461
|
+
class Bt {
|
|
462
|
+
constructor(t, r, i) {
|
|
463
|
+
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = r, this.options = i;
|
|
464
464
|
}
|
|
465
465
|
get _$AU() {
|
|
466
466
|
return this._$AM._$AU;
|
|
@@ -469,19 +469,19 @@ class Nt {
|
|
|
469
469
|
C(this, t);
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
const
|
|
473
|
-
jt?.(
|
|
474
|
-
const qt = (e, t,
|
|
475
|
-
const
|
|
476
|
-
let
|
|
477
|
-
if (
|
|
478
|
-
const
|
|
479
|
-
|
|
480
|
-
}
|
|
481
|
-
return
|
|
472
|
+
const Nt = { I: D }, jt = J.litHtmlPolyfillSupport;
|
|
473
|
+
jt?.(U, D), (J.litHtmlVersions ??= []).push("3.3.0");
|
|
474
|
+
const qt = (e, t, r) => {
|
|
475
|
+
const i = r?.renderBefore ?? t;
|
|
476
|
+
let s = i._$litPart$;
|
|
477
|
+
if (s === void 0) {
|
|
478
|
+
const o = r?.renderBefore ?? null;
|
|
479
|
+
i._$litPart$ = s = new D(t.insertBefore(O(), o), o, void 0, r ?? {});
|
|
480
|
+
}
|
|
481
|
+
return s._$AI(e), s;
|
|
482
482
|
};
|
|
483
483
|
const G = globalThis;
|
|
484
|
-
let
|
|
484
|
+
let F = class extends E {
|
|
485
485
|
constructor() {
|
|
486
486
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
487
487
|
}
|
|
@@ -490,8 +490,8 @@ let T = class extends E {
|
|
|
490
490
|
return this.renderOptions.renderBefore ??= t.firstChild, t;
|
|
491
491
|
}
|
|
492
492
|
update(t) {
|
|
493
|
-
const
|
|
494
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = qt(
|
|
493
|
+
const r = this.render();
|
|
494
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = qt(r, this.renderRoot, this.renderOptions);
|
|
495
495
|
}
|
|
496
496
|
connectedCallback() {
|
|
497
497
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -503,9 +503,9 @@ let T = class extends E {
|
|
|
503
503
|
return S;
|
|
504
504
|
}
|
|
505
505
|
};
|
|
506
|
-
|
|
506
|
+
F._$litElement$ = !0, F.finalized = !0, G.litElementHydrateSupport?.({ LitElement: F });
|
|
507
507
|
const zt = G.litElementPolyfillSupport;
|
|
508
|
-
zt?.({ LitElement:
|
|
508
|
+
zt?.({ LitElement: F });
|
|
509
509
|
(G.litElementVersions ??= []).push("4.2.0");
|
|
510
510
|
const It = { CHILD: 2 }, bt = (e) => (...t) => ({ _$litDirective$: e, values: t });
|
|
511
511
|
let gt = class {
|
|
@@ -514,93 +514,93 @@ let gt = class {
|
|
|
514
514
|
get _$AU() {
|
|
515
515
|
return this._$AM._$AU;
|
|
516
516
|
}
|
|
517
|
-
_$AT(t,
|
|
518
|
-
this._$Ct = t, this._$AM =
|
|
517
|
+
_$AT(t, r, i) {
|
|
518
|
+
this._$Ct = t, this._$AM = r, this._$Ci = i;
|
|
519
519
|
}
|
|
520
|
-
_$AS(t,
|
|
521
|
-
return this.update(t,
|
|
520
|
+
_$AS(t, r) {
|
|
521
|
+
return this.update(t, r);
|
|
522
522
|
}
|
|
523
|
-
update(t,
|
|
524
|
-
return this.render(...
|
|
523
|
+
update(t, r) {
|
|
524
|
+
return this.render(...r);
|
|
525
525
|
}
|
|
526
526
|
};
|
|
527
|
-
const { I: Lt } =
|
|
528
|
-
const
|
|
529
|
-
if (
|
|
530
|
-
const
|
|
531
|
-
|
|
527
|
+
const { I: Lt } = Nt, ht = () => document.createComment(""), k = (e, t, r) => {
|
|
528
|
+
const i = e._$AA.parentNode, s = t === void 0 ? e._$AB : t._$AA;
|
|
529
|
+
if (r === void 0) {
|
|
530
|
+
const o = i.insertBefore(ht(), s), n = i.insertBefore(ht(), s);
|
|
531
|
+
r = new Lt(o, n, e, e.options);
|
|
532
532
|
} else {
|
|
533
|
-
const
|
|
533
|
+
const o = r._$AB.nextSibling, n = r._$AM, h = n !== e;
|
|
534
534
|
if (h) {
|
|
535
|
-
let
|
|
536
|
-
|
|
535
|
+
let l;
|
|
536
|
+
r._$AQ?.(e), r._$AM = e, r._$AP !== void 0 && (l = e._$AU) !== n._$AU && r._$AP(l);
|
|
537
537
|
}
|
|
538
|
-
if (
|
|
539
|
-
let
|
|
540
|
-
for (;
|
|
541
|
-
const c =
|
|
542
|
-
|
|
538
|
+
if (o !== s || h) {
|
|
539
|
+
let l = r._$AA;
|
|
540
|
+
for (; l !== o; ) {
|
|
541
|
+
const c = l.nextSibling;
|
|
542
|
+
i.insertBefore(l, s), l = c;
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
|
-
return
|
|
547
|
-
}, A = (e, t,
|
|
546
|
+
return r;
|
|
547
|
+
}, A = (e, t, r = e) => (e._$AI(t, r), e), Wt = {}, _t = (e, t = Wt) => e._$AH = t, Kt = (e) => e._$AH, L = (e) => {
|
|
548
548
|
e._$AP?.(!1, !0);
|
|
549
549
|
let t = e._$AA;
|
|
550
|
-
const
|
|
551
|
-
for (; t !==
|
|
552
|
-
const
|
|
553
|
-
t.remove(), t =
|
|
550
|
+
const r = e._$AB.nextSibling;
|
|
551
|
+
for (; t !== r; ) {
|
|
552
|
+
const i = t.nextSibling;
|
|
553
|
+
t.remove(), t = i;
|
|
554
554
|
}
|
|
555
555
|
};
|
|
556
|
-
const
|
|
557
|
-
const
|
|
558
|
-
for (let
|
|
559
|
-
return
|
|
560
|
-
},
|
|
556
|
+
const ut = (e, t, r) => {
|
|
557
|
+
const i = /* @__PURE__ */ new Map();
|
|
558
|
+
for (let s = t; s <= r; s++) i.set(e[s], s);
|
|
559
|
+
return i;
|
|
560
|
+
}, ct = bt(class extends gt {
|
|
561
561
|
constructor(e) {
|
|
562
562
|
if (super(e), e.type !== It.CHILD) throw Error("repeat() can only be used in text expressions");
|
|
563
563
|
}
|
|
564
|
-
dt(e, t,
|
|
565
|
-
let
|
|
566
|
-
|
|
567
|
-
const
|
|
568
|
-
let
|
|
569
|
-
for (const h of e)
|
|
570
|
-
return { values:
|
|
571
|
-
}
|
|
572
|
-
render(e, t,
|
|
573
|
-
return this.dt(e, t,
|
|
574
|
-
}
|
|
575
|
-
update(e, [t,
|
|
576
|
-
const
|
|
577
|
-
if (!Array.isArray(
|
|
578
|
-
const h = this.ut ??= [],
|
|
579
|
-
let c, m,
|
|
580
|
-
for (;
|
|
581
|
-
else if (
|
|
582
|
-
else if (h[
|
|
583
|
-
else if (h[
|
|
584
|
-
else if (h[
|
|
585
|
-
else if (h[
|
|
586
|
-
else if (c === void 0 && (c =
|
|
587
|
-
const
|
|
564
|
+
dt(e, t, r) {
|
|
565
|
+
let i;
|
|
566
|
+
r === void 0 ? r = t : t !== void 0 && (i = t);
|
|
567
|
+
const s = [], o = [];
|
|
568
|
+
let n = 0;
|
|
569
|
+
for (const h of e) s[n] = i ? i(h, n) : n, o[n] = r(h, n), n++;
|
|
570
|
+
return { values: o, keys: s };
|
|
571
|
+
}
|
|
572
|
+
render(e, t, r) {
|
|
573
|
+
return this.dt(e, t, r).values;
|
|
574
|
+
}
|
|
575
|
+
update(e, [t, r, i]) {
|
|
576
|
+
const s = Kt(e), { values: o, keys: n } = this.dt(t, r, i);
|
|
577
|
+
if (!Array.isArray(s)) return this.ut = n, o;
|
|
578
|
+
const h = this.ut ??= [], l = [];
|
|
579
|
+
let c, m, a = 0, d = s.length - 1, u = 0, f = o.length - 1;
|
|
580
|
+
for (; a <= d && u <= f; ) if (s[a] === null) a++;
|
|
581
|
+
else if (s[d] === null) d--;
|
|
582
|
+
else if (h[a] === n[u]) l[u] = A(s[a], o[u]), a++, u++;
|
|
583
|
+
else if (h[d] === n[f]) l[f] = A(s[d], o[f]), d--, f--;
|
|
584
|
+
else if (h[a] === n[f]) l[f] = A(s[a], o[f]), k(e, l[f + 1], s[a]), a++, f--;
|
|
585
|
+
else if (h[d] === n[u]) l[u] = A(s[d], o[u]), k(e, s[a], s[d]), d--, u++;
|
|
586
|
+
else if (c === void 0 && (c = ut(n, u, f), m = ut(h, a, d)), c.has(h[a])) if (c.has(h[d])) {
|
|
587
|
+
const _ = m.get(n[u]), z = _ !== void 0 ? s[_] : null;
|
|
588
588
|
if (z === null) {
|
|
589
|
-
const X =
|
|
590
|
-
A(X,
|
|
591
|
-
} else
|
|
592
|
-
|
|
593
|
-
} else L(
|
|
594
|
-
else L(
|
|
595
|
-
for (;
|
|
596
|
-
const
|
|
597
|
-
A(
|
|
589
|
+
const X = k(e, s[a]);
|
|
590
|
+
A(X, o[u]), l[u] = X;
|
|
591
|
+
} else l[u] = A(z, o[u]), k(e, s[a], z), s[_] = null;
|
|
592
|
+
u++;
|
|
593
|
+
} else L(s[d]), d--;
|
|
594
|
+
else L(s[a]), a++;
|
|
595
|
+
for (; u <= f; ) {
|
|
596
|
+
const _ = k(e, l[f + 1]);
|
|
597
|
+
A(_, o[u]), l[u++] = _;
|
|
598
598
|
}
|
|
599
|
-
for (;
|
|
600
|
-
const
|
|
601
|
-
|
|
599
|
+
for (; a <= d; ) {
|
|
600
|
+
const _ = s[a++];
|
|
601
|
+
_ !== null && L(_);
|
|
602
602
|
}
|
|
603
|
-
return this.ut =
|
|
603
|
+
return this.ut = n, _t(e, l), S;
|
|
604
604
|
}
|
|
605
605
|
});
|
|
606
606
|
const Zt = bt(class extends gt {
|
|
@@ -610,62 +610,62 @@ const Zt = bt(class extends gt {
|
|
|
610
610
|
render(e, t) {
|
|
611
611
|
return this.key = e, t;
|
|
612
612
|
}
|
|
613
|
-
update(e, [t,
|
|
614
|
-
return t !== this.key && (_t(e), this.key = t),
|
|
613
|
+
update(e, [t, r]) {
|
|
614
|
+
return t !== this.key && (_t(e), this.key = t), r;
|
|
615
615
|
}
|
|
616
616
|
});
|
|
617
|
-
const Jt = (e) => (t,
|
|
618
|
-
|
|
617
|
+
const Jt = (e) => (t, r) => {
|
|
618
|
+
r !== void 0 ? r.addInitializer((() => {
|
|
619
619
|
customElements.define(e, t);
|
|
620
620
|
})) : customElements.define(e, t);
|
|
621
621
|
};
|
|
622
|
-
const Qt = { attribute: !0, type: String, converter:
|
|
623
|
-
const { kind:
|
|
624
|
-
let
|
|
625
|
-
if (
|
|
626
|
-
const { name:
|
|
622
|
+
const Qt = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged: Z }, Gt = (e = Qt, t, r) => {
|
|
623
|
+
const { kind: i, metadata: s } = r;
|
|
624
|
+
let o = globalThis.litPropertyMetadata.get(s);
|
|
625
|
+
if (o === void 0 && globalThis.litPropertyMetadata.set(s, o = /* @__PURE__ */ new Map()), i === "setter" && ((e = Object.create(e)).wrapped = !0), o.set(r.name, e), i === "accessor") {
|
|
626
|
+
const { name: n } = r;
|
|
627
627
|
return { set(h) {
|
|
628
|
-
const
|
|
629
|
-
t.set.call(this, h), this.requestUpdate(
|
|
628
|
+
const l = t.get.call(this);
|
|
629
|
+
t.set.call(this, h), this.requestUpdate(n, l, e);
|
|
630
630
|
}, init(h) {
|
|
631
|
-
return h !== void 0 && this.C(
|
|
631
|
+
return h !== void 0 && this.C(n, void 0, e, h), h;
|
|
632
632
|
} };
|
|
633
633
|
}
|
|
634
|
-
if (
|
|
635
|
-
const { name:
|
|
634
|
+
if (i === "setter") {
|
|
635
|
+
const { name: n } = r;
|
|
636
636
|
return function(h) {
|
|
637
|
-
const
|
|
638
|
-
t.call(this, h), this.requestUpdate(
|
|
637
|
+
const l = this[n];
|
|
638
|
+
t.call(this, h), this.requestUpdate(n, l, e);
|
|
639
639
|
};
|
|
640
640
|
}
|
|
641
|
-
throw Error("Unsupported decorator location: " +
|
|
641
|
+
throw Error("Unsupported decorator location: " + i);
|
|
642
642
|
};
|
|
643
|
-
function j(e) {
|
|
644
|
-
return (t, s) => typeof s == "object" ? Gt(e, t, s) : ((r, i, n) => {
|
|
645
|
-
const o = i.hasOwnProperty(n);
|
|
646
|
-
return i.constructor.createProperty(n, r), o ? Object.getOwnPropertyDescriptor(i, n) : void 0;
|
|
647
|
-
})(e, t, s);
|
|
648
|
-
}
|
|
649
643
|
function q(e) {
|
|
650
|
-
return
|
|
644
|
+
return (t, r) => typeof r == "object" ? Gt(e, t, r) : ((i, s, o) => {
|
|
645
|
+
const n = s.hasOwnProperty(o);
|
|
646
|
+
return s.constructor.createProperty(o, i), n ? Object.getOwnPropertyDescriptor(s, o) : void 0;
|
|
647
|
+
})(e, t, r);
|
|
651
648
|
}
|
|
652
|
-
|
|
649
|
+
function M(e) {
|
|
650
|
+
return q({ ...e, state: !0, attribute: !1 });
|
|
651
|
+
}
|
|
652
|
+
const Xt = (e, t, r) => (r.configurable = !0, r.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(e, t, r), r);
|
|
653
653
|
function Yt(e, t) {
|
|
654
|
-
return (
|
|
655
|
-
const
|
|
656
|
-
return Xt(
|
|
657
|
-
return
|
|
654
|
+
return (r, i, s) => {
|
|
655
|
+
const o = (n) => n.renderRoot?.querySelector(e) ?? null;
|
|
656
|
+
return Xt(r, i, { get() {
|
|
657
|
+
return o(this);
|
|
658
658
|
} });
|
|
659
659
|
};
|
|
660
660
|
}
|
|
661
|
-
var te = Object.defineProperty, ee = Object.getOwnPropertyDescriptor,
|
|
662
|
-
for (var
|
|
663
|
-
(
|
|
664
|
-
return
|
|
661
|
+
var te = Object.defineProperty, ee = Object.getOwnPropertyDescriptor, g = (e, t, r, i) => {
|
|
662
|
+
for (var s = i > 1 ? void 0 : i ? ee(t, r) : t, o = e.length - 1, n; o >= 0; o--)
|
|
663
|
+
(n = e[o]) && (s = (i ? n(t, r, s) : n(s)) || s);
|
|
664
|
+
return i && s && te(t, r, s), s;
|
|
665
665
|
};
|
|
666
|
-
let b = class extends
|
|
666
|
+
let b = class extends F {
|
|
667
667
|
constructor() {
|
|
668
|
-
super(...arguments), this.dialogOpen = !1, this.formKey = 0, this.version = "1.0.
|
|
668
|
+
super(...arguments), this.dialogOpen = !1, this.formKey = 0, this.fieldValues = {}, this.version = "1.0.27", this.dialogScrimPatched = !1;
|
|
669
669
|
}
|
|
670
670
|
update(e) {
|
|
671
671
|
e.has("theme") && this.registerTheme(this.theme), super.update(e);
|
|
@@ -703,51 +703,44 @@ let b = class extends T {
|
|
|
703
703
|
`), e.adoptedStyleSheets = [...e.adoptedStyleSheets, t], this.dialogScrimPatched = !0;
|
|
704
704
|
}
|
|
705
705
|
registerTheme(e) {
|
|
706
|
-
const t = getComputedStyle(this).getPropertyValue("--re-text-color").trim(),
|
|
707
|
-
this.themeBgColor =
|
|
706
|
+
const t = getComputedStyle(this).getPropertyValue("--re-text-color").trim(), r = getComputedStyle(this).getPropertyValue("--re-tile-background-color").trim();
|
|
707
|
+
this.themeBgColor = r || this.theme?.theme_object?.backgroundColor, this.themeTitleColor = t || this.theme?.theme_object?.title?.textStyle?.color;
|
|
708
708
|
}
|
|
709
709
|
openFormDialog() {
|
|
710
710
|
this.dialogOpen = !0;
|
|
711
711
|
}
|
|
712
712
|
handleFormSubmit(e) {
|
|
713
713
|
e.preventDefault();
|
|
714
|
-
const
|
|
715
|
-
const
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
else if (o.type === "checkbox")
|
|
720
|
-
c = i.has(a) ? "on" : "off";
|
|
721
|
-
else {
|
|
722
|
-
const m = i.get(a);
|
|
723
|
-
c = m === null || m === "" ? o.defaultValue ?? "" : m;
|
|
724
|
-
}
|
|
725
|
-
return {
|
|
726
|
-
swarm_app_databackend_key: o.targetColumn?.swarm_app_databackend_key,
|
|
727
|
-
table_name: o.targetColumn?.tablename,
|
|
728
|
-
column_name: o.targetColumn?.column,
|
|
729
|
-
value: this.formatValue(c, o.type ?? "textfield")
|
|
714
|
+
const r = e.submitter?.getAttribute("value") ?? "submit", i = e.target, s = new FormData(i), o = this.inputData?.formFields?.map((n, h) => {
|
|
715
|
+
const l = {
|
|
716
|
+
swarm_app_databackend_key: n.targetColumn?.swarm_app_databackend_key,
|
|
717
|
+
table_name: n.targetColumn?.tablename,
|
|
718
|
+
column_name: n.targetColumn?.column
|
|
730
719
|
};
|
|
720
|
+
if (!n.hiddenField && !this.isFieldVisible(n))
|
|
721
|
+
return { ...l, value: null };
|
|
722
|
+
const c = this.currentRawValue(n, h, s);
|
|
723
|
+
return { ...l, value: this.formatValue(c, n.type ?? "textfield") };
|
|
731
724
|
});
|
|
732
|
-
if (this.inputData?.deleteFlagColumn &&
|
|
725
|
+
if (this.inputData?.deleteFlagColumn && o?.push({
|
|
733
726
|
swarm_app_databackend_key: this.inputData?.deleteFlagColumn?.swarm_app_databackend_key,
|
|
734
727
|
table_name: this.inputData?.deleteFlagColumn?.tablename,
|
|
735
728
|
column_name: this.inputData?.deleteFlagColumn?.column,
|
|
736
|
-
value:
|
|
729
|
+
value: r === "delete"
|
|
737
730
|
}), this.dispatchEvent(
|
|
738
731
|
new CustomEvent("data-submit", {
|
|
739
|
-
detail:
|
|
732
|
+
detail: o,
|
|
740
733
|
bubbles: !1,
|
|
741
734
|
composed: !1
|
|
742
735
|
})
|
|
743
|
-
),
|
|
744
|
-
const
|
|
736
|
+
), r === "delete") {
|
|
737
|
+
const n = this.resolveRoute({
|
|
745
738
|
route: this.inputData?.deleteNavigationRoute,
|
|
746
739
|
variables: this.inputData?.variables
|
|
747
740
|
});
|
|
748
|
-
|
|
741
|
+
n && this.dispatchEvent(
|
|
749
742
|
new CustomEvent("nav-submit", {
|
|
750
|
-
detail: { path: String(
|
|
743
|
+
detail: { path: String(n) },
|
|
751
744
|
bubbles: !0,
|
|
752
745
|
composed: !0
|
|
753
746
|
})
|
|
@@ -755,12 +748,25 @@ let b = class extends T {
|
|
|
755
748
|
}
|
|
756
749
|
this.resetForm(), this.dialogOpen = !1;
|
|
757
750
|
}
|
|
751
|
+
// preFilledValue/defaultValue and their *Multiline/*Boolean twins are separate
|
|
752
|
+
// config keys (the editor shows a single-line, multi-line or checkbox input
|
|
753
|
+
// depending on the field type). Resolve by the current type — normalizing the
|
|
754
|
+
// boolean keys to 'true'/'false' strings for the existing downstream logic —
|
|
755
|
+
// and fall back to the single-line key so fields configured before the split
|
|
756
|
+
// keep their values. A value lingering in a hidden twin key after a type
|
|
757
|
+
// switch is ignored.
|
|
758
|
+
effectivePreFilledValue(e) {
|
|
759
|
+
return e.type === "textarea" ? e.preFilledValueMultiline ?? e.preFilledValue : e.type === "checkbox" && e.preFilledValueBoolean != null ? String(e.preFilledValueBoolean) : e.preFilledValue;
|
|
760
|
+
}
|
|
761
|
+
effectiveDefaultValue(e) {
|
|
762
|
+
return e.type === "textarea" ? e.defaultValueMultiline ?? e.defaultValue : e.type === "checkbox" && e.defaultValueBoolean != null ? String(e.defaultValueBoolean) : e.defaultValue;
|
|
763
|
+
}
|
|
758
764
|
formatValue(e, t) {
|
|
759
765
|
switch (t) {
|
|
760
766
|
case "numberfield": {
|
|
761
767
|
if (e === "" || e === null || e === void 0) return null;
|
|
762
|
-
const
|
|
763
|
-
return Number.isNaN(
|
|
768
|
+
const r = parseFloat(e);
|
|
769
|
+
return Number.isNaN(r) ? null : r;
|
|
764
770
|
}
|
|
765
771
|
case "checkbox":
|
|
766
772
|
return e === "on" || e === "true";
|
|
@@ -768,8 +774,46 @@ let b = class extends T {
|
|
|
768
774
|
return e;
|
|
769
775
|
}
|
|
770
776
|
}
|
|
777
|
+
// Resolve a field's current raw (string) value, applying the same
|
|
778
|
+
// empty-falls-back-to-default rule used at submit so condition evaluation and
|
|
779
|
+
// submission agree. Checkbox is normalized to 'true'/'false' (matching the
|
|
780
|
+
// literals designers use in a condition list); a field absent from the DOM
|
|
781
|
+
// (hidden by its own condition) yields its effective default value.
|
|
782
|
+
currentRawValue(e, t, r) {
|
|
783
|
+
const i = `column-${t}`;
|
|
784
|
+
if (e.hiddenField)
|
|
785
|
+
return this.effectivePreFilledValue(e) ?? this.effectiveDefaultValue(e) ?? "";
|
|
786
|
+
if (e.type === "checkbox") return r.has(i) ? "true" : "false";
|
|
787
|
+
const s = r.get(i);
|
|
788
|
+
return s === null || s === "" ? this.effectiveDefaultValue(e) ?? "" : String(s);
|
|
789
|
+
}
|
|
790
|
+
// Rebuild the label→value map on every input/change so conditional-display
|
|
791
|
+
// rules re-evaluate live. A single delegated listener on the <form> catches
|
|
792
|
+
// all field types (Material components bubble input/change within this root).
|
|
793
|
+
handleFieldChange(e) {
|
|
794
|
+
const t = e.currentTarget;
|
|
795
|
+
if (!t) return;
|
|
796
|
+
const r = new FormData(t), i = {};
|
|
797
|
+
this.inputData?.formFields?.forEach((s, o) => {
|
|
798
|
+
s.label && (i[s.label] = this.currentRawValue(s, o, r));
|
|
799
|
+
}), this.fieldValues = i;
|
|
800
|
+
}
|
|
801
|
+
// A field is visible unless it declares a conditional-display rule whose
|
|
802
|
+
// controlling field (referenced by label) does not currently hold one of the
|
|
803
|
+
// listed values. Fail-open on misconfiguration (unknown field / empty list)
|
|
804
|
+
// so a half-configured rule never silently hides a field and its data.
|
|
805
|
+
isFieldVisible(e) {
|
|
806
|
+
const t = e.conditionalDisplay?.conditionField?.trim();
|
|
807
|
+
if (!t) return !0;
|
|
808
|
+
const r = (e.conditionalDisplay?.conditionValues ?? "").split(",").map((o) => o.trim()).filter((o) => o !== "");
|
|
809
|
+
if (r.length === 0) return !0;
|
|
810
|
+
const i = this.inputData?.formFields?.find((o) => o.label === t);
|
|
811
|
+
if (!i) return !0;
|
|
812
|
+
const s = this.fieldValues[t] ?? this.effectivePreFilledValue(i) ?? this.effectiveDefaultValue(i) ?? "";
|
|
813
|
+
return r.includes(String(s));
|
|
814
|
+
}
|
|
771
815
|
renderTextField(e, t) {
|
|
772
|
-
return
|
|
816
|
+
return $`
|
|
773
817
|
<md-outlined-text-field
|
|
774
818
|
.name="column-${t}"
|
|
775
819
|
.label="${e.label ?? ""}"
|
|
@@ -784,7 +828,7 @@ let b = class extends T {
|
|
|
784
828
|
`;
|
|
785
829
|
}
|
|
786
830
|
renderNumberField(e, t) {
|
|
787
|
-
return
|
|
831
|
+
return $`
|
|
788
832
|
<md-outlined-text-field
|
|
789
833
|
.name="column-${t}"
|
|
790
834
|
.label="${e.label ?? ""}"
|
|
@@ -801,35 +845,37 @@ let b = class extends T {
|
|
|
801
845
|
`;
|
|
802
846
|
}
|
|
803
847
|
renderCheckbox(e, t) {
|
|
804
|
-
|
|
848
|
+
const r = this.effectivePreFilledValue(e), i = this.effectiveDefaultValue(e);
|
|
849
|
+
return $`
|
|
805
850
|
<div class="checkbox-container">
|
|
806
851
|
<md-checkbox
|
|
807
852
|
name="column-${t}"
|
|
808
853
|
aria-label=${e.label ?? ""}
|
|
809
|
-
?checked=${String(
|
|
854
|
+
?checked=${String(r ?? i) === "true"}
|
|
810
855
|
supporting-text=${e.description ?? ""}
|
|
811
|
-
?required=${e.required && !
|
|
856
|
+
?required=${e.required && !i && !r}
|
|
812
857
|
></md-checkbox>
|
|
813
858
|
<label class="label"> ${e.label} </label>
|
|
814
859
|
</div>
|
|
815
860
|
`;
|
|
816
861
|
}
|
|
817
862
|
renderTextArea(e, t) {
|
|
818
|
-
|
|
863
|
+
const r = this.effectivePreFilledValue(e), i = this.effectiveDefaultValue(e);
|
|
864
|
+
return $`
|
|
819
865
|
<md-outlined-text-field
|
|
820
866
|
.name="column-${t}"
|
|
821
867
|
.label="${e.label ?? ""}"
|
|
822
868
|
type="textarea"
|
|
823
|
-
.value="${
|
|
824
|
-
.placeholder="${
|
|
869
|
+
.value="${r ?? ""}"
|
|
870
|
+
.placeholder="${i ?? ""}"
|
|
825
871
|
rows="3"
|
|
826
|
-
?required=${e.required && !
|
|
872
|
+
?required=${e.required && !i && !r}
|
|
827
873
|
supporting-text=${e.description ?? ""}
|
|
828
874
|
></md-outlined-text-field>
|
|
829
875
|
`;
|
|
830
876
|
}
|
|
831
877
|
renderDropdown(e, t) {
|
|
832
|
-
return
|
|
878
|
+
return $`
|
|
833
879
|
<label class="label">
|
|
834
880
|
${e.label}
|
|
835
881
|
<md-outlined-select
|
|
@@ -838,12 +884,12 @@ let b = class extends T {
|
|
|
838
884
|
supporting-text=${e.description ?? ""}
|
|
839
885
|
?required=${e.required && !e.defaultValue && !e.preFilledValue}
|
|
840
886
|
>
|
|
841
|
-
${
|
|
887
|
+
${ct(
|
|
842
888
|
e.values ?? [],
|
|
843
|
-
(
|
|
844
|
-
(
|
|
845
|
-
<md-select-option .value="${
|
|
846
|
-
${
|
|
889
|
+
(r) => r.value,
|
|
890
|
+
(r) => $`
|
|
891
|
+
<md-select-option .value="${r.value ?? ""}">
|
|
892
|
+
${r.displayLabel}
|
|
847
893
|
</md-select-option>
|
|
848
894
|
`
|
|
849
895
|
)}
|
|
@@ -852,7 +898,7 @@ let b = class extends T {
|
|
|
852
898
|
`;
|
|
853
899
|
}
|
|
854
900
|
renderDateTimeField(e, t) {
|
|
855
|
-
return
|
|
901
|
+
return $`
|
|
856
902
|
<md-outlined-text-field
|
|
857
903
|
.name="column-${t}"
|
|
858
904
|
style="width: 200px;"
|
|
@@ -865,19 +911,19 @@ let b = class extends T {
|
|
|
865
911
|
`;
|
|
866
912
|
}
|
|
867
913
|
resetForm() {
|
|
868
|
-
this.formKey
|
|
914
|
+
this.formKey++, this.fieldValues = {};
|
|
869
915
|
}
|
|
870
916
|
resolveRoute(e) {
|
|
871
917
|
let t = e?.route ?? "";
|
|
872
918
|
if (t) {
|
|
873
919
|
if (e?.variables)
|
|
874
|
-
for (const
|
|
875
|
-
|
|
920
|
+
for (const r of e.variables)
|
|
921
|
+
r.label && (t = t.split(`{{${r.label}}}`).join(encodeURIComponent(String(r.value ?? ""))));
|
|
876
922
|
if (t.includes("*")) {
|
|
877
|
-
const
|
|
878
|
-
for (let
|
|
879
|
-
|
|
880
|
-
t = (t.startsWith("/") ? "/" : "") +
|
|
923
|
+
const r = (this.route || "").split("/").filter(Boolean), i = t.split("/").filter(Boolean);
|
|
924
|
+
for (let s = 0; s < i.length; s++)
|
|
925
|
+
i[s] === "*" && (i[s] = r[s] ?? "");
|
|
926
|
+
t = (t.startsWith("/") ? "/" : "") + i.filter(Boolean).join("/");
|
|
881
927
|
}
|
|
882
928
|
return t;
|
|
883
929
|
}
|
|
@@ -886,26 +932,26 @@ let b = class extends T {
|
|
|
886
932
|
this.resetForm(), this.dialogOpen = !1;
|
|
887
933
|
}
|
|
888
934
|
render() {
|
|
889
|
-
const e = this.themeTitleColor, t = this.themeBgColor,
|
|
890
|
-
return
|
|
935
|
+
const e = this.themeTitleColor, t = this.themeBgColor, r = t?.startsWith("rgba") ? t.replace(/rgba\(([^)]+),\s*[\d.]+\)/, "rgb($1)") : t?.startsWith("#") && t.length === 9 ? t.substring(0, 7) : t?.startsWith("#") && t.length === 5 ? t.substring(0, 4) : t;
|
|
936
|
+
return $`
|
|
891
937
|
<style>
|
|
892
938
|
:host {
|
|
893
939
|
--md-sys-color-on-surface: ${e};
|
|
894
940
|
--md-sys-color-on-surface-variant: ${e};
|
|
895
941
|
--md-sys-color-outline: ${e};
|
|
896
|
-
--md-sys-color-surface-container: ${
|
|
942
|
+
--md-sys-color-surface-container: ${r};
|
|
897
943
|
/* Dialog container and select dropdown panel always use the
|
|
898
944
|
alpha-stripped color so they stay fully opaque regardless of
|
|
899
945
|
the theme's (possibly translucent) background. */
|
|
900
|
-
--md-dialog-container-color: ${
|
|
901
|
-
--md-menu-container-color: ${
|
|
902
|
-
--md-menu-item-selected-container-color: ${
|
|
946
|
+
--md-dialog-container-color: ${r};
|
|
947
|
+
--md-menu-container-color: ${r};
|
|
948
|
+
--md-menu-item-selected-container-color: ${r};
|
|
903
949
|
--md-menu-item-selected-label-text-color: ${e};
|
|
904
950
|
color: ${e};
|
|
905
951
|
}
|
|
906
952
|
</style>
|
|
907
953
|
<div class="header">
|
|
908
|
-
${this.inputData?.formButton ?
|
|
954
|
+
${this.inputData?.formButton ? $`
|
|
909
955
|
<md-fab
|
|
910
956
|
aria-label="Add"
|
|
911
957
|
.size=${this.inputData.formButtonStyle?.size || "medium"}
|
|
@@ -915,7 +961,7 @@ let b = class extends T {
|
|
|
915
961
|
<md-icon slot="icon">add</md-icon>
|
|
916
962
|
</md-fab>
|
|
917
963
|
` : p}
|
|
918
|
-
${this.inputData?.formButton ? p :
|
|
964
|
+
${this.inputData?.formButton ? p : $`
|
|
919
965
|
<header>
|
|
920
966
|
<h3 class="paging" ?active=${this.inputData?.title}>
|
|
921
967
|
${this.inputData?.title}
|
|
@@ -926,24 +972,24 @@ let b = class extends T {
|
|
|
926
972
|
</header>
|
|
927
973
|
`}
|
|
928
974
|
</div>
|
|
929
|
-
${this.inputData?.formButton ?
|
|
975
|
+
${this.inputData?.formButton ? $`
|
|
930
976
|
<md-dialog
|
|
931
977
|
aria-label="${this.inputData?.title ?? "Data Entry"}"
|
|
932
978
|
class="form"
|
|
933
979
|
quick
|
|
934
980
|
?open=${this.dialogOpen}
|
|
935
|
-
@cancel=${(
|
|
936
|
-
|
|
981
|
+
@cancel=${(i) => {
|
|
982
|
+
i.preventDefault();
|
|
937
983
|
}}
|
|
938
|
-
@keydown=${(
|
|
939
|
-
|
|
984
|
+
@keydown=${(i) => {
|
|
985
|
+
i.key === "Escape" && i.preventDefault();
|
|
940
986
|
}}
|
|
941
987
|
@closed=${() => this.dialogOpen = !1}
|
|
942
988
|
>
|
|
943
989
|
<div slot="headline">${this.inputData?.title ?? "Data Entry"}</div>
|
|
944
990
|
${this.renderForm()}
|
|
945
991
|
<div slot="actions">
|
|
946
|
-
${this.inputData?.deleteButton ?
|
|
992
|
+
${this.inputData?.deleteButton ? $`<md-filled-button
|
|
947
993
|
class="delete-btn"
|
|
948
994
|
form="form"
|
|
949
995
|
value="delete"
|
|
@@ -957,11 +1003,11 @@ let b = class extends T {
|
|
|
957
1003
|
>
|
|
958
1004
|
</div>
|
|
959
1005
|
</md-dialog>
|
|
960
|
-
` :
|
|
1006
|
+
` : $`
|
|
961
1007
|
<div class="wrapper">
|
|
962
1008
|
${this.renderForm()}
|
|
963
1009
|
<div class="form-actions">
|
|
964
|
-
${this.inputData?.deleteButton ?
|
|
1010
|
+
${this.inputData?.deleteButton ? $`<md-filled-button
|
|
965
1011
|
class="delete-btn"
|
|
966
1012
|
form="form"
|
|
967
1013
|
value="delete"
|
|
@@ -980,19 +1026,21 @@ let b = class extends T {
|
|
|
980
1026
|
renderForm() {
|
|
981
1027
|
return Zt(
|
|
982
1028
|
this.formKey,
|
|
983
|
-
|
|
1029
|
+
$`
|
|
984
1030
|
<form
|
|
985
1031
|
id="form"
|
|
986
1032
|
slot="content"
|
|
987
1033
|
method="dialog"
|
|
988
1034
|
class="form-content"
|
|
989
1035
|
@submit=${this.handleFormSubmit}
|
|
1036
|
+
@input=${this.handleFieldChange}
|
|
1037
|
+
@change=${this.handleFieldChange}
|
|
990
1038
|
>
|
|
991
|
-
${
|
|
1039
|
+
${ct(
|
|
992
1040
|
this.inputData?.formFields ?? [],
|
|
993
1041
|
(e, t) => t,
|
|
994
1042
|
(e, t) => {
|
|
995
|
-
if (e.hiddenField) return p;
|
|
1043
|
+
if (e.hiddenField || !this.isFieldVisible(e)) return p;
|
|
996
1044
|
switch (e.type) {
|
|
997
1045
|
case "textfield":
|
|
998
1046
|
return this.renderTextField(e, t);
|
|
@@ -1162,32 +1210,35 @@ b.styles = vt`
|
|
|
1162
1210
|
--md-filled-button-pressed-label-text-color: #fff;
|
|
1163
1211
|
}
|
|
1164
1212
|
`;
|
|
1165
|
-
|
|
1166
|
-
|
|
1213
|
+
g([
|
|
1214
|
+
q({ type: Object })
|
|
1167
1215
|
], b.prototype, "inputData", 2);
|
|
1168
|
-
|
|
1169
|
-
|
|
1216
|
+
g([
|
|
1217
|
+
q({ type: Object })
|
|
1170
1218
|
], b.prototype, "theme", 2);
|
|
1171
|
-
|
|
1172
|
-
|
|
1219
|
+
g([
|
|
1220
|
+
q({ type: String })
|
|
1173
1221
|
], b.prototype, "route", 2);
|
|
1174
|
-
|
|
1175
|
-
|
|
1222
|
+
g([
|
|
1223
|
+
M()
|
|
1176
1224
|
], b.prototype, "themeBgColor", 2);
|
|
1177
|
-
|
|
1178
|
-
|
|
1225
|
+
g([
|
|
1226
|
+
M()
|
|
1179
1227
|
], b.prototype, "themeTitleColor", 2);
|
|
1180
|
-
|
|
1181
|
-
|
|
1228
|
+
g([
|
|
1229
|
+
M()
|
|
1182
1230
|
], b.prototype, "dialogOpen", 2);
|
|
1183
|
-
|
|
1231
|
+
g([
|
|
1184
1232
|
Yt("md-dialog")
|
|
1185
1233
|
], b.prototype, "dialog", 2);
|
|
1186
|
-
|
|
1187
|
-
|
|
1234
|
+
g([
|
|
1235
|
+
M()
|
|
1188
1236
|
], b.prototype, "formKey", 2);
|
|
1189
|
-
|
|
1190
|
-
|
|
1237
|
+
g([
|
|
1238
|
+
M()
|
|
1239
|
+
], b.prototype, "fieldValues", 2);
|
|
1240
|
+
b = g([
|
|
1241
|
+
Jt("widget-form-1.0.27")
|
|
1191
1242
|
], b);
|
|
1192
1243
|
export {
|
|
1193
1244
|
b as WidgetForm
|