amis-ui 1.0.0-beta.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/dist/components/404.d.ts +54 -0
- package/dist/components/404.js +44 -0
- package/dist/components/Alert.d.ts +560 -0
- package/dist/components/Alert.js +201 -0
- package/dist/components/Alert2.d.ts +66 -0
- package/dist/components/Alert2.js +69 -0
- package/dist/components/AnchorNav.d.ts +118 -0
- package/dist/components/AnchorNav.js +181 -0
- package/dist/components/ArrayInput.d.ts +625 -0
- package/dist/components/ArrayInput.js +162 -0
- package/dist/components/AsideNav.d.ts +142 -0
- package/dist/components/AsideNav.js +139 -0
- package/dist/components/AssociatedSelection.d.ts +491 -0
- package/dist/components/AssociatedSelection.js +113 -0
- package/dist/components/Avatar.d.ts +113 -0
- package/dist/components/Avatar.js +150 -0
- package/dist/components/Badge.d.ts +120 -0
- package/dist/components/BaiduMapPicker.d.ts +86 -0
- package/dist/components/BarCode.d.ts +58 -0
- package/dist/components/Breadcrumb.d.ts +115 -0
- package/dist/components/Breadcrumb.js +173 -0
- package/dist/components/Button.d.ts +74 -0
- package/dist/components/Button.js +73 -0
- package/dist/components/CalendarMobile.d.ts +353 -0
- package/dist/components/CalendarMobile.js +541 -0
- package/dist/components/Card.d.ts +75 -0
- package/dist/components/Cascader.d.ts +109 -0
- package/dist/components/ChainedSelection.d.ts +480 -0
- package/dist/components/ChainedSelection.js +131 -0
- package/dist/components/Checkbox.d.ts +69 -0
- package/dist/components/Checkbox.js +73 -0
- package/dist/components/CityArea.d.ts +307 -0
- package/dist/components/CityDB.d.ts +13 -0
- package/dist/components/CodeMirror.d.ts +25 -0
- package/dist/components/CodeMirror.js +113 -0
- package/dist/components/Collapse.d.ts +92 -0
- package/dist/components/Collapse.js +166 -0
- package/dist/components/CollapseGroup.d.ts +68 -0
- package/dist/components/CollapseGroup.js +96 -0
- package/dist/components/ColorPicker.d.ts +524 -0
- package/dist/components/ContextMenu.d.ts +96 -0
- package/dist/components/ContextMenu.js +225 -0
- package/dist/components/DatePicker.d.ts +619 -0
- package/dist/components/DatePicker.js +534 -0
- package/dist/components/DateRangePicker.d.ts +876 -0
- package/dist/components/DateRangePicker.js +1050 -0
- package/dist/components/Drawer.d.ts +95 -0
- package/dist/components/Drawer.js +262 -0
- package/dist/components/Editor.d.ts +605 -0
- package/dist/components/Editor.js +245 -0
- package/dist/components/Form.d.ts +22 -0
- package/dist/components/FormField.d.ts +65 -0
- package/dist/components/GridNav.d.ts +52 -0
- package/dist/components/GroupedSelection.d.ts +467 -0
- package/dist/components/GroupedSelection.js +71 -0
- package/dist/components/Html.d.ts +83 -0
- package/dist/components/Html.js +61 -0
- package/dist/components/ImageGallery.d.ts +297 -0
- package/dist/components/Input.d.ts +16 -0
- package/dist/components/Input.js +70 -0
- package/dist/components/InputBox.d.ts +99 -0
- package/dist/components/InputBox.js +106 -0
- package/dist/components/InputBoxWithSuggestion.d.ts +280 -0
- package/dist/components/InputBoxWithSuggestion.js +75 -0
- package/dist/components/Layout.d.ts +144 -0
- package/dist/components/Layout.js +75 -0
- package/dist/components/Link.d.ts +62 -0
- package/dist/components/ListGroup.d.ts +76 -0
- package/dist/components/ListGroup.js +40 -0
- package/dist/components/ListMenu.d.ts +573 -0
- package/dist/components/LocationPicker.d.ts +427 -0
- package/dist/components/Markdown.d.ts +20 -0
- package/dist/components/Modal.d.ts +1278 -0
- package/dist/components/Modal.js +159 -0
- package/dist/components/ModalManager.d.ts +17 -0
- package/dist/components/ModalManager.js +53 -0
- package/dist/components/MonthRangePicker.d.ts +748 -0
- package/dist/components/NumberInput.d.ts +89 -0
- package/dist/components/NumberInput.js +147 -0
- package/dist/components/Overlay.d.ts +41 -0
- package/dist/components/Overlay.js +218 -0
- package/dist/components/Pagination.d.ts +685 -0
- package/dist/components/Picker.d.ts +284 -0
- package/dist/components/Picker.js +82 -0
- package/dist/components/PickerColumn.d.ts +63 -0
- package/dist/components/PickerColumn.js +285 -0
- package/dist/components/PickerContainer.d.ts +303 -0
- package/dist/components/PickerContainer.js +158 -0
- package/dist/components/PopOver.d.ts +90 -0
- package/dist/components/PopOver.js +98 -0
- package/dist/components/PopOverContainer.d.ts +28 -0
- package/dist/components/PopOverContainer.js +101 -0
- package/dist/components/PopUp.d.ts +578 -0
- package/dist/components/PopUp.js +96 -0
- package/dist/components/Progress.d.ts +68 -0
- package/dist/components/PullRefresh.d.ts +64 -0
- package/dist/components/PullRefresh.js +149 -0
- package/dist/components/Radios.d.ts +180 -0
- package/dist/components/Radios.js +121 -0
- package/dist/components/Range.d.ts +122 -0
- package/dist/components/Range.js +418 -0
- package/dist/components/Rating.d.ts +252 -0
- package/dist/components/Rating.js +324 -0
- package/dist/components/ResultBox.d.ts +290 -0
- package/dist/components/ResultBox.js +156 -0
- package/dist/components/ResultList.d.ts +319 -0
- package/dist/components/ResultList.js +192 -0
- package/dist/components/ResultTableList.d.ts +708 -0
- package/dist/components/ResultTableList.js +135 -0
- package/dist/components/ResultTreeList.d.ts +308 -0
- package/dist/components/ResultTreeList.js +217 -0
- package/dist/components/RichText.d.ts +45 -0
- package/dist/components/SearchBox.d.ts +504 -0
- package/dist/components/SearchBox.js +137 -0
- package/dist/components/Select.d.ts +6280 -0
- package/dist/components/Select.js +772 -0
- package/dist/components/Selection.d.ts +510 -0
- package/dist/components/Selection.js +151 -0
- package/dist/components/SparkLine.d.ts +403 -0
- package/dist/components/SparkLine.js +71 -0
- package/dist/components/Spinner.d.ts +174 -0
- package/dist/components/Spinner.js +77 -0
- package/dist/components/Steps.d.ts +110 -0
- package/dist/components/Switch.d.ts +101 -0
- package/dist/components/Switch.js +73 -0
- package/dist/components/TableSelection.d.ts +695 -0
- package/dist/components/TableSelection.js +88 -0
- package/dist/components/Tabs.d.ts +210 -0
- package/dist/components/Tabs.js +486 -0
- package/dist/components/TabsTransfer.d.ts +297 -0
- package/dist/components/TabsTransfer.js +220 -0
- package/dist/components/TabsTransferPicker.d.ts +273 -0
- package/dist/components/Tag.d.ts +104 -0
- package/dist/components/Textarea.d.ts +568 -0
- package/dist/components/Textarea.js +144 -0
- package/dist/components/Timeline.d.ts +47 -0
- package/dist/components/TimelineItem.d.ts +297 -0
- package/dist/components/Tinymce.d.ts +55 -0
- package/dist/components/TitleBar.d.ts +115 -0
- package/dist/components/TitleBar.js +57 -0
- package/dist/components/Toast.d.ts +358 -0
- package/dist/components/Toast.js +260 -0
- package/dist/components/Tooltip.d.ts +65 -0
- package/dist/components/Tooltip.js +45 -0
- package/dist/components/TooltipWrapper.d.ts +155 -0
- package/dist/components/TooltipWrapper.js +192 -0
- package/dist/components/Transfer.d.ts +1243 -0
- package/dist/components/Transfer.js +332 -0
- package/dist/components/TransferDropDown.d.ts +271 -0
- package/dist/components/TransferPicker.d.ts +277 -0
- package/dist/components/TransferSearch.d.ts +292 -0
- package/dist/components/TransferSearch.js +104 -0
- package/dist/components/Tree.d.ts +1708 -0
- package/dist/components/Tree.js +773 -0
- package/dist/components/TreeSelection.d.ts +526 -0
- package/dist/components/TreeSelection.js +209 -0
- package/dist/components/UserSelect.d.ts +500 -0
- package/dist/components/UserTabSelect.d.ts +320 -0
- package/dist/components/WithRemoteConfig.d.ts +386 -0
- package/dist/components/WithRemoteConfig.js +268 -0
- package/dist/components/WithStore.d.ts +75 -0
- package/dist/components/WithStore.js +57 -0
- package/dist/components/calendar/Calendar.d.ts +64 -0
- package/dist/components/calendar/Calendar.js +499 -0
- package/dist/components/calendar/CalendarContainer.d.ts +10 -0
- package/dist/components/calendar/CalendarContainer.js +35 -0
- package/dist/components/calendar/DaysView.d.ts +170 -0
- package/dist/components/calendar/DaysView.js +453 -0
- package/dist/components/calendar/MonthsView.d.ts +128 -0
- package/dist/components/calendar/MonthsView.js +168 -0
- package/dist/components/calendar/QuartersView.d.ts +92 -0
- package/dist/components/calendar/QuartersView.js +93 -0
- package/dist/components/calendar/TimeView.d.ts +178 -0
- package/dist/components/calendar/TimeView.js +474 -0
- package/dist/components/calendar/YearsView.d.ts +102 -0
- package/dist/components/calendar/YearsView.js +131 -0
- package/dist/components/condition-builder/Expression.d.ts +298 -0
- package/dist/components/condition-builder/Field.d.ts +280 -0
- package/dist/components/condition-builder/Formula.d.ts +269 -0
- package/dist/components/condition-builder/Func.d.ts +279 -0
- package/dist/components/condition-builder/Group.d.ts +296 -0
- package/dist/components/condition-builder/GroupOrItem.d.ts +72 -0
- package/dist/components/condition-builder/InputSwitch.d.ts +47 -0
- package/dist/components/condition-builder/Item.d.ts +292 -0
- package/dist/components/condition-builder/Value.d.ts +277 -0
- package/dist/components/condition-builder/config.d.ts +35 -0
- package/dist/components/condition-builder/index.d.ts +303 -0
- package/dist/components/condition-builder/types.d.ts +150 -0
- package/dist/components/formula/Editor.d.ts +362 -0
- package/dist/components/formula/Editor.js +217 -0
- package/dist/components/formula/FuncList.d.ts +48 -0
- package/dist/components/formula/FuncList.js +57 -0
- package/dist/components/formula/Picker.d.ts +440 -0
- package/dist/components/formula/Picker.js +231 -0
- package/dist/components/formula/VariableList.d.ts +54 -0
- package/dist/components/formula/VariableList.js +49 -0
- package/dist/components/formula/plugin.d.ts +27 -0
- package/dist/components/formula/plugin.js +211 -0
- package/dist/components/icons.d.ts +45 -0
- package/dist/components/icons.js +270 -0
- package/dist/components/index.d.ts +64 -0
- package/dist/components/json-schema/Array.d.ts +3 -0
- package/dist/components/json-schema/Array.js +136 -0
- package/dist/components/json-schema/Item.d.ts +3 -0
- package/dist/components/json-schema/Item.js +45 -0
- package/dist/components/json-schema/Object.d.ts +3 -0
- package/dist/components/json-schema/Object.js +189 -0
- package/dist/components/json-schema/index.d.ts +277 -0
- package/dist/components/json-schema/index.js +28 -0
- package/dist/components/schema-editor/Array.d.ts +11 -0
- package/dist/components/schema-editor/Common.d.ts +29 -0
- package/dist/components/schema-editor/Item.d.ts +8 -0
- package/dist/components/schema-editor/Object.d.ts +44 -0
- package/dist/components/schema-editor/SchemaVariableList.d.ts +193 -0
- package/dist/components/schema-editor/SchemaVariableList.js +83 -0
- package/dist/components/schema-editor/SchemaVariableListPicker.d.ts +186 -0
- package/dist/components/schema-editor/SchemaVariableListPicker.js +43 -0
- package/dist/components/schema-editor/index.d.ts +303 -0
- package/dist/components/table/Cell.d.ts +489 -0
- package/dist/components/table/Cell.js +47 -0
- package/dist/components/table/HeadCellDropDown.d.ts +293 -0
- package/dist/components/table/HeadCellDropDown.js +64 -0
- package/dist/components/table/HeadCellFilter.d.ts +419 -0
- package/dist/components/table/HeadCellFilter.js +146 -0
- package/dist/components/table/HeadCellSelect.d.ts +364 -0
- package/dist/components/table/HeadCellSelect.js +57 -0
- package/dist/components/table/HeadCellSort.d.ts +278 -0
- package/dist/components/table/HeadCellSort.js +83 -0
- package/dist/components/table/ItemActionsWrapper.d.ts +10 -0
- package/dist/components/table/ItemActionsWrapper.js +37 -0
- package/dist/components/table/index.d.ts +794 -0
- package/dist/components/table/index.js +1250 -0
- package/dist/components/virtual-list/SizeAndPositionManager.d.ts +70 -0
- package/dist/components/virtual-list/SizeAndPositionManager.js +220 -0
- package/dist/components/virtual-list/constants.d.ts +34 -0
- package/dist/components/virtual-list/constants.js +53 -0
- package/dist/components/virtual-list/index.d.ts +94 -0
- package/dist/components/virtual-list/index.js +309 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/use-set-state.d.ts +2 -0
- package/dist/hooks/use-set-state.js +27 -0
- package/dist/hooks/use-touch.d.ts +16 -0
- package/dist/hooks/use-touch.js +81 -0
- package/dist/hooks/use-update-effect.d.ts +3 -0
- package/dist/hooks/use-update-effect.js +25 -0
- package/dist/hooks/use-validation-resolver.d.ts +2 -0
- package/dist/hooks/use-validation-resolver.js +59 -0
- package/dist/icons/alert-danger.svg.js +48 -0
- package/dist/icons/alert-info.svg.js +48 -0
- package/dist/icons/alert-success.svg.js +48 -0
- package/dist/icons/alert-warning.svg.js +48 -0
- package/dist/icons/back.svg.js +47 -0
- package/dist/icons/calendar.svg.js +56 -0
- package/dist/icons/caret.svg.js +46 -0
- package/dist/icons/check.svg.js +45 -0
- package/dist/icons/clock.svg.js +56 -0
- package/dist/icons/close-small.svg.js +49 -0
- package/dist/icons/close.svg.js +45 -0
- package/dist/icons/cloud-upload.svg.js +57 -0
- package/dist/icons/column-filter.svg.js +47 -0
- package/dist/icons/columns.svg.js +46 -0
- package/dist/icons/compress-alt.svg.js +46 -0
- package/dist/icons/copy.svg.js +51 -0
- package/dist/icons/date.svg.js +52 -0
- package/dist/icons/department.svg.js +78 -0
- package/dist/icons/desk-empty.svg.js +99 -0
- package/dist/icons/dot.svg.js +62 -0
- package/dist/icons/down-arrow-bold.svg.js +48 -0
- package/dist/icons/download.svg.js +50 -0
- package/dist/icons/drag-bar.svg.js +79 -0
- package/dist/icons/drag.svg.js +48 -0
- package/dist/icons/edit.svg.js +48 -0
- package/dist/icons/ellipsis-v.svg.js +47 -0
- package/dist/icons/enter.svg.js +45 -0
- package/dist/icons/exchange.svg.js +47 -0
- package/dist/icons/expand-alt.svg.js +46 -0
- package/dist/icons/fail.svg.js +54 -0
- package/dist/icons/file.svg.js +47 -0
- package/dist/icons/filter.svg.js +46 -0
- package/dist/icons/folder.svg.js +49 -0
- package/dist/icons/function.svg.js +48 -0
- package/dist/icons/home.svg.js +46 -0
- package/dist/icons/image.svg.js +45 -0
- package/dist/icons/info-circle.svg.js +46 -0
- package/dist/icons/info.svg.js +52 -0
- package/dist/icons/input-clear.svg.js +48 -0
- package/dist/icons/invisible.svg.js +48 -0
- package/dist/icons/left-arrow.svg.js +46 -0
- package/dist/icons/loading-outline.svg.js +49 -0
- package/dist/icons/location.svg.js +46 -0
- package/dist/icons/menu.svg.js +48 -0
- package/dist/icons/minus.svg.js +46 -0
- package/dist/icons/move.svg.js +47 -0
- package/dist/icons/mute.svg.js +46 -0
- package/dist/icons/pause.svg.js +46 -0
- package/dist/icons/pencil.svg.js +46 -0
- package/dist/icons/play.svg.js +45 -0
- package/dist/icons/plus-cicle.svg.js +47 -0
- package/dist/icons/plus-fine.svg.js +48 -0
- package/dist/icons/plus.svg.js +47 -0
- package/dist/icons/post.svg.js +74 -0
- package/dist/icons/question-mark.svg.js +51 -0
- package/dist/icons/question.svg.js +46 -0
- package/dist/icons/redo.svg.js +46 -0
- package/dist/icons/refresh.svg.js +47 -0
- package/dist/icons/reload.svg.js +46 -0
- package/dist/icons/remove.svg.js +48 -0
- package/dist/icons/retry.svg.js +51 -0
- package/dist/icons/right-arrow-bold.svg.js +46 -0
- package/dist/icons/right-arrow.svg.js +46 -0
- package/dist/icons/role.svg.js +69 -0
- package/dist/icons/schedule.svg.js +49 -0
- package/dist/icons/search.svg.js +45 -0
- package/dist/icons/setting.svg.js +47 -0
- package/dist/icons/slider-handle-icon.svg.js +48 -0
- package/dist/icons/sort-asc.svg.js +46 -0
- package/dist/icons/sort-default.svg.js +47 -0
- package/dist/icons/sort-desc.svg.js +46 -0
- package/dist/icons/star.svg.js +47 -0
- package/dist/icons/status-close.svg.js +49 -0
- package/dist/icons/status-fail.svg.js +48 -0
- package/dist/icons/status-info.svg.js +52 -0
- package/dist/icons/status-success.svg.js +48 -0
- package/dist/icons/status-warning.svg.js +52 -0
- package/dist/icons/success.svg.js +52 -0
- package/dist/icons/transparent.svg.js +65 -0
- package/dist/icons/trash.svg.js +48 -0
- package/dist/icons/tree-down.svg.js +47 -0
- package/dist/icons/undo.svg.js +46 -0
- package/dist/icons/upload.svg.js +48 -0
- package/dist/icons/user-remove.svg.js +59 -0
- package/dist/icons/view.svg.js +48 -0
- package/dist/icons/volume.svg.js +49 -0
- package/dist/icons/warning-mark.svg.js +49 -0
- package/dist/icons/warning.svg.js +46 -0
- package/dist/icons/window-restore.svg.js +46 -0
- package/dist/icons/zoom-in.svg.js +46 -0
- package/dist/icons/zoom-out.svg.js +46 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +151 -0
- package/dist/locale/de-DE.d.ts +1 -0
- package/dist/locale/de-DE.js +344 -0
- package/dist/locale/en-US.d.ts +1 -0
- package/dist/locale/en-US.js +347 -0
- package/dist/locale/zh-CN.d.ts +1 -0
- package/dist/locale/zh-CN.js +358 -0
- package/dist/themes/ang.d.ts +3 -0
- package/dist/themes/ang.js +20 -0
- package/dist/themes/antd.d.ts +1 -0
- package/dist/themes/antd.js +44 -0
- package/dist/themes/cxd.d.ts +3 -0
- package/dist/themes/cxd.js +459 -0
- package/dist/themes/dark.d.ts +3 -0
- package/dist/themes/dark.js +28 -0
- package/dist/themes/default.d.ts +4 -0
- package/esm-dist/components/404.d.ts +54 -0
- package/esm-dist/components/404.js +35 -0
- package/esm-dist/components/Alert.d.ts +560 -0
- package/esm-dist/components/Alert.js +188 -0
- package/esm-dist/components/Alert2.d.ts +66 -0
- package/esm-dist/components/Alert2.js +60 -0
- package/esm-dist/components/AnchorNav.d.ts +118 -0
- package/esm-dist/components/AnchorNav.js +171 -0
- package/esm-dist/components/ArrayInput.d.ts +625 -0
- package/esm-dist/components/ArrayInput.js +152 -0
- package/esm-dist/components/AsideNav.d.ts +142 -0
- package/esm-dist/components/AsideNav.js +130 -0
- package/esm-dist/components/AssociatedSelection.d.ts +491 -0
- package/esm-dist/components/AssociatedSelection.js +104 -0
- package/esm-dist/components/Avatar.d.ts +113 -0
- package/esm-dist/components/Avatar.js +125 -0
- package/esm-dist/components/Badge.d.ts +120 -0
- package/esm-dist/components/BaiduMapPicker.d.ts +86 -0
- package/esm-dist/components/BarCode.d.ts +58 -0
- package/esm-dist/components/Breadcrumb.d.ts +115 -0
- package/esm-dist/components/Breadcrumb.js +163 -0
- package/esm-dist/components/Button.d.ts +74 -0
- package/esm-dist/components/Button.js +64 -0
- package/esm-dist/components/CalendarMobile.d.ts +353 -0
- package/esm-dist/components/CalendarMobile.js +531 -0
- package/esm-dist/components/Card.d.ts +75 -0
- package/esm-dist/components/Cascader.d.ts +109 -0
- package/esm-dist/components/ChainedSelection.d.ts +480 -0
- package/esm-dist/components/ChainedSelection.js +121 -0
- package/esm-dist/components/Checkbox.d.ts +69 -0
- package/esm-dist/components/Checkbox.js +64 -0
- package/esm-dist/components/CityArea.d.ts +307 -0
- package/esm-dist/components/CityDB.d.ts +13 -0
- package/esm-dist/components/CodeMirror.d.ts +25 -0
- package/esm-dist/components/CodeMirror.js +104 -0
- package/esm-dist/components/Collapse.d.ts +92 -0
- package/esm-dist/components/Collapse.js +156 -0
- package/esm-dist/components/CollapseGroup.d.ts +68 -0
- package/esm-dist/components/CollapseGroup.js +88 -0
- package/esm-dist/components/ColorPicker.d.ts +524 -0
- package/esm-dist/components/ContextMenu.d.ts +96 -0
- package/esm-dist/components/ContextMenu.js +213 -0
- package/esm-dist/components/DatePicker.d.ts +619 -0
- package/esm-dist/components/DatePicker.js +524 -0
- package/esm-dist/components/DateRangePicker.d.ts +876 -0
- package/esm-dist/components/DateRangePicker.js +1038 -0
- package/esm-dist/components/Drawer.d.ts +95 -0
- package/esm-dist/components/Drawer.js +250 -0
- package/esm-dist/components/Editor.d.ts +605 -0
- package/esm-dist/components/Editor.js +234 -0
- package/esm-dist/components/Form.d.ts +22 -0
- package/esm-dist/components/FormField.d.ts +65 -0
- package/esm-dist/components/GridNav.d.ts +52 -0
- package/esm-dist/components/GroupedSelection.d.ts +467 -0
- package/esm-dist/components/GroupedSelection.js +62 -0
- package/esm-dist/components/Html.d.ts +83 -0
- package/esm-dist/components/Html.js +52 -0
- package/esm-dist/components/ImageGallery.d.ts +297 -0
- package/esm-dist/components/Input.d.ts +16 -0
- package/esm-dist/components/Input.js +62 -0
- package/esm-dist/components/InputBox.d.ts +99 -0
- package/esm-dist/components/InputBox.js +97 -0
- package/esm-dist/components/InputBoxWithSuggestion.d.ts +280 -0
- package/esm-dist/components/InputBoxWithSuggestion.js +66 -0
- package/esm-dist/components/Layout.d.ts +144 -0
- package/esm-dist/components/Layout.js +66 -0
- package/esm-dist/components/Link.d.ts +62 -0
- package/esm-dist/components/ListGroup.d.ts +76 -0
- package/esm-dist/components/ListGroup.js +31 -0
- package/esm-dist/components/ListMenu.d.ts +573 -0
- package/esm-dist/components/LocationPicker.d.ts +427 -0
- package/esm-dist/components/Markdown.d.ts +20 -0
- package/esm-dist/components/Modal.d.ts +1278 -0
- package/esm-dist/components/Modal.js +148 -0
- package/esm-dist/components/ModalManager.d.ts +17 -0
- package/esm-dist/components/ModalManager.js +42 -0
- package/esm-dist/components/MonthRangePicker.d.ts +748 -0
- package/esm-dist/components/NumberInput.d.ts +89 -0
- package/esm-dist/components/NumberInput.js +136 -0
- package/esm-dist/components/Overlay.d.ts +41 -0
- package/esm-dist/components/Overlay.js +207 -0
- package/esm-dist/components/Pagination.d.ts +685 -0
- package/esm-dist/components/Picker.d.ts +284 -0
- package/esm-dist/components/Picker.js +74 -0
- package/esm-dist/components/PickerColumn.d.ts +63 -0
- package/esm-dist/components/PickerColumn.js +275 -0
- package/esm-dist/components/PickerContainer.d.ts +303 -0
- package/esm-dist/components/PickerContainer.js +149 -0
- package/esm-dist/components/PopOver.d.ts +90 -0
- package/esm-dist/components/PopOver.js +89 -0
- package/esm-dist/components/PopOverContainer.d.ts +28 -0
- package/esm-dist/components/PopOverContainer.js +92 -0
- package/esm-dist/components/PopUp.d.ts +578 -0
- package/esm-dist/components/PopUp.js +85 -0
- package/esm-dist/components/Progress.d.ts +68 -0
- package/esm-dist/components/PullRefresh.d.ts +64 -0
- package/esm-dist/components/PullRefresh.js +141 -0
- package/esm-dist/components/Radios.d.ts +180 -0
- package/esm-dist/components/Radios.js +112 -0
- package/esm-dist/components/Range.d.ts +122 -0
- package/esm-dist/components/Range.js +405 -0
- package/esm-dist/components/Rating.d.ts +252 -0
- package/esm-dist/components/Rating.js +315 -0
- package/esm-dist/components/ResultBox.d.ts +290 -0
- package/esm-dist/components/ResultBox.js +146 -0
- package/esm-dist/components/ResultList.d.ts +319 -0
- package/esm-dist/components/ResultList.js +182 -0
- package/esm-dist/components/ResultTableList.d.ts +708 -0
- package/esm-dist/components/ResultTableList.js +126 -0
- package/esm-dist/components/ResultTreeList.d.ts +308 -0
- package/esm-dist/components/ResultTreeList.js +208 -0
- package/esm-dist/components/RichText.d.ts +45 -0
- package/esm-dist/components/SearchBox.d.ts +504 -0
- package/esm-dist/components/SearchBox.js +127 -0
- package/esm-dist/components/Select.d.ts +6281 -0
- package/esm-dist/components/Select.js +756 -0
- package/esm-dist/components/Selection.d.ts +510 -0
- package/esm-dist/components/Selection.js +140 -0
- package/esm-dist/components/SparkLine.d.ts +403 -0
- package/esm-dist/components/SparkLine.js +62 -0
- package/esm-dist/components/Spinner.d.ts +174 -0
- package/esm-dist/components/Spinner.js +67 -0
- package/esm-dist/components/Steps.d.ts +110 -0
- package/esm-dist/components/Switch.d.ts +101 -0
- package/esm-dist/components/Switch.js +64 -0
- package/esm-dist/components/TableSelection.d.ts +695 -0
- package/esm-dist/components/TableSelection.js +79 -0
- package/esm-dist/components/Tabs.d.ts +210 -0
- package/esm-dist/components/Tabs.js +473 -0
- package/esm-dist/components/TabsTransfer.d.ts +297 -0
- package/esm-dist/components/TabsTransfer.js +210 -0
- package/esm-dist/components/TabsTransferPicker.d.ts +273 -0
- package/esm-dist/components/Tag.d.ts +104 -0
- package/esm-dist/components/Textarea.d.ts +568 -0
- package/esm-dist/components/Textarea.js +134 -0
- package/esm-dist/components/Timeline.d.ts +47 -0
- package/esm-dist/components/TimelineItem.d.ts +297 -0
- package/esm-dist/components/Tinymce.d.ts +55 -0
- package/esm-dist/components/TitleBar.d.ts +115 -0
- package/esm-dist/components/TitleBar.js +48 -0
- package/esm-dist/components/Toast.d.ts +358 -0
- package/esm-dist/components/Toast.js +247 -0
- package/esm-dist/components/Tooltip.d.ts +65 -0
- package/esm-dist/components/Tooltip.js +36 -0
- package/esm-dist/components/TooltipWrapper.d.ts +155 -0
- package/esm-dist/components/TooltipWrapper.js +183 -0
- package/esm-dist/components/Transfer.d.ts +1243 -0
- package/esm-dist/components/Transfer.js +323 -0
- package/esm-dist/components/TransferDropDown.d.ts +271 -0
- package/esm-dist/components/TransferPicker.d.ts +277 -0
- package/esm-dist/components/TransferSearch.d.ts +292 -0
- package/esm-dist/components/TransferSearch.js +95 -0
- package/esm-dist/components/Tree.d.ts +1708 -0
- package/esm-dist/components/Tree.js +764 -0
- package/esm-dist/components/TreeSelection.d.ts +526 -0
- package/esm-dist/components/TreeSelection.js +200 -0
- package/esm-dist/components/UserSelect.d.ts +500 -0
- package/esm-dist/components/UserTabSelect.d.ts +320 -0
- package/esm-dist/components/WithRemoteConfig.d.ts +386 -0
- package/esm-dist/components/WithRemoteConfig.js +257 -0
- package/esm-dist/components/WithStore.d.ts +75 -0
- package/esm-dist/components/WithStore.js +48 -0
- package/esm-dist/components/calendar/Calendar.d.ts +64 -0
- package/esm-dist/components/calendar/Calendar.js +489 -0
- package/esm-dist/components/calendar/CalendarContainer.d.ts +10 -0
- package/esm-dist/components/calendar/CalendarContainer.js +27 -0
- package/esm-dist/components/calendar/DaysView.d.ts +170 -0
- package/esm-dist/components/calendar/DaysView.js +440 -0
- package/esm-dist/components/calendar/MonthsView.d.ts +128 -0
- package/esm-dist/components/calendar/MonthsView.js +158 -0
- package/esm-dist/components/calendar/QuartersView.d.ts +92 -0
- package/esm-dist/components/calendar/QuartersView.js +83 -0
- package/esm-dist/components/calendar/TimeView.d.ts +178 -0
- package/esm-dist/components/calendar/TimeView.js +462 -0
- package/esm-dist/components/calendar/YearsView.d.ts +102 -0
- package/esm-dist/components/calendar/YearsView.js +121 -0
- package/esm-dist/components/condition-builder/Expression.d.ts +298 -0
- package/esm-dist/components/condition-builder/Field.d.ts +280 -0
- package/esm-dist/components/condition-builder/Formula.d.ts +269 -0
- package/esm-dist/components/condition-builder/Func.d.ts +279 -0
- package/esm-dist/components/condition-builder/Group.d.ts +296 -0
- package/esm-dist/components/condition-builder/GroupOrItem.d.ts +72 -0
- package/esm-dist/components/condition-builder/InputSwitch.d.ts +47 -0
- package/esm-dist/components/condition-builder/Item.d.ts +292 -0
- package/esm-dist/components/condition-builder/Value.d.ts +277 -0
- package/esm-dist/components/condition-builder/config.d.ts +35 -0
- package/esm-dist/components/condition-builder/index.d.ts +303 -0
- package/esm-dist/components/condition-builder/types.d.ts +150 -0
- package/esm-dist/components/formula/Editor.d.ts +362 -0
- package/esm-dist/components/formula/Editor.js +208 -0
- package/esm-dist/components/formula/FuncList.d.ts +48 -0
- package/esm-dist/components/formula/FuncList.js +48 -0
- package/esm-dist/components/formula/Picker.d.ts +440 -0
- package/esm-dist/components/formula/Picker.js +222 -0
- package/esm-dist/components/formula/VariableList.d.ts +54 -0
- package/esm-dist/components/formula/VariableList.js +41 -0
- package/esm-dist/components/formula/plugin.d.ts +27 -0
- package/esm-dist/components/formula/plugin.js +206 -0
- package/esm-dist/components/icons.d.ts +45 -0
- package/esm-dist/components/icons.js +249 -0
- package/esm-dist/components/index.d.ts +64 -0
- package/esm-dist/components/json-schema/Array.d.ts +3 -0
- package/esm-dist/components/json-schema/Array.js +128 -0
- package/esm-dist/components/json-schema/Item.d.ts +3 -0
- package/esm-dist/components/json-schema/Item.js +37 -0
- package/esm-dist/components/json-schema/Object.d.ts +3 -0
- package/esm-dist/components/json-schema/Object.js +181 -0
- package/esm-dist/components/json-schema/index.d.ts +277 -0
- package/esm-dist/components/json-schema/index.js +20 -0
- package/esm-dist/components/schema-editor/Array.d.ts +11 -0
- package/esm-dist/components/schema-editor/Common.d.ts +29 -0
- package/esm-dist/components/schema-editor/Item.d.ts +8 -0
- package/esm-dist/components/schema-editor/Object.d.ts +44 -0
- package/esm-dist/components/schema-editor/SchemaVariableList.d.ts +193 -0
- package/esm-dist/components/schema-editor/SchemaVariableList.js +74 -0
- package/esm-dist/components/schema-editor/SchemaVariableListPicker.d.ts +186 -0
- package/esm-dist/components/schema-editor/SchemaVariableListPicker.js +34 -0
- package/esm-dist/components/schema-editor/index.d.ts +303 -0
- package/esm-dist/components/table/Cell.d.ts +489 -0
- package/esm-dist/components/table/Cell.js +38 -0
- package/esm-dist/components/table/HeadCellDropDown.d.ts +293 -0
- package/esm-dist/components/table/HeadCellDropDown.js +55 -0
- package/esm-dist/components/table/HeadCellFilter.d.ts +419 -0
- package/esm-dist/components/table/HeadCellFilter.js +136 -0
- package/esm-dist/components/table/HeadCellSelect.d.ts +364 -0
- package/esm-dist/components/table/HeadCellSelect.js +48 -0
- package/esm-dist/components/table/HeadCellSort.d.ts +278 -0
- package/esm-dist/components/table/HeadCellSort.js +74 -0
- package/esm-dist/components/table/ItemActionsWrapper.d.ts +10 -0
- package/esm-dist/components/table/ItemActionsWrapper.js +29 -0
- package/esm-dist/components/table/index.d.ts +794 -0
- package/esm-dist/components/table/index.js +1234 -0
- package/esm-dist/components/virtual-list/SizeAndPositionManager.d.ts +70 -0
- package/esm-dist/components/virtual-list/SizeAndPositionManager.js +216 -0
- package/esm-dist/components/virtual-list/constants.d.ts +34 -0
- package/esm-dist/components/virtual-list/constants.js +45 -0
- package/esm-dist/components/virtual-list/index.d.ts +94 -0
- package/esm-dist/components/virtual-list/index.js +281 -0
- package/esm-dist/hooks/index.d.ts +7 -0
- package/esm-dist/hooks/use-set-state.d.ts +2 -0
- package/esm-dist/hooks/use-set-state.js +19 -0
- package/esm-dist/hooks/use-touch.d.ts +16 -0
- package/esm-dist/hooks/use-touch.js +77 -0
- package/esm-dist/hooks/use-update-effect.d.ts +3 -0
- package/esm-dist/hooks/use-update-effect.js +21 -0
- package/esm-dist/hooks/use-validation-resolver.d.ts +2 -0
- package/esm-dist/hooks/use-validation-resolver.js +49 -0
- package/esm-dist/icons/alert-danger.svg.js +24 -0
- package/esm-dist/icons/alert-info.svg.js +24 -0
- package/esm-dist/icons/alert-success.svg.js +24 -0
- package/esm-dist/icons/alert-warning.svg.js +24 -0
- package/esm-dist/icons/back.svg.js +23 -0
- package/esm-dist/icons/calendar.svg.js +32 -0
- package/esm-dist/icons/caret.svg.js +22 -0
- package/esm-dist/icons/check.svg.js +21 -0
- package/esm-dist/icons/clock.svg.js +32 -0
- package/esm-dist/icons/close-small.svg.js +25 -0
- package/esm-dist/icons/close.svg.js +21 -0
- package/esm-dist/icons/cloud-upload.svg.js +33 -0
- package/esm-dist/icons/column-filter.svg.js +23 -0
- package/esm-dist/icons/columns.svg.js +22 -0
- package/esm-dist/icons/compress-alt.svg.js +22 -0
- package/esm-dist/icons/copy.svg.js +27 -0
- package/esm-dist/icons/date.svg.js +28 -0
- package/esm-dist/icons/department.svg.js +54 -0
- package/esm-dist/icons/desk-empty.svg.js +75 -0
- package/esm-dist/icons/dot.svg.js +38 -0
- package/esm-dist/icons/down-arrow-bold.svg.js +24 -0
- package/esm-dist/icons/download.svg.js +26 -0
- package/esm-dist/icons/drag-bar.svg.js +55 -0
- package/esm-dist/icons/drag.svg.js +24 -0
- package/esm-dist/icons/edit.svg.js +24 -0
- package/esm-dist/icons/ellipsis-v.svg.js +23 -0
- package/esm-dist/icons/enter.svg.js +21 -0
- package/esm-dist/icons/exchange.svg.js +23 -0
- package/esm-dist/icons/expand-alt.svg.js +22 -0
- package/esm-dist/icons/fail.svg.js +30 -0
- package/esm-dist/icons/file.svg.js +23 -0
- package/esm-dist/icons/filter.svg.js +22 -0
- package/esm-dist/icons/folder.svg.js +25 -0
- package/esm-dist/icons/function.svg.js +24 -0
- package/esm-dist/icons/home.svg.js +22 -0
- package/esm-dist/icons/image.svg.js +21 -0
- package/esm-dist/icons/info-circle.svg.js +22 -0
- package/esm-dist/icons/info.svg.js +28 -0
- package/esm-dist/icons/input-clear.svg.js +24 -0
- package/esm-dist/icons/invisible.svg.js +24 -0
- package/esm-dist/icons/left-arrow.svg.js +22 -0
- package/esm-dist/icons/loading-outline.svg.js +25 -0
- package/esm-dist/icons/location.svg.js +22 -0
- package/esm-dist/icons/menu.svg.js +24 -0
- package/esm-dist/icons/minus.svg.js +22 -0
- package/esm-dist/icons/move.svg.js +23 -0
- package/esm-dist/icons/mute.svg.js +22 -0
- package/esm-dist/icons/pause.svg.js +22 -0
- package/esm-dist/icons/pencil.svg.js +22 -0
- package/esm-dist/icons/play.svg.js +21 -0
- package/esm-dist/icons/plus-cicle.svg.js +23 -0
- package/esm-dist/icons/plus-fine.svg.js +24 -0
- package/esm-dist/icons/plus.svg.js +23 -0
- package/esm-dist/icons/post.svg.js +50 -0
- package/esm-dist/icons/question-mark.svg.js +27 -0
- package/esm-dist/icons/question.svg.js +22 -0
- package/esm-dist/icons/redo.svg.js +22 -0
- package/esm-dist/icons/refresh.svg.js +23 -0
- package/esm-dist/icons/reload.svg.js +22 -0
- package/esm-dist/icons/remove.svg.js +24 -0
- package/esm-dist/icons/retry.svg.js +27 -0
- package/esm-dist/icons/right-arrow-bold.svg.js +22 -0
- package/esm-dist/icons/right-arrow.svg.js +22 -0
- package/esm-dist/icons/role.svg.js +45 -0
- package/esm-dist/icons/schedule.svg.js +25 -0
- package/esm-dist/icons/search.svg.js +21 -0
- package/esm-dist/icons/setting.svg.js +23 -0
- package/esm-dist/icons/slider-handle-icon.svg.js +24 -0
- package/esm-dist/icons/sort-asc.svg.js +22 -0
- package/esm-dist/icons/sort-default.svg.js +23 -0
- package/esm-dist/icons/sort-desc.svg.js +22 -0
- package/esm-dist/icons/star.svg.js +23 -0
- package/esm-dist/icons/status-close.svg.js +25 -0
- package/esm-dist/icons/status-fail.svg.js +24 -0
- package/esm-dist/icons/status-info.svg.js +28 -0
- package/esm-dist/icons/status-success.svg.js +24 -0
- package/esm-dist/icons/status-warning.svg.js +28 -0
- package/esm-dist/icons/success.svg.js +28 -0
- package/esm-dist/icons/transparent.svg.js +41 -0
- package/esm-dist/icons/trash.svg.js +24 -0
- package/esm-dist/icons/tree-down.svg.js +23 -0
- package/esm-dist/icons/undo.svg.js +22 -0
- package/esm-dist/icons/upload.svg.js +24 -0
- package/esm-dist/icons/user-remove.svg.js +35 -0
- package/esm-dist/icons/view.svg.js +24 -0
- package/esm-dist/icons/volume.svg.js +25 -0
- package/esm-dist/icons/warning-mark.svg.js +25 -0
- package/esm-dist/icons/warning.svg.js +22 -0
- package/esm-dist/icons/window-restore.svg.js +22 -0
- package/esm-dist/icons/zoom-in.svg.js +22 -0
- package/esm-dist/icons/zoom-out.svg.js +22 -0
- package/esm-dist/index.d.ts +10 -0
- package/esm-dist/index.js +74 -0
- package/esm-dist/locale/de-DE.d.ts +1 -0
- package/esm-dist/locale/de-DE.js +342 -0
- package/esm-dist/locale/en-US.d.ts +1 -0
- package/esm-dist/locale/en-US.js +345 -0
- package/esm-dist/locale/zh-CN.d.ts +1 -0
- package/esm-dist/locale/zh-CN.js +356 -0
- package/esm-dist/themes/ang.d.ts +3 -0
- package/esm-dist/themes/ang.js +15 -0
- package/esm-dist/themes/antd.d.ts +1 -0
- package/esm-dist/themes/antd.js +42 -0
- package/esm-dist/themes/cxd.d.ts +3 -0
- package/esm-dist/themes/cxd.js +455 -0
- package/esm-dist/themes/dark.d.ts +3 -0
- package/esm-dist/themes/dark.js +23 -0
- package/esm-dist/themes/default.d.ts +4 -0
- package/package.json +71 -0
- package/rollup.config.js +129 -0
- package/scss/README.md +9 -0
- package/scss/_functions.scss +101 -0
- package/scss/_mixins.scss +472 -0
- package/scss/_properties.scss +1702 -0
- package/scss/_thirds.scss +8 -0
- package/scss/_utilities.scss +1753 -0
- package/scss/_variables.scss +417 -0
- package/scss/base/_common.scss +3 -0
- package/scss/base/_normalize.scss +361 -0
- package/scss/base/_reset.scss +18 -0
- package/scss/base/_typography.scss +59 -0
- package/scss/components/_alert.scss +82 -0
- package/scss/components/_anchor-nav.scss +115 -0
- package/scss/components/_app.scss +31 -0
- package/scss/components/_array-input.scss +101 -0
- package/scss/components/_audio.scss +146 -0
- package/scss/components/_avatar.scss +55 -0
- package/scss/components/_badge.scss +136 -0
- package/scss/components/_barcode.scss +6 -0
- package/scss/components/_breadcrumb.scss +98 -0
- package/scss/components/_button-group.scss +131 -0
- package/scss/components/_button.scss +379 -0
- package/scss/components/_calendar.scss +395 -0
- package/scss/components/_card.scss +359 -0
- package/scss/components/_card2.scss +28 -0
- package/scss/components/_cards.scss +187 -0
- package/scss/components/_carousel.scss +197 -0
- package/scss/components/_cascader.scss +102 -0
- package/scss/components/_chart.scss +20 -0
- package/scss/components/_city-area.scss +29 -0
- package/scss/components/_collapse-group.scss +30 -0
- package/scss/components/_collapse.scss +120 -0
- package/scss/components/_color.scss +18 -0
- package/scss/components/_column-toggler.scss +244 -0
- package/scss/components/_condition-builder.scss +280 -0
- package/scss/components/_context-menu.scss +206 -0
- package/scss/components/_copyable.scss +10 -0
- package/scss/components/_crud.scss +151 -0
- package/scss/components/_debug.scss +170 -0
- package/scss/components/_divider.scss +11 -0
- package/scss/components/_drawer.scss +314 -0
- package/scss/components/_dropdown.scss +144 -0
- package/scss/components/_each.scss +7 -0
- package/scss/components/_formula.scss +407 -0
- package/scss/components/_grid-nav.scss +128 -0
- package/scss/components/_icon.scss +4 -0
- package/scss/components/_image-gallery.scss +205 -0
- package/scss/components/_images.scss +186 -0
- package/scss/components/_input-box.scss +74 -0
- package/scss/components/_json-schema-editor.scss +126 -0
- package/scss/components/_json-schema.scss +124 -0
- package/scss/components/_json.scss +7 -0
- package/scss/components/_link.scss +6 -0
- package/scss/components/_list-menu.scss +74 -0
- package/scss/components/_list.scss +249 -0
- package/scss/components/_log.scss +141 -0
- package/scss/components/_mapping.scss +6 -0
- package/scss/components/_markdown.scss +266 -0
- package/scss/components/_modal.scss +252 -0
- package/scss/components/_nav.scss +310 -0
- package/scss/components/_page.scss +144 -0
- package/scss/components/_pagination.scss +200 -0
- package/scss/components/_panel.scss +229 -0
- package/scss/components/_picker-columns.scss +140 -0
- package/scss/components/_popover.scss +54 -0
- package/scss/components/_popoverable.scss +62 -0
- package/scss/components/_popup.scss +160 -0
- package/scss/components/_portlet.scss +51 -0
- package/scss/components/_progress.scss +142 -0
- package/scss/components/_property.scss +47 -0
- package/scss/components/_pull-refresh.scss +25 -0
- package/scss/components/_quick-edit.scss +56 -0
- package/scss/components/_remark.scss +58 -0
- package/scss/components/_result-box.scss +246 -0
- package/scss/components/_search-box.scss +138 -0
- package/scss/components/_service.scss +3 -0
- package/scss/components/_sparkline.scss +18 -0
- package/scss/components/_spinner.scss +176 -0
- package/scss/components/_status.scss +102 -0
- package/scss/components/_steps.scss +394 -0
- package/scss/components/_table-v2.scss +912 -0
- package/scss/components/_table.scss +936 -0
- package/scss/components/_tabs.scss +1021 -0
- package/scss/components/_tag.scss +177 -0
- package/scss/components/_timeline.scss +198 -0
- package/scss/components/_toast.scss +272 -0
- package/scss/components/_tooltip.scss +339 -0
- package/scss/components/_tpl.scss +5 -0
- package/scss/components/_video.scss +38 -0
- package/scss/components/_wizard.scss +270 -0
- package/scss/components/_wrapper.scss +21 -0
- package/scss/components/form/_chained-select.scss +5 -0
- package/scss/components/form/_checks.scss +513 -0
- package/scss/components/form/_city.scss +33 -0
- package/scss/components/form/_color.scss +119 -0
- package/scss/components/form/_combo.scss +316 -0
- package/scss/components/form/_date-range.scss +222 -0
- package/scss/components/form/_date.scss +633 -0
- package/scss/components/form/_editor.scss +125 -0
- package/scss/components/form/_excel.scss +42 -0
- package/scss/components/form/_fieldset.scss +136 -0
- package/scss/components/form/_file.scss +246 -0
- package/scss/components/form/_form.scss +617 -0
- package/scss/components/form/_group.scss +116 -0
- package/scss/components/form/_icon-picker.scss +107 -0
- package/scss/components/form/_image.scss +266 -0
- package/scss/components/form/_input-group.scss +150 -0
- package/scss/components/form/_list.scss +122 -0
- package/scss/components/form/_location.scss +140 -0
- package/scss/components/form/_matrix.scss +5 -0
- package/scss/components/form/_nested-select.scss +106 -0
- package/scss/components/form/_number.scss +312 -0
- package/scss/components/form/_picker.scss +101 -0
- package/scss/components/form/_qr-code.scss +4 -0
- package/scss/components/form/_range.scss +274 -0
- package/scss/components/form/_rating.scss +74 -0
- package/scss/components/form/_repeat.scss +40 -0
- package/scss/components/form/_result-list.scss +87 -0
- package/scss/components/form/_rich-text.scss +116 -0
- package/scss/components/form/_select.scss +447 -0
- package/scss/components/form/_selection.scss +350 -0
- package/scss/components/form/_sub-form.scss +118 -0
- package/scss/components/form/_switch.scss +102 -0
- package/scss/components/form/_tag.scss +92 -0
- package/scss/components/form/_text.scss +307 -0
- package/scss/components/form/_textarea.scss +62 -0
- package/scss/components/form/_tinymce.scss +6 -0
- package/scss/components/form/_transfer.scss +320 -0
- package/scss/components/form/_tree-select.scss +39 -0
- package/scss/components/form/_tree.scss +317 -0
- package/scss/components/form/_user-select.scss +422 -0
- package/scss/components/react-datetime.scss +247 -0
- package/scss/helper/background/_background-color.scss +214 -0
- package/scss/helper/border/_border-color.scss +178 -0
- package/scss/helper/border/_border-radius.scss +152 -0
- package/scss/helper/border/_border-style.scss +40 -0
- package/scss/helper/border/_border-width.scss +72 -0
- package/scss/helper/box-alignment/_align-content.scss +44 -0
- package/scss/helper/box-alignment/_align-items.scss +41 -0
- package/scss/helper/box-alignment/_align-self.scss +40 -0
- package/scss/helper/box-alignment/_justify-content.scss +44 -0
- package/scss/helper/box-alignment/_justify-items.scss +40 -0
- package/scss/helper/box-alignment/_justify-self.scss +40 -0
- package/scss/helper/box-alignment/_place-content.scss +48 -0
- package/scss/helper/box-alignment/_place-items.scss +40 -0
- package/scss/helper/box-alignment/_place-self.scss +40 -0
- package/scss/helper/effect/_box-shadow.scss +74 -0
- package/scss/helper/effect/_opacity.scss +66 -0
- package/scss/helper/flex/_direction.scss +41 -0
- package/scss/helper/flex/_flex.scss +38 -0
- package/scss/helper/flex/_grow.scss +28 -0
- package/scss/helper/flex/_order.scss +56 -0
- package/scss/helper/flex/_shrink.scss +27 -0
- package/scss/helper/flex/_wrap.scss +36 -0
- package/scss/helper/grid/_auto-columns.scss +38 -0
- package/scss/helper/grid/_auto-flow.scss +38 -0
- package/scss/helper/grid/_auto-rows.scss +38 -0
- package/scss/helper/grid/_column-start-end.scss +201 -0
- package/scss/helper/grid/_columns.scss +74 -0
- package/scss/helper/grid/_gap.scss +154 -0
- package/scss/helper/grid/_row-start-end.scss +201 -0
- package/scss/helper/grid/_rows.scss +50 -0
- package/scss/helper/layout/_box-sizing.scss +51 -0
- package/scss/helper/layout/_clear.scss +56 -0
- package/scss/helper/layout/_display.scss +82 -0
- package/scss/helper/layout/_float.scss +71 -0
- package/scss/helper/layout/_overflow.scss +85 -0
- package/scss/helper/layout/_position.scss +55 -0
- package/scss/helper/layout/_top-right-bottom-left.scss +292 -0
- package/scss/helper/layout/_visibility.scss +42 -0
- package/scss/helper/layout/_z-index.scss +67 -0
- package/scss/helper/sizing/_height.scss +161 -0
- package/scss/helper/sizing/_width.scss +158 -0
- package/scss/helper/spacing/_margin.scss +821 -0
- package/scss/helper/spacing/_padding.scss +394 -0
- package/scss/helper/spacing/_space-between.scss +224 -0
- package/scss/helper/typography/_font-family.scss +28 -0
- package/scss/helper/typography/_font-size.scss +40 -0
- package/scss/helper/typography/_font-style.scss +31 -0
- package/scss/helper/typography/_font-weight.scss +49 -0
- package/scss/helper/typography/_letter-spacing.scss +43 -0
- package/scss/helper/typography/_line-height.scss +59 -0
- package/scss/helper/typography/_list-style-type.scss +43 -0
- package/scss/helper/typography/_text-align.scss +34 -0
- package/scss/helper/typography/_text-color.scss +184 -0
- package/scss/helper/typography/_text-decoration.scss +34 -0
- package/scss/helper/typography/_text-overflow.scss +40 -0
- package/scss/helper/typography/_text-transform.scss +40 -0
- package/scss/helper/typography/_vertical-align.scss +44 -0
- package/scss/helper/typography/_whitespace.scss +42 -0
- package/scss/helper/typography/_word-break.scss +36 -0
- package/scss/helper.scss +70 -0
- package/scss/layout/_aside.scss +361 -0
- package/scss/layout/_grid.scss +171 -0
- package/scss/layout/_hbox.scss +127 -0
- package/scss/layout/_header.scss +0 -0
- package/scss/layout/_layout.scss +458 -0
- package/scss/layout/_vbox.scss +38 -0
- package/scss/themes/_ang-variables.scss +132 -0
- package/scss/themes/_antd-colors.scss +149 -0
- package/scss/themes/_antd-variables.scss +171 -0
- package/scss/themes/_common.scss +138 -0
- package/scss/themes/_cxd-colors.scss +56 -0
- package/scss/themes/_cxd-variables.scss +687 -0
- package/scss/themes/_dark-variables.scss +129 -0
- package/scss/themes/ang-ie11.scss +1 -0
- package/scss/themes/ang.scss +4 -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 +426 -0
- package/scss/themes/dark-ie11.scss +1 -0
- package/scss/themes/dark.scss +3 -0
- package/scss/themes/default.scss +2 -0
- package/scss/themes/extract-antd-color.py +27 -0
- package/src/components/404.tsx +49 -0
- package/src/components/Alert.tsx +300 -0
- package/src/components/Alert2.tsx +117 -0
- package/src/components/AnchorNav.tsx +265 -0
- package/src/components/ArrayInput.tsx +234 -0
- package/src/components/AsideNav.tsx +280 -0
- package/src/components/AssociatedSelection.tsx +243 -0
- package/src/components/Avatar.tsx +255 -0
- package/src/components/Badge.tsx +300 -0
- package/src/components/BaiduMapPicker.tsx +394 -0
- package/src/components/BarCode.tsx +50 -0
- package/src/components/Breadcrumb.tsx +294 -0
- package/src/components/Button.tsx +149 -0
- package/src/components/CalendarMobile.tsx +803 -0
- package/src/components/Card.tsx +206 -0
- package/src/components/Cascader.tsx +596 -0
- package/src/components/ChainedSelection.tsx +253 -0
- package/src/components/Checkbox.tsx +117 -0
- package/src/components/CityArea.tsx +318 -0
- package/src/components/CityDB.ts +4109 -0
- package/src/components/CodeMirror.tsx +99 -0
- package/src/components/Collapse.tsx +253 -0
- package/src/components/CollapseGroup.tsx +133 -0
- package/src/components/ColorPicker.tsx +374 -0
- package/src/components/ContextMenu.tsx +313 -0
- package/src/components/DatePicker.tsx +879 -0
- package/src/components/DateRangePicker.tsx +1500 -0
- package/src/components/Drawer.tsx +357 -0
- package/src/components/Editor.tsx +341 -0
- package/src/components/Form.tsx +70 -0
- package/src/components/FormField.tsx +127 -0
- package/src/components/GridNav.tsx +233 -0
- package/src/components/GroupedSelection.tsx +123 -0
- package/src/components/Html.tsx +75 -0
- package/src/components/ImageGallery.tsx +179 -0
- package/src/components/Input.tsx +72 -0
- package/src/components/InputBox.tsx +126 -0
- package/src/components/InputBoxWithSuggestion.tsx +113 -0
- package/src/components/Layout.tsx +123 -0
- package/src/components/Link.tsx +85 -0
- package/src/components/ListGroup.tsx +72 -0
- package/src/components/ListMenu.tsx +112 -0
- package/src/components/LocationPicker.tsx +213 -0
- package/src/components/Markdown.tsx +53 -0
- package/src/components/Modal.tsx +294 -0
- package/src/components/ModalManager.ts +49 -0
- package/src/components/MonthRangePicker.tsx +699 -0
- package/src/components/NumberInput.tsx +255 -0
- package/src/components/Overlay.tsx +317 -0
- package/src/components/Pagination.tsx +526 -0
- package/src/components/Picker.tsx +161 -0
- package/src/components/PickerColumn.tsx +400 -0
- package/src/components/PickerContainer.tsx +178 -0
- package/src/components/PopOver.tsx +155 -0
- package/src/components/PopOverContainer.tsx +114 -0
- package/src/components/PopUp.tsx +161 -0
- package/src/components/Progress.tsx +173 -0
- package/src/components/PullRefresh.tsx +197 -0
- package/src/components/Radios.tsx +198 -0
- package/src/components/Range.tsx +561 -0
- package/src/components/Rating.tsx +421 -0
- package/src/components/ResultBox.tsx +224 -0
- package/src/components/ResultList.tsx +300 -0
- package/src/components/ResultTableList.tsx +229 -0
- package/src/components/ResultTreeList.tsx +312 -0
- package/src/components/RichText.tsx +312 -0
- package/src/components/SearchBox.tsx +175 -0
- package/src/components/Select.tsx +1229 -0
- package/src/components/Selection.tsx +232 -0
- package/src/components/SparkLine.tsx +111 -0
- package/src/components/Spinner.tsx +126 -0
- package/src/components/Steps.tsx +221 -0
- package/src/components/Switch.tsx +122 -0
- package/src/components/TableSelection.tsx +183 -0
- package/src/components/Tabs.tsx +747 -0
- package/src/components/TabsTransfer.tsx +422 -0
- package/src/components/TabsTransferPicker.tsx +111 -0
- package/src/components/Tag.tsx +179 -0
- package/src/components/Textarea.tsx +234 -0
- package/src/components/Timeline.tsx +36 -0
- package/src/components/TimelineItem.tsx +140 -0
- package/src/components/Tinymce.tsx +614 -0
- package/src/components/TitleBar.tsx +61 -0
- package/src/components/Toast.tsx +421 -0
- package/src/components/Tooltip.tsx +78 -0
- package/src/components/TooltipWrapper.tsx +366 -0
- package/src/components/Transfer.tsx +755 -0
- package/src/components/TransferDropDown.tsx +136 -0
- package/src/components/TransferPicker.tsx +118 -0
- package/src/components/TransferSearch.tsx +126 -0
- package/src/components/Tree.tsx +1183 -0
- package/src/components/TreeSelection.tsx +315 -0
- package/src/components/UserSelect.tsx +850 -0
- package/src/components/UserTabSelect.tsx +261 -0
- package/src/components/WithRemoteConfig.tsx +406 -0
- package/src/components/WithStore.tsx +73 -0
- package/src/components/calendar/Calendar.tsx +710 -0
- package/src/components/calendar/CalendarContainer.tsx +30 -0
- package/src/components/calendar/DaysView.tsx +812 -0
- package/src/components/calendar/MonthsView.tsx +288 -0
- package/src/components/calendar/QuartersView.tsx +156 -0
- package/src/components/calendar/TimeView.tsx +742 -0
- package/src/components/calendar/YearsView.tsx +214 -0
- package/src/components/condition-builder/Expression.tsx +244 -0
- package/src/components/condition-builder/Field.tsx +152 -0
- package/src/components/condition-builder/Formula.tsx +39 -0
- package/src/components/condition-builder/Func.tsx +141 -0
- package/src/components/condition-builder/Group.tsx +258 -0
- package/src/components/condition-builder/GroupOrItem.tsx +161 -0
- package/src/components/condition-builder/InputSwitch.tsx +51 -0
- package/src/components/condition-builder/Item.tsx +427 -0
- package/src/components/condition-builder/Value.tsx +162 -0
- package/src/components/condition-builder/config.ts +133 -0
- package/src/components/condition-builder/index.tsx +269 -0
- package/src/components/condition-builder/types.ts +218 -0
- package/src/components/formula/Editor.tsx +337 -0
- package/src/components/formula/FuncList.tsx +113 -0
- package/src/components/formula/Picker.tsx +415 -0
- package/src/components/formula/VariableList.tsx +126 -0
- package/src/components/formula/plugin.ts +252 -0
- package/src/components/icons.tsx +267 -0
- package/src/components/index.tsx +133 -0
- package/src/components/json-schema/Array.tsx +216 -0
- package/src/components/json-schema/Item.tsx +47 -0
- package/src/components/json-schema/Object.tsx +339 -0
- package/src/components/json-schema/index.tsx +48 -0
- package/src/components/schema-editor/Array.tsx +99 -0
- package/src/components/schema-editor/Common.tsx +191 -0
- package/src/components/schema-editor/Item.tsx +30 -0
- package/src/components/schema-editor/Object.tsx +302 -0
- package/src/components/schema-editor/SchemaVariableList.tsx +98 -0
- package/src/components/schema-editor/SchemaVariableListPicker.tsx +68 -0
- package/src/components/schema-editor/index.tsx +228 -0
- package/src/components/table/Cell.tsx +71 -0
- package/src/components/table/HeadCellDropDown.tsx +112 -0
- package/src/components/table/HeadCellFilter.tsx +230 -0
- package/src/components/table/HeadCellSelect.tsx +97 -0
- package/src/components/table/HeadCellSort.tsx +99 -0
- package/src/components/table/ItemActionsWrapper.tsx +37 -0
- package/src/components/table/index.tsx +2012 -0
- package/src/components/virtual-list/SizeAndPositionManager.ts +308 -0
- package/src/components/virtual-list/constants.ts +41 -0
- package/src/components/virtual-list/index.tsx +447 -0
- package/src/custom.d.ts +14 -0
- package/src/hooks/index.ts +7 -0
- package/src/hooks/use-set-state.ts +19 -0
- package/src/hooks/use-touch.ts +100 -0
- package/src/hooks/use-update-effect.ts +16 -0
- package/src/hooks/use-validation-resolver.ts +47 -0
- package/src/icons/alert-danger.svg +1 -0
- package/src/icons/alert-info.svg +1 -0
- package/src/icons/alert-success.svg +1 -0
- package/src/icons/alert-warning.svg +1 -0
- package/src/icons/back.svg +11 -0
- package/src/icons/calendar.svg +27 -0
- package/src/icons/caret.svg +7 -0
- package/src/icons/check.svg +9 -0
- package/src/icons/clock.svg +1 -0
- package/src/icons/close-small.svg +5 -0
- package/src/icons/close.svg +4 -0
- package/src/icons/cloud-upload.svg +22 -0
- package/src/icons/column-filter.svg +9 -0
- package/src/icons/columns.svg +7 -0
- package/src/icons/compress-alt.svg +3 -0
- package/src/icons/copy.svg +9 -0
- package/src/icons/date.svg +9 -0
- package/src/icons/department.svg +17 -0
- package/src/icons/desk-empty.svg +25 -0
- package/src/icons/dot.svg +11 -0
- package/src/icons/down-arrow-bold.svg +10 -0
- package/src/icons/download.svg +4 -0
- package/src/icons/drag-bar.svg +13 -0
- package/src/icons/drag.svg +8 -0
- package/src/icons/edit.svg +8 -0
- package/src/icons/ellipsis-v.svg +9 -0
- package/src/icons/enter.svg +4 -0
- package/src/icons/exchange.svg +7 -0
- package/src/icons/expand-alt.svg +3 -0
- package/src/icons/fail.svg +8 -0
- package/src/icons/file.svg +8 -0
- package/src/icons/filter.svg +7 -0
- package/src/icons/folder.svg +9 -0
- package/src/icons/function.svg +4 -0
- package/src/icons/home.svg +7 -0
- package/src/icons/image.svg +1 -0
- package/src/icons/info-circle.svg +7 -0
- package/src/icons/info.svg +8 -0
- package/src/icons/input-clear.svg +1 -0
- package/src/icons/invisible.svg +10 -0
- package/src/icons/left-arrow.svg +7 -0
- package/src/icons/loading-outline.svg +4 -0
- package/src/icons/location.svg +10 -0
- package/src/icons/menu.svg +2 -0
- package/src/icons/minus.svg +7 -0
- package/src/icons/move.svg +8 -0
- package/src/icons/mute.svg +4 -0
- package/src/icons/pause.svg +5 -0
- package/src/icons/pencil.svg +7 -0
- package/src/icons/play.svg +4 -0
- package/src/icons/plus-cicle.svg +9 -0
- package/src/icons/plus-fine.svg +10 -0
- package/src/icons/plus.svg +9 -0
- package/src/icons/post.svg +15 -0
- package/src/icons/question-mark.svg +12 -0
- package/src/icons/question.svg +7 -0
- package/src/icons/redo.svg +7 -0
- package/src/icons/refresh.svg +7 -0
- package/src/icons/reload.svg +6 -0
- package/src/icons/remove.svg +10 -0
- package/src/icons/retry.svg +8 -0
- package/src/icons/right-arrow-bold.svg +7 -0
- package/src/icons/right-arrow.svg +7 -0
- package/src/icons/role.svg +14 -0
- package/src/icons/schedule.svg +9 -0
- package/src/icons/search.svg +4 -0
- package/src/icons/setting.svg +9 -0
- package/src/icons/slider-handle-icon.svg +6 -0
- package/src/icons/sort-asc.svg +7 -0
- package/src/icons/sort-default.svg +9 -0
- package/src/icons/sort-desc.svg +7 -0
- package/src/icons/star.svg +12 -0
- package/src/icons/status-close.svg +10 -0
- package/src/icons/status-fail.svg +10 -0
- package/src/icons/status-info.svg +8 -0
- package/src/icons/status-success.svg +10 -0
- package/src/icons/status-warning.svg +8 -0
- package/src/icons/success.svg +10 -0
- package/src/icons/transparent.svg +11 -0
- package/src/icons/trash.svg +8 -0
- package/src/icons/tree-down.svg +5 -0
- package/src/icons/undo.svg +7 -0
- package/src/icons/upload.svg +9 -0
- package/src/icons/user-remove.svg +12 -0
- package/src/icons/view.svg +10 -0
- package/src/icons/volume.svg +5 -0
- package/src/icons/warning-mark.svg +13 -0
- package/src/icons/warning.svg +7 -0
- package/src/icons/window-restore.svg +7 -0
- package/src/icons/zoom-in.svg +7 -0
- package/src/icons/zoom-out.svg +7 -0
- package/src/index.tsx +11 -0
- package/src/locale/de-DE.ts +357 -0
- package/src/locale/en-US.ts +346 -0
- package/src/locale/zh-CN.ts +351 -0
- package/src/themes/ang.ts +8 -0
- package/src/themes/antd.ts +44 -0
- package/src/themes/cxd.ts +458 -0
- package/src/themes/dark.ts +16 -0
- package/src/themes/default.ts +5 -0
- package/tsconfig.json +14 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-ui v1.0.0-beta.0
|
|
3
|
+
* Copyright 2018-2022 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { __extends, __awaiter, __generator, __assign, __rest, __decorate, __metadata } from 'tslib';
|
|
7
|
+
import { uncontrollable } from 'uncontrollable';
|
|
8
|
+
import React__default from 'react';
|
|
9
|
+
import Editor, { FormulaEditor } from './Editor.js';
|
|
10
|
+
import { parse, Evaluator, generateIcon, noop, autobind, themeable, localeable } from 'amis-core';
|
|
11
|
+
import ResultBox from '../ResultBox.js';
|
|
12
|
+
import Button from '../Button.js';
|
|
13
|
+
import { Icon } from '../icons.js';
|
|
14
|
+
import FinalModal from '../Modal.js';
|
|
15
|
+
|
|
16
|
+
var FormulaPicker = /** @class */ (function (_super) {
|
|
17
|
+
__extends(FormulaPicker, _super);
|
|
18
|
+
function FormulaPicker(props) {
|
|
19
|
+
var _this = _super.call(this, props) || this;
|
|
20
|
+
_this.state = {
|
|
21
|
+
isOpened: false,
|
|
22
|
+
value: _this.props.value,
|
|
23
|
+
editorValue: _this.props.value,
|
|
24
|
+
isError: false
|
|
25
|
+
};
|
|
26
|
+
_this.props.onRef && _this.props.onRef(_this);
|
|
27
|
+
return _this;
|
|
28
|
+
}
|
|
29
|
+
FormulaPicker.prototype.handleConfirm = function () {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
var value = this.state.value;
|
|
32
|
+
if (this.props.onConfirm) {
|
|
33
|
+
this.props.onConfirm(value);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
(_b = (_a = this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, value);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
FormulaPicker.prototype.renderFormulaValue = function (item) {
|
|
40
|
+
var _a = this.props, allowInput = _a.allowInput, cx = _a.classnames;
|
|
41
|
+
var html = { __html: item.html };
|
|
42
|
+
if (allowInput) {
|
|
43
|
+
return '';
|
|
44
|
+
}
|
|
45
|
+
return (React__default.createElement("div", { className: cx('FormulaPicker-ResultBox'), dangerouslySetInnerHTML: html }));
|
|
46
|
+
};
|
|
47
|
+
FormulaPicker.prototype.handleInputChange = function (value) {
|
|
48
|
+
var _this = this;
|
|
49
|
+
this.setState({ value: value }, function () { return _this.handleConfirm(); });
|
|
50
|
+
};
|
|
51
|
+
FormulaPicker.prototype.handleEditorChange = function (value) {
|
|
52
|
+
this.setState({
|
|
53
|
+
editorValue: value,
|
|
54
|
+
isError: false
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
FormulaPicker.prototype.handleEditorConfirm = function () {
|
|
58
|
+
var _this = this;
|
|
59
|
+
this.props.translate;
|
|
60
|
+
var value = this.state.editorValue;
|
|
61
|
+
var validate = this.validate(value);
|
|
62
|
+
if (validate === true) {
|
|
63
|
+
this.setState({ value: value }, function () {
|
|
64
|
+
_this.close(undefined, function () { return _this.handleConfirm(); });
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
this.setState({ isError: validate });
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
FormulaPicker.prototype.handleClick = function () {
|
|
72
|
+
var _a, _b;
|
|
73
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
74
|
+
var state, _c;
|
|
75
|
+
return __generator(this, function (_d) {
|
|
76
|
+
switch (_d.label) {
|
|
77
|
+
case 0:
|
|
78
|
+
_c = [{}];
|
|
79
|
+
return [4 /*yield*/, ((_b = (_a = this.props).onPickerOpen) === null || _b === void 0 ? void 0 : _b.call(_a, this.props))];
|
|
80
|
+
case 1:
|
|
81
|
+
state = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_d.sent())])), { editorValue: this.props.value, isOpened: true }]);
|
|
82
|
+
this.setState(state);
|
|
83
|
+
return [2 /*return*/];
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
FormulaPicker.prototype.close = function (e, callback) {
|
|
89
|
+
this.setState({
|
|
90
|
+
isOpened: false,
|
|
91
|
+
isError: false
|
|
92
|
+
}, function () {
|
|
93
|
+
if (callback) {
|
|
94
|
+
callback();
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
FormulaPicker.prototype.updateState = function (state) {
|
|
100
|
+
if (state === void 0) { state = {}; }
|
|
101
|
+
state.isOpened; var rest = __rest(state, ["isOpened"]);
|
|
102
|
+
this.setState(__assign(__assign({}, this.state), rest));
|
|
103
|
+
};
|
|
104
|
+
FormulaPicker.prototype.validate = function (value) {
|
|
105
|
+
this.props.translate;
|
|
106
|
+
try {
|
|
107
|
+
var ast = parse(value, {
|
|
108
|
+
evalMode: this.props.evalMode,
|
|
109
|
+
allowFilter: false
|
|
110
|
+
});
|
|
111
|
+
new Evaluator({}).evalute(ast);
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
catch (e) {
|
|
115
|
+
if (/\s(\d+:\d+)$/.test(e.message)) {
|
|
116
|
+
var _a = /\s(\d+:\d+)$/.exec(e.message) || [], position = _a[1];
|
|
117
|
+
return position;
|
|
118
|
+
}
|
|
119
|
+
return e.message;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
FormulaPicker.prototype.render = function () {
|
|
123
|
+
var _a, _b, _c;
|
|
124
|
+
var _d, _e, _f, _g, _h;
|
|
125
|
+
var _j = this.props, cx = _j.classnames, __ = _j.translate, disabled = _j.disabled, allowInput = _j.allowInput, className = _j.className; _j.onChange; _j.size; var borderMode = _j.borderMode, placeholder = _j.placeholder, mode = _j.mode, btnLabel = _j.btnLabel, level = _j.level, btnSize = _j.btnSize, icon = _j.icon, title = _j.title, clearable = _j.clearable, variables = _j.variables, functions = _j.functions, children = _j.children, variableMode = _j.variableMode, rest = __rest(_j, ["classnames", "translate", "disabled", "allowInput", "className", "onChange", "size", "borderMode", "placeholder", "mode", "btnLabel", "level", "btnSize", "icon", "title", "clearable", "variables", "functions", "children", "variableMode"]);
|
|
126
|
+
var _k = this.state, isOpened = _k.isOpened, value = _k.value, editorValue = _k.editorValue, isError = _k.isError;
|
|
127
|
+
var iconElement = generateIcon(cx, icon, 'Icon');
|
|
128
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
129
|
+
children ? (children({
|
|
130
|
+
isOpened: this.state.isOpened,
|
|
131
|
+
onClick: this.handleClick,
|
|
132
|
+
setState: this.updateState
|
|
133
|
+
})) : (React__default.createElement("div", { className: cx('FormulaPicker', className) }, mode === 'button' ? (React__default.createElement(Button, { className: cx('FormulaPicker-action', 'w-full'), level: level, size: btnSize, onClick: this.handleClick },
|
|
134
|
+
iconElement ? (React__default.cloneElement(iconElement, {
|
|
135
|
+
className: cx((_e = (_d = iconElement === null || iconElement === void 0 ? void 0 : iconElement.props) === null || _d === void 0 ? void 0 : _d.className) !== null && _e !== void 0 ? _e : '', 'FormulaPicker-icon', (_a = {},
|
|
136
|
+
_a['is-filled'] = !!value,
|
|
137
|
+
_a))
|
|
138
|
+
})) : (React__default.createElement(Icon, { icon: "function", className: cx('FormulaPicker-icon', 'icon', (_b = {},
|
|
139
|
+
_b['is-filled'] = !!value,
|
|
140
|
+
_b)) })),
|
|
141
|
+
React__default.createElement("span", { className: cx('FormulaPicker-label') }, __(btnLabel || 'FormulaEditor.btnLabel')))) : (React__default.createElement(React__default.Fragment, null,
|
|
142
|
+
React__default.createElement(ResultBox, { className: cx('FormulaPicker-input', isOpened ? 'is-active' : '', !!isError ? 'is-error' : ''), allowInput: allowInput, clearable: clearable, value: value, result: allowInput
|
|
143
|
+
? void 0
|
|
144
|
+
: FormulaEditor.highlightValue(value, variables, this.props.evalMode), itemRender: this.renderFormulaValue, onResultChange: noop, onChange: this.handleInputChange, disabled: disabled, borderMode: borderMode, placeholder: placeholder }),
|
|
145
|
+
React__default.createElement(Button, { className: cx('FormulaPicker-action'), onClick: this.handleClick },
|
|
146
|
+
React__default.createElement(Icon, { icon: "function", className: cx('FormulaPicker-icon', 'icon', (_c = {},
|
|
147
|
+
_c['is-filled'] = !!value,
|
|
148
|
+
_c)) })))))),
|
|
149
|
+
React__default.createElement(FinalModal, { size: "md", closeOnEsc: true, show: this.state.isOpened, onHide: this.close },
|
|
150
|
+
React__default.createElement(FinalModal.Header, { onClose: this.close, className: "font-bold" }, __(title || 'FormulaEditor.title')),
|
|
151
|
+
React__default.createElement(FinalModal.Body, null,
|
|
152
|
+
React__default.createElement(Editor, __assign({}, rest, { variables: (_f = this.state.variables) !== null && _f !== void 0 ? _f : variables, functions: (_g = this.state.functions) !== null && _g !== void 0 ? _g : functions, variableMode: (_h = this.state.variableMode) !== null && _h !== void 0 ? _h : variableMode, value: editorValue, onChange: this.handleEditorChange }))),
|
|
153
|
+
React__default.createElement(FinalModal.Footer, null,
|
|
154
|
+
!!isError ? (React__default.createElement("div", { className: cx('Dialog-info'), key: "info" },
|
|
155
|
+
React__default.createElement("span", { className: cx('Dialog-error') }, __('FormulaEditor.invalidData', { err: isError })))) : null,
|
|
156
|
+
React__default.createElement(Button, { onClick: this.close }, __('cancel')),
|
|
157
|
+
React__default.createElement(Button, { onClick: this.handleEditorConfirm, level: "primary" }, __('confirm'))))));
|
|
158
|
+
};
|
|
159
|
+
FormulaPicker.defaultProps = {
|
|
160
|
+
evalMode: true
|
|
161
|
+
};
|
|
162
|
+
__decorate([
|
|
163
|
+
autobind,
|
|
164
|
+
__metadata("design:type", Function),
|
|
165
|
+
__metadata("design:paramtypes", []),
|
|
166
|
+
__metadata("design:returntype", void 0)
|
|
167
|
+
], FormulaPicker.prototype, "handleConfirm", null);
|
|
168
|
+
__decorate([
|
|
169
|
+
autobind,
|
|
170
|
+
__metadata("design:type", Function),
|
|
171
|
+
__metadata("design:paramtypes", [Object]),
|
|
172
|
+
__metadata("design:returntype", void 0)
|
|
173
|
+
], FormulaPicker.prototype, "renderFormulaValue", null);
|
|
174
|
+
__decorate([
|
|
175
|
+
autobind,
|
|
176
|
+
__metadata("design:type", Function),
|
|
177
|
+
__metadata("design:paramtypes", [String]),
|
|
178
|
+
__metadata("design:returntype", void 0)
|
|
179
|
+
], FormulaPicker.prototype, "handleInputChange", null);
|
|
180
|
+
__decorate([
|
|
181
|
+
autobind,
|
|
182
|
+
__metadata("design:type", Function),
|
|
183
|
+
__metadata("design:paramtypes", [String]),
|
|
184
|
+
__metadata("design:returntype", void 0)
|
|
185
|
+
], FormulaPicker.prototype, "handleEditorChange", null);
|
|
186
|
+
__decorate([
|
|
187
|
+
autobind,
|
|
188
|
+
__metadata("design:type", Function),
|
|
189
|
+
__metadata("design:paramtypes", []),
|
|
190
|
+
__metadata("design:returntype", void 0)
|
|
191
|
+
], FormulaPicker.prototype, "handleEditorConfirm", null);
|
|
192
|
+
__decorate([
|
|
193
|
+
autobind,
|
|
194
|
+
__metadata("design:type", Function),
|
|
195
|
+
__metadata("design:paramtypes", []),
|
|
196
|
+
__metadata("design:returntype", Promise)
|
|
197
|
+
], FormulaPicker.prototype, "handleClick", null);
|
|
198
|
+
__decorate([
|
|
199
|
+
autobind,
|
|
200
|
+
__metadata("design:type", Function),
|
|
201
|
+
__metadata("design:paramtypes", [Object, Function]),
|
|
202
|
+
__metadata("design:returntype", void 0)
|
|
203
|
+
], FormulaPicker.prototype, "close", null);
|
|
204
|
+
__decorate([
|
|
205
|
+
autobind,
|
|
206
|
+
__metadata("design:type", Function),
|
|
207
|
+
__metadata("design:paramtypes", [Object]),
|
|
208
|
+
__metadata("design:returntype", void 0)
|
|
209
|
+
], FormulaPicker.prototype, "updateState", null);
|
|
210
|
+
__decorate([
|
|
211
|
+
autobind,
|
|
212
|
+
__metadata("design:type", Function),
|
|
213
|
+
__metadata("design:paramtypes", [String]),
|
|
214
|
+
__metadata("design:returntype", void 0)
|
|
215
|
+
], FormulaPicker.prototype, "validate", null);
|
|
216
|
+
return FormulaPicker;
|
|
217
|
+
}(React__default.Component));
|
|
218
|
+
var Picker = themeable(localeable(uncontrollable(FormulaPicker, {
|
|
219
|
+
value: 'onChange'
|
|
220
|
+
})));
|
|
221
|
+
|
|
222
|
+
export { FormulaPicker, Picker as default };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/// <reference types="hoist-non-react-statics" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ThemeProps } from 'amis-core';
|
|
4
|
+
import type { VariableItem } from './Editor';
|
|
5
|
+
import type { ItemRenderStates } from '../Selection';
|
|
6
|
+
import type { Option } from '../Select';
|
|
7
|
+
import type { TabsMode } from '../Tabs';
|
|
8
|
+
export interface VariableListProps extends ThemeProps {
|
|
9
|
+
className?: string;
|
|
10
|
+
itemClassName?: string;
|
|
11
|
+
value?: any;
|
|
12
|
+
data: Array<VariableItem>;
|
|
13
|
+
selectMode?: 'list' | 'tree' | 'tabs';
|
|
14
|
+
tabsMode?: TabsMode;
|
|
15
|
+
itemRender?: (option: Option, states: ItemRenderStates) => JSX.Element;
|
|
16
|
+
onSelect?: (item: VariableItem) => void;
|
|
17
|
+
}
|
|
18
|
+
declare function VariableList(props: VariableListProps): JSX.Element;
|
|
19
|
+
declare const _default: {
|
|
20
|
+
new (props: Omit<VariableListProps, keyof ThemeProps> & import("amis-core/dist/theme").ThemeOutterProps): {
|
|
21
|
+
ref: any;
|
|
22
|
+
childRef(ref: any): void;
|
|
23
|
+
getWrappedInstance(): any;
|
|
24
|
+
render(): JSX.Element;
|
|
25
|
+
context: any;
|
|
26
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<VariableListProps, keyof ThemeProps> & import("amis-core/dist/theme").ThemeOutterProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
27
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
28
|
+
readonly props: Readonly<Omit<VariableListProps, keyof ThemeProps> & import("amis-core/dist/theme").ThemeOutterProps> & Readonly<{
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
}>;
|
|
31
|
+
state: Readonly<{}>;
|
|
32
|
+
refs: {
|
|
33
|
+
[key: string]: React.ReactInstance;
|
|
34
|
+
};
|
|
35
|
+
componentDidMount?(): void;
|
|
36
|
+
shouldComponentUpdate?(nextProps: Readonly<Omit<VariableListProps, keyof ThemeProps> & import("amis-core/dist/theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
37
|
+
componentWillUnmount?(): void;
|
|
38
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
39
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<VariableListProps, keyof ThemeProps> & import("amis-core/dist/theme").ThemeOutterProps>, prevState: Readonly<{}>): any;
|
|
40
|
+
componentDidUpdate?(prevProps: Readonly<Omit<VariableListProps, keyof ThemeProps> & import("amis-core/dist/theme").ThemeOutterProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
41
|
+
componentWillMount?(): void;
|
|
42
|
+
UNSAFE_componentWillMount?(): void;
|
|
43
|
+
componentWillReceiveProps?(nextProps: Readonly<Omit<VariableListProps, keyof ThemeProps> & import("amis-core/dist/theme").ThemeOutterProps>, nextContext: any): void;
|
|
44
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<VariableListProps, keyof ThemeProps> & import("amis-core/dist/theme").ThemeOutterProps>, nextContext: any): void;
|
|
45
|
+
componentWillUpdate?(nextProps: Readonly<Omit<VariableListProps, keyof ThemeProps> & import("amis-core/dist/theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
46
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<VariableListProps, keyof ThemeProps> & import("amis-core/dist/theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
47
|
+
};
|
|
48
|
+
displayName: string;
|
|
49
|
+
contextType: React.Context<string>;
|
|
50
|
+
ComposedComponent: React.ComponentType<typeof VariableList>;
|
|
51
|
+
} & import("hoist-non-react-statics").NonReactStatics<typeof VariableList, {}> & {
|
|
52
|
+
ComposedComponent: typeof VariableList;
|
|
53
|
+
};
|
|
54
|
+
export default _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-ui v1.0.0-beta.0
|
|
3
|
+
* Copyright 2018-2022 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React__default from 'react';
|
|
7
|
+
import { themeable, findTree } from 'amis-core';
|
|
8
|
+
import ListSelection from '../GroupedSelection.js';
|
|
9
|
+
import ThemedTabs, { Tab } from '../Tabs.js';
|
|
10
|
+
import TreeSelection from '../TreeSelection.js';
|
|
11
|
+
import SearchBox from '../SearchBox.js';
|
|
12
|
+
|
|
13
|
+
function VariableList(props) {
|
|
14
|
+
var list = props.data, className = props.className, cx = props.classnames, _a = props.tabsMode, tabsMode = _a === void 0 ? 'line' : _a, themePrefix = props.classPrefix, itemClassName = props.itemClassName, selectMode = props.selectMode, onSelect = props.onSelect;
|
|
15
|
+
var _b = React__default.useState(list), filterVars = _b[0], setFilterVars = _b[1];
|
|
16
|
+
var classPrefix = "".concat(themePrefix, "FormulaEditor-VariableList");
|
|
17
|
+
var itemRender = props.itemRender && typeof props.itemRender === 'function'
|
|
18
|
+
? props.itemRender
|
|
19
|
+
: function (option, states) {
|
|
20
|
+
return (React__default.createElement("span", { className: cx("".concat(classPrefix, "-item"), itemClassName) },
|
|
21
|
+
React__default.createElement("label", null, option.label),
|
|
22
|
+
(option === null || option === void 0 ? void 0 : option.tag) ? (React__default.createElement("span", { className: cx("".concat(classPrefix, "-item-tag")) }, option.tag)) : null));
|
|
23
|
+
};
|
|
24
|
+
function onSearch(term) {
|
|
25
|
+
var tree = findTree(list, function (i) { return ~i.label.indexOf(term); });
|
|
26
|
+
setFilterVars(!term ? list : tree ? [tree] : list);
|
|
27
|
+
}
|
|
28
|
+
function renderSearchBox() {
|
|
29
|
+
return (React__default.createElement("div", { className: cx('FormulaEditor-VariableList-searchBox') },
|
|
30
|
+
React__default.createElement(SearchBox, { mini: false, onSearch: onSearch })));
|
|
31
|
+
}
|
|
32
|
+
return (React__default.createElement("div", { className: cx(className, 'FormulaEditor-VariableList', selectMode && "FormulaEditor-VariableList-".concat(selectMode)) }, selectMode === 'tabs' ? (React__default.createElement(ThemedTabs, { tabsMode: tabsMode, className: cx("".concat(classPrefix, "-base ").concat(classPrefix, "-tabs")) }, filterVars.map(function (item, index) { return (React__default.createElement(Tab, { className: cx("".concat(classPrefix, "-tab")), eventKey: index, key: index, title: item.label },
|
|
33
|
+
React__default.createElement(VariableList, { classnames: cx, classPrefix: "".concat(classPrefix, "-sub-"), className: cx("".concat(classPrefix, "-sub")), itemRender: itemRender, selectMode: item.selectMode, data: item.children, onSelect: onSelect }))); }))) : selectMode === 'tree' ? (React__default.createElement("div", { className: cx('FormulaEditor-VariableList-body') },
|
|
34
|
+
renderSearchBox(),
|
|
35
|
+
React__default.createElement(TreeSelection, { itemRender: itemRender, className: cx("".concat(classPrefix, "-base"), 'is-scrollable'), multiple: false, options: filterVars, onChange: function (item) { return onSelect === null || onSelect === void 0 ? void 0 : onSelect(item); } }))) : (React__default.createElement("div", { className: cx('FormulaEditor-VariableList-body') },
|
|
36
|
+
renderSearchBox(),
|
|
37
|
+
React__default.createElement(ListSelection, { itemRender: itemRender, className: cx("".concat(classPrefix, "-base"), 'is-scrollable'), multiple: false, options: filterVars, onChange: function (item) { return onSelect === null || onSelect === void 0 ? void 0 : onSelect(item); } })))));
|
|
38
|
+
}
|
|
39
|
+
var VariableList$1 = themeable(VariableList);
|
|
40
|
+
|
|
41
|
+
export { VariableList$1 as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file 扩展 codemirror
|
|
3
|
+
*/
|
|
4
|
+
import type CodeMirror from 'codemirror';
|
|
5
|
+
import type { FormulaEditorProps, VariableItem } from './Editor';
|
|
6
|
+
export declare function editorFactory(dom: HTMLElement, cm: typeof CodeMirror, props: any): CodeMirror.Editor;
|
|
7
|
+
export declare class FormulaPlugin {
|
|
8
|
+
readonly editor: CodeMirror.Editor;
|
|
9
|
+
readonly cm: typeof CodeMirror;
|
|
10
|
+
readonly getProps: () => FormulaEditorProps;
|
|
11
|
+
constructor(editor: CodeMirror.Editor, cm: typeof CodeMirror, getProps: () => FormulaEditorProps);
|
|
12
|
+
autoMarkText(): void;
|
|
13
|
+
computedBracesPosition(exp: string): {
|
|
14
|
+
begin: number;
|
|
15
|
+
end: number;
|
|
16
|
+
}[];
|
|
17
|
+
checkStrIsInBraces([from, to]: number[], braces: {
|
|
18
|
+
begin: number;
|
|
19
|
+
end: number;
|
|
20
|
+
}[]): boolean;
|
|
21
|
+
insertBraces(originFrom: CodeMirror.Position, originTo: CodeMirror.Position): void;
|
|
22
|
+
insertContent(value: any, type?: 'variable' | 'func'): void;
|
|
23
|
+
markText(from: CodeMirror.Position, to: CodeMirror.Position, label: string, className?: string): void;
|
|
24
|
+
autoMark(variables: Array<VariableItem>): void;
|
|
25
|
+
dispose(): void;
|
|
26
|
+
validate(): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-ui v1.0.0-beta.0
|
|
3
|
+
* Copyright 2018-2022 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { eachTree } from 'amis-core';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @file 扩展 codemirror
|
|
10
|
+
*/
|
|
11
|
+
function editorFactory(dom, cm, props) {
|
|
12
|
+
registerLaunguageMode(cm);
|
|
13
|
+
return cm(dom, {
|
|
14
|
+
value: props.value || '',
|
|
15
|
+
autofocus: true,
|
|
16
|
+
mode: props.evalMode ? 'text/formula' : 'text/formula-template'
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
var FormulaPlugin = /** @class */ (function () {
|
|
20
|
+
function FormulaPlugin(editor, cm, getProps) {
|
|
21
|
+
this.editor = editor;
|
|
22
|
+
this.cm = cm;
|
|
23
|
+
this.getProps = getProps;
|
|
24
|
+
// editor.on('change', this.autoMarkText);
|
|
25
|
+
this.autoMarkText();
|
|
26
|
+
}
|
|
27
|
+
FormulaPlugin.prototype.autoMarkText = function () {
|
|
28
|
+
var _a = this.getProps(); _a.functions; var variables = _a.variables, value = _a.value;
|
|
29
|
+
if (value) {
|
|
30
|
+
// todo functions 也需要自动替换
|
|
31
|
+
this.autoMark(variables);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
// 计算 `${`、`}` 括号的位置,如 ${a}+${b}, 结果是 [ { from: 0, to: 3 }, { from: 5, to: 8 } ]
|
|
35
|
+
FormulaPlugin.prototype.computedBracesPosition = function (exp) {
|
|
36
|
+
var braces = [];
|
|
37
|
+
exp === null || exp === void 0 ? void 0 : exp.replace(/\$\{/g, function (val, offset) {
|
|
38
|
+
if (val) {
|
|
39
|
+
var charArr = exp.slice(offset + val.length).split('');
|
|
40
|
+
var cache = ['${'];
|
|
41
|
+
for (var index = 0; index < charArr.length; index++) {
|
|
42
|
+
var char = charArr[index];
|
|
43
|
+
if (char === '$' && charArr[index + 1] === '{') {
|
|
44
|
+
cache.push('${');
|
|
45
|
+
}
|
|
46
|
+
else if (char === '}') {
|
|
47
|
+
cache.pop();
|
|
48
|
+
}
|
|
49
|
+
if (cache.length === 0) {
|
|
50
|
+
braces.push({ begin: offset + 2, end: index + offset + 2 });
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return '';
|
|
56
|
+
});
|
|
57
|
+
return braces;
|
|
58
|
+
};
|
|
59
|
+
// 判断字符串是否在 ${} 中
|
|
60
|
+
FormulaPlugin.prototype.checkStrIsInBraces = function (_a, braces) {
|
|
61
|
+
var from = _a[0], to = _a[1];
|
|
62
|
+
var isIn = false;
|
|
63
|
+
if (braces.length) {
|
|
64
|
+
for (var index = 0; index < braces.length; index++) {
|
|
65
|
+
var brace = braces[index];
|
|
66
|
+
if (from > brace.begin && to <= brace.end) {
|
|
67
|
+
isIn = true;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return isIn;
|
|
73
|
+
};
|
|
74
|
+
FormulaPlugin.prototype.insertBraces = function (originFrom, originTo) {
|
|
75
|
+
var str = this.editor.getValue();
|
|
76
|
+
var braces = this.computedBracesPosition(str);
|
|
77
|
+
if (!this.checkStrIsInBraces([originFrom.ch, originTo.ch], braces)) {
|
|
78
|
+
this.editor.setCursor({
|
|
79
|
+
line: originFrom.line,
|
|
80
|
+
ch: originFrom.ch
|
|
81
|
+
});
|
|
82
|
+
this.editor.replaceSelection('${');
|
|
83
|
+
this.editor.setCursor({
|
|
84
|
+
line: originTo.line,
|
|
85
|
+
ch: originTo.ch + 2
|
|
86
|
+
});
|
|
87
|
+
this.editor.replaceSelection('}');
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
FormulaPlugin.prototype.insertContent = function (value, type) {
|
|
91
|
+
var from = this.editor.getCursor();
|
|
92
|
+
var evalMode = this.getProps().evalMode;
|
|
93
|
+
if (type === 'variable') {
|
|
94
|
+
this.editor.replaceSelection(value.key);
|
|
95
|
+
var to = this.editor.getCursor();
|
|
96
|
+
this.markText(from, to, value.name, 'cm-field');
|
|
97
|
+
!evalMode && this.insertBraces(from, to);
|
|
98
|
+
}
|
|
99
|
+
else if (type === 'func') {
|
|
100
|
+
this.editor.replaceSelection("".concat(value, "()"));
|
|
101
|
+
var to = this.editor.getCursor();
|
|
102
|
+
this.markText(from, {
|
|
103
|
+
line: to.line,
|
|
104
|
+
ch: to.ch - 2
|
|
105
|
+
}, value, 'cm-func');
|
|
106
|
+
this.editor.setCursor({
|
|
107
|
+
line: to.line,
|
|
108
|
+
ch: to.ch - 1
|
|
109
|
+
});
|
|
110
|
+
if (!evalMode) {
|
|
111
|
+
this.insertBraces(from, to);
|
|
112
|
+
this.editor.setCursor({
|
|
113
|
+
line: to.line,
|
|
114
|
+
ch: to.ch + 1
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else if (typeof value === 'string') {
|
|
119
|
+
this.editor.replaceSelection(value);
|
|
120
|
+
}
|
|
121
|
+
this.editor.focus();
|
|
122
|
+
};
|
|
123
|
+
FormulaPlugin.prototype.markText = function (from, to, label, className) {
|
|
124
|
+
if (className === void 0) { className = 'cm-func'; }
|
|
125
|
+
var text = document.createElement('span');
|
|
126
|
+
text.className = className;
|
|
127
|
+
text.innerText = label;
|
|
128
|
+
this.editor.markText(from, to, {
|
|
129
|
+
atomic: true,
|
|
130
|
+
replacedWith: text
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
FormulaPlugin.prototype.autoMark = function (variables) {
|
|
134
|
+
var _this = this;
|
|
135
|
+
if (!Array.isArray(variables) || !variables.length) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
var varMap = {};
|
|
139
|
+
eachTree(variables, function (item) {
|
|
140
|
+
if (item.value) {
|
|
141
|
+
var key = item.value;
|
|
142
|
+
varMap[key] = item.label;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
var vars = Object.keys(varMap).sort(function (a, b) { return b.length - a.length; });
|
|
146
|
+
var editor = this.editor;
|
|
147
|
+
var lines = editor.lineCount();
|
|
148
|
+
var _loop_1 = function (line) {
|
|
149
|
+
var content = editor.getLine(line);
|
|
150
|
+
// 标记方法调用
|
|
151
|
+
content.replace(/([A-Z]+)\s*\(/g, function (_, func, pos) {
|
|
152
|
+
_this.markText({
|
|
153
|
+
line: line,
|
|
154
|
+
ch: pos
|
|
155
|
+
}, {
|
|
156
|
+
line: line,
|
|
157
|
+
ch: pos + func.length
|
|
158
|
+
}, func, 'cm-func');
|
|
159
|
+
return _;
|
|
160
|
+
});
|
|
161
|
+
// 标记变量
|
|
162
|
+
vars.forEach(function (v) {
|
|
163
|
+
var from = 0;
|
|
164
|
+
var idx = -1;
|
|
165
|
+
while (~(idx = content.indexOf(v, from))) {
|
|
166
|
+
_this.markText({
|
|
167
|
+
line: line,
|
|
168
|
+
ch: idx
|
|
169
|
+
}, {
|
|
170
|
+
line: line,
|
|
171
|
+
ch: idx + v.length
|
|
172
|
+
}, varMap[v], 'cm-field');
|
|
173
|
+
from = idx + v.length;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
for (var line = 0; line < lines; line++) {
|
|
178
|
+
_loop_1(line);
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
FormulaPlugin.prototype.dispose = function () { };
|
|
182
|
+
FormulaPlugin.prototype.validate = function () { };
|
|
183
|
+
return FormulaPlugin;
|
|
184
|
+
}());
|
|
185
|
+
var modeRegisted = false;
|
|
186
|
+
function registerLaunguageMode(cm) {
|
|
187
|
+
if (modeRegisted) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
modeRegisted = true;
|
|
191
|
+
// 对应 evalMode
|
|
192
|
+
cm.defineMode('formula', function (config, parserConfig) {
|
|
193
|
+
var formula = cm.getMode(config, 'javascript');
|
|
194
|
+
if (!parserConfig || !parserConfig.base)
|
|
195
|
+
return formula;
|
|
196
|
+
return cm.multiplexingMode(cm.getMode(config, parserConfig.base), {
|
|
197
|
+
open: '${',
|
|
198
|
+
close: '}',
|
|
199
|
+
mode: formula
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
cm.defineMIME('text/formula', { name: 'formula' });
|
|
203
|
+
cm.defineMIME('text/formula-template', { name: 'formula', base: 'htmlmixed' });
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export { FormulaPlugin, editorFactory };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Icon
|
|
3
|
+
* @description
|
|
4
|
+
* @author fex
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import CloseIcon from '../icons/close.svg';
|
|
8
|
+
import UnDoIcon from '../icons/undo.svg';
|
|
9
|
+
import ReDoIcon from '../icons/redo.svg';
|
|
10
|
+
import EnterIcon from '../icons/enter.svg';
|
|
11
|
+
import VolumeIcon from '../icons/volume.svg';
|
|
12
|
+
import MuteIcon from '../icons/mute.svg';
|
|
13
|
+
import PlayIcon from '../icons/play.svg';
|
|
14
|
+
import PauseIcon from '../icons/pause.svg';
|
|
15
|
+
import LeftArrowIcon from '../icons/left-arrow.svg';
|
|
16
|
+
import RightArrowIcon from '../icons/right-arrow.svg';
|
|
17
|
+
import CheckIcon from '../icons/check.svg';
|
|
18
|
+
import PlusIcon from '../icons/plus.svg';
|
|
19
|
+
import MinusIcon from '../icons/minus.svg';
|
|
20
|
+
import PencilIcon from '../icons/pencil.svg';
|
|
21
|
+
import ReloadIcon from '../icons/reload.svg';
|
|
22
|
+
import FunctionIcon from '../icons/function.svg';
|
|
23
|
+
import InputClearIcon from '../icons/input-clear.svg';
|
|
24
|
+
import MenuIcon from '../icons/menu.svg';
|
|
25
|
+
import UserRemove from '../icons/user-remove.svg';
|
|
26
|
+
import Role from '../icons/role.svg';
|
|
27
|
+
import Department from '../icons/department.svg';
|
|
28
|
+
import Post from '../icons/post.svg';
|
|
29
|
+
export declare const closeIcon: JSX.Element;
|
|
30
|
+
export declare const unDoIcon: JSX.Element;
|
|
31
|
+
export declare const reDoIcon: JSX.Element;
|
|
32
|
+
export declare const enterIcon: JSX.Element;
|
|
33
|
+
export declare const volumeIcon: JSX.Element;
|
|
34
|
+
export declare const muteIcon: JSX.Element;
|
|
35
|
+
export declare const playIcon: JSX.Element;
|
|
36
|
+
export declare const pauseIcon: JSX.Element;
|
|
37
|
+
export declare const leftArrowIcon: JSX.Element;
|
|
38
|
+
export declare const rightArrowIcon: JSX.Element;
|
|
39
|
+
export declare function getIcon(key: string): React.ReactType<{}>;
|
|
40
|
+
export declare function hasIcon(iconName: string): boolean;
|
|
41
|
+
export declare function registerIcon(key: string, component: React.ReactType<{}>): void;
|
|
42
|
+
export declare function Icon({ icon, className, ...rest }: {
|
|
43
|
+
icon: string;
|
|
44
|
+
} & React.ComponentProps<any>): JSX.Element;
|
|
45
|
+
export { InputClearIcon, CloseIcon, UnDoIcon, ReDoIcon, EnterIcon, VolumeIcon, MuteIcon, PlayIcon, PauseIcon, ReloadIcon, LeftArrowIcon, RightArrowIcon, CheckIcon, PlusIcon, MinusIcon, PencilIcon, FunctionIcon, MenuIcon, UserRemove, Role, Department, Post };
|