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,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-rev-ui v6.13.0
|
|
3
|
+
* Copyright 2018-2026 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { __extends } from 'tslib';
|
|
7
|
+
import React__default from 'react';
|
|
8
|
+
import { themeable } from 'amis-rev-core';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @file TitleBar。
|
|
12
|
+
* @description
|
|
13
|
+
* @author fex
|
|
14
|
+
* @param 参数说明:
|
|
15
|
+
* title 标题内容
|
|
16
|
+
* titleClassName 标题类名,默认为 bg-light lter b-b
|
|
17
|
+
* right 可以传入右侧节点, 当有右侧时自动采用 hbox 来左右布局。
|
|
18
|
+
*/
|
|
19
|
+
var TitleBar = /** @class */ (function (_super) {
|
|
20
|
+
__extends(TitleBar, _super);
|
|
21
|
+
function TitleBar() {
|
|
22
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
23
|
+
}
|
|
24
|
+
TitleBar.prototype.render = function () {
|
|
25
|
+
var _a = this.props, className = _a.className, title = _a.title, titleClassName = _a.titleClassName, right = _a.right, cx = _a.classnames;
|
|
26
|
+
var left = title ? React__default.createElement("div", { className: titleClassName }, title) : null;
|
|
27
|
+
var body = left;
|
|
28
|
+
if (right) {
|
|
29
|
+
body = (React__default.createElement("div", { className: "hbox hbox-auto-xs h-auto" },
|
|
30
|
+
React__default.createElement("div", { className: "col bg-light b-b wrapper" }, left),
|
|
31
|
+
React__default.createElement("div", { className: "col v-middle padder-md text-right bg-light b-b wrapper-sm" }, right)));
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
body = React__default.createElement("div", { className: "wrapper" }, left);
|
|
35
|
+
}
|
|
36
|
+
return React__default.createElement("div", { className: cx(className, 'TitleBar') }, body);
|
|
37
|
+
};
|
|
38
|
+
TitleBar.defaultProps = {
|
|
39
|
+
className: 'bg-light lter b-b',
|
|
40
|
+
title: '标题',
|
|
41
|
+
titleClassName: 'm-n font-thin h3',
|
|
42
|
+
right: false
|
|
43
|
+
};
|
|
44
|
+
return TitleBar;
|
|
45
|
+
}(React__default.PureComponent));
|
|
46
|
+
var TitleBar$1 = themeable(TitleBar);
|
|
47
|
+
|
|
48
|
+
export { TitleBar, TitleBar$1 as default };
|
|
@@ -0,0 +1,247 @@
|
|
|
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 Transition, { ENTERING, ENTERED, EXITING } from 'react-transition-group/Transition';
|
|
8
|
+
import React__default from 'react';
|
|
9
|
+
import Html from './Html.js';
|
|
10
|
+
import { guid, autobind, themeable, localeable, noop } from 'amis-rev-core';
|
|
11
|
+
import { Icon } from './icons.js';
|
|
12
|
+
import groupBy from 'lodash/groupBy';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @file Toast
|
|
16
|
+
* @description toast提示组件, 单例模式,App级别只需要一个ToastComponent,引入了多个会兼容,也只有第一个生效
|
|
17
|
+
* @author fex
|
|
18
|
+
*/
|
|
19
|
+
var _a;
|
|
20
|
+
var fadeStyles = (_a = {},
|
|
21
|
+
_a[ENTERING] = 'in',
|
|
22
|
+
_a[ENTERED] = 'in',
|
|
23
|
+
_a[EXITING] = 'out',
|
|
24
|
+
_a);
|
|
25
|
+
var toastRef = null;
|
|
26
|
+
var show = function (content, conf, method) {
|
|
27
|
+
if (conf === void 0) { conf = {}; }
|
|
28
|
+
if (!toastRef || !toastRef[method]) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
toastRef[method](content, __assign({}, conf));
|
|
32
|
+
};
|
|
33
|
+
var ToastComponent = /** @class */ (function (_super) {
|
|
34
|
+
__extends(ToastComponent, _super);
|
|
35
|
+
function ToastComponent() {
|
|
36
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
|
37
|
+
// 当前ToastComponent是否真正render了
|
|
38
|
+
_this.hasRendered = false;
|
|
39
|
+
_this.state = {
|
|
40
|
+
items: []
|
|
41
|
+
};
|
|
42
|
+
return _this;
|
|
43
|
+
}
|
|
44
|
+
ToastComponent.prototype.componentDidMount = function () {
|
|
45
|
+
this.hasRendered = true;
|
|
46
|
+
toastRef = this;
|
|
47
|
+
};
|
|
48
|
+
ToastComponent.prototype.componentWillUnmount = function () {
|
|
49
|
+
if (this.hasRendered) {
|
|
50
|
+
toastRef = null;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
ToastComponent.prototype.notifiy = function (level, content, config) {
|
|
54
|
+
var mobileUI = config.mobileUI || this.props.mobileUI;
|
|
55
|
+
this.setState(function (state) {
|
|
56
|
+
var items = state.items.concat();
|
|
57
|
+
if (mobileUI) {
|
|
58
|
+
// 移动端只能存在一个
|
|
59
|
+
items = [];
|
|
60
|
+
}
|
|
61
|
+
items.push(__assign(__assign({ body: content, level: level }, config), { id: guid(), className: config.className || '', position: config.position || (mobileUI ? 'center' : config.position), timeout: config.timeout || (mobileUI ? 3000 : undefined) }));
|
|
62
|
+
return {
|
|
63
|
+
items: items,
|
|
64
|
+
mobileUI: mobileUI
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
ToastComponent.prototype.success = function (content, config) {
|
|
69
|
+
this.notifiy('success', content, config);
|
|
70
|
+
};
|
|
71
|
+
ToastComponent.prototype.error = function (content, config) {
|
|
72
|
+
this.notifiy('error', content, config);
|
|
73
|
+
};
|
|
74
|
+
ToastComponent.prototype.info = function (content, config) {
|
|
75
|
+
this.notifiy('info', content, config);
|
|
76
|
+
};
|
|
77
|
+
ToastComponent.prototype.warning = function (content, config) {
|
|
78
|
+
this.notifiy('warning', content, config);
|
|
79
|
+
};
|
|
80
|
+
ToastComponent.prototype.handleDismissed = function (index) {
|
|
81
|
+
var _a;
|
|
82
|
+
var items = this.state.items.concat();
|
|
83
|
+
var _b = __read(items.splice(index, 1), 1), item = _b[0];
|
|
84
|
+
(_a = item === null || item === void 0 ? void 0 : item.onDissmiss) === null || _a === void 0 ? void 0 : _a.call(item);
|
|
85
|
+
this.setState({
|
|
86
|
+
items: items
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
ToastComponent.prototype.render = function () {
|
|
90
|
+
var _this = this;
|
|
91
|
+
if (toastRef && !this.hasRendered) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
var _a = this.props, cx = _a.classnames, className = _a.className, timeout = _a.timeout, errorTimeout = _a.errorTimeout, position = _a.position, showIcon = _a.showIcon, translate = _a.translate, closeButton = _a.closeButton;
|
|
95
|
+
var items = this.state.items;
|
|
96
|
+
var mobileUI = this.state.mobileUI || this.props.mobileUI;
|
|
97
|
+
var groupedItems = groupBy(items, function (item) { return item.position || position; });
|
|
98
|
+
return Object.keys(groupedItems).map(function (position) {
|
|
99
|
+
var toasts = groupedItems[position];
|
|
100
|
+
return (React__default.createElement("div", { key: position, className: cx("Toast-wrap Toast-wrap--".concat(position.replace(/\-(\w)/g, function (_, l) {
|
|
101
|
+
return l.toUpperCase();
|
|
102
|
+
})), {
|
|
103
|
+
'Toast-mobile': mobileUI
|
|
104
|
+
}, className) }, toasts.map(function (item, index) {
|
|
105
|
+
var _a, _b, _c;
|
|
106
|
+
var level = item.level || 'info';
|
|
107
|
+
var toastTimeout = (_a = item.timeout) !== null && _a !== void 0 ? _a : (level === 'error' ? errorTimeout : timeout);
|
|
108
|
+
return (React__default.createElement(ToastMessage, { classnames: cx, key: item.id || index, title: item.title, body: item.body, level: level, className: item.className, timeout: toastTimeout, closeButton: !mobileUI && ((_b = item.closeButton) !== null && _b !== void 0 ? _b : closeButton), onDismiss: _this.handleDismissed.bind(_this, items.indexOf(item)), translate: translate, showIcon: (_c = item.showIcon) !== null && _c !== void 0 ? _c : showIcon, mobileUI: mobileUI }));
|
|
109
|
+
})));
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
ToastComponent.defaultProps = {
|
|
113
|
+
position: 'top-center',
|
|
114
|
+
closeButton: false,
|
|
115
|
+
timeout: 4000,
|
|
116
|
+
errorTimeout: 6000, // 错误的时候 time 调长
|
|
117
|
+
items: []
|
|
118
|
+
};
|
|
119
|
+
ToastComponent.themeKey = 'toast';
|
|
120
|
+
__decorate([
|
|
121
|
+
autobind,
|
|
122
|
+
__metadata("design:type", Function),
|
|
123
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
124
|
+
__metadata("design:returntype", void 0)
|
|
125
|
+
], ToastComponent.prototype, "success", null);
|
|
126
|
+
__decorate([
|
|
127
|
+
autobind,
|
|
128
|
+
__metadata("design:type", Function),
|
|
129
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
130
|
+
__metadata("design:returntype", void 0)
|
|
131
|
+
], ToastComponent.prototype, "error", null);
|
|
132
|
+
__decorate([
|
|
133
|
+
autobind,
|
|
134
|
+
__metadata("design:type", Function),
|
|
135
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
136
|
+
__metadata("design:returntype", void 0)
|
|
137
|
+
], ToastComponent.prototype, "info", null);
|
|
138
|
+
__decorate([
|
|
139
|
+
autobind,
|
|
140
|
+
__metadata("design:type", Function),
|
|
141
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
142
|
+
__metadata("design:returntype", void 0)
|
|
143
|
+
], ToastComponent.prototype, "warning", null);
|
|
144
|
+
return ToastComponent;
|
|
145
|
+
}(React__default.Component));
|
|
146
|
+
var Toast = themeable(localeable(ToastComponent));
|
|
147
|
+
var ToastMessage = /** @class */ (function (_super) {
|
|
148
|
+
__extends(ToastMessage, _super);
|
|
149
|
+
function ToastMessage() {
|
|
150
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
|
151
|
+
_this.state = {
|
|
152
|
+
visible: false
|
|
153
|
+
};
|
|
154
|
+
_this.mounted = false;
|
|
155
|
+
return _this;
|
|
156
|
+
}
|
|
157
|
+
ToastMessage.prototype.componentDidMount = function () {
|
|
158
|
+
this.mounted = true;
|
|
159
|
+
this.setState({
|
|
160
|
+
visible: true
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
ToastMessage.prototype.componentWillUnmount = function () {
|
|
164
|
+
clearTimeout(this.timer);
|
|
165
|
+
this.mounted = false;
|
|
166
|
+
};
|
|
167
|
+
ToastMessage.prototype.handleMouseEnter = function () {
|
|
168
|
+
clearTimeout(this.timer);
|
|
169
|
+
};
|
|
170
|
+
ToastMessage.prototype.handleMouseLeave = function () {
|
|
171
|
+
this.handleEntered();
|
|
172
|
+
};
|
|
173
|
+
ToastMessage.prototype.handleEntered = function () {
|
|
174
|
+
var timeout = this.props.timeout;
|
|
175
|
+
if (this.mounted && timeout) {
|
|
176
|
+
this.timer = setTimeout(this.close, timeout);
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
ToastMessage.prototype.close = function () {
|
|
180
|
+
clearTimeout(this.timer);
|
|
181
|
+
this.setState({
|
|
182
|
+
visible: false
|
|
183
|
+
});
|
|
184
|
+
};
|
|
185
|
+
ToastMessage.prototype.render = function () {
|
|
186
|
+
var _this = this;
|
|
187
|
+
var _a = this.props, onDismiss = _a.onDismiss, cx = _a.classnames, closeButton = _a.closeButton, title = _a.title, body = _a.body, allowHtml = _a.allowHtml, level = _a.level, showIcon = _a.showIcon, mobileUI = _a.mobileUI; _a.translate; var className = _a.className;
|
|
188
|
+
var iconName = mobileUI ? '' : 'alert-';
|
|
189
|
+
return (React__default.createElement(Transition, { mountOnEnter: true, unmountOnExit: true, in: this.state.visible, timeout: 750, onEntered: this.handleEntered, onExited: onDismiss }, function (status) {
|
|
190
|
+
var _a, _b, _c, _d;
|
|
191
|
+
return (React__default.createElement("div", { className: cx("Toast Toast--".concat(level), className, fadeStyles[status], {
|
|
192
|
+
'Toast-mobile--has-icon': mobileUI && showIcon !== false
|
|
193
|
+
}), onMouseEnter: _this.handleMouseEnter, onMouseLeave: _this.handleMouseLeave, onClick: closeButton ? noop : _this.close },
|
|
194
|
+
showIcon === false ? null : (React__default.createElement("div", { className: cx('Toast-icon') }, level === 'success' ? (React__default.createElement(Icon, { icon: iconName + 'success', className: "icon" })) : level == 'error' ? (React__default.createElement(Icon, { icon: iconName + 'fail', className: "icon" })) : level == 'info' ? (React__default.createElement(Icon, { icon: iconName + 'info', className: "icon" })) : level == 'warning' ? (React__default.createElement(Icon, { icon: iconName + 'warning', className: "icon" })) : null)),
|
|
195
|
+
React__default.createElement("div", { className: cx('Toast-content') },
|
|
196
|
+
typeof title === 'string' ? (React__default.createElement("span", { className: cx("Toast-title") }, title)) : React__default.isValidElement(title) ? (React__default.cloneElement(title, {
|
|
197
|
+
className: cx("Toast-title", (_b = (_a = title === null || title === void 0 ? void 0 : title.props) === null || _a === void 0 ? void 0 : _a.className) !== null && _b !== void 0 ? _b : '')
|
|
198
|
+
})) : null,
|
|
199
|
+
React__default.isValidElement(body) ? (React__default.cloneElement(body, {
|
|
200
|
+
className: cx("Toast-body", (_d = (_c = body === null || body === void 0 ? void 0 : body.props) === null || _c === void 0 ? void 0 : _c.className) !== null && _d !== void 0 ? _d : '')
|
|
201
|
+
})) : typeof body === 'string' || typeof body === 'object' ? (React__default.createElement("div", { className: cx('Toast-body') }, allowHtml ? (React__default.createElement(Html, { html: body === null || body === void 0 ? void 0 : body.toString() })) : (body === null || body === void 0 ? void 0 : body.toString()))) : null),
|
|
202
|
+
closeButton ? (React__default.createElement("a", { onClick: _this.close, className: cx("Toast-close") },
|
|
203
|
+
React__default.createElement(Icon, { icon: "status-close", className: "icon" }))) : null));
|
|
204
|
+
}));
|
|
205
|
+
};
|
|
206
|
+
ToastMessage.defaultProps = {
|
|
207
|
+
timeout: 5000,
|
|
208
|
+
classPrefix: '',
|
|
209
|
+
position: 'top-center',
|
|
210
|
+
allowHtml: true,
|
|
211
|
+
level: 'info'
|
|
212
|
+
};
|
|
213
|
+
__decorate([
|
|
214
|
+
autobind,
|
|
215
|
+
__metadata("design:type", Function),
|
|
216
|
+
__metadata("design:paramtypes", []),
|
|
217
|
+
__metadata("design:returntype", void 0)
|
|
218
|
+
], ToastMessage.prototype, "handleMouseEnter", null);
|
|
219
|
+
__decorate([
|
|
220
|
+
autobind,
|
|
221
|
+
__metadata("design:type", Function),
|
|
222
|
+
__metadata("design:paramtypes", []),
|
|
223
|
+
__metadata("design:returntype", void 0)
|
|
224
|
+
], ToastMessage.prototype, "handleMouseLeave", null);
|
|
225
|
+
__decorate([
|
|
226
|
+
autobind,
|
|
227
|
+
__metadata("design:type", Function),
|
|
228
|
+
__metadata("design:paramtypes", []),
|
|
229
|
+
__metadata("design:returntype", void 0)
|
|
230
|
+
], ToastMessage.prototype, "handleEntered", null);
|
|
231
|
+
__decorate([
|
|
232
|
+
autobind,
|
|
233
|
+
__metadata("design:type", Function),
|
|
234
|
+
__metadata("design:paramtypes", []),
|
|
235
|
+
__metadata("design:returntype", void 0)
|
|
236
|
+
], ToastMessage.prototype, "close", null);
|
|
237
|
+
return ToastMessage;
|
|
238
|
+
}(React__default.Component));
|
|
239
|
+
var toast = {
|
|
240
|
+
container: toastRef,
|
|
241
|
+
success: function (content, conf) { return show(content, conf, 'success'); },
|
|
242
|
+
error: function (content, conf) { return show(content, conf, 'error'); },
|
|
243
|
+
info: function (content, conf) { return show(content, conf, 'info'); },
|
|
244
|
+
warning: function (content, conf) { return show(content, conf, 'warning'); }
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
export { ToastComponent, ToastMessage, Toast as default, toast };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-rev-ui v6.13.0
|
|
3
|
+
* Copyright 2018-2026 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { __extends, __rest, __assign } from 'tslib';
|
|
7
|
+
import React__default from 'react';
|
|
8
|
+
import { themeable } from 'amis-rev-core';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @file Tooltip
|
|
12
|
+
* @description
|
|
13
|
+
* @author fex
|
|
14
|
+
*/
|
|
15
|
+
var Tooltip = /** @class */ (function (_super) {
|
|
16
|
+
__extends(Tooltip, _super);
|
|
17
|
+
function Tooltip() {
|
|
18
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
19
|
+
}
|
|
20
|
+
Tooltip.prototype.render = function () {
|
|
21
|
+
var _a = this.props; _a.classPrefix; var className = _a.className, tooltipTheme = _a.tooltipTheme, title = _a.title, children = _a.children, arrowProps = _a.arrowProps, style = _a.style; _a.placement; _a.arrowOffsetLeft; _a.arrowOffsetTop; _a.positionLeft; _a.positionTop; var cx = _a.classnames, activePlacement = _a.activePlacement, showArrow = _a.showArrow, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, arrowClassName = _a.arrowClassName, bodyClassName = _a.bodyClassName; _a.componentId; var rest = __rest(_a, ["classPrefix", "className", "tooltipTheme", "title", "children", "arrowProps", "style", "placement", "arrowOffsetLeft", "arrowOffsetTop", "positionLeft", "positionTop", "classnames", "activePlacement", "showArrow", "onMouseEnter", "onMouseLeave", "arrowClassName", "bodyClassName", "componentId"]);
|
|
22
|
+
return (React__default.createElement("div", __assign({}, rest, { className: cx("Tooltip", activePlacement ? "Tooltip--".concat(activePlacement) : '', className, "Tooltip--".concat(tooltipTheme === 'dark' ? 'dark' : 'light')), style: style, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, role: "tooltip" }),
|
|
23
|
+
showArrow ? (React__default.createElement("div", __assign({ className: cx(arrowClassName, 'Tooltip-arrow') }, arrowProps))) : null,
|
|
24
|
+
title ? React__default.createElement("div", { className: cx('Tooltip-title') }, title) : null,
|
|
25
|
+
React__default.createElement("div", { className: cx(bodyClassName, 'Tooltip-body') }, children)));
|
|
26
|
+
};
|
|
27
|
+
Tooltip.defaultProps = {
|
|
28
|
+
className: '',
|
|
29
|
+
tooltipTheme: 'light',
|
|
30
|
+
showArrow: true
|
|
31
|
+
};
|
|
32
|
+
return Tooltip;
|
|
33
|
+
}(React__default.Component));
|
|
34
|
+
var Tooltip$1 = themeable(Tooltip);
|
|
35
|
+
|
|
36
|
+
export { Tooltip, Tooltip$1 as default };
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-rev-ui v6.13.0
|
|
3
|
+
* Copyright 2018-2026 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { __extends, __assign } from 'tslib';
|
|
7
|
+
import React__default from 'react';
|
|
8
|
+
import Html from './Html.js';
|
|
9
|
+
import { findDomCompat, isObject, Overlay, themeable, uncontrollable } from 'amis-rev-core';
|
|
10
|
+
import Tooltip from './Tooltip.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @file TooltipWrapper
|
|
14
|
+
* @description
|
|
15
|
+
* @author fex
|
|
16
|
+
*/
|
|
17
|
+
var waitToHide = null;
|
|
18
|
+
var TooltipWrapper = /** @class */ (function (_super) {
|
|
19
|
+
__extends(TooltipWrapper, _super);
|
|
20
|
+
function TooltipWrapper(props) {
|
|
21
|
+
var _this = _super.call(this, props) || this;
|
|
22
|
+
_this.moutned = true;
|
|
23
|
+
_this.tooltipMouseEnter = function (e) {
|
|
24
|
+
var _a;
|
|
25
|
+
var tooltip = _this.props.tooltip;
|
|
26
|
+
var enterable = (_a = tooltip === null || tooltip === void 0 ? void 0 : tooltip.enterable) !== null && _a !== void 0 ? _a : true;
|
|
27
|
+
enterable && clearTimeout(_this.timer);
|
|
28
|
+
};
|
|
29
|
+
_this.tooltipMouseLeave = function (e) {
|
|
30
|
+
var _a;
|
|
31
|
+
var tooltip = _this.props.tooltip;
|
|
32
|
+
var enterable = (_a = tooltip === null || tooltip === void 0 ? void 0 : tooltip.enterable) !== null && _a !== void 0 ? _a : true;
|
|
33
|
+
enterable && clearTimeout(_this.timer);
|
|
34
|
+
_this.hide();
|
|
35
|
+
};
|
|
36
|
+
_this.getTarget = _this.getTarget.bind(_this);
|
|
37
|
+
_this.show = _this.show.bind(_this);
|
|
38
|
+
_this.hide = _this.hide.bind(_this);
|
|
39
|
+
_this.handleShow = _this.handleShow.bind(_this);
|
|
40
|
+
_this.handleHide = _this.handleHide.bind(_this);
|
|
41
|
+
_this.handleClick = _this.handleClick.bind(_this);
|
|
42
|
+
_this.handleFocus = _this.handleFocus.bind(_this);
|
|
43
|
+
_this.handleBlur = _this.handleBlur.bind(_this);
|
|
44
|
+
_this.handleMouseOver = _this.handleMouseOver.bind(_this);
|
|
45
|
+
_this.handleMouseOut = _this.handleMouseOut.bind(_this);
|
|
46
|
+
_this.state = {
|
|
47
|
+
show: false
|
|
48
|
+
};
|
|
49
|
+
return _this;
|
|
50
|
+
}
|
|
51
|
+
TooltipWrapper.prototype.componentWillUnmount = function () {
|
|
52
|
+
clearTimeout(this.timer);
|
|
53
|
+
this.moutned = false;
|
|
54
|
+
};
|
|
55
|
+
TooltipWrapper.prototype.getTarget = function () {
|
|
56
|
+
return findDomCompat(this);
|
|
57
|
+
};
|
|
58
|
+
TooltipWrapper.prototype.show = function () {
|
|
59
|
+
var _this = this;
|
|
60
|
+
this.setState({
|
|
61
|
+
show: true
|
|
62
|
+
}, function () {
|
|
63
|
+
if (_this.props.onVisibleChange) {
|
|
64
|
+
_this.props.onVisibleChange(true);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
TooltipWrapper.prototype.hide = function () {
|
|
69
|
+
var _this = this;
|
|
70
|
+
waitToHide = null;
|
|
71
|
+
this.moutned &&
|
|
72
|
+
this.setState({
|
|
73
|
+
show: false
|
|
74
|
+
}, function () {
|
|
75
|
+
if (_this.props.onVisibleChange) {
|
|
76
|
+
_this.props.onVisibleChange(false);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
TooltipWrapper.prototype.getChildProps = function () {
|
|
81
|
+
var child = React__default.Children.only(this.props.children);
|
|
82
|
+
return child && child.props;
|
|
83
|
+
};
|
|
84
|
+
TooltipWrapper.prototype.handleShow = function () {
|
|
85
|
+
this.timer && clearTimeout(this.timer);
|
|
86
|
+
waitToHide && waitToHide();
|
|
87
|
+
var tooltip = this.props.tooltip;
|
|
88
|
+
if (isObject(tooltip)) {
|
|
89
|
+
var _a = tooltip.mouseEnterDelay, mouseEnterDelay = _a === void 0 ? 0 : _a;
|
|
90
|
+
this.timer = setTimeout(this.show, mouseEnterDelay);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
this.timer = setTimeout(this.show, 0);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
TooltipWrapper.prototype.handleHide = function () {
|
|
97
|
+
clearTimeout(this.timer);
|
|
98
|
+
var _a = this.props, delay = _a.delay, tooltip = _a.tooltip;
|
|
99
|
+
waitToHide = this.hide.bind(this);
|
|
100
|
+
if (isObject(tooltip)) {
|
|
101
|
+
var _b = tooltip.mouseLeaveDelay, mouseLeaveDelay = _b === void 0 ? 300 : _b;
|
|
102
|
+
this.timer = setTimeout(this.hide, mouseLeaveDelay);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
this.timer = setTimeout(this.hide, delay);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
TooltipWrapper.prototype.handleFocus = function (e) {
|
|
109
|
+
var onFocus = this.getChildProps().onFocus;
|
|
110
|
+
this.handleShow();
|
|
111
|
+
onFocus && onFocus(e);
|
|
112
|
+
};
|
|
113
|
+
TooltipWrapper.prototype.handleBlur = function (e) {
|
|
114
|
+
var onBlur = this.getChildProps().onBlur;
|
|
115
|
+
this.handleHide();
|
|
116
|
+
onBlur && onBlur(e);
|
|
117
|
+
};
|
|
118
|
+
TooltipWrapper.prototype.handleMouseOver = function (e) {
|
|
119
|
+
this.handleMouseOverOut(this.handleShow, e, 'fromElement');
|
|
120
|
+
};
|
|
121
|
+
TooltipWrapper.prototype.handleMouseOut = function (e) {
|
|
122
|
+
this.handleMouseOverOut(this.handleHide, e, 'toElement');
|
|
123
|
+
};
|
|
124
|
+
TooltipWrapper.prototype.handleMouseOverOut = function (handler, e, relatedNative) {
|
|
125
|
+
var target = e.currentTarget;
|
|
126
|
+
var related = e.relatedTarget || e.nativeEvent[relatedNative];
|
|
127
|
+
if ((!related || related !== target) && !target.contains(related)) {
|
|
128
|
+
handler(e);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
TooltipWrapper.prototype.handleClick = function (e) {
|
|
132
|
+
var onClick = this.getChildProps().onClick;
|
|
133
|
+
this.state.show ? this.hide() : this.show();
|
|
134
|
+
onClick && onClick(e);
|
|
135
|
+
};
|
|
136
|
+
TooltipWrapper.prototype.render = function () {
|
|
137
|
+
var props = this.props;
|
|
138
|
+
var child = React__default.Children.only(props.children);
|
|
139
|
+
if (!props.tooltip) {
|
|
140
|
+
return child;
|
|
141
|
+
}
|
|
142
|
+
// tooltip 对象内属性优先级更高
|
|
143
|
+
var tooltipObj = __assign({ placement: props.placement, container: props.container, trigger: props.trigger, rootClose: props.rootClose, tooltipClassName: props.tooltipClassName, style: props.style, mouseLeaveDelay: props.delay, tooltipTheme: props.tooltipTheme }, (typeof props.tooltip === 'string'
|
|
144
|
+
? { content: props.tooltip }
|
|
145
|
+
: props.tooltip));
|
|
146
|
+
var title = tooltipObj.title, content = tooltipObj.content, placement = tooltipObj.placement, container = tooltipObj.container, trigger = tooltipObj.trigger, rootClose = tooltipObj.rootClose, tooltipClassName = tooltipObj.tooltipClassName, tooltipArrowClassName = tooltipObj.tooltipArrowClassName, tooltipBodyClassName = tooltipObj.tooltipBodyClassName, style = tooltipObj.style, _a = tooltipObj.disabled, disabled = _a === void 0 ? false : _a, offset = tooltipObj.offset, _b = tooltipObj.tooltipTheme, tooltipTheme = _b === void 0 ? 'light' : _b, _c = tooltipObj.showArrow, showArrow = _c === void 0 ? true : _c, children = tooltipObj.children;
|
|
147
|
+
var childProps = {
|
|
148
|
+
key: 'target'
|
|
149
|
+
};
|
|
150
|
+
var triggers = Array.isArray(trigger) ? trigger.concat() : [trigger];
|
|
151
|
+
if (~triggers.indexOf('click')) {
|
|
152
|
+
childProps.onClick = this.handleClick;
|
|
153
|
+
}
|
|
154
|
+
if (~triggers.indexOf('focus')) {
|
|
155
|
+
childProps.onFocus = this.handleShow;
|
|
156
|
+
childProps.onBlur = this.handleHide;
|
|
157
|
+
}
|
|
158
|
+
if (~triggers.indexOf('hover')) {
|
|
159
|
+
childProps.onMouseOver = this.handleMouseOver;
|
|
160
|
+
childProps.onMouseOut = this.handleMouseOut;
|
|
161
|
+
}
|
|
162
|
+
return [
|
|
163
|
+
child ? React__default.cloneElement(child, childProps) : null,
|
|
164
|
+
React__default.createElement(Overlay, { key: "overlay", target: this.getTarget, show: this.state.show && !disabled, onHide: this.handleHide, rootClose: rootClose, placement: placement, container: container, offset: Array.isArray(offset) ? offset : [0, 0] },
|
|
165
|
+
React__default.createElement(Tooltip, { title: typeof title === 'string' ? title : undefined, style: style, className: tooltipClassName, tooltipTheme: tooltipTheme, showArrow: showArrow, arrowClassName: tooltipArrowClassName, bodyClassName: tooltipBodyClassName, onMouseEnter: ~triggers.indexOf('hover') ? this.tooltipMouseEnter : function () { }, onMouseLeave: ~triggers.indexOf('hover') ? this.tooltipMouseLeave : function () { } }, children ? (React__default.createElement(React__default.Fragment, null, typeof children === 'function' ? children() : children)) : (React__default.createElement(Html, { html: typeof content === 'string' ? content : '' }))))
|
|
166
|
+
];
|
|
167
|
+
};
|
|
168
|
+
TooltipWrapper.defaultProps = {
|
|
169
|
+
placement: 'top',
|
|
170
|
+
trigger: ['hover', 'focus'],
|
|
171
|
+
rootClose: false,
|
|
172
|
+
delay: 300
|
|
173
|
+
};
|
|
174
|
+
return TooltipWrapper;
|
|
175
|
+
}(React__default.Component));
|
|
176
|
+
var TooltipWrapper$1 = themeable(uncontrollable(TooltipWrapper, {
|
|
177
|
+
show: 'onVisibleChange'
|
|
178
|
+
}));
|
|
179
|
+
|
|
180
|
+
export { TooltipWrapper, TooltipWrapper$1 as default };
|