amis-rev-ui 6.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/esm/HTMLFilterContext.d.ts +3 -0
- package/esm/HTMLFilterContext.js +10 -0
- package/esm/components/404.js +35 -0
- package/esm/components/Alert.js +266 -0
- package/esm/components/Alert2.js +58 -0
- package/esm/components/AlphabetIndexer.d.ts +11 -0
- package/esm/components/AlphabetIndexer.js +48 -0
- package/esm/components/AnchorNav.js +153 -0
- package/esm/components/AnchorNavSection.d.ts +2 -0
- package/esm/components/AnchorNavSection.js +7 -0
- package/esm/components/ArrayInput.js +146 -0
- package/esm/components/AsideNav.js +133 -0
- package/esm/components/AssociatedSelection.js +107 -0
- package/esm/components/AutoFoldedList.js +124 -0
- package/esm/components/AutoSizer.d.ts +2 -0
- package/esm/components/AutoSizer.js +8 -0
- package/esm/components/Avatar.js +126 -0
- package/esm/components/Badge.d.ts +20 -0
- package/esm/components/Badge.js +154 -0
- package/esm/components/BaiduMapPicker.js +366 -0
- package/esm/components/BarCode.js +42 -0
- package/esm/components/Breadcrumb.js +160 -0
- package/esm/components/Button.js +64 -0
- package/esm/components/CalendarMobile.js +538 -0
- package/esm/components/Card.js +88 -0
- package/esm/components/Cascader.js +515 -0
- package/esm/components/ChainedDropdownSelection.js +104 -0
- package/esm/components/ChainedSelection.js +184 -0
- package/esm/components/Checkbox.js +87 -0
- package/esm/components/CityArea.js +190 -0
- package/esm/components/CityDB.d.ts +13 -0
- package/esm/components/CityDB.js +3942 -0
- package/esm/components/CodeMirror.d.ts +29 -0
- package/esm/components/CodeMirror.js +140 -0
- package/esm/components/Collapse.js +184 -0
- package/esm/components/CollapseGroup.js +117 -0
- package/esm/components/ColorPicker.js +259 -0
- package/esm/components/Combo.js +212 -0
- package/esm/components/ConditionBuilder.d.ts +2 -0
- package/esm/components/ConditionBuilder.js +7 -0
- package/esm/components/ConfirmBox.js +128 -0
- package/esm/components/ContextMenu.js +310 -0
- package/esm/components/DatePicker.js +716 -0
- package/esm/components/DateRangePicker.js +1385 -0
- package/esm/components/DiffEditor.d.ts +21 -0
- package/esm/components/DiffEditor.js +119 -0
- package/esm/components/DndContainer.js +25 -0
- package/esm/components/Drawer.js +272 -0
- package/esm/components/DropDownSelection.js +77 -0
- package/esm/components/DropdownContextMenus.js +93 -0
- package/esm/components/Editor.js +238 -0
- package/esm/components/Form.d.ts +31 -0
- package/esm/components/Form.js +84 -0
- package/esm/components/FormField.js +78 -0
- package/esm/components/FormulaPicker.d.ts +2 -0
- package/esm/components/FormulaPicker.js +7 -0
- package/esm/components/GaodeMapPicker.js +204 -0
- package/esm/components/GridNav.d.ts +53 -0
- package/esm/components/GridNav.js +125 -0
- package/esm/components/GridNavItem.d.ts +2 -0
- package/esm/components/GridNavItem.js +7 -0
- package/esm/components/GroupedSelection.js +138 -0
- package/esm/components/HeadCellDropDown.d.ts +2 -0
- package/esm/components/HeadCellDropDown.js +7 -0
- package/esm/components/HorizontalScroll.d.ts +74 -0
- package/esm/components/HorizontalScroll.js +271 -0
- package/esm/components/Html.js +55 -0
- package/esm/components/Icon.d.ts +2 -0
- package/esm/components/Icon.js +7 -0
- package/esm/components/ImageGallery.js +396 -0
- package/esm/components/Input.d.ts +18 -0
- package/esm/components/Input.js +75 -0
- package/esm/components/InputBox.js +99 -0
- package/esm/components/InputBoxWithSuggestion.js +70 -0
- package/esm/components/InputJSONSchema.d.ts +2 -0
- package/esm/components/InputJSONSchema.js +7 -0
- package/esm/components/InputTable.js +176 -0
- package/esm/components/JSONSchemaEditor.d.ts +2 -0
- package/esm/components/JSONSchemaEditor.js +7 -0
- package/esm/components/Layout.js +60 -0
- package/esm/components/Link.js +44 -0
- package/esm/components/ListGroup.js +31 -0
- package/esm/components/ListMenu.js +62 -0
- package/esm/components/LocationPicker.js +208 -0
- package/esm/components/Markdown.d.ts +25 -0
- package/esm/components/Markdown.js +70 -0
- package/esm/components/Menu.d.ts +2 -0
- package/esm/components/Menu.js +7 -0
- package/esm/components/MixedInput.js +88 -0
- package/esm/components/MobileDevTool.d.ts +12 -0
- package/esm/components/MobileDevTool.js +312 -0
- package/esm/components/Modal.js +261 -0
- package/esm/components/ModalManager.d.ts +16 -0
- package/esm/components/ModalManager.js +42 -0
- package/esm/components/MultilineText.js +90 -0
- package/esm/components/NumberInput.js +274 -0
- package/esm/components/OverflowTpl.js +100 -0
- package/esm/components/Pagination.js +377 -0
- package/esm/components/PdfViewer.js +83 -0
- package/esm/components/Picker.js +73 -0
- package/esm/components/PickerColumn.js +276 -0
- package/esm/components/PickerContainer.js +157 -0
- package/esm/components/PopOverContainer.d.ts +59 -0
- package/esm/components/PopOverContainer.js +148 -0
- package/esm/components/PopUp.js +85 -0
- package/esm/components/Progress.js +136 -0
- package/esm/components/PullRefresh.js +172 -0
- package/esm/components/Radios.js +129 -0
- package/esm/components/Range.js +516 -0
- package/esm/components/Rating.js +341 -0
- package/esm/components/ResultBox.js +195 -0
- package/esm/components/ResultList.js +253 -0
- package/esm/components/ResultTableList.js +152 -0
- package/esm/components/ResultTreeList.js +241 -0
- package/esm/components/RichText.d.ts +48 -0
- package/esm/components/RichText.js +271 -0
- package/esm/components/SearchBox.js +298 -0
- package/esm/components/Select.js +814 -0
- package/esm/components/SelectMobile.d.ts +38 -0
- package/esm/components/SelectMobile.js +369 -0
- package/esm/components/Selection.js +166 -0
- package/esm/components/Shape.js +429 -0
- package/esm/components/Signature.js +294 -0
- package/esm/components/Slider.js +140 -0
- package/esm/components/SparkLine.js +62 -0
- package/esm/components/Spinner.js +202 -0
- package/esm/components/Steps.js +76 -0
- package/esm/components/Switch.js +73 -0
- package/esm/components/Tab.d.ts +2 -0
- package/esm/components/Tab.js +7 -0
- package/esm/components/Table.d.ts +2 -0
- package/esm/components/Table.js +7 -0
- package/esm/components/TableSelection.js +169 -0
- package/esm/components/Tabs.js +607 -0
- package/esm/components/TabsTransfer.js +221 -0
- package/esm/components/TabsTransferPicker.js +81 -0
- package/esm/components/Tag.js +137 -0
- package/esm/components/Textarea.js +146 -0
- package/esm/components/Timeline.js +60 -0
- package/esm/components/TimelineItem.js +101 -0
- package/esm/components/Tinymce.d.ts +66 -0
- package/esm/components/Tinymce.js +634 -0
- package/esm/components/TitleBar.js +48 -0
- package/esm/components/Toast.js +247 -0
- package/esm/components/Tooltip.js +36 -0
- package/esm/components/TooltipWrapper.js +180 -0
- package/esm/components/Transfer.js +485 -0
- package/esm/components/TransferDropDown.js +98 -0
- package/esm/components/TransferPicker.js +98 -0
- package/esm/components/TransferSearch.js +100 -0
- package/esm/components/Tree.js +1256 -0
- package/esm/components/TreeSelection.js +201 -0
- package/esm/components/UserSelect.js +674 -0
- package/esm/components/UserTabSelect.js +227 -0
- package/esm/components/VerificationCode.js +172 -0
- package/esm/components/VirtualList.d.ts +2 -0
- package/esm/components/VirtualList.js +7 -0
- package/esm/components/WithRemoteConfig.d.ts +70 -0
- package/esm/components/WithRemoteConfig.js +301 -0
- package/esm/components/WithStore.d.ts +13 -0
- package/esm/components/WithStore.js +48 -0
- package/esm/components/calendar/Calendar.d.ts +83 -0
- package/esm/components/calendar/Calendar.js +529 -0
- package/esm/components/calendar/CalendarContainer.d.ts +10 -0
- package/esm/components/calendar/CalendarContainer.js +27 -0
- package/esm/components/calendar/DaysView.js +528 -0
- package/esm/components/calendar/MonthsView.js +175 -0
- package/esm/components/calendar/QuartersView.js +125 -0
- package/esm/components/calendar/TimeView.js +559 -0
- package/esm/components/calendar/YearsView.js +122 -0
- package/esm/components/condition-builder/Expression.js +121 -0
- package/esm/components/condition-builder/Field.js +32 -0
- package/esm/components/condition-builder/Func.js +75 -0
- package/esm/components/condition-builder/Group.js +196 -0
- package/esm/components/condition-builder/GroupOrItem.js +107 -0
- package/esm/components/condition-builder/InputSwitch.js +28 -0
- package/esm/components/condition-builder/Item.js +233 -0
- package/esm/components/condition-builder/Value.js +115 -0
- package/esm/components/condition-builder/config.d.ts +36 -0
- package/esm/components/condition-builder/config.js +120 -0
- package/esm/components/condition-builder/index.js +242 -0
- package/esm/components/condition-builder/types.d.ts +116 -0
- package/esm/components/formula/CodeEditor.js +99 -0
- package/esm/components/formula/Editor.js +446 -0
- package/esm/components/formula/FuncList.js +64 -0
- package/esm/components/formula/Input.js +141 -0
- package/esm/components/formula/Picker.js +454 -0
- package/esm/components/formula/VariableList.js +185 -0
- package/esm/components/formula/plugin.d.ts +51 -0
- package/esm/components/formula/plugin.js +445 -0
- package/esm/components/icons.d.ts +61 -0
- package/esm/components/icons.js +458 -0
- package/esm/components/index.d.ts +138 -0
- package/esm/components/json-schema/Array.d.ts +3 -0
- package/esm/components/json-schema/Array.js +129 -0
- package/esm/components/json-schema/Item.d.ts +5 -0
- package/esm/components/json-schema/Item.js +63 -0
- package/esm/components/json-schema/Object.d.ts +5 -0
- package/esm/components/json-schema/Object.js +272 -0
- package/esm/components/json-schema/index.js +29 -0
- package/esm/components/menu/MenuContext.d.ts +82 -0
- package/esm/components/menu/MenuContext.js +25 -0
- package/esm/components/menu/MenuItem.js +112 -0
- package/esm/components/menu/PanelMenu.js +68 -0
- package/esm/components/menu/SubMenu.js +137 -0
- package/esm/components/menu/index.js +368 -0
- package/esm/components/schema-editor/Array.d.ts +11 -0
- package/esm/components/schema-editor/Array.js +84 -0
- package/esm/components/schema-editor/Common.d.ts +61 -0
- package/esm/components/schema-editor/Common.js +162 -0
- package/esm/components/schema-editor/Item.d.ts +8 -0
- package/esm/components/schema-editor/Item.js +24 -0
- package/esm/components/schema-editor/Object.d.ts +51 -0
- package/esm/components/schema-editor/Object.js +294 -0
- package/esm/components/schema-editor/SchemaVariableList.js +74 -0
- package/esm/components/schema-editor/SchemaVariableListPicker.js +34 -0
- package/esm/components/schema-editor/index.js +122 -0
- package/esm/components/table/Cell.d.ts +36 -0
- package/esm/components/table/Cell.js +43 -0
- package/esm/components/table/ColGroup.d.ts +24 -0
- package/esm/components/table/ColGroup.js +77 -0
- package/esm/components/table/Head.d.ts +45 -0
- package/esm/components/table/Head.js +150 -0
- package/esm/components/table/HeadCellDropDown.js +54 -0
- package/esm/components/table/HeadCellFilter.js +130 -0
- package/esm/components/table/HeadCellSelect.js +51 -0
- package/esm/components/table/HeadCellSort.js +88 -0
- package/esm/components/table/ItemActionsWrapper.d.ts +10 -0
- package/esm/components/table/ItemActionsWrapper.js +29 -0
- package/esm/components/table/Row.d.ts +56 -0
- package/esm/components/table/Row.js +224 -0
- package/esm/components/table/SummaryRow.d.ts +28 -0
- package/esm/components/table/SummaryRow.js +73 -0
- package/esm/components/table/index.js +1095 -0
- package/esm/components/table/util.d.ts +25 -0
- package/esm/components/table/util.js +279 -0
- package/esm/components/virtual-list/AutoSizer.d.ts +19 -0
- package/esm/components/virtual-list/AutoSizer.js +48 -0
- package/esm/components/virtual-list/SizeAndPositionManager.d.ts +70 -0
- package/esm/components/virtual-list/SizeAndPositionManager.js +216 -0
- package/esm/components/virtual-list/constants.d.ts +34 -0
- package/esm/components/virtual-list/constants.js +45 -0
- package/esm/components/virtual-list/index.d.ts +98 -0
- package/esm/components/virtual-list/index.js +288 -0
- package/esm/components/withBadge.d.ts +2 -0
- package/esm/components/withBadge.js +7 -0
- package/esm/hooks/index.d.ts +8 -0
- package/esm/hooks/use-click-away.d.ts +12 -0
- package/esm/hooks/use-click-away.js +55 -0
- package/esm/hooks/use-on-screen.d.ts +2 -0
- package/esm/hooks/use-on-screen.js +28 -0
- package/esm/hooks/use-set-state.d.ts +2 -0
- package/esm/hooks/use-set-state.js +19 -0
- package/esm/hooks/use-sub-form.d.ts +4 -0
- package/esm/hooks/use-sub-form.js +39 -0
- package/esm/hooks/use-touch.d.ts +16 -0
- package/esm/hooks/use-touch.js +77 -0
- package/esm/hooks/use-update-effect.d.ts +3 -0
- package/esm/hooks/use-update-effect.js +21 -0
- package/esm/hooks/use-validation-resolver.d.ts +7 -0
- package/esm/hooks/use-validation-resolver.js +115 -0
- package/esm/icons/alert-danger.svg.js +22 -0
- package/esm/icons/alert-info.svg.js +22 -0
- package/esm/icons/alert-success.svg.js +22 -0
- package/esm/icons/alert-warning.svg.js +22 -0
- package/esm/icons/arrow-double-left.svg.js +24 -0
- package/esm/icons/arrow-double-right.svg.js +24 -0
- package/esm/icons/back.svg.js +21 -0
- package/esm/icons/calendar.svg.js +31 -0
- package/esm/icons/caret.svg.js +21 -0
- package/esm/icons/check.svg.js +21 -0
- package/esm/icons/clock.svg.js +29 -0
- package/esm/icons/close-small.svg.js +24 -0
- package/esm/icons/close.svg.js +21 -0
- package/esm/icons/cloud-upload.svg.js +22 -0
- package/esm/icons/column-filter.svg.js +22 -0
- package/esm/icons/columns.svg.js +21 -0
- package/esm/icons/compress-alt.svg.js +21 -0
- package/esm/icons/copy.svg.js +26 -0
- package/esm/icons/date.svg.js +26 -0
- package/esm/icons/department.svg.js +52 -0
- package/esm/icons/desk-empty.svg.js +73 -0
- package/esm/icons/dot.svg.js +36 -0
- package/esm/icons/down-arrow-bold.svg.js +22 -0
- package/esm/icons/down.svg.js +23 -0
- package/esm/icons/download.svg.js +24 -0
- package/esm/icons/drag-bar.svg.js +53 -0
- package/esm/icons/drag.svg.js +22 -0
- package/esm/icons/edit.svg.js +21 -0
- package/esm/icons/ellipsis-v.svg.js +21 -0
- package/esm/icons/enter.svg.js +20 -0
- package/esm/icons/exchange.svg.js +21 -0
- package/esm/icons/expand-alt.svg.js +21 -0
- package/esm/icons/fail.svg.js +31 -0
- package/esm/icons/file.svg.js +22 -0
- package/esm/icons/filter.svg.js +21 -0
- package/esm/icons/folder.svg.js +24 -0
- package/esm/icons/fullscreen.svg.js +21 -0
- package/esm/icons/function.svg.js +21 -0
- package/esm/icons/home.svg.js +21 -0
- package/esm/icons/if.svg.js +21 -0
- package/esm/icons/image.svg.js +20 -0
- package/esm/icons/info-circle.svg.js +21 -0
- package/esm/icons/info.svg.js +27 -0
- package/esm/icons/input-clear.svg.js +20 -0
- package/esm/icons/invisible.svg.js +22 -0
- package/esm/icons/left-arrow.svg.js +23 -0
- package/esm/icons/loading-outline.svg.js +21 -0
- package/esm/icons/location.svg.js +20 -0
- package/esm/icons/menu.svg.js +20 -0
- package/esm/icons/minus.svg.js +21 -0
- package/esm/icons/move.svg.js +22 -0
- package/esm/icons/mute.svg.js +21 -0
- package/esm/icons/new-edit.svg.js +22 -0
- package/esm/icons/pause.svg.js +21 -0
- package/esm/icons/pencil.svg.js +21 -0
- package/esm/icons/play.svg.js +20 -0
- package/esm/icons/plus-cicle.svg.js +20 -0
- package/esm/icons/plus-fine.svg.js +21 -0
- package/esm/icons/plus.svg.js +21 -0
- package/esm/icons/post.svg.js +48 -0
- package/esm/icons/question-mark.svg.js +26 -0
- package/esm/icons/question.svg.js +21 -0
- package/esm/icons/question2.svg.js +34 -0
- package/esm/icons/redo.svg.js +21 -0
- package/esm/icons/refresh.svg.js +21 -0
- package/esm/icons/reload.svg.js +21 -0
- package/esm/icons/remove.svg.js +21 -0
- package/esm/icons/retry.svg.js +24 -0
- package/esm/icons/right-arrow-bold.svg.js +21 -0
- package/esm/icons/right-arrow.svg.js +23 -0
- package/esm/icons/right-double-arrow.svg.js +22 -0
- package/esm/icons/role.svg.js +43 -0
- package/esm/icons/rotate-left.svg.js +22 -0
- package/esm/icons/rotate-right.svg.js +22 -0
- package/esm/icons/rotate-screen.svg.js +21 -0
- package/esm/icons/scale-origin.svg.js +24 -0
- package/esm/icons/schedule.svg.js +24 -0
- package/esm/icons/search.svg.js +21 -0
- package/esm/icons/setting.svg.js +21 -0
- package/esm/icons/slider-handle-icon.svg.js +22 -0
- package/esm/icons/sort-asc.svg.js +21 -0
- package/esm/icons/sort-default.svg.js +21 -0
- package/esm/icons/sort-desc.svg.js +21 -0
- package/esm/icons/star.svg.js +21 -0
- package/esm/icons/status-close.svg.js +23 -0
- package/esm/icons/steps-finsh.svg.js +22 -0
- package/esm/icons/sub-plus.svg.js +20 -0
- package/esm/icons/success.svg.js +29 -0
- package/esm/icons/transparent.svg.js +38 -0
- package/esm/icons/trash.svg.js +22 -0
- package/esm/icons/tree-down.svg.js +21 -0
- package/esm/icons/undo-normal.svg.js +25 -0
- package/esm/icons/undo.svg.js +21 -0
- package/esm/icons/unfullscreen.svg.js +21 -0
- package/esm/icons/upload.svg.js +21 -0
- package/esm/icons/user-remove.svg.js +33 -0
- package/esm/icons/view.svg.js +22 -0
- package/esm/icons/volume.svg.js +24 -0
- package/esm/icons/warning-mark.svg.js +22 -0
- package/esm/icons/warning.svg.js +21 -0
- package/esm/icons/window-restore.svg.js +21 -0
- package/esm/icons/zoom-in.svg.js +21 -0
- package/esm/icons/zoom-out.svg.js +21 -0
- package/esm/index.d.ts +16 -0
- package/esm/index.js +157 -0
- package/esm/locale/de-DE.d.ts +1 -0
- package/esm/locale/de-DE.js +423 -0
- package/esm/locale/en-US.d.ts +1 -0
- package/esm/locale/en-US.js +429 -0
- package/esm/locale/zh-CN.d.ts +1 -0
- package/esm/locale/zh-CN.js +438 -0
- package/esm/themes/ang.d.ts +3 -0
- package/esm/themes/ang.js +15 -0
- package/esm/themes/antd.d.ts +1 -0
- package/esm/themes/antd.js +42 -0
- package/esm/themes/cxd.d.ts +3 -0
- package/esm/themes/cxd.js +455 -0
- package/esm/themes/dark.d.ts +3 -0
- package/esm/themes/dark.js +23 -0
- package/esm/themes/default.d.ts +4 -0
- package/esm/utils/index.d.ts +2 -0
- package/esm/utils/smoothSignature.d.ts +86 -0
- package/esm/utils/vectorComputed.d.ts +20 -0
- package/esm/utils/vectorComputed.js +75 -0
- package/esm/withRemoteConfig.d.ts +2 -0
- package/esm/withRemoteConfig.js +7 -0
- package/esm/withStore.d.ts +2 -0
- package/esm/withStore.js +7 -0
- package/lib/HTMLFilterContext.d.ts +3 -0
- package/lib/components/AlphabetIndexer.d.ts +11 -0
- package/lib/components/AnchorNavSection.d.ts +2 -0
- package/lib/components/AutoSizer.d.ts +2 -0
- package/lib/components/Badge.d.ts +20 -0
- package/lib/components/BarCode.js +44 -0
- package/lib/components/CityDB.d.ts +13 -0
- package/lib/components/CityDB.js +3945 -0
- package/lib/components/CodeMirror.d.ts +29 -0
- package/lib/components/ColorPicker.js +267 -0
- package/lib/components/ConditionBuilder.d.ts +2 -0
- package/lib/components/DiffEditor.d.ts +21 -0
- package/lib/components/Form.d.ts +31 -0
- package/lib/components/FormulaPicker.d.ts +2 -0
- package/lib/components/GridNav.d.ts +53 -0
- package/lib/components/GridNavItem.d.ts +2 -0
- package/lib/components/HeadCellDropDown.d.ts +2 -0
- package/lib/components/HorizontalScroll.d.ts +74 -0
- package/lib/components/Icon.d.ts +2 -0
- package/lib/components/Input.d.ts +18 -0
- package/lib/components/InputJSONSchema.d.ts +2 -0
- package/lib/components/JSONSchemaEditor.d.ts +2 -0
- package/lib/components/Markdown.d.ts +25 -0
- package/lib/components/Markdown.js +76 -0
- package/lib/components/Menu.d.ts +2 -0
- package/lib/components/MobileDevTool.d.ts +12 -0
- package/lib/components/ModalManager.d.ts +16 -0
- package/lib/components/PdfViewer.js +83 -0
- package/lib/components/PopOverContainer.d.ts +59 -0
- package/lib/components/RichText.d.ts +48 -0
- package/lib/components/RichText.js +275 -0
- package/lib/components/SelectMobile.d.ts +38 -0
- package/lib/components/Tab.d.ts +2 -0
- package/lib/components/Table.d.ts +2 -0
- package/lib/components/Tinymce.d.ts +66 -0
- package/lib/components/Tinymce.js +641 -0
- package/lib/components/VirtualList.d.ts +2 -0
- package/lib/components/WithRemoteConfig.d.ts +70 -0
- package/lib/components/WithStore.d.ts +13 -0
- package/lib/components/calendar/Calendar.d.ts +83 -0
- package/lib/components/calendar/CalendarContainer.d.ts +10 -0
- package/lib/components/condition-builder/config.d.ts +36 -0
- package/lib/components/condition-builder/types.d.ts +116 -0
- package/lib/components/formula/plugin.d.ts +51 -0
- package/lib/components/icons.d.ts +61 -0
- package/lib/components/index.d.ts +138 -0
- package/lib/components/json-schema/Array.d.ts +3 -0
- package/lib/components/json-schema/Item.d.ts +5 -0
- package/lib/components/json-schema/Object.d.ts +5 -0
- package/lib/components/menu/MenuContext.d.ts +82 -0
- package/lib/components/schema-editor/Array.d.ts +11 -0
- package/lib/components/schema-editor/Common.d.ts +61 -0
- package/lib/components/schema-editor/Item.d.ts +8 -0
- package/lib/components/schema-editor/Object.d.ts +51 -0
- package/lib/components/table/Cell.d.ts +36 -0
- package/lib/components/table/ColGroup.d.ts +24 -0
- package/lib/components/table/Head.d.ts +45 -0
- package/lib/components/table/ItemActionsWrapper.d.ts +10 -0
- package/lib/components/table/Row.d.ts +56 -0
- package/lib/components/table/SummaryRow.d.ts +28 -0
- package/lib/components/table/util.d.ts +25 -0
- package/lib/components/virtual-list/AutoSizer.d.ts +19 -0
- package/lib/components/virtual-list/SizeAndPositionManager.d.ts +70 -0
- package/lib/components/virtual-list/constants.d.ts +34 -0
- package/lib/components/virtual-list/index.d.ts +98 -0
- package/lib/components/withBadge.d.ts +2 -0
- package/lib/helper.css +47762 -0
- package/lib/hooks/index.d.ts +8 -0
- package/lib/hooks/use-click-away.d.ts +12 -0
- package/lib/hooks/use-on-screen.d.ts +2 -0
- package/lib/hooks/use-set-state.d.ts +2 -0
- package/lib/hooks/use-sub-form.d.ts +4 -0
- package/lib/hooks/use-touch.d.ts +16 -0
- package/lib/hooks/use-update-effect.d.ts +3 -0
- package/lib/hooks/use-validation-resolver.d.ts +7 -0
- package/lib/index.d.ts +16 -0
- package/lib/index.js +28 -0
- package/lib/locale/de-DE.d.ts +1 -0
- package/lib/locale/en-US.d.ts +1 -0
- package/lib/locale/zh-CN.d.ts +1 -0
- package/lib/scss/helper.scss.js +12 -0
- package/lib/scss/themes/ang.scss.js +12 -0
- package/lib/scss/themes/antd.scss.js +12 -0
- package/lib/scss/themes/cxd.scss.js +12 -0
- package/lib/scss/themes/dark.scss.js +12 -0
- package/lib/scss/themes/default.scss.js +12 -0
- package/lib/themes/ang.css +45895 -0
- package/lib/themes/ang.d.ts +3 -0
- package/lib/themes/antd.css +45882 -0
- package/lib/themes/antd.d.ts +1 -0
- package/lib/themes/cxd.css +45871 -0
- package/lib/themes/cxd.d.ts +3 -0
- package/lib/themes/dark.css +45902 -0
- package/lib/themes/dark.d.ts +3 -0
- package/lib/themes/default.css +45871 -0
- package/lib/themes/default.d.ts +4 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/smoothSignature.d.ts +86 -0
- package/lib/utils/vectorComputed.d.ts +20 -0
- package/lib/withRemoteConfig.d.ts +2 -0
- package/lib/withStore.d.ts +2 -0
- package/package.json +158 -0
- package/scss/README.md +9 -0
- package/scss/_components.scss +4346 -0
- package/scss/_functions.scss +137 -0
- package/scss/_mixins.scss +805 -0
- package/scss/_properties.scss +898 -0
- package/scss/_thirds.scss +12 -0
- package/scss/_utilities.scss +1757 -0
- package/scss/_variables.scss +439 -0
- package/scss/base/_animate.scss +84 -0
- package/scss/base/_common.scss +19 -0
- package/scss/base/_normalize.scss +376 -0
- package/scss/base/_reset.scss +18 -0
- package/scss/base/_typography.scss +79 -0
- package/scss/components/_alert.scss +123 -0
- package/scss/components/_anchor-nav.scss +158 -0
- package/scss/components/_app.scss +46 -0
- package/scss/components/_array-input.scss +107 -0
- package/scss/components/_audio.scss +146 -0
- package/scss/components/_auto-folder.scss +40 -0
- package/scss/components/_avatar.scss +55 -0
- package/scss/components/_badge.scss +145 -0
- package/scss/components/_barcode.scss +6 -0
- package/scss/components/_breadcrumb.scss +110 -0
- package/scss/components/_button-group.scss +165 -0
- package/scss/components/_button.scss +871 -0
- package/scss/components/_calendar.scss +442 -0
- package/scss/components/_card.scss +389 -0
- package/scss/components/_card2.scss +28 -0
- package/scss/components/_cards.scss +221 -0
- package/scss/components/_carousel.scss +292 -0
- package/scss/components/_cascader.scss +157 -0
- package/scss/components/_chart.scss +22 -0
- package/scss/components/_city-area.scss +37 -0
- package/scss/components/_code.scss +10 -0
- package/scss/components/_collapse-group.scss +83 -0
- package/scss/components/_collapse.scss +245 -0
- package/scss/components/_color.scss +17 -0
- package/scss/components/_column-toggler.scss +261 -0
- package/scss/components/_condition-builder.scss +521 -0
- package/scss/components/_context-menu.scss +204 -0
- package/scss/components/_copyable.scss +10 -0
- package/scss/components/_crud.scss +195 -0
- package/scss/components/_crud2.scss +345 -0
- package/scss/components/_debug.scss +259 -0
- package/scss/components/_divider.scss +81 -0
- package/scss/components/_drawer.scss +393 -0
- package/scss/components/_dropdown-context-menus.scss +27 -0
- package/scss/components/_dropdown.scss +159 -0
- package/scss/components/_each.scss +7 -0
- package/scss/components/_formula.scss +723 -0
- package/scss/components/_grid-nav.scss +128 -0
- package/scss/components/_horizontal-scroll.scss +51 -0
- package/scss/components/_icon.scss +4 -0
- package/scss/components/_image-gallery.scss +331 -0
- package/scss/components/_images.scss +650 -0
- package/scss/components/_input-box.scss +111 -0
- package/scss/components/_json-schema-editor.scss +149 -0
- package/scss/components/_json-schema.scss +166 -0
- package/scss/components/_json.scss +7 -0
- package/scss/components/_link.scss +22 -0
- package/scss/components/_list-menu.scss +114 -0
- package/scss/components/_list.scss +313 -0
- package/scss/components/_log.scss +169 -0
- package/scss/components/_mapping.scss +6 -0
- package/scss/components/_markdown.scss +266 -0
- package/scss/components/_menu.scss +795 -0
- package/scss/components/_mobile-dev-tool.scss +175 -0
- package/scss/components/_modal.scss +282 -0
- package/scss/components/_multiline-text.scss +20 -0
- package/scss/components/_nav.scss +45 -0
- package/scss/components/_overflow-tpl.scss +5 -0
- package/scss/components/_page.scss +198 -0
- package/scss/components/_pagination.scss +403 -0
- package/scss/components/_panel.scss +263 -0
- package/scss/components/_pdf_viewer.scss +47 -0
- package/scss/components/_picker-columns.scss +140 -0
- package/scss/components/_popover.scss +54 -0
- package/scss/components/_popoverable.scss +100 -0
- package/scss/components/_popup.scss +171 -0
- package/scss/components/_portlet.scss +51 -0
- package/scss/components/_print.scss +13 -0
- package/scss/components/_progress.scss +165 -0
- package/scss/components/_property.scss +47 -0
- package/scss/components/_pull-refresh.scss +30 -0
- package/scss/components/_quick-edit.scss +53 -0
- package/scss/components/_remark.scss +58 -0
- package/scss/components/_result-box.scss +380 -0
- package/scss/components/_search-box.scss +267 -0
- package/scss/components/_service.scss +3 -0
- package/scss/components/_shape.scss +19 -0
- package/scss/components/_signature.scss +98 -0
- package/scss/components/_slider.scss +27 -0
- package/scss/components/_sparkline.scss +18 -0
- package/scss/components/_spinner.scss +214 -0
- package/scss/components/_status.scss +118 -0
- package/scss/components/_steps.scss +481 -0
- package/scss/components/_table.scss +1234 -0
- package/scss/components/_table2.scss +1066 -0
- package/scss/components/_tabs.scss +1410 -0
- package/scss/components/_tag.scss +191 -0
- package/scss/components/_timeline.scss +572 -0
- package/scss/components/_toast.scss +342 -0
- package/scss/components/_tooltip.scss +340 -0
- package/scss/components/_tpl.scss +51 -0
- package/scss/components/_verificationCode.scss +33 -0
- package/scss/components/_video.scss +38 -0
- package/scss/components/_wizard.scss +287 -0
- package/scss/components/_wrapper.scss +26 -0
- package/scss/components/form/_chained-select.scss +10 -0
- package/scss/components/form/_checks.scss +433 -0
- package/scss/components/form/_city.scss +33 -0
- package/scss/components/form/_color.scss +148 -0
- package/scss/components/form/_combo.scss +360 -0
- package/scss/components/form/_date-range.scss +332 -0
- package/scss/components/form/_date.scss +807 -0
- package/scss/components/form/_editor.scss +139 -0
- package/scss/components/form/_excel.scss +150 -0
- package/scss/components/form/_fieldset.scss +202 -0
- package/scss/components/form/_file.scss +308 -0
- package/scss/components/form/_form.scss +936 -0
- package/scss/components/form/_group.scss +116 -0
- package/scss/components/form/_icon-picker.scss +113 -0
- package/scss/components/form/_icon-select.scss +245 -0
- package/scss/components/form/_image.scss +359 -0
- package/scss/components/form/_input-group.scss +213 -0
- package/scss/components/form/_input-table.scss +17 -0
- package/scss/components/form/_list.scss +225 -0
- package/scss/components/form/_location.scss +210 -0
- package/scss/components/form/_matrix.scss +7 -0
- package/scss/components/form/_nested-select.scss +149 -0
- package/scss/components/form/_number.scss +633 -0
- package/scss/components/form/_picker.scss +237 -0
- package/scss/components/form/_qr-code.scss +4 -0
- package/scss/components/form/_range.scss +438 -0
- package/scss/components/form/_rating.scss +94 -0
- package/scss/components/form/_repeat.scss +40 -0
- package/scss/components/form/_result-list.scss +98 -0
- package/scss/components/form/_rich-text.scss +163 -0
- package/scss/components/form/_select.scss +712 -0
- package/scss/components/form/_selection.scss +485 -0
- package/scss/components/form/_sub-form.scss +118 -0
- package/scss/components/form/_switch.scss +228 -0
- package/scss/components/form/_tag.scss +146 -0
- package/scss/components/form/_text.scss +508 -0
- package/scss/components/form/_textarea.scss +78 -0
- package/scss/components/form/_tinymce.scss +6 -0
- package/scss/components/form/_transfer.scss +624 -0
- package/scss/components/form/_tree-select.scss +47 -0
- package/scss/components/form/_tree.scss +458 -0
- package/scss/components/form/_user-select.scss +643 -0
- package/scss/components/react-datetime.scss +267 -0
- package/scss/helper/background/_background-color.md +131 -0
- package/scss/helper/background/_background-color.scss +214 -0
- package/scss/helper/border/_border-color.md +109 -0
- package/scss/helper/border/_border-color.scss +178 -0
- package/scss/helper/border/_border-radius.md +86 -0
- package/scss/helper/border/_border-radius.scss +152 -0
- package/scss/helper/border/_border-style.md +11 -0
- package/scss/helper/border/_border-style.scss +40 -0
- package/scss/helper/border/_border-width.md +31 -0
- package/scss/helper/border/_border-width.scss +72 -0
- package/scss/helper/box-alignment/_align-content.md +12 -0
- package/scss/helper/box-alignment/_align-content.scss +44 -0
- package/scss/helper/box-alignment/_align-items.md +11 -0
- package/scss/helper/box-alignment/_align-items.scss +41 -0
- package/scss/helper/box-alignment/_align-self.md +11 -0
- package/scss/helper/box-alignment/_align-self.scss +40 -0
- package/scss/helper/box-alignment/_justify-content.md +12 -0
- package/scss/helper/box-alignment/_justify-content.scss +44 -0
- package/scss/helper/box-alignment/_justify-items.md +11 -0
- package/scss/helper/box-alignment/_justify-items.scss +40 -0
- package/scss/helper/box-alignment/_justify-self.md +11 -0
- package/scss/helper/box-alignment/_justify-self.scss +40 -0
- package/scss/helper/box-alignment/_place-content.md +13 -0
- package/scss/helper/box-alignment/_place-content.scss +48 -0
- package/scss/helper/box-alignment/_place-items.md +11 -0
- package/scss/helper/box-alignment/_place-items.scss +40 -0
- package/scss/helper/box-alignment/_place-self.md +11 -0
- package/scss/helper/box-alignment/_place-self.scss +40 -0
- package/scss/helper/effect/_box-shadow.md +16 -0
- package/scss/helper/effect/_box-shadow.scss +74 -0
- package/scss/helper/effect/_opacity.md +21 -0
- package/scss/helper/effect/_opacity.scss +66 -0
- package/scss/helper/flex/_direction.md +10 -0
- package/scss/helper/flex/_direction.scss +41 -0
- package/scss/helper/flex/_flex.md +10 -0
- package/scss/helper/flex/_flex.scss +38 -0
- package/scss/helper/flex/_grow.md +8 -0
- package/scss/helper/flex/_grow.scss +28 -0
- package/scss/helper/flex/_order.md +20 -0
- package/scss/helper/flex/_order.scss +56 -0
- package/scss/helper/flex/_shrink.md +8 -0
- package/scss/helper/flex/_shrink.scss +27 -0
- package/scss/helper/flex/_wrap.md +9 -0
- package/scss/helper/flex/_wrap.scss +36 -0
- package/scss/helper/grid/_auto-columns.md +10 -0
- package/scss/helper/grid/_auto-columns.scss +38 -0
- package/scss/helper/grid/_auto-flow.md +10 -0
- package/scss/helper/grid/_auto-flow.scss +38 -0
- package/scss/helper/grid/_auto-rows.md +10 -0
- package/scss/helper/grid/_auto-rows.scss +38 -0
- package/scss/helper/grid/_column-start-end.md +48 -0
- package/scss/helper/grid/_column-start-end.scss +201 -0
- package/scss/helper/grid/_columns.md +19 -0
- package/scss/helper/grid/_columns.scss +74 -0
- package/scss/helper/grid/_gap.md +117 -0
- package/scss/helper/grid/_gap.scss +154 -0
- package/scss/helper/grid/_row-start-end.md +48 -0
- package/scss/helper/grid/_row-start-end.scss +201 -0
- package/scss/helper/grid/_rows.md +13 -0
- package/scss/helper/grid/_rows.scss +50 -0
- package/scss/helper/layout/_box-sizing.md +35 -0
- package/scss/helper/layout/_box-sizing.scss +51 -0
- package/scss/helper/layout/_clear.md +27 -0
- package/scss/helper/layout/_clear.scss +56 -0
- package/scss/helper/layout/_display.md +41 -0
- package/scss/helper/layout/_display.scss +82 -0
- package/scss/helper/layout/_float.md +47 -0
- package/scss/helper/layout/_float.scss +71 -0
- package/scss/helper/layout/_overflow.md +34 -0
- package/scss/helper/layout/_overflow.scss +85 -0
- package/scss/helper/layout/_position.md +27 -0
- package/scss/helper/layout/_position.scss +55 -0
- package/scss/helper/layout/_top-right-bottom-left.md +150 -0
- package/scss/helper/layout/_top-right-bottom-left.scss +292 -0
- package/scss/helper/layout/_visibility.md +21 -0
- package/scss/helper/layout/_visibility.scss +42 -0
- package/scss/helper/layout/_z-index.md +37 -0
- package/scss/helper/layout/_z-index.scss +67 -0
- package/scss/helper/sizing/_height.md +103 -0
- package/scss/helper/sizing/_height.scss +161 -0
- package/scss/helper/sizing/_width.md +109 -0
- package/scss/helper/sizing/_width.scss +174 -0
- package/scss/helper/spacing/_margin.md +527 -0
- package/scss/helper/spacing/_margin.scss +821 -0
- package/scss/helper/spacing/_padding.md +265 -0
- package/scss/helper/spacing/_padding.scss +394 -0
- package/scss/helper/spacing/_space-between.md +155 -0
- package/scss/helper/spacing/_space-between.scss +224 -0
- package/scss/helper/typography/_font-family.md +9 -0
- package/scss/helper/typography/_font-family.scss +28 -0
- package/scss/helper/typography/_font-size.md +19 -0
- package/scss/helper/typography/_font-size.scss +40 -0
- package/scss/helper/typography/_font-style.md +8 -0
- package/scss/helper/typography/_font-style.scss +31 -0
- package/scss/helper/typography/_font-weight.md +15 -0
- package/scss/helper/typography/_font-weight.scss +49 -0
- package/scss/helper/typography/_letter-spacing.md +12 -0
- package/scss/helper/typography/_letter-spacing.scss +43 -0
- package/scss/helper/typography/_line-height.md +20 -0
- package/scss/helper/typography/_line-height.scss +59 -0
- package/scss/helper/typography/_list-style-type.md +11 -0
- package/scss/helper/typography/_list-style-type.scss +43 -0
- package/scss/helper/typography/_text-align.md +10 -0
- package/scss/helper/typography/_text-align.scss +34 -0
- package/scss/helper/typography/_text-color.md +110 -0
- package/scss/helper/typography/_text-color.scss +184 -0
- package/scss/helper/typography/_text-decoration.md +9 -0
- package/scss/helper/typography/_text-decoration.scss +34 -0
- package/scss/helper/typography/_text-overflow.md +9 -0
- package/scss/helper/typography/_text-overflow.scss +40 -0
- package/scss/helper/typography/_text-transform.md +10 -0
- package/scss/helper/typography/_text-transform.scss +40 -0
- package/scss/helper/typography/_vertical-align.md +12 -0
- package/scss/helper/typography/_vertical-align.scss +44 -0
- package/scss/helper/typography/_whitespace.md +11 -0
- package/scss/helper/typography/_whitespace.scss +42 -0
- package/scss/helper/typography/_word-break.md +9 -0
- package/scss/helper/typography/_word-break.scss +36 -0
- package/scss/helper.scss +72 -0
- package/scss/layout/_aside.scss +361 -0
- package/scss/layout/_grid.scss +173 -0
- package/scss/layout/_hbox.scss +127 -0
- package/scss/layout/_header.scss +0 -0
- package/scss/layout/_layout.scss +492 -0
- package/scss/layout/_vbox.scss +38 -0
- package/scss/themes/_ang-variables.scss +224 -0
- package/scss/themes/_antd-variables.scss +238 -0
- package/scss/themes/_common.scss +157 -0
- package/scss/themes/_cxd-variables.scss +222 -0
- package/scss/themes/_dark-variables.scss +229 -0
- package/scss/themes/ang-ie11.scss +1 -0
- package/scss/themes/ang.scss +27 -0
- package/scss/themes/antd-ie11.scss +1 -0
- package/scss/themes/antd.scss +5 -0
- package/scss/themes/cxd-ie11.scss +1 -0
- package/scss/themes/cxd.scss +5 -0
- package/scss/themes/dark-ie11.scss +1 -0
- package/scss/themes/dark.scss +34 -0
- package/scss/themes/default.scss +2 -0
- package/scss/themes/extract-antd-color.py +27 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-rev-ui v6.13.0
|
|
3
|
+
* Copyright 2018-2026 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { __extends, __spreadArray, __read, __assign, __decorate, __metadata } from 'tslib';
|
|
7
|
+
import React__default from 'react';
|
|
8
|
+
import { themeable, autobind, uncontrollable } from 'amis-rev-core';
|
|
9
|
+
import find from 'lodash/find';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @file AnchorNav
|
|
13
|
+
* @description 锚点导航
|
|
14
|
+
* @author hsm-lv
|
|
15
|
+
*/
|
|
16
|
+
var AnchorNavSectionComponent = /** @class */ (function (_super) {
|
|
17
|
+
__extends(AnchorNavSectionComponent, _super);
|
|
18
|
+
function AnchorNavSectionComponent() {
|
|
19
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
|
20
|
+
_this.contentRef = function (ref) { return (_this.contentDom = ref); };
|
|
21
|
+
return _this;
|
|
22
|
+
}
|
|
23
|
+
AnchorNavSectionComponent.prototype.render = function () {
|
|
24
|
+
var _a = this.props, cx = _a.classnames, children = _a.children, className = _a.className, name = _a.name;
|
|
25
|
+
return (React__default.createElement("div", { ref: this.contentRef, className: cx('AnchorNav-section', className), "data-id": name + '' }, children));
|
|
26
|
+
};
|
|
27
|
+
return AnchorNavSectionComponent;
|
|
28
|
+
}(React__default.PureComponent));
|
|
29
|
+
var AnchorNavSection = themeable(AnchorNavSectionComponent);
|
|
30
|
+
var AnchorNav = /** @class */ (function (_super) {
|
|
31
|
+
__extends(AnchorNav, _super);
|
|
32
|
+
function AnchorNav() {
|
|
33
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
|
34
|
+
// 滚动区域DOM
|
|
35
|
+
_this.contentDom = React__default.createRef();
|
|
36
|
+
_this.sections = [];
|
|
37
|
+
_this.fromSelect = false;
|
|
38
|
+
return _this;
|
|
39
|
+
}
|
|
40
|
+
AnchorNav.prototype.componentDidMount = function () {
|
|
41
|
+
var _this = this;
|
|
42
|
+
this.observer = new IntersectionObserver(this.scrollToNav);
|
|
43
|
+
this.sections.forEach(function (item) {
|
|
44
|
+
_this.observer.observe(item.element);
|
|
45
|
+
});
|
|
46
|
+
if (this.props.active) {
|
|
47
|
+
this.scrollToSection(this.props.active);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
AnchorNav.prototype.componentWillUnmount = function () {
|
|
51
|
+
this.observer.disconnect();
|
|
52
|
+
};
|
|
53
|
+
AnchorNav.prototype.scrollToNav = function (entries) {
|
|
54
|
+
var _this = this;
|
|
55
|
+
entries.forEach(function (entry) {
|
|
56
|
+
var key = entry.target.getAttribute('data-id');
|
|
57
|
+
var currentSection = _this.sections.find(function (item) { return item.key === key; });
|
|
58
|
+
if (currentSection) {
|
|
59
|
+
currentSection.isIntersecting = entry.isIntersecting;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
// 找到第一个可见的区域
|
|
63
|
+
var firstIntersectingSection = this.sections.find(function (item) { return item.isIntersecting; });
|
|
64
|
+
if (!this.fromSelect) {
|
|
65
|
+
firstIntersectingSection && this.fireSelect(firstIntersectingSection.key);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
// 滚动结束后,重置fromSelect状态
|
|
69
|
+
if (this.fromSelectTimer) {
|
|
70
|
+
clearTimeout(this.fromSelectTimer);
|
|
71
|
+
}
|
|
72
|
+
this.fromSelectTimer = setTimeout(function () {
|
|
73
|
+
_this.fromSelect = false;
|
|
74
|
+
}, 300);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
AnchorNav.prototype.scrollToSection = function (key) {
|
|
78
|
+
var _a, _b;
|
|
79
|
+
this.fromSelect = true;
|
|
80
|
+
var node = (_a = find(this.sections, function (item) { return item.key === key; })) === null || _a === void 0 ? void 0 : _a.element;
|
|
81
|
+
(_b = node === null || node === void 0 ? void 0 : node.scrollIntoView) === null || _b === void 0 ? void 0 : _b.call(node, { behavior: 'smooth' });
|
|
82
|
+
};
|
|
83
|
+
AnchorNav.prototype.handleSelect = function (key) {
|
|
84
|
+
this.scrollToSection(key);
|
|
85
|
+
this.fireSelect(key);
|
|
86
|
+
};
|
|
87
|
+
AnchorNav.prototype.fireSelect = function (key) {
|
|
88
|
+
var onSelect = this.props.onSelect;
|
|
89
|
+
onSelect && onSelect(key);
|
|
90
|
+
};
|
|
91
|
+
AnchorNav.prototype.renderLink = function (link, index) {
|
|
92
|
+
var _this = this;
|
|
93
|
+
var _a;
|
|
94
|
+
if (!link) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
var _b = this.props, cx = _b.classnames, activeProp = _b.active;
|
|
98
|
+
var _c = link.props, title = _c.title, name = _c.name;
|
|
99
|
+
var active = activeProp === undefined && index === 0 ? name : activeProp;
|
|
100
|
+
// 判断是否为子节点,子节点key为 <父节点索引>-<子节点索引>
|
|
101
|
+
var isChild = ((_a = link.key) === null || _a === void 0 ? void 0 : _a.split('-').length) >= 2;
|
|
102
|
+
return (React__default.createElement("li", { className: cx('AnchorNav-link', isChild ? 'AnchorNav-link-child' : '', String(active) === String(name) ? 'is-active' : ''), key: link.key, onClick: function () { return _this.handleSelect(name); } },
|
|
103
|
+
React__default.createElement("a", { title: title }, title)));
|
|
104
|
+
};
|
|
105
|
+
AnchorNav.prototype.renderSection = function (section, index) {
|
|
106
|
+
var _this = this;
|
|
107
|
+
if (!section) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
var _a = this.props, activeProp = _a.active, classnames = _a.classnames;
|
|
111
|
+
var name = section.props.name;
|
|
112
|
+
var key = section.key;
|
|
113
|
+
var active = activeProp === undefined && index === 0 ? name : activeProp;
|
|
114
|
+
return React__default.cloneElement(section, __assign(__assign({}, section.props), { key: key, classnames: classnames, active: active, ref: function (props) {
|
|
115
|
+
if (props && !_this.sections.find(function (item) { return item.key === name; })) {
|
|
116
|
+
// 收集每个段落的真实dom节点
|
|
117
|
+
_this.sections.push({ key: name, element: props.ref.contentDom });
|
|
118
|
+
}
|
|
119
|
+
} }));
|
|
120
|
+
};
|
|
121
|
+
AnchorNav.prototype.render = function () {
|
|
122
|
+
var _a;
|
|
123
|
+
var _this = this;
|
|
124
|
+
var _b = this.props, cx = _b.classnames, className = _b.className, style = _b.style, linkClassName = _b.linkClassName, sectionClassName = _b.sectionClassName, children = _b.children, direction = _b.direction;
|
|
125
|
+
if (!Array.isArray(children)) {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
return (React__default.createElement("div", { className: cx('AnchorNav', (_a = {},
|
|
129
|
+
_a["AnchorNav--".concat(direction)] = direction,
|
|
130
|
+
_a), className), style: style },
|
|
131
|
+
React__default.createElement("ul", { className: cx('AnchorNav-link-wrap', linkClassName), role: "anchorlist" }, children.map(function (link, index) { return _this.renderLink(link, index); })),
|
|
132
|
+
React__default.createElement("div", { className: cx('AnchorNav-section-wrap', sectionClassName), ref: this.contentDom }, children.map(function (section, index) {
|
|
133
|
+
return _this.renderSection(section, index);
|
|
134
|
+
}))));
|
|
135
|
+
};
|
|
136
|
+
AnchorNav.defaultProps = {
|
|
137
|
+
linkClassName: '',
|
|
138
|
+
sectionClassName: '',
|
|
139
|
+
direction: 'vertical'
|
|
140
|
+
};
|
|
141
|
+
__decorate([
|
|
142
|
+
autobind,
|
|
143
|
+
__metadata("design:type", Function),
|
|
144
|
+
__metadata("design:paramtypes", [Array]),
|
|
145
|
+
__metadata("design:returntype", void 0)
|
|
146
|
+
], AnchorNav.prototype, "scrollToNav", null);
|
|
147
|
+
return AnchorNav;
|
|
148
|
+
}(React__default.Component));
|
|
149
|
+
var ThemedAnchorNav = themeable(uncontrollable(AnchorNav, {
|
|
150
|
+
active: 'onSelect'
|
|
151
|
+
}));
|
|
152
|
+
|
|
153
|
+
export { AnchorNav, AnchorNavSection, ThemedAnchorNav as default };
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-rev-ui v6.13.0
|
|
3
|
+
* Copyright 2018-2026 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { __extends, __spreadArray, __read, __decorate, __metadata } from 'tslib';
|
|
7
|
+
import React__default from 'react';
|
|
8
|
+
import { guid, findDomCompat, autobind, themeable, localeable, uncontrollable } from 'amis-rev-core';
|
|
9
|
+
import InputBox from './InputBox.js';
|
|
10
|
+
import { Icon } from './icons.js';
|
|
11
|
+
import Button from './Button.js';
|
|
12
|
+
import Sortable from 'sortablejs';
|
|
13
|
+
|
|
14
|
+
var ArrayInput = /** @class */ (function (_super) {
|
|
15
|
+
__extends(ArrayInput, _super);
|
|
16
|
+
function ArrayInput() {
|
|
17
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
|
18
|
+
_this.id = guid();
|
|
19
|
+
return _this;
|
|
20
|
+
}
|
|
21
|
+
ArrayInput.prototype.handleItemOnChange = function (index, itemValue) {
|
|
22
|
+
var onChange = this.props.onChange;
|
|
23
|
+
var value = this.props.value;
|
|
24
|
+
var newValue = Array.isArray(value) ? value.concat() : [];
|
|
25
|
+
newValue.splice(index, 1, itemValue);
|
|
26
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
27
|
+
};
|
|
28
|
+
ArrayInput.prototype.dragTipRef = function (ref) {
|
|
29
|
+
if (!this.dragTip && ref) {
|
|
30
|
+
this.initDragging();
|
|
31
|
+
}
|
|
32
|
+
else if (this.dragTip && !ref) {
|
|
33
|
+
this.destroyDragging();
|
|
34
|
+
}
|
|
35
|
+
this.dragTip = ref;
|
|
36
|
+
};
|
|
37
|
+
ArrayInput.prototype.handleAdd = function () {
|
|
38
|
+
var _a = this.props, value = _a.value, onChange = _a.onChange, itemInitalValue = _a.itemInitalValue;
|
|
39
|
+
var newValue = Array.isArray(value) ? value.concat() : [];
|
|
40
|
+
newValue.push(itemInitalValue);
|
|
41
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
42
|
+
};
|
|
43
|
+
ArrayInput.prototype.handleRemove = function (e) {
|
|
44
|
+
var indx = parseInt(e.currentTarget.getAttribute('data-index'), 10);
|
|
45
|
+
var _a = this.props, value = _a.value, onChange = _a.onChange; _a.itemInitalValue;
|
|
46
|
+
var newValue = Array.isArray(value) ? value.concat() : [];
|
|
47
|
+
newValue.splice(indx, 1);
|
|
48
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
49
|
+
};
|
|
50
|
+
ArrayInput.prototype.initDragging = function () {
|
|
51
|
+
var _this = this;
|
|
52
|
+
var onChange = this.props.onChange;
|
|
53
|
+
var ns = this.props.classPrefix;
|
|
54
|
+
var dom = findDomCompat(this);
|
|
55
|
+
this.sortable = new Sortable(dom.querySelector(".drag-group"), {
|
|
56
|
+
group: "array-input-".concat(this.id),
|
|
57
|
+
animation: 150,
|
|
58
|
+
handle: ".drag-bar",
|
|
59
|
+
ghostClass: "".concat(ns, "ArrayInput-item--dragging"),
|
|
60
|
+
onEnd: function (e) {
|
|
61
|
+
// 没有移动
|
|
62
|
+
if (e.newIndex === e.oldIndex) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
// 换回来
|
|
66
|
+
var parent = e.to;
|
|
67
|
+
if (e.oldIndex < parent.childNodes.length - 1) {
|
|
68
|
+
parent.insertBefore(e.item, parent.childNodes[e.oldIndex > e.newIndex ? e.oldIndex + 1 : e.oldIndex]);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
parent.appendChild(e.item);
|
|
72
|
+
}
|
|
73
|
+
var value = _this.props.value;
|
|
74
|
+
if (!Array.isArray(value)) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
var newValue = value.concat();
|
|
78
|
+
newValue.splice(e.newIndex, 0, newValue.splice(e.oldIndex, 1)[0]);
|
|
79
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
ArrayInput.prototype.destroyDragging = function () {
|
|
84
|
+
this.sortable && this.sortable.destroy();
|
|
85
|
+
};
|
|
86
|
+
ArrayInput.prototype.renderItem = function (value, index, collection) {
|
|
87
|
+
var _a = this.props, itemRender = _a.itemRender, disabled = _a.disabled, cx = _a.classnames, sortable = _a.sortable, removable = _a.removable, minLength = _a.minLength;
|
|
88
|
+
return (React__default.createElement("div", { className: cx('ArrayInput-item'), key: index },
|
|
89
|
+
sortable && collection.length > 1 && !disabled ? (React__default.createElement("a", { className: cx('ArrayInput-itemDrager drag-bar') },
|
|
90
|
+
React__default.createElement(Icon, { icon: "drag-bar", className: "icon" }))) : null,
|
|
91
|
+
itemRender({
|
|
92
|
+
value: value,
|
|
93
|
+
onChange: this.handleItemOnChange.bind(this, index),
|
|
94
|
+
index: index,
|
|
95
|
+
disabled: disabled
|
|
96
|
+
}),
|
|
97
|
+
removable !== false &&
|
|
98
|
+
!disabled &&
|
|
99
|
+
(!minLength || collection.length > minLength) ? (React__default.createElement("a", { "data-index": index, className: cx('ArrayInput-itemRemove'), onClick: this.handleRemove },
|
|
100
|
+
React__default.createElement(Icon, { icon: "close", className: "icon" }))) : null));
|
|
101
|
+
};
|
|
102
|
+
ArrayInput.prototype.render = function () {
|
|
103
|
+
var _this = this;
|
|
104
|
+
var _a = this.props, cx = _a.classnames, value = _a.value, placeholder = _a.placeholder, __ = _a.translate, maxLength = _a.maxLength, sortable = _a.sortable, sortTip = _a.sortTip, disabled = _a.disabled;
|
|
105
|
+
return (React__default.createElement("div", { className: cx('ArrayInput') },
|
|
106
|
+
Array.isArray(value) && value.length ? (React__default.createElement("div", { className: cx('ArrayInput-items drag-group') }, value.map(function (item, index) { return _this.renderItem(item, index, value); }))) : (React__default.createElement("div", { className: cx('ArrayInput-placeholder') }, __(placeholder))),
|
|
107
|
+
React__default.createElement("div", { className: cx('ArrayInput-toolbar', sortable && Array.isArray(value) && value.length > 1
|
|
108
|
+
? 'ArrayInput-toolbar--dnd'
|
|
109
|
+
: '') },
|
|
110
|
+
!Array.isArray(value) || !maxLength || value.length < maxLength ? (React__default.createElement(Button, { className: cx('ArrayInput-addBtn'), onClick: this.handleAdd, level: "", disabled: disabled },
|
|
111
|
+
React__default.createElement(Icon, { icon: "plus", className: "icon" }),
|
|
112
|
+
React__default.createElement("span", null, __('add')))) : null,
|
|
113
|
+
sortable && Array.isArray(value) && value.length ? (React__default.createElement("span", { className: cx("ArrayInput-sortTip"), ref: this.dragTipRef }, Array.isArray(value) && value.length > 1 ? __(sortTip) : '')) : null)));
|
|
114
|
+
};
|
|
115
|
+
ArrayInput.defaultProps = {
|
|
116
|
+
placeholder: 'empty',
|
|
117
|
+
itemRender: function (_a) {
|
|
118
|
+
var value = _a.value, onChange = _a.onChange;
|
|
119
|
+
return React__default.createElement(InputBox, { value: value, onChange: onChange });
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
__decorate([
|
|
123
|
+
autobind,
|
|
124
|
+
__metadata("design:type", Function),
|
|
125
|
+
__metadata("design:paramtypes", [Object]),
|
|
126
|
+
__metadata("design:returntype", void 0)
|
|
127
|
+
], ArrayInput.prototype, "dragTipRef", null);
|
|
128
|
+
__decorate([
|
|
129
|
+
autobind,
|
|
130
|
+
__metadata("design:type", Function),
|
|
131
|
+
__metadata("design:paramtypes", []),
|
|
132
|
+
__metadata("design:returntype", void 0)
|
|
133
|
+
], ArrayInput.prototype, "handleAdd", null);
|
|
134
|
+
__decorate([
|
|
135
|
+
autobind,
|
|
136
|
+
__metadata("design:type", Function),
|
|
137
|
+
__metadata("design:paramtypes", [Object]),
|
|
138
|
+
__metadata("design:returntype", void 0)
|
|
139
|
+
], ArrayInput.prototype, "handleRemove", null);
|
|
140
|
+
return ArrayInput;
|
|
141
|
+
}(React__default.Component));
|
|
142
|
+
var ArrayInput$1 = themeable(localeable(uncontrollable(ArrayInput, {
|
|
143
|
+
value: 'onChange'
|
|
144
|
+
})));
|
|
145
|
+
|
|
146
|
+
export { ArrayInput, ArrayInput$1 as default };
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-rev-ui v6.13.0
|
|
3
|
+
* Copyright 2018-2026 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { __extends, __assign, __rest } from 'tslib';
|
|
7
|
+
import React__default from 'react';
|
|
8
|
+
import { mapTree, themeable } from 'amis-rev-core';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @file AsideNav
|
|
12
|
+
* @description 左侧导航。
|
|
13
|
+
* @author fex
|
|
14
|
+
*/
|
|
15
|
+
var AsideNav = /** @class */ (function (_super) {
|
|
16
|
+
__extends(AsideNav, _super);
|
|
17
|
+
function AsideNav(props) {
|
|
18
|
+
var _this = _super.call(this, props) || this;
|
|
19
|
+
var isOpen = props.isOpen;
|
|
20
|
+
var id = 1;
|
|
21
|
+
_this.state = {
|
|
22
|
+
navigations: mapTree(props.navigations, function (item) {
|
|
23
|
+
var isActive = typeof item.active === 'undefined'
|
|
24
|
+
? props.isActive(item)
|
|
25
|
+
: item.active;
|
|
26
|
+
return __assign(__assign({}, item), { id: id++, active: isActive, open: isActive || isOpen(item) });
|
|
27
|
+
}, 1, true)
|
|
28
|
+
};
|
|
29
|
+
_this.renderLink = _this.renderLink.bind(_this);
|
|
30
|
+
_this.toggleExpand = _this.toggleExpand.bind(_this);
|
|
31
|
+
return _this;
|
|
32
|
+
}
|
|
33
|
+
AsideNav.prototype.componentDidUpdate = function (prevProps) {
|
|
34
|
+
var props = this.props;
|
|
35
|
+
var isOpen = prevProps.isOpen;
|
|
36
|
+
if (prevProps.navigations !== props.navigations ||
|
|
37
|
+
prevProps.isActive !== props.isActive) {
|
|
38
|
+
var id_1 = 1;
|
|
39
|
+
this.setState({
|
|
40
|
+
navigations: mapTree(props.navigations, function (item) {
|
|
41
|
+
var isActive = typeof item.active === 'undefined'
|
|
42
|
+
? props.isActive(item)
|
|
43
|
+
: item.active;
|
|
44
|
+
return __assign(__assign({}, item), { id: id_1++, active: isActive, open: isActive || isOpen(item) });
|
|
45
|
+
}, 1, true)
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
AsideNav.prototype.toggleExpand = function (link, e) {
|
|
50
|
+
if (e) {
|
|
51
|
+
e.stopPropagation();
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
}
|
|
54
|
+
this.setState({
|
|
55
|
+
navigations: mapTree(this.state.navigations, function (item) { return (__assign(__assign({}, item), { open: link.id === item.id ? !item.open : item.open })); }, 1, true)
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
AsideNav.prototype.renderLink = function (link, key, props, depth) {
|
|
59
|
+
var _a;
|
|
60
|
+
if (props === void 0) { props = {}; }
|
|
61
|
+
if (depth === void 0) { depth = 1; }
|
|
62
|
+
var _b = this.props, renderLink = _b.renderLink; _b.isActive; var renderSubLinks = _b.renderSubLinks, cx = _b.classnames, others = __rest(_b, ["renderLink", "isActive", "renderSubLinks", "classnames"]);
|
|
63
|
+
var dom = renderLink(__assign({ link: link, active: link.active, open: link.open, toggleExpand: this.toggleExpand, depth: depth, classnames: cx, subHeader: key === 'subHeader' }, others));
|
|
64
|
+
if (!dom) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
else if (key === 'subHeader') {
|
|
68
|
+
return React__default.cloneElement(dom, {
|
|
69
|
+
key: key
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return (React__default.createElement("li", __assign({}, props, { key: key, className: cx("AsideNav-item", link.className, (_a = {},
|
|
73
|
+
_a["is-open"] = link.open,
|
|
74
|
+
_a["is-active"] = link.active,
|
|
75
|
+
_a)) }),
|
|
76
|
+
dom,
|
|
77
|
+
renderSubLinks(link, this.renderLink, depth, this.props)));
|
|
78
|
+
};
|
|
79
|
+
AsideNav.prototype.render = function () {
|
|
80
|
+
var _this = this;
|
|
81
|
+
var navigations = this.state.navigations;
|
|
82
|
+
var links = [];
|
|
83
|
+
var _a = this.props, className = _a.className, cx = _a.classnames;
|
|
84
|
+
navigations.forEach(function (navigation, index) {
|
|
85
|
+
if (!Array.isArray(navigation.children)) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (navigation.prefix) {
|
|
89
|
+
var prefix = typeof navigation.prefix === 'function'
|
|
90
|
+
? navigation.prefix(_this.props)
|
|
91
|
+
: navigation.prefix;
|
|
92
|
+
links.push(React__default.cloneElement(prefix, __assign(__assign({}, prefix.props), { key: "".concat(index, "-prefix") })));
|
|
93
|
+
}
|
|
94
|
+
navigation.label &&
|
|
95
|
+
links.push(React__default.createElement("li", { key: "".concat(index, "-label"), className: cx("AsideNav-label", navigation.className) },
|
|
96
|
+
React__default.createElement("span", null, navigation.label)));
|
|
97
|
+
navigation.children.forEach(function (item, key) {
|
|
98
|
+
var link = _this.renderLink(item, "".concat(index, "-").concat(key));
|
|
99
|
+
link && links.push(link);
|
|
100
|
+
});
|
|
101
|
+
if (navigation.affix) {
|
|
102
|
+
var affix = typeof navigation.affix === 'function'
|
|
103
|
+
? navigation.affix(_this.props)
|
|
104
|
+
: navigation.affix;
|
|
105
|
+
links.push(React__default.cloneElement(affix, __assign(__assign({}, affix.props), { key: "".concat(index, "-affix") })));
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
return (React__default.createElement("nav", { className: cx("AsideNav", className) },
|
|
109
|
+
React__default.createElement("ul", { className: cx("AsideNav-list") }, links)));
|
|
110
|
+
};
|
|
111
|
+
AsideNav.defaultProps = {
|
|
112
|
+
renderLink: function (item) {
|
|
113
|
+
var _a;
|
|
114
|
+
return (React__default.createElement("a", __assign({}, (_a = item.testIdBuilder) === null || _a === void 0 ? void 0 : _a.getTestId()), item.label));
|
|
115
|
+
},
|
|
116
|
+
renderSubLinks: function (link, renderLink, depth, _a) {
|
|
117
|
+
var cx = _a.classnames;
|
|
118
|
+
return link.children && link.children.length ? (React__default.createElement("ul", { className: cx('AsideNav-subList') },
|
|
119
|
+
link.label ? (React__default.createElement("li", { key: "subHeader", className: cx('AsideNav-subHeader') }, renderLink(__assign(__assign({}, link), { children: undefined }), 'subHeader', {}, depth))) : null,
|
|
120
|
+
link.children.map(function (link, key) {
|
|
121
|
+
return renderLink(link, key, {}, depth + 1);
|
|
122
|
+
}))) : link.label && depth === 1 ? (React__default.createElement("div", { className: cx('AsideNav-tooltip') }, link.label)) : null;
|
|
123
|
+
},
|
|
124
|
+
isActive: function (link) { return link.open; },
|
|
125
|
+
isOpen: function (item) {
|
|
126
|
+
return item.children ? item.children.some(function (item) { return item.open; }) : false;
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
return AsideNav;
|
|
130
|
+
}(React__default.Component));
|
|
131
|
+
var AsideNav$1 = themeable(AsideNav);
|
|
132
|
+
|
|
133
|
+
export { AsideNav, AsideNav$1 as default };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-rev-ui v6.13.0
|
|
3
|
+
* Copyright 2018-2026 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { __extends, __spreadArray, __read, __decorate, __metadata } from 'tslib';
|
|
7
|
+
import React__default from 'react';
|
|
8
|
+
import { BaseSelection } from './Selection.js';
|
|
9
|
+
import { autobind, themeable, localeable, uncontrollable } from 'amis-rev-core';
|
|
10
|
+
import GroupedSelection from './GroupedSelection.js';
|
|
11
|
+
import TableCheckboxes from './TableSelection.js';
|
|
12
|
+
import ChainedCheckboxes from './ChainedSelection.js';
|
|
13
|
+
import { Icon } from './icons.js';
|
|
14
|
+
import Tree from './Tree.js';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 关联多选框,仅支持两层关联选择。
|
|
18
|
+
* 左边先点选,然后右边再次点选。
|
|
19
|
+
* 可以满足,先从 tree 中选中一个元素,然后查出来一个列表再次勾选。
|
|
20
|
+
*/
|
|
21
|
+
var AssociatedSelection = /** @class */ (function (_super) {
|
|
22
|
+
__extends(AssociatedSelection, _super);
|
|
23
|
+
function AssociatedSelection() {
|
|
24
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
|
25
|
+
_this.state = {
|
|
26
|
+
leftValue: _this.props.leftDefaultValue
|
|
27
|
+
};
|
|
28
|
+
return _this;
|
|
29
|
+
}
|
|
30
|
+
AssociatedSelection.prototype.componentDidMount = function () {
|
|
31
|
+
var leftValue = this.state.leftValue;
|
|
32
|
+
var _a = this.props, options = _a.options, onDeferLoad = _a.onDeferLoad, _b = _a.deferField, deferField = _b === void 0 ? 'defer' : _b;
|
|
33
|
+
if (leftValue) {
|
|
34
|
+
var selectdOption = BaseSelection.resolveSelected(leftValue, options, function (option) { return option.ref; });
|
|
35
|
+
if (selectdOption && onDeferLoad && selectdOption[deferField]) {
|
|
36
|
+
onDeferLoad(selectdOption);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
AssociatedSelection.prototype.leftOption2Value = function (option) {
|
|
41
|
+
return option.value;
|
|
42
|
+
};
|
|
43
|
+
AssociatedSelection.prototype.handleLeftSelect = function (value) {
|
|
44
|
+
var _a = this.props, options = _a.options, onDeferLoad = _a.onDeferLoad, _b = _a.deferField, deferField = _b === void 0 ? 'defer' : _b;
|
|
45
|
+
this.setState({ leftValue: value });
|
|
46
|
+
var selectdOption = BaseSelection.resolveSelected(value, options, function (option) { return option.ref; });
|
|
47
|
+
if (selectdOption && onDeferLoad && selectdOption[deferField]) {
|
|
48
|
+
onDeferLoad(selectdOption);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
AssociatedSelection.prototype.handleLeftDeferLoad = function (option) {
|
|
52
|
+
var _a = this.props, leftOptions = _a.leftOptions, onLeftDeferLoad = _a.onLeftDeferLoad, onDeferLoad = _a.onDeferLoad;
|
|
53
|
+
if (typeof onLeftDeferLoad === 'function') {
|
|
54
|
+
// TabsTransfer
|
|
55
|
+
return onLeftDeferLoad === null || onLeftDeferLoad === void 0 ? void 0 : onLeftDeferLoad(option, leftOptions);
|
|
56
|
+
}
|
|
57
|
+
else if (typeof onDeferLoad === 'function') {
|
|
58
|
+
// Select
|
|
59
|
+
return onDeferLoad === null || onDeferLoad === void 0 ? void 0 : onDeferLoad(option);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
AssociatedSelection.prototype.handleRetry = function (option) {
|
|
63
|
+
var onDeferLoad = this.props.onDeferLoad;
|
|
64
|
+
onDeferLoad === null || onDeferLoad === void 0 ? void 0 : onDeferLoad(option);
|
|
65
|
+
};
|
|
66
|
+
AssociatedSelection.prototype.render = function () {
|
|
67
|
+
var _a = this.props, cx = _a.classnames, className = _a.className, leftOptions = _a.leftOptions, options = _a.options, option2value = _a.option2value, rightMode = _a.rightMode, onChange = _a.onChange, columns = _a.columns, value = _a.value, disabled = _a.disabled, leftMode = _a.leftMode, cellRender = _a.cellRender, multiple = _a.multiple, itemRender = _a.itemRender, labelField = _a.labelField, virtualThreshold = _a.virtualThreshold, itemHeight = _a.itemHeight, loadingConfig = _a.loadingConfig, checkAll = _a.checkAll, checkAllLabel = _a.checkAllLabel, _b = _a.deferField, deferField = _b === void 0 ? 'defer' : _b, testIdBuilder = _a.testIdBuilder;
|
|
68
|
+
var selectdOption = BaseSelection.resolveSelected(this.state.leftValue, options, function (option) { return option.ref; });
|
|
69
|
+
var __ = this.props.translate;
|
|
70
|
+
return (React__default.createElement("div", { className: cx('AssociatedSelection', className) },
|
|
71
|
+
React__default.createElement("div", { className: cx('AssociatedSelection-left') }, leftMode === 'tree' ? (React__default.createElement(Tree, { multiple: false, disabled: disabled, value: this.state.leftValue, options: leftOptions, onChange: this.handleLeftSelect, onDeferLoad: this.handleLeftDeferLoad, virtualThreshold: virtualThreshold,
|
|
72
|
+
// itemHeight={itemHeight}
|
|
73
|
+
loadingConfig: loadingConfig, testIdBuilder: testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('left-selection') })) : (React__default.createElement(GroupedSelection, { option2value: this.leftOption2Value, options: leftOptions, value: this.state.leftValue, disabled: disabled, onChange: this.handleLeftSelect, multiple: false, clearable: false, virtualThreshold: virtualThreshold, itemHeight: itemHeight, testIdBuilder: testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('left-selection') }))),
|
|
74
|
+
React__default.createElement("div", { className: cx('AssociatedSelection-right') }, this.state.leftValue ? (selectdOption ? (selectdOption[deferField] && !selectdOption.loaded ? (React__default.createElement("div", { className: cx('AssociatedSelection-box') },
|
|
75
|
+
React__default.createElement("div", { className: cx('AssociatedSelection-reload', selectdOption.loading ? 'is-spin' : 'is-clickable'), onClick: selectdOption.loading
|
|
76
|
+
? undefined
|
|
77
|
+
: this.handleRetry.bind(this, selectdOption) },
|
|
78
|
+
React__default.createElement(Icon, { icon: "reload", className: "icon" })),
|
|
79
|
+
selectdOption.loading ? (React__default.createElement("p", null, __('loading'))) : (React__default.createElement("p", null, __('Transfer.refreshIcon'))))) : rightMode === 'table' ? (React__default.createElement(TableCheckboxes, { columns: columns, value: value, disabled: disabled, options: selectdOption.children || [], onChange: onChange, option2value: option2value, cellRender: cellRender, multiple: multiple, virtualThreshold: virtualThreshold, itemHeight: itemHeight, testIdBuilder: testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('right-selection') })) : rightMode === 'tree' ? (React__default.createElement(Tree, { value: value, disabled: disabled, options: selectdOption.children || [], onChange: onChange, multiple: multiple, labelField: labelField, virtualThreshold: virtualThreshold,
|
|
80
|
+
// itemHeight={itemHeight}
|
|
81
|
+
loadingConfig: loadingConfig, checkAllLabel: checkAllLabel, checkAll: checkAll, testIdBuilder: testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('right-selection') })) : rightMode === 'chained' ? (React__default.createElement(ChainedCheckboxes, { value: value, disabled: disabled, options: selectdOption.children || [], onChange: onChange, option2value: option2value, multiple: multiple, itemRender: itemRender, labelField: labelField, virtualThreshold: virtualThreshold, itemHeight: itemHeight, loadingConfig: loadingConfig, checkAllLabel: checkAllLabel, checkAll: checkAll, testIdBuilder: testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('right-selection') })) : (React__default.createElement(GroupedSelection, { value: value, disabled: disabled, options: selectdOption.children || [], onChange: onChange, option2value: option2value, multiple: multiple, itemRender: itemRender, labelField: labelField, virtualThreshold: virtualThreshold, itemHeight: itemHeight, checkAllLabel: checkAllLabel, checkAll: checkAll, testIdBuilder: testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('right-selection') }))) : (React__default.createElement("div", { className: cx('AssociatedSelection-box') }, __('Transfer.configError')))) : (React__default.createElement("div", { className: cx('AssociatedSelection-box') }, __('Transfer.selectFromLeft'))))));
|
|
82
|
+
};
|
|
83
|
+
__decorate([
|
|
84
|
+
autobind,
|
|
85
|
+
__metadata("design:type", Function),
|
|
86
|
+
__metadata("design:paramtypes", [Object]),
|
|
87
|
+
__metadata("design:returntype", void 0)
|
|
88
|
+
], AssociatedSelection.prototype, "leftOption2Value", null);
|
|
89
|
+
__decorate([
|
|
90
|
+
autobind,
|
|
91
|
+
__metadata("design:type", Function),
|
|
92
|
+
__metadata("design:paramtypes", [Object]),
|
|
93
|
+
__metadata("design:returntype", void 0)
|
|
94
|
+
], AssociatedSelection.prototype, "handleLeftSelect", null);
|
|
95
|
+
__decorate([
|
|
96
|
+
autobind,
|
|
97
|
+
__metadata("design:type", Function),
|
|
98
|
+
__metadata("design:paramtypes", [Object]),
|
|
99
|
+
__metadata("design:returntype", void 0)
|
|
100
|
+
], AssociatedSelection.prototype, "handleLeftDeferLoad", null);
|
|
101
|
+
return AssociatedSelection;
|
|
102
|
+
}(BaseSelection));
|
|
103
|
+
var AssociatedCheckboxes = themeable(localeable(uncontrollable(AssociatedSelection, {
|
|
104
|
+
value: 'onChange'
|
|
105
|
+
})));
|
|
106
|
+
|
|
107
|
+
export { AssociatedSelection, AssociatedCheckboxes as default };
|