@base-framework/ui 0.0.5 → 0.0.7
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/{calendar-DR_svCOR.js → calendar-B5TK6tLi.js} +128 -138
- package/dist/{confirmation-D1Y_SgzE.js → confirmation-D020eNiS.js} +1 -1
- package/dist/index.es.js +5 -5
- package/dist/mobile-nav-wrapper-CguousG5.js +505 -0
- package/dist/molecules.es.js +2 -2
- package/dist/organisms.es.js +3 -3
- package/dist/pages.es.js +1 -1
- package/dist/sidebar-menu-page-22AUZwFc.js +208 -0
- package/dist/{tab-C_dZb2qH.js → tab-BGR7fWvY.js} +455 -536
- package/dist/types/components/organisms/navigation/main-link.d.ts +2 -2
- 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,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
import { C as J, I as X } from "./inputs-BF3C3KfF.js";
|
|
10
|
-
import { A as Z, P as ee } from "./calendar-DR_svCOR.js";
|
|
11
|
-
u((e, s) => ({
|
|
1
|
+
import { Button as w, Div as o, On as j, Span as y, Th as O, UseParent as z, I as Y, Thead as U, Tr as F, Table as E, P as g, Li as v, Time as Q, Nav as D, Ul as p, Section as B } from "@base-framework/atoms";
|
|
2
|
+
import { Atom as d, Component as u, Data as S, DateTime as H, Jot as I, router as b, NavLink as M } from "@base-framework/base";
|
|
3
|
+
import { B as R, I as T } from "./icon-B9QUT2NY.js";
|
|
4
|
+
import { Icons as k } from "./icons.es.js";
|
|
5
|
+
import { TableBody as K, List as _ } from "@base-framework/organisms";
|
|
6
|
+
import { C as G, I as V } from "./inputs-BF3C3KfF.js";
|
|
7
|
+
import { A as q, P as J } from "./calendar-B5TK6tLi.js";
|
|
8
|
+
d((t, e) => ({
|
|
12
9
|
class: "flex items-center px-4 py-2",
|
|
13
|
-
...
|
|
14
|
-
children:
|
|
10
|
+
...t,
|
|
11
|
+
children: e
|
|
15
12
|
}));
|
|
16
|
-
|
|
13
|
+
d(({ value: t, label: e }) => w({
|
|
17
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",
|
|
18
|
-
onState: ["performance", { active:
|
|
19
|
-
dataSet: ["performance", ["state",
|
|
20
|
-
click: (
|
|
21
|
-
},
|
|
22
|
-
class
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
onState: ["performance", { active: t }],
|
|
16
|
+
dataSet: ["performance", ["state", t, "active"]],
|
|
17
|
+
click: (s, { state: n }) => n.performance = t
|
|
18
|
+
}, e));
|
|
19
|
+
class Ee extends u {
|
|
20
|
+
/**
|
|
21
|
+
* This will declare the props for the compiler.
|
|
22
|
+
*
|
|
23
|
+
* @returns {void}
|
|
24
|
+
*/
|
|
25
|
+
declareProps() {
|
|
26
|
+
this.class = "";
|
|
29
27
|
}
|
|
30
28
|
/**
|
|
31
29
|
* This will render the component.
|
|
@@ -36,77 +34,77 @@ class _e extends h {
|
|
|
36
34
|
return o({ class: this.class || "" }, this.children);
|
|
37
35
|
}
|
|
38
36
|
}
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
const n =
|
|
37
|
+
const X = (t) => {
|
|
38
|
+
const e = new Date(t, 11, 31), s = new Date(t, 0, 1);
|
|
39
|
+
return e.getDay() === 4 || // December 31 is a Thursday
|
|
40
|
+
s.getDay() === 4;
|
|
41
|
+
}, Z = (t) => {
|
|
42
|
+
const e = new Date(t.valueOf()), s = (e.getDay() + 6) % 7;
|
|
43
|
+
e.setDate(e.getDate() - s + 3);
|
|
44
|
+
const n = e.getFullYear(), a = new Date(n, 0, 4);
|
|
47
45
|
a.setDate(a.getDate() - (a.getDay() + 6) % 7);
|
|
48
|
-
const i = Math.ceil((
|
|
49
|
-
return i > 52 && !
|
|
46
|
+
const i = Math.ceil((e - a) / 6048e5) + 1;
|
|
47
|
+
return i > 52 && !X(n) ? {
|
|
50
48
|
weekNumber: 1,
|
|
51
49
|
year: n + 1
|
|
52
50
|
} : {
|
|
53
51
|
weekNumber: i,
|
|
54
52
|
year: n
|
|
55
53
|
};
|
|
56
|
-
},
|
|
57
|
-
if (
|
|
58
|
-
const n = new Date(
|
|
54
|
+
}, ee = (t, e, s) => {
|
|
55
|
+
if (s === 0) return [];
|
|
56
|
+
const n = new Date(t, e, 0).getDate();
|
|
59
57
|
return Array.from(
|
|
60
|
-
{ length:
|
|
61
|
-
(a, i) => new Date(
|
|
58
|
+
{ length: s },
|
|
59
|
+
(a, i) => new Date(t, e - 1, n - s + i + 1)
|
|
62
60
|
);
|
|
63
|
-
},
|
|
64
|
-
const
|
|
65
|
-
a.setDate(
|
|
61
|
+
}, te = (t, e, s) => Array.from({ length: s }, (n, a) => new Date(t, e + 1, a + 1)), L = (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);
|
|
66
64
|
const i = new Date(a);
|
|
67
|
-
return i.setDate(a.getDate() + (
|
|
68
|
-
},
|
|
69
|
-
const
|
|
65
|
+
return i.setDate(a.getDate() + (t - 1) * 7), i;
|
|
66
|
+
}, Qe = (t, e) => {
|
|
67
|
+
const s = new Date(t, e, 1).getDay(), n = new Date(t, e + 1, 0).getDate(), a = [];
|
|
70
68
|
let i = [];
|
|
71
|
-
for (let r = 1 -
|
|
72
|
-
const
|
|
73
|
-
i.push(r > 0 ?
|
|
69
|
+
for (let r = 1 - s; r <= n; r++) {
|
|
70
|
+
const h = new Date(t, e, r);
|
|
71
|
+
i.push(r > 0 ? h : null), (i.length === 7 || r === n) && (a.push([...i]), i = []);
|
|
74
72
|
}
|
|
75
73
|
return a;
|
|
76
|
-
},
|
|
77
|
-
const
|
|
74
|
+
}, He = (t, e) => {
|
|
75
|
+
const s = new Date(t, e + 1, 0).getDate(), n = [];
|
|
78
76
|
let a = [];
|
|
79
|
-
for (let i = 1; i <=
|
|
80
|
-
a.push(new Date(
|
|
77
|
+
for (let i = 1; i <= s; i++)
|
|
78
|
+
a.push(new Date(t, e, i)), a.length === 7 && (n.push(a), a = []);
|
|
81
79
|
return a.length > 0 && n.push(a), n;
|
|
82
|
-
},
|
|
80
|
+
}, se = (t, e, s) => {
|
|
83
81
|
const n = /* @__PURE__ */ new Date();
|
|
84
|
-
return n.getDate() ===
|
|
85
|
-
},
|
|
86
|
-
const i =
|
|
87
|
-
return
|
|
88
|
-
text:
|
|
89
|
-
disabled: !
|
|
82
|
+
return n.getDate() === t && n.getMonth() === e && n.getFullYear() === s;
|
|
83
|
+
}, ne = ({ day: t, month: e, year: s, weekNumber: n, selectWeek: a }) => {
|
|
84
|
+
const i = se(t, e, s);
|
|
85
|
+
return w({
|
|
86
|
+
text: t || "",
|
|
87
|
+
disabled: !t,
|
|
90
88
|
class: `
|
|
91
89
|
px-2 py-1 text-center rounded-md
|
|
92
90
|
${i ? "bg-accent text-accent-foreground" : ""}
|
|
93
91
|
hover:bg-primary hover:text-primary-foreground
|
|
94
92
|
`,
|
|
95
|
-
click: () => a(n,
|
|
93
|
+
click: () => a(n, s)
|
|
96
94
|
});
|
|
97
|
-
},
|
|
98
|
-
const
|
|
99
|
-
for (let
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
weekNumber:
|
|
103
|
-
year:
|
|
104
|
-
days:
|
|
95
|
+
}, ae = (t, e) => {
|
|
96
|
+
const s = new Date(t, e, 1).getDay(), n = new Date(t, e + 1, 0).getDate(), a = ee(t, e, s), i = Array.from({ length: n }, (l, x) => new Date(t, e, x + 1)), r = (a.length + i.length) % 7, h = r === 0 ? 0 : 7 - r, c = te(t, e, h), f = [...a, ...i, ...c], m = [];
|
|
97
|
+
for (let l = 0; l < f.length; l += 7) {
|
|
98
|
+
const x = f.slice(l, l + 7), W = x.find((A) => A) || new Date(t, e, 1), { weekNumber: $, year: P } = Z(W);
|
|
99
|
+
m.push({
|
|
100
|
+
weekNumber: $,
|
|
101
|
+
year: P,
|
|
102
|
+
days: x
|
|
105
103
|
});
|
|
106
104
|
}
|
|
107
|
-
return
|
|
108
|
-
},
|
|
109
|
-
const { year: a, month: i, currentDate: r } = n,
|
|
105
|
+
return m;
|
|
106
|
+
}, ie = ({ selectWeek: t }) => j("month", (e, s, { data: n }) => {
|
|
107
|
+
const { year: a, month: i, currentDate: r } = n, h = ae(a, i);
|
|
110
108
|
return o(
|
|
111
109
|
{ class: "grid grid-cols-8 gap-1 text-sm px-4 py-2" },
|
|
112
110
|
[
|
|
@@ -117,40 +115,40 @@ const te = (e) => {
|
|
|
117
115
|
class: "grid grid-cols-7 col-span-7 text-center text-muted-foreground items-center"
|
|
118
116
|
},
|
|
119
117
|
["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(
|
|
120
|
-
(
|
|
118
|
+
(c) => y({ class: "px-1 py-1", text: c })
|
|
121
119
|
)
|
|
122
120
|
),
|
|
123
121
|
// Render each "week" row
|
|
124
|
-
...
|
|
125
|
-
({ weekNumber:
|
|
122
|
+
...h.map(
|
|
123
|
+
({ weekNumber: c, days: f, year: m }) => o({
|
|
126
124
|
class: "grid grid-cols-8 col-span-8 items-center ring-primary rounded-sm px-1",
|
|
127
125
|
onSet: ["currentWeek", {
|
|
128
|
-
ring:
|
|
126
|
+
ring: c
|
|
129
127
|
}]
|
|
130
128
|
}, [
|
|
131
129
|
// Left column: ISO week number
|
|
132
130
|
o({
|
|
133
131
|
class: "font-medium text-center col-span-1 rounded-sm cursor-pointer",
|
|
134
|
-
click: () =>
|
|
132
|
+
click: () => t(c, m),
|
|
135
133
|
// If you have a 'currentWeek' state, you can highlight it with 'onSet'
|
|
136
134
|
onSet: ["currentWeek", {
|
|
137
|
-
"text-primary-foreground":
|
|
138
|
-
"bg-primary":
|
|
135
|
+
"text-primary-foreground": c,
|
|
136
|
+
"bg-primary": c
|
|
139
137
|
}],
|
|
140
|
-
text:
|
|
138
|
+
text: c ? `W${c}` : ""
|
|
141
139
|
}),
|
|
142
140
|
// The 7 cells for each day in the row
|
|
143
141
|
o(
|
|
144
142
|
{ class: "grid grid-cols-7 col-span-7 text-center" },
|
|
145
|
-
|
|
146
|
-
(
|
|
147
|
-
year: (
|
|
148
|
-
month: (
|
|
149
|
-
day: (
|
|
150
|
-
week:
|
|
151
|
-
weekNumber:
|
|
143
|
+
f.map(
|
|
144
|
+
(l) => ne({
|
|
145
|
+
year: (l == null ? void 0 : l.getFullYear()) || null,
|
|
146
|
+
month: (l == null ? void 0 : l.getMonth()) || null,
|
|
147
|
+
day: (l == null ? void 0 : l.getDate()) || null,
|
|
148
|
+
week: f,
|
|
149
|
+
weekNumber: c,
|
|
152
150
|
currentDate: r,
|
|
153
|
-
selectWeek:
|
|
151
|
+
selectWeek: t
|
|
154
152
|
})
|
|
155
153
|
)
|
|
156
154
|
)
|
|
@@ -158,51 +156,38 @@ const te = (e) => {
|
|
|
158
156
|
)
|
|
159
157
|
]
|
|
160
158
|
);
|
|
161
|
-
}),
|
|
159
|
+
}), C = ({ label: t, click: e }) => R(
|
|
162
160
|
{
|
|
163
161
|
class: `
|
|
164
162
|
inline-flex items-center justify-center h-7 w-7 bg-transparent p-0
|
|
165
163
|
opacity-50 hover:opacity-100 text-muted-foreground absolute
|
|
166
|
-
${
|
|
164
|
+
${t === "Previous" ? "left-1" : "right-1"}
|
|
167
165
|
focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2
|
|
168
166
|
`,
|
|
169
|
-
click:
|
|
170
|
-
"aria-label": `${
|
|
167
|
+
click: e,
|
|
168
|
+
"aria-label": `${t} month`,
|
|
171
169
|
variant: "icon",
|
|
172
|
-
icon:
|
|
170
|
+
icon: t === "Previous" ? k.chevron.single.left : k.chevron.single.right
|
|
173
171
|
}
|
|
174
|
-
),
|
|
175
|
-
|
|
176
|
-
|
|
172
|
+
), oe = ({ next: t, previous: e }) => o({ class: "flex flex-auto min-h-12 text-sm font-medium relative justify-center items-center" }, [
|
|
173
|
+
y("[[monthName]] [[year]]"),
|
|
174
|
+
C({
|
|
177
175
|
label: "Previous",
|
|
178
|
-
click:
|
|
176
|
+
click: e
|
|
179
177
|
}),
|
|
180
|
-
|
|
178
|
+
C({
|
|
181
179
|
label: "Next",
|
|
182
|
-
click:
|
|
180
|
+
click: t
|
|
183
181
|
})
|
|
184
182
|
]);
|
|
185
|
-
class
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
l(this, "selectedDate", null);
|
|
194
|
-
/**
|
|
195
|
-
* The selected week.
|
|
196
|
-
* @member {number} selectedWeek
|
|
197
|
-
* @default null
|
|
198
|
-
*/
|
|
199
|
-
l(this, "selectedWeek", null);
|
|
200
|
-
/**
|
|
201
|
-
* The selected call back.
|
|
202
|
-
* @member {function} selectedCallBack
|
|
203
|
-
* @default null
|
|
204
|
-
*/
|
|
205
|
-
l(this, "selectedCallBack", null);
|
|
183
|
+
class Ke extends u {
|
|
184
|
+
/**
|
|
185
|
+
* This will declare the props for the compiler.
|
|
186
|
+
*
|
|
187
|
+
* @returns {void}
|
|
188
|
+
*/
|
|
189
|
+
declareProps() {
|
|
190
|
+
this.selectedDate = null, this.selectedWeek = null, this.selectedCallBack = null;
|
|
206
191
|
}
|
|
207
192
|
/**
|
|
208
193
|
* Initializes the calendar data.
|
|
@@ -210,13 +195,13 @@ class qe extends h {
|
|
|
210
195
|
* @returns {Data}
|
|
211
196
|
*/
|
|
212
197
|
setData() {
|
|
213
|
-
const
|
|
214
|
-
return new
|
|
215
|
-
monthName: this.getMonthName(
|
|
216
|
-
year:
|
|
217
|
-
month:
|
|
218
|
-
currentDate:
|
|
219
|
-
currentWeek:
|
|
198
|
+
const e = /* @__PURE__ */ new Date(), s = this.selectedWeek || this.calculateCurrentWeek(e), n = L(s, e.getFullYear());
|
|
199
|
+
return new S({
|
|
200
|
+
monthName: this.getMonthName(n.getMonth()),
|
|
201
|
+
year: n.getFullYear(),
|
|
202
|
+
month: n.getMonth(),
|
|
203
|
+
currentDate: n.getDate(),
|
|
204
|
+
currentWeek: s
|
|
220
205
|
});
|
|
221
206
|
}
|
|
222
207
|
/**
|
|
@@ -225,9 +210,9 @@ class qe extends h {
|
|
|
225
210
|
* @param {Date} today
|
|
226
211
|
* @returns {Date}
|
|
227
212
|
*/
|
|
228
|
-
getSelectedDate(
|
|
229
|
-
const
|
|
230
|
-
return new Date(
|
|
213
|
+
getSelectedDate(e) {
|
|
214
|
+
const s = this.selectedDate ? new Date(this.selectedDate) : e;
|
|
215
|
+
return new Date(s.getFullYear(), s.getMonth(), s.getDate());
|
|
231
216
|
}
|
|
232
217
|
/**
|
|
233
218
|
* Calculates the ISO week number for a given date.
|
|
@@ -235,11 +220,11 @@ class qe extends h {
|
|
|
235
220
|
* @param {Date} date
|
|
236
221
|
* @returns {number}
|
|
237
222
|
*/
|
|
238
|
-
calculateCurrentWeek(
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
const
|
|
242
|
-
return
|
|
223
|
+
calculateCurrentWeek(e) {
|
|
224
|
+
const s = new Date(e.valueOf()), n = (e.getDay() + 6) % 7;
|
|
225
|
+
s.setDate(s.getDate() - n + 3);
|
|
226
|
+
const a = s.valueOf();
|
|
227
|
+
return s.setMonth(0, 1), s.getDay() !== 4 && s.setMonth(0, 1 + (4 - s.getDay() + 7) % 7), 1 + Math.ceil((a - s) / 6048e5);
|
|
243
228
|
}
|
|
244
229
|
/**
|
|
245
230
|
* Gets the name of the month.
|
|
@@ -247,8 +232,8 @@ class qe extends h {
|
|
|
247
232
|
* @param {number} month
|
|
248
233
|
* @returns {string}
|
|
249
234
|
*/
|
|
250
|
-
getMonthName(
|
|
251
|
-
return
|
|
235
|
+
getMonthName(e) {
|
|
236
|
+
return H.monthNames[e];
|
|
252
237
|
}
|
|
253
238
|
/**
|
|
254
239
|
* Updates the calendar to show the previous month.
|
|
@@ -256,9 +241,9 @@ class qe extends h {
|
|
|
256
241
|
* @returns {void}
|
|
257
242
|
*/
|
|
258
243
|
goToPreviousMonth() {
|
|
259
|
-
const
|
|
260
|
-
let { year:
|
|
261
|
-
|
|
244
|
+
const e = this.data;
|
|
245
|
+
let { year: s, month: n } = e;
|
|
246
|
+
n === 0 ? (n = 11, s--) : n--, this.setDate(n, s);
|
|
262
247
|
}
|
|
263
248
|
/**
|
|
264
249
|
* Updates the calendar to show the next month.
|
|
@@ -266,9 +251,9 @@ class qe extends h {
|
|
|
266
251
|
* @returns {void}
|
|
267
252
|
*/
|
|
268
253
|
goToNextMonth() {
|
|
269
|
-
const
|
|
270
|
-
let { year:
|
|
271
|
-
|
|
254
|
+
const e = this.data;
|
|
255
|
+
let { year: s, month: n } = e;
|
|
256
|
+
n === 11 ? (n = 0, s++) : n++, this.setDate(n, s);
|
|
272
257
|
}
|
|
273
258
|
/**
|
|
274
259
|
* Sets the selected date.
|
|
@@ -278,12 +263,12 @@ class qe extends h {
|
|
|
278
263
|
* @param {number|null} [date=null]
|
|
279
264
|
* @returns {void}
|
|
280
265
|
*/
|
|
281
|
-
setDate(
|
|
266
|
+
setDate(e, s, n) {
|
|
282
267
|
this.data.set({
|
|
283
|
-
year:
|
|
284
|
-
month:
|
|
285
|
-
monthName: this.getMonthName(
|
|
286
|
-
}),
|
|
268
|
+
year: s,
|
|
269
|
+
month: e,
|
|
270
|
+
monthName: this.getMonthName(e)
|
|
271
|
+
}), n && (this.data.currentDate = n);
|
|
287
272
|
}
|
|
288
273
|
/**
|
|
289
274
|
* Handles week selection.
|
|
@@ -291,10 +276,10 @@ class qe extends h {
|
|
|
291
276
|
* @param {number} weekNumber
|
|
292
277
|
* @returns {void}
|
|
293
278
|
*/
|
|
294
|
-
selectWeek(
|
|
295
|
-
this.data.currentWeek =
|
|
296
|
-
const
|
|
297
|
-
this.setDate(
|
|
279
|
+
selectWeek(e, s) {
|
|
280
|
+
this.data.currentWeek = e;
|
|
281
|
+
const n = L(e, s);
|
|
282
|
+
this.setDate(n.getMonth(), n.getFullYear(), n.getDate()), typeof this.selectedCallBack == "function" && this.selectedCallBack(e);
|
|
298
283
|
}
|
|
299
284
|
/**
|
|
300
285
|
* Renders the WeekCalendar component.
|
|
@@ -303,47 +288,47 @@ class qe extends h {
|
|
|
303
288
|
*/
|
|
304
289
|
render() {
|
|
305
290
|
return o({ class: "week-calendar-container border rounded-md bg-background p-3" }, [
|
|
306
|
-
|
|
291
|
+
oe({
|
|
307
292
|
next: () => this.goToNextMonth(),
|
|
308
293
|
previous: () => this.goToPreviousMonth()
|
|
309
294
|
}),
|
|
310
|
-
|
|
311
|
-
selectWeek: (
|
|
295
|
+
ie({
|
|
296
|
+
selectWeek: (e, s) => this.selectWeek(e, s)
|
|
312
297
|
})
|
|
313
298
|
]);
|
|
314
299
|
}
|
|
315
300
|
}
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
]),
|
|
319
|
-
const r =
|
|
320
|
-
return
|
|
301
|
+
const le = (t) => O({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class || ""}` }, [
|
|
302
|
+
z((e) => new G({ class: "mr-2", onChange: () => e.toggleAllSelectedRows() }))
|
|
303
|
+
]), re = ({ align: t, sortable: e, key: s, label: n, sort: a, class: i }) => {
|
|
304
|
+
const r = t || "justify-start";
|
|
305
|
+
return O({
|
|
321
306
|
class: `cursor-pointer py-3 px-4 text-base ${i || ""}`,
|
|
322
|
-
click:
|
|
307
|
+
click: e && (() => a(s))
|
|
323
308
|
}, [
|
|
324
309
|
o({ class: `flex flex-auto w-full items-center ${r}` }, [
|
|
325
|
-
|
|
326
|
-
|
|
310
|
+
y(n),
|
|
311
|
+
e && Y({ class: "ml-2", html: k.arrows.upDown })
|
|
327
312
|
])
|
|
328
313
|
]);
|
|
329
|
-
},
|
|
330
|
-
|
|
314
|
+
}, ce = (t) => U([
|
|
315
|
+
F({
|
|
331
316
|
class: "text-muted-foreground border-b",
|
|
332
|
-
map: [
|
|
333
|
-
align:
|
|
334
|
-
sortable:
|
|
335
|
-
key:
|
|
336
|
-
label:
|
|
337
|
-
sort:
|
|
317
|
+
map: [t.headers, (e) => e.label === "checkbox" ? le({ toggle: t.toggle }) : re({
|
|
318
|
+
align: e.align,
|
|
319
|
+
sortable: e.sortable,
|
|
320
|
+
key: e.key,
|
|
321
|
+
label: e.label,
|
|
322
|
+
sort: t.sort
|
|
338
323
|
})]
|
|
339
324
|
})
|
|
340
|
-
]),
|
|
325
|
+
]), de = ({ key: t, rows: e, selectRow: s, rowItem: n }) => new K({
|
|
341
326
|
cache: "table",
|
|
342
|
-
key:
|
|
343
|
-
items:
|
|
344
|
-
rowItem: (a) => n(a,
|
|
327
|
+
key: t,
|
|
328
|
+
items: e,
|
|
329
|
+
rowItem: (a) => n(a, s),
|
|
345
330
|
class: "divide-y divide-border"
|
|
346
|
-
}),
|
|
331
|
+
}), _e = I(
|
|
347
332
|
{
|
|
348
333
|
/**
|
|
349
334
|
* Initializes component data.
|
|
@@ -351,7 +336,7 @@ const de = (e) => B({ class: `cursor-pointer py-3 px-4 text-base w-10 ${e.class
|
|
|
351
336
|
* @returns {Data}
|
|
352
337
|
*/
|
|
353
338
|
setData() {
|
|
354
|
-
return new
|
|
339
|
+
return new S({
|
|
355
340
|
selectedRows: [],
|
|
356
341
|
selected: !1
|
|
357
342
|
});
|
|
@@ -362,8 +347,8 @@ const de = (e) => B({ class: `cursor-pointer py-3 px-4 text-base w-10 ${e.class
|
|
|
362
347
|
* @returns {void}
|
|
363
348
|
*/
|
|
364
349
|
toggleAllSelectedRows() {
|
|
365
|
-
const
|
|
366
|
-
this.data.selectedRows =
|
|
350
|
+
const t = this.table.getRows(), e = this.data.selectedRows.length === t.length, s = e ? [] : t;
|
|
351
|
+
this.data.selectedRows = s, this.updateSelected(), this.updateTable(!e);
|
|
367
352
|
},
|
|
368
353
|
/**
|
|
369
354
|
* This will update the selected state.
|
|
@@ -371,8 +356,8 @@ const de = (e) => B({ class: `cursor-pointer py-3 px-4 text-base w-10 ${e.class
|
|
|
371
356
|
* @returns {void}
|
|
372
357
|
*/
|
|
373
358
|
updateSelected() {
|
|
374
|
-
const
|
|
375
|
-
this.data.selected =
|
|
359
|
+
const t = this.data.get("selectedRows");
|
|
360
|
+
this.data.selected = t.length > 0;
|
|
376
361
|
},
|
|
377
362
|
/**
|
|
378
363
|
* This will get the selected rows.
|
|
@@ -389,19 +374,19 @@ const de = (e) => B({ class: `cursor-pointer py-3 px-4 text-base w-10 ${e.class
|
|
|
389
374
|
* @param {boolean} selected
|
|
390
375
|
* @returns {void}
|
|
391
376
|
*/
|
|
392
|
-
updateTable(
|
|
393
|
-
const
|
|
394
|
-
|
|
377
|
+
updateTable(t) {
|
|
378
|
+
const e = this.table.getRows();
|
|
379
|
+
e.forEach((s) => s.selected = t), this.table.setRows(e);
|
|
395
380
|
},
|
|
396
381
|
/**
|
|
397
382
|
* Handles row selection.
|
|
398
383
|
*
|
|
399
384
|
* @param {object} row
|
|
400
385
|
*/
|
|
401
|
-
selectRow(
|
|
402
|
-
const
|
|
403
|
-
|
|
404
|
-
const
|
|
386
|
+
selectRow(t) {
|
|
387
|
+
const e = t.selected ?? !1;
|
|
388
|
+
t.selected = !e;
|
|
389
|
+
const s = this.data.get("selectedRows"), n = t.selected ? [...s, t] : s.filter((a) => a !== t);
|
|
405
390
|
this.data.selectedRows = n, this.updateSelected();
|
|
406
391
|
},
|
|
407
392
|
/**
|
|
@@ -410,18 +395,18 @@ const de = (e) => B({ class: `cursor-pointer py-3 px-4 text-base w-10 ${e.class
|
|
|
410
395
|
* @returns {object}
|
|
411
396
|
*/
|
|
412
397
|
render() {
|
|
413
|
-
const
|
|
398
|
+
const t = this.rows, e = this.border !== !1 ? "border" : "";
|
|
414
399
|
return o({ class: "w-full" }, [
|
|
415
|
-
o({ class: `w-full rounded-md ${
|
|
416
|
-
|
|
400
|
+
o({ class: `w-full rounded-md ${e} overflow-x-auto` }, [
|
|
401
|
+
E({ class: "w-full" }, [
|
|
417
402
|
// @ts-ignore
|
|
418
|
-
this.headers &&
|
|
403
|
+
this.headers && ce({ headers: this.headers, sort: (s) => this.sortRows(s) }),
|
|
419
404
|
// @ts-ignore
|
|
420
405
|
this.customHeader ?? null,
|
|
421
|
-
|
|
406
|
+
de({
|
|
422
407
|
// @ts-ignore
|
|
423
408
|
key: this.key,
|
|
424
|
-
rows:
|
|
409
|
+
rows: t,
|
|
425
410
|
// @ts-ignore
|
|
426
411
|
selectRow: this.selectRow.bind(this),
|
|
427
412
|
// @ts-ignore
|
|
@@ -438,8 +423,8 @@ const de = (e) => B({ class: `cursor-pointer py-3 px-4 text-base w-10 ${e.class
|
|
|
438
423
|
* @param {array} items
|
|
439
424
|
* @returns {void}
|
|
440
425
|
*/
|
|
441
|
-
remove(
|
|
442
|
-
this.table.remove(
|
|
426
|
+
remove(t) {
|
|
427
|
+
this.table.remove(t);
|
|
443
428
|
},
|
|
444
429
|
/**
|
|
445
430
|
* This will set the items in the list.
|
|
@@ -448,8 +433,8 @@ const de = (e) => B({ class: `cursor-pointer py-3 px-4 text-base w-10 ${e.class
|
|
|
448
433
|
* @param {array} rows
|
|
449
434
|
* @returns {void}
|
|
450
435
|
*/
|
|
451
|
-
setRows(
|
|
452
|
-
this.table.setRows(
|
|
436
|
+
setRows(t) {
|
|
437
|
+
this.table.setRows(t);
|
|
453
438
|
},
|
|
454
439
|
/**
|
|
455
440
|
* This will append items to the list.
|
|
@@ -458,8 +443,8 @@ const de = (e) => B({ class: `cursor-pointer py-3 px-4 text-base w-10 ${e.class
|
|
|
458
443
|
* @param {array|object} items
|
|
459
444
|
* @returns {void}
|
|
460
445
|
*/
|
|
461
|
-
append(
|
|
462
|
-
this.table.append(
|
|
446
|
+
append(t) {
|
|
447
|
+
this.table.append(t);
|
|
463
448
|
},
|
|
464
449
|
/**
|
|
465
450
|
* This will mingle the new items with the old items.
|
|
@@ -469,8 +454,8 @@ const de = (e) => B({ class: `cursor-pointer py-3 px-4 text-base w-10 ${e.class
|
|
|
469
454
|
* @param {boolean} withDelete
|
|
470
455
|
* @returns {void}
|
|
471
456
|
*/
|
|
472
|
-
mingle(
|
|
473
|
-
this.table.mingle(
|
|
457
|
+
mingle(t, e = !1) {
|
|
458
|
+
this.table.mingle(t, e);
|
|
474
459
|
},
|
|
475
460
|
/**
|
|
476
461
|
* This will prepend items to the list.
|
|
@@ -479,8 +464,8 @@ const de = (e) => B({ class: `cursor-pointer py-3 px-4 text-base w-10 ${e.class
|
|
|
479
464
|
* @param {array|object} items
|
|
480
465
|
* @returns {void}
|
|
481
466
|
*/
|
|
482
|
-
prepend(
|
|
483
|
-
this.table.prepend(
|
|
467
|
+
prepend(t) {
|
|
468
|
+
this.table.prepend(t);
|
|
484
469
|
},
|
|
485
470
|
/**
|
|
486
471
|
* This will remove the selected rows.
|
|
@@ -491,59 +476,52 @@ const de = (e) => B({ class: `cursor-pointer py-3 px-4 text-base w-10 ${e.class
|
|
|
491
476
|
this.data.selectedRows = [];
|
|
492
477
|
}
|
|
493
478
|
}
|
|
494
|
-
),
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
])),
|
|
479
|
+
), ue = d(({ name: t, email: e }) => o({ class: "min-w-0 flex-auto" }, [
|
|
480
|
+
g({ class: "text-base font-semibold leading-6 m-0" }, t),
|
|
481
|
+
g({ class: "truncate text-sm leading-5 text-muted-foreground m-0" }, e)
|
|
482
|
+
])), he = () => o({ class: "flex items-center gap-x-1.5" }, [
|
|
498
483
|
o({ class: "flex-none rounded-full bg-emerald-500/20 p-1" }, [
|
|
499
484
|
o({ class: "h-1.5 w-1.5 rounded-full bg-emerald-500" })
|
|
500
485
|
]),
|
|
501
|
-
|
|
502
|
-
]),
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
]),
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
])),
|
|
486
|
+
g({ class: "text-xs leading-5 text-gray-500" }, "Online")
|
|
487
|
+
]), fe = (t) => g({ class: "text-xs leading-5 text-muted-foreground" }, [
|
|
488
|
+
y("Last seen "),
|
|
489
|
+
Q({ datetime: t }, "3h ago")
|
|
490
|
+
]), ge = (t, e) => t === "online" ? he() : fe(e), pe = d(({ role: t, lastSeen: e, status: s }) => o({ class: "hidden shrink-0 sm:flex sm:flex-col sm:items-end" }, [
|
|
491
|
+
g({ class: "text-sm leading-6 m-0" }, t),
|
|
492
|
+
ge(s, e)
|
|
493
|
+
])), me = (t) => t.split(" ").map((s) => s[0]).join(""), xe = d((t) => v({ class: "fadeIn flex justify-between gap-x-6 py-4 px-4 rounded-md hover:bg-muted/50" }, [
|
|
509
494
|
o({ class: "flex min-w-0 gap-x-4" }, [
|
|
510
|
-
|
|
511
|
-
|
|
495
|
+
q({ src: t.image, alt: t.name, fallbackText: me(t.name) }),
|
|
496
|
+
ue({ name: t.name, email: t.email })
|
|
512
497
|
]),
|
|
513
|
-
|
|
514
|
-
role:
|
|
515
|
-
lastSeen:
|
|
516
|
-
status:
|
|
498
|
+
pe({
|
|
499
|
+
role: t.role,
|
|
500
|
+
lastSeen: t.lastSeen,
|
|
501
|
+
status: t.status
|
|
517
502
|
})
|
|
518
|
-
])),
|
|
503
|
+
])), Ge = d((t) => new _({
|
|
519
504
|
cache: "list",
|
|
520
505
|
key: "name",
|
|
521
|
-
items:
|
|
506
|
+
items: t.users,
|
|
522
507
|
role: "list",
|
|
523
508
|
class: "divide-y divide-border",
|
|
524
|
-
rowItem:
|
|
525
|
-
})),
|
|
526
|
-
text:
|
|
527
|
-
href:
|
|
528
|
-
exact:
|
|
509
|
+
rowItem: xe
|
|
510
|
+
})), be = (t, e) => e.includes(t), ke = (t, e, s) => t.exact ? s === e : be(e, s), we = ({ text: t, href: e, exact: s, hidden: n }) => new M({
|
|
511
|
+
text: t,
|
|
512
|
+
href: e,
|
|
513
|
+
exact: s,
|
|
529
514
|
dataSet: ["selected", ["state", !0, "active"]],
|
|
530
515
|
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
516
|
});
|
|
532
|
-
class
|
|
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", "");
|
|
517
|
+
class Ve extends u {
|
|
518
|
+
/**
|
|
519
|
+
* This will declare the props for the compiler.
|
|
520
|
+
*
|
|
521
|
+
* @returns {void}
|
|
522
|
+
*/
|
|
523
|
+
declareProps() {
|
|
524
|
+
this.options = [], this.class = "";
|
|
547
525
|
}
|
|
548
526
|
/**
|
|
549
527
|
* This will configure the links.
|
|
@@ -557,14 +535,14 @@ class Ze extends h {
|
|
|
557
535
|
* @returns {object}
|
|
558
536
|
*/
|
|
559
537
|
render() {
|
|
560
|
-
return
|
|
538
|
+
return D(
|
|
561
539
|
{ class: `flex items-center justify-center p-2 text-muted-foreground rounded-md ${this.class || ""}` },
|
|
562
540
|
[
|
|
563
|
-
|
|
541
|
+
p({
|
|
564
542
|
class: "flex space-x-4",
|
|
565
|
-
map: [this.options, (
|
|
543
|
+
map: [this.options, (e) => this.addLink(e)],
|
|
566
544
|
watch: {
|
|
567
|
-
value: ["[[path]]",
|
|
545
|
+
value: ["[[path]]", b.data],
|
|
568
546
|
callBack: this.updateLinks.bind(this)
|
|
569
547
|
}
|
|
570
548
|
})
|
|
@@ -577,8 +555,8 @@ class Ze extends h {
|
|
|
577
555
|
* @returns {void}
|
|
578
556
|
*/
|
|
579
557
|
afterSetup() {
|
|
580
|
-
const
|
|
581
|
-
this.updateLinks(
|
|
558
|
+
const e = b.data.path;
|
|
559
|
+
this.updateLinks(e);
|
|
582
560
|
}
|
|
583
561
|
/**
|
|
584
562
|
* This will update the links based on the current path.
|
|
@@ -586,15 +564,15 @@ class Ze extends h {
|
|
|
586
564
|
* @param {string} path
|
|
587
565
|
* @returns {void}
|
|
588
566
|
*/
|
|
589
|
-
updateLinks(
|
|
590
|
-
let
|
|
567
|
+
updateLinks(e) {
|
|
568
|
+
let s = !1;
|
|
591
569
|
this.deactivateAllLinks();
|
|
592
|
-
for (const
|
|
593
|
-
if (!
|
|
570
|
+
for (const n of this.links) {
|
|
571
|
+
if (!n.rendered)
|
|
594
572
|
continue;
|
|
595
|
-
|
|
573
|
+
ke(n, n.getLinkPath(), e) ? (this.updateLink(n, !0), s = !0) : this.updateLink(n, !1);
|
|
596
574
|
}
|
|
597
|
-
!
|
|
575
|
+
!s && this.links[0] && this.updateLink(this.links[0], !0);
|
|
598
576
|
}
|
|
599
577
|
/**
|
|
600
578
|
* This will deactivate all links.
|
|
@@ -602,8 +580,8 @@ class Ze extends h {
|
|
|
602
580
|
* @returns {void}
|
|
603
581
|
*/
|
|
604
582
|
deactivateAllLinks() {
|
|
605
|
-
for (const
|
|
606
|
-
this.updateLink(
|
|
583
|
+
for (const e of this.links)
|
|
584
|
+
this.updateLink(e, !1);
|
|
607
585
|
}
|
|
608
586
|
/**
|
|
609
587
|
* This will update the link's active state.
|
|
@@ -612,8 +590,8 @@ class Ze extends h {
|
|
|
612
590
|
* @param {boolean} selected
|
|
613
591
|
* @returns {void}
|
|
614
592
|
*/
|
|
615
|
-
updateLink(
|
|
616
|
-
|
|
593
|
+
updateLink(e, s) {
|
|
594
|
+
e.update(s);
|
|
617
595
|
}
|
|
618
596
|
/**
|
|
619
597
|
* This will add a link to the navigation.
|
|
@@ -621,9 +599,9 @@ class Ze extends h {
|
|
|
621
599
|
* @param {object} option
|
|
622
600
|
* @returns {object}
|
|
623
601
|
*/
|
|
624
|
-
addLink({ label:
|
|
625
|
-
const
|
|
626
|
-
return this.links.push(
|
|
602
|
+
addLink({ label: e, href: s, exact: n, hidden: a }) {
|
|
603
|
+
const i = we({ text: e, href: s, exact: n, hidden: a });
|
|
604
|
+
return this.links.push(i), i;
|
|
627
605
|
}
|
|
628
606
|
/**
|
|
629
607
|
* This will clear the links.
|
|
@@ -634,10 +612,10 @@ class Ze extends h {
|
|
|
634
612
|
this.links = [];
|
|
635
613
|
}
|
|
636
614
|
}
|
|
637
|
-
const
|
|
638
|
-
const
|
|
639
|
-
return o({ class: `flex-none ${
|
|
640
|
-
|
|
615
|
+
const qe = d((t) => {
|
|
616
|
+
const e = t.margin || "m-4 ml-0";
|
|
617
|
+
return o({ class: `flex-none ${e}` }, [
|
|
618
|
+
R({
|
|
641
619
|
variant: "icon",
|
|
642
620
|
class: "back-button",
|
|
643
621
|
click: () => {
|
|
@@ -645,21 +623,21 @@ const et = u((e) => {
|
|
|
645
623
|
window.history.back();
|
|
646
624
|
return;
|
|
647
625
|
}
|
|
648
|
-
|
|
626
|
+
t.backUrl && app.navigate(t.backUrl);
|
|
649
627
|
}
|
|
650
628
|
}, [
|
|
651
|
-
|
|
629
|
+
T(k.arrows.left)
|
|
652
630
|
])
|
|
653
631
|
]);
|
|
654
632
|
});
|
|
655
|
-
class
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
633
|
+
class N extends u {
|
|
634
|
+
/**
|
|
635
|
+
* This will declare the props for the compiler.
|
|
636
|
+
*
|
|
637
|
+
* @returns {void}
|
|
638
|
+
*/
|
|
639
|
+
declareProps() {
|
|
640
|
+
this.class = "";
|
|
663
641
|
}
|
|
664
642
|
/**
|
|
665
643
|
* This will render the component.
|
|
@@ -693,7 +671,7 @@ class W extends h {
|
|
|
693
671
|
* @param {object} container
|
|
694
672
|
* @returns {void}
|
|
695
673
|
*/
|
|
696
|
-
setContainer(
|
|
674
|
+
setContainer(e) {
|
|
697
675
|
this.container = app.root;
|
|
698
676
|
}
|
|
699
677
|
/**
|
|
@@ -739,15 +717,7 @@ class W extends h {
|
|
|
739
717
|
return this.children;
|
|
740
718
|
}
|
|
741
719
|
}
|
|
742
|
-
class
|
|
743
|
-
constructor() {
|
|
744
|
-
super(...arguments);
|
|
745
|
-
/**
|
|
746
|
-
* @member {string} class
|
|
747
|
-
* @default ''
|
|
748
|
-
*/
|
|
749
|
-
l(this, "class", "");
|
|
750
|
-
}
|
|
720
|
+
class Je extends N {
|
|
751
721
|
/**
|
|
752
722
|
* This will stop presistence.
|
|
753
723
|
*
|
|
@@ -762,15 +732,15 @@ class tt extends W {
|
|
|
762
732
|
* @returns {object}
|
|
763
733
|
*/
|
|
764
734
|
render() {
|
|
765
|
-
const
|
|
735
|
+
const e = this.container;
|
|
766
736
|
return o(
|
|
767
737
|
{
|
|
768
738
|
onState: [
|
|
769
739
|
["loading", {
|
|
770
740
|
loading: !0
|
|
771
741
|
}],
|
|
772
|
-
["docked", (
|
|
773
|
-
|
|
742
|
+
["docked", (s, n) => {
|
|
743
|
+
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");
|
|
774
744
|
}]
|
|
775
745
|
]
|
|
776
746
|
},
|
|
@@ -793,8 +763,8 @@ class tt extends W {
|
|
|
793
763
|
* @param {object} container
|
|
794
764
|
* @returns {void}
|
|
795
765
|
*/
|
|
796
|
-
setup(
|
|
797
|
-
this.container =
|
|
766
|
+
setup(e) {
|
|
767
|
+
this.container = e, this.initialize();
|
|
798
768
|
}
|
|
799
769
|
/**
|
|
800
770
|
* This will setup the overlay states.
|
|
@@ -850,15 +820,7 @@ class tt extends W {
|
|
|
850
820
|
document.documentElement.style.overflowY = "auto";
|
|
851
821
|
}
|
|
852
822
|
}
|
|
853
|
-
class
|
|
854
|
-
constructor() {
|
|
855
|
-
super(...arguments);
|
|
856
|
-
/**
|
|
857
|
-
* @member {string} class
|
|
858
|
-
* @default ''
|
|
859
|
-
*/
|
|
860
|
-
l(this, "class", "");
|
|
861
|
-
}
|
|
823
|
+
class Xe extends N {
|
|
862
824
|
/**
|
|
863
825
|
* This will get the overlay type.
|
|
864
826
|
*
|
|
@@ -873,51 +835,51 @@ class st extends W {
|
|
|
873
835
|
* @param {object} container
|
|
874
836
|
* @returns {void}
|
|
875
837
|
*/
|
|
876
|
-
setup(
|
|
877
|
-
this.container =
|
|
838
|
+
setup(e) {
|
|
839
|
+
this.container = e, this.initialize();
|
|
878
840
|
}
|
|
879
841
|
}
|
|
880
|
-
const
|
|
842
|
+
const ye = d(({ index: t, click: e, state: s }, n) => v({
|
|
881
843
|
class: "p-2 cursor-pointer hover:bg-muted/50",
|
|
882
844
|
onState: [
|
|
883
|
-
[
|
|
884
|
-
"bg-accent":
|
|
885
|
-
"text-white":
|
|
845
|
+
[s, "selectedIndex", {
|
|
846
|
+
"bg-accent": t,
|
|
847
|
+
"text-white": t
|
|
886
848
|
}]
|
|
887
849
|
],
|
|
888
|
-
pointerdown: () =>
|
|
889
|
-
}, n)),
|
|
850
|
+
pointerdown: () => e(t)
|
|
851
|
+
}, n)), ve = d(({ selectOption: t, state: e }) => p({
|
|
890
852
|
class: "border rounded-md list-none m-0 p-0 max-h-[400px] overflow-y-auto",
|
|
891
|
-
for: ["filteredOptions", (
|
|
892
|
-
})),
|
|
893
|
-
|
|
853
|
+
for: ["filteredOptions", (s, n) => ye({ index: n, click: t, state: e }, s.label)]
|
|
854
|
+
})), De = 100, Se = d((t) => o({ class: "relative flex items-center" }, [
|
|
855
|
+
V({
|
|
894
856
|
cache: "input",
|
|
895
|
-
placeholder:
|
|
896
|
-
bind: [
|
|
897
|
-
keyup: (
|
|
898
|
-
|
|
857
|
+
placeholder: t.placeholder ?? "Search...",
|
|
858
|
+
bind: [t.state, "searchQuery"],
|
|
859
|
+
keyup: (e, s) => {
|
|
860
|
+
s.state.open = !0, typeof t.filterOptions == "function" && t.filterOptions(), s.dropdown.updatePosition();
|
|
899
861
|
},
|
|
900
|
-
pointerup: (
|
|
901
|
-
blur: (
|
|
902
|
-
keydown: (
|
|
862
|
+
pointerup: (e, s) => s.toggleDropdown(),
|
|
863
|
+
blur: (e, { state: s }) => setTimeout(() => s.open = !1, De),
|
|
864
|
+
keydown: (e) => typeof t.handleKeyDown == "function" && t.handleKeyDown(e)
|
|
903
865
|
}),
|
|
904
|
-
|
|
905
|
-
|
|
866
|
+
t.icon && o({ class: "absolute right-0 mr-2" }, [
|
|
867
|
+
T(t.icon)
|
|
906
868
|
])
|
|
907
|
-
])),
|
|
869
|
+
])), Le = (t) => o({
|
|
908
870
|
class: "relative flex fle-auto flex-col",
|
|
909
|
-
onState: ["open", (
|
|
910
|
-
if (
|
|
911
|
-
return new
|
|
871
|
+
onState: ["open", (e, s, n) => {
|
|
872
|
+
if (e)
|
|
873
|
+
return new J({
|
|
912
874
|
cache: "dropdown",
|
|
913
875
|
parent: n,
|
|
914
876
|
button: n.input,
|
|
915
877
|
size: "xl"
|
|
916
878
|
}, [
|
|
917
|
-
|
|
879
|
+
ve(t)
|
|
918
880
|
]);
|
|
919
881
|
}]
|
|
920
|
-
}),
|
|
882
|
+
}), Ze = I(
|
|
921
883
|
{
|
|
922
884
|
/**
|
|
923
885
|
* This will set up the data object.
|
|
@@ -925,10 +887,10 @@ const Se = u(({ index: e, click: s, state: t }, n) => D({
|
|
|
925
887
|
* @returns {object} - The data object.
|
|
926
888
|
*/
|
|
927
889
|
setData() {
|
|
928
|
-
const
|
|
929
|
-
return new
|
|
930
|
-
options:
|
|
931
|
-
filteredOptions:
|
|
890
|
+
const t = this.options || [];
|
|
891
|
+
return new S({
|
|
892
|
+
options: t,
|
|
893
|
+
filteredOptions: t
|
|
932
894
|
});
|
|
933
895
|
},
|
|
934
896
|
/**
|
|
@@ -949,11 +911,11 @@ const Se = u(({ index: e, click: s, state: t }, n) => D({
|
|
|
949
911
|
* @returns {void}
|
|
950
912
|
*/
|
|
951
913
|
setSelectedIndexByQuery() {
|
|
952
|
-
const
|
|
953
|
-
let { searchQuery:
|
|
954
|
-
|
|
955
|
-
const
|
|
956
|
-
|
|
914
|
+
const t = this.data.filteredOptions;
|
|
915
|
+
let { searchQuery: e } = this.state;
|
|
916
|
+
e = e.toLowerCase();
|
|
917
|
+
const s = t.findIndex((n) => n.label.toLowerCase() === e);
|
|
918
|
+
s >= 0 && (this.state.selectedIndex = s);
|
|
957
919
|
},
|
|
958
920
|
/**
|
|
959
921
|
* This will filter the options.
|
|
@@ -961,14 +923,14 @@ const Se = u(({ index: e, click: s, state: t }, n) => D({
|
|
|
961
923
|
* @returns {void}
|
|
962
924
|
*/
|
|
963
925
|
filterOptions() {
|
|
964
|
-
const
|
|
965
|
-
if (
|
|
926
|
+
const t = this.state.searchQuery.toLowerCase();
|
|
927
|
+
if (t === "" || t.length === 0) {
|
|
966
928
|
this.data.filteredOptions = this.data.options;
|
|
967
929
|
return;
|
|
968
930
|
}
|
|
969
|
-
const
|
|
970
|
-
this.data.filteredOptions =
|
|
971
|
-
(
|
|
931
|
+
const e = this.data.get("options");
|
|
932
|
+
this.data.filteredOptions = e.filter(
|
|
933
|
+
(s) => s.label.toLowerCase().includes(t)
|
|
972
934
|
);
|
|
973
935
|
},
|
|
974
936
|
/**
|
|
@@ -977,8 +939,8 @@ const Se = u(({ index: e, click: s, state: t }, n) => D({
|
|
|
977
939
|
* @returns {object}
|
|
978
940
|
*/
|
|
979
941
|
getValue() {
|
|
980
|
-
const { selectedIndex:
|
|
981
|
-
return
|
|
942
|
+
const { selectedIndex: t } = this.state;
|
|
943
|
+
return t < 0 ? null : this.data.get(`filteredOptions[${t}]`);
|
|
982
944
|
},
|
|
983
945
|
/**
|
|
984
946
|
* This will select an option.
|
|
@@ -986,10 +948,10 @@ const Se = u(({ index: e, click: s, state: t }, n) => D({
|
|
|
986
948
|
* @param {number} index - The index of the option.
|
|
987
949
|
* @returns {void}
|
|
988
950
|
*/
|
|
989
|
-
selectOption(
|
|
990
|
-
this.state.selectedIndex =
|
|
991
|
-
const
|
|
992
|
-
this.state.searchQuery =
|
|
951
|
+
selectOption(t) {
|
|
952
|
+
this.state.selectedIndex = t;
|
|
953
|
+
const e = this.data.get(`filteredOptions[${t}]`);
|
|
954
|
+
this.state.searchQuery = e.label, this.state.open = !1, typeof this.onSelect == "function" && this.onSelect(e);
|
|
993
955
|
},
|
|
994
956
|
/**
|
|
995
957
|
* Toggles the dropdown open state.
|
|
@@ -1003,9 +965,9 @@ const Se = u(({ index: e, click: s, state: t }, n) => D({
|
|
|
1003
965
|
* @param {object} event - The event object.
|
|
1004
966
|
* @returns {void}
|
|
1005
967
|
*/
|
|
1006
|
-
handleKeyDown(
|
|
1007
|
-
const
|
|
1008
|
-
|
|
968
|
+
handleKeyDown(t) {
|
|
969
|
+
const e = this.data.filteredOptions, { selectedIndex: s } = this.state;
|
|
970
|
+
t.key === "ArrowDown" ? (t.preventDefault(), this.state.selectedIndex = Math.min(s + 1, e.length - 1)) : t.key === "ArrowUp" ? (t.preventDefault(), this.state.selectedIndex = Math.max(s - 1, 0)) : t.key === "Enter" && s >= 0 && (t.preventDefault(), this.selectOption(s));
|
|
1009
971
|
},
|
|
1010
972
|
/**
|
|
1011
973
|
* This will render the component.
|
|
@@ -1014,7 +976,7 @@ const Se = u(({ index: e, click: s, state: t }, n) => D({
|
|
|
1014
976
|
*/
|
|
1015
977
|
render() {
|
|
1016
978
|
return o({ class: "relative w-full max-w-md" }, [
|
|
1017
|
-
|
|
979
|
+
Se({
|
|
1018
980
|
// @ts-ignore
|
|
1019
981
|
state: this.state,
|
|
1020
982
|
// @ts-ignore
|
|
@@ -1026,7 +988,7 @@ const Se = u(({ index: e, click: s, state: t }, n) => D({
|
|
|
1026
988
|
// @ts-ignore
|
|
1027
989
|
handleKeyDown: this.handleKeyDown.bind(this)
|
|
1028
990
|
}),
|
|
1029
|
-
|
|
991
|
+
Le({
|
|
1030
992
|
// @ts-ignore
|
|
1031
993
|
state: this.state,
|
|
1032
994
|
// @ts-ignore
|
|
@@ -1037,41 +999,29 @@ const Se = u(({ index: e, click: s, state: t }, n) => D({
|
|
|
1037
999
|
]);
|
|
1038
1000
|
}
|
|
1039
1001
|
}
|
|
1040
|
-
),
|
|
1002
|
+
), Ce = (t) => v(
|
|
1041
1003
|
{
|
|
1042
1004
|
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",
|
|
1043
|
-
dataSet: ["selected", ["state",
|
|
1005
|
+
dataSet: ["selected", ["state", t.value, "active"]]
|
|
1044
1006
|
},
|
|
1045
1007
|
[
|
|
1046
|
-
|
|
1008
|
+
w({
|
|
1047
1009
|
class: "flex flex-auto justify-center items-center px-3 py-1.5",
|
|
1048
|
-
onSet: ["selected", { selected:
|
|
1049
|
-
click: (
|
|
1050
|
-
},
|
|
1010
|
+
onSet: ["selected", { selected: t.value }],
|
|
1011
|
+
click: (e) => t.callBack(t.value)
|
|
1012
|
+
}, t.label)
|
|
1051
1013
|
]
|
|
1052
|
-
),
|
|
1053
|
-
|
|
1014
|
+
), Oe = (t, e) => (t.callBack = e, Ce(t)), Be = (t) => D({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${t.class}` }, [
|
|
1015
|
+
p({ class: "flex flex-auto flex-row", map: [t.options, (e) => Oe(e, t.callBack)] })
|
|
1054
1016
|
]);
|
|
1055
|
-
class
|
|
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);
|
|
1017
|
+
class et extends u {
|
|
1018
|
+
/**
|
|
1019
|
+
* This will declare the props for the compiler.
|
|
1020
|
+
*
|
|
1021
|
+
* @returns {void}
|
|
1022
|
+
*/
|
|
1023
|
+
declareProps() {
|
|
1024
|
+
this.options = [], this.class = "", this.callBack = null;
|
|
1075
1025
|
}
|
|
1076
1026
|
/**
|
|
1077
1027
|
* This will render the component.
|
|
@@ -1079,14 +1029,14 @@ class at extends h {
|
|
|
1079
1029
|
* @returns {object}
|
|
1080
1030
|
*/
|
|
1081
1031
|
render() {
|
|
1082
|
-
const
|
|
1032
|
+
const e = this.select.bind(this);
|
|
1083
1033
|
return o({ class: "" }, [
|
|
1084
|
-
|
|
1034
|
+
Be({
|
|
1085
1035
|
class: this.class,
|
|
1086
1036
|
options: this.options,
|
|
1087
|
-
callBack:
|
|
1037
|
+
callBack: e
|
|
1088
1038
|
}),
|
|
1089
|
-
|
|
1039
|
+
B({
|
|
1090
1040
|
class: "tab-content",
|
|
1091
1041
|
onState: ["selected", this.updateContent.bind(this)]
|
|
1092
1042
|
})
|
|
@@ -1098,8 +1048,8 @@ class at extends h {
|
|
|
1098
1048
|
* @returns {*}
|
|
1099
1049
|
*/
|
|
1100
1050
|
getFirstValue() {
|
|
1101
|
-
var
|
|
1102
|
-
return (
|
|
1051
|
+
var e;
|
|
1052
|
+
return (e = this.options[0]) == null ? void 0 : e.value;
|
|
1103
1053
|
}
|
|
1104
1054
|
/**
|
|
1105
1055
|
* This will update the component.
|
|
@@ -1107,8 +1057,8 @@ class at extends h {
|
|
|
1107
1057
|
* @returns {void}
|
|
1108
1058
|
*/
|
|
1109
1059
|
update() {
|
|
1110
|
-
const
|
|
1111
|
-
this.select(null), this.select(
|
|
1060
|
+
const e = this.state.get("selected");
|
|
1061
|
+
this.select(null), this.select(e);
|
|
1112
1062
|
}
|
|
1113
1063
|
/**
|
|
1114
1064
|
* This will select a value.
|
|
@@ -1116,8 +1066,8 @@ class at extends h {
|
|
|
1116
1066
|
* @param {*} value
|
|
1117
1067
|
* @returns {void}
|
|
1118
1068
|
*/
|
|
1119
|
-
select(
|
|
1120
|
-
this.state.selected =
|
|
1069
|
+
select(e) {
|
|
1070
|
+
this.state.selected = e;
|
|
1121
1071
|
}
|
|
1122
1072
|
/**
|
|
1123
1073
|
* This will update the content.
|
|
@@ -1125,15 +1075,15 @@ class at extends h {
|
|
|
1125
1075
|
* @param {*} value
|
|
1126
1076
|
* @returns {object}
|
|
1127
1077
|
*/
|
|
1128
|
-
updateContent(
|
|
1129
|
-
const
|
|
1130
|
-
if (!
|
|
1078
|
+
updateContent(e) {
|
|
1079
|
+
const s = this.options;
|
|
1080
|
+
if (!s || s.length < 1)
|
|
1131
1081
|
return;
|
|
1132
|
-
const
|
|
1133
|
-
for (const
|
|
1134
|
-
if (
|
|
1135
|
-
return
|
|
1136
|
-
return
|
|
1082
|
+
const n = s[0];
|
|
1083
|
+
for (const a of s)
|
|
1084
|
+
if (a.value === e)
|
|
1085
|
+
return a.layout;
|
|
1086
|
+
return n.layout;
|
|
1137
1087
|
}
|
|
1138
1088
|
/**
|
|
1139
1089
|
* This will setup the states.
|
|
@@ -1141,53 +1091,41 @@ class at extends h {
|
|
|
1141
1091
|
* @returns {object}
|
|
1142
1092
|
*/
|
|
1143
1093
|
setupStates() {
|
|
1144
|
-
const
|
|
1094
|
+
const e = this.callBack, s = typeof e;
|
|
1145
1095
|
return {
|
|
1146
1096
|
selected: {
|
|
1147
1097
|
state: this.getFirstValue(),
|
|
1148
|
-
callBack(
|
|
1149
|
-
|
|
1098
|
+
callBack(n) {
|
|
1099
|
+
s === "function" && e(n);
|
|
1150
1100
|
}
|
|
1151
1101
|
}
|
|
1152
1102
|
};
|
|
1153
1103
|
}
|
|
1154
1104
|
}
|
|
1155
|
-
const
|
|
1105
|
+
const Ie = (t) => v(
|
|
1156
1106
|
{
|
|
1157
1107
|
class: "inline-flex flex-auto items-center justify-center whitespace-nowrap rounded-sm text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm",
|
|
1158
|
-
dataSet: ["selected", ["state",
|
|
1108
|
+
dataSet: ["selected", ["state", t.value, "active"]]
|
|
1159
1109
|
},
|
|
1160
1110
|
[
|
|
1161
|
-
|
|
1111
|
+
w({
|
|
1162
1112
|
class: "flex flex-auto justify-center items-center px-3 py-1.5 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1163
|
-
onSet: ["selected", { selected:
|
|
1164
|
-
click: (
|
|
1165
|
-
disabled:
|
|
1166
|
-
},
|
|
1113
|
+
onSet: ["selected", { selected: t.value }],
|
|
1114
|
+
click: (e) => t.callBack(t.value),
|
|
1115
|
+
disabled: t.disabled
|
|
1116
|
+
}, t.label)
|
|
1167
1117
|
]
|
|
1168
|
-
),
|
|
1169
|
-
|
|
1118
|
+
), Me = (t, e) => (t.callBack = e, Ie(t)), Re = (t) => D({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${t.class}` }, [
|
|
1119
|
+
p({ class: "flex flex-auto flex-row", map: [t.options, (e) => Me(e, t.callBack)] })
|
|
1170
1120
|
]);
|
|
1171
|
-
class
|
|
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);
|
|
1121
|
+
class tt extends u {
|
|
1122
|
+
/**
|
|
1123
|
+
* This will declare the props for the compiler.
|
|
1124
|
+
*
|
|
1125
|
+
* @returns {void}
|
|
1126
|
+
*/
|
|
1127
|
+
declareProps() {
|
|
1128
|
+
this.options = [], this.class = "", this.onSelect = null;
|
|
1191
1129
|
}
|
|
1192
1130
|
/**
|
|
1193
1131
|
* This will render the component.
|
|
@@ -1195,11 +1133,11 @@ class it extends h {
|
|
|
1195
1133
|
* @returns {object}
|
|
1196
1134
|
*/
|
|
1197
1135
|
render() {
|
|
1198
|
-
const
|
|
1199
|
-
return
|
|
1136
|
+
const e = this.select.bind(this);
|
|
1137
|
+
return Re({
|
|
1200
1138
|
class: this.class,
|
|
1201
1139
|
options: this.options,
|
|
1202
|
-
callBack:
|
|
1140
|
+
callBack: e
|
|
1203
1141
|
});
|
|
1204
1142
|
}
|
|
1205
1143
|
/**
|
|
@@ -1208,8 +1146,8 @@ class it extends h {
|
|
|
1208
1146
|
* @param {*} value
|
|
1209
1147
|
* @returns {void}
|
|
1210
1148
|
*/
|
|
1211
|
-
select(
|
|
1212
|
-
this.state.selected =
|
|
1149
|
+
select(e) {
|
|
1150
|
+
this.state.selected = e, typeof this.onSelect == "function" && this.onSelect(e, this.parent);
|
|
1213
1151
|
}
|
|
1214
1152
|
/**
|
|
1215
1153
|
* This will setup the states.
|
|
@@ -1217,42 +1155,30 @@ class it extends h {
|
|
|
1217
1155
|
* @returns {object}
|
|
1218
1156
|
*/
|
|
1219
1157
|
setupStates() {
|
|
1220
|
-
var
|
|
1158
|
+
var e;
|
|
1221
1159
|
return {
|
|
1222
|
-
selected: ((
|
|
1160
|
+
selected: ((e = this.options[0]) == null ? void 0 : e.value) || null
|
|
1223
1161
|
};
|
|
1224
1162
|
}
|
|
1225
1163
|
}
|
|
1226
|
-
const
|
|
1227
|
-
const
|
|
1228
|
-
return
|
|
1229
|
-
},
|
|
1230
|
-
text:
|
|
1231
|
-
href:
|
|
1232
|
-
exact:
|
|
1164
|
+
const Te = (t, e) => new RegExp(`${t}($|/|\\.).*`).test(e), Ne = (t, e) => {
|
|
1165
|
+
const s = t.getLinkPath();
|
|
1166
|
+
return t.exact ? e === s : Te(s, e);
|
|
1167
|
+
}, We = ({ text: t, href: e, exact: s }) => new M({
|
|
1168
|
+
text: t,
|
|
1169
|
+
href: e,
|
|
1170
|
+
exact: s,
|
|
1233
1171
|
dataSet: ["selected", ["state", !0, "active"]],
|
|
1234
1172
|
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
1173
|
});
|
|
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);
|
|
1174
|
+
class $e extends u {
|
|
1175
|
+
/**
|
|
1176
|
+
* This will declare the props for the compiler.
|
|
1177
|
+
*
|
|
1178
|
+
* @returns {void}
|
|
1179
|
+
*/
|
|
1180
|
+
declareProps() {
|
|
1181
|
+
this.options = [], this.class = "", this.onSelect = null;
|
|
1256
1182
|
}
|
|
1257
1183
|
/**
|
|
1258
1184
|
* This will configure the links.
|
|
@@ -1266,12 +1192,12 @@ class Pe extends h {
|
|
|
1266
1192
|
* @returns {object}
|
|
1267
1193
|
*/
|
|
1268
1194
|
render() {
|
|
1269
|
-
return
|
|
1270
|
-
|
|
1195
|
+
return D({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${this.class}` }, [
|
|
1196
|
+
p({
|
|
1271
1197
|
class: "flex flex-auto flex-row",
|
|
1272
|
-
map: [this.options, (
|
|
1198
|
+
map: [this.options, (e) => this.addLink(e)],
|
|
1273
1199
|
watch: {
|
|
1274
|
-
value: ["[[path]]",
|
|
1200
|
+
value: ["[[path]]", b.data],
|
|
1275
1201
|
callBack: this.updateLinks.bind(this)
|
|
1276
1202
|
}
|
|
1277
1203
|
})
|
|
@@ -1283,8 +1209,8 @@ class Pe extends h {
|
|
|
1283
1209
|
* @returns {void}
|
|
1284
1210
|
*/
|
|
1285
1211
|
afterSetup() {
|
|
1286
|
-
const
|
|
1287
|
-
this.updateLinks(
|
|
1212
|
+
const e = b.data.path;
|
|
1213
|
+
this.updateLinks(e);
|
|
1288
1214
|
}
|
|
1289
1215
|
/**
|
|
1290
1216
|
* This will update the links.
|
|
@@ -1292,15 +1218,15 @@ class Pe extends h {
|
|
|
1292
1218
|
* @param {string} value
|
|
1293
1219
|
* @returns {void}
|
|
1294
1220
|
*/
|
|
1295
|
-
updateLinks(
|
|
1296
|
-
let
|
|
1221
|
+
updateLinks(e) {
|
|
1222
|
+
let s = !1, n = this.links[0];
|
|
1297
1223
|
this.deactivateAllLinks();
|
|
1298
|
-
for (const
|
|
1299
|
-
if (
|
|
1300
|
-
this.updateLink(
|
|
1224
|
+
for (const a of this.links)
|
|
1225
|
+
if (a.rendered !== !1 && (s = Ne(a, e), s === !0)) {
|
|
1226
|
+
this.updateLink(a, !0);
|
|
1301
1227
|
break;
|
|
1302
1228
|
}
|
|
1303
|
-
|
|
1229
|
+
s !== !0 && n && this.updateLink(n, !0);
|
|
1304
1230
|
}
|
|
1305
1231
|
/**
|
|
1306
1232
|
* This will deactivate all links.
|
|
@@ -1308,8 +1234,8 @@ class Pe extends h {
|
|
|
1308
1234
|
* @returns {void}
|
|
1309
1235
|
*/
|
|
1310
1236
|
deactivateAllLinks() {
|
|
1311
|
-
for (const
|
|
1312
|
-
this.updateLink(
|
|
1237
|
+
for (const e of this.links)
|
|
1238
|
+
this.updateLink(e, !1);
|
|
1313
1239
|
}
|
|
1314
1240
|
/**
|
|
1315
1241
|
* This will update the link.
|
|
@@ -1318,8 +1244,8 @@ class Pe extends h {
|
|
|
1318
1244
|
* @param {boolean} selected
|
|
1319
1245
|
* @returns {void}
|
|
1320
1246
|
*/
|
|
1321
|
-
updateLink(
|
|
1322
|
-
|
|
1247
|
+
updateLink(e, s) {
|
|
1248
|
+
e.update(s);
|
|
1323
1249
|
}
|
|
1324
1250
|
/**
|
|
1325
1251
|
* This will add a link.
|
|
@@ -1327,9 +1253,9 @@ class Pe extends h {
|
|
|
1327
1253
|
* @param {object} option
|
|
1328
1254
|
* @returns {object}
|
|
1329
1255
|
*/
|
|
1330
|
-
addLink({ label:
|
|
1331
|
-
const
|
|
1332
|
-
return this.links.push(
|
|
1256
|
+
addLink({ label: e, href: s, exact: n }) {
|
|
1257
|
+
const a = We({ text: e, href: s, exact: n });
|
|
1258
|
+
return this.links.push(a), a;
|
|
1333
1259
|
}
|
|
1334
1260
|
/**
|
|
1335
1261
|
* This will remove all the links.
|
|
@@ -1340,21 +1266,14 @@ class Pe extends h {
|
|
|
1340
1266
|
this.links = [];
|
|
1341
1267
|
}
|
|
1342
1268
|
}
|
|
1343
|
-
class
|
|
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", "");
|
|
1269
|
+
class st extends u {
|
|
1270
|
+
/**
|
|
1271
|
+
* This will declare the props for the compiler.
|
|
1272
|
+
*
|
|
1273
|
+
* @returns {void}
|
|
1274
|
+
*/
|
|
1275
|
+
declareProps() {
|
|
1276
|
+
this.options = [], this.class = "";
|
|
1358
1277
|
}
|
|
1359
1278
|
/**
|
|
1360
1279
|
* This will render the component.
|
|
@@ -1363,11 +1282,11 @@ class ot extends h {
|
|
|
1363
1282
|
*/
|
|
1364
1283
|
render() {
|
|
1365
1284
|
return o({ class: "tab-panel" }, [
|
|
1366
|
-
new
|
|
1285
|
+
new $e({
|
|
1367
1286
|
class: this.class,
|
|
1368
1287
|
options: this.options
|
|
1369
1288
|
}),
|
|
1370
|
-
|
|
1289
|
+
B({
|
|
1371
1290
|
class: "tab-content",
|
|
1372
1291
|
switch: this.addGroup()
|
|
1373
1292
|
})
|
|
@@ -1379,47 +1298,47 @@ class ot extends h {
|
|
|
1379
1298
|
* @returns {array}
|
|
1380
1299
|
*/
|
|
1381
1300
|
addGroup() {
|
|
1382
|
-
let
|
|
1383
|
-
const
|
|
1384
|
-
for (let
|
|
1385
|
-
|
|
1301
|
+
let e;
|
|
1302
|
+
const s = [], n = this.options;
|
|
1303
|
+
for (let a = 0, i = n.length; a < i; a++)
|
|
1304
|
+
e = n[a], s.push(
|
|
1386
1305
|
{
|
|
1387
|
-
uri:
|
|
1388
|
-
component:
|
|
1389
|
-
title:
|
|
1306
|
+
uri: e.uri || e.href,
|
|
1307
|
+
component: e.component,
|
|
1308
|
+
title: e.title || null,
|
|
1390
1309
|
persist: !0
|
|
1391
1310
|
}
|
|
1392
1311
|
);
|
|
1393
|
-
return
|
|
1312
|
+
return s;
|
|
1394
1313
|
}
|
|
1395
1314
|
}
|
|
1396
1315
|
export {
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1316
|
+
qe as B,
|
|
1317
|
+
le as C,
|
|
1318
|
+
de as D,
|
|
1319
|
+
re as H,
|
|
1320
|
+
Xe as I,
|
|
1321
|
+
Ve as N,
|
|
1322
|
+
N as O,
|
|
1323
|
+
Ee as P,
|
|
1324
|
+
Ze as S,
|
|
1325
|
+
ce as T,
|
|
1326
|
+
xe as U,
|
|
1327
|
+
Ke as W,
|
|
1328
|
+
te as a,
|
|
1329
|
+
L as b,
|
|
1330
|
+
Z as c,
|
|
1331
|
+
Qe as d,
|
|
1332
|
+
He as e,
|
|
1333
|
+
ne as f,
|
|
1334
|
+
ee as g,
|
|
1335
|
+
ie as h,
|
|
1336
|
+
oe as i,
|
|
1337
|
+
_e as j,
|
|
1338
|
+
Ge as k,
|
|
1339
|
+
Je as l,
|
|
1340
|
+
et as m,
|
|
1341
|
+
tt as n,
|
|
1342
|
+
$e as o,
|
|
1343
|
+
st as p
|
|
1425
1344
|
};
|