amis-ui 6.13.0-beta.8 → 6.13.0
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/esm/components/404.d.ts +53 -0
- package/esm/components/404.js +35 -0
- package/esm/components/Alert.d.ts +615 -0
- package/esm/components/Alert.js +266 -0
- package/esm/components/Alert2.d.ts +117 -0
- package/esm/components/Alert2.js +58 -0
- package/esm/components/AlphabetIndexer.d.ts +11 -0
- package/esm/components/AlphabetIndexer.js +48 -0
- package/esm/components/AnchorNav.d.ts +162 -0
- package/esm/components/AnchorNav.js +153 -0
- package/esm/components/AnchorNavSection.d.ts +2 -0
- package/esm/components/AnchorNavSection.js +7 -0
- package/esm/components/ArrayInput.d.ts +617 -0
- package/esm/components/ArrayInput.js +147 -0
- package/esm/components/AsideNav.d.ts +142 -0
- package/esm/components/AsideNav.js +133 -0
- package/esm/components/AssociatedSelection.d.ts +564 -0
- package/esm/components/AssociatedSelection.js +107 -0
- package/esm/components/AutoFoldedList.d.ts +87 -0
- package/esm/components/AutoFoldedList.js +124 -0
- package/esm/components/AutoSizer.d.ts +2 -0
- package/esm/components/AutoSizer.js +8 -0
- package/esm/components/Avatar.d.ts +374 -0
- package/esm/components/Avatar.js +126 -0
- package/esm/components/Badge.d.ts +118 -0
- package/esm/components/Badge.js +154 -0
- package/esm/components/BaiduMapPicker.d.ts +100 -0
- package/esm/components/BaiduMapPicker.js +366 -0
- package/esm/components/BarCode.d.ts +56 -0
- package/esm/components/BarCode.js +42 -0
- package/esm/components/Breadcrumb.d.ts +115 -0
- package/esm/components/Breadcrumb.js +160 -0
- package/esm/components/Button.d.ts +147 -0
- package/esm/components/Button.js +63 -0
- package/esm/components/CalendarMobile.d.ts +431 -0
- package/esm/components/CalendarMobile.js +538 -0
- package/esm/components/Card.d.ts +444 -0
- package/esm/components/Card.js +88 -0
- package/esm/components/Cascader.d.ts +108 -0
- package/esm/components/Cascader.js +515 -0
- package/esm/components/ChainedDropdownSelection.d.ts +561 -0
- package/esm/components/ChainedDropdownSelection.js +104 -0
- package/esm/components/ChainedSelection.d.ts +554 -0
- package/esm/components/ChainedSelection.js +184 -0
- package/esm/components/Checkbox.d.ts +110 -0
- package/esm/components/Checkbox.js +87 -0
- package/esm/components/CityArea.d.ts +299 -0
- package/esm/components/CityArea.js +190 -0
- package/esm/components/CityDB.d.ts +13 -0
- package/esm/components/CityDB.js +3942 -0
- package/esm/components/CodeMirror.d.ts +29 -0
- package/esm/components/CodeMirror.js +140 -0
- package/esm/components/Collapse.d.ts +447 -0
- package/esm/components/Collapse.js +184 -0
- package/esm/components/CollapseGroup.d.ts +219 -0
- package/esm/components/CollapseGroup.js +117 -0
- package/esm/components/ColorPicker.d.ts +530 -0
- package/esm/components/ColorPicker.js +260 -0
- package/esm/components/Combo.d.ts +354 -0
- package/esm/components/Combo.js +212 -0
- package/esm/components/ConditionBuilder.d.ts +2 -0
- package/esm/components/ConditionBuilder.js +7 -0
- package/esm/components/ConfirmBox.d.ts +322 -0
- package/esm/components/ConfirmBox.js +129 -0
- package/esm/components/ContextMenu.d.ts +115 -0
- package/esm/components/ContextMenu.js +310 -0
- package/esm/components/DatePicker.d.ts +638 -0
- package/esm/components/DatePicker.js +717 -0
- package/esm/components/DateRangePicker.d.ts +1046 -0
- package/esm/components/DateRangePicker.js +1386 -0
- package/esm/components/DiffEditor.d.ts +21 -0
- package/esm/components/DiffEditor.js +119 -0
- package/esm/components/DndContainer.d.ts +205 -0
- package/esm/components/DndContainer.js +25 -0
- package/esm/components/Drawer.d.ts +159 -0
- package/esm/components/Drawer.js +272 -0
- package/esm/components/DropDownSelection.d.ts +557 -0
- package/esm/components/DropDownSelection.js +78 -0
- package/esm/components/DropdownContextMenus.d.ts +84 -0
- package/esm/components/DropdownContextMenus.js +93 -0
- package/esm/components/Editor.d.ts +681 -0
- package/esm/components/Editor.js +238 -0
- package/esm/components/Form.d.ts +31 -0
- package/esm/components/Form.js +84 -0
- package/esm/components/FormField.d.ts +287 -0
- package/esm/components/FormField.js +78 -0
- package/esm/components/FormulaPicker.d.ts +2 -0
- package/esm/components/FormulaPicker.js +7 -0
- package/esm/components/GaodeMapPicker.d.ts +89 -0
- package/esm/components/GaodeMapPicker.js +204 -0
- package/esm/components/GridNav.d.ts +53 -0
- package/esm/components/GridNav.js +125 -0
- package/esm/components/GridNavItem.d.ts +2 -0
- package/esm/components/GridNavItem.js +7 -0
- package/esm/components/GroupedSelection.d.ts +543 -0
- package/esm/components/GroupedSelection.js +138 -0
- package/esm/components/HeadCellDropDown.d.ts +2 -0
- package/esm/components/HeadCellDropDown.js +7 -0
- package/esm/components/HorizontalScroll.d.ts +75 -0
- package/esm/components/HorizontalScroll.js +271 -0
- package/esm/components/Html.d.ts +82 -0
- package/esm/components/Html.js +52 -0
- package/esm/components/Icon.d.ts +2 -0
- package/esm/components/Icon.js +7 -0
- package/esm/components/ImageGallery.d.ts +465 -0
- package/esm/components/ImageGallery.js +396 -0
- package/esm/components/Input.d.ts +18 -0
- package/esm/components/Input.js +75 -0
- package/esm/components/InputBox.d.ts +100 -0
- package/esm/components/InputBox.js +98 -0
- package/esm/components/InputBoxWithSuggestion.d.ts +272 -0
- package/esm/components/InputBoxWithSuggestion.js +69 -0
- package/esm/components/InputJSONSchema.d.ts +2 -0
- package/esm/components/InputJSONSchema.js +7 -0
- package/esm/components/InputTable.d.ts +317 -0
- package/esm/components/InputTable.js +176 -0
- package/esm/components/JSONSchemaEditor.d.ts +2 -0
- package/esm/components/JSONSchemaEditor.js +7 -0
- package/esm/components/Layout.d.ts +74 -0
- package/esm/components/Layout.js +60 -0
- package/esm/components/Link.d.ts +60 -0
- package/esm/components/Link.js +44 -0
- package/esm/components/ListGroup.d.ts +77 -0
- package/esm/components/ListGroup.js +31 -0
- package/esm/components/ListMenu.d.ts +568 -0
- package/esm/components/ListMenu.js +62 -0
- package/esm/components/LocationPicker.d.ts +467 -0
- package/esm/components/LocationPicker.js +208 -0
- package/esm/components/Markdown.d.ts +25 -0
- package/esm/components/Markdown.js +70 -0
- package/esm/components/Menu.d.ts +2 -0
- package/esm/components/Menu.js +7 -0
- package/esm/components/MixedInput.d.ts +55 -0
- package/esm/components/MixedInput.js +88 -0
- package/esm/components/MobileDevTool.d.ts +12 -0
- package/esm/components/MobileDevTool.js +312 -0
- package/esm/components/Modal.d.ts +1316 -0
- package/esm/components/Modal.js +261 -0
- package/esm/components/ModalManager.d.ts +17 -0
- package/esm/components/ModalManager.js +42 -0
- package/esm/components/MonthRangePicker.d.ts +744 -0
- package/esm/components/MultilineText.d.ts +454 -0
- package/esm/components/MultilineText.js +90 -0
- package/esm/components/NumberInput.d.ts +201 -0
- package/esm/components/NumberInput.js +274 -0
- package/esm/components/OverflowTpl.d.ts +61 -0
- package/esm/components/OverflowTpl.js +101 -0
- package/esm/components/Pagination.d.ts +812 -0
- package/esm/components/Pagination.js +377 -0
- package/esm/components/PdfViewer.d.ts +49 -0
- package/esm/components/PdfViewer.js +83 -0
- package/esm/components/Picker.d.ts +277 -0
- package/esm/components/Picker.js +73 -0
- package/esm/components/PickerColumn.d.ts +62 -0
- package/esm/components/PickerColumn.js +276 -0
- package/esm/components/PickerContainer.d.ts +291 -0
- package/esm/components/PickerContainer.js +157 -0
- package/esm/components/PopOverContainer.d.ts +59 -0
- package/esm/components/PopOverContainer.js +149 -0
- package/esm/components/PopUp.d.ts +573 -0
- package/esm/components/PopUp.js +85 -0
- package/esm/components/Progress.d.ts +311 -0
- package/esm/components/Progress.js +136 -0
- package/esm/components/PullRefresh.d.ts +79 -0
- package/esm/components/PullRefresh.js +172 -0
- package/esm/components/Radios.d.ts +170 -0
- package/esm/components/Radios.js +129 -0
- package/esm/components/Range.d.ts +131 -0
- package/esm/components/Range.js +517 -0
- package/esm/components/Rating.d.ts +227 -0
- package/esm/components/Rating.js +341 -0
- package/esm/components/ResultBox.d.ts +532 -0
- package/esm/components/ResultBox.js +195 -0
- package/esm/components/ResultList.d.ts +554 -0
- package/esm/components/ResultList.js +254 -0
- package/esm/components/ResultTableList.d.ts +786 -0
- package/esm/components/ResultTableList.js +152 -0
- package/esm/components/ResultTreeList.d.ts +425 -0
- package/esm/components/ResultTreeList.js +241 -0
- package/esm/components/RichText.d.ts +48 -0
- package/esm/components/RichText.js +271 -0
- package/esm/components/SearchBox.d.ts +625 -0
- package/esm/components/SearchBox.js +299 -0
- package/esm/components/Select.d.ts +6498 -0
- package/esm/components/Select.js +815 -0
- package/esm/components/SelectMobile.d.ts +38 -0
- package/esm/components/SelectMobile.js +370 -0
- package/esm/components/Selection.d.ts +598 -0
- package/esm/components/Selection.js +166 -0
- package/esm/components/Shape.d.ts +58 -0
- package/esm/components/Shape.js +429 -0
- package/esm/components/Signature.d.ts +279 -0
- package/esm/components/Signature.js +293 -0
- package/esm/components/Slider.d.ts +56 -0
- package/esm/components/Slider.js +140 -0
- package/esm/components/SparkLine.d.ts +397 -0
- package/esm/components/SparkLine.js +62 -0
- package/esm/components/Spinner.d.ts +266 -0
- package/esm/components/Spinner.js +202 -0
- package/esm/components/Steps.d.ts +117 -0
- package/esm/components/Steps.js +76 -0
- package/esm/components/Switch.d.ts +105 -0
- package/esm/components/Switch.js +73 -0
- package/esm/components/Tab.d.ts +2 -0
- package/esm/components/Tab.js +7 -0
- package/esm/components/Table.d.ts +2 -0
- package/esm/components/Table.js +7 -0
- package/esm/components/TableSelection.d.ts +791 -0
- package/esm/components/TableSelection.js +169 -0
- package/esm/components/Tabs.d.ts +670 -0
- package/esm/components/Tabs.js +607 -0
- package/esm/components/TabsTransfer.d.ts +423 -0
- package/esm/components/TabsTransfer.js +221 -0
- package/esm/components/TabsTransferPicker.d.ts +267 -0
- package/esm/components/TabsTransferPicker.js +81 -0
- package/esm/components/Tag.d.ts +318 -0
- package/esm/components/Tag.js +137 -0
- package/esm/components/Textarea.d.ts +564 -0
- package/esm/components/Textarea.js +147 -0
- package/esm/components/Timeline.d.ts +56 -0
- package/esm/components/Timeline.js +60 -0
- package/esm/components/TimelineItem.d.ts +1292 -0
- package/esm/components/TimelineItem.js +101 -0
- package/esm/components/Tinymce.d.ts +66 -0
- package/esm/components/Tinymce.js +632 -0
- package/esm/components/TitleBar.d.ts +123 -0
- package/esm/components/TitleBar.js +48 -0
- package/esm/components/Toast.d.ts +591 -0
- package/esm/components/Toast.js +247 -0
- package/esm/components/Tooltip.d.ts +65 -0
- package/esm/components/Tooltip.js +36 -0
- package/esm/components/TooltipWrapper.d.ts +217 -0
- package/esm/components/TooltipWrapper.js +181 -0
- package/esm/components/Transfer.d.ts +1844 -0
- package/esm/components/Transfer.js +485 -0
- package/esm/components/TransferDropDown.d.ts +634 -0
- package/esm/components/TransferDropDown.js +98 -0
- package/esm/components/TransferPicker.d.ts +275 -0
- package/esm/components/TransferPicker.js +98 -0
- package/esm/components/TransferSearch.d.ts +283 -0
- package/esm/components/TransferSearch.js +100 -0
- package/esm/components/Tree.d.ts +1953 -0
- package/esm/components/Tree.js +1220 -0
- package/esm/components/TreeSelection.d.ts +601 -0
- package/esm/components/TreeSelection.js +201 -0
- package/esm/components/UserSelect.d.ts +541 -0
- package/esm/components/UserSelect.js +674 -0
- package/esm/components/UserTabSelect.d.ts +315 -0
- package/esm/components/UserTabSelect.js +227 -0
- package/esm/components/VerificationCode.d.ts +116 -0
- package/esm/components/VerificationCode.js +172 -0
- package/esm/components/VirtualList.d.ts +2 -0
- package/esm/components/VirtualList.js +7 -0
- package/esm/components/WithRemoteConfig.d.ts +383 -0
- package/esm/components/WithRemoteConfig.js +302 -0
- package/esm/components/WithStore.d.ts +72 -0
- package/esm/components/WithStore.js +48 -0
- package/esm/components/calendar/Calendar.d.ts +83 -0
- package/esm/components/calendar/Calendar.js +529 -0
- package/esm/components/calendar/CalendarContainer.d.ts +10 -0
- package/esm/components/calendar/CalendarContainer.js +27 -0
- package/esm/components/calendar/DaysView.d.ts +184 -0
- package/esm/components/calendar/DaysView.js +528 -0
- package/esm/components/calendar/MonthsView.d.ts +133 -0
- package/esm/components/calendar/MonthsView.js +175 -0
- package/esm/components/calendar/QuartersView.d.ts +102 -0
- package/esm/components/calendar/QuartersView.js +125 -0
- package/esm/components/calendar/TimeView.d.ts +183 -0
- package/esm/components/calendar/TimeView.js +559 -0
- package/esm/components/calendar/YearsView.d.ts +102 -0
- package/esm/components/calendar/YearsView.js +122 -0
- package/esm/components/condition-builder/Expression.d.ts +292 -0
- package/esm/components/condition-builder/Expression.js +121 -0
- package/esm/components/condition-builder/Field.d.ts +272 -0
- package/esm/components/condition-builder/Field.js +32 -0
- package/esm/components/condition-builder/Formula.d.ts +261 -0
- package/esm/components/condition-builder/Func.d.ts +273 -0
- package/esm/components/condition-builder/Func.js +75 -0
- package/esm/components/condition-builder/Group.d.ts +310 -0
- package/esm/components/condition-builder/Group.js +191 -0
- package/esm/components/condition-builder/GroupOrItem.d.ts +87 -0
- package/esm/components/condition-builder/GroupOrItem.js +105 -0
- package/esm/components/condition-builder/InputSwitch.d.ts +47 -0
- package/esm/components/condition-builder/InputSwitch.js +28 -0
- package/esm/components/condition-builder/Item.d.ts +287 -0
- package/esm/components/condition-builder/Item.js +232 -0
- package/esm/components/condition-builder/Value.d.ts +274 -0
- package/esm/components/condition-builder/Value.js +114 -0
- package/esm/components/condition-builder/config.d.ts +36 -0
- package/esm/components/condition-builder/config.js +120 -0
- package/esm/components/condition-builder/index.d.ts +319 -0
- package/esm/components/condition-builder/index.js +228 -0
- package/esm/components/condition-builder/types.d.ts +116 -0
- package/esm/components/formula/CodeEditor.d.ts +92 -0
- package/esm/components/formula/CodeEditor.js +99 -0
- package/esm/components/formula/Editor.d.ts +516 -0
- package/esm/components/formula/Editor.js +446 -0
- package/esm/components/formula/FuncList.d.ts +46 -0
- package/esm/components/formula/FuncList.js +64 -0
- package/esm/components/formula/Input.d.ts +292 -0
- package/esm/components/formula/Input.js +122 -0
- package/esm/components/formula/Picker.d.ts +492 -0
- package/esm/components/formula/Picker.js +454 -0
- package/esm/components/formula/VariableList.d.ts +58 -0
- package/esm/components/formula/VariableList.js +183 -0
- package/esm/components/formula/plugin.d.ts +51 -0
- package/esm/components/formula/plugin.js +372 -0
- package/esm/components/icons.d.ts +61 -0
- package/esm/components/icons.js +458 -0
- package/esm/components/index.d.ts +138 -0
- package/esm/components/json-schema/Array.d.ts +3 -0
- package/esm/components/json-schema/Array.js +129 -0
- package/esm/components/json-schema/Item.d.ts +5 -0
- package/esm/components/json-schema/Item.js +63 -0
- package/esm/components/json-schema/Object.d.ts +5 -0
- package/esm/components/json-schema/Object.js +265 -0
- package/esm/components/json-schema/index.d.ts +272 -0
- package/esm/components/json-schema/index.js +29 -0
- package/esm/components/menu/MenuContext.d.ts +83 -0
- package/esm/components/menu/MenuContext.js +25 -0
- package/esm/components/menu/MenuItem.d.ts +81 -0
- package/esm/components/menu/MenuItem.js +112 -0
- package/esm/components/menu/PanelMenu.d.ts +46 -0
- package/esm/components/menu/PanelMenu.js +68 -0
- package/esm/components/menu/SubMenu.d.ts +84 -0
- package/esm/components/menu/SubMenu.js +137 -0
- package/esm/components/menu/index.d.ts +381 -0
- package/esm/components/menu/index.js +369 -0
- package/esm/components/schema-editor/Array.d.ts +11 -0
- package/esm/components/schema-editor/Array.js +84 -0
- package/esm/components/schema-editor/Common.d.ts +61 -0
- package/esm/components/schema-editor/Common.js +161 -0
- package/esm/components/schema-editor/Item.d.ts +8 -0
- package/esm/components/schema-editor/Item.js +24 -0
- package/esm/components/schema-editor/Object.d.ts +51 -0
- package/esm/components/schema-editor/Object.js +294 -0
- package/esm/components/schema-editor/SchemaVariableList.d.ts +186 -0
- package/esm/components/schema-editor/SchemaVariableList.js +74 -0
- package/esm/components/schema-editor/SchemaVariableListPicker.d.ts +179 -0
- package/esm/components/schema-editor/SchemaVariableListPicker.js +34 -0
- package/esm/components/schema-editor/index.d.ts +797 -0
- package/esm/components/schema-editor/index.js +122 -0
- package/esm/components/table/Cell.d.ts +36 -0
- package/esm/components/table/Cell.js +43 -0
- package/esm/components/table/ColGroup.d.ts +24 -0
- package/esm/components/table/ColGroup.js +58 -0
- package/esm/components/table/Head.d.ts +45 -0
- package/esm/components/table/Head.js +150 -0
- package/esm/components/table/HeadCellDropDown.d.ts +289 -0
- package/esm/components/table/HeadCellDropDown.js +55 -0
- package/esm/components/table/HeadCellFilter.d.ts +414 -0
- package/esm/components/table/HeadCellFilter.js +131 -0
- package/esm/components/table/HeadCellSelect.d.ts +357 -0
- package/esm/components/table/HeadCellSelect.js +52 -0
- package/esm/components/table/HeadCellSort.d.ts +278 -0
- package/esm/components/table/HeadCellSort.js +88 -0
- package/esm/components/table/ItemActionsWrapper.d.ts +10 -0
- package/esm/components/table/ItemActionsWrapper.js +29 -0
- package/esm/components/table/Row.d.ts +56 -0
- package/esm/components/table/Row.js +224 -0
- package/esm/components/table/SummaryRow.d.ts +28 -0
- package/esm/components/table/SummaryRow.js +73 -0
- package/esm/components/table/index.d.ts +852 -0
- package/esm/components/table/index.js +1069 -0
- package/esm/components/table/util.d.ts +56 -0
- package/esm/components/table/util.js +276 -0
- package/esm/components/virtual-list/AutoSizer.d.ts +19 -0
- package/esm/components/virtual-list/AutoSizer.js +49 -0
- package/esm/components/virtual-list/SizeAndPositionManager.d.ts +70 -0
- package/esm/components/virtual-list/SizeAndPositionManager.js +216 -0
- package/esm/components/virtual-list/constants.d.ts +34 -0
- package/esm/components/virtual-list/constants.js +45 -0
- package/esm/components/virtual-list/index.d.ts +99 -0
- package/esm/components/virtual-list/index.js +288 -0
- package/esm/components/withBadge.d.ts +2 -0
- package/esm/components/withBadge.js +7 -0
- package/esm/hooks/index.d.ts +8 -0
- package/esm/hooks/use-click-away.d.ts +12 -0
- package/esm/hooks/use-click-away.js +55 -0
- package/esm/hooks/use-on-screen.d.ts +2 -0
- package/esm/hooks/use-on-screen.js +28 -0
- package/esm/hooks/use-set-state.d.ts +2 -0
- package/esm/hooks/use-set-state.js +19 -0
- package/esm/hooks/use-sub-form.d.ts +4 -0
- package/esm/hooks/use-sub-form.js +39 -0
- package/esm/hooks/use-touch.d.ts +16 -0
- package/esm/hooks/use-touch.js +77 -0
- package/esm/hooks/use-update-effect.d.ts +3 -0
- package/esm/hooks/use-update-effect.js +21 -0
- package/esm/hooks/use-validation-resolver.d.ts +7 -0
- package/esm/hooks/use-validation-resolver.js +115 -0
- package/esm/icons/alert-danger.svg.js +22 -0
- package/esm/icons/alert-info.svg.js +22 -0
- package/esm/icons/alert-success.svg.js +22 -0
- package/esm/icons/alert-warning.svg.js +22 -0
- package/esm/icons/arrow-double-left.svg.js +24 -0
- package/esm/icons/arrow-double-right.svg.js +24 -0
- package/esm/icons/back.svg.js +21 -0
- package/esm/icons/calendar.svg.js +31 -0
- package/esm/icons/caret.svg.js +21 -0
- package/esm/icons/check.svg.js +21 -0
- package/esm/icons/clock.svg.js +29 -0
- package/esm/icons/close-small.svg.js +24 -0
- package/esm/icons/close.svg.js +21 -0
- package/esm/icons/cloud-upload.svg.js +22 -0
- package/esm/icons/column-filter.svg.js +22 -0
- package/esm/icons/columns.svg.js +21 -0
- package/esm/icons/compress-alt.svg.js +21 -0
- package/esm/icons/copy.svg.js +26 -0
- package/esm/icons/date.svg.js +26 -0
- package/esm/icons/department.svg.js +52 -0
- package/esm/icons/desk-empty.svg.js +73 -0
- package/esm/icons/dot.svg.js +36 -0
- package/esm/icons/down-arrow-bold.svg.js +22 -0
- package/esm/icons/down.svg.js +23 -0
- package/esm/icons/download.svg.js +24 -0
- package/esm/icons/drag-bar.svg.js +53 -0
- package/esm/icons/drag.svg.js +22 -0
- package/esm/icons/edit.svg.js +21 -0
- package/esm/icons/ellipsis-v.svg.js +21 -0
- package/esm/icons/enter.svg.js +20 -0
- package/esm/icons/exchange.svg.js +21 -0
- package/esm/icons/expand-alt.svg.js +21 -0
- package/esm/icons/fail.svg.js +31 -0
- package/esm/icons/file.svg.js +22 -0
- package/esm/icons/filter.svg.js +21 -0
- package/esm/icons/folder.svg.js +24 -0
- package/esm/icons/fullscreen.svg.js +21 -0
- package/esm/icons/function.svg.js +21 -0
- package/esm/icons/home.svg.js +21 -0
- package/esm/icons/if.svg.js +21 -0
- package/esm/icons/image.svg.js +20 -0
- package/esm/icons/info-circle.svg.js +21 -0
- package/esm/icons/info.svg.js +27 -0
- package/esm/icons/input-clear.svg.js +20 -0
- package/esm/icons/invisible.svg.js +22 -0
- package/esm/icons/left-arrow.svg.js +23 -0
- package/esm/icons/loading-outline.svg.js +21 -0
- package/esm/icons/location.svg.js +20 -0
- package/esm/icons/menu.svg.js +20 -0
- package/esm/icons/minus.svg.js +21 -0
- package/esm/icons/move.svg.js +22 -0
- package/esm/icons/mute.svg.js +21 -0
- package/esm/icons/new-edit.svg.js +22 -0
- package/esm/icons/pause.svg.js +21 -0
- package/esm/icons/pencil.svg.js +21 -0
- package/esm/icons/play.svg.js +20 -0
- package/esm/icons/plus-cicle.svg.js +20 -0
- package/esm/icons/plus-fine.svg.js +21 -0
- package/esm/icons/plus.svg.js +21 -0
- package/esm/icons/post.svg.js +48 -0
- package/esm/icons/question-mark.svg.js +26 -0
- package/esm/icons/question.svg.js +21 -0
- package/esm/icons/question2.svg.js +34 -0
- package/esm/icons/redo.svg.js +21 -0
- package/esm/icons/refresh.svg.js +21 -0
- package/esm/icons/reload.svg.js +21 -0
- package/esm/icons/remove.svg.js +21 -0
- package/esm/icons/retry.svg.js +24 -0
- package/esm/icons/right-arrow-bold.svg.js +21 -0
- package/esm/icons/right-arrow.svg.js +23 -0
- package/esm/icons/right-double-arrow.svg.js +22 -0
- package/esm/icons/role.svg.js +43 -0
- package/esm/icons/rotate-left.svg.js +22 -0
- package/esm/icons/rotate-right.svg.js +22 -0
- package/esm/icons/rotate-screen.svg.js +21 -0
- package/esm/icons/scale-origin.svg.js +24 -0
- package/esm/icons/schedule.svg.js +24 -0
- package/esm/icons/search.svg.js +21 -0
- package/esm/icons/setting.svg.js +21 -0
- package/esm/icons/slider-handle-icon.svg.js +22 -0
- package/esm/icons/sort-asc.svg.js +21 -0
- package/esm/icons/sort-default.svg.js +21 -0
- package/esm/icons/sort-desc.svg.js +21 -0
- package/esm/icons/star.svg.js +21 -0
- package/esm/icons/status-close.svg.js +23 -0
- package/esm/icons/steps-finsh.svg.js +22 -0
- package/esm/icons/sub-plus.svg.js +20 -0
- package/esm/icons/success.svg.js +29 -0
- package/esm/icons/transparent.svg.js +38 -0
- package/esm/icons/trash.svg.js +22 -0
- package/esm/icons/tree-down.svg.js +21 -0
- package/esm/icons/undo-normal.svg.js +25 -0
- package/esm/icons/undo.svg.js +21 -0
- package/esm/icons/unfullscreen.svg.js +21 -0
- package/esm/icons/upload.svg.js +21 -0
- package/esm/icons/user-remove.svg.js +33 -0
- package/esm/icons/view.svg.js +22 -0
- package/esm/icons/volume.svg.js +24 -0
- package/esm/icons/warning-mark.svg.js +22 -0
- package/esm/icons/warning.svg.js +21 -0
- package/esm/icons/window-restore.svg.js +21 -0
- package/esm/icons/zoom-in.svg.js +21 -0
- package/esm/icons/zoom-out.svg.js +21 -0
- package/esm/index.d.ts +15 -0
- package/esm/index.js +156 -0
- package/esm/locale/de-DE.d.ts +1 -0
- package/esm/locale/de-DE.js +421 -0
- package/esm/locale/en-US.d.ts +1 -0
- package/esm/locale/en-US.js +427 -0
- package/esm/locale/zh-CN.d.ts +1 -0
- package/esm/locale/zh-CN.js +436 -0
- package/esm/themes/ang.d.ts +3 -0
- package/esm/themes/ang.js +15 -0
- package/esm/themes/antd.d.ts +1 -0
- package/esm/themes/antd.js +42 -0
- package/esm/themes/cxd.d.ts +3 -0
- package/esm/themes/cxd.js +455 -0
- package/esm/themes/dark.d.ts +3 -0
- package/esm/themes/dark.js +23 -0
- package/esm/themes/default.d.ts +4 -0
- package/esm/utils/index.d.ts +2 -0
- package/esm/utils/smoothSignature.d.ts +86 -0
- package/esm/utils/vectorComputed.d.ts +20 -0
- package/esm/utils/vectorComputed.js +75 -0
- package/esm/withRemoteConfig.d.ts +2 -0
- package/esm/withRemoteConfig.js +7 -0
- package/esm/withStore.d.ts +2 -0
- package/esm/withStore.js +7 -0
- package/lib/components/404.d.ts +53 -0
- package/lib/components/404.js +43 -0
- package/lib/components/Alert.d.ts +615 -0
- package/lib/components/Alert.js +279 -0
- package/lib/components/Alert2.d.ts +117 -0
- package/lib/components/Alert2.js +66 -0
- package/lib/components/AlphabetIndexer.d.ts +11 -0
- package/lib/components/AlphabetIndexer.js +59 -0
- package/lib/components/AnchorNav.d.ts +162 -0
- package/lib/components/AnchorNav.js +162 -0
- package/lib/components/AnchorNavSection.d.ts +2 -0
- package/lib/components/AnchorNavSection.js +14 -0
- package/lib/components/ArrayInput.d.ts +617 -0
- package/lib/components/ArrayInput.js +160 -0
- package/lib/components/AsideNav.d.ts +142 -0
- package/lib/components/AsideNav.js +140 -0
- package/lib/components/AssociatedSelection.d.ts +564 -0
- package/lib/components/AssociatedSelection.js +110 -0
- package/lib/components/AutoFoldedList.d.ts +87 -0
- package/lib/components/AutoFoldedList.js +128 -0
- package/lib/components/AutoSizer.d.ts +2 -0
- package/lib/components/AutoSizer.js +15 -0
- package/lib/components/Avatar.d.ts +374 -0
- package/lib/components/Avatar.js +154 -0
- package/lib/components/Badge.d.ts +118 -0
- package/lib/components/Badge.js +165 -0
- package/lib/components/BaiduMapPicker.d.ts +100 -0
- package/lib/components/BaiduMapPicker.js +379 -0
- package/lib/components/BarCode.d.ts +56 -0
- package/lib/components/BarCode.js +52 -0
- package/lib/components/Breadcrumb.d.ts +115 -0
- package/lib/components/Breadcrumb.js +170 -0
- package/lib/components/Button.d.ts +147 -0
- package/lib/components/Button.js +71 -0
- package/lib/components/CalendarMobile.d.ts +431 -0
- package/lib/components/CalendarMobile.js +546 -0
- package/lib/components/Card.d.ts +444 -0
- package/lib/components/Card.js +100 -0
- package/lib/components/Cascader.d.ts +108 -0
- package/lib/components/Cascader.js +527 -0
- package/lib/components/ChainedDropdownSelection.d.ts +561 -0
- package/lib/components/ChainedDropdownSelection.js +116 -0
- package/lib/components/ChainedSelection.d.ts +554 -0
- package/lib/components/ChainedSelection.js +197 -0
- package/lib/components/Checkbox.d.ts +110 -0
- package/lib/components/Checkbox.js +95 -0
- package/lib/components/CityArea.d.ts +299 -0
- package/lib/components/CityArea.js +197 -0
- package/lib/components/CityDB.d.ts +13 -0
- package/lib/components/CityDB.js +3949 -0
- package/lib/components/CodeMirror.d.ts +29 -0
- package/lib/components/CodeMirror.js +152 -0
- package/lib/components/Collapse.d.ts +447 -0
- package/lib/components/Collapse.js +192 -0
- package/lib/components/CollapseGroup.d.ts +219 -0
- package/lib/components/CollapseGroup.js +124 -0
- package/lib/components/ColorPicker.d.ts +530 -0
- package/lib/components/ColorPicker.js +267 -0
- package/lib/components/Combo.d.ts +354 -0
- package/lib/components/Combo.js +165 -0
- package/lib/components/ConditionBuilder.d.ts +2 -0
- package/lib/components/ConditionBuilder.js +14 -0
- package/lib/components/ConfirmBox.d.ts +322 -0
- package/lib/components/ConfirmBox.js +141 -0
- package/lib/components/ContextMenu.d.ts +115 -0
- package/lib/components/ContextMenu.js +327 -0
- package/lib/components/DatePicker.d.ts +638 -0
- package/lib/components/DatePicker.js +725 -0
- package/lib/components/DateRangePicker.d.ts +1046 -0
- package/lib/components/DateRangePicker.js +1398 -0
- package/lib/components/DiffEditor.d.ts +21 -0
- package/lib/components/DiffEditor.js +130 -0
- package/lib/components/DndContainer.d.ts +205 -0
- package/lib/components/DndContainer.js +32 -0
- package/lib/components/Drawer.d.ts +159 -0
- package/lib/components/Drawer.js +282 -0
- package/lib/components/DropDownSelection.d.ts +557 -0
- package/lib/components/DropDownSelection.js +85 -0
- package/lib/components/DropdownContextMenus.d.ts +84 -0
- package/lib/components/DropdownContextMenus.js +101 -0
- package/lib/components/Editor.d.ts +681 -0
- package/lib/components/Editor.js +246 -0
- package/lib/components/Form.d.ts +31 -0
- package/lib/components/Form.js +97 -0
- package/lib/components/FormField.d.ts +287 -0
- package/lib/components/FormField.js +90 -0
- package/lib/components/FormulaPicker.d.ts +2 -0
- package/lib/components/FormulaPicker.js +14 -0
- package/lib/components/GaodeMapPicker.d.ts +89 -0
- package/lib/components/GaodeMapPicker.js +217 -0
- package/lib/components/GridNav.d.ts +53 -0
- package/lib/components/GridNav.js +133 -0
- package/lib/components/GridNavItem.d.ts +2 -0
- package/lib/components/GridNavItem.js +14 -0
- package/lib/components/GroupedSelection.d.ts +543 -0
- package/lib/components/GroupedSelection.js +150 -0
- package/lib/components/HeadCellDropDown.d.ts +2 -0
- package/lib/components/HeadCellDropDown.js +14 -0
- package/lib/components/HorizontalScroll.d.ts +75 -0
- package/lib/components/HorizontalScroll.js +283 -0
- package/lib/components/Html.d.ts +82 -0
- package/lib/components/Html.js +59 -0
- package/lib/components/Icon.d.ts +2 -0
- package/lib/components/Icon.js +14 -0
- package/lib/components/ImageGallery.d.ts +465 -0
- package/lib/components/ImageGallery.js +409 -0
- package/lib/components/Input.d.ts +18 -0
- package/lib/components/Input.js +86 -0
- package/lib/components/InputBox.d.ts +100 -0
- package/lib/components/InputBox.js +110 -0
- package/lib/components/InputBoxWithSuggestion.d.ts +272 -0
- package/lib/components/InputBoxWithSuggestion.js +81 -0
- package/lib/components/InputJSONSchema.d.ts +2 -0
- package/lib/components/InputJSONSchema.js +14 -0
- package/lib/components/InputTable.d.ts +317 -0
- package/lib/components/InputTable.js +189 -0
- package/lib/components/JSONSchemaEditor.d.ts +2 -0
- package/lib/components/JSONSchemaEditor.js +14 -0
- package/lib/components/Layout.d.ts +74 -0
- package/lib/components/Layout.js +56 -0
- package/lib/components/Link.d.ts +60 -0
- package/lib/components/Link.js +56 -0
- package/lib/components/ListGroup.d.ts +77 -0
- package/lib/components/ListGroup.js +43 -0
- package/lib/components/ListMenu.d.ts +568 -0
- package/lib/components/ListMenu.js +74 -0
- package/lib/components/LocationPicker.d.ts +467 -0
- package/lib/components/LocationPicker.js +220 -0
- package/lib/components/Markdown.d.ts +25 -0
- package/lib/components/Markdown.js +83 -0
- package/lib/components/Menu.d.ts +2 -0
- package/lib/components/Menu.js +14 -0
- package/lib/components/MixedInput.d.ts +55 -0
- package/lib/components/MixedInput.js +99 -0
- package/lib/components/MobileDevTool.d.ts +12 -0
- package/lib/components/MobileDevTool.js +325 -0
- package/lib/components/Modal.d.ts +1316 -0
- package/lib/components/Modal.js +272 -0
- package/lib/components/ModalManager.d.ts +17 -0
- package/lib/components/ModalManager.js +53 -0
- package/lib/components/MonthRangePicker.d.ts +744 -0
- package/lib/components/MultilineText.d.ts +454 -0
- package/lib/components/MultilineText.js +102 -0
- package/lib/components/NumberInput.d.ts +201 -0
- package/lib/components/NumberInput.js +289 -0
- package/lib/components/OverflowTpl.d.ts +61 -0
- package/lib/components/OverflowTpl.js +109 -0
- package/lib/components/Pagination.d.ts +812 -0
- package/lib/components/Pagination.js +390 -0
- package/lib/components/PdfViewer.d.ts +49 -0
- package/lib/components/PdfViewer.js +89 -0
- package/lib/components/Picker.d.ts +277 -0
- package/lib/components/Picker.js +80 -0
- package/lib/components/PickerColumn.d.ts +62 -0
- package/lib/components/PickerColumn.js +288 -0
- package/lib/components/PickerContainer.d.ts +291 -0
- package/lib/components/PickerContainer.js +169 -0
- package/lib/components/PopOverContainer.d.ts +59 -0
- package/lib/components/PopOverContainer.js +162 -0
- package/lib/components/PopUp.d.ts +573 -0
- package/lib/components/PopUp.js +94 -0
- package/lib/components/Progress.d.ts +311 -0
- package/lib/components/Progress.js +148 -0
- package/lib/components/PullRefresh.d.ts +79 -0
- package/lib/components/PullRefresh.js +178 -0
- package/lib/components/Radios.d.ts +170 -0
- package/lib/components/Radios.js +126 -0
- package/lib/components/Range.d.ts +131 -0
- package/lib/components/Range.js +528 -0
- package/lib/components/Rating.d.ts +227 -0
- package/lib/components/Rating.js +349 -0
- package/lib/components/ResultBox.d.ts +532 -0
- package/lib/components/ResultBox.js +209 -0
- package/lib/components/ResultList.d.ts +554 -0
- package/lib/components/ResultList.js +268 -0
- package/lib/components/ResultTableList.d.ts +786 -0
- package/lib/components/ResultTableList.js +161 -0
- package/lib/components/ResultTreeList.d.ts +425 -0
- package/lib/components/ResultTreeList.js +256 -0
- package/lib/components/RichText.d.ts +48 -0
- package/lib/components/RichText.js +283 -0
- package/lib/components/SearchBox.d.ts +625 -0
- package/lib/components/SearchBox.js +315 -0
- package/lib/components/Select.d.ts +6497 -0
- package/lib/components/Select.js +832 -0
- package/lib/components/SelectMobile.d.ts +38 -0
- package/lib/components/SelectMobile.js +382 -0
- package/lib/components/Selection.d.ts +598 -0
- package/lib/components/Selection.js +176 -0
- package/lib/components/Shape.d.ts +58 -0
- package/lib/components/Shape.js +434 -0
- package/lib/components/Signature.d.ts +279 -0
- package/lib/components/Signature.js +297 -0
- package/lib/components/Slider.d.ts +56 -0
- package/lib/components/Slider.js +146 -0
- package/lib/components/SparkLine.d.ts +397 -0
- package/lib/components/SparkLine.js +74 -0
- package/lib/components/Spinner.d.ts +266 -0
- package/lib/components/Spinner.js +210 -0
- package/lib/components/Steps.d.ts +117 -0
- package/lib/components/Steps.js +84 -0
- package/lib/components/Switch.d.ts +105 -0
- package/lib/components/Switch.js +80 -0
- package/lib/components/Tab.d.ts +2 -0
- package/lib/components/Tab.js +14 -0
- package/lib/components/Table.d.ts +2 -0
- package/lib/components/Table.js +14 -0
- package/lib/components/TableSelection.d.ts +791 -0
- package/lib/components/TableSelection.js +183 -0
- package/lib/components/Tabs.d.ts +670 -0
- package/lib/components/Tabs.js +618 -0
- package/lib/components/TabsTransfer.d.ts +423 -0
- package/lib/components/TabsTransfer.js +234 -0
- package/lib/components/TabsTransferPicker.d.ts +267 -0
- package/lib/components/TabsTransferPicker.js +93 -0
- package/lib/components/Tag.d.ts +318 -0
- package/lib/components/Tag.js +146 -0
- package/lib/components/Textarea.d.ts +564 -0
- package/lib/components/Textarea.js +160 -0
- package/lib/components/Timeline.d.ts +56 -0
- package/lib/components/Timeline.js +68 -0
- package/lib/components/TimelineItem.d.ts +1292 -0
- package/lib/components/TimelineItem.js +118 -0
- package/lib/components/Tinymce.d.ts +66 -0
- package/lib/components/Tinymce.js +648 -0
- package/lib/components/TitleBar.d.ts +123 -0
- package/lib/components/TitleBar.js +51 -0
- package/lib/components/Toast.d.ts +591 -0
- package/lib/components/Toast.js +258 -0
- package/lib/components/Tooltip.d.ts +65 -0
- package/lib/components/Tooltip.js +43 -0
- package/lib/components/TooltipWrapper.d.ts +217 -0
- package/lib/components/TooltipWrapper.js +188 -0
- package/lib/components/Transfer.d.ts +1844 -0
- package/lib/components/Transfer.js +502 -0
- package/lib/components/TransferDropDown.d.ts +634 -0
- package/lib/components/TransferDropDown.js +106 -0
- package/lib/components/TransferPicker.d.ts +275 -0
- package/lib/components/TransferPicker.js +110 -0
- package/lib/components/TransferSearch.d.ts +283 -0
- package/lib/components/TransferSearch.js +113 -0
- package/lib/components/Tree.d.ts +1953 -0
- package/lib/components/Tree.js +1214 -0
- package/lib/components/TreeSelection.d.ts +601 -0
- package/lib/components/TreeSelection.js +209 -0
- package/lib/components/UserSelect.d.ts +541 -0
- package/lib/components/UserSelect.js +685 -0
- package/lib/components/UserTabSelect.d.ts +315 -0
- package/lib/components/UserTabSelect.js +235 -0
- package/lib/components/VerificationCode.d.ts +116 -0
- package/lib/components/VerificationCode.js +191 -0
- package/lib/components/VirtualList.d.ts +2 -0
- package/lib/components/VirtualList.js +14 -0
- package/lib/components/WithRemoteConfig.d.ts +382 -0
- package/lib/components/WithRemoteConfig.js +316 -0
- package/lib/components/WithStore.d.ts +72 -0
- package/lib/components/WithStore.js +61 -0
- package/lib/components/calendar/Calendar.d.ts +83 -0
- package/lib/components/calendar/Calendar.js +542 -0
- package/lib/components/calendar/CalendarContainer.d.ts +10 -0
- package/lib/components/calendar/CalendarContainer.js +38 -0
- package/lib/components/calendar/DaysView.d.ts +184 -0
- package/lib/components/calendar/DaysView.js +547 -0
- package/lib/components/calendar/MonthsView.d.ts +133 -0
- package/lib/components/calendar/MonthsView.js +188 -0
- package/lib/components/calendar/QuartersView.d.ts +102 -0
- package/lib/components/calendar/QuartersView.js +138 -0
- package/lib/components/calendar/TimeView.d.ts +183 -0
- package/lib/components/calendar/TimeView.js +574 -0
- package/lib/components/calendar/YearsView.d.ts +102 -0
- package/lib/components/calendar/YearsView.js +135 -0
- package/lib/components/condition-builder/Expression.d.ts +292 -0
- package/lib/components/condition-builder/Expression.js +133 -0
- package/lib/components/condition-builder/Field.d.ts +272 -0
- package/lib/components/condition-builder/Field.js +44 -0
- package/lib/components/condition-builder/Formula.d.ts +261 -0
- package/lib/components/condition-builder/Func.d.ts +273 -0
- package/lib/components/condition-builder/Func.js +87 -0
- package/lib/components/condition-builder/Group.d.ts +310 -0
- package/lib/components/condition-builder/Group.js +203 -0
- package/lib/components/condition-builder/GroupOrItem.d.ts +87 -0
- package/lib/components/condition-builder/GroupOrItem.js +117 -0
- package/lib/components/condition-builder/InputSwitch.d.ts +47 -0
- package/lib/components/condition-builder/InputSwitch.js +36 -0
- package/lib/components/condition-builder/Item.d.ts +287 -0
- package/lib/components/condition-builder/Item.js +244 -0
- package/lib/components/condition-builder/Value.d.ts +274 -0
- package/lib/components/condition-builder/Value.js +127 -0
- package/lib/components/condition-builder/config.d.ts +36 -0
- package/lib/components/condition-builder/config.js +125 -0
- package/lib/components/condition-builder/index.d.ts +319 -0
- package/lib/components/condition-builder/index.js +240 -0
- package/lib/components/condition-builder/types.d.ts +116 -0
- package/lib/components/formula/CodeEditor.d.ts +92 -0
- package/lib/components/formula/CodeEditor.js +110 -0
- package/lib/components/formula/Editor.d.ts +516 -0
- package/lib/components/formula/Editor.js +460 -0
- package/lib/components/formula/FuncList.d.ts +46 -0
- package/lib/components/formula/FuncList.js +76 -0
- package/lib/components/formula/Input.d.ts +292 -0
- package/lib/components/formula/Input.js +134 -0
- package/lib/components/formula/Picker.d.ts +492 -0
- package/lib/components/formula/Picker.js +467 -0
- package/lib/components/formula/VariableList.d.ts +58 -0
- package/lib/components/formula/VariableList.js +194 -0
- package/lib/components/formula/plugin.d.ts +51 -0
- package/lib/components/formula/plugin.js +381 -0
- package/lib/components/icons.d.ts +61 -0
- package/lib/components/icons.js +486 -0
- package/lib/components/index.d.ts +138 -0
- package/lib/components/json-schema/Array.d.ts +3 -0
- package/lib/components/json-schema/Array.js +140 -0
- package/lib/components/json-schema/Item.d.ts +5 -0
- package/lib/components/json-schema/Item.js +75 -0
- package/lib/components/json-schema/Object.d.ts +5 -0
- package/lib/components/json-schema/Object.js +278 -0
- package/lib/components/json-schema/index.d.ts +272 -0
- package/lib/components/json-schema/index.js +40 -0
- package/lib/components/menu/MenuContext.d.ts +83 -0
- package/lib/components/menu/MenuContext.js +29 -0
- package/lib/components/menu/MenuItem.d.ts +81 -0
- package/lib/components/menu/MenuItem.js +120 -0
- package/lib/components/menu/PanelMenu.d.ts +46 -0
- package/lib/components/menu/PanelMenu.js +74 -0
- package/lib/components/menu/SubMenu.d.ts +84 -0
- package/lib/components/menu/SubMenu.js +145 -0
- package/lib/components/menu/index.d.ts +381 -0
- package/lib/components/menu/index.js +379 -0
- package/lib/components/schema-editor/Array.d.ts +11 -0
- package/lib/components/schema-editor/Array.js +95 -0
- package/lib/components/schema-editor/Common.d.ts +61 -0
- package/lib/components/schema-editor/Common.js +174 -0
- package/lib/components/schema-editor/Item.d.ts +8 -0
- package/lib/components/schema-editor/Item.js +35 -0
- package/lib/components/schema-editor/Object.d.ts +51 -0
- package/lib/components/schema-editor/Object.js +305 -0
- package/lib/components/schema-editor/SchemaVariableList.d.ts +186 -0
- package/lib/components/schema-editor/SchemaVariableList.js +86 -0
- package/lib/components/schema-editor/SchemaVariableListPicker.d.ts +179 -0
- package/lib/components/schema-editor/SchemaVariableListPicker.js +46 -0
- package/lib/components/schema-editor/index.d.ts +797 -0
- package/lib/components/schema-editor/index.js +131 -0
- package/lib/components/table/Cell.d.ts +36 -0
- package/lib/components/table/Cell.js +50 -0
- package/lib/components/table/ColGroup.d.ts +24 -0
- package/lib/components/table/ColGroup.js +69 -0
- package/lib/components/table/Head.d.ts +45 -0
- package/lib/components/table/Head.js +157 -0
- package/lib/components/table/HeadCellDropDown.d.ts +289 -0
- package/lib/components/table/HeadCellDropDown.js +63 -0
- package/lib/components/table/HeadCellFilter.d.ts +414 -0
- package/lib/components/table/HeadCellFilter.js +140 -0
- package/lib/components/table/HeadCellSelect.d.ts +357 -0
- package/lib/components/table/HeadCellSelect.js +60 -0
- package/lib/components/table/HeadCellSort.d.ts +278 -0
- package/lib/components/table/HeadCellSort.js +96 -0
- package/lib/components/table/ItemActionsWrapper.d.ts +10 -0
- package/lib/components/table/ItemActionsWrapper.js +40 -0
- package/lib/components/table/Row.d.ts +56 -0
- package/lib/components/table/Row.js +231 -0
- package/lib/components/table/SummaryRow.d.ts +28 -0
- package/lib/components/table/SummaryRow.js +81 -0
- package/lib/components/table/index.d.ts +852 -0
- package/lib/components/table/index.js +1083 -0
- package/lib/components/table/util.d.ts +56 -0
- package/lib/components/table/util.js +298 -0
- package/lib/components/virtual-list/AutoSizer.d.ts +19 -0
- package/lib/components/virtual-list/AutoSizer.js +76 -0
- package/lib/components/virtual-list/SizeAndPositionManager.d.ts +70 -0
- package/lib/components/virtual-list/SizeAndPositionManager.js +220 -0
- package/lib/components/virtual-list/constants.d.ts +34 -0
- package/lib/components/virtual-list/constants.js +53 -0
- package/lib/components/virtual-list/index.d.ts +99 -0
- package/lib/components/virtual-list/index.js +317 -0
- package/lib/components/withBadge.d.ts +2 -0
- package/lib/components/withBadge.js +14 -0
- package/lib/helper.css +47744 -0
- package/lib/hooks/index.d.ts +8 -0
- package/lib/hooks/use-click-away.d.ts +12 -0
- package/lib/hooks/use-click-away.js +59 -0
- package/lib/hooks/use-on-screen.d.ts +2 -0
- package/lib/hooks/use-on-screen.js +32 -0
- package/lib/hooks/use-set-state.d.ts +2 -0
- package/lib/hooks/use-set-state.js +27 -0
- package/lib/hooks/use-sub-form.d.ts +4 -0
- package/lib/hooks/use-sub-form.js +48 -0
- package/lib/hooks/use-touch.d.ts +16 -0
- package/lib/hooks/use-touch.js +81 -0
- package/lib/hooks/use-update-effect.d.ts +3 -0
- package/lib/hooks/use-update-effect.js +25 -0
- package/lib/hooks/use-validation-resolver.d.ts +7 -0
- package/lib/hooks/use-validation-resolver.js +125 -0
- package/lib/icons/alert-danger.svg.js +29 -0
- package/lib/icons/alert-info.svg.js +29 -0
- package/lib/icons/alert-success.svg.js +29 -0
- package/lib/icons/alert-warning.svg.js +29 -0
- package/lib/icons/arrow-double-left.svg.js +31 -0
- package/lib/icons/arrow-double-right.svg.js +31 -0
- package/lib/icons/back.svg.js +28 -0
- package/lib/icons/calendar.svg.js +38 -0
- package/lib/icons/caret.svg.js +28 -0
- package/lib/icons/check.svg.js +28 -0
- package/lib/icons/clock.svg.js +36 -0
- package/lib/icons/close-small.svg.js +31 -0
- package/lib/icons/close.svg.js +28 -0
- package/lib/icons/cloud-upload.svg.js +29 -0
- package/lib/icons/column-filter.svg.js +29 -0
- package/lib/icons/columns.svg.js +28 -0
- package/lib/icons/compress-alt.svg.js +28 -0
- package/lib/icons/copy.svg.js +33 -0
- package/lib/icons/date.svg.js +33 -0
- package/lib/icons/department.svg.js +59 -0
- package/lib/icons/desk-empty.svg.js +80 -0
- package/lib/icons/dot.svg.js +43 -0
- package/lib/icons/down-arrow-bold.svg.js +29 -0
- package/lib/icons/down.svg.js +30 -0
- package/lib/icons/download.svg.js +31 -0
- package/lib/icons/drag-bar.svg.js +60 -0
- package/lib/icons/drag.svg.js +29 -0
- package/lib/icons/edit.svg.js +28 -0
- package/lib/icons/ellipsis-v.svg.js +28 -0
- package/lib/icons/enter.svg.js +27 -0
- package/lib/icons/exchange.svg.js +28 -0
- package/lib/icons/expand-alt.svg.js +28 -0
- package/lib/icons/fail.svg.js +38 -0
- package/lib/icons/file.svg.js +29 -0
- package/lib/icons/filter.svg.js +28 -0
- package/lib/icons/folder.svg.js +31 -0
- package/lib/icons/fullscreen.svg.js +28 -0
- package/lib/icons/function.svg.js +28 -0
- package/lib/icons/home.svg.js +28 -0
- package/lib/icons/if.svg.js +28 -0
- package/lib/icons/image.svg.js +27 -0
- package/lib/icons/info-circle.svg.js +28 -0
- package/lib/icons/info.svg.js +34 -0
- package/lib/icons/input-clear.svg.js +27 -0
- package/lib/icons/invisible.svg.js +29 -0
- package/lib/icons/left-arrow.svg.js +30 -0
- package/lib/icons/loading-outline.svg.js +28 -0
- package/lib/icons/location.svg.js +27 -0
- package/lib/icons/menu.svg.js +27 -0
- package/lib/icons/minus.svg.js +28 -0
- package/lib/icons/move.svg.js +29 -0
- package/lib/icons/mute.svg.js +28 -0
- package/lib/icons/new-edit.svg.js +29 -0
- package/lib/icons/pause.svg.js +28 -0
- package/lib/icons/pencil.svg.js +28 -0
- package/lib/icons/play.svg.js +27 -0
- package/lib/icons/plus-cicle.svg.js +27 -0
- package/lib/icons/plus-fine.svg.js +28 -0
- package/lib/icons/plus.svg.js +28 -0
- package/lib/icons/post.svg.js +55 -0
- package/lib/icons/question-mark.svg.js +33 -0
- package/lib/icons/question.svg.js +28 -0
- package/lib/icons/question2.svg.js +41 -0
- package/lib/icons/redo.svg.js +28 -0
- package/lib/icons/refresh.svg.js +28 -0
- package/lib/icons/reload.svg.js +28 -0
- package/lib/icons/remove.svg.js +28 -0
- package/lib/icons/retry.svg.js +31 -0
- package/lib/icons/right-arrow-bold.svg.js +28 -0
- package/lib/icons/right-arrow.svg.js +30 -0
- package/lib/icons/right-double-arrow.svg.js +29 -0
- package/lib/icons/role.svg.js +50 -0
- package/lib/icons/rotate-left.svg.js +29 -0
- package/lib/icons/rotate-right.svg.js +29 -0
- package/lib/icons/rotate-screen.svg.js +28 -0
- package/lib/icons/scale-origin.svg.js +31 -0
- package/lib/icons/schedule.svg.js +31 -0
- package/lib/icons/search.svg.js +28 -0
- package/lib/icons/setting.svg.js +28 -0
- package/lib/icons/slider-handle-icon.svg.js +29 -0
- package/lib/icons/sort-asc.svg.js +28 -0
- package/lib/icons/sort-default.svg.js +28 -0
- package/lib/icons/sort-desc.svg.js +28 -0
- package/lib/icons/star.svg.js +28 -0
- package/lib/icons/status-close.svg.js +30 -0
- package/lib/icons/steps-finsh.svg.js +29 -0
- package/lib/icons/sub-plus.svg.js +27 -0
- package/lib/icons/success.svg.js +36 -0
- package/lib/icons/transparent.svg.js +45 -0
- package/lib/icons/trash.svg.js +29 -0
- package/lib/icons/tree-down.svg.js +28 -0
- package/lib/icons/undo-normal.svg.js +32 -0
- package/lib/icons/undo.svg.js +28 -0
- package/lib/icons/unfullscreen.svg.js +28 -0
- package/lib/icons/upload.svg.js +28 -0
- package/lib/icons/user-remove.svg.js +40 -0
- package/lib/icons/view.svg.js +29 -0
- package/lib/icons/volume.svg.js +31 -0
- package/lib/icons/warning-mark.svg.js +29 -0
- package/lib/icons/warning.svg.js +28 -0
- package/lib/icons/window-restore.svg.js +28 -0
- package/lib/icons/zoom-in.svg.js +28 -0
- package/lib/icons/zoom-out.svg.js +28 -0
- package/lib/index.d.ts +15 -0
- package/lib/index.js +348 -0
- package/lib/locale/de-DE.d.ts +1 -0
- package/lib/locale/de-DE.js +423 -0
- package/lib/locale/en-US.d.ts +1 -0
- package/lib/locale/en-US.js +429 -0
- package/lib/locale/zh-CN.d.ts +1 -0
- package/lib/locale/zh-CN.js +438 -0
- package/lib/scss/helper.scss.js +12 -0
- package/lib/scss/themes/ang.scss.js +12 -0
- package/lib/scss/themes/antd.scss.js +12 -0
- package/lib/scss/themes/cxd.scss.js +12 -0
- package/lib/scss/themes/dark.scss.js +12 -0
- package/lib/scss/themes/default.scss.js +12 -0
- package/lib/themes/ang.css +46414 -0
- package/lib/themes/ang.d.ts +3 -0
- package/lib/themes/ang.js +20 -0
- package/lib/themes/antd.css +46401 -0
- package/lib/themes/antd.d.ts +1 -0
- package/lib/themes/antd.js +44 -0
- package/lib/themes/cxd.css +46390 -0
- package/lib/themes/cxd.d.ts +3 -0
- package/lib/themes/cxd.js +459 -0
- package/lib/themes/dark.css +46421 -0
- package/lib/themes/dark.d.ts +3 -0
- package/lib/themes/dark.js +28 -0
- package/lib/themes/default.css +46390 -0
- package/lib/themes/default.d.ts +4 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/smoothSignature.d.ts +86 -0
- package/lib/utils/vectorComputed.d.ts +20 -0
- package/lib/utils/vectorComputed.js +84 -0
- package/lib/withRemoteConfig.d.ts +2 -0
- package/lib/withRemoteConfig.js +14 -0
- package/lib/withStore.d.ts +2 -0
- package/lib/withStore.js +14 -0
- package/package.json +8 -4
- package/scss/_components.scss +4 -7
- package/scss/_mixins.scss +1 -0
- package/scss/_properties.scss +1 -1
- package/scss/components/_auto-folder.scss +40 -0
- package/scss/components/_cascader.scss +22 -2
- package/scss/components/_condition-builder.scss +1 -0
- package/scss/components/_crud.scss +32 -0
- package/scss/components/_modal.scss +13 -0
- package/scss/components/_page.scss +0 -1
- package/scss/components/_pagination.scss +1 -2
- package/scss/components/_result-box.scss +15 -3
- package/scss/components/_table.scss +2 -0
- package/scss/components/form/_combo.scss +13 -0
- package/scss/components/form/_form.scss +14 -1
- package/scss/components/form/_icon-picker.scss +1 -0
- package/scss/components/form/_input-group.scss +23 -2
- package/scss/components/form/_nested-select.scss +10 -0
- package/scss/components/form/_picker.scss +33 -0
- package/scss/components/form/_select.scss +30 -4
- package/scss/components/form/_selection.scss +2 -0
- package/scss/components/form/_tree.scss +8 -9
- package/scss/layout/_layout.scss +1 -0
- package/scss/themes/_common.scss +1 -0
|
@@ -0,0 +1,1214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-ui v6.13.0
|
|
3
|
+
* Copyright 2018-2025 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
'use strict';
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
|
+
|
|
10
|
+
var tslib = require('tslib');
|
|
11
|
+
var React = require('react');
|
|
12
|
+
var amisCore = require('amis-core');
|
|
13
|
+
var Select = require('./Select.js');
|
|
14
|
+
var icons = require('./icons.js');
|
|
15
|
+
var Checkbox = require('./Checkbox.js');
|
|
16
|
+
var Spinner = require('./Spinner.js');
|
|
17
|
+
var index = require('./virtual-list/index.js');
|
|
18
|
+
var TooltipWrapper = require('./TooltipWrapper.js');
|
|
19
|
+
|
|
20
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
21
|
+
|
|
22
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
|
+
|
|
24
|
+
var __react_jsx__ = require('react');
|
|
25
|
+
var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
|
|
26
|
+
(__react_jsx__["default"] || __react_jsx__).Fragment;
|
|
27
|
+
var TreeSelector = /** @class */ (function (_super) {
|
|
28
|
+
tslib.__extends(TreeSelector, _super);
|
|
29
|
+
function TreeSelector(props) {
|
|
30
|
+
var _this = _super.call(this, props) || this;
|
|
31
|
+
// 展开的节点
|
|
32
|
+
_this.unfolded = new WeakMap();
|
|
33
|
+
// key: child option, value: parent option;
|
|
34
|
+
_this.relations = new WeakMap();
|
|
35
|
+
_this.levels = new WeakMap();
|
|
36
|
+
_this.startPoint = {
|
|
37
|
+
x: 0,
|
|
38
|
+
y: 0
|
|
39
|
+
};
|
|
40
|
+
_this.root = React__default["default"].createRef();
|
|
41
|
+
_this.virtualListRef = null;
|
|
42
|
+
var value = Select.value2array(props.value, {
|
|
43
|
+
multiple: props.multiple,
|
|
44
|
+
delimiter: props.delimiter,
|
|
45
|
+
valueField: props.valueField,
|
|
46
|
+
labelField: props.labelField,
|
|
47
|
+
options: props.options,
|
|
48
|
+
pathSeparator: props.pathSeparator
|
|
49
|
+
}, props.enableNodePath);
|
|
50
|
+
_this.state = {
|
|
51
|
+
value: value,
|
|
52
|
+
valueSet: new Set(value),
|
|
53
|
+
flattenedOptions: [],
|
|
54
|
+
inputValue: '',
|
|
55
|
+
addingParent: null,
|
|
56
|
+
isAdding: false,
|
|
57
|
+
isEditing: false,
|
|
58
|
+
editingItem: null,
|
|
59
|
+
dropIndicator: undefined,
|
|
60
|
+
virtualHeight: 0,
|
|
61
|
+
itemHeight: 0
|
|
62
|
+
};
|
|
63
|
+
_this.syncUnFolded(props, undefined, true);
|
|
64
|
+
_this.flattenOptions(props, true);
|
|
65
|
+
return _this;
|
|
66
|
+
}
|
|
67
|
+
TreeSelector.prototype.componentDidMount = function () {
|
|
68
|
+
var _a, _b, _c;
|
|
69
|
+
var enableNodePath = this.props.enableNodePath;
|
|
70
|
+
// onRef只有渲染器的情况才会使用
|
|
71
|
+
(_b = (_a = this.props).onRef) === null || _b === void 0 ? void 0 : _b.call(_a, this);
|
|
72
|
+
enableNodePath && this.expandLazyLoadNodes();
|
|
73
|
+
var treeElement = this.root.current;
|
|
74
|
+
treeElement =
|
|
75
|
+
((_c = treeElement === null || treeElement === void 0 ? void 0 : treeElement.parentElement) === null || _c === void 0 ? void 0 : _c.matches('.cxd-TreeControl')) &&
|
|
76
|
+
treeElement.parentElement.childElementCount === 1
|
|
77
|
+
? treeElement.parentElement
|
|
78
|
+
: treeElement;
|
|
79
|
+
this.unSensor = amisCore.resizeSensor(treeElement, this.handleVirtualHeight, false, 'height');
|
|
80
|
+
};
|
|
81
|
+
TreeSelector.prototype.componentDidUpdate = function (prevProps, prevState) {
|
|
82
|
+
var props = this.props;
|
|
83
|
+
this.state;
|
|
84
|
+
if (prevProps.options !== props.options) {
|
|
85
|
+
this.syncUnFolded(props);
|
|
86
|
+
this.flattenOptions(props);
|
|
87
|
+
}
|
|
88
|
+
if (prevProps.value !== props.value ||
|
|
89
|
+
prevProps.options !== props.options) {
|
|
90
|
+
var newValue = Select.value2array(props.value, {
|
|
91
|
+
multiple: props.multiple,
|
|
92
|
+
delimiter: props.delimiter,
|
|
93
|
+
valueField: props.valueField,
|
|
94
|
+
pathSeparator: props.pathSeparator,
|
|
95
|
+
options: props.options,
|
|
96
|
+
labelField: props.labelField
|
|
97
|
+
}, props.enableNodePath);
|
|
98
|
+
this.setState({
|
|
99
|
+
value: newValue,
|
|
100
|
+
valueSet: new Set(newValue)
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
TreeSelector.prototype.componentWillUnmount = function () {
|
|
105
|
+
// clear data
|
|
106
|
+
this.relations = this.unfolded = this.levels = new WeakMap();
|
|
107
|
+
if (this.unSensor) {
|
|
108
|
+
this.unSensor();
|
|
109
|
+
delete this.unSensor;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* 展开懒加载节点的父节点
|
|
114
|
+
*/
|
|
115
|
+
TreeSelector.prototype.expandLazyLoadNodes = function () {
|
|
116
|
+
var _a = this.props, pathSeparator = _a.pathSeparator, onExpandTree = _a.onExpandTree, _b = _a.nodePath, nodePath = _b === void 0 ? [] : _b;
|
|
117
|
+
var nodePathArr = nodePath.map(function (path) {
|
|
118
|
+
return path ? path.toString().split(pathSeparator) : [];
|
|
119
|
+
});
|
|
120
|
+
onExpandTree === null || onExpandTree === void 0 ? void 0 : onExpandTree(nodePathArr);
|
|
121
|
+
};
|
|
122
|
+
TreeSelector.prototype.virtualListRefSetter = function (ref) {
|
|
123
|
+
this.virtualListRef = ref;
|
|
124
|
+
ref && this.handleVirtualHeight();
|
|
125
|
+
};
|
|
126
|
+
TreeSelector.prototype.syncUnFolded = function (props, unfoldedLevel, initial) {
|
|
127
|
+
// 传入默认展开层级需要重新初始化unfolded
|
|
128
|
+
var initFoldedLevel = typeof unfoldedLevel !== 'undefined';
|
|
129
|
+
var expandLevel = Number(initFoldedLevel ? unfoldedLevel : props.unfoldedLevel);
|
|
130
|
+
// 初始化树节点的展开状态
|
|
131
|
+
var unfolded = this.unfolded;
|
|
132
|
+
var _a = this.props, deferField = _a.deferField, foldedField = _a.foldedField, unfoldedField = _a.unfoldedField;
|
|
133
|
+
amisCore.eachTree(props.options, function (node, index, level) {
|
|
134
|
+
if (unfolded.has(node) && !initFoldedLevel) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (node.children && node.children.length) {
|
|
138
|
+
var ret = true;
|
|
139
|
+
if (node[deferField] &&
|
|
140
|
+
node.loaded &&
|
|
141
|
+
!initFoldedLevel &&
|
|
142
|
+
unfoldedField &&
|
|
143
|
+
node[unfoldedField] !== false) {
|
|
144
|
+
ret = true;
|
|
145
|
+
}
|
|
146
|
+
else if (unfoldedField &&
|
|
147
|
+
typeof node[unfoldedField] !== 'undefined') {
|
|
148
|
+
ret = !!node[unfoldedField];
|
|
149
|
+
}
|
|
150
|
+
else if (foldedField && typeof node[foldedField] !== 'undefined') {
|
|
151
|
+
ret = !node[foldedField];
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
ret = !!props.initiallyOpen && !initFoldedLevel;
|
|
155
|
+
if (!ret && level <= expandLevel) {
|
|
156
|
+
ret = true;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
unfolded.set(node, ret);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
initFoldedLevel && this.forceUpdate();
|
|
163
|
+
this.flattenOptions(undefined, initial);
|
|
164
|
+
return unfolded;
|
|
165
|
+
};
|
|
166
|
+
TreeSelector.prototype.toggleUnfolded = function (node) {
|
|
167
|
+
var unfolded = this.unfolded;
|
|
168
|
+
var _a = this.props, deferField = _a.deferField, onDeferLoad = _a.onDeferLoad, unfoldedField = _a.unfoldedField;
|
|
169
|
+
if (node[deferField] && !node.loaded) {
|
|
170
|
+
onDeferLoad === null || onDeferLoad === void 0 ? void 0 : onDeferLoad(node);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
// ! hack: 在node上直接添加属性,options 在更新的时候旧的字段会保留
|
|
174
|
+
if (node[deferField] && node.loaded) {
|
|
175
|
+
node[unfoldedField] = !unfolded.get(node);
|
|
176
|
+
}
|
|
177
|
+
unfolded.set(node, !unfolded.get(node));
|
|
178
|
+
this.flattenOptions();
|
|
179
|
+
this.forceUpdate();
|
|
180
|
+
};
|
|
181
|
+
TreeSelector.prototype.isUnfolded = function (node) {
|
|
182
|
+
var unfolded = this.unfolded;
|
|
183
|
+
var parent = this.relations.get(node);
|
|
184
|
+
if (parent) {
|
|
185
|
+
return !!unfolded.get(node) && this.isUnfolded(parent);
|
|
186
|
+
}
|
|
187
|
+
return !!unfolded.get(node);
|
|
188
|
+
};
|
|
189
|
+
TreeSelector.prototype.clearSelect = function () {
|
|
190
|
+
var _this = this;
|
|
191
|
+
this.setState({
|
|
192
|
+
value: []
|
|
193
|
+
}, function () {
|
|
194
|
+
var _a = _this.props, joinValues = _a.joinValues, rootValue = _a.rootValue, onChange = _a.onChange;
|
|
195
|
+
onChange(joinValues ? rootValue : []);
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* enableNodePath为true时,将label和value转换成node path格式
|
|
200
|
+
*/
|
|
201
|
+
TreeSelector.prototype.transform2NodePath = function (value) {
|
|
202
|
+
var _a = this.props, multiple = _a.multiple, options = _a.options, valueField = _a.valueField, labelField = _a.labelField, joinValues = _a.joinValues, extractValue = _a.extractValue, pathSeparator = _a.pathSeparator, delimiter = _a.delimiter;
|
|
203
|
+
var nodesValuePath = [];
|
|
204
|
+
var selectedNodes = Array.isArray(value) ? value.concat() : [value];
|
|
205
|
+
var selectedNodesPath = selectedNodes.map(function (node) {
|
|
206
|
+
var _a, _b;
|
|
207
|
+
var _c;
|
|
208
|
+
var nodePath = (_c = amisCore.getTreeAncestors(options, node, true)) === null || _c === void 0 ? void 0 : _c.reduce(function (acc, node) {
|
|
209
|
+
acc[labelField].push(node[labelField]);
|
|
210
|
+
acc[valueField].push(node[valueField]);
|
|
211
|
+
return acc;
|
|
212
|
+
}, (_a = {}, _a[labelField] = [], _a[valueField] = [], _a));
|
|
213
|
+
var nodeValuePath = nodePath[valueField].join(pathSeparator);
|
|
214
|
+
nodesValuePath.push(nodeValuePath);
|
|
215
|
+
return tslib.__assign(tslib.__assign({}, node), (_b = {}, _b[labelField] = nodePath[labelField].join(pathSeparator), _b[valueField] = nodeValuePath, _b));
|
|
216
|
+
});
|
|
217
|
+
if (multiple) {
|
|
218
|
+
return joinValues
|
|
219
|
+
? nodesValuePath.join(delimiter)
|
|
220
|
+
: extractValue
|
|
221
|
+
? nodesValuePath
|
|
222
|
+
: selectedNodesPath;
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
return joinValues || extractValue
|
|
226
|
+
? selectedNodesPath[0][valueField]
|
|
227
|
+
: selectedNodesPath[0];
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
TreeSelector.prototype.handleSelect = function (node, value) {
|
|
231
|
+
var _this = this;
|
|
232
|
+
var _a = this.props, joinValues = _a.joinValues, valueField = _a.valueField, deferField = _a.deferField, onChange = _a.onChange, enableNodePath = _a.enableNodePath, onlyLeaf = _a.onlyLeaf;
|
|
233
|
+
if (node[valueField] === undefined) {
|
|
234
|
+
if (node[deferField] && !node.loaded) {
|
|
235
|
+
this.toggleUnfolded(node);
|
|
236
|
+
}
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
if (onlyLeaf && Array.isArray(node.children) && node.children.length) {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
this.setState({
|
|
243
|
+
value: [node]
|
|
244
|
+
}, function () {
|
|
245
|
+
onChange(enableNodePath
|
|
246
|
+
? _this.transform2NodePath(node)
|
|
247
|
+
: joinValues
|
|
248
|
+
? node[valueField]
|
|
249
|
+
: node);
|
|
250
|
+
});
|
|
251
|
+
};
|
|
252
|
+
TreeSelector.prototype.handleItemClick = function (node, checked) {
|
|
253
|
+
var _a;
|
|
254
|
+
var _b = this.props, onHandleNodeClick = _b.onHandleNodeClick, multiple = _b.multiple, _c = _b.nodeBehavior, nodeBehavior = _c === void 0 ? ['check'] : _c;
|
|
255
|
+
onHandleNodeClick && onHandleNodeClick(node);
|
|
256
|
+
if ((nodeBehavior === null || nodeBehavior === void 0 ? void 0 : nodeBehavior.includes('unfold')) && ((_a = node.children) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
257
|
+
this.toggleUnfolded(node);
|
|
258
|
+
}
|
|
259
|
+
if (nodeBehavior === null || nodeBehavior === void 0 ? void 0 : nodeBehavior.includes('check')) {
|
|
260
|
+
multiple ? this.handleCheck(node, !checked) : this.handleSelect(node);
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
TreeSelector.prototype.handleCheck = function (item, checked) {
|
|
264
|
+
var _this = this;
|
|
265
|
+
// TODO: 重新梳理这里的逻辑
|
|
266
|
+
var props = this.props;
|
|
267
|
+
var value = this.state.valueSet;
|
|
268
|
+
var onlyChildren = props.onlyChildren, withChildren = props.withChildren, cascade = props.cascade, autoCheckChildren = props.autoCheckChildren, autoCancelParent = props.autoCancelParent, valueField = props.valueField;
|
|
269
|
+
if (checked) {
|
|
270
|
+
if (!value.has(item)) {
|
|
271
|
+
value.add(item);
|
|
272
|
+
}
|
|
273
|
+
// cascade 为 true 表示父节点跟子节点没有级联关系。
|
|
274
|
+
if (autoCheckChildren) {
|
|
275
|
+
var children = item.children ? tslib.__spreadArray([], tslib.__read(item.children), false) : [];
|
|
276
|
+
var hasDisabled = amisCore.flattenTree(children).some(function (item) { return item === null || item === void 0 ? void 0 : item.disabled; });
|
|
277
|
+
if (onlyChildren) {
|
|
278
|
+
// 这个 isAllChecked 主要是判断如果有disabled的item项,这时父节点还是选中的话,针对性的处理逻辑
|
|
279
|
+
var isAllChecked = amisCore.flattenTreeWithLeafNodes(children)
|
|
280
|
+
.filter(function (item) { return !(item === null || item === void 0 ? void 0 : item.disabled); })
|
|
281
|
+
.every(function (v) { return value.has(v); });
|
|
282
|
+
// 父级选中的时候,子节点也都选中,但是自己不选中
|
|
283
|
+
if (value.has(item) && children.length) {
|
|
284
|
+
value.delete(item);
|
|
285
|
+
}
|
|
286
|
+
while (children.length) {
|
|
287
|
+
var child = children.shift();
|
|
288
|
+
if (child.children && child.children.length) {
|
|
289
|
+
children.push.apply(children, child.children);
|
|
290
|
+
continue;
|
|
291
|
+
}
|
|
292
|
+
if (hasDisabled && isAllChecked) {
|
|
293
|
+
if (value.has(child) &&
|
|
294
|
+
child.value !== 'undefined' &&
|
|
295
|
+
!(child === null || child === void 0 ? void 0 : child.disabled)) {
|
|
296
|
+
value.delete(child);
|
|
297
|
+
}
|
|
298
|
+
continue;
|
|
299
|
+
}
|
|
300
|
+
if (!value.has(child) &&
|
|
301
|
+
child.value !== 'undefined' &&
|
|
302
|
+
!(child === null || child === void 0 ? void 0 : child.disabled)) {
|
|
303
|
+
value.add(child);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
// 这个 isAllChecked 主要是判断如果有disabled的item项,这时父节点还是选中的话,针对性的处理逻辑
|
|
309
|
+
var isAllChecked = amisCore.flattenTree(children)
|
|
310
|
+
.filter(function (item) { return !(item === null || item === void 0 ? void 0 : item.disabled); })
|
|
311
|
+
.every(function (v) { return value.has(v); });
|
|
312
|
+
// 只要父节点选择了,子节点就不需要了,全部去掉勾选. withChildren时相反
|
|
313
|
+
while (children.length) {
|
|
314
|
+
var child = children.shift();
|
|
315
|
+
if (child === null || child === void 0 ? void 0 : child.disabled) {
|
|
316
|
+
continue;
|
|
317
|
+
}
|
|
318
|
+
// 判断下下面是否有禁用项
|
|
319
|
+
if (!hasDisabled) {
|
|
320
|
+
if (value.has(child)) {
|
|
321
|
+
value.delete(child);
|
|
322
|
+
}
|
|
323
|
+
if (withChildren || cascade) {
|
|
324
|
+
value.add(child);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
isAllChecked ? value.delete(child) : value.add(child);
|
|
329
|
+
}
|
|
330
|
+
if (child.children && child.children.length) {
|
|
331
|
+
children.push.apply(children, child.children);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
var toCheck = item;
|
|
335
|
+
while (true) {
|
|
336
|
+
var parent_1 = amisCore.getTreeParent(props.options, toCheck);
|
|
337
|
+
// 判断 parent 节点是否已经勾选,避免重复值
|
|
338
|
+
if ((parent_1 === null || parent_1 === void 0 ? void 0 : parent_1[valueField || 'value']) && !value.has(parent_1)) {
|
|
339
|
+
// 如果所有孩子节点都勾选了,应该自动勾选父级。
|
|
340
|
+
if (parent_1.children.every(function (child) { return value.has(child); })) {
|
|
341
|
+
if (!cascade && !withChildren) {
|
|
342
|
+
parent_1.children.forEach(function (child) {
|
|
343
|
+
if (value.has(child)) {
|
|
344
|
+
value.delete(child);
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
value.add(parent_1);
|
|
349
|
+
toCheck = parent_1;
|
|
350
|
+
continue;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
break;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
value.has(item) && value.delete(item);
|
|
360
|
+
if (autoCheckChildren) {
|
|
361
|
+
if (cascade || withChildren || onlyChildren) {
|
|
362
|
+
var children = item.children ? tslib.__spreadArray([], tslib.__read(item.children), false) : [];
|
|
363
|
+
while (children.length) {
|
|
364
|
+
var child = children.shift();
|
|
365
|
+
if (value.has(child) && !(child === null || child === void 0 ? void 0 : child.disabled)) {
|
|
366
|
+
value.delete(child);
|
|
367
|
+
}
|
|
368
|
+
if (child.children && child.children.length) {
|
|
369
|
+
children.push.apply(children, child.children);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
if (autoCancelParent && cascade) {
|
|
375
|
+
var toCheck = item;
|
|
376
|
+
while (true) {
|
|
377
|
+
var parent_2 = amisCore.getTreeParent(props.options, toCheck);
|
|
378
|
+
//判断 parent 节点是否已经勾选
|
|
379
|
+
if (value.has(parent_2)) {
|
|
380
|
+
//当有一个子节点取消时要去掉父节点,也要去掉父节点的父节点,直至最外层
|
|
381
|
+
value.delete(parent_2);
|
|
382
|
+
toCheck = parent_2;
|
|
383
|
+
continue;
|
|
384
|
+
}
|
|
385
|
+
break;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
this.setState({
|
|
390
|
+
value: tslib.__spreadArray([], tslib.__read(value), false)
|
|
391
|
+
}, function () { return _this.fireChange(tslib.__spreadArray([], tslib.__read(value), false)); });
|
|
392
|
+
};
|
|
393
|
+
TreeSelector.prototype.fireChange = function (value) {
|
|
394
|
+
var _a = this.props, joinValues = _a.joinValues, extractValue = _a.extractValue, valueField = _a.valueField, delimiter = _a.delimiter, onChange = _a.onChange, enableNodePath = _a.enableNodePath;
|
|
395
|
+
onChange(enableNodePath
|
|
396
|
+
? this.transform2NodePath(value)
|
|
397
|
+
: joinValues
|
|
398
|
+
? value.map(function (item) { return item[valueField]; }).join(delimiter)
|
|
399
|
+
: extractValue
|
|
400
|
+
? value.map(function (item) { return item[valueField]; })
|
|
401
|
+
: value);
|
|
402
|
+
};
|
|
403
|
+
TreeSelector.prototype.handleAdd = function (parent) {
|
|
404
|
+
var _this = this;
|
|
405
|
+
if (parent === void 0) { parent = null; }
|
|
406
|
+
var _a = this.props, bultinCUD = _a.bultinCUD, onAdd = _a.onAdd, options = _a.options;
|
|
407
|
+
if (!bultinCUD) {
|
|
408
|
+
var idxes = amisCore.findTreeIndex(options, function (item) { return item === parent; }) || [];
|
|
409
|
+
return onAdd && onAdd(idxes.concat(0));
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
this.setState({
|
|
413
|
+
isEditing: false,
|
|
414
|
+
isAdding: true,
|
|
415
|
+
addingParent: parent
|
|
416
|
+
}, function () {
|
|
417
|
+
var e_1, _a;
|
|
418
|
+
if (!parent) {
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
var result = [];
|
|
422
|
+
try {
|
|
423
|
+
for (var _b = tslib.__values(_this.state.flattenedOptions), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
424
|
+
var option = _c.value;
|
|
425
|
+
result.push(option);
|
|
426
|
+
if (option === parent) {
|
|
427
|
+
var insert = { isAdding: true };
|
|
428
|
+
_this.levels.set(insert, (_this.levels.get(option) || 0) + 1);
|
|
429
|
+
result.push(insert);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
434
|
+
finally {
|
|
435
|
+
try {
|
|
436
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
437
|
+
}
|
|
438
|
+
finally { if (e_1) throw e_1.error; }
|
|
439
|
+
}
|
|
440
|
+
_this.setState({ flattenedOptions: result });
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
};
|
|
444
|
+
TreeSelector.prototype.handleEdit = function (item) {
|
|
445
|
+
var _a = this.props, bultinCUD = _a.bultinCUD, onEdit = _a.onEdit, labelField = _a.labelField; _a.options;
|
|
446
|
+
if (!bultinCUD) {
|
|
447
|
+
onEdit === null || onEdit === void 0 ? void 0 : onEdit(item);
|
|
448
|
+
}
|
|
449
|
+
else {
|
|
450
|
+
this.setState({
|
|
451
|
+
isEditing: true,
|
|
452
|
+
isAdding: false,
|
|
453
|
+
editingItem: item,
|
|
454
|
+
inputValue: item[labelField]
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
TreeSelector.prototype.handleRemove = function (item) {
|
|
459
|
+
var onDelete = this.props.onDelete;
|
|
460
|
+
onDelete && onDelete(item);
|
|
461
|
+
};
|
|
462
|
+
TreeSelector.prototype.handleInputChange = function (e) {
|
|
463
|
+
this.setState({
|
|
464
|
+
inputValue: e.currentTarget.value
|
|
465
|
+
});
|
|
466
|
+
};
|
|
467
|
+
TreeSelector.prototype.handleConfirm = function () {
|
|
468
|
+
var _a = this.state, value = _a.inputValue, isAdding = _a.isAdding, addingParent = _a.addingParent, editingItem = _a.editingItem, isEditing = _a.isEditing;
|
|
469
|
+
if (!value) {
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
var _b = this.props, labelField = _b.labelField, onAdd = _b.onAdd, options = _b.options, onEdit = _b.onEdit;
|
|
473
|
+
this.setState({
|
|
474
|
+
inputValue: '',
|
|
475
|
+
isAdding: false,
|
|
476
|
+
isEditing: false
|
|
477
|
+
}, function () {
|
|
478
|
+
var _a, _b;
|
|
479
|
+
if (isAdding && onAdd) {
|
|
480
|
+
var idxes = (addingParent &&
|
|
481
|
+
amisCore.findTreeIndex(options, function (item) { return item === addingParent; })) ||
|
|
482
|
+
[];
|
|
483
|
+
onAdd(idxes.concat(0), (_a = {}, _a[labelField] = value, _a), true);
|
|
484
|
+
}
|
|
485
|
+
else if (isEditing && onEdit) {
|
|
486
|
+
onEdit(tslib.__assign(tslib.__assign({}, editingItem), (_b = {}, _b[labelField] = value, _b)), editingItem, true);
|
|
487
|
+
}
|
|
488
|
+
});
|
|
489
|
+
};
|
|
490
|
+
TreeSelector.prototype.handleCancel = function () {
|
|
491
|
+
var flattenedOptions = this.state.flattenedOptions;
|
|
492
|
+
var flattenedOptionsWithoutAdding = flattenedOptions.filter(function (item) { return !item.isAdding; });
|
|
493
|
+
this.setState({
|
|
494
|
+
inputValue: '',
|
|
495
|
+
isAdding: false,
|
|
496
|
+
isEditing: false,
|
|
497
|
+
flattenedOptions: flattenedOptionsWithoutAdding
|
|
498
|
+
});
|
|
499
|
+
};
|
|
500
|
+
TreeSelector.prototype.renderInput = function (prfix, testIdBuilder) {
|
|
501
|
+
if (prfix === void 0) { prfix = null; }
|
|
502
|
+
var _a = this.props, cx = _a.classnames, mobileUI = _a.mobileUI, __ = _a.translate;
|
|
503
|
+
var inputValue = this.state.inputValue;
|
|
504
|
+
return (_J$X_("div", { className: cx('Tree-itemLabel', {
|
|
505
|
+
'is-mobile': mobileUI
|
|
506
|
+
}) },
|
|
507
|
+
_J$X_("div", { className: cx('Tree-itemInput', {
|
|
508
|
+
'is-mobile': mobileUI
|
|
509
|
+
}) },
|
|
510
|
+
prfix,
|
|
511
|
+
_J$X_("input", tslib.__assign({ onChange: this.handleInputChange, value: inputValue, placeholder: __('placeholder.enter') }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('input').getTestId())),
|
|
512
|
+
_J$X_("a", tslib.__assign({ "data-tooltip": __('cancel'), onClick: this.handleCancel }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('cancel').getTestId()),
|
|
513
|
+
_J$X_(icons.Icon, { icon: "close", className: "icon" })),
|
|
514
|
+
_J$X_("a", tslib.__assign({ "data-tooltip": __('confirm'), onClick: this.handleConfirm }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('confirm').getTestId()),
|
|
515
|
+
_J$X_(icons.Icon, { icon: "check", className: "icon" })))));
|
|
516
|
+
};
|
|
517
|
+
TreeSelector.prototype.getOffsetPosition = function (element) {
|
|
518
|
+
var left = 0;
|
|
519
|
+
var top = 0;
|
|
520
|
+
while (element.offsetParent) {
|
|
521
|
+
left += element.offsetLeft;
|
|
522
|
+
top += element.offsetTop;
|
|
523
|
+
element = element.offsetParent;
|
|
524
|
+
}
|
|
525
|
+
return { left: left, top: top };
|
|
526
|
+
};
|
|
527
|
+
TreeSelector.prototype.getDropInfo = function (e, node) {
|
|
528
|
+
var _a;
|
|
529
|
+
var rect = e.currentTarget.getBoundingClientRect();
|
|
530
|
+
var dragNode = this.dragNode;
|
|
531
|
+
var deltaX = Math.min(50, rect.width * 0.3);
|
|
532
|
+
var gap = ((_a = node === null || node === void 0 ? void 0 : node.children) === null || _a === void 0 ? void 0 : _a.length) ? 0 : 16;
|
|
533
|
+
// 计算相对位置
|
|
534
|
+
var offset = this.getOffsetPosition(this.root.current);
|
|
535
|
+
var targetOffset = this.getOffsetPosition(e.currentTarget);
|
|
536
|
+
var left = targetOffset.left - offset.left;
|
|
537
|
+
var top = targetOffset.top - offset.top;
|
|
538
|
+
var clientX = e.clientX, clientY = e.clientY;
|
|
539
|
+
var position = clientY >= rect.top + rect.height / 2 ? 'bottom' : 'top';
|
|
540
|
+
var indicator;
|
|
541
|
+
if (position === 'bottom' && clientX >= this.startPoint.x + deltaX) {
|
|
542
|
+
position = 'self';
|
|
543
|
+
indicator = {
|
|
544
|
+
top: top,
|
|
545
|
+
left: left,
|
|
546
|
+
width: rect.width,
|
|
547
|
+
height: rect.height
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
else {
|
|
551
|
+
indicator = {
|
|
552
|
+
top: position === 'bottom' ? top + rect.height : top,
|
|
553
|
+
left: left + gap,
|
|
554
|
+
width: rect.width - gap
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
return {
|
|
558
|
+
node: node,
|
|
559
|
+
dragNode: dragNode,
|
|
560
|
+
position: position,
|
|
561
|
+
indicator: indicator
|
|
562
|
+
};
|
|
563
|
+
};
|
|
564
|
+
TreeSelector.prototype.updateDropIndicator = function (e, node) {
|
|
565
|
+
// const gap = node?.children?.length ? 0 : 16;
|
|
566
|
+
this.dropInfo = this.getDropInfo(e, node);
|
|
567
|
+
var _a = this.dropInfo, dragNode = _a.dragNode, indicator = _a.indicator;
|
|
568
|
+
if (node === dragNode) {
|
|
569
|
+
this.setState({ dropIndicator: undefined });
|
|
570
|
+
return;
|
|
571
|
+
}
|
|
572
|
+
this.setState({
|
|
573
|
+
dropIndicator: indicator
|
|
574
|
+
});
|
|
575
|
+
};
|
|
576
|
+
TreeSelector.prototype.onDragStart = function (node) {
|
|
577
|
+
var _this = this;
|
|
578
|
+
var draggable = this.props.draggable;
|
|
579
|
+
return function (e) {
|
|
580
|
+
var _a;
|
|
581
|
+
if (draggable) {
|
|
582
|
+
e.dataTransfer.effectAllowed = 'copyMove';
|
|
583
|
+
_this.dragNode = node;
|
|
584
|
+
_this.dropInfo = null;
|
|
585
|
+
_this.startPoint = {
|
|
586
|
+
x: e.clientX,
|
|
587
|
+
y: e.clientY
|
|
588
|
+
};
|
|
589
|
+
if ((_a = node === null || node === void 0 ? void 0 : node.children) === null || _a === void 0 ? void 0 : _a.length) {
|
|
590
|
+
_this.unfolded.set(node, false);
|
|
591
|
+
_this.flattenOptions();
|
|
592
|
+
_this.forceUpdate();
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
else {
|
|
596
|
+
_this.dragNode = null;
|
|
597
|
+
_this.dropInfo = null;
|
|
598
|
+
}
|
|
599
|
+
e.stopPropagation();
|
|
600
|
+
};
|
|
601
|
+
};
|
|
602
|
+
TreeSelector.prototype.onDragOver = function (node) {
|
|
603
|
+
var _this = this;
|
|
604
|
+
return function (e) {
|
|
605
|
+
if (!_this.dragNode) {
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
_this.updateDropIndicator(e, node);
|
|
609
|
+
e.preventDefault();
|
|
610
|
+
};
|
|
611
|
+
};
|
|
612
|
+
TreeSelector.prototype.onDragEnd = function (dragNode) {
|
|
613
|
+
var _this = this;
|
|
614
|
+
return function (e) {
|
|
615
|
+
var _a, _b, _c;
|
|
616
|
+
_this.setState({
|
|
617
|
+
dropIndicator: undefined
|
|
618
|
+
});
|
|
619
|
+
var node = (_a = _this.dropInfo) === null || _a === void 0 ? void 0 : _a.node;
|
|
620
|
+
if (!_this.dropInfo || !node || dragNode === node) {
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
(_c = (_b = _this.props).onMove) === null || _c === void 0 ? void 0 : _c.call(_b, _this.dropInfo);
|
|
624
|
+
_this.dragNode = null;
|
|
625
|
+
_this.dropInfo = null;
|
|
626
|
+
e.preventDefault();
|
|
627
|
+
};
|
|
628
|
+
};
|
|
629
|
+
/**
|
|
630
|
+
* 将树形接口转换为平铺结构,以支持虚拟列表
|
|
631
|
+
* TODO: this.unfolded => reaction 更加合理
|
|
632
|
+
*/
|
|
633
|
+
TreeSelector.prototype.flattenOptions = function (props, initial) {
|
|
634
|
+
var _this = this;
|
|
635
|
+
var flattenedOptions = [];
|
|
636
|
+
amisCore.eachTree((props === null || props === void 0 ? void 0 : props.options) || this.props.options, function (item, index, level, paths) {
|
|
637
|
+
var parent = paths[paths.length - 1];
|
|
638
|
+
if (!amisCore.isVisible(item)) {
|
|
639
|
+
return;
|
|
640
|
+
}
|
|
641
|
+
_this.levels.set(item, level);
|
|
642
|
+
parent && _this.relations.set(item, parent);
|
|
643
|
+
if (paths.length === 0) {
|
|
644
|
+
// 父节点
|
|
645
|
+
flattenedOptions.push(item);
|
|
646
|
+
}
|
|
647
|
+
else if (_this.isUnfolded(parent)) {
|
|
648
|
+
// 父节点是展开的状态
|
|
649
|
+
flattenedOptions.push(item);
|
|
650
|
+
}
|
|
651
|
+
});
|
|
652
|
+
if (initial) {
|
|
653
|
+
// 初始化
|
|
654
|
+
this.state = tslib.__assign(tslib.__assign({}, this.state), { flattenedOptions: flattenedOptions });
|
|
655
|
+
}
|
|
656
|
+
else {
|
|
657
|
+
this.setState({
|
|
658
|
+
flattenedOptions: flattenedOptions
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
};
|
|
662
|
+
/**
|
|
663
|
+
* 判断父元素是否勾选
|
|
664
|
+
* TODO: 递归可能需要优化
|
|
665
|
+
*/
|
|
666
|
+
TreeSelector.prototype.isParentChecked = function (item) {
|
|
667
|
+
if (!item || !this.relations.get(item)) {
|
|
668
|
+
return false;
|
|
669
|
+
}
|
|
670
|
+
var valueSet = this.state.valueSet;
|
|
671
|
+
var currentItem = item;
|
|
672
|
+
while (currentItem) {
|
|
673
|
+
var itemParent = this.relations.get(currentItem);
|
|
674
|
+
if (!itemParent) {
|
|
675
|
+
return false;
|
|
676
|
+
}
|
|
677
|
+
if (valueSet.has(itemParent)) {
|
|
678
|
+
return true;
|
|
679
|
+
}
|
|
680
|
+
currentItem = itemParent;
|
|
681
|
+
}
|
|
682
|
+
return false;
|
|
683
|
+
};
|
|
684
|
+
/**
|
|
685
|
+
* 判断 子元素 是否全部选中
|
|
686
|
+
*/
|
|
687
|
+
TreeSelector.prototype.isItemChildrenChecked = function (item) {
|
|
688
|
+
var _this = this;
|
|
689
|
+
if (!item || !item.children) {
|
|
690
|
+
return true;
|
|
691
|
+
}
|
|
692
|
+
return !item.children.some(function (child) { return !_this.isItemChecked(child); });
|
|
693
|
+
};
|
|
694
|
+
/**
|
|
695
|
+
* 判断子元素 部分勾选
|
|
696
|
+
*/
|
|
697
|
+
TreeSelector.prototype.isItemChildrenPartialChecked = function (item, checked) {
|
|
698
|
+
var e_2, _a;
|
|
699
|
+
if (!item || !item.children || checked) {
|
|
700
|
+
return false;
|
|
701
|
+
}
|
|
702
|
+
var checkedLength = 0;
|
|
703
|
+
var partialChildrenLength = 0;
|
|
704
|
+
try {
|
|
705
|
+
for (var _b = tslib.__values(item.children), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
706
|
+
var child = _c.value;
|
|
707
|
+
if (this.isItemChecked(child)) {
|
|
708
|
+
checkedLength++;
|
|
709
|
+
}
|
|
710
|
+
else if (this.isItemChildrenPartialChecked(child, false)) {
|
|
711
|
+
partialChildrenLength++;
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
716
|
+
finally {
|
|
717
|
+
try {
|
|
718
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
719
|
+
}
|
|
720
|
+
finally { if (e_2) throw e_2.error; }
|
|
721
|
+
}
|
|
722
|
+
return checkedLength !== 0 || partialChildrenLength !== 0;
|
|
723
|
+
};
|
|
724
|
+
/**
|
|
725
|
+
* 判断元素是否选中:checked
|
|
726
|
+
*/
|
|
727
|
+
TreeSelector.prototype.isItemChecked = function (item) {
|
|
728
|
+
var _a;
|
|
729
|
+
if (!item) {
|
|
730
|
+
return false;
|
|
731
|
+
}
|
|
732
|
+
var _b = this.props, autoCheckChildren = _b.autoCheckChildren, onlyChildren = _b.onlyChildren, multiple = _b.multiple, withChildren = _b.withChildren, cascade = _b.cascade;
|
|
733
|
+
var valueSet = this.state.valueSet;
|
|
734
|
+
var checked = valueSet.has(item);
|
|
735
|
+
if (checked) {
|
|
736
|
+
return true;
|
|
737
|
+
}
|
|
738
|
+
if ((_a = item.children) === null || _a === void 0 ? void 0 : _a.length) {
|
|
739
|
+
if (onlyChildren && autoCheckChildren) {
|
|
740
|
+
if (this.isItemChildrenChecked(item)) {
|
|
741
|
+
// 当前元素没有在 value 中,但是子组件全部勾选了
|
|
742
|
+
return true;
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
var itemParent = this.relations.get(item);
|
|
747
|
+
if (itemParent && multiple && autoCheckChildren) {
|
|
748
|
+
// 当前节点为子节点
|
|
749
|
+
if (withChildren || cascade) {
|
|
750
|
+
return false;
|
|
751
|
+
}
|
|
752
|
+
return this.isParentChecked(item);
|
|
753
|
+
}
|
|
754
|
+
// 判断父组件是否勾选
|
|
755
|
+
return false;
|
|
756
|
+
};
|
|
757
|
+
/**
|
|
758
|
+
* item 是否 disabled 状态
|
|
759
|
+
* props.disabled === true return;
|
|
760
|
+
*
|
|
761
|
+
*/
|
|
762
|
+
TreeSelector.prototype.isItemDisabled = function (item, checked) {
|
|
763
|
+
var _a = this.props, disabledField = _a.disabledField, disabled = _a.disabled, autoCheckChildren = _a.autoCheckChildren, valueField = _a.valueField, multiple = _a.multiple, maxLength = _a.maxLength, minLength = _a.minLength, cascade = _a.cascade, onlyChildren = _a.onlyChildren;
|
|
764
|
+
var value = this.state.value;
|
|
765
|
+
var selfDisabled = item[disabledField];
|
|
766
|
+
var nodeDisabled = !!disabled ||
|
|
767
|
+
selfDisabled ||
|
|
768
|
+
(multiple && !autoCheckChildren && !item[valueField]);
|
|
769
|
+
if (nodeDisabled) {
|
|
770
|
+
return true;
|
|
771
|
+
}
|
|
772
|
+
if ((maxLength && !checked && value.length >= maxLength) ||
|
|
773
|
+
(minLength && checked && value.length <= minLength)) {
|
|
774
|
+
return true;
|
|
775
|
+
}
|
|
776
|
+
var itemParent = this.relations.get(item);
|
|
777
|
+
if (autoCheckChildren && multiple && checked && itemParent) {
|
|
778
|
+
if (!this.isItemChecked(itemParent)) {
|
|
779
|
+
return false;
|
|
780
|
+
}
|
|
781
|
+
// 子节点
|
|
782
|
+
if (onlyChildren) {
|
|
783
|
+
return false;
|
|
784
|
+
}
|
|
785
|
+
return !cascade;
|
|
786
|
+
}
|
|
787
|
+
return false;
|
|
788
|
+
};
|
|
789
|
+
TreeSelector.prototype.renderItem = function (_a) {
|
|
790
|
+
var _this = this;
|
|
791
|
+
var index = _a.index, style = _a.style, rest = tslib.__rest(_a, ["index", "style"]);
|
|
792
|
+
var _b = this.props, itemClassName = _b.itemClassName, showIcon = _b.showIcon, showRadio = _b.showRadio, multiple = _b.multiple, labelField = _b.labelField, iconField = _b.iconField, deferField = _b.deferField, cascade = _b.cascade, cx = _b.classnames, highlightTxt = _b.highlightTxt, creatable = _b.creatable, editable = _b.editable, removable = _b.removable, createTip = _b.createTip, editTip = _b.editTip, removeTip = _b.removeTip, __ = _b.translate, itemRender = _b.itemRender, draggable = _b.draggable, loadingConfig = _b.loadingConfig, enableDefaultIcon = _b.enableDefaultIcon, valueField = _b.valueField, mobileUI = _b.mobileUI, testIdBuilder = _b.testIdBuilder, itemActionsRender = _b.itemActionsRender, actionClassName = _b.actionClassName;
|
|
793
|
+
var item = this.state.flattenedOptions[index];
|
|
794
|
+
if (!item) {
|
|
795
|
+
return null;
|
|
796
|
+
}
|
|
797
|
+
var _c = this.state, isAdding = _c.isAdding, editingItem = _c.editingItem, isEditing = _c.isEditing;
|
|
798
|
+
var checked = this.isItemChecked(item);
|
|
799
|
+
var disabled = this.isItemDisabled(item, checked);
|
|
800
|
+
var partial = this.isItemChildrenPartialChecked(item, checked);
|
|
801
|
+
var checkedInValue = !!~this.state.value.indexOf(item);
|
|
802
|
+
var itemTestBuilder = testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild("item-".concat(item[valueField] || item[labelField] || index));
|
|
803
|
+
var checkbox = multiple ? (_J$X_(Checkbox["default"], { size: "sm", disabled: disabled, checked: checked || partial, partial: partial, onChange: this.handleCheck.bind(this, item, !checked), testIdBuilder: itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getChild('chekbx') })) : showRadio ? (_J$X_(Checkbox["default"], { size: "sm", disabled: disabled, checked: checked, onChange: this.handleSelect.bind(this, item), testIdBuilder: itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getChild('chekbx') })) : null;
|
|
804
|
+
var isLeaf = (!item.children || !item.children.length) && !item.placeholder;
|
|
805
|
+
var iconValue = item[iconField] ||
|
|
806
|
+
(enableDefaultIcon !== false
|
|
807
|
+
? (Array.isArray(item.children) && item.children.length) ||
|
|
808
|
+
item[deferField]
|
|
809
|
+
? 'folder'
|
|
810
|
+
: 'file'
|
|
811
|
+
: false);
|
|
812
|
+
var level = this.levels.has(item) ? this.levels.get(item) - 1 : 0;
|
|
813
|
+
var body = null;
|
|
814
|
+
if (isEditing && editingItem === item) {
|
|
815
|
+
body = this.renderInput(checkbox, itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getChild('edit'));
|
|
816
|
+
}
|
|
817
|
+
else if (item.isAdding) {
|
|
818
|
+
body = this.renderInput(_J$X_("span", { className: cx('Tree-itemArrowPlaceholder') }), itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getChild('add'));
|
|
819
|
+
}
|
|
820
|
+
else {
|
|
821
|
+
var isFolded = !this.isUnfolded(item);
|
|
822
|
+
body = (_J$X_("div", { className: cx('Tree-itemLabel', {
|
|
823
|
+
'is-children-checked': multiple &&
|
|
824
|
+
!cascade &&
|
|
825
|
+
this.isItemChildrenChecked(item) &&
|
|
826
|
+
!disabled,
|
|
827
|
+
'is-checked': checkedInValue,
|
|
828
|
+
'is-disabled': disabled
|
|
829
|
+
}), draggable: draggable, onDragStart: this.onDragStart(item), onDragOver: this.onDragOver(item), onDragEnd: this.onDragEnd(item) },
|
|
830
|
+
draggable && (_J$X_("a", tslib.__assign({ className: cx('Tree-itemDrager drag-bar') }, itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getChild('drag-bar').getTestId()),
|
|
831
|
+
_J$X_(icons.Icon, { icon: "drag-bar", className: "icon" }))),
|
|
832
|
+
item.loading ? (_J$X_(Spinner["default"], { size: "sm", show: true, icon: "reload", spinnerClassName: cx('Tree-spinner'), loadingConfig: loadingConfig })) : !isLeaf || (item[deferField] && !item.loaded) ? (_J$X_("div", tslib.__assign({ onClick: function () { return _this.toggleUnfolded(item); }, className: cx('Tree-itemArrow', {
|
|
833
|
+
'is-folded': isFolded
|
|
834
|
+
}) }, itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getChild(isFolded ? 'open' : 'fold').getTestId()),
|
|
835
|
+
_J$X_(icons.Icon, { icon: "down-arrow-bold", className: "icon" }))) : (_J$X_("span", { className: cx('Tree-itemArrowPlaceholder') })),
|
|
836
|
+
checkbox,
|
|
837
|
+
_J$X_("div", tslib.__assign({ className: cx('Tree-itemLabel-item', { 'is-mobile': mobileUI }) }, itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getChild('content').getTestId(), { onClick: function () { return !disabled && _this.handleItemClick(item, checked); } }),
|
|
838
|
+
showIcon ? (_J$X_("i", { className: cx("Tree-itemIcon ".concat((Array.isArray(item.children) && item.children.length) ||
|
|
839
|
+
item[deferField]
|
|
840
|
+
? 'Tree-folderIcon'
|
|
841
|
+
: 'Tree-leafIcon')) }, iconValue ? _J$X_(icons.Icon, { icon: iconValue, className: "icon" }) : null)) : null,
|
|
842
|
+
_J$X_("span", tslib.__assign({ className: cx('Tree-itemText'), title: item[labelField] }, itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getChild('text').getTestId()), itemRender
|
|
843
|
+
? itemRender(item, {
|
|
844
|
+
index: index,
|
|
845
|
+
multiple: multiple,
|
|
846
|
+
checked: checked,
|
|
847
|
+
labelField: labelField,
|
|
848
|
+
onChange: function () { return _this.handleCheck(item, !checked); },
|
|
849
|
+
disabled: disabled || item.disabled,
|
|
850
|
+
classnames: cx
|
|
851
|
+
})
|
|
852
|
+
: highlightTxt
|
|
853
|
+
? amisCore.highlight("".concat(item[labelField]), highlightTxt)
|
|
854
|
+
: "".concat(item[labelField])),
|
|
855
|
+
!disabled && !isAdding && !isEditing ? (_J$X_("div", { className: cx('Tree-item-icons', actionClassName), onClick: function (e) { return e.stopPropagation(); } },
|
|
856
|
+
creatable &&
|
|
857
|
+
!(item[deferField] && !item.loaded) &&
|
|
858
|
+
amisCore.hasAbility(item, 'creatable') ? (_J$X_(TooltipWrapper["default"], { placement: 'bottom', tooltip: __(createTip), trigger: 'hover', tooltipTheme: "dark" },
|
|
859
|
+
_J$X_("a", tslib.__assign({ onClick: this.handleAdd.bind(this, item) }, itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getChild('add').getTestId()),
|
|
860
|
+
_J$X_(icons.Icon, { icon: "plus", className: "icon" })))) : null,
|
|
861
|
+
removable && amisCore.hasAbility(item, 'removable') ? (_J$X_(TooltipWrapper["default"], { placement: 'bottom', tooltip: __(removeTip), trigger: 'hover', tooltipTheme: "dark" },
|
|
862
|
+
_J$X_("a", tslib.__assign({ onClick: this.handleRemove.bind(this, item) }, itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getChild('remove').getTestId()),
|
|
863
|
+
_J$X_(icons.Icon, { icon: "minus", className: "icon" })))) : null,
|
|
864
|
+
editable && amisCore.hasAbility(item, 'editable') ? (_J$X_(TooltipWrapper["default"], { placement: 'bottom', tooltip: __(editTip), trigger: 'hover', tooltipTheme: "dark" },
|
|
865
|
+
_J$X_("a", tslib.__assign({ onClick: this.handleEdit.bind(this, item) }, itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getChild('edit').getTestId()),
|
|
866
|
+
_J$X_(icons.Icon, { icon: "new-edit", className: "icon" })))) : null,
|
|
867
|
+
itemActionsRender && (_J$X_("div", { className: cx('Tree-itemActions') }, itemActionsRender(item, tslib.__assign(tslib.__assign({}, item), { index: index, multiple: multiple, checked: checked, labelField: labelField, onChange: function () { return _this.handleCheck(item, !checked); }, disabled: disabled || item.disabled, classnames: cx })))))) : null)));
|
|
868
|
+
}
|
|
869
|
+
return (_J$X_("li", tslib.__assign({}, rest, { key: "".concat(item[valueField || 'value'], "-").concat(index), className: cx("Tree-item ".concat(itemClassName || ''), {
|
|
870
|
+
'Tree-item--isLeaf': isLeaf,
|
|
871
|
+
'is-child': this.relations.get(item)
|
|
872
|
+
}), style: tslib.__assign(tslib.__assign({}, style), { '--Tree-depth': level }) }, itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getTestId()), body));
|
|
873
|
+
};
|
|
874
|
+
TreeSelector.prototype.isEmptyOrNotExist = function (obj) {
|
|
875
|
+
return obj === '' || obj === undefined || obj === null;
|
|
876
|
+
};
|
|
877
|
+
TreeSelector.prototype.getAvailableOptions = function () {
|
|
878
|
+
var _this = this;
|
|
879
|
+
var _a = this.props, options = _a.options, onlyChildren = _a.onlyChildren, valueField = _a.valueField;
|
|
880
|
+
var flattendOptions = amisCore.flattenTree(options, function (item) {
|
|
881
|
+
var _a;
|
|
882
|
+
return onlyChildren
|
|
883
|
+
? ((_a = item.children) === null || _a === void 0 ? void 0 : _a.length)
|
|
884
|
+
? null
|
|
885
|
+
: item
|
|
886
|
+
: _this.isEmptyOrNotExist(item[valueField || 'value'])
|
|
887
|
+
? null
|
|
888
|
+
: item;
|
|
889
|
+
}).filter(function (a) { return a && !a.disabled; });
|
|
890
|
+
return flattendOptions;
|
|
891
|
+
};
|
|
892
|
+
TreeSelector.prototype.handleCheckAll = function (availableOptions, checkedAll) {
|
|
893
|
+
var _this = this;
|
|
894
|
+
this.setState({
|
|
895
|
+
value: checkedAll ? [] : availableOptions
|
|
896
|
+
}, function () { return _this.fireChange(checkedAll ? [] : availableOptions); });
|
|
897
|
+
};
|
|
898
|
+
TreeSelector.prototype.handleToggle = function (bool) {
|
|
899
|
+
var _this = this;
|
|
900
|
+
var availableOptions = this.getAvailableOptions();
|
|
901
|
+
if (bool === undefined) {
|
|
902
|
+
var checkedAll = availableOptions.every(function (option) {
|
|
903
|
+
return _this.isItemChecked(option);
|
|
904
|
+
});
|
|
905
|
+
this.handleCheckAll(availableOptions, checkedAll);
|
|
906
|
+
return;
|
|
907
|
+
}
|
|
908
|
+
this.handleCheckAll(availableOptions, bool);
|
|
909
|
+
};
|
|
910
|
+
TreeSelector.prototype.renderCheckAll = function () {
|
|
911
|
+
var _this = this;
|
|
912
|
+
var _a = this.props, multiple = _a.multiple, checkAll = _a.checkAll, checkAllLabel = _a.checkAllLabel, cx = _a.classnames, __ = _a.translate, disabled = _a.disabled, mobileUI = _a.mobileUI;
|
|
913
|
+
if (!multiple || !checkAll) {
|
|
914
|
+
return null;
|
|
915
|
+
}
|
|
916
|
+
var availableOptions = this.getAvailableOptions();
|
|
917
|
+
var checkedAll = availableOptions.every(function (option) {
|
|
918
|
+
return _this.isItemChecked(option);
|
|
919
|
+
});
|
|
920
|
+
var checkedPartial = availableOptions.some(function (option) {
|
|
921
|
+
return _this.isItemChecked(option);
|
|
922
|
+
});
|
|
923
|
+
return (_J$X_("div", { className: cx('Tree-itemLabel'), onClick: function () { return _this.handleCheckAll(availableOptions, checkedAll); } },
|
|
924
|
+
_J$X_(Checkbox["default"], { size: "sm", disabled: disabled, checked: checkedPartial, partial: checkedPartial && !checkedAll }),
|
|
925
|
+
_J$X_("div", { className: cx('Tree-itemLabel-item', {
|
|
926
|
+
'is-mobile': mobileUI
|
|
927
|
+
}) },
|
|
928
|
+
_J$X_("span", { className: cx('Tree-itemText') }, __(checkAllLabel)))));
|
|
929
|
+
};
|
|
930
|
+
TreeSelector.prototype.styleGetter = function (node) {
|
|
931
|
+
node && this.setState({ itemHeight: (node === null || node === void 0 ? void 0 : node.offsetHeight) || 0 });
|
|
932
|
+
};
|
|
933
|
+
TreeSelector.prototype.renderList = function (list) {
|
|
934
|
+
var _this = this;
|
|
935
|
+
var virtualThreshold = this.props.virtualThreshold;
|
|
936
|
+
var _a = this.state, virtualHeight = _a.virtualHeight, itemHeight = _a.itemHeight;
|
|
937
|
+
if (virtualThreshold && list.length > virtualThreshold) {
|
|
938
|
+
return itemHeight ? (_J$X_("div", { ref: this.virtualListRefSetter },
|
|
939
|
+
_J$X_(index["default"], { height: virtualHeight, itemCount: list.length, prefix: this.renderCheckAll(), itemSize: itemHeight, renderItem: this.renderItem }))) : (this.renderItem({ index: 0, ref: this.styleGetter }));
|
|
940
|
+
}
|
|
941
|
+
return (_J$X_(React__default["default"].Fragment, null,
|
|
942
|
+
this.renderCheckAll(),
|
|
943
|
+
list.map(function (item, index) { return _this.renderItem({ index: index }); })));
|
|
944
|
+
};
|
|
945
|
+
TreeSelector.prototype.handleVirtualHeight = function () {
|
|
946
|
+
var _a;
|
|
947
|
+
var virtualThreshold = this.props.virtualThreshold;
|
|
948
|
+
var _b = this.state, flattenedOptions = _b.flattenedOptions, itemHeight = _b.itemHeight;
|
|
949
|
+
if (virtualThreshold && flattenedOptions.length > virtualThreshold) {
|
|
950
|
+
// tree 对应元素
|
|
951
|
+
var treeElement = this.root.current;
|
|
952
|
+
if (!this.virtualListRef ||
|
|
953
|
+
(!treeElement.offsetHeight && !treeElement.offsetWidth)) {
|
|
954
|
+
return;
|
|
955
|
+
}
|
|
956
|
+
treeElement =
|
|
957
|
+
((_a = treeElement === null || treeElement === void 0 ? void 0 : treeElement.parentElement) === null || _a === void 0 ? void 0 : _a.matches('.cxd-TreeControl')) &&
|
|
958
|
+
treeElement.parentElement.childElementCount === 1
|
|
959
|
+
? treeElement.parentElement
|
|
960
|
+
: treeElement;
|
|
961
|
+
var styles = getComputedStyle(treeElement);
|
|
962
|
+
var offsetHeight = 0;
|
|
963
|
+
if (styles.flexGrow !== '0') {
|
|
964
|
+
// 当配置了成了动态高度时,根据实际高度来
|
|
965
|
+
offsetHeight = treeElement.offsetHeight;
|
|
966
|
+
}
|
|
967
|
+
else {
|
|
968
|
+
offsetHeight =
|
|
969
|
+
itemHeight * Math.min(flattenedOptions.length, virtualThreshold);
|
|
970
|
+
}
|
|
971
|
+
var virtualElement = this.virtualListRef;
|
|
972
|
+
// 通常时外围设置了 maxHeight
|
|
973
|
+
if (virtualElement.offsetHeight &&
|
|
974
|
+
virtualElement.offsetHeight > treeElement.offsetHeight) {
|
|
975
|
+
offsetHeight = treeElement.offsetHeight;
|
|
976
|
+
}
|
|
977
|
+
// 虚拟列表 对应元素
|
|
978
|
+
// todo 去支持外部滚动也支持虚拟滚动的场景,目前不支持,所以只能让高度最大,其实就没启动虚拟滚动
|
|
979
|
+
// 目前只有没有配置 heightAuto 的时候
|
|
980
|
+
// 或者配置了 flexGrow 的时候,才会有虚拟滚动的效果
|
|
981
|
+
var virtualHeight = offsetHeight - amisCore.calculateHeight(treeElement, virtualElement);
|
|
982
|
+
this.setState({ virtualHeight: virtualHeight });
|
|
983
|
+
}
|
|
984
|
+
};
|
|
985
|
+
TreeSelector.prototype.render = function () {
|
|
986
|
+
var _a = this.props, className = _a.className, placeholder = _a.placeholder, hideRoot = _a.hideRoot, rootLabel = _a.rootLabel, showOutline = _a.showOutline, showIcon = _a.showIcon, cx = _a.classnames, creatable = _a.creatable, rootCreatable = _a.rootCreatable, rootCreateTip = _a.rootCreateTip, disabled = _a.disabled, draggable = _a.draggable, __ = _a.translate, testIdBuilder = _a.testIdBuilder, actionClassName = _a.actionClassName, height = _a.height;
|
|
987
|
+
var _b = this.state, value = _b.value, isAdding = _b.isAdding, addingParent = _b.addingParent, isEditing = _b.isEditing, dropIndicator = _b.dropIndicator, flattenedOptions = _b.flattenedOptions;
|
|
988
|
+
var addBtn = null;
|
|
989
|
+
if (creatable && rootCreatable !== false && hideRoot) {
|
|
990
|
+
addBtn = (_J$X_("a", tslib.__assign({ className: cx('Tree-addTopBtn', {
|
|
991
|
+
'is-disabled': isAdding || isEditing
|
|
992
|
+
}), onClick: this.handleAdd.bind(this, null) }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('add').getTestId()),
|
|
993
|
+
_J$X_(icons.Icon, { icon: "plus", className: "icon" }),
|
|
994
|
+
_J$X_("span", null, __(rootCreateTip))));
|
|
995
|
+
}
|
|
996
|
+
var style = {};
|
|
997
|
+
if (height && height > 0) {
|
|
998
|
+
style = {
|
|
999
|
+
height: "".concat(height, "px"),
|
|
1000
|
+
maxHeight: 'none'
|
|
1001
|
+
};
|
|
1002
|
+
}
|
|
1003
|
+
return (_J$X_("div", tslib.__assign({ className: cx("Tree ".concat(className || ''), {
|
|
1004
|
+
'Tree--outline': showOutline,
|
|
1005
|
+
'is-disabled': disabled,
|
|
1006
|
+
'is-draggable': draggable
|
|
1007
|
+
}), style: style, ref: this.root }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getTestId()),
|
|
1008
|
+
(flattenedOptions && flattenedOptions.length) ||
|
|
1009
|
+
addBtn ||
|
|
1010
|
+
hideRoot === false ? (_J$X_("ul", { className: cx('Tree-list') }, hideRoot ? (_J$X_(React__default["default"].Fragment, null,
|
|
1011
|
+
addBtn,
|
|
1012
|
+
isAdding && !addingParent ? (_J$X_("li", { className: cx('Tree-item') }, this.renderInput())) : null,
|
|
1013
|
+
this.renderList(flattenedOptions))) : (_J$X_("li", { className: cx('Tree-rootItem', {
|
|
1014
|
+
'is-checked': !value || !value.length
|
|
1015
|
+
}) },
|
|
1016
|
+
_J$X_("div", { className: cx('Tree-itemLabel') },
|
|
1017
|
+
_J$X_("span", tslib.__assign({ className: cx('Tree-itemText'), onClick: this.clearSelect }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild("root-item").getTestId()),
|
|
1018
|
+
showIcon ? (_J$X_("i", { className: cx('Tree-itemIcon Tree-rootIcon') },
|
|
1019
|
+
_J$X_(icons.Icon, { icon: "home", className: "icon" }))) : null,
|
|
1020
|
+
rootLabel),
|
|
1021
|
+
!disabled &&
|
|
1022
|
+
creatable &&
|
|
1023
|
+
rootCreatable !== false &&
|
|
1024
|
+
!isAdding &&
|
|
1025
|
+
!isEditing ? (_J$X_("div", { className: cx('Tree-item-icons', actionClassName) }, creatable ? (_J$X_("a", tslib.__assign({ onClick: this.handleAdd.bind(this, null), "data-tooltip": rootCreateTip, "data-position": "left" }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild("root-add").getTestId()),
|
|
1026
|
+
_J$X_(icons.Icon, { icon: "plus", className: "icon" }))) : null)) : null),
|
|
1027
|
+
_J$X_("ul", { className: cx('Tree-sublist') },
|
|
1028
|
+
isAdding && !addingParent ? (_J$X_("li", { className: cx('Tree-item') }, this.renderInput())) : null,
|
|
1029
|
+
this.renderList(flattenedOptions)))))) : (_J$X_("div", { className: cx('Tree-placeholder') }, placeholder)),
|
|
1030
|
+
dropIndicator && (_J$X_("div", { className: cx('Tree-dropIndicator', {
|
|
1031
|
+
'Tree-dropIndicator--hover': !!dropIndicator.height
|
|
1032
|
+
}), style: dropIndicator }))));
|
|
1033
|
+
};
|
|
1034
|
+
TreeSelector.defaultProps = {
|
|
1035
|
+
showIcon: true,
|
|
1036
|
+
showOutline: false,
|
|
1037
|
+
initiallyOpen: true,
|
|
1038
|
+
unfoldedLevel: 1,
|
|
1039
|
+
showRadio: false,
|
|
1040
|
+
multiple: false,
|
|
1041
|
+
disabled: false,
|
|
1042
|
+
withChildren: false,
|
|
1043
|
+
onlyChildren: false,
|
|
1044
|
+
labelField: 'label',
|
|
1045
|
+
valueField: 'value',
|
|
1046
|
+
iconField: 'icon',
|
|
1047
|
+
deferField: 'defer',
|
|
1048
|
+
unfoldedField: 'unfolded',
|
|
1049
|
+
foldedField: 'foled',
|
|
1050
|
+
disabledField: 'disabled',
|
|
1051
|
+
joinValues: true,
|
|
1052
|
+
extractValue: false,
|
|
1053
|
+
delimiter: ',',
|
|
1054
|
+
hideRoot: true,
|
|
1055
|
+
rootLabel: 'Tree.root',
|
|
1056
|
+
rootValue: 0,
|
|
1057
|
+
autoCheckChildren: true,
|
|
1058
|
+
autoCancelParent: false,
|
|
1059
|
+
cascade: false,
|
|
1060
|
+
selfDisabledAffectChildren: true,
|
|
1061
|
+
rootCreateTip: 'Tree.addRoot',
|
|
1062
|
+
createTip: 'Tree.addChild',
|
|
1063
|
+
editTip: 'Tree.editNode',
|
|
1064
|
+
removeTip: 'Tree.removeNode',
|
|
1065
|
+
enableNodePath: false,
|
|
1066
|
+
pathSeparator: '/',
|
|
1067
|
+
nodePath: [],
|
|
1068
|
+
virtualThreshold: 100,
|
|
1069
|
+
enableDefaultIcon: true
|
|
1070
|
+
};
|
|
1071
|
+
tslib.__decorate([
|
|
1072
|
+
amisCore.autobind,
|
|
1073
|
+
tslib.__metadata("design:type", Function),
|
|
1074
|
+
tslib.__metadata("design:paramtypes", [Object]),
|
|
1075
|
+
tslib.__metadata("design:returntype", void 0)
|
|
1076
|
+
], TreeSelector.prototype, "virtualListRefSetter", null);
|
|
1077
|
+
tslib.__decorate([
|
|
1078
|
+
amisCore.autobind,
|
|
1079
|
+
tslib.__metadata("design:type", Function),
|
|
1080
|
+
tslib.__metadata("design:paramtypes", [Object]),
|
|
1081
|
+
tslib.__metadata("design:returntype", void 0)
|
|
1082
|
+
], TreeSelector.prototype, "toggleUnfolded", null);
|
|
1083
|
+
tslib.__decorate([
|
|
1084
|
+
amisCore.autobind,
|
|
1085
|
+
tslib.__metadata("design:type", Function),
|
|
1086
|
+
tslib.__metadata("design:paramtypes", []),
|
|
1087
|
+
tslib.__metadata("design:returntype", void 0)
|
|
1088
|
+
], TreeSelector.prototype, "clearSelect", null);
|
|
1089
|
+
tslib.__decorate([
|
|
1090
|
+
amisCore.autobind,
|
|
1091
|
+
tslib.__metadata("design:type", Function),
|
|
1092
|
+
tslib.__metadata("design:paramtypes", [Object, Object]),
|
|
1093
|
+
tslib.__metadata("design:returntype", void 0)
|
|
1094
|
+
], TreeSelector.prototype, "handleSelect", null);
|
|
1095
|
+
tslib.__decorate([
|
|
1096
|
+
amisCore.autobind,
|
|
1097
|
+
tslib.__metadata("design:type", Function),
|
|
1098
|
+
tslib.__metadata("design:paramtypes", [Object, Boolean]),
|
|
1099
|
+
tslib.__metadata("design:returntype", void 0)
|
|
1100
|
+
], TreeSelector.prototype, "handleItemClick", null);
|
|
1101
|
+
tslib.__decorate([
|
|
1102
|
+
amisCore.autobind,
|
|
1103
|
+
tslib.__metadata("design:type", Function),
|
|
1104
|
+
tslib.__metadata("design:paramtypes", [Object, Boolean]),
|
|
1105
|
+
tslib.__metadata("design:returntype", void 0)
|
|
1106
|
+
], TreeSelector.prototype, "handleCheck", null);
|
|
1107
|
+
tslib.__decorate([
|
|
1108
|
+
amisCore.autobind,
|
|
1109
|
+
tslib.__metadata("design:type", Function),
|
|
1110
|
+
tslib.__metadata("design:paramtypes", [Object]),
|
|
1111
|
+
tslib.__metadata("design:returntype", void 0)
|
|
1112
|
+
], TreeSelector.prototype, "handleAdd", null);
|
|
1113
|
+
tslib.__decorate([
|
|
1114
|
+
amisCore.autobind,
|
|
1115
|
+
tslib.__metadata("design:type", Function),
|
|
1116
|
+
tslib.__metadata("design:paramtypes", [Object]),
|
|
1117
|
+
tslib.__metadata("design:returntype", void 0)
|
|
1118
|
+
], TreeSelector.prototype, "handleEdit", null);
|
|
1119
|
+
tslib.__decorate([
|
|
1120
|
+
amisCore.autobind,
|
|
1121
|
+
tslib.__metadata("design:type", Function),
|
|
1122
|
+
tslib.__metadata("design:paramtypes", [Object]),
|
|
1123
|
+
tslib.__metadata("design:returntype", void 0)
|
|
1124
|
+
], TreeSelector.prototype, "handleRemove", null);
|
|
1125
|
+
tslib.__decorate([
|
|
1126
|
+
amisCore.autobind,
|
|
1127
|
+
tslib.__metadata("design:type", Function),
|
|
1128
|
+
tslib.__metadata("design:paramtypes", [Object]),
|
|
1129
|
+
tslib.__metadata("design:returntype", void 0)
|
|
1130
|
+
], TreeSelector.prototype, "handleInputChange", null);
|
|
1131
|
+
tslib.__decorate([
|
|
1132
|
+
amisCore.autobind,
|
|
1133
|
+
tslib.__metadata("design:type", Function),
|
|
1134
|
+
tslib.__metadata("design:paramtypes", []),
|
|
1135
|
+
tslib.__metadata("design:returntype", void 0)
|
|
1136
|
+
], TreeSelector.prototype, "handleConfirm", null);
|
|
1137
|
+
tslib.__decorate([
|
|
1138
|
+
amisCore.autobind,
|
|
1139
|
+
tslib.__metadata("design:type", Function),
|
|
1140
|
+
tslib.__metadata("design:paramtypes", []),
|
|
1141
|
+
tslib.__metadata("design:returntype", void 0)
|
|
1142
|
+
], TreeSelector.prototype, "handleCancel", null);
|
|
1143
|
+
tslib.__decorate([
|
|
1144
|
+
amisCore.autobind,
|
|
1145
|
+
tslib.__metadata("design:type", Function),
|
|
1146
|
+
tslib.__metadata("design:paramtypes", [Object, Object]),
|
|
1147
|
+
tslib.__metadata("design:returntype", Object)
|
|
1148
|
+
], TreeSelector.prototype, "getDropInfo", null);
|
|
1149
|
+
tslib.__decorate([
|
|
1150
|
+
amisCore.autobind,
|
|
1151
|
+
tslib.__metadata("design:type", Function),
|
|
1152
|
+
tslib.__metadata("design:paramtypes", [Object, Object]),
|
|
1153
|
+
tslib.__metadata("design:returntype", void 0)
|
|
1154
|
+
], TreeSelector.prototype, "updateDropIndicator", null);
|
|
1155
|
+
tslib.__decorate([
|
|
1156
|
+
amisCore.autobind,
|
|
1157
|
+
tslib.__metadata("design:type", Function),
|
|
1158
|
+
tslib.__metadata("design:paramtypes", [Object]),
|
|
1159
|
+
tslib.__metadata("design:returntype", void 0)
|
|
1160
|
+
], TreeSelector.prototype, "onDragStart", null);
|
|
1161
|
+
tslib.__decorate([
|
|
1162
|
+
amisCore.autobind,
|
|
1163
|
+
tslib.__metadata("design:type", Function),
|
|
1164
|
+
tslib.__metadata("design:paramtypes", [Object]),
|
|
1165
|
+
tslib.__metadata("design:returntype", void 0)
|
|
1166
|
+
], TreeSelector.prototype, "onDragOver", null);
|
|
1167
|
+
tslib.__decorate([
|
|
1168
|
+
amisCore.autobind,
|
|
1169
|
+
tslib.__metadata("design:type", Function),
|
|
1170
|
+
tslib.__metadata("design:paramtypes", [Object]),
|
|
1171
|
+
tslib.__metadata("design:returntype", void 0)
|
|
1172
|
+
], TreeSelector.prototype, "onDragEnd", null);
|
|
1173
|
+
tslib.__decorate([
|
|
1174
|
+
amisCore.autobind,
|
|
1175
|
+
tslib.__metadata("design:type", Function),
|
|
1176
|
+
tslib.__metadata("design:paramtypes", [Object]),
|
|
1177
|
+
tslib.__metadata("design:returntype", void 0)
|
|
1178
|
+
], TreeSelector.prototype, "renderItem", null);
|
|
1179
|
+
tslib.__decorate([
|
|
1180
|
+
amisCore.autobind,
|
|
1181
|
+
tslib.__metadata("design:type", Function),
|
|
1182
|
+
tslib.__metadata("design:paramtypes", [Array, Boolean]),
|
|
1183
|
+
tslib.__metadata("design:returntype", void 0)
|
|
1184
|
+
], TreeSelector.prototype, "handleCheckAll", null);
|
|
1185
|
+
tslib.__decorate([
|
|
1186
|
+
amisCore.autobind,
|
|
1187
|
+
tslib.__metadata("design:type", Function),
|
|
1188
|
+
tslib.__metadata("design:paramtypes", [Boolean]),
|
|
1189
|
+
tslib.__metadata("design:returntype", void 0)
|
|
1190
|
+
], TreeSelector.prototype, "handleToggle", null);
|
|
1191
|
+
tslib.__decorate([
|
|
1192
|
+
amisCore.autobind,
|
|
1193
|
+
tslib.__metadata("design:type", Function),
|
|
1194
|
+
tslib.__metadata("design:paramtypes", [Object]),
|
|
1195
|
+
tslib.__metadata("design:returntype", void 0)
|
|
1196
|
+
], TreeSelector.prototype, "styleGetter", null);
|
|
1197
|
+
tslib.__decorate([
|
|
1198
|
+
amisCore.autobind,
|
|
1199
|
+
tslib.__metadata("design:type", Function),
|
|
1200
|
+
tslib.__metadata("design:paramtypes", [Object]),
|
|
1201
|
+
tslib.__metadata("design:returntype", void 0)
|
|
1202
|
+
], TreeSelector.prototype, "renderList", null);
|
|
1203
|
+
tslib.__decorate([
|
|
1204
|
+
amisCore.autobind,
|
|
1205
|
+
tslib.__metadata("design:type", Function),
|
|
1206
|
+
tslib.__metadata("design:paramtypes", []),
|
|
1207
|
+
tslib.__metadata("design:returntype", void 0)
|
|
1208
|
+
], TreeSelector.prototype, "handleVirtualHeight", null);
|
|
1209
|
+
return TreeSelector;
|
|
1210
|
+
}(React__default["default"].Component));
|
|
1211
|
+
var Tree = amisCore.themeable(amisCore.localeable(TreeSelector));
|
|
1212
|
+
|
|
1213
|
+
exports.TreeSelector = TreeSelector;
|
|
1214
|
+
exports["default"] = Tree;
|