@factorialco/f0-react 14.23.1 → 14.24.1
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/component-status.js +1 -1
- package/dist/f0.d.ts +26 -2
- package/dist/f0.js +826 -823
- package/package.json +1 -1
package/dist/f0.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as e } from "./rolldown-runtime-BItFwnF5.js";
|
|
2
|
-
import { $ as t, $n as n, $r as r, $t as i, A as a, An as o, Ar as s, Bn as c, Bt as l, C as u, Ci as d, Cn as f, Cr as p, D as m, Dn as h, Dr as g, Dt as _, E as v, En as y, Er as b, F as x, Fn as S, Ft as C, Gn as w, Gr as T, Gt as E, Hn as D, Ht as O, I as k, In as A, It as j, Jn as M, Jr as N, Jt as P, Kn as F, Kr as
|
|
2
|
+
import { $ as t, $n as n, $r as r, $t as i, A as a, An as o, Ar as s, Bn as c, Bt as l, C as u, Ci as d, Cn as f, Cr as p, D as m, Dn as h, Dr as g, Dt as _, E as v, En as y, Er as b, F as x, Fn as S, Ft as C, Gn as w, Gr as T, Gt as E, Hn as D, Ht as O, I as k, In as A, It as j, Jn as M, Jr as N, Jt as P, Kn as F, Kr as I, Kt as ee, Ln as te, Lt as ne, M as re, Mn as ie, Mr as ae, N as oe, Nn as se, Nt as ce, O as le, On as ue, Or as de, P as fe, Pn as pe, Pt as me, Q as he, Qn as ge, Qr as _e, Rn as ve, Rt as ye, S as be, Sn as xe, Sr as Se, T as Ce, Tn as we, Tr as Te, Un as Ee, Ur as De, Ut as Oe, Vn as ke, Vt as Ae, Wn as je, Wt as Me, Xn as Ne, Xr as Pe, Xt as Fe, Yn as Ie, Zr as Le, Zt as Re, _ as ze, _r as Be, _t as Ve, an as He, ar as Ue, b as We, bi as Ge, bn as Ke, br as qe, bt as Je, c as Ye, cn as Xe, cr as Ze, ct as Qe, d as $e, di as et, dr as tt, dt as nt, en as rt, er as it, f as at, fi as ot, fr as st, gr as ct, gt as lt, h as ut, hr as dt, ht as ft, i as pt, ii as mt, ir as ht, j as gt, jn as _t, jr as vt, k as yt, kn as bt, kr as xt, l as St, ln as Ct, lr as wt, m as Tt, mr as Et, mt as Dt, ni as Ot, nn as kt, nr as At, on as jt, or as Mt, pr as Nt, pt as Pt, qn as Ft, qr as It, qt as Lt, ri as Rt, rr as zt, s as Bt, sn as Vt, sr as Ht, t as Ut, ti as Wt, tn as Gt, tr as Kt, u as qt, ui as Jt, ur as Yt, v as Xt, vi as Zt, vr as Qt, vt as $t, w as en, wn as tn, wr as nn, x as rn, xn as an, xr as on, y as sn, yi as cn, yr as ln, yt as un, zn as dn } from "./CoachmarkProvider-DXN2crWr.js";
|
|
3
3
|
import { a as L, i as fn, n as pn, o as mn, r as R, t as hn } from "./i18n-provider-DzFN07EQ.js";
|
|
4
4
|
import { n as gn, t as z } from "./skeleton-DISb7cNz.js";
|
|
5
5
|
import { A as _n, C as vn, D as yn, F as bn, I as xn, L as B, M as Sn, N as Cn, O as wn, P as Tn, R as En, S as Dn, _ as On, b as kn, c as An, f as jn, g as Mn, h as Nn, j as Pn, k as Fn, l as In, m as Ln, p as Rn, v as zn, w as Bn, x as Vn, y as Hn } from "./tooltip-DFMOxXQO.js";
|
|
@@ -133,16 +133,9 @@ function Bc(e) {
|
|
|
133
133
|
content: () => document.createElement("div")
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
|
-
function Vc(e) {
|
|
137
|
-
let t = Bc(e);
|
|
138
|
-
return e.subGridOpts?.children && (t.subGridOpts = {
|
|
139
|
-
...e.subGridOpts,
|
|
140
|
-
children: e.subGridOpts.children.map((e) => Vc(e))
|
|
141
|
-
}), t;
|
|
142
|
-
}
|
|
143
136
|
//#endregion
|
|
144
137
|
//#region src/blocks/F0GridStack/components/grid-stack-provider.tsx
|
|
145
|
-
var
|
|
138
|
+
var Vc = [
|
|
146
139
|
"noMove",
|
|
147
140
|
"noResize",
|
|
148
141
|
"locked",
|
|
@@ -150,8 +143,8 @@ var Hc = [
|
|
|
150
143
|
"h",
|
|
151
144
|
"x",
|
|
152
145
|
"y"
|
|
153
|
-
],
|
|
154
|
-
function
|
|
146
|
+
], Hc = 200;
|
|
147
|
+
function Uc(e) {
|
|
155
148
|
let t = e.cloneNode(!0);
|
|
156
149
|
return e.querySelectorAll("canvas").forEach((n) => {
|
|
157
150
|
if (n.width > 0 && n.height > 0) try {
|
|
@@ -165,32 +158,22 @@ function Wc(e) {
|
|
|
165
158
|
}
|
|
166
159
|
}), t.innerHTML;
|
|
167
160
|
}
|
|
168
|
-
function
|
|
161
|
+
function Wc({ children: e, options: t, onResizeStop: n, onChange: r, widgets: i, static: a, forcePositionSync: o }) {
|
|
169
162
|
let [s, c] = J(null), l = q(null), u = q(!1), d = K(() => ({
|
|
170
163
|
...t,
|
|
171
|
-
children: (i || []).map((e) =>
|
|
164
|
+
children: (i || []).map((e) => Bc(e))
|
|
172
165
|
}), [t, i]), [f, p] = J(() => {
|
|
173
|
-
let e = /* @__PURE__ */ new Map()
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
});
|
|
177
|
-
};
|
|
178
|
-
return t.forEach((e) => {
|
|
179
|
-
n(e);
|
|
180
|
-
}), e;
|
|
166
|
+
let e = /* @__PURE__ */ new Map();
|
|
167
|
+
for (let t of i || []) t.id && t.content && e.set(t.id, t.content);
|
|
168
|
+
return e;
|
|
181
169
|
}), m = q(f);
|
|
182
170
|
G(() => {
|
|
183
171
|
m.current = f;
|
|
184
172
|
}, [f]);
|
|
185
173
|
let [h, g] = J(() => {
|
|
186
|
-
let e = /* @__PURE__ */ new Map()
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
});
|
|
190
|
-
};
|
|
191
|
-
return t.forEach((e) => {
|
|
192
|
-
n(e);
|
|
193
|
-
}), e;
|
|
174
|
+
let e = /* @__PURE__ */ new Map();
|
|
175
|
+
for (let t of i || []) t.id && t._originalContent !== void 0 && e.set(t.id, t._originalContent);
|
|
176
|
+
return e;
|
|
194
177
|
}), _ = q(h);
|
|
195
178
|
G(() => {
|
|
196
179
|
_.current = h;
|
|
@@ -200,18 +183,9 @@ function Gc({ children: e, options: t, onResizeStop: n, onChange: r, widgets: i,
|
|
|
200
183
|
v.current = r;
|
|
201
184
|
}, [r]);
|
|
202
185
|
let [y, b] = J(() => {
|
|
203
|
-
let e = /* @__PURE__ */ new Map()
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
e.set(t.id, n);
|
|
207
|
-
}
|
|
208
|
-
t.subGridOpts?.children && t.subGridOpts.children.forEach((e) => {
|
|
209
|
-
n(e);
|
|
210
|
-
});
|
|
211
|
-
};
|
|
212
|
-
return t.forEach((e) => {
|
|
213
|
-
n(e);
|
|
214
|
-
}), e;
|
|
186
|
+
let e = /* @__PURE__ */ new Map();
|
|
187
|
+
for (let t of i || []) t.id && e.set(t.id, Bc(t));
|
|
188
|
+
return e;
|
|
215
189
|
});
|
|
216
190
|
os(() => {
|
|
217
191
|
if (!s) return;
|
|
@@ -221,12 +195,12 @@ function Gc({ children: e, options: t, onResizeStop: n, onChange: r, widgets: i,
|
|
|
221
195
|
a.length > 0 && (a.forEach((e) => {
|
|
222
196
|
e.content && m.current.set(e.id, e.content), e._originalContent !== void 0 && _.current.set(e.id, e._originalContent);
|
|
223
197
|
}), a.forEach((e) => {
|
|
224
|
-
let t =
|
|
198
|
+
let t = Bc(e);
|
|
225
199
|
s.addWidget(t);
|
|
226
200
|
}), b((e) => {
|
|
227
201
|
let t = new Map(e);
|
|
228
202
|
return a.forEach((e) => {
|
|
229
|
-
let n =
|
|
203
|
+
let n = Bc(e);
|
|
230
204
|
t.set(e.id, n);
|
|
231
205
|
}), t;
|
|
232
206
|
}), p((e) => {
|
|
@@ -246,25 +220,25 @@ function Gc({ children: e, options: t, onResizeStop: n, onChange: r, widgets: i,
|
|
|
246
220
|
e.forEach((e) => {
|
|
247
221
|
setTimeout(() => {
|
|
248
222
|
m.current.delete(e), _.current.delete(e);
|
|
249
|
-
},
|
|
223
|
+
}, Hc);
|
|
250
224
|
}), o.forEach((e) => {
|
|
251
225
|
let t = s.el.querySelector(`[gs-id="${e.id}"]`);
|
|
252
226
|
t && setTimeout(() => {
|
|
253
227
|
s.removeWidget(t, !0);
|
|
254
|
-
},
|
|
228
|
+
}, Hc);
|
|
255
229
|
}), b((t) => {
|
|
256
230
|
let n = new Map(t);
|
|
257
231
|
return e.forEach((e) => {
|
|
258
232
|
setTimeout(() => {
|
|
259
233
|
n.delete(e);
|
|
260
|
-
},
|
|
234
|
+
}, Hc);
|
|
261
235
|
}), n;
|
|
262
236
|
}), p((t) => {
|
|
263
237
|
let n = new Map(t);
|
|
264
238
|
return e.forEach((e) => {
|
|
265
239
|
if (n.get(e)) {
|
|
266
240
|
let t = s.el.querySelector(`[gs-id="${e}"] .grid-stack-item-content`), r = "";
|
|
267
|
-
t && (r = Ws.sanitize(
|
|
241
|
+
t && (r = Ws.sanitize(Uc(t))), n.set(e, /* @__PURE__ */ X(qn.div, {
|
|
268
242
|
className: "h-full w-full",
|
|
269
243
|
initial: {
|
|
270
244
|
opacity: 1,
|
|
@@ -283,7 +257,7 @@ function Gc({ children: e, options: t, onResizeStop: n, onChange: r, widgets: i,
|
|
|
283
257
|
},
|
|
284
258
|
transition: {
|
|
285
259
|
opacity: {
|
|
286
|
-
duration:
|
|
260
|
+
duration: Hc / 1e3,
|
|
287
261
|
ease: [
|
|
288
262
|
.32,
|
|
289
263
|
0,
|
|
@@ -292,7 +266,7 @@ function Gc({ children: e, options: t, onResizeStop: n, onChange: r, widgets: i,
|
|
|
292
266
|
]
|
|
293
267
|
},
|
|
294
268
|
scale: {
|
|
295
|
-
duration:
|
|
269
|
+
duration: Hc / 1e3,
|
|
296
270
|
ease: [
|
|
297
271
|
.65,
|
|
298
272
|
0,
|
|
@@ -301,7 +275,7 @@ function Gc({ children: e, options: t, onResizeStop: n, onChange: r, widgets: i,
|
|
|
301
275
|
]
|
|
302
276
|
},
|
|
303
277
|
filter: {
|
|
304
|
-
duration:
|
|
278
|
+
duration: Hc / 1e3,
|
|
305
279
|
ease: "linear"
|
|
306
280
|
}
|
|
307
281
|
},
|
|
@@ -310,14 +284,14 @@ function Gc({ children: e, options: t, onResizeStop: n, onChange: r, widgets: i,
|
|
|
310
284
|
}
|
|
311
285
|
setTimeout(() => {
|
|
312
286
|
n.delete(e);
|
|
313
|
-
},
|
|
287
|
+
}, Hc);
|
|
314
288
|
}), n;
|
|
315
289
|
}), g((t) => {
|
|
316
290
|
let n = new Map(t);
|
|
317
291
|
return e.forEach((e) => {
|
|
318
292
|
setTimeout(() => {
|
|
319
293
|
n.delete(e);
|
|
320
|
-
},
|
|
294
|
+
}, Hc);
|
|
321
295
|
}), n;
|
|
322
296
|
});
|
|
323
297
|
}
|
|
@@ -327,7 +301,7 @@ function Gc({ children: e, options: t, onResizeStop: n, onChange: r, widgets: i,
|
|
|
327
301
|
c.forEach((n) => {
|
|
328
302
|
let r = e.find((e) => e.id === n.id);
|
|
329
303
|
if (!r) return;
|
|
330
|
-
let i =
|
|
304
|
+
let i = Vc.filter((e) => r[e] !== n[e]);
|
|
331
305
|
if (i.length > 0) {
|
|
332
306
|
let e = {}, r = [
|
|
333
307
|
"w",
|
|
@@ -365,7 +339,7 @@ function Gc({ children: e, options: t, onResizeStop: n, onChange: r, widgets: i,
|
|
|
365
339
|
}), b((e) => {
|
|
366
340
|
let t = new Map(e);
|
|
367
341
|
return c.forEach((e) => {
|
|
368
|
-
let n =
|
|
342
|
+
let n = Bc(e);
|
|
369
343
|
t.set(e.id, n);
|
|
370
344
|
}), t;
|
|
371
345
|
}), p((e) => {
|
|
@@ -416,20 +390,20 @@ function Gc({ children: e, options: t, onResizeStop: n, onChange: r, widgets: i,
|
|
|
416
390
|
if (!s) return;
|
|
417
391
|
let e = s.save();
|
|
418
392
|
if (Array.isArray(e)) {
|
|
419
|
-
let t = e.map((e) => {
|
|
420
|
-
let
|
|
421
|
-
if (!
|
|
422
|
-
let
|
|
393
|
+
let t = e.map(({ subGridOpts: e, ...t }) => {
|
|
394
|
+
let n = t.id;
|
|
395
|
+
if (!n) return null;
|
|
396
|
+
let r = m.current.get(n), i = _.current.get(n), a = t;
|
|
423
397
|
return {
|
|
424
|
-
...
|
|
425
|
-
id:
|
|
426
|
-
w:
|
|
427
|
-
h:
|
|
428
|
-
x:
|
|
429
|
-
y:
|
|
430
|
-
meta:
|
|
431
|
-
_originalContent:
|
|
432
|
-
content:
|
|
398
|
+
...t,
|
|
399
|
+
id: n,
|
|
400
|
+
w: t.w ?? 1,
|
|
401
|
+
h: t.h ?? 1,
|
|
402
|
+
x: t.x ?? 0,
|
|
403
|
+
y: t.y ?? 0,
|
|
404
|
+
meta: a.meta,
|
|
405
|
+
_originalContent: i,
|
|
406
|
+
content: r ?? /* @__PURE__ */ X("div", { children: "No content" })
|
|
433
407
|
};
|
|
434
408
|
}).filter((e) => e !== null);
|
|
435
409
|
v.current?.(t);
|
|
@@ -484,16 +458,16 @@ function Gc({ children: e, options: t, onResizeStop: n, onChange: r, widgets: i,
|
|
|
484
458
|
}
|
|
485
459
|
//#endregion
|
|
486
460
|
//#region src/blocks/F0GridStack/components/grid-stack-render-context.ts
|
|
487
|
-
var
|
|
488
|
-
function
|
|
489
|
-
let e = Sc(
|
|
461
|
+
var Gc = vc(null);
|
|
462
|
+
function Kc() {
|
|
463
|
+
let e = Sc(Gc);
|
|
490
464
|
if (!e) throw Error("useGridStackRenderContext must be used within a GridStackProvider");
|
|
491
465
|
return e;
|
|
492
466
|
}
|
|
493
467
|
//#endregion
|
|
494
468
|
//#region src/blocks/F0GridStack/components/grid-stack-render.tsx
|
|
495
|
-
function
|
|
496
|
-
let { _reactContentMap: e } = zc(), { getWidgetContainer: t } =
|
|
469
|
+
function qc() {
|
|
470
|
+
let { _reactContentMap: e } = zc(), { getWidgetContainer: t } = Kc();
|
|
497
471
|
return /* @__PURE__ */ X(Y, { children: Array.from(e.value.entries()).map(([e, n]) => {
|
|
498
472
|
let r = t(e);
|
|
499
473
|
return r ? /* @__PURE__ */ X(_c, { children: n ? Oc(n, r) : null }, e) : (console.error(`Widget container not found for widget ${e}`), null);
|
|
@@ -501,7 +475,7 @@ function Jc() {
|
|
|
501
475
|
}
|
|
502
476
|
//#endregion
|
|
503
477
|
//#region ../../node_modules/.pnpm/gridstack@12.3.3/node_modules/gridstack/dist/utils.js
|
|
504
|
-
function
|
|
478
|
+
function Jc(e, t, n, r, i) {
|
|
505
479
|
let a = (...a) => (console.warn("gridstack.js: Function `" + n + "` is deprecated in " + i + " and has been replaced with `" + r + "`. It will be **removed** in a future release"), t.apply(e, a));
|
|
506
480
|
return a.prototype = t.prototype, a;
|
|
507
481
|
}
|
|
@@ -759,7 +733,7 @@ var Q = class e {
|
|
|
759
733
|
static canBeRotated(e) {
|
|
760
734
|
return !(!e || e.w === e.h || e.locked || e.noResize || e.grid?.opts.disableResize || e.minW && e.minW === e.maxW || e.minH && e.minH === e.maxH);
|
|
761
735
|
}
|
|
762
|
-
},
|
|
736
|
+
}, Yc = class e {
|
|
763
737
|
constructor(e = {}) {
|
|
764
738
|
this.addedNodes = [], this.removedNodes = [], this.defaultColumn = 12, this.column = e.column || this.defaultColumn, this.column > this.defaultColumn && (this.defaultColumn = this.column), this.maxRow = e.maxRow, this._float = e.float, this.nodes = e.nodes || [], this.onChange = e.onChange;
|
|
765
739
|
}
|
|
@@ -1161,10 +1135,10 @@ var Q = class e {
|
|
|
1161
1135
|
return this;
|
|
1162
1136
|
}
|
|
1163
1137
|
};
|
|
1164
|
-
|
|
1138
|
+
Yc._idSeq = 0;
|
|
1165
1139
|
//#endregion
|
|
1166
1140
|
//#region ../../node_modules/.pnpm/gridstack@12.3.3/node_modules/gridstack/dist/types.js
|
|
1167
|
-
var
|
|
1141
|
+
var Xc = {
|
|
1168
1142
|
alwaysShowResizeHandle: "mobile",
|
|
1169
1143
|
animate: !0,
|
|
1170
1144
|
auto: !0,
|
|
@@ -1191,61 +1165,61 @@ var Zc = {
|
|
|
1191
1165
|
},
|
|
1192
1166
|
resizable: { handles: "se" },
|
|
1193
1167
|
rtl: "auto"
|
|
1194
|
-
}, $ = class {},
|
|
1195
|
-
function
|
|
1168
|
+
}, $ = class {}, Zc = typeof window < "u" && typeof document < "u" && ("ontouchstart" in document || "ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0), Qc = class {};
|
|
1169
|
+
function $c(e, t) {
|
|
1196
1170
|
e.touches.length > 1 || (e.cancelable && e.preventDefault(), Q.simulateMouseEvent(e.changedTouches[0], t));
|
|
1197
1171
|
}
|
|
1198
|
-
function
|
|
1172
|
+
function el(e, t) {
|
|
1199
1173
|
e.cancelable && e.preventDefault(), Q.simulateMouseEvent(e, t);
|
|
1200
1174
|
}
|
|
1175
|
+
function tl(e) {
|
|
1176
|
+
Qc.touchHandled || (Qc.touchHandled = !0, $c(e, "mousedown"));
|
|
1177
|
+
}
|
|
1201
1178
|
function nl(e) {
|
|
1202
|
-
|
|
1179
|
+
Qc.touchHandled && $c(e, "mousemove");
|
|
1203
1180
|
}
|
|
1204
1181
|
function rl(e) {
|
|
1205
|
-
|
|
1182
|
+
if (!Qc.touchHandled) return;
|
|
1183
|
+
Qc.pointerLeaveTimeout && (window.clearTimeout(Qc.pointerLeaveTimeout), delete Qc.pointerLeaveTimeout);
|
|
1184
|
+
let t = !!$.dragElement;
|
|
1185
|
+
$c(e, "mouseup"), t || $c(e, "click"), Qc.touchHandled = !1;
|
|
1206
1186
|
}
|
|
1207
1187
|
function il(e) {
|
|
1208
|
-
|
|
1209
|
-
$c.pointerLeaveTimeout && (window.clearTimeout($c.pointerLeaveTimeout), delete $c.pointerLeaveTimeout);
|
|
1210
|
-
let t = !!$.dragElement;
|
|
1211
|
-
el(e, "mouseup"), t || el(e, "click"), $c.touchHandled = !1;
|
|
1188
|
+
e.pointerType !== "mouse" && e.target.releasePointerCapture(e.pointerId);
|
|
1212
1189
|
}
|
|
1213
1190
|
function al(e) {
|
|
1214
|
-
e.pointerType !== "mouse" &&
|
|
1191
|
+
$.dragElement && e.pointerType !== "mouse" && el(e, "mouseenter");
|
|
1215
1192
|
}
|
|
1216
1193
|
function ol(e) {
|
|
1217
|
-
$.dragElement && e.pointerType !== "mouse" &&
|
|
1218
|
-
|
|
1219
|
-
function sl(e) {
|
|
1220
|
-
$.dragElement && e.pointerType !== "mouse" && ($c.pointerLeaveTimeout = window.setTimeout(() => {
|
|
1221
|
-
delete $c.pointerLeaveTimeout, tl(e, "mouseleave");
|
|
1194
|
+
$.dragElement && e.pointerType !== "mouse" && (Qc.pointerLeaveTimeout = window.setTimeout(() => {
|
|
1195
|
+
delete Qc.pointerLeaveTimeout, el(e, "mouseleave");
|
|
1222
1196
|
}, 10));
|
|
1223
1197
|
}
|
|
1224
1198
|
//#endregion
|
|
1225
1199
|
//#region ../../node_modules/.pnpm/gridstack@12.3.3/node_modules/gridstack/dist/dd-resizable-handle.js
|
|
1226
|
-
var
|
|
1200
|
+
var sl = class e {
|
|
1227
1201
|
constructor(e, t, n) {
|
|
1228
1202
|
this.host = e, this.dir = t, this.option = n, this.moving = !1, this._mouseDown = this._mouseDown.bind(this), this._mouseMove = this._mouseMove.bind(this), this._mouseUp = this._mouseUp.bind(this), this._keyEvent = this._keyEvent.bind(this), this._init();
|
|
1229
1203
|
}
|
|
1230
1204
|
_init() {
|
|
1231
1205
|
let t = this.el = document.createElement("div");
|
|
1232
|
-
return t.classList.add("ui-resizable-handle"), t.classList.add(`${e.prefix}${this.dir}`), t.style.zIndex = "100", t.style.userSelect = "none", this.host.appendChild(this.el), this.el.addEventListener("mousedown", this._mouseDown),
|
|
1206
|
+
return t.classList.add("ui-resizable-handle"), t.classList.add(`${e.prefix}${this.dir}`), t.style.zIndex = "100", t.style.userSelect = "none", this.host.appendChild(this.el), this.el.addEventListener("mousedown", this._mouseDown), Zc && (this.el.addEventListener("touchstart", tl), this.el.addEventListener("pointerdown", il)), this;
|
|
1233
1207
|
}
|
|
1234
1208
|
destroy() {
|
|
1235
|
-
return this.moving && this._mouseUp(this.mouseDownEvent), this.el.removeEventListener("mousedown", this._mouseDown),
|
|
1209
|
+
return this.moving && this._mouseUp(this.mouseDownEvent), this.el.removeEventListener("mousedown", this._mouseDown), Zc && (this.el.removeEventListener("touchstart", tl), this.el.removeEventListener("pointerdown", il)), this.host.removeChild(this.el), delete this.el, delete this.host, this;
|
|
1236
1210
|
}
|
|
1237
1211
|
_mouseDown(e) {
|
|
1238
1212
|
this.mouseDownEvent = e, document.addEventListener("mousemove", this._mouseMove, {
|
|
1239
1213
|
capture: !0,
|
|
1240
1214
|
passive: !0
|
|
1241
|
-
}), document.addEventListener("mouseup", this._mouseUp, !0),
|
|
1215
|
+
}), document.addEventListener("mouseup", this._mouseUp, !0), Zc && (this.el.addEventListener("touchmove", nl), this.el.addEventListener("touchend", rl)), e.stopPropagation(), e.preventDefault();
|
|
1242
1216
|
}
|
|
1243
1217
|
_mouseMove(e) {
|
|
1244
1218
|
let t = this.mouseDownEvent;
|
|
1245
1219
|
this.moving ? this._triggerEvent("move", e) : Math.abs(e.x - t.x) + Math.abs(e.y - t.y) > 2 && (this.moving = !0, this._triggerEvent("start", this.mouseDownEvent), this._triggerEvent("move", e), document.addEventListener("keydown", this._keyEvent)), e.stopPropagation();
|
|
1246
1220
|
}
|
|
1247
1221
|
_mouseUp(e) {
|
|
1248
|
-
this.moving && (this._triggerEvent("stop", e), document.removeEventListener("keydown", this._keyEvent)), document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0),
|
|
1222
|
+
this.moving && (this._triggerEvent("stop", e), document.removeEventListener("keydown", this._keyEvent)), document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), Zc && (this.el.removeEventListener("touchmove", nl), this.el.removeEventListener("touchend", rl)), delete this.moving, delete this.mouseDownEvent, e.stopPropagation(), e.preventDefault();
|
|
1249
1223
|
}
|
|
1250
1224
|
_keyEvent(e) {
|
|
1251
1225
|
e.key === "Escape" && (this.host.gridstackNode?.grid?.engine.restoreInitial(), this._mouseUp(this.mouseDownEvent));
|
|
@@ -1254,10 +1228,10 @@ var cl = class e {
|
|
|
1254
1228
|
return this.option[e] && this.option[e](t), this;
|
|
1255
1229
|
}
|
|
1256
1230
|
};
|
|
1257
|
-
|
|
1231
|
+
sl.prefix = "ui-resizable-";
|
|
1258
1232
|
//#endregion
|
|
1259
1233
|
//#region ../../node_modules/.pnpm/gridstack@12.3.3/node_modules/gridstack/dist/dd-base-impl.js
|
|
1260
|
-
var
|
|
1234
|
+
var cl = class {
|
|
1261
1235
|
constructor() {
|
|
1262
1236
|
this._eventRegister = {};
|
|
1263
1237
|
}
|
|
@@ -1282,7 +1256,7 @@ var ll = class {
|
|
|
1282
1256
|
triggerEvent(e, t) {
|
|
1283
1257
|
if (!this.disabled && this._eventRegister && this._eventRegister[e]) return this._eventRegister[e](t);
|
|
1284
1258
|
}
|
|
1285
|
-
},
|
|
1259
|
+
}, ll = class e extends cl {
|
|
1286
1260
|
constructor(e, t = {}) {
|
|
1287
1261
|
super(), this.el = e, this.option = t, this.rectScale = {
|
|
1288
1262
|
x: 1,
|
|
@@ -1335,7 +1309,7 @@ var ll = class {
|
|
|
1335
1309
|
$.overResizeElement === this && (delete $.overResizeElement, this.el.classList.add("ui-resizable-autohide"));
|
|
1336
1310
|
}
|
|
1337
1311
|
_setupHandlers() {
|
|
1338
|
-
return this.handlers = this.option.handles.split(",").map((e) => e.trim()).map((e) => new
|
|
1312
|
+
return this.handlers = this.option.handles.split(",").map((e) => e.trim()).map((e) => new sl(this.el, e, {
|
|
1339
1313
|
start: (e) => {
|
|
1340
1314
|
this._resizeStart(e);
|
|
1341
1315
|
},
|
|
@@ -1426,7 +1400,7 @@ var ll = class {
|
|
|
1426
1400
|
return this.handlers.forEach((e) => e.destroy()), delete this.handlers, this;
|
|
1427
1401
|
}
|
|
1428
1402
|
};
|
|
1429
|
-
|
|
1403
|
+
ll._originStyleProp = [
|
|
1430
1404
|
"width",
|
|
1431
1405
|
"height",
|
|
1432
1406
|
"position",
|
|
@@ -1437,7 +1411,7 @@ ul._originStyleProp = [
|
|
|
1437
1411
|
];
|
|
1438
1412
|
//#endregion
|
|
1439
1413
|
//#region ../../node_modules/.pnpm/gridstack@12.3.3/node_modules/gridstack/dist/dd-draggable.js
|
|
1440
|
-
var
|
|
1414
|
+
var ul = "input,textarea,button,select,option,[contenteditable=\"true\"],.ui-resizable-handle", dl = class e extends cl {
|
|
1441
1415
|
constructor(e, t = {}) {
|
|
1442
1416
|
super(), this.el = e, this.option = t, this.dragTransform = {
|
|
1443
1417
|
xScale: 1,
|
|
@@ -1456,12 +1430,12 @@ var dl = "input,textarea,button,select,option,[contenteditable=\"true\"],.ui-res
|
|
|
1456
1430
|
}
|
|
1457
1431
|
enable() {
|
|
1458
1432
|
this.disabled !== !1 && (super.enable(), this.dragEls.forEach((e) => {
|
|
1459
|
-
e.addEventListener("mousedown", this._mouseDown),
|
|
1433
|
+
e.addEventListener("mousedown", this._mouseDown), Zc && (e.addEventListener("touchstart", tl), e.addEventListener("pointerdown", il));
|
|
1460
1434
|
}), this.el.classList.remove("ui-draggable-disabled"));
|
|
1461
1435
|
}
|
|
1462
1436
|
disable(e = !1) {
|
|
1463
1437
|
this.disabled !== !0 && (super.disable(), this.dragEls.forEach((e) => {
|
|
1464
|
-
e.removeEventListener("mousedown", this._mouseDown),
|
|
1438
|
+
e.removeEventListener("mousedown", this._mouseDown), Zc && (e.removeEventListener("touchstart", tl), e.removeEventListener("pointerdown", il));
|
|
1465
1439
|
}), e || this.el.classList.add("ui-draggable-disabled"));
|
|
1466
1440
|
}
|
|
1467
1441
|
destroy() {
|
|
@@ -1471,10 +1445,10 @@ var dl = "input,textarea,button,select,option,[contenteditable=\"true\"],.ui-res
|
|
|
1471
1445
|
return Object.keys(e).forEach((t) => this.option[t] = e[t]), this;
|
|
1472
1446
|
}
|
|
1473
1447
|
_mouseDown(e) {
|
|
1474
|
-
if (!$.mouseHandled) return e.button !== 0 || !this.dragEls.find((t) => t === e.target) && e.target.closest(
|
|
1448
|
+
if (!$.mouseHandled) return e.button !== 0 || !this.dragEls.find((t) => t === e.target) && e.target.closest(ul) || this.option.cancel && e.target.closest(this.option.cancel) || (this.mouseDownEvent = e, delete this.dragging, delete $.dragElement, delete $.dropElement, document.addEventListener("mousemove", this._mouseMove, {
|
|
1475
1449
|
capture: !0,
|
|
1476
1450
|
passive: !0
|
|
1477
|
-
}), document.addEventListener("mouseup", this._mouseUp, !0),
|
|
1451
|
+
}), document.addEventListener("mouseup", this._mouseUp, !0), Zc && (e.currentTarget.addEventListener("touchmove", nl), e.currentTarget.addEventListener("touchend", rl)), e.preventDefault(), document.activeElement && document.activeElement.blur(), $.mouseHandled = !0), !0;
|
|
1478
1452
|
}
|
|
1479
1453
|
_callDrag(e) {
|
|
1480
1454
|
if (!this.dragging) return;
|
|
@@ -1504,7 +1478,7 @@ var dl = "input,textarea,button,select,option,[contenteditable=\"true\"],.ui-res
|
|
|
1504
1478
|
return !0;
|
|
1505
1479
|
}
|
|
1506
1480
|
_mouseUp(e) {
|
|
1507
|
-
if (document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0),
|
|
1481
|
+
if (document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), Zc && e.currentTarget && (e.currentTarget.removeEventListener("touchmove", nl, !0), e.currentTarget.removeEventListener("touchend", rl, !0)), this.dragging) {
|
|
1508
1482
|
delete this.dragging, delete this.el.gridstackNode?._origRotate, document.removeEventListener("keydown", this._keyEvent), $.dropElement?.el === this.el.parentElement && delete $.dropElement, this.helperContainment.style.position = this.parentOriginStylePosition || null, this.helper !== this.el && this.helper.remove(), this._removeHelperStyle();
|
|
1509
1483
|
let t = Q.initEvent(e, {
|
|
1510
1484
|
target: this.el,
|
|
@@ -1574,7 +1548,7 @@ var dl = "input,textarea,button,select,option,[contenteditable=\"true\"],.ui-res
|
|
|
1574
1548
|
} };
|
|
1575
1549
|
}
|
|
1576
1550
|
};
|
|
1577
|
-
|
|
1551
|
+
dl.originStyleProp = [
|
|
1578
1552
|
"width",
|
|
1579
1553
|
"height",
|
|
1580
1554
|
"transform",
|
|
@@ -1589,7 +1563,7 @@ fl.originStyleProp = [
|
|
|
1589
1563
|
];
|
|
1590
1564
|
//#endregion
|
|
1591
1565
|
//#region ../../node_modules/.pnpm/gridstack@12.3.3/node_modules/gridstack/dist/dd-droppable.js
|
|
1592
|
-
var
|
|
1566
|
+
var fl = class extends cl {
|
|
1593
1567
|
constructor(e, t = {}) {
|
|
1594
1568
|
super(), this.el = e, this.option = t, this._mouseEnter = this._mouseEnter.bind(this), this._mouseLeave = this._mouseLeave.bind(this), this.enable(), this._setupAccept();
|
|
1595
1569
|
}
|
|
@@ -1600,10 +1574,10 @@ var pl = class extends ll {
|
|
|
1600
1574
|
super.off(e);
|
|
1601
1575
|
}
|
|
1602
1576
|
enable() {
|
|
1603
|
-
this.disabled !== !1 && (super.enable(), this.el.classList.add("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), this.el.addEventListener("mouseenter", this._mouseEnter), this.el.addEventListener("mouseleave", this._mouseLeave),
|
|
1577
|
+
this.disabled !== !1 && (super.enable(), this.el.classList.add("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), this.el.addEventListener("mouseenter", this._mouseEnter), this.el.addEventListener("mouseleave", this._mouseLeave), Zc && (this.el.addEventListener("pointerenter", al), this.el.addEventListener("pointerleave", ol)));
|
|
1604
1578
|
}
|
|
1605
1579
|
disable(e = !1) {
|
|
1606
|
-
this.disabled !== !0 && (super.disable(), this.el.classList.remove("ui-droppable"), e || this.el.classList.add("ui-droppable-disabled"), this.el.removeEventListener("mouseenter", this._mouseEnter), this.el.removeEventListener("mouseleave", this._mouseLeave),
|
|
1580
|
+
this.disabled !== !0 && (super.disable(), this.el.classList.remove("ui-droppable"), e || this.el.classList.add("ui-droppable-disabled"), this.el.removeEventListener("mouseenter", this._mouseEnter), this.el.removeEventListener("mouseleave", this._mouseLeave), Zc && (this.el.removeEventListener("pointerenter", al), this.el.removeEventListener("pointerleave", ol)));
|
|
1607
1581
|
}
|
|
1608
1582
|
destroy() {
|
|
1609
1583
|
this.disable(!0), this.el.classList.remove("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), super.destroy();
|
|
@@ -1653,7 +1627,7 @@ var pl = class extends ll {
|
|
|
1653
1627
|
...e.ui()
|
|
1654
1628
|
};
|
|
1655
1629
|
}
|
|
1656
|
-
},
|
|
1630
|
+
}, pl = class e {
|
|
1657
1631
|
static init(t) {
|
|
1658
1632
|
return t.ddElement ||= new e(t), t.ddElement;
|
|
1659
1633
|
}
|
|
@@ -1691,24 +1665,24 @@ var pl = class extends ll {
|
|
|
1691
1665
|
].indexOf(e) > -1 && this.ddResizable.off(e), this;
|
|
1692
1666
|
}
|
|
1693
1667
|
setupDraggable(e) {
|
|
1694
|
-
return this.ddDraggable ? this.ddDraggable.updateOption(e) : this.ddDraggable = new
|
|
1668
|
+
return this.ddDraggable ? this.ddDraggable.updateOption(e) : this.ddDraggable = new dl(this.el, e), this;
|
|
1695
1669
|
}
|
|
1696
1670
|
cleanDraggable() {
|
|
1697
1671
|
return this.ddDraggable && (this.ddDraggable.destroy(), delete this.ddDraggable), this;
|
|
1698
1672
|
}
|
|
1699
1673
|
setupResizable(e) {
|
|
1700
|
-
return this.ddResizable ? this.ddResizable.updateOption(e) : this.ddResizable = new
|
|
1674
|
+
return this.ddResizable ? this.ddResizable.updateOption(e) : this.ddResizable = new ll(this.el, e), this;
|
|
1701
1675
|
}
|
|
1702
1676
|
cleanResizable() {
|
|
1703
1677
|
return this.ddResizable && (this.ddResizable.destroy(), delete this.ddResizable), this;
|
|
1704
1678
|
}
|
|
1705
1679
|
setupDroppable(e) {
|
|
1706
|
-
return this.ddDroppable ? this.ddDroppable.updateOption(e) : this.ddDroppable = new
|
|
1680
|
+
return this.ddDroppable ? this.ddDroppable.updateOption(e) : this.ddDroppable = new fl(this.el, e), this;
|
|
1707
1681
|
}
|
|
1708
1682
|
cleanDroppable() {
|
|
1709
1683
|
return this.ddDroppable && (this.ddDroppable.destroy(), delete this.ddDroppable), this;
|
|
1710
1684
|
}
|
|
1711
|
-
},
|
|
1685
|
+
}, ml = new class {
|
|
1712
1686
|
resizable(e, t, n, r) {
|
|
1713
1687
|
return this._getDDElements(e, t).forEach((e) => {
|
|
1714
1688
|
if (t === "disable" || t === "enable") e.ddResizable && e.ddResizable[t]();
|
|
@@ -1772,9 +1746,9 @@ var pl = class extends ll {
|
|
|
1772
1746
|
}
|
|
1773
1747
|
_getDDElements(e, t) {
|
|
1774
1748
|
let n = e.gridstack || t !== "destroy" && t !== "disable", r = Q.getElements(e);
|
|
1775
|
-
return r.length ? r.map((e) => e.ddElement || (n ?
|
|
1749
|
+
return r.length ? r.map((e) => e.ddElement || (n ? pl.init(e) : null)).filter((e) => e) : [];
|
|
1776
1750
|
}
|
|
1777
|
-
}(),
|
|
1751
|
+
}(), hl = class e {
|
|
1778
1752
|
static init(t = {}, n = ".grid-stack") {
|
|
1779
1753
|
if (typeof document > "u") return null;
|
|
1780
1754
|
let r = e.getGridElement(n);
|
|
@@ -1805,7 +1779,7 @@ var pl = class extends ll {
|
|
|
1805
1779
|
if (!this._placeholder) {
|
|
1806
1780
|
this._placeholder = Q.createDiv([
|
|
1807
1781
|
this.opts.placeholderClass,
|
|
1808
|
-
|
|
1782
|
+
Xc.itemClass,
|
|
1809
1783
|
this.opts.itemClass
|
|
1810
1784
|
]);
|
|
1811
1785
|
let e = Q.createDiv(["placeholder-content"], this._placeholder);
|
|
@@ -1828,28 +1802,28 @@ var pl = class extends ll {
|
|
|
1828
1802
|
!i.columnWidth && !e?.length ? delete n.columnOpts : (i.columnMax = i.columnMax || 12, e?.length > 1 && e.sort((e, t) => (t.w || 0) - (e.w || 0)));
|
|
1829
1803
|
}
|
|
1830
1804
|
let a = {
|
|
1831
|
-
...Q.cloneDeep(
|
|
1832
|
-
column: Q.toNumber(t.getAttribute("gs-column")) ||
|
|
1833
|
-
minRow: r || Q.toNumber(t.getAttribute("gs-min-row")) ||
|
|
1834
|
-
maxRow: r || Q.toNumber(t.getAttribute("gs-max-row")) ||
|
|
1835
|
-
staticGrid: Q.toBool(t.getAttribute("gs-static")) ||
|
|
1805
|
+
...Q.cloneDeep(Xc),
|
|
1806
|
+
column: Q.toNumber(t.getAttribute("gs-column")) || Xc.column,
|
|
1807
|
+
minRow: r || Q.toNumber(t.getAttribute("gs-min-row")) || Xc.minRow,
|
|
1808
|
+
maxRow: r || Q.toNumber(t.getAttribute("gs-max-row")) || Xc.maxRow,
|
|
1809
|
+
staticGrid: Q.toBool(t.getAttribute("gs-static")) || Xc.staticGrid,
|
|
1836
1810
|
sizeToContent: Q.toBool(t.getAttribute("gs-size-to-content")) || void 0,
|
|
1837
|
-
draggable: { handle: (n.handleClass ? "." + n.handleClass : n.handle ? n.handle : "") ||
|
|
1811
|
+
draggable: { handle: (n.handleClass ? "." + n.handleClass : n.handle ? n.handle : "") || Xc.draggable.handle },
|
|
1838
1812
|
removableOptions: {
|
|
1839
|
-
accept: n.itemClass ||
|
|
1840
|
-
decline:
|
|
1813
|
+
accept: n.itemClass || Xc.removableOptions.accept,
|
|
1814
|
+
decline: Xc.removableOptions.decline
|
|
1841
1815
|
}
|
|
1842
1816
|
};
|
|
1843
1817
|
t.getAttribute("gs-animate") && (a.animate = Q.toBool(t.getAttribute("gs-animate"))), n = Q.defaults(n, a), this._initMargin(), this.checkDynamicColumn(), this._updateColumnVar(n), n.rtl === "auto" && (n.rtl = t.style.direction === "rtl"), n.rtl && this.el.classList.add("grid-stack-rtl");
|
|
1844
|
-
let o = this.el.closest("." +
|
|
1818
|
+
let o = this.el.closest("." + Xc.itemClass)?.gridstackNode;
|
|
1845
1819
|
if (o && (o.subGrid = this, this.parentGridNode = o, this.el.classList.add("grid-stack-nested"), o.el.classList.add("grid-stack-sub-grid")), this._isAutoCellHeight = n.cellHeight === "auto", this._isAutoCellHeight || n.cellHeight === "initial") this.cellHeight(void 0);
|
|
1846
1820
|
else {
|
|
1847
|
-
typeof n.cellHeight == "number" && n.cellHeightUnit && n.cellHeightUnit !==
|
|
1821
|
+
typeof n.cellHeight == "number" && n.cellHeightUnit && n.cellHeightUnit !== Xc.cellHeightUnit && (n.cellHeight += n.cellHeightUnit, delete n.cellHeightUnit);
|
|
1848
1822
|
let e = n.cellHeight;
|
|
1849
1823
|
delete n.cellHeight, this.cellHeight(e);
|
|
1850
1824
|
}
|
|
1851
|
-
n.alwaysShowResizeHandle === "mobile" && (n.alwaysShowResizeHandle =
|
|
1852
|
-
let s = n.engineClass || e.engineClass ||
|
|
1825
|
+
n.alwaysShowResizeHandle === "mobile" && (n.alwaysShowResizeHandle = Zc), this._setStaticClass();
|
|
1826
|
+
let s = n.engineClass || e.engineClass || Yc;
|
|
1853
1827
|
if (this.engine = new s({
|
|
1854
1828
|
column: this.getColumn(),
|
|
1855
1829
|
float: n.float,
|
|
@@ -1940,7 +1914,7 @@ var pl = class extends ll {
|
|
|
1940
1914
|
let e = Q.cloneDeep(this.opts);
|
|
1941
1915
|
e.marginBottom === e.marginTop && e.marginRight === e.marginLeft && e.marginTop === e.marginRight && (e.margin = e.marginTop, delete e.marginTop, delete e.marginRight, delete e.marginBottom, delete e.marginLeft), e.rtl === (this.el.style.direction === "rtl") && (e.rtl = "auto"), this._isAutoCellHeight && (e.cellHeight = "auto"), this._autoColumn && (e.column = "auto");
|
|
1942
1916
|
let t = e._alwaysShowResizeHandle;
|
|
1943
|
-
return delete e._alwaysShowResizeHandle, t === void 0 ? delete e.alwaysShowResizeHandle : e.alwaysShowResizeHandle = t, Q.removeInternalAndSame(e,
|
|
1917
|
+
return delete e._alwaysShowResizeHandle, t === void 0 ? delete e.alwaysShowResizeHandle : e.alwaysShowResizeHandle = t, Q.removeInternalAndSame(e, Xc), e.children = a, e;
|
|
1944
1918
|
}
|
|
1945
1919
|
return a;
|
|
1946
1920
|
}
|
|
@@ -2278,7 +2252,7 @@ var pl = class extends ll {
|
|
|
2278
2252
|
return this.el.setAttribute("gs-current-row", String(t)), this.el.style.removeProperty("min-height"), this.el.style.removeProperty("height"), t && (this.el.style[e ? "minHeight" : "height"] = t * n + r), e && Q.shouldSizeToContent(e) && e.grid.resizeToContentCBCheck(e.el), this;
|
|
2279
2253
|
}
|
|
2280
2254
|
_prepareElement(e, t = !1, n) {
|
|
2281
|
-
n ||= this._readAttr(e), e.gridstackNode = n, n.el = e, n.grid = this, n = this.engine.addNode(n, t), this._writeAttr(e, n), e.classList.add(
|
|
2255
|
+
n ||= this._readAttr(e), e.gridstackNode = n, n.el = e, n.grid = this, n = this.engine.addNode(n, t), this._writeAttr(e, n), e.classList.add(Xc.itemClass, this.opts.itemClass);
|
|
2282
2256
|
let r = Q.shouldSizeToContent(n);
|
|
2283
2257
|
return r ? e.classList.add("size-to-content") : e.classList.remove("size-to-content"), r && this.resizeToContentCheck(!1, n), Q.lazyLoad(n) || this.prepareDragDrop(n.el), this;
|
|
2284
2258
|
}
|
|
@@ -2364,7 +2338,7 @@ var pl = class extends ll {
|
|
|
2364
2338
|
return r.setProperty("--gs-item-margin-top", `${this.opts.marginTop}${this.opts.marginUnit}`), r.setProperty("--gs-item-margin-bottom", `${this.opts.marginBottom}${this.opts.marginUnit}`), r.setProperty("--gs-item-margin-right", `${this.opts.marginRight}${this.opts.marginUnit}`), r.setProperty("--gs-item-margin-left", `${this.opts.marginLeft}${this.opts.marginUnit}`), this;
|
|
2365
2339
|
}
|
|
2366
2340
|
static getDD() {
|
|
2367
|
-
return
|
|
2341
|
+
return ml;
|
|
2368
2342
|
}
|
|
2369
2343
|
static setupDragIn(e, t, n, r = document) {
|
|
2370
2344
|
t?.pause !== void 0 && ($.pauseDrag = t.pause), t = {
|
|
@@ -2372,7 +2346,7 @@ var pl = class extends ll {
|
|
|
2372
2346
|
helper: "clone",
|
|
2373
2347
|
...t || {}
|
|
2374
2348
|
}, (typeof e == "string" ? Q.getElements(e, r) : e).forEach((e, r) => {
|
|
2375
|
-
|
|
2349
|
+
ml.isDraggable(e) || ml.dragIn(e, t), n?.[r] && (e.gridstackNode = n[r]);
|
|
2376
2350
|
});
|
|
2377
2351
|
}
|
|
2378
2352
|
movable(t, n) {
|
|
@@ -2408,10 +2382,10 @@ var pl = class extends ll {
|
|
|
2408
2382
|
t && (t._isExternal ? (t._isAboutToRemove = !0, this.engine.removeNode(t)) : t._isAboutToRemove && e._itemRemoving(t.el, !1), this.engine.restoreInitial());
|
|
2409
2383
|
}
|
|
2410
2384
|
_removeDD(e) {
|
|
2411
|
-
return
|
|
2385
|
+
return ml.draggable(e, "destroy").resizable(e, "destroy"), e.gridstackNode && delete e.gridstackNode._initDD, delete e.ddElement, this;
|
|
2412
2386
|
}
|
|
2413
2387
|
_setupAcceptWidget() {
|
|
2414
|
-
if (this.opts.staticGrid || !this.opts.acceptWidgets && !this.opts.removable) return
|
|
2388
|
+
if (this.opts.staticGrid || !this.opts.acceptWidgets && !this.opts.removable) return ml.droppable(this.el, "destroy"), this;
|
|
2415
2389
|
let t, n, r = (e, r, i) => {
|
|
2416
2390
|
i ||= r;
|
|
2417
2391
|
let a = i.gridstackNode;
|
|
@@ -2430,7 +2404,7 @@ var pl = class extends ll {
|
|
|
2430
2404
|
if (a._temporaryRemoved) {
|
|
2431
2405
|
if (a.x = Math.max(0, Math.round(s / n)), a.y = Math.max(0, Math.round(o / t)), delete a.autoPosition, this.engine.nodeBoundFix(a), !this.engine.willItFit(a)) {
|
|
2432
2406
|
if (a.autoPosition = !0, !this.engine.willItFit(a)) {
|
|
2433
|
-
|
|
2407
|
+
ml.off(r, "drag");
|
|
2434
2408
|
return;
|
|
2435
2409
|
}
|
|
2436
2410
|
a._willFitPos && (Q.copyPos(a, a._willFitPos), delete a._willFitPos);
|
|
@@ -2438,7 +2412,7 @@ var pl = class extends ll {
|
|
|
2438
2412
|
this._onStartMoving(i, e, l, a, n, t);
|
|
2439
2413
|
} else this._dragOrResize(i, e, l, a, n, t);
|
|
2440
2414
|
};
|
|
2441
|
-
return
|
|
2415
|
+
return ml.droppable(this.el, { accept: (e) => {
|
|
2442
2416
|
let t = e.gridstackNode || this._readAttr(e, !1);
|
|
2443
2417
|
if (t?.grid === this) return !0;
|
|
2444
2418
|
if (!this.opts.acceptWidgets) return !1;
|
|
@@ -2483,7 +2457,7 @@ var pl = class extends ll {
|
|
|
2483
2457
|
w: c,
|
|
2484
2458
|
h: l,
|
|
2485
2459
|
grid: this
|
|
2486
|
-
}, delete s.x, delete s.y, this.engine.cleanupNode(s).nodeBoundFix(s), s._initDD = s._isExternal = s._temporaryRemoved = !0) : (s.w = c, s.h = l, s._temporaryRemoved = !0), e._itemRemoving(s.el, !1),
|
|
2460
|
+
}, delete s.x, delete s.y, this.engine.cleanupNode(s).nodeBoundFix(s), s._initDD = s._isExternal = s._temporaryRemoved = !0) : (s.w = c, s.h = l, s._temporaryRemoved = !0), e._itemRemoving(s.el, !1), ml.on(a, "drag", r), r(i, a, o), !1;
|
|
2487
2461
|
}).on(this.el, "dropout", (e, t, n) => {
|
|
2488
2462
|
let r = n?.gridstackNode || t.gridstackNode;
|
|
2489
2463
|
return r && (!r.grid || r.grid === this) && (this._leave(t, n), this._isTemp && this.removeAsSubGrid(r)), !1;
|
|
@@ -2497,7 +2471,7 @@ var pl = class extends ll {
|
|
|
2497
2471
|
let e = s.grid;
|
|
2498
2472
|
e.engine.removeNodeFromLayoutCache(s), e.engine.removedNodes.push(s), e._triggerRemoveEvent()._triggerChangeEvent(), e.parentGridNode && !e.engine.nodes.length && e.opts.subGridDynamic && e.removeAsSubGrid();
|
|
2499
2473
|
}
|
|
2500
|
-
if (!i || (a && (this.engine.cleanupNode(i), i.grid = this), delete i.grid?._isTemp,
|
|
2474
|
+
if (!i || (a && (this.engine.cleanupNode(i), i.grid = this), delete i.grid?._isTemp, ml.off(n, "drag"), r === n ? n.remove() : (r.remove(), n = r), this._removeDD(n), !a)) return !1;
|
|
2501
2475
|
let c = i.subGrid?.el?.gridstack;
|
|
2502
2476
|
return Q.copyPos(i, this._readAttr(this.placeholder)), Q.removePositioningStyles(n), o && (i.content || i.subGridOpts || e.addRemoveCB) ? (delete i.el, n = this.addWidget(i)) : (this._prepareElement(n, !0, i), this.el.appendChild(n), this.resizeToContentCheck(!1, i), c && (c.parentGridNode = i), this._updateContainerHeight()), this.engine.addedNodes.push(i), this._triggerAddEvent(), this._triggerChangeEvent(), this.engine.endUpdate(), this._gsEventHandler.dropped && this._gsEventHandler.dropped({
|
|
2503
2477
|
...t,
|
|
@@ -2513,7 +2487,7 @@ var pl = class extends ll {
|
|
|
2513
2487
|
_setupRemoveDrop() {
|
|
2514
2488
|
if (typeof this.opts.removable != "string") return this;
|
|
2515
2489
|
let t = document.querySelector(this.opts.removable);
|
|
2516
|
-
return t && !this.opts.staticGrid && !
|
|
2490
|
+
return t && !this.opts.staticGrid && !ml.isDroppable(t) && ml.droppable(t, this.opts.removableOptions).on(t, "dropover", (t, n) => e._itemRemoving(n, !0)).on(t, "dropout", (t, n) => e._itemRemoving(n, !1)), this;
|
|
2517
2491
|
}
|
|
2518
2492
|
prepareDragDrop(e, t = !1) {
|
|
2519
2493
|
let n = e?.gridstackNode;
|
|
@@ -2536,7 +2510,7 @@ var pl = class extends ll {
|
|
|
2536
2510
|
this._extraDragRow = 0, this._updateContainerHeight(), this._triggerChangeEvent(), this.engine.endUpdate(), t.type === "resizestop" && (Number.isInteger(n.sizeToContent) && (n.sizeToContent = n.h), this.resizeToContentCheck(r, n));
|
|
2537
2511
|
}
|
|
2538
2512
|
};
|
|
2539
|
-
|
|
2513
|
+
ml.draggable(e, {
|
|
2540
2514
|
start: i,
|
|
2541
2515
|
stop: o,
|
|
2542
2516
|
drag: a
|
|
@@ -2546,7 +2520,7 @@ var pl = class extends ll {
|
|
|
2546
2520
|
resize: a
|
|
2547
2521
|
}), n._initDD = !0;
|
|
2548
2522
|
}
|
|
2549
|
-
return
|
|
2523
|
+
return ml.draggable(e, r ? "disable" : "enable").resizable(e, i ? "disable" : "enable"), this;
|
|
2550
2524
|
}
|
|
2551
2525
|
_onStartMoving(e, t, n, r, i, a) {
|
|
2552
2526
|
if (this.engine.cleanNodes().beginUpdate(r), this._writePosAttr(this.placeholder, r), this.el.appendChild(this.placeholder), this.placeholder.gridstackNode = r, r.grid?.el) this.dragTransform = Q.getValuesFromTransformedElement(e);
|
|
@@ -2561,7 +2535,7 @@ var pl = class extends ll {
|
|
|
2561
2535
|
};
|
|
2562
2536
|
if (r.el = this.placeholder, r._lastUiPosition = n.position, r._prevYPix = n.position.top, r._moving = t.type === "dragstart", r._resizing = t.type === "resizestart", delete r._lastTried, t.type === "dropover" && r._temporaryRemoved && (this.engine.addNode(r), r._moving = !0), this.engine.cacheRects(i, a, this.opts.marginTop, this.opts.marginRight, this.opts.marginBottom, this.opts.marginLeft), t.type === "resizestart") {
|
|
2563
2537
|
let t = this.getColumn() - r.x, n = (this.opts.maxRow || 2 ** 53 - 1) - r.y;
|
|
2564
|
-
|
|
2538
|
+
ml.resizable(e, "option", "minWidth", i * Math.min(r.minW || 1, t)).resizable(e, "option", "minHeight", a * Math.min(r.minH || 1, n)).resizable(e, "option", "maxWidth", i * Math.min(r.maxW || 2 ** 53 - 1, t)).resizable(e, "option", "maxWidthMoveLeft", i * Math.min(r.maxW || 2 ** 53 - 1, r.x + r.w)).resizable(e, "option", "maxHeight", a * Math.min(r.maxH || 2 ** 53 - 1, n)).resizable(e, "option", "maxHeightMoveUp", a * Math.min(r.maxH || 2 ** 53 - 1, r.y + r.h));
|
|
2565
2539
|
}
|
|
2566
2540
|
}
|
|
2567
2541
|
_dragOrResize(e, t, n, r, i, a) {
|
|
@@ -2610,41 +2584,41 @@ var pl = class extends ll {
|
|
|
2610
2584
|
_leave(t, n) {
|
|
2611
2585
|
n ||= t;
|
|
2612
2586
|
let r = n.gridstackNode;
|
|
2613
|
-
if (!r || (n.style.transform = n.style.transformOrigin = null,
|
|
2587
|
+
if (!r || (n.style.transform = n.style.transformOrigin = null, ml.off(t, "drag"), r._temporaryRemoved)) return;
|
|
2614
2588
|
r._temporaryRemoved = !0, this.engine.removeNode(r), r.el = r._isExternal && n ? n : t;
|
|
2615
2589
|
let i = r._sidebarOrig;
|
|
2616
2590
|
r._isExternal && this.engine.cleanupNode(r), r._sidebarOrig = i, this.opts.removable === !0 && e._itemRemoving(t, !0), t._gridstackNodeOrig ? (t.gridstackNode = t._gridstackNodeOrig, delete t._gridstackNodeOrig) : r._isExternal && this.engine.restoreInitial();
|
|
2617
2591
|
}
|
|
2618
2592
|
commit() {
|
|
2619
|
-
return
|
|
2593
|
+
return Jc(this, this.batchUpdate(!1), "commit", "batchUpdate", "5.2"), this;
|
|
2620
2594
|
}
|
|
2621
2595
|
};
|
|
2622
|
-
|
|
2596
|
+
hl.renderCB = (e, t) => {
|
|
2623
2597
|
e && t?.content && (e.textContent = t.content);
|
|
2624
|
-
},
|
|
2598
|
+
}, hl.resizeToContentParent = ".grid-stack-item-content", hl.Utils = Q, hl.Engine = Yc, hl.GDRev = "12.3.2";
|
|
2625
2599
|
//#endregion
|
|
2626
2600
|
//#region src/blocks/F0GridStack/components/grid-stack-render-provider.tsx
|
|
2627
|
-
var
|
|
2628
|
-
function
|
|
2601
|
+
var gl = /* @__PURE__ */ e(Po(), 1), _l = /* @__PURE__ */ new WeakMap();
|
|
2602
|
+
function vl({ children: e }) {
|
|
2629
2603
|
let { _gridStack: { value: t, set: n }, options: r } = zc(), i = q(/* @__PURE__ */ new Map()), a = q(null), o = q(r), s = W((e, t) => {
|
|
2630
2604
|
if (t.id && t.grid) {
|
|
2631
|
-
let n =
|
|
2632
|
-
n || (n = /* @__PURE__ */ new Map(),
|
|
2605
|
+
let n = _l.get(t.grid);
|
|
2606
|
+
n || (n = /* @__PURE__ */ new Map(), _l.set(t.grid, n)), n.set(t.id, e), i.current.set(t.id, e);
|
|
2633
2607
|
}
|
|
2634
2608
|
}, []), c = W(() => {
|
|
2635
2609
|
if (a.current) {
|
|
2636
|
-
|
|
2637
|
-
let e =
|
|
2610
|
+
hl.renderCB = s;
|
|
2611
|
+
let e = hl.init(o.current, a.current);
|
|
2638
2612
|
return e && o.current.handle && e.opts && (e.opts.handle = o.current.handle), e;
|
|
2639
2613
|
}
|
|
2640
2614
|
return null;
|
|
2641
2615
|
}, [s]), l = (e, t) => {
|
|
2642
2616
|
let { children: n, ...r } = e, { children: i, ...a } = t;
|
|
2643
|
-
return (0,
|
|
2617
|
+
return (0, gl.default)(r, a);
|
|
2644
2618
|
};
|
|
2645
2619
|
return Tc(() => {
|
|
2646
2620
|
if (!l(r, o.current) && t) try {
|
|
2647
|
-
t.removeAll(!1), t.destroy(!1), i.current.clear(),
|
|
2621
|
+
t.removeAll(!1), t.destroy(!1), i.current.clear(), _l.delete(t), o.current = r, n(null);
|
|
2648
2622
|
} catch (e) {
|
|
2649
2623
|
console.error("Error destroying gridstack", e);
|
|
2650
2624
|
}
|
|
@@ -2663,10 +2637,10 @@ function yl({ children: e }) {
|
|
|
2663
2637
|
t,
|
|
2664
2638
|
c,
|
|
2665
2639
|
n
|
|
2666
|
-
]), /* @__PURE__ */ X(
|
|
2640
|
+
]), /* @__PURE__ */ X(Gc.Provider, {
|
|
2667
2641
|
value: K(() => ({ getWidgetContainer: (e) => {
|
|
2668
2642
|
if (t) {
|
|
2669
|
-
let n =
|
|
2643
|
+
let n = _l.get(t);
|
|
2670
2644
|
if (n?.has(e)) return n.get(e) || null;
|
|
2671
2645
|
}
|
|
2672
2646
|
return i.current.get(e) || null;
|
|
@@ -2679,7 +2653,7 @@ function yl({ children: e }) {
|
|
|
2679
2653
|
}
|
|
2680
2654
|
//#endregion
|
|
2681
2655
|
//#region src/blocks/F0GridStack/F0GridStack.tsx
|
|
2682
|
-
var
|
|
2656
|
+
var yl = ({ options: e, widgets: t, onChange: n, className: r, static: i, forcePositionSync: a }) => {
|
|
2683
2657
|
let o = K(() => JSON.stringify(t.map((e) => ({
|
|
2684
2658
|
id: e.id,
|
|
2685
2659
|
w: e.w,
|
|
@@ -2707,7 +2681,7 @@ var bl = ({ options: e, widgets: t, onChange: n, className: r, static: i, forceP
|
|
|
2707
2681
|
}
|
|
2708
2682
|
return r;
|
|
2709
2683
|
};
|
|
2710
|
-
return /* @__PURE__ */ X(
|
|
2684
|
+
return /* @__PURE__ */ X(Wc, {
|
|
2711
2685
|
options: s,
|
|
2712
2686
|
widgets: t,
|
|
2713
2687
|
onResizeStop: (e, t) => {
|
|
@@ -2724,11 +2698,11 @@ var bl = ({ options: e, widgets: t, onChange: n, className: r, static: i, forceP
|
|
|
2724
2698
|
onChange: n,
|
|
2725
2699
|
static: i,
|
|
2726
2700
|
forcePositionSync: a,
|
|
2727
|
-
children: /* @__PURE__ */ X(
|
|
2701
|
+
children: /* @__PURE__ */ X(vl, { children: /* @__PURE__ */ X(qc, {}) })
|
|
2728
2702
|
});
|
|
2729
2703
|
};
|
|
2730
|
-
|
|
2731
|
-
var
|
|
2704
|
+
yl.displayName = "F0GridStack";
|
|
2705
|
+
var bl = L(gn("F0GridStack", yl)), xl = (e, t, n) => /* @__PURE__ */ X("div", { children: e }), Sl = ({ widgets: e = [], editMode: t = !1, onChange: n = () => {}, WidgetWrapper: r = xl, main: i = !1, deps: a }) => {
|
|
2732
2706
|
let o = W((e, t, n) => /* @__PURE__ */ X(qn.div, {
|
|
2733
2707
|
className: "h-full w-full",
|
|
2734
2708
|
initial: {
|
|
@@ -2896,36 +2870,36 @@ var xl = L(gn("F0GridStack", bl)), Sl = (e, t, n) => /* @__PURE__ */ X("div", {
|
|
|
2896
2870
|
o,
|
|
2897
2871
|
_,
|
|
2898
2872
|
a
|
|
2899
|
-
]), /* @__PURE__ */ X(
|
|
2873
|
+
]), /* @__PURE__ */ X(yl, {
|
|
2900
2874
|
className: B(i && "h-full flex-1 overflow-auto"),
|
|
2901
2875
|
options: s,
|
|
2902
2876
|
onChange: v,
|
|
2903
2877
|
widgets: l
|
|
2904
2878
|
});
|
|
2905
2879
|
};
|
|
2906
|
-
|
|
2880
|
+
Sl.displayName = "GroupGrid", Sl.__isPageLayoutGroup = !0;
|
|
2907
2881
|
//#endregion
|
|
2908
2882
|
//#region src/blocks/layouts/Layout/utils.ts
|
|
2909
|
-
var
|
|
2883
|
+
var Cl = (e, t) => {
|
|
2910
2884
|
let n = t;
|
|
2911
2885
|
return n.displayName = e, n.__isPageLayoutBlock = !0, n;
|
|
2912
|
-
},
|
|
2886
|
+
}, wl = (e, t) => {
|
|
2913
2887
|
let n = t;
|
|
2914
2888
|
return n.displayName = e, n.__isPageLayoutGroup = !0, n;
|
|
2915
|
-
},
|
|
2889
|
+
}, Tl = Un.filter((e) => e !== "ai"), El = Gn, Dl = ({ children: e, title: t, draggable: n = !1, actions: r, aiButton: i }) => /* @__PURE__ */ X(mt, {
|
|
2916
2890
|
header: { title: t },
|
|
2917
2891
|
draggable: n,
|
|
2918
2892
|
actions: r,
|
|
2919
2893
|
AIButton: i,
|
|
2920
2894
|
fullHeight: !0,
|
|
2921
2895
|
children: e
|
|
2922
|
-
}),
|
|
2896
|
+
}), Ol = ({ widgets: e, editMode: t = !1, onChange: n = () => {}, deps: r, ...i }) => /* @__PURE__ */ X(Sl, {
|
|
2923
2897
|
widgets: e,
|
|
2924
2898
|
editMode: t,
|
|
2925
2899
|
onChange: n,
|
|
2926
2900
|
deps: r,
|
|
2927
2901
|
...i,
|
|
2928
|
-
WidgetWrapper: (e, t, n) => /* @__PURE__ */ X(
|
|
2902
|
+
WidgetWrapper: (e, t, n) => /* @__PURE__ */ X(Dl, {
|
|
2929
2903
|
title: t?.title ?? "",
|
|
2930
2904
|
draggable: n,
|
|
2931
2905
|
actions: t?.actions,
|
|
@@ -2933,19 +2907,19 @@ var wl = (e, t) => {
|
|
|
2933
2907
|
children: e
|
|
2934
2908
|
})
|
|
2935
2909
|
});
|
|
2936
|
-
|
|
2937
|
-
var
|
|
2910
|
+
Ol.displayName = "Dashboard";
|
|
2911
|
+
var kl = wl("Dashboard", Ol), Al = L(gn("Dashboard", kl)), jl = $a({
|
|
2938
2912
|
base: "flex w-full flex-col p-4",
|
|
2939
2913
|
variants: { variant: {
|
|
2940
2914
|
default: "",
|
|
2941
2915
|
"full-width": "px-0",
|
|
2942
2916
|
full: "p-0"
|
|
2943
2917
|
} }
|
|
2944
|
-
}),
|
|
2945
|
-
let d = K(() =>
|
|
2918
|
+
}), Ml = (e) => (e || []).map((e) => e.items).reduce((e, t) => (e.length > 0 && e.push({ type: "separator" }), e.push(...t), e), []), Nl = (e) => Array.isArray(e) ? e.every((e) => "onClick" in e) ? [{ items: e }] : e : [e], Pl = yc(({ children: e, variant: t = "default", className: n, draggable: r = !1, onDragStart: i, onDragEnd: a, onDrop: o, dragId: s, primaryAction: c, ...l }, u) => {
|
|
2919
|
+
let d = K(() => Nl(l.actions || []), [l.actions]), f = K(() => d.flatMap((e) => e.items), [d]), p = K(() => f.length > 0 || !!c, [f, c]);
|
|
2946
2920
|
return /* @__PURE__ */ Z("div", {
|
|
2947
2921
|
ref: u,
|
|
2948
|
-
className: B(
|
|
2922
|
+
className: B(jl({ variant: t }), "relative", n),
|
|
2949
2923
|
draggable: r,
|
|
2950
2924
|
onDragStart: i,
|
|
2951
2925
|
onDragEnd: a,
|
|
@@ -2955,7 +2929,7 @@ var Al = Tl("Dashboard", kl), jl = L(gn("Dashboard", Al)), Ml = $a({
|
|
|
2955
2929
|
children: [p ? /* @__PURE__ */ Z("div", {
|
|
2956
2930
|
className: "absolute right-0 top-0 flex items-center justify-end gap-2 p-4",
|
|
2957
2931
|
children: [c || null, f.length > 0 ? /* @__PURE__ */ X(zi, {
|
|
2958
|
-
items:
|
|
2932
|
+
items: Ml(d),
|
|
2959
2933
|
"data-testid": "actions-dropdown"
|
|
2960
2934
|
}) : null]
|
|
2961
2935
|
}) : null, /* @__PURE__ */ X("div", {
|
|
@@ -2964,11 +2938,11 @@ var Al = Tl("Dashboard", kl), jl = L(gn("Dashboard", Al)), Ml = $a({
|
|
|
2964
2938
|
})]
|
|
2965
2939
|
});
|
|
2966
2940
|
});
|
|
2967
|
-
|
|
2968
|
-
var
|
|
2941
|
+
Pl.displayName = "Block", Pl.__isPageLayoutBlock = !0;
|
|
2942
|
+
var Fl = Cl("BlockContent", ({ title: e = "", description: t, titleLevel: n = "h2", children: r, className: i, ...a }) => {
|
|
2969
2943
|
if (!e) return null;
|
|
2970
2944
|
let o = n;
|
|
2971
|
-
return /* @__PURE__ */ Z(
|
|
2945
|
+
return /* @__PURE__ */ Z(Pl, {
|
|
2972
2946
|
...a,
|
|
2973
2947
|
className: B("space-y-4", i),
|
|
2974
2948
|
children: [/* @__PURE__ */ Z("div", {
|
|
@@ -2992,11 +2966,11 @@ var Il = wl("BlockContent", ({ title: e = "", description: t, titleLevel: n = "h
|
|
|
2992
2966
|
children: r
|
|
2993
2967
|
})]
|
|
2994
2968
|
});
|
|
2995
|
-
}),
|
|
2969
|
+
}), Il = (e) => !bc(e) || !e.type || typeof e.type == "string" || typeof e.type == "symbol" ? !1 : "__isPageLayoutBlock" in e.type, Ll = (e) => !bc(e) || !e.type || typeof e.type == "string" || typeof e.type == "symbol" ? !1 : "__isPageLayoutGroup" in e.type, Rl = (e, t, n) => {
|
|
2996
2970
|
let r = gc.toArray(t);
|
|
2997
|
-
for (let t of r) n.includes("block") &&
|
|
2998
|
-
},
|
|
2999
|
-
|
|
2971
|
+
for (let t of r) n.includes("block") && Il(t) || n.includes("group") && Ll(t) || console.warn(`${e}: Children components must inherit from PageLayoutBlock or PageLayoutGroup. Found:`, t);
|
|
2972
|
+
}, zl = yc(({ children: e, onSort: t, ...n }, r) => {
|
|
2973
|
+
Rl("GroupLinear", e, ["block"]);
|
|
3000
2974
|
let [i, a] = J(gc.toArray(e));
|
|
3001
2975
|
return G(() => {
|
|
3002
2976
|
a(gc.toArray(e));
|
|
@@ -3008,10 +2982,10 @@ var Il = wl("BlockContent", ({ title: e = "", description: t, titleLevel: n = "h
|
|
|
3008
2982
|
children: i.map((e, t) => /* @__PURE__ */ X(_c, { children: e }, t))
|
|
3009
2983
|
});
|
|
3010
2984
|
});
|
|
3011
|
-
|
|
2985
|
+
zl.displayName = "GroupLinear", zl.__isPageLayoutGroup = !0;
|
|
3012
2986
|
//#endregion
|
|
3013
2987
|
//#region src/blocks/layouts/Layout/groups/GroupMasonry/components/SortableBlock.tsx
|
|
3014
|
-
var
|
|
2988
|
+
var Bl = ({ id: e, children: t }) => {
|
|
3015
2989
|
let { attributes: n, listeners: r, setNodeRef: i, transform: a, transition: o } = N({ id: e }), s = {
|
|
3016
2990
|
transform: Rt.Translate.toString(a),
|
|
3017
2991
|
transition: o,
|
|
@@ -3026,7 +3000,7 @@ var Vl = ({ id: e, children: t }) => {
|
|
|
3026
3000
|
...r,
|
|
3027
3001
|
children: t
|
|
3028
3002
|
});
|
|
3029
|
-
},
|
|
3003
|
+
}, Vl = ({ blocks: e, sortable: t = !1, onSort: n = () => {}, main: i = !1 }) => {
|
|
3030
3004
|
let [a, o] = J([]);
|
|
3031
3005
|
os(() => {
|
|
3032
3006
|
o(e.map((e, t) => ({
|
|
@@ -3046,27 +3020,27 @@ var Vl = ({ id: e, children: t }) => {
|
|
|
3046
3020
|
let { active: t, over: n } = e;
|
|
3047
3021
|
c(null), n && t.id !== n.id && o((e) => {
|
|
3048
3022
|
let r = e.findIndex((e) => e.id === t.id), i = e.findIndex((e) => e.id === n.id);
|
|
3049
|
-
return
|
|
3023
|
+
return I(e, r, i);
|
|
3050
3024
|
});
|
|
3051
3025
|
},
|
|
3052
3026
|
children: [/* @__PURE__ */ X(T, {
|
|
3053
3027
|
items: a,
|
|
3054
|
-
children: a.map((e) => /* @__PURE__ */ X(
|
|
3028
|
+
children: a.map((e) => /* @__PURE__ */ X(Bl, {
|
|
3055
3029
|
id: e.id,
|
|
3056
3030
|
children: e.render
|
|
3057
3031
|
}, e.id))
|
|
3058
|
-
}), /* @__PURE__ */ X(Le, { children: s ? /* @__PURE__ */ X(
|
|
3032
|
+
}), /* @__PURE__ */ X(Le, { children: s ? /* @__PURE__ */ X(Bl, {
|
|
3059
3033
|
id: s,
|
|
3060
3034
|
children: a.find((e) => e.id === s)?.render
|
|
3061
3035
|
}) : null })]
|
|
3062
3036
|
})
|
|
3063
3037
|
});
|
|
3064
3038
|
};
|
|
3065
|
-
|
|
3039
|
+
Vl.displayName = "GroupMasonry", Vl.__isPageLayoutGroup = !0;
|
|
3066
3040
|
//#endregion
|
|
3067
3041
|
//#region src/blocks/layouts/Layout/pages/Page.tsx
|
|
3068
|
-
var
|
|
3069
|
-
return process.env.NODE_ENV === "development" &&
|
|
3042
|
+
var Hl = yc(function({ children: e, aside: t, header: n, variant: r = "main-aside" }, i) {
|
|
3043
|
+
return process.env.NODE_ENV === "development" && Rl("Page", e, ["block", "group"]), /* @__PURE__ */ X("div", {
|
|
3070
3044
|
ref: i,
|
|
3071
3045
|
className: "h-full",
|
|
3072
3046
|
children: /* @__PURE__ */ Z("div", {
|
|
@@ -3086,30 +3060,30 @@ var Ul = yc(function({ children: e, aside: t, header: n, variant: r = "main-asid
|
|
|
3086
3060
|
}) : null]
|
|
3087
3061
|
})
|
|
3088
3062
|
});
|
|
3089
|
-
}),
|
|
3090
|
-
Page: L(gn("Page",
|
|
3091
|
-
Block: L(gn("Block",
|
|
3092
|
-
BlockContent: L(gn("BlockContent",
|
|
3093
|
-
Group: L(gn("Group",
|
|
3094
|
-
GroupGrid: L(gn("GroupGrid",
|
|
3095
|
-
GroupMasonry: L(gn("GroupMasonry",
|
|
3096
|
-
},
|
|
3063
|
+
}), Ul = {
|
|
3064
|
+
Page: L(gn("Page", Hl)),
|
|
3065
|
+
Block: L(gn("Block", Pl)),
|
|
3066
|
+
BlockContent: L(gn("BlockContent", Fl)),
|
|
3067
|
+
Group: L(gn("Group", zl)),
|
|
3068
|
+
GroupGrid: L(gn("GroupGrid", Sl)),
|
|
3069
|
+
GroupMasonry: L(gn("GroupMasonry", Vl))
|
|
3070
|
+
}, Wl = Pc, Gl = Ic, Kl = L(eo({
|
|
3097
3071
|
name: "HomeLayout",
|
|
3098
3072
|
type: "layout"
|
|
3099
|
-
}, jc)),
|
|
3073
|
+
}, jc)), ql = [
|
|
3100
3074
|
"person",
|
|
3101
3075
|
"team",
|
|
3102
3076
|
"company",
|
|
3103
3077
|
"file",
|
|
3104
3078
|
"flag"
|
|
3105
|
-
],
|
|
3079
|
+
], Jl = (e) => typeof e == "boolean" || !e ? {
|
|
3106
3080
|
show: !!e,
|
|
3107
3081
|
invertStatus: !1
|
|
3108
3082
|
} : {
|
|
3109
3083
|
show: e.show ?? !0,
|
|
3110
3084
|
invertStatus: e.invertStatus ?? !1
|
|
3111
|
-
},
|
|
3112
|
-
let n = Fo(), r = n(t.value, { formatterOptions: { decimalPlaces: 2 } }), i =
|
|
3085
|
+
}, Yl = ({ label: e, ...t }) => {
|
|
3086
|
+
let n = Fo(), r = n(t.value, { formatterOptions: { decimalPlaces: 2 } }), i = Jl(t.trend), a = n(t.comparison), o = Ro(r.numericValue, r.formatterOptions), s = qo(a.numericValue), c = qo(r.numericValue), l = K(() => {
|
|
3113
3087
|
if (s && i.show && s && c) return (c - s) / s * 100;
|
|
3114
3088
|
}, [
|
|
3115
3089
|
c,
|
|
@@ -3131,19 +3105,19 @@ var Ul = yc(function({ children: e, aside: t, header: n, variant: r = "main-asid
|
|
|
3131
3105
|
})]
|
|
3132
3106
|
})]
|
|
3133
3107
|
});
|
|
3134
|
-
},
|
|
3108
|
+
}, Xl = () => /* @__PURE__ */ Z("div", {
|
|
3135
3109
|
className: "relative flex h-full w-full cursor-progress flex-col gap-2",
|
|
3136
3110
|
children: [/* @__PURE__ */ X(z, { className: "h-3 w-full max-w-16 rounded-md" }), /* @__PURE__ */ Z("div", {
|
|
3137
3111
|
className: "flex flex-row flex-wrap items-end gap-2",
|
|
3138
3112
|
children: [/* @__PURE__ */ X(z, { className: "h-8 w-full max-w-36 rounded-sm" }), /* @__PURE__ */ X(z, { className: "h-6 w-full max-w-18 rounded-sm" })]
|
|
3139
3113
|
})]
|
|
3140
3114
|
});
|
|
3141
|
-
|
|
3142
|
-
var
|
|
3115
|
+
Yl.displayName = "F0BigNumber";
|
|
3116
|
+
var Zl = Si(Yl, Xl), Ql = L(Zl), $l = [
|
|
3143
3117
|
"default",
|
|
3144
3118
|
"outline",
|
|
3145
3119
|
"neutral"
|
|
3146
|
-
],
|
|
3120
|
+
], eu = Gn, tu = ["split", "dropdown"], nu = ["sm", "md"], ru = Zn, iu = ({ actions: e }) => /* @__PURE__ */ X("div", {
|
|
3147
3121
|
className: "flex items-center gap-2",
|
|
3148
3122
|
children: e.map((e, t) => {
|
|
3149
3123
|
switch (e.type) {
|
|
@@ -3168,7 +3142,7 @@ var Ql = Si(Xl, Zl), $l = L(Ql), eu = [
|
|
|
3168
3142
|
}, t);
|
|
3169
3143
|
}
|
|
3170
3144
|
})
|
|
3171
|
-
}),
|
|
3145
|
+
}), au = ({ item: e, open: t, onOpenChange: n }) => {
|
|
3172
3146
|
let r = Xn(), i = R().t(t ? "actions.collapseItem" : "actions.expandItem", { title: e.title }), a = !!e.actions && e.actions.length > 0;
|
|
3173
3147
|
return /* @__PURE__ */ X(yr, {
|
|
3174
3148
|
open: t,
|
|
@@ -3195,7 +3169,7 @@ var Ql = Si(Xl, Zl), $l = L(Ql), eu = [
|
|
|
3195
3169
|
className: "flex items-center [&>*]:min-w-0",
|
|
3196
3170
|
children: e.summary
|
|
3197
3171
|
}) : null,
|
|
3198
|
-
a ? /* @__PURE__ */ X(
|
|
3172
|
+
a ? /* @__PURE__ */ X(iu, { actions: e.actions }) : null,
|
|
3199
3173
|
/* @__PURE__ */ X(Yr, {
|
|
3200
3174
|
asChild: !0,
|
|
3201
3175
|
children: /* @__PURE__ */ X(V, {
|
|
@@ -3240,7 +3214,7 @@ var Ql = Si(Xl, Zl), $l = L(Ql), eu = [
|
|
|
3240
3214
|
})]
|
|
3241
3215
|
})
|
|
3242
3216
|
});
|
|
3243
|
-
},
|
|
3217
|
+
}, ou = ({ items: e = 4 }) => /* @__PURE__ */ X("div", {
|
|
3244
3218
|
"aria-busy": "true",
|
|
3245
3219
|
"aria-live": "polite",
|
|
3246
3220
|
className: B("flex flex-col rounded-md border border-solid border-f1-border-secondary", "overflow-hidden bg-f1-background"),
|
|
@@ -3248,7 +3222,7 @@ var Ql = Si(Xl, Zl), $l = L(Ql), eu = [
|
|
|
3248
3222
|
className: "flex items-center gap-3 px-4 py-3",
|
|
3249
3223
|
children: [/* @__PURE__ */ X(z, { className: "h-4 flex-1 max-w-48" }), /* @__PURE__ */ X(z, { className: "ml-auto h-7 w-7 shrink-0 rounded" })]
|
|
3250
3224
|
})] }, t))
|
|
3251
|
-
}),
|
|
3225
|
+
}), su = yc((e, t) => {
|
|
3252
3226
|
let { items: n, value: r, defaultValue: i, onValueChange: a, ...o } = e, s = K(() => i === void 0 ? n.filter((e) => e.defaultOpen).map((e) => e.id) : i, [i, n]), [c = [], l] = ec({
|
|
3253
3227
|
prop: r,
|
|
3254
3228
|
defaultProp: s,
|
|
@@ -3261,20 +3235,20 @@ var Ql = Si(Xl, Zl), $l = L(Ql), eu = [
|
|
|
3261
3235
|
ref: t,
|
|
3262
3236
|
...o,
|
|
3263
3237
|
className: B("flex flex-col rounded-md border border-solid border-f1-border-secondary", "overflow-hidden bg-f1-background"),
|
|
3264
|
-
children: n.map((e, t) => /* @__PURE__ */ Z(_c, { children: [t > 0 ? /* @__PURE__ */ X("div", { className: "h-px w-full bg-f1-border-secondary" }) : null, /* @__PURE__ */ X(
|
|
3238
|
+
children: n.map((e, t) => /* @__PURE__ */ Z(_c, { children: [t > 0 ? /* @__PURE__ */ X("div", { className: "h-px w-full bg-f1-border-secondary" }) : null, /* @__PURE__ */ X(au, {
|
|
3265
3239
|
item: e,
|
|
3266
3240
|
open: c.includes(e.id),
|
|
3267
3241
|
onOpenChange: (t) => u(e.id, t)
|
|
3268
3242
|
})] }, e.id))
|
|
3269
3243
|
});
|
|
3270
3244
|
});
|
|
3271
|
-
|
|
3272
|
-
var
|
|
3245
|
+
su.displayName = "F0Accordion";
|
|
3246
|
+
var cu = L(gn("F0Accordion", Si(su, ou))), lu = [
|
|
3273
3247
|
"info",
|
|
3274
3248
|
"warning",
|
|
3275
3249
|
"critical",
|
|
3276
3250
|
"positive"
|
|
3277
|
-
],
|
|
3251
|
+
], uu = ({ count: e, list: t }) => {
|
|
3278
3252
|
let [n, r] = J(!1), i = /* @__PURE__ */ X(Ao, { label: `+${e}` });
|
|
3279
3253
|
return t?.length ? /* @__PURE__ */ Z(ic, {
|
|
3280
3254
|
open: n,
|
|
@@ -3301,16 +3275,16 @@ var lu = L(gn("F0Accordion", Si(cu, su))), uu = [
|
|
|
3301
3275
|
})]
|
|
3302
3276
|
}) : i;
|
|
3303
3277
|
};
|
|
3304
|
-
|
|
3278
|
+
uu.displayName = "ChipCounter";
|
|
3305
3279
|
//#endregion
|
|
3306
3280
|
//#region src/elements/F0ChipList/F0ChipList.tsx
|
|
3307
|
-
var
|
|
3281
|
+
var du = ({ chips: e, max: t = 4, remainingCount: n, layout: r = "compact" }) => {
|
|
3308
3282
|
if (r === "fill") return /* @__PURE__ */ X(bo, {
|
|
3309
3283
|
items: e,
|
|
3310
3284
|
renderListItem: (e) => /* @__PURE__ */ X(Ao, { ...e }),
|
|
3311
3285
|
renderDropdownItem: () => null,
|
|
3312
3286
|
forceShowingOverflowIndicator: n !== void 0,
|
|
3313
|
-
renderOverflowIndicator: (t) => /* @__PURE__ */ X(
|
|
3287
|
+
renderOverflowIndicator: (t) => /* @__PURE__ */ X(uu, {
|
|
3314
3288
|
count: (n ?? 0) + t,
|
|
3315
3289
|
list: n ? void 0 : e.slice(e.length - t)
|
|
3316
3290
|
}),
|
|
@@ -3320,31 +3294,31 @@ var fu = ({ chips: e, max: t = 4, remainingCount: n, layout: r = "compact" }) =>
|
|
|
3320
3294
|
let i = e.slice(0, t), a = e.slice(t), o = n ?? e.length - t, s = o > 0;
|
|
3321
3295
|
return /* @__PURE__ */ Z("div", {
|
|
3322
3296
|
className: "flex items-center gap-2",
|
|
3323
|
-
children: [i.map((e, t) => /* @__PURE__ */ X(Ao, { ...e }, t)), s ? /* @__PURE__ */ X(
|
|
3297
|
+
children: [i.map((e, t) => /* @__PURE__ */ X(Ao, { ...e }, t)), s ? /* @__PURE__ */ X(uu, {
|
|
3324
3298
|
count: o,
|
|
3325
3299
|
list: n ? void 0 : a
|
|
3326
3300
|
}) : null]
|
|
3327
3301
|
});
|
|
3328
3302
|
};
|
|
3329
|
-
|
|
3330
|
-
var
|
|
3303
|
+
du.displayName = "F0ChipList";
|
|
3304
|
+
var fu = L(gn("F0ChipList", du)), pu = [
|
|
3331
3305
|
"blur",
|
|
3332
3306
|
"escape",
|
|
3333
3307
|
"commit",
|
|
3334
3308
|
"popupClose"
|
|
3335
|
-
],
|
|
3309
|
+
], mu = ks, hu = [
|
|
3336
3310
|
"info",
|
|
3337
3311
|
"warning",
|
|
3338
3312
|
"critical",
|
|
3339
3313
|
"neutral",
|
|
3340
3314
|
"positive",
|
|
3341
3315
|
"transparent"
|
|
3342
|
-
],
|
|
3316
|
+
], gu = {
|
|
3343
3317
|
get: async (e) => JSON.parse(localStorage.getItem(Ci(e)) ?? "{}"),
|
|
3344
3318
|
set: async (e, t) => {
|
|
3345
3319
|
localStorage.setItem(Ci(e), JSON.stringify(t));
|
|
3346
3320
|
}
|
|
3347
|
-
},
|
|
3321
|
+
}, _u = ({ disableClose: e = !1, onClose: t, isOpen: n, children: r, position: i = "right", size: a = "md", primaryAction: o, secondaryAction: s, title: l, description: u, module: d, otherActions: f, tabs: p, modal: m = !1, activeTabId: h, setActiveTabId: g, disableContentPadding: _, container: v, onWidthChange: y }) => {
|
|
3348
3322
|
let [b, x] = J(n);
|
|
3349
3323
|
G(() => {
|
|
3350
3324
|
x(n);
|
|
@@ -3396,10 +3370,10 @@ var pu = L(gn("F0ChipList", fu)), mu = [
|
|
|
3396
3370
|
onWidthChange: y,
|
|
3397
3371
|
children: S
|
|
3398
3372
|
});
|
|
3399
|
-
},
|
|
3400
|
-
|
|
3401
|
-
var
|
|
3402
|
-
function
|
|
3373
|
+
}, vu = (e) => /* @__PURE__ */ X(_u, { ...e });
|
|
3374
|
+
vu.displayName = "F0Drawer";
|
|
3375
|
+
var yu = gn("F0Drawer", vu), bu = 388;
|
|
3376
|
+
function xu({ filters: e, value: t, onChange: n, height: r, width: i = 600, className: a, showApplyButton: o = !0, applyButtonLabel: s, dataTestId: c }) {
|
|
3403
3377
|
let l = R(), u = Object.keys(e)[0] ?? null, [d, f] = J(u), [p, m] = J(t);
|
|
3404
3378
|
G(() => {
|
|
3405
3379
|
m(t);
|
|
@@ -3433,7 +3407,7 @@ function Su({ filters: e, value: t, onChange: n, height: r, width: i = 600, clas
|
|
|
3433
3407
|
n(p);
|
|
3434
3408
|
}, _ = K(() => r || Object.entries(e).reduce((e, [t, n]) => {
|
|
3435
3409
|
let r = ss(n.type);
|
|
3436
|
-
return Math.max(e, r?.formHeight ||
|
|
3410
|
+
return Math.max(e, r?.formHeight || bu);
|
|
3437
3411
|
}, 0), [e, r]);
|
|
3438
3412
|
return !e || Object.keys(e).length === 0 ? null : /* @__PURE__ */ X(fn, {
|
|
3439
3413
|
dataTestId: c,
|
|
@@ -3454,11 +3428,11 @@ function Su({ filters: e, value: t, onChange: n, height: r, width: i = 600, clas
|
|
|
3454
3428
|
})
|
|
3455
3429
|
});
|
|
3456
3430
|
}
|
|
3457
|
-
|
|
3458
|
-
var
|
|
3431
|
+
xu.displayName = "F0FilterPickerContent";
|
|
3432
|
+
var Su = xu;
|
|
3459
3433
|
//#endregion
|
|
3460
3434
|
//#region src/blocks/F0Form/describeFormSchema.ts
|
|
3461
|
-
function
|
|
3435
|
+
function Cu(e) {
|
|
3462
3436
|
let t = ti(e).shape, n = [];
|
|
3463
3437
|
for (let [e, r] of Object.entries(t)) {
|
|
3464
3438
|
let t = r, i = or(t);
|
|
@@ -3486,7 +3460,7 @@ function wu(e) {
|
|
|
3486
3460
|
}
|
|
3487
3461
|
//#endregion
|
|
3488
3462
|
//#region src/blocks/F0Form/testing/createF0FormTester.ts
|
|
3489
|
-
function
|
|
3463
|
+
function wu(e) {
|
|
3490
3464
|
let t = {}, n;
|
|
3491
3465
|
for (let r of e.issues) {
|
|
3492
3466
|
if (r.path.length === 0) {
|
|
@@ -3501,7 +3475,7 @@ function Tu(e) {
|
|
|
3501
3475
|
rootError: n
|
|
3502
3476
|
};
|
|
3503
3477
|
}
|
|
3504
|
-
function
|
|
3478
|
+
function Tu(e) {
|
|
3505
3479
|
let { schema: t, defaultValues: n, errorMap: r, onSubmit: i } = e, a = async (e) => {
|
|
3506
3480
|
let i = {
|
|
3507
3481
|
...n,
|
|
@@ -3513,7 +3487,7 @@ function Eu(e) {
|
|
|
3513
3487
|
valid: !0,
|
|
3514
3488
|
errors: {}
|
|
3515
3489
|
};
|
|
3516
|
-
let { errors: l, rootError: u } =
|
|
3490
|
+
let { errors: l, rootError: u } = wu(c.error);
|
|
3517
3491
|
return {
|
|
3518
3492
|
valid: !1,
|
|
3519
3493
|
errors: l,
|
|
@@ -3529,7 +3503,7 @@ function Eu(e) {
|
|
|
3529
3503
|
errors: n === void 0 ? {} : { [e]: n }
|
|
3530
3504
|
};
|
|
3531
3505
|
},
|
|
3532
|
-
describeFields: () =>
|
|
3506
|
+
describeFields: () => Cu(t),
|
|
3533
3507
|
getDefaultValues: () => n,
|
|
3534
3508
|
getVisibleFields: (e) => {
|
|
3535
3509
|
let r = {
|
|
@@ -3559,8 +3533,8 @@ function Eu(e) {
|
|
|
3559
3533
|
}
|
|
3560
3534
|
//#endregion
|
|
3561
3535
|
//#region src/blocks/F0Form/testing/createF0FormDefinitionTester.ts
|
|
3562
|
-
function
|
|
3563
|
-
return
|
|
3536
|
+
function Eu(e, t) {
|
|
3537
|
+
return Tu({
|
|
3564
3538
|
schema: e.schema,
|
|
3565
3539
|
defaultValues: e.defaultValues,
|
|
3566
3540
|
errorMap: t?.errorMap,
|
|
@@ -3569,7 +3543,7 @@ function Du(e, t) {
|
|
|
3569
3543
|
}
|
|
3570
3544
|
//#endregion
|
|
3571
3545
|
//#region src/blocks/dialog-alike/F0Dialog/internal/DialogNotification.tsx
|
|
3572
|
-
var
|
|
3546
|
+
var Du = ({ isOpen: e = !1, onClose: t = () => {}, type: n, title: r, description: i, primaryAction: a, secondaryAction: o, dismissable: s = !1 }) => /* @__PURE__ */ X(P, {
|
|
3573
3547
|
isOpen: e,
|
|
3574
3548
|
onClose: t,
|
|
3575
3549
|
variant: "notification",
|
|
@@ -3595,7 +3569,7 @@ var Ou = ({ isOpen: e = !1, onClose: t = () => {}, type: n, title: r, descriptio
|
|
|
3595
3569
|
})]
|
|
3596
3570
|
})]
|
|
3597
3571
|
})
|
|
3598
|
-
}),
|
|
3572
|
+
}), Ou = 200, ku = async (e) => Promise.resolve(typeof e.value == "function" ? await e.value() : e.value), Au = ({ items: e }) => {
|
|
3599
3573
|
let [t, n] = J({}), [r, i] = J(e), a = q(e), o = q(/* @__PURE__ */ new Map());
|
|
3600
3574
|
G(() => {
|
|
3601
3575
|
let t = new Set(e.map((e) => e.id)), n = a.current;
|
|
@@ -3608,7 +3582,7 @@ var Ou = ({ isOpen: e = !1, onClose: t = () => {}, type: n, title: r, descriptio
|
|
|
3608
3582
|
if (t.has(e.id) || o.current.has(e.id)) continue;
|
|
3609
3583
|
let n = setTimeout(() => {
|
|
3610
3584
|
o.current.delete(e.id), i((t) => t.filter((t) => t.id !== e.id));
|
|
3611
|
-
},
|
|
3585
|
+
}, Ou);
|
|
3612
3586
|
o.current.set(e.id, n);
|
|
3613
3587
|
}
|
|
3614
3588
|
i((n) => {
|
|
@@ -3635,7 +3609,7 @@ var Ou = ({ isOpen: e = !1, onClose: t = () => {}, type: n, title: r, descriptio
|
|
|
3635
3609
|
onClick: async () => {
|
|
3636
3610
|
t.nonBlocking || l(e.id, 1);
|
|
3637
3611
|
try {
|
|
3638
|
-
let n = await
|
|
3612
|
+
let n = await ku(t);
|
|
3639
3613
|
e.onClickAction(t, n);
|
|
3640
3614
|
} finally {
|
|
3641
3615
|
t.nonBlocking || l(e.id, -1);
|
|
@@ -3663,7 +3637,7 @@ var Ou = ({ isOpen: e = !1, onClose: t = () => {}, type: n, title: r, descriptio
|
|
|
3663
3637
|
}
|
|
3664
3638
|
}));
|
|
3665
3639
|
}, [u, t]);
|
|
3666
|
-
return /* @__PURE__ */ X(Y, { children: d.map((e) => /* @__PURE__ */ X(_c, { children: e.variant === "notification" ? /* @__PURE__ */ X(
|
|
3640
|
+
return /* @__PURE__ */ X(Y, { children: d.map((e) => /* @__PURE__ */ X(_c, { children: e.variant === "notification" ? /* @__PURE__ */ X(Du, {
|
|
3667
3641
|
title: e.title,
|
|
3668
3642
|
description: e.description ?? "",
|
|
3669
3643
|
type: e.type,
|
|
@@ -3672,7 +3646,7 @@ var Ou = ({ isOpen: e = !1, onClose: t = () => {}, type: n, title: r, descriptio
|
|
|
3672
3646
|
primaryAction: e.actions.primary[0],
|
|
3673
3647
|
secondaryAction: e.actions.secondary,
|
|
3674
3648
|
dismissable: e.dismissable
|
|
3675
|
-
}, e.id) : e.variant === "drawer" ? /* @__PURE__ */ X(
|
|
3649
|
+
}, e.id) : e.variant === "drawer" ? /* @__PURE__ */ X(_u, {
|
|
3676
3650
|
disableClose: c(e.id),
|
|
3677
3651
|
isOpen: s.has(e.id),
|
|
3678
3652
|
size: e.size,
|
|
@@ -3698,7 +3672,7 @@ var Ou = ({ isOpen: e = !1, onClose: t = () => {}, type: n, title: r, descriptio
|
|
|
3698
3672
|
module: e.module,
|
|
3699
3673
|
children: e.content
|
|
3700
3674
|
}, e.id) }, e.id)) });
|
|
3701
|
-
},
|
|
3675
|
+
}, ju = ({ children: e }) => {
|
|
3702
3676
|
let t = Ec(Lt.subscribe, Lt.getSnapshot, Lt.getServerSnapshot), n = R(), [r, i] = J(null);
|
|
3703
3677
|
G(() => {
|
|
3704
3678
|
let e = Lt.acquireRenderer();
|
|
@@ -3710,16 +3684,16 @@ var Ou = ({ isOpen: e = !1, onClose: t = () => {}, type: n, title: r, descriptio
|
|
|
3710
3684
|
ok: n.actions.ok,
|
|
3711
3685
|
cancel: n.actions.cancel
|
|
3712
3686
|
});
|
|
3713
|
-
}, [n]), /* @__PURE__ */ Z(Y, { children: [o && typeof document < "u" ? Oc(/* @__PURE__ */ X(
|
|
3714
|
-
},
|
|
3687
|
+
}, [n]), /* @__PURE__ */ Z(Y, { children: [o && typeof document < "u" ? Oc(/* @__PURE__ */ X(Au, { items: t }), document.body) : null, e] });
|
|
3688
|
+
}, Mu = 200, Nu = ({ children: e }) => {
|
|
3715
3689
|
let t = Ec(Oe.subscribe, Oe.getSnapshot, Oe.getServerSnapshot), [n, r] = J(null);
|
|
3716
3690
|
G(() => {
|
|
3717
3691
|
let e = Oe.acquireRenderer();
|
|
3718
3692
|
return r(e.id), e.release;
|
|
3719
3693
|
}, []);
|
|
3720
3694
|
let i = Ec(Oe.subscribeRenderer, Oe.getActiveRendererId, () => null);
|
|
3721
|
-
return /* @__PURE__ */ Z(Y, { children: [n !== null && n === i && typeof document < "u" ? Oc(/* @__PURE__ */ X(
|
|
3722
|
-
},
|
|
3695
|
+
return /* @__PURE__ */ Z(Y, { children: [n !== null && n === i && typeof document < "u" ? Oc(/* @__PURE__ */ X(Pu, { items: t }), document.body) : null, e] });
|
|
3696
|
+
}, Pu = ({ items: e }) => {
|
|
3723
3697
|
let [t, n] = J(e), r = q(e), i = q(/* @__PURE__ */ new Map());
|
|
3724
3698
|
G(() => {
|
|
3725
3699
|
let t = new Set(e.map((e) => e.id)), a = r.current;
|
|
@@ -3732,7 +3706,7 @@ var Ou = ({ isOpen: e = !1, onClose: t = () => {}, type: n, title: r, descriptio
|
|
|
3732
3706
|
if (t.has(e.id) || i.current.has(e.id)) continue;
|
|
3733
3707
|
let r = setTimeout(() => {
|
|
3734
3708
|
i.current.delete(e.id), n((t) => t.filter((t) => t.id !== e.id));
|
|
3735
|
-
},
|
|
3709
|
+
}, Mu);
|
|
3736
3710
|
i.current.set(e.id, r);
|
|
3737
3711
|
}
|
|
3738
3712
|
n((n) => {
|
|
@@ -3752,7 +3726,7 @@ var Ou = ({ isOpen: e = !1, onClose: t = () => {}, type: n, title: r, descriptio
|
|
|
3752
3726
|
};
|
|
3753
3727
|
//#endregion
|
|
3754
3728
|
//#region src/blocks/F0FormField/F0FormField.tsx
|
|
3755
|
-
function
|
|
3729
|
+
function Fu({ children: e }) {
|
|
3756
3730
|
let t = y(), n = K(() => t && {
|
|
3757
3731
|
...t,
|
|
3758
3732
|
registerInlineRow: void 0,
|
|
@@ -3766,7 +3740,7 @@ function Iu({ children: e }) {
|
|
|
3766
3740
|
})
|
|
3767
3741
|
});
|
|
3768
3742
|
}
|
|
3769
|
-
function
|
|
3743
|
+
function Iu({ field: e, value: t, onChange: n, onBlur: r, error: i, errorMessage: s, status: c, loading: l, required: u, disabled: d, hideLabel: p, initialFiles: m, inline: h }) {
|
|
3770
3744
|
let g = Cc(), _ = u ?? (e.validation ? o(e.validation) : !1), v = !p && e.type !== "checkbox" && e.type !== "custom", y = {
|
|
3771
3745
|
value: t,
|
|
3772
3746
|
onChange: n,
|
|
@@ -3786,7 +3760,7 @@ function Lu({ field: e, value: t, onChange: n, onBlur: r, error: i, errorMessage
|
|
|
3786
3760
|
...e,
|
|
3787
3761
|
disabled: d
|
|
3788
3762
|
}, C = e.type === "file" ? m : void 0;
|
|
3789
|
-
return h ? /* @__PURE__ */ X(
|
|
3763
|
+
return h ? /* @__PURE__ */ X(Fu, { children: /* @__PURE__ */ X("div", {
|
|
3790
3764
|
id: g,
|
|
3791
3765
|
children: /* @__PURE__ */ X(f, { children: /* @__PURE__ */ X(a, {
|
|
3792
3766
|
field: S,
|
|
@@ -3801,7 +3775,7 @@ function Lu({ field: e, value: t, onChange: n, onBlur: r, error: i, errorMessage
|
|
|
3801
3775
|
}),
|
|
3802
3776
|
restoreSnapshot: (e) => n(e.value)
|
|
3803
3777
|
}) })
|
|
3804
|
-
}) }) : /* @__PURE__ */ X(
|
|
3778
|
+
}) }) : /* @__PURE__ */ X(Fu, { children: /* @__PURE__ */ Z("div", {
|
|
3805
3779
|
className: "space-y-2",
|
|
3806
3780
|
id: g,
|
|
3807
3781
|
children: [
|
|
@@ -3831,24 +3805,24 @@ function Lu({ field: e, value: t, onChange: n, onBlur: r, error: i, errorMessage
|
|
|
3831
3805
|
]
|
|
3832
3806
|
}) });
|
|
3833
3807
|
}
|
|
3834
|
-
|
|
3808
|
+
Iu.displayName = "F0FormField";
|
|
3835
3809
|
//#endregion
|
|
3836
3810
|
//#region src/blocks/F0Wizard/components/WizardProvider.tsx
|
|
3837
|
-
var
|
|
3838
|
-
function
|
|
3839
|
-
let e = Sc(
|
|
3811
|
+
var Lu = vc(null);
|
|
3812
|
+
function Ru() {
|
|
3813
|
+
let e = Sc(Lu);
|
|
3840
3814
|
if (!e) throw Error("useF0Wizard must be used within a F0Wizard");
|
|
3841
3815
|
return e;
|
|
3842
3816
|
}
|
|
3843
|
-
function
|
|
3844
|
-
return /* @__PURE__ */ X(
|
|
3817
|
+
function zu({ children: e, ...t }) {
|
|
3818
|
+
return /* @__PURE__ */ X(Lu.Provider, {
|
|
3845
3819
|
value: t,
|
|
3846
3820
|
children: e
|
|
3847
3821
|
});
|
|
3848
3822
|
}
|
|
3849
3823
|
//#endregion
|
|
3850
3824
|
//#region src/blocks/F0Wizard/components/WizardSteps.tsx
|
|
3851
|
-
var
|
|
3825
|
+
var Bu = $a({
|
|
3852
3826
|
base: "flex-1 text-base font-medium leading-5 tracking-[-0.005em]",
|
|
3853
3827
|
variants: { state: {
|
|
3854
3828
|
active: "text-f1-foreground",
|
|
@@ -3856,10 +3830,10 @@ var Vu = $a({
|
|
|
3856
3830
|
upcoming: "text-f1-foreground"
|
|
3857
3831
|
} }
|
|
3858
3832
|
});
|
|
3859
|
-
function
|
|
3833
|
+
function Vu(e, t, n) {
|
|
3860
3834
|
return e === t ? "active" : n ? "completed" : "upcoming";
|
|
3861
3835
|
}
|
|
3862
|
-
function
|
|
3836
|
+
function Hu({ state: e, index: t }) {
|
|
3863
3837
|
return e === "completed" ? /* @__PURE__ */ X("span", {
|
|
3864
3838
|
className: "flex h-5 w-5 min-w-5 shrink-0 items-center justify-center rounded-xs bg-f1-background-secondary text-f1-foreground-secondary",
|
|
3865
3839
|
children: /* @__PURE__ */ X(Bs, { className: "h-3 w-3" })
|
|
@@ -3869,13 +3843,13 @@ function Uu({ state: e, index: t }) {
|
|
|
3869
3843
|
size: "md"
|
|
3870
3844
|
});
|
|
3871
3845
|
}
|
|
3872
|
-
function
|
|
3873
|
-
let { steps: e, currentStep: t, goToStep: n, allowStepSkipping: r } =
|
|
3846
|
+
function Uu() {
|
|
3847
|
+
let { steps: e, currentStep: t, goToStep: n, allowStepSkipping: r } = Ru();
|
|
3874
3848
|
return /* @__PURE__ */ X("nav", {
|
|
3875
3849
|
"aria-label": "Wizard steps",
|
|
3876
3850
|
className: "flex flex-col gap-1.5 p-1",
|
|
3877
3851
|
children: e.map((i, a) => {
|
|
3878
|
-
let o = a < t || i.isCompleted?.() === !0, s =
|
|
3852
|
+
let o = a < t || i.isCompleted?.() === !0, s = Vu(a, t, o), c = e[t]?.hasErrors?.() === !0, l = a > t && e.slice(t, a).some((e) => e.hasErrors?.() === !0), u = a !== t && !c && !l && e.slice(0, a).every((e) => e.isCompleted?.() !== !1);
|
|
3879
3853
|
return u && !r && a > t + 1 && (u = !1), /* @__PURE__ */ Z("button", {
|
|
3880
3854
|
type: "button",
|
|
3881
3855
|
onClick: () => {
|
|
@@ -3887,11 +3861,11 @@ function Wu() {
|
|
|
3887
3861
|
disabled: !u && a !== t,
|
|
3888
3862
|
"aria-current": a === t ? "step" : void 0,
|
|
3889
3863
|
className: B(En(), "flex cursor-pointer items-center gap-2 rounded p-2 text-left", s === "active" && "bg-f1-background-selected", u && "hover:bg-f1-background-secondary-hover", !u && a !== t && "cursor-default opacity-70"),
|
|
3890
|
-
children: [/* @__PURE__ */ X(
|
|
3864
|
+
children: [/* @__PURE__ */ X(Hu, {
|
|
3891
3865
|
state: s,
|
|
3892
3866
|
index: a
|
|
3893
3867
|
}), /* @__PURE__ */ X("span", {
|
|
3894
|
-
className:
|
|
3868
|
+
className: Bu({ state: s }),
|
|
3895
3869
|
children: i.title
|
|
3896
3870
|
})]
|
|
3897
3871
|
}, a);
|
|
@@ -3900,7 +3874,7 @@ function Wu() {
|
|
|
3900
3874
|
}
|
|
3901
3875
|
//#endregion
|
|
3902
3876
|
//#region src/blocks/F0Wizard/hooks/useWizardNavigation.ts
|
|
3903
|
-
function
|
|
3877
|
+
function Wu({ steps: e, defaultStepIndex: t = 0, onSubmit: n, onStepChanged: r, allowStepSkipping: i = !1, autoCloseOnLastStepSubmit: a = !1, onClose: o }) {
|
|
3904
3878
|
let [s, c] = J(t), [l, u] = J(!1), d = q(e);
|
|
3905
3879
|
d.current = e;
|
|
3906
3880
|
let f = W((e) => {
|
|
@@ -3953,8 +3927,8 @@ function Gu({ steps: e, defaultStepIndex: t = 0, onSubmit: n, onStepChanged: r,
|
|
|
3953
3927
|
}
|
|
3954
3928
|
//#endregion
|
|
3955
3929
|
//#region src/blocks/F0Wizard/F0Wizard.tsx
|
|
3956
|
-
var
|
|
3957
|
-
let h =
|
|
3930
|
+
var Gu = () => {}, Ku = ({ steps: e, children: t, isOpen: n, onClose: r = Gu, title: i, size: a = "xl", defaultStepIndex: o, nextLabel: s, previousLabel: c, submitLabel: l, onSubmit: u, onStepChanged: d, allowStepSkipping: f = !1, autoCloseOnLastStepSubmit: p = !1, autoSkipCompletedSteps: m = !1 }) => {
|
|
3931
|
+
let h = Wu({
|
|
3958
3932
|
steps: e,
|
|
3959
3933
|
defaultStepIndex: K(() => {
|
|
3960
3934
|
if (o !== void 0) return o;
|
|
@@ -4001,7 +3975,7 @@ var Ku = () => {}, qu = ({ steps: e, children: t, isOpen: n, onClose: r = Ku, ti
|
|
|
4001
3975
|
primaryAction: S,
|
|
4002
3976
|
secondaryAction: C,
|
|
4003
3977
|
disableContentPadding: !0,
|
|
4004
|
-
children: /* @__PURE__ */ X(
|
|
3978
|
+
children: /* @__PURE__ */ X(zu, {
|
|
4005
3979
|
currentStep: h.currentStep,
|
|
4006
3980
|
totalSteps: e.length,
|
|
4007
3981
|
loading: h.loading,
|
|
@@ -4014,7 +3988,7 @@ var Ku = () => {}, qu = ({ steps: e, children: t, isOpen: n, onClose: r = Ku, ti
|
|
|
4014
3988
|
className: "flex h-[58vh] flex-1 flex-row",
|
|
4015
3989
|
children: [/* @__PURE__ */ X("div", {
|
|
4016
3990
|
className: "w-1/3 shrink-0 overflow-y-auto border-x-0 border-b-0 border-r border-t-0 border-dashed border-f1-border-secondary p-2",
|
|
4017
|
-
children: /* @__PURE__ */ X(
|
|
3991
|
+
children: /* @__PURE__ */ X(Uu, {})
|
|
4018
3992
|
}), /* @__PURE__ */ X("div", {
|
|
4019
3993
|
className: "flex-1 overflow-y-auto px-8",
|
|
4020
3994
|
children: t({
|
|
@@ -4026,14 +4000,14 @@ var Ku = () => {}, qu = ({ steps: e, children: t, isOpen: n, onClose: r = Ku, ti
|
|
|
4026
4000
|
})
|
|
4027
4001
|
});
|
|
4028
4002
|
};
|
|
4029
|
-
|
|
4003
|
+
Ku.displayName = "F0Wizard", L(Ku);
|
|
4030
4004
|
//#endregion
|
|
4031
4005
|
//#region src/blocks/F0WizardForm/F0WizardForm.tsx
|
|
4032
|
-
function
|
|
4006
|
+
function qu(e) {
|
|
4033
4007
|
let t = ti(e).shape, n = Object.entries(t);
|
|
4034
4008
|
return n.length !== 0 && n.every(([, e]) => or(e)?.disabled === !0);
|
|
4035
4009
|
}
|
|
4036
|
-
function
|
|
4010
|
+
function Ju(e, t) {
|
|
4037
4011
|
if (t) return Object.keys(t);
|
|
4038
4012
|
let n = ti(e).shape, r = /* @__PURE__ */ new Set();
|
|
4039
4013
|
for (let e of Object.values(n)) {
|
|
@@ -4042,7 +4016,7 @@ function Yu(e, t) {
|
|
|
4042
4016
|
}
|
|
4043
4017
|
return Array.from(r);
|
|
4044
4018
|
}
|
|
4045
|
-
function
|
|
4019
|
+
function Yu(e, t) {
|
|
4046
4020
|
let n = e.shape, r = {};
|
|
4047
4021
|
for (let [e, i] of Object.entries(n)) {
|
|
4048
4022
|
let n = or(i);
|
|
@@ -4050,7 +4024,7 @@ function Xu(e, t) {
|
|
|
4050
4024
|
}
|
|
4051
4025
|
return _r(r);
|
|
4052
4026
|
}
|
|
4053
|
-
function
|
|
4027
|
+
function Xu(e, t, n) {
|
|
4054
4028
|
let r = t ?? {};
|
|
4055
4029
|
if (n) return n({ data: r });
|
|
4056
4030
|
let i = ti(e).shape;
|
|
@@ -4060,8 +4034,8 @@ function Zu(e, t, n) {
|
|
|
4060
4034
|
return n != null && n !== "";
|
|
4061
4035
|
});
|
|
4062
4036
|
}
|
|
4063
|
-
var
|
|
4064
|
-
function
|
|
4037
|
+
var Zu = 3e3;
|
|
4038
|
+
function Qu() {
|
|
4065
4039
|
let { forms: e } = R(), [t, n] = J("idle"), [r, i] = J(), a = q(null);
|
|
4066
4040
|
G(() => () => {
|
|
4067
4041
|
a.current && clearTimeout(a.current);
|
|
@@ -4069,7 +4043,7 @@ function $u() {
|
|
|
4069
4043
|
let o = W((e) => {
|
|
4070
4044
|
a.current &&= (clearTimeout(a.current), null), i(e), n("success"), a.current = setTimeout(() => {
|
|
4071
4045
|
n("idle"), i(void 0), a.current = null;
|
|
4072
|
-
},
|
|
4046
|
+
}, Zu);
|
|
4073
4047
|
}, []), s = t === "success" ? r ?? e.actionBar.saved : void 0;
|
|
4074
4048
|
return {
|
|
4075
4049
|
showSuccess: o,
|
|
@@ -4081,7 +4055,7 @@ function $u() {
|
|
|
4081
4055
|
}), [t, s])
|
|
4082
4056
|
};
|
|
4083
4057
|
}
|
|
4084
|
-
function
|
|
4058
|
+
function $u({ sectionIds: e, sections: t, customSteps: n, isStepAllDisabled: r, onNextForStep: i, hasErrorsForStep: a, isStepDataFilled: o }) {
|
|
4085
4059
|
return (n ?? e.map((e) => ({
|
|
4086
4060
|
title: t?.[e]?.title ?? e,
|
|
4087
4061
|
sectionIds: [e]
|
|
@@ -4097,12 +4071,12 @@ function ed({ sectionIds: e, sections: t, customSteps: n, isStepAllDisabled: r,
|
|
|
4097
4071
|
};
|
|
4098
4072
|
});
|
|
4099
4073
|
}
|
|
4100
|
-
function
|
|
4074
|
+
function ed(e, t, n) {
|
|
4101
4075
|
if (n) return n[e]?.sectionIds ?? [];
|
|
4102
4076
|
let r = t[e];
|
|
4103
4077
|
return r ? [r] : [];
|
|
4104
4078
|
}
|
|
4105
|
-
function
|
|
4079
|
+
function td({ formDefinition: e, steps: t, isOpen: n, onClose: r, title: i, width: a, size: o, defaultStepIndex: s, nextLabel: c, previousLabel: l, onStepChanged: u, allowStepSkipping: d, autoCloseOnLastStepSubmit: f, linkAfterLastStepSubmit: p, autoSkipCompletedSteps: m = !1, renderCustomField: h }) {
|
|
4106
4080
|
let { name: g, schema: _, sections: v, defaultValues: y, onSubmit: b, submitConfig: x, errorTriggerMode: S = "on-blur" } = e, C = x?.label, w = K(() => Object.keys(_), [_]), T = t ?? e.steps, E = K(() => {
|
|
4107
4081
|
if (T) return T.some((e) => e.sectionIds.length > 1) ? (process.env.NODE_ENV !== "production" && console.error("[F0WizardForm] Per-section schema mode does not support grouping multiple sections into a single step. Each section requires its own independent form and submit. Steps with multiple sectionIds will be automatically split into separate steps."), T.flatMap((e) => e.sectionIds.map((t) => ({
|
|
4108
4082
|
title: v?.[t]?.title ?? e.title,
|
|
@@ -4114,9 +4088,9 @@ function nd({ formDefinition: e, steps: t, isOpen: n, onClose: r, title: i, widt
|
|
|
4114
4088
|
M.current = A;
|
|
4115
4089
|
let N = W((e) => e.every((e) => {
|
|
4116
4090
|
let t = _[e];
|
|
4117
|
-
return t ?
|
|
4091
|
+
return t ? qu(t) : !1;
|
|
4118
4092
|
}), [_]), P = W((e) => async () => {
|
|
4119
|
-
let t =
|
|
4093
|
+
let t = ed(e, w, E);
|
|
4120
4094
|
for (let e of t) {
|
|
4121
4095
|
let t = k[e];
|
|
4122
4096
|
t && await t.submit();
|
|
@@ -4125,43 +4099,43 @@ function nd({ formDefinition: e, steps: t, isOpen: n, onClose: r, title: i, widt
|
|
|
4125
4099
|
w,
|
|
4126
4100
|
E,
|
|
4127
4101
|
k
|
|
4128
|
-
]), F = W((e) =>
|
|
4102
|
+
]), F = W((e) => ed(e, w, E).some((e) => M.current[e] === !0), [w, E]), I = K(() => E ?? w.map((e) => ({
|
|
4129
4103
|
title: v?.[e]?.title ?? e,
|
|
4130
4104
|
sectionIds: [e]
|
|
4131
4105
|
})), [
|
|
4132
4106
|
E,
|
|
4133
4107
|
w,
|
|
4134
4108
|
v
|
|
4135
|
-
]),
|
|
4109
|
+
]), ee = W((e) => {
|
|
4136
4110
|
if (!m) return !1;
|
|
4137
|
-
let t =
|
|
4111
|
+
let t = I[e];
|
|
4138
4112
|
return t ? t.sectionIds.every((e) => {
|
|
4139
4113
|
let n = _[e];
|
|
4140
|
-
return n ?
|
|
4114
|
+
return n ? Xu(n, y?.[e] ?? D.current[e], t.isCompleted) : !1;
|
|
4141
4115
|
}) : !1;
|
|
4142
4116
|
}, [
|
|
4143
4117
|
m,
|
|
4144
|
-
|
|
4118
|
+
I,
|
|
4145
4119
|
_,
|
|
4146
4120
|
y
|
|
4147
|
-
]),
|
|
4121
|
+
]), te = K(() => {
|
|
4148
4122
|
if (s !== void 0) return s;
|
|
4149
4123
|
if (!m) return;
|
|
4150
|
-
let e =
|
|
4151
|
-
return e === -1 ?
|
|
4124
|
+
let e = I.findIndex((e, t) => !ee(t));
|
|
4125
|
+
return e === -1 ? I.length - 1 : e;
|
|
4152
4126
|
}, [
|
|
4153
4127
|
s,
|
|
4154
4128
|
m,
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
]),
|
|
4129
|
+
I,
|
|
4130
|
+
ee
|
|
4131
|
+
]), ne = K(() => $u({
|
|
4158
4132
|
sectionIds: w,
|
|
4159
4133
|
sections: v,
|
|
4160
4134
|
customSteps: E,
|
|
4161
4135
|
isStepAllDisabled: N,
|
|
4162
4136
|
onNextForStep: P,
|
|
4163
4137
|
hasErrorsForStep: F,
|
|
4164
|
-
isStepDataFilled: m ?
|
|
4138
|
+
isStepDataFilled: m ? ee : void 0
|
|
4165
4139
|
}), [
|
|
4166
4140
|
w,
|
|
4167
4141
|
v,
|
|
@@ -4171,8 +4145,8 @@ function nd({ formDefinition: e, steps: t, isOpen: n, onClose: r, title: i, widt
|
|
|
4171
4145
|
F,
|
|
4172
4146
|
A,
|
|
4173
4147
|
m,
|
|
4174
|
-
|
|
4175
|
-
]), re = q(null), { showSuccess: ie, ActionBar: ae } =
|
|
4148
|
+
ee
|
|
4149
|
+
]), re = q(null), { showSuccess: ie, ActionBar: ae } = Qu(), oe = W((e) => async (t) => {
|
|
4176
4150
|
D.current[e] = t;
|
|
4177
4151
|
let n = await b({
|
|
4178
4152
|
sectionId: e,
|
|
@@ -4192,7 +4166,7 @@ function nd({ formDefinition: e, steps: t, isOpen: n, onClose: r, title: i, widt
|
|
|
4192
4166
|
p,
|
|
4193
4167
|
r
|
|
4194
4168
|
]), ce = W(() => {
|
|
4195
|
-
let e =
|
|
4169
|
+
let e = ed(O.current, w, E);
|
|
4196
4170
|
for (let t of e) {
|
|
4197
4171
|
let e = k[t];
|
|
4198
4172
|
e && (D.current[t] = e.getValues());
|
|
@@ -4204,13 +4178,13 @@ function nd({ formDefinition: e, steps: t, isOpen: n, onClose: r, title: i, widt
|
|
|
4204
4178
|
]), le = W((e) => {
|
|
4205
4179
|
ce(), O.current = e, u?.(e);
|
|
4206
4180
|
}, [ce, u]);
|
|
4207
|
-
return /* @__PURE__ */ X(
|
|
4208
|
-
steps:
|
|
4181
|
+
return /* @__PURE__ */ X(Ku, {
|
|
4182
|
+
steps: ne,
|
|
4209
4183
|
isOpen: n,
|
|
4210
4184
|
onClose: r,
|
|
4211
4185
|
title: i,
|
|
4212
4186
|
size: o ?? a,
|
|
4213
|
-
defaultStepIndex:
|
|
4187
|
+
defaultStepIndex: te,
|
|
4214
4188
|
nextLabel: c,
|
|
4215
4189
|
previousLabel: l,
|
|
4216
4190
|
submitLabel: C,
|
|
@@ -4218,14 +4192,14 @@ function nd({ formDefinition: e, steps: t, isOpen: n, onClose: r, title: i, widt
|
|
|
4218
4192
|
onStepChanged: le,
|
|
4219
4193
|
allowStepSkipping: d,
|
|
4220
4194
|
children: ({ currentStep: t }) => {
|
|
4221
|
-
let n =
|
|
4195
|
+
let n = ed(t, w, E);
|
|
4222
4196
|
return /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X("div", {
|
|
4223
4197
|
className: "flex flex-col gap-6 pb-5",
|
|
4224
4198
|
children: n.map((t) => {
|
|
4225
4199
|
let n = _[t];
|
|
4226
4200
|
if (!n) return null;
|
|
4227
4201
|
let r = v?.[t], i = D.current[t], a = y?.[t];
|
|
4228
|
-
return /* @__PURE__ */ X(
|
|
4202
|
+
return /* @__PURE__ */ X(nd, {
|
|
4229
4203
|
sectionId: t,
|
|
4230
4204
|
formName: g,
|
|
4231
4205
|
schema: n,
|
|
@@ -4249,7 +4223,7 @@ function nd({ formDefinition: e, steps: t, isOpen: n, onClose: r, title: i, widt
|
|
|
4249
4223
|
}
|
|
4250
4224
|
});
|
|
4251
4225
|
}
|
|
4252
|
-
function
|
|
4226
|
+
function nd({ sectionId: e, formName: t, schema: n, sectionConfig: r, defaultValues: i, onSubmit: a, submitConfig: o, errorTriggerMode: s, sectionForms: c, onErrorStateChange: l, renderCustomField: u, isLoading: d }) {
|
|
4253
4227
|
let f = an();
|
|
4254
4228
|
G(() => (c[e] = f, () => {
|
|
4255
4229
|
c[e] = null;
|
|
@@ -4278,8 +4252,8 @@ function rd({ sectionId: e, formName: t, schema: n, sectionConfig: r, defaultVal
|
|
|
4278
4252
|
isLoading: d
|
|
4279
4253
|
});
|
|
4280
4254
|
}
|
|
4281
|
-
function
|
|
4282
|
-
let { name: g, schema: _, sections: v, defaultValues: y, onSubmit: b, submitConfig: x, errorTriggerMode: S = "on-blur" } = e, C = x?.label, w = K(() => ti(_), [_]), T = K(() =>
|
|
4255
|
+
function rd({ formDefinition: e, steps: t, isOpen: n, onClose: r, title: i, width: a, size: o, defaultStepIndex: s, nextLabel: c, previousLabel: l, onStepChanged: u, allowStepSkipping: d, autoCloseOnLastStepSubmit: f, linkAfterLastStepSubmit: p, autoSkipCompletedSteps: m = !1, renderCustomField: h }) {
|
|
4256
|
+
let { name: g, schema: _, sections: v, defaultValues: y, onSubmit: b, submitConfig: x, errorTriggerMode: S = "on-blur" } = e, C = x?.label, w = K(() => ti(_), [_]), T = K(() => Ju(_, v), [_, v]), E = W((e) => qu(Yu(w, e)), [w]), D = an(), O = q(y ? { ...y } : {}), k = q(s ?? 0), A = W((e) => async () => {
|
|
4283
4257
|
await D.submit();
|
|
4284
4258
|
}, [D]), j = W((e) => D.hasErrors, [D.hasErrors]), M = t ?? e.steps, N = K(() => M ?? T.map((e) => ({
|
|
4285
4259
|
title: v?.[e]?.title ?? e,
|
|
@@ -4291,7 +4265,7 @@ function id({ formDefinition: e, steps: t, isOpen: n, onClose: r, title: i, widt
|
|
|
4291
4265
|
]), P = W((e) => {
|
|
4292
4266
|
if (!m) return !1;
|
|
4293
4267
|
let t = N[e];
|
|
4294
|
-
return t ?
|
|
4268
|
+
return t ? Xu(Yu(w, t.sectionIds), y, t.isCompleted) : !1;
|
|
4295
4269
|
}, [
|
|
4296
4270
|
m,
|
|
4297
4271
|
N,
|
|
@@ -4307,7 +4281,7 @@ function id({ formDefinition: e, steps: t, isOpen: n, onClose: r, title: i, widt
|
|
|
4307
4281
|
m,
|
|
4308
4282
|
N,
|
|
4309
4283
|
P
|
|
4310
|
-
]),
|
|
4284
|
+
]), I = K(() => $u({
|
|
4311
4285
|
sectionIds: T,
|
|
4312
4286
|
sections: v,
|
|
4313
4287
|
customSteps: M,
|
|
@@ -4324,17 +4298,17 @@ function id({ formDefinition: e, steps: t, isOpen: n, onClose: r, title: i, widt
|
|
|
4324
4298
|
j,
|
|
4325
4299
|
m,
|
|
4326
4300
|
P
|
|
4327
|
-
]),
|
|
4301
|
+
]), ee = q(null), te = q(null), { showSuccess: ne, ActionBar: re } = Qu(), ie = W(async (e) => {
|
|
4328
4302
|
Object.assign(O.current, e);
|
|
4329
4303
|
let t = { ...O.current };
|
|
4330
|
-
|
|
4304
|
+
te.current = t;
|
|
4331
4305
|
let n = await b({ data: t });
|
|
4332
|
-
return
|
|
4306
|
+
return ee.current = n, n;
|
|
4333
4307
|
}, [b]), ae = W(() => {
|
|
4334
|
-
let e =
|
|
4308
|
+
let e = ee.current;
|
|
4335
4309
|
if (e?.success) {
|
|
4336
|
-
if (
|
|
4337
|
-
let e = p({ fullData:
|
|
4310
|
+
if (ne(e.message), p) {
|
|
4311
|
+
let e = p({ fullData: te.current });
|
|
4338
4312
|
window.location.href = e;
|
|
4339
4313
|
} else f && r?.();
|
|
4340
4314
|
}
|
|
@@ -4342,13 +4316,13 @@ function id({ formDefinition: e, steps: t, isOpen: n, onClose: r, title: i, widt
|
|
|
4342
4316
|
f,
|
|
4343
4317
|
p,
|
|
4344
4318
|
r,
|
|
4345
|
-
|
|
4319
|
+
ne
|
|
4346
4320
|
]), oe = W((e) => {
|
|
4347
4321
|
let t = D.getValues();
|
|
4348
4322
|
Object.assign(O.current, t), k.current = e, u?.(e);
|
|
4349
4323
|
}, [D, u]);
|
|
4350
|
-
return /* @__PURE__ */ X(
|
|
4351
|
-
steps:
|
|
4324
|
+
return /* @__PURE__ */ X(Ku, {
|
|
4325
|
+
steps: I,
|
|
4352
4326
|
isOpen: n,
|
|
4353
4327
|
onClose: r,
|
|
4354
4328
|
title: i,
|
|
@@ -4361,7 +4335,7 @@ function id({ formDefinition: e, steps: t, isOpen: n, onClose: r, title: i, widt
|
|
|
4361
4335
|
onStepChanged: oe,
|
|
4362
4336
|
allowStepSkipping: d,
|
|
4363
4337
|
children: ({ currentStep: t }) => {
|
|
4364
|
-
let n =
|
|
4338
|
+
let n = ed(t, T, M), r = Yu(w, n), i = n.reduce((e, t) => (v?.[t] && (e[t] = v[t]), e), {});
|
|
4365
4339
|
return /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X("div", {
|
|
4366
4340
|
className: "pb-5",
|
|
4367
4341
|
children: /* @__PURE__ */ X(le, {
|
|
@@ -4383,12 +4357,12 @@ function id({ formDefinition: e, steps: t, isOpen: n, onClose: r, title: i, widt
|
|
|
4383
4357
|
}
|
|
4384
4358
|
});
|
|
4385
4359
|
}
|
|
4386
|
-
function
|
|
4387
|
-
return e.formDefinition._brand === "per-section" ? /* @__PURE__ */ X(
|
|
4360
|
+
function id(e) {
|
|
4361
|
+
return e.formDefinition._brand === "per-section" ? /* @__PURE__ */ X(td, { ...e }) : /* @__PURE__ */ X(rd, { ...e });
|
|
4388
4362
|
}
|
|
4389
|
-
|
|
4390
|
-
var
|
|
4391
|
-
function
|
|
4363
|
+
id.displayName = "F0WizardForm";
|
|
4364
|
+
var ad = L(id), od = id;
|
|
4365
|
+
function sd(e, t) {
|
|
4392
4366
|
if (e._brand === "per-section") {
|
|
4393
4367
|
let n = e;
|
|
4394
4368
|
return {
|
|
@@ -4408,8 +4382,8 @@ function cd(e, t) {
|
|
|
4408
4382
|
}
|
|
4409
4383
|
};
|
|
4410
4384
|
}
|
|
4411
|
-
function
|
|
4412
|
-
let { formDefinition: r, onStepChanged: i, ...a } = e, o = q(!1), s = q(void 0), c = K(() =>
|
|
4385
|
+
function cd({ options: e, isOpen: t, onResolve: n }) {
|
|
4386
|
+
let { formDefinition: r, onStepChanged: i, ...a } = e, o = q(!1), s = q(void 0), c = K(() => sd(r, (e) => {
|
|
4413
4387
|
o.current = !0, s.current = e;
|
|
4414
4388
|
}), [r]), l = (e) => {
|
|
4415
4389
|
o.current = !1, i?.(e);
|
|
@@ -4426,9 +4400,9 @@ function ld({ options: e, isOpen: t, onResolve: n }) {
|
|
|
4426
4400
|
onStepChanged: l,
|
|
4427
4401
|
autoCloseOnLastStepSubmit: !0
|
|
4428
4402
|
};
|
|
4429
|
-
return /* @__PURE__ */ X(
|
|
4403
|
+
return /* @__PURE__ */ X(od, { ...d });
|
|
4430
4404
|
}
|
|
4431
|
-
function
|
|
4405
|
+
function ld(e) {
|
|
4432
4406
|
return new Promise((t) => {
|
|
4433
4407
|
let n = e.id ?? De(), r = !1, i = (e) => {
|
|
4434
4408
|
r || (r = !0, t(e), O(n));
|
|
@@ -4436,7 +4410,7 @@ function ud(e) {
|
|
|
4436
4410
|
Ae({
|
|
4437
4411
|
id: n,
|
|
4438
4412
|
onDismiss: () => i({ completed: !1 }),
|
|
4439
|
-
render: ({ isOpen: t }) => /* @__PURE__ */ X(
|
|
4413
|
+
render: ({ isOpen: t }) => /* @__PURE__ */ X(cd, {
|
|
4440
4414
|
options: e,
|
|
4441
4415
|
isOpen: t,
|
|
4442
4416
|
onResolve: i
|
|
@@ -4446,23 +4420,23 @@ function ud(e) {
|
|
|
4446
4420
|
}
|
|
4447
4421
|
//#endregion
|
|
4448
4422
|
//#region src/facade/forms/forms.ts
|
|
4449
|
-
function
|
|
4423
|
+
function ud(e) {
|
|
4450
4424
|
let { mode: t, ...n } = e;
|
|
4451
|
-
return t === "wizard" ?
|
|
4425
|
+
return t === "wizard" ? ld(n) : l(n);
|
|
4452
4426
|
}
|
|
4453
|
-
var
|
|
4427
|
+
var dd = { open: ud }, fd = [
|
|
4454
4428
|
"escape",
|
|
4455
4429
|
"commit",
|
|
4456
4430
|
"popupClose"
|
|
4457
|
-
],
|
|
4431
|
+
], pd = [
|
|
4458
4432
|
"always",
|
|
4459
4433
|
"onHover",
|
|
4460
4434
|
"never"
|
|
4461
|
-
],
|
|
4435
|
+
], md = ({ minLabel: e, maxLabel: t }) => !e && !t ? null : /* @__PURE__ */ Z("div", {
|
|
4462
4436
|
"data-testid": "slider-range-labels",
|
|
4463
4437
|
className: "flex justify-between text-sm text-f1-foreground-secondary",
|
|
4464
4438
|
children: [/* @__PURE__ */ X("span", { children: e }), /* @__PURE__ */ X("span", { children: t })]
|
|
4465
|
-
}),
|
|
4439
|
+
}), hd = ({ visible: e, content: t, style: n }) => {
|
|
4466
4440
|
let r = Xn() ? 0 : .15;
|
|
4467
4441
|
return /* @__PURE__ */ X(Wn, { children: e ? /* @__PURE__ */ X(qn.div, {
|
|
4468
4442
|
initial: {
|
|
@@ -4486,7 +4460,7 @@ var fd = { open: dd }, pd = [
|
|
|
4486
4460
|
role: "tooltip",
|
|
4487
4461
|
children: t
|
|
4488
4462
|
}) : null });
|
|
4489
|
-
},
|
|
4463
|
+
}, gd = ({ hideLabel: e = !1 }) => /* @__PURE__ */ Z("div", {
|
|
4490
4464
|
className: "flex w-full flex-col gap-2",
|
|
4491
4465
|
role: "status",
|
|
4492
4466
|
"aria-label": "Loading slider",
|
|
@@ -4496,7 +4470,7 @@ var fd = { open: dd }, pd = [
|
|
|
4496
4470
|
className: "flex items-center py-2",
|
|
4497
4471
|
children: /* @__PURE__ */ X(z, { className: "h-1.5 w-full rounded-full" })
|
|
4498
4472
|
})]
|
|
4499
|
-
}),
|
|
4473
|
+
}), _d = $a({
|
|
4500
4474
|
base: "relative h-1.5 grow overflow-hidden rounded-full bg-f1-background-tertiary",
|
|
4501
4475
|
variants: { status: {
|
|
4502
4476
|
default: "",
|
|
@@ -4504,7 +4478,7 @@ var fd = { open: dd }, pd = [
|
|
|
4504
4478
|
info: "",
|
|
4505
4479
|
error: ""
|
|
4506
4480
|
} }
|
|
4507
|
-
}),
|
|
4481
|
+
}), vd = $a({
|
|
4508
4482
|
base: "absolute h-full",
|
|
4509
4483
|
variants: {
|
|
4510
4484
|
status: {
|
|
@@ -4518,7 +4492,7 @@ var fd = { open: dd }, pd = [
|
|
|
4518
4492
|
false: ""
|
|
4519
4493
|
}
|
|
4520
4494
|
}
|
|
4521
|
-
}),
|
|
4495
|
+
}), yd = 20, bd = $a({
|
|
4522
4496
|
base: B("relative block rounded-full bg-f1-background border-[2px] border-solid", "transition-[transform,border-color] hover:scale-110", "motion-reduce:transition-none motion-reduce:hover:scale-100", "data-[disabled]:cursor-not-allowed data-[disabled]:hover:scale-100"),
|
|
4523
4497
|
variants: {
|
|
4524
4498
|
status: {
|
|
@@ -4532,7 +4506,7 @@ var fd = { open: dd }, pd = [
|
|
|
4532
4506
|
false: ""
|
|
4533
4507
|
}
|
|
4534
4508
|
}
|
|
4535
|
-
}),
|
|
4509
|
+
}), xd = yc((e, t) => {
|
|
4536
4510
|
let { label: n, ariaLabel: r, hideLabel: i = !1, hint: a, status: o, required: s, disabled: c, name: l, value: u, defaultValue: d, onChange: f, onValueCommit: p, min: m, max: h, step: g = 1, minLabel: _, maxLabel: v, formatValue: y = (e) => String(e), showTooltip: b = "onHover", ...x } = e, S = Cc(), C = Cc(), w = Cc(), T = r && r.trim().length > 0 ? r : n.trim().length > 0 ? n : void 0;
|
|
4537
4511
|
G(() => {
|
|
4538
4512
|
process.env.NODE_ENV !== "production" && !T && console.warn("F0Slider: provide a non-empty `label` or `ariaLabel` for accessibility.");
|
|
@@ -4541,13 +4515,13 @@ var fd = { open: dd }, pd = [
|
|
|
4541
4515
|
prop: u,
|
|
4542
4516
|
defaultProp: d ?? m,
|
|
4543
4517
|
onChange: f
|
|
4544
|
-
}), O = E ?? m, k = h === m ? 0 : (Math.min(h, Math.max(m, O)) - m) / (h - m) * 100, A =
|
|
4518
|
+
}), O = E ?? m, k = h === m ? 0 : (Math.min(h, Math.max(m, O)) - m) / (h - m) * 100, A = yd * (.5 - k / 100), j = W((e) => {
|
|
4545
4519
|
let [t] = e;
|
|
4546
4520
|
t !== void 0 && D(t);
|
|
4547
4521
|
}, [D]), M = W((e) => {
|
|
4548
4522
|
let [t] = e;
|
|
4549
4523
|
t !== void 0 && p?.(t);
|
|
4550
|
-
}, [p]), [N, P] = J(!1), [F,
|
|
4524
|
+
}, [p]), [N, P] = J(!1), [F, I] = J(!1), [ee, te] = J(!1), ne = q(!1), re = b === "always" || b === "onHover" && (N || F || ee), ie = o?.type ?? "default", ae = !i && n.trim().length > 0, oe = o ?? (a ? {
|
|
4551
4525
|
type: "default",
|
|
4552
4526
|
message: a
|
|
4553
4527
|
} : void 0), se = a || o?.message ? w : void 0;
|
|
@@ -4556,10 +4530,10 @@ var fd = { open: dd }, pd = [
|
|
|
4556
4530
|
...x,
|
|
4557
4531
|
className: B("flex flex-col gap-2", c && "cursor-not-allowed"),
|
|
4558
4532
|
onPointerDownCapture: () => {
|
|
4559
|
-
|
|
4533
|
+
ne.current = !0;
|
|
4560
4534
|
},
|
|
4561
4535
|
onPointerUp: () => {
|
|
4562
|
-
|
|
4536
|
+
ne.current = !1;
|
|
4563
4537
|
},
|
|
4564
4538
|
children: [
|
|
4565
4539
|
ae ? /* @__PURE__ */ X(Go, {
|
|
@@ -4573,8 +4547,8 @@ var fd = { open: dd }, pd = [
|
|
|
4573
4547
|
value: [O],
|
|
4574
4548
|
onValueChange: j,
|
|
4575
4549
|
onValueCommit: M,
|
|
4576
|
-
onPointerDown: () =>
|
|
4577
|
-
onPointerUp: () =>
|
|
4550
|
+
onPointerDown: () => te(!0),
|
|
4551
|
+
onPointerUp: () => te(!1),
|
|
4578
4552
|
min: m,
|
|
4579
4553
|
max: h,
|
|
4580
4554
|
step: g,
|
|
@@ -4585,8 +4559,8 @@ var fd = { open: dd }, pd = [
|
|
|
4585
4559
|
onMouseLeave: () => P(!1),
|
|
4586
4560
|
children: [
|
|
4587
4561
|
/* @__PURE__ */ X(Ar, {
|
|
4588
|
-
className:
|
|
4589
|
-
children: /* @__PURE__ */ X(ei, { className:
|
|
4562
|
+
className: _d({ status: ie }),
|
|
4563
|
+
children: /* @__PURE__ */ X(ei, { className: vd({
|
|
4590
4564
|
status: ie,
|
|
4591
4565
|
disabled: c
|
|
4592
4566
|
}) })
|
|
@@ -4599,24 +4573,24 @@ var fd = { open: dd }, pd = [
|
|
|
4599
4573
|
"aria-describedby": se,
|
|
4600
4574
|
"aria-required": s,
|
|
4601
4575
|
style: {
|
|
4602
|
-
width:
|
|
4603
|
-
height:
|
|
4576
|
+
width: yd,
|
|
4577
|
+
height: yd
|
|
4604
4578
|
},
|
|
4605
|
-
className: B(
|
|
4579
|
+
className: B(bd({
|
|
4606
4580
|
status: ie,
|
|
4607
4581
|
disabled: c
|
|
4608
4582
|
}), En("focus-visible:ring-offset-1")),
|
|
4609
|
-
onFocus: () =>
|
|
4610
|
-
onBlur: () =>
|
|
4583
|
+
onFocus: () => I(!ne.current),
|
|
4584
|
+
onBlur: () => I(!1)
|
|
4611
4585
|
}),
|
|
4612
|
-
b === "never" ? null : /* @__PURE__ */ X(
|
|
4586
|
+
b === "never" ? null : /* @__PURE__ */ X(hd, {
|
|
4613
4587
|
visible: re,
|
|
4614
4588
|
content: y(O),
|
|
4615
4589
|
style: { left: `calc(${k}% + ${A}px)` }
|
|
4616
4590
|
})
|
|
4617
4591
|
]
|
|
4618
4592
|
}),
|
|
4619
|
-
/* @__PURE__ */ X(
|
|
4593
|
+
/* @__PURE__ */ X(md, {
|
|
4620
4594
|
minLabel: _,
|
|
4621
4595
|
maxLabel: v
|
|
4622
4596
|
}),
|
|
@@ -4629,25 +4603,25 @@ var fd = { open: dd }, pd = [
|
|
|
4629
4603
|
]
|
|
4630
4604
|
});
|
|
4631
4605
|
});
|
|
4632
|
-
|
|
4633
|
-
var
|
|
4606
|
+
xd.displayName = "F0Slider";
|
|
4607
|
+
var Sd = gn("F0Slider", Si(L(xd), gd)), Cd = [
|
|
4634
4608
|
"completed",
|
|
4635
4609
|
"in-progress",
|
|
4636
4610
|
"not-started",
|
|
4637
4611
|
"rejected",
|
|
4638
4612
|
"changes-requested",
|
|
4639
4613
|
"skipped"
|
|
4640
|
-
],
|
|
4614
|
+
], wd = [
|
|
4641
4615
|
"approved",
|
|
4642
4616
|
"waiting",
|
|
4643
4617
|
"rejected"
|
|
4644
|
-
],
|
|
4618
|
+
], Td = [
|
|
4645
4619
|
"neutral",
|
|
4646
4620
|
"info",
|
|
4647
4621
|
"positive",
|
|
4648
4622
|
"warning",
|
|
4649
4623
|
"critical"
|
|
4650
|
-
],
|
|
4624
|
+
], Ed = [
|
|
4651
4625
|
"viridian",
|
|
4652
4626
|
"malibu",
|
|
4653
4627
|
"yellow",
|
|
@@ -4663,7 +4637,7 @@ var Cd = gn("F0Slider", Si(L(Sd), _d)), wd = [
|
|
|
4663
4637
|
"grey",
|
|
4664
4638
|
"orange",
|
|
4665
4639
|
"radical"
|
|
4666
|
-
],
|
|
4640
|
+
], Dd = 16, Od = $a({
|
|
4667
4641
|
base: "h-0.5 rounded-full bg-f1-foreground cursor-pointer",
|
|
4668
4642
|
variants: {
|
|
4669
4643
|
depth: {
|
|
@@ -4696,15 +4670,15 @@ var Cd = gn("F0Slider", Si(L(Sd), _d)), wd = [
|
|
|
4696
4670
|
active: !0
|
|
4697
4671
|
}
|
|
4698
4672
|
});
|
|
4699
|
-
function
|
|
4673
|
+
function kd(e, t = 0) {
|
|
4700
4674
|
return e.flatMap((e) => [{
|
|
4701
4675
|
id: e.id,
|
|
4702
4676
|
depth: Math.min(t, 3)
|
|
4703
|
-
}, ...e.children ?
|
|
4677
|
+
}, ...e.children ? kd(e.children, t + 1) : []]);
|
|
4704
4678
|
}
|
|
4705
|
-
function
|
|
4679
|
+
function Ad(e, t) {
|
|
4706
4680
|
let n = e.length;
|
|
4707
|
-
if (n <=
|
|
4681
|
+
if (n <= Dd) return e;
|
|
4708
4682
|
let r = n / 15, i = new Set(Array.from({ length: 15 }, (e, t) => Math.min(Math.floor(t * r), n - 1)));
|
|
4709
4683
|
if (i.add(n - 1), t) {
|
|
4710
4684
|
let n = e.findIndex((e) => e.id === t);
|
|
@@ -4715,11 +4689,11 @@ function jd(e, t) {
|
|
|
4715
4689
|
}
|
|
4716
4690
|
return [...i].sort((e, t) => e - t).map((t) => e[t]);
|
|
4717
4691
|
}
|
|
4718
|
-
function
|
|
4719
|
-
let a = K(() =>
|
|
4692
|
+
function jd({ items: e, activeItem: t, className: n, align: r = "left", variant: i = "dark" }) {
|
|
4693
|
+
let a = K(() => Ad(kd(e), t), [e, t]);
|
|
4720
4694
|
return /* @__PURE__ */ X("div", {
|
|
4721
4695
|
className: B("flex flex-col justify-center gap-2 py-3", r === "right" ? "items-end" : "items-start", n),
|
|
4722
|
-
children: a.map((e) => /* @__PURE__ */ X("div", { className:
|
|
4696
|
+
children: a.map((e) => /* @__PURE__ */ X("div", { className: Od({
|
|
4723
4697
|
depth: e.depth,
|
|
4724
4698
|
variant: i,
|
|
4725
4699
|
active: e.id === t
|
|
@@ -4728,20 +4702,20 @@ function Md({ items: e, activeItem: t, className: n, align: r = "left", variant:
|
|
|
4728
4702
|
}
|
|
4729
4703
|
//#endregion
|
|
4730
4704
|
//#region src/blocks/F0TableOfContentPopover/useDeferredClose.ts
|
|
4731
|
-
var
|
|
4732
|
-
function
|
|
4705
|
+
var Md = "[role='menu']";
|
|
4706
|
+
function Nd(e, t) {
|
|
4733
4707
|
let n = q(null), r = W(() => {
|
|
4734
4708
|
n.current?.(), n.current = null;
|
|
4735
4709
|
}, []);
|
|
4736
4710
|
return G(() => r, [r]), { deferClose: W(() => {
|
|
4737
|
-
if (!document.querySelector(
|
|
4711
|
+
if (!document.querySelector(Md)) return !1;
|
|
4738
4712
|
r();
|
|
4739
4713
|
let i = () => {
|
|
4740
4714
|
o.disconnect(), document.removeEventListener("pointermove", s), n.current = null;
|
|
4741
4715
|
}, a = () => {
|
|
4742
4716
|
i(), t();
|
|
4743
4717
|
}, o = new MutationObserver(() => {
|
|
4744
|
-
document.querySelector(
|
|
4718
|
+
document.querySelector(Md) || a();
|
|
4745
4719
|
});
|
|
4746
4720
|
o.observe(document.body, {
|
|
4747
4721
|
childList: !0,
|
|
@@ -4749,7 +4723,7 @@ function Pd(e, t) {
|
|
|
4749
4723
|
});
|
|
4750
4724
|
let s = (t) => {
|
|
4751
4725
|
let n = t.target;
|
|
4752
|
-
!n.closest(
|
|
4726
|
+
!n.closest(Md) && !e.current?.contains(n) && a();
|
|
4753
4727
|
};
|
|
4754
4728
|
return document.addEventListener("pointermove", s), n.current = i, !0;
|
|
4755
4729
|
}, [
|
|
@@ -4760,7 +4734,7 @@ function Pd(e, t) {
|
|
|
4760
4734
|
}
|
|
4761
4735
|
//#endregion
|
|
4762
4736
|
//#region src/blocks/F0TableOfContentPopover/F0TableOfContentPopover.tsx
|
|
4763
|
-
var
|
|
4737
|
+
var Pd = 300, Fd = 0, Id = $a({
|
|
4764
4738
|
base: "w-auto overflow-y-auto rounded-lg border border-solid border-f1-border-secondary bg-f1-background p-0 shadow-lg",
|
|
4765
4739
|
variants: { size: {
|
|
4766
4740
|
sm: "max-h-[240px]",
|
|
@@ -4769,8 +4743,8 @@ var Fd = 300, Id = 0, Ld = $a({
|
|
|
4769
4743
|
} },
|
|
4770
4744
|
defaultVariants: { size: "md" }
|
|
4771
4745
|
});
|
|
4772
|
-
function
|
|
4773
|
-
let [f, p] = J(!1), m = q(!1), h = q(null), { deferClose: g } =
|
|
4746
|
+
function Ld({ title: e, items: t, className: n, activeItem: r, collapsible: i = !1, sortable: a, onReorder: o, showChildrenCounter: s = !1, barsAlign: c = "left", size: l = "md", variant: u = "light", portalContainer: d }) {
|
|
4747
|
+
let [f, p] = J(!1), m = q(!1), h = q(null), { deferClose: g } = Nd(h, () => p(!1)), _ = (e) => {
|
|
4774
4748
|
(e || !g()) && (e && !f && (m.current = !0), p(e));
|
|
4775
4749
|
}, v = W((e) => {
|
|
4776
4750
|
h.current = e, e && m.current && (m.current = !1, requestAnimationFrame(() => {
|
|
@@ -4783,14 +4757,14 @@ function Rd({ title: e, items: t, className: n, activeItem: r, collapsible: i =
|
|
|
4783
4757
|
return /* @__PURE__ */ Z(Ps, {
|
|
4784
4758
|
open: f,
|
|
4785
4759
|
onOpenChange: _,
|
|
4786
|
-
openDelay:
|
|
4787
|
-
closeDelay:
|
|
4760
|
+
openDelay: Fd,
|
|
4761
|
+
closeDelay: Pd,
|
|
4788
4762
|
children: [/* @__PURE__ */ X(is, {
|
|
4789
4763
|
asChild: !0,
|
|
4790
4764
|
children: /* @__PURE__ */ X("button", {
|
|
4791
4765
|
className: B(En(), "flex cursor-pointer items-center rounded-md px-1.5 py-1", n),
|
|
4792
4766
|
"aria-label": e ?? "Menu",
|
|
4793
|
-
children: /* @__PURE__ */ X(
|
|
4767
|
+
children: /* @__PURE__ */ X(jd, {
|
|
4794
4768
|
items: t,
|
|
4795
4769
|
activeItem: r,
|
|
4796
4770
|
align: c,
|
|
@@ -4803,7 +4777,7 @@ function Rd({ title: e, items: t, className: n, activeItem: r, collapsible: i =
|
|
|
4803
4777
|
align: "center",
|
|
4804
4778
|
sideOffset: -28,
|
|
4805
4779
|
container: d,
|
|
4806
|
-
className: B(
|
|
4780
|
+
className: B(Id({ size: l }), !e && "pt-2", "scrollbar-macos"),
|
|
4807
4781
|
children: /* @__PURE__ */ X(kt, {
|
|
4808
4782
|
title: e,
|
|
4809
4783
|
items: t,
|
|
@@ -4817,10 +4791,10 @@ function Rd({ title: e, items: t, className: n, activeItem: r, collapsible: i =
|
|
|
4817
4791
|
})]
|
|
4818
4792
|
});
|
|
4819
4793
|
}
|
|
4820
|
-
var
|
|
4794
|
+
var Rd = L(gn("F0TableOfContentPopover", Ld));
|
|
4821
4795
|
//#endregion
|
|
4822
4796
|
//#region src/domains/talent/surveys/surveys/SurveyFormBuilder/Form/utils.ts
|
|
4823
|
-
function
|
|
4797
|
+
function zd(e) {
|
|
4824
4798
|
return e.flatMap((e) => e.type === "section" ? [
|
|
4825
4799
|
{
|
|
4826
4800
|
type: "section-header",
|
|
@@ -4843,7 +4817,7 @@ function Bd(e) {
|
|
|
4843
4817
|
question: e.question
|
|
4844
4818
|
}]);
|
|
4845
4819
|
}
|
|
4846
|
-
function
|
|
4820
|
+
function Bd(e) {
|
|
4847
4821
|
let t = /* @__PURE__ */ new Map();
|
|
4848
4822
|
for (let n of e) {
|
|
4849
4823
|
if (n.type !== "section") continue;
|
|
@@ -4857,7 +4831,7 @@ function Vd(e) {
|
|
|
4857
4831
|
}
|
|
4858
4832
|
return t;
|
|
4859
4833
|
}
|
|
4860
|
-
function
|
|
4834
|
+
function Vd(e) {
|
|
4861
4835
|
let t = [], n = null, r = [], i = () => {
|
|
4862
4836
|
n && (t.push({
|
|
4863
4837
|
type: "section",
|
|
@@ -4873,7 +4847,7 @@ function Hd(e) {
|
|
|
4873
4847
|
});
|
|
4874
4848
|
return i(), t;
|
|
4875
4849
|
}
|
|
4876
|
-
function
|
|
4850
|
+
function Hd(e, t) {
|
|
4877
4851
|
let n = [], r = null, i = [];
|
|
4878
4852
|
function a() {
|
|
4879
4853
|
if (!r) return;
|
|
@@ -4901,7 +4875,7 @@ function Ud(e, t) {
|
|
|
4901
4875
|
for (let t of e) t.type === "section-header" ? (a(), r = t.section.id, n.push(t)) : r ? i.push(t) : n.push(t);
|
|
4902
4876
|
return a(), n;
|
|
4903
4877
|
}
|
|
4904
|
-
function
|
|
4878
|
+
function Ud(e) {
|
|
4905
4879
|
let t = /* @__PURE__ */ new Set();
|
|
4906
4880
|
for (let n of e) if (n.type === "section") {
|
|
4907
4881
|
let e = n.section.questions;
|
|
@@ -4911,11 +4885,11 @@ function Wd(e) {
|
|
|
4911
4885
|
}
|
|
4912
4886
|
//#endregion
|
|
4913
4887
|
//#region src/domains/talent/surveys/surveys/SurveyFormBuilder/ApplyingChangesTag/ApplyingChangesTag.tsx
|
|
4914
|
-
var
|
|
4888
|
+
var Wd = qn.create(Ti), Gd = xc(() => {
|
|
4915
4889
|
let e = R();
|
|
4916
4890
|
return /* @__PURE__ */ Z("div", {
|
|
4917
4891
|
className: "flex flex-row items-center gap-1 rounded-full border border-solid border-f1-border-secondary bg-f1-background px-2 py-1.5 pr-2.5 shadow-md",
|
|
4918
|
-
children: [/* @__PURE__ */ X(
|
|
4892
|
+
children: [/* @__PURE__ */ X(Wd, {
|
|
4919
4893
|
size: "xs",
|
|
4920
4894
|
animate: {
|
|
4921
4895
|
rotate: [0, 360],
|
|
@@ -4965,7 +4939,7 @@ var Gd = qn.create(Ti), Kd = xc(() => {
|
|
|
4965
4939
|
children: e.t("surveyFormBuilder.labels.applyingChanges")
|
|
4966
4940
|
})]
|
|
4967
4941
|
});
|
|
4968
|
-
}),
|
|
4942
|
+
}), Kd = (e) => {
|
|
4969
4943
|
switch (e) {
|
|
4970
4944
|
case "1-5": return Array.from({ length: 5 }, (e, t) => ({
|
|
4971
4945
|
value: t + 1,
|
|
@@ -5002,15 +4976,15 @@ var Gd = qn.create(Ti), Kd = xc(() => {
|
|
|
5002
4976
|
}
|
|
5003
4977
|
];
|
|
5004
4978
|
}
|
|
5005
|
-
},
|
|
4979
|
+
}, qd = (e) => {
|
|
5006
4980
|
if (!e || e.length === 0) return null;
|
|
5007
4981
|
let t = e.length, n = e.every((e) => /^\d+$/.test(e.label.trim()));
|
|
5008
4982
|
return t === 5 && n ? "1-5" : t === 10 && n ? "1-10" : t === 11 && n ? "0-10" : t === 5 && !n ? "emojis" : null;
|
|
5009
|
-
},
|
|
4983
|
+
}, Jd = /^(?:\p{Extended_Pictographic}|\p{Emoji_Modifier}|\u200D|\uFE0F)+$/u, Yd = (e) => e.length > 0 && e.every((e) => Jd.test(e.label.trim())), Xd = (e) => {
|
|
5010
4984
|
switch (e) {
|
|
5011
4985
|
case "rating": return {
|
|
5012
4986
|
value: void 0,
|
|
5013
|
-
options:
|
|
4987
|
+
options: Kd("1-5")
|
|
5014
4988
|
};
|
|
5015
4989
|
case "select":
|
|
5016
4990
|
case "multi-select": return { options: [{
|
|
@@ -5031,7 +5005,7 @@ var Gd = qn.create(Ti), Kd = xc(() => {
|
|
|
5031
5005
|
};
|
|
5032
5006
|
default: throw Error(`Unsupported question type: ${e}`);
|
|
5033
5007
|
}
|
|
5034
|
-
},
|
|
5008
|
+
}, Zd = (e) => `new-${e}-${Date.now()}`, Qd = [
|
|
5035
5009
|
"text",
|
|
5036
5010
|
"longText",
|
|
5037
5011
|
"select",
|
|
@@ -5041,13 +5015,13 @@ var Gd = qn.create(Ti), Kd = xc(() => {
|
|
|
5041
5015
|
"date",
|
|
5042
5016
|
"file",
|
|
5043
5017
|
"checkbox"
|
|
5044
|
-
],
|
|
5045
|
-
if (!e) return
|
|
5046
|
-
let t =
|
|
5018
|
+
], $d = (e) => {
|
|
5019
|
+
if (!e) return Qd[0];
|
|
5020
|
+
let t = Qd.find((t) => e?.includes(t));
|
|
5047
5021
|
if (!t) throw Error(`No default question type found for allowed question types: ${e.join(", ")}`);
|
|
5048
5022
|
return t;
|
|
5049
|
-
},
|
|
5050
|
-
function
|
|
5023
|
+
}, ef = vc(void 0);
|
|
5024
|
+
function tf({ elements: e, children: t, disabled: n, answering: r, disallowOptionalQuestions: i, onChange: a, allowedQuestionTypes: o, errors: s, onFieldBlur: c, useUpload: l, datasets: u, placeholders: d, labels: f, skipDefaultSection: p }) {
|
|
5051
5025
|
let m = _(o), h = _(s), g = _(u), v = _(d), y = _(f), b = q(e);
|
|
5052
5026
|
b.current = e;
|
|
5053
5027
|
let x = q(a);
|
|
@@ -5110,18 +5084,18 @@ function nf({ elements: e, children: t, disabled: n, answering: r, disallowOptio
|
|
|
5110
5084
|
}), x.current(n)) : (n.push(e), x.current(n));
|
|
5111
5085
|
}, []), E = W(({ type: e, afterId: t, datasetKey: n }) => {
|
|
5112
5086
|
if ((e === "dropdown-single" || e === "dropdown-multi") && !n) throw Error(`${e} questions require a datasetKey`);
|
|
5113
|
-
let r =
|
|
5087
|
+
let r = Zd(e === "section" ? "section" : "question"), i = $d(m), a = e === "section" ? {
|
|
5114
5088
|
type: "section",
|
|
5115
5089
|
section: {
|
|
5116
5090
|
id: r,
|
|
5117
5091
|
title: "",
|
|
5118
5092
|
questions: [{
|
|
5119
|
-
id:
|
|
5093
|
+
id: Zd("question"),
|
|
5120
5094
|
title: "",
|
|
5121
5095
|
description: "",
|
|
5122
5096
|
type: i,
|
|
5123
5097
|
required: !0,
|
|
5124
|
-
...
|
|
5098
|
+
...Xd(i)
|
|
5125
5099
|
}]
|
|
5126
5100
|
}
|
|
5127
5101
|
} : {
|
|
@@ -5132,7 +5106,7 @@ function nf({ elements: e, children: t, disabled: n, answering: r, disallowOptio
|
|
|
5132
5106
|
description: "",
|
|
5133
5107
|
type: e,
|
|
5134
5108
|
required: !0,
|
|
5135
|
-
...
|
|
5109
|
+
...Xd(e),
|
|
5136
5110
|
...n ? { datasetKey: n } : {}
|
|
5137
5111
|
}
|
|
5138
5112
|
};
|
|
@@ -5146,17 +5120,17 @@ function nf({ elements: e, children: t, disabled: n, answering: r, disallowOptio
|
|
|
5146
5120
|
...t,
|
|
5147
5121
|
section: {
|
|
5148
5122
|
...t.section,
|
|
5149
|
-
id:
|
|
5123
|
+
id: Zd("section"),
|
|
5150
5124
|
questions: t.section.questions?.map((e, t) => ({
|
|
5151
5125
|
...e,
|
|
5152
|
-
id: `${
|
|
5126
|
+
id: `${Zd("question")}-${t}`
|
|
5153
5127
|
}))
|
|
5154
5128
|
}
|
|
5155
5129
|
} : {
|
|
5156
5130
|
type: "question",
|
|
5157
5131
|
question: {
|
|
5158
5132
|
...t,
|
|
5159
|
-
id:
|
|
5133
|
+
id: Zd("question")
|
|
5160
5134
|
}
|
|
5161
5135
|
}), n && T({
|
|
5162
5136
|
element: n,
|
|
@@ -5228,33 +5202,33 @@ function nf({ elements: e, children: t, disabled: n, answering: r, disallowOptio
|
|
|
5228
5202
|
v,
|
|
5229
5203
|
y
|
|
5230
5204
|
]);
|
|
5231
|
-
return /* @__PURE__ */ X(
|
|
5205
|
+
return /* @__PURE__ */ X(ef.Provider, {
|
|
5232
5206
|
value: F,
|
|
5233
5207
|
children: t
|
|
5234
5208
|
});
|
|
5235
5209
|
}
|
|
5236
|
-
function
|
|
5237
|
-
let e = Sc(
|
|
5210
|
+
function nf() {
|
|
5211
|
+
let e = Sc(ef);
|
|
5238
5212
|
if (!e) throw Error("useSurveyFormBuilderContext must be used within a SurveyFormBuilderProvider");
|
|
5239
5213
|
return e;
|
|
5240
5214
|
}
|
|
5241
5215
|
//#endregion
|
|
5242
5216
|
//#region src/domains/talent/surveys/surveys/SurveyFormBuilder/DragContext.tsx
|
|
5243
|
-
var
|
|
5244
|
-
function
|
|
5217
|
+
var rf = vc(void 0);
|
|
5218
|
+
function af({ children: e }) {
|
|
5245
5219
|
let [t, n] = J(!1), [r, i] = J(null), a = K(() => ({
|
|
5246
5220
|
isDragging: t,
|
|
5247
5221
|
setIsDragging: n,
|
|
5248
5222
|
draggedItemId: r,
|
|
5249
5223
|
setDraggedItemId: i
|
|
5250
5224
|
}), [t, r]);
|
|
5251
|
-
return /* @__PURE__ */ X(
|
|
5225
|
+
return /* @__PURE__ */ X(rf.Provider, {
|
|
5252
5226
|
value: a,
|
|
5253
5227
|
children: e
|
|
5254
5228
|
});
|
|
5255
5229
|
}
|
|
5256
|
-
function
|
|
5257
|
-
return Sc(
|
|
5230
|
+
function of() {
|
|
5231
|
+
return Sc(rf) || {
|
|
5258
5232
|
isDragging: !1,
|
|
5259
5233
|
setIsDragging: () => {},
|
|
5260
5234
|
draggedItemId: null,
|
|
@@ -5263,8 +5237,8 @@ function sf() {
|
|
|
5263
5237
|
}
|
|
5264
5238
|
//#endregion
|
|
5265
5239
|
//#region src/domains/talent/surveys/surveys/SurveyFormBuilder/constants.ts
|
|
5266
|
-
var
|
|
5267
|
-
let { isQuestionTypeAllowed: e, datasets: t } =
|
|
5240
|
+
var sf = () => {
|
|
5241
|
+
let { isQuestionTypeAllowed: e, datasets: t } = nf(), { t: n } = R(), r = [
|
|
5268
5242
|
{
|
|
5269
5243
|
label: n("surveyFormBuilder.questionTypes.rating"),
|
|
5270
5244
|
icon: Gi,
|
|
@@ -5322,7 +5296,7 @@ var cf = () => {
|
|
|
5322
5296
|
datasetKey: e
|
|
5323
5297
|
})) : [];
|
|
5324
5298
|
return [...r, ...i];
|
|
5325
|
-
},
|
|
5299
|
+
}, cf = {
|
|
5326
5300
|
rating: Gi,
|
|
5327
5301
|
"multi-select": Rr,
|
|
5328
5302
|
select: Bs,
|
|
@@ -5335,8 +5309,8 @@ var cf = () => {
|
|
|
5335
5309
|
"dropdown-multi": so,
|
|
5336
5310
|
file: fi,
|
|
5337
5311
|
checkbox: Vs
|
|
5338
|
-
},
|
|
5339
|
-
let { disabled: e, answering: t, onAddNewElement: n, isQuestionTypeAllowed: r, labels: i } =
|
|
5312
|
+
}, lf = () => {
|
|
5313
|
+
let { disabled: e, answering: t, onAddNewElement: n, isQuestionTypeAllowed: r, labels: i } = nf(), [a, o] = J(!1), s = sf(), { t: c } = R(), l = i?.addQuestion ?? c("surveyFormBuilder.actions.addQuestion"), u = (e, t) => {
|
|
5340
5314
|
n?.({
|
|
5341
5315
|
type: e,
|
|
5342
5316
|
datasetKey: t
|
|
@@ -5433,7 +5407,7 @@ var cf = () => {
|
|
|
5433
5407
|
})]
|
|
5434
5408
|
})
|
|
5435
5409
|
});
|
|
5436
|
-
},
|
|
5410
|
+
}, uf = ({ open: e, onConfirm: t, onCancel: n }) => {
|
|
5437
5411
|
let { t: r } = R();
|
|
5438
5412
|
return /* @__PURE__ */ X(We, {
|
|
5439
5413
|
open: e,
|
|
@@ -5454,7 +5428,7 @@ var cf = () => {
|
|
|
5454
5428
|
}
|
|
5455
5429
|
}
|
|
5456
5430
|
});
|
|
5457
|
-
},
|
|
5431
|
+
}, df = [
|
|
5458
5432
|
{
|
|
5459
5433
|
label: "1 - 5",
|
|
5460
5434
|
value: "1-5"
|
|
@@ -5472,39 +5446,39 @@ var cf = () => {
|
|
|
5472
5446
|
value: "emojis"
|
|
5473
5447
|
}
|
|
5474
5448
|
];
|
|
5475
|
-
function
|
|
5449
|
+
function ff(e, t) {
|
|
5476
5450
|
if (e !== "rating" || !t || t.type !== "rating") return null;
|
|
5477
5451
|
let n = t.options;
|
|
5478
|
-
return !Array.isArray(n) || n.length === 0 || typeof n[0]?.value != "number" ? null :
|
|
5452
|
+
return !Array.isArray(n) || n.length === 0 || typeof n[0]?.value != "number" ? null : qd(n);
|
|
5479
5453
|
}
|
|
5480
|
-
function
|
|
5454
|
+
function pf(e, t, n) {
|
|
5481
5455
|
return !(e === t || (e === "select" || e === "multi-select") && n && "options" in n && Array.isArray(n.options) && n.options.length > 0 || (e === "dropdown-single" || e === "dropdown-multi") && (t === "dropdown-single" || t === "dropdown-multi"));
|
|
5482
5456
|
}
|
|
5483
|
-
function
|
|
5484
|
-
let { onQuestionChange: e, getQuestionById: t, deleteElement: n, onDuplicateElement: r, disallowOptionalQuestions: i, datasets: a } =
|
|
5457
|
+
function mf() {
|
|
5458
|
+
let { onQuestionChange: e, getQuestionById: t, deleteElement: n, onDuplicateElement: r, disallowOptionalQuestions: i, datasets: a } = nf(), o = sf();
|
|
5485
5459
|
return {
|
|
5486
5460
|
getActionsForQuestion: W((s, c, l) => {
|
|
5487
|
-
let u = t(s), d = u && "datasetKey" in u && typeof u.datasetKey == "string" ? u.datasetKey : void 0, f =
|
|
5461
|
+
let u = t(s), d = u && "datasetKey" in u && typeof u.datasetKey == "string" ? u.datasetKey : void 0, f = ff(c, u), p = (t) => {
|
|
5488
5462
|
e?.({
|
|
5489
5463
|
id: s,
|
|
5490
5464
|
type: c,
|
|
5491
5465
|
required: t
|
|
5492
5466
|
});
|
|
5493
5467
|
}, m = (t, n) => {
|
|
5494
|
-
let r =
|
|
5468
|
+
let r = pf(t, c, u), i = t === "dropdown-single" || t === "dropdown-multi", a = c === "dropdown-single" || c === "dropdown-multi", o = i && a && t !== c, l = i && !a;
|
|
5495
5469
|
e?.({
|
|
5496
5470
|
id: s,
|
|
5497
5471
|
type: t,
|
|
5498
5472
|
...i ? { datasetKey: n } : { datasetKey: void 0 },
|
|
5499
5473
|
...o || l ? { value: t === "dropdown-multi" ? [] : null } : {},
|
|
5500
|
-
...r && { ...
|
|
5474
|
+
...r && { ...Xd(t) }
|
|
5501
5475
|
});
|
|
5502
5476
|
}, h = (t) => {
|
|
5503
5477
|
e?.({
|
|
5504
5478
|
id: s,
|
|
5505
5479
|
type: "rating",
|
|
5506
5480
|
value: void 0,
|
|
5507
|
-
options:
|
|
5481
|
+
options: Kd(t)
|
|
5508
5482
|
});
|
|
5509
5483
|
}, g = c === "dropdown-multi" && !!d, _ = (t) => {
|
|
5510
5484
|
d && e?.({
|
|
@@ -5557,8 +5531,8 @@ function hf() {
|
|
|
5557
5531
|
questionTypes: o
|
|
5558
5532
|
};
|
|
5559
5533
|
}
|
|
5560
|
-
function
|
|
5561
|
-
let { getActionsForQuestion: r } =
|
|
5534
|
+
function hf({ questionId: e, questionType: t, canDelete: n = !0 }) {
|
|
5535
|
+
let { getActionsForQuestion: r } = mf();
|
|
5562
5536
|
return K(() => r(e, t, n), [
|
|
5563
5537
|
r,
|
|
5564
5538
|
e,
|
|
@@ -5568,7 +5542,7 @@ function gf({ questionId: e, questionType: t, canDelete: n = !0 }) {
|
|
|
5568
5542
|
}
|
|
5569
5543
|
//#endregion
|
|
5570
5544
|
//#region src/domains/talent/surveys/surveys/SurveyFormBuilder/QuestionTypes/BaseQuestion/ActionsMenu/ActionsMenu.tsx
|
|
5571
|
-
var
|
|
5545
|
+
var gf = ({ label: e, icon: t, checked: n, onChange: r }) => /* @__PURE__ */ X(Ys, {
|
|
5572
5546
|
className: "!pb-2.5 pr-4",
|
|
5573
5547
|
onClick: (e) => {
|
|
5574
5548
|
e.preventDefault(), r(!n);
|
|
@@ -5592,7 +5566,7 @@ var _f = ({ label: e, icon: t, checked: n, onChange: r }) => /* @__PURE__ */ X(Y
|
|
|
5592
5566
|
})
|
|
5593
5567
|
]
|
|
5594
5568
|
})
|
|
5595
|
-
}),
|
|
5569
|
+
}), _f = ({ label: e, value: t, currentDatasetKey: n, questionTypes: r, currentRatingType: i, isQuestionTypeAllowed: a, onSelectQuestionType: o, onSelectRatingType: s }) => {
|
|
5596
5570
|
let { t: c } = R(), l = r.filter((e) => !e.datasetKey), u = Array.from(new Set(r.filter((e) => !!e.datasetKey).map((e) => e.datasetKey))), d = n ? r.find((e) => e.questionType === t && e.datasetKey === n)?.label ?? void 0 : r.find((e) => e.questionType === t && !e.datasetKey)?.label ?? void 0;
|
|
5597
5571
|
return /* @__PURE__ */ Z(Qs, { children: [/* @__PURE__ */ X(Ks, {
|
|
5598
5572
|
className: "mx-1 px-2 data-[state=open]:rounded-sm data-[state=closed]:bg-transparent data-[state=open]:bg-f1-background-hover",
|
|
@@ -5630,11 +5604,11 @@ var _f = ({ label: e, icon: t, checked: n, onChange: r }) => /* @__PURE__ */ X(Y
|
|
|
5630
5604
|
}),
|
|
5631
5605
|
i ? /* @__PURE__ */ X("span", {
|
|
5632
5606
|
className: "mr-1 text-base text-f1-foreground-secondary",
|
|
5633
|
-
children:
|
|
5607
|
+
children: df.find((e) => e.value === i)?.label
|
|
5634
5608
|
}) : null
|
|
5635
5609
|
]
|
|
5636
5610
|
})
|
|
5637
|
-
}), /* @__PURE__ */ X(Zs, { children: /* @__PURE__ */ X(ac, { children:
|
|
5611
|
+
}), /* @__PURE__ */ X(Zs, { children: /* @__PURE__ */ X(ac, { children: df.map((e) => /* @__PURE__ */ X(Ys, {
|
|
5638
5612
|
onClick: () => s(e.value),
|
|
5639
5613
|
children: /* @__PURE__ */ Z("div", {
|
|
5640
5614
|
className: "flex w-full flex-row items-center gap-2 pl-2",
|
|
@@ -5727,7 +5701,7 @@ var _f = ({ label: e, icon: t, checked: n, onChange: r }) => /* @__PURE__ */ X(Y
|
|
|
5727
5701
|
})
|
|
5728
5702
|
}) : null] }) })] }, e);
|
|
5729
5703
|
})] }) : null] }) })] });
|
|
5730
|
-
},
|
|
5704
|
+
}, vf = ({ label: e, icon: t, onClick: n, critical: r }) => /* @__PURE__ */ X(Ys, {
|
|
5731
5705
|
onClick: n,
|
|
5732
5706
|
className: B(r ? "text-f1-foreground-critical" : void 0),
|
|
5733
5707
|
children: /* @__PURE__ */ Z("div", {
|
|
@@ -5737,21 +5711,21 @@ var _f = ({ label: e, icon: t, checked: n, onChange: r }) => /* @__PURE__ */ X(Y
|
|
|
5737
5711
|
children: e
|
|
5738
5712
|
})]
|
|
5739
5713
|
})
|
|
5740
|
-
}),
|
|
5741
|
-
let { t: a } = R(), { labels: o } =
|
|
5742
|
-
return !e && !t ? null : /* @__PURE__ */ Z(Y, { children: [n ? /* @__PURE__ */ X(Js, {}) : null, /* @__PURE__ */ Z(nc, { children: [e ? /* @__PURE__ */ X(
|
|
5714
|
+
}), yf = ({ showDuplicate: e, showDelete: t, withSeparator: n, onDuplicate: r, onDelete: i }) => {
|
|
5715
|
+
let { t: a } = R(), { labels: o } = nf();
|
|
5716
|
+
return !e && !t ? null : /* @__PURE__ */ Z(Y, { children: [n ? /* @__PURE__ */ X(Js, {}) : null, /* @__PURE__ */ Z(nc, { children: [e ? /* @__PURE__ */ X(vf, {
|
|
5743
5717
|
label: o?.duplicateQuestion ?? a("surveyFormBuilder.actions.duplicateQuestion"),
|
|
5744
5718
|
icon: Mr,
|
|
5745
5719
|
onClick: r
|
|
5746
|
-
}) : null, t ? /* @__PURE__ */ X(
|
|
5720
|
+
}) : null, t ? /* @__PURE__ */ X(vf, {
|
|
5747
5721
|
label: o?.deleteQuestion ?? a("surveyFormBuilder.actions.deleteQuestion"),
|
|
5748
5722
|
icon: fr,
|
|
5749
5723
|
onClick: i,
|
|
5750
5724
|
critical: !0
|
|
5751
5725
|
}) : null] })] });
|
|
5752
5726
|
};
|
|
5753
|
-
function
|
|
5754
|
-
let { t: o } = R(), { isQuestionTypeAllowed: s, labels: c } =
|
|
5727
|
+
function bf({ open: e, setOpen: t, questionId: n, questionType: r, canDeleteQuestion: i = !0, hiddenActions: a }) {
|
|
5728
|
+
let { t: o } = R(), { isQuestionTypeAllowed: s, labels: c } = nf(), { question: l, questionTypes: u, currentRatingType: d, currentDatasetKey: f, isMultiSelectEnabled: p, isAllowCreateEnabled: m, datasetHasOnCreate: h, disallowOptionalQuestions: g, handleChangeRequired: _, handleSelectQuestionType: v, handleSelectRatingType: y, handleToggleMultiSelect: b, handleToggleAllowCreate: x, handleDuplicate: S, handleDelete: C } = hf({
|
|
5755
5729
|
questionId: n,
|
|
5756
5730
|
questionType: r,
|
|
5757
5731
|
canDelete: i
|
|
@@ -5778,25 +5752,25 @@ function xf({ open: e, setOpen: t, questionId: n, questionType: r, canDeleteQues
|
|
|
5778
5752
|
className: "p-4 pb-2 font-medium text-f1-foreground-secondary",
|
|
5779
5753
|
children: c?.questionOptions ?? o("surveyFormBuilder.labels.questionOptions")
|
|
5780
5754
|
}),
|
|
5781
|
-
T ? /* @__PURE__ */ X(nc, { children: /* @__PURE__ */ X(
|
|
5755
|
+
T ? /* @__PURE__ */ X(nc, { children: /* @__PURE__ */ X(gf, {
|
|
5782
5756
|
label: o("surveyFormBuilder.labels.required"),
|
|
5783
5757
|
icon: ri,
|
|
5784
5758
|
checked: !!l?.required,
|
|
5785
5759
|
onChange: _
|
|
5786
5760
|
}) }) : null,
|
|
5787
|
-
E ? /* @__PURE__ */ X(nc, { children: /* @__PURE__ */ X(
|
|
5761
|
+
E ? /* @__PURE__ */ X(nc, { children: /* @__PURE__ */ X(gf, {
|
|
5788
5762
|
label: o("surveyFormBuilder.labels.allowMultiSelection"),
|
|
5789
5763
|
icon: Rr,
|
|
5790
5764
|
checked: p,
|
|
5791
5765
|
onChange: b
|
|
5792
5766
|
}) }) : null,
|
|
5793
|
-
D ? /* @__PURE__ */ X(nc, { children: /* @__PURE__ */ X(
|
|
5767
|
+
D ? /* @__PURE__ */ X(nc, { children: /* @__PURE__ */ X(gf, {
|
|
5794
5768
|
label: o("surveyFormBuilder.labels.allowCreate"),
|
|
5795
5769
|
icon: js,
|
|
5796
5770
|
checked: m,
|
|
5797
5771
|
onChange: x
|
|
5798
5772
|
}) }) : null,
|
|
5799
|
-
O ? /* @__PURE__ */ X(nc, { children: /* @__PURE__ */ X(
|
|
5773
|
+
O ? /* @__PURE__ */ X(nc, { children: /* @__PURE__ */ X(_f, {
|
|
5800
5774
|
label: c?.questionType ?? o("surveyFormBuilder.labels.questionType"),
|
|
5801
5775
|
value: r,
|
|
5802
5776
|
currentDatasetKey: f,
|
|
@@ -5806,7 +5780,7 @@ function xf({ open: e, setOpen: t, questionId: n, questionType: r, canDeleteQues
|
|
|
5806
5780
|
onSelectQuestionType: v,
|
|
5807
5781
|
onSelectRatingType: y
|
|
5808
5782
|
}) }) : null,
|
|
5809
|
-
/* @__PURE__ */ X(
|
|
5783
|
+
/* @__PURE__ */ X(yf, {
|
|
5810
5784
|
showDuplicate: k,
|
|
5811
5785
|
showDelete: A,
|
|
5812
5786
|
withSeparator: T || E || D || O,
|
|
@@ -5819,7 +5793,7 @@ function xf({ open: e, setOpen: t, questionId: n, questionType: r, canDeleteQues
|
|
|
5819
5793
|
}
|
|
5820
5794
|
//#endregion
|
|
5821
5795
|
//#region src/domains/talent/surveys/surveys/SurveyFormBuilder/QuestionTypes/BaseQuestion/BaseQuestion.tsx
|
|
5822
|
-
var
|
|
5796
|
+
var xf = ({ notice: e, className: t, children: n }) => {
|
|
5823
5797
|
let r = /* @__PURE__ */ X("div", {
|
|
5824
5798
|
className: t,
|
|
5825
5799
|
children: n
|
|
@@ -5829,31 +5803,31 @@ var Sf = ({ notice: e, className: t, children: n }) => {
|
|
|
5829
5803
|
...e,
|
|
5830
5804
|
children: r
|
|
5831
5805
|
}) : r;
|
|
5832
|
-
},
|
|
5833
|
-
let { onQuestionChange: d, onAddNewElement: f, disabled: p, answering: m, getIsSingleQuestionInSection: h, getSectionContainingQuestion: g, isQuestionTypeAllowed: _, placeholders: v, labels: y } =
|
|
5806
|
+
}, Sf = ({ id: e, title: t, description: n, children: r, required: a, type: o, hiddenActions: s, locked: c, lockedFields: l, lockedNote: u }) => {
|
|
5807
|
+
let { onQuestionChange: d, onAddNewElement: f, disabled: p, answering: m, getIsSingleQuestionInSection: h, getSectionContainingQuestion: g, isQuestionTypeAllowed: _, placeholders: v, labels: y } = nf(), b = g(e), x = !!b?.locked || !!c, S = x || !!l?.includes("title"), C = x || !!l?.includes("description"), w = !x && (S || C), T = !!b, [E, D] = J(!1), [O, k] = J(!1), { isDragging: A } = of(), { t: j } = R(), M = v?.questionTitle ?? j("surveyFormBuilder.labels.titlePlaceholder"), N = y?.addQuestion ?? j("surveyFormBuilder.actions.addQuestion"), P = v?.questionDescription ?? j("surveyFormBuilder.labels.questionDescriptionPlaceholder"), F = (t) => {
|
|
5834
5808
|
d?.({
|
|
5835
5809
|
id: e,
|
|
5836
5810
|
type: o,
|
|
5837
5811
|
title: t.target.value
|
|
5838
5812
|
});
|
|
5839
|
-
},
|
|
5813
|
+
}, I = (t) => {
|
|
5840
5814
|
d?.({
|
|
5841
5815
|
id: e,
|
|
5842
5816
|
type: o,
|
|
5843
5817
|
description: t.target.value
|
|
5844
5818
|
});
|
|
5845
|
-
},
|
|
5819
|
+
}, ee = (t, n) => {
|
|
5846
5820
|
f?.({
|
|
5847
5821
|
type: t,
|
|
5848
5822
|
afterId: e,
|
|
5849
5823
|
datasetKey: n
|
|
5850
5824
|
});
|
|
5851
|
-
},
|
|
5825
|
+
}, te = () => {
|
|
5852
5826
|
f?.({
|
|
5853
5827
|
type: "section",
|
|
5854
5828
|
afterId: e
|
|
5855
5829
|
});
|
|
5856
|
-
},
|
|
5830
|
+
}, ne = sf(), re = ne.filter((e) => !e.datasetKey), ie = Array.from(new Set(ne.filter((e) => !!e.datasetKey).map((e) => e.datasetKey))), ae = h(e), oe = q(null), se = q(!ae);
|
|
5857
5831
|
G(() => {
|
|
5858
5832
|
se.current && oe.current?.focus({ preventScroll: !0 });
|
|
5859
5833
|
}, []);
|
|
@@ -5867,7 +5841,7 @@ var Sf = ({ notice: e, className: t, children: n }) => {
|
|
|
5867
5841
|
children: [/* @__PURE__ */ Z("div", {
|
|
5868
5842
|
className: "flex flex-row gap-2",
|
|
5869
5843
|
children: [
|
|
5870
|
-
/* @__PURE__ */ X(
|
|
5844
|
+
/* @__PURE__ */ X(xf, {
|
|
5871
5845
|
className: "relative w-full",
|
|
5872
5846
|
notice: w && S ? de : null,
|
|
5873
5847
|
children: m ? /* @__PURE__ */ Z("div", {
|
|
@@ -5923,7 +5897,7 @@ var Sf = ({ notice: e, className: t, children: n }) => {
|
|
|
5923
5897
|
}) }) : null,
|
|
5924
5898
|
!p && !m && !x ? /* @__PURE__ */ X("div", {
|
|
5925
5899
|
className: B("opacity-0 group-hover/question:opacity-100", O && "opacity-100"),
|
|
5926
|
-
children: /* @__PURE__ */ X(
|
|
5900
|
+
children: /* @__PURE__ */ X(bf, {
|
|
5927
5901
|
open: O,
|
|
5928
5902
|
setOpen: k,
|
|
5929
5903
|
questionId: e,
|
|
@@ -5936,13 +5910,13 @@ var Sf = ({ notice: e, className: t, children: n }) => {
|
|
|
5936
5910
|
}), m ? n ? /* @__PURE__ */ X("p", {
|
|
5937
5911
|
className: "w-full whitespace-pre-wrap break-words px-2 text-f1-foreground-secondary",
|
|
5938
5912
|
children: n
|
|
5939
|
-
}) : null : ue ? /* @__PURE__ */ X(
|
|
5913
|
+
}) : null : ue ? /* @__PURE__ */ X(xf, {
|
|
5940
5914
|
notice: w && C ? de : null,
|
|
5941
5915
|
children: /* @__PURE__ */ X("textarea", {
|
|
5942
5916
|
value: n,
|
|
5943
5917
|
"aria-label": j("surveyFormBuilder.labels.description"),
|
|
5944
5918
|
placeholder: P,
|
|
5945
|
-
onChange:
|
|
5919
|
+
onChange: I,
|
|
5946
5920
|
disabled: le,
|
|
5947
5921
|
className: B("w-full [field-sizing:content] resize-none px-2 text-f1-foreground-secondary placeholder:text-f1-foreground-tertiary disabled:text-f1-foreground-secondary [&::-webkit-search-cancel-button]:hidden", !m && le && "!cursor-not-allowed")
|
|
5948
5922
|
})
|
|
@@ -5972,7 +5946,7 @@ var Sf = ({ notice: e, className: t, children: n }) => {
|
|
|
5972
5946
|
className: "w-80",
|
|
5973
5947
|
children: [
|
|
5974
5948
|
T ? null : /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X(Ys, {
|
|
5975
|
-
onClick:
|
|
5949
|
+
onClick: te,
|
|
5976
5950
|
children: /* @__PURE__ */ Z("div", {
|
|
5977
5951
|
className: "flex w-full flex-row items-center gap-2",
|
|
5978
5952
|
children: [/* @__PURE__ */ X(H, {
|
|
@@ -5985,7 +5959,7 @@ var Sf = ({ notice: e, className: t, children: n }) => {
|
|
|
5985
5959
|
})
|
|
5986
5960
|
}), /* @__PURE__ */ X(Js, {})] }),
|
|
5987
5961
|
re.map((e) => /* @__PURE__ */ X(Ys, {
|
|
5988
|
-
onClick: () =>
|
|
5962
|
+
onClick: () => ee(e.questionType),
|
|
5989
5963
|
children: /* @__PURE__ */ Z("div", {
|
|
5990
5964
|
className: "flex w-full flex-row items-center gap-2",
|
|
5991
5965
|
children: [/* @__PURE__ */ X(H, {
|
|
@@ -5998,7 +5972,7 @@ var Sf = ({ notice: e, className: t, children: n }) => {
|
|
|
5998
5972
|
})
|
|
5999
5973
|
}, e.questionType)),
|
|
6000
5974
|
ie.length > 0 ? /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X(Js, {}), ie.map((e) => {
|
|
6001
|
-
let t =
|
|
5975
|
+
let t = ne.find((t) => t.datasetKey === e && t.questionType === "dropdown-single");
|
|
6002
5976
|
return /* @__PURE__ */ Z(Qs, { children: [/* @__PURE__ */ X(Ks, {
|
|
6003
5977
|
className: "mx-1 px-2 data-[state=open]:rounded-sm data-[state=closed]:bg-transparent data-[state=open]:bg-f1-background-hover",
|
|
6004
5978
|
children: /* @__PURE__ */ Z("div", {
|
|
@@ -6012,7 +5986,7 @@ var Sf = ({ notice: e, className: t, children: n }) => {
|
|
|
6012
5986
|
})]
|
|
6013
5987
|
})
|
|
6014
5988
|
}), /* @__PURE__ */ X(Zs, { children: /* @__PURE__ */ Z(ac, { children: [_("dropdown-single") ? /* @__PURE__ */ X(Ys, {
|
|
6015
|
-
onClick: () =>
|
|
5989
|
+
onClick: () => ee("dropdown-single", e),
|
|
6016
5990
|
children: /* @__PURE__ */ Z("div", {
|
|
6017
5991
|
className: "flex w-full flex-row items-center gap-2",
|
|
6018
5992
|
children: [/* @__PURE__ */ X(H, {
|
|
@@ -6024,7 +5998,7 @@ var Sf = ({ notice: e, className: t, children: n }) => {
|
|
|
6024
5998
|
})]
|
|
6025
5999
|
})
|
|
6026
6000
|
}) : null, _("dropdown-multi") ? /* @__PURE__ */ X(Ys, {
|
|
6027
|
-
onClick: () =>
|
|
6001
|
+
onClick: () => ee("dropdown-multi", e),
|
|
6028
6002
|
children: /* @__PURE__ */ Z("div", {
|
|
6029
6003
|
className: "flex w-full flex-row items-center gap-2",
|
|
6030
6004
|
children: [/* @__PURE__ */ X(H, {
|
|
@@ -6046,15 +6020,15 @@ var Sf = ({ notice: e, className: t, children: n }) => {
|
|
|
6046
6020
|
};
|
|
6047
6021
|
//#endregion
|
|
6048
6022
|
//#region src/domains/talent/surveys/surveys/SurveyFormBuilder/QuestionTypes/BaseQuestion/useQuestionDisabled.ts
|
|
6049
|
-
function
|
|
6050
|
-
let { answering: t, getSectionContainingQuestion: n } =
|
|
6023
|
+
function Cf(e) {
|
|
6024
|
+
let { answering: t, getSectionContainingQuestion: n } = nf(), r = n(e.id)?.locked;
|
|
6051
6025
|
return t ? !1 : r || !0;
|
|
6052
6026
|
}
|
|
6053
6027
|
//#endregion
|
|
6054
6028
|
//#region src/domains/talent/surveys/surveys/SurveyFormBuilder/QuestionTypes/CheckboxQuestion/CheckboxQuestion.tsx
|
|
6055
|
-
var
|
|
6056
|
-
let { onQuestionChange: r, answering: i, disabled: a, getSectionContainingQuestion: o } =
|
|
6057
|
-
if (i) return /* @__PURE__ */ X(
|
|
6029
|
+
var wf = ({ value: e, label: t, ...n }) => {
|
|
6030
|
+
let { onQuestionChange: r, answering: i, disabled: a, getSectionContainingQuestion: o } = nf(), s = Cf(n), { t: c } = R();
|
|
6031
|
+
if (i) return /* @__PURE__ */ X(Sf, {
|
|
6058
6032
|
...n,
|
|
6059
6033
|
children: /* @__PURE__ */ X(cs, {
|
|
6060
6034
|
id: n.id,
|
|
@@ -6072,7 +6046,7 @@ var Tf = ({ value: e, label: t, ...n }) => {
|
|
|
6072
6046
|
})
|
|
6073
6047
|
});
|
|
6074
6048
|
let l = a || o(n.id)?.locked || n.locked;
|
|
6075
|
-
return /* @__PURE__ */ X(
|
|
6049
|
+
return /* @__PURE__ */ X(Sf, {
|
|
6076
6050
|
...n,
|
|
6077
6051
|
children: /* @__PURE__ */ Z("div", {
|
|
6078
6052
|
className: "flex items-start",
|
|
@@ -6097,16 +6071,16 @@ var Tf = ({ value: e, label: t, ...n }) => {
|
|
|
6097
6071
|
})]
|
|
6098
6072
|
})
|
|
6099
6073
|
});
|
|
6100
|
-
},
|
|
6101
|
-
let { onQuestionChange: n } =
|
|
6074
|
+
}, Tf = ({ value: e, ...t }) => {
|
|
6075
|
+
let { onQuestionChange: n } = nf(), r = Cf(t), { t: i } = R(), a = {
|
|
6102
6076
|
id: t.id,
|
|
6103
6077
|
type: "date",
|
|
6104
6078
|
label: i("surveyFormBuilder.answer.label"),
|
|
6105
6079
|
clearable: !t.required
|
|
6106
6080
|
};
|
|
6107
|
-
return /* @__PURE__ */ X(
|
|
6081
|
+
return /* @__PURE__ */ X(Sf, {
|
|
6108
6082
|
...t,
|
|
6109
|
-
children: /* @__PURE__ */ X(
|
|
6083
|
+
children: /* @__PURE__ */ X(Iu, {
|
|
6110
6084
|
field: a,
|
|
6111
6085
|
value: e ?? void 0,
|
|
6112
6086
|
onChange: (e) => {
|
|
@@ -6120,8 +6094,8 @@ var Tf = ({ value: e, label: t, ...n }) => {
|
|
|
6120
6094
|
hideLabel: !0
|
|
6121
6095
|
})
|
|
6122
6096
|
});
|
|
6123
|
-
},
|
|
6124
|
-
let { onQuestionChange: i, answering: a, datasets: o } =
|
|
6097
|
+
}, Ef = ({ datasetKey: e, showSearchBox: t, searchBoxPlaceholder: n, ...r }) => {
|
|
6098
|
+
let { onQuestionChange: i, answering: a, datasets: o } = nf(), s = Cf(r), { t: c } = R(), l = o?.[e];
|
|
6125
6099
|
if (!l) throw Error(`Dataset "${e}" not found for ${r.type}`);
|
|
6126
6100
|
let u = r.type === "dropdown-multi", d = t ?? !0, f = r.type === "dropdown-single" ? r.allowCreate : void 0, p = a && !u && f && l.onCreate ? async (e) => {
|
|
6127
6101
|
try {
|
|
@@ -6148,11 +6122,11 @@ var Tf = ({ value: e, label: t, ...n }) => {
|
|
|
6148
6122
|
searchBoxPlaceholder: n,
|
|
6149
6123
|
onCreate: p
|
|
6150
6124
|
};
|
|
6151
|
-
return /* @__PURE__ */ X(
|
|
6125
|
+
return /* @__PURE__ */ X(Sf, {
|
|
6152
6126
|
...r,
|
|
6153
6127
|
children: /* @__PURE__ */ X("div", {
|
|
6154
6128
|
className: "flex flex-col items-start [&>div]:w-full",
|
|
6155
|
-
children: /* @__PURE__ */ X(
|
|
6129
|
+
children: /* @__PURE__ */ X(Iu, {
|
|
6156
6130
|
field: m,
|
|
6157
6131
|
value: u ? r.value ?? [] : r.value ?? "",
|
|
6158
6132
|
onChange: (e) => {
|
|
@@ -6171,7 +6145,7 @@ var Tf = ({ value: e, label: t, ...n }) => {
|
|
|
6171
6145
|
})
|
|
6172
6146
|
})
|
|
6173
6147
|
});
|
|
6174
|
-
},
|
|
6148
|
+
}, Df = [
|
|
6175
6149
|
"image/*",
|
|
6176
6150
|
"application/pdf",
|
|
6177
6151
|
"application/msword",
|
|
@@ -6182,7 +6156,7 @@ var Tf = ({ value: e, label: t, ...n }) => {
|
|
|
6182
6156
|
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
6183
6157
|
"text/plain",
|
|
6184
6158
|
"text/csv"
|
|
6185
|
-
],
|
|
6159
|
+
], Of = () => ({
|
|
6186
6160
|
upload: async (e) => ({
|
|
6187
6161
|
type: "success",
|
|
6188
6162
|
value: `local-${e.name}-${Date.now()}`
|
|
@@ -6190,19 +6164,19 @@ var Tf = ({ value: e, label: t, ...n }) => {
|
|
|
6190
6164
|
cancelUpload: () => {},
|
|
6191
6165
|
progress: 0,
|
|
6192
6166
|
status: "idle"
|
|
6193
|
-
}),
|
|
6194
|
-
let { onQuestionChange: a, useUpload: o } =
|
|
6167
|
+
}), kf = ({ value: e, useUpload: t, accept: n, maxSizeMB: r, ...i }) => {
|
|
6168
|
+
let { onQuestionChange: a, useUpload: o } = nf(), s = Cf(i), { t: c } = R(), l = t ?? o, u = {
|
|
6195
6169
|
id: i.id,
|
|
6196
6170
|
type: "file",
|
|
6197
6171
|
label: c("surveyFormBuilder.answer.label"),
|
|
6198
6172
|
multiple: !0,
|
|
6199
|
-
accept: n ??
|
|
6173
|
+
accept: n ?? Df,
|
|
6200
6174
|
maxSizeMB: r,
|
|
6201
|
-
useUpload: l ??
|
|
6175
|
+
useUpload: l ?? Of
|
|
6202
6176
|
};
|
|
6203
|
-
return /* @__PURE__ */ X(
|
|
6177
|
+
return /* @__PURE__ */ X(Sf, {
|
|
6204
6178
|
...i,
|
|
6205
|
-
children: /* @__PURE__ */ X(
|
|
6179
|
+
children: /* @__PURE__ */ X(Iu, {
|
|
6206
6180
|
field: u,
|
|
6207
6181
|
value: e ?? [],
|
|
6208
6182
|
onChange: (e) => {
|
|
@@ -6216,8 +6190,8 @@ var Tf = ({ value: e, label: t, ...n }) => {
|
|
|
6216
6190
|
hideLabel: !0
|
|
6217
6191
|
})
|
|
6218
6192
|
});
|
|
6219
|
-
},
|
|
6220
|
-
let { t: n } = R(), { onQuestionChange: r, answering: i } =
|
|
6193
|
+
}, Af = ({ value: e, ...t }) => {
|
|
6194
|
+
let { t: n } = R(), { onQuestionChange: r, answering: i } = nf(), a = Cf(t), o = n("surveyFormBuilder.answer.linkPlaceholder"), s = {
|
|
6221
6195
|
id: t.id,
|
|
6222
6196
|
type: "text",
|
|
6223
6197
|
inputType: "url",
|
|
@@ -6225,9 +6199,9 @@ var Tf = ({ value: e, label: t, ...n }) => {
|
|
|
6225
6199
|
placeholder: o,
|
|
6226
6200
|
clearable: !t.required
|
|
6227
6201
|
};
|
|
6228
|
-
return /* @__PURE__ */ X(
|
|
6202
|
+
return /* @__PURE__ */ X(Sf, {
|
|
6229
6203
|
...t,
|
|
6230
|
-
children: /* @__PURE__ */ X(
|
|
6204
|
+
children: /* @__PURE__ */ X(Iu, {
|
|
6231
6205
|
field: s,
|
|
6232
6206
|
value: i ? e ?? "" : o,
|
|
6233
6207
|
onChange: (e) => {
|
|
@@ -6241,15 +6215,15 @@ var Tf = ({ value: e, label: t, ...n }) => {
|
|
|
6241
6215
|
hideLabel: !0
|
|
6242
6216
|
})
|
|
6243
6217
|
});
|
|
6244
|
-
},
|
|
6245
|
-
let { t: n } = R(), { onQuestionChange: r, answering: i } =
|
|
6218
|
+
}, jf = ({ value: e, ...t }) => {
|
|
6219
|
+
let { t: n } = R(), { onQuestionChange: r, answering: i } = nf(), a = Cf(t), o = (e) => {
|
|
6246
6220
|
r?.({
|
|
6247
6221
|
...t,
|
|
6248
6222
|
type: "numeric",
|
|
6249
6223
|
value: e
|
|
6250
6224
|
});
|
|
6251
6225
|
}, s = n("surveyFormBuilder.answer.numericPlaceholder");
|
|
6252
|
-
return /* @__PURE__ */ X(
|
|
6226
|
+
return /* @__PURE__ */ X(Sf, {
|
|
6253
6227
|
...t,
|
|
6254
6228
|
children: i ? /* @__PURE__ */ X(A, {
|
|
6255
6229
|
locale: "en-US",
|
|
@@ -6274,7 +6248,7 @@ var Tf = ({ value: e, label: t, ...n }) => {
|
|
|
6274
6248
|
icon: vr
|
|
6275
6249
|
})
|
|
6276
6250
|
});
|
|
6277
|
-
},
|
|
6251
|
+
}, Mf = ({ option: e, selected: n, onClick: r, onChangeLabel: i, disabled: a, isEmojiMode: o = !1 }) => {
|
|
6278
6252
|
let { value: s, label: c } = e, [l, u] = J(!1);
|
|
6279
6253
|
return G(() => {
|
|
6280
6254
|
a && u(!1);
|
|
@@ -6329,7 +6303,7 @@ var Tf = ({ value: e, label: t, ...n }) => {
|
|
|
6329
6303
|
children: c
|
|
6330
6304
|
})
|
|
6331
6305
|
});
|
|
6332
|
-
},
|
|
6306
|
+
}, Nf = ({ minLabel: e, maxLabel: t }) => !e && !t ? null : /* @__PURE__ */ Z("div", {
|
|
6333
6307
|
className: "flex items-start justify-between gap-4 px-2 pb-1",
|
|
6334
6308
|
children: [/* @__PURE__ */ X("span", {
|
|
6335
6309
|
className: "text-sm text-f1-foreground-secondary",
|
|
@@ -6338,8 +6312,8 @@ var Tf = ({ value: e, label: t, ...n }) => {
|
|
|
6338
6312
|
className: "text-right text-sm text-f1-foreground-secondary",
|
|
6339
6313
|
children: t
|
|
6340
6314
|
})]
|
|
6341
|
-
}),
|
|
6342
|
-
let { onQuestionChange: a, disabled: o, answering: s, getSectionContainingQuestion: c } =
|
|
6315
|
+
}), Pf = ({ options: e, value: t, minLabel: n, maxLabel: r, ...i }) => {
|
|
6316
|
+
let { onQuestionChange: a, disabled: o, answering: s, getSectionContainingQuestion: c } = nf(), l = c(i.id)?.locked || i.locked, u = !!(n || r), d = qd(e) === "emojis" && Yd(e), f = (e) => {
|
|
6343
6317
|
a?.({
|
|
6344
6318
|
id: i.id,
|
|
6345
6319
|
value: e,
|
|
@@ -6357,13 +6331,13 @@ var Tf = ({ value: e, label: t, ...n }) => {
|
|
|
6357
6331
|
options: o
|
|
6358
6332
|
});
|
|
6359
6333
|
};
|
|
6360
|
-
return /* @__PURE__ */ X(
|
|
6334
|
+
return /* @__PURE__ */ X(Sf, {
|
|
6361
6335
|
...i,
|
|
6362
6336
|
children: /* @__PURE__ */ Z("div", {
|
|
6363
6337
|
className: "flex flex-col gap-3",
|
|
6364
6338
|
children: [/* @__PURE__ */ X("div", {
|
|
6365
6339
|
className: B(u ? "flex gap-3 [&>*]:min-w-0" : "grid grid-cols-3 gap-3 @md:grid-cols-5"),
|
|
6366
|
-
children: e.map((e) => /* @__PURE__ */ X(
|
|
6340
|
+
children: e.map((e) => /* @__PURE__ */ X(Mf, {
|
|
6367
6341
|
option: e,
|
|
6368
6342
|
selected: t === e.value,
|
|
6369
6343
|
onClick: f,
|
|
@@ -6371,27 +6345,27 @@ var Tf = ({ value: e, label: t, ...n }) => {
|
|
|
6371
6345
|
disabled: (o || l) && !s,
|
|
6372
6346
|
isEmojiMode: !s && d
|
|
6373
6347
|
}, e.value))
|
|
6374
|
-
}), /* @__PURE__ */ X(
|
|
6348
|
+
}), /* @__PURE__ */ X(Nf, {
|
|
6375
6349
|
minLabel: n,
|
|
6376
6350
|
maxLabel: r
|
|
6377
6351
|
})]
|
|
6378
6352
|
})
|
|
6379
6353
|
});
|
|
6380
|
-
},
|
|
6354
|
+
}, Ff = (e) => /* @__PURE__ */ X(Pf, {
|
|
6381
6355
|
...e,
|
|
6382
6356
|
type: "rating"
|
|
6383
6357
|
});
|
|
6384
6358
|
//#endregion
|
|
6385
6359
|
//#region src/domains/talent/surveys/surveys/SurveyFormBuilder/QuestionTypes/SelectQuestion/SelectOption/SelectOption.tsx
|
|
6386
|
-
function
|
|
6360
|
+
function If({ checked: e, disabled: t }) {
|
|
6387
6361
|
return /* @__PURE__ */ X("div", {
|
|
6388
6362
|
"aria-hidden": "true",
|
|
6389
6363
|
className: B("flex h-5 w-5 shrink-0 items-center justify-center rounded-full transition-colors", e ? "bg-f1-background-selected-bold" : "border border-solid border-f1-border bg-f1-background", t && "opacity-50"),
|
|
6390
6364
|
children: e ? /* @__PURE__ */ X("div", { className: "h-2 w-2 rounded-full bg-f1-background" }) : null
|
|
6391
6365
|
});
|
|
6392
6366
|
}
|
|
6393
|
-
var
|
|
6394
|
-
let { value: d, label: f } = t, { isDragging: p, setIsDragging: m, setDraggedItemId: h, draggedItemId: g } =
|
|
6367
|
+
var Lf = ({ index: e, option: t, onClick: n, onClickAction: r, onChangeLabel: i, disabled: a, answering: o, selected: s, correct: c, locked: l, type: u }) => {
|
|
6368
|
+
let { value: d, label: f } = t, { isDragging: p, setIsDragging: m, setDraggedItemId: h, draggedItemId: g } = of(), { t: _ } = R(), v = p && g === d, y = () => {
|
|
6395
6369
|
(a || o) && n(d);
|
|
6396
6370
|
}, b = (t) => {
|
|
6397
6371
|
r({
|
|
@@ -6435,7 +6409,7 @@ var Rf = ({ index: e, option: t, onClick: n, onClickAction: r, onChangeLabel: i,
|
|
|
6435
6409
|
disabled: !o,
|
|
6436
6410
|
presentational: !o,
|
|
6437
6411
|
hideLabel: !0
|
|
6438
|
-
}) : /* @__PURE__ */ X(
|
|
6412
|
+
}) : /* @__PURE__ */ X(If, {
|
|
6439
6413
|
checked: o ? !!s : !1,
|
|
6440
6414
|
disabled: !o
|
|
6441
6415
|
})
|
|
@@ -6482,8 +6456,8 @@ var Rf = ({ index: e, option: t, onClick: n, onClickAction: r, onChangeLabel: i,
|
|
|
6482
6456
|
]
|
|
6483
6457
|
})
|
|
6484
6458
|
});
|
|
6485
|
-
},
|
|
6486
|
-
let { onQuestionChange: n, disabled: r, answering: i, getSectionContainingQuestion: a } =
|
|
6459
|
+
}, Rf = ({ options: e, ...t }) => {
|
|
6460
|
+
let { onQuestionChange: n, disabled: r, answering: i, getSectionContainingQuestion: a } = nf(), o = new Set(e.map((e) => e.value)).size !== e.length, s = a(t.id)?.locked || t.locked, { t: c } = R(), l = K(() => ({
|
|
6487
6461
|
id: t.id,
|
|
6488
6462
|
type: t.type,
|
|
6489
6463
|
options: e
|
|
@@ -6570,11 +6544,11 @@ var Rf = ({ index: e, option: t, onClick: n, onClickAction: r, onChangeLabel: i,
|
|
|
6570
6544
|
options: e
|
|
6571
6545
|
});
|
|
6572
6546
|
};
|
|
6573
|
-
return o ? null : /* @__PURE__ */ X(
|
|
6547
|
+
return o ? null : /* @__PURE__ */ X(Sf, {
|
|
6574
6548
|
...t,
|
|
6575
6549
|
children: /* @__PURE__ */ Z("div", {
|
|
6576
6550
|
className: "-mx-0.5 flex flex-col items-start [&>div]:w-full",
|
|
6577
|
-
children: [/* @__PURE__ */ X(
|
|
6551
|
+
children: [/* @__PURE__ */ X(af, { children: /* @__PURE__ */ X(cn, {
|
|
6578
6552
|
axis: "y",
|
|
6579
6553
|
values: e,
|
|
6580
6554
|
onReorder: m,
|
|
@@ -6583,7 +6557,7 @@ var Rf = ({ index: e, option: t, onClick: n, onClickAction: r, onChangeLabel: i,
|
|
|
6583
6557
|
let a = t.type === "select" ? t.value === e.value : Array.isArray(t.value) && t.value.includes(e.value);
|
|
6584
6558
|
return /* @__PURE__ */ X("div", {
|
|
6585
6559
|
className: "w-full [&>div]:w-full",
|
|
6586
|
-
children: /* @__PURE__ */ X(
|
|
6560
|
+
children: /* @__PURE__ */ X(Lf, {
|
|
6587
6561
|
index: n,
|
|
6588
6562
|
option: e,
|
|
6589
6563
|
correct: e.correct,
|
|
@@ -6609,8 +6583,8 @@ var Rf = ({ index: e, option: t, onClick: n, onClickAction: r, onChangeLabel: i,
|
|
|
6609
6583
|
}) : null]
|
|
6610
6584
|
})
|
|
6611
6585
|
});
|
|
6612
|
-
},
|
|
6613
|
-
let { onQuestionChange: n, answering: r, placeholders: i } =
|
|
6586
|
+
}, zf = ({ value: e, ...t }) => {
|
|
6587
|
+
let { onQuestionChange: n, answering: r, placeholders: i } = nf(), a = Cf(t), { t: o } = R(), s = i?.answer ?? o("surveyFormBuilder.answer.textPlaceholder"), c = K(() => t.type === "text" ? {
|
|
6614
6588
|
id: t.id,
|
|
6615
6589
|
type: "text",
|
|
6616
6590
|
label: o("surveyFormBuilder.answer.label"),
|
|
@@ -6629,9 +6603,9 @@ var Rf = ({ index: e, option: t, onClick: n, onClickAction: r, onChangeLabel: i,
|
|
|
6629
6603
|
s,
|
|
6630
6604
|
o
|
|
6631
6605
|
]);
|
|
6632
|
-
return /* @__PURE__ */ X(
|
|
6606
|
+
return /* @__PURE__ */ X(Sf, {
|
|
6633
6607
|
...t,
|
|
6634
|
-
children: /* @__PURE__ */ X(
|
|
6608
|
+
children: /* @__PURE__ */ X(Iu, {
|
|
6635
6609
|
field: c,
|
|
6636
6610
|
value: r ? e ?? "" : s,
|
|
6637
6611
|
onChange: (e) => {
|
|
@@ -6644,23 +6618,23 @@ var Rf = ({ index: e, option: t, onClick: n, onClickAction: r, onChangeLabel: i,
|
|
|
6644
6618
|
hideLabel: !0
|
|
6645
6619
|
})
|
|
6646
6620
|
});
|
|
6647
|
-
},
|
|
6621
|
+
}, Bf = ({ ...e }) => {
|
|
6648
6622
|
switch (e.type) {
|
|
6649
6623
|
case "text":
|
|
6650
|
-
case "longText": return /* @__PURE__ */ X(
|
|
6651
|
-
case "rating": return /* @__PURE__ */ X(
|
|
6624
|
+
case "longText": return /* @__PURE__ */ X(zf, { ...e });
|
|
6625
|
+
case "rating": return /* @__PURE__ */ X(Ff, { ...e });
|
|
6652
6626
|
case "select":
|
|
6653
|
-
case "multi-select": return /* @__PURE__ */ X(
|
|
6627
|
+
case "multi-select": return /* @__PURE__ */ X(Rf, { ...e });
|
|
6654
6628
|
case "dropdown-single":
|
|
6655
|
-
case "dropdown-multi": return /* @__PURE__ */ X(
|
|
6656
|
-
case "numeric": return /* @__PURE__ */ X(
|
|
6657
|
-
case "link": return /* @__PURE__ */ X(
|
|
6658
|
-
case "date": return /* @__PURE__ */ X(
|
|
6659
|
-
case "file": return /* @__PURE__ */ X(
|
|
6660
|
-
case "checkbox": return /* @__PURE__ */ X(
|
|
6629
|
+
case "dropdown-multi": return /* @__PURE__ */ X(Ef, { ...e });
|
|
6630
|
+
case "numeric": return /* @__PURE__ */ X(jf, { ...e });
|
|
6631
|
+
case "link": return /* @__PURE__ */ X(Af, { ...e });
|
|
6632
|
+
case "date": return /* @__PURE__ */ X(Tf, { ...e });
|
|
6633
|
+
case "file": return /* @__PURE__ */ X(kf, { ...e });
|
|
6634
|
+
case "checkbox": return /* @__PURE__ */ X(wf, { ...e });
|
|
6661
6635
|
default: throw Error("Invalid question type provided");
|
|
6662
6636
|
}
|
|
6663
|
-
},
|
|
6637
|
+
}, Vf = () => {
|
|
6664
6638
|
let { t: e } = R();
|
|
6665
6639
|
return /* @__PURE__ */ Z("div", {
|
|
6666
6640
|
className: "mt-8 ml-7 flex flex-row items-center gap-4",
|
|
@@ -6673,8 +6647,8 @@ var Rf = ({ index: e, option: t, onClick: n, onClickAction: r, onChangeLabel: i,
|
|
|
6673
6647
|
/* @__PURE__ */ X("div", { className: "h-px flex-1 bg-f1-border-secondary" })
|
|
6674
6648
|
]
|
|
6675
6649
|
});
|
|
6676
|
-
},
|
|
6677
|
-
let { isDragging: i, setIsDragging: a, setDraggedItemId: o, draggedItemId: s } =
|
|
6650
|
+
}, Hf = xc(({ item: e, section: t, showEndOfSection: n, className: r }) => {
|
|
6651
|
+
let { isDragging: i, setIsDragging: a, setDraggedItemId: o, draggedItemId: s } = of(), c = Ge(), { disabled: l, answering: u } = nf(), d = !!t && s === t.id, f = () => {
|
|
6678
6652
|
a(!0), o(e.question.id);
|
|
6679
6653
|
}, p = () => {
|
|
6680
6654
|
a(!1), o(null);
|
|
@@ -6704,12 +6678,12 @@ var Rf = ({ index: e, option: t, onClick: n, onClickAction: r, onChangeLabel: i,
|
|
|
6704
6678
|
icon: Ui,
|
|
6705
6679
|
size: "sm"
|
|
6706
6680
|
})
|
|
6707
|
-
}) : null, /* @__PURE__ */ X(
|
|
6681
|
+
}) : null, /* @__PURE__ */ X(Bf, { ...e.question })]
|
|
6708
6682
|
})
|
|
6709
|
-
}), n ? /* @__PURE__ */ X(
|
|
6683
|
+
}), n ? /* @__PURE__ */ X(Vf, {}) : null]
|
|
6710
6684
|
});
|
|
6711
|
-
}, (e, t) => e.showEndOfSection === t.showEndOfSection && e.className === t.className && (0,
|
|
6712
|
-
let { isDragging: t, setIsDragging: n, setDraggedItemId: r } =
|
|
6685
|
+
}, (e, t) => e.showEndOfSection === t.showEndOfSection && e.className === t.className && (0, gl.default)(e.section, t.section) && (0, gl.default)(e.item, t.item)), Uf = ({ question: e }) => {
|
|
6686
|
+
let { isDragging: t, setIsDragging: n, setDraggedItemId: r } = of(), i = Ge(), { disabled: a, answering: o, getSectionContainingQuestion: s } = nf(), c = s(e.id), l = () => {
|
|
6713
6687
|
n(!0), r(e.id);
|
|
6714
6688
|
}, u = () => {
|
|
6715
6689
|
n(!1), r(null);
|
|
@@ -6734,11 +6708,11 @@ var Rf = ({ index: e, option: t, onClick: n, onClickAction: r, onChangeLabel: i,
|
|
|
6734
6708
|
icon: Ui,
|
|
6735
6709
|
size: "sm"
|
|
6736
6710
|
})
|
|
6737
|
-
}) : null, /* @__PURE__ */ X(
|
|
6711
|
+
}) : null, /* @__PURE__ */ X(Bf, { ...e })]
|
|
6738
6712
|
})
|
|
6739
6713
|
});
|
|
6740
|
-
},
|
|
6741
|
-
let { onSectionChange: s, disabled: c, answering: l, deleteElement: u, onDuplicateElement: d, placeholders: f } =
|
|
6714
|
+
}, Wf = ({ id: e, title: t = "", description: n, lockedNote: r, questions: i = [], locked: a, hideQuestions: o }) => {
|
|
6715
|
+
let { onSectionChange: s, disabled: c, answering: l, deleteElement: u, onDuplicateElement: d, placeholders: f } = nf(), [p, m] = J(!1), { t: h } = R(), g = f?.sectionTitle ?? h("surveyFormBuilder.labels.sectionTitlePlaceholder"), _ = K(() => ({
|
|
6742
6716
|
id: e,
|
|
6743
6717
|
title: t,
|
|
6744
6718
|
description: n
|
|
@@ -6842,14 +6816,14 @@ var Rf = ({ index: e, option: t, onClick: n, onClickAction: r, onChangeLabel: i,
|
|
|
6842
6816
|
disabled: S,
|
|
6843
6817
|
className: B("w-full [field-sizing:content] resize-none text-f1-foreground-secondary placeholder:text-f1-foreground-tertiary disabled:text-f1-foreground-secondary [&::-webkit-search-cancel-button]:hidden", S && "cursor-not-allowed")
|
|
6844
6818
|
}) : null]
|
|
6845
|
-
}) : null, o ? null : /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X(
|
|
6819
|
+
}) : null, o ? null : /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X(af, { children: /* @__PURE__ */ X(cn, {
|
|
6846
6820
|
axis: "y",
|
|
6847
6821
|
values: i,
|
|
6848
6822
|
onReorder: b,
|
|
6849
6823
|
as: "div",
|
|
6850
6824
|
children: /* @__PURE__ */ X("div", {
|
|
6851
6825
|
className: "group/section-list flex flex-col gap-4",
|
|
6852
|
-
children: i.map((e) => /* @__PURE__ */ X(
|
|
6826
|
+
children: i.map((e) => /* @__PURE__ */ X(Uf, { question: e }, e.id))
|
|
6853
6827
|
})
|
|
6854
6828
|
}) }), l ? null : /* @__PURE__ */ Z("div", {
|
|
6855
6829
|
className: "mt-8 flex flex-row items-center gap-4",
|
|
@@ -6863,8 +6837,8 @@ var Rf = ({ index: e, option: t, onClick: n, onClickAction: r, onChangeLabel: i,
|
|
|
6863
6837
|
]
|
|
6864
6838
|
})] })]
|
|
6865
6839
|
});
|
|
6866
|
-
},
|
|
6867
|
-
let { isDragging: n, setIsDragging: r, setDraggedItemId: i, draggedItemId: a } =
|
|
6840
|
+
}, Gf = xc(({ item: e, className: t }) => {
|
|
6841
|
+
let { isDragging: n, setIsDragging: r, setDraggedItemId: i, draggedItemId: a } = of(), o = Ge(), { disabled: s, answering: c } = nf(), l = a === e.section.id;
|
|
6868
6842
|
return /* @__PURE__ */ X(Zt, {
|
|
6869
6843
|
value: e.id,
|
|
6870
6844
|
onDragStart: () => {
|
|
@@ -6896,25 +6870,25 @@ var Rf = ({ index: e, option: t, onClick: n, onClickAction: r, onChangeLabel: i,
|
|
|
6896
6870
|
icon: Ui,
|
|
6897
6871
|
size: "sm"
|
|
6898
6872
|
})
|
|
6899
|
-
}) : null, /* @__PURE__ */ X(
|
|
6873
|
+
}) : null, /* @__PURE__ */ X(Wf, {
|
|
6900
6874
|
...e.section,
|
|
6901
6875
|
hideQuestions: !0
|
|
6902
6876
|
})]
|
|
6903
6877
|
}), l && (e.section.questions ?? []).length > 0 ? /* @__PURE__ */ Z("div", {
|
|
6904
6878
|
className: "flex flex-col gap-4 w-full mt-4 ml-7",
|
|
6905
|
-
children: [(e.section.questions ?? []).map((e) => /* @__PURE__ */ X(
|
|
6879
|
+
children: [(e.section.questions ?? []).map((e) => /* @__PURE__ */ X(Bf, { ...e }, e.id)), /* @__PURE__ */ X(Vf, {})]
|
|
6906
6880
|
}) : null]
|
|
6907
6881
|
})
|
|
6908
6882
|
})
|
|
6909
6883
|
});
|
|
6910
|
-
}, (e, t) => e.className === t.className && (0,
|
|
6884
|
+
}, (e, t) => e.className === t.className && (0, gl.default)(e.item, t.item)), Kf = (e) => cf[e], qf = (e) => {
|
|
6911
6885
|
document.getElementById(e)?.scrollIntoView({
|
|
6912
6886
|
behavior: "smooth",
|
|
6913
6887
|
block: "start"
|
|
6914
6888
|
});
|
|
6915
|
-
},
|
|
6916
|
-
let { untitledSectionLabel: n, untitledQuestionLabel: r, duplicateQuestionLabel: i, deleteQuestionLabel: a, duplicateSectionLabel: o, deleteSectionLabel: s, questionOptionsLabel: c, requiredLabel: l, questionTypeLabel: u, singleSelectionLabel: d, multiSelectionLabel: f } = t, { deleteElement: p, onDuplicateElement: m, disabled: h, answering: g } =
|
|
6917
|
-
|
|
6889
|
+
}, Jf = (e, t) => {
|
|
6890
|
+
let { untitledSectionLabel: n, untitledQuestionLabel: r, duplicateQuestionLabel: i, deleteQuestionLabel: a, duplicateSectionLabel: o, deleteSectionLabel: s, questionOptionsLabel: c, requiredLabel: l, questionTypeLabel: u, singleSelectionLabel: d, multiSelectionLabel: f } = t, { deleteElement: p, onDuplicateElement: m, disabled: h, answering: g } = nf(), { getActionsForQuestion: _, questionTypes: v } = mf(), y = W((e) => {
|
|
6891
|
+
qf(e);
|
|
6918
6892
|
}, []), b = W((e, t, n) => {
|
|
6919
6893
|
let { question: r, currentRatingType: o, currentDatasetKey: s, disallowOptionalQuestions: p, handleChangeRequired: m, handleSelectQuestionType: h, handleSelectRatingType: g, handleDuplicate: y, handleDelete: b } = _(e, t, n), x = [{
|
|
6920
6894
|
type: "label",
|
|
@@ -6929,7 +6903,7 @@ var Rf = ({ index: e, option: t, onClick: n, onClickAction: r, onChangeLabel: i,
|
|
|
6929
6903
|
});
|
|
6930
6904
|
let S = v.filter((e) => !e.datasetKey), C = v.filter((e) => !!e.datasetKey), w = S.map((e) => {
|
|
6931
6905
|
if (e.questionType === "rating") {
|
|
6932
|
-
let t =
|
|
6906
|
+
let t = df.map((e) => ({
|
|
6933
6907
|
label: e.label,
|
|
6934
6908
|
onClick: () => g(e.value),
|
|
6935
6909
|
selected: o === e.value
|
|
@@ -6938,7 +6912,7 @@ var Rf = ({ index: e, option: t, onClick: n, onClickAction: r, onChangeLabel: i,
|
|
|
6938
6912
|
type: "submenu",
|
|
6939
6913
|
label: e.label,
|
|
6940
6914
|
icon: e.icon,
|
|
6941
|
-
selectedLabel: o ?
|
|
6915
|
+
selectedLabel: o ? df.find((e) => e.value === o)?.label : void 0,
|
|
6942
6916
|
children: t
|
|
6943
6917
|
};
|
|
6944
6918
|
}
|
|
@@ -7034,7 +7008,7 @@ var Rf = ({ index: e, option: t, onClick: n, onClickAction: r, onChangeLabel: i,
|
|
|
7034
7008
|
children: a.map((e) => ({
|
|
7035
7009
|
id: `co-creation-question-${e.id}`,
|
|
7036
7010
|
label: e.title || r,
|
|
7037
|
-
icon:
|
|
7011
|
+
icon: Kf(e.type),
|
|
7038
7012
|
onClick: y,
|
|
7039
7013
|
...!h && !g && !t.locked && { otherActions: b(e.id, e.type, !c) }
|
|
7040
7014
|
}))
|
|
@@ -7044,7 +7018,7 @@ var Rf = ({ index: e, option: t, onClick: n, onClickAction: r, onChangeLabel: i,
|
|
|
7044
7018
|
return {
|
|
7045
7019
|
id: `co-creation-question-${t.id}`,
|
|
7046
7020
|
label: t.title || r,
|
|
7047
|
-
icon:
|
|
7021
|
+
icon: Kf(t.type),
|
|
7048
7022
|
onClick: y,
|
|
7049
7023
|
...!h && !g && { otherActions: b(t.id, t.type, !0) }
|
|
7050
7024
|
};
|
|
@@ -7061,18 +7035,18 @@ var Rf = ({ index: e, option: t, onClick: n, onClickAction: r, onChangeLabel: i,
|
|
|
7061
7035
|
m,
|
|
7062
7036
|
p
|
|
7063
7037
|
]);
|
|
7064
|
-
},
|
|
7065
|
-
function
|
|
7038
|
+
}, Yf = "co-creation-section-", Xf = "co-creation-question-";
|
|
7039
|
+
function Zf(e, t) {
|
|
7066
7040
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
7067
7041
|
for (let e of t) if (e.type === "section") {
|
|
7068
7042
|
n.set(e.section.id, e.section);
|
|
7069
7043
|
for (let t of e.section.questions ?? []) r.set(t.id, t);
|
|
7070
7044
|
} else r.set(e.question.id, e.question);
|
|
7071
7045
|
let i = [], a = (e) => {
|
|
7072
|
-
if (e.id.startsWith(
|
|
7046
|
+
if (e.id.startsWith(Yf)) {
|
|
7073
7047
|
let t = e.id.slice(20), o = n.get(t);
|
|
7074
7048
|
if (!o) return;
|
|
7075
|
-
let s = (e.children ?? []).filter((e) => e.id.startsWith(
|
|
7049
|
+
let s = (e.children ?? []).filter((e) => e.id.startsWith(Xf)).map((e) => r.get(e.id.slice(21))).filter((e) => e != null);
|
|
7076
7050
|
i.push({
|
|
7077
7051
|
type: "section",
|
|
7078
7052
|
section: {
|
|
@@ -7080,8 +7054,8 @@ function Qf(e, t) {
|
|
|
7080
7054
|
questions: s
|
|
7081
7055
|
}
|
|
7082
7056
|
});
|
|
7083
|
-
for (let t of e.children ?? []) t.id.startsWith(
|
|
7084
|
-
} else if (e.id.startsWith(
|
|
7057
|
+
for (let t of e.children ?? []) t.id.startsWith(Yf) && a(t);
|
|
7058
|
+
} else if (e.id.startsWith(Xf)) {
|
|
7085
7059
|
let t = e.id.slice(21), n = r.get(t);
|
|
7086
7060
|
n && i.push({
|
|
7087
7061
|
type: "question",
|
|
@@ -7092,8 +7066,8 @@ function Qf(e, t) {
|
|
|
7092
7066
|
for (let t of e) a(t);
|
|
7093
7067
|
return i;
|
|
7094
7068
|
}
|
|
7095
|
-
var
|
|
7096
|
-
let { t: r } = R(), { disabled: i, labels: a } =
|
|
7069
|
+
var Qf = ({ elements: e, onChange: t, answering: n }) => {
|
|
7070
|
+
let { t: r } = R(), { disabled: i, labels: a } = nf(), { portalContainer: o } = Sc(Io), s = Jf(e, {
|
|
7097
7071
|
untitledSectionLabel: r("surveyFormBuilder.labels.sectionTitlePlaceholder"),
|
|
7098
7072
|
untitledQuestionLabel: r("surveyFormBuilder.labels.titlePlaceholder"),
|
|
7099
7073
|
duplicateQuestionLabel: a?.duplicateQuestion ?? r("surveyFormBuilder.actions.duplicateQuestion"),
|
|
@@ -7106,11 +7080,11 @@ var $f = ({ elements: e, onChange: t, answering: n }) => {
|
|
|
7106
7080
|
singleSelectionLabel: r("surveyFormBuilder.labels.singleSelection"),
|
|
7107
7081
|
multiSelectionLabel: r("surveyFormBuilder.labels.multiSelection")
|
|
7108
7082
|
}), c = W((n) => {
|
|
7109
|
-
t(
|
|
7083
|
+
t(Zf(n, e));
|
|
7110
7084
|
}, [e, t]);
|
|
7111
7085
|
return /* @__PURE__ */ X("div", {
|
|
7112
7086
|
className: "sticky left-0 top-1/2 z-10 hidden h-0 -translate-y-12 px-2 @3xl:block",
|
|
7113
|
-
children: /* @__PURE__ */ X(
|
|
7087
|
+
children: /* @__PURE__ */ X(Ld, {
|
|
7114
7088
|
items: s,
|
|
7115
7089
|
barsAlign: "left",
|
|
7116
7090
|
size: "md",
|
|
@@ -7124,7 +7098,7 @@ var $f = ({ elements: e, onChange: t, answering: n }) => {
|
|
|
7124
7098
|
};
|
|
7125
7099
|
//#endregion
|
|
7126
7100
|
//#region src/domains/talent/surveys/surveys/SurveyFormBuilder/Form/useReorderHandler.ts
|
|
7127
|
-
function
|
|
7101
|
+
function $f({ flatItems: e, onChange: t }) {
|
|
7128
7102
|
let [n, r] = J(null), [i, a] = J(!1);
|
|
7129
7103
|
return {
|
|
7130
7104
|
handleFlatReorder: W((n) => {
|
|
@@ -7156,7 +7130,7 @@ function ep({ flatItems: e, onChange: t }) {
|
|
|
7156
7130
|
} else g = s;
|
|
7157
7131
|
let _ = /* @__PURE__ */ new Set();
|
|
7158
7132
|
for (let e of c.values()) for (let t of e) _.add(t);
|
|
7159
|
-
let v =
|
|
7133
|
+
let v = Hd(g, _);
|
|
7160
7134
|
if (l.size > 0) {
|
|
7161
7135
|
let e = null;
|
|
7162
7136
|
for (let t of v) if (t.type === "section-header") e = t.id;
|
|
@@ -7169,7 +7143,7 @@ function ep({ flatItems: e, onChange: t }) {
|
|
|
7169
7143
|
if (n === -1) return !1;
|
|
7170
7144
|
let r = v[n + 1];
|
|
7171
7145
|
return !r || r.type !== "question";
|
|
7172
|
-
}) ? (r(v), a(!0)) : t(
|
|
7146
|
+
}) ? (r(v), a(!0)) : t(Vd(v));
|
|
7173
7147
|
}, [t, e]),
|
|
7174
7148
|
handleConfirmLastQuestionMove: W(() => {
|
|
7175
7149
|
if (n) {
|
|
@@ -7181,7 +7155,7 @@ function ep({ flatItems: e, onChange: t }) {
|
|
|
7181
7155
|
(!i || i.type === "section-end" || i.type === "section-header") && e.add(r.section.id);
|
|
7182
7156
|
}
|
|
7183
7157
|
}
|
|
7184
|
-
t(
|
|
7158
|
+
t(Vd(n.filter((t) => !(t.type === "section-header" && e.has(t.section.id) || t.type === "section-end" && e.has(t.sectionId)))));
|
|
7185
7159
|
}
|
|
7186
7160
|
a(!1), r(null);
|
|
7187
7161
|
}, [n, t]),
|
|
@@ -7193,35 +7167,35 @@ function ep({ flatItems: e, onChange: t }) {
|
|
|
7193
7167
|
}
|
|
7194
7168
|
//#endregion
|
|
7195
7169
|
//#region src/domains/talent/surveys/surveys/SurveyFormBuilder/Form/Form.tsx
|
|
7196
|
-
function
|
|
7197
|
-
let { isDragging: t } =
|
|
7170
|
+
function ep({ children: e }) {
|
|
7171
|
+
let { isDragging: t } = of();
|
|
7198
7172
|
return /* @__PURE__ */ X("div", {
|
|
7199
7173
|
className: B("relative @container", t && "select-none"),
|
|
7200
7174
|
children: e
|
|
7201
7175
|
});
|
|
7202
7176
|
}
|
|
7203
|
-
var
|
|
7177
|
+
var tp = (e, t, n) => {
|
|
7204
7178
|
let r = [e[t]], i = t + 1;
|
|
7205
7179
|
for (; i < e.length && e[i].type === "question" && n.has(e[i].id);) r.push(e[i]), i++;
|
|
7206
7180
|
return r;
|
|
7207
|
-
},
|
|
7181
|
+
}, np = ({ items: e, first: t, sectionByQuestionId: n }) => /* @__PURE__ */ X("div", {
|
|
7208
7182
|
className: B("rounded-2xl bg-f1-background-secondary pb-8 pt-4", t ? "" : "mt-8"),
|
|
7209
|
-
children: e.map((e, t) => e.type === "section-header" ? /* @__PURE__ */ X(
|
|
7183
|
+
children: e.map((e, t) => e.type === "section-header" ? /* @__PURE__ */ X(Gf, {
|
|
7210
7184
|
item: e,
|
|
7211
7185
|
className: ""
|
|
7212
|
-
}, e.id) : e.type === "question" ? /* @__PURE__ */ X(
|
|
7186
|
+
}, e.id) : e.type === "question" ? /* @__PURE__ */ X(Hf, {
|
|
7213
7187
|
item: e,
|
|
7214
7188
|
section: n.get(e.question.id),
|
|
7215
7189
|
showEndOfSection: !1,
|
|
7216
7190
|
className: t === 1 ? "mt-2" : "mt-4"
|
|
7217
7191
|
}, e.id) : null)
|
|
7218
|
-
}),
|
|
7192
|
+
}), rp = ({ items: e, lockedSectionIds: t, inSectionQuestionIds: n, sectionEndIds: r, sectionByQuestionId: i }) => {
|
|
7219
7193
|
let a = [], o = 0;
|
|
7220
7194
|
for (; o < e.length;) {
|
|
7221
7195
|
let s = e[o];
|
|
7222
7196
|
if (s.type === "section-header" && t.has(s.section.id)) {
|
|
7223
|
-
let t =
|
|
7224
|
-
a.push(/* @__PURE__ */ X(
|
|
7197
|
+
let t = tp(e, o, n);
|
|
7198
|
+
a.push(/* @__PURE__ */ X(np, {
|
|
7225
7199
|
items: t,
|
|
7226
7200
|
first: o === 0,
|
|
7227
7201
|
sectionByQuestionId: i
|
|
@@ -7229,10 +7203,10 @@ var np = (e, t, n) => {
|
|
|
7229
7203
|
continue;
|
|
7230
7204
|
}
|
|
7231
7205
|
let c = o === 0 ? "" : n.has(s.id) ? "mt-4" : "mt-8";
|
|
7232
|
-
s.type === "section-header" ? a.push(/* @__PURE__ */ X(
|
|
7206
|
+
s.type === "section-header" ? a.push(/* @__PURE__ */ X(Gf, {
|
|
7233
7207
|
item: s,
|
|
7234
7208
|
className: c
|
|
7235
|
-
}, s.id)) : s.type === "question" && a.push(/* @__PURE__ */ X(
|
|
7209
|
+
}, s.id)) : s.type === "question" && a.push(/* @__PURE__ */ X(Hf, {
|
|
7236
7210
|
item: s,
|
|
7237
7211
|
section: i.get(s.question.id),
|
|
7238
7212
|
showEndOfSection: r.has(s.id),
|
|
@@ -7240,7 +7214,7 @@ var np = (e, t, n) => {
|
|
|
7240
7214
|
}, s.id)), o++;
|
|
7241
7215
|
}
|
|
7242
7216
|
return /* @__PURE__ */ X(Y, { children: a });
|
|
7243
|
-
},
|
|
7217
|
+
}, ip = L(({ elements: e, disabled: t, onChange: n, disallowOptionalQuestions: r, allowedQuestionTypes: i, applyingChanges: a, useUpload: o, datasets: s, placeholders: c, labels: l, skipDefaultSection: u }) => {
|
|
7244
7218
|
let d = !t, f = K(() => e.map((e) => e.type === "question" ? {
|
|
7245
7219
|
...e,
|
|
7246
7220
|
question: {
|
|
@@ -7256,7 +7230,7 @@ var np = (e, t, n) => {
|
|
|
7256
7230
|
required: r ? !0 : e.required
|
|
7257
7231
|
}))
|
|
7258
7232
|
}
|
|
7259
|
-
} : e), [e, r]), p = K(() =>
|
|
7233
|
+
} : e), [e, r]), p = K(() => zd(f), [f]), m = K(() => p.filter((e) => e.type !== "section-end"), [p]), h = K(() => m.map((e) => e.id), [m]), g = K(() => Ud(f), [f]), _ = K(() => Bd(f), [f]), v = K(() => {
|
|
7260
7234
|
let e = /* @__PURE__ */ new Set();
|
|
7261
7235
|
for (let t of f) if (t.type === "section") for (let n of t.section.questions ?? []) e.add(`question-${n.id}`);
|
|
7262
7236
|
return e;
|
|
@@ -7264,7 +7238,7 @@ var np = (e, t, n) => {
|
|
|
7264
7238
|
let e = /* @__PURE__ */ new Set();
|
|
7265
7239
|
for (let t of f) t.type === "section" && t.section.locked && e.add(t.section.id);
|
|
7266
7240
|
return e;
|
|
7267
|
-
}, [f]), { handleFlatReorder: b, handleConfirmLastQuestionMove: x, handleCancelLastQuestionMove: S, lastQuestionDialogOpen: C } =
|
|
7241
|
+
}, [f]), { handleFlatReorder: b, handleConfirmLastQuestionMove: x, handleCancelLastQuestionMove: S, lastQuestionDialogOpen: C } = $f({
|
|
7268
7242
|
flatItems: p,
|
|
7269
7243
|
onChange: n
|
|
7270
7244
|
});
|
|
@@ -7275,7 +7249,7 @@ var np = (e, t, n) => {
|
|
|
7275
7249
|
}
|
|
7276
7250
|
}, [a]);
|
|
7277
7251
|
let w = !!f.length;
|
|
7278
|
-
return /* @__PURE__ */ Z(
|
|
7252
|
+
return /* @__PURE__ */ Z(tf, {
|
|
7279
7253
|
disabled: t,
|
|
7280
7254
|
elements: f,
|
|
7281
7255
|
onChange: n,
|
|
@@ -7286,7 +7260,7 @@ var np = (e, t, n) => {
|
|
|
7286
7260
|
placeholders: c,
|
|
7287
7261
|
labels: l,
|
|
7288
7262
|
skipDefaultSection: u,
|
|
7289
|
-
children: [/* @__PURE__ */ X(
|
|
7263
|
+
children: [/* @__PURE__ */ X(af, { children: /* @__PURE__ */ Z(ep, { children: [w ? /* @__PURE__ */ X(Qf, {
|
|
7290
7264
|
elements: f,
|
|
7291
7265
|
onChange: n
|
|
7292
7266
|
}) : null, /* @__PURE__ */ Z("div", {
|
|
@@ -7303,7 +7277,7 @@ var np = (e, t, n) => {
|
|
|
7303
7277
|
as: "div",
|
|
7304
7278
|
children: /* @__PURE__ */ X("div", {
|
|
7305
7279
|
className: "flex flex-col",
|
|
7306
|
-
children: /* @__PURE__ */ X(
|
|
7280
|
+
children: /* @__PURE__ */ X(rp, {
|
|
7307
7281
|
items: m,
|
|
7308
7282
|
lockedSectionIds: y,
|
|
7309
7283
|
inSectionQuestionIds: v,
|
|
@@ -7311,7 +7285,7 @@ var np = (e, t, n) => {
|
|
|
7311
7285
|
sectionByQuestionId: _
|
|
7312
7286
|
})
|
|
7313
7287
|
})
|
|
7314
|
-
}), d ? /* @__PURE__ */ X(
|
|
7288
|
+
}), d ? /* @__PURE__ */ X(lf, {}) : null]
|
|
7315
7289
|
}), a ? /* @__PURE__ */ X(qn.div, {
|
|
7316
7290
|
className: "sticky bottom-1/2 left-0 z-50 flex w-full items-center justify-center",
|
|
7317
7291
|
initial: {
|
|
@@ -7326,9 +7300,9 @@ var np = (e, t, n) => {
|
|
|
7326
7300
|
opacity: 0,
|
|
7327
7301
|
scale: .95
|
|
7328
7302
|
},
|
|
7329
|
-
children: /* @__PURE__ */ X(
|
|
7303
|
+
children: /* @__PURE__ */ X(Gd, {})
|
|
7330
7304
|
}) : null]
|
|
7331
|
-
})] }) }), /* @__PURE__ */ X(
|
|
7305
|
+
})] }) }), /* @__PURE__ */ X(uf, {
|
|
7332
7306
|
open: C,
|
|
7333
7307
|
onConfirm: x,
|
|
7334
7308
|
onCancel: S
|
|
@@ -7337,7 +7311,7 @@ var np = (e, t, n) => {
|
|
|
7337
7311
|
});
|
|
7338
7312
|
//#endregion
|
|
7339
7313
|
//#region src/domains/talent/surveys/surveys/SurveyAnsweringForm/components/skeletons/SurveyAnsweringFormLoadingSkeletons.tsx
|
|
7340
|
-
function
|
|
7314
|
+
function ap({ titleWidth: e, descriptionWidth: t, answer: n }) {
|
|
7341
7315
|
return /* @__PURE__ */ Z("div", {
|
|
7342
7316
|
className: "flex flex-col gap-4 rounded-xl border border-solid border-f1-border-secondary bg-f1-background p-4",
|
|
7343
7317
|
children: [/* @__PURE__ */ Z("div", {
|
|
@@ -7352,14 +7326,14 @@ function op({ titleWidth: e, descriptionWidth: t, answer: n }) {
|
|
|
7352
7326
|
}), n]
|
|
7353
7327
|
});
|
|
7354
7328
|
}
|
|
7355
|
-
var
|
|
7356
|
-
function
|
|
7329
|
+
var op = /* @__PURE__ */ X(z, { className: "h-10 w-full rounded-sm" }), sp = /* @__PURE__ */ X(z, { className: "h-24 w-full rounded-sm" }), cp = /* @__PURE__ */ X(z, { className: "h-10 w-56 max-w-full rounded-sm" });
|
|
7330
|
+
function lp() {
|
|
7357
7331
|
return /* @__PURE__ */ X("div", {
|
|
7358
7332
|
className: "grid grid-cols-5 gap-2 sm:max-w-80",
|
|
7359
7333
|
children: Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ X(z, { className: "h-9 rounded-sm" }, t))
|
|
7360
7334
|
});
|
|
7361
7335
|
}
|
|
7362
|
-
function
|
|
7336
|
+
function up({ count: e }) {
|
|
7363
7337
|
return /* @__PURE__ */ X("div", {
|
|
7364
7338
|
className: "flex flex-col gap-2",
|
|
7365
7339
|
children: Array.from({ length: e }).map((e, t) => /* @__PURE__ */ X(z, {
|
|
@@ -7368,7 +7342,7 @@ function dp({ count: e }) {
|
|
|
7368
7342
|
}, t))
|
|
7369
7343
|
});
|
|
7370
7344
|
}
|
|
7371
|
-
function
|
|
7345
|
+
function dp() {
|
|
7372
7346
|
return /* @__PURE__ */ X("div", {
|
|
7373
7347
|
className: "flex flex-wrap gap-2",
|
|
7374
7348
|
children: Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ X(z, {
|
|
@@ -7377,7 +7351,7 @@ function fp() {
|
|
|
7377
7351
|
}, t))
|
|
7378
7352
|
});
|
|
7379
7353
|
}
|
|
7380
|
-
function
|
|
7354
|
+
function fp() {
|
|
7381
7355
|
return /* @__PURE__ */ X("div", {
|
|
7382
7356
|
className: "flex w-full flex-col gap-10",
|
|
7383
7357
|
"data-testid": "survey-answering-form-loading-all-questions",
|
|
@@ -7391,63 +7365,63 @@ function pp() {
|
|
|
7391
7365
|
}), /* @__PURE__ */ X("div", {
|
|
7392
7366
|
className: "flex flex-col gap-4",
|
|
7393
7367
|
children: e === 0 ? /* @__PURE__ */ Z(Y, { children: [
|
|
7394
|
-
/* @__PURE__ */ X(
|
|
7368
|
+
/* @__PURE__ */ X(ap, {
|
|
7395
7369
|
titleWidth: "65%",
|
|
7396
7370
|
descriptionWidth: "42%",
|
|
7397
|
-
answer:
|
|
7371
|
+
answer: op
|
|
7398
7372
|
}),
|
|
7399
|
-
/* @__PURE__ */ X(
|
|
7373
|
+
/* @__PURE__ */ X(ap, {
|
|
7400
7374
|
titleWidth: "70%",
|
|
7401
7375
|
descriptionWidth: "55%",
|
|
7402
|
-
answer:
|
|
7376
|
+
answer: sp
|
|
7403
7377
|
}),
|
|
7404
|
-
/* @__PURE__ */ X(
|
|
7378
|
+
/* @__PURE__ */ X(ap, {
|
|
7405
7379
|
titleWidth: "58%",
|
|
7406
7380
|
descriptionWidth: "38%",
|
|
7407
|
-
answer: /* @__PURE__ */ X(
|
|
7381
|
+
answer: /* @__PURE__ */ X(lp, {})
|
|
7408
7382
|
}),
|
|
7409
|
-
/* @__PURE__ */ X(
|
|
7383
|
+
/* @__PURE__ */ X(ap, {
|
|
7410
7384
|
titleWidth: "62%",
|
|
7411
7385
|
descriptionWidth: "46%",
|
|
7412
|
-
answer: /* @__PURE__ */ X(
|
|
7386
|
+
answer: /* @__PURE__ */ X(up, { count: 4 })
|
|
7413
7387
|
}),
|
|
7414
|
-
/* @__PURE__ */ X(
|
|
7388
|
+
/* @__PURE__ */ X(ap, {
|
|
7415
7389
|
titleWidth: "54%",
|
|
7416
7390
|
descriptionWidth: "44%",
|
|
7417
|
-
answer:
|
|
7391
|
+
answer: op
|
|
7418
7392
|
})
|
|
7419
7393
|
] }) : /* @__PURE__ */ Z(Y, { children: [
|
|
7420
|
-
/* @__PURE__ */ X(
|
|
7394
|
+
/* @__PURE__ */ X(ap, {
|
|
7421
7395
|
titleWidth: "60%",
|
|
7422
7396
|
descriptionWidth: "50%",
|
|
7423
|
-
answer:
|
|
7397
|
+
answer: cp
|
|
7424
7398
|
}),
|
|
7425
|
-
/* @__PURE__ */ X(
|
|
7399
|
+
/* @__PURE__ */ X(ap, {
|
|
7426
7400
|
titleWidth: "66%",
|
|
7427
7401
|
descriptionWidth: "45%",
|
|
7428
|
-
answer:
|
|
7402
|
+
answer: op
|
|
7429
7403
|
}),
|
|
7430
|
-
/* @__PURE__ */ X(
|
|
7404
|
+
/* @__PURE__ */ X(ap, {
|
|
7431
7405
|
titleWidth: "57%",
|
|
7432
7406
|
descriptionWidth: "48%",
|
|
7433
|
-
answer: /* @__PURE__ */ X(
|
|
7407
|
+
answer: /* @__PURE__ */ X(dp, {})
|
|
7434
7408
|
}),
|
|
7435
|
-
/* @__PURE__ */ X(
|
|
7409
|
+
/* @__PURE__ */ X(ap, {
|
|
7436
7410
|
titleWidth: "64%",
|
|
7437
7411
|
descriptionWidth: "36%",
|
|
7438
|
-
answer: /* @__PURE__ */ X(
|
|
7412
|
+
answer: /* @__PURE__ */ X(up, { count: 3 })
|
|
7439
7413
|
}),
|
|
7440
|
-
/* @__PURE__ */ X(
|
|
7414
|
+
/* @__PURE__ */ X(ap, {
|
|
7441
7415
|
titleWidth: "52%",
|
|
7442
7416
|
descriptionWidth: "40%",
|
|
7443
|
-
answer:
|
|
7417
|
+
answer: sp
|
|
7444
7418
|
})
|
|
7445
7419
|
] })
|
|
7446
7420
|
})]
|
|
7447
7421
|
}, e))
|
|
7448
7422
|
});
|
|
7449
7423
|
}
|
|
7450
|
-
function
|
|
7424
|
+
function pp() {
|
|
7451
7425
|
return /* @__PURE__ */ Z("div", {
|
|
7452
7426
|
className: "flex w-full flex-col gap-6",
|
|
7453
7427
|
"data-testid": "survey-answering-form-loading-stepped",
|
|
@@ -7456,16 +7430,16 @@ function mp() {
|
|
|
7456
7430
|
children: [/* @__PURE__ */ Z("div", {
|
|
7457
7431
|
className: "flex flex-col gap-2 px-5",
|
|
7458
7432
|
children: [/* @__PURE__ */ X(z, { className: "h-6 w-52 rounded-sm" }), /* @__PURE__ */ X(z, { className: "h-4 w-72 max-w-full rounded-sm" })]
|
|
7459
|
-
}), /* @__PURE__ */ X(
|
|
7433
|
+
}), /* @__PURE__ */ X(ap, {
|
|
7460
7434
|
titleWidth: "74%",
|
|
7461
7435
|
descriptionWidth: "50%",
|
|
7462
|
-
answer:
|
|
7436
|
+
answer: op
|
|
7463
7437
|
})]
|
|
7464
7438
|
});
|
|
7465
7439
|
}
|
|
7466
7440
|
//#endregion
|
|
7467
7441
|
//#region src/domains/talent/surveys/surveys/SurveyAnsweringForm/hooks/useStepper.ts
|
|
7468
|
-
function
|
|
7442
|
+
function mp(e) {
|
|
7469
7443
|
let [t, n] = J(0), [r, i] = J(null), a = e.length, o = a > 0 ? t / a * 100 : 0;
|
|
7470
7444
|
return {
|
|
7471
7445
|
currentStep: t,
|
|
@@ -7490,7 +7464,7 @@ function hp(e) {
|
|
|
7490
7464
|
}
|
|
7491
7465
|
//#endregion
|
|
7492
7466
|
//#region src/domains/talent/surveys/surveys/SurveyAnsweringForm/components/RatingQuestionField.tsx
|
|
7493
|
-
function
|
|
7467
|
+
function hp({ value: e, onChange: t, onBlur: n, config: r }) {
|
|
7494
7468
|
let { options: i, minLabel: a, maxLabel: o, disabled: s } = r, c = !!(a || o), l = (e) => {
|
|
7495
7469
|
s || (t(e), n());
|
|
7496
7470
|
};
|
|
@@ -7506,7 +7480,7 @@ function gp({ value: e, onChange: t, onBlur: n, config: r }) {
|
|
|
7506
7480
|
children: t.label
|
|
7507
7481
|
})
|
|
7508
7482
|
}, t.value))
|
|
7509
|
-
}), /* @__PURE__ */ X(
|
|
7483
|
+
}), /* @__PURE__ */ X(Nf, {
|
|
7510
7484
|
minLabel: a,
|
|
7511
7485
|
maxLabel: o
|
|
7512
7486
|
})]
|
|
@@ -7514,14 +7488,14 @@ function gp({ value: e, onChange: t, onBlur: n, config: r }) {
|
|
|
7514
7488
|
}
|
|
7515
7489
|
//#endregion
|
|
7516
7490
|
//#region src/domains/talent/surveys/surveys/SurveyAnsweringForm/components/SelectQuestionField.tsx
|
|
7517
|
-
function
|
|
7491
|
+
function gp({ checked: e }) {
|
|
7518
7492
|
return /* @__PURE__ */ X("div", {
|
|
7519
7493
|
"aria-hidden": "true",
|
|
7520
7494
|
className: B("flex h-5 w-5 shrink-0 items-center justify-center rounded-full transition-colors", e ? "bg-f1-background-selected-bold" : "border border-solid border-f1-border bg-f1-background"),
|
|
7521
7495
|
children: e ? /* @__PURE__ */ X("div", { className: "h-2 w-2 rounded-full bg-f1-background" }) : null
|
|
7522
7496
|
});
|
|
7523
7497
|
}
|
|
7524
|
-
function
|
|
7498
|
+
function _p({ value: e, onChange: t, onBlur: n, config: r }) {
|
|
7525
7499
|
let { options: i, type: a, required: o, disabled: s, showAnswerValidation: c } = r, l = i.some((e) => e.correct), u = !!c && l, d = (r) => {
|
|
7526
7500
|
s || a === "select" && (t(!o && e === r ? void 0 : r), n());
|
|
7527
7501
|
}, f = (r) => {
|
|
@@ -7546,7 +7520,7 @@ function vp({ value: e, onChange: t, onBlur: n, config: r }) {
|
|
|
7546
7520
|
checked: !!n,
|
|
7547
7521
|
onCheckedChange: () => f(t.value),
|
|
7548
7522
|
hideLabel: !0
|
|
7549
|
-
}) : /* @__PURE__ */ X(
|
|
7523
|
+
}) : /* @__PURE__ */ X(gp, { checked: !!n }),
|
|
7550
7524
|
/* @__PURE__ */ X("p", {
|
|
7551
7525
|
className: "flex-1 font-medium",
|
|
7552
7526
|
children: t.label
|
|
@@ -7566,7 +7540,7 @@ function vp({ value: e, onChange: t, onBlur: n, config: r }) {
|
|
|
7566
7540
|
}
|
|
7567
7541
|
//#endregion
|
|
7568
7542
|
//#region src/domains/talent/surveys/surveys/SurveyAnsweringForm/hooks/useSurveyFormSchema.tsx
|
|
7569
|
-
var
|
|
7543
|
+
var vp = /^(https?:\/\/)?[\w.-]+\.[a-z]{2,}(:\d+)?(\/[^\s]*)?$/i, yp = () => ({
|
|
7570
7544
|
upload: async (e) => ({
|
|
7571
7545
|
type: "success",
|
|
7572
7546
|
value: `local-${e.name}-${Date.now()}`
|
|
@@ -7575,7 +7549,7 @@ var yp = /^(https?:\/\/)?[\w.-]+\.[a-z]{2,}(:\d+)?(\/[^\s]*)?$/i, bp = () => ({
|
|
|
7575
7549
|
progress: 0,
|
|
7576
7550
|
status: "idle"
|
|
7577
7551
|
});
|
|
7578
|
-
function
|
|
7552
|
+
function bp(e, t) {
|
|
7579
7553
|
return Zr().optional().superRefine((n, r) => {
|
|
7580
7554
|
e && (!n || n.trim() === "") && r.addIssue({
|
|
7581
7555
|
code: "custom",
|
|
@@ -7583,18 +7557,18 @@ function xp(e, t) {
|
|
|
7583
7557
|
});
|
|
7584
7558
|
});
|
|
7585
7559
|
}
|
|
7586
|
-
function
|
|
7560
|
+
function xp(e, t) {
|
|
7587
7561
|
return Zr().optional().superRefine((n, r) => {
|
|
7588
7562
|
e && (!n || n.trim() === "") ? r.addIssue({
|
|
7589
7563
|
code: "custom",
|
|
7590
7564
|
message: t("forms.validation.required")
|
|
7591
|
-
}) : n && !
|
|
7565
|
+
}) : n && !vp.test(n) && r.addIssue({
|
|
7592
7566
|
code: "custom",
|
|
7593
7567
|
message: t("surveyFormBuilder.answer.invalidUrl")
|
|
7594
7568
|
});
|
|
7595
7569
|
});
|
|
7596
7570
|
}
|
|
7597
|
-
function
|
|
7571
|
+
function Sp(e, t) {
|
|
7598
7572
|
return xr().optional().superRefine((n, r) => {
|
|
7599
7573
|
e && n == null && r.addIssue({
|
|
7600
7574
|
code: "custom",
|
|
@@ -7602,7 +7576,7 @@ function Cp(e, t) {
|
|
|
7602
7576
|
});
|
|
7603
7577
|
});
|
|
7604
7578
|
}
|
|
7605
|
-
function
|
|
7579
|
+
function Cp(e, t) {
|
|
7606
7580
|
return mr(Zr()).optional().superRefine((n, r) => {
|
|
7607
7581
|
e && (!n || n.length === 0) && r.addIssue({
|
|
7608
7582
|
code: "custom",
|
|
@@ -7610,7 +7584,7 @@ function wp(e, t) {
|
|
|
7610
7584
|
});
|
|
7611
7585
|
});
|
|
7612
7586
|
}
|
|
7613
|
-
function
|
|
7587
|
+
function wp(e, t) {
|
|
7614
7588
|
return di().optional().superRefine((n, r) => {
|
|
7615
7589
|
e && !n && r.addIssue({
|
|
7616
7590
|
code: "custom",
|
|
@@ -7618,8 +7592,8 @@ function Tp(e, t) {
|
|
|
7618
7592
|
});
|
|
7619
7593
|
});
|
|
7620
7594
|
}
|
|
7621
|
-
var
|
|
7622
|
-
function
|
|
7595
|
+
var Tp = Cp;
|
|
7596
|
+
function Ep(e, t) {
|
|
7623
7597
|
return ta().optional().superRefine((n, r) => {
|
|
7624
7598
|
e && !n && r.addIssue({
|
|
7625
7599
|
code: "custom",
|
|
@@ -7627,14 +7601,14 @@ function Dp(e, t) {
|
|
|
7627
7601
|
});
|
|
7628
7602
|
});
|
|
7629
7603
|
}
|
|
7630
|
-
function
|
|
7604
|
+
function Dp(e, t) {
|
|
7631
7605
|
let n = t?.[e.id];
|
|
7632
7606
|
if (n) return n.value;
|
|
7633
7607
|
if (e.type === "multi-select" || e.type === "dropdown-multi") return [];
|
|
7634
7608
|
let r = e;
|
|
7635
7609
|
return r.value !== void 0 && r.value !== null ? r.value : null;
|
|
7636
7610
|
}
|
|
7637
|
-
function
|
|
7611
|
+
function Op(e) {
|
|
7638
7612
|
let t = [];
|
|
7639
7613
|
for (let n of e) if (n.type === "section") for (let e of n.section.questions ?? []) t.push({
|
|
7640
7614
|
id: e.id,
|
|
@@ -7650,10 +7624,10 @@ function kp(e) {
|
|
|
7650
7624
|
});
|
|
7651
7625
|
return t;
|
|
7652
7626
|
}
|
|
7653
|
-
var
|
|
7654
|
-
e(n), t?.(
|
|
7627
|
+
var kp = (e) => e != null && e !== "", Ap = (e, t) => (n) => {
|
|
7628
|
+
e(n), t?.(kp(n));
|
|
7655
7629
|
};
|
|
7656
|
-
function
|
|
7630
|
+
function jp({ q: e, t, sectionId: n, previewMode: r = !1, disableFields: i = r, formUseUpload: a, datasets: o, onSingleAnswerChange: s }) {
|
|
7657
7631
|
let c = e.title ?? "", l = {
|
|
7658
7632
|
label: c,
|
|
7659
7633
|
section: n
|
|
@@ -7673,14 +7647,14 @@ function Mp({ q: e, t, sectionId: n, previewMode: r = !1, disableFields: i = r,
|
|
|
7673
7647
|
placeholder: t("surveyFormBuilder.answer.textPlaceholder"),
|
|
7674
7648
|
disabled: i
|
|
7675
7649
|
};
|
|
7676
|
-
return Li(
|
|
7650
|
+
return Li(bp(!!e.required, t), {
|
|
7677
7651
|
...l,
|
|
7678
7652
|
fieldType: "custom",
|
|
7679
|
-
render: ({ value: e, onChange: t, onBlur: r, error: i }) => /* @__PURE__ */ X(
|
|
7653
|
+
render: ({ value: e, onChange: t, onBlur: r, error: i }) => /* @__PURE__ */ X(Sf, {
|
|
7680
7654
|
...u,
|
|
7681
7655
|
children: /* @__PURE__ */ X("div", {
|
|
7682
7656
|
className: "px-0.5",
|
|
7683
|
-
children: /* @__PURE__ */ X(
|
|
7657
|
+
children: /* @__PURE__ */ X(Iu, {
|
|
7684
7658
|
field: n,
|
|
7685
7659
|
value: e ?? "",
|
|
7686
7660
|
onChange: t,
|
|
@@ -7701,14 +7675,14 @@ function Mp({ q: e, t, sectionId: n, previewMode: r = !1, disableFields: i = r,
|
|
|
7701
7675
|
rows: 4,
|
|
7702
7676
|
disabled: i
|
|
7703
7677
|
};
|
|
7704
|
-
return Li(
|
|
7678
|
+
return Li(bp(!!e.required, t), {
|
|
7705
7679
|
...l,
|
|
7706
7680
|
fieldType: "custom",
|
|
7707
|
-
render: ({ value: e, onChange: t, onBlur: r, error: i }) => /* @__PURE__ */ X(
|
|
7681
|
+
render: ({ value: e, onChange: t, onBlur: r, error: i }) => /* @__PURE__ */ X(Sf, {
|
|
7708
7682
|
...u,
|
|
7709
7683
|
children: /* @__PURE__ */ X("div", {
|
|
7710
7684
|
className: "px-0.5",
|
|
7711
|
-
children: /* @__PURE__ */ X(
|
|
7685
|
+
children: /* @__PURE__ */ X(Iu, {
|
|
7712
7686
|
field: n,
|
|
7713
7687
|
value: e ?? "",
|
|
7714
7688
|
onChange: t,
|
|
@@ -7728,14 +7702,14 @@ function Mp({ q: e, t, sectionId: n, previewMode: r = !1, disableFields: i = r,
|
|
|
7728
7702
|
placeholder: t("surveyFormBuilder.answer.numericPlaceholder"),
|
|
7729
7703
|
disabled: i
|
|
7730
7704
|
};
|
|
7731
|
-
return Li(
|
|
7705
|
+
return Li(Sp(!!e.required, t), {
|
|
7732
7706
|
...l,
|
|
7733
7707
|
fieldType: "custom",
|
|
7734
|
-
render: ({ value: e, onChange: t, onBlur: r, error: i }) => /* @__PURE__ */ X(
|
|
7708
|
+
render: ({ value: e, onChange: t, onBlur: r, error: i }) => /* @__PURE__ */ X(Sf, {
|
|
7735
7709
|
...u,
|
|
7736
7710
|
children: /* @__PURE__ */ X("div", {
|
|
7737
7711
|
className: "px-0.5",
|
|
7738
|
-
children: /* @__PURE__ */ X(
|
|
7712
|
+
children: /* @__PURE__ */ X(Iu, {
|
|
7739
7713
|
field: n,
|
|
7740
7714
|
value: e,
|
|
7741
7715
|
onChange: t,
|
|
@@ -7756,14 +7730,14 @@ function Mp({ q: e, t, sectionId: n, previewMode: r = !1, disableFields: i = r,
|
|
|
7756
7730
|
placeholder: t("surveyFormBuilder.answer.linkPlaceholder"),
|
|
7757
7731
|
disabled: i
|
|
7758
7732
|
};
|
|
7759
|
-
return Li(
|
|
7733
|
+
return Li(xp(!!e.required, t), {
|
|
7760
7734
|
...l,
|
|
7761
7735
|
fieldType: "custom",
|
|
7762
|
-
render: ({ value: e, onChange: t, onBlur: r, error: i }) => /* @__PURE__ */ X(
|
|
7736
|
+
render: ({ value: e, onChange: t, onBlur: r, error: i }) => /* @__PURE__ */ X(Sf, {
|
|
7763
7737
|
...u,
|
|
7764
7738
|
children: /* @__PURE__ */ X("div", {
|
|
7765
7739
|
className: "px-0.5",
|
|
7766
|
-
children: /* @__PURE__ */ X(
|
|
7740
|
+
children: /* @__PURE__ */ X(Iu, {
|
|
7767
7741
|
field: n,
|
|
7768
7742
|
value: e ?? "",
|
|
7769
7743
|
onChange: t,
|
|
@@ -7783,14 +7757,14 @@ function Mp({ q: e, t, sectionId: n, previewMode: r = !1, disableFields: i = r,
|
|
|
7783
7757
|
clearable: !e.required,
|
|
7784
7758
|
disabled: i
|
|
7785
7759
|
};
|
|
7786
|
-
return Li(
|
|
7760
|
+
return Li(wp(!!e.required, t), {
|
|
7787
7761
|
...l,
|
|
7788
7762
|
fieldType: "custom",
|
|
7789
|
-
render: ({ value: e, onChange: t, onBlur: r, error: i }) => /* @__PURE__ */ X(
|
|
7763
|
+
render: ({ value: e, onChange: t, onBlur: r, error: i }) => /* @__PURE__ */ X(Sf, {
|
|
7790
7764
|
...u,
|
|
7791
7765
|
children: /* @__PURE__ */ X("div", {
|
|
7792
7766
|
className: "px-0.5",
|
|
7793
|
-
children: /* @__PURE__ */ X(
|
|
7767
|
+
children: /* @__PURE__ */ X(Iu, {
|
|
7794
7768
|
field: n,
|
|
7795
7769
|
value: e,
|
|
7796
7770
|
onChange: t,
|
|
@@ -7819,7 +7793,7 @@ function Mp({ q: e, t, sectionId: n, previewMode: r = !1, disableFields: i = r,
|
|
|
7819
7793
|
showSearchBox: r,
|
|
7820
7794
|
searchBoxPlaceholder: e.searchBoxPlaceholder
|
|
7821
7795
|
};
|
|
7822
|
-
return Li(
|
|
7796
|
+
return Li(bp(!!e.required, t), {
|
|
7823
7797
|
...l,
|
|
7824
7798
|
fieldType: "custom",
|
|
7825
7799
|
render: ({ value: t, onChange: r, onBlur: i, error: o }) => {
|
|
@@ -7834,11 +7808,11 @@ function Mp({ q: e, t, sectionId: n, previewMode: r = !1, disableFields: i = r,
|
|
|
7834
7808
|
}
|
|
7835
7809
|
}
|
|
7836
7810
|
} : a;
|
|
7837
|
-
return /* @__PURE__ */ X(
|
|
7811
|
+
return /* @__PURE__ */ X(Sf, {
|
|
7838
7812
|
...u,
|
|
7839
7813
|
children: /* @__PURE__ */ X("div", {
|
|
7840
7814
|
className: "flex flex-col items-start px-0.5 [&>div]:w-full",
|
|
7841
|
-
children: /* @__PURE__ */ X(
|
|
7815
|
+
children: /* @__PURE__ */ X(Iu, {
|
|
7842
7816
|
field: s,
|
|
7843
7817
|
value: t ?? "",
|
|
7844
7818
|
onChange: r,
|
|
@@ -7868,14 +7842,14 @@ function Mp({ q: e, t, sectionId: n, previewMode: r = !1, disableFields: i = r,
|
|
|
7868
7842
|
showSearchBox: r,
|
|
7869
7843
|
searchBoxPlaceholder: e.searchBoxPlaceholder
|
|
7870
7844
|
};
|
|
7871
|
-
return Li(
|
|
7845
|
+
return Li(Cp(!!e.required, t), {
|
|
7872
7846
|
...l,
|
|
7873
7847
|
fieldType: "custom",
|
|
7874
|
-
render: ({ value: e, onChange: t, onBlur: n, error: r }) => /* @__PURE__ */ X(
|
|
7848
|
+
render: ({ value: e, onChange: t, onBlur: n, error: r }) => /* @__PURE__ */ X(Sf, {
|
|
7875
7849
|
...u,
|
|
7876
7850
|
children: /* @__PURE__ */ X("div", {
|
|
7877
7851
|
className: "flex flex-col items-start px-0.5 [&>div]:w-full",
|
|
7878
|
-
children: /* @__PURE__ */ X(
|
|
7852
|
+
children: /* @__PURE__ */ X(Iu, {
|
|
7879
7853
|
field: a,
|
|
7880
7854
|
value: e ?? [],
|
|
7881
7855
|
onChange: t,
|
|
@@ -7895,15 +7869,15 @@ function Mp({ q: e, t, sectionId: n, previewMode: r = !1, disableFields: i = r,
|
|
|
7895
7869
|
disabled: i,
|
|
7896
7870
|
showAnswerValidation: r
|
|
7897
7871
|
};
|
|
7898
|
-
return Li(
|
|
7872
|
+
return Li(bp(!!e.required, t), {
|
|
7899
7873
|
...l,
|
|
7900
7874
|
fieldType: "custom",
|
|
7901
7875
|
fieldConfig: n,
|
|
7902
|
-
render: ({ value: e, onChange: t, onBlur: n, config: r }) => /* @__PURE__ */ X(
|
|
7876
|
+
render: ({ value: e, onChange: t, onBlur: n, config: r }) => /* @__PURE__ */ X(Sf, {
|
|
7903
7877
|
...u,
|
|
7904
|
-
children: /* @__PURE__ */ X(
|
|
7878
|
+
children: /* @__PURE__ */ X(_p, {
|
|
7905
7879
|
value: e,
|
|
7906
|
-
onChange:
|
|
7880
|
+
onChange: Ap(t, s),
|
|
7907
7881
|
onBlur: n,
|
|
7908
7882
|
config: r
|
|
7909
7883
|
})
|
|
@@ -7918,13 +7892,13 @@ function Mp({ q: e, t, sectionId: n, previewMode: r = !1, disableFields: i = r,
|
|
|
7918
7892
|
disabled: i,
|
|
7919
7893
|
showAnswerValidation: r
|
|
7920
7894
|
};
|
|
7921
|
-
return Li(
|
|
7895
|
+
return Li(Cp(!!e.required, t), {
|
|
7922
7896
|
...l,
|
|
7923
7897
|
fieldType: "custom",
|
|
7924
7898
|
fieldConfig: n,
|
|
7925
|
-
render: ({ value: e, onChange: t, onBlur: n, config: r }) => /* @__PURE__ */ X(
|
|
7899
|
+
render: ({ value: e, onChange: t, onBlur: n, config: r }) => /* @__PURE__ */ X(Sf, {
|
|
7926
7900
|
...u,
|
|
7927
|
-
children: /* @__PURE__ */ X(
|
|
7901
|
+
children: /* @__PURE__ */ X(_p, {
|
|
7928
7902
|
value: e,
|
|
7929
7903
|
onChange: t,
|
|
7930
7904
|
onBlur: n,
|
|
@@ -7940,15 +7914,15 @@ function Mp({ q: e, t, sectionId: n, previewMode: r = !1, disableFields: i = r,
|
|
|
7940
7914
|
maxLabel: n.maxLabel,
|
|
7941
7915
|
disabled: i
|
|
7942
7916
|
};
|
|
7943
|
-
return Li(
|
|
7917
|
+
return Li(Sp(!!e.required, t), {
|
|
7944
7918
|
...l,
|
|
7945
7919
|
fieldType: "custom",
|
|
7946
7920
|
fieldConfig: r,
|
|
7947
|
-
render: ({ value: e, onChange: t, onBlur: n, config: r }) => /* @__PURE__ */ X(
|
|
7921
|
+
render: ({ value: e, onChange: t, onBlur: n, config: r }) => /* @__PURE__ */ X(Sf, {
|
|
7948
7922
|
...u,
|
|
7949
|
-
children: /* @__PURE__ */ X(
|
|
7923
|
+
children: /* @__PURE__ */ X(hp, {
|
|
7950
7924
|
value: e,
|
|
7951
|
-
onChange:
|
|
7925
|
+
onChange: Ap(t, s),
|
|
7952
7926
|
onBlur: n,
|
|
7953
7927
|
config: r
|
|
7954
7928
|
})
|
|
@@ -7961,19 +7935,19 @@ function Mp({ q: e, t, sectionId: n, previewMode: r = !1, disableFields: i = r,
|
|
|
7961
7935
|
type: "file",
|
|
7962
7936
|
label: c,
|
|
7963
7937
|
multiple: !0,
|
|
7964
|
-
accept: n.accept ??
|
|
7938
|
+
accept: n.accept ?? Df,
|
|
7965
7939
|
maxSizeMB: n.maxSizeMB,
|
|
7966
|
-
useUpload: r ??
|
|
7940
|
+
useUpload: r ?? yp,
|
|
7967
7941
|
disabled: i || !r
|
|
7968
7942
|
};
|
|
7969
|
-
return Li(
|
|
7943
|
+
return Li(Tp(!!e.required, t), {
|
|
7970
7944
|
...l,
|
|
7971
7945
|
fieldType: "custom",
|
|
7972
|
-
render: ({ value: e, onChange: t, onBlur: n, error: r }) => /* @__PURE__ */ X(
|
|
7946
|
+
render: ({ value: e, onChange: t, onBlur: n, error: r }) => /* @__PURE__ */ X(Sf, {
|
|
7973
7947
|
...u,
|
|
7974
7948
|
children: /* @__PURE__ */ X("div", {
|
|
7975
7949
|
className: "px-0.5",
|
|
7976
|
-
children: /* @__PURE__ */ X(
|
|
7950
|
+
children: /* @__PURE__ */ X(Iu, {
|
|
7977
7951
|
field: o,
|
|
7978
7952
|
value: e ?? [],
|
|
7979
7953
|
onChange: t,
|
|
@@ -7992,14 +7966,14 @@ function Mp({ q: e, t, sectionId: n, previewMode: r = !1, disableFields: i = r,
|
|
|
7992
7966
|
label: n.label || c,
|
|
7993
7967
|
disabled: i
|
|
7994
7968
|
};
|
|
7995
|
-
return Li(
|
|
7969
|
+
return Li(Ep(!!e.required, t), {
|
|
7996
7970
|
...l,
|
|
7997
7971
|
fieldType: "custom",
|
|
7998
|
-
render: ({ value: e, onChange: t, onBlur: n, error: i }) => /* @__PURE__ */ X(
|
|
7972
|
+
render: ({ value: e, onChange: t, onBlur: n, error: i }) => /* @__PURE__ */ X(Sf, {
|
|
7999
7973
|
...u,
|
|
8000
7974
|
children: /* @__PURE__ */ X("div", {
|
|
8001
7975
|
className: "px-0.5",
|
|
8002
|
-
children: /* @__PURE__ */ X(
|
|
7976
|
+
children: /* @__PURE__ */ X(Iu, {
|
|
8003
7977
|
field: r,
|
|
8004
7978
|
value: e ?? !1,
|
|
8005
7979
|
onChange: t,
|
|
@@ -8018,9 +7992,9 @@ function Mp({ q: e, t, sectionId: n, previewMode: r = !1, disableFields: i = r,
|
|
|
8018
7992
|
});
|
|
8019
7993
|
}
|
|
8020
7994
|
}
|
|
8021
|
-
function
|
|
7995
|
+
function Mp({ elements: e, mode: t, t: n, defaultValues: r, currentQuestionId: i, accumulatedValues: a, previewMode: o = !1, disableFields: s = o, useUpload: c, datasets: l, onSingleAnswerChange: u }) {
|
|
8022
7996
|
return K(() => {
|
|
8023
|
-
let d = {}, f = {}, p = {}, m =
|
|
7997
|
+
let d = {}, f = {}, p = {}, m = Op(e), h = t === "stepped";
|
|
8024
7998
|
for (let m of e) if (m.type === "section") {
|
|
8025
7999
|
let e = m.section, g = e.id;
|
|
8026
8000
|
t === "all-questions" && (p[g] = {
|
|
@@ -8028,7 +8002,7 @@ function Np({ elements: e, mode: t, t: n, defaultValues: r, currentQuestionId: i
|
|
|
8028
8002
|
description: e.description,
|
|
8029
8003
|
withInset: !0
|
|
8030
8004
|
});
|
|
8031
|
-
for (let p of e.questions ?? []) h && i && p.id !== i || (d[p.id] =
|
|
8005
|
+
for (let p of e.questions ?? []) h && i && p.id !== i || (d[p.id] = jp({
|
|
8032
8006
|
q: p,
|
|
8033
8007
|
t: n,
|
|
8034
8008
|
sectionId: t === "all-questions" ? g : void 0,
|
|
@@ -8037,11 +8011,11 @@ function Np({ elements: e, mode: t, t: n, defaultValues: r, currentQuestionId: i
|
|
|
8037
8011
|
formUseUpload: c,
|
|
8038
8012
|
datasets: l,
|
|
8039
8013
|
onSingleAnswerChange: u
|
|
8040
|
-
}), f[p.id] = a?.[p.id] ??
|
|
8014
|
+
}), f[p.id] = a?.[p.id] ?? Dp(p, r));
|
|
8041
8015
|
} else {
|
|
8042
8016
|
let e = m.question;
|
|
8043
8017
|
if (h && i && e.id !== i) continue;
|
|
8044
|
-
d[e.id] =
|
|
8018
|
+
d[e.id] = jp({
|
|
8045
8019
|
q: e,
|
|
8046
8020
|
t: n,
|
|
8047
8021
|
previewMode: o,
|
|
@@ -8049,7 +8023,7 @@ function Np({ elements: e, mode: t, t: n, defaultValues: r, currentQuestionId: i
|
|
|
8049
8023
|
formUseUpload: c,
|
|
8050
8024
|
datasets: l,
|
|
8051
8025
|
onSingleAnswerChange: u
|
|
8052
|
-
}), f[e.id] = a?.[e.id] ??
|
|
8026
|
+
}), f[e.id] = a?.[e.id] ?? Dp(e, r);
|
|
8053
8027
|
}
|
|
8054
8028
|
return {
|
|
8055
8029
|
schema: _r(d),
|
|
@@ -8072,149 +8046,178 @@ function Np({ elements: e, mode: t, t: n, defaultValues: r, currentQuestionId: i
|
|
|
8072
8046
|
}
|
|
8073
8047
|
//#endregion
|
|
8074
8048
|
//#region src/domains/talent/surveys/surveys/SurveyAnsweringForm/SurveyAnsweringForm.tsx
|
|
8075
|
-
var
|
|
8076
|
-
function
|
|
8049
|
+
var Np = () => {}, Pp = 400;
|
|
8050
|
+
function Fp(e) {
|
|
8077
8051
|
let t = {};
|
|
8078
8052
|
for (let [n, r] of Object.entries(e)) t[n] = r === void 0 ? null : r;
|
|
8079
8053
|
return t;
|
|
8080
8054
|
}
|
|
8055
|
+
function Ip(e, t) {
|
|
8056
|
+
let n = {};
|
|
8057
|
+
for (let r of e) {
|
|
8058
|
+
let e = r.type === "section" ? r.section.questions ?? [] : [r.question];
|
|
8059
|
+
for (let r of e) n[r.id] = Dp(r, t);
|
|
8060
|
+
}
|
|
8061
|
+
return n;
|
|
8062
|
+
}
|
|
8081
8063
|
function Lp(e) {
|
|
8082
8064
|
return e.inline ? /* @__PURE__ */ X(zp, { ...e }) : /* @__PURE__ */ X(Rp, { ...e });
|
|
8083
8065
|
}
|
|
8084
|
-
function Rp({ elements: e, onSubmit: t, mode: n, title: r, description: i, resourceHeader: a, isOpen: o, onClose: s, position: c = "center", module: l, allowToChangeFullscreen: u = !1, defaultValues: d, errorTriggerMode: f = "on-blur", loading: p = !1, labels: m, preview: h = !1, useUpload: g, datasets: _ }) {
|
|
8085
|
-
let { t:
|
|
8086
|
-
title: m?.empty?.title ??
|
|
8087
|
-
description: m?.empty?.description ??
|
|
8088
|
-
emoji: m?.empty?.emoji ??
|
|
8089
|
-
},
|
|
8090
|
-
clearTimeout(
|
|
8091
|
-
}, []),
|
|
8092
|
-
|
|
8093
|
-
}, [
|
|
8066
|
+
function Rp({ elements: e, onSubmit: t, mode: n, title: r, description: i, resourceHeader: a, isOpen: o, onClose: s, position: c = "center", module: l, allowToChangeFullscreen: u = !1, defaultValues: d, errorTriggerMode: f = "on-blur", loading: p = !1, labels: m, preview: h = !1, useUpload: g, datasets: _, saveDraft: v }) {
|
|
8067
|
+
let { t: y } = R(), [b, x] = J(!1), S = c === "fullscreen", C = c === "fullscreen" ? "center" : c, [w, T] = J(S), { formRef: E, submit: D, isSubmitting: O, hasErrors: k } = an(), A = q({}), j = K(() => Op(e), [e]), M = mp(j), N = j.length > 0, P = {
|
|
8068
|
+
title: m?.empty?.title ?? y("surveyAnsweringForm.labels.empty.title"),
|
|
8069
|
+
description: m?.empty?.description ?? y("surveyAnsweringForm.labels.empty.description"),
|
|
8070
|
+
emoji: m?.empty?.emoji ?? y("surveyAnsweringForm.labels.empty.emoji")
|
|
8071
|
+
}, F = n === "stepped", I = h && !!d && Object.keys(d).length > 0, ee = h && !I, te = F ? M.currentQuestion?.id : void 0, ne = q(void 0), re = q(Np), ie = W(() => {
|
|
8072
|
+
clearTimeout(ne.current);
|
|
8073
|
+
}, []), ae = W((e) => {
|
|
8074
|
+
ie(), e && (ne.current = setTimeout(() => re.current(), Pp));
|
|
8075
|
+
}, [ie]), { schema: oe, defaultValues: se, sections: ce } = Mp({
|
|
8094
8076
|
elements: e,
|
|
8095
8077
|
mode: n,
|
|
8096
|
-
t:
|
|
8078
|
+
t: y,
|
|
8097
8079
|
defaultValues: d,
|
|
8098
|
-
currentQuestionId:
|
|
8099
|
-
accumulatedValues:
|
|
8080
|
+
currentQuestionId: te,
|
|
8081
|
+
accumulatedValues: F ? A.current : void 0,
|
|
8100
8082
|
previewMode: h,
|
|
8101
|
-
disableFields:
|
|
8083
|
+
disableFields: I,
|
|
8102
8084
|
useUpload: g,
|
|
8103
8085
|
datasets: _,
|
|
8104
|
-
onSingleAnswerChange:
|
|
8105
|
-
}),
|
|
8106
|
-
|
|
8107
|
-
|
|
8086
|
+
onSingleAnswerChange: F ? ae : void 0
|
|
8087
|
+
}), ue = w ? "fullscreen" : C, de = ue === "center" ? "xl" : void 0, fe = q(null), pe = W((e) => {
|
|
8088
|
+
fe.current && clearTimeout(fe.current), fe.current = setTimeout(() => {
|
|
8089
|
+
fe.current = null, s();
|
|
8108
8090
|
}, e);
|
|
8109
|
-
}, [s]),
|
|
8091
|
+
}, [s]), he = W((e) => e.success ? (pe(e.message ? 1e3 : 0), {
|
|
8110
8092
|
success: !0,
|
|
8111
8093
|
message: e.message
|
|
8112
8094
|
}) : {
|
|
8113
8095
|
success: !1,
|
|
8114
8096
|
errors: e.errors
|
|
8115
|
-
}, [
|
|
8097
|
+
}, [pe]), ge = W(async (e) => {
|
|
8116
8098
|
if (h) return { success: !0 };
|
|
8117
8099
|
if (!t) throw Error("onSubmit is required when preview is false");
|
|
8118
|
-
if (
|
|
8119
|
-
...
|
|
8100
|
+
if (F && !M.isLastStep) return A.current = {
|
|
8101
|
+
...A.current,
|
|
8120
8102
|
...e
|
|
8121
|
-
},
|
|
8122
|
-
let n =
|
|
8123
|
-
...
|
|
8103
|
+
}, M.goToNext(), { success: !0 };
|
|
8104
|
+
let n = Fp(F ? {
|
|
8105
|
+
...A.current,
|
|
8124
8106
|
...e
|
|
8125
8107
|
} : e);
|
|
8126
|
-
if (
|
|
8127
|
-
|
|
8108
|
+
if (F) {
|
|
8109
|
+
M.setProgress(100);
|
|
8128
8110
|
let [e] = await Promise.all([t(n), new Promise((e) => setTimeout(e, 1e3))]);
|
|
8129
|
-
return e.success ||
|
|
8111
|
+
return e.success || M.setProgress(null), he(e);
|
|
8130
8112
|
}
|
|
8131
|
-
return
|
|
8113
|
+
return he(await t(n));
|
|
8132
8114
|
}, [
|
|
8133
8115
|
t,
|
|
8134
8116
|
h,
|
|
8135
|
-
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
]),
|
|
8117
|
+
he,
|
|
8118
|
+
F,
|
|
8119
|
+
M.isLastStep,
|
|
8120
|
+
M.goToNext,
|
|
8121
|
+
M.setProgress
|
|
8122
|
+
]), _e = W(async () => {
|
|
8141
8123
|
try {
|
|
8142
|
-
await
|
|
8124
|
+
await D();
|
|
8143
8125
|
} catch {}
|
|
8144
|
-
}, [
|
|
8145
|
-
let e =
|
|
8146
|
-
|
|
8147
|
-
...
|
|
8126
|
+
}, [D]), ve = W(() => {
|
|
8127
|
+
let e = E.current?.getValues() ?? {};
|
|
8128
|
+
A.current = {
|
|
8129
|
+
...A.current,
|
|
8148
8130
|
...e
|
|
8149
|
-
},
|
|
8150
|
-
}, [
|
|
8131
|
+
}, M.goToPrevious();
|
|
8132
|
+
}, [E, M.goToPrevious]), ye = W(async () => {
|
|
8133
|
+
if (!v) return;
|
|
8134
|
+
let t = {
|
|
8135
|
+
...Ip(e, d),
|
|
8136
|
+
...A.current,
|
|
8137
|
+
...E.current?.getValues()
|
|
8138
|
+
};
|
|
8139
|
+
x(!0), await Promise.resolve().then(() => v.onSave(Fp(t))).catch((e) => {
|
|
8140
|
+
console.warn("SurveyAnsweringForm: saveDraft.onSave failed", e);
|
|
8141
|
+
}).finally(() => x(!1));
|
|
8142
|
+
}, [
|
|
8143
|
+
v,
|
|
8144
|
+
e,
|
|
8145
|
+
d,
|
|
8146
|
+
E
|
|
8147
|
+
]), be = F && !M.isLastStep && !p && !I, xe = ee ? M.goToNext : _e;
|
|
8151
8148
|
G(() => {
|
|
8152
|
-
|
|
8153
|
-
}, [
|
|
8154
|
-
|
|
8149
|
+
re.current = be ? xe : Np;
|
|
8150
|
+
}, [be, xe]), G(() => () => ie(), [
|
|
8151
|
+
M.currentStep,
|
|
8155
8152
|
o,
|
|
8156
|
-
|
|
8153
|
+
ie
|
|
8157
8154
|
]);
|
|
8158
|
-
let
|
|
8159
|
-
label:
|
|
8160
|
-
icon:
|
|
8161
|
-
onClick: () =>
|
|
8162
|
-
}] : void 0,
|
|
8163
|
-
label:
|
|
8164
|
-
onClick:
|
|
8155
|
+
let Se = u && !p ? [{
|
|
8156
|
+
label: y(w ? "surveyAnsweringForm.actions.collapse" : "surveyAnsweringForm.actions.expand"),
|
|
8157
|
+
icon: w ? Jr : dr,
|
|
8158
|
+
onClick: () => T((e) => !e)
|
|
8159
|
+
}] : void 0, Ce = N ? p || I ? void 0 : ee ? F && !M.isLastStep ? {
|
|
8160
|
+
label: y("surveyAnsweringForm.actions.next"),
|
|
8161
|
+
onClick: M.goToNext,
|
|
8165
8162
|
icon: Er
|
|
8166
8163
|
} : {
|
|
8167
|
-
label:
|
|
8168
|
-
onClick:
|
|
8164
|
+
label: y("surveyAnsweringForm.actions.submit"),
|
|
8165
|
+
onClick: Np,
|
|
8169
8166
|
disabled: !0
|
|
8170
|
-
} :
|
|
8171
|
-
label:
|
|
8172
|
-
onClick:
|
|
8173
|
-
icon: Er
|
|
8167
|
+
} : F && !M.isLastStep ? {
|
|
8168
|
+
label: y("surveyAnsweringForm.actions.next"),
|
|
8169
|
+
onClick: _e,
|
|
8170
|
+
icon: Er,
|
|
8171
|
+
disabled: b
|
|
8174
8172
|
} : {
|
|
8175
|
-
label:
|
|
8176
|
-
onClick:
|
|
8177
|
-
disabled:
|
|
8178
|
-
loading:
|
|
8179
|
-
} : void 0,
|
|
8180
|
-
label:
|
|
8181
|
-
onClick:
|
|
8173
|
+
label: y("surveyAnsweringForm.actions.submit"),
|
|
8174
|
+
onClick: _e,
|
|
8175
|
+
disabled: O || k || b,
|
|
8176
|
+
loading: O
|
|
8177
|
+
} : void 0, we = N ? p || I ? void 0 : F && !M.isFirstStep ? {
|
|
8178
|
+
label: y("surveyAnsweringForm.actions.previous"),
|
|
8179
|
+
onClick: ve,
|
|
8182
8180
|
icon: Ho
|
|
8183
|
-
} : void 0 : void 0,
|
|
8181
|
+
} : void 0 : void 0, Te = v && N && !p && !h ? [{
|
|
8182
|
+
label: v.label,
|
|
8183
|
+
onClick: ye,
|
|
8184
|
+
disabled: O
|
|
8185
|
+
}] : void 0, Ee = n === "all-questions" && N && !p, De = F && N && !p, Oe = F && !!M.currentQuestion?.sectionTitle && !p, ke = ue === "center" || ue === "fullscreen";
|
|
8184
8186
|
return /* @__PURE__ */ X(mi, {
|
|
8185
8187
|
isOpen: o,
|
|
8186
8188
|
onClose: s,
|
|
8187
8189
|
title: r,
|
|
8188
8190
|
module: l,
|
|
8189
|
-
position:
|
|
8190
|
-
width:
|
|
8191
|
-
primaryAction:
|
|
8192
|
-
secondaryAction:
|
|
8193
|
-
|
|
8194
|
-
|
|
8195
|
-
|
|
8191
|
+
position: ue,
|
|
8192
|
+
width: de,
|
|
8193
|
+
primaryAction: Ce,
|
|
8194
|
+
secondaryAction: we,
|
|
8195
|
+
secondaryActions: Te,
|
|
8196
|
+
otherActions: Se,
|
|
8197
|
+
disableContentPadding: ke,
|
|
8198
|
+
children: /* @__PURE__ */ X(tf, {
|
|
8196
8199
|
answering: !0,
|
|
8197
8200
|
elements: e,
|
|
8198
|
-
onChange:
|
|
8201
|
+
onChange: Np,
|
|
8199
8202
|
datasets: _,
|
|
8200
8203
|
children: /* @__PURE__ */ Z("div", {
|
|
8201
|
-
className: B("relative flex h-full min-h-full flex-col @container",
|
|
8204
|
+
className: B("relative flex h-full min-h-full flex-col @container", F && !w && "min-h-[600px]"),
|
|
8202
8205
|
children: [
|
|
8203
|
-
|
|
8206
|
+
Ee ? /* @__PURE__ */ X(Qf, {
|
|
8204
8207
|
elements: e,
|
|
8205
|
-
onChange:
|
|
8208
|
+
onChange: Np,
|
|
8206
8209
|
answering: !0
|
|
8207
8210
|
}) : null,
|
|
8208
|
-
|
|
8211
|
+
De ? /* @__PURE__ */ X("div", {
|
|
8209
8212
|
className: "absolute left-0 right-0 top-0 [&>div>div>div]:h-1 [&>div>div>div]:rounded-none",
|
|
8210
8213
|
children: /* @__PURE__ */ X(Jo, {
|
|
8211
8214
|
label: "Value",
|
|
8212
|
-
value:
|
|
8215
|
+
value: M.progress,
|
|
8213
8216
|
hideLabel: !0
|
|
8214
8217
|
})
|
|
8215
8218
|
}) : null,
|
|
8216
8219
|
/* @__PURE__ */ Z("div", {
|
|
8217
|
-
className: B("mx-auto flex w-full flex-1 justify-center flex-col @lg:w-[750px] max-w-full pt-0",
|
|
8220
|
+
className: B("mx-auto flex w-full flex-1 justify-center flex-col @lg:w-[750px] max-w-full pt-0", ke && "px-4 py-12"),
|
|
8218
8221
|
children: [
|
|
8219
8222
|
/* @__PURE__ */ X("div", {
|
|
8220
8223
|
className: "mb-6",
|
|
@@ -8224,7 +8227,7 @@ function Rp({ elements: e, onSubmit: t, mode: n, title: r, description: i, resou
|
|
|
8224
8227
|
...a
|
|
8225
8228
|
})
|
|
8226
8229
|
}),
|
|
8227
|
-
p ? X(n === "stepped" ?
|
|
8230
|
+
p ? X(n === "stepped" ? pp : fp, {}) : N ? null : /* @__PURE__ */ X(io, {
|
|
8228
8231
|
display: "flex",
|
|
8229
8232
|
flexDirection: "column",
|
|
8230
8233
|
height: "full",
|
|
@@ -8232,31 +8235,31 @@ function Rp({ elements: e, onSubmit: t, mode: n, title: r, description: i, resou
|
|
|
8232
8235
|
alignItems: "center",
|
|
8233
8236
|
paddingX: "lg",
|
|
8234
8237
|
children: /* @__PURE__ */ X(me, {
|
|
8235
|
-
emoji:
|
|
8236
|
-
title:
|
|
8237
|
-
description:
|
|
8238
|
+
emoji: P.emoji,
|
|
8239
|
+
title: P.title,
|
|
8240
|
+
description: P.description
|
|
8238
8241
|
})
|
|
8239
8242
|
}),
|
|
8240
|
-
|
|
8243
|
+
Oe ? /* @__PURE__ */ Z("div", {
|
|
8241
8244
|
className: "py-1 pl-5",
|
|
8242
8245
|
children: [/* @__PURE__ */ X("span", {
|
|
8243
8246
|
className: "text-lg font-semibold text-f1-foreground",
|
|
8244
|
-
children:
|
|
8245
|
-
}),
|
|
8247
|
+
children: M.currentQuestion?.sectionTitle
|
|
8248
|
+
}), M.currentQuestion?.sectionDescription ? /* @__PURE__ */ X("p", {
|
|
8246
8249
|
className: "whitespace-pre-line text-f1-foreground-secondary",
|
|
8247
|
-
children:
|
|
8250
|
+
children: M.currentQuestion?.sectionDescription
|
|
8248
8251
|
}) : null]
|
|
8249
8252
|
}) : null,
|
|
8250
|
-
|
|
8251
|
-
formRef:
|
|
8253
|
+
N && !p ? /* @__PURE__ */ X(le, {
|
|
8254
|
+
formRef: E,
|
|
8252
8255
|
name: "survey-answering",
|
|
8253
|
-
schema:
|
|
8254
|
-
defaultValues:
|
|
8255
|
-
onSubmit:
|
|
8256
|
+
schema: oe,
|
|
8257
|
+
defaultValues: se,
|
|
8258
|
+
onSubmit: ge,
|
|
8256
8259
|
submitConfig: { hideSubmitButton: !0 },
|
|
8257
8260
|
errorTriggerMode: f,
|
|
8258
|
-
sections:
|
|
8259
|
-
},
|
|
8261
|
+
sections: ce
|
|
8262
|
+
}, F ? M.currentStep : void 0) : null
|
|
8260
8263
|
]
|
|
8261
8264
|
})
|
|
8262
8265
|
]
|
|
@@ -8265,11 +8268,11 @@ function Rp({ elements: e, onSubmit: t, mode: n, title: r, description: i, resou
|
|
|
8265
8268
|
});
|
|
8266
8269
|
}
|
|
8267
8270
|
function zp({ elements: e, title: t, description: n, resourceHeader: r, defaultValues: i, loading: a = !1, labels: o, useUpload: s, datasets: c, hideResourceHeader: l = !1 }) {
|
|
8268
|
-
let { t: u } = R(), d = K(() =>
|
|
8271
|
+
let { t: u } = R(), d = K(() => Op(e), [e]).length > 0, f = {
|
|
8269
8272
|
title: o?.empty?.title ?? u("surveyAnsweringForm.labels.empty.title"),
|
|
8270
8273
|
description: o?.empty?.description ?? u("surveyAnsweringForm.labels.empty.description"),
|
|
8271
8274
|
emoji: o?.empty?.emoji ?? u("surveyAnsweringForm.labels.empty.emoji")
|
|
8272
|
-
}, { schema: p, defaultValues: m, sections: h } =
|
|
8275
|
+
}, { schema: p, defaultValues: m, sections: h } = Mp({
|
|
8273
8276
|
elements: e,
|
|
8274
8277
|
mode: "all-questions",
|
|
8275
8278
|
t: u,
|
|
@@ -8279,10 +8282,10 @@ function zp({ elements: e, title: t, description: n, resourceHeader: r, defaultV
|
|
|
8279
8282
|
useUpload: s,
|
|
8280
8283
|
datasets: c
|
|
8281
8284
|
});
|
|
8282
|
-
return /* @__PURE__ */ X(
|
|
8285
|
+
return /* @__PURE__ */ X(tf, {
|
|
8283
8286
|
answering: !0,
|
|
8284
8287
|
elements: e,
|
|
8285
|
-
onChange:
|
|
8288
|
+
onChange: Np,
|
|
8286
8289
|
datasets: c,
|
|
8287
8290
|
children: /* @__PURE__ */ Z("div", {
|
|
8288
8291
|
className: "mx-auto flex w-full max-w-3xl flex-col",
|
|
@@ -8293,7 +8296,7 @@ function zp({ elements: e, title: t, description: n, resourceHeader: r, defaultV
|
|
|
8293
8296
|
description: n,
|
|
8294
8297
|
...r
|
|
8295
8298
|
})
|
|
8296
|
-
}), a ? /* @__PURE__ */ X(
|
|
8299
|
+
}), a ? /* @__PURE__ */ X(fp, {}) : d ? /* @__PURE__ */ X(le, {
|
|
8297
8300
|
name: "survey-answering-inline",
|
|
8298
8301
|
schema: p,
|
|
8299
8302
|
defaultValues: m,
|
|
@@ -9803,7 +9806,7 @@ function rh({ title: e, enabled: t, actionsCollapse: n }) {
|
|
|
9803
9806
|
function ih({ title: e, description: t, info: n, isLoading: r, error: i, onRetry: a, skeleton: o, children: s, actions: c = [], itemFilters: l, editMode: u, readOnly: d = !1, handleDelete: f, onAskAi: p, onAskAiTarget: m, itemId: h, chartTypeOptions: g, explanation: _, isFullscreen: v = !1, descriptionAction: y, headerLines: b = 2, fitContent: x = !1, onFullscreenChange: S }) {
|
|
9804
9807
|
let [C, w] = J(!1), [T, E] = J(!1), D = q(!1), [O, k] = J(!1), A = R(), { enabled: j, setPendingQuote: M, setOpen: N, focusChatInput: P } = Yi(), F = (e) => {
|
|
9805
9808
|
w(e), e || k(!1);
|
|
9806
|
-
},
|
|
9809
|
+
}, I = c.filter((e) => !("type" in e) || e.type === "item" || e.type === void 0), ee = I.length > 0, te = u && f && h, ne = g && g.length > 0, re = !!_ && _.trim().length > 0, ie = !!S, ae = !d && e.trim().length > 0 && (p ? !!h : j), oe = ae || ee || te || ne || re, se = !!l || ie || !!oe, ce = !v && (C || T), le = B("flex flex-shrink-0 gap-0.5", !v && "opacity-100 transition-opacity delay-150 duration-150 focus-within:delay-0 group-hover/dashitem:delay-0 sm:[@media(hover:hover)]:opacity-0 focus-within:sm:opacity-100 group-hover/dashitem:sm:opacity-100", ce && "delay-0 !opacity-100"), ue = B("-my-2 -mr-0.5 isolate grid flex-shrink-0", !v && "transition-[grid-template-columns] delay-150 duration-150 focus-within:delay-0 group-hover/dashitem:delay-0 motion-reduce:duration-0 sm:[@media(hover:hover)]:grid-cols-[0fr] focus-within:sm:grid-cols-[1fr] group-hover/dashitem:sm:grid-cols-[1fr]", ce && "delay-0 !grid-cols-[1fr]"), de = rh({
|
|
9807
9810
|
title: e,
|
|
9808
9811
|
enabled: b > 2,
|
|
9809
9812
|
actionsCollapse: !v
|
|
@@ -9965,7 +9968,7 @@ function ih({ title: e, description: t, info: n, isLoading: r, error: i, onRetry
|
|
|
9965
9968
|
format: "markdown"
|
|
9966
9969
|
})
|
|
9967
9970
|
}) : /* @__PURE__ */ Z(Y, { children: [
|
|
9968
|
-
|
|
9971
|
+
ne ? /* @__PURE__ */ Z("div", {
|
|
9969
9972
|
className: "mb-1 flex flex-col items-start gap-2 border-0 border-b border-solid border-f1-border-secondary p-3",
|
|
9970
9973
|
children: [/* @__PURE__ */ X(tr, {
|
|
9971
9974
|
className: "text-base font-medium text-f1-foreground-tertiary",
|
|
@@ -9999,7 +10002,7 @@ function ih({ title: e, description: t, info: n, isLoading: r, error: i, onRetry
|
|
|
9999
10002
|
})
|
|
10000
10003
|
}) }) : null,
|
|
10001
10004
|
_e,
|
|
10002
|
-
|
|
10005
|
+
ee ? /* @__PURE__ */ X(nc, { children: /* @__PURE__ */ Z(Qs, { children: [/* @__PURE__ */ X(Ks, {
|
|
10003
10006
|
className: "mx-1 rounded-sm px-2",
|
|
10004
10007
|
children: /* @__PURE__ */ Z("div", {
|
|
10005
10008
|
className: "flex w-full flex-row items-center gap-2 pr-2",
|
|
@@ -10008,7 +10011,7 @@ function ih({ title: e, description: t, info: n, isLoading: r, error: i, onRetry
|
|
|
10008
10011
|
children: A.ai.dataDownload.title
|
|
10009
10012
|
})]
|
|
10010
10013
|
})
|
|
10011
|
-
}), /* @__PURE__ */ X(Zs, { children: /* @__PURE__ */ X(ac, { children:
|
|
10014
|
+
}), /* @__PURE__ */ X(Zs, { children: /* @__PURE__ */ X(ac, { children: I.map((e) => /* @__PURE__ */ X(Ys, {
|
|
10012
10015
|
onClick: e.onClick,
|
|
10013
10016
|
children: /* @__PURE__ */ Z("div", {
|
|
10014
10017
|
className: "flex w-full flex-row items-center gap-2",
|
|
@@ -10018,7 +10021,7 @@ function ih({ title: e, description: t, info: n, isLoading: r, error: i, onRetry
|
|
|
10018
10021
|
})]
|
|
10019
10022
|
})
|
|
10020
10023
|
}, e.label)) }) })] }) }) : null,
|
|
10021
|
-
|
|
10024
|
+
te ? /* @__PURE__ */ X(nc, { children: /* @__PURE__ */ X(Ys, {
|
|
10022
10025
|
onClick: () => {
|
|
10023
10026
|
v && S?.(!1), f(h);
|
|
10024
10027
|
},
|
|
@@ -10342,7 +10345,7 @@ function Sh({ config: e, data: t }) {
|
|
|
10342
10345
|
label: e,
|
|
10343
10346
|
id: e
|
|
10344
10347
|
}))
|
|
10345
|
-
}), [i]), o =
|
|
10348
|
+
}), [i]), o = ne(a, [i]), s = K(() => [{
|
|
10346
10349
|
type: "table",
|
|
10347
10350
|
options: { columns: i.columns.map((e, t) => ({
|
|
10348
10351
|
label: e,
|
|
@@ -10403,23 +10406,23 @@ function wh({ item: e, filters: t, actions: n, itemFilters: r, editMode: i, read
|
|
|
10403
10406
|
_,
|
|
10404
10407
|
v,
|
|
10405
10408
|
y
|
|
10406
|
-
]), F = K(() => gh(f), [f]),
|
|
10409
|
+
]), F = K(() => gh(f), [f]), I = Qm({
|
|
10407
10410
|
chartContainerRef: A,
|
|
10408
10411
|
chartConfig: x,
|
|
10409
10412
|
data: E,
|
|
10410
10413
|
title: e.title
|
|
10411
|
-
}),
|
|
10414
|
+
}), ee = K(() => [...n ?? [], ...I], [n, I]), te = W(() => C(null), []), ne = x.type === "bar" ? "orientation" in x ? x.orientation ?? "vertical" : "vertical" : void 0, re = E ? xm(E, x.type) : x.type, ie = K(() => jm(re), [re]), ae = K(() => E ? Am(Sm(E, re)) : !1, [E, re]), oe = E && Array.isArray(E.series) ? E.series.length : 1, se = F.filter((e) => {
|
|
10412
10415
|
let t = e.type === "bar" ? "bar" : e.type;
|
|
10413
10416
|
return !(!ie.has(t) || e.type === "pie" && oe > 1 || (e.type === "pie" || e.type === "funnel") && ae);
|
|
10414
10417
|
}), ce = l && re !== "scatter" && re !== "radar" && re !== "heatmap" ? se.map((t) => {
|
|
10415
|
-
let n = t.type === "table", r = n ? m === "table" : m === "chart" && x.type === t.type && (t.type !== "bar" ||
|
|
10418
|
+
let n = t.type === "table", r = n ? m === "table" : m === "chart" && x.type === t.type && (t.type !== "bar" || ne === t.orientation);
|
|
10416
10419
|
return {
|
|
10417
10420
|
label: t.label,
|
|
10418
10421
|
value: t.value,
|
|
10419
10422
|
icon: t.icon,
|
|
10420
10423
|
isActive: r,
|
|
10421
10424
|
onSelect: () => {
|
|
10422
|
-
n ? h("table") : (h("chart"), (x.type !== t.type || t.type === "bar" &&
|
|
10425
|
+
n ? h("table") : (h("chart"), (x.type !== t.type || t.type === "bar" && ne !== t.orientation) && l(e.id, t.type, t.orientation));
|
|
10423
10426
|
}
|
|
10424
10427
|
};
|
|
10425
10428
|
}) : void 0, le = !!u && Ch(e), [ue, de] = J(0), fe = !!d && Ch(e), pe = fe && !u && ue > 0, me = fe && !!u, he = E?.categories?.length ?? 0, ge = pe ? f.dataChart.windowedCategories.replace("{{count}}", String(Math.max(0, he - ue))).replace("{{total}}", String(he)) : void 0, _e = pe ? {
|
|
@@ -10439,7 +10442,7 @@ function wh({ item: e, filters: t, actions: n, itemFilters: r, editMode: i, read
|
|
|
10439
10442
|
error: O ?? (b ? /* @__PURE__ */ Error() : void 0),
|
|
10440
10443
|
onRetry: b ? void 0 : k,
|
|
10441
10444
|
skeleton: vh(x),
|
|
10442
|
-
actions:
|
|
10445
|
+
actions: ee,
|
|
10443
10446
|
itemFilters: r,
|
|
10444
10447
|
editMode: i,
|
|
10445
10448
|
readOnly: a,
|
|
@@ -10472,7 +10475,7 @@ function wh({ item: e, filters: t, actions: n, itemFilters: r, editMode: i, read
|
|
|
10472
10475
|
onAsk: () => {
|
|
10473
10476
|
S && P(S);
|
|
10474
10477
|
},
|
|
10475
|
-
onDismiss:
|
|
10478
|
+
onDismiss: te,
|
|
10476
10479
|
returnFocusTo: A
|
|
10477
10480
|
})]
|
|
10478
10481
|
}) : D ? null : /* @__PURE__ */ X("div", {
|
|
@@ -10607,7 +10610,7 @@ function Mh({ source: e, title: t, description: n, columns: r, tableSettings: i
|
|
|
10607
10610
|
//#endregion
|
|
10608
10611
|
//#region src/domains/platform/ai/analytics/F0AnalyticsDashboard/components/CollectionItem/CollectionItem.tsx
|
|
10609
10612
|
function Nh({ item: e, filters: t, actions: n, itemFilters: r, editMode: i, readOnly: a, handleDelete: o, onAskAi: s, onAskAiTarget: c, isFullscreen: l, onFullscreenChange: u }) {
|
|
10610
|
-
let d = e.useDashboardFilters === !1 ? {} : t, f = JSON.stringify(d), p = JSON.stringify(r?.value ?? {}), m = K(() => e.createSource(d), [f, p]), h =
|
|
10613
|
+
let d = e.useDashboardFilters === !1 ? {} : t, f = JSON.stringify(d), p = JSON.stringify(r?.value ?? {}), m = K(() => e.createSource(d), [f, p]), h = ne(m, [f, p]), [g, _] = J(), v = K(() => Th(e.visualizations), [e]), y = Mh({
|
|
10611
10614
|
source: h,
|
|
10612
10615
|
title: e.title,
|
|
10613
10616
|
description: e.description,
|
|
@@ -10894,7 +10897,7 @@ function qh({ items: e, itemFilters: t, filters: n, editMode: r, readOnly: i, on
|
|
|
10894
10897
|
}
|
|
10895
10898
|
return r = r.filter((e) => e.ids.length > 0), x(r), r;
|
|
10896
10899
|
});
|
|
10897
|
-
}, [x]),
|
|
10900
|
+
}, [x]), I = W((e, t) => {
|
|
10898
10901
|
if (Zh(N.current, e, t)) return null;
|
|
10899
10902
|
let n = d.current ? Array.from(d.current.querySelectorAll("[data-dashboard-row]")) : [], r = O.current;
|
|
10900
10903
|
if (n.length === 0 || n.length !== r.length) return null;
|
|
@@ -10913,7 +10916,7 @@ function qh({ items: e, itemFilters: t, filters: n, editMode: r, readOnly: i, on
|
|
|
10913
10916
|
rowIdx: a,
|
|
10914
10917
|
position: $h(n[a].querySelectorAll("[data-card-id]"), e, s.ids.length)
|
|
10915
10918
|
};
|
|
10916
|
-
}, []),
|
|
10919
|
+
}, []), ee = W((e, t) => {
|
|
10917
10920
|
if (typeof t.button == "number" && t.button !== 0) return;
|
|
10918
10921
|
t.preventDefault(), t.stopPropagation();
|
|
10919
10922
|
let n = t.clientX, r = t.clientY, i = !1;
|
|
@@ -10932,24 +10935,24 @@ function qh({ items: e, itemFilters: t, filters: n, editMode: r, readOnly: i, on
|
|
|
10932
10935
|
}
|
|
10933
10936
|
let a = M.current;
|
|
10934
10937
|
a && (a.style.transform = `translate(${t.clientX + 12}px, ${t.clientY + 16}px)`);
|
|
10935
|
-
let o =
|
|
10938
|
+
let o = I(t.clientX, t.clientY);
|
|
10936
10939
|
JSON.stringify(o) !== JSON.stringify(j.current) && (j.current = o, D(o));
|
|
10937
10940
|
}, o = (e) => {
|
|
10938
10941
|
document.removeEventListener("pointermove", a), document.removeEventListener("pointerup", s), document.removeEventListener("pointercancel", u), P.current = null;
|
|
10939
10942
|
let t = A.current, n = j.current;
|
|
10940
10943
|
e && i && t && n && F(t, n), A.current = null, j.current = null, N.current = [], T(null), D(null), i && window.dispatchEvent(new CustomEvent(Sr));
|
|
10941
10944
|
}, s = (e) => {
|
|
10942
|
-
i && (N.current = Array.from(document.querySelectorAll("[data-ai-chat-dropzone]")), j.current =
|
|
10945
|
+
i && (N.current = Array.from(document.querySelectorAll("[data-ai-chat-dropzone]")), j.current = I(e.clientX, e.clientY)), o(!0);
|
|
10943
10946
|
}, u = () => o(!1);
|
|
10944
10947
|
P.current = () => o(!1), document.addEventListener("pointermove", a), document.addEventListener("pointerup", s), document.addEventListener("pointercancel", u);
|
|
10945
10948
|
}, [
|
|
10946
10949
|
F,
|
|
10947
10950
|
c,
|
|
10948
10951
|
l,
|
|
10949
|
-
|
|
10952
|
+
I
|
|
10950
10953
|
]);
|
|
10951
10954
|
G(() => () => P.current?.(), []);
|
|
10952
|
-
let
|
|
10955
|
+
let te = W((e, t, n, r) => {
|
|
10953
10956
|
let i = Math.max(ig(_[e], g), r), a = (r) => {
|
|
10954
10957
|
let a = Math.max(i, n + r.clientY - t);
|
|
10955
10958
|
v((t) => t.map((t, n) => n === e ? {
|
|
@@ -10964,7 +10967,7 @@ function qh({ items: e, itemFilters: t, filters: n, editMode: r, readOnly: i, on
|
|
|
10964
10967
|
_,
|
|
10965
10968
|
x,
|
|
10966
10969
|
g
|
|
10967
|
-
]),
|
|
10970
|
+
]), ne = f ? _.flatMap((e) => e.ids.map((t) => ({
|
|
10968
10971
|
ids: [t],
|
|
10969
10972
|
height: e.height
|
|
10970
10973
|
}))) : _, re = !!r && !f, ie = (e) => w && E?.type === "new-row" && E.afterRowIdx === e;
|
|
@@ -11016,7 +11019,7 @@ function qh({ items: e, itemFilters: t, filters: n, editMode: r, readOnly: i, on
|
|
|
11016
11019
|
className: "flex flex-col",
|
|
11017
11020
|
style: { gap: zh },
|
|
11018
11021
|
children: [
|
|
11019
|
-
|
|
11022
|
+
ne.map((e, a) => {
|
|
11020
11023
|
let o = w && E?.type === "into-row" && E.rowIdx === a, u = e.ids.some((e) => g.get(e)?.type === "collection");
|
|
11021
11024
|
return /* @__PURE__ */ Z("div", {
|
|
11022
11025
|
className: "relative",
|
|
@@ -11043,7 +11046,7 @@ function qh({ items: e, itemFilters: t, filters: n, editMode: r, readOnly: i, on
|
|
|
11043
11046
|
showIndicatorBefore: !!p,
|
|
11044
11047
|
showIndicatorAfter: !!m,
|
|
11045
11048
|
draggable: re,
|
|
11046
|
-
onGripPointerDown:
|
|
11049
|
+
onGripPointerDown: ee,
|
|
11047
11050
|
onContentHeightChange: S,
|
|
11048
11051
|
children: /* @__PURE__ */ X(cg, {
|
|
11049
11052
|
item: d,
|
|
@@ -11065,14 +11068,14 @@ function qh({ items: e, itemFilters: t, filters: n, editMode: r, readOnly: i, on
|
|
|
11065
11068
|
onMouseDown: (t) => {
|
|
11066
11069
|
t.preventDefault();
|
|
11067
11070
|
let n = t.currentTarget.parentElement?.querySelector("[data-dashboard-row]"), r = Math.max(n?.getBoundingClientRect().height ?? 0, e.height), i = new Set(e.ids.filter((e) => g.get(e)?.type !== "chart"));
|
|
11068
|
-
|
|
11071
|
+
te(a, t.clientY, r, ag(n, i));
|
|
11069
11072
|
},
|
|
11070
11073
|
children: /* @__PURE__ */ X("div", { className: "h-1 w-16 rounded-full bg-transparent transition-colors group-hover/resize:bg-f1-foreground-tertiary" })
|
|
11071
11074
|
}) : null
|
|
11072
11075
|
]
|
|
11073
11076
|
}, a);
|
|
11074
11077
|
}),
|
|
11075
|
-
re ? /* @__PURE__ */ X(Xh, { active: !!ie(
|
|
11078
|
+
re ? /* @__PURE__ */ X(Xh, { active: !!ie(ne.length - 1) }) : null,
|
|
11076
11079
|
w ? /* @__PURE__ */ X("div", {
|
|
11077
11080
|
ref: M,
|
|
11078
11081
|
className: "pointer-events-none fixed left-0 top-0 z-50 max-w-xs truncate rounded-lg border border-solid border-f1-border-secondary bg-f1-background px-3 py-2 text-sm font-medium text-f1-foreground shadow-lg",
|
|
@@ -11951,10 +11954,10 @@ var Lg = "--toast-index", Rg = "--toast-offset-y", zg = "--toast-height", Bg = "
|
|
|
11951
11954
|
}), M = U.useRef(void 0), N = U.useRef(0), P = U.useRef(!1), F = U.useRef({
|
|
11952
11955
|
x: 0,
|
|
11953
11956
|
y: 0
|
|
11954
|
-
}),
|
|
11957
|
+
}), I = U.useRef(!1), ee = U.useRef({
|
|
11955
11958
|
x: 0,
|
|
11956
11959
|
y: 0
|
|
11957
|
-
}),
|
|
11960
|
+
}), te = U.useRef(null), ne = U.useRef(null), re = d.useState("toastIndex", n.id), ie = d.useState("toastVisibleIndex", n.id), ae = d.useState("toastOffsetY", n.id), oe = d.useState("focused"), se = d.useState("expanded");
|
|
11958
11961
|
An({
|
|
11959
11962
|
open: n.transitionStatus !== "ending",
|
|
11960
11963
|
ref: O,
|
|
@@ -11994,10 +11997,10 @@ var Lg = "--toast-index", Rg = "--toast-offset-y", zg = "--toast-height", Bg = "
|
|
|
11994
11997
|
n.transitionStatus
|
|
11995
11998
|
]);
|
|
11996
11999
|
function le(e) {
|
|
11997
|
-
|
|
12000
|
+
ee.current = e, y(e);
|
|
11998
12001
|
}
|
|
11999
12002
|
bn(() => () => {
|
|
12000
|
-
|
|
12003
|
+
ne.current?.abort();
|
|
12001
12004
|
}, []);
|
|
12002
12005
|
function ue(e, t) {
|
|
12003
12006
|
let n = (e) => e > 0 ? e ** Kg : -(Math.abs(e) ** Kg), r = e > 0 && !l.includes("right") || e < 0 && !l.includes("left"), i = t > 0 && !l.includes("down") || t < 0 && !l.includes("up");
|
|
@@ -12007,8 +12010,8 @@ var Lg = "--toast-index", Rg = "--toast-offset-y", zg = "--toast-height", Bg = "
|
|
|
12007
12010
|
};
|
|
12008
12011
|
}
|
|
12009
12012
|
let de = kn((e) => {
|
|
12010
|
-
if (e.pointerId !==
|
|
12011
|
-
|
|
12013
|
+
if (e.pointerId !== te.current) return;
|
|
12014
|
+
te.current = null, ne.current?.abort(), ne.current = null, h(!1), _(!1), D(null);
|
|
12012
12015
|
let t = j.current;
|
|
12013
12016
|
if (e.type === "pointercancel" || P.current) {
|
|
12014
12017
|
le({
|
|
@@ -12017,7 +12020,7 @@ var Lg = "--toast-index", Rg = "--toast-offset-y", zg = "--toast-height", Bg = "
|
|
|
12017
12020
|
}), p(void 0);
|
|
12018
12021
|
return;
|
|
12019
12022
|
}
|
|
12020
|
-
let r =
|
|
12023
|
+
let r = ee.current, i = r.x - t.x, a = r.y - t.y, o;
|
|
12021
12024
|
for (let e of l) if (Ig(e, i, a) > Wg) {
|
|
12022
12025
|
o = e;
|
|
12023
12026
|
break;
|
|
@@ -12029,7 +12032,7 @@ var Lg = "--toast-index", Rg = "--toast-offset-y", zg = "--toast-height", Bg = "
|
|
|
12029
12032
|
});
|
|
12030
12033
|
function fe(e) {
|
|
12031
12034
|
if (e.button !== 0 || (e.pointerType === "touch" && d.pauseTimers(), Fn(e.nativeEvent)?.closest(`button,a,input,textarea,[role="button"],${Jg}`))) return;
|
|
12032
|
-
P.current = !1, M.current = void 0, N.current = 0,
|
|
12035
|
+
P.current = !1, M.current = void 0, N.current = 0, te.current = e.pointerId, A.current = {
|
|
12033
12036
|
x: e.clientX,
|
|
12034
12037
|
y: e.clientY
|
|
12035
12038
|
}, F.current = A.current;
|
|
@@ -12037,15 +12040,15 @@ var Lg = "--toast-index", Rg = "--toast-offset-y", zg = "--toast-height", Bg = "
|
|
|
12037
12040
|
j.current = n, x(n), le({
|
|
12038
12041
|
x: n.x,
|
|
12039
12042
|
y: n.y
|
|
12040
|
-
}), d.set("hovering", !0), h(!0), _(!1), D(null),
|
|
12043
|
+
}), d.set("hovering", !0), h(!0), _(!1), D(null), I.current = !0, ne.current?.abort();
|
|
12041
12044
|
let r = new AbortController();
|
|
12042
|
-
|
|
12045
|
+
ne.current = r;
|
|
12043
12046
|
let i = Hn(t);
|
|
12044
12047
|
i.addEventListener("pointerup", de, { signal: r.signal }), i.addEventListener("pointercancel", de, { signal: r.signal }), t.setPointerCapture?.(e.pointerId);
|
|
12045
12048
|
}
|
|
12046
12049
|
function pe(e) {
|
|
12047
|
-
if (e.pointerId !==
|
|
12048
|
-
e.preventDefault(),
|
|
12050
|
+
if (e.pointerId !== te.current) return;
|
|
12051
|
+
e.preventDefault(), I.current &&= (A.current = {
|
|
12049
12052
|
x: e.clientX,
|
|
12050
12053
|
y: e.clientY
|
|
12051
12054
|
}, !1);
|
|
@@ -12085,7 +12088,7 @@ var Lg = "--toast-index", Rg = "--toast-offset-y", zg = "--toast-height", Bg = "
|
|
|
12085
12088
|
let e = O.current;
|
|
12086
12089
|
if (!u || !e) return;
|
|
12087
12090
|
function t(t) {
|
|
12088
|
-
|
|
12091
|
+
te.current !== null && wn(e, Fn(t)) && t.preventDefault();
|
|
12089
12092
|
}
|
|
12090
12093
|
return Dn(e, "touchmove", t, { passive: !1 });
|
|
12091
12094
|
}, [u]);
|
|
@@ -12713,12 +12716,12 @@ var v_ = B("group/toast pointer-events-auto absolute bottom-0 left-0 right-0 fle
|
|
|
12713
12716
|
...m,
|
|
12714
12717
|
children: /* @__PURE__ */ X(W_.Provider, {
|
|
12715
12718
|
value: p,
|
|
12716
|
-
children: /* @__PURE__ */ X(
|
|
12719
|
+
children: /* @__PURE__ */ X(ju, { children: /* @__PURE__ */ X(B_, {
|
|
12717
12720
|
portalTargets: {
|
|
12718
12721
|
mobile: "#f0-overlay-root",
|
|
12719
12722
|
desktop: "#f0-overlay-root"
|
|
12720
12723
|
},
|
|
12721
|
-
children: /* @__PURE__ */ X(
|
|
12724
|
+
children: /* @__PURE__ */ X(Nu, { children: /* @__PURE__ */ X(Ut, { children: e }) })
|
|
12722
12725
|
}) })
|
|
12723
12726
|
})
|
|
12724
12727
|
}) })
|
|
@@ -12726,4 +12729,4 @@ var v_ = B("group/toast pointer-events-auto absolute bottom-0 left-0 right-0 fle
|
|
|
12726
12729
|
})
|
|
12727
12730
|
});
|
|
12728
12731
|
//#endregion
|
|
12729
|
-
export { Da as AiChatTranslationsProvider, nn as AreaChart, wo as Await, Te as BarChart, dt as BarChartSkeleton, Mt as CardSelectableContainer, b as CategoryBarChart, bi as ChatSpinner, Ao as Chip, za as CollapsibleGroup, g as ComboChart, Pt as DATA_COLLECTION_URL_PARAMS, Dt as DATA_COLLECTION_URL_PARAM_PREFIX,
|
|
12732
|
+
export { Da as AiChatTranslationsProvider, nn as AreaChart, wo as Await, Te as BarChart, dt as BarChartSkeleton, Mt as CardSelectableContainer, b as CategoryBarChart, bi as ChatSpinner, Ao as Chip, za as CollapsibleGroup, g as ComboChart, Pt as DATA_COLLECTION_URL_PARAMS, Dt as DATA_COLLECTION_URL_PARAM_PREFIX, Al as Dashboard, p as DataChartEmptyStateView, fn as DataTestIdWrapper, Xe as DndProvider, sa as DropOverlay, Yn as EmojiImage, cu as F0Accordion, Ht as F0ActionBar, Oi as F0ActionItem, Ur as F0AiChat, Oa as F0AiChatCreditsButton, Ia as F0AiChatHeader, Na as F0AiChatHistory, Qr as F0AiChatProvider, ha as F0AiChatTextArea, _a as F0AiChatUsageLimitsButton, wa as F0AiFileAttachments, Fi as F0AiFilePreviewsProvider, oa as F0AiFormRegistryProvider, La as F0AiInsightCard, Ta as F0AiMask, ka as F0AiMessageSources, fa as F0AiMessagesContainer, Nr as F0AiPong, Ua as F0AiProcessingOverlay, Aa as F0AiProposalCard, Wa as F0AiTableCard, lc as F0Alert, yg as F0AnalyticsDashboard, ar as F0AudioPlayer, Mi as F0AudioPlayerCard, ja as F0AuraVoiceAnimation, lo as F0Avatar, wi as F0AvatarAlert, oo as F0AvatarCompany, ni as F0AvatarDate, xo as F0AvatarEmoji, So as F0AvatarFile, uo as F0AvatarIcon, ho as F0AvatarList, ao as F0AvatarModule, fo as F0AvatarPerson, go as F0AvatarTeam, Ql as F0BigNumber, lm as F0BookAMeetingCard, io as F0Box, V as F0Button, lr as F0ButtonDropdown, Ls as F0ButtonToggle, Fa as F0CanvasCard, Xi as F0CanvasPanel, aa as F0Card, sr as F0CardRow, Sa as F0ChatComposer, cs as F0Checkbox, fu as F0ChipList, Ga as F0ClarifyingPanel, wt as F0DataChart, M as F0DatePicker, Ft as F0DatePickerInline, am as F0DemoCard, mi as F0Dialog, Ee as F0DialogAlikeContext, je as F0DialogAlikeProvider, Io as F0DialogContext, $o as F0DialogProvider, fc as F0DocumentViewer, yu as F0Drawer, ve as F0DurationInput, Fs as F0EventCatcherProvider, sm as F0FAQCard, qi as F0FileItem, Su as F0FilterPickerContent, m as F0Form, Iu as F0FormField, bl as F0GridStack, Ma as F0HILActionConfirmation, v as F0Heading, H as F0Icon, Ii as F0Link, cm as F0ModuleCard, rn as F0NotesTextEditor, be as F0NotesTextEditorSkeleton, A as F0NumberInput, S as F0NumberInputInline, Ti as F0OneIcon, Hi as F0OneSwitch, uc as F0PdfViewer, K_ as F0Provider, um as F0QuestionCardMultiStep, vi as F0RichTextDisplay, oe as F0RichTextEditor, fs as F0SearchInput, Os as F0Select, re as F0SelectInline, Sd as F0Slider, Rd as F0TableOfContentPopover, Vo as F0TagAlert, jo as F0TagBalance, Wo as F0TagCompany, Bo as F0TagDot, ds as F0TagList, zo as F0TagPerson, gs as F0TagRaw, Do as F0TagStatus, hs as F0TagTeam, cc as F0Text, se as F0TextAreaInput, ie as F0TextAreaInputInline, Pi as F0TextInput, _t as F0TextInputInline, Ce as F0TimelineRow, mc as F0VideoPlayer, ad as F0WizardForm, us as F1SearchBox, x as FILE_TYPES, Vi as FileItem, ma as FormCardValueFormatterProvider, ct as FunnelChartSkeleton, co as GROUP_ID_SYMBOL, yo as GROUP_KEY_SEPARATOR, Be as GaugeChartSkeleton, Qt as HeatmapChartSkeleton, Kl as HomeLayout, xe as InlineFieldRow, f as InlineFieldRowList, Hr as Input, Ul as Layout, de as LineChart, ln as LineChartSkeleton, ft as MAX_URL_FILTER_VALUES, u as NotesTextEditor, en as NotesTextEditorSkeleton, te as NumberInput, es as OneCalendar, tr as OneEllipsis, me as OneEmptyState, ws as OneFilterPicker, xt as PieChart, qe as PieChartSkeleton, oi as PongBall, Jt as PrivacyModeProvider, Kp as ProductBlankslate, Xt as ProductCard, Yp as ProductModal, Zp as ProductWidget, s as ProgressBarChart, vt as RadarChart, on as RadarChartSkeleton, ai as RichTextDisplay, fe as RichTextEditor, Se as ScatterChartSkeleton, Wl as StandardLayout, fp as SurveyAllQuestionsLoadingSkeleton, Lp as SurveyAnsweringForm, ip as SurveyFormBuilder, Bp as SurveySampleQuestion, pp as SurveySteppedLoadingSkeleton, vs as Tag, ts as TagCounter, pe as Textarea, Ha as ThreadItem, Ea as ThreadListSkeleton, B_ as ToastProvider, Gl as TwoColumnLayout, k as UPLOAD_INPUT_ID, j as UpsellRequestResponseDialog, em as UpsellingAlert, nm as UpsellingBanner, C as UpsellingButton, im as UpsellingPopover, ae as VerticalBarChart, rs as WeekStartDay, Ze as actionBarStatuses, da as actionItemStatuses, Qi as adaptDataAdapterToInfiniteScroll, ua as aiChatFileFromShowFilesItem, Pa as aiChatFileFromUploadedFile, va as aiChatFilesFromMessage, ya as aiChatMessageText, Ca as aiTranslations, hu as alertVariantOptions, nu as audioPlayerSizes, ql as avatarVariants, lt as buildDataCollectionUrlParams, pn as buildTranslations, tu as buttonDropdownModes, eu as buttonDropdownSizes, $l as buttonDropdownVariants, El as buttonSizes, zt as buttonToggleColors, ht as buttonToggleSizes, Ue as buttonToggleVariants, Tl as buttonVariants, lu as cardAlertVariants, na as cardImageAspectRatios, ui as cardImageFits, pr as cardImageSizes, To as chartColorTokens, ko as chipVariants, Ud as computeSectionEndIds, pc as configurePdfWorker, Ba as contentTypes, Ct as createAtlaskitDriver, Mo as createDataSourceDefinition, Eu as createF0FormDefinitionTester, Tu as createF0FormTester, Cl as createPageLayoutBlock, wl as createPageLayoutBlockGroup, ga as createPersonMentionSource, gu as dataCollectionLocalStorageHandler, pu as datePickerInlineDismissReasons, mu as datepickerSizes, to as defaultTranslations, xi as defineAvailableForm, Cu as describeFormSchema, E as dialog, E as dialogs, ee as drawers, la as durationInputSizes, ur as durationUnits, h as evaluateRenderIf, gn as experimental, Ai as f0FileItemSizes, Li as f0FormField, jr as fieldsToSeconds, zd as flattenElements, ca as formatPlaybackTime, dd as forms, we as generateAnchorId, Xo as getAnimationVariants, Ci as getDataCollectionStorageKey, Lo as getDataSourcePaginationType, er as getEmojiLabel, or as getF0Config, Ns as getGranularityDefinition, xs as getGranularityDefinitions, Rs as getGranularitySimpleDefinition, ue as getSchemaDefinition, Es as granularityDefinitions, Ni as hasF0Config, Br as inferFieldType, Hd as injectSectionEnds, _o as isInfiniteScrollPagination, vo as isPageBasedPagination, Kr as isZodType, ru as linkVariants, xa as markdownRenderers, Wi as mergeDataCollectionFilters, mo as modules, Ya as oneIconSizes, Ve as parseDataCollectionUrlParams, dc as pdfScales, At as predefinedPresets, Ms as rangeSeparator, Ji as readDataCollectionStorage, Vd as reconstructElements, ji as resolveDataCollectionFilters, ms as resolveGranularityDefinition, Kt as resolveItemNeighbors, n as resolveWindowNeighbors, Ir as secondsToFields, li as secondsToVisibleFields, fd as selectInlineDismissReasons, Ie as selectSizes, Ne as selectVariants, $t as setDataCollectionUrlParams, pd as sliderTooltipModes, un as syncDataCollectionUrlParams, Ed as tagDotColors, wd as timelineRowApproverStatuses, Cd as timelineRowStatuses, Td as timelineRowTagVariants, Bt as toasts, Tr as unwrapZodSchema, Ra as usageLimitsPopoverSides, Yi as useAiChat, qa as useAiChatTranslations, ci as useAudioPlayer, Ja as useCanvasEntity, Va as useChatHistory, po as useData, Cs as useDataSource, ge as useDataSourceItemNavigation, Fr as useDerivedTranscription, He as useDndEvents, jt as useDraggable, Vt as useDroppableList, Qn as useEmojiConfetti, ra as useF0AiFormRegistry, Qo as useF0Dialog, w as useF0DialogAlikeContext, an as useF0Form, Gt as useF0FormDefinition, pa as useFormCardValueFormatter, G_ as useFormComponent, Zo as useGroups, bg as useIsDesktop, xg as useIsMobile, it as useItemNeighbors, et as usePrivacyMode, Xn as useReducedMotion, bt as useSchemaDefinition, No as useSelectable, ba as useSetFormCardValueFormatter, Ka as useToolCallId, Xa as useXRay, L as withDataTestId, Je as writeDataCollectionStorage };
|