@ztwoint/z-ui 0.1.64 → 0.1.66

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 (89) hide show
  1. package/dist/components/column-reorder/column-reorder.js +20 -10
  2. package/dist/components/column-reorder/column-reorder.type.d.ts +1 -0
  3. package/dist/components/column-reorder/components/column-item/column-item.js +42 -37
  4. package/dist/components/column-reorder/components/column-item/column-item.type.d.ts +1 -0
  5. package/dist/components/table/components/cell/avatar-cell.js +3 -2
  6. package/dist/components/table/index.d.ts +1 -1
  7. package/dist/components/table/table-provider.d.ts +0 -2
  8. package/dist/components/table/table-provider.js +20 -23
  9. package/dist/components/table/table.type.d.ts +0 -20
  10. package/dist/components/table-card/table-card.js +50 -49
  11. package/dist/components/table-card/table-card.type.d.ts +3 -1
  12. package/dist/components/{table/components/table-filter → table-filter}/close-filter-confirm/filter-confirmation-dialog.js +2 -2
  13. package/dist/{types/components/table/components → components}/table-filter/close-filter-confirm/filter-confirmation-dialog.utils.d.ts +1 -1
  14. package/dist/components/{table/components/table-filter → table-filter}/filters/checkbox.js +2 -2
  15. package/dist/components/{table/components/table-filter → table-filter}/filters/number/filter-input-field.js +1 -1
  16. package/dist/components/{table/components/table-filter → table-filter}/filters/text.js +3 -3
  17. package/dist/components/table-filter/index.d.ts +9 -0
  18. package/dist/components/table-filter/index.js +11 -0
  19. package/dist/{types/components/table/components → components}/table-filter/selected-filters-display/selected-filters-display.type.d.ts +2 -2
  20. package/dist/components/{table/components/table-filter → table-filter}/selected-filters-display/selected-filters-display.utils.d.ts +2 -2
  21. package/dist/components/table-filter/selected-filters-display/selected-filters-display.utils.js +30 -0
  22. package/dist/components/{table/components/table-filter → table-filter}/table-filter-button.js +71 -67
  23. package/dist/components/table-filter/table-filter-column-button.js +110 -0
  24. package/dist/components/table-filter/table-filter-provider.d.ts +3 -0
  25. package/dist/components/table-filter/table-filter-provider.js +27 -0
  26. package/dist/components/{table/components/table-filter → table-filter}/table-filter.context.d.ts +2 -4
  27. package/dist/components/{table/components/table-filter → table-filter}/table-filter.hook.d.ts +2 -4
  28. package/dist/components/{table/components/table-filter → table-filter}/table-filter.hook.js +23 -24
  29. package/dist/components/table-filter/table-filter.type.d.ts +44 -0
  30. package/dist/routes/table.d.ts +3 -0
  31. package/dist/types/components/column-reorder/column-reorder.type.d.ts +1 -0
  32. package/dist/types/components/column-reorder/components/column-item/column-item.type.d.ts +1 -0
  33. package/dist/types/components/table/index.d.ts +1 -1
  34. package/dist/types/components/table/table-provider.d.ts +0 -2
  35. package/dist/types/components/table/table.type.d.ts +0 -20
  36. package/dist/types/components/table-card/table-card.type.d.ts +4 -1
  37. package/dist/{components/table → types}/components/table-filter/close-filter-confirm/filter-confirmation-dialog.utils.d.ts +1 -1
  38. package/dist/types/components/table-filter/index.d.ts +9 -0
  39. package/dist/{components/table → types}/components/table-filter/selected-filters-display/selected-filters-display.type.d.ts +2 -2
  40. package/dist/types/components/{table/components/table-filter → table-filter}/selected-filters-display/selected-filters-display.utils.d.ts +2 -2
  41. package/dist/types/components/table-filter/table-filter-provider.d.ts +3 -0
  42. package/dist/types/components/{table/components/table-filter → table-filter}/table-filter.context.d.ts +3 -3
  43. package/dist/types/components/{table/components/table-filter → table-filter}/table-filter.hook.d.ts +2 -3
  44. package/dist/types/components/table-filter/table-filter.type.d.ts +44 -0
  45. package/dist/types/routes/table.d.ts +3 -0
  46. package/package.json +1 -1
  47. package/dist/components/table/components/table-filter/index.d.ts +0 -4
  48. package/dist/components/table/components/table-filter/selected-filters-display/selected-filters-display.utils.js +0 -26
  49. package/dist/components/table/components/table-filter/table-filter-column-button.js +0 -108
  50. package/dist/components/table/components/table-filter/table-filter-provider.d.ts +0 -14
  51. package/dist/components/table/components/table-filter/table-filter-provider.js +0 -32
  52. package/dist/components/table/components/table-filter/table-filter.type.d.ts +0 -19
  53. package/dist/types/components/table/components/table-filter/index.d.ts +0 -4
  54. package/dist/types/components/table/components/table-filter/table-filter-provider.d.ts +0 -14
  55. package/dist/types/components/table/components/table-filter/table-filter.type.d.ts +0 -19
  56. /package/dist/components/{table/components/table-filter → table-filter}/close-filter-confirm/filter-confirmation-dialog.d.ts +0 -0
  57. /package/dist/components/{table/components/table-filter → table-filter}/close-filter-confirm/filter-confirmation-dialog.utils.js +0 -0
  58. /package/dist/components/{table/components/table-filter → table-filter}/filters/boolean.d.ts +0 -0
  59. /package/dist/components/{table/components/table-filter → table-filter}/filters/boolean.js +0 -0
  60. /package/dist/components/{table/components/table-filter → table-filter}/filters/checkbox.d.ts +0 -0
  61. /package/dist/components/{table/components/table-filter → table-filter}/filters/index.d.ts +0 -0
  62. /package/dist/components/{table/components/table-filter → table-filter}/filters/number/filter-input-field.d.ts +0 -0
  63. /package/dist/components/{table/components/table-filter → table-filter}/filters/number/index.d.ts +0 -0
  64. /package/dist/components/{table/components/table-filter → table-filter}/filters/number/number.d.ts +0 -0
  65. /package/dist/components/{table/components/table-filter → table-filter}/filters/number/number.hook.d.ts +0 -0
  66. /package/dist/components/{table/components/table-filter → table-filter}/filters/number/number.hook.js +0 -0
  67. /package/dist/components/{table/components/table-filter → table-filter}/filters/number/number.js +0 -0
  68. /package/dist/components/{table/components/table-filter → table-filter}/filters/text.d.ts +0 -0
  69. /package/dist/components/{table/components/table-filter → table-filter}/selected-filters-display/index.d.ts +0 -0
  70. /package/dist/components/{table/components/table-filter → table-filter}/selected-filters-display/selected-filters-display.d.ts +0 -0
  71. /package/dist/components/{table/components/table-filter → table-filter}/selected-filters-display/selected-filters-display.js +0 -0
  72. /package/dist/components/{table/components/table-filter → table-filter}/table-filter-button.d.ts +0 -0
  73. /package/dist/components/{table/components/table-filter → table-filter}/table-filter-column-button.d.ts +0 -0
  74. /package/dist/components/{table/components/table-filter → table-filter}/table-filter-column-button.type.d.ts +0 -0
  75. /package/dist/components/{table/components/table-filter → table-filter}/table-filter.context.js +0 -0
  76. /package/dist/types/components/{table/components/table-filter → table-filter}/close-filter-confirm/filter-confirmation-dialog.d.ts +0 -0
  77. /package/dist/types/components/{table/components/table-filter → table-filter}/filters/boolean.d.ts +0 -0
  78. /package/dist/types/components/{table/components/table-filter → table-filter}/filters/checkbox.d.ts +0 -0
  79. /package/dist/types/components/{table/components/table-filter → table-filter}/filters/index.d.ts +0 -0
  80. /package/dist/types/components/{table/components/table-filter → table-filter}/filters/number/filter-input-field.d.ts +0 -0
  81. /package/dist/types/components/{table/components/table-filter → table-filter}/filters/number/index.d.ts +0 -0
  82. /package/dist/types/components/{table/components/table-filter → table-filter}/filters/number/number.d.ts +0 -0
  83. /package/dist/types/components/{table/components/table-filter → table-filter}/filters/number/number.hook.d.ts +0 -0
  84. /package/dist/types/components/{table/components/table-filter → table-filter}/filters/text.d.ts +0 -0
  85. /package/dist/types/components/{table/components/table-filter → table-filter}/selected-filters-display/index.d.ts +0 -0
  86. /package/dist/types/components/{table/components/table-filter → table-filter}/selected-filters-display/selected-filters-display.d.ts +0 -0
  87. /package/dist/types/components/{table/components/table-filter → table-filter}/table-filter-button.d.ts +0 -0
  88. /package/dist/types/components/{table/components/table-filter → table-filter}/table-filter-column-button.d.ts +0 -0
  89. /package/dist/types/components/{table/components/table-filter → table-filter}/table-filter-column-button.type.d.ts +0 -0
@@ -1,5 +1,4 @@
1
1
  import { FC } from 'react';
2
- import { FilterComponentType } from './components/table-filter/table-filter.type';
3
2
  export type CellType = 'number' | 'boolean' | 'checkbox' | 'link' | 'avatar' | 'label' | 'description' | 'text';
4
3
  export type CellValue = string | number | boolean | null | undefined;
5
4
  export type CellRendererProps = {
@@ -8,21 +7,6 @@ export type CellRendererProps = {
8
7
  index: number;
9
8
  };
10
9
  export type CellRenderer = FC<CellRendererProps>;
11
- export type FilterCondition = 'contains' | 'notEqual' | 'equal' | '>' | '<' | '=' | '!=';
12
- export type FilterRule = {
13
- field: string;
14
- condition?: string;
15
- value: string | string[];
16
- };
17
- export type FilterOption = {
18
- label: string;
19
- value: string;
20
- total?: number;
21
- };
22
- export type TableFilter = {
23
- value: FilterRule[];
24
- onChange: (filters: FilterRule[]) => void;
25
- };
26
10
  export type TableSearch = {
27
11
  value: string;
28
12
  onChange: (searchValue: string) => void;
@@ -68,10 +52,8 @@ type ColumnBase<T extends CellType> = {
68
52
  title: string;
69
53
  cellType: T;
70
54
  cellRenderer?: CellRenderer;
71
- filterable?: boolean;
72
55
  hideable?: boolean;
73
56
  sortable?: boolean;
74
- filterOptions?: FilterOption[];
75
57
  };
76
58
  export type TableSchemaColumn = (ColumnBase<'number'> & {
77
59
  valueGetter?: (record: Record<string, unknown>) => CellValue | CellPropsByType['number'];
@@ -97,8 +79,6 @@ export type TableProps = {
97
79
  schema: TableSchema;
98
80
  loading?: boolean;
99
81
  emptyMessage?: string;
100
- filter?: TableFilter;
101
- filterComponents?: Record<string, FilterComponentType>;
102
82
  pagination?: TablePaginationConfig;
103
83
  sort?: TableSort;
104
84
  customCells?: Record<string, CellRenderer>;
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
- import { TableProps, TableSchema, TableFilter, TableSearch, TableSort } from '../table/table.type';
2
+ import { TableProps, TableSchema, TableSearch, TableSort } from '../table/table.type';
3
+ import { TableFilter } from '../table-filter/table-filter.type';
3
4
  import { PaginationProps, PaginationInfoProps, PaginationQuickJumperProps } from '../table/components/pagination/pagination.type';
5
+ import { FilterSchema } from '../table-filter/table-filter.type';
4
6
  export interface TableCardProps {
5
7
  dataSource: Record<string, unknown>[];
6
8
  schema: TableSchema;
@@ -15,6 +17,7 @@ export interface TableCardProps {
15
17
  filter?: Partial<TableFilter> & {
16
18
  quickFilters?: string[];
17
19
  showFilterButton?: boolean;
20
+ filterSchema: FilterSchema;
18
21
  };
19
22
  headerLeftContent?: React.ReactNode;
20
23
  headerActions?: React.ReactNode;
@@ -1,4 +1,4 @@
1
- import { FilterRule } from '../../../table.type';
1
+ import { FilterRule } from '../table-filter.type';
2
2
  /**
3
3
  * Compares two filter arrays to determine if they are different
4
4
  */
@@ -0,0 +1,9 @@
1
+ import { TableFilterProviderProps } from './table-filter.type';
2
+ import { TableFilterButton } from './table-filter-button';
3
+ import { TableFilterColumnButton } from './table-filter-column-button';
4
+ export { useTableFilterContext } from './table-filter.context';
5
+ export interface FilterCompoundComponent extends React.FC<TableFilterProviderProps> {
6
+ FilterButton: typeof TableFilterButton;
7
+ FilterColumnButton: typeof TableFilterColumnButton;
8
+ }
9
+ export declare const Filter: FilterCompoundComponent;
@@ -1,7 +1,7 @@
1
- import { FilterRule, TableSchema } from '../../../table.type';
1
+ import { FilterRule, FilterSchema } from '../table-filter.type';
2
2
  export interface SelectedFilterDisplayProps {
3
3
  selectedFilters: FilterRule[];
4
- schema: TableSchema;
4
+ schema: FilterSchema;
5
5
  }
6
6
  export interface FilterDisplayItem {
7
7
  field: string;
@@ -1,6 +1,6 @@
1
- import { FilterRule, TableSchema, FilterOption } from '../../../table.type';
1
+ import { FilterRule, FilterSchema, FilterOption } from '../table-filter.type';
2
2
  import { FilterDisplayItem } from './selected-filters-display.type';
3
3
  export declare const formatFilterValue: (value: string | string[]) => string;
4
4
  export declare const getFilterCount: (filterRule: FilterRule, filterOptions?: FilterOption[]) => number | undefined;
5
- export declare const createFilterDisplayItems: (selectedFilters: FilterRule[], schema: TableSchema) => FilterDisplayItem[];
5
+ export declare const createFilterDisplayItems: (selectedFilters: FilterRule[], schema: FilterSchema) => FilterDisplayItem[];
6
6
  export declare const calculateTotalCount: (filterDisplayItems: FilterDisplayItem[]) => number;
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { TableFilterProviderProps } from './table-filter.type';
3
+ export declare const TableFilterProvider: React.FC<TableFilterProviderProps>;
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
- import { TableSchema, TableFilter as TableFilterType, FilterRule } from '../../table.type';
2
+ import { FilterRule } from './table-filter.type';
3
+ import type { TableFilter as TableFilterType, FilterSchema } from './table-filter.type';
3
4
  import { FilterComponentType } from './table-filter.type';
4
5
  export interface TableFilterContextValue {
5
6
  selectedColumn: string | null;
@@ -12,9 +13,8 @@ export interface TableFilterContextValue {
12
13
  resetToAppliedFilters: () => void;
13
14
  applyFilters: () => void;
14
15
  hasActiveFilters: boolean;
15
- filterableFields: TableSchema;
16
16
  tempFilters: FilterRule[];
17
- schema: TableSchema;
17
+ filterSchema: FilterSchema;
18
18
  filter: TableFilterType;
19
19
  filterComponents?: Record<string, FilterComponentType>;
20
20
  }
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { TableFilterProps } from './table-filter.type';
3
- import { FilterRule } from '../../table.type';
4
- declare const useTableFilter: ({ filter, schema }: TableFilterProps) => {
3
+ import { FilterRule } from './table-filter.type';
4
+ declare const useTableFilter: ({ filter, filterSchema }: TableFilterProps) => {
5
5
  selectedColumn: string | null;
6
6
  setSelectedColumn: React.Dispatch<React.SetStateAction<string | null>>;
7
7
  getFilterForColumn: (columnKey: string) => FilterRule | undefined;
@@ -13,6 +13,5 @@ declare const useTableFilter: ({ filter, schema }: TableFilterProps) => {
13
13
  applyFilters: () => void;
14
14
  hasActiveFilters: boolean;
15
15
  tempFilters: FilterRule[];
16
- filterableFields: import("../../table.type").TableSchemaColumn[];
17
16
  };
18
17
  export default useTableFilter;
@@ -0,0 +1,44 @@
1
+ import { FC } from 'react';
2
+ export type FilterCondition = 'contains' | 'notEqual' | 'equal' | '>' | '<' | '=' | '!=';
3
+ export type FilterRule = {
4
+ field: string;
5
+ condition?: string;
6
+ value: string | string[];
7
+ };
8
+ export type FilterOption = {
9
+ label: string;
10
+ value: string;
11
+ total?: number;
12
+ };
13
+ export type FilterFieldType = 'string' | 'number' | 'boolean' | 'checkbox';
14
+ export type FilterSchemaField = {
15
+ filterKey: string;
16
+ title: string;
17
+ type: FilterFieldType;
18
+ options?: Record<string, number>;
19
+ };
20
+ export type FilterSchema = FilterSchemaField[];
21
+ export type TableFilter = {
22
+ value: FilterRule[];
23
+ onChange: (filters: FilterRule[]) => void;
24
+ };
25
+ export interface TableFilterProps {
26
+ filterSchema: FilterSchema;
27
+ filter: TableFilter;
28
+ filterComponents?: Record<string, FilterComponentType>;
29
+ }
30
+ export type FilterComponentProps = {
31
+ onChange: (input: {
32
+ condition?: string;
33
+ value?: string | string[];
34
+ }) => void;
35
+ value: {
36
+ condition?: string;
37
+ value: string | string[];
38
+ };
39
+ filterOptions?: FilterOption[];
40
+ };
41
+ export interface TableFilterProviderProps extends TableFilterProps {
42
+ children: React.ReactNode;
43
+ }
44
+ export type FilterComponentType = FC<FilterComponentProps>;
@@ -1,2 +1,5 @@
1
+ import { TableSchema } from '../components/table';
2
+ import type { FilterSchema } from '../components/table-filter/table-filter.type';
3
+ export declare const createFilterSchemaFromTableSchema: (tableSchema: TableSchema) => FilterSchema;
1
4
  declare const TablePage: () => import("react/jsx-runtime").JSX.Element;
2
5
  export default TablePage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztwoint/z-ui",
3
- "version": "0.1.64",
3
+ "version": "0.1.66",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -1,4 +0,0 @@
1
- export { TableFilterProvider, TableFilter } from './table-filter-provider';
2
- export { TableFilterButton } from './table-filter-button';
3
- export { TableFilterColumnButton } from './table-filter-column-button';
4
- export { useTableFilterContext } from './table-filter.context';
@@ -1,26 +0,0 @@
1
- const o = (n, u) => {
2
- if (!u || u.length === 0) return n.value !== "" ? 1 : 0;
3
- if (Array.isArray(n.value)) {
4
- const t = u.filter(
5
- (r) => n.value.includes(r.value)
6
- ).reduce((r, a) => r + (a.total || 0), 0);
7
- return t > 0 ? t : void 0;
8
- } else {
9
- const e = u.find((t) => t.value === n.value);
10
- return e == null ? void 0 : e.total;
11
- }
12
- }, l = (n, u) => n.filter((e) => Array.isArray(e.value) ? e.value.length > 0 : e.value !== "").map((e) => {
13
- const t = u.find((a) => a.key === e.field), r = o(e, t == null ? void 0 : t.filterOptions);
14
- return {
15
- field: e.field,
16
- fieldTitle: (t == null ? void 0 : t.title) || e.field,
17
- value: e.value,
18
- condition: e.condition,
19
- count: r
20
- };
21
- }), c = (n) => n.reduce((u, e) => u + (e.count || 1), 0);
22
- export {
23
- c as calculateTotalCount,
24
- l as createFilterDisplayItems,
25
- o as getFilterCount
26
- };
@@ -1,108 +0,0 @@
1
- import { jsxs as i, jsx as n } from "react/jsx-runtime";
2
- import * as m from "react";
3
- import { Button as u } from "../../../button/button.js";
4
- import { useTableFilterContext as K } from "./table-filter.context.js";
5
- import U from "./filters/text.js";
6
- import I from "./filters/boolean.js";
7
- import P from "./filters/number/number.js";
8
- import V from "./filters/checkbox.js";
9
- import q from "../../../assets/icons/circle-check-filled.js";
10
- import { useClickOutside as E } from "../../../../hooks/useClickOutside.js";
11
- import { getFilterCount as G } from "./selected-filters-display/selected-filters-display.utils.js";
12
- import { FilterConfirmationDialog as H } from "./close-filter-confirm/filter-confirmation-dialog.js";
13
- import { hasUnsavedFilterChangesForColumn as b } from "./close-filter-confirm/filter-confirmation-dialog.utils.js";
14
- const oe = ({ filterName: l }) => {
15
- const [a, t] = m.useState(!1), [x, s] = m.useState(!1), h = m.useRef(null), {
16
- getFilterForColumn: k,
17
- hasAppliedFilterForColumn: y,
18
- updateColumnFilter: C,
19
- applyFilters: c,
20
- resetToAppliedFilters: w,
21
- schema: T,
22
- filterComponents: d = {},
23
- tempFilters: F,
24
- filter: g
25
- } = K();
26
- E(h, () => {
27
- b(l, F, g.value) && a ? s(!0) : t(!1);
28
- });
29
- const A = () => {
30
- c(), t(!1);
31
- }, O = () => {
32
- s(!1), t(!1);
33
- }, $ = () => {
34
- w(), s(!1), t(!1);
35
- }, R = () => {
36
- s(!1);
37
- }, e = T.find((r) => r.key === l);
38
- if (!e)
39
- return console.warn(`Column "${l}" not found in schema`), null;
40
- if (e.filterable === !1)
41
- return console.warn(`Column "${l}" is not filterable`), null;
42
- const z = {
43
- boolean: I,
44
- text: U,
45
- number: P,
46
- checkbox: V
47
- }, v = e.cellType && (d == null ? void 0 : d[e.cellType]) || z[e.cellType ?? "text"];
48
- if (!v)
49
- return console.warn(
50
- `No filter component found for column "${e.key}" with cellType "${e.cellType}". Provide a custom filter component or use supported types: "text", "number", "boolean", "checkbox".`
51
- ), null;
52
- const o = k(l), f = y(l), p = o ? G(o, e.filterOptions) : void 0, D = {
53
- condition: (o == null ? void 0 : o.condition) || "",
54
- value: (o == null ? void 0 : o.value) || ""
55
- }, j = () => {
56
- C(l, "", ""), c(), t(!1);
57
- }, B = () => {
58
- c(), t(!1);
59
- };
60
- return /* @__PURE__ */ i("div", { className: "relative", ref: h, children: [
61
- /* @__PURE__ */ n(
62
- u,
63
- {
64
- onClick: () => {
65
- t(!a);
66
- },
67
- variant: f ? "filled" : "stroke",
68
- shade: f ? "brand" : "neutral",
69
- size: "small",
70
- children: /* @__PURE__ */ i("span", { className: "flex items-center gap-2", children: [
71
- e.title,
72
- f && /* @__PURE__ */ n(q, { className: "w-4 h-4 text-white flex-shrink-0" })
73
- ] })
74
- }
75
- ),
76
- a && /* @__PURE__ */ i("div", { className: "absolute top-full left-0 mt-2 w-80 bg-surface-neutral-default border border-stroke-solid-light rounded-2xl z-10 overflow-hidden shadow-lg", children: [
77
- /* @__PURE__ */ n(
78
- v,
79
- {
80
- value: D,
81
- onChange: ({ condition: r, value: S }) => C(l, r, S),
82
- filterOptions: e.filterOptions
83
- }
84
- ),
85
- !!p && /* @__PURE__ */ i("div", { className: "flex justify-between gap-2 p-3 border-t border-stroke-solid-medium", children: [
86
- /* @__PURE__ */ n(u, { onClick: j, variant: "stroke", shade: "neutral", size: "small", children: "Clear All" }),
87
- /* @__PURE__ */ n(u, { onClick: B, variant: "filled", shade: "neutral", size: "small", children: `Apply${p !== void 0 ? ` ${p}` : ""}` })
88
- ] })
89
- ] }),
90
- x && /* @__PURE__ */ n(
91
- H,
92
- {
93
- onClose: R,
94
- onKeepChanges: O,
95
- onRevertChanges: $,
96
- onApplyChanges: A,
97
- hasUnsavedChanges: b(
98
- l,
99
- F,
100
- g.value
101
- )
102
- }
103
- )
104
- ] });
105
- };
106
- export {
107
- oe as TableFilterColumnButton
108
- };
@@ -1,14 +0,0 @@
1
- import { TableFilterProps } from './table-filter.type';
2
- import { TableFilterButton } from './table-filter-button';
3
- import { TableFilterColumnButton } from './table-filter-column-button';
4
- import * as React from 'react';
5
- export interface TableFilterProviderProps extends TableFilterProps {
6
- children: React.ReactNode;
7
- }
8
- export declare const TableFilterProvider: React.FC<TableFilterProviderProps>;
9
- interface TableFilterCompoundComponent extends React.FC<TableFilterProviderProps> {
10
- FilterButton: typeof TableFilterButton;
11
- FilterColumnButton: typeof TableFilterColumnButton;
12
- }
13
- export declare const TableFilter: TableFilterCompoundComponent;
14
- export {};
@@ -1,32 +0,0 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import m from "./table-filter.hook.js";
3
- import { TableFilterContext as a } from "./table-filter.context.js";
4
- import { TableFilterButton as F } from "./table-filter-button.js";
5
- import { TableFilterColumnButton as b } from "./table-filter-column-button.js";
6
- const p = ({
7
- children: e,
8
- filterComponents: l = {},
9
- schema: o,
10
- filter: t
11
- }) => {
12
- const n = m({
13
- schema: o,
14
- filter: t || { value: [], onChange: () => {
15
- } }
16
- });
17
- if (!t)
18
- return null;
19
- const i = {
20
- ...n,
21
- schema: o,
22
- filter: t,
23
- filterComponents: l
24
- };
25
- return /* @__PURE__ */ u(a.Provider, { value: i, children: e });
26
- }, r = p;
27
- r.FilterButton = F;
28
- r.FilterColumnButton = b;
29
- export {
30
- r as TableFilter,
31
- p as TableFilterProvider
32
- };
@@ -1,19 +0,0 @@
1
- import { FC } from 'react';
2
- import { TableFilter, TableSchema, FilterOption } from '../../table.type';
3
- export interface TableFilterProps {
4
- schema: TableSchema;
5
- filter: TableFilter;
6
- filterComponents?: Record<string, FilterComponentType>;
7
- }
8
- export type FilterComponentProps = {
9
- onChange: (input: {
10
- condition?: string;
11
- value?: string | string[];
12
- }) => void;
13
- value: {
14
- condition?: string;
15
- value: string | string[];
16
- };
17
- filterOptions?: FilterOption[];
18
- };
19
- export type FilterComponentType = FC<FilterComponentProps>;
@@ -1,4 +0,0 @@
1
- export { TableFilterProvider, TableFilter } from './table-filter-provider';
2
- export { TableFilterButton } from './table-filter-button';
3
- export { TableFilterColumnButton } from './table-filter-column-button';
4
- export { useTableFilterContext } from './table-filter.context';
@@ -1,14 +0,0 @@
1
- import * as React from 'react';
2
- import { TableFilterProps } from './table-filter.type';
3
- import { TableFilterButton } from './table-filter-button';
4
- import { TableFilterColumnButton } from './table-filter-column-button';
5
- export interface TableFilterProviderProps extends TableFilterProps {
6
- children: React.ReactNode;
7
- }
8
- export declare const TableFilterProvider: React.FC<TableFilterProviderProps>;
9
- interface TableFilterCompoundComponent extends React.FC<TableFilterProviderProps> {
10
- FilterButton: typeof TableFilterButton;
11
- FilterColumnButton: typeof TableFilterColumnButton;
12
- }
13
- export declare const TableFilter: TableFilterCompoundComponent;
14
- export {};
@@ -1,19 +0,0 @@
1
- import { FC } from 'react';
2
- import { TableFilter, TableSchema, FilterOption } from '../../table.type';
3
- export interface TableFilterProps {
4
- schema: TableSchema;
5
- filter: TableFilter;
6
- filterComponents?: Record<string, FilterComponentType>;
7
- }
8
- export type FilterComponentProps = {
9
- onChange: (input: {
10
- condition?: string;
11
- value?: string | string[];
12
- }) => void;
13
- value: {
14
- condition?: string;
15
- value: string | string[];
16
- };
17
- filterOptions?: FilterOption[];
18
- };
19
- export type FilterComponentType = FC<FilterComponentProps>;