@trsys-tech/matrix-library 0.6.2 → 0.6.3-canary-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { VariantProps, TVReturnType } from 'tailwind-variants';
2
- import { TVConfig } from 'tailwind-variants/dist/config';
2
+ import { TVConfig } from 'tailwind-variants/dist/config.js';
3
3
  import * as React from "react";
4
4
  declare const badgeVariants: TVReturnType<{
5
5
  variant: {
@@ -1,5 +1,5 @@
1
1
  import { VariantProps, TVReturnType } from 'tailwind-variants';
2
- import { TVConfig } from 'tailwind-variants/dist/config';
2
+ import { TVConfig } from 'tailwind-variants/dist/config.js';
3
3
  import * as React from "react";
4
4
  declare const buttonVariants: TVReturnType<{
5
5
  variant: {
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { VariantProps, TVReturnType } from 'tailwind-variants';
3
- import { TVConfig } from 'tailwind-variants/dist/config';
3
+ import { TVConfig } from 'tailwind-variants/dist/config.js';
4
4
  declare const chipVariants: TVReturnType<{
5
5
  variant: {
6
6
  primary: string;
@@ -4,7 +4,13 @@ import { GridApi, Theme, ThemeDefaultParams } from 'ag-grid-community';
4
4
  import { ButtonProps } from '../button/Button';
5
5
  import { IconButtonProps } from '../icon-botton/IconButton';
6
6
  import { PopoverContentProps, PopoverProps, PopoverTriggerProps } from '../popover/Popover';
7
+ /**
8
+ * Default ag-Grid theme used by DataGrid.
9
+ */
7
10
  declare const dataGridDefaultTheme: Theme< ThemeDefaultParams>;
11
+ /**
12
+ * Shared DataGrid state exposed through context.
13
+ */
8
14
  type DataGridContext = {
9
15
  api: GridApi | null;
10
16
  setApi: (value: GridApi) => void;
@@ -22,44 +28,165 @@ type DataGridContext = {
22
28
  };
23
29
  declare const DataGridContext: React.Context<DataGridContext | null>;
24
30
  declare const useDataGrid: () => DataGridContext;
31
+ /**
32
+ * Props for the root DataGrid provider.
33
+ */
25
34
  type DataGridProps = {
35
+ /** Content rendered inside the provider. */
26
36
  children: React.ReactNode;
27
37
  };
38
+ /**
39
+ * DataGrid provider.
40
+ * Provides shared state for the grid shell, content, and toolbar actions.
41
+ * @param {DataGridProps} props - DataGrid props.
42
+ * @param {React.ReactNode} children - Content rendered inside the provider.
43
+ * @returns {React.ReactElement}
44
+ */
28
45
  declare const DataGrid: React.FC<DataGridProps>;
46
+ /**
47
+ * Props for the Ag Grid content wrapper.
48
+ */
29
49
  type DataGridContentProps = Omit<AgGridReactProps, "theme"> & {
50
+ /** Optional theme override forwarded to ag-Grid. */
30
51
  theme?: Theme;
31
52
  };
53
+ /**
54
+ * DataGridContent component.
55
+ * Connects ag-Grid to the shared DataGrid context and keeps pinned rows separate from the main row set.
56
+ * @param {DataGridContentProps} props - Ag Grid props.
57
+ * @param {Theme} [theme] - Optional ag-Grid theme override.
58
+ * @param {GridReadyEvent} [onGridReady] - Called when the grid becomes ready.
59
+ * @param {any[] | null | undefined} [rowData] - Row data rendered by the grid.
60
+ * @param {string} [quickFilterText] - Quick filter text synced from the search action.
61
+ * @param {React.CSSProperties} [containerStyle] - Inline styles applied to the grid container.
62
+ * @param {Function} [getRowId] - Resolves the row id used to keep pinned rows stable.
63
+ * @param {React.ForwardedRef<AgGridReact>} ref - Grid ref.
64
+ * @returns {React.ReactElement}
65
+ */
32
66
  declare const DataGridContent: React.ForwardRefExoticComponent<Omit<AgGridReactProps<any>, "theme"> & {
67
+ /** Optional theme override forwarded to ag-Grid. */
33
68
  theme?: Theme;
34
69
  } & React.RefAttributes<AgGridReact<any>>>;
70
+ /**
71
+ * Props for the DataGrid action bar container.
72
+ */
35
73
  type DatagridActionBarProps = HTMLAttributes<HTMLDivElement> & {};
74
+ /**
75
+ * DataGrid action bar.
76
+ * Marks the grid as having a toolbar so the grid can adjust border radius and height.
77
+ * @param {DatagridActionBarProps} props - Action bar props.
78
+ * @param {React.ReactNode} children - Action bar content.
79
+ * @param {string} className - Additional classes applied to the action bar.
80
+ * @returns {React.ReactElement}
81
+ */
36
82
  declare const DataGridActionBar: React.FC<DatagridActionBarProps>;
83
+ /**
84
+ * Props for SearchAction.
85
+ */
37
86
  type SearchActionProps = HTMLAttributes<HTMLDivElement> & {
87
+ /** Opens the search input immediately on mount. */
38
88
  defaultOpen?: boolean;
89
+ /** Focuses the input the first time it opens. */
90
+ defaultOpenAutoFocus?: boolean;
39
91
  };
92
+ /**
93
+ * Search action.
94
+ * Toggles the quick filter input and manages its open/close focus behavior.
95
+ * @param {SearchActionProps} props - Search action props.
96
+ * @param {boolean} [defaultOpen] - Opens the search input immediately on mount.
97
+ * @param {boolean} [defaultOpenAutoFocus] - Focuses the input the first time it opens.
98
+ * @param {React.ReactNode} children - Optional wrapper content.
99
+ * @param {string} className - Additional wrapper classes.
100
+ * @returns {React.ReactElement}
101
+ */
40
102
  declare const SearchAction: React.FC<SearchActionProps>;
103
+ /**
104
+ * Props for FreezeAction.
105
+ */
41
106
  type FreezeActionProps = ButtonProps & {
107
+ /** Label shown when rows can be frozen. */
42
108
  freezeText?: string;
109
+ /** Label shown when rows are already frozen. */
43
110
  unFreezeText?: string;
44
111
  };
112
+ /**
113
+ * Freeze action.
114
+ * Pins the current selection when rows are selected, or clears pinned rows when the grid is already frozen.
115
+ * @param {FreezeActionProps} props - Freeze action props.
116
+ * @param {boolean} [disabled] - Disables the action button.
117
+ * @param {React.MouseEventHandler<HTMLButtonElement>} [onClick] - Called after the freeze toggle runs.
118
+ * @returns {React.ReactElement}
119
+ */
45
120
  declare const FreezeAction: React.FC<FreezeActionProps>;
121
+ /**
122
+ * Props for PrintAction.
123
+ */
46
124
  type PrintActionProps = IconButtonProps & {};
125
+ /**
126
+ * Print action.
127
+ * Switches the grid to print layout, captures the rendered markup, and opens the browser print flow.
128
+ * @param {PrintActionProps} props - Print action props.
129
+ * @param {React.ReactNode} [children] - Custom icon content rendered in the button.
130
+ * @param {string} [className] - Additional button classes.
131
+ * @param {React.MouseEventHandler<HTMLButtonElement>} [onClick] - Called after printing is triggered.
132
+ * @returns {React.ReactElement}
133
+ */
47
134
  declare const PrintAction: React.FC<PrintActionProps>;
135
+ /**
136
+ * Props for RefreshAction.
137
+ */
48
138
  type RefreshActionProps = Omit<IconButtonProps, "onClick"> & {
139
+ /** Callback invoked when the refresh action is clicked. */
49
140
  onRefresh: () => void;
50
141
  };
142
+ /**
143
+ * Refresh action.
144
+ * Calls the provided refresh callback and reflects the loading state in the toolbar button.
145
+ * @param {RefreshActionProps} props - Refresh action props.
146
+ * @param {() => void} onRefresh - Called when the button is clicked.
147
+ * @param {boolean} [loading] - Shows the loading spinner and disables the button.
148
+ * @param {React.ReactNode} [children] - Custom icon content rendered in the button.
149
+ * @param {string} [className] - Additional button classes.
150
+ * @returns {React.ReactElement}
151
+ */
51
152
  declare const RefreshAction: React.FC<RefreshActionProps>;
153
+ /**
154
+ * Props for DeleteAction.
155
+ */
52
156
  type DeleteActionProps = Omit<ButtonProps, "onClick"> & {
157
+ /** Callback invoked when the delete action is clicked. */
53
158
  onDelete: () => void;
54
159
  };
160
+ /**
161
+ * Delete action.
162
+ * Renders a danger button with the delete icon and delegates the click to the provided handler.
163
+ * @param {DeleteActionProps} props - Delete action props.
164
+ * @param {() => void} onDelete - Called when the button is clicked.
165
+ * @param {React.ReactNode} [children] - Button label or custom content.
166
+ * @returns {React.ReactElement}
167
+ */
55
168
  declare const DeleteAction: React.FC<DeleteActionProps>;
169
+ /**
170
+ * Props for ExtraActions.
171
+ */
56
172
  type ExtraActionsProps = PopoverContentProps & {
173
+ /** Menu items rendered inside the popover. */
57
174
  children: React.ReactNode;
175
+ /** Props forwarded to the popover trigger and popover root. */
58
176
  slotProps?: {
59
177
  triggerProps?: PopoverTriggerProps;
60
178
  popoverProps?: PopoverProps;
61
179
  };
62
180
  };
181
+ /**
182
+ * Extra actions menu.
183
+ * Wraps overflow actions in a popover anchored to the vertical ellipsis trigger.
184
+ * @param {ExtraActionsProps} props - Extra actions props.
185
+ * @param {React.ReactNode} children - Menu items rendered inside the popover.
186
+ * @param {{ triggerProps?: PopoverTriggerProps; popoverProps?: PopoverProps; }} [slotProps] - Props forwarded to the trigger and popover root.
187
+ * @param {string} [className] - Additional popover content classes.
188
+ * @returns {React.ReactElement}
189
+ */
63
190
  declare const ExtraActions: React.FC<ExtraActionsProps>;
64
191
  export { DataGrid, DataGridContent, DataGridActionBar, SearchAction, FreezeAction, PrintAction, RefreshAction, ExtraActions, DeleteAction, type DataGridProps, type DataGridContentProps, type DatagridActionBarProps, type SearchActionProps, type FreezeActionProps, type RefreshActionProps, type ExtraActionsProps, type DeleteActionProps, useDataGrid, dataGridDefaultTheme, };
65
192
  //# sourceMappingURL=DataGrid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataGrid.d.ts","sourceRoot":"","sources":["../../../src/components/data-grid/DataGrid.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAc,cAAc,EAAW,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAmE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAMpH,OAAO,EAAU,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAc,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAA2B,mBAAmB,EAAE,YAAY,EAAkB,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAMrI,QAAA,MAAM,oBAAoB,uDAUxB,CAAC;AAEH,KAAK,eAAe,GAAG;IACrB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,OAAO,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC,UAAU,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,SAAS,KAAK,IAAI,CAAC;IACtD,MAAM,EAAE,M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B,EACtB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,WAAW,EACX,oBAAoB,GACrB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { VariantProps, TVReturnType } from 'tailwind-variants';
2
- import { TVConfig } from 'tailwind-variants/dist/config';
2
+ import { TVConfig } from 'tailwind-variants/dist/config.js';
3
3
  import * as React from "react";
4
4
  declare const textFieldVariants: TVReturnType<{
5
5
  size: {
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { VariantProps, TVReturnType } from 'tailwind-variants';
3
- import { TVConfig } from 'tailwind-variants/dist/config';
3
+ import { TVConfig } from 'tailwind-variants/dist/config.js';
4
4
  declare const iconButtonVariants: TVReturnType<{
5
5
  variant: {
6
6
  table: string;
@@ -1,5 +1,5 @@
1
1
  import { VariantProps, TVReturnType } from 'tailwind-variants';
2
- import { TVConfig } from 'tailwind-variants/dist/config';
2
+ import { TVConfig } from 'tailwind-variants/dist/config.js';
3
3
  import * as React from "react";
4
4
  declare const Label: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & VariantProps< TVReturnType<{} | {} | {}, undefined, "text-xs font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70", TVConfig<unknown, {} | {}>, {} | {}, undefined, TVReturnType<unknown, undefined, "text-xs font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70", TVConfig<unknown, {} | {}>, unknown, unknown, undefined>>> & React.RefAttributes<HTMLLabelElement>>;
5
5
  type LabelProps = React.ComponentProps<typeof Label>;
@@ -1 +1 @@
1
- {"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../src/components/label/Label.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAM1D,QAAA,MAAM,KAAK,ypBAEV,CAAC;AAEF,KAAK,UAAU,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,CAAC;AAErD,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../src/components/label/Label.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAM1D,QAAA,MAAM,KAAK,+pBAEV,CAAC;AAEF,KAAK,UAAU,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,CAAC;AAErD,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { VariantProps, TVReturnType } from 'tailwind-variants';
2
- import { TVConfig } from 'tailwind-variants/dist/config';
2
+ import { TVConfig } from 'tailwind-variants/dist/config.js';
3
3
  import * as React from "react";
4
4
  /**
5
5
  * Variants for the multi-select component to handle different styles.
@@ -1,5 +1,5 @@
1
1
  import { VariantProps, TVReturnType } from 'tailwind-variants';
2
- import { TVConfig } from 'tailwind-variants/dist/config';
2
+ import { TVConfig } from 'tailwind-variants/dist/config.js';
3
3
  import * as React from "react";
4
4
  import * as ProgressPrimitive from "@radix-ui/react-progress";
5
5
  declare const progressVariants: TVReturnType<{
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { VariantProps, TVReturnType } from 'tailwind-variants';
3
- import { TVConfig } from 'tailwind-variants/dist/config';
3
+ import { TVConfig } from 'tailwind-variants/dist/config.js';
4
4
  declare const ratingVariants: TVReturnType<{
5
5
  variant: {
6
6
  default: string;
@@ -1,6 +1,6 @@
1
1
  import { DialogProps as SheetProps, DialogTriggerProps as SheetTriggerProps, DialogCloseProps as SheetCloseProps, DialogPortalProps as SheetPortalProps, DialogOverlayProps as SheetOverlayProps, DialogDescriptionProps as SheetDescriptionProps, DialogTitleProps as SheetTitleProps } from '@radix-ui/react-dialog';
2
2
  import { VariantProps, TVReturnType } from 'tailwind-variants';
3
- import { TVConfig } from 'tailwind-variants/dist/config';
3
+ import { TVConfig } from 'tailwind-variants/dist/config.js';
4
4
  import * as React from "react";
5
5
  import * as SheetPrimitive from "@radix-ui/react-dialog";
6
6
  declare const Sheet: React.FC<SheetPrimitive.DialogProps>;
@@ -1,7 +1,7 @@
1
1
  import { VariantProps, TVReturnType } from 'tailwind-variants';
2
2
  import { TooltipContent } from '../tooltip/Tooltip';
3
3
  import { SeparatorProps } from '@radix-ui/react-separator';
4
- import { TVConfig } from 'tailwind-variants/dist/config';
4
+ import { TVConfig } from 'tailwind-variants/dist/config.js';
5
5
  import * as React from "react";
6
6
  type SidebarContext = {
7
7
  state: "expanded" | "collapsed";
@@ -1,5 +1,5 @@
1
1
  import { VariantProps, TVReturnType } from 'tailwind-variants';
2
- import { TVConfig } from 'tailwind-variants/dist/config';
2
+ import { TVConfig } from 'tailwind-variants/dist/config.js';
3
3
  import * as React from "react";
4
4
  import * as SwitchPrimitives from "@radix-ui/react-switch";
5
5
  declare const switchVariants: TVReturnType<{
@@ -1,5 +1,5 @@
1
1
  import { VariantProps, TVReturnType } from 'tailwind-variants';
2
- import { TVConfig } from 'tailwind-variants/dist/config';
2
+ import { TVConfig } from 'tailwind-variants/dist/config.js';
3
3
  import * as React from "react";
4
4
  declare const textFieldVariants: TVReturnType<{
5
5
  size: {
@@ -1,5 +1,5 @@
1
1
  import { VariantProps, TVReturnType } from 'tailwind-variants';
2
- import { TVConfig } from 'tailwind-variants/dist/config';
2
+ import { TVConfig } from 'tailwind-variants/dist/config.js';
3
3
  import * as React from "react";
4
4
  import * as ToastPrimitives from "@radix-ui/react-toast";
5
5
  declare const ToastProvider: React.FC<ToastPrimitives.ToastProviderProps>;
@@ -1,13 +1,13 @@
1
- import { jsx as o, jsxs as z } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as z } from "react/jsx-runtime";
2
2
  import e, { forwardRef as H, useMemo as G } from "react";
3
3
  import { AgGridReact as L } from "ag-grid-react";
4
4
  import { themeQuartz as M, ModuleRegistry as B, AllCommunityModule as Q } from "ag-grid-community";
5
5
  import { Trashcan as O, ElipsisVertical as q, Snowflake as $, Print as j, Refresh as _, CircleXmark as U, Magnifier as N } from "@trsys-tech/matrix-icons";
6
- import { cn as g } from "./utils.es.js";
6
+ import { cn as C } from "./utils.es.js";
7
7
  import { printHtml as V } from "./printhtml.es.js";
8
8
  import { TextField as W } from "./textfield.es.js";
9
9
  import { Button as k } from "./button.es.js";
10
- import { IconButton as v } from "./iconbutton.es.js";
10
+ import { IconButton as D } from "./iconbutton.es.js";
11
11
  import { Popover as X, PopoverTrigger as J, PopoverContent as K } from "./popover.es.js";
12
12
  B.registerModules([Q]);
13
13
  const Y = M.withParams({
@@ -20,200 +20,200 @@ const Y = M.withParams({
20
20
  accentColor: "hsl(var(--primary-300))",
21
21
  foregroundColor: "hsl(var(--text-500))",
22
22
  cellTextColor: "hsl(var(--text-500))"
23
- }), w = e.createContext(null), ue = () => {
24
- const r = e.useContext(w);
25
- if (!r)
23
+ }), x = e.createContext(null), ue = () => {
24
+ const i = e.useContext(x);
25
+ if (!i)
26
26
  throw new Error("useDataGrid should be used within <DataGrid>");
27
- return r;
28
- }, he = ({ children: r }) => {
29
- const s = e.useId(), [i, n] = e.useState(null), [a, c] = e.useState([]), [d, u] = e.useState(0), [h, l] = e.useState(/* @__PURE__ */ new Set()), [t, p] = e.useState(""), [f, m] = e.useState(!1);
30
- return /* @__PURE__ */ o(
31
- w.Provider,
27
+ return i;
28
+ }, he = ({ children: i }) => {
29
+ const a = e.useId(), [s, o] = e.useState(null), [n, c] = e.useState([]), [l, u] = e.useState(0), [p, d] = e.useState(/* @__PURE__ */ new Set()), [t, h] = e.useState(""), [f, m] = e.useState(!1);
30
+ return /* @__PURE__ */ r(
31
+ x.Provider,
32
32
  {
33
33
  value: {
34
- api: i,
35
- setApi: n,
36
- rowData: a,
34
+ api: s,
35
+ setApi: o,
36
+ rowData: n,
37
37
  setRowData: c,
38
- gridId: s,
38
+ gridId: a,
39
39
  quickFilterText: t,
40
- setQuickFilterText: p,
40
+ setQuickFilterText: h,
41
41
  actionbarExists: f,
42
42
  setActionbarExists: m,
43
- actionbarHeight: d,
43
+ actionbarHeight: l,
44
44
  setActionbarHeight: u,
45
- pinnedRowIds: h,
46
- setPinnedRowIds: l
45
+ pinnedRowIds: p,
46
+ setPinnedRowIds: d
47
47
  },
48
- children: r
48
+ children: i
49
49
  }
50
50
  );
51
51
  }, Z = H(
52
- ({ theme: r, onGridReady: s, quickFilterText: i, rowData: n, containerStyle: a, getRowId: c, ...d }, u) => {
53
- const h = e.useContext(w);
54
- if (!h)
52
+ ({ theme: i, onGridReady: a, quickFilterText: s, rowData: o, containerStyle: n, getRowId: c, ...l }, u) => {
53
+ const p = e.useContext(x);
54
+ if (!p)
55
55
  throw new Error("DataGridContent should be used within <DataGrid>");
56
- const { rowData: l, setRowData: t, actionbarExists: p, setApi: f, setQuickFilterText: m, quickFilterText: b, gridId: E, actionbarHeight: C, pinnedRowIds: x } = h, D = G(() => Y.withParams({
56
+ const { rowData: d, setRowData: t, actionbarExists: h, setApi: f, setQuickFilterText: m, quickFilterText: R, gridId: b, actionbarHeight: w, pinnedRowIds: g } = p, S = G(() => Y.withParams({
57
57
  headerHeight: 40,
58
- wrapperBorderRadius: p ? "0px 0px 8px 8px" : "8px"
59
- }), [p]), P = (R) => {
60
- f(R.api), s?.(R);
58
+ wrapperBorderRadius: h ? "0px 0px 8px 8px" : "8px"
59
+ }), [h]), P = (v) => {
60
+ f(v.api), a?.(v);
61
61
  };
62
62
  e.useEffect(() => {
63
- t(n);
64
- }, [n, t]), e.useEffect(() => {
65
- i !== void 0 && m(i ?? "");
66
- }, [i, m]);
67
- const { finalRowData: F, finalPinnedTopRowData: I } = G(() => {
68
- if (!l || x.size === 0)
69
- return { finalRowData: l, finalPinnedTopRowData: [] };
70
- const R = [], A = [];
71
- return l.forEach((S) => {
72
- const y = c ? c({ data: S, level: 0 }) : S.id, T = y != null ? String(y) : void 0;
73
- T !== void 0 && x.has(T) ? R.push(S) : A.push(S);
74
- }), { finalRowData: A, finalPinnedTopRowData: R };
75
- }, [l, x, c]);
76
- return /* @__PURE__ */ o(
63
+ t(o);
64
+ }, [o, t]), e.useEffect(() => {
65
+ s !== void 0 && m(s ?? "");
66
+ }, [s, m]);
67
+ const { finalRowData: I, finalPinnedTopRowData: F } = G(() => {
68
+ if (!d || g.size === 0)
69
+ return { finalRowData: d, finalPinnedTopRowData: [] };
70
+ const v = [], T = [];
71
+ return d.forEach((E) => {
72
+ const y = c ? c({ data: E, level: 0 }) : E.id, A = y != null ? String(y) : void 0;
73
+ A !== void 0 && g.has(A) ? v.push(E) : T.push(E);
74
+ }), { finalRowData: T, finalPinnedTopRowData: v };
75
+ }, [d, g, c]);
76
+ return /* @__PURE__ */ r(
77
77
  L,
78
78
  {
79
- gridId: E,
80
- theme: r ?? D,
81
- rowData: F,
82
- pinnedTopRowData: I,
83
- quickFilterText: b,
79
+ gridId: b,
80
+ theme: i ?? S,
81
+ rowData: I,
82
+ pinnedTopRowData: F,
83
+ quickFilterText: R,
84
84
  onGridReady: P,
85
- containerStyle: { height: `calc(100% - ${C}px)`, ...a },
85
+ containerStyle: { height: `calc(100% - ${w}px)`, ...n },
86
86
  getRowId: c,
87
- ...d,
87
+ ...l,
88
88
  ref: u
89
89
  }
90
90
  );
91
91
  }
92
92
  );
93
93
  Z.displayName = "DataGridContent";
94
- const pe = ({ className: r, ...s }) => {
95
- const i = e.useContext(w);
96
- if (!i)
94
+ const pe = ({ className: i, ...a }) => {
95
+ const s = e.useContext(x);
96
+ if (!s)
97
97
  throw new Error("DataGridActionBar should be used within <DataGrid>");
98
- const n = e.useRef(null), { setActionbarExists: a, setActionbarHeight: c } = i, { children: d } = s;
99
- return e.useEffect(() => (a(!0), () => a(!1)), [a]), e.useEffect(() => {
100
- n.current && c(n.current.clientHeight);
101
- }, [c]), /* @__PURE__ */ o(
98
+ const o = e.useRef(null), { setActionbarExists: n, setActionbarHeight: c } = s, { children: l } = a;
99
+ return e.useEffect(() => (n(!0), () => n(!1)), [n]), e.useEffect(() => {
100
+ o.current && c(o.current.clientHeight);
101
+ }, [c]), /* @__PURE__ */ r(
102
102
  "div",
103
103
  {
104
- className: g(
104
+ className: C(
105
105
  "relative flex items-center p-2 h-12 w-full bg-gray-0 border border-gray-200 border-b-0 -mb-[1px] z-10 rounded-t-[8px]",
106
- r
106
+ i
107
107
  ),
108
- ref: n,
109
- children: d
108
+ ref: o,
109
+ children: l
110
110
  }
111
111
  );
112
- }, fe = ({ defaultOpen: r = !1, className: s, ...i }) => {
113
- const n = e.useContext(w);
112
+ }, fe = ({ defaultOpen: i = !1, defaultOpenAutoFocus: a = !0, className: s, ...o }) => {
113
+ const n = e.useContext(x);
114
114
  if (!n)
115
115
  throw new Error("SearchAction should be used within <DataGrid>");
116
- const { quickFilterText: a, setQuickFilterText: c } = n, [d, u] = e.useState(r), [h, l] = e.useState(!1), t = e.useRef(null), p = () => {
117
- n.setQuickFilterText(""), t.current && t.current.focus();
118
- }, f = () => {
119
- u(!0);
116
+ const { quickFilterText: c, setQuickFilterText: l } = n, [u, p] = e.useState(i), [d, t] = e.useState(!1), h = e.useRef(null), f = e.useRef(!0), m = () => {
117
+ n.setQuickFilterText(""), h.current && h.current.focus();
118
+ }, R = () => {
119
+ p(!0);
120
120
  };
121
121
  e.useEffect(() => {
122
- d && t?.current && t.current.focus();
123
- }, [d]);
124
- const m = () => {
125
- l(!0), n.setQuickFilterText(""), setTimeout(() => {
126
- u(!1), l(!1);
122
+ u && h?.current && (a || !f.current) && h.current.focus(), f.current = !1;
123
+ }, [u, a]);
124
+ const b = () => {
125
+ t(!0), n.setQuickFilterText(""), setTimeout(() => {
126
+ p(!1), t(!1);
127
127
  }, 200);
128
128
  };
129
- return /* @__PURE__ */ o("div", { className: g("max-w-60", s), ...i, children: d || h ? /* @__PURE__ */ o(
129
+ return /* @__PURE__ */ r("div", { className: C("max-w-60", s), ...o, children: u || d ? /* @__PURE__ */ r(
130
130
  W,
131
131
  {
132
- ref: t,
133
- className: g("relative h-7.5", d && !h ? "animate-input-open" : "", h && "animate-input-close"),
134
- onChange: (b) => c(b.target.value),
135
- value: a,
136
- startAdornment: /* @__PURE__ */ o(v, { type: "button", variant: "toolbar", className: "p-0.5 h-6 w-6 border-none mx-1", onClick: m, children: /* @__PURE__ */ o(N, { className: "w-5 h-5" }) }),
137
- endAdornment: a && /* @__PURE__ */ o(v, { type: "button", variant: "toolbar", className: "p-0.5 w-6 h-6 border-none mx-1", onClick: p, children: /* @__PURE__ */ o(U, { className: "w-5 h-5" }) })
132
+ ref: h,
133
+ className: C("relative h-7.5", u && !d ? "animate-input-open" : "", d && "animate-input-close"),
134
+ onChange: (w) => l(w.target.value),
135
+ value: c,
136
+ startAdornment: /* @__PURE__ */ r(D, { type: "button", variant: "toolbar", className: "p-0.5 h-6 w-6 border-none mx-1", onClick: b, children: /* @__PURE__ */ r(N, { className: "w-5 h-5" }) }),
137
+ endAdornment: c && /* @__PURE__ */ r(D, { type: "button", variant: "toolbar", className: "p-0.5 w-6 h-6 border-none mx-1", onClick: m, children: /* @__PURE__ */ r(U, { className: "w-5 h-5" }) })
138
138
  }
139
- ) : /* @__PURE__ */ o(v, { type: "button", variant: "toolbar", className: "p-0.5 w-6 h-6 m-1", onClick: f, children: /* @__PURE__ */ o(N, { className: "w-5 h-5" }) }) });
140
- }, me = ({ freezeText: r, unFreezeText: s, onClick: i, disabled: n, ...a }) => {
141
- const c = e.useContext(w);
139
+ ) : /* @__PURE__ */ r(D, { type: "button", variant: "toolbar", className: "p-0.5 w-6 h-6 m-1", onClick: R, children: /* @__PURE__ */ r(N, { className: "w-5 h-5" }) }) });
140
+ }, me = ({ freezeText: i, unFreezeText: a, onClick: s, disabled: o, ...n }) => {
141
+ const c = e.useContext(x);
142
142
  if (!c)
143
143
  throw new Error("FreezeAction should be used within <DataGrid>");
144
- const [d, u] = e.useState(0), [h, l] = e.useState(0), { api: t, pinnedRowIds: p, setPinnedRowIds: f } = c, m = () => {
144
+ const [l, u] = e.useState(0), [p, d] = e.useState(0), { api: t, pinnedRowIds: h, setPinnedRowIds: f } = c, m = () => {
145
145
  if (!t) return;
146
- const C = t.getSelectedNodes();
147
- if (C.length > 0) {
148
- const x = new Set(p);
149
- C.forEach((D) => {
150
- D.id !== void 0 && x.add(D.id);
151
- }), f(x), t.deselectAll();
146
+ const w = t.getSelectedNodes();
147
+ if (w.length > 0) {
148
+ const g = new Set(h);
149
+ w.forEach((S) => {
150
+ S.id !== void 0 && g.add(S.id);
151
+ }), f(g), t.deselectAll();
152
152
  }
153
- }, b = () => {
153
+ }, R = () => {
154
154
  f(/* @__PURE__ */ new Set());
155
- }, E = (C) => {
156
- t && (t.getPinnedTopRowCount() > 0 ? b() : m()), i?.(C);
155
+ }, b = (w) => {
156
+ t && (t.getPinnedTopRowCount() > 0 ? R() : m()), s?.(w);
157
157
  };
158
158
  return e.useEffect(() => (t?.addEventListener("pinnedRowDataChanged", () => {
159
159
  u(t.getPinnedTopRowCount());
160
160
  }), t?.addEventListener("selectionChanged", () => {
161
- l(t.getSelectedNodes().length);
161
+ d(t.getSelectedNodes().length);
162
162
  }), () => {
163
163
  t?.isDestroyed() || (t?.removeEventListener("pinnedRowDataChanged", () => {
164
164
  u(t.getPinnedTopRowCount());
165
165
  }), t?.removeEventListener("selectionChanged", () => {
166
- l(t.getSelectedNodes().length);
166
+ d(t.getSelectedNodes().length);
167
167
  }));
168
- }), [t]), /* @__PURE__ */ o(
168
+ }), [t]), /* @__PURE__ */ r(
169
169
  k,
170
170
  {
171
171
  variant: "text",
172
172
  type: "button",
173
- onClick: E,
174
- startIcon: /* @__PURE__ */ o($, { className: "w-4.5 h-4.5" }),
175
- disabled: !d && !h || n,
176
- ...a,
177
- children: d ? s ?? "Unfreeze" : r ?? "Freeze"
173
+ onClick: b,
174
+ startIcon: /* @__PURE__ */ r($, { className: "w-4.5 h-4.5" }),
175
+ disabled: !l && !p || o,
176
+ ...n,
177
+ children: l ? a ?? "Unfreeze" : i ?? "Freeze"
178
178
  }
179
179
  );
180
- }, we = ({ children: r, className: s, onClick: i, ...n }) => {
181
- const a = e.useContext(w);
182
- if (!a)
180
+ }, we = ({ children: i, className: a, onClick: s, ...o }) => {
181
+ const n = e.useContext(x);
182
+ if (!n)
183
183
  throw new Error("PrintAction should be used within <DataGrid>");
184
- const c = (d) => {
185
- a.api && (a.api.setGridOption("domLayout", "print"), setTimeout(() => {
186
- const u = document.querySelector("[grid-id='" + a.gridId + "']"), l = `<html>
184
+ const c = (l) => {
185
+ n.api && (n.api.setGridOption("domLayout", "print"), setTimeout(() => {
186
+ const u = document.querySelector("[grid-id='" + n.gridId + "']"), d = `<html>
187
187
  ${document.head.innerHTML}
188
188
  ${u.outerHTML}
189
189
  </html>`;
190
- V(l), a?.api?.setGridOption("domLayout", void 0);
191
- })), i?.(d);
190
+ V(d), n?.api?.setGridOption("domLayout", void 0);
191
+ })), s?.(l);
192
192
  };
193
- return /* @__PURE__ */ o(v, { type: "button", variant: "toolbar", className: g("p-0.5 w-6 h-6", s), onClick: c, ...n, children: r ?? /* @__PURE__ */ o(j, { className: "w-5 h-5" }) });
194
- }, xe = ({ className: r, onRefresh: s, children: i, loading: n, ...a }) => {
195
- if (!e.useContext(w))
193
+ return /* @__PURE__ */ r(D, { type: "button", variant: "toolbar", className: C("p-0.5 w-6 h-6", a), onClick: c, ...o, children: i ?? /* @__PURE__ */ r(j, { className: "w-5 h-5" }) });
194
+ }, xe = ({ className: i, onRefresh: a, children: s, loading: o, ...n }) => {
195
+ if (!e.useContext(x))
196
196
  throw new Error("RefreshAction should be used within <DataGrid>");
197
- const d = () => {
198
- s();
197
+ const l = () => {
198
+ a();
199
199
  };
200
- return /* @__PURE__ */ o(
201
- v,
200
+ return /* @__PURE__ */ r(
201
+ D,
202
202
  {
203
203
  type: "button",
204
- className: g("p-0.5 w-6 h-6", n && "disabled:bg-transparent", r),
204
+ className: C("p-0.5 w-6 h-6", o && "disabled:bg-transparent", i),
205
205
  variant: "toolbar",
206
- onClick: d,
207
- disabled: n,
208
- ...a,
209
- children: i ?? /* @__PURE__ */ o(_, { className: g("w-4.5 h-4.5", n && "animate-spin") })
206
+ onClick: l,
207
+ disabled: o,
208
+ ...n,
209
+ children: s ?? /* @__PURE__ */ r(_, { className: C("w-4.5 h-4.5", o && "animate-spin") })
210
210
  }
211
211
  );
212
- }, ge = ({ onDelete: r, children: s, ...i }) => /* @__PURE__ */ o(k, { variant: "danger", type: "button", onClick: () => {
213
- r();
214
- }, startIcon: /* @__PURE__ */ o(O, { className: "w-4.5 h-4.5" }), ...i, children: s }), Ce = ({ children: r, slotProps: s, className: i, ...n }) => /* @__PURE__ */ z(X, { ...s?.popoverProps ?? {}, children: [
215
- /* @__PURE__ */ o(J, { ...s?.triggerProps ?? {}, children: /* @__PURE__ */ o(q, { className: "w-4.5 h-4.5 text-primary" }) }),
216
- /* @__PURE__ */ o(K, { align: "end", className: g("w-40", i), ...n, children: r })
212
+ }, ge = ({ onDelete: i, children: a, ...s }) => /* @__PURE__ */ r(k, { variant: "danger", type: "button", onClick: () => {
213
+ i();
214
+ }, startIcon: /* @__PURE__ */ r(O, { className: "w-4.5 h-4.5" }), ...s, children: a }), Ce = ({ children: i, slotProps: a, className: s, ...o }) => /* @__PURE__ */ z(X, { ...a?.popoverProps ?? {}, children: [
215
+ /* @__PURE__ */ r(J, { ...a?.triggerProps ?? {}, children: /* @__PURE__ */ r(q, { className: "w-4.5 h-4.5 text-primary" }) }),
216
+ /* @__PURE__ */ r(K, { align: "end", className: C("w-40", s), ...o, children: i })
217
217
  ] });
218
218
  export {
219
219
  he as DataGrid,
@@ -1 +1 @@
1
- {"version":3,"file":"datagrid.es.js","sources":["../src/components/data-grid/DataGrid.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React, { forwardRef, HTMLAttributes, useMemo } from \"react\";\r\nimport { AgGridReact, AgGridReactProps } from \"ag-grid-react\";\r\nimport { GridApi, GridReadyEvent, themeQuartz, AllCommunityModule, ModuleRegistry, Theme } from \"ag-grid-community\";\r\nimport { CircleXmark, ElipsisVertical, Magnifier, Print, Refresh, Snowflake, Trashcan } from \"@trsys-tech/matrix-icons\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\nimport { printHtml } from \"../../lib/printHtml\";\r\nimport { TextField } from \"../text-field/TextField\";\r\nimport { Button, ButtonProps } from \"../button/Button\";\r\nimport { IconButton, IconButtonProps } from \"../icon-botton/IconButton\";\r\nimport { Popover, PopoverContent, PopoverContentProps, PopoverProps, PopoverTrigger, PopoverTriggerProps } from \"../popover/Popover\";\r\n\r\n// Register all Community features\r\n// Todo: Register only the required features\r\nModuleRegistry.registerModules([AllCommunityModule]);\r\n\r\nconst dataGridDefaultTheme = themeQuartz.withParams({\r\n fontFamily: \"DMSans\",\r\n fontSize: \"12px\",\r\n headerFontSize: \"12px\",\r\n headerFontWeight: 700,\r\n headerBackgroundColor: \"hsl(var(--primary-50))\",\r\n backgroundColor: \"hsl(var(--gray-0))\",\r\n accentColor: \"hsl(var(--primary-300))\",\r\n foregroundColor: \"hsl(var(--text-500))\",\r\n cellTextColor: \"hsl(var(--text-500))\",\r\n});\r\n\r\ntype DataGridContext = {\r\n api: GridApi | null;\r\n setApi: (value: GridApi) => void;\r\n rowData: any[] | null | undefined;\r\n setRowData: (value: any[] | null | undefined) => void;\r\n gridId: string;\r\n quickFilterText: string;\r\n setQuickFilterText: (value: string) => void;\r\n actionbarExists: boolean;\r\n setActionbarExists: (value: boolean) => void;\r\n actionbarHeight: number;\r\n setActionbarHeight: (value: number) => void;\r\n pinnedRowIds: Set<string>;\r\n setPinnedRowIds: (value: Set<string>) => void;\r\n};\r\n\r\nconst DataGridContext = React.createContext<DataGridContext | null>(null);\r\n\r\nconst useDataGrid = () => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"useDataGrid should be used within <DataGrid>\");\r\n }\r\n\r\n return context;\r\n};\r\n\r\ntype DataGridProps = {\r\n children: React.ReactNode;\r\n};\r\n\r\nconst DataGrid: React.FC<DataGridProps> = ({ children }) => {\r\n const gridId = React.useId();\r\n const [api, setApi] = React.useState<GridApi | null>(null);\r\n const [rowData, setRowData] = React.useState<any[] | null | undefined>([]);\r\n const [actionbarHeight, setActionbarHeight] = React.useState(0);\r\n const [pinnedRowIds, setPinnedRowIds] = React.useState<Set<string>>(new Set());\r\n\r\n const [quickFilterText, setQuickFilterText] = React.useState(\"\");\r\n const [actionbarExists, setActionbarExists] = React.useState(false);\r\n return (\r\n <DataGridContext.Provider\r\n value={{\r\n api,\r\n setApi,\r\n rowData,\r\n setRowData,\r\n gridId,\r\n quickFilterText,\r\n setQuickFilterText,\r\n actionbarExists,\r\n setActionbarExists,\r\n actionbarHeight,\r\n setActionbarHeight,\r\n pinnedRowIds,\r\n setPinnedRowIds,\r\n }}\r\n >\r\n {children}\r\n </DataGridContext.Provider>\r\n );\r\n};\r\n\r\ntype DataGridContentProps = Omit<AgGridReactProps, \"theme\"> & {\r\n theme?: Theme;\r\n};\r\n\r\nconst DataGridContent = forwardRef<AgGridReact, DataGridContentProps>(\r\n ({ theme: propTheme, onGridReady, quickFilterText: quickFilterTextProps, rowData: rowDataProps, containerStyle, getRowId, ...props }, ref) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"DataGridContent should be used within <DataGrid>\");\r\n }\r\n const { rowData, setRowData, actionbarExists, setApi, setQuickFilterText, quickFilterText, gridId, actionbarHeight, pinnedRowIds } = context;\r\n\r\n const theme = useMemo(() => {\r\n return dataGridDefaultTheme.withParams({\r\n headerHeight: 40,\r\n wrapperBorderRadius: actionbarExists ? \"0px 0px 8px 8px\" : \"8px\",\r\n });\r\n }, [actionbarExists]);\r\n\r\n const handleGridReady = (e: GridReadyEvent) => {\r\n setApi(e.api);\r\n onGridReady?.(e);\r\n };\r\n\r\n React.useEffect(() => {\r\n setRowData(rowDataProps);\r\n }, [rowDataProps, setRowData]);\r\n\r\n React.useEffect(() => {\r\n if (quickFilterTextProps !== undefined) {\r\n setQuickFilterText(quickFilterTextProps ?? \"\");\r\n }\r\n }, [quickFilterTextProps, setQuickFilterText]);\r\n\r\n const { finalRowData, finalPinnedTopRowData } = useMemo(() => {\r\n if (!rowData || pinnedRowIds.size === 0) {\r\n return { finalRowData: rowData, finalPinnedTopRowData: [] };\r\n }\r\n\r\n const pinned: any[] = [];\r\n const unpinned: any[] = [];\r\n\r\n rowData.forEach(data => {\r\n const id = getRowId ? getRowId({ data, level: 0 } as any) : (data as any).id;\r\n const stringId = id !== undefined && id !== null ? String(id) : undefined;\r\n\r\n if (stringId !== undefined && pinnedRowIds.has(stringId)) {\r\n pinned.push(data);\r\n } else {\r\n unpinned.push(data);\r\n }\r\n });\r\n\r\n return { finalRowData: unpinned, finalPinnedTopRowData: pinned };\r\n }, [rowData, pinnedRowIds, getRowId]);\r\n\r\n return (\r\n <AgGridReact\r\n gridId={gridId}\r\n theme={propTheme ?? theme}\r\n rowData={finalRowData}\r\n pinnedTopRowData={finalPinnedTopRowData}\r\n quickFilterText={quickFilterText}\r\n onGridReady={handleGridReady}\r\n containerStyle={{ height: `calc(100% - ${actionbarHeight}px)`, ...containerStyle }}\r\n getRowId={getRowId}\r\n {...props}\r\n ref={ref}\r\n />\r\n );\r\n },\r\n);\r\n\r\nDataGridContent.displayName = \"DataGridContent\";\r\n\r\ntype DatagridActionBarProps = HTMLAttributes<HTMLDivElement> & {};\r\n\r\nconst DataGridActionBar: React.FC<DatagridActionBarProps> = ({ className, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"DataGridActionBar should be used within <DataGrid>\");\r\n }\r\n const ref = React.useRef<HTMLDivElement | null>(null);\r\n const { setActionbarExists, setActionbarHeight } = context;\r\n const { children } = props;\r\n\r\n React.useEffect(() => {\r\n setActionbarExists(true);\r\n return () => setActionbarExists(false);\r\n }, [setActionbarExists]);\r\n\r\n React.useEffect(() => {\r\n if (ref.current) {\r\n setActionbarHeight(ref.current.clientHeight);\r\n }\r\n }, [setActionbarHeight]);\r\n\r\n return (\r\n <div\r\n className={cn(\r\n \"relative flex items-center p-2 h-12 w-full bg-gray-0 border border-gray-200 border-b-0 -mb-[1px] z-10 rounded-t-[8px]\",\r\n className,\r\n )}\r\n ref={ref}\r\n >\r\n {children}\r\n </div>\r\n );\r\n};\r\n\r\ntype SearchActionProps = HTMLAttributes<HTMLDivElement> & {\r\n defaultOpen?: boolean;\r\n};\r\n\r\nconst SearchAction: React.FC<SearchActionProps> = ({ defaultOpen = false, className, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"SearchAction should be used within <DataGrid>\");\r\n }\r\n\r\n const { quickFilterText, setQuickFilterText } = context;\r\n\r\n const [isSearchInputOpen, setIsSearchInputOpen] = React.useState(defaultOpen);\r\n const [isClosing, setIsClosing] = React.useState(false);\r\n const inputRef = React.useRef<HTMLInputElement | null>(null);\r\n\r\n const handleClear = () => {\r\n context.setQuickFilterText(\"\");\r\n if (inputRef.current) {\r\n inputRef.current.focus();\r\n }\r\n };\r\n\r\n const handleOpen = () => {\r\n setIsSearchInputOpen(true);\r\n };\r\n\r\n React.useEffect(() => {\r\n if (isSearchInputOpen && inputRef?.current) {\r\n inputRef.current.focus();\r\n }\r\n }, [isSearchInputOpen]);\r\n\r\n const handleClose = () => {\r\n setIsClosing(true);\r\n context.setQuickFilterText(\"\");\r\n setTimeout(() => {\r\n setIsSearchInputOpen(false);\r\n setIsClosing(false);\r\n }, 200);\r\n };\r\n\r\n return (\r\n <div className={cn(\"max-w-60\", className)} {...props}>\r\n {isSearchInputOpen || isClosing ? (\r\n <TextField\r\n ref={inputRef}\r\n className={cn(\"relative h-7.5\", isSearchInputOpen && !isClosing ? \"animate-input-open\" : \"\", isClosing && \"animate-input-close\")}\r\n onChange={e => setQuickFilterText(e.target.value)}\r\n value={quickFilterText}\r\n startAdornment={\r\n <IconButton type=\"button\" variant=\"toolbar\" className=\"p-0.5 h-6 w-6 border-none mx-1\" onClick={handleClose}>\r\n <Magnifier className=\"w-5 h-5\" />\r\n </IconButton>\r\n }\r\n endAdornment={\r\n quickFilterText && (\r\n <IconButton type=\"button\" variant=\"toolbar\" className=\"p-0.5 w-6 h-6 border-none mx-1\" onClick={handleClear}>\r\n <CircleXmark className=\"w-5 h-5\" />\r\n </IconButton>\r\n )\r\n }\r\n />\r\n ) : (\r\n <IconButton type=\"button\" variant=\"toolbar\" className=\"p-0.5 w-6 h-6 m-1\" onClick={handleOpen}>\r\n <Magnifier className=\"w-5 h-5\" />\r\n </IconButton>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\ntype FreezeActionProps = ButtonProps & {\r\n freezeText?: string;\r\n unFreezeText?: string;\r\n};\r\n\r\nconst FreezeAction: React.FC<FreezeActionProps> = ({ freezeText, unFreezeText, onClick, disabled, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"FreezeAction should be used within <DataGrid>\");\r\n }\r\n\r\n const [pinnedRowCount, setPinnedRowCount] = React.useState(0);\r\n const [selectedRowsCount, setSelectedRowsCount] = React.useState(0);\r\n\r\n const { api, pinnedRowIds, setPinnedRowIds } = context;\r\n\r\n const freezeRows = () => {\r\n if (!api) return;\r\n\r\n // Get currently selected rows\r\n const selectedRows = api.getSelectedNodes();\r\n\r\n if (selectedRows.length > 0) {\r\n const newPinnedIds = new Set(pinnedRowIds);\r\n selectedRows.forEach(row => {\r\n if (row.id !== undefined) {\r\n newPinnedIds.add(row.id);\r\n }\r\n });\r\n setPinnedRowIds(newPinnedIds);\r\n api.deselectAll();\r\n }\r\n };\r\n\r\n const unfreezeRows = () => {\r\n setPinnedRowIds(new Set());\r\n };\r\n\r\n const handleFreezing = (e: React.MouseEvent<HTMLButtonElement>) => {\r\n if (api) {\r\n const pinnedRowsCount = api.getPinnedTopRowCount();\r\n if (pinnedRowsCount > 0) {\r\n unfreezeRows();\r\n } else {\r\n freezeRows();\r\n }\r\n }\r\n onClick?.(e);\r\n };\r\n\r\n React.useEffect(() => {\r\n api?.addEventListener(\"pinnedRowDataChanged\", () => {\r\n setPinnedRowCount(api.getPinnedTopRowCount());\r\n });\r\n\r\n api?.addEventListener(\"selectionChanged\", () => {\r\n setSelectedRowsCount(api.getSelectedNodes().length);\r\n });\r\n\r\n return () => {\r\n if (api?.isDestroyed()) return;\r\n api?.removeEventListener(\"pinnedRowDataChanged\", () => {\r\n setPinnedRowCount(api.getPinnedTopRowCount());\r\n });\r\n\r\n api?.removeEventListener(\"selectionChanged\", () => {\r\n setSelectedRowsCount(api.getSelectedNodes().length);\r\n });\r\n };\r\n }, [api]);\r\n\r\n return (\r\n <Button\r\n variant=\"text\"\r\n type=\"button\"\r\n onClick={handleFreezing}\r\n startIcon={<Snowflake className=\"w-4.5 h-4.5\" />}\r\n disabled={(!pinnedRowCount && !selectedRowsCount) || disabled}\r\n {...props}\r\n >\r\n {pinnedRowCount ? (unFreezeText ?? \"Unfreeze\") : (freezeText ?? \"Freeze\")}\r\n </Button>\r\n );\r\n};\r\n\r\ntype PrintActionProps = IconButtonProps & {};\r\n\r\nconst PrintAction: React.FC<PrintActionProps> = ({ children, className, onClick, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"PrintAction should be used within <DataGrid>\");\r\n }\r\n\r\n const handlePrint = (e: React.MouseEvent<HTMLButtonElement>) => {\r\n if (context.api) {\r\n context.api.setGridOption(\"domLayout\", \"print\");\r\n\r\n setTimeout(() => {\r\n const element = document.querySelector(\"[grid-id='\" + context.gridId + \"']\") as HTMLElement;\r\n const header = document.head;\r\n const html = `<html>\r\n ${header.innerHTML}\r\n ${element.outerHTML}\r\n </html>`;\r\n printHtml(html);\r\n context?.api?.setGridOption(\"domLayout\", undefined);\r\n });\r\n }\r\n onClick?.(e);\r\n };\r\n\r\n return (\r\n <IconButton type=\"button\" variant=\"toolbar\" className={cn(\"p-0.5 w-6 h-6\", className)} onClick={handlePrint} {...props}>\r\n {children ?? <Print className=\"w-5 h-5\" />}\r\n </IconButton>\r\n );\r\n};\r\n\r\ntype RefreshActionProps = Omit<IconButtonProps, \"onClick\"> & {\r\n onRefresh: () => void;\r\n};\r\n\r\nconst RefreshAction: React.FC<RefreshActionProps> = ({ className, onRefresh, children, loading, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"RefreshAction should be used within <DataGrid>\");\r\n }\r\n\r\n const handleRefresh = () => {\r\n onRefresh();\r\n };\r\n\r\n return (\r\n <IconButton\r\n type=\"button\"\r\n className={cn(\"p-0.5 w-6 h-6\", loading && \"disabled:bg-transparent\", className)}\r\n variant=\"toolbar\"\r\n onClick={handleRefresh}\r\n disabled={loading}\r\n {...props}\r\n >\r\n {children ?? <Refresh className={cn(\"w-4.5 h-4.5\", loading && \"animate-spin\")} />}\r\n </IconButton>\r\n );\r\n};\r\n\r\ntype DeleteActionProps = Omit<ButtonProps, \"onClick\"> & {\r\n onDelete: () => void;\r\n};\r\n\r\nconst DeleteAction: React.FC<DeleteActionProps> = ({ onDelete, children, ...props }) => {\r\n const handleDelete = () => {\r\n onDelete();\r\n };\r\n\r\n return (\r\n <Button variant=\"danger\" type=\"button\" onClick={handleDelete} startIcon={<Trashcan className=\"w-4.5 h-4.5\" />} {...props}>\r\n {children}\r\n </Button>\r\n );\r\n};\r\n\r\ntype ExtraActionsProps = PopoverContentProps & {\r\n children: React.ReactNode;\r\n slotProps?: {\r\n triggerProps?: PopoverTriggerProps;\r\n popoverProps?: PopoverProps;\r\n };\r\n};\r\n\r\nconst ExtraActions: React.FC<ExtraActionsProps> = ({ children, slotProps, className, ...props }) => {\r\n return (\r\n <Popover {...(slotProps?.popoverProps ?? {})}>\r\n <PopoverTrigger {...(slotProps?.triggerProps ?? {})}>\r\n <ElipsisVertical className=\"w-4.5 h-4.5 text-primary\" />\r\n </PopoverTrigger>\r\n <PopoverContent align=\"end\" className={cn(\"w-40\", className)} {...props}>\r\n {children}\r\n </PopoverContent>\r\n </Popover>\r\n );\r\n};\r\n\r\nexport {\r\n DataGrid,\r\n DataGridContent,\r\n DataGridActionBar,\r\n SearchAction,\r\n FreezeAction,\r\n PrintAction,\r\n RefreshAction,\r\n ExtraActions,\r\n DeleteAction,\r\n type DataGridProps,\r\n type DataGridContentProps,\r\n type DatagridActionBarProps,\r\n type SearchActionProps,\r\n type FreezeActionProps,\r\n type RefreshActionProps,\r\n type ExtraActionsProps,\r\n type DeleteActionProps,\r\n useDataGrid,\r\n dataGridDefaultTheme,\r\n};\r\n"],"names":["ModuleRegistry","AllCommunityModule","dataGridDefaultTheme","themeQuartz","DataGridContext","React","useDataGrid","context","DataGrid","children","gridId","api","setApi","rowData","setRowData","actionbarHeight","setActionbarHeight","pinnedRowIds","setPinnedRowIds","quickFilterText","setQuickFilterText","actionbarExists","setActionbarExists","jsx","DataGridContent","forwardRef","propTheme","onGridReady","quickFilterTextProps","rowDataProps","containerStyle","getRowId","props","ref","theme","useMemo","handleGridReady","e","finalRowData","finalPinnedTopRowData","pinned","unpinned","data","id","stringId","AgGridReact","DataGridActionBar","className","cn","SearchAction","defaultOpen","isSearchInputOpen","setIsSearchInputOpen","isClosing","setIsClosing","inputRef","handleClear","handleOpen","handleClose","TextField","IconButton","Magnifier","CircleXmark","FreezeAction","freezeText","unFreezeText","onClick","disabled","pinnedRowCount","setPinnedRowCount","selectedRowsCount","setSelectedRowsCount","freezeRows","selectedRows","newPinnedIds","row","unfreezeRows","handleFreezing","Button","Snowflake","PrintAction","handlePrint","element","html","printHtml","Print","RefreshAction","onRefresh","loading","handleRefresh","Refresh","DeleteAction","onDelete","Trashcan","ExtraActions","slotProps","Popover","PopoverTrigger","ElipsisVertical","PopoverContent"],"mappings":";;;;;;;;;;;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,UAAArF,GAAU,WAAAsF,GAAW,WAAAhD,GAAW,GAAGf,0BAEnFgE,GAAA,EAAS,GAAID,GAAW,gBAAgB,CAAA,GACvC,UAAA;AAAA,EAAA,gBAAAxE,EAAC0E,GAAA,EAAgB,GAAIF,GAAW,gBAAgB,CAAA,GAC9C,UAAA,gBAAAxE,EAAC2E,GAAA,EAAgB,WAAU,2BAAA,CAA2B,EAAA,CACxD;AAAA,EACA,gBAAA3E,EAAC4E,GAAA,EAAe,OAAM,OAAM,WAAWnD,EAAG,QAAQD,CAAS,GAAI,GAAGf,GAC/D,UAAAvB,EAAA,CACH;AAAA,GACF;"}
1
+ {"version":3,"file":"datagrid.es.js","sources":["../src/components/data-grid/DataGrid.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React, { forwardRef, HTMLAttributes, useMemo } from \"react\";\r\nimport { AgGridReact, AgGridReactProps } from \"ag-grid-react\";\r\nimport { GridApi, GridReadyEvent, themeQuartz, AllCommunityModule, ModuleRegistry, Theme } from \"ag-grid-community\";\r\nimport { CircleXmark, ElipsisVertical, Magnifier, Print, Refresh, Snowflake, Trashcan } from \"@trsys-tech/matrix-icons\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\nimport { printHtml } from \"../../lib/printHtml\";\r\nimport { TextField } from \"../text-field/TextField\";\r\nimport { Button, ButtonProps } from \"../button/Button\";\r\nimport { IconButton, IconButtonProps } from \"../icon-botton/IconButton\";\r\nimport { Popover, PopoverContent, PopoverContentProps, PopoverProps, PopoverTrigger, PopoverTriggerProps } from \"../popover/Popover\";\r\n\r\n// Register all Community features\r\n// Todo: Register only the required features\r\nModuleRegistry.registerModules([AllCommunityModule]);\r\n\r\n/**\r\n * Default ag-Grid theme used by DataGrid.\r\n */\r\nconst dataGridDefaultTheme = themeQuartz.withParams({\r\n fontFamily: \"DMSans\",\r\n fontSize: \"12px\",\r\n headerFontSize: \"12px\",\r\n headerFontWeight: 700,\r\n headerBackgroundColor: \"hsl(var(--primary-50))\",\r\n backgroundColor: \"hsl(var(--gray-0))\",\r\n accentColor: \"hsl(var(--primary-300))\",\r\n foregroundColor: \"hsl(var(--text-500))\",\r\n cellTextColor: \"hsl(var(--text-500))\",\r\n});\r\n\r\n/**\r\n * Shared DataGrid state exposed through context.\r\n */\r\ntype DataGridContext = {\r\n api: GridApi | null;\r\n setApi: (value: GridApi) => void;\r\n rowData: any[] | null | undefined;\r\n setRowData: (value: any[] | null | undefined) => void;\r\n gridId: string;\r\n quickFilterText: string;\r\n setQuickFilterText: (value: string) => void;\r\n actionbarExists: boolean;\r\n setActionbarExists: (value: boolean) => void;\r\n actionbarHeight: number;\r\n setActionbarHeight: (value: number) => void;\r\n pinnedRowIds: Set<string>;\r\n setPinnedRowIds: (value: Set<string>) => void;\r\n};\r\n\r\nconst DataGridContext = React.createContext<DataGridContext | null>(null);\r\n\r\nconst useDataGrid = () => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"useDataGrid should be used within <DataGrid>\");\r\n }\r\n\r\n return context;\r\n};\r\n\r\n/**\r\n * Props for the root DataGrid provider.\r\n */\r\ntype DataGridProps = {\r\n /** Content rendered inside the provider. */\r\n children: React.ReactNode;\r\n};\r\n\r\n/**\r\n * DataGrid provider.\r\n * Provides shared state for the grid shell, content, and toolbar actions.\r\n * @param {DataGridProps} props - DataGrid props.\r\n * @param {React.ReactNode} children - Content rendered inside the provider.\r\n * @returns {React.ReactElement}\r\n */\r\n\r\nconst DataGrid: React.FC<DataGridProps> = ({ children }) => {\r\n const gridId = React.useId();\r\n const [api, setApi] = React.useState<GridApi | null>(null);\r\n const [rowData, setRowData] = React.useState<any[] | null | undefined>([]);\r\n const [actionbarHeight, setActionbarHeight] = React.useState(0);\r\n const [pinnedRowIds, setPinnedRowIds] = React.useState<Set<string>>(new Set());\r\n\r\n const [quickFilterText, setQuickFilterText] = React.useState(\"\");\r\n const [actionbarExists, setActionbarExists] = React.useState(false);\r\n return (\r\n <DataGridContext.Provider\r\n value={{\r\n api,\r\n setApi,\r\n rowData,\r\n setRowData,\r\n gridId,\r\n quickFilterText,\r\n setQuickFilterText,\r\n actionbarExists,\r\n setActionbarExists,\r\n actionbarHeight,\r\n setActionbarHeight,\r\n pinnedRowIds,\r\n setPinnedRowIds,\r\n }}\r\n >\r\n {children}\r\n </DataGridContext.Provider>\r\n );\r\n};\r\n\r\n/**\r\n * Props for the Ag Grid content wrapper.\r\n */\r\ntype DataGridContentProps = Omit<AgGridReactProps, \"theme\"> & {\r\n /** Optional theme override forwarded to ag-Grid. */\r\n theme?: Theme;\r\n};\r\n\r\n/**\r\n * DataGridContent component.\r\n * Connects ag-Grid to the shared DataGrid context and keeps pinned rows separate from the main row set.\r\n * @param {DataGridContentProps} props - Ag Grid props.\r\n * @param {Theme} [theme] - Optional ag-Grid theme override.\r\n * @param {GridReadyEvent} [onGridReady] - Called when the grid becomes ready.\r\n * @param {any[] | null | undefined} [rowData] - Row data rendered by the grid.\r\n * @param {string} [quickFilterText] - Quick filter text synced from the search action.\r\n * @param {React.CSSProperties} [containerStyle] - Inline styles applied to the grid container.\r\n * @param {Function} [getRowId] - Resolves the row id used to keep pinned rows stable.\r\n * @param {React.ForwardedRef<AgGridReact>} ref - Grid ref.\r\n * @returns {React.ReactElement}\r\n */\r\nconst DataGridContent = forwardRef<AgGridReact, DataGridContentProps>(\r\n ({ theme: propTheme, onGridReady, quickFilterText: quickFilterTextProps, rowData: rowDataProps, containerStyle, getRowId, ...props }, ref) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"DataGridContent should be used within <DataGrid>\");\r\n }\r\n const { rowData, setRowData, actionbarExists, setApi, setQuickFilterText, quickFilterText, gridId, actionbarHeight, pinnedRowIds } = context;\r\n\r\n const theme = useMemo(() => {\r\n return dataGridDefaultTheme.withParams({\r\n headerHeight: 40,\r\n wrapperBorderRadius: actionbarExists ? \"0px 0px 8px 8px\" : \"8px\",\r\n });\r\n }, [actionbarExists]);\r\n\r\n const handleGridReady = (e: GridReadyEvent) => {\r\n setApi(e.api);\r\n onGridReady?.(e);\r\n };\r\n\r\n React.useEffect(() => {\r\n setRowData(rowDataProps);\r\n }, [rowDataProps, setRowData]);\r\n\r\n React.useEffect(() => {\r\n if (quickFilterTextProps !== undefined) {\r\n setQuickFilterText(quickFilterTextProps ?? \"\");\r\n }\r\n }, [quickFilterTextProps, setQuickFilterText]);\r\n\r\n const { finalRowData, finalPinnedTopRowData } = useMemo(() => {\r\n if (!rowData || pinnedRowIds.size === 0) {\r\n return { finalRowData: rowData, finalPinnedTopRowData: [] };\r\n }\r\n\r\n const pinned: any[] = [];\r\n const unpinned: any[] = [];\r\n\r\n rowData.forEach(data => {\r\n const id = getRowId ? getRowId({ data, level: 0 } as any) : (data as any).id;\r\n const stringId = id !== undefined && id !== null ? String(id) : undefined;\r\n\r\n if (stringId !== undefined && pinnedRowIds.has(stringId)) {\r\n pinned.push(data);\r\n } else {\r\n unpinned.push(data);\r\n }\r\n });\r\n\r\n return { finalRowData: unpinned, finalPinnedTopRowData: pinned };\r\n }, [rowData, pinnedRowIds, getRowId]);\r\n\r\n return (\r\n <AgGridReact\r\n gridId={gridId}\r\n theme={propTheme ?? theme}\r\n rowData={finalRowData}\r\n pinnedTopRowData={finalPinnedTopRowData}\r\n quickFilterText={quickFilterText}\r\n onGridReady={handleGridReady}\r\n containerStyle={{ height: `calc(100% - ${actionbarHeight}px)`, ...containerStyle }}\r\n getRowId={getRowId}\r\n {...props}\r\n ref={ref}\r\n />\r\n );\r\n },\r\n);\r\n\r\nDataGridContent.displayName = \"DataGridContent\";\r\n\r\n/**\r\n * Props for the DataGrid action bar container.\r\n */\r\ntype DatagridActionBarProps = HTMLAttributes<HTMLDivElement> & {};\r\n\r\n/**\r\n * DataGrid action bar.\r\n * Marks the grid as having a toolbar so the grid can adjust border radius and height.\r\n * @param {DatagridActionBarProps} props - Action bar props.\r\n * @param {React.ReactNode} children - Action bar content.\r\n * @param {string} className - Additional classes applied to the action bar.\r\n * @returns {React.ReactElement}\r\n */\r\nconst DataGridActionBar: React.FC<DatagridActionBarProps> = ({ className, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"DataGridActionBar should be used within <DataGrid>\");\r\n }\r\n const ref = React.useRef<HTMLDivElement | null>(null);\r\n const { setActionbarExists, setActionbarHeight } = context;\r\n const { children } = props;\r\n\r\n React.useEffect(() => {\r\n setActionbarExists(true);\r\n return () => setActionbarExists(false);\r\n }, [setActionbarExists]);\r\n\r\n React.useEffect(() => {\r\n if (ref.current) {\r\n setActionbarHeight(ref.current.clientHeight);\r\n }\r\n }, [setActionbarHeight]);\r\n\r\n return (\r\n <div\r\n className={cn(\r\n \"relative flex items-center p-2 h-12 w-full bg-gray-0 border border-gray-200 border-b-0 -mb-[1px] z-10 rounded-t-[8px]\",\r\n className,\r\n )}\r\n ref={ref}\r\n >\r\n {children}\r\n </div>\r\n );\r\n};\r\n\r\n/**\r\n * Props for SearchAction.\r\n */\r\ntype SearchActionProps = HTMLAttributes<HTMLDivElement> & {\r\n /** Opens the search input immediately on mount. */\r\n defaultOpen?: boolean;\r\n /** Focuses the input the first time it opens. */\r\n defaultOpenAutoFocus?: boolean;\r\n};\r\n\r\n/**\r\n * Search action.\r\n * Toggles the quick filter input and manages its open/close focus behavior.\r\n * @param {SearchActionProps} props - Search action props.\r\n * @param {boolean} [defaultOpen] - Opens the search input immediately on mount.\r\n * @param {boolean} [defaultOpenAutoFocus] - Focuses the input the first time it opens.\r\n * @param {React.ReactNode} children - Optional wrapper content.\r\n * @param {string} className - Additional wrapper classes.\r\n * @returns {React.ReactElement}\r\n */\r\nconst SearchAction: React.FC<SearchActionProps> = ({ defaultOpen = false, defaultOpenAutoFocus = true, className, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"SearchAction should be used within <DataGrid>\");\r\n }\r\n\r\n const { quickFilterText, setQuickFilterText } = context;\r\n\r\n const [isSearchInputOpen, setIsSearchInputOpen] = React.useState(defaultOpen);\r\n const [isClosing, setIsClosing] = React.useState(false);\r\n const inputRef = React.useRef<HTMLInputElement | null>(null);\r\n const firstRenderRef = React.useRef(true);\r\n\r\n const handleClear = () => {\r\n context.setQuickFilterText(\"\");\r\n if (inputRef.current) {\r\n inputRef.current.focus();\r\n }\r\n };\r\n\r\n const handleOpen = () => {\r\n setIsSearchInputOpen(true);\r\n };\r\n\r\n React.useEffect(() => {\r\n if (isSearchInputOpen && inputRef?.current && (defaultOpenAutoFocus || !firstRenderRef.current)) {\r\n inputRef.current.focus();\r\n }\r\n firstRenderRef.current = false;\r\n }, [isSearchInputOpen, defaultOpenAutoFocus]);\r\n\r\n const handleClose = () => {\r\n setIsClosing(true);\r\n context.setQuickFilterText(\"\");\r\n setTimeout(() => {\r\n setIsSearchInputOpen(false);\r\n setIsClosing(false);\r\n }, 200);\r\n };\r\n\r\n return (\r\n <div className={cn(\"max-w-60\", className)} {...props}>\r\n {isSearchInputOpen || isClosing ? (\r\n <TextField\r\n ref={inputRef}\r\n className={cn(\"relative h-7.5\", isSearchInputOpen && !isClosing ? \"animate-input-open\" : \"\", isClosing && \"animate-input-close\")}\r\n onChange={e => setQuickFilterText(e.target.value)}\r\n value={quickFilterText}\r\n startAdornment={\r\n <IconButton type=\"button\" variant=\"toolbar\" className=\"p-0.5 h-6 w-6 border-none mx-1\" onClick={handleClose}>\r\n <Magnifier className=\"w-5 h-5\" />\r\n </IconButton>\r\n }\r\n endAdornment={\r\n quickFilterText && (\r\n <IconButton type=\"button\" variant=\"toolbar\" className=\"p-0.5 w-6 h-6 border-none mx-1\" onClick={handleClear}>\r\n <CircleXmark className=\"w-5 h-5\" />\r\n </IconButton>\r\n )\r\n }\r\n />\r\n ) : (\r\n <IconButton type=\"button\" variant=\"toolbar\" className=\"p-0.5 w-6 h-6 m-1\" onClick={handleOpen}>\r\n <Magnifier className=\"w-5 h-5\" />\r\n </IconButton>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\n/**\r\n * Props for FreezeAction.\r\n */\r\ntype FreezeActionProps = ButtonProps & {\r\n /** Label shown when rows can be frozen. */\r\n freezeText?: string;\r\n /** Label shown when rows are already frozen. */\r\n unFreezeText?: string;\r\n};\r\n\r\n/**\r\n * Freeze action.\r\n * Pins the current selection when rows are selected, or clears pinned rows when the grid is already frozen.\r\n * @param {FreezeActionProps} props - Freeze action props.\r\n * @param {boolean} [disabled] - Disables the action button.\r\n * @param {React.MouseEventHandler<HTMLButtonElement>} [onClick] - Called after the freeze toggle runs.\r\n * @returns {React.ReactElement}\r\n */\r\nconst FreezeAction: React.FC<FreezeActionProps> = ({ freezeText, unFreezeText, onClick, disabled, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"FreezeAction should be used within <DataGrid>\");\r\n }\r\n\r\n const [pinnedRowCount, setPinnedRowCount] = React.useState(0);\r\n const [selectedRowsCount, setSelectedRowsCount] = React.useState(0);\r\n\r\n const { api, pinnedRowIds, setPinnedRowIds } = context;\r\n\r\n const freezeRows = () => {\r\n if (!api) return;\r\n\r\n // Get currently selected rows\r\n const selectedRows = api.getSelectedNodes();\r\n\r\n if (selectedRows.length > 0) {\r\n const newPinnedIds = new Set(pinnedRowIds);\r\n selectedRows.forEach(row => {\r\n if (row.id !== undefined) {\r\n newPinnedIds.add(row.id);\r\n }\r\n });\r\n setPinnedRowIds(newPinnedIds);\r\n api.deselectAll();\r\n }\r\n };\r\n\r\n const unfreezeRows = () => {\r\n setPinnedRowIds(new Set());\r\n };\r\n\r\n const handleFreezing = (e: React.MouseEvent<HTMLButtonElement>) => {\r\n if (api) {\r\n const pinnedRowsCount = api.getPinnedTopRowCount();\r\n if (pinnedRowsCount > 0) {\r\n unfreezeRows();\r\n } else {\r\n freezeRows();\r\n }\r\n }\r\n onClick?.(e);\r\n };\r\n\r\n React.useEffect(() => {\r\n api?.addEventListener(\"pinnedRowDataChanged\", () => {\r\n setPinnedRowCount(api.getPinnedTopRowCount());\r\n });\r\n\r\n api?.addEventListener(\"selectionChanged\", () => {\r\n setSelectedRowsCount(api.getSelectedNodes().length);\r\n });\r\n\r\n return () => {\r\n if (api?.isDestroyed()) return;\r\n api?.removeEventListener(\"pinnedRowDataChanged\", () => {\r\n setPinnedRowCount(api.getPinnedTopRowCount());\r\n });\r\n\r\n api?.removeEventListener(\"selectionChanged\", () => {\r\n setSelectedRowsCount(api.getSelectedNodes().length);\r\n });\r\n };\r\n }, [api]);\r\n\r\n return (\r\n <Button\r\n variant=\"text\"\r\n type=\"button\"\r\n onClick={handleFreezing}\r\n startIcon={<Snowflake className=\"w-4.5 h-4.5\" />}\r\n disabled={(!pinnedRowCount && !selectedRowsCount) || disabled}\r\n {...props}\r\n >\r\n {pinnedRowCount ? (unFreezeText ?? \"Unfreeze\") : (freezeText ?? \"Freeze\")}\r\n </Button>\r\n );\r\n};\r\n\r\n/**\r\n * Props for PrintAction.\r\n */\r\ntype PrintActionProps = IconButtonProps & {};\r\n\r\n/**\r\n * Print action.\r\n * Switches the grid to print layout, captures the rendered markup, and opens the browser print flow.\r\n * @param {PrintActionProps} props - Print action props.\r\n * @param {React.ReactNode} [children] - Custom icon content rendered in the button.\r\n * @param {string} [className] - Additional button classes.\r\n * @param {React.MouseEventHandler<HTMLButtonElement>} [onClick] - Called after printing is triggered.\r\n * @returns {React.ReactElement}\r\n */\r\nconst PrintAction: React.FC<PrintActionProps> = ({ children, className, onClick, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"PrintAction should be used within <DataGrid>\");\r\n }\r\n\r\n const handlePrint = (e: React.MouseEvent<HTMLButtonElement>) => {\r\n if (context.api) {\r\n context.api.setGridOption(\"domLayout\", \"print\");\r\n\r\n setTimeout(() => {\r\n const element = document.querySelector(\"[grid-id='\" + context.gridId + \"']\") as HTMLElement;\r\n const header = document.head;\r\n const html = `<html>\r\n ${header.innerHTML}\r\n ${element.outerHTML}\r\n </html>`;\r\n printHtml(html);\r\n context?.api?.setGridOption(\"domLayout\", undefined);\r\n });\r\n }\r\n onClick?.(e);\r\n };\r\n\r\n return (\r\n <IconButton type=\"button\" variant=\"toolbar\" className={cn(\"p-0.5 w-6 h-6\", className)} onClick={handlePrint} {...props}>\r\n {children ?? <Print className=\"w-5 h-5\" />}\r\n </IconButton>\r\n );\r\n};\r\n\r\n/**\r\n * Props for RefreshAction.\r\n */\r\ntype RefreshActionProps = Omit<IconButtonProps, \"onClick\"> & {\r\n /** Callback invoked when the refresh action is clicked. */\r\n onRefresh: () => void;\r\n};\r\n\r\n/**\r\n * Refresh action.\r\n * Calls the provided refresh callback and reflects the loading state in the toolbar button.\r\n * @param {RefreshActionProps} props - Refresh action props.\r\n * @param {() => void} onRefresh - Called when the button is clicked.\r\n * @param {boolean} [loading] - Shows the loading spinner and disables the button.\r\n * @param {React.ReactNode} [children] - Custom icon content rendered in the button.\r\n * @param {string} [className] - Additional button classes.\r\n * @returns {React.ReactElement}\r\n */\r\nconst RefreshAction: React.FC<RefreshActionProps> = ({ className, onRefresh, children, loading, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"RefreshAction should be used within <DataGrid>\");\r\n }\r\n\r\n const handleRefresh = () => {\r\n onRefresh();\r\n };\r\n\r\n return (\r\n <IconButton\r\n type=\"button\"\r\n className={cn(\"p-0.5 w-6 h-6\", loading && \"disabled:bg-transparent\", className)}\r\n variant=\"toolbar\"\r\n onClick={handleRefresh}\r\n disabled={loading}\r\n {...props}\r\n >\r\n {children ?? <Refresh className={cn(\"w-4.5 h-4.5\", loading && \"animate-spin\")} />}\r\n </IconButton>\r\n );\r\n};\r\n\r\n/**\r\n * Props for DeleteAction.\r\n */\r\ntype DeleteActionProps = Omit<ButtonProps, \"onClick\"> & {\r\n /** Callback invoked when the delete action is clicked. */\r\n onDelete: () => void;\r\n};\r\n\r\n/**\r\n * Delete action.\r\n * Renders a danger button with the delete icon and delegates the click to the provided handler.\r\n * @param {DeleteActionProps} props - Delete action props.\r\n * @param {() => void} onDelete - Called when the button is clicked.\r\n * @param {React.ReactNode} [children] - Button label or custom content.\r\n * @returns {React.ReactElement}\r\n */\r\nconst DeleteAction: React.FC<DeleteActionProps> = ({ onDelete, children, ...props }) => {\r\n const handleDelete = () => {\r\n onDelete();\r\n };\r\n\r\n return (\r\n <Button variant=\"danger\" type=\"button\" onClick={handleDelete} startIcon={<Trashcan className=\"w-4.5 h-4.5\" />} {...props}>\r\n {children}\r\n </Button>\r\n );\r\n};\r\n\r\n/**\r\n * Props for ExtraActions.\r\n */\r\ntype ExtraActionsProps = PopoverContentProps & {\r\n /** Menu items rendered inside the popover. */\r\n children: React.ReactNode;\r\n /** Props forwarded to the popover trigger and popover root. */\r\n slotProps?: {\r\n triggerProps?: PopoverTriggerProps;\r\n popoverProps?: PopoverProps;\r\n };\r\n};\r\n\r\n/**\r\n * Extra actions menu.\r\n * Wraps overflow actions in a popover anchored to the vertical ellipsis trigger.\r\n * @param {ExtraActionsProps} props - Extra actions props.\r\n * @param {React.ReactNode} children - Menu items rendered inside the popover.\r\n * @param {{ triggerProps?: PopoverTriggerProps; popoverProps?: PopoverProps; }} [slotProps] - Props forwarded to the trigger and popover root.\r\n * @param {string} [className] - Additional popover content classes.\r\n * @returns {React.ReactElement}\r\n */\r\nconst ExtraActions: React.FC<ExtraActionsProps> = ({ children, slotProps, className, ...props }) => {\r\n return (\r\n <Popover {...(slotProps?.popoverProps ?? {})}>\r\n <PopoverTrigger {...(slotProps?.triggerProps ?? {})}>\r\n <ElipsisVertical className=\"w-4.5 h-4.5 text-primary\" />\r\n </PopoverTrigger>\r\n <PopoverContent align=\"end\" className={cn(\"w-40\", className)} {...props}>\r\n {children}\r\n </PopoverContent>\r\n </Popover>\r\n );\r\n};\r\n\r\nexport {\r\n DataGrid,\r\n DataGridContent,\r\n DataGridActionBar,\r\n SearchAction,\r\n FreezeAction,\r\n PrintAction,\r\n RefreshAction,\r\n ExtraActions,\r\n DeleteAction,\r\n type DataGridProps,\r\n type DataGridContentProps,\r\n type DatagridActionBarProps,\r\n type SearchActionProps,\r\n type FreezeActionProps,\r\n type RefreshActionProps,\r\n type ExtraActionsProps,\r\n type DeleteActionProps,\r\n useDataGrid,\r\n dataGridDefaultTheme,\r\n};\r\n"],"names":["ModuleRegistry","AllCommunityModule","dataGridDefaultTheme","themeQuartz","DataGridContext","React","useDataGrid","context","DataGrid","children","gridId","api","setApi","rowData","setRowData","actionbarHeight","setActionbarHeight","pinnedRowIds","setPinnedRowIds","quickFilterText","setQuickFilterText","actionbarExists","setActionbarExists","jsx","DataGridContent","forwardRef","propTheme","onGridReady","quickFilterTextProps","rowDataProps","containerStyle","getRowId","props","ref","theme","useMemo","handleGridReady","e","finalRowData","finalPinnedTopRowData","pinned","unpinned","data","id","stringId","AgGridReact","DataGridActionBar","className","cn","SearchAction","defaultOpen","defaultOpenAutoFocus","isSearchInputOpen","setIsSearchInputOpen","isClosing","setIsClosing","inputRef","firstRenderRef","handleClear","handleOpen","handleClose","TextField","IconButton","Magnifier","CircleXmark","FreezeAction","freezeText","unFreezeText","onClick","disabled","pinnedRowCount","setPinnedRowCount","selectedRowsCount","setSelectedRowsCount","freezeRows","selectedRows","newPinnedIds","row","unfreezeRows","handleFreezing","Button","Snowflake","PrintAction","handlePrint","element","html","printHtml","Print","RefreshAction","onRefresh","loading","handleRefresh","Refresh","DeleteAction","onDelete","Trashcan","ExtraActions","slotProps","Popover","PopoverTrigger","ElipsisVertical","PopoverContent"],"mappings":";;;;;;;;;;;AAgBAA,EAAe,gBAAgB,CAACC,CAAkB,CAAC;AAKnD,MAAMC,IAAuBC,EAAY,WAAW;AAAA,EAClD,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,uBAAuB;AAAA,EACvB,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,eAAe;AACjB,CAAC,GAqB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AA,EAAgB,GAAIF,GAAW,gBAAgB,CAAA,GAC9C,UAAA,gBAAA1E,EAAC6E,GAAA,EAAgB,WAAU,2BAAA,CAA2B,EAAA,CACxD;AAAA,EACA,gBAAA7E,EAAC8E,GAAA,EAAe,OAAM,OAAM,WAAWrD,EAAG,QAAQD,CAAS,GAAI,GAAGf,GAC/D,UAAAvB,EAAA,CACH;AAAA,GACF;"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@trsys-tech/matrix-library",
3
3
  "description": "MatrixUI Library",
4
4
  "private": false,
5
- "version": "0.6.2",
5
+ "version": "0.6.3-canary-1",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
@@ -89,8 +89,8 @@
89
89
  "vaul": "^1.1.1"
90
90
  },
91
91
  "peerDependencies": {
92
- "react": "^19.2.4",
93
- "react-dom": "^19.2.4",
92
+ "react": "^18.3.1 || ^19.0.0",
93
+ "react-dom": "^18.3.1 || ^19.0.0",
94
94
  "react-hook-form": "^7.61.1"
95
95
  },
96
96
  "devDependencies": {