@ztwoint/z-ui 0.1.145 → 0.1.147

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,7 +1,7 @@
1
- import { jsx as t, jsxs as m } from "react/jsx-runtime";
1
+ import { jsx as t, jsxs as o } from "react/jsx-runtime";
2
2
  import { Table as r } from "../../table/table-provider.js";
3
3
  import "react";
4
- import { cn as d } from "../../../lib/utils.js";
4
+ import { cn as h } from "../../../lib/utils.js";
5
5
  /* empty css */
6
6
  import "../../alert/alert.const.js";
7
7
  import "../../button/button.js";
@@ -23,7 +23,7 @@ import "@radix-ui/react-dialog";
23
23
  import "../../dropdown/z2-dropdown.js";
24
24
  import "@radix-ui/react-dropdown-menu";
25
25
  import "lucide-react";
26
- import S from "../../assets/icons/octagon-warning-Copy.js";
26
+ import q from "../../assets/icons/octagon-warning-Copy.js";
27
27
  import "../../input/input.js";
28
28
  import "../../nav-header/nav-header.js";
29
29
  import "../../nav-header/nav-item/nav-item.js";
@@ -33,7 +33,7 @@ import "../../stepper/stepper.js";
33
33
  import "../../stepper-item/stepper-item.js";
34
34
  import "@radix-ui/react-tabs";
35
35
  import "../../tooltip/tooltip.js";
36
- import { Filter as x } from "../../table-filter/index.js";
36
+ import { Filter as g } from "../../table-filter/index.js";
37
37
  import "../../badge/badge.js";
38
38
  import "../../avatar/avatar.js";
39
39
  import "../../text-preset/text-preset.js";
@@ -58,57 +58,58 @@ import "../../z2map/components/map-zoom-control.js";
58
58
  import "../../z2map/components/map-style-control.js";
59
59
  import "../../kpi-card/kpi-card.js";
60
60
  import "../../table/table.context.js";
61
- const It = ({
62
- dataSource: w,
63
- schema: B,
64
- loading: b,
65
- emptyMessage: k,
66
- className: H,
67
- rounded: c = !0,
68
- bordered: n = !0,
69
- showHeader: g = !0,
70
- headerClassName: j,
61
+ const Mt = ({
62
+ dataSource: b,
63
+ schema: k,
64
+ loading: H,
65
+ emptyMessage: f,
66
+ className: j,
67
+ rounded: n = !0,
68
+ bordered: c = !0,
69
+ showHeader: P = !0,
70
+ headerClassName: T,
71
71
  search: s,
72
72
  filter: e,
73
73
  headerLeftContent: p,
74
- headerActions: h,
75
- body: o = {
74
+ headerActions: u,
75
+ body: l = {
76
76
  cell: { hasBorder: !0 },
77
77
  className: "",
78
78
  stickyHeader: !0
79
79
  },
80
- showFooter: P = !0,
81
- footerClassName: T,
82
- pagination: l,
80
+ showFooter: C = !0,
81
+ footerClassName: _,
82
+ pagination: m,
83
83
  paginationInfo: i,
84
84
  paginationQuickJumper: a,
85
- error: u = !1,
86
- dataSourceError: _ = !1
85
+ footerInfo: d,
86
+ error: x = !1,
87
+ dataSourceError: R = !1
87
88
  }) => {
88
- var F;
89
- if (u)
90
- return /* @__PURE__ */ t("div", { className: "flex flex-col items-center justify-center h-64 bg-background-error-subtle rounded-lg text-text-warning-secondary", children: /* @__PURE__ */ m("div", { className: "flex gap-2", children: [
91
- /* @__PURE__ */ t(S, { className: "mt-1.5" }),
92
- /* @__PURE__ */ m("div", { className: "flex flex-col gap-2", children: [
89
+ var w;
90
+ if (x)
91
+ return /* @__PURE__ */ t("div", { className: "flex flex-col items-center justify-center h-64 bg-background-error-subtle rounded-lg text-text-warning-secondary", children: /* @__PURE__ */ o("div", { className: "flex gap-2", children: [
92
+ /* @__PURE__ */ t(q, { className: "mt-1.5" }),
93
+ /* @__PURE__ */ o("div", { className: "flex flex-col gap-2", children: [
93
94
  /* @__PURE__ */ t("div", { className: "text-text-error-primary text-lg font-medium", children: "Error loading data" }),
94
95
  /* @__PURE__ */ t("div", { className: "text-sm", children: "Please try again later" }),
95
- typeof u == "string" && /* @__PURE__ */ t("div", { className: "text-text-warning-secondary text-sm", children: u })
96
+ typeof x == "string" && /* @__PURE__ */ t("div", { className: "text-text-warning-secondary text-sm", children: x })
96
97
  ] })
97
98
  ] }) });
98
- const N = a && a.totalPage && a.totalPage >= 2, C = l && l.totalPage && l.totalPage >= 2 || !!i || N, v = s || e || p || h, R = typeof (e == null ? void 0 : e.showFilterButton) > "u" ? !0 : e == null ? void 0 : e.showFilterButton;
99
- return /* @__PURE__ */ m("div", { className: d("flex flex-col overflow-hidden relative", H), children: [
100
- /* @__PURE__ */ m(r, { dataSource: w, schema: B, emptyMessage: k, children: [
101
- g && v && /* @__PURE__ */ m(
99
+ const N = a && a.totalPage && a.totalPage >= 2, v = m && m.totalPage && m.totalPage >= 2 || !!i || N || !!d, F = s || e || p || u, S = typeof (e == null ? void 0 : e.showFilterButton) > "u" ? !0 : e == null ? void 0 : e.showFilterButton;
100
+ return /* @__PURE__ */ o("div", { className: h("flex flex-col overflow-hidden relative", j), children: [
101
+ /* @__PURE__ */ o(r, { dataSource: b, schema: k, emptyMessage: f, children: [
102
+ P && F && /* @__PURE__ */ o(
102
103
  r.Header,
103
104
  {
104
- className: d(
105
+ className: h(
105
106
  "flex-shrink-0",
106
- n && "border-stroke-solid-medium border-1 border-b-0",
107
- c && "rounded-t-xl",
108
- j
107
+ c && "border-stroke-solid-medium border-1 border-b-0",
108
+ n && "rounded-t-xl",
109
+ T
109
110
  ),
110
111
  children: [
111
- /* @__PURE__ */ m(r.HeaderContent, { className: "overflow-x-auto p-[1px]", children: [
112
+ /* @__PURE__ */ o(r.HeaderContent, { className: "overflow-x-auto p-[1px]", children: [
112
113
  p && p,
113
114
  s && /* @__PURE__ */ t(
114
115
  r.Search,
@@ -122,8 +123,8 @@ const It = ({
122
123
  className: s.className
123
124
  }
124
125
  ),
125
- e && /* @__PURE__ */ m(
126
- x,
126
+ e && /* @__PURE__ */ o(
127
+ g,
127
128
  {
128
129
  filterSchema: e.filterSchema,
129
130
  filter: {
@@ -134,54 +135,57 @@ const It = ({
134
135
  loading: e.loading
135
136
  },
136
137
  children: [
137
- R && /* @__PURE__ */ t(x.FilterButton, {}),
138
- (F = e == null ? void 0 : e.quickFilters) == null ? void 0 : F.map((f) => /* @__PURE__ */ t(x.FilterColumnButton, { filterName: f }, f))
138
+ S && /* @__PURE__ */ t(g.FilterButton, {}),
139
+ (w = e == null ? void 0 : e.quickFilters) == null ? void 0 : w.map((B) => /* @__PURE__ */ t(g.FilterColumnButton, { filterName: B }, B))
139
140
  ]
140
141
  }
141
142
  )
142
143
  ] }),
143
- h && /* @__PURE__ */ t(r.HeaderContent, { children: h })
144
+ u && /* @__PURE__ */ t(r.HeaderContent, { children: u })
144
145
  ]
145
146
  }
146
147
  ),
147
148
  /* @__PURE__ */ t(
148
149
  r.Body,
149
150
  {
150
- dataSourceError: _,
151
- cell: o == null ? void 0 : o.cell,
152
- sort: o == null ? void 0 : o.sort,
153
- className: d(
151
+ dataSourceError: R,
152
+ cell: l == null ? void 0 : l.cell,
153
+ sort: l == null ? void 0 : l.sort,
154
+ className: h(
154
155
  "flex-1 min-h-0",
155
- n && "border-stroke-solid-light border-1",
156
- c && !(g && v) && "rounded-t-xl",
157
- c && !(P && C) && "rounded-b-xl",
158
- n && "[&_td:first-child]:border-l-0 [&_td:last-child]:border-r-0",
159
- n && "[&_th:first-child]:border-l-0 [&_th:last-child]:border-r-0",
160
- o == null ? void 0 : o.className
156
+ c && "border-stroke-solid-light border-1",
157
+ n && !(P && F) && "rounded-t-xl",
158
+ n && !(C && v) && "rounded-b-xl",
159
+ c && "[&_td:first-child]:border-l-0 [&_td:last-child]:border-r-0",
160
+ c && "[&_th:first-child]:border-l-0 [&_th:last-child]:border-r-0",
161
+ l == null ? void 0 : l.className
161
162
  ),
162
- stickyHeader: o == null ? void 0 : o.stickyHeader
163
+ stickyHeader: l == null ? void 0 : l.stickyHeader
163
164
  }
164
165
  ),
165
- P && C && /* @__PURE__ */ m(
166
+ C && v && /* @__PURE__ */ o(
166
167
  r.Footer,
167
168
  {
168
- className: d(
169
+ className: h(
169
170
  "flex-shrink-0 border-stroke-solid-light border-t-[1px] mt-[-2px]",
170
- n && "border",
171
- c && "rounded-b-xl",
172
- T
171
+ c && "border",
172
+ n && "rounded-b-xl",
173
+ _
173
174
  ),
174
175
  children: [
175
- i ? /* @__PURE__ */ t(r.FooterContent, { children: /* @__PURE__ */ t(
176
- r.PaginationInfo,
177
- {
178
- showTotal: i.showTotal,
179
- totalItems: i.totalItems,
180
- currentPage: i.currentPage,
181
- itemsPerPage: i.itemsPerPage
182
- }
183
- ) }) : a || l ? /* @__PURE__ */ t(r.FooterContent, { children: null }) : null,
184
- (a || l) && /* @__PURE__ */ m(r.FooterContent, { children: [
176
+ i ? /* @__PURE__ */ o(r.FooterContent, { children: [
177
+ /* @__PURE__ */ t(
178
+ r.PaginationInfo,
179
+ {
180
+ showTotal: i.showTotal,
181
+ totalItems: i.totalItems,
182
+ currentPage: i.currentPage,
183
+ itemsPerPage: i.itemsPerPage
184
+ }
185
+ ),
186
+ d
187
+ ] }) : d ? /* @__PURE__ */ t(r.FooterContent, { children: d }) : a || m ? /* @__PURE__ */ t(r.FooterContent, { children: null }) : null,
188
+ (a || m) && /* @__PURE__ */ o(r.FooterContent, { children: [
185
189
  N && /* @__PURE__ */ t(
186
190
  r.PaginationQuickJumper,
187
191
  {
@@ -192,14 +196,14 @@ const It = ({
192
196
  disabled: a.disabled
193
197
  }
194
198
  ),
195
- l && /* @__PURE__ */ t(
199
+ m && /* @__PURE__ */ t(
196
200
  r.Pagination,
197
201
  {
198
- currentPage: l.currentPage,
199
- totalPage: l.totalPage,
200
- onChange: l.onChange || (() => {
202
+ currentPage: m.currentPage,
203
+ totalPage: m.totalPage,
204
+ onChange: m.onChange || (() => {
201
205
  }),
202
- totalItems: l.totalItems
206
+ totalItems: m.totalItems
203
207
  }
204
208
  )
205
209
  ] })
@@ -207,12 +211,12 @@ const It = ({
207
211
  }
208
212
  )
209
213
  ] }),
210
- b && /* @__PURE__ */ t("div", { className: "absolute top-0 inset-0 w-full h-full bg-white/80 flex items-center justify-center", children: /* @__PURE__ */ m("div", { className: "flex flex-col items-center gap-3", children: [
214
+ H && /* @__PURE__ */ t("div", { className: "absolute top-0 inset-0 w-full h-full bg-white/80 flex items-center justify-center", children: /* @__PURE__ */ o("div", { className: "flex flex-col items-center gap-3", children: [
211
215
  /* @__PURE__ */ t("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-text-brand-secondary" }),
212
216
  /* @__PURE__ */ t("p", { className: "text-text-neutral-primary font-medium", children: "Loading..." })
213
217
  ] }) })
214
218
  ] });
215
219
  };
216
220
  export {
217
- It as default
221
+ Mt as default
218
222
  };
@@ -32,6 +32,7 @@ export interface TableCardProps {
32
32
  pagination?: PaginationProps;
33
33
  paginationInfo?: PaginationInfoProps;
34
34
  paginationQuickJumper?: PaginationQuickJumperProps;
35
+ footerInfo?: React.ReactNode;
35
36
  loading?: boolean;
36
37
  emptyMessage?: string;
37
38
  dataSourceError?: boolean | string;
@@ -1,33 +1,33 @@
1
- import { jsx as a, jsxs as t } from "react/jsx-runtime";
1
+ import { jsx as a, jsxs as i } from "react/jsx-runtime";
2
2
  import * as e from "@radix-ui/react-tooltip";
3
- import { cn as n } from "../../lib/utils.js";
3
+ import { cn as s } from "../../lib/utils.js";
4
4
  const p = ({
5
- message: d,
6
- children: i,
5
+ message: t,
6
+ children: d,
7
7
  delayDuration: o = 300,
8
- side: l = void 0,
9
- className: r,
10
- ...s
11
- }) => /* @__PURE__ */ a(e.Provider, { delayDuration: o, children: /* @__PURE__ */ t(e.Root, { children: [
12
- /* @__PURE__ */ a(e.Trigger, { asChild: !0, children: i }),
13
- /* @__PURE__ */ a(e.Portal, { children: /* @__PURE__ */ t(
8
+ side: r = void 0,
9
+ className: l,
10
+ ...n
11
+ }) => t ? /* @__PURE__ */ a(e.Provider, { delayDuration: o, children: /* @__PURE__ */ i(e.Root, { children: [
12
+ /* @__PURE__ */ a(e.Trigger, { asChild: !0, children: d }),
13
+ /* @__PURE__ */ a(e.Portal, { children: /* @__PURE__ */ i(
14
14
  e.Content,
15
15
  {
16
- side: l,
16
+ side: r,
17
17
  sideOffset: 4,
18
- className: n(
18
+ className: s(
19
19
  "bg-tooltip-surface text-white leading-none-regular-sm rounded-md px-2 py-2",
20
20
  "will-change-[transform,opacity] data-[state=delayed-open]:data-[side=bottom]:animate-slideUpAndFade data-[state=delayed-open]:data-[side=left]:animate-slideRightAndFade data-[state=delayed-open]:data-[side=right]:animate-slideLeftAndFade data-[state=delayed-open]:data-[side=top]:animate-slideDownAndFade",
21
- r
21
+ l
22
22
  ),
23
- ...s,
23
+ ...n,
24
24
  children: [
25
- d,
25
+ t,
26
26
  /* @__PURE__ */ a(e.Arrow, { className: "fill-tooltip-surface" })
27
27
  ]
28
28
  }
29
29
  ) })
30
- ] }) });
30
+ ] }) }) : d;
31
31
  p.displayName = "Z2Tooltip";
32
32
  export {
33
33
  p as Z2Tooltip
@@ -33,6 +33,7 @@ export interface TableCardProps {
33
33
  pagination?: PaginationProps;
34
34
  paginationInfo?: PaginationInfoProps;
35
35
  paginationQuickJumper?: PaginationQuickJumperProps;
36
+ footerInfo?: React.ReactNode;
36
37
  loading?: boolean;
37
38
  emptyMessage?: string;
38
39
  dataSourceError?: boolean | string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztwoint/z-ui",
3
- "version": "0.1.145",
3
+ "version": "0.1.147",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",