@base-framework/ui 1.0.70 → 1.0.72
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
CHANGED
|
@@ -5,7 +5,7 @@ import { V as w, a as U } from "./veil-D4dRxILB.js";
|
|
|
5
5
|
import { Icons as R } from "./icons.es.js";
|
|
6
6
|
import { A as G, B as V, C as j, z as q, u as z, v as J, w as _, D as K, j as Q, k as X, G as Y, E as Z, s as $, c as aa, a as sa, b as ea, i as oa, g as ta, e as ra, h as na, F as ia, d as la, f as pa, t as ua, M as ma, l as da, N as ga, P as Ta, p as ca, q as Ca, S as ba, n as Da, o as Sa, T as Ia, x as Ba, y as Pa, m as Fa, r as Ma } from "./confirmation-DgARq0AK.js";
|
|
7
7
|
import { A as Na, b as va, C as fa, D as xa, a as ha, F as ya, M as Wa, P as La, c as Aa, g as Ha, p as wa } from "./calendar-BDqm833e.js";
|
|
8
|
-
import { B as Oa, n as Ra, C as Ea, j as Ga, D as Va, l as ja, H as qa, I as za, N as Ja, O as _a, P as Ka, S as Qa, m as Xa, r as Ya, q as Za, o as $a, p as as, T as ss, k as es, U as os, W as ts, f as rs, h as ns, i as is, c as ls, d as ps, b as us, e as ms, a as ds, g as gs } from "./signature-panel-
|
|
8
|
+
import { B as Oa, n as Ra, C as Ea, j as Ga, D as Va, l as ja, H as qa, I as za, N as Ja, O as _a, P as Ka, S as Qa, m as Xa, r as Ya, q as Za, o as $a, p as as, T as ss, k as es, U as os, W as ts, f as rs, h as ns, i as is, c as ls, d as ps, b as us, e as ms, a as ds, g as gs } from "./signature-panel-BzWL3-N-.js";
|
|
9
9
|
import { B as cs, I as Cs, M as bs, d as Ds, e as Ss, g as Is, N as Bs, b as Ps, a as Fs, f as Ms, P as ks, c as Ns, S as vs, T as fs } from "./mobile-nav-wrapper-BE_hr65B.js";
|
|
10
10
|
import { B as hs, a as ys, C as Ws, F as Ls, b as As, c as Hs, M as ws, P as Us, S as Os } from "./sidebar-menu-page-nCAVFk3R.js";
|
|
11
11
|
import { A as Es, F as Gs, M as Vs, a as js, T as qs } from "./aside-template-McEj_Gxc.js";
|
package/dist/organisms.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as s, n as o, C as t, j as r, D as l, l as n, H as i, I as b, N as d, O as v, P as g, S as p, m as u, r as N, q as k, o as D, p as C, T, k as c, U as M, W as B, f as m, h as y, i as W, c as h, d as H, b as P, e as S, a as f, g as x } from "./signature-panel-
|
|
1
|
+
import { B as s, n as o, C as t, j as r, D as l, l as n, H as i, I as b, N as d, O as v, P as g, S as p, m as u, r as N, q as k, o as D, p as C, T, k as c, U as M, W as B, f as m, h as y, i as W, c as h, d as H, b as P, e as S, a as f, g as x } from "./signature-panel-BzWL3-N-.js";
|
|
2
2
|
import { b as L, C as O, D as F, a as U, F as G, M as j, c as q, p as w } from "./calendar-BDqm833e.js";
|
|
3
3
|
import { B as A, I as E, M as J, d as K, e as Q, g as R, N as V, b as X, a as Y, f as Z, P as _, c as $, S as aa, T as ea } from "./mobile-nav-wrapper-BE_hr65B.js";
|
|
4
4
|
export {
|
|
@@ -3,8 +3,8 @@ import { Atom as d, Component as u, Data as L, DateTime as V, Jot as M, router a
|
|
|
3
3
|
import { B as C, I as $ } from "./buttons-CVEwmPAi.js";
|
|
4
4
|
import { Icons as w } from "./icons.es.js";
|
|
5
5
|
import { TableBody as _, ScrollableTableBody as J, List as Z, IntervalTimer as ee } from "@base-framework/organisms";
|
|
6
|
-
import { C as te, I as se, H as
|
|
7
|
-
import { A as
|
|
6
|
+
import { C as te, I as se, H as ne } from "./inputs-DmJuUwS9.js";
|
|
7
|
+
import { A as ae, P as ie } from "./calendar-BDqm833e.js";
|
|
8
8
|
d((t, e) => ({
|
|
9
9
|
class: "flex items-center px-4 py-2",
|
|
10
10
|
...t,
|
|
@@ -14,7 +14,7 @@ d(({ value: t, label: e }) => y({
|
|
|
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
|
-
click: (s, { state:
|
|
17
|
+
click: (s, { state: n }) => n.performance = t
|
|
18
18
|
}, e));
|
|
19
19
|
class Je extends u {
|
|
20
20
|
/**
|
|
@@ -41,46 +41,46 @@ const oe = (t) => {
|
|
|
41
41
|
}, le = (t) => {
|
|
42
42
|
const e = new Date(t.valueOf()), s = (e.getDay() + 6) % 7;
|
|
43
43
|
e.setDate(e.getDate() - s + 3);
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
const i = Math.ceil((e -
|
|
47
|
-
return i > 52 && !oe(
|
|
44
|
+
const n = e.getFullYear(), a = new Date(n, 0, 4);
|
|
45
|
+
a.setDate(a.getDate() - (a.getDay() + 6) % 7);
|
|
46
|
+
const i = Math.ceil((e - a) / 6048e5) + 1;
|
|
47
|
+
return i > 52 && !oe(n) ? {
|
|
48
48
|
weekNumber: 1,
|
|
49
|
-
year:
|
|
49
|
+
year: n + 1
|
|
50
50
|
} : {
|
|
51
51
|
weekNumber: i,
|
|
52
|
-
year:
|
|
52
|
+
year: n
|
|
53
53
|
};
|
|
54
54
|
}, re = (t, e, s) => {
|
|
55
55
|
if (s === 0) return [];
|
|
56
|
-
const
|
|
56
|
+
const n = new Date(t, e, 0).getDate();
|
|
57
57
|
return Array.from(
|
|
58
58
|
{ length: s },
|
|
59
|
-
(
|
|
59
|
+
(a, i) => new Date(t, e - 1, n - s + i + 1)
|
|
60
60
|
);
|
|
61
|
-
}, ce = (t, e, s) => Array.from({ length: s }, (
|
|
62
|
-
const s = new Date(e, 0, 4),
|
|
63
|
-
|
|
64
|
-
const i = new Date(
|
|
65
|
-
return i.setDate(
|
|
61
|
+
}, ce = (t, e, s) => Array.from({ length: s }, (n, a) => new Date(t, e + 1, a + 1)), T = (t, e) => {
|
|
62
|
+
const s = new Date(e, 0, 4), n = (s.getDay() + 6) % 7, a = new Date(s);
|
|
63
|
+
a.setDate(s.getDate() - n);
|
|
64
|
+
const i = new Date(a);
|
|
65
|
+
return i.setDate(a.getDate() + (t - 1) * 7), i;
|
|
66
66
|
}, Ze = (t, e) => {
|
|
67
|
-
const s = new Date(t, e, 1).getDay(),
|
|
67
|
+
const s = new Date(t, e, 1).getDay(), n = new Date(t, e + 1, 0).getDate(), a = [];
|
|
68
68
|
let i = [];
|
|
69
|
-
for (let l = 1 - s; l <=
|
|
69
|
+
for (let l = 1 - s; l <= n; l++) {
|
|
70
70
|
const h = new Date(t, e, l);
|
|
71
|
-
i.push(l > 0 ? h : null), (i.length === 7 || l ===
|
|
71
|
+
i.push(l > 0 ? h : null), (i.length === 7 || l === n) && (a.push([...i]), i = []);
|
|
72
72
|
}
|
|
73
|
-
return
|
|
73
|
+
return a;
|
|
74
74
|
}, et = (t, e) => {
|
|
75
|
-
const s = new Date(t, e + 1, 0).getDate(),
|
|
76
|
-
let
|
|
75
|
+
const s = new Date(t, e + 1, 0).getDate(), n = [];
|
|
76
|
+
let a = [];
|
|
77
77
|
for (let i = 1; i <= s; i++)
|
|
78
|
-
|
|
79
|
-
return
|
|
78
|
+
a.push(new Date(t, e, i)), a.length === 7 && (n.push(a), a = []);
|
|
79
|
+
return a.length > 0 && n.push(a), n;
|
|
80
80
|
}, de = (t, e, s) => {
|
|
81
|
-
const
|
|
82
|
-
return
|
|
83
|
-
}, he = ({ day: t, month: e, year: s, weekNumber:
|
|
81
|
+
const n = /* @__PURE__ */ new Date();
|
|
82
|
+
return n.getDate() === t && n.getMonth() === e && n.getFullYear() === s;
|
|
83
|
+
}, he = ({ day: t, month: e, year: s, weekNumber: n, selectWeek: a }) => {
|
|
84
84
|
const i = de(t, e, s);
|
|
85
85
|
return y({
|
|
86
86
|
text: t || "",
|
|
@@ -90,10 +90,10 @@ const oe = (t) => {
|
|
|
90
90
|
${i ? "bg-accent text-accent-foreground" : ""}
|
|
91
91
|
hover:bg-primary hover:text-primary-foreground
|
|
92
92
|
`,
|
|
93
|
-
click: () => n
|
|
93
|
+
click: () => a(n, s)
|
|
94
94
|
});
|
|
95
95
|
}, ue = (t, e) => {
|
|
96
|
-
const s = new Date(t, e, 1).getDay(),
|
|
96
|
+
const s = new Date(t, e, 1).getDay(), n = new Date(t, e + 1, 0).getDate(), a = re(t, e, s), i = Array.from({ length: n }, (r, p) => new Date(t, e, p + 1)), l = (a.length + i.length) % 7, h = l === 0 ? 0 : 7 - l, c = ce(t, e, h), f = [...a, ...i, ...c], g = [];
|
|
97
97
|
for (let r = 0; r < f.length; r += 7) {
|
|
98
98
|
const p = f.slice(r, r + 7), k = p.find((F) => F) || new Date(t, e, 1), { weekNumber: U, year: Y } = le(k);
|
|
99
99
|
g.push({
|
|
@@ -103,8 +103,8 @@ const oe = (t) => {
|
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
return g;
|
|
106
|
-
}, fe = ({ selectWeek: t }) => E("month", (e, s, { data:
|
|
107
|
-
const { year:
|
|
106
|
+
}, fe = ({ selectWeek: t }) => E("month", (e, s, { data: n }) => {
|
|
107
|
+
const { year: a, month: i, currentDate: l } = n, h = ue(a, i);
|
|
108
108
|
return o(
|
|
109
109
|
{ class: "grid grid-cols-8 gap-1 text-sm px-4 py-2" },
|
|
110
110
|
[
|
|
@@ -193,12 +193,12 @@ class tt extends u {
|
|
|
193
193
|
* @returns {Data}
|
|
194
194
|
*/
|
|
195
195
|
setData() {
|
|
196
|
-
const e = /* @__PURE__ */ new Date(), s = this.selectedWeek || this.calculateCurrentWeek(e),
|
|
196
|
+
const e = /* @__PURE__ */ new Date(), s = this.selectedWeek || this.calculateCurrentWeek(e), n = T(s, e.getFullYear());
|
|
197
197
|
return new L({
|
|
198
|
-
monthName: this.getMonthName(
|
|
199
|
-
year:
|
|
200
|
-
month:
|
|
201
|
-
currentDate:
|
|
198
|
+
monthName: this.getMonthName(n.getMonth()),
|
|
199
|
+
year: n.getFullYear(),
|
|
200
|
+
month: n.getMonth(),
|
|
201
|
+
currentDate: n.getDate(),
|
|
202
202
|
currentWeek: s
|
|
203
203
|
});
|
|
204
204
|
}
|
|
@@ -219,10 +219,10 @@ class tt extends u {
|
|
|
219
219
|
* @returns {number}
|
|
220
220
|
*/
|
|
221
221
|
calculateCurrentWeek(e) {
|
|
222
|
-
const s = new Date(e.valueOf()),
|
|
223
|
-
s.setDate(s.getDate() -
|
|
224
|
-
const
|
|
225
|
-
return s.setMonth(0, 1), s.getDay() !== 4 && s.setMonth(0, 1 + (4 - s.getDay() + 7) % 7), 1 + Math.ceil((
|
|
222
|
+
const s = new Date(e.valueOf()), n = (e.getDay() + 6) % 7;
|
|
223
|
+
s.setDate(s.getDate() - n + 3);
|
|
224
|
+
const a = s.valueOf();
|
|
225
|
+
return s.setMonth(0, 1), s.getDay() !== 4 && s.setMonth(0, 1 + (4 - s.getDay() + 7) % 7), 1 + Math.ceil((a - s) / 6048e5);
|
|
226
226
|
}
|
|
227
227
|
/**
|
|
228
228
|
* Gets the name of the month.
|
|
@@ -240,8 +240,8 @@ class tt extends u {
|
|
|
240
240
|
*/
|
|
241
241
|
goToPreviousMonth() {
|
|
242
242
|
const e = this.data;
|
|
243
|
-
let { year: s, month:
|
|
244
|
-
|
|
243
|
+
let { year: s, month: n } = e;
|
|
244
|
+
n === 0 ? (n = 11, s--) : n--, this.setDate(n, s);
|
|
245
245
|
}
|
|
246
246
|
/**
|
|
247
247
|
* Updates the calendar to show the next month.
|
|
@@ -250,8 +250,8 @@ class tt extends u {
|
|
|
250
250
|
*/
|
|
251
251
|
goToNextMonth() {
|
|
252
252
|
const e = this.data;
|
|
253
|
-
let { year: s, month:
|
|
254
|
-
|
|
253
|
+
let { year: s, month: n } = e;
|
|
254
|
+
n === 11 ? (n = 0, s++) : n++, this.setDate(n, s);
|
|
255
255
|
}
|
|
256
256
|
/**
|
|
257
257
|
* Sets the selected date.
|
|
@@ -261,12 +261,12 @@ class tt extends u {
|
|
|
261
261
|
* @param {number|null} [date=null]
|
|
262
262
|
* @returns {void}
|
|
263
263
|
*/
|
|
264
|
-
setDate(e, s,
|
|
264
|
+
setDate(e, s, n) {
|
|
265
265
|
this.data.set({
|
|
266
266
|
year: s,
|
|
267
267
|
month: e,
|
|
268
268
|
monthName: this.getMonthName(e)
|
|
269
|
-
}),
|
|
269
|
+
}), n && (this.data.currentDate = n);
|
|
270
270
|
}
|
|
271
271
|
/**
|
|
272
272
|
* Handles week selection.
|
|
@@ -276,8 +276,8 @@ class tt extends u {
|
|
|
276
276
|
*/
|
|
277
277
|
selectWeek(e, s) {
|
|
278
278
|
this.data.currentWeek = e;
|
|
279
|
-
const
|
|
280
|
-
this.setDate(
|
|
279
|
+
const n = T(e, s);
|
|
280
|
+
this.setDate(n.getMonth(), n.getFullYear(), n.getDate()), typeof this.selectedCallBack == "function" && this.selectedCallBack(e);
|
|
281
281
|
}
|
|
282
282
|
/**
|
|
283
283
|
* Renders the WeekCalendar component.
|
|
@@ -297,18 +297,19 @@ class tt extends u {
|
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
const pe = (t, e) => {
|
|
300
|
+
console.log(t);
|
|
300
301
|
const s = t.toggleAllSelectedRows();
|
|
301
302
|
e.state.checked = !s;
|
|
302
303
|
}, me = (t) => P({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class || ""}` }, [
|
|
303
|
-
H((e) => new te({ class: "mr-2", onChange: (s,
|
|
304
|
-
]), we = ({ align: t, sortable: e, key: s, label:
|
|
304
|
+
H((e) => new te({ class: "mr-2", onChange: (s, n) => pe(e, n) }))
|
|
305
|
+
]), we = ({ align: t, sortable: e, key: s, label: n, sort: a, class: i }) => {
|
|
305
306
|
const l = t || "justify-start";
|
|
306
307
|
return P({
|
|
307
308
|
class: `cursor-pointer py-3 px-4 text-base ${i || ""}`,
|
|
308
|
-
click: e && (() =>
|
|
309
|
+
click: e && (() => a(s))
|
|
309
310
|
}, [
|
|
310
311
|
o({ class: `flex flex-auto w-full items-center ${l}` }, [
|
|
311
|
-
v(
|
|
312
|
+
v(n),
|
|
312
313
|
e && Q({ class: "ml-2", html: w.arrows.upDown })
|
|
313
314
|
])
|
|
314
315
|
]);
|
|
@@ -323,11 +324,11 @@ const pe = (t, e) => {
|
|
|
323
324
|
sort: t.sort
|
|
324
325
|
})]
|
|
325
326
|
})
|
|
326
|
-
]), be = ({ key: t, rows: e, selectRow: s, rowItem:
|
|
327
|
+
]), be = ({ key: t, rows: e, selectRow: s, rowItem: n }) => new _({
|
|
327
328
|
cache: "list",
|
|
328
329
|
key: t,
|
|
329
330
|
items: e,
|
|
330
|
-
rowItem: (
|
|
331
|
+
rowItem: (a) => n(a, s),
|
|
331
332
|
class: "divide-y divide-border"
|
|
332
333
|
}), ke = M(
|
|
333
334
|
{
|
|
@@ -387,8 +388,8 @@ const pe = (t, e) => {
|
|
|
387
388
|
selectRow(t) {
|
|
388
389
|
const e = t.selected ?? !1;
|
|
389
390
|
t.selected = !e;
|
|
390
|
-
const s = this.data.get("selectedRows"),
|
|
391
|
-
this.data.selectedRows =
|
|
391
|
+
const s = this.data.get("selectedRows"), n = t.selected ? [...s, t] : s.filter((a) => a !== t);
|
|
392
|
+
this.data.selectedRows = n, this.updateSelected();
|
|
392
393
|
},
|
|
393
394
|
/**
|
|
394
395
|
* Renders the DataTable component.
|
|
@@ -488,12 +489,13 @@ const pe = (t, e) => {
|
|
|
488
489
|
* @returns {object}
|
|
489
490
|
*/
|
|
490
491
|
render() {
|
|
492
|
+
console.log(this);
|
|
491
493
|
const e = this.rows, s = this.border !== !1 ? "border" : "";
|
|
492
494
|
return o({ class: "w-full" }, [
|
|
493
495
|
o({ class: `w-full rounded-md ${s} overflow-x-auto` }, [
|
|
494
496
|
R({ class: "w-full" }, [
|
|
495
497
|
// @ts-ignore
|
|
496
|
-
t.headers && j({ headers: t.headers, sort: (
|
|
498
|
+
t.headers && j({ headers: t.headers, sort: (n) => this.sortRows(n) }),
|
|
497
499
|
// @ts-ignore
|
|
498
500
|
t.customHeader ?? null,
|
|
499
501
|
J({
|
|
@@ -533,7 +535,7 @@ const pe = (t, e) => {
|
|
|
533
535
|
De(s, e)
|
|
534
536
|
])), Le = (t) => t.split(" ").map((s) => s[0]).join(""), Ce = d((t) => D({ class: "fadeIn flex justify-between gap-x-6 py-4 px-4 rounded-md hover:bg-muted/50" }, [
|
|
535
537
|
o({ class: "flex min-w-0 gap-x-4" }, [
|
|
536
|
-
|
|
538
|
+
ae({ src: t.image, alt: t.name, fallbackText: Le(t.name) }),
|
|
537
539
|
xe({ name: t.name, email: t.email })
|
|
538
540
|
]),
|
|
539
541
|
Se({
|
|
@@ -541,21 +543,21 @@ const pe = (t, e) => {
|
|
|
541
543
|
lastSeen: t.lastSeen,
|
|
542
544
|
status: t.status
|
|
543
545
|
})
|
|
544
|
-
])),
|
|
546
|
+
])), nt = d((t) => new Z({
|
|
545
547
|
cache: "list",
|
|
546
548
|
key: "name",
|
|
547
549
|
items: t.users,
|
|
548
550
|
role: "list",
|
|
549
551
|
class: "divide-y divide-border",
|
|
550
552
|
rowItem: Ce
|
|
551
|
-
})), Ie = (t, e) => e.includes(t), Be = (t, e, s) => t.exact ? s === e : Ie(e, s), Te = ({ text: t, href: e, exact: s, hidden:
|
|
553
|
+
})), Ie = (t, e) => e.includes(t), Be = (t, e, s) => t.exact ? s === e : Ie(e, s), Te = ({ text: t, href: e, exact: s, hidden: n }) => new z({
|
|
552
554
|
text: t,
|
|
553
555
|
href: e,
|
|
554
556
|
exact: s,
|
|
555
557
|
dataSet: ["selected", ["state", !0, "active"]],
|
|
556
|
-
class: `${
|
|
558
|
+
class: `${n ? "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`
|
|
557
559
|
});
|
|
558
|
-
class
|
|
560
|
+
class at extends u {
|
|
559
561
|
/**
|
|
560
562
|
* This will declare the props for the compiler.
|
|
561
563
|
*
|
|
@@ -608,10 +610,10 @@ class nt extends u {
|
|
|
608
610
|
updateLinks(e) {
|
|
609
611
|
let s = !1;
|
|
610
612
|
this.deactivateAllLinks();
|
|
611
|
-
for (const
|
|
612
|
-
if (!
|
|
613
|
+
for (const n of this.links) {
|
|
614
|
+
if (!n.rendered)
|
|
613
615
|
continue;
|
|
614
|
-
Be(
|
|
616
|
+
Be(n, n.getLinkPath(), e) ? (this.updateLink(n, !0), s = !0) : this.updateLink(n, !1);
|
|
615
617
|
}
|
|
616
618
|
!s && this.links[0] && this.updateLink(this.links[0], !0);
|
|
617
619
|
}
|
|
@@ -640,8 +642,8 @@ class nt extends u {
|
|
|
640
642
|
* @param {object} option
|
|
641
643
|
* @returns {object}
|
|
642
644
|
*/
|
|
643
|
-
addLink({ label: e, href: s, exact:
|
|
644
|
-
const i = Te({ text: e, href: s, exact:
|
|
645
|
+
addLink({ label: e, href: s, exact: n, hidden: a }) {
|
|
646
|
+
const i = Te({ text: e, href: s, exact: n, hidden: a });
|
|
645
647
|
return this.links.push(i), i;
|
|
646
648
|
}
|
|
647
649
|
/**
|
|
@@ -786,8 +788,8 @@ class ot extends A {
|
|
|
786
788
|
["loading", {
|
|
787
789
|
loading: !0
|
|
788
790
|
}],
|
|
789
|
-
["docked", (s,
|
|
790
|
-
s ? (
|
|
791
|
+
["docked", (s, n) => {
|
|
792
|
+
s ? (n.className = this.getDockedClassName(), e.appendChild(n), document.documentElement.style.overflowY = "auto") : (n.className = this.getClassName(), app.root.appendChild(n), document.documentElement.style.overflowY = "hidden");
|
|
791
793
|
}]
|
|
792
794
|
]
|
|
793
795
|
},
|
|
@@ -892,7 +894,7 @@ class lt extends A {
|
|
|
892
894
|
this.container = e, this.initialize();
|
|
893
895
|
}
|
|
894
896
|
}
|
|
895
|
-
const We = d(({ index: t, click: e, state: s },
|
|
897
|
+
const We = d(({ index: t, click: e, state: s }, n) => D({
|
|
896
898
|
class: "p-2 cursor-pointer hover:bg-muted/50",
|
|
897
899
|
onState: [
|
|
898
900
|
[s, "selectedIndex", {
|
|
@@ -901,9 +903,9 @@ const We = d(({ index: t, click: e, state: s }, a) => D({
|
|
|
901
903
|
}]
|
|
902
904
|
],
|
|
903
905
|
click: () => e(t)
|
|
904
|
-
},
|
|
906
|
+
}, n)), Pe = d(({ selectOption: t, state: e }) => b({
|
|
905
907
|
class: "border rounded-md list-none m-0 p-0 max-h-[400px] overflow-y-auto",
|
|
906
|
-
for: ["filteredOptions", (s,
|
|
908
|
+
for: ["filteredOptions", (s, n) => We({ index: n, click: t, state: e }, s.label)]
|
|
907
909
|
})), Re = d((t) => o({ class: "relative flex items-center" }, [
|
|
908
910
|
se({
|
|
909
911
|
cache: "input",
|
|
@@ -920,12 +922,12 @@ const We = d(({ index: t, click: e, state: s }, a) => D({
|
|
|
920
922
|
])
|
|
921
923
|
])), Oe = (t) => o({
|
|
922
924
|
class: "relative flex fle-auto flex-col",
|
|
923
|
-
onState: ["open", (e, s,
|
|
925
|
+
onState: ["open", (e, s, n) => {
|
|
924
926
|
if (e)
|
|
925
927
|
return new ie({
|
|
926
928
|
cache: "dropdown",
|
|
927
|
-
parent:
|
|
928
|
-
button:
|
|
929
|
+
parent: n,
|
|
930
|
+
button: n.input,
|
|
929
931
|
size: "xl"
|
|
930
932
|
}, [
|
|
931
933
|
Pe(t)
|
|
@@ -966,7 +968,7 @@ const We = d(({ index: t, click: e, state: s }, a) => D({
|
|
|
966
968
|
const t = this.data.filteredOptions;
|
|
967
969
|
let { searchQuery: e } = this.state;
|
|
968
970
|
e = e.toLowerCase();
|
|
969
|
-
const s = t.findIndex((
|
|
971
|
+
const s = t.findIndex((n) => n.label.toLowerCase() === e);
|
|
970
972
|
s >= 0 && (this.state.selectedIndex = s);
|
|
971
973
|
},
|
|
972
974
|
/**
|
|
@@ -1131,11 +1133,11 @@ class ct extends u {
|
|
|
1131
1133
|
const s = this.options;
|
|
1132
1134
|
if (!s || s.length < 1)
|
|
1133
1135
|
return;
|
|
1134
|
-
const
|
|
1135
|
-
for (const
|
|
1136
|
-
if (
|
|
1137
|
-
return
|
|
1138
|
-
return
|
|
1136
|
+
const n = s[0];
|
|
1137
|
+
for (const a of s)
|
|
1138
|
+
if (a.value === e)
|
|
1139
|
+
return a.layout;
|
|
1140
|
+
return n.layout;
|
|
1139
1141
|
}
|
|
1140
1142
|
/**
|
|
1141
1143
|
* This will setup the states.
|
|
@@ -1147,8 +1149,8 @@ class ct extends u {
|
|
|
1147
1149
|
return {
|
|
1148
1150
|
selected: {
|
|
1149
1151
|
state: this.getFirstValue(),
|
|
1150
|
-
callBack(
|
|
1151
|
-
s === "function" && e(
|
|
1152
|
+
callBack(n) {
|
|
1153
|
+
s === "function" && e(n);
|
|
1152
1154
|
}
|
|
1153
1155
|
}
|
|
1154
1156
|
};
|
|
@@ -1271,14 +1273,14 @@ class Ee extends u {
|
|
|
1271
1273
|
* @returns {void}
|
|
1272
1274
|
*/
|
|
1273
1275
|
updateLinks(e) {
|
|
1274
|
-
let s = !1,
|
|
1276
|
+
let s = !1, n = this.links[0];
|
|
1275
1277
|
this.deactivateAllLinks();
|
|
1276
|
-
for (const
|
|
1277
|
-
if (
|
|
1278
|
-
this.updateLink(
|
|
1278
|
+
for (const a of this.links)
|
|
1279
|
+
if (a.rendered !== !1 && (s = Ye(a, e), s === !0)) {
|
|
1280
|
+
this.updateLink(a, !0);
|
|
1279
1281
|
break;
|
|
1280
1282
|
}
|
|
1281
|
-
s !== !0 &&
|
|
1283
|
+
s !== !0 && n && this.updateLink(n, !0);
|
|
1282
1284
|
}
|
|
1283
1285
|
/**
|
|
1284
1286
|
* This will deactivate all links.
|
|
@@ -1305,9 +1307,9 @@ class Ee extends u {
|
|
|
1305
1307
|
* @param {object} option
|
|
1306
1308
|
* @returns {object}
|
|
1307
1309
|
*/
|
|
1308
|
-
addLink({ label: e, href: s, exact:
|
|
1309
|
-
const
|
|
1310
|
-
return this.links.push(
|
|
1310
|
+
addLink({ label: e, href: s, exact: n }) {
|
|
1311
|
+
const a = Fe({ text: e, href: s, exact: n });
|
|
1312
|
+
return this.links.push(a), a;
|
|
1311
1313
|
}
|
|
1312
1314
|
/**
|
|
1313
1315
|
* This will remove all the links.
|
|
@@ -1351,9 +1353,9 @@ class ht extends u {
|
|
|
1351
1353
|
*/
|
|
1352
1354
|
addGroup() {
|
|
1353
1355
|
let e;
|
|
1354
|
-
const s = [],
|
|
1355
|
-
for (let
|
|
1356
|
-
e = a
|
|
1356
|
+
const s = [], n = this.options;
|
|
1357
|
+
for (let a = 0, i = n.length; a < i; a++)
|
|
1358
|
+
e = n[a], s.push(
|
|
1357
1359
|
{
|
|
1358
1360
|
uri: e.uri || e.href,
|
|
1359
1361
|
component: e.component,
|
|
@@ -1412,12 +1414,12 @@ class He extends u {
|
|
|
1412
1414
|
* @returns {Array} An array of [eventName, element, callback] definitions.
|
|
1413
1415
|
*/
|
|
1414
1416
|
setupEvents() {
|
|
1415
|
-
const e = this.panel, s = this.pointerPosition.bind(this),
|
|
1417
|
+
const e = this.panel, s = this.pointerPosition.bind(this), n = this.pointerUp.bind(this), a = this.pointerDown.bind(this), i = this.resize.bind(this), l = { passive: !1 };
|
|
1416
1418
|
return [
|
|
1417
1419
|
["pointermove", e, s, l],
|
|
1418
|
-
["pointerup", e,
|
|
1419
|
-
["pointerdown", e,
|
|
1420
|
-
["pointerout", e,
|
|
1420
|
+
["pointerup", e, n],
|
|
1421
|
+
["pointerdown", e, a, l],
|
|
1422
|
+
["pointerout", e, n],
|
|
1421
1423
|
["resize", window, i]
|
|
1422
1424
|
];
|
|
1423
1425
|
}
|
|
@@ -1428,14 +1430,14 @@ class He extends u {
|
|
|
1428
1430
|
* @returns {void}
|
|
1429
1431
|
*/
|
|
1430
1432
|
getEventPosition(e) {
|
|
1431
|
-
let s,
|
|
1432
|
-
const
|
|
1433
|
+
let s, n;
|
|
1434
|
+
const a = this.canvas, i = a.width / parseInt(a.style.width), l = a.getBoundingClientRect();
|
|
1433
1435
|
if (e.touches && e.touches.length) {
|
|
1434
1436
|
const f = e.touches[0];
|
|
1435
|
-
s = f.clientX,
|
|
1437
|
+
s = f.clientX, n = f.clientY;
|
|
1436
1438
|
} else
|
|
1437
|
-
s = e.x || e.clientX,
|
|
1438
|
-
const h = parseInt((s - l.left) * i), c = parseInt((
|
|
1439
|
+
s = e.x || e.clientX, n = e.y || e.clientY;
|
|
1440
|
+
const h = parseInt((s - l.left) * i), c = parseInt((n - l.top) * i);
|
|
1439
1441
|
this.mouse.x = h, this.mouse.y = c;
|
|
1440
1442
|
}
|
|
1441
1443
|
/**
|
|
@@ -1447,8 +1449,8 @@ class He extends u {
|
|
|
1447
1449
|
*/
|
|
1448
1450
|
pointerDown(e) {
|
|
1449
1451
|
e.preventDefault(), e.stopPropagation(), this.getEventPosition(e);
|
|
1450
|
-
const { ctx: s, mouse:
|
|
1451
|
-
s.beginPath(), s.moveTo(
|
|
1452
|
+
const { ctx: s, mouse: n } = this;
|
|
1453
|
+
s.beginPath(), s.moveTo(n.x, n.y), n.status = "down", this.startTimer();
|
|
1452
1454
|
}
|
|
1453
1455
|
/**
|
|
1454
1456
|
* Called when the pointer goes up or leaves the canvas area.
|
|
@@ -1476,12 +1478,12 @@ class He extends u {
|
|
|
1476
1478
|
* @returns {void}
|
|
1477
1479
|
*/
|
|
1478
1480
|
resize() {
|
|
1479
|
-
const { canvas: e, ctx: s } = this,
|
|
1480
|
-
if (this.scale(), this.setupBackground(s),
|
|
1481
|
-
const
|
|
1482
|
-
I.on("load",
|
|
1483
|
-
s.drawImage(
|
|
1484
|
-
}),
|
|
1481
|
+
const { canvas: e, ctx: s } = this, n = e.toDataURL();
|
|
1482
|
+
if (this.scale(), this.setupBackground(s), n !== "data:,") {
|
|
1483
|
+
const a = new window.Image();
|
|
1484
|
+
I.on("load", a, function i() {
|
|
1485
|
+
s.drawImage(a, 0, 0), I.off("load", a, i);
|
|
1486
|
+
}), a.src = n;
|
|
1485
1487
|
}
|
|
1486
1488
|
this.draw();
|
|
1487
1489
|
}
|
|
@@ -1510,10 +1512,10 @@ class He extends u {
|
|
|
1510
1512
|
* @returns {void}
|
|
1511
1513
|
*/
|
|
1512
1514
|
scale() {
|
|
1513
|
-
const e = this.canvas, s = this.container,
|
|
1515
|
+
const e = this.canvas, s = this.container, n = B.getSize(s), a = this.targetSize, i = a.width, l = a.height;
|
|
1514
1516
|
let h = i + "px", c = l + "px";
|
|
1515
|
-
if (this.width = e.width = i, this.height = e.height = l,
|
|
1516
|
-
const f =
|
|
1517
|
+
if (this.width = e.width = i, this.height = e.height = l, n.width !== 0 && n.height !== 0) {
|
|
1518
|
+
const f = n.width, g = n.height, r = f / i, p = g / l, k = Math.min(r, p);
|
|
1517
1519
|
h = i * k + "px", c = l * k + "px";
|
|
1518
1520
|
}
|
|
1519
1521
|
e.style.width = h, e.style.height = c;
|
|
@@ -1536,8 +1538,8 @@ class He extends u {
|
|
|
1536
1538
|
drawBottomLine(e) {
|
|
1537
1539
|
const s = this.canvas;
|
|
1538
1540
|
e.globalAlpha = 1, e.shadowBlur = 0;
|
|
1539
|
-
const
|
|
1540
|
-
e.beginPath(), e.moveTo(
|
|
1541
|
+
const n = this.margin.x, a = this.height - this.margin.y;
|
|
1542
|
+
e.beginPath(), e.moveTo(n, a), e.lineTo(s.width - this.margin.x, a), e.lineWidth = this.baseLineWidth, e.strokeStyle = this.baseStrokeColor, e.stroke(), e.closePath();
|
|
1541
1543
|
}
|
|
1542
1544
|
/**
|
|
1543
1545
|
* Adds a line to the current path, updating the 'signed' status.
|
|
@@ -1548,10 +1550,10 @@ class He extends u {
|
|
|
1548
1550
|
* @param {string} color The stroke color.
|
|
1549
1551
|
* @returns {void}
|
|
1550
1552
|
*/
|
|
1551
|
-
addLine(e, s,
|
|
1553
|
+
addLine(e, s, n, a) {
|
|
1552
1554
|
this.signed || (this.signed = !0);
|
|
1553
|
-
const i = Math.round(s), l = Math.round(
|
|
1554
|
-
e.lineWidth = this.lineWidth, e.strokeStyle =
|
|
1555
|
+
const i = Math.round(s), l = Math.round(n);
|
|
1556
|
+
e.lineWidth = this.lineWidth, e.strokeStyle = a, e.lineTo(i, l), e.stroke();
|
|
1555
1557
|
}
|
|
1556
1558
|
/**
|
|
1557
1559
|
* Clears the canvas, sets signed to false, and re-initializes
|
|
@@ -1607,7 +1609,7 @@ class ut extends u {
|
|
|
1607
1609
|
*/
|
|
1608
1610
|
render() {
|
|
1609
1611
|
return o({ class: "signature-panel relative flex flex-auto overflow-hidden select-none" }, [
|
|
1610
|
-
|
|
1612
|
+
ne({
|
|
1611
1613
|
cache: "hiddenInput",
|
|
1612
1614
|
required: !0,
|
|
1613
1615
|
bind: this.path + ".data"
|
|
@@ -1674,7 +1676,7 @@ export {
|
|
|
1674
1676
|
be as D,
|
|
1675
1677
|
we as H,
|
|
1676
1678
|
lt as I,
|
|
1677
|
-
|
|
1679
|
+
at as N,
|
|
1678
1680
|
A as O,
|
|
1679
1681
|
Je as P,
|
|
1680
1682
|
st as S,
|
|
@@ -1691,7 +1693,7 @@ export {
|
|
|
1691
1693
|
fe as h,
|
|
1692
1694
|
ge as i,
|
|
1693
1695
|
ke as j,
|
|
1694
|
-
|
|
1696
|
+
nt as k,
|
|
1695
1697
|
ot as l,
|
|
1696
1698
|
rt as m,
|
|
1697
1699
|
ct as n,
|
package/package.json
CHANGED