amis-rev-ui 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/LICENSE +201 -0
- package/esm/HTMLFilterContext.d.ts +3 -0
- package/esm/HTMLFilterContext.js +10 -0
- package/esm/components/404.js +35 -0
- package/esm/components/Alert.js +266 -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.js +153 -0
- package/esm/components/AnchorNavSection.d.ts +2 -0
- package/esm/components/AnchorNavSection.js +7 -0
- package/esm/components/ArrayInput.js +146 -0
- package/esm/components/AsideNav.js +133 -0
- package/esm/components/AssociatedSelection.js +107 -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.js +126 -0
- package/esm/components/Badge.d.ts +20 -0
- package/esm/components/Badge.js +154 -0
- package/esm/components/BaiduMapPicker.js +366 -0
- package/esm/components/BarCode.js +42 -0
- package/esm/components/Breadcrumb.js +160 -0
- package/esm/components/Button.js +64 -0
- package/esm/components/CalendarMobile.js +538 -0
- package/esm/components/Card.js +88 -0
- package/esm/components/Cascader.js +515 -0
- package/esm/components/ChainedDropdownSelection.js +104 -0
- package/esm/components/ChainedSelection.js +184 -0
- package/esm/components/Checkbox.js +87 -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.js +184 -0
- package/esm/components/CollapseGroup.js +117 -0
- package/esm/components/ColorPicker.js +259 -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.js +128 -0
- package/esm/components/ContextMenu.js +310 -0
- package/esm/components/DatePicker.js +716 -0
- package/esm/components/DateRangePicker.js +1385 -0
- package/esm/components/DiffEditor.d.ts +21 -0
- package/esm/components/DiffEditor.js +119 -0
- package/esm/components/DndContainer.js +25 -0
- package/esm/components/Drawer.js +272 -0
- package/esm/components/DropDownSelection.js +77 -0
- package/esm/components/DropdownContextMenus.js +93 -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.js +78 -0
- package/esm/components/FormulaPicker.d.ts +2 -0
- package/esm/components/FormulaPicker.js +7 -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.js +138 -0
- package/esm/components/HeadCellDropDown.d.ts +2 -0
- package/esm/components/HeadCellDropDown.js +7 -0
- package/esm/components/HorizontalScroll.d.ts +74 -0
- package/esm/components/HorizontalScroll.js +271 -0
- package/esm/components/Html.js +55 -0
- package/esm/components/Icon.d.ts +2 -0
- package/esm/components/Icon.js +7 -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.js +99 -0
- package/esm/components/InputBoxWithSuggestion.js +70 -0
- package/esm/components/InputJSONSchema.d.ts +2 -0
- package/esm/components/InputJSONSchema.js +7 -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.js +60 -0
- package/esm/components/Link.js +44 -0
- package/esm/components/ListGroup.js +31 -0
- package/esm/components/ListMenu.js +62 -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.js +88 -0
- package/esm/components/MobileDevTool.d.ts +12 -0
- package/esm/components/MobileDevTool.js +312 -0
- package/esm/components/Modal.js +261 -0
- package/esm/components/ModalManager.d.ts +16 -0
- package/esm/components/ModalManager.js +42 -0
- package/esm/components/MultilineText.js +90 -0
- package/esm/components/NumberInput.js +274 -0
- package/esm/components/OverflowTpl.js +100 -0
- package/esm/components/Pagination.js +377 -0
- package/esm/components/PdfViewer.js +83 -0
- package/esm/components/Picker.js +73 -0
- package/esm/components/PickerColumn.js +276 -0
- package/esm/components/PickerContainer.js +157 -0
- package/esm/components/PopOverContainer.d.ts +59 -0
- package/esm/components/PopOverContainer.js +148 -0
- package/esm/components/PopUp.js +85 -0
- package/esm/components/Progress.js +136 -0
- package/esm/components/PullRefresh.js +172 -0
- package/esm/components/Radios.js +129 -0
- package/esm/components/Range.js +516 -0
- package/esm/components/Rating.js +341 -0
- package/esm/components/ResultBox.js +195 -0
- package/esm/components/ResultList.js +253 -0
- package/esm/components/ResultTableList.js +152 -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.js +298 -0
- package/esm/components/Select.js +814 -0
- package/esm/components/SelectMobile.d.ts +38 -0
- package/esm/components/SelectMobile.js +369 -0
- package/esm/components/Selection.js +166 -0
- package/esm/components/Shape.js +429 -0
- package/esm/components/Signature.js +294 -0
- package/esm/components/Slider.js +140 -0
- package/esm/components/SparkLine.js +62 -0
- package/esm/components/Spinner.js +202 -0
- package/esm/components/Steps.js +76 -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.js +169 -0
- package/esm/components/Tabs.js +607 -0
- package/esm/components/TabsTransfer.js +221 -0
- package/esm/components/TabsTransferPicker.js +81 -0
- package/esm/components/Tag.js +137 -0
- package/esm/components/Textarea.js +146 -0
- package/esm/components/Timeline.js +60 -0
- package/esm/components/TimelineItem.js +101 -0
- package/esm/components/Tinymce.d.ts +66 -0
- package/esm/components/Tinymce.js +634 -0
- package/esm/components/TitleBar.js +48 -0
- package/esm/components/Toast.js +247 -0
- package/esm/components/Tooltip.js +36 -0
- package/esm/components/TooltipWrapper.js +180 -0
- package/esm/components/Transfer.js +485 -0
- package/esm/components/TransferDropDown.js +98 -0
- package/esm/components/TransferPicker.js +98 -0
- package/esm/components/TransferSearch.js +100 -0
- package/esm/components/Tree.js +1256 -0
- package/esm/components/TreeSelection.js +201 -0
- package/esm/components/UserSelect.js +674 -0
- package/esm/components/UserTabSelect.js +227 -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 +70 -0
- package/esm/components/WithRemoteConfig.js +301 -0
- package/esm/components/WithStore.d.ts +13 -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.js +528 -0
- package/esm/components/calendar/MonthsView.js +175 -0
- package/esm/components/calendar/QuartersView.js +125 -0
- package/esm/components/calendar/TimeView.js +559 -0
- package/esm/components/calendar/YearsView.js +122 -0
- package/esm/components/condition-builder/Expression.js +121 -0
- package/esm/components/condition-builder/Field.js +32 -0
- package/esm/components/condition-builder/Func.js +75 -0
- package/esm/components/condition-builder/Group.js +196 -0
- package/esm/components/condition-builder/GroupOrItem.js +107 -0
- package/esm/components/condition-builder/InputSwitch.js +28 -0
- package/esm/components/condition-builder/Item.js +233 -0
- package/esm/components/condition-builder/Value.js +115 -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.js +242 -0
- package/esm/components/condition-builder/types.d.ts +116 -0
- package/esm/components/formula/CodeEditor.js +99 -0
- package/esm/components/formula/Editor.js +446 -0
- package/esm/components/formula/FuncList.js +64 -0
- package/esm/components/formula/Input.js +141 -0
- package/esm/components/formula/Picker.js +454 -0
- package/esm/components/formula/VariableList.js +185 -0
- package/esm/components/formula/plugin.d.ts +51 -0
- package/esm/components/formula/plugin.js +445 -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 +272 -0
- package/esm/components/json-schema/index.js +29 -0
- package/esm/components/menu/MenuContext.d.ts +82 -0
- package/esm/components/menu/MenuContext.js +25 -0
- package/esm/components/menu/MenuItem.js +112 -0
- package/esm/components/menu/PanelMenu.js +68 -0
- package/esm/components/menu/SubMenu.js +137 -0
- package/esm/components/menu/index.js +368 -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 +162 -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.js +74 -0
- package/esm/components/schema-editor/SchemaVariableListPicker.js +34 -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 +77 -0
- package/esm/components/table/Head.d.ts +45 -0
- package/esm/components/table/Head.js +150 -0
- package/esm/components/table/HeadCellDropDown.js +54 -0
- package/esm/components/table/HeadCellFilter.js +130 -0
- package/esm/components/table/HeadCellSelect.js +51 -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.js +1095 -0
- package/esm/components/table/util.d.ts +25 -0
- package/esm/components/table/util.js +279 -0
- package/esm/components/virtual-list/AutoSizer.d.ts +19 -0
- package/esm/components/virtual-list/AutoSizer.js +48 -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 +98 -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 +16 -0
- package/esm/index.js +157 -0
- package/esm/locale/de-DE.d.ts +1 -0
- package/esm/locale/de-DE.js +423 -0
- package/esm/locale/en-US.d.ts +1 -0
- package/esm/locale/en-US.js +429 -0
- package/esm/locale/zh-CN.d.ts +1 -0
- package/esm/locale/zh-CN.js +438 -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/HTMLFilterContext.d.ts +3 -0
- package/lib/components/AlphabetIndexer.d.ts +11 -0
- package/lib/components/AnchorNavSection.d.ts +2 -0
- package/lib/components/AutoSizer.d.ts +2 -0
- package/lib/components/Badge.d.ts +20 -0
- package/lib/components/BarCode.js +44 -0
- package/lib/components/CityDB.d.ts +13 -0
- package/lib/components/CityDB.js +3945 -0
- package/lib/components/CodeMirror.d.ts +29 -0
- package/lib/components/ColorPicker.js +267 -0
- package/lib/components/ConditionBuilder.d.ts +2 -0
- package/lib/components/DiffEditor.d.ts +21 -0
- package/lib/components/Form.d.ts +31 -0
- package/lib/components/FormulaPicker.d.ts +2 -0
- package/lib/components/GridNav.d.ts +53 -0
- package/lib/components/GridNavItem.d.ts +2 -0
- package/lib/components/HeadCellDropDown.d.ts +2 -0
- package/lib/components/HorizontalScroll.d.ts +74 -0
- package/lib/components/Icon.d.ts +2 -0
- package/lib/components/Input.d.ts +18 -0
- package/lib/components/InputJSONSchema.d.ts +2 -0
- package/lib/components/JSONSchemaEditor.d.ts +2 -0
- package/lib/components/Markdown.d.ts +25 -0
- package/lib/components/Markdown.js +76 -0
- package/lib/components/Menu.d.ts +2 -0
- package/lib/components/MobileDevTool.d.ts +12 -0
- package/lib/components/ModalManager.d.ts +16 -0
- package/lib/components/PdfViewer.js +83 -0
- package/lib/components/PopOverContainer.d.ts +59 -0
- package/lib/components/RichText.d.ts +48 -0
- package/lib/components/RichText.js +275 -0
- package/lib/components/SelectMobile.d.ts +38 -0
- package/lib/components/Tab.d.ts +2 -0
- package/lib/components/Table.d.ts +2 -0
- package/lib/components/Tinymce.d.ts +66 -0
- package/lib/components/Tinymce.js +641 -0
- package/lib/components/VirtualList.d.ts +2 -0
- package/lib/components/WithRemoteConfig.d.ts +70 -0
- package/lib/components/WithStore.d.ts +13 -0
- package/lib/components/calendar/Calendar.d.ts +83 -0
- package/lib/components/calendar/CalendarContainer.d.ts +10 -0
- package/lib/components/condition-builder/config.d.ts +36 -0
- package/lib/components/condition-builder/types.d.ts +116 -0
- package/lib/components/formula/plugin.d.ts +51 -0
- package/lib/components/icons.d.ts +61 -0
- package/lib/components/index.d.ts +138 -0
- package/lib/components/json-schema/Array.d.ts +3 -0
- package/lib/components/json-schema/Item.d.ts +5 -0
- package/lib/components/json-schema/Object.d.ts +5 -0
- package/lib/components/menu/MenuContext.d.ts +82 -0
- package/lib/components/schema-editor/Array.d.ts +11 -0
- package/lib/components/schema-editor/Common.d.ts +61 -0
- package/lib/components/schema-editor/Item.d.ts +8 -0
- package/lib/components/schema-editor/Object.d.ts +51 -0
- package/lib/components/table/Cell.d.ts +36 -0
- package/lib/components/table/ColGroup.d.ts +24 -0
- package/lib/components/table/Head.d.ts +45 -0
- package/lib/components/table/ItemActionsWrapper.d.ts +10 -0
- package/lib/components/table/Row.d.ts +56 -0
- package/lib/components/table/SummaryRow.d.ts +28 -0
- package/lib/components/table/util.d.ts +25 -0
- package/lib/components/virtual-list/AutoSizer.d.ts +19 -0
- package/lib/components/virtual-list/SizeAndPositionManager.d.ts +70 -0
- package/lib/components/virtual-list/constants.d.ts +34 -0
- package/lib/components/virtual-list/index.d.ts +98 -0
- package/lib/components/withBadge.d.ts +2 -0
- package/lib/helper.css +47762 -0
- package/lib/hooks/index.d.ts +8 -0
- package/lib/hooks/use-click-away.d.ts +12 -0
- package/lib/hooks/use-on-screen.d.ts +2 -0
- package/lib/hooks/use-set-state.d.ts +2 -0
- package/lib/hooks/use-sub-form.d.ts +4 -0
- package/lib/hooks/use-touch.d.ts +16 -0
- package/lib/hooks/use-update-effect.d.ts +3 -0
- package/lib/hooks/use-validation-resolver.d.ts +7 -0
- package/lib/index.d.ts +16 -0
- package/lib/index.js +28 -0
- package/lib/locale/de-DE.d.ts +1 -0
- package/lib/locale/en-US.d.ts +1 -0
- package/lib/locale/zh-CN.d.ts +1 -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 +45895 -0
- package/lib/themes/ang.d.ts +3 -0
- package/lib/themes/antd.css +45882 -0
- package/lib/themes/antd.d.ts +1 -0
- package/lib/themes/cxd.css +45871 -0
- package/lib/themes/cxd.d.ts +3 -0
- package/lib/themes/dark.css +45902 -0
- package/lib/themes/dark.d.ts +3 -0
- package/lib/themes/default.css +45871 -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/withRemoteConfig.d.ts +2 -0
- package/lib/withStore.d.ts +2 -0
- package/package.json +158 -0
- package/scss/README.md +9 -0
- package/scss/_components.scss +4346 -0
- package/scss/_functions.scss +137 -0
- package/scss/_mixins.scss +805 -0
- package/scss/_properties.scss +898 -0
- package/scss/_thirds.scss +12 -0
- package/scss/_utilities.scss +1757 -0
- package/scss/_variables.scss +439 -0
- package/scss/base/_animate.scss +84 -0
- package/scss/base/_common.scss +19 -0
- package/scss/base/_normalize.scss +376 -0
- package/scss/base/_reset.scss +18 -0
- package/scss/base/_typography.scss +79 -0
- package/scss/components/_alert.scss +123 -0
- package/scss/components/_anchor-nav.scss +158 -0
- package/scss/components/_app.scss +46 -0
- package/scss/components/_array-input.scss +107 -0
- package/scss/components/_audio.scss +146 -0
- package/scss/components/_auto-folder.scss +40 -0
- package/scss/components/_avatar.scss +55 -0
- package/scss/components/_badge.scss +145 -0
- package/scss/components/_barcode.scss +6 -0
- package/scss/components/_breadcrumb.scss +110 -0
- package/scss/components/_button-group.scss +165 -0
- package/scss/components/_button.scss +871 -0
- package/scss/components/_calendar.scss +442 -0
- package/scss/components/_card.scss +389 -0
- package/scss/components/_card2.scss +28 -0
- package/scss/components/_cards.scss +221 -0
- package/scss/components/_carousel.scss +292 -0
- package/scss/components/_cascader.scss +157 -0
- package/scss/components/_chart.scss +22 -0
- package/scss/components/_city-area.scss +37 -0
- package/scss/components/_code.scss +10 -0
- package/scss/components/_collapse-group.scss +83 -0
- package/scss/components/_collapse.scss +245 -0
- package/scss/components/_color.scss +17 -0
- package/scss/components/_column-toggler.scss +261 -0
- package/scss/components/_condition-builder.scss +521 -0
- package/scss/components/_context-menu.scss +204 -0
- package/scss/components/_copyable.scss +10 -0
- package/scss/components/_crud.scss +195 -0
- package/scss/components/_crud2.scss +345 -0
- package/scss/components/_debug.scss +259 -0
- package/scss/components/_divider.scss +81 -0
- package/scss/components/_drawer.scss +393 -0
- package/scss/components/_dropdown-context-menus.scss +27 -0
- package/scss/components/_dropdown.scss +159 -0
- package/scss/components/_each.scss +7 -0
- package/scss/components/_formula.scss +723 -0
- package/scss/components/_grid-nav.scss +128 -0
- package/scss/components/_horizontal-scroll.scss +51 -0
- package/scss/components/_icon.scss +4 -0
- package/scss/components/_image-gallery.scss +331 -0
- package/scss/components/_images.scss +650 -0
- package/scss/components/_input-box.scss +111 -0
- package/scss/components/_json-schema-editor.scss +149 -0
- package/scss/components/_json-schema.scss +166 -0
- package/scss/components/_json.scss +7 -0
- package/scss/components/_link.scss +22 -0
- package/scss/components/_list-menu.scss +114 -0
- package/scss/components/_list.scss +313 -0
- package/scss/components/_log.scss +169 -0
- package/scss/components/_mapping.scss +6 -0
- package/scss/components/_markdown.scss +266 -0
- package/scss/components/_menu.scss +795 -0
- package/scss/components/_mobile-dev-tool.scss +175 -0
- package/scss/components/_modal.scss +282 -0
- package/scss/components/_multiline-text.scss +20 -0
- package/scss/components/_nav.scss +45 -0
- package/scss/components/_overflow-tpl.scss +5 -0
- package/scss/components/_page.scss +198 -0
- package/scss/components/_pagination.scss +403 -0
- package/scss/components/_panel.scss +263 -0
- package/scss/components/_pdf_viewer.scss +47 -0
- package/scss/components/_picker-columns.scss +140 -0
- package/scss/components/_popover.scss +54 -0
- package/scss/components/_popoverable.scss +100 -0
- package/scss/components/_popup.scss +171 -0
- package/scss/components/_portlet.scss +51 -0
- package/scss/components/_print.scss +13 -0
- package/scss/components/_progress.scss +165 -0
- package/scss/components/_property.scss +47 -0
- package/scss/components/_pull-refresh.scss +30 -0
- package/scss/components/_quick-edit.scss +53 -0
- package/scss/components/_remark.scss +58 -0
- package/scss/components/_result-box.scss +380 -0
- package/scss/components/_search-box.scss +267 -0
- package/scss/components/_service.scss +3 -0
- package/scss/components/_shape.scss +19 -0
- package/scss/components/_signature.scss +98 -0
- package/scss/components/_slider.scss +27 -0
- package/scss/components/_sparkline.scss +18 -0
- package/scss/components/_spinner.scss +214 -0
- package/scss/components/_status.scss +118 -0
- package/scss/components/_steps.scss +481 -0
- package/scss/components/_table.scss +1234 -0
- package/scss/components/_table2.scss +1066 -0
- package/scss/components/_tabs.scss +1410 -0
- package/scss/components/_tag.scss +191 -0
- package/scss/components/_timeline.scss +572 -0
- package/scss/components/_toast.scss +342 -0
- package/scss/components/_tooltip.scss +340 -0
- package/scss/components/_tpl.scss +51 -0
- package/scss/components/_verificationCode.scss +33 -0
- package/scss/components/_video.scss +38 -0
- package/scss/components/_wizard.scss +287 -0
- package/scss/components/_wrapper.scss +26 -0
- package/scss/components/form/_chained-select.scss +10 -0
- package/scss/components/form/_checks.scss +433 -0
- package/scss/components/form/_city.scss +33 -0
- package/scss/components/form/_color.scss +148 -0
- package/scss/components/form/_combo.scss +360 -0
- package/scss/components/form/_date-range.scss +332 -0
- package/scss/components/form/_date.scss +807 -0
- package/scss/components/form/_editor.scss +139 -0
- package/scss/components/form/_excel.scss +150 -0
- package/scss/components/form/_fieldset.scss +202 -0
- package/scss/components/form/_file.scss +308 -0
- package/scss/components/form/_form.scss +936 -0
- package/scss/components/form/_group.scss +116 -0
- package/scss/components/form/_icon-picker.scss +113 -0
- package/scss/components/form/_icon-select.scss +245 -0
- package/scss/components/form/_image.scss +359 -0
- package/scss/components/form/_input-group.scss +213 -0
- package/scss/components/form/_input-table.scss +17 -0
- package/scss/components/form/_list.scss +225 -0
- package/scss/components/form/_location.scss +210 -0
- package/scss/components/form/_matrix.scss +7 -0
- package/scss/components/form/_nested-select.scss +149 -0
- package/scss/components/form/_number.scss +633 -0
- package/scss/components/form/_picker.scss +237 -0
- package/scss/components/form/_qr-code.scss +4 -0
- package/scss/components/form/_range.scss +438 -0
- package/scss/components/form/_rating.scss +94 -0
- package/scss/components/form/_repeat.scss +40 -0
- package/scss/components/form/_result-list.scss +98 -0
- package/scss/components/form/_rich-text.scss +163 -0
- package/scss/components/form/_select.scss +712 -0
- package/scss/components/form/_selection.scss +485 -0
- package/scss/components/form/_sub-form.scss +118 -0
- package/scss/components/form/_switch.scss +228 -0
- package/scss/components/form/_tag.scss +146 -0
- package/scss/components/form/_text.scss +508 -0
- package/scss/components/form/_textarea.scss +78 -0
- package/scss/components/form/_tinymce.scss +6 -0
- package/scss/components/form/_transfer.scss +624 -0
- package/scss/components/form/_tree-select.scss +47 -0
- package/scss/components/form/_tree.scss +458 -0
- package/scss/components/form/_user-select.scss +643 -0
- package/scss/components/react-datetime.scss +267 -0
- package/scss/helper/background/_background-color.md +131 -0
- package/scss/helper/background/_background-color.scss +214 -0
- package/scss/helper/border/_border-color.md +109 -0
- package/scss/helper/border/_border-color.scss +178 -0
- package/scss/helper/border/_border-radius.md +86 -0
- package/scss/helper/border/_border-radius.scss +152 -0
- package/scss/helper/border/_border-style.md +11 -0
- package/scss/helper/border/_border-style.scss +40 -0
- package/scss/helper/border/_border-width.md +31 -0
- package/scss/helper/border/_border-width.scss +72 -0
- package/scss/helper/box-alignment/_align-content.md +12 -0
- package/scss/helper/box-alignment/_align-content.scss +44 -0
- package/scss/helper/box-alignment/_align-items.md +11 -0
- package/scss/helper/box-alignment/_align-items.scss +41 -0
- package/scss/helper/box-alignment/_align-self.md +11 -0
- package/scss/helper/box-alignment/_align-self.scss +40 -0
- package/scss/helper/box-alignment/_justify-content.md +12 -0
- package/scss/helper/box-alignment/_justify-content.scss +44 -0
- package/scss/helper/box-alignment/_justify-items.md +11 -0
- package/scss/helper/box-alignment/_justify-items.scss +40 -0
- package/scss/helper/box-alignment/_justify-self.md +11 -0
- package/scss/helper/box-alignment/_justify-self.scss +40 -0
- package/scss/helper/box-alignment/_place-content.md +13 -0
- package/scss/helper/box-alignment/_place-content.scss +48 -0
- package/scss/helper/box-alignment/_place-items.md +11 -0
- package/scss/helper/box-alignment/_place-items.scss +40 -0
- package/scss/helper/box-alignment/_place-self.md +11 -0
- package/scss/helper/box-alignment/_place-self.scss +40 -0
- package/scss/helper/effect/_box-shadow.md +16 -0
- package/scss/helper/effect/_box-shadow.scss +74 -0
- package/scss/helper/effect/_opacity.md +21 -0
- package/scss/helper/effect/_opacity.scss +66 -0
- package/scss/helper/flex/_direction.md +10 -0
- package/scss/helper/flex/_direction.scss +41 -0
- package/scss/helper/flex/_flex.md +10 -0
- package/scss/helper/flex/_flex.scss +38 -0
- package/scss/helper/flex/_grow.md +8 -0
- package/scss/helper/flex/_grow.scss +28 -0
- package/scss/helper/flex/_order.md +20 -0
- package/scss/helper/flex/_order.scss +56 -0
- package/scss/helper/flex/_shrink.md +8 -0
- package/scss/helper/flex/_shrink.scss +27 -0
- package/scss/helper/flex/_wrap.md +9 -0
- package/scss/helper/flex/_wrap.scss +36 -0
- package/scss/helper/grid/_auto-columns.md +10 -0
- package/scss/helper/grid/_auto-columns.scss +38 -0
- package/scss/helper/grid/_auto-flow.md +10 -0
- package/scss/helper/grid/_auto-flow.scss +38 -0
- package/scss/helper/grid/_auto-rows.md +10 -0
- package/scss/helper/grid/_auto-rows.scss +38 -0
- package/scss/helper/grid/_column-start-end.md +48 -0
- package/scss/helper/grid/_column-start-end.scss +201 -0
- package/scss/helper/grid/_columns.md +19 -0
- package/scss/helper/grid/_columns.scss +74 -0
- package/scss/helper/grid/_gap.md +117 -0
- package/scss/helper/grid/_gap.scss +154 -0
- package/scss/helper/grid/_row-start-end.md +48 -0
- package/scss/helper/grid/_row-start-end.scss +201 -0
- package/scss/helper/grid/_rows.md +13 -0
- package/scss/helper/grid/_rows.scss +50 -0
- package/scss/helper/layout/_box-sizing.md +35 -0
- package/scss/helper/layout/_box-sizing.scss +51 -0
- package/scss/helper/layout/_clear.md +27 -0
- package/scss/helper/layout/_clear.scss +56 -0
- package/scss/helper/layout/_display.md +41 -0
- package/scss/helper/layout/_display.scss +82 -0
- package/scss/helper/layout/_float.md +47 -0
- package/scss/helper/layout/_float.scss +71 -0
- package/scss/helper/layout/_overflow.md +34 -0
- package/scss/helper/layout/_overflow.scss +85 -0
- package/scss/helper/layout/_position.md +27 -0
- package/scss/helper/layout/_position.scss +55 -0
- package/scss/helper/layout/_top-right-bottom-left.md +150 -0
- package/scss/helper/layout/_top-right-bottom-left.scss +292 -0
- package/scss/helper/layout/_visibility.md +21 -0
- package/scss/helper/layout/_visibility.scss +42 -0
- package/scss/helper/layout/_z-index.md +37 -0
- package/scss/helper/layout/_z-index.scss +67 -0
- package/scss/helper/sizing/_height.md +103 -0
- package/scss/helper/sizing/_height.scss +161 -0
- package/scss/helper/sizing/_width.md +109 -0
- package/scss/helper/sizing/_width.scss +174 -0
- package/scss/helper/spacing/_margin.md +527 -0
- package/scss/helper/spacing/_margin.scss +821 -0
- package/scss/helper/spacing/_padding.md +265 -0
- package/scss/helper/spacing/_padding.scss +394 -0
- package/scss/helper/spacing/_space-between.md +155 -0
- package/scss/helper/spacing/_space-between.scss +224 -0
- package/scss/helper/typography/_font-family.md +9 -0
- package/scss/helper/typography/_font-family.scss +28 -0
- package/scss/helper/typography/_font-size.md +19 -0
- package/scss/helper/typography/_font-size.scss +40 -0
- package/scss/helper/typography/_font-style.md +8 -0
- package/scss/helper/typography/_font-style.scss +31 -0
- package/scss/helper/typography/_font-weight.md +15 -0
- package/scss/helper/typography/_font-weight.scss +49 -0
- package/scss/helper/typography/_letter-spacing.md +12 -0
- package/scss/helper/typography/_letter-spacing.scss +43 -0
- package/scss/helper/typography/_line-height.md +20 -0
- package/scss/helper/typography/_line-height.scss +59 -0
- package/scss/helper/typography/_list-style-type.md +11 -0
- package/scss/helper/typography/_list-style-type.scss +43 -0
- package/scss/helper/typography/_text-align.md +10 -0
- package/scss/helper/typography/_text-align.scss +34 -0
- package/scss/helper/typography/_text-color.md +110 -0
- package/scss/helper/typography/_text-color.scss +184 -0
- package/scss/helper/typography/_text-decoration.md +9 -0
- package/scss/helper/typography/_text-decoration.scss +34 -0
- package/scss/helper/typography/_text-overflow.md +9 -0
- package/scss/helper/typography/_text-overflow.scss +40 -0
- package/scss/helper/typography/_text-transform.md +10 -0
- package/scss/helper/typography/_text-transform.scss +40 -0
- package/scss/helper/typography/_vertical-align.md +12 -0
- package/scss/helper/typography/_vertical-align.scss +44 -0
- package/scss/helper/typography/_whitespace.md +11 -0
- package/scss/helper/typography/_whitespace.scss +42 -0
- package/scss/helper/typography/_word-break.md +9 -0
- package/scss/helper/typography/_word-break.scss +36 -0
- package/scss/helper.scss +72 -0
- package/scss/layout/_aside.scss +361 -0
- package/scss/layout/_grid.scss +173 -0
- package/scss/layout/_hbox.scss +127 -0
- package/scss/layout/_header.scss +0 -0
- package/scss/layout/_layout.scss +492 -0
- package/scss/layout/_vbox.scss +38 -0
- package/scss/themes/_ang-variables.scss +224 -0
- package/scss/themes/_antd-variables.scss +238 -0
- package/scss/themes/_common.scss +157 -0
- package/scss/themes/_cxd-variables.scss +222 -0
- package/scss/themes/_dark-variables.scss +229 -0
- package/scss/themes/ang-ie11.scss +1 -0
- package/scss/themes/ang.scss +27 -0
- package/scss/themes/antd-ie11.scss +1 -0
- package/scss/themes/antd.scss +5 -0
- package/scss/themes/cxd-ie11.scss +1 -0
- package/scss/themes/cxd.scss +5 -0
- package/scss/themes/dark-ie11.scss +1 -0
- package/scss/themes/dark.scss +34 -0
- package/scss/themes/default.scss +2 -0
- package/scss/themes/extract-antd-color.py +27 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-rev-ui v6.13.0
|
|
3
|
+
* Copyright 2018-2026 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { __extends, __spreadArray, __read, __assign, __decorate, __metadata } from 'tslib';
|
|
7
|
+
import React__default from 'react';
|
|
8
|
+
import Sortable from 'sortablejs';
|
|
9
|
+
import { guid, findDomCompat, autobind, themeable, localeable } from 'amis-rev-core';
|
|
10
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
11
|
+
import { Icon } from './icons.js';
|
|
12
|
+
import TransferSearch from './TransferSearch.js';
|
|
13
|
+
import VirtualList from './virtual-list/index.js';
|
|
14
|
+
import AutoSizer from './virtual-list/AutoSizer.js';
|
|
15
|
+
|
|
16
|
+
var ResultList = /** @class */ (function (_super) {
|
|
17
|
+
__extends(ResultList, _super);
|
|
18
|
+
function ResultList() {
|
|
19
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
|
20
|
+
_this.state = {
|
|
21
|
+
searchResult: null
|
|
22
|
+
};
|
|
23
|
+
_this.id = guid();
|
|
24
|
+
_this.unmounted = false;
|
|
25
|
+
return _this;
|
|
26
|
+
}
|
|
27
|
+
ResultList.itemRender = function (option, states) {
|
|
28
|
+
var scopeLabel = option.scopeLabel || '';
|
|
29
|
+
var label = option[(states === null || states === void 0 ? void 0 : states.labelField) || 'label'];
|
|
30
|
+
var canScopeLabelTitle = typeof scopeLabel === 'string' || typeof scopeLabel === 'number';
|
|
31
|
+
var canLabelTitle = typeof label === 'string' || typeof label === 'number';
|
|
32
|
+
var title = canScopeLabelTitle && canLabelTitle ? "".concat(scopeLabel).concat(label) : '';
|
|
33
|
+
var classnames = states.classnames;
|
|
34
|
+
return (React__default.createElement("span", { title: title, className: classnames('Selection-ellipsis-line') },
|
|
35
|
+
scopeLabel,
|
|
36
|
+
label));
|
|
37
|
+
};
|
|
38
|
+
ResultList.prototype.componentDidMount = function () {
|
|
39
|
+
this.props.sortable && this.initSortable();
|
|
40
|
+
};
|
|
41
|
+
ResultList.prototype.componentDidUpdate = function () {
|
|
42
|
+
if (this.props.sortable) {
|
|
43
|
+
this.sortable || this.initSortable();
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
this.desposeSortable();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
ResultList.prototype.componentWillUnmount = function () {
|
|
50
|
+
this.desposeSortable();
|
|
51
|
+
this.unmounted = true;
|
|
52
|
+
};
|
|
53
|
+
ResultList.prototype.domSearchRef = function (ref) {
|
|
54
|
+
while (ref && ref.getWrappedInstance) {
|
|
55
|
+
ref = ref.getWrappedInstance();
|
|
56
|
+
}
|
|
57
|
+
this.searchRef = ref;
|
|
58
|
+
};
|
|
59
|
+
ResultList.prototype.initSortable = function () {
|
|
60
|
+
var _this = this;
|
|
61
|
+
var ns = this.props.classPrefix;
|
|
62
|
+
var dom = findDomCompat(this);
|
|
63
|
+
var container = dom.querySelector(".".concat(ns, "Selections-items"));
|
|
64
|
+
if (!container) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
this.sortable = new Sortable(container, {
|
|
68
|
+
group: "selections-".concat(this.id),
|
|
69
|
+
animation: 150,
|
|
70
|
+
handle: ".".concat(ns, "Selections-dragbar"),
|
|
71
|
+
ghostClass: "".concat(ns, "Selections-item--dragging"),
|
|
72
|
+
onEnd: function (e) {
|
|
73
|
+
var _b, _c;
|
|
74
|
+
// 没有移动
|
|
75
|
+
if (e.newIndex === e.oldIndex) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
// 换回来
|
|
79
|
+
var parent = e.to;
|
|
80
|
+
if (e.oldIndex < parent.childNodes.length - 1) {
|
|
81
|
+
parent.insertBefore(e.item, parent.childNodes[e.oldIndex > e.newIndex ? e.oldIndex + 1 : e.oldIndex]);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
parent.appendChild(e.item);
|
|
85
|
+
}
|
|
86
|
+
var value = _this.props.value;
|
|
87
|
+
if (!Array.isArray(value)) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
var newValue = value.concat();
|
|
91
|
+
newValue.splice(e.newIndex, 0, newValue.splice(e.oldIndex, 1)[0]);
|
|
92
|
+
(_c = (_b = _this.props).onChange) === null || _c === void 0 ? void 0 : _c.call(_b, newValue);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
ResultList.prototype.desposeSortable = function () {
|
|
97
|
+
var _b;
|
|
98
|
+
(_b = this.sortable) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
99
|
+
delete this.sortable;
|
|
100
|
+
};
|
|
101
|
+
ResultList.prototype.handleValueChange = function (index, value, name) {
|
|
102
|
+
var _b;
|
|
103
|
+
if (typeof name !== 'string') {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
var _c = this.props, list = _c.value, onChange = _c.onChange;
|
|
107
|
+
var result = Array.isArray(list) ? list.concat() : [];
|
|
108
|
+
if (!result[index]) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
result.splice(index, 1, __assign(__assign({}, result[index]), (_b = {}, _b[name] = value, _b)));
|
|
112
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(result, true);
|
|
113
|
+
};
|
|
114
|
+
ResultList.prototype.search = function (inputValue) {
|
|
115
|
+
var _b = this.props, onSearch = _b.onSearch, value = _b.value;
|
|
116
|
+
var searchResult = (value || []).filter(function (item) { return onSearch && onSearch(inputValue, item); });
|
|
117
|
+
this.setState({ searchResult: searchResult });
|
|
118
|
+
};
|
|
119
|
+
ResultList.prototype.clearSearch = function () {
|
|
120
|
+
this.setState({ searchResult: null });
|
|
121
|
+
};
|
|
122
|
+
ResultList.prototype.clearInput = function () {
|
|
123
|
+
var _b, _c;
|
|
124
|
+
if (this.props.searchable) {
|
|
125
|
+
(_c = (_b = this.searchRef) === null || _b === void 0 ? void 0 : _b.clearInput) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
126
|
+
}
|
|
127
|
+
this.clearSearch();
|
|
128
|
+
};
|
|
129
|
+
// 删除项
|
|
130
|
+
ResultList.prototype.handleCloseItem = function (e, option) {
|
|
131
|
+
var _b = this.props, value = _b.value, onChange = _b.onChange, disabled = _b.disabled, searchable = _b.searchable, _c = _b.valueField, valueField = _c === void 0 ? 'value' : _c;
|
|
132
|
+
if (disabled || option.disabled) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
var searchResult = this.state.searchResult;
|
|
136
|
+
// 结果搜索
|
|
137
|
+
if (searchable && searchResult) {
|
|
138
|
+
// 删除普通值
|
|
139
|
+
var valueArray = cloneDeep(value) || [];
|
|
140
|
+
var idx = valueArray.findIndex(function (item) { return item[valueField] === option[valueField]; });
|
|
141
|
+
if (idx > -1) {
|
|
142
|
+
valueArray.splice(idx, 1);
|
|
143
|
+
onChange && onChange(valueArray);
|
|
144
|
+
}
|
|
145
|
+
// 删除搜索结果
|
|
146
|
+
var searchIdx = parseInt(e.currentTarget.getAttribute('data-index'), 10);
|
|
147
|
+
if (searchIdx > -1) {
|
|
148
|
+
searchResult.splice(searchIdx, 1);
|
|
149
|
+
this.setState({ searchResult: searchResult });
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
// 没有搜索,走旧的删除方式
|
|
153
|
+
else {
|
|
154
|
+
var index = parseInt(e.currentTarget.getAttribute('data-index'), 10);
|
|
155
|
+
var _d = this.props, value_1 = _d.value, onChange_1 = _d.onChange;
|
|
156
|
+
if (!Array.isArray(value_1)) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
var newValue = value_1.concat();
|
|
160
|
+
newValue.splice(index, 1);
|
|
161
|
+
onChange_1 === null || onChange_1 === void 0 ? void 0 : onChange_1(newValue);
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
ResultList.prototype.renderOption = function (option, index, value, styles) {
|
|
165
|
+
var _this = this;
|
|
166
|
+
if (styles === void 0) { styles = {}; }
|
|
167
|
+
var _b = this.props, cx = _b.classnames, itemRender = _b.itemRender, disabled = _b.disabled, itemClassName = _b.itemClassName, sortable = _b.sortable, labelField = _b.labelField; _b.translate; var showInvalidMatch = _b.showInvalidMatch, testIdBuilder = _b.testIdBuilder;
|
|
168
|
+
var itemTIB = testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild("item-".concat(option.value || index));
|
|
169
|
+
return (React__default.createElement("div", { style: styles, className: cx('Selections-item', itemClassName, option === null || option === void 0 ? void 0 : option.className), key: index },
|
|
170
|
+
sortable && !disabled && value.length > 1 ? (React__default.createElement(Icon, { className: cx('Selections-dragbar icon'), icon: "drag-bar" })) : null,
|
|
171
|
+
React__default.createElement("label", { className: cx('Selections-label', {
|
|
172
|
+
'is-invalid': showInvalidMatch ? option === null || option === void 0 ? void 0 : option.__unmatched : false
|
|
173
|
+
}) }, itemRender(option, {
|
|
174
|
+
index: index,
|
|
175
|
+
disabled: disabled,
|
|
176
|
+
onChange: this.handleValueChange.bind(this, index),
|
|
177
|
+
labelField: labelField,
|
|
178
|
+
classnames: cx
|
|
179
|
+
})),
|
|
180
|
+
!disabled ? (React__default.createElement("a", __assign({ className: cx('Selections-delBtn'), "data-index": index, onClick: function (e) {
|
|
181
|
+
return _this.handleCloseItem(e, option);
|
|
182
|
+
} }, itemTIB === null || itemTIB === void 0 ? void 0 : itemTIB.getChild('close').getTestId()),
|
|
183
|
+
React__default.createElement(Icon, { icon: "close", className: "icon" }))) : null));
|
|
184
|
+
};
|
|
185
|
+
ResultList.prototype.renderNormalList = function (value) {
|
|
186
|
+
var _this = this;
|
|
187
|
+
var _b = this.props, cx = _b.classnames, __ = _b.translate, placeholder = _b.placeholder, _c = _b.virtualThreshold, virtualThreshold = _c === void 0 ? 1000 : _c, _d = _b.itemHeight, itemHeight = _d === void 0 ? 30 : _d;
|
|
188
|
+
return (React__default.createElement(React__default.Fragment, null, Array.isArray(value) && value.length ? (React__default.createElement("div", { className: cx('Selections-items') }, value.length > virtualThreshold ? (React__default.createElement(AutoSizer, null, function (_b) {
|
|
189
|
+
var height = _b.height;
|
|
190
|
+
return (React__default.createElement(VirtualList, { height: height, itemCount: value.length, itemSize: itemHeight, renderItem: function (_b) {
|
|
191
|
+
var index = _b.index, style = _b.style;
|
|
192
|
+
var option = value[index];
|
|
193
|
+
if (!option) {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
return _this.renderOption(option, index, value, __assign(__assign({}, style), { width: '100%' }));
|
|
197
|
+
} }));
|
|
198
|
+
})) : (value.map(function (option, index) {
|
|
199
|
+
return _this.renderOption(option, index, value);
|
|
200
|
+
})))) : (React__default.createElement("div", { className: cx('Selections-placeholder') }, __(placeholder)))));
|
|
201
|
+
};
|
|
202
|
+
ResultList.prototype.render = function () {
|
|
203
|
+
var _b = this.props, cx = _b.classnames, className = _b.className, title = _b.title, searchable = _b.searchable, value = _b.value, __ = _b.translate, _c = _b.searchPlaceholder, searchPlaceholder = _c === void 0 ? __('Transfer.searchKeyword') : _c;
|
|
204
|
+
var searchResult = this.state.searchResult;
|
|
205
|
+
return (React__default.createElement("div", { className: cx('Selections', className) },
|
|
206
|
+
title ? React__default.createElement("div", { className: cx('Selections-title') }, title) : null,
|
|
207
|
+
searchable ? (React__default.createElement(TransferSearch, { ref: this.domSearchRef, placeholder: searchPlaceholder, onSearch: this.search, onCancelSearch: this.clearSearch })) : null,
|
|
208
|
+
this.renderNormalList(searchResult !== null ? searchResult : value)));
|
|
209
|
+
};
|
|
210
|
+
var _a;
|
|
211
|
+
_a = ResultList;
|
|
212
|
+
ResultList.defaultProps = {
|
|
213
|
+
placeholder: 'placeholder.selectData',
|
|
214
|
+
itemRender: _a.itemRender,
|
|
215
|
+
searchPlaceholder: '',
|
|
216
|
+
virtualThreshold: 100,
|
|
217
|
+
itemHeight: 32
|
|
218
|
+
};
|
|
219
|
+
__decorate([
|
|
220
|
+
autobind,
|
|
221
|
+
__metadata("design:type", Function),
|
|
222
|
+
__metadata("design:paramtypes", [Object]),
|
|
223
|
+
__metadata("design:returntype", void 0)
|
|
224
|
+
], ResultList.prototype, "domSearchRef", null);
|
|
225
|
+
__decorate([
|
|
226
|
+
autobind,
|
|
227
|
+
__metadata("design:type", Function),
|
|
228
|
+
__metadata("design:paramtypes", [String]),
|
|
229
|
+
__metadata("design:returntype", void 0)
|
|
230
|
+
], ResultList.prototype, "search", null);
|
|
231
|
+
__decorate([
|
|
232
|
+
autobind,
|
|
233
|
+
__metadata("design:type", Function),
|
|
234
|
+
__metadata("design:paramtypes", []),
|
|
235
|
+
__metadata("design:returntype", void 0)
|
|
236
|
+
], ResultList.prototype, "clearSearch", null);
|
|
237
|
+
__decorate([
|
|
238
|
+
autobind,
|
|
239
|
+
__metadata("design:type", Function),
|
|
240
|
+
__metadata("design:paramtypes", []),
|
|
241
|
+
__metadata("design:returntype", void 0)
|
|
242
|
+
], ResultList.prototype, "clearInput", null);
|
|
243
|
+
__decorate([
|
|
244
|
+
autobind,
|
|
245
|
+
__metadata("design:type", Function),
|
|
246
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
247
|
+
__metadata("design:returntype", void 0)
|
|
248
|
+
], ResultList.prototype, "handleCloseItem", null);
|
|
249
|
+
return ResultList;
|
|
250
|
+
}(React__default.Component));
|
|
251
|
+
var ResultList$1 = themeable(localeable(ResultList));
|
|
252
|
+
|
|
253
|
+
export { ResultList, ResultList$1 as default };
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-rev-ui v6.13.0
|
|
3
|
+
* Copyright 2018-2026 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { __extends, __spreadArray, __read, __assign, __decorate, __metadata } from 'tslib';
|
|
7
|
+
import React__default from 'react';
|
|
8
|
+
import { BaseSelection } from './Selection.js';
|
|
9
|
+
import { resolveVariable, autobind, themeable, localeable } from 'amis-rev-core';
|
|
10
|
+
import TransferSearch from './TransferSearch.js';
|
|
11
|
+
import './icons.js';
|
|
12
|
+
import TableCheckboxes from './TableSelection.js';
|
|
13
|
+
import SvgClose from '../icons/close.svg.js';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 结果表格(暂时不支持结果排序)
|
|
17
|
+
*/
|
|
18
|
+
var BaseResultTableSelection = /** @class */ (function (_super) {
|
|
19
|
+
__extends(BaseResultTableSelection, _super);
|
|
20
|
+
function BaseResultTableSelection() {
|
|
21
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
|
22
|
+
_this.state = {
|
|
23
|
+
tableOptions: [],
|
|
24
|
+
searching: false,
|
|
25
|
+
searchTableOptions: []
|
|
26
|
+
};
|
|
27
|
+
return _this;
|
|
28
|
+
}
|
|
29
|
+
BaseResultTableSelection.getDerivedStateFromProps = function (props) {
|
|
30
|
+
var options = props.options, value = props.value, option2value = props.option2value, valueField = props.valueField;
|
|
31
|
+
var valueArray = BaseSelection.value2array(value, options, option2value, valueField);
|
|
32
|
+
return {
|
|
33
|
+
tableOptions: valueArray
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
BaseResultTableSelection.prototype.domSearchRef = function (ref) {
|
|
37
|
+
while (ref && ref.getWrappedInstance) {
|
|
38
|
+
ref = ref.getWrappedInstance();
|
|
39
|
+
}
|
|
40
|
+
this.searchRef = ref;
|
|
41
|
+
};
|
|
42
|
+
BaseResultTableSelection.prototype.handleCloseItem = function (option) {
|
|
43
|
+
var _a = this.props, value = _a.value, onChange = _a.onChange, option2value = _a.option2value, options = _a.options, disabled = _a.disabled, valueField = _a.valueField;
|
|
44
|
+
var _b = this.state, searching = _b.searching, searchTableOptions = _b.searchTableOptions;
|
|
45
|
+
if (disabled || option.disabled) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
// 删除普通值
|
|
49
|
+
var valueArray = BaseSelection.value2array(value, options, option2value, valueField);
|
|
50
|
+
var idx = valueArray.indexOf(option);
|
|
51
|
+
valueArray.splice(idx, 1);
|
|
52
|
+
var newValue = option2value
|
|
53
|
+
? valueArray.map(function (item) { return option2value(item); })
|
|
54
|
+
: valueArray;
|
|
55
|
+
onChange && onChange(newValue);
|
|
56
|
+
if (searching) {
|
|
57
|
+
var searchArray = BaseSelection.value2array(searchTableOptions, options, option2value, valueField);
|
|
58
|
+
var searchIdx = searchArray.indexOf(option);
|
|
59
|
+
searchTableOptions.splice(searchIdx, 1);
|
|
60
|
+
this.setState({ searchTableOptions: searchTableOptions });
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
BaseResultTableSelection.prototype.search = function (inputValue) {
|
|
64
|
+
// 结果为空,直接清空
|
|
65
|
+
if (!inputValue) {
|
|
66
|
+
this.clearSearch();
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
var _a = this.props, value = _a.value, onSearch = _a.onSearch;
|
|
70
|
+
var searchOptions = (value || []).filter(function (item) {
|
|
71
|
+
return onSearch === null || onSearch === void 0 ? void 0 : onSearch(inputValue, item);
|
|
72
|
+
});
|
|
73
|
+
this.setState({
|
|
74
|
+
searching: true,
|
|
75
|
+
searchTableOptions: searchOptions
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
BaseResultTableSelection.prototype.clearSearch = function () {
|
|
79
|
+
this.setState({
|
|
80
|
+
searching: false,
|
|
81
|
+
searchTableOptions: []
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
BaseResultTableSelection.prototype.clearInput = function () {
|
|
85
|
+
var _a, _b;
|
|
86
|
+
if (this.props.searchable) {
|
|
87
|
+
(_b = (_a = this.searchRef) === null || _a === void 0 ? void 0 : _a.clearInput) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
88
|
+
}
|
|
89
|
+
this.clearSearch();
|
|
90
|
+
};
|
|
91
|
+
BaseResultTableSelection.prototype.renderTable = function () {
|
|
92
|
+
var _this = this;
|
|
93
|
+
var _a = this.props, cx = _a.classnames, className = _a.className, columns = _a.columns, cellRender = _a.cellRender, value = _a.value, disabled = _a.disabled, option2value = _a.option2value, onChange = _a.onChange, __ = _a.translate, placeholder = _a.placeholder, virtualThreshold = _a.virtualThreshold, itemHeight = _a.itemHeight, testIdBuilder = _a.testIdBuilder;
|
|
94
|
+
var _b = this.state, searching = _b.searching, tableOptions = _b.tableOptions, searchTableOptions = _b.searchTableOptions;
|
|
95
|
+
return (React__default.createElement("div", { className: cx('ResultTableList', className) }, Array.isArray(value) && value.length ? (React__default.createElement(TableCheckboxes, { columns: columns, options: !searching ? tableOptions : searchTableOptions, value: value, disabled: disabled, option2value: option2value, onChange: onChange, multiple: false, resultMode: true, virtualThreshold: virtualThreshold, itemHeight: itemHeight, cellRender: function (column, option, colIndex, rowIndex) {
|
|
96
|
+
var raw = cellRender(column, option, colIndex, rowIndex);
|
|
97
|
+
var itemTIB = testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild("item-".concat(option.value || rowIndex));
|
|
98
|
+
if (colIndex === columns.length - 1) {
|
|
99
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
100
|
+
raw,
|
|
101
|
+
React__default.createElement("span", __assign({ className: cx('ResultTableList-close-btn'), onClick: function (e) {
|
|
102
|
+
e.stopPropagation();
|
|
103
|
+
_this.handleCloseItem(option);
|
|
104
|
+
} }, itemTIB === null || itemTIB === void 0 ? void 0 : itemTIB.getChild("close").getTestId()),
|
|
105
|
+
React__default.createElement(SvgClose, null))));
|
|
106
|
+
}
|
|
107
|
+
return raw;
|
|
108
|
+
} })) : (React__default.createElement("div", { className: cx('Selections-placeholder') }, __(placeholder)))));
|
|
109
|
+
};
|
|
110
|
+
BaseResultTableSelection.prototype.render = function () {
|
|
111
|
+
var _a = this.props, cx = _a.classnames, className = _a.className, title = _a.title, searchable = _a.searchable, __ = _a.translate, _b = _a.searchPlaceholder, searchPlaceholder = _b === void 0 ? __('Transfer.searchKeyword') : _b;
|
|
112
|
+
return (React__default.createElement("div", { className: cx('Selections', className) },
|
|
113
|
+
title ? React__default.createElement("div", { className: cx('Selections-title') }, title) : null,
|
|
114
|
+
searchable ? (React__default.createElement(TransferSearch, { ref: this.domSearchRef, placeholder: searchPlaceholder, onSearch: this.search, onCancelSearch: this.clearSearch })) : null,
|
|
115
|
+
this.renderTable()));
|
|
116
|
+
};
|
|
117
|
+
BaseResultTableSelection.defaultProps = __assign(__assign({}, BaseSelection.defaultProps), { cellRender: function (column, option, colIndex, rowIndex) { return React__default.createElement("span", null, resolveVariable(column.name, option)); } });
|
|
118
|
+
__decorate([
|
|
119
|
+
autobind,
|
|
120
|
+
__metadata("design:type", Function),
|
|
121
|
+
__metadata("design:paramtypes", [Object]),
|
|
122
|
+
__metadata("design:returntype", void 0)
|
|
123
|
+
], BaseResultTableSelection.prototype, "domSearchRef", null);
|
|
124
|
+
__decorate([
|
|
125
|
+
autobind,
|
|
126
|
+
__metadata("design:type", Function),
|
|
127
|
+
__metadata("design:paramtypes", [Object]),
|
|
128
|
+
__metadata("design:returntype", void 0)
|
|
129
|
+
], BaseResultTableSelection.prototype, "handleCloseItem", null);
|
|
130
|
+
__decorate([
|
|
131
|
+
autobind,
|
|
132
|
+
__metadata("design:type", Function),
|
|
133
|
+
__metadata("design:paramtypes", [String]),
|
|
134
|
+
__metadata("design:returntype", void 0)
|
|
135
|
+
], BaseResultTableSelection.prototype, "search", null);
|
|
136
|
+
__decorate([
|
|
137
|
+
autobind,
|
|
138
|
+
__metadata("design:type", Function),
|
|
139
|
+
__metadata("design:paramtypes", []),
|
|
140
|
+
__metadata("design:returntype", void 0)
|
|
141
|
+
], BaseResultTableSelection.prototype, "clearSearch", null);
|
|
142
|
+
__decorate([
|
|
143
|
+
autobind,
|
|
144
|
+
__metadata("design:type", Function),
|
|
145
|
+
__metadata("design:paramtypes", []),
|
|
146
|
+
__metadata("design:returntype", void 0)
|
|
147
|
+
], BaseResultTableSelection.prototype, "clearInput", null);
|
|
148
|
+
return BaseResultTableSelection;
|
|
149
|
+
}(BaseSelection));
|
|
150
|
+
var ResultTableList = themeable(localeable(BaseResultTableSelection));
|
|
151
|
+
|
|
152
|
+
export { BaseResultTableSelection, ResultTableList as default };
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-rev-ui v6.13.0
|
|
3
|
+
* Copyright 2018-2026 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { __extends, __spreadArray, __read, __decorate, __metadata } from 'tslib';
|
|
7
|
+
import React__default from 'react';
|
|
8
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
9
|
+
import isEqual from 'lodash/isEqual';
|
|
10
|
+
import omit from 'lodash/omit';
|
|
11
|
+
import { noop, autobind, themeable, localeable } from 'amis-rev-core';
|
|
12
|
+
import Tree from './Tree.js';
|
|
13
|
+
import TransferSearch from './TransferSearch.js';
|
|
14
|
+
|
|
15
|
+
// 递归找到对应选中节点(dfs)
|
|
16
|
+
function getDeep(node, cb, pathNodes, valueField) {
|
|
17
|
+
if (node[valueField] && cb(node)) {
|
|
18
|
+
node.isChecked = true;
|
|
19
|
+
for (var i = pathNodes.length - 2; i >= 0; i--) {
|
|
20
|
+
if (!pathNodes[i].isChecked) {
|
|
21
|
+
pathNodes[i].isChecked = true;
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
else if (node.children && Array.isArray(node.children)) {
|
|
28
|
+
node.children.forEach(function (n) {
|
|
29
|
+
pathNodes.push(n);
|
|
30
|
+
getDeep(n, cb, pathNodes, valueField);
|
|
31
|
+
pathNodes.pop();
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
// 递归删除树多余的节点
|
|
36
|
+
function deepCheckedTreeNode(nodes) {
|
|
37
|
+
var arr = [];
|
|
38
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
39
|
+
var node = nodes[i];
|
|
40
|
+
if (node.isChecked) {
|
|
41
|
+
if (node.children && Array.isArray(node.children)) {
|
|
42
|
+
node.children = deepCheckedTreeNode(node.children);
|
|
43
|
+
}
|
|
44
|
+
arr.push(node);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return arr;
|
|
48
|
+
}
|
|
49
|
+
// 根据选项获取到结果
|
|
50
|
+
function getResultOptions(value, options, valueField) {
|
|
51
|
+
if (value === void 0) { value = []; }
|
|
52
|
+
var newOptions = cloneDeep(options);
|
|
53
|
+
var callBack = function (node) {
|
|
54
|
+
return !!(value || []).find(function (target) { return target[valueField] === node[valueField]; });
|
|
55
|
+
};
|
|
56
|
+
newOptions &&
|
|
57
|
+
newOptions.forEach(function (op) {
|
|
58
|
+
getDeep(op, callBack, [op], valueField);
|
|
59
|
+
});
|
|
60
|
+
return deepCheckedTreeNode(newOptions);
|
|
61
|
+
}
|
|
62
|
+
// 在包含回调函数情况下,遍历树
|
|
63
|
+
function deepTree(nodes, cb) {
|
|
64
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
65
|
+
var node = nodes[i];
|
|
66
|
+
cb(node);
|
|
67
|
+
if (node.children && Array.isArray(node.children)) {
|
|
68
|
+
deepTree(node.children, cb);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// 树的节点删除
|
|
73
|
+
function deepDeleteTree(nodes, option, valueField) {
|
|
74
|
+
var arr = [];
|
|
75
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
76
|
+
var node = nodes[i];
|
|
77
|
+
if (isEqual(node, option)) {
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
if (node.children && Array.isArray(node.children)) {
|
|
81
|
+
node.children = deepDeleteTree(node.children, option, valueField);
|
|
82
|
+
}
|
|
83
|
+
if ((node.children && node.children.length > 0) ||
|
|
84
|
+
node[valueField] !== undefined) {
|
|
85
|
+
arr.push(node);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return arr;
|
|
89
|
+
}
|
|
90
|
+
var BaseResultTreeList = /** @class */ (function (_super) {
|
|
91
|
+
__extends(BaseResultTreeList, _super);
|
|
92
|
+
function BaseResultTreeList() {
|
|
93
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
|
94
|
+
_this.state = {
|
|
95
|
+
searching: false,
|
|
96
|
+
treeOptions: [],
|
|
97
|
+
searchTreeOptions: []
|
|
98
|
+
};
|
|
99
|
+
return _this;
|
|
100
|
+
}
|
|
101
|
+
BaseResultTreeList.itemRender = function (option) {
|
|
102
|
+
return React__default.createElement("span", null, "".concat(option.scopeLabel || '').concat(option.label));
|
|
103
|
+
};
|
|
104
|
+
BaseResultTreeList.getDerivedStateFromProps = function (props) {
|
|
105
|
+
var newOptions = getResultOptions(props.value, props.options, props.valueField);
|
|
106
|
+
return {
|
|
107
|
+
treeOptions: cloneDeep(newOptions)
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
BaseResultTreeList.prototype.domSearchRef = function (ref) {
|
|
111
|
+
while (ref && ref.getWrappedInstance) {
|
|
112
|
+
ref = ref.getWrappedInstance();
|
|
113
|
+
}
|
|
114
|
+
this.searchRef = ref;
|
|
115
|
+
};
|
|
116
|
+
// 删除非选中节点
|
|
117
|
+
BaseResultTreeList.prototype.deleteTreeChecked = function (option) {
|
|
118
|
+
var _b = this.props, _c = _b.value, value = _c === void 0 ? [] : _c, onChange = _b.onChange, valueField = _b.valueField;
|
|
119
|
+
var _d = this.state, searching = _d.searching, treeOptions = _d.treeOptions;
|
|
120
|
+
var temNode = [];
|
|
121
|
+
var cb = function (node) {
|
|
122
|
+
// 对比时去掉 parent,因为其无限嵌套
|
|
123
|
+
if (isEqual(omit(node, 'parent'), omit(option, 'parent'))) {
|
|
124
|
+
temNode = [node];
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
deepTree(treeOptions || [], cb);
|
|
128
|
+
var arr = [];
|
|
129
|
+
var cb2 = function (node) {
|
|
130
|
+
if (node.isChecked && node[valueField]) {
|
|
131
|
+
arr.push(node);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
deepTree(temNode, cb2);
|
|
135
|
+
onChange &&
|
|
136
|
+
onChange(value.filter(function (item) {
|
|
137
|
+
return !arr.find(function (arrItem) {
|
|
138
|
+
// 对比时去掉 parent,因为其无限嵌套,且不相等
|
|
139
|
+
return isEqual(omit(arrItem, ['isChecked', 'childrens', 'parent']), omit(item, 'parent'));
|
|
140
|
+
});
|
|
141
|
+
}));
|
|
142
|
+
// 搜索时,重新生成树
|
|
143
|
+
searching && this.deleteResultTreeNode(option);
|
|
144
|
+
};
|
|
145
|
+
// 搜索树点击删除时,删除对应节点
|
|
146
|
+
BaseResultTreeList.prototype.deleteResultTreeNode = function (option) {
|
|
147
|
+
var arr = deepDeleteTree(cloneDeep(this.state.searchTreeOptions) || [], option, this.props.valueField);
|
|
148
|
+
this.setState({ searchTreeOptions: arr });
|
|
149
|
+
};
|
|
150
|
+
BaseResultTreeList.prototype.search = function (inputValue) {
|
|
151
|
+
// 结果为空,直接清空
|
|
152
|
+
if (!inputValue) {
|
|
153
|
+
this.clearSearch();
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
var _b = this.props, valueField = _b.valueField, onSearch = _b.onSearch;
|
|
157
|
+
var temOptions = this.state.treeOptions || [];
|
|
158
|
+
var cb = function (node) {
|
|
159
|
+
node.isChecked = false;
|
|
160
|
+
return true;
|
|
161
|
+
};
|
|
162
|
+
deepTree(temOptions, cb);
|
|
163
|
+
var callBack = function (node) { return onSearch === null || onSearch === void 0 ? void 0 : onSearch(inputValue, node); };
|
|
164
|
+
temOptions &&
|
|
165
|
+
temOptions.forEach(function (op) {
|
|
166
|
+
getDeep(op, callBack, [op], valueField);
|
|
167
|
+
});
|
|
168
|
+
this.setState({
|
|
169
|
+
searching: true,
|
|
170
|
+
searchTreeOptions: deepCheckedTreeNode(temOptions)
|
|
171
|
+
});
|
|
172
|
+
};
|
|
173
|
+
BaseResultTreeList.prototype.clearSearch = function () {
|
|
174
|
+
this.setState({
|
|
175
|
+
searching: false,
|
|
176
|
+
searchTreeOptions: []
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
BaseResultTreeList.prototype.clearInput = function () {
|
|
180
|
+
var _b, _c;
|
|
181
|
+
if (this.props.searchable) {
|
|
182
|
+
(_c = (_b = this.searchRef) === null || _b === void 0 ? void 0 : _b.clearInput) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
183
|
+
}
|
|
184
|
+
this.clearSearch();
|
|
185
|
+
};
|
|
186
|
+
BaseResultTreeList.prototype.renderTree = function () {
|
|
187
|
+
var _this = this;
|
|
188
|
+
var _b = this.props, className = _b.className, cx = _b.classnames, value = _b.value, valueField = _b.valueField, itemRender = _b.itemRender, __ = _b.translate, placeholder = _b.placeholder, virtualThreshold = _b.virtualThreshold; _b.itemHeight; var loadingConfig = _b.loadingConfig, testIdBuilder = _b.testIdBuilder;
|
|
189
|
+
var _c = this.state, treeOptions = _c.treeOptions, searching = _c.searching, searchTreeOptions = _c.searchTreeOptions;
|
|
190
|
+
return (React__default.createElement("div", { className: cx('ResultTreeList', className) }, Array.isArray(value) && value.length ? (React__default.createElement(Tree, { className: cx('Transfer-tree'), options: !searching ? treeOptions : searchTreeOptions, valueField: valueField, value: [], onChange: noop, showIcon: false, itemRender: itemRender, removable: true, loadingConfig: loadingConfig, onDelete: function (option) { return _this.deleteTreeChecked(option); }, virtualThreshold: virtualThreshold,
|
|
191
|
+
// itemHeight={itemHeight}
|
|
192
|
+
testIdBuilder: testIdBuilder })) : (React__default.createElement("div", { className: cx('Selections-placeholder') }, __(placeholder)))));
|
|
193
|
+
};
|
|
194
|
+
BaseResultTreeList.prototype.render = function () {
|
|
195
|
+
var _b = this.props, cx = _b.classnames, className = _b.className, title = _b.title, searchable = _b.searchable, __ = _b.translate, _c = _b.searchPlaceholder, searchPlaceholder = _c === void 0 ? __('Transfer.searchKeyword') : _c;
|
|
196
|
+
return (React__default.createElement("div", { className: cx('Selections', className) },
|
|
197
|
+
title ? React__default.createElement("div", { className: cx('Selections-title') }, title) : null,
|
|
198
|
+
searchable ? (React__default.createElement(TransferSearch, { ref: this.domSearchRef, placeholder: searchPlaceholder, onSearch: this.search, onCancelSearch: this.clearSearch })) : null,
|
|
199
|
+
this.renderTree()));
|
|
200
|
+
};
|
|
201
|
+
var _a;
|
|
202
|
+
_a = BaseResultTreeList;
|
|
203
|
+
BaseResultTreeList.defaultProps = {
|
|
204
|
+
placeholder: 'placeholder.selectData',
|
|
205
|
+
itemRender: _a.itemRender
|
|
206
|
+
};
|
|
207
|
+
__decorate([
|
|
208
|
+
autobind,
|
|
209
|
+
__metadata("design:type", Function),
|
|
210
|
+
__metadata("design:paramtypes", [Object]),
|
|
211
|
+
__metadata("design:returntype", void 0)
|
|
212
|
+
], BaseResultTreeList.prototype, "domSearchRef", null);
|
|
213
|
+
__decorate([
|
|
214
|
+
autobind,
|
|
215
|
+
__metadata("design:type", Function),
|
|
216
|
+
__metadata("design:paramtypes", [Object]),
|
|
217
|
+
__metadata("design:returntype", void 0)
|
|
218
|
+
], BaseResultTreeList.prototype, "deleteTreeChecked", null);
|
|
219
|
+
__decorate([
|
|
220
|
+
autobind,
|
|
221
|
+
__metadata("design:type", Function),
|
|
222
|
+
__metadata("design:paramtypes", [String]),
|
|
223
|
+
__metadata("design:returntype", void 0)
|
|
224
|
+
], BaseResultTreeList.prototype, "search", null);
|
|
225
|
+
__decorate([
|
|
226
|
+
autobind,
|
|
227
|
+
__metadata("design:type", Function),
|
|
228
|
+
__metadata("design:paramtypes", []),
|
|
229
|
+
__metadata("design:returntype", void 0)
|
|
230
|
+
], BaseResultTreeList.prototype, "clearSearch", null);
|
|
231
|
+
__decorate([
|
|
232
|
+
autobind,
|
|
233
|
+
__metadata("design:type", Function),
|
|
234
|
+
__metadata("design:paramtypes", []),
|
|
235
|
+
__metadata("design:returntype", void 0)
|
|
236
|
+
], BaseResultTreeList.prototype, "clearInput", null);
|
|
237
|
+
return BaseResultTreeList;
|
|
238
|
+
}(React__default.Component));
|
|
239
|
+
var ResultTreeList = themeable(localeable(BaseResultTreeList));
|
|
240
|
+
|
|
241
|
+
export { BaseResultTreeList, ResultTreeList as default };
|