drill-widgets 2.7.5 → 2.7.7
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/drill-widgets.es.js +341 -288
- package/dist/drill-widgets.umd.js +183 -153
- package/dist/lib.d.ts +5 -1
- package/package.json +1 -1
package/dist/drill-widgets.es.js
CHANGED
|
@@ -75,7 +75,7 @@ const { is: We, defineProperty: He, getOwnPropertyDescriptor: Ve, getOwnProperty
|
|
|
75
75
|
return t;
|
|
76
76
|
} }, fe = (i, e) => !We(i, e), Se = { attribute: !0, type: String, converter: K, reflect: !1, useDefault: !1, hasChanged: fe };
|
|
77
77
|
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), A.litPropertyMetadata ?? (A.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
78
|
-
let
|
|
78
|
+
let U = class extends HTMLElement {
|
|
79
79
|
static addInitializer(e) {
|
|
80
80
|
this._$Ei(), (this.l ?? (this.l = [])).push(e);
|
|
81
81
|
}
|
|
@@ -192,8 +192,8 @@ let I = class extends HTMLElement {
|
|
|
192
192
|
var r, o;
|
|
193
193
|
const n = this.constructor, s = n._$Eh.get(e);
|
|
194
194
|
if (s !== void 0 && this._$Em !== s) {
|
|
195
|
-
const a = n.getPropertyOptions(s),
|
|
196
|
-
this._$Em = s, this[s] =
|
|
195
|
+
const a = n.getPropertyOptions(s), l = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((r = a.converter) == null ? void 0 : r.fromAttribute) !== void 0 ? a.converter : K;
|
|
196
|
+
this._$Em = s, this[s] = l.fromAttribute(t, a.type) ?? ((o = this._$Ej) == null ? void 0 : o.get(s)) ?? null, this._$Em = null;
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
requestUpdate(e, t, n) {
|
|
@@ -231,8 +231,8 @@ let I = class extends HTMLElement {
|
|
|
231
231
|
}
|
|
232
232
|
const s = this.constructor.elementProperties;
|
|
233
233
|
if (s.size > 0) for (const [r, o] of s) {
|
|
234
|
-
const { wrapped: a } = o,
|
|
235
|
-
a !== !0 || this._$AL.has(r) ||
|
|
234
|
+
const { wrapped: a } = o, l = this[r];
|
|
235
|
+
a !== !0 || this._$AL.has(r) || l === void 0 || this.C(r, void 0, o, l);
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
let e = !1;
|
|
@@ -276,15 +276,15 @@ let I = class extends HTMLElement {
|
|
|
276
276
|
firstUpdated(e) {
|
|
277
277
|
}
|
|
278
278
|
};
|
|
279
|
-
|
|
279
|
+
U.elementStyles = [], U.shadowRootOptions = { mode: "open" }, U[W("elementProperties")] = /* @__PURE__ */ new Map(), U[W("finalized")] = /* @__PURE__ */ new Map(), ne == null || ne({ ReactiveElement: U }), (A.reactiveElementVersions ?? (A.reactiveElementVersions = [])).push("2.1.0");
|
|
280
280
|
/**
|
|
281
281
|
* @license
|
|
282
282
|
* Copyright 2017 Google LLC
|
|
283
283
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
284
284
|
*/
|
|
285
|
-
const H = globalThis, J = H.trustedTypes, ye = J ? J.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, ze = "$lit$", E = `lit$${Math.random().toFixed(9).slice(2)}$`,
|
|
285
|
+
const H = globalThis, J = H.trustedTypes, ye = J ? J.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, ze = "$lit$", E = `lit$${Math.random().toFixed(9).slice(2)}$`, Ie = "?" + E, Ye = `<${Ie}>`, z = document, V = () => z.createComment(""), j = (i) => i === null || typeof i != "object" && typeof i != "function", me = Array.isArray, qe = (i) => me(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", se = `[
|
|
286
286
|
\f\r]`, O = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, we = /-->/g, ke = />/g, M = RegExp(`>|${se}(?:([^\\s"'>=/]+)(${se}*=${se}*(?:[^
|
|
287
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), $e = /'/g, De = /"/g,
|
|
287
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), $e = /'/g, De = /"/g, Ue = /^(?:script|style|textarea|title)$/i, Ke = (i) => (e, ...t) => ({ _$litType$: i, strings: e, values: t }), d = Ke(1), I = Symbol.for("lit-noChange"), v = Symbol.for("lit-nothing"), Ce = /* @__PURE__ */ new WeakMap(), F = z.createTreeWalker(z, 129);
|
|
288
288
|
function Pe(i, e) {
|
|
289
289
|
if (!me(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
290
290
|
return ye !== void 0 ? ye.createHTML(e) : e;
|
|
@@ -293,11 +293,11 @@ const Je = (i, e) => {
|
|
|
293
293
|
const t = i.length - 1, n = [];
|
|
294
294
|
let s, r = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", o = O;
|
|
295
295
|
for (let a = 0; a < t; a++) {
|
|
296
|
-
const
|
|
296
|
+
const l = i[a];
|
|
297
297
|
let p, c, u = -1, h = 0;
|
|
298
|
-
for (; h <
|
|
298
|
+
for (; h < l.length && (o.lastIndex = h, c = o.exec(l), c !== null); ) h = o.lastIndex, o === O ? c[1] === "!--" ? o = we : c[1] !== void 0 ? o = ke : c[2] !== void 0 ? (Ue.test(c[2]) && (s = RegExp("</" + c[2], "g")), o = M) : c[3] !== void 0 && (o = M) : o === M ? c[0] === ">" ? (o = s ?? O, u = -1) : c[1] === void 0 ? u = -2 : (u = o.lastIndex - c[2].length, p = c[1], o = c[3] === void 0 ? M : c[3] === '"' ? De : $e) : o === De || o === $e ? o = M : o === we || o === ke ? o = O : (o = M, s = void 0);
|
|
299
299
|
const g = o === M && i[a + 1].startsWith("/>") ? " " : "";
|
|
300
|
-
r += o === O ?
|
|
300
|
+
r += o === O ? l + Ye : u >= 0 ? (n.push(p), l.slice(0, u) + ze + l.slice(u) + E + g) : l + E + (u === -2 ? a : g);
|
|
301
301
|
}
|
|
302
302
|
return [Pe(i, r + (i[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), n];
|
|
303
303
|
};
|
|
@@ -306,29 +306,29 @@ class Q {
|
|
|
306
306
|
let s;
|
|
307
307
|
this.parts = [];
|
|
308
308
|
let r = 0, o = 0;
|
|
309
|
-
const a = e.length - 1,
|
|
309
|
+
const a = e.length - 1, l = this.parts, [p, c] = Je(e, t);
|
|
310
310
|
if (this.el = Q.createElement(p, n), F.currentNode = this.el.content, t === 2 || t === 3) {
|
|
311
311
|
const u = this.el.content.firstChild;
|
|
312
312
|
u.replaceWith(...u.childNodes);
|
|
313
313
|
}
|
|
314
|
-
for (; (s = F.nextNode()) !== null &&
|
|
314
|
+
for (; (s = F.nextNode()) !== null && l.length < a; ) {
|
|
315
315
|
if (s.nodeType === 1) {
|
|
316
316
|
if (s.hasAttributes()) for (const u of s.getAttributeNames()) if (u.endsWith(ze)) {
|
|
317
317
|
const h = c[o++], g = s.getAttribute(u).split(E), b = /([.?@])?(.*)/.exec(h);
|
|
318
|
-
|
|
319
|
-
} else u.startsWith(E) && (
|
|
320
|
-
if (
|
|
318
|
+
l.push({ type: 1, index: r, name: b[2], strings: g, ctor: b[1] === "." ? Ze : b[1] === "?" ? et : b[1] === "@" ? tt : ie }), s.removeAttribute(u);
|
|
319
|
+
} else u.startsWith(E) && (l.push({ type: 6, index: r }), s.removeAttribute(u));
|
|
320
|
+
if (Ue.test(s.tagName)) {
|
|
321
321
|
const u = s.textContent.split(E), h = u.length - 1;
|
|
322
322
|
if (h > 0) {
|
|
323
323
|
s.textContent = J ? J.emptyScript : "";
|
|
324
|
-
for (let g = 0; g < h; g++) s.append(u[g], V()), F.nextNode(),
|
|
324
|
+
for (let g = 0; g < h; g++) s.append(u[g], V()), F.nextNode(), l.push({ type: 2, index: ++r });
|
|
325
325
|
s.append(u[h], V());
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
} else if (s.nodeType === 8) if (s.data ===
|
|
328
|
+
} else if (s.nodeType === 8) if (s.data === Ie) l.push({ type: 2, index: r });
|
|
329
329
|
else {
|
|
330
330
|
let u = -1;
|
|
331
|
-
for (; (u = s.data.indexOf(E, u + 1)) !== -1; )
|
|
331
|
+
for (; (u = s.data.indexOf(E, u + 1)) !== -1; ) l.push({ type: 7, index: r }), u += E.length - 1;
|
|
332
332
|
}
|
|
333
333
|
r++;
|
|
334
334
|
}
|
|
@@ -340,7 +340,7 @@ class Q {
|
|
|
340
340
|
}
|
|
341
341
|
function L(i, e, t = i, n) {
|
|
342
342
|
var o, a;
|
|
343
|
-
if (e ===
|
|
343
|
+
if (e === I) return e;
|
|
344
344
|
let s = n !== void 0 ? (o = t._$Co) == null ? void 0 : o[n] : t._$Cl;
|
|
345
345
|
const r = j(e) ? void 0 : e._$litDirective$;
|
|
346
346
|
return (s == null ? void 0 : s.constructor) !== r && ((a = s == null ? void 0 : s._$AO) == null || a.call(s, !1), r === void 0 ? s = void 0 : (s = new r(i), s._$AT(i, t, n)), n !== void 0 ? (t._$Co ?? (t._$Co = []))[n] = s : t._$Cl = s), s !== void 0 && (e = L(i, s._$AS(i, e.values), s, n)), e;
|
|
@@ -358,13 +358,13 @@ class Xe {
|
|
|
358
358
|
u(e) {
|
|
359
359
|
const { el: { content: t }, parts: n } = this._$AD, s = ((e == null ? void 0 : e.creationScope) ?? z).importNode(t, !0);
|
|
360
360
|
F.currentNode = s;
|
|
361
|
-
let r = F.nextNode(), o = 0, a = 0,
|
|
362
|
-
for (;
|
|
363
|
-
if (o ===
|
|
361
|
+
let r = F.nextNode(), o = 0, a = 0, l = n[0];
|
|
362
|
+
for (; l !== void 0; ) {
|
|
363
|
+
if (o === l.index) {
|
|
364
364
|
let p;
|
|
365
|
-
|
|
365
|
+
l.type === 2 ? p = new B(r, r.nextSibling, this, e) : l.type === 1 ? p = new l.ctor(r, l.name, l.strings, this, e) : l.type === 6 && (p = new it(r, this, e)), this._$AV.push(p), l = n[++a];
|
|
366
366
|
}
|
|
367
|
-
o !== (
|
|
367
|
+
o !== (l == null ? void 0 : l.index) && (r = F.nextNode(), o++);
|
|
368
368
|
}
|
|
369
369
|
return F.currentNode = z, s;
|
|
370
370
|
}
|
|
@@ -393,7 +393,7 @@ class B {
|
|
|
393
393
|
return this._$AB;
|
|
394
394
|
}
|
|
395
395
|
_$AI(e, t = this) {
|
|
396
|
-
e = L(this, e, t), j(e) ? e === v || e == null || e === "" ? (this._$AH !== v && this._$AR(), this._$AH = v) : e !== this._$AH && e !==
|
|
396
|
+
e = L(this, e, t), j(e) ? e === v || e == null || e === "" ? (this._$AH !== v && this._$AR(), this._$AH = v) : e !== this._$AH && e !== I && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : qe(e) ? this.k(e) : this._(e);
|
|
397
397
|
}
|
|
398
398
|
O(e) {
|
|
399
399
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -449,11 +449,11 @@ class ie {
|
|
|
449
449
|
_$AI(e, t = this, n, s) {
|
|
450
450
|
const r = this.strings;
|
|
451
451
|
let o = !1;
|
|
452
|
-
if (r === void 0) e = L(this, e, t, 0), o = !j(e) || e !== this._$AH && e !==
|
|
452
|
+
if (r === void 0) e = L(this, e, t, 0), o = !j(e) || e !== this._$AH && e !== I, o && (this._$AH = e);
|
|
453
453
|
else {
|
|
454
454
|
const a = e;
|
|
455
|
-
let
|
|
456
|
-
for (e = r[0],
|
|
455
|
+
let l, p;
|
|
456
|
+
for (e = r[0], l = 0; l < r.length - 1; l++) p = L(this, a[n + l], t, l), p === I && (p = this._$AH[l]), o || (o = !j(p) || p !== this._$AH[l]), p === v ? e = v : e !== v && (e += (p ?? "") + r[l + 1]), this._$AH[l] = p;
|
|
457
457
|
}
|
|
458
458
|
o && !s && this.j(e);
|
|
459
459
|
}
|
|
@@ -482,7 +482,7 @@ class tt extends ie {
|
|
|
482
482
|
super(e, t, n, s, r), this.type = 5;
|
|
483
483
|
}
|
|
484
484
|
_$AI(e, t = this) {
|
|
485
|
-
if ((e = L(this, e, t, 0) ?? v) ===
|
|
485
|
+
if ((e = L(this, e, t, 0) ?? v) === I) return;
|
|
486
486
|
const n = this._$AH, s = e === v && n !== v || e.capture !== n.capture || e.once !== n.once || e.passive !== n.passive, r = e !== v && (n === v || s);
|
|
487
487
|
s && this.element.removeEventListener(this.name, this, n), r && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
488
488
|
}
|
|
@@ -519,7 +519,7 @@ const nt = (i, e, t) => {
|
|
|
519
519
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
520
520
|
*/
|
|
521
521
|
const T = globalThis;
|
|
522
|
-
let P = class extends
|
|
522
|
+
let P = class extends U {
|
|
523
523
|
constructor() {
|
|
524
524
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
525
525
|
}
|
|
@@ -541,7 +541,7 @@ let P = class extends I {
|
|
|
541
541
|
super.disconnectedCallback(), (e = this._$Do) == null || e.setConnected(!1);
|
|
542
542
|
}
|
|
543
543
|
render() {
|
|
544
|
-
return
|
|
544
|
+
return I;
|
|
545
545
|
}
|
|
546
546
|
};
|
|
547
547
|
var Fe;
|
|
@@ -570,8 +570,8 @@ const st = { attribute: !0, type: String, converter: K, reflect: !1, hasChanged:
|
|
|
570
570
|
if (r === void 0 && globalThis.litPropertyMetadata.set(s, r = /* @__PURE__ */ new Map()), n === "setter" && ((i = Object.create(i)).wrapped = !0), r.set(t.name, i), n === "accessor") {
|
|
571
571
|
const { name: o } = t;
|
|
572
572
|
return { set(a) {
|
|
573
|
-
const
|
|
574
|
-
e.set.call(this, a), this.requestUpdate(o,
|
|
573
|
+
const l = e.get.call(this);
|
|
574
|
+
e.set.call(this, a), this.requestUpdate(o, l, i);
|
|
575
575
|
}, init(a) {
|
|
576
576
|
return a !== void 0 && this.C(o, void 0, i, a), a;
|
|
577
577
|
} };
|
|
@@ -579,8 +579,8 @@ const st = { attribute: !0, type: String, converter: K, reflect: !1, hasChanged:
|
|
|
579
579
|
if (n === "setter") {
|
|
580
580
|
const { name: o } = t;
|
|
581
581
|
return function(a) {
|
|
582
|
-
const
|
|
583
|
-
e.call(this, a), this.requestUpdate(o,
|
|
582
|
+
const l = this[o];
|
|
583
|
+
e.call(this, a), this.requestUpdate(o, l, i);
|
|
584
584
|
};
|
|
585
585
|
}
|
|
586
586
|
throw Error("Unsupported decorator location: " + n);
|
|
@@ -607,7 +607,7 @@ function ot(i, e = 0) {
|
|
|
607
607
|
}
|
|
608
608
|
let ae;
|
|
609
609
|
const at = new Uint8Array(16);
|
|
610
|
-
function
|
|
610
|
+
function lt() {
|
|
611
611
|
if (!ae) {
|
|
612
612
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
613
613
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
@@ -615,13 +615,13 @@ function dt() {
|
|
|
615
615
|
}
|
|
616
616
|
return ae(at);
|
|
617
617
|
}
|
|
618
|
-
const
|
|
619
|
-
function
|
|
618
|
+
const dt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ee = { randomUUID: dt };
|
|
619
|
+
function le(i, e, t) {
|
|
620
620
|
var s;
|
|
621
621
|
if (Ee.randomUUID && !i)
|
|
622
622
|
return Ee.randomUUID();
|
|
623
623
|
i = i || {};
|
|
624
|
-
const n = i.random ?? ((s = i.rng) == null ? void 0 : s.call(i)) ??
|
|
624
|
+
const n = i.random ?? ((s = i.rng) == null ? void 0 : s.call(i)) ?? lt();
|
|
625
625
|
if (n.length < 16)
|
|
626
626
|
throw new Error("Random bytes length must be >= 16");
|
|
627
627
|
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, ot(n);
|
|
@@ -3107,7 +3107,11 @@ let w = class extends P {
|
|
|
3107
3107
|
}, this._draggedStepId = null, this._dragOverStepId = null, this._selectedStepId = null, this._questions = [];
|
|
3108
3108
|
}
|
|
3109
3109
|
connectedCallback() {
|
|
3110
|
-
super.connectedCallback(), this._templateData = this._getDefaultWorkflowData();
|
|
3110
|
+
super.connectedCallback(), this.workflow ? (this._templateData = { ...this.workflow }, this.workflow.steps && this.workflow.steps.length > 0 && (this._selectedStepId = this.workflow.steps[0].id), console.log("Builder loaded with existing workflow:", this.workflow.name)) : this._templateData = this._getDefaultWorkflowData();
|
|
3111
|
+
}
|
|
3112
|
+
// Detect changes to the workflow property
|
|
3113
|
+
updated(i) {
|
|
3114
|
+
i.has("workflow") && this.workflow && (this._templateData = { ...this.workflow }, this.workflow.steps && this.workflow.steps.length > 0 && (this._selectedStepId = this.workflow.steps[0].id), console.log("Workflow property changed, reloading template data"));
|
|
3111
3115
|
}
|
|
3112
3116
|
_getDefaultWorkflowData() {
|
|
3113
3117
|
const i = {
|
|
@@ -3123,7 +3127,7 @@ let w = class extends P {
|
|
|
3123
3127
|
status: "pending"
|
|
3124
3128
|
};
|
|
3125
3129
|
return {
|
|
3126
|
-
id:
|
|
3130
|
+
id: le(),
|
|
3127
3131
|
name: "",
|
|
3128
3132
|
description: "",
|
|
3129
3133
|
steps: [i]
|
|
@@ -3148,15 +3152,15 @@ let w = class extends P {
|
|
|
3148
3152
|
console.log("🚫 Builder Widget: Cancel button clicked"), (i = this.onCancel) == null || i.call(this);
|
|
3149
3153
|
}
|
|
3150
3154
|
_handleSave() {
|
|
3151
|
-
var i, e;
|
|
3155
|
+
var i, e, t;
|
|
3152
3156
|
if ((i = this._templateData.name) != null && i.trim()) {
|
|
3153
|
-
const
|
|
3154
|
-
id: this._templateData.id ||
|
|
3157
|
+
const n = {
|
|
3158
|
+
id: this._templateData.id || le(),
|
|
3155
3159
|
name: this._templateData.name,
|
|
3156
3160
|
description: this._templateData.description || "",
|
|
3157
3161
|
steps: this._templateData.steps || []
|
|
3158
3162
|
};
|
|
3159
|
-
console.log("💾 Builder Widget: Save button clicked"), console.log("📄 Workflow Template:", JSON.stringify(
|
|
3163
|
+
console.log("💾 Builder Widget: Save button clicked"), console.log("📄 Workflow Template:", JSON.stringify(n, null, 2)), this.workflow ? (console.log("Calling onWorkflowUpdated callback"), (e = this.onWorkflowUpdated) == null || e.call(this, n)) : (console.log("Calling onWorkflowCreated callback"), (t = this.onWorkflowCreated) == null || t.call(this, n));
|
|
3160
3164
|
} else
|
|
3161
3165
|
console.log("⚠️ Builder Widget: Save attempted but no title provided");
|
|
3162
3166
|
}
|
|
@@ -3186,7 +3190,7 @@ let w = class extends P {
|
|
|
3186
3190
|
return;
|
|
3187
3191
|
}
|
|
3188
3192
|
const i = this._templateData.steps || [], e = {
|
|
3189
|
-
id:
|
|
3193
|
+
id: le(),
|
|
3190
3194
|
title: this._stepFormData.title.trim(),
|
|
3191
3195
|
description: ((n = this._stepFormData.description) == null ? void 0 : n.trim()) || "",
|
|
3192
3196
|
order: i.length + 1,
|
|
@@ -3236,14 +3240,14 @@ let w = class extends P {
|
|
|
3236
3240
|
}
|
|
3237
3241
|
console.log(
|
|
3238
3242
|
"🔄 Before reorder:",
|
|
3239
|
-
t.map((a,
|
|
3243
|
+
t.map((a, l) => `${l + 1}: ${a.title}`)
|
|
3240
3244
|
);
|
|
3241
3245
|
const r = [...t], [o] = r.splice(n, 1);
|
|
3242
|
-
r.splice(s, 0, o), r.forEach((a,
|
|
3243
|
-
a.order =
|
|
3246
|
+
r.splice(s, 0, o), r.forEach((a, l) => {
|
|
3247
|
+
a.order = l + 1;
|
|
3244
3248
|
}), console.log(
|
|
3245
3249
|
"🔄 After reorder:",
|
|
3246
|
-
r.map((a,
|
|
3250
|
+
r.map((a, l) => `${l + 1}: ${a.title}`)
|
|
3247
3251
|
), this._templateData = {
|
|
3248
3252
|
...this._templateData,
|
|
3249
3253
|
steps: r
|
|
@@ -3414,12 +3418,12 @@ Use **bold** and *italic* text.`;
|
|
|
3414
3418
|
switch (i.type) {
|
|
3415
3419
|
case "select":
|
|
3416
3420
|
case "radio":
|
|
3417
|
-
return
|
|
3421
|
+
return d`
|
|
3418
3422
|
<div class="question-options-section">
|
|
3419
3423
|
<label class="options-label">Options:</label>
|
|
3420
3424
|
<div class="options-list">
|
|
3421
3425
|
${(i.options || []).map(
|
|
3422
|
-
(e, t) =>
|
|
3426
|
+
(e, t) => d`
|
|
3423
3427
|
<div class="option-item">
|
|
3424
3428
|
<input
|
|
3425
3429
|
type="text"
|
|
@@ -3463,7 +3467,7 @@ Use **bold** and *italic* text.`;
|
|
|
3463
3467
|
</div>
|
|
3464
3468
|
`;
|
|
3465
3469
|
case "checkbox":
|
|
3466
|
-
return
|
|
3470
|
+
return d`
|
|
3467
3471
|
<div class="question-checkbox-config">
|
|
3468
3472
|
<div class="checkbox-type-selection">
|
|
3469
3473
|
<label class="checkbox-type-label">
|
|
@@ -3496,12 +3500,12 @@ Use **bold** and *italic* text.`;
|
|
|
3496
3500
|
</label>
|
|
3497
3501
|
</div>
|
|
3498
3502
|
|
|
3499
|
-
${i.options && i.options.length > 0 ?
|
|
3503
|
+
${i.options && i.options.length > 0 ? d`
|
|
3500
3504
|
<div class="question-options-section">
|
|
3501
3505
|
<label class="options-label">Checkbox Options:</label>
|
|
3502
3506
|
<div class="options-list">
|
|
3503
3507
|
${(i.options || []).map(
|
|
3504
|
-
(e, t) =>
|
|
3508
|
+
(e, t) => d`
|
|
3505
3509
|
<div class="option-item">
|
|
3506
3510
|
<input
|
|
3507
3511
|
type="text"
|
|
@@ -3543,7 +3547,7 @@ Use **bold** and *italic* text.`;
|
|
|
3543
3547
|
</button>
|
|
3544
3548
|
</div>
|
|
3545
3549
|
</div>
|
|
3546
|
-
` :
|
|
3550
|
+
` : d`
|
|
3547
3551
|
<div class="single-checkbox-info">
|
|
3548
3552
|
<p class="config-note">
|
|
3549
3553
|
Single checkbox - users can check/uncheck for Yes/No response
|
|
@@ -3553,7 +3557,7 @@ Use **bold** and *italic* text.`;
|
|
|
3553
3557
|
</div>
|
|
3554
3558
|
`;
|
|
3555
3559
|
case "textarea":
|
|
3556
|
-
return
|
|
3560
|
+
return d`
|
|
3557
3561
|
<div class="question-config-section">
|
|
3558
3562
|
<label class="config-label">
|
|
3559
3563
|
Placeholder:
|
|
@@ -3573,7 +3577,7 @@ Use **bold** and *italic* text.`;
|
|
|
3573
3577
|
</div>
|
|
3574
3578
|
`;
|
|
3575
3579
|
case "text_input":
|
|
3576
|
-
return
|
|
3580
|
+
return d`
|
|
3577
3581
|
<div class="question-config-section">
|
|
3578
3582
|
<label class="config-label">
|
|
3579
3583
|
Placeholder:
|
|
@@ -3593,7 +3597,7 @@ Use **bold** and *italic* text.`;
|
|
|
3593
3597
|
</div>
|
|
3594
3598
|
`;
|
|
3595
3599
|
case "number":
|
|
3596
|
-
return
|
|
3600
|
+
return d`
|
|
3597
3601
|
<div class="question-config-section">
|
|
3598
3602
|
<label class="config-label">
|
|
3599
3603
|
Placeholder:
|
|
@@ -3613,31 +3617,31 @@ Use **bold** and *italic* text.`;
|
|
|
3613
3617
|
</div>
|
|
3614
3618
|
`;
|
|
3615
3619
|
case "file_upload":
|
|
3616
|
-
return
|
|
3620
|
+
return d`
|
|
3617
3621
|
<div class="question-config-section">
|
|
3618
3622
|
<p class="config-note">File upload field - users can upload files</p>
|
|
3619
3623
|
</div>
|
|
3620
3624
|
`;
|
|
3621
3625
|
case "signature":
|
|
3622
|
-
return
|
|
3626
|
+
return d`
|
|
3623
3627
|
<div class="question-config-section">
|
|
3624
3628
|
<p class="config-note">Digital signature pad - users can sign with mouse/touch</p>
|
|
3625
3629
|
</div>
|
|
3626
3630
|
`;
|
|
3627
3631
|
case "date":
|
|
3628
|
-
return
|
|
3632
|
+
return d`
|
|
3629
3633
|
<div class="question-config-section">
|
|
3630
3634
|
<p class="config-note">Date picker field</p>
|
|
3631
3635
|
</div>
|
|
3632
3636
|
`;
|
|
3633
3637
|
default:
|
|
3634
|
-
return
|
|
3638
|
+
return d``;
|
|
3635
3639
|
}
|
|
3636
3640
|
}
|
|
3637
3641
|
_renderContentTypeSpecificFields(i) {
|
|
3638
3642
|
switch (i.type) {
|
|
3639
3643
|
case "text":
|
|
3640
|
-
return
|
|
3644
|
+
return d`
|
|
3641
3645
|
<div class="content-config-section">
|
|
3642
3646
|
<label class="config-label">
|
|
3643
3647
|
Text Content:
|
|
@@ -3656,7 +3660,7 @@ Use **bold** and *italic* text.`;
|
|
|
3656
3660
|
</div>
|
|
3657
3661
|
`;
|
|
3658
3662
|
case "html":
|
|
3659
|
-
return
|
|
3663
|
+
return d`
|
|
3660
3664
|
<div class="content-config-section">
|
|
3661
3665
|
<label class="config-label">
|
|
3662
3666
|
HTML Content:
|
|
@@ -3675,7 +3679,7 @@ Use **bold** and *italic* text.`;
|
|
|
3675
3679
|
</div>
|
|
3676
3680
|
`;
|
|
3677
3681
|
case "image":
|
|
3678
|
-
return
|
|
3682
|
+
return d`
|
|
3679
3683
|
<div class="content-config-section">
|
|
3680
3684
|
<label class="config-label">
|
|
3681
3685
|
Image URL:
|
|
@@ -3725,7 +3729,7 @@ Use **bold** and *italic* text.`;
|
|
|
3725
3729
|
</div>
|
|
3726
3730
|
`;
|
|
3727
3731
|
case "video":
|
|
3728
|
-
return
|
|
3732
|
+
return d`
|
|
3729
3733
|
<div class="content-config-section">
|
|
3730
3734
|
<label class="config-label">
|
|
3731
3735
|
Video URL:
|
|
@@ -3760,7 +3764,7 @@ Use **bold** and *italic* text.`;
|
|
|
3760
3764
|
</div>
|
|
3761
3765
|
`;
|
|
3762
3766
|
case "file":
|
|
3763
|
-
return
|
|
3767
|
+
return d`
|
|
3764
3768
|
<div class="content-config-section">
|
|
3765
3769
|
<label class="config-label">
|
|
3766
3770
|
File URL:
|
|
@@ -3795,7 +3799,7 @@ Use **bold** and *italic* text.`;
|
|
|
3795
3799
|
</div>
|
|
3796
3800
|
`;
|
|
3797
3801
|
case "divider":
|
|
3798
|
-
return
|
|
3802
|
+
return d`
|
|
3799
3803
|
<div class="content-config-section">
|
|
3800
3804
|
<label class="config-label">
|
|
3801
3805
|
Caption:
|
|
@@ -3815,7 +3819,7 @@ Use **bold** and *italic* text.`;
|
|
|
3815
3819
|
</div>
|
|
3816
3820
|
`;
|
|
3817
3821
|
case "markdown":
|
|
3818
|
-
return
|
|
3822
|
+
return d`
|
|
3819
3823
|
<div class="content-config-section">
|
|
3820
3824
|
<label class="config-label">
|
|
3821
3825
|
Markdown Content:
|
|
@@ -3834,7 +3838,7 @@ Use **bold** and *italic* text.`;
|
|
|
3834
3838
|
</div>
|
|
3835
3839
|
`;
|
|
3836
3840
|
default:
|
|
3837
|
-
return
|
|
3841
|
+
return d``;
|
|
3838
3842
|
}
|
|
3839
3843
|
}
|
|
3840
3844
|
_getQuestionTypeDisplayName(i) {
|
|
@@ -3888,6 +3892,20 @@ Use **bold** and *italic* text.`;
|
|
|
3888
3892
|
const i = !!(this._templateData.steps && this._templateData.steps.length > 0);
|
|
3889
3893
|
return i && !this._selectedStepId && this._templateData.steps && (this._selectedStepId = this._templateData.steps[0].id, console.log("🎯 Auto-selected first step:", this._templateData.steps[0].title)), !i && this._selectedStepId && (this._selectedStepId = null), i;
|
|
3890
3894
|
}
|
|
3895
|
+
_showStepMenu(i, e) {
|
|
3896
|
+
i.stopPropagation(), console.log("Step menu for:", e), confirm("Delete this step?") && this._deleteStep(e);
|
|
3897
|
+
}
|
|
3898
|
+
_deleteStep(i) {
|
|
3899
|
+
if (!confirm("Are you sure you want to delete this step?"))
|
|
3900
|
+
return;
|
|
3901
|
+
const e = (this._templateData.steps || []).filter((t) => t.id !== i);
|
|
3902
|
+
e.forEach((t, n) => {
|
|
3903
|
+
t.order = n + 1;
|
|
3904
|
+
}), this._templateData = {
|
|
3905
|
+
...this._templateData,
|
|
3906
|
+
steps: e
|
|
3907
|
+
}, this._selectedStepId === i && (this._selectedStepId = e.length > 0 ? e[0].id : null), console.log("Step deleted:", i);
|
|
3908
|
+
}
|
|
3891
3909
|
_getAssignmentDisplayText(i) {
|
|
3892
3910
|
switch (i.category) {
|
|
3893
3911
|
case "individual":
|
|
@@ -3915,8 +3933,9 @@ Use **bold** and *italic* text.`;
|
|
|
3915
3933
|
}
|
|
3916
3934
|
}
|
|
3917
3935
|
render() {
|
|
3936
|
+
var e;
|
|
3918
3937
|
const i = this._getSelectedStep();
|
|
3919
|
-
return
|
|
3938
|
+
return d`
|
|
3920
3939
|
<div class="header">
|
|
3921
3940
|
<div class="header-inputs">
|
|
3922
3941
|
<div class="form-group">
|
|
@@ -3956,15 +3975,49 @@ Use **bold** and *italic* text.`;
|
|
|
3956
3975
|
</div>
|
|
3957
3976
|
|
|
3958
3977
|
<div class="steps-list">
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3978
|
+
${((e = this._templateData.steps) == null ? void 0 : e.map(
|
|
3979
|
+
(t) => d`
|
|
3980
|
+
<div
|
|
3981
|
+
class="step-item ${this._selectedStepId === t.id ? "selected" : ""} ${this._dragOverStepId === t.id ? "drag-over" : ""}"
|
|
3982
|
+
@click=${() => this._selectStep(t.id)}
|
|
3983
|
+
draggable="true"
|
|
3984
|
+
@dragstart=${(n) => this._handleDragStart(n, t.id)}
|
|
3985
|
+
@dragend=${this._handleDragEnd}
|
|
3986
|
+
@dragover=${(n) => this._handleDragOver(n, t.id)}
|
|
3987
|
+
@dragleave=${this._handleDragLeave}
|
|
3988
|
+
@drop=${(n) => this._handleDrop(n, t.id)}
|
|
3989
|
+
>
|
|
3990
|
+
<div class="step-handle">
|
|
3991
|
+
<svg
|
|
3992
|
+
width="16"
|
|
3993
|
+
height="16"
|
|
3994
|
+
viewBox="0 0 16 16"
|
|
3995
|
+
fill="none"
|
|
3996
|
+
stroke="currentColor"
|
|
3997
|
+
stroke-width="2"
|
|
3998
|
+
>
|
|
3999
|
+
<line x1="4" y1="4" x2="12" y2="4" />
|
|
4000
|
+
<line x1="4" y1="8" x2="12" y2="8" />
|
|
4001
|
+
<line x1="4" y1="12" x2="12" y2="12" />
|
|
4002
|
+
</svg>
|
|
4003
|
+
</div>
|
|
4004
|
+
<div class="step-content">
|
|
4005
|
+
<strong>${t.title}</strong>
|
|
4006
|
+
<small>${this._getAssignmentDisplayText(t.assignment)}</small>
|
|
4007
|
+
</div>
|
|
4008
|
+
<div class="step-actions">
|
|
4009
|
+
<button
|
|
4010
|
+
class="step-menu"
|
|
4011
|
+
@click=${(n) => {
|
|
4012
|
+
n.stopPropagation(), this._showStepMenu(n, t.id);
|
|
4013
|
+
}}
|
|
4014
|
+
>
|
|
4015
|
+
⋯
|
|
4016
|
+
</button>
|
|
4017
|
+
</div>
|
|
4018
|
+
</div>
|
|
4019
|
+
`
|
|
4020
|
+
)) || []}
|
|
3968
4021
|
</div>
|
|
3969
4022
|
</div>
|
|
3970
4023
|
|
|
@@ -3975,40 +4028,40 @@ Use **bold** and *italic* text.`;
|
|
|
3975
4028
|
<button class="add-button" @click=${() => this._addQuestion()}>Add</button>
|
|
3976
4029
|
</div>
|
|
3977
4030
|
|
|
3978
|
-
${i && i.elements && i.elements.length > 0 ?
|
|
4031
|
+
${i && i.elements && i.elements.length > 0 ? d`
|
|
3979
4032
|
<div class="elements-list">
|
|
3980
|
-
${i.elements.map((
|
|
3981
|
-
const
|
|
3982
|
-
if (
|
|
3983
|
-
const
|
|
3984
|
-
return
|
|
4033
|
+
${i.elements.map((t) => {
|
|
4034
|
+
const n = "label" in t && "required" in t, s = "content" in t;
|
|
4035
|
+
if (n) {
|
|
4036
|
+
const r = t;
|
|
4037
|
+
return d`
|
|
3985
4038
|
<div class="question-item">
|
|
3986
4039
|
<div class="question-header">
|
|
3987
4040
|
<h3 class="question-title">
|
|
3988
|
-
${
|
|
4041
|
+
${r.label || (r.type === "checkbox" ? this._getCheckboxTypeDisplayName(r) : this._getQuestionTypeDisplayName(r.type))}
|
|
3989
4042
|
</h3>
|
|
3990
4043
|
<div class="question-header-controls">
|
|
3991
4044
|
<select
|
|
3992
4045
|
class="question-type-select"
|
|
3993
|
-
.value=${
|
|
4046
|
+
.value=${r.type || "text_input"}
|
|
3994
4047
|
style="color: #000 !important;"
|
|
3995
|
-
@change=${(
|
|
3996
|
-
const
|
|
4048
|
+
@change=${(o) => {
|
|
4049
|
+
const l = o.target.value;
|
|
3997
4050
|
if ([
|
|
3998
4051
|
"text",
|
|
3999
4052
|
"html",
|
|
4000
4053
|
"divider",
|
|
4001
4054
|
"markdown"
|
|
4002
|
-
].includes(
|
|
4003
|
-
this._addQuestion(
|
|
4055
|
+
].includes(l)) {
|
|
4056
|
+
this._addQuestion(l), this._deleteQuestion(r.id);
|
|
4004
4057
|
return;
|
|
4005
4058
|
}
|
|
4006
|
-
const
|
|
4007
|
-
["select", "radio", "checkbox"].includes(
|
|
4008
|
-
const
|
|
4009
|
-
|
|
4059
|
+
const c = { type: l };
|
|
4060
|
+
["select", "radio", "checkbox"].includes(l) && !r.options && (c.options = ["Option 1", "Option 2"]);
|
|
4061
|
+
const u = this._getQuestionTypeDisplayName(
|
|
4062
|
+
r.type
|
|
4010
4063
|
);
|
|
4011
|
-
(!
|
|
4064
|
+
(!r.label || r.label === u) && (c.label = this._getQuestionTypeDisplayName(l)), this._updateQuestion(r.id, c);
|
|
4012
4065
|
}}
|
|
4013
4066
|
>
|
|
4014
4067
|
<optgroup label="Questions">
|
|
@@ -4031,7 +4084,7 @@ Use **bold** and *italic* text.`;
|
|
|
4031
4084
|
</select>
|
|
4032
4085
|
<button
|
|
4033
4086
|
class="delete-question-button"
|
|
4034
|
-
@click=${() => this._deleteQuestion(
|
|
4087
|
+
@click=${() => this._deleteQuestion(r.id)}
|
|
4035
4088
|
title="Delete question"
|
|
4036
4089
|
>
|
|
4037
4090
|
🗑️
|
|
@@ -4043,25 +4096,25 @@ Use **bold** and *italic* text.`;
|
|
|
4043
4096
|
type="text"
|
|
4044
4097
|
class="question-label-input"
|
|
4045
4098
|
placeholder="Question label"
|
|
4046
|
-
.value=${
|
|
4047
|
-
@input=${(
|
|
4048
|
-
const
|
|
4049
|
-
this._updateQuestion(
|
|
4050
|
-
label:
|
|
4099
|
+
.value=${r.label || ""}
|
|
4100
|
+
@input=${(o) => {
|
|
4101
|
+
const a = o.target;
|
|
4102
|
+
this._updateQuestion(r.id, {
|
|
4103
|
+
label: a.value
|
|
4051
4104
|
}), this.requestUpdate();
|
|
4052
4105
|
}}
|
|
4053
4106
|
/>
|
|
4054
4107
|
|
|
4055
|
-
${this._renderQuestionTypeSpecificFields(
|
|
4108
|
+
${this._renderQuestionTypeSpecificFields(r)}
|
|
4056
4109
|
|
|
4057
4110
|
<label class="question-required-label">
|
|
4058
4111
|
<input
|
|
4059
4112
|
type="checkbox"
|
|
4060
|
-
.checked=${
|
|
4061
|
-
@change=${(
|
|
4062
|
-
const
|
|
4063
|
-
this._updateQuestion(
|
|
4064
|
-
required:
|
|
4113
|
+
.checked=${r.required || !1}
|
|
4114
|
+
@change=${(o) => {
|
|
4115
|
+
const a = o.target;
|
|
4116
|
+
this._updateQuestion(r.id, {
|
|
4117
|
+
required: a.checked
|
|
4065
4118
|
});
|
|
4066
4119
|
}}
|
|
4067
4120
|
/>
|
|
@@ -4069,31 +4122,31 @@ Use **bold** and *italic* text.`;
|
|
|
4069
4122
|
</label>
|
|
4070
4123
|
</div>
|
|
4071
4124
|
`;
|
|
4072
|
-
} else if (
|
|
4073
|
-
const
|
|
4074
|
-
return
|
|
4125
|
+
} else if (s) {
|
|
4126
|
+
const r = t;
|
|
4127
|
+
return d`
|
|
4075
4128
|
<div class="question-item">
|
|
4076
4129
|
<div class="question-header">
|
|
4077
4130
|
<h3 class="question-title">
|
|
4078
|
-
${this._getContentTypeDisplayName(
|
|
4131
|
+
${this._getContentTypeDisplayName(r.type)}
|
|
4079
4132
|
</h3>
|
|
4080
4133
|
<div class="question-header-controls">
|
|
4081
4134
|
<select
|
|
4082
4135
|
class="question-type-select"
|
|
4083
|
-
.value=${
|
|
4136
|
+
.value=${t.type || "text"}
|
|
4084
4137
|
style="color: #000 !important;"
|
|
4085
|
-
@change=${(
|
|
4086
|
-
const
|
|
4138
|
+
@change=${(o) => {
|
|
4139
|
+
const l = o.target.value;
|
|
4087
4140
|
if (![
|
|
4088
4141
|
"text",
|
|
4089
4142
|
"html",
|
|
4090
4143
|
"divider",
|
|
4091
4144
|
"markdown"
|
|
4092
|
-
].includes(
|
|
4093
|
-
this._addQuestion(
|
|
4145
|
+
].includes(l)) {
|
|
4146
|
+
this._addQuestion(l), this._deleteQuestion(t.id);
|
|
4094
4147
|
return;
|
|
4095
4148
|
}
|
|
4096
|
-
this._addQuestion(
|
|
4149
|
+
this._addQuestion(l), this._deleteQuestion(t.id);
|
|
4097
4150
|
}}
|
|
4098
4151
|
>
|
|
4099
4152
|
<optgroup label="Questions">
|
|
@@ -4116,7 +4169,7 @@ Use **bold** and *italic* text.`;
|
|
|
4116
4169
|
</select>
|
|
4117
4170
|
<button
|
|
4118
4171
|
class="delete-question-button"
|
|
4119
|
-
@click=${() => this._deleteQuestion(
|
|
4172
|
+
@click=${() => this._deleteQuestion(t.id)}
|
|
4120
4173
|
title="Delete content"
|
|
4121
4174
|
>
|
|
4122
4175
|
✕
|
|
@@ -4124,20 +4177,20 @@ Use **bold** and *italic* text.`;
|
|
|
4124
4177
|
</div>
|
|
4125
4178
|
</div>
|
|
4126
4179
|
<div class="question-content">
|
|
4127
|
-
${this._renderContentTypeSpecificFields(
|
|
4180
|
+
${this._renderContentTypeSpecificFields(r)}
|
|
4128
4181
|
</div>
|
|
4129
4182
|
</div>
|
|
4130
4183
|
`;
|
|
4131
4184
|
} else {
|
|
4132
|
-
const
|
|
4133
|
-
return
|
|
4185
|
+
const r = t;
|
|
4186
|
+
return d`
|
|
4134
4187
|
<div class="question-item">
|
|
4135
4188
|
<div class="question-header">
|
|
4136
4189
|
<h3 class="question-title">Unknown Element</h3>
|
|
4137
4190
|
<div class="question-header-controls">
|
|
4138
4191
|
<button
|
|
4139
4192
|
class="delete-question-button"
|
|
4140
|
-
@click=${() => this._deleteQuestion(
|
|
4193
|
+
@click=${() => this._deleteQuestion(r.id)}
|
|
4141
4194
|
title="Delete element"
|
|
4142
4195
|
>
|
|
4143
4196
|
✕
|
|
@@ -4149,7 +4202,7 @@ Use **bold** and *italic* text.`;
|
|
|
4149
4202
|
}
|
|
4150
4203
|
})}
|
|
4151
4204
|
</div>
|
|
4152
|
-
` :
|
|
4205
|
+
` : d`
|
|
4153
4206
|
<div class="empty-state">
|
|
4154
4207
|
<h3>Add questions</h3>
|
|
4155
4208
|
<p>Use the add button to start building your workflow</p>
|
|
@@ -4195,7 +4248,7 @@ C([
|
|
|
4195
4248
|
], w.prototype, "onCancel", 2);
|
|
4196
4249
|
C([
|
|
4197
4250
|
D({ attribute: !1 })
|
|
4198
|
-
], w.prototype, "
|
|
4251
|
+
], w.prototype, "workflow", 2);
|
|
4199
4252
|
w = C([
|
|
4200
4253
|
Le("builder-widget")
|
|
4201
4254
|
], w);
|
|
@@ -4214,11 +4267,11 @@ class mt {
|
|
|
4214
4267
|
if (this.isQuestionElement(o)) {
|
|
4215
4268
|
const a = o;
|
|
4216
4269
|
if (a.required) {
|
|
4217
|
-
const
|
|
4270
|
+
const l = this.validateQuestion(
|
|
4218
4271
|
a,
|
|
4219
4272
|
t[a.id]
|
|
4220
4273
|
);
|
|
4221
|
-
|
|
4274
|
+
l && (s = !1, r[a.id] = l.message);
|
|
4222
4275
|
}
|
|
4223
4276
|
}
|
|
4224
4277
|
return { isValid: s, errors: r };
|
|
@@ -4291,7 +4344,7 @@ class bt {
|
|
|
4291
4344
|
}
|
|
4292
4345
|
saveFormData(e, t, n, s, r, o) {
|
|
4293
4346
|
var c, u, h;
|
|
4294
|
-
const a = this.getStorageKey(e),
|
|
4347
|
+
const a = this.getStorageKey(e), l = o ? {
|
|
4295
4348
|
...o,
|
|
4296
4349
|
currentStepId: (u = (c = o.steps) == null ? void 0 : c[n]) == null ? void 0 : u.id,
|
|
4297
4350
|
completedSteps: Array.from(r),
|
|
@@ -4306,7 +4359,7 @@ class bt {
|
|
|
4306
4359
|
stepIndex: n,
|
|
4307
4360
|
savedSignatures: Array.from(s),
|
|
4308
4361
|
completedSteps: Array.from(r),
|
|
4309
|
-
instance:
|
|
4362
|
+
instance: l
|
|
4310
4363
|
};
|
|
4311
4364
|
try {
|
|
4312
4365
|
localStorage.setItem(a, JSON.stringify(p));
|
|
@@ -4370,9 +4423,9 @@ class be {
|
|
|
4370
4423
|
return new be(e[1], n, s, e[2], t.start, t.end);
|
|
4371
4424
|
}
|
|
4372
4425
|
static calculateControlPoints(e, t, n) {
|
|
4373
|
-
const s = e.x - t.x, r = e.y - t.y, o = t.x - n.x, a = t.y - n.y,
|
|
4426
|
+
const s = e.x - t.x, r = e.y - t.y, o = t.x - n.x, a = t.y - n.y, l = { x: (e.x + t.x) / 2, y: (e.y + t.y) / 2 }, p = { x: (t.x + n.x) / 2, y: (t.y + n.y) / 2 }, c = Math.sqrt(s * s + r * r), u = Math.sqrt(o * o + a * a), h = l.x - p.x, g = l.y - p.y, b = c + u == 0 ? 0 : u / (c + u), k = { x: p.x + h * b, y: p.y + g * b }, G = t.x - k.x, Y = t.y - k.y;
|
|
4374
4427
|
return {
|
|
4375
|
-
c1: new X(
|
|
4428
|
+
c1: new X(l.x + G, l.y + Y),
|
|
4376
4429
|
c2: new X(p.x + G, p.y + Y)
|
|
4377
4430
|
};
|
|
4378
4431
|
}
|
|
@@ -4382,12 +4435,12 @@ class be {
|
|
|
4382
4435
|
length() {
|
|
4383
4436
|
let t = 0, n, s;
|
|
4384
4437
|
for (let r = 0; r <= 10; r += 1) {
|
|
4385
|
-
const o = r / 10, a = this.point(o, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x),
|
|
4438
|
+
const o = r / 10, a = this.point(o, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x), l = this.point(o, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);
|
|
4386
4439
|
if (r > 0) {
|
|
4387
|
-
const p = a - n, c =
|
|
4440
|
+
const p = a - n, c = l - s;
|
|
4388
4441
|
t += Math.sqrt(p * p + c * c);
|
|
4389
4442
|
}
|
|
4390
|
-
n = a, s =
|
|
4443
|
+
n = a, s = l;
|
|
4391
4444
|
}
|
|
4392
4445
|
return t;
|
|
4393
4446
|
}
|
|
@@ -4434,9 +4487,9 @@ class Z extends vt {
|
|
|
4434
4487
|
}
|
|
4435
4488
|
fromDataURL(e, t = {}) {
|
|
4436
4489
|
return new Promise((n, s) => {
|
|
4437
|
-
const r = new Image(), o = t.ratio || window.devicePixelRatio || 1, a = t.width || this.canvas.width / o,
|
|
4490
|
+
const r = new Image(), o = t.ratio || window.devicePixelRatio || 1, a = t.width || this.canvas.width / o, l = t.height || this.canvas.height / o, p = t.xOffset || 0, c = t.yOffset || 0;
|
|
4438
4491
|
this._reset(this._getPointGroupOptions()), r.onload = () => {
|
|
4439
|
-
this._ctx.drawImage(r, p, c, a,
|
|
4492
|
+
this._ctx.drawImage(r, p, c, a, l), n();
|
|
4440
4493
|
}, r.onerror = (u) => {
|
|
4441
4494
|
s(u);
|
|
4442
4495
|
}, r.crossOrigin = "anonymous", r.src = e, this._isEmpty = !1;
|
|
@@ -4597,8 +4650,8 @@ class Z extends vt {
|
|
|
4597
4650
|
this.dispatchEvent(new CustomEvent("beforeUpdateStroke", { detail: e }));
|
|
4598
4651
|
const t = this._createPoint(e.x, e.y, e.pressure), n = this._data[this._data.length - 1], s = n.points, r = s.length > 0 && s[s.length - 1], o = r ? t.distanceTo(r) <= this.minDistance : !1, a = this._getPointGroupOptions(n);
|
|
4599
4652
|
if (!r || !(r && o)) {
|
|
4600
|
-
const
|
|
4601
|
-
r ?
|
|
4653
|
+
const l = this._addPoint(t, a);
|
|
4654
|
+
r ? l && this._drawCurve(l, a) : this._drawDot(t, a), s.push({
|
|
4602
4655
|
time: t.time,
|
|
4603
4656
|
x: t.x,
|
|
4604
4657
|
y: t.y,
|
|
@@ -4659,11 +4712,11 @@ class Z extends vt {
|
|
|
4659
4712
|
const n = this._ctx, s = e.endWidth - e.startWidth, r = Math.ceil(e.length()) * 2;
|
|
4660
4713
|
n.beginPath(), n.fillStyle = t.penColor;
|
|
4661
4714
|
for (let o = 0; o < r; o += 1) {
|
|
4662
|
-
const a = o / r,
|
|
4715
|
+
const a = o / r, l = a * a, p = l * a, c = 1 - a, u = c * c, h = u * c;
|
|
4663
4716
|
let g = h * e.startPoint.x;
|
|
4664
|
-
g += 3 * u * a * e.control1.x, g += 3 * c *
|
|
4717
|
+
g += 3 * u * a * e.control1.x, g += 3 * c * l * e.control2.x, g += p * e.endPoint.x;
|
|
4665
4718
|
let b = h * e.startPoint.y;
|
|
4666
|
-
b += 3 * u * a * e.control1.y, b += 3 * c *
|
|
4719
|
+
b += 3 * u * a * e.control1.y, b += 3 * c * l * e.control2.y, b += p * e.endPoint.y;
|
|
4667
4720
|
const k = Math.min(e.startWidth + p * s, t.maxWidth);
|
|
4668
4721
|
this._drawCurveSegment(g, b, k);
|
|
4669
4722
|
}
|
|
@@ -4678,7 +4731,7 @@ class Z extends vt {
|
|
|
4678
4731
|
const { points: r } = s, o = this._getPointGroupOptions(s);
|
|
4679
4732
|
if (r.length > 1)
|
|
4680
4733
|
for (let a = 0; a < r.length; a += 1) {
|
|
4681
|
-
const
|
|
4734
|
+
const l = r[a], p = new X(l.x, l.y, l.pressure, l.time);
|
|
4682
4735
|
a === 0 && this._reset(o);
|
|
4683
4736
|
const c = this._addPoint(p, o);
|
|
4684
4737
|
c && t(c, o);
|
|
@@ -4688,21 +4741,21 @@ class Z extends vt {
|
|
|
4688
4741
|
}
|
|
4689
4742
|
}
|
|
4690
4743
|
toSVG({ includeBackgroundColor: e = !1 } = {}) {
|
|
4691
|
-
const t = this._data, n = Math.max(window.devicePixelRatio || 1, 1), s = 0, r = 0, o = this.canvas.width / n, a = this.canvas.height / n,
|
|
4692
|
-
if (
|
|
4744
|
+
const t = this._data, n = Math.max(window.devicePixelRatio || 1, 1), s = 0, r = 0, o = this.canvas.width / n, a = this.canvas.height / n, l = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
4745
|
+
if (l.setAttribute("xmlns", "http://www.w3.org/2000/svg"), l.setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink"), l.setAttribute("viewBox", `${s} ${r} ${o} ${a}`), l.setAttribute("width", o.toString()), l.setAttribute("height", a.toString()), e && this.backgroundColor) {
|
|
4693
4746
|
const p = document.createElement("rect");
|
|
4694
|
-
p.setAttribute("width", "100%"), p.setAttribute("height", "100%"), p.setAttribute("fill", this.backgroundColor),
|
|
4747
|
+
p.setAttribute("width", "100%"), p.setAttribute("height", "100%"), p.setAttribute("fill", this.backgroundColor), l.appendChild(p);
|
|
4695
4748
|
}
|
|
4696
4749
|
return this._fromData(t, (p, { penColor: c }) => {
|
|
4697
4750
|
const u = document.createElement("path");
|
|
4698
4751
|
if (!isNaN(p.control1.x) && !isNaN(p.control1.y) && !isNaN(p.control2.x) && !isNaN(p.control2.y)) {
|
|
4699
4752
|
const h = `M ${p.startPoint.x.toFixed(3)},${p.startPoint.y.toFixed(3)} C ${p.control1.x.toFixed(3)},${p.control1.y.toFixed(3)} ${p.control2.x.toFixed(3)},${p.control2.y.toFixed(3)} ${p.endPoint.x.toFixed(3)},${p.endPoint.y.toFixed(3)}`;
|
|
4700
|
-
u.setAttribute("d", h), u.setAttribute("stroke-width", (p.endWidth * 2.25).toFixed(3)), u.setAttribute("stroke", c), u.setAttribute("fill", "none"), u.setAttribute("stroke-linecap", "round"),
|
|
4753
|
+
u.setAttribute("d", h), u.setAttribute("stroke-width", (p.endWidth * 2.25).toFixed(3)), u.setAttribute("stroke", c), u.setAttribute("fill", "none"), u.setAttribute("stroke-linecap", "round"), l.appendChild(u);
|
|
4701
4754
|
}
|
|
4702
4755
|
}, (p, { penColor: c, dotSize: u, minWidth: h, maxWidth: g }) => {
|
|
4703
4756
|
const b = document.createElement("circle"), k = u > 0 ? u : (h + g) / 2;
|
|
4704
|
-
b.setAttribute("r", k.toString()), b.setAttribute("cx", p.x.toString()), b.setAttribute("cy", p.y.toString()), b.setAttribute("fill", c),
|
|
4705
|
-
}),
|
|
4757
|
+
b.setAttribute("r", k.toString()), b.setAttribute("cx", p.x.toString()), b.setAttribute("cy", p.y.toString()), b.setAttribute("fill", c), l.appendChild(b);
|
|
4758
|
+
}), l.outerHTML;
|
|
4706
4759
|
}
|
|
4707
4760
|
}
|
|
4708
4761
|
class _t {
|
|
@@ -4915,9 +4968,9 @@ class yt {
|
|
|
4915
4968
|
newStepIndex: t,
|
|
4916
4969
|
reason: "Invalid step index"
|
|
4917
4970
|
};
|
|
4918
|
-
const
|
|
4919
|
-
if (this.isStepAssignedToUser(
|
|
4920
|
-
const p = s.has(
|
|
4971
|
+
const l = a[e];
|
|
4972
|
+
if (this.isStepAssignedToUser(l)) {
|
|
4973
|
+
const p = s.has(l.id), c = this.isStepWithinAllowedRange(
|
|
4921
4974
|
e,
|
|
4922
4975
|
n,
|
|
4923
4976
|
s
|
|
@@ -4938,16 +4991,16 @@ class yt {
|
|
|
4938
4991
|
}
|
|
4939
4992
|
isStepWithinAllowedRange(e, t, n) {
|
|
4940
4993
|
if (!(t != null && t.steps)) return !1;
|
|
4941
|
-
const r = this.getAssignedSteps(t).map((
|
|
4994
|
+
const r = this.getAssignedSteps(t).map((l) => t.steps.findIndex((p) => p.id === l.id)).sort((l, p) => l - p);
|
|
4942
4995
|
let o = -1;
|
|
4943
|
-
for (const
|
|
4944
|
-
const p = t.steps[
|
|
4945
|
-
n.has(p.id) && (o =
|
|
4996
|
+
for (const l of r) {
|
|
4997
|
+
const p = t.steps[l];
|
|
4998
|
+
n.has(p.id) && (o = l);
|
|
4946
4999
|
}
|
|
4947
5000
|
let a = -1;
|
|
4948
|
-
for (const
|
|
4949
|
-
if (
|
|
4950
|
-
a =
|
|
5001
|
+
for (const l of r)
|
|
5002
|
+
if (l > o) {
|
|
5003
|
+
a = l;
|
|
4951
5004
|
break;
|
|
4952
5005
|
}
|
|
4953
5006
|
return a !== -1 ? e <= a && this.isStepAssignedToUser(t.steps[e]) : this.isStepAssignedToUser(t.steps[e]);
|
|
@@ -5138,8 +5191,8 @@ const te = class te {
|
|
|
5138
5191
|
this.formStateManager.clearValidationError(e);
|
|
5139
5192
|
const a = this.createFileInfo(r);
|
|
5140
5193
|
this.formStateManager.setFormField(e, a);
|
|
5141
|
-
const
|
|
5142
|
-
|
|
5194
|
+
const l = this.hasFileChanged(e, a, n.savedInstance);
|
|
5195
|
+
l && n.mode !== "preview" ? this.executeFileUploadCallback(e, r, a, n) : this.logSkippedCallback(e, n.mode, l), (h = n.onRequestUpdate) == null || h.call(n), n.mode !== "admin" && ((g = n.onFormDataSave) == null || g.call(n));
|
|
5143
5196
|
}
|
|
5144
5197
|
/**
|
|
5145
5198
|
* Clears file data for a question
|
|
@@ -5260,9 +5313,9 @@ class y {
|
|
|
5260
5313
|
}[n] || `${n.toUpperCase()} File` : "Unknown";
|
|
5261
5314
|
}
|
|
5262
5315
|
static renderTextArea(e, t, n) {
|
|
5263
|
-
return n.mode === "print" ?
|
|
5264
|
-
${t ||
|
|
5265
|
-
</div>` :
|
|
5316
|
+
return n.mode === "print" ? d`<div class="print-response-value textarea-response">
|
|
5317
|
+
${t || d`<span class="print-no-response">No response</span>`}
|
|
5318
|
+
</div>` : d`<textarea
|
|
5266
5319
|
id=${e.id}
|
|
5267
5320
|
.value=${t}
|
|
5268
5321
|
?required=${e.required}
|
|
@@ -5273,9 +5326,9 @@ class y {
|
|
|
5273
5326
|
}
|
|
5274
5327
|
static renderSelect(e, t, n) {
|
|
5275
5328
|
var s;
|
|
5276
|
-
return n.mode === "print" ?
|
|
5277
|
-
${t ||
|
|
5278
|
-
</div>` :
|
|
5329
|
+
return n.mode === "print" ? d`<div class="print-response-value select-response">
|
|
5330
|
+
${t || d`<span class="print-no-response">No selection made</span>`}
|
|
5331
|
+
</div>` : d`<select
|
|
5279
5332
|
id=${e.id}
|
|
5280
5333
|
.value=${t}
|
|
5281
5334
|
?required=${e.required}
|
|
@@ -5284,17 +5337,17 @@ class y {
|
|
|
5284
5337
|
@change=${(r) => n.handlers.handleInputChange(e.id, r)}
|
|
5285
5338
|
>
|
|
5286
5339
|
<option value="">Choose</option>
|
|
5287
|
-
${(s = e.options) == null ? void 0 : s.map((r) =>
|
|
5340
|
+
${(s = e.options) == null ? void 0 : s.map((r) => d`<option value=${r}>${r}</option>`)}
|
|
5288
5341
|
</select>`;
|
|
5289
5342
|
}
|
|
5290
5343
|
static renderRadio(e, t, n) {
|
|
5291
5344
|
var o;
|
|
5292
5345
|
const s = this._isInputDisabled(n), r = n.mode === "print";
|
|
5293
|
-
return r ?
|
|
5294
|
-
${t ||
|
|
5295
|
-
</div>` :
|
|
5346
|
+
return r ? d`<div class="print-response-value radio-response">
|
|
5347
|
+
${t || d`<span class="print-no-response">No selection made</span>`}
|
|
5348
|
+
</div>` : d`<div class="radio-group ${r ? "print-mode" : ""}">
|
|
5296
5349
|
${(o = e.options) == null ? void 0 : o.map(
|
|
5297
|
-
(a) =>
|
|
5350
|
+
(a) => d`
|
|
5298
5351
|
<label class="radio-option">
|
|
5299
5352
|
<input
|
|
5300
5353
|
type="radio"
|
|
@@ -5302,7 +5355,7 @@ class y {
|
|
|
5302
5355
|
value=${a}
|
|
5303
5356
|
.checked=${t === a}
|
|
5304
5357
|
?disabled=${s}
|
|
5305
|
-
@change=${r ? null : (
|
|
5358
|
+
@change=${r ? null : (l) => n.handlers.handleInputChange(e.id, l)}
|
|
5306
5359
|
/>
|
|
5307
5360
|
<span class="radio-label">${a}</span>
|
|
5308
5361
|
</label>
|
|
@@ -5316,13 +5369,13 @@ class y {
|
|
|
5316
5369
|
if (e.options && e.options.length > 0) {
|
|
5317
5370
|
if (r) {
|
|
5318
5371
|
const a = Array.isArray(t) ? t : [];
|
|
5319
|
-
return
|
|
5320
|
-
${a.length > 0 ? a.map((
|
|
5372
|
+
return d`<div class="print-response-value checkbox-response">
|
|
5373
|
+
${a.length > 0 ? a.map((l) => d`<div>• ${l}</div>`) : d`<span class="print-no-response">No selections made</span>`}
|
|
5321
5374
|
</div>`;
|
|
5322
5375
|
}
|
|
5323
|
-
return
|
|
5376
|
+
return d`<div class="checkbox-group ${r ? "print-mode" : ""}">
|
|
5324
5377
|
${(o = e.options) == null ? void 0 : o.map(
|
|
5325
|
-
(a) =>
|
|
5378
|
+
(a) => d`
|
|
5326
5379
|
<label class="checkbox-option">
|
|
5327
5380
|
<input
|
|
5328
5381
|
type="checkbox"
|
|
@@ -5330,7 +5383,7 @@ class y {
|
|
|
5330
5383
|
value=${a}
|
|
5331
5384
|
.checked=${Array.isArray(t) ? t.includes(a) : !1}
|
|
5332
5385
|
?disabled=${s}
|
|
5333
|
-
@change=${r ? null : (
|
|
5386
|
+
@change=${r ? null : (l) => n.handlers.handleCheckboxGroupChange(e.id, a, l)}
|
|
5334
5387
|
/>
|
|
5335
5388
|
<span class="checkbox-label">${a}</span>
|
|
5336
5389
|
</label>
|
|
@@ -5338,9 +5391,9 @@ class y {
|
|
|
5338
5391
|
)}
|
|
5339
5392
|
</div>`;
|
|
5340
5393
|
} else
|
|
5341
|
-
return r ?
|
|
5394
|
+
return r ? d`<div class="print-response-value checkbox-response">
|
|
5342
5395
|
${t ? "Yes" : "No"}
|
|
5343
|
-
</div>` :
|
|
5396
|
+
</div>` : d`<label class="checkbox-single ${r ? "print-mode" : ""}">
|
|
5344
5397
|
<input
|
|
5345
5398
|
type="checkbox"
|
|
5346
5399
|
id=${e.id}
|
|
@@ -5354,15 +5407,15 @@ class y {
|
|
|
5354
5407
|
static renderSignature(e, t, n) {
|
|
5355
5408
|
const s = n.formData[e.id], r = !!n.formData[e.id], o = n.savedSignatures.has(e.id), a = n.replacingSignatures.has(e.id);
|
|
5356
5409
|
if (n.mode === "print")
|
|
5357
|
-
return s && typeof s == "string" ?
|
|
5410
|
+
return s && typeof s == "string" ? d`
|
|
5358
5411
|
<div class="print-response-value signature-response">
|
|
5359
5412
|
<img
|
|
5360
5413
|
src="${s}"
|
|
5361
5414
|
alt="Digital Signature"
|
|
5362
5415
|
class="signature-image"
|
|
5363
|
-
@error=${(
|
|
5416
|
+
@error=${(l) => {
|
|
5364
5417
|
var u;
|
|
5365
|
-
const p =
|
|
5418
|
+
const p = l.target;
|
|
5366
5419
|
p.style.display = "none";
|
|
5367
5420
|
const c = (u = p.parentElement) == null ? void 0 : u.querySelector(".signature-fallback");
|
|
5368
5421
|
c && c.classList.remove("hidden");
|
|
@@ -5372,19 +5425,19 @@ class y {
|
|
|
5372
5425
|
<span class="signature-error">Unable to display signature</span>
|
|
5373
5426
|
</div>
|
|
5374
5427
|
</div>
|
|
5375
|
-
` :
|
|
5428
|
+
` : d`<div class="print-response-value signature-response">
|
|
5376
5429
|
<span class="print-no-response">No signature provided</span>
|
|
5377
5430
|
</div>`;
|
|
5378
5431
|
if (n.mode === "view-only")
|
|
5379
|
-
return s && typeof s == "string" ?
|
|
5432
|
+
return s && typeof s == "string" ? d`
|
|
5380
5433
|
<div class="signature-view-only">
|
|
5381
5434
|
<img
|
|
5382
5435
|
src="${s}"
|
|
5383
5436
|
alt="Digital Signature"
|
|
5384
5437
|
class="signature-image"
|
|
5385
|
-
@error=${(
|
|
5438
|
+
@error=${(l) => {
|
|
5386
5439
|
var u;
|
|
5387
|
-
const p =
|
|
5440
|
+
const p = l.target;
|
|
5388
5441
|
p.style.display = "none";
|
|
5389
5442
|
const c = (u = p.parentElement) == null ? void 0 : u.querySelector(".signature-fallback");
|
|
5390
5443
|
c && c.classList.remove("hidden");
|
|
@@ -5394,17 +5447,17 @@ class y {
|
|
|
5394
5447
|
<span class="signature-error">Unable to display signature</span>
|
|
5395
5448
|
</div>
|
|
5396
5449
|
</div>
|
|
5397
|
-
` :
|
|
5450
|
+
` : d`
|
|
5398
5451
|
<div class="signature-view-only">
|
|
5399
5452
|
<span class="no-signature">No signature captured</span>
|
|
5400
5453
|
</div>
|
|
5401
5454
|
`;
|
|
5402
5455
|
if (n.mode === "admin" && s && typeof s == "string" && !a) {
|
|
5403
|
-
const
|
|
5404
|
-
return
|
|
5456
|
+
const l = s.trim().startsWith("<svg");
|
|
5457
|
+
return d`
|
|
5405
5458
|
<div class="signature-admin-display">
|
|
5406
5459
|
<div class="signature-existing">
|
|
5407
|
-
${
|
|
5460
|
+
${l ? d` <div class="signature-svg-container" .innerHTML=${s}></div> ` : d`
|
|
5408
5461
|
<img
|
|
5409
5462
|
src="${s}"
|
|
5410
5463
|
alt="Digital Signature"
|
|
@@ -5434,7 +5487,7 @@ class y {
|
|
|
5434
5487
|
</div>
|
|
5435
5488
|
`;
|
|
5436
5489
|
}
|
|
5437
|
-
return
|
|
5490
|
+
return d`
|
|
5438
5491
|
<div class="signature-container ${this._isInputDisabled(n) ? "disabled" : ""}">
|
|
5439
5492
|
<canvas id="signature-${e.id}" class="signature-canvas"></canvas>
|
|
5440
5493
|
<div class="signature-controls">
|
|
@@ -5446,7 +5499,7 @@ class y {
|
|
|
5446
5499
|
>
|
|
5447
5500
|
Clear
|
|
5448
5501
|
</button>
|
|
5449
|
-
${r && !o ?
|
|
5502
|
+
${r && !o ? d`
|
|
5450
5503
|
<button
|
|
5451
5504
|
type="button"
|
|
5452
5505
|
class="signature-save-btn"
|
|
@@ -5456,8 +5509,8 @@ class y {
|
|
|
5456
5509
|
Save
|
|
5457
5510
|
</button>
|
|
5458
5511
|
` : ""}
|
|
5459
|
-
${o ?
|
|
5460
|
-
${n.mode === "admin" && a ?
|
|
5512
|
+
${o ? d` <span class="signature-saved">✓ Saved</span> ` : ""}
|
|
5513
|
+
${n.mode === "admin" && a ? d`
|
|
5461
5514
|
<button
|
|
5462
5515
|
type="button"
|
|
5463
5516
|
class="signature-cancel-btn"
|
|
@@ -5477,25 +5530,25 @@ class y {
|
|
|
5477
5530
|
const r = typeof s == "string", o = typeof s == "object" && s.name;
|
|
5478
5531
|
if (n.mode === "print") {
|
|
5479
5532
|
if (o)
|
|
5480
|
-
return
|
|
5533
|
+
return d`
|
|
5481
5534
|
<div class="print-response-value file-response">
|
|
5482
5535
|
📎 ${s.name}
|
|
5483
|
-
${s.size ?
|
|
5536
|
+
${s.size ? d` <span class="file-size"
|
|
5484
5537
|
>(${y._formatFileSize(s.size)})</span
|
|
5485
5538
|
>` : ""}
|
|
5486
5539
|
</div>
|
|
5487
5540
|
`;
|
|
5488
5541
|
if (r) {
|
|
5489
5542
|
const a = y._extractFilenameFromUrl(s);
|
|
5490
|
-
return
|
|
5543
|
+
return d` <div class="print-response-value file-response">📎 ${a}</div> `;
|
|
5491
5544
|
} else
|
|
5492
|
-
return
|
|
5545
|
+
return d` <div class="print-response-value file-response">📎 ${s}</div> `;
|
|
5493
5546
|
} else {
|
|
5494
|
-
const a = r ? s : "#",
|
|
5495
|
-
return
|
|
5547
|
+
const a = r ? s : "#", l = o ? s.name : r ? y._extractFilenameFromUrl(s) : "View File";
|
|
5548
|
+
return d`
|
|
5496
5549
|
<div class="file-upload-view-only">
|
|
5497
|
-
<a href="${a}" target="_blank" class="file-link"> 📎 ${
|
|
5498
|
-
${o && s.size ?
|
|
5550
|
+
<a href="${a}" target="_blank" class="file-link"> 📎 ${l} </a>
|
|
5551
|
+
${o && s.size ? d`
|
|
5499
5552
|
<span class="file-size-info"
|
|
5500
5553
|
>(${y._formatFileSize(s.size)})</span
|
|
5501
5554
|
>
|
|
@@ -5504,16 +5557,16 @@ class y {
|
|
|
5504
5557
|
`;
|
|
5505
5558
|
}
|
|
5506
5559
|
} else
|
|
5507
|
-
return n.mode === "print" ?
|
|
5560
|
+
return n.mode === "print" ? d`
|
|
5508
5561
|
<div class="print-response-value file-response">
|
|
5509
5562
|
<span class="print-no-response">No file uploaded</span>
|
|
5510
5563
|
</div>
|
|
5511
|
-
` :
|
|
5564
|
+
` : d`
|
|
5512
5565
|
<div class="file-upload-view-only">
|
|
5513
5566
|
<span class="no-file">No file uploaded</span>
|
|
5514
5567
|
</div>
|
|
5515
5568
|
`;
|
|
5516
|
-
return
|
|
5569
|
+
return d`
|
|
5517
5570
|
<div class="file-upload-container">
|
|
5518
5571
|
<input
|
|
5519
5572
|
type="file"
|
|
@@ -5522,7 +5575,7 @@ class y {
|
|
|
5522
5575
|
?disabled=${this._isInputDisabled(n)}
|
|
5523
5576
|
@change=${(r) => n.handlers.handleFileUpload(e.id, r)}
|
|
5524
5577
|
/>
|
|
5525
|
-
${s ?
|
|
5578
|
+
${s ? d`
|
|
5526
5579
|
<div class="file-preview">
|
|
5527
5580
|
<span class="file-name">${s.name || "File selected"}</span>
|
|
5528
5581
|
<button
|
|
@@ -5543,12 +5596,12 @@ class y {
|
|
|
5543
5596
|
static renderDefaultInput(e, t, n) {
|
|
5544
5597
|
if (n.mode === "print") {
|
|
5545
5598
|
const r = e.type === "date" && t ? new Date(t).toLocaleDateString() : t;
|
|
5546
|
-
return
|
|
5547
|
-
${r ||
|
|
5599
|
+
return d`<div class="print-response-value input-response">
|
|
5600
|
+
${r || d`<span class="print-no-response">No response</span>`}
|
|
5548
5601
|
</div>`;
|
|
5549
5602
|
}
|
|
5550
5603
|
const s = e.type === "number" ? "number" : e.type === "date" ? "date" : "text";
|
|
5551
|
-
return
|
|
5604
|
+
return d`<input
|
|
5552
5605
|
type=${s}
|
|
5553
5606
|
id=${e.id}
|
|
5554
5607
|
.value=${t}
|
|
@@ -5577,22 +5630,22 @@ class y {
|
|
|
5577
5630
|
return y.renderDefaultInput(e, n, t);
|
|
5578
5631
|
}
|
|
5579
5632
|
}, o = e.type === "checkbox" && (!e.options || e.options.length === 0);
|
|
5580
|
-
return t.mode === "print" ?
|
|
5633
|
+
return t.mode === "print" ? d`
|
|
5581
5634
|
<div class="question-print">
|
|
5582
|
-
${o ? "" :
|
|
5635
|
+
${o ? "" : d` <div class="print-question-title">${e.label}:</div> `}
|
|
5583
5636
|
${r()}
|
|
5584
5637
|
<hr class="print-question-separator" />
|
|
5585
5638
|
</div>
|
|
5586
|
-
` :
|
|
5639
|
+
` : d`
|
|
5587
5640
|
<div class="question ${s ? "error" : ""}">
|
|
5588
|
-
${o ? "" :
|
|
5641
|
+
${o ? "" : d`
|
|
5589
5642
|
<div class="runner-question-title">
|
|
5590
|
-
${e.label}${e.required ?
|
|
5643
|
+
${e.label}${e.required ? d`<span class="runner-question-required">*</span>` : ""}
|
|
5591
5644
|
</div>
|
|
5592
5645
|
<hr class="runner-question-divider" />
|
|
5593
5646
|
`}
|
|
5594
5647
|
${r()}
|
|
5595
|
-
${s ?
|
|
5648
|
+
${s ? d`<div class="error-message">${s}</div>` : ""}
|
|
5596
5649
|
</div>
|
|
5597
5650
|
`;
|
|
5598
5651
|
}
|
|
@@ -5630,7 +5683,7 @@ class ue extends $t {
|
|
|
5630
5683
|
}
|
|
5631
5684
|
render(e) {
|
|
5632
5685
|
if (e === v || e == null) return this._t = void 0, this.it = e;
|
|
5633
|
-
if (e ===
|
|
5686
|
+
if (e === I) return e;
|
|
5634
5687
|
if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
5635
5688
|
if (e === this.it) return this._t;
|
|
5636
5689
|
this.it = e;
|
|
@@ -5645,14 +5698,14 @@ class $ {
|
|
|
5645
5698
|
return e.replace(/^### (.*$)/gim, "<h3>$1</h3>").replace(/^## (.*$)/gim, "<h2>$1</h2>").replace(/^# (.*$)/gim, "<h1>$1</h1>").replace(/\*\*(.*?)\*\*/gim, "<strong>$1</strong>").replace(/\*(.*?)\*/gim, "<em>$1</em>").replace(/`(.*?)`/gim, "<code>$1</code>").replace(/^> (.*$)/gim, "<blockquote>$1</blockquote>").replace(/\n/gim, "<br>");
|
|
5646
5699
|
}
|
|
5647
5700
|
static renderText(e) {
|
|
5648
|
-
return
|
|
5701
|
+
return d`
|
|
5649
5702
|
<div class="content-element text-content">
|
|
5650
5703
|
<p>${e.content}</p>
|
|
5651
5704
|
</div>
|
|
5652
5705
|
`;
|
|
5653
5706
|
}
|
|
5654
5707
|
static renderMarkdownElement(e) {
|
|
5655
|
-
return
|
|
5708
|
+
return d`
|
|
5656
5709
|
<div class="content-element markdown-content">
|
|
5657
5710
|
<div class="markdown-text">
|
|
5658
5711
|
${Ae($.renderMarkdown(e.content))}
|
|
@@ -5661,22 +5714,22 @@ class $ {
|
|
|
5661
5714
|
`;
|
|
5662
5715
|
}
|
|
5663
5716
|
static renderDivider(e) {
|
|
5664
|
-
return
|
|
5717
|
+
return d`
|
|
5665
5718
|
<div class="content-element divider-content">
|
|
5666
5719
|
<hr class="content-divider" />
|
|
5667
|
-
${e.caption ?
|
|
5720
|
+
${e.caption ? d`<div class="divider-caption">${e.caption}</div>` : ""}
|
|
5668
5721
|
</div>
|
|
5669
5722
|
`;
|
|
5670
5723
|
}
|
|
5671
5724
|
static renderHtml(e) {
|
|
5672
|
-
return
|
|
5725
|
+
return d`
|
|
5673
5726
|
<div class="content-element html-content">
|
|
5674
5727
|
<div class="html-content-wrapper">${Ae(e.content)}</div>
|
|
5675
5728
|
</div>
|
|
5676
5729
|
`;
|
|
5677
5730
|
}
|
|
5678
5731
|
static renderImage(e) {
|
|
5679
|
-
return
|
|
5732
|
+
return d`
|
|
5680
5733
|
<div class="content-element image-content">
|
|
5681
5734
|
<div class="image-placeholder">
|
|
5682
5735
|
<p>📷 Image: ${e.caption || e.alt || "Image content"}</p>
|
|
@@ -5686,7 +5739,7 @@ class $ {
|
|
|
5686
5739
|
`;
|
|
5687
5740
|
}
|
|
5688
5741
|
static renderVideo(e) {
|
|
5689
|
-
return
|
|
5742
|
+
return d`
|
|
5690
5743
|
<div class="content-element video-content">
|
|
5691
5744
|
<div class="video-placeholder">
|
|
5692
5745
|
<p>🎥 Video: ${e.caption || "Video content"}</p>
|
|
@@ -5696,7 +5749,7 @@ class $ {
|
|
|
5696
5749
|
`;
|
|
5697
5750
|
}
|
|
5698
5751
|
static renderFile(e) {
|
|
5699
|
-
return
|
|
5752
|
+
return d`
|
|
5700
5753
|
<div class="content-element file-content">
|
|
5701
5754
|
<div class="file-placeholder">
|
|
5702
5755
|
<p>📄 File: ${e.caption || "File content"}</p>
|
|
@@ -5706,7 +5759,7 @@ class $ {
|
|
|
5706
5759
|
`;
|
|
5707
5760
|
}
|
|
5708
5761
|
static renderUnknown(e) {
|
|
5709
|
-
return
|
|
5762
|
+
return d`
|
|
5710
5763
|
<div class="content-element unknown-content">
|
|
5711
5764
|
<p>⚠️ Unknown content type: ${e.type}</p>
|
|
5712
5765
|
</div>
|
|
@@ -5733,10 +5786,10 @@ class $ {
|
|
|
5733
5786
|
return $.renderUnknown(e);
|
|
5734
5787
|
}
|
|
5735
5788
|
};
|
|
5736
|
-
return (t == null ? void 0 : t.mode) === "print" ?
|
|
5789
|
+
return (t == null ? void 0 : t.mode) === "print" ? d`
|
|
5737
5790
|
<div class="content-print">
|
|
5738
5791
|
${n()}
|
|
5739
|
-
${e.type !== "divider" ?
|
|
5792
|
+
${e.type !== "divider" ? d`<hr class="print-question-separator" />` : ""}
|
|
5740
5793
|
</div>
|
|
5741
5794
|
` : n();
|
|
5742
5795
|
}
|
|
@@ -5744,13 +5797,13 @@ class $ {
|
|
|
5744
5797
|
class Me {
|
|
5745
5798
|
static renderMobileStepsForStatus(e) {
|
|
5746
5799
|
const { steps: t, disabled: n = !1 } = e;
|
|
5747
|
-
return
|
|
5800
|
+
return d`
|
|
5748
5801
|
<div class="runner-mobile-steps">
|
|
5749
5802
|
<nav aria-label="Workflow steps">
|
|
5750
5803
|
<div class="runner-mobile-steps-container">
|
|
5751
5804
|
${t == null ? void 0 : t.map((s) => {
|
|
5752
5805
|
const r = e.isStepAssignedToUser(s), o = e.completedSteps.has(s.id);
|
|
5753
|
-
return
|
|
5806
|
+
return d`
|
|
5754
5807
|
<div
|
|
5755
5808
|
class="runner-mobile-step-tab ${o ? "completed" : ""} ${r ? "" : "unassigned"} ${n ? "disabled" : ""}"
|
|
5756
5809
|
style="cursor: not-allowed; opacity: ${n ? "0.6" : r ? "1" : "0.6"};"
|
|
@@ -5768,7 +5821,7 @@ class Me {
|
|
|
5768
5821
|
`;
|
|
5769
5822
|
}
|
|
5770
5823
|
static renderNotAssignedView() {
|
|
5771
|
-
return
|
|
5824
|
+
return d`
|
|
5772
5825
|
<div class="runner-content not-assigned-view">
|
|
5773
5826
|
<div class="not-assigned-container">
|
|
5774
5827
|
<div class="not-assigned-icon">
|
|
@@ -5795,7 +5848,7 @@ class Me {
|
|
|
5795
5848
|
}
|
|
5796
5849
|
static renderUnifiedSubmissionView(e) {
|
|
5797
5850
|
var t, n, s;
|
|
5798
|
-
return
|
|
5851
|
+
return d`
|
|
5799
5852
|
<div class="runner-layout">
|
|
5800
5853
|
<!-- Mobile Steps Navigation (visible only on mobile) -->
|
|
5801
5854
|
${this.renderMobileStepsForStatus({
|
|
@@ -5812,7 +5865,7 @@ class Me {
|
|
|
5812
5865
|
<ul class="runner-steps-list">
|
|
5813
5866
|
${(s = (n = e.instance) == null ? void 0 : n.steps) == null ? void 0 : s.map((r) => {
|
|
5814
5867
|
const o = e.isStepAssignedToUser(r), a = e.completedSteps.has(r.id);
|
|
5815
|
-
return
|
|
5868
|
+
return d`
|
|
5816
5869
|
<li
|
|
5817
5870
|
class="runner-step-item ${a ? "completed" : ""} ${o ? "" : "unassigned"}"
|
|
5818
5871
|
style="opacity: ${o ? "1" : "0.6"}; cursor: not-allowed;"
|
|
@@ -5865,22 +5918,22 @@ class R {
|
|
|
5865
5918
|
}
|
|
5866
5919
|
static renderSidebar(e) {
|
|
5867
5920
|
const { steps: t } = e;
|
|
5868
|
-
return
|
|
5921
|
+
return d`
|
|
5869
5922
|
<aside class="runner-sidebar">
|
|
5870
5923
|
<div class="runner-sidebar-header">Steps</div>
|
|
5871
5924
|
<nav aria-label="Workflow steps">
|
|
5872
5925
|
<ul class="runner-steps-list">
|
|
5873
5926
|
${t == null ? void 0 : t.map((n, s) => {
|
|
5874
|
-
const r = e.mode === "preview" || e.mode === "admin" || e.mode === "view-only" || e.mode === "print" || e.isStepAssignedToUser(n), o = s === e.currentStepIndex, a = this.isStepCompleted(n, e, r),
|
|
5875
|
-
return
|
|
5927
|
+
const r = e.mode === "preview" || e.mode === "admin" || e.mode === "view-only" || e.mode === "print" || e.isStepAssignedToUser(n), o = s === e.currentStepIndex, a = this.isStepCompleted(n, e, r), l = (e.isSubmitted || e.userStepsSubmitted) && e.mode !== "preview" && e.mode !== "admin" && e.mode !== "view-only" && e.mode !== "print", p = e.isLoading;
|
|
5928
|
+
return d`
|
|
5876
5929
|
<li
|
|
5877
|
-
class="runner-step-item ${o ? "active" : ""} ${a ? "completed" : ""} ${r ? "" : "unassigned"} ${
|
|
5930
|
+
class="runner-step-item ${o ? "active" : ""} ${a ? "completed" : ""} ${r ? "" : "unassigned"} ${l ? "disabled" : ""} ${p ? "loading-disabled" : ""}"
|
|
5878
5931
|
@click=${() => !p && e.goToStep(s)}
|
|
5879
|
-
style="${
|
|
5932
|
+
style="${l ? "opacity: 0.5; cursor: not-allowed;" : ""}"
|
|
5880
5933
|
>
|
|
5881
5934
|
<span class="runner-step-title">${n.title}</span>
|
|
5882
5935
|
<span class="runner-step-badge">
|
|
5883
|
-
${e.mode === "preview" ? "Preview" : e.mode === "admin" ? "Admin" : e.mode === "view-only" ? "View Only" : e.mode === "print" ? "Print" :
|
|
5936
|
+
${e.mode === "preview" ? "Preview" : e.mode === "admin" ? "Admin" : e.mode === "view-only" ? "View Only" : e.mode === "print" ? "Print" : l ? "Submitted" : a ? "Completed" : r ? "Assigned" : "Not Assigned"}
|
|
5884
5937
|
</span>
|
|
5885
5938
|
</li>
|
|
5886
5939
|
`;
|
|
@@ -5892,22 +5945,22 @@ class R {
|
|
|
5892
5945
|
}
|
|
5893
5946
|
static renderMobileSteps(e) {
|
|
5894
5947
|
const { steps: t } = e;
|
|
5895
|
-
return
|
|
5948
|
+
return d`
|
|
5896
5949
|
<div class="runner-mobile-steps">
|
|
5897
5950
|
<nav aria-label="Workflow steps">
|
|
5898
5951
|
<div class="runner-mobile-steps-container">
|
|
5899
5952
|
${t == null ? void 0 : t.map((n, s) => {
|
|
5900
|
-
const r = e.mode === "preview" || e.mode === "admin" || e.mode === "view-only" || e.mode === "print" || e.isStepAssignedToUser(n), o = s === e.currentStepIndex, a = this.isStepCompleted(n, e, r),
|
|
5901
|
-
return
|
|
5953
|
+
const r = e.mode === "preview" || e.mode === "admin" || e.mode === "view-only" || e.mode === "print" || e.isStepAssignedToUser(n), o = s === e.currentStepIndex, a = this.isStepCompleted(n, e, r), l = (e.isSubmitted || e.userStepsSubmitted) && e.mode !== "preview" && e.mode !== "admin" && e.mode !== "view-only" && e.mode !== "print", p = e.isLoading;
|
|
5954
|
+
return d`
|
|
5902
5955
|
<button
|
|
5903
|
-
class="runner-mobile-step-tab ${o ? "active" : ""} ${a ? "completed" : ""} ${r ? "" : "unassigned"} ${
|
|
5956
|
+
class="runner-mobile-step-tab ${o ? "active" : ""} ${a ? "completed" : ""} ${r ? "" : "unassigned"} ${l ? "disabled" : ""} ${p ? "loading-disabled" : ""}"
|
|
5904
5957
|
@click=${() => !p && e.goToStep(s)}
|
|
5905
|
-
?disabled=${
|
|
5958
|
+
?disabled=${l || p}
|
|
5906
5959
|
aria-current=${o ? "step" : "false"}
|
|
5907
5960
|
>
|
|
5908
5961
|
<span class="runner-mobile-step-title">${n.title}</span>
|
|
5909
5962
|
<span class="runner-mobile-step-badge">
|
|
5910
|
-
${e.mode === "preview" ? "Preview" : e.mode === "admin" ? "Admin" : e.mode === "view-only" ? "View Only" : e.mode === "print" ? "Print" :
|
|
5963
|
+
${e.mode === "preview" ? "Preview" : e.mode === "admin" ? "Admin" : e.mode === "view-only" ? "View Only" : e.mode === "print" ? "Print" : l ? "Submitted" : a ? "Completed" : r ? "Assigned" : "Not Assigned"}
|
|
5911
5964
|
</span>
|
|
5912
5965
|
</button>
|
|
5913
5966
|
`;
|
|
@@ -5919,24 +5972,24 @@ class R {
|
|
|
5919
5972
|
}
|
|
5920
5973
|
static renderStepHeader(e) {
|
|
5921
5974
|
const { step: t, mode: n } = e;
|
|
5922
|
-
return n === "print" ?
|
|
5975
|
+
return n === "print" ? d`
|
|
5923
5976
|
<div class="step-print-header">
|
|
5924
5977
|
<div class="print-step-title">${t.title}</div>
|
|
5925
|
-
${t.description ?
|
|
5978
|
+
${t.description ? d`<div class="print-step-description">${t.description}</div>` : ""}
|
|
5926
5979
|
<hr class="print-question-separator" />
|
|
5927
5980
|
</div>
|
|
5928
|
-
` :
|
|
5981
|
+
` : d`
|
|
5929
5982
|
<section class="runner-step-header">
|
|
5930
5983
|
<h2 class="runner-step-title">${t.title}</h2>
|
|
5931
5984
|
<hr class="runner-step-divider" />
|
|
5932
|
-
${t.description ?
|
|
5985
|
+
${t.description ? d`<p class="runner-step-desc">${t.description}</p>` : ""}
|
|
5933
5986
|
</section>
|
|
5934
5987
|
`;
|
|
5935
5988
|
}
|
|
5936
5989
|
}
|
|
5937
5990
|
class Dt {
|
|
5938
5991
|
static renderFormActions(e) {
|
|
5939
|
-
return e.mode === "preview" || e.mode === "view-only" || e.mode === "print" || !e.isCurrentStepAssigned ?
|
|
5992
|
+
return e.mode === "preview" || e.mode === "view-only" || e.mode === "print" || !e.isCurrentStepAssigned ? d`` : d`
|
|
5940
5993
|
<div class="runner-form-actions">
|
|
5941
5994
|
<button
|
|
5942
5995
|
class="next-button ${e.mode === "admin" && e.justSaved ? "saved-state" : ""}"
|
|
@@ -5949,37 +6002,37 @@ class Dt {
|
|
|
5949
6002
|
`;
|
|
5950
6003
|
}
|
|
5951
6004
|
}
|
|
5952
|
-
class
|
|
6005
|
+
class de {
|
|
5953
6006
|
/**
|
|
5954
6007
|
* Handles change events for basic text inputs, textareas, selects, numbers, dates
|
|
5955
6008
|
*/
|
|
5956
6009
|
static handleInputChange(e, t, n, s, r, o) {
|
|
5957
6010
|
const a = t.target;
|
|
5958
|
-
let
|
|
5959
|
-
a.type === "radio" ?
|
|
6011
|
+
let l;
|
|
6012
|
+
a.type === "radio" ? l = a.value : a.type === "checkbox" ? l = a.checked : l = a.value;
|
|
5960
6013
|
const p = {
|
|
5961
6014
|
...n,
|
|
5962
|
-
[e]:
|
|
6015
|
+
[e]: l
|
|
5963
6016
|
};
|
|
5964
|
-
s(p), o !== "preview" && r(e,
|
|
6017
|
+
s(p), o !== "preview" && r(e, l);
|
|
5965
6018
|
}
|
|
5966
6019
|
/**
|
|
5967
6020
|
* Handles change events for single checkboxes
|
|
5968
6021
|
*/
|
|
5969
6022
|
static handleCheckboxChange(e, t, n, s, r, o) {
|
|
5970
|
-
const
|
|
6023
|
+
const l = t.target.checked, p = {
|
|
5971
6024
|
...n,
|
|
5972
|
-
[e]:
|
|
6025
|
+
[e]: l
|
|
5973
6026
|
};
|
|
5974
|
-
s(p), o !== "preview" && r(e,
|
|
6027
|
+
s(p), o !== "preview" && r(e, l);
|
|
5975
6028
|
}
|
|
5976
6029
|
/**
|
|
5977
6030
|
* Handles change events for checkbox groups (multiple checkboxes with same name)
|
|
5978
6031
|
*/
|
|
5979
6032
|
static handleCheckboxGroupChange(e, t, n, s, r, o, a) {
|
|
5980
|
-
const
|
|
6033
|
+
const l = n.target, p = s[e];
|
|
5981
6034
|
let c = Array.isArray(p) ? [...p] : [];
|
|
5982
|
-
|
|
6035
|
+
l.checked ? c.includes(t) || c.push(t) : c = c.filter((h) => h !== t);
|
|
5983
6036
|
const u = {
|
|
5984
6037
|
...s,
|
|
5985
6038
|
[e]: c
|
|
@@ -6148,7 +6201,7 @@ let m = class extends P {
|
|
|
6148
6201
|
return this.formStateManager.setValidationErrors(e.errors), this._validationErrors = this.formStateManager.getValidationErrors(), e.isValid;
|
|
6149
6202
|
}
|
|
6150
6203
|
_handleInputChange(i, e) {
|
|
6151
|
-
|
|
6204
|
+
de.handleInputChange(
|
|
6152
6205
|
i,
|
|
6153
6206
|
e,
|
|
6154
6207
|
this._formData,
|
|
@@ -6158,7 +6211,7 @@ let m = class extends P {
|
|
|
6158
6211
|
), this._handleFormDataUpdate(i);
|
|
6159
6212
|
}
|
|
6160
6213
|
_handleCheckboxChange(i, e) {
|
|
6161
|
-
|
|
6214
|
+
de.handleCheckboxChange(
|
|
6162
6215
|
i,
|
|
6163
6216
|
e,
|
|
6164
6217
|
this._formData,
|
|
@@ -6168,7 +6221,7 @@ let m = class extends P {
|
|
|
6168
6221
|
), this._handleFormDataUpdate(i);
|
|
6169
6222
|
}
|
|
6170
6223
|
_handleCheckboxGroupChange(i, e, t) {
|
|
6171
|
-
|
|
6224
|
+
de.handleCheckboxGroupChange(
|
|
6172
6225
|
i,
|
|
6173
6226
|
e,
|
|
6174
6227
|
t,
|
|
@@ -6258,16 +6311,16 @@ let m = class extends P {
|
|
|
6258
6311
|
return m.CONTENT_ELEMENT_TYPES.includes(i.type);
|
|
6259
6312
|
}
|
|
6260
6313
|
_renderStepElement(i) {
|
|
6261
|
-
return this.mode === "print" ? this._isQuestionElement(i) ? this._renderQuestion(i) : this._isContentElement(i) ? this._renderContentElement(i) :
|
|
6314
|
+
return this.mode === "print" ? this._isQuestionElement(i) ? this._renderQuestion(i) : this._isContentElement(i) ? this._renderContentElement(i) : d`<div class="unknown-element">
|
|
6262
6315
|
<p>⚠️ Unknown element type: ${i.type}</p>
|
|
6263
|
-
</div>` : this._isQuestionElement(i) ?
|
|
6316
|
+
</div>` : this._isQuestionElement(i) ? d`<div class="runner-card">${this._renderQuestion(i)}</div>` : this._isContentElement(i) ? d`<div class="runner-card">${this._renderContentElement(i)}</div>` : d`<div class="runner-card">
|
|
6264
6317
|
<div class="unknown-element">
|
|
6265
6318
|
<p>⚠️ Unknown element type: ${i.type}</p>
|
|
6266
6319
|
</div>
|
|
6267
6320
|
</div>`;
|
|
6268
6321
|
}
|
|
6269
6322
|
_renderStepWithElements(i) {
|
|
6270
|
-
return
|
|
6323
|
+
return d`
|
|
6271
6324
|
<div class="print-step">
|
|
6272
6325
|
<!-- Step Header -->
|
|
6273
6326
|
${R.renderStepHeader({ step: i, mode: "print" })}
|
|
@@ -6279,9 +6332,9 @@ let m = class extends P {
|
|
|
6279
6332
|
}
|
|
6280
6333
|
_renderAllStepsForPrint() {
|
|
6281
6334
|
var i;
|
|
6282
|
-
return !((i = this.instance) != null && i.steps) || this.instance.steps.length === 0 ?
|
|
6335
|
+
return !((i = this.instance) != null && i.steps) || this.instance.steps.length === 0 ? d`<div class="runner-content">
|
|
6283
6336
|
No workflow instance loaded or instance has no steps.
|
|
6284
|
-
</div>` :
|
|
6337
|
+
</div>` : d`
|
|
6285
6338
|
<div class="print-layout">
|
|
6286
6339
|
<!-- Instance Title at top -->
|
|
6287
6340
|
<div class="print-instance-title">${this.instance.name || "Untitled Form"}</div>
|
|
@@ -6300,8 +6353,8 @@ let m = class extends P {
|
|
|
6300
6353
|
if (e !== -1) {
|
|
6301
6354
|
const o = (t = this._currentStep) == null ? void 0 : t.id;
|
|
6302
6355
|
if (this._currentStepIndex = e, o && ((n = this.instance) != null && n.steps)) {
|
|
6303
|
-
const
|
|
6304
|
-
|
|
6356
|
+
const l = this.instance.steps.find((p) => p.id === o);
|
|
6357
|
+
l && (l.status = "completed");
|
|
6305
6358
|
}
|
|
6306
6359
|
const a = (r = (s = this.instance) == null ? void 0 : s.steps) == null ? void 0 : r[this._currentStepIndex];
|
|
6307
6360
|
a && (a.status = "active"), this._updateInstanceData(o, "step_navigation", {
|
|
@@ -6400,9 +6453,9 @@ let m = class extends P {
|
|
|
6400
6453
|
});
|
|
6401
6454
|
}
|
|
6402
6455
|
_updateInstanceData(i, e, t) {
|
|
6403
|
-
var
|
|
6456
|
+
var l, p, c, u, h, g, b;
|
|
6404
6457
|
i && this._internalCompletedSteps.add(i);
|
|
6405
|
-
let n = (p = (
|
|
6458
|
+
let n = (p = (l = this.instance) == null ? void 0 : l.steps) == null ? void 0 : p.find((k) => k.id === i);
|
|
6406
6459
|
if (!n && this._internalCompletedSteps.size > 0) {
|
|
6407
6460
|
const k = Array.from(this._internalCompletedSteps), G = k[k.length - 1];
|
|
6408
6461
|
n = (u = (c = this.instance) == null ? void 0 : c.steps) == null ? void 0 : u.find((Y) => Y.id === G);
|
|
@@ -6543,7 +6596,7 @@ let m = class extends P {
|
|
|
6543
6596
|
if (s.type === "text_input" || s.type === "textarea" || s.type === "select" || s.type === "number" || s.type === "radio" || s.type === "checkbox" || s.type === "date" || s.type === "file_upload" || s.type === "signature") {
|
|
6544
6597
|
const r = s, o = this._formData[r.id];
|
|
6545
6598
|
if (o !== void 0 && n.responses) {
|
|
6546
|
-
let a = n.responses.find((
|
|
6599
|
+
let a = n.responses.find((l) => l.elementId === r.id);
|
|
6547
6600
|
a ? (a.value = o, a.answeredAt = /* @__PURE__ */ new Date()) : (a = {
|
|
6548
6601
|
elementId: r.id,
|
|
6549
6602
|
value: o,
|
|
@@ -6631,7 +6684,7 @@ let m = class extends P {
|
|
|
6631
6684
|
if (this.mode === "print")
|
|
6632
6685
|
return this._renderAllStepsForPrint();
|
|
6633
6686
|
const i = this.mode === "preview" ? (e = this.workflow) == null ? void 0 : e.steps : (t = this.instance) == null ? void 0 : t.steps;
|
|
6634
|
-
return !i || i.length === 0 ?
|
|
6687
|
+
return !i || i.length === 0 ? d`<div class="runner-content">
|
|
6635
6688
|
${this.mode === "preview" ? "No workflow loaded or workflow has no steps." : "No workflow instance loaded or instance has no steps."}
|
|
6636
6689
|
</div>` : this.mode === "default" && this._getAssignedSteps().length === 0 ? this._renderNotAssignedView() : null;
|
|
6637
6690
|
}
|
|
@@ -6663,7 +6716,7 @@ let m = class extends P {
|
|
|
6663
6716
|
_renderCurrentStepLayout(i) {
|
|
6664
6717
|
var s, r;
|
|
6665
6718
|
const e = this._isLastAssignedStep(), t = this._isLastStepInWorkflow(), n = this.mode === "preview" ? (s = this.workflow) == null ? void 0 : s.steps : (r = this.instance) == null ? void 0 : r.steps;
|
|
6666
|
-
return
|
|
6719
|
+
return d`
|
|
6667
6720
|
<!-- Mobile Steps Navigation (visible only on mobile) -->
|
|
6668
6721
|
${R.renderMobileSteps({
|
|
6669
6722
|
steps: n,
|
|
@@ -6692,7 +6745,7 @@ let m = class extends P {
|
|
|
6692
6745
|
|
|
6693
6746
|
<!-- Main Content: Step Details and Questions -->
|
|
6694
6747
|
<main class="runner-main-content">
|
|
6695
|
-
${this.mode === "print" ? R.renderStepHeader({ step: i, mode: this.mode }) :
|
|
6748
|
+
${this.mode === "print" ? R.renderStepHeader({ step: i, mode: this.mode }) : d`<div class="runner-card">
|
|
6696
6749
|
${R.renderStepHeader({
|
|
6697
6750
|
step: i,
|
|
6698
6751
|
mode: this.mode
|
|
@@ -6722,15 +6775,15 @@ let m = class extends P {
|
|
|
6722
6775
|
if (i)
|
|
6723
6776
|
return i;
|
|
6724
6777
|
const e = this._validateCurrentStep();
|
|
6725
|
-
return e ? (this._initializeStepAssets(e), this._renderCurrentStepLayout(e)) :
|
|
6778
|
+
return e ? (this._initializeStepAssets(e), this._renderCurrentStepLayout(e)) : d`<div class="runner-content">Invalid current step.</div>`;
|
|
6726
6779
|
}
|
|
6727
6780
|
render() {
|
|
6728
|
-
return
|
|
6781
|
+
return d`
|
|
6729
6782
|
<div class="runner-layout">
|
|
6730
6783
|
${this._renderMainContent()}
|
|
6731
6784
|
|
|
6732
6785
|
<!-- Loading overlay with white box (conditionally rendered) -->
|
|
6733
|
-
${this.isLoading ?
|
|
6786
|
+
${this.isLoading ? d`
|
|
6734
6787
|
<div class="runner-loading-overlay">
|
|
6735
6788
|
<div class="runner-loading-box">
|
|
6736
6789
|
<div class="runner-loading-spinner"></div>
|
|
@@ -6848,7 +6901,7 @@ function Jt(i, e = {}) {
|
|
|
6848
6901
|
<hr class="print-question-separator" />
|
|
6849
6902
|
|
|
6850
6903
|
${r ? Vt(i, o) : ""}
|
|
6851
|
-
${i.steps.map((
|
|
6904
|
+
${i.steps.map((l) => At(l)).join(`
|
|
6852
6905
|
`)}
|
|
6853
6906
|
</div>
|
|
6854
6907
|
</body>
|
|
@@ -6891,9 +6944,9 @@ function Tt(i, e) {
|
|
|
6891
6944
|
case "text_input":
|
|
6892
6945
|
case "number":
|
|
6893
6946
|
case "date":
|
|
6894
|
-
return r + Ut(i, n) + o;
|
|
6895
|
-
case "textarea":
|
|
6896
6947
|
return r + It(i, n) + o;
|
|
6948
|
+
case "textarea":
|
|
6949
|
+
return r + Ut(i, n) + o;
|
|
6897
6950
|
case "select":
|
|
6898
6951
|
return r + Pt(i, n) + o;
|
|
6899
6952
|
case "radio":
|
|
@@ -7008,7 +7061,7 @@ function zt(i) {
|
|
|
7008
7061
|
`;
|
|
7009
7062
|
}
|
|
7010
7063
|
}
|
|
7011
|
-
function
|
|
7064
|
+
function It(i, e) {
|
|
7012
7065
|
const t = e != null ? f(String(e)) : "";
|
|
7013
7066
|
return `
|
|
7014
7067
|
<div class="print-response-value input-response">
|
|
@@ -7016,7 +7069,7 @@ function Ut(i, e) {
|
|
|
7016
7069
|
</div>
|
|
7017
7070
|
`;
|
|
7018
7071
|
}
|
|
7019
|
-
function
|
|
7072
|
+
function Ut(i, e) {
|
|
7020
7073
|
return `
|
|
7021
7074
|
<div class="print-response-value textarea-response">
|
|
7022
7075
|
${(e != null ? f(String(e)) : "") || '<span class="print-no-response">No response</span>'}
|
|
@@ -7678,7 +7731,7 @@ function Xt(i, e = {}) {
|
|
|
7678
7731
|
return console.error(`Error: Target element with ID '${i}' not found.`), null;
|
|
7679
7732
|
t.innerHTML = "";
|
|
7680
7733
|
const n = document.createElement("builder-widget");
|
|
7681
|
-
return e.onWorkflowCreated && (n.onWorkflowCreated = e.onWorkflowCreated), e.onWorkflowDeleted && (n.onWorkflowDeleted = e.onWorkflowDeleted), e.onWorkflowUpdated && (n.onWorkflowUpdated = e.onWorkflowUpdated), t.appendChild(n), console.log(`Drill Builder mounted on #${i}`), n;
|
|
7734
|
+
return e.workflow && (n.workflow = e.workflow), e.onWorkflowCreated && (n.onWorkflowCreated = e.onWorkflowCreated), e.onWorkflowDeleted && (n.onWorkflowDeleted = e.onWorkflowDeleted), e.onWorkflowUpdated && (n.onWorkflowUpdated = e.onWorkflowUpdated), t.appendChild(n), console.log(`Drill Builder mounted on #${i}`), n;
|
|
7682
7735
|
}
|
|
7683
7736
|
function Zt(i, e) {
|
|
7684
7737
|
if (!customElements.get("runner-widget"))
|
|
@@ -7715,7 +7768,7 @@ function ei(i, e) {
|
|
|
7715
7768
|
if (r.type === "text_input" || r.type === "textarea" || r.type === "select" || r.type === "number" || r.type === "radio" || r.type === "checkbox" || r.type === "date" || r.type === "file_upload" || r.type === "signature") {
|
|
7716
7769
|
const o = t[r.id];
|
|
7717
7770
|
if (o !== void 0) {
|
|
7718
|
-
let a = s.responses.find((
|
|
7771
|
+
let a = s.responses.find((l) => l.elementId === r.id);
|
|
7719
7772
|
a ? (a.value = o, a.answeredAt = /* @__PURE__ */ new Date()) : (a = {
|
|
7720
7773
|
elementId: r.id,
|
|
7721
7774
|
value: o,
|