@base-framework/ui 1.0.76 → 1.0.80
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/index.es.js +1 -1
- package/dist/organisms.es.js +1 -1
- package/dist/{signature-panel-DkDboZSd.js → signature-panel-DjT5AthY.js} +333 -325
- package/dist/types/components/molecules/delay-component.d.ts +6 -0
- package/dist/types/components/organisms/lists/data-table.d.ts +89 -1
- package/dist/types/components/organisms/lists/scrollable-data-table.d.ts +0 -1
- package/dist/types/components/organisms/lists/scrollable-table.d.ts +3 -8
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -5,7 +5,7 @@ import { V as w, a as U } from "./veil-D4dRxILB.js";
|
|
|
5
5
|
import { Icons as R } from "./icons.es.js";
|
|
6
6
|
import { A as G, B as V, C as j, z as q, u as z, v as J, w as _, D as K, j as Q, k as X, G as Y, E as Z, s as $, c as aa, a as sa, b as ea, i as oa, g as ta, e as ra, h as na, F as ia, d as la, f as pa, t as ua, M as ma, l as da, N as ga, P as Ta, p as ca, q as Ca, S as ba, n as Da, o as Sa, T as Ia, x as Ba, y as Pa, m as Fa, r as Ma } from "./confirmation-DgARq0AK.js";
|
|
7
7
|
import { A as Na, b as va, C as fa, D as xa, a as ha, F as ya, M as Wa, P as La, c as Aa, g as Ha, p as wa } from "./calendar-BDqm833e.js";
|
|
8
|
-
import { B as Oa, n as Ra, C as Ea, j as Ga, D as Va, l as ja, H as qa, I as za, N as Ja, O as _a, P as Ka, S as Qa, m as Xa, r as Ya, q as Za, o as $a, p as as, T as ss, k as es, U as os, W as ts, f as rs, h as ns, i as is, c as ls, d as ps, b as us, e as ms, a as ds, g as gs } from "./signature-panel-
|
|
8
|
+
import { B as Oa, n as Ra, C as Ea, j as Ga, D as Va, l as ja, H as qa, I as za, N as Ja, O as _a, P as Ka, S as Qa, m as Xa, r as Ya, q as Za, o as $a, p as as, T as ss, k as es, U as os, W as ts, f as rs, h as ns, i as is, c as ls, d as ps, b as us, e as ms, a as ds, g as gs } from "./signature-panel-DjT5AthY.js";
|
|
9
9
|
import { B as cs, I as Cs, M as bs, d as Ds, e as Ss, g as Is, N as Bs, b as Ps, a as Fs, f as Ms, P as ks, c as Ns, S as vs, T as fs } from "./mobile-nav-wrapper-BE_hr65B.js";
|
|
10
10
|
import { B as hs, a as ys, C as Ws, F as Ls, b as As, c as Hs, M as ws, P as Us, S as Os } from "./sidebar-menu-page-nCAVFk3R.js";
|
|
11
11
|
import { A as Es, F as Gs, M as Vs, a as js, T as qs } from "./aside-template-McEj_Gxc.js";
|
package/dist/organisms.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as s, n as o, C as t, j as r, D as l, l as n, H as i, I as b, N as d, O as v, P as g, S as p, m as u, r as N, q as k, o as D, p as C, T, k as c, U as M, W as B, f as m, h as y, i as W, c as h, d as H, b as P, e as S, a as f, g as x } from "./signature-panel-
|
|
1
|
+
import { B as s, n as o, C as t, j as r, D as l, l as n, H as i, I as b, N as d, O as v, P as g, S as p, m as u, r as N, q as k, o as D, p as C, T, k as c, U as M, W as B, f as m, h as y, i as W, c as h, d as H, b as P, e as S, a as f, g as x } from "./signature-panel-DjT5AthY.js";
|
|
2
2
|
import { b as L, C as O, D as F, a as U, F as G, M as j, c as q, p as w } from "./calendar-BDqm833e.js";
|
|
3
3
|
import { B as A, I as E, M as J, d as K, e as Q, g as R, N as V, b as X, a as Y, f as Z, P as _, c as $, S as aa, T as ea } from "./mobile-nav-wrapper-BE_hr65B.js";
|
|
4
4
|
export {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Button as y, Div as o, On as
|
|
2
|
-
import { Atom as d, Component as
|
|
3
|
-
import { B as
|
|
1
|
+
import { Button as y, Div as o, On as F, Span as v, Th as R, UseParent as E, I as H, Thead as Q, Tr as X, Table as W, P as p, Li as D, Time as q, Nav as S, Ul as b, Section as P, Canvas as K } from "@base-framework/atoms";
|
|
2
|
+
import { Atom as d, Component as h, Data as L, DateTime as G, router as x, NavLink as O, DataTracker as z, Jot as V, base as I, Dom as B } from "@base-framework/base";
|
|
3
|
+
import { B as C, I as N } from "./buttons-CVEwmPAi.js";
|
|
4
4
|
import { Icons as w } from "./icons.es.js";
|
|
5
5
|
import { TableBody as _, ScrollableTableBody as J, List as Z, IntervalTimer as ee } from "@base-framework/organisms";
|
|
6
6
|
import { C as te, I as se, H as ae } from "./inputs-DmJuUwS9.js";
|
|
7
|
-
import { A as
|
|
7
|
+
import { A as ie, P as ne } from "./calendar-BDqm833e.js";
|
|
8
8
|
d((t, e) => ({
|
|
9
9
|
class: "flex items-center px-4 py-2",
|
|
10
10
|
...t,
|
|
@@ -16,7 +16,7 @@ d(({ value: t, label: e }) => y({
|
|
|
16
16
|
dataSet: ["performance", ["state", t, "active"]],
|
|
17
17
|
click: (s, { state: a }) => a.performance = t
|
|
18
18
|
}, e));
|
|
19
|
-
class
|
|
19
|
+
class et extends h {
|
|
20
20
|
/**
|
|
21
21
|
* This will declare the props for the compiler.
|
|
22
22
|
*
|
|
@@ -41,14 +41,14 @@ const oe = (t) => {
|
|
|
41
41
|
}, le = (t) => {
|
|
42
42
|
const e = new Date(t.valueOf()), s = (e.getDay() + 6) % 7;
|
|
43
43
|
e.setDate(e.getDate() - s + 3);
|
|
44
|
-
const a = e.getFullYear(),
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
return
|
|
44
|
+
const a = e.getFullYear(), i = new Date(a, 0, 4);
|
|
45
|
+
i.setDate(i.getDate() - (i.getDay() + 6) % 7);
|
|
46
|
+
const n = Math.ceil((e - i) / 6048e5) + 1;
|
|
47
|
+
return n > 52 && !oe(a) ? {
|
|
48
48
|
weekNumber: 1,
|
|
49
49
|
year: a + 1
|
|
50
50
|
} : {
|
|
51
|
-
weekNumber:
|
|
51
|
+
weekNumber: n,
|
|
52
52
|
year: a
|
|
53
53
|
};
|
|
54
54
|
}, re = (t, e, s) => {
|
|
@@ -56,55 +56,55 @@ const oe = (t) => {
|
|
|
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
|
-
}, ce = (t, e, s) => Array.from({ length: s }, (a,
|
|
62
|
-
const s = new Date(e, 0, 4), a = (s.getDay() + 6) % 7,
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
return
|
|
66
|
-
},
|
|
67
|
-
const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(),
|
|
68
|
-
let
|
|
61
|
+
}, ce = (t, e, s) => Array.from({ length: s }, (a, i) => new Date(t, e + 1, i + 1)), T = (t, e) => {
|
|
62
|
+
const s = new Date(e, 0, 4), a = (s.getDay() + 6) % 7, i = new Date(s);
|
|
63
|
+
i.setDate(s.getDate() - a);
|
|
64
|
+
const n = new Date(i);
|
|
65
|
+
return n.setDate(i.getDate() + (t - 1) * 7), n;
|
|
66
|
+
}, tt = (t, e) => {
|
|
67
|
+
const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(), i = [];
|
|
68
|
+
let n = [];
|
|
69
69
|
for (let l = 1 - s; l <= a; l++) {
|
|
70
|
-
const
|
|
71
|
-
|
|
70
|
+
const u = new Date(t, e, l);
|
|
71
|
+
n.push(l > 0 ? u : null), (n.length === 7 || l === a) && (i.push([...n]), n = []);
|
|
72
72
|
}
|
|
73
|
-
return
|
|
74
|
-
},
|
|
73
|
+
return i;
|
|
74
|
+
}, st = (t, e) => {
|
|
75
75
|
const s = new Date(t, e + 1, 0).getDate(), a = [];
|
|
76
|
-
let
|
|
77
|
-
for (let
|
|
78
|
-
|
|
79
|
-
return
|
|
76
|
+
let i = [];
|
|
77
|
+
for (let n = 1; n <= s; n++)
|
|
78
|
+
i.push(new Date(t, e, n)), i.length === 7 && (a.push(i), i = []);
|
|
79
|
+
return i.length > 0 && a.push(i), a;
|
|
80
80
|
}, de = (t, e, s) => {
|
|
81
81
|
const a = /* @__PURE__ */ new Date();
|
|
82
82
|
return a.getDate() === t && a.getMonth() === e && a.getFullYear() === s;
|
|
83
|
-
}, he = ({ day: t, month: e, year: s, weekNumber: a, selectWeek:
|
|
84
|
-
const
|
|
83
|
+
}, he = ({ day: t, month: e, year: s, weekNumber: a, selectWeek: i }) => {
|
|
84
|
+
const n = de(t, e, s);
|
|
85
85
|
return y({
|
|
86
86
|
text: t || "",
|
|
87
87
|
disabled: !t,
|
|
88
88
|
class: `
|
|
89
89
|
px-2 py-1 text-center rounded-md
|
|
90
|
-
${
|
|
90
|
+
${n ? "bg-accent text-accent-foreground" : ""}
|
|
91
91
|
hover:bg-primary hover:text-primary-foreground
|
|
92
92
|
`,
|
|
93
|
-
click: () =>
|
|
93
|
+
click: () => i(a, s)
|
|
94
94
|
});
|
|
95
95
|
}, ue = (t, e) => {
|
|
96
|
-
const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(),
|
|
96
|
+
const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(), i = re(t, e, s), n = Array.from({ length: a }, (r, m) => new Date(t, e, m + 1)), l = (i.length + n.length) % 7, u = l === 0 ? 0 : 7 - l, c = ce(t, e, u), f = [...i, ...n, ...c], g = [];
|
|
97
97
|
for (let r = 0; r < f.length; r += 7) {
|
|
98
|
-
const
|
|
98
|
+
const m = f.slice(r, r + 7), k = m.find((Y) => Y) || new Date(t, e, 1), { weekNumber: A, year: U } = le(k);
|
|
99
99
|
g.push({
|
|
100
|
-
weekNumber:
|
|
101
|
-
year:
|
|
102
|
-
days:
|
|
100
|
+
weekNumber: A,
|
|
101
|
+
year: U,
|
|
102
|
+
days: m
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
return g;
|
|
106
|
-
}, fe = ({ selectWeek: t }) =>
|
|
107
|
-
const { year:
|
|
106
|
+
}, fe = ({ selectWeek: t }) => F("month", (e, s, { data: a }) => {
|
|
107
|
+
const { year: i, month: n, currentDate: l } = a, u = ue(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 oe = (t) => {
|
|
|
119
119
|
)
|
|
120
120
|
),
|
|
121
121
|
// Render each "week" row
|
|
122
|
-
...
|
|
122
|
+
...u.map(
|
|
123
123
|
({ weekNumber: c, days: f, year: g }) => o({
|
|
124
124
|
class: "grid grid-cols-8 col-span-8 items-center ring-primary rounded-sm px-1",
|
|
125
125
|
onSet: ["currentWeek", {
|
|
@@ -154,7 +154,7 @@ const oe = (t) => {
|
|
|
154
154
|
)
|
|
155
155
|
]
|
|
156
156
|
);
|
|
157
|
-
}),
|
|
157
|
+
}), M = ({ label: t, click: e }) => C(
|
|
158
158
|
{
|
|
159
159
|
class: `
|
|
160
160
|
inline-flex items-center justify-center h-7 w-7 bg-transparent p-0
|
|
@@ -169,16 +169,16 @@ const oe = (t) => {
|
|
|
169
169
|
}
|
|
170
170
|
), ge = ({ next: t, previous: e }) => o({ class: "flex flex-auto min-h-12 text-sm font-medium relative justify-center items-center" }, [
|
|
171
171
|
v("[[monthName]] [[year]]"),
|
|
172
|
-
|
|
172
|
+
M({
|
|
173
173
|
label: "Previous",
|
|
174
174
|
click: e
|
|
175
175
|
}),
|
|
176
|
-
|
|
176
|
+
M({
|
|
177
177
|
label: "Next",
|
|
178
178
|
click: t
|
|
179
179
|
})
|
|
180
180
|
]);
|
|
181
|
-
class
|
|
181
|
+
class at extends h {
|
|
182
182
|
/**
|
|
183
183
|
* This will declare the props for the compiler.
|
|
184
184
|
*
|
|
@@ -194,7 +194,7 @@ class st extends u {
|
|
|
194
194
|
*/
|
|
195
195
|
setData() {
|
|
196
196
|
const e = /* @__PURE__ */ new Date(), s = this.selectedWeek || this.calculateCurrentWeek(e), a = T(s, e.getFullYear());
|
|
197
|
-
return new
|
|
197
|
+
return new L({
|
|
198
198
|
monthName: this.getMonthName(a.getMonth()),
|
|
199
199
|
year: a.getFullYear(),
|
|
200
200
|
month: a.getMonth(),
|
|
@@ -221,8 +221,8 @@ class st extends u {
|
|
|
221
221
|
calculateCurrentWeek(e) {
|
|
222
222
|
const s = new Date(e.valueOf()), a = (e.getDay() + 6) % 7;
|
|
223
223
|
s.setDate(s.getDate() - a + 3);
|
|
224
|
-
const
|
|
225
|
-
return s.setMonth(0, 1), s.getDay() !== 4 && s.setMonth(0, 1 + (4 - s.getDay() + 7) % 7), 1 + Math.ceil((
|
|
224
|
+
const i = s.valueOf();
|
|
225
|
+
return s.setMonth(0, 1), s.getDay() !== 4 && s.setMonth(0, 1 + (4 - s.getDay() + 7) % 7), 1 + Math.ceil((i - s) / 6048e5);
|
|
226
226
|
}
|
|
227
227
|
/**
|
|
228
228
|
* Gets the name of the month.
|
|
@@ -231,7 +231,7 @@ class st extends u {
|
|
|
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.
|
|
@@ -296,26 +296,26 @@ class st extends u {
|
|
|
296
296
|
]);
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
const
|
|
299
|
+
const me = (t, e) => {
|
|
300
300
|
const s = t.toggleAllSelectedRows();
|
|
301
301
|
e.state.checked = !s;
|
|
302
|
-
},
|
|
303
|
-
|
|
304
|
-
]), we = ({ align: t, sortable: e, key: s, label: a, sort:
|
|
302
|
+
}, pe = (t) => R({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class || ""}` }, [
|
|
303
|
+
E((e) => new te({ class: "mr-2", onChange: (s, a) => me(e, a) }))
|
|
304
|
+
]), we = ({ align: t, sortable: e, key: s, label: a, sort: i, class: n }) => {
|
|
305
305
|
const l = t || "justify-start";
|
|
306
|
-
return
|
|
307
|
-
class: `cursor-pointer py-3 px-4 text-base ${
|
|
308
|
-
click: e && (() =>
|
|
306
|
+
return R({
|
|
307
|
+
class: `cursor-pointer py-3 px-4 text-base ${n || ""}`,
|
|
308
|
+
click: e && (() => i(s))
|
|
309
309
|
}, [
|
|
310
310
|
o({ class: `flex flex-auto w-full items-center ${l}` }, [
|
|
311
311
|
v(a),
|
|
312
|
-
e &&
|
|
312
|
+
e && H({ class: "ml-2", html: w.arrows.upDown })
|
|
313
313
|
])
|
|
314
314
|
]);
|
|
315
|
-
},
|
|
316
|
-
|
|
315
|
+
}, $ = (t) => Q([
|
|
316
|
+
X({
|
|
317
317
|
class: "text-muted-foreground border-b",
|
|
318
|
-
map: [t.headers, (e) => e.label === "checkbox" ?
|
|
318
|
+
map: [t.headers, (e) => e.label === "checkbox" ? pe({ toggle: t.toggle }) : we({
|
|
319
319
|
align: e.align,
|
|
320
320
|
sortable: e.sortable,
|
|
321
321
|
key: e.key,
|
|
@@ -327,158 +327,169 @@ const pe = (t, e) => {
|
|
|
327
327
|
cache: "list",
|
|
328
328
|
key: t,
|
|
329
329
|
items: e,
|
|
330
|
-
rowItem: (
|
|
330
|
+
rowItem: (i) => a(i, s),
|
|
331
331
|
class: "divide-y divide-border"
|
|
332
|
-
})
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
332
|
+
});
|
|
333
|
+
class ke extends h {
|
|
334
|
+
/**
|
|
335
|
+
* Initializes component data.
|
|
336
|
+
*
|
|
337
|
+
* @returns {Data}
|
|
338
|
+
*/
|
|
339
|
+
setData() {
|
|
340
|
+
return new L({
|
|
341
|
+
selectedRows: [],
|
|
342
|
+
selected: !1
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* This will toggle all selected rows.
|
|
347
|
+
*
|
|
348
|
+
* @returns {boolean}
|
|
349
|
+
*/
|
|
350
|
+
toggleAllSelectedRows() {
|
|
351
|
+
const e = this.list.getRows(), s = this.data.selectedRows.length === e.length, a = s ? [] : e;
|
|
352
|
+
return this.data.selectedRows = a, this.updateSelected(), this.updateTable(!s), s;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* This will update the selected state.
|
|
356
|
+
*
|
|
357
|
+
* @returns {void}
|
|
358
|
+
*/
|
|
359
|
+
updateSelected() {
|
|
360
|
+
const e = this.data.get("selectedRows");
|
|
361
|
+
this.data.selected = e.length > 0;
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* This will get the selected rows.
|
|
365
|
+
*
|
|
366
|
+
* @returns {Array<object>}
|
|
367
|
+
*/
|
|
368
|
+
getSelectedRows() {
|
|
369
|
+
return this.data.get("selectedRows");
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* This will update the table rows.
|
|
373
|
+
*
|
|
374
|
+
* @protected
|
|
375
|
+
* @param {boolean} selected
|
|
376
|
+
* @returns {void}
|
|
377
|
+
*/
|
|
378
|
+
updateTable(e) {
|
|
379
|
+
const s = this.list.getRows();
|
|
380
|
+
s.forEach((a) => a.selected = e), this.list.setRows(s);
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Handles row selection.
|
|
384
|
+
*
|
|
385
|
+
* @param {object} row
|
|
386
|
+
*/
|
|
387
|
+
selectRow(e) {
|
|
388
|
+
const s = e.selected ?? !1;
|
|
389
|
+
e.selected = !s;
|
|
390
|
+
const a = this.data.get("selectedRows"), i = e.selected ? [...a, e] : a.filter((n) => n !== e);
|
|
391
|
+
this.data.selectedRows = i, this.updateSelected();
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Renders the DataTable component.
|
|
395
|
+
*
|
|
396
|
+
* @returns {object}
|
|
397
|
+
*/
|
|
398
|
+
render() {
|
|
399
|
+
const e = this.rows, s = this.border !== !1 ? "border" : "";
|
|
400
|
+
return o({ class: "w-full" }, [
|
|
401
|
+
o({ class: `w-full rounded-md ${s} overflow-x-auto` }, [
|
|
402
|
+
W({ class: "w-full" }, [
|
|
403
|
+
// @ts-ignore
|
|
404
|
+
this.headers && $({ headers: this.headers, sort: (a) => this.sortRows(a) }),
|
|
405
|
+
// @ts-ignore
|
|
406
|
+
this.customHeader ?? null,
|
|
407
|
+
be({
|
|
408
|
+
// @ts-ignore
|
|
409
|
+
key: this.key,
|
|
410
|
+
rows: e,
|
|
403
411
|
// @ts-ignore
|
|
404
|
-
|
|
412
|
+
selectRow: this.selectRow.bind(this),
|
|
405
413
|
// @ts-ignore
|
|
406
|
-
this.
|
|
407
|
-
|
|
408
|
-
// @ts-ignore
|
|
409
|
-
key: this.key,
|
|
410
|
-
rows: t,
|
|
411
|
-
// @ts-ignore
|
|
412
|
-
selectRow: this.selectRow.bind(this),
|
|
413
|
-
// @ts-ignore
|
|
414
|
-
rowItem: this.rowItem
|
|
415
|
-
})
|
|
416
|
-
])
|
|
414
|
+
rowItem: this.rowItem
|
|
415
|
+
})
|
|
417
416
|
])
|
|
418
|
-
])
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
/**
|
|
472
|
-
* This will remove the selected rows.
|
|
473
|
-
*
|
|
474
|
-
* @returns {void}
|
|
475
|
-
*/
|
|
476
|
-
beforeDestroy() {
|
|
477
|
-
this.data.selectedRows = [];
|
|
478
|
-
}
|
|
417
|
+
])
|
|
418
|
+
]);
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* This will remove items from the list.
|
|
422
|
+
*
|
|
423
|
+
* @public
|
|
424
|
+
* @param {array} items
|
|
425
|
+
* @returns {void}
|
|
426
|
+
*/
|
|
427
|
+
remove(e) {
|
|
428
|
+
this.list.remove(e);
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* This will set the items in the list.
|
|
432
|
+
*
|
|
433
|
+
* @public
|
|
434
|
+
* @param {array} rows
|
|
435
|
+
* @returns {void}
|
|
436
|
+
*/
|
|
437
|
+
setRows(e) {
|
|
438
|
+
this.list.setRows(e);
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* This will append items to the list.
|
|
442
|
+
*
|
|
443
|
+
* @public
|
|
444
|
+
* @param {array|object} items
|
|
445
|
+
* @returns {void}
|
|
446
|
+
*/
|
|
447
|
+
append(e) {
|
|
448
|
+
this.list.append(e);
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* This will mingle the new items with the old items.
|
|
452
|
+
*
|
|
453
|
+
* @public
|
|
454
|
+
* @param {Array<Object>} newItems
|
|
455
|
+
* @param {boolean} withDelete
|
|
456
|
+
* @returns {void}
|
|
457
|
+
*/
|
|
458
|
+
mingle(e, s = !1) {
|
|
459
|
+
this.list.mingle(e, s);
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* This will prepend items to the list.
|
|
463
|
+
*
|
|
464
|
+
* @public
|
|
465
|
+
* @param {array|object} items
|
|
466
|
+
* @returns {void}
|
|
467
|
+
*/
|
|
468
|
+
prepend(e) {
|
|
469
|
+
this.list.prepend(e);
|
|
479
470
|
}
|
|
480
|
-
|
|
481
|
-
|
|
471
|
+
/**
|
|
472
|
+
* This will remove the selected rows.
|
|
473
|
+
*
|
|
474
|
+
* @returns {void}
|
|
475
|
+
*/
|
|
476
|
+
beforeDestroy() {
|
|
477
|
+
this.data.selectedRows = [];
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
const xe = (t) => new J({
|
|
481
|
+
cache: "list",
|
|
482
|
+
scrollContainer: t.scrollContainer,
|
|
483
|
+
loadMoreItems: t.loadMoreItems,
|
|
484
|
+
offset: t.offset,
|
|
485
|
+
limit: t.limit,
|
|
486
|
+
key: t.key,
|
|
487
|
+
data: t.data,
|
|
488
|
+
items: t.items,
|
|
489
|
+
rowItem: (e) => t.rowItem(e, t.selectRow),
|
|
490
|
+
class: "divide-y divide-border"
|
|
491
|
+
});
|
|
492
|
+
class ye extends ke {
|
|
482
493
|
/**
|
|
483
494
|
* Renders the DataTable component.
|
|
484
495
|
*
|
|
@@ -488,12 +499,12 @@ class xe extends ke {
|
|
|
488
499
|
const e = this.rows, s = this.border !== !1 ? "border" : "";
|
|
489
500
|
return o({ class: "w-full" }, [
|
|
490
501
|
o({ class: `w-full rounded-md ${s} overflow-x-auto` }, [
|
|
491
|
-
|
|
502
|
+
W({ class: "w-full" }, [
|
|
492
503
|
// @ts-ignore
|
|
493
|
-
this.headers &&
|
|
504
|
+
this.headers && $({ headers: this.headers, sort: (a) => this.sortRows(a) }),
|
|
494
505
|
// @ts-ignore
|
|
495
506
|
this.customHeader ?? null,
|
|
496
|
-
|
|
507
|
+
xe({
|
|
497
508
|
// @ts-ignore
|
|
498
509
|
scrollContainer: this.scrollContainer,
|
|
499
510
|
// @ts-ignore
|
|
@@ -505,8 +516,6 @@ class xe extends ke {
|
|
|
505
516
|
// @ts-ignore
|
|
506
517
|
class: this.class,
|
|
507
518
|
// @ts-ignore
|
|
508
|
-
containerClass: this.containerClass ?? "",
|
|
509
|
-
// @ts-ignore
|
|
510
519
|
data: this.tableData,
|
|
511
520
|
// @ts-ignore
|
|
512
521
|
key: this.key,
|
|
@@ -521,7 +530,7 @@ class xe extends ke {
|
|
|
521
530
|
]);
|
|
522
531
|
}
|
|
523
532
|
}
|
|
524
|
-
const
|
|
533
|
+
const it = d((t) => new ye(
|
|
525
534
|
{
|
|
526
535
|
tableData: t.data,
|
|
527
536
|
scrollContainer: t.scrollContainer,
|
|
@@ -532,29 +541,28 @@ const at = d((t) => new xe(
|
|
|
532
541
|
key: t.key,
|
|
533
542
|
rows: t.rows,
|
|
534
543
|
rowItem: t.rowItem,
|
|
535
|
-
containerClass: t.containerClass ?? "",
|
|
536
544
|
headers: t.headers,
|
|
537
545
|
customHeader: t.customHeader,
|
|
538
546
|
border: t.border
|
|
539
547
|
}
|
|
540
|
-
)),
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
])),
|
|
548
|
+
)), ve = d(({ name: t, email: e }) => o({ class: "min-w-0 flex-auto" }, [
|
|
549
|
+
p({ class: "text-base font-semibold leading-6 m-0" }, t),
|
|
550
|
+
p({ class: "truncate text-sm leading-5 text-muted-foreground m-0" }, e)
|
|
551
|
+
])), De = () => o({ class: "flex items-center gap-x-1.5" }, [
|
|
544
552
|
o({ class: "flex-none rounded-full bg-emerald-500/20 p-1" }, [
|
|
545
553
|
o({ class: "h-1.5 w-1.5 rounded-full bg-emerald-500" })
|
|
546
554
|
]),
|
|
547
|
-
|
|
548
|
-
]),
|
|
555
|
+
p({ class: "text-xs leading-5 text-gray-500" }, "Online")
|
|
556
|
+
]), Se = (t) => p({ class: "text-xs leading-5 text-muted-foreground" }, [
|
|
549
557
|
v("Last seen "),
|
|
550
|
-
|
|
551
|
-
]),
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
])),
|
|
558
|
+
q({ datetime: t }, "3h ago")
|
|
559
|
+
]), Le = (t, e) => t === "online" ? De() : Se(e), Ce = d(({ role: t, lastSeen: e, status: s }) => o({ class: "hidden shrink-0 sm:flex sm:flex-col sm:items-end" }, [
|
|
560
|
+
p({ class: "text-sm leading-6 m-0" }, t),
|
|
561
|
+
Le(s, e)
|
|
562
|
+
])), Ie = (t) => t.split(" ").map((s) => s[0]).join(""), Be = d((t) => D({ class: "fadeIn flex justify-between gap-x-6 py-4 px-4 rounded-md hover:bg-muted/50" }, [
|
|
555
563
|
o({ class: "flex min-w-0 gap-x-4" }, [
|
|
556
|
-
|
|
557
|
-
|
|
564
|
+
ie({ src: t.image, alt: t.name, fallbackText: Ie(t.name) }),
|
|
565
|
+
ve({ name: t.name, email: t.email })
|
|
558
566
|
]),
|
|
559
567
|
Ce({
|
|
560
568
|
role: t.role,
|
|
@@ -567,15 +575,15 @@ const at = d((t) => new xe(
|
|
|
567
575
|
items: t.users,
|
|
568
576
|
role: "list",
|
|
569
577
|
class: "divide-y divide-border",
|
|
570
|
-
rowItem:
|
|
571
|
-
})),
|
|
578
|
+
rowItem: Be
|
|
579
|
+
})), Te = (t, e) => e.includes(t), Me = (t, e, s) => t.exact ? s === e : Te(e, s), Re = ({ text: t, href: e, exact: s, hidden: a }) => new O({
|
|
572
580
|
text: t,
|
|
573
581
|
href: e,
|
|
574
582
|
exact: s,
|
|
575
583
|
dataSet: ["selected", ["state", !0, "active"]],
|
|
576
584
|
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`
|
|
577
585
|
});
|
|
578
|
-
class
|
|
586
|
+
class ot extends h {
|
|
579
587
|
/**
|
|
580
588
|
* This will declare the props for the compiler.
|
|
581
589
|
*
|
|
@@ -631,7 +639,7 @@ class it extends u {
|
|
|
631
639
|
for (const a of this.links) {
|
|
632
640
|
if (!a.rendered)
|
|
633
641
|
continue;
|
|
634
|
-
|
|
642
|
+
Me(a, a.getLinkPath(), e) ? (this.updateLink(a, !0), s = !0) : this.updateLink(a, !1);
|
|
635
643
|
}
|
|
636
644
|
!s && this.links[0] && this.updateLink(this.links[0], !0);
|
|
637
645
|
}
|
|
@@ -660,9 +668,9 @@ class it extends u {
|
|
|
660
668
|
* @param {object} option
|
|
661
669
|
* @returns {object}
|
|
662
670
|
*/
|
|
663
|
-
addLink({ label: e, href: s, exact: a, hidden:
|
|
664
|
-
const
|
|
665
|
-
return this.links.push(
|
|
671
|
+
addLink({ label: e, href: s, exact: a, hidden: i }) {
|
|
672
|
+
const n = Re({ text: e, href: s, exact: a, hidden: i });
|
|
673
|
+
return this.links.push(n), n;
|
|
666
674
|
}
|
|
667
675
|
/**
|
|
668
676
|
* This will clear the links.
|
|
@@ -673,10 +681,10 @@ class it extends u {
|
|
|
673
681
|
this.links = [];
|
|
674
682
|
}
|
|
675
683
|
}
|
|
676
|
-
const
|
|
684
|
+
const lt = d((t) => {
|
|
677
685
|
const e = t.margin || "m-4 ml-0";
|
|
678
686
|
return o({ class: `flex-none ${e}` }, [
|
|
679
|
-
|
|
687
|
+
C({
|
|
680
688
|
variant: "icon",
|
|
681
689
|
class: "back-button",
|
|
682
690
|
click: () => {
|
|
@@ -687,11 +695,11 @@ const ot = d((t) => {
|
|
|
687
695
|
t.backUrl && app.navigate(t.backUrl);
|
|
688
696
|
}
|
|
689
697
|
}, [
|
|
690
|
-
|
|
698
|
+
N(w.arrows.left)
|
|
691
699
|
])
|
|
692
700
|
]);
|
|
693
701
|
});
|
|
694
|
-
class
|
|
702
|
+
class j extends h {
|
|
695
703
|
/**
|
|
696
704
|
* This will declare the props for the compiler.
|
|
697
705
|
*
|
|
@@ -778,13 +786,13 @@ class A extends u {
|
|
|
778
786
|
return this.children;
|
|
779
787
|
}
|
|
780
788
|
}
|
|
781
|
-
|
|
789
|
+
z.addType("dockableOverlay", (t) => {
|
|
782
790
|
if (!t)
|
|
783
791
|
return;
|
|
784
792
|
const e = t.component;
|
|
785
793
|
e && e.rendered === !0 && e.state.docked === !1 && e.destroy();
|
|
786
794
|
});
|
|
787
|
-
class
|
|
795
|
+
class rt extends j {
|
|
788
796
|
/**
|
|
789
797
|
* This will stop presistence.
|
|
790
798
|
*
|
|
@@ -850,7 +858,7 @@ class lt extends A {
|
|
|
850
858
|
* @returns {void}
|
|
851
859
|
*/
|
|
852
860
|
afterSetup() {
|
|
853
|
-
|
|
861
|
+
z.add(
|
|
854
862
|
this.container,
|
|
855
863
|
"dockableOverlay",
|
|
856
864
|
{
|
|
@@ -893,7 +901,7 @@ class lt extends A {
|
|
|
893
901
|
document.documentElement.style.overflowY = "auto";
|
|
894
902
|
}
|
|
895
903
|
}
|
|
896
|
-
class
|
|
904
|
+
class ct extends j {
|
|
897
905
|
/**
|
|
898
906
|
* This will get the overlay type.
|
|
899
907
|
*
|
|
@@ -912,7 +920,7 @@ class rt extends A {
|
|
|
912
920
|
this.container = e, this.initialize();
|
|
913
921
|
}
|
|
914
922
|
}
|
|
915
|
-
const
|
|
923
|
+
const We = d(({ index: t, click: e, state: s }, a) => D({
|
|
916
924
|
class: "p-2 cursor-pointer hover:bg-muted/50",
|
|
917
925
|
onState: [
|
|
918
926
|
[s, "selectedIndex", {
|
|
@@ -921,10 +929,10 @@ const Pe = d(({ index: t, click: e, state: s }, a) => D({
|
|
|
921
929
|
}]
|
|
922
930
|
],
|
|
923
931
|
click: () => e(t)
|
|
924
|
-
}, a)),
|
|
932
|
+
}, a)), Pe = d(({ selectOption: t, state: e }) => b({
|
|
925
933
|
class: "border rounded-md list-none m-0 p-0 max-h-[400px] overflow-y-auto",
|
|
926
|
-
for: ["filteredOptions", (s, a) =>
|
|
927
|
-
})),
|
|
934
|
+
for: ["filteredOptions", (s, a) => We({ index: a, click: t, state: e }, s.label)]
|
|
935
|
+
})), Oe = d((t) => o({ class: "relative flex items-center" }, [
|
|
928
936
|
se({
|
|
929
937
|
cache: "input",
|
|
930
938
|
placeholder: t.placeholder ?? "Search...",
|
|
@@ -936,22 +944,22 @@ const Pe = d(({ index: t, click: e, state: s }, a) => D({
|
|
|
936
944
|
keydown: (e) => typeof t.handleKeyDown == "function" && t.handleKeyDown(e)
|
|
937
945
|
}),
|
|
938
946
|
t.icon && o({ class: "absolute right-0 mr-2" }, [
|
|
939
|
-
|
|
947
|
+
N(t.icon)
|
|
940
948
|
])
|
|
941
|
-
])),
|
|
949
|
+
])), ze = (t) => o({
|
|
942
950
|
class: "relative flex fle-auto flex-col",
|
|
943
951
|
onState: ["open", (e, s, a) => {
|
|
944
952
|
if (e)
|
|
945
|
-
return new
|
|
953
|
+
return new ne({
|
|
946
954
|
cache: "dropdown",
|
|
947
955
|
parent: a,
|
|
948
956
|
button: a.input,
|
|
949
957
|
size: "xl"
|
|
950
958
|
}, [
|
|
951
|
-
|
|
959
|
+
Pe(t)
|
|
952
960
|
]);
|
|
953
961
|
}]
|
|
954
|
-
}),
|
|
962
|
+
}), dt = V(
|
|
955
963
|
{
|
|
956
964
|
/**
|
|
957
965
|
* This will set up the data object.
|
|
@@ -960,7 +968,7 @@ const Pe = d(({ index: t, click: e, state: s }, a) => D({
|
|
|
960
968
|
*/
|
|
961
969
|
setData() {
|
|
962
970
|
const t = this.options || [];
|
|
963
|
-
return new
|
|
971
|
+
return new L({
|
|
964
972
|
options: t,
|
|
965
973
|
filteredOptions: t
|
|
966
974
|
});
|
|
@@ -1048,7 +1056,7 @@ const Pe = d(({ index: t, click: e, state: s }, a) => D({
|
|
|
1048
1056
|
*/
|
|
1049
1057
|
render() {
|
|
1050
1058
|
return o({ class: "relative w-full max-w-md" }, [
|
|
1051
|
-
|
|
1059
|
+
Oe({
|
|
1052
1060
|
// @ts-ignore
|
|
1053
1061
|
state: this.state,
|
|
1054
1062
|
// @ts-ignore
|
|
@@ -1060,7 +1068,7 @@ const Pe = d(({ index: t, click: e, state: s }, a) => D({
|
|
|
1060
1068
|
// @ts-ignore
|
|
1061
1069
|
handleKeyDown: this.handleKeyDown.bind(this)
|
|
1062
1070
|
}),
|
|
1063
|
-
|
|
1071
|
+
ze({
|
|
1064
1072
|
// @ts-ignore
|
|
1065
1073
|
state: this.state,
|
|
1066
1074
|
// @ts-ignore
|
|
@@ -1071,7 +1079,7 @@ const Pe = d(({ index: t, click: e, state: s }, a) => D({
|
|
|
1071
1079
|
]);
|
|
1072
1080
|
}
|
|
1073
1081
|
}
|
|
1074
|
-
),
|
|
1082
|
+
), Ne = (t) => D(
|
|
1075
1083
|
{
|
|
1076
1084
|
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",
|
|
1077
1085
|
dataSet: ["selected", ["state", t.value, "active"]]
|
|
@@ -1083,10 +1091,10 @@ const Pe = d(({ index: t, click: e, state: s }, a) => D({
|
|
|
1083
1091
|
click: (e) => t.callBack(t.value)
|
|
1084
1092
|
}, t.label)
|
|
1085
1093
|
]
|
|
1086
|
-
),
|
|
1087
|
-
b({ class: "flex flex-auto flex-row", map: [t.options, (e) =>
|
|
1094
|
+
), $e = (t, e) => (t.callBack = e, Ne(t)), je = (t) => S({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${t.class}` }, [
|
|
1095
|
+
b({ class: "flex flex-auto flex-row", map: [t.options, (e) => $e(e, t.callBack)] })
|
|
1088
1096
|
]);
|
|
1089
|
-
class
|
|
1097
|
+
class ht extends h {
|
|
1090
1098
|
/**
|
|
1091
1099
|
* This will declare the props for the compiler.
|
|
1092
1100
|
*
|
|
@@ -1103,12 +1111,12 @@ class dt extends u {
|
|
|
1103
1111
|
render() {
|
|
1104
1112
|
const e = this.select.bind(this);
|
|
1105
1113
|
return o({ class: "" }, [
|
|
1106
|
-
|
|
1114
|
+
je({
|
|
1107
1115
|
class: this.class,
|
|
1108
1116
|
options: this.options,
|
|
1109
1117
|
callBack: e
|
|
1110
1118
|
}),
|
|
1111
|
-
|
|
1119
|
+
P({
|
|
1112
1120
|
class: "tab-content",
|
|
1113
1121
|
onState: ["selected", this.updateContent.bind(this)]
|
|
1114
1122
|
})
|
|
@@ -1152,9 +1160,9 @@ class dt extends u {
|
|
|
1152
1160
|
if (!s || s.length < 1)
|
|
1153
1161
|
return;
|
|
1154
1162
|
const a = s[0];
|
|
1155
|
-
for (const
|
|
1156
|
-
if (
|
|
1157
|
-
return
|
|
1163
|
+
for (const i of s)
|
|
1164
|
+
if (i.value === e)
|
|
1165
|
+
return i.layout;
|
|
1158
1166
|
return a.layout;
|
|
1159
1167
|
}
|
|
1160
1168
|
/**
|
|
@@ -1174,7 +1182,7 @@ class dt extends u {
|
|
|
1174
1182
|
};
|
|
1175
1183
|
}
|
|
1176
1184
|
}
|
|
1177
|
-
const
|
|
1185
|
+
const Ae = (t) => D(
|
|
1178
1186
|
{
|
|
1179
1187
|
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",
|
|
1180
1188
|
dataSet: ["selected", ["state", t.value, "active"]]
|
|
@@ -1187,10 +1195,10 @@ const je = (t) => D(
|
|
|
1187
1195
|
disabled: t.disabled
|
|
1188
1196
|
}, t.label)
|
|
1189
1197
|
]
|
|
1190
|
-
),
|
|
1191
|
-
b({ class: "flex flex-auto flex-row", map: [t.options, (e) =>
|
|
1198
|
+
), Ue = (t, e) => (t.callBack = e, Ae(t)), Ye = (t) => S({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${t.class}` }, [
|
|
1199
|
+
b({ class: "flex flex-auto flex-row", map: [t.options, (e) => Ue(e, t.callBack)] })
|
|
1192
1200
|
]);
|
|
1193
|
-
class
|
|
1201
|
+
class ut extends h {
|
|
1194
1202
|
/**
|
|
1195
1203
|
* This will declare the props for the compiler.
|
|
1196
1204
|
*
|
|
@@ -1206,7 +1214,7 @@ class ht extends u {
|
|
|
1206
1214
|
*/
|
|
1207
1215
|
render() {
|
|
1208
1216
|
const e = this.select.bind(this);
|
|
1209
|
-
return
|
|
1217
|
+
return Ye({
|
|
1210
1218
|
class: this.class,
|
|
1211
1219
|
options: this.options,
|
|
1212
1220
|
callBack: e
|
|
@@ -1233,17 +1241,17 @@ class ht extends u {
|
|
|
1233
1241
|
};
|
|
1234
1242
|
}
|
|
1235
1243
|
}
|
|
1236
|
-
const
|
|
1244
|
+
const Fe = (t, e) => new RegExp(`${t}($|/|\\.).*`).test(e), Ee = (t, e) => {
|
|
1237
1245
|
const s = t.getLinkPath();
|
|
1238
|
-
return t.exact ? e === s :
|
|
1239
|
-
},
|
|
1246
|
+
return t.exact ? e === s : Fe(s, e);
|
|
1247
|
+
}, He = ({ text: t, href: e, exact: s }) => new O({
|
|
1240
1248
|
text: t,
|
|
1241
1249
|
href: e,
|
|
1242
1250
|
exact: s,
|
|
1243
1251
|
dataSet: ["selected", ["state", !0, "active"]],
|
|
1244
1252
|
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"
|
|
1245
1253
|
});
|
|
1246
|
-
class
|
|
1254
|
+
class Qe extends h {
|
|
1247
1255
|
/**
|
|
1248
1256
|
* This will declare the props for the compiler.
|
|
1249
1257
|
*
|
|
@@ -1293,9 +1301,9 @@ class He extends u {
|
|
|
1293
1301
|
updateLinks(e) {
|
|
1294
1302
|
let s = !1, a = this.links[0];
|
|
1295
1303
|
this.deactivateAllLinks();
|
|
1296
|
-
for (const
|
|
1297
|
-
if (
|
|
1298
|
-
this.updateLink(
|
|
1304
|
+
for (const i of this.links)
|
|
1305
|
+
if (i.rendered !== !1 && (s = Ee(i, e), s === !0)) {
|
|
1306
|
+
this.updateLink(i, !0);
|
|
1299
1307
|
break;
|
|
1300
1308
|
}
|
|
1301
1309
|
s !== !0 && a && this.updateLink(a, !0);
|
|
@@ -1326,8 +1334,8 @@ class He extends u {
|
|
|
1326
1334
|
* @returns {object}
|
|
1327
1335
|
*/
|
|
1328
1336
|
addLink({ label: e, href: s, exact: a }) {
|
|
1329
|
-
const
|
|
1330
|
-
return this.links.push(
|
|
1337
|
+
const i = He({ text: e, href: s, exact: a });
|
|
1338
|
+
return this.links.push(i), i;
|
|
1331
1339
|
}
|
|
1332
1340
|
/**
|
|
1333
1341
|
* This will remove all the links.
|
|
@@ -1338,7 +1346,7 @@ class He extends u {
|
|
|
1338
1346
|
this.links = [];
|
|
1339
1347
|
}
|
|
1340
1348
|
}
|
|
1341
|
-
class
|
|
1349
|
+
class ft extends h {
|
|
1342
1350
|
/**
|
|
1343
1351
|
* This will declare the props for the compiler.
|
|
1344
1352
|
*
|
|
@@ -1354,11 +1362,11 @@ class ut extends u {
|
|
|
1354
1362
|
*/
|
|
1355
1363
|
render() {
|
|
1356
1364
|
return o({ class: "tab-panel" }, [
|
|
1357
|
-
new
|
|
1365
|
+
new Qe({
|
|
1358
1366
|
class: this.class,
|
|
1359
1367
|
options: this.options
|
|
1360
1368
|
}),
|
|
1361
|
-
|
|
1369
|
+
P({
|
|
1362
1370
|
class: "tab-content",
|
|
1363
1371
|
switch: this.addGroup()
|
|
1364
1372
|
})
|
|
@@ -1372,8 +1380,8 @@ class ut extends u {
|
|
|
1372
1380
|
addGroup() {
|
|
1373
1381
|
let e;
|
|
1374
1382
|
const s = [], a = this.options;
|
|
1375
|
-
for (let
|
|
1376
|
-
e = a[
|
|
1383
|
+
for (let i = 0, n = a.length; i < n; i++)
|
|
1384
|
+
e = a[i], s.push(
|
|
1377
1385
|
{
|
|
1378
1386
|
uri: e.uri || e.href,
|
|
1379
1387
|
component: e.component,
|
|
@@ -1384,7 +1392,7 @@ class ut extends u {
|
|
|
1384
1392
|
return s;
|
|
1385
1393
|
}
|
|
1386
1394
|
}
|
|
1387
|
-
class
|
|
1395
|
+
class Xe extends h {
|
|
1388
1396
|
/**
|
|
1389
1397
|
* Runs before rendering, sets up defaults, a timer for drawing,
|
|
1390
1398
|
* and basic canvas properties.
|
|
@@ -1402,7 +1410,7 @@ class Qe extends u {
|
|
|
1402
1410
|
* @returns {object} Layout definition for the canvas.
|
|
1403
1411
|
*/
|
|
1404
1412
|
render() {
|
|
1405
|
-
return
|
|
1413
|
+
return K({
|
|
1406
1414
|
style: "touch-action: none; -webkit-user-select: none; -webkit-touch-callout: none;"
|
|
1407
1415
|
});
|
|
1408
1416
|
}
|
|
@@ -1432,13 +1440,13 @@ class Qe extends u {
|
|
|
1432
1440
|
* @returns {Array} An array of [eventName, element, callback] definitions.
|
|
1433
1441
|
*/
|
|
1434
1442
|
setupEvents() {
|
|
1435
|
-
const e = this.panel, s = this.pointerPosition.bind(this), a = this.pointerUp.bind(this),
|
|
1443
|
+
const e = this.panel, s = this.pointerPosition.bind(this), a = this.pointerUp.bind(this), i = this.pointerDown.bind(this), n = this.resize.bind(this), l = { passive: !1 };
|
|
1436
1444
|
return [
|
|
1437
1445
|
["pointermove", e, s, l],
|
|
1438
1446
|
["pointerup", e, a],
|
|
1439
|
-
["pointerdown", e,
|
|
1447
|
+
["pointerdown", e, i, l],
|
|
1440
1448
|
["pointerout", e, a],
|
|
1441
|
-
["resize", window,
|
|
1449
|
+
["resize", window, n]
|
|
1442
1450
|
];
|
|
1443
1451
|
}
|
|
1444
1452
|
/**
|
|
@@ -1449,14 +1457,14 @@ class Qe extends u {
|
|
|
1449
1457
|
*/
|
|
1450
1458
|
getEventPosition(e) {
|
|
1451
1459
|
let s, a;
|
|
1452
|
-
const
|
|
1460
|
+
const i = this.canvas, n = i.width / parseInt(i.style.width), l = i.getBoundingClientRect();
|
|
1453
1461
|
if (e.touches && e.touches.length) {
|
|
1454
1462
|
const f = e.touches[0];
|
|
1455
1463
|
s = f.clientX, a = f.clientY;
|
|
1456
1464
|
} else
|
|
1457
1465
|
s = e.x || e.clientX, a = e.y || e.clientY;
|
|
1458
|
-
const
|
|
1459
|
-
this.mouse.x =
|
|
1466
|
+
const u = parseInt((s - l.left) * n), c = parseInt((a - l.top) * n);
|
|
1467
|
+
this.mouse.x = u, this.mouse.y = c;
|
|
1460
1468
|
}
|
|
1461
1469
|
/**
|
|
1462
1470
|
* Called when the pointer goes down on the canvas.
|
|
@@ -1498,10 +1506,10 @@ class Qe extends u {
|
|
|
1498
1506
|
resize() {
|
|
1499
1507
|
const { canvas: e, ctx: s } = this, a = e.toDataURL();
|
|
1500
1508
|
if (this.scale(), this.setupBackground(s), a !== "data:,") {
|
|
1501
|
-
const
|
|
1502
|
-
I.on("load",
|
|
1503
|
-
s.drawImage(
|
|
1504
|
-
}),
|
|
1509
|
+
const i = new window.Image();
|
|
1510
|
+
I.on("load", i, function n() {
|
|
1511
|
+
s.drawImage(i, 0, 0), I.off("load", i, n);
|
|
1512
|
+
}), i.src = a;
|
|
1505
1513
|
}
|
|
1506
1514
|
this.draw();
|
|
1507
1515
|
}
|
|
@@ -1530,13 +1538,13 @@ class Qe extends u {
|
|
|
1530
1538
|
* @returns {void}
|
|
1531
1539
|
*/
|
|
1532
1540
|
scale() {
|
|
1533
|
-
const e = this.canvas, s = this.container, a = B.getSize(s),
|
|
1534
|
-
let
|
|
1535
|
-
if (this.width = e.width =
|
|
1536
|
-
const f = a.width, g = a.height, r = f /
|
|
1537
|
-
|
|
1541
|
+
const e = this.canvas, s = this.container, a = B.getSize(s), i = this.targetSize, n = i.width, l = i.height;
|
|
1542
|
+
let u = n + "px", c = l + "px";
|
|
1543
|
+
if (this.width = e.width = n, this.height = e.height = l, a.width !== 0 && a.height !== 0) {
|
|
1544
|
+
const f = a.width, g = a.height, r = f / n, m = g / l, k = Math.min(r, m);
|
|
1545
|
+
u = n * k + "px", c = l * k + "px";
|
|
1538
1546
|
}
|
|
1539
|
-
e.style.width =
|
|
1547
|
+
e.style.width = u, e.style.height = c;
|
|
1540
1548
|
}
|
|
1541
1549
|
/**
|
|
1542
1550
|
* Main drawing loop. If the mouse is down, adds a line
|
|
@@ -1556,8 +1564,8 @@ class Qe extends u {
|
|
|
1556
1564
|
drawBottomLine(e) {
|
|
1557
1565
|
const s = this.canvas;
|
|
1558
1566
|
e.globalAlpha = 1, e.shadowBlur = 0;
|
|
1559
|
-
const a = this.margin.x,
|
|
1560
|
-
e.beginPath(), e.moveTo(a,
|
|
1567
|
+
const a = this.margin.x, i = this.height - this.margin.y;
|
|
1568
|
+
e.beginPath(), e.moveTo(a, i), e.lineTo(s.width - this.margin.x, i), e.lineWidth = this.baseLineWidth, e.strokeStyle = this.baseStrokeColor, e.stroke(), e.closePath();
|
|
1561
1569
|
}
|
|
1562
1570
|
/**
|
|
1563
1571
|
* Adds a line to the current path, updating the 'signed' status.
|
|
@@ -1568,10 +1576,10 @@ class Qe extends u {
|
|
|
1568
1576
|
* @param {string} color The stroke color.
|
|
1569
1577
|
* @returns {void}
|
|
1570
1578
|
*/
|
|
1571
|
-
addLine(e, s, a,
|
|
1579
|
+
addLine(e, s, a, i) {
|
|
1572
1580
|
this.signed || (this.signed = !0);
|
|
1573
|
-
const
|
|
1574
|
-
e.lineWidth = this.lineWidth, e.strokeStyle =
|
|
1581
|
+
const n = Math.round(s), l = Math.round(a);
|
|
1582
|
+
e.lineWidth = this.lineWidth, e.strokeStyle = i, e.lineTo(n, l), e.stroke();
|
|
1575
1583
|
}
|
|
1576
1584
|
/**
|
|
1577
1585
|
* Clears the canvas, sets signed to false, and re-initializes
|
|
@@ -1610,7 +1618,7 @@ class Qe extends u {
|
|
|
1610
1618
|
this.timer.stop(), this.status = "stopped";
|
|
1611
1619
|
}
|
|
1612
1620
|
}
|
|
1613
|
-
class
|
|
1621
|
+
class gt extends h {
|
|
1614
1622
|
/**
|
|
1615
1623
|
* Sets up default properties for the signature panel.
|
|
1616
1624
|
*
|
|
@@ -1633,13 +1641,13 @@ class ft extends u {
|
|
|
1633
1641
|
bind: this.path + ".data"
|
|
1634
1642
|
}),
|
|
1635
1643
|
o({ class: "absolute top-2 right-2" }, [
|
|
1636
|
-
|
|
1644
|
+
C({
|
|
1637
1645
|
variant: "icon",
|
|
1638
1646
|
icon: w.circleX,
|
|
1639
1647
|
click: this.reset.bind(this)
|
|
1640
1648
|
})
|
|
1641
1649
|
]),
|
|
1642
|
-
new
|
|
1650
|
+
new Xe({
|
|
1643
1651
|
cache: "canvasLayer",
|
|
1644
1652
|
margin: this.margin,
|
|
1645
1653
|
targetSize: this.targetSize,
|
|
@@ -1689,34 +1697,34 @@ class ft extends u {
|
|
|
1689
1697
|
}
|
|
1690
1698
|
}
|
|
1691
1699
|
export {
|
|
1692
|
-
|
|
1693
|
-
|
|
1700
|
+
lt as B,
|
|
1701
|
+
pe as C,
|
|
1694
1702
|
be as D,
|
|
1695
1703
|
we as H,
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
+
ct as I,
|
|
1705
|
+
ot as N,
|
|
1706
|
+
j as O,
|
|
1707
|
+
et as P,
|
|
1708
|
+
it as S,
|
|
1709
|
+
$ as T,
|
|
1710
|
+
Be as U,
|
|
1711
|
+
at as W,
|
|
1704
1712
|
ce as a,
|
|
1705
1713
|
T as b,
|
|
1706
1714
|
le as c,
|
|
1707
|
-
|
|
1708
|
-
|
|
1715
|
+
tt as d,
|
|
1716
|
+
st as e,
|
|
1709
1717
|
he as f,
|
|
1710
1718
|
re as g,
|
|
1711
1719
|
fe as h,
|
|
1712
1720
|
ge as i,
|
|
1713
1721
|
ke as j,
|
|
1714
1722
|
nt as k,
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1723
|
+
rt as l,
|
|
1724
|
+
dt as m,
|
|
1725
|
+
ht as n,
|
|
1726
|
+
ut as o,
|
|
1727
|
+
Qe as p,
|
|
1728
|
+
ft as q,
|
|
1729
|
+
gt as r
|
|
1722
1730
|
};
|
|
@@ -14,5 +14,11 @@ export class DelayComponent extends Component {
|
|
|
14
14
|
* @default ''
|
|
15
15
|
*/
|
|
16
16
|
removingClass: string;
|
|
17
|
+
/**
|
|
18
|
+
* This will remove the component from the DOM after a delay.
|
|
19
|
+
*
|
|
20
|
+
* @returns {void}
|
|
21
|
+
*/
|
|
22
|
+
remove(): void;
|
|
17
23
|
}
|
|
18
24
|
import { Component } from "@base-framework/base";
|
|
@@ -6,8 +6,96 @@
|
|
|
6
6
|
* @param {object} props
|
|
7
7
|
* @returns {object}
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export class DataTable extends Component {
|
|
10
|
+
/**
|
|
11
|
+
* Initializes component data.
|
|
12
|
+
*
|
|
13
|
+
* @returns {Data}
|
|
14
|
+
*/
|
|
15
|
+
setData(): Data;
|
|
16
|
+
/**
|
|
17
|
+
* This will toggle all selected rows.
|
|
18
|
+
*
|
|
19
|
+
* @returns {boolean}
|
|
20
|
+
*/
|
|
21
|
+
toggleAllSelectedRows(): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* This will update the selected state.
|
|
24
|
+
*
|
|
25
|
+
* @returns {void}
|
|
26
|
+
*/
|
|
27
|
+
updateSelected(): void;
|
|
28
|
+
/**
|
|
29
|
+
* This will get the selected rows.
|
|
30
|
+
*
|
|
31
|
+
* @returns {Array<object>}
|
|
32
|
+
*/
|
|
33
|
+
getSelectedRows(): Array<object>;
|
|
34
|
+
/**
|
|
35
|
+
* This will update the table rows.
|
|
36
|
+
*
|
|
37
|
+
* @protected
|
|
38
|
+
* @param {boolean} selected
|
|
39
|
+
* @returns {void}
|
|
40
|
+
*/
|
|
41
|
+
protected updateTable(selected: boolean): void;
|
|
42
|
+
/**
|
|
43
|
+
* Handles row selection.
|
|
44
|
+
*
|
|
45
|
+
* @param {object} row
|
|
46
|
+
*/
|
|
47
|
+
selectRow(row: object): void;
|
|
48
|
+
/**
|
|
49
|
+
* Renders the DataTable component.
|
|
50
|
+
*
|
|
51
|
+
* @returns {object}
|
|
52
|
+
*/
|
|
53
|
+
render(): object;
|
|
54
|
+
/**
|
|
55
|
+
* This will remove items from the list.
|
|
56
|
+
*
|
|
57
|
+
* @public
|
|
58
|
+
* @param {array} items
|
|
59
|
+
* @returns {void}
|
|
60
|
+
*/
|
|
61
|
+
public remove(items: any[]): void;
|
|
62
|
+
/**
|
|
63
|
+
* This will set the items in the list.
|
|
64
|
+
*
|
|
65
|
+
* @public
|
|
66
|
+
* @param {array} rows
|
|
67
|
+
* @returns {void}
|
|
68
|
+
*/
|
|
69
|
+
public setRows(rows: any[]): void;
|
|
70
|
+
/**
|
|
71
|
+
* This will append items to the list.
|
|
72
|
+
*
|
|
73
|
+
* @public
|
|
74
|
+
* @param {array|object} items
|
|
75
|
+
* @returns {void}
|
|
76
|
+
*/
|
|
77
|
+
public append(items: any[] | object): void;
|
|
78
|
+
/**
|
|
79
|
+
* This will mingle the new items with the old items.
|
|
80
|
+
*
|
|
81
|
+
* @public
|
|
82
|
+
* @param {Array<Object>} newItems
|
|
83
|
+
* @param {boolean} withDelete
|
|
84
|
+
* @returns {void}
|
|
85
|
+
*/
|
|
86
|
+
public mingle(newItems: Array<any>, withDelete?: boolean): void;
|
|
87
|
+
/**
|
|
88
|
+
* This will prepend items to the list.
|
|
89
|
+
*
|
|
90
|
+
* @public
|
|
91
|
+
* @param {array|object} items
|
|
92
|
+
* @returns {void}
|
|
93
|
+
*/
|
|
94
|
+
public prepend(items: any[] | object): void;
|
|
95
|
+
}
|
|
10
96
|
import { CheckboxCol } from './table-header.js';
|
|
11
97
|
import { HeaderCol } from './table-header.js';
|
|
12
98
|
import { TableHeader } from './table-header.js';
|
|
99
|
+
import { Component } from '@base-framework/base';
|
|
100
|
+
import { Data } from '@base-framework/base';
|
|
13
101
|
export { CheckboxCol, HeaderCol, TableHeader };
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
* @property {function} [props.selectRow] - The function to select a row.
|
|
18
18
|
* @property {string} [props.border] - The border to add to the table.
|
|
19
19
|
* @property {object} [props.data] - The table data.
|
|
20
|
-
* @property {string} [props.containerClass] - The class to add to the scroll container.
|
|
21
20
|
* @returns {object}
|
|
22
21
|
*/
|
|
23
22
|
export const ScrollableDataTable: Function;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export function ScrollableDataTableBody(props: object): object;
|
|
2
2
|
/**
|
|
3
3
|
* ScrollableDataTable Component
|
|
4
4
|
*
|
|
@@ -16,16 +16,11 @@ declare const ScrollableTable_base: typeof import("@base-framework/base").Compon
|
|
|
16
16
|
* @property {string} [props.containerClass] - The class to add to the scroll container.
|
|
17
17
|
* @returns {object}
|
|
18
18
|
*/
|
|
19
|
-
export class ScrollableTable extends
|
|
20
|
-
/**
|
|
21
|
-
* Renders the DataTable component.
|
|
22
|
-
*
|
|
23
|
-
* @returns {object}
|
|
24
|
-
*/
|
|
25
|
-
render(): object;
|
|
19
|
+
export class ScrollableTable extends DataTable {
|
|
26
20
|
}
|
|
27
21
|
export default ScrollableTable;
|
|
28
22
|
import { CheckboxCol } from './table-header.js';
|
|
29
23
|
import { HeaderCol } from './table-header.js';
|
|
30
24
|
import { TableHeader } from './table-header.js';
|
|
25
|
+
import { DataTable } from './data-table.js';
|
|
31
26
|
export { CheckboxCol, HeaderCol, TableHeader };
|
package/package.json
CHANGED