@base-framework/ui 1.0.280 → 1.0.282

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 { C as F, d as P, D as B, c as k, E as M, F as f, H as x, I as N, M as v,
5
5
  import { Icons as G } from "./icons.es.js";
6
6
  import { A as E, B as V, C as j, w as q, J, y as z, z as K, E as Q, G as _, D as X, m as Y, n as Z, O as $, K as aa, v as ea, c as sa, a as oa, b as ta, Q as ra, l as na, g as la, i as ia, h as pa, j as ma, e as ua, k as da, F as ga, d as Ca, f as ca, L as Ta, x as Da, M as Ia, o as ba, N as Sa, P as Fa, s as Pa, t as Ba, S as ka, q as Ma, r as fa, T as xa, H as Na, I as va, p as ya, u as ha } from "./empty-state-CPWpkmxa.js";
7
7
  import { A as Wa, b as Ha, C as Aa, D as Ra, a as wa, F as Ua, M as Ga, P as Oa, R as Ea, c as Va, g as ja, p as qa } from "./range-calendar-DW0cMOJy.js";
8
- import { B as za, p as Ka, C as Qa, j as _a, D as Xa, m as Ya, k as Za, H as $a, I as ae, N as ee, O as se, P as oe, S as te, n as re, o as ne, t as le, s as ie, q as pe, r as me, T as ue, l as de, U as ge, W as Ce, f as ce, h as Te, i as De, c as Ie, d as be, b as Se, e as Fe, a as Pe, g as Be } from "./signature-panel-fN7fYDwD.js";
8
+ import { B as za, p as Ka, C as Qa, j as _a, D as Xa, m as Ya, k as Za, H as $a, I as ae, N as ee, O as se, P as oe, S as te, n as re, o as ne, t as le, s as ie, q as pe, r as me, T as ue, l as de, U as ge, W as Ce, f as ce, h as Te, i as De, c as Ie, d as be, b as Se, e as Fe, a as Pe, g as Be } from "./signature-panel-BjP9rXkL.js";
9
9
  import { B as Me, I as fe, M as xe, d as Ne, e as ve, g as ye, N as he, b as Le, a as We, f as He, P as Ae, c as Re, S as we, T as Ue } from "./mobile-nav-wrapper-C7RyGC5a.js";
10
10
  import { B as Oe, a as Ee, C as Ve, F as je, b as qe, c as Je, M as ze, P as Ke, S as Qe } from "./sidebar-menu-page-BtUJdw-T.js";
11
11
  import { A as Xe, F as Ye, M as Ze, a as $e, T as as } from "./aside-template-McEj_Gxc.js";
@@ -1,4 +1,4 @@
1
- import { B as s, p as t, C as o, j as r, D as n, m as l, k as i, H as b, I as d, N as g, O as p, P as u, S as v, n as D, o as N, t as k, s as C, q as c, r as T, T as M, l as m, U as y, W as B, f as W, h, i as S, c as H, d as P, b as I, e as f, a as x, g as L } from "./signature-panel-fN7fYDwD.js";
1
+ import { B as s, p as t, C as o, j as r, D as n, m as l, k as i, H as b, I as d, N as g, O as p, P as u, S as v, n as D, o as N, t as k, s as C, q as c, r as T, T as M, l as m, U as y, W as B, f as W, h, i as S, c as H, d as P, b as I, e as f, a as x, g as L } from "./signature-panel-BjP9rXkL.js";
2
2
  import { b as F, C as U, D as G, a as R, F as j, M as q, R as w, c as z, p as A } from "./range-calendar-DW0cMOJy.js";
3
3
  import { B as J, I as K, M as Q, d as V, e as X, g as Y, N as Z, b as _, a as $, f as aa, P as ea, c as sa, S as ta, T as oa } from "./mobile-nav-wrapper-C7RyGC5a.js";
4
4
  export {
@@ -1,4 +1,4 @@
1
- import { Button as x, Div as o, On as v, Span as D, Th as O, UseParent as F, I as E, Thead as Q, Tr as X, Table as C, P as p, Li as S, Time as q, Nav as I, Ul as w, Section as z, Canvas as K } from "@base-framework/atoms";
1
+ import { Button as x, Div as o, On as v, Span as D, Th as O, UseParent as F, I as E, Thead as Q, Tr as X, Table as I, P as p, Li as S, Time as q, Nav as C, Ul as b, Section as z, Canvas as K } from "@base-framework/atoms";
2
2
  import { Atom as h, Component as u, Data as L, DateTime as G, router as y, NavLink as $, DataTracker as N, Jot as V, base as M, Dom as R } from "@base-framework/base";
3
3
  import { B as T, I as _ } from "./buttons-BKLL4I6r.js";
4
4
  import { Icons as k } from "./icons.es.js";
@@ -95,10 +95,10 @@ const re = (t) => {
95
95
  }, me = (t, e) => {
96
96
  const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(), i = de(t, e, s), n = Array.from({ length: a }, (r, g) => new Date(t, e, g + 1)), l = (i.length + n.length) % 7, d = l === 0 ? 0 : 7 - l, c = he(t, e, d), f = [...i, ...n, ...c], m = [];
97
97
  for (let r = 0; r < f.length; r += 7) {
98
- const g = f.slice(r, r + 7), b = g.find((H) => H) || new Date(t, e, 1), { weekNumber: U, year: Y } = ce(b);
98
+ const g = f.slice(r, r + 7), w = g.find((Y) => Y) || new Date(t, e, 1), { weekNumber: H, year: U } = ce(w);
99
99
  m.push({
100
- weekNumber: U,
101
- year: Y,
100
+ weekNumber: H,
101
+ year: U,
102
102
  days: g
103
103
  });
104
104
  }
@@ -296,11 +296,11 @@ class ot extends u {
296
296
  ]);
297
297
  }
298
298
  }
299
- const we = (t, e) => {
299
+ const be = (t, e) => {
300
300
  const s = t.toggleAllSelectedRows();
301
301
  e.state.checked = !s;
302
- }, be = (t) => O({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class || ""}` }, [
303
- F((e) => new ae({ class: "mr-2", onChange: (s, a) => we(e, a) }))
302
+ }, we = (t) => O({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class || ""}` }, [
303
+ F((e) => new ae({ class: "mr-2", onChange: (s, a) => be(e, a) }))
304
304
  ]), ye = ({ align: t, sortable: e, key: s, label: a, sort: i, class: n }) => {
305
305
  const l = t || "justify-start";
306
306
  return O({
@@ -317,7 +317,7 @@ const we = (t, e) => {
317
317
  class: "text-muted-foreground border-b",
318
318
  map: [
319
319
  t.headers,
320
- (e) => e.label === "checkbox" ? be({ toggle: t.toggle }) : ye({
320
+ (e) => e.label === "checkbox" ? we({ toggle: t.toggle }) : ye({
321
321
  align: e.align,
322
322
  sortable: e.sortable,
323
323
  key: e.key,
@@ -399,17 +399,30 @@ class j extends u {
399
399
  const a = this.data.get("selectedRows"), i = e.selected ? [...a, e] : a.filter((n) => n !== e);
400
400
  this.data.selectedRows = i, this.updateSelected();
401
401
  }
402
+ /**
403
+ * Gets the number of header columns.
404
+ *
405
+ * @returns {number}
406
+ */
407
+ getHeaderColCount() {
408
+ var e;
409
+ if (this.customHeader) {
410
+ const s = this.customHeader, a = s == null ? void 0 : s.children[0];
411
+ return (e = a == null ? void 0 : a.children) == null ? void 0 : e.length;
412
+ }
413
+ return this.headers ? this.headers.length : 3;
414
+ }
402
415
  /**
403
416
  * Renders the DataTable component.
404
417
  *
405
418
  * @returns {object}
406
419
  */
407
420
  render() {
408
- const e = this.border !== !1 ? "border" : "", s = this.headers ? this.headers.length : 3;
421
+ const e = this.border !== !1 ? "border" : "", s = this.getHeaderColCount();
409
422
  return o({ class: "w-full flex flex-auto flex-col" }, [
410
423
  v("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
411
424
  o({ class: `w-full rounded-md ${e} overflow-x-auto`, onSet: ["hasItems", { hidden: !1 }] }, [
412
- C({ class: "w-full" }, [
425
+ I({ class: "w-full" }, [
413
426
  // @ts-ignore
414
427
  this.headers && B({ headers: this.headers, sort: (a) => this.sortRows(a) }),
415
428
  // @ts-ignore
@@ -493,7 +506,7 @@ class j extends u {
493
506
  this.data.selectedRows = [];
494
507
  }
495
508
  }
496
- const xe = (t) => new Z({
509
+ const xe = (t) => Z({
497
510
  cache: "list",
498
511
  loadMoreItems: t.loadMoreItems,
499
512
  offset: t.offset,
@@ -513,11 +526,11 @@ class ve extends j {
513
526
  * @returns {object}
514
527
  */
515
528
  render() {
516
- const e = this.border !== !1 ? "border" : "", s = this.headers ? this.headers.length : 3;
529
+ const e = this.border !== !1 ? "border" : "", s = this.getHeaderColCount();
517
530
  return o({ class: "w-full flex flex-auto flex-col" }, [
518
531
  v("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
519
532
  o({ class: `w-full rounded-md ${e} overflow-x-auto`, onSet: ["hasItems", { hidden: !1 }] }, [
520
- C({ class: "w-full" }, [
533
+ I({ class: "w-full" }, [
521
534
  // @ts-ignore
522
535
  this.headers && B({ headers: this.headers, sort: (a) => this.sortRows(a) }),
523
536
  // @ts-ignore
@@ -596,11 +609,11 @@ class Se extends j {
596
609
  * @returns {object}
597
610
  */
598
611
  render() {
599
- const e = this.border !== !1 ? "border" : "", s = this.headers ? this.headers.length : 3;
612
+ const e = this.border !== !1 ? "border" : "", s = this.getHeaderColCount();
600
613
  return o({ class: "w-full flex flex-auto flex-col" }, [
601
614
  v("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
602
615
  o({ class: `w-full rounded-md ${e} overflow-x-auto`, onSet: ["hasItems", { hidden: !1 }] }, [
603
- C({ class: "w-full" }, [
616
+ I({ class: "w-full" }, [
604
617
  // @ts-ignore
605
618
  this.headers && B({ headers: this.headers, sort: (a) => this.sortRows(a) }),
606
619
  // @ts-ignore
@@ -661,10 +674,10 @@ const rt = h((t) => new Se(
661
674
  emptyState: t.emptyState,
662
675
  skeleton: t.skeleton
663
676
  }
664
- )), Ie = h(({ name: t, email: e }) => o({ class: "min-w-0 flex-auto" }, [
677
+ )), Ce = h(({ name: t, email: e }) => o({ class: "min-w-0 flex-auto" }, [
665
678
  p({ class: "text-base font-semibold leading-6 m-0" }, t),
666
679
  p({ class: "truncate text-sm leading-5 text-muted-foreground m-0" }, e)
667
- ])), Ce = () => o({ class: "flex items-center gap-x-1.5" }, [
680
+ ])), Ie = () => o({ class: "flex items-center gap-x-1.5" }, [
668
681
  o({ class: "flex-none rounded-full bg-emerald-500/20 p-1" }, [
669
682
  o({ class: "h-1.5 w-1.5 rounded-full bg-emerald-500" })
670
683
  ]),
@@ -672,13 +685,13 @@ const rt = h((t) => new Se(
672
685
  ]), Le = (t) => p({ class: "text-xs leading-5 text-muted-foreground" }, [
673
686
  D("Last seen "),
674
687
  q({ datetime: t }, "3h ago")
675
- ]), Te = (t, e) => t === "online" ? Ce() : Le(e), Be = h(({ role: t, lastSeen: e, status: s }) => o({ class: "hidden shrink-0 sm:flex sm:flex-col sm:items-end" }, [
688
+ ]), Te = (t, e) => t === "online" ? Ie() : Le(e), Be = h(({ role: t, lastSeen: e, status: s }) => o({ class: "hidden shrink-0 sm:flex sm:flex-col sm:items-end" }, [
676
689
  p({ class: "text-sm leading-6 m-0" }, t),
677
690
  Te(s, e)
678
691
  ])), Me = (t) => t.split(" ").map((s) => s[0]).join(""), Re = h((t) => S({ class: "fadeIn flex justify-between gap-x-6 py-4 px-4 rounded-md hover:bg-muted/50" }, [
679
692
  o({ class: "flex min-w-0 gap-x-4" }, [
680
693
  oe({ src: t.image, alt: t.name, fallbackText: Me(t.name) }),
681
- Ie({ name: t.name, email: t.email })
694
+ Ce({ name: t.name, email: t.email })
682
695
  ]),
683
696
  Be({
684
697
  role: t.role,
@@ -720,10 +733,10 @@ class dt extends u {
720
733
  * @returns {object}
721
734
  */
722
735
  render() {
723
- return I(
736
+ return C(
724
737
  { class: `flex items-center justify-center p-2 text-muted-foreground rounded-md ${this.class || ""}` },
725
738
  [
726
- w({
739
+ b({
727
740
  class: "flex space-x-4",
728
741
  map: [this.options, (e) => this.addLink(e)],
729
742
  watch: {
@@ -1033,7 +1046,7 @@ const ze = h(({ index: t, click: e, state: s }, a) => S({
1033
1046
  }]
1034
1047
  ],
1035
1048
  click: () => e(t)
1036
- }, a)), $e = h(({ selectOption: t, state: e }) => w({
1049
+ }, a)), $e = h(({ selectOption: t, state: e }) => b({
1037
1050
  class: "border rounded-md list-none m-0 p-0 max-h-[400px] overflow-y-auto",
1038
1051
  for: ["filteredOptions", (s, a) => ze({ index: a, click: t, state: e }, s.label)]
1039
1052
  })), Ne = h((t) => o({ class: "relative flex items-center" }, [
@@ -1200,8 +1213,8 @@ const ze = h(({ index: t, click: e, state: s }, a) => S({
1200
1213
  click: (e) => t.callBack(t.value)
1201
1214
  }, t.label)
1202
1215
  ]
1203
- ), Ue = (t, e) => (t.callBack = e, Ae(t)), Ye = (t) => I({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${t.class}` }, [
1204
- w({ class: "flex flex-auto flex-row", map: [t.options, (e) => Ue(e, t.callBack)] })
1216
+ ), He = (t, e) => (t.callBack = e, Ae(t)), Ue = (t) => C({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${t.class}` }, [
1217
+ b({ class: "flex flex-auto flex-row", map: [t.options, (e) => He(e, t.callBack)] })
1205
1218
  ]);
1206
1219
  class gt extends u {
1207
1220
  /**
@@ -1220,7 +1233,7 @@ class gt extends u {
1220
1233
  render() {
1221
1234
  const e = this.select.bind(this);
1222
1235
  return o({ class: "" }, [
1223
- Ye({
1236
+ Ue({
1224
1237
  class: this.class,
1225
1238
  options: this.options,
1226
1239
  callBack: e
@@ -1291,7 +1304,7 @@ class gt extends u {
1291
1304
  };
1292
1305
  }
1293
1306
  }
1294
- const He = (t) => S(
1307
+ const Ye = (t) => S(
1295
1308
  {
1296
1309
  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",
1297
1310
  dataSet: ["selected", ["state", t.value, "active"]]
@@ -1304,8 +1317,8 @@ const He = (t) => S(
1304
1317
  disabled: t.disabled
1305
1318
  }, t.label)
1306
1319
  ]
1307
- ), Fe = (t, e) => (t.callBack = e, He(t)), Ee = (t) => I({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${t.class}` }, [
1308
- w({ class: "flex flex-auto flex-row", map: [t.options, (e) => Fe(e, t.callBack)] })
1320
+ ), Fe = (t, e) => (t.callBack = e, Ye(t)), Ee = (t) => C({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${t.class}` }, [
1321
+ b({ class: "flex flex-auto flex-row", map: [t.options, (e) => Fe(e, t.callBack)] })
1309
1322
  ]);
1310
1323
  class pt extends u {
1311
1324
  /**
@@ -1381,8 +1394,8 @@ class Ke extends u {
1381
1394
  * @returns {object}
1382
1395
  */
1383
1396
  render() {
1384
- return I({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${this.class}` }, [
1385
- w({
1397
+ return C({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${this.class}` }, [
1398
+ b({
1386
1399
  class: "flex flex-auto flex-row",
1387
1400
  map: [this.options, (e) => this.addLink(e)],
1388
1401
  watch: {
@@ -1455,7 +1468,7 @@ class Ke extends u {
1455
1468
  this.links = [];
1456
1469
  }
1457
1470
  }
1458
- class wt extends u {
1471
+ class bt extends u {
1459
1472
  /**
1460
1473
  * This will declare the props for the compiler.
1461
1474
  *
@@ -1650,8 +1663,8 @@ class Ge extends u {
1650
1663
  const e = this.canvas, s = this.container, a = R.getSize(s), i = this.targetSize, n = i.width, l = i.height;
1651
1664
  let d = n + "px", c = l + "px";
1652
1665
  if (this.width = e.width = n, this.height = e.height = l, a.width !== 0 && a.height !== 0) {
1653
- const f = a.width, m = a.height, r = f / n, g = m / l, b = Math.min(r, g);
1654
- d = n * b + "px", c = l * b + "px";
1666
+ const f = a.width, m = a.height, r = f / n, g = m / l, w = Math.min(r, g);
1667
+ d = n * w + "px", c = l * w + "px";
1655
1668
  }
1656
1669
  e.style.width = d, e.style.height = c;
1657
1670
  }
@@ -1727,7 +1740,7 @@ class Ge extends u {
1727
1740
  this.timer.stop(), this.status = "stopped";
1728
1741
  }
1729
1742
  }
1730
- class bt extends u {
1743
+ class wt extends u {
1731
1744
  /**
1732
1745
  * Sets up default properties for the signature panel.
1733
1746
  *
@@ -1807,7 +1820,7 @@ class bt extends u {
1807
1820
  }
1808
1821
  export {
1809
1822
  ht as B,
1810
- be as C,
1823
+ we as C,
1811
1824
  ke as D,
1812
1825
  ye as H,
1813
1826
  ft as I,
@@ -1836,6 +1849,6 @@ export {
1836
1849
  gt as p,
1837
1850
  pt as q,
1838
1851
  Ke as r,
1839
- wt as s,
1840
- bt as t
1852
+ bt as s,
1853
+ wt as t
1841
1854
  };
@@ -46,6 +46,12 @@ export class DataTable extends Component {
46
46
  * @param {object} row
47
47
  */
48
48
  selectRow(row: object): void;
49
+ /**
50
+ * Gets the number of header columns.
51
+ *
52
+ * @returns {number}
53
+ */
54
+ getHeaderColCount(): number;
49
55
  /**
50
56
  * Renders the DataTable component.
51
57
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base-framework/ui",
3
- "version": "1.0.280",
3
+ "version": "1.0.282",
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": {