@toolbox-web/grid-react 0.16.0 → 0.17.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.
@@ -0,0 +1,5 @@
1
+ import { createContext as t } from "react";
2
+ const o = t(null);
3
+ export {
4
+ o as G
5
+ };
@@ -1,5 +1,5 @@
1
1
  import { useContext as g, useCallback as n } from "react";
2
- import { G as c } from "../chunks/data-grid-oxWjOqoA.js";
2
+ import { G as c } from "../chunks/grid-element-context-BU3WvNtM.js";
3
3
  import "@toolbox-web/grid/features/export";
4
4
  function E() {
5
5
  const i = g(c), t = n(() => i?.current?.getPluginByName("export"), [i]), x = n(
@@ -2,7 +2,7 @@ import { FilteringPlugin as c } from "@toolbox-web/grid/plugins/filtering";
2
2
  import { useContext as m, useCallback as n } from "react";
3
3
  import { flushSync as w } from "react-dom";
4
4
  import { createRoot as P } from "react-dom/client";
5
- import { G as b } from "../chunks/data-grid-oxWjOqoA.js";
5
+ import { G as b } from "../chunks/grid-element-context-BU3WvNtM.js";
6
6
  import { registerFeature as R } from "@toolbox-web/grid/features/registry";
7
7
  R("filtering", (r) => {
8
8
  if (typeof r == "boolean") return new c();
@@ -1 +1,25 @@
1
+ /**
2
+ * Column Grouping feature for @toolbox-web/grid-react
3
+ *
4
+ * Import this module to enable the `groupingColumns` prop on DataGrid.
5
+ * Automatically bridges React JSX `groupHeaderRenderer` to vanilla DOM.
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * import '@toolbox-web/grid-react/features/grouping-columns';
10
+ *
11
+ * <DataGrid groupingColumns />
12
+ * ```
13
+ *
14
+ * @example Custom group header renderer
15
+ * ```tsx
16
+ * <DataGrid groupingColumns={{
17
+ * columnGroups: [...],
18
+ * groupHeaderRenderer: (params) => <strong>{params.label} ({params.columns.length})</strong>,
19
+ * }} />
20
+ * ```
21
+ *
22
+ * @packageDocumentation
23
+ */
24
+ export {};
1
25
  //# sourceMappingURL=grouping-columns.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"grouping-columns.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/features/grouping-columns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,6CAA6C,CAAC"}
1
+ {"version":3,"file":"grouping-columns.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/features/grouping-columns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG"}
@@ -1 +1,21 @@
1
- import "@toolbox-web/grid/features/grouping-columns";
1
+ import { GroupingColumnsPlugin as n } from "@toolbox-web/grid/plugins/grouping-columns";
2
+ import { flushSync as c } from "react-dom";
3
+ import { createRoot as s } from "react-dom/client";
4
+ import { registerFeature as m } from "@toolbox-web/grid/features/registry";
5
+ m("groupingColumns", (e) => {
6
+ if (typeof e == "boolean") return new n();
7
+ if (!e) return new n();
8
+ const r = e, t = { ...r };
9
+ if (typeof r.groupHeaderRenderer == "function") {
10
+ const u = r.groupHeaderRenderer;
11
+ t.groupHeaderRenderer = (p) => {
12
+ const o = document.createElement("div");
13
+ o.style.display = "contents";
14
+ const i = s(o);
15
+ return c(() => {
16
+ i.render(u(p));
17
+ }), o;
18
+ };
19
+ }
20
+ return new n(t);
21
+ });
@@ -1 +1,25 @@
1
+ /**
2
+ * Row Grouping feature for @toolbox-web/grid-react
3
+ *
4
+ * Import this module to enable the `groupingRows` prop on DataGrid.
5
+ * Automatically bridges React JSX `groupRowRenderer` to vanilla DOM.
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * import '@toolbox-web/grid-react/features/grouping-rows';
10
+ *
11
+ * <DataGrid groupingRows={{ groupBy: ['department'] }} />
12
+ * ```
13
+ *
14
+ * @example Custom group row renderer
15
+ * ```tsx
16
+ * <DataGrid groupingRows={{
17
+ * groupBy: ['department'],
18
+ * groupRowRenderer: (params) => <strong>{params.key}: {params.value} ({params.rows.length})</strong>,
19
+ * }} />
20
+ * ```
21
+ *
22
+ * @packageDocumentation
23
+ */
24
+ export {};
1
25
  //# sourceMappingURL=grouping-rows.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"grouping-rows.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/features/grouping-rows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,0CAA0C,CAAC"}
1
+ {"version":3,"file":"grouping-rows.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/features/grouping-rows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG"}
@@ -1 +1,21 @@
1
- import "@toolbox-web/grid/features/grouping-rows";
1
+ import { GroupingRowsPlugin as t } from "@toolbox-web/grid/plugins/grouping-rows";
2
+ import { flushSync as c } from "react-dom";
3
+ import { createRoot as s } from "react-dom/client";
4
+ import { registerFeature as f } from "@toolbox-web/grid/features/registry";
5
+ f("groupingRows", (e) => {
6
+ if (typeof e == "boolean") return new t();
7
+ if (!e) return new t();
8
+ const r = e, n = { ...r };
9
+ if (typeof r.groupRowRenderer == "function") {
10
+ const p = r.groupRowRenderer;
11
+ n.groupRowRenderer = (i) => {
12
+ const o = document.createElement("div");
13
+ o.style.display = "contents";
14
+ const u = s(o);
15
+ return c(() => {
16
+ u.render(p(i));
17
+ }), o;
18
+ };
19
+ }
20
+ return new t(n);
21
+ });
package/features/index.js CHANGED
@@ -3,15 +3,15 @@ import "@toolbox-web/grid/features/column-virtualization";
3
3
  import "@toolbox-web/grid/features/context-menu";
4
4
  import "@toolbox-web/grid/features/editing";
5
5
  import "react";
6
- import "../chunks/data-grid-oxWjOqoA.js";
6
+ import "../chunks/grid-element-context-BU3WvNtM.js";
7
7
  import "@toolbox-web/grid/features/export";
8
8
  import "./filtering.js";
9
- import "@toolbox-web/grid/features/grouping-columns";
10
- import "@toolbox-web/grid/features/grouping-rows";
9
+ import "./grouping-columns.js";
10
+ import "./grouping-rows.js";
11
11
  import "@toolbox-web/grid/features/master-detail";
12
12
  import "@toolbox-web/grid/features/multi-sort";
13
13
  import "@toolbox-web/grid/features/pinned-columns";
14
- import "@toolbox-web/grid/features/pinned-rows";
14
+ import "./pinned-rows.js";
15
15
  import "@toolbox-web/grid/features/pivot";
16
16
  import "@toolbox-web/grid/features/print";
17
17
  import "@toolbox-web/grid/features/responsive";
@@ -1 +1 @@
1
- {"version":3,"file":"pinned-rows.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/features/pinned-rows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,wCAAwC,CAAC"}
1
+ {"version":3,"file":"pinned-rows.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/features/pinned-rows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,wCAAwC,CAAC"}
@@ -1 +1,25 @@
1
1
  import "@toolbox-web/grid/features/pinned-rows";
2
+ import { PinnedRowsPlugin as o } from "@toolbox-web/grid/plugins/pinned-rows";
3
+ import { flushSync as u } from "react-dom";
4
+ import { createRoot as f } from "react-dom/client";
5
+ import { registerFeature as p } from "@toolbox-web/grid/features/registry";
6
+ p("pinnedRows", (e) => {
7
+ if (typeof e == "boolean") return new o();
8
+ if (!e) return new o();
9
+ const t = e, s = { ...t };
10
+ return Array.isArray(t.customPanels) && (s.customPanels = t.customPanels.map((r) => {
11
+ if (typeof r.render != "function") return r;
12
+ const i = r.render;
13
+ return {
14
+ ...r,
15
+ render: (c) => {
16
+ const n = document.createElement("div");
17
+ n.style.display = "contents";
18
+ const m = f(n);
19
+ return u(() => {
20
+ m.render(i(c));
21
+ }), n;
22
+ }
23
+ };
24
+ })), new o(s);
25
+ });
package/features/print.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useContext as g, useCallback as t } from "react";
2
- import { G as u } from "../chunks/data-grid-oxWjOqoA.js";
2
+ import { G as u } from "../chunks/grid-element-context-BU3WvNtM.js";
3
3
  import "@toolbox-web/grid/features/print";
4
4
  function l() {
5
5
  const r = g(u), n = t(() => r?.current?.getPluginByName("print"), [r]), o = t(
@@ -1,5 +1,5 @@
1
1
  import { useContext as m, useCallback as n } from "react";
2
- import { G as S } from "../chunks/data-grid-oxWjOqoA.js";
2
+ import { G as S } from "../chunks/grid-element-context-BU3WvNtM.js";
3
3
  import "@toolbox-web/grid/features/selection";
4
4
  function h() {
5
5
  const l = m(S), e = n(() => l?.current?.getPluginByName("selection"), [l]), g = n(() => {
@@ -1,5 +1,5 @@
1
1
  import { useContext as U, useCallback as d } from "react";
2
- import { G as p } from "../chunks/data-grid-oxWjOqoA.js";
2
+ import { G as p } from "../chunks/grid-element-context-BU3WvNtM.js";
3
3
  import "@toolbox-web/grid/features/undo-redo";
4
4
  function m() {
5
5
  const e = U(p), n = d(() => e?.current?.getPluginByName("undoRedo"), [e]), r = d(() => {
package/index.d.ts CHANGED
@@ -9,19 +9,19 @@ export type { AllFeatureProps, FeatureProps, SSRProps } from './lib/feature-prop
9
9
  export type { ColumnShorthand } from './lib/column-shorthand';
10
10
  export type { EventHandler, EventProps } from './lib/event-props';
11
11
  export { GridTypeProvider, useGridTypeDefaults, useTypeDefault, type GridTypeProviderProps,
12
- /** @deprecated Use `TypeDefault` instead */
12
+ /** @deprecated Use `TypeDefault` instead. Will be removed in v2. */
13
13
  type ReactTypeDefault, type TypeDefault, type TypeDefaultsMap, } from './lib/grid-type-registry';
14
14
  export { GridIconProvider, useGridIcons, type GridIconProviderProps } from './lib/grid-icon-registry';
15
15
  export { GridProvider, type GridProviderProps } from './lib/grid-provider';
16
16
  export type { ColumnConfig, GridConfig,
17
- /** @deprecated Use `ColumnConfig` instead */
17
+ /** @deprecated Use `ColumnConfig` instead. Will be removed in v2. */
18
18
  ReactColumnConfig,
19
- /** @deprecated Use `GridConfig` instead */
19
+ /** @deprecated Use `GridConfig` instead. Will be removed in v2. */
20
20
  ReactGridConfig, } from './lib/react-column-config';
21
21
  export { useGrid, type ExportMethods, type SelectionMethods, type UseGridReturn } from './lib/use-grid';
22
22
  export { useGridEvent } from './lib/use-grid-event';
23
23
  export { GridAdapter } from './lib/react-grid-adapter';
24
- /** @deprecated Use `GridAdapter` instead */
24
+ /** @deprecated Use `GridAdapter` instead. Will be removed in v2. */
25
25
  export { ReactGridAdapter } from './lib/react-grid-adapter';
26
26
  export type { GridCellContext, GridDetailContext, GridEditorContext, GridToolPanelContext } from './lib/context-types';
27
27
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../libs/grid-react/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,YAAY,CAAC;AAGpB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,KAAK,kBAAkB,EAAE,KAAK,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC9G,OAAO,EACL,kBAAkB,EAClB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,GAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGtG,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGnF,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAG9D,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGlE,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,KAAK,qBAAqB;AAE1B,4CAA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