@restio/ui 0.0.8-SNAPSHOT → 0.0.9-SNAPSHOT
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/components/anchored-overlay/anchored-overlay-types.d.ts +1 -1
- package/dist/components/anchored-overlay/anchored-overlay-types.js +2 -0
- package/dist/components/anchored-overlay/anchored-overlay-types.js.map +1 -0
- package/dist/components/anchored-overlay/anchored-overlay.d.ts +2 -2
- package/dist/components/anchored-overlay/anchored-overlay.js +67 -0
- package/dist/components/anchored-overlay/anchored-overlay.js.map +1 -0
- package/dist/components/banner/banner-types.d.ts +1 -1
- package/dist/components/banner/banner-types.js +2 -0
- package/dist/components/banner/banner-types.js.map +1 -0
- package/dist/components/banner/banner.d.ts +2 -2
- package/dist/components/banner/banner.js +29 -0
- package/dist/components/banner/banner.js.map +1 -0
- package/dist/components/button/button-types.d.ts +1 -1
- package/dist/components/button/button-types.js +2 -0
- package/dist/components/button/button-types.js.map +1 -0
- package/dist/components/button/button.d.ts +2 -2
- package/dist/components/button/button.js +20 -0
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/button-group/button-group-types.js +2 -0
- package/dist/components/button-group/button-group-types.js.map +1 -0
- package/dist/components/button-group/button-group.d.ts +2 -2
- package/dist/components/button-group/button-group.js +16 -0
- package/dist/components/button-group/button-group.js.map +1 -0
- package/dist/components/checkbox/checkbox-types.d.ts +1 -1
- package/dist/components/checkbox/checkbox-types.js +2 -0
- package/dist/components/checkbox/checkbox-types.js.map +1 -0
- package/dist/components/checkbox/checkbox.d.ts +2 -2
- package/dist/components/checkbox/checkbox.js +19 -0
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/code-block/code-block.d.ts +1 -1
- package/dist/components/code-block/code-block.js +9 -0
- package/dist/components/code-block/code-block.js.map +1 -0
- package/dist/components/file-upload/file-upload-types.d.ts +1 -1
- package/dist/components/file-upload/file-upload-types.js +2 -0
- package/dist/components/file-upload/file-upload-types.js.map +1 -0
- package/dist/components/file-upload/file-upload-utils.js +10 -0
- package/dist/components/file-upload/file-upload-utils.js.map +1 -0
- package/dist/components/file-upload/file-upload.d.ts +2 -2
- package/dist/components/file-upload/file-upload.js +106 -0
- package/dist/components/file-upload/file-upload.js.map +1 -0
- package/dist/components/graph/graph-types.js +2 -0
- package/dist/components/graph/graph-types.js.map +1 -0
- package/dist/components/graph/graph.d.ts +1 -1
- package/dist/components/graph/graph.js +21 -0
- package/dist/components/graph/graph.js.map +1 -0
- package/dist/components/input/date/date-calendar.d.ts +2 -2
- package/dist/components/input/date/date-calendar.js +114 -0
- package/dist/components/input/date/date-calendar.js.map +1 -0
- package/dist/components/input/date/date-input-field.d.ts +2 -2
- package/dist/components/input/date/date-input-field.js +61 -0
- package/dist/components/input/date/date-input-field.js.map +1 -0
- package/dist/components/input/date/date-picker.d.ts +2 -2
- package/dist/components/input/date/date-picker.js +35 -0
- package/dist/components/input/date/date-picker.js.map +1 -0
- package/dist/components/input/date/date-range-input-field.d.ts +2 -2
- package/dist/components/input/date/date-range-input-field.js +90 -0
- package/dist/components/input/date/date-range-input-field.js.map +1 -0
- package/dist/components/input/date/date-range-picker.d.ts +2 -2
- package/dist/components/input/date/date-range-picker.js +74 -0
- package/dist/components/input/date/date-range-picker.js.map +1 -0
- package/dist/components/input/date/date-shortcuts.d.ts +2 -2
- package/dist/components/input/date/date-shortcuts.js +47 -0
- package/dist/components/input/date/date-shortcuts.js.map +1 -0
- package/dist/components/input/date/date-types.d.ts +1 -1
- package/dist/components/input/date/date-types.js +2 -0
- package/dist/components/input/date/date-types.js.map +1 -0
- package/dist/components/input/date/date-utils.d.ts +1 -1
- package/dist/components/input/date/date-utils.js +203 -0
- package/dist/components/input/date/date-utils.js.map +1 -0
- package/dist/components/input/input-types.js +2 -0
- package/dist/components/input/input-types.js.map +1 -0
- package/dist/components/input/input.d.ts +2 -2
- package/dist/components/input/input.js +14 -0
- package/dist/components/input/input.js.map +1 -0
- package/dist/components/input/number/input-number-types.d.ts +1 -1
- package/dist/components/input/number/input-number-types.js +2 -0
- package/dist/components/input/number/input-number-types.js.map +1 -0
- package/dist/components/input/number/input-number.d.ts +2 -2
- package/dist/components/input/number/input-number.js +11 -0
- package/dist/components/input/number/input-number.js.map +1 -0
- package/dist/components/input/text/input-text-types.d.ts +1 -1
- package/dist/components/input/text/input-text-types.js +2 -0
- package/dist/components/input/text/input-text-types.js.map +1 -0
- package/dist/components/input/text/input-text.d.ts +2 -2
- package/dist/components/input/text/input-text.js +8 -0
- package/dist/components/input/text/input-text.js.map +1 -0
- package/dist/components/kbd/kbd-types.js +2 -0
- package/dist/components/kbd/kbd-types.js.map +1 -0
- package/dist/components/kbd/kbd.d.ts +2 -2
- package/dist/components/kbd/kbd.js +12 -0
- package/dist/components/kbd/kbd.js.map +1 -0
- package/dist/components/kbd-group/kbd-group-types.js +2 -0
- package/dist/components/kbd-group/kbd-group-types.js.map +1 -0
- package/dist/components/kbd-group/kbd-group.d.ts +2 -2
- package/dist/components/kbd-group/kbd-group.js +15 -0
- package/dist/components/kbd-group/kbd-group.js.map +1 -0
- package/dist/components/list/list-types.d.ts +1 -1
- package/dist/components/list/list-types.js +2 -0
- package/dist/components/list/list-types.js.map +1 -0
- package/dist/components/list/list-utils.d.ts +4 -4
- package/dist/components/list/list-utils.js +73 -0
- package/dist/components/list/list-utils.js.map +1 -0
- package/dist/components/list/list.d.ts +1 -1
- package/dist/components/list/list.js +68 -0
- package/dist/components/list/list.js.map +1 -0
- package/dist/components/menu/anchored-navigation-menu.d.ts +3 -3
- package/dist/components/menu/anchored-navigation-menu.js +48 -0
- package/dist/components/menu/anchored-navigation-menu.js.map +1 -0
- package/dist/components/menu/menu-assets.d.ts +1 -1
- package/dist/components/menu/menu-assets.js +35 -0
- package/dist/components/menu/menu-assets.js.map +1 -0
- package/dist/components/menu/menu-types.d.ts +2 -2
- package/dist/components/menu/menu-types.js +2 -0
- package/dist/components/menu/menu-types.js.map +1 -0
- package/dist/components/menu/menu.d.ts +2 -2
- package/dist/components/menu/menu.js +86 -0
- package/dist/components/menu/menu.js.map +1 -0
- package/dist/components/otp/otp-types.js +2 -0
- package/dist/components/otp/otp-types.js.map +1 -0
- package/dist/components/otp/otp-utils.js +22 -0
- package/dist/components/otp/otp-utils.js.map +1 -0
- package/dist/components/otp/otp.d.ts +3 -2
- package/dist/components/otp/otp.js +85 -0
- package/dist/components/otp/otp.js.map +1 -0
- package/dist/components/select/select-types.d.ts +1 -1
- package/dist/components/select/select-types.js +2 -0
- package/dist/components/select/select-types.js.map +1 -0
- package/dist/components/select/select.d.ts +2 -2
- package/dist/components/select/select.js +52 -0
- package/dist/components/select/select.js.map +1 -0
- package/dist/components/tag/tag-types.d.ts +1 -1
- package/dist/components/tag/tag-types.js +2 -0
- package/dist/components/tag/tag-types.js.map +1 -0
- package/dist/components/tag/tag.d.ts +2 -2
- package/dist/components/tag/tag.js +16 -0
- package/dist/components/tag/tag.js.map +1 -0
- package/dist/components/textarea/textarea-types.d.ts +2 -2
- package/dist/components/textarea/textarea-types.js +2 -0
- package/dist/components/textarea/textarea-types.js.map +1 -0
- package/dist/components/textarea/textarea.d.ts +2 -2
- package/dist/components/textarea/textarea.js +19 -0
- package/dist/components/textarea/textarea.js.map +1 -0
- package/dist/components/toast-group/toast-group-types.d.ts +1 -1
- package/dist/components/toast-group/toast-group-types.js +2 -0
- package/dist/components/toast-group/toast-group-types.js.map +1 -0
- package/dist/components/toast-group/toast-group.d.ts +2 -2
- package/dist/components/toast-group/toast-group.js +25 -0
- package/dist/components/toast-group/toast-group.js.map +1 -0
- package/dist/components/typography/typography-types.d.ts +1 -1
- package/dist/components/typography/typography-types.js +11 -0
- package/dist/components/typography/typography-types.js.map +1 -0
- package/dist/components/typography/typography.d.ts +2 -2
- package/dist/components/typography/typography.js +17 -0
- package/dist/components/typography/typography.js.map +1 -0
- package/dist/custom-components/chat/chat-types.d.ts +1 -1
- package/dist/custom-components/chat/chat-types.js +2 -0
- package/dist/custom-components/chat/chat-types.js.map +1 -0
- package/dist/custom-components/chat/chat.d.ts +1 -1
- package/dist/custom-components/chat/chat.js +14 -0
- package/dist/custom-components/chat/chat.js.map +1 -0
- package/dist/custom-components/layout/layout-types.js +2 -0
- package/dist/custom-components/layout/layout-types.js.map +1 -0
- package/dist/custom-components/layout/layout.d.ts +2 -2
- package/dist/custom-components/layout/layout.js +46 -0
- package/dist/custom-components/layout/layout.js.map +1 -0
- package/dist/custom-components/layout-builder/layout-builder-constants.js +25 -0
- package/dist/custom-components/layout-builder/layout-builder-constants.js.map +1 -0
- package/dist/custom-components/layout-builder/layout-builder-schema.js +169 -0
- package/dist/custom-components/layout-builder/layout-builder-schema.js.map +1 -0
- package/dist/custom-components/layout-builder/layout-builder-templates.js +206 -0
- package/dist/custom-components/layout-builder/layout-builder-templates.js.map +1 -0
- package/dist/custom-components/layout-builder/layout-builder-types.js +2 -0
- package/dist/custom-components/layout-builder/layout-builder-types.js.map +1 -0
- package/dist/custom-components/layout-builder/layout-builder-utils.js +251 -0
- package/dist/custom-components/layout-builder/layout-builder-utils.js.map +1 -0
- package/dist/custom-components/layout-builder/layout-builder-validation.d.ts +8 -2
- package/dist/custom-components/layout-builder/layout-builder-validation.js +445 -0
- package/dist/custom-components/layout-builder/layout-builder-validation.js.map +1 -0
- package/dist/custom-components/layout-builder/layout-builder.d.ts +2 -2
- package/dist/custom-components/layout-builder/layout-builder.js +908 -0
- package/dist/custom-components/layout-builder/layout-builder.js.map +1 -0
- package/dist/custom-components/layout-builder/layout-json-editor-types.d.ts +1 -1
- package/dist/custom-components/layout-builder/layout-json-editor-types.js +2 -0
- package/dist/custom-components/layout-builder/layout-json-editor-types.js.map +1 -0
- package/dist/custom-components/layout-builder/layout-json-editor.d.ts +2 -2
- package/dist/custom-components/layout-builder/layout-json-editor.js +103 -0
- package/dist/custom-components/layout-builder/layout-json-editor.js.map +1 -0
- package/dist/custom-components/layout-builder/stories/hooks/useHistory.js +100 -0
- package/dist/custom-components/layout-builder/stories/hooks/useHistory.js.map +1 -0
- package/dist/custom-components/markdown/markdown-types.d.ts +3 -3
- package/dist/custom-components/markdown/markdown-types.js +2 -0
- package/dist/custom-components/markdown/markdown-types.js.map +1 -0
- package/dist/custom-components/markdown/markdown-utils.js +10 -0
- package/dist/custom-components/markdown/markdown-utils.js.map +1 -0
- package/dist/custom-components/markdown/markdown.d.ts +2 -2
- package/dist/custom-components/markdown/markdown.js +39 -0
- package/dist/custom-components/markdown/markdown.js.map +1 -0
- package/dist/custom-components/mindmap/index.d.ts +2 -2
- package/dist/custom-components/mindmap/index.js +2 -0
- package/dist/custom-components/mindmap/index.js.map +1 -0
- package/dist/custom-components/mindmap/mind-tree-types.d.ts +1 -1
- package/dist/custom-components/mindmap/mind-tree-types.js +2 -0
- package/dist/custom-components/mindmap/mind-tree-types.js.map +1 -0
- package/dist/custom-components/mindmap/mind-tree.d.ts +1 -1
- package/dist/custom-components/mindmap/mind-tree.js +201 -0
- package/dist/custom-components/mindmap/mind-tree.js.map +1 -0
- package/dist/custom-components/mindmap/reingold-tilford-algorithm.d.ts +1 -1
- package/dist/custom-components/mindmap/reingold-tilford-algorithm.js +277 -0
- package/dist/custom-components/mindmap/reingold-tilford-algorithm.js.map +1 -0
- package/dist/custom-components/shortcut-tooltip/shortcut-tooltip-types.js +2 -0
- package/dist/custom-components/shortcut-tooltip/shortcut-tooltip-types.js.map +1 -0
- package/dist/custom-components/shortcut-tooltip/shortcut-tooltip.d.ts +2 -2
- package/dist/custom-components/shortcut-tooltip/shortcut-tooltip.js +32 -0
- package/dist/custom-components/shortcut-tooltip/shortcut-tooltip.js.map +1 -0
- package/dist/custom-components/timeline/skeleton/timeline-skeleton.d.ts +1 -1
- package/dist/custom-components/timeline/skeleton/timeline-skeleton.js +19 -0
- package/dist/custom-components/timeline/skeleton/timeline-skeleton.js.map +1 -0
- package/dist/custom-components/timeline/timeline-types.js +2 -0
- package/dist/custom-components/timeline/timeline-types.js.map +1 -0
- package/dist/custom-components/timeline/timeline.d.ts +2 -2
- package/dist/custom-components/timeline/timeline.js +64 -0
- package/dist/custom-components/timeline/timeline.js.map +1 -0
- package/dist/custom-components/workflow/layout/workflow-edge.d.ts +1 -1
- package/dist/custom-components/workflow/layout/workflow-edge.js +31 -0
- package/dist/custom-components/workflow/layout/workflow-edge.js.map +1 -0
- package/dist/custom-components/workflow/layout/workflow-layout-types.d.ts +1 -1
- package/dist/custom-components/workflow/layout/workflow-layout-types.js +2 -0
- package/dist/custom-components/workflow/layout/workflow-layout-types.js.map +1 -0
- package/dist/custom-components/workflow/layout/workflow-layout.d.ts +2 -2
- package/dist/custom-components/workflow/layout/workflow-layout.js +284 -0
- package/dist/custom-components/workflow/layout/workflow-layout.js.map +1 -0
- package/dist/custom-components/workflow/node/workflow-node.d.ts +1 -1
- package/dist/custom-components/workflow/node/workflow-node.js +22 -0
- package/dist/custom-components/workflow/node/workflow-node.js.map +1 -0
- package/dist/custom-components/workflow/panel/workflow-panel-types.d.ts +1 -1
- package/dist/custom-components/workflow/panel/workflow-panel-types.js +2 -0
- package/dist/custom-components/workflow/panel/workflow-panel-types.js.map +1 -0
- package/dist/custom-components/workflow/panel/workflow-panel.d.ts +1 -1
- package/dist/custom-components/workflow/panel/workflow-panel.js +53 -0
- package/dist/custom-components/workflow/panel/workflow-panel.js.map +1 -0
- package/dist/custom-components/workflow/toolbar/workflow-toolbar-types.js +2 -0
- package/dist/custom-components/workflow/toolbar/workflow-toolbar-types.js.map +1 -0
- package/dist/custom-components/workflow/toolbar/workflow-toolbar.d.ts +1 -1
- package/dist/custom-components/workflow/toolbar/workflow-toolbar.js +19 -0
- package/dist/custom-components/workflow/toolbar/workflow-toolbar.js.map +1 -0
- package/dist/custom-components/workflow/utils/workflow-validation.d.ts +2 -2
- package/dist/custom-components/workflow/utils/workflow-validation.js +257 -0
- package/dist/custom-components/workflow/utils/workflow-validation.js.map +1 -0
- package/dist/custom-components/workflow/workflow-types.d.ts +3 -3
- package/dist/custom-components/workflow/workflow-types.js +2 -0
- package/dist/custom-components/workflow/workflow-types.js.map +1 -0
- package/dist/custom-components/workflow/workflow.d.ts +1 -1
- package/dist/custom-components/workflow/workflow.js +125 -0
- package/dist/custom-components/workflow/workflow.js.map +1 -0
- package/dist/data-components/assets/data-components-asset.js +2 -0
- package/dist/data-components/assets/data-components-asset.js.map +1 -0
- package/dist/data-components/calendar/calendar-types.d.ts +1 -1
- package/dist/data-components/calendar/calendar-types.js +2 -0
- package/dist/data-components/calendar/calendar-types.js.map +1 -0
- package/dist/data-components/calendar/calendar-utils.js +2 -0
- package/dist/data-components/calendar/calendar-utils.js.map +1 -0
- package/dist/data-components/calendar/calendar.d.ts +1 -1
- package/dist/data-components/calendar/calendar.js +78 -0
- package/dist/data-components/calendar/calendar.js.map +1 -0
- package/dist/data-components/cell/cell-switch.d.ts +1 -1
- package/dist/data-components/cell/cell-switch.js +68 -0
- package/dist/data-components/cell/cell-switch.js.map +1 -0
- package/dist/data-components/cell/cell-types.d.ts +2 -2
- package/dist/data-components/cell/cell-types.js +2 -0
- package/dist/data-components/cell/cell-types.js.map +1 -0
- package/dist/data-components/cell/cell-utils.js +60 -0
- package/dist/data-components/cell/cell-utils.js.map +1 -0
- package/dist/data-components/cell/cell.d.ts +1 -1
- package/dist/data-components/cell/cell.js +63 -0
- package/dist/data-components/cell/cell.js.map +1 -0
- package/dist/data-components/chart/chart-types.d.ts +1 -1
- package/dist/data-components/chart/chart-types.js +2 -0
- package/dist/data-components/chart/chart-types.js.map +1 -0
- package/dist/data-components/chart/chart.d.ts +1 -1
- package/dist/data-components/chart/chart.js +121 -0
- package/dist/data-components/chart/chart.js.map +1 -0
- package/dist/data-components/chart/sankey/sankeyChart.d.ts +1 -1
- package/dist/data-components/chart/sankey/sankeyChart.js +111 -0
- package/dist/data-components/chart/sankey/sankeyChart.js.map +1 -0
- package/dist/data-components/data-structure/data-structure-utils.d.ts +1 -1
- package/dist/data-components/data-structure/data-structure-utils.js +28 -0
- package/dist/data-components/data-structure/data-structure-utils.js.map +1 -0
- package/dist/data-components/data-structure/data-structure.d.ts +1 -1
- package/dist/data-components/data-structure/data-structure.js +2 -0
- package/dist/data-components/data-structure/data-structure.js.map +1 -0
- package/dist/data-components/data-structure/stories-assets.d.ts +5 -1
- package/dist/data-components/data-structure/stories-assets.js +199 -0
- package/dist/data-components/data-structure/stories-assets.js.map +1 -0
- package/dist/data-components/form/form-types.d.ts +2 -2
- package/dist/data-components/form/form-types.js +2 -0
- package/dist/data-components/form/form-types.js.map +1 -0
- package/dist/data-components/form/form.d.ts +1 -1
- package/dist/data-components/form/form.js +124 -0
- package/dist/data-components/form/form.js.map +1 -0
- package/dist/data-components/table-grid/aggregation/aggregation-utils.js +31 -0
- package/dist/data-components/table-grid/aggregation/aggregation-utils.js.map +1 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-executor.d.ts +1 -1
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-executor.js +264 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-executor.js.map +1 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-mock.d.ts +1 -1
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-mock.js +306 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-mock.js.map +1 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-panel-types.d.ts +1 -1
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-panel-types.js +2 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-panel-types.js.map +1 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-panel.d.ts +1 -1
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-panel.js +33 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-panel.js.map +1 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-schema.d.ts +2 -2
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-schema.js +59 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-schema.js.map +1 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-tools.d.ts +1 -1
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-tools.js +167 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-tools.js.map +1 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-types.d.ts +1 -1
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-types.js +2 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-types.js.map +1 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-validator.d.ts +2 -2
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-validator.js +157 -0
- package/dist/data-components/table-grid/ai-assistant/ai-assistant-validator.js.map +1 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/autoDetect.js +27 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/autoDetect.js.map +1 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/createDataStructureFromFile.d.ts +1 -1
- package/dist/data-components/table-grid/external-functionalities/import/csv/createDataStructureFromFile.js +21 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/createDataStructureFromFile.js.map +1 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/csvToObj.js +21 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/csvToObj.js.map +1 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/detectDelimeter.js +12 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/detectDelimeter.js.map +1 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/index.d.ts +6 -6
- package/dist/data-components/table-grid/external-functionalities/import/csv/index.js +7 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/index.js.map +1 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/inferColumns.d.ts +1 -1
- package/dist/data-components/table-grid/external-functionalities/import/csv/inferColumns.js +15 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/inferColumns.js.map +1 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/parseDelimeted.js +50 -0
- package/dist/data-components/table-grid/external-functionalities/import/csv/parseDelimeted.js.map +1 -0
- package/dist/data-components/table-grid/footer/table-grid-footer-types.d.ts +1 -1
- package/dist/data-components/table-grid/footer/table-grid-footer-types.js +2 -0
- package/dist/data-components/table-grid/footer/table-grid-footer-types.js.map +1 -0
- package/dist/data-components/table-grid/footer/table-grid-footer.d.ts +1 -1
- package/dist/data-components/table-grid/footer/table-grid-footer.js +47 -0
- package/dist/data-components/table-grid/footer/table-grid-footer.js.map +1 -0
- package/dist/data-components/table-grid/formula/evaluator.js +91 -0
- package/dist/data-components/table-grid/formula/evaluator.js.map +1 -0
- package/dist/data-components/table-grid/formula/formula-builder-types.d.ts +1 -1
- package/dist/data-components/table-grid/formula/formula-builder-types.js +2 -0
- package/dist/data-components/table-grid/formula/formula-builder-types.js.map +1 -0
- package/dist/data-components/table-grid/formula/formula-builder.d.ts +1 -1
- package/dist/data-components/table-grid/formula/formula-builder.js +47 -0
- package/dist/data-components/table-grid/formula/formula-builder.js.map +1 -0
- package/dist/data-components/table-grid/formula/formula.test.js +50 -0
- package/dist/data-components/table-grid/formula/formula.test.js.map +1 -0
- package/dist/data-components/table-grid/formula/index.js +40 -0
- package/dist/data-components/table-grid/formula/index.js.map +1 -0
- package/dist/data-components/table-grid/formula/parser.js +179 -0
- package/dist/data-components/table-grid/formula/parser.js.map +1 -0
- package/dist/data-components/table-grid/formula/tokenizer.js +140 -0
- package/dist/data-components/table-grid/formula/tokenizer.js.map +1 -0
- package/dist/data-components/table-grid/formula/types.js +2 -0
- package/dist/data-components/table-grid/formula/types.js.map +1 -0
- package/dist/data-components/table-grid/header/grouping/group-panel-types.d.ts +1 -1
- package/dist/data-components/table-grid/header/grouping/group-panel-types.js +2 -0
- package/dist/data-components/table-grid/header/grouping/group-panel-types.js.map +1 -0
- package/dist/data-components/table-grid/header/grouping/group-panel.d.ts +1 -1
- package/dist/data-components/table-grid/header/grouping/group-panel.js +91 -0
- package/dist/data-components/table-grid/header/grouping/group-panel.js.map +1 -0
- package/dist/data-components/table-grid/header/table-grid-column-menu.d.ts +1 -1
- package/dist/data-components/table-grid/header/table-grid-column-menu.js +84 -0
- package/dist/data-components/table-grid/header/table-grid-column-menu.js.map +1 -0
- package/dist/data-components/table-grid/header/table-grid-header-types.d.ts +1 -1
- package/dist/data-components/table-grid/header/table-grid-header-types.js +2 -0
- package/dist/data-components/table-grid/header/table-grid-header-types.js.map +1 -0
- package/dist/data-components/table-grid/header/table-grid-header.d.ts +1 -1
- package/dist/data-components/table-grid/header/table-grid-header.js +148 -0
- package/dist/data-components/table-grid/header/table-grid-header.js.map +1 -0
- package/dist/data-components/table-grid/hooks/use-table.d.ts +1 -1
- package/dist/data-components/table-grid/hooks/use-table.js +18 -0
- package/dist/data-components/table-grid/hooks/use-table.js.map +1 -0
- package/dist/data-components/table-grid/pinning/pinning-utils.d.ts +1 -1
- package/dist/data-components/table-grid/pinning/pinning-utils.js +70 -0
- package/dist/data-components/table-grid/pinning/pinning-utils.js.map +1 -0
- package/dist/data-components/table-grid/pivot/pivot-config-panel-types.d.ts +2 -2
- package/dist/data-components/table-grid/pivot/pivot-config-panel-types.js +2 -0
- package/dist/data-components/table-grid/pivot/pivot-config-panel-types.js.map +1 -0
- package/dist/data-components/table-grid/pivot/pivot-config-panel.d.ts +1 -1
- package/dist/data-components/table-grid/pivot/pivot-config-panel.js +89 -0
- package/dist/data-components/table-grid/pivot/pivot-config-panel.js.map +1 -0
- package/dist/data-components/table-grid/pivot/pivot-table.d.ts +1 -1
- package/dist/data-components/table-grid/pivot/pivot-table.js +26 -0
- package/dist/data-components/table-grid/pivot/pivot-table.js.map +1 -0
- package/dist/data-components/table-grid/pivot/pivot-types.d.ts +1 -1
- package/dist/data-components/table-grid/pivot/pivot-types.js +2 -0
- package/dist/data-components/table-grid/pivot/pivot-types.js.map +1 -0
- package/dist/data-components/table-grid/pivot/pivot-utils.d.ts +2 -2
- package/dist/data-components/table-grid/pivot/pivot-utils.js +150 -0
- package/dist/data-components/table-grid/pivot/pivot-utils.js.map +1 -0
- package/dist/data-components/table-grid/row/table-grid-row-types.d.ts +3 -1
- package/dist/data-components/table-grid/row/table-grid-row-types.d.ts.map +1 -1
- package/dist/data-components/table-grid/row/table-grid-row-types.js +2 -0
- package/dist/data-components/table-grid/row/table-grid-row-types.js.map +1 -0
- package/dist/data-components/table-grid/row/table-grid-row-utils.d.ts +2 -2
- package/dist/data-components/table-grid/row/table-grid-row-utils.js +35 -0
- package/dist/data-components/table-grid/row/table-grid-row-utils.js.map +1 -0
- package/dist/data-components/table-grid/row/table-grid-row.d.ts +2 -2
- package/dist/data-components/table-grid/row/table-grid-row.d.ts.map +1 -1
- package/dist/data-components/table-grid/row/table-grid-row.js +68 -0
- package/dist/data-components/table-grid/row/table-grid-row.js.map +1 -0
- package/dist/data-components/table-grid/selection/selection-types.js +2 -0
- package/dist/data-components/table-grid/selection/selection-types.js.map +1 -0
- package/dist/data-components/table-grid/selection/selection-utils.d.ts +2 -2
- package/dist/data-components/table-grid/selection/selection-utils.js +136 -0
- package/dist/data-components/table-grid/selection/selection-utils.js.map +1 -0
- package/dist/data-components/table-grid/sidebar/table-grid-sidebar-types.js +2 -0
- package/dist/data-components/table-grid/sidebar/table-grid-sidebar-types.js.map +1 -0
- package/dist/data-components/table-grid/sidebar/table-grid-sidebar.d.ts +1 -1
- package/dist/data-components/table-grid/sidebar/table-grid-sidebar.js +7 -0
- package/dist/data-components/table-grid/sidebar/table-grid-sidebar.js.map +1 -0
- package/dist/data-components/table-grid/sorting/sorting.d.ts +1 -1
- package/dist/data-components/table-grid/sorting/sorting.js +45 -0
- package/dist/data-components/table-grid/sorting/sorting.js.map +1 -0
- package/dist/data-components/table-grid/table-context/table-context-types.d.ts +2 -2
- package/dist/data-components/table-grid/table-context/table-context-types.js +2 -0
- package/dist/data-components/table-grid/table-context/table-context-types.js.map +1 -0
- package/dist/data-components/table-grid/table-context/table-context.d.ts +2 -2
- package/dist/data-components/table-grid/table-context/table-context.js +4 -0
- package/dist/data-components/table-grid/table-context/table-context.js.map +1 -0
- package/dist/data-components/table-grid/table-grid-context.d.ts +2 -2
- package/dist/data-components/table-grid/table-grid-context.d.ts.map +1 -1
- package/dist/data-components/table-grid/table-grid-context.js +258 -0
- package/dist/data-components/table-grid/table-grid-context.js.map +1 -0
- package/dist/data-components/table-grid/table-grid-types.d.ts +9 -7
- package/dist/data-components/table-grid/table-grid-types.d.ts.map +1 -1
- package/dist/data-components/table-grid/table-grid-types.js +2 -0
- package/dist/data-components/table-grid/table-grid-types.js.map +1 -0
- package/dist/data-components/table-grid/table-grid.d.ts +1 -1
- package/dist/data-components/table-grid/table-grid.d.ts.map +1 -1
- package/dist/data-components/table-grid/table-grid.js +144 -0
- package/dist/data-components/table-grid/table-grid.js.map +1 -0
- package/dist/data-components/table-grid/table-utils.d.ts +1 -1
- package/dist/data-components/table-grid/table-utils.js +116 -0
- package/dist/data-components/table-grid/table-utils.js.map +1 -0
- package/dist/experimental-components/contribution-heatmap/contribution-heatmap-types.js +2 -0
- package/dist/experimental-components/contribution-heatmap/contribution-heatmap-types.js.map +1 -0
- package/dist/experimental-components/contribution-heatmap/contribution-heatmap-utils.d.ts +1 -1
- package/dist/experimental-components/contribution-heatmap/contribution-heatmap-utils.js +61 -0
- package/dist/experimental-components/contribution-heatmap/contribution-heatmap-utils.js.map +1 -0
- package/dist/experimental-components/contribution-heatmap/contribution-heatmap.d.ts +2 -2
- package/dist/experimental-components/contribution-heatmap/contribution-heatmap.js +23 -0
- package/dist/experimental-components/contribution-heatmap/contribution-heatmap.js.map +1 -0
- package/dist/experimental-components/filter-builder/filter-builder-types.d.ts +1 -1
- package/dist/experimental-components/filter-builder/filter-builder-types.js +2 -0
- package/dist/experimental-components/filter-builder/filter-builder-types.js.map +1 -0
- package/dist/experimental-components/filter-builder/filter-builder.d.ts +3 -2
- package/dist/experimental-components/filter-builder/filter-builder.js +139 -0
- package/dist/experimental-components/filter-builder/filter-builder.js.map +1 -0
- package/dist/framework-components/appbar/appbar-assets.js +5 -0
- package/dist/framework-components/appbar/appbar-assets.js.map +1 -0
- package/dist/framework-components/appbar/appbar-types.d.ts +1 -1
- package/dist/framework-components/appbar/appbar-types.js +2 -0
- package/dist/framework-components/appbar/appbar-types.js.map +1 -0
- package/dist/framework-components/appbar/appbar.d.ts +2 -2
- package/dist/framework-components/appbar/appbar.js +36 -0
- package/dist/framework-components/appbar/appbar.js.map +1 -0
- package/dist/framework-components/breadcrumbs/breadcrumbs-types.js +2 -0
- package/dist/framework-components/breadcrumbs/breadcrumbs-types.js.map +1 -0
- package/dist/framework-components/breadcrumbs/breadcrumbs.d.ts +2 -2
- package/dist/framework-components/breadcrumbs/breadcrumbs.js +31 -0
- package/dist/framework-components/breadcrumbs/breadcrumbs.js.map +1 -0
- package/dist/framework-components/drawer/drawer-types.d.ts +2 -2
- package/dist/framework-components/drawer/drawer-types.js +2 -0
- package/dist/framework-components/drawer/drawer-types.js.map +1 -0
- package/dist/framework-components/drawer/drawer.d.ts +2 -2
- package/dist/framework-components/drawer/drawer.js +10 -0
- package/dist/framework-components/drawer/drawer.js.map +1 -0
- package/dist/framework-components/scaffold/scaffold-context.d.ts +2 -2
- package/dist/framework-components/scaffold/scaffold-context.js +10 -0
- package/dist/framework-components/scaffold/scaffold-context.js.map +1 -0
- package/dist/framework-components/scaffold/scaffold-types.d.ts +1 -1
- package/dist/framework-components/scaffold/scaffold-types.js +2 -0
- package/dist/framework-components/scaffold/scaffold-types.js.map +1 -0
- package/dist/framework-components/scaffold/scaffold.d.ts +2 -2
- package/dist/framework-components/scaffold/scaffold.js +76 -0
- package/dist/framework-components/scaffold/scaffold.js.map +1 -0
- package/dist/framework-components/sidebar/sidebar-assets.js +4 -0
- package/dist/framework-components/sidebar/sidebar-assets.js.map +1 -0
- package/dist/framework-components/sidebar/sidebar-context.d.ts +2 -2
- package/dist/framework-components/sidebar/sidebar-context.js +9 -0
- package/dist/framework-components/sidebar/sidebar-context.js.map +1 -0
- package/dist/framework-components/sidebar/sidebar-logo/sidebar-logo-types.js +2 -0
- package/dist/framework-components/sidebar/sidebar-logo/sidebar-logo-types.js.map +1 -0
- package/dist/framework-components/sidebar/sidebar-logo/sidebar-logo.d.ts +1 -1
- package/dist/framework-components/sidebar/sidebar-logo/sidebar-logo.js +12 -0
- package/dist/framework-components/sidebar/sidebar-logo/sidebar-logo.js.map +1 -0
- package/dist/framework-components/sidebar/sidebar-types.d.ts +1 -1
- package/dist/framework-components/sidebar/sidebar-types.js +2 -0
- package/dist/framework-components/sidebar/sidebar-types.js.map +1 -0
- package/dist/framework-components/sidebar/sidebar.d.ts +3 -3
- package/dist/framework-components/sidebar/sidebar.js +42 -0
- package/dist/framework-components/sidebar/sidebar.js.map +1 -0
- package/dist/hooks/useDynamicVirtualList.d.ts +76 -0
- package/dist/hooks/useDynamicVirtualList.d.ts.map +1 -0
- package/dist/hooks/useDynamicVirtualList.js +208 -0
- package/dist/hooks/useDynamicVirtualList.js.map +1 -0
- package/dist/hooks/useFixedVirtualList.d.ts +1 -1
- package/dist/hooks/useFixedVirtualList.js +64 -0
- package/dist/hooks/useFixedVirtualList.js.map +1 -0
- package/dist/hooks/useShortcut.d.ts +1 -1
- package/dist/hooks/useShortcut.js +86 -0
- package/dist/hooks/useShortcut.js.map +1 -0
- package/dist/hooks/useTour/useTour-context-internal.d.ts +2 -2
- package/dist/hooks/useTour/useTour-context-internal.js +7 -0
- package/dist/hooks/useTour/useTour-context-internal.js.map +1 -0
- package/dist/hooks/useTour/useTour-context.d.ts +3 -3
- package/dist/hooks/useTour/useTour-context.js +54 -0
- package/dist/hooks/useTour/useTour-context.js.map +1 -0
- package/dist/hooks/useTour/useTour-types.d.ts +1 -1
- package/dist/hooks/useTour/useTour-types.js +2 -0
- package/dist/hooks/useTour/useTour-types.js.map +1 -0
- package/dist/hooks/useTour/useTour.d.ts +1 -1
- package/dist/hooks/useTour/useTour.js +408 -0
- package/dist/hooks/useTour/useTour.js.map +1 -0
- package/dist/hooks/useVirtualListScroll.d.ts +1 -1
- package/dist/hooks/useVirtualListScroll.js +79 -0
- package/dist/hooks/useVirtualListScroll.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -0
- package/dist/providers/ai-assistant/ai-assistant-prompts.d.ts +1 -1
- package/dist/providers/ai-assistant/ai-assistant-prompts.js +98 -0
- package/dist/providers/ai-assistant/ai-assistant-prompts.js.map +1 -0
- package/dist/providers/ai-assistant/ai-assistant-types.js +5 -0
- package/dist/providers/ai-assistant/ai-assistant-types.js.map +1 -0
- package/dist/providers/ai-assistant/ai-assistant-validator.d.ts +1 -1
- package/dist/providers/ai-assistant/ai-assistant-validator.js +74 -0
- package/dist/providers/ai-assistant/ai-assistant-validator.js.map +1 -0
- package/dist/providers/ai-assistant/ai-chat-panel-types.d.ts +1 -1
- package/dist/providers/ai-assistant/ai-chat-panel-types.js +2 -0
- package/dist/providers/ai-assistant/ai-chat-panel-types.js.map +1 -0
- package/dist/providers/ai-assistant/ai-chat-panel.d.ts +1 -1
- package/dist/providers/ai-assistant/ai-chat-panel.js +111 -0
- package/dist/providers/ai-assistant/ai-chat-panel.js.map +1 -0
- package/dist/providers/shortcut/shortcut-context.d.ts +2 -2
- package/dist/providers/shortcut/shortcut-context.js +7 -0
- package/dist/providers/shortcut/shortcut-context.js.map +1 -0
- package/dist/providers/shortcut/shortcut-provider.d.ts +1 -1
- package/dist/providers/shortcut/shortcut-provider.js +267 -0
- package/dist/providers/shortcut/shortcut-provider.js.map +1 -0
- package/dist/providers/theme/index.js +2 -0
- package/dist/providers/theme/index.js.map +1 -0
- package/dist/providers/theme/theme-provider-types.js +2 -0
- package/dist/providers/theme/theme-provider-types.js.map +1 -0
- package/dist/providers/theme/themeProvider.d.ts +2 -2
- package/dist/providers/theme/themeProvider.js +17 -0
- package/dist/providers/theme/themeProvider.js.map +1 -0
- package/dist/test/vitest.utils.js +2 -0
- package/dist/test/vitest.utils.js.map +1 -0
- package/dist/types/global-types.js +10 -0
- package/dist/types/global-types.js.map +1 -0
- package/dist/types/storybook-types.js +2 -0
- package/dist/types/storybook-types.js.map +1 -0
- package/dist/utility-components/avatar/avatar-types.d.ts +1 -1
- package/dist/utility-components/avatar/avatar-types.js +2 -0
- package/dist/utility-components/avatar/avatar-types.js.map +1 -0
- package/dist/utility-components/avatar/avatar.d.ts +2 -2
- package/dist/utility-components/avatar/avatar.js +10 -0
- package/dist/utility-components/avatar/avatar.js.map +1 -0
- package/dist/utility-components/chip/chip-types.d.ts +2 -2
- package/dist/utility-components/chip/chip-types.js +2 -0
- package/dist/utility-components/chip/chip-types.js.map +1 -0
- package/dist/utility-components/chip/chip.d.ts +2 -2
- package/dist/utility-components/chip/chip.js +11 -0
- package/dist/utility-components/chip/chip.js.map +1 -0
- package/dist/utility-components/helper-text/helper-text-types.d.ts +1 -1
- package/dist/utility-components/helper-text/helper-text-types.js +2 -0
- package/dist/utility-components/helper-text/helper-text-types.js.map +1 -0
- package/dist/utility-components/helper-text/helper-text.d.ts +1 -1
- package/dist/utility-components/helper-text/helper-text.js +12 -0
- package/dist/utility-components/helper-text/helper-text.js.map +1 -0
- package/dist/utility-components/icon/icon-assets.js +95 -0
- package/dist/utility-components/icon/icon-assets.js.map +1 -0
- package/dist/utility-components/icon/icon-types.d.ts +1 -1
- package/dist/utility-components/icon/icon-types.js +2 -0
- package/dist/utility-components/icon/icon-types.js.map +1 -0
- package/dist/utility-components/icon/icon.d.ts +2 -2
- package/dist/utility-components/icon/icon.js +28 -0
- package/dist/utility-components/icon/icon.js.map +1 -0
- package/dist/utility-components/label/label-types.js +2 -0
- package/dist/utility-components/label/label-types.js.map +1 -0
- package/dist/utility-components/label/label.d.ts +1 -1
- package/dist/utility-components/label/label.js +10 -0
- package/dist/utility-components/label/label.js.map +1 -0
- package/dist/utility-components/overlay-panel/overlay-panel-types.js +2 -0
- package/dist/utility-components/overlay-panel/overlay-panel-types.js.map +1 -0
- package/dist/utility-components/overlay-panel/overlay-panel.d.ts +2 -2
- package/dist/utility-components/overlay-panel/overlay-panel.js +98 -0
- package/dist/utility-components/overlay-panel/overlay-panel.js.map +1 -0
- package/dist/utility-components/overlay-panel/use-focus-trap.d.ts +1 -1
- package/dist/utility-components/overlay-panel/use-focus-trap.js +61 -0
- package/dist/utility-components/overlay-panel/use-focus-trap.js.map +1 -0
- package/dist/utility-components/skeleton/skeleton-types.js +2 -0
- package/dist/utility-components/skeleton/skeleton-types.js.map +1 -0
- package/dist/utility-components/skeleton/skeleton.d.ts +2 -2
- package/dist/utility-components/skeleton/skeleton.js +14 -0
- package/dist/utility-components/skeleton/skeleton.js.map +1 -0
- package/dist/utility-components/stack/stack-types.js +2 -0
- package/dist/utility-components/stack/stack-types.js.map +1 -0
- package/dist/utility-components/stack/stack.d.ts +2 -2
- package/dist/utility-components/stack/stack.js +12 -0
- package/dist/utility-components/stack/stack.js.map +1 -0
- package/dist/utility-components/toast/toast-types.d.ts +1 -1
- package/dist/utility-components/toast/toast-types.js +2 -0
- package/dist/utility-components/toast/toast-types.js.map +1 -0
- package/dist/utility-components/toast/toast.d.ts +2 -2
- package/dist/utility-components/toast/toast.js +21 -0
- package/dist/utility-components/toast/toast.js.map +1 -0
- package/dist/utils/general.d.ts +1 -1
- package/dist/utils/general.js +27 -0
- package/dist/utils/general.js.map +1 -0
- package/dist/utils/shortcut-utils.js +164 -0
- package/dist/utils/shortcut-utils.js.map +1 -0
- package/package.json +1 -1
- package/dist/assets/svg/alert.svg +0 -1
- package/dist/assets/svg/arrow-down-up.svg +0 -1
- package/dist/assets/svg/arrow-down.svg +0 -1
- package/dist/assets/svg/arrow-left.svg +0 -1
- package/dist/assets/svg/arrow-right.svg +0 -1
- package/dist/assets/svg/arrow-up.svg +0 -1
- package/dist/assets/svg/arrow_drop_down.svg +0 -1
- package/dist/assets/svg/calendar.svg +0 -1
- package/dist/assets/svg/check.svg +0 -1
- package/dist/assets/svg/chevron-down.svg +0 -1
- package/dist/assets/svg/chevron-right.svg +0 -1
- package/dist/assets/svg/clipboard.svg +0 -1
- package/dist/assets/svg/close.svg +0 -1
- package/dist/assets/svg/copy.svg +0 -1
- package/dist/assets/svg/cursor.svg +0 -1
- package/dist/assets/svg/cut.svg +0 -1
- package/dist/assets/svg/delete.svg +0 -1
- package/dist/assets/svg/dock-left-arrow.svg +0 -1
- package/dist/assets/svg/dock-right-arrow.svg +0 -1
- package/dist/assets/svg/document-outline.svg +0 -1
- package/dist/assets/svg/download.svg +0 -1
- package/dist/assets/svg/drag.svg +0 -1
- package/dist/assets/svg/error.svg +0 -1
- package/dist/assets/svg/expand-right.svg +0 -1
- package/dist/assets/svg/expand.svg +0 -1
- package/dist/assets/svg/eye.svg +0 -1
- package/dist/assets/svg/fullscreen.svg +0 -1
- package/dist/assets/svg/gear.svg +0 -1
- package/dist/assets/svg/groups.svg +0 -1
- package/dist/assets/svg/help.svg +0 -1
- package/dist/assets/svg/info.svg +0 -1
- package/dist/assets/svg/logo.svg +0 -9
- package/dist/assets/svg/menu.svg +0 -1
- package/dist/assets/svg/message-bubble-question-mark.svg +0 -1
- package/dist/assets/svg/pencil.svg +0 -1
- package/dist/assets/svg/plus.svg +0 -1
- package/dist/assets/svg/restio.svg +0 -5
- package/dist/assets/svg/search.svg +0 -1
- package/dist/assets/svg/send.svg +0 -1
- package/dist/assets/svg/shrink-right.svg +0 -1
- package/dist/assets/svg/sidebar.svg +0 -1
- package/dist/assets/svg/terminal.svg +0 -1
- package/dist/assets/svg/timer.svg +0 -1
- package/dist/assets/svg/warning.svg +0 -1
- package/dist/assets/svg/zoom-minus.svg +0 -1
- package/dist/assets/svg/zoom-plus.svg +0 -1
- package/dist/restio-ui.cjs.js +0 -109
- package/dist/restio-ui.es.js +0 -34431
- package/dist/ui.css +0 -2
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { NumberInput } from "../../components/input/number/input-number";
|
|
3
|
+
import { TextInput } from "../../components/input/text/input-text";
|
|
4
|
+
import { Select } from "../../components/select/select";
|
|
5
|
+
import { ButtonGroup } from "../../components/button-group/button-group";
|
|
6
|
+
import { DateRangePicker } from "../../components/input/date/date-range-picker";
|
|
7
|
+
import { Checkbox } from "../../components/checkbox/checkbox";
|
|
8
|
+
import { CellType } from "../../types/global-types";
|
|
9
|
+
import { DatePicker } from "../../components/input/date/date-picker";
|
|
10
|
+
/**
|
|
11
|
+
* Renders the appropriate editor component based on value type and column configuration
|
|
12
|
+
* @param value - Current draft value
|
|
13
|
+
* @param column - Column definition
|
|
14
|
+
* @param onDraftChange - Callback when draft value changes
|
|
15
|
+
* @param onCommit - Callback to commit the value
|
|
16
|
+
* @param onImmediateCommit - Callback for immediate commit (select, checkbox)
|
|
17
|
+
* @param onKeyDown - Keyboard event handler
|
|
18
|
+
* @param autoFocus - Whether to autofocus the editor
|
|
19
|
+
* @param error - Error message
|
|
20
|
+
* @param disabled - Whether the cell is disabled
|
|
21
|
+
* @param className - CSS class name
|
|
22
|
+
* @returns Editor component
|
|
23
|
+
*/
|
|
24
|
+
export function renderCell(value, column, onDraftChange, onCommit, onImmediateCommit, onKeyDown, autoFocus, error, disabled, className) {
|
|
25
|
+
// Select component for columns with options
|
|
26
|
+
if ("options" in column && column.options) {
|
|
27
|
+
const cellType = column.cellType; // default to select
|
|
28
|
+
switch (cellType) {
|
|
29
|
+
case CellType.SELECT:
|
|
30
|
+
return (_jsx(Select, { value: String(value ?? ""), options: column.options, onChange: (newValue) => onImmediateCommit(newValue), disabled: disabled }));
|
|
31
|
+
case CellType.BUTTON_GROUP:
|
|
32
|
+
return (_jsx(ButtonGroup, { value: String(value ?? ""), options: column.options, onChange: (newValue) => onImmediateCommit(newValue), size: "small", disabled: disabled }));
|
|
33
|
+
default:
|
|
34
|
+
return (_jsx(Select, { value: String(value ?? ""), options: column.options, onChange: (newValue) => onImmediateCommit(newValue), disabled: disabled }));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// When value is nullish, use cellType to determine the correct editor
|
|
38
|
+
if (value === undefined || value === null) {
|
|
39
|
+
if (column.cellType === CellType.NUMBER) {
|
|
40
|
+
return (_jsx(NumberInput, { value: undefined, onChange: (newValue) => onDraftChange(newValue), onBlur: onCommit, onKeyDown: onKeyDown, autoFocus: autoFocus, className: className, error: error, disabled: disabled }));
|
|
41
|
+
}
|
|
42
|
+
return (_jsx(TextInput, { value: "", onChange: (newValue) => onDraftChange(newValue), onBlur: onCommit, onKeyDown: onKeyDown, autoFocus: autoFocus, className: className, error: error, disabled: disabled }));
|
|
43
|
+
}
|
|
44
|
+
// String input
|
|
45
|
+
if (typeof value === "string") {
|
|
46
|
+
return (_jsx(TextInput, { value: value, onChange: (newValue) => onDraftChange(newValue), onBlur: onCommit, onKeyDown: onKeyDown, autoFocus: autoFocus, error: error, disabled: disabled }));
|
|
47
|
+
}
|
|
48
|
+
// Number input
|
|
49
|
+
if (typeof value === "number") {
|
|
50
|
+
return (_jsx(NumberInput, { value: value, onChange: (newValue) => onDraftChange(newValue), onBlur: onCommit, onKeyDown: onKeyDown, autoFocus: autoFocus, className: className, error: error, disabled: disabled }));
|
|
51
|
+
}
|
|
52
|
+
// Boolean checkbox
|
|
53
|
+
if (typeof value === "boolean") {
|
|
54
|
+
return _jsx(Checkbox, { checked: value, onChange: (checked) => onImmediateCommit(checked), className: className, disabled: disabled });
|
|
55
|
+
}
|
|
56
|
+
// Date range input (cellType: DATE_RANGE)
|
|
57
|
+
if (column.cellType === CellType.DATE_RANGE) {
|
|
58
|
+
const rangeValue = value ?? { from: null, to: null };
|
|
59
|
+
return (_jsx(DateRangePicker, { value: rangeValue, onChange: (newValue) => onImmediateCommit(newValue), className: className, error: error, disabled: disabled, shortcuts: true }));
|
|
60
|
+
}
|
|
61
|
+
// Date input
|
|
62
|
+
if (value instanceof Date) {
|
|
63
|
+
return (_jsx(DatePicker, { value: value, onChange: (newValue) => onDraftChange(newValue), onBlur: onCommit, onKeyDown: onKeyDown, autoFocus: autoFocus, className: className, error: error, disabled: disabled }));
|
|
64
|
+
}
|
|
65
|
+
// Fallback to text input
|
|
66
|
+
return (_jsx(TextInput, { value: value, onChange: (newValue) => onDraftChange(newValue), onBlur: onCommit, onKeyDown: onKeyDown, autoFocus: autoFocus, className: className, disabled: disabled }));
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=cell-switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-switch.js","sourceRoot":"","sources":["../../../src/data-components/cell/cell-switch.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAU,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAGrE;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,UAAU,CACxB,KAAa,EACb,MAA0C,EAC1C,aAAsC,EACtC,QAAoB,EACpB,iBAA0C,EAC1C,SAA2C,EAC3C,SAAkB,EAClB,KAAc,EACd,QAAkB,EAClB,SAAkB;IAElB,4CAA4C;IAC5C,IAAI,SAAS,IAAI,MAAM,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QAC1C,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,oBAAoB;QAEtD,QAAQ,QAAQ,EAAE,CAAC;YACjB,KAAK,QAAQ,CAAC,MAAM;gBAClB,OAAO,CACL,KAAC,MAAM,IACL,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,EAAE,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AC;IAED,0CAA0C;IAC1C,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC,UAAU,EAAE,CAAC;QAC5C,MAAM,UAAU,GAAI,KAA8B,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;QAC/E,OAAO,CACL,KAAC,eAAe,IACd,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,iBAAiB,CAAC,QAAkB,CAAC,EAC7D,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,SAAS,SACT,CACH,CAAC;IACJ,CAAC;IAED,aAAa;IACb,IAAI,KAAK,YAAY,IAAI,EAAE,CAAC;QAC1B,OAAO,CACL,KAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,aAAa,CAAC,QAAkB,CAAC,EACzD,MAAM,EAAE,QAAQ,EAChB,SAAS,EAAE,SAAyD,EACpE,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;IACJ,CAAC;IAED,yBAAyB;IACzB,OAAO,CACL,KAAC,SAAS,IACR,KAAK,EAAE,KAAe,EACtB,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,aAAa,CAAC,QAAkB,CAAC,EACzD,MAAM,EAAE,QAAQ,EAChB,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EditMode } from
|
|
2
|
-
import { DataStructureColumn } from
|
|
1
|
+
import { EditMode } from "../../types/global-types";
|
|
2
|
+
import { DataStructureColumn } from "../data-structure/data-structure";
|
|
3
3
|
export interface CellProps<TData, TValue> {
|
|
4
4
|
/** The actual value to display/edit */
|
|
5
5
|
value: TValue;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-types.js","sourceRoot":"","sources":["../../../src/data-components/cell/cell-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Determines if a cell should be editable based on column and cell-level settings
|
|
4
|
+
* @param isEditable - Cell-level editable override
|
|
5
|
+
* @param columnEditable - Column-level editable setting
|
|
6
|
+
* @returns Whether the cell can be edited
|
|
7
|
+
*/
|
|
8
|
+
export function canEditCell(isEditable, columnEditable) {
|
|
9
|
+
return isEditable ?? columnEditable ?? false;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Determines if a cell should always be in edit mode
|
|
13
|
+
* @param editMode - The edit mode setting
|
|
14
|
+
* @param canEdit - Whether the cell is editable
|
|
15
|
+
* @returns Whether the cell should always be in edit mode
|
|
16
|
+
*/
|
|
17
|
+
export function shouldAlwaysEdit(editMode, canEdit) {
|
|
18
|
+
return editMode === "always" && canEdit;
|
|
19
|
+
}
|
|
20
|
+
import { Checkbox } from "../../components/checkbox/checkbox";
|
|
21
|
+
import Typography from "../../components/typography/typography";
|
|
22
|
+
/**
|
|
23
|
+
* Renders the display view of a cell value
|
|
24
|
+
* @param value - Value to display
|
|
25
|
+
* @returns Rendered display element
|
|
26
|
+
*/
|
|
27
|
+
export function renderDisplay(value) {
|
|
28
|
+
if (value instanceof Date) {
|
|
29
|
+
return _jsx(Typography, { variant: "body", children: value.toLocaleDateString() });
|
|
30
|
+
}
|
|
31
|
+
if (Array.isArray(value)) {
|
|
32
|
+
return _jsx(Typography, { variant: "body", children: value.join(", ") });
|
|
33
|
+
}
|
|
34
|
+
if (typeof value === "boolean") {
|
|
35
|
+
return _jsx(Checkbox, { checked: value, disabled: true });
|
|
36
|
+
}
|
|
37
|
+
if (typeof value === "number" && value < 0) {
|
|
38
|
+
return (_jsx(Typography, { variant: "body", color: "var(--rst-fontColor-danger)", children: String(value) }));
|
|
39
|
+
}
|
|
40
|
+
return _jsx(Typography, { variant: "body", children: String(value ?? "") });
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Creates a keyboard event handler for cell editing
|
|
44
|
+
* @param onCommit - Callback to commit changes
|
|
45
|
+
* @param onCancel - Callback to cancel editing
|
|
46
|
+
* @returns Keyboard event handler
|
|
47
|
+
*/
|
|
48
|
+
export function createKeyDownHandler(onCommit, onCancel) {
|
|
49
|
+
return (e) => {
|
|
50
|
+
if (e.key === "Enter") {
|
|
51
|
+
e.preventDefault();
|
|
52
|
+
onCommit();
|
|
53
|
+
}
|
|
54
|
+
else if (e.key === "Escape") {
|
|
55
|
+
e.preventDefault();
|
|
56
|
+
onCancel();
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=cell-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-utils.js","sourceRoot":"","sources":["../../../src/data-components/cell/cell-utils.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,UAA+B,EAAE,cAAmC;IAC9F,OAAO,UAAU,IAAI,cAAc,IAAI,KAAK,CAAC;AAC/C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAsD,EAAE,OAAgB;IACvG,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,CAAC;AAC1C,CAAC;AAED,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAC9D,OAAO,UAAU,MAAM,wCAAwC,CAAC;AAEhE;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAS,KAAa;IACjD,IAAI,KAAK,YAAY,IAAI,EAAE,CAAC;QAC1B,OAAO,KAAC,UAAU,I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Mode, isEditable, error, disabled, showLabel, showHelperText, onValueChange, onEditStart, onEditEnd, }: CellProps<TData, TValue>) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=cell.d.ts.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useCallback, useEffect } from "react";
|
|
3
|
+
import { canEditCell, shouldAlwaysEdit as checkAlwaysEdit, renderDisplay, createKeyDownHandler } from "./cell-utils";
|
|
4
|
+
import { renderCell } from "./cell-switch";
|
|
5
|
+
import { Label } from "../../utility-components/label/label";
|
|
6
|
+
import { HelperText } from "../../utility-components/helper-text/helper-text";
|
|
7
|
+
export const Cell = ({ value, column, rowData, editMode = "doubleClick", isEditable, error, disabled = false, showLabel = true, showHelperText = true, onValueChange, onEditStart, onEditEnd, }) => {
|
|
8
|
+
const canEdit = canEditCell(isEditable, column.enableEditing);
|
|
9
|
+
const alwaysEdit = checkAlwaysEdit(editMode, canEdit);
|
|
10
|
+
const isNonEditable = !canEdit || editMode === "never";
|
|
11
|
+
const [draft, setDraft] = useState(value);
|
|
12
|
+
const [isEditing, setIsEditing] = useState(alwaysEdit);
|
|
13
|
+
const columnId = column.id || String(column.accessorKey);
|
|
14
|
+
const displayLabel = column.header;
|
|
15
|
+
/** Sync draft with value changes */
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
setDraft(value);
|
|
18
|
+
}, [value]);
|
|
19
|
+
/** Start editing the cell */
|
|
20
|
+
const startEditing = useCallback(() => {
|
|
21
|
+
if (!canEdit || disabled)
|
|
22
|
+
return;
|
|
23
|
+
setIsEditing(true);
|
|
24
|
+
onEditStart?.(rowData, column);
|
|
25
|
+
}, [canEdit, disabled, onEditStart, rowData, column]);
|
|
26
|
+
/** Commit the current draft value */
|
|
27
|
+
const commit = useCallback(() => {
|
|
28
|
+
if (draft !== value && onValueChange) {
|
|
29
|
+
onValueChange(draft, rowData, column);
|
|
30
|
+
}
|
|
31
|
+
if (!alwaysEdit) {
|
|
32
|
+
setIsEditing(false);
|
|
33
|
+
onEditEnd?.(rowData, column);
|
|
34
|
+
}
|
|
35
|
+
}, [draft, value, column, rowData, onValueChange, alwaysEdit, onEditEnd]);
|
|
36
|
+
/** Callback when cancel editing */
|
|
37
|
+
const cancel = useCallback(() => {
|
|
38
|
+
setDraft(value);
|
|
39
|
+
if (!alwaysEdit) {
|
|
40
|
+
setIsEditing(false);
|
|
41
|
+
onEditEnd?.(rowData, column);
|
|
42
|
+
}
|
|
43
|
+
}, [value, alwaysEdit, onEditEnd, rowData, column]);
|
|
44
|
+
/** Callback for immediate commit */
|
|
45
|
+
const immediateCommit = useCallback((newValue) => {
|
|
46
|
+
setDraft(newValue);
|
|
47
|
+
if (onValueChange) {
|
|
48
|
+
onValueChange(newValue, rowData, column);
|
|
49
|
+
}
|
|
50
|
+
}, [onValueChange, rowData, column]);
|
|
51
|
+
const handleKeyDown = createKeyDownHandler(commit, cancel);
|
|
52
|
+
const handleClick = editMode === "click" ? startEditing : undefined;
|
|
53
|
+
const handleDoubleClick = editMode === "doubleClick" ? startEditing : undefined;
|
|
54
|
+
if (isNonEditable || disabled) {
|
|
55
|
+
return _jsx("div", { style: { opacity: disabled ? 0.5 : 1, cursor: disabled ? "not-allowed" : "default" }, children: renderDisplay(draft) });
|
|
56
|
+
}
|
|
57
|
+
if (alwaysEdit || isEditing) {
|
|
58
|
+
return (_jsxs("div", { children: [showLabel && displayLabel && _jsx(Label, { label: displayLabel, id: columnId, required: column.required, disabled: disabled }), renderCell(draft, column, setDraft, commit, immediateCommit, handleKeyDown, !alwaysEdit, error, disabled), showHelperText && error && _jsx(HelperText, { helperText: error, id: columnId, disabled: disabled, state: "base" })] }));
|
|
59
|
+
}
|
|
60
|
+
const isEmpty = draft === undefined || draft === null || draft === "";
|
|
61
|
+
return (_jsx("div", { onClick: disabled ? undefined : handleClick, onDoubleClick: disabled ? undefined : handleDoubleClick, style: { cursor: disabled ? "not-allowed" : "pointer", opacity: disabled ? 0.5 : 1 }, children: isEmpty ? (_jsx("span", { style: { color: "var(--rst-fontColor-disabled)", display: "block", minHeight: "1.25em" }, children: "\u2014" })) : (renderDisplay(draft)) }));
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=cell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell.js","sourceRoot":"","sources":["../../../src/data-components/cell/cell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,gBAAgB,IAAI,eAAe,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACrH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,kDAAkD,CAAC;AAG9E,MAAM,CAAC,MAAM,IAAI,GAAG,CAAgB,EAClC,KAAK,EACL,MAAM,EACN,OAAO,EACP,QAAQ,GAAG,aAAa,EACxB,UAAU,EACV,KAAK,EACL,QAAQ,GAAG,KAAK,EAChB,SAAS,GAAG,IAAI,EAChB,cAAc,GAAG,IAAI,EACrB,aAAa,EACb,WAAW,EACX,SAAS,GACgB,EAAE,EAAE;IAC7B,MAAM,OAAO,GAAG,WAAW,CAAC,UAAU,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;IAC9D,MAAM,UAAU,GAAG,eAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACtD,MAAM,aAAa,GAAG,CAAC,OAAO,IAAI,QAAQ,KAAK,OAAO,CAAC;IAEvD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1C,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAA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EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAC,EACzG,cAAc,IAAI,KAAK,IAAI,KAAC,UAAU,IAAC,UAAU,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAC,MAAM,GAAG,IACxG,CACP,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;IAEtE,OAAO,CACL,cACE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,EAC3C,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,iBAAiB,EACvD,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,YAEnF,OAAO,CAAC,CAAC,CAAC,CACT,eAAM,KAAK,EAAE,EAAE,KAAK,EAAE,+BAA+B,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,uBAAU,CACzG,CAAC,CAAC,CAAC,CACF,aAAa,CAAC,KAAK,CAAC,CACrB,GACG,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataStructureComponent } from
|
|
1
|
+
import { DataStructureComponent } from "../data-structure/data-structure";
|
|
2
2
|
export type ChartType = "line" | "bar" | "pie" | "area" | "scatter" | "sankey";
|
|
3
3
|
/**
|
|
4
4
|
* Configuration for Sankey charts.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart-types.js","sourceRoot":"","sources":["../../../src/data-components/chart/chart-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartProps } from
|
|
1
|
+
import { ChartProps } from "./chart-types";
|
|
2
2
|
export declare const Chart: <TData extends object>({ data, columns, type, xAxisColumn, yAxisColumns, title, subtitle, width, height, colors, showGrid, showTooltip, showLegend, showXAxis, showYAxis, layout, sankeyConfig, }: ChartProps<TData>) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export { Chart as default };
|
|
4
4
|
//# sourceMappingURL=chart.d.ts.map
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { LineChart, Line, BarChart, Bar, AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer, Pie, PieChart, ScatterChart, Scatter, Sankey,
|
|
3
|
+
// Sankey,
|
|
4
|
+
} from "recharts";
|
|
5
|
+
import styles from "./chart.module.css";
|
|
6
|
+
import { generateColumnsFromSchema } from "../data-structure/data-structure-utils";
|
|
7
|
+
import { buildSankeyDataFromStages, makeSankeyLink, makeSankeyNode } from "./sankey/sankeyChart";
|
|
8
|
+
export const Chart = ({ data, columns, type, xAxisColumn = "", yAxisColumns = [], title, subtitle, width = "100%", height = 400, colors = ["#8884d8", "#82ca9d", "#ffc658", "#ff7c7c", "#8dd1e1"], showGrid = true, showTooltip = true, showLegend = true, showXAxis = true, showYAxis = true, layout = "horizontal", sankeyConfig, }) => {
|
|
9
|
+
// Generate columns from schema if not provided
|
|
10
|
+
const schema = data[0] ? Object.keys(data[0]) : [];
|
|
11
|
+
const formColumns = columns || generateColumnsFromSchema(schema);
|
|
12
|
+
// Validation for required props (not applicable to sankey)
|
|
13
|
+
if (type !== "sankey" && (!xAxisColumn || !yAxisColumns || yAxisColumns.length === 0)) {
|
|
14
|
+
return (_jsx("div", { className: styles["rst-chart-container"], children: _jsx("div", { className: styles["rst-chart-error"], children: "Missing required axis configuration. Please provide xAxisColumn and yAxisColumns." }) }));
|
|
15
|
+
}
|
|
16
|
+
if (!data || data.length === 0) {
|
|
17
|
+
return (_jsx("div", { className: styles["rst-chart-container"], children: _jsx("div", { className: styles["rst-chart-empty"], children: "No data to display" }) }));
|
|
18
|
+
}
|
|
19
|
+
// Helper function to get value from data using column definition
|
|
20
|
+
const getValue = (row, columnKey) => {
|
|
21
|
+
const column = formColumns.find((col) => col.id === columnKey || col.accessorKey === columnKey || String(col.accessorKey) === columnKey);
|
|
22
|
+
if (column) {
|
|
23
|
+
if (column.accessorFn) {
|
|
24
|
+
return column.accessorFn(row);
|
|
25
|
+
}
|
|
26
|
+
if (column.accessorKey) {
|
|
27
|
+
return row[column.accessorKey];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return row[columnKey];
|
|
31
|
+
};
|
|
32
|
+
// Helper function to get column label
|
|
33
|
+
const getColumnLabel = (columnKey) => {
|
|
34
|
+
const column = formColumns.find((col) => col.id === columnKey || col.accessorKey === columnKey || String(col.accessorKey) === columnKey);
|
|
35
|
+
return column?.header || String(columnKey);
|
|
36
|
+
};
|
|
37
|
+
// Transform data for chart consumption
|
|
38
|
+
const transformChartData = () => {
|
|
39
|
+
return data.map((row, index) => {
|
|
40
|
+
const chartRow = {
|
|
41
|
+
_originalData: row,
|
|
42
|
+
_index: index,
|
|
43
|
+
};
|
|
44
|
+
// Add X-axis value
|
|
45
|
+
const xValue = getValue(row, xAxisColumn);
|
|
46
|
+
chartRow[String(xAxisColumn)] = xValue;
|
|
47
|
+
// Add Y-axis values
|
|
48
|
+
yAxisColumns.forEach((yCol) => {
|
|
49
|
+
const yValue = getValue(row, yCol);
|
|
50
|
+
// Convert to number for chart, fallback to 0 if not a number
|
|
51
|
+
chartRow[String(yCol)] = typeof yValue === "number" ? yValue : typeof yValue === "string" && !isNaN(Number(yValue)) ? Number(yValue) : 0;
|
|
52
|
+
});
|
|
53
|
+
return chartRow;
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
// For sankey: compute minimum required height based on node count per stage
|
|
57
|
+
// and dynamic margins based on longest label text (~6.5 px/char at 12px font).
|
|
58
|
+
let effectiveHeight = height;
|
|
59
|
+
if (type === "sankey" && sankeyConfig && data.length > 0) {
|
|
60
|
+
const stageCounts = sankeyConfig.stageColumns.map((col) => new Set(data.map((r) => r[col]).filter((v) => v != null && String(v).trim() !== "")).size);
|
|
61
|
+
const maxNodesInStage = Math.max(...stageCounts);
|
|
62
|
+
// Each node needs at least 24px height + 20px padding between nodes
|
|
63
|
+
const minH = maxNodesInStage * (24 + 20) - 20 + 48; // -1 padding + top+bottom margin
|
|
64
|
+
effectiveHeight = typeof height === "number" ? Math.max(height, minH) : minH;
|
|
65
|
+
}
|
|
66
|
+
// Render chart based on type
|
|
67
|
+
const renderChart = () => {
|
|
68
|
+
const commonProps = {
|
|
69
|
+
data: transformChartData(),
|
|
70
|
+
margin: { top: 20, right: 30, left: 20, bottom: 5 },
|
|
71
|
+
};
|
|
72
|
+
const xAxisProps = showXAxis
|
|
73
|
+
? {
|
|
74
|
+
...(layout !== "vertical" && { dataKey: String(xAxisColumn) }),
|
|
75
|
+
}
|
|
76
|
+
: {};
|
|
77
|
+
const yAxisProps = showYAxis
|
|
78
|
+
? {
|
|
79
|
+
...(layout === "vertical" && { dataKey: String(xAxisColumn) }),
|
|
80
|
+
}
|
|
81
|
+
: {};
|
|
82
|
+
switch (type) {
|
|
83
|
+
case "line":
|
|
84
|
+
return (_jsxs(LineChart, { ...commonProps, children: [showGrid && _jsx(CartesianGrid, { strokeDasharray: "3 3" }), showXAxis && _jsx(XAxis, { ...xAxisProps }), showYAxis && _jsx(YAxis, { ...yAxisProps }), showTooltip && _jsx(Tooltip, {}), showLegend && _jsx(Legend, {}), yAxisColumns.map((yCol, index) => (_jsx(Line, { type: "monotone", dataKey: String(yCol), stroke: colors[index % colors.length], name: getColumnLabel(yCol) }, String(yCol))))] }));
|
|
85
|
+
case "bar":
|
|
86
|
+
return (_jsxs(BarChart, { ...commonProps, layout: layout, children: [showGrid && _jsx(CartesianGrid, { strokeDasharray: "3 3" }), showXAxis && _jsx(XAxis, { ...xAxisProps }), showYAxis && _jsx(YAxis, { ...yAxisProps }), showTooltip && _jsx(Tooltip, {}), showLegend && _jsx(Legend, {}), yAxisColumns.map((yCol, index) => (_jsx(Bar, { dataKey: String(yCol), fill: colors[index % colors.length], name: getColumnLabel(yCol) }, String(yCol))))] }));
|
|
87
|
+
case "area":
|
|
88
|
+
return (_jsxs(AreaChart, { ...commonProps, children: [showGrid && _jsx(CartesianGrid, { strokeDasharray: "3 3" }), showXAxis && _jsx(XAxis, { ...xAxisProps }), showYAxis && _jsx(YAxis, { ...yAxisProps }), showTooltip && _jsx(Tooltip, {}), showLegend && _jsx(Legend, {}), yAxisColumns.map((yCol, index) => (_jsx(Area, { type: "monotone", dataKey: String(yCol), stackId: "1", stroke: colors[index % colors.length], fill: colors[index % colors.length], name: getColumnLabel(yCol) }, String(yCol))))] }));
|
|
89
|
+
case "pie":
|
|
90
|
+
return (_jsxs(PieChart, { ...commonProps, children: [yAxisColumns.map((yCol, index) => (_jsx(Pie, { data: transformChartData(), dataKey: String(yCol), nameKey: String(xAxisColumn), cx: "50%", cy: "50%", outerRadius: 80 + index * 30, fill: colors[index % colors.length], label: true }, String(yCol)))), showTooltip && _jsx(Tooltip, {}), showLegend && _jsx(Legend, {})] }));
|
|
91
|
+
case "scatter":
|
|
92
|
+
// Scatter chart implementation can be added here if needed
|
|
93
|
+
return (_jsxs(ScatterChart, { ...commonProps, children: [showGrid && _jsx(CartesianGrid, { strokeDasharray: "3 3" }), showXAxis && _jsx(XAxis, { ...xAxisProps }), showYAxis && _jsx(YAxis, { ...yAxisProps }), showTooltip && _jsx(Tooltip, {}), showLegend && _jsx(Legend, {}), yAxisColumns.map((yCol, index) => (_jsx(Scatter, { dataKey: String(yCol), name: getColumnLabel(yCol), fill: colors[index % colors.length] }, String(yCol))))] }));
|
|
94
|
+
case "sankey": {
|
|
95
|
+
if (!sankeyConfig) {
|
|
96
|
+
return (_jsxs("div", { children: ["Sankey requires a ", _jsx("code", { children: "sankeyConfig" }), " prop with ", _jsx("code", { children: "stageColumns" }), " and ", _jsx("code", { children: "valueColumn" }), "."] }));
|
|
97
|
+
}
|
|
98
|
+
const { nodes, links, nodeColors } = buildSankeyDataFromStages(data, sankeyConfig.stageColumns, sankeyConfig.valueColumn, colors);
|
|
99
|
+
const numStages = sankeyConfig.stageColumns.length;
|
|
100
|
+
const maxDepth = numStages - 1;
|
|
101
|
+
const hasMiddleStages = maxDepth > 1;
|
|
102
|
+
// Dynamic left/right margins: measure longest label in first and last stage
|
|
103
|
+
const charPx = 6.5; // approximate px per char at 12px font
|
|
104
|
+
const labelGap = 14;
|
|
105
|
+
const leftLabels = [...new Set(data.map((r) => String(r[sankeyConfig.stageColumns[0]] ?? "")))].filter(Boolean);
|
|
106
|
+
const rightLabels = [...new Set(data.map((r) => String(r[sankeyConfig.stageColumns[maxDepth]] ?? "")))].filter(Boolean);
|
|
107
|
+
const leftMargin = Math.max(64, Math.max(...leftLabels.map((n) => n.length)) * charPx + labelGap);
|
|
108
|
+
const rightMargin = Math.max(64, Math.max(...rightLabels.map((n) => n.length)) * charPx + labelGap);
|
|
109
|
+
// Middle-stage labels go ABOVE nodes → need extra top margin
|
|
110
|
+
const topMargin = hasMiddleStages ? 36 : 14;
|
|
111
|
+
return (_jsx(Sankey, { data: { nodes, links }, node: makeSankeyNode(nodeColors, maxDepth), link: makeSankeyLink(nodeColors), nodePadding: 20, nodeWidth: 14, iterations: 32, margin: { top: topMargin, right: Math.ceil(rightMargin), bottom: 14, left: Math.ceil(leftMargin) } }));
|
|
112
|
+
}
|
|
113
|
+
default:
|
|
114
|
+
return _jsxs("div", { children: ["Unsupported chart type: ", type] });
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const containerClasses = [styles["rst-chart-container"]].filter(Boolean).join(" ");
|
|
118
|
+
return (_jsxs("div", { className: containerClasses, children: [title && (_jsxs("div", { className: styles["rst-chart-header"], children: [_jsx("h3", { className: styles["rst-chart-title"], children: title }), subtitle && _jsx("p", { className: styles["rst-chart-subtitle"], children: subtitle })] })), _jsx("div", { className: styles["rst-chart-content"], children: _jsx(ResponsiveContainer, { width: width, height: effectiveHeight, children: renderChart() }) })] }));
|
|
119
|
+
};
|
|
120
|
+
export { Chart as default };
|
|
121
|
+
//# sourceMappingURL=chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.js","sourceRoot":"","sources":["../../../src/data-components/chart/chart.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,GAAG,EACH,SAAS,EACT,IAAI,EACJ,KAAK,EACL,KAAK,EACL,aAAa,EACb,OAAO,EACP,MAAM,EACN,mBAAmB,EACnB,GAAG,EACH,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,MAAM;AACN,UAAU;EACX,MAAM,UAAU,CAAC;AAElB,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAEnF,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEjG,MAAM,CAAC,MAAM,KAAK,GAAG,CAAuB,EAC1C,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,WAAW,GAAG,EAAiB,EAC/B,YAAY,GAAG,EAAqB,EACpC,KAAK,EACL,QAAQ,EACR,KAAK,GAAG,MAAM,EACd,MAAM,GAAG,GAAG,EACZ,MAAM,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,EAChE,QAAQ,GAAG,IAAI,EACf,WAAW,GAAG,IAAI,EAClB,UAAU,GAAG,IAAI,EACjB,SAAS,GAAG,IAAI,EAChB,SAAS,GAAG,IAAI,EAChB,MAAM,GAAG,YAAY,EACrB,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AS,EAAE,MAAM,CAAC,mBAAmB,CAAC,YACzC,KAAC,mBAAmB,IAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,YACvD,WAAW,EAAE,GACM,GAClB,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Layer, Rectangle } from "recharts";
|
|
3
|
+
// ─── Nodo personalizzato ─────────────────────────────────────────
|
|
4
|
+
/**
|
|
5
|
+
* maxDepth = stageColumns.length - 1
|
|
6
|
+
* depth=0 → label on LEFT (first stage)
|
|
7
|
+
* depth=maxDepth → label on RIGHT (last stage)
|
|
8
|
+
* 0 < depth < maxDepth → label ABOVE node, centered (intermediate stages)
|
|
9
|
+
*/
|
|
10
|
+
export function makeSankeyNode(nodeColors, maxDepth) {
|
|
11
|
+
return function SankeyNode(props) {
|
|
12
|
+
const { x, y, width, height, index, payload } = props;
|
|
13
|
+
const fill = nodeColors[index] ?? "#94a3b8";
|
|
14
|
+
const depth = payload.depth ?? 0;
|
|
15
|
+
const isFirst = depth === 0;
|
|
16
|
+
const isLast = depth === maxDepth;
|
|
17
|
+
const isMiddle = maxDepth > 1 && !isFirst && !isLast;
|
|
18
|
+
const midY = y + height / 2;
|
|
19
|
+
return (_jsxs(Layer, { children: [_jsx(Rectangle, { x: x, y: y, width: width, height: height, fill: fill, fillOpacity: 0.9, radius: 3 }), isMiddle ? (_jsxs(_Fragment, { children: [_jsx("text", { x: x + width / 2, y: y - 14, textAnchor: "middle", dominantBaseline: "auto", fontSize: 11, fontWeight: 600, fill: "#1e293b", children: payload.name }), _jsx("text", { x: x + width / 2, y: y - 3, textAnchor: "middle", dominantBaseline: "auto", fontSize: 10, fill: "#64748b", children: payload.value })] })) : (_jsxs(_Fragment, { children: [_jsx("text", { x: isFirst ? x - 12 : x + width + 12, y: midY - (height > 24 ? 7 : 0), textAnchor: isFirst ? "end" : "start", dominantBaseline: "middle", fontSize: 12, fontWeight: 600, fill: "#1e293b", children: payload.name }), height > 20 && (_jsx("text", { x: isFirst ? x - 12 : x + width + 12, y: midY + 9, textAnchor: isFirst ? "end" : "start", dominantBaseline: "middle", fontSize: 11, fill: "#64748b", children: payload.value }))] }))] }, `sn-${index}`));
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
// ─── Link come ribbon ─────────────────────────────────────────────
|
|
23
|
+
/**
|
|
24
|
+
* Draws each link as a filled bezier ribbon (band) instead of a stroke.
|
|
25
|
+
* sourceY / targetY are the CENTER of the link; linkWidth is the full thickness.
|
|
26
|
+
*/
|
|
27
|
+
export function makeSankeyLink(nodeColors) {
|
|
28
|
+
return function SankeyLink(props) {
|
|
29
|
+
const { sourceX, targetX, sourceY, targetY, sourceControlX, targetControlX, linkWidth, payload } = props;
|
|
30
|
+
if (!payload)
|
|
31
|
+
return _jsx("g", {});
|
|
32
|
+
const targetIndex = typeof payload.target === "number" ? payload.target : payload.target.index;
|
|
33
|
+
const fill = nodeColors[targetIndex] ?? "#94a3b8";
|
|
34
|
+
const lw = Math.max(1, linkWidth || 0);
|
|
35
|
+
const half = lw / 2;
|
|
36
|
+
// Closed bezier band: top edge → right side → bottom edge (reversed) → close
|
|
37
|
+
const path = [
|
|
38
|
+
`M${sourceX},${sourceY - half}`,
|
|
39
|
+
`C${sourceControlX},${sourceY - half} ${targetControlX},${targetY - half} ${targetX},${targetY - half}`,
|
|
40
|
+
`L${targetX},${targetY + half}`,
|
|
41
|
+
`C${targetControlX},${targetY + half} ${sourceControlX},${sourceY + half} ${sourceX},${sourceY + half}`,
|
|
42
|
+
"Z",
|
|
43
|
+
].join(" ");
|
|
44
|
+
return _jsx("path", { d: path, fill: fill, fillOpacity: 0.3, stroke: fill, strokeOpacity: 0.15, strokeWidth: 0.5 });
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
// ─── Genera dati Sankey da stage columns ─────────────────────────
|
|
48
|
+
/**
|
|
49
|
+
* Transforms flat tabular data into Sankey nodes + links.
|
|
50
|
+
*
|
|
51
|
+
* Algorithm:
|
|
52
|
+
* 1. Scan all rows to discover unique node names per stage (ordered).
|
|
53
|
+
* 2. Assign node indices stage by stage so recharts computes correct depth.
|
|
54
|
+
* 3. For each row, build the sequence of non-null stage values and create
|
|
55
|
+
* weighted links between consecutive pairs (skip logic handled via the
|
|
56
|
+
* non-null filter: jumps across empty stages create direct links).
|
|
57
|
+
* 4. Aggregate duplicate links by summing values.
|
|
58
|
+
*/
|
|
59
|
+
export function buildSankeyDataFromStages(data, stageColumns, valueColumn, colors) {
|
|
60
|
+
const nodes = [];
|
|
61
|
+
const nodeColors = [];
|
|
62
|
+
// key: `${stageIdx}:${value}` → node index
|
|
63
|
+
const nodeMap = new Map();
|
|
64
|
+
// Step 1: discover all unique node names per stage in insertion order
|
|
65
|
+
const stageNodeNames = stageColumns.map(() => new Map());
|
|
66
|
+
for (const row of data) {
|
|
67
|
+
stageColumns.forEach((col, si) => {
|
|
68
|
+
const val = row[col];
|
|
69
|
+
if (val !== null && val !== undefined && String(val).trim() !== "") {
|
|
70
|
+
stageNodeNames[si].set(String(val), null);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
// Step 2: register nodes stage by stage so indices are grouped by depth
|
|
75
|
+
stageNodeNames.forEach((names, si) => {
|
|
76
|
+
for (const name of names.keys()) {
|
|
77
|
+
nodeMap.set(`${si}:${name}`, nodes.length);
|
|
78
|
+
nodes.push({ name });
|
|
79
|
+
nodeColors.push(colors[si % colors.length]);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
// Step 3: build links
|
|
83
|
+
const linkMap = new Map();
|
|
84
|
+
for (const row of data) {
|
|
85
|
+
const rawValue = row[valueColumn];
|
|
86
|
+
const value = typeof rawValue === "number" ? rawValue : Number(rawValue) || 0;
|
|
87
|
+
// Sequence of (nodeIndex) for non-null stages
|
|
88
|
+
const sequence = [];
|
|
89
|
+
stageColumns.forEach((col, si) => {
|
|
90
|
+
const val = row[col];
|
|
91
|
+
if (val !== null && val !== undefined && String(val).trim() !== "") {
|
|
92
|
+
sequence.push(nodeMap.get(`${si}:${String(val)}`));
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
// Link consecutive non-null nodes
|
|
96
|
+
for (let i = 0; i < sequence.length - 1; i++) {
|
|
97
|
+
const src = sequence[i];
|
|
98
|
+
const tgt = sequence[i + 1];
|
|
99
|
+
const key = `${src}:${tgt}`;
|
|
100
|
+
const existing = linkMap.get(key);
|
|
101
|
+
if (existing) {
|
|
102
|
+
existing.value += value;
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
linkMap.set(key, { source: src, target: tgt, value });
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return { nodes, links: Array.from(linkMap.values()), nodeColors };
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=sankeyChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sankeyChart.js","sourceRoot":"","sources":["../../../../src/data-components/chart/sankey/sankeyChart.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAmB,KAAK,EAAE,SAAS,EAAmB,MAAM,UAAU,CAAC;AAE9E,oEAAoE;AACpE;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,UAAoB,EAAE,QAAgB;IACnE,OAAO,SAAS,UAAU,CAAC,KAAsB;QAC/C,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;QACtD,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC;QAC5C,MAAM,KAAK,GAAI,OAA8B,CAAC,KAAK,IAAI,CAAC,CAAC;QAEzD,MAAM,OAAO,GAAG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AAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;gBACnE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,CAAE,CAAC,CAAC;YACtD,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,kCAAkC;QAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7C,MAAM,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YACxB,MAAM,GAAG,GAAG,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAC5B,MAAM,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;YAC5B,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAClC,IAAI,QAAQ,EAAE,CAAC;gBACb,QAAQ,CAAC,KAAK,IAAI,KAAK,CAAC;YAC1B,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;YACxD,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate column definitions using a schema builder
|
|
3
|
+
* Type-safe way to generate columns without Object.keys()
|
|
4
|
+
*/
|
|
5
|
+
export function generateColumnsFromSchema(schema, options) {
|
|
6
|
+
const defaultHeaderFormatter = (key) => key.charAt(0).toUpperCase() + key.slice(1).replace(/([A-Z])/g, ' $1');
|
|
7
|
+
const headerFormatter = options?.headerFormatter || defaultHeaderFormatter;
|
|
8
|
+
return schema.map((key) => ({
|
|
9
|
+
id: String(key),
|
|
10
|
+
accessorKey: key,
|
|
11
|
+
header: headerFormatter(String(key)),
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Merge auto-generated columns with user-provided columns
|
|
16
|
+
* User-provided columns take precedence
|
|
17
|
+
*/
|
|
18
|
+
export function mergeColumns(schema, userColumns, options) {
|
|
19
|
+
const autoColumns = generateColumnsFromSchema(schema, options);
|
|
20
|
+
if (!userColumns || userColumns.length === 0) {
|
|
21
|
+
return autoColumns;
|
|
22
|
+
}
|
|
23
|
+
// Create a map of user-provided columns by accessorKey for quick lookup
|
|
24
|
+
const userColMap = new Map(userColumns.map((col) => [col.accessorKey, col]));
|
|
25
|
+
// Return auto columns, but replace with user columns where they exist
|
|
26
|
+
return autoColumns.map((autoCol) => userColMap.get(autoCol.accessorKey) || autoCol);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=data-structure-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-structure-utils.js","sourceRoot":"","sources":["../../../src/data-components/data-structure/data-structure-utils.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CACvC,MAAuB,EACvB,OAEC;IAED,MAAM,sBAAsB,GAAG,CAAC,GAAW,EAAE,EAAE,CAC7C,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IACxE,MAAM,eAAe,GAAG,OAAO,EAAE,eAAe,IAAI,sBAAsB,CAAC;IAE3E,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC1B,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;QACf,WAAW,EAAE,GAAG;QAChB,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;KACN,CAAA,CAAC,CAAC;AACpC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAC1B,MAAuB,EACvB,WAA0C,EAC1C,OAEC;IAED,MAAM,WAAW,GAAG,yBAAyB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE/D,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7C,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,wEAAwE;IACxE,MAAM,UAAU,GAAG,IAAI,GAAG,CACxB,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CACjD,CAAC;IAEF,sEAAsE;IACtE,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CACjC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,OAAO,CAC/C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-structure.js","sourceRoot":"","sources":["../../../src/data-components/data-structure/data-structure.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Shared data types and mock data for data-components stories
|
|
3
|
+
* This file centralizes all interfaces and sample data used across stories
|
|
4
|
+
*/
|
|
5
|
+
import { ColumnDef } from "../..";
|
|
2
6
|
export interface User {
|
|
3
7
|
id: string;
|
|
4
8
|
firstName: string;
|