@base-framework/ui 1.0.280 → 1.0.281

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-BEO99NlI.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-BEO99NlI.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 w, 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), b = g.find((Y) => Y) || new Date(t, e, 1), { weekNumber: H, year: U } = ce(b);
99
99
  m.push({
100
- weekNumber: U,
101
- year: Y,
100
+ weekNumber: H,
101
+ year: U,
102
102
  days: g
103
103
  });
104
104
  }
@@ -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
@@ -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,7 +733,7 @@ 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
739
  w({
@@ -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
+ w({ 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,7 +1317,7 @@ 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}` }, [
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}` }, [
1308
1321
  w({ class: "flex flex-auto flex-row", map: [t.options, (e) => Fe(e, t.callBack)] })
1309
1322
  ]);
1310
1323
  class pt extends u {
@@ -1381,7 +1394,7 @@ 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}` }, [
1397
+ return C({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${this.class}` }, [
1385
1398
  w({
1386
1399
  class: "flex flex-auto flex-row",
1387
1400
  map: [this.options, (e) => this.addLink(e)],
@@ -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.281",
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": {