@oneplatformdev/ui 0.0.1-beta.32 → 0.0.1-beta.33

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,64 +1,45 @@
1
- import { jsxs as r, jsx as l } from "react/jsx-runtime";
2
- import { flexRender as d } from "@tanstack/react-table";
3
- import { ChevronDown as u } from "lucide-react";
4
- import { Button as p } from "../Button/Button.mjs";
5
- import "../Button/buttonVariants.mjs";
6
- import { DropdownMenu as g, DropdownMenuTrigger as b, DropdownMenuContent as C, DropdownMenuCheckboxItem as f } from "../DropdownMenu/DropdownMenu.mjs";
7
- import { Table as w, TableHeader as x, TableRow as o, TableHead as T, TableBody as D, TableCell as a } from "../Table/Table.mjs";
8
- const B = (s) => {
9
- var i;
1
+ import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
+ import { flexRender as i } from "@tanstack/react-table";
3
+ import { Table as h, TableHeader as u, TableRow as n, TableHead as b, TableBody as g, TableCell as c } from "../Table/Table.mjs";
4
+ import { DataTableColumnFilter as f } from "./DataTableColumnFilter.mjs";
5
+ const N = (d) => {
6
+ var o;
10
7
  const {
11
- table: t,
12
- ToolBar: c,
13
- columnsLabel: m = "Columns",
14
- noResultLabel: h = "No results"
15
- } = s;
16
- return /* @__PURE__ */ r("div", { className: "w-full", children: [
17
- /* @__PURE__ */ r("div", { className: "flex items-center py-4", children: [
18
- c,
19
- /* @__PURE__ */ r(g, { children: [
20
- /* @__PURE__ */ l(b, { asChild: !0, children: /* @__PURE__ */ r(p, { variant: "outline", className: "ml-auto", children: [
21
- m,
22
- /* @__PURE__ */ l(u, { className: "ml-2 h-4 w-4" })
23
- ] }) }),
24
- /* @__PURE__ */ l(C, { align: "end", children: t.getAllColumns().filter((e) => e.getCanHide()).map((e) => /* @__PURE__ */ l(
25
- f,
26
- {
27
- className: "capitalize",
28
- checked: e.getIsVisible(),
29
- onCheckedChange: (n) => e.toggleVisibility(!!n),
30
- children: e.id
31
- },
32
- e.id
33
- )) })
34
- ] })
8
+ table: r,
9
+ ToolBar: s,
10
+ noResultLabel: m = "No results"
11
+ } = d;
12
+ return /* @__PURE__ */ a("div", { className: "w-full", children: [
13
+ /* @__PURE__ */ a("div", { className: "flex items-center py-4", children: [
14
+ s,
15
+ /* @__PURE__ */ e(f, { ...d })
35
16
  ] }),
36
- /* @__PURE__ */ l("div", { className: "rounded-md border", children: /* @__PURE__ */ r(w, { children: [
37
- /* @__PURE__ */ l(x, { children: t.getHeaderGroups().map((e) => /* @__PURE__ */ l(o, { children: e.headers.map((n) => /* @__PURE__ */ l(T, { children: n.isPlaceholder ? null : d(
38
- n.column.columnDef.header,
39
- n.getContext()
40
- ) }, n.id)) }, e.id)) }),
41
- /* @__PURE__ */ l(D, { children: (i = t.getRowModel().rows) != null && i.length ? t.getRowModel().rows.map((e) => /* @__PURE__ */ l(
42
- o,
17
+ /* @__PURE__ */ e("div", { className: "rounded-md border", children: /* @__PURE__ */ a(h, { children: [
18
+ /* @__PURE__ */ e(u, { children: r.getHeaderGroups().map((t) => /* @__PURE__ */ e(n, { children: t.headers.map((l) => /* @__PURE__ */ e(b, { children: l.isPlaceholder ? null : i(
19
+ l.column.columnDef.header,
20
+ l.getContext()
21
+ ) }, l.id)) }, t.id)) }),
22
+ /* @__PURE__ */ e(g, { children: (o = r.getRowModel().rows) != null && o.length ? r.getRowModel().rows.map((t) => /* @__PURE__ */ e(
23
+ n,
43
24
  {
44
- "data-state": e.getIsSelected() && "selected",
45
- children: e.getVisibleCells().map((n) => /* @__PURE__ */ l(a, { children: d(
46
- n.column.columnDef.cell,
47
- n.getContext()
48
- ) }, n.id))
25
+ "data-state": t.getIsSelected() && "selected",
26
+ children: t.getVisibleCells().map((l) => /* @__PURE__ */ e(c, { children: i(
27
+ l.column.columnDef.cell,
28
+ l.getContext()
29
+ ) }, l.id))
49
30
  },
50
- e.id
51
- )) : /* @__PURE__ */ l(o, { children: /* @__PURE__ */ l(
52
- a,
31
+ t.id
32
+ )) : /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(
33
+ c,
53
34
  {
54
- colSpan: t.getAllColumns().length,
35
+ colSpan: r.getAllColumns().length,
55
36
  className: "h-24 text-center",
56
- children: h
37
+ children: m
57
38
  }
58
39
  ) }) })
59
40
  ] }) })
60
41
  ] });
61
42
  };
62
43
  export {
63
- B as DataTable
44
+ N as DataTable
64
45
  };
@@ -0,0 +1,4 @@
1
+ import { DataTableProps } from './DataTable.types';
2
+ import { FC } from 'react';
3
+
4
+ export declare const DataTableColumnFilter: FC<DataTableProps>;
@@ -0,0 +1,31 @@
1
+ import { jsx as n, jsxs as t } from "react/jsx-runtime";
2
+ import { ChevronDown as m } from "lucide-react";
3
+ import { useMemo as s } from "react";
4
+ import { Button as d } from "../Button/Button.mjs";
5
+ import "../Button/buttonVariants.mjs";
6
+ import { DropdownMenuCheckboxItem as c, DropdownMenu as u, DropdownMenuTrigger as h, DropdownMenuContent as p } from "../DropdownMenu/DropdownMenu.mjs";
7
+ const x = (i) => {
8
+ const {
9
+ table: r,
10
+ columnsLabel: l = "Columns"
11
+ } = i, o = s(() => r.getAllColumns().filter((e) => e.getCanHide()).map((e) => /* @__PURE__ */ n(
12
+ c,
13
+ {
14
+ className: "capitalize",
15
+ checked: e.getIsVisible(),
16
+ onCheckedChange: (a) => e.toggleVisibility(!!a),
17
+ children: e.id
18
+ },
19
+ e.id
20
+ )), [r]);
21
+ return o.length ? /* @__PURE__ */ t(u, { children: [
22
+ /* @__PURE__ */ n(h, { asChild: !0, children: /* @__PURE__ */ t(d, { variant: "outline", className: "ml-auto", children: [
23
+ l,
24
+ /* @__PURE__ */ n(m, { className: "ml-2 h-4 w-4" })
25
+ ] }) }),
26
+ /* @__PURE__ */ n(p, { align: "end", children: o })
27
+ ] }) : null;
28
+ };
29
+ export {
30
+ x as DataTableColumnFilter
31
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneplatformdev/ui",
3
- "version": "0.0.1-beta.32",
3
+ "version": "0.0.1-beta.33",
4
4
  "description": "UI React Components.",
5
5
  "author": "One Platform Development Team",
6
6
  "keywords": [