@ztwoint/z-ui 0.1.46 → 0.1.47

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.
Files changed (59) hide show
  1. package/dist/components/assets/icons/check.d.ts +8 -0
  2. package/dist/components/assets/icons/check.js +17 -0
  3. package/dist/components/assets/icons/x-mark.d.ts +8 -0
  4. package/dist/components/assets/icons/x-mark.js +17 -0
  5. package/dist/components/table/components/cell/avatar-cell.d.ts +15 -0
  6. package/dist/components/table/components/cell/avatar-cell.js +74 -0
  7. package/dist/components/table/components/cell/boolean-cell.d.ts +1 -2
  8. package/dist/components/table/components/cell/boolean-cell.js +5 -5
  9. package/dist/components/table/components/cell/description-cell.d.ts +7 -0
  10. package/dist/components/table/components/cell/description-cell.js +16 -0
  11. package/dist/components/table/components/cell/index.d.ts +10 -1
  12. package/dist/components/table/components/cell/label-cell.d.ts +10 -0
  13. package/dist/components/table/components/cell/label-cell.js +47 -0
  14. package/dist/components/table/components/cell/link-cell.d.ts +10 -0
  15. package/dist/components/table/components/cell/link-cell.js +35 -0
  16. package/dist/components/table/components/cell/number-cell.d.ts +5 -3
  17. package/dist/components/table/components/cell/number-cell.js +40 -3
  18. package/dist/components/table/components/index.d.ts +1 -1
  19. package/dist/components/table/components/table-cell.d.ts +1 -1
  20. package/dist/components/table/components/table-cell.js +41 -32
  21. package/dist/components/table/components/table-filter/filters/boolean.js +52 -44
  22. package/dist/components/table/components/table-filter/selected-filters-display/selected-filters-display.utils.js +16 -16
  23. package/dist/components/table/components/table-filter/table-filter-button.js +59 -49
  24. package/dist/components/table/components/table-filter/table-filter-column-button.js +42 -41
  25. package/dist/components/table/components/table-header/stories/basic-header.d.ts +1 -1
  26. package/dist/components/table/components/table-header/table-header.js +10 -10
  27. package/dist/components/table/index.d.ts +1 -1
  28. package/dist/components/table/table-provider.js +37 -8
  29. package/dist/components/table/table.const.d.ts +10 -8
  30. package/dist/components/table/table.const.js +10 -8
  31. package/dist/components/table/table.js +1 -7
  32. package/dist/components/table/table.type.d.ts +36 -5
  33. package/dist/components/table/table.utils.d.ts +1 -1
  34. package/dist/components/table/table.utils.js +5 -3
  35. package/dist/components/table-card/table-card.js +116 -89
  36. package/dist/css/styles/tailwind.css +1 -1
  37. package/dist/index.js +62 -64
  38. package/dist/types/components/assets/icons/check.d.ts +8 -0
  39. package/dist/types/components/assets/icons/x-mark.d.ts +8 -0
  40. package/dist/types/components/table/components/cell/avatar-cell.d.ts +15 -0
  41. package/dist/types/components/table/components/cell/boolean-cell.d.ts +1 -2
  42. package/dist/types/components/table/components/cell/description-cell.d.ts +7 -0
  43. package/dist/types/components/table/components/cell/index.d.ts +10 -1
  44. package/dist/types/components/table/components/cell/label-cell.d.ts +10 -0
  45. package/dist/types/components/table/components/cell/link-cell.d.ts +10 -0
  46. package/dist/types/components/table/components/cell/number-cell.d.ts +5 -3
  47. package/dist/types/components/table/components/index.d.ts +1 -1
  48. package/dist/types/components/table/components/table-cell.d.ts +1 -1
  49. package/dist/types/components/table/components/table-header/stories/basic-header.d.ts +1 -1
  50. package/dist/types/components/table/index.d.ts +1 -1
  51. package/dist/types/components/table/table.const.d.ts +10 -8
  52. package/dist/types/components/table/table.type.d.ts +36 -5
  53. package/dist/types/components/table/table.utils.d.ts +1 -1
  54. package/package.json +1 -1
  55. package/dist/components/table/components/cell/text-cell.d.ts +0 -7
  56. package/dist/components/table/components/cell/text-cell.js +0 -5
  57. package/dist/node_modules/@heroicons/react/24/solid/esm/CheckCircleIcon.js +0 -26
  58. package/dist/node_modules/@heroicons/react/24/solid/esm/XCircleIcon.js +0 -26
  59. package/dist/types/components/table/components/cell/text-cell.d.ts +0 -7
@@ -1,137 +1,164 @@
1
- import { jsx as r, jsxs as h } from "react/jsx-runtime";
2
- import { Table as e } from "../table/table-provider.js";
1
+ import { jsx as o, jsxs as c } from "react/jsx-runtime";
2
+ import { Table as t } from "../table/table-provider.js";
3
3
  import "react";
4
- import { cn as P } from "../../lib/utils.js";
5
- import "../table/table.context.js";
4
+ import { cn as n } from "../../lib/utils.js";
5
+ /* empty css */
6
+ import "../alert/alert.const.js";
6
7
  import "../button/button.js";
8
+ import "../collapsible-side-nav-bar/side-nav-bar-provider.js";
9
+ import "../collapsible-side-nav-bar/side-nav-bar.js";
10
+ import "../collapsible-side-nav-bar/side-nav-bar-header.js";
11
+ import "../collapsible-side-nav-bar/side-nav-bar-content.js";
12
+ import "../collapsible-side-nav-bar/side-nav-bar-footer.js";
13
+ import "../collapsible-side-nav-bar/side-nav-bar-group.js";
14
+ import "../collapsible-side-nav-bar/side-nav-bar-item.js";
15
+ import "../collapsible-side-nav-bar/side-nav-bar-separator.js";
16
+ import "../collapsible-side-nav-bar/context.js";
17
+ import "../collapsible-side-nav-bar/popover/popover.js";
18
+ import "react-country-flag";
19
+ import "classnames";
20
+ import "@radix-ui/react-dialog";
21
+ import "../dropdown/z2-dropdown.js";
22
+ import "@radix-ui/react-dropdown-menu";
23
+ import "lucide-react";
7
24
  import "../input/input.js";
8
- const M = ({
9
- dataSource: w,
10
- schema: C,
11
- loading: T,
12
- emptyMessage: _,
13
- className: k,
14
- rounded: n = !0,
15
- bordered: d = !0,
16
- showHeader: x = !0,
17
- headerClassName: R,
18
- search: a,
19
- filter: t,
20
- headerLeftContent: m,
25
+ import "../nav-header/nav-header.js";
26
+ import "../nav-header/nav-item/nav-item.js";
27
+ import "@radix-ui/react-select";
28
+ import "../stepper/stepper.js";
29
+ import "../stepper-item/stepper-item.js";
30
+ import "@radix-ui/react-tabs";
31
+ import "../tooltip/tooltip.js";
32
+ import "../badge/badge.js";
33
+ import "../avatar/avatar.js";
34
+ import "../table/table.context.js";
35
+ const dt = ({
36
+ dataSource: v,
37
+ schema: i,
38
+ loading: H,
39
+ emptyMessage: w,
40
+ className: T,
41
+ rounded: d = !0,
42
+ bordered: h = !0,
43
+ showHeader: C = !0,
44
+ headerClassName: _,
45
+ search: m,
46
+ filter: e,
47
+ headerLeftContent: P,
21
48
  headerActions: u,
22
- body: l = {
23
- cell: { cellHeight: "small", hasBorder: !0 },
49
+ body: r = {
50
+ cell: { hasBorder: !0 },
24
51
  className: "",
25
52
  stickyHeader: !0
26
53
  },
27
- showFooter: F = !0,
28
- footerClassName: j,
29
- pagination: s,
30
- paginationInfo: c,
31
- paginationQuickJumper: o
54
+ showFooter: x = !0,
55
+ footerClassName: k,
56
+ pagination: l,
57
+ paginationInfo: a,
58
+ paginationQuickJumper: s
32
59
  }) => {
33
- var N;
34
- const g = o && o.totalPage && o.totalPage >= 2, B = s && s.totalPage && s.totalPage >= 2 || !!c || g, H = a || t || m || u, q = typeof (t == null ? void 0 : t.showFilterButton) > "u" ? !0 : t == null ? void 0 : t.showFilterButton;
35
- return /* @__PURE__ */ r("div", { className: P("flex flex-col overflow-hidden", k), children: /* @__PURE__ */ h(e, { dataSource: w, schema: C, loading: T, emptyMessage: _, children: [
36
- x && H && /* @__PURE__ */ h(
37
- e.Header,
60
+ var B;
61
+ const F = s && s.totalPage && s.totalPage >= 2, p = l && l.totalPage && l.totalPage >= 2 || !!a || F, g = m || e || P || u, R = typeof (e == null ? void 0 : e.showFilterButton) > "u" ? !0 : e == null ? void 0 : e.showFilterButton;
62
+ return /* @__PURE__ */ o("div", { className: n("flex flex-col overflow-hidden", T), children: /* @__PURE__ */ c(t, { dataSource: v, schema: i, loading: H, emptyMessage: w, children: [
63
+ C && g && /* @__PURE__ */ c(
64
+ t.Header,
38
65
  {
39
- className: P(
66
+ className: n(
40
67
  "flex-shrink-0",
41
- d && "border-stroke-solid-medium border-1 border-b-0",
42
- n && "rounded-t-xl",
43
- R
68
+ h && "border-stroke-solid-medium border-1 border-b-0",
69
+ d && "rounded-t-xl",
70
+ _
44
71
  ),
45
72
  children: [
46
- /* @__PURE__ */ h(e.HeaderContent, { children: [
47
- m && m,
48
- a && /* @__PURE__ */ r(
49
- e.Search,
73
+ /* @__PURE__ */ c(t.HeaderContent, { children: [
74
+ P && P,
75
+ m && /* @__PURE__ */ o(
76
+ t.Search,
50
77
  {
51
78
  search: {
52
- value: a.value || "",
53
- onChange: a.onChange || (() => {
79
+ value: m.value || "",
80
+ onChange: m.onChange || (() => {
54
81
  }),
55
- placeholder: a.placeholder
82
+ placeholder: m.placeholder
56
83
  },
57
- className: a.className
84
+ className: m.className
58
85
  }
59
86
  ),
60
- t && /* @__PURE__ */ h(
61
- e.Filter,
87
+ e && /* @__PURE__ */ c(
88
+ t.Filter,
62
89
  {
63
- schema: C,
90
+ schema: i,
64
91
  filter: {
65
- value: t.value || [],
66
- onChange: t.onChange || (() => {
92
+ value: e.value || [],
93
+ onChange: e.onChange || (() => {
67
94
  })
68
95
  },
69
96
  children: [
70
- q && /* @__PURE__ */ r(e.Filter.FilterButton, {}),
71
- (N = t == null ? void 0 : t.quickFilters) == null ? void 0 : N.map((v) => /* @__PURE__ */ r(e.Filter.FilterColumnButton, { filterName: v }, v))
97
+ R && /* @__PURE__ */ o(t.Filter.FilterButton, {}),
98
+ (B = e == null ? void 0 : e.quickFilters) == null ? void 0 : B.map((N) => /* @__PURE__ */ o(t.Filter.FilterColumnButton, { filterName: N }, N))
72
99
  ]
73
100
  }
74
101
  )
75
102
  ] }),
76
- u && /* @__PURE__ */ r(e.HeaderContent, { children: u })
103
+ u && /* @__PURE__ */ o(t.HeaderContent, { children: u })
77
104
  ]
78
105
  }
79
106
  ),
80
- /* @__PURE__ */ r(
81
- e.Body,
107
+ /* @__PURE__ */ o(
108
+ t.Body,
82
109
  {
83
- cell: l == null ? void 0 : l.cell,
84
- sort: l == null ? void 0 : l.sort,
85
- className: P(
110
+ cell: r == null ? void 0 : r.cell,
111
+ sort: r == null ? void 0 : r.sort,
112
+ className: n(
86
113
  "flex-1 min-h-0",
87
- d && "border-stroke-solid-light border-b-1 border-x-1 border-t-0",
88
- n && !(x && H) && "rounded-t-xl",
89
- n && !(F && B) && "rounded-b-xl",
90
- d && "[&_td:first-child]:border-l-0 [&_td:last-child]:border-r-0",
91
- d && "[&_th:first-child]:border-l-0 [&_th:last-child]:border-r-0",
92
- l == null ? void 0 : l.className
114
+ h && "border-stroke-solid-light border-b-1 border-x-1 border-t-0",
115
+ d && !(C && g) && "rounded-t-xl",
116
+ d && !(x && p) && "rounded-b-xl",
117
+ h && "[&_td:first-child]:border-l-0 [&_td:last-child]:border-r-0",
118
+ h && "[&_th:first-child]:border-l-0 [&_th:last-child]:border-r-0",
119
+ r == null ? void 0 : r.className
93
120
  ),
94
- stickyHeader: l == null ? void 0 : l.stickyHeader
121
+ stickyHeader: r == null ? void 0 : r.stickyHeader
95
122
  }
96
123
  ),
97
- F && B && /* @__PURE__ */ h(
98
- e.Footer,
124
+ x && p && /* @__PURE__ */ c(
125
+ t.Footer,
99
126
  {
100
- className: P(
101
- "flex-shrink-0",
102
- d && "border-stroke-solid-light border border-t-[0.5px]",
103
- n && "rounded-b-xl",
104
- j
127
+ className: n(
128
+ "flex-shrink-0 border-stroke-solid-light border-t-[0.5px]",
129
+ h && "border",
130
+ d && "rounded-b-xl",
131
+ k
105
132
  ),
106
133
  children: [
107
- c ? /* @__PURE__ */ r(e.FooterContent, { children: /* @__PURE__ */ r(
108
- e.PaginationInfo,
134
+ a ? /* @__PURE__ */ o(t.FooterContent, { children: /* @__PURE__ */ o(
135
+ t.PaginationInfo,
109
136
  {
110
- showTotal: c.showTotal,
111
- totalItems: c.totalItems,
112
- currentPage: c.currentPage,
113
- itemsPerPage: c.itemsPerPage
137
+ showTotal: a.showTotal,
138
+ totalItems: a.totalItems,
139
+ currentPage: a.currentPage,
140
+ itemsPerPage: a.itemsPerPage
114
141
  }
115
- ) }) : o || s ? /* @__PURE__ */ r(e.FooterContent, { children: null }) : null,
116
- (o || s) && /* @__PURE__ */ h(e.FooterContent, { children: [
117
- g && /* @__PURE__ */ r(
118
- e.PaginationQuickJumper,
142
+ ) }) : s || l ? /* @__PURE__ */ o(t.FooterContent, { children: null }) : null,
143
+ (s || l) && /* @__PURE__ */ c(t.FooterContent, { children: [
144
+ F && /* @__PURE__ */ o(
145
+ t.PaginationQuickJumper,
119
146
  {
120
- currentPage: o.currentPage,
121
- totalPage: o.totalPage,
122
- onChange: o.onChange || (() => {
147
+ currentPage: s.currentPage,
148
+ totalPage: s.totalPage,
149
+ onChange: s.onChange || (() => {
123
150
  }),
124
- disabled: o.disabled
151
+ disabled: s.disabled
125
152
  }
126
153
  ),
127
- s && /* @__PURE__ */ r(
128
- e.Pagination,
154
+ l && /* @__PURE__ */ o(
155
+ t.Pagination,
129
156
  {
130
- currentPage: s.currentPage,
131
- totalPage: s.totalPage,
132
- onChange: s.onChange || (() => {
157
+ currentPage: l.currentPage,
158
+ totalPage: l.totalPage,
159
+ onChange: l.onChange || (() => {
133
160
  }),
134
- totalItems: s.totalItems
161
+ totalItems: l.totalItems
135
162
  }
136
163
  )
137
164
  ] })
@@ -141,5 +168,5 @@ const M = ({
141
168
  ] }) });
142
169
  };
143
170
  export {
144
- M as default
171
+ dt as default
145
172
  };