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,1038 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-ui v1.0.0-beta.0
|
|
3
|
+
* Copyright 2018-2022 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { __extends, __spreadArray, __assign } from 'tslib';
|
|
7
|
+
import React__default from 'react';
|
|
8
|
+
import moment from 'moment';
|
|
9
|
+
import { findDOMNode } from 'react-dom';
|
|
10
|
+
import { Icon } from './icons.js';
|
|
11
|
+
import Overlay from './Overlay.js';
|
|
12
|
+
import Calendar from './calendar/Calendar.js';
|
|
13
|
+
import PopOver from './PopOver.js';
|
|
14
|
+
import PopUp from './PopUp.js';
|
|
15
|
+
import { noop, isMobile, ucFirst, themeable, localeable } from 'amis-core';
|
|
16
|
+
import CalendarMobile from './CalendarMobile.js';
|
|
17
|
+
import Input from './Input.js';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @file DateRangePicker
|
|
21
|
+
* @description 自定义日期范围时间选择器组件
|
|
22
|
+
* @author fex
|
|
23
|
+
*/
|
|
24
|
+
var availableRanges = {
|
|
25
|
+
'today': {
|
|
26
|
+
label: 'Date.today',
|
|
27
|
+
startDate: function (now) {
|
|
28
|
+
return now.startOf('day');
|
|
29
|
+
},
|
|
30
|
+
endDate: function (now) {
|
|
31
|
+
return now;
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
'yesterday': {
|
|
35
|
+
label: 'Date.yesterday',
|
|
36
|
+
startDate: function (now) {
|
|
37
|
+
return now.add(-1, 'days').startOf('day');
|
|
38
|
+
},
|
|
39
|
+
endDate: function (now) {
|
|
40
|
+
return now.add(-1, 'days').endOf('day');
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
'tomorrow': {
|
|
44
|
+
label: 'Date.tomorrow',
|
|
45
|
+
startDate: function (now) {
|
|
46
|
+
return now.add(1, 'days').startOf('day');
|
|
47
|
+
},
|
|
48
|
+
endDate: function (now) {
|
|
49
|
+
return now.add(1, 'days').endOf('day');
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
// 兼容一下错误的用法
|
|
53
|
+
'1daysago': {
|
|
54
|
+
label: 'DateRange.1daysago',
|
|
55
|
+
startDate: function (now) {
|
|
56
|
+
return now.add(-1, 'days');
|
|
57
|
+
},
|
|
58
|
+
endDate: function (now) {
|
|
59
|
+
return now;
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
'1dayago': {
|
|
63
|
+
label: 'DateRange.1daysago',
|
|
64
|
+
startDate: function (now) {
|
|
65
|
+
return now.add(-1, 'days');
|
|
66
|
+
},
|
|
67
|
+
endDate: function (now) {
|
|
68
|
+
return now;
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
'7daysago': {
|
|
72
|
+
label: 'DateRange.7daysago',
|
|
73
|
+
startDate: function (now) {
|
|
74
|
+
return now.add(-7, 'days').startOf('day');
|
|
75
|
+
},
|
|
76
|
+
endDate: function (now) {
|
|
77
|
+
return now.add(-1, 'days').endOf('day');
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
'30daysago': {
|
|
81
|
+
label: 'DateRange.30daysago',
|
|
82
|
+
startDate: function (now) {
|
|
83
|
+
return now.add(-30, 'days').startOf('day');
|
|
84
|
+
},
|
|
85
|
+
endDate: function (now) {
|
|
86
|
+
return now.add(-1, 'days').endOf('day');
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
'90daysago': {
|
|
90
|
+
label: 'DateRange.90daysago',
|
|
91
|
+
startDate: function (now) {
|
|
92
|
+
return now.add(-90, 'days').startOf('day');
|
|
93
|
+
},
|
|
94
|
+
endDate: function (now) {
|
|
95
|
+
return now.add(-1, 'days').endOf('day');
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
'prevweek': {
|
|
99
|
+
label: 'DateRange.lastWeek',
|
|
100
|
+
startDate: function (now) {
|
|
101
|
+
return now.startOf('week').add(-1, 'weeks');
|
|
102
|
+
},
|
|
103
|
+
endDate: function (now) {
|
|
104
|
+
return now.startOf('week').add(-1, 'days').endOf('day');
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
'thisweek': {
|
|
108
|
+
label: 'DateRange.thisWeek',
|
|
109
|
+
startDate: function (now) {
|
|
110
|
+
return now.startOf('week');
|
|
111
|
+
},
|
|
112
|
+
endDate: function (now) {
|
|
113
|
+
return now.endOf('week');
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
'thismonth': {
|
|
117
|
+
label: 'DateRange.thisMonth',
|
|
118
|
+
startDate: function (now) {
|
|
119
|
+
return now.startOf('month');
|
|
120
|
+
},
|
|
121
|
+
endDate: function (now) {
|
|
122
|
+
return now.endOf('month');
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
'thisquarter': {
|
|
126
|
+
label: 'DateRange.thisQuarter',
|
|
127
|
+
startDate: function (now) {
|
|
128
|
+
return now.startOf('quarter');
|
|
129
|
+
},
|
|
130
|
+
endDate: function (now) {
|
|
131
|
+
return now.endOf('quarter');
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
'prevmonth': {
|
|
135
|
+
label: 'DateRange.lastMonth',
|
|
136
|
+
startDate: function (now) {
|
|
137
|
+
return now.startOf('month').add(-1, 'month');
|
|
138
|
+
},
|
|
139
|
+
endDate: function (now) {
|
|
140
|
+
return now.startOf('month').add(-1, 'day').endOf('day');
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
'prevquarter': {
|
|
144
|
+
label: 'DateRange.lastQuarter',
|
|
145
|
+
startDate: function (now) {
|
|
146
|
+
return now.startOf('quarter').add(-1, 'quarter');
|
|
147
|
+
},
|
|
148
|
+
endDate: function (now) {
|
|
149
|
+
return now.startOf('quarter').add(-1, 'day').endOf('day');
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
'thisyear': {
|
|
153
|
+
label: 'DateRange.thisYear',
|
|
154
|
+
startDate: function (now) {
|
|
155
|
+
return now.startOf('year');
|
|
156
|
+
},
|
|
157
|
+
endDate: function (now) {
|
|
158
|
+
return now.endOf('year');
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
// 兼容一下之前的用法 'lastYear'
|
|
162
|
+
'prevyear': {
|
|
163
|
+
label: 'DateRange.lastYear',
|
|
164
|
+
startDate: function (now) {
|
|
165
|
+
return now.startOf('year').add(-1, 'year');
|
|
166
|
+
},
|
|
167
|
+
endDate: function (now) {
|
|
168
|
+
return now.endOf('year').add(-1, 'year').endOf('day');
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
'lastYear': {
|
|
172
|
+
label: 'DateRange.lastYear',
|
|
173
|
+
startDate: function (now) {
|
|
174
|
+
return now.startOf('year').add(-1, 'year');
|
|
175
|
+
},
|
|
176
|
+
endDate: function (now) {
|
|
177
|
+
return now.endOf('year').add(-1, 'year').endOf('day');
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
var advancedRanges = [
|
|
182
|
+
{
|
|
183
|
+
regexp: /^(\d+)hoursago$/,
|
|
184
|
+
resolve: function (__, _, hours) {
|
|
185
|
+
return {
|
|
186
|
+
label: __('DateRange.hoursago', { hours: hours }),
|
|
187
|
+
startDate: function (now) {
|
|
188
|
+
return now.add(-hours, 'hours').startOf('hour');
|
|
189
|
+
},
|
|
190
|
+
endDate: function (now) {
|
|
191
|
+
return now.add(-1, 'hours').endOf('hours');
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
regexp: /^(\d+)hourslater$/,
|
|
198
|
+
resolve: function (__, _, hours) {
|
|
199
|
+
return {
|
|
200
|
+
label: __('DateRange.hourslater', { hours: hours }),
|
|
201
|
+
startDate: function (now) {
|
|
202
|
+
return now.startOf('hour');
|
|
203
|
+
},
|
|
204
|
+
endDate: function (now) {
|
|
205
|
+
return now.add(hours, 'hours').endOf('hour');
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
regexp: /^(\d+)daysago$/,
|
|
212
|
+
resolve: function (__, _, days) {
|
|
213
|
+
return {
|
|
214
|
+
label: __('DateRange.daysago', { days: days }),
|
|
215
|
+
startDate: function (now) {
|
|
216
|
+
return now.add(-days, 'days').startOf('day');
|
|
217
|
+
},
|
|
218
|
+
endDate: function (now) {
|
|
219
|
+
return now.add(-1, 'days').endOf('day');
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
regexp: /^(\d+)dayslater$/,
|
|
226
|
+
resolve: function (__, _, days) {
|
|
227
|
+
return {
|
|
228
|
+
label: __('DateRange.dayslater', { days: days }),
|
|
229
|
+
startDate: function (now) {
|
|
230
|
+
return now.startOf('day');
|
|
231
|
+
},
|
|
232
|
+
endDate: function (now) {
|
|
233
|
+
return now.add(days, 'days').endOf('day');
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
regexp: /^(\d+)weeksago$/,
|
|
240
|
+
resolve: function (__, _, weeks) {
|
|
241
|
+
return {
|
|
242
|
+
label: __('DateRange.weeksago', { weeks: weeks }),
|
|
243
|
+
startDate: function (now) {
|
|
244
|
+
return now.startOf('week').add(-weeks, 'weeks');
|
|
245
|
+
},
|
|
246
|
+
endDate: function (now) {
|
|
247
|
+
return now.startOf('week').add(-1, 'days').endOf('day');
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
regexp: /^(\d+)weekslater$/,
|
|
254
|
+
resolve: function (__, _, weeks) {
|
|
255
|
+
return {
|
|
256
|
+
label: __('DateRange.weekslater', { weeks: weeks }),
|
|
257
|
+
startDate: function (now) {
|
|
258
|
+
return now.startOf('week');
|
|
259
|
+
},
|
|
260
|
+
endDate: function (now) {
|
|
261
|
+
return now.startOf('week').add(weeks, 'weeks').endOf('day');
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
regexp: /^(\d+)monthsago$/,
|
|
268
|
+
resolve: function (__, _, months) {
|
|
269
|
+
return {
|
|
270
|
+
label: __('DateRange.monthsago', { months: months }),
|
|
271
|
+
startDate: function (now) {
|
|
272
|
+
return now.startOf('months').add(-months, 'months');
|
|
273
|
+
},
|
|
274
|
+
endDate: function (now) {
|
|
275
|
+
return now.startOf('month').add(-1, 'days').endOf('day');
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
regexp: /^(\d+)monthslater$/,
|
|
282
|
+
resolve: function (__, _, months) {
|
|
283
|
+
return {
|
|
284
|
+
label: __('DateRange.monthslater', { months: months }),
|
|
285
|
+
startDate: function (now) {
|
|
286
|
+
return now.startOf('month');
|
|
287
|
+
},
|
|
288
|
+
endDate: function (now) {
|
|
289
|
+
return now.startOf('month').add(months, 'months').endOf('day');
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
regexp: /^(\d+)quartersago$/,
|
|
296
|
+
resolve: function (__, _, quarters) {
|
|
297
|
+
return {
|
|
298
|
+
label: __('DateRange.quartersago', { quarters: quarters }),
|
|
299
|
+
startDate: function (now) {
|
|
300
|
+
return now.startOf('quarters').add(-quarters, 'quarters');
|
|
301
|
+
},
|
|
302
|
+
endDate: function (now) {
|
|
303
|
+
return now.startOf('quarter').add(-1, 'days').endOf('day');
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
regexp: /^(\d+)quarterslater$/,
|
|
310
|
+
resolve: function (__, _, quarters) {
|
|
311
|
+
return {
|
|
312
|
+
label: __('DateRange.quarterslater', { quarters: quarters }),
|
|
313
|
+
startDate: function (now) {
|
|
314
|
+
return now.startOf('quarter');
|
|
315
|
+
},
|
|
316
|
+
endDate: function (now) {
|
|
317
|
+
return now.startOf('quarter').add(quarters, 'quarters').endOf('day');
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
regexp: /^(\d+)yearsago$/,
|
|
324
|
+
resolve: function (__, _, years) {
|
|
325
|
+
return {
|
|
326
|
+
label: __('DateRange.yearsago', { years: years }),
|
|
327
|
+
startDate: function (now) {
|
|
328
|
+
return now.startOf('years').add(-years, 'years');
|
|
329
|
+
},
|
|
330
|
+
endDate: function (now) {
|
|
331
|
+
return now.startOf('year').add(-1, 'days').endOf('day');
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
regexp: /^(\d+)yearslater$/,
|
|
338
|
+
resolve: function (__, _, years) {
|
|
339
|
+
return {
|
|
340
|
+
label: __('DateRange.yearslater', { years: years }),
|
|
341
|
+
startDate: function (now) {
|
|
342
|
+
return now.startOf('year');
|
|
343
|
+
},
|
|
344
|
+
endDate: function (now) {
|
|
345
|
+
return now.startOf('year').add(years, 'years').endOf('day');
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
];
|
|
351
|
+
var DateRangePicker = /** @class */ (function (_super) {
|
|
352
|
+
__extends(DateRangePicker, _super);
|
|
353
|
+
function DateRangePicker(props) {
|
|
354
|
+
var _this = _super.call(this, props) || this;
|
|
355
|
+
// 是否是第一次点击,如果是第一次点击就可以点任意地址
|
|
356
|
+
_this.isFirstClick = true;
|
|
357
|
+
_this.nextMonth = moment().add(1, 'months');
|
|
358
|
+
_this.startInputRef = React__default.createRef();
|
|
359
|
+
_this.endInputRef = React__default.createRef();
|
|
360
|
+
_this.calendarRef = React__default.createRef();
|
|
361
|
+
_this.open = _this.open.bind(_this);
|
|
362
|
+
_this.openStart = _this.openStart.bind(_this);
|
|
363
|
+
_this.openEnd = _this.openEnd.bind(_this);
|
|
364
|
+
_this.close = _this.close.bind(_this);
|
|
365
|
+
_this.startInputChange = _this.startInputChange.bind(_this);
|
|
366
|
+
_this.endInputChange = _this.endInputChange.bind(_this);
|
|
367
|
+
_this.handleDateChange = _this.handleDateChange.bind(_this);
|
|
368
|
+
_this.handleStartDateChange = _this.handleStartDateChange.bind(_this);
|
|
369
|
+
_this.handeleEndDateChange = _this.handeleEndDateChange.bind(_this);
|
|
370
|
+
_this.handleTimeStartChange = _this.handleTimeStartChange.bind(_this);
|
|
371
|
+
_this.handleTimeEndChange = _this.handleTimeEndChange.bind(_this);
|
|
372
|
+
_this.handleFocus = _this.handleFocus.bind(_this);
|
|
373
|
+
_this.handleBlur = _this.handleBlur.bind(_this);
|
|
374
|
+
_this.checkStartIsValidDate = _this.checkStartIsValidDate.bind(_this);
|
|
375
|
+
_this.checkEndIsValidDate = _this.checkEndIsValidDate.bind(_this);
|
|
376
|
+
_this.confirm = _this.confirm.bind(_this);
|
|
377
|
+
_this.clearValue = _this.clearValue.bind(_this);
|
|
378
|
+
_this.dom = React__default.createRef();
|
|
379
|
+
_this.handleClick = _this.handleClick.bind(_this);
|
|
380
|
+
_this.handleKeyPress = _this.handleKeyPress.bind(_this);
|
|
381
|
+
_this.handlePopOverClick = _this.handlePopOverClick.bind(_this);
|
|
382
|
+
_this.renderDay = _this.renderDay.bind(_this);
|
|
383
|
+
_this.renderMonth = _this.renderMonth.bind(_this);
|
|
384
|
+
_this.renderQuarter = _this.renderQuarter.bind(_this);
|
|
385
|
+
_this.renderYear = _this.renderYear.bind(_this);
|
|
386
|
+
_this.handleMobileChange = _this.handleMobileChange.bind(_this);
|
|
387
|
+
_this.handleOutClick = _this.handleOutClick.bind(_this);
|
|
388
|
+
var _a = _this.props, format = _a.format, joinValues = _a.joinValues, delimiter = _a.delimiter, value = _a.value, inputFormat = _a.inputFormat;
|
|
389
|
+
var _b = DateRangePicker.unFormatValue(value, format, joinValues, delimiter), startDate = _b.startDate, endDate = _b.endDate;
|
|
390
|
+
_this.state = {
|
|
391
|
+
isOpened: false,
|
|
392
|
+
isFocused: false,
|
|
393
|
+
editState: 'start',
|
|
394
|
+
startDate: startDate,
|
|
395
|
+
endDate: endDate,
|
|
396
|
+
startInputValue: startDate === null || startDate === void 0 ? void 0 : startDate.format(inputFormat),
|
|
397
|
+
endInputValue: endDate === null || endDate === void 0 ? void 0 : endDate.format(inputFormat)
|
|
398
|
+
};
|
|
399
|
+
return _this;
|
|
400
|
+
}
|
|
401
|
+
DateRangePicker.formatValue = function (newValue, format, joinValues, delimiter, utc) {
|
|
402
|
+
var _a, _b;
|
|
403
|
+
if (utc === void 0) { utc = false; }
|
|
404
|
+
newValue = [
|
|
405
|
+
(_a = (utc ? moment.utc(newValue.startDate) : newValue.startDate)) === null || _a === void 0 ? void 0 : _a.format(format),
|
|
406
|
+
(_b = (utc ? moment.utc(newValue.endDate) : newValue.endDate)) === null || _b === void 0 ? void 0 : _b.format(format)
|
|
407
|
+
];
|
|
408
|
+
if (joinValues) {
|
|
409
|
+
newValue = newValue.join(delimiter);
|
|
410
|
+
}
|
|
411
|
+
return newValue;
|
|
412
|
+
};
|
|
413
|
+
DateRangePicker.unFormatValue = function (value, format, joinValues, delimiter) {
|
|
414
|
+
if (!value) {
|
|
415
|
+
return {
|
|
416
|
+
startDate: undefined,
|
|
417
|
+
endDate: undefined
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
if (joinValues && typeof value === 'string') {
|
|
421
|
+
value = value.split(delimiter);
|
|
422
|
+
}
|
|
423
|
+
return {
|
|
424
|
+
startDate: value[0] ? moment(value[0], format) : undefined,
|
|
425
|
+
endDate: value[1] ? moment(value[1], format) : undefined
|
|
426
|
+
};
|
|
427
|
+
};
|
|
428
|
+
DateRangePicker.prototype.componentDidMount = function () {
|
|
429
|
+
var _a, _b;
|
|
430
|
+
document.body.addEventListener('click', this.handleOutClick, true);
|
|
431
|
+
(_b = (_a = this.props) === null || _a === void 0 ? void 0 : _a.onRef) === null || _b === void 0 ? void 0 : _b.call(_a, this);
|
|
432
|
+
};
|
|
433
|
+
DateRangePicker.prototype.componentWillUnmount = function () {
|
|
434
|
+
document.body.removeEventListener('click', this.handleOutClick, true);
|
|
435
|
+
};
|
|
436
|
+
DateRangePicker.prototype.handleOutClick = function (e) {
|
|
437
|
+
if (!e.target ||
|
|
438
|
+
!this.dom.current ||
|
|
439
|
+
this.dom.current.contains(e.target) ||
|
|
440
|
+
!this.calendarRef.current ||
|
|
441
|
+
this.calendarRef.current.contains(e.target)) {
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
if (this.state.isOpened) {
|
|
445
|
+
e.preventDefault();
|
|
446
|
+
this.close();
|
|
447
|
+
}
|
|
448
|
+
};
|
|
449
|
+
DateRangePicker.prototype.componentDidUpdate = function (prevProps) {
|
|
450
|
+
var props = this.props;
|
|
451
|
+
var value = props.value, format = props.format, joinValues = props.joinValues, inputFormat = props.inputFormat, delimiter = props.delimiter;
|
|
452
|
+
if (prevProps.value !== value) {
|
|
453
|
+
var _a = DateRangePicker.unFormatValue(value, format, joinValues, delimiter), startDate = _a.startDate, endDate = _a.endDate;
|
|
454
|
+
this.setState({
|
|
455
|
+
startDate: startDate,
|
|
456
|
+
endDate: endDate,
|
|
457
|
+
startInputValue: startDate === null || startDate === void 0 ? void 0 : startDate.format(inputFormat),
|
|
458
|
+
endInputValue: endDate === null || endDate === void 0 ? void 0 : endDate.format(inputFormat)
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
DateRangePicker.prototype.focus = function () {
|
|
463
|
+
if (!this.dom.current || this.props.disabled) {
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
this.dom.current.focus();
|
|
467
|
+
};
|
|
468
|
+
DateRangePicker.prototype.blur = function () {
|
|
469
|
+
if (!this.dom.current || this.props.disabled) {
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
this.dom.current.blur();
|
|
473
|
+
};
|
|
474
|
+
DateRangePicker.prototype.handleFocus = function (e) {
|
|
475
|
+
this.setState({
|
|
476
|
+
isFocused: true
|
|
477
|
+
});
|
|
478
|
+
var onFocus = this.props.onFocus;
|
|
479
|
+
onFocus && onFocus(e);
|
|
480
|
+
};
|
|
481
|
+
DateRangePicker.prototype.handleBlur = function (e) {
|
|
482
|
+
this.setState({
|
|
483
|
+
isFocused: false
|
|
484
|
+
});
|
|
485
|
+
var onBlur = this.props.onBlur;
|
|
486
|
+
onBlur && onBlur(e);
|
|
487
|
+
};
|
|
488
|
+
DateRangePicker.prototype.open = function () {
|
|
489
|
+
if (this.props.disabled) {
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
this.setState({
|
|
493
|
+
isOpened: true
|
|
494
|
+
});
|
|
495
|
+
};
|
|
496
|
+
DateRangePicker.prototype.openStart = function () {
|
|
497
|
+
if (this.props.disabled) {
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
this.setState({
|
|
501
|
+
isOpened: true,
|
|
502
|
+
editState: 'start'
|
|
503
|
+
});
|
|
504
|
+
};
|
|
505
|
+
DateRangePicker.prototype.openEnd = function () {
|
|
506
|
+
if (this.props.disabled) {
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
this.setState({
|
|
510
|
+
isOpened: true,
|
|
511
|
+
editState: 'end'
|
|
512
|
+
});
|
|
513
|
+
};
|
|
514
|
+
DateRangePicker.prototype.close = function () {
|
|
515
|
+
this.setState({
|
|
516
|
+
isOpened: false,
|
|
517
|
+
editState: undefined
|
|
518
|
+
}, this.blur);
|
|
519
|
+
};
|
|
520
|
+
DateRangePicker.prototype.handleClick = function () {
|
|
521
|
+
this.state.isOpened ? this.close() : this.open();
|
|
522
|
+
};
|
|
523
|
+
DateRangePicker.prototype.handlePopOverClick = function (e) {
|
|
524
|
+
e.stopPropagation();
|
|
525
|
+
e.preventDefault();
|
|
526
|
+
};
|
|
527
|
+
DateRangePicker.prototype.handleKeyPress = function (e) {
|
|
528
|
+
if (e.key === ' ') {
|
|
529
|
+
this.handleClick();
|
|
530
|
+
e.preventDefault();
|
|
531
|
+
}
|
|
532
|
+
};
|
|
533
|
+
DateRangePicker.prototype.confirm = function () {
|
|
534
|
+
var _a;
|
|
535
|
+
if (!this.state.startDate && !this.state.endDate) {
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
else if ((_a = this.state.startDate) === null || _a === void 0 ? void 0 : _a.isAfter(this.state.endDate)) {
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
this.props.onChange(DateRangePicker.formatValue({
|
|
542
|
+
startDate: this.state.startDate,
|
|
543
|
+
endDate: this.state.endDate
|
|
544
|
+
}, this.props.format, this.props.joinValues, this.props.delimiter, this.props.utc));
|
|
545
|
+
if (this.state.startDate && !this.state.endDate) {
|
|
546
|
+
this.setState({ editState: 'end' });
|
|
547
|
+
}
|
|
548
|
+
else {
|
|
549
|
+
this.close();
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
DateRangePicker.prototype.filterDate = function (date, originValue, timeFormat, type) {
|
|
553
|
+
if (type === void 0) { type = 'start'; }
|
|
554
|
+
var value = date.clone();
|
|
555
|
+
// 没有初始值
|
|
556
|
+
if (!originValue) {
|
|
557
|
+
value = value[type === 'start' ? 'startOf' : 'endOf']('day');
|
|
558
|
+
}
|
|
559
|
+
else if (typeof timeFormat === 'string' && /ss/.test(timeFormat)) {
|
|
560
|
+
value = value[type === 'start' ? 'startOf' : 'endOf']('second');
|
|
561
|
+
}
|
|
562
|
+
else if (typeof timeFormat === 'string' && /mm/.test(timeFormat)) {
|
|
563
|
+
value = value[type === 'start' ? 'startOf' : 'endOf']('minute');
|
|
564
|
+
}
|
|
565
|
+
else if (typeof timeFormat === 'string' && /HH/i.test(timeFormat)) {
|
|
566
|
+
value = value[type === 'start' ? 'startOf' : 'endOf']('hour');
|
|
567
|
+
}
|
|
568
|
+
else if (typeof timeFormat === 'string' && /Q/i.test(timeFormat)) {
|
|
569
|
+
value = value[type === 'start' ? 'startOf' : 'endOf']('quarter');
|
|
570
|
+
}
|
|
571
|
+
else {
|
|
572
|
+
value = value[type === 'start' ? 'startOf' : 'endOf']('day');
|
|
573
|
+
}
|
|
574
|
+
return value;
|
|
575
|
+
};
|
|
576
|
+
DateRangePicker.prototype.handleDateChange = function (newValue) {
|
|
577
|
+
var editState = this.state.editState;
|
|
578
|
+
if (editState === 'start') {
|
|
579
|
+
this.handleStartDateChange(newValue);
|
|
580
|
+
}
|
|
581
|
+
else if (editState === 'end') {
|
|
582
|
+
this.handeleEndDateChange(newValue);
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
DateRangePicker.prototype.handleStartDateChange = function (newValue) {
|
|
586
|
+
var _a = this.props, timeFormat = _a.timeFormat, minDate = _a.minDate, inputFormat = _a.inputFormat, type = _a.type;
|
|
587
|
+
var startDate = this.state.startDate;
|
|
588
|
+
if (minDate && newValue.isBefore(minDate)) {
|
|
589
|
+
newValue = minDate;
|
|
590
|
+
}
|
|
591
|
+
var date = this.filterDate(newValue, startDate || minDate, timeFormat, 'start');
|
|
592
|
+
var newState = {
|
|
593
|
+
startDate: date,
|
|
594
|
+
startInputValue: date.format(inputFormat)
|
|
595
|
+
};
|
|
596
|
+
// 这些没有时间的选择点第一次后第二次就是选结束时间
|
|
597
|
+
if (type === 'input-date-range' ||
|
|
598
|
+
type === 'input-year-range' ||
|
|
599
|
+
type === 'input-quarter-range' ||
|
|
600
|
+
type === 'input-month-range') {
|
|
601
|
+
newState.editState = 'end';
|
|
602
|
+
}
|
|
603
|
+
this.setState(newState);
|
|
604
|
+
};
|
|
605
|
+
DateRangePicker.prototype.handeleEndDateChange = function (newValue) {
|
|
606
|
+
var _this = this;
|
|
607
|
+
var _a = this.props, embed = _a.embed, timeFormat = _a.timeFormat, inputFormat = _a.inputFormat;
|
|
608
|
+
var _b = this.state, startDate = _b.startDate, endDate = _b.endDate;
|
|
609
|
+
newValue = this.getEndDateByDuration(newValue);
|
|
610
|
+
// 如果结束时间在前面,需要清空开始时间
|
|
611
|
+
if (newValue.isBefore(startDate)) {
|
|
612
|
+
this.setState({
|
|
613
|
+
startDate: undefined,
|
|
614
|
+
startInputValue: ''
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
var date = this.filterDate(newValue, endDate, timeFormat, 'end');
|
|
618
|
+
this.setState({
|
|
619
|
+
endDate: date,
|
|
620
|
+
endInputValue: date.format(inputFormat)
|
|
621
|
+
}, function () {
|
|
622
|
+
embed && _this.confirm();
|
|
623
|
+
});
|
|
624
|
+
};
|
|
625
|
+
// 手动控制输入时间
|
|
626
|
+
DateRangePicker.prototype.startInputChange = function (e) {
|
|
627
|
+
var _a = this.props, onChange = _a.onChange, inputFormat = _a.inputFormat; _a.format; _a.utc;
|
|
628
|
+
var value = e.currentTarget.value;
|
|
629
|
+
this.setState({ startInputValue: value });
|
|
630
|
+
if (value === '') {
|
|
631
|
+
onChange('');
|
|
632
|
+
}
|
|
633
|
+
else {
|
|
634
|
+
var newDate = this.getStartDateByDuration(moment(value, inputFormat));
|
|
635
|
+
this.setState({ startDate: newDate });
|
|
636
|
+
}
|
|
637
|
+
};
|
|
638
|
+
DateRangePicker.prototype.endInputChange = function (e) {
|
|
639
|
+
var _a = this.props, onChange = _a.onChange, inputFormat = _a.inputFormat; _a.format; _a.utc;
|
|
640
|
+
var value = e.currentTarget.value;
|
|
641
|
+
this.setState({ endInputValue: value });
|
|
642
|
+
if (value === '') {
|
|
643
|
+
onChange('');
|
|
644
|
+
}
|
|
645
|
+
else {
|
|
646
|
+
var newDate = this.getEndDateByDuration(moment(value, inputFormat));
|
|
647
|
+
this.setState({ endDate: newDate });
|
|
648
|
+
}
|
|
649
|
+
};
|
|
650
|
+
// 根据 duration 修复结束时间
|
|
651
|
+
DateRangePicker.prototype.getEndDateByDuration = function (newValue) {
|
|
652
|
+
var _a = this.props, minDuration = _a.minDuration, maxDuration = _a.maxDuration, type = _a.type;
|
|
653
|
+
var _b = this.state, startDate = _b.startDate; _b.endDate; _b.editState;
|
|
654
|
+
if (!startDate) {
|
|
655
|
+
return newValue;
|
|
656
|
+
}
|
|
657
|
+
// 时间范围必须统一成同一天,不然会不一致
|
|
658
|
+
if (type === 'input-time-range' && startDate) {
|
|
659
|
+
newValue.set({
|
|
660
|
+
year: startDate.year(),
|
|
661
|
+
month: startDate.month(),
|
|
662
|
+
date: startDate.date()
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
if (minDuration && newValue.isBefore(startDate.clone().add(minDuration))) {
|
|
666
|
+
newValue = startDate.clone().add(minDuration);
|
|
667
|
+
}
|
|
668
|
+
if (maxDuration && newValue.isAfter(startDate.clone().add(maxDuration))) {
|
|
669
|
+
newValue = startDate.clone().add(maxDuration);
|
|
670
|
+
}
|
|
671
|
+
return newValue;
|
|
672
|
+
};
|
|
673
|
+
// 根据 duration 修复起始时间
|
|
674
|
+
DateRangePicker.prototype.getStartDateByDuration = function (newValue) {
|
|
675
|
+
var _a = this.props, minDuration = _a.minDuration, maxDuration = _a.maxDuration, type = _a.type;
|
|
676
|
+
var _b = this.state, endDate = _b.endDate; _b.editState;
|
|
677
|
+
if (!endDate) {
|
|
678
|
+
return newValue;
|
|
679
|
+
}
|
|
680
|
+
// 时间范围必须统一成同一天,不然会不一致
|
|
681
|
+
if (type === 'input-time-range' && endDate) {
|
|
682
|
+
newValue.set({
|
|
683
|
+
year: endDate.year(),
|
|
684
|
+
month: endDate.month(),
|
|
685
|
+
date: endDate.date()
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
if (minDuration &&
|
|
689
|
+
newValue.isBefore(endDate.clone().subtract(minDuration))) {
|
|
690
|
+
newValue = endDate.clone().subtract(minDuration);
|
|
691
|
+
}
|
|
692
|
+
if (maxDuration &&
|
|
693
|
+
newValue.isAfter(endDate.clone().subtract(maxDuration))) {
|
|
694
|
+
newValue = endDate.clone().subtract(maxDuration);
|
|
695
|
+
}
|
|
696
|
+
return newValue;
|
|
697
|
+
};
|
|
698
|
+
// 主要用于处理时间的情况
|
|
699
|
+
DateRangePicker.prototype.handleTimeStartChange = function (newValue) {
|
|
700
|
+
var _this = this;
|
|
701
|
+
var _a = this.props, embed = _a.embed; _a.timeFormat; var inputFormat = _a.inputFormat; _a.minDuration; _a.maxDuration; var minDate = _a.minDate;
|
|
702
|
+
var _b = this.state; _b.startDate; var endDate = _b.endDate;
|
|
703
|
+
// 时间范围必须统一成同一天,不然会不一致
|
|
704
|
+
if (endDate) {
|
|
705
|
+
newValue.set({
|
|
706
|
+
year: endDate.year(),
|
|
707
|
+
month: endDate.month(),
|
|
708
|
+
date: endDate.date()
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
if (minDate && newValue && newValue.isBefore(minDate, 'second')) {
|
|
712
|
+
newValue = minDate;
|
|
713
|
+
}
|
|
714
|
+
this.setState({
|
|
715
|
+
startDate: newValue,
|
|
716
|
+
startInputValue: newValue.format(inputFormat)
|
|
717
|
+
}, function () {
|
|
718
|
+
embed && _this.confirm();
|
|
719
|
+
});
|
|
720
|
+
};
|
|
721
|
+
DateRangePicker.prototype.handleTimeEndChange = function (newValue) {
|
|
722
|
+
var _this = this;
|
|
723
|
+
var _a = this.props, embed = _a.embed; _a.timeFormat; var inputFormat = _a.inputFormat, minDuration = _a.minDuration, maxDuration = _a.maxDuration, maxDate = _a.maxDate;
|
|
724
|
+
var _b = this.state, startDate = _b.startDate; _b.endDate;
|
|
725
|
+
if (startDate) {
|
|
726
|
+
newValue.set({
|
|
727
|
+
year: startDate.year(),
|
|
728
|
+
month: startDate.month(),
|
|
729
|
+
date: startDate.date()
|
|
730
|
+
});
|
|
731
|
+
}
|
|
732
|
+
if (maxDate && newValue && newValue.isAfter(maxDate, 'second')) {
|
|
733
|
+
newValue = maxDate;
|
|
734
|
+
}
|
|
735
|
+
if (startDate &&
|
|
736
|
+
minDuration &&
|
|
737
|
+
newValue.isAfter(startDate.clone().add(minDuration))) {
|
|
738
|
+
newValue = startDate.clone().add(minDuration);
|
|
739
|
+
}
|
|
740
|
+
if (startDate &&
|
|
741
|
+
maxDuration &&
|
|
742
|
+
newValue.isBefore(startDate.clone().add(maxDuration))) {
|
|
743
|
+
newValue = startDate.clone().add(maxDuration);
|
|
744
|
+
}
|
|
745
|
+
this.setState({
|
|
746
|
+
endDate: newValue,
|
|
747
|
+
endInputValue: newValue.format(inputFormat)
|
|
748
|
+
}, function () {
|
|
749
|
+
embed && _this.confirm();
|
|
750
|
+
});
|
|
751
|
+
};
|
|
752
|
+
DateRangePicker.prototype.handleMobileChange = function (data, callback) {
|
|
753
|
+
this.setState({
|
|
754
|
+
startDate: data.startDate,
|
|
755
|
+
endDate: data.endDate
|
|
756
|
+
}, callback);
|
|
757
|
+
};
|
|
758
|
+
DateRangePicker.prototype.selectRannge = function (range) {
|
|
759
|
+
var _a = this.props, closeOnSelect = _a.closeOnSelect, minDate = _a.minDate, maxDate = _a.maxDate;
|
|
760
|
+
var now = moment();
|
|
761
|
+
this.setState({
|
|
762
|
+
startDate: minDate && minDate.isValid()
|
|
763
|
+
? moment.max(range.startDate(now.clone()), minDate)
|
|
764
|
+
: range.startDate(now.clone()),
|
|
765
|
+
endDate: maxDate && maxDate.isValid()
|
|
766
|
+
? moment.min(maxDate, range.endDate(now.clone()))
|
|
767
|
+
: range.endDate(now.clone())
|
|
768
|
+
}, closeOnSelect ? this.confirm : noop);
|
|
769
|
+
};
|
|
770
|
+
DateRangePicker.prototype.renderRanges = function (ranges) {
|
|
771
|
+
var _this = this;
|
|
772
|
+
if (!ranges) {
|
|
773
|
+
return null;
|
|
774
|
+
}
|
|
775
|
+
var ns = this.props.classPrefix;
|
|
776
|
+
var rangeArr;
|
|
777
|
+
if (typeof ranges === 'string') {
|
|
778
|
+
rangeArr = ranges.split(',');
|
|
779
|
+
}
|
|
780
|
+
else {
|
|
781
|
+
rangeArr = ranges;
|
|
782
|
+
}
|
|
783
|
+
var __ = this.props.translate;
|
|
784
|
+
return (React__default.createElement("ul", { className: "".concat(ns, "DateRangePicker-rangers") }, rangeArr.map(function (item) {
|
|
785
|
+
if (!item) {
|
|
786
|
+
return null;
|
|
787
|
+
}
|
|
788
|
+
var range = {};
|
|
789
|
+
if (typeof item === 'string') {
|
|
790
|
+
if (availableRanges[item]) {
|
|
791
|
+
range = availableRanges[item];
|
|
792
|
+
range.key = item;
|
|
793
|
+
}
|
|
794
|
+
else {
|
|
795
|
+
// 通过正则尝试匹配
|
|
796
|
+
for (var i = 0, len = advancedRanges.length; i < len; i++) {
|
|
797
|
+
var value = advancedRanges[i];
|
|
798
|
+
var m = value.regexp.exec(item);
|
|
799
|
+
if (m) {
|
|
800
|
+
range = value.resolve.apply(item, __spreadArray([__], m, true));
|
|
801
|
+
range.key = item;
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
else if (item.startDate &&
|
|
807
|
+
item.endDate) {
|
|
808
|
+
range = __assign(__assign({}, item), { startDate: function () { return item.startDate; }, endDate: function () { return item.endDate; } });
|
|
809
|
+
}
|
|
810
|
+
if (Object.keys(range).length) {
|
|
811
|
+
return (React__default.createElement("li", { className: "".concat(ns, "DateRangePicker-ranger"), onClick: function () { return _this.selectRannge(range); }, key: range.key || range.label },
|
|
812
|
+
React__default.createElement("a", null, __(range.label))));
|
|
813
|
+
}
|
|
814
|
+
else {
|
|
815
|
+
return null;
|
|
816
|
+
}
|
|
817
|
+
})));
|
|
818
|
+
};
|
|
819
|
+
DateRangePicker.prototype.clearValue = function (e) {
|
|
820
|
+
e.preventDefault();
|
|
821
|
+
e.stopPropagation();
|
|
822
|
+
var onChange = this.props.onChange;
|
|
823
|
+
this.setState({ startInputValue: '', endInputValue: '' });
|
|
824
|
+
onChange('');
|
|
825
|
+
};
|
|
826
|
+
// 清空
|
|
827
|
+
DateRangePicker.prototype.clear = function () {
|
|
828
|
+
var onChange = this.props.onChange;
|
|
829
|
+
this.setState({ startInputValue: '', endInputValue: '' });
|
|
830
|
+
onChange('');
|
|
831
|
+
};
|
|
832
|
+
// 重置
|
|
833
|
+
DateRangePicker.prototype.reset = function () {
|
|
834
|
+
var _a = this.props, resetValue = _a.resetValue, onChange = _a.onChange, format = _a.format, joinValues = _a.joinValues, delimiter = _a.delimiter, inputFormat = _a.inputFormat;
|
|
835
|
+
if (!resetValue) {
|
|
836
|
+
return;
|
|
837
|
+
}
|
|
838
|
+
var _b = DateRangePicker.unFormatValue(resetValue, format, joinValues, delimiter), startDate = _b.startDate, endDate = _b.endDate;
|
|
839
|
+
onChange(resetValue);
|
|
840
|
+
this.setState({
|
|
841
|
+
startInputValue: startDate === null || startDate === void 0 ? void 0 : startDate.format(inputFormat),
|
|
842
|
+
endInputValue: endDate === null || endDate === void 0 ? void 0 : endDate.format(inputFormat)
|
|
843
|
+
});
|
|
844
|
+
};
|
|
845
|
+
DateRangePicker.prototype.checkStartIsValidDate = function (currentDate) {
|
|
846
|
+
var _a = this.state, endDate = _a.endDate; _a.startDate;
|
|
847
|
+
var _b = this.props, minDate = _b.minDate, maxDate = _b.maxDate, minDuration = _b.minDuration, maxDuration = _b.maxDuration, viewMode = _b.viewMode;
|
|
848
|
+
var precision = viewMode === 'time' ? 'hours' : viewMode || 'day';
|
|
849
|
+
maxDate =
|
|
850
|
+
maxDate && endDate
|
|
851
|
+
? maxDate.isBefore(endDate)
|
|
852
|
+
? maxDate
|
|
853
|
+
: endDate
|
|
854
|
+
: undefined;
|
|
855
|
+
if (minDate && currentDate.isBefore(minDate, precision)) {
|
|
856
|
+
return false;
|
|
857
|
+
}
|
|
858
|
+
else if (maxDate && currentDate.isAfter(maxDate, precision)) {
|
|
859
|
+
return false;
|
|
860
|
+
}
|
|
861
|
+
else if (
|
|
862
|
+
// 如果配置了 minDuration 那么 EndDate - minDuration 之后的天数也不能选
|
|
863
|
+
endDate &&
|
|
864
|
+
minDuration &&
|
|
865
|
+
currentDate.isAfter(endDate.clone().subtract(minDuration))) {
|
|
866
|
+
return false;
|
|
867
|
+
}
|
|
868
|
+
else if (endDate &&
|
|
869
|
+
maxDuration &&
|
|
870
|
+
currentDate.isBefore(endDate.clone().subtract(maxDuration))) {
|
|
871
|
+
return false;
|
|
872
|
+
}
|
|
873
|
+
return true;
|
|
874
|
+
};
|
|
875
|
+
DateRangePicker.prototype.checkEndIsValidDate = function (currentDate) {
|
|
876
|
+
var startDate = this.state.startDate;
|
|
877
|
+
var _a = this.props, minDate = _a.minDate, maxDate = _a.maxDate, minDuration = _a.minDuration, maxDuration = _a.maxDuration, viewMode = _a.viewMode;
|
|
878
|
+
var precision = viewMode === 'time' ? 'hours' : viewMode || 'day';
|
|
879
|
+
minDate =
|
|
880
|
+
minDate && startDate
|
|
881
|
+
? minDate.isAfter(startDate)
|
|
882
|
+
? minDate
|
|
883
|
+
: startDate
|
|
884
|
+
: undefined;
|
|
885
|
+
if (minDate && currentDate.isBefore(minDate, precision)) {
|
|
886
|
+
return false;
|
|
887
|
+
}
|
|
888
|
+
else if (maxDate && currentDate.isAfter(maxDate, precision)) {
|
|
889
|
+
return false;
|
|
890
|
+
}
|
|
891
|
+
else if (startDate &&
|
|
892
|
+
minDuration &&
|
|
893
|
+
currentDate.isBefore(startDate.clone().add(minDuration))) {
|
|
894
|
+
return false;
|
|
895
|
+
}
|
|
896
|
+
else if (startDate &&
|
|
897
|
+
maxDuration &&
|
|
898
|
+
currentDate.isAfter(startDate.clone().add(maxDuration))) {
|
|
899
|
+
return false;
|
|
900
|
+
}
|
|
901
|
+
return true;
|
|
902
|
+
};
|
|
903
|
+
DateRangePicker.prototype.renderDay = function (props, currentDate) {
|
|
904
|
+
var _a = this.state, startDate = _a.startDate, endDate = _a.endDate;
|
|
905
|
+
if (startDate &&
|
|
906
|
+
endDate &&
|
|
907
|
+
currentDate.isBetween(startDate, endDate, 'day', '[]')) {
|
|
908
|
+
props.className += ' rdtBetween';
|
|
909
|
+
}
|
|
910
|
+
return (React__default.createElement("td", __assign({}, props),
|
|
911
|
+
React__default.createElement("span", null, currentDate.date())));
|
|
912
|
+
};
|
|
913
|
+
DateRangePicker.prototype.renderMonth = function (props, month, year, date) {
|
|
914
|
+
var m = moment();
|
|
915
|
+
var currentDate = m.year(year).month(month);
|
|
916
|
+
var _a = this.state, startDate = _a.startDate, endDate = _a.endDate;
|
|
917
|
+
var localMoment = m.localeData().monthsShort(m.month(month));
|
|
918
|
+
var strLength = 3;
|
|
919
|
+
var monthStrFixedLength = localMoment.substring(0, strLength);
|
|
920
|
+
if (startDate &&
|
|
921
|
+
endDate &&
|
|
922
|
+
currentDate.isBetween(startDate, endDate, 'month', '[]')) {
|
|
923
|
+
props.className += ' rdtBetween';
|
|
924
|
+
}
|
|
925
|
+
return (React__default.createElement("td", __assign({}, props),
|
|
926
|
+
React__default.createElement("span", null, monthStrFixedLength)));
|
|
927
|
+
};
|
|
928
|
+
DateRangePicker.prototype.renderQuarter = function (props, quarter, year) {
|
|
929
|
+
var currentDate = moment().year(year).quarter(quarter);
|
|
930
|
+
var _a = this.state, startDate = _a.startDate, endDate = _a.endDate;
|
|
931
|
+
if (startDate &&
|
|
932
|
+
endDate &&
|
|
933
|
+
currentDate.isBetween(startDate, endDate, 'quarter', '[]')) {
|
|
934
|
+
props.className += ' rdtBetween';
|
|
935
|
+
}
|
|
936
|
+
return (React__default.createElement("td", __assign({}, props),
|
|
937
|
+
React__default.createElement("span", null,
|
|
938
|
+
"Q",
|
|
939
|
+
quarter)));
|
|
940
|
+
};
|
|
941
|
+
DateRangePicker.prototype.renderYear = function (props, year) {
|
|
942
|
+
var currentDate = moment().year(year);
|
|
943
|
+
var _a = this.state, startDate = _a.startDate, endDate = _a.endDate;
|
|
944
|
+
if (startDate &&
|
|
945
|
+
endDate &&
|
|
946
|
+
currentDate.isBetween(startDate, endDate, 'year', '[]')) {
|
|
947
|
+
props.className += ' rdtBetween';
|
|
948
|
+
}
|
|
949
|
+
return (React__default.createElement("td", __assign({}, props),
|
|
950
|
+
React__default.createElement("span", null, year)));
|
|
951
|
+
};
|
|
952
|
+
DateRangePicker.prototype.renderCalendar = function () {
|
|
953
|
+
var _a;
|
|
954
|
+
var _b = this.props, ns = _b.classPrefix, cx = _b.classnames, dateFormat = _b.dateFormat, timeFormat = _b.timeFormat, inputFormat = _b.inputFormat, ranges = _b.ranges, locale = _b.locale, embed = _b.embed, type = _b.type, _c = _b.viewMode, viewMode = _c === void 0 ? 'days' : _c;
|
|
955
|
+
var __ = this.props.translate;
|
|
956
|
+
var _d = this.state, startDate = _d.startDate, endDate = _d.endDate, editState = _d.editState;
|
|
957
|
+
// timeRange需要单独选择范围
|
|
958
|
+
var isTimeRange = type === 'input-datetime-range' || viewMode === 'time';
|
|
959
|
+
return (React__default.createElement("div", { className: "".concat(ns, "DateRangePicker-wrap"), ref: this.calendarRef },
|
|
960
|
+
this.renderRanges(ranges),
|
|
961
|
+
(!isTimeRange || (editState === 'start' && !embed)) && (React__default.createElement(Calendar, { className: "".concat(ns, "DateRangePicker-start"), value: startDate,
|
|
962
|
+
// 区分的原因是 time-range 左侧就只能选起始时间,而其它都能在左侧同时同时选择起始和结束
|
|
963
|
+
// TODO: 后续得把 time-range 代码拆分出来
|
|
964
|
+
onChange: type === 'input-datetime-range'
|
|
965
|
+
? this.handleStartDateChange
|
|
966
|
+
: viewMode === 'time'
|
|
967
|
+
? this.handleTimeStartChange
|
|
968
|
+
: this.handleDateChange, requiredConfirm: false, dateFormat: dateFormat, inputFormat: inputFormat, timeFormat: timeFormat, isValidDate: this.checkStartIsValidDate, viewMode: viewMode, input: false, onClose: this.close, renderDay: this.renderDay, renderMonth: this.renderMonth, renderQuarter: this.renderQuarter, renderYear: this.renderYear, locale: locale, timeRangeHeader: "\u5F00\u59CB\u65F6\u95F4" })),
|
|
969
|
+
(!isTimeRange || (editState === 'end' && !embed)) && (React__default.createElement(Calendar, { className: "".concat(ns, "DateRangePicker-end"), value: endDate, onChange: type === 'input-datetime-range'
|
|
970
|
+
? this.handeleEndDateChange
|
|
971
|
+
: viewMode === 'time'
|
|
972
|
+
? this.handleTimeEndChange
|
|
973
|
+
: this.handleDateChange, requiredConfirm: false, dateFormat: dateFormat, inputFormat: inputFormat, timeFormat: timeFormat, viewDate: this.nextMonth, isEndDate: true, isValidDate: this.checkEndIsValidDate, viewMode: viewMode, input: false, onClose: this.close, renderDay: this.renderDay, renderMonth: this.renderMonth, renderQuarter: this.renderQuarter, renderYear: this.renderYear, locale: locale, timeRangeHeader: "\u7ED3\u675F\u65F6\u95F4" })),
|
|
974
|
+
embed ? null : (React__default.createElement("div", { key: "button", className: "".concat(ns, "DateRangePicker-actions") },
|
|
975
|
+
React__default.createElement("a", { className: cx('Button', 'Button--default'), onClick: this.close }, __('cancel')),
|
|
976
|
+
React__default.createElement("a", { className: cx('Button', 'Button--primary', 'm-l-sm', {
|
|
977
|
+
'is-disabled': (!this.state.startDate &&
|
|
978
|
+
isTimeRange &&
|
|
979
|
+
editState === 'start') ||
|
|
980
|
+
(!this.state.endDate && isTimeRange && editState === 'end') ||
|
|
981
|
+
((_a = this.state.endDate) === null || _a === void 0 ? void 0 : _a.isBefore(this.state.startDate))
|
|
982
|
+
}), onClick: this.confirm }, __('confirm'))))));
|
|
983
|
+
};
|
|
984
|
+
DateRangePicker.prototype.render = function () {
|
|
985
|
+
var _a;
|
|
986
|
+
var _this = this;
|
|
987
|
+
var _b = this.props, className = _b.className, popoverClassName = _b.popoverClassName, ns = _b.classPrefix, cx = _b.classnames, value = _b.value, startPlaceholder = _b.startPlaceholder, endPlaceholder = _b.endPlaceholder, popOverContainer = _b.popOverContainer, inputFormat = _b.inputFormat; _b.format; _b.joinValues; _b.delimiter; var clearable = _b.clearable, disabled = _b.disabled, embed = _b.embed, overlayPlacement = _b.overlayPlacement, borderMode = _b.borderMode, useMobileUI = _b.useMobileUI, timeFormat = _b.timeFormat, minDate = _b.minDate, maxDate = _b.maxDate, minDuration = _b.minDuration, maxDuration = _b.maxDuration, dateFormat = _b.dateFormat, _c = _b.viewMode, viewMode = _c === void 0 ? 'days' : _c, ranges = _b.ranges;
|
|
988
|
+
var useCalendarMobile = useMobileUI &&
|
|
989
|
+
isMobile() &&
|
|
990
|
+
['days', 'months', 'quarters'].indexOf(viewMode) > -1;
|
|
991
|
+
var _d = this.state, isOpened = _d.isOpened, isFocused = _d.isFocused, startDate = _d.startDate, endDate = _d.endDate;
|
|
992
|
+
var __ = this.props.translate;
|
|
993
|
+
var calendarMobile = (React__default.createElement(CalendarMobile, { timeFormat: timeFormat, inputFormat: inputFormat, startDate: startDate, endDate: endDate, minDate: minDate, maxDate: maxDate, minDuration: minDuration, maxDuration: maxDuration, dateFormat: dateFormat, embed: embed, viewMode: viewMode, close: this.close, confirm: this.confirm, onChange: this.handleMobileChange, footerExtra: this.renderRanges(ranges), showViewMode: viewMode === 'quarters' || viewMode === 'months' ? 'years' : 'months' }));
|
|
994
|
+
if (embed) {
|
|
995
|
+
return (React__default.createElement("div", { className: cx("".concat(ns, "DateRangeCalendar"), {
|
|
996
|
+
'is-disabled': disabled
|
|
997
|
+
}, className) }, useCalendarMobile ? calendarMobile : this.renderCalendar()));
|
|
998
|
+
}
|
|
999
|
+
var CalendarMobileTitle = (React__default.createElement("div", { className: "".concat(ns, "CalendarMobile-title") }, __('Calendar.datepicker')));
|
|
1000
|
+
return (React__default.createElement("div", { tabIndex: 0, onKeyPress: this.handleKeyPress, onFocus: this.handleFocus, onBlur: this.handleBlur, className: cx("".concat(ns, "DateRangePicker"), (_a = {
|
|
1001
|
+
'is-disabled': disabled,
|
|
1002
|
+
'is-focused': isFocused
|
|
1003
|
+
},
|
|
1004
|
+
_a["".concat(ns, "DateRangePicker--border").concat(ucFirst(borderMode))] = borderMode,
|
|
1005
|
+
_a['is-mobile'] = useMobileUI && isMobile(),
|
|
1006
|
+
_a), className), ref: this.dom },
|
|
1007
|
+
React__default.createElement(Input, { className: cx('DateRangePicker-input', {
|
|
1008
|
+
isActive: this.state.editState === 'start' && isOpened
|
|
1009
|
+
}), onChange: this.startInputChange, onClick: this.openStart, ref: this.startInputRef, placeholder: __(startPlaceholder), autoComplete: "off", value: this.state.startInputValue || '', disabled: disabled }),
|
|
1010
|
+
React__default.createElement("span", { className: cx('DateRangePicker-input-separator') }, "-"),
|
|
1011
|
+
React__default.createElement(Input, { className: cx('DateRangePicker-input', {
|
|
1012
|
+
isActive: this.state.editState === 'end' && isOpened
|
|
1013
|
+
}), onChange: this.endInputChange, onClick: this.openEnd, ref: this.endInputRef, placeholder: __(endPlaceholder), autoComplete: "off", value: this.state.endInputValue || '', disabled: disabled }),
|
|
1014
|
+
clearable && !disabled && value ? (React__default.createElement("a", { className: "".concat(ns, "DateRangePicker-clear"), onClick: this.clearValue },
|
|
1015
|
+
React__default.createElement(Icon, { icon: "input-clear", className: "icon" }))) : null,
|
|
1016
|
+
React__default.createElement("a", { className: "".concat(ns, "DateRangePicker-toggler") },
|
|
1017
|
+
React__default.createElement(Icon, { icon: viewMode === 'time' ? 'clock' : 'date', className: "icon" })),
|
|
1018
|
+
isOpened ? (useMobileUI && isMobile() ? (React__default.createElement(PopUp, { isShow: isOpened, container: popOverContainer, className: cx("".concat(ns, "CalendarMobile-pop")), onHide: this.close, header: CalendarMobileTitle }, useCalendarMobile ? calendarMobile : this.renderCalendar())) : (React__default.createElement(Overlay, { target: function () { return _this.dom.current; }, onHide: this.close, container: popOverContainer || (function () { return findDOMNode(_this); }), rootClose: false, placement: overlayPlacement, show: true },
|
|
1019
|
+
React__default.createElement(PopOver, { classPrefix: ns, className: cx("".concat(ns, "DateRangePicker-popover"), popoverClassName), onHide: this.close, onClick: this.handlePopOverClick }, this.renderCalendar())))) : null));
|
|
1020
|
+
};
|
|
1021
|
+
DateRangePicker.defaultProps = {
|
|
1022
|
+
startPlaceholder: 'Calendar.startPick',
|
|
1023
|
+
endPlaceholder: 'Calendar.endPick',
|
|
1024
|
+
format: 'X',
|
|
1025
|
+
inputFormat: 'YYYY-MM-DD',
|
|
1026
|
+
joinValues: true,
|
|
1027
|
+
clearable: true,
|
|
1028
|
+
delimiter: ',',
|
|
1029
|
+
ranges: 'yesterday,7daysago,prevweek,thismonth,prevmonth,prevquarter',
|
|
1030
|
+
resetValue: '',
|
|
1031
|
+
closeOnSelect: true,
|
|
1032
|
+
overlayPlacement: 'auto'
|
|
1033
|
+
};
|
|
1034
|
+
return DateRangePicker;
|
|
1035
|
+
}(React__default.Component));
|
|
1036
|
+
var DateRangePicker$1 = themeable(localeable(DateRangePicker));
|
|
1037
|
+
|
|
1038
|
+
export { DateRangePicker, advancedRanges, availableRanges, DateRangePicker$1 as default };
|