@gears-frontx/ui-kit 0.4.6 → 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/{data-grid.-6P4UQGJ.css → data-grid.DSkYrsay.css} +1 -1
- package/dist/chunks/drag-drop.BASVe3_O.css +1 -0
- package/dist/chunks/hooked.js +23 -31
- package/dist/chunks/hooked.js.map +1 -1
- package/dist/chunks/is-record.js +7 -0
- package/dist/chunks/is-record.js.map +1 -0
- package/dist/chunks/messages.js +12 -1
- 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 +80 -96
- package/dist/chunks/resolve-body-cell-props.js.map +1 -1
- package/dist/chunks/row-click-utils.js +12 -0
- package/dist/chunks/row-click-utils.js.map +1 -0
- package/dist/chunks/row-number.BxFT_3yP.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-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.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 +9 -0
- package/dist/components/data-grid/messages.d.ts.map +1 -1
- 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 +2 -0
- package/dist/components/data-grid/plugins/actions-menu/public.d.ts.map +1 -1
- 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/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/table/components/data-grid-table.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/data-grid/actions-menu.js +349 -33
- package/dist/data-grid/actions-menu.js.map +1 -1
- 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 +22 -21
- 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-click.js +35 -42
- package/dist/data-grid/row-click.js.map +1 -1
- package/dist/data-grid/row-number.js +6 -6
- 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 +508 -536
- package/dist/data-grid.js.map +1 -1
- package/dist/docs/data-grid.md +280 -7
- package/dist/docs/pagination.md +14 -0
- package/dist/docs/table.md +10 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +375 -370
- package/dist/index.js.map +1 -1
- package/dist/pagination.js +23 -23
- package/dist/pagination.js.map +1 -1
- package/dist/table.js +88 -88
- package/llms.txt +6 -3
- package/package.json +10 -1
- package/dist/chunks/pagination.CKDEuWt6.css +0 -1
- package/dist/chunks/resolve-body-cell-props.DGczzk1U.css +0 -1
- package/dist/chunks/row-number.C7fNu9Bw.css +0 -1
- package/dist/chunks/table.Dmz7LEk7.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions-menu.js","sources":["../../src/components/data-grid/plugins/actions-menu/components/data-grid-actions-menu.tsx","../../src/components/data-grid/plugins/actions-menu/actions-menu-plugin.tsx"],"sourcesContent":["import { EllipsisIcon } from 'lucide-react';\n\nimport { Button } from '../../../../button/public.js';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuTrigger,\n} from '../../../../dropdown-menu/public.js';\nimport { messages } from '../../../messages';\nimport { useDataGrid } from '../../../services/core/data-grid-context';\nimport type { DataGridActionsMenuPluginApi } from '../actions-menu-types';\n\nexport function DataGridActionsMenu() {\n const grid = useDataGrid();\n const actionsMenu = grid.getPlugin<DataGridActionsMenuPluginApi>('actionsMenu')!;\n const menuItems = actionsMenu.useMenuItems();\n\n return (\n <DropdownMenu>\n <DropdownMenuTrigger\n render={\n <Button\n variant=\"ghost\"\n size=\"sm\"\n icon={<EllipsisIcon />}\n aria-label={messages.actionsMenu.actions}\n />\n }\n />\n <DropdownMenuContent side=\"bottom\" align=\"end\">\n {menuItems.map((menuItem) => (\n <menuItem.component key={menuItem.id} params={menuItem.params} />\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\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';\nimport type { DataGridItem } from '../../data-grid-types';\nimport { createDataGridPlugin } from '../../services/plugins/plugins-helpers';\nimport type {\n DataGridActionsMenuItem,\n DataGridActionsMenuItemOption,\n DataGridActionsMenuPluginApi,\n DataGridActionsMenuPluginProps,\n} from './actions-menu-types';\nimport { DataGridActionsMenu } from './components/data-grid-actions-menu';\n\ninterface ActionsMenuStore {\n menuItems: DataGridActionsMenuItem[];\n}\n\nexport const DataGridActionsMenuPlugin = createDataGridPlugin<\n DataGridItem,\n 'actionsMenu',\n DataGridActionsMenuPluginProps,\n DataGridActionsMenuPluginApi\n>('actionsMenu', (context) => {\n const useStore = create<ActionsMenuStore>(() => ({\n menuItems: [],\n }));\n\n context.registerSlot('top-end', {\n id: 'actionsMenu',\n component: DataGridActionsMenu,\n order: 100,\n });\n\n const useMenuItems = () => useStore((s) => s.menuItems);\n\n const api: DataGridActionsMenuPluginApi = {\n registerMenuItem,\n useMenuItems,\n onPropsChange,\n };\n\n return api;\n\n function registerMenuItem(options: DataGridActionsMenuItemOption) {\n const id = Math.random().toString();\n const currentItems = useStore.getState().menuItems;\n const order = options.order ?? (currentItems.length + 1) * 10;\n const newMenuItem = { id, ...options, order };\n const updatedItems = [...currentItems, newMenuItem].sort((a, b) => a.order - b.order);\n useStore.setState({ menuItems: updatedItems });\n }\n\n function onPropsChange(props: DataGridActionsMenuPluginProps) {\n const items: DataGridActionsMenuItem[] = props.menuItems.map((options, index) => {\n const id = Math.random().toString();\n const order = options.order ?? (index + 1) * 10;\n return { id, ...options, order } satisfies DataGridActionsMenuItem;\n });\n items.sort((a, b) => a.order - b.order);\n useStore.setState({ menuItems: items });\n }\n});\n"],"names":["DataGridActionsMenu","menuItems","useDataGrid","DropdownMenu","jsx","DropdownMenuTrigger","Button","EllipsisIcon","messages","DropdownMenuContent","menuItem","DataGridActionsMenuPlugin","createDataGridPlugin","context","useStore","create","registerMenuItem","s","onPropsChange","options","id","currentItems","order","newMenuItem","updatedItems","a","b","props","items","index"],"mappings":";;;;;;;;AAYO,SAASA,IAAsB;AAGpC,QAAMC,IAFOC,EAAA,EACY,UAAwC,aAAa,EAChD,aAAA;AAE9B,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,QACE,gBAAAD;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,SAAQ;AAAA,YACR,MAAK;AAAA,YACL,wBAAOC,GAAA,EAAa;AAAA,Y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ACD,IAAAM,EAAM,KAAK,CAACH,GAAGC,MAAMD,EAAE,QAAQC,EAAE,KAAK,GACtCZ,EAAS,SAAS,EAAE,WAAWc,EAAA,CAAO;AAAA,EACxC;AACF,CAAC;"}
|
|
1
|
+
{"version":3,"file":"actions-menu.js","sources":["../../src/components/data-grid/plugins/actions-menu/components/data-grid-actions-menu.tsx","../../src/components/data-grid/plugins/actions-menu/actions-menu-plugin.tsx","../../src/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-cells.ts","../../src/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/formatters/csv-formatter.ts","../../src/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/formatters/excel-formatter.ts","../../src/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-service.ts","../../src/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/data-grid-export-menu-item.tsx","../../src/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-menu-items.ts"],"sourcesContent":["import { EllipsisIcon } from 'lucide-react';\n\nimport { Button } from '../../../../button/public.js';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuTrigger,\n} from '../../../../dropdown-menu/public.js';\nimport { messages } from '../../../messages';\nimport { useDataGrid } from '../../../services/core/data-grid-context';\nimport type { DataGridActionsMenuPluginApi } from '../actions-menu-types';\n\nexport function DataGridActionsMenu() {\n const grid = useDataGrid();\n const actionsMenu = grid.getPlugin<DataGridActionsMenuPluginApi>('actionsMenu')!;\n const menuItems = actionsMenu.useMenuItems();\n\n return (\n <DropdownMenu>\n <DropdownMenuTrigger\n render={\n <Button\n variant=\"ghost\"\n size=\"sm\"\n icon={<EllipsisIcon />}\n aria-label={messages.actionsMenu.actions}\n />\n }\n />\n <DropdownMenuContent side=\"bottom\" align=\"end\">\n {menuItems.map((menuItem) => (\n <menuItem.component key={menuItem.id} params={menuItem.params} />\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\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';\nimport type { DataGridItem } from '../../data-grid-types';\nimport { createDataGridPlugin } from '../../services/plugins/plugins-helpers';\nimport type {\n DataGridActionsMenuItem,\n DataGridActionsMenuItemOption,\n DataGridActionsMenuPluginApi,\n DataGridActionsMenuPluginProps,\n} from './actions-menu-types';\nimport { DataGridActionsMenu } from './components/data-grid-actions-menu';\n\ninterface ActionsMenuStore {\n menuItems: DataGridActionsMenuItem[];\n}\n\nexport const DataGridActionsMenuPlugin = createDataGridPlugin<\n DataGridItem,\n 'actionsMenu',\n DataGridActionsMenuPluginProps,\n DataGridActionsMenuPluginApi\n>('actionsMenu', (context) => {\n const useStore = create<ActionsMenuStore>(() => ({\n menuItems: [],\n }));\n\n context.registerSlot('top-end', {\n id: 'actionsMenu',\n component: DataGridActionsMenu,\n order: 100,\n });\n\n const useMenuItems = () => useStore((s) => s.menuItems);\n\n const api: DataGridActionsMenuPluginApi = {\n registerMenuItem,\n useMenuItems,\n onPropsChange,\n };\n\n return api;\n\n function registerMenuItem(options: DataGridActionsMenuItemOption) {\n const id = Math.random().toString();\n const currentItems = useStore.getState().menuItems;\n const order = options.order ?? (currentItems.length + 1) * 10;\n const newMenuItem = { id, ...options, order };\n const updatedItems = [...currentItems, newMenuItem].sort((a, b) => a.order - b.order);\n useStore.setState({ menuItems: updatedItems });\n }\n\n function onPropsChange(props: DataGridActionsMenuPluginProps) {\n const items: DataGridActionsMenuItem[] = props.menuItems.map((options, index) => {\n const id = Math.random().toString();\n const order = options.order ?? (index + 1) * 10;\n return { id, ...options, order } satisfies DataGridActionsMenuItem;\n });\n items.sort((a, b) => a.order - b.order);\n useStore.setState({ menuItems: items });\n }\n});\n","import type { DataGridItem } from '../../../../data-grid-types';\nimport type { DataGridPluginContext } from '../../../../services/plugins/plugins-types';\nimport type { DataGridExportColumn, DataGridExportOptions } from './export-types';\n\n// What a formatter does to one cell, apart from the service that uses the formatters: the service\n// imports them, so they cannot import it back.\n\nexport function getCellValue<Item extends DataGridItem = DataGridItem>(\n item: Item,\n column: DataGridExportColumn,\n): { raw: unknown; formatted: string } {\n const rawValue = column.key ? item[column.key] : item[column.id];\n\n let formattedValue: string;\n if (column.formatter) {\n formattedValue = column.formatter(rawValue);\n } else {\n formattedValue = String(rawValue ?? '');\n }\n\n return { raw: rawValue, formatted: formattedValue };\n}\n\nexport function applyCellTextTransformation<Item extends DataGridItem = DataGridItem>({\n item,\n column,\n cellValue,\n transformCellText,\n gridContext,\n}: {\n item: Item;\n column: DataGridExportColumn;\n cellValue: { raw: unknown; formatted: string };\n transformCellText: DataGridExportOptions<Item>['transformCellText'];\n gridContext: DataGridPluginContext<Item>;\n}): string {\n const transformer = transformCellText?.[column.id];\n\n if (!transformer) {\n return cellValue.formatted;\n }\n\n return transformer(\n {\n value: cellValue.raw,\n formattedValue: cellValue.formatted,\n row: item,\n },\n gridContext,\n );\n}\n","import type { DataGridItem } from '../../../../../data-grid-types';\nimport { applyCellTextTransformation, getCellValue } from '../export-cells';\nimport type { DataGridExportFormatter, DataGridExportFormatterParams } from '../export-types';\n\nexport const csvFormatter: DataGridExportFormatter = <Item extends DataGridItem>(\n exportContext: DataGridExportFormatterParams<Item>,\n): Promise<string> => {\n const { data, columns, options, gridContext } = exportContext;\n const delimiter = options.delimiter || ',';\n const includeHeaders = options.includeHeaders ?? true;\n const rows: string[] = [];\n\n if (includeHeaders) {\n const headerRow = columns\n .map((column) => escapeCsvValue(column.label, delimiter))\n .join(delimiter);\n rows.push(headerRow);\n }\n\n for (const item of data) {\n const row: string[] = [];\n\n for (const column of columns) {\n const cellValue = getCellValue(item, column);\n\n const transformedValue = applyCellTextTransformation({\n item,\n column,\n cellValue,\n transformCellText: options.transformCellText,\n gridContext,\n });\n\n row.push(escapeCsvValue(transformedValue, delimiter));\n }\n\n rows.push(row.join(delimiter));\n }\n\n return Promise.resolve(rows.join('\\n'));\n};\n\nconst csvInjectionChars = /^[=+\\-@\\t\\r]/;\n\nfunction escapeCsvValue(value: string, delimiter: string): string {\n const stringValue = String(value ?? '');\n\n const needsQuoting =\n stringValue.includes(delimiter) ||\n stringValue.includes('\\n') ||\n stringValue.includes('\"') ||\n csvInjectionChars.test(stringValue);\n\n if (needsQuoting) {\n const escaped = stringValue.replace(/\"/g, '\"\"');\n // Prefix with tab to prevent CSV injection (CWE-1236) when value starts with a formula character\n const prefix = csvInjectionChars.test(stringValue) ? '\\t' : '';\n return `\"${prefix}${escaped}\"`;\n }\n\n return stringValue;\n}\n","import type { DataGridItem } from '../../../../../data-grid-types';\nimport { applyCellTextTransformation, getCellValue } from '../export-cells';\nimport type {\n DataGridExcelJsApi,\n DataGridExcelJsModule,\n DataGridExportFormatter,\n DataGridExportFormatterParams,\n} from '../export-types';\n\nexport const excelFormatter: DataGridExportFormatter = async <Item extends DataGridItem>(\n exportContext: DataGridExportFormatterParams<Item>,\n): Promise<Blob> => {\n const { data, columns, options, gridContext } = exportContext;\n\n if (!options.loadExcelJs) {\n throw new Error(\n 'Exporting to Excel needs `loadExcelJs`, a function that loads the exceljs package: the grid does not import it itself.',\n );\n }\n const excelJs = resolveExcelJs(await options.loadExcelJs());\n\n const workbook = new excelJs.Workbook();\n const worksheet = workbook.addWorksheet(options.sheetName);\n\n const includeHeaders = options.includeHeaders ?? true;\n let currentRow = 1;\n\n if (includeHeaders) {\n const headerRow = worksheet.getRow(currentRow);\n\n columns.forEach((column, index) => {\n const cell = headerRow.getCell(index + 1);\n cell.value = column.label;\n });\n\n currentRow++;\n }\n\n for (const item of data) {\n const row = worksheet.getRow(currentRow);\n\n for (const [columnIndex, column] of columns.entries()) {\n const cellValue = getCellValue(item, column);\n\n const transformedValue = applyCellTextTransformation({\n item,\n column,\n cellValue,\n transformCellText: options.transformCellText,\n gridContext,\n });\n\n const cell = row.getCell(columnIndex + 1);\n\n cell.value = processExcelValue(cellValue.raw, transformedValue);\n }\n\n currentRow++;\n }\n\n const buffer = await workbook.xlsx.writeBuffer();\n return new Blob([buffer], {\n type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n });\n};\n\nfunction hasDefault(module: DataGridExcelJsModule): module is { default: DataGridExcelJsApi } {\n return 'default' in module && !!module.default;\n}\n\n// A CommonJS package imported dynamically arrives as the module itself under one bundler and as\n// `{ default: module }` under another, so the loader's result is read either way.\nfunction resolveExcelJs(module: DataGridExcelJsModule): DataGridExcelJsApi {\n const api = hasDefault(module) ? module.default : module;\n if (typeof api.Workbook !== 'function') {\n throw new Error('`loadExcelJs` has to resolve to the exceljs package, which exports `Workbook`.');\n }\n return api;\n}\n\nexport function processExcelValue(\n rawValue: unknown,\n transformedValue: string,\n): string | number | boolean | Date {\n if (transformedValue !== String(rawValue ?? '')) {\n return transformedValue;\n }\n\n if (rawValue === null || rawValue === undefined) {\n return '';\n }\n\n if (typeof rawValue === 'number') {\n return rawValue;\n }\n\n if (typeof rawValue === 'boolean') {\n return rawValue;\n }\n\n if (rawValue instanceof Date) {\n return rawValue;\n }\n\n if (typeof rawValue === 'string') {\n const dateRegex = /^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})?)?$/;\n if (dateRegex.test(rawValue)) {\n const date = new Date(rawValue);\n if (!isNaN(date.getTime())) {\n return date;\n }\n }\n\n const trimmed = rawValue.trim();\n if (\n trimmed !== '' &&\n !isNaN(Number(trimmed)) &&\n !/[eE]/.test(trimmed) &&\n !(trimmed.length > 1 && trimmed.startsWith('0') && trimmed[1] !== '.')\n ) {\n return Number(trimmed);\n }\n }\n\n return String(rawValue);\n}\n","import type { DataGridItem } from '../../../../data-grid-types';\nimport type { DataGridPluginContext } from '../../../../services/plugins/plugins-types';\nimport type {\n DataGridItemId,\n DataGridRecord,\n DataGridSection,\n} from '../../../../services/storage/storage-types';\nimport type { PaginationPluginApi } from '../../../pagination/pagination-plugin';\nimport type { DataGridTableTreePluginApi } from '../../../table-tree/table-tree-types';\nimport type {\n DataGridExportColumn,\n DataGridExportOptions,\n DataGridExportService,\n} from './export-types';\nimport { csvFormatter } from './formatters/csv-formatter';\nimport { excelFormatter } from './formatters/excel-formatter';\n\nexport function createExportService<\n Item extends DataGridItem = DataGridItem,\n>(): DataGridExportService<Item> {\n return {\n exportToCSV,\n exportToExcel,\n downloadFile,\n getAllData,\n };\n\n async function exportToCSV(\n data: Item[],\n columns: DataGridExportColumn[],\n options: DataGridExportOptions<Item>,\n gridContext: DataGridPluginContext<Item>,\n ): Promise<void> {\n const csvOptions = { ...options, format: 'csv' as const };\n try {\n const csvContent = await csvFormatter<Item>({\n data,\n columns,\n options: csvOptions,\n gridContext,\n });\n\n const filename = generateFilename(options.filename, 'csv');\n downloadFile(csvContent, filename, 'text/csv');\n } catch (error) {\n if (options.onError) {\n options.onError(toError(error));\n } else {\n throw error;\n }\n }\n }\n\n async function exportToExcel(\n data: Item[],\n columns: DataGridExportColumn[],\n options: DataGridExportOptions<Item>,\n gridContext: DataGridPluginContext<Item>,\n ): Promise<void> {\n const excelOptions = { ...options, format: 'xlsx' as const };\n try {\n const excelBlob = await excelFormatter<Item>({\n data,\n columns,\n options: excelOptions,\n gridContext,\n });\n\n const filename = generateFilename(options.filename, 'xlsx');\n downloadFile(\n excelBlob,\n filename,\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n );\n } catch (error) {\n if (options.onError) {\n options.onError(toError(error));\n } else {\n throw error;\n }\n }\n }\n\n function downloadFile(content: string | Blob, filename: string, mimeType: string): void {\n const blob = content instanceof Blob ? content : new Blob([content], { type: mimeType });\n const url = URL.createObjectURL(blob);\n\n const link = document.createElement('a');\n link.href = url;\n link.download = filename;\n link.style.display = 'none';\n\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n\n URL.revokeObjectURL(url);\n }\n\n async function getAllData(gridContext: DataGridPluginContext<Item>): Promise<Item[]> {\n // The export reads the pagination and the tree plugin by name: with neither registered, what\n // is on screen is everything there is.\n const paginationPlugin = gridContext.getPlugin<PaginationPluginApi>('pagination');\n const treePlugin = gridContext.getPlugin<DataGridTableTreePluginApi<Item>>('tableTree');\n\n if (treePlugin && paginationPlugin) {\n return await getAllTreeDataWithPagination(gridContext, treePlugin, paginationPlugin);\n } else if (treePlugin) {\n return await getAllTreeData(gridContext, treePlugin);\n } else if (paginationPlugin) {\n return await getAllDataPageByPage(gridContext, paginationPlugin);\n }\n\n const records = gridContext.useStore.getState().visibleRecords;\n return records.map((record) => record.item);\n }\n\n async function getAllTreeData(\n gridContext: DataGridPluginContext<Item>,\n treePlugin: DataGridTableTreePluginApi<Item>,\n ): Promise<Item[]> {\n const allData: Item[] = [];\n const visitedIds = new Set<DataGridItemId>();\n const records = gridContext.useStore.getState().visibleRecords;\n\n await collectTreeDataFromRecords(gridContext, records, allData, visitedIds, treePlugin);\n return allData;\n }\n\n async function getAllTreeDataWithPagination(\n gridContext: DataGridPluginContext<Item>,\n treePlugin: DataGridTableTreePluginApi<Item>,\n paginationPlugin: PaginationPluginApi,\n ): Promise<Item[]> {\n const originalState = { page: paginationPlugin.getPage(), limit: paginationPlugin.getLimit() };\n const allData: Item[] = [];\n const visitedIds = new Set<DataGridItemId>();\n let currentPage = 1;\n let hasMorePages = true;\n\n while (hasMorePages) {\n const loadInstance = gridContext.triggerLoad({\n loadContext: {\n pagination: { ...originalState, page: currentPage },\n tree: { parentId: null },\n },\n store: false,\n });\n\n await loadInstance.promise;\n\n if (loadInstance.processResult) {\n const pageData = loadInstance.processResult.results;\n\n if (pageData.length === 0) {\n hasMorePages = false;\n } else {\n // A page is not stored, so it has no records of the grid's own; the tree is walked\n // over records made for it.\n const pageRecords = pageData.map((item, index) => ({\n id: gridContext.getItemId(item),\n item,\n index,\n section: rootSection<Item>(),\n }));\n\n await collectTreeDataFromRecords(\n gridContext,\n pageRecords,\n allData,\n visitedIds,\n treePlugin,\n );\n\n currentPage++;\n\n if (pageData.length < originalState.limit) {\n hasMorePages = false;\n }\n }\n } else {\n hasMorePages = false;\n }\n }\n\n return allData;\n }\n\n async function collectTreeDataFromRecords(\n gridContext: DataGridPluginContext<Item>,\n records: DataGridRecord<Item>[],\n allData: Item[],\n visitedIds: Set<DataGridItemId>,\n treePlugin: DataGridTableTreePluginApi<Item>,\n ): Promise<void> {\n for (const record of records) {\n if (visitedIds.has(record.id)) {\n continue;\n }\n\n visitedIds.add(record.id);\n allData.push(record.item);\n\n const expandable = treePlugin.isExpandable(record);\n if (expandable) {\n // Load children if not already loaded\n const loadedSections = gridContext.getSectionsByParentId(record.id);\n if (!loadedSections.length) {\n const loadInstance = gridContext.triggerLoad({\n loadContext: { tree: { parentId: record.id } },\n });\n await loadInstance.promise;\n }\n\n const childRecords = gridContext.getRecordsByParentId(record.id);\n if (childRecords.length > 0) {\n await collectTreeDataFromRecords(\n gridContext,\n childRecords,\n allData,\n visitedIds,\n treePlugin,\n );\n }\n }\n }\n }\n\n async function getAllDataPageByPage(\n gridContext: DataGridPluginContext<Item>,\n paginationPlugin: PaginationPluginApi,\n ): Promise<Item[]> {\n const originalState = { page: paginationPlugin.getPage(), limit: paginationPlugin.getLimit() };\n\n const allData: Item[] = [];\n let currentPage = 1;\n let hasMorePages = true;\n\n while (hasMorePages) {\n const loadInstance = gridContext.triggerLoad({\n loadContext: {\n pagination: { ...originalState, page: currentPage },\n },\n store: false,\n });\n\n await loadInstance.promise;\n\n if (loadInstance.processResult) {\n const pageData = loadInstance.processResult.results;\n\n if (pageData.length === 0) {\n hasMorePages = false;\n } else {\n allData.push(...pageData);\n currentPage++;\n\n if (pageData.length < originalState.limit) {\n hasMorePages = false;\n }\n\n if (\n loadInstance.processResult.total &&\n allData.length >= loadInstance.processResult.total\n ) {\n hasMorePages = false;\n }\n }\n } else {\n hasMorePages = false;\n }\n }\n\n return allData;\n }\n}\n\nfunction rootSection<Item extends DataGridItem>(): DataGridSection<Item> {\n return { id: '', visible: true, loadContext: {}, parentId: null, records: [] };\n}\n\nfunction toError(error: unknown): Error {\n return error instanceof Error ? error : new Error(String(error));\n}\n\nexport function generateFilename(\n filename: string | (() => string) | undefined,\n extension: string,\n): string {\n if (typeof filename === 'function') {\n return filename();\n }\n\n if (typeof filename === 'string') {\n return filename.endsWith(`.${extension}`) ? filename : `${filename}.${extension}`;\n }\n\n const timestamp = new Date().toISOString().slice(0, 19).replace(/:/g, '-');\n return `${timestamp}.${extension}`;\n}\n","import { ArrowDownToLineIcon } from 'lucide-react';\nimport { useState } from 'react';\nimport { DropdownMenuItem } from '../../../../../dropdown-menu/public.js';\nimport { messages } from '../../../../messages';\nimport { useDataGridPluginContext } from '../../../../services/core/data-grid-context';\nimport { resolveLabel } from '../../../../services/table/table-helpers';\nimport { useTableService } from '../../../../services/table/table-context';\nimport { isRecord } from '../../../../utils/is-record';\nimport { createExportService } from './export-service';\nimport type {\n DataGridExportColumn,\n DataGridExportFormat,\n DataGridExportOptions,\n} from './export-types';\n\ninterface DataGridExportMenuItemParams {\n type: DataGridExportFormat;\n exportConfig?: Partial<DataGridExportOptions>;\n}\n\nexport interface DataGridExportMenuItemProps {\n params?: Record<string, unknown>;\n}\n\n// The menu hands every item `params` as a plain record, so the item reads its own back with these.\n// `exportConfig` is only known to be an object here: `exportMenuItems` is what typed it.\nfunction isExportFormat(value: unknown): value is DataGridExportFormat {\n return value === 'csv' || value === 'xlsx';\n}\n\nfunction isExportConfig(value: unknown): value is Partial<DataGridExportOptions> {\n return isRecord(value);\n}\n\nfunction readParams(params: Record<string, unknown> | undefined): DataGridExportMenuItemParams | undefined {\n if (!params || !isExportFormat(params.type)) return undefined;\n\n return {\n type: params.type,\n exportConfig: isExportConfig(params.exportConfig) ? params.exportConfig : undefined,\n };\n}\n\nexport function DataGridExportMenuItem({ params: rawParams }: DataGridExportMenuItemProps) {\n const params = readParams(rawParams);\n const pluginContext = useDataGridPluginContext();\n // useTableService is needed for useVisibleColumns which isn't exposed in the public API\n const tableService = useTableService();\n const [isExporting, setIsExporting] = useState(false);\n\n const visibleColumns = tableService.useVisibleColumns();\n const exportType = params?.type === 'csv' ? 'CSV' : 'Excel';\n\n async function handleSelect() {\n if (isExporting || !params) return;\n\n setIsExporting(true);\n\n try {\n const exportService = createExportService();\n\n const allData = await exportService.getAllData(pluginContext);\n\n const columns: DataGridExportColumn[] = visibleColumns.map((column) => {\n const label = resolveLabel(column.label);\n return {\n id: column.id,\n label,\n key: column.key,\n formatter: column.formatter,\n };\n });\n\n const defaultOptions: DataGridExportOptions = {\n format: params.type,\n filename: messages.exportMenuItem.defaultFilename,\n includeHeaders: true,\n ...(params.type === 'xlsx' ? { sheetName: messages.exportMenuItem.defaultSheetName } : {}),\n };\n\n const options: DataGridExportOptions = {\n ...defaultOptions,\n ...params.exportConfig,\n };\n\n const method =\n params.type === 'csv' ? exportService.exportToCSV : exportService.exportToExcel;\n\n await method(allData, columns, options, pluginContext);\n } catch (error) {\n console.error('Export failed:', error);\n } finally {\n setIsExporting(false);\n }\n }\n\n return (\n <DropdownMenuItem disabled={isExporting} onClick={handleSelect}>\n <ArrowDownToLineIcon />\n {messages.exportMenuItem.exportAs(exportType)}\n </DropdownMenuItem>\n );\n}\n","// `.js` on each relative import: they land verbatim in the shipped declaration file, where\n// `moduleResolution: \"nodenext\"` rejects an extensionless one and the type behind it goes untyped.\nimport type { DataGridItem } from '../../../../data-grid-types.js';\nimport type { DataGridActionsMenuItemOption } from '../../actions-menu-types.js';\nimport { DataGridExportMenuItem } from './data-grid-export-menu-item';\nimport type { DataGridExportOptions } from './export-types.js';\n\n/**\n * The items that export the grid's rows: Excel, when `loadExcelJs` is given, and CSV. Both read the\n * whole data set, not just the page on screen.\n */\nexport function exportMenuItems<Item extends DataGridItem = DataGridItem>(\n config?: Partial<DataGridExportOptions<Item>>,\n): DataGridActionsMenuItemOption[] {\n const csv: DataGridActionsMenuItemOption = {\n component: DataGridExportMenuItem,\n params: { type: 'csv', exportConfig: config },\n };\n\n // exceljs is the consumer's to load, so an Excel item with no way to load it would only fail.\n if (!config?.loadExcelJs) return [csv];\n\n return [{ component: DataGridExportMenuItem, params: { type: 'xlsx', exportConfig: config } }, csv];\n}\n"],"names":["DataGridActionsMenu","menuItems","useDataGrid","DropdownMenu","jsx","DropdownMenuTrigger","Button","EllipsisIcon","messages","DropdownMenuContent","menuItem","DataGridActionsMenuPlugin","createDataGridPlugin","context","useStore","create","registerMenuItem","s","onPropsChange","options","id","currentItems","order","newMenuItem","updatedItems","a","b","props","items","index","getCellValue","item","column","rawValue","formattedValue","applyCellTextTransformation","cellValue","transformCellText","gridContext","transformer","csvFormatter","exportContext","data","columns","delimiter","includeHeaders","rows","headerRow","escapeCsvValue","row","transformedValue","csvInjectionChars","value","stringValue","escaped","excelFormatter","excelJs","resolveExcelJs","workbook","worksheet","currentRow","cell","columnIndex","processExcelValue","buffer","hasDefault","module","api","date","trimmed","createExportService","exportToCSV","exportToExcel","downloadFile","getAllData","csvOptions","csvContent","filename","generateFilename","error","toError","excelOptions","excelBlob","content","mimeType","blob","url","link","paginationPlugin","treePlugin","getAllTreeDataWithPagination","getAllTreeData","getAllDataPageByPage","record","allData","visitedIds","records","collectTreeDataFromRecords","originalState","currentPage","hasMorePages","loadInstance","pageData","pageRecords","rootSection","childRecords","extension","isExportFormat","isExportConfig","isRecord","readParams","params","DataGridExportMenuItem","rawParams","pluginContext","useDataGridPluginContext","tableService","useTableService","isExporting","setIsExporting","useState","visibleColumns","exportType","handleSelect","exportService","label","resolveLabel","jsxs","DropdownMenuItem","ArrowDownToLineIcon","exportMenuItems","config","csv"],"mappings":";;;;;;;;;;;;AAYO,SAASA,IAAsB;AAGpC,QAAMC,IAFOC,EAAA,EACY,UAAwC,aAAa,EAChD,aAAA;AAE9B,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,QACE,gBAAAD;A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S,SAAS,EAAE,WAAWvG,EAAS,eAAe,qBAAqB,CAAA;AAAA,UAAC;AAAA,UAKxF,GAAGuG,EAAO;AAAA,QAAA;AAMZ,eAFEA,EAAO,SAAS,QAAQa,EAAc,cAAcA,EAAc,eAEvD9B,GAASnD,GAASxB,GAAS+F,CAAa;AAAA,MACvD,SAASnC,GAAO;AACd,gBAAQ,MAAM,kBAAkBA,CAAK;AAAA,MACvC,UAAA;AACE,QAAAwC,EAAe,EAAK;AAAA,MACtB;AAAA;AAAA,EACF;AAEA,SACE,gBAAAQ,EAACC,GAAA,EAAiB,UAAUV,GAAa,SAASK,GAChD,UAAA;AAAA,IAAA,gBAAAvH,EAAC6H,GAAA,EAAoB;AAAA,IACpBzH,EAAS,eAAe,SAASkH,CAAU;AAAA,EAAA,GAC9C;AAEJ;AC3FO,SAASQ,GACdC,GACiC;AACjC,QAAMC,IAAqC;AAAA,IACzC,WAAWpB;AAAA,IACX,QAAQ,EAAE,MAAM,OAAO,cAAcmB,EAAA;AAAA,EAAO;AAI9C,SAAKA,KAAA,QAAAA,EAAQ,cAEN,CAAC,EAAE,WAAWnB,GAAwB,QAAQ,EAAE,MAAM,QAAQ,cAAcmB,EAAA,EAAO,GAAKC,CAAG,IAFjE,CAACA,CAAG;AAGvC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../components/data-grid/plugins/drag-drop/public.js'
|
|
@@ -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,GAAG;AAAA,MAChC,oBAAiB;AAAA,MACjB,cAAYC,EAAS,SAAS;AAAA,MAE7B,UAAAN,IAAY,gBAAAE,EAACK,GAAA,CAAA,CAAQ,sBAAMC,GAAA,CAAA,CAAiB;AAAA,IAAA;AAAA,EAAA;AAGnD;ACtBA,SAASC,GAAiBC,GAAyC;AACjE,SAAO,OAAOA,KAAU,YAAY,OAAOA,KAAU;AACvD;AAEA,SAASC,GAAiBD,GA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eE,GAAoB3E,GAAgB;AAC1D,QAAAX,EAAoB,SAAS,CAACuF,OAAW,EAAE,SAAS,EAAE,GAAGA,EAAM,SAAS,CAACD,CAAE,GAAG3E,EAAA,IAAU;AAAA,MAC1F;AAEA,eAAS0E,EAAiBC,GAAoB;AAC5C,QAAAtF,EAAoB,SAAS,CAACuF,MAAU;AACtC,gBAAMC,IAAO,EAAE,GAAGD,EAAM,QAAA;AACxB,wBAAOC,EAAKF,CAAE,GACP,EAAE,SAASE,EAAA;AAAA,QACpB,CAAC;AAAA,MACH;AAEA,eAASjE,EACPgB,GACAD,GACA;AACA,QAAAmD,GAAkB;AAAA,UAChB,cAAAlD;AAAA,UACA,cAAAD;AAAA,UACA,QAAQ,CAACoD,GAAMC,MAAWV,EAAO,OAAO,EAAE,GAAG7D,GAAS,MAAAsE,GAAM,QAAAC,GAAQ;AAAA,UACpE,gBAAAP;AAAA,UACA,kBAAAC;AAAA,QAAA,CACD;AAAA,MACH;AAAA,IACF;AAAA,EAAA;AAEJ;AAGO,SAASI,GAA8C;AAAA,EAC5D,cAAAlD;AAAA,EACA,cAAAD;AAAA,EACA,QAAAsD;AAAA,EACA,gBAAAR;AAAA,EACA,kBAAAC;AACF,GAMG;AACD,QAAMM,KAASrD,KAAA,gBAAAA,EAAc,SAAQ,MAC/BuD,IAAOD,EAAOrD,EAAa,MAAMoD,CAAM;AAE7C,EAAIE,aAAgB,YAClBT,EAAe7C,EAAa,IAAI,EAAI,GACpCsD,EACG,MAAM,MAAM;AAAA,EAEb,CAAC,EACA,QAAQ,MAAM;AACb,IAAAR,EAAiB9C,EAAa,EAAE;AAAA,EAClC,CAAC;AAEP;"}
|
|
@@ -18,8 +18,9 @@ import { Input as Me } from "../input.js";
|
|
|
18
18
|
import { Spinner as kt } from "../spinner.js";
|
|
19
19
|
import { Label as Oe } from "../label.js";
|
|
20
20
|
import { Checkbox as Tt } from "../checkbox.js";
|
|
21
|
-
import {
|
|
22
|
-
import { DropdownMenu as
|
|
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";
|
|
23
24
|
import { useShallow as U } from "zustand/react/shallow";
|
|
24
25
|
import { RadioGroup as Ot, RadioGroupItem as zt } from "../radio-group.js";
|
|
25
26
|
import { parse as $t, isValid as Rt, format as Gt, set as Vt, isBefore as Ht, startOfDay as ye } from "date-fns";
|
|
@@ -123,7 +124,7 @@ function sn() {
|
|
|
123
124
|
i.length === 0 && l && /* @__PURE__ */ s(Ie, {})
|
|
124
125
|
] });
|
|
125
126
|
}
|
|
126
|
-
const
|
|
127
|
+
const So = rt("filters", (e) => {
|
|
127
128
|
const t = z(() => ({
|
|
128
129
|
entities: [],
|
|
129
130
|
isAllFiltersOptionVisible: !0
|
|
@@ -326,7 +327,7 @@ function yn({ filterEntity: e }) {
|
|
|
326
327
|
}
|
|
327
328
|
return /* @__PURE__ */ s(X, { filterEntity: e, children: /* @__PURE__ */ s(Me, { value: o, onValueChange: a }) });
|
|
328
329
|
}
|
|
329
|
-
function
|
|
330
|
+
function vo(e) {
|
|
330
331
|
return {
|
|
331
332
|
id: e.id,
|
|
332
333
|
filterKey: e.filterKey ?? e.id,
|
|
@@ -341,7 +342,7 @@ function In({ filterEntity: e }) {
|
|
|
341
342
|
}
|
|
342
343
|
return /* @__PURE__ */ s(fe, { active: o, onClick: i, children: /* @__PURE__ */ s(pe, { filterEntity: e }) });
|
|
343
344
|
}
|
|
344
|
-
function
|
|
345
|
+
function Co(e) {
|
|
345
346
|
return {
|
|
346
347
|
id: e.id,
|
|
347
348
|
filterKey: e.filterKey ?? e.id,
|
|
@@ -545,7 +546,7 @@ function Hn({ filterEntity: e }) {
|
|
|
545
546
|
}
|
|
546
547
|
) });
|
|
547
548
|
}
|
|
548
|
-
function
|
|
549
|
+
function yo(e) {
|
|
549
550
|
const { options: t } = e;
|
|
550
551
|
return {
|
|
551
552
|
id: e.id,
|
|
@@ -626,7 +627,7 @@ function Un({ filterEntity: e }) {
|
|
|
626
627
|
}
|
|
627
628
|
) });
|
|
628
629
|
}
|
|
629
|
-
function
|
|
630
|
+
function Io(e) {
|
|
630
631
|
return {
|
|
631
632
|
id: e.id,
|
|
632
633
|
filterKey: e.filterKey ?? e.id,
|
|
@@ -802,7 +803,7 @@ function ir() {
|
|
|
802
803
|
"aria-labelledby": e.ariaLabelledBy,
|
|
803
804
|
onKeyDown: n.handleKeyDown,
|
|
804
805
|
children: [
|
|
805
|
-
/* @__PURE__ */ s(
|
|
806
|
+
/* @__PURE__ */ s(Kt, { open: !0, modal: !1, children: r.length > 0 ? /* @__PURE__ */ s(We, { nodes: r }) : (
|
|
806
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.
|
|
807
808
|
/* @__PURE__ */ s(o, { parent: null })
|
|
808
809
|
) }),
|
|
@@ -905,7 +906,7 @@ function ur(e) {
|
|
|
905
906
|
}
|
|
906
907
|
}
|
|
907
908
|
function dr() {
|
|
908
|
-
const e =
|
|
909
|
+
const e = Mt();
|
|
909
910
|
return {
|
|
910
911
|
hook: e.hook,
|
|
911
912
|
callHook: e.callHook,
|
|
@@ -1198,7 +1199,7 @@ function Dr({
|
|
|
1198
1199
|
children: n,
|
|
1199
1200
|
...r
|
|
1200
1201
|
}) {
|
|
1201
|
-
const o =
|
|
1202
|
+
const o = Pt(t), [i] = T(
|
|
1202
1203
|
() => Fr({
|
|
1203
1204
|
...r,
|
|
1204
1205
|
name: e,
|
|
@@ -1333,7 +1334,7 @@ function zr({ filterEntity: e }) {
|
|
|
1333
1334
|
}
|
|
1334
1335
|
return /* @__PURE__ */ s(X, { filterEntity: e, children: /* @__PURE__ */ s(Qe, { filterEntity: e, value: o, onChange: i, searchSize: "m" }) });
|
|
1335
1336
|
}
|
|
1336
|
-
function
|
|
1337
|
+
function bo(e) {
|
|
1337
1338
|
return {
|
|
1338
1339
|
id: e.id,
|
|
1339
1340
|
filterKey: e.filterKey ?? e.id,
|
|
@@ -1420,7 +1421,7 @@ function Hr({ filterEntity: e }) {
|
|
|
1420
1421
|
}
|
|
1421
1422
|
) });
|
|
1422
1423
|
}
|
|
1423
|
-
function
|
|
1424
|
+
function _o(e) {
|
|
1424
1425
|
return {
|
|
1425
1426
|
id: e.id,
|
|
1426
1427
|
filterKey: e.filterKey ?? e.id,
|
|
@@ -1616,19 +1617,19 @@ function Br(e) {
|
|
|
1616
1617
|
}
|
|
1617
1618
|
}
|
|
1618
1619
|
}
|
|
1619
|
-
function
|
|
1620
|
+
function No(e) {
|
|
1620
1621
|
const [t] = T(() => Br(e));
|
|
1621
1622
|
return t;
|
|
1622
1623
|
}
|
|
1623
1624
|
export {
|
|
1624
|
-
|
|
1625
|
+
So as DataGridFiltersPlugin,
|
|
1625
1626
|
Br as createDataGridTreeStructure,
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
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
|
|
1633
1634
|
};
|
|
1634
1635
|
//# sourceMappingURL=filters.js.map
|