@ztwoint/z-ui 0.1.146 → 0.1.148

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 (36) hide show
  1. package/dist/components/pdf-preview/components/pdf-error-state.d.ts +9 -0
  2. package/dist/components/pdf-preview/components/pdf-error-state.js +18 -0
  3. package/dist/components/pdf-preview/components/pdf-loading-state.d.ts +3 -0
  4. package/dist/components/pdf-preview/components/pdf-loading-state.js +34 -0
  5. package/dist/components/pdf-preview/components/pdf-toolbar.d.ts +16 -0
  6. package/dist/components/pdf-preview/components/pdf-toolbar.js +47 -0
  7. package/dist/components/pdf-preview/components/pdf-viewer.d.ts +22 -0
  8. package/dist/components/pdf-preview/components/pdf-viewer.js +6 -0
  9. package/dist/components/pdf-preview/index.d.ts +3 -0
  10. package/dist/components/pdf-preview/pdf-preview.const.d.ts +29 -0
  11. package/dist/components/pdf-preview/pdf-preview.const.js +29 -0
  12. package/dist/components/pdf-preview/pdf-preview.d.ts +16 -0
  13. package/dist/components/pdf-preview/pdf-preview.hook.d.ts +12 -0
  14. package/dist/components/pdf-preview/pdf-preview.hook.js +69 -0
  15. package/dist/components/pdf-preview/pdf-preview.js +77 -0
  16. package/dist/components/pdf-preview/pdf-preview.type.d.ts +81 -0
  17. package/dist/components/primitives/table-card/table-card.js +81 -76
  18. package/dist/components/primitives/table-card/table-card.type.d.ts +1 -0
  19. package/dist/components/table/components/cell/avatar-cell.js +3 -2
  20. package/dist/components/table/table-provider.js +1 -0
  21. package/dist/css/styles/tailwind.css +1 -1
  22. package/dist/index.d.ts +1 -0
  23. package/dist/index.js +56 -54
  24. package/dist/sample-resume.pdf +0 -0
  25. package/dist/types/components/pdf-preview/components/pdf-error-state.d.ts +9 -0
  26. package/dist/types/components/pdf-preview/components/pdf-loading-state.d.ts +3 -0
  27. package/dist/types/components/pdf-preview/components/pdf-toolbar.d.ts +16 -0
  28. package/dist/types/components/pdf-preview/components/pdf-viewer.d.ts +22 -0
  29. package/dist/types/components/pdf-preview/index.d.ts +3 -0
  30. package/dist/types/components/pdf-preview/pdf-preview.const.d.ts +29 -0
  31. package/dist/types/components/pdf-preview/pdf-preview.d.ts +16 -0
  32. package/dist/types/components/pdf-preview/pdf-preview.hook.d.ts +12 -0
  33. package/dist/types/components/pdf-preview/pdf-preview.type.d.ts +81 -0
  34. package/dist/types/components/primitives/table-card/table-card.type.d.ts +1 -0
  35. package/dist/types/index.d.ts +1 -0
  36. package/package.json +1 -1
@@ -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 p } 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";
@@ -57,59 +57,61 @@ import "../../z2map/components/map-controls.js";
57
57
  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
+ import "../../pdf-preview/pdf-preview.js";
60
61
  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,
62
+ const Ut = ({
63
+ dataSource: b,
64
+ schema: k,
65
+ loading: H,
66
+ emptyMessage: f,
67
+ className: j,
68
+ rounded: n = !0,
69
+ bordered: c = !0,
70
+ showHeader: P = !0,
71
+ headerClassName: T,
71
72
  search: s,
72
73
  filter: e,
73
- headerLeftContent: p,
74
- headerActions: h,
75
- body: o = {
74
+ headerLeftContent: h,
75
+ headerActions: u,
76
+ body: l = {
76
77
  cell: { hasBorder: !0 },
77
78
  className: "",
78
79
  stickyHeader: !0
79
80
  },
80
- showFooter: P = !0,
81
- footerClassName: T,
82
- pagination: l,
81
+ showFooter: C = !0,
82
+ footerClassName: _,
83
+ pagination: m,
83
84
  paginationInfo: i,
84
85
  paginationQuickJumper: a,
85
- error: u = !1,
86
- dataSourceError: _ = !1
86
+ footerInfo: d,
87
+ error: x = !1,
88
+ dataSourceError: R = !1
87
89
  }) => {
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: [
90
+ var w;
91
+ if (x)
92
+ 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: [
93
+ /* @__PURE__ */ t(q, { className: "mt-1.5" }),
94
+ /* @__PURE__ */ o("div", { className: "flex flex-col gap-2", children: [
93
95
  /* @__PURE__ */ t("div", { className: "text-text-error-primary text-lg font-medium", children: "Error loading data" }),
94
96
  /* @__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 })
97
+ typeof x == "string" && /* @__PURE__ */ t("div", { className: "text-text-warning-secondary text-sm", children: x })
96
98
  ] })
97
99
  ] }) });
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(
100
+ const N = a && a.totalPage && a.totalPage >= 2, v = m && m.totalPage && m.totalPage >= 2 || !!i || N || !!d, F = s || e || h || u, S = typeof (e == null ? void 0 : e.showFilterButton) > "u" ? !0 : e == null ? void 0 : e.showFilterButton;
101
+ return /* @__PURE__ */ o("div", { className: p("flex flex-col overflow-hidden relative", j), children: [
102
+ /* @__PURE__ */ o(r, { dataSource: b, schema: k, emptyMessage: f, children: [
103
+ P && F && /* @__PURE__ */ o(
102
104
  r.Header,
103
105
  {
104
- className: d(
106
+ className: p(
105
107
  "flex-shrink-0",
106
- n && "border-stroke-solid-medium border-1 border-b-0",
107
- c && "rounded-t-xl",
108
- j
108
+ c && "border-stroke-solid-medium border-1 border-b-0",
109
+ n && "rounded-t-xl",
110
+ T
109
111
  ),
110
112
  children: [
111
- /* @__PURE__ */ m(r.HeaderContent, { className: "overflow-x-auto p-[1px]", children: [
112
- p && p,
113
+ /* @__PURE__ */ o(r.HeaderContent, { className: "overflow-x-auto p-[1px]", children: [
114
+ h && h,
113
115
  s && /* @__PURE__ */ t(
114
116
  r.Search,
115
117
  {
@@ -122,8 +124,8 @@ const It = ({
122
124
  className: s.className
123
125
  }
124
126
  ),
125
- e && /* @__PURE__ */ m(
126
- x,
127
+ e && /* @__PURE__ */ o(
128
+ g,
127
129
  {
128
130
  filterSchema: e.filterSchema,
129
131
  filter: {
@@ -134,54 +136,57 @@ const It = ({
134
136
  loading: e.loading
135
137
  },
136
138
  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))
139
+ S && /* @__PURE__ */ t(g.FilterButton, {}),
140
+ (w = e == null ? void 0 : e.quickFilters) == null ? void 0 : w.map((B) => /* @__PURE__ */ t(g.FilterColumnButton, { filterName: B }, B))
139
141
  ]
140
142
  }
141
143
  )
142
144
  ] }),
143
- h && /* @__PURE__ */ t(r.HeaderContent, { children: h })
145
+ u && /* @__PURE__ */ t(r.HeaderContent, { children: u })
144
146
  ]
145
147
  }
146
148
  ),
147
149
  /* @__PURE__ */ t(
148
150
  r.Body,
149
151
  {
150
- dataSourceError: _,
151
- cell: o == null ? void 0 : o.cell,
152
- sort: o == null ? void 0 : o.sort,
153
- className: d(
152
+ dataSourceError: R,
153
+ cell: l == null ? void 0 : l.cell,
154
+ sort: l == null ? void 0 : l.sort,
155
+ className: p(
154
156
  "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
157
+ c && "border-stroke-solid-light border-1",
158
+ n && !(P && F) && "rounded-t-xl",
159
+ n && !(C && v) && "rounded-b-xl",
160
+ c && "[&_td:first-child]:border-l-0 [&_td:last-child]:border-r-0",
161
+ c && "[&_th:first-child]:border-l-0 [&_th:last-child]:border-r-0",
162
+ l == null ? void 0 : l.className
161
163
  ),
162
- stickyHeader: o == null ? void 0 : o.stickyHeader
164
+ stickyHeader: l == null ? void 0 : l.stickyHeader
163
165
  }
164
166
  ),
165
- P && C && /* @__PURE__ */ m(
167
+ C && v && /* @__PURE__ */ o(
166
168
  r.Footer,
167
169
  {
168
- className: d(
170
+ className: p(
169
171
  "flex-shrink-0 border-stroke-solid-light border-t-[1px] mt-[-2px]",
170
- n && "border",
171
- c && "rounded-b-xl",
172
- T
172
+ c && "border",
173
+ n && "rounded-b-xl",
174
+ _
173
175
  ),
174
176
  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: [
177
+ i ? /* @__PURE__ */ o(r.FooterContent, { children: [
178
+ /* @__PURE__ */ t(
179
+ r.PaginationInfo,
180
+ {
181
+ showTotal: i.showTotal,
182
+ totalItems: i.totalItems,
183
+ currentPage: i.currentPage,
184
+ itemsPerPage: i.itemsPerPage
185
+ }
186
+ ),
187
+ d
188
+ ] }) : d ? /* @__PURE__ */ t(r.FooterContent, { children: d }) : a || m ? /* @__PURE__ */ t(r.FooterContent, { children: null }) : null,
189
+ (a || m) && /* @__PURE__ */ o(r.FooterContent, { children: [
185
190
  N && /* @__PURE__ */ t(
186
191
  r.PaginationQuickJumper,
187
192
  {
@@ -192,14 +197,14 @@ const It = ({
192
197
  disabled: a.disabled
193
198
  }
194
199
  ),
195
- l && /* @__PURE__ */ t(
200
+ m && /* @__PURE__ */ t(
196
201
  r.Pagination,
197
202
  {
198
- currentPage: l.currentPage,
199
- totalPage: l.totalPage,
200
- onChange: l.onChange || (() => {
203
+ currentPage: m.currentPage,
204
+ totalPage: m.totalPage,
205
+ onChange: m.onChange || (() => {
201
206
  }),
202
- totalItems: l.totalItems
207
+ totalItems: m.totalItems
203
208
  }
204
209
  )
205
210
  ] })
@@ -207,12 +212,12 @@ const It = ({
207
212
  }
208
213
  )
209
214
  ] }),
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: [
215
+ 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
216
  /* @__PURE__ */ t("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-text-brand-secondary" }),
212
217
  /* @__PURE__ */ t("p", { className: "text-text-neutral-primary font-medium", children: "Loading..." })
213
218
  ] }) })
214
219
  ] });
215
220
  };
216
221
  export {
217
- It as default
222
+ Ut as default
218
223
  };
@@ -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;
@@ -57,7 +57,8 @@ import "../../../z2map/components/map-controls.js";
57
57
  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
- const ht = ({
60
+ import "../../../pdf-preview/pdf-preview.js";
61
+ const Nt = ({
61
62
  avatar: m,
62
63
  value: a,
63
64
  rightIcon: o,
@@ -95,5 +96,5 @@ const ht = ({
95
96
  }
96
97
  );
97
98
  export {
98
- ht as AvatarCell
99
+ Nt as AvatarCell
99
100
  };
@@ -62,6 +62,7 @@ import "../z2map/components/map-controls.js";
62
62
  import "../z2map/components/map-zoom-control.js";
63
63
  import "../z2map/components/map-style-control.js";
64
64
  import "../kpi-card/kpi-card.js";
65
+ import "../pdf-preview/pdf-preview.js";
65
66
  import { TableHeaderWrapper as T } from "./components/table-header-wrapper.js";
66
67
  import { TableHeaderContent as b } from "./components/table-header-content.js";
67
68
  import { TableFooter as s } from "./components/table-footer.js";