@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segment.js","sources":["../../src/components/data-grid/components/segment.tsx"],"sourcesContent":["import { ToggleGroup, type ToggleGroupProps } from '../../toggle-group/public.js';\n\nexport interface SegmentProps\n extends Omit<ToggleGroupProps, 'value' | 'defaultValue' | 'onValueChange' | 'multiple'> {\n /** The chosen item's value. Leave it out to let the group keep its own state. */\n value?: string;\n /** Called with the chosen value, or `undefined` when the chosen item is pressed again. */\n onValueChange?: (value: string | undefined) => void;\n}\n\n/**\n * A single-choice segmented control: `ToggleGroup` in its joined, outlined look, with its array\n * value narrowed to one. The grid reads and writes one value everywhere it uses a segmented\n * control (the page-size selector, the view switch), and an array that is\n * always zero or one long is a trap for each of those callers.\n */\nexport function Segment({ value, onValueChange, ...props }: SegmentProps) {\n return (\n <ToggleGroup\n spacing={0}\n variant=\"outline\"\n {...props}\n value={value === undefined ? undefined : [value]}\n onValueChange={(next) => onValueChange?.(next[0])}\n />\n );\n}\n"],"names":["Segment","value","onValueChange","props","jsx","ToggleGroup","next"],"mappings":"
|
|
1
|
+
{"version":3,"file":"segment.js","sources":["../../src/components/data-grid/services/core/data-grid-label-context.ts","../../src/components/data-grid/components/segment.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\n\n/*\n * The grid's accessible name, as passed to `DataGrid`'s `label` prop. The two components that\n * render landmarks read it: the table's scroll wrapper becomes a `region` named with the label,\n * and the pagination plugin's pager becomes a `nav` named \"<label> pagination\" (the wording lives\n * in `messages.pagination.ariaLabelFor`). A context rather than a grid store: the label is\n * render-time naming only -- nothing loads it, persists it, or writes it from a second place --\n * so carrying it from the component that owns the prop renames both landmarks on the very render\n * that changes it, with no effect and no store write in between.\n *\n * `undefined` is a value, not an absence of wiring: it is what a grid without a `label` provides,\n * and its consumers must then render exactly what they rendered before the prop existed (the pager\n * keeps its \"Pagination\" name, the table wrapper stays roleless). The context default is\n * `undefined` for the same reason.\n */\nconst DataGridLabelContext = createContext<string | undefined>(undefined);\n\nexport const DataGridLabelProvider = DataGridLabelContext.Provider;\n\n/**\n * The grid's `label` prop, or `undefined` when the grid has none or the prop is blank.\n */\nexport function useDataGridLabel(): string | undefined {\n return useContext(DataGridLabelContext);\n}\n","import { ToggleGroup, type ToggleGroupProps } from '../../toggle-group/public.js';\n\nexport interface SegmentProps\n extends Omit<ToggleGroupProps, 'value' | 'defaultValue' | 'onValueChange' | 'multiple'> {\n /** The chosen item's value. Leave it out to let the group keep its own state. */\n value?: string;\n /** Called with the chosen value, or `undefined` when the chosen item is pressed again. */\n onValueChange?: (value: string | undefined) => void;\n}\n\n/**\n * A single-choice segmented control: `ToggleGroup` in its joined, outlined look, with its array\n * value narrowed to one. The grid reads and writes one value everywhere it uses a segmented\n * control (the page-size selector, the view switch), and an array that is\n * always zero or one long is a trap for each of those callers.\n */\nexport function Segment({ value, onValueChange, ...props }: SegmentProps) {\n return (\n <ToggleGroup\n spacing={0}\n variant=\"outline\"\n {...props}\n value={value === undefined ? undefined : [value]}\n onValueChange={(next) => onValueChange?.(next[0])}\n />\n );\n}\n"],"names":["DataGridLabelContext","createContext","DataGridLabelProvider","useDataGridLabel","useContext","Segment","value","onValueChange","props","jsx","ToggleGroup","next"],"mappings":";;;AAgBA,MAAMA,IAAuBC,EAAkC,MAAS,GAE3DC,IAAwBF,EAAqB;AAKnD,SAASG,IAAuC;AACrD,SAAOC,EAAWJ,CAAoB;AACxC;ACTO,SAASK,EAAQ,EAAE,OAAAC,GAAO,eAAAC,GAAe,GAAGC,KAAuB;AACxE,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAS;AAAA,MACT,SAAQ;AAAA,MACP,GAAGF;AAAA,MACJ,OAAOF,MAAU,SAAY,SAAY,CAACA,CAAK;AAAA,MAC/C,eAAe,CAACK,MAASJ,KAAA,gBAAAA,EAAgBI,EAAK,CAAC;AAAA,IAAC;AAAA,EAAA;AAGtD;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as n, Fragment as t } from "react/jsx-runtime";
|
|
2
|
+
import { g as s, r as d } from "./table-helpers.js";
|
|
3
|
+
import { u as f } from "./table-context.js";
|
|
4
|
+
function g({
|
|
5
|
+
column: e,
|
|
6
|
+
item: r
|
|
7
|
+
}) {
|
|
8
|
+
if (e.render)
|
|
9
|
+
return typeof e.render == "function" ? /* @__PURE__ */ n(t, { children: e.render(r) }) : /* @__PURE__ */ n(t, { children: e.render });
|
|
10
|
+
if (e.component) {
|
|
11
|
+
const o = e.component, i = e.key ?? e.id, a = i.includes(".") ? s(r, i) : r[i];
|
|
12
|
+
return /* @__PURE__ */ n(o, { item: r, column: e, value: a });
|
|
13
|
+
}
|
|
14
|
+
return /* @__PURE__ */ n(t, { children: d(e, r) });
|
|
15
|
+
}
|
|
16
|
+
function l({
|
|
17
|
+
record: e
|
|
18
|
+
}) {
|
|
19
|
+
const o = f().useComponent("row");
|
|
20
|
+
return /* @__PURE__ */ n(o, { record: e });
|
|
21
|
+
}
|
|
22
|
+
function C({
|
|
23
|
+
records: e
|
|
24
|
+
}) {
|
|
25
|
+
return /* @__PURE__ */ n(t, { children: e.map((r) => /* @__PURE__ */ n(l, { record: r }, r.id)) });
|
|
26
|
+
}
|
|
27
|
+
function b(e, r) {
|
|
28
|
+
if (typeof r == "string") {
|
|
29
|
+
if (!(r in e))
|
|
30
|
+
throw new Error(`Key "${r}" not found in item ${JSON.stringify(e)}`);
|
|
31
|
+
return e[r];
|
|
32
|
+
}
|
|
33
|
+
return r(e);
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
C as D,
|
|
37
|
+
g as a,
|
|
38
|
+
b as g
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=storage-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-helpers.js","sources":["../../src/components/data-grid/services/table/components/data-grid-body-cell-content.tsx","../../src/components/data-grid/services/table/components/data-grid-table-record.tsx","../../src/components/data-grid/services/table/components/data-grid-table-records.tsx","../../src/components/data-grid/services/storage/storage-helpers.ts"],"sourcesContent":["import type { DataGridItem } from '../../../data-grid-types';\nimport { getNestedValue, resolveCellDisplayValue } from '../table-helpers';\nimport type { DataGridTableColumn } from '../table-types';\n\ninterface DataGridBodyCellContentProps<TItem extends DataGridItem> {\n column: DataGridTableColumn<TItem>;\n item: TItem;\n}\n\nexport function DataGridBodyCellContent<TItem extends DataGridItem>({\n column,\n item,\n}: DataGridBodyCellContentProps<TItem>) {\n // Column-specific render function takes priority\n if (column.render) {\n if (typeof column.render === 'function') {\n return <>{column.render(item)}</>;\n }\n return <>{column.render}</>;\n }\n\n // Column-specific component\n if (column.component) {\n const CellComponent = column.component;\n const key = column.key ?? column.id;\n const value = key.includes('.') ? getNestedValue(item, key) : item[key];\n return <CellComponent item={item} column={column} value={value} />;\n }\n\n // Default: resolve value from key (shared with the `title` fallback in DataGridRow)\n return <>{resolveCellDisplayValue(column, item)}</>;\n}\n","import type { DataGridItem } from '../../../data-grid-types';\nimport type { DataGridRecord } from '../../storage/storage-types';\nimport { useTableService } from '../table-context';\n\ninterface DataGridTableRecordProps<TItem extends DataGridItem> {\n record: DataGridRecord<TItem>;\n}\n\nexport function DataGridTableRecord<TItem extends DataGridItem>({\n record,\n}: DataGridTableRecordProps<TItem>) {\n const tableService = useTableService<TItem>();\n const RowComponent = tableService.useComponent<DataGridTableRecordProps<TItem>>('row');\n\n // eslint-disable-next-line react-hooks/static-components -- RowComponent comes from the grid's component registry (a store lookup), so it is the same component on every render; the rule cannot see through the lookup.\n return <RowComponent record={record} />;\n}\n","import type { DataGridItem } from '../../../data-grid-types';\nimport type { DataGridRecord } from '../../storage/storage-types';\nimport { DataGridTableRecord } from './data-grid-table-record';\n\ninterface DataGridTableRecordsProps<TItem extends DataGridItem> {\n records: DataGridRecord<TItem>[];\n}\n\nexport function DataGridTableRecords<TItem extends DataGridItem>({\n records,\n}: DataGridTableRecordsProps<TItem>) {\n return (\n <>\n {records.map((record) => (\n <DataGridTableRecord<TItem> key={record.id} record={record} />\n ))}\n </>\n );\n}\n","import type { DataGridItem } from '../../data-grid-types';\nimport type { DataGridDataKey, DataGridItemId } from './storage-types';\n\nexport function getItemKeyValue<TItem extends DataGridItem = DataGridItem>(\n item: TItem,\n key: DataGridDataKey<TItem>,\n) {\n if (typeof key === 'string') {\n if (!(key in item)) {\n throw new Error(`Key \"${key}\" not found in item ${JSON.stringify(item)}`);\n }\n return item[key] as DataGridItemId;\n }\n\n return key(item);\n}\n"],"names":["DataGridBodyCellContent","column","item","jsx","Fragment","CellComponent","key","value","getNestedValue","resolveCellDisplayValue","DataGridTableRecord","record","RowComponent","useTableService","DataGridTableRecords","records","getItemKeyValue"],"mappings":";;;AASO,SAASA,EAAoD;AAAA,EAClE,QAAAC;AAAA,EACA,MAAAC;AACF,GAAwC;AAEtC,MAAID,EAAO;AACT,WAAI,OAAOA,EAAO,UAAW,aACpB,gBAAAE,EAAAC,GAAA,EAAG,UAAAH,EAAO,OAAOC,CAAI,GAAE,IAEzB,gBAAAC,EAAAC,GAAA,EAAG,YAAO,OAAA,CAAO;AAI1B,MAAIH,EAAO,WAAW;AACpB,UAAMI,IAAgBJ,EAAO,WACvBK,IAAML,EAAO,OAAOA,EAAO,IAC3BM,IAAQD,EAAI,SAAS,GAAG,IAAIE,EAAeN,GAAMI,CAAG,IAAIJ,EAAKI,CAAG;AACtE,WAAO,gBAAAH,EAACE,GAAA,EAAc,MAAAH,GAAY,QAAAD,GAAgB,OAAAM,EAAA,CAAc;AAAA,EAClE;AAGA,SAAO,gBAAAJ,EAAAC,GAAA,EAAG,UAAAK,EAAwBR,GAAQC,CAAI,GAAE;AAClD;ACvBO,SAASQ,EAAgD;AAAA,EAC9D,QAAAC;AACF,GAAoC;AAElC,QAAMC,IADeC,EAAA,EACa,aAA8C,KAAK;AAGrF,SAAO,gBAAAV,EAACS,KAAa,QAAAD,GAAgB;AACvC;ACRO,SAASG,EAAiD;AAAA,EAC/D,SAAAC;AACF,GAAqC;AACnC,SACE,gBAAAZ,EAAAC,GAAA,EACG,UAAAW,EAAQ,IAAI,CAACJ,MACZ,gBAAAR,EAACO,GAAA,EAA2C,QAAAC,EAAA,GAAXA,EAAO,EAAoB,CAC7D,GACH;AAEJ;ACfO,SAASK,EACdd,GACAI,GACA;AACA,MAAI,OAAOA,KAAQ,UAAU;AAC3B,QAAI,EAAEA,KAAOJ;AACX,YAAM,IAAI,MAAM,QAAQI,CAAG,uBAAuB,KAAK,UAAUJ,CAAI,CAAC,EAAE;AAE1E,WAAOA,EAAKI,CAAG;AAAA,EACjB;AAEA,SAAOA,EAAIJ,CAAI;AACjB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._popup_i679w_8._popup_i679w_8{width:auto;max-inline-size:var(--available-width);max-block-size:var(--available-height)}._tableConfiguration_i679w_23{display:flex;flex-direction:column;min-block-size:0;min-inline-size:min(var(--data-grid-table-configuration-min-inline-size, 304px),calc(var(--available-width, 100vw) - var(--space-6)))}._header_i679w_33{flex:none;padding-block:var(--space-3);padding-inline:var(--space-4);border-block-end:var(--border-width) solid var(--border);color:var(--foreground);font-size:var(--text-body-size);font-weight:var(--text-heading-2-weight);line-height:var(--text-body-line-height)}._content_i679w_48{flex:1 1 auto;overflow:hidden auto;padding-block:var(--space-2);min-block-size:0;max-block-size:var(--data-grid-table-configuration-content-max-block-size, 500px)}._configurationItem_i679w_61._configurationItem_i679w_61{padding-block:var(--space-1)}._configurationItem_i679w_61{--_data-grid-table-configuration-pin-button-opacity: 0}._configurationItem_i679w_61:hover{--_data-grid-table-configuration-pin-button-opacity: 1;background-color:var(--accent);color:var(--accent-foreground)}._configurationItem_i679w_61:has(:focus-visible){--_data-grid-table-configuration-pin-button-opacity: 1}@supports not selector(:has(*)){._configurationItem_i679w_61:focus-within{--_data-grid-table-configuration-pin-button-opacity: 1}}._pinButton_i679w_92{display:flex;opacity:var(--_data-grid-table-configuration-pin-button-opacity, 0)}._pinButtonVisible_i679w_97{--_data-grid-table-configuration-pin-button-opacity: 1}._configurationItem_i679w_61:is(:hover,:focus) [role=switch][data-checked]{box-shadow:0 0 0 var(--border-width) var(--accent-foreground)}._configurationItem_i679w_61:is(:hover,:focus) ._pin_i679w_92:not(:hover):not([data-pressed]){color:inherit}._label_i679w_116{flex:1 1 auto;min-inline-size:0}._configurationItem_i679w_61._configurationItemNoSticky_i679w_122{padding-inline-start:calc(var(--space-2) + var(--control-height-sm) + var(--space-2))}._groupContent_i679w_126{padding-inline-start:var(--space-4)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-context.js","sources":["../../src/components/data-grid/services/table/table-context.ts"],"sourcesContent":["import type { DataGridItem } from '../../data-grid-types';\nimport { useDataGridContext } from '../core/data-grid-context';\nimport type { TableService } from './table-types';\n\nexport function useTableService<\n TItem extends DataGridItem = DataGridItem,\n>(): TableService<TItem> {\n return useDataGridContext<TItem>().table;\n}\n"],"names":["useTableService","useDataGridContext"],"mappings":";AAIO,SAASA,IAES;AACvB,SAAOC,IAA4B;AACrC;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
function o(e) {
|
|
2
|
+
return typeof e == "function" ? e() : e;
|
|
3
|
+
}
|
|
4
|
+
function i(e, n) {
|
|
5
|
+
return n.split(".").reduce((r, t) => {
|
|
6
|
+
if (r != null && typeof r == "object")
|
|
7
|
+
return r[t];
|
|
8
|
+
}, e);
|
|
9
|
+
}
|
|
10
|
+
function u(e, n) {
|
|
11
|
+
if (e.render || e.component) return;
|
|
12
|
+
const r = e.key ?? e.id, t = r.includes(".") ? i(n, r) : n[r];
|
|
13
|
+
return e.formatter ? e.formatter(t) : t != null ? String(t) : "";
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
o as a,
|
|
17
|
+
i as g,
|
|
18
|
+
u as r
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=table-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-helpers.js","sources":["../../src/components/data-grid/services/table/table-helpers.ts"],"sourcesContent":["import type { DataGridItem } from '../../data-grid-types';\nimport type { DataGridTableColumn } from './table-types';\n\nexport function resolveLabel(label: string | (() => string)): string {\n return typeof label === 'function' ? label() : label;\n}\n\nexport function getNestedValue(obj: Record<string, unknown>, path: string): unknown {\n return path.split('.').reduce<unknown>((acc, key) => {\n if (acc != null && typeof acc === 'object') {\n return (acc as Record<string, unknown>)[key];\n }\n return undefined;\n }, obj);\n}\n\n/**\n * Resolves a body cell's plain-string display value — the same value the default cell renderer\n * shows — or `undefined` when the column uses `component`/`render` (output the kit cannot safely\n * stringify, e.g. for an auto-set `title` fallback). Shared by `DataGridBodyCellContent` (the\n * renderer) and `resolveBodyCellProps` (the `title` fallback for `cellOverflow: 'nowrap'`) so the\n * two never drift on what counts as \"plain string\" content.\n */\nexport function resolveCellDisplayValue<TItem extends DataGridItem>(\n column: DataGridTableColumn<TItem>,\n item: TItem,\n): string | undefined {\n if (column.render || column.component) return undefined;\n\n const key = column.key ?? column.id;\n const rawValue = key.includes('.') ? getNestedValue(item, key) : item[key];\n\n if (column.formatter) return column.formatter(rawValue);\n\n return rawValue != null ? String(rawValue) : '';\n}\n"],"names":["resolveLabel","label","getNestedValue","obj","path","acc","key","resolveCellDisplayValue","column","item","rawValue"],"mappings":"AAGO,SAASA,EAAaC,GAAwC;AACnE,SAAO,OAAOA,KAAU,aAAaA,EAAA,IAAUA;AACjD;AAEO,SAASC,EAAeC,GAA8BC,GAAuB;AAClF,SAAOA,EAAK,MAAM,GAAG,EAAE,OAAgB,CAACC,GAAKC,MAAQ;AACnD,QAAID,KAAO,QAAQ,OAAOA,KAAQ;AAChC,aAAQA,EAAgCC,CAAG;AAAA,EAG/C,GAAGH,CAAG;AACR;AASO,SAASI,EACdC,GACAC,GACoB;AACpB,MAAID,EAAO,UAAUA,EAAO,UAAW;AAEvC,QAAMF,IAAME,EAAO,OAAOA,EAAO,IAC3BE,IAAWJ,EAAI,SAAS,GAAG,IAAIJ,EAAeO,GAAMH,CAAG,IAAIG,EAAKH,CAAG;AAEzE,SAAIE,EAAO,YAAkBA,EAAO,UAAUE,CAAQ,IAE/CA,KAAY,OAAO,OAAOA,CAAQ,IAAI;AAC/C;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._treeCellContent_p1inr_1{display:flex;align-items:center}._expand_p1inr_6{display:flex;align-items:center;flex-shrink:0;margin-inline-end:var(--space-1)}._expandIcon_p1inr_13{transition:transform var(--duration-micro) var(--ease-standard)}._expandIconCollapsed_p1inr_18{transform:rotate(-90deg)}._expandIconCollapsed_p1inr_18:dir(rtl){transform:rotate(90deg)}._label_p1inr_35{flex:1 1 auto;min-inline-size:0}[data-overflow=nowrap] ._label_p1inr_35{overflow:hidden;text-overflow:ellipsis}._indentSpacer_p1inr_50{--_data-grid-table-tree-indent: var(--space-6);flex-shrink:0}._expand_p1inr_6 ._toggle_p1inr_65{block-size:var(--text-meta-line-height);inline-size:var(--text-meta-line-height);border-radius:var(--radius-sm)}._expand_p1inr_6 ._toggle_p1inr_65:after{content:"";position:absolute;inset:calc(-1 * (var(--space-1) + var(--border-width)))}[data-overflow=nowrap]>span:has(>._treeCellContent_p1inr_1){overflow:clip;overflow-clip-margin:var(--space-1)}._expand_p1inr_6 ._toggle_p1inr_65:focus-visible{outline-offset:calc(var(--border-width-focus) * -1)}._clickableRow_p1inr_120{cursor:pointer}._clickableRow_p1inr_120:focus-visible{outline:none}:where(._clickableRow_p1inr_120:focus-visible)>td{position:relative}._clickableRow_p1inr_120:focus-visible>*:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-block:var(--border-width-focus) solid var(--ring);pointer-events:none}._clickableRow_p1inr_120:focus-visible>:first-child:after{border-inline-start:var(--border-width-focus) solid var(--ring)}._clickableRow_p1inr_120:focus-visible>:last-child:after{border-inline-end:var(--border-width-focus) solid var(--ring)}@media(forced-colors:active){._clickableRow_p1inr_120:focus-visible>*:after{border-color:Highlight}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-types.js","sources":["../../src/components/data-grid/services/table/table-types.ts"],"sourcesContent":["import type { ComponentType, ReactNode } from 'react';\nimport type { DataGridItem } from '../../data-grid-types';\n\nexport const TableLayouts = ['fixed', 'auto'] as const;\nexport type DataGridTableLayout = (typeof TableLayouts)[number];\n\nexport const TableColumnOverflows = ['wrap', 'nowrap'] as const;\nexport type DataGridTableColumnOverflow = (typeof TableColumnOverflows)[number];\n\nexport interface DataGridTableColumn<TItem extends DataGridItem = DataGridItem> {\n id: string;\n key?: string;\n label: string | (() => string);\n type?: 'string' | 'number' | 'date';\n /**\n * Column width. Under `tableLayout=\"fixed\"` (default) this is the column's shared track — a\n * proportional weight when every column has a `width`, an exact size when some columns are\n * widthless. Under `tableLayout=\"auto\"` it is a preferred size that also acts as a floor unless\n * `minWidth` is set. A `%` string maps to `inline-size`; any other value maps to `width` +\n * `min-inline-size`.\n *\n * `'min-content'` is a first-class value: it sizes the column to its own header content, in\n * both layout modes -- the literal CSS keyword isn't honored by either table-layout algorithm\n * as a sizing hint on its own, so `DataGridHeaderCell` measures the header cell's content and\n * applies the result as a pixel width instead (the column's size under `auto`, its shared track\n * under `fixed`). See `resolveColumnStyle`. For choosing a width strategy per column, see the\n * decision guide in `data-grid.md` (\"Choosing column widths\").\n */\n width?: number | 'min-content' | (string & {});\n /**\n * Minimum column width in px. Under `tableLayout=\"auto\"` this is an independent floor. Under\n * `tableLayout=\"fixed\"` the three width props collapse to a single track: a lone `minWidth`\n * (no `width`, no `maxWidth`) aliases to the track, while combining it with `width` triggers a\n * DEV-only console warning and `width` wins, since fixed layout cannot honor both.\n */\n minWidth?: number;\n /**\n * Maximum column width in px, enforced via a content-cap wrapper. Under `tableLayout=\"auto\"`\n * this is a real, independent cap. Under `tableLayout=\"fixed\"` the three width props collapse\n * to a single track: a lone `maxWidth` (no `width`, no `minWidth`) aliases to the track, while\n * combining it with `width` triggers a DEV-only console warning and `width` wins, since fixed\n * layout cannot honor both.\n */\n maxWidth?: number;\n visible?: boolean;\n sticky?: boolean;\n visibleToggleDisabled?: boolean;\n formatter?: (value: unknown) => string;\n /**\n * Header-only overflow handling. Default `'nowrap'` — the label stays on one line and clips\n * with an ellipsis (\"…\") on overflow, auto-setting `title` with the full label for the default\n * label renderer; when `headerComponent` is set the kit cannot supply that fallback and the\n * consumer is responsible for it. `'wrap'` lets the label wrap across lines instead.\n */\n headerOverflow?: DataGridTableColumnOverflow;\n /**\n * Body-cell overflow handling. Default `'wrap'`: the value wraps across lines. `'nowrap'` keeps the value on one line and clips it with an ellipsis (\"…\") on\n * overflow, auto-setting `title` with the formatted value for the default value renderer; when\n * `component` or `render` is set the kit cannot supply that fallback and the consumer is\n * responsible for it.\n */\n cellOverflow?: DataGridTableColumnOverflow;\n /**\n * @deprecated Use `headerOverflow: 'nowrap'` instead. Normalized to `headerOverflow` at\n * column ingestion and kept working for one release with a dev-only deprecation warning.\n */\n headerTruncate?: boolean;\n component?: ComponentType<{ item: TItem; column: DataGridTableColumn<TItem>; value: unknown }>;\n headerComponent?: ComponentType<{ column: DataGridTableColumn<TItem> }>;\n render?: ((item: TItem) => ReactNode) | ReactNode;\n getClassName?: (item: TItem) => string | undefined;\n groupId?: string;\n}\n\nexport interface DataGridTableGroup<TItem extends DataGridItem = DataGridItem> {\n id: string;\n label: string | (() => string);\n columns: DataGridTableColumn<TItem>[];\n component?: ComponentType<{ group: DataGridTableGroup<TItem> }>;\n visible?: boolean;\n sticky?: boolean;\n}\n\nexport function isTableGroup<TItem extends DataGridItem>(\n item: DataGridTableColumn<TItem> | DataGridTableGroup<TItem>,\n): item is DataGridTableGroup<TItem> {\n return 'columns' in item && Array.isArray(item.columns);\n}\n\nexport type TableSlotName = 'subheader' | 'footer' | 'header-cell-end';\n\nexport interface TableSlot {\n id: string;\n name: TableSlotName;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- what `registerTableSlot` takes: a `header-cell-end` slot gets the column, the others nothing\n component: ComponentType<any>;\n order: number;\n}\n\nexport interface TableSlotOption {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- the option `registerTableSlot` takes\n component: ComponentType<any>;\n order?: number;\n}\n\nexport interface TableSlotOptions {\n subheader: TableSlotOption;\n footer: TableSlotOption;\n 'header-cell-end': TableSlotOption;\n}\n\nexport type ExtraColumnPosition = 'start' | 'end';\n\nexport interface ExtraColumn {\n id: string;\n header?: ComponentType;\n body?: ComponentType;\n position: ExtraColumnPosition;\n order: number;\n /**\n * Any CSS length, applied as the column's width. A pinned `end` column's contribution to the\n * offsets of the columns pinned inside it is read from this only while the header has not been\n * measured yet, and only when the value is a plain px length -- anything else contributes `0`\n * until the measurement lands.\n */\n width?: string;\n /**\n * Pins the column to the table's inline-end edge, so it stays reachable while the rows scroll\n * sideways. Read only for `end` columns; a `start` extra column is not pinned by it, and is not\n * pinned by the table's own sticky columns either -- it only offsets them. Setting it on a\n * `start` column logs a DEV-only warning. Defaults to unpinned.\n */\n sticky?: boolean;\n /**\n * When `true`, the rendered header and body cells for this column carry\n * `data-grid-row-ignore-click`, so a plugin that reacts to row clicks can skip clicks\n * anywhere in the cell (including its padding, not just the inner content).\n */\n ignoreRowClick?: boolean;\n}\n\nexport type ExtraColumnOption = Partial<ExtraColumn>;\n\nexport type TableComponentName =\n | 'row'\n | 'header-cell'\n | 'header-cell-label'\n | 'header-group'\n | 'body-cell-content'\n | 'content';\n\n/**\n * How the registry stores a component registered under a `TableComponentName`. Each name takes its\n * own props, so the registry holds them as taking none it could name: every function component\n * (a `memo`, `forwardRef` or `lazy` one too) is assignable to `ComponentType<never>`, and\n * `useComponent` hands one back as the props its caller renders. A class component is not: its\n * instance carries its props (`this.props`), which `never` cannot hold. So this is the stored\n * form only; the public `registerComponent` still takes `ComponentType<any>` and asserts a class\n * component into it.\n */\nexport type RegisteredTableComponent = ComponentType<never>;\n\nexport interface TableHeaderCell<TItem extends DataGridItem = DataGridItem> {\n type: 'group' | 'column';\n item: DataGridTableGroup<TItem> | DataGridTableColumn<TItem>;\n component: RegisteredTableComponent;\n colspan?: number;\n rowspan?: number;\n}\n\nexport interface TableStore<TItem extends DataGridItem = DataGridItem> {\n columns: (DataGridTableColumn<TItem> | DataGridTableGroup<TItem>)[];\n flatColumns: DataGridTableColumn<TItem>[];\n columnVisibility: Map<string, boolean>;\n columnSticky: Map<string, boolean>;\n groupSticky: Map<string, boolean>;\n columnWidths: Map<string, number>;\n /**\n * Measured pixel width of `tableLayout=\"auto\"` columns with `width: 'min-content'` -- see\n * `table-min-content-width.ts`. Kept separate from `columnWidths` above: that one is read-only\n * telemetry off a cell's already-rendered width (for sticky-offset math) and never feeds back\n * into that cell's own size, so it never needs a dedup guard. This one directly drives the\n * column's own CSS width, so it must dedupe writes to avoid a measure -> apply -> relayout ->\n * re-measure loop.\n */\n minContentWidths: Map<string, number>;\n extraColumnsStart: ExtraColumn[];\n extraColumnsEnd: ExtraColumn[];\n slots: Map<TableSlotName, TableSlot[]>;\n components: Map<TableComponentName, RegisteredTableComponent>;\n tableLayout: DataGridTableLayout;\n /** Mirrors `DataGrid`'s `stickyHeader` prop; read by the header renderers. */\n stickyHeader: boolean;\n}\n\nexport interface ConfigurationColumn {\n id: string;\n label: string;\n visible: boolean;\n sticky: boolean;\n visibleToggleDisabled: boolean;\n}\n\nexport interface ConfigurationGroup {\n id: string;\n label: string;\n visible: boolean;\n sticky: boolean;\n columns: ConfigurationColumn[];\n}\n\nexport type ConfigurationEntry = ConfigurationColumn | ConfigurationGroup;\n\nexport function isConfigurationGroup(entry: ConfigurationEntry): entry is ConfigurationGroup {\n return 'columns' in entry && Array.isArray(entry.columns);\n}\n\nexport interface TablePublicApi<TItem extends DataGridItem = DataGridItem> {\n registerTableSlot: <T extends TableSlotName>(name: T, options: TableSlotOptions[T]) => void;\n registerExtraColumn: (options: ExtraColumnOption) => void;\n updateExtraColumnWidth: (columnId: string, width: string) => void;\n updateExtraColumnOrder: (columnId: string, order: number) => void;\n updateExtraColumnSticky: (columnId: string, sticky: boolean) => void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- `ComponentType<never>` would refuse a class component\n registerComponent: (name: TableComponentName, component: ComponentType<any>) => void;\n updateColumns: (columns: (DataGridTableColumn<TItem> | DataGridTableGroup<TItem>)[]) => void;\n updateColumnVisibility: (columnId: string, visible: boolean) => void;\n updateColumnSticky: (id: string, sticky: boolean) => void;\n updateTableLayout: (tableLayout: DataGridTableLayout) => void;\n updateStickyHeader: (stickyHeader: boolean) => void;\n}\n\nexport interface TableService<\n TItem extends DataGridItem = DataGridItem,\n> extends TablePublicApi<TItem> {\n registerSlot: <T extends TableSlotName>(name: T, options: TableSlotOptions[T]) => void;\n useSlots: <T extends TableSlotName>(name: T) => TableSlot[];\n\n useComponent: <TProps = unknown>(name: TableComponentName) => ComponentType<TProps>;\n\n useExtraColumns: (position: ExtraColumnPosition) => ExtraColumn[];\n\n initializeColumns: (columns: (DataGridTableColumn<TItem> | DataGridTableGroup<TItem>)[]) => {\n columns: (DataGridTableColumn<TItem> | DataGridTableGroup<TItem>)[];\n flatColumns: DataGridTableColumn<TItem>[];\n columnVisibility: Map<string, boolean>;\n };\n useVisibleColumns: () => DataGridTableColumn<TItem>[];\n\n initializeStickyState: (columns: (DataGridTableColumn<TItem> | DataGridTableGroup<TItem>)[]) => {\n columnSticky: Map<string, boolean>;\n groupSticky: Map<string, boolean>;\n };\n getOrderedColumnsWithSticky: (\n visibleColumns: DataGridTableColumn<TItem>[],\n columnSticky: Map<string, boolean>,\n ) => DataGridTableColumn<TItem>[];\n onResizeColumn: (columnId: string, width: number) => void;\n isColumnSticky: (columnId: string) => boolean;\n isGroupSticky: (groupId: string) => boolean;\n useColumnStickyOffset: (columnId: string) => number | undefined;\n useColumnEndStickyOffset: (columnId: string) => number | undefined;\n useGroupStickyOffset: (groupId: string) => number | undefined;\n\n useHasGroups: () => boolean;\n useFirstRowHeaderCells: () => TableHeaderCell<TItem>[];\n useSecondRowHeaderColumns: () => DataGridTableColumn<TItem>[];\n\n useConfigurationColumns: () => ConfigurationEntry[];\n useTableLayout: () => DataGridTableLayout;\n useStickyHeader: () => boolean;\n\n /**\n * Measured pixel width for a `tableLayout=\"auto\"` column with `width: 'min-content'` -- see\n * `table-min-content-width.ts` and `DataGridHeaderCell`'s measurement effect.\n */\n useMinContentWidth: (columnId: string) => number | undefined;\n setMinContentWidth: (columnId: string, width: number) => void;\n}\n"],"names":["isTableGroup","item","isConfigurationGroup","entry"],"mappings":"AAmFO,SAASA,EACdC,GACmC;AACnC,SAAO,aAAaA,KAAQ,MAAM,QAAQA,EAAK,OAAO;AACxD;AA8HO,SAASC,EAAqBC,GAAwD;AAC3F,SAAO,aAAaA,KAAS,MAAM,QAAQA,EAAM,OAAO;AAC1D;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._tableContainer_qh5zk_8{position:relative;width:100%;overflow:auto}._tableContainer_qh5zk_8:focus-visible{outline:var(--border-width-focus) solid var(--ring);outline-offset:2px}@media(forced-colors:active){._tableContainer_qh5zk_8:focus-visible{outline:2px solid Highlight;outline-offset:2px}}._table_qh5zk_8{width:100%;border-collapse:collapse;caption-side:bottom;font-size:var(--text-meta-size);line-height:var(--text-meta-line-height);font-weight:var(--text-meta-weight);letter-spacing:var(--text-meta-tracking)}._stickyHeader_qh5zk_79{border-collapse:separate;border-spacing:0}:where(._stickyHeader_qh5zk_79) ._tableHeader_qh5zk_91 ._tableHead_qh5zk_70{position:sticky;top:0;z-index:2;background-color:var(--table-header-fill, var(--card))}._tableRow_qh5zk_59{--_table-row-fill: transparent;background-color:var(--_table-row-fill);transition:color .15s ease,background-color .15s ease}._tableBody_qh5zk_147:last-child ._tableRow_qh5zk_59:last-child>*{border-bottom:0}._tableBody_qh5zk_147 ._tableRow_qh5zk_59:hover,._tableBody_qh5zk_147 ._tableRow_qh5zk_59:has([aria-expanded=true]){--_table-row-fill: var(--table-row-hover-fill, var(--card-hover))}._tableBody_qh5zk_147 ._tableRow_qh5zk_59[data-state=selected]{--_table-row-fill: var(--selection-subtle)}._tableBody_qh5zk_147 ._tableRow_qh5zk_59[data-state=stale]{--_table-row-fill: var(--warning-soft)}._tableBody_qh5zk_147 ._tableRow_qh5zk_59[data-state=restricted]{--_table-row-fill: var(--danger-soft)}._tableHead_qh5zk_70{box-sizing:border-box;position:relative;height:var(--control-height-md);padding:0 var(--space-4);border-bottom:var(--border-width) solid var(--border);text-align:start;vertical-align:middle;font-family:var(--font-mono);font-size:var(--text-mono-size);line-height:var(--text-mono-line-height);font-weight:var(--text-mono-weight);letter-spacing:var(--text-mono-tracking);text-transform:uppercase;white-space:nowrap;color:var(--subtle-foreground)}._tableHead_qh5zk_70:has([role=checkbox]){padding-inline-end:0}._columnResizer_qh5zk_285{position:absolute;top:0;bottom:0;z-index:1;padding:0;border:0;background:none;cursor:col-resize;touch-action:none;outline:none}._columnResizer_qh5zk_285:after{content:"";position:absolute;top:0;bottom:0;left:50%;width:var(--border-width);translate:-50% 0;background-color:var(--border);transition:width var(--duration-micro) var(--ease-standard),background-color var(--duration-micro) var(--ease-standard)}._columnResizer_qh5zk_285:hover:after,._columnResizer_qh5zk_285:focus-visible:after,._columnResizer_qh5zk_285:active:after{width:var(--border-width-focus);background-color:var(--primary)}@media(forced-colors:active){._columnResizer_qh5zk_285:focus-visible:after{background-color:Highlight}}._tableCell_qh5zk_127{box-sizing:border-box;padding:var(--space-3) var(--space-4);height:var(--control-height-lg);border-bottom:var(--border-width) solid var(--border);vertical-align:middle;white-space:nowrap}._tableCell_qh5zk_127:has([role=checkbox]){padding-inline-end:0}._pinned_qh5zk_403{position:sticky;z-index:1;background-color:var(--table-pinned-fill, var(--card));background-image:linear-gradient(var(--_table-row-fill, transparent),var(--_table-row-fill, transparent))}._tableHead_qh5zk_70._pinned_qh5zk_403{z-index:2}:where(._stickyHeader_qh5zk_79) ._tableHeader_qh5zk_91 ._tableHead_qh5zk_70._pinned_qh5zk_403{z-index:3}._variantCollection_qh5zk_94 ._tableHead_qh5zk_70._pinned_qh5zk_403{z-index:3}._variantCollection_qh5zk_94{table-layout:fixed;min-width:960px}._variantCollection_qh5zk_94 ._tableHead_qh5zk_70{position:sticky;top:0;z-index:2;height:var(--control-height-lg);padding:0 var(--space-3);background-color:var(--card);color:var(--muted-foreground);line-height:16px}._variantCollection_qh5zk_94 ._tableBody_qh5zk_147 ._tableRow_qh5zk_59{height:4rem}._variantCollection_qh5zk_94 ._tableCell_qh5zk_127{height:auto;padding:var(--space-3) var(--space-2);font-size:var(--text-meta-size);line-height:var(--text-meta-line-height);white-space:normal}._variantCollection_qh5zk_94 ._tableBody_qh5zk_147 ._tableRow_qh5zk_59:focus-visible{outline:none;box-shadow:inset 0 0 0 var(--border-width-focus) var(--primary)}._variantCollection_qh5zk_94 ._tableBody_qh5zk_147 ._tableRow_qh5zk_59:focus-visible>._pinned_qh5zk_403:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;border-block:var(--border-width-focus) solid var(--primary)}._variantCollection_qh5zk_94 ._tableBody_qh5zk_147 ._tableRow_qh5zk_59:focus-visible>._pinned_qh5zk_403:first-child:after{border-inline-start:var(--border-width-focus) solid var(--primary)}._variantCollection_qh5zk_94 ._tableBody_qh5zk_147 ._tableRow_qh5zk_59:focus-visible>._pinned_qh5zk_403:last-child:after{border-inline-end:var(--border-width-focus) solid var(--primary)}._variantCollection_qh5zk_94 ._tableBody_qh5zk_147 ._tableRow_qh5zk_59[tabindex]{cursor:pointer;transition:background-color var(--duration-micro) var(--ease-standard)}._variantCollection_qh5zk_94 ._tableBody_qh5zk_147 ._tableRow_qh5zk_59[data-pending]{--_table-row-fill: var(--muted);cursor:progress}._densityCompact_qh5zk_537 ._tableHead_qh5zk_70{height:var(--control-height-sm)}._densityCompact_qh5zk_537 ._tableCell_qh5zk_127{padding-block:var(--space-2);height:auto}._tableCaption_qh5zk_546{margin-top:var(--space-4);font-size:var(--text-body-size);line-height:var(--text-body-line-height);color:var(--muted-foreground)}._tableFooter_qh5zk_568{font-weight:var(--text-label-weight)}._tableFooter_qh5zk_568 ._tableRow_qh5zk_59{--_table-row-fill: var(--muted)}._tableFooter_qh5zk_568 ._tableRow_qh5zk_59:last-child>*{border-bottom:0}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-latest.js","sources":["../../src/components/data-grid/utils/use-latest.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\n/** A ref that always holds the value of the latest committed render. */\nexport function useLatest<T>(value: T) {\n const ref = useRef<T>(value);\n\n // Written in an effect, not during render: React does not recommend mutating a ref while\n // rendering. https://react.dev/reference/react/useRef#caveats\n useEffect(() => {\n ref.current = value;\n }, [value]);\n\n return ref;\n}\n"],"names":["useLatest","value","ref","useRef","useEffect"],"mappings":";AAGO,SAASA,EAAaC,GAAU;AACrC,QAAMC,IAAMC,EAAUF,CAAK;AAI3B,SAAAG,EAAU,MAAM;AACd,IAAAF,EAAI,UAAUD;AAAA,EAChB,GAAG,CAACA,CAAK,CAAC,GAEHC;AACT;"}
|
|
@@ -115,6 +115,15 @@ export interface DataGridProps<TItem extends DataGridItem> extends Pick<DataGrid
|
|
|
115
115
|
* ```
|
|
116
116
|
*/
|
|
117
117
|
implicitFilterKeys?: string[];
|
|
118
|
+
/**
|
|
119
|
+
* Accessible name for the grid's landmarks, for a page that renders more than one grid: the
|
|
120
|
+
* table's scroll wrapper becomes a `region` named with it, and the pagination plugin's pager
|
|
121
|
+
* becomes a `nav` named "<label> pagination", so the grids are told apart by name. Without it
|
|
122
|
+
* the pager is the one `nav` named "Pagination" and the wrapper stays roleless. Give every
|
|
123
|
+
* grid on such a page a distinct label; two grids sharing one still collide. A blank label
|
|
124
|
+
* reads as absent. It is a spoken name, not the storage key `name`, and it is never persisted.
|
|
125
|
+
*/
|
|
126
|
+
label?: string;
|
|
118
127
|
children?: ReactNode;
|
|
119
128
|
}
|
|
120
129
|
export interface InternalContext<TItem extends DataGridItem> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-grid-types.d.ts","sourceRoot":"","sources":["../../../src/components/data-grid/data-grid-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAA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|
|
|
1
1
|
import { DataGridItem, DataGridProps } from './data-grid-types';
|
|
2
|
-
export declare function DataGrid<TItem extends DataGridItem = DataGridItem>({ name, load, columns, children, persistent, persistentColumnVisibility, tableLayout, stickyHeader, loading, implicitFilterKeys, }: DataGridProps<TItem>): import("react").JSX.Element;
|
|
2
|
+
export declare function DataGrid<TItem extends DataGridItem = DataGridItem>({ name, load, columns, children, persistent, persistentColumnVisibility, tableLayout, stickyHeader, loading, implicitFilterKeys, label, }: DataGridProps<TItem>): import("react").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=data-grid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-grid.d.ts","sourceRoot":"","sources":["../../../src/components/data-grid/data-grid.tsx"],"names":[],"mappings":";AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"data-grid.d.ts","sourceRoot":"","sources":["../../../src/components/data-grid/data-grid.tsx"],"names":[],"mappings":";AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAQrE,wBAAgB,QAAQ,CAAC,KAAK,SAAS,YAAY,GAAG,YAAY,EAAE,EAClE,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,UAAU,EACV,0BAA0B,EAC1B,WAAqB,EACrB,YAAoB,EACpB,OAAe,EACf,kBAAkB,EAClB,KAAK,GACN,EAAE,aAAa,CAAC,KAAK,CAAC,+BAsDtB"}
|
|
@@ -27,8 +27,30 @@ export declare const messages: {
|
|
|
27
27
|
ascDate: string;
|
|
28
28
|
descDate: string;
|
|
29
29
|
};
|
|
30
|
+
actionsMenu: {
|
|
31
|
+
actions: string;
|
|
32
|
+
};
|
|
33
|
+
exportMenuItem: {
|
|
34
|
+
defaultFilename: string;
|
|
35
|
+
defaultSheetName: string;
|
|
36
|
+
exportAs: (type: string) => string;
|
|
37
|
+
};
|
|
38
|
+
tableConfiguration: {
|
|
39
|
+
header: string;
|
|
40
|
+
configureColumns: string;
|
|
41
|
+
pinColumn: string;
|
|
42
|
+
unpinColumn: string;
|
|
43
|
+
};
|
|
44
|
+
rowSelect: {
|
|
45
|
+
itemsSelected: (count: number) => string;
|
|
46
|
+
pageSelected: (count: number) => string;
|
|
47
|
+
selectAll: (count: number) => string;
|
|
48
|
+
allSelected: (count: number) => string;
|
|
49
|
+
clearSelection: string;
|
|
50
|
+
};
|
|
30
51
|
pagination: {
|
|
31
52
|
ariaLabel: string;
|
|
53
|
+
ariaLabelFor: (label: string) => string;
|
|
32
54
|
limitSelectorAriaLabel: string;
|
|
33
55
|
previousPage: string;
|
|
34
56
|
nextPage: string;
|
|
@@ -45,6 +67,9 @@ export declare const messages: {
|
|
|
45
67
|
close: string;
|
|
46
68
|
closeDialog: string;
|
|
47
69
|
};
|
|
70
|
+
dragDrop: {
|
|
71
|
+
dragHandle: string;
|
|
72
|
+
};
|
|
48
73
|
tree: {
|
|
49
74
|
noItems: string;
|
|
50
75
|
collapse: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/components/data-grid/messages.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;qCAqBY,MAAM
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/components/data-grid/messages.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;qCAqBY,MAAM;;;;;;;;;;;;;;yBAclB,MAAM;;;;;;;;;+BASA,MAAM;8BACP,MAAM;2BAET,MAAM;6BACJ,MAAM;;;;;8BAQL,MAAM;;;;yBAIX,MAAM;yBACN,MAAM,cAAc,MAAM,SAAS,MAAM;;;;;;;;;;;;;;;;;;;;CAqB7D,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DataGridActionsPluginApi, DataGridActionsPluginProps } from './actions-types';
|
|
2
|
+
export type { DataGridActionsPluginApi, DataGridActionsPluginProps };
|
|
3
|
+
export declare const DataGridActionsPlugin: import('react').NamedExoticComponent<DataGridActionsPluginProps>;
|
|
4
|
+
//# sourceMappingURL=actions-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions-plugin.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-grid/plugins/actions/actions-plugin.tsx"],"names":[],"mappings":";AAWA,OAAO,KAAK,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAG5F,YAAY,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,CAAC;AAOrE,eAAO,MAAM,qBAAqB,kEAiChC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { DataGridPluginApi } from '../../services/plugins/plugins-helpers';
|
|
3
|
+
export interface DataGridActionsPluginProps extends Record<string, unknown> {
|
|
4
|
+
component: ComponentType;
|
|
5
|
+
props?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
export interface DataGridActionsPluginApi extends DataGridPluginApi<DataGridActionsPluginProps> {
|
|
8
|
+
useComponent: () => ComponentType | null;
|
|
9
|
+
useProps: () => Record<string, unknown> | undefined;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=actions-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions-types.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-grid/plugins/actions/actions-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAEhF,MAAM,WAAW,0BAA2B,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACzE,SAAS,EAAE,aAAa,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB,CAAC,0BAA0B,CAAC;IAC7F,YAAY,EAAE,MAAM,aAAa,GAAG,IAAI,CAAC;IACzC,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;CACrD"}
|
package/dist/components/data-grid/plugins/actions/components/data-grid-actions-wrapper.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-grid-actions-wrapper.d.ts","sourceRoot":"","sources":["../../../../../../src/components/data-grid/plugins/actions/components/data-grid-actions-wrapper.tsx"],"names":[],"mappings":";AAIA,wBAAgB,sBAAsB,uCAiBrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-grid/plugins/actions/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions-menu-plugin.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-grid/plugins/actions-menu/actions-menu-plugin.tsx"],"names":[],"mappings":";AAUA,OAAO,KAAK,EAIV,8BAA8B,EAC/B,MAAM,sBAAsB,CAAC;AAO9B,eAAO,MAAM,yBAAyB,sEA4CpC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { DataGridPluginApi } from '../../services/plugins/plugins-helpers';
|
|
3
|
+
export interface DataGridActionsMenuItemOption<Params extends Record<string, unknown> = Record<string, unknown>> {
|
|
4
|
+
order?: number;
|
|
5
|
+
component: ComponentType<{
|
|
6
|
+
params?: Params;
|
|
7
|
+
}>;
|
|
8
|
+
params?: Params;
|
|
9
|
+
}
|
|
10
|
+
export interface DataGridActionsMenuItem {
|
|
11
|
+
id: string;
|
|
12
|
+
order: number;
|
|
13
|
+
component: ComponentType<{
|
|
14
|
+
params?: Record<string, unknown>;
|
|
15
|
+
}>;
|
|
16
|
+
params?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
export interface DataGridActionsMenuPluginApi extends DataGridPluginApi<DataGridActionsMenuPluginProps> {
|
|
19
|
+
registerMenuItem: (item: DataGridActionsMenuItemOption) => void;
|
|
20
|
+
useMenuItems: () => DataGridActionsMenuItem[];
|
|
21
|
+
}
|
|
22
|
+
export interface DataGridActionsMenuPluginProps extends Record<string, unknown> {
|
|
23
|
+
menuItems: DataGridActionsMenuItemOption[];
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=actions-menu-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions-menu-types.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-grid/plugins/actions-menu/actions-menu-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAEhF,MAAM,WAAW,6BAA6B,CAC5C,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAEhE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,aAAa,CAAC;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,aAAa,CAAC;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,4BAA6B,SAAQ,iBAAiB,CAAC,8BAA8B,CAAC;IACrG,gBAAgB,EAAE,CAAC,IAAI,EAAE,6BAA6B,KAAK,IAAI,CAAC;IAChE,YAAY,EAAE,MAAM,uBAAuB,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,8BAA+B,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC7E,SAAS,EAAE,6BAA6B,EAAE,CAAC;CAC5C"}
|
package/dist/components/data-grid/plugins/actions-menu/components/data-grid-actions-menu.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-grid-actions-menu.d.ts","sourceRoot":"","sources":["../../../../../../src/components/data-grid/plugins/actions-menu/components/data-grid-actions-menu.tsx"],"names":[],"mappings":";AAYA,wBAAgB,mBAAmB,gCAwBlC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface DataGridExportMenuItemProps {
|
|
3
|
+
params?: Record<string, unknown>;
|
|
4
|
+
}
|
|
5
|
+
export declare function DataGridExportMenuItem({ params: rawParams }: DataGridExportMenuItemProps): import("react").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=data-grid-export-menu-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-grid-export-menu-item.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/data-grid-export-menu-item.tsx"],"names":[],"mappings":";AAoBA,MAAM,WAAW,2BAA2B;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAqBD,wBAAgB,sBAAsB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,2BAA2B,+BA2DxF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DataGridItem } from '../../../../data-grid-types';
|
|
2
|
+
import { DataGridPluginContext } from '../../../../services/plugins/plugins-types';
|
|
3
|
+
import { DataGridExportColumn, DataGridExportOptions } from './export-types';
|
|
4
|
+
export declare function getCellValue<Item extends DataGridItem = DataGridItem>(item: Item, column: DataGridExportColumn): {
|
|
5
|
+
raw: unknown;
|
|
6
|
+
formatted: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function applyCellTextTransformation<Item extends DataGridItem = DataGridItem>({ item, column, cellValue, transformCellText, gridContext, }: {
|
|
9
|
+
item: Item;
|
|
10
|
+
column: DataGridExportColumn;
|
|
11
|
+
cellValue: {
|
|
12
|
+
raw: unknown;
|
|
13
|
+
formatted: string;
|
|
14
|
+
};
|
|
15
|
+
transformCellText: DataGridExportOptions<Item>['transformCellText'];
|
|
16
|
+
gridContext: DataGridPluginContext<Item>;
|
|
17
|
+
}): string;
|
|
18
|
+
//# sourceMappingURL=export-cells.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-cells.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-cells.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAKlF,wBAAgB,YAAY,CAAC,IAAI,SAAS,YAAY,GAAG,YAAY,EACnE,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,oBAAoB,GAC3B;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAWrC;AAED,wBAAgB,2BAA2B,CAAC,IAAI,SAAS,YAAY,GAAG,YAAY,EAAE,EACpF,IAAI,EACJ,MAAM,EACN,SAAS,EACT,iBAAiB,EACjB,WAAW,GACZ,EAAE;IACD,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,oBAAoB,CAAC;IAC7B,SAAS,EAAE;QAAE,GAAG,EAAE,OAAO,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C,iBAAiB,EAAE,qBAAqB,CAAC,IAAI,CAAC,CAAC,mBAAmB,CAAC,CAAC;IACpE,WAAW,EAAE,qBAAqB,CAAC,IAAI,CAAC,CAAC;CAC1C,GAAG,MAAM,CAeT"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DataGridItem } from '../../../../data-grid-types.js';
|
|
2
|
+
import { DataGridActionsMenuItemOption } from '../../actions-menu-types.js';
|
|
3
|
+
import { DataGridExportOptions } from './export-types.js';
|
|
4
|
+
/**
|
|
5
|
+
* The items that export the grid's rows: Excel, when `loadExcelJs` is given, and CSV. Both read the
|
|
6
|
+
* whole data set, not just the page on screen.
|
|
7
|
+
*/
|
|
8
|
+
export declare function exportMenuItems<Item extends DataGridItem = DataGridItem>(config?: Partial<DataGridExportOptions<Item>>): DataGridActionsMenuItemOption[];
|
|
9
|
+
//# sourceMappingURL=export-menu-items.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-menu-items.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-menu-items.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAEjF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/D;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,SAAS,YAAY,GAAG,YAAY,EACtE,MAAM,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,GAC5C,6BAA6B,EAAE,CAUjC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DataGridItem } from '../../../../data-grid-types';
|
|
2
|
+
import { DataGridExportService } from './export-types';
|
|
3
|
+
export declare function createExportService<Item extends DataGridItem = DataGridItem>(): DataGridExportService<Item>;
|
|
4
|
+
export declare function generateFilename(filename: string | (() => string) | undefined, extension: string): string;
|
|
5
|
+
//# sourceMappingURL=export-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-service.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAShE,OAAO,KAAK,EAGV,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AAIxB,wBAAgB,mBAAmB,CACjC,IAAI,SAAS,YAAY,GAAG,YAAY,KACrC,qBAAqB,CAAC,IAAI,CAAC,CAgQ/B;AAUD,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,GAAG,SAAS,EAC7C,SAAS,EAAE,MAAM,GAChB,MAAM,CAWR"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { DataGridItem } from '../../../../data-grid-types.js';
|
|
2
|
+
import { DataGridPluginContext } from '../../../../services/plugins/plugins-types.js';
|
|
3
|
+
export type DataGridExportFormat = 'csv' | 'xlsx';
|
|
4
|
+
export type DataGridExportCellTextTransformer<Item extends DataGridItem> = (cell: {
|
|
5
|
+
value: unknown;
|
|
6
|
+
formattedValue: string;
|
|
7
|
+
row: Item;
|
|
8
|
+
}, gridContext: DataGridPluginContext<Item>) => string;
|
|
9
|
+
export type DataGridExportTransformCellTextMap<Item extends DataGridItem> = Record<string, DataGridExportCellTextTransformer<Item>>;
|
|
10
|
+
/**
|
|
11
|
+
* The part of an exceljs cell the export writes. A cell's `value` takes more shapes than the
|
|
12
|
+
* export ever gives it, so it is `unknown` here, which an exceljs `Cell` satisfies.
|
|
13
|
+
*/
|
|
14
|
+
export interface DataGridExcelJsCell {
|
|
15
|
+
value: unknown;
|
|
16
|
+
}
|
|
17
|
+
export interface DataGridExcelJsRow {
|
|
18
|
+
getCell: (column: number) => DataGridExcelJsCell;
|
|
19
|
+
}
|
|
20
|
+
export interface DataGridExcelJsWorksheet {
|
|
21
|
+
getRow: (row: number) => DataGridExcelJsRow;
|
|
22
|
+
}
|
|
23
|
+
export interface DataGridExcelJsWorkbook {
|
|
24
|
+
addWorksheet: (name?: string) => DataGridExcelJsWorksheet;
|
|
25
|
+
xlsx: {
|
|
26
|
+
writeBuffer: () => Promise<ArrayBuffer>;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/** The part of the `exceljs` package the export uses: the `Workbook` class. */
|
|
30
|
+
export interface DataGridExcelJsApi {
|
|
31
|
+
Workbook: new () => DataGridExcelJsWorkbook;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* What `import('exceljs')` resolves to, spelled out here so that the kit's types never name
|
|
35
|
+
* `exceljs`, which a consumer that does not export to Excel does not have installed. Depending on
|
|
36
|
+
* the bundler the package arrives as the module itself or under `default`; both are accepted.
|
|
37
|
+
*/
|
|
38
|
+
export type DataGridExcelJsModule = DataGridExcelJsApi | {
|
|
39
|
+
default: DataGridExcelJsApi;
|
|
40
|
+
};
|
|
41
|
+
export interface DataGridExportOptions<Item extends DataGridItem = DataGridItem> {
|
|
42
|
+
format?: DataGridExportFormat;
|
|
43
|
+
filename?: string | (() => string);
|
|
44
|
+
transformCellText?: DataGridExportTransformCellTextMap<Item>;
|
|
45
|
+
onError?: (error: Error) => void;
|
|
46
|
+
includeHeaders?: boolean;
|
|
47
|
+
delimiter?: string;
|
|
48
|
+
encoding?: string;
|
|
49
|
+
sheetName?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Loads the `exceljs` package, which the kit does not import itself: a bundler resolves a
|
|
52
|
+
* dynamic import when it builds the kit's consumer, and a consumer without `exceljs` would fail
|
|
53
|
+
* to build. Pass `() => import('exceljs')`, with `exceljs` 4.4.0 installed. Without it
|
|
54
|
+
* `exportMenuItems` offers CSV only.
|
|
55
|
+
*/
|
|
56
|
+
loadExcelJs?: () => Promise<DataGridExcelJsModule>;
|
|
57
|
+
}
|
|
58
|
+
export interface DataGridExportColumn {
|
|
59
|
+
id: string;
|
|
60
|
+
label: string;
|
|
61
|
+
key?: string;
|
|
62
|
+
formatter?: (value: unknown) => string;
|
|
63
|
+
}
|
|
64
|
+
export interface DataGridExportService<Item extends DataGridItem> {
|
|
65
|
+
exportToCSV: (data: Item[], columns: DataGridExportColumn[], options: DataGridExportOptions<Item>, gridContext: DataGridPluginContext<Item>) => Promise<void>;
|
|
66
|
+
exportToExcel: (data: Item[], columns: DataGridExportColumn[], options: DataGridExportOptions<Item>, gridContext: DataGridPluginContext<Item>) => Promise<void>;
|
|
67
|
+
downloadFile: (content: string | Blob, filename: string, mimeType: string) => void;
|
|
68
|
+
getAllData: (gridContext: DataGridPluginContext<Item>) => Promise<Item[]>;
|
|
69
|
+
}
|
|
70
|
+
export interface DataGridExportFormatterParams<Item extends DataGridItem> {
|
|
71
|
+
data: Item[];
|
|
72
|
+
columns: DataGridExportColumn[];
|
|
73
|
+
options: DataGridExportOptions<Item>;
|
|
74
|
+
gridContext: DataGridPluginContext<Item>;
|
|
75
|
+
}
|
|
76
|
+
export type DataGridExportFormatter = <Item extends DataGridItem>(context: DataGridExportFormatterParams<Item>) => Promise<string | Blob>;
|
|
77
|
+
//# sourceMappingURL=export-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-types.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-types.ts"],"names":[],"mappings":"AAEA,OAAO,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,UAAU,EAAE,CAAC,WAAW,EAAE,qBAAqB,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;CAC3E;AAED,MAAM,WAAW,6BAA6B,CAAC,IAAI,SAAS,YAAY;IACtE,IAAI,EAAE,IAAI,EAAE,CAAC;IACb,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,OAAO,EAAE,qBAAqB,CAAC,IAAI,CAAC,CAAC;IACrC,WAAW,EAAE,qBAAqB,CAAC,IAAI,CAAC,CAAC;CAC1C;AAED,MAAM,MAAM,uBAAuB,GAAG,CAAC,IAAI,SAAS,YAAY,EAC9D,OAAO,EAAE,6BAA6B,CAAC,IAAI,CAAC,KACzC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"csv-formatter.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/formatters/csv-formatter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAiC,MAAM,iBAAiB,CAAC;AAE9F,eAAO,MAAM,YAAY,EAAE,uBAoC1B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DataGridExportFormatter } from '../export-types';
|
|
2
|
+
export declare const excelFormatter: DataGridExportFormatter;
|
|
3
|
+
export declare function processExcelValue(rawValue: unknown, transformedValue: string): string | number | boolean | Date;
|
|
4
|
+
//# sourceMappingURL=excel-formatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"excel-formatter.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/formatters/excel-formatter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,uBAAuB,EAExB,MAAM,iBAAiB,CAAC;AAEzB,eAAO,MAAM,cAAc,EAAE,uBAuD5B,CAAC;AAgBF,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,OAAO,EACjB,gBAAgB,EAAE,MAAM,GACvB,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CA0ClC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { DataGridActionsMenuPlugin } from './actions-menu-plugin.js';
|
|
2
|
+
export type { DataGridActionsMenuPluginProps, DataGridActionsMenuPluginApi, DataGridActionsMenuItemOption, } from './actions-menu-types.js';
|
|
3
|
+
export { exportMenuItems } from './menu-items/export-menu-items/export-menu-items.js';
|
|
4
|
+
export type { DataGridExcelJsModule, DataGridExportOptions, } from './menu-items/export-menu-items/export-types.js';
|
|
5
|
+
//# sourceMappingURL=public.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-grid/plugins/actions-menu/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,YAAY,EACV,8BAA8B,EAC9B,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AACtF,YAAY,EACV,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,gDAAgD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-grid-drag-drop-body-cell.d.ts","sourceRoot":"","sources":["../../../../../../src/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-body-cell.tsx"],"names":[],"mappings":";AAUA,wBAAgB,wBAAwB,gCAkBvC"}
|
package/dist/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-content.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface DataGridDragDropContentProps {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare function DataGridDragDropContent({ children }: DataGridDragDropContentProps): import("react").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=data-grid-drag-drop-content.d.ts.map
|