@base-framework/ui 1.0.279 → 1.0.281
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/atoms.es.js +25 -25
- package/dist/index.es.js +31 -31
- package/dist/{skeleton-CLm2c9Bc.js → inputs-DYxmO1rQ.js} +44 -47
- package/dist/organisms.es.js +1 -1
- package/dist/{signature-panel-LOOJ7iLB.js → signature-panel-BEO99NlI.js} +236 -273
- package/dist/{tooltip-nLqurlbX.js → tooltip-Cok_NM7z.js} +19 -16
- package/dist/types/components/organisms/lists/data-table-body.d.ts +1 -1
- package/dist/types/components/organisms/lists/data-table.d.ts +6 -12
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { Button as
|
|
2
|
-
import { Atom as
|
|
3
|
-
import { B as T, I as
|
|
4
|
-
import { Icons as
|
|
5
|
-
import { TableBody as
|
|
6
|
-
import { C as
|
|
7
|
-
import { A as
|
|
8
|
-
|
|
1
|
+
import { Button as x, Div as o, On as v, Span as D, Th as O, UseParent as F, I as E, Thead as Q, Tr as X, Table as I, P as p, Li as S, Time as q, Nav as C, Ul as w, Section as z, Canvas as K } from "@base-framework/atoms";
|
|
2
|
+
import { Atom as h, Component as u, Data as L, DateTime as G, router as y, NavLink as $, DataTracker as N, Jot as V, base as M, Dom as R } from "@base-framework/base";
|
|
3
|
+
import { B as T, I as _ } from "./buttons-BKLL4I6r.js";
|
|
4
|
+
import { Icons as k } from "./icons.es.js";
|
|
5
|
+
import { TableBody as J, DataTableBody as Z, ScrollableTableBody as ee, List as te, IntervalTimer as se } from "@base-framework/organisms";
|
|
6
|
+
import { C as ae, I as ie, H as ne } from "./inputs-DYxmO1rQ.js";
|
|
7
|
+
import { A as oe, P as le } from "./range-calendar-DW0cMOJy.js";
|
|
8
|
+
h((t, e) => ({
|
|
9
9
|
class: "flex items-center px-4 py-2",
|
|
10
10
|
...t,
|
|
11
11
|
children: e
|
|
12
12
|
}));
|
|
13
|
-
|
|
13
|
+
h(({ value: t, label: e }) => x({
|
|
14
14
|
class: "inline-flex flex-auto items-center justify-center whitespace-nowrap rounded-md px-8 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
|
|
15
15
|
onState: ["performance", { active: t }],
|
|
16
16
|
dataSet: ["performance", ["state", t, "active"]],
|
|
17
17
|
click: (s, { state: a }) => a.performance = t
|
|
18
18
|
}, e));
|
|
19
|
-
class
|
|
19
|
+
class at extends u {
|
|
20
20
|
/**
|
|
21
21
|
* This will declare the props for the compiler.
|
|
22
22
|
*
|
|
@@ -34,55 +34,55 @@ class ot extends h {
|
|
|
34
34
|
return o({ class: this.class || "" }, this.children);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
const
|
|
37
|
+
const re = (t) => {
|
|
38
38
|
const e = new Date(t, 11, 31), s = new Date(t, 0, 1);
|
|
39
39
|
return e.getDay() === 4 || // December 31 is a Thursday
|
|
40
40
|
s.getDay() === 4;
|
|
41
|
-
},
|
|
41
|
+
}, ce = (t) => {
|
|
42
42
|
const e = new Date(t.valueOf()), s = (e.getDay() + 6) % 7;
|
|
43
43
|
e.setDate(e.getDate() - s + 3);
|
|
44
44
|
const a = e.getFullYear(), i = new Date(a, 0, 4);
|
|
45
45
|
i.setDate(i.getDate() - (i.getDay() + 6) % 7);
|
|
46
46
|
const n = Math.ceil((e - i) / 6048e5) + 1;
|
|
47
|
-
return n > 52 && !
|
|
47
|
+
return n > 52 && !re(a) ? {
|
|
48
48
|
weekNumber: 1,
|
|
49
49
|
year: a + 1
|
|
50
50
|
} : {
|
|
51
51
|
weekNumber: n,
|
|
52
52
|
year: a
|
|
53
53
|
};
|
|
54
|
-
},
|
|
54
|
+
}, de = (t, e, s) => {
|
|
55
55
|
if (s === 0) return [];
|
|
56
56
|
const a = new Date(t, e, 0).getDate();
|
|
57
57
|
return Array.from(
|
|
58
58
|
{ length: s },
|
|
59
59
|
(i, n) => new Date(t, e - 1, a - s + n + 1)
|
|
60
60
|
);
|
|
61
|
-
},
|
|
61
|
+
}, he = (t, e, s) => Array.from({ length: s }, (a, i) => new Date(t, e + 1, i + 1)), W = (t, e) => {
|
|
62
62
|
const s = new Date(e, 0, 4), a = (s.getDay() + 6) % 7, i = new Date(s);
|
|
63
63
|
i.setDate(s.getDate() - a);
|
|
64
64
|
const n = new Date(i);
|
|
65
65
|
return n.setDate(i.getDate() + (t - 1) * 7), n;
|
|
66
|
-
},
|
|
66
|
+
}, it = (t, e) => {
|
|
67
67
|
const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(), i = [];
|
|
68
68
|
let n = [];
|
|
69
69
|
for (let l = 1 - s; l <= a; l++) {
|
|
70
|
-
const
|
|
71
|
-
n.push(l > 0 ?
|
|
70
|
+
const d = new Date(t, e, l);
|
|
71
|
+
n.push(l > 0 ? d : null), (n.length === 7 || l === a) && (i.push([...n]), n = []);
|
|
72
72
|
}
|
|
73
73
|
return i;
|
|
74
|
-
},
|
|
74
|
+
}, nt = (t, e) => {
|
|
75
75
|
const s = new Date(t, e + 1, 0).getDate(), a = [];
|
|
76
76
|
let i = [];
|
|
77
77
|
for (let n = 1; n <= s; n++)
|
|
78
78
|
i.push(new Date(t, e, n)), i.length === 7 && (a.push(i), i = []);
|
|
79
79
|
return i.length > 0 && a.push(i), a;
|
|
80
|
-
},
|
|
80
|
+
}, ue = (t, e, s) => {
|
|
81
81
|
const a = /* @__PURE__ */ new Date();
|
|
82
82
|
return a.getDate() === t && a.getMonth() === e && a.getFullYear() === s;
|
|
83
|
-
},
|
|
84
|
-
const n =
|
|
85
|
-
return
|
|
83
|
+
}, fe = ({ day: t, month: e, year: s, weekNumber: a, selectWeek: i }) => {
|
|
84
|
+
const n = ue(t, e, s);
|
|
85
|
+
return x({
|
|
86
86
|
text: t || "",
|
|
87
87
|
disabled: !t,
|
|
88
88
|
class: `
|
|
@@ -92,19 +92,19 @@ const de = (t) => {
|
|
|
92
92
|
`,
|
|
93
93
|
click: () => i(a, s)
|
|
94
94
|
});
|
|
95
|
-
},
|
|
96
|
-
const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(), i =
|
|
95
|
+
}, me = (t, e) => {
|
|
96
|
+
const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(), i = de(t, e, s), n = Array.from({ length: a }, (r, g) => new Date(t, e, g + 1)), l = (i.length + n.length) % 7, d = l === 0 ? 0 : 7 - l, c = he(t, e, d), f = [...i, ...n, ...c], m = [];
|
|
97
97
|
for (let r = 0; r < f.length; r += 7) {
|
|
98
|
-
const
|
|
98
|
+
const g = f.slice(r, r + 7), b = g.find((Y) => Y) || new Date(t, e, 1), { weekNumber: H, year: U } = ce(b);
|
|
99
99
|
m.push({
|
|
100
|
-
weekNumber:
|
|
101
|
-
year:
|
|
102
|
-
days:
|
|
100
|
+
weekNumber: H,
|
|
101
|
+
year: U,
|
|
102
|
+
days: g
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
return m;
|
|
106
|
-
},
|
|
107
|
-
const { year: i, month: n, currentDate: l } = a,
|
|
106
|
+
}, ge = ({ selectWeek: t }) => v("month", (e, s, { data: a }) => {
|
|
107
|
+
const { year: i, month: n, currentDate: l } = a, d = me(i, n);
|
|
108
108
|
return o(
|
|
109
109
|
{ class: "grid grid-cols-8 gap-1 text-sm px-4 py-2" },
|
|
110
110
|
[
|
|
@@ -119,7 +119,7 @@ const de = (t) => {
|
|
|
119
119
|
)
|
|
120
120
|
),
|
|
121
121
|
// Render each "week" row
|
|
122
|
-
...
|
|
122
|
+
...d.map(
|
|
123
123
|
({ weekNumber: c, days: f, year: m }) => o({
|
|
124
124
|
class: "grid grid-cols-8 col-span-8 items-center ring-primary rounded-sm px-1",
|
|
125
125
|
onSet: ["currentWeek", {
|
|
@@ -141,7 +141,7 @@ const de = (t) => {
|
|
|
141
141
|
o(
|
|
142
142
|
{ class: "grid grid-cols-7 col-span-7 text-center" },
|
|
143
143
|
f.map(
|
|
144
|
-
(r) =>
|
|
144
|
+
(r) => fe({
|
|
145
145
|
year: (r == null ? void 0 : r.getFullYear()) || null,
|
|
146
146
|
month: (r == null ? void 0 : r.getMonth()) || null,
|
|
147
147
|
day: (r == null ? void 0 : r.getDate()) || null,
|
|
@@ -154,7 +154,7 @@ const de = (t) => {
|
|
|
154
154
|
)
|
|
155
155
|
]
|
|
156
156
|
);
|
|
157
|
-
}),
|
|
157
|
+
}), P = ({ label: t, click: e }) => T(
|
|
158
158
|
{
|
|
159
159
|
class: `
|
|
160
160
|
inline-flex items-center justify-center h-7 w-7 bg-transparent p-0
|
|
@@ -165,20 +165,20 @@ const de = (t) => {
|
|
|
165
165
|
click: e,
|
|
166
166
|
"aria-label": `${t} month`,
|
|
167
167
|
variant: "icon",
|
|
168
|
-
icon: t === "Previous" ?
|
|
168
|
+
icon: t === "Previous" ? k.chevron.single.left : k.chevron.single.right
|
|
169
169
|
}
|
|
170
|
-
),
|
|
170
|
+
), pe = ({ next: t, previous: e }) => o({ class: "flex flex-auto min-h-12 text-sm font-medium relative justify-center items-center" }, [
|
|
171
171
|
D("[[monthName]] [[year]]"),
|
|
172
|
-
|
|
172
|
+
P({
|
|
173
173
|
label: "Previous",
|
|
174
174
|
click: e
|
|
175
175
|
}),
|
|
176
|
-
|
|
176
|
+
P({
|
|
177
177
|
label: "Next",
|
|
178
178
|
click: t
|
|
179
179
|
})
|
|
180
180
|
]);
|
|
181
|
-
class
|
|
181
|
+
class ot extends u {
|
|
182
182
|
/**
|
|
183
183
|
* This will declare the props for the compiler.
|
|
184
184
|
*
|
|
@@ -193,7 +193,7 @@ class ct extends h {
|
|
|
193
193
|
* @returns {Data}
|
|
194
194
|
*/
|
|
195
195
|
setData() {
|
|
196
|
-
const e = /* @__PURE__ */ new Date(), s = this.selectedWeek || this.calculateCurrentWeek(e), a =
|
|
196
|
+
const e = /* @__PURE__ */ new Date(), s = this.selectedWeek || this.calculateCurrentWeek(e), a = W(s, e.getFullYear());
|
|
197
197
|
return new L({
|
|
198
198
|
monthName: this.getMonthName(a.getMonth()),
|
|
199
199
|
year: a.getFullYear(),
|
|
@@ -231,7 +231,7 @@ class ct extends h {
|
|
|
231
231
|
* @returns {string}
|
|
232
232
|
*/
|
|
233
233
|
getMonthName(e) {
|
|
234
|
-
return
|
|
234
|
+
return G.monthNames[e];
|
|
235
235
|
}
|
|
236
236
|
/**
|
|
237
237
|
* Updates the calendar to show the previous month.
|
|
@@ -276,7 +276,7 @@ class ct extends h {
|
|
|
276
276
|
*/
|
|
277
277
|
selectWeek(e, s) {
|
|
278
278
|
this.data.currentWeek = e;
|
|
279
|
-
const a =
|
|
279
|
+
const a = W(e, s);
|
|
280
280
|
this.setDate(a.getMonth(), a.getFullYear(), a.getDate()), typeof this.selectedCallBack == "function" && this.selectedCallBack(e);
|
|
281
281
|
}
|
|
282
282
|
/**
|
|
@@ -286,38 +286,38 @@ class ct extends h {
|
|
|
286
286
|
*/
|
|
287
287
|
render() {
|
|
288
288
|
return o({ class: "week-calendar-container border rounded-md p-3" }, [
|
|
289
|
-
|
|
289
|
+
pe({
|
|
290
290
|
next: () => this.goToNextMonth(),
|
|
291
291
|
previous: () => this.goToPreviousMonth()
|
|
292
292
|
}),
|
|
293
|
-
|
|
293
|
+
ge({
|
|
294
294
|
selectWeek: (e, s) => this.selectWeek(e, s)
|
|
295
295
|
})
|
|
296
296
|
]);
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
const
|
|
299
|
+
const we = (t, e) => {
|
|
300
300
|
const s = t.toggleAllSelectedRows();
|
|
301
301
|
e.state.checked = !s;
|
|
302
|
-
},
|
|
303
|
-
|
|
304
|
-
]),
|
|
302
|
+
}, be = (t) => O({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class || ""}` }, [
|
|
303
|
+
F((e) => new ae({ class: "mr-2", onChange: (s, a) => we(e, a) }))
|
|
304
|
+
]), ye = ({ align: t, sortable: e, key: s, label: a, sort: i, class: n }) => {
|
|
305
305
|
const l = t || "justify-start";
|
|
306
|
-
return
|
|
306
|
+
return O({
|
|
307
307
|
class: `cursor-pointer py-3 px-4 text-base ${n || ""}`,
|
|
308
308
|
click: e && (() => i(s))
|
|
309
309
|
}, [
|
|
310
310
|
o({ class: `flex flex-auto w-full items-center ${l}` }, [
|
|
311
311
|
D(a),
|
|
312
|
-
e &&
|
|
312
|
+
e && E({ class: "ml-2", html: k.arrows.upDown })
|
|
313
313
|
])
|
|
314
314
|
]);
|
|
315
|
-
},
|
|
316
|
-
|
|
315
|
+
}, B = (t) => Q([
|
|
316
|
+
X({
|
|
317
317
|
class: "text-muted-foreground border-b",
|
|
318
318
|
map: [
|
|
319
319
|
t.headers,
|
|
320
|
-
(e) => e.label === "checkbox" ?
|
|
320
|
+
(e) => e.label === "checkbox" ? be({ toggle: t.toggle }) : ye({
|
|
321
321
|
align: e.align,
|
|
322
322
|
sortable: e.sortable,
|
|
323
323
|
key: e.key,
|
|
@@ -326,28 +326,17 @@ const be = (t, e) => {
|
|
|
326
326
|
})
|
|
327
327
|
]
|
|
328
328
|
})
|
|
329
|
-
]),
|
|
329
|
+
]), ke = ({ key: t, rows: e, selectRow: s, rowItem: a, emptyState: i, skeleton: n, columnCount: l }) => new J({
|
|
330
330
|
cache: "list",
|
|
331
331
|
key: t,
|
|
332
332
|
items: e,
|
|
333
|
-
rowItem: (
|
|
333
|
+
rowItem: (d) => a(d, s),
|
|
334
334
|
class: "divide-y divide-border",
|
|
335
|
-
emptyState: i
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
const n = ["w-3/4", "w-1/2", "w-full", "w-2/3", "w-5/6"], l = n[i % n.length];
|
|
341
|
-
return _({ class: "px-6 py-4" }, [
|
|
342
|
-
ne({ width: l, height: "h-4" })
|
|
343
|
-
]);
|
|
344
|
-
};
|
|
345
|
-
return $({
|
|
346
|
-
class: "border-b",
|
|
347
|
-
key: s
|
|
348
|
-
}, Array.from({ length: t }, (i, n) => a(n)));
|
|
349
|
-
};
|
|
350
|
-
class Y extends h {
|
|
335
|
+
emptyState: i,
|
|
336
|
+
skeleton: n,
|
|
337
|
+
columnCount: l
|
|
338
|
+
});
|
|
339
|
+
class j extends u {
|
|
351
340
|
/**
|
|
352
341
|
* Initializes component data.
|
|
353
342
|
*
|
|
@@ -355,15 +344,11 @@ class Y extends h {
|
|
|
355
344
|
*/
|
|
356
345
|
setData() {
|
|
357
346
|
let e = this.rows && this.rows.length > 0;
|
|
358
|
-
(this.loadMoreItems || this.tableData) && !e && (e = null)
|
|
359
|
-
const s = this.skeleton && !e;
|
|
360
|
-
return new L({
|
|
347
|
+
return (this.loadMoreItems || this.tableData) && !e && (e = null), new L({
|
|
361
348
|
selectedRows: [],
|
|
362
349
|
// @ts-ignore
|
|
363
|
-
hasItems:
|
|
364
|
-
selected: !1
|
|
365
|
-
// @ts-ignore
|
|
366
|
-
showSkeleton: s
|
|
350
|
+
hasItems: e,
|
|
351
|
+
selected: !1
|
|
367
352
|
});
|
|
368
353
|
}
|
|
369
354
|
/**
|
|
@@ -384,33 +369,6 @@ class Y extends h {
|
|
|
384
369
|
const e = this.data.get("selectedRows");
|
|
385
370
|
this.data.selected = e.length > 0;
|
|
386
371
|
}
|
|
387
|
-
/**
|
|
388
|
-
* Generates skeleton rows for the table.
|
|
389
|
-
*
|
|
390
|
-
* @returns {Array}
|
|
391
|
-
*/
|
|
392
|
-
generateSkeletonRows() {
|
|
393
|
-
const e = this.skeleton;
|
|
394
|
-
let s = 5, a = null;
|
|
395
|
-
typeof e == "object" && (s = e.number || 5, a = e.row || null);
|
|
396
|
-
const i = this.headers ? this.headers.length : 3;
|
|
397
|
-
return Array.from({ length: s }, (n, l) => a && typeof a == "function" ? a(l, i) : De({
|
|
398
|
-
columnCount: i,
|
|
399
|
-
key: `skeleton-${l}`
|
|
400
|
-
}));
|
|
401
|
-
}
|
|
402
|
-
/**
|
|
403
|
-
* Removes skeleton rows and shows real content.
|
|
404
|
-
*
|
|
405
|
-
* @returns {void}
|
|
406
|
-
*/
|
|
407
|
-
removeSkeleton() {
|
|
408
|
-
if (this.data.showSkeleton) {
|
|
409
|
-
this.data.showSkeleton = !1;
|
|
410
|
-
const e = this.rows && this.rows.length > 0;
|
|
411
|
-
this.data.hasItems = e;
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
372
|
/**
|
|
415
373
|
* This will get the selected rows.
|
|
416
374
|
*
|
|
@@ -441,40 +399,49 @@ class Y extends h {
|
|
|
441
399
|
const a = this.data.get("selectedRows"), i = e.selected ? [...a, e] : a.filter((n) => n !== e);
|
|
442
400
|
this.data.selectedRows = i, this.updateSelected();
|
|
443
401
|
}
|
|
402
|
+
/**
|
|
403
|
+
* Gets the number of header columns.
|
|
404
|
+
*
|
|
405
|
+
* @returns {number}
|
|
406
|
+
*/
|
|
407
|
+
getHeaderColCount() {
|
|
408
|
+
var e;
|
|
409
|
+
if (this.customHeader) {
|
|
410
|
+
const s = this.customHeader, a = s == null ? void 0 : s.children[0];
|
|
411
|
+
return (e = a == null ? void 0 : a.children) == null ? void 0 : e.length;
|
|
412
|
+
}
|
|
413
|
+
return this.headers ? this.headers.length : 3;
|
|
414
|
+
}
|
|
444
415
|
/**
|
|
445
416
|
* Renders the DataTable component.
|
|
446
417
|
*
|
|
447
418
|
* @returns {object}
|
|
448
419
|
*/
|
|
449
420
|
render() {
|
|
450
|
-
const
|
|
421
|
+
const e = this.border !== !1 ? "border" : "", s = this.getHeaderColCount();
|
|
451
422
|
return o({ class: "w-full flex flex-auto flex-col" }, [
|
|
452
|
-
|
|
453
|
-
o({ class: `w-full rounded-md ${
|
|
454
|
-
|
|
423
|
+
v("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
|
|
424
|
+
o({ class: `w-full rounded-md ${e} overflow-x-auto`, onSet: ["hasItems", { hidden: !1 }] }, [
|
|
425
|
+
I({ class: "w-full" }, [
|
|
455
426
|
// @ts-ignore
|
|
456
|
-
this.headers &&
|
|
427
|
+
this.headers && B({ headers: this.headers, sort: (a) => this.sortRows(a) }),
|
|
457
428
|
// @ts-ignore
|
|
458
429
|
this.customHeader ?? null,
|
|
459
|
-
|
|
460
|
-
cache: "list",
|
|
430
|
+
ke({
|
|
461
431
|
// @ts-ignore
|
|
462
432
|
key: this.key,
|
|
463
|
-
items: s,
|
|
464
|
-
rowItem: (n) => n,
|
|
465
|
-
// Skeleton rows are already complete components
|
|
466
|
-
class: "divide-y divide-border"
|
|
467
|
-
}) : ve({
|
|
468
433
|
// @ts-ignore
|
|
469
|
-
|
|
470
|
-
rows: s,
|
|
434
|
+
rows: this.rows,
|
|
471
435
|
// @ts-ignore
|
|
472
436
|
selectRow: this.selectRow.bind(this),
|
|
473
437
|
// @ts-ignore
|
|
474
438
|
rowItem: this.rowItem,
|
|
475
439
|
// @ts-ignore
|
|
476
|
-
emptyState: this.emptyState
|
|
477
|
-
|
|
440
|
+
emptyState: this.emptyState,
|
|
441
|
+
// @ts-ignore
|
|
442
|
+
skeleton: this.skeleton,
|
|
443
|
+
columnCount: s
|
|
444
|
+
})
|
|
478
445
|
])
|
|
479
446
|
])
|
|
480
447
|
]);
|
|
@@ -497,7 +464,7 @@ class Y extends h {
|
|
|
497
464
|
* @returns {void}
|
|
498
465
|
*/
|
|
499
466
|
setRows(e) {
|
|
500
|
-
this.
|
|
467
|
+
this.list.setRows(e);
|
|
501
468
|
}
|
|
502
469
|
/**
|
|
503
470
|
* This will append items to the list.
|
|
@@ -507,7 +474,7 @@ class Y extends h {
|
|
|
507
474
|
* @returns {void}
|
|
508
475
|
*/
|
|
509
476
|
append(e) {
|
|
510
|
-
this.
|
|
477
|
+
this.list.append(e);
|
|
511
478
|
}
|
|
512
479
|
/**
|
|
513
480
|
* This will mingle the new items with the old items.
|
|
@@ -528,7 +495,7 @@ class Y extends h {
|
|
|
528
495
|
* @returns {void}
|
|
529
496
|
*/
|
|
530
497
|
prepend(e) {
|
|
531
|
-
this.
|
|
498
|
+
this.list.prepend(e);
|
|
532
499
|
}
|
|
533
500
|
/**
|
|
534
501
|
* This will remove the selected rows.
|
|
@@ -539,7 +506,7 @@ class Y extends h {
|
|
|
539
506
|
this.data.selectedRows = [];
|
|
540
507
|
}
|
|
541
508
|
}
|
|
542
|
-
const
|
|
509
|
+
const xe = (t) => new Z({
|
|
543
510
|
cache: "list",
|
|
544
511
|
loadMoreItems: t.loadMoreItems,
|
|
545
512
|
offset: t.offset,
|
|
@@ -548,33 +515,27 @@ const Se = (t) => new te({
|
|
|
548
515
|
tableData: t.tableData,
|
|
549
516
|
items: t.items,
|
|
550
517
|
rowItem: (e) => t.rowItem(e, t.selectRow),
|
|
551
|
-
class: "divide-y divide-border"
|
|
518
|
+
class: "divide-y divide-border",
|
|
519
|
+
skeleton: t.skeleton,
|
|
520
|
+
columnCount: t.columnCount
|
|
552
521
|
});
|
|
553
|
-
class
|
|
522
|
+
class ve extends j {
|
|
554
523
|
/**
|
|
555
524
|
* Renders the DataTable component.
|
|
556
525
|
*
|
|
557
526
|
* @returns {object}
|
|
558
527
|
*/
|
|
559
528
|
render() {
|
|
560
|
-
const
|
|
529
|
+
const e = this.border !== !1 ? "border" : "", s = this.getHeaderColCount();
|
|
561
530
|
return o({ class: "w-full flex flex-auto flex-col" }, [
|
|
562
|
-
|
|
563
|
-
o({ class: `w-full rounded-md ${
|
|
564
|
-
|
|
531
|
+
v("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
|
|
532
|
+
o({ class: `w-full rounded-md ${e} overflow-x-auto`, onSet: ["hasItems", { hidden: !1 }] }, [
|
|
533
|
+
I({ class: "w-full" }, [
|
|
565
534
|
// @ts-ignore
|
|
566
|
-
this.headers &&
|
|
535
|
+
this.headers && B({ headers: this.headers, sort: (a) => this.sortRows(a) }),
|
|
567
536
|
// @ts-ignore
|
|
568
537
|
this.customHeader ?? null,
|
|
569
|
-
|
|
570
|
-
cache: "list",
|
|
571
|
-
// @ts-ignore
|
|
572
|
-
key: this.key,
|
|
573
|
-
items: s,
|
|
574
|
-
rowItem: (n) => n,
|
|
575
|
-
// Skeleton rows are already complete components
|
|
576
|
-
class: "divide-y divide-border"
|
|
577
|
-
}) : Se({
|
|
538
|
+
xe({
|
|
578
539
|
// @ts-ignore
|
|
579
540
|
loadMoreItems: this.loadMoreItems,
|
|
580
541
|
// @ts-ignore
|
|
@@ -587,12 +548,16 @@ class Ie extends Y {
|
|
|
587
548
|
tableData: this.tableData,
|
|
588
549
|
// @ts-ignore
|
|
589
550
|
key: this.key,
|
|
590
|
-
|
|
551
|
+
// @ts-ignore
|
|
552
|
+
items: this.rows,
|
|
591
553
|
// @ts-ignore
|
|
592
554
|
selectRow: this.selectRow.bind(this),
|
|
593
555
|
// @ts-ignore
|
|
594
|
-
rowItem: this.rowItem
|
|
595
|
-
|
|
556
|
+
rowItem: this.rowItem,
|
|
557
|
+
// @ts-ignore
|
|
558
|
+
skeleton: this.skeleton,
|
|
559
|
+
columnCount: s
|
|
560
|
+
})
|
|
596
561
|
])
|
|
597
562
|
])
|
|
598
563
|
]);
|
|
@@ -606,7 +571,7 @@ class Ie extends Y {
|
|
|
606
571
|
this.list.refresh();
|
|
607
572
|
}
|
|
608
573
|
}
|
|
609
|
-
const
|
|
574
|
+
const lt = h((t) => new ve(
|
|
610
575
|
{
|
|
611
576
|
cache: t.cache ?? "list",
|
|
612
577
|
tableData: t.data,
|
|
@@ -623,7 +588,7 @@ const dt = d((t) => new Ie(
|
|
|
623
588
|
emptyState: t.emptyState,
|
|
624
589
|
skeleton: t.skeleton
|
|
625
590
|
}
|
|
626
|
-
)),
|
|
591
|
+
)), De = (t) => new ee({
|
|
627
592
|
cache: "list",
|
|
628
593
|
scrollContainer: t.scrollContainer,
|
|
629
594
|
loadMoreItems: t.loadMoreItems,
|
|
@@ -633,33 +598,27 @@ const dt = d((t) => new Ie(
|
|
|
633
598
|
tableData: t.tableData,
|
|
634
599
|
items: t.items,
|
|
635
600
|
rowItem: (e) => t.rowItem(e, t.selectRow),
|
|
636
|
-
class: "divide-y divide-border"
|
|
601
|
+
class: "divide-y divide-border",
|
|
602
|
+
skeleton: t.skeleton,
|
|
603
|
+
columnCount: t.columnCount
|
|
637
604
|
});
|
|
638
|
-
class
|
|
605
|
+
class Se extends j {
|
|
639
606
|
/**
|
|
640
607
|
* Renders the DataTable component.
|
|
641
608
|
*
|
|
642
609
|
* @returns {object}
|
|
643
610
|
*/
|
|
644
611
|
render() {
|
|
645
|
-
const
|
|
612
|
+
const e = this.border !== !1 ? "border" : "", s = this.getHeaderColCount();
|
|
646
613
|
return o({ class: "w-full flex flex-auto flex-col" }, [
|
|
647
|
-
|
|
648
|
-
o({ class: `w-full rounded-md ${
|
|
649
|
-
|
|
614
|
+
v("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
|
|
615
|
+
o({ class: `w-full rounded-md ${e} overflow-x-auto`, onSet: ["hasItems", { hidden: !1 }] }, [
|
|
616
|
+
I({ class: "w-full" }, [
|
|
650
617
|
// @ts-ignore
|
|
651
|
-
this.headers &&
|
|
618
|
+
this.headers && B({ headers: this.headers, sort: (a) => this.sortRows(a) }),
|
|
652
619
|
// @ts-ignore
|
|
653
620
|
this.customHeader ?? null,
|
|
654
|
-
|
|
655
|
-
cache: "list",
|
|
656
|
-
// @ts-ignore
|
|
657
|
-
key: this.key,
|
|
658
|
-
items: s,
|
|
659
|
-
rowItem: (n) => n,
|
|
660
|
-
// Skeleton rows are already complete components
|
|
661
|
-
class: "divide-y divide-border"
|
|
662
|
-
}) : Ce({
|
|
621
|
+
De({
|
|
663
622
|
// @ts-ignore
|
|
664
623
|
scrollContainer: this.scrollContainer,
|
|
665
624
|
// @ts-ignore
|
|
@@ -674,12 +633,16 @@ class Le extends Y {
|
|
|
674
633
|
tableData: this.tableData,
|
|
675
634
|
// @ts-ignore
|
|
676
635
|
key: this.key,
|
|
677
|
-
|
|
636
|
+
// @ts-ignore
|
|
637
|
+
items: this.rows,
|
|
678
638
|
// @ts-ignore
|
|
679
639
|
selectRow: this.selectRow.bind(this),
|
|
680
640
|
// @ts-ignore
|
|
681
|
-
rowItem: this.rowItem
|
|
682
|
-
|
|
641
|
+
rowItem: this.rowItem,
|
|
642
|
+
// @ts-ignore
|
|
643
|
+
skeleton: this.skeleton,
|
|
644
|
+
columnCount: s
|
|
645
|
+
})
|
|
683
646
|
])
|
|
684
647
|
])
|
|
685
648
|
]);
|
|
@@ -693,7 +656,7 @@ class Le extends Y {
|
|
|
693
656
|
this.list.refresh();
|
|
694
657
|
}
|
|
695
658
|
}
|
|
696
|
-
const
|
|
659
|
+
const rt = h((t) => new Se(
|
|
697
660
|
{
|
|
698
661
|
cache: t.cache ?? "list",
|
|
699
662
|
tableData: t.data,
|
|
@@ -711,45 +674,45 @@ const ht = d((t) => new Le(
|
|
|
711
674
|
emptyState: t.emptyState,
|
|
712
675
|
skeleton: t.skeleton
|
|
713
676
|
}
|
|
714
|
-
)),
|
|
677
|
+
)), Ce = h(({ name: t, email: e }) => o({ class: "min-w-0 flex-auto" }, [
|
|
715
678
|
p({ class: "text-base font-semibold leading-6 m-0" }, t),
|
|
716
679
|
p({ class: "truncate text-sm leading-5 text-muted-foreground m-0" }, e)
|
|
717
|
-
])),
|
|
680
|
+
])), Ie = () => o({ class: "flex items-center gap-x-1.5" }, [
|
|
718
681
|
o({ class: "flex-none rounded-full bg-emerald-500/20 p-1" }, [
|
|
719
682
|
o({ class: "h-1.5 w-1.5 rounded-full bg-emerald-500" })
|
|
720
683
|
]),
|
|
721
684
|
p({ class: "text-xs leading-5 text-gray-500" }, "Online")
|
|
722
|
-
]),
|
|
685
|
+
]), Le = (t) => p({ class: "text-xs leading-5 text-muted-foreground" }, [
|
|
723
686
|
D("Last seen "),
|
|
724
|
-
|
|
725
|
-
]),
|
|
687
|
+
q({ datetime: t }, "3h ago")
|
|
688
|
+
]), Te = (t, e) => t === "online" ? Ie() : Le(e), Be = h(({ role: t, lastSeen: e, status: s }) => o({ class: "hidden shrink-0 sm:flex sm:flex-col sm:items-end" }, [
|
|
726
689
|
p({ class: "text-sm leading-6 m-0" }, t),
|
|
727
|
-
|
|
728
|
-
])),
|
|
690
|
+
Te(s, e)
|
|
691
|
+
])), Me = (t) => t.split(" ").map((s) => s[0]).join(""), Re = h((t) => S({ class: "fadeIn flex justify-between gap-x-6 py-4 px-4 rounded-md hover:bg-muted/50" }, [
|
|
729
692
|
o({ class: "flex min-w-0 gap-x-4" }, [
|
|
730
|
-
|
|
731
|
-
|
|
693
|
+
oe({ src: t.image, alt: t.name, fallbackText: Me(t.name) }),
|
|
694
|
+
Ce({ name: t.name, email: t.email })
|
|
732
695
|
]),
|
|
733
|
-
|
|
696
|
+
Be({
|
|
734
697
|
role: t.role,
|
|
735
698
|
lastSeen: t.lastSeen,
|
|
736
699
|
status: t.status
|
|
737
700
|
})
|
|
738
|
-
])),
|
|
701
|
+
])), ct = h((t) => new te({
|
|
739
702
|
cache: "list",
|
|
740
703
|
key: "name",
|
|
741
704
|
items: t.users,
|
|
742
705
|
role: "list",
|
|
743
706
|
class: "divide-y divide-border",
|
|
744
|
-
rowItem:
|
|
745
|
-
})),
|
|
707
|
+
rowItem: Re
|
|
708
|
+
})), We = (t, e) => e.includes(t), Pe = (t, e, s) => t.exact ? s === e : We(e, s), Oe = ({ text: t, href: e, exact: s, hidden: a }) => new $({
|
|
746
709
|
text: t,
|
|
747
710
|
href: e,
|
|
748
711
|
exact: s,
|
|
749
712
|
dataSet: ["selected", ["state", !0, "active"]],
|
|
750
713
|
class: `${a ? "hidden" : "inline-flex"} items-center justify-center whitespace-nowrap px-3 py-1.5 text-sm font-medium transition-all rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring focus-visible:ring-offset-background hover:bg-primary hover:text-primary-foreground disabled:opacity-50 disabled:pointer-events-none data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm`
|
|
751
714
|
});
|
|
752
|
-
class
|
|
715
|
+
class dt extends u {
|
|
753
716
|
/**
|
|
754
717
|
* This will declare the props for the compiler.
|
|
755
718
|
*
|
|
@@ -770,10 +733,10 @@ class ft extends h {
|
|
|
770
733
|
* @returns {object}
|
|
771
734
|
*/
|
|
772
735
|
render() {
|
|
773
|
-
return
|
|
736
|
+
return C(
|
|
774
737
|
{ class: `flex items-center justify-center p-2 text-muted-foreground rounded-md ${this.class || ""}` },
|
|
775
738
|
[
|
|
776
|
-
|
|
739
|
+
w({
|
|
777
740
|
class: "flex space-x-4",
|
|
778
741
|
map: [this.options, (e) => this.addLink(e)],
|
|
779
742
|
watch: {
|
|
@@ -805,7 +768,7 @@ class ft extends h {
|
|
|
805
768
|
for (const a of this.links) {
|
|
806
769
|
if (!a.rendered)
|
|
807
770
|
continue;
|
|
808
|
-
|
|
771
|
+
Pe(a, a.getLinkPath(), e) ? (this.updateLink(a, !0), s = !0) : this.updateLink(a, !1);
|
|
809
772
|
}
|
|
810
773
|
!s && this.links[0] && this.updateLink(this.links[0], !0);
|
|
811
774
|
}
|
|
@@ -835,7 +798,7 @@ class ft extends h {
|
|
|
835
798
|
* @returns {object}
|
|
836
799
|
*/
|
|
837
800
|
addLink({ label: e, href: s, exact: a, hidden: i }) {
|
|
838
|
-
const n =
|
|
801
|
+
const n = Oe({ text: e, href: s, exact: a, hidden: i });
|
|
839
802
|
return this.links.push(n), n;
|
|
840
803
|
}
|
|
841
804
|
/**
|
|
@@ -847,13 +810,13 @@ class ft extends h {
|
|
|
847
810
|
this.links = [];
|
|
848
811
|
}
|
|
849
812
|
}
|
|
850
|
-
const
|
|
813
|
+
const ht = h((t) => {
|
|
851
814
|
const e = t.margin || "m-4 ml-0";
|
|
852
815
|
return t.allowHistory = t.allowHistory === !0, o({ class: `flex-none ${e}` }, [
|
|
853
816
|
T({ variant: "back", class: "ghost", ...t })
|
|
854
817
|
]);
|
|
855
818
|
});
|
|
856
|
-
class
|
|
819
|
+
class A extends u {
|
|
857
820
|
/**
|
|
858
821
|
* This will declare the props for the compiler.
|
|
859
822
|
*
|
|
@@ -940,13 +903,13 @@ class H extends h {
|
|
|
940
903
|
return this.children;
|
|
941
904
|
}
|
|
942
905
|
}
|
|
943
|
-
|
|
906
|
+
N.addType("dockableOverlay", (t) => {
|
|
944
907
|
if (!t)
|
|
945
908
|
return;
|
|
946
909
|
const e = t.component;
|
|
947
910
|
e && e.rendered === !0 && e.state.docked === !1 && e.destroy();
|
|
948
911
|
});
|
|
949
|
-
class
|
|
912
|
+
class ut extends A {
|
|
950
913
|
/**
|
|
951
914
|
* This will stop presistence.
|
|
952
915
|
*
|
|
@@ -1012,7 +975,7 @@ class mt extends H {
|
|
|
1012
975
|
* @returns {void}
|
|
1013
976
|
*/
|
|
1014
977
|
afterSetup() {
|
|
1015
|
-
|
|
978
|
+
N.add(
|
|
1016
979
|
this.container,
|
|
1017
980
|
"dockableOverlay",
|
|
1018
981
|
{
|
|
@@ -1055,7 +1018,7 @@ class mt extends H {
|
|
|
1055
1018
|
document.documentElement.style.overflowY = "auto";
|
|
1056
1019
|
}
|
|
1057
1020
|
}
|
|
1058
|
-
class
|
|
1021
|
+
class ft extends A {
|
|
1059
1022
|
/**
|
|
1060
1023
|
* This will get the overlay type.
|
|
1061
1024
|
*
|
|
@@ -1074,7 +1037,7 @@ class wt extends H {
|
|
|
1074
1037
|
this.container = e, this.initialize();
|
|
1075
1038
|
}
|
|
1076
1039
|
}
|
|
1077
|
-
const
|
|
1040
|
+
const ze = h(({ index: t, click: e, state: s }, a) => S({
|
|
1078
1041
|
class: "p-2 cursor-pointer hover:bg-muted/50",
|
|
1079
1042
|
onState: [
|
|
1080
1043
|
[s, "selectedIndex", {
|
|
@@ -1083,11 +1046,11 @@ const Ae = d(({ index: t, click: e, state: s }, a) => S({
|
|
|
1083
1046
|
}]
|
|
1084
1047
|
],
|
|
1085
1048
|
click: () => e(t)
|
|
1086
|
-
}, a)),
|
|
1049
|
+
}, a)), $e = h(({ selectOption: t, state: e }) => w({
|
|
1087
1050
|
class: "border rounded-md list-none m-0 p-0 max-h-[400px] overflow-y-auto",
|
|
1088
|
-
for: ["filteredOptions", (s, a) =>
|
|
1089
|
-
})),
|
|
1090
|
-
|
|
1051
|
+
for: ["filteredOptions", (s, a) => ze({ index: a, click: t, state: e }, s.label)]
|
|
1052
|
+
})), Ne = h((t) => o({ class: "relative flex items-center" }, [
|
|
1053
|
+
ie({
|
|
1091
1054
|
cache: "input",
|
|
1092
1055
|
class: t.class ?? "",
|
|
1093
1056
|
placeholder: t.placeholder ?? "Search...",
|
|
@@ -1103,22 +1066,22 @@ const Ae = d(({ index: t, click: e, state: s }, a) => S({
|
|
|
1103
1066
|
]
|
|
1104
1067
|
}),
|
|
1105
1068
|
t.icon && o({ class: "absolute flex right-0 mr-2" }, [
|
|
1106
|
-
|
|
1069
|
+
_(t.icon)
|
|
1107
1070
|
])
|
|
1108
|
-
])),
|
|
1071
|
+
])), je = (t) => o({
|
|
1109
1072
|
class: "relative flex fle-auto flex-col",
|
|
1110
1073
|
onState: ["open", (e, s, a) => {
|
|
1111
1074
|
if (e)
|
|
1112
|
-
return new
|
|
1075
|
+
return new le({
|
|
1113
1076
|
cache: "dropdown",
|
|
1114
1077
|
parent: a,
|
|
1115
1078
|
button: a.input,
|
|
1116
1079
|
size: "xl"
|
|
1117
1080
|
}, [
|
|
1118
|
-
|
|
1081
|
+
$e(t)
|
|
1119
1082
|
]);
|
|
1120
1083
|
}]
|
|
1121
|
-
}),
|
|
1084
|
+
}), mt = V(
|
|
1122
1085
|
{
|
|
1123
1086
|
/**
|
|
1124
1087
|
* This will set up the data object.
|
|
@@ -1215,7 +1178,7 @@ const Ae = d(({ index: t, click: e, state: s }, a) => S({
|
|
|
1215
1178
|
*/
|
|
1216
1179
|
render() {
|
|
1217
1180
|
return o({ class: "relative w-full max-w-md" }, [
|
|
1218
|
-
|
|
1181
|
+
Ne({
|
|
1219
1182
|
// @ts-ignore
|
|
1220
1183
|
state: this.state,
|
|
1221
1184
|
// @ts-ignore
|
|
@@ -1227,7 +1190,7 @@ const Ae = d(({ index: t, click: e, state: s }, a) => S({
|
|
|
1227
1190
|
// @ts-ignore
|
|
1228
1191
|
handleKeyDown: this.handleKeyDown.bind(this)
|
|
1229
1192
|
}),
|
|
1230
|
-
|
|
1193
|
+
je({
|
|
1231
1194
|
// @ts-ignore
|
|
1232
1195
|
state: this.state,
|
|
1233
1196
|
// @ts-ignore
|
|
@@ -1238,22 +1201,22 @@ const Ae = d(({ index: t, click: e, state: s }, a) => S({
|
|
|
1238
1201
|
]);
|
|
1239
1202
|
}
|
|
1240
1203
|
}
|
|
1241
|
-
),
|
|
1204
|
+
), Ae = (t) => S(
|
|
1242
1205
|
{
|
|
1243
1206
|
class: "inline-flex flex-auto items-center justify-center whitespace-nowrap rounded-sm text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm",
|
|
1244
1207
|
dataSet: ["selected", ["state", t.value, "active"]]
|
|
1245
1208
|
},
|
|
1246
1209
|
[
|
|
1247
|
-
|
|
1210
|
+
x({
|
|
1248
1211
|
class: "flex flex-auto justify-center items-center px-3 py-1.5 rounded-md",
|
|
1249
1212
|
onSet: ["selected", { selected: t.value }],
|
|
1250
1213
|
click: (e) => t.callBack(t.value)
|
|
1251
1214
|
}, t.label)
|
|
1252
1215
|
]
|
|
1253
|
-
),
|
|
1254
|
-
|
|
1216
|
+
), He = (t, e) => (t.callBack = e, Ae(t)), Ue = (t) => C({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${t.class}` }, [
|
|
1217
|
+
w({ class: "flex flex-auto flex-row", map: [t.options, (e) => He(e, t.callBack)] })
|
|
1255
1218
|
]);
|
|
1256
|
-
class
|
|
1219
|
+
class gt extends u {
|
|
1257
1220
|
/**
|
|
1258
1221
|
* This will declare the props for the compiler.
|
|
1259
1222
|
*
|
|
@@ -1270,12 +1233,12 @@ class kt extends h {
|
|
|
1270
1233
|
render() {
|
|
1271
1234
|
const e = this.select.bind(this);
|
|
1272
1235
|
return o({ class: "" }, [
|
|
1273
|
-
|
|
1236
|
+
Ue({
|
|
1274
1237
|
class: this.class,
|
|
1275
1238
|
options: this.options,
|
|
1276
1239
|
callBack: e
|
|
1277
1240
|
}),
|
|
1278
|
-
|
|
1241
|
+
z({
|
|
1279
1242
|
class: "tab-content",
|
|
1280
1243
|
onState: ["selected", this.updateContent.bind(this)]
|
|
1281
1244
|
})
|
|
@@ -1341,23 +1304,23 @@ class kt extends h {
|
|
|
1341
1304
|
};
|
|
1342
1305
|
}
|
|
1343
1306
|
}
|
|
1344
|
-
const
|
|
1307
|
+
const Ye = (t) => S(
|
|
1345
1308
|
{
|
|
1346
1309
|
class: "inline-flex flex-auto items-center justify-center whitespace-nowrap rounded-sm text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm",
|
|
1347
1310
|
dataSet: ["selected", ["state", t.value, "active"]]
|
|
1348
1311
|
},
|
|
1349
1312
|
[
|
|
1350
|
-
|
|
1313
|
+
x({
|
|
1351
1314
|
class: "flex flex-auto justify-center items-center px-3 py-1.5 rounded-md disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1352
1315
|
onSet: ["selected", { selected: t.value }],
|
|
1353
1316
|
click: (e) => t.callBack(t.value),
|
|
1354
1317
|
disabled: t.disabled
|
|
1355
1318
|
}, t.label)
|
|
1356
1319
|
]
|
|
1357
|
-
),
|
|
1358
|
-
|
|
1320
|
+
), Fe = (t, e) => (t.callBack = e, Ye(t)), Ee = (t) => C({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${t.class}` }, [
|
|
1321
|
+
w({ class: "flex flex-auto flex-row", map: [t.options, (e) => Fe(e, t.callBack)] })
|
|
1359
1322
|
]);
|
|
1360
|
-
class
|
|
1323
|
+
class pt extends u {
|
|
1361
1324
|
/**
|
|
1362
1325
|
* This will declare the props for the compiler.
|
|
1363
1326
|
*
|
|
@@ -1373,7 +1336,7 @@ class bt extends h {
|
|
|
1373
1336
|
*/
|
|
1374
1337
|
render() {
|
|
1375
1338
|
const e = this.select.bind(this);
|
|
1376
|
-
return
|
|
1339
|
+
return Ee({
|
|
1377
1340
|
class: this.class,
|
|
1378
1341
|
options: this.options,
|
|
1379
1342
|
callBack: e
|
|
@@ -1400,17 +1363,17 @@ class bt extends h {
|
|
|
1400
1363
|
};
|
|
1401
1364
|
}
|
|
1402
1365
|
}
|
|
1403
|
-
const
|
|
1366
|
+
const Qe = (t, e) => new RegExp(`${t}($|/|\\.).*`).test(e), Xe = (t, e) => {
|
|
1404
1367
|
const s = t.getLinkPath();
|
|
1405
|
-
return t.exact ? e === s :
|
|
1406
|
-
},
|
|
1368
|
+
return t.exact ? e === s : Qe(s, e);
|
|
1369
|
+
}, qe = ({ text: t, href: e, exact: s }) => new $({
|
|
1407
1370
|
text: t,
|
|
1408
1371
|
href: e,
|
|
1409
1372
|
exact: s,
|
|
1410
1373
|
dataSet: ["selected", ["state", !0, "active"]],
|
|
1411
1374
|
class: "inline-flex flex-auto items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm"
|
|
1412
1375
|
});
|
|
1413
|
-
class
|
|
1376
|
+
class Ke extends u {
|
|
1414
1377
|
/**
|
|
1415
1378
|
* This will declare the props for the compiler.
|
|
1416
1379
|
*
|
|
@@ -1431,8 +1394,8 @@ class Ve extends h {
|
|
|
1431
1394
|
* @returns {object}
|
|
1432
1395
|
*/
|
|
1433
1396
|
render() {
|
|
1434
|
-
return
|
|
1435
|
-
|
|
1397
|
+
return C({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${this.class}` }, [
|
|
1398
|
+
w({
|
|
1436
1399
|
class: "flex flex-auto flex-row",
|
|
1437
1400
|
map: [this.options, (e) => this.addLink(e)],
|
|
1438
1401
|
watch: {
|
|
@@ -1461,7 +1424,7 @@ class Ve extends h {
|
|
|
1461
1424
|
let s = !1, a = this.links[0];
|
|
1462
1425
|
this.deactivateAllLinks();
|
|
1463
1426
|
for (const i of this.links)
|
|
1464
|
-
if (i.rendered !== !1 && (s =
|
|
1427
|
+
if (i.rendered !== !1 && (s = Xe(i, e), s === !0)) {
|
|
1465
1428
|
this.updateLink(i, !0);
|
|
1466
1429
|
break;
|
|
1467
1430
|
}
|
|
@@ -1493,7 +1456,7 @@ class Ve extends h {
|
|
|
1493
1456
|
* @returns {object}
|
|
1494
1457
|
*/
|
|
1495
1458
|
addLink({ label: e, href: s, exact: a }) {
|
|
1496
|
-
const i =
|
|
1459
|
+
const i = qe({ text: e, href: s, exact: a });
|
|
1497
1460
|
return this.links.push(i), i;
|
|
1498
1461
|
}
|
|
1499
1462
|
/**
|
|
@@ -1505,7 +1468,7 @@ class Ve extends h {
|
|
|
1505
1468
|
this.links = [];
|
|
1506
1469
|
}
|
|
1507
1470
|
}
|
|
1508
|
-
class
|
|
1471
|
+
class wt extends u {
|
|
1509
1472
|
/**
|
|
1510
1473
|
* This will declare the props for the compiler.
|
|
1511
1474
|
*
|
|
@@ -1521,11 +1484,11 @@ class yt extends h {
|
|
|
1521
1484
|
*/
|
|
1522
1485
|
render() {
|
|
1523
1486
|
return o({ class: "tab-panel" }, [
|
|
1524
|
-
new
|
|
1487
|
+
new Ke({
|
|
1525
1488
|
class: this.class,
|
|
1526
1489
|
options: this.options
|
|
1527
1490
|
}),
|
|
1528
|
-
|
|
1491
|
+
z({
|
|
1529
1492
|
class: "tab-content",
|
|
1530
1493
|
switch: this.addGroup()
|
|
1531
1494
|
})
|
|
@@ -1551,7 +1514,7 @@ class yt extends h {
|
|
|
1551
1514
|
return s;
|
|
1552
1515
|
}
|
|
1553
1516
|
}
|
|
1554
|
-
class
|
|
1517
|
+
class Ge extends u {
|
|
1555
1518
|
/**
|
|
1556
1519
|
* Runs before rendering, sets up defaults, a timer for drawing,
|
|
1557
1520
|
* and basic canvas properties.
|
|
@@ -1561,7 +1524,7 @@ class Je extends h {
|
|
|
1561
1524
|
onCreated() {
|
|
1562
1525
|
this.lineWidth = this.lineWidth || 3, this.lineColor = this.lineColor || "#000000", this.canvas = null, this.ctx = null, this.status = "stopped";
|
|
1563
1526
|
const e = 1e3 / 60;
|
|
1564
|
-
this.timer = new
|
|
1527
|
+
this.timer = new se(e, this.draw.bind(this)), this.width = 0, this.height = 0, this.signed = !1, this.mouse = { x: 0, y: 0, status: "up" }, this.margin = this.margin || { x: 40, y: 60 }, this.targetSize = this.targetSize || { width: 740, height: 345 }, this.baseLineWidth = this.baseLineWidth || 2, this.baseStrokeColor = this.baseStrokeColor || "#000000";
|
|
1565
1528
|
}
|
|
1566
1529
|
/**
|
|
1567
1530
|
* Renders a <canvas> element.
|
|
@@ -1569,7 +1532,7 @@ class Je extends h {
|
|
|
1569
1532
|
* @returns {object} Layout definition for the canvas.
|
|
1570
1533
|
*/
|
|
1571
1534
|
render() {
|
|
1572
|
-
return
|
|
1535
|
+
return K({
|
|
1573
1536
|
style: "touch-action: none; -webkit-user-select: none; -webkit-touch-callout: none;"
|
|
1574
1537
|
});
|
|
1575
1538
|
}
|
|
@@ -1622,8 +1585,8 @@ class Je extends h {
|
|
|
1622
1585
|
s = f.clientX, a = f.clientY;
|
|
1623
1586
|
} else
|
|
1624
1587
|
s = e.x || e.clientX, a = e.y || e.clientY;
|
|
1625
|
-
const
|
|
1626
|
-
this.mouse.x =
|
|
1588
|
+
const d = parseInt((s - l.left) * n), c = parseInt((a - l.top) * n);
|
|
1589
|
+
this.mouse.x = d, this.mouse.y = c;
|
|
1627
1590
|
}
|
|
1628
1591
|
/**
|
|
1629
1592
|
* Called when the pointer goes down on the canvas.
|
|
@@ -1687,7 +1650,7 @@ class Je extends h {
|
|
|
1687
1650
|
* @returns {void}
|
|
1688
1651
|
*/
|
|
1689
1652
|
noScaleResize() {
|
|
1690
|
-
const e =
|
|
1653
|
+
const e = R.getSize(container);
|
|
1691
1654
|
this.width = canvas.width = e.width, this.height = canvas.height = e.height;
|
|
1692
1655
|
}
|
|
1693
1656
|
/**
|
|
@@ -1697,13 +1660,13 @@ class Je extends h {
|
|
|
1697
1660
|
* @returns {void}
|
|
1698
1661
|
*/
|
|
1699
1662
|
scale() {
|
|
1700
|
-
const e = this.canvas, s = this.container, a =
|
|
1701
|
-
let
|
|
1663
|
+
const e = this.canvas, s = this.container, a = R.getSize(s), i = this.targetSize, n = i.width, l = i.height;
|
|
1664
|
+
let d = n + "px", c = l + "px";
|
|
1702
1665
|
if (this.width = e.width = n, this.height = e.height = l, a.width !== 0 && a.height !== 0) {
|
|
1703
|
-
const f = a.width, m = a.height, r = f / n,
|
|
1704
|
-
|
|
1666
|
+
const f = a.width, m = a.height, r = f / n, g = m / l, b = Math.min(r, g);
|
|
1667
|
+
d = n * b + "px", c = l * b + "px";
|
|
1705
1668
|
}
|
|
1706
|
-
e.style.width =
|
|
1669
|
+
e.style.width = d, e.style.height = c;
|
|
1707
1670
|
}
|
|
1708
1671
|
/**
|
|
1709
1672
|
* Main drawing loop. If the mouse is down, adds a line
|
|
@@ -1777,7 +1740,7 @@ class Je extends h {
|
|
|
1777
1740
|
this.timer.stop(), this.status = "stopped";
|
|
1778
1741
|
}
|
|
1779
1742
|
}
|
|
1780
|
-
class
|
|
1743
|
+
class bt extends u {
|
|
1781
1744
|
/**
|
|
1782
1745
|
* Sets up default properties for the signature panel.
|
|
1783
1746
|
*
|
|
@@ -1794,7 +1757,7 @@ class xt extends h {
|
|
|
1794
1757
|
*/
|
|
1795
1758
|
render() {
|
|
1796
1759
|
return o({ class: "signature-panel relative flex flex-auto overflow-hidden select-none" }, [
|
|
1797
|
-
|
|
1760
|
+
ne({
|
|
1798
1761
|
cache: "hiddenInput",
|
|
1799
1762
|
required: !0,
|
|
1800
1763
|
bind: this.path + ".data"
|
|
@@ -1802,11 +1765,11 @@ class xt extends h {
|
|
|
1802
1765
|
o({ class: "absolute top-2 right-2" }, [
|
|
1803
1766
|
T({
|
|
1804
1767
|
variant: "icon",
|
|
1805
|
-
icon:
|
|
1768
|
+
icon: k.circleX,
|
|
1806
1769
|
click: this.reset.bind(this)
|
|
1807
1770
|
})
|
|
1808
1771
|
]),
|
|
1809
|
-
new
|
|
1772
|
+
new Ge({
|
|
1810
1773
|
cache: "canvasLayer",
|
|
1811
1774
|
margin: this.margin,
|
|
1812
1775
|
targetSize: this.targetSize,
|
|
@@ -1856,36 +1819,36 @@ class xt extends h {
|
|
|
1856
1819
|
}
|
|
1857
1820
|
}
|
|
1858
1821
|
export {
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1822
|
+
ht as B,
|
|
1823
|
+
be as C,
|
|
1824
|
+
ke as D,
|
|
1825
|
+
ye as H,
|
|
1826
|
+
ft as I,
|
|
1827
|
+
dt as N,
|
|
1828
|
+
A as O,
|
|
1829
|
+
at as P,
|
|
1830
|
+
rt as S,
|
|
1831
|
+
B as T,
|
|
1832
|
+
Re as U,
|
|
1833
|
+
ot as W,
|
|
1834
|
+
he as a,
|
|
1835
|
+
W as b,
|
|
1836
|
+
ce as c,
|
|
1837
|
+
it as d,
|
|
1838
|
+
nt as e,
|
|
1839
|
+
fe as f,
|
|
1840
|
+
de as g,
|
|
1841
|
+
ge as h,
|
|
1842
|
+
pe as i,
|
|
1843
|
+
j,
|
|
1844
|
+
lt as k,
|
|
1845
|
+
ct as l,
|
|
1846
|
+
ut as m,
|
|
1847
|
+
mt as n,
|
|
1848
|
+
Ne as o,
|
|
1849
|
+
gt as p,
|
|
1850
|
+
pt as q,
|
|
1851
|
+
Ke as r,
|
|
1852
|
+
wt as s,
|
|
1853
|
+
bt as t
|
|
1891
1854
|
};
|