@ztwoint/z-ui 0.1.125 → 0.1.127

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 (85) hide show
  1. package/dist/components/dynamic-table/z2-table-pagination.js +22 -15
  2. package/dist/components/primitives/chart-card/builders/chart-builder-factory.js +17 -0
  3. package/dist/components/{chart-card → primitives/chart-card}/chart-card.js +2 -2
  4. package/dist/components/primitives/chart-card/config/colors.js +39 -0
  5. package/dist/components/primitives/popconfirm/popconfirm.const.d.ts +20 -0
  6. package/dist/components/primitives/popconfirm/popconfirm.const.js +22 -0
  7. package/dist/components/primitives/popconfirm/popconfirm.d.ts +4 -0
  8. package/dist/components/primitives/popconfirm/popconfirm.hook.d.ts +14 -0
  9. package/dist/components/primitives/popconfirm/popconfirm.hook.js +32 -0
  10. package/dist/components/primitives/popconfirm/popconfirm.js +78 -0
  11. package/dist/components/primitives/popconfirm/popconfirm.type.d.ts +24 -0
  12. package/dist/components/primitives/popconfirm/popconfirm.utils.d.ts +3 -0
  13. package/dist/components/primitives/popconfirm/popconfirm.utils.js +6 -0
  14. package/dist/components/primitives/select-compact/select-compact.js +17 -0
  15. package/dist/components/{table-card → primitives/table-card}/table-card.type.d.ts +3 -3
  16. package/dist/components/table/components/cell/avatar-cell.js +4 -4
  17. package/dist/components/table/table-provider.js +4 -4
  18. package/dist/components/table-filter/table-filter.context.js +3 -12
  19. package/dist/css/styles/tailwind.css +1 -1
  20. package/dist/index.d.ts +4 -3
  21. package/dist/index.js +346 -362
  22. package/dist/types/components/primitives/popconfirm/popconfirm.const.d.ts +20 -0
  23. package/dist/types/components/primitives/popconfirm/popconfirm.d.ts +4 -0
  24. package/dist/types/components/primitives/popconfirm/popconfirm.hook.d.ts +14 -0
  25. package/dist/types/components/primitives/popconfirm/popconfirm.type.d.ts +24 -0
  26. package/dist/types/components/primitives/popconfirm/popconfirm.utils.d.ts +3 -0
  27. package/dist/types/components/{table-card → primitives/table-card}/table-card.type.d.ts +4 -4
  28. package/dist/types/index.d.ts +4 -3
  29. package/package.json +1 -1
  30. package/dist/components/chart-card/builders/chart-builder-factory.js +0 -23
  31. package/dist/components/chart-card/config/colors.js +0 -49
  32. package/dist/components/select-compact/select-compact.js +0 -17
  33. package/dist/components/table-card/table-card.js +0 -215
  34. package/dist/components/table-filter/close-filter-confirm/filter-confirmation-dialog.js +0 -20
  35. package/dist/components/table-filter/close-filter-confirm/filter-confirmation-dialog.utils.js +0 -20
  36. package/dist/components/table-filter/filters/boolean.js +0 -67
  37. package/dist/components/table-filter/filters/checkbox.js +0 -70
  38. package/dist/components/table-filter/filters/number/filter-input-field.js +0 -38
  39. package/dist/components/table-filter/filters/number/number.hook.js +0 -33
  40. package/dist/components/table-filter/filters/number/number.js +0 -55
  41. package/dist/components/table-filter/filters/text.js +0 -50
  42. package/dist/components/table-filter/index.js +0 -11
  43. package/dist/components/table-filter/selected-filters-display/selected-filters-display.js +0 -31
  44. package/dist/components/table-filter/selected-filters-display/selected-filters-display.utils.js +0 -23
  45. package/dist/components/table-filter/table-filter-button.js +0 -181
  46. package/dist/components/table-filter/table-filter-column-button.js +0 -113
  47. package/dist/components/table-filter/table-filter-provider.js +0 -32
  48. package/dist/components/table-filter/table-filter.hook.js +0 -72
  49. package/dist/components/table-filter/table-filter.utils.js +0 -12
  50. /package/dist/components/{chart-card → primitives/chart-card}/builders/bar-chart-builder.d.ts +0 -0
  51. /package/dist/components/{chart-card → primitives/chart-card}/builders/bar-chart-builder.js +0 -0
  52. /package/dist/components/{chart-card → primitives/chart-card}/builders/chart-builder-factory.d.ts +0 -0
  53. /package/dist/components/{chart-card → primitives/chart-card}/builders/line-chart-builder.d.ts +0 -0
  54. /package/dist/components/{chart-card → primitives/chart-card}/builders/line-chart-builder.js +0 -0
  55. /package/dist/components/{chart-card → primitives/chart-card}/builders/pie-chart-builder.d.ts +0 -0
  56. /package/dist/components/{chart-card → primitives/chart-card}/builders/pie-chart-builder.js +0 -0
  57. /package/dist/components/{chart-card → primitives/chart-card}/chart-card-states.d.ts +0 -0
  58. /package/dist/components/{chart-card → primitives/chart-card}/chart-card-states.js +0 -0
  59. /package/dist/components/{chart-card → primitives/chart-card}/chart-card.config.types.d.ts +0 -0
  60. /package/dist/components/{chart-card → primitives/chart-card}/chart-card.d.ts +0 -0
  61. /package/dist/components/{chart-card → primitives/chart-card}/chart-card.types.d.ts +0 -0
  62. /package/dist/components/{chart-card → primitives/chart-card}/config/colors.d.ts +0 -0
  63. /package/dist/components/{chart-card → primitives/chart-card}/config/defaults.d.ts +0 -0
  64. /package/dist/components/{chart-card → primitives/chart-card}/config/defaults.js +0 -0
  65. /package/dist/components/{chart-card → primitives/chart-card}/index.d.ts +0 -0
  66. /package/dist/components/{chart-card → primitives/chart-card}/validators/config-validator.d.ts +0 -0
  67. /package/dist/components/{chart-card → primitives/chart-card}/validators/config-validator.js +0 -0
  68. /package/dist/components/{select-compact → primitives/select-compact}/select-compact.d.ts +0 -0
  69. /package/dist/components/{table-card → primitives/table-card}/index.d.ts +0 -0
  70. /package/dist/components/{table-card → primitives/table-card}/table-card.d.ts +0 -0
  71. /package/dist/types/components/{chart-card → primitives/chart-card}/builders/bar-chart-builder.d.ts +0 -0
  72. /package/dist/types/components/{chart-card → primitives/chart-card}/builders/chart-builder-factory.d.ts +0 -0
  73. /package/dist/types/components/{chart-card → primitives/chart-card}/builders/line-chart-builder.d.ts +0 -0
  74. /package/dist/types/components/{chart-card → primitives/chart-card}/builders/pie-chart-builder.d.ts +0 -0
  75. /package/dist/types/components/{chart-card → primitives/chart-card}/chart-card-states.d.ts +0 -0
  76. /package/dist/types/components/{chart-card → primitives/chart-card}/chart-card.config.types.d.ts +0 -0
  77. /package/dist/types/components/{chart-card → primitives/chart-card}/chart-card.d.ts +0 -0
  78. /package/dist/types/components/{chart-card → primitives/chart-card}/chart-card.types.d.ts +0 -0
  79. /package/dist/types/components/{chart-card → primitives/chart-card}/config/colors.d.ts +0 -0
  80. /package/dist/types/components/{chart-card → primitives/chart-card}/config/defaults.d.ts +0 -0
  81. /package/dist/types/components/{chart-card → primitives/chart-card}/index.d.ts +0 -0
  82. /package/dist/types/components/{chart-card → primitives/chart-card}/validators/config-validator.d.ts +0 -0
  83. /package/dist/types/components/{select-compact → primitives/select-compact}/select-compact.d.ts +0 -0
  84. /package/dist/types/components/{table-card → primitives/table-card}/index.d.ts +0 -0
  85. /package/dist/types/components/{table-card → primitives/table-card}/table-card.d.ts +0 -0
@@ -0,0 +1,20 @@
1
+ export declare const POPCONFIRM_PLACEMENTS: {
2
+ readonly TOP: "top";
3
+ readonly TOP_LEFT: "topLeft";
4
+ readonly TOP_RIGHT: "topRight";
5
+ readonly BOTTOM: "bottom";
6
+ readonly BOTTOM_LEFT: "bottomLeft";
7
+ readonly BOTTOM_RIGHT: "bottomRight";
8
+ readonly LEFT: "left";
9
+ readonly LEFT_TOP: "leftTop";
10
+ readonly LEFT_BOTTOM: "leftBottom";
11
+ readonly RIGHT: "right";
12
+ readonly RIGHT_TOP: "rightTop";
13
+ readonly RIGHT_BOTTOM: "rightBottom";
14
+ };
15
+ export type PopconfirmPlacement = (typeof POPCONFIRM_PLACEMENTS)[keyof typeof POPCONFIRM_PLACEMENTS];
16
+ export declare const POPCONFIRM_DEFAULT_CONFIG: {
17
+ readonly okText: "OK";
18
+ readonly cancelText: "Cancel";
19
+ readonly placement: PopconfirmPlacement;
20
+ };
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { PopconfirmProps } from './popconfirm.type';
3
+ declare const Popconfirm: React.FC<PopconfirmProps>;
4
+ export { Popconfirm };
@@ -0,0 +1,14 @@
1
+ interface UsePopconfirmProps {
2
+ open?: boolean;
3
+ onOpenChange?: (open: boolean) => void;
4
+ onConfirm?: () => void | Promise<void>;
5
+ onCancel?: () => void;
6
+ }
7
+ export declare const usePopconfirm: (props: UsePopconfirmProps) => {
8
+ open: boolean;
9
+ confirmLoading: boolean;
10
+ handleOpenChange: (newOpen: boolean) => void;
11
+ handleConfirm: () => Promise<void>;
12
+ handleCancel: () => void;
13
+ };
14
+ export {};
@@ -0,0 +1,24 @@
1
+ import { ReactNode } from 'react';
2
+ import { PopconfirmPlacement } from './popconfirm.const';
3
+ export interface PopconfirmProps {
4
+ title: ReactNode;
5
+ children: ReactNode;
6
+ onConfirm?: () => void | Promise<void>;
7
+ onCancel?: () => void;
8
+ okText?: string;
9
+ cancelText?: string;
10
+ placement?: PopconfirmPlacement;
11
+ open?: boolean;
12
+ onOpenChange?: (open: boolean) => void;
13
+ disabled?: boolean;
14
+ okButtonProps?: {
15
+ loading?: boolean;
16
+ disabled?: boolean;
17
+ className?: string;
18
+ };
19
+ cancelButtonProps?: {
20
+ disabled?: boolean;
21
+ className?: string;
22
+ };
23
+ className?: string;
24
+ }
@@ -0,0 +1,3 @@
1
+ import { PopconfirmPlacement } from './popconfirm.const';
2
+ export declare const mapPlacementToRadixSide: (placement: PopconfirmPlacement) => "top" | "bottom" | "left" | "right";
3
+ export declare const mapPlacementToRadixAlign: (placement: PopconfirmPlacement) => "start" | "center" | "end";
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { TableProps, TableSchema, TableSearch, TableSort } from '../table/table.type';
3
- import { TableFilter, FilterRule } from '../table-filter/table-filter.type';
4
- import { PaginationProps, PaginationInfoProps, PaginationQuickJumperProps } from '../table/components/pagination/pagination.type';
5
- import { FilterSchema } from '../table-filter/table-filter.type';
2
+ import { TableProps, TableSchema, TableSearch, TableSort } from '../../table/table.type';
3
+ import { TableFilter, FilterRule } from '../../table-filter/table-filter.type';
4
+ import { PaginationProps, PaginationInfoProps, PaginationQuickJumperProps } from '../../table/components/pagination/pagination.type';
5
+ import { FilterSchema } from '../../table-filter/table-filter.type';
6
6
  export interface TableCardProps {
7
7
  dataSource: Record<string, unknown>[];
8
8
  schema: TableSchema;
@@ -11,13 +11,13 @@ export * from './components/file-upload-area';
11
11
  export * from './components/input/input';
12
12
  export * from './components/nav-header';
13
13
  export * from './components/select/z2-select';
14
- export * from './components/select-compact/select-compact';
14
+ export * from './components/primitives/select-compact/select-compact';
15
15
  export * from './components/stepper';
16
16
  export * from './components/stepper-item/stepper-item';
17
17
  export * from './components/tab/tab';
18
18
  export * from './components/table';
19
19
  export * from './components/tooltip/tooltip';
20
- export * from './components/table-card';
20
+ export * from './components/primitives/table-card/table-card';
21
21
  export * from './components/badge/badge';
22
22
  export * from './components/avatar/avatar';
23
23
  export * from './components/text-preset/text-preset';
@@ -28,9 +28,10 @@ export * from './components/radio/z2-radio';
28
28
  export * from './components/assets/icons';
29
29
  export * from './components/segmented-control';
30
30
  export * from './components/popover/popover';
31
+ export * from './components/primitives/popconfirm/popconfirm';
31
32
  export * from './components/dynamic-table';
32
33
  export * from './components/chart';
33
- export * from './components/chart-card';
34
+ export * from './components/primitives/chart-card/chart-card';
34
35
  export * from './components/radio-card/radio-card';
35
36
  export * from './components/z2map';
36
37
  export * from './lib/theme.hook';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztwoint/z-ui",
3
- "version": "0.1.125",
3
+ "version": "0.1.127",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -1,23 +0,0 @@
1
- import { buildBarChartOptions as p } from "./bar-chart-builder.js";
2
- import { buildLineChartOptions as n } from "./line-chart-builder.js";
3
- import { buildPieChartOptions as a } from "./pie-chart-builder.js";
4
- const s = {
5
- line: n,
6
- bar: p,
7
- pie: a
8
- };
9
- function h(r, i, e, o) {
10
- const t = s[r.type];
11
- if (!t)
12
- throw new Error(`Unsupported chart type: ${r.type}`);
13
- return t(r, i, e, o);
14
- }
15
- function l(r) {
16
- return r === "line" || r === "bar" || r === "pie";
17
- }
18
- const m = ["line", "bar", "pie"];
19
- export {
20
- h as buildChartOptions,
21
- l as isChartTypeSupported,
22
- m as registeredChartTypes
23
- };
@@ -1,49 +0,0 @@
1
- const d = {
2
- default: ["#2563eb", "#7c3aed", "#d97706", "#16a34a", "#dc2626", "#0284c7"],
3
- brand: ["#2563eb", "#3b82f6", "#1d4ed8", "#60a5fa"],
4
- success: ["#16a34a", "#22c55e", "#15803d", "#4ade80"],
5
- warning: ["#d97706", "#f59e0b", "#b45309", "#fbbf24"],
6
- danger: ["#dc2626", "#ef4444", "#b91c1c", "#f87171"],
7
- purple: ["#7c3aed", "#8b5cf6", "#6d28d9", "#a78bfa"],
8
- neutral: ["#5d5d5d", "#6d6d6d", "#4f4f4f", "#888888"]
9
- }, t = {
10
- basic: d.default,
11
- smooth: ["#1d4ed8", "#38bdf8", "#22d3ee", "#6366f1"]
12
- }, b = {
13
- basic: d.default,
14
- stacked: ["#0284c7", "#38bdf8", "#60a5fa", "#93c5fd"]
15
- }, E = {
16
- basic: d.default,
17
- donut: ["#2563eb", "#7c3aed", "#d97706", "#16a34a", "#dc2626", "#0284c7", "#8b5cf6", "#f59e0b"]
18
- }, n = {
19
- line: t,
20
- bar: b,
21
- pie: E
22
- }, r = {
23
- text: {
24
- primary: "#000000",
25
- secondary: "#5d5d5d",
26
- muted: "#888888"
27
- },
28
- border: {
29
- light: "#e7e7e7",
30
- default: "#d1d1d1",
31
- medium: "#b0b0b0"
32
- },
33
- background: {
34
- default: "#ffffff",
35
- light: "#fafafa",
36
- medium: "#f6f6f6"
37
- }
38
- };
39
- function u(a, f) {
40
- var e;
41
- const c = ((e = n[a]) == null ? void 0 : e[f]) ?? d.default;
42
- return Array.from(c);
43
- }
44
- export {
45
- n as CHART_THEME_PALETTES,
46
- d as COLOR_PALETTES,
47
- r as UI_COLORS,
48
- u as getThemePalette
49
- };
@@ -1,17 +0,0 @@
1
- import { jsxs as u, jsx as e } from "react/jsx-runtime";
2
- import { Z2Select as i, Z2SelectTrigger as m, Z2SelectValue as S, Z2SelectContent as Z, Z2SelectItem as d } from "../select/z2-select.js";
3
- function f({
4
- value: t,
5
- onChange: c,
6
- options: r,
7
- placeholder: a = "Select field",
8
- className: n
9
- }) {
10
- return /* @__PURE__ */ u(i, { value: t || "", onValueChange: c, children: [
11
- /* @__PURE__ */ e(m, { className: n, children: /* @__PURE__ */ e(S, { placeholder: a }) }),
12
- /* @__PURE__ */ e(Z, { children: r.map((l) => /* @__PURE__ */ e(d, { value: l.value, children: l.label }, l.value)) })
13
- ] });
14
- }
15
- export {
16
- f as Z2SelectCompact
17
- };
@@ -1,215 +0,0 @@
1
- import { jsx as t, jsxs as m } from "react/jsx-runtime";
2
- import { Table as r } from "../table/table-provider.js";
3
- import "react";
4
- import { cn as d } from "../../lib/utils.js";
5
- /* empty css */
6
- import "../alert/alert.const.js";
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-checkbox";
21
- import "@radix-ui/react-dialog";
22
- import "../dropdown/z2-dropdown.js";
23
- import "@radix-ui/react-dropdown-menu";
24
- import "lucide-react";
25
- import S from "../assets/icons/octagon-warning-Copy.js";
26
- import "../input/input.js";
27
- import "../nav-header/nav-header.js";
28
- import "../nav-header/nav-item/nav-item.js";
29
- import "@radix-ui/react-select";
30
- import "../stepper/stepper.js";
31
- import "../stepper-item/stepper-item.js";
32
- import "@radix-ui/react-tabs";
33
- import "../tooltip/tooltip.js";
34
- import { Filter as x } from "../table-filter/index.js";
35
- import "../badge/badge.js";
36
- import "../avatar/avatar.js";
37
- import "../text-preset/text-preset.js";
38
- import "react-dom";
39
- import "../../node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/count-events-for-safari.js";
40
- import "../../node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/dispatch-consumer-event.js";
41
- import "@radix-ui/react-slot";
42
- import "../radio/z2-radio.js";
43
- import "../segmented-control/item.js";
44
- import "@radix-ui/react-popover";
45
- import "../dynamic-table/z2-table.js";
46
- import "../dynamic-table/z2-table-context.js";
47
- import "../chart/chart.js";
48
- import "../chart-card/config/defaults.js";
49
- import "../chart-card/config/colors.js";
50
- import "../z2map/map.js";
51
- import "../z2map/map.constants.js";
52
- import "../z2map/components/map-pin.js";
53
- import "../z2map/components/map-pin-content.js";
54
- import "../z2map/components/map-controls.js";
55
- import "../z2map/components/map-zoom-control.js";
56
- import "../z2map/components/map-style-control.js";
57
- import "../table/table.context.js";
58
- const zt = ({
59
- dataSource: w,
60
- schema: B,
61
- loading: b,
62
- emptyMessage: k,
63
- className: H,
64
- rounded: c = !0,
65
- bordered: n = !0,
66
- showHeader: g = !0,
67
- headerClassName: j,
68
- search: a,
69
- filter: e,
70
- headerLeftContent: h,
71
- headerActions: p,
72
- body: l = {
73
- cell: { hasBorder: !0 },
74
- className: "",
75
- stickyHeader: !0
76
- },
77
- showFooter: P = !0,
78
- footerClassName: T,
79
- pagination: o,
80
- paginationInfo: i,
81
- paginationQuickJumper: s,
82
- error: u = !1,
83
- dataSourceError: _ = !1
84
- }) => {
85
- var F;
86
- if (u)
87
- 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: [
88
- /* @__PURE__ */ t(S, { className: "mt-1.5" }),
89
- /* @__PURE__ */ m("div", { className: "flex flex-col gap-2", children: [
90
- /* @__PURE__ */ t("div", { className: "text-text-error-primary text-lg font-medium", children: "Error loading data" }),
91
- /* @__PURE__ */ t("div", { className: "text-sm", children: "Please try again later" }),
92
- typeof u == "string" && /* @__PURE__ */ t("div", { className: "text-text-warning-secondary text-sm", children: u })
93
- ] })
94
- ] }) });
95
- const C = s && s.totalPage && s.totalPage >= 2, N = o && o.totalPage && o.totalPage >= 2 || !!i || C, v = a || e || h || p, R = typeof (e == null ? void 0 : e.showFilterButton) > "u" ? !0 : e == null ? void 0 : e.showFilterButton;
96
- return /* @__PURE__ */ m("div", { className: d("flex flex-col overflow-hidden relative", H), children: [
97
- /* @__PURE__ */ m(r, { dataSource: w, schema: B, emptyMessage: k, children: [
98
- g && v && /* @__PURE__ */ m(
99
- r.Header,
100
- {
101
- className: d(
102
- "flex-shrink-0",
103
- n && "border-stroke-solid-medium border-1 border-b-0",
104
- c && "rounded-t-xl",
105
- j
106
- ),
107
- children: [
108
- /* @__PURE__ */ m(r.HeaderContent, { children: [
109
- h && h,
110
- a && /* @__PURE__ */ t(
111
- r.Search,
112
- {
113
- search: {
114
- value: a.value || "",
115
- onChange: a.onChange || (() => {
116
- }),
117
- placeholder: a.placeholder
118
- },
119
- className: a.className
120
- }
121
- ),
122
- e && /* @__PURE__ */ m(
123
- x,
124
- {
125
- filterSchema: e.filterSchema,
126
- filter: {
127
- value: e.value || [],
128
- onChange: e.onChange || (() => {
129
- }),
130
- onFilterClick: e.onFilterClick,
131
- loading: e.loading
132
- },
133
- children: [
134
- R && /* @__PURE__ */ t(x.FilterButton, {}),
135
- (F = e == null ? void 0 : e.quickFilters) == null ? void 0 : F.map((f) => /* @__PURE__ */ t(x.FilterColumnButton, { filterName: f }, f))
136
- ]
137
- }
138
- )
139
- ] }),
140
- p && /* @__PURE__ */ t(r.HeaderContent, { children: p })
141
- ]
142
- }
143
- ),
144
- /* @__PURE__ */ t(
145
- r.Body,
146
- {
147
- dataSourceError: _,
148
- cell: l == null ? void 0 : l.cell,
149
- sort: l == null ? void 0 : l.sort,
150
- className: d(
151
- "flex-1 min-h-0",
152
- n && "border-stroke-solid-light border-1",
153
- c && !(g && v) && "rounded-t-xl",
154
- c && !(P && N) && "rounded-b-xl",
155
- n && "[&_td:first-child]:border-l-0 [&_td:last-child]:border-r-0",
156
- n && "[&_th:first-child]:border-l-0 [&_th:last-child]:border-r-0",
157
- l == null ? void 0 : l.className
158
- ),
159
- stickyHeader: l == null ? void 0 : l.stickyHeader
160
- }
161
- ),
162
- P && N && /* @__PURE__ */ m(
163
- r.Footer,
164
- {
165
- className: d(
166
- "flex-shrink-0 border-stroke-solid-light border-t-[0.5px] mt-[-2px]",
167
- n && "border",
168
- c && "rounded-b-xl",
169
- T
170
- ),
171
- children: [
172
- i ? /* @__PURE__ */ t(r.FooterContent, { children: /* @__PURE__ */ t(
173
- r.PaginationInfo,
174
- {
175
- showTotal: i.showTotal,
176
- totalItems: i.totalItems,
177
- currentPage: i.currentPage,
178
- itemsPerPage: i.itemsPerPage
179
- }
180
- ) }) : s || o ? /* @__PURE__ */ t(r.FooterContent, { children: null }) : null,
181
- (s || o) && /* @__PURE__ */ m(r.FooterContent, { children: [
182
- C && /* @__PURE__ */ t(
183
- r.PaginationQuickJumper,
184
- {
185
- currentPage: s.currentPage,
186
- totalPage: s.totalPage,
187
- onChange: s.onChange || (() => {
188
- }),
189
- disabled: s.disabled
190
- }
191
- ),
192
- o && /* @__PURE__ */ t(
193
- r.Pagination,
194
- {
195
- currentPage: o.currentPage,
196
- totalPage: o.totalPage,
197
- onChange: o.onChange || (() => {
198
- }),
199
- totalItems: o.totalItems
200
- }
201
- )
202
- ] })
203
- ]
204
- }
205
- )
206
- ] }),
207
- 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: [
208
- /* @__PURE__ */ t("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-text-brand-secondary" }),
209
- /* @__PURE__ */ t("p", { className: "text-text-neutral-primary font-medium", children: "Loading..." })
210
- ] }) })
211
- ] });
212
- };
213
- export {
214
- zt as default
215
- };
@@ -1,20 +0,0 @@
1
- import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
- import { Button as r } from "../../button/button.js";
3
- import { Z2Dialog as a, Z2DialogContent as t, Z2DialogHeader as s, Z2DialogTitle as d, Z2DialogDescription as h, Z2DialogFooter as c } from "../../dialog/dialog.js";
4
- const u = ({
5
- onClose: l,
6
- onRevertChanges: n,
7
- onApplyChanges: o
8
- }) => /* @__PURE__ */ e(a, { open: !0, onOpenChange: l, children: /* @__PURE__ */ i(t, { className: "max-w-md p-4 rounded-2xl", children: [
9
- /* @__PURE__ */ i(s, { children: [
10
- /* @__PURE__ */ e("div", { className: "flex justify-between", children: /* @__PURE__ */ e(d, { children: "Unsaved Filter Changes" }) }),
11
- /* @__PURE__ */ e(h, { children: "You have unsaved filter changes. Would you like to keep these changes or revert to the previous state?" })
12
- ] }),
13
- /* @__PURE__ */ i(c, { children: [
14
- /* @__PURE__ */ e(r, { onClick: n, variant: "stroke", shade: "danger", size: "small", children: "Discard" }),
15
- /* @__PURE__ */ e(r, { onClick: o, variant: "filled", shade: "brand", size: "small", children: "Apply Changes" })
16
- ] })
17
- ] }) });
18
- export {
19
- u as FilterConfirmationDialog
20
- };
@@ -1,20 +0,0 @@
1
- const v = (u, t) => {
2
- if (u.length !== t.length)
3
- return !1;
4
- const i = [...u].sort((r, l) => r.field.localeCompare(l.field)), e = [...t].sort((r, l) => r.field.localeCompare(l.field));
5
- return i.every((r, l) => {
6
- const a = e[l];
7
- return r.field !== a.field || r.condition !== a.condition ? !1 : Array.isArray(r.value) && Array.isArray(a.value) ? r.value.length !== a.value.length ? !1 : r.value.every((n, s) => n === a.value[s]) : Array.isArray(r.value) || Array.isArray(a.value) ? !1 : r.value === a.value;
8
- });
9
- }, o = (u, t) => {
10
- const i = u.filter((e) => Array.isArray(e.value) ? e.value.length > 0 : e.value !== "");
11
- return !v(i, t);
12
- }, y = (u, t, i) => {
13
- const e = t.find((n) => n.field === u), r = i.find((n) => n.field === u), l = e && (Array.isArray(e.value) ? e.value.length > 0 : e.value !== ""), a = r && (Array.isArray(r.value) ? r.value.length > 0 : r.value !== "");
14
- return !l && a || l && !a ? !0 : !l && !a ? !1 : l && a && e && r ? e.condition !== r.condition ? !0 : Array.isArray(e.value) && Array.isArray(r.value) ? e.value.length !== r.value.length ? !0 : !e.value.every((n, s) => n === r.value[s]) : Array.isArray(e.value) || Array.isArray(r.value) ? !0 : e.value !== r.value : !1;
15
- };
16
- export {
17
- v as areFiltersEqual,
18
- o as hasUnsavedFilterChanges,
19
- y as hasUnsavedFilterChangesForColumn
20
- };
@@ -1,67 +0,0 @@
1
- import { jsx as r, jsxs as t } from "react/jsx-runtime";
2
- const c = ({ value: e, onChange: l }) => {
3
- const i = (s, d) => {
4
- l(d ? { value: s } : { value: "" });
5
- };
6
- return /* @__PURE__ */ r("div", { className: "w-full", children: /* @__PURE__ */ t("div", { className: "p-4 space-y-3", children: [
7
- /* @__PURE__ */ t("label", { className: "flex items-center p-3 rounded-lg border border-stroke-solid-light hover:border-stroke-solid-medium hover:bg-gray-50 transition-all duration-200 cursor-pointer group", children: [
8
- /* @__PURE__ */ t("div", { className: "relative", children: [
9
- /* @__PURE__ */ r(
10
- "input",
11
- {
12
- type: "checkbox",
13
- checked: (e == null ? void 0 : e.value) === "true",
14
- onChange: (s) => i("true", s.target.checked),
15
- className: "w-5 h-5 rounded border-2 border-stroke-solid-medium text-blue-600 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors duration-200"
16
- }
17
- ),
18
- (e == null ? void 0 : e.value) === "true" && /* @__PURE__ */ r("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ r("svg", { className: "w-3 h-3 text-white", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ r(
19
- "path",
20
- {
21
- fillRule: "evenodd",
22
- d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
23
- clipRule: "evenodd"
24
- }
25
- ) }) })
26
- ] }),
27
- /* @__PURE__ */ t("div", { className: "ml-3 flex-1", children: [
28
- /* @__PURE__ */ t("div", { className: "flex items-center", children: [
29
- /* @__PURE__ */ r("span", { className: "text-sm font-medium text-text-neutral-primary", children: "True" }),
30
- (e == null ? void 0 : e.value) === "true" && /* @__PURE__ */ r("span", { className: "ml-2 inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800", children: "Selected" })
31
- ] }),
32
- /* @__PURE__ */ r("p", { className: "text-xs text-text-neutral-secondary mt-0.5", children: "Include records with true values" })
33
- ] })
34
- ] }),
35
- /* @__PURE__ */ t("label", { className: "flex items-center p-3 rounded-lg border border-stroke-solid-light hover:border-stroke-solid-medium hover:bg-gray-50 transition-all duration-200 cursor-pointer group", children: [
36
- /* @__PURE__ */ t("div", { className: "relative", children: [
37
- /* @__PURE__ */ r(
38
- "input",
39
- {
40
- type: "checkbox",
41
- checked: (e == null ? void 0 : e.value) === "false",
42
- onChange: (s) => i("false", s.target.checked),
43
- className: "w-5 h-5 rounded border-2 border-stroke-solid-medium text-blue-600 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors duration-200"
44
- }
45
- ),
46
- (e == null ? void 0 : e.value) === "false" && /* @__PURE__ */ r("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ r("svg", { className: "w-3 h-3 text-white", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ r(
47
- "path",
48
- {
49
- fillRule: "evenodd",
50
- d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
51
- clipRule: "evenodd"
52
- }
53
- ) }) })
54
- ] }),
55
- /* @__PURE__ */ t("div", { className: "ml-3 flex-1", children: [
56
- /* @__PURE__ */ t("div", { className: "flex items-center", children: [
57
- /* @__PURE__ */ r("span", { className: "text-sm font-medium text-text-neutral-primary", children: "False" }),
58
- (e == null ? void 0 : e.value) === "false" && /* @__PURE__ */ r("span", { className: "ml-2 inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800", children: "Selected" })
59
- ] }),
60
- /* @__PURE__ */ r("p", { className: "text-xs text-text-neutral-secondary mt-0.5", children: "Include records with false values" })
61
- ] })
62
- ] })
63
- ] }) });
64
- };
65
- export {
66
- c as default
67
- };
@@ -1,70 +0,0 @@
1
- import { jsx as t, jsxs as s } from "react/jsx-runtime";
2
- import { useState as d, useEffect as h } from "react";
3
- import { Virtuoso as k } from "react-virtuoso";
4
- import { MagnifierIcon as y } from "../../assets/icons/magnifier-icon.js";
5
- import S from "../../assets/icons/x.js";
6
- import { Z2Checkbox as w } from "../../checkbox/checkbox.js";
7
- const E = ({ value: n, onChange: f, filterOptions: r = [] }) => {
8
- const [c, o] = d([]), [m, u] = d(""), [x, i] = d(r), p = (l) => {
9
- u(l.target.value);
10
- const e = r.filter(
11
- (a) => a.label.toLowerCase().includes(l.target.value.toLowerCase())
12
- );
13
- i(e);
14
- };
15
- h(() => {
16
- n && Array.isArray(n.value) ? o(n.value.filter(Boolean) ?? []) : o([]);
17
- }, [n]), h(() => {
18
- i(r);
19
- }, [r]);
20
- const b = (l, e) => {
21
- let a;
22
- e ? a = [...c, l] : a = c.filter((N) => N !== l), o(a), f({ value: a });
23
- }, C = () => {
24
- u(""), i(r);
25
- }, g = (l) => c.includes(l), v = (l, e) => /* @__PURE__ */ s("div", { className: "flex justify-between items-center py-2 px-3", children: [
26
- /* @__PURE__ */ s("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
27
- /* @__PURE__ */ t(
28
- w,
29
- {
30
- checked: g(e.value),
31
- onCheckedChange: (a) => b(e.value, a === !0)
32
- }
33
- ),
34
- /* @__PURE__ */ t("span", { className: "text-text-neutral-primary leading-none-medium-sm", children: e.label })
35
- ] }),
36
- e.total && /* @__PURE__ */ s("span", { className: "text-text-neutral-muted text-sm", children: [
37
- "[",
38
- e.total,
39
- "]"
40
- ] })
41
- ] });
42
- return r.length === 0 ? /* @__PURE__ */ t("div", { className: "text-text-neutral-muted text-sm p-4", children: "No filter options available for this column" }) : /* @__PURE__ */ s("div", { className: "flex flex-col h-full", children: [
43
- /* @__PURE__ */ s("div", { className: "relative border-b border-stroke-solid-medium", children: [
44
- /* @__PURE__ */ t(y, { className: "absolute left-3 top-3.5 text-text-neutral-muted" }),
45
- /* @__PURE__ */ t(
46
- "input",
47
- {
48
- placeholder: "Search options",
49
- value: m,
50
- onChange: p,
51
- className: "border-none outline-none bg-surface-neutral-default text-text-neutral-primary rounded p-3 pl-8 leading-none-medium-sm w-full"
52
- }
53
- ),
54
- m && /* @__PURE__ */ t("span", { className: "absolute right-3 top-3.5", onClick: C, children: /* @__PURE__ */ t(S, {}) })
55
- ] }),
56
- /* @__PURE__ */ t("div", { className: "flex-1", children: /* @__PURE__ */ t(
57
- k,
58
- {
59
- data: x,
60
- itemContent: v,
61
- className: "h-full min-h-60",
62
- style: { height: "100%" },
63
- overscan: 5
64
- }
65
- ) })
66
- ] });
67
- };
68
- export {
69
- E as default
70
- };
@@ -1,38 +0,0 @@
1
- import { jsxs as a, jsx as t } from "react/jsx-runtime";
2
- import i from "../../../assets/icons/x.js";
3
- const d = ({
4
- label: l,
5
- operator: n,
6
- value: e,
7
- onChange: o,
8
- onReset: s,
9
- disabled: r,
10
- placeholder: m = "0.00"
11
- }) => /* @__PURE__ */ a("div", { className: "flex flex-col gap-2", children: [
12
- /* @__PURE__ */ t("label", { className: "text-sm font-medium text-text-neutral-primary", children: l }),
13
- /* @__PURE__ */ a("div", { className: "relative", children: [
14
- /* @__PURE__ */ t("span", { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-text-neutral-muted", children: n }),
15
- /* @__PURE__ */ t(
16
- "input",
17
- {
18
- type: "number",
19
- value: e,
20
- onChange: (u) => o(u.target.value),
21
- placeholder: m,
22
- disabled: r,
23
- className: `border border-stroke-solid-medium bg-surface-neutral-default text-text-neutral-primary placeholder:text-text-neutral-muted rounded px-2 py-2 pl-10 pr-8 text-sm w-full ${r ? "opacity-50 cursor-not-allowed" : ""}`
24
- }
25
- ),
26
- e && /* @__PURE__ */ t(
27
- "button",
28
- {
29
- onClick: s,
30
- className: "absolute right-2 top-1/2 transform -translate-y-1/2 text-text-neutral-muted hover:text-text-neutral-primary",
31
- children: /* @__PURE__ */ t(i, {})
32
- }
33
- )
34
- ] })
35
- ] });
36
- export {
37
- d as FilterInputField
38
- };