@base-framework/ui 1.0.216 → 1.0.217
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 +69 -68
- package/dist/organisms.es.js +39 -38
- package/dist/{signature-panel-K002fWxp.js → signature-panel-Cb3wM-a4.js} +331 -211
- 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/range-calendar.d.ts +60 -0
- package/dist/types/components/organisms/calendar/range/range-day-cell.d.ts +9 -0
- package/dist/types/components/organisms/calendar/range/range-days-grid.d.ts +3 -0
- package/dist/types/components/organisms/calendar/range/range-toggle.d.ts +7 -0
- package/dist/types/components/organisms/organisms.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { Button as
|
|
2
|
-
import { Atom as
|
|
3
|
-
import { B as
|
|
4
|
-
import { Icons as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { Button as D, Div as o, On as v, Span as S, Th as N, UseParent as E, I as Q, Thead as X, Tr as q, Table as M, P as w, Li as I, Time as K, Nav as C, Ul as b, Section as j, Canvas as G } from "@base-framework/atoms";
|
|
2
|
+
import { Atom as f, Component as g, Data as L, DateTime as V, router as x, NavLink as A, DataTracker as Y, Jot as _, base as W, Dom as O } from "@base-framework/base";
|
|
3
|
+
import { B as y, I as J } from "./buttons-Cm9etaEG.js";
|
|
4
|
+
import { Icons as k } from "./icons.es.js";
|
|
5
|
+
import { F as Z, A as ee, P as te } from "./calendar-Bn55oWBo.js";
|
|
6
|
+
import { TableBody as se, DataTableBody as ae, ScrollableTableBody as ie, List as ne, IntervalTimer as oe } from "@base-framework/organisms";
|
|
7
|
+
import { C as le, I as re, H as ce } from "./inputs-CMjx5-IX.js";
|
|
8
|
+
f((t, e) => ({
|
|
9
9
|
class: "flex items-center px-4 py-2",
|
|
10
10
|
...t,
|
|
11
11
|
children: e
|
|
12
12
|
}));
|
|
13
|
-
|
|
13
|
+
f(({ value: t, label: e }) => D({
|
|
14
14
|
class: "inline-flex flex-auto items-center justify-center whitespace-nowrap rounded-md px-8 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
|
|
15
15
|
onState: ["performance", { active: t }],
|
|
16
16
|
dataSet: ["performance", ["state", t, "active"]],
|
|
17
17
|
click: (s, { state: a }) => a.performance = t
|
|
18
18
|
}, e));
|
|
19
|
-
class
|
|
19
|
+
class dt extends g {
|
|
20
20
|
/**
|
|
21
21
|
* This will declare the props for the compiler.
|
|
22
22
|
*
|
|
@@ -34,55 +34,55 @@ class at extends h {
|
|
|
34
34
|
return o({ class: this.class || "" }, this.children);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
const
|
|
37
|
+
const de = (t) => {
|
|
38
38
|
const e = new Date(t, 11, 31), s = new Date(t, 0, 1);
|
|
39
39
|
return e.getDay() === 4 || // December 31 is a Thursday
|
|
40
40
|
s.getDay() === 4;
|
|
41
|
-
},
|
|
41
|
+
}, he = (t) => {
|
|
42
42
|
const e = new Date(t.valueOf()), s = (e.getDay() + 6) % 7;
|
|
43
43
|
e.setDate(e.getDate() - s + 3);
|
|
44
44
|
const a = e.getFullYear(), i = new Date(a, 0, 4);
|
|
45
45
|
i.setDate(i.getDate() - (i.getDay() + 6) % 7);
|
|
46
46
|
const n = Math.ceil((e - i) / 6048e5) + 1;
|
|
47
|
-
return n > 52 && !
|
|
47
|
+
return n > 52 && !de(a) ? {
|
|
48
48
|
weekNumber: 1,
|
|
49
49
|
year: a + 1
|
|
50
50
|
} : {
|
|
51
51
|
weekNumber: n,
|
|
52
52
|
year: a
|
|
53
53
|
};
|
|
54
|
-
},
|
|
54
|
+
}, ue = (t, e, s) => {
|
|
55
55
|
if (s === 0) return [];
|
|
56
56
|
const a = new Date(t, e, 0).getDate();
|
|
57
57
|
return Array.from(
|
|
58
58
|
{ length: s },
|
|
59
59
|
(i, n) => new Date(t, e - 1, a - s + n + 1)
|
|
60
60
|
);
|
|
61
|
-
},
|
|
61
|
+
}, fe = (t, e, s) => Array.from({ length: s }, (a, i) => new Date(t, e + 1, i + 1)), z = (t, e) => {
|
|
62
62
|
const s = new Date(e, 0, 4), a = (s.getDay() + 6) % 7, i = new Date(s);
|
|
63
63
|
i.setDate(s.getDate() - a);
|
|
64
64
|
const n = new Date(i);
|
|
65
65
|
return n.setDate(i.getDate() + (t - 1) * 7), n;
|
|
66
|
-
},
|
|
66
|
+
}, ht = (t, e) => {
|
|
67
67
|
const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(), i = [];
|
|
68
68
|
let n = [];
|
|
69
69
|
for (let l = 1 - s; l <= a; l++) {
|
|
70
|
-
const
|
|
71
|
-
n.push(l > 0 ?
|
|
70
|
+
const h = new Date(t, e, l);
|
|
71
|
+
n.push(l > 0 ? h : null), (n.length === 7 || l === a) && (i.push([...n]), n = []);
|
|
72
72
|
}
|
|
73
73
|
return i;
|
|
74
|
-
},
|
|
74
|
+
}, ut = (t, e) => {
|
|
75
75
|
const s = new Date(t, e + 1, 0).getDate(), a = [];
|
|
76
76
|
let i = [];
|
|
77
77
|
for (let n = 1; n <= s; n++)
|
|
78
78
|
i.push(new Date(t, e, n)), i.length === 7 && (a.push(i), i = []);
|
|
79
79
|
return i.length > 0 && a.push(i), a;
|
|
80
|
-
},
|
|
80
|
+
}, ge = (t, e, s) => {
|
|
81
81
|
const a = /* @__PURE__ */ new Date();
|
|
82
82
|
return a.getDate() === t && a.getMonth() === e && a.getFullYear() === s;
|
|
83
|
-
},
|
|
84
|
-
const n =
|
|
85
|
-
return
|
|
83
|
+
}, me = ({ day: t, month: e, year: s, weekNumber: a, selectWeek: i }) => {
|
|
84
|
+
const n = ge(t, e, s);
|
|
85
|
+
return D({
|
|
86
86
|
text: t || "",
|
|
87
87
|
disabled: !t,
|
|
88
88
|
class: `
|
|
@@ -92,19 +92,19 @@ const re = (t) => {
|
|
|
92
92
|
`,
|
|
93
93
|
click: () => i(a, s)
|
|
94
94
|
});
|
|
95
|
-
},
|
|
96
|
-
const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(), i =
|
|
97
|
-
for (let
|
|
98
|
-
const m =
|
|
99
|
-
|
|
100
|
-
weekNumber:
|
|
101
|
-
year:
|
|
95
|
+
}, pe = (t, e) => {
|
|
96
|
+
const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(), i = ue(t, e, s), n = Array.from({ length: a }, (c, m) => new Date(t, e, m + 1)), l = (i.length + n.length) % 7, h = l === 0 ? 0 : 7 - l, r = fe(t, e, h), d = [...i, ...n, ...r], u = [];
|
|
97
|
+
for (let c = 0; c < d.length; c += 7) {
|
|
98
|
+
const m = d.slice(c, c + 7), p = m.find((R) => R) || new Date(t, e, 1), { weekNumber: T, year: B } = he(p);
|
|
99
|
+
u.push({
|
|
100
|
+
weekNumber: T,
|
|
101
|
+
year: B,
|
|
102
102
|
days: m
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
|
-
return
|
|
106
|
-
},
|
|
107
|
-
const { year: i, month: n, currentDate: l } = a,
|
|
105
|
+
return u;
|
|
106
|
+
}, ye = ({ selectWeek: t }) => v("month", (e, s, { data: a }) => {
|
|
107
|
+
const { year: i, month: n, currentDate: l } = a, h = pe(i, n);
|
|
108
108
|
return o(
|
|
109
109
|
{ class: "grid grid-cols-8 gap-1 text-sm px-4 py-2" },
|
|
110
110
|
[
|
|
@@ -115,37 +115,37 @@ const re = (t) => {
|
|
|
115
115
|
class: "grid grid-cols-7 col-span-7 text-center text-muted-foreground items-center"
|
|
116
116
|
},
|
|
117
117
|
["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(
|
|
118
|
-
(
|
|
118
|
+
(r) => S({ class: "px-1 py-1", text: r })
|
|
119
119
|
)
|
|
120
120
|
),
|
|
121
121
|
// Render each "week" row
|
|
122
|
-
...
|
|
123
|
-
({ weekNumber:
|
|
122
|
+
...h.map(
|
|
123
|
+
({ weekNumber: r, days: d, year: u }) => o({
|
|
124
124
|
class: "grid grid-cols-8 col-span-8 items-center ring-primary rounded-sm px-1",
|
|
125
125
|
onSet: ["currentWeek", {
|
|
126
|
-
ring:
|
|
126
|
+
ring: r
|
|
127
127
|
}]
|
|
128
128
|
}, [
|
|
129
129
|
// Left column: ISO week number
|
|
130
130
|
o({
|
|
131
131
|
class: "font-medium text-center col-span-1 rounded-sm cursor-pointer",
|
|
132
|
-
click: () => t(
|
|
132
|
+
click: () => t(r, u),
|
|
133
133
|
// If you have a 'currentWeek' state, you can highlight it with 'onSet'
|
|
134
134
|
onSet: ["currentWeek", {
|
|
135
|
-
"text-primary-foreground":
|
|
136
|
-
"bg-primary":
|
|
135
|
+
"text-primary-foreground": r,
|
|
136
|
+
"bg-primary": r
|
|
137
137
|
}],
|
|
138
|
-
text:
|
|
138
|
+
text: r ? `W${r}` : ""
|
|
139
139
|
}),
|
|
140
140
|
// The 7 cells for each day in the row
|
|
141
141
|
o(
|
|
142
142
|
{ class: "grid grid-cols-7 col-span-7 text-center" },
|
|
143
|
-
|
|
144
|
-
(
|
|
145
|
-
year: (
|
|
146
|
-
month: (
|
|
147
|
-
day: (
|
|
148
|
-
weekNumber:
|
|
143
|
+
d.map(
|
|
144
|
+
(c) => me({
|
|
145
|
+
year: (c == null ? void 0 : c.getFullYear()) || null,
|
|
146
|
+
month: (c == null ? void 0 : c.getMonth()) || null,
|
|
147
|
+
day: (c == null ? void 0 : c.getDate()) || null,
|
|
148
|
+
weekNumber: r,
|
|
149
149
|
selectWeek: t
|
|
150
150
|
})
|
|
151
151
|
)
|
|
@@ -154,7 +154,7 @@ const re = (t) => {
|
|
|
154
154
|
)
|
|
155
155
|
]
|
|
156
156
|
);
|
|
157
|
-
}),
|
|
157
|
+
}), $ = ({ label: t, click: e }) => y(
|
|
158
158
|
{
|
|
159
159
|
class: `
|
|
160
160
|
inline-flex items-center justify-center h-7 w-7 bg-transparent p-0
|
|
@@ -165,20 +165,20 @@ const re = (t) => {
|
|
|
165
165
|
click: e,
|
|
166
166
|
"aria-label": `${t} month`,
|
|
167
167
|
variant: "icon",
|
|
168
|
-
icon: t === "Previous" ?
|
|
168
|
+
icon: t === "Previous" ? k.chevron.single.left : k.chevron.single.right
|
|
169
169
|
}
|
|
170
|
-
),
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
), we = ({ next: t, previous: e }) => o({ class: "flex flex-auto min-h-12 text-sm font-medium relative justify-center items-center" }, [
|
|
171
|
+
S("[[monthName]] [[year]]"),
|
|
172
|
+
$({
|
|
173
173
|
label: "Previous",
|
|
174
174
|
click: e
|
|
175
175
|
}),
|
|
176
|
-
|
|
176
|
+
$({
|
|
177
177
|
label: "Next",
|
|
178
178
|
click: t
|
|
179
179
|
})
|
|
180
180
|
]);
|
|
181
|
-
class
|
|
181
|
+
class ft extends g {
|
|
182
182
|
/**
|
|
183
183
|
* This will declare the props for the compiler.
|
|
184
184
|
*
|
|
@@ -193,8 +193,8 @@ class ot extends h {
|
|
|
193
193
|
* @returns {Data}
|
|
194
194
|
*/
|
|
195
195
|
setData() {
|
|
196
|
-
const e = /* @__PURE__ */ new Date(), s = this.selectedWeek || this.calculateCurrentWeek(e), a =
|
|
197
|
-
return new
|
|
196
|
+
const e = /* @__PURE__ */ new Date(), s = this.selectedWeek || this.calculateCurrentWeek(e), a = z(s, e.getFullYear());
|
|
197
|
+
return new L({
|
|
198
198
|
monthName: this.getMonthName(a.getMonth()),
|
|
199
199
|
year: a.getFullYear(),
|
|
200
200
|
month: a.getMonth(),
|
|
@@ -231,7 +231,7 @@ class ot extends h {
|
|
|
231
231
|
* @returns {string}
|
|
232
232
|
*/
|
|
233
233
|
getMonthName(e) {
|
|
234
|
-
return
|
|
234
|
+
return V.monthNames[e];
|
|
235
235
|
}
|
|
236
236
|
/**
|
|
237
237
|
* Updates the calendar to show the previous month.
|
|
@@ -276,7 +276,7 @@ class ot extends h {
|
|
|
276
276
|
*/
|
|
277
277
|
selectWeek(e, s) {
|
|
278
278
|
this.data.currentWeek = e;
|
|
279
|
-
const a =
|
|
279
|
+
const a = z(e, s);
|
|
280
280
|
this.setDate(a.getMonth(), a.getFullYear(), a.getDate()), typeof this.selectedCallBack == "function" && this.selectedCallBack(e);
|
|
281
281
|
}
|
|
282
282
|
/**
|
|
@@ -286,38 +286,157 @@ class ot extends h {
|
|
|
286
286
|
*/
|
|
287
287
|
render() {
|
|
288
288
|
return o({ class: "week-calendar-container border rounded-md bg-background p-3" }, [
|
|
289
|
-
|
|
289
|
+
we({
|
|
290
290
|
next: () => this.goToNextMonth(),
|
|
291
291
|
previous: () => this.goToPreviousMonth()
|
|
292
292
|
}),
|
|
293
|
-
|
|
293
|
+
ye({
|
|
294
294
|
selectWeek: (e, s) => this.selectWeek(e, s)
|
|
295
295
|
})
|
|
296
296
|
]);
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
const
|
|
299
|
+
const be = (t) => o({ class: "py-1" }, t), xe = () => o(
|
|
300
|
+
{ class: "grid grid-cols-7 text-center text-sm font-medium text-muted-foreground mb-1" },
|
|
301
|
+
["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(be)
|
|
302
|
+
), ke = ({ day: t, iso: e, disabled: s, isStart: a, isEnd: i, isBetween: n, onClick: l }) => y(
|
|
303
|
+
{
|
|
304
|
+
class: "flex items-center justify-center h-9 p-0 text-sm rounded-md " + (a || i ? "bg-primary text-primary-foreground" : n ? "bg-muted text-foreground" : ""),
|
|
305
|
+
disabled: s,
|
|
306
|
+
click: () => !s && l(e)
|
|
307
|
+
},
|
|
308
|
+
t.toString()
|
|
309
|
+
), De = ({ cells: t }) => o(
|
|
310
|
+
{ class: "grid grid-cols-7 gap-1" },
|
|
311
|
+
t.map(
|
|
312
|
+
(e) => e === null ? o() : ke(
|
|
313
|
+
{
|
|
314
|
+
day: e.day,
|
|
315
|
+
iso: e.iso,
|
|
316
|
+
disabled: e.disabled,
|
|
317
|
+
isStart: e.isStart,
|
|
318
|
+
isEnd: e.isEnd,
|
|
319
|
+
isBetween: e.isBetween,
|
|
320
|
+
onClick: e.onClick
|
|
321
|
+
}
|
|
322
|
+
)
|
|
323
|
+
)
|
|
324
|
+
), ve = ({ start: t, end: e, selecting: s, onSelectStart: a, onSelectEnd: i }) => o({ class: "flex space-x-2 mb-3" }, [
|
|
325
|
+
y(
|
|
326
|
+
{ click: a, variant: s === "start" ? "primary" : "ghost" },
|
|
327
|
+
t ? `Start: ${t}` : "Select start"
|
|
328
|
+
),
|
|
329
|
+
y(
|
|
330
|
+
{ click: i, variant: s === "end" ? "primary" : "ghost" },
|
|
331
|
+
e ? `End: ${e}` : "Select end"
|
|
332
|
+
)
|
|
333
|
+
]);
|
|
334
|
+
class gt extends g {
|
|
335
|
+
/**
|
|
336
|
+
* Declare compiler props.
|
|
337
|
+
*
|
|
338
|
+
* @returns {void}
|
|
339
|
+
*/
|
|
340
|
+
declareProps() {
|
|
341
|
+
this.startDate = null, this.endDate = null, this.onRangeSelect = null, this.blockPriorDates = !1;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Initialize reactive data for today and current view.
|
|
345
|
+
*
|
|
346
|
+
* @returns {Data}
|
|
347
|
+
*/
|
|
348
|
+
setData() {
|
|
349
|
+
const e = /* @__PURE__ */ new Date();
|
|
350
|
+
return new L({
|
|
351
|
+
today: {
|
|
352
|
+
date: e.getDate(),
|
|
353
|
+
month: e.getMonth(),
|
|
354
|
+
year: e.getFullYear()
|
|
355
|
+
},
|
|
356
|
+
current: {
|
|
357
|
+
date: e.getDate(),
|
|
358
|
+
month: e.getMonth(),
|
|
359
|
+
year: e.getFullYear()
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Initialize component state.
|
|
365
|
+
*
|
|
366
|
+
* @returns {{selecting:string,start:string|null,end:string|null}}
|
|
367
|
+
*/
|
|
368
|
+
setupStates() {
|
|
369
|
+
return {
|
|
370
|
+
selecting: "start",
|
|
371
|
+
start: this.startDate,
|
|
372
|
+
end: this.endDate
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Handle a date cell click.
|
|
377
|
+
*
|
|
378
|
+
* @param {string} isoDate
|
|
379
|
+
* @returns {void}
|
|
380
|
+
*/
|
|
381
|
+
handleClick(e) {
|
|
382
|
+
this.state.selecting === "start" ? (this.state.start = e, this.state.end = null, this.state.selecting = "end") : (this.state.end = e, this.state.selecting = "start", typeof this.onRangeSelect == "function" && this.onRangeSelect(this.state.start, this.state.end));
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Render the range calendar.
|
|
386
|
+
*
|
|
387
|
+
* @returns {object}
|
|
388
|
+
*/
|
|
389
|
+
render() {
|
|
390
|
+
const { today: e, current: s } = this.data, { start: a, end: i, selecting: n } = this.state, l = new Date(s.year, s.month, 1).getDay(), h = new Date(s.year, s.month + 1, 0).getDate(), r = [];
|
|
391
|
+
for (let d = 0; d < l; d++)
|
|
392
|
+
r.push(null);
|
|
393
|
+
for (let d = 1; d <= h; d++) {
|
|
394
|
+
const u = Z(s.year, s.month, d), m = /* @__PURE__ */ new Date(u + "T00:00:00") < new Date(e.year, e.month, e.date), p = this.blockPriorDates && m, T = a === u, B = i === u, R = a && i && u > a && u < i;
|
|
395
|
+
r.push({
|
|
396
|
+
day: d,
|
|
397
|
+
iso: u,
|
|
398
|
+
disabled: p,
|
|
399
|
+
isStart: T,
|
|
400
|
+
isEnd: B,
|
|
401
|
+
isBetween: R,
|
|
402
|
+
onClick: (U) => this.handleClick(U)
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
return o({ class: "range-calendar p-4 rounded-md border min-w-80" }, [
|
|
406
|
+
ve({
|
|
407
|
+
start: a,
|
|
408
|
+
end: i,
|
|
409
|
+
selecting: n,
|
|
410
|
+
onSelectStart: () => this.state.selecting = "start",
|
|
411
|
+
onSelectEnd: () => this.state.selecting = "end"
|
|
412
|
+
}),
|
|
413
|
+
xe(),
|
|
414
|
+
De({ cells: r })
|
|
415
|
+
]);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
const Se = (t, e) => {
|
|
300
419
|
const s = t.toggleAllSelectedRows();
|
|
301
420
|
e.state.checked = !s;
|
|
302
|
-
},
|
|
303
|
-
|
|
304
|
-
]),
|
|
421
|
+
}, Ie = (t) => N({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class || ""}` }, [
|
|
422
|
+
E((e) => new le({ class: "mr-2", onChange: (s, a) => Se(e, a) }))
|
|
423
|
+
]), Ce = ({ align: t, sortable: e, key: s, label: a, sort: i, class: n }) => {
|
|
305
424
|
const l = t || "justify-start";
|
|
306
|
-
return
|
|
425
|
+
return N({
|
|
307
426
|
class: `cursor-pointer py-3 px-4 text-base ${n || ""}`,
|
|
308
427
|
click: e && (() => i(s))
|
|
309
428
|
}, [
|
|
310
429
|
o({ class: `flex flex-auto w-full items-center ${l}` }, [
|
|
311
|
-
|
|
312
|
-
e &&
|
|
430
|
+
S(a),
|
|
431
|
+
e && Q({ class: "ml-2", html: k.arrows.upDown })
|
|
313
432
|
])
|
|
314
433
|
]);
|
|
315
|
-
},
|
|
316
|
-
|
|
434
|
+
}, P = (t) => X([
|
|
435
|
+
q({
|
|
317
436
|
class: "text-muted-foreground border-b",
|
|
318
437
|
map: [
|
|
319
438
|
t.headers,
|
|
320
|
-
(e) => e.label === "checkbox" ?
|
|
439
|
+
(e) => e.label === "checkbox" ? Ie({ toggle: t.toggle }) : Ce({
|
|
321
440
|
align: e.align,
|
|
322
441
|
sortable: e.sortable,
|
|
323
442
|
key: e.key,
|
|
@@ -326,7 +445,7 @@ const we = (t, e) => {
|
|
|
326
445
|
})
|
|
327
446
|
]
|
|
328
447
|
})
|
|
329
|
-
]),
|
|
448
|
+
]), Le = ({ key: t, rows: e, selectRow: s, rowItem: a, emptyState: i }) => new se({
|
|
330
449
|
cache: "list",
|
|
331
450
|
key: t,
|
|
332
451
|
items: e,
|
|
@@ -334,7 +453,7 @@ const we = (t, e) => {
|
|
|
334
453
|
class: "divide-y divide-border",
|
|
335
454
|
emptyState: i
|
|
336
455
|
});
|
|
337
|
-
class
|
|
456
|
+
class F extends g {
|
|
338
457
|
/**
|
|
339
458
|
* Initializes component data.
|
|
340
459
|
*
|
|
@@ -342,7 +461,7 @@ class j extends h {
|
|
|
342
461
|
*/
|
|
343
462
|
setData() {
|
|
344
463
|
let e = this.rows && this.rows.length > 0;
|
|
345
|
-
return (this.loadMoreItems || this.tableData) && !e && (e = null), new
|
|
464
|
+
return (this.loadMoreItems || this.tableData) && !e && (e = null), new L({
|
|
346
465
|
selectedRows: [],
|
|
347
466
|
// @ts-ignore
|
|
348
467
|
hasItems: e,
|
|
@@ -407,12 +526,12 @@ class j extends h {
|
|
|
407
526
|
return o({ class: "w-full flex flex-auto flex-col" }, [
|
|
408
527
|
v("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
|
|
409
528
|
o({ class: `w-full rounded-md ${s} overflow-x-auto`, onSet: ["hasItems", { hidden: !1 }] }, [
|
|
410
|
-
|
|
529
|
+
M({ class: "w-full" }, [
|
|
411
530
|
// @ts-ignore
|
|
412
|
-
this.headers &&
|
|
531
|
+
this.headers && P({ headers: this.headers, sort: (a) => this.sortRows(a) }),
|
|
413
532
|
// @ts-ignore
|
|
414
533
|
this.customHeader ?? null,
|
|
415
|
-
|
|
534
|
+
Le({
|
|
416
535
|
// @ts-ignore
|
|
417
536
|
key: this.key,
|
|
418
537
|
rows: e,
|
|
@@ -487,7 +606,7 @@ class j extends h {
|
|
|
487
606
|
this.data.selectedRows = [];
|
|
488
607
|
}
|
|
489
608
|
}
|
|
490
|
-
const
|
|
609
|
+
const Te = (t) => new ae({
|
|
491
610
|
cache: "list",
|
|
492
611
|
loadMoreItems: t.loadMoreItems,
|
|
493
612
|
offset: t.offset,
|
|
@@ -498,7 +617,7 @@ const ke = (t) => new Z({
|
|
|
498
617
|
rowItem: (e) => t.rowItem(e, t.selectRow),
|
|
499
618
|
class: "divide-y divide-border"
|
|
500
619
|
});
|
|
501
|
-
class
|
|
620
|
+
class Be extends F {
|
|
502
621
|
/**
|
|
503
622
|
* Renders the DataTable component.
|
|
504
623
|
*
|
|
@@ -509,12 +628,12 @@ class ve extends j {
|
|
|
509
628
|
return o({ class: "w-full flex flex-auto flex-col" }, [
|
|
510
629
|
v("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
|
|
511
630
|
o({ class: `w-full rounded-md ${s} overflow-x-auto`, onSet: ["hasItems", { hidden: !1 }] }, [
|
|
512
|
-
|
|
631
|
+
M({ class: "w-full" }, [
|
|
513
632
|
// @ts-ignore
|
|
514
|
-
this.headers &&
|
|
633
|
+
this.headers && P({ headers: this.headers, sort: (a) => this.sortRows(a) }),
|
|
515
634
|
// @ts-ignore
|
|
516
635
|
this.customHeader ?? null,
|
|
517
|
-
|
|
636
|
+
Te({
|
|
518
637
|
// @ts-ignore
|
|
519
638
|
loadMoreItems: this.loadMoreItems,
|
|
520
639
|
// @ts-ignore
|
|
@@ -546,7 +665,7 @@ class ve extends j {
|
|
|
546
665
|
this.list.refresh();
|
|
547
666
|
}
|
|
548
667
|
}
|
|
549
|
-
const
|
|
668
|
+
const mt = f((t) => new Be(
|
|
550
669
|
{
|
|
551
670
|
cache: t.cache ?? "list",
|
|
552
671
|
tableData: t.data,
|
|
@@ -562,7 +681,7 @@ const lt = d((t) => new ve(
|
|
|
562
681
|
border: t.border,
|
|
563
682
|
emptyState: t.emptyState
|
|
564
683
|
}
|
|
565
|
-
)),
|
|
684
|
+
)), Re = (t) => new ie({
|
|
566
685
|
cache: "list",
|
|
567
686
|
scrollContainer: t.scrollContainer,
|
|
568
687
|
loadMoreItems: t.loadMoreItems,
|
|
@@ -574,7 +693,7 @@ const lt = d((t) => new ve(
|
|
|
574
693
|
rowItem: (e) => t.rowItem(e, t.selectRow),
|
|
575
694
|
class: "divide-y divide-border"
|
|
576
695
|
});
|
|
577
|
-
class
|
|
696
|
+
class Me extends F {
|
|
578
697
|
/**
|
|
579
698
|
* Renders the DataTable component.
|
|
580
699
|
*
|
|
@@ -585,12 +704,12 @@ class Se extends j {
|
|
|
585
704
|
return o({ class: "w-full flex flex-auto flex-col" }, [
|
|
586
705
|
v("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
|
|
587
706
|
o({ class: `w-full rounded-md ${s} overflow-x-auto`, onSet: ["hasItems", { hidden: !1 }] }, [
|
|
588
|
-
|
|
707
|
+
M({ class: "w-full" }, [
|
|
589
708
|
// @ts-ignore
|
|
590
|
-
this.headers &&
|
|
709
|
+
this.headers && P({ headers: this.headers, sort: (a) => this.sortRows(a) }),
|
|
591
710
|
// @ts-ignore
|
|
592
711
|
this.customHeader ?? null,
|
|
593
|
-
|
|
712
|
+
Re({
|
|
594
713
|
// @ts-ignore
|
|
595
714
|
scrollContainer: this.scrollContainer,
|
|
596
715
|
// @ts-ignore
|
|
@@ -624,7 +743,7 @@ class Se extends j {
|
|
|
624
743
|
this.list.refresh();
|
|
625
744
|
}
|
|
626
745
|
}
|
|
627
|
-
const
|
|
746
|
+
const pt = f((t) => new Me(
|
|
628
747
|
{
|
|
629
748
|
cache: t.cache ?? "list",
|
|
630
749
|
tableData: t.data,
|
|
@@ -641,45 +760,45 @@ const rt = d((t) => new Se(
|
|
|
641
760
|
border: t.border,
|
|
642
761
|
emptyState: t.emptyState
|
|
643
762
|
}
|
|
644
|
-
)),
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
])),
|
|
763
|
+
)), Pe = f(({ name: t, email: e }) => o({ class: "min-w-0 flex-auto" }, [
|
|
764
|
+
w({ class: "text-base font-semibold leading-6 m-0" }, t),
|
|
765
|
+
w({ class: "truncate text-sm leading-5 text-muted-foreground m-0" }, e)
|
|
766
|
+
])), We = () => o({ class: "flex items-center gap-x-1.5" }, [
|
|
648
767
|
o({ class: "flex-none rounded-full bg-emerald-500/20 p-1" }, [
|
|
649
768
|
o({ class: "h-1.5 w-1.5 rounded-full bg-emerald-500" })
|
|
650
769
|
]),
|
|
651
|
-
|
|
652
|
-
]),
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
]),
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
])),
|
|
770
|
+
w({ class: "text-xs leading-5 text-gray-500" }, "Online")
|
|
771
|
+
]), Oe = (t) => w({ class: "text-xs leading-5 text-muted-foreground" }, [
|
|
772
|
+
S("Last seen "),
|
|
773
|
+
K({ datetime: t }, "3h ago")
|
|
774
|
+
]), ze = (t, e) => t === "online" ? We() : Oe(e), $e = f(({ role: t, lastSeen: e, status: s }) => o({ class: "hidden shrink-0 sm:flex sm:flex-col sm:items-end" }, [
|
|
775
|
+
w({ class: "text-sm leading-6 m-0" }, t),
|
|
776
|
+
ze(s, e)
|
|
777
|
+
])), Ne = (t) => t.split(" ").map((s) => s[0]).join(""), je = f((t) => I({ class: "fadeIn flex justify-between gap-x-6 py-4 px-4 rounded-md hover:bg-muted/50" }, [
|
|
659
778
|
o({ class: "flex min-w-0 gap-x-4" }, [
|
|
660
|
-
|
|
661
|
-
|
|
779
|
+
ee({ src: t.image, alt: t.name, fallbackText: Ne(t.name) }),
|
|
780
|
+
Pe({ name: t.name, email: t.email })
|
|
662
781
|
]),
|
|
663
|
-
|
|
782
|
+
$e({
|
|
664
783
|
role: t.role,
|
|
665
784
|
lastSeen: t.lastSeen,
|
|
666
785
|
status: t.status
|
|
667
786
|
})
|
|
668
|
-
])),
|
|
787
|
+
])), yt = f((t) => new ne({
|
|
669
788
|
cache: "list",
|
|
670
789
|
key: "name",
|
|
671
790
|
items: t.users,
|
|
672
791
|
role: "list",
|
|
673
792
|
class: "divide-y divide-border",
|
|
674
|
-
rowItem:
|
|
675
|
-
})),
|
|
793
|
+
rowItem: je
|
|
794
|
+
})), Ae = (t, e) => e.includes(t), Ye = (t, e, s) => t.exact ? s === e : Ae(e, s), Fe = ({ text: t, href: e, exact: s, hidden: a }) => new A({
|
|
676
795
|
text: t,
|
|
677
796
|
href: e,
|
|
678
797
|
exact: s,
|
|
679
798
|
dataSet: ["selected", ["state", !0, "active"]],
|
|
680
799
|
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`
|
|
681
800
|
});
|
|
682
|
-
class
|
|
801
|
+
class wt extends g {
|
|
683
802
|
/**
|
|
684
803
|
* This will declare the props for the compiler.
|
|
685
804
|
*
|
|
@@ -700,14 +819,14 @@ class dt extends h {
|
|
|
700
819
|
* @returns {object}
|
|
701
820
|
*/
|
|
702
821
|
render() {
|
|
703
|
-
return
|
|
822
|
+
return C(
|
|
704
823
|
{ class: `flex items-center justify-center p-2 text-muted-foreground rounded-md ${this.class || ""}` },
|
|
705
824
|
[
|
|
706
|
-
|
|
825
|
+
b({
|
|
707
826
|
class: "flex space-x-4",
|
|
708
827
|
map: [this.options, (e) => this.addLink(e)],
|
|
709
828
|
watch: {
|
|
710
|
-
value: ["[[path]]",
|
|
829
|
+
value: ["[[path]]", x.data],
|
|
711
830
|
callBack: this.updateLinks.bind(this)
|
|
712
831
|
}
|
|
713
832
|
})
|
|
@@ -720,7 +839,7 @@ class dt extends h {
|
|
|
720
839
|
* @returns {void}
|
|
721
840
|
*/
|
|
722
841
|
afterSetup() {
|
|
723
|
-
const e =
|
|
842
|
+
const e = x.data.path;
|
|
724
843
|
this.updateLinks(e);
|
|
725
844
|
}
|
|
726
845
|
/**
|
|
@@ -735,7 +854,7 @@ class dt extends h {
|
|
|
735
854
|
for (const a of this.links) {
|
|
736
855
|
if (!a.rendered)
|
|
737
856
|
continue;
|
|
738
|
-
|
|
857
|
+
Ye(a, a.getLinkPath(), e) ? (this.updateLink(a, !0), s = !0) : this.updateLink(a, !1);
|
|
739
858
|
}
|
|
740
859
|
!s && this.links[0] && this.updateLink(this.links[0], !0);
|
|
741
860
|
}
|
|
@@ -765,7 +884,7 @@ class dt extends h {
|
|
|
765
884
|
* @returns {object}
|
|
766
885
|
*/
|
|
767
886
|
addLink({ label: e, href: s, exact: a, hidden: i }) {
|
|
768
|
-
const n =
|
|
887
|
+
const n = Fe({ text: e, href: s, exact: a, hidden: i });
|
|
769
888
|
return this.links.push(n), n;
|
|
770
889
|
}
|
|
771
890
|
/**
|
|
@@ -777,13 +896,13 @@ class dt extends h {
|
|
|
777
896
|
this.links = [];
|
|
778
897
|
}
|
|
779
898
|
}
|
|
780
|
-
const
|
|
899
|
+
const bt = f((t) => {
|
|
781
900
|
const e = t.margin || "m-4 ml-0";
|
|
782
901
|
return t.allowHistory = t.allowHistory === !0, o({ class: `flex-none ${e}` }, [
|
|
783
|
-
|
|
902
|
+
y({ variant: "back", class: "ghost", ...t })
|
|
784
903
|
]);
|
|
785
904
|
});
|
|
786
|
-
class
|
|
905
|
+
class H extends g {
|
|
787
906
|
/**
|
|
788
907
|
* This will declare the props for the compiler.
|
|
789
908
|
*
|
|
@@ -870,13 +989,13 @@ class A extends h {
|
|
|
870
989
|
return this.children;
|
|
871
990
|
}
|
|
872
991
|
}
|
|
873
|
-
|
|
992
|
+
Y.addType("dockableOverlay", (t) => {
|
|
874
993
|
if (!t)
|
|
875
994
|
return;
|
|
876
995
|
const e = t.component;
|
|
877
996
|
e && e.rendered === !0 && e.state.docked === !1 && e.destroy();
|
|
878
997
|
});
|
|
879
|
-
class
|
|
998
|
+
class xt extends H {
|
|
880
999
|
/**
|
|
881
1000
|
* This will stop presistence.
|
|
882
1001
|
*
|
|
@@ -942,7 +1061,7 @@ class ut extends A {
|
|
|
942
1061
|
* @returns {void}
|
|
943
1062
|
*/
|
|
944
1063
|
afterSetup() {
|
|
945
|
-
|
|
1064
|
+
Y.add(
|
|
946
1065
|
this.container,
|
|
947
1066
|
"dockableOverlay",
|
|
948
1067
|
{
|
|
@@ -985,7 +1104,7 @@ class ut extends A {
|
|
|
985
1104
|
document.documentElement.style.overflowY = "auto";
|
|
986
1105
|
}
|
|
987
1106
|
}
|
|
988
|
-
class
|
|
1107
|
+
class kt extends H {
|
|
989
1108
|
/**
|
|
990
1109
|
* This will get the overlay type.
|
|
991
1110
|
*
|
|
@@ -1004,7 +1123,7 @@ class ft extends A {
|
|
|
1004
1123
|
this.container = e, this.initialize();
|
|
1005
1124
|
}
|
|
1006
1125
|
}
|
|
1007
|
-
const
|
|
1126
|
+
const He = f(({ index: t, click: e, state: s }, a) => I({
|
|
1008
1127
|
class: "p-2 cursor-pointer hover:bg-muted/50",
|
|
1009
1128
|
onState: [
|
|
1010
1129
|
[s, "selectedIndex", {
|
|
@@ -1013,11 +1132,11 @@ const ze = d(({ index: t, click: e, state: s }, a) => S({
|
|
|
1013
1132
|
}]
|
|
1014
1133
|
],
|
|
1015
1134
|
click: () => e(t)
|
|
1016
|
-
}, a)),
|
|
1135
|
+
}, a)), Ue = f(({ selectOption: t, state: e }) => b({
|
|
1017
1136
|
class: "border rounded-md list-none m-0 p-0 max-h-[400px] overflow-y-auto",
|
|
1018
|
-
for: ["filteredOptions", (s, a) =>
|
|
1019
|
-
})),
|
|
1020
|
-
|
|
1137
|
+
for: ["filteredOptions", (s, a) => He({ index: a, click: t, state: e }, s.label)]
|
|
1138
|
+
})), Ee = f((t) => o({ class: "relative flex items-center" }, [
|
|
1139
|
+
re({
|
|
1021
1140
|
cache: "input",
|
|
1022
1141
|
class: t.class ?? "",
|
|
1023
1142
|
placeholder: t.placeholder ?? "Search...",
|
|
@@ -1033,22 +1152,22 @@ const ze = d(({ index: t, click: e, state: s }, a) => S({
|
|
|
1033
1152
|
]
|
|
1034
1153
|
}),
|
|
1035
1154
|
t.icon && o({ class: "absolute flex right-0 mr-2" }, [
|
|
1036
|
-
|
|
1155
|
+
J(t.icon)
|
|
1037
1156
|
])
|
|
1038
|
-
])),
|
|
1157
|
+
])), Qe = (t) => o({
|
|
1039
1158
|
class: "relative flex fle-auto flex-col",
|
|
1040
1159
|
onState: ["open", (e, s, a) => {
|
|
1041
1160
|
if (e)
|
|
1042
|
-
return new
|
|
1161
|
+
return new te({
|
|
1043
1162
|
cache: "dropdown",
|
|
1044
1163
|
parent: a,
|
|
1045
1164
|
button: a.input,
|
|
1046
1165
|
size: "xl"
|
|
1047
1166
|
}, [
|
|
1048
|
-
|
|
1167
|
+
Ue(t)
|
|
1049
1168
|
]);
|
|
1050
1169
|
}]
|
|
1051
|
-
}),
|
|
1170
|
+
}), Dt = _(
|
|
1052
1171
|
{
|
|
1053
1172
|
/**
|
|
1054
1173
|
* This will set up the data object.
|
|
@@ -1057,7 +1176,7 @@ const ze = d(({ index: t, click: e, state: s }, a) => S({
|
|
|
1057
1176
|
*/
|
|
1058
1177
|
setData() {
|
|
1059
1178
|
const t = this.options || [];
|
|
1060
|
-
return new
|
|
1179
|
+
return new L({
|
|
1061
1180
|
options: t,
|
|
1062
1181
|
filteredOptions: t
|
|
1063
1182
|
});
|
|
@@ -1145,7 +1264,7 @@ const ze = d(({ index: t, click: e, state: s }, a) => S({
|
|
|
1145
1264
|
*/
|
|
1146
1265
|
render() {
|
|
1147
1266
|
return o({ class: "relative w-full max-w-md" }, [
|
|
1148
|
-
|
|
1267
|
+
Ee({
|
|
1149
1268
|
// @ts-ignore
|
|
1150
1269
|
state: this.state,
|
|
1151
1270
|
// @ts-ignore
|
|
@@ -1157,7 +1276,7 @@ const ze = d(({ index: t, click: e, state: s }, a) => S({
|
|
|
1157
1276
|
// @ts-ignore
|
|
1158
1277
|
handleKeyDown: this.handleKeyDown.bind(this)
|
|
1159
1278
|
}),
|
|
1160
|
-
|
|
1279
|
+
Qe({
|
|
1161
1280
|
// @ts-ignore
|
|
1162
1281
|
state: this.state,
|
|
1163
1282
|
// @ts-ignore
|
|
@@ -1168,22 +1287,22 @@ const ze = d(({ index: t, click: e, state: s }, a) => S({
|
|
|
1168
1287
|
]);
|
|
1169
1288
|
}
|
|
1170
1289
|
}
|
|
1171
|
-
),
|
|
1290
|
+
), Xe = (t) => I(
|
|
1172
1291
|
{
|
|
1173
1292
|
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",
|
|
1174
1293
|
dataSet: ["selected", ["state", t.value, "active"]]
|
|
1175
1294
|
},
|
|
1176
1295
|
[
|
|
1177
|
-
|
|
1296
|
+
D({
|
|
1178
1297
|
class: "flex flex-auto justify-center items-center px-3 py-1.5 rounded-md",
|
|
1179
1298
|
onSet: ["selected", { selected: t.value }],
|
|
1180
1299
|
click: (e) => t.callBack(t.value)
|
|
1181
1300
|
}, t.label)
|
|
1182
1301
|
]
|
|
1183
|
-
),
|
|
1184
|
-
|
|
1302
|
+
), qe = (t, e) => (t.callBack = e, Xe(t)), Ke = (t) => C({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${t.class}` }, [
|
|
1303
|
+
b({ class: "flex flex-auto flex-row", map: [t.options, (e) => qe(e, t.callBack)] })
|
|
1185
1304
|
]);
|
|
1186
|
-
class
|
|
1305
|
+
class vt extends g {
|
|
1187
1306
|
/**
|
|
1188
1307
|
* This will declare the props for the compiler.
|
|
1189
1308
|
*
|
|
@@ -1200,12 +1319,12 @@ class mt extends h {
|
|
|
1200
1319
|
render() {
|
|
1201
1320
|
const e = this.select.bind(this);
|
|
1202
1321
|
return o({ class: "" }, [
|
|
1203
|
-
|
|
1322
|
+
Ke({
|
|
1204
1323
|
class: this.class,
|
|
1205
1324
|
options: this.options,
|
|
1206
1325
|
callBack: e
|
|
1207
1326
|
}),
|
|
1208
|
-
|
|
1327
|
+
j({
|
|
1209
1328
|
class: "tab-content",
|
|
1210
1329
|
onState: ["selected", this.updateContent.bind(this)]
|
|
1211
1330
|
})
|
|
@@ -1271,23 +1390,23 @@ class mt extends h {
|
|
|
1271
1390
|
};
|
|
1272
1391
|
}
|
|
1273
1392
|
}
|
|
1274
|
-
const
|
|
1393
|
+
const Ge = (t) => I(
|
|
1275
1394
|
{
|
|
1276
1395
|
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",
|
|
1277
1396
|
dataSet: ["selected", ["state", t.value, "active"]]
|
|
1278
1397
|
},
|
|
1279
1398
|
[
|
|
1280
|
-
|
|
1399
|
+
D({
|
|
1281
1400
|
class: "flex flex-auto justify-center items-center px-3 py-1.5 rounded-md disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1282
1401
|
onSet: ["selected", { selected: t.value }],
|
|
1283
1402
|
click: (e) => t.callBack(t.value),
|
|
1284
1403
|
disabled: t.disabled
|
|
1285
1404
|
}, t.label)
|
|
1286
1405
|
]
|
|
1287
|
-
),
|
|
1288
|
-
|
|
1406
|
+
), Ve = (t, e) => (t.callBack = e, Ge(t)), _e = (t) => C({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${t.class}` }, [
|
|
1407
|
+
b({ class: "flex flex-auto flex-row", map: [t.options, (e) => Ve(e, t.callBack)] })
|
|
1289
1408
|
]);
|
|
1290
|
-
class
|
|
1409
|
+
class St extends g {
|
|
1291
1410
|
/**
|
|
1292
1411
|
* This will declare the props for the compiler.
|
|
1293
1412
|
*
|
|
@@ -1303,7 +1422,7 @@ class pt extends h {
|
|
|
1303
1422
|
*/
|
|
1304
1423
|
render() {
|
|
1305
1424
|
const e = this.select.bind(this);
|
|
1306
|
-
return
|
|
1425
|
+
return _e({
|
|
1307
1426
|
class: this.class,
|
|
1308
1427
|
options: this.options,
|
|
1309
1428
|
callBack: e
|
|
@@ -1330,17 +1449,17 @@ class pt extends h {
|
|
|
1330
1449
|
};
|
|
1331
1450
|
}
|
|
1332
1451
|
}
|
|
1333
|
-
const
|
|
1452
|
+
const Je = (t, e) => new RegExp(`${t}($|/|\\.).*`).test(e), Ze = (t, e) => {
|
|
1334
1453
|
const s = t.getLinkPath();
|
|
1335
|
-
return t.exact ? e === s :
|
|
1336
|
-
},
|
|
1454
|
+
return t.exact ? e === s : Je(s, e);
|
|
1455
|
+
}, et = ({ text: t, href: e, exact: s }) => new A({
|
|
1337
1456
|
text: t,
|
|
1338
1457
|
href: e,
|
|
1339
1458
|
exact: s,
|
|
1340
1459
|
dataSet: ["selected", ["state", !0, "active"]],
|
|
1341
1460
|
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"
|
|
1342
1461
|
});
|
|
1343
|
-
class
|
|
1462
|
+
class tt extends g {
|
|
1344
1463
|
/**
|
|
1345
1464
|
* This will declare the props for the compiler.
|
|
1346
1465
|
*
|
|
@@ -1361,12 +1480,12 @@ class Ke extends h {
|
|
|
1361
1480
|
* @returns {object}
|
|
1362
1481
|
*/
|
|
1363
1482
|
render() {
|
|
1364
|
-
return
|
|
1365
|
-
|
|
1483
|
+
return C({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${this.class}` }, [
|
|
1484
|
+
b({
|
|
1366
1485
|
class: "flex flex-auto flex-row",
|
|
1367
1486
|
map: [this.options, (e) => this.addLink(e)],
|
|
1368
1487
|
watch: {
|
|
1369
|
-
value: ["[[path]]",
|
|
1488
|
+
value: ["[[path]]", x.data],
|
|
1370
1489
|
callBack: this.updateLinks.bind(this)
|
|
1371
1490
|
}
|
|
1372
1491
|
})
|
|
@@ -1378,7 +1497,7 @@ class Ke extends h {
|
|
|
1378
1497
|
* @returns {void}
|
|
1379
1498
|
*/
|
|
1380
1499
|
afterSetup() {
|
|
1381
|
-
const e =
|
|
1500
|
+
const e = x.data.path;
|
|
1382
1501
|
this.updateLinks(e);
|
|
1383
1502
|
}
|
|
1384
1503
|
/**
|
|
@@ -1391,7 +1510,7 @@ class Ke extends h {
|
|
|
1391
1510
|
let s = !1, a = this.links[0];
|
|
1392
1511
|
this.deactivateAllLinks();
|
|
1393
1512
|
for (const i of this.links)
|
|
1394
|
-
if (i.rendered !== !1 && (s =
|
|
1513
|
+
if (i.rendered !== !1 && (s = Ze(i, e), s === !0)) {
|
|
1395
1514
|
this.updateLink(i, !0);
|
|
1396
1515
|
break;
|
|
1397
1516
|
}
|
|
@@ -1423,7 +1542,7 @@ class Ke extends h {
|
|
|
1423
1542
|
* @returns {object}
|
|
1424
1543
|
*/
|
|
1425
1544
|
addLink({ label: e, href: s, exact: a }) {
|
|
1426
|
-
const i =
|
|
1545
|
+
const i = et({ text: e, href: s, exact: a });
|
|
1427
1546
|
return this.links.push(i), i;
|
|
1428
1547
|
}
|
|
1429
1548
|
/**
|
|
@@ -1435,7 +1554,7 @@ class Ke extends h {
|
|
|
1435
1554
|
this.links = [];
|
|
1436
1555
|
}
|
|
1437
1556
|
}
|
|
1438
|
-
class
|
|
1557
|
+
class It extends g {
|
|
1439
1558
|
/**
|
|
1440
1559
|
* This will declare the props for the compiler.
|
|
1441
1560
|
*
|
|
@@ -1451,11 +1570,11 @@ class wt extends h {
|
|
|
1451
1570
|
*/
|
|
1452
1571
|
render() {
|
|
1453
1572
|
return o({ class: "tab-panel" }, [
|
|
1454
|
-
new
|
|
1573
|
+
new tt({
|
|
1455
1574
|
class: this.class,
|
|
1456
1575
|
options: this.options
|
|
1457
1576
|
}),
|
|
1458
|
-
|
|
1577
|
+
j({
|
|
1459
1578
|
class: "tab-content",
|
|
1460
1579
|
switch: this.addGroup()
|
|
1461
1580
|
})
|
|
@@ -1481,7 +1600,7 @@ class wt extends h {
|
|
|
1481
1600
|
return s;
|
|
1482
1601
|
}
|
|
1483
1602
|
}
|
|
1484
|
-
class
|
|
1603
|
+
class st extends g {
|
|
1485
1604
|
/**
|
|
1486
1605
|
* Runs before rendering, sets up defaults, a timer for drawing,
|
|
1487
1606
|
* and basic canvas properties.
|
|
@@ -1491,7 +1610,7 @@ class Ge extends h {
|
|
|
1491
1610
|
onCreated() {
|
|
1492
1611
|
this.lineWidth = this.lineWidth || 3, this.lineColor = this.lineColor || "#000000", this.canvas = null, this.ctx = null, this.status = "stopped";
|
|
1493
1612
|
const e = 1e3 / 60;
|
|
1494
|
-
this.timer = new
|
|
1613
|
+
this.timer = new oe(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";
|
|
1495
1614
|
}
|
|
1496
1615
|
/**
|
|
1497
1616
|
* Renders a <canvas> element.
|
|
@@ -1499,7 +1618,7 @@ class Ge extends h {
|
|
|
1499
1618
|
* @returns {object} Layout definition for the canvas.
|
|
1500
1619
|
*/
|
|
1501
1620
|
render() {
|
|
1502
|
-
return
|
|
1621
|
+
return G({
|
|
1503
1622
|
style: "touch-action: none; -webkit-user-select: none; -webkit-touch-callout: none;"
|
|
1504
1623
|
});
|
|
1505
1624
|
}
|
|
@@ -1548,12 +1667,12 @@ class Ge extends h {
|
|
|
1548
1667
|
let s, a;
|
|
1549
1668
|
const i = this.canvas, n = i.width / parseInt(i.style.width), l = i.getBoundingClientRect();
|
|
1550
1669
|
if (e.touches && e.touches.length) {
|
|
1551
|
-
const
|
|
1552
|
-
s =
|
|
1670
|
+
const d = e.touches[0];
|
|
1671
|
+
s = d.clientX, a = d.clientY;
|
|
1553
1672
|
} else
|
|
1554
1673
|
s = e.x || e.clientX, a = e.y || e.clientY;
|
|
1555
|
-
const
|
|
1556
|
-
this.mouse.x =
|
|
1674
|
+
const h = parseInt((s - l.left) * n), r = parseInt((a - l.top) * n);
|
|
1675
|
+
this.mouse.x = h, this.mouse.y = r;
|
|
1557
1676
|
}
|
|
1558
1677
|
/**
|
|
1559
1678
|
* Called when the pointer goes down on the canvas.
|
|
@@ -1596,8 +1715,8 @@ class Ge extends h {
|
|
|
1596
1715
|
const { canvas: e, ctx: s } = this, a = e.toDataURL();
|
|
1597
1716
|
if (this.scale(), this.setupBackground(s), a !== "data:,") {
|
|
1598
1717
|
const i = new globalThis.Image();
|
|
1599
|
-
|
|
1600
|
-
s.drawImage(i, 0, 0),
|
|
1718
|
+
W.on("load", i, function n() {
|
|
1719
|
+
s.drawImage(i, 0, 0), W.off("load", i, n);
|
|
1601
1720
|
}), i.src = a;
|
|
1602
1721
|
}
|
|
1603
1722
|
this.draw();
|
|
@@ -1617,7 +1736,7 @@ class Ge extends h {
|
|
|
1617
1736
|
* @returns {void}
|
|
1618
1737
|
*/
|
|
1619
1738
|
noScaleResize() {
|
|
1620
|
-
const e =
|
|
1739
|
+
const e = O.getSize(container);
|
|
1621
1740
|
this.width = canvas.width = e.width, this.height = canvas.height = e.height;
|
|
1622
1741
|
}
|
|
1623
1742
|
/**
|
|
@@ -1627,13 +1746,13 @@ class Ge extends h {
|
|
|
1627
1746
|
* @returns {void}
|
|
1628
1747
|
*/
|
|
1629
1748
|
scale() {
|
|
1630
|
-
const e = this.canvas, s = this.container, a =
|
|
1631
|
-
let
|
|
1749
|
+
const e = this.canvas, s = this.container, a = O.getSize(s), i = this.targetSize, n = i.width, l = i.height;
|
|
1750
|
+
let h = n + "px", r = l + "px";
|
|
1632
1751
|
if (this.width = e.width = n, this.height = e.height = l, a.width !== 0 && a.height !== 0) {
|
|
1633
|
-
const
|
|
1634
|
-
|
|
1752
|
+
const d = a.width, u = a.height, c = d / n, m = u / l, p = Math.min(c, m);
|
|
1753
|
+
h = n * p + "px", r = l * p + "px";
|
|
1635
1754
|
}
|
|
1636
|
-
e.style.width =
|
|
1755
|
+
e.style.width = h, e.style.height = r;
|
|
1637
1756
|
}
|
|
1638
1757
|
/**
|
|
1639
1758
|
* Main drawing loop. If the mouse is down, adds a line
|
|
@@ -1707,7 +1826,7 @@ class Ge extends h {
|
|
|
1707
1826
|
this.timer.stop(), this.status = "stopped";
|
|
1708
1827
|
}
|
|
1709
1828
|
}
|
|
1710
|
-
class
|
|
1829
|
+
class Ct extends g {
|
|
1711
1830
|
/**
|
|
1712
1831
|
* Sets up default properties for the signature panel.
|
|
1713
1832
|
*
|
|
@@ -1724,19 +1843,19 @@ class bt extends h {
|
|
|
1724
1843
|
*/
|
|
1725
1844
|
render() {
|
|
1726
1845
|
return o({ class: "signature-panel relative flex flex-auto overflow-hidden select-none" }, [
|
|
1727
|
-
|
|
1846
|
+
ce({
|
|
1728
1847
|
cache: "hiddenInput",
|
|
1729
1848
|
required: !0,
|
|
1730
1849
|
bind: this.path + ".data"
|
|
1731
1850
|
}),
|
|
1732
1851
|
o({ class: "absolute top-2 right-2" }, [
|
|
1733
|
-
|
|
1852
|
+
y({
|
|
1734
1853
|
variant: "icon",
|
|
1735
|
-
icon:
|
|
1854
|
+
icon: k.circleX,
|
|
1736
1855
|
click: this.reset.bind(this)
|
|
1737
1856
|
})
|
|
1738
1857
|
]),
|
|
1739
|
-
new
|
|
1858
|
+
new st({
|
|
1740
1859
|
cache: "canvasLayer",
|
|
1741
1860
|
margin: this.margin,
|
|
1742
1861
|
targetSize: this.targetSize,
|
|
@@ -1786,36 +1905,37 @@ class bt extends h {
|
|
|
1786
1905
|
}
|
|
1787
1906
|
}
|
|
1788
1907
|
export {
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1908
|
+
bt as B,
|
|
1909
|
+
Ie as C,
|
|
1910
|
+
Le as D,
|
|
1911
|
+
Ce as H,
|
|
1912
|
+
kt as I,
|
|
1913
|
+
wt as N,
|
|
1914
|
+
H as O,
|
|
1915
|
+
dt as P,
|
|
1916
|
+
gt as R,
|
|
1917
|
+
pt as S,
|
|
1918
|
+
P as T,
|
|
1919
|
+
je as U,
|
|
1920
|
+
ft as W,
|
|
1921
|
+
fe as a,
|
|
1922
|
+
z as b,
|
|
1923
|
+
he as c,
|
|
1924
|
+
ht as d,
|
|
1925
|
+
ut as e,
|
|
1926
|
+
me as f,
|
|
1927
|
+
ue as g,
|
|
1928
|
+
ye as h,
|
|
1929
|
+
we as i,
|
|
1930
|
+
F as j,
|
|
1931
|
+
mt as k,
|
|
1932
|
+
yt as l,
|
|
1933
|
+
xt as m,
|
|
1934
|
+
Dt as n,
|
|
1935
|
+
Ee as o,
|
|
1936
|
+
vt as p,
|
|
1937
|
+
St as q,
|
|
1938
|
+
tt as r,
|
|
1939
|
+
It as s,
|
|
1940
|
+
Ct as t
|
|
1821
1941
|
};
|