@net-advantage/nabs-ui-shell 0.81.0 → 0.84.0
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/Branding.test.d.ts +1 -0
- package/dist/Shell.test.d.ts +1 -0
- package/dist/nabs-ui-shell.cjs +1 -1
- package/dist/nabs-ui-shell.css +2 -2
- package/dist/nabs-ui-shell.js +1876 -502
- package/dist/shell.exports.test.d.ts +1 -0
- package/package.json +38 -35
package/dist/nabs-ui-shell.js
CHANGED
|
@@ -220,16 +220,16 @@ function w(e) {
|
|
|
220
220
|
function T(e, t) {
|
|
221
221
|
return w(e[t]);
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function E(e) {
|
|
224
224
|
return !Number.isFinite(e) || e <= 0 ? 5 : Math.abs(e);
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function D(e, t, n) {
|
|
227
227
|
return Math.min(n, Math.max(t, e));
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function O(e) {
|
|
230
230
|
return Number(e.toFixed(6));
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function ee(e, t, n) {
|
|
233
233
|
let r = [];
|
|
234
234
|
if (n?.length) for (let e of n) {
|
|
235
235
|
let t = String(e ?? "").trim();
|
|
@@ -246,7 +246,7 @@ function D(e, t, n) {
|
|
|
246
246
|
}
|
|
247
247
|
return r.slice(0, 10);
|
|
248
248
|
}
|
|
249
|
-
function
|
|
249
|
+
function te(e, t, n, r) {
|
|
250
250
|
let i = e + t, a = Number.isFinite(n) ? n : 0, o = Number.isFinite(r) ? r : i;
|
|
251
251
|
return o <= a ? {
|
|
252
252
|
axisMin: a,
|
|
@@ -256,16 +256,16 @@ function O(e, t, n, r) {
|
|
|
256
256
|
axisMax: o
|
|
257
257
|
};
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function ne(e, t, n) {
|
|
260
260
|
let r = [e], i = n / 1e3, a = 0;
|
|
261
261
|
for (let o = e + n; o <= t + i && !(a > 5e3); o += n) {
|
|
262
|
-
let e =
|
|
262
|
+
let e = O(o);
|
|
263
263
|
if (e >= t) break;
|
|
264
264
|
r.push(e), a += 1;
|
|
265
265
|
}
|
|
266
266
|
return r[r.length - 1] !== t && r.push(t), r;
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function re(e, t, n) {
|
|
269
269
|
let r = e.map((e) => x.legendSampleWidth + x.legendTextGap + e.length * x.legendApproxCharWidth), i = t - (r.reduce((e, t) => e + t, 0) + Math.max(0, e.length - 1) * x.legendItemGap) / 2;
|
|
270
270
|
return e.map((e, t) => {
|
|
271
271
|
let n = r[t], a = i, o = a + x.legendSampleWidth, s = a + x.legendSampleWidth / 2, c = o + x.legendTextGap;
|
|
@@ -280,7 +280,7 @@ function ne(e, t, n) {
|
|
|
280
280
|
};
|
|
281
281
|
});
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function k(e, t) {
|
|
284
284
|
let n = [];
|
|
285
285
|
for (let r of e) r !== e[0] && n.push({
|
|
286
286
|
id: `guide-${r}`,
|
|
@@ -289,24 +289,24 @@ function A(e, t) {
|
|
|
289
289
|
});
|
|
290
290
|
return n;
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function A(e, t) {
|
|
293
293
|
return e.map((e) => ({
|
|
294
294
|
id: `tick-${e}`,
|
|
295
295
|
value: e,
|
|
296
296
|
y: t(e)
|
|
297
297
|
}));
|
|
298
298
|
}
|
|
299
|
-
function
|
|
300
|
-
let c =
|
|
299
|
+
function ie(e, t, n, r, i, a, o, s) {
|
|
300
|
+
let c = ee(e, t, n), l = c.flatMap((t) => e.map((e) => T(e, t))), { axisMin: u, axisMax: d } = te(Math.max(0, ...l), i, a, o), f = Math.max(1, d - u), p = E(s), m = Math.max(1, e.length) * x.itemStep, h = x.leftPadding, g = h + m, _ = x.plotTop, v = _ + x.plotHeight, y = h + m + x.rightPadding, b = v, S = v + x.xLabelOffset, C = v + x.axisLabelOffset, w = C + x.legendOffset, O = r && c.length > 1, ie = O ? w + x.svgBottomPadding : C + x.svgBottomPadding, j = (e) => _ + (d - e) / f * x.plotHeight, M = ne(u, d, p), N = k(M, j), P = A(M, j), F = e.map((e, t) => {
|
|
301
301
|
let n = h + t * x.itemStep + x.itemStep / 2;
|
|
302
302
|
return {
|
|
303
303
|
id: `category-${e.yAxis}-${t}`,
|
|
304
304
|
label: e.yAxis,
|
|
305
305
|
x: n
|
|
306
306
|
};
|
|
307
|
-
}),
|
|
308
|
-
let r =
|
|
309
|
-
let i = e[r], a = T(i, t), o =
|
|
307
|
+
}), ae = c.map((t, n) => {
|
|
308
|
+
let r = F.map((n, r) => {
|
|
309
|
+
let i = e[r], a = T(i, t), o = j(D(a, u, d));
|
|
310
310
|
return {
|
|
311
311
|
id: `${t}-${n.id}`,
|
|
312
312
|
label: n.label,
|
|
@@ -321,22 +321,22 @@ function M(e, t, n, r, i, a, o, s) {
|
|
|
321
321
|
colorIndex: n,
|
|
322
322
|
points: r
|
|
323
323
|
};
|
|
324
|
-
}),
|
|
324
|
+
}), I = F.map((e) => ({
|
|
325
325
|
id: `v-guide-${e.id}`,
|
|
326
326
|
x: e.x
|
|
327
|
-
})),
|
|
327
|
+
})), L = O ? re(c, y / 2, w) : [], oe = Math.max(1, ae.length), se = x.itemStep * x.barGroupScale, ce = x.barGap;
|
|
328
328
|
return {
|
|
329
329
|
valueKeys: c,
|
|
330
|
-
categoryTicks:
|
|
331
|
-
seriesModels:
|
|
332
|
-
guides:
|
|
333
|
-
verticalGuides:
|
|
334
|
-
yTicks:
|
|
335
|
-
legendItems:
|
|
336
|
-
svgHeight:
|
|
330
|
+
categoryTicks: F,
|
|
331
|
+
seriesModels: ae,
|
|
332
|
+
guides: N,
|
|
333
|
+
verticalGuides: I,
|
|
334
|
+
yTicks: P,
|
|
335
|
+
legendItems: L,
|
|
336
|
+
svgHeight: ie,
|
|
337
337
|
svgWidth: y,
|
|
338
|
-
barWidth: Math.max(2, Math.min(x.barWidthMax, (
|
|
339
|
-
barGap:
|
|
338
|
+
barWidth: Math.max(2, Math.min(x.barWidthMax, (se - Math.max(0, oe - 1) * ce) / oe)),
|
|
339
|
+
barGap: ce,
|
|
340
340
|
plotLeft: h,
|
|
341
341
|
plotRight: g,
|
|
342
342
|
plotTop: _,
|
|
@@ -347,14 +347,14 @@ function M(e, t, n, r, i, a, o, s) {
|
|
|
347
347
|
legendY: w
|
|
348
348
|
};
|
|
349
349
|
}
|
|
350
|
-
function
|
|
350
|
+
function j(e) {
|
|
351
351
|
return e.map((e) => `${e.x},${e.y}`).join(" ");
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function M(...e) {
|
|
354
354
|
return e.filter(Boolean).join(" ");
|
|
355
355
|
}
|
|
356
|
-
var
|
|
357
|
-
let b = C(s), w = r(() =>
|
|
356
|
+
var N = e(function({ className: e = "", series: t, valueName: n, valueNames: i, palette: a, chartType: o = "line", topSpace: s = 8, yAxisMin: u, yAxisMax: d, yAxisInterval: f, xAxisName: p = "", showXAxisName: m = !0, showLegend: h = !0, minPointHeight: g = 2, style: _, ...v }, y) {
|
|
357
|
+
let b = C(s), w = r(() => ie(t, n, i, h, b, u, d, f), [
|
|
358
358
|
b,
|
|
359
359
|
t,
|
|
360
360
|
h,
|
|
@@ -371,20 +371,20 @@ var F = e(function({ className: e = "", series: t, valueName: n, valueNames: i,
|
|
|
371
371
|
n && (e[`--nabs-ui-charts-series-inline-${t + 1}`] = n);
|
|
372
372
|
}
|
|
373
373
|
return Object.keys(e).length > 0 ? e : void 0;
|
|
374
|
-
}, [a]),
|
|
374
|
+
}, [a]), E = T ? {
|
|
375
375
|
...T,
|
|
376
376
|
..._
|
|
377
|
-
} : _,
|
|
377
|
+
} : _, D = M("nabs-ui-charts", S[o], e), O = m && p.trim().length > 0, ee = w.valueKeys.length > 0 ? w.valueKeys.join(", ") : String(n ?? "value");
|
|
378
378
|
return /* @__PURE__ */ c("div", {
|
|
379
379
|
ref: y,
|
|
380
|
-
className:
|
|
381
|
-
style:
|
|
380
|
+
className: D,
|
|
381
|
+
style: E,
|
|
382
382
|
...v,
|
|
383
383
|
children: /* @__PURE__ */ l("svg", {
|
|
384
384
|
className: "nabs-ui-charts__svg",
|
|
385
385
|
viewBox: `0 0 ${w.svgWidth} ${w.svgHeight}`,
|
|
386
386
|
role: "img",
|
|
387
|
-
"aria-label": `2D ${o} chart for ${
|
|
387
|
+
"aria-label": `2D ${o} chart for ${ee}`,
|
|
388
388
|
preserveAspectRatio: "xMidYMid meet",
|
|
389
389
|
children: [
|
|
390
390
|
/* @__PURE__ */ c("rect", {
|
|
@@ -422,10 +422,10 @@ var F = e(function({ className: e = "", series: t, valueName: n, valueNames: i,
|
|
|
422
422
|
y2: w.xAxisY
|
|
423
423
|
}),
|
|
424
424
|
o === "line" ? w.seriesModels.map((e) => {
|
|
425
|
-
let t =
|
|
425
|
+
let t = M("nabs-ui-charts__line", `nabs-ui-charts__series-color-${e.colorIndex}`), n = M("nabs-ui-charts__point", `nabs-ui-charts__series-color-${e.colorIndex}`);
|
|
426
426
|
return /* @__PURE__ */ l("g", { children: [e.points.length > 1 ? /* @__PURE__ */ c("polyline", {
|
|
427
427
|
className: t,
|
|
428
|
-
points:
|
|
428
|
+
points: j(e.points)
|
|
429
429
|
}) : null, e.points.map((t) => /* @__PURE__ */ c("circle", {
|
|
430
430
|
className: n,
|
|
431
431
|
cx: t.x,
|
|
@@ -438,7 +438,7 @@ var F = e(function({ className: e = "", series: t, valueName: n, valueNames: i,
|
|
|
438
438
|
return /* @__PURE__ */ c("g", { children: w.seriesModels.map((n, r) => {
|
|
439
439
|
let a = n.points[t], o = Math.max(w.xAxisY - a.y, g), s = w.xAxisY - o, l = i + r * (w.barWidth + w.barGap);
|
|
440
440
|
return /* @__PURE__ */ c("rect", {
|
|
441
|
-
className:
|
|
441
|
+
className: M("nabs-ui-charts__bar", `nabs-ui-charts__series-color-${n.colorIndex}`),
|
|
442
442
|
x: l,
|
|
443
443
|
y: s,
|
|
444
444
|
width: w.barWidth,
|
|
@@ -455,14 +455,14 @@ var F = e(function({ className: e = "", series: t, valueName: n, valueNames: i,
|
|
|
455
455
|
y: w.xAxisLabelY,
|
|
456
456
|
children: e.label
|
|
457
457
|
}, `${e.id}-label`)),
|
|
458
|
-
|
|
458
|
+
O ? /* @__PURE__ */ c("text", {
|
|
459
459
|
className: "nabs-ui-charts__axisName",
|
|
460
460
|
x: w.svgWidth / 2,
|
|
461
461
|
y: w.axisNameY,
|
|
462
462
|
children: p
|
|
463
463
|
}) : null,
|
|
464
464
|
w.legendItems.map((e) => {
|
|
465
|
-
let t =
|
|
465
|
+
let t = M("nabs-ui-charts__legendSample", `nabs-ui-charts__series-color-${e.colorIndex}`);
|
|
466
466
|
return /* @__PURE__ */ l("g", { children: [
|
|
467
467
|
/* @__PURE__ */ c("line", {
|
|
468
468
|
className: t,
|
|
@@ -489,8 +489,8 @@ var F = e(function({ className: e = "", series: t, valueName: n, valueNames: i,
|
|
|
489
489
|
})
|
|
490
490
|
});
|
|
491
491
|
});
|
|
492
|
-
|
|
493
|
-
var
|
|
492
|
+
N.displayName = "2DChart";
|
|
493
|
+
var P = {
|
|
494
494
|
svgWidth: 400,
|
|
495
495
|
svgHeight: 180,
|
|
496
496
|
centerX: 88,
|
|
@@ -503,13 +503,13 @@ var I = {
|
|
|
503
503
|
legendSwatchSize: 7,
|
|
504
504
|
legendTextGap: 6
|
|
505
505
|
};
|
|
506
|
-
function
|
|
506
|
+
function F(e) {
|
|
507
507
|
let t = w(e);
|
|
508
508
|
return t > 0 ? t : 0;
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function ae(e, t) {
|
|
511
511
|
let n = e.map((e, n) => {
|
|
512
|
-
let r = String(e.yAxis ?? `Slice ${n + 1}`).trim() || `Slice ${n + 1}`, i =
|
|
512
|
+
let r = String(e.yAxis ?? `Slice ${n + 1}`).trim() || `Slice ${n + 1}`, i = F(e[t]);
|
|
513
513
|
return {
|
|
514
514
|
id: `slice-${r}-${n}`,
|
|
515
515
|
label: r,
|
|
@@ -529,13 +529,13 @@ function R(e, t) {
|
|
|
529
529
|
};
|
|
530
530
|
});
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function I(e, t, n, r) {
|
|
533
533
|
return {
|
|
534
534
|
x: e + n * Math.cos(r),
|
|
535
535
|
y: t + n * Math.sin(r)
|
|
536
536
|
};
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function L(e, t, n) {
|
|
539
539
|
let r = e, i = t - n, a = e, o = t + n;
|
|
540
540
|
return [
|
|
541
541
|
`M ${e} ${t}`,
|
|
@@ -545,7 +545,7 @@ function B(e, t, n) {
|
|
|
545
545
|
"Z"
|
|
546
546
|
].join(" ");
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function oe(e, t, n, r) {
|
|
549
549
|
let i = e, a = t - n, o = e, s = t + n, c = e, l = t - r, u = e, d = t + r;
|
|
550
550
|
return [
|
|
551
551
|
`M ${i} ${a}`,
|
|
@@ -557,16 +557,16 @@ function V(e, t, n, r) {
|
|
|
557
557
|
"Z"
|
|
558
558
|
].join(" ");
|
|
559
559
|
}
|
|
560
|
-
function
|
|
561
|
-
if (e.ratio >= .999999) return t === "donut" ?
|
|
562
|
-
let o = +(e.endAngle - e.startAngle > Math.PI), s =
|
|
560
|
+
function se(e, t, n, r, i, a) {
|
|
561
|
+
if (e.ratio >= .999999) return t === "donut" ? oe(n, r, i, a) : L(n, r, i);
|
|
562
|
+
let o = +(e.endAngle - e.startAngle > Math.PI), s = I(n, r, i, e.startAngle), c = I(n, r, i, e.endAngle);
|
|
563
563
|
if (t === "pie") return [
|
|
564
564
|
`M ${n} ${r}`,
|
|
565
565
|
`L ${s.x} ${s.y}`,
|
|
566
566
|
`A ${i} ${i} 0 ${o} 1 ${c.x} ${c.y}`,
|
|
567
567
|
"Z"
|
|
568
568
|
].join(" ");
|
|
569
|
-
let l =
|
|
569
|
+
let l = I(n, r, a, e.startAngle), u = I(n, r, a, e.endAngle);
|
|
570
570
|
return [
|
|
571
571
|
`M ${s.x} ${s.y}`,
|
|
572
572
|
`A ${i} ${i} 0 ${o} 1 ${c.x} ${c.y}`,
|
|
@@ -575,8 +575,8 @@ function H(e, t, n, r, i, a) {
|
|
|
575
575
|
"Z"
|
|
576
576
|
].join(" ");
|
|
577
577
|
}
|
|
578
|
-
var
|
|
579
|
-
let f = r(() =>
|
|
578
|
+
var ce = e(function({ className: e = "", series: t, valueName: n, palette: i, chartType: a = "pie", showLegend: o = !0, style: s, ...u }, d) {
|
|
579
|
+
let f = r(() => ae(t, n), [t, n]), p = r(() => {
|
|
580
580
|
if (!i || i.length === 0) return;
|
|
581
581
|
let e = {};
|
|
582
582
|
for (let t = 0; t < Math.min(10, i.length); t += 1) {
|
|
@@ -587,7 +587,7 @@ var U = e(function({ className: e = "", series: t, valueName: n, palette: i, cha
|
|
|
587
587
|
}, [i]);
|
|
588
588
|
return /* @__PURE__ */ c("div", {
|
|
589
589
|
ref: d,
|
|
590
|
-
className:
|
|
590
|
+
className: M("nabs-ui-charts", "nabs-ui-charts--pie", `nabs-ui-charts--${a}`, e),
|
|
591
591
|
style: p ? {
|
|
592
592
|
...p,
|
|
593
593
|
...s
|
|
@@ -595,27 +595,27 @@ var U = e(function({ className: e = "", series: t, valueName: n, palette: i, cha
|
|
|
595
595
|
...u,
|
|
596
596
|
children: /* @__PURE__ */ l("svg", {
|
|
597
597
|
className: "nabs-ui-charts__svg",
|
|
598
|
-
viewBox: `0 0 ${
|
|
598
|
+
viewBox: `0 0 ${P.svgWidth} ${P.svgHeight}`,
|
|
599
599
|
role: "img",
|
|
600
600
|
"aria-label": `${a} chart for ${n}`,
|
|
601
601
|
preserveAspectRatio: "xMidYMid meet",
|
|
602
602
|
children: [
|
|
603
603
|
f.length > 0 ? f.map((e) => {
|
|
604
|
-
let t =
|
|
604
|
+
let t = se(e, a, P.centerX, P.centerY, P.radius, P.donutInnerRadius);
|
|
605
605
|
return /* @__PURE__ */ c("path", {
|
|
606
|
-
className:
|
|
606
|
+
className: M("nabs-ui-charts__pieSlice", `nabs-ui-charts__series-color-${e.colorIndex}`),
|
|
607
607
|
d: t,
|
|
608
608
|
children: /* @__PURE__ */ c("title", { children: `${e.label}: ${e.value}` })
|
|
609
609
|
}, e.id);
|
|
610
610
|
}) : null,
|
|
611
611
|
o ? f.map((e, t) => {
|
|
612
|
-
let n =
|
|
612
|
+
let n = P.legendStartY + t * P.legendItemHeight, r = M("nabs-ui-charts__legendSwatch", `nabs-ui-charts__series-color-${e.colorIndex}`), i = n - P.legendSwatchSize / 2, a = P.legendStartX + P.legendSwatchSize + P.legendTextGap;
|
|
613
613
|
return /* @__PURE__ */ l("g", { children: [/* @__PURE__ */ c("rect", {
|
|
614
614
|
className: r,
|
|
615
|
-
x:
|
|
615
|
+
x: P.legendStartX,
|
|
616
616
|
y: i,
|
|
617
|
-
width:
|
|
618
|
-
height:
|
|
617
|
+
width: P.legendSwatchSize,
|
|
618
|
+
height: P.legendSwatchSize,
|
|
619
619
|
rx: 1,
|
|
620
620
|
ry: 1
|
|
621
621
|
}), /* @__PURE__ */ c("text", {
|
|
@@ -627,8 +627,8 @@ var U = e(function({ className: e = "", series: t, valueName: n, palette: i, cha
|
|
|
627
627
|
}) : null,
|
|
628
628
|
f.length === 0 ? /* @__PURE__ */ c("text", {
|
|
629
629
|
className: "nabs-ui-charts__legendLabel",
|
|
630
|
-
x:
|
|
631
|
-
y:
|
|
630
|
+
x: P.centerX,
|
|
631
|
+
y: P.centerY,
|
|
632
632
|
textAnchor: "middle",
|
|
633
633
|
children: "No data"
|
|
634
634
|
}) : null
|
|
@@ -636,56 +636,91 @@ var U = e(function({ className: e = "", series: t, valueName: n, palette: i, cha
|
|
|
636
636
|
})
|
|
637
637
|
});
|
|
638
638
|
});
|
|
639
|
-
|
|
639
|
+
ce.displayName = "PieChart";
|
|
640
640
|
//#endregion
|
|
641
641
|
//#region ../nabs-ui-event-calendar/dist/nabs-ui-event-calendar.js
|
|
642
|
-
var
|
|
642
|
+
var le = [
|
|
643
|
+
"primary",
|
|
644
|
+
"secondary",
|
|
645
|
+
"ghost"
|
|
646
|
+
], ue = "primary", de = {
|
|
647
|
+
primary: "nabs-ui-button--primary",
|
|
648
|
+
secondary: "nabs-ui-button--secondary",
|
|
649
|
+
ghost: "nabs-ui-button--ghost"
|
|
650
|
+
};
|
|
651
|
+
function fe(e) {
|
|
652
|
+
return typeof e == "string" && le.includes(e);
|
|
653
|
+
}
|
|
654
|
+
function pe(e) {
|
|
655
|
+
return fe(e) ? e : ue;
|
|
656
|
+
}
|
|
657
|
+
function R({ variant: e, className: t }) {
|
|
658
|
+
return [
|
|
659
|
+
"nabs-ui-button",
|
|
660
|
+
de[pe(e)],
|
|
661
|
+
t ?? ""
|
|
662
|
+
].filter(Boolean).join(" ");
|
|
663
|
+
}
|
|
664
|
+
var z = e(function({ children: e, className: t = "", variant: n = "primary", type: r = "button", ...i }, a) {
|
|
665
|
+
return /* @__PURE__ */ c("button", {
|
|
666
|
+
ref: a,
|
|
667
|
+
className: R({
|
|
668
|
+
variant: n,
|
|
669
|
+
className: t
|
|
670
|
+
}),
|
|
671
|
+
type: r,
|
|
672
|
+
...i,
|
|
673
|
+
children: e
|
|
674
|
+
});
|
|
675
|
+
});
|
|
676
|
+
z.displayName = "Button";
|
|
677
|
+
var me = [
|
|
643
678
|
"none",
|
|
644
679
|
"top",
|
|
645
680
|
"left"
|
|
646
|
-
],
|
|
681
|
+
], he = {
|
|
647
682
|
none: "nabs-ui-datepicker--label-none",
|
|
648
683
|
top: "nabs-ui-datepicker--label-top",
|
|
649
684
|
left: "nabs-ui-datepicker--label-left"
|
|
650
685
|
};
|
|
651
|
-
function
|
|
652
|
-
return typeof e == "string" &&
|
|
686
|
+
function ge(e) {
|
|
687
|
+
return typeof e == "string" && me.includes(e);
|
|
653
688
|
}
|
|
654
|
-
function
|
|
655
|
-
return
|
|
689
|
+
function _e(e) {
|
|
690
|
+
return ge(e) ? e : "top";
|
|
656
691
|
}
|
|
657
|
-
function
|
|
692
|
+
function B(e, t) {
|
|
658
693
|
return e || `nabs-ui-datepicker-${t.replace(/:/g, "")}`;
|
|
659
694
|
}
|
|
660
|
-
function
|
|
661
|
-
let r =
|
|
695
|
+
function V({ label: e, labelPosition: t, className: n }) {
|
|
696
|
+
let r = _e(t);
|
|
662
697
|
return [
|
|
663
698
|
"nabs-ui-datepicker",
|
|
664
|
-
e ?
|
|
699
|
+
e ? he[r] ?? he.top : "",
|
|
665
700
|
n ?? ""
|
|
666
701
|
].filter(Boolean).join(" ");
|
|
667
702
|
}
|
|
668
|
-
function
|
|
703
|
+
function ve(e) {
|
|
669
704
|
return ["nabs-ui-datepicker__input", e ?? ""].filter(Boolean).join(" ");
|
|
670
705
|
}
|
|
671
|
-
function
|
|
706
|
+
function H(e) {
|
|
672
707
|
return ["nabs-ui-datepicker__label", e ?? ""].filter(Boolean).join(" ");
|
|
673
708
|
}
|
|
674
|
-
function
|
|
709
|
+
function U(e) {
|
|
675
710
|
if (e !== void 0) return e ?? "";
|
|
676
711
|
}
|
|
677
|
-
function
|
|
712
|
+
function ye(e, t) {
|
|
678
713
|
return t && e === "" ? null : e;
|
|
679
714
|
}
|
|
680
|
-
function
|
|
715
|
+
function be({ defaultPrevented: e, disabled: t, readOnly: n }) {
|
|
681
716
|
return !e && !t && !n;
|
|
682
717
|
}
|
|
683
|
-
var
|
|
684
|
-
let g =
|
|
718
|
+
var xe = e(({ label: e, labelPosition: t = "top", className: r = "", inputClassName: i = "", labelClassName: a = "", allowNull: o = !1, id: s, value: u, onChange: d, onClick: f, onValueChange: p, ...m }, h) => {
|
|
719
|
+
let g = B(s, n()), _ = V({
|
|
685
720
|
label: e,
|
|
686
721
|
labelPosition: t,
|
|
687
722
|
className: r
|
|
688
|
-
}), v =
|
|
723
|
+
}), v = ve(i), y = H(a), b = U(u);
|
|
689
724
|
return /* @__PURE__ */ l("div", {
|
|
690
725
|
className: _,
|
|
691
726
|
children: [e ? /* @__PURE__ */ c("label", {
|
|
@@ -701,50 +736,135 @@ var fe = e(({ label: e, labelPosition: t = "top", className: r = "", inputClassN
|
|
|
701
736
|
onClick: (e) => {
|
|
702
737
|
f?.(e);
|
|
703
738
|
let t = e.currentTarget;
|
|
704
|
-
|
|
739
|
+
be({
|
|
705
740
|
defaultPrevented: e.defaultPrevented,
|
|
706
741
|
disabled: t.disabled,
|
|
707
742
|
readOnly: t.readOnly
|
|
708
743
|
}) && t.showPicker?.();
|
|
709
744
|
},
|
|
710
745
|
onChange: (e) => {
|
|
711
|
-
d?.(e), p?.(
|
|
746
|
+
d?.(e), p?.(ye(e.target.value, o), e);
|
|
712
747
|
},
|
|
713
748
|
...m
|
|
714
749
|
})]
|
|
715
750
|
});
|
|
716
751
|
});
|
|
717
|
-
|
|
718
|
-
|
|
752
|
+
xe.displayName = "DatePicker";
|
|
753
|
+
var Se = "a[href], area[href], button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
|
|
754
|
+
function W(e) {
|
|
755
|
+
return Array.from(e.querySelectorAll(Se)).filter((e) => !e.hasAttribute("disabled") && e.getAttribute("aria-hidden") !== "true");
|
|
756
|
+
}
|
|
757
|
+
var Ce = e(function({ title: e, description: r, header: a, footer: o, showHeader: s = !0, showFooter: u = !0, onRequestClose: d, closeOnBackdropClick: f = !0, closeOnEscape: p = !0, initialFocusSelector: m, dialogRole: h = "dialog", className: g = "", backdropClassName: _ = "", headerClassName: v = "", descriptionClassName: y = "", contentClassName: b = "", footerClassName: x = "", onKeyDown: S, tabIndex: C, children: w, ...T }, E) {
|
|
758
|
+
let D = i(null), O = i(null), ee = `nabs-ui-dialog-title-${n().replace(/:/g, "")}`, te = `nabs-ui-dialog-description-${n().replace(/:/g, "")}`, ne = T["aria-labelledby"], re = T["aria-describedby"], k = !a && !!e, A = !!r, ie = s && (!!a || k), j = u && o != null, M = ne ?? (k ? ee : void 0), N = re ?? (A ? te : void 0), P = ["nabs-ui-dialog__backdrop", _].filter(Boolean).join(" "), F = ["nabs-ui-dialog", g].filter(Boolean).join(" "), ae = ["nabs-ui-dialog__header", v].filter(Boolean).join(" "), I = ["nabs-ui-dialog__description", y].filter(Boolean).join(" "), L = ["nabs-ui-dialog__content", b].filter(Boolean).join(" "), oe = ["nabs-ui-dialog__footer", x].filter(Boolean).join(" ");
|
|
759
|
+
return t(() => {
|
|
760
|
+
let e = D.current;
|
|
761
|
+
if (O.current = document.activeElement, m) try {
|
|
762
|
+
let t = e.querySelector(m);
|
|
763
|
+
if (t) return t.focus(), () => {
|
|
764
|
+
O.current?.focus(), O.current = null;
|
|
765
|
+
};
|
|
766
|
+
} catch {}
|
|
767
|
+
let t = W(e);
|
|
768
|
+
return t.length > 0 ? t[0].focus() : e.focus(), () => {
|
|
769
|
+
O.current?.focus(), O.current = null;
|
|
770
|
+
};
|
|
771
|
+
}, [m]), /* @__PURE__ */ c("div", {
|
|
772
|
+
className: P,
|
|
773
|
+
role: "presentation",
|
|
774
|
+
onClick: (e) => {
|
|
775
|
+
!f || e.target !== e.currentTarget || d?.();
|
|
776
|
+
},
|
|
777
|
+
children: /* @__PURE__ */ l("section", {
|
|
778
|
+
ref: (e) => {
|
|
779
|
+
if (D.current = e, typeof E == "function") {
|
|
780
|
+
E(e);
|
|
781
|
+
return;
|
|
782
|
+
}
|
|
783
|
+
E && (E.current = e);
|
|
784
|
+
},
|
|
785
|
+
className: F,
|
|
786
|
+
role: h,
|
|
787
|
+
"aria-modal": "true",
|
|
788
|
+
"aria-labelledby": M,
|
|
789
|
+
"aria-describedby": N,
|
|
790
|
+
tabIndex: C ?? -1,
|
|
791
|
+
onKeyDown: (e) => {
|
|
792
|
+
if (S?.(e), e.defaultPrevented) return;
|
|
793
|
+
if (e.key === "Escape" && p) {
|
|
794
|
+
e.preventDefault(), d?.();
|
|
795
|
+
return;
|
|
796
|
+
}
|
|
797
|
+
if (e.key !== "Tab") return;
|
|
798
|
+
let t = W(D.current);
|
|
799
|
+
if (t.length === 0) {
|
|
800
|
+
e.preventDefault(), D.current.focus();
|
|
801
|
+
return;
|
|
802
|
+
}
|
|
803
|
+
let n = document.activeElement, r = t[0], i = t[t.length - 1];
|
|
804
|
+
if (e.shiftKey) {
|
|
805
|
+
(!n || n === r || !D.current.contains(n)) && (e.preventDefault(), i.focus());
|
|
806
|
+
return;
|
|
807
|
+
}
|
|
808
|
+
(!n || n === i || !D.current.contains(n)) && (e.preventDefault(), r.focus());
|
|
809
|
+
},
|
|
810
|
+
...T,
|
|
811
|
+
children: [
|
|
812
|
+
ie ? /* @__PURE__ */ c("header", {
|
|
813
|
+
className: ae,
|
|
814
|
+
children: a ?? /* @__PURE__ */ c("h3", {
|
|
815
|
+
className: "nabs-ui-dialog__title",
|
|
816
|
+
id: ee,
|
|
817
|
+
children: e
|
|
818
|
+
})
|
|
819
|
+
}) : null,
|
|
820
|
+
A ? /* @__PURE__ */ c("div", {
|
|
821
|
+
id: te,
|
|
822
|
+
className: I,
|
|
823
|
+
children: r
|
|
824
|
+
}) : null,
|
|
825
|
+
/* @__PURE__ */ c("div", {
|
|
826
|
+
className: L,
|
|
827
|
+
children: w
|
|
828
|
+
}),
|
|
829
|
+
j ? /* @__PURE__ */ c("footer", {
|
|
830
|
+
className: oe,
|
|
831
|
+
children: o
|
|
832
|
+
}) : null
|
|
833
|
+
]
|
|
834
|
+
})
|
|
835
|
+
});
|
|
836
|
+
});
|
|
837
|
+
Ce.displayName = "Dialog";
|
|
838
|
+
function we(e) {
|
|
719
839
|
return e.label ?? e.children ?? e.value;
|
|
720
840
|
}
|
|
721
|
-
function
|
|
841
|
+
function G(e, t) {
|
|
722
842
|
return e.value || `item-${t}`;
|
|
723
843
|
}
|
|
724
|
-
function
|
|
844
|
+
function K(e, t, n) {
|
|
725
845
|
return e || t === null || n === null;
|
|
726
846
|
}
|
|
727
|
-
function
|
|
847
|
+
function Te(e, t) {
|
|
728
848
|
return e || `nabs-ui-dropdownlist-${t.replace(/:/g, "")}`;
|
|
729
849
|
}
|
|
730
|
-
function
|
|
850
|
+
function Ee({ disabled: e = !1, className: t }) {
|
|
731
851
|
return [
|
|
732
852
|
"nabs-ui-dropdownlist",
|
|
733
853
|
e ? "nabs-ui-dropdownlist--disabled" : "",
|
|
734
854
|
t ?? ""
|
|
735
855
|
].filter(Boolean).join(" ");
|
|
736
856
|
}
|
|
737
|
-
function
|
|
738
|
-
return
|
|
857
|
+
function De(e, t, n) {
|
|
858
|
+
return K(e, t, n);
|
|
739
859
|
}
|
|
740
|
-
function
|
|
860
|
+
function Oe(e) {
|
|
741
861
|
return e === "" ? null : e;
|
|
742
862
|
}
|
|
743
|
-
var
|
|
744
|
-
let h =
|
|
863
|
+
var ke = e(function({ items: e = [], value: t, defaultValue: r, allowNull: i = !1, nullLabel: a = "None", className: o = "", onChange: s, onValueChange: u, id: d, disabled: f, ...p }, m) {
|
|
864
|
+
let h = Te(d, n()), g = Ee({
|
|
745
865
|
disabled: f,
|
|
746
866
|
className: o
|
|
747
|
-
}), _ =
|
|
867
|
+
}), _ = De(i, t, r);
|
|
748
868
|
return /* @__PURE__ */ l("select", {
|
|
749
869
|
ref: m,
|
|
750
870
|
id: h,
|
|
@@ -753,7 +873,7 @@ var be = e(function({ items: e = [], value: t, defaultValue: r, allowNull: i = !
|
|
|
753
873
|
value: t ?? void 0,
|
|
754
874
|
defaultValue: r ?? void 0,
|
|
755
875
|
onChange: (e) => {
|
|
756
|
-
let t =
|
|
876
|
+
let t = Oe(e.target.value);
|
|
757
877
|
u?.(t, e), s?.(e);
|
|
758
878
|
},
|
|
759
879
|
...p,
|
|
@@ -764,27 +884,660 @@ var be = e(function({ items: e = [], value: t, defaultValue: r, allowNull: i = !
|
|
|
764
884
|
}) : null, e.map((e, t) => /* @__PURE__ */ c("option", {
|
|
765
885
|
value: e.value,
|
|
766
886
|
disabled: e.disabled,
|
|
767
|
-
children:
|
|
768
|
-
},
|
|
887
|
+
children: we(e)
|
|
888
|
+
}, G(e, t)))]
|
|
889
|
+
});
|
|
890
|
+
});
|
|
891
|
+
ke.displayName = "DropdownList";
|
|
892
|
+
var Ae = [
|
|
893
|
+
"right",
|
|
894
|
+
"left",
|
|
895
|
+
"top",
|
|
896
|
+
"bottom"
|
|
897
|
+
], je = "right", Me = {
|
|
898
|
+
right: "nabs-ui-checkbox--label-right",
|
|
899
|
+
left: "nabs-ui-checkbox--label-left",
|
|
900
|
+
top: "nabs-ui-checkbox--label-top",
|
|
901
|
+
bottom: "nabs-ui-checkbox--label-bottom"
|
|
902
|
+
};
|
|
903
|
+
function Ne(e) {
|
|
904
|
+
return typeof e == "string" && Ae.includes(e);
|
|
905
|
+
}
|
|
906
|
+
function q(e) {
|
|
907
|
+
return Ne(e) ? e : je;
|
|
908
|
+
}
|
|
909
|
+
function Pe(e, t) {
|
|
910
|
+
return e || `nabs-ui-checkbox-${t.replace(/:/g, "")}`;
|
|
911
|
+
}
|
|
912
|
+
function Fe({ disabled: e = !1, labelPosition: t, className: n }) {
|
|
913
|
+
let r = q(t);
|
|
914
|
+
return [
|
|
915
|
+
"nabs-ui-checkbox",
|
|
916
|
+
e ? "nabs-ui-checkbox--disabled" : "",
|
|
917
|
+
Me[r],
|
|
918
|
+
n ?? ""
|
|
919
|
+
].filter(Boolean).join(" ");
|
|
920
|
+
}
|
|
921
|
+
function Ie(e) {
|
|
922
|
+
return ["nabs-ui-checkbox__input", e ?? ""].filter(Boolean).join(" ");
|
|
923
|
+
}
|
|
924
|
+
function J(e) {
|
|
925
|
+
return ["nabs-ui-checkbox__label", e ?? ""].filter(Boolean).join(" ");
|
|
926
|
+
}
|
|
927
|
+
var Y = e(function({ label: e = "Checkbox", labelPosition: t = "right", className: r = "", inputClassName: i = "", labelClassName: a = "", id: o, disabled: s, ...u }, d) {
|
|
928
|
+
let f = Pe(o, n()), p = Fe({
|
|
929
|
+
disabled: s,
|
|
930
|
+
labelPosition: t,
|
|
931
|
+
className: r
|
|
932
|
+
}), m = Ie(i), h = J(a);
|
|
933
|
+
return /* @__PURE__ */ l("label", {
|
|
934
|
+
className: p,
|
|
935
|
+
htmlFor: f,
|
|
936
|
+
children: [/* @__PURE__ */ c("input", {
|
|
937
|
+
ref: d,
|
|
938
|
+
id: f,
|
|
939
|
+
className: m,
|
|
940
|
+
type: "checkbox",
|
|
941
|
+
disabled: s,
|
|
942
|
+
...u
|
|
943
|
+
}), /* @__PURE__ */ c("span", {
|
|
944
|
+
className: h,
|
|
945
|
+
children: e
|
|
946
|
+
})]
|
|
947
|
+
});
|
|
948
|
+
});
|
|
949
|
+
Y.displayName = "Checkbox";
|
|
950
|
+
var Le = [
|
|
951
|
+
"right",
|
|
952
|
+
"left",
|
|
953
|
+
"top",
|
|
954
|
+
"bottom"
|
|
955
|
+
], Re = "right", ze = {
|
|
956
|
+
right: "nabs-ui-radiobutton--label-right",
|
|
957
|
+
left: "nabs-ui-radiobutton--label-left",
|
|
958
|
+
top: "nabs-ui-radiobutton--label-top",
|
|
959
|
+
bottom: "nabs-ui-radiobutton--label-bottom"
|
|
960
|
+
};
|
|
961
|
+
function X(e) {
|
|
962
|
+
return typeof e == "string" && Le.includes(e);
|
|
963
|
+
}
|
|
964
|
+
function Be(e) {
|
|
965
|
+
return X(e) ? e : Re;
|
|
966
|
+
}
|
|
967
|
+
function Ve(e, t) {
|
|
968
|
+
return e || `nabs-ui-radiobutton-${t.replace(/:/g, "")}`;
|
|
969
|
+
}
|
|
970
|
+
function He({ disabled: e = !1, labelPosition: t, className: n }) {
|
|
971
|
+
let r = Be(t);
|
|
972
|
+
return [
|
|
973
|
+
"nabs-ui-radiobutton",
|
|
974
|
+
e ? "nabs-ui-radiobutton--disabled" : "",
|
|
975
|
+
ze[r],
|
|
976
|
+
n ?? ""
|
|
977
|
+
].filter(Boolean).join(" ");
|
|
978
|
+
}
|
|
979
|
+
function Ue(e) {
|
|
980
|
+
return ["nabs-ui-radiobutton__input", e ?? ""].filter(Boolean).join(" ");
|
|
981
|
+
}
|
|
982
|
+
function We(e) {
|
|
983
|
+
return ["nabs-ui-radiobutton__label", e ?? ""].filter(Boolean).join(" ");
|
|
984
|
+
}
|
|
985
|
+
function Ge({ label: e = "Radio button", labelPosition: t = "right", className: r = "", inputClassName: i = "", labelClassName: a = "", id: o, ...s }) {
|
|
986
|
+
let u = s.disabled === !0, d = Ve(o, n()), f = He({
|
|
987
|
+
disabled: u,
|
|
988
|
+
labelPosition: t,
|
|
989
|
+
className: r
|
|
990
|
+
}), p = Ue(i), m = We(a);
|
|
991
|
+
return /* @__PURE__ */ l("label", {
|
|
992
|
+
className: f,
|
|
993
|
+
htmlFor: d,
|
|
994
|
+
children: [/* @__PURE__ */ c("input", {
|
|
995
|
+
id: d,
|
|
996
|
+
className: p,
|
|
997
|
+
type: "radio",
|
|
998
|
+
...s
|
|
999
|
+
}), /* @__PURE__ */ c("span", {
|
|
1000
|
+
className: m,
|
|
1001
|
+
children: e
|
|
1002
|
+
})]
|
|
1003
|
+
});
|
|
1004
|
+
}
|
|
1005
|
+
var Ke = [
|
|
1006
|
+
"vertical",
|
|
1007
|
+
"none",
|
|
1008
|
+
"horizontal",
|
|
1009
|
+
"both"
|
|
1010
|
+
], qe = "vertical";
|
|
1011
|
+
function Je(e) {
|
|
1012
|
+
return typeof e == "string" && Ke.includes(e);
|
|
1013
|
+
}
|
|
1014
|
+
function Ye(e) {
|
|
1015
|
+
return Je(e) ? e : qe;
|
|
1016
|
+
}
|
|
1017
|
+
function Xe(e, t) {
|
|
1018
|
+
return e || `nabs-ui-textarea-${t.replace(/:/g, "")}`;
|
|
1019
|
+
}
|
|
1020
|
+
function Ze(e) {
|
|
1021
|
+
return ["nabs-ui-textarea", e ?? ""].filter(Boolean).join(" ");
|
|
1022
|
+
}
|
|
1023
|
+
function Qe(e) {
|
|
1024
|
+
return ["nabs-ui-textarea__input", e ?? ""].filter(Boolean).join(" ");
|
|
1025
|
+
}
|
|
1026
|
+
function $e(e) {
|
|
1027
|
+
return ["nabs-ui-textarea__label", e ?? ""].filter(Boolean).join(" ");
|
|
1028
|
+
}
|
|
1029
|
+
function et({ rows: e, resize: t }) {
|
|
1030
|
+
return {
|
|
1031
|
+
renderedRows: typeof e == "number" ? e : 4,
|
|
1032
|
+
renderedResize: Ye(t)
|
|
1033
|
+
};
|
|
1034
|
+
}
|
|
1035
|
+
var tt = e(({ label: e, className: t = "", inputClassName: r = "", labelClassName: i = "", id: a, rows: o = 4, resize: s = "vertical", ...u }, d) => {
|
|
1036
|
+
let f = Xe(a, n()), p = Ze(t), m = Qe(r), h = $e(i), { renderedRows: g, renderedResize: _ } = et({
|
|
1037
|
+
rows: o,
|
|
1038
|
+
resize: s
|
|
1039
|
+
});
|
|
1040
|
+
return /* @__PURE__ */ l("div", {
|
|
1041
|
+
className: p,
|
|
1042
|
+
children: [e ? /* @__PURE__ */ c("label", {
|
|
1043
|
+
className: h,
|
|
1044
|
+
htmlFor: f,
|
|
1045
|
+
children: e
|
|
1046
|
+
}) : null, /* @__PURE__ */ c("textarea", {
|
|
1047
|
+
ref: d,
|
|
1048
|
+
id: f,
|
|
1049
|
+
className: m,
|
|
1050
|
+
rows: g,
|
|
1051
|
+
"data-resize": _,
|
|
1052
|
+
...u
|
|
1053
|
+
})]
|
|
769
1054
|
});
|
|
770
1055
|
});
|
|
771
|
-
|
|
772
|
-
var
|
|
1056
|
+
tt.displayName = "Textarea";
|
|
1057
|
+
var nt = [
|
|
1058
|
+
"none",
|
|
1059
|
+
"top",
|
|
1060
|
+
"left"
|
|
1061
|
+
], rt = ["default", "currency"], it = "default", at = {
|
|
1062
|
+
none: "",
|
|
1063
|
+
top: "nabs-ui-textbox--label-top",
|
|
1064
|
+
left: "nabs-ui-textbox--label-left"
|
|
1065
|
+
};
|
|
1066
|
+
function ot(e) {
|
|
1067
|
+
return typeof e == "string" && nt.includes(e);
|
|
1068
|
+
}
|
|
1069
|
+
function st(e) {
|
|
1070
|
+
return ot(e) ? e : "top";
|
|
1071
|
+
}
|
|
1072
|
+
function ct(e) {
|
|
1073
|
+
return typeof e == "string" && rt.includes(e);
|
|
1074
|
+
}
|
|
1075
|
+
function lt(e) {
|
|
1076
|
+
return ct(e) ? e : it;
|
|
1077
|
+
}
|
|
1078
|
+
function ut(e) {
|
|
1079
|
+
if (typeof e == "number") return Number.isFinite(e);
|
|
1080
|
+
if (typeof e == "string") {
|
|
1081
|
+
let t = e.trim().replace(/,/g, "");
|
|
1082
|
+
if (!t) return !1;
|
|
1083
|
+
let n = Number(t);
|
|
1084
|
+
return Number.isFinite(n);
|
|
1085
|
+
}
|
|
1086
|
+
return !1;
|
|
1087
|
+
}
|
|
1088
|
+
function dt(e, t) {
|
|
1089
|
+
return e || `nabs-ui-textbox-${t.replace(/:/g, "")}`;
|
|
1090
|
+
}
|
|
1091
|
+
function ft({ label: e, labelPosition: t, className: n }) {
|
|
1092
|
+
let r = st(t);
|
|
1093
|
+
return [
|
|
1094
|
+
"nabs-ui-textbox",
|
|
1095
|
+
e ? at[r] ?? at.top : "",
|
|
1096
|
+
n ?? ""
|
|
1097
|
+
].filter(Boolean).join(" ");
|
|
1098
|
+
}
|
|
1099
|
+
function pt(e, t = !1) {
|
|
1100
|
+
return [
|
|
1101
|
+
"nabs-ui-textbox__input",
|
|
1102
|
+
t ? "nabs-ui-textbox__input--numeric" : "",
|
|
1103
|
+
e ?? ""
|
|
1104
|
+
].filter(Boolean).join(" ");
|
|
1105
|
+
}
|
|
1106
|
+
function mt(e) {
|
|
1107
|
+
return ["nabs-ui-textbox__label", e ?? ""].filter(Boolean).join(" ");
|
|
1108
|
+
}
|
|
1109
|
+
function ht(e) {
|
|
1110
|
+
if (e === "" || e == null) return "";
|
|
1111
|
+
if (typeof e == "number") return e.toFixed(2);
|
|
1112
|
+
if (typeof e == "string") {
|
|
1113
|
+
let t = e.trim();
|
|
1114
|
+
if (!t) return "";
|
|
1115
|
+
let n = Number.parseFloat(t);
|
|
1116
|
+
return Number.isNaN(n) ? e : n.toFixed(2);
|
|
1117
|
+
}
|
|
1118
|
+
return e;
|
|
1119
|
+
}
|
|
1120
|
+
function gt({ format: e, type: t = "text", inputMode: n, value: r }) {
|
|
1121
|
+
let i = lt(e) === "currency";
|
|
1122
|
+
return {
|
|
1123
|
+
isCurrency: i,
|
|
1124
|
+
shouldRightAlign: i || t === "number" || ut(r),
|
|
1125
|
+
renderedType: i ? "text" : t,
|
|
1126
|
+
renderedInputMode: i ? n ?? "decimal" : n,
|
|
1127
|
+
renderedValue: i ? ht(r) : r
|
|
1128
|
+
};
|
|
1129
|
+
}
|
|
1130
|
+
var _t = e(({ label: e, labelPosition: t = "top", className: r = "", inputClassName: i = "", labelClassName: a = "", format: o = "default", currencySymbol: s = "$", id: u, type: d = "text", value: f, inputMode: p, ...m }, h) => {
|
|
1131
|
+
let g = dt(u, n()), _ = ft({
|
|
1132
|
+
label: e,
|
|
1133
|
+
labelPosition: t,
|
|
1134
|
+
className: r
|
|
1135
|
+
}), v = mt(a), { isCurrency: y, shouldRightAlign: b, renderedType: x, renderedInputMode: S, renderedValue: C } = gt({
|
|
1136
|
+
format: o,
|
|
1137
|
+
type: d,
|
|
1138
|
+
inputMode: p,
|
|
1139
|
+
value: f
|
|
1140
|
+
}), w = pt(i, b);
|
|
1141
|
+
return /* @__PURE__ */ l("div", {
|
|
1142
|
+
className: _,
|
|
1143
|
+
children: [e ? /* @__PURE__ */ c("label", {
|
|
1144
|
+
className: v,
|
|
1145
|
+
htmlFor: g,
|
|
1146
|
+
children: e
|
|
1147
|
+
}) : null, y ? /* @__PURE__ */ l("div", {
|
|
1148
|
+
className: "nabs-ui-textbox__currencyWrap",
|
|
1149
|
+
children: [/* @__PURE__ */ c("span", {
|
|
1150
|
+
className: "nabs-ui-textbox__currencySymbol",
|
|
1151
|
+
"aria-hidden": "true",
|
|
1152
|
+
children: s
|
|
1153
|
+
}), /* @__PURE__ */ c("input", {
|
|
1154
|
+
ref: h,
|
|
1155
|
+
id: g,
|
|
1156
|
+
className: w,
|
|
1157
|
+
type: x,
|
|
1158
|
+
inputMode: S,
|
|
1159
|
+
value: C,
|
|
1160
|
+
...m
|
|
1161
|
+
})]
|
|
1162
|
+
}) : /* @__PURE__ */ c("input", {
|
|
1163
|
+
ref: h,
|
|
1164
|
+
id: g,
|
|
1165
|
+
className: w,
|
|
1166
|
+
type: x,
|
|
1167
|
+
inputMode: S,
|
|
1168
|
+
value: C,
|
|
1169
|
+
...m
|
|
1170
|
+
})]
|
|
1171
|
+
});
|
|
1172
|
+
});
|
|
1173
|
+
_t.displayName = "Textbox";
|
|
1174
|
+
function vt(e) {
|
|
1175
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1176
|
+
}
|
|
1177
|
+
function yt(e) {
|
|
1178
|
+
return !e || e.type !== "object" || !vt(e.properties) ? {} : Object.fromEntries(Object.entries(e.properties).map(([e, t]) => [e, bt(t)]));
|
|
1179
|
+
}
|
|
1180
|
+
function bt(e) {
|
|
1181
|
+
if (!e || !vt(e)) return "";
|
|
1182
|
+
if (e.default !== void 0) return e.default;
|
|
1183
|
+
if (Array.isArray(e.enum) && e.enum.length > 0) return e.enum[0];
|
|
1184
|
+
switch (e.type) {
|
|
1185
|
+
case "boolean": return !1;
|
|
1186
|
+
case "integer":
|
|
1187
|
+
case "number": return "";
|
|
1188
|
+
case "object": return yt(e);
|
|
1189
|
+
default: return "";
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
function xt(e, t) {
|
|
1193
|
+
if (!e || !vt(e)) return t;
|
|
1194
|
+
if (e.type === "object" && vt(e.properties)) {
|
|
1195
|
+
let n = vt(t) ? t : {};
|
|
1196
|
+
return Object.fromEntries(Object.entries(e.properties).map(([e, t]) => [e, xt(t, n[e] === void 0 ? bt(t) : n[e])]));
|
|
1197
|
+
}
|
|
1198
|
+
if (e.type === "boolean") return t === !0;
|
|
1199
|
+
if (e.type === "integer") {
|
|
1200
|
+
if (t === "" || t == null) return "";
|
|
1201
|
+
let e = Number.parseInt(String(t), 10);
|
|
1202
|
+
return Number.isNaN(e) ? "" : e;
|
|
1203
|
+
}
|
|
1204
|
+
if (e.type === "number") {
|
|
1205
|
+
if (t === "" || t == null) return "";
|
|
1206
|
+
let e = Number.parseFloat(String(t));
|
|
1207
|
+
return Number.isNaN(e) ? "" : e;
|
|
1208
|
+
}
|
|
1209
|
+
return t ?? "";
|
|
1210
|
+
}
|
|
1211
|
+
function St(e) {
|
|
1212
|
+
if (!e || !vt(e)) return "textbox";
|
|
1213
|
+
if (Array.isArray(e.enum) && e.enum.length > 0) return "radio";
|
|
1214
|
+
if (e.type === "string") return e.maxLength !== void 0 && e.maxLength > 50 ? "textarea" : "textbox";
|
|
1215
|
+
if (e.type === "integer") return "int";
|
|
1216
|
+
if (e.type === "number") {
|
|
1217
|
+
let t = String(e.format ?? "").toLowerCase(), n = String(e.currencySymbol ?? "").trim().length > 0;
|
|
1218
|
+
return t === "decimal" ? n ? "currencyDecimal" : "decimal" : n ? "currencyDouble" : "double";
|
|
1219
|
+
}
|
|
1220
|
+
return e.type === "boolean" ? "bool" : "textbox";
|
|
1221
|
+
}
|
|
1222
|
+
var Ct = {
|
|
1223
|
+
type: "object",
|
|
1224
|
+
properties: {}
|
|
1225
|
+
};
|
|
1226
|
+
function wt({ schema: e, name: t, value: n, onChange: r }) {
|
|
1227
|
+
let i = e.title ?? t, a = e.description, o = St(e), s = n;
|
|
1228
|
+
if (o === "radio") {
|
|
1229
|
+
let n = e.enum;
|
|
1230
|
+
return /* @__PURE__ */ l("fieldset", {
|
|
1231
|
+
className: "nabs-ui-dynamicform__fieldset",
|
|
1232
|
+
children: [
|
|
1233
|
+
/* @__PURE__ */ c("legend", {
|
|
1234
|
+
className: "nabs-ui-dynamicform__legend",
|
|
1235
|
+
children: i
|
|
1236
|
+
}),
|
|
1237
|
+
a ? /* @__PURE__ */ c("p", {
|
|
1238
|
+
className: "nabs-ui-dynamicform__description",
|
|
1239
|
+
children: a
|
|
1240
|
+
}) : null,
|
|
1241
|
+
/* @__PURE__ */ c("div", {
|
|
1242
|
+
className: "nabs-ui-dynamicform__radioGroup",
|
|
1243
|
+
children: n.map((e) => /* @__PURE__ */ c(Ge, {
|
|
1244
|
+
label: String(e),
|
|
1245
|
+
name: t,
|
|
1246
|
+
checked: s === e,
|
|
1247
|
+
onChange: () => r(e)
|
|
1248
|
+
}, String(e)))
|
|
1249
|
+
})
|
|
1250
|
+
]
|
|
1251
|
+
});
|
|
1252
|
+
}
|
|
1253
|
+
if (o === "textarea") return /* @__PURE__ */ c(tt, {
|
|
1254
|
+
label: i,
|
|
1255
|
+
rows: 5,
|
|
1256
|
+
value: String(s),
|
|
1257
|
+
placeholder: String(e.default ?? ""),
|
|
1258
|
+
onChange: (e) => r(e.target.value)
|
|
1259
|
+
});
|
|
1260
|
+
if (o === "bool") return /* @__PURE__ */ c(Y, {
|
|
1261
|
+
label: i,
|
|
1262
|
+
checked: s === !0,
|
|
1263
|
+
onChange: (e) => r(e.target.checked)
|
|
1264
|
+
});
|
|
1265
|
+
let u = o === "currencyDecimal" || o === "currencyDouble", d = o === "int" || o === "decimal" || o === "double" || o === "currencyDecimal" || o === "currencyDouble", f = d ? "number" : "text", p = o === "int" ? 1 : d ? "any" : void 0, m = String(e.currencySymbol ?? "").trim(), h = u && m.length > 0, g = (e) => {
|
|
1266
|
+
if (o === "int") {
|
|
1267
|
+
r(e === "" ? "" : Number.parseInt(e, 10));
|
|
1268
|
+
return;
|
|
1269
|
+
}
|
|
1270
|
+
if (o === "decimal" || o === "double" || o === "currencyDecimal" || o === "currencyDouble") {
|
|
1271
|
+
r(e === "" ? "" : Number.parseFloat(e));
|
|
1272
|
+
return;
|
|
1273
|
+
}
|
|
1274
|
+
r(e);
|
|
1275
|
+
};
|
|
1276
|
+
return /* @__PURE__ */ c(_t, {
|
|
1277
|
+
label: i,
|
|
1278
|
+
type: f,
|
|
1279
|
+
step: p,
|
|
1280
|
+
format: h ? "currency" : "default",
|
|
1281
|
+
currencySymbol: h ? m : void 0,
|
|
1282
|
+
value: String(s),
|
|
1283
|
+
placeholder: String(e.default ?? ""),
|
|
1284
|
+
onChange: (e) => g(e.target.value)
|
|
1285
|
+
});
|
|
1286
|
+
}
|
|
1287
|
+
var Tt = e(function({ schema: e, value: r, onChange: i, className: o = "", id: s, disabled: u = !1, ...d }, f) {
|
|
1288
|
+
let p = n(), m = s ?? `nabs-ui-dynamicform-${p.replace(/:/g, "")}`, h = e && e.type === "object" ? e : Ct, [g, _] = a(() => xt(h, r ?? yt(h)));
|
|
1289
|
+
t(() => {
|
|
1290
|
+
_(xt(h, r ?? yt(h)));
|
|
1291
|
+
}, [h, r]);
|
|
1292
|
+
let v = g, y = h.title ?? "Dynamic form", b = h.description, x = [
|
|
1293
|
+
"nabs-ui-dynamicform",
|
|
1294
|
+
u ? "nabs-ui-dynamicform--disabled" : "",
|
|
1295
|
+
o
|
|
1296
|
+
].filter(Boolean).join(" "), S = (e) => {
|
|
1297
|
+
_(e), i?.(e);
|
|
1298
|
+
};
|
|
1299
|
+
return u ? /* @__PURE__ */ l("div", {
|
|
1300
|
+
ref: f,
|
|
1301
|
+
id: m,
|
|
1302
|
+
className: x,
|
|
1303
|
+
"aria-disabled": "true",
|
|
1304
|
+
...d,
|
|
1305
|
+
children: [/* @__PURE__ */ l("div", {
|
|
1306
|
+
className: "nabs-ui-dynamicform__header",
|
|
1307
|
+
children: [/* @__PURE__ */ c("div", {
|
|
1308
|
+
className: "nabs-ui-dynamicform__title",
|
|
1309
|
+
children: y
|
|
1310
|
+
}), b ? /* @__PURE__ */ c("div", {
|
|
1311
|
+
className: "nabs-ui-dynamicform__description",
|
|
1312
|
+
children: b
|
|
1313
|
+
}) : null]
|
|
1314
|
+
}), /* @__PURE__ */ c("div", {
|
|
1315
|
+
className: "nabs-ui-dynamicform__fields",
|
|
1316
|
+
children: Object.entries(h.properties ?? {}).map(([e, t]) => /* @__PURE__ */ c("div", {
|
|
1317
|
+
className: "nabs-ui-dynamicform__field",
|
|
1318
|
+
children: /* @__PURE__ */ c(wt, {
|
|
1319
|
+
schema: t,
|
|
1320
|
+
name: e,
|
|
1321
|
+
value: v[e],
|
|
1322
|
+
onChange: (n) => S({
|
|
1323
|
+
...v,
|
|
1324
|
+
[e]: xt(t, n)
|
|
1325
|
+
})
|
|
1326
|
+
})
|
|
1327
|
+
}, e))
|
|
1328
|
+
})]
|
|
1329
|
+
}) : /* @__PURE__ */ l("div", {
|
|
1330
|
+
ref: f,
|
|
1331
|
+
id: m,
|
|
1332
|
+
className: x,
|
|
1333
|
+
...d,
|
|
1334
|
+
children: [/* @__PURE__ */ l("div", {
|
|
1335
|
+
className: "nabs-ui-dynamicform__header",
|
|
1336
|
+
children: [/* @__PURE__ */ c("div", {
|
|
1337
|
+
className: "nabs-ui-dynamicform__title",
|
|
1338
|
+
children: y
|
|
1339
|
+
}), b ? /* @__PURE__ */ c("div", {
|
|
1340
|
+
className: "nabs-ui-dynamicform__description",
|
|
1341
|
+
children: b
|
|
1342
|
+
}) : null]
|
|
1343
|
+
}), /* @__PURE__ */ c("div", {
|
|
1344
|
+
className: "nabs-ui-dynamicform__fields",
|
|
1345
|
+
children: Object.entries(h.properties ?? {}).map(([e, t]) => /* @__PURE__ */ c("div", {
|
|
1346
|
+
className: "nabs-ui-dynamicform__field",
|
|
1347
|
+
children: /* @__PURE__ */ c(wt, {
|
|
1348
|
+
schema: t,
|
|
1349
|
+
name: e,
|
|
1350
|
+
value: v[e],
|
|
1351
|
+
onChange: (n) => S({
|
|
1352
|
+
...v,
|
|
1353
|
+
[e]: xt(t, n)
|
|
1354
|
+
})
|
|
1355
|
+
})
|
|
1356
|
+
}, e))
|
|
1357
|
+
})]
|
|
1358
|
+
});
|
|
1359
|
+
});
|
|
1360
|
+
Tt.displayName = "DynamicForm";
|
|
1361
|
+
function Et(e) {
|
|
1362
|
+
return e ? (Array.isArray(e) ? e : String(e).split(",")).map((e) => e.trim().toLowerCase()).filter(Boolean).map((e) => e.startsWith(".") ? e : `.${e}`) : [];
|
|
1363
|
+
}
|
|
1364
|
+
function Dt(e, t) {
|
|
1365
|
+
let n = String(e).split(",").map((e) => e.trim().toLowerCase()).filter(Boolean), r = Et(t);
|
|
1366
|
+
return [.../* @__PURE__ */ new Set([...n, ...r])];
|
|
1367
|
+
}
|
|
1368
|
+
function Ot(e, t) {
|
|
1369
|
+
let n = e.name.toLowerCase(), r = (e.type ?? "").toLowerCase();
|
|
1370
|
+
return t === "*/*" ? !0 : t.endsWith("/*") ? r.startsWith(t.slice(0, -1)) : t.startsWith(".") ? n.endsWith(t) : r === t;
|
|
1371
|
+
}
|
|
1372
|
+
function kt(e, t) {
|
|
1373
|
+
if (t.length === 0) return {
|
|
1374
|
+
acceptedFiles: e,
|
|
1375
|
+
rejectedFiles: []
|
|
1376
|
+
};
|
|
1377
|
+
let n = [], r = [];
|
|
1378
|
+
for (let i of e) (t.some((e) => Ot(i, e)) ? n : r).push(i);
|
|
1379
|
+
return {
|
|
1380
|
+
acceptedFiles: n,
|
|
1381
|
+
rejectedFiles: r
|
|
1382
|
+
};
|
|
1383
|
+
}
|
|
1384
|
+
function At(e, t) {
|
|
1385
|
+
return e || `nabs-ui-fileupload-${t.replace(/:/g, "")}`;
|
|
1386
|
+
}
|
|
1387
|
+
function jt({ disabled: e, isDragOver: t, className: n, surfaceClassName: r, labelClassName: i, descriptionClassName: a, buttonClassName: o, inputClassName: s }) {
|
|
1388
|
+
return {
|
|
1389
|
+
classes: [
|
|
1390
|
+
"nabs-ui-fileupload",
|
|
1391
|
+
e ? "nabs-ui-fileupload--disabled" : "",
|
|
1392
|
+
t ? "nabs-ui-fileupload--drag-over" : "",
|
|
1393
|
+
n ?? ""
|
|
1394
|
+
].filter(Boolean).join(" "),
|
|
1395
|
+
surfaceClasses: ["nabs-ui-fileupload__surface", r ?? ""].filter(Boolean).join(" "),
|
|
1396
|
+
labelClasses: ["nabs-ui-fileupload__label", i ?? ""].filter(Boolean).join(" "),
|
|
1397
|
+
descriptionClasses: ["nabs-ui-fileupload__description", a ?? ""].filter(Boolean).join(" "),
|
|
1398
|
+
buttonClasses: ["nabs-ui-fileupload__button", o ?? ""].filter(Boolean).join(" "),
|
|
1399
|
+
inputClasses: ["nabs-ui-fileupload__input", s ?? ""].filter(Boolean).join(" ")
|
|
1400
|
+
};
|
|
1401
|
+
}
|
|
1402
|
+
function Mt(e) {
|
|
1403
|
+
return e.length > 0 ? e.join(",") : void 0;
|
|
1404
|
+
}
|
|
1405
|
+
function Nt({ label: e = "Drop files here or click Browse files", description: t = "Drag and drop files into the drop zone or choose them manually.", accept: r = "", extensions: o = [], multiple: s = !0, disabled: u = !1, className: d = "", surfaceClassName: f = "", labelClassName: p = "", descriptionClassName: m = "", buttonClassName: h = "", inputClassName: g = "", id: _, onFilesSelected: v, ...y }) {
|
|
1406
|
+
let b = At(_, n()), x = i(null), [S, C] = a(!1), w = Dt(r, o), T = Mt(w), { classes: E, surfaceClasses: D, labelClasses: O, descriptionClasses: ee, buttonClasses: te, inputClasses: ne } = jt({
|
|
1407
|
+
disabled: u,
|
|
1408
|
+
isDragOver: S,
|
|
1409
|
+
className: d,
|
|
1410
|
+
surfaceClassName: f,
|
|
1411
|
+
labelClassName: p,
|
|
1412
|
+
descriptionClassName: m,
|
|
1413
|
+
buttonClassName: h,
|
|
1414
|
+
inputClassName: g
|
|
1415
|
+
}), re = (e, t) => {
|
|
1416
|
+
let { acceptedFiles: n, rejectedFiles: r } = kt(Array.from(e ?? []), w);
|
|
1417
|
+
v?.({
|
|
1418
|
+
acceptedFiles: n,
|
|
1419
|
+
rejectedFiles: r,
|
|
1420
|
+
source: t
|
|
1421
|
+
});
|
|
1422
|
+
}, k = () => {
|
|
1423
|
+
u || x.current?.click();
|
|
1424
|
+
}, A = (e) => {
|
|
1425
|
+
re(e.target.files, "input"), e.target.value = "";
|
|
1426
|
+
}, ie = (e) => {
|
|
1427
|
+
e.preventDefault(), u || C(!0);
|
|
1428
|
+
}, j = (e) => {
|
|
1429
|
+
e.preventDefault(), e.currentTarget === e.target && C(!1);
|
|
1430
|
+
}, M = (e) => {
|
|
1431
|
+
e.preventDefault(), C(!1), !u && re(e.dataTransfer.files, "drop");
|
|
1432
|
+
}, N = (e) => {
|
|
1433
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), k());
|
|
1434
|
+
};
|
|
1435
|
+
return /* @__PURE__ */ c("div", {
|
|
1436
|
+
className: E,
|
|
1437
|
+
...y,
|
|
1438
|
+
children: /* @__PURE__ */ l("div", {
|
|
1439
|
+
className: D,
|
|
1440
|
+
role: "button",
|
|
1441
|
+
tabIndex: u ? -1 : 0,
|
|
1442
|
+
"aria-label": e,
|
|
1443
|
+
"data-disabled": u ? "true" : void 0,
|
|
1444
|
+
onClick: k,
|
|
1445
|
+
onKeyDown: N,
|
|
1446
|
+
onDragOver: ie,
|
|
1447
|
+
onDragLeave: j,
|
|
1448
|
+
onDrop: M,
|
|
1449
|
+
children: [
|
|
1450
|
+
/* @__PURE__ */ c("input", {
|
|
1451
|
+
ref: x,
|
|
1452
|
+
id: b,
|
|
1453
|
+
className: ne,
|
|
1454
|
+
type: "file",
|
|
1455
|
+
accept: T,
|
|
1456
|
+
multiple: s,
|
|
1457
|
+
disabled: u,
|
|
1458
|
+
"aria-label": e,
|
|
1459
|
+
title: e,
|
|
1460
|
+
onChange: A
|
|
1461
|
+
}),
|
|
1462
|
+
/* @__PURE__ */ l("div", {
|
|
1463
|
+
className: "nabs-ui-fileupload__content",
|
|
1464
|
+
children: [
|
|
1465
|
+
/* @__PURE__ */ c("span", {
|
|
1466
|
+
className: O,
|
|
1467
|
+
children: e
|
|
1468
|
+
}),
|
|
1469
|
+
t ? /* @__PURE__ */ c("span", {
|
|
1470
|
+
className: ee,
|
|
1471
|
+
children: t
|
|
1472
|
+
}) : null,
|
|
1473
|
+
/* @__PURE__ */ l("span", {
|
|
1474
|
+
className: "nabs-ui-fileupload__meta",
|
|
1475
|
+
children: [w.length > 0 ? `Accepted: ${w.join(", ")}` : "Accepted: all files", s ? " • multiple files" : " • single file"]
|
|
1476
|
+
})
|
|
1477
|
+
]
|
|
1478
|
+
}),
|
|
1479
|
+
/* @__PURE__ */ c("button", {
|
|
1480
|
+
type: "button",
|
|
1481
|
+
className: te,
|
|
1482
|
+
disabled: u,
|
|
1483
|
+
onClick: (e) => {
|
|
1484
|
+
e.stopPropagation(), k();
|
|
1485
|
+
},
|
|
1486
|
+
children: "Browse files"
|
|
1487
|
+
})
|
|
1488
|
+
]
|
|
1489
|
+
})
|
|
1490
|
+
});
|
|
1491
|
+
}
|
|
1492
|
+
function Pt({ className: e, headerClassName: t, contentClassName: n, labelClassName: r }) {
|
|
1493
|
+
return {
|
|
1494
|
+
classes: ["nabs-ui-tab", e ?? ""].filter(Boolean).join(" "),
|
|
1495
|
+
headerClasses: ["nabs-ui-tab__header", t ?? ""].filter(Boolean).join(" "),
|
|
1496
|
+
contentClasses: ["nabs-ui-tab__content", n ?? ""].filter(Boolean).join(" "),
|
|
1497
|
+
labelClasses: ["nabs-ui-tab__label", r ?? ""].filter(Boolean).join(" ")
|
|
1498
|
+
};
|
|
1499
|
+
}
|
|
1500
|
+
var Ft = e(({ label: e = "Tab", children: t, showHeader: n = !0, className: r = "", headerClassName: i = "", contentClassName: a = "", labelClassName: o = "", id: s, ...u }, d) => {
|
|
1501
|
+
let { classes: f, headerClasses: p, contentClasses: m, labelClasses: h } = Pt({
|
|
1502
|
+
className: r,
|
|
1503
|
+
headerClassName: i,
|
|
1504
|
+
contentClassName: a,
|
|
1505
|
+
labelClassName: o
|
|
1506
|
+
});
|
|
1507
|
+
return /* @__PURE__ */ l("section", {
|
|
1508
|
+
ref: d,
|
|
1509
|
+
id: s,
|
|
1510
|
+
className: f,
|
|
1511
|
+
...u,
|
|
1512
|
+
children: [n ? /* @__PURE__ */ c("div", {
|
|
1513
|
+
className: p,
|
|
1514
|
+
children: /* @__PURE__ */ c("div", {
|
|
1515
|
+
className: h,
|
|
1516
|
+
children: e
|
|
1517
|
+
})
|
|
1518
|
+
}) : null, /* @__PURE__ */ c("div", {
|
|
1519
|
+
className: m,
|
|
1520
|
+
children: t
|
|
1521
|
+
})]
|
|
1522
|
+
});
|
|
1523
|
+
});
|
|
1524
|
+
Ft.displayName = "Tab";
|
|
1525
|
+
var It = {
|
|
773
1526
|
left: "nabs-ui-toolbar__content--label-left",
|
|
774
1527
|
right: "nabs-ui-toolbar__content--label-right",
|
|
775
1528
|
top: "nabs-ui-toolbar__content--label-top",
|
|
776
1529
|
bottom: "nabs-ui-toolbar__content--label-bottom"
|
|
777
1530
|
};
|
|
778
|
-
function
|
|
1531
|
+
function Lt(e) {
|
|
779
1532
|
return e || "right";
|
|
780
1533
|
}
|
|
781
|
-
function
|
|
1534
|
+
function Rt(e) {
|
|
782
1535
|
return ["nabs-ui-toolbar", e ?? ""].filter(Boolean).join(" ");
|
|
783
1536
|
}
|
|
784
|
-
function
|
|
1537
|
+
function zt(e) {
|
|
785
1538
|
return ["nabs-ui-toolbar__content", e].filter(Boolean).join(" ");
|
|
786
1539
|
}
|
|
787
|
-
function
|
|
1540
|
+
function Bt({ isActive: e, hasLabel: t, buttonClassName: n }) {
|
|
788
1541
|
return [
|
|
789
1542
|
"nabs-ui-toolbar__button",
|
|
790
1543
|
e ? "nabs-ui-toolbar__button--active" : "",
|
|
@@ -792,27 +1545,27 @@ function Te({ isActive: e, hasLabel: t, buttonClassName: n }) {
|
|
|
792
1545
|
n ?? ""
|
|
793
1546
|
].filter(Boolean).join(" ");
|
|
794
1547
|
}
|
|
795
|
-
function
|
|
1548
|
+
function Vt(e) {
|
|
796
1549
|
return ["nabs-ui-toolbar__icon", e ?? ""].filter(Boolean).join(" ");
|
|
797
1550
|
}
|
|
798
|
-
function
|
|
1551
|
+
function Ht(e) {
|
|
799
1552
|
return ["nabs-ui-toolbar__label", e ?? ""].filter(Boolean).join(" ");
|
|
800
1553
|
}
|
|
801
|
-
function
|
|
1554
|
+
function Ut(e, t) {
|
|
802
1555
|
return typeof e == "string" ? e : t;
|
|
803
1556
|
}
|
|
804
|
-
var
|
|
1557
|
+
var Wt = e(function({ items: e, activeItemId: t, className: n = "", buttonClassName: r = "", iconClassName: i = "", labelClassName: a = "", onItemSelect: o, ...s }, u) {
|
|
805
1558
|
return /* @__PURE__ */ c("div", {
|
|
806
1559
|
ref: u,
|
|
807
|
-
className:
|
|
1560
|
+
className: Rt(n),
|
|
808
1561
|
role: "toolbar",
|
|
809
1562
|
...s,
|
|
810
1563
|
children: e.map((e) => {
|
|
811
|
-
let n = e.icon, s = !!e.label, u = e.id === t || e.pressed === !0, d =
|
|
1564
|
+
let n = e.icon, s = !!e.label, u = e.id === t || e.pressed === !0, d = zt(It[Lt(e.labelPosition)]), f = Bt({
|
|
812
1565
|
isActive: u,
|
|
813
1566
|
hasLabel: s,
|
|
814
1567
|
buttonClassName: r
|
|
815
|
-
}), p =
|
|
1568
|
+
}), p = Vt(i), m = Ht(a), h = Ut(e.label, e.title);
|
|
816
1569
|
return /* @__PURE__ */ c("button", {
|
|
817
1570
|
type: "button",
|
|
818
1571
|
className: f,
|
|
@@ -842,8 +1595,8 @@ var ke = e(function({ items: e, activeItemId: t, className: n = "", buttonClassN
|
|
|
842
1595
|
})
|
|
843
1596
|
});
|
|
844
1597
|
});
|
|
845
|
-
|
|
846
|
-
var
|
|
1598
|
+
Wt.displayName = "Toolbar";
|
|
1599
|
+
var Gt = [
|
|
847
1600
|
"day",
|
|
848
1601
|
"week",
|
|
849
1602
|
"work-week",
|
|
@@ -851,7 +1604,7 @@ var Ae = [
|
|
|
851
1604
|
"quarter",
|
|
852
1605
|
"half-year",
|
|
853
1606
|
"year"
|
|
854
|
-
],
|
|
1607
|
+
], Kt = {
|
|
855
1608
|
day: "Day",
|
|
856
1609
|
week: "Week",
|
|
857
1610
|
"work-week": "Work week",
|
|
@@ -860,21 +1613,21 @@ var Ae = [
|
|
|
860
1613
|
"half-year": "Half year",
|
|
861
1614
|
year: "Year"
|
|
862
1615
|
};
|
|
863
|
-
function
|
|
864
|
-
return e &&
|
|
1616
|
+
function qt(e) {
|
|
1617
|
+
return e && Gt.includes(e) ? e : "week";
|
|
865
1618
|
}
|
|
866
|
-
function
|
|
1619
|
+
function Jt(e, t) {
|
|
867
1620
|
return typeof e != "number" || Number.isNaN(e) ? t : (Math.trunc(e) % 7 + 7) % 7;
|
|
868
1621
|
}
|
|
869
|
-
function
|
|
1622
|
+
function Yt(e, t) {
|
|
870
1623
|
return typeof e != "number" || Number.isNaN(e) ? t : Math.min(23, Math.max(0, Math.trunc(e)));
|
|
871
1624
|
}
|
|
872
|
-
function
|
|
1625
|
+
function Xt(e) {
|
|
873
1626
|
if (typeof e != "number" || Number.isNaN(e)) return 60;
|
|
874
1627
|
let t = Math.trunc(e);
|
|
875
1628
|
return t <= 0 ? 60 : Math.min(240, t);
|
|
876
1629
|
}
|
|
877
|
-
function
|
|
1630
|
+
function Zt(e) {
|
|
878
1631
|
if (e instanceof Date) return Number.isNaN(e.getTime()) ? /* @__PURE__ */ new Date() : new Date(e.getTime());
|
|
879
1632
|
if (typeof e == "number" || typeof e == "string") {
|
|
880
1633
|
let t = new Date(e);
|
|
@@ -882,39 +1635,39 @@ function Pe(e) {
|
|
|
882
1635
|
}
|
|
883
1636
|
return /* @__PURE__ */ new Date();
|
|
884
1637
|
}
|
|
885
|
-
function
|
|
1638
|
+
function Z(e) {
|
|
886
1639
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate(), 0, 0, 0, 0);
|
|
887
1640
|
}
|
|
888
|
-
function
|
|
1641
|
+
function Q(e, t) {
|
|
889
1642
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate() + t, e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
|
|
890
1643
|
}
|
|
891
|
-
function
|
|
1644
|
+
function $(e, t) {
|
|
892
1645
|
return new Date(e.getFullYear(), e.getMonth() + t, e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
|
|
893
1646
|
}
|
|
894
|
-
function
|
|
1647
|
+
function Qt(e) {
|
|
895
1648
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate(), 23, 59, 59, 999);
|
|
896
1649
|
}
|
|
897
|
-
function
|
|
898
|
-
let n =
|
|
899
|
-
return
|
|
1650
|
+
function $t(e, t) {
|
|
1651
|
+
let n = Z(e);
|
|
1652
|
+
return Q(n, -((n.getDay() - t + 7) % 7));
|
|
900
1653
|
}
|
|
901
|
-
function
|
|
902
|
-
return
|
|
1654
|
+
function en(e, t) {
|
|
1655
|
+
return Qt(Q($t(e, t), 6));
|
|
903
1656
|
}
|
|
904
|
-
function
|
|
1657
|
+
function tn(e) {
|
|
905
1658
|
return new Date(e.getFullYear(), e.getMonth(), 1, 0, 0, 0, 0);
|
|
906
1659
|
}
|
|
907
|
-
function
|
|
1660
|
+
function nn(e) {
|
|
908
1661
|
return new Date(e.getFullYear(), e.getMonth() + 1, 0, 23, 59, 59, 999);
|
|
909
1662
|
}
|
|
910
|
-
function
|
|
1663
|
+
function rn(e) {
|
|
911
1664
|
return e.getHours() * 60 + e.getMinutes();
|
|
912
1665
|
}
|
|
913
|
-
function
|
|
1666
|
+
function an(e) {
|
|
914
1667
|
return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
915
1668
|
}
|
|
916
|
-
function
|
|
917
|
-
let t =
|
|
1669
|
+
function on(e) {
|
|
1670
|
+
let t = Zt(e.start), n = Zt(e.end);
|
|
918
1671
|
return n.getTime() <= t.getTime() ? {
|
|
919
1672
|
start: t,
|
|
920
1673
|
end: new Date(t.getTime() + 1800 * 1e3)
|
|
@@ -923,52 +1676,52 @@ function ze(e) {
|
|
|
923
1676
|
end: n
|
|
924
1677
|
};
|
|
925
1678
|
}
|
|
926
|
-
var
|
|
1679
|
+
var sn = new Intl.DateTimeFormat(void 0, { weekday: "short" }), cn = new Intl.DateTimeFormat(void 0, {
|
|
927
1680
|
weekday: "short",
|
|
928
1681
|
day: "numeric"
|
|
929
|
-
}),
|
|
1682
|
+
}), ln = new Intl.DateTimeFormat(void 0, {
|
|
930
1683
|
month: "long",
|
|
931
1684
|
year: "numeric"
|
|
932
1685
|
});
|
|
933
|
-
function
|
|
1686
|
+
function un(e) {
|
|
934
1687
|
return ["nabs-ui-event-calendar", e ?? ""].filter(Boolean).join(" ");
|
|
935
1688
|
}
|
|
936
|
-
function
|
|
937
|
-
let r =
|
|
1689
|
+
function dn(e, t, n) {
|
|
1690
|
+
let r = Z(t);
|
|
938
1691
|
if (e === "day") return {
|
|
939
1692
|
start: r,
|
|
940
|
-
end:
|
|
1693
|
+
end: Qt(r)
|
|
941
1694
|
};
|
|
942
1695
|
if (e === "week") {
|
|
943
|
-
let e =
|
|
1696
|
+
let e = $t(r, 0);
|
|
944
1697
|
return {
|
|
945
1698
|
start: e,
|
|
946
|
-
end:
|
|
1699
|
+
end: Qt(Q(e, 6))
|
|
947
1700
|
};
|
|
948
1701
|
}
|
|
949
1702
|
if (e === "work-week") {
|
|
950
|
-
let e =
|
|
1703
|
+
let e = $t(r, Jt(n, 1));
|
|
951
1704
|
return {
|
|
952
1705
|
start: e,
|
|
953
|
-
end:
|
|
1706
|
+
end: Qt(Q(e, 4))
|
|
954
1707
|
};
|
|
955
1708
|
}
|
|
956
1709
|
if (e === "month") return {
|
|
957
|
-
start:
|
|
958
|
-
end:
|
|
1710
|
+
start: tn(r),
|
|
1711
|
+
end: nn(r)
|
|
959
1712
|
};
|
|
960
1713
|
if (e === "quarter") {
|
|
961
1714
|
let e = Math.floor(r.getMonth() / 3) * 3, t = new Date(r.getFullYear(), e, 1);
|
|
962
1715
|
return {
|
|
963
1716
|
start: t,
|
|
964
|
-
end: $(
|
|
1717
|
+
end: nn($(t, 2))
|
|
965
1718
|
};
|
|
966
1719
|
}
|
|
967
1720
|
if (e === "half-year") {
|
|
968
1721
|
let e = Math.floor(r.getMonth() / 6) * 6, t = new Date(r.getFullYear(), e, 1);
|
|
969
1722
|
return {
|
|
970
1723
|
start: t,
|
|
971
|
-
end: $(
|
|
1724
|
+
end: nn($(t, 5))
|
|
972
1725
|
};
|
|
973
1726
|
}
|
|
974
1727
|
return {
|
|
@@ -976,7 +1729,7 @@ function We(e, t, n) {
|
|
|
976
1729
|
end: new Date(r.getFullYear(), 11, 31, 23, 59, 59, 999)
|
|
977
1730
|
};
|
|
978
1731
|
}
|
|
979
|
-
function
|
|
1732
|
+
function fn(e) {
|
|
980
1733
|
let t = e.start.getFullYear() === e.end.getFullYear();
|
|
981
1734
|
return `${new Intl.DateTimeFormat(void 0, {
|
|
982
1735
|
month: "short",
|
|
@@ -988,32 +1741,32 @@ function Ge(e) {
|
|
|
988
1741
|
year: "numeric"
|
|
989
1742
|
}).format(e.end)}`;
|
|
990
1743
|
}
|
|
991
|
-
function
|
|
992
|
-
return n === 0 ? /* @__PURE__ */ new Date() : t === "day" ?
|
|
1744
|
+
function pn(e, t, n) {
|
|
1745
|
+
return n === 0 ? /* @__PURE__ */ new Date() : t === "day" ? Q(e, n) : t === "week" || t === "work-week" ? Q(e, n * 7) : t === "month" ? $(e, n) : t === "quarter" ? $(e, n * 3) : t === "half-year" ? $(e, n * 6) : $(e, n * 12);
|
|
993
1746
|
}
|
|
994
|
-
function
|
|
995
|
-
let r =
|
|
1747
|
+
function mn(e, t, n) {
|
|
1748
|
+
let r = Z(t), i = (e) => ({
|
|
996
1749
|
date: e,
|
|
997
1750
|
id: `${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`,
|
|
998
|
-
label:
|
|
999
|
-
shortLabel:
|
|
1751
|
+
label: cn.format(e),
|
|
1752
|
+
shortLabel: sn.format(e)
|
|
1000
1753
|
});
|
|
1001
1754
|
if (e === "day") return [i(r)];
|
|
1002
1755
|
if (e === "week") {
|
|
1003
|
-
let e =
|
|
1004
|
-
return Array.from({ length: 7 }, (t, n) => i(
|
|
1756
|
+
let e = $t(r, 0);
|
|
1757
|
+
return Array.from({ length: 7 }, (t, n) => i(Q(e, n)));
|
|
1005
1758
|
}
|
|
1006
|
-
let a =
|
|
1007
|
-
return Array.from({ length: 5 }, (e, t) => i(
|
|
1759
|
+
let a = $t(r, Jt(n, 1));
|
|
1760
|
+
return Array.from({ length: 5 }, (e, t) => i(Q(a, t)));
|
|
1008
1761
|
}
|
|
1009
|
-
function
|
|
1010
|
-
let i = Math.max(n,
|
|
1762
|
+
function hn(e, t, n, r) {
|
|
1763
|
+
let i = Math.max(n, rn(e)), a = Math.min(r, rn(t));
|
|
1011
1764
|
return a <= i ? null : {
|
|
1012
1765
|
startMinutes: i,
|
|
1013
1766
|
endMinutes: a
|
|
1014
1767
|
};
|
|
1015
1768
|
}
|
|
1016
|
-
function
|
|
1769
|
+
function gn(e) {
|
|
1017
1770
|
let t = [...e].sort((e, t) => e.startMinutes === t.startMinutes ? t.endMinutes - e.endMinutes : e.startMinutes - t.startMinutes), n = [], r = t.map((e) => {
|
|
1018
1771
|
let t = n.findIndex((t) => e.startMinutes >= t);
|
|
1019
1772
|
return t === -1 ? (t = n.length, n.push(e.endMinutes)) : n[t] = e.endMinutes, {
|
|
@@ -1027,21 +1780,21 @@ function Ye(e) {
|
|
|
1027
1780
|
laneCount: i
|
|
1028
1781
|
}));
|
|
1029
1782
|
}
|
|
1030
|
-
function
|
|
1031
|
-
let n =
|
|
1783
|
+
function _n(e, t) {
|
|
1784
|
+
let n = on(e);
|
|
1032
1785
|
return n.start.getTime() < t.end.getTime() && n.end.getTime() > t.start.getTime();
|
|
1033
1786
|
}
|
|
1034
|
-
function
|
|
1787
|
+
function vn(e, t, n, r) {
|
|
1035
1788
|
let i = n * 60, a = r * 60, o = Math.max(60, a - i), s = [];
|
|
1036
1789
|
for (let n of t) {
|
|
1037
1790
|
let t = {
|
|
1038
1791
|
start: n.date,
|
|
1039
|
-
end:
|
|
1040
|
-
}, r =
|
|
1792
|
+
end: Q(n.date, 1)
|
|
1793
|
+
}, r = gn(e.filter((e) => !e.allDay).map((e) => ({
|
|
1041
1794
|
event: e,
|
|
1042
|
-
range:
|
|
1043
|
-
})).filter((e) =>
|
|
1044
|
-
let t =
|
|
1795
|
+
range: on(e)
|
|
1796
|
+
})).filter((e) => _n(e.event, t)).filter((e) => Z(e.range.start).getTime() === Z(e.range.end).getTime()).map((e) => {
|
|
1797
|
+
let t = hn(e.range.start, e.range.end, i, a);
|
|
1045
1798
|
return t ? {
|
|
1046
1799
|
event: e.event,
|
|
1047
1800
|
start: e.range.start,
|
|
@@ -1063,7 +1816,7 @@ function Ze(e, t, n, r) {
|
|
|
1063
1816
|
}
|
|
1064
1817
|
return s;
|
|
1065
1818
|
}
|
|
1066
|
-
function
|
|
1819
|
+
function yn(e) {
|
|
1067
1820
|
let t = [...e].sort((e, t) => e.startIndex === t.startIndex ? t.endIndex - t.startIndex - (e.endIndex - e.startIndex) : e.startIndex - t.startIndex), n = [], r = t.map((e) => {
|
|
1068
1821
|
let t = n.findIndex((t) => e.startIndex > t);
|
|
1069
1822
|
return t === -1 ? (t = n.length, n.push(e.endIndex)) : n[t] = e.endIndex, {
|
|
@@ -1077,14 +1830,14 @@ function Qe(e) {
|
|
|
1077
1830
|
laneCount: i
|
|
1078
1831
|
}));
|
|
1079
1832
|
}
|
|
1080
|
-
function
|
|
1833
|
+
function bn(e, t) {
|
|
1081
1834
|
if (t.length === 0) return [];
|
|
1082
|
-
let n = t[0].date, r =
|
|
1083
|
-
return
|
|
1835
|
+
let n = t[0].date, r = Q(t[t.length - 1].date, 1);
|
|
1836
|
+
return yn(e.map((e) => ({
|
|
1084
1837
|
event: e,
|
|
1085
|
-
range:
|
|
1086
|
-
})).filter((e) => e.range.start < r && e.range.end > n).filter((e) => e.event.allDay ||
|
|
1087
|
-
let i = new Date(Math.max(e.range.start.getTime(), n.getTime())), a = new Date(Math.min(e.range.end.getTime(), r.getTime())), o = Math.max(0, Math.floor((
|
|
1838
|
+
range: on(e)
|
|
1839
|
+
})).filter((e) => e.range.start < r && e.range.end > n).filter((e) => e.event.allDay || Z(e.range.start).getTime() !== Z(e.range.end).getTime()).map((e) => {
|
|
1840
|
+
let i = new Date(Math.max(e.range.start.getTime(), n.getTime())), a = new Date(Math.min(e.range.end.getTime(), r.getTime())), o = Math.max(0, Math.floor((Z(i).getTime() - n.getTime()) / (1440 * 60 * 1e3))), s = Q(Z(a), a.getHours() === 0 && a.getMinutes() === 0 ? -1 : 0), c = Math.min(t.length - 1, Math.max(o, Math.floor((s.getTime() - n.getTime()) / (1440 * 60 * 1e3))));
|
|
1088
1841
|
return {
|
|
1089
1842
|
event: e.event,
|
|
1090
1843
|
segmentStart: i,
|
|
@@ -1106,46 +1859,220 @@ function $e(e, t) {
|
|
|
1106
1859
|
isClippedEnd: e.isClippedEnd
|
|
1107
1860
|
}));
|
|
1108
1861
|
}
|
|
1109
|
-
function
|
|
1110
|
-
let i = e === "month" ? 1 : e === "quarter" ? 3 : e === "half-year" ? 6 : 12, a = e === "month" ?
|
|
1862
|
+
function xn(e, t, n, r) {
|
|
1863
|
+
let i = e === "month" ? 1 : e === "quarter" ? 3 : e === "half-year" ? 6 : 12, a = e === "month" ? tn(t) : e === "quarter" ? new Date(t.getFullYear(), Math.floor(t.getMonth() / 3) * 3, 1) : e === "half-year" ? new Date(t.getFullYear(), Math.floor(t.getMonth() / 6) * 6, 1) : new Date(t.getFullYear(), 0, 1), o = Jt(r, 0), s = [];
|
|
1111
1864
|
for (let e = 0; e < i; e += 1) {
|
|
1112
|
-
let t =
|
|
1865
|
+
let t = tn($(a, e)), r = nn(t), i = $t(t, o), c = en(r, o), l = [], u = i, d = 0;
|
|
1113
1866
|
for (; u.getTime() <= c.getTime();) {
|
|
1114
|
-
let e = u, r = Array.from({ length: 7 }, (t, n) =>
|
|
1867
|
+
let e = u, r = Array.from({ length: 7 }, (t, n) => Q(e, n)), i = r.map((e) => ({
|
|
1115
1868
|
date: e,
|
|
1116
1869
|
id: `${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`,
|
|
1117
|
-
label:
|
|
1118
|
-
shortLabel:
|
|
1870
|
+
label: cn.format(e),
|
|
1871
|
+
shortLabel: sn.format(e)
|
|
1119
1872
|
}));
|
|
1120
1873
|
l.push({
|
|
1121
1874
|
id: `${t.getFullYear()}-${t.getMonth()}-${d}`,
|
|
1122
1875
|
weekStart: e,
|
|
1123
1876
|
days: r,
|
|
1124
|
-
segments:
|
|
1125
|
-
}), u =
|
|
1877
|
+
segments: bn(n, i)
|
|
1878
|
+
}), u = Q(e, 7), d += 1;
|
|
1126
1879
|
}
|
|
1127
1880
|
s.push({
|
|
1128
1881
|
id: `${t.getFullYear()}-${t.getMonth()}`,
|
|
1129
|
-
title:
|
|
1882
|
+
title: ln.format(t),
|
|
1130
1883
|
weeks: l
|
|
1131
1884
|
});
|
|
1132
1885
|
}
|
|
1133
1886
|
return s;
|
|
1134
1887
|
}
|
|
1135
|
-
function
|
|
1888
|
+
function Sn(e) {
|
|
1136
1889
|
return e === "day" || e === "week" || e === "work-week";
|
|
1137
1890
|
}
|
|
1138
|
-
function
|
|
1891
|
+
function Cn(e, t) {
|
|
1139
1892
|
let n = new Intl.DateTimeFormat(void 0, {
|
|
1140
1893
|
hour: "numeric",
|
|
1141
1894
|
minute: "2-digit"
|
|
1142
1895
|
});
|
|
1143
1896
|
return `${n.format(e)} - ${n.format(t)}`;
|
|
1144
1897
|
}
|
|
1145
|
-
function
|
|
1146
|
-
return
|
|
1898
|
+
function wn(e) {
|
|
1899
|
+
return Zt(e);
|
|
1900
|
+
}
|
|
1901
|
+
var Tn = [
|
|
1902
|
+
{
|
|
1903
|
+
key: "title",
|
|
1904
|
+
label: "Title",
|
|
1905
|
+
type: "string",
|
|
1906
|
+
required: !0
|
|
1907
|
+
},
|
|
1908
|
+
{
|
|
1909
|
+
key: "start",
|
|
1910
|
+
label: "Start",
|
|
1911
|
+
type: "datetime",
|
|
1912
|
+
required: !0
|
|
1913
|
+
},
|
|
1914
|
+
{
|
|
1915
|
+
key: "end",
|
|
1916
|
+
label: "End",
|
|
1917
|
+
type: "datetime",
|
|
1918
|
+
required: !0
|
|
1919
|
+
},
|
|
1920
|
+
{
|
|
1921
|
+
key: "allDay",
|
|
1922
|
+
label: "All day",
|
|
1923
|
+
type: "boolean"
|
|
1924
|
+
}
|
|
1925
|
+
], En = [{
|
|
1926
|
+
id: "standard",
|
|
1927
|
+
name: "Standard event",
|
|
1928
|
+
model: [
|
|
1929
|
+
...Tn,
|
|
1930
|
+
{
|
|
1931
|
+
key: "description",
|
|
1932
|
+
label: "Description",
|
|
1933
|
+
type: "string"
|
|
1934
|
+
},
|
|
1935
|
+
{
|
|
1936
|
+
key: "location",
|
|
1937
|
+
label: "Location",
|
|
1938
|
+
type: "string"
|
|
1939
|
+
}
|
|
1940
|
+
]
|
|
1941
|
+
}, {
|
|
1942
|
+
id: "media",
|
|
1943
|
+
name: "Media event",
|
|
1944
|
+
model: [
|
|
1945
|
+
...Tn,
|
|
1946
|
+
{
|
|
1947
|
+
key: "description",
|
|
1948
|
+
label: "Description",
|
|
1949
|
+
type: "string"
|
|
1950
|
+
},
|
|
1951
|
+
{
|
|
1952
|
+
key: "media",
|
|
1953
|
+
label: "Media",
|
|
1954
|
+
type: "media"
|
|
1955
|
+
},
|
|
1956
|
+
{
|
|
1957
|
+
key: "caption",
|
|
1958
|
+
label: "Caption",
|
|
1959
|
+
type: "string"
|
|
1960
|
+
}
|
|
1961
|
+
]
|
|
1962
|
+
}], Dn = JSON.stringify([{
|
|
1963
|
+
key: "description",
|
|
1964
|
+
label: "Description",
|
|
1965
|
+
type: "string"
|
|
1966
|
+
}], null, 2);
|
|
1967
|
+
function On(e) {
|
|
1968
|
+
return e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "custom-event";
|
|
1969
|
+
}
|
|
1970
|
+
function kn(e) {
|
|
1971
|
+
let t = /* @__PURE__ */ new Map();
|
|
1972
|
+
for (let e of Tn) t.set(e.key, e);
|
|
1973
|
+
for (let n of e) {
|
|
1974
|
+
let e = String(n.key ?? "").trim(), r = String(n.label ?? "").trim(), i = n.type;
|
|
1975
|
+
!e || !r || i !== "string" && i !== "datetime" && i !== "boolean" && i !== "media" || t.set(e, {
|
|
1976
|
+
key: e,
|
|
1977
|
+
label: r,
|
|
1978
|
+
type: i,
|
|
1979
|
+
required: !!n.required
|
|
1980
|
+
});
|
|
1981
|
+
}
|
|
1982
|
+
return Array.from(t.values());
|
|
1147
1983
|
}
|
|
1148
|
-
function
|
|
1984
|
+
function An(e) {
|
|
1985
|
+
let t = JSON.parse(e);
|
|
1986
|
+
return Array.isArray(t) ? t.map((e) => {
|
|
1987
|
+
let t = e;
|
|
1988
|
+
return {
|
|
1989
|
+
key: String(t.key ?? ""),
|
|
1990
|
+
label: String(t.label ?? ""),
|
|
1991
|
+
type: t.type ?? "string",
|
|
1992
|
+
required: !!t.required
|
|
1993
|
+
};
|
|
1994
|
+
}).filter((e) => !!e.key && !!e.label) : [];
|
|
1995
|
+
}
|
|
1996
|
+
function jn(e = []) {
|
|
1997
|
+
let t = /* @__PURE__ */ new Map();
|
|
1998
|
+
for (let n of [...En, ...e]) t.set(n.id, {
|
|
1999
|
+
id: n.id,
|
|
2000
|
+
name: n.name,
|
|
2001
|
+
model: kn(n.model)
|
|
2002
|
+
});
|
|
2003
|
+
return Array.from(t.values());
|
|
2004
|
+
}
|
|
2005
|
+
function Mn(e) {
|
|
2006
|
+
let t = {};
|
|
2007
|
+
for (let n of e?.model ?? Tn) if (n.type !== "media") {
|
|
2008
|
+
if (n.type === "boolean") {
|
|
2009
|
+
t[n.key] = {
|
|
2010
|
+
title: n.label,
|
|
2011
|
+
type: "boolean"
|
|
2012
|
+
};
|
|
2013
|
+
continue;
|
|
2014
|
+
}
|
|
2015
|
+
t[n.key] = {
|
|
2016
|
+
title: n.label,
|
|
2017
|
+
type: "string",
|
|
2018
|
+
...n.required ? { minLength: 1 } : {}
|
|
2019
|
+
};
|
|
2020
|
+
}
|
|
2021
|
+
return {
|
|
2022
|
+
title: "Create event",
|
|
2023
|
+
type: "object",
|
|
2024
|
+
properties: t
|
|
2025
|
+
};
|
|
2026
|
+
}
|
|
2027
|
+
function Nn(e) {
|
|
2028
|
+
let t = an(e);
|
|
2029
|
+
return {
|
|
2030
|
+
title: "",
|
|
2031
|
+
start: `${t}T09:00:00`,
|
|
2032
|
+
end: `${t}T10:00:00`,
|
|
2033
|
+
allDay: !1,
|
|
2034
|
+
description: "",
|
|
2035
|
+
location: "",
|
|
2036
|
+
caption: ""
|
|
2037
|
+
};
|
|
2038
|
+
}
|
|
2039
|
+
function Pn(e) {
|
|
2040
|
+
return e.map((e) => ({
|
|
2041
|
+
id: `media-${Date.now()}-${Math.random().toString(16).slice(2, 8)}`,
|
|
2042
|
+
name: e.name,
|
|
2043
|
+
url: URL.createObjectURL(e)
|
|
2044
|
+
}));
|
|
2045
|
+
}
|
|
2046
|
+
function Fn(e) {
|
|
2047
|
+
return Array.isArray(e) ? e.map((e) => {
|
|
2048
|
+
if (typeof e != "object" || !e) return null;
|
|
2049
|
+
let t = e;
|
|
2050
|
+
return !t.url || typeof t.url != "string" ? null : {
|
|
2051
|
+
id: t.id && typeof t.id == "string" ? t.id : `media-${Math.random().toString(16).slice(2, 8)}`,
|
|
2052
|
+
name: t.name && typeof t.name == "string" ? t.name : "Uploaded image",
|
|
2053
|
+
url: t.url
|
|
2054
|
+
};
|
|
2055
|
+
}).filter((e) => !!e) : [];
|
|
2056
|
+
}
|
|
2057
|
+
function In(e, t) {
|
|
2058
|
+
if (!(!e && t.length === 0)) return /* @__PURE__ */ l("div", {
|
|
2059
|
+
className: "nabs-ui-event-calendar__native-content",
|
|
2060
|
+
children: [e ? /* @__PURE__ */ c("span", { children: e }) : null, t.length > 0 ? /* @__PURE__ */ c("div", {
|
|
2061
|
+
className: "nabs-ui-event-calendar__native-image-strip",
|
|
2062
|
+
children: t.map((e) => /* @__PURE__ */ c("img", {
|
|
2063
|
+
className: "nabs-ui-event-calendar__native-image-strip-item",
|
|
2064
|
+
src: e.url,
|
|
2065
|
+
alt: e.name,
|
|
2066
|
+
width: 56,
|
|
2067
|
+
height: 36
|
|
2068
|
+
}, e.id))
|
|
2069
|
+
}) : null]
|
|
2070
|
+
});
|
|
2071
|
+
}
|
|
2072
|
+
function Ln(e) {
|
|
2073
|
+
return typeof e == "string" ? e : typeof e == "number" ? String(e) : "";
|
|
2074
|
+
}
|
|
2075
|
+
function Rn(e, t, n) {
|
|
1149
2076
|
return n ? n(e) : /* @__PURE__ */ l("div", {
|
|
1150
2077
|
className: t,
|
|
1151
2078
|
children: [/* @__PURE__ */ c("strong", {
|
|
@@ -1157,233 +2084,276 @@ function it(e, t, n) {
|
|
|
1157
2084
|
}) : null]
|
|
1158
2085
|
});
|
|
1159
2086
|
}
|
|
1160
|
-
|
|
1161
|
-
|
|
2087
|
+
function zn(e, t) {
|
|
2088
|
+
return t === "ArrowRight" ? e === "details" ? "media" : "details" : t === "ArrowLeft" ? e === "media" ? "details" : "media" : t === "Home" ? "details" : t === "End" ? "media" : e;
|
|
2089
|
+
}
|
|
2090
|
+
var Bn = e(function({ events: e, view: n, defaultView: o = "week", anchorDate: s, defaultAnchorDate: u, weekStartsOn: d = 0, workWeekStartsOn: f = 1, dayStartsAt: p = 7, dayEndsAt: m = 22, slotMinutes: h = 60, showControls: g = !0, eventTemplate: _, onViewChange: v, onAnchorDateChange: y, onRangeChange: b, onEventClick: x, onEventDoubleClick: S, additionalEventObjectTypes: C, enableNativeDialogs: w = !0, onAddEventRequest: T, onAdminRequest: E, className: D = "", ...O }, ee) {
|
|
2091
|
+
let [te, ne] = a(qt(o)), [re, k] = a(() => wn(u)), [A, ie] = a(() => jn(C)), [j, M] = a("standard"), [N, P] = a(""), [F, ae] = a(Dn), [I, L] = a(""), [oe, se] = a(!1), [ce, le] = a(!1), [ue, de] = a([]), [fe, pe] = a({}), [R, me] = a(() => Nn(wn(u))), [he, ge] = a([]), [_e, B] = a(null), [V, ve] = a({}), [H, U] = a([]), [ye, be] = a("read"), [Se, W] = a("details"), we = i(b);
|
|
1162
2092
|
t(() => {
|
|
1163
|
-
|
|
2093
|
+
we.current = b;
|
|
1164
2094
|
}, [b]);
|
|
1165
|
-
let
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
2095
|
+
let G = qt(n ?? te), K = r(() => wn(s ?? re), [s, re]), Te = Jt(d, 0), Ee = Jt(f, 1), De = Yt(p, 7), Oe = Math.max(De + 1, Yt(m, 22)), Ae = Xt(h), je = r(() => dn(G, K, Ee), [
|
|
2096
|
+
K,
|
|
2097
|
+
G,
|
|
2098
|
+
Ee
|
|
1169
2099
|
]);
|
|
1170
2100
|
t(() => {
|
|
1171
|
-
|
|
1172
|
-
view:
|
|
1173
|
-
range:
|
|
2101
|
+
we.current?.({
|
|
2102
|
+
view: G,
|
|
2103
|
+
range: je
|
|
1174
2104
|
});
|
|
1175
|
-
}, [
|
|
1176
|
-
let
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
2105
|
+
}, [je, G]);
|
|
2106
|
+
let Me = un(D), Ne = fn(je);
|
|
2107
|
+
t(() => {
|
|
2108
|
+
me((e) => ({
|
|
2109
|
+
...Nn(K),
|
|
2110
|
+
...e
|
|
2111
|
+
}));
|
|
2112
|
+
}, [K, j]);
|
|
2113
|
+
let q = r(() => A.find((e) => e.id === j) ?? null, [A, j]), Pe = r(() => Mn(q), [q]), Fe = r(() => q?.model.some((e) => e.type === "media") ?? !1, [q]), Ie = r(() => A.map((e) => ({
|
|
2114
|
+
value: e.id,
|
|
2115
|
+
label: e.name
|
|
2116
|
+
})), [A]), J = r(() => [...e, ...ue].map((e) => {
|
|
2117
|
+
let t = fe[e.id];
|
|
2118
|
+
return t ? {
|
|
2119
|
+
...e,
|
|
2120
|
+
...t
|
|
2121
|
+
} : e;
|
|
2122
|
+
}), [
|
|
2123
|
+
ue,
|
|
2124
|
+
fe,
|
|
2125
|
+
e
|
|
2126
|
+
]), Y = r(() => J.find((e) => e.id === _e) ?? null, [J, _e]), Le = r(() => {
|
|
2127
|
+
if (!Y || typeof Y.data != "object" || Y.data === null) return null;
|
|
2128
|
+
let e = Y.data;
|
|
2129
|
+
return Array.isArray(e.model) && e.model.length > 0 ? {
|
|
2130
|
+
id: e.eventObjectTypeId ?? "custom-event",
|
|
2131
|
+
name: e.eventObjectTypeName ?? "Custom event",
|
|
2132
|
+
model: e.model
|
|
2133
|
+
} : e.eventObjectTypeId ? A.find((t) => t.id === e.eventObjectTypeId) ?? null : null;
|
|
2134
|
+
}, [Y, A]), Re = r(() => Le?.model.some((e) => e.type === "media") ?? !1, [Le]), ze = r(() => ({
|
|
2135
|
+
title: "Edit event",
|
|
2136
|
+
type: "object",
|
|
2137
|
+
properties: {
|
|
2138
|
+
title: {
|
|
2139
|
+
title: "Title",
|
|
2140
|
+
type: "string",
|
|
2141
|
+
maxLength: 120
|
|
2142
|
+
},
|
|
2143
|
+
start: {
|
|
2144
|
+
title: "Start",
|
|
2145
|
+
type: "string"
|
|
2146
|
+
},
|
|
2147
|
+
end: {
|
|
2148
|
+
title: "End",
|
|
2149
|
+
type: "string"
|
|
2150
|
+
},
|
|
2151
|
+
content: {
|
|
2152
|
+
title: "Content",
|
|
2153
|
+
type: "string",
|
|
2154
|
+
maxLength: 280
|
|
2155
|
+
},
|
|
2156
|
+
allDay: {
|
|
2157
|
+
title: "All day",
|
|
2158
|
+
type: "boolean"
|
|
2159
|
+
}
|
|
2160
|
+
}
|
|
2161
|
+
}), []), X = r(() => mn(G, K, Ee), [
|
|
2162
|
+
K,
|
|
2163
|
+
G,
|
|
2164
|
+
Ee
|
|
2165
|
+
]), Be = r(() => vn(J, X, De, Oe), [
|
|
2166
|
+
X,
|
|
2167
|
+
Oe,
|
|
2168
|
+
De,
|
|
2169
|
+
J
|
|
2170
|
+
]), Ve = r(() => bn(J, X), [X, J]), He = r(() => {
|
|
2171
|
+
let e = Math.max(60, (Oe - De) * 60);
|
|
2172
|
+
return Math.max(1, Math.floor(e / Ae));
|
|
1188
2173
|
}, [
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
]),
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
]),
|
|
1198
|
-
label:
|
|
2174
|
+
Oe,
|
|
2175
|
+
De,
|
|
2176
|
+
Ae
|
|
2177
|
+
]), Ue = r(() => xn(G, K, J, Te), [
|
|
2178
|
+
K,
|
|
2179
|
+
J,
|
|
2180
|
+
G,
|
|
2181
|
+
Te
|
|
2182
|
+
]), We = r(() => Gt.map((e) => ({
|
|
2183
|
+
label: Kt[e],
|
|
1199
2184
|
value: e
|
|
1200
|
-
})), []),
|
|
1201
|
-
let t =
|
|
2185
|
+
})), []), Ge = (e) => {
|
|
2186
|
+
let t = pn(K, G, e);
|
|
1202
2187
|
k(t), y?.(t);
|
|
1203
|
-
},
|
|
1204
|
-
let t =
|
|
1205
|
-
|
|
2188
|
+
}, Ke = (e) => {
|
|
2189
|
+
let t = qt(e);
|
|
2190
|
+
ne(t), v?.(t);
|
|
2191
|
+
}, qe = () => {
|
|
2192
|
+
let e = N.trim();
|
|
2193
|
+
if (!e) return L("Type name is required."), !1;
|
|
2194
|
+
try {
|
|
2195
|
+
let t = kn(An(F)), n = On(e);
|
|
2196
|
+
return ie((r) => {
|
|
2197
|
+
let i = {
|
|
2198
|
+
id: n,
|
|
2199
|
+
name: e,
|
|
2200
|
+
model: t
|
|
2201
|
+
}, a = r.findIndex((e) => e.id === n);
|
|
2202
|
+
return a < 0 ? [...r, i] : r.map((e, t) => t === a ? i : e);
|
|
2203
|
+
}), M(n), P(""), L(""), !0;
|
|
2204
|
+
} catch {
|
|
2205
|
+
return L("Model JSON is invalid. Provide an array of field definitions."), !1;
|
|
2206
|
+
}
|
|
2207
|
+
}, Je = () => {
|
|
2208
|
+
let e = String(R.title ?? "").trim(), t = String(R.start ?? "").trim(), n = String(R.end ?? "").trim();
|
|
2209
|
+
if (!e || !t || !n) return !1;
|
|
2210
|
+
let r = [], i = String(R.description ?? "").trim();
|
|
2211
|
+
i && r.push(i);
|
|
2212
|
+
let a = String(R.location ?? "").trim();
|
|
2213
|
+
a && r.push(`Location: ${a}`);
|
|
2214
|
+
let o = String(R.caption ?? "").trim();
|
|
2215
|
+
o && r.push(o);
|
|
2216
|
+
let s = Pn(he), c = Object.fromEntries(Object.entries(R).filter(([e]) => ![
|
|
2217
|
+
"title",
|
|
2218
|
+
"start",
|
|
2219
|
+
"end",
|
|
2220
|
+
"allDay"
|
|
2221
|
+
].includes(e))), l = {
|
|
2222
|
+
id: `custom-${Date.now()}-${Math.random().toString(16).slice(2, 8)}`,
|
|
2223
|
+
title: e,
|
|
2224
|
+
start: t,
|
|
2225
|
+
end: n,
|
|
2226
|
+
allDay: !!R.allDay,
|
|
2227
|
+
content: In(r.join(" | "), s),
|
|
2228
|
+
data: {
|
|
2229
|
+
eventObjectTypeId: q?.id,
|
|
2230
|
+
eventObjectTypeName: q?.name,
|
|
2231
|
+
model: q?.model,
|
|
2232
|
+
customData: c,
|
|
2233
|
+
mediaFileNames: he.map((e) => e.name),
|
|
2234
|
+
mediaItems: s
|
|
2235
|
+
}
|
|
2236
|
+
};
|
|
2237
|
+
return de((e) => [...e, l]), me(Nn(K)), ge([]), !0;
|
|
1206
2238
|
};
|
|
1207
2239
|
return /* @__PURE__ */ l("section", {
|
|
1208
|
-
ref:
|
|
1209
|
-
className:
|
|
1210
|
-
...
|
|
1211
|
-
children: [
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
2240
|
+
ref: ee,
|
|
2241
|
+
className: Me,
|
|
2242
|
+
...O,
|
|
2243
|
+
children: [
|
|
2244
|
+
g ? /* @__PURE__ */ l("div", {
|
|
2245
|
+
className: "nabs-ui-event-calendar__controls",
|
|
2246
|
+
"aria-label": "Calendar controls",
|
|
2247
|
+
children: [
|
|
2248
|
+
/* @__PURE__ */ c(Wt, {
|
|
2249
|
+
"aria-label": "Calendar navigation",
|
|
2250
|
+
items: [
|
|
2251
|
+
{
|
|
2252
|
+
id: "previous",
|
|
2253
|
+
label: "Previous"
|
|
2254
|
+
},
|
|
2255
|
+
{
|
|
2256
|
+
id: "today",
|
|
2257
|
+
label: "Today"
|
|
2258
|
+
},
|
|
2259
|
+
{
|
|
2260
|
+
id: "next",
|
|
2261
|
+
label: "Next"
|
|
2262
|
+
},
|
|
2263
|
+
{
|
|
2264
|
+
id: "add-event",
|
|
2265
|
+
label: "Add event"
|
|
2266
|
+
},
|
|
2267
|
+
{
|
|
2268
|
+
id: "admin",
|
|
2269
|
+
label: "Admin"
|
|
2270
|
+
}
|
|
2271
|
+
],
|
|
2272
|
+
onItemSelect: ({ itemId: e }) => {
|
|
2273
|
+
if (e === "previous") {
|
|
2274
|
+
Ge(-1);
|
|
2275
|
+
return;
|
|
2276
|
+
}
|
|
2277
|
+
if (e === "today") {
|
|
2278
|
+
Ge(0);
|
|
2279
|
+
return;
|
|
2280
|
+
}
|
|
2281
|
+
if (e === "add-event") {
|
|
2282
|
+
w && le(!0), T?.();
|
|
2283
|
+
return;
|
|
2284
|
+
}
|
|
2285
|
+
if (e === "admin") {
|
|
2286
|
+
w && se(!0), E?.();
|
|
2287
|
+
return;
|
|
2288
|
+
}
|
|
2289
|
+
Ge(1);
|
|
1247
2290
|
}
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
2291
|
+
}),
|
|
2292
|
+
/* @__PURE__ */ c(ke, {
|
|
2293
|
+
"aria-label": "Calendar view",
|
|
2294
|
+
items: We,
|
|
2295
|
+
value: G,
|
|
2296
|
+
onValueChange: (e) => {
|
|
2297
|
+
e && Ke(e);
|
|
1251
2298
|
}
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
2299
|
+
}),
|
|
2300
|
+
/* @__PURE__ */ c(xe, {
|
|
2301
|
+
"aria-label": "Anchor date",
|
|
2302
|
+
label: "Date",
|
|
2303
|
+
labelPosition: "left",
|
|
2304
|
+
value: an(K),
|
|
2305
|
+
onValueChange: (e) => {
|
|
2306
|
+
if (!e) return;
|
|
2307
|
+
let t = wn(e);
|
|
2308
|
+
k(t), y?.(t);
|
|
1255
2309
|
}
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
"aria-label": "Calendar view",
|
|
1261
|
-
items: W,
|
|
1262
|
-
value: A,
|
|
1263
|
-
onValueChange: (e) => {
|
|
1264
|
-
e && ie(e);
|
|
1265
|
-
}
|
|
1266
|
-
}),
|
|
1267
|
-
/* @__PURE__ */ c(fe, {
|
|
1268
|
-
"aria-label": "Anchor date",
|
|
1269
|
-
label: "Date",
|
|
1270
|
-
labelPosition: "left",
|
|
1271
|
-
value: Re(j),
|
|
1272
|
-
onValueChange: (e) => {
|
|
1273
|
-
if (!e) return;
|
|
1274
|
-
let t = rt(e);
|
|
1275
|
-
k(t), y?.(t);
|
|
1276
|
-
}
|
|
1277
|
-
}),
|
|
1278
|
-
/* @__PURE__ */ c("span", {
|
|
1279
|
-
className: "nabs-ui-event-calendar__rangeLabel",
|
|
1280
|
-
children: z
|
|
1281
|
-
})
|
|
1282
|
-
]
|
|
1283
|
-
}) : null, tt(A) ? /* @__PURE__ */ l("div", {
|
|
1284
|
-
className: "nabs-ui-event-calendar__timeView",
|
|
1285
|
-
children: [
|
|
1286
|
-
/* @__PURE__ */ c("div", {
|
|
1287
|
-
className: "nabs-ui-event-calendar__dayHeaderRow",
|
|
1288
|
-
children: /* @__PURE__ */ c("div", {
|
|
1289
|
-
className: "nabs-ui-event-calendar__dayHeaderGrid",
|
|
1290
|
-
style: { gridTemplateColumns: `repeat(${B.length}, minmax(0, 1fr))` },
|
|
1291
|
-
children: B.map((e) => /* @__PURE__ */ l("div", {
|
|
1292
|
-
className: "nabs-ui-event-calendar__dayHeaderCell",
|
|
1293
|
-
"aria-label": e.label,
|
|
1294
|
-
children: [/* @__PURE__ */ c("span", { children: e.shortLabel }), /* @__PURE__ */ c("strong", { children: e.date.getDate() })]
|
|
1295
|
-
}, e.id))
|
|
2310
|
+
}),
|
|
2311
|
+
/* @__PURE__ */ c("span", {
|
|
2312
|
+
className: "nabs-ui-event-calendar__rangeLabel",
|
|
2313
|
+
children: Ne
|
|
1296
2314
|
})
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
}
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
},
|
|
1330
|
-
onDoubleClick: (t) => {
|
|
1331
|
-
S?.({
|
|
1332
|
-
event: e.event,
|
|
1333
|
-
nativeEvent: t
|
|
1334
|
-
});
|
|
1335
|
-
},
|
|
1336
|
-
children: [
|
|
1337
|
-
e.isClippedStart ? /* @__PURE__ */ c("span", {
|
|
1338
|
-
className: "nabs-ui-event-calendar__clipMark",
|
|
1339
|
-
children: "‹"
|
|
1340
|
-
}) : null,
|
|
1341
|
-
it(i, "nabs-ui-event-calendar__eventContent", _),
|
|
1342
|
-
e.isClippedEnd ? /* @__PURE__ */ c("span", {
|
|
1343
|
-
className: "nabs-ui-event-calendar__clipMark",
|
|
1344
|
-
children: "›"
|
|
1345
|
-
}) : null
|
|
1346
|
-
]
|
|
1347
|
-
}, `${e.event.id}-${e.startIndex}-${e.endIndex}-${e.laneIndex}`);
|
|
1348
|
-
})]
|
|
1349
|
-
})
|
|
1350
|
-
}),
|
|
1351
|
-
/* @__PURE__ */ c("div", {
|
|
1352
|
-
className: "nabs-ui-event-calendar__timeGridArea",
|
|
1353
|
-
children: /* @__PURE__ */ l("div", {
|
|
1354
|
-
className: "nabs-ui-event-calendar__dayColumns",
|
|
1355
|
-
style: { gridTemplateColumns: `repeat(${B.length}, minmax(0, 1fr))` },
|
|
1356
|
-
children: [B.map((e) => /* @__PURE__ */ c("div", {
|
|
1357
|
-
className: "nabs-ui-event-calendar__dayColumn",
|
|
1358
|
-
children: Array.from({ length: U }, (t, n) => /* @__PURE__ */ c("div", { className: "nabs-ui-event-calendar__timeGridLine" }, `${e.id}-${n}`))
|
|
1359
|
-
}, `${e.id}-lane`)), V.map((e) => {
|
|
1360
|
-
let t = 100 / e.laneCount, n = e.laneIndex / e.laneCount * 100, r = Math.max(10, t - 2), i = B.findIndex((t) => t.id === e.columnId);
|
|
1361
|
-
if (i < 0) return null;
|
|
1362
|
-
let a = {
|
|
1363
|
-
event: e.event,
|
|
1364
|
-
view: A,
|
|
1365
|
-
segmentStart: e.start,
|
|
1366
|
-
segmentEnd: e.end,
|
|
1367
|
-
isClippedStart: !1,
|
|
1368
|
-
isClippedEnd: !1
|
|
1369
|
-
};
|
|
1370
|
-
return /* @__PURE__ */ c("div", {
|
|
1371
|
-
className: "nabs-ui-event-calendar__timedContainer",
|
|
1372
|
-
style: {
|
|
1373
|
-
gridColumn: `${i + 1}`,
|
|
1374
|
-
top: `${e.topPct}%`,
|
|
1375
|
-
height: `${e.heightPct}%`
|
|
1376
|
-
},
|
|
1377
|
-
children: /* @__PURE__ */ l("button", {
|
|
2315
|
+
]
|
|
2316
|
+
}) : null,
|
|
2317
|
+
Sn(G) ? /* @__PURE__ */ l("div", {
|
|
2318
|
+
className: "nabs-ui-event-calendar__timeView",
|
|
2319
|
+
children: [
|
|
2320
|
+
/* @__PURE__ */ c("div", {
|
|
2321
|
+
className: "nabs-ui-event-calendar__dayHeaderRow",
|
|
2322
|
+
children: /* @__PURE__ */ c("div", {
|
|
2323
|
+
className: "nabs-ui-event-calendar__dayHeaderGrid",
|
|
2324
|
+
style: { gridTemplateColumns: `repeat(${X.length}, minmax(0, 1fr))` },
|
|
2325
|
+
children: X.map((e) => /* @__PURE__ */ l("div", {
|
|
2326
|
+
className: "nabs-ui-event-calendar__dayHeaderCell",
|
|
2327
|
+
"aria-label": e.label,
|
|
2328
|
+
children: [/* @__PURE__ */ c("span", { children: e.shortLabel }), /* @__PURE__ */ c("strong", { children: e.date.getDate() })]
|
|
2329
|
+
}, e.id))
|
|
2330
|
+
})
|
|
2331
|
+
}),
|
|
2332
|
+
/* @__PURE__ */ c("div", {
|
|
2333
|
+
className: "nabs-ui-event-calendar__allDayRow",
|
|
2334
|
+
children: /* @__PURE__ */ l("div", {
|
|
2335
|
+
className: "nabs-ui-event-calendar__spanTrack",
|
|
2336
|
+
style: { gridTemplateColumns: `repeat(${X.length}, minmax(0, 1fr))` },
|
|
2337
|
+
children: [X.map((e) => /* @__PURE__ */ c("div", { className: "nabs-ui-event-calendar__spanCell" }, `${e.id}-all-day`)), Ve.map((e) => {
|
|
2338
|
+
let t = e.startIndex / X.length * 100, n = (e.endIndex - e.startIndex + 1) / X.length * 100, r = e.laneIndex * 1.9, i = {
|
|
2339
|
+
event: e.event,
|
|
2340
|
+
view: G,
|
|
2341
|
+
segmentStart: e.segmentStart,
|
|
2342
|
+
segmentEnd: e.segmentEnd,
|
|
2343
|
+
isClippedStart: e.isClippedStart,
|
|
2344
|
+
isClippedEnd: e.isClippedEnd
|
|
2345
|
+
};
|
|
2346
|
+
return /* @__PURE__ */ l("button", {
|
|
1378
2347
|
type: "button",
|
|
1379
2348
|
className: [
|
|
1380
2349
|
"nabs-ui-event-calendar__event",
|
|
1381
|
-
"nabs-ui-event-calendar__event--
|
|
2350
|
+
"nabs-ui-event-calendar__event--span",
|
|
1382
2351
|
e.event.className ?? ""
|
|
1383
2352
|
].filter(Boolean).join(" "),
|
|
1384
2353
|
style: {
|
|
1385
|
-
left: `${
|
|
1386
|
-
width: `${
|
|
2354
|
+
left: `${t}%`,
|
|
2355
|
+
width: `${n}%`,
|
|
2356
|
+
top: `${r}rem`
|
|
1387
2357
|
},
|
|
1388
2358
|
onClick: (t) => {
|
|
1389
2359
|
x?.({
|
|
@@ -1392,118 +2362,522 @@ var at = e(function({ events: e, view: n, defaultView: o = "week", anchorDate: s
|
|
|
1392
2362
|
});
|
|
1393
2363
|
},
|
|
1394
2364
|
onDoubleClick: (t) => {
|
|
1395
|
-
|
|
2365
|
+
w && (B(e.event.id), U(Fn(typeof e.event.data == "object" && e.event.data !== null ? e.event.data.mediaItems : void 0)), be("read"), W("details"), ve({
|
|
2366
|
+
title: Ln(e.event.title) || String(e.event.id),
|
|
2367
|
+
start: String(e.event.start),
|
|
2368
|
+
end: String(e.event.end),
|
|
2369
|
+
content: Ln(e.event.content ?? ""),
|
|
2370
|
+
allDay: e.event.allDay === !0
|
|
2371
|
+
})), S?.({
|
|
1396
2372
|
event: e.event,
|
|
1397
2373
|
nativeEvent: t
|
|
1398
2374
|
});
|
|
1399
2375
|
},
|
|
1400
|
-
children: [
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
2376
|
+
children: [
|
|
2377
|
+
e.isClippedStart ? /* @__PURE__ */ c("span", {
|
|
2378
|
+
className: "nabs-ui-event-calendar__clipMark",
|
|
2379
|
+
children: "‹"
|
|
2380
|
+
}) : null,
|
|
2381
|
+
Rn(i, "nabs-ui-event-calendar__eventContent", _),
|
|
2382
|
+
e.isClippedEnd ? /* @__PURE__ */ c("span", {
|
|
2383
|
+
className: "nabs-ui-event-calendar__clipMark",
|
|
2384
|
+
children: "›"
|
|
2385
|
+
}) : null
|
|
2386
|
+
]
|
|
2387
|
+
}, `${e.event.id}-${e.startIndex}-${e.endIndex}-${e.laneIndex}`);
|
|
2388
|
+
})]
|
|
2389
|
+
})
|
|
2390
|
+
}),
|
|
2391
|
+
/* @__PURE__ */ c("div", {
|
|
2392
|
+
className: "nabs-ui-event-calendar__timeGridArea",
|
|
2393
|
+
children: /* @__PURE__ */ l("div", {
|
|
2394
|
+
className: "nabs-ui-event-calendar__dayColumns",
|
|
2395
|
+
style: { gridTemplateColumns: `repeat(${X.length}, minmax(0, 1fr))` },
|
|
2396
|
+
children: [X.map((e) => /* @__PURE__ */ c("div", {
|
|
2397
|
+
className: "nabs-ui-event-calendar__dayColumn",
|
|
2398
|
+
children: Array.from({ length: He }, (t, n) => /* @__PURE__ */ c("div", { className: "nabs-ui-event-calendar__timeGridLine" }, `${e.id}-${n}`))
|
|
2399
|
+
}, `${e.id}-lane`)), Be.map((e) => {
|
|
2400
|
+
let t = 100 / e.laneCount, n = e.laneIndex / e.laneCount * 100, r = Math.max(10, t - 2), i = X.findIndex((t) => t.id === e.columnId);
|
|
2401
|
+
if (i < 0) return null;
|
|
2402
|
+
let a = {
|
|
2403
|
+
event: e.event,
|
|
2404
|
+
view: G,
|
|
2405
|
+
segmentStart: e.start,
|
|
2406
|
+
segmentEnd: e.end,
|
|
2407
|
+
isClippedStart: !1,
|
|
2408
|
+
isClippedEnd: !1
|
|
2409
|
+
};
|
|
2410
|
+
return /* @__PURE__ */ c("div", {
|
|
2411
|
+
className: "nabs-ui-event-calendar__timedContainer",
|
|
2412
|
+
style: {
|
|
2413
|
+
gridColumn: `${i + 1}`,
|
|
2414
|
+
top: `${e.topPct}%`,
|
|
2415
|
+
height: `${e.heightPct}%`
|
|
2416
|
+
},
|
|
2417
|
+
children: /* @__PURE__ */ l("button", {
|
|
2418
|
+
type: "button",
|
|
2419
|
+
className: [
|
|
2420
|
+
"nabs-ui-event-calendar__event",
|
|
2421
|
+
"nabs-ui-event-calendar__event--timed",
|
|
2422
|
+
e.event.className ?? ""
|
|
2423
|
+
].filter(Boolean).join(" "),
|
|
2424
|
+
style: {
|
|
2425
|
+
left: `${n}%`,
|
|
2426
|
+
width: `${r}%`
|
|
2427
|
+
},
|
|
2428
|
+
onClick: (t) => {
|
|
2429
|
+
x?.({
|
|
2430
|
+
event: e.event,
|
|
2431
|
+
nativeEvent: t
|
|
2432
|
+
});
|
|
2433
|
+
},
|
|
2434
|
+
onDoubleClick: (t) => {
|
|
2435
|
+
w && (B(e.event.id), U(Fn(typeof e.event.data == "object" && e.event.data !== null ? e.event.data.mediaItems : void 0)), be("read"), W("details"), ve({
|
|
2436
|
+
title: Ln(e.event.title) || String(e.event.id),
|
|
2437
|
+
start: String(e.event.start),
|
|
2438
|
+
end: String(e.event.end),
|
|
2439
|
+
content: Ln(e.event.content ?? ""),
|
|
2440
|
+
allDay: e.event.allDay === !0
|
|
2441
|
+
})), S?.({
|
|
2442
|
+
event: e.event,
|
|
2443
|
+
nativeEvent: t
|
|
2444
|
+
});
|
|
2445
|
+
},
|
|
2446
|
+
children: [/* @__PURE__ */ c("div", {
|
|
2447
|
+
className: "nabs-ui-event-calendar__eventMeta",
|
|
2448
|
+
children: Cn(e.start, e.end)
|
|
2449
|
+
}), Rn(a, "nabs-ui-event-calendar__eventContent", _)]
|
|
2450
|
+
})
|
|
2451
|
+
}, `${e.event.id}-${e.columnId}-${e.laneIndex}-${e.topPct}`);
|
|
2452
|
+
})]
|
|
2453
|
+
})
|
|
1407
2454
|
})
|
|
2455
|
+
]
|
|
2456
|
+
}) : /* @__PURE__ */ c("div", {
|
|
2457
|
+
className: "nabs-ui-event-calendar__monthLayouts",
|
|
2458
|
+
children: Ue.map((e) => {
|
|
2459
|
+
let t = Number(e.id.split("-")[1] ?? "0");
|
|
2460
|
+
return /* @__PURE__ */ l("article", {
|
|
2461
|
+
className: "nabs-ui-event-calendar__monthCard",
|
|
2462
|
+
children: [
|
|
2463
|
+
/* @__PURE__ */ c("header", {
|
|
2464
|
+
className: "nabs-ui-event-calendar__monthHeader",
|
|
2465
|
+
children: /* @__PURE__ */ c("h3", { children: e.title })
|
|
2466
|
+
}),
|
|
2467
|
+
/* @__PURE__ */ c("div", {
|
|
2468
|
+
className: "nabs-ui-event-calendar__weekdayHeader",
|
|
2469
|
+
style: { gridTemplateColumns: "repeat(7, minmax(0, 1fr))" },
|
|
2470
|
+
children: Array.from({ length: 7 }, (t, n) => {
|
|
2471
|
+
let r = new Date(2026, 0, 4 + n);
|
|
2472
|
+
return /* @__PURE__ */ c("div", {
|
|
2473
|
+
className: "nabs-ui-event-calendar__weekdayCell",
|
|
2474
|
+
children: new Intl.DateTimeFormat(void 0, { weekday: "short" }).format(r)
|
|
2475
|
+
}, `${e.id}-weekday-${n}`);
|
|
2476
|
+
})
|
|
2477
|
+
}),
|
|
2478
|
+
/* @__PURE__ */ c("div", {
|
|
2479
|
+
className: "nabs-ui-event-calendar__monthWeeks",
|
|
2480
|
+
children: e.weeks.map((e) => /* @__PURE__ */ l("div", {
|
|
2481
|
+
className: "nabs-ui-event-calendar__monthWeek",
|
|
2482
|
+
children: [/* @__PURE__ */ c("div", {
|
|
2483
|
+
className: "nabs-ui-event-calendar__monthWeekDays",
|
|
2484
|
+
style: { gridTemplateColumns: "repeat(7, minmax(0, 1fr))" },
|
|
2485
|
+
children: e.days.map((n) => /* @__PURE__ */ c("div", {
|
|
2486
|
+
className: ["nabs-ui-event-calendar__monthDayCell", n.getMonth() === t ? "" : "nabs-ui-event-calendar__monthDayCell--outside"].filter(Boolean).join(" "),
|
|
2487
|
+
children: /* @__PURE__ */ c("span", {
|
|
2488
|
+
className: "nabs-ui-event-calendar__monthDayNumber",
|
|
2489
|
+
children: n.getDate()
|
|
2490
|
+
})
|
|
2491
|
+
}, `${e.id}-${n.toISOString()}`))
|
|
2492
|
+
}), /* @__PURE__ */ c("div", {
|
|
2493
|
+
className: "nabs-ui-event-calendar__monthWeekSpans",
|
|
2494
|
+
children: e.segments.map((t) => {
|
|
2495
|
+
let n = t.startIndex / 7 * 100, r = (t.endIndex - t.startIndex + 1) / 7 * 100, i = t.laneIndex * 1.85, a = {
|
|
2496
|
+
event: t.event,
|
|
2497
|
+
view: G,
|
|
2498
|
+
segmentStart: t.segmentStart,
|
|
2499
|
+
segmentEnd: t.segmentEnd,
|
|
2500
|
+
isClippedStart: t.isClippedStart,
|
|
2501
|
+
isClippedEnd: t.isClippedEnd
|
|
2502
|
+
};
|
|
2503
|
+
return /* @__PURE__ */ l("button", {
|
|
2504
|
+
type: "button",
|
|
2505
|
+
className: [
|
|
2506
|
+
"nabs-ui-event-calendar__event",
|
|
2507
|
+
"nabs-ui-event-calendar__event--month",
|
|
2508
|
+
t.event.className ?? ""
|
|
2509
|
+
].filter(Boolean).join(" "),
|
|
2510
|
+
style: {
|
|
2511
|
+
left: `${n}%`,
|
|
2512
|
+
width: `${r}%`,
|
|
2513
|
+
top: `${i}rem`
|
|
2514
|
+
},
|
|
2515
|
+
onClick: (e) => {
|
|
2516
|
+
x?.({
|
|
2517
|
+
event: t.event,
|
|
2518
|
+
nativeEvent: e
|
|
2519
|
+
});
|
|
2520
|
+
},
|
|
2521
|
+
onDoubleClick: (e) => {
|
|
2522
|
+
w && (B(t.event.id), U(Fn(typeof t.event.data == "object" && t.event.data !== null ? t.event.data.mediaItems : void 0)), be("read"), W("details"), ve({
|
|
2523
|
+
title: Ln(t.event.title) || String(t.event.id),
|
|
2524
|
+
start: String(t.event.start),
|
|
2525
|
+
end: String(t.event.end),
|
|
2526
|
+
content: Ln(t.event.content ?? ""),
|
|
2527
|
+
allDay: t.event.allDay === !0
|
|
2528
|
+
})), S?.({
|
|
2529
|
+
event: t.event,
|
|
2530
|
+
nativeEvent: e
|
|
2531
|
+
});
|
|
2532
|
+
},
|
|
2533
|
+
children: [
|
|
2534
|
+
t.isClippedStart ? /* @__PURE__ */ c("span", {
|
|
2535
|
+
className: "nabs-ui-event-calendar__clipMark",
|
|
2536
|
+
children: "‹"
|
|
2537
|
+
}) : null,
|
|
2538
|
+
/* @__PURE__ */ c("div", {
|
|
2539
|
+
className: "nabs-ui-event-calendar__eventMeta",
|
|
2540
|
+
children: Cn(t.segmentStart, t.segmentEnd)
|
|
2541
|
+
}),
|
|
2542
|
+
Rn(a, "nabs-ui-event-calendar__eventContent", _),
|
|
2543
|
+
t.isClippedEnd ? /* @__PURE__ */ c("span", {
|
|
2544
|
+
className: "nabs-ui-event-calendar__clipMark",
|
|
2545
|
+
children: "›"
|
|
2546
|
+
}) : null
|
|
2547
|
+
]
|
|
2548
|
+
}, `${e.id}-${t.event.id}-${t.startIndex}-${t.endIndex}-${t.laneIndex}`);
|
|
2549
|
+
})
|
|
2550
|
+
})]
|
|
2551
|
+
}, e.id))
|
|
2552
|
+
})
|
|
2553
|
+
]
|
|
2554
|
+
}, e.id);
|
|
1408
2555
|
})
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
className: "nabs-ui-event-
|
|
2556
|
+
}),
|
|
2557
|
+
oe && w ? /* @__PURE__ */ c(Ce, {
|
|
2558
|
+
title: "Event Type Admin",
|
|
2559
|
+
description: "Define event object types and model fields. The minimum id/title/start/end contract is always enforced.",
|
|
2560
|
+
onRequestClose: () => se(!1),
|
|
2561
|
+
footer: /* @__PURE__ */ l("div", {
|
|
2562
|
+
className: "nabs-ui-event-calendar__native-footer nabs-ui-event-calendar__native-footer--right",
|
|
2563
|
+
children: [/* @__PURE__ */ c(z, {
|
|
2564
|
+
variant: "secondary",
|
|
2565
|
+
onClick: () => se(!1),
|
|
2566
|
+
children: "Close"
|
|
2567
|
+
}), /* @__PURE__ */ c(z, {
|
|
2568
|
+
onClick: () => {
|
|
2569
|
+
qe() && se(!1);
|
|
2570
|
+
},
|
|
2571
|
+
children: "Save type"
|
|
2572
|
+
})]
|
|
2573
|
+
}),
|
|
2574
|
+
children: /* @__PURE__ */ l("div", {
|
|
2575
|
+
className: "nabs-ui-event-calendar__native-grid",
|
|
1416
2576
|
children: [
|
|
1417
|
-
/* @__PURE__ */
|
|
1418
|
-
className: "nabs-ui-event-
|
|
1419
|
-
children: /* @__PURE__ */ c("
|
|
2577
|
+
/* @__PURE__ */ l("label", {
|
|
2578
|
+
className: "nabs-ui-event-calendar__native-grid",
|
|
2579
|
+
children: [/* @__PURE__ */ c("span", { children: "Type name" }), /* @__PURE__ */ c("input", {
|
|
2580
|
+
className: "nabs-ui-event-calendar__native-input",
|
|
2581
|
+
value: N,
|
|
2582
|
+
onChange: (e) => P(e.target.value),
|
|
2583
|
+
placeholder: "Media briefing"
|
|
2584
|
+
})]
|
|
1420
2585
|
}),
|
|
1421
|
-
/* @__PURE__ */
|
|
1422
|
-
className: "nabs-ui-event-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
},
|
|
1430
|
-
|
|
2586
|
+
/* @__PURE__ */ l("label", {
|
|
2587
|
+
className: "nabs-ui-event-calendar__native-grid",
|
|
2588
|
+
children: [/* @__PURE__ */ c("span", { children: "Model JSON" }), /* @__PURE__ */ c("textarea", {
|
|
2589
|
+
className: "nabs-ui-event-calendar__native-input",
|
|
2590
|
+
rows: 8,
|
|
2591
|
+
value: F,
|
|
2592
|
+
onChange: (e) => {
|
|
2593
|
+
ae(e.target.value), L("");
|
|
2594
|
+
},
|
|
2595
|
+
placeholder: "[{\"key\":\"description\",\"label\":\"Description\",\"type\":\"string\"}]"
|
|
2596
|
+
})]
|
|
1431
2597
|
}),
|
|
1432
|
-
/* @__PURE__ */ c("
|
|
1433
|
-
className: "nabs-ui-event-
|
|
1434
|
-
children:
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
2598
|
+
I ? /* @__PURE__ */ c("p", {
|
|
2599
|
+
className: "nabs-ui-event-calendar__native-note",
|
|
2600
|
+
children: I
|
|
2601
|
+
}) : null
|
|
2602
|
+
]
|
|
2603
|
+
})
|
|
2604
|
+
}) : null,
|
|
2605
|
+
ce && w ? /* @__PURE__ */ c(Ce, {
|
|
2606
|
+
title: "Add Event",
|
|
2607
|
+
description: "Choose an event object type, enter values, and save to add it to the calendar.",
|
|
2608
|
+
onRequestClose: () => le(!1),
|
|
2609
|
+
footer: /* @__PURE__ */ l("div", {
|
|
2610
|
+
className: "nabs-ui-event-calendar__native-footer nabs-ui-event-calendar__native-footer--right",
|
|
2611
|
+
children: [/* @__PURE__ */ c(z, {
|
|
2612
|
+
variant: "secondary",
|
|
2613
|
+
onClick: () => le(!1),
|
|
2614
|
+
children: "Cancel"
|
|
2615
|
+
}), /* @__PURE__ */ c(z, {
|
|
2616
|
+
onClick: () => {
|
|
2617
|
+
Je() && le(!1);
|
|
2618
|
+
},
|
|
2619
|
+
children: "Create event"
|
|
2620
|
+
})]
|
|
2621
|
+
}),
|
|
2622
|
+
children: /* @__PURE__ */ l("div", {
|
|
2623
|
+
className: "nabs-ui-event-calendar__native-grid",
|
|
2624
|
+
children: [
|
|
2625
|
+
/* @__PURE__ */ l("label", {
|
|
2626
|
+
className: "nabs-ui-event-calendar__native-grid",
|
|
2627
|
+
children: [/* @__PURE__ */ c("span", { children: "Event object type" }), /* @__PURE__ */ c(ke, {
|
|
2628
|
+
items: Ie,
|
|
2629
|
+
value: j,
|
|
2630
|
+
onValueChange: (e) => {
|
|
2631
|
+
e && (M(e), ge([]));
|
|
2632
|
+
}
|
|
2633
|
+
})]
|
|
2634
|
+
}),
|
|
2635
|
+
/* @__PURE__ */ c(Tt, {
|
|
2636
|
+
schema: Pe,
|
|
2637
|
+
value: R,
|
|
2638
|
+
onChange: (e) => me(e)
|
|
2639
|
+
}),
|
|
2640
|
+
Fe ? /* @__PURE__ */ l("div", {
|
|
2641
|
+
className: "nabs-ui-event-calendar__native-grid",
|
|
2642
|
+
children: [
|
|
2643
|
+
/* @__PURE__ */ c("span", { children: "Media upload" }),
|
|
2644
|
+
/* @__PURE__ */ c(Nt, {
|
|
2645
|
+
label: "Upload event media",
|
|
2646
|
+
accept: "image/*",
|
|
2647
|
+
extensions: [
|
|
2648
|
+
"png",
|
|
2649
|
+
"jpg",
|
|
2650
|
+
"jpeg",
|
|
2651
|
+
"gif",
|
|
2652
|
+
"webp"
|
|
2653
|
+
],
|
|
2654
|
+
multiple: !0,
|
|
2655
|
+
onFilesSelected: ({ acceptedFiles: e }) => {
|
|
2656
|
+
ge(e);
|
|
2657
|
+
}
|
|
2658
|
+
}),
|
|
2659
|
+
/* @__PURE__ */ l("p", {
|
|
2660
|
+
className: "nabs-ui-event-calendar__native-note",
|
|
2661
|
+
children: ["Selected media files: ", he.length]
|
|
2662
|
+
})
|
|
2663
|
+
]
|
|
2664
|
+
}) : null
|
|
2665
|
+
]
|
|
2666
|
+
})
|
|
2667
|
+
}) : null,
|
|
2668
|
+
Y && w ? /* @__PURE__ */ c(Ce, {
|
|
2669
|
+
title: `Edit ${typeof Y.title == "string" ? Y.title : Y.id}`,
|
|
2670
|
+
description: "Double-clicked event data editor.",
|
|
2671
|
+
onRequestClose: () => B(null),
|
|
2672
|
+
footer: /* @__PURE__ */ l("div", {
|
|
2673
|
+
className: "nabs-ui-event-calendar__native-footer nabs-ui-event-calendar__native-footer--between",
|
|
2674
|
+
children: [/* @__PURE__ */ c("div", {
|
|
2675
|
+
className: "nabs-ui-event-calendar__native-row",
|
|
2676
|
+
children: ye === "read" ? /* @__PURE__ */ c(z, {
|
|
2677
|
+
onClick: () => {
|
|
2678
|
+
be("edit");
|
|
2679
|
+
},
|
|
2680
|
+
children: "Edit mode"
|
|
2681
|
+
}) : /* @__PURE__ */ c(z, {
|
|
2682
|
+
variant: "secondary",
|
|
2683
|
+
onClick: () => {
|
|
2684
|
+
be("read");
|
|
2685
|
+
},
|
|
2686
|
+
children: "Read only"
|
|
2687
|
+
})
|
|
2688
|
+
}), /* @__PURE__ */ l("div", {
|
|
2689
|
+
className: "nabs-ui-event-calendar__native-row",
|
|
2690
|
+
children: [/* @__PURE__ */ c(z, {
|
|
2691
|
+
variant: "secondary",
|
|
2692
|
+
onClick: () => {
|
|
2693
|
+
B(null), U([]);
|
|
2694
|
+
},
|
|
2695
|
+
children: "Close"
|
|
2696
|
+
}), ye === "edit" ? /* @__PURE__ */ c(z, {
|
|
2697
|
+
onClick: () => {
|
|
2698
|
+
if (Y) {
|
|
2699
|
+
let e = String(V.title ?? "").trim(), t = String(V.start ?? "").trim(), n = String(V.end ?? "").trim(), r = String(V.content ?? "").trim(), i = typeof Y.data == "object" && Y.data !== null ? Y.data : {};
|
|
2700
|
+
pe((a) => ({
|
|
2701
|
+
...a,
|
|
2702
|
+
[Y.id]: {
|
|
2703
|
+
title: e || Y.title,
|
|
2704
|
+
start: t || Y.start,
|
|
2705
|
+
end: n || Y.end,
|
|
2706
|
+
content: In(r, H),
|
|
2707
|
+
allDay: !!V.allDay,
|
|
2708
|
+
data: {
|
|
2709
|
+
...i,
|
|
2710
|
+
mediaFileNames: H.map((e) => e.name),
|
|
2711
|
+
mediaItems: H
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2714
|
+
}));
|
|
2715
|
+
}
|
|
2716
|
+
be("read"), B(null), U([]);
|
|
2717
|
+
},
|
|
2718
|
+
children: "Save"
|
|
2719
|
+
}) : null]
|
|
2720
|
+
})]
|
|
2721
|
+
}),
|
|
2722
|
+
children: /* @__PURE__ */ l("div", {
|
|
2723
|
+
className: "nabs-ui-event-calendar__native-grid nabs-ui-event-calendar__native-grid--compact",
|
|
2724
|
+
children: [/* @__PURE__ */ c("div", {
|
|
2725
|
+
className: "nabs-ui-event-calendar__tablist",
|
|
2726
|
+
role: "tablist",
|
|
2727
|
+
"aria-label": "Event editor sections",
|
|
2728
|
+
children: [{
|
|
2729
|
+
id: "details",
|
|
2730
|
+
label: "Details"
|
|
2731
|
+
}, {
|
|
2732
|
+
id: "media",
|
|
2733
|
+
label: "Media"
|
|
2734
|
+
}].map((e) => Se === e.id ? /* @__PURE__ */ c("button", {
|
|
2735
|
+
type: "button",
|
|
2736
|
+
role: "tab",
|
|
2737
|
+
"aria-selected": "true",
|
|
2738
|
+
className: "nabs-ui-event-calendar__tab-trigger nabs-ui-event-calendar__tab-trigger--active",
|
|
2739
|
+
onClick: () => W(e.id),
|
|
2740
|
+
onKeyDown: (e) => {
|
|
2741
|
+
let t = zn(Se, e.key);
|
|
2742
|
+
t !== Se && (e.preventDefault(), W(t));
|
|
2743
|
+
},
|
|
2744
|
+
children: e.label
|
|
2745
|
+
}, e.id) : /* @__PURE__ */ c("button", {
|
|
2746
|
+
type: "button",
|
|
2747
|
+
role: "tab",
|
|
2748
|
+
"aria-selected": "false",
|
|
2749
|
+
className: "nabs-ui-event-calendar__tab-trigger",
|
|
2750
|
+
onClick: () => W(e.id),
|
|
2751
|
+
onKeyDown: (e) => {
|
|
2752
|
+
let t = zn(Se, e.key);
|
|
2753
|
+
t !== Se && (e.preventDefault(), W(t));
|
|
2754
|
+
},
|
|
2755
|
+
children: e.label
|
|
2756
|
+
}, e.id))
|
|
2757
|
+
}), /* @__PURE__ */ c(Ft, {
|
|
2758
|
+
showHeader: !1,
|
|
2759
|
+
className: "nabs-ui-event-calendar__connected-tab",
|
|
2760
|
+
children: Se === "details" ? ye === "read" ? /* @__PURE__ */ l("div", {
|
|
2761
|
+
className: "nabs-ui-event-calendar__native-grid",
|
|
2762
|
+
children: [
|
|
2763
|
+
/* @__PURE__ */ l("p", { children: [
|
|
2764
|
+
/* @__PURE__ */ c("strong", { children: "Title:" }),
|
|
2765
|
+
" ",
|
|
2766
|
+
String(V.title ?? "")
|
|
2767
|
+
] }),
|
|
2768
|
+
/* @__PURE__ */ l("p", { children: [
|
|
2769
|
+
/* @__PURE__ */ c("strong", { children: "Start:" }),
|
|
2770
|
+
" ",
|
|
2771
|
+
String(V.start ?? "")
|
|
2772
|
+
] }),
|
|
2773
|
+
/* @__PURE__ */ l("p", { children: [
|
|
2774
|
+
/* @__PURE__ */ c("strong", { children: "End:" }),
|
|
2775
|
+
" ",
|
|
2776
|
+
String(V.end ?? "")
|
|
2777
|
+
] }),
|
|
2778
|
+
/* @__PURE__ */ l("p", { children: [
|
|
2779
|
+
/* @__PURE__ */ c("strong", { children: "All day:" }),
|
|
2780
|
+
" ",
|
|
2781
|
+
V.allDay ? "Yes" : "No"
|
|
2782
|
+
] }),
|
|
2783
|
+
/* @__PURE__ */ l("p", { children: [
|
|
2784
|
+
/* @__PURE__ */ c("strong", { children: "Content:" }),
|
|
2785
|
+
" ",
|
|
2786
|
+
String(V.content ?? "") || "(none)"
|
|
2787
|
+
] })
|
|
2788
|
+
]
|
|
2789
|
+
}) : /* @__PURE__ */ c(Tt, {
|
|
2790
|
+
schema: ze,
|
|
2791
|
+
value: V,
|
|
2792
|
+
onChange: (e) => {
|
|
2793
|
+
ve(e);
|
|
2794
|
+
}
|
|
2795
|
+
}) : /* @__PURE__ */ l("div", {
|
|
2796
|
+
className: "nabs-ui-event-calendar__native-grid",
|
|
2797
|
+
children: [ye === "edit" && Re ? /* @__PURE__ */ l("div", {
|
|
2798
|
+
className: "nabs-ui-event-calendar__native-grid",
|
|
2799
|
+
children: [/* @__PURE__ */ c("span", { children: "Media upload" }), /* @__PURE__ */ c(Nt, {
|
|
2800
|
+
label: "Upload event media",
|
|
2801
|
+
accept: "image/*",
|
|
2802
|
+
extensions: [
|
|
2803
|
+
"png",
|
|
2804
|
+
"jpg",
|
|
2805
|
+
"jpeg",
|
|
2806
|
+
"gif",
|
|
2807
|
+
"webp"
|
|
2808
|
+
],
|
|
2809
|
+
multiple: !0,
|
|
2810
|
+
onFilesSelected: ({ acceptedFiles: e }) => {
|
|
2811
|
+
let t = Pn(e);
|
|
2812
|
+
U((e) => [...e, ...t]);
|
|
2813
|
+
}
|
|
1498
2814
|
})]
|
|
1499
|
-
},
|
|
2815
|
+
}) : null, /* @__PURE__ */ l("div", {
|
|
2816
|
+
className: "nabs-ui-event-calendar__native-grid",
|
|
2817
|
+
children: [/* @__PURE__ */ c("span", { children: "Photos" }), H.length === 0 ? /* @__PURE__ */ c("p", {
|
|
2818
|
+
className: "nabs-ui-event-calendar__native-note",
|
|
2819
|
+
children: "No photos attached."
|
|
2820
|
+
}) : /* @__PURE__ */ c("div", {
|
|
2821
|
+
className: "nabs-ui-event-calendar__photo-grid",
|
|
2822
|
+
children: H.map((e, t) => /* @__PURE__ */ l("div", {
|
|
2823
|
+
className: "nabs-ui-event-calendar__photo-card",
|
|
2824
|
+
children: [
|
|
2825
|
+
/* @__PURE__ */ c("img", {
|
|
2826
|
+
src: e.url,
|
|
2827
|
+
alt: e.name,
|
|
2828
|
+
className: "nabs-ui-event-calendar__photo-card-image"
|
|
2829
|
+
}),
|
|
2830
|
+
/* @__PURE__ */ c("span", {
|
|
2831
|
+
className: "nabs-ui-event-calendar__photo-card-name",
|
|
2832
|
+
children: e.name
|
|
2833
|
+
}),
|
|
2834
|
+
ye === "edit" ? /* @__PURE__ */ l("div", {
|
|
2835
|
+
className: "nabs-ui-event-calendar__native-row",
|
|
2836
|
+
children: [
|
|
2837
|
+
/* @__PURE__ */ c(z, {
|
|
2838
|
+
variant: "secondary",
|
|
2839
|
+
disabled: t === 0,
|
|
2840
|
+
onClick: () => {
|
|
2841
|
+
U((e) => {
|
|
2842
|
+
if (t === 0) return e;
|
|
2843
|
+
let n = [...e], r = n[t - 1];
|
|
2844
|
+
return n[t - 1] = n[t], n[t] = r, n;
|
|
2845
|
+
});
|
|
2846
|
+
},
|
|
2847
|
+
children: "Up"
|
|
2848
|
+
}),
|
|
2849
|
+
/* @__PURE__ */ c(z, {
|
|
2850
|
+
variant: "secondary",
|
|
2851
|
+
disabled: t === H.length - 1,
|
|
2852
|
+
onClick: () => {
|
|
2853
|
+
U((e) => {
|
|
2854
|
+
if (t === e.length - 1) return e;
|
|
2855
|
+
let n = [...e], r = n[t + 1];
|
|
2856
|
+
return n[t + 1] = n[t], n[t] = r, n;
|
|
2857
|
+
});
|
|
2858
|
+
},
|
|
2859
|
+
children: "Down"
|
|
2860
|
+
}),
|
|
2861
|
+
/* @__PURE__ */ c(z, {
|
|
2862
|
+
variant: "secondary",
|
|
2863
|
+
onClick: () => {
|
|
2864
|
+
U((t) => t.filter((t) => t.id !== e.id));
|
|
2865
|
+
},
|
|
2866
|
+
children: "Remove"
|
|
2867
|
+
})
|
|
2868
|
+
]
|
|
2869
|
+
}) : null
|
|
2870
|
+
]
|
|
2871
|
+
}, e.id))
|
|
2872
|
+
})]
|
|
2873
|
+
})]
|
|
1500
2874
|
})
|
|
1501
|
-
]
|
|
1502
|
-
}
|
|
1503
|
-
})
|
|
1504
|
-
|
|
2875
|
+
})]
|
|
2876
|
+
})
|
|
2877
|
+
}) : null
|
|
2878
|
+
]
|
|
1505
2879
|
});
|
|
1506
2880
|
});
|
|
1507
|
-
|
|
2881
|
+
Bn.displayName = "EventCalendar";
|
|
1508
2882
|
//#endregion
|
|
1509
|
-
export { d as Branding, b as Breadcrumb,
|
|
2883
|
+
export { d as Branding, b as Breadcrumb, Bn as EventCalendar, ce as PieChart, u as Shell, N as TwoDChart };
|