xmlui 0.11.4 → 0.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/index.cjs +8836 -0
- package/dist/bin/index.js +8825 -0
- package/dist/lib/{apiInterceptorWorker-QiltRtq1.js → apiInterceptorWorker-dwrAyq6l.js} +126 -151
- package/dist/lib/{index-Cq0EMm3L.js → index-CwYK6iB4.js} +2502 -2675
- package/dist/lib/index.css +1 -1
- package/dist/lib/{initMock-DCigV4Zh.js → initMock-CvmWAkGr.js} +19 -22
- package/dist/lib/language-server-web-worker.js +13 -5
- package/dist/lib/language-server.js +11 -3
- package/dist/lib/{metadata-utils-BiolWMg9.js → metadata-utils-2bsMr4Gd.js} +58 -26
- package/dist/lib/{server-common-DyCHOk-z.js → server-common-DI3W4cob.js} +6297 -5930
- package/dist/lib/syntax-textmate.js +8 -2472
- package/dist/lib/testing.d.ts +1 -0
- package/dist/lib/testing.js +20 -23
- package/dist/lib/{transform-DHf9tQF7.js → transform-CQ_6R-43.js} +159 -126
- package/dist/lib/vite-xmlui-plugin.d.ts +10 -0
- package/dist/lib/vite-xmlui-plugin.js +8316 -0
- package/dist/lib/{xmlui-parser-CHN3mADy.js → xmlui-parser-CW8YmGjO.js} +10 -11
- package/dist/lib/xmlui-parser.js +2 -2
- package/dist/lib/{xmlui-serializer-CYNSHAlP.js → xmlui-serializer-CeCcgdVR.js} +19 -19
- package/dist/lib/xmlui.d.ts +122 -1
- package/dist/lib/xmlui.js +8 -3
- package/dist/metadata/{apiInterceptorWorker-Dql7QGw2.js → apiInterceptorWorker-Wgm2_zjg.js} +124 -149
- package/dist/metadata/{collectedComponentMetadata-CLaDZhmc.js → collectedComponentMetadata-CSFNLstl.js} +3169 -3302
- package/dist/metadata/{initMock-Buqah4JF.js → initMock-CyTd5aE8.js} +19 -22
- package/dist/metadata/xmlui-metadata.css +1 -0
- package/dist/metadata/xmlui-metadata.js +1 -1
- package/dist/metadata/xmlui-metadata.umd.cjs +3 -3
- package/dist/standalone/xmlui-standalone.es.d.ts +171 -2
- package/dist/standalone/xmlui-standalone.umd.js +36 -37
- package/package.json +20 -50
- package/dist/lib/vite-xmlui-plugin/index.js +0 -13985
- package/dist/lib/vite-xmlui-plugin/package.json +0 -3
- package/dist/metadata/style.css +0 -1
- package/dist/scripts/bin/bootstrap.cjs +0 -4
- package/dist/scripts/bin/build-lib.js +0 -126
- package/dist/scripts/bin/build.js +0 -266
- package/dist/scripts/bin/index.js +0 -167
- package/dist/scripts/bin/preview.js +0 -44
- package/dist/scripts/bin/start.js +0 -52
- package/dist/scripts/bin/vite-xmlui-plugin.js +0 -109
- package/dist/scripts/bin/viteConfig.js +0 -144
- package/dist/scripts/package.json +0 -285
- package/dist/scripts/src/abstractions/ActionDefs.js +0 -2
- package/dist/scripts/src/abstractions/AppContextDefs.js +0 -4
- package/dist/scripts/src/abstractions/ComponentDefs.js +0 -2
- package/dist/scripts/src/abstractions/ContainerDefs.js +0 -2
- package/dist/scripts/src/abstractions/ExtensionDefs.js +0 -2
- package/dist/scripts/src/abstractions/FunctionDefs.js +0 -2
- package/dist/scripts/src/abstractions/RendererDefs.js +0 -2
- package/dist/scripts/src/abstractions/ThemingDefs.js +0 -2
- package/dist/scripts/src/abstractions/scripting/BlockScope.js +0 -2
- package/dist/scripts/src/abstractions/scripting/Compilation.js +0 -2
- package/dist/scripts/src/abstractions/scripting/LogicalThread.js +0 -2
- package/dist/scripts/src/abstractions/scripting/LoopScope.js +0 -2
- package/dist/scripts/src/abstractions/scripting/ScriptParserError.js +0 -2
- package/dist/scripts/src/abstractions/scripting/Token.js +0 -2
- package/dist/scripts/src/abstractions/scripting/TryScope.js +0 -2
- package/dist/scripts/src/abstractions/scripting/TryScopeExp.js +0 -2
- package/dist/scripts/src/abstractions/scripting/modules.js +0 -2
- package/dist/scripts/src/components/APICall/APICall.js +0 -130
- package/dist/scripts/src/components/APICall/APICall.spec.js +0 -910
- package/dist/scripts/src/components/APICall/APICallNative.js +0 -36
- package/dist/scripts/src/components/Accordion/Accordion.js +0 -97
- package/dist/scripts/src/components/Accordion/Accordion.spec.js +0 -969
- package/dist/scripts/src/components/Accordion/AccordionContext.js +0 -20
- package/dist/scripts/src/components/Accordion/AccordionItem.js +0 -35
- package/dist/scripts/src/components/Accordion/AccordionItemNative.js +0 -95
- package/dist/scripts/src/components/Accordion/AccordionNative.js +0 -141
- package/dist/scripts/src/components/Animation/AnimationNative.js +0 -263
- package/dist/scripts/src/components/App/App.js +0 -581
- package/dist/scripts/src/components/App/App.spec.js +0 -331
- package/dist/scripts/src/components/App/AppLayoutContext.js +0 -49
- package/dist/scripts/src/components/App/AppNative.js +0 -308
- package/dist/scripts/src/components/App/AppStateContext.js +0 -9
- package/dist/scripts/src/components/App/IndexerContext.js +0 -44
- package/dist/scripts/src/components/App/LinkInfoContext.js +0 -9
- package/dist/scripts/src/components/App/SearchContext.js +0 -35
- package/dist/scripts/src/components/App/Sheet.js +0 -99
- package/dist/scripts/src/components/AppHeader/AppHeader.js +0 -58
- package/dist/scripts/src/components/AppHeader/AppHeader.spec.js +0 -169
- package/dist/scripts/src/components/AppHeader/AppHeaderNative.js +0 -72
- package/dist/scripts/src/components/AppState/AppState.js +0 -75
- package/dist/scripts/src/components/AppState/AppState.spec.js +0 -292
- package/dist/scripts/src/components/AppState/AppStateNative.js +0 -51
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +0 -109
- package/dist/scripts/src/components/AutoComplete/AutoComplete.spec.js +0 -546
- package/dist/scripts/src/components/AutoComplete/AutoCompleteContext.js +0 -19
- package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +0 -498
- package/dist/scripts/src/components/Avatar/Avatar.js +0 -55
- package/dist/scripts/src/components/Avatar/Avatar.spec.js +0 -1514
- package/dist/scripts/src/components/Avatar/AvatarNative.js +0 -58
- package/dist/scripts/src/components/Backdrop/Backdrop.js +0 -40
- package/dist/scripts/src/components/Backdrop/Backdrop.spec.js +0 -131
- package/dist/scripts/src/components/Backdrop/BackdropNative.js +0 -25
- package/dist/scripts/src/components/Badge/Badge.js +0 -81
- package/dist/scripts/src/components/Badge/Badge.spec.js +0 -2214
- package/dist/scripts/src/components/Badge/BadgeNative.js +0 -46
- package/dist/scripts/src/components/Bookmark/Bookmark.js +0 -48
- package/dist/scripts/src/components/Bookmark/Bookmark.spec.js +0 -230
- package/dist/scripts/src/components/Bookmark/BookmarkNative.js +0 -55
- package/dist/scripts/src/components/Breakout/Breakout.js +0 -17
- package/dist/scripts/src/components/Breakout/Breakout.spec.js +0 -56
- package/dist/scripts/src/components/Breakout/BreakoutNative.js +0 -24
- package/dist/scripts/src/components/Button/Button-style.spec.js +0 -274
- package/dist/scripts/src/components/Button/Button.js +0 -171
- package/dist/scripts/src/components/Button/Button.spec.js +0 -425
- package/dist/scripts/src/components/Button/ButtonNative.js +0 -109
- package/dist/scripts/src/components/Card/Card.js +0 -89
- package/dist/scripts/src/components/Card/Card.spec.js +0 -150
- package/dist/scripts/src/components/Card/CardNative.js +0 -41
- package/dist/scripts/src/components/Carousel/Carousel.js +0 -133
- package/dist/scripts/src/components/Carousel/Carousel.spec.js +0 -557
- package/dist/scripts/src/components/Carousel/CarouselContext.js +0 -57
- package/dist/scripts/src/components/Carousel/CarouselItem.js +0 -15
- package/dist/scripts/src/components/Carousel/CarouselItemNative.js +0 -40
- package/dist/scripts/src/components/Carousel/CarouselNative.js +0 -195
- package/dist/scripts/src/components/ChangeListener/ChangeListener.js +0 -34
- package/dist/scripts/src/components/ChangeListener/ChangeListener.spec.js +0 -169
- package/dist/scripts/src/components/ChangeListener/ChangeListenerNative.js +0 -30
- package/dist/scripts/src/components/Charts/AreaChart/AreaChart.js +0 -92
- package/dist/scripts/src/components/Charts/AreaChart/AreaChart.spec.js +0 -999
- package/dist/scripts/src/components/Charts/AreaChart/AreaChartNative.js +0 -127
- package/dist/scripts/src/components/Charts/BarChart/BarChart.js +0 -97
- package/dist/scripts/src/components/Charts/BarChart/BarChart.spec.js +0 -597
- package/dist/scripts/src/components/Charts/BarChart/BarChartNative.js +0 -317
- package/dist/scripts/src/components/Charts/DonutChart/DonutChart.js +0 -60
- package/dist/scripts/src/components/Charts/DonutChart/DonutChart.spec.js +0 -608
- package/dist/scripts/src/components/Charts/LabelList/LabelList.js +0 -41
- package/dist/scripts/src/components/Charts/LabelList/LabelList.spec.js +0 -539
- package/dist/scripts/src/components/Charts/LabelList/LabelListNative.js +0 -25
- package/dist/scripts/src/components/Charts/Legend/Legend.js +0 -33
- package/dist/scripts/src/components/Charts/Legend/Legend.spec.js +0 -558
- package/dist/scripts/src/components/Charts/Legend/LegendNative.js +0 -64
- package/dist/scripts/src/components/Charts/LineChart/LineChart.js +0 -94
- package/dist/scripts/src/components/Charts/LineChart/LineChart.spec.js +0 -450
- package/dist/scripts/src/components/Charts/LineChart/LineChartNative.js +0 -192
- package/dist/scripts/src/components/Charts/PieChart/PieChart.js +0 -64
- package/dist/scripts/src/components/Charts/PieChart/PieChart.spec.js +0 -584
- package/dist/scripts/src/components/Charts/PieChart/PieChartNative.js +0 -167
- package/dist/scripts/src/components/Charts/RadarChart/RadarChart.js +0 -92
- package/dist/scripts/src/components/Charts/RadarChart/RadarChart.spec.js +0 -571
- package/dist/scripts/src/components/Charts/RadarChart/RadarChartNative.js +0 -125
- package/dist/scripts/src/components/Charts/Tooltip/TooltipContent.js +0 -27
- package/dist/scripts/src/components/Charts/Tooltip/TooltipContent.spec.js +0 -451
- package/dist/scripts/src/components/Charts/utils/ChartProvider.js +0 -65
- package/dist/scripts/src/components/Charts/utils/abstractions.js +0 -26
- package/dist/scripts/src/components/Checkbox/Checkbox.js +0 -81
- package/dist/scripts/src/components/Checkbox/Checkbox.spec.js +0 -900
- package/dist/scripts/src/components/CodeBlock/CodeBlock.js +0 -42
- package/dist/scripts/src/components/CodeBlock/CodeBlock.spec.js +0 -196
- package/dist/scripts/src/components/CodeBlock/CodeBlockNative.js +0 -127
- package/dist/scripts/src/components/CodeBlock/highlight-code.js +0 -273
- package/dist/scripts/src/components/ColorPicker/ColorPicker.js +0 -54
- package/dist/scripts/src/components/ColorPicker/ColorPicker.spec.js +0 -355
- package/dist/scripts/src/components/ColorPicker/ColorPickerNative.js +0 -86
- package/dist/scripts/src/components/Column/Column.js +0 -89
- package/dist/scripts/src/components/Column/ColumnNative.js +0 -49
- package/dist/scripts/src/components/Column/TableContext.js +0 -12
- package/dist/scripts/src/components/Column/doc-resources/list-component-data.js +0 -53
- package/dist/scripts/src/components/ComponentProvider.js +0 -811
- package/dist/scripts/src/components/ComponentRegistryContext.js +0 -44
- package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +0 -51
- package/dist/scripts/src/components/ContentSeparator/ContentSeparator.spec.js +0 -531
- package/dist/scripts/src/components/ContentSeparator/ContentSeparatorNative.js +0 -31
- package/dist/scripts/src/components/DataSource/DataSource.js +0 -124
- package/dist/scripts/src/components/DateInput/DateInput.js +0 -197
- package/dist/scripts/src/components/DateInput/DateInput.spec.js +0 -1023
- package/dist/scripts/src/components/DateInput/DateInputNative.js +0 -734
- package/dist/scripts/src/components/DatePicker/DatePicker.js +0 -146
- package/dist/scripts/src/components/DatePicker/DatePicker.spec.js +0 -394
- package/dist/scripts/src/components/DatePicker/DatePickerNative.js +0 -326
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +0 -196
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.spec.js +0 -331
- package/dist/scripts/src/components/DropdownMenu/DropdownMenuNative.js +0 -146
- package/dist/scripts/src/components/EmojiSelector/EmojiSelector.js +0 -26
- package/dist/scripts/src/components/EmojiSelector/EmojiSelector.spec.js +0 -29
- package/dist/scripts/src/components/EmojiSelector/EmojiSelectorNative.js +0 -71
- package/dist/scripts/src/components/ExpandableItem/ExpandableItem.js +0 -101
- package/dist/scripts/src/components/ExpandableItem/ExpandableItem.spec.js +0 -435
- package/dist/scripts/src/components/ExpandableItem/ExpandableItemNative.js +0 -109
- package/dist/scripts/src/components/FileInput/FileInput.js +0 -80
- package/dist/scripts/src/components/FileInput/FileInput.spec.js +0 -285
- package/dist/scripts/src/components/FileInput/FileInputNative.js +0 -161
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.js +0 -58
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.spec.js +0 -296
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZoneNative.js +0 -134
- package/dist/scripts/src/components/FlowLayout/FlowLayout.js +0 -65
- package/dist/scripts/src/components/FlowLayout/FlowLayout.spec.js +0 -518
- package/dist/scripts/src/components/FlowLayout/FlowLayoutNative.js +0 -153
- package/dist/scripts/src/components/Footer/Footer.js +0 -45
- package/dist/scripts/src/components/Footer/Footer.spec.js +0 -991
- package/dist/scripts/src/components/Footer/FooterNative.js +0 -35
- package/dist/scripts/src/components/Form/Form.js +0 -161
- package/dist/scripts/src/components/Form/Form.spec.js +0 -1719
- package/dist/scripts/src/components/Form/FormContext.js +0 -124
- package/dist/scripts/src/components/Form/FormNative.js +0 -463
- package/dist/scripts/src/components/Form/formActions.js +0 -115
- package/dist/scripts/src/components/FormItem/FormItem.js +0 -231
- package/dist/scripts/src/components/FormItem/FormItem.spec.js +0 -1022
- package/dist/scripts/src/components/FormItem/FormItemNative.js +0 -255
- package/dist/scripts/src/components/FormItem/HelperText.js +0 -27
- package/dist/scripts/src/components/FormItem/ItemWithLabel.js +0 -52
- package/dist/scripts/src/components/FormItem/Validations.js +0 -389
- package/dist/scripts/src/components/FormSection/FormSection.js +0 -56
- package/dist/scripts/src/components/Fragment/Fragment.js +0 -24
- package/dist/scripts/src/components/Fragment/Fragment.spec.js +0 -50
- package/dist/scripts/src/components/Heading/H1.spec.js +0 -66
- package/dist/scripts/src/components/Heading/H2.spec.js +0 -66
- package/dist/scripts/src/components/Heading/H3.spec.js +0 -66
- package/dist/scripts/src/components/Heading/H4.spec.js +0 -66
- package/dist/scripts/src/components/Heading/H5.spec.js +0 -66
- package/dist/scripts/src/components/Heading/H6.spec.js +0 -66
- package/dist/scripts/src/components/Heading/Heading.js +0 -396
- package/dist/scripts/src/components/Heading/Heading.spec.js +0 -966
- package/dist/scripts/src/components/Heading/HeadingNative.js +0 -98
- package/dist/scripts/src/components/Heading/abstractions.js +0 -4
- package/dist/scripts/src/components/HoverCard/HoverCard.js +0 -18
- package/dist/scripts/src/components/HoverCard/HovercardNative.js +0 -44
- package/dist/scripts/src/components/HtmlTags/HtmlTags.js +0 -1441
- package/dist/scripts/src/components/HtmlTags/HtmlTags.spec.js +0 -69
- package/dist/scripts/src/components/IFrame/IFrame.js +0 -77
- package/dist/scripts/src/components/IFrame/IFrame.spec.js +0 -527
- package/dist/scripts/src/components/IFrame/IFrameNative.js +0 -46
- package/dist/scripts/src/components/Icon/AdmonitionDanger.js +0 -10
- package/dist/scripts/src/components/Icon/AdmonitionInfo.js +0 -10
- package/dist/scripts/src/components/Icon/AdmonitionNote.js +0 -10
- package/dist/scripts/src/components/Icon/AdmonitionTip.js +0 -10
- package/dist/scripts/src/components/Icon/AdmonitionWarning.js +0 -10
- package/dist/scripts/src/components/Icon/ApiIcon.js +0 -10
- package/dist/scripts/src/components/Icon/ArrowDropDown.js +0 -11
- package/dist/scripts/src/components/Icon/ArrowDropUp.js +0 -11
- package/dist/scripts/src/components/Icon/ArrowLeft.js +0 -11
- package/dist/scripts/src/components/Icon/ArrowRight.js +0 -11
- package/dist/scripts/src/components/Icon/Attach.js +0 -10
- package/dist/scripts/src/components/Icon/Binding.js +0 -11
- package/dist/scripts/src/components/Icon/BoardIcon.js +0 -7
- package/dist/scripts/src/components/Icon/BoxIcon.js +0 -10
- package/dist/scripts/src/components/Icon/CheckIcon.js +0 -7
- package/dist/scripts/src/components/Icon/ChevronDownIcon.js +0 -7
- package/dist/scripts/src/components/Icon/ChevronLeft.js +0 -7
- package/dist/scripts/src/components/Icon/ChevronRight.js +0 -7
- package/dist/scripts/src/components/Icon/ChevronUpIcon.js +0 -7
- package/dist/scripts/src/components/Icon/CodeFileIcon.js +0 -10
- package/dist/scripts/src/components/Icon/CodeSandbox.js +0 -10
- package/dist/scripts/src/components/Icon/CompactListIcon.js +0 -7
- package/dist/scripts/src/components/Icon/ContentCopyIcon.js +0 -7
- package/dist/scripts/src/components/Icon/DarkToLightIcon.js +0 -10
- package/dist/scripts/src/components/Icon/DatabaseIcon.js +0 -11
- package/dist/scripts/src/components/Icon/DocFileIcon.js +0 -10
- package/dist/scripts/src/components/Icon/DocIcon.js +0 -10
- package/dist/scripts/src/components/Icon/DotMenuHorizontalIcon.js +0 -7
- package/dist/scripts/src/components/Icon/DotMenuIcon.js +0 -7
- package/dist/scripts/src/components/Icon/EmailIcon.js +0 -7
- package/dist/scripts/src/components/Icon/EmptyFolderIcon.js +0 -10
- package/dist/scripts/src/components/Icon/ErrorIcon.js +0 -7
- package/dist/scripts/src/components/Icon/ExpressionIcon.js +0 -10
- package/dist/scripts/src/components/Icon/FillPlusCricleIcon.js +0 -7
- package/dist/scripts/src/components/Icon/FilterIcon.js +0 -10
- package/dist/scripts/src/components/Icon/FolderIcon.js +0 -10
- package/dist/scripts/src/components/Icon/GlobeIcon.js +0 -7
- package/dist/scripts/src/components/Icon/HomeIcon.js +0 -7
- package/dist/scripts/src/components/Icon/HyperLinkIcon.js +0 -7
- package/dist/scripts/src/components/Icon/Icon.js +0 -42
- package/dist/scripts/src/components/Icon/Icon.spec.js +0 -527
- package/dist/scripts/src/components/Icon/IconNative.js +0 -127
- package/dist/scripts/src/components/Icon/ImageFileIcon.js +0 -10
- package/dist/scripts/src/components/Icon/Inspect.js +0 -10
- package/dist/scripts/src/components/Icon/LightToDark.js +0 -10
- package/dist/scripts/src/components/Icon/LinkIcon.js +0 -7
- package/dist/scripts/src/components/Icon/ListIcon.js +0 -7
- package/dist/scripts/src/components/Icon/LooseListIcon.js +0 -7
- package/dist/scripts/src/components/Icon/MoonIcon.js +0 -10
- package/dist/scripts/src/components/Icon/MoreOptionsIcon.js +0 -7
- package/dist/scripts/src/components/Icon/NoSortIcon.js +0 -8
- package/dist/scripts/src/components/Icon/PDFIcon.js +0 -10
- package/dist/scripts/src/components/Icon/PenIcon.js +0 -7
- package/dist/scripts/src/components/Icon/PhoneIcon.js +0 -7
- package/dist/scripts/src/components/Icon/PhotoIcon.js +0 -10
- package/dist/scripts/src/components/Icon/PlusIcon.js +0 -7
- package/dist/scripts/src/components/Icon/SearchIcon.js +0 -7
- package/dist/scripts/src/components/Icon/ShareIcon.js +0 -10
- package/dist/scripts/src/components/Icon/SortAscendingIcon.js +0 -8
- package/dist/scripts/src/components/Icon/SortDescendingIcon.js +0 -8
- package/dist/scripts/src/components/Icon/StarsIcon.js +0 -10
- package/dist/scripts/src/components/Icon/SunIcon.js +0 -10
- package/dist/scripts/src/components/Icon/TableDeleteColumnIcon.js +0 -7
- package/dist/scripts/src/components/Icon/TableDeleteRowIcon.js +0 -7
- package/dist/scripts/src/components/Icon/TableInsertColumnIcon.js +0 -7
- package/dist/scripts/src/components/Icon/TableInsertRowIcon.js +0 -7
- package/dist/scripts/src/components/Icon/TrashIcon.js +0 -7
- package/dist/scripts/src/components/Icon/TrendingDownIcon.js +0 -10
- package/dist/scripts/src/components/Icon/TrendingLevelIcon.js +0 -10
- package/dist/scripts/src/components/Icon/TrendingUpIcon.js +0 -10
- package/dist/scripts/src/components/Icon/TxtIcon.js +0 -10
- package/dist/scripts/src/components/Icon/UnknownFileIcon.js +0 -10
- package/dist/scripts/src/components/Icon/UnlinkIcon.js +0 -10
- package/dist/scripts/src/components/Icon/UserIcon.js +0 -7
- package/dist/scripts/src/components/Icon/WarningIcon.js +0 -7
- package/dist/scripts/src/components/Icon/XlsIcon.js +0 -10
- package/dist/scripts/src/components/IconProvider.js +0 -300
- package/dist/scripts/src/components/IconRegistryContext.js +0 -318
- package/dist/scripts/src/components/Image/Image.js +0 -52
- package/dist/scripts/src/components/Image/Image.spec.js +0 -198
- package/dist/scripts/src/components/Image/ImageNative.js +0 -73
- package/dist/scripts/src/components/Input/InputAdornment.js +0 -28
- package/dist/scripts/src/components/Input/InputDivider.js +0 -35
- package/dist/scripts/src/components/Input/InputLabel.js +0 -25
- package/dist/scripts/src/components/Input/PartialInput.js +0 -155
- package/dist/scripts/src/components/Input/index.js +0 -5
- package/dist/scripts/src/components/InspectButton/InspectButton.js +0 -35
- package/dist/scripts/src/components/Items/Items.js +0 -39
- package/dist/scripts/src/components/Items/Items.spec.js +0 -397
- package/dist/scripts/src/components/Items/ItemsNative.js +0 -33
- package/dist/scripts/src/components/Link/Link.js +0 -82
- package/dist/scripts/src/components/Link/Link.spec.js +0 -894
- package/dist/scripts/src/components/Link/LinkNative.js +0 -48
- package/dist/scripts/src/components/List/List.js +0 -130
- package/dist/scripts/src/components/List/List.spec.js +0 -927
- package/dist/scripts/src/components/List/ListNative.js +0 -433
- package/dist/scripts/src/components/List/doc-resources/list-component-data.js +0 -53
- package/dist/scripts/src/components/Logo/Logo.js +0 -30
- package/dist/scripts/src/components/Logo/LogoNative.js +0 -32
- package/dist/scripts/src/components/Markdown/CodeText.js +0 -38
- package/dist/scripts/src/components/Markdown/Markdown.js +0 -143
- package/dist/scripts/src/components/Markdown/Markdown.spec.js +0 -188
- package/dist/scripts/src/components/Markdown/MarkdownNative.js +0 -476
- package/dist/scripts/src/components/Markdown/parse-binding-expr.js +0 -60
- package/dist/scripts/src/components/Markdown/utils.js +0 -389
- package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +0 -111
- package/dist/scripts/src/components/ModalDialog/Dialog.js +0 -20
- package/dist/scripts/src/components/ModalDialog/ModalDialog.js +0 -83
- package/dist/scripts/src/components/ModalDialog/ModalDialog.spec.js +0 -181
- package/dist/scripts/src/components/ModalDialog/ModalDialogNative.js +0 -217
- package/dist/scripts/src/components/ModalDialog/ModalVisibilityContext.js +0 -60
- package/dist/scripts/src/components/NavGroup/NavGroup.js +0 -70
- package/dist/scripts/src/components/NavGroup/NavGroup.spec.js +0 -304
- package/dist/scripts/src/components/NavGroup/NavGroupContext.js +0 -13
- package/dist/scripts/src/components/NavGroup/NavGroupNative.js +0 -133
- package/dist/scripts/src/components/NavLink/NavLink.js +0 -86
- package/dist/scripts/src/components/NavLink/NavLink.spec.js +0 -864
- package/dist/scripts/src/components/NavLink/NavLinkNative.js +0 -73
- package/dist/scripts/src/components/NavPanel/NavPanel.js +0 -53
- package/dist/scripts/src/components/NavPanel/NavPanel.spec.js +0 -864
- package/dist/scripts/src/components/NavPanel/NavPanelNative.js +0 -222
- package/dist/scripts/src/components/NestedApp/AppWithCodeView.js +0 -91
- package/dist/scripts/src/components/NestedApp/AppWithCodeViewNative.js +0 -84
- package/dist/scripts/src/components/NestedApp/NestedApp.js +0 -86
- package/dist/scripts/src/components/NestedApp/NestedAppNative.js +0 -231
- package/dist/scripts/src/components/NestedApp/Tooltip.js +0 -46
- package/dist/scripts/src/components/NestedApp/defaultProps.js +0 -12
- package/dist/scripts/src/components/NestedApp/utils.js +0 -67
- package/dist/scripts/src/components/NoResult/NoResult.js +0 -46
- package/dist/scripts/src/components/NoResult/NoResult.spec.js +0 -863
- package/dist/scripts/src/components/NoResult/NoResultNative.js +0 -31
- package/dist/scripts/src/components/NumberBox/NumberBox.js +0 -123
- package/dist/scripts/src/components/NumberBox/NumberBox.spec.js +0 -979
- package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +0 -513
- package/dist/scripts/src/components/NumberBox/numberbox-abstractions.js +0 -109
- package/dist/scripts/src/components/Option/Option.js +0 -44
- package/dist/scripts/src/components/Option/Option.spec.js +0 -474
- package/dist/scripts/src/components/Option/OptionNative.js +0 -29
- package/dist/scripts/src/components/Option/OptionTypeProvider.js +0 -16
- package/dist/scripts/src/components/PageMetaTitle/PageMetaTilteNative.js +0 -13
- package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.js +0 -22
- package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.spec.js +0 -80
- package/dist/scripts/src/components/Pages/Pages.js +0 -54
- package/dist/scripts/src/components/Pages/PagesNative.js +0 -57
- package/dist/scripts/src/components/Pagination/Pagination.js +0 -107
- package/dist/scripts/src/components/Pagination/Pagination.spec.js +0 -1008
- package/dist/scripts/src/components/Pagination/PaginationNative.js +0 -157
- package/dist/scripts/src/components/PositionedContainer/PositionedContainer.js +0 -24
- package/dist/scripts/src/components/PositionedContainer/PositionedContainerNative.js +0 -14
- package/dist/scripts/src/components/ProfileMenu/ProfileMenu.js +0 -20
- package/dist/scripts/src/components/ProgressBar/ProgressBar.js +0 -38
- package/dist/scripts/src/components/ProgressBar/ProgressBar.spec.js +0 -166
- package/dist/scripts/src/components/ProgressBar/ProgressBarNative.js +0 -28
- package/dist/scripts/src/components/Queue/Queue.js +0 -85
- package/dist/scripts/src/components/Queue/Queue.spec.js +0 -624
- package/dist/scripts/src/components/Queue/QueueNative.js +0 -342
- package/dist/scripts/src/components/Queue/queueActions.js +0 -87
- package/dist/scripts/src/components/RadioGroup/RadioGroup.js +0 -61
- package/dist/scripts/src/components/RadioGroup/RadioGroup.spec.js +0 -490
- package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +0 -158
- package/dist/scripts/src/components/RadioGroup/RadioItem.js +0 -28
- package/dist/scripts/src/components/RadioGroup/RadioItemNative.js +0 -62
- package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapter.js +0 -24
- package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapterNative.js +0 -135
- package/dist/scripts/src/components/Redirect/Redirect.js +0 -31
- package/dist/scripts/src/components/Redirect/Redirect.spec.js +0 -527
- package/dist/scripts/src/components/ResponsiveBar/ResponsiveBar.js +0 -60
- package/dist/scripts/src/components/ResponsiveBar/ResponsiveBar.spec.js +0 -76
- package/dist/scripts/src/components/ResponsiveBar/ResponsiveBarNative.js +0 -313
- package/dist/scripts/src/components/Select/HiddenOption.js +0 -20
- package/dist/scripts/src/components/Select/OptionContext.js +0 -12
- package/dist/scripts/src/components/Select/Select.js +0 -131
- package/dist/scripts/src/components/Select/Select.spec.js +0 -763
- package/dist/scripts/src/components/Select/SelectContext.js +0 -16
- package/dist/scripts/src/components/Select/SelectNative.js +0 -440
- package/dist/scripts/src/components/SelectionStore/SelectionStore.js +0 -25
- package/dist/scripts/src/components/SelectionStore/SelectionStoreNative.js +0 -103
- package/dist/scripts/src/components/Slider/Slider.js +0 -115
- package/dist/scripts/src/components/Slider/Slider.spec.js +0 -677
- package/dist/scripts/src/components/Slider/SliderNative.js +0 -237
- package/dist/scripts/src/components/Slot/Slot.js +0 -17
- package/dist/scripts/src/components/Slot/Slot.spec.js +0 -368
- package/dist/scripts/src/components/SlotItem.js +0 -32
- package/dist/scripts/src/components/SpaceFiller/SpaceFiller.js +0 -20
- package/dist/scripts/src/components/SpaceFiller/SpaceFiller.spec.js +0 -184
- package/dist/scripts/src/components/SpaceFiller/SpaceFillerNative.js +0 -10
- package/dist/scripts/src/components/Spinner/Spinner.js +0 -39
- package/dist/scripts/src/components/Spinner/Spinner.spec.js +0 -161
- package/dist/scripts/src/components/Spinner/SpinnerNative.js +0 -48
- package/dist/scripts/src/components/Splitter/HSplitter.spec.js +0 -104
- package/dist/scripts/src/components/Splitter/Splitter.js +0 -163
- package/dist/scripts/src/components/Splitter/Splitter.spec.js +0 -856
- package/dist/scripts/src/components/Splitter/SplitterNative.js +0 -205
- package/dist/scripts/src/components/Splitter/VSplitter.spec.js +0 -104
- package/dist/scripts/src/components/Splitter/utils.js +0 -22
- package/dist/scripts/src/components/Stack/CHStack.spec.js +0 -86
- package/dist/scripts/src/components/Stack/CVStack.spec.js +0 -86
- package/dist/scripts/src/components/Stack/HStack.spec.js +0 -67
- package/dist/scripts/src/components/Stack/Stack.js +0 -156
- package/dist/scripts/src/components/Stack/Stack.spec.js +0 -654
- package/dist/scripts/src/components/Stack/StackNative.js +0 -45
- package/dist/scripts/src/components/Stack/VStack.spec.js +0 -67
- package/dist/scripts/src/components/StickyBox/StickyBox.js +0 -34
- package/dist/scripts/src/components/StickyBox/StickyBoxNative.js +0 -42
- package/dist/scripts/src/components/Switch/Switch.js +0 -80
- package/dist/scripts/src/components/Switch/Switch.spec.js +0 -834
- package/dist/scripts/src/components/Table/Table.js +0 -268
- package/dist/scripts/src/components/Table/Table.spec.js +0 -827
- package/dist/scripts/src/components/Table/TableNative.js +0 -670
- package/dist/scripts/src/components/Table/doc-resources/list-component-data.js +0 -53
- package/dist/scripts/src/components/Table/useRowSelection.js +0 -454
- package/dist/scripts/src/components/TableOfContents/TableOfContents.js +0 -76
- package/dist/scripts/src/components/TableOfContents/TableOfContents.spec.js +0 -838
- package/dist/scripts/src/components/TableOfContents/TableOfContentsNative.js +0 -81
- package/dist/scripts/src/components/Tabs/TabContext.js +0 -58
- package/dist/scripts/src/components/Tabs/TabItem.js +0 -44
- package/dist/scripts/src/components/Tabs/TabItemNative.js +0 -53
- package/dist/scripts/src/components/Tabs/Tabs.js +0 -95
- package/dist/scripts/src/components/Tabs/Tabs.spec.js +0 -1237
- package/dist/scripts/src/components/Tabs/TabsNative.js +0 -137
- package/dist/scripts/src/components/Text/Text.js +0 -181
- package/dist/scripts/src/components/Text/Text.spec.js +0 -1676
- package/dist/scripts/src/components/Text/TextNative.js +0 -244
- package/dist/scripts/src/components/TextArea/TextArea.js +0 -103
- package/dist/scripts/src/components/TextArea/TextArea.spec.js +0 -886
- package/dist/scripts/src/components/TextArea/TextAreaNative.js +0 -196
- package/dist/scripts/src/components/TextArea/TextAreaResizable.js +0 -73
- package/dist/scripts/src/components/TextArea/useComposedRef.js +0 -60
- package/dist/scripts/src/components/TextBox/TextBox.js +0 -133
- package/dist/scripts/src/components/TextBox/TextBox.spec.js +0 -758
- package/dist/scripts/src/components/TextBox/TextBoxNative.js +0 -142
- package/dist/scripts/src/components/Theme/NotificationToast.js +0 -64
- package/dist/scripts/src/components/Theme/Theme.js +0 -47
- package/dist/scripts/src/components/Theme/Theme.spec.js +0 -390
- package/dist/scripts/src/components/Theme/ThemeNative.js +0 -162
- package/dist/scripts/src/components/TimeInput/TimeInput.js +0 -149
- package/dist/scripts/src/components/TimeInput/TimeInput.spec.js +0 -1236
- package/dist/scripts/src/components/TimeInput/TimeInputNative.js +0 -650
- package/dist/scripts/src/components/TimeInput/utils.js +0 -197
- package/dist/scripts/src/components/Timer/Timer.js +0 -62
- package/dist/scripts/src/components/Timer/Timer.spec.js +0 -328
- package/dist/scripts/src/components/Timer/TimerNative.js +0 -178
- package/dist/scripts/src/components/Toggle/Toggle.js +0 -172
- package/dist/scripts/src/components/ToneChangerButton/ToneChangerButton.js +0 -63
- package/dist/scripts/src/components/ToneChangerButton/ToneChangerButton.spec.js +0 -414
- package/dist/scripts/src/components/ToneSwitch/ToneSwitch.js +0 -51
- package/dist/scripts/src/components/ToneSwitch/ToneSwitch.spec.js +0 -89
- package/dist/scripts/src/components/ToneSwitch/ToneSwitchNative.js +0 -42
- package/dist/scripts/src/components/Tooltip/Tooltip.js +0 -118
- package/dist/scripts/src/components/Tooltip/Tooltip.spec.js +0 -418
- package/dist/scripts/src/components/Tooltip/TooltipNative.js +0 -160
- package/dist/scripts/src/components/Tree/Tree-dynamic.spec.js +0 -2894
- package/dist/scripts/src/components/Tree/Tree-icons.spec.js +0 -206
- package/dist/scripts/src/components/Tree/Tree.spec.js +0 -2839
- package/dist/scripts/src/components/Tree/TreeComponent.js +0 -324
- package/dist/scripts/src/components/Tree/TreeNative.js +0 -1129
- package/dist/scripts/src/components/Tree/testData.js +0 -296
- package/dist/scripts/src/components/TreeDisplay/TreeDisplay.js +0 -49
- package/dist/scripts/src/components/TreeDisplay/TreeDisplayNative.js +0 -104
- package/dist/scripts/src/components/ValidationSummary/ValidationSummary.js +0 -64
- package/dist/scripts/src/components/VisuallyHidden.js +0 -21
- package/dist/scripts/src/components/abstractions.js +0 -341
- package/dist/scripts/src/components/chart-color-schemes.js +0 -43
- package/dist/scripts/src/components/collectedComponentMetadata.js +0 -316
- package/dist/scripts/src/components/component-utils.js +0 -29
- package/dist/scripts/src/components/container-helpers.js +0 -26
- package/dist/scripts/src/components/metadata-helpers.js +0 -269
- package/dist/scripts/src/components-core/ApiBoundComponent.js +0 -227
- package/dist/scripts/src/components-core/AppContext.js +0 -16
- package/dist/scripts/src/components-core/ComponentDecorator.js +0 -74
- package/dist/scripts/src/components-core/ComponentViewer.js +0 -69
- package/dist/scripts/src/components-core/CompoundComponent.js +0 -145
- package/dist/scripts/src/components-core/DebugViewProvider.js +0 -43
- package/dist/scripts/src/components-core/EngineError.js +0 -91
- package/dist/scripts/src/components-core/InspectorContext.js +0 -248
- package/dist/scripts/src/components-core/LoaderComponent.js +0 -109
- package/dist/scripts/src/components-core/RestApiProxy.js +0 -468
- package/dist/scripts/src/components-core/StandaloneApp.js +0 -821
- package/dist/scripts/src/components-core/StandaloneExtensionManager.js +0 -44
- package/dist/scripts/src/components-core/TableOfContentsContext.js +0 -168
- package/dist/scripts/src/components-core/abstractions/ComponentRenderer.js +0 -2
- package/dist/scripts/src/components-core/abstractions/LoaderRenderer.js +0 -2
- package/dist/scripts/src/components-core/abstractions/standalone.js +0 -2
- package/dist/scripts/src/components-core/abstractions/treeAbstractions.js +0 -2
- package/dist/scripts/src/components-core/action/APICall.js +0 -284
- package/dist/scripts/src/components-core/action/FileDownloadAction.js +0 -80
- package/dist/scripts/src/components-core/action/FileUploadAction.js +0 -88
- package/dist/scripts/src/components-core/action/NavigateAction.js +0 -20
- package/dist/scripts/src/components-core/action/TimedAction.js +0 -21
- package/dist/scripts/src/components-core/action/actions.js +0 -15
- package/dist/scripts/src/components-core/appContext/date-functions.js +0 -24
- package/dist/scripts/src/components-core/appContext/math-function.js +0 -27
- package/dist/scripts/src/components-core/appContext/misc-utils.js +0 -14
- package/dist/scripts/src/components-core/behaviors/Behavior.js +0 -2
- package/dist/scripts/src/components-core/behaviors/CoreBehaviors.js +0 -201
- package/dist/scripts/src/components-core/component-hooks.js +0 -25
- package/dist/scripts/src/components-core/constants.js +0 -18
- package/dist/scripts/src/components-core/descriptorHelper.js +0 -96
- package/dist/scripts/src/components-core/devtools/InspectorDialog.js +0 -135
- package/dist/scripts/src/components-core/devtools/InspectorDialogVisibilityContext.js +0 -8
- package/dist/scripts/src/components-core/event-handlers.js +0 -46
- package/dist/scripts/src/components-core/interception/ApiInterceptor.js +0 -247
- package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +0 -167
- package/dist/scripts/src/components-core/interception/Backend.js +0 -141
- package/dist/scripts/src/components-core/interception/Errors.js +0 -129
- package/dist/scripts/src/components-core/interception/InMemoryDb.js +0 -41
- package/dist/scripts/src/components-core/interception/IndexedDb.js +0 -205
- package/dist/scripts/src/components-core/interception/ReadonlyCollection.js +0 -145
- package/dist/scripts/src/components-core/interception/abstractions.js +0 -2
- package/dist/scripts/src/components-core/interception/apiInterceptorWorker.js +0 -44
- package/dist/scripts/src/components-core/interception/initMock.js +0 -20
- package/dist/scripts/src/components-core/interception/useApiInterceptorContext.js +0 -9
- package/dist/scripts/src/components-core/loader/ApiLoader.js +0 -54
- package/dist/scripts/src/components-core/loader/DataLoader.js +0 -330
- package/dist/scripts/src/components-core/loader/ExternalDataLoader.js +0 -60
- package/dist/scripts/src/components-core/loader/Loader.js +0 -159
- package/dist/scripts/src/components-core/loader/MockLoaderRenderer.js +0 -43
- package/dist/scripts/src/components-core/loader/PageableLoader.js +0 -272
- package/dist/scripts/src/components-core/markup-check.js +0 -279
- package/dist/scripts/src/components-core/parts.js +0 -11
- package/dist/scripts/src/components-core/renderers.js +0 -76
- package/dist/scripts/src/components-core/rendering/AppContent.js +0 -400
- package/dist/scripts/src/components-core/rendering/AppRoot.js +0 -87
- package/dist/scripts/src/components-core/rendering/AppWrapper.js +0 -49
- package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +0 -380
- package/dist/scripts/src/components-core/rendering/ComponentWrapper.js +0 -166
- package/dist/scripts/src/components-core/rendering/Container.js +0 -621
- package/dist/scripts/src/components-core/rendering/ContainerWrapper.js +0 -94
- package/dist/scripts/src/components-core/rendering/ErrorBoundary.js +0 -65
- package/dist/scripts/src/components-core/rendering/InvalidComponent.js +0 -17
- package/dist/scripts/src/components-core/rendering/StandaloneComponent.js +0 -39
- package/dist/scripts/src/components-core/rendering/StateContainer.js +0 -350
- package/dist/scripts/src/components-core/rendering/UnknownComponent.js +0 -15
- package/dist/scripts/src/components-core/rendering/buildProxy.js +0 -58
- package/dist/scripts/src/components-core/rendering/collectFnVarDeps.js +0 -49
- package/dist/scripts/src/components-core/rendering/containers.js +0 -19
- package/dist/scripts/src/components-core/rendering/nodeUtils.js +0 -6
- package/dist/scripts/src/components-core/rendering/reducer.js +0 -160
- package/dist/scripts/src/components-core/rendering/renderChild.js +0 -82
- package/dist/scripts/src/components-core/rendering/valueExtractor.js +0 -216
- package/dist/scripts/src/components-core/reportEngineError.js +0 -62
- package/dist/scripts/src/components-core/script-runner/AttributeValueParser.js +0 -117
- package/dist/scripts/src/components-core/script-runner/BindingTreeEvaluationContext.js +0 -33
- package/dist/scripts/src/components-core/script-runner/ParameterParser.js +0 -117
- package/dist/scripts/src/components-core/script-runner/ScriptingSourceTree.js +0 -45
- package/dist/scripts/src/components-core/script-runner/asyncProxy.js +0 -96
- package/dist/scripts/src/components-core/script-runner/bannedFunctions.js +0 -34
- package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +0 -613
- package/dist/scripts/src/components-core/script-runner/eval-tree-common.js +0 -439
- package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +0 -522
- package/dist/scripts/src/components-core/script-runner/process-statement-async.js +0 -761
- package/dist/scripts/src/components-core/script-runner/process-statement-common.js +0 -208
- package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +0 -746
- package/dist/scripts/src/components-core/script-runner/simplify-expression.js +0 -386
- package/dist/scripts/src/components-core/script-runner/statement-queue.js +0 -63
- package/dist/scripts/src/components-core/script-runner/visitors.js +0 -369
- package/dist/scripts/src/components-core/theming/StyleContext.js +0 -133
- package/dist/scripts/src/components-core/theming/StyleRegistry.js +0 -171
- package/dist/scripts/src/components-core/theming/ThemeContext.js +0 -53
- package/dist/scripts/src/components-core/theming/ThemeProvider.js +0 -342
- package/dist/scripts/src/components-core/theming/component-layout-resolver.js +0 -153
- package/dist/scripts/src/components-core/theming/extendThemeUtils.js +0 -47
- package/dist/scripts/src/components-core/theming/hvar.js +0 -105
- package/dist/scripts/src/components-core/theming/layout-resolver.js +0 -388
- package/dist/scripts/src/components-core/theming/parse-layout-props.js +0 -136
- package/dist/scripts/src/components-core/theming/themeVars.js +0 -62
- package/dist/scripts/src/components-core/theming/themes/base-utils.js +0 -15
- package/dist/scripts/src/components-core/theming/themes/palette.js +0 -57
- package/dist/scripts/src/components-core/theming/themes/root.js +0 -434
- package/dist/scripts/src/components-core/theming/themes/solid.js +0 -16
- package/dist/scripts/src/components-core/theming/themes/theme-colors.js +0 -561
- package/dist/scripts/src/components-core/theming/themes/xmlui.js +0 -57
- package/dist/scripts/src/components-core/theming/transformThemeVars.js +0 -733
- package/dist/scripts/src/components-core/theming/utils.js +0 -31
- package/dist/scripts/src/components-core/utils/DataLoaderQueryKeyGenerator.js +0 -41
- package/dist/scripts/src/components-core/utils/LruCache.js +0 -184
- package/dist/scripts/src/components-core/utils/actionUtils.js +0 -32
- package/dist/scripts/src/components-core/utils/audio-utils.js +0 -83
- package/dist/scripts/src/components-core/utils/base64-utils.js +0 -124
- package/dist/scripts/src/components-core/utils/compound-utils.js +0 -11
- package/dist/scripts/src/components-core/utils/css-utils.js +0 -179
- package/dist/scripts/src/components-core/utils/date-utils.js +0 -186
- package/dist/scripts/src/components-core/utils/extractParam.js +0 -281
- package/dist/scripts/src/components-core/utils/hooks.js +0 -400
- package/dist/scripts/src/components-core/utils/mergeProps.js +0 -45
- package/dist/scripts/src/components-core/utils/misc.js +0 -539
- package/dist/scripts/src/components-core/utils/request-params.js +0 -70
- package/dist/scripts/src/components-core/utils/statementUtils.js +0 -224
- package/dist/scripts/src/components-core/utils/treeUtils.js +0 -226
- package/dist/scripts/src/components-core/xmlui-parser.js +0 -548
- package/dist/scripts/src/index-standalone.js +0 -61
- package/dist/scripts/src/index.js +0 -158
- package/dist/scripts/src/language-server/server-common.js +0 -152
- package/dist/scripts/src/language-server/server-web-worker.js +0 -47
- package/dist/scripts/src/language-server/server.js +0 -42
- package/dist/scripts/src/language-server/services/common/docs-generation.js +0 -73
- package/dist/scripts/src/language-server/services/common/lsp-utils.js +0 -9
- package/dist/scripts/src/language-server/services/common/metadata-utils.js +0 -157
- package/dist/scripts/src/language-server/services/common/syntax-node-utilities.js +0 -127
- package/dist/scripts/src/language-server/services/completion.js +0 -288
- package/dist/scripts/src/language-server/services/diagnostic.js +0 -19
- package/dist/scripts/src/language-server/services/format.js +0 -569
- package/dist/scripts/src/language-server/services/hover.js +0 -164
- package/dist/scripts/src/language-server/xmlui-metadata-generated.js +0 -16276
- package/dist/scripts/src/logging/LoggerContext.js +0 -22
- package/dist/scripts/src/logging/LoggerInitializer.js +0 -14
- package/dist/scripts/src/logging/LoggerService.js +0 -60
- package/dist/scripts/src/logging/xmlui.js +0 -21
- package/dist/scripts/src/parsers/common/GenericToken.js +0 -2
- package/dist/scripts/src/parsers/common/InputStream.js +0 -59
- package/dist/scripts/src/parsers/common/utils.js +0 -19
- package/dist/scripts/src/parsers/scripting/Lexer.js +0 -1097
- package/dist/scripts/src/parsers/scripting/Parser.js +0 -2638
- package/dist/scripts/src/parsers/scripting/ParserError.js +0 -47
- package/dist/scripts/src/parsers/scripting/ScriptingNodeTypes.js +0 -50
- package/dist/scripts/src/parsers/scripting/TokenTrait.js +0 -108
- package/dist/scripts/src/parsers/scripting/TokenType.js +0 -109
- package/dist/scripts/src/parsers/scripting/code-behind-collect.js +0 -101
- package/dist/scripts/src/parsers/scripting/modules.js +0 -105
- package/dist/scripts/src/parsers/scripting/tree-visitor.js +0 -601
- package/dist/scripts/src/parsers/style-parser/StyleInputStream.js +0 -39
- package/dist/scripts/src/parsers/style-parser/StyleLexer.js +0 -623
- package/dist/scripts/src/parsers/style-parser/StyleParser.js +0 -453
- package/dist/scripts/src/parsers/style-parser/errors.js +0 -37
- package/dist/scripts/src/parsers/style-parser/source-tree.js +0 -2
- package/dist/scripts/src/parsers/style-parser/tokens.js +0 -43
- package/dist/scripts/src/parsers/xmlui-parser/CharacterCodes.js +0 -136
- package/dist/scripts/src/parsers/xmlui-parser/ParserError.js +0 -60
- package/dist/scripts/src/parsers/xmlui-parser/diagnostics.js +0 -172
- package/dist/scripts/src/parsers/xmlui-parser/fileExtensions.js +0 -6
- package/dist/scripts/src/parsers/xmlui-parser/index.js +0 -29
- package/dist/scripts/src/parsers/xmlui-parser/lint.js +0 -165
- package/dist/scripts/src/parsers/xmlui-parser/parser.js +0 -627
- package/dist/scripts/src/parsers/xmlui-parser/scanner.js +0 -415
- package/dist/scripts/src/parsers/xmlui-parser/syntax-kind.js +0 -123
- package/dist/scripts/src/parsers/xmlui-parser/syntax-node.js +0 -83
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +0 -1131
- package/dist/scripts/src/parsers/xmlui-parser/utils.js +0 -83
- package/dist/scripts/src/parsers/xmlui-parser/xmlui-serializer.js +0 -582
- package/dist/scripts/src/parsers/xmlui-parser/xmlui-tree.js +0 -2
- package/dist/scripts/src/syntax/monaco/grammar.monacoLanguage.js +0 -286
- package/dist/scripts/src/syntax/monaco/index.js +0 -14
- package/dist/scripts/src/syntax/monaco/xmlui-dark.js +0 -25
- package/dist/scripts/src/syntax/monaco/xmlui-light.js +0 -25
- package/dist/scripts/src/syntax/monaco/xmluiscript.monacoLanguage.js +0 -310
- package/dist/scripts/src/syntax/textMate/index.js +0 -14
- package/dist/scripts/src/syntax/textMate/xmlui-dark.json +0 -631
- package/dist/scripts/src/syntax/textMate/xmlui-light.json +0 -565
- package/dist/scripts/src/syntax/textMate/xmlui.json +0 -564
- package/dist/scripts/src/syntax/textMate/xmlui.tmLanguage.json +0 -341
- package/dist/scripts/src/testing/ComponentDrivers.js +0 -1380
- package/dist/scripts/src/testing/assertions.js +0 -444
- package/dist/scripts/src/testing/component-test-helpers.js +0 -373
- package/dist/scripts/src/testing/drivers/DateInputDriver.js +0 -19
- package/dist/scripts/src/testing/drivers/ModalDialogDriver.js +0 -10
- package/dist/scripts/src/testing/drivers/NumberBoxDriver.js +0 -44
- package/dist/scripts/src/testing/drivers/TextBoxDriver.js +0 -20
- package/dist/scripts/src/testing/drivers/TimeInputDriver.js +0 -22
- package/dist/scripts/src/testing/drivers/TimerDriver.js +0 -64
- package/dist/scripts/src/testing/drivers/TreeDriver.js +0 -13
- package/dist/scripts/src/testing/drivers/index.js +0 -9
- package/dist/scripts/src/testing/fixtures.js +0 -519
- package/dist/scripts/src/testing/index.js +0 -69
- package/dist/scripts/src/testing/infrastructure/TestBed.js +0 -17
- package/dist/scripts/src/testing/infrastructure/main.js +0 -9
- package/dist/scripts/src/testing/infrastructure/public/mockServiceWorker.js +0 -266
- package/dist/scripts/src/testing/themed-app-test-helpers.js +0 -133
|
@@ -1,1129 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.TreeComponent = exports.defaultProps = void 0;
|
|
16
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
17
|
-
const react_1 = require("react");
|
|
18
|
-
const virtua_1 = require("virtua");
|
|
19
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
20
|
-
const IconNative_1 = __importDefault(require("../Icon/IconNative"));
|
|
21
|
-
const SpinnerNative_1 = require("../Spinner/SpinnerNative");
|
|
22
|
-
const TreeComponent_module_scss_1 = __importDefault(require("./TreeComponent.module.scss"));
|
|
23
|
-
const treeUtils_1 = require("../../components-core/utils/treeUtils");
|
|
24
|
-
const TreeRow = (0, react_1.memo)(({ index, data }) => {
|
|
25
|
-
const { nodes, toggleNode, selectedId, itemRenderer, itemClickExpands, onItemClick, onSelection, focusedIndex, treeContainerRef, iconCollapsed, iconExpanded, iconSize, animateExpand, expandRotation, } = data;
|
|
26
|
-
const treeItem = nodes[index];
|
|
27
|
-
const isFocused = focusedIndex === index && focusedIndex >= 0;
|
|
28
|
-
// Use string comparison to handle type mismatches between selectedId and treeItem.key
|
|
29
|
-
const isSelected = String(selectedId) === String(treeItem.key);
|
|
30
|
-
const onToggleNode = (0, react_1.useCallback)((e) => {
|
|
31
|
-
e.stopPropagation();
|
|
32
|
-
// Prevent toggling if node is in loading state
|
|
33
|
-
const nodeWithState = treeItem;
|
|
34
|
-
if (nodeWithState.loadingState === "loading") {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
toggleNode(treeItem);
|
|
38
|
-
}, [toggleNode, treeItem]);
|
|
39
|
-
const onItemMouseDownHandler = (0, react_1.useCallback)((e) => {
|
|
40
|
-
// Handle selection immediately on mouse down for immediate visual feedback
|
|
41
|
-
if (treeItem.selectable) {
|
|
42
|
-
onSelection(treeItem);
|
|
43
|
-
// Ensure tree container maintains focus after mouse selection
|
|
44
|
-
setTimeout(() => {
|
|
45
|
-
var _a;
|
|
46
|
-
(_a = treeContainerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
47
|
-
}, 0);
|
|
48
|
-
}
|
|
49
|
-
}, [onSelection, treeItem, treeContainerRef]);
|
|
50
|
-
const onItemClickHandler = (0, react_1.useCallback)((e) => {
|
|
51
|
-
// Selection is already handled in onMouseDown, so we skip it here
|
|
52
|
-
// Call optional onItemClick callback
|
|
53
|
-
if (onItemClick) {
|
|
54
|
-
onItemClick(treeItem);
|
|
55
|
-
}
|
|
56
|
-
// If itemClickExpands is enabled and item has children, also toggle
|
|
57
|
-
// But prevent toggling if node is in loading state
|
|
58
|
-
const nodeWithState = treeItem;
|
|
59
|
-
if (itemClickExpands && treeItem.hasChildren && nodeWithState.loadingState !== "loading") {
|
|
60
|
-
toggleNode(treeItem);
|
|
61
|
-
}
|
|
62
|
-
}, [onItemClick, itemClickExpands, treeItem, toggleNode]);
|
|
63
|
-
// Get loading state for styling and interaction
|
|
64
|
-
const nodeWithState = treeItem;
|
|
65
|
-
const isLoading = nodeWithState.loadingState === "loading";
|
|
66
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: { width: "100%", display: "flex" }, children: (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(TreeComponent_module_scss_1.default.rowWrapper, {
|
|
67
|
-
[TreeComponent_module_scss_1.default.selected]: isSelected,
|
|
68
|
-
[TreeComponent_module_scss_1.default.focused]: isFocused,
|
|
69
|
-
}), role: "treeitem", "aria-level": treeItem.depth + 1, "aria-expanded": treeItem.hasChildren ? treeItem.isExpanded : undefined, "aria-selected": isSelected, "aria-label": treeItem.displayName, "aria-busy": isLoading, tabIndex: isFocused ? 0 : -1, children: [(0, jsx_runtime_1.jsxs)("div", { onClick: onToggleNode, className: TreeComponent_module_scss_1.default.gutter, style: { cursor: isLoading ? "default" : "pointer" }, children: [(0, jsx_runtime_1.jsx)("div", { style: { width: treeItem.depth * 10 }, className: TreeComponent_module_scss_1.default.depthPlaceholder }), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(TreeComponent_module_scss_1.default.toggleWrapper, {
|
|
70
|
-
[TreeComponent_module_scss_1.default.expanded]: treeItem.isExpanded,
|
|
71
|
-
[TreeComponent_module_scss_1.default.hidden]: !treeItem.hasChildren,
|
|
72
|
-
}), children: treeItem.hasChildren && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: treeItem.loadingState === "loading" ? ((0, jsx_runtime_1.jsx)(SpinnerNative_1.Spinner, { delay: 0, style: { width: 24, height: 24 } })) : ((0, jsx_runtime_1.jsx)(IconNative_1.default, { name: animateExpand
|
|
73
|
-
? treeItem.iconCollapsed || iconCollapsed
|
|
74
|
-
: treeItem.isExpanded
|
|
75
|
-
? treeItem.iconExpanded || iconExpanded
|
|
76
|
-
: treeItem.iconCollapsed || iconCollapsed, size: iconSize, className: (0, classnames_1.default)(TreeComponent_module_scss_1.default.toggleIcon, {
|
|
77
|
-
[TreeComponent_module_scss_1.default.rotated]: animateExpand && treeItem.isExpanded,
|
|
78
|
-
}), style: animateExpand && treeItem.isExpanded
|
|
79
|
-
? {
|
|
80
|
-
transform: `rotate(${expandRotation}deg)`,
|
|
81
|
-
}
|
|
82
|
-
: undefined })) })) })] }), (0, jsx_runtime_1.jsx)("div", { className: TreeComponent_module_scss_1.default.labelWrapper, onMouseDown: onItemMouseDownHandler, onClick: onItemClickHandler, style: { cursor: "pointer" }, children: itemRenderer(treeItem) })] }) }));
|
|
83
|
-
});
|
|
84
|
-
const emptyTreeData = {
|
|
85
|
-
treeData: [],
|
|
86
|
-
treeItemsById: {},
|
|
87
|
-
};
|
|
88
|
-
/**
|
|
89
|
-
* Find all parent node IDs for a given node ID by traversing up the tree structure
|
|
90
|
-
* @param nodeId The target node ID to find parents for
|
|
91
|
-
* @param treeItemsById Map of all tree nodes by their ID
|
|
92
|
-
* @returns Array of parent node IDs from immediate parent to root
|
|
93
|
-
*/
|
|
94
|
-
const findAllParentIds = (nodeId, treeItemsById) => {
|
|
95
|
-
const parentIds = [];
|
|
96
|
-
const targetNode = treeItemsById[String(nodeId)];
|
|
97
|
-
if (!targetNode) {
|
|
98
|
-
return parentIds;
|
|
99
|
-
}
|
|
100
|
-
// Walk up the tree using parentIds property which contains the path from root to parent
|
|
101
|
-
if (targetNode.parentIds && targetNode.parentIds.length > 0) {
|
|
102
|
-
parentIds.push(...targetNode.parentIds);
|
|
103
|
-
}
|
|
104
|
-
return parentIds;
|
|
105
|
-
};
|
|
106
|
-
/**
|
|
107
|
-
* Expand all parent paths for an array of node IDs to ensure they are visible
|
|
108
|
-
* @param nodeIds Array of node IDs that should be expanded
|
|
109
|
-
* @param treeItemsById Map of all tree nodes by their ID
|
|
110
|
-
* @returns Array containing original node IDs plus all necessary parent IDs
|
|
111
|
-
*/
|
|
112
|
-
const expandParentPaths = (nodeIds, treeItemsById) => {
|
|
113
|
-
const allExpandedIds = new Set(nodeIds);
|
|
114
|
-
// For each target node, find and add all its parent IDs
|
|
115
|
-
nodeIds.forEach((nodeId) => {
|
|
116
|
-
const parentIds = findAllParentIds(nodeId, treeItemsById);
|
|
117
|
-
parentIds.forEach((parentId) => allExpandedIds.add(parentId));
|
|
118
|
-
});
|
|
119
|
-
return Array.from(allExpandedIds);
|
|
120
|
-
};
|
|
121
|
-
// Default props following XMLUI conventions
|
|
122
|
-
exports.defaultProps = {
|
|
123
|
-
dataFormat: "flat",
|
|
124
|
-
idField: "id",
|
|
125
|
-
nameField: "name",
|
|
126
|
-
iconField: "icon",
|
|
127
|
-
iconExpandedField: "iconExpanded",
|
|
128
|
-
iconCollapsedField: "iconCollapsed",
|
|
129
|
-
parentIdField: "parentId",
|
|
130
|
-
childrenField: "children",
|
|
131
|
-
selectableField: "selectable",
|
|
132
|
-
defaultExpanded: "none",
|
|
133
|
-
autoExpandToSelection: true,
|
|
134
|
-
itemClickExpands: false,
|
|
135
|
-
dynamicField: "dynamic",
|
|
136
|
-
iconCollapsed: "chevronright",
|
|
137
|
-
iconExpanded: "chevrondown",
|
|
138
|
-
iconSize: "16",
|
|
139
|
-
itemHeight: 32,
|
|
140
|
-
animateExpand: false,
|
|
141
|
-
expandRotation: 90,
|
|
142
|
-
};
|
|
143
|
-
exports.TreeComponent = (0, react_1.memo)((props) => {
|
|
144
|
-
const { registerComponentApi, data = emptyTreeData, dataFormat = exports.defaultProps.dataFormat, idField = exports.defaultProps.idField, nameField = exports.defaultProps.nameField, iconField = exports.defaultProps.iconField, iconExpandedField = exports.defaultProps.iconExpandedField, iconCollapsedField = exports.defaultProps.iconCollapsedField, parentIdField = exports.defaultProps.parentIdField, childrenField = exports.defaultProps.childrenField, selectableField = exports.defaultProps.selectableField, selectedValue, selectedId, defaultExpanded = exports.defaultProps.defaultExpanded, autoExpandToSelection = exports.defaultProps.autoExpandToSelection, itemClickExpands = exports.defaultProps.itemClickExpands, dynamicField = exports.defaultProps.dynamicField, iconCollapsed = exports.defaultProps.iconCollapsed, iconExpanded = exports.defaultProps.iconExpanded, iconSize = exports.defaultProps.iconSize, itemHeight = exports.defaultProps.itemHeight, animateExpand = exports.defaultProps.animateExpand, expandRotation = exports.defaultProps.expandRotation, onItemClick, onSelectionChanged, onNodeExpanded, onNodeCollapsed, loadChildren, itemRenderer, className, } = props;
|
|
145
|
-
// Internal selection state for uncontrolled usage
|
|
146
|
-
// Initialize with selectedValue if provided and no onSelectionChanged handler (uncontrolled mode)
|
|
147
|
-
const [internalSelectedId, setInternalSelectedId] = (0, react_1.useState)(() => {
|
|
148
|
-
return !onSelectionChanged && selectedValue ? selectedValue : undefined;
|
|
149
|
-
});
|
|
150
|
-
// Internal data state for API methods that modify the tree structure
|
|
151
|
-
const [internalData, setInternalData] = (0, react_1.useState)(undefined);
|
|
152
|
-
const [dataRevision, setDataRevision] = (0, react_1.useState)(0);
|
|
153
|
-
// Use internal data if available, otherwise use props data
|
|
154
|
-
const effectiveData = internalData !== null && internalData !== void 0 ? internalData : data;
|
|
155
|
-
// Helper function to update internal data and force re-render
|
|
156
|
-
const updateInternalData = (0, react_1.useCallback)((updater) => {
|
|
157
|
-
setInternalData(updater);
|
|
158
|
-
setDataRevision((prev) => prev + 1);
|
|
159
|
-
}, []);
|
|
160
|
-
// Build field configuration
|
|
161
|
-
const fieldConfig = (0, react_1.useMemo)(() => ({
|
|
162
|
-
idField: idField || "id",
|
|
163
|
-
labelField: nameField || "name",
|
|
164
|
-
iconField,
|
|
165
|
-
iconExpandedField,
|
|
166
|
-
iconCollapsedField,
|
|
167
|
-
parentField: parentIdField,
|
|
168
|
-
childrenField,
|
|
169
|
-
selectableField,
|
|
170
|
-
dynamicField,
|
|
171
|
-
}), [
|
|
172
|
-
idField,
|
|
173
|
-
nameField,
|
|
174
|
-
iconField,
|
|
175
|
-
iconExpandedField,
|
|
176
|
-
iconCollapsedField,
|
|
177
|
-
parentIdField,
|
|
178
|
-
childrenField,
|
|
179
|
-
selectableField,
|
|
180
|
-
dynamicField,
|
|
181
|
-
]);
|
|
182
|
-
// Steps 3a & 3b: Transform data based on format
|
|
183
|
-
// Enhanced data transformation pipeline with validation and error handling
|
|
184
|
-
const transformedData = (0, react_1.useMemo)(() => {
|
|
185
|
-
// Return empty data if no data provided
|
|
186
|
-
if (!effectiveData) {
|
|
187
|
-
return emptyTreeData;
|
|
188
|
-
}
|
|
189
|
-
try {
|
|
190
|
-
if (dataFormat === "flat") {
|
|
191
|
-
// Validation: Flat format requires array
|
|
192
|
-
if (!Array.isArray(effectiveData)) {
|
|
193
|
-
throw new Error(`TreeComponent: dataFormat='flat' requires array data, received: ${typeof effectiveData}`);
|
|
194
|
-
}
|
|
195
|
-
// Validation: Check for required fields in sample data
|
|
196
|
-
if (effectiveData.length > 0) {
|
|
197
|
-
const sampleItem = effectiveData[0];
|
|
198
|
-
if (typeof sampleItem !== "object" || sampleItem === null) {
|
|
199
|
-
throw new Error("TreeComponent: Flat data items must be objects");
|
|
200
|
-
}
|
|
201
|
-
if (!(fieldConfig.idField in sampleItem)) {
|
|
202
|
-
throw new Error(`TreeComponent: Required field '${fieldConfig.idField}' not found in flat data items`);
|
|
203
|
-
}
|
|
204
|
-
if (!(fieldConfig.labelField in sampleItem)) {
|
|
205
|
-
throw new Error(`TreeComponent: Required field '${fieldConfig.labelField}' not found in flat data items`);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
return (0, treeUtils_1.flatToNative)(effectiveData, fieldConfig);
|
|
209
|
-
}
|
|
210
|
-
else if (dataFormat === "hierarchy") {
|
|
211
|
-
// Validation: Hierarchy format requires object or array
|
|
212
|
-
if (!effectiveData || typeof effectiveData !== "object") {
|
|
213
|
-
throw new Error(`TreeComponent: dataFormat='hierarchy' requires object or array data, received: ${typeof effectiveData}`);
|
|
214
|
-
}
|
|
215
|
-
// Validation: Check for required fields in hierarchy data
|
|
216
|
-
const checkHierarchyData = (item) => {
|
|
217
|
-
if (typeof item !== "object" || item === null) {
|
|
218
|
-
throw new Error("TreeComponent: Hierarchy data items must be objects");
|
|
219
|
-
}
|
|
220
|
-
if (!(fieldConfig.idField in item)) {
|
|
221
|
-
throw new Error(`TreeComponent: Required field '${fieldConfig.idField}' not found in hierarchy data`);
|
|
222
|
-
}
|
|
223
|
-
if (!(fieldConfig.labelField in item)) {
|
|
224
|
-
throw new Error(`TreeComponent: Required field '${fieldConfig.labelField}' not found in hierarchy data`);
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
if (Array.isArray(effectiveData)) {
|
|
228
|
-
if (effectiveData.length > 0) {
|
|
229
|
-
checkHierarchyData(effectiveData[0]);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
else {
|
|
233
|
-
checkHierarchyData(effectiveData);
|
|
234
|
-
}
|
|
235
|
-
return (0, treeUtils_1.hierarchyToNative)(effectiveData, fieldConfig);
|
|
236
|
-
}
|
|
237
|
-
else {
|
|
238
|
-
throw new Error(`TreeComponent: Unsupported dataFormat '${dataFormat}'. Use 'flat' or 'hierarchy'.`);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
catch (error) {
|
|
242
|
-
// Return empty data on error to prevent crashes
|
|
243
|
-
return emptyTreeData;
|
|
244
|
-
}
|
|
245
|
-
}, [effectiveData, dataFormat, fieldConfig, dataRevision]);
|
|
246
|
-
const { treeData, treeItemsById } = transformedData;
|
|
247
|
-
// Use selectedValue (source ID) directly since TreeNode.key is the source ID
|
|
248
|
-
const mappedSelectedId = (0, react_1.useMemo)(() => {
|
|
249
|
-
if (selectedValue) {
|
|
250
|
-
// For flat/hierarchy formats, selectedValue is already the source ID (matches TreeNode.key)
|
|
251
|
-
return selectedValue;
|
|
252
|
-
}
|
|
253
|
-
return selectedId;
|
|
254
|
-
}, [selectedValue, selectedId]);
|
|
255
|
-
// Determine if we're in controlled mode (has onSelectionChanged handler) or uncontrolled mode
|
|
256
|
-
const isControlledMode = !!onSelectionChanged;
|
|
257
|
-
// Use mapped selectedValue/selectedId if in controlled mode and provided,
|
|
258
|
-
// otherwise use internal state (uncontrolled mode or controlled mode without selectedValue)
|
|
259
|
-
const effectiveSelectedId = isControlledMode && mappedSelectedId !== undefined ? mappedSelectedId : internalSelectedId;
|
|
260
|
-
// Initialize expanded IDs based on defaultExpanded prop
|
|
261
|
-
const [expandedIds, setExpandedIds] = (0, react_1.useState)(() => {
|
|
262
|
-
// Helper function to check if a node is dynamic (should not be auto-expanded)
|
|
263
|
-
const isDynamic = (node) => {
|
|
264
|
-
return !!(fieldConfig.dynamicField && node[fieldConfig.dynamicField]);
|
|
265
|
-
};
|
|
266
|
-
if (defaultExpanded === "first-level") {
|
|
267
|
-
return treeData.filter((node) => !isDynamic(node)).map((node) => node.key);
|
|
268
|
-
}
|
|
269
|
-
else if (defaultExpanded === "all") {
|
|
270
|
-
const allIds = [];
|
|
271
|
-
const collectIds = (nodes) => {
|
|
272
|
-
nodes.forEach((node) => {
|
|
273
|
-
if (!isDynamic(node)) {
|
|
274
|
-
allIds.push(node.key);
|
|
275
|
-
}
|
|
276
|
-
if (node.children) {
|
|
277
|
-
collectIds(node.children);
|
|
278
|
-
}
|
|
279
|
-
});
|
|
280
|
-
};
|
|
281
|
-
collectIds(treeData);
|
|
282
|
-
return allIds;
|
|
283
|
-
}
|
|
284
|
-
else if (Array.isArray(defaultExpanded)) {
|
|
285
|
-
// Expand full paths to specified nodes by including all parent nodes
|
|
286
|
-
// But exclude dynamic nodes from the expansion
|
|
287
|
-
const expandedPaths = expandParentPaths(defaultExpanded, treeItemsById);
|
|
288
|
-
return expandedPaths.filter((nodeId) => {
|
|
289
|
-
const node = treeItemsById[String(nodeId)];
|
|
290
|
-
return !node || !isDynamic(node);
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
return [];
|
|
294
|
-
});
|
|
295
|
-
// Node loading states management for dynamic loading
|
|
296
|
-
const [nodeStates, setNodeStates] = (0, react_1.useState)(new Map());
|
|
297
|
-
// Helper functions for managing node loading states
|
|
298
|
-
const getNodeState = (0, react_1.useCallback)((nodeId) => {
|
|
299
|
-
return nodeStates.get(nodeId) || "loaded";
|
|
300
|
-
}, [nodeStates]);
|
|
301
|
-
const setNodeState = (0, react_1.useCallback)((nodeId, state) => {
|
|
302
|
-
setNodeStates((prev) => {
|
|
303
|
-
const newStates = new Map(prev);
|
|
304
|
-
newStates.set(nodeId, state);
|
|
305
|
-
return newStates;
|
|
306
|
-
});
|
|
307
|
-
}, []);
|
|
308
|
-
// Simplified focus management
|
|
309
|
-
const [focusedIndex, setFocusedIndex] = (0, react_1.useState)(-1);
|
|
310
|
-
const treeContainerRef = (0, react_1.useRef)(null);
|
|
311
|
-
const listRef = (0, react_1.useRef)(null);
|
|
312
|
-
const flatTreeData = (0, react_1.useMemo)(() => {
|
|
313
|
-
return (0, treeUtils_1.toFlatTree)(treeData, expandedIds, fieldConfig.dynamicField, nodeStates);
|
|
314
|
-
}, [expandedIds, treeData, fieldConfig.dynamicField, nodeStates]);
|
|
315
|
-
// Tree node utilities for consistent ID mapping
|
|
316
|
-
const findNodeById = (0, react_1.useCallback)((nodeId) => {
|
|
317
|
-
return flatTreeData.find((n) => String(n.key) === String(nodeId)) || null;
|
|
318
|
-
}, [flatTreeData]);
|
|
319
|
-
const findNodeIndexById = (0, react_1.useCallback)((nodeId) => {
|
|
320
|
-
return flatTreeData.findIndex((item) => String(item.key) === String(nodeId));
|
|
321
|
-
}, [flatTreeData]);
|
|
322
|
-
// Tree validation utilities
|
|
323
|
-
const nodeExists = (0, react_1.useCallback)((nodeId) => {
|
|
324
|
-
return Object.values(treeItemsById).some((n) => String(n.key) === String(nodeId));
|
|
325
|
-
}, [treeItemsById]);
|
|
326
|
-
/**
|
|
327
|
-
* Centralized selection handler - handles all selection logic consistently
|
|
328
|
-
* @param nodeId - The node key (source ID) to select, or undefined to clear selection
|
|
329
|
-
*/
|
|
330
|
-
const setSelectedNodeById = (0, react_1.useCallback)((nodeId) => {
|
|
331
|
-
// Find the node if nodeId is provided
|
|
332
|
-
const node = nodeId
|
|
333
|
-
? Object.values(treeItemsById).find((n) => String(n.key) === String(nodeId))
|
|
334
|
-
: null;
|
|
335
|
-
const nodeKey = node === null || node === void 0 ? void 0 : node.key;
|
|
336
|
-
// Get previous selection for event
|
|
337
|
-
const previousNode = effectiveSelectedId ? findNodeById(effectiveSelectedId) : null;
|
|
338
|
-
// Always update internal state (this provides visual feedback)
|
|
339
|
-
setInternalSelectedId(nodeKey);
|
|
340
|
-
// Update focused index to match the selected item
|
|
341
|
-
if (nodeKey) {
|
|
342
|
-
const nodeIndex = flatTreeData.findIndex((item) => String(item.key) === String(nodeKey));
|
|
343
|
-
if (nodeIndex >= 0) {
|
|
344
|
-
setFocusedIndex(nodeIndex);
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
// Fire selection event if handler is provided
|
|
348
|
-
if (onSelectionChanged) {
|
|
349
|
-
const newNode = node
|
|
350
|
-
? Object.assign(Object.assign({}, node), { isExpanded: expandedIds.includes(node.key), depth: node.parentIds.length, hasChildren: !!(node.children && node.children.length > 0) })
|
|
351
|
-
: null;
|
|
352
|
-
onSelectionChanged({
|
|
353
|
-
previousNode,
|
|
354
|
-
newNode,
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
}, [
|
|
358
|
-
treeItemsById,
|
|
359
|
-
effectiveSelectedId,
|
|
360
|
-
flatTreeData,
|
|
361
|
-
expandedIds,
|
|
362
|
-
onSelectionChanged,
|
|
363
|
-
internalSelectedId,
|
|
364
|
-
]);
|
|
365
|
-
// Simple tree API method implementations
|
|
366
|
-
const getExpandedNodes = (0, react_1.useCallback)(() => {
|
|
367
|
-
return expandedIds;
|
|
368
|
-
}, [expandedIds]);
|
|
369
|
-
const getSelectedNode = (0, react_1.useCallback)(() => {
|
|
370
|
-
if (!effectiveSelectedId)
|
|
371
|
-
return null;
|
|
372
|
-
return (Object.values(treeItemsById).find((node) => String(node.key) === String(effectiveSelectedId)) || null);
|
|
373
|
-
}, [effectiveSelectedId, treeItemsById]);
|
|
374
|
-
const getNodeById = (0, react_1.useCallback)((nodeId) => {
|
|
375
|
-
return Object.values(treeItemsById).find((n) => String(n.key) === String(nodeId)) || null;
|
|
376
|
-
}, [treeItemsById]);
|
|
377
|
-
const clearSelection = (0, react_1.useCallback)(() => {
|
|
378
|
-
setSelectedNodeById(undefined);
|
|
379
|
-
}, [setSelectedNodeById]);
|
|
380
|
-
// Initialize selection based on selectedValue prop - only on mount
|
|
381
|
-
(0, react_1.useEffect)(() => {
|
|
382
|
-
if (selectedValue !== undefined && !onSelectionChanged) {
|
|
383
|
-
// Uncontrolled mode: set initial selection based on selectedValue
|
|
384
|
-
setInternalSelectedId(selectedValue);
|
|
385
|
-
}
|
|
386
|
-
}, []); // Only run on mount
|
|
387
|
-
/**
|
|
388
|
-
* ensure the selected item's parents are expanded when selection changes
|
|
389
|
-
*/
|
|
390
|
-
(0, react_1.useEffect)(() => {
|
|
391
|
-
if (autoExpandToSelection && effectiveSelectedId) {
|
|
392
|
-
// Find node by key (source ID) since treeItemsById is indexed by id
|
|
393
|
-
const treeItem = Object.values(treeItemsById).find((node) => node.key === effectiveSelectedId);
|
|
394
|
-
if (treeItem) {
|
|
395
|
-
setExpandedIds((prev) => [...prev, ...treeItem.parentIds]);
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
}, [autoExpandToSelection, effectiveSelectedId, treeItemsById]);
|
|
399
|
-
const toggleNode = (0, react_1.useCallback)((node) => __awaiter(void 0, void 0, void 0, function* () {
|
|
400
|
-
if (!node.isExpanded) {
|
|
401
|
-
// Expanding the node
|
|
402
|
-
setExpandedIds((prev) => [...prev, node.key]);
|
|
403
|
-
// Always fire nodeDidExpand event
|
|
404
|
-
if (onNodeExpanded) {
|
|
405
|
-
onNodeExpanded(Object.assign(Object.assign({}, node), { isExpanded: true }));
|
|
406
|
-
}
|
|
407
|
-
// Check if we need to load children dynamically
|
|
408
|
-
const nodeWithState = node;
|
|
409
|
-
if (nodeWithState.loadingState === "unloaded" && loadChildren) {
|
|
410
|
-
// Set loading state
|
|
411
|
-
setNodeStates((prev) => new Map(prev).set(node.key, "loading"));
|
|
412
|
-
// Immediately remove existing children so node appears empty while loading
|
|
413
|
-
updateInternalData((prevData) => {
|
|
414
|
-
const currentData = prevData !== null && prevData !== void 0 ? prevData : data;
|
|
415
|
-
if (dataFormat === "flat" && Array.isArray(currentData)) {
|
|
416
|
-
// Remove existing children of this node
|
|
417
|
-
return currentData.filter((item) => String(item[fieldConfig.parentField || "parentId"]) !== String(node.key));
|
|
418
|
-
}
|
|
419
|
-
else if (dataFormat === "hierarchy" && Array.isArray(currentData)) {
|
|
420
|
-
// For hierarchy format, clear children array
|
|
421
|
-
const clearChildren = (nodes) => {
|
|
422
|
-
return nodes.map((n) => {
|
|
423
|
-
if (String(n[fieldConfig.idField || "id"]) === String(node.key)) {
|
|
424
|
-
return Object.assign(Object.assign({}, n), { [fieldConfig.childrenField || "children"]: [] });
|
|
425
|
-
}
|
|
426
|
-
else if (n[fieldConfig.childrenField || "children"]) {
|
|
427
|
-
return Object.assign(Object.assign({}, n), { [fieldConfig.childrenField || "children"]: clearChildren(n[fieldConfig.childrenField || "children"]) });
|
|
428
|
-
}
|
|
429
|
-
return n;
|
|
430
|
-
});
|
|
431
|
-
};
|
|
432
|
-
return clearChildren(currentData);
|
|
433
|
-
}
|
|
434
|
-
return currentData;
|
|
435
|
-
});
|
|
436
|
-
try {
|
|
437
|
-
// Load the children data
|
|
438
|
-
const loadedData = yield loadChildren(Object.assign(Object.assign({}, node), { isExpanded: true }));
|
|
439
|
-
// Update the tree data with loaded children
|
|
440
|
-
if (loadedData && Array.isArray(loadedData) && loadedData.length > 0) {
|
|
441
|
-
updateInternalData((prevData) => {
|
|
442
|
-
const currentData = prevData !== null && prevData !== void 0 ? prevData : data;
|
|
443
|
-
if (dataFormat === "flat" && Array.isArray(currentData)) {
|
|
444
|
-
// Replace existing children with newly loaded data
|
|
445
|
-
// Remove existing children of this node
|
|
446
|
-
const filteredData = currentData.filter((item) => String(item[fieldConfig.parentField || "parentId"]) !== String(node.key));
|
|
447
|
-
// Add new children
|
|
448
|
-
const newItems = loadedData.map((item) => (Object.assign(Object.assign({}, item), { [fieldConfig.parentField || "parentId"]: String(node.key) })));
|
|
449
|
-
return [...filteredData, ...newItems];
|
|
450
|
-
}
|
|
451
|
-
else if (dataFormat === "hierarchy" && Array.isArray(currentData)) {
|
|
452
|
-
// For hierarchy format, we need to find the node and add children
|
|
453
|
-
const updateHierarchy = (nodes) => {
|
|
454
|
-
return nodes.map((n) => {
|
|
455
|
-
if (String(n[fieldConfig.idField || "id"]) === String(node.key)) {
|
|
456
|
-
return Object.assign(Object.assign({}, n), { [fieldConfig.childrenField || "children"]: loadedData });
|
|
457
|
-
}
|
|
458
|
-
else if (n[fieldConfig.childrenField || "children"]) {
|
|
459
|
-
return Object.assign(Object.assign({}, n), { [fieldConfig.childrenField || "children"]: updateHierarchy(n[fieldConfig.childrenField || "children"]) });
|
|
460
|
-
}
|
|
461
|
-
return n;
|
|
462
|
-
});
|
|
463
|
-
};
|
|
464
|
-
return updateHierarchy(currentData);
|
|
465
|
-
}
|
|
466
|
-
return currentData;
|
|
467
|
-
});
|
|
468
|
-
}
|
|
469
|
-
// Set loaded state
|
|
470
|
-
setNodeStates((prev) => new Map(prev).set(node.key, "loaded"));
|
|
471
|
-
}
|
|
472
|
-
catch (error) {
|
|
473
|
-
console.error("Error loading tree node data:", error);
|
|
474
|
-
// Set back to unloaded state on error
|
|
475
|
-
setNodeStates((prev) => {
|
|
476
|
-
const newMap = new Map(prev);
|
|
477
|
-
newMap.delete(node.key);
|
|
478
|
-
return newMap;
|
|
479
|
-
});
|
|
480
|
-
// Collapse the node since loading failed
|
|
481
|
-
setExpandedIds((prev) => prev.filter((id) => id !== node.key));
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
else {
|
|
486
|
-
// Collapsing the node
|
|
487
|
-
setExpandedIds((prev) => prev.filter((id) => id !== node.key));
|
|
488
|
-
// Fire nodeDidCollapse event
|
|
489
|
-
if (onNodeCollapsed) {
|
|
490
|
-
onNodeCollapsed(Object.assign(Object.assign({}, node), { isExpanded: false }));
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
}), [onNodeExpanded, onNodeCollapsed, loadChildren, data, dataFormat, fieldConfig, setNodeStates]);
|
|
494
|
-
// Simplified keyboard navigation handler
|
|
495
|
-
const handleKeyDown = (0, react_1.useCallback)((e) => {
|
|
496
|
-
if (flatTreeData.length === 0)
|
|
497
|
-
return;
|
|
498
|
-
const currentIndex = focusedIndex >= 0 ? focusedIndex : 0;
|
|
499
|
-
let newIndex = currentIndex;
|
|
500
|
-
let handled = false;
|
|
501
|
-
switch (e.key) {
|
|
502
|
-
case "ArrowDown":
|
|
503
|
-
e.preventDefault();
|
|
504
|
-
newIndex = Math.min(currentIndex + 1, flatTreeData.length - 1);
|
|
505
|
-
handled = true;
|
|
506
|
-
break;
|
|
507
|
-
case "ArrowUp":
|
|
508
|
-
e.preventDefault();
|
|
509
|
-
newIndex = Math.max(currentIndex - 1, 0);
|
|
510
|
-
handled = true;
|
|
511
|
-
break;
|
|
512
|
-
case "ArrowRight":
|
|
513
|
-
e.preventDefault();
|
|
514
|
-
if (currentIndex >= 0) {
|
|
515
|
-
const currentNode = flatTreeData[currentIndex];
|
|
516
|
-
if (currentNode.hasChildren && !currentNode.isExpanded) {
|
|
517
|
-
// Expand node
|
|
518
|
-
void toggleNode(currentNode);
|
|
519
|
-
}
|
|
520
|
-
else if (currentNode.hasChildren &&
|
|
521
|
-
currentNode.isExpanded &&
|
|
522
|
-
currentIndex + 1 < flatTreeData.length) {
|
|
523
|
-
// Move to first child
|
|
524
|
-
newIndex = currentIndex + 1;
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
handled = true;
|
|
528
|
-
break;
|
|
529
|
-
case "ArrowLeft":
|
|
530
|
-
e.preventDefault();
|
|
531
|
-
if (currentIndex >= 0) {
|
|
532
|
-
const currentNode = flatTreeData[currentIndex];
|
|
533
|
-
if (currentNode.hasChildren && currentNode.isExpanded) {
|
|
534
|
-
// Collapse node
|
|
535
|
-
void toggleNode(currentNode);
|
|
536
|
-
}
|
|
537
|
-
else if (currentNode.depth > 0) {
|
|
538
|
-
// Move to parent - find previous node with smaller depth
|
|
539
|
-
for (let i = currentIndex - 1; i >= 0; i--) {
|
|
540
|
-
if (flatTreeData[i].depth < currentNode.depth) {
|
|
541
|
-
newIndex = i;
|
|
542
|
-
break;
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
handled = true;
|
|
548
|
-
break;
|
|
549
|
-
case "Home":
|
|
550
|
-
e.preventDefault();
|
|
551
|
-
newIndex = 0;
|
|
552
|
-
handled = true;
|
|
553
|
-
break;
|
|
554
|
-
case "End":
|
|
555
|
-
e.preventDefault();
|
|
556
|
-
newIndex = flatTreeData.length - 1;
|
|
557
|
-
handled = true;
|
|
558
|
-
break;
|
|
559
|
-
case "Enter":
|
|
560
|
-
case " ":
|
|
561
|
-
e.preventDefault();
|
|
562
|
-
if (currentIndex >= 0) {
|
|
563
|
-
const currentNode = flatTreeData[currentIndex];
|
|
564
|
-
// Handle selection
|
|
565
|
-
if (currentNode.selectable) {
|
|
566
|
-
setSelectedNodeById(currentNode.key);
|
|
567
|
-
// Ensure focus stays on the current item after selection
|
|
568
|
-
newIndex = currentIndex;
|
|
569
|
-
}
|
|
570
|
-
// Handle expansion for Enter key
|
|
571
|
-
if (e.key === "Enter" && currentNode.hasChildren) {
|
|
572
|
-
void toggleNode(currentNode);
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
handled = true;
|
|
576
|
-
break;
|
|
577
|
-
}
|
|
578
|
-
if (handled) {
|
|
579
|
-
setFocusedIndex(newIndex);
|
|
580
|
-
}
|
|
581
|
-
}, [focusedIndex, flatTreeData, toggleNode, setSelectedNodeById]);
|
|
582
|
-
const itemData = (0, react_1.useMemo)(() => {
|
|
583
|
-
return {
|
|
584
|
-
nodes: flatTreeData,
|
|
585
|
-
toggleNode,
|
|
586
|
-
selectedId: effectiveSelectedId,
|
|
587
|
-
itemRenderer,
|
|
588
|
-
itemClickExpands,
|
|
589
|
-
onItemClick,
|
|
590
|
-
onSelection: (node) => setSelectedNodeById(node.key),
|
|
591
|
-
focusedIndex,
|
|
592
|
-
onKeyDown: handleKeyDown,
|
|
593
|
-
treeContainerRef,
|
|
594
|
-
iconCollapsed,
|
|
595
|
-
iconExpanded,
|
|
596
|
-
iconSize,
|
|
597
|
-
animateExpand,
|
|
598
|
-
expandRotation,
|
|
599
|
-
};
|
|
600
|
-
}, [
|
|
601
|
-
flatTreeData,
|
|
602
|
-
toggleNode,
|
|
603
|
-
effectiveSelectedId,
|
|
604
|
-
itemRenderer,
|
|
605
|
-
itemClickExpands,
|
|
606
|
-
onItemClick,
|
|
607
|
-
setSelectedNodeById,
|
|
608
|
-
focusedIndex,
|
|
609
|
-
handleKeyDown,
|
|
610
|
-
iconCollapsed,
|
|
611
|
-
iconExpanded,
|
|
612
|
-
iconSize,
|
|
613
|
-
animateExpand,
|
|
614
|
-
expandRotation,
|
|
615
|
-
]);
|
|
616
|
-
// Shared API implementation to avoid duplication between ref and component APIs
|
|
617
|
-
const treeApiMethods = (0, react_1.useMemo)(() => {
|
|
618
|
-
return {
|
|
619
|
-
// Expansion methods
|
|
620
|
-
expandAll: () => {
|
|
621
|
-
const allIds = [];
|
|
622
|
-
const collectIds = (nodes) => {
|
|
623
|
-
nodes.forEach((node) => {
|
|
624
|
-
allIds.push(node.key);
|
|
625
|
-
if (node.children) {
|
|
626
|
-
collectIds(node.children);
|
|
627
|
-
}
|
|
628
|
-
});
|
|
629
|
-
};
|
|
630
|
-
collectIds(treeData);
|
|
631
|
-
setExpandedIds(allIds);
|
|
632
|
-
},
|
|
633
|
-
collapseAll: () => {
|
|
634
|
-
setExpandedIds([]);
|
|
635
|
-
},
|
|
636
|
-
expandToLevel: (level) => {
|
|
637
|
-
const levelIds = [];
|
|
638
|
-
const collectIdsToLevel = (nodes, currentLevel = 0) => {
|
|
639
|
-
if (currentLevel >= level)
|
|
640
|
-
return;
|
|
641
|
-
nodes.forEach((node) => {
|
|
642
|
-
levelIds.push(node.key);
|
|
643
|
-
if (node.children && currentLevel < level - 1) {
|
|
644
|
-
collectIdsToLevel(node.children, currentLevel + 1);
|
|
645
|
-
}
|
|
646
|
-
});
|
|
647
|
-
};
|
|
648
|
-
collectIdsToLevel(treeData);
|
|
649
|
-
setExpandedIds(levelIds);
|
|
650
|
-
},
|
|
651
|
-
expandNode: (nodeId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
652
|
-
// nodeId is source ID, which matches TreeNode.key
|
|
653
|
-
const wasExpanded = expandedIds.includes(nodeId);
|
|
654
|
-
if (!wasExpanded) {
|
|
655
|
-
setExpandedIds((prev) => [...prev, nodeId]);
|
|
656
|
-
// Always fire nodeDidExpand event
|
|
657
|
-
const node = getNodeById(nodeId);
|
|
658
|
-
if (node && onNodeExpanded) {
|
|
659
|
-
// Convert TreeNode to FlatTreeNode format for the event
|
|
660
|
-
const flatNode = Object.assign(Object.assign({}, node), { isExpanded: true, depth: node.parentIds.length, hasChildren: !!(node.children && node.children.length > 0) });
|
|
661
|
-
onNodeExpanded(flatNode);
|
|
662
|
-
}
|
|
663
|
-
// Check if we need to load children dynamically
|
|
664
|
-
if (node && loadChildren) {
|
|
665
|
-
// Set loading state
|
|
666
|
-
setNodeStates((prev) => new Map(prev).set(nodeId, "loading"));
|
|
667
|
-
try {
|
|
668
|
-
// Convert TreeNode to FlatTreeNode format for loadChildren
|
|
669
|
-
const flatNode = Object.assign(Object.assign({}, node), { isExpanded: true, depth: node.parentIds.length, hasChildren: !!(node.children && node.children.length > 0) });
|
|
670
|
-
// Load the children data
|
|
671
|
-
const loadedData = yield loadChildren(flatNode);
|
|
672
|
-
// Update the tree data with loaded children
|
|
673
|
-
if (loadedData && Array.isArray(loadedData) && loadedData.length > 0) {
|
|
674
|
-
updateInternalData((prevData) => {
|
|
675
|
-
const currentData = prevData !== null && prevData !== void 0 ? prevData : data;
|
|
676
|
-
if (dataFormat === "flat" && Array.isArray(currentData)) {
|
|
677
|
-
// Replace existing children with newly loaded data
|
|
678
|
-
// Remove existing children of this node
|
|
679
|
-
const filteredData = currentData.filter((item) => String(item[fieldConfig.parentField || "parentId"]) !== String(nodeId));
|
|
680
|
-
// Add new children
|
|
681
|
-
const newItems = loadedData.map((item) => (Object.assign(Object.assign({}, item), { [fieldConfig.parentField || "parentId"]: String(nodeId) })));
|
|
682
|
-
return [...filteredData, ...newItems];
|
|
683
|
-
}
|
|
684
|
-
else if (dataFormat === "hierarchy" && Array.isArray(currentData)) {
|
|
685
|
-
// For hierarchy format, we need to find the node and add children
|
|
686
|
-
const updateHierarchy = (nodes) => {
|
|
687
|
-
return nodes.map((n) => {
|
|
688
|
-
if (String(n[fieldConfig.idField || "id"]) === String(nodeId)) {
|
|
689
|
-
return Object.assign(Object.assign({}, n), { [fieldConfig.childrenField || "children"]: loadedData });
|
|
690
|
-
}
|
|
691
|
-
else if (n[fieldConfig.childrenField || "children"]) {
|
|
692
|
-
return Object.assign(Object.assign({}, n), { [fieldConfig.childrenField || "children"]: updateHierarchy(n[fieldConfig.childrenField || "children"]) });
|
|
693
|
-
}
|
|
694
|
-
return n;
|
|
695
|
-
});
|
|
696
|
-
};
|
|
697
|
-
return updateHierarchy(currentData);
|
|
698
|
-
}
|
|
699
|
-
return currentData;
|
|
700
|
-
});
|
|
701
|
-
}
|
|
702
|
-
// Set loaded state
|
|
703
|
-
setNodeStates((prev) => new Map(prev).set(nodeId, "loaded"));
|
|
704
|
-
}
|
|
705
|
-
catch (error) {
|
|
706
|
-
console.error("Error loading tree node data:", error);
|
|
707
|
-
// Set back to unloaded state on error
|
|
708
|
-
setNodeStates((prev) => {
|
|
709
|
-
const newMap = new Map(prev);
|
|
710
|
-
newMap.delete(nodeId);
|
|
711
|
-
return newMap;
|
|
712
|
-
});
|
|
713
|
-
// Collapse the node since loading failed
|
|
714
|
-
setExpandedIds((prev) => prev.filter((id) => id !== nodeId));
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
}),
|
|
719
|
-
collapseNode: (nodeId) => {
|
|
720
|
-
// nodeId is source ID, which matches TreeNode.key
|
|
721
|
-
const wasExpanded = expandedIds.includes(nodeId);
|
|
722
|
-
if (!wasExpanded)
|
|
723
|
-
return; // Nothing to collapse
|
|
724
|
-
// Find the node and collect all its descendants
|
|
725
|
-
const nodeToCollapse = Object.values(treeItemsById).find((n) => String(n.key) === String(nodeId));
|
|
726
|
-
if (nodeToCollapse) {
|
|
727
|
-
const idsToRemove = new Set();
|
|
728
|
-
// Recursively collect all descendant IDs
|
|
729
|
-
const collectDescendants = (treeNode) => {
|
|
730
|
-
idsToRemove.add(String(treeNode.key));
|
|
731
|
-
if (treeNode.children) {
|
|
732
|
-
treeNode.children.forEach((child) => collectDescendants(child));
|
|
733
|
-
}
|
|
734
|
-
};
|
|
735
|
-
collectDescendants(nodeToCollapse);
|
|
736
|
-
// Remove all descendant IDs from expanded list
|
|
737
|
-
setExpandedIds((prev) => prev.filter((id) => !idsToRemove.has(String(id))));
|
|
738
|
-
// Fire nodeDidCollapse event
|
|
739
|
-
if (nodeToCollapse && onNodeCollapsed) {
|
|
740
|
-
// Convert to FlatTreeNode format for the event
|
|
741
|
-
const flatNode = Object.assign(Object.assign({}, nodeToCollapse), { isExpanded: false, depth: nodeToCollapse.parentIds.length, hasChildren: !!(nodeToCollapse.children && nodeToCollapse.children.length > 0) });
|
|
742
|
-
onNodeCollapsed(flatNode);
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
},
|
|
746
|
-
// Selection methods
|
|
747
|
-
selectNode: (nodeId) => {
|
|
748
|
-
// Check if node exists before calling setSelectedNodeById
|
|
749
|
-
if (nodeExists(nodeId)) {
|
|
750
|
-
return setSelectedNodeById(nodeId);
|
|
751
|
-
}
|
|
752
|
-
else {
|
|
753
|
-
return setSelectedNodeById(undefined);
|
|
754
|
-
}
|
|
755
|
-
},
|
|
756
|
-
clearSelection,
|
|
757
|
-
// Utility methods
|
|
758
|
-
getNodeById,
|
|
759
|
-
getExpandedNodes,
|
|
760
|
-
getSelectedNode,
|
|
761
|
-
scrollIntoView: (nodeId, options) => {
|
|
762
|
-
// Find the target node
|
|
763
|
-
const targetNode = Object.values(treeItemsById).find((n) => String(n.key) === String(nodeId));
|
|
764
|
-
if (!targetNode) {
|
|
765
|
-
return; // Node not found
|
|
766
|
-
}
|
|
767
|
-
// Collect all parent IDs that need to be expanded
|
|
768
|
-
const parentsToExpand = [];
|
|
769
|
-
const collectParents = (node) => {
|
|
770
|
-
if (node.parentIds && node.parentIds.length > 0) {
|
|
771
|
-
// Add all parent IDs to expansion list
|
|
772
|
-
parentsToExpand.push(...node.parentIds);
|
|
773
|
-
}
|
|
774
|
-
};
|
|
775
|
-
collectParents(targetNode);
|
|
776
|
-
// Calculate the new expanded IDs including parents
|
|
777
|
-
const newExpandedIds = [...new Set([...expandedIds, ...parentsToExpand])];
|
|
778
|
-
// Expand all parent nodes if they aren't already expanded
|
|
779
|
-
if (parentsToExpand.length > 0) {
|
|
780
|
-
setExpandedIds(newExpandedIds);
|
|
781
|
-
}
|
|
782
|
-
// Use setTimeout to ensure DOM is updated after expansion state change
|
|
783
|
-
setTimeout(() => {
|
|
784
|
-
// Generate the flat tree data with the new expanded state to find the correct index
|
|
785
|
-
const updatedFlatTreeData = (0, treeUtils_1.toFlatTree)(treeData, newExpandedIds, fieldConfig.dynamicField, nodeStates);
|
|
786
|
-
const nodeIndex = updatedFlatTreeData.findIndex((item) => String(item.key) === String(nodeId));
|
|
787
|
-
if (nodeIndex >= 0 && listRef.current) {
|
|
788
|
-
// Scroll to the item using virtua's scrollToIndex method
|
|
789
|
-
listRef.current.scrollToIndex(nodeIndex, { align: "center" });
|
|
790
|
-
}
|
|
791
|
-
}, 0);
|
|
792
|
-
},
|
|
793
|
-
scrollToItem: (nodeId) => {
|
|
794
|
-
// Simple scroll without expanding - just scroll to the item if it's visible
|
|
795
|
-
const nodeIndex = findNodeIndexById(nodeId);
|
|
796
|
-
if (nodeIndex >= 0 && listRef.current) {
|
|
797
|
-
listRef.current.scrollToIndex(nodeIndex, { align: "center" });
|
|
798
|
-
}
|
|
799
|
-
},
|
|
800
|
-
appendNode: (parentNodeId, nodeData) => {
|
|
801
|
-
// Generate a new ID if not provided
|
|
802
|
-
const nodeId = nodeData[fieldConfig.idField] || Date.now();
|
|
803
|
-
// Create the new node with proper field mapping
|
|
804
|
-
const newNode = Object.assign(Object.assign({}, nodeData), { [fieldConfig.idField]: nodeId });
|
|
805
|
-
// For flat data format, set the parent ID field
|
|
806
|
-
if (dataFormat === "flat") {
|
|
807
|
-
newNode[fieldConfig.parentField || "parentId"] = parentNodeId || null;
|
|
808
|
-
}
|
|
809
|
-
// Update the internal data state
|
|
810
|
-
updateInternalData((prevData) => {
|
|
811
|
-
const currentData = prevData !== null && prevData !== void 0 ? prevData : data;
|
|
812
|
-
if (dataFormat === "flat") {
|
|
813
|
-
// For flat format, just append to the array
|
|
814
|
-
return Array.isArray(currentData) ? [...currentData, newNode] : [newNode];
|
|
815
|
-
}
|
|
816
|
-
else if (dataFormat === "hierarchy") {
|
|
817
|
-
// For hierarchy format, we need to find the parent and add to its children
|
|
818
|
-
const addToHierarchy = (nodes) => {
|
|
819
|
-
if (!parentNodeId) {
|
|
820
|
-
// Add to root level
|
|
821
|
-
return [...nodes, Object.assign(Object.assign({}, newNode), { [fieldConfig.childrenField || "children"]: [] })];
|
|
822
|
-
}
|
|
823
|
-
return nodes.map((node) => {
|
|
824
|
-
if (node[fieldConfig.idField] === parentNodeId) {
|
|
825
|
-
const children = node[fieldConfig.childrenField || "children"] || [];
|
|
826
|
-
return Object.assign(Object.assign({}, node), { [fieldConfig.childrenField || "children"]: [
|
|
827
|
-
...children,
|
|
828
|
-
Object.assign(Object.assign({}, newNode), { [fieldConfig.childrenField || "children"]: [] }),
|
|
829
|
-
] });
|
|
830
|
-
}
|
|
831
|
-
// Recursively check children
|
|
832
|
-
const childrenField = fieldConfig.childrenField || "children";
|
|
833
|
-
if (node[childrenField] && Array.isArray(node[childrenField])) {
|
|
834
|
-
return Object.assign(Object.assign({}, node), { [childrenField]: addToHierarchy(node[childrenField]) });
|
|
835
|
-
}
|
|
836
|
-
return node;
|
|
837
|
-
});
|
|
838
|
-
};
|
|
839
|
-
if (Array.isArray(currentData)) {
|
|
840
|
-
return addToHierarchy(currentData);
|
|
841
|
-
}
|
|
842
|
-
else {
|
|
843
|
-
return currentData;
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
return currentData;
|
|
847
|
-
});
|
|
848
|
-
},
|
|
849
|
-
removeNode: (nodeId) => {
|
|
850
|
-
// Helper function to recursively find and remove a node and its descendants
|
|
851
|
-
const removeFromFlat = (data) => {
|
|
852
|
-
const nodeIdToRemove = String(nodeId);
|
|
853
|
-
const fieldId = fieldConfig.idField || "id";
|
|
854
|
-
const fieldParent = fieldConfig.parentField || "parentId";
|
|
855
|
-
// First, collect all descendant IDs recursively
|
|
856
|
-
const getDescendantIds = (parentId) => {
|
|
857
|
-
const descendants = [];
|
|
858
|
-
for (const item of data) {
|
|
859
|
-
if (String(item[fieldParent]) === parentId) {
|
|
860
|
-
const itemId = String(item[fieldId]);
|
|
861
|
-
descendants.push(itemId);
|
|
862
|
-
descendants.push(...getDescendantIds(itemId));
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
return descendants;
|
|
866
|
-
};
|
|
867
|
-
// Get all IDs to remove (node itself + all descendants)
|
|
868
|
-
const idsToRemove = new Set([nodeIdToRemove, ...getDescendantIds(nodeIdToRemove)]);
|
|
869
|
-
// Filter out all nodes with IDs in the removal set
|
|
870
|
-
return data.filter((item) => !idsToRemove.has(String(item[fieldId])));
|
|
871
|
-
};
|
|
872
|
-
const removeFromHierarchy = (nodes) => {
|
|
873
|
-
const fieldId = fieldConfig.idField || "id";
|
|
874
|
-
const fieldChildren = fieldConfig.childrenField || "children";
|
|
875
|
-
return nodes.reduce((acc, node) => {
|
|
876
|
-
// If this is the node to remove, don't include it (and its descendants)
|
|
877
|
-
if (String(node[fieldId]) === String(nodeId)) {
|
|
878
|
-
return acc;
|
|
879
|
-
}
|
|
880
|
-
// Otherwise, include the node but recursively process its children
|
|
881
|
-
const children = node[fieldChildren];
|
|
882
|
-
if (children && Array.isArray(children)) {
|
|
883
|
-
acc.push(Object.assign(Object.assign({}, node), { [fieldChildren]: removeFromHierarchy(children) }));
|
|
884
|
-
}
|
|
885
|
-
else {
|
|
886
|
-
acc.push(node);
|
|
887
|
-
}
|
|
888
|
-
return acc;
|
|
889
|
-
}, []);
|
|
890
|
-
};
|
|
891
|
-
// Update the internal data state
|
|
892
|
-
setInternalData((prevData) => {
|
|
893
|
-
const currentData = prevData !== null && prevData !== void 0 ? prevData : data;
|
|
894
|
-
if (dataFormat === "flat" && Array.isArray(currentData)) {
|
|
895
|
-
return removeFromFlat(currentData);
|
|
896
|
-
}
|
|
897
|
-
else if (dataFormat === "hierarchy" && Array.isArray(currentData)) {
|
|
898
|
-
return removeFromHierarchy(currentData);
|
|
899
|
-
}
|
|
900
|
-
return currentData;
|
|
901
|
-
});
|
|
902
|
-
},
|
|
903
|
-
removeChildren: (nodeId) => {
|
|
904
|
-
// Helper function to remove only the children of a node in flat format
|
|
905
|
-
const removeChildrenFromFlat = (data) => {
|
|
906
|
-
const parentNodeId = String(nodeId);
|
|
907
|
-
const fieldId = fieldConfig.idField || "id";
|
|
908
|
-
const fieldParent = fieldConfig.parentField || "parentId";
|
|
909
|
-
// First, collect all descendant IDs recursively (but not the parent node itself)
|
|
910
|
-
const getDescendantIds = (parentId) => {
|
|
911
|
-
const descendants = [];
|
|
912
|
-
for (const item of data) {
|
|
913
|
-
if (String(item[fieldParent]) === parentId) {
|
|
914
|
-
const itemId = String(item[fieldId]);
|
|
915
|
-
descendants.push(itemId);
|
|
916
|
-
descendants.push(...getDescendantIds(itemId));
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
return descendants;
|
|
920
|
-
};
|
|
921
|
-
// Get all descendant IDs to remove (children and their descendants)
|
|
922
|
-
const idsToRemove = new Set(getDescendantIds(parentNodeId));
|
|
923
|
-
// Filter out all descendant nodes but keep the parent node
|
|
924
|
-
return data.filter((item) => !idsToRemove.has(String(item[fieldId])));
|
|
925
|
-
};
|
|
926
|
-
const removeChildrenFromHierarchy = (nodes) => {
|
|
927
|
-
const fieldId = fieldConfig.idField || "id";
|
|
928
|
-
const fieldChildren = fieldConfig.childrenField || "children";
|
|
929
|
-
return nodes.map((node) => {
|
|
930
|
-
// If this is the target node, remove all its children
|
|
931
|
-
if (String(node[fieldId]) === String(nodeId)) {
|
|
932
|
-
return Object.assign(Object.assign({}, node), { [fieldChildren]: [] });
|
|
933
|
-
}
|
|
934
|
-
// Otherwise, recursively process children
|
|
935
|
-
const children = node[fieldChildren];
|
|
936
|
-
if (children && Array.isArray(children)) {
|
|
937
|
-
return Object.assign(Object.assign({}, node), { [fieldChildren]: removeChildrenFromHierarchy(children) });
|
|
938
|
-
}
|
|
939
|
-
return node;
|
|
940
|
-
});
|
|
941
|
-
};
|
|
942
|
-
// Update the internal data state
|
|
943
|
-
setInternalData((prevData) => {
|
|
944
|
-
const currentData = prevData !== null && prevData !== void 0 ? prevData : data;
|
|
945
|
-
if (dataFormat === "flat" && Array.isArray(currentData)) {
|
|
946
|
-
return removeChildrenFromFlat(currentData);
|
|
947
|
-
}
|
|
948
|
-
else if (dataFormat === "hierarchy" && Array.isArray(currentData)) {
|
|
949
|
-
return removeChildrenFromHierarchy(currentData);
|
|
950
|
-
}
|
|
951
|
-
return currentData;
|
|
952
|
-
});
|
|
953
|
-
},
|
|
954
|
-
insertNodeBefore: (beforeNodeId, nodeData) => {
|
|
955
|
-
// Generate a new ID if not provided
|
|
956
|
-
const nodeId = nodeData[fieldConfig.idField] || Date.now();
|
|
957
|
-
// Create the new node with proper field mapping
|
|
958
|
-
const newNode = Object.assign(Object.assign({}, nodeData), { [fieldConfig.idField]: nodeId });
|
|
959
|
-
// Helper function to insert before a node in flat format
|
|
960
|
-
const insertBeforeInFlat = (data) => {
|
|
961
|
-
const beforeNodeIdStr = String(beforeNodeId);
|
|
962
|
-
const fieldId = fieldConfig.idField || "id";
|
|
963
|
-
const fieldParent = fieldConfig.parentField || "parentId";
|
|
964
|
-
// Find the target node to get its parent
|
|
965
|
-
const targetNode = data.find((item) => String(item[fieldId]) === beforeNodeIdStr);
|
|
966
|
-
if (!targetNode) {
|
|
967
|
-
// If target node not found, just append to root level
|
|
968
|
-
return [...data, Object.assign(Object.assign({}, newNode), { [fieldParent]: null })];
|
|
969
|
-
}
|
|
970
|
-
// Set the same parent as the target node
|
|
971
|
-
const parentId = targetNode[fieldParent];
|
|
972
|
-
newNode[fieldParent] = parentId;
|
|
973
|
-
// Find the index of the target node and insert before it
|
|
974
|
-
const targetIndex = data.findIndex((item) => String(item[fieldId]) === beforeNodeIdStr);
|
|
975
|
-
const result = [...data];
|
|
976
|
-
result.splice(targetIndex, 0, newNode);
|
|
977
|
-
return result;
|
|
978
|
-
};
|
|
979
|
-
const insertBeforeInHierarchy = (nodes) => {
|
|
980
|
-
const beforeNodeIdStr = String(beforeNodeId);
|
|
981
|
-
const fieldId = fieldConfig.idField || "id";
|
|
982
|
-
const fieldChildren = fieldConfig.childrenField || "children";
|
|
983
|
-
// Check if the target node is at this level
|
|
984
|
-
const targetIndex = nodes.findIndex((node) => String(node[fieldId]) === beforeNodeIdStr);
|
|
985
|
-
if (targetIndex >= 0) {
|
|
986
|
-
// Insert before the target node at this level
|
|
987
|
-
const result = [...nodes];
|
|
988
|
-
const nodeWithChildren = Object.assign(Object.assign({}, newNode), { [fieldChildren]: [] });
|
|
989
|
-
result.splice(targetIndex, 0, nodeWithChildren);
|
|
990
|
-
return result;
|
|
991
|
-
}
|
|
992
|
-
// Otherwise, recursively search in children
|
|
993
|
-
return nodes.map((node) => {
|
|
994
|
-
const children = node[fieldChildren];
|
|
995
|
-
if (children && Array.isArray(children)) {
|
|
996
|
-
const updatedChildren = insertBeforeInHierarchy(children);
|
|
997
|
-
if (updatedChildren !== children) {
|
|
998
|
-
return Object.assign(Object.assign({}, node), { [fieldChildren]: updatedChildren });
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
|
-
return node;
|
|
1002
|
-
});
|
|
1003
|
-
};
|
|
1004
|
-
// Update the internal data state
|
|
1005
|
-
setInternalData((prevData) => {
|
|
1006
|
-
const currentData = prevData !== null && prevData !== void 0 ? prevData : data;
|
|
1007
|
-
if (dataFormat === "flat" && Array.isArray(currentData)) {
|
|
1008
|
-
return insertBeforeInFlat(currentData);
|
|
1009
|
-
}
|
|
1010
|
-
else if (dataFormat === "hierarchy" && Array.isArray(currentData)) {
|
|
1011
|
-
return insertBeforeInHierarchy(currentData);
|
|
1012
|
-
}
|
|
1013
|
-
return currentData;
|
|
1014
|
-
});
|
|
1015
|
-
},
|
|
1016
|
-
insertNodeAfter: (afterNodeId, nodeData) => {
|
|
1017
|
-
// Generate a new ID if not provided
|
|
1018
|
-
const nodeId = nodeData[fieldConfig.idField] || Date.now();
|
|
1019
|
-
// Create the new node with proper field mapping
|
|
1020
|
-
const newNode = Object.assign(Object.assign({}, nodeData), { [fieldConfig.idField]: nodeId });
|
|
1021
|
-
// Helper function to insert after a node in flat format
|
|
1022
|
-
const insertAfterInFlat = (data) => {
|
|
1023
|
-
const afterNodeIdStr = String(afterNodeId);
|
|
1024
|
-
const fieldId = fieldConfig.idField || "id";
|
|
1025
|
-
const fieldParent = fieldConfig.parentField || "parentId";
|
|
1026
|
-
// Find the target node to get its parent
|
|
1027
|
-
const targetNode = data.find((item) => String(item[fieldId]) === afterNodeIdStr);
|
|
1028
|
-
if (!targetNode) {
|
|
1029
|
-
// If target node not found, just append to root level
|
|
1030
|
-
return [...data, Object.assign(Object.assign({}, newNode), { [fieldParent]: null })];
|
|
1031
|
-
}
|
|
1032
|
-
// Set the same parent as the target node
|
|
1033
|
-
const parentId = targetNode[fieldParent];
|
|
1034
|
-
newNode[fieldParent] = parentId;
|
|
1035
|
-
// Find the index of the target node and insert after it
|
|
1036
|
-
const targetIndex = data.findIndex((item) => String(item[fieldId]) === afterNodeIdStr);
|
|
1037
|
-
const result = [...data];
|
|
1038
|
-
result.splice(targetIndex + 1, 0, newNode);
|
|
1039
|
-
return result;
|
|
1040
|
-
};
|
|
1041
|
-
const insertAfterInHierarchy = (nodes) => {
|
|
1042
|
-
const afterNodeIdStr = String(afterNodeId);
|
|
1043
|
-
const fieldId = fieldConfig.idField || "id";
|
|
1044
|
-
const fieldChildren = fieldConfig.childrenField || "children";
|
|
1045
|
-
// Check if the target node is at this level
|
|
1046
|
-
const targetIndex = nodes.findIndex((node) => String(node[fieldId]) === afterNodeIdStr);
|
|
1047
|
-
if (targetIndex >= 0) {
|
|
1048
|
-
// Insert after the target node at this level
|
|
1049
|
-
const result = [...nodes];
|
|
1050
|
-
const nodeWithChildren = Object.assign(Object.assign({}, newNode), { [fieldChildren]: [] });
|
|
1051
|
-
result.splice(targetIndex + 1, 0, nodeWithChildren);
|
|
1052
|
-
return result;
|
|
1053
|
-
}
|
|
1054
|
-
// Otherwise, recursively search in children
|
|
1055
|
-
return nodes.map((node) => {
|
|
1056
|
-
const children = node[fieldChildren];
|
|
1057
|
-
if (children && Array.isArray(children)) {
|
|
1058
|
-
const updatedChildren = insertAfterInHierarchy(children);
|
|
1059
|
-
if (updatedChildren !== children) {
|
|
1060
|
-
return Object.assign(Object.assign({}, node), { [fieldChildren]: updatedChildren });
|
|
1061
|
-
}
|
|
1062
|
-
}
|
|
1063
|
-
return node;
|
|
1064
|
-
});
|
|
1065
|
-
};
|
|
1066
|
-
// Update the internal data state
|
|
1067
|
-
setInternalData((prevData) => {
|
|
1068
|
-
const currentData = prevData !== null && prevData !== void 0 ? prevData : data;
|
|
1069
|
-
if (dataFormat === "flat" && Array.isArray(currentData)) {
|
|
1070
|
-
return insertAfterInFlat(currentData);
|
|
1071
|
-
}
|
|
1072
|
-
else if (dataFormat === "hierarchy" && Array.isArray(currentData)) {
|
|
1073
|
-
return insertAfterInHierarchy(currentData);
|
|
1074
|
-
}
|
|
1075
|
-
return currentData;
|
|
1076
|
-
});
|
|
1077
|
-
},
|
|
1078
|
-
// Node state management methods
|
|
1079
|
-
getNodeLoadingState: (nodeId) => {
|
|
1080
|
-
return getNodeState(nodeId);
|
|
1081
|
-
},
|
|
1082
|
-
markNodeLoaded: (nodeId) => {
|
|
1083
|
-
setNodeState(nodeId, "loaded");
|
|
1084
|
-
},
|
|
1085
|
-
markNodeUnloaded: (nodeId) => {
|
|
1086
|
-
setNodeState(nodeId, "unloaded");
|
|
1087
|
-
treeApiMethods.collapseNode(nodeId);
|
|
1088
|
-
},
|
|
1089
|
-
};
|
|
1090
|
-
}, [
|
|
1091
|
-
treeData,
|
|
1092
|
-
treeItemsById,
|
|
1093
|
-
expandedIds,
|
|
1094
|
-
effectiveSelectedId,
|
|
1095
|
-
flatTreeData,
|
|
1096
|
-
onNodeExpanded,
|
|
1097
|
-
onNodeCollapsed,
|
|
1098
|
-
setSelectedNodeById,
|
|
1099
|
-
nodeExists,
|
|
1100
|
-
fieldConfig,
|
|
1101
|
-
dataFormat,
|
|
1102
|
-
data,
|
|
1103
|
-
setInternalData,
|
|
1104
|
-
]);
|
|
1105
|
-
// Register component API methods for external access
|
|
1106
|
-
(0, react_1.useEffect)(() => {
|
|
1107
|
-
if (registerComponentApi) {
|
|
1108
|
-
registerComponentApi(treeApiMethods);
|
|
1109
|
-
}
|
|
1110
|
-
}, [registerComponentApi, treeApiMethods]);
|
|
1111
|
-
// Simplified focus management for the tree container
|
|
1112
|
-
const handleTreeFocus = (0, react_1.useCallback)(() => {
|
|
1113
|
-
if (flatTreeData.length > 0 && focusedIndex === -1) {
|
|
1114
|
-
// Initialize to selected item or first item on focus
|
|
1115
|
-
const selectedIndex = findNodeIndexById(effectiveSelectedId);
|
|
1116
|
-
const targetIndex = selectedIndex >= 0 ? selectedIndex : 0;
|
|
1117
|
-
setFocusedIndex(targetIndex);
|
|
1118
|
-
}
|
|
1119
|
-
}, [focusedIndex, flatTreeData, effectiveSelectedId]);
|
|
1120
|
-
const handleTreeBlur = (0, react_1.useCallback)((e) => {
|
|
1121
|
-
// Check if focus is moving to another element within the tree
|
|
1122
|
-
const isMovingWithinTree = e.relatedTarget && e.currentTarget.contains(e.relatedTarget);
|
|
1123
|
-
if (!isMovingWithinTree) {
|
|
1124
|
-
// Clear focus when tree loses focus completely
|
|
1125
|
-
setFocusedIndex(-1);
|
|
1126
|
-
}
|
|
1127
|
-
}, []);
|
|
1128
|
-
return ((0, jsx_runtime_1.jsx)("div", { ref: treeContainerRef, className: (0, classnames_1.default)(TreeComponent_module_scss_1.default.wrapper, className), role: "tree", "aria-label": "Tree navigation", "aria-multiselectable": "false", tabIndex: 0, onFocus: handleTreeFocus, onBlur: handleTreeBlur, onKeyDown: handleKeyDown, style: { height: "100%", overflow: "auto" }, children: (0, jsx_runtime_1.jsx)(virtua_1.Virtualizer, { ref: listRef, children: flatTreeData.map((node, index) => ((0, jsx_runtime_1.jsx)(TreeRow, { index: index, data: itemData }, node.key))) }) }));
|
|
1129
|
-
});
|