@gears-frontx/ui-kit 0.4.6 → 0.4.9

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.
Files changed (131) hide show
  1. package/dist/chunks/data-grid-portal-container-context.js +10 -0
  2. package/dist/chunks/data-grid-portal-container-context.js.map +1 -0
  3. package/dist/chunks/{data-grid.-6P4UQGJ.css → data-grid.DSkYrsay.css} +1 -1
  4. package/dist/chunks/drag-drop.BASVe3_O.css +1 -0
  5. package/dist/chunks/hooked.js +23 -31
  6. package/dist/chunks/hooked.js.map +1 -1
  7. package/dist/chunks/is-record.js +7 -0
  8. package/dist/chunks/is-record.js.map +1 -0
  9. package/dist/chunks/messages.js +12 -1
  10. package/dist/chunks/messages.js.map +1 -1
  11. package/dist/chunks/pagination.DJ7HJSFX.css +1 -0
  12. package/dist/chunks/resolve-body-cell-props.BA5IRWq0.css +1 -0
  13. package/dist/chunks/resolve-body-cell-props.js +80 -96
  14. package/dist/chunks/resolve-body-cell-props.js.map +1 -1
  15. package/dist/chunks/row-click-utils.js +12 -0
  16. package/dist/chunks/row-click-utils.js.map +1 -0
  17. package/dist/chunks/row-number.BxFT_3yP.css +1 -0
  18. package/dist/chunks/segment.js +16 -9
  19. package/dist/chunks/segment.js.map +1 -1
  20. package/dist/chunks/storage-helpers.js +40 -0
  21. package/dist/chunks/storage-helpers.js.map +1 -0
  22. package/dist/chunks/table-helpers.js +20 -0
  23. package/dist/chunks/table-helpers.js.map +1 -0
  24. package/dist/chunks/table-tree.DMtpMddS.css +1 -0
  25. package/dist/chunks/table.biUlW2U6.css +1 -0
  26. package/dist/chunks/use-latest.js +11 -0
  27. package/dist/chunks/use-latest.js.map +1 -0
  28. package/dist/components/data-grid/data-grid-types.d.ts +19 -0
  29. package/dist/components/data-grid/data-grid-types.d.ts.map +1 -1
  30. package/dist/components/data-grid/data-grid.d.ts +1 -1
  31. package/dist/components/data-grid/data-grid.d.ts.map +1 -1
  32. package/dist/components/data-grid/messages.d.ts +9 -0
  33. package/dist/components/data-grid/messages.d.ts.map +1 -1
  34. package/dist/components/data-grid/plugins/actions-menu/components/data-grid-actions-menu.d.ts.map +1 -1
  35. package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/data-grid-export-menu-item.d.ts +6 -0
  36. package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/data-grid-export-menu-item.d.ts.map +1 -0
  37. package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-cells.d.ts +18 -0
  38. package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-cells.d.ts.map +1 -0
  39. package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-menu-items.d.ts +9 -0
  40. package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-menu-items.d.ts.map +1 -0
  41. package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-service.d.ts +5 -0
  42. package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-service.d.ts.map +1 -0
  43. package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-types.d.ts +77 -0
  44. package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-types.d.ts.map +1 -0
  45. package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/formatters/csv-formatter.d.ts +3 -0
  46. package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/formatters/csv-formatter.d.ts.map +1 -0
  47. package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/formatters/excel-formatter.d.ts +4 -0
  48. package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/formatters/excel-formatter.d.ts.map +1 -0
  49. package/dist/components/data-grid/plugins/actions-menu/public.d.ts +2 -0
  50. package/dist/components/data-grid/plugins/actions-menu/public.d.ts.map +1 -1
  51. package/dist/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-body-cell.d.ts +3 -0
  52. package/dist/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-body-cell.d.ts.map +1 -0
  53. package/dist/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-content.d.ts +7 -0
  54. package/dist/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-content.d.ts.map +1 -0
  55. package/dist/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-row.d.ts +8 -0
  56. package/dist/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-row.d.ts.map +1 -0
  57. package/dist/components/data-grid/plugins/drag-drop/drag-data.d.ts +4 -0
  58. package/dist/components/data-grid/plugins/drag-drop/drag-data.d.ts.map +1 -0
  59. package/dist/components/data-grid/plugins/drag-drop/drag-drop-plugin.d.ts +18 -0
  60. package/dist/components/data-grid/plugins/drag-drop/drag-drop-plugin.d.ts.map +1 -0
  61. package/dist/components/data-grid/plugins/drag-drop/drag-drop-types.d.ts +60 -0
  62. package/dist/components/data-grid/plugins/drag-drop/drag-drop-types.d.ts.map +1 -0
  63. package/dist/components/data-grid/plugins/drag-drop/drag-preview.d.ts +2 -0
  64. package/dist/components/data-grid/plugins/drag-drop/drag-preview.d.ts.map +1 -0
  65. package/dist/components/data-grid/plugins/drag-drop/public.d.ts +3 -0
  66. package/dist/components/data-grid/plugins/drag-drop/public.d.ts.map +1 -0
  67. package/dist/components/data-grid/plugins/filters/components/adaptive-popover.d.ts.map +1 -1
  68. package/dist/components/data-grid/plugins/filters/components/all-filters-button.d.ts.map +1 -1
  69. package/dist/components/data-grid/plugins/order/components/data-grid-order-button.d.ts.map +1 -1
  70. package/dist/components/data-grid/plugins/pagination/components/data-grid-pagination.d.ts.map +1 -1
  71. package/dist/components/data-grid/plugins/pagination/components/pager.d.ts +6 -0
  72. package/dist/components/data-grid/plugins/pagination/components/pager.d.ts.map +1 -1
  73. package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-trigger.d.ts.map +1 -1
  74. package/dist/components/data-grid/plugins/table-tree/components/data-grid-table-tree-body-cell-content.d.ts +9 -0
  75. package/dist/components/data-grid/plugins/table-tree/components/data-grid-table-tree-body-cell-content.d.ts.map +1 -0
  76. package/dist/components/data-grid/plugins/table-tree/components/data-grid-table-tree-expand.d.ts +3 -0
  77. package/dist/components/data-grid/plugins/table-tree/components/data-grid-table-tree-expand.d.ts.map +1 -0
  78. package/dist/components/data-grid/plugins/table-tree/components/data-grid-table-tree-row.d.ts +8 -0
  79. package/dist/components/data-grid/plugins/table-tree/components/data-grid-table-tree-row.d.ts.map +1 -0
  80. package/dist/components/data-grid/plugins/table-tree/public.d.ts +3 -0
  81. package/dist/components/data-grid/plugins/table-tree/public.d.ts.map +1 -0
  82. package/dist/components/data-grid/plugins/table-tree/table-tree-helpers.d.ts +4 -0
  83. package/dist/components/data-grid/plugins/table-tree/table-tree-helpers.d.ts.map +1 -0
  84. package/dist/components/data-grid/plugins/table-tree/table-tree-plugin.d.ts +5 -0
  85. package/dist/components/data-grid/plugins/table-tree/table-tree-plugin.d.ts.map +1 -0
  86. package/dist/components/data-grid/plugins/table-tree/table-tree-types.d.ts +33 -0
  87. package/dist/components/data-grid/plugins/table-tree/table-tree-types.d.ts.map +1 -0
  88. package/dist/components/data-grid/services/core/data-grid-label-context.d.ts +7 -0
  89. package/dist/components/data-grid/services/core/data-grid-label-context.d.ts.map +1 -0
  90. package/dist/components/data-grid/services/core/data-grid-portal-container-context.d.ts +9 -0
  91. package/dist/components/data-grid/services/core/data-grid-portal-container-context.d.ts.map +1 -0
  92. package/dist/components/data-grid/services/table/components/data-grid-table.d.ts.map +1 -1
  93. package/dist/components/pagination/pagination.d.ts +7 -4
  94. package/dist/components/pagination/pagination.d.ts.map +1 -1
  95. package/dist/data-grid/actions-menu.js +350 -33
  96. package/dist/data-grid/actions-menu.js.map +1 -1
  97. package/dist/data-grid/drag-drop.d.ts +1 -0
  98. package/dist/data-grid/drag-drop.js +261 -0
  99. package/dist/data-grid/drag-drop.js.map +1 -0
  100. package/dist/data-grid/filters.js +368 -364
  101. package/dist/data-grid/filters.js.map +1 -1
  102. package/dist/data-grid/order.js +111 -110
  103. package/dist/data-grid/order.js.map +1 -1
  104. package/dist/data-grid/pagination.js +152 -143
  105. package/dist/data-grid/pagination.js.map +1 -1
  106. package/dist/data-grid/row-click.js +35 -42
  107. package/dist/data-grid/row-click.js.map +1 -1
  108. package/dist/data-grid/row-number.js +6 -6
  109. package/dist/data-grid/table-configuration.js +49 -37
  110. package/dist/data-grid/table-configuration.js.map +1 -1
  111. package/dist/data-grid/table-tree.d.ts +1 -0
  112. package/dist/data-grid/table-tree.js +233 -0
  113. package/dist/data-grid/table-tree.js.map +1 -0
  114. package/dist/data-grid.js +516 -542
  115. package/dist/data-grid.js.map +1 -1
  116. package/dist/docs/data-grid.md +309 -11
  117. package/dist/docs/pagination.md +14 -0
  118. package/dist/docs/table.md +10 -1
  119. package/dist/index.d.ts +2 -0
  120. package/dist/index.d.ts.map +1 -1
  121. package/dist/index.js +375 -370
  122. package/dist/index.js.map +1 -1
  123. package/dist/pagination.js +23 -23
  124. package/dist/pagination.js.map +1 -1
  125. package/dist/table.js +88 -88
  126. package/llms.txt +6 -3
  127. package/package.json +10 -1
  128. package/dist/chunks/pagination.CKDEuWt6.css +0 -1
  129. package/dist/chunks/resolve-body-cell-props.DGczzk1U.css +0 -1
  130. package/dist/chunks/row-number.C7fNu9Bw.css +0 -1
  131. package/dist/chunks/table.Dmz7LEk7.css +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"row-click.js","sources":["../../src/components/data-grid/plugins/row-click/row-click-utils.ts","../../src/components/data-grid/plugins/row-click/components/data-grid-row-click.tsx","../../src/components/data-grid/plugins/row-click/row-click-plugin.tsx"],"sourcesContent":["import type { KeyboardEvent, MouseEvent } from 'react';\nimport type { DataGridItem } from '../../data-grid-types';\nimport { IGNORE_CLICK_ATTRIBUTE } from '../../services/table/ignore-row-click';\nimport type { DataGridRowClickCallback } from './row-click-plugin';\n\nconst IGNORE_CLICK_SELECTOR = `[${IGNORE_CLICK_ATTRIBUTE}]`;\n\n/**\n * Accepts a getter so the callback is read at event time from the mutable plugin API,\n * avoiding stale closures when onPropsChange updates the API without re-rendering the row.\n */\nexport function getClickListener<TItem extends DataGridItem>(\n item: TItem,\n getCb: () => DataGridRowClickCallback<TItem> | undefined,\n) {\n return (event: MouseEvent | KeyboardEvent) => {\n const cb = getCb();\n if (!cb) return;\n if (event.target instanceof HTMLElement || event.target instanceof SVGElement) {\n if (event.target.closest(IGNORE_CLICK_SELECTOR)) {\n return;\n }\n }\n cb(item);\n };\n}\n","import type { KeyboardEvent } from 'react';\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 type { DataGridRowClickPluginApi } from '../row-click-plugin';\nimport { getClickListener } from '../row-click-utils';\nimport styles from './data-grid-row-click.module.css';\n\ninterface DataGridRowClickProps<TItem extends DataGridItem> {\n record: DataGridRecord<TItem>;\n}\n\nexport function DataGridRowClick<TItem extends DataGridItem>({\n record,\n}: DataGridRowClickProps<TItem>) {\n // Uses useDataGridContext (not useTableService) because we need both context.table and context.plugins\n const context = useDataGridContext<TItem>();\n const tableService = context.table;\n const columns = tableService.useVisibleColumns();\n const tableLayout = tableService.useTableLayout();\n const rowClickApi = context.plugins.getPlugin<DataGridRowClickPluginApi<TItem>>('rowClick');\n\n const onClick = getClickListener(record.item, () => rowClickApi?.click);\n const onDblClick = getClickListener(record.item, () => rowClickApi?.dblclick);\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Enter') {\n onClick(event);\n }\n };\n\n const BodyCellContent = tableService.useComponent<{ column: DataGridTableColumn<TItem>; item: TItem }>(\n 'body-cell-content',\n );\n\n return (\n <DataGridRecordProvider value={record}>\n <TableRow\n className={styles.clickableRow}\n tabIndex={0}\n onClick={onClick}\n onDoubleClick={onDblClick}\n onKeyDown={onKeyDown}\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 </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 type { ReactNode } from 'react';\nimport type { DataGridItem } from '../../data-grid-types';\nimport { createDataGridPlugin } from '../../services/plugins/plugins-helpers';\nimport type { DataGridPluginApi } from '../../services/plugins/plugins-helpers';\nimport { DataGridRowClick } from './components/data-grid-row-click';\n\nexport type DataGridRowClickCallback<Item extends DataGridItem = DataGridItem> = (\n item: Item,\n) => void;\n\nexport interface DataGridRowClickPluginProps<\n Item extends DataGridItem = DataGridItem,\n> extends Record<string, unknown> {\n click?: DataGridRowClickCallback<Item>;\n dblclick?: DataGridRowClickCallback<Item>;\n}\n\nexport interface DataGridRowClickPluginApi<\n Item extends DataGridItem = DataGridItem,\n> extends DataGridPluginApi<DataGridRowClickPluginProps<Item>> {\n click?: DataGridRowClickCallback<Item>;\n dblclick?: DataGridRowClickCallback<Item>;\n}\n\nconst DataGridRowClickPluginRaw = createDataGridPlugin<\n DataGridItem,\n 'rowClick',\n DataGridRowClickPluginProps\n>('rowClick', (context) => {\n context.registerComponent('row', DataGridRowClick);\n\n const api: DataGridRowClickPluginApi = {\n click: undefined,\n dblclick: undefined,\n onPropsChange(props: DataGridRowClickPluginProps) {\n api.click = props.click;\n api.dblclick = props.dblclick;\n },\n };\n\n return api;\n});\n\n// The plugin is built for the base item type; the cast hands the consumer a generic component, so\n// `<DataGridRowClickPlugin<User> click={(user) => ...} />` types the callback's argument.\nexport const DataGridRowClickPlugin = DataGridRowClickPluginRaw as <\n TItem extends DataGridItem = DataGridItem,\n>(\n props: DataGridRowClickPluginProps<TItem>,\n) => ReactNode;\n"],"names":["IGNORE_CLICK_SELECTOR","IGNORE_CLICK_ATTRIBUTE","getClickListener","item","getCb","event","cb","DataGridRowClick","record","context","useDataGridContext","tableService","columns","tableLayout","rowClickApi","onClick","onDblClick","onKeyDown","BodyCellContent","jsx","DataGridRecordProvider","jsxs","TableRow","styles","DataGridExtraBodyColumns","col","dynamicClassName","_a","bodyCellProps","resolveBodyCellProps","DataGridCell","DataGridRowClickPluginRaw","createDataGridPlugin","api","props","DataGridRowClickPlugin"],"mappings":";;;;;;;AAKA,MAAMA,IAAwB,IAAIC,CAAsB;AAMjD,SAASC,EACdC,GACAC,GACA;AACA,SAAO,CAACC,MAAsC;AAC5C,UAAMC,IAAKF,EAAA;AACX,IAAKE,OACDD,EAAM,kBAAkB,eAAeA,EAAM,kBAAkB,eAC7DA,EAAM,OAAO,QAAQL,CAAqB,KAIhDM,EAAGH,CAAI;AAAA,EACT;AACF;;;;ACPO,SAASI,EAA6C;AAAA,EAC3D,QAAAC;AACF,GAAiC;AAE/B,QAAMC,IAAUC,EAAA,GACVC,IAAeF,EAAQ,OACvBG,IAAUD,EAAa,kBAAA,GACvBE,IAAcF,EAAa,eAAA,GAC3BG,IAAcL,EAAQ,QAAQ,UAA4C,UAAU,GAEpFM,IAAUb,EAAiBM,EAAO,MAAM,MAAMM,KAAA,gBAAAA,EAAa,KAAK,GAChEE,IAAad,E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;AAAA,EAAA;AAGF,SAAOD;AACT,CAAC,GAIYE,IAAyBJ;"}
1
+ {"version":3,"file":"row-click.js","sources":["../../src/components/data-grid/plugins/row-click/components/data-grid-row-click.tsx","../../src/components/data-grid/plugins/row-click/row-click-plugin.tsx"],"sourcesContent":["import type { KeyboardEvent } from 'react';\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 type { DataGridRowClickPluginApi } from '../row-click-plugin';\nimport { getClickListener } from '../row-click-utils';\nimport styles from './data-grid-row-click.module.css';\n\ninterface DataGridRowClickProps<TItem extends DataGridItem> {\n record: DataGridRecord<TItem>;\n}\n\nexport function DataGridRowClick<TItem extends DataGridItem>({\n record,\n}: DataGridRowClickProps<TItem>) {\n // Uses useDataGridContext (not useTableService) because we need both context.table and context.plugins\n const context = useDataGridContext<TItem>();\n const tableService = context.table;\n const columns = tableService.useVisibleColumns();\n const tableLayout = tableService.useTableLayout();\n const rowClickApi = context.plugins.getPlugin<DataGridRowClickPluginApi<TItem>>('rowClick');\n\n const onClick = getClickListener(record.item, () => rowClickApi?.click);\n const onDblClick = getClickListener(record.item, () => rowClickApi?.dblclick);\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Enter') {\n onClick(event);\n }\n };\n\n const BodyCellContent = tableService.useComponent<{ column: DataGridTableColumn<TItem>; item: TItem }>(\n 'body-cell-content',\n );\n\n return (\n <DataGridRecordProvider value={record}>\n <TableRow\n className={styles.clickableRow}\n tabIndex={0}\n onClick={onClick}\n onDoubleClick={onDblClick}\n onKeyDown={onKeyDown}\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 </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 type { ReactNode } from 'react';\nimport type { DataGridItem } from '../../data-grid-types';\nimport { createDataGridPlugin } from '../../services/plugins/plugins-helpers';\nimport type { DataGridPluginApi } from '../../services/plugins/plugins-helpers';\nimport { DataGridRowClick } from './components/data-grid-row-click';\n\nexport type DataGridRowClickCallback<Item extends DataGridItem = DataGridItem> = (\n item: Item,\n) => void;\n\nexport interface DataGridRowClickPluginProps<\n Item extends DataGridItem = DataGridItem,\n> extends Record<string, unknown> {\n click?: DataGridRowClickCallback<Item>;\n dblclick?: DataGridRowClickCallback<Item>;\n}\n\nexport interface DataGridRowClickPluginApi<\n Item extends DataGridItem = DataGridItem,\n> extends DataGridPluginApi<DataGridRowClickPluginProps<Item>> {\n click?: DataGridRowClickCallback<Item>;\n dblclick?: DataGridRowClickCallback<Item>;\n}\n\nconst DataGridRowClickPluginRaw = createDataGridPlugin<\n DataGridItem,\n 'rowClick',\n DataGridRowClickPluginProps\n>('rowClick', (context) => {\n context.registerComponent('row', DataGridRowClick);\n\n const api: DataGridRowClickPluginApi = {\n click: undefined,\n dblclick: undefined,\n onPropsChange(props: DataGridRowClickPluginProps) {\n api.click = props.click;\n api.dblclick = props.dblclick;\n },\n };\n\n return api;\n});\n\n// The plugin is built for the base item type; the cast hands the consumer a generic component, so\n// `<DataGridRowClickPlugin<User> click={(user) => ...} />` types the callback's argument.\nexport const DataGridRowClickPlugin = DataGridRowClickPluginRaw as <\n TItem extends DataGridItem = DataGridItem,\n>(\n props: DataGridRowClickPluginProps<TItem>,\n) => ReactNode;\n"],"names":["DataGridRowClick","record","context","useDataGridContext","tableService","columns","tableLayout","rowClickApi","onClick","getClickListener","onDblClick","onKeyDown","event","BodyCellContent","jsx","DataGridRecordProvider","jsxs","TableRow","styles","DataGridExtraBodyColumns","col","dynamicClassName","_a","bodyCellProps","resolveBodyCellProps","DataGridCell","DataGridRowClickPluginRaw","createDataGridPlugin","api","props","DataGridRowClickPlugin"],"mappings":";;;;;;;;;;AAkBO,SAASA,EAA6C;AAAA,EAC3D,QAAAC;AACF,GAAiC;AAE/B,QAAMC,IAAUC,EAAA,GACVC,IAAeF,EAAQ,OACvBG,IAAUD,EAAa,kBAAA,GACvBE,IAAcF,EAAa,eAAA,GAC3BG,IAAcL,EAAQ,QAAQ,UAA4C,UAAU,GAEpFM,IAAUC,EAAiBR,EAAO,MAAM,MAAMM,KAAA,gBAAAA,EAAa,KAAK,GAChEG,IAAaD,EAAiBR,EAAO,MAAM,MAAMM,KAAA,gBAAAA,EAAa,QAAQ,GACtEI,IAAY,CAACC,MAAyB;AAC1C,IAAIA,EAAM,QAAQ,WAChBJ,EAAQI,CAAK;AAAA,EAEjB,GAEMC,IAAkBT,EAAa;AAAA,IACnC;AAAA,EAAA;AAGF,SACE,gBAAAU,EAACC,GAAA,EAAuB,OAAOd,GAC7B,UAAA,gBAAAe;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAO;AAAA,MAClB,UAAU;AAAA,MACV,SAAAV;AAAA,MACA,eAAeE;AAAA,MACf,WAAAC;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAG,EAACK,GAAA,EAAyB,UAAS,QAAA,CAAQ;AAAA,QAC1Cd,EAAQ,IAAI,CAACe,MAAQ;;AACpB,gBAAMC,KAAmBC,IAAAF,EAAI,iBAAJ,gBAAAE,EAAA,KAAAF,GAAmBnB,EAAO,OAC7CsB,IAAgBC,EAAqBJ,GAAKnB,EAAO,MAAMK,CAAW;AAExE,iBACE,gBAAAQ;AAAA,YAACW;AAAA,YAAA;AAAA,cAEC,UAAUL,EAAI;AAAA,cACd,WAAWC;AAAA,cACV,GAAGE;AAAA,cAEJ,4BAACV,GAAA,EAAgB,QAAQO,GAAK,MAAMnB,EAAO,KAAA,CAAM;AAAA,YAAA;AAAA,YAL5CmB,EAAI;AAAA,UAAA;AAAA,QAQf,CAAC;AAAA,QACD,gBAAAN,EAACK,GAAA,EAAyB,UAAS,MAAA,CAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAE7C;AAEJ;ACtCA,MAAMO,IAA4BC,EAIhC,YAAY,CAACzB,MAAY;AACzB,EAAAA,EAAQ,kBAAkB,OAAOF,CAAgB;AAEjD,QAAM4B,IAAiC;AAAA,IACrC,OAAO;AAAA,IACP,UAAU;AAAA,IACV,cAAcC,GAAoC;AAChD,MAAAD,EAAI,QAAQC,EAAM,OAClBD,EAAI,WAAWC,EAAM;AAAA,IACvB;AAAA,EAAA;AAGF,SAAOD;AACT,CAAC,GAIYE,IAAyBJ;"}
@@ -1,23 +1,23 @@
1
1
  "use client";
2
- import { c as a } from "../chunks/create-column-auto-size.js";
2
+ import { c as u } from "../chunks/create-column-auto-size.js";
3
3
  import { u as m, c } from "../chunks/plugins-helpers.js";
4
4
  import { jsx as d } from "react/jsx-runtime";
5
5
  import { u as l } from "../chunks/data-grid-record-context.js";
6
- import '../chunks/row-number.C7fNu9Bw.css';function p(o, r, t) {
6
+ import '../chunks/row-number.BxFT_3yP.css';function p(o, r, t) {
7
7
  return t * (r - 1) + o + 1;
8
8
  }
9
- const b = "_rowNumber_1sdux_1", w = {
9
+ const b = "_rowNumber_c3lgn_8", w = {
10
10
  rowNumber: b
11
11
  };
12
12
  function N() {
13
- var s, u;
14
- const o = m(), r = l(), { measureRef: t } = o.getPlugin("rowNumber"), e = ((s = r.section.loadContext.pagination) == null ? void 0 : s.page) ?? 1, i = ((u = r.section.loadContext.pagination) == null ? void 0 : u.limit) ?? 0, n = p(r.index, e, i);
13
+ var a, s;
14
+ const o = m(), r = l(), { measureRef: t } = o.getPlugin("rowNumber"), e = ((a = r.section.loadContext.pagination) == null ? void 0 : a.page) ?? 1, i = ((s = r.section.loadContext.pagination) == null ? void 0 : s.limit) ?? 0, n = p(r.index, e, i);
15
15
  return /* @__PURE__ */ d("span", { ref: t, className: w.rowNumber, children: n });
16
16
  }
17
17
  const g = "row-number", f = "32px", D = c(
18
18
  "rowNumber",
19
19
  (o) => {
20
- const r = g, { measureRef: t, destroy: e } = a((n) => {
20
+ const r = g, { measureRef: t, destroy: e } = u((n) => {
21
21
  o.updateExtraColumnWidth(r, n);
22
22
  });
23
23
  return o.hook("destroy", e), o.registerExtraColumn({
@@ -1,36 +1,37 @@
1
1
  "use client";
2
2
  import { c as f } from "../chunks/plugins-helpers.js";
3
3
  import { jsx as n, jsxs as s } from "react/jsx-runtime";
4
- import { PinIcon as b, SettingsIcon as h } from "lucide-react";
4
+ import { PinIcon as b, SettingsIcon as C } from "lucide-react";
5
5
  import { m as c } from "../chunks/messages.js";
6
+ import { u as h } from "../chunks/data-grid-portal-container-context.js";
6
7
  import { Fragment as _ } from "react";
7
- import { u as C } from "../chunks/table-context.js";
8
- import { a as T } from "../chunks/table-types.js";
8
+ import { u as T } from "../chunks/table-context.js";
9
+ import { a as y } from "../chunks/table-types.js";
9
10
  import { cx as u } from "class-variance-authority";
10
- import { Toggle as y } from "../toggle.js";
11
- import { DropdownMenuItem as g, DropdownMenu as k, DropdownMenuSeparator as S } from "../dropdown-menu.js";
12
- import { Switch as w } from "../switch.js";
13
- import { Popover as N, PopoverTrigger as v, PopoverContent as I } from "../popover.js";
14
- import { Button as D } from "../button.js";
15
- import '../chunks/table-configuration.a6C_fp7B.css';const B = "_popup_i679w_8", G = "_tableConfiguration_i679w_23", V = "_header_i679w_33", P = "_content_i679w_48", x = "_configurationItem_i679w_61", z = "_pinButton_i679w_92", M = "_pinButtonVisible_i679w_97", j = "_pin_i679w_92", O = "_label_i679w_116", F = "_configurationItemNoSticky_i679w_122", q = "_groupContent_i679w_126", o = {
16
- popup: B,
17
- tableConfiguration: G,
11
+ import { Toggle as k } from "../toggle.js";
12
+ import { DropdownMenuItem as g, DropdownMenu as S, DropdownMenuSeparator as w } from "../dropdown-menu.js";
13
+ import { Switch as N } from "../switch.js";
14
+ import { Popover as v, PopoverTrigger as I, PopoverContent as D } from "../popover.js";
15
+ import { Button as B } from "../button.js";
16
+ import '../chunks/table-configuration.a6C_fp7B.css';const G = "_popup_i679w_8", P = "_tableConfiguration_i679w_23", V = "_header_i679w_33", x = "_content_i679w_48", z = "_configurationItem_i679w_61", M = "_pinButton_i679w_92", j = "_pinButtonVisible_i679w_97", O = "_pin_i679w_92", F = "_label_i679w_116", q = "_configurationItemNoSticky_i679w_122", A = "_groupContent_i679w_126", o = {
17
+ popup: G,
18
+ tableConfiguration: P,
18
19
  header: V,
19
- content: P,
20
- configurationItem: x,
21
- pinButton: z,
22
- pinButtonVisible: M,
23
- pin: j,
24
- label: O,
25
- configurationItemNoSticky: F,
26
- groupContent: q
20
+ content: x,
21
+ configurationItem: z,
22
+ pinButton: M,
23
+ pinButtonVisible: j,
24
+ pin: O,
25
+ label: F,
26
+ configurationItemNoSticky: q,
27
+ groupContent: A
27
28
  };
28
29
  function m({
29
30
  sticky: i,
30
31
  onToggle: a
31
32
  }) {
32
33
  return /* @__PURE__ */ n("div", { className: u(o.pinButton, i && o.pinButtonVisible), children: /* @__PURE__ */ n(
33
- y,
34
+ k,
34
35
  {
35
36
  className: o.pin,
36
37
  iconOnly: !0,
@@ -62,7 +63,7 @@ function d({
62
63
  a && /* @__PURE__ */ n(m, { sticky: i.sticky, onToggle: e }),
63
64
  /* @__PURE__ */ n("span", { className: o.label, children: i.label }),
64
65
  /* @__PURE__ */ n(
65
- w,
66
+ N,
66
67
  {
67
68
  size: "sm",
68
69
  checked: i.visible,
@@ -74,7 +75,7 @@ function d({
74
75
  }
75
76
  );
76
77
  }
77
- function A({
78
+ function E({
78
79
  group: i,
79
80
  hasSticky: a,
80
81
  onVisibilityToggle: l,
@@ -99,8 +100,8 @@ function A({
99
100
  )) })
100
101
  ] });
101
102
  }
102
- function E() {
103
- const i = C(), a = i.useConfigurationColumns();
103
+ function H() {
104
+ const i = T(), a = i.useConfigurationColumns();
104
105
  function l(t, e) {
105
106
  i.updateColumnVisibility(t, e);
106
107
  }
@@ -110,11 +111,11 @@ function E() {
110
111
  return (
111
112
  // The menu parts without a popup of their own: the popover is the popup, and the menu only
112
113
  // supplies the items, so there is no arrow-key navigation between them.
113
- /* @__PURE__ */ n(k, { open: !0, modal: !1, children: /* @__PURE__ */ s("div", { className: o.tableConfiguration, children: [
114
+ /* @__PURE__ */ n(S, { open: !0, modal: !1, children: /* @__PURE__ */ s("div", { className: o.tableConfiguration, children: [
114
115
  /* @__PURE__ */ n("div", { className: o.header, children: c.tableConfiguration.header }),
115
116
  /* @__PURE__ */ n("div", { className: o.content, children: a.map((t, e) => /* @__PURE__ */ s(_, { children: [
116
- T(t) ? /* @__PURE__ */ n(
117
- A,
117
+ y(t) ? /* @__PURE__ */ n(
118
+ E,
118
119
  {
119
120
  group: t,
120
121
  hasSticky: !0,
@@ -130,36 +131,47 @@ function E() {
130
131
  onStickyToggle: r
131
132
  }
132
133
  ),
133
- e !== a.length - 1 && /* @__PURE__ */ n(S, {})
134
+ e !== a.length - 1 && /* @__PURE__ */ n(w, {})
134
135
  ] }, t.id)) })
135
136
  ] }) })
136
137
  );
137
138
  }
138
- function H() {
139
- return /* @__PURE__ */ s(N, { children: [
139
+ function J() {
140
+ const i = h();
141
+ return /* @__PURE__ */ s(v, { children: [
140
142
  /* @__PURE__ */ n(
141
- v,
143
+ I,
142
144
  {
143
145
  render: /* @__PURE__ */ n(
144
- D,
146
+ B,
145
147
  {
146
148
  variant: "ghost",
147
149
  size: "sm",
148
- icon: /* @__PURE__ */ n(h, {}),
150
+ icon: /* @__PURE__ */ n(C, {}),
149
151
  "aria-label": c.tableConfiguration.configureColumns
150
152
  }
151
153
  )
152
154
  }
153
155
  ),
154
- /* @__PURE__ */ n(I, { side: "bottom", align: "end", sideOffset: 4, className: o.popup, children: /* @__PURE__ */ n(E, {}) })
156
+ /* @__PURE__ */ n(
157
+ D,
158
+ {
159
+ side: "bottom",
160
+ align: "end",
161
+ sideOffset: 4,
162
+ className: o.popup,
163
+ container: i,
164
+ children: /* @__PURE__ */ n(H, {})
165
+ }
166
+ )
155
167
  ] });
156
168
  }
157
- const oi = f("tableConfiguration", (i) => (i.registerSlot("top-end", {
169
+ const ei = f("tableConfiguration", (i) => (i.registerSlot("top-end", {
158
170
  id: "tableConfiguration",
159
- component: H,
171
+ component: J,
160
172
  order: 10
161
173
  }), {}));
162
174
  export {
163
- oi as DataGridTableConfigurationPlugin
175
+ ei as DataGridTableConfigurationPlugin
164
176
  };
165
177
  //# sourceMappingURL=table-configuration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"table-configuration.js","sources":["../../src/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-pin-button.tsx","../../src/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-item.tsx","../../src/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-group-item.tsx","../../src/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration.tsx","../../src/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-trigger.tsx","../../src/components/data-grid/plugins/table-configuration/table-configuration-plugin.tsx"],"sourcesContent":["import { cx } from 'class-variance-authority';\nimport { PinIcon } from 'lucide-react';\n\nimport { Toggle } from '../../../../toggle/public.js';\nimport { messages } from '../../../messages';\nimport styles from './data-grid-table-configuration.module.css';\n\ninterface DataGridTableConfigurationPinButtonProps {\n sticky?: boolean;\n onToggle: () => void;\n}\n\nexport function DataGridTableConfigurationPinButton({\n sticky,\n onToggle,\n}: DataGridTableConfigurationPinButtonProps) {\n return (\n <div className={cx(styles.pinButton, sticky && styles.pinButtonVisible)}>\n <Toggle\n className={styles.pin}\n iconOnly\n size=\"sm\"\n pressed={sticky ?? false}\n onPressedChange={onToggle}\n aria-label={\n sticky ? messages.tableConfiguration.unpinColumn : messages.tableConfiguration.pinColumn\n }\n >\n <PinIcon />\n </Toggle>\n </div>\n );\n}\n","import { cx } from 'class-variance-authority';\n\nimport { DropdownMenuItem } from '../../../../dropdown-menu/public.js';\nimport { Switch } from '../../../../switch/public.js';\nimport type { ConfigurationColumn } from '../../../services/table/table-types';\nimport styles from './data-grid-table-configuration.module.css';\nimport { DataGridTableConfigurationPinButton } from './data-grid-table-configuration-pin-button';\n\ninterface DataGridTableConfigurationItemProps {\n column: ConfigurationColumn;\n hasSticky?: boolean;\n onVisibilityToggle: (columnId: string, visible: boolean) => void;\n onStickyToggle: (columnId: string, sticky: boolean) => void;\n}\n\nexport function DataGridTableConfigurationItem({\n column,\n hasSticky,\n onVisibilityToggle,\n onStickyToggle,\n}: DataGridTableConfigurationItemProps) {\n function handleVisibilityToggle(visible: boolean) {\n onVisibilityToggle(column.id, visible);\n }\n\n function handleStickyToggle() {\n onStickyToggle(column.id, !column.sticky);\n }\n\n // The item holds a switch and a pin button, both interactive: a menu item is the row they sit\n // in, not something to activate itself.\n return (\n <DropdownMenuItem\n className={cx(styles.configurationItem, !hasSticky && styles.configurationItemNoSticky)}\n >\n {hasSticky && (\n <DataGridTableConfigurationPinButton sticky={column.sticky} onToggle={handleStickyToggle} />\n )}\n <span className={styles.label}>{column.label}</span>\n <Switch\n size=\"sm\"\n checked={column.visible}\n disabled={column.visibleToggleDisabled}\n onCheckedChange={handleVisibilityToggle}\n />\n </DropdownMenuItem>\n );\n}\n","import { DropdownMenuItem } from '../../../../dropdown-menu/public.js';\nimport type { ConfigurationGroup } from '../../../services/table/table-types';\nimport styles from './data-grid-table-configuration.module.css';\nimport { DataGridTableConfigurationItem } from './data-grid-table-configuration-item';\nimport { DataGridTableConfigurationPinButton } from './data-grid-table-configuration-pin-button';\n\ninterface DataGridTableConfigurationGroupItemProps {\n group: ConfigurationGroup;\n hasSticky?: boolean;\n onVisibilityToggle: (columnId: string, visible: boolean) => void;\n onStickyToggle: (id: string, sticky: boolean) => void;\n}\n\nexport function DataGridTableConfigurationGroupItem({\n group,\n hasSticky,\n onVisibilityToggle,\n onStickyToggle,\n}: DataGridTableConfigurationGroupItemProps) {\n function handleStickyToggle() {\n onStickyToggle(group.id, !group.sticky);\n }\n\n return (\n <div>\n <DropdownMenuItem className={styles.configurationItem}>\n {hasSticky && (\n <DataGridTableConfigurationPinButton sticky={group.sticky} onToggle={handleStickyToggle} />\n )}\n <span className={styles.label}>{group.label}</span>\n </DropdownMenuItem>\n <div className={styles.groupContent}>\n {group.columns.map((col) => (\n <DataGridTableConfigurationItem\n key={col.id}\n column={col}\n onVisibilityToggle={onVisibilityToggle}\n onStickyToggle={onStickyToggle}\n />\n ))}\n </div>\n </div>\n );\n}\n","import { Fragment } from 'react';\n\nimport { DropdownMenu, DropdownMenuSeparator } from '../../../../dropdown-menu/public.js';\nimport { messages } from '../../../messages';\nimport { useTableService } from '../../../services/table/table-context';\nimport { isConfigurationGroup } from '../../../services/table/table-types';\nimport styles from './data-grid-table-configuration.module.css';\nimport { DataGridTableConfigurationGroupItem } from './data-grid-table-configuration-group-item';\nimport { DataGridTableConfigurationItem } from './data-grid-table-configuration-item';\n\nexport function DataGridTableConfiguration() {\n const tableService = useTableService();\n const columns = tableService.useConfigurationColumns();\n\n function handleVisibilityToggle(columnId: string, visible: boolean) {\n tableService.updateColumnVisibility(columnId, visible);\n }\n\n function handleStickyToggle(id: string, sticky: boolean) {\n tableService.updateColumnSticky(id, sticky);\n }\n\n return (\n // The menu parts without a popup of their own: the popover is the popup, and the menu only\n // supplies the items, so there is no arrow-key navigation between them.\n <DropdownMenu open modal={false}>\n <div className={styles.tableConfiguration}>\n <div className={styles.header}>{messages.tableConfiguration.header}</div>\n <div className={styles.content}>\n {columns.map((entry, index) => (\n <Fragment key={entry.id}>\n {isConfigurationGroup(entry) ? (\n <DataGridTableConfigurationGroupItem\n group={entry}\n hasSticky\n onVisibilityToggle={handleVisibilityToggle}\n onStickyToggle={handleStickyToggle}\n />\n ) : (\n <DataGridTableConfigurationItem\n column={entry}\n hasSticky\n onVisibilityToggle={handleVisibilityToggle}\n onStickyToggle={handleStickyToggle}\n />\n )}\n {index !== columns.length - 1 && <DropdownMenuSeparator />}\n </Fragment>\n ))}\n </div>\n </div>\n </DropdownMenu>\n );\n}\n","import { SettingsIcon } from 'lucide-react';\n\nimport { Button } from '../../../../button/public.js';\nimport { Popover, PopoverContent, PopoverTrigger } from '../../../../popover/public.js';\nimport { messages } from '../../../messages';\nimport styles from './data-grid-table-configuration.module.css';\nimport { DataGridTableConfiguration } from './data-grid-table-configuration';\n\nexport function DataGridTableConfigurationTrigger() {\n return (\n <Popover>\n <PopoverTrigger\n render={\n <Button\n variant=\"ghost\"\n size=\"sm\"\n icon={<SettingsIcon />}\n aria-label={messages.tableConfiguration.configureColumns}\n />\n }\n />\n <PopoverContent side=\"bottom\" align=\"end\" sideOffset={4} className={styles.popup}>\n <DataGridTableConfiguration />\n </PopoverContent>\n </Popover>\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 type { DataGridItem } from '../../data-grid-types';\nimport { createDataGridPlugin } from '../../services/plugins/plugins-helpers';\nimport { DataGridTableConfigurationTrigger } from './components/data-grid-table-configuration-trigger';\n\n/** The plugin takes no props; the type is public so a consumer can name it. */\nexport type DataGridTableConfigurationPluginProps = Record<string, never>;\n\nexport const DataGridTableConfigurationPlugin = createDataGridPlugin<\n DataGridItem,\n 'tableConfiguration',\n DataGridTableConfigurationPluginProps\n>('tableConfiguration', (context) => {\n context.registerSlot('top-end', {\n id: 'tableConfiguration',\n component: DataGridTableConfigurationTrigger,\n order: 10,\n });\n\n return {};\n});\n"],"names":["DataGridTableConfigurationPinButton","sticky","onToggle","jsx","cx","styles","Toggle","messages","PinIcon","DataGridTableConfigurationItem","column","hasSticky","onVisibilityToggle","onStickyToggle","handleVisibilityToggle","visible","handleStickyToggle","jsxs","DropdownMenuItem","Switch","DataGridTableConfigurationGroupItem","group","col","DataGridTableConfiguration","tableService","useTableService","columns","columnId","id","DropdownMenu","entry","index","Fragment","isConfigurationGroup","DropdownMenuSeparator","DataGridTableConfigurationTrigger","Popover","PopoverTrigger","Button","SettingsIcon","PopoverContent","DataGridTableConfigurationPlugin","createDataGridPlugin","context"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAYO,SAASA,EAAoC;AAAA,EAClD,QAAAC;AAAA,EACA,UAAAC;AACF,GAA6C;AAC3C,SACE,gBAAAC,EAAC,SAAI,WAAWC,EAAGC,EAAO,WAAWJ,KAAUI,EAAO,gBAAgB,GACpE,UAAA,gBAAAF;AAAA,IAACG;AAAA,IAAA;AAAA,MACC,WAAWD,EAAO;AAAA,MAClB,UAAQ;AAAA,MACR,MAAK;AAAA,MACL,SAASJ,KAAU;AAAA,MACnB,iBAAiBC;AAAA,MACjB,cACED,IAASM,EAAS,mBAAmB,cAAcA,EAAS,mBAAmB;AAAA,MAGjF,4BAACC,GAAA,CAAA,CAAQ;AAAA,IAAA;AAAA,EAAA,GAEb;AAEJ;ACjBO,SAASC,EAA+B;AAAA,EAC7C,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,gBAAAC;AACF,GAAwC;AACtC,WAASC,EAAuBC,GAAkB;AAChD,IAAAH,EAAmBF,EAAO,IAAIK,CAAO;AA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ACE,gBAAAlC;AAAA,UAACmC;AAAA,UAAA;AAAA,YACC,SAAQ;AAAA,YACR,MAAK;AAAA,YACL,wBAAOC,GAAA,EAAa;AAAA,YACpB,cAAYhC,EAAS,mBAAmB;AAAA,UAAA;AAAA,QAAA;AAAA,MAC1C;AAAA,IAAA;AAAA,IAGJ,gBAAAJ,EAACqC,GAAA,EAAe,MAAK,UAAS,OAAM,OAAM,YAAY,GAAG,WAAWnC,EAAO,OACzE,UAAA,gBAAAF,EAACoB,KAA2B,EAAA,CAC9B;AAAA,EAAA,GACF;AAEJ;ACZO,MAAMkB,KAAmCC,EAI9C,sBAAsB,CAACC,OACvBA,EAAQ,aAAa,WAAW;AAAA,EAC9B,IAAI;AAAA,EACJ,WAAWR;AAAA,EACX,OAAO;AAAA,CACR,GAEM,CAAA,EACR;"}
1
+ {"version":3,"file":"table-configuration.js","sources":["../../src/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-pin-button.tsx","../../src/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-item.tsx","../../src/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-group-item.tsx","../../src/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration.tsx","../../src/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-trigger.tsx","../../src/components/data-grid/plugins/table-configuration/table-configuration-plugin.tsx"],"sourcesContent":["import { cx } from 'class-variance-authority';\nimport { PinIcon } from 'lucide-react';\n\nimport { Toggle } from '../../../../toggle/public.js';\nimport { messages } from '../../../messages';\nimport styles from './data-grid-table-configuration.module.css';\n\ninterface DataGridTableConfigurationPinButtonProps {\n sticky?: boolean;\n onToggle: () => void;\n}\n\nexport function DataGridTableConfigurationPinButton({\n sticky,\n onToggle,\n}: DataGridTableConfigurationPinButtonProps) {\n return (\n <div className={cx(styles.pinButton, sticky && styles.pinButtonVisible)}>\n <Toggle\n className={styles.pin}\n iconOnly\n size=\"sm\"\n pressed={sticky ?? false}\n onPressedChange={onToggle}\n aria-label={\n sticky ? messages.tableConfiguration.unpinColumn : messages.tableConfiguration.pinColumn\n }\n >\n <PinIcon />\n </Toggle>\n </div>\n );\n}\n","import { cx } from 'class-variance-authority';\n\nimport { DropdownMenuItem } from '../../../../dropdown-menu/public.js';\nimport { Switch } from '../../../../switch/public.js';\nimport type { ConfigurationColumn } from '../../../services/table/table-types';\nimport styles from './data-grid-table-configuration.module.css';\nimport { DataGridTableConfigurationPinButton } from './data-grid-table-configuration-pin-button';\n\ninterface DataGridTableConfigurationItemProps {\n column: ConfigurationColumn;\n hasSticky?: boolean;\n onVisibilityToggle: (columnId: string, visible: boolean) => void;\n onStickyToggle: (columnId: string, sticky: boolean) => void;\n}\n\nexport function DataGridTableConfigurationItem({\n column,\n hasSticky,\n onVisibilityToggle,\n onStickyToggle,\n}: DataGridTableConfigurationItemProps) {\n function handleVisibilityToggle(visible: boolean) {\n onVisibilityToggle(column.id, visible);\n }\n\n function handleStickyToggle() {\n onStickyToggle(column.id, !column.sticky);\n }\n\n // The item holds a switch and a pin button, both interactive: a menu item is the row they sit\n // in, not something to activate itself.\n return (\n <DropdownMenuItem\n className={cx(styles.configurationItem, !hasSticky && styles.configurationItemNoSticky)}\n >\n {hasSticky && (\n <DataGridTableConfigurationPinButton sticky={column.sticky} onToggle={handleStickyToggle} />\n )}\n <span className={styles.label}>{column.label}</span>\n <Switch\n size=\"sm\"\n checked={column.visible}\n disabled={column.visibleToggleDisabled}\n onCheckedChange={handleVisibilityToggle}\n />\n </DropdownMenuItem>\n );\n}\n","import { DropdownMenuItem } from '../../../../dropdown-menu/public.js';\nimport type { ConfigurationGroup } from '../../../services/table/table-types';\nimport styles from './data-grid-table-configuration.module.css';\nimport { DataGridTableConfigurationItem } from './data-grid-table-configuration-item';\nimport { DataGridTableConfigurationPinButton } from './data-grid-table-configuration-pin-button';\n\ninterface DataGridTableConfigurationGroupItemProps {\n group: ConfigurationGroup;\n hasSticky?: boolean;\n onVisibilityToggle: (columnId: string, visible: boolean) => void;\n onStickyToggle: (id: string, sticky: boolean) => void;\n}\n\nexport function DataGridTableConfigurationGroupItem({\n group,\n hasSticky,\n onVisibilityToggle,\n onStickyToggle,\n}: DataGridTableConfigurationGroupItemProps) {\n function handleStickyToggle() {\n onStickyToggle(group.id, !group.sticky);\n }\n\n return (\n <div>\n <DropdownMenuItem className={styles.configurationItem}>\n {hasSticky && (\n <DataGridTableConfigurationPinButton sticky={group.sticky} onToggle={handleStickyToggle} />\n )}\n <span className={styles.label}>{group.label}</span>\n </DropdownMenuItem>\n <div className={styles.groupContent}>\n {group.columns.map((col) => (\n <DataGridTableConfigurationItem\n key={col.id}\n column={col}\n onVisibilityToggle={onVisibilityToggle}\n onStickyToggle={onStickyToggle}\n />\n ))}\n </div>\n </div>\n );\n}\n","import { Fragment } from 'react';\n\nimport { DropdownMenu, DropdownMenuSeparator } from '../../../../dropdown-menu/public.js';\nimport { messages } from '../../../messages';\nimport { useTableService } from '../../../services/table/table-context';\nimport { isConfigurationGroup } from '../../../services/table/table-types';\nimport styles from './data-grid-table-configuration.module.css';\nimport { DataGridTableConfigurationGroupItem } from './data-grid-table-configuration-group-item';\nimport { DataGridTableConfigurationItem } from './data-grid-table-configuration-item';\n\nexport function DataGridTableConfiguration() {\n const tableService = useTableService();\n const columns = tableService.useConfigurationColumns();\n\n function handleVisibilityToggle(columnId: string, visible: boolean) {\n tableService.updateColumnVisibility(columnId, visible);\n }\n\n function handleStickyToggle(id: string, sticky: boolean) {\n tableService.updateColumnSticky(id, sticky);\n }\n\n return (\n // The menu parts without a popup of their own: the popover is the popup, and the menu only\n // supplies the items, so there is no arrow-key navigation between them.\n <DropdownMenu open modal={false}>\n <div className={styles.tableConfiguration}>\n <div className={styles.header}>{messages.tableConfiguration.header}</div>\n <div className={styles.content}>\n {columns.map((entry, index) => (\n <Fragment key={entry.id}>\n {isConfigurationGroup(entry) ? (\n <DataGridTableConfigurationGroupItem\n group={entry}\n hasSticky\n onVisibilityToggle={handleVisibilityToggle}\n onStickyToggle={handleStickyToggle}\n />\n ) : (\n <DataGridTableConfigurationItem\n column={entry}\n hasSticky\n onVisibilityToggle={handleVisibilityToggle}\n onStickyToggle={handleStickyToggle}\n />\n )}\n {index !== columns.length - 1 && <DropdownMenuSeparator />}\n </Fragment>\n ))}\n </div>\n </div>\n </DropdownMenu>\n );\n}\n","import { SettingsIcon } from 'lucide-react';\n\nimport { Button } from '../../../../button/public.js';\nimport { Popover, PopoverContent, PopoverTrigger } from '../../../../popover/public.js';\nimport { messages } from '../../../messages';\nimport { useDataGridPortalContainer } from '../../../services/core/data-grid-portal-container-context';\nimport styles from './data-grid-table-configuration.module.css';\nimport { DataGridTableConfiguration } from './data-grid-table-configuration';\n\nexport function DataGridTableConfigurationTrigger() {\n const portalContainer = useDataGridPortalContainer();\n\n return (\n <Popover>\n <PopoverTrigger\n render={\n <Button\n variant=\"ghost\"\n size=\"sm\"\n icon={<SettingsIcon />}\n aria-label={messages.tableConfiguration.configureColumns}\n />\n }\n />\n <PopoverContent\n side=\"bottom\"\n align=\"end\"\n sideOffset={4}\n className={styles.popup}\n container={portalContainer}\n >\n <DataGridTableConfiguration />\n </PopoverContent>\n </Popover>\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 type { DataGridItem } from '../../data-grid-types';\nimport { createDataGridPlugin } from '../../services/plugins/plugins-helpers';\nimport { DataGridTableConfigurationTrigger } from './components/data-grid-table-configuration-trigger';\n\n/** The plugin takes no props; the type is public so a consumer can name it. */\nexport type DataGridTableConfigurationPluginProps = Record<string, never>;\n\nexport const DataGridTableConfigurationPlugin = createDataGridPlugin<\n DataGridItem,\n 'tableConfiguration',\n DataGridTableConfigurationPluginProps\n>('tableConfiguration', (context) => {\n context.registerSlot('top-end', {\n id: 'tableConfiguration',\n component: DataGridTableConfigurationTrigger,\n order: 10,\n });\n\n return {};\n});\n"],"names":["DataGridTableConfigurationPinButton","sticky","onToggle","jsx","cx","styles","Toggle","messages","PinIcon","DataGridTableConfigurationItem","column","hasSticky","onVisibilityToggle","onStickyToggle","handleVisibilityToggle","visible","handleStickyToggle","jsxs","DropdownMenuItem","Switch","DataGridTableConfigurationGroupItem","group","col","DataGridTableConfiguration","tableService","useTableService","columns","columnId","id","DropdownMenu","entry","index","Fragment","isConfigurationGroup","DropdownMenuSeparator","DataGridTableConfigurationTrigger","portalContainer","useDataGridPortalContainer","Popover","PopoverTrigger","Button","SettingsIcon","PopoverContent","DataGridTableConfigurationPlugin","createDataGridPlugin","context"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYO,SAASA,EAAoC;AAAA,EAClD,QAAAC;AAAA,EACA,UAAAC;AACF,GAA6C;AAC3C,SACE,gBAAAC,EAAC,SAAI,WAAWC,EAAGC,EAAO,WAAWJ,KAAUI,EAAO,gBAAgB,GACpE,UAAA,gBAAAF;AAAA,IAACG;AAAA,IAAA;AAAA,MACC,WAAWD,EAAO;AAAA,MAClB,UAAQ;AAAA,MACR,MAAK;AAAA,MACL,SAASJ,KAAU;AAAA,MACnB,iBAAiBC;AAAA,MACjB,cACED,IAASM,EAAS,mBAAmB,cAAcA,EAAS,mBAAmB;AAAA,MAGjF,4BAACC,GAAA,CAAA,CAAQ;AAAA,IAAA;AAAA,EAAA,GAEb;AAEJ;ACjBO,SAASC,EAA+B;AAAA,EAC7C,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,gBAAAC;AACF,GAAwC;AACtC,WAASC,EAAuBC,GAAkB;AAChD,IAAAH,EAAmBF,EAAO,IAAIK,CAAO;AAAA,EACvC;AAEA,WAASC,IAAqB;AAC5B,IAAAH,EAAeH,EAAO,IAAI,CAACA,EAAO,MAAM;AAAA,EAC1C;AAIA,SACE,gBAAAO;AAAA,I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AAA,EAAa;AAAA,YACpB,cAAYlC,EAAS,mBAAmB;AAAA,UAAA;AAAA,QAAA;AAAA,MAC1C;AAAA,IAAA;AAAA,IAGJ,gBAAAJ;AAAA,MAACuC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAM;AAAA,QACN,YAAY;AAAA,QACZ,WAAWrC,EAAO;AAAA,QAClB,WAAW+B;AAAA,QAEX,4BAACb,GAAA,CAAA,CAA2B;AAAA,MAAA;AAAA,IAAA;AAAA,EAC9B,GACF;AAEJ;ACrBO,MAAMoB,KAAmCC,EAI9C,sBAAsB,CAACC,OACvBA,EAAQ,aAAa,WAAW;AAAA,EAC9B,IAAI;AAAA,EACJ,WAAWV;AAAA,EACX,OAAO;AAAA,CACR,GAEM,CAAA,EACR;"}
@@ -0,0 +1 @@
1
+ export * from '../components/data-grid/plugins/table-tree/public.js'
@@ -0,0 +1,233 @@
1
+ "use client";
2
+ import { create as G } from "zustand";
3
+ import { u as N, b as F, c as V } from "../chunks/plugins-helpers.js";
4
+ import { jsx as l, jsxs as E } from "react/jsx-runtime";
5
+ import { a as L, D as j, g as $ } from "../chunks/storage-helpers.js";
6
+ import { u as K, D as M } from "../chunks/data-grid-record-context.js";
7
+ import { u as A } from "../chunks/table-context.js";
8
+ import { ChevronDownIcon as O } from "lucide-react";
9
+ import { I as U } from "../chunks/ignore-row-click.js";
10
+ import { Button as q } from "../button.js";
11
+ import { D as B, r as H, a as J } from "../chunks/resolve-body-cell-props.js";
12
+ import { g as k } from "../chunks/row-click-utils.js";
13
+ import { TableRow as Q } from "../table.js";
14
+ import '../chunks/table-tree.DMtpMddS.css';const W = "_treeCellContent_p1inr_1", X = "_expand_p1inr_6", Y = "_expandIcon_p1inr_13", Z = "_expandIconCollapsed_p1inr_18", ee = "_label_p1inr_35", te = "_indentSpacer_p1inr_50", ne = "_toggle_p1inr_65", oe = "_clickableRow_p1inr_120", m = {
15
+ treeCellContent: W,
16
+ expand: X,
17
+ expandIcon: Y,
18
+ expandIconCollapsed: Z,
19
+ label: ee,
20
+ indentSpacer: te,
21
+ toggle: ne,
22
+ clickableRow: oe
23
+ };
24
+ function se() {
25
+ const t = N(), o = K(), r = t.getPlugin("tableTree"), c = r.useIsExpanded(o.id) ? m.expandIcon : `${m.expandIcon} ${m.expandIconCollapsed}`;
26
+ return /* @__PURE__ */ l("div", { className: m.expand, [U]: "", children: /* @__PURE__ */ l(
27
+ q,
28
+ {
29
+ variant: "ghost",
30
+ size: "sm",
31
+ className: m.toggle,
32
+ icon: /* @__PURE__ */ l(O, { className: c }),
33
+ onClick: () => r.toggle(o.id)
34
+ }
35
+ ) });
36
+ }
37
+ function ae({
38
+ column: t,
39
+ item: o
40
+ }) {
41
+ var p;
42
+ const r = N(), d = K(), c = A(), g = r.getPlugin("tableTree"), S = ((p = c.useVisibleColumns()[0]) == null ? void 0 : p.id) === t.id, b = g.useIsExpandable(d), C = g.useLevel(d.section);
43
+ return (b || C > 0) && S ? /* @__PURE__ */ E("div", { className: m.treeCellContent, children: [
44
+ C > 0 && /* @__PURE__ */ l(
45
+ "div",
46
+ {
47
+ className: m.indentSpacer,
48
+ style: { inlineSize: `calc(var(--_data-grid-table-tree-indent) * ${C})` }
49
+ }
50
+ ),
51
+ b && /* @__PURE__ */ l(se, {}),
52
+ /* @__PURE__ */ l("div", { className: m.label, children: /* @__PURE__ */ l(L, { column: t, item: o }) })
53
+ ] }) : /* @__PURE__ */ l(L, { column: t, item: o });
54
+ }
55
+ function re({
56
+ record: t
57
+ }) {
58
+ const o = F(), r = o.table, d = r.useVisibleColumns(), c = r.useTableLayout(), g = o.plugins.getPlugin("tableTree"), f = o.plugins.getPlugin("rowClick"), S = g.useIsExpanded(t.id), b = o.storage.getRecordsByParentId(t.id), C = r.useComponent("body-cell-content"), p = !!f, x = p ? k(t.item, () => f == null ? void 0 : f.click) : void 0, P = p ? k(t.item, () => f == null ? void 0 : f.dblclick) : void 0, T = p ? (i) => {
59
+ i.key === "Enter" && (x == null || x(i));
60
+ } : void 0;
61
+ return /* @__PURE__ */ E(M, { value: t, children: [
62
+ /* @__PURE__ */ E(
63
+ Q,
64
+ {
65
+ className: p ? m.clickableRow : void 0,
66
+ tabIndex: p ? 0 : void 0,
67
+ onClick: x,
68
+ onDoubleClick: P,
69
+ onKeyDown: T,
70
+ children: [
71
+ /* @__PURE__ */ l(B, { position: "start" }),
72
+ d.map((i) => {
73
+ var _;
74
+ const D = (_ = i.getClassName) == null ? void 0 : _.call(i, t.item), R = H(i, t.item, c);
75
+ return /* @__PURE__ */ l(
76
+ J,
77
+ {
78
+ columnId: i.id,
79
+ className: D,
80
+ ...R,
81
+ children: /* @__PURE__ */ l(C, { column: i, item: t.item })
82
+ },
83
+ i.id
84
+ );
85
+ }),
86
+ /* @__PURE__ */ l(B, { position: "end" })
87
+ ]
88
+ }
89
+ ),
90
+ S && b.length > 0 && /* @__PURE__ */ l(j, { records: b })
91
+ ] });
92
+ }
93
+ function de(t, o) {
94
+ const r = /* @__PURE__ */ new Map();
95
+ for (const d of t) {
96
+ const c = $(d, o) ?? null, g = r.get(c);
97
+ g ? g.push(d) : r.set(c, [d]);
98
+ }
99
+ return r;
100
+ }
101
+ const ie = V("tableTree", (t) => {
102
+ const o = G(() => ({
103
+ expandedIds: /* @__PURE__ */ new Set()
104
+ })), r = G(() => ({
105
+ parentKey: void 0,
106
+ expandable: void 0
107
+ })), d = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), g = t.registerPersistentState("tree", {
108
+ schema: { expanded: "object" },
109
+ router: !1
110
+ });
111
+ return t.hook("load:prepare", R), t.hook("load:context", ({ loadContext: e }) => {
112
+ var n;
113
+ return {
114
+ tree: { parentId: ((n = e.tree) == null ? void 0 : n.parentId) ?? null }
115
+ };
116
+ }), t.hook("load:store", _), t.registerComponent("row", re), t.registerComponent("body-cell-content", ae), {
117
+ useIsExpandable: S,
118
+ useIsExpanded: b,
119
+ useLevel: C,
120
+ toggle: p,
121
+ isExpandable: w,
122
+ onPropsChange: f
123
+ };
124
+ function f(e) {
125
+ r.setState({
126
+ parentKey: e.parentKey,
127
+ expandable: e.expandable
128
+ });
129
+ }
130
+ function S(e) {
131
+ const n = r((a) => a.expandable), s = r((a) => a.parentKey);
132
+ return n ? n(e.item) : s ? !!t.getSectionsByParentId(e.id).length : !1;
133
+ }
134
+ function b(e) {
135
+ return o((n) => n.expandedIds.has(e));
136
+ }
137
+ function C(e) {
138
+ const { parentId: n } = e;
139
+ if (!n)
140
+ return 0;
141
+ const s = t.getRecord(n);
142
+ return 1 + (s ? C(s.section) : 0);
143
+ }
144
+ function p(e) {
145
+ const n = o.getState(), s = n.expandedIds.has(e), a = new Set(n.expandedIds);
146
+ s ? a.delete(e) : a.add(e), o.setState({ expandedIds: a }), P(), s || i(e);
147
+ }
148
+ function x() {
149
+ var h;
150
+ const e = (h = g.value) == null ? void 0 : h.expanded, n = Array.isArray(e) ? e.filter((u) => typeof u == "string" || typeof u == "number").slice(-200) : [];
151
+ if (!n.length)
152
+ return;
153
+ const { parentKey: s } = r.getState(), a = new Set(o.getState().expandedIds);
154
+ for (const u of n)
155
+ a.add(u), s || c.add(u);
156
+ o.setState({ expandedIds: a });
157
+ }
158
+ function P() {
159
+ const e = [...o.getState().expandedIds].slice(-200);
160
+ g.setValue({ expanded: e });
161
+ }
162
+ function T(e) {
163
+ if (!c.size)
164
+ return;
165
+ const { expandedIds: n } = o.getState();
166
+ for (const s of e)
167
+ for (const a of s.records)
168
+ !c.delete(a.id) || !n.has(a.id) || (w(a) ? i(a.id) : p(a.id));
169
+ }
170
+ function i(e) {
171
+ if (D(e))
172
+ return;
173
+ t.getSectionsByParentId(e).length || t.triggerLoad({ loadContext: { tree: { parentId: e } } });
174
+ }
175
+ function D(e) {
176
+ return t.getLoadInstances().find((n) => {
177
+ var s;
178
+ return ((s = n.loadContext.tree) == null ? void 0 : s.parentId) === e;
179
+ });
180
+ }
181
+ function R() {
182
+ d.clear();
183
+ for (const e of t.getSections())
184
+ for (const n of e.records)
185
+ o.getState().expandedIds.has(n.id) && d.add(n.id);
186
+ }
187
+ function _(e) {
188
+ var h;
189
+ const { parentKey: n } = r.getState(), s = z((h = e.loadContext.pagination) == null ? void 0 : h.page);
190
+ (e.refresh || s) && t.clearSections(), s && (o.setState({ expandedIds: /* @__PURE__ */ new Set() }), x());
191
+ const a = [];
192
+ if (n) {
193
+ const u = de(e.processResult.results, n);
194
+ for (const [v, I] of u) {
195
+ const y = t.createSection(
196
+ { loadContext: e.loadContext, parentId: v },
197
+ I
198
+ );
199
+ a.push(y);
200
+ }
201
+ } else {
202
+ const u = t.createSection(
203
+ { loadContext: e.loadContext, parentId: e.loadContext.tree.parentId },
204
+ e.processResult.results
205
+ );
206
+ a.push(u);
207
+ }
208
+ if (d.size) {
209
+ const { expandedIds: u } = o.getState(), v = a.flatMap((I) => I.records.filter(
210
+ (y) => d.has(y.id) && w(y) && u.has(y.id)
211
+ ));
212
+ if (v.length)
213
+ for (const I of v)
214
+ d.delete(I.id), i(I.id);
215
+ else
216
+ d.clear();
217
+ }
218
+ return T(a), !0;
219
+ }
220
+ function z(e) {
221
+ var s;
222
+ const n = t.getSectionsByParentId(null);
223
+ return n.length === 0 ? !0 : (e ?? 1) !== (((s = n[0].loadContext.pagination) == null ? void 0 : s.page) ?? 1);
224
+ }
225
+ function w(e) {
226
+ const { expandable: n, parentKey: s } = r.getState();
227
+ return n ? n(e.item) : s ? !!t.getSectionsByParentId(e.id).length : !1;
228
+ }
229
+ }), he = ie;
230
+ export {
231
+ he as DataGridTableTreePlugin
232
+ };
233
+ //# sourceMappingURL=table-tree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-tree.js","sources":["../../src/components/data-grid/plugins/table-tree/components/data-grid-table-tree-expand.tsx","../../src/components/data-grid/plugins/table-tree/components/data-grid-table-tree-body-cell-content.tsx","../../src/components/data-grid/plugins/table-tree/components/data-grid-table-tree-row.tsx","../../src/components/data-grid/plugins/table-tree/table-tree-helpers.ts","../../src/components/data-grid/plugins/table-tree/table-tree-plugin.tsx"],"sourcesContent":["import { ChevronDownIcon } from 'lucide-react';\nimport { Button } from '../../../../button/public.js';\nimport type { DataGridItem } from '../../../data-grid-types';\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 { DataGridTableTreePluginApi } from '../table-tree-types';\nimport styles from './data-grid-table-tree.module.css';\n\nexport function DataGridTableTreeExpand<TItem extends DataGridItem>() {\n const grid = useDataGrid<TItem>();\n const record = useDataGridRecord<TItem>();\n const treePlugin = grid.getPlugin<DataGridTableTreePluginApi<TItem>>('tableTree')!;\n const isExpanded = treePlugin.useIsExpanded(record.id);\n\n const iconClassName = isExpanded\n ? styles.expandIcon\n : `${styles.expandIcon} ${styles.expandIconCollapsed}`;\n\n return (\n <div className={styles.expand} {...{ [IGNORE_CLICK_ATTRIBUTE]: '' }}>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className={styles.toggle}\n icon={<ChevronDownIcon className={iconClassName} />}\n onClick={() => treePlugin.toggle(record.id)}\n />\n </div>\n );\n}\n","import type { DataGridItem } from '../../../data-grid-types';\nimport { useDataGrid } from '../../../services/core/data-grid-context';\nimport { DataGridBodyCellContent } from '../../../services/table/components/data-grid-body-cell-content';\nimport { useDataGridRecord } from '../../../services/table/data-grid-record-context';\nimport { useTableService } from '../../../services/table/table-context';\nimport type { DataGridTableColumn } from '../../../services/table/table-types';\nimport type { DataGridTableTreePluginApi } from '../table-tree-types';\nimport { DataGridTableTreeExpand } from './data-grid-table-tree-expand';\nimport styles from './data-grid-table-tree.module.css';\n\ninterface DataGridTableTreeBodyCellContentProps<TItem extends DataGridItem> {\n column: DataGridTableColumn<TItem>;\n item: TItem;\n}\n\nexport function DataGridTableTreeBodyCellContent<TItem extends DataGridItem>({\n column,\n item,\n}: DataGridTableTreeBodyCellContentProps<TItem>) {\n const grid = useDataGrid<TItem>();\n const record = useDataGridRecord<TItem>();\n const tableService = useTableService<TItem>();\n const treePlugin = grid.getPlugin<DataGridTableTreePluginApi<TItem>>('tableTree')!;\n const visibleColumns = tableService.useVisibleColumns();\n const isFirstColumn = visibleColumns[0]?.id === column.id;\n const isExpandable = treePlugin.useIsExpandable(record);\n const level = treePlugin.useLevel(record.section);\n\n if ((isExpandable || level > 0) && isFirstColumn) {\n return (\n <div className={styles.treeCellContent}>\n {level > 0 && (\n <div\n className={styles.indentSpacer}\n style={{ inlineSize: `calc(var(--_data-grid-table-tree-indent) * ${level})` }}\n />\n )}\n {isExpandable && <DataGridTableTreeExpand />}\n <div className={styles.label}>\n <DataGridBodyCellContent column={column} item={item} />\n </div>\n </div>\n );\n }\n\n return <DataGridBodyCellContent column={column} item={item} />;\n}\n","import type { KeyboardEvent } from 'react';\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 { DataGridTableRecords } from '../../../services/table/components/data-grid-table-records';\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 type { DataGridRowClickPluginApi } from '../../row-click/row-click-plugin';\nimport { getClickListener } from '../../row-click/row-click-utils';\nimport type { DataGridTableTreePluginApi } from '../table-tree-types';\nimport styles from './data-grid-table-tree.module.css';\n\ninterface DataGridTableTreeRowProps<TItem extends DataGridItem> {\n record: DataGridRecord<TItem>;\n}\n\nexport function DataGridTableTreeRow<TItem extends DataGridItem>({\n record,\n}: DataGridTableTreeRowProps<TItem>) {\n const context = useDataGridContext<TItem>();\n const tableService = context.table;\n const columns = tableService.useVisibleColumns();\n const tableLayout = tableService.useTableLayout();\n const treePlugin = context.plugins.getPlugin<DataGridTableTreePluginApi<TItem>>('tableTree')!;\n const rowClickApi = context.plugins.getPlugin<DataGridRowClickPluginApi<TItem>>('rowClick');\n const isExpanded = treePlugin.useIsExpanded(record.id);\n const childRecords = context.storage.getRecordsByParentId(record.id);\n\n const BodyCellContent = tableService.useComponent<{\n column: DataGridTableColumn<TItem>;\n item: TItem;\n }>('body-cell-content');\n\n // This row replaces the row-click plugin's, so it has to do what that row does when the plugin\n // is registered.\n const hasRowClick = !!rowClickApi;\n const onClick = hasRowClick ? getClickListener(record.item, () => rowClickApi?.click) : undefined;\n const onDblClick = hasRowClick\n ? getClickListener(record.item, () => rowClickApi?.dblclick)\n : undefined;\n const onKeyDown = hasRowClick\n ? (event: KeyboardEvent) => {\n if (event.key === 'Enter') {\n onClick?.(event);\n }\n }\n : undefined;\n\n return (\n <DataGridRecordProvider value={record}>\n <TableRow\n className={hasRowClick ? styles.clickableRow : undefined}\n tabIndex={hasRowClick ? 0 : undefined}\n onClick={onClick}\n onDoubleClick={onDblClick}\n onKeyDown={onKeyDown}\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 {isExpanded && childRecords.length > 0 && (\n <DataGridTableRecords<TItem> records={childRecords} />\n )}\n </DataGridRecordProvider>\n );\n}\n","import type { DataGridItem } from '../../data-grid-types';\nimport { getItemKeyValue } from '../../services/storage/storage-helpers';\nimport type { DataGridDataKey, DataGridParentId } from '../../services/storage/storage-types';\n\nexport function createTreeDataFromFlattenedArray<TItem extends DataGridItem = DataGridItem>(\n items: TItem[],\n parentKey: DataGridDataKey<TItem>,\n): Map<DataGridParentId, TItem[]> {\n const results = new Map<DataGridParentId, TItem[]>();\n\n for (const item of items) {\n const parentId = getItemKeyValue(item, parentKey) ?? null;\n const group = results.get(parentId);\n if (group) {\n group.push(item);\n } else {\n results.set(parentId, [item]);\n }\n }\n\n return results;\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 type { ReactNode } from 'react';\nimport { create } from 'zustand';\n// `.js` on each relative type import: they land verbatim in the shipped declaration file, where\n// `moduleResolution: \"nodenext\"` rejects an extensionless one and every type from it goes untyped\n// (the `expandable` callback's `item` among them).\nimport type { DataGridItem } from '../../data-grid-types.js';\nimport type { LoadInstance } from '../../services/load/load-types.js';\nimport { createDataGridPlugin } from '../../services/plugins/plugins-helpers';\nimport type {\n DataGridItemId,\n DataGridRecord,\n DataGridSection,\n} from '../../services/storage/storage-types.js';\nimport { DataGridTableTreeBodyCellContent } from './components/data-grid-table-tree-body-cell-content';\nimport { DataGridTableTreeRow } from './components/data-grid-table-tree-row';\nimport { createTreeDataFromFlattenedArray } from './table-tree-helpers';\nimport type {\n DataGridTableTreePluginApi,\n DataGridTableTreePluginConfig,\n TableTreeConfigStore,\n TableTreePersistentState,\n TableTreeStore,\n} from './table-tree-types.js';\n\n// Ids from every visited page accumulate in the stored list (a row that is not\n// on screen cannot be collapsed), and rows deleted server-side never come back\n// to be collapsed either — so the list is bounded, dropping the oldest first.\nconst maxPersistedExpandedIds = 200;\n\nconst DataGridTableTreePluginRaw = createDataGridPlugin<\n DataGridItem,\n 'tableTree',\n DataGridTableTreePluginConfig,\n DataGridTableTreePluginApi\n>('tableTree', (context) => {\n const useTreeStore = create<TableTreeStore>(() => ({\n expandedIds: new Set(),\n }));\n\n const useConfigStore = create<TableTreeConfigStore>(() => ({\n parentKey: undefined,\n expandable: undefined,\n }));\n\n const resetIds = new Set<DataGridItemId>();\n // One-shot work queue, not observable state: ids restored from storage whose\n // children still need a lazy load. A restored id alone cannot tell whether the\n // row exists or is expandable, so the load waits until its record arrives.\n const restoredIds = new Set<DataGridItemId>();\n // Expand state is stored next to the page, filters and order, under whichever\n // backend the grid was configured with — except the URL: the list grows to the\n // persistence cap and keeps ids of rows deleted server-side, and every copied\n // URL would seed all of that into whichever grid opens the link.\n const persistentState = context.registerPersistentState<TableTreePersistentState>('tree', {\n schema: { expanded: 'object' },\n router: false,\n });\n\n context.hook('load:prepare', onBeforeLoad);\n context.hook('load:context', ({ loadContext }) => ({\n tree: { parentId: loadContext.tree?.parentId ?? null },\n }));\n context.hook('load:store', onLoadStore);\n context.registerComponent('row', DataGridTableTreeRow);\n context.registerComponent('body-cell-content', DataGridTableTreeBodyCellContent);\n\n return {\n useIsExpandable,\n useIsExpanded,\n useLevel: getLevel,\n toggle,\n isExpandable,\n onPropsChange,\n };\n\n function onPropsChange(props: DataGridTableTreePluginConfig) {\n useConfigStore.setState({\n parentKey: props.parentKey,\n expandable: props.expandable,\n });\n }\n\n function useIsExpandable(record: DataGridRecord): boolean {\n const expandable = useConfigStore((s) => s.expandable);\n const parentKey = useConfigStore((s) => s.parentKey);\n\n if (expandable) {\n return expandable(record.item);\n }\n\n if (parentKey) {\n return !!context.getSectionsByParentId(record.id).length;\n }\n\n return false;\n }\n\n function useIsExpanded(itemId: DataGridItemId): boolean {\n return useTreeStore((s) => s.expandedIds.has(itemId));\n }\n\n function getLevel(section: DataGridSection<DataGridItem>): number {\n const { parentId } = section;\n\n if (!parentId) {\n return 0;\n }\n\n const parentRecord = context.getRecord(parentId);\n return 1 + (parentRecord ? getLevel(parentRecord.section) : 0);\n }\n\n function toggle(itemId: DataGridItemId) {\n const state = useTreeStore.getState();\n const isCurrentlyExpanded = state.expandedIds.has(itemId);\n\n const newExpandedIds = new Set(state.expandedIds);\n if (isCurrentlyExpanded) {\n newExpandedIds.delete(itemId);\n } else {\n newExpandedIds.add(itemId);\n }\n useTreeStore.setState({ expandedIds: newExpandedIds });\n syncPersistent();\n\n if (!isCurrentlyExpanded) {\n triggerLoadChildren(itemId);\n }\n }\n\n // --- Private helpers ---\n\n function seedFromPersistent() {\n // Storage is user-editable, so the value is narrowed to the id type\n // instead of being trusted as-is, and capped the same way the write side\n // caps it — the plugin itself never stores more, so an oversized list is\n // external. The slice keeps the tail: storage order is oldest-first.\n const stored = persistentState.value?.expanded;\n const expanded = Array.isArray(stored)\n ? stored\n .filter((id): id is DataGridItemId => typeof id === 'string' || typeof id === 'number')\n .slice(-maxPersistedExpandedIds)\n : [];\n if (!expanded.length) {\n return;\n }\n\n const { parentKey } = useConfigStore.getState();\n const expandedIds = new Set(useTreeStore.getState().expandedIds);\n\n for (const id of expanded) {\n expandedIds.add(id);\n if (!parentKey) {\n restoredIds.add(id);\n }\n }\n\n useTreeStore.setState({ expandedIds });\n }\n\n function syncPersistent() {\n // Writes the whole object rather than a delta, because the accessor stores\n // whatever it is given: a partial write would drop the ids it omits. The\n // empty list is written too, so a fully collapsed hierarchy is stored as\n // such instead of as an absent entry. Set iterates in insertion order —\n // seeded ids first, fresh toggles last — so the slice drops the oldest.\n const expanded = [...useTreeStore.getState().expandedIds].slice(-maxPersistedExpandedIds);\n persistentState.setValue({ expanded });\n }\n\n // Drains the restored ids against sections that have just been stored,\n // starting a children load only for rows that actually arrived.\n function loadRestoredChildren(sections: DataGridSection<DataGridItem>[]) {\n if (!restoredIds.size) {\n return;\n }\n\n const { expandedIds } = useTreeStore.getState();\n\n for (const section of sections) {\n for (const record of section.records) {\n if (!restoredIds.delete(record.id) || !expandedIds.has(record.id)) {\n continue;\n }\n\n if (isExpandable(record)) {\n triggerLoadChildren(record.id);\n } else {\n // The row arrived and cannot be expanded, so the stored id is dropped\n // instead of leaving the row marked expanded with nothing under it.\n toggle(record.id);\n }\n }\n }\n }\n\n function triggerLoadChildren(parentId: DataGridItemId) {\n const loadInstance = findLoadInstance(parentId);\n if (loadInstance) {\n return;\n }\n\n const loadedSections = context.getSectionsByParentId(parentId);\n if (!loadedSections.length) {\n context.triggerLoad({ loadContext: { tree: { parentId } } });\n }\n }\n\n function findLoadInstance(parentId: DataGridItemId) {\n return context\n .getLoadInstances()\n .find((instance) => instance.loadContext.tree?.parentId === parentId);\n }\n\n function onBeforeLoad() {\n resetIds.clear();\n\n for (const section of context.getSections()) {\n for (const record of section.records) {\n if (useTreeStore.getState().expandedIds.has(record.id)) {\n resetIds.add(record.id);\n }\n }\n }\n }\n\n function onLoadStore(instance: LoadInstance<DataGridItem>) {\n const { parentKey } = useConfigStore.getState();\n const pageChanged = isPageChanged(instance.loadContext.pagination?.page);\n\n if (instance.refresh || pageChanged) {\n context.clearSections();\n }\n if (pageChanged) {\n // Two cases reach this branch, and the reseed serves both.\n //\n // A real page change: the in-memory expansion belongs to the page being\n // left, so it is reset, but the stored ids are kept and re-applied. A row\n // expanded on page 1 is expanded again when the user comes back to it, and\n // ids belonging to other pages sit in the set harmlessly, because children\n // load only for records that arrived and pass isExpandable.\n //\n // The very first load, where isPageChanged() is also true because no root\n // section exists yet: here the reset would erase the state just restored\n // from storage, so it has to be seeded again.\n useTreeStore.setState({ expandedIds: new Set() });\n seedFromPersistent();\n }\n\n const newSections: DataGridSection<DataGridItem>[] = [];\n\n if (parentKey) {\n const results = createTreeDataFromFlattenedArray(instance.processResult!.results, parentKey);\n\n for (const [parentId, items] of results) {\n const newSection = context.createSection(\n { loadContext: instance.loadContext, parentId },\n items,\n );\n newSections.push(newSection);\n }\n } else {\n const newSection = context.createSection(\n { loadContext: instance.loadContext, parentId: instance.loadContext.tree!.parentId },\n instance.processResult!.results,\n );\n newSections.push(newSection);\n }\n\n if (resetIds.size) {\n const { expandedIds } = useTreeStore.getState();\n const toLoadRecords = newSections.flatMap((section) => {\n return section.records.filter(\n (record) => resetIds.has(record.id) && isExpandable(record) && expandedIds.has(record.id),\n );\n });\n\n if (toLoadRecords.length) {\n for (const record of toLoadRecords) {\n resetIds.delete(record.id);\n triggerLoadChildren(record.id);\n }\n } else {\n resetIds.clear();\n }\n }\n\n loadRestoredChildren(newSections);\n\n return true;\n }\n\n function isPageChanged(newPage?: number) {\n const sections = context.getSectionsByParentId(null);\n return sections.length === 0\n ? true\n : (newPage ?? 1) !== (sections[0].loadContext.pagination?.page ?? 1);\n }\n\n function isExpandable(record: DataGridRecord): boolean {\n const { expandable, parentKey } = useConfigStore.getState();\n\n if (expandable) {\n return expandable(record.item);\n }\n\n if (parentKey) {\n return !!context.getSectionsByParentId(record.id).length;\n }\n\n return false;\n }\n});\n\n// The plugin is built for the base item type; the cast hands the consumer a generic component, so\n// `<DataGridTableTreePlugin<Category> parentKey=\"parent_id\" />` types `parentKey` and `expandable`\n// against the consumer's item.\nexport const DataGridTableTreePlugin = DataGridTableTreePluginRaw as <\n TItem extends DataGridItem = DataGridItem,\n>(\n props: DataGridTableTreePluginConfig<TItem>,\n) => ReactNode;\n"],"names":["DataGridTableTreeExpand","grid","useDataGrid","record","useDataGridRecord","treePlugin","iconClassName","styles","jsx","IGNORE_CLICK_ATTRIBUTE","Button","ChevronDownIcon","DataGridTableTreeBodyCellContent","column","item","tableService","useTableService","isFirstColumn","_a","isExpandable","level","jsxs","DataGridBodyCellContent","DataGridTableTreeRow","context","useDataGridContext","columns","tableLayout","rowClickApi","isExpanded","childRecords","BodyCellContent","hasRowClick","onClick","getClickListener","onDblClick","onKeyDown","event","DataGridRecordProvider","TableRow","DataGridExtraBodyColumns","col","dynamicClassName","bodyCellProps","resolveBodyCellProps","DataGridCell","DataGridTableRecords","createTreeDataFromFlattenedArray","items","parentKey","results","parentId","getItemKeyValue","group","DataGridTableTreePluginRaw","createDataGridPlugin","useTreeStore","create","useConfigStore","resetIds","restoredIds","persistentState","onBeforeLoad","loadContext","onLoadStore","useIsExpandable","useIsExpanded","getLevel","toggle","onPropsChange","props","expandable","s","itemId","section","parentRecord","state","isCurrentlyExpanded","newExpandedIds","syncPersistent","triggerLoadChildren","seedFromPersistent","stored","expanded","id","expandedIds","loadRestoredChildren","sections","findLoadInstance","instance","pageChanged","isPageChanged","newSections","newSection","toLoadRecords","newPage","DataGridTableTreePlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AASO,SAASA,KAAsD;AACpE,QAAMC,IAAOC,EAAA,GACPC,IAASC,EAAA,GACTC,IAAaJ,EAAK,UAA6C,WAAW,GAG1EK,IAFaD,EAAW,cAAcF,EAAO,EAAE,IAGjDI,EAAO,aACP,GAAGA,EAAO,UAAU,IAAIA,EAAO,mBAAmB;AAEtD,SACE,gBAAAC,EAAC,OAAA,EAAI,WAAWD,EAAO,QAAc,CAACE,CAAsB,GAAG,IAC7D,UAAA,gBAAAD;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,WAAWH,EAAO;AAAA,MAClB,MAAM,gBAAAC,EAACG,GAAA,EAAgB,WAAWL,EAAA,CAAe;AAAA,MACjD,SAAS,MAAMD,EAAW,OAAOF,EAAO,EAAE;AAAA,IAAA;AAAA,EAAA,GAE9C;AAEJ;ACfO,SAASS,GAA6D;AAAA,EAC3E,QAAAC;AAAA,EACA,MAAAC;AACF,GAAiD;;AAC/C,QAAMb,IAAOC,EAAA,GACPC,IAASC,EAAA,GACTW,IAAeC,EAAA,GACfX,IAAaJ,EAAK,UAA6C,WAAW,GAE1EgB,MAAgBC,IADCH,EAAa,kBAAA,EACC,CAAC,MAAhB,gBAAAG,EAAmB,QAAOL,EAAO,IACjDM,IAAed,EAAW,gBAAgBF,CAAM,GAChDiB,IAAQf,EAAW,SAASF,EAAO,OAAO;AAEhD,UAAKgB,KAAgBC,IAAQ,MAAMH,IAE/B,gBAAAI,EAAC,OAAA,EAAI,WAAWd,EAAO,iBACpB,UAAA;AAAA,IAAAa,IAAQ,KACP,gBAAAZ;AAAA,MAAC;AAAA,MAAA;AAAA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