@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.
@@ -1,31 +1,29 @@
1
- var z = Object.defineProperty;
2
- var Y = (e, s, t) => s in e ? z(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
3
- var l = (e, s, t) => Y(e, typeof s != "symbol" ? s + "" : s, t);
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 p, Li as D, Time as _, Nav as S, Ul as m, Section as I } from "@base-framework/atoms";
5
- import { Atom as u, Component as h, Data as L, DateTime as G, Jot as M, router as k, NavLink as R } from "@base-framework/base";
6
- import { B as T, I as N } from "./icon-B9QUT2NY.js";
7
- import { Icons as w } from "./icons.es.js";
8
- import { TableBody as V, List as q } from "@base-framework/organisms";
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
- ...e,
14
- children: s
10
+ ...t,
11
+ children: e
15
12
  }));
16
- u(({ value: e, label: s }) => y({
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: e }],
19
- dataSet: ["performance", ["state", e, "active"]],
20
- click: (t, { state: n }) => n.performance = e
21
- }, s));
22
- class _e extends h {
23
- constructor() {
24
- super(...arguments);
25
- /**
26
- * @member {string} class
27
- */
28
- l(this, "class", null);
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 te = (e) => {
40
- const s = new Date(e, 11, 31), t = new Date(e, 0, 1);
41
- return s.getDay() === 4 || // December 31 is a Thursday
42
- t.getDay() === 4;
43
- }, se = (e) => {
44
- const s = new Date(e.valueOf()), t = (s.getDay() + 6) % 7;
45
- s.setDate(s.getDate() - t + 3);
46
- const n = s.getFullYear(), a = new Date(n, 0, 4);
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((s - a) / 6048e5) + 1;
49
- return i > 52 && !te(n) ? {
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
- }, ne = (e, s, t) => {
57
- if (t === 0) return [];
58
- const n = new Date(e, s, 0).getDate();
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: t },
61
- (a, i) => new Date(e, s - 1, n - t + i + 1)
58
+ { length: s },
59
+ (a, i) => new Date(t, e - 1, n - s + i + 1)
62
60
  );
63
- }, ae = (e, s, t) => Array.from({ length: t }, (n, a) => new Date(e, s + 1, a + 1)), C = (e, s) => {
64
- const t = new Date(s, 0, 4), n = (t.getDay() + 6) % 7, a = new Date(t);
65
- a.setDate(t.getDate() - n);
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() + (e - 1) * 7), i;
68
- }, Ge = (e, s) => {
69
- const t = new Date(e, s, 1).getDay(), n = new Date(e, s + 1, 0).getDate(), a = [];
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 - t; r <= n; r++) {
72
- const f = new Date(e, s, r);
73
- i.push(r > 0 ? f : null), (i.length === 7 || r === n) && (a.push([...i]), i = []);
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
- }, Ve = (e, s) => {
77
- const t = new Date(e, s + 1, 0).getDate(), n = [];
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 <= t; i++)
80
- a.push(new Date(e, s, i)), a.length === 7 && (n.push(a), a = []);
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
- }, ie = (e, s, t) => {
80
+ }, se = (t, e, s) => {
83
81
  const n = /* @__PURE__ */ new Date();
84
- return n.getDate() === e && n.getMonth() === s && n.getFullYear() === t;
85
- }, oe = ({ day: e, month: s, year: t, weekNumber: n, selectWeek: a }) => {
86
- const i = ie(e, s, t);
87
- return y({
88
- text: e || "",
89
- disabled: !e,
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, t)
93
+ click: () => a(n, s)
96
94
  });
97
- }, le = (e, s) => {
98
- const t = new Date(e, s, 1).getDay(), n = new Date(e, s + 1, 0).getDate(), a = ne(e, s, t), i = Array.from({ length: n }, (c, b) => new Date(e, s, b + 1)), r = (a.length + i.length) % 7, f = r === 0 ? 0 : 7 - r, d = ae(e, s, f), g = [...a, ...i, ...d], x = [];
99
- for (let c = 0; c < g.length; c += 7) {
100
- const b = g.slice(c, c + 7), $ = b.find((P) => P) || new Date(e, s, 1), { weekNumber: A, year: j } = se($);
101
- x.push({
102
- weekNumber: A,
103
- year: j,
104
- days: b
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 x;
108
- }, re = ({ selectWeek: e }) => U("month", (s, t, { data: n }) => {
109
- const { year: a, month: i, currentDate: r } = n, f = le(a, i);
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
- (d) => v({ class: "px-1 py-1", text: d })
118
+ (c) => y({ class: "px-1 py-1", text: c })
121
119
  )
122
120
  ),
123
121
  // Render each "week" row
124
- ...f.map(
125
- ({ weekNumber: d, days: g, year: x }) => o({
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: d
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: () => e(d, x),
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": d,
138
- "bg-primary": d
135
+ "text-primary-foreground": c,
136
+ "bg-primary": c
139
137
  }],
140
- text: d ? `W${d}` : ""
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
- g.map(
146
- (c) => oe({
147
- year: (c == null ? void 0 : c.getFullYear()) || null,
148
- month: (c == null ? void 0 : c.getMonth()) || null,
149
- day: (c == null ? void 0 : c.getDate()) || null,
150
- week: g,
151
- weekNumber: d,
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: e
151
+ selectWeek: t
154
152
  })
155
153
  )
156
154
  )
@@ -158,51 +156,38 @@ const te = (e) => {
158
156
  )
159
157
  ]
160
158
  );
161
- }), O = ({ label: e, click: s }) => T(
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
- ${e === "Previous" ? "left-1" : "right-1"}
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: s,
170
- "aria-label": `${e} month`,
167
+ click: e,
168
+ "aria-label": `${t} month`,
171
169
  variant: "icon",
172
- icon: e === "Previous" ? w.chevron.single.left : w.chevron.single.right
170
+ icon: t === "Previous" ? k.chevron.single.left : k.chevron.single.right
173
171
  }
174
- ), ce = ({ next: e, previous: s }) => o({ class: "flex flex-auto min-h-12 text-sm font-medium relative justify-center items-center" }, [
175
- v("[[monthName]] [[year]]"),
176
- O({
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: s
176
+ click: e
179
177
  }),
180
- O({
178
+ C({
181
179
  label: "Next",
182
- click: e
180
+ click: t
183
181
  })
184
182
  ]);
185
- class qe extends h {
186
- constructor() {
187
- super(...arguments);
188
- /**
189
- * The selected date.
190
- * @member {string} selectedDate
191
- * @default null
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 t = /* @__PURE__ */ new Date(), n = this.selectedWeek || this.calculateCurrentWeek(t), a = C(n, t.getFullYear());
214
- return new L({
215
- monthName: this.getMonthName(a.getMonth()),
216
- year: a.getFullYear(),
217
- month: a.getMonth(),
218
- currentDate: a.getDate(),
219
- currentWeek: n
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(t) {
229
- const n = this.selectedDate ? new Date(this.selectedDate) : t;
230
- return new Date(n.getFullYear(), n.getMonth(), n.getDate());
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(t) {
239
- const n = new Date(t.valueOf()), a = (t.getDay() + 6) % 7;
240
- n.setDate(n.getDate() - a + 3);
241
- const i = n.valueOf();
242
- return n.setMonth(0, 1), n.getDay() !== 4 && n.setMonth(0, 1 + (4 - n.getDay() + 7) % 7), 1 + Math.ceil((i - n) / 6048e5);
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(t) {
251
- return G.monthNames[t];
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 t = this.data;
260
- let { year: n, month: a } = t;
261
- a === 0 ? (a = 11, n--) : a--, this.setDate(a, n);
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 t = this.data;
270
- let { year: n, month: a } = t;
271
- a === 11 ? (a = 0, n++) : a++, this.setDate(a, n);
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(t, n, a) {
266
+ setDate(e, s, n) {
282
267
  this.data.set({
283
- year: n,
284
- month: t,
285
- monthName: this.getMonthName(t)
286
- }), a && (this.data.currentDate = a);
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(t, n) {
295
- this.data.currentWeek = t;
296
- const a = C(t, n);
297
- this.setDate(a.getMonth(), a.getFullYear(), a.getDate()), typeof this.selectedCallBack == "function" && this.selectedCallBack(t);
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
- ce({
291
+ oe({
307
292
  next: () => this.goToNextMonth(),
308
293
  previous: () => this.goToPreviousMonth()
309
294
  }),
310
- re({
311
- selectWeek: (t, n) => this.selectWeek(t, n)
295
+ ie({
296
+ selectWeek: (e, s) => this.selectWeek(e, s)
312
297
  })
313
298
  ]);
314
299
  }
315
300
  }
316
- const de = (e) => B({ class: `cursor-pointer py-3 px-4 text-base w-10 ${e.class || ""}` }, [
317
- F((s) => new J({ class: "mr-2", onChange: () => s.toggleAllSelectedRows() }))
318
- ]), ue = ({ align: e, sortable: s, key: t, label: n, sort: a, class: i }) => {
319
- const r = e || "justify-start";
320
- return B({
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: s && (() => a(t))
307
+ click: e && (() => a(s))
323
308
  }, [
324
309
  o({ class: `flex flex-auto w-full items-center ${r}` }, [
325
- v(n),
326
- s && E({ class: "ml-2", html: w.arrows.upDown })
310
+ y(n),
311
+ e && Y({ class: "ml-2", html: k.arrows.upDown })
327
312
  ])
328
313
  ]);
329
- }, he = (e) => Q([
330
- H({
314
+ }, ce = (t) => U([
315
+ F({
331
316
  class: "text-muted-foreground border-b",
332
- map: [e.headers, (s) => s.label === "checkbox" ? de({ toggle: e.toggle }) : ue({
333
- align: s.align,
334
- sortable: s.sortable,
335
- key: s.key,
336
- label: s.label,
337
- sort: e.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
- ]), fe = ({ key: e, rows: s, selectRow: t, rowItem: n }) => new V({
325
+ ]), de = ({ key: t, rows: e, selectRow: s, rowItem: n }) => new K({
341
326
  cache: "table",
342
- key: e,
343
- items: s,
344
- rowItem: (a) => n(a, t),
327
+ key: t,
328
+ items: e,
329
+ rowItem: (a) => n(a, s),
345
330
  class: "divide-y divide-border"
346
- }), Je = M(
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 L({
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 e = this.table.getRows(), s = this.data.selectedRows.length === e.length, t = s ? [] : e;
366
- this.data.selectedRows = t, this.updateSelected(), this.updateTable(!s);
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 e = this.data.get("selectedRows");
375
- this.data.selected = e.length > 0;
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(e) {
393
- const s = this.table.getRows();
394
- s.forEach((t) => t.selected = e), this.table.setRows(s);
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(e) {
402
- const s = e.selected ?? !1;
403
- e.selected = !s;
404
- const t = this.data.get("selectedRows"), n = e.selected ? [...t, e] : t.filter((a) => a !== e);
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 e = this.rows, s = this.border !== !1 ? "border" : "";
398
+ const t = this.rows, e = this.border !== !1 ? "border" : "";
414
399
  return o({ class: "w-full" }, [
415
- o({ class: `w-full rounded-md ${s} overflow-x-auto` }, [
416
- K({ class: "w-full" }, [
400
+ o({ class: `w-full rounded-md ${e} overflow-x-auto` }, [
401
+ E({ class: "w-full" }, [
417
402
  // @ts-ignore
418
- this.headers && he({ headers: this.headers, sort: (t) => this.sortRows(t) }),
403
+ this.headers && ce({ headers: this.headers, sort: (s) => this.sortRows(s) }),
419
404
  // @ts-ignore
420
405
  this.customHeader ?? null,
421
- fe({
406
+ de({
422
407
  // @ts-ignore
423
408
  key: this.key,
424
- rows: e,
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(e) {
442
- this.table.remove(e);
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(e) {
452
- this.table.setRows(e);
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(e) {
462
- this.table.append(e);
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(e, s = !1) {
473
- this.table.mingle(e, s);
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(e) {
483
- this.table.prepend(e);
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
- ), ge = u(({ name: e, email: s }) => o({ class: "min-w-0 flex-auto" }, [
495
- p({ class: "text-base font-semibold leading-6 m-0" }, e),
496
- p({ class: "truncate text-sm leading-5 text-muted-foreground m-0" }, s)
497
- ])), pe = () => o({ class: "flex items-center gap-x-1.5" }, [
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
- p({ class: "text-xs leading-5 text-gray-500" }, "Online")
502
- ]), me = (e) => p({ class: "text-xs leading-5 text-muted-foreground" }, [
503
- v("Last seen "),
504
- _({ datetime: e }, "3h ago")
505
- ]), xe = (e, s) => e === "online" ? pe() : me(s), be = u(({ role: e, lastSeen: s, status: t }) => o({ class: "hidden shrink-0 sm:flex sm:flex-col sm:items-end" }, [
506
- p({ class: "text-sm leading-6 m-0" }, e),
507
- xe(t, s)
508
- ])), ke = (e) => e.split(" ").map((t) => t[0]).join(""), we = u((e) => D({ class: "fadeIn flex justify-between gap-x-6 py-4 px-4 rounded-md hover:bg-muted/50" }, [
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
- Z({ src: e.image, alt: e.name, fallbackText: ke(e.name) }),
511
- ge({ name: e.name, email: e.email })
495
+ q({ src: t.image, alt: t.name, fallbackText: me(t.name) }),
496
+ ue({ name: t.name, email: t.email })
512
497
  ]),
513
- be({
514
- role: e.role,
515
- lastSeen: e.lastSeen,
516
- status: e.status
498
+ pe({
499
+ role: t.role,
500
+ lastSeen: t.lastSeen,
501
+ status: t.status
517
502
  })
518
- ])), Xe = u((e) => new q({
503
+ ])), Ge = d((t) => new _({
519
504
  cache: "list",
520
505
  key: "name",
521
- items: e.users,
506
+ items: t.users,
522
507
  role: "list",
523
508
  class: "divide-y divide-border",
524
- rowItem: we
525
- })), ye = (e, s) => s.includes(e), ve = (e, s, t) => e.exact ? t === s : ye(s, t), De = ({ text: e, href: s, exact: t, hidden: n }) => new R({
526
- text: e,
527
- href: s,
528
- exact: t,
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 Ze extends h {
533
- constructor() {
534
- super(...arguments);
535
- /**
536
- * This will set the options.
537
- * @member {array} options
538
- * @default []
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 S(
538
+ return D(
561
539
  { class: `flex items-center justify-center p-2 text-muted-foreground rounded-md ${this.class || ""}` },
562
540
  [
563
- m({
541
+ p({
564
542
  class: "flex space-x-4",
565
- map: [this.options, (t) => this.addLink(t)],
543
+ map: [this.options, (e) => this.addLink(e)],
566
544
  watch: {
567
- value: ["[[path]]", k.data],
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 t = k.data.path;
581
- this.updateLinks(t);
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(t) {
590
- let n = !1;
567
+ updateLinks(e) {
568
+ let s = !1;
591
569
  this.deactivateAllLinks();
592
- for (const a of this.links) {
593
- if (!a.rendered)
570
+ for (const n of this.links) {
571
+ if (!n.rendered)
594
572
  continue;
595
- ve(a, a.getLinkPath(), t) ? (this.updateLink(a, !0), n = !0) : this.updateLink(a, !1);
573
+ ke(n, n.getLinkPath(), e) ? (this.updateLink(n, !0), s = !0) : this.updateLink(n, !1);
596
574
  }
597
- !n && this.links[0] && this.updateLink(this.links[0], !0);
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 t of this.links)
606
- this.updateLink(t, !1);
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(t, n) {
616
- t.update(n);
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: t, href: n, exact: a, hidden: i }) {
625
- const r = De({ text: t, href: n, exact: a, hidden: i });
626
- return this.links.push(r), r;
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 et = u((e) => {
638
- const s = e.margin || "m-4 ml-0";
639
- return o({ class: `flex-none ${s}` }, [
640
- T({
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
- e.backUrl && app.navigate(e.backUrl);
626
+ t.backUrl && app.navigate(t.backUrl);
649
627
  }
650
628
  }, [
651
- N(w.arrows.left)
629
+ T(k.arrows.left)
652
630
  ])
653
631
  ]);
654
632
  });
655
- class W extends h {
656
- constructor() {
657
- super(...arguments);
658
- /**
659
- * @member {string} class
660
- * @default ''
661
- */
662
- l(this, "class", "");
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(t) {
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 tt extends W {
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 t = this.container;
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", (n, a) => {
773
- n ? (a.className = this.getDockedClassName(), t.appendChild(a), document.documentElement.style.overflowY = "auto") : (a.className = this.getClassName(), app.root.appendChild(a), document.documentElement.style.overflowY = "hidden");
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(t) {
797
- this.container = t, this.initialize();
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 st extends W {
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(t) {
877
- this.container = t, this.initialize();
838
+ setup(e) {
839
+ this.container = e, this.initialize();
878
840
  }
879
841
  }
880
- const Se = u(({ index: e, click: s, state: t }, n) => D({
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
- [t, "selectedIndex", {
884
- "bg-accent": e,
885
- "text-white": e
845
+ [s, "selectedIndex", {
846
+ "bg-accent": t,
847
+ "text-white": t
886
848
  }]
887
849
  ],
888
- pointerdown: () => s(e)
889
- }, n)), Le = u(({ selectOption: e, state: s }) => m({
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", (t, n) => Se({ index: n, click: e, state: s }, t.label)]
892
- })), Ce = 100, Oe = u((e) => o({ class: "relative flex items-center" }, [
893
- X({
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: e.placeholder ?? "Search...",
896
- bind: [e.state, "searchQuery"],
897
- keyup: (s, t) => {
898
- t.state.open = !0, typeof e.filterOptions == "function" && e.filterOptions(), t.dropdown.updatePosition();
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: (s, t) => t.toggleDropdown(),
901
- blur: (s, { state: t }) => setTimeout(() => t.open = !1, Ce),
902
- keydown: (s) => typeof e.handleKeyDown == "function" && e.handleKeyDown(s)
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
- e.icon && o({ class: "absolute right-0 mr-2" }, [
905
- N(e.icon)
866
+ t.icon && o({ class: "absolute right-0 mr-2" }, [
867
+ T(t.icon)
906
868
  ])
907
- ])), Be = (e) => o({
869
+ ])), Le = (t) => o({
908
870
  class: "relative flex fle-auto flex-col",
909
- onState: ["open", (s, t, n) => {
910
- if (s)
911
- return new ee({
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
- Le(e)
879
+ ve(t)
918
880
  ]);
919
881
  }]
920
- }), nt = M(
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 e = this.options || [];
929
- return new L({
930
- options: e,
931
- filteredOptions: e
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 e = this.data.filteredOptions;
953
- let { searchQuery: s } = this.state;
954
- s = s.toLowerCase();
955
- const t = e.findIndex((n) => n.label.toLowerCase() === s);
956
- t >= 0 && (this.state.selectedIndex = t);
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 e = this.state.searchQuery.toLowerCase();
965
- if (e === "" || e.length === 0) {
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 s = this.data.get("options");
970
- this.data.filteredOptions = s.filter(
971
- (t) => t.label.toLowerCase().includes(e)
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: e } = this.state;
981
- return e < 0 ? null : this.data.get(`filteredOptions[${e}]`);
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(e) {
990
- this.state.selectedIndex = e;
991
- const s = this.data.get(`filteredOptions[${e}]`);
992
- this.state.searchQuery = s.label, this.state.open = !1, typeof this.onSelect == "function" && this.onSelect(s);
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(e) {
1007
- const s = this.data.filteredOptions, { selectedIndex: t } = this.state;
1008
- e.key === "ArrowDown" ? (e.preventDefault(), this.state.selectedIndex = Math.min(t + 1, s.length - 1)) : e.key === "ArrowUp" ? (e.preventDefault(), this.state.selectedIndex = Math.max(t - 1, 0)) : e.key === "Enter" && t >= 0 && (e.preventDefault(), this.selectOption(t));
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
- Oe({
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
- Be({
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
- ), Ie = (e) => D(
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", e.value, "active"]]
1005
+ dataSet: ["selected", ["state", t.value, "active"]]
1044
1006
  },
1045
1007
  [
1046
- y({
1008
+ w({
1047
1009
  class: "flex flex-auto justify-center items-center px-3 py-1.5",
1048
- onSet: ["selected", { selected: e.value }],
1049
- click: (s) => e.callBack(e.value)
1050
- }, e.label)
1010
+ onSet: ["selected", { selected: t.value }],
1011
+ click: (e) => t.callBack(t.value)
1012
+ }, t.label)
1051
1013
  ]
1052
- ), Me = (e, s) => (e.callBack = s, Ie(e)), Re = (e) => S({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${e.class}` }, [
1053
- m({ class: "flex flex-auto flex-row", map: [e.options, (s) => Me(s, e.callBack)] })
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 at extends h {
1056
- constructor() {
1057
- super(...arguments);
1058
- /**
1059
- * This will set the options.
1060
- * @member {array} options
1061
- * @default []
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 t = this.select.bind(this);
1032
+ const e = this.select.bind(this);
1083
1033
  return o({ class: "" }, [
1084
- Re({
1034
+ Be({
1085
1035
  class: this.class,
1086
1036
  options: this.options,
1087
- callBack: t
1037
+ callBack: e
1088
1038
  }),
1089
- I({
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 t;
1102
- return (t = this.options[0]) == null ? void 0 : t.value;
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 t = this.state.get("selected");
1111
- this.select(null), this.select(t);
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(t) {
1120
- this.state.selected = t;
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(t) {
1129
- const n = this.options;
1130
- if (!n || n.length < 1)
1078
+ updateContent(e) {
1079
+ const s = this.options;
1080
+ if (!s || s.length < 1)
1131
1081
  return;
1132
- const a = n[0];
1133
- for (const i of n)
1134
- if (i.value === t)
1135
- return i.layout;
1136
- return a.layout;
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 t = this.callBack, n = typeof t;
1094
+ const e = this.callBack, s = typeof e;
1145
1095
  return {
1146
1096
  selected: {
1147
1097
  state: this.getFirstValue(),
1148
- callBack(a) {
1149
- n === "function" && t(a);
1098
+ callBack(n) {
1099
+ s === "function" && e(n);
1150
1100
  }
1151
1101
  }
1152
1102
  };
1153
1103
  }
1154
1104
  }
1155
- const Te = (e) => D(
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", e.value, "active"]]
1108
+ dataSet: ["selected", ["state", t.value, "active"]]
1159
1109
  },
1160
1110
  [
1161
- y({
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: e.value }],
1164
- click: (s) => e.callBack(e.value),
1165
- disabled: e.disabled
1166
- }, e.label)
1113
+ onSet: ["selected", { selected: t.value }],
1114
+ click: (e) => t.callBack(t.value),
1115
+ disabled: t.disabled
1116
+ }, t.label)
1167
1117
  ]
1168
- ), Ne = (e, s) => (e.callBack = s, Te(e)), We = (e) => S({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${e.class}` }, [
1169
- m({ class: "flex flex-auto flex-row", map: [e.options, (s) => Ne(s, e.callBack)] })
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 it extends h {
1172
- constructor() {
1173
- super(...arguments);
1174
- /**
1175
- * This will set the options.
1176
- * @member {array} options
1177
- * @default []
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 t = this.select.bind(this);
1199
- return We({
1136
+ const e = this.select.bind(this);
1137
+ return Re({
1200
1138
  class: this.class,
1201
1139
  options: this.options,
1202
- callBack: t
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(t) {
1212
- this.state.selected = t, typeof this.onSelect == "function" && this.onSelect(t, this.parent);
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 t;
1158
+ var e;
1221
1159
  return {
1222
- selected: ((t = this.options[0]) == null ? void 0 : t.value) || null
1160
+ selected: ((e = this.options[0]) == null ? void 0 : e.value) || null
1223
1161
  };
1224
1162
  }
1225
1163
  }
1226
- const $e = (e, s) => new RegExp(`${e}($|/|\\.).*`).test(s), Ae = (e, s) => {
1227
- const t = e.getLinkPath();
1228
- return e.exact ? s === t : $e(t, s);
1229
- }, je = ({ text: e, href: s, exact: t }) => new R({
1230
- text: e,
1231
- href: s,
1232
- exact: t,
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 Pe extends h {
1237
- constructor() {
1238
- super(...arguments);
1239
- /**
1240
- * This will set the options.
1241
- * @member {array} options
1242
- * @default []
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 S({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${this.class}` }, [
1270
- m({
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, (t) => this.addLink(t)],
1198
+ map: [this.options, (e) => this.addLink(e)],
1273
1199
  watch: {
1274
- value: ["[[path]]", k.data],
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 t = k.data.path;
1287
- this.updateLinks(t);
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(t) {
1296
- let n = !1, a = this.links[0];
1221
+ updateLinks(e) {
1222
+ let s = !1, n = this.links[0];
1297
1223
  this.deactivateAllLinks();
1298
- for (const i of this.links)
1299
- if (i.rendered !== !1 && (n = Ae(i, t), n === !0)) {
1300
- this.updateLink(i, !0);
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
- n !== !0 && a && this.updateLink(a, !0);
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 t of this.links)
1312
- this.updateLink(t, !1);
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(t, n) {
1322
- t.update(n);
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: t, href: n, exact: a }) {
1331
- const i = je({ text: t, href: n, exact: a });
1332
- return this.links.push(i), i;
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 ot extends h {
1344
- constructor() {
1345
- super(...arguments);
1346
- /**
1347
- * This will set the options.
1348
- * @member {array} options
1349
- * @default []
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 Pe({
1285
+ new $e({
1367
1286
  class: this.class,
1368
1287
  options: this.options
1369
1288
  }),
1370
- I({
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 t;
1383
- const n = [], a = this.options;
1384
- for (let i = 0, r = a.length; i < r; i++)
1385
- t = a[i], n.push(
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: t.uri || t.href,
1388
- component: t.component,
1389
- title: t.title || null,
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 n;
1312
+ return s;
1394
1313
  }
1395
1314
  }
1396
1315
  export {
1397
- et as B,
1398
- de as C,
1399
- fe as D,
1400
- ue as H,
1401
- st as I,
1402
- Ze as N,
1403
- W as O,
1404
- _e as P,
1405
- nt as S,
1406
- he as T,
1407
- we as U,
1408
- qe as W,
1409
- ae as a,
1410
- C as b,
1411
- se as c,
1412
- Ge as d,
1413
- Ve as e,
1414
- oe as f,
1415
- ne as g,
1416
- re as h,
1417
- ce as i,
1418
- Je as j,
1419
- Xe as k,
1420
- tt as l,
1421
- at as m,
1422
- it as n,
1423
- Pe as o,
1424
- ot as p
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
  };