@base-framework/ui 1.0.66 → 1.0.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -5,7 +5,7 @@ import { V as w, a as U } from "./veil-D4dRxILB.js";
5
5
  import { Icons as R } from "./icons.es.js";
6
6
  import { A as G, B as V, C as j, z as q, u as z, v as J, w as _, D as K, j as Q, k as X, G as Y, E as Z, s as $, c as aa, a as sa, b as ea, i as oa, g as ta, e as ra, h as na, F as ia, d as la, f as pa, t as ua, M as ma, l as da, N as ga, P as Ta, p as ca, q as Ca, S as ba, n as Da, o as Sa, T as Ia, x as Ba, y as Pa, m as Fa, r as Ma } from "./confirmation-DgARq0AK.js";
7
7
  import { A as Na, b as va, C as fa, D as xa, a as ha, F as ya, M as Wa, P as La, c as Aa, g as Ha, p as wa } from "./calendar-BDqm833e.js";
8
- import { B as Oa, n as Ra, C as Ea, j as Ga, D as Va, l as ja, H as qa, I as za, N as Ja, O as _a, P as Ka, S as Qa, m as Xa, r as Ya, q as Za, o as $a, p as as, T as ss, k as es, U as os, W as ts, f as rs, h as ns, i as is, c as ls, d as ps, b as us, e as ms, a as ds, g as gs } from "./signature-panel-BCsAYjDW.js";
8
+ import { B as Oa, n as Ra, C as Ea, j as Ga, D as Va, l as ja, H as qa, I as za, N as Ja, O as _a, P as Ka, S as Qa, m as Xa, r as Ya, q as Za, o as $a, p as as, T as ss, k as es, U as os, W as ts, f as rs, h as ns, i as is, c as ls, d as ps, b as us, e as ms, a as ds, g as gs } from "./signature-panel-BeiIudPS.js";
9
9
  import { B as cs, I as Cs, M as bs, d as Ds, e as Ss, g as Is, N as Bs, b as Ps, a as Fs, f as Ms, P as ks, c as Ns, S as vs, T as fs } from "./mobile-nav-wrapper-BE_hr65B.js";
10
10
  import { B as hs, a as ys, C as Ws, F as Ls, b as As, c as Hs, M as ws, P as Us, S as Os } from "./sidebar-menu-page-nCAVFk3R.js";
11
11
  import { A as Es, F as Gs, M as Vs, a as js, T as qs } from "./aside-template-McEj_Gxc.js";
@@ -1,4 +1,4 @@
1
- import { B as s, n as o, C as t, j as r, D as l, l as n, H as i, I as b, N as d, O as v, P as g, S as p, m as u, r as N, q as k, o as D, p as C, T, k as c, U as M, W as B, f as m, h as y, i as W, c as h, d as H, b as P, e as S, a as f, g as x } from "./signature-panel-BCsAYjDW.js";
1
+ import { B as s, n as o, C as t, j as r, D as l, l as n, H as i, I as b, N as d, O as v, P as g, S as p, m as u, r as N, q as k, o as D, p as C, T, k as c, U as M, W as B, f as m, h as y, i as W, c as h, d as H, b as P, e as S, a as f, g as x } from "./signature-panel-BeiIudPS.js";
2
2
  import { b as L, C as O, D as F, a as U, F as G, M as j, c as q, p as w } from "./calendar-BDqm833e.js";
3
3
  import { B as A, I as E, M as J, d as K, e as Q, g as R, N as V, b as X, a as Y, f as Z, P as _, c as $, S as aa, T as ea } from "./mobile-nav-wrapper-BE_hr65B.js";
4
4
  export {
@@ -1,16 +1,16 @@
1
1
  import { Button as y, Div as o, On as E, Span as v, Th as P, UseParent as H, I as Q, Thead as X, Tr as q, Table as R, P as m, Li as D, Time as K, Nav as S, Ul as b, Section as O, Canvas as G } from "@base-framework/atoms";
2
- import { Atom as h, Component as u, Data as L, DateTime as V, Jot as M, router as x, NavLink as z, DataTracker as N, base as B, Dom as I } from "@base-framework/base";
2
+ import { Atom as d, Component as u, Data as L, DateTime as V, Jot as M, router as x, NavLink as z, DataTracker as N, base as I, Dom as B } from "@base-framework/base";
3
3
  import { B as C, I as $ } from "./buttons-CVEwmPAi.js";
4
4
  import { Icons as w } from "./icons.es.js";
5
5
  import { TableBody as _, ScrollableTableBody as J, List as Z, IntervalTimer as ee } from "@base-framework/organisms";
6
6
  import { C as te, I as se, H as ae } from "./inputs-DmJuUwS9.js";
7
7
  import { A as ne, P as ie } from "./calendar-BDqm833e.js";
8
- h((t, e) => ({
8
+ d((t, e) => ({
9
9
  class: "flex items-center px-4 py-2",
10
10
  ...t,
11
11
  children: e
12
12
  }));
13
- h(({ value: t, label: e }) => y({
13
+ d(({ value: t, label: e }) => y({
14
14
  class: "inline-flex flex-auto items-center justify-center whitespace-nowrap rounded-md px-8 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
15
15
  onState: ["performance", { active: t }],
16
16
  dataSet: ["performance", ["state", t, "active"]],
@@ -67,8 +67,8 @@ const oe = (t) => {
67
67
  const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(), n = [];
68
68
  let i = [];
69
69
  for (let l = 1 - s; l <= a; l++) {
70
- const d = new Date(t, e, l);
71
- i.push(l > 0 ? d : null), (i.length === 7 || l === a) && (n.push([...i]), i = []);
70
+ const h = new Date(t, e, l);
71
+ i.push(l > 0 ? h : null), (i.length === 7 || l === a) && (n.push([...i]), i = []);
72
72
  }
73
73
  return n;
74
74
  }, et = (t, e) => {
@@ -93,7 +93,7 @@ const oe = (t) => {
93
93
  click: () => n(a, s)
94
94
  });
95
95
  }, ue = (t, e) => {
96
- const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(), n = re(t, e, s), i = Array.from({ length: a }, (r, p) => new Date(t, e, p + 1)), l = (n.length + i.length) % 7, d = l === 0 ? 0 : 7 - l, c = ce(t, e, d), f = [...n, ...i, ...c], g = [];
96
+ const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(), n = re(t, e, s), i = Array.from({ length: a }, (r, p) => new Date(t, e, p + 1)), l = (n.length + i.length) % 7, h = l === 0 ? 0 : 7 - l, c = ce(t, e, h), f = [...n, ...i, ...c], g = [];
97
97
  for (let r = 0; r < f.length; r += 7) {
98
98
  const p = f.slice(r, r + 7), k = p.find((F) => F) || new Date(t, e, 1), { weekNumber: U, year: Y } = le(k);
99
99
  g.push({
@@ -104,7 +104,7 @@ const oe = (t) => {
104
104
  }
105
105
  return g;
106
106
  }, fe = ({ selectWeek: t }) => E("month", (e, s, { data: a }) => {
107
- const { year: n, month: i, currentDate: l } = a, d = ue(n, i);
107
+ const { year: n, month: i, currentDate: l } = a, h = ue(n, i);
108
108
  return o(
109
109
  { class: "grid grid-cols-8 gap-1 text-sm px-4 py-2" },
110
110
  [
@@ -119,7 +119,7 @@ const oe = (t) => {
119
119
  )
120
120
  ),
121
121
  // Render each "week" row
122
- ...d.map(
122
+ ...h.map(
123
123
  ({ weekNumber: c, days: f, year: g }) => o({
124
124
  class: "grid grid-cols-8 col-span-8 items-center ring-primary rounded-sm px-1",
125
125
  onSet: ["currentWeek", {
@@ -324,7 +324,7 @@ const pe = (t, e) => {
324
324
  })]
325
325
  })
326
326
  ]), be = ({ key: t, rows: e, selectRow: s, rowItem: a }) => new _({
327
- cache: "table",
327
+ cache: "list",
328
328
  key: t,
329
329
  items: e,
330
330
  rowItem: (n) => a(n, s),
@@ -348,7 +348,7 @@ const pe = (t, e) => {
348
348
  * @returns {boolean}
349
349
  */
350
350
  toggleAllSelectedRows() {
351
- const t = this.table.getRows(), e = this.data.selectedRows.length === t.length, s = e ? [] : t;
351
+ const t = this.list.getRows(), e = this.data.selectedRows.length === t.length, s = e ? [] : t;
352
352
  return this.data.selectedRows = s, this.updateSelected(), this.updateTable(!e), e;
353
353
  },
354
354
  /**
@@ -376,8 +376,8 @@ const pe = (t, e) => {
376
376
  * @returns {void}
377
377
  */
378
378
  updateTable(t) {
379
- const e = this.table.getRows();
380
- e.forEach((s) => s.selected = t), this.table.setRows(e);
379
+ const e = this.list.getRows();
380
+ e.forEach((s) => s.selected = t), this.list.setRows(e);
381
381
  },
382
382
  /**
383
383
  * Handles row selection.
@@ -425,7 +425,7 @@ const pe = (t, e) => {
425
425
  * @returns {void}
426
426
  */
427
427
  remove(t) {
428
- this.table.remove(t);
428
+ this.list.remove(t);
429
429
  },
430
430
  /**
431
431
  * This will set the items in the list.
@@ -435,7 +435,7 @@ const pe = (t, e) => {
435
435
  * @returns {void}
436
436
  */
437
437
  setRows(t) {
438
- this.table.setRows(t);
438
+ this.list.setRows(t);
439
439
  },
440
440
  /**
441
441
  * This will append items to the list.
@@ -445,7 +445,7 @@ const pe = (t, e) => {
445
445
  * @returns {void}
446
446
  */
447
447
  append(t) {
448
- this.table.append(t);
448
+ this.list.append(t);
449
449
  },
450
450
  /**
451
451
  * This will mingle the new items with the old items.
@@ -456,7 +456,7 @@ const pe = (t, e) => {
456
456
  * @returns {void}
457
457
  */
458
458
  mingle(t, e = !1) {
459
- this.table.mingle(t, e);
459
+ this.list.mingle(t, e);
460
460
  },
461
461
  /**
462
462
  * This will prepend items to the list.
@@ -466,7 +466,7 @@ const pe = (t, e) => {
466
466
  * @returns {void}
467
467
  */
468
468
  prepend(t) {
469
- this.table.prepend(t);
469
+ this.list.prepend(t);
470
470
  },
471
471
  /**
472
472
  * This will remove the selected rows.
@@ -477,37 +477,51 @@ const pe = (t, e) => {
477
477
  this.data.selectedRows = [];
478
478
  }
479
479
  }
480
- );
481
- class st extends ke {
482
- /**
483
- * Renders the DataTable component.
484
- *
485
- * @returns {object}
486
- */
487
- render() {
488
- const e = this.rows, s = this.border !== !1 ? "border" : "";
489
- return o({ class: "w-full" }, [
490
- o({ class: `w-full rounded-md ${s} overflow-x-auto` }, [
491
- R({ class: "w-full" }, [
492
- // @ts-ignore
493
- this.headers && j({ headers: this.headers, sort: (a) => this.sortRows(a) }),
494
- // @ts-ignore
495
- this.customHeader ?? null,
496
- J({
497
- // @ts-ignore
498
- key: this.key,
499
- rows: e,
500
- // @ts-ignore
501
- selectRow: this.selectRow.bind(this),
502
- // @ts-ignore
503
- rowItem: this.rowItem
504
- })
505
- ])
506
- ])
507
- ]);
508
- }
509
- }
510
- const xe = h(({ name: t, email: e }) => o({ class: "min-w-0 flex-auto" }, [
480
+ ), st = d((t) => {
481
+ new ke(
482
+ {
483
+ customHeaders: t.customHeaders,
484
+ headers: t.headers,
485
+ class: t.class,
486
+ key: t.key,
487
+ rows: t.rows,
488
+ rowItem: t.rowItem,
489
+ /**
490
+ * Renders the DataTable component.
491
+ *
492
+ * @returns {object}
493
+ */
494
+ render() {
495
+ const e = this.rows, s = this.border !== !1 ? "border" : "";
496
+ return o({ class: "w-full" }, [
497
+ o({ class: `w-full rounded-md ${s} overflow-x-auto` }, [
498
+ R({ class: "w-full" }, [
499
+ // @ts-ignore
500
+ this.headers && j({ headers: this.headers, sort: (a) => this.sortRows(a) }),
501
+ // @ts-ignore
502
+ this.customHeader ?? null,
503
+ J({
504
+ scrollContainer: t.scrollContainer,
505
+ loadMoreItems: t.loadMoreItems,
506
+ offset: t.offset,
507
+ limit: t.limit,
508
+ containerClass: t.containerClass ?? "",
509
+ data: t.data,
510
+ // @ts-ignore
511
+ key: this.key,
512
+ rows: e,
513
+ // @ts-ignore
514
+ selectRow: this.selectRow.bind(this),
515
+ // @ts-ignore
516
+ rowItem: this.rowItem
517
+ })
518
+ ])
519
+ ])
520
+ ]);
521
+ }
522
+ }
523
+ );
524
+ }), xe = d(({ name: t, email: e }) => o({ class: "min-w-0 flex-auto" }, [
511
525
  m({ class: "text-base font-semibold leading-6 m-0" }, t),
512
526
  m({ class: "truncate text-sm leading-5 text-muted-foreground m-0" }, e)
513
527
  ])), ye = () => o({ class: "flex items-center gap-x-1.5" }, [
@@ -518,10 +532,10 @@ const xe = h(({ name: t, email: e }) => o({ class: "min-w-0 flex-auto" }, [
518
532
  ]), ve = (t) => m({ class: "text-xs leading-5 text-muted-foreground" }, [
519
533
  v("Last seen "),
520
534
  K({ datetime: t }, "3h ago")
521
- ]), De = (t, e) => t === "online" ? ye() : ve(e), Se = h(({ role: t, lastSeen: e, status: s }) => o({ class: "hidden shrink-0 sm:flex sm:flex-col sm:items-end" }, [
535
+ ]), De = (t, e) => t === "online" ? ye() : ve(e), Se = d(({ role: t, lastSeen: e, status: s }) => o({ class: "hidden shrink-0 sm:flex sm:flex-col sm:items-end" }, [
522
536
  m({ class: "text-sm leading-6 m-0" }, t),
523
537
  De(s, e)
524
- ])), Le = (t) => t.split(" ").map((s) => s[0]).join(""), Ce = h((t) => D({ class: "fadeIn flex justify-between gap-x-6 py-4 px-4 rounded-md hover:bg-muted/50" }, [
538
+ ])), Le = (t) => t.split(" ").map((s) => s[0]).join(""), Ce = d((t) => D({ class: "fadeIn flex justify-between gap-x-6 py-4 px-4 rounded-md hover:bg-muted/50" }, [
525
539
  o({ class: "flex min-w-0 gap-x-4" }, [
526
540
  ne({ src: t.image, alt: t.name, fallbackText: Le(t.name) }),
527
541
  xe({ name: t.name, email: t.email })
@@ -531,14 +545,14 @@ const xe = h(({ name: t, email: e }) => o({ class: "min-w-0 flex-auto" }, [
531
545
  lastSeen: t.lastSeen,
532
546
  status: t.status
533
547
  })
534
- ])), at = h((t) => new Z({
548
+ ])), at = d((t) => new Z({
535
549
  cache: "list",
536
550
  key: "name",
537
551
  items: t.users,
538
552
  role: "list",
539
553
  class: "divide-y divide-border",
540
554
  rowItem: Ce
541
- })), Be = (t, e) => e.includes(t), Ie = (t, e, s) => t.exact ? s === e : Be(e, s), Te = ({ text: t, href: e, exact: s, hidden: a }) => new z({
555
+ })), Ie = (t, e) => e.includes(t), Be = (t, e, s) => t.exact ? s === e : Ie(e, s), Te = ({ text: t, href: e, exact: s, hidden: a }) => new z({
542
556
  text: t,
543
557
  href: e,
544
558
  exact: s,
@@ -601,7 +615,7 @@ class nt extends u {
601
615
  for (const a of this.links) {
602
616
  if (!a.rendered)
603
617
  continue;
604
- Ie(a, a.getLinkPath(), e) ? (this.updateLink(a, !0), s = !0) : this.updateLink(a, !1);
618
+ Be(a, a.getLinkPath(), e) ? (this.updateLink(a, !0), s = !0) : this.updateLink(a, !1);
605
619
  }
606
620
  !s && this.links[0] && this.updateLink(this.links[0], !0);
607
621
  }
@@ -643,7 +657,7 @@ class nt extends u {
643
657
  this.links = [];
644
658
  }
645
659
  }
646
- const it = h((t) => {
660
+ const it = d((t) => {
647
661
  const e = t.margin || "m-4 ml-0";
648
662
  return o({ class: `flex-none ${e}` }, [
649
663
  C({
@@ -882,7 +896,7 @@ class lt extends A {
882
896
  this.container = e, this.initialize();
883
897
  }
884
898
  }
885
- const We = h(({ index: t, click: e, state: s }, a) => D({
899
+ const We = d(({ index: t, click: e, state: s }, a) => D({
886
900
  class: "p-2 cursor-pointer hover:bg-muted/50",
887
901
  onState: [
888
902
  [s, "selectedIndex", {
@@ -891,10 +905,10 @@ const We = h(({ index: t, click: e, state: s }, a) => D({
891
905
  }]
892
906
  ],
893
907
  click: () => e(t)
894
- }, a)), Pe = h(({ selectOption: t, state: e }) => b({
908
+ }, a)), Pe = d(({ selectOption: t, state: e }) => b({
895
909
  class: "border rounded-md list-none m-0 p-0 max-h-[400px] overflow-y-auto",
896
910
  for: ["filteredOptions", (s, a) => We({ index: a, click: t, state: e }, s.label)]
897
- })), Re = h((t) => o({ class: "relative flex items-center" }, [
911
+ })), Re = d((t) => o({ class: "relative flex items-center" }, [
898
912
  se({
899
913
  cache: "input",
900
914
  placeholder: t.placeholder ?? "Search...",
@@ -1425,8 +1439,8 @@ class He extends u {
1425
1439
  s = f.clientX, a = f.clientY;
1426
1440
  } else
1427
1441
  s = e.x || e.clientX, a = e.y || e.clientY;
1428
- const d = parseInt((s - l.left) * i), c = parseInt((a - l.top) * i);
1429
- this.mouse.x = d, this.mouse.y = c;
1442
+ const h = parseInt((s - l.left) * i), c = parseInt((a - l.top) * i);
1443
+ this.mouse.x = h, this.mouse.y = c;
1430
1444
  }
1431
1445
  /**
1432
1446
  * Called when the pointer goes down on the canvas.
@@ -1469,8 +1483,8 @@ class He extends u {
1469
1483
  const { canvas: e, ctx: s } = this, a = e.toDataURL();
1470
1484
  if (this.scale(), this.setupBackground(s), a !== "data:,") {
1471
1485
  const n = new window.Image();
1472
- B.on("load", n, function i() {
1473
- s.drawImage(n, 0, 0), B.off("load", n, i);
1486
+ I.on("load", n, function i() {
1487
+ s.drawImage(n, 0, 0), I.off("load", n, i);
1474
1488
  }), n.src = a;
1475
1489
  }
1476
1490
  this.draw();
@@ -1490,7 +1504,7 @@ class He extends u {
1490
1504
  * @returns {void}
1491
1505
  */
1492
1506
  noScaleResize() {
1493
- const e = I.getSize(container);
1507
+ const e = B.getSize(container);
1494
1508
  this.width = canvas.width = e.width, this.height = canvas.height = e.height;
1495
1509
  }
1496
1510
  /**
@@ -1500,13 +1514,13 @@ class He extends u {
1500
1514
  * @returns {void}
1501
1515
  */
1502
1516
  scale() {
1503
- const e = this.canvas, s = this.container, a = I.getSize(s), n = this.targetSize, i = n.width, l = n.height;
1504
- let d = i + "px", c = l + "px";
1517
+ const e = this.canvas, s = this.container, a = B.getSize(s), n = this.targetSize, i = n.width, l = n.height;
1518
+ let h = i + "px", c = l + "px";
1505
1519
  if (this.width = e.width = i, this.height = e.height = l, a.width !== 0 && a.height !== 0) {
1506
1520
  const f = a.width, g = a.height, r = f / i, p = g / l, k = Math.min(r, p);
1507
- d = i * k + "px", c = l * k + "px";
1521
+ h = i * k + "px", c = l * k + "px";
1508
1522
  }
1509
- e.style.width = d, e.style.height = c;
1523
+ e.style.width = h, e.style.height = c;
1510
1524
  }
1511
1525
  /**
1512
1526
  * Main drawing loop. If the mouse is down, adds a line
@@ -1,20 +1,21 @@
1
- declare const ScrollableDataTable_base: typeof import("@base-framework/base").Component;
2
1
  /**
3
2
  * ScrollableDataTable Component
4
3
  *
5
- * Manages data, filtering, pagination, and selection within a table.
4
+ * This will create a scrollable data table.
6
5
  *
7
- * @param {object} props
6
+ * @property {HTMLElement} [props.scrollContainer] - The container element for scroll events. Defaults to window.
7
+ * @property {function} [props.loadMoreItems] - A function to fetch/generate additional items.
8
+ * @property {number} [props.offset] - The initial offset. Defaults to 0.
9
+ * @property {number} [props.limit] - Number of items to load per batch. Defaults to 20.
10
+ * @property {string} [props.class] - The class to add to the list.
11
+ * @property {string} [props.key] - The key to use to identify the items.
12
+ * @property {array} [props.rows] - The initial rows.
13
+ * @property {function} [props.rowItem] - The row item.
14
+ * @property {string} [props.containerClass] - The class to add to the scroll container.
8
15
  * @returns {object}
9
16
  */
10
- export class ScrollableDataTable extends ScrollableDataTable_base {
11
- /**
12
- * Renders the DataTable component.
13
- *
14
- * @returns {object}
15
- */
16
- render(): object;
17
- }
17
+ export const ScrollableDataTable: Function;
18
+ export default ScrollableDataTable;
18
19
  import { CheckboxCol } from './table-header.js';
19
20
  import { HeaderCol } from './table-header.js';
20
21
  import { TableHeader } from './table-header.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base-framework/ui",
3
- "version": "1.0.66",
3
+ "version": "1.0.68",
4
4
  "description": "This is a UI package that adds components and atoms that use Tailwind CSS and a theme based on Shadcn.",
5
5
  "main": "./dist/index.es.js",
6
6
  "scripts": {