amis-ui 2.2.0 → 2.3.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.js +1 -1
- package/esm/components/Alert.js +1 -1
- package/esm/components/Alert2.js +1 -1
- package/esm/components/AnchorNav.js +2 -2
- package/esm/components/ArrayInput.js +1 -1
- package/esm/components/AsideNav.d.ts +11 -11
- package/esm/components/AsideNav.js +1 -1
- package/esm/components/AssociatedSelection.d.ts +40 -40
- package/esm/components/AssociatedSelection.js +3 -3
- package/esm/components/Avatar.js +1 -1
- package/esm/components/Badge.js +1 -1
- package/esm/components/BaiduMapPicker.js +1 -1
- package/esm/components/BarCode.js +1 -1
- package/esm/components/Breadcrumb.js +1 -1
- package/esm/components/Button.js +4 -5
- package/esm/components/CalendarMobile.js +1 -1
- package/esm/components/Card.js +1 -1
- package/esm/components/Cascader.js +1 -1
- package/esm/components/ChainedSelection.d.ts +40 -40
- package/esm/components/ChainedSelection.js +7 -5
- package/esm/components/Checkbox.js +1 -1
- package/esm/components/CityArea.js +1 -1
- package/esm/components/CityDB.js +1 -1
- package/esm/components/CodeMirror.js +1 -1
- package/esm/components/Collapse.js +1 -1
- package/esm/components/CollapseGroup.js +1 -1
- package/esm/components/ColorPicker.js +1 -1
- package/esm/components/ContextMenu.js +1 -1
- package/esm/components/DatePicker.js +1 -1
- package/esm/components/DateRangePicker.js +4 -2
- package/esm/components/Drawer.js +1 -1
- package/esm/components/Editor.js +1 -1
- package/esm/components/Form.js +1 -1
- package/esm/components/FormField.js +1 -1
- package/esm/components/GridNav.js +1 -1
- package/esm/components/GroupedSelection.d.ts +41 -41
- package/esm/components/GroupedSelection.js +12 -5
- package/esm/components/Html.js +1 -1
- package/esm/components/ImageGallery.d.ts +10 -3
- package/esm/components/ImageGallery.js +18 -6
- package/esm/components/Input.js +1 -1
- package/esm/components/InputBox.js +1 -1
- package/esm/components/InputBoxWithSuggestion.js +1 -1
- package/esm/components/Layout.js +1 -1
- package/esm/components/Link.js +1 -1
- package/esm/components/ListGroup.js +1 -1
- package/esm/components/ListMenu.js +1 -1
- package/esm/components/LocationPicker.js +1 -1
- package/esm/components/Markdown.js +1 -1
- package/esm/components/Modal.d.ts +18 -18
- package/esm/components/Modal.js +1 -1
- package/esm/components/ModalManager.js +1 -1
- package/esm/components/NumberInput.d.ts +19 -10
- package/esm/components/NumberInput.js +38 -9
- package/esm/components/Pagination.js +2 -2
- package/esm/components/Picker.js +1 -1
- package/esm/components/PickerColumn.js +1 -1
- package/esm/components/PickerContainer.js +1 -1
- package/esm/components/PopOverContainer.js +1 -1
- package/esm/components/PopUp.js +1 -1
- package/esm/components/Progress.js +1 -1
- package/esm/components/PullRefresh.js +1 -1
- package/esm/components/Radios.js +1 -1
- package/esm/components/Range.js +5 -3
- package/esm/components/Rating.js +1 -1
- package/esm/components/ResultBox.js +1 -1
- package/esm/components/ResultList.d.ts +45 -42
- package/esm/components/ResultList.js +10 -8
- package/esm/components/ResultTableList.d.ts +41 -40
- package/esm/components/ResultTableList.js +3 -3
- package/esm/components/ResultTreeList.d.ts +41 -40
- package/esm/components/ResultTreeList.js +4 -4
- package/esm/components/RichText.js +1 -1
- package/esm/components/SearchBox.js +1 -1
- package/esm/components/Select.d.ts +193 -193
- package/esm/components/Select.js +1 -1
- package/esm/components/Selection.d.ts +42 -40
- package/esm/components/Selection.js +6 -3
- package/esm/components/SparkLine.js +1 -1
- package/esm/components/Spinner.d.ts +12 -0
- package/esm/components/Spinner.js +111 -23
- package/esm/components/Steps.js +1 -1
- package/esm/components/Switch.js +1 -1
- package/esm/components/TableSelection.d.ts +40 -40
- package/esm/components/TableSelection.js +1 -1
- package/esm/components/Tabs.js +1 -1
- package/esm/components/TabsTransfer.js +1 -1
- package/esm/components/TabsTransferPicker.js +1 -1
- package/esm/components/Tag.js +1 -1
- package/esm/components/Textarea.js +2 -2
- package/esm/components/Timeline.js +1 -1
- package/esm/components/TimelineItem.js +1 -1
- package/esm/components/Tinymce.js +2 -2
- package/esm/components/TitleBar.js +1 -1
- package/esm/components/Toast.js +1 -1
- package/esm/components/Tooltip.js +1 -1
- package/esm/components/TooltipWrapper.js +1 -1
- package/esm/components/Transfer.d.ts +50 -50
- package/esm/components/Transfer.js +12 -12
- package/esm/components/TransferDropDown.d.ts +40 -40
- package/esm/components/TransferDropDown.js +1 -1
- package/esm/components/TransferPicker.js +1 -1
- package/esm/components/TransferSearch.d.ts +40 -42
- package/esm/components/TransferSearch.js +2 -8
- package/esm/components/Tree.js +3 -2
- package/esm/components/TreeSelection.d.ts +40 -40
- package/esm/components/TreeSelection.js +1 -1
- package/esm/components/UserSelect.d.ts +5 -1
- package/esm/components/UserSelect.js +87 -28
- package/esm/components/UserTabSelect.d.ts +4 -3
- package/esm/components/UserTabSelect.js +64 -18
- package/esm/components/WithRemoteConfig.js +1 -1
- package/esm/components/WithStore.js +1 -1
- package/esm/components/calendar/Calendar.js +1 -1
- package/esm/components/calendar/CalendarContainer.js +1 -1
- package/esm/components/calendar/DaysView.js +1 -1
- package/esm/components/calendar/MonthsView.js +1 -1
- package/esm/components/calendar/QuartersView.js +1 -1
- package/esm/components/calendar/TimeView.js +1 -1
- package/esm/components/calendar/YearsView.js +1 -1
- package/esm/components/condition-builder/Expression.d.ts +1 -0
- package/esm/components/condition-builder/Expression.js +3 -3
- package/esm/components/condition-builder/Field.d.ts +2 -1
- package/esm/components/condition-builder/Field.js +9 -5
- package/esm/components/condition-builder/Formula.js +1 -1
- package/esm/components/condition-builder/Func.js +1 -1
- package/esm/components/condition-builder/Group.d.ts +1 -0
- package/esm/components/condition-builder/Group.js +3 -3
- package/esm/components/condition-builder/GroupOrItem.d.ts +1 -0
- package/esm/components/condition-builder/GroupOrItem.js +3 -3
- package/esm/components/condition-builder/InputSwitch.js +1 -1
- package/esm/components/condition-builder/Item.d.ts +1 -0
- package/esm/components/condition-builder/Item.js +3 -3
- package/esm/components/condition-builder/Value.js +1 -1
- package/esm/components/condition-builder/config.js +1 -1
- package/esm/components/condition-builder/index.d.ts +1 -0
- package/esm/components/condition-builder/index.js +3 -3
- package/esm/components/formula/Editor.d.ts +2 -0
- package/esm/components/formula/Editor.js +17 -6
- package/esm/components/formula/FuncList.js +1 -1
- package/esm/components/formula/Picker.d.ts +65 -54
- package/esm/components/formula/Picker.js +22 -9
- package/esm/components/formula/VariableList.js +1 -1
- package/esm/components/formula/plugin.d.ts +1 -1
- package/esm/components/formula/plugin.js +6 -4
- package/esm/components/icons.js +1 -1
- package/esm/components/json-schema/Array.js +1 -1
- package/esm/components/json-schema/Item.js +1 -1
- package/esm/components/json-schema/Object.js +1 -1
- package/esm/components/json-schema/index.js +1 -1
- package/esm/components/schema-editor/Array.js +1 -1
- package/esm/components/schema-editor/Common.js +1 -1
- package/esm/components/schema-editor/Item.js +1 -1
- package/esm/components/schema-editor/Object.js +1 -1
- package/esm/components/schema-editor/SchemaVariableList.js +1 -1
- package/esm/components/schema-editor/SchemaVariableListPicker.js +1 -1
- package/esm/components/schema-editor/index.js +1 -1
- package/esm/components/table/Cell.js +1 -1
- package/esm/components/table/HeadCellDropDown.js +1 -1
- package/esm/components/table/HeadCellFilter.js +1 -1
- package/esm/components/table/HeadCellSelect.js +1 -1
- package/esm/components/table/HeadCellSort.js +1 -1
- package/esm/components/table/ItemActionsWrapper.js +1 -1
- package/esm/components/table/index.d.ts +49 -43
- package/esm/components/table/index.js +98 -51
- package/esm/components/virtual-list/SizeAndPositionManager.js +1 -1
- package/esm/components/virtual-list/constants.js +1 -1
- package/esm/components/virtual-list/index.js +1 -1
- package/esm/hooks/use-set-state.js +1 -1
- package/esm/hooks/use-touch.js +1 -1
- package/esm/hooks/use-update-effect.js +1 -1
- package/esm/hooks/use-validation-resolver.js +1 -1
- package/esm/icons/alert-danger.svg.js +1 -1
- package/esm/icons/alert-info.svg.js +1 -1
- package/esm/icons/alert-success.svg.js +1 -1
- package/esm/icons/alert-warning.svg.js +1 -1
- package/esm/icons/back.svg.js +1 -1
- package/esm/icons/calendar.svg.js +1 -1
- package/esm/icons/caret.svg.js +1 -1
- package/esm/icons/check-circle.svg.js +1 -1
- package/esm/icons/check.svg.js +1 -1
- package/esm/icons/clock.svg.js +1 -1
- package/esm/icons/close-small.svg.js +1 -1
- package/esm/icons/close.svg.js +1 -1
- package/esm/icons/cloud-upload.svg.js +1 -1
- package/esm/icons/column-filter.svg.js +1 -1
- package/esm/icons/columns.svg.js +1 -1
- package/esm/icons/compress-alt.svg.js +1 -1
- package/esm/icons/copy.svg.js +1 -1
- package/esm/icons/date.svg.js +1 -1
- package/esm/icons/department.svg.js +1 -1
- package/esm/icons/desk-empty.svg.js +1 -1
- package/esm/icons/dot.svg.js +1 -1
- package/esm/icons/down-arrow-bold.svg.js +1 -1
- package/esm/icons/down.svg.js +1 -1
- package/esm/icons/download.svg.js +1 -1
- package/esm/icons/drag-bar.svg.js +1 -1
- package/esm/icons/drag.svg.js +1 -1
- package/esm/icons/edit.svg.js +1 -1
- package/esm/icons/ellipsis-v.svg.js +1 -1
- package/esm/icons/enter.svg.js +1 -1
- package/esm/icons/exchange.svg.js +1 -1
- package/esm/icons/expand-alt.svg.js +1 -1
- package/esm/icons/fail.svg.js +1 -1
- package/esm/icons/file.svg.js +1 -1
- package/esm/icons/filter.svg.js +1 -1
- package/esm/icons/folder.svg.js +1 -1
- package/esm/icons/function.svg.js +1 -1
- package/esm/icons/home.svg.js +1 -1
- package/esm/icons/image.svg.js +1 -1
- package/esm/icons/info-circle.svg.js +1 -1
- package/esm/icons/info.svg.js +1 -1
- package/esm/icons/input-clear.svg.js +1 -1
- package/esm/icons/invisible.svg.js +1 -1
- package/esm/icons/left-arrow.svg.js +1 -1
- package/esm/icons/loading-outline.svg.js +1 -1
- package/esm/icons/location.svg.js +1 -1
- package/esm/icons/menu.svg.js +1 -1
- package/esm/icons/minus.svg.js +1 -1
- package/esm/icons/move.svg.js +1 -1
- package/esm/icons/mute.svg.js +1 -1
- package/esm/icons/new-edit.svg.js +1 -1
- package/esm/icons/pause.svg.js +1 -1
- package/esm/icons/pencil.svg.js +1 -1
- package/esm/icons/play.svg.js +1 -1
- package/esm/icons/plus-cicle.svg.js +1 -1
- package/esm/icons/plus-fine.svg.js +1 -1
- package/esm/icons/plus.svg.js +1 -1
- package/esm/icons/post.svg.js +1 -1
- package/esm/icons/question-mark.svg.js +1 -1
- package/esm/icons/question.svg.js +1 -1
- package/esm/icons/redo.svg.js +1 -1
- package/esm/icons/refresh.svg.js +1 -1
- package/esm/icons/reload.svg.js +1 -1
- package/esm/icons/remove.svg.js +1 -1
- package/esm/icons/retry.svg.js +1 -1
- package/esm/icons/right-arrow-bold.svg.js +1 -1
- package/esm/icons/right-arrow.svg.js +1 -1
- package/esm/icons/right-double-arrow.svg.js +1 -1
- package/esm/icons/role.svg.js +1 -1
- package/esm/icons/rotate-left.svg.js +1 -1
- package/esm/icons/rotate-right.svg.js +1 -1
- package/esm/icons/scale-origin.svg.js +1 -1
- package/esm/icons/schedule.svg.js +1 -1
- package/esm/icons/search.svg.js +1 -1
- package/esm/icons/setting.svg.js +1 -1
- package/esm/icons/slider-handle-icon.svg.js +1 -1
- package/esm/icons/sort-asc.svg.js +1 -1
- package/esm/icons/sort-default.svg.js +1 -1
- package/esm/icons/sort-desc.svg.js +1 -1
- package/esm/icons/star.svg.js +1 -1
- package/esm/icons/status-close.svg.js +1 -1
- package/esm/icons/status-fail.svg.js +1 -1
- package/esm/icons/status-info.svg.js +1 -1
- package/esm/icons/status-success.svg.js +1 -1
- package/esm/icons/status-warning.svg.js +1 -1
- package/esm/icons/steps-finsh.svg.js +1 -1
- package/esm/icons/success.svg.js +1 -1
- package/esm/icons/transparent.svg.js +1 -1
- package/esm/icons/trash.svg.js +1 -1
- package/esm/icons/tree-down.svg.js +1 -1
- package/esm/icons/undo.svg.js +1 -1
- package/esm/icons/upload.svg.js +1 -1
- package/esm/icons/user-remove.svg.js +1 -1
- package/esm/icons/view.svg.js +1 -1
- package/esm/icons/volume.svg.js +1 -1
- package/esm/icons/warning-mark.svg.js +1 -1
- package/esm/icons/warning.svg.js +1 -1
- package/esm/icons/window-restore.svg.js +1 -1
- package/esm/icons/zoom-in.svg.js +1 -1
- package/esm/icons/zoom-out.svg.js +1 -1
- package/esm/index.js +1 -1
- package/esm/locale/de-DE.js +7 -2
- package/esm/locale/en-US.js +7 -3
- package/esm/locale/zh-CN.js +7 -3
- package/esm/themes/ang.js +1 -1
- package/esm/themes/antd.js +1 -1
- package/esm/themes/cxd.js +1 -1
- package/esm/themes/dark.js +1 -1
- package/lib/components/404.js +1 -1
- package/lib/components/Alert.js +1 -1
- package/lib/components/Alert2.d.ts +10 -10
- package/lib/components/Alert2.js +1 -1
- package/lib/components/AnchorNav.d.ts +10 -10
- package/lib/components/AnchorNav.js +2 -2
- package/lib/components/ArrayInput.d.ts +40 -40
- package/lib/components/ArrayInput.js +1 -1
- package/lib/components/AsideNav.d.ts +11 -11
- package/lib/components/AsideNav.js +1 -1
- package/lib/components/AssociatedSelection.d.ts +40 -40
- package/lib/components/AssociatedSelection.js +3 -3
- package/lib/components/Avatar.d.ts +10 -10
- package/lib/components/Avatar.js +1 -1
- package/lib/components/Badge.js +1 -1
- package/lib/components/BaiduMapPicker.js +1 -1
- package/lib/components/BarCode.js +1 -1
- package/lib/components/Breadcrumb.js +1 -1
- package/lib/components/Button.d.ts +10 -10
- package/lib/components/Button.js +4 -5
- package/lib/components/CalendarMobile.d.ts +40 -40
- package/lib/components/CalendarMobile.js +1 -1
- package/lib/components/Card.d.ts +10 -10
- package/lib/components/Card.js +1 -1
- package/lib/components/Cascader.js +1 -1
- package/lib/components/ChainedSelection.d.ts +40 -40
- package/lib/components/ChainedSelection.js +7 -5
- package/lib/components/Checkbox.d.ts +10 -10
- package/lib/components/Checkbox.js +1 -1
- package/lib/components/CityArea.js +1 -1
- package/lib/components/CityDB.js +1 -1
- package/lib/components/CodeMirror.js +1 -1
- package/lib/components/Collapse.d.ts +10 -10
- package/lib/components/Collapse.js +1 -1
- package/lib/components/CollapseGroup.js +1 -1
- package/lib/components/ColorPicker.d.ts +40 -40
- package/lib/components/ColorPicker.js +1 -1
- package/lib/components/ContextMenu.js +1 -1
- package/lib/components/DatePicker.d.ts +40 -40
- package/lib/components/DatePicker.js +1 -1
- package/lib/components/DateRangePicker.d.ts +40 -40
- package/lib/components/DateRangePicker.js +4 -2
- package/lib/components/Drawer.d.ts +10 -10
- package/lib/components/Drawer.js +1 -1
- package/lib/components/Editor.d.ts +40 -40
- package/lib/components/Editor.js +1 -1
- package/lib/components/Form.js +1 -1
- package/lib/components/FormField.js +1 -1
- package/lib/components/GridNav.js +1 -1
- package/lib/components/GroupedSelection.d.ts +41 -41
- package/lib/components/GroupedSelection.js +12 -5
- package/lib/components/Html.js +1 -1
- package/lib/components/ImageGallery.d.ts +10 -3
- package/lib/components/ImageGallery.js +18 -6
- package/lib/components/Input.js +1 -1
- package/lib/components/InputBox.d.ts +10 -10
- package/lib/components/InputBox.js +1 -1
- package/lib/components/InputBoxWithSuggestion.js +1 -1
- package/lib/components/Layout.js +1 -1
- package/lib/components/Link.js +1 -1
- package/lib/components/ListGroup.d.ts +10 -10
- package/lib/components/ListGroup.js +1 -1
- package/lib/components/ListMenu.d.ts +40 -40
- package/lib/components/ListMenu.js +1 -1
- package/lib/components/LocationPicker.d.ts +40 -40
- package/lib/components/LocationPicker.js +1 -1
- package/lib/components/Markdown.js +1 -1
- package/lib/components/Modal.d.ts +58 -58
- package/lib/components/Modal.js +1 -1
- package/lib/components/ModalManager.js +1 -1
- package/lib/components/MonthRangePicker.d.ts +40 -40
- package/lib/components/NumberInput.d.ts +19 -10
- package/lib/components/NumberInput.js +38 -9
- package/lib/components/Pagination.js +2 -2
- package/lib/components/Picker.js +1 -1
- package/lib/components/PickerColumn.js +1 -1
- package/lib/components/PickerContainer.js +1 -1
- package/lib/components/PopOverContainer.js +1 -1
- package/lib/components/PopUp.js +1 -1
- package/lib/components/Progress.d.ts +10 -10
- package/lib/components/Progress.js +1 -1
- package/lib/components/PullRefresh.js +1 -1
- package/lib/components/Radios.d.ts +10 -10
- package/lib/components/Radios.js +1 -1
- package/lib/components/Range.js +5 -3
- package/lib/components/Rating.d.ts +10 -10
- package/lib/components/Rating.js +1 -1
- package/lib/components/ResultBox.d.ts +40 -40
- package/lib/components/ResultBox.js +1 -1
- package/lib/components/ResultList.d.ts +45 -42
- package/lib/components/ResultList.js +10 -8
- package/lib/components/ResultTableList.d.ts +41 -40
- package/lib/components/ResultTableList.js +3 -3
- package/lib/components/ResultTreeList.d.ts +41 -40
- package/lib/components/ResultTreeList.js +4 -4
- package/lib/components/RichText.js +1 -1
- package/lib/components/SearchBox.d.ts +40 -40
- package/lib/components/SearchBox.js +1 -1
- package/lib/components/Select.d.ts +193 -193
- package/lib/components/Select.js +1 -1
- package/lib/components/Selection.d.ts +42 -40
- package/lib/components/Selection.js +6 -3
- package/lib/components/SparkLine.d.ts +40 -40
- package/lib/components/SparkLine.js +1 -1
- package/lib/components/Spinner.d.ts +22 -10
- package/lib/components/Spinner.js +111 -23
- package/lib/components/Steps.js +1 -1
- package/lib/components/Switch.d.ts +10 -10
- package/lib/components/Switch.js +1 -1
- package/lib/components/TableSelection.d.ts +40 -40
- package/lib/components/TableSelection.js +1 -1
- package/lib/components/Tabs.d.ts +40 -40
- package/lib/components/Tabs.js +1 -1
- package/lib/components/TabsTransfer.js +1 -1
- package/lib/components/TabsTransferPicker.js +1 -1
- package/lib/components/Tag.d.ts +10 -10
- package/lib/components/Tag.js +1 -1
- package/lib/components/Textarea.d.ts +40 -40
- package/lib/components/Textarea.js +2 -2
- package/lib/components/Timeline.js +1 -1
- package/lib/components/TimelineItem.js +1 -1
- package/lib/components/Tinymce.js +2 -2
- package/lib/components/TitleBar.js +1 -1
- package/lib/components/Toast.js +1 -1
- package/lib/components/Tooltip.js +1 -1
- package/lib/components/TooltipWrapper.js +1 -1
- package/lib/components/Transfer.d.ts +50 -50
- package/lib/components/Transfer.js +12 -12
- package/lib/components/TransferDropDown.d.ts +40 -40
- package/lib/components/TransferDropDown.js +1 -1
- package/lib/components/TransferPicker.js +1 -1
- package/lib/components/TransferSearch.d.ts +40 -42
- package/lib/components/TransferSearch.js +2 -8
- package/lib/components/Tree.d.ts +40 -40
- package/lib/components/Tree.js +3 -2
- package/lib/components/TreeSelection.d.ts +40 -40
- package/lib/components/TreeSelection.js +1 -1
- package/lib/components/UserSelect.d.ts +45 -41
- package/lib/components/UserSelect.js +86 -27
- package/lib/components/UserTabSelect.d.ts +44 -43
- package/lib/components/UserTabSelect.js +64 -18
- package/lib/components/WithRemoteConfig.js +1 -1
- package/lib/components/WithStore.js +1 -1
- package/lib/components/calendar/Calendar.js +1 -1
- package/lib/components/calendar/CalendarContainer.js +1 -1
- package/lib/components/calendar/DaysView.js +1 -1
- package/lib/components/calendar/MonthsView.js +1 -1
- package/lib/components/calendar/QuartersView.js +1 -1
- package/lib/components/calendar/TimeView.js +1 -1
- package/lib/components/calendar/YearsView.js +1 -1
- package/lib/components/condition-builder/Expression.d.ts +1 -0
- package/lib/components/condition-builder/Expression.js +3 -3
- package/lib/components/condition-builder/Field.d.ts +2 -1
- package/lib/components/condition-builder/Field.js +9 -5
- package/lib/components/condition-builder/Formula.js +1 -1
- package/lib/components/condition-builder/Func.js +1 -1
- package/lib/components/condition-builder/Group.d.ts +1 -0
- package/lib/components/condition-builder/Group.js +3 -3
- package/lib/components/condition-builder/GroupOrItem.d.ts +1 -0
- package/lib/components/condition-builder/GroupOrItem.js +3 -3
- package/lib/components/condition-builder/InputSwitch.js +1 -1
- package/lib/components/condition-builder/Item.d.ts +1 -0
- package/lib/components/condition-builder/Item.js +3 -3
- package/lib/components/condition-builder/Value.js +1 -1
- package/lib/components/condition-builder/config.js +1 -1
- package/lib/components/condition-builder/index.d.ts +1 -0
- package/lib/components/condition-builder/index.js +3 -3
- package/lib/components/formula/Editor.d.ts +42 -40
- package/lib/components/formula/Editor.js +17 -6
- package/lib/components/formula/FuncList.js +1 -1
- package/lib/components/formula/Picker.d.ts +65 -54
- package/lib/components/formula/Picker.js +22 -9
- package/lib/components/formula/VariableList.js +1 -1
- package/lib/components/formula/plugin.d.ts +1 -1
- package/lib/components/formula/plugin.js +6 -4
- package/lib/components/icons.js +1 -1
- package/lib/components/json-schema/Array.js +1 -1
- package/lib/components/json-schema/Item.js +1 -1
- package/lib/components/json-schema/Object.js +1 -1
- package/lib/components/json-schema/index.js +1 -1
- package/lib/components/schema-editor/Array.js +1 -1
- package/lib/components/schema-editor/Common.js +1 -1
- package/lib/components/schema-editor/Item.js +1 -1
- package/lib/components/schema-editor/Object.js +1 -1
- package/lib/components/schema-editor/SchemaVariableList.js +1 -1
- package/lib/components/schema-editor/SchemaVariableListPicker.js +1 -1
- package/lib/components/schema-editor/index.d.ts +40 -40
- package/lib/components/schema-editor/index.js +1 -1
- package/lib/components/table/Cell.d.ts +40 -40
- package/lib/components/table/Cell.js +1 -1
- package/lib/components/table/HeadCellDropDown.js +1 -1
- package/lib/components/table/HeadCellFilter.js +1 -1
- package/lib/components/table/HeadCellSelect.js +1 -1
- package/lib/components/table/HeadCellSort.js +1 -1
- package/lib/components/table/ItemActionsWrapper.js +1 -1
- package/lib/components/table/index.d.ts +49 -43
- package/lib/components/table/index.js +98 -51
- package/lib/components/virtual-list/SizeAndPositionManager.js +1 -1
- package/lib/components/virtual-list/constants.js +1 -1
- package/lib/components/virtual-list/index.js +1 -1
- package/lib/helper.css +8335 -38
- package/lib/hooks/use-set-state.js +1 -1
- package/lib/hooks/use-touch.js +1 -1
- package/lib/hooks/use-update-effect.js +1 -1
- package/lib/hooks/use-validation-resolver.js +1 -1
- package/lib/icons/alert-danger.svg.js +1 -1
- package/lib/icons/alert-info.svg.js +1 -1
- package/lib/icons/alert-success.svg.js +1 -1
- package/lib/icons/alert-warning.svg.js +1 -1
- package/lib/icons/back.svg.js +1 -1
- package/lib/icons/calendar.svg.js +1 -1
- package/lib/icons/caret.svg.js +1 -1
- package/lib/icons/check-circle.svg.js +1 -1
- package/lib/icons/check.svg.js +1 -1
- package/lib/icons/clock.svg.js +1 -1
- package/lib/icons/close-small.svg.js +1 -1
- package/lib/icons/close.svg.js +1 -1
- package/lib/icons/cloud-upload.svg.js +1 -1
- package/lib/icons/column-filter.svg.js +1 -1
- package/lib/icons/columns.svg.js +1 -1
- package/lib/icons/compress-alt.svg.js +1 -1
- package/lib/icons/copy.svg.js +1 -1
- package/lib/icons/date.svg.js +1 -1
- package/lib/icons/department.svg.js +1 -1
- package/lib/icons/desk-empty.svg.js +1 -1
- package/lib/icons/dot.svg.js +1 -1
- package/lib/icons/down-arrow-bold.svg.js +1 -1
- package/lib/icons/down.svg.js +1 -1
- package/lib/icons/download.svg.js +1 -1
- package/lib/icons/drag-bar.svg.js +1 -1
- package/lib/icons/drag.svg.js +1 -1
- package/lib/icons/edit.svg.js +1 -1
- package/lib/icons/ellipsis-v.svg.js +1 -1
- package/lib/icons/enter.svg.js +1 -1
- package/lib/icons/exchange.svg.js +1 -1
- package/lib/icons/expand-alt.svg.js +1 -1
- package/lib/icons/fail.svg.js +1 -1
- package/lib/icons/file.svg.js +1 -1
- package/lib/icons/filter.svg.js +1 -1
- package/lib/icons/folder.svg.js +1 -1
- package/lib/icons/function.svg.js +1 -1
- package/lib/icons/home.svg.js +1 -1
- package/lib/icons/image.svg.js +1 -1
- package/lib/icons/info-circle.svg.js +1 -1
- package/lib/icons/info.svg.js +1 -1
- package/lib/icons/input-clear.svg.js +1 -1
- package/lib/icons/invisible.svg.js +1 -1
- package/lib/icons/left-arrow.svg.js +1 -1
- package/lib/icons/loading-outline.svg.js +1 -1
- package/lib/icons/location.svg.js +1 -1
- package/lib/icons/menu.svg.js +1 -1
- package/lib/icons/minus.svg.js +1 -1
- package/lib/icons/move.svg.js +1 -1
- package/lib/icons/mute.svg.js +1 -1
- package/lib/icons/new-edit.svg.js +1 -1
- package/lib/icons/pause.svg.js +1 -1
- package/lib/icons/pencil.svg.js +1 -1
- package/lib/icons/play.svg.js +1 -1
- package/lib/icons/plus-cicle.svg.js +1 -1
- package/lib/icons/plus-fine.svg.js +1 -1
- package/lib/icons/plus.svg.js +1 -1
- package/lib/icons/post.svg.js +1 -1
- package/lib/icons/question-mark.svg.js +1 -1
- package/lib/icons/question.svg.js +1 -1
- package/lib/icons/redo.svg.js +1 -1
- package/lib/icons/refresh.svg.js +1 -1
- package/lib/icons/reload.svg.js +1 -1
- package/lib/icons/remove.svg.js +1 -1
- package/lib/icons/retry.svg.js +1 -1
- package/lib/icons/right-arrow-bold.svg.js +1 -1
- package/lib/icons/right-arrow.svg.js +1 -1
- package/lib/icons/right-double-arrow.svg.js +1 -1
- package/lib/icons/role.svg.js +1 -1
- package/lib/icons/rotate-left.svg.js +1 -1
- package/lib/icons/rotate-right.svg.js +1 -1
- package/lib/icons/scale-origin.svg.js +1 -1
- package/lib/icons/schedule.svg.js +1 -1
- package/lib/icons/search.svg.js +1 -1
- package/lib/icons/setting.svg.js +1 -1
- package/lib/icons/slider-handle-icon.svg.js +1 -1
- package/lib/icons/sort-asc.svg.js +1 -1
- package/lib/icons/sort-default.svg.js +1 -1
- package/lib/icons/sort-desc.svg.js +1 -1
- package/lib/icons/star.svg.js +1 -1
- package/lib/icons/status-close.svg.js +1 -1
- package/lib/icons/status-fail.svg.js +1 -1
- package/lib/icons/status-info.svg.js +1 -1
- package/lib/icons/status-success.svg.js +1 -1
- package/lib/icons/status-warning.svg.js +1 -1
- package/lib/icons/steps-finsh.svg.js +1 -1
- package/lib/icons/success.svg.js +1 -1
- package/lib/icons/transparent.svg.js +1 -1
- package/lib/icons/trash.svg.js +1 -1
- package/lib/icons/tree-down.svg.js +1 -1
- package/lib/icons/undo.svg.js +1 -1
- package/lib/icons/upload.svg.js +1 -1
- package/lib/icons/user-remove.svg.js +1 -1
- package/lib/icons/view.svg.js +1 -1
- package/lib/icons/volume.svg.js +1 -1
- package/lib/icons/warning-mark.svg.js +1 -1
- package/lib/icons/warning.svg.js +1 -1
- package/lib/icons/window-restore.svg.js +1 -1
- package/lib/icons/zoom-in.svg.js +1 -1
- package/lib/icons/zoom-out.svg.js +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/de-DE.js +7 -2
- package/lib/locale/en-US.js +7 -3
- package/lib/locale/zh-CN.js +7 -3
- package/lib/scss/helper.scss.js +1 -1
- package/lib/scss/themes/ang.scss.js +1 -1
- package/lib/scss/themes/antd.scss.js +1 -1
- package/lib/scss/themes/cxd.scss.js +1 -1
- package/lib/scss/themes/dark.scss.js +1 -1
- package/lib/scss/themes/default.scss.js +1 -1
- package/lib/themes/ang.css +8847 -5617
- package/lib/themes/ang.js +1 -1
- package/lib/themes/antd.css +8955 -5731
- package/lib/themes/antd.js +1 -1
- package/lib/themes/cxd.css +8855 -5630
- package/lib/themes/cxd.js +1 -1
- package/lib/themes/dark.css +8940 -5709
- package/lib/themes/dark.js +1 -1
- package/lib/themes/default.css +8855 -5630
- package/package.json +22 -22
- package/scss/_mixins.scss +10 -0
- package/scss/_thirds.scss +6 -6
- package/scss/components/_anchor-nav.scss +9 -2
- package/scss/components/_collapse.scss +4 -4
- package/scss/components/_spinner.scss +6 -0
- package/scss/components/_table.scss +1 -1
- package/scss/components/form/_fieldset.scss +20 -0
- package/scss/components/form/_input-group.scss +5 -0
- package/scss/components/form/_selection.scss +6 -1
- package/scss/components/form/_textarea.scss +4 -2
- package/scss/components/form/_user-select.scss +35 -2
- package/scss/themes/_antd-variables.scss +4 -2
- package/scss/themes/_cxd-variables.scss +5 -1
- package/scss/themes/_dark-variables.scss +3 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-ui v2.
|
|
2
|
+
* amis-ui v2.3.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { __extends, __awaiter, __generator, __assign, __decorate, __metadata } from 'tslib';
|
|
7
7
|
import React__default from 'react';
|
|
8
|
-
import { findTree, autobind, themeable, localeable } from 'amis-core';
|
|
8
|
+
import { eachTree, findTree, autobind, themeable, localeable } from 'amis-core';
|
|
9
9
|
import './404.js';
|
|
10
10
|
import './Alert.js';
|
|
11
11
|
import './ContextMenu.js';
|
|
@@ -158,7 +158,7 @@ var UserSelect = /** @class */ (function (_super) {
|
|
|
158
158
|
var _b = this.props, options = _b.options, value = _b.value;
|
|
159
159
|
if (prevProps.options !== options) {
|
|
160
160
|
if (options &&
|
|
161
|
-
options.length
|
|
161
|
+
options.length &&
|
|
162
162
|
options[0].leftOptions &&
|
|
163
163
|
Array.isArray(options[0].children)) {
|
|
164
164
|
var leftOptions = options[0].leftOptions;
|
|
@@ -255,10 +255,10 @@ var UserSelect = /** @class */ (function (_super) {
|
|
|
255
255
|
this.sortable && this.sortable.destroy();
|
|
256
256
|
};
|
|
257
257
|
UserSelect.prototype.onOpen = function () {
|
|
258
|
-
var selection = this.
|
|
258
|
+
var selection = this.props.selection;
|
|
259
259
|
this.setState({
|
|
260
260
|
isOpened: true,
|
|
261
|
-
|
|
261
|
+
selection: selection || []
|
|
262
262
|
});
|
|
263
263
|
};
|
|
264
264
|
UserSelect.prototype.handleBack = function () {
|
|
@@ -267,6 +267,7 @@ var UserSelect = /** @class */ (function (_super) {
|
|
|
267
267
|
inputValue: '',
|
|
268
268
|
isSearch: false,
|
|
269
269
|
searchList: [],
|
|
270
|
+
selection: [],
|
|
270
271
|
breadList: []
|
|
271
272
|
});
|
|
272
273
|
};
|
|
@@ -316,6 +317,8 @@ var UserSelect = /** @class */ (function (_super) {
|
|
|
316
317
|
// 直接替换的option 肯定是数组
|
|
317
318
|
if (isReplace) {
|
|
318
319
|
selection = option;
|
|
320
|
+
// ResultBox 删除场景
|
|
321
|
+
onChange(selection);
|
|
319
322
|
}
|
|
320
323
|
else {
|
|
321
324
|
var selectionVals = selection.map(function (option) { return option[valueField]; });
|
|
@@ -332,23 +335,35 @@ var UserSelect = /** @class */ (function (_super) {
|
|
|
332
335
|
}
|
|
333
336
|
}
|
|
334
337
|
}
|
|
335
|
-
onChange(multiple ? selection : selection
|
|
338
|
+
// onChange(multiple ? selection : selection?.[0]);
|
|
336
339
|
this.setState({
|
|
337
340
|
selection: selection
|
|
338
341
|
});
|
|
339
342
|
return false;
|
|
340
343
|
};
|
|
344
|
+
UserSelect.prototype.handleSubmit = function () {
|
|
345
|
+
var _a = this.props, onChange = _a.onChange, multiple = _a.multiple;
|
|
346
|
+
var selection = this.state.selection;
|
|
347
|
+
var value = multiple ? selection : selection === null || selection === void 0 ? void 0 : selection[0];
|
|
348
|
+
onChange(value);
|
|
349
|
+
this.handleBack();
|
|
350
|
+
};
|
|
341
351
|
UserSelect.prototype.onDelete = function (option, isTemp) {
|
|
342
352
|
if (isTemp === void 0) { isTemp = false; }
|
|
343
|
-
var _a = this.props.valueField, valueField =
|
|
344
|
-
var
|
|
353
|
+
var _a = this.props, _b = _a.valueField, valueField = _b === void 0 ? 'value' : _b, controlled = _a.controlled, onChange = _a.onChange;
|
|
354
|
+
var _c = this.state, tempSelection = _c.tempSelection, selection = _c.selection;
|
|
345
355
|
var _selection = isTemp ? tempSelection : selection;
|
|
346
356
|
_selection = _selection.filter(function (item) { return item[valueField] !== option[valueField]; });
|
|
347
357
|
if (isTemp) {
|
|
348
358
|
this.setState({ tempSelection: _selection });
|
|
349
359
|
}
|
|
350
360
|
else {
|
|
351
|
-
|
|
361
|
+
if (controlled) {
|
|
362
|
+
onChange(option, false, true);
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
this.setState({ selection: _selection });
|
|
366
|
+
}
|
|
352
367
|
}
|
|
353
368
|
};
|
|
354
369
|
UserSelect.prototype.handleBreadChange = function (option, index) {
|
|
@@ -357,6 +372,16 @@ var UserSelect = /** @class */ (function (_super) {
|
|
|
357
372
|
breadList: breadList
|
|
358
373
|
});
|
|
359
374
|
};
|
|
375
|
+
UserSelect.prototype.handleSort = function () {
|
|
376
|
+
var _a;
|
|
377
|
+
var controlled = this.props.controlled;
|
|
378
|
+
this.setState({
|
|
379
|
+
isSelectOpened: true,
|
|
380
|
+
tempSelection: controlled
|
|
381
|
+
? ((_a = this.props.selection) === null || _a === void 0 ? void 0 : _a.slice()) || []
|
|
382
|
+
: this.state.selection.slice()
|
|
383
|
+
});
|
|
384
|
+
};
|
|
360
385
|
UserSelect.prototype.handleEdit = function () {
|
|
361
386
|
var _a = this.props, multiple = _a.multiple, onChange = _a.onChange, controlled = _a.controlled;
|
|
362
387
|
var _b = this.state, isEdit = _b.isEdit, tempSelection = _b.tempSelection;
|
|
@@ -383,12 +408,28 @@ var UserSelect = /** @class */ (function (_super) {
|
|
|
383
408
|
});
|
|
384
409
|
}
|
|
385
410
|
};
|
|
411
|
+
UserSelect.prototype.handleClear = function () {
|
|
412
|
+
this.setState({ tempSelection: [] });
|
|
413
|
+
};
|
|
414
|
+
UserSelect.prototype.getResult = function () {
|
|
415
|
+
var _a;
|
|
416
|
+
var _b = this.props, _c = _b.valueField, valueField = _c === void 0 ? 'value' : _c, _d = _b.labelField, labelField = _d === void 0 ? 'label' : _d, _e = _b.options, options = _e === void 0 ? [] : _e;
|
|
417
|
+
var _selection = ((_a = this.props.selection) === null || _a === void 0 ? void 0 : _a.slice()) || [];
|
|
418
|
+
eachTree(options, function (item) {
|
|
419
|
+
var res = _selection.find(function (item2) { return item2[valueField] === item[valueField]; });
|
|
420
|
+
if (res) {
|
|
421
|
+
res[labelField] = item[labelField];
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
return _selection;
|
|
425
|
+
};
|
|
386
426
|
UserSelect.prototype.renderIcon = function (option, isSelect) {
|
|
387
|
-
var _a
|
|
427
|
+
var _a;
|
|
428
|
+
var _b = this.props, _c = _b.labelField, labelField = _c === void 0 ? 'label' : _c, cx = _b.classnames, isRef = _b.isRef;
|
|
388
429
|
var isSearch = this.state.isSearch;
|
|
389
430
|
if (!option.icon) {
|
|
390
431
|
if (option.isRef || ((isSearch || isSelect) && isRef)) {
|
|
391
|
-
return (React__default.createElement("span", { className: cx('UserSelect-text-userPic') }, option[labelField].slice(0, 1)));
|
|
432
|
+
return (React__default.createElement("span", { className: cx('UserSelect-text-userPic') }, (_a = option[labelField]) === null || _a === void 0 ? void 0 : _a.slice(0, 1)));
|
|
392
433
|
}
|
|
393
434
|
else {
|
|
394
435
|
// 没有icon默认返回部门图标
|
|
@@ -478,11 +519,9 @@ var UserSelect = /** @class */ (function (_super) {
|
|
|
478
519
|
};
|
|
479
520
|
UserSelect.prototype.renderContent = function () {
|
|
480
521
|
var _this = this;
|
|
481
|
-
var _a = this.props, navTitle = _a.navTitle, showNav = _a.showNav, searchable = _a.searchable, searchPlaceholder = _a.searchPlaceholder, controlled = _a.controlled, _b = _a.labelField, labelField = _b === void 0 ? 'label' : _b, _c = _a.valueField, valueField = _c === void 0 ? 'value' : _c, cx = _a.classnames
|
|
522
|
+
var _a = this.props, navTitle = _a.navTitle, showNav = _a.showNav, searchable = _a.searchable, searchPlaceholder = _a.searchPlaceholder, controlled = _a.controlled, _b = _a.labelField, labelField = _b === void 0 ? 'label' : _b, _c = _a.valueField, valueField = _c === void 0 ? 'value' : _c, cx = _a.classnames, __ = _a.translate;
|
|
482
523
|
var _d = this.state, breadList = _d.breadList, options = _d.options, isSearch = _d.isSearch, searchList = _d.searchList, searchLoading = _d.searchLoading;
|
|
483
|
-
var selection = controlled
|
|
484
|
-
? this.props.selection || []
|
|
485
|
-
: this.state.selection;
|
|
524
|
+
var selection = controlled ? this.props.selection : this.state.selection;
|
|
486
525
|
return (React__default.createElement("div", { className: cx("UserSelect-wrap") },
|
|
487
526
|
showNav ? (React__default.createElement("div", { className: cx('UserSelect-navbar') },
|
|
488
527
|
React__default.createElement("span", { className: "left-arrow-box", onClick: this.handleBack },
|
|
@@ -508,12 +547,7 @@ var UserSelect = /** @class */ (function (_super) {
|
|
|
508
547
|
React__default.createElement("span", { className: cx('UserSelect-selectList-item-closeBox'), onClick: function () { return _this.onDelete(item); } },
|
|
509
548
|
React__default.createElement(Icon, { icon: "close", className: "icon" }))));
|
|
510
549
|
})),
|
|
511
|
-
React__default.createElement("span", { className: cx('UserSelect-selectSort-box'), onClick:
|
|
512
|
-
return _this.setState({
|
|
513
|
-
isSelectOpened: true,
|
|
514
|
-
tempSelection: selection.slice()
|
|
515
|
-
});
|
|
516
|
-
} },
|
|
550
|
+
React__default.createElement("span", { className: cx('UserSelect-selectSort-box'), onClick: this.handleSort },
|
|
517
551
|
React__default.createElement(Icon, { icon: "menu", className: cx('UserSelect-selectSort', 'icon') })))) : null,
|
|
518
552
|
isSearch ? (searchLoading ? (React__default.createElement("div", { className: cx("UserSelect-searchLoadingBox") },
|
|
519
553
|
React__default.createElement(Spinner, null))) : (React__default.createElement("div", { className: cx('UserSelect-searchResult') }, this.renderList(searchList, -1, true)))) : (React__default.createElement("div", { className: cx("UserSelect-contentBox") },
|
|
@@ -528,15 +562,16 @@ var UserSelect = /** @class */ (function (_super) {
|
|
|
528
562
|
var hasChildren = Array.isArray(children) && children;
|
|
529
563
|
return hasChildren ? (_this.renderList(children, option[valueField])) : (React__default.createElement("div", { className: cx("UserSelect-spinnerBox"), key: index },
|
|
530
564
|
React__default.createElement(Spinner, null)));
|
|
531
|
-
}))))
|
|
565
|
+
})))),
|
|
566
|
+
!controlled ? (React__default.createElement("div", { className: cx('UserSelect-footer') },
|
|
567
|
+
React__default.createElement("button", { type: "button", className: cx('Button Button--md Button--primary'), onClick: this.handleSubmit }, __('UserSelect.sure')))) : null));
|
|
532
568
|
};
|
|
533
569
|
UserSelect.prototype.render = function () {
|
|
534
570
|
var _this = this;
|
|
535
|
-
var _a = this.props, cx = _a.classnames, __ = _a.translate, _b = _a.placeholder, placeholder = _b === void 0 ? '请选择' : _b, showResultBox = _a.showResultBox
|
|
536
|
-
var _c = this.state, isOpened = _c.isOpened,
|
|
537
|
-
var selection = controlled ? this.props.selection : this.state.selection;
|
|
571
|
+
var _a = this.props, cx = _a.classnames, __ = _a.translate, _b = _a.placeholder, placeholder = _b === void 0 ? '请选择' : _b, showResultBox = _a.showResultBox;
|
|
572
|
+
var _c = this.state, isOpened = _c.isOpened, isEdit = _c.isEdit, isSelectOpened = _c.isSelectOpened;
|
|
538
573
|
return (React__default.createElement("div", { className: cx('UserSelect') },
|
|
539
|
-
showResultBox ? (React__default.createElement(ResultBox, { className: cx('UserSelect-input', isOpened ? 'is-active' : ''), allowInput: false, result:
|
|
574
|
+
showResultBox ? (React__default.createElement(ResultBox, { className: cx('UserSelect-input', isOpened ? 'is-active' : ''), allowInput: false, result: this.getResult(), onResultChange: function (value) { return _this.handleSelectChange(value, true); }, onResultClick: this.onOpen, placeholder: placeholder, useMobileUI: true })) : null,
|
|
540
575
|
showResultBox ? (React__default.createElement(PopUp, { isShow: isOpened, className: cx("UserSelect-popup"), onHide: this.onClose, showClose: false }, this.renderContent())) : (this.renderContent()),
|
|
541
576
|
React__default.createElement(PopUp, { isShow: isSelectOpened, className: cx("UserSelect-selectPopup"), onHide: function () {
|
|
542
577
|
return _this.setState({
|
|
@@ -558,8 +593,8 @@ var UserSelect = /** @class */ (function (_super) {
|
|
|
558
593
|
React__default.createElement("div", { className: cx('UserSelect-selectList-box') },
|
|
559
594
|
React__default.createElement("div", { className: cx('UserSelect-select-head') },
|
|
560
595
|
React__default.createElement("span", { className: cx('UserSelect-select-head-text') }, __('UserSelect.selected')),
|
|
561
|
-
isEdit ? (React__default.createElement("span", { className: cx('UserSelect-select-head-btnClear'), onClick:
|
|
562
|
-
this.renderselectList(tempSelection))))));
|
|
596
|
+
isEdit ? (React__default.createElement("span", { className: cx('UserSelect-select-head-btnClear'), onClick: this.handleClear }, __('UserSelect.clear'))) : null),
|
|
597
|
+
this.renderselectList(this.state.tempSelection))))));
|
|
563
598
|
};
|
|
564
599
|
UserSelect.defaultProps = {
|
|
565
600
|
showResultBox: true,
|
|
@@ -614,6 +649,12 @@ var UserSelect = /** @class */ (function (_super) {
|
|
|
614
649
|
__metadata("design:paramtypes", [Object, Boolean]),
|
|
615
650
|
__metadata("design:returntype", void 0)
|
|
616
651
|
], UserSelect.prototype, "handleSelectChange", null);
|
|
652
|
+
__decorate([
|
|
653
|
+
autobind,
|
|
654
|
+
__metadata("design:type", Function),
|
|
655
|
+
__metadata("design:paramtypes", []),
|
|
656
|
+
__metadata("design:returntype", void 0)
|
|
657
|
+
], UserSelect.prototype, "handleSubmit", null);
|
|
617
658
|
__decorate([
|
|
618
659
|
autobind,
|
|
619
660
|
__metadata("design:type", Function),
|
|
@@ -626,12 +667,30 @@ var UserSelect = /** @class */ (function (_super) {
|
|
|
626
667
|
__metadata("design:paramtypes", [Object, Number]),
|
|
627
668
|
__metadata("design:returntype", void 0)
|
|
628
669
|
], UserSelect.prototype, "handleBreadChange", null);
|
|
670
|
+
__decorate([
|
|
671
|
+
autobind,
|
|
672
|
+
__metadata("design:type", Function),
|
|
673
|
+
__metadata("design:paramtypes", []),
|
|
674
|
+
__metadata("design:returntype", void 0)
|
|
675
|
+
], UserSelect.prototype, "handleSort", null);
|
|
629
676
|
__decorate([
|
|
630
677
|
autobind,
|
|
631
678
|
__metadata("design:type", Function),
|
|
632
679
|
__metadata("design:paramtypes", []),
|
|
633
680
|
__metadata("design:returntype", void 0)
|
|
634
681
|
], UserSelect.prototype, "handleEdit", null);
|
|
682
|
+
__decorate([
|
|
683
|
+
autobind,
|
|
684
|
+
__metadata("design:type", Function),
|
|
685
|
+
__metadata("design:paramtypes", []),
|
|
686
|
+
__metadata("design:returntype", void 0)
|
|
687
|
+
], UserSelect.prototype, "handleClear", null);
|
|
688
|
+
__decorate([
|
|
689
|
+
autobind,
|
|
690
|
+
__metadata("design:type", Function),
|
|
691
|
+
__metadata("design:paramtypes", []),
|
|
692
|
+
__metadata("design:returntype", void 0)
|
|
693
|
+
], UserSelect.prototype, "getResult", null);
|
|
635
694
|
return UserSelect;
|
|
636
695
|
}(React__default.Component));
|
|
637
696
|
var UserSelect$1 = themeable(localeable(UserSelect));
|
|
@@ -37,7 +37,6 @@ export interface UserTabSelectState {
|
|
|
37
37
|
inputValue: string;
|
|
38
38
|
breadList: Array<any>;
|
|
39
39
|
options: Array<Option>;
|
|
40
|
-
tempSelection: Array<Option>;
|
|
41
40
|
selection: Array<Option>;
|
|
42
41
|
searchList: Array<Option>;
|
|
43
42
|
searchLoading: boolean;
|
|
@@ -55,9 +54,11 @@ export declare class UserTabSelect extends React.Component<UserTabSelectProps, U
|
|
|
55
54
|
componentWillUnmount(): void;
|
|
56
55
|
onClose(): void;
|
|
57
56
|
onOpen(): void;
|
|
58
|
-
|
|
59
|
-
handleSelectChange(option: Option | Array<Option>, isReplace?: boolean): boolean;
|
|
57
|
+
handleSubmit(): void;
|
|
58
|
+
handleSelectChange(option: Option | Array<Option>, isReplace?: boolean, isDelete?: boolean): boolean;
|
|
59
|
+
handleImmediateChange(option: Array<Option>): void;
|
|
60
60
|
handleTabChange(key: number): void;
|
|
61
|
+
getResult(): Option[];
|
|
61
62
|
render(): JSX.Element;
|
|
62
63
|
}
|
|
63
64
|
declare const _default: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-ui v2.
|
|
2
|
+
* amis-ui v2.3.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -109,7 +109,6 @@ var UserTabSelect = /** @class */ (function (_super) {
|
|
|
109
109
|
options: [],
|
|
110
110
|
breadList: [],
|
|
111
111
|
searchList: [],
|
|
112
|
-
tempSelection: [],
|
|
113
112
|
selection: props.selection ? props.selection : [],
|
|
114
113
|
isSearch: false,
|
|
115
114
|
searchLoading: false,
|
|
@@ -130,32 +129,36 @@ var UserTabSelect = /** @class */ (function (_super) {
|
|
|
130
129
|
inputValue: '',
|
|
131
130
|
searchList: [],
|
|
132
131
|
searchLoading: false,
|
|
133
|
-
activeKey: 0
|
|
132
|
+
activeKey: 0,
|
|
133
|
+
selection: []
|
|
134
134
|
});
|
|
135
135
|
};
|
|
136
136
|
UserTabSelect.prototype.onOpen = function () {
|
|
137
|
-
var
|
|
137
|
+
var _a = this.props.selection, selection = _a === void 0 ? [] : _a;
|
|
138
138
|
this.setState({
|
|
139
139
|
isOpened: true,
|
|
140
|
-
|
|
140
|
+
selection: selection.slice()
|
|
141
141
|
});
|
|
142
142
|
};
|
|
143
|
-
UserTabSelect.prototype.
|
|
144
|
-
this.onClose();
|
|
143
|
+
UserTabSelect.prototype.handleSubmit = function () {
|
|
145
144
|
var onChange = this.props.onChange;
|
|
146
145
|
onChange(this.state.selection);
|
|
146
|
+
this.onClose();
|
|
147
147
|
};
|
|
148
|
-
UserTabSelect.prototype.handleSelectChange = function (option, isReplace) {
|
|
148
|
+
UserTabSelect.prototype.handleSelectChange = function (option, isReplace, isDelete) {
|
|
149
149
|
var _a = this.props, multiple = _a.multiple, _b = _a.valueField, valueField = _b === void 0 ? 'value' : _b;
|
|
150
150
|
var selection = this.state.selection.slice();
|
|
151
151
|
var selectionVals = selection.map(function (option) { return option[valueField]; });
|
|
152
|
-
if (
|
|
152
|
+
if (isDelete) {
|
|
153
|
+
selection = selection.filter(function (item) { return item[valueField] !== option[valueField]; });
|
|
154
|
+
}
|
|
155
|
+
else if (isReplace && Array.isArray(option)) {
|
|
153
156
|
selection = option.slice();
|
|
154
157
|
}
|
|
155
158
|
else if (!Array.isArray(option)) {
|
|
156
159
|
var pos = selectionVals.indexOf(option[valueField]);
|
|
157
160
|
if (pos !== -1) {
|
|
158
|
-
selection.splice(
|
|
161
|
+
selection.splice(pos, 1);
|
|
159
162
|
}
|
|
160
163
|
else {
|
|
161
164
|
if (multiple) {
|
|
@@ -171,26 +174,55 @@ var UserTabSelect = /** @class */ (function (_super) {
|
|
|
171
174
|
});
|
|
172
175
|
return false;
|
|
173
176
|
};
|
|
177
|
+
UserTabSelect.prototype.handleImmediateChange = function (option) {
|
|
178
|
+
var onChange = this.props.onChange;
|
|
179
|
+
if (Array.isArray(option)) {
|
|
180
|
+
this.setState({
|
|
181
|
+
selection: option
|
|
182
|
+
});
|
|
183
|
+
onChange(option);
|
|
184
|
+
}
|
|
185
|
+
};
|
|
174
186
|
UserTabSelect.prototype.handleTabChange = function (key) {
|
|
175
187
|
this.setState({
|
|
176
188
|
activeKey: key
|
|
177
189
|
});
|
|
178
190
|
};
|
|
191
|
+
UserTabSelect.prototype.getResult = function () {
|
|
192
|
+
var _a = this.props, selection = _a.selection, tabOptions = _a.tabOptions, _b = _a.valueField, valueField = _b === void 0 ? 'value' : _b, _c = _a.labelField, labelField = _c === void 0 ? 'label' : _c;
|
|
193
|
+
var _selection = (selection === null || selection === void 0 ? void 0 : selection.slice()) || [];
|
|
194
|
+
if (tabOptions) {
|
|
195
|
+
for (var _i = 0, tabOptions_1 = tabOptions; _i < tabOptions_1.length; _i++) {
|
|
196
|
+
var item = tabOptions_1[_i];
|
|
197
|
+
var _loop_1 = function (item2) {
|
|
198
|
+
var res = _selection.find(function (item) { return item[valueField] === item2[valueField]; });
|
|
199
|
+
if (res) {
|
|
200
|
+
res[labelField] = item2[labelField];
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
for (var _d = 0, _e = item.options; _d < _e.length; _d++) {
|
|
204
|
+
var item2 = _e[_d];
|
|
205
|
+
_loop_1(item2);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return _selection;
|
|
210
|
+
};
|
|
179
211
|
UserTabSelect.prototype.render = function () {
|
|
180
212
|
var _this = this;
|
|
181
|
-
var _a = this.props, cx = _a.classnames
|
|
182
|
-
var _c = this.state, activeKey = _c.activeKey, isOpened = _c.isOpened
|
|
213
|
+
var _a = this.props, cx = _a.classnames, __ = _a.translate, _b = _a.placeholder, placeholder = _b === void 0 ? '请选择' : _b, tabOptions = _a.tabOptions, onSearch = _a.onSearch, deferLoad = _a.deferLoad, data = _a.data;
|
|
214
|
+
var _c = this.state, activeKey = _c.activeKey, isOpened = _c.isOpened;
|
|
183
215
|
return (React__default.createElement("div", { className: cx('UserTabSelect') },
|
|
184
|
-
React__default.createElement(ResultBox, { className: cx('UserTabSelect-input', isOpened ? 'is-active' : ''), allowInput: false, result:
|
|
216
|
+
React__default.createElement(ResultBox, { className: cx('UserTabSelect-input', isOpened ? 'is-active' : ''), allowInput: false, result: this.getResult(), onResultChange: this.handleImmediateChange, onResultClick: this.onOpen, placeholder: placeholder, useMobileUI: true }),
|
|
185
217
|
React__default.createElement(PopUp, { isShow: isOpened, className: cx("UserTabSelect-popup"), onHide: this.onClose, showClose: false },
|
|
186
218
|
React__default.createElement("div", { className: cx('UserTabSelect-wrap') },
|
|
187
219
|
React__default.createElement("div", { className: cx('UserSelect-navbar') },
|
|
188
|
-
React__default.createElement("span", { className: "left-arrow-box", onClick: this.
|
|
220
|
+
React__default.createElement("span", { className: "left-arrow-box", onClick: this.onClose },
|
|
189
221
|
React__default.createElement(Icon, { icon: "left-arrow", className: "icon" })),
|
|
190
222
|
React__default.createElement("div", { className: cx('UserSelect-navbar-title') }, "\u4EBA\u5458\u9009\u62E9")),
|
|
191
223
|
React__default.createElement(ThemedTabs, { mode: "tiled", className: cx('UserTabSelect-tabs'), onSelect: this.handleTabChange, activeKey: activeKey }, tabOptions === null || tabOptions === void 0 ? void 0 : tabOptions.map(function (item, index) {
|
|
192
224
|
return (React__default.createElement(Tab, __assign({}, _this.props, { eventKey: index, key: index, title: item.title, className: "TabsTransfer-tab" }),
|
|
193
|
-
React__default.createElement(UserSelect, __assign({ selection: selection, showResultBox: false }, item, { options: typeof item.options === 'string' && data
|
|
225
|
+
React__default.createElement(UserSelect, __assign({ selection: _this.state.selection, showResultBox: false }, item, { options: typeof item.options === 'string' && data
|
|
194
226
|
? resolveVariableAndFilter(item.options, data, '| raw')
|
|
195
227
|
: item.options, multiple: true, controlled: true, onChange: _this.handleSelectChange, onSearch: function (input, cancelExecutor) {
|
|
196
228
|
return item.searchable && onSearch
|
|
@@ -203,7 +235,9 @@ var UserTabSelect = /** @class */ (function (_super) {
|
|
|
203
235
|
}, deferLoad: function (data, isRef, param) {
|
|
204
236
|
return deferLoad(data, isRef, __assign({ deferApi: item.deferApi }, (param || {})));
|
|
205
237
|
} }))));
|
|
206
|
-
}))
|
|
238
|
+
})),
|
|
239
|
+
React__default.createElement("div", { className: cx('UserTabSelect-footer') },
|
|
240
|
+
React__default.createElement("button", { type: "button", className: cx('Button Button--md Button--primary'), onClick: this.handleSubmit }, __('UserSelect.sure')))))));
|
|
207
241
|
};
|
|
208
242
|
UserTabSelect.defaultProps = {};
|
|
209
243
|
__decorate([
|
|
@@ -223,19 +257,31 @@ var UserTabSelect = /** @class */ (function (_super) {
|
|
|
223
257
|
__metadata("design:type", Function),
|
|
224
258
|
__metadata("design:paramtypes", []),
|
|
225
259
|
__metadata("design:returntype", void 0)
|
|
226
|
-
], UserTabSelect.prototype, "
|
|
260
|
+
], UserTabSelect.prototype, "handleSubmit", null);
|
|
227
261
|
__decorate([
|
|
228
262
|
autobind,
|
|
229
263
|
__metadata("design:type", Function),
|
|
230
|
-
__metadata("design:paramtypes", [Object, Boolean]),
|
|
264
|
+
__metadata("design:paramtypes", [Object, Boolean, Boolean]),
|
|
231
265
|
__metadata("design:returntype", void 0)
|
|
232
266
|
], UserTabSelect.prototype, "handleSelectChange", null);
|
|
267
|
+
__decorate([
|
|
268
|
+
autobind,
|
|
269
|
+
__metadata("design:type", Function),
|
|
270
|
+
__metadata("design:paramtypes", [Array]),
|
|
271
|
+
__metadata("design:returntype", void 0)
|
|
272
|
+
], UserTabSelect.prototype, "handleImmediateChange", null);
|
|
233
273
|
__decorate([
|
|
234
274
|
autobind,
|
|
235
275
|
__metadata("design:type", Function),
|
|
236
276
|
__metadata("design:paramtypes", [Number]),
|
|
237
277
|
__metadata("design:returntype", void 0)
|
|
238
278
|
], UserTabSelect.prototype, "handleTabChange", null);
|
|
279
|
+
__decorate([
|
|
280
|
+
autobind,
|
|
281
|
+
__metadata("design:type", Function),
|
|
282
|
+
__metadata("design:paramtypes", []),
|
|
283
|
+
__metadata("design:returntype", void 0)
|
|
284
|
+
], UserTabSelect.prototype, "getResult", null);
|
|
239
285
|
return UserTabSelect;
|
|
240
286
|
}(React__default.Component));
|
|
241
287
|
var UserTabSelect$1 = themeable(localeable(UserTabSelect));
|
|
@@ -29,6 +29,7 @@ export interface ExpressionProps extends ThemeProps, LocaleProps {
|
|
|
29
29
|
formula?: FormulaPickerProps;
|
|
30
30
|
popOverContainer?: any;
|
|
31
31
|
renderEtrValue?: any;
|
|
32
|
+
selectMode?: 'list' | 'tree';
|
|
32
33
|
}
|
|
33
34
|
export declare class Expression extends React.Component<ExpressionProps> {
|
|
34
35
|
handleInputTypeChange(type: 'value' | 'field' | 'func' | 'formula'): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-ui v2.
|
|
2
|
+
* amis-ui v2.3.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -79,7 +79,7 @@ var Expression = /** @class */ (function (_super) {
|
|
|
79
79
|
onChange(value, this.props.index);
|
|
80
80
|
};
|
|
81
81
|
Expression.prototype.render = function () {
|
|
82
|
-
var _a = this.props, value = _a.value, valueField = _a.valueField, allowedTypes = _a.allowedTypes, funcs = _a.funcs, fields = _a.fields, op = _a.op; _a.classnames; var fieldClassName = _a.fieldClassName, config = _a.config, data = _a.data, disabled = _a.disabled, searchable = _a.searchable, formula = _a.formula, popOverContainer = _a.popOverContainer, renderEtrValue = _a.renderEtrValue;
|
|
82
|
+
var _a = this.props, value = _a.value, valueField = _a.valueField, allowedTypes = _a.allowedTypes, funcs = _a.funcs, fields = _a.fields, op = _a.op; _a.classnames; var fieldClassName = _a.fieldClassName, config = _a.config, data = _a.data, disabled = _a.disabled, searchable = _a.searchable, formula = _a.formula, popOverContainer = _a.popOverContainer, selectMode = _a.selectMode, renderEtrValue = _a.renderEtrValue;
|
|
83
83
|
var inputType = ((value === null || value === void 0 ? void 0 : value.type) === 'field'
|
|
84
84
|
? 'field'
|
|
85
85
|
: (value === null || value === void 0 ? void 0 : value.type) === 'func'
|
|
@@ -97,7 +97,7 @@ var Expression = /** @class */ (function (_super) {
|
|
|
97
97
|
}
|
|
98
98
|
return (React__default.createElement(React__default.Fragment, null,
|
|
99
99
|
inputType === 'value' ? (React__default.createElement(Value, { field: valueField, value: value, onChange: this.handleValueChange, op: op, data: data, disabled: disabled, formula: formula, popOverContainer: popOverContainer, renderEtrValue: renderEtrValue })) : null,
|
|
100
|
-
inputType === 'field' ? (React__default.createElement(ConditionField, { value: value === null || value === void 0 ? void 0 : value.field, onChange: this.handleFieldChange, fieldClassName: fieldClassName, disabled: disabled, searchable: searchable, popOverContainer: popOverContainer, options: valueField
|
|
100
|
+
inputType === 'field' ? (React__default.createElement(ConditionField, { value: value === null || value === void 0 ? void 0 : value.field, onChange: this.handleFieldChange, fieldClassName: fieldClassName, disabled: disabled, searchable: searchable, popOverContainer: popOverContainer, selectMode: selectMode, options: valueField
|
|
101
101
|
? filterTree(fields, function (item) {
|
|
102
102
|
return item.children ||
|
|
103
103
|
item.type === valueField.type;
|
|
@@ -9,6 +9,7 @@ export interface ConditionFieldProps extends ThemeProps, LocaleProps {
|
|
|
9
9
|
fieldClassName?: string;
|
|
10
10
|
searchable?: boolean;
|
|
11
11
|
popOverContainer?: any;
|
|
12
|
+
selectMode?: 'list' | 'tree';
|
|
12
13
|
}
|
|
13
14
|
export interface ConditionFieldState {
|
|
14
15
|
searchText: string;
|
|
@@ -17,7 +18,7 @@ export declare class ConditionField extends React.Component<ConditionFieldProps,
|
|
|
17
18
|
constructor(props: ConditionFieldProps);
|
|
18
19
|
onSearch(text: string): void;
|
|
19
20
|
filterOptions(options: any[]): any[];
|
|
20
|
-
onPopClose(
|
|
21
|
+
onPopClose(onClose: () => void): void;
|
|
21
22
|
render(): JSX.Element;
|
|
22
23
|
}
|
|
23
24
|
declare const _default: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-ui v2.
|
|
2
|
+
* amis-ui v2.3.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -12,6 +12,7 @@ import ResultBox from '../ResultBox.js';
|
|
|
12
12
|
import { findTree, noop, themeable, localeable } from 'amis-core';
|
|
13
13
|
import { Icon } from '../icons.js';
|
|
14
14
|
import SearchBox from '../SearchBox.js';
|
|
15
|
+
import TreeSelection from '../TreeSelection.js';
|
|
15
16
|
|
|
16
17
|
var option2value = function (item) { return item.name; };
|
|
17
18
|
var ConditionField = /** @class */ (function (_super) {
|
|
@@ -57,20 +58,23 @@ var ConditionField = /** @class */ (function (_super) {
|
|
|
57
58
|
});
|
|
58
59
|
};
|
|
59
60
|
// 选了值,还原options
|
|
60
|
-
ConditionField.prototype.onPopClose = function (
|
|
61
|
+
ConditionField.prototype.onPopClose = function (onClose) {
|
|
61
62
|
this.setState({ searchText: '' });
|
|
62
63
|
onClose();
|
|
63
64
|
};
|
|
64
65
|
ConditionField.prototype.render = function () {
|
|
65
66
|
var _this = this;
|
|
66
|
-
var _a = this.props, options = _a.options, onChange = _a.onChange, value = _a.value, cx = _a.classnames, fieldClassName = _a.fieldClassName, disabled = _a.disabled, __ = _a.translate, searchable = _a.searchable, popOverContainer = _a.popOverContainer;
|
|
67
|
+
var _a = this.props, options = _a.options, onChange = _a.onChange, value = _a.value, cx = _a.classnames, fieldClassName = _a.fieldClassName, disabled = _a.disabled, __ = _a.translate, searchable = _a.searchable, popOverContainer = _a.popOverContainer, _b = _a.selectMode, selectMode = _b === void 0 ? 'list' : _b;
|
|
67
68
|
return (React__default.createElement(PopOverContainer, { popOverContainer: popOverContainer || (function () { return findDOMNode(_this); }), popOverRender: function (_a) {
|
|
68
69
|
var onClose = _a.onClose;
|
|
69
70
|
return (React__default.createElement(React__default.Fragment, null,
|
|
70
71
|
searchable ? (React__default.createElement(SearchBox, { mini: false, onSearch: _this.onSearch })) : null,
|
|
71
|
-
React__default.createElement(
|
|
72
|
+
selectMode === 'tree' ? (React__default.createElement(TreeSelection, { className: 'is-scrollable', multiple: false, options: _this.filterOptions(_this.props.options), value: value, onChange: function (value) {
|
|
73
|
+
_this.onPopClose(onClose);
|
|
74
|
+
onChange(value.name);
|
|
75
|
+
} })) : (React__default.createElement(GroupedSelection, { multiple: false, onClick: function () { return _this.onPopClose(onClose); }, options: _this.filterOptions(_this.props.options), value: [value], option2value: option2value, onChange: function (value) {
|
|
72
76
|
return onChange(Array.isArray(value) ? value[0] : value);
|
|
73
|
-
} })));
|
|
77
|
+
} }))));
|
|
74
78
|
} }, function (_a) {
|
|
75
79
|
var onClick = _a.onClick, ref = _a.ref, isOpened = _a.isOpened;
|
|
76
80
|
return (React__default.createElement("div", { className: cx('CBGroup-field') },
|
|
@@ -23,6 +23,7 @@ export interface ConditionGroupProps extends ThemeProps, LocaleProps {
|
|
|
23
23
|
formula?: FormulaPickerProps;
|
|
24
24
|
popOverContainer?: any;
|
|
25
25
|
renderEtrValue?: any;
|
|
26
|
+
selectMode?: 'list' | 'tree';
|
|
26
27
|
}
|
|
27
28
|
export declare class ConditionGroup extends React.Component<ConditionGroupProps> {
|
|
28
29
|
getValue(): ConditionGroupValue;
|