@base-framework/ui 1.0.1727 → 1.0.2000
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/copilot.md +80 -0
- package/dist/aside-template-sUm-F2f0.js +44 -0
- package/dist/atoms.es.js +31 -30
- package/dist/{bside-template-Du2m3rsE.js → bside-template-do_hXebn.js} +1 -1
- package/dist/{buttons-Cm9etaEG.js → buttons-CHEs54Wl.js} +23 -24
- package/dist/{confirmation-BxmDhBjv.js → empty-state-BfT4MKkN.js} +721 -335
- package/dist/form-group-CJzpq9Us.js +29 -0
- package/dist/format-BLolnx9j.js +122 -0
- package/dist/icons.es.js +4 -1
- package/dist/image-scaler-1G-JzJVG.js +530 -0
- package/dist/index.es.js +170 -151
- package/dist/inputs-9udyzkHR.js +210 -0
- package/dist/{mobile-nav-wrapper-Dj67Pb8l.js → mobile-nav-wrapper-Dm9DinRD.js} +2 -2
- package/dist/molecules.es.js +46 -39
- package/dist/organisms.es.js +55 -49
- package/dist/pages.es.js +1 -1
- package/dist/range-calendar-BMWSJTE0.js +833 -0
- package/dist/{sidebar-menu-page-BVryQj2Z.js → sidebar-menu-page-D4WMgz5U.js} +6 -6
- package/dist/{signature-panel-xXbYWejE.js → signature-panel-CcRmukPe.js} +598 -252
- package/dist/templates.es.js +2 -2
- package/dist/{tooltip-CESEqMCU.js → tooltip-PupzYM1r.js} +27 -34
- package/dist/types/components/atoms/atoms.d.ts +1 -0
- package/dist/types/components/atoms/form/form-group.d.ts +12 -0
- package/dist/types/components/atoms/form/inputs/input-classes.d.ts +2 -2
- package/dist/types/components/atoms/form/inputs/inputs.d.ts +0 -7
- package/dist/types/components/molecules/date-time/date-range-picker.d.ts +10 -0
- package/dist/types/components/molecules/empty/empty-state.d.ts +9 -0
- package/dist/types/components/molecules/files/attachment/attachment-input.d.ts +9 -0
- package/dist/types/components/molecules/files/attachment/attachment.d.ts +10 -0
- package/dist/types/components/molecules/files/attachment/orientation.d.ts +1 -0
- package/dist/types/components/molecules/files/attachment/type.d.ts +1 -0
- package/dist/types/components/molecules/form/form-card.d.ts +31 -0
- package/dist/types/components/molecules/image/image-uploader.d.ts +9 -0
- package/dist/types/components/molecules/image/logo-uploader.d.ts +9 -0
- package/dist/types/components/molecules/molecules.d.ts +5 -0
- package/dist/types/components/molecules/notifications/notification.d.ts +3 -3
- package/dist/types/components/organisms/calendar/calendar.d.ts +6 -0
- package/dist/types/components/organisms/calendar/month/calendar-header.d.ts +7 -0
- package/dist/types/components/organisms/calendar/month-selector.d.ts +5 -0
- package/dist/types/components/organisms/calendar/range/calendar-header.d.ts +7 -0
- package/dist/types/components/organisms/calendar/range/day-header.d.ts +1 -0
- package/dist/types/components/organisms/calendar/range/days-of-week-header.d.ts +1 -0
- package/dist/types/components/organisms/calendar/range/month-calendar.d.ts +17 -0
- package/dist/types/components/organisms/calendar/range/month-selector.d.ts +5 -0
- package/dist/types/components/organisms/calendar/range/navigation-button.d.ts +1 -0
- package/dist/types/components/organisms/calendar/range/range-calendar.d.ts +72 -0
- package/dist/types/components/organisms/calendar/range/range-day-cell.d.ts +10 -0
- package/dist/types/components/organisms/calendar/range/range-days-grid.d.ts +6 -0
- package/dist/types/components/organisms/calendar/range/range-toggle.d.ts +7 -0
- package/dist/types/components/organisms/calendar/range/year-selector.d.ts +4 -0
- package/dist/types/components/organisms/calendar/year-selector.d.ts +5 -0
- package/dist/types/components/organisms/lists/data-table-body.d.ts +1 -1
- package/dist/types/components/organisms/lists/data-table.d.ts +7 -0
- package/dist/types/components/organisms/lists/dynamic-data-table.d.ts +2 -0
- package/dist/types/components/organisms/lists/dynamic-table.d.ts +2 -0
- package/dist/types/components/organisms/lists/scrollable-data-table.d.ts +2 -0
- package/dist/types/components/organisms/lists/scrollable-table.d.ts +2 -0
- package/dist/types/components/organisms/lists/skeleton-examples.d.ts +12 -0
- package/dist/types/components/organisms/lists/skeleton-table-row.d.ts +6 -0
- package/dist/types/components/organisms/organisms.d.ts +6 -0
- package/dist/types/components/organisms/tabs/button-tab.d.ts +2 -2
- package/dist/types/components/organisms/tabs/tab-group.d.ts +3 -3
- package/dist/types/components/organisms/tabs/tab-navigation.d.ts +2 -2
- package/dist/types/components/organisms/tabs/tab.d.ts +2 -2
- package/dist/types/components/organisms/tabs/underlined-button-tab.d.ts +60 -0
- package/dist/types/components/organisms/tabs/underlined-tab-group.d.ts +48 -0
- package/dist/types/components/organisms/tabs/underlined-tab-navigation.d.ts +63 -0
- package/dist/types/components/organisms/tabs/underlined-tab.d.ts +36 -0
- package/dist/types/demo.d.ts +0 -0
- package/dist/types/ui.d.ts +1 -0
- package/dist/types/utils/format/format.d.ts +78 -0
- package/dist/types/utils/utils.d.ts +2 -0
- package/dist/utils.es.js +7 -1
- package/dist/veil-CqnAmj-D.js +20 -0
- package/package.json +85 -85
- package/dist/aside-template-McEj_Gxc.js +0 -35
- package/dist/calendar-DQXME-2u.js +0 -440
- package/dist/inputs-Dmu4Z-7-.js +0 -209
- package/dist/veil-D4dRxILB.js +0 -21
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { Button as
|
|
2
|
-
import { Atom as d, Component as
|
|
3
|
-
import { B as
|
|
4
|
-
import { Icons as
|
|
5
|
-
import { TableBody as
|
|
6
|
-
import { C as
|
|
7
|
-
import { A as
|
|
1
|
+
import { Button as w, Div as o, On as C, Span as L, Th as N, UseParent as E, I as Q, Thead as V, Tr as G, Table as B, P as v, Li as y, Time as X, Nav as m, Ul as f, Section as I, Canvas as q } from "@base-framework/atoms";
|
|
2
|
+
import { Atom as d, Component as p, Data as T, DateTime as K, router as x, NavLink as M, DataTracker as U, Jot as _, base as O, Dom as W } from "@base-framework/base";
|
|
3
|
+
import { B as P, I as J } from "./buttons-CHEs54Wl.js";
|
|
4
|
+
import { Icons as S } from "./icons.es.js";
|
|
5
|
+
import { TableBody as Z, DataTableBody as ee, ScrollableTableBody as te, List as se, IntervalTimer as ae } from "@base-framework/organisms";
|
|
6
|
+
import { C as ie, I as ne, H as oe } from "./inputs-9udyzkHR.js";
|
|
7
|
+
import { A as le, P as re } from "./range-calendar-BMWSJTE0.js";
|
|
8
|
+
import { V as g } from "./veil-CqnAmj-D.js";
|
|
8
9
|
d((t, e) => ({
|
|
9
10
|
class: "flex items-center px-4 py-2",
|
|
10
11
|
...t,
|
|
11
12
|
children: e
|
|
12
13
|
}));
|
|
13
|
-
d(({ value: t, label: e }) =>
|
|
14
|
+
d(({ value: t, label: e }) => w({
|
|
14
15
|
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
16
|
onState: ["performance", { active: t }],
|
|
16
17
|
dataSet: ["performance", ["state", t, "active"]],
|
|
17
18
|
click: (s, { state: a }) => a.performance = t
|
|
18
19
|
}, e));
|
|
19
|
-
class
|
|
20
|
+
class mt extends p {
|
|
20
21
|
/**
|
|
21
22
|
* This will declare the props for the compiler.
|
|
22
23
|
*
|
|
@@ -34,55 +35,55 @@ class at extends h {
|
|
|
34
35
|
return o({ class: this.class || "" }, this.children);
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
|
-
const
|
|
38
|
+
const ce = (t) => {
|
|
38
39
|
const e = new Date(t, 11, 31), s = new Date(t, 0, 1);
|
|
39
40
|
return e.getDay() === 4 || // December 31 is a Thursday
|
|
40
41
|
s.getDay() === 4;
|
|
41
|
-
},
|
|
42
|
+
}, de = (t) => {
|
|
42
43
|
const e = new Date(t.valueOf()), s = (e.getDay() + 6) % 7;
|
|
43
44
|
e.setDate(e.getDate() - s + 3);
|
|
44
45
|
const a = e.getFullYear(), i = new Date(a, 0, 4);
|
|
45
46
|
i.setDate(i.getDate() - (i.getDay() + 6) % 7);
|
|
46
47
|
const n = Math.ceil((e - i) / 6048e5) + 1;
|
|
47
|
-
return n > 52 && !
|
|
48
|
+
return n > 52 && !ce(a) ? {
|
|
48
49
|
weekNumber: 1,
|
|
49
50
|
year: a + 1
|
|
50
51
|
} : {
|
|
51
52
|
weekNumber: n,
|
|
52
53
|
year: a
|
|
53
54
|
};
|
|
54
|
-
},
|
|
55
|
+
}, he = (t, e, s) => {
|
|
55
56
|
if (s === 0) return [];
|
|
56
57
|
const a = new Date(t, e, 0).getDate();
|
|
57
58
|
return Array.from(
|
|
58
59
|
{ length: s },
|
|
59
60
|
(i, n) => new Date(t, e - 1, a - s + n + 1)
|
|
60
61
|
);
|
|
61
|
-
},
|
|
62
|
+
}, ue = (t, e, s) => Array.from({ length: s }, (a, i) => new Date(t, e + 1, i + 1)), $ = (t, e) => {
|
|
62
63
|
const s = new Date(e, 0, 4), a = (s.getDay() + 6) % 7, i = new Date(s);
|
|
63
64
|
i.setDate(s.getDate() - a);
|
|
64
65
|
const n = new Date(i);
|
|
65
66
|
return n.setDate(i.getDate() + (t - 1) * 7), n;
|
|
66
|
-
},
|
|
67
|
+
}, pt = (t, e) => {
|
|
67
68
|
const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(), i = [];
|
|
68
69
|
let n = [];
|
|
69
70
|
for (let l = 1 - s; l <= a; l++) {
|
|
70
|
-
const
|
|
71
|
-
n.push(l > 0 ?
|
|
71
|
+
const c = new Date(t, e, l);
|
|
72
|
+
n.push(l > 0 ? c : null), (n.length === 7 || l === a) && (i.push([...n]), n = []);
|
|
72
73
|
}
|
|
73
74
|
return i;
|
|
74
|
-
},
|
|
75
|
+
}, bt = (t, e) => {
|
|
75
76
|
const s = new Date(t, e + 1, 0).getDate(), a = [];
|
|
76
77
|
let i = [];
|
|
77
78
|
for (let n = 1; n <= s; n++)
|
|
78
79
|
i.push(new Date(t, e, n)), i.length === 7 && (a.push(i), i = []);
|
|
79
80
|
return i.length > 0 && a.push(i), a;
|
|
80
|
-
},
|
|
81
|
+
}, fe = (t, e, s) => {
|
|
81
82
|
const a = /* @__PURE__ */ new Date();
|
|
82
83
|
return a.getDate() === t && a.getMonth() === e && a.getFullYear() === s;
|
|
83
|
-
},
|
|
84
|
-
const n =
|
|
85
|
-
return
|
|
84
|
+
}, ge = ({ day: t, month: e, year: s, weekNumber: a, selectWeek: i }) => {
|
|
85
|
+
const n = fe(t, e, s);
|
|
86
|
+
return w({
|
|
86
87
|
text: t || "",
|
|
87
88
|
disabled: !t,
|
|
88
89
|
class: `
|
|
@@ -92,19 +93,19 @@ const re = (t) => {
|
|
|
92
93
|
`,
|
|
93
94
|
click: () => i(a, s)
|
|
94
95
|
});
|
|
95
|
-
},
|
|
96
|
-
const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(), i =
|
|
97
|
-
for (let
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
weekNumber:
|
|
101
|
-
year:
|
|
102
|
-
days:
|
|
96
|
+
}, me = (t, e) => {
|
|
97
|
+
const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(), i = he(t, e, s), n = Array.from({ length: a }, (h, k) => new Date(t, e, k + 1)), l = (i.length + n.length) % 7, c = l === 0 ? 0 : 7 - l, r = ue(t, e, c), u = [...i, ...n, ...r], b = [];
|
|
98
|
+
for (let h = 0; h < u.length; h += 7) {
|
|
99
|
+
const k = u.slice(h, h + 7), D = k.find((Y) => Y) || new Date(t, e, 1), { weekNumber: H, year: F } = de(D);
|
|
100
|
+
b.push({
|
|
101
|
+
weekNumber: H,
|
|
102
|
+
year: F,
|
|
103
|
+
days: k
|
|
103
104
|
});
|
|
104
105
|
}
|
|
105
|
-
return
|
|
106
|
-
},
|
|
107
|
-
const { year: i, month: n, currentDate: l } = a,
|
|
106
|
+
return b;
|
|
107
|
+
}, pe = ({ selectWeek: t }) => C("month", (e, s, { data: a }) => {
|
|
108
|
+
const { year: i, month: n, currentDate: l } = a, c = me(i, n);
|
|
108
109
|
return o(
|
|
109
110
|
{ class: "grid grid-cols-8 gap-1 text-sm px-4 py-2" },
|
|
110
111
|
[
|
|
@@ -115,37 +116,37 @@ const re = (t) => {
|
|
|
115
116
|
class: "grid grid-cols-7 col-span-7 text-center text-muted-foreground items-center"
|
|
116
117
|
},
|
|
117
118
|
["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(
|
|
118
|
-
(
|
|
119
|
+
(r) => L({ class: "px-1 py-1", text: r })
|
|
119
120
|
)
|
|
120
121
|
),
|
|
121
122
|
// Render each "week" row
|
|
122
|
-
...
|
|
123
|
-
({ weekNumber:
|
|
123
|
+
...c.map(
|
|
124
|
+
({ weekNumber: r, days: u, year: b }) => o({
|
|
124
125
|
class: "grid grid-cols-8 col-span-8 items-center ring-primary rounded-sm px-1",
|
|
125
126
|
onSet: ["currentWeek", {
|
|
126
|
-
ring:
|
|
127
|
+
ring: r
|
|
127
128
|
}]
|
|
128
129
|
}, [
|
|
129
130
|
// Left column: ISO week number
|
|
130
131
|
o({
|
|
131
132
|
class: "font-medium text-center col-span-1 rounded-sm cursor-pointer",
|
|
132
|
-
click: () => t(
|
|
133
|
+
click: () => t(r, b),
|
|
133
134
|
// If you have a 'currentWeek' state, you can highlight it with 'onSet'
|
|
134
135
|
onSet: ["currentWeek", {
|
|
135
|
-
"text-primary-foreground":
|
|
136
|
-
"bg-primary":
|
|
136
|
+
"text-primary-foreground": r,
|
|
137
|
+
"bg-primary": r
|
|
137
138
|
}],
|
|
138
|
-
text:
|
|
139
|
+
text: r ? `W${r}` : ""
|
|
139
140
|
}),
|
|
140
141
|
// The 7 cells for each day in the row
|
|
141
142
|
o(
|
|
142
143
|
{ class: "grid grid-cols-7 col-span-7 text-center" },
|
|
143
|
-
|
|
144
|
-
(
|
|
145
|
-
year:
|
|
146
|
-
month:
|
|
147
|
-
day:
|
|
148
|
-
weekNumber:
|
|
144
|
+
u.map(
|
|
145
|
+
(h) => ge({
|
|
146
|
+
year: h?.getFullYear() || null,
|
|
147
|
+
month: h?.getMonth() || null,
|
|
148
|
+
day: h?.getDate() || null,
|
|
149
|
+
weekNumber: r,
|
|
149
150
|
selectWeek: t
|
|
150
151
|
})
|
|
151
152
|
)
|
|
@@ -154,7 +155,7 @@ const re = (t) => {
|
|
|
154
155
|
)
|
|
155
156
|
]
|
|
156
157
|
);
|
|
157
|
-
}),
|
|
158
|
+
}), z = ({ label: t, click: e }) => P(
|
|
158
159
|
{
|
|
159
160
|
class: `
|
|
160
161
|
inline-flex items-center justify-center h-7 w-7 bg-transparent p-0
|
|
@@ -165,20 +166,20 @@ const re = (t) => {
|
|
|
165
166
|
click: e,
|
|
166
167
|
"aria-label": `${t} month`,
|
|
167
168
|
variant: "icon",
|
|
168
|
-
icon: t === "Previous" ?
|
|
169
|
+
icon: t === "Previous" ? S.chevron.single.left : S.chevron.single.right
|
|
169
170
|
}
|
|
170
|
-
),
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
), be = ({ next: t, previous: e }) => o({ class: "flex flex-auto min-h-12 text-sm font-medium relative justify-center items-center" }, [
|
|
172
|
+
L("[[monthName]] [[year]]"),
|
|
173
|
+
z({
|
|
173
174
|
label: "Previous",
|
|
174
175
|
click: e
|
|
175
176
|
}),
|
|
176
|
-
|
|
177
|
+
z({
|
|
177
178
|
label: "Next",
|
|
178
179
|
click: t
|
|
179
180
|
})
|
|
180
181
|
]);
|
|
181
|
-
class
|
|
182
|
+
class kt extends p {
|
|
182
183
|
/**
|
|
183
184
|
* This will declare the props for the compiler.
|
|
184
185
|
*
|
|
@@ -193,8 +194,8 @@ class ot extends h {
|
|
|
193
194
|
* @returns {Data}
|
|
194
195
|
*/
|
|
195
196
|
setData() {
|
|
196
|
-
const e = /* @__PURE__ */ new Date(), s = this.selectedWeek || this.calculateCurrentWeek(e), a =
|
|
197
|
-
return new
|
|
197
|
+
const e = /* @__PURE__ */ new Date(), s = this.selectedWeek || this.calculateCurrentWeek(e), a = $(s, e.getFullYear());
|
|
198
|
+
return new T({
|
|
198
199
|
monthName: this.getMonthName(a.getMonth()),
|
|
199
200
|
year: a.getFullYear(),
|
|
200
201
|
month: a.getMonth(),
|
|
@@ -231,7 +232,7 @@ class ot extends h {
|
|
|
231
232
|
* @returns {string}
|
|
232
233
|
*/
|
|
233
234
|
getMonthName(e) {
|
|
234
|
-
return
|
|
235
|
+
return K.monthNames[e];
|
|
235
236
|
}
|
|
236
237
|
/**
|
|
237
238
|
* Updates the calendar to show the previous month.
|
|
@@ -276,7 +277,7 @@ class ot extends h {
|
|
|
276
277
|
*/
|
|
277
278
|
selectWeek(e, s) {
|
|
278
279
|
this.data.currentWeek = e;
|
|
279
|
-
const a =
|
|
280
|
+
const a = $(e, s);
|
|
280
281
|
this.setDate(a.getMonth(), a.getFullYear(), a.getDate()), typeof this.selectedCallBack == "function" && this.selectedCallBack(e);
|
|
281
282
|
}
|
|
282
283
|
/**
|
|
@@ -285,39 +286,39 @@ class ot extends h {
|
|
|
285
286
|
* @returns {object}
|
|
286
287
|
*/
|
|
287
288
|
render() {
|
|
288
|
-
return o({ class: "week-calendar-container border rounded-md
|
|
289
|
-
|
|
289
|
+
return o({ class: "week-calendar-container border rounded-md p-3" }, [
|
|
290
|
+
be({
|
|
290
291
|
next: () => this.goToNextMonth(),
|
|
291
292
|
previous: () => this.goToPreviousMonth()
|
|
292
293
|
}),
|
|
293
|
-
|
|
294
|
+
pe({
|
|
294
295
|
selectWeek: (e, s) => this.selectWeek(e, s)
|
|
295
296
|
})
|
|
296
297
|
]);
|
|
297
298
|
}
|
|
298
299
|
}
|
|
299
|
-
const
|
|
300
|
+
const ke = (t, e) => {
|
|
300
301
|
const s = t.toggleAllSelectedRows();
|
|
301
302
|
e.state.checked = !s;
|
|
302
|
-
},
|
|
303
|
-
|
|
304
|
-
]),
|
|
303
|
+
}, xe = (t) => N({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class || ""}` }, [
|
|
304
|
+
E((e) => new ie({ class: "mr-2", onChange: (s, a) => ke(e, a) }))
|
|
305
|
+
]), we = ({ align: t, sortable: e, key: s, label: a, sort: i, class: n }) => {
|
|
305
306
|
const l = t || "justify-start";
|
|
306
|
-
return
|
|
307
|
+
return N({
|
|
307
308
|
class: `cursor-pointer py-3 px-4 text-base ${n || ""}`,
|
|
308
309
|
click: e && (() => i(s))
|
|
309
310
|
}, [
|
|
310
311
|
o({ class: `flex flex-auto w-full items-center ${l}` }, [
|
|
311
|
-
|
|
312
|
-
e &&
|
|
312
|
+
L(a),
|
|
313
|
+
e && Q({ class: "ml-2", html: S.arrows.upDown })
|
|
313
314
|
])
|
|
314
315
|
]);
|
|
315
|
-
},
|
|
316
|
-
|
|
316
|
+
}, R = (t) => V([
|
|
317
|
+
G({
|
|
317
318
|
class: "text-muted-foreground border-b",
|
|
318
319
|
map: [
|
|
319
320
|
t.headers,
|
|
320
|
-
(e) => e.label === "checkbox" ?
|
|
321
|
+
(e) => e.label === "checkbox" ? xe({ toggle: t.toggle }) : we({
|
|
321
322
|
align: e.align,
|
|
322
323
|
sortable: e.sortable,
|
|
323
324
|
key: e.key,
|
|
@@ -326,22 +327,28 @@ const be = (t, e) => {
|
|
|
326
327
|
})
|
|
327
328
|
]
|
|
328
329
|
})
|
|
329
|
-
]),
|
|
330
|
+
]), ye = ({ key: t, rows: e, selectRow: s, rowItem: a, emptyState: i, skeleton: n, columnCount: l }) => new Z({
|
|
330
331
|
cache: "list",
|
|
331
332
|
key: t,
|
|
332
333
|
items: e,
|
|
333
|
-
rowItem: (
|
|
334
|
-
class: "divide-y divide-border"
|
|
334
|
+
rowItem: (c) => a(c, s),
|
|
335
|
+
class: "divide-y divide-border",
|
|
336
|
+
emptyState: i,
|
|
337
|
+
skeleton: n,
|
|
338
|
+
columnCount: l
|
|
335
339
|
});
|
|
336
|
-
class
|
|
340
|
+
class j extends p {
|
|
337
341
|
/**
|
|
338
342
|
* Initializes component data.
|
|
339
343
|
*
|
|
340
344
|
* @returns {Data}
|
|
341
345
|
*/
|
|
342
346
|
setData() {
|
|
343
|
-
|
|
347
|
+
let e = this.rows && this.rows.length > 0;
|
|
348
|
+
return (this.loadMoreItems || this.tableData) && !e && (e = null), new T({
|
|
344
349
|
selectedRows: [],
|
|
350
|
+
// @ts-ignore
|
|
351
|
+
hasItems: e,
|
|
345
352
|
selected: !1
|
|
346
353
|
});
|
|
347
354
|
}
|
|
@@ -393,28 +400,43 @@ class N extends h {
|
|
|
393
400
|
const a = this.data.get("selectedRows"), i = e.selected ? [...a, e] : a.filter((n) => n !== e);
|
|
394
401
|
this.data.selectedRows = i, this.updateSelected();
|
|
395
402
|
}
|
|
403
|
+
/**
|
|
404
|
+
* Gets the number of header columns.
|
|
405
|
+
*
|
|
406
|
+
* @returns {number}
|
|
407
|
+
*/
|
|
408
|
+
getHeaderColCount() {
|
|
409
|
+
return this.customHeader ? this.customHeader?.children[0]?.children?.length : this.headers ? this.headers.length : 3;
|
|
410
|
+
}
|
|
396
411
|
/**
|
|
397
412
|
* Renders the DataTable component.
|
|
398
413
|
*
|
|
399
414
|
* @returns {object}
|
|
400
415
|
*/
|
|
401
416
|
render() {
|
|
402
|
-
const e = this.
|
|
403
|
-
return o({ class: "w-full" }, [
|
|
404
|
-
|
|
405
|
-
|
|
417
|
+
const e = this.border !== !1 ? "border" : "", s = this.getHeaderColCount();
|
|
418
|
+
return o({ class: "w-full flex flex-auto flex-col" }, [
|
|
419
|
+
C("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
|
|
420
|
+
o({ class: `w-full rounded-md ${e} overflow-x-auto`, onSet: ["hasItems", { hidden: !1 }] }, [
|
|
421
|
+
B({ class: "w-full" }, [
|
|
406
422
|
// @ts-ignore
|
|
407
|
-
this.headers &&
|
|
423
|
+
this.headers && R({ headers: this.headers, sort: (a) => this.sortRows(a) }),
|
|
408
424
|
// @ts-ignore
|
|
409
425
|
this.customHeader ?? null,
|
|
410
|
-
|
|
426
|
+
ye({
|
|
411
427
|
// @ts-ignore
|
|
412
428
|
key: this.key,
|
|
413
|
-
|
|
429
|
+
// @ts-ignore
|
|
430
|
+
rows: this.rows,
|
|
414
431
|
// @ts-ignore
|
|
415
432
|
selectRow: this.selectRow.bind(this),
|
|
416
433
|
// @ts-ignore
|
|
417
|
-
rowItem: this.rowItem
|
|
434
|
+
rowItem: this.rowItem,
|
|
435
|
+
// @ts-ignore
|
|
436
|
+
emptyState: this.emptyState,
|
|
437
|
+
// @ts-ignore
|
|
438
|
+
skeleton: this.skeleton,
|
|
439
|
+
columnCount: s
|
|
418
440
|
})
|
|
419
441
|
])
|
|
420
442
|
])
|
|
@@ -480,7 +502,7 @@ class N extends h {
|
|
|
480
502
|
this.data.selectedRows = [];
|
|
481
503
|
}
|
|
482
504
|
}
|
|
483
|
-
const
|
|
505
|
+
const ve = (t) => new ee({
|
|
484
506
|
cache: "list",
|
|
485
507
|
loadMoreItems: t.loadMoreItems,
|
|
486
508
|
offset: t.offset,
|
|
@@ -489,24 +511,27 @@ const xe = (t) => new Z({
|
|
|
489
511
|
tableData: t.tableData,
|
|
490
512
|
items: t.items,
|
|
491
513
|
rowItem: (e) => t.rowItem(e, t.selectRow),
|
|
492
|
-
class: "divide-y divide-border"
|
|
514
|
+
class: "divide-y divide-border",
|
|
515
|
+
skeleton: t.skeleton,
|
|
516
|
+
columnCount: t.columnCount
|
|
493
517
|
});
|
|
494
|
-
class
|
|
518
|
+
class De extends j {
|
|
495
519
|
/**
|
|
496
520
|
* Renders the DataTable component.
|
|
497
521
|
*
|
|
498
522
|
* @returns {object}
|
|
499
523
|
*/
|
|
500
524
|
render() {
|
|
501
|
-
const e = this.
|
|
502
|
-
return o({ class: "w-full" }, [
|
|
503
|
-
|
|
504
|
-
|
|
525
|
+
const e = this.border !== !1 ? "border" : "", s = this.getHeaderColCount();
|
|
526
|
+
return o({ class: "w-full flex flex-auto flex-col" }, [
|
|
527
|
+
C("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
|
|
528
|
+
o({ class: `w-full rounded-md ${e} overflow-x-auto`, onSet: ["hasItems", { hidden: !1 }] }, [
|
|
529
|
+
B({ class: "w-full" }, [
|
|
505
530
|
// @ts-ignore
|
|
506
|
-
this.headers &&
|
|
531
|
+
this.headers && R({ headers: this.headers, sort: (a) => this.sortRows(a) }),
|
|
507
532
|
// @ts-ignore
|
|
508
533
|
this.customHeader ?? null,
|
|
509
|
-
|
|
534
|
+
ve({
|
|
510
535
|
// @ts-ignore
|
|
511
536
|
loadMoreItems: this.loadMoreItems,
|
|
512
537
|
// @ts-ignore
|
|
@@ -519,11 +544,15 @@ class ve extends N {
|
|
|
519
544
|
tableData: this.tableData,
|
|
520
545
|
// @ts-ignore
|
|
521
546
|
key: this.key,
|
|
522
|
-
|
|
547
|
+
// @ts-ignore
|
|
548
|
+
items: this.rows,
|
|
523
549
|
// @ts-ignore
|
|
524
550
|
selectRow: this.selectRow.bind(this),
|
|
525
551
|
// @ts-ignore
|
|
526
|
-
rowItem: this.rowItem
|
|
552
|
+
rowItem: this.rowItem,
|
|
553
|
+
// @ts-ignore
|
|
554
|
+
skeleton: this.skeleton,
|
|
555
|
+
columnCount: s
|
|
527
556
|
})
|
|
528
557
|
])
|
|
529
558
|
])
|
|
@@ -538,7 +567,7 @@ class ve extends N {
|
|
|
538
567
|
this.list.refresh();
|
|
539
568
|
}
|
|
540
569
|
}
|
|
541
|
-
const
|
|
570
|
+
const xt = d((t) => new De(
|
|
542
571
|
{
|
|
543
572
|
cache: t.cache ?? "list",
|
|
544
573
|
tableData: t.data,
|
|
@@ -551,9 +580,11 @@ const lt = d((t) => new ve(
|
|
|
551
580
|
rowItem: t.rowItem,
|
|
552
581
|
headers: t.headers,
|
|
553
582
|
customHeader: t.customHeader,
|
|
554
|
-
border: t.border
|
|
583
|
+
border: t.border,
|
|
584
|
+
emptyState: t.emptyState,
|
|
585
|
+
skeleton: t.skeleton
|
|
555
586
|
}
|
|
556
|
-
)),
|
|
587
|
+
)), Se = (t) => new te({
|
|
557
588
|
cache: "list",
|
|
558
589
|
scrollContainer: t.scrollContainer,
|
|
559
590
|
loadMoreItems: t.loadMoreItems,
|
|
@@ -563,24 +594,27 @@ const lt = d((t) => new ve(
|
|
|
563
594
|
tableData: t.tableData,
|
|
564
595
|
items: t.items,
|
|
565
596
|
rowItem: (e) => t.rowItem(e, t.selectRow),
|
|
566
|
-
class: "divide-y divide-border"
|
|
597
|
+
class: "divide-y divide-border",
|
|
598
|
+
skeleton: t.skeleton,
|
|
599
|
+
columnCount: t.columnCount
|
|
567
600
|
});
|
|
568
|
-
class
|
|
601
|
+
class Ce extends j {
|
|
569
602
|
/**
|
|
570
603
|
* Renders the DataTable component.
|
|
571
604
|
*
|
|
572
605
|
* @returns {object}
|
|
573
606
|
*/
|
|
574
607
|
render() {
|
|
575
|
-
const e = this.
|
|
576
|
-
return o({ class: "w-full" }, [
|
|
577
|
-
|
|
578
|
-
|
|
608
|
+
const e = this.border !== !1 ? "border" : "", s = this.getHeaderColCount();
|
|
609
|
+
return o({ class: "w-full flex flex-auto flex-col" }, [
|
|
610
|
+
C("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
|
|
611
|
+
o({ class: `w-full rounded-md ${e} overflow-x-auto`, onSet: ["hasItems", { hidden: !1 }] }, [
|
|
612
|
+
B({ class: "w-full" }, [
|
|
579
613
|
// @ts-ignore
|
|
580
|
-
this.headers &&
|
|
614
|
+
this.headers && R({ headers: this.headers, sort: (a) => this.sortRows(a) }),
|
|
581
615
|
// @ts-ignore
|
|
582
616
|
this.customHeader ?? null,
|
|
583
|
-
|
|
617
|
+
Se({
|
|
584
618
|
// @ts-ignore
|
|
585
619
|
scrollContainer: this.scrollContainer,
|
|
586
620
|
// @ts-ignore
|
|
@@ -595,11 +629,15 @@ class Se extends N {
|
|
|
595
629
|
tableData: this.tableData,
|
|
596
630
|
// @ts-ignore
|
|
597
631
|
key: this.key,
|
|
598
|
-
|
|
632
|
+
// @ts-ignore
|
|
633
|
+
items: this.rows,
|
|
599
634
|
// @ts-ignore
|
|
600
635
|
selectRow: this.selectRow.bind(this),
|
|
601
636
|
// @ts-ignore
|
|
602
|
-
rowItem: this.rowItem
|
|
637
|
+
rowItem: this.rowItem,
|
|
638
|
+
// @ts-ignore
|
|
639
|
+
skeleton: this.skeleton,
|
|
640
|
+
columnCount: s
|
|
603
641
|
})
|
|
604
642
|
])
|
|
605
643
|
])
|
|
@@ -614,7 +652,7 @@ class Se extends N {
|
|
|
614
652
|
this.list.refresh();
|
|
615
653
|
}
|
|
616
654
|
}
|
|
617
|
-
const
|
|
655
|
+
const wt = d((t) => new Ce(
|
|
618
656
|
{
|
|
619
657
|
cache: t.cache ?? "list",
|
|
620
658
|
tableData: t.data,
|
|
@@ -628,47 +666,49 @@ const rt = d((t) => new Se(
|
|
|
628
666
|
rowItem: t.rowItem,
|
|
629
667
|
headers: t.headers,
|
|
630
668
|
customHeader: t.customHeader,
|
|
631
|
-
border: t.border
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
669
|
+
border: t.border,
|
|
670
|
+
emptyState: t.emptyState,
|
|
671
|
+
skeleton: t.skeleton
|
|
672
|
+
}
|
|
673
|
+
)), Le = d(({ name: t, email: e }) => o({ class: "min-w-0 flex-auto" }, [
|
|
674
|
+
v({ class: "text-base font-semibold leading-6 m-0" }, t),
|
|
675
|
+
v({ class: "truncate text-sm leading-5 text-muted-foreground m-0" }, e)
|
|
676
|
+
])), Ie = () => o({ class: "flex items-center gap-x-1.5" }, [
|
|
637
677
|
o({ class: "flex-none rounded-full bg-emerald-500/20 p-1" }, [
|
|
638
678
|
o({ class: "h-1.5 w-1.5 rounded-full bg-emerald-500" })
|
|
639
679
|
]),
|
|
640
|
-
|
|
641
|
-
]),
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
]), Te = (t, e) => t === "online" ?
|
|
645
|
-
|
|
680
|
+
v({ class: "text-xs leading-5 text-gray-500" }, "Online")
|
|
681
|
+
]), Be = (t) => v({ class: "text-xs leading-5 text-muted-foreground" }, [
|
|
682
|
+
L("Last seen "),
|
|
683
|
+
X({ datetime: t }, "3h ago")
|
|
684
|
+
]), Te = (t, e) => t === "online" ? Ie() : Be(e), Me = d(({ role: t, lastSeen: e, status: s }) => o({ class: "hidden shrink-0 sm:flex sm:flex-col sm:items-end" }, [
|
|
685
|
+
v({ class: "text-sm leading-6 m-0" }, t),
|
|
646
686
|
Te(s, e)
|
|
647
|
-
])),
|
|
687
|
+
])), Pe = (t) => t.split(" ").map((s) => s[0]).join(""), Re = d((t) => y({ class: "fadeIn flex justify-between gap-x-6 py-4 px-4 rounded-md hover:bg-muted/50" }, [
|
|
648
688
|
o({ class: "flex min-w-0 gap-x-4" }, [
|
|
649
|
-
|
|
650
|
-
|
|
689
|
+
le({ src: t.image, alt: t.name, fallbackText: Pe(t.name) }),
|
|
690
|
+
Le({ name: t.name, email: t.email })
|
|
651
691
|
]),
|
|
652
|
-
|
|
692
|
+
Me({
|
|
653
693
|
role: t.role,
|
|
654
694
|
lastSeen: t.lastSeen,
|
|
655
695
|
status: t.status
|
|
656
696
|
})
|
|
657
|
-
])),
|
|
697
|
+
])), yt = d((t) => new se({
|
|
658
698
|
cache: "list",
|
|
659
699
|
key: "name",
|
|
660
700
|
items: t.users,
|
|
661
701
|
role: "list",
|
|
662
702
|
class: "divide-y divide-border",
|
|
663
703
|
rowItem: Re
|
|
664
|
-
})),
|
|
704
|
+
})), Oe = (t, e) => e.includes(t), We = (t, e, s) => t.exact ? s === e : Oe(e, s), $e = ({ text: t, href: e, exact: s, hidden: a }) => new M({
|
|
665
705
|
text: t,
|
|
666
706
|
href: e,
|
|
667
707
|
exact: s,
|
|
668
708
|
dataSet: ["selected", ["state", !0, "active"]],
|
|
669
709
|
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`
|
|
670
710
|
});
|
|
671
|
-
class
|
|
711
|
+
class vt extends p {
|
|
672
712
|
/**
|
|
673
713
|
* This will declare the props for the compiler.
|
|
674
714
|
*
|
|
@@ -689,14 +729,14 @@ class dt extends h {
|
|
|
689
729
|
* @returns {object}
|
|
690
730
|
*/
|
|
691
731
|
render() {
|
|
692
|
-
return
|
|
732
|
+
return m(
|
|
693
733
|
{ class: `flex items-center justify-center p-2 text-muted-foreground rounded-md ${this.class || ""}` },
|
|
694
734
|
[
|
|
695
|
-
|
|
696
|
-
class: "flex
|
|
735
|
+
f({
|
|
736
|
+
class: "flex gap-x-4",
|
|
697
737
|
map: [this.options, (e) => this.addLink(e)],
|
|
698
738
|
watch: {
|
|
699
|
-
value: ["[[path]]",
|
|
739
|
+
value: ["[[path]]", x.data],
|
|
700
740
|
callBack: this.updateLinks.bind(this)
|
|
701
741
|
}
|
|
702
742
|
})
|
|
@@ -709,7 +749,7 @@ class dt extends h {
|
|
|
709
749
|
* @returns {void}
|
|
710
750
|
*/
|
|
711
751
|
afterSetup() {
|
|
712
|
-
const e =
|
|
752
|
+
const e = x.data.path;
|
|
713
753
|
this.updateLinks(e);
|
|
714
754
|
}
|
|
715
755
|
/**
|
|
@@ -724,7 +764,7 @@ class dt extends h {
|
|
|
724
764
|
for (const a of this.links) {
|
|
725
765
|
if (!a.rendered)
|
|
726
766
|
continue;
|
|
727
|
-
|
|
767
|
+
We(a, a.getLinkPath(), e) ? (this.updateLink(a, !0), s = !0) : this.updateLink(a, !1);
|
|
728
768
|
}
|
|
729
769
|
!s && this.links[0] && this.updateLink(this.links[0], !0);
|
|
730
770
|
}
|
|
@@ -754,7 +794,7 @@ class dt extends h {
|
|
|
754
794
|
* @returns {object}
|
|
755
795
|
*/
|
|
756
796
|
addLink({ label: e, href: s, exact: a, hidden: i }) {
|
|
757
|
-
const n =
|
|
797
|
+
const n = $e({ text: e, href: s, exact: a, hidden: i });
|
|
758
798
|
return this.links.push(n), n;
|
|
759
799
|
}
|
|
760
800
|
/**
|
|
@@ -766,13 +806,13 @@ class dt extends h {
|
|
|
766
806
|
this.links = [];
|
|
767
807
|
}
|
|
768
808
|
}
|
|
769
|
-
const
|
|
809
|
+
const Dt = d((t) => {
|
|
770
810
|
const e = t.margin || "m-4 ml-0";
|
|
771
811
|
return t.allowHistory = t.allowHistory === !0, o({ class: `flex-none ${e}` }, [
|
|
772
|
-
|
|
812
|
+
P({ variant: "back", class: "ghost", ...t })
|
|
773
813
|
]);
|
|
774
814
|
});
|
|
775
|
-
class
|
|
815
|
+
class A extends p {
|
|
776
816
|
/**
|
|
777
817
|
* This will declare the props for the compiler.
|
|
778
818
|
*
|
|
@@ -805,7 +845,11 @@ class j extends h {
|
|
|
805
845
|
* @returns {string}
|
|
806
846
|
*/
|
|
807
847
|
getClassName() {
|
|
808
|
-
return
|
|
848
|
+
return `absolute overlay left-0 top-0 right-0 z-20
|
|
849
|
+
h-svh max-h-svh min-h-svh
|
|
850
|
+
bg-background pointer-events-auto
|
|
851
|
+
lg:left-16
|
|
852
|
+
pb-[calc(env(safe-area-inset-bottom)+56px)] will-change-contents ${this.class || ""}`;
|
|
809
853
|
}
|
|
810
854
|
/**
|
|
811
855
|
* This will setup and render the component.
|
|
@@ -848,7 +892,7 @@ class j extends h {
|
|
|
848
892
|
* @returns {object}
|
|
849
893
|
*/
|
|
850
894
|
addBody() {
|
|
851
|
-
return o({ class: "body fadeIn flex flex-auto flex-col" }, this.getContents());
|
|
895
|
+
return o({ class: "body fadeIn flex flex-auto flex-col bg-background" }, this.getContents());
|
|
852
896
|
}
|
|
853
897
|
/**
|
|
854
898
|
* This will get the body contents.
|
|
@@ -859,13 +903,13 @@ class j extends h {
|
|
|
859
903
|
return this.children;
|
|
860
904
|
}
|
|
861
905
|
}
|
|
862
|
-
|
|
906
|
+
U.addType("dockableOverlay", (t) => {
|
|
863
907
|
if (!t)
|
|
864
908
|
return;
|
|
865
909
|
const e = t.component;
|
|
866
910
|
e && e.rendered === !0 && e.state.docked === !1 && e.destroy();
|
|
867
911
|
});
|
|
868
|
-
class
|
|
912
|
+
class St extends A {
|
|
869
913
|
/**
|
|
870
914
|
* This will stop presistence.
|
|
871
915
|
*
|
|
@@ -888,7 +932,7 @@ class ut extends j {
|
|
|
888
932
|
loading: !0
|
|
889
933
|
}],
|
|
890
934
|
["docked", (s, a) => {
|
|
891
|
-
s ? (a.className = this.getDockedClassName(), e.appendChild(a)
|
|
935
|
+
s ? (a.className = this.getDockedClassName(), e.appendChild(a)) : (a.className = this.getClassName(), app.root.appendChild(a));
|
|
892
936
|
}]
|
|
893
937
|
]
|
|
894
938
|
},
|
|
@@ -931,7 +975,7 @@ class ut extends j {
|
|
|
931
975
|
* @returns {void}
|
|
932
976
|
*/
|
|
933
977
|
afterSetup() {
|
|
934
|
-
|
|
978
|
+
U.add(
|
|
935
979
|
this.container,
|
|
936
980
|
"dockableOverlay",
|
|
937
981
|
{
|
|
@@ -965,16 +1009,8 @@ class ut extends j {
|
|
|
965
1009
|
onResize() {
|
|
966
1010
|
this.state.docked = this.canDock();
|
|
967
1011
|
}
|
|
968
|
-
/**
|
|
969
|
-
* This will resume scrolling when the overlay is being removed.
|
|
970
|
-
*
|
|
971
|
-
* @returns {void}
|
|
972
|
-
*/
|
|
973
|
-
beforeDestroy() {
|
|
974
|
-
document.documentElement.style.overflowY = "auto";
|
|
975
|
-
}
|
|
976
1012
|
}
|
|
977
|
-
class
|
|
1013
|
+
class Ct extends A {
|
|
978
1014
|
/**
|
|
979
1015
|
* This will get the overlay type.
|
|
980
1016
|
*
|
|
@@ -993,7 +1029,7 @@ class ft extends j {
|
|
|
993
1029
|
this.container = e, this.initialize();
|
|
994
1030
|
}
|
|
995
1031
|
}
|
|
996
|
-
const ze = d(({ index: t, click: e, state: s }, a) =>
|
|
1032
|
+
const ze = d(({ index: t, click: e, state: s }, a) => y({
|
|
997
1033
|
class: "p-2 cursor-pointer hover:bg-muted/50",
|
|
998
1034
|
onState: [
|
|
999
1035
|
[s, "selectedIndex", {
|
|
@@ -1002,37 +1038,42 @@ const ze = d(({ index: t, click: e, state: s }, a) => D({
|
|
|
1002
1038
|
}]
|
|
1003
1039
|
],
|
|
1004
1040
|
click: () => e(t)
|
|
1005
|
-
}, a)),
|
|
1041
|
+
}, a)), Ne = d(({ selectOption: t, state: e }) => f({
|
|
1006
1042
|
class: "border rounded-md list-none m-0 p-0 max-h-[400px] overflow-y-auto",
|
|
1007
1043
|
for: ["filteredOptions", (s, a) => ze({ index: a, click: t, state: e }, s.label)]
|
|
1008
|
-
})),
|
|
1009
|
-
|
|
1044
|
+
})), Ue = d((t) => o({ class: "relative flex items-center" }, [
|
|
1045
|
+
ne({
|
|
1010
1046
|
cache: "input",
|
|
1047
|
+
class: t.class ?? "",
|
|
1011
1048
|
placeholder: t.placeholder ?? "Search...",
|
|
1012
|
-
bind: [t.state, "searchQuery"],
|
|
1049
|
+
bind: t.bind ?? [t.state, "searchQuery"],
|
|
1013
1050
|
keyup: (e, s) => {
|
|
1014
|
-
s.state.open = !
|
|
1051
|
+
s.state && (s.state.open = !1), typeof t.filterOptions == "function" && t.filterOptions(), s.dropdown && s.dropdown.updatePosition(), t.keyup && t.keyup(e, s);
|
|
1052
|
+
},
|
|
1053
|
+
pointerup: (e, s) => {
|
|
1054
|
+
typeof s.toggleDropdown == "function" && s.toggleDropdown();
|
|
1015
1055
|
},
|
|
1016
|
-
|
|
1017
|
-
|
|
1056
|
+
keydown: (e) => [
|
|
1057
|
+
typeof t.handleKeyDown == "function" && t.handleKeyDown(e)
|
|
1058
|
+
]
|
|
1018
1059
|
}),
|
|
1019
|
-
t.icon && o({ class: "absolute right-0 mr-2" }, [
|
|
1020
|
-
|
|
1060
|
+
t.icon && o({ class: "absolute flex right-0 mr-2" }, [
|
|
1061
|
+
J(t.icon)
|
|
1021
1062
|
])
|
|
1022
1063
|
])), je = (t) => o({
|
|
1023
1064
|
class: "relative flex fle-auto flex-col",
|
|
1024
1065
|
onState: ["open", (e, s, a) => {
|
|
1025
1066
|
if (e)
|
|
1026
|
-
return new
|
|
1067
|
+
return new re({
|
|
1027
1068
|
cache: "dropdown",
|
|
1028
1069
|
parent: a,
|
|
1029
1070
|
button: a.input,
|
|
1030
1071
|
size: "xl"
|
|
1031
1072
|
}, [
|
|
1032
|
-
|
|
1073
|
+
Ne(t)
|
|
1033
1074
|
]);
|
|
1034
1075
|
}]
|
|
1035
|
-
}),
|
|
1076
|
+
}), Lt = _(
|
|
1036
1077
|
{
|
|
1037
1078
|
/**
|
|
1038
1079
|
* This will set up the data object.
|
|
@@ -1041,7 +1082,7 @@ const ze = d(({ index: t, click: e, state: s }, a) => D({
|
|
|
1041
1082
|
*/
|
|
1042
1083
|
setData() {
|
|
1043
1084
|
const t = this.options || [];
|
|
1044
|
-
return new
|
|
1085
|
+
return new T({
|
|
1045
1086
|
options: t,
|
|
1046
1087
|
filteredOptions: t
|
|
1047
1088
|
});
|
|
@@ -1129,7 +1170,7 @@ const ze = d(({ index: t, click: e, state: s }, a) => D({
|
|
|
1129
1170
|
*/
|
|
1130
1171
|
render() {
|
|
1131
1172
|
return o({ class: "relative w-full max-w-md" }, [
|
|
1132
|
-
|
|
1173
|
+
Ue({
|
|
1133
1174
|
// @ts-ignore
|
|
1134
1175
|
state: this.state,
|
|
1135
1176
|
// @ts-ignore
|
|
@@ -1152,22 +1193,22 @@ const ze = d(({ index: t, click: e, state: s }, a) => D({
|
|
|
1152
1193
|
]);
|
|
1153
1194
|
}
|
|
1154
1195
|
}
|
|
1155
|
-
), Ae = (t) =>
|
|
1196
|
+
), Ae = (t) => y(
|
|
1156
1197
|
{
|
|
1157
1198
|
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",
|
|
1158
|
-
|
|
1199
|
+
dataStateSet: ["selected", ["state", t.value, "active"]]
|
|
1159
1200
|
},
|
|
1160
1201
|
[
|
|
1161
|
-
|
|
1202
|
+
w({
|
|
1162
1203
|
class: "flex flex-auto justify-center items-center px-3 py-1.5 rounded-md",
|
|
1163
|
-
|
|
1204
|
+
onState: ["selected", { selected: t.value }],
|
|
1164
1205
|
click: (e) => t.callBack(t.value)
|
|
1165
1206
|
}, t.label)
|
|
1166
1207
|
]
|
|
1167
|
-
),
|
|
1168
|
-
|
|
1208
|
+
), He = (t, e) => (t.callBack = e, Ae(t)), Fe = (t) => m({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${t.class}` }, [
|
|
1209
|
+
f({ class: "flex flex-auto flex-row", map: [t.options, (e) => He(e, t.callBack)] })
|
|
1169
1210
|
]);
|
|
1170
|
-
class
|
|
1211
|
+
class It extends g {
|
|
1171
1212
|
/**
|
|
1172
1213
|
* This will declare the props for the compiler.
|
|
1173
1214
|
*
|
|
@@ -1184,12 +1225,12 @@ class mt extends h {
|
|
|
1184
1225
|
render() {
|
|
1185
1226
|
const e = this.select.bind(this);
|
|
1186
1227
|
return o({ class: "" }, [
|
|
1187
|
-
|
|
1228
|
+
Fe({
|
|
1188
1229
|
class: this.class,
|
|
1189
1230
|
options: this.options,
|
|
1190
1231
|
callBack: e
|
|
1191
1232
|
}),
|
|
1192
|
-
|
|
1233
|
+
I({
|
|
1193
1234
|
class: "tab-content",
|
|
1194
1235
|
onState: ["selected", this.updateContent.bind(this)]
|
|
1195
1236
|
})
|
|
@@ -1201,8 +1242,7 @@ class mt extends h {
|
|
|
1201
1242
|
* @returns {*}
|
|
1202
1243
|
*/
|
|
1203
1244
|
getFirstValue() {
|
|
1204
|
-
|
|
1205
|
-
return (e = this.options[0]) == null ? void 0 : e.value;
|
|
1245
|
+
return this.options[0]?.value;
|
|
1206
1246
|
}
|
|
1207
1247
|
/**
|
|
1208
1248
|
* This will update the component.
|
|
@@ -1255,23 +1295,23 @@ class mt extends h {
|
|
|
1255
1295
|
};
|
|
1256
1296
|
}
|
|
1257
1297
|
}
|
|
1258
|
-
const
|
|
1298
|
+
const Ye = (t) => y(
|
|
1259
1299
|
{
|
|
1260
1300
|
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",
|
|
1261
|
-
|
|
1301
|
+
dataStateSet: ["selected", ["state", t.value, "active"]]
|
|
1262
1302
|
},
|
|
1263
1303
|
[
|
|
1264
|
-
|
|
1304
|
+
w({
|
|
1265
1305
|
class: "flex flex-auto justify-center items-center px-3 py-1.5 rounded-md disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1266
|
-
|
|
1306
|
+
onState: ["selected", { selected: t.value }],
|
|
1267
1307
|
click: (e) => t.callBack(t.value),
|
|
1268
1308
|
disabled: t.disabled
|
|
1269
1309
|
}, t.label)
|
|
1270
1310
|
]
|
|
1271
|
-
),
|
|
1272
|
-
|
|
1311
|
+
), Ee = (t, e) => (t.callBack = e, Ye(t)), Qe = (t) => m({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${t.class}` }, [
|
|
1312
|
+
f({ class: "flex flex-auto flex-row", map: [t.options, (e) => Ee(e, t.callBack)] })
|
|
1273
1313
|
]);
|
|
1274
|
-
class
|
|
1314
|
+
class Bt extends g {
|
|
1275
1315
|
/**
|
|
1276
1316
|
* This will declare the props for the compiler.
|
|
1277
1317
|
*
|
|
@@ -1287,7 +1327,7 @@ class pt extends h {
|
|
|
1287
1327
|
*/
|
|
1288
1328
|
render() {
|
|
1289
1329
|
const e = this.select.bind(this);
|
|
1290
|
-
return
|
|
1330
|
+
return Qe({
|
|
1291
1331
|
class: this.class,
|
|
1292
1332
|
options: this.options,
|
|
1293
1333
|
callBack: e
|
|
@@ -1308,23 +1348,22 @@ class pt extends h {
|
|
|
1308
1348
|
* @returns {object}
|
|
1309
1349
|
*/
|
|
1310
1350
|
setupStates() {
|
|
1311
|
-
var e;
|
|
1312
1351
|
return {
|
|
1313
|
-
selected:
|
|
1352
|
+
selected: this.options[0]?.value || null
|
|
1314
1353
|
};
|
|
1315
1354
|
}
|
|
1316
1355
|
}
|
|
1317
|
-
const
|
|
1356
|
+
const Ve = (t, e) => new RegExp(`${t}($|/|\\.).*`).test(e), Ge = (t, e) => {
|
|
1318
1357
|
const s = t.getLinkPath();
|
|
1319
|
-
return t.exact ? e === s :
|
|
1320
|
-
},
|
|
1358
|
+
return t.exact ? e === s : Ve(s, e);
|
|
1359
|
+
}, Xe = ({ text: t, href: e, exact: s }) => new M({
|
|
1321
1360
|
text: t,
|
|
1322
1361
|
href: e,
|
|
1323
1362
|
exact: s,
|
|
1324
1363
|
dataSet: ["selected", ["state", !0, "active"]],
|
|
1325
1364
|
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"
|
|
1326
1365
|
});
|
|
1327
|
-
class
|
|
1366
|
+
class qe extends g {
|
|
1328
1367
|
/**
|
|
1329
1368
|
* This will declare the props for the compiler.
|
|
1330
1369
|
*
|
|
@@ -1345,12 +1384,12 @@ class Ke extends h {
|
|
|
1345
1384
|
* @returns {object}
|
|
1346
1385
|
*/
|
|
1347
1386
|
render() {
|
|
1348
|
-
return
|
|
1349
|
-
|
|
1387
|
+
return m({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${this.class}` }, [
|
|
1388
|
+
f({
|
|
1350
1389
|
class: "flex flex-auto flex-row",
|
|
1351
1390
|
map: [this.options, (e) => this.addLink(e)],
|
|
1352
1391
|
watch: {
|
|
1353
|
-
value: ["[[path]]",
|
|
1392
|
+
value: ["[[path]]", x.data],
|
|
1354
1393
|
callBack: this.updateLinks.bind(this)
|
|
1355
1394
|
}
|
|
1356
1395
|
})
|
|
@@ -1362,7 +1401,7 @@ class Ke extends h {
|
|
|
1362
1401
|
* @returns {void}
|
|
1363
1402
|
*/
|
|
1364
1403
|
afterSetup() {
|
|
1365
|
-
const e =
|
|
1404
|
+
const e = x.data.path;
|
|
1366
1405
|
this.updateLinks(e);
|
|
1367
1406
|
}
|
|
1368
1407
|
/**
|
|
@@ -1375,7 +1414,7 @@ class Ke extends h {
|
|
|
1375
1414
|
let s = !1, a = this.links[0];
|
|
1376
1415
|
this.deactivateAllLinks();
|
|
1377
1416
|
for (const i of this.links)
|
|
1378
|
-
if (i.rendered !== !1 && (s =
|
|
1417
|
+
if (i.rendered !== !1 && (s = Ge(i, e), s === !0)) {
|
|
1379
1418
|
this.updateLink(i, !0);
|
|
1380
1419
|
break;
|
|
1381
1420
|
}
|
|
@@ -1407,7 +1446,7 @@ class Ke extends h {
|
|
|
1407
1446
|
* @returns {object}
|
|
1408
1447
|
*/
|
|
1409
1448
|
addLink({ label: e, href: s, exact: a }) {
|
|
1410
|
-
const i =
|
|
1449
|
+
const i = Xe({ text: e, href: s, exact: a });
|
|
1411
1450
|
return this.links.push(i), i;
|
|
1412
1451
|
}
|
|
1413
1452
|
/**
|
|
@@ -1419,7 +1458,7 @@ class Ke extends h {
|
|
|
1419
1458
|
this.links = [];
|
|
1420
1459
|
}
|
|
1421
1460
|
}
|
|
1422
|
-
class
|
|
1461
|
+
class Tt extends g {
|
|
1423
1462
|
/**
|
|
1424
1463
|
* This will declare the props for the compiler.
|
|
1425
1464
|
*
|
|
@@ -1435,11 +1474,11 @@ class bt extends h {
|
|
|
1435
1474
|
*/
|
|
1436
1475
|
render() {
|
|
1437
1476
|
return o({ class: "tab-panel" }, [
|
|
1438
|
-
new
|
|
1477
|
+
new qe({
|
|
1439
1478
|
class: this.class,
|
|
1440
1479
|
options: this.options
|
|
1441
1480
|
}),
|
|
1442
|
-
|
|
1481
|
+
I({
|
|
1443
1482
|
class: "tab-content",
|
|
1444
1483
|
switch: this.addGroup()
|
|
1445
1484
|
})
|
|
@@ -1465,7 +1504,309 @@ class bt extends h {
|
|
|
1465
1504
|
return s;
|
|
1466
1505
|
}
|
|
1467
1506
|
}
|
|
1468
|
-
|
|
1507
|
+
const Ke = (t) => y(
|
|
1508
|
+
{
|
|
1509
|
+
class: "relative inline-flex items-center justify-center whitespace-nowrap text-sm font-medium text-muted-foreground transition-colors hover:text-foreground 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]:text-foreground after:absolute after:bottom-0 after:left-0 after:right-0 after:h-0.5 after:bg-primary after:transition-all after:duration-200 after:scale-x-0 data-[state=active]:after:scale-x-100",
|
|
1510
|
+
dataStateSet: ["selected", ["state", t.value, "active"]]
|
|
1511
|
+
},
|
|
1512
|
+
[
|
|
1513
|
+
w({
|
|
1514
|
+
class: "flex flex-auto justify-center items-center px-4 py-3 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1515
|
+
onState: ["selected", { selected: t.value }],
|
|
1516
|
+
click: (e) => t.callBack(t.value)
|
|
1517
|
+
}, t.label)
|
|
1518
|
+
]
|
|
1519
|
+
), _e = (t, e) => (t.callBack = e, Ke(t)), Je = (t) => m({ class: `border-b border-border ${t.class}` }, [
|
|
1520
|
+
f({ class: "flex flex-row items-center", map: [t.options, (e) => _e(e, t.callBack)] })
|
|
1521
|
+
]);
|
|
1522
|
+
class Mt extends g {
|
|
1523
|
+
/**
|
|
1524
|
+
* This will declare the props for the compiler.
|
|
1525
|
+
*
|
|
1526
|
+
* @returns {void}
|
|
1527
|
+
*/
|
|
1528
|
+
declareProps() {
|
|
1529
|
+
this.options = [], this.class = "", this.onSelect = null;
|
|
1530
|
+
}
|
|
1531
|
+
/**
|
|
1532
|
+
* This will render the component.
|
|
1533
|
+
*
|
|
1534
|
+
* @returns {object}
|
|
1535
|
+
*/
|
|
1536
|
+
render() {
|
|
1537
|
+
const e = this.select.bind(this);
|
|
1538
|
+
return o({ class: "underlined-button-tab-panel" }, [
|
|
1539
|
+
Je({
|
|
1540
|
+
class: this.class,
|
|
1541
|
+
options: this.options,
|
|
1542
|
+
callBack: e
|
|
1543
|
+
}),
|
|
1544
|
+
I({
|
|
1545
|
+
class: "tab-content pt-6",
|
|
1546
|
+
onState: ["selected", this.updateContent.bind(this)]
|
|
1547
|
+
})
|
|
1548
|
+
]);
|
|
1549
|
+
}
|
|
1550
|
+
/**
|
|
1551
|
+
* This will get the first value.
|
|
1552
|
+
*
|
|
1553
|
+
* @returns {*}
|
|
1554
|
+
*/
|
|
1555
|
+
getFirstValue() {
|
|
1556
|
+
return this.options[0]?.value;
|
|
1557
|
+
}
|
|
1558
|
+
/**
|
|
1559
|
+
* This will select an option.
|
|
1560
|
+
*
|
|
1561
|
+
* @param {*} value
|
|
1562
|
+
* @returns {void}
|
|
1563
|
+
*/
|
|
1564
|
+
select(e) {
|
|
1565
|
+
this.state.selected = e;
|
|
1566
|
+
}
|
|
1567
|
+
/**
|
|
1568
|
+
* This will update the content.
|
|
1569
|
+
*
|
|
1570
|
+
* @param {*} value
|
|
1571
|
+
* @returns {object}
|
|
1572
|
+
*/
|
|
1573
|
+
updateContent(e) {
|
|
1574
|
+
const s = this.options;
|
|
1575
|
+
if (!s || s.length < 1)
|
|
1576
|
+
return;
|
|
1577
|
+
const a = s[0];
|
|
1578
|
+
for (const i of s)
|
|
1579
|
+
if (i.value === e)
|
|
1580
|
+
return i.component;
|
|
1581
|
+
return a.component;
|
|
1582
|
+
}
|
|
1583
|
+
/**
|
|
1584
|
+
* This will setup the states.
|
|
1585
|
+
*
|
|
1586
|
+
* @returns {object}
|
|
1587
|
+
*/
|
|
1588
|
+
setupStates() {
|
|
1589
|
+
const e = this.onSelect, s = typeof e;
|
|
1590
|
+
return {
|
|
1591
|
+
selected: {
|
|
1592
|
+
state: this.getFirstValue(),
|
|
1593
|
+
callBack(a) {
|
|
1594
|
+
s === "function" && e(a);
|
|
1595
|
+
}
|
|
1596
|
+
}
|
|
1597
|
+
};
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
const Ze = (t) => y(
|
|
1601
|
+
{
|
|
1602
|
+
class: "relative inline-flex items-center justify-center whitespace-nowrap text-sm font-medium text-muted-foreground transition-colors hover:text-foreground 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]:text-foreground after:absolute after:bottom-0 after:left-0 after:right-0 after:h-0.5 after:bg-primary after:transition-all after:duration-200 after:scale-x-0 data-[state=active]:after:scale-x-100",
|
|
1603
|
+
dataStateSet: ["selected", ["state", t.value, "active"]]
|
|
1604
|
+
},
|
|
1605
|
+
[
|
|
1606
|
+
w({
|
|
1607
|
+
class: "flex flex-auto justify-center items-center px-4 py-3 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",
|
|
1608
|
+
onState: ["selected", { selected: t.value }],
|
|
1609
|
+
click: (e) => t.callBack(t.value),
|
|
1610
|
+
disabled: t.disabled
|
|
1611
|
+
}, t.label)
|
|
1612
|
+
]
|
|
1613
|
+
), et = (t, e) => (t.callBack = e, Ze(t)), tt = (t) => m({ class: `border-b border-border ${t.class}` }, [
|
|
1614
|
+
f({ class: "flex flex-row items-center", map: [t.options, (e) => et(e, t.callBack)] })
|
|
1615
|
+
]);
|
|
1616
|
+
class Pt extends g {
|
|
1617
|
+
/**
|
|
1618
|
+
* This will declare the props for the compiler.
|
|
1619
|
+
*
|
|
1620
|
+
* @returns {void}
|
|
1621
|
+
*/
|
|
1622
|
+
declareProps() {
|
|
1623
|
+
this.options = [], this.class = "", this.onSelect = null;
|
|
1624
|
+
}
|
|
1625
|
+
/**
|
|
1626
|
+
* This will render the component.
|
|
1627
|
+
*
|
|
1628
|
+
* @returns {object}
|
|
1629
|
+
*/
|
|
1630
|
+
render() {
|
|
1631
|
+
const e = this.select.bind(this);
|
|
1632
|
+
return tt({
|
|
1633
|
+
class: this.class,
|
|
1634
|
+
options: this.options,
|
|
1635
|
+
callBack: e
|
|
1636
|
+
});
|
|
1637
|
+
}
|
|
1638
|
+
/**
|
|
1639
|
+
* This will select an option.
|
|
1640
|
+
*
|
|
1641
|
+
* @param {*} value
|
|
1642
|
+
* @returns {void}
|
|
1643
|
+
*/
|
|
1644
|
+
select(e) {
|
|
1645
|
+
this.state.selected = e, typeof this.onSelect == "function" && this.onSelect(e, this.parent);
|
|
1646
|
+
}
|
|
1647
|
+
/**
|
|
1648
|
+
* This will setup the states.
|
|
1649
|
+
*
|
|
1650
|
+
* @returns {object}
|
|
1651
|
+
*/
|
|
1652
|
+
setupStates() {
|
|
1653
|
+
return {
|
|
1654
|
+
selected: this.options[0]?.value || null
|
|
1655
|
+
};
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
const st = (t, e) => new RegExp(`${t}($|/|\\.).*`).test(e), at = (t, e) => {
|
|
1659
|
+
const s = t.getLinkPath();
|
|
1660
|
+
return t.exact ? e === s : st(s, e);
|
|
1661
|
+
}, it = ({ text: t, href: e, exact: s }) => new M({
|
|
1662
|
+
text: t,
|
|
1663
|
+
href: e,
|
|
1664
|
+
exact: s,
|
|
1665
|
+
dataSet: ["selected", ["state", !0, "active"]],
|
|
1666
|
+
class: "relative inline-flex items-center justify-center whitespace-nowrap px-4 py-3 text-sm font-medium text-muted-foreground transition-colors hover:text-foreground 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]:text-foreground after:absolute after:bottom-0 after:left-0 after:right-0 after:h-0.5 after:bg-primary after:transition-all after:duration-200 after:scale-x-0 data-[state=active]:after:scale-x-100"
|
|
1667
|
+
});
|
|
1668
|
+
class nt extends g {
|
|
1669
|
+
/**
|
|
1670
|
+
* This will declare the props for the compiler.
|
|
1671
|
+
*
|
|
1672
|
+
* @returns {void}
|
|
1673
|
+
*/
|
|
1674
|
+
declareProps() {
|
|
1675
|
+
this.options = [], this.class = "", this.onSelect = null;
|
|
1676
|
+
}
|
|
1677
|
+
/**
|
|
1678
|
+
* This will configure the links.
|
|
1679
|
+
*/
|
|
1680
|
+
beforeSetup() {
|
|
1681
|
+
this.links = [];
|
|
1682
|
+
}
|
|
1683
|
+
/**
|
|
1684
|
+
* This will render the component.
|
|
1685
|
+
*
|
|
1686
|
+
* @returns {object}
|
|
1687
|
+
*/
|
|
1688
|
+
render() {
|
|
1689
|
+
return m({ class: `border-b border-border ${this.class}` }, [
|
|
1690
|
+
f({
|
|
1691
|
+
class: "flex flex-row items-center",
|
|
1692
|
+
map: [this.options, (e) => this.addLink(e)],
|
|
1693
|
+
watch: {
|
|
1694
|
+
value: ["[[path]]", x.data],
|
|
1695
|
+
callBack: this.updateLinks.bind(this)
|
|
1696
|
+
}
|
|
1697
|
+
})
|
|
1698
|
+
]);
|
|
1699
|
+
}
|
|
1700
|
+
/**
|
|
1701
|
+
* This will update the links.
|
|
1702
|
+
*
|
|
1703
|
+
* @returns {void}
|
|
1704
|
+
*/
|
|
1705
|
+
afterSetup() {
|
|
1706
|
+
const e = x.data.path;
|
|
1707
|
+
this.updateLinks(e);
|
|
1708
|
+
}
|
|
1709
|
+
/**
|
|
1710
|
+
* This will update the links.
|
|
1711
|
+
*
|
|
1712
|
+
* @param {string} value
|
|
1713
|
+
* @returns {void}
|
|
1714
|
+
*/
|
|
1715
|
+
updateLinks(e) {
|
|
1716
|
+
let s = !1, a = this.links[0];
|
|
1717
|
+
this.deactivateAllLinks();
|
|
1718
|
+
for (const i of this.links)
|
|
1719
|
+
if (i.rendered !== !1 && (s = at(i, e), s === !0)) {
|
|
1720
|
+
this.updateLink(i, !0);
|
|
1721
|
+
break;
|
|
1722
|
+
}
|
|
1723
|
+
s !== !0 && a && this.updateLink(a, !0);
|
|
1724
|
+
}
|
|
1725
|
+
/**
|
|
1726
|
+
* This will deactivate all links.
|
|
1727
|
+
*
|
|
1728
|
+
* @returns {void}
|
|
1729
|
+
*/
|
|
1730
|
+
deactivateAllLinks() {
|
|
1731
|
+
for (const e of this.links)
|
|
1732
|
+
this.updateLink(e, !1);
|
|
1733
|
+
}
|
|
1734
|
+
/**
|
|
1735
|
+
* This will update the link.
|
|
1736
|
+
*
|
|
1737
|
+
* @param {object} link
|
|
1738
|
+
* @param {boolean} selected
|
|
1739
|
+
* @returns {void}
|
|
1740
|
+
*/
|
|
1741
|
+
updateLink(e, s) {
|
|
1742
|
+
e.update(s);
|
|
1743
|
+
}
|
|
1744
|
+
/**
|
|
1745
|
+
* This will add a link.
|
|
1746
|
+
*
|
|
1747
|
+
* @param {object} option
|
|
1748
|
+
* @returns {object}
|
|
1749
|
+
*/
|
|
1750
|
+
addLink({ label: e, href: s, exact: a }) {
|
|
1751
|
+
const i = it({ text: e, href: s, exact: a });
|
|
1752
|
+
return this.links.push(i), i;
|
|
1753
|
+
}
|
|
1754
|
+
/**
|
|
1755
|
+
* This will remove all the links.
|
|
1756
|
+
*
|
|
1757
|
+
* @returns {void}
|
|
1758
|
+
*/
|
|
1759
|
+
beforeDestroy() {
|
|
1760
|
+
this.links = [];
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
class Rt extends g {
|
|
1764
|
+
/**
|
|
1765
|
+
* This will declare the props for the compiler.
|
|
1766
|
+
*
|
|
1767
|
+
* @returns {void}
|
|
1768
|
+
*/
|
|
1769
|
+
declareProps() {
|
|
1770
|
+
this.options = [], this.class = "";
|
|
1771
|
+
}
|
|
1772
|
+
/**
|
|
1773
|
+
* This will render the component.
|
|
1774
|
+
*
|
|
1775
|
+
* @returns {object}
|
|
1776
|
+
*/
|
|
1777
|
+
render() {
|
|
1778
|
+
return o({ class: "underlined-tab-panel flex flex-auto flex-col" }, [
|
|
1779
|
+
new nt({
|
|
1780
|
+
class: this.class,
|
|
1781
|
+
options: this.options
|
|
1782
|
+
}),
|
|
1783
|
+
I({
|
|
1784
|
+
class: "tab-content pt-6 flex flex-auto flex-col",
|
|
1785
|
+
switch: this.addGroup()
|
|
1786
|
+
})
|
|
1787
|
+
]);
|
|
1788
|
+
}
|
|
1789
|
+
/**
|
|
1790
|
+
* This will add the group.
|
|
1791
|
+
*
|
|
1792
|
+
* @returns {array}
|
|
1793
|
+
*/
|
|
1794
|
+
addGroup() {
|
|
1795
|
+
let e;
|
|
1796
|
+
const s = [], a = this.options;
|
|
1797
|
+
for (let i = 0, n = a.length; i < n; i++)
|
|
1798
|
+
e = a[i], s.push(
|
|
1799
|
+
{
|
|
1800
|
+
uri: e.uri || e.href,
|
|
1801
|
+
component: e.component,
|
|
1802
|
+
title: e.title || null,
|
|
1803
|
+
persist: !0
|
|
1804
|
+
}
|
|
1805
|
+
);
|
|
1806
|
+
return s;
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
class ot extends p {
|
|
1469
1810
|
/**
|
|
1470
1811
|
* Runs before rendering, sets up defaults, a timer for drawing,
|
|
1471
1812
|
* and basic canvas properties.
|
|
@@ -1475,7 +1816,7 @@ class Ge extends h {
|
|
|
1475
1816
|
onCreated() {
|
|
1476
1817
|
this.lineWidth = this.lineWidth || 3, this.lineColor = this.lineColor || "#000000", this.canvas = null, this.ctx = null, this.status = "stopped";
|
|
1477
1818
|
const e = 1e3 / 60;
|
|
1478
|
-
this.timer = new
|
|
1819
|
+
this.timer = new ae(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";
|
|
1479
1820
|
}
|
|
1480
1821
|
/**
|
|
1481
1822
|
* Renders a <canvas> element.
|
|
@@ -1483,7 +1824,7 @@ class Ge extends h {
|
|
|
1483
1824
|
* @returns {object} Layout definition for the canvas.
|
|
1484
1825
|
*/
|
|
1485
1826
|
render() {
|
|
1486
|
-
return
|
|
1827
|
+
return q({
|
|
1487
1828
|
style: "touch-action: none; -webkit-user-select: none; -webkit-touch-callout: none;"
|
|
1488
1829
|
});
|
|
1489
1830
|
}
|
|
@@ -1532,12 +1873,12 @@ class Ge extends h {
|
|
|
1532
1873
|
let s, a;
|
|
1533
1874
|
const i = this.canvas, n = i.width / parseInt(i.style.width), l = i.getBoundingClientRect();
|
|
1534
1875
|
if (e.touches && e.touches.length) {
|
|
1535
|
-
const
|
|
1536
|
-
s =
|
|
1876
|
+
const u = e.touches[0];
|
|
1877
|
+
s = u.clientX, a = u.clientY;
|
|
1537
1878
|
} else
|
|
1538
1879
|
s = e.x || e.clientX, a = e.y || e.clientY;
|
|
1539
|
-
const
|
|
1540
|
-
this.mouse.x =
|
|
1880
|
+
const c = parseInt((s - l.left) * n), r = parseInt((a - l.top) * n);
|
|
1881
|
+
this.mouse.x = c, this.mouse.y = r;
|
|
1541
1882
|
}
|
|
1542
1883
|
/**
|
|
1543
1884
|
* Called when the pointer goes down on the canvas.
|
|
@@ -1580,8 +1921,8 @@ class Ge extends h {
|
|
|
1580
1921
|
const { canvas: e, ctx: s } = this, a = e.toDataURL();
|
|
1581
1922
|
if (this.scale(), this.setupBackground(s), a !== "data:,") {
|
|
1582
1923
|
const i = new globalThis.Image();
|
|
1583
|
-
|
|
1584
|
-
s.drawImage(i, 0, 0),
|
|
1924
|
+
O.on("load", i, function n() {
|
|
1925
|
+
s.drawImage(i, 0, 0), O.off("load", i, n);
|
|
1585
1926
|
}), i.src = a;
|
|
1586
1927
|
}
|
|
1587
1928
|
this.draw();
|
|
@@ -1601,7 +1942,7 @@ class Ge extends h {
|
|
|
1601
1942
|
* @returns {void}
|
|
1602
1943
|
*/
|
|
1603
1944
|
noScaleResize() {
|
|
1604
|
-
const e =
|
|
1945
|
+
const e = W.getSize(container);
|
|
1605
1946
|
this.width = canvas.width = e.width, this.height = canvas.height = e.height;
|
|
1606
1947
|
}
|
|
1607
1948
|
/**
|
|
@@ -1611,13 +1952,13 @@ class Ge extends h {
|
|
|
1611
1952
|
* @returns {void}
|
|
1612
1953
|
*/
|
|
1613
1954
|
scale() {
|
|
1614
|
-
const e = this.canvas, s = this.container, a =
|
|
1615
|
-
let
|
|
1955
|
+
const e = this.canvas, s = this.container, a = W.getSize(s), i = this.targetSize, n = i.width, l = i.height;
|
|
1956
|
+
let c = n + "px", r = l + "px";
|
|
1616
1957
|
if (this.width = e.width = n, this.height = e.height = l, a.width !== 0 && a.height !== 0) {
|
|
1617
|
-
const
|
|
1618
|
-
|
|
1958
|
+
const u = a.width, b = a.height, h = u / n, k = b / l, D = Math.min(h, k);
|
|
1959
|
+
c = n * D + "px", r = l * D + "px";
|
|
1619
1960
|
}
|
|
1620
|
-
e.style.width =
|
|
1961
|
+
e.style.width = c, e.style.height = r;
|
|
1621
1962
|
}
|
|
1622
1963
|
/**
|
|
1623
1964
|
* Main drawing loop. If the mouse is down, adds a line
|
|
@@ -1691,7 +2032,7 @@ class Ge extends h {
|
|
|
1691
2032
|
this.timer.stop(), this.status = "stopped";
|
|
1692
2033
|
}
|
|
1693
2034
|
}
|
|
1694
|
-
class
|
|
2035
|
+
class Ot extends p {
|
|
1695
2036
|
/**
|
|
1696
2037
|
* Sets up default properties for the signature panel.
|
|
1697
2038
|
*
|
|
@@ -1708,19 +2049,19 @@ class wt extends h {
|
|
|
1708
2049
|
*/
|
|
1709
2050
|
render() {
|
|
1710
2051
|
return o({ class: "signature-panel relative flex flex-auto overflow-hidden select-none" }, [
|
|
1711
|
-
|
|
2052
|
+
oe({
|
|
1712
2053
|
cache: "hiddenInput",
|
|
1713
2054
|
required: !0,
|
|
1714
2055
|
bind: this.path + ".data"
|
|
1715
2056
|
}),
|
|
1716
2057
|
o({ class: "absolute top-2 right-2" }, [
|
|
1717
|
-
|
|
2058
|
+
P({
|
|
1718
2059
|
variant: "icon",
|
|
1719
|
-
icon:
|
|
2060
|
+
icon: S.circleX,
|
|
1720
2061
|
click: this.reset.bind(this)
|
|
1721
2062
|
})
|
|
1722
2063
|
]),
|
|
1723
|
-
new
|
|
2064
|
+
new ot({
|
|
1724
2065
|
cache: "canvasLayer",
|
|
1725
2066
|
margin: this.margin,
|
|
1726
2067
|
targetSize: this.targetSize,
|
|
@@ -1770,35 +2111,40 @@ class wt extends h {
|
|
|
1770
2111
|
}
|
|
1771
2112
|
}
|
|
1772
2113
|
export {
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
T,
|
|
2114
|
+
Dt as B,
|
|
2115
|
+
xe as C,
|
|
2116
|
+
ye as D,
|
|
2117
|
+
we as H,
|
|
2118
|
+
Ct as I,
|
|
2119
|
+
vt as N,
|
|
2120
|
+
A as O,
|
|
2121
|
+
mt as P,
|
|
2122
|
+
wt as S,
|
|
2123
|
+
R as T,
|
|
1783
2124
|
Re as U,
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
2125
|
+
kt as W,
|
|
2126
|
+
ue as a,
|
|
2127
|
+
$ as b,
|
|
2128
|
+
de as c,
|
|
2129
|
+
pt as d,
|
|
2130
|
+
bt as e,
|
|
2131
|
+
ge as f,
|
|
2132
|
+
he as g,
|
|
2133
|
+
pe as h,
|
|
2134
|
+
be as i,
|
|
2135
|
+
j,
|
|
2136
|
+
xt as k,
|
|
2137
|
+
yt as l,
|
|
2138
|
+
St as m,
|
|
2139
|
+
Lt as n,
|
|
2140
|
+
Ue as o,
|
|
2141
|
+
It as p,
|
|
2142
|
+
Bt as q,
|
|
2143
|
+
qe as r,
|
|
2144
|
+
Tt as s,
|
|
2145
|
+
Mt as t,
|
|
2146
|
+
Pt as u,
|
|
2147
|
+
nt as v,
|
|
2148
|
+
Rt as w,
|
|
2149
|
+
Ot as x
|
|
1804
2150
|
};
|