@gears-frontx/ui-kit 0.4.5 → 0.4.7
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.
- package/dist/chunks/actions.iasfkjWq.css +1 -0
- package/dist/chunks/create-column-auto-size.js +62 -0
- package/dist/chunks/create-column-auto-size.js.map +1 -0
- package/dist/chunks/data-grid-record-context.js +13 -0
- package/dist/chunks/data-grid-record-context.js.map +1 -0
- package/dist/chunks/data-grid.DSkYrsay.css +1 -0
- package/dist/chunks/drag-drop.BASVe3_O.css +1 -0
- package/dist/chunks/hooked.js +23 -39
- package/dist/chunks/hooked.js.map +1 -1
- package/dist/chunks/ignore-row-click.js +5 -0
- package/dist/chunks/ignore-row-click.js.map +1 -0
- package/dist/chunks/is-record.js +7 -0
- package/dist/chunks/is-record.js.map +1 -0
- package/dist/chunks/messages.js +30 -3
- package/dist/chunks/messages.js.map +1 -1
- package/dist/chunks/pagination.DJ7HJSFX.css +1 -0
- package/dist/chunks/resolve-body-cell-props.BA5IRWq0.css +1 -0
- package/dist/chunks/resolve-body-cell-props.js +124 -0
- package/dist/chunks/resolve-body-cell-props.js.map +1 -0
- package/dist/chunks/row-actions.BprAXgu2.css +1 -0
- package/dist/chunks/row-click-utils.js +12 -0
- package/dist/chunks/row-click-utils.js.map +1 -0
- package/dist/chunks/row-click.DAYTmSBO.css +1 -0
- package/dist/chunks/row-number.BxFT_3yP.css +1 -0
- package/dist/chunks/row-select.BjKdiMf5.css +1 -0
- package/dist/chunks/segment.js +16 -9
- package/dist/chunks/segment.js.map +1 -1
- package/dist/chunks/storage-helpers.js +40 -0
- package/dist/chunks/storage-helpers.js.map +1 -0
- package/dist/chunks/table-configuration.a6C_fp7B.css +1 -0
- package/dist/chunks/table-context.js +8 -0
- package/dist/chunks/table-context.js.map +1 -0
- package/dist/chunks/table-helpers.js +20 -0
- package/dist/chunks/table-helpers.js.map +1 -0
- package/dist/chunks/table-tree.DMtpMddS.css +1 -0
- package/dist/chunks/table-types.js +11 -0
- package/dist/chunks/table-types.js.map +1 -0
- package/dist/chunks/table.biUlW2U6.css +1 -0
- package/dist/chunks/use-latest.js +11 -0
- package/dist/chunks/use-latest.js.map +1 -0
- package/dist/components/data-grid/data-grid-types.d.ts +9 -0
- package/dist/components/data-grid/data-grid-types.d.ts.map +1 -1
- package/dist/components/data-grid/data-grid.d.ts +1 -1
- package/dist/components/data-grid/data-grid.d.ts.map +1 -1
- package/dist/components/data-grid/messages.d.ts +25 -0
- package/dist/components/data-grid/messages.d.ts.map +1 -1
- package/dist/components/data-grid/plugins/actions/actions-plugin.d.ts +4 -0
- package/dist/components/data-grid/plugins/actions/actions-plugin.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions/actions-types.d.ts +11 -0
- package/dist/components/data-grid/plugins/actions/actions-types.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions/components/data-grid-actions-wrapper.d.ts +3 -0
- package/dist/components/data-grid/plugins/actions/components/data-grid-actions-wrapper.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions/public.d.ts +3 -0
- package/dist/components/data-grid/plugins/actions/public.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions-menu/actions-menu-plugin.d.ts +3 -0
- package/dist/components/data-grid/plugins/actions-menu/actions-menu-plugin.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions-menu/actions-menu-types.d.ts +25 -0
- package/dist/components/data-grid/plugins/actions-menu/actions-menu-types.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions-menu/components/data-grid-actions-menu.d.ts +3 -0
- package/dist/components/data-grid/plugins/actions-menu/components/data-grid-actions-menu.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/data-grid-export-menu-item.d.ts +6 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/data-grid-export-menu-item.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-cells.d.ts +18 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-cells.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-menu-items.d.ts +9 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-menu-items.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-service.d.ts +5 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-service.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-types.d.ts +77 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-types.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/formatters/csv-formatter.d.ts +3 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/formatters/csv-formatter.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/formatters/excel-formatter.d.ts +4 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/formatters/excel-formatter.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions-menu/public.d.ts +5 -0
- package/dist/components/data-grid/plugins/actions-menu/public.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-body-cell.d.ts +3 -0
- package/dist/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-body-cell.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-content.d.ts +7 -0
- package/dist/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-content.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-row.d.ts +8 -0
- package/dist/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-row.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/drag-drop/drag-data.d.ts +4 -0
- package/dist/components/data-grid/plugins/drag-drop/drag-data.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/drag-drop/drag-drop-plugin.d.ts +18 -0
- package/dist/components/data-grid/plugins/drag-drop/drag-drop-plugin.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/drag-drop/drag-drop-types.d.ts +60 -0
- package/dist/components/data-grid/plugins/drag-drop/drag-drop-types.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/drag-drop/drag-preview.d.ts +2 -0
- package/dist/components/data-grid/plugins/drag-drop/drag-preview.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/drag-drop/public.d.ts +3 -0
- package/dist/components/data-grid/plugins/drag-drop/public.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/pagination/components/data-grid-pagination.d.ts.map +1 -1
- package/dist/components/data-grid/plugins/pagination/components/pager.d.ts +6 -0
- package/dist/components/data-grid/plugins/pagination/components/pager.d.ts.map +1 -1
- package/dist/components/data-grid/plugins/row-actions/components/data-grid-row-actions-cell.d.ts +3 -0
- package/dist/components/data-grid/plugins/row-actions/components/data-grid-row-actions-cell.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-actions/public.d.ts +3 -0
- package/dist/components/data-grid/plugins/row-actions/public.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-actions/row-actions-plugin.d.ts +6 -0
- package/dist/components/data-grid/plugins/row-actions/row-actions-plugin.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-actions/row-actions-types.d.ts +24 -0
- package/dist/components/data-grid/plugins/row-actions/row-actions-types.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-click/components/data-grid-row-click.d.ts +8 -0
- package/dist/components/data-grid/plugins/row-click/components/data-grid-row-click.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-click/public.d.ts +3 -0
- package/dist/components/data-grid/plugins/row-click/public.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-click/row-click-plugin.d.ts +14 -0
- package/dist/components/data-grid/plugins/row-click/row-click-plugin.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-click/row-click-utils.d.ts +9 -0
- package/dist/components/data-grid/plugins/row-click/row-click-utils.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-number/components/data-grid-row-number-cell.d.ts +3 -0
- package/dist/components/data-grid/plugins/row-number/components/data-grid-row-number-cell.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-number/public.d.ts +3 -0
- package/dist/components/data-grid/plugins/row-number/public.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-number/row-number-plugin.d.ts +4 -0
- package/dist/components/data-grid/plugins/row-number/row-number-plugin.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-number/row-number-types.d.ts +6 -0
- package/dist/components/data-grid/plugins/row-number/row-number-types.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-number/services/row-number-formula.d.ts +2 -0
- package/dist/components/data-grid/plugins/row-number/services/row-number-formula.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-select/components/data-grid-row-select-banner.d.ts +3 -0
- package/dist/components/data-grid/plugins/row-select/components/data-grid-row-select-banner.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-select/components/data-grid-row-select-body.d.ts +3 -0
- package/dist/components/data-grid/plugins/row-select/components/data-grid-row-select-body.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-select/components/data-grid-row-select-header.d.ts +3 -0
- package/dist/components/data-grid/plugins/row-select/components/data-grid-row-select-header.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-select/components/data-grid-row-select-top.d.ts +3 -0
- package/dist/components/data-grid/plugins/row-select/components/data-grid-row-select-top.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-select/public.d.ts +3 -0
- package/dist/components/data-grid/plugins/row-select/public.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-select/row-select-plugin.d.ts +5 -0
- package/dist/components/data-grid/plugins/row-select/row-select-plugin.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-select/row-select-types.d.ts +113 -0
- package/dist/components/data-grid/plugins/row-select/row-select-types.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-group-item.d.ts +10 -0
- package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-group-item.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-item.d.ts +10 -0
- package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-item.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-pin-button.d.ts +8 -0
- package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-pin-button.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-trigger.d.ts +3 -0
- package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-trigger.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration.d.ts +3 -0
- package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-configuration/public.d.ts +3 -0
- package/dist/components/data-grid/plugins/table-configuration/public.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-configuration/table-configuration-plugin.d.ts +5 -0
- package/dist/components/data-grid/plugins/table-configuration/table-configuration-plugin.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-tree/components/data-grid-table-tree-body-cell-content.d.ts +9 -0
- package/dist/components/data-grid/plugins/table-tree/components/data-grid-table-tree-body-cell-content.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-tree/components/data-grid-table-tree-expand.d.ts +3 -0
- package/dist/components/data-grid/plugins/table-tree/components/data-grid-table-tree-expand.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-tree/components/data-grid-table-tree-row.d.ts +8 -0
- package/dist/components/data-grid/plugins/table-tree/components/data-grid-table-tree-row.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-tree/public.d.ts +3 -0
- package/dist/components/data-grid/plugins/table-tree/public.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-tree/table-tree-helpers.d.ts +4 -0
- package/dist/components/data-grid/plugins/table-tree/table-tree-helpers.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-tree/table-tree-plugin.d.ts +5 -0
- package/dist/components/data-grid/plugins/table-tree/table-tree-plugin.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-tree/table-tree-types.d.ts +33 -0
- package/dist/components/data-grid/plugins/table-tree/table-tree-types.d.ts.map +1 -0
- package/dist/components/data-grid/services/core/data-grid-label-context.d.ts +7 -0
- package/dist/components/data-grid/services/core/data-grid-label-context.d.ts.map +1 -0
- package/dist/components/data-grid/services/layout/components/data-grid-layout-top.d.ts.map +1 -1
- package/dist/components/data-grid/services/layout/components/toolbar-lines.d.ts +2 -0
- package/dist/components/data-grid/services/layout/components/toolbar-lines.d.ts.map +1 -0
- package/dist/components/data-grid/services/table/components/data-grid-cell.d.ts.map +1 -1
- package/dist/components/data-grid/services/table/components/data-grid-extra-header-cell.d.ts.map +1 -1
- package/dist/components/data-grid/services/table/components/data-grid-header-cell.d.ts.map +1 -1
- package/dist/components/data-grid/services/table/components/data-grid-header-group.d.ts.map +1 -1
- package/dist/components/data-grid/services/table/components/data-grid-table.d.ts.map +1 -1
- package/dist/components/data-grid/services/table/table-service.d.ts.map +1 -1
- package/dist/components/data-grid/services/table/table-sticky.d.ts +16 -0
- package/dist/components/data-grid/services/table/table-sticky.d.ts.map +1 -1
- package/dist/components/pagination/pagination.d.ts +7 -4
- package/dist/components/pagination/pagination.d.ts.map +1 -1
- package/dist/components/table/table.d.ts +20 -3
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/data-grid/actions-menu.d.ts +1 -0
- package/dist/data-grid/actions-menu.js +373 -0
- package/dist/data-grid/actions-menu.js.map +1 -0
- package/dist/data-grid/actions.d.ts +1 -0
- package/dist/data-grid/actions.js +36 -0
- package/dist/data-grid/actions.js.map +1 -0
- package/dist/data-grid/drag-drop.d.ts +1 -0
- package/dist/data-grid/drag-drop.js +261 -0
- package/dist/data-grid/drag-drop.js.map +1 -0
- package/dist/data-grid/filters.js +27 -25
- package/dist/data-grid/filters.js.map +1 -1
- package/dist/data-grid/pagination.js +152 -143
- package/dist/data-grid/pagination.js.map +1 -1
- package/dist/data-grid/row-actions.d.ts +1 -0
- package/dist/data-grid/row-actions.js +52 -0
- package/dist/data-grid/row-actions.js.map +1 -0
- package/dist/data-grid/row-click.d.ts +1 -0
- package/dist/data-grid/row-click.js +62 -0
- package/dist/data-grid/row-click.js.map +1 -0
- package/dist/data-grid/row-number.d.ts +1 -0
- package/dist/data-grid/row-number.js +38 -0
- package/dist/data-grid/row-number.js.map +1 -0
- package/dist/data-grid/row-select.d.ts +1 -0
- package/dist/data-grid/row-select.js +293 -0
- package/dist/data-grid/row-select.js.map +1 -0
- package/dist/data-grid/table-configuration.d.ts +1 -0
- package/dist/data-grid/table-configuration.js +165 -0
- package/dist/data-grid/table-configuration.js.map +1 -0
- package/dist/data-grid/table-tree.d.ts +1 -0
- package/dist/data-grid/table-tree.js +233 -0
- package/dist/data-grid/table-tree.js.map +1 -0
- package/dist/data-grid.js +791 -887
- package/dist/data-grid.js.map +1 -1
- package/dist/docs/data-grid.md +612 -12
- package/dist/docs/pagination.md +14 -0
- package/dist/docs/table.md +67 -3
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +409 -389
- package/dist/index.js.map +1 -1
- package/dist/pagination.js +23 -23
- package/dist/pagination.js.map +1 -1
- package/dist/table.js +137 -135
- package/dist/table.js.map +1 -1
- package/llms.txt +12 -7
- package/package.json +10 -1
- package/dist/chunks/data-grid.DYrZEU-F.css +0 -1
- package/dist/chunks/pagination.CKDEuWt6.css +0 -1
- package/dist/chunks/table.CMm41tvy.css +0 -1
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { create as I } from "zustand";
|
|
3
|
+
import { u as L, b as P, c as q } from "../chunks/plugins-helpers.js";
|
|
4
|
+
import { jsx as D, jsxs as y } from "react/jsx-runtime";
|
|
5
|
+
import { cx as C } from "class-variance-authority";
|
|
6
|
+
import { GripVerticalIcon as B } from "lucide-react";
|
|
7
|
+
import { m as H } from "../chunks/messages.js";
|
|
8
|
+
import { I as N } from "../chunks/ignore-row-click.js";
|
|
9
|
+
import { u as O, D as j } from "../chunks/data-grid-record-context.js";
|
|
10
|
+
import { Spinner as F } from "../spinner.js";
|
|
11
|
+
import { combine as h } from "@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/combine.js";
|
|
12
|
+
import { dropTargetForElements as E, monitorForElements as V, draggable as A } from "@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/element/adapter.js";
|
|
13
|
+
import { extractClosestEdge as K, attachClosestEdge as M } from "@atlaskit/pragmatic-drag-and-drop-hitbox/dist/esm/closest-edge.js";
|
|
14
|
+
import { useRef as S, useEffect as G, useState as U } from "react";
|
|
15
|
+
import { i as T } from "../chunks/is-record.js";
|
|
16
|
+
import { pointerOutsideOfPreview as $ } from "@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/element/pointer-outside-of-preview.js";
|
|
17
|
+
import { setCustomNativeDragPreview as k } from "@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/element/set-custom-native-drag-preview.js";
|
|
18
|
+
import { flushSync as z, createPortal as J } from "react-dom";
|
|
19
|
+
import { D as b, r as Q, a as W } from "../chunks/resolve-body-cell-props.js";
|
|
20
|
+
import { u as X } from "../chunks/use-latest.js";
|
|
21
|
+
import { TableRow as Y } from "../table.js";
|
|
22
|
+
import '../chunks/drag-drop.BASVe3_O.css';const Z = "_dragHandler_mre9q_12", rr = "_dragHandlerLoading_mre9q_26", tr = "_dragRow_mre9q_38", or = "_dragRowDragging_mre9q_38", er = "_dragRowDropping_mre9q_60", nr = "_dragRowDropIndicatorTop_mre9q_66", ar = "_dragRowDropIndicatorBottom_mre9q_70", dr = "_dragPreview_mre9q_79", ir = "_content_mre9q_98", gr = "_contentDragging_mre9q_111", sr = "_contentRootDropping_mre9q_122", c = {
|
|
23
|
+
dragHandler: Z,
|
|
24
|
+
dragHandlerLoading: rr,
|
|
25
|
+
dragRow: tr,
|
|
26
|
+
dragRowDragging: or,
|
|
27
|
+
dragRowDropping: er,
|
|
28
|
+
dragRowDropIndicatorTop: nr,
|
|
29
|
+
dragRowDropIndicatorBottom: ar,
|
|
30
|
+
dragPreview: dr,
|
|
31
|
+
content: ir,
|
|
32
|
+
contentDragging: gr,
|
|
33
|
+
contentRootDropping: sr
|
|
34
|
+
};
|
|
35
|
+
function cr() {
|
|
36
|
+
const r = L(), t = O(), { useDropLoadingStore: n } = r.getPlugin("dragDrop"), o = n((i) => !!i.loading[t.id]);
|
|
37
|
+
return /* @__PURE__ */ D(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
className: C(c.dragHandler, o && c.dragHandlerLoading),
|
|
41
|
+
[N]: "",
|
|
42
|
+
"data-drag-handle": "",
|
|
43
|
+
"aria-label": H.dragDrop.dragHandle,
|
|
44
|
+
children: o ? /* @__PURE__ */ D(F, {}) : /* @__PURE__ */ D(B, {})
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
function pr(r) {
|
|
49
|
+
return typeof r == "string" || typeof r == "number";
|
|
50
|
+
}
|
|
51
|
+
function lr(r) {
|
|
52
|
+
return T(r) && pr(r.id) && T(r.item);
|
|
53
|
+
}
|
|
54
|
+
function v(r) {
|
|
55
|
+
return lr(r.record) ? r.record : void 0;
|
|
56
|
+
}
|
|
57
|
+
function mr({ children: r }) {
|
|
58
|
+
const t = S(null), n = P(), { useDragDropStore: o, handleDrop: i } = n.plugins.getPlugin("dragDrop"), p = o((a) => a.isDragging), l = o((a) => a.isRootDropTarget);
|
|
59
|
+
return G(() => {
|
|
60
|
+
if (t.current)
|
|
61
|
+
return h(
|
|
62
|
+
E({
|
|
63
|
+
element: t.current,
|
|
64
|
+
getData: () => ({ type: "data-grid-root" })
|
|
65
|
+
}),
|
|
66
|
+
V({
|
|
67
|
+
// A page can hold several grids with this plugin, and another grid's rows are drag
|
|
68
|
+
// sources too: only a drag that began in this plugin instance is this one's to track.
|
|
69
|
+
canMonitor: ({ source: a }) => a.data.pluginStore === o,
|
|
70
|
+
onDragStart: ({ source: a }) => {
|
|
71
|
+
const g = v(a.data);
|
|
72
|
+
g && o.setState({ isDragging: !0, draggedRecordId: g.id });
|
|
73
|
+
},
|
|
74
|
+
onDropTargetChange: ({ location: a }) => {
|
|
75
|
+
const g = a.current.dropTargets, e = g.find((w) => w.data.type === "data-grid-row"), s = g.find((w) => w.data.type === "data-grid-root"), m = e ? K(e.data) : null, f = e ? v(e.data) : void 0;
|
|
76
|
+
o.setState({
|
|
77
|
+
dropTargetRecordId: f == null ? void 0 : f.id,
|
|
78
|
+
dropEdge: m === "top" || m === "bottom" ? m : void 0,
|
|
79
|
+
isRootDropTarget: !e && !!s
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
onDrop: ({ source: a, location: g }) => {
|
|
83
|
+
const e = g.current.dropTargets, s = v(a.data);
|
|
84
|
+
if (e.length > 0 && s) {
|
|
85
|
+
const m = e.find((f) => f.data.type === "data-grid-row");
|
|
86
|
+
i(s, m ? v(m.data) : void 0);
|
|
87
|
+
}
|
|
88
|
+
o.setState({
|
|
89
|
+
isDragging: !1,
|
|
90
|
+
draggedRecordId: void 0,
|
|
91
|
+
dropTargetRecordId: void 0,
|
|
92
|
+
dropEdge: void 0,
|
|
93
|
+
isRootDropTarget: !1
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
);
|
|
98
|
+
}, [o, i]), /* @__PURE__ */ D(
|
|
99
|
+
"div",
|
|
100
|
+
{
|
|
101
|
+
ref: t,
|
|
102
|
+
className: C(
|
|
103
|
+
c.content,
|
|
104
|
+
p && c.contentDragging,
|
|
105
|
+
p && l && c.contentRootDropping
|
|
106
|
+
),
|
|
107
|
+
children: r
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
function ur(r, t) {
|
|
112
|
+
const n = document.createElement("table"), o = r.closest("table");
|
|
113
|
+
n.className = [o == null ? void 0 : o.className, t].filter(Boolean).join(" "), n.style.width = `${r.getBoundingClientRect().width}px`;
|
|
114
|
+
const i = document.createElement("tbody");
|
|
115
|
+
return i.appendChild(r.cloneNode(!0)), n.appendChild(i), n;
|
|
116
|
+
}
|
|
117
|
+
function Dr({
|
|
118
|
+
record: r
|
|
119
|
+
}) {
|
|
120
|
+
const t = S(null), n = X(r), [o, i] = U(null), p = P(), l = p.table, a = l.useVisibleColumns(), g = l.useTableLayout(), { useDragDropStore: e, renderDragPreview: s } = p.plugins.getPlugin("dragDrop"), m = e((d) => d.draggedRecordId === r.id), f = e((d) => d.dropTargetRecordId === r.id), w = e(
|
|
121
|
+
(d) => d.dropTargetRecordId === r.id ? d.dropEdge : void 0
|
|
122
|
+
), x = l.useComponent("body-cell-content");
|
|
123
|
+
return G(() => {
|
|
124
|
+
if (!t.current) return;
|
|
125
|
+
const d = t.current.querySelector("[data-drag-handle]");
|
|
126
|
+
return h(
|
|
127
|
+
A({
|
|
128
|
+
element: t.current,
|
|
129
|
+
dragHandle: d ?? void 0,
|
|
130
|
+
getInitialData: () => ({
|
|
131
|
+
type: "data-grid-row",
|
|
132
|
+
pluginStore: e,
|
|
133
|
+
recordId: n.current.id,
|
|
134
|
+
record: n.current
|
|
135
|
+
}),
|
|
136
|
+
onGenerateDragPreview: ({ nativeSetDragImage: u }) => {
|
|
137
|
+
k({
|
|
138
|
+
nativeSetDragImage: u,
|
|
139
|
+
getOffset: $({ x: "8px", y: "8px" }),
|
|
140
|
+
render: ({ container: R }) => {
|
|
141
|
+
if (s)
|
|
142
|
+
return z(() => i(R)), () => i(null);
|
|
143
|
+
const _ = t.current;
|
|
144
|
+
_ && R.appendChild(ur(_, c.dragPreview));
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}),
|
|
149
|
+
E({
|
|
150
|
+
element: t.current,
|
|
151
|
+
canDrop: ({ source: u }) => u.data.pluginStore === e && u.data.recordId !== n.current.id,
|
|
152
|
+
getData: ({ input: u, element: R }) => M(
|
|
153
|
+
{
|
|
154
|
+
type: "data-grid-row",
|
|
155
|
+
recordId: n.current.id,
|
|
156
|
+
record: n.current
|
|
157
|
+
},
|
|
158
|
+
{ input: u, element: R, allowedEdges: ["top", "bottom"] }
|
|
159
|
+
)
|
|
160
|
+
})
|
|
161
|
+
);
|
|
162
|
+
}, [r.id, e, s, n]), /* @__PURE__ */ y(j, { value: r, children: [
|
|
163
|
+
/* @__PURE__ */ y(
|
|
164
|
+
Y,
|
|
165
|
+
{
|
|
166
|
+
ref: t,
|
|
167
|
+
className: C(
|
|
168
|
+
c.dragRow,
|
|
169
|
+
m && c.dragRowDragging,
|
|
170
|
+
f && c.dragRowDropping,
|
|
171
|
+
w === "top" && c.dragRowDropIndicatorTop,
|
|
172
|
+
w === "bottom" && c.dragRowDropIndicatorBottom
|
|
173
|
+
),
|
|
174
|
+
children: [
|
|
175
|
+
/* @__PURE__ */ D(b, { position: "start" }),
|
|
176
|
+
a.map((d) => {
|
|
177
|
+
var _;
|
|
178
|
+
const u = (_ = d.getClassName) == null ? void 0 : _.call(d, r.item), R = Q(d, r.item, g);
|
|
179
|
+
return /* @__PURE__ */ D(
|
|
180
|
+
W,
|
|
181
|
+
{
|
|
182
|
+
columnId: d.id,
|
|
183
|
+
className: u,
|
|
184
|
+
...R,
|
|
185
|
+
children: /* @__PURE__ */ D(x, { column: d, item: r.item })
|
|
186
|
+
},
|
|
187
|
+
d.id
|
|
188
|
+
);
|
|
189
|
+
}),
|
|
190
|
+
/* @__PURE__ */ D(b, { position: "end" })
|
|
191
|
+
]
|
|
192
|
+
}
|
|
193
|
+
),
|
|
194
|
+
o && s ? J(s(r.item), o) : null
|
|
195
|
+
] });
|
|
196
|
+
}
|
|
197
|
+
function Or(r) {
|
|
198
|
+
return q(
|
|
199
|
+
"dragDrop",
|
|
200
|
+
(t) => {
|
|
201
|
+
const n = I(() => ({
|
|
202
|
+
isDragging: !1,
|
|
203
|
+
draggedRecordId: void 0,
|
|
204
|
+
dropTargetRecordId: void 0,
|
|
205
|
+
dropEdge: void 0,
|
|
206
|
+
isRootDropTarget: !1
|
|
207
|
+
})), o = I(() => ({
|
|
208
|
+
loading: {}
|
|
209
|
+
}));
|
|
210
|
+
return t.registerComponent("content", mr), t.registerExtraColumn({
|
|
211
|
+
id: "drag-drop",
|
|
212
|
+
body: cr,
|
|
213
|
+
position: "start",
|
|
214
|
+
order: 0,
|
|
215
|
+
width: "37px"
|
|
216
|
+
}), t.registerComponent("row", Dr), {
|
|
217
|
+
renderDragPreview: r.renderDragPreview,
|
|
218
|
+
useDragDropStore: n,
|
|
219
|
+
useDropLoadingStore: o,
|
|
220
|
+
setDropLoading: i,
|
|
221
|
+
clearDropLoading: p,
|
|
222
|
+
handleDrop: l
|
|
223
|
+
};
|
|
224
|
+
function i(a, g) {
|
|
225
|
+
o.setState((e) => ({ loading: { ...e.loading, [a]: g } }));
|
|
226
|
+
}
|
|
227
|
+
function p(a) {
|
|
228
|
+
o.setState((g) => {
|
|
229
|
+
const e = { ...g.loading };
|
|
230
|
+
return delete e[a], { loading: e };
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
function l(a, g) {
|
|
234
|
+
fr({
|
|
235
|
+
sourceRecord: a,
|
|
236
|
+
targetRecord: g,
|
|
237
|
+
onDrop: (e, s) => r.onDrop({ ...t, item: e, target: s }),
|
|
238
|
+
setDropLoading: i,
|
|
239
|
+
clearDropLoading: p
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
function fr({
|
|
246
|
+
sourceRecord: r,
|
|
247
|
+
targetRecord: t,
|
|
248
|
+
onDrop: n,
|
|
249
|
+
setDropLoading: o,
|
|
250
|
+
clearDropLoading: i
|
|
251
|
+
}) {
|
|
252
|
+
const p = (t == null ? void 0 : t.item) ?? null, l = n(r.item, p);
|
|
253
|
+
l instanceof Promise && (o(r.id, !0), l.catch(() => {
|
|
254
|
+
}).finally(() => {
|
|
255
|
+
i(r.id);
|
|
256
|
+
}));
|
|
257
|
+
}
|
|
258
|
+
export {
|
|
259
|
+
Or as createDataGridDragDropPlugin
|
|
260
|
+
};
|
|
261
|
+
//# sourceMappingURL=drag-drop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drag-drop.js","sources":["../../src/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-body-cell.tsx","../../src/components/data-grid/plugins/drag-drop/drag-data.ts","../../src/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-content.tsx","../../src/components/data-grid/plugins/drag-drop/drag-preview.ts","../../src/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-row.tsx","../../src/components/data-grid/plugins/drag-drop/drag-drop-plugin.tsx"],"sourcesContent":["import { cx } from 'class-variance-authority';\nimport { GripVerticalIcon } from 'lucide-react';\nimport { Spinner } from '../../../../spinner/public.js';\nimport { messages } from '../../../messages';\nimport { useDataGrid } from '../../../services/core/data-grid-context';\nimport { IGNORE_CLICK_ATTRIBUTE } from '../../../services/table/ignore-row-click';\nimport { useDataGridRecord } from '../../../services/table/data-grid-record-context';\nimport type { DataGridDragDropPluginApi } from '../drag-drop-types';\nimport styles from './data-grid-drag-drop.module.css';\n\nexport function DataGridDragDropBodyCell() {\n const grid = useDataGrid();\n const record = useDataGridRecord();\n\n const { useDropLoadingStore } = grid.getPlugin<DataGridDragDropPluginApi>('dragDrop')!;\n\n const isLoading = useDropLoadingStore((s) => !!s.loading[record.id]);\n\n return (\n <div\n className={cx(styles.dragHandler, isLoading && styles.dragHandlerLoading)}\n {...{ [IGNORE_CLICK_ATTRIBUTE]: '' }}\n data-drag-handle=\"\"\n aria-label={messages.dragDrop.dragHandle}\n >\n {isLoading ? <Spinner /> : <GripVerticalIcon />}\n </div>\n );\n}\n","import type { DataGridItemId, DataGridRecord } from '../../services/storage/storage-types';\nimport { isRecord } from '../../utils/is-record';\n\n// What a row puts in the drag data (`getInitialData`) and a drop target reads back is typed\n// `unknown` by the drag library, so each read goes through one of these guards instead of a cast.\n\nfunction isDataGridItemId(value: unknown): value is DataGridItemId {\n return typeof value === 'string' || typeof value === 'number';\n}\n\nfunction isDataGridRecord(value: unknown): value is DataGridRecord {\n return isRecord(value) && isDataGridItemId(value.id) && isRecord(value.item);\n}\n\n/** The record a dragged row or a row used as a drop target carries, or nothing for any other data. */\nexport function readRecord(data: Record<string | symbol, unknown>): DataGridRecord | undefined {\n return isDataGridRecord(data.record) ? data.record : undefined;\n}\n","import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n dropTargetForElements,\n monitorForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { cx } from 'class-variance-authority';\nimport type { ReactNode } from 'react';\nimport { useEffect, useRef } from 'react';\nimport { useDataGridContext } from '../../../services/core/data-grid-context';\nimport { readRecord } from '../drag-data';\nimport type { DataGridDragDropPluginApi } from '../drag-drop-types';\nimport styles from './data-grid-drag-drop.module.css';\n\ninterface DataGridDragDropContentProps {\n children?: ReactNode;\n}\n\nexport function DataGridDragDropContent({ children }: DataGridDragDropContentProps) {\n const contentRef = useRef<HTMLDivElement>(null);\n\n const context = useDataGridContext();\n const { useDragDropStore, handleDrop } =\n context.plugins.getPlugin<DataGridDragDropPluginApi>('dragDrop')!;\n\n const isDragging = useDragDropStore((s) => s.isDragging);\n const isRootDropTarget = useDragDropStore((s) => s.isRootDropTarget);\n\n useEffect(() => {\n if (!contentRef.current) return;\n\n return combine(\n dropTargetForElements({\n element: contentRef.current,\n getData: () => ({ type: 'data-grid-root' }),\n }),\n monitorForElements({\n // A page can hold several grids with this plugin, and another grid's rows are drag\n // sources too: only a drag that began in this plugin instance is this one's to track.\n canMonitor: ({ source }) => source.data.pluginStore === useDragDropStore,\n onDragStart: ({ source }) => {\n const record = readRecord(source.data);\n if (!record) return;\n\n useDragDropStore.setState({ isDragging: true, draggedRecordId: record.id });\n },\n onDropTargetChange: ({ location }) => {\n const targets = location.current.dropTargets;\n const rowTarget = targets.find((t) => t.data.type === 'data-grid-row');\n const rootTarget = targets.find((t) => t.data.type === 'data-grid-root');\n const dropEdge = rowTarget ? extractClosestEdge(rowTarget.data) : null;\n const targetRecord = rowTarget ? readRecord(rowTarget.data) : undefined;\n\n useDragDropStore.setState({\n dropTargetRecordId: targetRecord?.id,\n dropEdge: dropEdge === 'top' || dropEdge === 'bottom' ? dropEdge : undefined,\n isRootDropTarget: !rowTarget && !!rootTarget,\n });\n },\n onDrop: ({ source, location }) => {\n const targets = location.current.dropTargets;\n const sourceRecord = readRecord(source.data);\n\n if (targets.length > 0 && sourceRecord) {\n const rowTarget = targets.find((t) => t.data.type === 'data-grid-row');\n handleDrop(sourceRecord, rowTarget ? readRecord(rowTarget.data) : undefined);\n }\n\n useDragDropStore.setState({\n isDragging: false,\n draggedRecordId: undefined,\n dropTargetRecordId: undefined,\n dropEdge: undefined,\n isRootDropTarget: false,\n });\n },\n }),\n );\n }, [useDragDropStore, handleDrop]);\n\n return (\n <div\n ref={contentRef}\n className={cx(\n styles.content,\n isDragging && styles.contentDragging,\n isDragging && isRootDropTarget && styles.contentRootDropping,\n )}\n >\n {children}\n </div>\n );\n}\n","export function buildClonedRowPreview(row: HTMLElement, className: string): HTMLTableElement {\n const table = document.createElement('table');\n const sourceTable = row.closest('table');\n table.className = [sourceTable?.className, className].filter(Boolean).join(' ');\n table.style.width = `${row.getBoundingClientRect().width}px`;\n\n const tbody = document.createElement('tbody');\n tbody.appendChild(row.cloneNode(true));\n table.appendChild(tbody);\n\n return table;\n}\n","import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n draggable,\n dropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { attachClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { cx } from 'class-variance-authority';\nimport { useEffect, useRef, useState } from 'react';\nimport { createPortal, flushSync } from 'react-dom';\nimport { TableRow } from '../../../../table/public.js';\nimport type { DataGridItem } from '../../../data-grid-types';\nimport { useDataGridContext } from '../../../services/core/data-grid-context';\nimport type { DataGridRecord } from '../../../services/storage/storage-types';\nimport { DataGridCell } from '../../../services/table/components/data-grid-cell';\nimport { DataGridExtraBodyColumns } from '../../../services/table/components/data-grid-extra-body-columns';\nimport { DataGridRecordProvider } from '../../../services/table/data-grid-record-context';\nimport { resolveBodyCellProps } from '../../../services/table/resolve-body-cell-props';\nimport type { DataGridTableColumn } from '../../../services/table/table-types';\nimport { useLatest } from '../../../utils/use-latest';\nimport type { DataGridDragDropPluginApi } from '../drag-drop-types';\nimport { buildClonedRowPreview } from '../drag-preview';\nimport styles from './data-grid-drag-drop.module.css';\n\ninterface DataGridDragDropRowProps<TItem extends DataGridItem> {\n record: DataGridRecord<TItem>;\n}\n\nexport function DataGridDragDropRow<TItem extends DataGridItem>({\n record,\n}: DataGridDragDropRowProps<TItem>) {\n const rowRef = useRef<HTMLTableRowElement>(null);\n // The drag and drop callbacks are registered once per record id and read the record when the\n // event fires, so a refreshed record is what they see.\n const recordRef = useLatest(record);\n\n const [previewContainer, setPreviewContainer] = useState<HTMLElement | null>(null);\n\n const context = useDataGridContext<TItem>();\n const tableService = context.table;\n const columns = tableService.useVisibleColumns();\n const tableLayout = tableService.useTableLayout();\n\n const { useDragDropStore, renderDragPreview } =\n context.plugins.getPlugin<DataGridDragDropPluginApi<TItem>>('dragDrop')!;\n\n const isDragging = useDragDropStore((s) => s.draggedRecordId === record.id);\n const isDropping = useDragDropStore((s) => s.dropTargetRecordId === record.id);\n const dropEdge = useDragDropStore((s) =>\n s.dropTargetRecordId === record.id ? s.dropEdge : undefined,\n );\n\n const BodyCellContent = tableService.useComponent<{\n column: DataGridTableColumn<TItem>;\n item: TItem;\n }>('body-cell-content');\n\n useEffect(() => {\n if (!rowRef.current) return;\n\n const handleEl = rowRef.current.querySelector<HTMLElement>('[data-drag-handle]');\n\n return combine(\n draggable({\n element: rowRef.current,\n dragHandle: handleEl ?? undefined,\n getInitialData: () => ({\n type: 'data-grid-row',\n pluginStore: useDragDropStore,\n recordId: recordRef.current.id,\n record: recordRef.current,\n }),\n onGenerateDragPreview: ({ nativeSetDragImage }) => {\n setCustomNativeDragPreview({\n nativeSetDragImage,\n getOffset: pointerOutsideOfPreview({ x: '8px', y: '8px' }),\n render: ({ container }) => {\n if (renderDragPreview) {\n // Render the consumer's preview inside the live React tree (so it\n // keeps context); flushSync commits the portal before the browser\n // snapshots the preview image.\n flushSync(() => setPreviewContainer(container));\n return () => setPreviewContainer(null);\n }\n const row = rowRef.current;\n if (!row) return undefined;\n container.appendChild(buildClonedRowPreview(row, styles.dragPreview));\n return undefined;\n },\n });\n },\n }),\n dropTargetForElements({\n element: rowRef.current,\n canDrop: ({ source }) =>\n source.data.pluginStore === useDragDropStore &&\n source.data.recordId !== recordRef.current.id,\n getData: ({ input, element }) =>\n attachClosestEdge(\n {\n type: 'data-grid-row',\n recordId: recordRef.current.id,\n record: recordRef.current,\n },\n { input, element, allowedEdges: ['top', 'bottom'] },\n ),\n }),\n );\n }, [record.id, useDragDropStore, renderDragPreview, recordRef]);\n\n return (\n <DataGridRecordProvider value={record}>\n <TableRow\n ref={rowRef}\n className={cx(\n styles.dragRow,\n isDragging && styles.dragRowDragging,\n isDropping && styles.dragRowDropping,\n dropEdge === 'top' && styles.dragRowDropIndicatorTop,\n dropEdge === 'bottom' && styles.dragRowDropIndicatorBottom,\n )}\n >\n <DataGridExtraBodyColumns position=\"start\" />\n {columns.map((col) => {\n const dynamicClassName = col.getClassName?.(record.item);\n const bodyCellProps = resolveBodyCellProps(col, record.item, tableLayout);\n\n return (\n <DataGridCell<TItem>\n key={col.id}\n columnId={col.id}\n className={dynamicClassName}\n {...bodyCellProps}\n >\n <BodyCellContent column={col} item={record.item} />\n </DataGridCell>\n );\n })}\n <DataGridExtraBodyColumns position=\"end\" />\n </TableRow>\n {previewContainer && renderDragPreview\n ? createPortal(renderDragPreview(record.item), previewContainer)\n : null}\n </DataGridRecordProvider>\n );\n}\n","// Load-bearing: a plugin is rendered as a child of <DataGrid>, so a Server Component can import\n// and render it, and the component it returns calls hooks. This directive puts the banner on the\n// plugin's own entry chunk (dist/data-grid/<plugin>.js). client-boundaries.test.ts only scans a\n// component's top-level files, so scripts/verify-consumer.sh is what checks the built banner of\n// every plugin entry.\n'use client';\n\nimport { create } from 'zustand';\n// The `.js` on the type imports below is for the shipped declaration file: this file's\n// `createDataGridDragDropPlugin(config: DataGridDragDropPluginProps)` is a signature a consumer\n// types a callback by, and `moduleResolution: \"nodenext\"` rejects an extensionless relative\n// specifier in it, which turns the parameter into an untyped one.\nimport type { DataGridItem } from '../../data-grid-types.js';\nimport { createDataGridPlugin } from '../../services/plugins/plugins-helpers';\nimport type { DataGridItemId, DataGridRecord } from '../../services/storage/storage-types.js';\nimport { DataGridDragDropBodyCell } from './components/data-grid-drag-drop-body-cell';\nimport { DataGridDragDropContent } from './components/data-grid-drag-drop-content';\nimport { DataGridDragDropRow } from './components/data-grid-drag-drop-row';\nimport type {\n DataGridDragDropPluginApi,\n DataGridDragDropPluginProps,\n DataGridDragDropState,\n DataGridDropLoadingState,\n} from './drag-drop-types.js';\n\n/**\n * Creates a drag-and-drop plugin component for reordering a DataGrid's rows. It is a factory\n * because the callbacks are the plugin's own configuration, not props of the component it\n * returns: create it once, outside render, and render the result as a child of the grid.\n */\nexport function createDataGridDragDropPlugin<TItem extends DataGridItem = DataGridItem>(\n config: DataGridDragDropPluginProps<TItem>,\n) {\n return createDataGridPlugin<TItem, 'dragDrop', Record<string, never>, DataGridDragDropPluginApi<TItem>>(\n 'dragDrop',\n (context) => {\n const useDragDropStore = create<DataGridDragDropState>(() => ({\n isDragging: false,\n draggedRecordId: undefined,\n dropTargetRecordId: undefined,\n dropEdge: undefined,\n isRootDropTarget: false,\n }));\n\n const useDropLoadingStore = create<DataGridDropLoadingState>(() => ({\n loading: {},\n }));\n\n context.registerComponent('content', DataGridDragDropContent);\n context.registerExtraColumn({\n id: 'drag-drop',\n body: DataGridDragDropBodyCell,\n position: 'start',\n order: 0,\n width: '37px',\n });\n context.registerComponent('row', DataGridDragDropRow);\n\n return {\n renderDragPreview: config.renderDragPreview,\n useDragDropStore,\n useDropLoadingStore,\n setDropLoading,\n clearDropLoading,\n handleDrop,\n };\n\n function setDropLoading(id: DataGridItemId, value: boolean) {\n useDropLoadingStore.setState((state) => ({ loading: { ...state.loading, [id]: value } }));\n }\n\n function clearDropLoading(id: DataGridItemId) {\n useDropLoadingStore.setState((state) => {\n const next = { ...state.loading };\n delete next[id];\n return { loading: next };\n });\n }\n\n function handleDrop(\n sourceRecord: DataGridRecord<TItem>,\n targetRecord: DataGridRecord<TItem> | undefined,\n ) {\n executeHandleDrop({\n sourceRecord,\n targetRecord,\n onDrop: (item, target) => config.onDrop({ ...context, item, target }),\n setDropLoading,\n clearDropLoading,\n });\n }\n },\n );\n}\n\n/** @internal Extracted for testability. */\nexport function executeHandleDrop<TItem extends DataGridItem>({\n sourceRecord,\n targetRecord,\n onDrop,\n setDropLoading,\n clearDropLoading,\n}: {\n sourceRecord: Pick<DataGridRecord<TItem>, 'id' | 'item'>;\n targetRecord: Pick<DataGridRecord<TItem>, 'item'> | undefined;\n onDrop: (item: TItem, target: TItem | null) => void | Promise<void>;\n setDropLoading: (id: DataGridItemId, value: boolean) => void;\n clearDropLoading: (id: DataGridItemId) => void;\n}) {\n const target = targetRecord?.item ?? null;\n const drop = onDrop(sourceRecord.item, target);\n\n if (drop instanceof Promise) {\n setDropLoading(sourceRecord.id, true);\n drop\n .catch(() => {\n // Swallow rejection — cleanup happens in finally\n })\n .finally(() => {\n clearDropLoading(sourceRecord.id);\n });\n }\n}\n"],"names":["DataGridDragDropBodyCell","grid","useDataGrid","record","useDataGridRecord","useDropLoadingStore","isLoading","s","jsx","cx","styles","IGNORE_CLICK_ATTRIBUTE","messages","Spinner","GripVerticalIcon","isDataGridItemId","value","isDataGridRecord","isRecord","readRecord","data","DataGridDragDropContent","children","contentRef","useRef","context","useDataGridContext","useDragDropStore","handleDrop","isDragging","isRootDropTarget","useEffect","combine","dropTargetForElements","monitorForElements","source","location","targets","rowTarget","t","rootTarget","dropEdge","extractClosestEdge","targetRecord","sourceRecord","buildClonedRowPreview","row","className","table","sourceTable","tbody","DataGridDragDropRow","rowRef","recordRef","useLatest","previewContainer","setPreviewContainer","useState","tableService","columns","tableLayout","renderDragPreview","isDropping","BodyCellContent","handleEl","draggable","nativeSetDragImage","setCustomNativeDragPreview","pointerOutsideOfPreview","container","flushSync","input","element","attachClosestEdge","jsxs","DataGridRecordProvider","TableRow","DataGridExtraBodyColumns","col","dynamicClassName","_a","bodyCellProps","resolveBodyCellProps","DataGridCell","createPortal","createDataGridDragDropPlugin","config","createDataGridPlugin","create","setDropLoading","clearDropLoading","id","state","next","executeHandleDrop","item","target","onDrop","drop"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUO,SAASA,KAA2B;AACzC,QAAMC,IAAOC,EAAA,GACPC,IAASC,EAAA,GAET,EAAE,qBAAAC,EAAA,IAAwBJ,EAAK,UAAqC,UAAU,GAE9EK,IAAYD,EAAoB,CAACE,MAAM,CAAC,CAACA,EAAE,QAAQJ,EAAO,EAAE,CAAC;AAEnE,SACE,gBAAAK;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAGC,EAAO,aAAaJ,KAAaI,EAAO,kBAAkB;AAAA,MAClE,CAACC,CAAsB,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,QAAQ,MAAM;AACb,IAAAR,EAAiB9C,EAAa,EAAE;AAAA,EAClC,CAAC;AAEP;"}
|
|
@@ -13,12 +13,14 @@ import { Badge as de } from "../badge.js";
|
|
|
13
13
|
import { d as Ke } from "../chunks/debounce.js";
|
|
14
14
|
import { Popover as Nt, PopoverTrigger as wt, PopoverContent as At } from "../popover.js";
|
|
15
15
|
import { Drawer as xt, DrawerTrigger as Ft, DrawerContent as Dt } from "../drawer.js";
|
|
16
|
-
import { a as Lt
|
|
16
|
+
import { a as Lt } from "../chunks/table-types.js";
|
|
17
17
|
import { Input as Me } from "../input.js";
|
|
18
|
-
import { Spinner as
|
|
18
|
+
import { Spinner as kt } from "../spinner.js";
|
|
19
19
|
import { Label as Oe } from "../label.js";
|
|
20
|
-
import { Checkbox as
|
|
21
|
-
import {
|
|
20
|
+
import { Checkbox as Tt } from "../checkbox.js";
|
|
21
|
+
import { u as Pt } from "../chunks/use-latest.js";
|
|
22
|
+
import { DropdownMenu as Kt, DropdownMenuItem as ze } from "../dropdown-menu.js";
|
|
23
|
+
import { c as Mt } from "../chunks/hooked.js";
|
|
22
24
|
import { useShallow as U } from "zustand/react/shallow";
|
|
23
25
|
import { RadioGroup as Ot, RadioGroupItem as zt } from "../radio-group.js";
|
|
24
26
|
import { parse as $t, isValid as Rt, format as Gt, set as Vt, isBefore as Ht, startOfDay as ye } from "date-fns";
|
|
@@ -122,7 +124,7 @@ function sn() {
|
|
|
122
124
|
i.length === 0 && l && /* @__PURE__ */ s(Ie, {})
|
|
123
125
|
] });
|
|
124
126
|
}
|
|
125
|
-
const
|
|
127
|
+
const So = rt("filters", (e) => {
|
|
126
128
|
const t = z(() => ({
|
|
127
129
|
entities: [],
|
|
128
130
|
isAllFiltersOptionVisible: !0
|
|
@@ -325,7 +327,7 @@ function yn({ filterEntity: e }) {
|
|
|
325
327
|
}
|
|
326
328
|
return /* @__PURE__ */ s(X, { filterEntity: e, children: /* @__PURE__ */ s(Me, { value: o, onValueChange: a }) });
|
|
327
329
|
}
|
|
328
|
-
function
|
|
330
|
+
function vo(e) {
|
|
329
331
|
return {
|
|
330
332
|
id: e.id,
|
|
331
333
|
filterKey: e.filterKey ?? e.id,
|
|
@@ -340,7 +342,7 @@ function In({ filterEntity: e }) {
|
|
|
340
342
|
}
|
|
341
343
|
return /* @__PURE__ */ s(fe, { active: o, onClick: i, children: /* @__PURE__ */ s(pe, { filterEntity: e }) });
|
|
342
344
|
}
|
|
343
|
-
function
|
|
345
|
+
function Co(e) {
|
|
344
346
|
return {
|
|
345
347
|
id: e.id,
|
|
346
348
|
filterKey: e.filterKey ?? e.id,
|
|
@@ -472,7 +474,7 @@ function Ve({
|
|
|
472
474
|
}) {
|
|
473
475
|
return /* @__PURE__ */ s("ul", { className: Z.list, children: e.map((r) => /* @__PURE__ */ s("li", { className: Z.listItem, children: /* @__PURE__ */ w(Oe, { children: [
|
|
474
476
|
/* @__PURE__ */ s(
|
|
475
|
-
|
|
477
|
+
Tt,
|
|
476
478
|
{
|
|
477
479
|
checked: t.includes(r.value),
|
|
478
480
|
onCheckedChange: (o) => n($n(t, r.value, o))
|
|
@@ -507,7 +509,7 @@ function Gn({
|
|
|
507
509
|
), h = f && a.length === 0;
|
|
508
510
|
return /* @__PURE__ */ w(P, { children: [
|
|
509
511
|
/* @__PURE__ */ s(ne, { size: o, children: /* @__PURE__ */ s(re, { value: i, onValueChange: l }) }),
|
|
510
|
-
/* @__PURE__ */ s(oe, { children: h ? /* @__PURE__ */ s("div", { className: Z.status, children: /* @__PURE__ */ s(
|
|
512
|
+
/* @__PURE__ */ s(oe, { children: h ? /* @__PURE__ */ s("div", { className: Z.status, children: /* @__PURE__ */ s(kt, {}) }) : a.length > 0 ? /* @__PURE__ */ s(Ve, { options: a, value: n, onChange: r }) : /* @__PURE__ */ s("div", { className: Z.status, children: O.filters.noOptionsFound }) })
|
|
511
513
|
] });
|
|
512
514
|
}
|
|
513
515
|
function He({ filterEntity: e, ...t }) {
|
|
@@ -544,7 +546,7 @@ function Hn({ filterEntity: e }) {
|
|
|
544
546
|
}
|
|
545
547
|
) });
|
|
546
548
|
}
|
|
547
|
-
function
|
|
549
|
+
function yo(e) {
|
|
548
550
|
const { options: t } = e;
|
|
549
551
|
return {
|
|
550
552
|
id: e.id,
|
|
@@ -625,7 +627,7 @@ function Un({ filterEntity: e }) {
|
|
|
625
627
|
}
|
|
626
628
|
) });
|
|
627
629
|
}
|
|
628
|
-
function
|
|
630
|
+
function Io(e) {
|
|
629
631
|
return {
|
|
630
632
|
id: e.id,
|
|
631
633
|
filterKey: e.filterKey ?? e.id,
|
|
@@ -801,7 +803,7 @@ function ir() {
|
|
|
801
803
|
"aria-labelledby": e.ariaLabelledBy,
|
|
802
804
|
onKeyDown: n.handleKeyDown,
|
|
803
805
|
children: [
|
|
804
|
-
/* @__PURE__ */ s(
|
|
806
|
+
/* @__PURE__ */ s(Kt, { open: !0, modal: !1, children: r.length > 0 ? /* @__PURE__ */ s(We, { nodes: r }) : (
|
|
805
807
|
// eslint-disable-next-line react-hooks/static-components -- PlaceholderComponent comes from the tree's component registry (a store lookup), so it is the same component on every render; the rule cannot see through the lookup.
|
|
806
808
|
/* @__PURE__ */ s(o, { parent: null })
|
|
807
809
|
) }),
|
|
@@ -904,7 +906,7 @@ function ur(e) {
|
|
|
904
906
|
}
|
|
905
907
|
}
|
|
906
908
|
function dr() {
|
|
907
|
-
const e =
|
|
909
|
+
const e = Mt();
|
|
908
910
|
return {
|
|
909
911
|
hook: e.hook,
|
|
910
912
|
callHook: e.callHook,
|
|
@@ -1197,7 +1199,7 @@ function Dr({
|
|
|
1197
1199
|
children: n,
|
|
1198
1200
|
...r
|
|
1199
1201
|
}) {
|
|
1200
|
-
const o =
|
|
1202
|
+
const o = Pt(t), [i] = T(
|
|
1201
1203
|
() => Fr({
|
|
1202
1204
|
...r,
|
|
1203
1205
|
name: e,
|
|
@@ -1332,7 +1334,7 @@ function zr({ filterEntity: e }) {
|
|
|
1332
1334
|
}
|
|
1333
1335
|
return /* @__PURE__ */ s(X, { filterEntity: e, children: /* @__PURE__ */ s(Qe, { filterEntity: e, value: o, onChange: i, searchSize: "m" }) });
|
|
1334
1336
|
}
|
|
1335
|
-
function
|
|
1337
|
+
function bo(e) {
|
|
1336
1338
|
return {
|
|
1337
1339
|
id: e.id,
|
|
1338
1340
|
filterKey: e.filterKey ?? e.id,
|
|
@@ -1419,7 +1421,7 @@ function Hr({ filterEntity: e }) {
|
|
|
1419
1421
|
}
|
|
1420
1422
|
) });
|
|
1421
1423
|
}
|
|
1422
|
-
function
|
|
1424
|
+
function _o(e) {
|
|
1423
1425
|
return {
|
|
1424
1426
|
id: e.id,
|
|
1425
1427
|
filterKey: e.filterKey ?? e.id,
|
|
@@ -1615,19 +1617,19 @@ function Br(e) {
|
|
|
1615
1617
|
}
|
|
1616
1618
|
}
|
|
1617
1619
|
}
|
|
1618
|
-
function
|
|
1620
|
+
function No(e) {
|
|
1619
1621
|
const [t] = T(() => Br(e));
|
|
1620
1622
|
return t;
|
|
1621
1623
|
}
|
|
1622
1624
|
export {
|
|
1623
|
-
|
|
1625
|
+
So as DataGridFiltersPlugin,
|
|
1624
1626
|
Br as createDataGridTreeStructure,
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1627
|
+
yo as filterCheckboxGroup,
|
|
1628
|
+
_o as filterDateRange,
|
|
1629
|
+
vo as filterSearch,
|
|
1630
|
+
Io as filterTagGroup,
|
|
1631
|
+
Co as filterToggle,
|
|
1632
|
+
bo as filterTree,
|
|
1633
|
+
No as useDataGridTreeStructure
|
|
1632
1634
|
};
|
|
1633
1635
|
//# sourceMappingURL=filters.js.map
|