@ztwoint/z-ui 0.1.85 → 0.1.87

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 (24) hide show
  1. package/dist/components/assets/icons/index.d.ts +2 -0
  2. package/dist/components/assets/icons/table-cols-2.d.ts +8 -0
  3. package/dist/components/assets/icons/table-cols-2.js +60 -0
  4. package/dist/components/assets/icons/vector_3.d.ts +6 -0
  5. package/dist/components/assets/icons/vector_3.js +34 -0
  6. package/dist/components/table-card/table-card.js +38 -37
  7. package/dist/components/table-card/table-card.type.d.ts +2 -1
  8. package/dist/components/table-filter/filters/boolean.js +28 -32
  9. package/dist/components/table-filter/filters/checkbox.js +24 -26
  10. package/dist/components/table-filter/filters/number/number.hook.d.ts +2 -12
  11. package/dist/components/table-filter/filters/number/number.hook.js +18 -18
  12. package/dist/components/table-filter/filters/text.js +25 -28
  13. package/dist/components/table-filter/table-filter-column-button.js +36 -39
  14. package/dist/components/table-filter/table-filter-provider.js +10 -10
  15. package/dist/components/table-filter/table-filter.hook.js +46 -42
  16. package/dist/components/table-filter/table-filter.type.d.ts +3 -2
  17. package/dist/index.js +33 -29
  18. package/dist/types/components/assets/icons/index.d.ts +2 -0
  19. package/dist/types/components/assets/icons/table-cols-2.d.ts +8 -0
  20. package/dist/types/components/assets/icons/vector_3.d.ts +6 -0
  21. package/dist/types/components/table-card/table-card.type.d.ts +2 -1
  22. package/dist/types/components/table-filter/filters/number/number.hook.d.ts +2 -12
  23. package/dist/types/components/table-filter/table-filter.type.d.ts +3 -2
  24. package/package.json +1 -1
@@ -34,3 +34,5 @@ export { default as XIcon } from './x';
34
34
  export { default as Z2Icon } from './z2-icon';
35
35
  export { default as Z2SlashIcon } from './z2-slash';
36
36
  export { default as Z2DataIcon } from './z2data';
37
+ export { default as Vector3Icon } from './vector_3';
38
+ export { default as TableCols2Icon } from './table-cols-2';
@@ -0,0 +1,8 @@
1
+ import { SVGProps } from 'react';
2
+ type IconProps = SVGProps<SVGSVGElement> & {
3
+ secondaryfill?: string;
4
+ strokewidth?: number;
5
+ title?: string;
6
+ };
7
+ declare function TableCols2({ fill, secondaryfill, strokewidth, width, height, title, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
8
+ export default TableCols2;
@@ -0,0 +1,60 @@
1
+ import { jsxs as o, jsx as t } from "react/jsx-runtime";
2
+ function a({
3
+ fill: e = "currentColor",
4
+ secondaryfill: r,
5
+ strokewidth: n = 1,
6
+ width: i = "1em",
7
+ height: s = "1em",
8
+ title: d = "badge 13",
9
+ ...h
10
+ }) {
11
+ return r = r || e, /* @__PURE__ */ o(
12
+ "svg",
13
+ {
14
+ height: s,
15
+ width: i,
16
+ viewBox: "0 0 20 20",
17
+ xmlns: "http://www.w3.org/2000/svg",
18
+ ...h,
19
+ children: [
20
+ /* @__PURE__ */ t("title", { children: d }),
21
+ /* @__PURE__ */ o("g", { fill: e, children: [
22
+ /* @__PURE__ */ t(
23
+ "line",
24
+ {
25
+ fill: "none",
26
+ stroke: r,
27
+ strokeLinecap: "round",
28
+ strokeLinejoin: "round",
29
+ strokeWidth: n,
30
+ x1: "10",
31
+ x2: "10",
32
+ y1: "17",
33
+ y2: "3"
34
+ }
35
+ ),
36
+ /* @__PURE__ */ t(
37
+ "rect",
38
+ {
39
+ height: "14",
40
+ width: "14",
41
+ fill: "none",
42
+ rx: "3",
43
+ ry: "3",
44
+ stroke: e,
45
+ strokeLinecap: "round",
46
+ strokeLinejoin: "round",
47
+ strokeWidth: "2",
48
+ transform: "translate(0 20) rotate(-90)",
49
+ x: "3",
50
+ y: "3"
51
+ }
52
+ )
53
+ ] })
54
+ ]
55
+ }
56
+ );
57
+ }
58
+ export {
59
+ a as default
60
+ };
@@ -0,0 +1,6 @@
1
+ import { SVGProps } from 'react';
2
+ type IconProps = SVGProps<SVGSVGElement> & {
3
+ title?: string;
4
+ };
5
+ declare function Vector3({ fill, width, height, title, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
6
+ export default Vector3;
@@ -0,0 +1,34 @@
1
+ import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
+ function l({
3
+ fill: r = "currentColor",
4
+ width: t = "1em",
5
+ height: o = "1em",
6
+ title: n = "Vector",
7
+ ...i
8
+ }) {
9
+ return /* @__PURE__ */ s(
10
+ "svg",
11
+ {
12
+ height: o,
13
+ width: t,
14
+ viewBox: "0 0 9 9",
15
+ xmlns: "http://www.w3.org/2000/svg",
16
+ ...i,
17
+ children: [
18
+ /* @__PURE__ */ e("title", { children: n }),
19
+ /* @__PURE__ */ e("g", { fill: "none", children: /* @__PURE__ */ e(
20
+ "path",
21
+ {
22
+ d: "M1 1V1C1 4.86599 4.13401 8 8 8V8",
23
+ stroke: r,
24
+ strokeLinecap: "round",
25
+ strokeOpacity: "1"
26
+ }
27
+ ) })
28
+ ]
29
+ }
30
+ );
31
+ }
32
+ export {
33
+ l as default
34
+ };
@@ -1,4 +1,4 @@
1
- import { jsx as e, jsxs as s } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
2
  import { Table as r } from "../table/table-provider.js";
3
3
  import "react";
4
4
  import { cn as d } from "../../lib/utils.js";
@@ -47,8 +47,8 @@ const we = ({
47
47
  loading: b,
48
48
  emptyMessage: H,
49
49
  className: j,
50
- rounded: n = !0,
51
- bordered: i = !0,
50
+ rounded: i = !0,
51
+ bordered: c = !0,
52
52
  showHeader: g = !0,
53
53
  headerClassName: k,
54
54
  search: m,
@@ -63,35 +63,35 @@ const we = ({
63
63
  showFooter: P = !0,
64
64
  footerClassName: T,
65
65
  pagination: o,
66
- paginationInfo: c,
67
- paginationQuickJumper: a,
66
+ paginationInfo: n,
67
+ paginationQuickJumper: s,
68
68
  error: x = !1,
69
69
  dataSourceError: _ = !1
70
70
  }) => {
71
71
  var f;
72
72
  if (x)
73
- return /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center h-64 bg-background-error-subtle rounded-lg text-text-warning-secondary", children: /* @__PURE__ */ s("div", { className: "flex gap-2", children: [
73
+ return /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center h-64 bg-background-error-subtle rounded-lg text-text-warning-secondary", children: /* @__PURE__ */ a("div", { className: "flex gap-2", children: [
74
74
  /* @__PURE__ */ e(S, { className: "mt-1.5" }),
75
- /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: [
75
+ /* @__PURE__ */ a("div", { className: "flex flex-col gap-2", children: [
76
76
  /* @__PURE__ */ e("div", { className: "text-text-error-primary text-lg font-medium", children: "Error loading data" }),
77
77
  /* @__PURE__ */ e("div", { className: "text-sm", children: "Please try again later" }),
78
78
  typeof x == "string" && /* @__PURE__ */ e("div", { className: "text-text-warning-secondary text-sm", children: x })
79
79
  ] })
80
80
  ] }) });
81
- const N = a && a.totalPage && a.totalPage >= 2, v = o && o.totalPage && o.totalPage >= 2 || !!c || N, C = m || t || h || u, R = typeof (t == null ? void 0 : t.showFilterButton) > "u" ? !0 : t == null ? void 0 : t.showFilterButton;
82
- return /* @__PURE__ */ s("div", { className: d("flex flex-col overflow-hidden relative", j), children: [
83
- /* @__PURE__ */ s(r, { dataSource: w, schema: B, emptyMessage: H, children: [
84
- g && C && /* @__PURE__ */ s(
81
+ const C = s && s.totalPage && s.totalPage >= 2, N = o && o.totalPage && o.totalPage >= 2 || !!n || C, v = m || t || h || u, R = typeof (t == null ? void 0 : t.showFilterButton) > "u" ? !0 : t == null ? void 0 : t.showFilterButton;
82
+ return /* @__PURE__ */ a("div", { className: d("flex flex-col overflow-hidden relative", j), children: [
83
+ /* @__PURE__ */ a(r, { dataSource: w, schema: B, emptyMessage: H, children: [
84
+ g && v && /* @__PURE__ */ a(
85
85
  r.Header,
86
86
  {
87
87
  className: d(
88
88
  "flex-shrink-0",
89
- i && "border-stroke-solid-medium border-1 border-b-0",
90
- n && "rounded-t-xl",
89
+ c && "border-stroke-solid-medium border-1 border-b-0",
90
+ i && "rounded-t-xl",
91
91
  k
92
92
  ),
93
93
  children: [
94
- /* @__PURE__ */ s(r.HeaderContent, { children: [
94
+ /* @__PURE__ */ a(r.HeaderContent, { children: [
95
95
  h && h,
96
96
  m && /* @__PURE__ */ e(
97
97
  r.Search,
@@ -105,14 +105,15 @@ const we = ({
105
105
  className: m.className
106
106
  }
107
107
  ),
108
- t && /* @__PURE__ */ s(
108
+ t && /* @__PURE__ */ a(
109
109
  p,
110
110
  {
111
111
  filterSchema: t.filterSchema,
112
112
  filter: {
113
113
  value: t.value || [],
114
114
  onChange: t.onChange || (() => {
115
- })
115
+ }),
116
+ onDynamicChange: t.onDynamicChange
116
117
  },
117
118
  children: [
118
119
  R && /* @__PURE__ */ e(p.FilterButton, {}),
@@ -133,44 +134,44 @@ const we = ({
133
134
  sort: l == null ? void 0 : l.sort,
134
135
  className: d(
135
136
  "flex-1 min-h-0",
136
- i && "border-stroke-solid-light border-1",
137
- n && !(g && C) && "rounded-t-xl",
138
- n && !(P && v) && "rounded-b-xl",
139
- i && "[&_td:first-child]:border-l-0 [&_td:last-child]:border-r-0",
140
- i && "[&_th:first-child]:border-l-0 [&_th:last-child]:border-r-0",
137
+ c && "border-stroke-solid-light border-1",
138
+ i && !(g && v) && "rounded-t-xl",
139
+ i && !(P && N) && "rounded-b-xl",
140
+ c && "[&_td:first-child]:border-l-0 [&_td:last-child]:border-r-0",
141
+ c && "[&_th:first-child]:border-l-0 [&_th:last-child]:border-r-0",
141
142
  l == null ? void 0 : l.className
142
143
  ),
143
144
  stickyHeader: l == null ? void 0 : l.stickyHeader
144
145
  }
145
146
  ),
146
- P && v && /* @__PURE__ */ s(
147
+ P && N && /* @__PURE__ */ a(
147
148
  r.Footer,
148
149
  {
149
150
  className: d(
150
151
  "flex-shrink-0 border-stroke-solid-light border-t-[0.5px] mt-[-2px]",
151
- i && "border",
152
- n && "rounded-b-xl",
152
+ c && "border",
153
+ i && "rounded-b-xl",
153
154
  T
154
155
  ),
155
156
  children: [
156
- c ? /* @__PURE__ */ e(r.FooterContent, { children: /* @__PURE__ */ e(
157
+ n ? /* @__PURE__ */ e(r.FooterContent, { children: /* @__PURE__ */ e(
157
158
  r.PaginationInfo,
158
159
  {
159
- showTotal: c.showTotal,
160
- totalItems: c.totalItems,
161
- currentPage: c.currentPage,
162
- itemsPerPage: c.itemsPerPage
160
+ showTotal: n.showTotal,
161
+ totalItems: n.totalItems,
162
+ currentPage: n.currentPage,
163
+ itemsPerPage: n.itemsPerPage
163
164
  }
164
- ) }) : a || o ? /* @__PURE__ */ e(r.FooterContent, { children: null }) : null,
165
- (a || o) && /* @__PURE__ */ s(r.FooterContent, { children: [
166
- N && /* @__PURE__ */ e(
165
+ ) }) : s || o ? /* @__PURE__ */ e(r.FooterContent, { children: null }) : null,
166
+ (s || o) && /* @__PURE__ */ a(r.FooterContent, { children: [
167
+ C && /* @__PURE__ */ e(
167
168
  r.PaginationQuickJumper,
168
169
  {
169
- currentPage: a.currentPage,
170
- totalPage: a.totalPage,
171
- onChange: a.onChange || (() => {
170
+ currentPage: s.currentPage,
171
+ totalPage: s.totalPage,
172
+ onChange: s.onChange || (() => {
172
173
  }),
173
- disabled: a.disabled
174
+ disabled: s.disabled
174
175
  }
175
176
  ),
176
177
  o && /* @__PURE__ */ e(
@@ -188,7 +189,7 @@ const we = ({
188
189
  }
189
190
  )
190
191
  ] }),
191
- b && /* @__PURE__ */ e("div", { className: "absolute top-0 inset-0 w-full h-full bg-white/80 flex items-center justify-center", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-3", children: [
192
+ b && /* @__PURE__ */ e("div", { className: "absolute top-0 inset-0 w-full h-full bg-white/80 flex items-center justify-center", children: /* @__PURE__ */ a("div", { className: "flex flex-col items-center gap-3", children: [
192
193
  /* @__PURE__ */ e("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-text-brand-secondary" }),
193
194
  /* @__PURE__ */ e("p", { className: "text-text-neutral-primary font-medium", children: "Loading..." })
194
195
  ] }) })
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { TableProps, TableSchema, TableSearch, TableSort } from '../table/table.type';
3
- import { TableFilter, FilterSchema } from '../table-filter/table-filter.type';
3
+ import { TableFilter, FilterRule, FilterSchema } from '../table-filter/table-filter.type';
4
4
  import { PaginationProps, PaginationInfoProps, PaginationQuickJumperProps } from '../table/components/pagination/pagination.type';
5
5
  export interface TableCardProps {
6
6
  dataSource: Record<string, unknown>[];
@@ -17,6 +17,7 @@ export interface TableCardProps {
17
17
  quickFilters?: string[];
18
18
  showFilterButton?: boolean;
19
19
  filterSchema: FilterSchema;
20
+ onDynamicChange?: (filters: FilterRule[]) => void;
20
21
  };
21
22
  headerLeftContent?: React.ReactNode;
22
23
  headerActions?: React.ReactNode;
@@ -1,25 +1,21 @@
1
- import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
- import { useEffect as n } from "react";
3
- const d = ["equals", "notEqual"], u = ({ value: t, onChange: s }) => {
4
- n(() => {
5
- t.condition || s({ condition: d[0] });
6
- }, []);
7
- const i = (r, a) => {
8
- s(a ? { value: r } : { value: "" });
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: "" });
9
5
  };
10
- return /* @__PURE__ */ e("div", { className: "w-full", children: /* @__PURE__ */ l("div", { className: "p-4 space-y-3", children: [
11
- /* @__PURE__ */ l("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: [
12
- /* @__PURE__ */ l("div", { className: "relative", children: [
13
- /* @__PURE__ */ e(
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(
14
10
  "input",
15
11
  {
16
12
  type: "checkbox",
17
- checked: t.value === "true",
18
- onChange: (r) => i("true", r.target.checked),
13
+ checked: (e == null ? void 0 : e.value) === "true",
14
+ onChange: (s) => i("true", s.target.checked),
19
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"
20
16
  }
21
17
  ),
22
- t.value === "true" && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e("svg", { className: "w-3 h-3 text-white", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e(
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(
23
19
  "path",
24
20
  {
25
21
  fillRule: "evenodd",
@@ -28,26 +24,26 @@ const d = ["equals", "notEqual"], u = ({ value: t, onChange: s }) => {
28
24
  }
29
25
  ) }) })
30
26
  ] }),
31
- /* @__PURE__ */ l("div", { className: "ml-3 flex-1", children: [
32
- /* @__PURE__ */ l("div", { className: "flex items-center", children: [
33
- /* @__PURE__ */ e("span", { className: "text-sm font-medium text-text-neutral-primary", children: "True" }),
34
- t.value === "true" && /* @__PURE__ */ e("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" })
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" })
35
31
  ] }),
36
- /* @__PURE__ */ e("p", { className: "text-xs text-text-neutral-secondary mt-0.5", children: "Include records with true values" })
32
+ /* @__PURE__ */ r("p", { className: "text-xs text-text-neutral-secondary mt-0.5", children: "Include records with true values" })
37
33
  ] })
38
34
  ] }),
39
- /* @__PURE__ */ l("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: [
40
- /* @__PURE__ */ l("div", { className: "relative", children: [
41
- /* @__PURE__ */ e(
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(
42
38
  "input",
43
39
  {
44
40
  type: "checkbox",
45
- checked: t.value === "false",
46
- onChange: (r) => i("false", r.target.checked),
41
+ checked: (e == null ? void 0 : e.value) === "false",
42
+ onChange: (s) => i("false", s.target.checked),
47
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"
48
44
  }
49
45
  ),
50
- t.value === "false" && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e("svg", { className: "w-3 h-3 text-white", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e(
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(
51
47
  "path",
52
48
  {
53
49
  fillRule: "evenodd",
@@ -56,16 +52,16 @@ const d = ["equals", "notEqual"], u = ({ value: t, onChange: s }) => {
56
52
  }
57
53
  ) }) })
58
54
  ] }),
59
- /* @__PURE__ */ l("div", { className: "ml-3 flex-1", children: [
60
- /* @__PURE__ */ l("div", { className: "flex items-center", children: [
61
- /* @__PURE__ */ e("span", { className: "text-sm font-medium text-text-neutral-primary", children: "False" }),
62
- t.value === "false" && /* @__PURE__ */ e("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" })
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" })
63
59
  ] }),
64
- /* @__PURE__ */ e("p", { className: "text-xs text-text-neutral-secondary mt-0.5", children: "Include records with false values" })
60
+ /* @__PURE__ */ r("p", { className: "text-xs text-text-neutral-secondary mt-0.5", children: "Include records with false values" })
65
61
  ] })
66
62
  ] })
67
63
  ] }) });
68
64
  };
69
65
  export {
70
- u as default
66
+ c as default
71
67
  };
@@ -1,63 +1,61 @@
1
- import { jsx as t, jsxs as s } from "react/jsx-runtime";
2
- import { useState as i, useEffect as f } from "react";
1
+ import { jsx as t, jsxs as r } from "react/jsx-runtime";
2
+ import { useState as i, useEffect as N } from "react";
3
3
  import { Virtuoso as k } from "react-virtuoso";
4
4
  import { MagnifierIcon as y } from "../../assets/icons/magnifier-icon.js";
5
5
  import S from "../../assets/icons/x.js";
6
6
  import { Z2Checkbox as w } from "../../checkbox/checkbox.js";
7
- const V = ["includesAny", "includesAll", "excludes"], I = ({ value: r, onChange: d, filterOptions: n = [] }) => {
8
- const [c, o] = i([]), [u, m] = i(""), [x, h] = i(n), p = (l) => {
7
+ const E = ({ value: s, onChange: h, filterOptions: n = [] }) => {
8
+ const [o, c] = i([]), [d, m] = i(""), [f, u] = i(n), x = (l) => {
9
9
  m(l.target.value);
10
10
  const e = n.filter(
11
11
  (a) => a.label.toLowerCase().includes(l.target.value.toLowerCase())
12
12
  );
13
- h(e);
13
+ u(e);
14
14
  };
15
- f(() => {
16
- r.condition || d({ condition: V[0] });
17
- }, []), f(() => {
18
- Array.isArray(r.value) ? o(r.value.filter(Boolean)) : o([]);
19
- }, [r.value]);
20
- const b = (l, e) => {
15
+ N(() => {
16
+ s && Array.isArray(s.value) ? c(s.value.filter(Boolean) ?? []) : c([]);
17
+ }, [s]);
18
+ const p = (l, e) => {
21
19
  let a;
22
- e ? a = [...c, l] : a = c.filter((g) => g !== l), o(a), d({ value: a });
23
- }, v = () => {
24
- m(""), h(n);
25
- }, C = (l) => c.includes(l), N = (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: [
20
+ e ? a = [...o, l] : a = o.filter((v) => v !== l), c(a), h({ value: a });
21
+ }, b = () => {
22
+ m(""), u(n);
23
+ }, C = (l) => o.includes(l), g = (l, e) => /* @__PURE__ */ r("div", { className: "flex justify-between items-center py-2 px-3", children: [
24
+ /* @__PURE__ */ r("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
27
25
  /* @__PURE__ */ t(
28
26
  w,
29
27
  {
30
28
  checked: C(e.value),
31
- onCheckedChange: (a) => b(e.value, a === !0)
29
+ onCheckedChange: (a) => p(e.value, a === !0)
32
30
  }
33
31
  ),
34
32
  /* @__PURE__ */ t("span", { className: "text-text-neutral-primary leading-none-medium-sm", children: e.label })
35
33
  ] }),
36
- e.total && /* @__PURE__ */ s("span", { className: "text-text-neutral-muted text-sm", children: [
34
+ e.total && /* @__PURE__ */ r("span", { className: "text-text-neutral-muted text-sm", children: [
37
35
  "[",
38
36
  e.total,
39
37
  "]"
40
38
  ] })
41
39
  ] });
42
- return n.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: [
40
+ return n.length === 0 ? /* @__PURE__ */ t("div", { className: "text-text-neutral-muted text-sm p-4", children: "No filter options available for this column" }) : /* @__PURE__ */ r("div", { className: "flex flex-col h-full", children: [
41
+ /* @__PURE__ */ r("div", { className: "relative border-b border-stroke-solid-medium", children: [
44
42
  /* @__PURE__ */ t(y, { className: "absolute left-3 top-3.5 text-text-neutral-muted" }),
45
43
  /* @__PURE__ */ t(
46
44
  "input",
47
45
  {
48
46
  placeholder: "Search options",
49
- value: u,
50
- onChange: p,
47
+ value: d,
48
+ onChange: x,
51
49
  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
50
  }
53
51
  ),
54
- u && /* @__PURE__ */ t("span", { className: "absolute right-3 top-3.5", onClick: v, children: /* @__PURE__ */ t(S, {}) })
52
+ d && /* @__PURE__ */ t("span", { className: "absolute right-3 top-3.5", onClick: b, children: /* @__PURE__ */ t(S, {}) })
55
53
  ] }),
56
54
  /* @__PURE__ */ t("div", { className: "flex-1", children: /* @__PURE__ */ t(
57
55
  k,
58
56
  {
59
- data: x,
60
- itemContent: N,
57
+ data: f,
58
+ itemContent: g,
61
59
  className: "h-full min-h-60",
62
60
  style: { height: "100%" },
63
61
  overscan: 5
@@ -66,5 +64,5 @@ const V = ["includesAny", "includesAll", "excludes"], I = ({ value: r, onChange:
66
64
  ] });
67
65
  };
68
66
  export {
69
- I as default
67
+ E as default
70
68
  };
@@ -1,14 +1,5 @@
1
- interface UseNumberFilterProps {
2
- value: {
3
- condition: string;
4
- value: string;
5
- };
6
- onChange: (update: {
7
- condition?: string;
8
- value?: string;
9
- }) => void;
10
- }
11
- export declare const useNumberFilter: ({ value, onChange }: UseNumberFilterProps) => {
1
+ import { FilterComponentProps } from '../../table-filter.type';
2
+ export declare const useNumberFilter: ({ value, onChange }: FilterComponentProps) => {
12
3
  specificAmount: string;
13
4
  atLeast: string;
14
5
  noMoreThan: string;
@@ -20,4 +11,3 @@ export declare const useNumberFilter: ({ value, onChange }: UseNumberFilterProps
20
11
  resetAtLeast: () => void;
21
12
  resetNoMoreThan: () => void;
22
13
  };
23
- export {};
@@ -1,33 +1,33 @@
1
- import { useState as s, useEffect as l } from "react";
2
- const T = ({ value: t, onChange: i }) => {
3
- const [r, o] = s(""), [d, n] = s(""), [a, c] = s(""), f = r ? "specific" : d ? "atLeast" : a ? "noMoreThan" : null;
4
- return l(() => {
5
- t.condition === "=" && t.value ? (o(t.value), n(""), c("")) : t.condition === ">" && t.value ? (n(t.value), o(""), c("")) : t.condition === "<" && t.value && (c(t.value), o(""), n(""));
6
- }, [t.condition, t.value]), {
1
+ import { useState as e, useEffect as h } from "react";
2
+ const b = ({ value: t, onChange: o }) => {
3
+ const [r, n] = e(""), [d, c] = e(""), [f, s] = e(""), A = r ? "specific" : d ? "atLeast" : f ? "noMoreThan" : null;
4
+ return h(() => {
5
+ (t == null ? void 0 : t.condition) === "=" && (t != null && t.value) ? (n(t == null ? void 0 : t.value), c(""), s("")) : (t == null ? void 0 : t.condition) === ">" && (t != null && t.value) ? (c(t.value), n(""), s("")) : (t == null ? void 0 : t.condition) === "<" && (t != null && t.value) && (s(t.value), n(""), c(""));
6
+ }, [t == null ? void 0 : t.condition, t == null ? void 0 : t.value]), {
7
7
  specificAmount: r,
8
8
  atLeast: d,
9
- noMoreThan: a,
10
- activeField: f,
11
- handleSpecificAmountChange: (e) => {
12
- o(e), e ? (n(""), c(""), i({ condition: "=", value: e })) : i({ condition: "", value: "" });
9
+ noMoreThan: f,
10
+ activeField: A,
11
+ handleSpecificAmountChange: (i) => {
12
+ n(i), i ? (c(""), s(""), o({ condition: "=", value: i })) : o({ condition: "", value: "" });
13
13
  },
14
- handleAtLeastChange: (e) => {
15
- n(e), e ? (o(""), c(""), i({ condition: ">", value: e })) : i({ condition: "", value: "" });
14
+ handleAtLeastChange: (i) => {
15
+ c(i), i ? (n(""), s(""), o({ condition: ">", value: i })) : o({ condition: "", value: "" });
16
16
  },
17
- handleNoMoreThanChange: (e) => {
18
- c(e), e ? (o(""), n(""), i({ condition: "<", value: e })) : i({ condition: "", value: "" });
17
+ handleNoMoreThanChange: (i) => {
18
+ s(i), i ? (n(""), c(""), o({ condition: "<", value: i })) : o({ condition: "", value: "" });
19
19
  },
20
20
  resetSpecificAmount: () => {
21
- o(""), i({ condition: "", value: "" });
21
+ n(""), o({ condition: "", value: "" });
22
22
  },
23
23
  resetAtLeast: () => {
24
- n(""), i({ condition: "", value: "" });
24
+ c(""), o({ condition: "", value: "" });
25
25
  },
26
26
  resetNoMoreThan: () => {
27
- c(""), i({ condition: "", value: "" });
27
+ s(""), o({ condition: "", value: "" });
28
28
  }
29
29
  };
30
30
  };
31
31
  export {
32
- T as useNumberFilter
32
+ b as useNumberFilter
33
33
  };
@@ -1,47 +1,44 @@
1
- import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
- import { useEffect as c } from "react";
3
- import s from "../../assets/icons/x.js";
4
- import { MagnifierIcon as u } from "../../assets/icons/magnifier-icon.js";
5
- import { Input as d } from "../../input/input.js";
6
- const o = [
1
+ import { jsxs as r, jsx as t } from "react/jsx-runtime";
2
+ import i from "../../assets/icons/x.js";
3
+ import { MagnifierIcon as o } from "../../assets/icons/magnifier-icon.js";
4
+ import { Input as c } from "../../input/input.js";
5
+ const d = [
7
6
  { label: "Contains", value: "contains" },
8
7
  { label: "Does not equal", value: "notEqual" },
9
8
  { label: "Equals", value: "equals" }
10
- ], h = ({ value: t, onChange: a }) => {
11
- var i;
12
- const n = () => {
13
- a({ value: "" });
9
+ ], x = ({ value: e, onChange: n }) => {
10
+ var a;
11
+ const s = () => {
12
+ n({ value: "" });
14
13
  };
15
- return c(() => {
16
- t.condition || a({ condition: o[0].value });
17
- }, []), /* @__PURE__ */ l("div", { className: "flex flex-col gap-3", children: [
18
- /* @__PURE__ */ e("div", { className: "p-4 relative", children: /* @__PURE__ */ e(
19
- d,
14
+ return /* @__PURE__ */ r("div", { className: "flex flex-col gap-3", children: [
15
+ /* @__PURE__ */ t("div", { className: "p-4 relative", children: /* @__PURE__ */ t(
16
+ c,
20
17
  {
21
- leftIcon: /* @__PURE__ */ e(u, {}),
18
+ leftIcon: /* @__PURE__ */ t(o, {}),
22
19
  size: "large",
23
20
  placeholder: "Search options",
24
- value: t.value,
25
- rightIcon: t.value ? /* @__PURE__ */ e(s, { onClick: n }) : null,
26
- onChange: (r) => a({ value: r.target.value }),
21
+ value: e == null ? void 0 : e.value,
22
+ rightIcon: e != null && e.value ? /* @__PURE__ */ t(i, { onClick: s }) : null,
23
+ onChange: (l) => n({ value: l.target.value }),
27
24
  className: ""
28
25
  }
29
26
  ) }),
30
- /* @__PURE__ */ e("div", { className: "flex flex-col gap-2 p-3", children: t.value && /* @__PURE__ */ l("div", { className: "flex items-center justify-center gap-2 px-3 py-2", children: [
31
- /* @__PURE__ */ e("span", { className: "text-text-neutral-muted text-xs font-medium uppercase tracking-wide", children: (i = o.find((r) => r.value === t.condition)) == null ? void 0 : i.label }),
32
- /* @__PURE__ */ l("div", { className: "flex items-center gap-1", children: [
33
- /* @__PURE__ */ l("span", { className: "text-text-neutral-primary text-sm font-medium px-2 py-1 bg-surface-neutral-default rounded border border-stroke-solid-medium", children: [
27
+ /* @__PURE__ */ t("div", { className: "flex flex-col gap-2 p-3", children: !!(e != null && e.value) && /* @__PURE__ */ r("div", { className: "flex items-center justify-center gap-2 px-3 py-2", children: [
28
+ /* @__PURE__ */ t("span", { className: "text-text-neutral-muted text-xs font-medium uppercase tracking-wide", children: (a = d.find((l) => l.value === (e == null ? void 0 : e.condition))) == null ? void 0 : a.label }),
29
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: [
30
+ /* @__PURE__ */ r("span", { className: "text-text-neutral-primary text-sm font-medium px-2 py-1 bg-surface-neutral-default rounded border border-stroke-solid-medium", children: [
34
31
  "“",
35
- t.value,
32
+ e.value,
36
33
  "”"
37
34
  ] }),
38
- /* @__PURE__ */ e(
35
+ /* @__PURE__ */ t(
39
36
  "button",
40
37
  {
41
- onClick: n,
38
+ onClick: s,
42
39
  className: "flex items-center justify-center w-5 h-5 rounded-full bg-surface-neutral-hovered hover:bg-surface-neutral-pressed transition-colors",
43
40
  title: "Remove filter",
44
- children: /* @__PURE__ */ e(s, { className: "w-3 h-3 text-text-neutral-muted" })
41
+ children: /* @__PURE__ */ t(i, { className: "w-3 h-3 text-text-neutral-muted" })
45
42
  }
46
43
  )
47
44
  ] })
@@ -49,5 +46,5 @@ const o = [
49
46
  ] });
50
47
  };
51
48
  export {
52
- h as default
49
+ x as default
53
50
  };
@@ -1,8 +1,8 @@
1
1
  import { jsxs as a, jsx as l } from "react/jsx-runtime";
2
2
  import * as x from "react";
3
3
  import * as p from "@radix-ui/react-popover";
4
- import { Button as h } from "../button/button.js";
5
- import { useTableFilterContext as V } from "./table-filter.context.js";
4
+ import { Button as d } from "../button/button.js";
5
+ import { useTableFilterContext as U } from "./table-filter.context.js";
6
6
  import q from "./filters/text.js";
7
7
  import E from "./filters/boolean.js";
8
8
  import G from "./filters/number/number.js";
@@ -11,63 +11,60 @@ import J from "../assets/icons/circle-check-filled.js";
11
11
  import { getFilterCount as L } from "./selected-filters-display/selected-filters-display.utils.js";
12
12
  import { FilterConfirmationDialog as M } from "./close-filter-confirm/filter-confirmation-dialog.js";
13
13
  import { hasUnsavedFilterChangesForColumn as w } from "./close-filter-confirm/filter-confirmation-dialog.utils.js";
14
- const le = ({ filterName: n }) => {
15
- const [k, r] = x.useState(!1), [f, s] = x.useState(!1), {
14
+ const ne = ({ filterName: t }) => {
15
+ const [k, s] = x.useState(!1), [f, r] = x.useState(!1), {
16
16
  getFilterForColumn: A,
17
17
  hasAppliedFilterForColumn: O,
18
18
  updateColumnFilter: u,
19
19
  applyFilters: c,
20
20
  resetToAppliedFilters: P,
21
21
  filterSchema: T,
22
- filterComponents: d = {},
22
+ filterComponents: m = {},
23
23
  tempFilters: C,
24
24
  filter: g
25
- } = V(), $ = (o) => {
26
- !o && f ? w(n, C, g.value) ? r(!0) : s(!1) : s(o);
25
+ } = U(), $ = (e) => {
26
+ !e && f ? w(t, C, g.value) ? s(!0) : r(!1) : r(e);
27
27
  }, j = () => {
28
- c(), r(!1), s(!1);
28
+ c(), s(!1), r(!1);
29
29
  }, D = () => {
30
- r(!1), s(!1);
30
+ s(!1), r(!1);
31
31
  }, K = () => {
32
- P(), r(!1), s(!1);
32
+ P(), s(!1), r(!1);
33
33
  }, R = () => {
34
- r(!1);
35
- }, v = w(n, C, g.value), t = T.find((o) => o.filterKey === n);
36
- if (!t)
37
- return console.warn(`Column "${n}" not found in schema`), null;
34
+ s(!1);
35
+ }, F = w(t, C, g.value), o = T.find((e) => e.filterKey === t);
36
+ if (!o)
37
+ return console.warn(`Column "${t}" not found in schema`), null;
38
38
  const S = {
39
39
  boolean: E,
40
40
  string: q,
41
41
  number: G,
42
42
  checkbox: H
43
- }, F = t.type && (d == null ? void 0 : d[t.type]) || S[t.type ?? "string"];
44
- if (!F)
43
+ }, v = o.type && (m == null ? void 0 : m[o.type]) || S[o.type ?? "string"];
44
+ if (!v)
45
45
  return console.warn(
46
- `No filter component found for column "${t.filterKey}" with type "${t.type}". Provide a custom filter component or use supported types: "string", "number", "boolean", "checkbox".`
46
+ `No filter component found for column "${o.filterKey}" with type "${o.type}". Provide a custom filter component or use supported types: "string", "number", "boolean", "checkbox".`
47
47
  ), null;
48
- const e = A(n), m = O(n), b = t.options ? Object.entries(t.options).map(([o, i]) => ({
49
- label: o,
50
- value: o,
48
+ const n = A(t), h = O(t), b = o.options ? Object.entries(o.options).map(([e, i]) => ({
49
+ label: e,
50
+ value: e,
51
51
  total: i
52
- })) : void 0, y = e ? L(e, b) : void 0, z = e != null && e.value ? Array.isArray(e.value) ? e.value.length : 1 : 0, B = {
53
- condition: (e == null ? void 0 : e.condition) || "",
54
- value: (e == null ? void 0 : e.value) || ""
52
+ })) : void 0, y = n ? L(n, b) : void 0, z = n != null && n.value ? Array.isArray(n.value) ? n.value.length : 1 : 0, B = () => {
53
+ const e = u(t, "", "");
54
+ c(e), r(!1);
55
55
  }, I = () => {
56
- const o = u(n, "", "");
57
- c(o), s(!1);
58
- }, U = () => {
59
- c(), s(!1);
56
+ c(), r(!1);
60
57
  };
61
58
  return /* @__PURE__ */ a(p.Root, { open: f, onOpenChange: $, children: [
62
59
  /* @__PURE__ */ l(p.Trigger, { asChild: !0, children: /* @__PURE__ */ l(
63
- h,
60
+ d,
64
61
  {
65
- variant: m ? "filled" : "stroke",
66
- shade: m ? "brand" : "neutral",
62
+ variant: h ? "filled" : "stroke",
63
+ shade: h ? "brand" : "neutral",
67
64
  size: "small",
68
65
  children: /* @__PURE__ */ a("span", { className: "flex items-center gap-2", children: [
69
- t.title,
70
- m && /* @__PURE__ */ l(J, { className: "w-4 h-4 text-white flex-shrink-0" })
66
+ o.title,
67
+ h && /* @__PURE__ */ l(J, { className: "w-4 h-4 text-white flex-shrink-0" })
71
68
  ] })
72
69
  }
73
70
  ) }),
@@ -79,16 +76,16 @@ const le = ({ filterName: n }) => {
79
76
  align: "start",
80
77
  children: [
81
78
  /* @__PURE__ */ l(
82
- F,
79
+ v,
83
80
  {
84
- value: B,
85
- onChange: ({ condition: o, value: i }) => u(n, o, i),
81
+ value: n,
82
+ onChange: ({ condition: e, value: i }) => u(t, e, i),
86
83
  filterOptions: b
87
84
  }
88
85
  ),
89
- (v || !!z) && /* @__PURE__ */ a("div", { className: "flex justify-between gap-2 p-3 border-t border-stroke-solid-medium", children: [
90
- /* @__PURE__ */ l(h, { onClick: I, variant: "stroke", shade: "neutral", size: "small", children: "Clear All" }),
91
- v && /* @__PURE__ */ l(h, { onClick: U, variant: "filled", shade: "neutral", size: "small", children: `Apply${y !== void 0 ? ` ${y}` : ""}` })
86
+ (F || !!z) && /* @__PURE__ */ a("div", { className: "flex justify-between gap-2 p-3 border-t border-stroke-solid-medium", children: [
87
+ /* @__PURE__ */ l(d, { onClick: B, variant: "stroke", shade: "neutral", size: "small", children: "Clear All" }),
88
+ F && /* @__PURE__ */ l(d, { onClick: I, variant: "filled", shade: "neutral", size: "small", children: `Apply${y !== void 0 ? ` ${y}` : ""}` })
92
89
  ] })
93
90
  ]
94
91
  }
@@ -105,5 +102,5 @@ const le = ({ filterName: n }) => {
105
102
  ] });
106
103
  };
107
104
  export {
108
- le as TableFilterColumnButton
105
+ ne as TableFilterColumnButton
109
106
  };
@@ -1,27 +1,27 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import i from "./table-filter.hook.js";
3
- import { TableFilterContext as a } from "./table-filter.context.js";
4
- const v = ({
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import a from "./table-filter.hook.js";
3
+ import { TableFilterContext as u } from "./table-filter.context.js";
4
+ const c = ({
5
5
  children: r,
6
6
  filterComponents: t = {},
7
7
  filterSchema: e,
8
8
  filter: o
9
9
  }) => {
10
- const l = i({
10
+ const n = a({
11
11
  filterSchema: e,
12
12
  filter: o || { value: [], onChange: () => {
13
- } }
13
+ }, onDynamicChange: void 0 }
14
14
  });
15
15
  if (!o)
16
16
  return null;
17
- const n = {
18
- ...l,
17
+ const l = {
18
+ ...n,
19
19
  filterSchema: e,
20
20
  filter: o,
21
21
  filterComponents: t
22
22
  };
23
- return /* @__PURE__ */ u(a.Provider, { value: n, children: r });
23
+ return /* @__PURE__ */ i(u.Provider, { value: l, children: r });
24
24
  };
25
25
  export {
26
- v as TableFilterProvider
26
+ c as TableFilterProvider
27
27
  };
@@ -1,59 +1,63 @@
1
- import i from "react";
2
- const E = ({ filter: l, filterSchema: o }) => {
3
- const [d, c] = i.useState(null), [n, s] = i.useState(l.value);
4
- i.useEffect(() => {
5
- !d && o.length > 0 && c(o[0].filterKey);
6
- }, [d, o]);
7
- const f = (t) => n.find((e) => e.field === t), p = (t) => {
8
- const e = f(t);
1
+ import o from "react";
2
+ const w = ({ filter: n, filterSchema: c }) => {
3
+ const [v, d] = o.useState(null), [l, i] = o.useState(n.value);
4
+ o.useEffect(() => {
5
+ !v && c.length > 0 && d(c[0].filterKey);
6
+ }, [v, c]);
7
+ const F = (t) => l.find((e) => e.field === t), p = (t) => {
8
+ const e = F(t);
9
9
  return e ? Array.isArray(e.value) ? e.value.length > 0 : e.value !== "" : !1;
10
- }, A = (t) => l.value.find((e) => e.field === t), m = (t) => {
11
- const e = A(t);
10
+ }, g = (t) => n.value.find((e) => e.field === t), m = (t) => {
11
+ const e = g(t);
12
12
  return e ? Array.isArray(e.value) ? e.value.length > 0 : e.value !== "" : !1;
13
- }, g = (t, e, r) => {
14
- const F = n.findIndex((a) => a.field === t);
13
+ }, y = (t, e, a) => {
14
+ const f = l.findIndex((r) => r.field === t);
15
15
  let u = [];
16
- if (F >= 0)
17
- u = n.map(
18
- (v, T) => T === F ? {
19
- ...v,
16
+ if (f >= 0)
17
+ u = l.map(
18
+ (s, x) => x === f ? {
19
+ ...s,
20
20
  ...e !== void 0 ? { condition: e } : {},
21
- ...r !== void 0 ? { value: r } : {}
22
- } : v
21
+ ...a !== void 0 ? { value: a } : {}
22
+ } : s
23
23
  );
24
24
  else {
25
- const a = {
25
+ const r = {
26
26
  field: t,
27
27
  ...e ? { condition: e } : {},
28
- value: r || ""
28
+ value: a || ""
29
29
  };
30
- u = [...n, a];
30
+ u = [...l, r];
31
31
  }
32
- return s(u), u;
33
- }, C = () => {
34
- s([]);
32
+ if (i(u), n.onDynamicChange) {
33
+ const r = u.filter((s) => Array.isArray(s.value) ? s.value.length > 0 : s.value !== "");
34
+ n.onDynamicChange(r);
35
+ }
36
+ return u;
35
37
  }, h = () => {
36
- s(l.value);
37
- }, y = (t) => {
38
- const e = (t || n).filter((r) => Array.isArray(r.value) ? r.value.length > 0 : r.value !== "");
39
- l.onChange(e);
40
- }, x = l.value.length > 0;
41
- return i.useEffect(() => {
42
- s(l.value);
43
- }, [l.value]), {
44
- selectedColumn: d,
45
- setSelectedColumn: c,
46
- getFilterForColumn: f,
38
+ i([]), n.onDynamicChange && n.onDynamicChange([]);
39
+ }, C = () => {
40
+ i(n.value), n.onDynamicChange && n.onDynamicChange(n.value);
41
+ }, A = (t) => {
42
+ const e = (t || l).filter((a) => Array.isArray(a.value) ? a.value.length > 0 : a.value !== "");
43
+ n.onChange(e);
44
+ }, D = n.value.length > 0;
45
+ return o.useEffect(() => {
46
+ i(n.value);
47
+ }, [n.value]), {
48
+ selectedColumn: v,
49
+ setSelectedColumn: d,
50
+ getFilterForColumn: F,
47
51
  hasFilterForColumn: p,
48
52
  hasAppliedFilterForColumn: m,
49
- updateColumnFilter: g,
50
- clearAllFilters: C,
51
- resetToAppliedFilters: h,
52
- applyFilters: y,
53
- hasActiveFilters: x,
54
- tempFilters: n
53
+ updateColumnFilter: y,
54
+ clearAllFilters: h,
55
+ resetToAppliedFilters: C,
56
+ applyFilters: A,
57
+ hasActiveFilters: D,
58
+ tempFilters: l
55
59
  };
56
60
  };
57
61
  export {
58
- E as default
62
+ w as default
59
63
  };
@@ -21,6 +21,7 @@ export type FilterSchema = FilterSchemaField[];
21
21
  export type TableFilter = {
22
22
  value: FilterRule[];
23
23
  onChange: (filters: FilterRule[]) => void;
24
+ onDynamicChange?: (filters: FilterRule[]) => void;
24
25
  };
25
26
  export interface TableFilterProps {
26
27
  filterSchema: FilterSchema;
@@ -32,9 +33,9 @@ export type FilterComponentProps = {
32
33
  condition?: string;
33
34
  value?: string | string[];
34
35
  }) => void;
35
- value: {
36
+ value?: {
36
37
  condition?: string;
37
- value: string | string[];
38
+ value?: string | string[];
38
39
  };
39
40
  filterOptions?: FilterOption[];
40
41
  };
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { Z2SideNavBarProvider as c } from "./components/collapsible-side-nav-bar
6
6
  import { Z2SideNavBar as s, Z2SidebarVariants as I } from "./components/collapsible-side-nav-bar/side-nav-bar.js";
7
7
  import { Z2SideNavBarHeader as b } from "./components/collapsible-side-nav-bar/side-nav-bar-header.js";
8
8
  import { Z2SideNavBarContent as D } from "./components/collapsible-side-nav-bar/side-nav-bar-content.js";
9
- import { Z2SideNavBarFooter as T } from "./components/collapsible-side-nav-bar/side-nav-bar-footer.js";
9
+ import { Z2SideNavBarFooter as g } from "./components/collapsible-side-nav-bar/side-nav-bar-footer.js";
10
10
  import { Z2SideNavBarGroup as v } from "./components/collapsible-side-nav-bar/side-nav-bar-group.js";
11
11
  import { Z2SideNavBarItem as L } from "./components/collapsible-side-nav-bar/side-nav-bar-item.js";
12
12
  import { Z2SideNavBarSeparator as h } from "./components/collapsible-side-nav-bar/side-nav-bar-separator.js";
@@ -15,17 +15,17 @@ import { Z2Popover as k } from "./components/collapsible-side-nav-bar/popover/po
15
15
  import "react/jsx-runtime";
16
16
  import { default as R, default as H } from "./components/assets/icons/sub-nav-indicator.js";
17
17
  import { default as F } from "./components/assets/icons/circles-icon.js";
18
- import { default as _, default as W } from "./components/assets/icons/database-copy.js";
18
+ import { default as _, default as V } from "./components/assets/icons/database-copy.js";
19
19
  import { default as U, default as O } from "./components/assets/icons/window-left-copy.js";
20
20
  import { default as J, default as Q } from "./components/assets/icons/sidebar-left-show-copy.js";
21
21
  import { SIDEBAR_WIDTH as j, SIDEBAR_WIDTH_COLLAPSED as q } from "./components/collapsible-side-nav-bar/constants.js";
22
22
  import { CountryFlags as K } from "./components/country-flags/country-flags.js";
23
23
  import { Z2Checkbox as oo } from "./components/checkbox/checkbox.js";
24
24
  import { Z2Dialog as ro, Z2DialogClose as to, Z2DialogContent as ao, Z2DialogDescription as po, Z2DialogFooter as no, Z2DialogHeader as fo, Z2DialogOverlay as lo, Z2DialogPortal as mo, Z2DialogTitle as xo, Z2DialogTrigger as uo } from "./components/dialog/dialog.js";
25
- import { DropdownContext as co, Z2Dropdown as Zo, Z2DropdownContent as so, Z2DropdownInput as Io, Z2DropdownItem as So, Z2DropdownSub as bo, Z2DropdownSubContent as Co, Z2DropdownSubItem as Do, Z2DropdownSubTrigger as go } from "./components/dropdown/z2-dropdown.js";
25
+ import { DropdownContext as co, Z2Dropdown as Zo, Z2DropdownContent as so, Z2DropdownInput as Io, Z2DropdownItem as So, Z2DropdownSub as bo, Z2DropdownSubContent as Co, Z2DropdownSubItem as Do, Z2DropdownSubTrigger as To } from "./components/dropdown/z2-dropdown.js";
26
26
  import { Z2DropdownMenu as wo, Z2DropdownMenuCheckboxItem as vo, Z2DropdownMenuContent as Bo, Z2DropdownMenuGroup as Lo, Z2DropdownMenuItem as Mo, Z2DropdownMenuLabel as ho, Z2DropdownMenuPortal as Ao, Z2DropdownMenuRadioGroup as Po, Z2DropdownMenuRadioItem as No, Z2DropdownMenuSeparator as ko, Z2DropdownMenuShortcut as Eo, Z2DropdownMenuSub as Ro, Z2DropdownMenuSubContent as Ho, Z2DropdownMenuSubTrigger as yo, Z2DropdownMenuTrigger as Fo } from "./components/dropdown-menu/z2-dropdown-menu.js";
27
27
  import { FileUploadArea as _o } from "./components/file-upload-area/file-upload-area.js";
28
- import { DEFAULT_ACCEPT as Vo } from "./components/file-upload-area/file-upload-area.const.js";
28
+ import { DEFAULT_ACCEPT as Wo } from "./components/file-upload-area/file-upload-area.const.js";
29
29
  import { Input as Oo } from "./components/input/input.js";
30
30
  import { NavHeader as Jo } from "./components/nav-header/nav-header.js";
31
31
  import { NavItem as Yo } from "./components/nav-header/nav-item/nav-item.js";
@@ -36,7 +36,7 @@ import { Z2Tabs as xe, Z2TabsContent as ue, Z2TabsList as ie, Z2TabsTrigger as c
36
36
  import { Table as se, TableProvider as Ie } from "./components/table/table-provider.js";
37
37
  import { TableBody as be } from "./components/table/table.js";
38
38
  import { extractCellValue as De } from "./components/table/table.utils.js";
39
- import { DEFAULT_EMPTY_MESSAGE as Te, TABLE_CSS_CLASSES as we } from "./components/table/table.const.js";
39
+ import { DEFAULT_EMPTY_MESSAGE as ge, TABLE_CSS_CLASSES as we } from "./components/table/table.const.js";
40
40
  import { TableContext as Be, useTableContext as Le } from "./components/table/table.context.js";
41
41
  import { TableCell as he } from "./components/table/components/table-cell.js";
42
42
  import { NumberCell as Pe } from "./components/table/components/cell/number-cell.js";
@@ -44,7 +44,7 @@ import { BooleanCell as ke } from "./components/table/components/cell/boolean-ce
44
44
  import { LinkCell as Re } from "./components/table/components/cell/link-cell.js";
45
45
  import { DescriptionCell as ye } from "./components/table/components/cell/description-cell.js";
46
46
  import { AvatarCell as Ge } from "./components/table/components/cell/avatar-cell.js";
47
- import { LabelCell as We } from "./components/table/components/cell/label-cell.js";
47
+ import { LabelCell as Ve } from "./components/table/components/cell/label-cell.js";
48
48
  import { TableHeader as Ue } from "./components/table/components/table-header/table-header.js";
49
49
  import { default as Xe } from "./components/assets/icons/chevron-down.js";
50
50
  import { TableRow as Qe } from "./components/table/components/table-row.js";
@@ -62,12 +62,12 @@ import "react";
62
62
  import { Z2Tooltip as Zr } from "./components/tooltip/tooltip.js";
63
63
  import { default as Ir } from "./components/table-card/table-card.js";
64
64
  import { Badge as br, badgeVariants as Cr } from "./components/badge/badge.js";
65
- import { Avatar as gr, AvatarWithLabel as Tr } from "./components/avatar/avatar.js";
65
+ import { Avatar as Tr, AvatarWithLabel as gr } from "./components/avatar/avatar.js";
66
66
  import { Z2TextPreset as vr } from "./components/text-preset/text-preset.js";
67
67
  import { ColumnReOrder as Lr } from "./components/column-reorder/column-reorder.js";
68
68
  import { default as hr } from "./components/tree-checkbox-select/TreeCheckboxSelect.js";
69
69
  import { Z2Breadcrumb as Pr, Z2BreadcrumbEllipsis as Nr, Z2BreadcrumbItem as kr, Z2BreadcrumbLink as Er, Z2BreadcrumbList as Rr, Z2BreadcrumbPage as Hr, Z2BreadcrumbSeparator as yr } from "./components/breadcrumb/z2-breadcrumb.js";
70
- import { Z2RadioGroup as Gr, Z2RadioGroupIndicator as _r, Z2RadioGroupItem as Wr } from "./components/radio/z2-radio.js";
70
+ import { Z2RadioGroup as Gr, Z2RadioGroupIndicator as _r, Z2RadioGroupItem as Vr } from "./components/radio/z2-radio.js";
71
71
  import { default as Ur } from "./components/assets/icons/apartment-building.js";
72
72
  import { Check as Xr } from "./components/assets/icons/check.js";
73
73
  import { default as Qr } from "./components/assets/icons/chevron-left.js";
@@ -85,7 +85,7 @@ import { default as Zt } from "./components/assets/icons/link.js";
85
85
  import { default as It } from "./components/assets/icons/list-tree.js";
86
86
  import { default as bt } from "./components/assets/icons/media-record.js";
87
87
  import { Minus as Dt } from "./components/assets/icons/minus.js";
88
- import { default as Tt } from "./components/assets/icons/octagon-warning-Copy.js";
88
+ import { default as gt } from "./components/assets/icons/octagon-warning-Copy.js";
89
89
  import { default as vt } from "./components/assets/icons/pin.js";
90
90
  import { default as Lt } from "./components/assets/icons/sitemap.js";
91
91
  import { default as ht } from "./components/assets/icons/slider.js";
@@ -94,21 +94,23 @@ import { default as kt } from "./components/assets/icons/vector.js";
94
94
  import { XMark as Rt } from "./components/assets/icons/x-mark.js";
95
95
  import { default as yt } from "./components/assets/icons/x.js";
96
96
  import { default as Gt } from "./components/assets/icons/z2-icon.js";
97
- import { default as Wt } from "./components/assets/icons/z2-slash.js";
97
+ import { default as Vt } from "./components/assets/icons/z2-slash.js";
98
98
  import { default as Ut } from "./components/assets/icons/z2data.js";
99
- import { useTheme as Xt } from "./lib/theme.hook.js";
100
- import { cn as Qt } from "./lib/utils.js";
101
- import { Z2PopoverTrigger as jt } from "./components/collapsible-side-nav-bar/popover/popover-trigger.js";
102
- import { Z2PopoverContent as zt } from "./components/collapsible-side-nav-bar/popover/popover-content.js";
99
+ import { default as Xt } from "./components/assets/icons/vector_3.js";
100
+ import { default as Qt } from "./components/assets/icons/table-cols-2.js";
101
+ import { useTheme as jt } from "./lib/theme.hook.js";
102
+ import { cn as zt } from "./lib/utils.js";
103
+ import { Z2PopoverTrigger as $t } from "./components/collapsible-side-nav-bar/popover/popover-trigger.js";
104
+ import { Z2PopoverContent as ea } from "./components/collapsible-side-nav-bar/popover/popover-content.js";
103
105
  export {
104
106
  p as Alert,
105
107
  m as AlertCirclesIcon,
106
108
  n as AlertDescription,
107
109
  f as AlertTitle,
108
110
  Ur as ApartmentBuildingIcon,
109
- gr as Avatar,
111
+ Tr as Avatar,
110
112
  Ge as AvatarCell,
111
- Tr as AvatarWithLabel,
113
+ gr as AvatarWithLabel,
112
114
  br as Badge,
113
115
  ke as BooleanCell,
114
116
  x as Button,
@@ -121,10 +123,10 @@ export {
121
123
  F as CirclesIcon,
122
124
  Lr as ColumnReOrder,
123
125
  K as CountryFlags,
124
- Vo as DEFAULT_ACCEPT,
125
- Te as DEFAULT_EMPTY_MESSAGE,
126
+ Wo as DEFAULT_ACCEPT,
127
+ ge as DEFAULT_EMPTY_MESSAGE,
126
128
  _ as DatabaseCopy,
127
- W as DatabaseCopyIcon,
129
+ V as DatabaseCopyIcon,
128
130
  ye as DescriptionCell,
129
131
  et as DotsIcon,
130
132
  tt as DoubleChevronLeftIcon,
@@ -135,7 +137,7 @@ export {
135
137
  mt as HomeIcon,
136
138
  xt as InfoIcon,
137
139
  Oo as Input,
138
- We as LabelCell,
140
+ Ve as LabelCell,
139
141
  it as LeftArrowIcon,
140
142
  Re as LinkCell,
141
143
  Zt as LinkIcon,
@@ -146,7 +148,7 @@ export {
146
148
  Jo as NavHeader,
147
149
  Yo as NavItem,
148
150
  Pe as NumberCell,
149
- Tt as OctagonWarningIcon,
151
+ gt as OctagonWarningIcon,
150
152
  xr as PaginationInfo,
151
153
  ir as PaginationQuickJumper,
152
154
  vt as PinIcon,
@@ -163,6 +165,7 @@ export {
163
165
  be as TableBody,
164
166
  Ir as TableCard,
165
167
  he as TableCell,
168
+ Qt as TableCols2Icon,
166
169
  Be as TableContext,
167
170
  pr as TableFooter,
168
171
  fr as TableFooterContent,
@@ -176,6 +179,7 @@ export {
176
179
  Qe as TableRow,
177
180
  hr as TreeCheckboxSelect,
178
181
  Pt as UploadIcon,
182
+ Xt as Vector3Icon,
179
183
  kt as VectorIcon,
180
184
  U as WindowLeftCopy,
181
185
  O as WindowLeftCopyIcon,
@@ -222,14 +226,14 @@ export {
222
226
  bo as Z2DropdownSub,
223
227
  Co as Z2DropdownSubContent,
224
228
  Do as Z2DropdownSubItem,
225
- go as Z2DropdownSubTrigger,
229
+ To as Z2DropdownSubTrigger,
226
230
  Gt as Z2Icon,
227
231
  k as Z2Popover,
228
- zt as Z2PopoverContent,
229
- jt as Z2PopoverTrigger,
232
+ ea as Z2PopoverContent,
233
+ $t as Z2PopoverTrigger,
230
234
  Gr as Z2RadioGroup,
231
235
  _r as Z2RadioGroupIndicator,
232
- Wr as Z2RadioGroupItem,
236
+ Vr as Z2RadioGroupItem,
233
237
  qo as Z2Select,
234
238
  zo as Z2SelectContent,
235
239
  Ko as Z2SelectGroup,
@@ -242,14 +246,14 @@ export {
242
246
  pe as Z2SelectValue,
243
247
  s as Z2SideNavBar,
244
248
  D as Z2SideNavBarContent,
245
- T as Z2SideNavBarFooter,
249
+ g as Z2SideNavBarFooter,
246
250
  v as Z2SideNavBarGroup,
247
251
  b as Z2SideNavBarHeader,
248
252
  L as Z2SideNavBarItem,
249
253
  c as Z2SideNavBarProvider,
250
254
  h as Z2SideNavBarSeparator,
251
255
  I as Z2SidebarVariants,
252
- Wt as Z2SlashIcon,
256
+ Vt as Z2SlashIcon,
253
257
  fe as Z2Stepper,
254
258
  me as Z2StepperItem,
255
259
  xe as Z2Tabs,
@@ -260,9 +264,9 @@ export {
260
264
  Zr as Z2Tooltip,
261
265
  Cr as badgeVariants,
262
266
  u as buttonVariants,
263
- Qt as cn,
267
+ zt as cn,
264
268
  De as extractCellValue,
265
269
  Le as useTableContext,
266
- Xt as useTheme,
270
+ jt as useTheme,
267
271
  P as useZ2SideNavBar
268
272
  };
@@ -34,3 +34,5 @@ export { default as XIcon } from './x';
34
34
  export { default as Z2Icon } from './z2-icon';
35
35
  export { default as Z2SlashIcon } from './z2-slash';
36
36
  export { default as Z2DataIcon } from './z2data';
37
+ export { default as Vector3Icon } from './vector_3';
38
+ export { default as TableCols2Icon } from './table-cols-2';
@@ -0,0 +1,8 @@
1
+ import { SVGProps } from 'react';
2
+ type IconProps = SVGProps<SVGSVGElement> & {
3
+ secondaryfill?: string;
4
+ strokewidth?: number;
5
+ title?: string;
6
+ };
7
+ declare function TableCols2({ fill, secondaryfill, strokewidth, width, height, title, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
8
+ export default TableCols2;
@@ -0,0 +1,6 @@
1
+ import { SVGProps } from 'react';
2
+ type IconProps = SVGProps<SVGSVGElement> & {
3
+ title?: string;
4
+ };
5
+ declare function Vector3({ fill, width, height, title, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
6
+ export default Vector3;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { TableProps, TableSchema, TableSearch, TableSort } from '../table/table.type';
3
- import { TableFilter } from '../table-filter/table-filter.type';
3
+ import { TableFilter, FilterRule } from '../table-filter/table-filter.type';
4
4
  import { PaginationProps, PaginationInfoProps, PaginationQuickJumperProps } from '../table/components/pagination/pagination.type';
5
5
  import { FilterSchema } from '../table-filter/table-filter.type';
6
6
  export interface TableCardProps {
@@ -18,6 +18,7 @@ export interface TableCardProps {
18
18
  quickFilters?: string[];
19
19
  showFilterButton?: boolean;
20
20
  filterSchema: FilterSchema;
21
+ onDynamicChange?: (filters: FilterRule[]) => void;
21
22
  };
22
23
  headerLeftContent?: React.ReactNode;
23
24
  headerActions?: React.ReactNode;
@@ -1,14 +1,5 @@
1
- interface UseNumberFilterProps {
2
- value: {
3
- condition: string;
4
- value: string;
5
- };
6
- onChange: (update: {
7
- condition?: string;
8
- value?: string;
9
- }) => void;
10
- }
11
- export declare const useNumberFilter: ({ value, onChange }: UseNumberFilterProps) => {
1
+ import { FilterComponentProps } from '../../table-filter.type';
2
+ export declare const useNumberFilter: ({ value, onChange }: FilterComponentProps) => {
12
3
  specificAmount: string;
13
4
  atLeast: string;
14
5
  noMoreThan: string;
@@ -20,4 +11,3 @@ export declare const useNumberFilter: ({ value, onChange }: UseNumberFilterProps
20
11
  resetAtLeast: () => void;
21
12
  resetNoMoreThan: () => void;
22
13
  };
23
- export {};
@@ -21,6 +21,7 @@ export type FilterSchema = FilterSchemaField[];
21
21
  export type TableFilter = {
22
22
  value: FilterRule[];
23
23
  onChange: (filters: FilterRule[]) => void;
24
+ onDynamicChange?: (filters: FilterRule[]) => void;
24
25
  };
25
26
  export interface TableFilterProps {
26
27
  filterSchema: FilterSchema;
@@ -32,9 +33,9 @@ export type FilterComponentProps = {
32
33
  condition?: string;
33
34
  value?: string | string[];
34
35
  }) => void;
35
- value: {
36
+ value?: {
36
37
  condition?: string;
37
- value: string | string[];
38
+ value?: string | string[];
38
39
  };
39
40
  filterOptions?: FilterOption[];
40
41
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztwoint/z-ui",
3
- "version": "0.1.85",
3
+ "version": "0.1.87",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",