amis-ui 2.3.1 → 2.4.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 +2 -2
- package/esm/components/AnchorNav.js +1 -1
- package/esm/components/ArrayInput.js +1 -1
- package/esm/components/AsideNav.js +1 -1
- package/esm/components/AssociatedSelection.js +1 -1
- package/esm/components/Avatar.d.ts +2 -2
- package/esm/components/Avatar.js +4 -4
- package/esm/components/Badge.js +1 -1
- package/esm/components/BaiduMapPicker.d.ts +1 -1
- package/esm/components/BaiduMapPicker.js +5 -5
- package/esm/components/BarCode.js +1 -1
- package/esm/components/Breadcrumb.js +1 -1
- package/esm/components/Button.js +3 -3
- package/esm/components/CalendarMobile.js +1 -1
- package/esm/components/Card.js +1 -1
- package/esm/components/Cascader.js +22 -14
- package/esm/components/ChainedSelection.js +1 -1
- package/esm/components/Checkbox.js +1 -1
- package/esm/components/CityArea.js +13 -5
- 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 +10 -3
- package/esm/components/DateRangePicker.js +3 -7
- 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.js +1 -1
- package/esm/components/Html.js +1 -1
- package/esm/components/ImageGallery.js +1 -1
- 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.d.ts +10 -10
- 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.js +1 -1
- package/esm/components/ModalManager.js +1 -1
- package/esm/components/MultilineText.d.ts +462 -0
- package/esm/components/MultilineText.js +85 -0
- package/esm/components/NumberInput.d.ts +34 -11
- package/esm/components/NumberInput.js +88 -34
- package/esm/components/Pagination.js +1 -1
- 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 +1 -1
- package/esm/components/Rating.js +1 -1
- package/esm/components/ResultBox.js +1 -1
- package/esm/components/ResultList.js +17 -15
- package/esm/components/ResultTableList.js +1 -1
- package/esm/components/ResultTreeList.js +10 -8
- package/esm/components/RichText.js +1 -1
- package/esm/components/SearchBox.js +1 -1
- package/esm/components/Select.js +1 -1
- package/esm/components/Selection.js +7 -5
- package/esm/components/SparkLine.js +1 -1
- package/esm/components/Spinner.js +1 -1
- package/esm/components/Steps.js +1 -1
- package/esm/components/Switch.js +1 -1
- package/esm/components/TableSelection.js +1 -1
- package/esm/components/Tabs.js +3 -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 +6 -5
- package/esm/components/Timeline.js +1 -1
- package/esm/components/TimelineItem.js +2 -2
- package/esm/components/Tinymce.d.ts +1 -0
- package/esm/components/Tinymce.js +5 -3
- 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.js +19 -14
- package/esm/components/TransferDropDown.js +1 -1
- package/esm/components/TransferPicker.js +1 -1
- package/esm/components/TransferSearch.js +1 -1
- package/esm/components/Tree.js +1 -1
- package/esm/components/TreeSelection.js +1 -1
- package/esm/components/UserSelect.js +3 -1
- package/esm/components/UserTabSelect.js +3 -1
- package/esm/components/WithRemoteConfig.js +1 -1
- package/esm/components/WithStore.js +1 -1
- package/esm/components/calendar/Calendar.js +2 -6
- 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 +2 -2
- package/esm/components/calendar/YearsView.js +1 -1
- package/esm/components/condition-builder/Expression.js +1 -1
- package/esm/components/condition-builder/Field.js +1 -1
- 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 +9 -1
- package/esm/components/condition-builder/Group.js +57 -13
- package/esm/components/condition-builder/GroupOrItem.d.ts +1 -0
- package/esm/components/condition-builder/GroupOrItem.js +7 -5
- package/esm/components/condition-builder/InputSwitch.js +1 -1
- package/esm/components/condition-builder/Item.js +1 -1
- package/esm/components/condition-builder/Value.js +1 -1
- package/esm/components/condition-builder/config.js +1 -1
- package/esm/components/condition-builder/index.js +3 -3
- package/esm/components/formula/Editor.js +1 -1
- package/esm/components/formula/FuncList.js +1 -1
- package/esm/components/formula/Picker.js +3 -3
- package/esm/components/formula/VariableList.js +1 -1
- package/esm/components/formula/plugin.js +1 -1
- package/esm/components/icons.d.ts +2 -1
- package/esm/components/icons.js +2 -1
- package/esm/components/index.d.ts +12 -7
- 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.js +1 -1
- 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 -3
- package/esm/icons/alert-info.svg.js +1 -3
- package/esm/icons/alert-success.svg.js +1 -3
- package/esm/icons/alert-warning.svg.js +1 -3
- package/esm/icons/back.svg.js +1 -3
- package/esm/icons/calendar.svg.js +1 -3
- package/esm/icons/caret.svg.js +1 -3
- package/esm/icons/check-circle.svg.js +1 -3
- package/esm/icons/check.svg.js +1 -3
- package/esm/icons/clock.svg.js +1 -3
- package/esm/icons/close-small.svg.js +1 -3
- package/esm/icons/close.svg.js +1 -3
- package/esm/icons/cloud-upload.svg.js +1 -3
- package/esm/icons/column-filter.svg.js +1 -3
- package/esm/icons/columns.svg.js +1 -3
- package/esm/icons/compress-alt.svg.js +1 -3
- package/esm/icons/copy.svg.js +1 -3
- package/esm/icons/date.svg.js +1 -3
- package/esm/icons/department.svg.js +1 -3
- package/esm/icons/desk-empty.svg.js +1 -3
- package/esm/icons/dot.svg.js +1 -3
- package/esm/icons/down-arrow-bold.svg.js +1 -3
- package/esm/icons/down.svg.js +1 -3
- package/esm/icons/download.svg.js +1 -3
- package/esm/icons/drag-bar.svg.js +1 -3
- package/esm/icons/drag.svg.js +1 -3
- package/esm/icons/edit.svg.js +1 -3
- package/esm/icons/ellipsis-v.svg.js +1 -3
- package/esm/icons/enter.svg.js +1 -3
- package/esm/icons/exchange.svg.js +1 -3
- package/esm/icons/expand-alt.svg.js +1 -3
- package/esm/icons/fail.svg.js +1 -3
- package/esm/icons/file.svg.js +1 -3
- package/esm/icons/filter.svg.js +1 -3
- package/esm/icons/folder.svg.js +1 -3
- package/esm/icons/function.svg.js +1 -3
- package/esm/icons/home.svg.js +1 -3
- package/esm/icons/image.svg.js +1 -3
- package/esm/icons/info-circle.svg.js +1 -3
- package/esm/icons/info.svg.js +1 -3
- package/esm/icons/input-clear.svg.js +1 -3
- package/esm/icons/invisible.svg.js +1 -3
- package/esm/icons/left-arrow.svg.js +1 -3
- package/esm/icons/loading-outline.svg.js +1 -3
- package/esm/icons/location.svg.js +1 -3
- package/esm/icons/menu.svg.js +1 -3
- package/esm/icons/minus.svg.js +1 -3
- package/esm/icons/move.svg.js +1 -3
- package/esm/icons/mute.svg.js +1 -3
- package/esm/icons/new-edit.svg.js +1 -3
- package/esm/icons/pause.svg.js +1 -3
- package/esm/icons/pencil.svg.js +1 -3
- package/esm/icons/play.svg.js +1 -3
- package/esm/icons/plus-cicle.svg.js +1 -3
- package/esm/icons/plus-fine.svg.js +1 -3
- package/esm/icons/plus.svg.js +1 -3
- package/esm/icons/post.svg.js +1 -3
- package/esm/icons/question-mark.svg.js +1 -3
- package/esm/icons/question.svg.js +1 -3
- package/esm/icons/redo.svg.js +1 -3
- package/esm/icons/refresh.svg.js +1 -3
- package/esm/icons/reload.svg.js +1 -3
- package/esm/icons/remove.svg.js +1 -3
- package/esm/icons/retry.svg.js +1 -3
- package/esm/icons/right-arrow-bold.svg.js +1 -3
- package/esm/icons/right-arrow.svg.js +1 -3
- package/esm/icons/right-double-arrow.svg.js +1 -3
- package/esm/icons/role.svg.js +1 -3
- package/esm/icons/rotate-left.svg.js +1 -3
- package/esm/icons/rotate-right.svg.js +1 -3
- package/esm/icons/scale-origin.svg.js +1 -3
- package/esm/icons/schedule.svg.js +1 -3
- package/esm/icons/search.svg.js +1 -3
- package/esm/icons/setting.svg.js +1 -3
- package/esm/icons/slider-handle-icon.svg.js +1 -3
- package/esm/icons/sort-asc.svg.js +1 -3
- package/esm/icons/sort-default.svg.js +1 -3
- package/esm/icons/sort-desc.svg.js +1 -3
- package/esm/icons/star.svg.js +1 -3
- package/esm/icons/status-close.svg.js +1 -3
- package/esm/icons/status-fail.svg.js +1 -3
- package/esm/icons/status-info.svg.js +1 -3
- package/esm/icons/status-success.svg.js +1 -3
- package/esm/icons/status-warning.svg.js +1 -3
- package/esm/icons/steps-finsh.svg.js +1 -3
- package/esm/icons/success.svg.js +1 -3
- package/esm/icons/transparent.svg.js +1 -3
- package/esm/icons/trash.svg.js +1 -3
- package/esm/icons/tree-down.svg.js +1 -3
- package/esm/icons/undo.svg.js +1 -3
- package/esm/icons/upload.svg.js +1 -3
- package/esm/icons/user-remove.svg.js +1 -3
- package/esm/icons/view.svg.js +1 -3
- package/esm/icons/volume.svg.js +1 -3
- package/esm/icons/warning-mark.svg.js +1 -3
- package/esm/icons/warning.svg.js +1 -3
- package/esm/icons/window-restore.svg.js +1 -3
- package/esm/icons/zoom-in.svg.js +1 -3
- package/esm/icons/zoom-out.svg.js +1 -3
- package/esm/index.js +4 -1
- package/esm/locale/de-DE.js +3 -1
- package/esm/locale/en-US.js +6 -2
- package/esm/locale/zh-CN.js +8 -4
- 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 +2 -2
- package/lib/components/AnchorNav.d.ts +10 -10
- package/lib/components/AnchorNav.js +1 -1
- package/lib/components/ArrayInput.d.ts +40 -40
- package/lib/components/ArrayInput.js +1 -1
- package/lib/components/AsideNav.js +1 -1
- package/lib/components/AssociatedSelection.d.ts +40 -40
- package/lib/components/AssociatedSelection.js +1 -1
- package/lib/components/Avatar.d.ts +12 -12
- package/lib/components/Avatar.js +3 -3
- package/lib/components/Badge.js +1 -1
- package/lib/components/BaiduMapPicker.d.ts +1 -1
- package/lib/components/BaiduMapPicker.js +5 -5
- 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 +3 -3
- 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 +22 -14
- package/lib/components/ChainedSelection.d.ts +40 -40
- package/lib/components/ChainedSelection.js +1 -1
- package/lib/components/Checkbox.d.ts +10 -10
- package/lib/components/Checkbox.js +1 -1
- package/lib/components/CityArea.js +13 -5
- 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 +10 -3
- package/lib/components/DateRangePicker.d.ts +40 -40
- package/lib/components/DateRangePicker.js +3 -8
- 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 +40 -40
- package/lib/components/GroupedSelection.js +1 -1
- package/lib/components/Html.js +1 -1
- package/lib/components/ImageGallery.js +1 -1
- 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 +40 -40
- 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/MultilineText.d.ts +462 -0
- package/lib/components/MultilineText.js +94 -0
- package/lib/components/NumberInput.d.ts +34 -11
- package/lib/components/NumberInput.js +88 -33
- package/lib/components/Pagination.js +1 -1
- 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 +1 -1
- 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 +40 -40
- package/lib/components/ResultList.js +17 -15
- package/lib/components/ResultTableList.d.ts +40 -40
- package/lib/components/ResultTableList.js +1 -1
- package/lib/components/ResultTreeList.d.ts +40 -40
- package/lib/components/ResultTreeList.js +10 -8
- 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 +40 -40
- package/lib/components/Selection.js +7 -5
- package/lib/components/SparkLine.d.ts +40 -40
- package/lib/components/SparkLine.js +1 -1
- package/lib/components/Spinner.d.ts +10 -10
- package/lib/components/Spinner.js +1 -1
- 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 +3 -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 +6 -5
- package/lib/components/Timeline.js +1 -1
- package/lib/components/TimelineItem.js +2 -2
- package/lib/components/Tinymce.d.ts +1 -0
- package/lib/components/Tinymce.js +5 -3
- 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 +40 -40
- package/lib/components/Transfer.js +18 -13
- 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.js +1 -1
- package/lib/components/Tree.d.ts +40 -40
- package/lib/components/Tree.js +1 -1
- package/lib/components/TreeSelection.d.ts +40 -40
- package/lib/components/TreeSelection.js +1 -1
- package/lib/components/UserSelect.d.ts +40 -40
- package/lib/components/UserSelect.js +3 -1
- package/lib/components/UserTabSelect.d.ts +40 -40
- package/lib/components/UserTabSelect.js +3 -1
- package/lib/components/WithRemoteConfig.js +1 -1
- package/lib/components/WithStore.js +1 -1
- package/lib/components/calendar/Calendar.js +2 -6
- 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 +2 -2
- package/lib/components/calendar/YearsView.js +1 -1
- package/lib/components/condition-builder/Expression.js +1 -1
- package/lib/components/condition-builder/Field.js +1 -1
- 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 +9 -1
- package/lib/components/condition-builder/Group.js +57 -13
- package/lib/components/condition-builder/GroupOrItem.d.ts +1 -0
- package/lib/components/condition-builder/GroupOrItem.js +7 -5
- package/lib/components/condition-builder/InputSwitch.js +1 -1
- package/lib/components/condition-builder/Item.js +1 -1
- package/lib/components/condition-builder/Value.js +1 -1
- package/lib/components/condition-builder/config.js +1 -1
- package/lib/components/condition-builder/index.js +3 -3
- package/lib/components/formula/Editor.d.ts +40 -40
- package/lib/components/formula/Editor.js +1 -1
- package/lib/components/formula/FuncList.js +1 -1
- package/lib/components/formula/Picker.d.ts +40 -40
- package/lib/components/formula/Picker.js +3 -3
- package/lib/components/formula/VariableList.js +1 -1
- package/lib/components/formula/plugin.js +1 -1
- package/lib/components/icons.d.ts +2 -1
- package/lib/components/icons.js +2 -1
- package/lib/components/index.d.ts +12 -7
- 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 +40 -40
- package/lib/components/table/index.js +1 -1
- 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 +3 -0
- 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 -3
- package/lib/icons/alert-info.svg.js +1 -3
- package/lib/icons/alert-success.svg.js +1 -3
- package/lib/icons/alert-warning.svg.js +1 -3
- package/lib/icons/back.svg.js +1 -3
- package/lib/icons/calendar.svg.js +1 -3
- package/lib/icons/caret.svg.js +1 -3
- package/lib/icons/check-circle.svg.js +1 -3
- package/lib/icons/check.svg.js +1 -3
- package/lib/icons/clock.svg.js +1 -3
- package/lib/icons/close-small.svg.js +1 -3
- package/lib/icons/close.svg.js +1 -3
- package/lib/icons/cloud-upload.svg.js +1 -3
- package/lib/icons/column-filter.svg.js +1 -3
- package/lib/icons/columns.svg.js +1 -3
- package/lib/icons/compress-alt.svg.js +1 -3
- package/lib/icons/copy.svg.js +1 -3
- package/lib/icons/date.svg.js +1 -3
- package/lib/icons/department.svg.js +1 -3
- package/lib/icons/desk-empty.svg.js +1 -3
- package/lib/icons/dot.svg.js +1 -3
- package/lib/icons/down-arrow-bold.svg.js +1 -3
- package/lib/icons/down.svg.js +1 -3
- package/lib/icons/download.svg.js +1 -3
- package/lib/icons/drag-bar.svg.js +1 -3
- package/lib/icons/drag.svg.js +1 -3
- package/lib/icons/edit.svg.js +1 -3
- package/lib/icons/ellipsis-v.svg.js +1 -3
- package/lib/icons/enter.svg.js +1 -3
- package/lib/icons/exchange.svg.js +1 -3
- package/lib/icons/expand-alt.svg.js +1 -3
- package/lib/icons/fail.svg.js +1 -3
- package/lib/icons/file.svg.js +1 -3
- package/lib/icons/filter.svg.js +1 -3
- package/lib/icons/folder.svg.js +1 -3
- package/lib/icons/function.svg.js +1 -3
- package/lib/icons/home.svg.js +1 -3
- package/lib/icons/image.svg.js +1 -3
- package/lib/icons/info-circle.svg.js +1 -3
- package/lib/icons/info.svg.js +1 -3
- package/lib/icons/input-clear.svg.js +1 -3
- package/lib/icons/invisible.svg.js +1 -3
- package/lib/icons/left-arrow.svg.js +1 -3
- package/lib/icons/loading-outline.svg.js +1 -3
- package/lib/icons/location.svg.js +1 -3
- package/lib/icons/menu.svg.js +1 -3
- package/lib/icons/minus.svg.js +1 -3
- package/lib/icons/move.svg.js +1 -3
- package/lib/icons/mute.svg.js +1 -3
- package/lib/icons/new-edit.svg.js +1 -3
- package/lib/icons/pause.svg.js +1 -3
- package/lib/icons/pencil.svg.js +1 -3
- package/lib/icons/play.svg.js +1 -3
- package/lib/icons/plus-cicle.svg.js +1 -3
- package/lib/icons/plus-fine.svg.js +1 -3
- package/lib/icons/plus.svg.js +1 -3
- package/lib/icons/post.svg.js +1 -3
- package/lib/icons/question-mark.svg.js +1 -3
- package/lib/icons/question.svg.js +1 -3
- package/lib/icons/redo.svg.js +1 -3
- package/lib/icons/refresh.svg.js +1 -3
- package/lib/icons/reload.svg.js +1 -3
- package/lib/icons/remove.svg.js +1 -3
- package/lib/icons/retry.svg.js +1 -3
- package/lib/icons/right-arrow-bold.svg.js +1 -3
- package/lib/icons/right-arrow.svg.js +1 -3
- package/lib/icons/right-double-arrow.svg.js +1 -3
- package/lib/icons/role.svg.js +1 -3
- package/lib/icons/rotate-left.svg.js +1 -3
- package/lib/icons/rotate-right.svg.js +1 -3
- package/lib/icons/scale-origin.svg.js +1 -3
- package/lib/icons/schedule.svg.js +1 -3
- package/lib/icons/search.svg.js +1 -3
- package/lib/icons/setting.svg.js +1 -3
- package/lib/icons/slider-handle-icon.svg.js +1 -3
- package/lib/icons/sort-asc.svg.js +1 -3
- package/lib/icons/sort-default.svg.js +1 -3
- package/lib/icons/sort-desc.svg.js +1 -3
- package/lib/icons/star.svg.js +1 -3
- package/lib/icons/status-close.svg.js +1 -3
- package/lib/icons/status-fail.svg.js +1 -3
- package/lib/icons/status-info.svg.js +1 -3
- package/lib/icons/status-success.svg.js +1 -3
- package/lib/icons/status-warning.svg.js +1 -3
- package/lib/icons/steps-finsh.svg.js +1 -3
- package/lib/icons/success.svg.js +1 -3
- package/lib/icons/transparent.svg.js +1 -3
- package/lib/icons/trash.svg.js +1 -3
- package/lib/icons/tree-down.svg.js +1 -3
- package/lib/icons/undo.svg.js +1 -3
- package/lib/icons/upload.svg.js +1 -3
- package/lib/icons/user-remove.svg.js +1 -3
- package/lib/icons/view.svg.js +1 -3
- package/lib/icons/volume.svg.js +1 -3
- package/lib/icons/warning-mark.svg.js +1 -3
- package/lib/icons/warning.svg.js +1 -3
- package/lib/icons/window-restore.svg.js +1 -3
- package/lib/icons/zoom-in.svg.js +1 -3
- package/lib/icons/zoom-out.svg.js +1 -3
- package/lib/index.js +7 -1
- package/lib/locale/de-DE.js +3 -1
- package/lib/locale/en-US.js +6 -2
- package/lib/locale/zh-CN.js +8 -4
- 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 +1500 -748
- package/lib/themes/ang.js +1 -1
- package/lib/themes/antd.css +2721 -886
- package/lib/themes/antd.js +1 -1
- package/lib/themes/cxd.css +3104 -1548
- package/lib/themes/cxd.js +1 -1
- package/lib/themes/dark.css +1500 -748
- package/lib/themes/dark.js +1 -1
- package/lib/themes/default.css +3104 -1548
- package/package.json +4 -4
- package/scss/_mixins.scss +144 -45
- package/scss/_properties.scss +155 -312
- package/scss/_utilities.scss +4 -0
- package/scss/base/_normalize.scss +4 -0
- package/scss/components/_alert.scss +0 -1
- package/scss/components/_array-input.scss +8 -3
- package/scss/components/_button.scss +708 -177
- package/scss/components/_code.scss +10 -0
- package/scss/components/_collapse.scss +17 -0
- package/scss/components/_condition-builder.scss +153 -30
- package/scss/components/_drawer.scss +7 -2
- package/scss/components/_formula.scss +4 -0
- package/scss/components/_images.scss +4 -0
- package/scss/components/_list.scss +1 -1
- package/scss/components/_modal.scss +1 -0
- package/scss/components/_multiline-text.scss +20 -0
- package/scss/components/_search-box.scss +1 -1
- package/scss/components/_steps.scss +2 -0
- package/scss/components/_table.scss +14 -0
- package/scss/components/_tabs.scss +1 -1
- package/scss/components/form/_checks.scss +20 -5
- package/scss/components/form/_combo.scss +47 -8
- package/scss/components/form/_date-range.scss +1 -1
- package/scss/components/form/_date.scss +4 -2
- package/scss/components/form/_fieldset.scss +4 -3
- package/scss/components/form/_form.scss +11 -5
- package/scss/components/form/_icon-select.scss +216 -0
- package/scss/components/form/_image.scss +44 -9
- package/scss/components/form/_input-group.scss +3 -0
- package/scss/components/form/_list.scss +33 -28
- package/scss/components/form/_location.scss +4 -0
- package/scss/components/form/_nested-select.scss +1 -1
- package/scss/components/form/_range.scss +4 -0
- package/scss/components/form/_select.scss +2 -1
- package/scss/components/form/_switch.scss +54 -0
- package/scss/components/form/_tag.scss +8 -3
- package/scss/components/form/_text.scss +2 -2
- package/scss/components/form/_textarea.scss +8 -0
- package/scss/components/form/_transfer.scss +213 -20
- package/scss/components/form/_tree-select.scss +7 -0
- package/scss/themes/_antd-variables.scss +1107 -41
- package/scss/themes/_common.scss +3 -0
- package/scss/themes/_cxd-variables.scss +1456 -477
- package/scss/themes/cxd.scss +423 -404
- package/scss/themes/_cxd-colors.scss +0 -56
|
@@ -45,9 +45,32 @@ export interface NumberProps extends ThemeProps {
|
|
|
45
45
|
* 是否是大数
|
|
46
46
|
*/
|
|
47
47
|
big?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* 清空输入内容时的值
|
|
50
|
+
*/
|
|
51
|
+
resetValue?: any;
|
|
48
52
|
}
|
|
49
53
|
export declare class NumberInput extends React.Component<NumberProps, any> {
|
|
50
|
-
static defaultProps: Pick<NumberProps, 'step' | 'readOnly' | 'borderMode'>;
|
|
54
|
+
static defaultProps: Pick<NumberProps, 'step' | 'readOnly' | 'borderMode' | 'resetValue'>;
|
|
55
|
+
/**
|
|
56
|
+
* 处理value值
|
|
57
|
+
*
|
|
58
|
+
* @param value value 值
|
|
59
|
+
* @param min 最小值
|
|
60
|
+
* @param max 最大值
|
|
61
|
+
* @param precision 精度
|
|
62
|
+
* @param resetValue 重置值
|
|
63
|
+
* @param isBig 是否为大数模式
|
|
64
|
+
*/
|
|
65
|
+
static normalizeValue: (value: any, min: number | undefined, max: number | undefined, precision: number, resetValue: any, isBig: boolean | undefined) => any;
|
|
66
|
+
/**
|
|
67
|
+
* 获取精度,合法的精度为0和正整数,不合法的精度统一转化为0
|
|
68
|
+
* 若设置了step,则会基于step的精度生成,最终使用更高的精度
|
|
69
|
+
*
|
|
70
|
+
* @param precision 精度
|
|
71
|
+
* @param step 步长
|
|
72
|
+
*/
|
|
73
|
+
static normalizePrecision: (precision: any, step?: number) => number;
|
|
51
74
|
/**
|
|
52
75
|
* 是否是 bigNumber,如果输入的内容是字符串就自动开启
|
|
53
76
|
*/
|
|
@@ -61,15 +84,15 @@ export declare class NumberInput extends React.Component<NumberProps, any> {
|
|
|
61
84
|
render(): JSX.Element;
|
|
62
85
|
}
|
|
63
86
|
declare const _default: {
|
|
64
|
-
new (props: Pick<Omit<NumberProps, keyof ThemeProps>, "big" | "disabled" | "value" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "max" | "min" | "inputRef" | "showSteps" | "precision" | "formatter" | "parser" | "displayMode" | "keyboard"> & Partial<Pick<Omit<NumberProps, keyof ThemeProps>, "step" | "readOnly" | "borderMode">> & Partial<Pick<Pick<NumberProps, "step" | "readOnly" | "borderMode">, never>> & import("amis-core/lib/theme").ThemeOutterProps): {
|
|
87
|
+
new (props: Pick<Omit<NumberProps, keyof ThemeProps>, "big" | "disabled" | "value" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "max" | "min" | "inputRef" | "showSteps" | "precision" | "formatter" | "parser" | "displayMode" | "keyboard"> & Partial<Pick<Omit<NumberProps, keyof ThemeProps>, "step" | "readOnly" | "resetValue" | "borderMode">> & Partial<Pick<Pick<NumberProps, "step" | "readOnly" | "resetValue" | "borderMode">, never>> & import("amis-core/lib/theme").ThemeOutterProps): {
|
|
65
88
|
ref: any;
|
|
66
89
|
childRef(ref: any): void;
|
|
67
90
|
getWrappedInstance(): any;
|
|
68
91
|
render(): JSX.Element;
|
|
69
92
|
context: any;
|
|
70
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Pick<Omit<NumberProps, keyof ThemeProps>, "big" | "disabled" | "value" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "max" | "min" | "inputRef" | "showSteps" | "precision" | "formatter" | "parser" | "displayMode" | "keyboard"> & Partial<Pick<Omit<NumberProps, keyof ThemeProps>, "step" | "readOnly" | "borderMode">> & Partial<Pick<Pick<NumberProps, "step" | "readOnly" | "borderMode">, never>> & import("amis-core/lib/theme").ThemeOutterProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
93
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Pick<Omit<NumberProps, keyof ThemeProps>, "big" | "disabled" | "value" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "max" | "min" | "inputRef" | "showSteps" | "precision" | "formatter" | "parser" | "displayMode" | "keyboard"> & Partial<Pick<Omit<NumberProps, keyof ThemeProps>, "step" | "readOnly" | "resetValue" | "borderMode">> & Partial<Pick<Pick<NumberProps, "step" | "readOnly" | "resetValue" | "borderMode">, never>> & import("amis-core/lib/theme").ThemeOutterProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
71
94
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
72
|
-
readonly props: Readonly<Pick<Omit<NumberProps, keyof ThemeProps>, "big" | "disabled" | "value" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "max" | "min" | "inputRef" | "showSteps" | "precision" | "formatter" | "parser" | "displayMode" | "keyboard"> & Partial<Pick<Omit<NumberProps, keyof ThemeProps>, "step" | "readOnly" | "borderMode">> & Partial<Pick<Pick<NumberProps, "step" | "readOnly" | "borderMode">, never>> & import("amis-core/lib/theme").ThemeOutterProps> & Readonly<{
|
|
95
|
+
readonly props: Readonly<Pick<Omit<NumberProps, keyof ThemeProps>, "big" | "disabled" | "value" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "max" | "min" | "inputRef" | "showSteps" | "precision" | "formatter" | "parser" | "displayMode" | "keyboard"> & Partial<Pick<Omit<NumberProps, keyof ThemeProps>, "step" | "readOnly" | "resetValue" | "borderMode">> & Partial<Pick<Pick<NumberProps, "step" | "readOnly" | "resetValue" | "borderMode">, never>> & import("amis-core/lib/theme").ThemeOutterProps> & Readonly<{
|
|
73
96
|
children?: React.ReactNode;
|
|
74
97
|
}>;
|
|
75
98
|
state: Readonly<{}>;
|
|
@@ -77,17 +100,17 @@ declare const _default: {
|
|
|
77
100
|
[key: string]: React.ReactInstance;
|
|
78
101
|
};
|
|
79
102
|
componentDidMount?(): void;
|
|
80
|
-
shouldComponentUpdate?(nextProps: Readonly<Pick<Omit<NumberProps, keyof ThemeProps>, "big" | "disabled" | "value" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "max" | "min" | "inputRef" | "showSteps" | "precision" | "formatter" | "parser" | "displayMode" | "keyboard"> & Partial<Pick<Omit<NumberProps, keyof ThemeProps>, "step" | "readOnly" | "borderMode">> & Partial<Pick<Pick<NumberProps, "step" | "readOnly" | "borderMode">, never>> & import("amis-core/lib/theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
103
|
+
shouldComponentUpdate?(nextProps: Readonly<Pick<Omit<NumberProps, keyof ThemeProps>, "big" | "disabled" | "value" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "max" | "min" | "inputRef" | "showSteps" | "precision" | "formatter" | "parser" | "displayMode" | "keyboard"> & Partial<Pick<Omit<NumberProps, keyof ThemeProps>, "step" | "readOnly" | "resetValue" | "borderMode">> & Partial<Pick<Pick<NumberProps, "step" | "readOnly" | "resetValue" | "borderMode">, never>> & import("amis-core/lib/theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
81
104
|
componentWillUnmount?(): void;
|
|
82
105
|
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
83
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<Pick<Omit<NumberProps, keyof ThemeProps>, "big" | "disabled" | "value" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "max" | "min" | "inputRef" | "showSteps" | "precision" | "formatter" | "parser" | "displayMode" | "keyboard"> & Partial<Pick<Omit<NumberProps, keyof ThemeProps>, "step" | "readOnly" | "borderMode">> & Partial<Pick<Pick<NumberProps, "step" | "readOnly" | "borderMode">, never>> & import("amis-core/lib/theme").ThemeOutterProps>, prevState: Readonly<{}>): any;
|
|
84
|
-
componentDidUpdate?(prevProps: Readonly<Pick<Omit<NumberProps, keyof ThemeProps>, "big" | "disabled" | "value" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "max" | "min" | "inputRef" | "showSteps" | "precision" | "formatter" | "parser" | "displayMode" | "keyboard"> & Partial<Pick<Omit<NumberProps, keyof ThemeProps>, "step" | "readOnly" | "borderMode">> & Partial<Pick<Pick<NumberProps, "step" | "readOnly" | "borderMode">, never>> & import("amis-core/lib/theme").ThemeOutterProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
106
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Pick<Omit<NumberProps, keyof ThemeProps>, "big" | "disabled" | "value" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "max" | "min" | "inputRef" | "showSteps" | "precision" | "formatter" | "parser" | "displayMode" | "keyboard"> & Partial<Pick<Omit<NumberProps, keyof ThemeProps>, "step" | "readOnly" | "resetValue" | "borderMode">> & Partial<Pick<Pick<NumberProps, "step" | "readOnly" | "resetValue" | "borderMode">, never>> & import("amis-core/lib/theme").ThemeOutterProps>, prevState: Readonly<{}>): any;
|
|
107
|
+
componentDidUpdate?(prevProps: Readonly<Pick<Omit<NumberProps, keyof ThemeProps>, "big" | "disabled" | "value" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "max" | "min" | "inputRef" | "showSteps" | "precision" | "formatter" | "parser" | "displayMode" | "keyboard"> & Partial<Pick<Omit<NumberProps, keyof ThemeProps>, "step" | "readOnly" | "resetValue" | "borderMode">> & Partial<Pick<Pick<NumberProps, "step" | "readOnly" | "resetValue" | "borderMode">, never>> & import("amis-core/lib/theme").ThemeOutterProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
85
108
|
componentWillMount?(): void;
|
|
86
109
|
UNSAFE_componentWillMount?(): void;
|
|
87
|
-
componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<NumberProps, keyof ThemeProps>, "big" | "disabled" | "value" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "max" | "min" | "inputRef" | "showSteps" | "precision" | "formatter" | "parser" | "displayMode" | "keyboard"> & Partial<Pick<Omit<NumberProps, keyof ThemeProps>, "step" | "readOnly" | "borderMode">> & Partial<Pick<Pick<NumberProps, "step" | "readOnly" | "borderMode">, never>> & import("amis-core/lib/theme").ThemeOutterProps>, nextContext: any): void;
|
|
88
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<NumberProps, keyof ThemeProps>, "big" | "disabled" | "value" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "max" | "min" | "inputRef" | "showSteps" | "precision" | "formatter" | "parser" | "displayMode" | "keyboard"> & Partial<Pick<Omit<NumberProps, keyof ThemeProps>, "step" | "readOnly" | "borderMode">> & Partial<Pick<Pick<NumberProps, "step" | "readOnly" | "borderMode">, never>> & import("amis-core/lib/theme").ThemeOutterProps>, nextContext: any): void;
|
|
89
|
-
componentWillUpdate?(nextProps: Readonly<Pick<Omit<NumberProps, keyof ThemeProps>, "big" | "disabled" | "value" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "max" | "min" | "inputRef" | "showSteps" | "precision" | "formatter" | "parser" | "displayMode" | "keyboard"> & Partial<Pick<Omit<NumberProps, keyof ThemeProps>, "step" | "readOnly" | "borderMode">> & Partial<Pick<Pick<NumberProps, "step" | "readOnly" | "borderMode">, never>> & import("amis-core/lib/theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
90
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<Pick<Omit<NumberProps, keyof ThemeProps>, "big" | "disabled" | "value" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "max" | "min" | "inputRef" | "showSteps" | "precision" | "formatter" | "parser" | "displayMode" | "keyboard"> & Partial<Pick<Omit<NumberProps, keyof ThemeProps>, "step" | "readOnly" | "borderMode">> & Partial<Pick<Pick<NumberProps, "step" | "readOnly" | "borderMode">, never>> & import("amis-core/lib/theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
110
|
+
componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<NumberProps, keyof ThemeProps>, "big" | "disabled" | "value" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "max" | "min" | "inputRef" | "showSteps" | "precision" | "formatter" | "parser" | "displayMode" | "keyboard"> & Partial<Pick<Omit<NumberProps, keyof ThemeProps>, "step" | "readOnly" | "resetValue" | "borderMode">> & Partial<Pick<Pick<NumberProps, "step" | "readOnly" | "resetValue" | "borderMode">, never>> & import("amis-core/lib/theme").ThemeOutterProps>, nextContext: any): void;
|
|
111
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<NumberProps, keyof ThemeProps>, "big" | "disabled" | "value" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "max" | "min" | "inputRef" | "showSteps" | "precision" | "formatter" | "parser" | "displayMode" | "keyboard"> & Partial<Pick<Omit<NumberProps, keyof ThemeProps>, "step" | "readOnly" | "resetValue" | "borderMode">> & Partial<Pick<Pick<NumberProps, "step" | "readOnly" | "resetValue" | "borderMode">, never>> & import("amis-core/lib/theme").ThemeOutterProps>, nextContext: any): void;
|
|
112
|
+
componentWillUpdate?(nextProps: Readonly<Pick<Omit<NumberProps, keyof ThemeProps>, "big" | "disabled" | "value" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "max" | "min" | "inputRef" | "showSteps" | "precision" | "formatter" | "parser" | "displayMode" | "keyboard"> & Partial<Pick<Omit<NumberProps, keyof ThemeProps>, "step" | "readOnly" | "resetValue" | "borderMode">> & Partial<Pick<Pick<NumberProps, "step" | "readOnly" | "resetValue" | "borderMode">, never>> & import("amis-core/lib/theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
113
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Pick<Omit<NumberProps, keyof ThemeProps>, "big" | "disabled" | "value" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "max" | "min" | "inputRef" | "showSteps" | "precision" | "formatter" | "parser" | "displayMode" | "keyboard"> & Partial<Pick<Omit<NumberProps, keyof ThemeProps>, "step" | "readOnly" | "resetValue" | "borderMode">> & Partial<Pick<Pick<NumberProps, "step" | "readOnly" | "resetValue" | "borderMode">, never>> & import("amis-core/lib/theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
91
114
|
};
|
|
92
115
|
displayName: string;
|
|
93
116
|
contextType: React.Context<string>;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-ui v2.
|
|
2
|
+
* amis-ui v2.4.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { __extends, __assign, __decorate, __metadata } from 'tslib';
|
|
7
7
|
import React__default from 'react';
|
|
8
|
+
import isInteger from 'lodash/isInteger';
|
|
8
9
|
import InputNumber from 'rc-input-number';
|
|
9
10
|
import getMiniDecimal, { toFixed } from 'rc-input-number/lib/utils/MiniDecimal';
|
|
10
|
-
import { getNumberPrecision } from 'rc-input-number/lib/utils/numberUtil';
|
|
11
|
+
import { getNumberPrecision, num2str } from 'rc-input-number/lib/utils/numberUtil';
|
|
11
12
|
import { Icon } from './icons.js';
|
|
12
13
|
import { ucFirst, autobind, themeable } from 'amis-core';
|
|
13
14
|
|
|
@@ -26,31 +27,10 @@ var NumberInput = /** @class */ (function (_super) {
|
|
|
26
27
|
return _this;
|
|
27
28
|
}
|
|
28
29
|
NumberInput.prototype.handleChange = function (value) {
|
|
29
|
-
var _a = this.props, min = _a.min, max = _a.max, onChange = _a.onChange;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
if (typeof max === 'number') {
|
|
35
|
-
value = Math.min(value, max);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
if (typeof value === 'string') {
|
|
39
|
-
var val = getMiniDecimal(value);
|
|
40
|
-
if (typeof min !== 'undefined') {
|
|
41
|
-
var minValue = getMiniDecimal(min);
|
|
42
|
-
if (val.lessEquals(minValue)) {
|
|
43
|
-
value = min;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
if (typeof max !== 'undefined') {
|
|
47
|
-
var maxValue = getMiniDecimal(max);
|
|
48
|
-
if (maxValue.lessEquals(val)) {
|
|
49
|
-
value = max;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
30
|
+
var _a = this.props, min = _a.min, max = _a.max, step = _a.step, precision = _a.precision, resetValue = _a.resetValue, onChange = _a.onChange;
|
|
31
|
+
var finalPrecision = NumberInput.normalizePrecision(precision, step);
|
|
32
|
+
var result = NumberInput.normalizeValue(value, min, max, finalPrecision, resetValue, this.isBig);
|
|
33
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(result);
|
|
54
34
|
};
|
|
55
35
|
NumberInput.prototype.handleFocus = function (e) {
|
|
56
36
|
var onFocus = this.props.onFocus;
|
|
@@ -101,11 +81,10 @@ var NumberInput = /** @class */ (function (_super) {
|
|
|
101
81
|
};
|
|
102
82
|
NumberInput.prototype.renderBase = function () {
|
|
103
83
|
var _a;
|
|
104
|
-
var _b = this.props, className = _b.className, ns = _b.classPrefix, cx = _b.classnames, value = _b.value, step = _b.step, precision = _b.precision, max = _b.max, min = _b.min, disabled = _b.disabled, placeholder = _b.placeholder
|
|
105
|
-
var precisionProps = {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
84
|
+
var _b = this.props, className = _b.className, ns = _b.classPrefix, cx = _b.classnames, value = _b.value, step = _b.step, precision = _b.precision, max = _b.max, min = _b.min, disabled = _b.disabled, placeholder = _b.placeholder, showSteps = _b.showSteps, formatter = _b.formatter, parser = _b.parser, borderMode = _b.borderMode, readOnly = _b.readOnly, displayMode = _b.displayMode, inputRef = _b.inputRef, keyboard = _b.keyboard;
|
|
85
|
+
var precisionProps = {
|
|
86
|
+
precision: NumberInput.normalizePrecision(precision, step)
|
|
87
|
+
};
|
|
109
88
|
return (React__default.createElement(InputNumber, __assign({ className: cx(className, showSteps === false ? 'no-steps' : '', displayMode === 'enhance' ? 'Number--enhance-input' : '', (_a = {},
|
|
110
89
|
_a["Number--border".concat(ucFirst(borderMode))] = borderMode,
|
|
111
90
|
_a)), ref: inputRef, readOnly: readOnly, prefixCls: "".concat(ns, "Number"), value: value, step: step, max: max, min: min, formatter: formatter, parser: parser, onChange: this.handleChange, disabled: disabled, placeholder: placeholder, onFocus: this.handleFocus, onBlur: this.handleBlur, stringMode: this.isBig ? true : false, keyboard: keyboard }, precisionProps)));
|
|
@@ -113,7 +92,7 @@ var NumberInput = /** @class */ (function (_super) {
|
|
|
113
92
|
NumberInput.prototype.render = function () {
|
|
114
93
|
var _a;
|
|
115
94
|
var _this = this;
|
|
116
|
-
var _b = this.props
|
|
95
|
+
var _b = this.props, cx = _b.classnames, value = _b.value, max = _b.max, min = _b.min, disabled = _b.disabled, showSteps = _b.showSteps, borderMode = _b.borderMode, readOnly = _b.readOnly, displayMode = _b.displayMode;
|
|
117
96
|
return (React__default.createElement(React__default.Fragment, null, displayMode === 'enhance' ? (React__default.createElement("div", { className: cx('Number--enhance', disabled ? 'Number--enhance-disabled' : '', showSteps === false ? 'Number--enhance-no-steps' : '', (_a = {},
|
|
118
97
|
_a["Number--enhance-border".concat(ucFirst(borderMode))] = borderMode,
|
|
119
98
|
_a)) },
|
|
@@ -126,7 +105,82 @@ var NumberInput = /** @class */ (function (_super) {
|
|
|
126
105
|
NumberInput.defaultProps = {
|
|
127
106
|
step: 1,
|
|
128
107
|
readOnly: false,
|
|
129
|
-
borderMode: 'full'
|
|
108
|
+
borderMode: 'full',
|
|
109
|
+
resetValue: ''
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* 处理value值
|
|
113
|
+
*
|
|
114
|
+
* @param value value 值
|
|
115
|
+
* @param min 最小值
|
|
116
|
+
* @param max 最大值
|
|
117
|
+
* @param precision 精度
|
|
118
|
+
* @param resetValue 重置值
|
|
119
|
+
* @param isBig 是否为大数模式
|
|
120
|
+
*/
|
|
121
|
+
NumberInput.normalizeValue = function (value, min, max, precision, resetValue, isBig) {
|
|
122
|
+
/**
|
|
123
|
+
* 输入不合法时重置为resetValue
|
|
124
|
+
* 若resetValue为非数字,则直接重置
|
|
125
|
+
* 若resetValue为数字,则需要处理max,min,precision,保证抛出的值满足条件
|
|
126
|
+
*/
|
|
127
|
+
if (value == null) {
|
|
128
|
+
if (typeof resetValue !== 'number') {
|
|
129
|
+
return resetValue !== null && resetValue !== void 0 ? resetValue : '';
|
|
130
|
+
}
|
|
131
|
+
value = resetValue;
|
|
132
|
+
}
|
|
133
|
+
// 处理max & min
|
|
134
|
+
if (typeof value === 'number') {
|
|
135
|
+
if (typeof min === 'number') {
|
|
136
|
+
value = Math.max(value, min);
|
|
137
|
+
}
|
|
138
|
+
if (typeof max === 'number') {
|
|
139
|
+
value = Math.min(value, max);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
// 处理string类型输入
|
|
143
|
+
if (typeof value === 'string') {
|
|
144
|
+
var val = getMiniDecimal(value);
|
|
145
|
+
if (typeof min !== 'undefined') {
|
|
146
|
+
var minValue = getMiniDecimal(min);
|
|
147
|
+
if (val.lessEquals(minValue)) {
|
|
148
|
+
value = min;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (typeof max !== 'undefined') {
|
|
152
|
+
var maxValue = getMiniDecimal(max);
|
|
153
|
+
if (maxValue.lessEquals(val)) {
|
|
154
|
+
value = max;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* 非大数模式下,如果精度不满足要求,需要处理value值,遵循四舍五入的处理规则
|
|
160
|
+
*/
|
|
161
|
+
if (!isBig && getNumberPrecision(value) !== precision) {
|
|
162
|
+
value = getMiniDecimal(toFixed(num2str(value), '.', precision)).toNumber();
|
|
163
|
+
}
|
|
164
|
+
return value;
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* 获取精度,合法的精度为0和正整数,不合法的精度统一转化为0
|
|
168
|
+
* 若设置了step,则会基于step的精度生成,最终使用更高的精度
|
|
169
|
+
*
|
|
170
|
+
* @param precision 精度
|
|
171
|
+
* @param step 步长
|
|
172
|
+
*/
|
|
173
|
+
NumberInput.normalizePrecision = function (precision, step) {
|
|
174
|
+
if (typeof precision === 'number' &&
|
|
175
|
+
isInteger(precision) &&
|
|
176
|
+
precision >= 0) {
|
|
177
|
+
return Math.max(precision, getNumberPrecision(step !== null && step !== void 0 ? step : 1));
|
|
178
|
+
}
|
|
179
|
+
// 如果设置了step,就基于step和precision,选取更高精度
|
|
180
|
+
if (step != null) {
|
|
181
|
+
return Math.max(0, getNumberPrecision(step));
|
|
182
|
+
}
|
|
183
|
+
return 0;
|
|
130
184
|
};
|
|
131
185
|
__decorate([
|
|
132
186
|
autobind,
|
package/esm/components/Picker.js
CHANGED
package/esm/components/PopUp.js
CHANGED
package/esm/components/Radios.js
CHANGED
package/esm/components/Range.js
CHANGED
package/esm/components/Rating.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-ui v2.
|
|
2
|
+
* amis-ui v2.4.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -24,7 +24,7 @@ var ResultList = /** @class */ (function (_super) {
|
|
|
24
24
|
return _this;
|
|
25
25
|
}
|
|
26
26
|
ResultList.itemRender = function (option, states) {
|
|
27
|
-
return React__default.createElement("span", null, "".concat(option.scopeLabel || '').concat(option[(states === null || states === void 0 ? void 0 : states.labelField) || 'label']));
|
|
27
|
+
return (React__default.createElement("span", null, "".concat(option.scopeLabel || '').concat(option[(states === null || states === void 0 ? void 0 : states.labelField) || 'label'])));
|
|
28
28
|
};
|
|
29
29
|
ResultList.prototype.componentDidMount = function () {
|
|
30
30
|
this.props.sortable && this.initSortable();
|
|
@@ -55,7 +55,7 @@ var ResultList = /** @class */ (function (_super) {
|
|
|
55
55
|
handle: ".".concat(ns, "Selections-dragbar"),
|
|
56
56
|
ghostClass: "".concat(ns, "Selections-item--dragging"),
|
|
57
57
|
onEnd: function (e) {
|
|
58
|
-
var
|
|
58
|
+
var _b, _c;
|
|
59
59
|
// 没有移动
|
|
60
60
|
if (e.newIndex === e.oldIndex) {
|
|
61
61
|
return;
|
|
@@ -78,30 +78,30 @@ var ResultList = /** @class */ (function (_super) {
|
|
|
78
78
|
}
|
|
79
79
|
var newValue = value.concat();
|
|
80
80
|
newValue.splice(e.newIndex, 0, newValue.splice(e.oldIndex, 1)[0]);
|
|
81
|
-
(
|
|
81
|
+
(_c = (_b = _this.props).onChange) === null || _c === void 0 ? void 0 : _c.call(_b, newValue);
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
84
|
};
|
|
85
85
|
ResultList.prototype.desposeSortable = function () {
|
|
86
|
-
var
|
|
87
|
-
(
|
|
86
|
+
var _b;
|
|
87
|
+
(_b = this.sortable) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
88
88
|
delete this.sortable;
|
|
89
89
|
};
|
|
90
90
|
ResultList.prototype.handleValueChange = function (index, value, name) {
|
|
91
|
-
var
|
|
91
|
+
var _b;
|
|
92
92
|
if (typeof name !== 'string') {
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
|
-
var
|
|
95
|
+
var _c = this.props, list = _c.value, onChange = _c.onChange;
|
|
96
96
|
var result = Array.isArray(list) ? list.concat() : [];
|
|
97
97
|
if (!result[index]) {
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
|
-
result.splice(index, 1, __assign(__assign({}, result[index]), (
|
|
100
|
+
result.splice(index, 1, __assign(__assign({}, result[index]), (_b = {}, _b[name] = value, _b)));
|
|
101
101
|
onChange === null || onChange === void 0 ? void 0 : onChange(result, true);
|
|
102
102
|
};
|
|
103
103
|
ResultList.prototype.search = function (inputValue) {
|
|
104
|
-
var
|
|
104
|
+
var _b = this.props, onSearch = _b.onSearch, value = _b.value;
|
|
105
105
|
var searchResult = (value || []).filter(function (item) { return onSearch && onSearch(inputValue, item); });
|
|
106
106
|
this.setState({ searchResult: searchResult });
|
|
107
107
|
};
|
|
@@ -110,7 +110,7 @@ var ResultList = /** @class */ (function (_super) {
|
|
|
110
110
|
};
|
|
111
111
|
// 删除项
|
|
112
112
|
ResultList.prototype.handleCloseItem = function (e, option) {
|
|
113
|
-
var
|
|
113
|
+
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;
|
|
114
114
|
if (disabled || option.disabled) {
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
@@ -134,7 +134,7 @@ var ResultList = /** @class */ (function (_super) {
|
|
|
134
134
|
// 没有搜索,走旧的删除方式
|
|
135
135
|
else {
|
|
136
136
|
var index = parseInt(e.currentTarget.getAttribute('data-index'), 10);
|
|
137
|
-
var
|
|
137
|
+
var _d = this.props, value_1 = _d.value, onChange_1 = _d.onChange;
|
|
138
138
|
if (!Array.isArray(value_1)) {
|
|
139
139
|
return;
|
|
140
140
|
}
|
|
@@ -145,7 +145,7 @@ var ResultList = /** @class */ (function (_super) {
|
|
|
145
145
|
};
|
|
146
146
|
ResultList.prototype.renderNormalList = function (value) {
|
|
147
147
|
var _this = this;
|
|
148
|
-
var
|
|
148
|
+
var _b = this.props, cx = _b.classnames, itemRender = _b.itemRender, disabled = _b.disabled, itemClassName = _b.itemClassName, sortable = _b.sortable, labelField = _b.labelField, __ = _b.translate, placeholder = _b.placeholder;
|
|
149
149
|
return (React__default.createElement(React__default.Fragment, null, Array.isArray(value) && value.length ? (React__default.createElement("div", { className: cx('Selections-items') }, value.map(function (option, index) { return (React__default.createElement("div", { className: cx('Selections-item', itemClassName, option === null || option === void 0 ? void 0 : option.className), key: index },
|
|
150
150
|
sortable && !disabled && value.length > 1 ? (React__default.createElement(Icon, { className: cx('Selections-dragbar icon'), icon: "drag-bar" })) : null,
|
|
151
151
|
React__default.createElement("label", null, itemRender(option, {
|
|
@@ -160,16 +160,18 @@ var ResultList = /** @class */ (function (_super) {
|
|
|
160
160
|
React__default.createElement(Icon, { icon: "close", className: "icon" }))) : null)); }))) : (React__default.createElement("div", { className: cx('Selections-placeholder') }, __(placeholder)))));
|
|
161
161
|
};
|
|
162
162
|
ResultList.prototype.render = function () {
|
|
163
|
-
var
|
|
163
|
+
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;
|
|
164
164
|
var searchResult = this.state.searchResult;
|
|
165
165
|
return (React__default.createElement("div", { className: cx('Selections', className) },
|
|
166
166
|
title ? React__default.createElement("div", { className: cx('Selections-title') }, title) : null,
|
|
167
167
|
searchable ? (React__default.createElement(TransferSearch, { placeholder: searchPlaceholder, onSearch: this.search, onCancelSearch: this.clearSearch })) : null,
|
|
168
168
|
this.renderNormalList(searchResult !== null ? searchResult : value)));
|
|
169
169
|
};
|
|
170
|
+
var _a;
|
|
171
|
+
_a = ResultList;
|
|
170
172
|
ResultList.defaultProps = {
|
|
171
173
|
placeholder: 'placeholder.selectData',
|
|
172
|
-
itemRender:
|
|
174
|
+
itemRender: _a.itemRender,
|
|
173
175
|
searchPlaceholder: ''
|
|
174
176
|
};
|
|
175
177
|
__decorate([
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-ui v2.
|
|
2
|
+
* amis-ui v2.4.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -107,8 +107,8 @@ var BaseResultTreeList = /** @class */ (function (_super) {
|
|
|
107
107
|
};
|
|
108
108
|
// 删除非选中节点
|
|
109
109
|
BaseResultTreeList.prototype.deleteTreeChecked = function (option) {
|
|
110
|
-
var
|
|
111
|
-
var
|
|
110
|
+
var _b = this.props, _c = _b.value, value = _c === void 0 ? [] : _c, onChange = _b.onChange, valueField = _b.valueField;
|
|
111
|
+
var _d = this.state, searching = _d.searching, treeOptions = _d.treeOptions;
|
|
112
112
|
var temNode = [];
|
|
113
113
|
var cb = function (node) {
|
|
114
114
|
if (isEqual(node, option)) {
|
|
@@ -143,7 +143,7 @@ var BaseResultTreeList = /** @class */ (function (_super) {
|
|
|
143
143
|
this.clearSearch();
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
146
|
-
var
|
|
146
|
+
var _b = this.props, valueField = _b.valueField, onSearch = _b.onSearch;
|
|
147
147
|
var temOptions = this.state.treeOptions || [];
|
|
148
148
|
var cb = function (node) {
|
|
149
149
|
node.isChecked = false;
|
|
@@ -168,20 +168,22 @@ var BaseResultTreeList = /** @class */ (function (_super) {
|
|
|
168
168
|
};
|
|
169
169
|
BaseResultTreeList.prototype.renderTree = function () {
|
|
170
170
|
var _this = this;
|
|
171
|
-
var
|
|
172
|
-
var
|
|
171
|
+
var _b = this.props, className = _b.className, cx = _b.classnames, value = _b.value, valueField = _b.valueField, itemRender = _b.itemRender, __ = _b.translate, placeholder = _b.placeholder;
|
|
172
|
+
var _c = this.state, treeOptions = _c.treeOptions, searching = _c.searching, searchTreeOptions = _c.searchTreeOptions;
|
|
173
173
|
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, onDelete: function (option) { return _this.deleteTreeChecked(option); } })) : (React__default.createElement("div", { className: cx('Selections-placeholder') }, __(placeholder)))));
|
|
174
174
|
};
|
|
175
175
|
BaseResultTreeList.prototype.render = function () {
|
|
176
|
-
var
|
|
176
|
+
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;
|
|
177
177
|
return (React__default.createElement("div", { className: cx('Selections', className) },
|
|
178
178
|
title ? React__default.createElement("div", { className: cx('Selections-title') }, title) : null,
|
|
179
179
|
searchable ? (React__default.createElement(TransferSearch, { placeholder: searchPlaceholder, onSearch: this.search, onCancelSearch: this.clearSearch })) : null,
|
|
180
180
|
this.renderTree()));
|
|
181
181
|
};
|
|
182
|
+
var _a;
|
|
183
|
+
_a = BaseResultTreeList;
|
|
182
184
|
BaseResultTreeList.defaultProps = {
|
|
183
185
|
placeholder: 'placeholder.selectData',
|
|
184
|
-
itemRender:
|
|
186
|
+
itemRender: _a.itemRender
|
|
185
187
|
};
|
|
186
188
|
__decorate([
|
|
187
189
|
autobind,
|
package/esm/components/Select.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-ui v2.
|
|
2
|
+
* amis-ui v2.4.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -57,7 +57,7 @@ var BaseSelection = /** @class */ (function (_super) {
|
|
|
57
57
|
return Array.from(new Set(arr1.filter(function (item) { return arr2.includes(item); })));
|
|
58
58
|
};
|
|
59
59
|
BaseSelection.prototype.toggleOption = function (option) {
|
|
60
|
-
var
|
|
60
|
+
var _b = this.props, value = _b.value, onChange = _b.onChange, option2value = _b.option2value, options = _b.options, disabled = _b.disabled, multiple = _b.multiple, clearable = _b.clearable;
|
|
61
61
|
if (disabled || option.disabled) {
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
@@ -78,7 +78,7 @@ var BaseSelection = /** @class */ (function (_super) {
|
|
|
78
78
|
onChange && onChange(multiple ? newValue : newValue[0]);
|
|
79
79
|
};
|
|
80
80
|
BaseSelection.prototype.toggleAll = function () {
|
|
81
|
-
var
|
|
81
|
+
var _b = this.props, value = _b.value, onChange = _b.onChange, option2value = _b.option2value, options = _b.options;
|
|
82
82
|
var valueArray = [];
|
|
83
83
|
var availableOptions = options.filter(function (option) { return !option.disabled; });
|
|
84
84
|
var intersectOptions = this.intersectArray(value, availableOptions);
|
|
@@ -98,7 +98,7 @@ var BaseSelection = /** @class */ (function (_super) {
|
|
|
98
98
|
};
|
|
99
99
|
BaseSelection.prototype.render = function () {
|
|
100
100
|
var _this = this;
|
|
101
|
-
var
|
|
101
|
+
var _b = this.props, value = _b.value, options = _b.options, className = _b.className, placeholder = _b.placeholder, inline = _b.inline, labelClassName = _b.labelClassName, disabled = _b.disabled, cx = _b.classnames, option2value = _b.option2value, itemClassName = _b.itemClassName, itemRender = _b.itemRender, multiple = _b.multiple, labelField = _b.labelField, onClick = _b.onClick;
|
|
102
102
|
var __ = this.props.translate;
|
|
103
103
|
var valueArray = BaseSelection.value2array(value, options, option2value);
|
|
104
104
|
var body = [];
|
|
@@ -114,9 +114,11 @@ var BaseSelection = /** @class */ (function (_super) {
|
|
|
114
114
|
}
|
|
115
115
|
return (React__default.createElement("div", { className: cx('Selection', className, inline ? 'Selection--inline' : ''), onClick: onClick }, body && body.length ? body : React__default.createElement("div", null, __(placeholder))));
|
|
116
116
|
};
|
|
117
|
+
var _a;
|
|
118
|
+
_a = BaseSelection;
|
|
117
119
|
BaseSelection.defaultProps = {
|
|
118
120
|
placeholder: 'placeholder.noOption',
|
|
119
|
-
itemRender:
|
|
121
|
+
itemRender: _a.itemRender,
|
|
120
122
|
multiple: true,
|
|
121
123
|
clearable: false
|
|
122
124
|
};
|