amis-ui 6.2.2 → 6.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/_virtual/_commonjsHelpers.js +10 -0
- package/esm/_virtual/pdf.worker.min.js +8 -0
- package/esm/components/404.js +1 -1
- package/esm/components/Alert.d.ts +124 -122
- package/esm/components/Alert.js +10 -6
- package/esm/components/Alert2.d.ts +20 -20
- package/esm/components/Alert2.js +1 -1
- 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.d.ts +2 -1
- package/esm/components/AsideNav.js +6 -3
- package/esm/components/AssociatedSelection.d.ts +120 -120
- package/esm/components/AssociatedSelection.js +4 -4
- package/esm/components/Avatar.d.ts +140 -140
- package/esm/components/Avatar.js +1 -1
- package/esm/components/Badge.js +1 -1
- package/esm/components/BaiduMapPicker.js +1 -1
- package/esm/components/BarCode.js +1 -1
- package/esm/components/Breadcrumb.d.ts +3 -0
- package/esm/components/Breadcrumb.js +7 -6
- package/esm/components/Button.d.ts +32 -31
- package/esm/components/Button.js +4 -4
- package/esm/components/CalendarMobile.d.ts +45 -40
- package/esm/components/CalendarMobile.js +41 -6
- package/esm/components/Card.d.ts +140 -140
- package/esm/components/Card.js +1 -1
- package/esm/components/Cascader.js +1 -1
- package/esm/components/ChainedDropdownSelection.d.ts +120 -120
- package/esm/components/ChainedDropdownSelection.js +1 -1
- package/esm/components/ChainedSelection.d.ts +120 -120
- package/esm/components/ChainedSelection.js +8 -6
- package/esm/components/Checkbox.d.ts +12 -11
- package/esm/components/Checkbox.js +7 -7
- package/esm/components/CityArea.js +1 -1
- package/esm/components/CityDB.d.ts +1 -1
- package/esm/components/CityDB.js +377 -889
- package/esm/components/CodeMirror.d.ts +1 -0
- package/esm/components/CodeMirror.js +16 -5
- package/esm/components/Collapse.d.ts +140 -140
- package/esm/components/Collapse.js +1 -1
- package/esm/components/CollapseGroup.d.ts +30 -30
- package/esm/components/CollapseGroup.js +1 -1
- package/esm/components/ColorPicker.d.ts +80 -80
- package/esm/components/ColorPicker.js +1 -1
- package/esm/components/Combo.js +1 -1
- package/esm/components/ConfirmBox.d.ts +81 -80
- package/esm/components/ConfirmBox.js +6 -3
- package/esm/components/ContextMenu.d.ts +17 -3
- package/esm/components/ContextMenu.js +72 -20
- package/esm/components/DatePicker.d.ts +84 -82
- package/esm/components/DatePicker.js +12 -12
- package/esm/components/DateRangePicker.d.ts +133 -129
- package/esm/components/DateRangePicker.js +40 -27
- 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 +120 -120
- package/esm/components/DropDownSelection.js +1 -1
- package/esm/components/Editor.d.ts +120 -120
- package/esm/components/Editor.js +3 -3
- 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 +5 -4
- package/esm/components/Html.js +1 -1
- package/esm/components/ImageGallery.d.ts +40 -40
- package/esm/components/ImageGallery.js +2 -1
- package/esm/components/Input.d.ts +3 -1
- package/esm/components/Input.js +3 -3
- package/esm/components/InputBox.d.ts +14 -13
- package/esm/components/InputBox.js +7 -7
- package/esm/components/InputBoxWithSuggestion.js +7 -7
- package/esm/components/InputTable.js +1 -1
- package/esm/components/Layout.d.ts +10 -10
- 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.d.ts +82 -80
- package/esm/components/ListMenu.js +3 -3
- package/esm/components/LocationPicker.d.ts +40 -40
- package/esm/components/LocationPicker.js +1 -1
- package/esm/components/Markdown.js +1 -1
- package/esm/components/Modal.d.ts +120 -120
- 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 +30 -21
- package/esm/components/NumberInput.js +36 -6
- package/esm/components/OverflowTpl.js +1 -1
- package/esm/components/Pagination.d.ts +200 -110
- package/esm/components/Pagination.js +21 -21
- package/esm/components/PdfViewer.d.ts +49 -0
- package/esm/components/PdfViewer.js +85 -0
- package/esm/components/Picker.d.ts +1 -0
- package/esm/components/Picker.js +4 -4
- package/esm/components/PickerColumn.d.ts +1 -0
- package/esm/components/PickerColumn.js +8 -6
- package/esm/components/PickerContainer.d.ts +1 -2
- package/esm/components/PickerContainer.js +26 -16
- package/esm/components/PopOverContainer.d.ts +1 -0
- package/esm/components/PopOverContainer.js +3 -3
- package/esm/components/PopUp.d.ts +120 -120
- package/esm/components/PopUp.js +1 -1
- package/esm/components/Progress.d.ts +60 -60
- package/esm/components/Progress.js +1 -1
- package/esm/components/PullRefresh.js +1 -1
- package/esm/components/Radios.d.ts +12 -10
- package/esm/components/Radios.js +4 -3
- package/esm/components/Range.js +1 -1
- package/esm/components/Rating.d.ts +20 -20
- package/esm/components/Rating.js +1 -1
- package/esm/components/ResultBox.d.ts +82 -81
- package/esm/components/ResultBox.js +25 -21
- package/esm/components/ResultList.d.ts +42 -40
- package/esm/components/ResultList.js +5 -4
- package/esm/components/ResultTableList.d.ts +120 -120
- package/esm/components/ResultTableList.js +5 -4
- package/esm/components/ResultTreeList.d.ts +40 -40
- package/esm/components/ResultTreeList.js +3 -3
- package/esm/components/RichText.js +1 -1
- package/esm/components/SearchBox.d.ts +82 -81
- package/esm/components/SearchBox.js +8 -8
- package/esm/components/Select.d.ts +1363 -1354
- package/esm/components/Select.js +13 -12
- package/esm/components/SelectMobile.js +22 -19
- package/esm/components/Selection.d.ts +122 -120
- package/esm/components/Selection.js +1 -1
- package/esm/components/Signature.d.ts +280 -0
- package/esm/components/Signature.js +271 -0
- package/esm/components/SparkLine.d.ts +40 -40
- package/esm/components/SparkLine.js +1 -1
- package/esm/components/Spinner.d.ts +60 -60
- package/esm/components/Spinner.js +1 -1
- package/esm/components/Steps.js +1 -1
- package/esm/components/Switch.d.ts +12 -12
- package/esm/components/Switch.js +4 -4
- package/esm/components/TableSelection.d.ts +120 -120
- package/esm/components/TableSelection.js +6 -5
- package/esm/components/Tabs.d.ts +83 -81
- package/esm/components/Tabs.js +21 -22
- package/esm/components/TabsTransfer.d.ts +40 -40
- package/esm/components/TabsTransfer.js +16 -14
- package/esm/components/TabsTransferPicker.js +1 -1
- package/esm/components/Tag.d.ts +70 -70
- package/esm/components/Tag.js +1 -1
- package/esm/components/Textarea.d.ts +42 -42
- package/esm/components/Textarea.js +4 -4
- package/esm/components/Timeline.js +1 -1
- package/esm/components/TimelineItem.d.ts +1 -1
- package/esm/components/TimelineItem.js +1 -1
- package/esm/components/Tinymce.js +7 -4
- package/esm/components/TitleBar.d.ts +10 -10
- package/esm/components/TitleBar.js +1 -1
- package/esm/components/Toast.d.ts +120 -120
- package/esm/components/Toast.js +1 -1
- package/esm/components/Tooltip.js +1 -1
- package/esm/components/TooltipWrapper.d.ts +32 -32
- package/esm/components/TooltipWrapper.js +1 -1
- package/esm/components/Transfer.d.ts +174 -172
- package/esm/components/Transfer.js +16 -16
- package/esm/components/TransferDropDown.d.ts +160 -160
- 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.d.ts +206 -210
- package/esm/components/Tree.js +32 -30
- package/esm/components/TreeSelection.d.ts +120 -120
- package/esm/components/TreeSelection.js +1 -1
- package/esm/components/UserSelect.d.ts +40 -40
- package/esm/components/UserSelect.js +1 -1
- package/esm/components/UserTabSelect.d.ts +40 -40
- package/esm/components/UserTabSelect.js +1 -1
- package/esm/components/WithRemoteConfig.d.ts +9 -0
- package/esm/components/WithRemoteConfig.js +19 -3
- package/esm/components/WithStore.js +1 -1
- package/esm/components/calendar/Calendar.d.ts +2 -1
- package/esm/components/calendar/Calendar.js +7 -6
- package/esm/components/calendar/CalendarContainer.js +1 -1
- package/esm/components/calendar/DaysView.d.ts +2 -1
- package/esm/components/calendar/DaysView.js +17 -15
- package/esm/components/calendar/MonthsView.d.ts +2 -0
- package/esm/components/calendar/MonthsView.js +8 -6
- package/esm/components/calendar/QuartersView.d.ts +2 -0
- package/esm/components/calendar/QuartersView.js +7 -6
- package/esm/components/calendar/TimeView.d.ts +2 -0
- package/esm/components/calendar/TimeView.js +8 -7
- package/esm/components/calendar/YearsView.d.ts +2 -0
- package/esm/components/calendar/YearsView.js +6 -5
- package/esm/components/condition-builder/Expression.js +1 -1
- package/esm/components/condition-builder/Field.js +1 -1
- package/esm/components/condition-builder/Func.js +1 -1
- package/esm/components/condition-builder/Group.js +1 -1
- package/esm/components/condition-builder/GroupOrItem.js +1 -1
- package/esm/components/condition-builder/InputSwitch.js +1 -1
- package/esm/components/condition-builder/Item.js +1 -1
- package/esm/components/condition-builder/Value.d.ts +1 -0
- package/esm/components/condition-builder/Value.js +30 -14
- package/esm/components/condition-builder/config.js +1 -1
- package/esm/components/condition-builder/index.js +1 -1
- package/esm/components/formula/CodeEditor.d.ts +92 -0
- package/esm/components/formula/CodeEditor.js +99 -0
- package/esm/components/formula/Editor.d.ts +64 -69
- package/esm/components/formula/Editor.js +173 -81
- package/esm/components/formula/FuncList.d.ts +1 -1
- package/esm/components/formula/FuncList.js +10 -9
- package/esm/components/formula/Input.d.ts +68 -54
- package/esm/components/formula/Input.js +45 -102
- package/esm/components/formula/Picker.d.ts +74 -60
- package/esm/components/formula/Picker.js +129 -69
- package/esm/components/formula/VariableList.d.ts +1 -1
- package/esm/components/formula/VariableList.js +26 -12
- package/esm/components/formula/plugin.d.ts +28 -7
- package/esm/components/formula/plugin.js +217 -90
- package/esm/components/icons.d.ts +4 -2
- package/esm/components/icons.js +14 -5
- package/esm/components/index.d.ts +5 -3
- package/esm/components/json-schema/Array.js +2 -2
- package/esm/components/json-schema/Item.d.ts +3 -1
- package/esm/components/json-schema/Item.js +35 -9
- package/esm/components/json-schema/Object.d.ts +3 -1
- package/esm/components/json-schema/Object.js +112 -52
- package/esm/components/json-schema/index.d.ts +53 -50
- package/esm/components/json-schema/index.js +14 -5
- package/esm/components/menu/MenuContext.js +1 -1
- package/esm/components/menu/MenuItem.d.ts +2 -1
- package/esm/components/menu/MenuItem.js +4 -4
- package/esm/components/menu/SubMenu.d.ts +2 -1
- package/esm/components/menu/SubMenu.js +6 -6
- package/esm/components/menu/index.d.ts +66 -63
- package/esm/components/menu/index.js +10 -7
- package/esm/components/schema-editor/Array.js +23 -8
- package/esm/components/schema-editor/Common.d.ts +17 -1
- package/esm/components/schema-editor/Common.js +84 -37
- package/esm/components/schema-editor/Item.js +2 -2
- package/esm/components/schema-editor/Object.d.ts +7 -1
- package/esm/components/schema-editor/Object.js +106 -14
- package/esm/components/schema-editor/SchemaVariableList.d.ts +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.d.ts +48 -40
- package/esm/components/schema-editor/index.js +4 -4
- package/esm/components/table/Cell.d.ts +2 -0
- package/esm/components/table/Cell.js +4 -4
- package/esm/components/table/ColGroup.js +1 -1
- package/esm/components/table/Head.d.ts +2 -0
- package/esm/components/table/Head.js +12 -9
- package/esm/components/table/HeadCellDropDown.d.ts +2 -0
- package/esm/components/table/HeadCellDropDown.js +1 -1
- package/esm/components/table/HeadCellFilter.d.ts +42 -40
- package/esm/components/table/HeadCellFilter.js +8 -8
- package/esm/components/table/HeadCellSelect.d.ts +40 -40
- package/esm/components/table/HeadCellSelect.js +1 -1
- package/esm/components/table/HeadCellSort.d.ts +2 -0
- package/esm/components/table/HeadCellSort.js +8 -8
- package/esm/components/table/ItemActionsWrapper.js +1 -1
- package/esm/components/table/Row.d.ts +2 -0
- package/esm/components/table/Row.js +4 -3
- package/esm/components/table/SummaryRow.js +1 -1
- package/esm/components/table/index.d.ts +162 -160
- package/esm/components/table/index.js +7 -5
- package/esm/components/table/util.d.ts +7 -7
- package/esm/components/table/util.js +4 -2
- 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/arrow-double-left.svg.js +1 -1
- package/esm/icons/arrow-double-right.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/fullscreen.svg.js +21 -0
- package/esm/icons/function.svg.js +1 -1
- package/esm/icons/home.svg.js +1 -1
- package/esm/icons/if.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/sub-plus.svg.js +20 -0
- 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-normal.svg.js +25 -0
- package/esm/icons/undo.svg.js +1 -1
- package/esm/icons/unfullscreen.svg.js +21 -0
- 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 +4 -2
- package/esm/locale/de-DE.js +27 -11
- package/esm/locale/en-US.js +18 -2
- package/esm/locale/zh-CN.js +19 -3
- package/esm/node_modules/pdfjs-dist/build/pdf.worker.min.js +37 -0
- package/esm/node_modules/smooth-signature/es/index.js +506 -0
- 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/_virtual/_commonjsHelpers.js +14 -0
- package/lib/_virtual/pdf.worker.min.js +12 -0
- package/lib/components/404.js +1 -1
- package/lib/components/Alert.d.ts +124 -122
- package/lib/components/Alert.js +10 -6
- package/lib/components/Alert2.d.ts +20 -20
- package/lib/components/Alert2.js +1 -1
- package/lib/components/AnchorNav.d.ts +20 -20
- 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.d.ts +12 -11
- package/lib/components/AsideNav.js +5 -2
- package/lib/components/AssociatedSelection.d.ts +80 -80
- package/lib/components/AssociatedSelection.js +4 -4
- package/lib/components/Avatar.d.ts +70 -70
- package/lib/components/Avatar.js +1 -1
- package/lib/components/Badge.d.ts +1 -1
- package/lib/components/Badge.js +1 -1
- package/lib/components/BaiduMapPicker.js +1 -1
- package/lib/components/BarCode.js +1 -1
- package/lib/components/Breadcrumb.d.ts +3 -0
- package/lib/components/Breadcrumb.js +7 -6
- package/lib/components/Button.d.ts +42 -41
- package/lib/components/Button.js +3 -3
- package/lib/components/CalendarMobile.d.ts +85 -80
- package/lib/components/CalendarMobile.js +41 -6
- package/lib/components/Card.d.ts +110 -110
- package/lib/components/Card.js +1 -1
- package/lib/components/Cascader.js +1 -1
- package/lib/components/ChainedDropdownSelection.d.ts +80 -80
- package/lib/components/ChainedDropdownSelection.js +1 -1
- package/lib/components/ChainedSelection.d.ts +80 -80
- package/lib/components/ChainedSelection.js +8 -6
- package/lib/components/Checkbox.d.ts +12 -11
- package/lib/components/Checkbox.js +6 -6
- package/lib/components/CityArea.js +1 -1
- package/lib/components/CityDB.d.ts +1 -1
- package/lib/components/CityDB.js +377 -889
- package/lib/components/CodeMirror.d.ts +1 -0
- package/lib/components/CodeMirror.js +15 -4
- package/lib/components/Collapse.d.ts +140 -140
- package/lib/components/Collapse.js +1 -1
- package/lib/components/CollapseGroup.d.ts +20 -20
- 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/Combo.js +1 -1
- package/lib/components/ConfirmBox.d.ts +81 -80
- package/lib/components/ConfirmBox.js +6 -3
- package/lib/components/ContextMenu.d.ts +17 -3
- package/lib/components/ContextMenu.js +73 -20
- package/lib/components/DatePicker.d.ts +124 -122
- package/lib/components/DatePicker.js +12 -12
- package/lib/components/DateRangePicker.d.ts +293 -289
- package/lib/components/DateRangePicker.js +40 -27
- package/lib/components/DndContainer.js +1 -1
- package/lib/components/Drawer.d.ts +30 -30
- package/lib/components/Drawer.js +1 -1
- package/lib/components/DropDownSelection.d.ts +80 -80
- package/lib/components/DropDownSelection.js +1 -1
- package/lib/components/Editor.d.ts +120 -120
- package/lib/components/Editor.js +3 -3
- package/lib/components/Form.js +1 -1
- package/lib/components/FormField.js +1 -1
- package/lib/components/GaodeMapPicker.js +1 -1
- package/lib/components/GridNav.js +1 -1
- package/lib/components/GroupedSelection.d.ts +80 -80
- package/lib/components/GroupedSelection.js +5 -4
- package/lib/components/Html.js +1 -1
- package/lib/components/ImageGallery.d.ts +40 -40
- package/lib/components/ImageGallery.js +2 -1
- package/lib/components/Input.d.ts +3 -1
- package/lib/components/Input.js +3 -3
- package/lib/components/InputBox.d.ts +14 -13
- package/lib/components/InputBox.js +6 -6
- package/lib/components/InputBoxWithSuggestion.js +7 -7
- package/lib/components/InputTable.js +1 -1
- package/lib/components/Layout.d.ts +10 -10
- 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 +82 -80
- package/lib/components/ListMenu.js +3 -3
- 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 +80 -80
- package/lib/components/Modal.js +1 -1
- package/lib/components/ModalManager.js +1 -1
- package/lib/components/MonthRangePicker.d.ts +160 -160
- package/lib/components/MultilineText.d.ts +40 -40
- package/lib/components/MultilineText.js +1 -1
- package/lib/components/NumberInput.d.ts +30 -21
- package/lib/components/NumberInput.js +36 -6
- package/lib/components/OverflowTpl.js +1 -1
- package/lib/components/Pagination.d.ts +200 -110
- package/lib/components/Pagination.js +20 -20
- package/lib/components/PdfViewer.d.ts +49 -0
- package/lib/components/PdfViewer.js +91 -0
- package/lib/components/Picker.d.ts +1 -0
- package/lib/components/Picker.js +4 -4
- package/lib/components/PickerColumn.d.ts +1 -0
- package/lib/components/PickerColumn.js +7 -5
- package/lib/components/PickerContainer.d.ts +1 -2
- package/lib/components/PickerContainer.js +26 -16
- package/lib/components/PopOverContainer.d.ts +1 -0
- package/lib/components/PopOverContainer.js +3 -3
- package/lib/components/PopUp.d.ts +40 -40
- package/lib/components/PopUp.js +1 -1
- package/lib/components/Progress.d.ts +50 -50
- package/lib/components/Progress.js +1 -1
- package/lib/components/PullRefresh.js +1 -1
- package/lib/components/Radios.d.ts +12 -10
- package/lib/components/Radios.js +4 -3
- 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 +82 -81
- package/lib/components/ResultBox.js +25 -21
- package/lib/components/ResultList.d.ts +42 -40
- package/lib/components/ResultList.js +5 -4
- package/lib/components/ResultTableList.d.ts +80 -80
- package/lib/components/ResultTableList.js +5 -4
- package/lib/components/ResultTreeList.d.ts +40 -40
- package/lib/components/ResultTreeList.js +3 -3
- package/lib/components/RichText.js +1 -1
- package/lib/components/SearchBox.d.ts +82 -81
- package/lib/components/SearchBox.js +7 -7
- package/lib/components/Select.d.ts +1366 -1357
- package/lib/components/Select.js +12 -11
- package/lib/components/SelectMobile.js +22 -19
- package/lib/components/Selection.d.ts +82 -80
- package/lib/components/Selection.js +1 -1
- package/lib/components/Signature.d.ts +280 -0
- package/lib/components/Signature.js +275 -0
- package/lib/components/SparkLine.d.ts +40 -40
- package/lib/components/SparkLine.js +1 -1
- package/lib/components/Spinner.d.ts +60 -60
- package/lib/components/Spinner.js +1 -1
- package/lib/components/Steps.js +1 -1
- package/lib/components/Switch.d.ts +12 -12
- package/lib/components/Switch.js +3 -3
- package/lib/components/TableSelection.d.ts +80 -80
- package/lib/components/TableSelection.js +6 -5
- package/lib/components/Tabs.d.ts +83 -81
- package/lib/components/Tabs.js +21 -22
- package/lib/components/TabsTransfer.d.ts +40 -40
- package/lib/components/TabsTransfer.js +16 -14
- package/lib/components/TabsTransferPicker.js +1 -1
- package/lib/components/Tag.d.ts +70 -70
- package/lib/components/Tag.js +1 -1
- package/lib/components/Textarea.d.ts +42 -42
- package/lib/components/Textarea.js +3 -3
- package/lib/components/Timeline.js +1 -1
- package/lib/components/TimelineItem.d.ts +1 -1
- package/lib/components/TimelineItem.js +1 -1
- package/lib/components/Tinymce.js +7 -4
- package/lib/components/TitleBar.d.ts +10 -10
- package/lib/components/TitleBar.js +1 -1
- package/lib/components/Toast.d.ts +80 -80
- package/lib/components/Toast.js +1 -1
- package/lib/components/Tooltip.js +1 -1
- package/lib/components/TooltipWrapper.d.ts +42 -42
- package/lib/components/TooltipWrapper.js +1 -1
- package/lib/components/Transfer.d.ts +192 -190
- package/lib/components/Transfer.js +16 -16
- package/lib/components/TransferDropDown.d.ts +160 -160
- 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 +286 -290
- package/lib/components/Tree.js +31 -29
- package/lib/components/TreeSelection.d.ts +120 -120
- package/lib/components/TreeSelection.js +1 -1
- package/lib/components/UserSelect.d.ts +40 -40
- package/lib/components/UserSelect.js +1 -1
- package/lib/components/UserTabSelect.d.ts +40 -40
- package/lib/components/UserTabSelect.js +1 -1
- package/lib/components/WithRemoteConfig.d.ts +9 -0
- package/lib/components/WithRemoteConfig.js +19 -3
- package/lib/components/WithStore.js +1 -1
- package/lib/components/calendar/Calendar.d.ts +2 -1
- package/lib/components/calendar/Calendar.js +6 -5
- package/lib/components/calendar/CalendarContainer.js +1 -1
- package/lib/components/calendar/DaysView.d.ts +2 -1
- package/lib/components/calendar/DaysView.js +17 -15
- package/lib/components/calendar/MonthsView.d.ts +2 -0
- package/lib/components/calendar/MonthsView.js +8 -6
- package/lib/components/calendar/QuartersView.d.ts +2 -0
- package/lib/components/calendar/QuartersView.js +7 -6
- package/lib/components/calendar/TimeView.d.ts +2 -0
- package/lib/components/calendar/TimeView.js +8 -7
- package/lib/components/calendar/YearsView.d.ts +2 -0
- package/lib/components/calendar/YearsView.js +6 -5
- package/lib/components/condition-builder/Expression.js +1 -1
- package/lib/components/condition-builder/Field.js +1 -1
- package/lib/components/condition-builder/Func.js +1 -1
- package/lib/components/condition-builder/Group.js +1 -1
- package/lib/components/condition-builder/GroupOrItem.js +1 -1
- package/lib/components/condition-builder/InputSwitch.js +1 -1
- package/lib/components/condition-builder/Item.js +1 -1
- package/lib/components/condition-builder/Value.d.ts +1 -0
- package/lib/components/condition-builder/Value.js +28 -12
- package/lib/components/condition-builder/config.js +1 -1
- package/lib/components/condition-builder/index.d.ts +1 -1
- package/lib/components/condition-builder/index.js +1 -1
- package/lib/components/formula/CodeEditor.d.ts +92 -0
- package/lib/components/formula/CodeEditor.js +110 -0
- package/lib/components/formula/Editor.d.ts +64 -69
- package/lib/components/formula/Editor.js +172 -78
- package/lib/components/formula/FuncList.d.ts +1 -1
- package/lib/components/formula/FuncList.js +10 -9
- package/lib/components/formula/Input.d.ts +68 -54
- package/lib/components/formula/Input.js +43 -101
- package/lib/components/formula/Picker.d.ts +74 -60
- package/lib/components/formula/Picker.js +128 -68
- package/lib/components/formula/VariableList.d.ts +1 -1
- package/lib/components/formula/VariableList.js +24 -10
- package/lib/components/formula/plugin.d.ts +28 -7
- package/lib/components/formula/plugin.js +220 -89
- package/lib/components/icons.d.ts +4 -2
- package/lib/components/icons.js +14 -5
- package/lib/components/index.d.ts +5 -3
- package/lib/components/json-schema/Array.js +3 -3
- package/lib/components/json-schema/Item.d.ts +3 -1
- package/lib/components/json-schema/Item.js +39 -8
- package/lib/components/json-schema/Object.d.ts +3 -1
- package/lib/components/json-schema/Object.js +113 -51
- package/lib/components/json-schema/index.d.ts +53 -50
- package/lib/components/json-schema/index.js +18 -5
- package/lib/components/menu/MenuContext.js +1 -1
- package/lib/components/menu/MenuItem.d.ts +2 -1
- package/lib/components/menu/MenuItem.js +3 -3
- package/lib/components/menu/SubMenu.d.ts +2 -1
- package/lib/components/menu/SubMenu.js +5 -5
- package/lib/components/menu/index.d.ts +86 -83
- package/lib/components/menu/index.js +10 -7
- package/lib/components/schema-editor/Array.js +23 -8
- package/lib/components/schema-editor/Common.d.ts +17 -1
- package/lib/components/schema-editor/Common.js +83 -36
- package/lib/components/schema-editor/Item.js +2 -2
- package/lib/components/schema-editor/Object.d.ts +7 -1
- package/lib/components/schema-editor/Object.js +105 -13
- package/lib/components/schema-editor/SchemaVariableList.d.ts +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 +48 -40
- package/lib/components/schema-editor/index.js +4 -4
- package/lib/components/table/Cell.d.ts +2 -0
- package/lib/components/table/Cell.js +4 -4
- package/lib/components/table/ColGroup.js +1 -1
- package/lib/components/table/Head.d.ts +2 -0
- package/lib/components/table/Head.js +12 -9
- package/lib/components/table/HeadCellDropDown.d.ts +2 -0
- package/lib/components/table/HeadCellDropDown.js +1 -1
- package/lib/components/table/HeadCellFilter.d.ts +82 -80
- package/lib/components/table/HeadCellFilter.js +8 -8
- package/lib/components/table/HeadCellSelect.d.ts +40 -40
- package/lib/components/table/HeadCellSelect.js +1 -1
- package/lib/components/table/HeadCellSort.d.ts +2 -0
- package/lib/components/table/HeadCellSort.js +7 -7
- package/lib/components/table/ItemActionsWrapper.js +1 -1
- package/lib/components/table/Row.d.ts +2 -0
- package/lib/components/table/Row.js +4 -3
- package/lib/components/table/SummaryRow.js +1 -1
- package/lib/components/table/index.d.ts +122 -120
- package/lib/components/table/index.js +7 -5
- package/lib/components/table/util.d.ts +7 -7
- package/lib/components/table/util.js +4 -2
- package/lib/components/virtual-list/AutoSizer.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/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 +1 -1
- package/lib/icons/alert-info.svg.js +1 -1
- package/lib/icons/alert-success.svg.js +1 -1
- package/lib/icons/alert-warning.svg.js +1 -1
- package/lib/icons/arrow-double-left.svg.js +1 -1
- package/lib/icons/arrow-double-right.svg.js +1 -1
- package/lib/icons/back.svg.js +1 -1
- package/lib/icons/calendar.svg.js +1 -1
- package/lib/icons/caret.svg.js +1 -1
- package/lib/icons/check.svg.js +1 -1
- package/lib/icons/clock.svg.js +1 -1
- package/lib/icons/close-small.svg.js +1 -1
- package/lib/icons/close.svg.js +1 -1
- package/lib/icons/cloud-upload.svg.js +1 -1
- package/lib/icons/column-filter.svg.js +1 -1
- package/lib/icons/columns.svg.js +1 -1
- package/lib/icons/compress-alt.svg.js +1 -1
- package/lib/icons/copy.svg.js +1 -1
- package/lib/icons/date.svg.js +1 -1
- package/lib/icons/department.svg.js +1 -1
- package/lib/icons/desk-empty.svg.js +1 -1
- package/lib/icons/dot.svg.js +1 -1
- package/lib/icons/down-arrow-bold.svg.js +1 -1
- package/lib/icons/down.svg.js +1 -1
- package/lib/icons/download.svg.js +1 -1
- package/lib/icons/drag-bar.svg.js +1 -1
- package/lib/icons/drag.svg.js +1 -1
- package/lib/icons/edit.svg.js +1 -1
- package/lib/icons/ellipsis-v.svg.js +1 -1
- package/lib/icons/enter.svg.js +1 -1
- package/lib/icons/exchange.svg.js +1 -1
- package/lib/icons/expand-alt.svg.js +1 -1
- package/lib/icons/fail.svg.js +1 -1
- package/lib/icons/file.svg.js +1 -1
- package/lib/icons/filter.svg.js +1 -1
- package/lib/icons/folder.svg.js +1 -1
- package/lib/icons/fullscreen.svg.js +28 -0
- package/lib/icons/function.svg.js +1 -1
- package/lib/icons/home.svg.js +1 -1
- package/lib/icons/if.svg.js +1 -1
- package/lib/icons/image.svg.js +1 -1
- package/lib/icons/info-circle.svg.js +1 -1
- package/lib/icons/info.svg.js +1 -1
- package/lib/icons/input-clear.svg.js +1 -1
- package/lib/icons/invisible.svg.js +1 -1
- package/lib/icons/left-arrow.svg.js +1 -1
- package/lib/icons/loading-outline.svg.js +1 -1
- package/lib/icons/location.svg.js +1 -1
- package/lib/icons/menu.svg.js +1 -1
- package/lib/icons/minus.svg.js +1 -1
- package/lib/icons/move.svg.js +1 -1
- package/lib/icons/mute.svg.js +1 -1
- package/lib/icons/new-edit.svg.js +1 -1
- package/lib/icons/pause.svg.js +1 -1
- package/lib/icons/pencil.svg.js +1 -1
- package/lib/icons/play.svg.js +1 -1
- package/lib/icons/plus-cicle.svg.js +1 -1
- package/lib/icons/plus-fine.svg.js +1 -1
- package/lib/icons/plus.svg.js +1 -1
- package/lib/icons/post.svg.js +1 -1
- package/lib/icons/question-mark.svg.js +1 -1
- package/lib/icons/question.svg.js +1 -1
- package/lib/icons/redo.svg.js +1 -1
- package/lib/icons/refresh.svg.js +1 -1
- package/lib/icons/reload.svg.js +1 -1
- package/lib/icons/remove.svg.js +1 -1
- package/lib/icons/retry.svg.js +1 -1
- package/lib/icons/right-arrow-bold.svg.js +1 -1
- package/lib/icons/right-arrow.svg.js +1 -1
- package/lib/icons/right-double-arrow.svg.js +1 -1
- package/lib/icons/role.svg.js +1 -1
- package/lib/icons/rotate-left.svg.js +1 -1
- package/lib/icons/rotate-right.svg.js +1 -1
- package/lib/icons/scale-origin.svg.js +1 -1
- package/lib/icons/schedule.svg.js +1 -1
- package/lib/icons/search.svg.js +1 -1
- package/lib/icons/setting.svg.js +1 -1
- package/lib/icons/slider-handle-icon.svg.js +1 -1
- package/lib/icons/sort-asc.svg.js +1 -1
- package/lib/icons/sort-default.svg.js +1 -1
- package/lib/icons/sort-desc.svg.js +1 -1
- package/lib/icons/star.svg.js +1 -1
- package/lib/icons/status-close.svg.js +1 -1
- package/lib/icons/steps-finsh.svg.js +1 -1
- package/lib/icons/sub-plus.svg.js +27 -0
- package/lib/icons/success.svg.js +1 -1
- package/lib/icons/transparent.svg.js +1 -1
- package/lib/icons/trash.svg.js +1 -1
- package/lib/icons/tree-down.svg.js +1 -1
- package/lib/icons/undo-normal.svg.js +32 -0
- package/lib/icons/undo.svg.js +1 -1
- package/lib/icons/unfullscreen.svg.js +28 -0
- package/lib/icons/upload.svg.js +1 -1
- package/lib/icons/user-remove.svg.js +1 -1
- package/lib/icons/view.svg.js +1 -1
- package/lib/icons/volume.svg.js +1 -1
- package/lib/icons/warning-mark.svg.js +1 -1
- package/lib/icons/warning.svg.js +1 -1
- package/lib/icons/window-restore.svg.js +1 -1
- package/lib/icons/zoom-in.svg.js +1 -1
- package/lib/icons/zoom-out.svg.js +1 -1
- package/lib/index.js +6 -1
- package/lib/locale/de-DE.js +27 -11
- package/lib/locale/en-US.js +18 -2
- package/lib/locale/zh-CN.js +19 -3
- package/lib/node_modules/pdfjs-dist/build/pdf.worker.min.js +41 -0
- package/lib/node_modules/smooth-signature/es/index.js +510 -0
- package/lib/{scss → packages/amis-ui/scss}/helper.scss.js +1 -1
- package/lib/{scss → packages/amis-ui/scss}/themes/ang.scss.js +1 -1
- package/lib/{scss → packages/amis-ui/scss}/themes/antd.scss.js +1 -1
- package/lib/{scss → packages/amis-ui/scss}/themes/cxd.scss.js +1 -1
- package/lib/{scss → packages/amis-ui/scss}/themes/dark.scss.js +1 -1
- package/lib/{scss → packages/amis-ui/scss}/themes/default.scss.js +1 -1
- package/lib/themes/ang.css +1032 -38
- package/lib/themes/ang.js +1 -1
- package/lib/themes/antd.css +1032 -38
- package/lib/themes/antd.js +1 -1
- package/lib/themes/cxd.css +1032 -38
- package/lib/themes/cxd.js +1 -1
- package/lib/themes/dark.css +1032 -38
- package/lib/themes/dark.js +1 -1
- package/lib/themes/default.css +1032 -38
- package/package.json +4 -3
- package/scss/_components.scss +7 -0
- package/scss/_mixins.scss +1 -0
- package/scss/_thirds.scss +3 -0
- package/scss/components/_collapse.scss +1 -1
- package/scss/components/_condition-builder.scss +18 -0
- package/scss/components/_crud2.scss +4 -0
- package/scss/components/_formula.scss +148 -26
- package/scss/components/_image-gallery.scss +7 -1
- package/scss/components/_input-box.scss +6 -0
- package/scss/components/_json-schema-editor.scss +24 -3
- package/scss/components/_json-schema.scss +5 -0
- package/scss/components/_menu.scss +3 -0
- package/scss/components/_pdf_viewer.scss +47 -0
- package/scss/components/_signature.scss +97 -0
- package/scss/components/_table.scss +6 -1
- package/scss/components/_tabs.scss +10 -4
- package/scss/components/form/_combo.scss +1 -0
- package/scss/components/form/_form.scss +10 -0
- package/scss/components/form/_icon-select.scss +3 -0
- package/scss/components/form/_picker.scss +2 -1
- package/scss/components/form/_tag.scss +2 -1
- package/scss/components/form/_text.scss +4 -4
- package/scss/themes/_common.scss +2 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-ui v6.
|
|
2
|
+
* amis-ui v6.4.0
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { __extends, __awaiter, __generator, __decorate, __metadata } from 'tslib';
|
|
6
|
+
import { __extends, __awaiter, __generator, __assign, __decorate, __metadata } from 'tslib';
|
|
7
7
|
import React__default from 'react';
|
|
8
8
|
import isInteger from 'lodash/isInteger';
|
|
9
9
|
import { autobind, themeable, localeable } from 'amis-core';
|
|
@@ -58,12 +58,12 @@ var Pagination = /** @class */ (function (_super) {
|
|
|
58
58
|
*/
|
|
59
59
|
Pagination.prototype.renderPageItem = function (page) {
|
|
60
60
|
var _this = this;
|
|
61
|
-
var _a = this.props, cx = _a.classnames, activePage = _a.activePage;
|
|
61
|
+
var _a = this.props, cx = _a.classnames, activePage = _a.activePage, testIdBuilder = _a.testIdBuilder;
|
|
62
62
|
var perPage = this.state.perPage;
|
|
63
63
|
return (React__default.createElement("li", { onClick: function () { return _this.handlePageNumChange(page, perPage); }, key: page, className: cx('Pagination-pager-item', {
|
|
64
64
|
'is-active': page === activePage
|
|
65
65
|
}) },
|
|
66
|
-
React__default.createElement("a", { role: "button" }, page)));
|
|
66
|
+
React__default.createElement("a", __assign({ role: "button" }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild("page-".concat(page)).getTestId()), page)));
|
|
67
67
|
};
|
|
68
68
|
/**
|
|
69
69
|
* 渲染...
|
|
@@ -73,7 +73,7 @@ var Pagination = /** @class */ (function (_super) {
|
|
|
73
73
|
*/
|
|
74
74
|
Pagination.prototype.renderEllipsis = function (key) {
|
|
75
75
|
var _this = this;
|
|
76
|
-
var _a = this.props, cx = _a.classnames, activePage = _a.activePage, ellipsisPageGap = _a.ellipsisPageGap;
|
|
76
|
+
var _a = this.props, cx = _a.classnames, activePage = _a.activePage, ellipsisPageGap = _a.ellipsisPageGap, testIdBuilder = _a.testIdBuilder;
|
|
77
77
|
var perPage = this.state.perPage;
|
|
78
78
|
var lastPage = this.getLastPage();
|
|
79
79
|
var gap = isNaN(Number(ellipsisPageGap)) || Number(ellipsisPageGap) < 1
|
|
@@ -84,9 +84,9 @@ var Pagination = /** @class */ (function (_super) {
|
|
|
84
84
|
var jumpPage = isPrevEllipsis
|
|
85
85
|
? Math.max(1, activePage - gap)
|
|
86
86
|
: Math.min(lastPage, activePage + gap);
|
|
87
|
-
return (React__default.createElement("li", { key: key, className: cx('Pagination-ellipsis'), onClick: function (e) {
|
|
87
|
+
return (React__default.createElement("li", __assign({ key: key, className: cx('Pagination-ellipsis'), onClick: function (e) {
|
|
88
88
|
return _this.handlePageNumChange(jumpPage, perPage, isPrevEllipsis ? 'backward' : 'forward');
|
|
89
|
-
} },
|
|
89
|
+
} }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild(key).getTestId()),
|
|
90
90
|
React__default.createElement("a", { role: "button" }, "..."),
|
|
91
91
|
React__default.createElement("span", { className: "icon" }, jumpContent)));
|
|
92
92
|
};
|
|
@@ -186,7 +186,7 @@ var Pagination = /** @class */ (function (_super) {
|
|
|
186
186
|
};
|
|
187
187
|
Pagination.prototype.render = function () {
|
|
188
188
|
var _this = this;
|
|
189
|
-
var _a = this.props, layout = _a.layout, mode = _a.mode, activePage = _a.activePage, total = _a.total, showPerPage = _a.showPerPage, perPageAvailable = _a.perPageAvailable, cx = _a.classnames, showPageInput = _a.showPageInput, className = _a.className, style = _a.style, disabled = _a.disabled, hasNext = _a.hasNext, popOverContainer = _a.popOverContainer, popOverContainerSelector = _a.popOverContainerSelector, mobileUI = _a.mobileUI, size = _a.size, __ = _a.translate;
|
|
189
|
+
var _a = this.props, layout = _a.layout, mode = _a.mode, activePage = _a.activePage, total = _a.total, showPerPage = _a.showPerPage, perPageAvailable = _a.perPageAvailable, cx = _a.classnames, showPageInput = _a.showPageInput, className = _a.className, style = _a.style, disabled = _a.disabled, hasNext = _a.hasNext, popOverContainer = _a.popOverContainer, popOverContainerSelector = _a.popOverContainerSelector, mobileUI = _a.mobileUI, size = _a.size, __ = _a.translate, testIdBuilder = _a.testIdBuilder;
|
|
190
190
|
var maxButtons = this.props.maxButtons;
|
|
191
191
|
var _b = this.state, pageNum = _b.pageNum, perPage = _b.perPage, internalPageNum = _b.internalPageNum;
|
|
192
192
|
var lastPage = this.getLastPage();
|
|
@@ -194,10 +194,10 @@ var Pagination = /** @class */ (function (_super) {
|
|
|
194
194
|
// 简洁模式
|
|
195
195
|
if (mode === 'simple') {
|
|
196
196
|
simplePager = (React__default.createElement("li", { className: cx('Pagination-simplego'), key: "simple-go" },
|
|
197
|
-
React__default.createElement("input", { className: cx('Pagination-simplego-input'), key: "simple-input", type: "text", disabled: disabled, onChange: this.handleSimpleKeyUp, onKeyUp: this.handleSimpleKeyUp, onBlur: this.handleSimpleBlur, value: internalPageNum }),
|
|
197
|
+
React__default.createElement("input", __assign({ className: cx('Pagination-simplego-input'), key: "simple-input", type: "text", disabled: disabled, onChange: this.handleSimpleKeyUp, onKeyUp: this.handleSimpleKeyUp, onBlur: this.handleSimpleBlur, value: internalPageNum }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('simple-input').getTestId())),
|
|
198
198
|
"/",
|
|
199
199
|
React__default.createElement("span", { className: cx('Pagination-simplego-right'), key: "go-right" }, lastPage)));
|
|
200
|
-
return (React__default.createElement("div", { className: cx('Pagination-wrap', "Pagination-wrap-size--".concat(size), 'Pagination-simple', { disabled: disabled }, className), style: style },
|
|
200
|
+
return (React__default.createElement("div", __assign({ className: cx('Pagination-wrap', "Pagination-wrap-size--".concat(size), 'Pagination-simple', { disabled: disabled }, className), style: style }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getTestId()),
|
|
201
201
|
React__default.createElement("ul", { key: "pager-items", className: cx('Pagination', 'Pagination--sm', 'Pagination-pager-items', 'Pagination-item') },
|
|
202
202
|
React__default.createElement("li", { className: cx('Pagination-prev', {
|
|
203
203
|
'is-disabled': activePage < 2
|
|
@@ -207,7 +207,7 @@ var Pagination = /** @class */ (function (_super) {
|
|
|
207
207
|
}
|
|
208
208
|
return _this.handlePageNumChange(activePage - 1, undefined, 'backward');
|
|
209
209
|
}, key: "prev" },
|
|
210
|
-
React__default.createElement("span", null,
|
|
210
|
+
React__default.createElement("span", __assign({}, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild("go-prev").getTestId()),
|
|
211
211
|
React__default.createElement(Icon, { icon: "left-arrow", className: "icon" }))),
|
|
212
212
|
simplePager,
|
|
213
213
|
React__default.createElement("li", { className: cx('Pagination-next', {
|
|
@@ -218,7 +218,7 @@ var Pagination = /** @class */ (function (_super) {
|
|
|
218
218
|
}
|
|
219
219
|
return _this.handlePageNumChange(activePage + 1, perPage, 'forward');
|
|
220
220
|
}, key: "next" },
|
|
221
|
-
React__default.createElement("span", null,
|
|
221
|
+
React__default.createElement("span", __assign({}, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild("go-next").getTestId()),
|
|
222
222
|
React__default.createElement(Icon, { icon: "right-arrow", className: "icon" }))))));
|
|
223
223
|
}
|
|
224
224
|
var pageButtons = [];
|
|
@@ -273,7 +273,7 @@ var Pagination = /** @class */ (function (_super) {
|
|
|
273
273
|
}
|
|
274
274
|
return _this.handlePageNumChange(activePage - 1, perPage);
|
|
275
275
|
}, key: "prev" },
|
|
276
|
-
React__default.createElement("span", null,
|
|
276
|
+
React__default.createElement("span", __assign({}, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('go-prev').getTestId()),
|
|
277
277
|
React__default.createElement(Icon, { icon: "left-arrow", className: "icon" }))));
|
|
278
278
|
pageButtons.push(React__default.createElement("li", { className: cx('Pagination-next', {
|
|
279
279
|
'is-disabled': activePage === lastPage
|
|
@@ -283,7 +283,7 @@ var Pagination = /** @class */ (function (_super) {
|
|
|
283
283
|
}
|
|
284
284
|
return _this.handlePageNumChange(activePage + 1, perPage);
|
|
285
285
|
}, key: "next" },
|
|
286
|
-
React__default.createElement("span", null,
|
|
286
|
+
React__default.createElement("span", __assign({}, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('go-next').getTestId()),
|
|
287
287
|
React__default.createElement(Icon, { icon: "right-arrow", className: "icon" }))));
|
|
288
288
|
if (mobileUI) {
|
|
289
289
|
pageButtons = [
|
|
@@ -294,36 +294,36 @@ var Pagination = /** @class */ (function (_super) {
|
|
|
294
294
|
}
|
|
295
295
|
var go = (React__default.createElement("div", { className: cx('Pagination-inputGroup Pagination-item'), key: "go" },
|
|
296
296
|
!mobileUI ? (React__default.createElement("span", { className: cx('Pagination-inputGroup-left'), key: "go-left" }, __('Pagination.goto'))) : null,
|
|
297
|
-
React__default.createElement("input", { className: cx('Pagination-inputGroup-input'), key: "go-input", type: "text", disabled: disabled, onChange: this.handlePageChange, onFocus: function (e) { return e.currentTarget.select(); }, onKeyUp: function (e) {
|
|
297
|
+
React__default.createElement("input", __assign({ className: cx('Pagination-inputGroup-input'), key: "go-input", type: "text", disabled: disabled, onChange: this.handlePageChange, onFocus: function (e) { return e.currentTarget.select(); }, onKeyUp: function (e) {
|
|
298
298
|
var v = parseInt(e.currentTarget.value, 10);
|
|
299
299
|
if (!v || e.code != 'Enter') {
|
|
300
300
|
return;
|
|
301
301
|
}
|
|
302
302
|
_this.setState({ pageNum: '' });
|
|
303
303
|
_this.handlePageNumChange(v, perPage);
|
|
304
|
-
}, value: pageNum }),
|
|
305
|
-
React__default.createElement("span", { className: cx('Pagination-inputGroup-right'), key: "go-right", onClick: function (e) {
|
|
304
|
+
}, value: pageNum }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('go-input').getTestId())),
|
|
305
|
+
React__default.createElement("span", __assign({ className: cx('Pagination-inputGroup-right'), key: "go-right", onClick: function (e) {
|
|
306
306
|
if (!pageNum) {
|
|
307
307
|
return;
|
|
308
308
|
}
|
|
309
309
|
_this.setState({ pageNum: '' });
|
|
310
310
|
_this.handlePageNumChange(+pageNum, perPage);
|
|
311
|
-
} }, __('Pagination.go'))));
|
|
311
|
+
} }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('go').getTestId()), __('Pagination.go'))));
|
|
312
312
|
var selection = perPageAvailable
|
|
313
313
|
.filter(function (v) { return !!v; })
|
|
314
314
|
.map(function (v) { return ({ label: __('Pagination.select', { count: v }), value: v }); });
|
|
315
|
-
var perPageEle = (React__default.createElement(EnhancedSelect, { key: "perpage", className: cx('Pagination-perpage', 'Pagination-item'), clearable: false, disabled: disabled, value: perPage, options: selection, popOverContainer: popOverContainer, popOverContainerSelector: popOverContainerSelector, onChange: function (p) {
|
|
315
|
+
var perPageEle = (React__default.createElement(EnhancedSelect, __assign({ key: "perpage", className: cx('Pagination-perpage', 'Pagination-item'), clearable: false, disabled: disabled, value: perPage, options: selection, popOverContainer: popOverContainer, popOverContainerSelector: popOverContainerSelector, onChange: function (p) {
|
|
316
316
|
_this.setState({
|
|
317
317
|
perPage: p.value,
|
|
318
318
|
pageNum: ''
|
|
319
319
|
});
|
|
320
320
|
_this.handlePageNumChange(1, p.value);
|
|
321
|
-
} }));
|
|
321
|
+
} }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('perpage').getTestId())));
|
|
322
322
|
// total或者lastpage不存在,不渲染总数
|
|
323
323
|
var totalPage = !(total || lastPage) ? null : (React__default.createElement("div", { className: cx('Pagination-total Pagination-item'), key: "total" }, total || total === 0
|
|
324
324
|
? __('Pagination.totalCount', { total: total })
|
|
325
325
|
: __('Pagination.totalPage', { lastPage: lastPage })));
|
|
326
|
-
return (React__default.createElement("div", { className: cx('Pagination-wrap', "Pagination-wrap-size--".concat(size), { disabled: disabled }, className) }, layoutList.map(function (layoutItem) {
|
|
326
|
+
return (React__default.createElement("div", __assign({ className: cx('Pagination-wrap', "Pagination-wrap-size--".concat(size), { disabled: disabled }, className) }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getTestId()), layoutList.map(function (layoutItem) {
|
|
327
327
|
if (layoutItem === "pager" /* PaginationWidget.Pager */) {
|
|
328
328
|
return (React__default.createElement("ul", { key: "pager-items", className: cx('Pagination', 'Pagination--sm', 'Pagination-item') }, pageButtons));
|
|
329
329
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file PdfViewer.tsx PDF 预览
|
|
3
|
+
*
|
|
4
|
+
* @created: 2024/02/26
|
|
5
|
+
*/
|
|
6
|
+
/// <reference types="hoist-non-react-statics" />
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { ThemeProps } from 'amis-core';
|
|
9
|
+
export interface PdfViewerProps extends ThemeProps {
|
|
10
|
+
file?: ArrayBuffer;
|
|
11
|
+
width?: number;
|
|
12
|
+
height?: number;
|
|
13
|
+
background?: string;
|
|
14
|
+
loading: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const _default: {
|
|
17
|
+
new (props: Omit<PdfViewerProps, keyof ThemeProps> & import("packages/amis-core/lib/theme").ThemeOuterProps): {
|
|
18
|
+
ref: any;
|
|
19
|
+
childRef(ref: any): void;
|
|
20
|
+
getWrappedInstance(): any;
|
|
21
|
+
render(): React.JSX.Element;
|
|
22
|
+
context: unknown;
|
|
23
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<PdfViewerProps, keyof ThemeProps> & import("packages/amis-core/lib/theme").ThemeOuterProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
24
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
25
|
+
readonly props: Readonly<Omit<PdfViewerProps, keyof ThemeProps> & import("packages/amis-core/lib/theme").ThemeOuterProps>;
|
|
26
|
+
state: Readonly<{}>;
|
|
27
|
+
refs: {
|
|
28
|
+
[key: string]: React.ReactInstance;
|
|
29
|
+
};
|
|
30
|
+
componentDidMount?(): void;
|
|
31
|
+
shouldComponentUpdate?(nextProps: Readonly<Omit<PdfViewerProps, keyof ThemeProps> & import("packages/amis-core/lib/theme").ThemeOuterProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
32
|
+
componentWillUnmount?(): void;
|
|
33
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
34
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<PdfViewerProps, keyof ThemeProps> & import("packages/amis-core/lib/theme").ThemeOuterProps>, prevState: Readonly<{}>): any;
|
|
35
|
+
componentDidUpdate?(prevProps: Readonly<Omit<PdfViewerProps, keyof ThemeProps> & import("packages/amis-core/lib/theme").ThemeOuterProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
36
|
+
componentWillMount?(): void;
|
|
37
|
+
UNSAFE_componentWillMount?(): void;
|
|
38
|
+
componentWillReceiveProps?(nextProps: Readonly<Omit<PdfViewerProps, keyof ThemeProps> & import("packages/amis-core/lib/theme").ThemeOuterProps>, nextContext: any): void;
|
|
39
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<PdfViewerProps, keyof ThemeProps> & import("packages/amis-core/lib/theme").ThemeOuterProps>, nextContext: any): void;
|
|
40
|
+
componentWillUpdate?(nextProps: Readonly<Omit<PdfViewerProps, keyof ThemeProps> & import("packages/amis-core/lib/theme").ThemeOuterProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
41
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<PdfViewerProps, keyof ThemeProps> & import("packages/amis-core/lib/theme").ThemeOuterProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
42
|
+
};
|
|
43
|
+
displayName: string;
|
|
44
|
+
contextType: React.Context<string>;
|
|
45
|
+
ComposedComponent: React.ComponentType<React.FC<PdfViewerProps>>;
|
|
46
|
+
} & import("hoist-non-react-statics").NonReactStatics<React.FC<PdfViewerProps>, {}> & {
|
|
47
|
+
ComposedComponent: React.FC<PdfViewerProps>;
|
|
48
|
+
};
|
|
49
|
+
export default _default;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-ui v6.4.0
|
|
3
|
+
* Copyright 2018-2024 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { __read } from 'tslib';
|
|
7
|
+
import React__default from 'react';
|
|
8
|
+
import { themeable } from 'amis-core';
|
|
9
|
+
import { pdfjs, Document, Page } from 'react-pdf';
|
|
10
|
+
import { Icon } from './icons.js';
|
|
11
|
+
import Input from './Input.js';
|
|
12
|
+
import Spinner from './Spinner.js';
|
|
13
|
+
import pdfJSWorkerURL from '../node_modules/pdfjs-dist/build/pdf.worker.min.js';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @file PdfViewer.tsx PDF 预览
|
|
17
|
+
*
|
|
18
|
+
* @created: 2024/02/26
|
|
19
|
+
*/
|
|
20
|
+
pdfjs.GlobalWorkerOptions.workerSrc = pdfJSWorkerURL;
|
|
21
|
+
var PdfViewer = function (props) {
|
|
22
|
+
var cx = props.classnames, className = props.className, loading = props.loading, _a = props.width, width = _a === void 0 ? 300 : _a;
|
|
23
|
+
var _b = __read(React__default.useState(props.file), 2), file = _b[0], setFile = _b[1];
|
|
24
|
+
var _c = __read(React__default.useState(false), 2), loaded = _c[0], setLoaded = _c[1];
|
|
25
|
+
var _d = __read(React__default.useState(1), 2), page = _d[0], setPage = _d[1];
|
|
26
|
+
var _e = __read(React__default.useState(1), 2), scale = _e[0], setScale = _e[1];
|
|
27
|
+
var _f = __read(React__default.useState(1), 2), total = _f[0], setTotal = _f[1];
|
|
28
|
+
var wrapper = React__default.useRef(null);
|
|
29
|
+
var inputRef = React__default.useRef();
|
|
30
|
+
React__default.useEffect(function () {
|
|
31
|
+
if (props.file instanceof ArrayBuffer && props.file.byteLength > 0) {
|
|
32
|
+
setFile(props.file);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
setFile(undefined);
|
|
36
|
+
}
|
|
37
|
+
}, [props.file]);
|
|
38
|
+
function handleLoadSuccess(_a) {
|
|
39
|
+
var numPages = _a.numPages;
|
|
40
|
+
setLoaded(true);
|
|
41
|
+
setTotal(numPages);
|
|
42
|
+
}
|
|
43
|
+
function handleChangePage(idx) {
|
|
44
|
+
var newPage = page + idx;
|
|
45
|
+
if (newPage <= 0 || newPage > total) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
setPage(newPage);
|
|
49
|
+
}
|
|
50
|
+
function handlePageBlur(event) {
|
|
51
|
+
var newPage = +event.target.value;
|
|
52
|
+
if (isNaN(newPage) || newPage <= 0 || newPage > total) {
|
|
53
|
+
if (inputRef.current) {
|
|
54
|
+
inputRef.current.value = page + '';
|
|
55
|
+
}
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
setPage(newPage);
|
|
59
|
+
}
|
|
60
|
+
function handleChangeScale(t) {
|
|
61
|
+
setScale(scale * t);
|
|
62
|
+
}
|
|
63
|
+
function renderLoading() {
|
|
64
|
+
return (React__default.createElement("div", { className: cx('PdfViewer-Loading') },
|
|
65
|
+
React__default.createElement(Spinner, null)));
|
|
66
|
+
}
|
|
67
|
+
function renderTool() {
|
|
68
|
+
return (React__default.createElement("div", { className: cx('PdfViewer-Tool') },
|
|
69
|
+
React__default.createElement(Icon, { className: "icon", icon: "prev", onClick: function () { return handleChangePage(-1); } }),
|
|
70
|
+
React__default.createElement(Input, { className: "page-input", value: page, onBlur: handlePageBlur, ref: inputRef }),
|
|
71
|
+
React__default.createElement("span", { className: "gap" }, "/"),
|
|
72
|
+
React__default.createElement("span", null, total),
|
|
73
|
+
React__default.createElement(Icon, { className: "icon", icon: "next", onClick: function () { return handleChangePage(1); } }),
|
|
74
|
+
React__default.createElement(Icon, { className: "icon", icon: "zoom-in", onClick: function () { return handleChangeScale(1.2); } }),
|
|
75
|
+
React__default.createElement(Icon, { className: "icon", icon: "zoom-out", onClick: function () { return handleChangeScale(0.8); } })));
|
|
76
|
+
}
|
|
77
|
+
return (React__default.createElement("div", { className: cx(className, 'PdfViewer'), ref: wrapper }, !file || loading ? (renderLoading()) : (React__default.createElement(React__default.Fragment, null,
|
|
78
|
+
React__default.createElement("div", { className: cx('PdfViewer-Content', { 'is-loaded': loaded }) },
|
|
79
|
+
React__default.createElement(Document, { file: file, onLoadSuccess: handleLoadSuccess, loading: renderLoading() },
|
|
80
|
+
React__default.createElement(Page, { className: cx('PdfViewer-Content-Page'), pageNumber: page, width: width, height: props.height, loading: renderLoading(), noData: React__default.createElement("div", null, "No PDF data"), scale: scale, renderTextLayer: false, renderAnnotationLayer: false }))),
|
|
81
|
+
loaded ? renderTool() : null))));
|
|
82
|
+
};
|
|
83
|
+
var PdfViewer$1 = themeable(PdfViewer);
|
|
84
|
+
|
|
85
|
+
export { PdfViewer$1 as default };
|
|
@@ -18,6 +18,7 @@ export interface PickerProps extends ThemeProps, LocaleProps {
|
|
|
18
18
|
value?: PickerValue[];
|
|
19
19
|
swipeDuration?: number;
|
|
20
20
|
visibleItemCount?: number;
|
|
21
|
+
highlightTxt?: string;
|
|
21
22
|
itemHeight?: number;
|
|
22
23
|
columns: PickerColumnItem[] | PickerColumnItem;
|
|
23
24
|
onChange?: (value?: PickerValue[], index?: number, confirm?: boolean) => void;
|
package/esm/components/Picker.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-ui v6.
|
|
2
|
+
* amis-ui v6.4.0
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -16,9 +16,9 @@ function fixToArray(data) {
|
|
|
16
16
|
return data;
|
|
17
17
|
}
|
|
18
18
|
var Picker = memo(function (props) {
|
|
19
|
-
var title = props.title, labelField = props.labelField, valueField = props.valueField, _a = props.visibleItemCount, visibleItemCount = _a === void 0 ? 5 : _a, _b = props.value, value = _b === void 0 ? [] : _b, _c = props.swipeDuration, swipeDuration = _c === void 0 ? 1000 : _c, _d = props.columns, columns = _d === void 0 ? [] : _d, _e = props.itemHeight, itemHeight = _e === void 0 ? 48 : _e, _f = props.showToolbar, showToolbar = _f === void 0 ? true : _f, _g = props.className, className = _g === void 0 ? '' : _g, cx = props.classnames, ns = props.classPrefix, __ = props.translate;
|
|
19
|
+
var title = props.title, labelField = props.labelField, valueField = props.valueField, _a = props.visibleItemCount, visibleItemCount = _a === void 0 ? 5 : _a, _b = props.value, value = _b === void 0 ? [] : _b, _c = props.swipeDuration, swipeDuration = _c === void 0 ? 1000 : _c, _d = props.columns, columns = _d === void 0 ? [] : _d, _e = props.itemHeight, itemHeight = _e === void 0 ? 48 : _e, _f = props.showToolbar, showToolbar = _f === void 0 ? true : _f, _g = props.className, className = _g === void 0 ? '' : _g, _h = props.highlightTxt, highlightTxt = _h === void 0 ? '' : _h, cx = props.classnames, ns = props.classPrefix, __ = props.translate;
|
|
20
20
|
var _columns = fixToArray(columns);
|
|
21
|
-
var
|
|
21
|
+
var _j = __read(useState(fixToArray(props.value === undefined ? props.defaultValue || [] : value)), 2), innerValue = _j[0], setInnerValue = _j[1];
|
|
22
22
|
useEffect(function () {
|
|
23
23
|
if (value === innerValue)
|
|
24
24
|
return;
|
|
@@ -43,7 +43,7 @@ var Picker = memo(function (props) {
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
var renderColumnItem = function (item, index) {
|
|
46
|
-
return (React__default.createElement(Column, __assign({}, item, { classnames: cx, classPrefix: ns, labelField: labelField || item.labelField, valueField: valueField || item.valueField, itemHeight: itemHeight, swipeDuration: swipeDuration, visibleItemCount: visibleItemCount, value: innerValue[index], onChange: function (val, i, confirm) {
|
|
46
|
+
return (React__default.createElement(Column, __assign({}, item, { highlightTxt: highlightTxt, classnames: cx, classPrefix: ns, labelField: labelField || item.labelField, valueField: valueField || item.valueField, itemHeight: itemHeight, swipeDuration: swipeDuration, visibleItemCount: visibleItemCount, value: innerValue[index], onChange: function (val, i, confirm) {
|
|
47
47
|
onChange(val, index, confirm);
|
|
48
48
|
}, key: "column".concat(index) })));
|
|
49
49
|
};
|
|
@@ -14,6 +14,7 @@ export interface PickerColumnItem {
|
|
|
14
14
|
visibleItemCount?: number;
|
|
15
15
|
itemHeight?: number;
|
|
16
16
|
options?: PickerOption[];
|
|
17
|
+
highlightTxt?: string;
|
|
17
18
|
optionRender?: (...params: any) => React.ReactNode;
|
|
18
19
|
onChange?: (value?: PickerOption | string, index?: number, confirm?: boolean) => void;
|
|
19
20
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-ui v6.
|
|
2
|
+
* amis-ui v6.4.0
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ import { __read, __assign } from 'tslib';
|
|
|
7
7
|
import React__default, { forwardRef, useRef, useMemo, useCallback, useEffect, useImperativeHandle } from 'react';
|
|
8
8
|
import isObject from 'lodash/isObject';
|
|
9
9
|
import cloneDeep from 'lodash/cloneDeep';
|
|
10
|
-
import { themeable, uncontrollable, range } from 'amis-core';
|
|
10
|
+
import { themeable, uncontrollable, range, highlight } from 'amis-core';
|
|
11
11
|
import useSetState from '../hooks/use-set-state.js';
|
|
12
12
|
import useUpdateEffect from '../hooks/use-update-effect.js';
|
|
13
13
|
import useTouch from '../hooks/use-touch.js';
|
|
@@ -30,7 +30,7 @@ function isOptionDisabled(option) {
|
|
|
30
30
|
return isObject(option) && option.disabled;
|
|
31
31
|
}
|
|
32
32
|
var PickerColumn = forwardRef(function (props, ref) {
|
|
33
|
-
var _a = props.visibleItemCount, visibleItemCount = _a === void 0 ? 5 : _a, _b = props.itemHeight, itemHeight = _b === void 0 ? 48 : _b, value = props.value, _c = props.valueField, valueField = _c === void 0 ? 'value' : _c, _d = props.swipeDuration, swipeDuration = _d === void 0 ? 1000 : _d, _e = props.labelField, labelField = _e === void 0 ? 'text' : _e, _f = props.options, options =
|
|
33
|
+
var _a = props.visibleItemCount, visibleItemCount = _a === void 0 ? 5 : _a, _b = props.itemHeight, itemHeight = _b === void 0 ? 48 : _b, value = props.value, _c = props.valueField, valueField = _c === void 0 ? 'value' : _c, _d = props.swipeDuration, swipeDuration = _d === void 0 ? 1000 : _d, _e = props.labelField, labelField = _e === void 0 ? 'text' : _e, _f = props.highlightTxt, highlightTxt = _f === void 0 ? '' : _f, _g = props.options, options = _g === void 0 ? [] : _g, cx = props.classnames;
|
|
34
34
|
var root = useRef(null);
|
|
35
35
|
var menuItemRef = useRef(null);
|
|
36
36
|
var wrapper = useRef(null);
|
|
@@ -75,12 +75,12 @@ var PickerColumn = forwardRef(function (props, ref) {
|
|
|
75
75
|
}
|
|
76
76
|
return null;
|
|
77
77
|
};
|
|
78
|
-
var
|
|
78
|
+
var _h = __read(useSetState({
|
|
79
79
|
index: adjustIndex(defaultIndex) || 0,
|
|
80
80
|
offset: 0,
|
|
81
81
|
duration: 0,
|
|
82
82
|
options: cloneDeep(options)
|
|
83
|
-
}), 2), state =
|
|
83
|
+
}), 2), state = _h[0], updateState = _h[1];
|
|
84
84
|
/**
|
|
85
85
|
*
|
|
86
86
|
* @param index 索引
|
|
@@ -224,7 +224,9 @@ var PickerColumn = forwardRef(function (props, ref) {
|
|
|
224
224
|
};
|
|
225
225
|
var childData = {
|
|
226
226
|
className: 'text-ellipsis',
|
|
227
|
-
children:
|
|
227
|
+
children: (highlightTxt
|
|
228
|
+
? highlight(text, highlightTxt, cx('Select-option-hl'))
|
|
229
|
+
: text)
|
|
228
230
|
};
|
|
229
231
|
return (React__default.createElement("li", __assign({}, data, { ref: menuItemRef }), props.optionRender ? (props.optionRender(option, { index: index, checked: state.index === index })) : (React__default.createElement("div", __assign({}, childData)))));
|
|
230
232
|
});
|
|
@@ -29,12 +29,11 @@ export interface PickerContainerState {
|
|
|
29
29
|
}
|
|
30
30
|
export declare class PickerContainer extends React.Component<PickerContainerProps, PickerContainerState> {
|
|
31
31
|
state: PickerContainerState;
|
|
32
|
-
bodyRef: React.RefObject<any>;
|
|
33
32
|
componentDidUpdate(prevProps: PickerContainerProps): void;
|
|
34
33
|
handleClick(): Promise<void>;
|
|
35
34
|
close(e?: any, callback?: () => void): void;
|
|
36
35
|
handleChange(value: any): void;
|
|
37
|
-
|
|
36
|
+
beforeConfirm(form?: any): Promise<any>;
|
|
38
37
|
updateState(state?: any): void;
|
|
39
38
|
render(): React.JSX.Element;
|
|
40
39
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-ui v6.
|
|
2
|
+
* amis-ui v6.4.0
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -16,7 +16,6 @@ var PickerContainer = /** @class */ (function (_super) {
|
|
|
16
16
|
isOpened: false,
|
|
17
17
|
value: _this.props.value
|
|
18
18
|
};
|
|
19
|
-
_this.bodyRef = React__default.createRef();
|
|
20
19
|
return _this;
|
|
21
20
|
}
|
|
22
21
|
PickerContainer.prototype.componentDidUpdate = function (prevProps) {
|
|
@@ -64,17 +63,25 @@ var PickerContainer = /** @class */ (function (_super) {
|
|
|
64
63
|
value: value
|
|
65
64
|
});
|
|
66
65
|
};
|
|
67
|
-
PickerContainer.prototype.
|
|
66
|
+
PickerContainer.prototype.beforeConfirm = function (form) {
|
|
67
|
+
var _a, _b;
|
|
68
68
|
return __awaiter(this, void 0, void 0, function () {
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
switch (_b.label) {
|
|
69
|
+
var _c, onConfirm, beforeConfirm, ret, _d, state;
|
|
70
|
+
return __generator(this, function (_e) {
|
|
71
|
+
switch (_e.label) {
|
|
73
72
|
case 0:
|
|
74
|
-
|
|
75
|
-
return [
|
|
73
|
+
_c = this.props, onConfirm = _c.onConfirm, beforeConfirm = _c.beforeConfirm;
|
|
74
|
+
if (!beforeConfirm) return [3 /*break*/, 2];
|
|
75
|
+
return [4 /*yield*/, (beforeConfirm === null || beforeConfirm === void 0 ? void 0 : beforeConfirm(form))];
|
|
76
76
|
case 1:
|
|
77
|
-
|
|
77
|
+
_d = _e.sent();
|
|
78
|
+
return [3 /*break*/, 4];
|
|
79
|
+
case 2: return [4 /*yield*/, ((_a = form === null || form === void 0 ? void 0 : form.submit) === null || _a === void 0 ? void 0 : _a.call(form))];
|
|
80
|
+
case 3:
|
|
81
|
+
_d = _e.sent();
|
|
82
|
+
_e.label = 4;
|
|
83
|
+
case 4:
|
|
84
|
+
ret = _d;
|
|
78
85
|
state = {
|
|
79
86
|
isOpened: false
|
|
80
87
|
};
|
|
@@ -85,7 +92,10 @@ var PickerContainer = /** @class */ (function (_super) {
|
|
|
85
92
|
else if (isObject(ret)) {
|
|
86
93
|
state.value = ret;
|
|
87
94
|
}
|
|
88
|
-
|
|
95
|
+
return [4 /*yield*/, (onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm((_b = state.value) !== null && _b !== void 0 ? _b : this.state.value))];
|
|
96
|
+
case 5:
|
|
97
|
+
_e.sent();
|
|
98
|
+
this.setState(state);
|
|
89
99
|
return [2 /*return*/];
|
|
90
100
|
}
|
|
91
101
|
});
|
|
@@ -105,9 +115,9 @@ var PickerContainer = /** @class */ (function (_super) {
|
|
|
105
115
|
onClick: this.handleClick,
|
|
106
116
|
setState: this.updateState
|
|
107
117
|
}),
|
|
108
|
-
React__default.createElement(ConfirmBox, { type: "dialog", size: size, closeOnEsc: closeOnEsc, show: this.state.isOpened, onCancel: this.close, title: title || __('Select.placeholder'), showTitle: showTitle, headerClassName: headerClassName, bodyClassName: bodyClassName, className: className, showFooter: showFooter, beforeConfirm: this.
|
|
109
|
-
var popOverContainer = _a.popOverContainer, loading = _a.loading;
|
|
110
|
-
return popOverRender(__assign(__assign({}, _this.state), { ref:
|
|
118
|
+
React__default.createElement(ConfirmBox, { type: "dialog", size: size, closeOnEsc: closeOnEsc, show: this.state.isOpened, onCancel: this.close, title: title || __('Select.placeholder'), showTitle: showTitle, headerClassName: headerClassName, bodyClassName: bodyClassName, className: className, showFooter: showFooter, beforeConfirm: this.beforeConfirm, popOverContainer: popOverContainer, mobileUI: mobileUI, disabled: disabled }, function (_a) {
|
|
119
|
+
var popOverContainer = _a.popOverContainer, loading = _a.loading, onConfirm = _a.onConfirm, bodyRef = _a.bodyRef;
|
|
120
|
+
return popOverRender(__assign(__assign({}, _this.state), { ref: bodyRef, setState: _this.updateState, onClose: _this.close, onChange: _this.handleChange, onConfirm: onConfirm, popOverContainer: popOverContainer, loading: loading }));
|
|
111
121
|
})));
|
|
112
122
|
};
|
|
113
123
|
__decorate([
|
|
@@ -131,9 +141,9 @@ var PickerContainer = /** @class */ (function (_super) {
|
|
|
131
141
|
__decorate([
|
|
132
142
|
autobind,
|
|
133
143
|
__metadata("design:type", Function),
|
|
134
|
-
__metadata("design:paramtypes", []),
|
|
144
|
+
__metadata("design:paramtypes", [Object]),
|
|
135
145
|
__metadata("design:returntype", Promise)
|
|
136
|
-
], PickerContainer.prototype, "
|
|
146
|
+
], PickerContainer.prototype, "beforeConfirm", null);
|
|
137
147
|
__decorate([
|
|
138
148
|
autobind,
|
|
139
149
|
__metadata("design:type", Function),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-ui v6.
|
|
2
|
+
* amis-ui v6.4.0
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -89,12 +89,12 @@ var PopOverContainer = /** @class */ (function (_super) {
|
|
|
89
89
|
var _a = this.props, mobileUI = _a.mobileUI, children = _a.children, popOverContainer = _a.popOverContainer, popOverClassName = _a.popOverClassName, dropdownRender = _a.popOverRender, placement = _a.placement, align = _a.align, showConfirm = _a.showConfirm; _a.onConfirm; var disabled = _a.disabled;
|
|
90
90
|
return (React__default.createElement(React__default.Fragment, null,
|
|
91
91
|
children({
|
|
92
|
-
isOpened: this.state.isOpened,
|
|
92
|
+
isOpened: this.state.isOpened && this.props.show !== false,
|
|
93
93
|
onClick: this.handleClick,
|
|
94
94
|
ref: this.targetRef,
|
|
95
95
|
disabled: disabled
|
|
96
96
|
}),
|
|
97
|
-
mobileUI ? (React__default.createElement(PopUp, { isShow: this.state.isOpened, container:
|
|
97
|
+
mobileUI ? (React__default.createElement(PopUp, { isShow: this.state.isOpened && this.props.show !== false, container: popOverContainer, className: popOverClassName, showConfirm: showConfirm, onHide: this.close, onConfirm: this.onConfirm }, dropdownRender({ onClose: this.close }))) : (React__default.createElement(Overlay, { container: popOverContainer || this.getParent, target: this.getTarget, placement: placement || PopOverContainer.alignToPlacement({ align: align }), show: this.state.isOpened && this.props.show !== false },
|
|
98
98
|
React__default.createElement(PopOver, { overlay: true, className: popOverClassName, style: this.getOverlayStyle(), onHide: this.close }, dropdownRender({ onClose: this.close }))))));
|
|
99
99
|
};
|
|
100
100
|
PopOverContainer.alignPlacementMap = {
|