@record-evolution/widget-form 1.0.12 → 1.0.14

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.
@@ -8,7 +8,7 @@ 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 F = globalThis, L = F.ShadowRoot && (F.ShadyCSS === void 0 || F.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, W = /* @__PURE__ */ Symbol(), Y = /* @__PURE__ */ new WeakMap();
11
+ const N = globalThis, L = N.ShadowRoot && (N.ShadyCSS === void 0 || N.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, W = /* @__PURE__ */ Symbol(), Y = /* @__PURE__ */ new WeakMap();
12
12
  let ut = class {
13
13
  constructor(t, s, i) {
14
14
  if (this._$cssResult$ = !0, i !== W) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
@@ -27,28 +27,28 @@ let ut = class {
27
27
  return this.cssText;
28
28
  }
29
29
  };
30
- const bt = (e) => new ut(typeof e == "string" ? e : e + "", void 0, W), _t = (e, ...t) => {
30
+ const yt = (e) => new ut(typeof e == "string" ? e : e + "", void 0, W), vt = (e, ...t) => {
31
31
  const s = e.length === 1 ? e[0] : t.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
35
  })(r) + e[o + 1]), e[0]);
36
36
  return new ut(s, e, W);
37
- }, gt = (e, t) => {
37
+ }, At = (e, t) => {
38
38
  if (L) e.adoptedStyleSheets = t.map(((s) => s instanceof CSSStyleSheet ? s : s.styleSheet));
39
39
  else for (const s of t) {
40
- const i = document.createElement("style"), r = F.litNonce;
40
+ const i = document.createElement("style"), r = N.litNonce;
41
41
  r !== void 0 && i.setAttribute("nonce", r), i.textContent = s.cssText, e.appendChild(i);
42
42
  }
43
43
  }, tt = L ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
44
44
  let s = "";
45
45
  for (const i of t.cssRules) s += i.cssText;
46
- return bt(s);
46
+ return yt(s);
47
47
  })(e) : e;
48
- const { is: yt, defineProperty: vt, getOwnPropertyDescriptor: At, getOwnPropertyNames: xt, getOwnPropertySymbols: wt, getPrototypeOf: St } = Object, V = globalThis, et = V.trustedTypes, Et = et ? et.emptyScript : "", Ct = V.reactiveElementPolyfillSupport, T = (e, t) => e, N = { toAttribute(e, t) {
48
+ const { is: xt, defineProperty: wt, getOwnPropertyDescriptor: Et, getOwnPropertyNames: St, getOwnPropertySymbols: Ct, getPrototypeOf: Pt } = Object, j = globalThis, et = j.trustedTypes, Ot = et ? et.emptyScript : "", Dt = j.reactiveElementPolyfillSupport, T = (e, t) => e, V = { toAttribute(e, t) {
49
49
  switch (t) {
50
50
  case Boolean:
51
- e = e ? Et : null;
51
+ e = e ? Ot : null;
52
52
  break;
53
53
  case Object:
54
54
  case Array:
@@ -73,9 +73,9 @@ const { is: yt, defineProperty: vt, getOwnPropertyDescriptor: At, getOwnProperty
73
73
  }
74
74
  }
75
75
  return s;
76
- } }, Z = (e, t) => !yt(e, t), st = { attribute: !0, type: String, converter: N, reflect: !1, useDefault: !1, hasChanged: Z };
77
- Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), V.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
78
- let E = class extends HTMLElement {
76
+ } }, K = (e, t) => !xt(e, t), st = { attribute: !0, type: String, converter: V, reflect: !1, useDefault: !1, hasChanged: K };
77
+ Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), j.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
78
+ let S = class extends HTMLElement {
79
79
  static addInitializer(t) {
80
80
  this._$Ei(), (this.l ??= []).push(t);
81
81
  }
@@ -85,18 +85,18 @@ let E = class extends HTMLElement {
85
85
  static createProperty(t, s = st) {
86
86
  if (s.state && (s.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((s = Object.create(s)).wrapped = !0), this.elementProperties.set(t, s), !s.noAccessor) {
87
87
  const i = /* @__PURE__ */ Symbol(), r = this.getPropertyDescriptor(t, i, s);
88
- r !== void 0 && vt(this.prototype, t, r);
88
+ r !== void 0 && wt(this.prototype, t, r);
89
89
  }
90
90
  }
91
91
  static getPropertyDescriptor(t, s, i) {
92
- const { get: r, set: o } = At(this.prototype, t) ?? { get() {
92
+ const { get: r, set: o } = Et(this.prototype, t) ?? { get() {
93
93
  return this[s];
94
94
  }, set(n) {
95
95
  this[s] = n;
96
96
  } };
97
97
  return { get: r, set(n) {
98
- const a = r?.call(this);
99
- o?.call(this, n), this.requestUpdate(t, a, i);
98
+ const h = r?.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) {
@@ -104,13 +104,13 @@ let E = class extends HTMLElement {
104
104
  }
105
105
  static _$Ei() {
106
106
  if (this.hasOwnProperty(T("elementProperties"))) return;
107
- const t = St(this);
107
+ const t = Pt(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
111
  if (this.hasOwnProperty(T("finalized"))) return;
112
112
  if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(T("properties"))) {
113
- const s = this.properties, i = [...xt(s), ...wt(s)];
113
+ const s = this.properties, i = [...St(s), ...Ct(s)];
114
114
  for (const r of i) this.createProperty(r, s[r]);
115
115
  }
116
116
  const t = this[Symbol.metadata];
@@ -156,7 +156,7 @@ let E = class extends HTMLElement {
156
156
  }
157
157
  createRenderRoot() {
158
158
  const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
159
- return gt(t, this.constructor.elementStyles), t;
159
+ return At(t, this.constructor.elementStyles), t;
160
160
  }
161
161
  connectedCallback() {
162
162
  this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((t) => t.hostConnected?.()));
@@ -172,21 +172,21 @@ let E = class extends HTMLElement {
172
172
  _$ET(t, s) {
173
173
  const i = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, i);
174
174
  if (r !== void 0 && i.reflect === !0) {
175
- const o = (i.converter?.toAttribute !== void 0 ? i.converter : N).toAttribute(s, i.type);
175
+ const o = (i.converter?.toAttribute !== void 0 ? i.converter : V).toAttribute(s, i.type);
176
176
  this._$Em = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
177
177
  }
178
178
  }
179
179
  _$AK(t, s) {
180
180
  const i = this.constructor, r = i._$Eh.get(t);
181
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 : N;
182
+ const o = i.getPropertyOptions(r), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : V;
183
183
  this._$Em = r, this[r] = n.fromAttribute(s, o.type) ?? this._$Ej?.get(r) ?? null, this._$Em = null;
184
184
  }
185
185
  }
186
186
  requestUpdate(t, s, i) {
187
187
  if (t !== void 0) {
188
188
  const r = this.constructor, o = this[t];
189
- if (i ??= r.getPropertyOptions(t), !((i.hasChanged ?? Z)(o, s) || i.useDefault && i.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(r._$Eu(t, i)))) return;
189
+ if (i ??= r.getPropertyOptions(t), !((i.hasChanged ?? K)(o, s) || i.useDefault && i.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(r._$Eu(t, i)))) return;
190
190
  this.C(t, s, i);
191
191
  }
192
192
  this.isUpdatePending === !1 && (this._$ES = this._$EP());
@@ -216,8 +216,8 @@ let E = class extends HTMLElement {
216
216
  }
217
217
  const i = this.constructor.elementProperties;
218
218
  if (i.size > 0) for (const [r, o] of i) {
219
- const { wrapped: n } = o, a = this[r];
220
- n !== !0 || this._$AL.has(r) || a === void 0 || this.C(r, void 0, o, a);
219
+ const { wrapped: n } = o, h = this[r];
220
+ n !== !0 || this._$AL.has(r) || h === void 0 || this.C(r, void 0, o, h);
221
221
  }
222
222
  }
223
223
  let t = !1;
@@ -254,23 +254,23 @@ let E = class extends HTMLElement {
254
254
  firstUpdated(t) {
255
255
  }
256
256
  };
257
- E.elementStyles = [], E.shadowRootOptions = { mode: "open" }, E[T("elementProperties")] = /* @__PURE__ */ new Map(), E[T("finalized")] = /* @__PURE__ */ new Map(), Ct?.({ ReactiveElement: E }), (V.reactiveElementVersions ??= []).push("2.1.0");
258
- const J = globalThis, R = J.trustedTypes, it = R ? R.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, pt = "$lit$", g = `lit$${Math.random().toFixed(9).slice(2)}$`, mt = "?" + g, Pt = `<${mt}>`, w = document, k = () => w.createComment(""), M = (e) => e === null || typeof e != "object" && typeof e != "function", K = Array.isArray, Ot = (e) => K(e) || typeof e?.[Symbol.iterator] == "function", z = `[
257
+ S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[T("elementProperties")] = /* @__PURE__ */ new Map(), S[T("finalized")] = /* @__PURE__ */ new Map(), Dt?.({ ReactiveElement: S }), (j.reactiveElementVersions ??= []).push("2.1.0");
258
+ const Z = globalThis, R = Z.trustedTypes, it = R ? R.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, pt = "$lit$", y = `lit$${Math.random().toFixed(9).slice(2)}$`, mt = "?" + y, Tt = `<${mt}>`, w = document, k = () => w.createComment(""), M = (e) => e === null || typeof e != "object" && typeof e != "function", J = Array.isArray, Ut = (e) => J(e) || typeof e?.[Symbol.iterator] == "function", z = `[
259
259
  \f\r]`, O = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, rt = /-->/g, ot = />/g, v = RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^
260
- \f\r"'\`<>=]|("|')|))|$)`, "g"), nt = /'/g, lt = /"/g, $t = /^(?:script|style|textarea|title)$/i, Dt = (e) => (t, ...s) => ({ _$litType$: e, strings: t, values: s }), f = Dt(1), S = /* @__PURE__ */ Symbol.for("lit-noChange"), p = /* @__PURE__ */ Symbol.for("lit-nothing"), at = /* @__PURE__ */ new WeakMap(), x = w.createTreeWalker(w, 129);
260
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), nt = /'/g, lt = /"/g, $t = /^(?:script|style|textarea|title)$/i, kt = (e) => (t, ...s) => ({ _$litType$: e, strings: t, values: s }), f = kt(1), E = /* @__PURE__ */ Symbol.for("lit-noChange"), p = /* @__PURE__ */ Symbol.for("lit-nothing"), at = /* @__PURE__ */ new WeakMap(), x = w.createTreeWalker(w, 129);
261
261
  function ft(e, t) {
262
- if (!K(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
262
+ if (!J(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
263
263
  return it !== void 0 ? it.createHTML(t) : t;
264
264
  }
265
- const Tt = (e, t) => {
265
+ const Mt = (e, t) => {
266
266
  const s = e.length - 1, i = [];
267
267
  let r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = O;
268
- for (let a = 0; a < s; a++) {
269
- const l = e[a];
270
- let d, m, h = -1, u = 0;
271
- for (; u < l.length && (n.lastIndex = u, m = n.exec(l), m !== null); ) u = n.lastIndex, n === O ? m[1] === "!--" ? n = rt : m[1] !== void 0 ? n = ot : m[2] !== void 0 ? ($t.test(m[2]) && (r = RegExp("</" + m[2], "g")), n = v) : m[3] !== void 0 && (n = v) : n === v ? m[0] === ">" ? (n = r ?? O, h = -1) : m[1] === void 0 ? h = -2 : (h = n.lastIndex - m[2].length, d = m[1], n = m[3] === void 0 ? v : m[3] === '"' ? lt : nt) : n === lt || n === nt ? n = v : n === rt || n === ot ? n = O : (n = v, r = void 0);
272
- const c = n === v && e[a + 1].startsWith("/>") ? " " : "";
273
- o += n === O ? l + Pt : h >= 0 ? (i.push(d), l.slice(0, h) + pt + l.slice(h) + g + c) : l + g + (h === -2 ? a : c);
268
+ for (let h = 0; h < s; h++) {
269
+ const l = e[h];
270
+ let c, m, a = -1, u = 0;
271
+ for (; u < l.length && (n.lastIndex = u, m = n.exec(l), m !== null); ) u = n.lastIndex, n === O ? m[1] === "!--" ? n = rt : m[1] !== void 0 ? n = ot : m[2] !== void 0 ? ($t.test(m[2]) && (r = RegExp("</" + m[2], "g")), n = v) : m[3] !== void 0 && (n = v) : n === v ? m[0] === ">" ? (n = r ?? O, 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 === rt || n === ot ? n = O : (n = v, r = void 0);
272
+ const d = n === v && e[h + 1].startsWith("/>") ? " " : "";
273
+ o += n === O ? l + Tt : a >= 0 ? (i.push(c), l.slice(0, a) + pt + l.slice(a) + y + d) : l + y + (a === -2 ? h : d);
274
274
  }
275
275
  return [ft(e, o + (e[s] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
276
276
  };
@@ -279,29 +279,29 @@ class H {
279
279
  let r;
280
280
  this.parts = [];
281
281
  let o = 0, n = 0;
282
- const a = t.length - 1, l = this.parts, [d, m] = Tt(t, s);
283
- if (this.el = H.createElement(d, i), x.currentNode = this.el.content, s === 2 || s === 3) {
284
- const h = this.el.content.firstChild;
285
- h.replaceWith(...h.childNodes);
282
+ const h = t.length - 1, l = this.parts, [c, m] = Mt(t, s);
283
+ if (this.el = H.createElement(c, i), x.currentNode = this.el.content, s === 2 || s === 3) {
284
+ const a = this.el.content.firstChild;
285
+ a.replaceWith(...a.childNodes);
286
286
  }
287
- for (; (r = x.nextNode()) !== null && l.length < a; ) {
287
+ for (; (r = x.nextNode()) !== null && l.length < h; ) {
288
288
  if (r.nodeType === 1) {
289
- if (r.hasAttributes()) for (const h of r.getAttributeNames()) if (h.endsWith(pt)) {
290
- const u = m[n++], c = r.getAttribute(h).split(g), $ = /([.?@])?(.*)/.exec(u);
291
- l.push({ type: 1, index: o, name: $[2], strings: c, ctor: $[1] === "." ? kt : $[1] === "?" ? Mt : $[1] === "@" ? Ht : j }), r.removeAttribute(h);
292
- } else h.startsWith(g) && (l.push({ type: 6, index: o }), r.removeAttribute(h));
289
+ if (r.hasAttributes()) for (const a of r.getAttributeNames()) if (a.endsWith(pt)) {
290
+ const u = m[n++], d = r.getAttribute(a).split(y), $ = /([.?@])?(.*)/.exec(u);
291
+ l.push({ type: 1, index: o, name: $[2], strings: d, ctor: $[1] === "." ? Ft : $[1] === "?" ? Nt : $[1] === "@" ? Vt : B }), r.removeAttribute(a);
292
+ } else a.startsWith(y) && (l.push({ type: 6, index: o }), r.removeAttribute(a));
293
293
  if ($t.test(r.tagName)) {
294
- const h = r.textContent.split(g), u = h.length - 1;
294
+ const a = r.textContent.split(y), u = a.length - 1;
295
295
  if (u > 0) {
296
296
  r.textContent = R ? R.emptyScript : "";
297
- for (let c = 0; c < u; c++) r.append(h[c], k()), x.nextNode(), l.push({ type: 2, index: ++o });
298
- r.append(h[u], k());
297
+ for (let d = 0; d < u; d++) r.append(a[d], k()), x.nextNode(), l.push({ type: 2, index: ++o });
298
+ r.append(a[u], k());
299
299
  }
300
300
  }
301
301
  } else if (r.nodeType === 8) if (r.data === mt) l.push({ type: 2, index: o });
302
302
  else {
303
- let h = -1;
304
- for (; (h = r.data.indexOf(g, h + 1)) !== -1; ) l.push({ type: 7, index: o }), h += g.length - 1;
303
+ let a = -1;
304
+ for (; (a = r.data.indexOf(y, a + 1)) !== -1; ) l.push({ type: 7, index: o }), a += y.length - 1;
305
305
  }
306
306
  o++;
307
307
  }
@@ -312,12 +312,12 @@ class H {
312
312
  }
313
313
  }
314
314
  function C(e, t, s = e, i) {
315
- if (t === S) return t;
315
+ if (t === E) return t;
316
316
  let r = i !== void 0 ? s._$Co?.[i] : s._$Cl;
317
317
  const o = M(t) ? void 0 : t._$litDirective$;
318
318
  return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(e), r._$AT(e, s, i)), i !== void 0 ? (s._$Co ??= [])[i] = r : s._$Cl = r), r !== void 0 && (t = C(e, r._$AS(e, t.values), r, i)), t;
319
319
  }
320
- let Ut = class {
320
+ let Ht = class {
321
321
  constructor(t, s) {
322
322
  this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = s;
323
323
  }
@@ -330,11 +330,11 @@ let Ut = class {
330
330
  u(t) {
331
331
  const { el: { content: s }, parts: i } = this._$AD, r = (t?.creationScope ?? w).importNode(s, !0);
332
332
  x.currentNode = r;
333
- let o = x.nextNode(), n = 0, a = 0, l = i[0];
333
+ let o = x.nextNode(), n = 0, h = 0, l = i[0];
334
334
  for (; l !== void 0; ) {
335
335
  if (n === l.index) {
336
- let d;
337
- l.type === 2 ? d = new P(o, o.nextSibling, this, t) : l.type === 1 ? d = new l.ctor(o, l.name, l.strings, this, t) : l.type === 6 && (d = new Ft(o, this, t)), this._$AV.push(d), l = i[++a];
336
+ let c;
337
+ l.type === 2 ? c = new P(o, o.nextSibling, this, t) : l.type === 1 ? c = new l.ctor(o, l.name, l.strings, this, t) : l.type === 6 && (c = new Rt(o, this, t)), this._$AV.push(c), l = i[++h];
338
338
  }
339
339
  n !== l?.index && (o = x.nextNode(), n++);
340
340
  }
@@ -364,7 +364,7 @@ class P {
364
364
  return this._$AB;
365
365
  }
366
366
  _$AI(t, s = this) {
367
- t = C(this, t, s), M(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) : Ot(t) ? this.k(t) : this._(t);
367
+ t = C(this, t, s), M(t) ? t === p || t == null || t === "" ? (this._$AH !== p && this._$AR(), this._$AH = p) : t !== this._$AH && t !== E && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Ut(t) ? this.k(t) : this._(t);
368
368
  }
369
369
  O(t) {
370
370
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -379,7 +379,7 @@ class P {
379
379
  const { values: s, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = H.createElement(ft(i.h, i.h[0]), this.options)), i);
380
380
  if (this._$AH?._$AD === r) this._$AH.p(s);
381
381
  else {
382
- const o = new Ut(r, this), n = o.u(this.options);
382
+ const o = new Ht(r, this), n = o.u(this.options);
383
383
  o.p(s), this.T(n), this._$AH = o;
384
384
  }
385
385
  }
@@ -388,7 +388,7 @@ class P {
388
388
  return s === void 0 && at.set(t.strings, s = new H(t)), s;
389
389
  }
390
390
  k(t) {
391
- K(this._$AH) || (this._$AH = [], this._$AR());
391
+ J(this._$AH) || (this._$AH = [], this._$AR());
392
392
  const s = this._$AH;
393
393
  let i, r = 0;
394
394
  for (const o of t) r === s.length ? s.push(i = new P(this.O(k()), this.O(k()), this, this.options)) : i = s[r], i._$AI(o), r++;
@@ -404,7 +404,7 @@ class P {
404
404
  this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
405
405
  }
406
406
  }
407
- class j {
407
+ class B {
408
408
  get tagName() {
409
409
  return this.element.tagName;
410
410
  }
@@ -417,11 +417,11 @@ class j {
417
417
  _$AI(t, s = this, i, r) {
418
418
  const o = this.strings;
419
419
  let n = !1;
420
- if (o === void 0) t = C(this, t, s, 0), n = !M(t) || t !== this._$AH && t !== S, n && (this._$AH = t);
420
+ if (o === void 0) t = C(this, t, s, 0), n = !M(t) || t !== this._$AH && t !== E, n && (this._$AH = t);
421
421
  else {
422
- const a = t;
423
- let l, d;
424
- for (t = o[0], l = 0; l < o.length - 1; l++) d = C(this, a[i + l], s, l), d === S && (d = this._$AH[l]), n ||= !M(d) || d !== this._$AH[l], d === p ? t = p : t !== p && (t += (d ?? "") + o[l + 1]), this._$AH[l] = d;
422
+ const h = t;
423
+ let l, c;
424
+ for (t = o[0], l = 0; l < o.length - 1; l++) c = C(this, h[i + l], s, l), c === E && (c = this._$AH[l]), n ||= !M(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 && !r && this.j(t);
427
427
  }
@@ -429,7 +429,7 @@ class j {
429
429
  t === p ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
430
430
  }
431
431
  }
432
- class kt extends j {
432
+ class Ft extends B {
433
433
  constructor() {
434
434
  super(...arguments), this.type = 3;
435
435
  }
@@ -437,7 +437,7 @@ class kt extends j {
437
437
  this.element[this.name] = t === p ? void 0 : t;
438
438
  }
439
439
  }
440
- class Mt extends j {
440
+ class Nt extends B {
441
441
  constructor() {
442
442
  super(...arguments), this.type = 4;
443
443
  }
@@ -445,12 +445,12 @@ class Mt extends j {
445
445
  this.element.toggleAttribute(this.name, !!t && t !== p);
446
446
  }
447
447
  }
448
- class Ht extends j {
448
+ class Vt extends B {
449
449
  constructor(t, s, i, r, o) {
450
450
  super(t, s, i, r, o), this.type = 5;
451
451
  }
452
452
  _$AI(t, s = this) {
453
- if ((t = C(this, t, s, 0) ?? p) === S) return;
453
+ if ((t = C(this, t, s, 0) ?? p) === E) return;
454
454
  const i = this._$AH, r = t === p && i !== p || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, o = t !== p && (i === p || r);
455
455
  r && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
456
456
  }
@@ -458,7 +458,7 @@ class Ht extends j {
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 Ft {
461
+ class Rt {
462
462
  constructor(t, s, i) {
463
463
  this.element = t, this.type = 6, this._$AN = void 0, this._$AM = s, this.options = i;
464
464
  }
@@ -469,9 +469,9 @@ class Ft {
469
469
  C(this, t);
470
470
  }
471
471
  }
472
- const Nt = { I: P }, Rt = J.litHtmlPolyfillSupport;
473
- Rt?.(H, P), (J.litHtmlVersions ??= []).push("3.3.0");
474
- const Vt = (e, t, s) => {
472
+ const jt = { I: P }, Bt = Z.litHtmlPolyfillSupport;
473
+ Bt?.(H, P), (Z.litHtmlVersions ??= []).push("3.3.0");
474
+ const qt = (e, t, s) => {
475
475
  const i = s?.renderBefore ?? t;
476
476
  let r = i._$litPart$;
477
477
  if (r === void 0) {
@@ -481,7 +481,7 @@ const Vt = (e, t, s) => {
481
481
  return r._$AI(e), r;
482
482
  };
483
483
  const Q = globalThis;
484
- let U = class extends E {
484
+ let U = class extends S {
485
485
  constructor() {
486
486
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
487
487
  }
@@ -491,7 +491,7 @@ let U = class extends E {
491
491
  }
492
492
  update(t) {
493
493
  const s = this.render();
494
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Vt(s, this.renderRoot, this.renderOptions);
494
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = qt(s, this.renderRoot, this.renderOptions);
495
495
  }
496
496
  connectedCallback() {
497
497
  super.connectedCallback(), this._$Do?.setConnected(!0);
@@ -500,15 +500,15 @@ let U = class extends E {
500
500
  super.disconnectedCallback(), this._$Do?.setConnected(!1);
501
501
  }
502
502
  render() {
503
- return S;
503
+ return E;
504
504
  }
505
505
  };
506
506
  U._$litElement$ = !0, U.finalized = !0, Q.litElementHydrateSupport?.({ LitElement: U });
507
- const jt = Q.litElementPolyfillSupport;
508
- jt?.({ LitElement: U });
507
+ const zt = Q.litElementPolyfillSupport;
508
+ zt?.({ LitElement: U });
509
509
  (Q.litElementVersions ??= []).push("4.2.0");
510
- const qt = { CHILD: 2 }, Bt = (e) => (...t) => ({ _$litDirective$: e, values: t });
511
- class zt {
510
+ const It = { CHILD: 2 }, _t = (e) => (...t) => ({ _$litDirective$: e, values: t });
511
+ let bt = class {
512
512
  constructor(t) {
513
513
  }
514
514
  get _$AU() {
@@ -523,28 +523,28 @@ class zt {
523
523
  update(t, s) {
524
524
  return this.render(...s);
525
525
  }
526
- }
527
- const { I: It } = Nt, ht = () => document.createComment(""), D = (e, t, s) => {
526
+ };
527
+ const { I: Lt } = jt, ht = () => document.createComment(""), D = (e, t, s) => {
528
528
  const i = e._$AA.parentNode, r = t === void 0 ? e._$AB : t._$AA;
529
529
  if (s === void 0) {
530
530
  const o = i.insertBefore(ht(), r), n = i.insertBefore(ht(), r);
531
- s = new It(o, n, e, e.options);
531
+ s = new Lt(o, n, e, e.options);
532
532
  } else {
533
- const o = s._$AB.nextSibling, n = s._$AM, a = n !== e;
534
- if (a) {
533
+ const o = s._$AB.nextSibling, n = s._$AM, h = n !== e;
534
+ if (h) {
535
535
  let l;
536
536
  s._$AQ?.(e), s._$AM = e, s._$AP !== void 0 && (l = e._$AU) !== n._$AU && s._$AP(l);
537
537
  }
538
- if (o !== r || a) {
538
+ if (o !== r || h) {
539
539
  let l = s._$AA;
540
540
  for (; l !== o; ) {
541
- const d = l.nextSibling;
542
- i.insertBefore(l, r), l = d;
541
+ const c = l.nextSibling;
542
+ i.insertBefore(l, r), l = c;
543
543
  }
544
544
  }
545
545
  }
546
546
  return s;
547
- }, A = (e, t, s = e) => (e._$AI(t, s), e), Lt = {}, Wt = (e, t = Lt) => e._$AH = t, Zt = (e) => e._$AH, I = (e) => {
547
+ }, A = (e, t, s = e) => (e._$AI(t, s), e), Wt = {}, gt = (e, t = Wt) => e._$AH = t, Kt = (e) => e._$AH, I = (e) => {
548
548
  e._$AP?.(!1, !0);
549
549
  let t = e._$AA;
550
550
  const s = e._$AB.nextSibling;
@@ -557,50 +557,61 @@ const ct = (e, t, s) => {
557
557
  const i = /* @__PURE__ */ new Map();
558
558
  for (let r = t; r <= s; r++) i.set(e[r], r);
559
559
  return i;
560
- }, dt = Bt(class extends zt {
560
+ }, dt = _t(class extends bt {
561
561
  constructor(e) {
562
- if (super(e), e.type !== qt.CHILD) throw Error("repeat() can only be used in text expressions");
562
+ if (super(e), e.type !== It.CHILD) throw Error("repeat() can only be used in text expressions");
563
563
  }
564
564
  dt(e, t, s) {
565
565
  let i;
566
566
  s === void 0 ? s = t : t !== void 0 && (i = t);
567
567
  const r = [], o = [];
568
568
  let n = 0;
569
- for (const a of e) r[n] = i ? i(a, n) : n, o[n] = s(a, n), n++;
569
+ for (const h of e) r[n] = i ? i(h, n) : n, o[n] = s(h, n), n++;
570
570
  return { values: o, keys: r };
571
571
  }
572
572
  render(e, t, s) {
573
573
  return this.dt(e, t, s).values;
574
574
  }
575
575
  update(e, [t, s, i]) {
576
- const r = Zt(e), { values: o, keys: n } = this.dt(t, s, i);
576
+ const r = Kt(e), { values: o, keys: n } = this.dt(t, s, i);
577
577
  if (!Array.isArray(r)) return this.ut = n, o;
578
- const a = this.ut ??= [], l = [];
579
- let d, m, h = 0, u = r.length - 1, c = 0, $ = o.length - 1;
580
- for (; h <= u && c <= $; ) if (r[h] === null) h++;
578
+ const h = this.ut ??= [], l = [];
579
+ let c, m, a = 0, u = r.length - 1, d = 0, $ = o.length - 1;
580
+ for (; a <= u && d <= $; ) if (r[a] === null) a++;
581
581
  else if (r[u] === null) u--;
582
- else if (a[h] === n[c]) l[c] = A(r[h], o[c]), h++, c++;
583
- else if (a[u] === n[$]) l[$] = A(r[u], o[$]), u--, $--;
584
- else if (a[h] === n[$]) l[$] = A(r[h], o[$]), D(e, l[$ + 1], r[h]), h++, $--;
585
- else if (a[u] === n[c]) l[c] = A(r[u], o[c]), D(e, r[h], r[u]), u--, c++;
586
- else if (d === void 0 && (d = ct(n, c, $), m = ct(a, h, u)), d.has(a[h])) if (d.has(a[u])) {
587
- const _ = m.get(n[c]), B = _ !== void 0 ? r[_] : null;
588
- if (B === null) {
589
- const X = D(e, r[h]);
590
- A(X, o[c]), l[c] = X;
591
- } else l[c] = A(B, o[c]), D(e, r[h], B), r[_] = null;
592
- c++;
582
+ else if (h[a] === n[d]) l[d] = A(r[a], o[d]), a++, d++;
583
+ else if (h[u] === n[$]) l[$] = A(r[u], o[$]), u--, $--;
584
+ else if (h[a] === n[$]) l[$] = A(r[a], o[$]), D(e, l[$ + 1], r[a]), a++, $--;
585
+ else if (h[u] === n[d]) l[d] = A(r[u], o[d]), D(e, r[a], r[u]), u--, d++;
586
+ else if (c === void 0 && (c = ct(n, d, $), m = ct(h, a, u)), c.has(h[a])) if (c.has(h[u])) {
587
+ const b = m.get(n[d]), q = b !== void 0 ? r[b] : null;
588
+ if (q === null) {
589
+ const X = D(e, r[a]);
590
+ A(X, o[d]), l[d] = X;
591
+ } else l[d] = A(q, o[d]), D(e, r[a], q), r[b] = null;
592
+ d++;
593
593
  } else I(r[u]), u--;
594
- else I(r[h]), h++;
595
- for (; c <= $; ) {
596
- const _ = D(e, l[$ + 1]);
597
- A(_, o[c]), l[c++] = _;
594
+ else I(r[a]), a++;
595
+ for (; d <= $; ) {
596
+ const b = D(e, l[$ + 1]);
597
+ A(b, o[d]), l[d++] = b;
598
598
  }
599
- for (; h <= u; ) {
600
- const _ = r[h++];
601
- _ !== null && I(_);
599
+ for (; a <= u; ) {
600
+ const b = r[a++];
601
+ b !== null && I(b);
602
602
  }
603
- return this.ut = n, Wt(e, l), S;
603
+ return this.ut = n, gt(e, l), E;
604
+ }
605
+ });
606
+ const Zt = _t(class extends bt {
607
+ constructor() {
608
+ super(...arguments), this.key = p;
609
+ }
610
+ render(e, t) {
611
+ return this.key = e, t;
612
+ }
613
+ update(e, [t, s]) {
614
+ return t !== this.key && (gt(e), this.key = t), s;
604
615
  }
605
616
  });
606
617
  const Jt = (e) => (t, s) => {
@@ -608,53 +619,53 @@ const Jt = (e) => (t, s) => {
608
619
  customElements.define(e, t);
609
620
  })) : customElements.define(e, t);
610
621
  };
611
- const Kt = { attribute: !0, type: String, converter: N, reflect: !1, hasChanged: Z }, Qt = (e = Kt, t, s) => {
622
+ const Qt = { attribute: !0, type: String, converter: V, reflect: !1, hasChanged: K }, Gt = (e = Qt, t, s) => {
612
623
  const { kind: i, metadata: r } = s;
613
624
  let o = globalThis.litPropertyMetadata.get(r);
614
625
  if (o === void 0 && globalThis.litPropertyMetadata.set(r, o = /* @__PURE__ */ new Map()), i === "setter" && ((e = Object.create(e)).wrapped = !0), o.set(s.name, e), i === "accessor") {
615
626
  const { name: n } = s;
616
- return { set(a) {
627
+ return { set(h) {
617
628
  const l = t.get.call(this);
618
- t.set.call(this, a), this.requestUpdate(n, l, e);
619
- }, init(a) {
620
- return a !== void 0 && this.C(n, void 0, e, a), a;
629
+ t.set.call(this, h), this.requestUpdate(n, l, e);
630
+ }, init(h) {
631
+ return h !== void 0 && this.C(n, void 0, e, h), h;
621
632
  } };
622
633
  }
623
634
  if (i === "setter") {
624
635
  const { name: n } = s;
625
- return function(a) {
636
+ return function(h) {
626
637
  const l = this[n];
627
- t.call(this, a), this.requestUpdate(n, l, e);
638
+ t.call(this, h), this.requestUpdate(n, l, e);
628
639
  };
629
640
  }
630
641
  throw Error("Unsupported decorator location: " + i);
631
642
  };
632
643
  function G(e) {
633
- return (t, s) => typeof s == "object" ? Qt(e, t, s) : ((i, r, o) => {
644
+ return (t, s) => typeof s == "object" ? Gt(e, t, s) : ((i, r, o) => {
634
645
  const n = r.hasOwnProperty(o);
635
646
  return r.constructor.createProperty(o, i), n ? Object.getOwnPropertyDescriptor(r, o) : void 0;
636
647
  })(e, t, s);
637
648
  }
638
- function q(e) {
649
+ function F(e) {
639
650
  return G({ ...e, state: !0, attribute: !1 });
640
651
  }
641
- const Gt = (e, t, s) => (s.configurable = !0, s.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(e, t, s), s);
642
- function Xt(e, t) {
652
+ const Xt = (e, t, s) => (s.configurable = !0, s.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(e, t, s), s);
653
+ function Yt(e, t) {
643
654
  return (s, i, r) => {
644
655
  const o = (n) => n.renderRoot?.querySelector(e) ?? null;
645
- return Gt(s, i, { get() {
656
+ return Xt(s, i, { get() {
646
657
  return o(this);
647
658
  } });
648
659
  };
649
660
  }
650
- var Yt = Object.defineProperty, te = Object.getOwnPropertyDescriptor, y = (e, t, s, i) => {
651
- for (var r = i > 1 ? void 0 : i ? te(t, s) : t, o = e.length - 1, n; o >= 0; o--)
661
+ var te = Object.defineProperty, ee = Object.getOwnPropertyDescriptor, g = (e, t, s, i) => {
662
+ for (var r = i > 1 ? void 0 : i ? ee(t, s) : t, o = e.length - 1, n; o >= 0; o--)
652
663
  (n = e[o]) && (r = (i ? n(t, s, r) : n(r)) || r);
653
- return i && r && Yt(t, s, r), r;
664
+ return i && r && te(t, s, r), r;
654
665
  };
655
- let b = class extends U {
666
+ let _ = class extends U {
656
667
  constructor() {
657
- super(...arguments), this.dialogOpen = !1, this.version = "1.0.12";
668
+ super(...arguments), this.dialogOpen = !1, this.formKey = 0, this.version = "1.0.14";
658
669
  }
659
670
  update(e) {
660
671
  e.has("theme") && this.registerTheme(this.theme), super.update(e);
@@ -671,27 +682,28 @@ let b = class extends U {
671
682
  }
672
683
  handleFormSubmit(e) {
673
684
  e.preventDefault();
674
- const s = e.submitter?.getAttribute("value") ?? "submit", i = e.target, r = new FormData(i), o = Object.fromEntries(r.entries()), n = this.inputData?.formFields?.map((a, l) => ({
675
- swarm_app_databackend_key: a.targetColumn?.swarm_app_databackend_key,
676
- table_name: a.targetColumn?.tablename,
677
- column_name: a.targetColumn?.column,
678
- value: this.formatValue(
679
- o[`column-${l}`] || a.defaultValue || "",
680
- a.type ?? "textfield"
681
- )
682
- }));
683
- this.inputData?.deleteFlagColumn && n?.push({
685
+ const s = e.submitter?.getAttribute("value") ?? "submit", i = e.target, r = new FormData(i), o = this.inputData?.formFields?.map((n, h) => {
686
+ const l = `column-${h}`;
687
+ let c;
688
+ return n.hiddenField ? c = n.preFilledValue ?? n.defaultValue ?? "" : n.type === "checkbox" ? c = r.has(l) ? "on" : "off" : c = r.get(l) ?? n.defaultValue ?? "", {
689
+ swarm_app_databackend_key: n.targetColumn?.swarm_app_databackend_key,
690
+ table_name: n.targetColumn?.tablename,
691
+ column_name: n.targetColumn?.column,
692
+ value: this.formatValue(c, n.type ?? "textfield")
693
+ };
694
+ });
695
+ this.inputData?.deleteFlagColumn && o?.push({
684
696
  swarm_app_databackend_key: this.inputData?.deleteFlagColumn?.swarm_app_databackend_key,
685
697
  table_name: this.inputData?.deleteFlagColumn?.tablename,
686
698
  column_name: this.inputData?.deleteFlagColumn?.column,
687
699
  value: s === "delete"
688
700
  }), this.dispatchEvent(
689
701
  new CustomEvent("data-submit", {
690
- detail: n,
702
+ detail: o,
691
703
  bubbles: !1,
692
704
  composed: !1
693
705
  })
694
- ), i.reset(), this.dialogOpen = !1;
706
+ ), this.resetForm(), this.dialogOpen = !1;
695
707
  }
696
708
  formatValue(e, t) {
697
709
  switch (t) {
@@ -802,20 +814,7 @@ let b = class extends U {
802
814
  `;
803
815
  }
804
816
  resetForm() {
805
- const e = this.shadowRoot?.querySelector("#form");
806
- e && this.inputData?.formFields?.forEach((t, s) => {
807
- const i = `column-${s}`;
808
- if (t.type === "checkbox") {
809
- const r = e.querySelector(`md-checkbox[name="${i}"]`);
810
- r && (r.checked = t.preFilledValue === "true");
811
- } else if (t.type === "dropdown") {
812
- const r = e.querySelector(`md-outlined-select[name="${i}"]`);
813
- r && (r.value = t.preFilledValue ?? "");
814
- } else {
815
- const r = e.querySelector(`md-outlined-text-field[name="${i}"]`);
816
- r && (r.value = t.preFilledValue ?? "");
817
- }
818
- });
817
+ this.formKey++;
819
818
  }
820
819
  cancelEdit(e) {
821
820
  this.resetForm(), this.dialogOpen = !1;
@@ -903,39 +902,43 @@ let b = class extends U {
903
902
  `;
904
903
  }
905
904
  renderForm() {
906
- return f`
907
- <form
908
- id="form"
909
- slot="content"
910
- method="dialog"
911
- class="form-content"
912
- @submit=${this.handleFormSubmit}
913
- >
914
- ${dt(
915
- this.inputData?.formFields?.filter((e) => !e.hiddenField) ?? [],
916
- (e, t) => t,
917
- (e, t) => {
918
- switch (e.type) {
919
- case "textfield":
920
- return this.renderTextField(e, t);
921
- case "numberfield":
922
- return this.renderNumberField(e, t);
923
- case "datetime":
924
- return this.renderDateTimeField(e, t);
925
- case "textarea":
926
- return this.renderTextArea(e, t);
927
- case "dropdown":
928
- return this.renderDropdown(e, t);
929
- case "checkbox":
930
- return this.renderCheckbox(e, t);
905
+ return Zt(
906
+ this.formKey,
907
+ f`
908
+ <form
909
+ id="form"
910
+ slot="content"
911
+ method="dialog"
912
+ class="form-content"
913
+ @submit=${this.handleFormSubmit}
914
+ >
915
+ ${dt(
916
+ this.inputData?.formFields ?? [],
917
+ (e, t) => t,
918
+ (e, t) => {
919
+ if (e.hiddenField) return p;
920
+ switch (e.type) {
921
+ case "textfield":
922
+ return this.renderTextField(e, t);
923
+ case "numberfield":
924
+ return this.renderNumberField(e, t);
925
+ case "datetime":
926
+ return this.renderDateTimeField(e, t);
927
+ case "textarea":
928
+ return this.renderTextArea(e, t);
929
+ case "dropdown":
930
+ return this.renderDropdown(e, t);
931
+ case "checkbox":
932
+ return this.renderCheckbox(e, t);
933
+ }
931
934
  }
932
- }
933
- )}
934
- </form>
935
- `;
935
+ )}
936
+ </form>
937
+ `
938
+ );
936
939
  }
937
940
  };
938
- b.styles = _t`
941
+ _.styles = vt`
939
942
  :host {
940
943
  display: flex;
941
944
  flex-direction: column;
@@ -1058,31 +1061,34 @@ b.styles = _t`
1058
1061
  --md-filled-button-pressed-label-text-color: #fff;
1059
1062
  }
1060
1063
  `;
1061
- y([
1064
+ g([
1062
1065
  G({ type: Object })
1063
- ], b.prototype, "inputData", 2);
1064
- y([
1066
+ ], _.prototype, "inputData", 2);
1067
+ g([
1065
1068
  G({ type: Object })
1066
- ], b.prototype, "theme", 2);
1067
- y([
1068
- q()
1069
- ], b.prototype, "themeBgColor", 2);
1070
- y([
1071
- q()
1072
- ], b.prototype, "themeTitleColor", 2);
1073
- y([
1074
- q()
1075
- ], b.prototype, "themeSubtitleColor", 2);
1076
- y([
1077
- q()
1078
- ], b.prototype, "dialogOpen", 2);
1079
- y([
1080
- Xt("md-dialog")
1081
- ], b.prototype, "dialog", 2);
1082
- b = y([
1083
- Jt("widget-form-1.0.12")
1084
- ], b);
1069
+ ], _.prototype, "theme", 2);
1070
+ g([
1071
+ F()
1072
+ ], _.prototype, "themeBgColor", 2);
1073
+ g([
1074
+ F()
1075
+ ], _.prototype, "themeTitleColor", 2);
1076
+ g([
1077
+ F()
1078
+ ], _.prototype, "themeSubtitleColor", 2);
1079
+ g([
1080
+ F()
1081
+ ], _.prototype, "dialogOpen", 2);
1082
+ g([
1083
+ Yt("md-dialog")
1084
+ ], _.prototype, "dialog", 2);
1085
+ g([
1086
+ F()
1087
+ ], _.prototype, "formKey", 2);
1088
+ _ = g([
1089
+ Jt("widget-form-1.0.14")
1090
+ ], _);
1085
1091
  export {
1086
- b as WidgetForm
1092
+ _ as WidgetForm
1087
1093
  };
1088
1094
  //# sourceMappingURL=widget-form.js.map