@base-framework/ui 0.0.4 → 0.0.6
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 +3 -3
- package/dist/mobile-nav-wrapper-BS9uUekR.js +505 -0
- package/dist/organisms.es.js +2 -2
- package/dist/pages.es.js +1 -1
- package/dist/sidebar-menu-page-DN5qYk-Y.js +208 -0
- package/dist/{tab-C_dZb2qH.js → tab-DE7bmr2y.js} +263 -328
- package/dist/types/components/organisms/panel.d.ts +3 -1
- package/dist/types/components/organisms/tabs/tab-group.d.ts +2 -2
- package/dist/types/components/organisms/tabs/tab-navigation.d.ts +2 -2
- package/dist/types/components/pages/page.d.ts +2 -0
- package/package.json +1 -1
- package/dist/mobile-nav-wrapper-7Qul1-mt.js +0 -578
- package/dist/sidebar-menu-page-M8hr9onX.js +0 -224
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
var z = Object.defineProperty;
|
|
2
|
-
var Y = (e,
|
|
3
|
-
var
|
|
4
|
-
import { Button as y, Div as o, On as U, Span as v, Th as B, UseParent as F, I as E, Thead as Q, Tr as H, Table as K, P as
|
|
5
|
-
import { Atom as
|
|
2
|
+
var Y = (e, t, s) => t in e ? z(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
+
var b = (e, t, s) => Y(e, typeof t != "symbol" ? t + "" : t, s);
|
|
4
|
+
import { Button as y, Div as o, On as U, Span as v, Th as B, UseParent as F, I as E, Thead as Q, Tr as H, Table as K, P as g, Li as D, Time as _, Nav as S, Ul as p, Section as I } from "@base-framework/atoms";
|
|
5
|
+
import { Atom as d, Component as u, Data as L, DateTime as G, Jot as M, router as k, NavLink as R } from "@base-framework/base";
|
|
6
6
|
import { B as T, I as N } from "./icon-B9QUT2NY.js";
|
|
7
7
|
import { Icons as w } from "./icons.es.js";
|
|
8
8
|
import { TableBody as V, List as q } from "@base-framework/organisms";
|
|
9
9
|
import { C as J, I as X } from "./inputs-BF3C3KfF.js";
|
|
10
10
|
import { A as Z, P as ee } from "./calendar-DR_svCOR.js";
|
|
11
|
-
|
|
11
|
+
d((e, t) => ({
|
|
12
12
|
class: "flex items-center px-4 py-2",
|
|
13
13
|
...e,
|
|
14
|
-
children:
|
|
14
|
+
children: t
|
|
15
15
|
}));
|
|
16
|
-
|
|
16
|
+
d(({ value: e, label: t }) => y({
|
|
17
17
|
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",
|
|
18
18
|
onState: ["performance", { active: e }],
|
|
19
19
|
dataSet: ["performance", ["state", e, "active"]],
|
|
20
|
-
click: (
|
|
21
|
-
},
|
|
22
|
-
class _e extends
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
click: (s, { state: n }) => n.performance = e
|
|
21
|
+
}, t));
|
|
22
|
+
class _e extends u {
|
|
23
|
+
/**
|
|
24
|
+
* This will declare the props for the compiler.
|
|
25
|
+
*
|
|
26
|
+
* @returns {void}
|
|
27
|
+
*/
|
|
28
|
+
declareProps() {
|
|
29
|
+
this.class = "";
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
31
32
|
* This will render the component.
|
|
@@ -37,15 +38,15 @@ class _e extends h {
|
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
const te = (e) => {
|
|
40
|
-
const
|
|
41
|
-
return
|
|
42
|
-
|
|
41
|
+
const t = new Date(e, 11, 31), s = new Date(e, 0, 1);
|
|
42
|
+
return t.getDay() === 4 || // December 31 is a Thursday
|
|
43
|
+
s.getDay() === 4;
|
|
43
44
|
}, se = (e) => {
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
const n =
|
|
45
|
+
const t = new Date(e.valueOf()), s = (t.getDay() + 6) % 7;
|
|
46
|
+
t.setDate(t.getDate() - s + 3);
|
|
47
|
+
const n = t.getFullYear(), a = new Date(n, 0, 4);
|
|
47
48
|
a.setDate(a.getDate() - (a.getDay() + 6) % 7);
|
|
48
|
-
const i = Math.ceil((
|
|
49
|
+
const i = Math.ceil((t - a) / 6048e5) + 1;
|
|
49
50
|
return i > 52 && !te(n) ? {
|
|
50
51
|
weekNumber: 1,
|
|
51
52
|
year: n + 1
|
|
@@ -53,37 +54,37 @@ const te = (e) => {
|
|
|
53
54
|
weekNumber: i,
|
|
54
55
|
year: n
|
|
55
56
|
};
|
|
56
|
-
}, ne = (e,
|
|
57
|
-
if (
|
|
58
|
-
const n = new Date(e,
|
|
57
|
+
}, ne = (e, t, s) => {
|
|
58
|
+
if (s === 0) return [];
|
|
59
|
+
const n = new Date(e, t, 0).getDate();
|
|
59
60
|
return Array.from(
|
|
60
|
-
{ length:
|
|
61
|
-
(a, i) => new Date(e,
|
|
61
|
+
{ length: s },
|
|
62
|
+
(a, i) => new Date(e, t - 1, n - s + i + 1)
|
|
62
63
|
);
|
|
63
|
-
}, ae = (e,
|
|
64
|
-
const
|
|
65
|
-
a.setDate(
|
|
64
|
+
}, ae = (e, t, s) => Array.from({ length: s }, (n, a) => new Date(e, t + 1, a + 1)), C = (e, t) => {
|
|
65
|
+
const s = new Date(t, 0, 4), n = (s.getDay() + 6) % 7, a = new Date(s);
|
|
66
|
+
a.setDate(s.getDate() - n);
|
|
66
67
|
const i = new Date(a);
|
|
67
68
|
return i.setDate(a.getDate() + (e - 1) * 7), i;
|
|
68
|
-
}, Ge = (e,
|
|
69
|
-
const
|
|
69
|
+
}, Ge = (e, t) => {
|
|
70
|
+
const s = new Date(e, t, 1).getDay(), n = new Date(e, t + 1, 0).getDate(), a = [];
|
|
70
71
|
let i = [];
|
|
71
|
-
for (let r = 1 -
|
|
72
|
-
const
|
|
73
|
-
i.push(r > 0 ?
|
|
72
|
+
for (let r = 1 - s; r <= n; r++) {
|
|
73
|
+
const h = new Date(e, t, r);
|
|
74
|
+
i.push(r > 0 ? h : null), (i.length === 7 || r === n) && (a.push([...i]), i = []);
|
|
74
75
|
}
|
|
75
76
|
return a;
|
|
76
|
-
}, Ve = (e,
|
|
77
|
-
const
|
|
77
|
+
}, Ve = (e, t) => {
|
|
78
|
+
const s = new Date(e, t + 1, 0).getDate(), n = [];
|
|
78
79
|
let a = [];
|
|
79
|
-
for (let i = 1; i <=
|
|
80
|
-
a.push(new Date(e,
|
|
80
|
+
for (let i = 1; i <= s; i++)
|
|
81
|
+
a.push(new Date(e, t, i)), a.length === 7 && (n.push(a), a = []);
|
|
81
82
|
return a.length > 0 && n.push(a), n;
|
|
82
|
-
}, ie = (e,
|
|
83
|
+
}, ie = (e, t, s) => {
|
|
83
84
|
const n = /* @__PURE__ */ new Date();
|
|
84
|
-
return n.getDate() === e && n.getMonth() ===
|
|
85
|
-
}, oe = ({ day: e, month:
|
|
86
|
-
const i = ie(e,
|
|
85
|
+
return n.getDate() === e && n.getMonth() === t && n.getFullYear() === s;
|
|
86
|
+
}, oe = ({ day: e, month: t, year: s, weekNumber: n, selectWeek: a }) => {
|
|
87
|
+
const i = ie(e, t, s);
|
|
87
88
|
return y({
|
|
88
89
|
text: e || "",
|
|
89
90
|
disabled: !e,
|
|
@@ -92,21 +93,21 @@ const te = (e) => {
|
|
|
92
93
|
${i ? "bg-accent text-accent-foreground" : ""}
|
|
93
94
|
hover:bg-primary hover:text-primary-foreground
|
|
94
95
|
`,
|
|
95
|
-
click: () => a(n,
|
|
96
|
+
click: () => a(n, s)
|
|
96
97
|
});
|
|
97
|
-
}, le = (e,
|
|
98
|
-
const
|
|
99
|
-
for (let
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
weekNumber:
|
|
103
|
-
year:
|
|
104
|
-
days:
|
|
98
|
+
}, le = (e, t) => {
|
|
99
|
+
const s = new Date(e, t, 1).getDay(), n = new Date(e, t + 1, 0).getDate(), a = ne(e, t, s), i = Array.from({ length: n }, (l, x) => new Date(e, t, x + 1)), r = (a.length + i.length) % 7, h = r === 0 ? 0 : 7 - r, c = ae(e, t, h), f = [...a, ...i, ...c], m = [];
|
|
100
|
+
for (let l = 0; l < f.length; l += 7) {
|
|
101
|
+
const x = f.slice(l, l + 7), $ = x.find((j) => j) || new Date(e, t, 1), { weekNumber: P, year: A } = se($);
|
|
102
|
+
m.push({
|
|
103
|
+
weekNumber: P,
|
|
104
|
+
year: A,
|
|
105
|
+
days: x
|
|
105
106
|
});
|
|
106
107
|
}
|
|
107
|
-
return
|
|
108
|
-
}, re = ({ selectWeek: e }) => U("month", (
|
|
109
|
-
const { year: a, month: i, currentDate: r } = n,
|
|
108
|
+
return m;
|
|
109
|
+
}, re = ({ selectWeek: e }) => U("month", (t, s, { data: n }) => {
|
|
110
|
+
const { year: a, month: i, currentDate: r } = n, h = le(a, i);
|
|
110
111
|
return o(
|
|
111
112
|
{ class: "grid grid-cols-8 gap-1 text-sm px-4 py-2" },
|
|
112
113
|
[
|
|
@@ -117,38 +118,38 @@ const te = (e) => {
|
|
|
117
118
|
class: "grid grid-cols-7 col-span-7 text-center text-muted-foreground items-center"
|
|
118
119
|
},
|
|
119
120
|
["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(
|
|
120
|
-
(
|
|
121
|
+
(c) => v({ class: "px-1 py-1", text: c })
|
|
121
122
|
)
|
|
122
123
|
),
|
|
123
124
|
// Render each "week" row
|
|
124
|
-
...
|
|
125
|
-
({ weekNumber:
|
|
125
|
+
...h.map(
|
|
126
|
+
({ weekNumber: c, days: f, year: m }) => o({
|
|
126
127
|
class: "grid grid-cols-8 col-span-8 items-center ring-primary rounded-sm px-1",
|
|
127
128
|
onSet: ["currentWeek", {
|
|
128
|
-
ring:
|
|
129
|
+
ring: c
|
|
129
130
|
}]
|
|
130
131
|
}, [
|
|
131
132
|
// Left column: ISO week number
|
|
132
133
|
o({
|
|
133
134
|
class: "font-medium text-center col-span-1 rounded-sm cursor-pointer",
|
|
134
|
-
click: () => e(
|
|
135
|
+
click: () => e(c, m),
|
|
135
136
|
// If you have a 'currentWeek' state, you can highlight it with 'onSet'
|
|
136
137
|
onSet: ["currentWeek", {
|
|
137
|
-
"text-primary-foreground":
|
|
138
|
-
"bg-primary":
|
|
138
|
+
"text-primary-foreground": c,
|
|
139
|
+
"bg-primary": c
|
|
139
140
|
}],
|
|
140
|
-
text:
|
|
141
|
+
text: c ? `W${c}` : ""
|
|
141
142
|
}),
|
|
142
143
|
// The 7 cells for each day in the row
|
|
143
144
|
o(
|
|
144
145
|
{ class: "grid grid-cols-7 col-span-7 text-center" },
|
|
145
|
-
|
|
146
|
-
(
|
|
147
|
-
year: (
|
|
148
|
-
month: (
|
|
149
|
-
day: (
|
|
150
|
-
week:
|
|
151
|
-
weekNumber:
|
|
146
|
+
f.map(
|
|
147
|
+
(l) => oe({
|
|
148
|
+
year: (l == null ? void 0 : l.getFullYear()) || null,
|
|
149
|
+
month: (l == null ? void 0 : l.getMonth()) || null,
|
|
150
|
+
day: (l == null ? void 0 : l.getDate()) || null,
|
|
151
|
+
week: f,
|
|
152
|
+
weekNumber: c,
|
|
152
153
|
currentDate: r,
|
|
153
154
|
selectWeek: e
|
|
154
155
|
})
|
|
@@ -158,7 +159,7 @@ const te = (e) => {
|
|
|
158
159
|
)
|
|
159
160
|
]
|
|
160
161
|
);
|
|
161
|
-
}), O = ({ label: e, click:
|
|
162
|
+
}), O = ({ label: e, click: t }) => T(
|
|
162
163
|
{
|
|
163
164
|
class: `
|
|
164
165
|
inline-flex items-center justify-center h-7 w-7 bg-transparent p-0
|
|
@@ -166,23 +167,23 @@ const te = (e) => {
|
|
|
166
167
|
${e === "Previous" ? "left-1" : "right-1"}
|
|
167
168
|
focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2
|
|
168
169
|
`,
|
|
169
|
-
click:
|
|
170
|
+
click: t,
|
|
170
171
|
"aria-label": `${e} month`,
|
|
171
172
|
variant: "icon",
|
|
172
173
|
icon: e === "Previous" ? w.chevron.single.left : w.chevron.single.right
|
|
173
174
|
}
|
|
174
|
-
), ce = ({ next: e, previous:
|
|
175
|
+
), ce = ({ next: e, previous: t }) => o({ class: "flex flex-auto min-h-12 text-sm font-medium relative justify-center items-center" }, [
|
|
175
176
|
v("[[monthName]] [[year]]"),
|
|
176
177
|
O({
|
|
177
178
|
label: "Previous",
|
|
178
|
-
click:
|
|
179
|
+
click: t
|
|
179
180
|
}),
|
|
180
181
|
O({
|
|
181
182
|
label: "Next",
|
|
182
183
|
click: e
|
|
183
184
|
})
|
|
184
185
|
]);
|
|
185
|
-
class qe extends
|
|
186
|
+
class qe extends u {
|
|
186
187
|
constructor() {
|
|
187
188
|
super(...arguments);
|
|
188
189
|
/**
|
|
@@ -190,19 +191,19 @@ class qe extends h {
|
|
|
190
191
|
* @member {string} selectedDate
|
|
191
192
|
* @default null
|
|
192
193
|
*/
|
|
193
|
-
|
|
194
|
+
b(this, "selectedDate", null);
|
|
194
195
|
/**
|
|
195
196
|
* The selected week.
|
|
196
197
|
* @member {number} selectedWeek
|
|
197
198
|
* @default null
|
|
198
199
|
*/
|
|
199
|
-
|
|
200
|
+
b(this, "selectedWeek", null);
|
|
200
201
|
/**
|
|
201
202
|
* The selected call back.
|
|
202
203
|
* @member {function} selectedCallBack
|
|
203
204
|
* @default null
|
|
204
205
|
*/
|
|
205
|
-
|
|
206
|
+
b(this, "selectedCallBack", null);
|
|
206
207
|
}
|
|
207
208
|
/**
|
|
208
209
|
* Initializes the calendar data.
|
|
@@ -210,7 +211,7 @@ class qe extends h {
|
|
|
210
211
|
* @returns {Data}
|
|
211
212
|
*/
|
|
212
213
|
setData() {
|
|
213
|
-
const
|
|
214
|
+
const s = /* @__PURE__ */ new Date(), n = this.selectedWeek || this.calculateCurrentWeek(s), a = C(n, s.getFullYear());
|
|
214
215
|
return new L({
|
|
215
216
|
monthName: this.getMonthName(a.getMonth()),
|
|
216
217
|
year: a.getFullYear(),
|
|
@@ -225,8 +226,8 @@ class qe extends h {
|
|
|
225
226
|
* @param {Date} today
|
|
226
227
|
* @returns {Date}
|
|
227
228
|
*/
|
|
228
|
-
getSelectedDate(
|
|
229
|
-
const n = this.selectedDate ? new Date(this.selectedDate) :
|
|
229
|
+
getSelectedDate(s) {
|
|
230
|
+
const n = this.selectedDate ? new Date(this.selectedDate) : s;
|
|
230
231
|
return new Date(n.getFullYear(), n.getMonth(), n.getDate());
|
|
231
232
|
}
|
|
232
233
|
/**
|
|
@@ -235,8 +236,8 @@ class qe extends h {
|
|
|
235
236
|
* @param {Date} date
|
|
236
237
|
* @returns {number}
|
|
237
238
|
*/
|
|
238
|
-
calculateCurrentWeek(
|
|
239
|
-
const n = new Date(
|
|
239
|
+
calculateCurrentWeek(s) {
|
|
240
|
+
const n = new Date(s.valueOf()), a = (s.getDay() + 6) % 7;
|
|
240
241
|
n.setDate(n.getDate() - a + 3);
|
|
241
242
|
const i = n.valueOf();
|
|
242
243
|
return n.setMonth(0, 1), n.getDay() !== 4 && n.setMonth(0, 1 + (4 - n.getDay() + 7) % 7), 1 + Math.ceil((i - n) / 6048e5);
|
|
@@ -247,8 +248,8 @@ class qe extends h {
|
|
|
247
248
|
* @param {number} month
|
|
248
249
|
* @returns {string}
|
|
249
250
|
*/
|
|
250
|
-
getMonthName(
|
|
251
|
-
return G.monthNames[
|
|
251
|
+
getMonthName(s) {
|
|
252
|
+
return G.monthNames[s];
|
|
252
253
|
}
|
|
253
254
|
/**
|
|
254
255
|
* Updates the calendar to show the previous month.
|
|
@@ -256,8 +257,8 @@ class qe extends h {
|
|
|
256
257
|
* @returns {void}
|
|
257
258
|
*/
|
|
258
259
|
goToPreviousMonth() {
|
|
259
|
-
const
|
|
260
|
-
let { year: n, month: a } =
|
|
260
|
+
const s = this.data;
|
|
261
|
+
let { year: n, month: a } = s;
|
|
261
262
|
a === 0 ? (a = 11, n--) : a--, this.setDate(a, n);
|
|
262
263
|
}
|
|
263
264
|
/**
|
|
@@ -266,8 +267,8 @@ class qe extends h {
|
|
|
266
267
|
* @returns {void}
|
|
267
268
|
*/
|
|
268
269
|
goToNextMonth() {
|
|
269
|
-
const
|
|
270
|
-
let { year: n, month: a } =
|
|
270
|
+
const s = this.data;
|
|
271
|
+
let { year: n, month: a } = s;
|
|
271
272
|
a === 11 ? (a = 0, n++) : a++, this.setDate(a, n);
|
|
272
273
|
}
|
|
273
274
|
/**
|
|
@@ -278,11 +279,11 @@ class qe extends h {
|
|
|
278
279
|
* @param {number|null} [date=null]
|
|
279
280
|
* @returns {void}
|
|
280
281
|
*/
|
|
281
|
-
setDate(
|
|
282
|
+
setDate(s, n, a) {
|
|
282
283
|
this.data.set({
|
|
283
284
|
year: n,
|
|
284
|
-
month:
|
|
285
|
-
monthName: this.getMonthName(
|
|
285
|
+
month: s,
|
|
286
|
+
monthName: this.getMonthName(s)
|
|
286
287
|
}), a && (this.data.currentDate = a);
|
|
287
288
|
}
|
|
288
289
|
/**
|
|
@@ -291,10 +292,10 @@ class qe extends h {
|
|
|
291
292
|
* @param {number} weekNumber
|
|
292
293
|
* @returns {void}
|
|
293
294
|
*/
|
|
294
|
-
selectWeek(
|
|
295
|
-
this.data.currentWeek =
|
|
296
|
-
const a = C(
|
|
297
|
-
this.setDate(a.getMonth(), a.getFullYear(), a.getDate()), typeof this.selectedCallBack == "function" && this.selectedCallBack(
|
|
295
|
+
selectWeek(s, n) {
|
|
296
|
+
this.data.currentWeek = s;
|
|
297
|
+
const a = C(s, n);
|
|
298
|
+
this.setDate(a.getMonth(), a.getFullYear(), a.getDate()), typeof this.selectedCallBack == "function" && this.selectedCallBack(s);
|
|
298
299
|
}
|
|
299
300
|
/**
|
|
300
301
|
* Renders the WeekCalendar component.
|
|
@@ -308,40 +309,40 @@ class qe extends h {
|
|
|
308
309
|
previous: () => this.goToPreviousMonth()
|
|
309
310
|
}),
|
|
310
311
|
re({
|
|
311
|
-
selectWeek: (
|
|
312
|
+
selectWeek: (s, n) => this.selectWeek(s, n)
|
|
312
313
|
})
|
|
313
314
|
]);
|
|
314
315
|
}
|
|
315
316
|
}
|
|
316
317
|
const de = (e) => B({ class: `cursor-pointer py-3 px-4 text-base w-10 ${e.class || ""}` }, [
|
|
317
|
-
F((
|
|
318
|
-
]), ue = ({ align: e, sortable:
|
|
318
|
+
F((t) => new J({ class: "mr-2", onChange: () => t.toggleAllSelectedRows() }))
|
|
319
|
+
]), ue = ({ align: e, sortable: t, key: s, label: n, sort: a, class: i }) => {
|
|
319
320
|
const r = e || "justify-start";
|
|
320
321
|
return B({
|
|
321
322
|
class: `cursor-pointer py-3 px-4 text-base ${i || ""}`,
|
|
322
|
-
click:
|
|
323
|
+
click: t && (() => a(s))
|
|
323
324
|
}, [
|
|
324
325
|
o({ class: `flex flex-auto w-full items-center ${r}` }, [
|
|
325
326
|
v(n),
|
|
326
|
-
|
|
327
|
+
t && E({ class: "ml-2", html: w.arrows.upDown })
|
|
327
328
|
])
|
|
328
329
|
]);
|
|
329
330
|
}, he = (e) => Q([
|
|
330
331
|
H({
|
|
331
332
|
class: "text-muted-foreground border-b",
|
|
332
|
-
map: [e.headers, (
|
|
333
|
-
align:
|
|
334
|
-
sortable:
|
|
335
|
-
key:
|
|
336
|
-
label:
|
|
333
|
+
map: [e.headers, (t) => t.label === "checkbox" ? de({ toggle: e.toggle }) : ue({
|
|
334
|
+
align: t.align,
|
|
335
|
+
sortable: t.sortable,
|
|
336
|
+
key: t.key,
|
|
337
|
+
label: t.label,
|
|
337
338
|
sort: e.sort
|
|
338
339
|
})]
|
|
339
340
|
})
|
|
340
|
-
]), fe = ({ key: e, rows:
|
|
341
|
+
]), fe = ({ key: e, rows: t, selectRow: s, rowItem: n }) => new V({
|
|
341
342
|
cache: "table",
|
|
342
343
|
key: e,
|
|
343
|
-
items:
|
|
344
|
-
rowItem: (a) => n(a,
|
|
344
|
+
items: t,
|
|
345
|
+
rowItem: (a) => n(a, s),
|
|
345
346
|
class: "divide-y divide-border"
|
|
346
347
|
}), Je = M(
|
|
347
348
|
{
|
|
@@ -362,8 +363,8 @@ const de = (e) => B({ class: `cursor-pointer py-3 px-4 text-base w-10 ${e.class
|
|
|
362
363
|
* @returns {void}
|
|
363
364
|
*/
|
|
364
365
|
toggleAllSelectedRows() {
|
|
365
|
-
const e = this.table.getRows(),
|
|
366
|
-
this.data.selectedRows =
|
|
366
|
+
const e = this.table.getRows(), t = this.data.selectedRows.length === e.length, s = t ? [] : e;
|
|
367
|
+
this.data.selectedRows = s, this.updateSelected(), this.updateTable(!t);
|
|
367
368
|
},
|
|
368
369
|
/**
|
|
369
370
|
* This will update the selected state.
|
|
@@ -390,8 +391,8 @@ const de = (e) => B({ class: `cursor-pointer py-3 px-4 text-base w-10 ${e.class
|
|
|
390
391
|
* @returns {void}
|
|
391
392
|
*/
|
|
392
393
|
updateTable(e) {
|
|
393
|
-
const
|
|
394
|
-
|
|
394
|
+
const t = this.table.getRows();
|
|
395
|
+
t.forEach((s) => s.selected = e), this.table.setRows(t);
|
|
395
396
|
},
|
|
396
397
|
/**
|
|
397
398
|
* Handles row selection.
|
|
@@ -399,9 +400,9 @@ const de = (e) => B({ class: `cursor-pointer py-3 px-4 text-base w-10 ${e.class
|
|
|
399
400
|
* @param {object} row
|
|
400
401
|
*/
|
|
401
402
|
selectRow(e) {
|
|
402
|
-
const
|
|
403
|
-
e.selected = !
|
|
404
|
-
const
|
|
403
|
+
const t = e.selected ?? !1;
|
|
404
|
+
e.selected = !t;
|
|
405
|
+
const s = this.data.get("selectedRows"), n = e.selected ? [...s, e] : s.filter((a) => a !== e);
|
|
405
406
|
this.data.selectedRows = n, this.updateSelected();
|
|
406
407
|
},
|
|
407
408
|
/**
|
|
@@ -410,12 +411,12 @@ const de = (e) => B({ class: `cursor-pointer py-3 px-4 text-base w-10 ${e.class
|
|
|
410
411
|
* @returns {object}
|
|
411
412
|
*/
|
|
412
413
|
render() {
|
|
413
|
-
const e = this.rows,
|
|
414
|
+
const e = this.rows, t = this.border !== !1 ? "border" : "";
|
|
414
415
|
return o({ class: "w-full" }, [
|
|
415
|
-
o({ class: `w-full rounded-md ${
|
|
416
|
+
o({ class: `w-full rounded-md ${t} overflow-x-auto` }, [
|
|
416
417
|
K({ class: "w-full" }, [
|
|
417
418
|
// @ts-ignore
|
|
418
|
-
this.headers && he({ headers: this.headers, sort: (
|
|
419
|
+
this.headers && he({ headers: this.headers, sort: (s) => this.sortRows(s) }),
|
|
419
420
|
// @ts-ignore
|
|
420
421
|
this.customHeader ?? null,
|
|
421
422
|
fe({
|
|
@@ -469,8 +470,8 @@ const de = (e) => B({ class: `cursor-pointer py-3 px-4 text-base w-10 ${e.class
|
|
|
469
470
|
* @param {boolean} withDelete
|
|
470
471
|
* @returns {void}
|
|
471
472
|
*/
|
|
472
|
-
mingle(e,
|
|
473
|
-
this.table.mingle(e,
|
|
473
|
+
mingle(e, t = !1) {
|
|
474
|
+
this.table.mingle(e, t);
|
|
474
475
|
},
|
|
475
476
|
/**
|
|
476
477
|
* This will prepend items to the list.
|
|
@@ -491,21 +492,21 @@ const de = (e) => B({ class: `cursor-pointer py-3 px-4 text-base w-10 ${e.class
|
|
|
491
492
|
this.data.selectedRows = [];
|
|
492
493
|
}
|
|
493
494
|
}
|
|
494
|
-
), ge =
|
|
495
|
-
|
|
496
|
-
|
|
495
|
+
), ge = d(({ name: e, email: t }) => o({ class: "min-w-0 flex-auto" }, [
|
|
496
|
+
g({ class: "text-base font-semibold leading-6 m-0" }, e),
|
|
497
|
+
g({ class: "truncate text-sm leading-5 text-muted-foreground m-0" }, t)
|
|
497
498
|
])), pe = () => o({ class: "flex items-center gap-x-1.5" }, [
|
|
498
499
|
o({ class: "flex-none rounded-full bg-emerald-500/20 p-1" }, [
|
|
499
500
|
o({ class: "h-1.5 w-1.5 rounded-full bg-emerald-500" })
|
|
500
501
|
]),
|
|
501
|
-
|
|
502
|
-
]), me = (e) =>
|
|
502
|
+
g({ class: "text-xs leading-5 text-gray-500" }, "Online")
|
|
503
|
+
]), me = (e) => g({ class: "text-xs leading-5 text-muted-foreground" }, [
|
|
503
504
|
v("Last seen "),
|
|
504
505
|
_({ datetime: e }, "3h ago")
|
|
505
|
-
]), xe = (e,
|
|
506
|
-
|
|
507
|
-
xe(
|
|
508
|
-
])), ke = (e) => e.split(" ").map((
|
|
506
|
+
]), xe = (e, t) => e === "online" ? pe() : me(t), be = d(({ role: e, lastSeen: t, status: s }) => o({ class: "hidden shrink-0 sm:flex sm:flex-col sm:items-end" }, [
|
|
507
|
+
g({ class: "text-sm leading-6 m-0" }, e),
|
|
508
|
+
xe(s, t)
|
|
509
|
+
])), ke = (e) => e.split(" ").map((s) => s[0]).join(""), we = d((e) => D({ class: "fadeIn flex justify-between gap-x-6 py-4 px-4 rounded-md hover:bg-muted/50" }, [
|
|
509
510
|
o({ class: "flex min-w-0 gap-x-4" }, [
|
|
510
511
|
Z({ src: e.image, alt: e.name, fallbackText: ke(e.name) }),
|
|
511
512
|
ge({ name: e.name, email: e.email })
|
|
@@ -515,35 +516,28 @@ const de = (e) => B({ class: `cursor-pointer py-3 px-4 text-base w-10 ${e.class
|
|
|
515
516
|
lastSeen: e.lastSeen,
|
|
516
517
|
status: e.status
|
|
517
518
|
})
|
|
518
|
-
])), Xe =
|
|
519
|
+
])), Xe = d((e) => new q({
|
|
519
520
|
cache: "list",
|
|
520
521
|
key: "name",
|
|
521
522
|
items: e.users,
|
|
522
523
|
role: "list",
|
|
523
524
|
class: "divide-y divide-border",
|
|
524
525
|
rowItem: we
|
|
525
|
-
})), ye = (e,
|
|
526
|
+
})), ye = (e, t) => t.includes(e), ve = (e, t, s) => e.exact ? s === t : ye(t, s), De = ({ text: e, href: t, exact: s, hidden: n }) => new R({
|
|
526
527
|
text: e,
|
|
527
|
-
href:
|
|
528
|
-
exact:
|
|
528
|
+
href: t,
|
|
529
|
+
exact: s,
|
|
529
530
|
dataSet: ["selected", ["state", !0, "active"]],
|
|
530
531
|
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`
|
|
531
532
|
});
|
|
532
|
-
class Ze extends
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
l(this, "options", []);
|
|
541
|
-
/**
|
|
542
|
-
* This will set the class.
|
|
543
|
-
* @member {string} class
|
|
544
|
-
* @default ''
|
|
545
|
-
*/
|
|
546
|
-
l(this, "class", "");
|
|
533
|
+
class Ze extends u {
|
|
534
|
+
/**
|
|
535
|
+
* This will declare the props for the compiler.
|
|
536
|
+
*
|
|
537
|
+
* @returns {void}
|
|
538
|
+
*/
|
|
539
|
+
declareProps() {
|
|
540
|
+
this.options = [], this.class = "";
|
|
547
541
|
}
|
|
548
542
|
/**
|
|
549
543
|
* This will configure the links.
|
|
@@ -560,7 +554,7 @@ class Ze extends h {
|
|
|
560
554
|
return S(
|
|
561
555
|
{ class: `flex items-center justify-center p-2 text-muted-foreground rounded-md ${this.class || ""}` },
|
|
562
556
|
[
|
|
563
|
-
|
|
557
|
+
p({
|
|
564
558
|
class: "flex space-x-4",
|
|
565
559
|
map: [this.options, (t) => this.addLink(t)],
|
|
566
560
|
watch: {
|
|
@@ -587,14 +581,14 @@ class Ze extends h {
|
|
|
587
581
|
* @returns {void}
|
|
588
582
|
*/
|
|
589
583
|
updateLinks(t) {
|
|
590
|
-
let
|
|
584
|
+
let s = !1;
|
|
591
585
|
this.deactivateAllLinks();
|
|
592
|
-
for (const
|
|
593
|
-
if (!
|
|
586
|
+
for (const n of this.links) {
|
|
587
|
+
if (!n.rendered)
|
|
594
588
|
continue;
|
|
595
|
-
ve(
|
|
589
|
+
ve(n, n.getLinkPath(), t) ? (this.updateLink(n, !0), s = !0) : this.updateLink(n, !1);
|
|
596
590
|
}
|
|
597
|
-
!
|
|
591
|
+
!s && this.links[0] && this.updateLink(this.links[0], !0);
|
|
598
592
|
}
|
|
599
593
|
/**
|
|
600
594
|
* This will deactivate all links.
|
|
@@ -612,8 +606,8 @@ class Ze extends h {
|
|
|
612
606
|
* @param {boolean} selected
|
|
613
607
|
* @returns {void}
|
|
614
608
|
*/
|
|
615
|
-
updateLink(t,
|
|
616
|
-
t.update(
|
|
609
|
+
updateLink(t, s) {
|
|
610
|
+
t.update(s);
|
|
617
611
|
}
|
|
618
612
|
/**
|
|
619
613
|
* This will add a link to the navigation.
|
|
@@ -621,9 +615,9 @@ class Ze extends h {
|
|
|
621
615
|
* @param {object} option
|
|
622
616
|
* @returns {object}
|
|
623
617
|
*/
|
|
624
|
-
addLink({ label: t, href:
|
|
625
|
-
const
|
|
626
|
-
return this.links.push(
|
|
618
|
+
addLink({ label: t, href: s, exact: n, hidden: a }) {
|
|
619
|
+
const i = De({ text: t, href: s, exact: n, hidden: a });
|
|
620
|
+
return this.links.push(i), i;
|
|
627
621
|
}
|
|
628
622
|
/**
|
|
629
623
|
* This will clear the links.
|
|
@@ -634,9 +628,9 @@ class Ze extends h {
|
|
|
634
628
|
this.links = [];
|
|
635
629
|
}
|
|
636
630
|
}
|
|
637
|
-
const et =
|
|
638
|
-
const
|
|
639
|
-
return o({ class: `flex-none ${
|
|
631
|
+
const et = d((e) => {
|
|
632
|
+
const t = e.margin || "m-4 ml-0";
|
|
633
|
+
return o({ class: `flex-none ${t}` }, [
|
|
640
634
|
T({
|
|
641
635
|
variant: "icon",
|
|
642
636
|
class: "back-button",
|
|
@@ -652,14 +646,14 @@ const et = u((e) => {
|
|
|
652
646
|
])
|
|
653
647
|
]);
|
|
654
648
|
});
|
|
655
|
-
class W extends
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
649
|
+
class W extends u {
|
|
650
|
+
/**
|
|
651
|
+
* This will declare the props for the compiler.
|
|
652
|
+
*
|
|
653
|
+
* @returns {void}
|
|
654
|
+
*/
|
|
655
|
+
declareProps() {
|
|
656
|
+
this.class = "";
|
|
663
657
|
}
|
|
664
658
|
/**
|
|
665
659
|
* This will render the component.
|
|
@@ -740,14 +734,6 @@ class W extends h {
|
|
|
740
734
|
}
|
|
741
735
|
}
|
|
742
736
|
class tt extends W {
|
|
743
|
-
constructor() {
|
|
744
|
-
super(...arguments);
|
|
745
|
-
/**
|
|
746
|
-
* @member {string} class
|
|
747
|
-
* @default ''
|
|
748
|
-
*/
|
|
749
|
-
l(this, "class", "");
|
|
750
|
-
}
|
|
751
737
|
/**
|
|
752
738
|
* This will stop presistence.
|
|
753
739
|
*
|
|
@@ -769,8 +755,8 @@ class tt extends W {
|
|
|
769
755
|
["loading", {
|
|
770
756
|
loading: !0
|
|
771
757
|
}],
|
|
772
|
-
["docked", (
|
|
773
|
-
|
|
758
|
+
["docked", (s, n) => {
|
|
759
|
+
s ? (n.className = this.getDockedClassName(), t.appendChild(n), document.documentElement.style.overflowY = "auto") : (n.className = this.getClassName(), app.root.appendChild(n), document.documentElement.style.overflowY = "hidden");
|
|
774
760
|
}]
|
|
775
761
|
]
|
|
776
762
|
},
|
|
@@ -851,14 +837,6 @@ class tt extends W {
|
|
|
851
837
|
}
|
|
852
838
|
}
|
|
853
839
|
class st extends W {
|
|
854
|
-
constructor() {
|
|
855
|
-
super(...arguments);
|
|
856
|
-
/**
|
|
857
|
-
* @member {string} class
|
|
858
|
-
* @default ''
|
|
859
|
-
*/
|
|
860
|
-
l(this, "class", "");
|
|
861
|
-
}
|
|
862
840
|
/**
|
|
863
841
|
* This will get the overlay type.
|
|
864
842
|
*
|
|
@@ -877,37 +855,37 @@ class st extends W {
|
|
|
877
855
|
this.container = t, this.initialize();
|
|
878
856
|
}
|
|
879
857
|
}
|
|
880
|
-
const Se =
|
|
858
|
+
const Se = d(({ index: e, click: t, state: s }, n) => D({
|
|
881
859
|
class: "p-2 cursor-pointer hover:bg-muted/50",
|
|
882
860
|
onState: [
|
|
883
|
-
[
|
|
861
|
+
[s, "selectedIndex", {
|
|
884
862
|
"bg-accent": e,
|
|
885
863
|
"text-white": e
|
|
886
864
|
}]
|
|
887
865
|
],
|
|
888
|
-
pointerdown: () =>
|
|
889
|
-
}, n)), Le =
|
|
866
|
+
pointerdown: () => t(e)
|
|
867
|
+
}, n)), Le = d(({ selectOption: e, state: t }) => p({
|
|
890
868
|
class: "border rounded-md list-none m-0 p-0 max-h-[400px] overflow-y-auto",
|
|
891
|
-
for: ["filteredOptions", (
|
|
892
|
-
})), Ce = 100, Oe =
|
|
869
|
+
for: ["filteredOptions", (s, n) => Se({ index: n, click: e, state: t }, s.label)]
|
|
870
|
+
})), Ce = 100, Oe = d((e) => o({ class: "relative flex items-center" }, [
|
|
893
871
|
X({
|
|
894
872
|
cache: "input",
|
|
895
873
|
placeholder: e.placeholder ?? "Search...",
|
|
896
874
|
bind: [e.state, "searchQuery"],
|
|
897
|
-
keyup: (
|
|
898
|
-
|
|
875
|
+
keyup: (t, s) => {
|
|
876
|
+
s.state.open = !0, typeof e.filterOptions == "function" && e.filterOptions(), s.dropdown.updatePosition();
|
|
899
877
|
},
|
|
900
|
-
pointerup: (
|
|
901
|
-
blur: (
|
|
902
|
-
keydown: (
|
|
878
|
+
pointerup: (t, s) => s.toggleDropdown(),
|
|
879
|
+
blur: (t, { state: s }) => setTimeout(() => s.open = !1, Ce),
|
|
880
|
+
keydown: (t) => typeof e.handleKeyDown == "function" && e.handleKeyDown(t)
|
|
903
881
|
}),
|
|
904
882
|
e.icon && o({ class: "absolute right-0 mr-2" }, [
|
|
905
883
|
N(e.icon)
|
|
906
884
|
])
|
|
907
885
|
])), Be = (e) => o({
|
|
908
886
|
class: "relative flex fle-auto flex-col",
|
|
909
|
-
onState: ["open", (
|
|
910
|
-
if (
|
|
887
|
+
onState: ["open", (t, s, n) => {
|
|
888
|
+
if (t)
|
|
911
889
|
return new ee({
|
|
912
890
|
cache: "dropdown",
|
|
913
891
|
parent: n,
|
|
@@ -950,10 +928,10 @@ const Se = u(({ index: e, click: s, state: t }, n) => D({
|
|
|
950
928
|
*/
|
|
951
929
|
setSelectedIndexByQuery() {
|
|
952
930
|
const e = this.data.filteredOptions;
|
|
953
|
-
let { searchQuery:
|
|
954
|
-
|
|
955
|
-
const
|
|
956
|
-
|
|
931
|
+
let { searchQuery: t } = this.state;
|
|
932
|
+
t = t.toLowerCase();
|
|
933
|
+
const s = e.findIndex((n) => n.label.toLowerCase() === t);
|
|
934
|
+
s >= 0 && (this.state.selectedIndex = s);
|
|
957
935
|
},
|
|
958
936
|
/**
|
|
959
937
|
* This will filter the options.
|
|
@@ -966,9 +944,9 @@ const Se = u(({ index: e, click: s, state: t }, n) => D({
|
|
|
966
944
|
this.data.filteredOptions = this.data.options;
|
|
967
945
|
return;
|
|
968
946
|
}
|
|
969
|
-
const
|
|
970
|
-
this.data.filteredOptions =
|
|
971
|
-
(
|
|
947
|
+
const t = this.data.get("options");
|
|
948
|
+
this.data.filteredOptions = t.filter(
|
|
949
|
+
(s) => s.label.toLowerCase().includes(e)
|
|
972
950
|
);
|
|
973
951
|
},
|
|
974
952
|
/**
|
|
@@ -988,8 +966,8 @@ const Se = u(({ index: e, click: s, state: t }, n) => D({
|
|
|
988
966
|
*/
|
|
989
967
|
selectOption(e) {
|
|
990
968
|
this.state.selectedIndex = e;
|
|
991
|
-
const
|
|
992
|
-
this.state.searchQuery =
|
|
969
|
+
const t = this.data.get(`filteredOptions[${e}]`);
|
|
970
|
+
this.state.searchQuery = t.label, this.state.open = !1, typeof this.onSelect == "function" && this.onSelect(t);
|
|
993
971
|
},
|
|
994
972
|
/**
|
|
995
973
|
* Toggles the dropdown open state.
|
|
@@ -1004,8 +982,8 @@ const Se = u(({ index: e, click: s, state: t }, n) => D({
|
|
|
1004
982
|
* @returns {void}
|
|
1005
983
|
*/
|
|
1006
984
|
handleKeyDown(e) {
|
|
1007
|
-
const
|
|
1008
|
-
e.key === "ArrowDown" ? (e.preventDefault(), this.state.selectedIndex = Math.min(
|
|
985
|
+
const t = this.data.filteredOptions, { selectedIndex: s } = this.state;
|
|
986
|
+
e.key === "ArrowDown" ? (e.preventDefault(), this.state.selectedIndex = Math.min(s + 1, t.length - 1)) : e.key === "ArrowUp" ? (e.preventDefault(), this.state.selectedIndex = Math.max(s - 1, 0)) : e.key === "Enter" && s >= 0 && (e.preventDefault(), this.selectOption(s));
|
|
1009
987
|
},
|
|
1010
988
|
/**
|
|
1011
989
|
* This will render the component.
|
|
@@ -1046,32 +1024,20 @@ const Se = u(({ index: e, click: s, state: t }, n) => D({
|
|
|
1046
1024
|
y({
|
|
1047
1025
|
class: "flex flex-auto justify-center items-center px-3 py-1.5",
|
|
1048
1026
|
onSet: ["selected", { selected: e.value }],
|
|
1049
|
-
click: (
|
|
1027
|
+
click: (t) => e.callBack(e.value)
|
|
1050
1028
|
}, e.label)
|
|
1051
1029
|
]
|
|
1052
|
-
), Me = (e,
|
|
1053
|
-
|
|
1030
|
+
), Me = (e, t) => (e.callBack = t, Ie(e)), Re = (e) => S({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${e.class}` }, [
|
|
1031
|
+
p({ class: "flex flex-auto flex-row", map: [e.options, (t) => Me(t, e.callBack)] })
|
|
1054
1032
|
]);
|
|
1055
|
-
class at extends
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
l(this, "options", []);
|
|
1064
|
-
/**
|
|
1065
|
-
* This will set the class.
|
|
1066
|
-
* @member {string} class
|
|
1067
|
-
* @default ''
|
|
1068
|
-
*/
|
|
1069
|
-
l(this, "class", "");
|
|
1070
|
-
/**
|
|
1071
|
-
* This will set the call back.
|
|
1072
|
-
* @member {function} callBack
|
|
1073
|
-
*/
|
|
1074
|
-
l(this, "callBack", null);
|
|
1033
|
+
class at extends u {
|
|
1034
|
+
/**
|
|
1035
|
+
* This will declare the props for the compiler.
|
|
1036
|
+
*
|
|
1037
|
+
* @returns {void}
|
|
1038
|
+
*/
|
|
1039
|
+
declareProps() {
|
|
1040
|
+
this.options = [], this.class = "", this.callBack = null;
|
|
1075
1041
|
}
|
|
1076
1042
|
/**
|
|
1077
1043
|
* This will render the component.
|
|
@@ -1126,14 +1092,14 @@ class at extends h {
|
|
|
1126
1092
|
* @returns {object}
|
|
1127
1093
|
*/
|
|
1128
1094
|
updateContent(t) {
|
|
1129
|
-
const
|
|
1130
|
-
if (!
|
|
1095
|
+
const s = this.options;
|
|
1096
|
+
if (!s || s.length < 1)
|
|
1131
1097
|
return;
|
|
1132
|
-
const
|
|
1133
|
-
for (const
|
|
1134
|
-
if (
|
|
1135
|
-
return
|
|
1136
|
-
return
|
|
1098
|
+
const n = s[0];
|
|
1099
|
+
for (const a of s)
|
|
1100
|
+
if (a.value === t)
|
|
1101
|
+
return a.layout;
|
|
1102
|
+
return n.layout;
|
|
1137
1103
|
}
|
|
1138
1104
|
/**
|
|
1139
1105
|
* This will setup the states.
|
|
@@ -1141,12 +1107,12 @@ class at extends h {
|
|
|
1141
1107
|
* @returns {object}
|
|
1142
1108
|
*/
|
|
1143
1109
|
setupStates() {
|
|
1144
|
-
const t = this.callBack,
|
|
1110
|
+
const t = this.callBack, s = typeof t;
|
|
1145
1111
|
return {
|
|
1146
1112
|
selected: {
|
|
1147
1113
|
state: this.getFirstValue(),
|
|
1148
|
-
callBack(
|
|
1149
|
-
|
|
1114
|
+
callBack(n) {
|
|
1115
|
+
s === "function" && t(n);
|
|
1150
1116
|
}
|
|
1151
1117
|
}
|
|
1152
1118
|
};
|
|
@@ -1161,33 +1127,21 @@ const Te = (e) => D(
|
|
|
1161
1127
|
y({
|
|
1162
1128
|
class: "flex flex-auto justify-center items-center px-3 py-1.5 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1163
1129
|
onSet: ["selected", { selected: e.value }],
|
|
1164
|
-
click: (
|
|
1130
|
+
click: (t) => e.callBack(e.value),
|
|
1165
1131
|
disabled: e.disabled
|
|
1166
1132
|
}, e.label)
|
|
1167
1133
|
]
|
|
1168
|
-
), Ne = (e,
|
|
1169
|
-
|
|
1134
|
+
), Ne = (e, t) => (e.callBack = t, Te(e)), We = (e) => S({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${e.class}` }, [
|
|
1135
|
+
p({ class: "flex flex-auto flex-row", map: [e.options, (t) => Ne(t, e.callBack)] })
|
|
1170
1136
|
]);
|
|
1171
|
-
class it extends
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
l(this, "options", []);
|
|
1180
|
-
/**
|
|
1181
|
-
* This will set the class.
|
|
1182
|
-
* @member {string} class
|
|
1183
|
-
* @default ''
|
|
1184
|
-
*/
|
|
1185
|
-
l(this, "class", "");
|
|
1186
|
-
/**
|
|
1187
|
-
* This will set the on select call back.
|
|
1188
|
-
* @member {function} onSelect
|
|
1189
|
-
*/
|
|
1190
|
-
l(this, "onSelect", null);
|
|
1137
|
+
class it extends u {
|
|
1138
|
+
/**
|
|
1139
|
+
* This will declare the props for the compiler.
|
|
1140
|
+
*
|
|
1141
|
+
* @returns {void}
|
|
1142
|
+
*/
|
|
1143
|
+
declareProps() {
|
|
1144
|
+
this.options = [], this.class = "", this.onSelect = null;
|
|
1191
1145
|
}
|
|
1192
1146
|
/**
|
|
1193
1147
|
* This will render the component.
|
|
@@ -1223,36 +1177,24 @@ class it extends h {
|
|
|
1223
1177
|
};
|
|
1224
1178
|
}
|
|
1225
1179
|
}
|
|
1226
|
-
const $e = (e,
|
|
1227
|
-
const
|
|
1228
|
-
return e.exact ?
|
|
1229
|
-
},
|
|
1180
|
+
const $e = (e, t) => new RegExp(`${e}($|/|\\.).*`).test(t), Pe = (e, t) => {
|
|
1181
|
+
const s = e.getLinkPath();
|
|
1182
|
+
return e.exact ? t === s : $e(s, t);
|
|
1183
|
+
}, Ae = ({ text: e, href: t, exact: s }) => new R({
|
|
1230
1184
|
text: e,
|
|
1231
|
-
href:
|
|
1232
|
-
exact:
|
|
1185
|
+
href: t,
|
|
1186
|
+
exact: s,
|
|
1233
1187
|
dataSet: ["selected", ["state", !0, "active"]],
|
|
1234
1188
|
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"
|
|
1235
1189
|
});
|
|
1236
|
-
class
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
l(this, "options", []);
|
|
1245
|
-
/**
|
|
1246
|
-
* This will set the class.
|
|
1247
|
-
* @member {string} class
|
|
1248
|
-
* @default ''
|
|
1249
|
-
*/
|
|
1250
|
-
l(this, "class", "");
|
|
1251
|
-
/**
|
|
1252
|
-
* This will set the on select call back.
|
|
1253
|
-
* @member {function} onSelect
|
|
1254
|
-
*/
|
|
1255
|
-
l(this, "onSelect", null);
|
|
1190
|
+
class je extends u {
|
|
1191
|
+
/**
|
|
1192
|
+
* This will declare the props for the compiler.
|
|
1193
|
+
*
|
|
1194
|
+
* @returns {void}
|
|
1195
|
+
*/
|
|
1196
|
+
declareProps() {
|
|
1197
|
+
this.options = [], this.class = "", this.onSelect = null;
|
|
1256
1198
|
}
|
|
1257
1199
|
/**
|
|
1258
1200
|
* This will configure the links.
|
|
@@ -1267,7 +1209,7 @@ class Pe extends h {
|
|
|
1267
1209
|
*/
|
|
1268
1210
|
render() {
|
|
1269
1211
|
return S({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${this.class}` }, [
|
|
1270
|
-
|
|
1212
|
+
p({
|
|
1271
1213
|
class: "flex flex-auto flex-row",
|
|
1272
1214
|
map: [this.options, (t) => this.addLink(t)],
|
|
1273
1215
|
watch: {
|
|
@@ -1293,14 +1235,14 @@ class Pe extends h {
|
|
|
1293
1235
|
* @returns {void}
|
|
1294
1236
|
*/
|
|
1295
1237
|
updateLinks(t) {
|
|
1296
|
-
let
|
|
1238
|
+
let s = !1, n = this.links[0];
|
|
1297
1239
|
this.deactivateAllLinks();
|
|
1298
|
-
for (const
|
|
1299
|
-
if (
|
|
1300
|
-
this.updateLink(
|
|
1240
|
+
for (const a of this.links)
|
|
1241
|
+
if (a.rendered !== !1 && (s = Pe(a, t), s === !0)) {
|
|
1242
|
+
this.updateLink(a, !0);
|
|
1301
1243
|
break;
|
|
1302
1244
|
}
|
|
1303
|
-
|
|
1245
|
+
s !== !0 && n && this.updateLink(n, !0);
|
|
1304
1246
|
}
|
|
1305
1247
|
/**
|
|
1306
1248
|
* This will deactivate all links.
|
|
@@ -1318,8 +1260,8 @@ class Pe extends h {
|
|
|
1318
1260
|
* @param {boolean} selected
|
|
1319
1261
|
* @returns {void}
|
|
1320
1262
|
*/
|
|
1321
|
-
updateLink(t,
|
|
1322
|
-
t.update(
|
|
1263
|
+
updateLink(t, s) {
|
|
1264
|
+
t.update(s);
|
|
1323
1265
|
}
|
|
1324
1266
|
/**
|
|
1325
1267
|
* This will add a link.
|
|
@@ -1327,9 +1269,9 @@ class Pe extends h {
|
|
|
1327
1269
|
* @param {object} option
|
|
1328
1270
|
* @returns {object}
|
|
1329
1271
|
*/
|
|
1330
|
-
addLink({ label: t, href:
|
|
1331
|
-
const
|
|
1332
|
-
return this.links.push(
|
|
1272
|
+
addLink({ label: t, href: s, exact: n }) {
|
|
1273
|
+
const a = Ae({ text: t, href: s, exact: n });
|
|
1274
|
+
return this.links.push(a), a;
|
|
1333
1275
|
}
|
|
1334
1276
|
/**
|
|
1335
1277
|
* This will remove all the links.
|
|
@@ -1340,21 +1282,14 @@ class Pe extends h {
|
|
|
1340
1282
|
this.links = [];
|
|
1341
1283
|
}
|
|
1342
1284
|
}
|
|
1343
|
-
class ot extends
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
l(this, "options", []);
|
|
1352
|
-
/**
|
|
1353
|
-
* This will set the class.
|
|
1354
|
-
* @member {string} class
|
|
1355
|
-
* @default ''
|
|
1356
|
-
*/
|
|
1357
|
-
l(this, "class", "");
|
|
1285
|
+
class ot extends u {
|
|
1286
|
+
/**
|
|
1287
|
+
* This will declare the props for the compiler.
|
|
1288
|
+
*
|
|
1289
|
+
* @returns {void}
|
|
1290
|
+
*/
|
|
1291
|
+
declareProps() {
|
|
1292
|
+
this.options = [], this.class = "";
|
|
1358
1293
|
}
|
|
1359
1294
|
/**
|
|
1360
1295
|
* This will render the component.
|
|
@@ -1363,7 +1298,7 @@ class ot extends h {
|
|
|
1363
1298
|
*/
|
|
1364
1299
|
render() {
|
|
1365
1300
|
return o({ class: "tab-panel" }, [
|
|
1366
|
-
new
|
|
1301
|
+
new je({
|
|
1367
1302
|
class: this.class,
|
|
1368
1303
|
options: this.options
|
|
1369
1304
|
}),
|
|
@@ -1380,9 +1315,9 @@ class ot extends h {
|
|
|
1380
1315
|
*/
|
|
1381
1316
|
addGroup() {
|
|
1382
1317
|
let t;
|
|
1383
|
-
const
|
|
1384
|
-
for (let
|
|
1385
|
-
t = a
|
|
1318
|
+
const s = [], n = this.options;
|
|
1319
|
+
for (let a = 0, i = n.length; a < i; a++)
|
|
1320
|
+
t = n[a], s.push(
|
|
1386
1321
|
{
|
|
1387
1322
|
uri: t.uri || t.href,
|
|
1388
1323
|
component: t.component,
|
|
@@ -1390,7 +1325,7 @@ class ot extends h {
|
|
|
1390
1325
|
persist: !0
|
|
1391
1326
|
}
|
|
1392
1327
|
);
|
|
1393
|
-
return
|
|
1328
|
+
return s;
|
|
1394
1329
|
}
|
|
1395
1330
|
}
|
|
1396
1331
|
export {
|
|
@@ -1420,6 +1355,6 @@ export {
|
|
|
1420
1355
|
tt as l,
|
|
1421
1356
|
at as m,
|
|
1422
1357
|
it as n,
|
|
1423
|
-
|
|
1358
|
+
je as o,
|
|
1424
1359
|
ot as p
|
|
1425
1360
|
};
|