amis-ui 3.1.1 → 3.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.d.ts +122 -122
- package/esm/components/Alert.js +55 -17
- package/esm/components/Alert2.d.ts +20 -20
- package/esm/components/Alert2.js +5 -8
- package/esm/components/AnchorNav.d.ts +20 -20
- package/esm/components/AnchorNav.js +1 -1
- package/esm/components/ArrayInput.d.ts +40 -40
- package/esm/components/ArrayInput.js +1 -1
- package/esm/components/AsideNav.js +1 -1
- package/esm/components/AssociatedSelection.d.ts +120 -120
- package/esm/components/AssociatedSelection.js +1 -1
- package/esm/components/Avatar.d.ts +102 -101
- package/esm/components/Avatar.js +4 -3
- package/esm/components/Badge.d.ts +1 -1
- package/esm/components/Badge.js +1 -1
- package/esm/components/BaiduMapPicker.js +27 -23
- package/esm/components/BarCode.js +1 -1
- package/esm/components/Breadcrumb.js +5 -9
- package/esm/components/Button.d.ts +20 -20
- package/esm/components/Button.js +1 -1
- package/esm/components/CalendarMobile.d.ts +41 -40
- package/esm/components/CalendarMobile.js +21 -5
- package/esm/components/Card.d.ts +100 -100
- package/esm/components/Card.js +1 -1
- package/esm/components/Cascader.d.ts +4 -3
- package/esm/components/Cascader.js +106 -105
- package/esm/components/ChainedDropdownSelection.d.ts +559 -0
- package/esm/components/ChainedDropdownSelection.js +104 -0
- package/esm/components/ChainedSelection.d.ts +120 -120
- package/esm/components/ChainedSelection.js +1 -1
- package/esm/components/Checkbox.d.ts +11 -10
- package/esm/components/Checkbox.js +3 -2
- package/esm/components/CityArea.js +3 -3
- package/esm/components/CityDB.js +1 -1
- package/esm/components/CodeMirror.js +1 -1
- package/esm/components/Collapse.d.ts +162 -140
- package/esm/components/Collapse.js +11 -7
- package/esm/components/CollapseGroup.d.ts +53 -31
- package/esm/components/CollapseGroup.js +19 -14
- package/esm/components/ColorPicker.d.ts +84 -80
- package/esm/components/ColorPicker.js +32 -5
- package/esm/components/Combo.js +1 -1
- package/esm/components/ConfirmBox.d.ts +82 -81
- package/esm/components/ConfirmBox.js +11 -4
- package/esm/components/ContextMenu.d.ts +2 -2
- package/esm/components/ContextMenu.js +25 -10
- package/esm/components/DatePicker.d.ts +85 -81
- package/esm/components/DatePicker.js +9 -6
- package/esm/components/DateRangePicker.d.ts +120 -120
- package/esm/components/DateRangePicker.js +38 -17
- package/esm/components/DndContainer.js +1 -1
- package/esm/components/Drawer.d.ts +30 -30
- package/esm/components/Drawer.js +1 -1
- package/esm/components/DropDownSelection.d.ts +555 -0
- package/esm/components/DropDownSelection.js +77 -0
- package/esm/components/Editor.d.ts +120 -120
- package/esm/components/Editor.js +1 -1
- package/esm/components/Form.js +1 -1
- package/esm/components/FormField.js +1 -1
- package/esm/components/GaodeMapPicker.js +1 -1
- package/esm/components/GridNav.js +1 -1
- package/esm/components/GroupedSelection.d.ts +120 -120
- package/esm/components/GroupedSelection.js +1 -1
- package/esm/components/Html.js +1 -1
- package/esm/components/ImageGallery.d.ts +40 -40
- package/esm/components/ImageGallery.js +1 -1
- package/esm/components/Input.js +1 -1
- package/esm/components/InputBox.d.ts +11 -10
- package/esm/components/InputBox.js +5 -3
- package/esm/components/InputBoxWithSuggestion.d.ts +1 -0
- package/esm/components/InputBoxWithSuggestion.js +4 -4
- package/esm/components/InputTable.js +3 -3
- package/esm/components/Layout.d.ts +10 -10
- package/esm/components/Layout.js +1 -1
- package/esm/components/Link.js +5 -4
- package/esm/components/ListGroup.d.ts +10 -10
- package/esm/components/ListGroup.js +1 -1
- package/esm/components/ListMenu.d.ts +81 -80
- package/esm/components/ListMenu.js +6 -5
- package/esm/components/LocationPicker.d.ts +44 -40
- package/esm/components/LocationPicker.js +35 -8
- package/esm/components/Markdown.js +1 -1
- package/esm/components/Modal.d.ts +80 -80
- package/esm/components/Modal.js +1 -1
- package/esm/components/ModalManager.js +1 -1
- package/esm/components/MonthRangePicker.d.ts +120 -120
- package/esm/components/MultilineText.d.ts +40 -40
- package/esm/components/MultilineText.js +1 -1
- package/esm/components/NumberInput.d.ts +22 -25
- package/esm/components/NumberInput.js +14 -7
- package/esm/components/Pagination.d.ts +86 -81
- package/esm/components/Pagination.js +13 -4
- package/esm/components/Picker.js +3 -3
- package/esm/components/PickerColumn.d.ts +1 -1
- package/esm/components/PickerColumn.js +2 -2
- package/esm/components/PickerContainer.d.ts +1 -0
- package/esm/components/PickerContainer.js +4 -4
- package/esm/components/PopOverContainer.d.ts +3 -0
- package/esm/components/PopOverContainer.js +14 -3
- package/esm/components/PopUp.d.ts +120 -120
- package/esm/components/PopUp.js +3 -3
- package/esm/components/Progress.d.ts +30 -30
- package/esm/components/Progress.js +1 -1
- package/esm/components/PullRefresh.js +1 -1
- package/esm/components/Radios.d.ts +11 -10
- package/esm/components/Radios.js +7 -6
- package/esm/components/Range.d.ts +2 -1
- package/esm/components/Range.js +67 -16
- package/esm/components/Rating.d.ts +20 -20
- package/esm/components/Rating.js +2 -2
- package/esm/components/ResultBox.d.ts +83 -41
- package/esm/components/ResultBox.js +6 -5
- package/esm/components/ResultList.d.ts +40 -40
- package/esm/components/ResultList.js +2 -2
- package/esm/components/ResultTableList.d.ts +120 -120
- package/esm/components/ResultTableList.js +1 -1
- package/esm/components/ResultTreeList.d.ts +40 -40
- package/esm/components/ResultTreeList.js +4 -2
- package/esm/components/RichText.js +1 -1
- package/esm/components/SearchBox.d.ts +83 -82
- package/esm/components/SearchBox.js +8 -7
- package/esm/components/Select.d.ts +1353 -1353
- package/esm/components/Select.js +16 -9
- package/esm/components/SelectMobile.d.ts +37 -0
- package/esm/components/SelectMobile.js +362 -0
- package/esm/components/Selection.d.ts +120 -120
- package/esm/components/Selection.js +1 -1
- package/esm/components/SparkLine.d.ts +40 -40
- package/esm/components/SparkLine.js +1 -1
- package/esm/components/Spinner.d.ts +50 -50
- package/esm/components/Spinner.js +4 -4
- package/esm/components/Steps.js +1 -1
- package/esm/components/Switch.d.ts +10 -10
- package/esm/components/Switch.js +1 -1
- package/esm/components/TableSelection.d.ts +120 -120
- package/esm/components/TableSelection.js +3 -2
- package/esm/components/Tabs.d.ts +92 -80
- package/esm/components/Tabs.js +88 -13
- package/esm/components/TabsTransfer.d.ts +41 -40
- package/esm/components/TabsTransfer.js +7 -6
- package/esm/components/TabsTransferPicker.d.ts +2 -0
- package/esm/components/TabsTransferPicker.js +8 -8
- package/esm/components/Tag.d.ts +80 -80
- package/esm/components/Tag.js +5 -10
- package/esm/components/Textarea.d.ts +41 -40
- package/esm/components/Textarea.js +1 -1
- package/esm/components/Timeline.js +1 -1
- package/esm/components/TimelineItem.d.ts +1 -1
- package/esm/components/TimelineItem.js +4 -3
- package/esm/components/Tinymce.d.ts +1 -0
- package/esm/components/Tinymce.js +7 -3
- package/esm/components/TitleBar.js +1 -1
- package/esm/components/Toast.d.ts +80 -80
- package/esm/components/Toast.js +1 -1
- package/esm/components/Tooltip.js +1 -1
- package/esm/components/TooltipWrapper.d.ts +31 -31
- package/esm/components/TooltipWrapper.js +1 -1
- package/esm/components/Transfer.d.ts +134 -132
- package/esm/components/Transfer.js +26 -16
- package/esm/components/TransferDropDown.d.ts +124 -120
- package/esm/components/TransferDropDown.js +52 -18
- package/esm/components/TransferPicker.d.ts +2 -0
- package/esm/components/TransferPicker.js +8 -8
- package/esm/components/TransferSearch.js +3 -3
- package/esm/components/Tree.d.ts +161 -160
- package/esm/components/Tree.js +58 -23
- package/esm/components/TreeSelection.d.ts +120 -120
- package/esm/components/TreeSelection.js +3 -3
- package/esm/components/UserSelect.d.ts +40 -40
- package/esm/components/UserSelect.js +17 -9
- package/esm/components/UserTabSelect.d.ts +40 -40
- package/esm/components/UserTabSelect.js +1 -1
- package/esm/components/WithRemoteConfig.js +7 -7
- package/esm/components/WithStore.js +1 -1
- package/esm/components/calendar/Calendar.d.ts +2 -0
- package/esm/components/calendar/Calendar.js +8 -4
- package/esm/components/calendar/CalendarContainer.js +1 -1
- package/esm/components/calendar/DaysView.d.ts +3 -0
- package/esm/components/calendar/DaysView.js +17 -5
- package/esm/components/calendar/MonthsView.js +1 -1
- package/esm/components/calendar/QuartersView.d.ts +11 -0
- package/esm/components/calendar/QuartersView.js +47 -5
- package/esm/components/calendar/TimeView.js +4 -2
- package/esm/components/calendar/YearsView.js +1 -1
- package/esm/components/condition-builder/Expression.d.ts +1 -1
- package/esm/components/condition-builder/Expression.js +1 -1
- package/esm/components/condition-builder/Field.d.ts +3 -7
- package/esm/components/condition-builder/Field.js +14 -72
- package/esm/components/condition-builder/Formula.js +2 -2
- package/esm/components/condition-builder/Func.js +2 -2
- package/esm/components/condition-builder/Group.d.ts +10 -1
- package/esm/components/condition-builder/Group.js +9 -5
- package/esm/components/condition-builder/GroupOrItem.d.ts +10 -1
- package/esm/components/condition-builder/GroupOrItem.js +9 -6
- package/esm/components/condition-builder/InputSwitch.js +1 -1
- package/esm/components/condition-builder/Item.d.ts +1 -1
- package/esm/components/condition-builder/Item.js +5 -6
- package/esm/components/condition-builder/Value.js +13 -8
- package/esm/components/condition-builder/config.js +1 -1
- package/esm/components/condition-builder/index.d.ts +10 -1
- package/esm/components/condition-builder/index.js +8 -4
- package/esm/components/formula/Editor.d.ts +57 -40
- package/esm/components/formula/Editor.js +124 -24
- package/esm/components/formula/FuncList.js +24 -10
- package/esm/components/formula/Input.d.ts +272 -0
- package/esm/components/formula/Input.js +115 -0
- package/esm/components/formula/Picker.d.ts +64 -45
- package/esm/components/formula/Picker.js +120 -28
- package/esm/components/formula/VariableList.d.ts +1 -0
- package/esm/components/formula/VariableList.js +127 -23
- package/esm/components/formula/plugin.d.ts +4 -2
- package/esm/components/formula/plugin.js +49 -25
- package/esm/components/icons.d.ts +11 -2
- package/esm/components/icons.js +64 -22
- package/esm/components/json-schema/Array.js +6 -4
- package/esm/components/json-schema/Item.js +4 -4
- package/esm/components/json-schema/Object.js +9 -5
- package/esm/components/json-schema/index.d.ts +1 -0
- package/esm/components/json-schema/index.js +1 -1
- package/esm/components/menu/MenuContext.js +1 -1
- package/esm/components/menu/MenuItem.js +3 -2
- package/esm/components/menu/SubMenu.js +3 -3
- package/esm/components/menu/index.d.ts +65 -60
- package/esm/components/menu/index.js +34 -14
- package/esm/components/schema-editor/Array.js +3 -3
- package/esm/components/schema-editor/Common.d.ts +1 -0
- package/esm/components/schema-editor/Common.js +7 -7
- package/esm/components/schema-editor/Item.d.ts +1 -0
- package/esm/components/schema-editor/Item.js +1 -1
- package/esm/components/schema-editor/Object.js +5 -5
- package/esm/components/schema-editor/SchemaVariableList.js +1 -1
- package/esm/components/schema-editor/SchemaVariableListPicker.js +1 -1
- package/esm/components/schema-editor/index.d.ts +41 -40
- package/esm/components/schema-editor/index.js +3 -3
- package/esm/components/table/Cell.d.ts +80 -80
- package/esm/components/table/Cell.js +1 -1
- package/esm/components/table/HeadCellDropDown.js +1 -1
- package/esm/components/table/HeadCellFilter.d.ts +40 -40
- package/esm/components/table/HeadCellFilter.js +1 -1
- package/esm/components/table/HeadCellSelect.d.ts +40 -40
- package/esm/components/table/HeadCellSelect.js +1 -1
- package/esm/components/table/HeadCellSort.d.ts +5 -2
- package/esm/components/table/HeadCellSort.js +11 -11
- package/esm/components/table/ItemActionsWrapper.js +1 -1
- package/esm/components/table/index.d.ts +121 -121
- package/esm/components/table/index.js +1 -1
- package/esm/components/virtual-list/AutoSizer.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-sub-form.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.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 +15 -8
- 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/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 -2
- package/esm/locale/zh-CN.js +8 -3
- package/esm/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +1 -1
- package/esm/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +1 -1
- package/esm/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +1 -1
- package/esm/node_modules/@babel/runtime/helpers/esm/classCallCheck.js +1 -1
- package/esm/node_modules/@babel/runtime/helpers/esm/createClass.js +1 -1
- package/esm/node_modules/@babel/runtime/helpers/esm/createSuper.js +1 -1
- package/esm/node_modules/@babel/runtime/helpers/esm/defineProperty.js +1 -1
- package/esm/node_modules/@babel/runtime/helpers/esm/extends.js +1 -1
- package/esm/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js +1 -1
- package/esm/node_modules/@babel/runtime/helpers/esm/inherits.js +1 -1
- package/esm/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js +1 -1
- package/esm/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +1 -1
- package/esm/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +1 -1
- package/esm/node_modules/@babel/runtime/helpers/esm/objectSpread2.js +1 -1
- package/esm/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +1 -1
- package/esm/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +1 -1
- package/esm/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js +1 -1
- package/esm/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +1 -1
- package/esm/node_modules/@babel/runtime/helpers/esm/slicedToArray.js +1 -1
- package/esm/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +1 -1
- package/esm/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +1 -1
- package/esm/node_modules/@babel/runtime/helpers/esm/typeof.js +1 -1
- package/esm/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +1 -1
- package/esm/node_modules/rc-overflow/es/Item.js +1 -1
- package/esm/node_modules/rc-overflow/es/Overflow.js +4 -3
- package/esm/node_modules/rc-overflow/es/RawItem.js +2 -2
- package/esm/node_modules/rc-overflow/es/context.js +10 -0
- package/esm/node_modules/rc-overflow/es/hooks/channelUpdate.js +1 -1
- package/esm/node_modules/rc-overflow/es/hooks/useEffectState.js +1 -1
- package/esm/node_modules/rc-overflow/es/index.js +1 -1
- package/esm/node_modules/rc-resize-observer/es/Collection.js +1 -1
- package/esm/node_modules/rc-resize-observer/es/SingleObserver/DomWrapper.js +1 -1
- package/esm/node_modules/rc-resize-observer/es/SingleObserver/index.js +1 -1
- package/esm/node_modules/rc-resize-observer/es/index.js +1 -1
- package/esm/node_modules/rc-resize-observer/es/utils/observerUtil.js +1 -1
- package/esm/node_modules/rc-util/es/Children/toArray.js +3 -4
- package/esm/node_modules/rc-util/es/Dom/canUseDom.js +1 -1
- package/esm/node_modules/rc-util/es/Dom/findDOMNode.js +1 -1
- package/esm/node_modules/rc-util/es/hooks/useEvent.js +1 -1
- package/esm/node_modules/rc-util/es/hooks/useLayoutEffect.js +16 -2
- package/esm/node_modules/rc-util/es/raf.js +1 -1
- package/esm/node_modules/rc-util/es/ref.js +3 -4
- package/esm/node_modules/rc-util/es/warning.js +1 -1
- package/esm/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +1 -1
- 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 +12 -13
- package/lib/components/Alert.d.ts +122 -122
- package/lib/components/Alert.js +64 -27
- package/lib/components/Alert2.d.ts +20 -20
- package/lib/components/Alert2.js +13 -17
- package/lib/components/AnchorNav.d.ts +20 -20
- package/lib/components/AnchorNav.js +10 -12
- package/lib/components/ArrayInput.d.ts +40 -40
- package/lib/components/ArrayInput.js +17 -14
- package/lib/components/AsideNav.d.ts +10 -10
- package/lib/components/AsideNav.js +13 -15
- package/lib/components/AssociatedSelection.d.ts +80 -80
- package/lib/components/AssociatedSelection.js +11 -17
- package/lib/components/Avatar.d.ts +102 -101
- package/lib/components/Avatar.js +10 -6
- package/lib/components/Badge.d.ts +1 -1
- package/lib/components/Badge.js +13 -13
- package/lib/components/BaiduMapPicker.js +41 -34
- package/lib/components/BarCode.js +5 -5
- package/lib/components/Breadcrumb.js +21 -25
- package/lib/components/Button.d.ts +30 -30
- package/lib/components/Button.js +7 -8
- package/lib/components/CalendarMobile.d.ts +81 -80
- package/lib/components/CalendarMobile.js +55 -41
- package/lib/components/Card.d.ts +110 -110
- package/lib/components/Card.js +22 -19
- package/lib/components/Cascader.d.ts +4 -3
- package/lib/components/Cascader.js +114 -114
- package/lib/components/ChainedDropdownSelection.d.ts +559 -0
- package/lib/components/ChainedDropdownSelection.js +116 -0
- package/lib/components/ChainedSelection.d.ts +80 -80
- package/lib/components/ChainedSelection.js +23 -20
- package/lib/components/Checkbox.d.ts +11 -10
- package/lib/components/Checkbox.js +10 -10
- package/lib/components/CityArea.js +10 -11
- package/lib/components/CityDB.js +1 -1
- package/lib/components/CodeMirror.js +5 -2
- package/lib/components/Collapse.d.ts +152 -130
- package/lib/components/Collapse.js +19 -17
- package/lib/components/CollapseGroup.d.ts +53 -31
- package/lib/components/CollapseGroup.js +22 -19
- package/lib/components/ColorPicker.d.ts +84 -80
- package/lib/components/ColorPicker.js +44 -19
- package/lib/components/Combo.js +16 -73
- package/lib/components/ConfirmBox.d.ts +82 -81
- package/lib/components/ConfirmBox.js +31 -21
- package/lib/components/ContextMenu.d.ts +2 -2
- package/lib/components/ContextMenu.js +37 -19
- package/lib/components/DatePicker.d.ts +125 -121
- package/lib/components/DatePicker.js +28 -27
- package/lib/components/DateRangePicker.d.ts +280 -280
- package/lib/components/DateRangePicker.js +67 -48
- package/lib/components/DndContainer.js +6 -8
- package/lib/components/Drawer.d.ts +30 -30
- package/lib/components/Drawer.js +13 -15
- package/lib/components/DropDownSelection.d.ts +555 -0
- package/lib/components/DropDownSelection.js +84 -0
- package/lib/components/Editor.d.ts +40 -40
- package/lib/components/Editor.js +9 -11
- package/lib/components/Form.js +8 -5
- package/lib/components/FormField.js +20 -21
- package/lib/components/GaodeMapPicker.js +10 -7
- package/lib/components/GridNav.js +15 -16
- package/lib/components/GroupedSelection.d.ts +80 -80
- package/lib/components/GroupedSelection.js +22 -19
- package/lib/components/Html.js +5 -7
- package/lib/components/ImageGallery.d.ts +40 -40
- package/lib/components/ImageGallery.js +28 -25
- package/lib/components/Input.js +6 -3
- package/lib/components/InputBox.d.ts +21 -20
- package/lib/components/InputBox.js +11 -6
- package/lib/components/InputBoxWithSuggestion.d.ts +1 -0
- package/lib/components/InputBoxWithSuggestion.js +12 -9
- package/lib/components/InputTable.js +25 -22
- package/lib/components/Layout.d.ts +10 -10
- package/lib/components/Layout.js +13 -26
- package/lib/components/Link.js +8 -4
- package/lib/components/ListGroup.d.ts +10 -10
- package/lib/components/ListGroup.js +8 -5
- package/lib/components/ListMenu.d.ts +81 -80
- package/lib/components/ListMenu.js +14 -10
- package/lib/components/LocationPicker.d.ts +84 -80
- package/lib/components/LocationPicker.js +45 -15
- package/lib/components/Markdown.js +5 -2
- package/lib/components/Modal.d.ts +40 -40
- package/lib/components/Modal.js +15 -17
- package/lib/components/ModalManager.js +1 -1
- package/lib/components/MonthRangePicker.d.ts +200 -200
- package/lib/components/MultilineText.d.ts +40 -40
- package/lib/components/MultilineText.js +9 -6
- package/lib/components/NumberInput.d.ts +32 -35
- package/lib/components/NumberInput.js +20 -10
- package/lib/components/Pagination.d.ts +86 -81
- package/lib/components/Pagination.js +40 -28
- package/lib/components/Picker.js +13 -14
- package/lib/components/PickerColumn.d.ts +1 -1
- package/lib/components/PickerColumn.js +7 -5
- package/lib/components/PickerContainer.d.ts +1 -0
- package/lib/components/PickerContainer.js +8 -5
- package/lib/components/PopOverContainer.d.ts +3 -0
- package/lib/components/PopOverContainer.js +19 -5
- package/lib/components/PopUp.d.ts +80 -80
- package/lib/components/PopUp.js +18 -20
- package/lib/components/Progress.d.ts +80 -80
- package/lib/components/Progress.js +14 -11
- package/lib/components/PullRefresh.js +8 -14
- package/lib/components/Radios.d.ts +41 -40
- package/lib/components/Radios.js +13 -24
- package/lib/components/Range.d.ts +2 -1
- package/lib/components/Range.js +83 -34
- package/lib/components/Rating.d.ts +30 -30
- package/lib/components/Rating.js +14 -15
- package/lib/components/ResultBox.d.ts +123 -81
- package/lib/components/ResultBox.js +34 -30
- package/lib/components/ResultList.d.ts +40 -40
- package/lib/components/ResultList.js +19 -15
- package/lib/components/ResultTableList.d.ts +80 -80
- package/lib/components/ResultTableList.js +13 -13
- package/lib/components/ResultTreeList.d.ts +40 -40
- package/lib/components/ResultTreeList.js +21 -13
- package/lib/components/RichText.js +6 -8
- package/lib/components/SearchBox.d.ts +83 -82
- package/lib/components/SearchBox.js +28 -24
- package/lib/components/Select.d.ts +1933 -1933
- package/lib/components/Select.js +66 -62
- package/lib/components/SelectMobile.d.ts +37 -0
- package/lib/components/SelectMobile.js +374 -0
- package/lib/components/Selection.d.ts +80 -80
- package/lib/components/Selection.js +7 -9
- package/lib/components/SparkLine.d.ts +40 -40
- package/lib/components/SparkLine.js +8 -5
- package/lib/components/Spinner.d.ts +50 -50
- package/lib/components/Spinner.js +13 -16
- package/lib/components/Steps.js +20 -21
- package/lib/components/Switch.d.ts +10 -10
- package/lib/components/Switch.js +8 -10
- package/lib/components/TableSelection.d.ts +80 -80
- package/lib/components/TableSelection.js +35 -29
- package/lib/components/Tabs.d.ts +92 -80
- package/lib/components/Tabs.js +122 -49
- package/lib/components/TabsTransfer.d.ts +41 -40
- package/lib/components/TabsTransfer.js +20 -16
- package/lib/components/TabsTransferPicker.d.ts +2 -0
- package/lib/components/TabsTransferPicker.js +10 -7
- package/lib/components/Tag.d.ts +90 -90
- package/lib/components/Tag.js +12 -17
- package/lib/components/Textarea.d.ts +41 -40
- package/lib/components/Textarea.js +9 -6
- package/lib/components/Timeline.js +6 -7
- package/lib/components/TimelineItem.d.ts +1 -1
- package/lib/components/TimelineItem.js +18 -14
- package/lib/components/Tinymce.d.ts +1 -0
- package/lib/components/Tinymce.js +11 -4
- package/lib/components/TitleBar.js +10 -16
- package/lib/components/Toast.d.ts +120 -120
- package/lib/components/Toast.js +14 -16
- package/lib/components/Tooltip.js +8 -10
- package/lib/components/TooltipWrapper.d.ts +31 -31
- package/lib/components/TooltipWrapper.js +6 -8
- package/lib/components/Transfer.d.ts +174 -172
- package/lib/components/Transfer.js +61 -42
- package/lib/components/TransferDropDown.d.ts +164 -160
- package/lib/components/TransferDropDown.js +59 -26
- package/lib/components/TransferPicker.d.ts +2 -0
- package/lib/components/TransferPicker.js +10 -7
- package/lib/components/TransferSearch.js +10 -6
- package/lib/components/Tree.d.ts +241 -240
- package/lib/components/Tree.js +104 -84
- package/lib/components/TreeSelection.d.ts +80 -80
- package/lib/components/TreeSelection.js +17 -18
- package/lib/components/UserSelect.d.ts +40 -40
- package/lib/components/UserSelect.js +98 -91
- package/lib/components/UserTabSelect.d.ts +40 -40
- package/lib/components/UserTabSelect.js +17 -18
- package/lib/components/WithRemoteConfig.js +11 -8
- package/lib/components/WithStore.js +5 -2
- package/lib/components/calendar/Calendar.d.ts +2 -0
- package/lib/components/calendar/Calendar.js +12 -5
- package/lib/components/calendar/CalendarContainer.js +5 -2
- package/lib/components/calendar/DaysView.d.ts +3 -0
- package/lib/components/calendar/DaysView.js +70 -56
- package/lib/components/calendar/MonthsView.js +18 -15
- package/lib/components/calendar/QuartersView.d.ts +11 -0
- package/lib/components/calendar/QuartersView.js +59 -14
- package/lib/components/calendar/TimeView.js +35 -30
- package/lib/components/calendar/YearsView.js +18 -15
- package/lib/components/condition-builder/Expression.d.ts +1 -1
- package/lib/components/condition-builder/Expression.js +10 -7
- package/lib/components/condition-builder/Field.d.ts +3 -7
- package/lib/components/condition-builder/Field.js +16 -71
- package/lib/components/condition-builder/Formula.js +6 -3
- package/lib/components/condition-builder/Func.js +16 -13
- package/lib/components/condition-builder/Group.d.ts +10 -1
- package/lib/components/condition-builder/Group.js +27 -20
- package/lib/components/condition-builder/GroupOrItem.d.ts +10 -1
- package/lib/components/condition-builder/GroupOrItem.js +19 -13
- package/lib/components/condition-builder/InputSwitch.js +10 -11
- package/lib/components/condition-builder/Item.d.ts +1 -1
- package/lib/components/condition-builder/Item.js +19 -17
- package/lib/components/condition-builder/Value.js +18 -10
- package/lib/components/condition-builder/config.js +1 -1
- package/lib/components/condition-builder/index.d.ts +10 -1
- package/lib/components/condition-builder/index.js +13 -6
- package/lib/components/formula/Editor.d.ts +57 -40
- package/lib/components/formula/Editor.js +128 -25
- package/lib/components/formula/FuncList.js +33 -16
- package/lib/components/formula/Input.d.ts +272 -0
- package/lib/components/formula/Input.js +128 -0
- package/lib/components/formula/Picker.d.ts +64 -45
- package/lib/components/formula/Picker.js +140 -44
- package/lib/components/formula/VariableList.d.ts +1 -0
- package/lib/components/formula/VariableList.js +128 -21
- package/lib/components/formula/plugin.d.ts +4 -2
- package/lib/components/formula/plugin.js +48 -24
- package/lib/components/icons.d.ts +11 -2
- package/lib/components/icons.js +76 -30
- package/lib/components/json-schema/Array.js +18 -13
- package/lib/components/json-schema/Item.js +11 -12
- package/lib/components/json-schema/Object.js +22 -15
- package/lib/components/json-schema/index.d.ts +1 -0
- package/lib/components/json-schema/index.js +6 -7
- package/lib/components/menu/MenuContext.js +1 -1
- package/lib/components/menu/MenuItem.js +18 -19
- package/lib/components/menu/SubMenu.js +19 -21
- package/lib/components/menu/index.d.ts +75 -70
- package/lib/components/menu/index.js +46 -28
- package/lib/components/schema-editor/Array.js +11 -8
- package/lib/components/schema-editor/Common.d.ts +1 -0
- package/lib/components/schema-editor/Common.js +20 -17
- package/lib/components/schema-editor/Item.d.ts +1 -0
- package/lib/components/schema-editor/Item.js +5 -2
- package/lib/components/schema-editor/Object.js +16 -13
- package/lib/components/schema-editor/SchemaVariableList.js +9 -6
- package/lib/components/schema-editor/SchemaVariableListPicker.js +7 -4
- package/lib/components/schema-editor/index.d.ts +41 -40
- package/lib/components/schema-editor/index.js +7 -7
- package/lib/components/table/Cell.d.ts +40 -40
- package/lib/components/table/Cell.js +5 -6
- package/lib/components/table/HeadCellDropDown.js +8 -9
- package/lib/components/table/HeadCellFilter.d.ts +40 -40
- package/lib/components/table/HeadCellFilter.js +12 -13
- package/lib/components/table/HeadCellSelect.d.ts +40 -40
- package/lib/components/table/HeadCellSelect.js +6 -7
- package/lib/components/table/HeadCellSort.d.ts +5 -2
- package/lib/components/table/HeadCellSort.js +19 -20
- package/lib/components/table/ItemActionsWrapper.js +5 -2
- package/lib/components/table/index.d.ts +81 -81
- package/lib/components/table/index.js +62 -63
- package/lib/components/virtual-list/AutoSizer.js +5 -2
- 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 +6 -6
- package/lib/helper.css +159 -0
- package/lib/hooks/use-set-state.js +1 -1
- package/lib/hooks/use-sub-form.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 +7 -24
- package/lib/icons/alert-info.svg.js +7 -24
- package/lib/icons/alert-success.svg.js +7 -24
- package/lib/icons/alert-warning.svg.js +7 -24
- package/lib/icons/back.svg.js +7 -24
- package/lib/icons/calendar.svg.js +11 -28
- package/lib/icons/caret.svg.js +7 -24
- package/lib/icons/check.svg.js +7 -24
- package/lib/icons/clock.svg.js +9 -26
- package/lib/icons/close-small.svg.js +8 -25
- package/lib/icons/close.svg.js +7 -24
- package/lib/icons/cloud-upload.svg.js +7 -24
- package/lib/icons/column-filter.svg.js +7 -24
- package/lib/icons/columns.svg.js +7 -24
- package/lib/icons/compress-alt.svg.js +7 -24
- package/lib/icons/copy.svg.js +9 -26
- package/lib/icons/date.svg.js +9 -26
- package/lib/icons/department.svg.js +12 -29
- package/lib/icons/desk-empty.svg.js +19 -36
- package/lib/icons/dot.svg.js +10 -27
- package/lib/icons/down-arrow-bold.svg.js +7 -24
- package/lib/icons/down.svg.js +7 -24
- package/lib/icons/download.svg.js +7 -24
- package/lib/icons/drag-bar.svg.js +15 -32
- package/lib/icons/drag.svg.js +7 -24
- package/lib/icons/edit.svg.js +7 -24
- package/lib/icons/ellipsis-v.svg.js +7 -24
- package/lib/icons/enter.svg.js +7 -24
- package/lib/icons/exchange.svg.js +7 -24
- package/lib/icons/expand-alt.svg.js +7 -24
- package/lib/icons/fail.svg.js +9 -26
- package/lib/icons/file.svg.js +8 -25
- package/lib/icons/filter.svg.js +7 -24
- package/lib/icons/folder.svg.js +9 -26
- package/lib/icons/function.svg.js +20 -30
- package/lib/icons/home.svg.js +7 -24
- package/lib/icons/image.svg.js +7 -24
- package/lib/icons/info-circle.svg.js +7 -24
- package/lib/icons/info.svg.js +8 -25
- package/lib/icons/input-clear.svg.js +7 -24
- package/lib/icons/invisible.svg.js +7 -24
- package/lib/icons/left-arrow.svg.js +7 -24
- package/lib/icons/loading-outline.svg.js +7 -24
- package/lib/icons/location.svg.js +7 -24
- package/lib/icons/menu.svg.js +7 -24
- package/lib/icons/minus.svg.js +7 -24
- package/lib/icons/move.svg.js +7 -24
- package/lib/icons/mute.svg.js +7 -24
- package/lib/icons/new-edit.svg.js +7 -24
- package/lib/icons/pause.svg.js +7 -24
- package/lib/icons/pencil.svg.js +7 -24
- package/lib/icons/play.svg.js +7 -24
- package/lib/icons/plus-cicle.svg.js +7 -24
- package/lib/icons/plus-fine.svg.js +7 -24
- package/lib/icons/plus.svg.js +7 -24
- package/lib/icons/post.svg.js +12 -29
- package/lib/icons/question-mark.svg.js +8 -25
- package/lib/icons/question.svg.js +7 -24
- package/lib/icons/redo.svg.js +7 -24
- package/lib/icons/refresh.svg.js +7 -24
- package/lib/icons/reload.svg.js +7 -24
- package/lib/icons/remove.svg.js +7 -24
- package/lib/icons/retry.svg.js +9 -26
- package/lib/icons/right-arrow-bold.svg.js +7 -24
- package/lib/icons/right-arrow.svg.js +7 -24
- package/lib/icons/right-double-arrow.svg.js +7 -24
- package/lib/icons/role.svg.js +11 -28
- package/lib/icons/rotate-left.svg.js +8 -25
- package/lib/icons/rotate-right.svg.js +8 -25
- package/lib/icons/scale-origin.svg.js +9 -26
- package/lib/icons/schedule.svg.js +9 -26
- package/lib/icons/search.svg.js +7 -24
- package/lib/icons/setting.svg.js +7 -24
- package/lib/icons/slider-handle-icon.svg.js +7 -24
- package/lib/icons/sort-asc.svg.js +7 -24
- package/lib/icons/sort-default.svg.js +8 -25
- package/lib/icons/sort-desc.svg.js +7 -24
- package/lib/icons/star.svg.js +7 -24
- package/lib/icons/status-close.svg.js +7 -24
- package/lib/icons/steps-finsh.svg.js +7 -24
- package/lib/icons/success.svg.js +9 -26
- package/lib/icons/transparent.svg.js +12 -29
- package/lib/icons/trash.svg.js +7 -24
- package/lib/icons/tree-down.svg.js +7 -24
- package/lib/icons/undo.svg.js +7 -24
- package/lib/icons/upload.svg.js +7 -24
- package/lib/icons/user-remove.svg.js +9 -26
- package/lib/icons/view.svg.js +7 -24
- package/lib/icons/volume.svg.js +8 -25
- package/lib/icons/warning-mark.svg.js +8 -25
- package/lib/icons/warning.svg.js +7 -24
- package/lib/icons/window-restore.svg.js +7 -24
- package/lib/icons/zoom-in.svg.js +7 -24
- package/lib/icons/zoom-out.svg.js +7 -24
- package/lib/index.js +1 -1
- package/lib/locale/de-DE.js +7 -2
- package/lib/locale/en-US.js +7 -2
- package/lib/locale/zh-CN.js +8 -3
- package/lib/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/classCallCheck.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/createClass.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/createSuper.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/defineProperty.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/extends.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/inherits.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/objectSpread2.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/slicedToArray.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/typeof.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +1 -1
- package/lib/node_modules/rc-overflow/es/Item.js +1 -1
- package/lib/node_modules/rc-overflow/es/Overflow.js +5 -5
- package/lib/node_modules/rc-overflow/es/RawItem.js +7 -7
- package/lib/node_modules/rc-overflow/es/context.js +18 -0
- package/lib/node_modules/rc-overflow/es/hooks/channelUpdate.js +1 -1
- package/lib/node_modules/rc-overflow/es/hooks/useEffectState.js +1 -1
- package/lib/node_modules/rc-overflow/es/index.js +1 -1
- package/lib/node_modules/rc-resize-observer/es/Collection.js +1 -1
- package/lib/node_modules/rc-resize-observer/es/SingleObserver/DomWrapper.js +1 -1
- package/lib/node_modules/rc-resize-observer/es/SingleObserver/index.js +1 -1
- package/lib/node_modules/rc-resize-observer/es/index.js +1 -1
- package/lib/node_modules/rc-resize-observer/es/utils/observerUtil.js +1 -1
- package/lib/node_modules/rc-util/es/Children/toArray.js +3 -4
- package/lib/node_modules/rc-util/es/Dom/canUseDom.js +1 -1
- package/lib/node_modules/rc-util/es/Dom/findDOMNode.js +1 -1
- package/lib/node_modules/rc-util/es/hooks/useEvent.js +1 -1
- package/lib/node_modules/rc-util/es/hooks/useLayoutEffect.js +16 -2
- package/lib/node_modules/rc-util/es/raf.js +1 -1
- package/lib/node_modules/rc-util/es/ref.js +3 -4
- package/lib/node_modules/rc-util/es/warning.js +1 -1
- package/lib/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +1 -1
- package/lib/packages/amis-ui/scss/helper.scss.js +1 -1
- package/lib/packages/amis-ui/scss/themes/ang.scss.js +1 -1
- package/lib/packages/amis-ui/scss/themes/antd.scss.js +1 -1
- package/lib/packages/amis-ui/scss/themes/cxd.scss.js +1 -1
- package/lib/packages/amis-ui/scss/themes/dark.scss.js +1 -1
- package/lib/packages/amis-ui/scss/themes/default.scss.js +1 -1
- package/lib/themes/ang.css +1280 -691
- package/lib/themes/ang.js +1 -1
- package/lib/themes/antd.css +1280 -691
- package/lib/themes/antd.js +1 -1
- package/lib/themes/cxd.css +1280 -691
- package/lib/themes/cxd.js +1 -1
- package/lib/themes/dark.css +1280 -691
- package/lib/themes/dark.js +1 -1
- package/lib/themes/default.css +1280 -691
- package/package.json +10 -5
- package/scss/_components.scss +20 -9
- package/scss/_mixins.scss +0 -1
- package/scss/_properties.scss +30 -4
- package/scss/_variables.scss +20 -0
- package/scss/base/_common.scss +4 -0
- package/scss/components/_button-group.scss +1 -0
- package/scss/components/_calendar.scss +24 -14
- package/scss/components/_cards.scss +3 -10
- package/scss/components/_cascader.scss +26 -3
- package/scss/components/_city-area.scss +6 -0
- package/scss/components/_collapse-group.scss +11 -1
- package/scss/components/_collapse.scss +34 -1
- package/scss/components/_column-toggler.scss +11 -9
- package/scss/components/_condition-builder.scss +30 -4
- package/scss/components/_crud.scss +22 -12
- package/scss/components/_debug.scss +34 -1
- package/scss/components/_drawer.scss +10 -1
- package/scss/components/_dropdown.scss +13 -9
- package/scss/components/_formula.scss +139 -37
- package/scss/components/_input-box.scss +26 -1
- package/scss/components/_json-schema-editor.scss +2 -2
- package/scss/components/_json-schema.scss +30 -2
- package/scss/components/_list-menu.scss +40 -0
- package/scss/components/_list.scss +3 -10
- package/scss/components/_menu.scss +1 -0
- package/scss/components/_nav.scss +1 -0
- package/scss/components/_panel.scss +1 -1
- package/scss/components/_picker-columns.scss +2 -4
- package/scss/components/_popup.scss +8 -1
- package/scss/components/_progress.scss +1 -1
- package/scss/components/_result-box.scss +5 -0
- package/scss/components/_search-box.scss +12 -0
- package/scss/components/_steps.scss +5 -3
- package/scss/components/_table.scss +127 -129
- package/scss/components/_tabs.scss +12 -0
- package/scss/components/_timeline.scss +2 -1
- package/scss/components/form/_checks.scss +11 -1
- package/scss/components/form/_color.scss +31 -5
- package/scss/components/form/_combo.scss +27 -0
- package/scss/components/form/_date-range.scss +24 -5
- package/scss/components/form/_date.scss +13 -10
- package/scss/components/form/_editor.scss +4 -0
- package/scss/components/form/_fieldset.scss +13 -0
- package/scss/components/form/_form.scss +259 -109
- package/scss/components/form/_input-group.scss +6 -0
- package/scss/components/form/_list.scss +1 -1
- package/scss/components/form/_location.scss +39 -0
- package/scss/components/form/_matrix.scss +2 -0
- package/scss/components/form/_nested-select.scss +9 -3
- package/scss/components/form/_number.scss +8 -0
- package/scss/components/form/_picker.scss +12 -0
- package/scss/components/form/_range.scss +47 -5
- package/scss/components/form/_select.scss +39 -1
- package/scss/components/form/_selection.scss +46 -2
- package/scss/components/form/_text.scss +5 -6
- package/scss/components/form/_transfer.scss +50 -1
- package/scss/components/form/_tree.scss +34 -4
- package/scss/components/react-datetime.scss +8 -0
- package/scss/helper/sizing/_width.md +105 -94
- package/scss/helper/sizing/_width.scss +16 -0
- package/esm/_virtual/index.js +0 -8
- package/esm/_virtual/react-is.development.js +0 -8
- package/esm/_virtual/react-is.production.min.js +0 -8
- package/esm/node_modules/rc-util/node_modules/react-is/cjs/react-is.development.js +0 -195
- package/esm/node_modules/rc-util/node_modules/react-is/cjs/react-is.production.min.js +0 -31
- package/esm/node_modules/rc-util/node_modules/react-is/index.js +0 -17
- package/lib/_virtual/index.js +0 -12
- package/lib/_virtual/react-is.development.js +0 -12
- package/lib/_virtual/react-is.production.min.js +0 -12
- package/lib/node_modules/rc-util/node_modules/react-is/cjs/react-is.development.js +0 -199
- package/lib/node_modules/rc-util/node_modules/react-is/cjs/react-is.production.min.js +0 -35
- package/lib/node_modules/rc-util/node_modules/react-is/index.js +0 -19
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-ui v3.
|
|
2
|
+
* amis-ui v3.3.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { __extends, __awaiter, __generator, __assign, __rest, __read, __decorate, __metadata } from 'tslib';
|
|
7
|
-
import { parse,
|
|
7
|
+
import { parse, isMobile, noop, autobind, themeable, localeable, uncontrollable, isExpression, resolveVariableAndFilterForAsync } from 'amis-core';
|
|
8
8
|
import React__default from 'react';
|
|
9
9
|
import Editor, { FormulaEditor } from './Editor.js';
|
|
10
10
|
import ResultBox from '../ResultBox.js';
|
|
11
11
|
import Button from '../Button.js';
|
|
12
12
|
import { Icon } from '../icons.js';
|
|
13
13
|
import FinalModal from '../Modal.js';
|
|
14
|
+
import PopUp from '../PopUp.js';
|
|
15
|
+
import FormulaInput from './Input.js';
|
|
14
16
|
|
|
17
|
+
var InputSchemaType = [
|
|
18
|
+
'text',
|
|
19
|
+
'number',
|
|
20
|
+
'boolean',
|
|
21
|
+
'date',
|
|
22
|
+
'time',
|
|
23
|
+
'datetime',
|
|
24
|
+
'select'
|
|
25
|
+
];
|
|
15
26
|
var FormulaPicker = /** @class */ (function (_super) {
|
|
16
27
|
__extends(FormulaPicker, _super);
|
|
17
28
|
function FormulaPicker(props) {
|
|
@@ -21,7 +32,8 @@ var FormulaPicker = /** @class */ (function (_super) {
|
|
|
21
32
|
isOpened: false,
|
|
22
33
|
value: _this.props.value,
|
|
23
34
|
editorValue: _this.value2EditorValue(_this.props),
|
|
24
|
-
isError: false
|
|
35
|
+
isError: false,
|
|
36
|
+
variables: Array.isArray(props.variables) ? props.variables : []
|
|
25
37
|
};
|
|
26
38
|
return _this;
|
|
27
39
|
}
|
|
@@ -29,12 +41,21 @@ var FormulaPicker = /** @class */ (function (_super) {
|
|
|
29
41
|
var value = this.props.value;
|
|
30
42
|
if (value !== prevProps.value) {
|
|
31
43
|
this.setState({
|
|
32
|
-
value: typeof value === 'string' ? value : '',
|
|
44
|
+
value: typeof value === 'string' || !this.isTextInput() ? value : '',
|
|
33
45
|
editorValue: this.value2EditorValue(this.props)
|
|
34
46
|
});
|
|
35
47
|
}
|
|
36
48
|
};
|
|
37
49
|
FormulaPicker.prototype.value2EditorValue = function (props) {
|
|
50
|
+
var value = props.value;
|
|
51
|
+
if (!this.isTextInput()) {
|
|
52
|
+
var editorValue = '';
|
|
53
|
+
try {
|
|
54
|
+
editorValue = JSON.stringify(value);
|
|
55
|
+
}
|
|
56
|
+
catch (error) { }
|
|
57
|
+
return editorValue;
|
|
58
|
+
}
|
|
38
59
|
if (props.mixedMode) {
|
|
39
60
|
if (typeof props.value === 'string' &&
|
|
40
61
|
/^\s*\$\{(.+?)\}\s*$/.test(props.value)) {
|
|
@@ -46,6 +67,12 @@ var FormulaPicker = /** @class */ (function (_super) {
|
|
|
46
67
|
}
|
|
47
68
|
return String(props.value || '');
|
|
48
69
|
};
|
|
70
|
+
FormulaPicker.prototype.isTextInput = function () {
|
|
71
|
+
var inputSettings = this.props.inputSettings;
|
|
72
|
+
return (!inputSettings ||
|
|
73
|
+
(inputSettings === null || inputSettings === void 0 ? void 0 : inputSettings.type) === 'text' ||
|
|
74
|
+
!InputSchemaType.includes(inputSettings === null || inputSettings === void 0 ? void 0 : inputSettings.type));
|
|
75
|
+
};
|
|
49
76
|
FormulaPicker.prototype.handleConfirm = function () {
|
|
50
77
|
var _a, _b;
|
|
51
78
|
var value = this.state.value;
|
|
@@ -79,9 +106,33 @@ var FormulaPicker = /** @class */ (function (_super) {
|
|
|
79
106
|
});
|
|
80
107
|
};
|
|
81
108
|
FormulaPicker.prototype.handleEditorConfirm = function () {
|
|
82
|
-
|
|
83
|
-
var
|
|
84
|
-
this.
|
|
109
|
+
var _a, _b;
|
|
110
|
+
var _c = this.props; _c.translate; var inputSettings = _c.inputSettings;
|
|
111
|
+
var editorValue = this.state.editorValue;
|
|
112
|
+
if (this.isTextInput()) {
|
|
113
|
+
return this.confirm(editorValue);
|
|
114
|
+
}
|
|
115
|
+
else if (inputSettings) {
|
|
116
|
+
var result = editorValue;
|
|
117
|
+
var schemaType = inputSettings === null || inputSettings === void 0 ? void 0 : inputSettings.type;
|
|
118
|
+
try {
|
|
119
|
+
var ast = parse(editorValue, { evalMode: true, allowFilter: false });
|
|
120
|
+
if (schemaType === 'select' &&
|
|
121
|
+
inputSettings.multiple &&
|
|
122
|
+
ast.type === 'array') {
|
|
123
|
+
result = ast.members.map(function (i) { return i.value; });
|
|
124
|
+
}
|
|
125
|
+
else if (ast.type === 'literal' || ast.type === 'string') {
|
|
126
|
+
result = (_a = ast.value) !== null && _a !== void 0 ? _a : '';
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
this.setState({ isError: (_b = error === null || error === void 0 ? void 0 : error.message) !== null && _b !== void 0 ? _b : true });
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
this.setState({ isError: false });
|
|
134
|
+
return this.confirm(result);
|
|
135
|
+
}
|
|
85
136
|
};
|
|
86
137
|
FormulaPicker.prototype.confirm = function (value) {
|
|
87
138
|
var _this = this;
|
|
@@ -99,14 +150,29 @@ var FormulaPicker = /** @class */ (function (_super) {
|
|
|
99
150
|
FormulaPicker.prototype.handleClick = function () {
|
|
100
151
|
var _a, _b;
|
|
101
152
|
return __awaiter(this, void 0, void 0, function () {
|
|
102
|
-
var state,
|
|
103
|
-
return __generator(this, function (
|
|
104
|
-
switch (
|
|
153
|
+
var _c, variables, data, list, result, state, _d;
|
|
154
|
+
return __generator(this, function (_e) {
|
|
155
|
+
switch (_e.label) {
|
|
105
156
|
case 0:
|
|
106
|
-
_c =
|
|
107
|
-
|
|
157
|
+
_c = this.props, variables = _c.variables, data = _c.data;
|
|
158
|
+
if (!(typeof variables === 'function')) return [3 /*break*/, 2];
|
|
159
|
+
return [4 /*yield*/, variables(this.props)];
|
|
108
160
|
case 1:
|
|
109
|
-
|
|
161
|
+
list = _e.sent();
|
|
162
|
+
this.setState({ variables: list });
|
|
163
|
+
return [3 /*break*/, 4];
|
|
164
|
+
case 2:
|
|
165
|
+
if (!(typeof variables === 'string' && isExpression(variables))) return [3 /*break*/, 4];
|
|
166
|
+
return [4 /*yield*/, resolveVariableAndFilterForAsync(variables, data, '|raw')];
|
|
167
|
+
case 3:
|
|
168
|
+
result = _e.sent();
|
|
169
|
+
this.setState({ variables: result });
|
|
170
|
+
_e.label = 4;
|
|
171
|
+
case 4:
|
|
172
|
+
_d = [{}];
|
|
173
|
+
return [4 /*yield*/, ((_b = (_a = this.props).onPickerOpen) === null || _b === void 0 ? void 0 : _b.call(_a, this.props))];
|
|
174
|
+
case 5:
|
|
175
|
+
state = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_e.sent())])), { editorValue: this.value2EditorValue(this.props), isOpened: true }]);
|
|
110
176
|
this.setState(state);
|
|
111
177
|
return [2 /*return*/];
|
|
112
178
|
}
|
|
@@ -130,7 +196,28 @@ var FormulaPicker = /** @class */ (function (_super) {
|
|
|
130
196
|
this.setState(__assign(__assign({}, this.state), rest));
|
|
131
197
|
};
|
|
132
198
|
FormulaPicker.prototype.validate = function (value) {
|
|
133
|
-
this.props.translate;
|
|
199
|
+
var _a = this.props, __ = _a.translate, inputSettings = _a.inputSettings;
|
|
200
|
+
/** 处理非文本输入场景 */
|
|
201
|
+
if (inputSettings && !this.isTextInput()) {
|
|
202
|
+
var schemaType = inputSettings === null || inputSettings === void 0 ? void 0 : inputSettings.type;
|
|
203
|
+
var errorMsg = __('FormulaEditor.invalidValue');
|
|
204
|
+
/** 变量类型 */
|
|
205
|
+
if (typeof value === 'string') {
|
|
206
|
+
return true;
|
|
207
|
+
}
|
|
208
|
+
if (['number', 'boolean'].includes(schemaType)) {
|
|
209
|
+
return typeof value === schemaType ? true : errorMsg;
|
|
210
|
+
}
|
|
211
|
+
else if (['text', 'date', 'time', 'datetime'].includes(schemaType)) {
|
|
212
|
+
return typeof value === 'string' ? true : errorMsg;
|
|
213
|
+
}
|
|
214
|
+
else if (schemaType === 'select' && inputSettings.multiple) {
|
|
215
|
+
return Array.isArray(value) ? true : errorMsg;
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
return true;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
134
221
|
try {
|
|
135
222
|
value &&
|
|
136
223
|
parse(value, {
|
|
@@ -141,7 +228,7 @@ var FormulaPicker = /** @class */ (function (_super) {
|
|
|
141
228
|
}
|
|
142
229
|
catch (e) {
|
|
143
230
|
if (/\s(\d+:\d+)$/.test(e.message)) {
|
|
144
|
-
var
|
|
231
|
+
var _b = __read(/\s(\d+:\d+)$/.exec(e.message) || [], 2), position = _b[1];
|
|
145
232
|
return position;
|
|
146
233
|
}
|
|
147
234
|
return e.message;
|
|
@@ -149,16 +236,19 @@ var FormulaPicker = /** @class */ (function (_super) {
|
|
|
149
236
|
};
|
|
150
237
|
FormulaPicker.prototype.render = function () {
|
|
151
238
|
var _a, _b, _c;
|
|
152
|
-
var _d, _e, _f, _g, _h;
|
|
153
|
-
var
|
|
154
|
-
var
|
|
155
|
-
var iconElement =
|
|
239
|
+
var _d, _e, _f, _g, _h, _j;
|
|
240
|
+
var _k = this.props, cx = _k.classnames, __ = _k.translate, disabled = _k.disabled, _l = _k.allowInput, allowInput = _l === void 0 ? true : _l, className = _k.className, style = _k.style; _k.onChange; _k.size; var borderMode = _k.borderMode, placeholder = _k.placeholder, _m = _k.mode, mode = _m === void 0 ? 'input-button' : _m, btnLabel = _k.btnLabel, level = _k.level, btnSize = _k.btnSize, icon = _k.icon, title = _k.title, clearable = _k.clearable, functions = _k.functions, children = _k.children, variableMode = _k.variableMode, mixedMode = _k.mixedMode, evalMode = _k.evalMode, popOverContainer = _k.popOverContainer, useMobileUI = _k.useMobileUI, inputSettings = _k.inputSettings, rest = __rest(_k, ["classnames", "translate", "disabled", "allowInput", "className", "style", "onChange", "size", "borderMode", "placeholder", "mode", "btnLabel", "level", "btnSize", "icon", "title", "clearable", "functions", "children", "variableMode", "mixedMode", "evalMode", "popOverContainer", "useMobileUI", "inputSettings"]);
|
|
241
|
+
var _o = this.state, isOpened = _o.isOpened, value = _o.value, editorValue = _o.editorValue, isError = _o.isError;
|
|
242
|
+
var iconElement = React__default.createElement(Icon, { cx: cx, icon: icon, className: "Icon" });
|
|
243
|
+
var mobileUI = useMobileUI && isMobile();
|
|
156
244
|
return (React__default.createElement(React__default.Fragment, null,
|
|
157
245
|
children ? (children({
|
|
158
246
|
isOpened: this.state.isOpened,
|
|
159
247
|
onClick: this.handleClick,
|
|
160
248
|
setState: this.updateState
|
|
161
|
-
})) : (React__default.createElement("div", { className: cx('FormulaPicker',
|
|
249
|
+
})) : (React__default.createElement("div", { className: cx('FormulaPicker', mode === 'input-group' ? 'is-input-group' : '', {
|
|
250
|
+
'FormulaPicker--text': this.isTextInput()
|
|
251
|
+
}, className), style: style },
|
|
162
252
|
mode === 'button' && (React__default.createElement(Button, { className: cx('FormulaPicker-action', 'w-full'), level: level, size: btnSize, onClick: this.handleClick },
|
|
163
253
|
iconElement ? (React__default.cloneElement(iconElement, {
|
|
164
254
|
className: cx((_e = (_d = iconElement === null || iconElement === void 0 ? void 0 : iconElement.props) === null || _d === void 0 ? void 0 : _d.className) !== null && _e !== void 0 ? _e : '', 'FormulaPicker-icon', (_a = {},
|
|
@@ -171,26 +261,28 @@ var FormulaPicker = /** @class */ (function (_super) {
|
|
|
171
261
|
mode === 'input-button' && (React__default.createElement(React__default.Fragment, null,
|
|
172
262
|
React__default.createElement(ResultBox, { className: cx('FormulaPicker-input', isOpened ? 'is-active' : '', !!isError ? 'is-error' : ''), allowInput: allowInput, clearable: clearable, value: value, result: allowInput
|
|
173
263
|
? void 0
|
|
174
|
-
: FormulaEditor.highlightValue(value, variables, this.props.evalMode), itemRender: this.renderFormulaValue, onResultChange: noop, onChange: this.handleInputChange, disabled: disabled, borderMode: borderMode, placeholder: placeholder }),
|
|
264
|
+
: FormulaEditor.highlightValue(value, this.state.variables, this.props.evalMode), itemRender: this.renderFormulaValue, onResultChange: noop, onChange: this.handleInputChange, disabled: disabled, borderMode: borderMode, placeholder: placeholder }),
|
|
175
265
|
React__default.createElement(Button, { className: cx('FormulaPicker-action'), onClick: this.handleClick },
|
|
176
266
|
React__default.createElement(Icon, { icon: "function", className: cx('FormulaPicker-icon', 'icon', (_c = {},
|
|
177
267
|
_c['is-filled'] = !!value,
|
|
178
268
|
_c)) })))),
|
|
179
269
|
mode === 'input-group' && (React__default.createElement(React__default.Fragment, null,
|
|
180
|
-
React__default.createElement(
|
|
181
|
-
? void 0
|
|
182
|
-
: FormulaEditor.highlightValue(value, variables, this.props.evalMode), itemRender: this.renderFormulaValue, onResultChange: noop, onChange: this.handleInputChange, disabled: disabled, borderMode: borderMode, placeholder: placeholder }),
|
|
270
|
+
React__default.createElement(FormulaInput, { className: cx('FormulaPicker-input', isOpened ? 'is-active' : '', !!isError ? 'is-error' : ''), inputSettings: inputSettings, allowInput: allowInput, clearable: clearable, evalMode: evalMode, mixedMode: mixedMode, variables: this.state.variables, value: value, itemRender: this.renderFormulaValue, onChange: this.handleInputChange, disabled: disabled, borderMode: borderMode, placeholder: placeholder }),
|
|
183
271
|
React__default.createElement("a", { className: cx("FormulaPicker-toggler"), onClick: this.handleClick },
|
|
184
272
|
React__default.createElement(Icon, { icon: "function", className: "icon" })))))),
|
|
185
|
-
React__default.createElement(
|
|
273
|
+
mobileUI ? (React__default.createElement(PopUp, { className: cx("FormulaPicker-popup"), isShow: this.state.isOpened, showConfirm: true, onHide: this.close, onConfirm: this.handleEditorConfirm, container: popOverContainer },
|
|
274
|
+
React__default.createElement("div", { className: cx('FormulaPicker-popup-inner') },
|
|
275
|
+
React__default.createElement(Editor, __assign({}, rest, { evalMode: mixedMode ? true : evalMode, variables: this.state.variables, functions: (_f = this.state.functions) !== null && _f !== void 0 ? _f : functions, variableMode: (_g = this.state.variableMode) !== null && _g !== void 0 ? _g : variableMode, value: editorValue, onChange: this.handleEditorChange, selfVariableName: this.props.selfVariableName })),
|
|
276
|
+
!!isError ? (React__default.createElement("div", { className: cx('Dialog-info'), key: "info" },
|
|
277
|
+
React__default.createElement("span", { className: cx('Dialog-error') }, __('FormulaEditor.invalidData', { err: isError })))) : null))) : (React__default.createElement(FinalModal, { size: "lg", closeOnEsc: true, show: this.state.isOpened, onHide: this.close, container: popOverContainer },
|
|
186
278
|
React__default.createElement(FinalModal.Header, { onClose: this.close, className: "font-bold" }, __(title || 'FormulaEditor.title')),
|
|
187
279
|
React__default.createElement(FinalModal.Body, null,
|
|
188
|
-
React__default.createElement(Editor, __assign({}, rest, { evalMode: mixedMode ? true : evalMode, variables:
|
|
280
|
+
React__default.createElement(Editor, __assign({}, rest, { evalMode: mixedMode ? true : evalMode, variables: this.state.variables, functions: (_h = this.state.functions) !== null && _h !== void 0 ? _h : functions, variableMode: (_j = this.state.variableMode) !== null && _j !== void 0 ? _j : variableMode, value: editorValue, onChange: this.handleEditorChange, selfVariableName: this.props.selfVariableName }))),
|
|
189
281
|
React__default.createElement(FinalModal.Footer, null,
|
|
190
282
|
!!isError ? (React__default.createElement("div", { className: cx('Dialog-info'), key: "info" },
|
|
191
283
|
React__default.createElement("span", { className: cx('Dialog-error') }, __('FormulaEditor.invalidData', { err: isError })))) : null,
|
|
192
284
|
React__default.createElement(Button, { onClick: this.close }, __('cancel')),
|
|
193
|
-
React__default.createElement(Button, { onClick: this.handleEditorConfirm, level: "primary" }, __('confirm'))))));
|
|
285
|
+
React__default.createElement(Button, { onClick: this.handleEditorConfirm, level: "primary" }, __('confirm')))))));
|
|
194
286
|
};
|
|
195
287
|
FormulaPicker.defaultProps = {
|
|
196
288
|
evalMode: true
|
|
@@ -261,4 +353,4 @@ var Picker = themeable(localeable(uncontrollable(FormulaPicker, {
|
|
|
261
353
|
value: 'onChange'
|
|
262
354
|
})));
|
|
263
355
|
|
|
264
|
-
export { FormulaPicker, Picker as default };
|
|
356
|
+
export { FormulaPicker, InputSchemaType, Picker as default };
|
|
@@ -17,6 +17,7 @@ export interface VariableListProps extends ThemeProps, SpinnerExtraProps {
|
|
|
17
17
|
placeholderRender?: (props: any) => JSX.Element | null;
|
|
18
18
|
onSelect?: (item: VariableItem) => void;
|
|
19
19
|
selfVariableName?: string;
|
|
20
|
+
expandTree?: boolean;
|
|
20
21
|
}
|
|
21
22
|
declare function VariableList(props: VariableListProps): React.JSX.Element;
|
|
22
23
|
declare const _default: {
|
|
@@ -1,51 +1,155 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-ui v3.
|
|
2
|
+
* amis-ui v3.3.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { __read } from 'tslib';
|
|
7
|
-
import React__default from 'react';
|
|
8
|
-
import { themeable,
|
|
6
|
+
import { __read, __assign } from 'tslib';
|
|
7
|
+
import React__default, { useEffect } from 'react';
|
|
8
|
+
import { themeable, filterTree } from 'amis-core';
|
|
9
9
|
import GroupedSelection from '../GroupedSelection.js';
|
|
10
10
|
import ThemedTabs, { Tab } from '../Tabs.js';
|
|
11
11
|
import TreeSelection from '../TreeSelection.js';
|
|
12
12
|
import SearchBox from '../SearchBox.js';
|
|
13
13
|
import { Badge } from '../Badge.js';
|
|
14
|
+
import { PopOverContainer } from '../PopOverContainer.js';
|
|
15
|
+
import { matchSorter } from 'match-sorter';
|
|
16
|
+
import TooltipWrapper from '../TooltipWrapper.js';
|
|
14
17
|
|
|
18
|
+
// 数组成员读取
|
|
19
|
+
var memberOpers = [
|
|
20
|
+
{
|
|
21
|
+
label: '取该成员的记录',
|
|
22
|
+
value: 'ARRAYMAP(${arr}, item => item.${member})',
|
|
23
|
+
description: '即该列所有记录'
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: '取符合条件的该成员的记录',
|
|
27
|
+
value: 'ARRAYFILTER(ARRAYMAP(${arr}, item => item.${member}), item => item === 条件)',
|
|
28
|
+
description: '即该列所有记录中符合条件的记录,需补充条件,例如:item === 1'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: '取列表中符合该成员条件的记录',
|
|
32
|
+
value: 'ARRAYFILTER(${arr}, item => item.${member} === 条件)',
|
|
33
|
+
description: '即当前列表中所有符合该成员条件的记录,需补充成员条件,例如:item.xxx === 1'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: '取列表中符合该成员条件的记录总数',
|
|
37
|
+
value: 'COUNT(ARRAYFILTER(${arr}, item => item.${member} === 条件))',
|
|
38
|
+
description: '即当前列表中所有符合该成员条件的记录总数,需补充成员条件,例如:item.xxx === 1'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
label: '取该成员去重之后的总数',
|
|
42
|
+
value: 'COUNT(UNIQ(${arr}, item.${member}))',
|
|
43
|
+
description: '即对该成员记录进行去重,并统计总数'
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: '取该成员的总和',
|
|
47
|
+
value: 'SUM(ARRAYMAP(${arr}, item => item.${member}))',
|
|
48
|
+
description: '即计算该成员记录的总和,需确认该成员记录均为数字类型'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: '取该成员的平均值',
|
|
52
|
+
value: 'AVG(ARRAYMAP(${arr}, item => item.${member}))',
|
|
53
|
+
description: '即计算该成员记录的平均值,需确认该成员记录均为数字类型'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
label: '取该成员的最大值',
|
|
57
|
+
value: 'MAX(ARRAYMAP(${arr}, item => item.${member}))',
|
|
58
|
+
description: '即计算该成员记录中最大值,需确认该成员记录均为数字类型'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
label: '取该成员的最小值',
|
|
62
|
+
value: 'MIN(ARRAYMAP(${arr}, item => item.${member}))',
|
|
63
|
+
description: '即计算该成员记录中最小值,需确认该成员记录均为数字类型'
|
|
64
|
+
}
|
|
65
|
+
];
|
|
15
66
|
function VariableList(props) {
|
|
16
|
-
var
|
|
67
|
+
var variableListRef = React__default.useRef(null);
|
|
68
|
+
var list = props.data, className = props.className, cx = props.classnames, _a = props.tabsMode, tabsMode = _a === void 0 ? 'line' : _a, themePrefix = props.classPrefix, itemClassName = props.itemClassName, selectMode = props.selectMode, onSelect = props.onSelect, placeholderRender = props.placeholderRender, selfVariableName = props.selfVariableName, expandTree = props.expandTree;
|
|
17
69
|
var _b = __read(React__default.useState(list), 2), filterVars = _b[0], setFilterVars = _b[1];
|
|
18
70
|
var classPrefix = "".concat(themePrefix, "FormulaEditor-VariableList");
|
|
71
|
+
useEffect(function () {
|
|
72
|
+
var data = props.data;
|
|
73
|
+
if (data) {
|
|
74
|
+
setFilterVars(data);
|
|
75
|
+
}
|
|
76
|
+
}, [props.data]);
|
|
19
77
|
var itemRender = props.itemRender && typeof props.itemRender === 'function'
|
|
20
78
|
? props.itemRender
|
|
21
79
|
: function (option, states) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
option.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
80
|
+
var _a;
|
|
81
|
+
return (React__default.createElement("div", null,
|
|
82
|
+
React__default.createElement("div", { className: cx("".concat(classPrefix, "-item"), itemClassName) },
|
|
83
|
+
option.label &&
|
|
84
|
+
selfVariableName &&
|
|
85
|
+
option.value === selfVariableName && (React__default.createElement(Badge, { classnames: cx, badge: {
|
|
86
|
+
mode: 'text',
|
|
87
|
+
text: 'self',
|
|
88
|
+
offset: [15, 2]
|
|
89
|
+
} },
|
|
90
|
+
React__default.createElement("label", null, option.label))),
|
|
91
|
+
option.memberDepth === undefined &&
|
|
92
|
+
option.label &&
|
|
93
|
+
(!selfVariableName || option.value !== selfVariableName) && (React__default.createElement(TooltipWrapper, { tooltip: (_a = option.description) !== null && _a !== void 0 ? _a : option.label, tooltipTheme: "dark" },
|
|
94
|
+
React__default.createElement("label", null, option.label))),
|
|
95
|
+
option.memberDepth !== undefined &&
|
|
96
|
+
option.label &&
|
|
97
|
+
(!selfVariableName || option.value !== selfVariableName) ? (option.memberDepth < 2 ? (React__default.createElement(PopOverContainer, { popOverContainer: function () {
|
|
98
|
+
return document.querySelector(".".concat(cx('FormulaPicker-Modal')));
|
|
99
|
+
}, popOverRender: function (_a) {
|
|
100
|
+
var onClose = _a.onClose;
|
|
101
|
+
return (React__default.createElement("ul", { className: cx("".concat(classPrefix, "-item-oper")) }, memberOpers.map(function (item, i) {
|
|
102
|
+
return (React__default.createElement(TooltipWrapper, { tooltip: item.description, tooltipTheme: "dark" },
|
|
103
|
+
React__default.createElement("li", { key: i, onClick: function () {
|
|
104
|
+
return handleMemberClick(__assign(__assign({}, item), { isMember: true }), option, onClose);
|
|
105
|
+
} },
|
|
106
|
+
React__default.createElement("span", null, item.label))));
|
|
107
|
+
})));
|
|
108
|
+
} }, function (_a) {
|
|
109
|
+
var _b;
|
|
110
|
+
var onClick = _a.onClick; _a.ref; _a.isOpened;
|
|
111
|
+
return (React__default.createElement(TooltipWrapper, { tooltip: (_b = option.description) !== null && _b !== void 0 ? _b : option.label, tooltipTheme: "dark" },
|
|
112
|
+
React__default.createElement("label", { onClick: onClick }, option.label)));
|
|
113
|
+
})) : (React__default.createElement("label", null, option.label))) : null,
|
|
114
|
+
(option === null || option === void 0 ? void 0 : option.tag) ? (React__default.createElement("span", { className: cx("".concat(classPrefix, "-item-tag")) }, option.tag)) : null)));
|
|
34
115
|
};
|
|
116
|
+
function handleMemberClick(item, option, onClose) {
|
|
117
|
+
// todo:暂时只提供一层的快捷操作
|
|
118
|
+
// const lastPointIdx = option.value.lastIndexOf('.');
|
|
119
|
+
var firstPointIdx = option.value.indexOf('.');
|
|
120
|
+
var arr = option.value.substring(0, firstPointIdx);
|
|
121
|
+
var member = option.value.substring(firstPointIdx + 1);
|
|
122
|
+
var value = item.value
|
|
123
|
+
.replace('${arr}', arr)
|
|
124
|
+
.replace('${member}', member);
|
|
125
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
126
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(__assign(__assign({}, item), { label: value, value: value }));
|
|
127
|
+
}
|
|
35
128
|
function onSearch(term) {
|
|
36
|
-
var tree =
|
|
129
|
+
var tree = filterTree(list, function (i, key, level, paths) {
|
|
130
|
+
return !!((Array.isArray(i.children) && i.children.length) ||
|
|
131
|
+
!!matchSorter([i].concat(paths), term, {
|
|
132
|
+
keys: ['label', 'value']
|
|
133
|
+
}).length);
|
|
134
|
+
}, 1, true);
|
|
37
135
|
setFilterVars(!term ? list : tree);
|
|
38
136
|
}
|
|
39
137
|
function renderSearchBox() {
|
|
40
138
|
return (React__default.createElement("div", { className: cx('FormulaEditor-VariableList-searchBox') },
|
|
41
|
-
React__default.createElement(SearchBox, { mini: false, onSearch: onSearch })));
|
|
139
|
+
React__default.createElement(SearchBox, { mini: false, onSearch: onSearch, useMobileUI: true })));
|
|
140
|
+
}
|
|
141
|
+
function handleChange(item) {
|
|
142
|
+
if (item.isMember || item.memberDepth !== undefined) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(item);
|
|
42
146
|
}
|
|
43
|
-
return (React__default.createElement("div", { className: cx(className, 'FormulaEditor-VariableList', selectMode && "FormulaEditor-VariableList-".concat(selectMode)) }, selectMode === 'tabs' ? (React__default.createElement(ThemedTabs, { tabsMode: tabsMode, className: cx("".concat(classPrefix, "-base ").concat(classPrefix, "-tabs")) }, filterVars.map(function (item, index) { return (React__default.createElement(Tab, { className: cx("".concat(classPrefix, "-tab")), eventKey: index, key: index, title: item.label },
|
|
44
|
-
React__default.createElement(VariableList, { classnames: cx, classPrefix: "".concat(classPrefix, "-sub-"), className: cx("".concat(classPrefix, "-sub")), itemRender: itemRender, placeholderRender: placeholderRender, selectMode: item.selectMode, data: item.children, onSelect:
|
|
147
|
+
return (React__default.createElement("div", { className: cx(className, 'FormulaEditor-VariableList', selectMode && "FormulaEditor-VariableList-".concat(selectMode)), ref: variableListRef }, selectMode === 'tabs' ? (React__default.createElement(ThemedTabs, { tabsMode: tabsMode, className: cx("".concat(classPrefix, "-base ").concat(classPrefix, "-tabs")) }, filterVars.map(function (item, index) { return (React__default.createElement(Tab, { className: cx("".concat(classPrefix, "-tab")), eventKey: index, key: index, title: item.label },
|
|
148
|
+
React__default.createElement(VariableList, { classnames: cx, classPrefix: "".concat(classPrefix, "-sub-"), className: cx("".concat(classPrefix, "-sub")), itemRender: itemRender, placeholderRender: placeholderRender, selectMode: item.selectMode, data: item.children, onSelect: handleChange, selfVariableName: selfVariableName }))); }))) : selectMode === 'tree' ? (React__default.createElement("div", { className: cx('FormulaEditor-VariableList-body') },
|
|
45
149
|
renderSearchBox(),
|
|
46
|
-
React__default.createElement(TreeSelection, { itemRender: itemRender, placeholderRender: placeholderRender, className: cx("".concat(classPrefix, "-base"), 'is-scrollable'), multiple: false, options: filterVars, onChange: function (item) { return
|
|
150
|
+
React__default.createElement(TreeSelection, { itemRender: itemRender, placeholderRender: placeholderRender, className: cx("".concat(classPrefix, "-base"), 'is-scrollable'), multiple: false, expand: expandTree ? 'all' : 'none', options: filterVars, onChange: function (item) { return handleChange(item); } }))) : (React__default.createElement("div", { className: cx('FormulaEditor-VariableList-body') },
|
|
47
151
|
renderSearchBox(),
|
|
48
|
-
React__default.createElement(GroupedSelection, { itemRender: itemRender, placeholderRender: placeholderRender, className: cx("".concat(classPrefix, "-base"), 'is-scrollable'), multiple: false, options: filterVars, onChange: function (item) { return
|
|
152
|
+
React__default.createElement(GroupedSelection, { itemRender: itemRender, placeholderRender: placeholderRender, className: cx("".concat(classPrefix, "-base"), 'is-scrollable'), multiple: false, options: filterVars, onChange: function (item) { return handleChange(item); } })))));
|
|
49
153
|
}
|
|
50
154
|
var VariableList$1 = themeable(VariableList);
|
|
51
155
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type CodeMirror from 'codemirror';
|
|
5
5
|
import { FormulaEditorProps, VariableItem } from './Editor';
|
|
6
|
-
export declare function editorFactory(dom: HTMLElement, cm: typeof CodeMirror, props: any): CodeMirror.Editor;
|
|
6
|
+
export declare function editorFactory(dom: HTMLElement, cm: typeof CodeMirror, props: any, options?: any): CodeMirror.Editor;
|
|
7
7
|
export declare class FormulaPlugin {
|
|
8
8
|
readonly editor: CodeMirror.Editor;
|
|
9
9
|
readonly cm: typeof CodeMirror;
|
|
@@ -19,7 +19,9 @@ export declare class FormulaPlugin {
|
|
|
19
19
|
end: number;
|
|
20
20
|
}[]): boolean;
|
|
21
21
|
insertBraces(originFrom: CodeMirror.Position, originTo: CodeMirror.Position): void;
|
|
22
|
-
insertContent(value: any, type?: 'variable' | 'func'): void;
|
|
22
|
+
insertContent(value: any, type?: 'variable' | 'func', className?: string, toMark?: boolean): void;
|
|
23
|
+
setValue(value: string): void;
|
|
24
|
+
getValue(): string;
|
|
23
25
|
markText(from: CodeMirror.Position, to: CodeMirror.Position, label: string, className?: string): void;
|
|
24
26
|
autoMark(variables: Array<VariableItem>): void;
|
|
25
27
|
focus(value: string): void;
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-ui v3.
|
|
2
|
+
* amis-ui v3.3.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { __read } from 'tslib';
|
|
6
|
+
import { __assign, __read } from 'tslib';
|
|
7
7
|
import { eachTree } from 'amis-core';
|
|
8
8
|
import { FormulaEditor } from './Editor.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @file 扩展 codemirror
|
|
12
12
|
*/
|
|
13
|
-
function editorFactory(dom, cm, props) {
|
|
13
|
+
function editorFactory(dom, cm, props, options) {
|
|
14
14
|
registerLaunguageMode(cm);
|
|
15
|
-
return cm(dom, {
|
|
16
|
-
value: props.value || '',
|
|
17
|
-
autofocus: true,
|
|
18
|
-
mode: props.evalMode ? 'text/formula' : 'text/formula-template'
|
|
19
|
-
});
|
|
15
|
+
return cm(dom, __assign({ value: props.value || '', autofocus: true, mode: props.evalMode ? 'text/formula' : 'text/formula-template' }, options));
|
|
20
16
|
}
|
|
21
17
|
var FormulaPlugin = /** @class */ (function () {
|
|
22
18
|
function FormulaPlugin(editor, cm, getProps) {
|
|
@@ -90,22 +86,34 @@ var FormulaPlugin = /** @class */ (function () {
|
|
|
90
86
|
this.editor.replaceSelection('}');
|
|
91
87
|
}
|
|
92
88
|
};
|
|
93
|
-
FormulaPlugin.prototype.insertContent = function (value, type) {
|
|
89
|
+
FormulaPlugin.prototype.insertContent = function (value, type, className, toMark) {
|
|
90
|
+
var _this = this;
|
|
91
|
+
if (className === void 0) { className = 'cm-field'; }
|
|
92
|
+
if (toMark === void 0) { toMark = true; }
|
|
94
93
|
var from = this.editor.getCursor();
|
|
95
94
|
var evalMode = this.getProps().evalMode;
|
|
96
95
|
if (type === 'variable') {
|
|
97
96
|
this.editor.replaceSelection(value.key);
|
|
98
|
-
var
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
var to_1 = this.editor.getCursor();
|
|
98
|
+
if (toMark) {
|
|
99
|
+
// 路径中每个变量分别进行标记
|
|
100
|
+
var markFrom_1 = from.ch;
|
|
101
|
+
value.path.split('.').forEach(function (label, index) {
|
|
102
|
+
var val = value.key.split('.')[index];
|
|
103
|
+
_this.markText({ line: from.line, ch: markFrom_1 }, { line: to_1.line, ch: markFrom_1 + val.length }, label, className);
|
|
104
|
+
markFrom_1 += 1 + val.length;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
!evalMode && this.insertBraces(from, to_1);
|
|
101
108
|
}
|
|
102
109
|
else if (type === 'func') {
|
|
103
110
|
this.editor.replaceSelection("".concat(value, "()"));
|
|
104
111
|
var to = this.editor.getCursor();
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
112
|
+
toMark &&
|
|
113
|
+
this.markText(from, {
|
|
114
|
+
line: to.line,
|
|
115
|
+
ch: to.ch - 2
|
|
116
|
+
}, value, 'cm-func');
|
|
109
117
|
this.editor.setCursor({
|
|
110
118
|
line: to.line,
|
|
111
119
|
ch: to.ch - 1
|
|
@@ -120,9 +128,17 @@ var FormulaPlugin = /** @class */ (function () {
|
|
|
120
128
|
}
|
|
121
129
|
else if (typeof value === 'string') {
|
|
122
130
|
this.editor.replaceSelection(value);
|
|
131
|
+
// 非变量、非函数,可能是组合模式,也需要标记
|
|
132
|
+
toMark && setTimeout(function () { return _this.autoMarkText(); }, 0);
|
|
123
133
|
}
|
|
124
134
|
this.editor.focus();
|
|
125
135
|
};
|
|
136
|
+
FormulaPlugin.prototype.setValue = function (value) {
|
|
137
|
+
this.editor.setValue(value);
|
|
138
|
+
};
|
|
139
|
+
FormulaPlugin.prototype.getValue = function () {
|
|
140
|
+
return this.editor.getValue();
|
|
141
|
+
};
|
|
126
142
|
FormulaPlugin.prototype.markText = function (from, to, label, className) {
|
|
127
143
|
if (className === void 0) { className = 'cm-func'; }
|
|
128
144
|
var text = document.createElement('span');
|
|
@@ -140,8 +156,9 @@ var FormulaPlugin = /** @class */ (function () {
|
|
|
140
156
|
}
|
|
141
157
|
var varMap = {};
|
|
142
158
|
eachTree(variables, function (item) {
|
|
159
|
+
var _a;
|
|
143
160
|
if (item.value) {
|
|
144
|
-
varMap[item.value] = item.label;
|
|
161
|
+
varMap[item.value] = (_a = item.path) !== null && _a !== void 0 ? _a : item.label;
|
|
145
162
|
}
|
|
146
163
|
});
|
|
147
164
|
var vars = Object.keys(varMap).sort(function (a, b) { return b.length - a.length; });
|
|
@@ -166,19 +183,26 @@ var FormulaPlugin = /** @class */ (function () {
|
|
|
166
183
|
vars.forEach(function (v) {
|
|
167
184
|
var from = 0;
|
|
168
185
|
var idx = -1;
|
|
169
|
-
|
|
186
|
+
var _loop_2 = function () {
|
|
170
187
|
var encode = FormulaEditor.replaceStrByIndex(content, idx, v, REPLACE_KEY);
|
|
171
188
|
var reg = FormulaEditor.getRegExpByMode(evalMode, REPLACE_KEY);
|
|
172
189
|
if (reg.test(encode)) {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
190
|
+
var markFrom_2 = idx;
|
|
191
|
+
v.split('.').forEach(function (val, index) {
|
|
192
|
+
_this.markText({
|
|
193
|
+
line: line,
|
|
194
|
+
ch: markFrom_2
|
|
195
|
+
}, {
|
|
196
|
+
line: line,
|
|
197
|
+
ch: markFrom_2 + val.length
|
|
198
|
+
}, varMap[v].split('.')[index], 'cm-field');
|
|
199
|
+
markFrom_2 += 1 + val.length;
|
|
200
|
+
});
|
|
180
201
|
}
|
|
181
202
|
from = idx + v.length;
|
|
203
|
+
};
|
|
204
|
+
while (~(idx = content.indexOf(v, from))) {
|
|
205
|
+
_loop_2();
|
|
182
206
|
}
|
|
183
207
|
});
|
|
184
208
|
};
|
|
@@ -42,8 +42,17 @@ export declare function getIconNames(): string[];
|
|
|
42
42
|
export declare function getIcon(key: string): React.ElementType<{}>;
|
|
43
43
|
export declare function hasIcon(iconName: string): boolean;
|
|
44
44
|
export declare function registerIcon(key: string, component: React.ElementType<{}>): void;
|
|
45
|
-
export
|
|
45
|
+
export interface IconCheckedSchema {
|
|
46
|
+
id: string;
|
|
47
|
+
name?: string;
|
|
48
|
+
svg?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface IconCheckedSchemaNew {
|
|
51
|
+
type: 'icon';
|
|
52
|
+
icon: IconCheckedSchema;
|
|
53
|
+
}
|
|
54
|
+
export declare function Icon({ icon, className, classPrefix, classNameProp, iconContent, vendor, cx: iconCx, onClick, style }: {
|
|
46
55
|
icon: string;
|
|
47
56
|
iconContent?: string;
|
|
48
|
-
} & React.ComponentProps<any>): React.JSX.Element;
|
|
57
|
+
} & React.ComponentProps<any>): React.JSX.Element | null;
|
|
49
58
|
export { InputClearIcon, CloseIcon, UnDoIcon, ReDoIcon, EnterIcon, VolumeIcon, MuteIcon, PlayIcon, PauseIcon, ReloadIcon, LeftArrowIcon, RightArrowIcon, CheckIcon, PlusIcon, MinusIcon, PencilIcon, FunctionIcon, MenuIcon, UserRemove, Role, Department, Post, RightDoubleArrowIcon, DownArrowBoldIcon };
|