dishui 0.0.64 → 0.0.66
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/_virtual/_rolldown/runtime.js +10 -11
- package/dist/chart.js +12 -46
- package/dist/code-editor.js +16 -43
- package/dist/components/Badge/index.js +11 -13
- package/dist/components/Badge/index.js.map +1 -1
- package/dist/components/Button/index.js +62 -86
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Card/index.d.ts +87 -0
- package/dist/components/Card/index.js +178 -44
- package/dist/components/Card/index.js.map +1 -1
- package/dist/components/Chart/Chart.js +25 -25
- package/dist/components/Chart/Chart.js.map +1 -1
- package/dist/components/Checkbox/index.js +57 -63
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/ChoicePicker/index.d.ts +44 -0
- package/dist/components/ChoicePicker/index.js +81 -0
- package/dist/components/ChoicePicker/index.js.map +1 -0
- package/dist/components/Column/index.d.ts +28 -0
- package/dist/components/Column/index.js +30 -0
- package/dist/components/Column/index.js.map +1 -0
- package/dist/components/DateTimeInput/index.d.ts +44 -0
- package/dist/components/DateTimeInput/index.js +48 -0
- package/dist/components/DateTimeInput/index.js.map +1 -0
- package/dist/components/Demo/index.js +107 -107
- package/dist/components/Demo/index.js.map +1 -1
- package/dist/components/Divider/index.d.ts +20 -0
- package/dist/components/Divider/index.js +30 -0
- package/dist/components/Divider/index.js.map +1 -0
- package/dist/components/EmptyState/index.d.ts +4 -1
- package/dist/components/EmptyState/index.js +24 -24
- package/dist/components/EmptyState/index.js.map +1 -1
- package/dist/components/FileUploader/DropZone.js +134 -136
- package/dist/components/FileUploader/DropZone.js.map +1 -1
- package/dist/components/FileUploader/FileItem.js +159 -163
- package/dist/components/FileUploader/FileItem.js.map +1 -1
- package/dist/components/FileUploader/FileUploader.js +126 -127
- package/dist/components/FileUploader/FileUploader.js.map +1 -1
- package/dist/components/FileUploader/UploadQueue.js +62 -62
- package/dist/components/FileUploader/UploadQueue.js.map +1 -1
- package/dist/components/FloatWindow/index.d.ts +28 -0
- package/dist/components/GridLayout/index.d.ts +42 -0
- package/dist/components/Icon/index.d.ts +24 -0
- package/dist/components/Icon/index.js +26 -0
- package/dist/components/Icon/index.js.map +1 -0
- package/dist/components/Image/index.d.ts +33 -0
- package/dist/components/Image/index.js +44 -0
- package/dist/components/Image/index.js.map +1 -0
- package/dist/components/Input/index.js +196 -197
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/Label/index.js +62 -73
- package/dist/components/Label/index.js.map +1 -1
- package/dist/components/Layout/index.js +134 -139
- package/dist/components/Layout/index.js.map +1 -1
- package/dist/components/List/index.js +45 -43
- package/dist/components/List/index.js.map +1 -1
- package/dist/components/Markdown/Markdown.js +106 -103
- package/dist/components/Markdown/Markdown.js.map +1 -1
- package/dist/components/Markdown/codeThemes.js +24 -33
- package/dist/components/Markdown/codeThemes.js.map +1 -1
- package/dist/components/Markdown/markdownComponents.js +203 -208
- package/dist/components/Markdown/markdownComponents.js.map +1 -1
- package/dist/components/Markdown/parseCodeBlockMeta.js +22 -22
- package/dist/components/Markdown/parseCodeBlockMeta.js.map +1 -1
- package/dist/components/Markdown/useMarkdownSource.js +46 -46
- package/dist/components/Markdown/useMarkdownSource.js.map +1 -1
- package/dist/components/Markdown/useMarkmapRenderer.js +35 -36
- package/dist/components/Markdown/useMarkmapRenderer.js.map +1 -1
- package/dist/components/Markdown/useMermaidRenderer.js +41 -42
- package/dist/components/Markdown/useMermaidRenderer.js.map +1 -1
- package/dist/components/Modal/index.d.ts +7 -3
- package/dist/components/Modal/index.js +82 -70
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/MultipleChoice/index.d.ts +44 -0
- package/dist/components/MultipleChoice/index.js +52 -0
- package/dist/components/MultipleChoice/index.js.map +1 -0
- package/dist/components/Notification/index.d.ts +17 -0
- package/dist/components/Page/index.d.ts +58 -0
- package/dist/components/Page/index.js +43 -0
- package/dist/components/Page/index.js.map +1 -0
- package/dist/components/PageHeader/index.js +28 -28
- package/dist/components/PageHeader/index.js.map +1 -1
- package/dist/components/ProtectedRoute/index.js +8 -9
- package/dist/components/ProtectedRoute/index.js.map +1 -1
- package/dist/components/Row/index.d.ts +28 -0
- package/dist/components/Row/index.js +30 -0
- package/dist/components/Row/index.js.map +1 -0
- package/dist/components/Select/index.js +251 -257
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/SidebarToggleButton/index.js +56 -59
- package/dist/components/SidebarToggleButton/index.js.map +1 -1
- package/dist/components/Slider/index.d.ts +39 -0
- package/dist/components/Slider/index.js +52 -0
- package/dist/components/Slider/index.js.map +1 -0
- package/dist/components/StatCard/index.d.ts +31 -1
- package/dist/components/StatCard/index.js +189 -58
- package/dist/components/StatCard/index.js.map +1 -1
- package/dist/components/Switch/index.d.ts +34 -0
- package/dist/components/Switch/index.js +55 -0
- package/dist/components/Switch/index.js.map +1 -0
- package/dist/components/Tab/index.d.ts +40 -0
- package/dist/components/Table/index.js +109 -103
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Tabs/index.d.ts +19 -5
- package/dist/components/Tabs/index.js +30 -21
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Text/index.d.ts +43 -0
- package/dist/components/Text/index.js +55 -0
- package/dist/components/Text/index.js.map +1 -0
- package/dist/components/Tooltip/index.d.ts +23 -0
- package/dist/components/Tooltip/index.js +34 -0
- package/dist/components/Tooltip/index.js.map +1 -0
- package/dist/components/Tree/Tree.js +205 -205
- package/dist/components/Tree/Tree.js.map +1 -1
- package/dist/components/pro/ArticleContextMenu/index.js +86 -87
- package/dist/components/pro/ArticleContextMenu/index.js.map +1 -1
- package/dist/components/pro/ArticleControl/ArticleControl2.js +250 -250
- package/dist/components/pro/ArticleControl/ArticleControl2.js.map +1 -1
- package/dist/components/pro/ArticleControl/buildHeadingTree.js +31 -32
- package/dist/components/pro/ArticleControl/buildHeadingTree.js.map +1 -1
- package/dist/components/pro/ArticleControl/useArticleToc.js +100 -102
- package/dist/components/pro/ArticleControl/useArticleToc.js.map +1 -1
- package/dist/components/pro/Calendar/Calendar.d.ts +10 -0
- package/dist/components/pro/Calendar/hooks/useCalendarDrag.d.ts +47 -0
- package/dist/components/pro/Calendar/hooks/useCalendarState.d.ts +56 -0
- package/dist/components/pro/Calendar/index.d.ts +7 -0
- package/dist/components/pro/Calendar/types.d.ts +151 -0
- package/dist/components/pro/Calendar/utils.d.ts +94 -0
- package/dist/components/pro/Chat/Chat.d.ts +6 -0
- package/dist/components/pro/Chat/index.d.ts +2 -0
- package/dist/components/pro/Chat/types.d.ts +84 -0
- package/dist/components/pro/CodeEditor/editors/CodeEditor.js +287 -320
- package/dist/components/pro/CodeEditor/editors/CodeEditor.js.map +1 -1
- package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js +167 -221
- package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js.map +1 -1
- package/dist/components/pro/CodeEditor/editors/markdownExtensions.js +594 -613
- package/dist/components/pro/CodeEditor/editors/markdownExtensions.js.map +1 -1
- package/dist/components/pro/CodeEditor/extensions/contextMenu.js +54 -55
- package/dist/components/pro/CodeEditor/extensions/contextMenu.js.map +1 -1
- package/dist/components/pro/CodeEditor/extensions/index.js +152 -160
- package/dist/components/pro/CodeEditor/extensions/index.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/index.js +7 -15
- package/dist/components/pro/CodeEditor/langs/index.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/javascript.js +11 -48
- package/dist/components/pro/CodeEditor/langs/javascript.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/python.js +4 -40
- package/dist/components/pro/CodeEditor/langs/python.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/snippets.js +118 -147
- package/dist/components/pro/CodeEditor/langs/snippets.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/FootnotePanel.js +153 -153
- package/dist/components/pro/CodeEditor/panels/FootnotePanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/HistoryPanel.js +180 -190
- package/dist/components/pro/CodeEditor/panels/HistoryPanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/OutlinePanel.js +130 -137
- package/dist/components/pro/CodeEditor/panels/OutlinePanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/TableOfContentsPanel.js +228 -242
- package/dist/components/pro/CodeEditor/panels/TableOfContentsPanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/VariablePanel.js +208 -248
- package/dist/components/pro/CodeEditor/panels/VariablePanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/themes.js +513 -483
- package/dist/components/pro/CodeEditor/themes.js.map +1 -1
- package/dist/components/pro/CodeEditor/types.d.ts +1 -1
- package/dist/components/pro/CodeEditor/utils.js +171 -175
- package/dist/components/pro/CodeEditor/utils.js.map +1 -1
- package/dist/components/pro/DataTable/DataTable.js +305 -305
- package/dist/components/pro/DataTable/DataTable.js.map +1 -1
- package/dist/components/pro/DataTable/Filters.js +299 -314
- package/dist/components/pro/DataTable/Filters.js.map +1 -1
- package/dist/components/pro/DataTable/PivotPanel.js +203 -204
- package/dist/components/pro/DataTable/PivotPanel.js.map +1 -1
- package/dist/components/pro/DataTable/PivotView.js +142 -141
- package/dist/components/pro/DataTable/PivotView.js.map +1 -1
- package/dist/components/pro/DataTable/components/BulkActions.js +42 -42
- package/dist/components/pro/DataTable/components/BulkActions.js.map +1 -1
- package/dist/components/pro/DataTable/components/ColumnSelector.js +84 -84
- package/dist/components/pro/DataTable/components/ColumnSelector.js.map +1 -1
- package/dist/components/pro/DataTable/components/FilterBar.js +58 -58
- package/dist/components/pro/DataTable/components/FilterBar.js.map +1 -1
- package/dist/components/pro/DataTable/components/TableBody.js +93 -94
- package/dist/components/pro/DataTable/components/TableBody.js.map +1 -1
- package/dist/components/pro/DataTable/components/TableHeader.js +78 -78
- package/dist/components/pro/DataTable/components/TableHeader.js.map +1 -1
- package/dist/components/pro/DataTable/components/TablePagination.js +77 -77
- package/dist/components/pro/DataTable/components/TablePagination.js.map +1 -1
- package/dist/components/pro/DataTable/components/TableToolbar.js +40 -40
- package/dist/components/pro/DataTable/components/TableToolbar.js.map +1 -1
- package/dist/components/pro/DataTable/extension.js +5 -5
- package/dist/components/pro/DataTable/extension.js.map +1 -1
- package/dist/components/pro/DataTable/pivotEngine.js +84 -92
- package/dist/components/pro/DataTable/pivotEngine.js.map +1 -1
- package/dist/components/pro/DataTable/pivotExtension.js +93 -93
- package/dist/components/pro/DataTable/pivotExtension.js.map +1 -1
- package/dist/components/pro/DataTable/rowDetailExtension.js +30 -30
- package/dist/components/pro/DataTable/rowDetailExtension.js.map +1 -1
- package/dist/components/pro/DataTable/tanstack-table.js +45 -62
- package/dist/components/pro/DataTable/tanstack-table.js.map +1 -1
- package/dist/components/pro/DataTable/treeDataUtils.js +37 -48
- package/dist/components/pro/DataTable/treeDataUtils.js.map +1 -1
- package/dist/components/pro/DataTable/useColumnDragReorder.js +68 -68
- package/dist/components/pro/DataTable/useColumnDragReorder.js.map +1 -1
- package/dist/components/pro/DataTable/utils.js +156 -168
- package/dist/components/pro/DataTable/utils.js.map +1 -1
- package/dist/components/pro/FileExplorer/Breadcrumb.js +180 -180
- package/dist/components/pro/FileExplorer/Breadcrumb.js.map +1 -1
- package/dist/components/pro/FileExplorer/CreateDialog.js +78 -78
- package/dist/components/pro/FileExplorer/CreateDialog.js.map +1 -1
- package/dist/components/pro/FileExplorer/FileExplorer.js +202 -205
- package/dist/components/pro/FileExplorer/FileExplorer.js.map +1 -1
- package/dist/components/pro/FileExplorer/FileIcon.js +190 -190
- package/dist/components/pro/FileExplorer/FileIcon.js.map +1 -1
- package/dist/components/pro/FileExplorer/GridView.js +100 -100
- package/dist/components/pro/FileExplorer/GridView.js.map +1 -1
- package/dist/components/pro/FileExplorer/ListView.js +209 -209
- package/dist/components/pro/FileExplorer/ListView.js.map +1 -1
- package/dist/components/pro/FileExplorer/Toolbar.js +199 -199
- package/dist/components/pro/FileExplorer/Toolbar.js.map +1 -1
- package/dist/components/pro/Flow/Flow.js +920 -946
- package/dist/components/pro/Flow/Flow.js.map +1 -1
- package/dist/components/pro/Flow/FlowCanvas.js +1626 -1663
- package/dist/components/pro/Flow/FlowCanvas.js.map +1 -1
- package/dist/components/pro/Flow/archify/build.js +85 -94
- package/dist/components/pro/Flow/archify/build.js.map +1 -1
- package/dist/components/pro/Flow/archify/convert.js +512 -519
- package/dist/components/pro/Flow/archify/convert.js.map +1 -1
- package/dist/components/pro/Flow/archify/palette.js +87 -104
- package/dist/components/pro/Flow/archify/palette.js.map +1 -1
- package/dist/components/pro/Flow/archify/presets.js +34 -37
- package/dist/components/pro/Flow/archify/presets.js.map +1 -1
- package/dist/components/pro/Flow/archify/spec.js +7 -7
- package/dist/components/pro/Flow/archify/spec.js.map +1 -1
- package/dist/components/pro/Flow/canvas/AlignmentGuides.js +25 -25
- package/dist/components/pro/Flow/canvas/AlignmentGuides.js.map +1 -1
- package/dist/components/pro/Flow/canvas/GridRenderer.js +54 -55
- package/dist/components/pro/Flow/canvas/GridRenderer.js.map +1 -1
- package/dist/components/pro/Flow/canvas/MiniMapRenderer.js +54 -58
- package/dist/components/pro/Flow/canvas/MiniMapRenderer.js.map +1 -1
- package/dist/components/pro/Flow/canvas/PixiApp.js +105 -102
- package/dist/components/pro/Flow/canvas/PixiApp.js.map +1 -1
- package/dist/components/pro/Flow/canvas/SelectionOverlay.js +38 -38
- package/dist/components/pro/Flow/canvas/SelectionOverlay.js.map +1 -1
- package/dist/components/pro/Flow/canvas/ViewportContainer.js +117 -117
- package/dist/components/pro/Flow/canvas/ViewportContainer.js.map +1 -1
- package/dist/components/pro/Flow/constants.js +266 -278
- package/dist/components/pro/Flow/constants.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowAIContext.js +27 -28
- package/dist/components/pro/Flow/context/FlowAIContext.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowContext.js +60 -61
- package/dist/components/pro/Flow/context/FlowContext.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowUIContext.js +115 -117
- package/dist/components/pro/Flow/context/FlowUIContext.js.map +1 -1
- package/dist/components/pro/Flow/edges/EdgeRenderer.js +135 -138
- package/dist/components/pro/Flow/edges/EdgeRenderer.js.map +1 -1
- package/dist/components/pro/Flow/edges/edgeMarkers.js +11 -14
- package/dist/components/pro/Flow/edges/edgeMarkers.js.map +1 -1
- package/dist/components/pro/Flow/edges/edgePaths.js +351 -367
- package/dist/components/pro/Flow/edges/edgePaths.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useAlignmentGuides.js +49 -52
- package/dist/components/pro/Flow/hooks/useAlignmentGuides.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useClipboard.js +154 -154
- package/dist/components/pro/Flow/hooks/useClipboard.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useCompactMode.js +17 -17
- package/dist/components/pro/Flow/hooks/useCompactMode.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useDeleteSelection.js +40 -40
- package/dist/components/pro/Flow/hooks/useDeleteSelection.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useDraggablePanel.js +51 -51
- package/dist/components/pro/Flow/hooks/useDraggablePanel.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useEdgeMutations.js +157 -157
- package/dist/components/pro/Flow/hooks/useEdgeMutations.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useFlowImportExport.js +190 -201
- package/dist/components/pro/Flow/hooks/useFlowImportExport.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useKeyboardShortcuts.js +32 -38
- package/dist/components/pro/Flow/hooks/useKeyboardShortcuts.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useLayoutActions.js +172 -182
- package/dist/components/pro/Flow/hooks/useLayoutActions.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useLineMutations.js +57 -57
- package/dist/components/pro/Flow/hooks/useLineMutations.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useMindMap.js +229 -238
- package/dist/components/pro/Flow/hooks/useMindMap.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useNodeMutations.js +102 -102
- package/dist/components/pro/Flow/hooks/useNodeMutations.js.map +1 -1
- package/dist/components/pro/Flow/hooks/usePdfExport.js +55 -56
- package/dist/components/pro/Flow/hooks/usePdfExport.js.map +1 -1
- package/dist/components/pro/Flow/hooks/usePixiApp.js +55 -57
- package/dist/components/pro/Flow/hooks/usePixiApp.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useResizablePanel.js +31 -31
- package/dist/components/pro/Flow/hooks/useResizablePanel.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useSelection.js +69 -69
- package/dist/components/pro/Flow/hooks/useSelection.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useUndoRedo.js +27 -27
- package/dist/components/pro/Flow/hooks/useUndoRedo.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useViewport.js +28 -28
- package/dist/components/pro/Flow/hooks/useViewport.js.map +1 -1
- package/dist/components/pro/Flow/lines/FreehandTool.js +63 -63
- package/dist/components/pro/Flow/lines/FreehandTool.js.map +1 -1
- package/dist/components/pro/Flow/lines/GeometricLineTool.js +80 -80
- package/dist/components/pro/Flow/lines/GeometricLineTool.js.map +1 -1
- package/dist/components/pro/Flow/lines/LineRenderer.js +88 -88
- package/dist/components/pro/Flow/lines/LineRenderer.js.map +1 -1
- package/dist/components/pro/Flow/lines/lineSmoothing.js +32 -34
- package/dist/components/pro/Flow/lines/lineSmoothing.js.map +1 -1
- package/dist/components/pro/Flow/nodes/DataNodeView.js +236 -222
- package/dist/components/pro/Flow/nodes/DataNodeView.js.map +1 -1
- package/dist/components/pro/Flow/nodes/MediaContent.js +236 -246
- package/dist/components/pro/Flow/nodes/MediaContent.js.map +1 -1
- package/dist/components/pro/Flow/nodes/MediaOverlay.js +63 -63
- package/dist/components/pro/Flow/nodes/MediaOverlay.js.map +1 -1
- package/dist/components/pro/Flow/nodes/Model3DView.js +111 -113
- package/dist/components/pro/Flow/nodes/Model3DView.js.map +1 -1
- package/dist/components/pro/Flow/nodes/NodeHandles.js +74 -80
- package/dist/components/pro/Flow/nodes/NodeHandles.js.map +1 -1
- package/dist/components/pro/Flow/nodes/NodeRenderer.js +303 -314
- package/dist/components/pro/Flow/nodes/NodeRenderer.js.map +1 -1
- package/dist/components/pro/Flow/nodes/NodeText.js +25 -29
- package/dist/components/pro/Flow/nodes/NodeText.js.map +1 -1
- package/dist/components/pro/Flow/nodes/aiClient.js +124 -137
- package/dist/components/pro/Flow/nodes/aiClient.js.map +1 -1
- package/dist/components/pro/Flow/nodes/animAnchors.js +42 -49
- package/dist/components/pro/Flow/nodes/animAnchors.js.map +1 -1
- package/dist/components/pro/Flow/nodes/dataUtils.js +246 -267
- package/dist/components/pro/Flow/nodes/dataUtils.js.map +1 -1
- package/dist/components/pro/Flow/nodes/nodeUtils.js +23 -28
- package/dist/components/pro/Flow/nodes/nodeUtils.js.map +1 -1
- package/dist/components/pro/Flow/nodes/shapes.js +556 -591
- package/dist/components/pro/Flow/nodes/shapes.js.map +1 -1
- package/dist/components/pro/Flow/nodes/svgIconTexture.js +37 -39
- package/dist/components/pro/Flow/nodes/svgIconTexture.js.map +1 -1
- package/dist/components/pro/Flow/nodes/svgIcons.js +684 -689
- package/dist/components/pro/Flow/nodes/svgIcons.js.map +1 -1
- package/dist/components/pro/Flow/panels/AIPanel.js +464 -491
- package/dist/components/pro/Flow/panels/AIPanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/Breadcrumb.js +41 -41
- package/dist/components/pro/Flow/panels/Breadcrumb.js.map +1 -1
- package/dist/components/pro/Flow/panels/ContextMenu.js +37 -37
- package/dist/components/pro/Flow/panels/ContextMenu.js.map +1 -1
- package/dist/components/pro/Flow/panels/DataInspectorSection.js +428 -432
- package/dist/components/pro/Flow/panels/DataInspectorSection.js.map +1 -1
- package/dist/components/pro/Flow/panels/ExpandableTextarea.js +61 -62
- package/dist/components/pro/Flow/panels/ExpandableTextarea.js.map +1 -1
- package/dist/components/pro/Flow/panels/FlowPanelGroup.js +114 -114
- package/dist/components/pro/Flow/panels/FlowPanelGroup.js.map +1 -1
- package/dist/components/pro/Flow/panels/FlowToolbar.js +347 -391
- package/dist/components/pro/Flow/panels/FlowToolbar.js.map +1 -1
- package/dist/components/pro/Flow/panels/InspectorPanel.js +1792 -1798
- package/dist/components/pro/Flow/panels/InspectorPanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/OutlinePanel.js +242 -244
- package/dist/components/pro/Flow/panels/OutlinePanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/PresentationMode.js +137 -138
- package/dist/components/pro/Flow/panels/PresentationMode.js.map +1 -1
- package/dist/components/pro/Flow/panels/ProjectTitle.js +46 -46
- package/dist/components/pro/Flow/panels/ProjectTitle.js.map +1 -1
- package/dist/components/pro/Flow/panels/ShapePalette.js +557 -567
- package/dist/components/pro/Flow/panels/ShapePalette.js.map +1 -1
- package/dist/components/pro/Flow/panels/toolbarIcons.d.ts +0 -1
- package/dist/components/pro/Flow/panels/toolbarIcons.js +508 -557
- package/dist/components/pro/Flow/panels/toolbarIcons.js.map +1 -1
- package/dist/components/pro/Flow/types.js +26 -26
- package/dist/components/pro/Flow/types.js.map +1 -1
- package/dist/components/pro/Flow/utils/dashedLine.js +113 -117
- package/dist/components/pro/Flow/utils/dashedLine.js.map +1 -1
- package/dist/components/pro/Flow/utils/gradient.js +55 -55
- package/dist/components/pro/Flow/utils/gradient.js.map +1 -1
- package/dist/components/pro/Flow/utils/pdfExport.js +50 -89
- package/dist/components/pro/Flow/utils/pdfExport.js.map +1 -1
- package/dist/components/pro/Flow/utils/themeColor.js +185 -195
- package/dist/components/pro/Flow/utils/themeColor.js.map +1 -1
- package/dist/components/pro/Gantt/Gantt.d.ts +7 -0
- package/dist/components/pro/Gantt/hooks/useGanttDrag.d.ts +31 -0
- package/dist/components/pro/Gantt/hooks/useGanttState.d.ts +58 -0
- package/dist/components/pro/Gantt/index.d.ts +6 -0
- package/dist/components/pro/Gantt/types.d.ts +478 -0
- package/dist/components/pro/Gantt/utils.d.ts +124 -0
- package/dist/components/pro/Resizable/Resizable.d.ts +30 -0
- package/dist/components/pro/Resizable/index.d.ts +2 -0
- package/dist/components/pro/RichTextEditor/AIRewrite.js +323 -334
- package/dist/components/pro/RichTextEditor/AIRewrite.js.map +1 -1
- package/dist/components/pro/RichTextEditor/BlockHandle.js +314 -316
- package/dist/components/pro/RichTextEditor/BlockHandle.js.map +1 -1
- package/dist/components/pro/RichTextEditor/BubbleToolbar.js +97 -97
- package/dist/components/pro/RichTextEditor/BubbleToolbar.js.map +1 -1
- package/dist/components/pro/RichTextEditor/CommentDialog.js +88 -88
- package/dist/components/pro/RichTextEditor/CommentDialog.js.map +1 -1
- package/dist/components/pro/RichTextEditor/CommentPanel.js +240 -240
- package/dist/components/pro/RichTextEditor/CommentPanel.js.map +1 -1
- package/dist/components/pro/RichTextEditor/CommentPopover.js +234 -234
- package/dist/components/pro/RichTextEditor/CommentPopover.js.map +1 -1
- package/dist/components/pro/RichTextEditor/ContextMenu.js +251 -252
- package/dist/components/pro/RichTextEditor/ContextMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/RichTextEditor.js +267 -271
- package/dist/components/pro/RichTextEditor/RichTextEditor.js.map +1 -1
- package/dist/components/pro/RichTextEditor/SlashMenu.js +214 -214
- package/dist/components/pro/RichTextEditor/SlashMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js +44 -75
- package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.js +261 -261
- package/dist/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.js +172 -526
- package/dist/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/SelectDropdown.js +112 -114
- package/dist/components/pro/RichTextEditor/Toolbar/SelectDropdown.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/TableOpsMenu.js +194 -194
- package/dist/components/pro/RichTextEditor/Toolbar/TableOpsMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js +970 -973
- package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/ToolbarButton.js +11 -12
- package/dist/components/pro/RichTextEditor/Toolbar/ToolbarButton.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js +310 -344
- package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/CommentMark.js +38 -39
- package/dist/components/pro/RichTextEditor/extensions/CommentMark.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js +620 -625
- package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/FontSize.js +25 -25
- package/dist/components/pro/RichTextEditor/extensions/FontSize.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js +167 -176
- package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js.map +1 -1
- package/dist/components/pro/RichTextEditor/types.js +75 -75
- package/dist/components/pro/RichTextEditor/types.js.map +1 -1
- package/dist/contexts/AppContext.d.ts +1 -1
- package/dist/contexts/AppContext.js +216 -221
- package/dist/contexts/AppContext.js.map +1 -1
- package/dist/data-table.js +15 -41
- package/dist/data-table.js.map +1 -1
- package/dist/dishui.css +1 -1
- package/dist/flow.js +27 -83
- package/dist/hooks/useClickOutside.js +18 -18
- package/dist/hooks/useClickOutside.js.map +1 -1
- package/dist/hooks/useContainerElement.js +9 -9
- package/dist/hooks/useContainerElement.js.map +1 -1
- package/dist/hooks/useControllableState.js +33 -35
- package/dist/hooks/useControllableState.js.map +1 -1
- package/dist/hooks/useCopyToClipboard.js +16 -16
- package/dist/hooks/useCopyToClipboard.js.map +1 -1
- package/dist/hooks/useDebounce.js +14 -14
- package/dist/hooks/useDebounce.js.map +1 -1
- package/dist/hooks/useDraggable.js +50 -50
- package/dist/hooks/useDraggable.js.map +1 -1
- package/dist/hooks/useTableColumns.js +39 -42
- package/dist/hooks/useTableColumns.js.map +1 -1
- package/dist/hooks/useTableData.js +67 -68
- package/dist/hooks/useTableData.js.map +1 -1
- package/dist/index-nostyled.d.ts +8 -0
- package/dist/index.d.ts +29 -1
- package/dist/index.js +106 -236
- package/dist/layouts/MainLayout.js +56 -56
- package/dist/layouts/MainLayout.js.map +1 -1
- package/dist/layouts/Navbar.js +214 -214
- package/dist/layouts/Navbar.js.map +1 -1
- package/dist/layouts/Sidebar.js +184 -165
- package/dist/layouts/Sidebar.js.map +1 -1
- package/dist/layouts/headbar/Headbar.js +25 -25
- package/dist/layouts/headbar/Headbar.js.map +1 -1
- package/dist/layouts/headbar/HeadbarLangSwitcher.js +39 -39
- package/dist/layouts/headbar/HeadbarLangSwitcher.js.map +1 -1
- package/dist/layouts/headbar/HeadbarSearch.js +120 -120
- package/dist/layouts/headbar/HeadbarSearch.js.map +1 -1
- package/dist/layouts/headbar/HeadbarThemeSwitcher.js +27 -27
- package/dist/layouts/headbar/HeadbarThemeSwitcher.js.map +1 -1
- package/dist/layouts/headbar/HeadbarTitle.js +26 -26
- package/dist/layouts/headbar/HeadbarTitle.js.map +1 -1
- package/dist/lite.js +9 -24
- package/dist/markdown.js +4 -9
- package/dist/pages/components/Calendar/index.d.ts +3 -0
- package/dist/pages/components/Calendar/index.en.d.ts +3 -0
- package/dist/pages/components/Calendar/index.zh.d.ts +3 -0
- package/dist/pages/components/Chat/index.d.ts +3 -0
- package/dist/pages/components/Chat/index.en.d.ts +3 -0
- package/dist/pages/components/Chat/index.zh.d.ts +3 -0
- package/dist/pages/components/FloatWindow/index.d.ts +3 -0
- package/dist/pages/components/FloatWindow/index.en.d.ts +3 -0
- package/dist/pages/components/FloatWindow/index.zh.d.ts +3 -0
- package/dist/pages/components/Gantt/index.d.ts +3 -0
- package/dist/pages/components/Gantt/index.en.d.ts +3 -0
- package/dist/pages/components/Gantt/index.zh.d.ts +3 -0
- package/dist/pages/components/GridLayout/index.d.ts +3 -0
- package/dist/pages/components/GridLayout/index.en.d.ts +3 -0
- package/dist/pages/components/GridLayout/index.zh.d.ts +3 -0
- package/dist/pages/components/Notification/index.d.ts +3 -0
- package/dist/pages/components/Notification/index.en.d.ts +3 -0
- package/dist/pages/components/Notification/index.zh.d.ts +3 -0
- package/dist/pages/components/Resizable/index.d.ts +3 -0
- package/dist/pages/components/Resizable/index.en.d.ts +3 -0
- package/dist/pages/components/Resizable/index.zh.d.ts +3 -0
- package/dist/pages/components/Tab/index.d.ts +3 -0
- package/dist/pages/components/Tab/index.en.d.ts +3 -0
- package/dist/pages/components/Tab/index.zh.d.ts +3 -0
- package/dist/styles/themeStyles.js +87 -86
- package/dist/styles/themeStyles.js.map +1 -1
- package/dist/utils/cn.d.ts +13 -0
- package/dist/utils/cn.js +16 -0
- package/dist/utils/cn.js.map +1 -0
- package/dist/utils/i18n.js +690 -602
- package/dist/utils/i18n.js.map +1 -1
- package/dist/utils/menu.js +94 -94
- package/dist/utils/menu.js.map +1 -1
- package/dist/utils/rehype-code-meta.js +14 -14
- package/dist/utils/rehype-code-meta.js.map +1 -1
- package/dist/utils/remark-code-meta.js +9 -9
- package/dist/utils/remark-code-meta.js.map +1 -1
- package/dist/utils/routerBuilder.js +59 -58
- package/dist/utils/routerBuilder.js.map +1 -1
- package/dist/utils/selection.js +28 -29
- package/dist/utils/selection.js.map +1 -1
- package/dist/utils/themes.js +275 -255
- package/dist/utils/themes.js.map +1 -1
- package/package.json +23 -10
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DishUI Gantt Chart - Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* A highly configurable Gantt chart component supporting:
|
|
5
|
+
* - Arbitrary-level hierarchical data
|
|
6
|
+
* - Customizable holiday calendars
|
|
7
|
+
* - Per-category working time configuration
|
|
8
|
+
* - Configurable time rendering windows
|
|
9
|
+
*/
|
|
10
|
+
import type { ReactNode } from "react";
|
|
11
|
+
/** Unique identifier for a Gantt node */
|
|
12
|
+
export type GanttNodeId = string | number;
|
|
13
|
+
/**
|
|
14
|
+
* A node in the Gantt tree. Supports arbitrary nesting depth.
|
|
15
|
+
* Each node can represent any level of hierarchy (project, phase, task, subtask, etc.)
|
|
16
|
+
*/
|
|
17
|
+
export interface GanttNode {
|
|
18
|
+
/** Unique identifier */
|
|
19
|
+
id: GanttNodeId;
|
|
20
|
+
/** Display name */
|
|
21
|
+
label: string;
|
|
22
|
+
/** Category/type of this node (e.g. 'project', 'phase', 'task', 'milestone') — used for style & behavior config */
|
|
23
|
+
category?: string;
|
|
24
|
+
/** Start date (ISO 8601 string or Date) */
|
|
25
|
+
startDate?: string | Date;
|
|
26
|
+
/** End date (ISO 8601 string or Date) */
|
|
27
|
+
endDate?: string | Date;
|
|
28
|
+
/** Duration in working days (alternative to endDate) */
|
|
29
|
+
workingDays?: number;
|
|
30
|
+
/** Progress percentage (0–100) */
|
|
31
|
+
progress?: number;
|
|
32
|
+
/** Whether this node is a milestone (renders as diamond instead of bar) */
|
|
33
|
+
milestone?: boolean;
|
|
34
|
+
/** Whether this node should be rendered on the timeline (default: true) */
|
|
35
|
+
renderable?: boolean;
|
|
36
|
+
/** Child nodes (arbitrary depth) */
|
|
37
|
+
children?: GanttNode[];
|
|
38
|
+
/** Custom metadata for application use */
|
|
39
|
+
meta?: Record<string, any>;
|
|
40
|
+
/** Dependencies — IDs of nodes that must complete before this one */
|
|
41
|
+
dependencies?: GanttNodeId[];
|
|
42
|
+
/** Assignee or owner display text */
|
|
43
|
+
assignee?: string;
|
|
44
|
+
/** Optional URL link for this node (opens when link icon is clicked) */
|
|
45
|
+
link?: string;
|
|
46
|
+
/** Custom bar color for this specific node (overrides category color) */
|
|
47
|
+
barColor?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A single holiday definition
|
|
51
|
+
*/
|
|
52
|
+
export interface HolidayEntry {
|
|
53
|
+
/** Date string in YYYY-MM-DD format */
|
|
54
|
+
date: string;
|
|
55
|
+
/** Display name of the holiday */
|
|
56
|
+
name?: string;
|
|
57
|
+
/** If true, this is a compensatory workday (e.g., 调休 in China) — treated as a working day */
|
|
58
|
+
isWorkday?: boolean;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Holiday calendar configuration.
|
|
62
|
+
* Determines which days are non-working days.
|
|
63
|
+
*
|
|
64
|
+
* Priority resolution for any given date:
|
|
65
|
+
* 1. `isNonWorkingDay` function (if provided) overrides all other logic.
|
|
66
|
+
* 2. Entries with `isWorkday: true` (调休/compensatory workdays) force a date to be a working day,
|
|
67
|
+
* even if it falls on a weekend.
|
|
68
|
+
* 3. Entries without `isWorkday` (or `isWorkday: false`) mark the date as a holiday/non-working day.
|
|
69
|
+
* 4. If `weekendsOff` is true (default), Saturday & Sunday are non-working days.
|
|
70
|
+
*
|
|
71
|
+
* Example (China 2025 Spring Festival):
|
|
72
|
+
* ```
|
|
73
|
+
* {
|
|
74
|
+
* weekendsOff: true,
|
|
75
|
+
* entries: [
|
|
76
|
+
* { date: "2025-01-28", name: "春节" }, // holiday
|
|
77
|
+
* { date: "2025-01-26", name: "调休", isWorkday: true }, // Sunday but work
|
|
78
|
+
* ]
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export interface HolidayCalendar {
|
|
83
|
+
/** List of holiday/special day entries */
|
|
84
|
+
entries: HolidayEntry[];
|
|
85
|
+
/**
|
|
86
|
+
* Whether weekends (Saturday & Sunday) are non-working days.
|
|
87
|
+
* Default: true.
|
|
88
|
+
* Set to false for industries that work on weekends (e.g., retail, service).
|
|
89
|
+
* Note: Even when true, entries with `isWorkday: true` can override specific weekends (调休).
|
|
90
|
+
*/
|
|
91
|
+
weekendsOff?: boolean;
|
|
92
|
+
/** Custom function to determine if a date is a non-working day (overrides entries + weekends logic) */
|
|
93
|
+
isNonWorkingDay?: (date: Date) => boolean;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Defines the renderable time window within each day.
|
|
97
|
+
* For example, { startHour: 8, endHour: 16 } means only 8:00–16:00 is rendered.
|
|
98
|
+
*/
|
|
99
|
+
export interface TimeWindow {
|
|
100
|
+
/** Start hour (0–23). Default: 0 */
|
|
101
|
+
startHour: number;
|
|
102
|
+
/** End hour (0–24, exclusive). Default: 24 */
|
|
103
|
+
endHour: number;
|
|
104
|
+
}
|
|
105
|
+
/** Line style for dependency connections */
|
|
106
|
+
export type DependencyLineStyle = "solid" | "dashed" | "dotted";
|
|
107
|
+
/**
|
|
108
|
+
* A dependency link between two nodes, rendered as a polyline connector.
|
|
109
|
+
*/
|
|
110
|
+
export interface GanttDependencyLink {
|
|
111
|
+
/** Source node ID (from) */
|
|
112
|
+
fromId: GanttNodeId;
|
|
113
|
+
/** Target node ID (to) */
|
|
114
|
+
toId: GanttNodeId;
|
|
115
|
+
/** Line style. Default: 'solid' */
|
|
116
|
+
lineStyle?: DependencyLineStyle;
|
|
117
|
+
/** Line color (CSS color string). Default: theme-based */
|
|
118
|
+
color?: string;
|
|
119
|
+
/** Line width in pixels. Default: 1.5 */
|
|
120
|
+
lineWidth?: number;
|
|
121
|
+
/** Whether to show an arrow at the target end. Default: true */
|
|
122
|
+
showArrow?: boolean;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Configuration for the timeline grid appearance.
|
|
126
|
+
*/
|
|
127
|
+
export interface GanttGridConfig {
|
|
128
|
+
/** Whether to show vertical grid lines between each cell. Default: true */
|
|
129
|
+
showCellBorders?: boolean;
|
|
130
|
+
/** Color of regular cell border lines. Default: theme-based */
|
|
131
|
+
cellBorderColor?: string;
|
|
132
|
+
/** Background color for weekend columns. Default: theme-based */
|
|
133
|
+
weekendColor?: string;
|
|
134
|
+
/** Background color for holiday columns (distinct from weekends). Default: light pink '#fff0f3' */
|
|
135
|
+
holidayColor?: string;
|
|
136
|
+
/** Background color for today's column. Default: theme-based */
|
|
137
|
+
todayColor?: string;
|
|
138
|
+
/** Whether to show horizontal row separator lines in the timeline. Default: false */
|
|
139
|
+
showRowLines?: boolean;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Per-category rendering and behavior configuration.
|
|
143
|
+
* Categories are matched against GanttNode.category.
|
|
144
|
+
*/
|
|
145
|
+
export interface GanttCategoryConfig {
|
|
146
|
+
/** Display label for this category */
|
|
147
|
+
label?: string;
|
|
148
|
+
/** Bar color (CSS color string) */
|
|
149
|
+
color?: string;
|
|
150
|
+
/** Bar background color (if different from color) */
|
|
151
|
+
backgroundColor?: string;
|
|
152
|
+
/** Bar height as percentage of row height (0–1). Default: 0.6 */
|
|
153
|
+
barHeight?: number;
|
|
154
|
+
/** Bar border radius in pixels. Default: 4 */
|
|
155
|
+
borderRadius?: number;
|
|
156
|
+
/** Whether to show progress indicator inside the bar */
|
|
157
|
+
showProgress?: boolean;
|
|
158
|
+
/** Whether this category's dates should skip non-working days when computing duration. Default: false */
|
|
159
|
+
skipNonWorkingDays?: boolean;
|
|
160
|
+
/** Time window for rendering this category's bars. If not set, uses global timeWindow. */
|
|
161
|
+
timeWindow?: TimeWindow;
|
|
162
|
+
/** Custom render function for the bar content */
|
|
163
|
+
renderBar?: (node: GanttNode, barProps: GanttBarRenderProps) => ReactNode;
|
|
164
|
+
/** Custom render function for the tree row label */
|
|
165
|
+
renderLabel?: (node: GanttNode) => ReactNode;
|
|
166
|
+
/** Whether bars of this category are draggable. Default: inherits from global */
|
|
167
|
+
draggable?: boolean;
|
|
168
|
+
/** Whether bars of this category are resizable. Default: inherits from global */
|
|
169
|
+
resizable?: boolean;
|
|
170
|
+
/** Render style: 'bar' (filled rectangle), 'line' (thin line spanning children), 'segments' (multiple segments per working day) */
|
|
171
|
+
renderStyle?: "bar" | "line" | "segments";
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Props passed to custom bar render functions
|
|
175
|
+
*/
|
|
176
|
+
export interface GanttBarRenderProps {
|
|
177
|
+
/** The node being rendered */
|
|
178
|
+
node: GanttNode;
|
|
179
|
+
/** Pixel width of the bar */
|
|
180
|
+
width: number;
|
|
181
|
+
/** Pixel height of the bar */
|
|
182
|
+
height: number;
|
|
183
|
+
/** Whether the bar is currently being dragged */
|
|
184
|
+
isDragging: boolean;
|
|
185
|
+
/** Whether the bar is selected */
|
|
186
|
+
isSelected: boolean;
|
|
187
|
+
/** Formatted start date string */
|
|
188
|
+
startDateFormatted: string;
|
|
189
|
+
/** Formatted end date string */
|
|
190
|
+
endDateFormatted: string;
|
|
191
|
+
/** Duration text (e.g. "5d", "2w") */
|
|
192
|
+
durationText: string;
|
|
193
|
+
}
|
|
194
|
+
/** Available zoom/scale levels */
|
|
195
|
+
export type GanttScaleLevel = "year" | "quarter" | "month" | "week" | "day" | "halfday" | "hour";
|
|
196
|
+
/**
|
|
197
|
+
* Configuration for a specific scale level
|
|
198
|
+
*/
|
|
199
|
+
export interface GanttScaleConfig {
|
|
200
|
+
/** Display label */
|
|
201
|
+
label: string;
|
|
202
|
+
/** Width of each cell in pixels */
|
|
203
|
+
cellWidth: number;
|
|
204
|
+
/** Number of time slots per day at this scale */
|
|
205
|
+
slotsPerDay: number;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Column definition for the left tree panel
|
|
209
|
+
*/
|
|
210
|
+
export interface GanttColumn {
|
|
211
|
+
/** Unique key for the column */
|
|
212
|
+
key: string;
|
|
213
|
+
/** Column header title */
|
|
214
|
+
title: string;
|
|
215
|
+
/** Column width in pixels */
|
|
216
|
+
width?: number;
|
|
217
|
+
/** Minimum column width */
|
|
218
|
+
minWidth?: number;
|
|
219
|
+
/** Text alignment */
|
|
220
|
+
align?: "left" | "center" | "right";
|
|
221
|
+
/** Custom cell renderer */
|
|
222
|
+
render?: (node: GanttNode, column: GanttColumn) => ReactNode;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Information about a drag/resize operation on a Gantt bar
|
|
226
|
+
*/
|
|
227
|
+
export interface GanttBarChangeEvent {
|
|
228
|
+
/** The affected node */
|
|
229
|
+
node: GanttNode;
|
|
230
|
+
/** New start date */
|
|
231
|
+
newStartDate: Date;
|
|
232
|
+
/** New end date */
|
|
233
|
+
newEndDate: Date;
|
|
234
|
+
/** New working days (if skipNonWorkingDays is enabled) */
|
|
235
|
+
newWorkingDays?: number;
|
|
236
|
+
/** Type of change */
|
|
237
|
+
changeType: "move" | "resize-start" | "resize-end";
|
|
238
|
+
/** The original node before the change */
|
|
239
|
+
originalNode: GanttNode;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Context menu event
|
|
243
|
+
*/
|
|
244
|
+
export interface GanttContextMenuEvent {
|
|
245
|
+
/** The node that was right-clicked (null if clicked on empty area) */
|
|
246
|
+
node: GanttNode | null;
|
|
247
|
+
/** Mouse position */
|
|
248
|
+
position: {
|
|
249
|
+
x: number;
|
|
250
|
+
y: number;
|
|
251
|
+
};
|
|
252
|
+
/** The date at the click position */
|
|
253
|
+
date: Date;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Today marker configuration
|
|
257
|
+
*/
|
|
258
|
+
export interface GanttTodayMarker {
|
|
259
|
+
/** Whether to show the today marker line. Default: true */
|
|
260
|
+
visible?: boolean;
|
|
261
|
+
/** Color of the today line */
|
|
262
|
+
color?: string;
|
|
263
|
+
/** Whether to auto-scroll to today on mount. Default: true */
|
|
264
|
+
autoScroll?: boolean;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Tooltip configuration
|
|
268
|
+
*/
|
|
269
|
+
export interface GanttTooltipConfig {
|
|
270
|
+
/** Whether tooltips are enabled. Default: true */
|
|
271
|
+
enabled?: boolean;
|
|
272
|
+
/** Custom tooltip render function */
|
|
273
|
+
render?: (node: GanttNode) => ReactNode;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* i18n labels for the Gantt component
|
|
277
|
+
*/
|
|
278
|
+
export interface GanttLabels {
|
|
279
|
+
/** Title for the tree panel header */
|
|
280
|
+
treePanelTitle?: string;
|
|
281
|
+
/** Search placeholder */
|
|
282
|
+
searchPlaceholder?: string;
|
|
283
|
+
/** "Expand All" button text */
|
|
284
|
+
expandAll?: string;
|
|
285
|
+
/** "Collapse All" button text */
|
|
286
|
+
collapseAll?: string;
|
|
287
|
+
/** "Today" button text */
|
|
288
|
+
today?: string;
|
|
289
|
+
/** "Zoom In" tooltip */
|
|
290
|
+
zoomIn?: string;
|
|
291
|
+
/** "Zoom Out" tooltip */
|
|
292
|
+
zoomOut?: string;
|
|
293
|
+
/** "No data" text */
|
|
294
|
+
noData?: string;
|
|
295
|
+
/** Weekday short names (Sun–Sat) */
|
|
296
|
+
weekDays?: [string, string, string, string, string, string, string];
|
|
297
|
+
/** Month short names (Jan–Dec) */
|
|
298
|
+
monthNames?: [
|
|
299
|
+
string,
|
|
300
|
+
string,
|
|
301
|
+
string,
|
|
302
|
+
string,
|
|
303
|
+
string,
|
|
304
|
+
string,
|
|
305
|
+
string,
|
|
306
|
+
string,
|
|
307
|
+
string,
|
|
308
|
+
string,
|
|
309
|
+
string,
|
|
310
|
+
string
|
|
311
|
+
];
|
|
312
|
+
/** "Working days" label */
|
|
313
|
+
workingDays?: string;
|
|
314
|
+
/** "Calendar days" label */
|
|
315
|
+
calendarDays?: string;
|
|
316
|
+
/** "Add" button tooltip */
|
|
317
|
+
add?: string;
|
|
318
|
+
/** "Delete" button tooltip */
|
|
319
|
+
delete?: string;
|
|
320
|
+
/** "Edit" label tooltip */
|
|
321
|
+
edit?: string;
|
|
322
|
+
/** "Link" tooltip */
|
|
323
|
+
link?: string;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Props for the Gantt chart component
|
|
327
|
+
*/
|
|
328
|
+
export interface GanttProps {
|
|
329
|
+
/** Tree data — supports arbitrary nesting depth */
|
|
330
|
+
data: GanttNode[];
|
|
331
|
+
/**
|
|
332
|
+
* Category configurations — maps category strings to rendering/behavior configs.
|
|
333
|
+
* Categories not listed here use the 'default' config.
|
|
334
|
+
*/
|
|
335
|
+
categories?: Record<string, GanttCategoryConfig>;
|
|
336
|
+
/** Holiday calendar configuration */
|
|
337
|
+
holidays?: HolidayCalendar;
|
|
338
|
+
/**
|
|
339
|
+
* Global time window — defines which hours of the day are rendered.
|
|
340
|
+
* Default: { startHour: 0, endHour: 24 } (full day)
|
|
341
|
+
*/
|
|
342
|
+
timeWindow?: TimeWindow;
|
|
343
|
+
/** Column definitions for the tree panel. If not provided, only shows node label. */
|
|
344
|
+
columns?: GanttColumn[];
|
|
345
|
+
/** Initial scale level. Default: 'day' */
|
|
346
|
+
defaultScale?: GanttScaleLevel;
|
|
347
|
+
/** Available scale levels (subset of all levels). Default: all levels */
|
|
348
|
+
availableScales?: GanttScaleLevel[];
|
|
349
|
+
/** Custom scale configurations (override defaults) */
|
|
350
|
+
scaleConfigs?: Partial<Record<GanttScaleLevel, GanttScaleConfig>>;
|
|
351
|
+
/** Width of the tree panel in pixels. Default: 300 */
|
|
352
|
+
treePanelWidth?: number;
|
|
353
|
+
/** Minimum width of the tree panel. Default: 200 */
|
|
354
|
+
treePanelMinWidth?: number;
|
|
355
|
+
/** Maximum width of the tree panel. Default: 600 */
|
|
356
|
+
treePanelMaxWidth?: number;
|
|
357
|
+
/** Whether the tree panel is resizable. Default: true */
|
|
358
|
+
treePanelResizable?: boolean;
|
|
359
|
+
/** Height of each row in pixels. Default: 36 */
|
|
360
|
+
rowHeight?: number;
|
|
361
|
+
/** Whether bars are draggable (can be overridden per category). Default: false */
|
|
362
|
+
draggable?: boolean;
|
|
363
|
+
/** Whether bars are resizable (can be overridden per category). Default: false */
|
|
364
|
+
resizable?: boolean;
|
|
365
|
+
/** Read-only mode — disables all interactions. Default: false */
|
|
366
|
+
readOnly?: boolean;
|
|
367
|
+
/** IDs of initially expanded nodes. Default: all expanded */
|
|
368
|
+
defaultExpandedIds?: GanttNodeId[];
|
|
369
|
+
/** Whether to expand all nodes by default. Default: true */
|
|
370
|
+
defaultExpandAll?: boolean;
|
|
371
|
+
/** Today marker configuration */
|
|
372
|
+
todayMarker?: GanttTodayMarker;
|
|
373
|
+
/** Tooltip configuration */
|
|
374
|
+
tooltip?: GanttTooltipConfig;
|
|
375
|
+
/** i18n labels */
|
|
376
|
+
labels?: GanttLabels;
|
|
377
|
+
/** Show search input in tree panel. Default: false */
|
|
378
|
+
showSearch?: boolean;
|
|
379
|
+
/** Whether to show non-working day columns with a different background. Default: true */
|
|
380
|
+
highlightNonWorkingDays?: boolean;
|
|
381
|
+
/** Grid appearance configuration */
|
|
382
|
+
grid?: GanttGridConfig;
|
|
383
|
+
/** Dependency links between nodes (rendered as polyline connectors) */
|
|
384
|
+
dependencyLinks?: GanttDependencyLink[];
|
|
385
|
+
/** Called when a new dependency link is created by dragging from one bar's connector to another */
|
|
386
|
+
onDependencyCreate?: (fromId: GanttNodeId, toId: GanttNodeId) => void;
|
|
387
|
+
/** Called when a dependency link is clicked */
|
|
388
|
+
onDependencyClick?: (link: GanttDependencyLink) => void;
|
|
389
|
+
/** Called when a dependency link is deleted (e.g. via the × button on hover) */
|
|
390
|
+
onDependencyDelete?: (link: GanttDependencyLink) => void;
|
|
391
|
+
/** CSS class name for the container */
|
|
392
|
+
className?: string;
|
|
393
|
+
/** Component width. Default: '100%' */
|
|
394
|
+
width?: string | number;
|
|
395
|
+
/** Component height. Default: '100%' */
|
|
396
|
+
height?: string | number;
|
|
397
|
+
/** Called when a bar is moved or resized */
|
|
398
|
+
onBarChange?: (event: GanttBarChangeEvent) => void;
|
|
399
|
+
/** Called when a node is clicked in the tree or timeline */
|
|
400
|
+
onNodeClick?: (node: GanttNode) => void;
|
|
401
|
+
/** Called when a node is double-clicked */
|
|
402
|
+
onNodeDoubleClick?: (node: GanttNode) => void;
|
|
403
|
+
/** Called when right-clicking on the timeline */
|
|
404
|
+
onContextMenu?: (event: GanttContextMenuEvent) => void;
|
|
405
|
+
/** Called when a node is expanded/collapsed */
|
|
406
|
+
onNodeToggle?: (nodeId: GanttNodeId, expanded: boolean) => void;
|
|
407
|
+
/** Called when the visible date range changes (from scrolling or zooming) */
|
|
408
|
+
onViewChange?: (startDate: Date, endDate: Date, scale: GanttScaleLevel) => void;
|
|
409
|
+
/** Called when the scale level changes */
|
|
410
|
+
onScaleChange?: (scale: GanttScaleLevel) => void;
|
|
411
|
+
/** Called when a node's label is edited inline (double-click to edit). Return the updated label or undefined to cancel. */
|
|
412
|
+
onNodeLabelEdit?: (node: GanttNode, newLabel: string) => void;
|
|
413
|
+
/** Called when requesting to add a sibling node (at the same level, after the given node) */
|
|
414
|
+
onNodeAdd?: (parentNode: GanttNode | null, siblingNode: GanttNode) => void;
|
|
415
|
+
/** Called when requesting to add a child node (nested under the given node) */
|
|
416
|
+
onNodeAddChild?: (parentNode: GanttNode) => void;
|
|
417
|
+
/** Called when requesting to delete a node */
|
|
418
|
+
onNodeDelete?: (node: GanttNode) => void;
|
|
419
|
+
/** Called when a node's link is clicked */
|
|
420
|
+
onNodeLinkClick?: (node: GanttNode, link: string) => void;
|
|
421
|
+
/** Custom render for tree node row (entire row) */
|
|
422
|
+
renderTreeNode?: (node: GanttNode, depth: number, expanded: boolean, toggleExpand: () => void) => ReactNode;
|
|
423
|
+
/** Custom render for the toolbar area */
|
|
424
|
+
renderToolbar?: (defaultToolbar: ReactNode) => ReactNode;
|
|
425
|
+
/** Custom render for the timeline header */
|
|
426
|
+
renderTimelineHeader?: (dates: Date[], scale: GanttScaleLevel) => ReactNode;
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Flattened node used internally for rendering
|
|
430
|
+
*/
|
|
431
|
+
export interface FlatGanttNode {
|
|
432
|
+
/** Reference to the original node */
|
|
433
|
+
node: GanttNode;
|
|
434
|
+
/** Depth level (0 = root) */
|
|
435
|
+
depth: number;
|
|
436
|
+
/** Whether this node is expanded */
|
|
437
|
+
expanded: boolean;
|
|
438
|
+
/** Whether this node has children */
|
|
439
|
+
hasChildren: boolean;
|
|
440
|
+
/** Computed pixel left offset on the timeline */
|
|
441
|
+
barLeft: number;
|
|
442
|
+
/** Computed pixel width on the timeline */
|
|
443
|
+
barWidth: number;
|
|
444
|
+
/** Computed start date (resolved from node data) */
|
|
445
|
+
resolvedStartDate: Date | null;
|
|
446
|
+
/** Computed end date (resolved from node data) */
|
|
447
|
+
resolvedEndDate: Date | null;
|
|
448
|
+
/** Whether this node's bar should be rendered */
|
|
449
|
+
isRenderable: boolean;
|
|
450
|
+
/** Category config resolved for this node */
|
|
451
|
+
categoryConfig: GanttCategoryConfig;
|
|
452
|
+
/** Index in the visible list */
|
|
453
|
+
visibleIndex: number;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Imperative handle for the Gantt component (via React.forwardRef + useImperativeHandle)
|
|
457
|
+
*/
|
|
458
|
+
export interface GanttHandle {
|
|
459
|
+
/** Scroll the timeline to a specific date */
|
|
460
|
+
scrollToDate: (date: Date) => void;
|
|
461
|
+
/** Scroll to today */
|
|
462
|
+
scrollToToday: () => void;
|
|
463
|
+
/** Scroll to a specific node */
|
|
464
|
+
scrollToNode: (nodeId: GanttNodeId) => void;
|
|
465
|
+
/** Get the current visible date range */
|
|
466
|
+
getVisibleRange: () => {
|
|
467
|
+
start: Date;
|
|
468
|
+
end: Date;
|
|
469
|
+
};
|
|
470
|
+
/** Set the scale level programmatically */
|
|
471
|
+
setScale: (scale: GanttScaleLevel) => void;
|
|
472
|
+
/** Expand all nodes */
|
|
473
|
+
expandAll: () => void;
|
|
474
|
+
/** Collapse all nodes */
|
|
475
|
+
collapseAll: () => void;
|
|
476
|
+
/** Expand/collapse a specific node */
|
|
477
|
+
toggleNode: (nodeId: GanttNodeId, expanded?: boolean) => void;
|
|
478
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DishUI Gantt Chart - Utility Functions
|
|
3
|
+
*
|
|
4
|
+
* Core utilities for date math, working day calculations,
|
|
5
|
+
* and coordinate conversions in the Gantt timeline.
|
|
6
|
+
*/
|
|
7
|
+
import type { GanttNode, HolidayCalendar, TimeWindow, GanttScaleLevel, GanttScaleConfig, GanttCategoryConfig, FlatGanttNode, GanttNodeId } from "./types";
|
|
8
|
+
export declare const DEFAULT_SCALE_CONFIGS: Record<GanttScaleLevel, GanttScaleConfig>;
|
|
9
|
+
export declare const DEFAULT_CATEGORY_CONFIG: GanttCategoryConfig;
|
|
10
|
+
export declare const DEFAULT_TIME_WINDOW: TimeWindow;
|
|
11
|
+
/**
|
|
12
|
+
* Parse a date value (string or Date) into a Date object.
|
|
13
|
+
* Handles ISO 8601 strings, YYYY-MM-DD strings, and Date objects.
|
|
14
|
+
*/
|
|
15
|
+
export declare function parseDate(value: string | Date | undefined | null): Date | null;
|
|
16
|
+
/**
|
|
17
|
+
* Format a Date to YYYY-MM-DD string in local timezone
|
|
18
|
+
*/
|
|
19
|
+
export declare function formatDate(date: Date): string;
|
|
20
|
+
/**
|
|
21
|
+
* Format a Date to a display string based on scale level
|
|
22
|
+
*/
|
|
23
|
+
export declare function formatDateForScale(date: Date, scale: GanttScaleLevel): string;
|
|
24
|
+
/**
|
|
25
|
+
* Check if a given date is a weekend (Saturday or Sunday)
|
|
26
|
+
*/
|
|
27
|
+
export declare function isWeekend(date: Date): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Check if a date is a non-working day based on the holiday calendar.
|
|
30
|
+
* Priority: custom function > entries > weekends
|
|
31
|
+
*/
|
|
32
|
+
export declare function isNonWorkingDay(date: Date, calendar?: HolidayCalendar): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Calculate the number of working days between two dates (inclusive of both start and end).
|
|
35
|
+
*/
|
|
36
|
+
export declare function calculateWorkingDays(startDate: Date, endDate: Date, calendar?: HolidayCalendar): number;
|
|
37
|
+
/**
|
|
38
|
+
* Compute the end date from a start date and N working days.
|
|
39
|
+
* The returned date is the day AFTER the last working day (open interval end).
|
|
40
|
+
*/
|
|
41
|
+
export declare function addWorkingDays(startDate: Date, workingDays: number, calendar?: HolidayCalendar): Date;
|
|
42
|
+
/**
|
|
43
|
+
* Get the number of calendar days between two dates
|
|
44
|
+
*/
|
|
45
|
+
export declare function daysBetween(start: Date, end: Date): number;
|
|
46
|
+
/**
|
|
47
|
+
* Add calendar days to a date
|
|
48
|
+
*/
|
|
49
|
+
export declare function addDays(date: Date, days: number): Date;
|
|
50
|
+
/**
|
|
51
|
+
* Get the start of a day (midnight)
|
|
52
|
+
*/
|
|
53
|
+
export declare function startOfDay(date: Date): Date;
|
|
54
|
+
/**
|
|
55
|
+
* Get the start of a month
|
|
56
|
+
*/
|
|
57
|
+
export declare function startOfMonth(date: Date): Date;
|
|
58
|
+
/**
|
|
59
|
+
* Get the start of a year
|
|
60
|
+
*/
|
|
61
|
+
export declare function startOfYear(date: Date): Date;
|
|
62
|
+
/**
|
|
63
|
+
* Get the start of a quarter
|
|
64
|
+
*/
|
|
65
|
+
export declare function startOfQuarter(date: Date): Date;
|
|
66
|
+
/**
|
|
67
|
+
* Get the start of a week (Monday)
|
|
68
|
+
*/
|
|
69
|
+
export declare function startOfWeek(date: Date): Date;
|
|
70
|
+
/**
|
|
71
|
+
* Check if two dates are the same calendar day
|
|
72
|
+
*/
|
|
73
|
+
export declare function isSameDay(a: Date, b: Date): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Get the ISO 8601 week number. The week containing January 4 is week 1.
|
|
76
|
+
* Weeks start on Monday.
|
|
77
|
+
*/
|
|
78
|
+
export declare function getISOWeekNumber(date: Date): number;
|
|
79
|
+
/**
|
|
80
|
+
* Get the ISO week-numbering year. This may differ from the calendar year
|
|
81
|
+
* for dates near the start/end of a year.
|
|
82
|
+
*/
|
|
83
|
+
export declare function getISOWeekYear(date: Date): number;
|
|
84
|
+
/**
|
|
85
|
+
* Compute the date range needed to display all data in the Gantt chart,
|
|
86
|
+
* with some padding.
|
|
87
|
+
*/
|
|
88
|
+
export declare function computeDateRange(data: GanttNode[], calendar?: HolidayCalendar, paddingDays?: number): {
|
|
89
|
+
start: Date;
|
|
90
|
+
end: Date;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Generate an array of dates between start and end (inclusive)
|
|
94
|
+
*/
|
|
95
|
+
export declare function generateDateRange(start: Date, end: Date): Date[];
|
|
96
|
+
/**
|
|
97
|
+
* Generate header groups for the timeline (top row: months/years, bottom row: days/hours)
|
|
98
|
+
*/
|
|
99
|
+
export interface TimelineHeaderGroup {
|
|
100
|
+
label: string;
|
|
101
|
+
span: number;
|
|
102
|
+
date: Date;
|
|
103
|
+
}
|
|
104
|
+
export declare function generateHeaderGroups(dates: Date[], scale: GanttScaleLevel): TimelineHeaderGroup[];
|
|
105
|
+
/**
|
|
106
|
+
* Flatten the hierarchical GanttNode tree into a list of FlatGanttNode,
|
|
107
|
+
* respecting expanded/collapsed state.
|
|
108
|
+
*/
|
|
109
|
+
export declare function flattenTree(data: GanttNode[], expandedIds: Set<GanttNodeId>, defaultExpandAll: boolean, dateRange: {
|
|
110
|
+
start: Date;
|
|
111
|
+
end: Date;
|
|
112
|
+
}, scaleConfig: GanttScaleConfig, categoryConfigs: Record<string, GanttCategoryConfig>, calendar?: HolidayCalendar, globalTimeWindow?: TimeWindow): FlatGanttNode[];
|
|
113
|
+
/**
|
|
114
|
+
* Convert a pixel x-position on the timeline to a Date
|
|
115
|
+
*/
|
|
116
|
+
export declare function xToDate(x: number, timelineStart: Date, scaleConfig: GanttScaleConfig): Date;
|
|
117
|
+
/**
|
|
118
|
+
* Convert a Date to a pixel x-position on the timeline
|
|
119
|
+
*/
|
|
120
|
+
export declare function dateToX(date: Date, timelineStart: Date, scaleConfig: GanttScaleConfig): number;
|
|
121
|
+
/**
|
|
122
|
+
* Clamp a number between min and max
|
|
123
|
+
*/
|
|
124
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type ResizableDirection = 'horizontal' | 'vertical';
|
|
3
|
+
export type ResizablePanelProps = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/** Initial share as a fraction (0-1). Panels auto-normalise; omit to split evenly. */
|
|
6
|
+
defaultSize?: number;
|
|
7
|
+
/** Minimum size in pixels. */
|
|
8
|
+
minSize?: number;
|
|
9
|
+
/** Maximum size in pixels. */
|
|
10
|
+
maxSize?: number;
|
|
11
|
+
className?: string;
|
|
12
|
+
style?: React.CSSProperties;
|
|
13
|
+
};
|
|
14
|
+
export declare const ResizablePanel: React.FC<ResizablePanelProps>;
|
|
15
|
+
export type ResizableHandleProps = {
|
|
16
|
+
className?: string;
|
|
17
|
+
/** Width (horizontal) or height (vertical) of the drag handle in px. */
|
|
18
|
+
size?: number;
|
|
19
|
+
};
|
|
20
|
+
export declare const ResizableHandle: React.FC<ResizableHandleProps>;
|
|
21
|
+
export type ResizableProps = {
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
direction?: ResizableDirection;
|
|
24
|
+
className?: string;
|
|
25
|
+
style?: React.CSSProperties;
|
|
26
|
+
/** Called on every drag frame with the current panel sizes in px. */
|
|
27
|
+
onResize?: (sizes: number[]) => void;
|
|
28
|
+
};
|
|
29
|
+
declare const Resizable: React.FC<ResizableProps>;
|
|
30
|
+
export default Resizable;
|