amis-ui 6.13.0-beta.8 → 6.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/components/404.d.ts +53 -0
- package/esm/components/404.js +35 -0
- package/esm/components/Alert.d.ts +615 -0
- package/esm/components/Alert.js +266 -0
- package/esm/components/Alert2.d.ts +117 -0
- package/esm/components/Alert2.js +58 -0
- package/esm/components/AlphabetIndexer.d.ts +11 -0
- package/esm/components/AlphabetIndexer.js +48 -0
- package/esm/components/AnchorNav.d.ts +162 -0
- package/esm/components/AnchorNav.js +153 -0
- package/esm/components/AnchorNavSection.d.ts +2 -0
- package/esm/components/AnchorNavSection.js +7 -0
- package/esm/components/ArrayInput.d.ts +617 -0
- package/esm/components/ArrayInput.js +147 -0
- package/esm/components/AsideNav.d.ts +142 -0
- package/esm/components/AsideNav.js +133 -0
- package/esm/components/AssociatedSelection.d.ts +564 -0
- package/esm/components/AssociatedSelection.js +107 -0
- package/esm/components/AutoFoldedList.d.ts +87 -0
- package/esm/components/AutoFoldedList.js +124 -0
- package/esm/components/AutoSizer.d.ts +2 -0
- package/esm/components/AutoSizer.js +8 -0
- package/esm/components/Avatar.d.ts +374 -0
- package/esm/components/Avatar.js +126 -0
- package/esm/components/Badge.d.ts +118 -0
- package/esm/components/Badge.js +154 -0
- package/esm/components/BaiduMapPicker.d.ts +100 -0
- package/esm/components/BaiduMapPicker.js +366 -0
- package/esm/components/BarCode.d.ts +56 -0
- package/esm/components/BarCode.js +42 -0
- package/esm/components/Breadcrumb.d.ts +115 -0
- package/esm/components/Breadcrumb.js +160 -0
- package/esm/components/Button.d.ts +147 -0
- package/esm/components/Button.js +63 -0
- package/esm/components/CalendarMobile.d.ts +431 -0
- package/esm/components/CalendarMobile.js +538 -0
- package/esm/components/Card.d.ts +444 -0
- package/esm/components/Card.js +88 -0
- package/esm/components/Cascader.d.ts +108 -0
- package/esm/components/Cascader.js +515 -0
- package/esm/components/ChainedDropdownSelection.d.ts +561 -0
- package/esm/components/ChainedDropdownSelection.js +104 -0
- package/esm/components/ChainedSelection.d.ts +554 -0
- package/esm/components/ChainedSelection.js +184 -0
- package/esm/components/Checkbox.d.ts +110 -0
- package/esm/components/Checkbox.js +87 -0
- package/esm/components/CityArea.d.ts +299 -0
- package/esm/components/CityArea.js +190 -0
- package/esm/components/CityDB.d.ts +13 -0
- package/esm/components/CityDB.js +3942 -0
- package/esm/components/CodeMirror.d.ts +29 -0
- package/esm/components/CodeMirror.js +140 -0
- package/esm/components/Collapse.d.ts +447 -0
- package/esm/components/Collapse.js +184 -0
- package/esm/components/CollapseGroup.d.ts +219 -0
- package/esm/components/CollapseGroup.js +117 -0
- package/esm/components/ColorPicker.d.ts +530 -0
- package/esm/components/ColorPicker.js +260 -0
- package/esm/components/Combo.d.ts +354 -0
- package/esm/components/Combo.js +212 -0
- package/esm/components/ConditionBuilder.d.ts +2 -0
- package/esm/components/ConditionBuilder.js +7 -0
- package/esm/components/ConfirmBox.d.ts +322 -0
- package/esm/components/ConfirmBox.js +129 -0
- package/esm/components/ContextMenu.d.ts +115 -0
- package/esm/components/ContextMenu.js +310 -0
- package/esm/components/DatePicker.d.ts +638 -0
- package/esm/components/DatePicker.js +717 -0
- package/esm/components/DateRangePicker.d.ts +1046 -0
- package/esm/components/DateRangePicker.js +1386 -0
- package/esm/components/DiffEditor.d.ts +21 -0
- package/esm/components/DiffEditor.js +119 -0
- package/esm/components/DndContainer.d.ts +205 -0
- package/esm/components/DndContainer.js +25 -0
- package/esm/components/Drawer.d.ts +159 -0
- package/esm/components/Drawer.js +272 -0
- package/esm/components/DropDownSelection.d.ts +557 -0
- package/esm/components/DropDownSelection.js +78 -0
- package/esm/components/DropdownContextMenus.d.ts +84 -0
- package/esm/components/DropdownContextMenus.js +93 -0
- package/esm/components/Editor.d.ts +681 -0
- package/esm/components/Editor.js +238 -0
- package/esm/components/Form.d.ts +31 -0
- package/esm/components/Form.js +84 -0
- package/esm/components/FormField.d.ts +287 -0
- package/esm/components/FormField.js +78 -0
- package/esm/components/FormulaPicker.d.ts +2 -0
- package/esm/components/FormulaPicker.js +7 -0
- package/esm/components/GaodeMapPicker.d.ts +89 -0
- package/esm/components/GaodeMapPicker.js +204 -0
- package/esm/components/GridNav.d.ts +53 -0
- package/esm/components/GridNav.js +125 -0
- package/esm/components/GridNavItem.d.ts +2 -0
- package/esm/components/GridNavItem.js +7 -0
- package/esm/components/GroupedSelection.d.ts +543 -0
- package/esm/components/GroupedSelection.js +138 -0
- package/esm/components/HeadCellDropDown.d.ts +2 -0
- package/esm/components/HeadCellDropDown.js +7 -0
- package/esm/components/HorizontalScroll.d.ts +75 -0
- package/esm/components/HorizontalScroll.js +271 -0
- package/esm/components/Html.d.ts +82 -0
- package/esm/components/Html.js +52 -0
- package/esm/components/Icon.d.ts +2 -0
- package/esm/components/Icon.js +7 -0
- package/esm/components/ImageGallery.d.ts +465 -0
- package/esm/components/ImageGallery.js +396 -0
- package/esm/components/Input.d.ts +18 -0
- package/esm/components/Input.js +75 -0
- package/esm/components/InputBox.d.ts +100 -0
- package/esm/components/InputBox.js +98 -0
- package/esm/components/InputBoxWithSuggestion.d.ts +272 -0
- package/esm/components/InputBoxWithSuggestion.js +69 -0
- package/esm/components/InputJSONSchema.d.ts +2 -0
- package/esm/components/InputJSONSchema.js +7 -0
- package/esm/components/InputTable.d.ts +317 -0
- package/esm/components/InputTable.js +176 -0
- package/esm/components/JSONSchemaEditor.d.ts +2 -0
- package/esm/components/JSONSchemaEditor.js +7 -0
- package/esm/components/Layout.d.ts +74 -0
- package/esm/components/Layout.js +60 -0
- package/esm/components/Link.d.ts +60 -0
- package/esm/components/Link.js +44 -0
- package/esm/components/ListGroup.d.ts +77 -0
- package/esm/components/ListGroup.js +31 -0
- package/esm/components/ListMenu.d.ts +568 -0
- package/esm/components/ListMenu.js +62 -0
- package/esm/components/LocationPicker.d.ts +467 -0
- package/esm/components/LocationPicker.js +208 -0
- package/esm/components/Markdown.d.ts +25 -0
- package/esm/components/Markdown.js +70 -0
- package/esm/components/Menu.d.ts +2 -0
- package/esm/components/Menu.js +7 -0
- package/esm/components/MixedInput.d.ts +55 -0
- package/esm/components/MixedInput.js +88 -0
- package/esm/components/MobileDevTool.d.ts +12 -0
- package/esm/components/MobileDevTool.js +312 -0
- package/esm/components/Modal.d.ts +1316 -0
- package/esm/components/Modal.js +261 -0
- package/esm/components/ModalManager.d.ts +17 -0
- package/esm/components/ModalManager.js +42 -0
- package/esm/components/MonthRangePicker.d.ts +744 -0
- package/esm/components/MultilineText.d.ts +454 -0
- package/esm/components/MultilineText.js +90 -0
- package/esm/components/NumberInput.d.ts +201 -0
- package/esm/components/NumberInput.js +274 -0
- package/esm/components/OverflowTpl.d.ts +61 -0
- package/esm/components/OverflowTpl.js +101 -0
- package/esm/components/Pagination.d.ts +812 -0
- package/esm/components/Pagination.js +377 -0
- package/esm/components/PdfViewer.d.ts +49 -0
- package/esm/components/PdfViewer.js +83 -0
- package/esm/components/Picker.d.ts +277 -0
- package/esm/components/Picker.js +73 -0
- package/esm/components/PickerColumn.d.ts +62 -0
- package/esm/components/PickerColumn.js +276 -0
- package/esm/components/PickerContainer.d.ts +291 -0
- package/esm/components/PickerContainer.js +157 -0
- package/esm/components/PopOverContainer.d.ts +59 -0
- package/esm/components/PopOverContainer.js +149 -0
- package/esm/components/PopUp.d.ts +573 -0
- package/esm/components/PopUp.js +85 -0
- package/esm/components/Progress.d.ts +311 -0
- package/esm/components/Progress.js +136 -0
- package/esm/components/PullRefresh.d.ts +79 -0
- package/esm/components/PullRefresh.js +172 -0
- package/esm/components/Radios.d.ts +170 -0
- package/esm/components/Radios.js +129 -0
- package/esm/components/Range.d.ts +131 -0
- package/esm/components/Range.js +517 -0
- package/esm/components/Rating.d.ts +227 -0
- package/esm/components/Rating.js +341 -0
- package/esm/components/ResultBox.d.ts +532 -0
- package/esm/components/ResultBox.js +195 -0
- package/esm/components/ResultList.d.ts +554 -0
- package/esm/components/ResultList.js +254 -0
- package/esm/components/ResultTableList.d.ts +786 -0
- package/esm/components/ResultTableList.js +152 -0
- package/esm/components/ResultTreeList.d.ts +425 -0
- package/esm/components/ResultTreeList.js +241 -0
- package/esm/components/RichText.d.ts +48 -0
- package/esm/components/RichText.js +271 -0
- package/esm/components/SearchBox.d.ts +625 -0
- package/esm/components/SearchBox.js +299 -0
- package/esm/components/Select.d.ts +6498 -0
- package/esm/components/Select.js +815 -0
- package/esm/components/SelectMobile.d.ts +38 -0
- package/esm/components/SelectMobile.js +370 -0
- package/esm/components/Selection.d.ts +598 -0
- package/esm/components/Selection.js +166 -0
- package/esm/components/Shape.d.ts +58 -0
- package/esm/components/Shape.js +429 -0
- package/esm/components/Signature.d.ts +279 -0
- package/esm/components/Signature.js +293 -0
- package/esm/components/Slider.d.ts +56 -0
- package/esm/components/Slider.js +140 -0
- package/esm/components/SparkLine.d.ts +397 -0
- package/esm/components/SparkLine.js +62 -0
- package/esm/components/Spinner.d.ts +266 -0
- package/esm/components/Spinner.js +202 -0
- package/esm/components/Steps.d.ts +117 -0
- package/esm/components/Steps.js +76 -0
- package/esm/components/Switch.d.ts +105 -0
- package/esm/components/Switch.js +73 -0
- package/esm/components/Tab.d.ts +2 -0
- package/esm/components/Tab.js +7 -0
- package/esm/components/Table.d.ts +2 -0
- package/esm/components/Table.js +7 -0
- package/esm/components/TableSelection.d.ts +791 -0
- package/esm/components/TableSelection.js +169 -0
- package/esm/components/Tabs.d.ts +670 -0
- package/esm/components/Tabs.js +607 -0
- package/esm/components/TabsTransfer.d.ts +423 -0
- package/esm/components/TabsTransfer.js +221 -0
- package/esm/components/TabsTransferPicker.d.ts +267 -0
- package/esm/components/TabsTransferPicker.js +81 -0
- package/esm/components/Tag.d.ts +318 -0
- package/esm/components/Tag.js +137 -0
- package/esm/components/Textarea.d.ts +564 -0
- package/esm/components/Textarea.js +147 -0
- package/esm/components/Timeline.d.ts +56 -0
- package/esm/components/Timeline.js +60 -0
- package/esm/components/TimelineItem.d.ts +1292 -0
- package/esm/components/TimelineItem.js +101 -0
- package/esm/components/Tinymce.d.ts +66 -0
- package/esm/components/Tinymce.js +632 -0
- package/esm/components/TitleBar.d.ts +123 -0
- package/esm/components/TitleBar.js +48 -0
- package/esm/components/Toast.d.ts +591 -0
- package/esm/components/Toast.js +247 -0
- package/esm/components/Tooltip.d.ts +65 -0
- package/esm/components/Tooltip.js +36 -0
- package/esm/components/TooltipWrapper.d.ts +217 -0
- package/esm/components/TooltipWrapper.js +181 -0
- package/esm/components/Transfer.d.ts +1844 -0
- package/esm/components/Transfer.js +485 -0
- package/esm/components/TransferDropDown.d.ts +634 -0
- package/esm/components/TransferDropDown.js +98 -0
- package/esm/components/TransferPicker.d.ts +275 -0
- package/esm/components/TransferPicker.js +98 -0
- package/esm/components/TransferSearch.d.ts +283 -0
- package/esm/components/TransferSearch.js +100 -0
- package/esm/components/Tree.d.ts +1953 -0
- package/esm/components/Tree.js +1220 -0
- package/esm/components/TreeSelection.d.ts +601 -0
- package/esm/components/TreeSelection.js +201 -0
- package/esm/components/UserSelect.d.ts +541 -0
- package/esm/components/UserSelect.js +674 -0
- package/esm/components/UserTabSelect.d.ts +315 -0
- package/esm/components/UserTabSelect.js +227 -0
- package/esm/components/VerificationCode.d.ts +116 -0
- package/esm/components/VerificationCode.js +172 -0
- package/esm/components/VirtualList.d.ts +2 -0
- package/esm/components/VirtualList.js +7 -0
- package/esm/components/WithRemoteConfig.d.ts +383 -0
- package/esm/components/WithRemoteConfig.js +302 -0
- package/esm/components/WithStore.d.ts +72 -0
- package/esm/components/WithStore.js +48 -0
- package/esm/components/calendar/Calendar.d.ts +83 -0
- package/esm/components/calendar/Calendar.js +529 -0
- package/esm/components/calendar/CalendarContainer.d.ts +10 -0
- package/esm/components/calendar/CalendarContainer.js +27 -0
- package/esm/components/calendar/DaysView.d.ts +184 -0
- package/esm/components/calendar/DaysView.js +528 -0
- package/esm/components/calendar/MonthsView.d.ts +133 -0
- package/esm/components/calendar/MonthsView.js +175 -0
- package/esm/components/calendar/QuartersView.d.ts +102 -0
- package/esm/components/calendar/QuartersView.js +125 -0
- package/esm/components/calendar/TimeView.d.ts +183 -0
- package/esm/components/calendar/TimeView.js +559 -0
- package/esm/components/calendar/YearsView.d.ts +102 -0
- package/esm/components/calendar/YearsView.js +122 -0
- package/esm/components/condition-builder/Expression.d.ts +292 -0
- package/esm/components/condition-builder/Expression.js +121 -0
- package/esm/components/condition-builder/Field.d.ts +272 -0
- package/esm/components/condition-builder/Field.js +32 -0
- package/esm/components/condition-builder/Formula.d.ts +261 -0
- package/esm/components/condition-builder/Func.d.ts +273 -0
- package/esm/components/condition-builder/Func.js +75 -0
- package/esm/components/condition-builder/Group.d.ts +310 -0
- package/esm/components/condition-builder/Group.js +191 -0
- package/esm/components/condition-builder/GroupOrItem.d.ts +87 -0
- package/esm/components/condition-builder/GroupOrItem.js +105 -0
- package/esm/components/condition-builder/InputSwitch.d.ts +47 -0
- package/esm/components/condition-builder/InputSwitch.js +28 -0
- package/esm/components/condition-builder/Item.d.ts +287 -0
- package/esm/components/condition-builder/Item.js +232 -0
- package/esm/components/condition-builder/Value.d.ts +274 -0
- package/esm/components/condition-builder/Value.js +114 -0
- package/esm/components/condition-builder/config.d.ts +36 -0
- package/esm/components/condition-builder/config.js +120 -0
- package/esm/components/condition-builder/index.d.ts +319 -0
- package/esm/components/condition-builder/index.js +228 -0
- package/esm/components/condition-builder/types.d.ts +116 -0
- package/esm/components/formula/CodeEditor.d.ts +92 -0
- package/esm/components/formula/CodeEditor.js +99 -0
- package/esm/components/formula/Editor.d.ts +516 -0
- package/esm/components/formula/Editor.js +446 -0
- package/esm/components/formula/FuncList.d.ts +46 -0
- package/esm/components/formula/FuncList.js +64 -0
- package/esm/components/formula/Input.d.ts +292 -0
- package/esm/components/formula/Input.js +122 -0
- package/esm/components/formula/Picker.d.ts +492 -0
- package/esm/components/formula/Picker.js +454 -0
- package/esm/components/formula/VariableList.d.ts +58 -0
- package/esm/components/formula/VariableList.js +183 -0
- package/esm/components/formula/plugin.d.ts +51 -0
- package/esm/components/formula/plugin.js +372 -0
- package/esm/components/icons.d.ts +61 -0
- package/esm/components/icons.js +458 -0
- package/esm/components/index.d.ts +138 -0
- package/esm/components/json-schema/Array.d.ts +3 -0
- package/esm/components/json-schema/Array.js +129 -0
- package/esm/components/json-schema/Item.d.ts +5 -0
- package/esm/components/json-schema/Item.js +63 -0
- package/esm/components/json-schema/Object.d.ts +5 -0
- package/esm/components/json-schema/Object.js +265 -0
- package/esm/components/json-schema/index.d.ts +272 -0
- package/esm/components/json-schema/index.js +29 -0
- package/esm/components/menu/MenuContext.d.ts +83 -0
- package/esm/components/menu/MenuContext.js +25 -0
- package/esm/components/menu/MenuItem.d.ts +81 -0
- package/esm/components/menu/MenuItem.js +112 -0
- package/esm/components/menu/PanelMenu.d.ts +46 -0
- package/esm/components/menu/PanelMenu.js +68 -0
- package/esm/components/menu/SubMenu.d.ts +84 -0
- package/esm/components/menu/SubMenu.js +137 -0
- package/esm/components/menu/index.d.ts +381 -0
- package/esm/components/menu/index.js +369 -0
- package/esm/components/schema-editor/Array.d.ts +11 -0
- package/esm/components/schema-editor/Array.js +84 -0
- package/esm/components/schema-editor/Common.d.ts +61 -0
- package/esm/components/schema-editor/Common.js +161 -0
- package/esm/components/schema-editor/Item.d.ts +8 -0
- package/esm/components/schema-editor/Item.js +24 -0
- package/esm/components/schema-editor/Object.d.ts +51 -0
- package/esm/components/schema-editor/Object.js +294 -0
- package/esm/components/schema-editor/SchemaVariableList.d.ts +186 -0
- package/esm/components/schema-editor/SchemaVariableList.js +74 -0
- package/esm/components/schema-editor/SchemaVariableListPicker.d.ts +179 -0
- package/esm/components/schema-editor/SchemaVariableListPicker.js +34 -0
- package/esm/components/schema-editor/index.d.ts +797 -0
- package/esm/components/schema-editor/index.js +122 -0
- package/esm/components/table/Cell.d.ts +36 -0
- package/esm/components/table/Cell.js +43 -0
- package/esm/components/table/ColGroup.d.ts +24 -0
- package/esm/components/table/ColGroup.js +58 -0
- package/esm/components/table/Head.d.ts +45 -0
- package/esm/components/table/Head.js +150 -0
- package/esm/components/table/HeadCellDropDown.d.ts +289 -0
- package/esm/components/table/HeadCellDropDown.js +55 -0
- package/esm/components/table/HeadCellFilter.d.ts +414 -0
- package/esm/components/table/HeadCellFilter.js +131 -0
- package/esm/components/table/HeadCellSelect.d.ts +357 -0
- package/esm/components/table/HeadCellSelect.js +52 -0
- package/esm/components/table/HeadCellSort.d.ts +278 -0
- package/esm/components/table/HeadCellSort.js +88 -0
- package/esm/components/table/ItemActionsWrapper.d.ts +10 -0
- package/esm/components/table/ItemActionsWrapper.js +29 -0
- package/esm/components/table/Row.d.ts +56 -0
- package/esm/components/table/Row.js +224 -0
- package/esm/components/table/SummaryRow.d.ts +28 -0
- package/esm/components/table/SummaryRow.js +73 -0
- package/esm/components/table/index.d.ts +852 -0
- package/esm/components/table/index.js +1069 -0
- package/esm/components/table/util.d.ts +56 -0
- package/esm/components/table/util.js +276 -0
- package/esm/components/virtual-list/AutoSizer.d.ts +19 -0
- package/esm/components/virtual-list/AutoSizer.js +49 -0
- package/esm/components/virtual-list/SizeAndPositionManager.d.ts +70 -0
- package/esm/components/virtual-list/SizeAndPositionManager.js +216 -0
- package/esm/components/virtual-list/constants.d.ts +34 -0
- package/esm/components/virtual-list/constants.js +45 -0
- package/esm/components/virtual-list/index.d.ts +99 -0
- package/esm/components/virtual-list/index.js +288 -0
- package/esm/components/withBadge.d.ts +2 -0
- package/esm/components/withBadge.js +7 -0
- package/esm/hooks/index.d.ts +8 -0
- package/esm/hooks/use-click-away.d.ts +12 -0
- package/esm/hooks/use-click-away.js +55 -0
- package/esm/hooks/use-on-screen.d.ts +2 -0
- package/esm/hooks/use-on-screen.js +28 -0
- package/esm/hooks/use-set-state.d.ts +2 -0
- package/esm/hooks/use-set-state.js +19 -0
- package/esm/hooks/use-sub-form.d.ts +4 -0
- package/esm/hooks/use-sub-form.js +39 -0
- package/esm/hooks/use-touch.d.ts +16 -0
- package/esm/hooks/use-touch.js +77 -0
- package/esm/hooks/use-update-effect.d.ts +3 -0
- package/esm/hooks/use-update-effect.js +21 -0
- package/esm/hooks/use-validation-resolver.d.ts +7 -0
- package/esm/hooks/use-validation-resolver.js +115 -0
- package/esm/icons/alert-danger.svg.js +22 -0
- package/esm/icons/alert-info.svg.js +22 -0
- package/esm/icons/alert-success.svg.js +22 -0
- package/esm/icons/alert-warning.svg.js +22 -0
- package/esm/icons/arrow-double-left.svg.js +24 -0
- package/esm/icons/arrow-double-right.svg.js +24 -0
- package/esm/icons/back.svg.js +21 -0
- package/esm/icons/calendar.svg.js +31 -0
- package/esm/icons/caret.svg.js +21 -0
- package/esm/icons/check.svg.js +21 -0
- package/esm/icons/clock.svg.js +29 -0
- package/esm/icons/close-small.svg.js +24 -0
- package/esm/icons/close.svg.js +21 -0
- package/esm/icons/cloud-upload.svg.js +22 -0
- package/esm/icons/column-filter.svg.js +22 -0
- package/esm/icons/columns.svg.js +21 -0
- package/esm/icons/compress-alt.svg.js +21 -0
- package/esm/icons/copy.svg.js +26 -0
- package/esm/icons/date.svg.js +26 -0
- package/esm/icons/department.svg.js +52 -0
- package/esm/icons/desk-empty.svg.js +73 -0
- package/esm/icons/dot.svg.js +36 -0
- package/esm/icons/down-arrow-bold.svg.js +22 -0
- package/esm/icons/down.svg.js +23 -0
- package/esm/icons/download.svg.js +24 -0
- package/esm/icons/drag-bar.svg.js +53 -0
- package/esm/icons/drag.svg.js +22 -0
- package/esm/icons/edit.svg.js +21 -0
- package/esm/icons/ellipsis-v.svg.js +21 -0
- package/esm/icons/enter.svg.js +20 -0
- package/esm/icons/exchange.svg.js +21 -0
- package/esm/icons/expand-alt.svg.js +21 -0
- package/esm/icons/fail.svg.js +31 -0
- package/esm/icons/file.svg.js +22 -0
- package/esm/icons/filter.svg.js +21 -0
- package/esm/icons/folder.svg.js +24 -0
- package/esm/icons/fullscreen.svg.js +21 -0
- package/esm/icons/function.svg.js +21 -0
- package/esm/icons/home.svg.js +21 -0
- package/esm/icons/if.svg.js +21 -0
- package/esm/icons/image.svg.js +20 -0
- package/esm/icons/info-circle.svg.js +21 -0
- package/esm/icons/info.svg.js +27 -0
- package/esm/icons/input-clear.svg.js +20 -0
- package/esm/icons/invisible.svg.js +22 -0
- package/esm/icons/left-arrow.svg.js +23 -0
- package/esm/icons/loading-outline.svg.js +21 -0
- package/esm/icons/location.svg.js +20 -0
- package/esm/icons/menu.svg.js +20 -0
- package/esm/icons/minus.svg.js +21 -0
- package/esm/icons/move.svg.js +22 -0
- package/esm/icons/mute.svg.js +21 -0
- package/esm/icons/new-edit.svg.js +22 -0
- package/esm/icons/pause.svg.js +21 -0
- package/esm/icons/pencil.svg.js +21 -0
- package/esm/icons/play.svg.js +20 -0
- package/esm/icons/plus-cicle.svg.js +20 -0
- package/esm/icons/plus-fine.svg.js +21 -0
- package/esm/icons/plus.svg.js +21 -0
- package/esm/icons/post.svg.js +48 -0
- package/esm/icons/question-mark.svg.js +26 -0
- package/esm/icons/question.svg.js +21 -0
- package/esm/icons/question2.svg.js +34 -0
- package/esm/icons/redo.svg.js +21 -0
- package/esm/icons/refresh.svg.js +21 -0
- package/esm/icons/reload.svg.js +21 -0
- package/esm/icons/remove.svg.js +21 -0
- package/esm/icons/retry.svg.js +24 -0
- package/esm/icons/right-arrow-bold.svg.js +21 -0
- package/esm/icons/right-arrow.svg.js +23 -0
- package/esm/icons/right-double-arrow.svg.js +22 -0
- package/esm/icons/role.svg.js +43 -0
- package/esm/icons/rotate-left.svg.js +22 -0
- package/esm/icons/rotate-right.svg.js +22 -0
- package/esm/icons/rotate-screen.svg.js +21 -0
- package/esm/icons/scale-origin.svg.js +24 -0
- package/esm/icons/schedule.svg.js +24 -0
- package/esm/icons/search.svg.js +21 -0
- package/esm/icons/setting.svg.js +21 -0
- package/esm/icons/slider-handle-icon.svg.js +22 -0
- package/esm/icons/sort-asc.svg.js +21 -0
- package/esm/icons/sort-default.svg.js +21 -0
- package/esm/icons/sort-desc.svg.js +21 -0
- package/esm/icons/star.svg.js +21 -0
- package/esm/icons/status-close.svg.js +23 -0
- package/esm/icons/steps-finsh.svg.js +22 -0
- package/esm/icons/sub-plus.svg.js +20 -0
- package/esm/icons/success.svg.js +29 -0
- package/esm/icons/transparent.svg.js +38 -0
- package/esm/icons/trash.svg.js +22 -0
- package/esm/icons/tree-down.svg.js +21 -0
- package/esm/icons/undo-normal.svg.js +25 -0
- package/esm/icons/undo.svg.js +21 -0
- package/esm/icons/unfullscreen.svg.js +21 -0
- package/esm/icons/upload.svg.js +21 -0
- package/esm/icons/user-remove.svg.js +33 -0
- package/esm/icons/view.svg.js +22 -0
- package/esm/icons/volume.svg.js +24 -0
- package/esm/icons/warning-mark.svg.js +22 -0
- package/esm/icons/warning.svg.js +21 -0
- package/esm/icons/window-restore.svg.js +21 -0
- package/esm/icons/zoom-in.svg.js +21 -0
- package/esm/icons/zoom-out.svg.js +21 -0
- package/esm/index.d.ts +15 -0
- package/esm/index.js +156 -0
- package/esm/locale/de-DE.d.ts +1 -0
- package/esm/locale/de-DE.js +421 -0
- package/esm/locale/en-US.d.ts +1 -0
- package/esm/locale/en-US.js +427 -0
- package/esm/locale/zh-CN.d.ts +1 -0
- package/esm/locale/zh-CN.js +436 -0
- package/esm/themes/ang.d.ts +3 -0
- package/esm/themes/ang.js +15 -0
- package/esm/themes/antd.d.ts +1 -0
- package/esm/themes/antd.js +42 -0
- package/esm/themes/cxd.d.ts +3 -0
- package/esm/themes/cxd.js +455 -0
- package/esm/themes/dark.d.ts +3 -0
- package/esm/themes/dark.js +23 -0
- package/esm/themes/default.d.ts +4 -0
- package/esm/utils/index.d.ts +2 -0
- package/esm/utils/smoothSignature.d.ts +86 -0
- package/esm/utils/vectorComputed.d.ts +20 -0
- package/esm/utils/vectorComputed.js +75 -0
- package/esm/withRemoteConfig.d.ts +2 -0
- package/esm/withRemoteConfig.js +7 -0
- package/esm/withStore.d.ts +2 -0
- package/esm/withStore.js +7 -0
- package/lib/components/404.d.ts +53 -0
- package/lib/components/404.js +43 -0
- package/lib/components/Alert.d.ts +615 -0
- package/lib/components/Alert.js +279 -0
- package/lib/components/Alert2.d.ts +117 -0
- package/lib/components/Alert2.js +66 -0
- package/lib/components/AlphabetIndexer.d.ts +11 -0
- package/lib/components/AlphabetIndexer.js +59 -0
- package/lib/components/AnchorNav.d.ts +162 -0
- package/lib/components/AnchorNav.js +162 -0
- package/lib/components/AnchorNavSection.d.ts +2 -0
- package/lib/components/AnchorNavSection.js +14 -0
- package/lib/components/ArrayInput.d.ts +617 -0
- package/lib/components/ArrayInput.js +160 -0
- package/lib/components/AsideNav.d.ts +142 -0
- package/lib/components/AsideNav.js +140 -0
- package/lib/components/AssociatedSelection.d.ts +564 -0
- package/lib/components/AssociatedSelection.js +110 -0
- package/lib/components/AutoFoldedList.d.ts +87 -0
- package/lib/components/AutoFoldedList.js +128 -0
- package/lib/components/AutoSizer.d.ts +2 -0
- package/lib/components/AutoSizer.js +15 -0
- package/lib/components/Avatar.d.ts +374 -0
- package/lib/components/Avatar.js +154 -0
- package/lib/components/Badge.d.ts +118 -0
- package/lib/components/Badge.js +165 -0
- package/lib/components/BaiduMapPicker.d.ts +100 -0
- package/lib/components/BaiduMapPicker.js +379 -0
- package/lib/components/BarCode.d.ts +56 -0
- package/lib/components/BarCode.js +52 -0
- package/lib/components/Breadcrumb.d.ts +115 -0
- package/lib/components/Breadcrumb.js +170 -0
- package/lib/components/Button.d.ts +147 -0
- package/lib/components/Button.js +71 -0
- package/lib/components/CalendarMobile.d.ts +431 -0
- package/lib/components/CalendarMobile.js +546 -0
- package/lib/components/Card.d.ts +444 -0
- package/lib/components/Card.js +100 -0
- package/lib/components/Cascader.d.ts +108 -0
- package/lib/components/Cascader.js +527 -0
- package/lib/components/ChainedDropdownSelection.d.ts +561 -0
- package/lib/components/ChainedDropdownSelection.js +116 -0
- package/lib/components/ChainedSelection.d.ts +554 -0
- package/lib/components/ChainedSelection.js +197 -0
- package/lib/components/Checkbox.d.ts +110 -0
- package/lib/components/Checkbox.js +95 -0
- package/lib/components/CityArea.d.ts +299 -0
- package/lib/components/CityArea.js +197 -0
- package/lib/components/CityDB.d.ts +13 -0
- package/lib/components/CityDB.js +3949 -0
- package/lib/components/CodeMirror.d.ts +29 -0
- package/lib/components/CodeMirror.js +152 -0
- package/lib/components/Collapse.d.ts +447 -0
- package/lib/components/Collapse.js +192 -0
- package/lib/components/CollapseGroup.d.ts +219 -0
- package/lib/components/CollapseGroup.js +124 -0
- package/lib/components/ColorPicker.d.ts +530 -0
- package/lib/components/ColorPicker.js +267 -0
- package/lib/components/Combo.d.ts +354 -0
- package/lib/components/Combo.js +165 -0
- package/lib/components/ConditionBuilder.d.ts +2 -0
- package/lib/components/ConditionBuilder.js +14 -0
- package/lib/components/ConfirmBox.d.ts +322 -0
- package/lib/components/ConfirmBox.js +141 -0
- package/lib/components/ContextMenu.d.ts +115 -0
- package/lib/components/ContextMenu.js +327 -0
- package/lib/components/DatePicker.d.ts +638 -0
- package/lib/components/DatePicker.js +725 -0
- package/lib/components/DateRangePicker.d.ts +1046 -0
- package/lib/components/DateRangePicker.js +1398 -0
- package/lib/components/DiffEditor.d.ts +21 -0
- package/lib/components/DiffEditor.js +130 -0
- package/lib/components/DndContainer.d.ts +205 -0
- package/lib/components/DndContainer.js +32 -0
- package/lib/components/Drawer.d.ts +159 -0
- package/lib/components/Drawer.js +282 -0
- package/lib/components/DropDownSelection.d.ts +557 -0
- package/lib/components/DropDownSelection.js +85 -0
- package/lib/components/DropdownContextMenus.d.ts +84 -0
- package/lib/components/DropdownContextMenus.js +101 -0
- package/lib/components/Editor.d.ts +681 -0
- package/lib/components/Editor.js +246 -0
- package/lib/components/Form.d.ts +31 -0
- package/lib/components/Form.js +97 -0
- package/lib/components/FormField.d.ts +287 -0
- package/lib/components/FormField.js +90 -0
- package/lib/components/FormulaPicker.d.ts +2 -0
- package/lib/components/FormulaPicker.js +14 -0
- package/lib/components/GaodeMapPicker.d.ts +89 -0
- package/lib/components/GaodeMapPicker.js +217 -0
- package/lib/components/GridNav.d.ts +53 -0
- package/lib/components/GridNav.js +133 -0
- package/lib/components/GridNavItem.d.ts +2 -0
- package/lib/components/GridNavItem.js +14 -0
- package/lib/components/GroupedSelection.d.ts +543 -0
- package/lib/components/GroupedSelection.js +150 -0
- package/lib/components/HeadCellDropDown.d.ts +2 -0
- package/lib/components/HeadCellDropDown.js +14 -0
- package/lib/components/HorizontalScroll.d.ts +75 -0
- package/lib/components/HorizontalScroll.js +283 -0
- package/lib/components/Html.d.ts +82 -0
- package/lib/components/Html.js +59 -0
- package/lib/components/Icon.d.ts +2 -0
- package/lib/components/Icon.js +14 -0
- package/lib/components/ImageGallery.d.ts +465 -0
- package/lib/components/ImageGallery.js +409 -0
- package/lib/components/Input.d.ts +18 -0
- package/lib/components/Input.js +86 -0
- package/lib/components/InputBox.d.ts +100 -0
- package/lib/components/InputBox.js +110 -0
- package/lib/components/InputBoxWithSuggestion.d.ts +272 -0
- package/lib/components/InputBoxWithSuggestion.js +81 -0
- package/lib/components/InputJSONSchema.d.ts +2 -0
- package/lib/components/InputJSONSchema.js +14 -0
- package/lib/components/InputTable.d.ts +317 -0
- package/lib/components/InputTable.js +189 -0
- package/lib/components/JSONSchemaEditor.d.ts +2 -0
- package/lib/components/JSONSchemaEditor.js +14 -0
- package/lib/components/Layout.d.ts +74 -0
- package/lib/components/Layout.js +56 -0
- package/lib/components/Link.d.ts +60 -0
- package/lib/components/Link.js +56 -0
- package/lib/components/ListGroup.d.ts +77 -0
- package/lib/components/ListGroup.js +43 -0
- package/lib/components/ListMenu.d.ts +568 -0
- package/lib/components/ListMenu.js +74 -0
- package/lib/components/LocationPicker.d.ts +467 -0
- package/lib/components/LocationPicker.js +220 -0
- package/lib/components/Markdown.d.ts +25 -0
- package/lib/components/Markdown.js +83 -0
- package/lib/components/Menu.d.ts +2 -0
- package/lib/components/Menu.js +14 -0
- package/lib/components/MixedInput.d.ts +55 -0
- package/lib/components/MixedInput.js +99 -0
- package/lib/components/MobileDevTool.d.ts +12 -0
- package/lib/components/MobileDevTool.js +325 -0
- package/lib/components/Modal.d.ts +1316 -0
- package/lib/components/Modal.js +272 -0
- package/lib/components/ModalManager.d.ts +17 -0
- package/lib/components/ModalManager.js +53 -0
- package/lib/components/MonthRangePicker.d.ts +744 -0
- package/lib/components/MultilineText.d.ts +454 -0
- package/lib/components/MultilineText.js +102 -0
- package/lib/components/NumberInput.d.ts +201 -0
- package/lib/components/NumberInput.js +289 -0
- package/lib/components/OverflowTpl.d.ts +61 -0
- package/lib/components/OverflowTpl.js +109 -0
- package/lib/components/Pagination.d.ts +812 -0
- package/lib/components/Pagination.js +390 -0
- package/lib/components/PdfViewer.d.ts +49 -0
- package/lib/components/PdfViewer.js +89 -0
- package/lib/components/Picker.d.ts +277 -0
- package/lib/components/Picker.js +80 -0
- package/lib/components/PickerColumn.d.ts +62 -0
- package/lib/components/PickerColumn.js +288 -0
- package/lib/components/PickerContainer.d.ts +291 -0
- package/lib/components/PickerContainer.js +169 -0
- package/lib/components/PopOverContainer.d.ts +59 -0
- package/lib/components/PopOverContainer.js +162 -0
- package/lib/components/PopUp.d.ts +573 -0
- package/lib/components/PopUp.js +94 -0
- package/lib/components/Progress.d.ts +311 -0
- package/lib/components/Progress.js +148 -0
- package/lib/components/PullRefresh.d.ts +79 -0
- package/lib/components/PullRefresh.js +178 -0
- package/lib/components/Radios.d.ts +170 -0
- package/lib/components/Radios.js +126 -0
- package/lib/components/Range.d.ts +131 -0
- package/lib/components/Range.js +528 -0
- package/lib/components/Rating.d.ts +227 -0
- package/lib/components/Rating.js +349 -0
- package/lib/components/ResultBox.d.ts +532 -0
- package/lib/components/ResultBox.js +209 -0
- package/lib/components/ResultList.d.ts +554 -0
- package/lib/components/ResultList.js +268 -0
- package/lib/components/ResultTableList.d.ts +786 -0
- package/lib/components/ResultTableList.js +161 -0
- package/lib/components/ResultTreeList.d.ts +425 -0
- package/lib/components/ResultTreeList.js +256 -0
- package/lib/components/RichText.d.ts +48 -0
- package/lib/components/RichText.js +283 -0
- package/lib/components/SearchBox.d.ts +625 -0
- package/lib/components/SearchBox.js +315 -0
- package/lib/components/Select.d.ts +6497 -0
- package/lib/components/Select.js +832 -0
- package/lib/components/SelectMobile.d.ts +38 -0
- package/lib/components/SelectMobile.js +382 -0
- package/lib/components/Selection.d.ts +598 -0
- package/lib/components/Selection.js +176 -0
- package/lib/components/Shape.d.ts +58 -0
- package/lib/components/Shape.js +434 -0
- package/lib/components/Signature.d.ts +279 -0
- package/lib/components/Signature.js +297 -0
- package/lib/components/Slider.d.ts +56 -0
- package/lib/components/Slider.js +146 -0
- package/lib/components/SparkLine.d.ts +397 -0
- package/lib/components/SparkLine.js +74 -0
- package/lib/components/Spinner.d.ts +266 -0
- package/lib/components/Spinner.js +210 -0
- package/lib/components/Steps.d.ts +117 -0
- package/lib/components/Steps.js +84 -0
- package/lib/components/Switch.d.ts +105 -0
- package/lib/components/Switch.js +80 -0
- package/lib/components/Tab.d.ts +2 -0
- package/lib/components/Tab.js +14 -0
- package/lib/components/Table.d.ts +2 -0
- package/lib/components/Table.js +14 -0
- package/lib/components/TableSelection.d.ts +791 -0
- package/lib/components/TableSelection.js +183 -0
- package/lib/components/Tabs.d.ts +670 -0
- package/lib/components/Tabs.js +618 -0
- package/lib/components/TabsTransfer.d.ts +423 -0
- package/lib/components/TabsTransfer.js +234 -0
- package/lib/components/TabsTransferPicker.d.ts +267 -0
- package/lib/components/TabsTransferPicker.js +93 -0
- package/lib/components/Tag.d.ts +318 -0
- package/lib/components/Tag.js +146 -0
- package/lib/components/Textarea.d.ts +564 -0
- package/lib/components/Textarea.js +160 -0
- package/lib/components/Timeline.d.ts +56 -0
- package/lib/components/Timeline.js +68 -0
- package/lib/components/TimelineItem.d.ts +1292 -0
- package/lib/components/TimelineItem.js +118 -0
- package/lib/components/Tinymce.d.ts +66 -0
- package/lib/components/Tinymce.js +648 -0
- package/lib/components/TitleBar.d.ts +123 -0
- package/lib/components/TitleBar.js +51 -0
- package/lib/components/Toast.d.ts +591 -0
- package/lib/components/Toast.js +258 -0
- package/lib/components/Tooltip.d.ts +65 -0
- package/lib/components/Tooltip.js +43 -0
- package/lib/components/TooltipWrapper.d.ts +217 -0
- package/lib/components/TooltipWrapper.js +188 -0
- package/lib/components/Transfer.d.ts +1844 -0
- package/lib/components/Transfer.js +502 -0
- package/lib/components/TransferDropDown.d.ts +634 -0
- package/lib/components/TransferDropDown.js +106 -0
- package/lib/components/TransferPicker.d.ts +275 -0
- package/lib/components/TransferPicker.js +110 -0
- package/lib/components/TransferSearch.d.ts +283 -0
- package/lib/components/TransferSearch.js +113 -0
- package/lib/components/Tree.d.ts +1953 -0
- package/lib/components/Tree.js +1214 -0
- package/lib/components/TreeSelection.d.ts +601 -0
- package/lib/components/TreeSelection.js +209 -0
- package/lib/components/UserSelect.d.ts +541 -0
- package/lib/components/UserSelect.js +685 -0
- package/lib/components/UserTabSelect.d.ts +315 -0
- package/lib/components/UserTabSelect.js +235 -0
- package/lib/components/VerificationCode.d.ts +116 -0
- package/lib/components/VerificationCode.js +191 -0
- package/lib/components/VirtualList.d.ts +2 -0
- package/lib/components/VirtualList.js +14 -0
- package/lib/components/WithRemoteConfig.d.ts +382 -0
- package/lib/components/WithRemoteConfig.js +316 -0
- package/lib/components/WithStore.d.ts +72 -0
- package/lib/components/WithStore.js +61 -0
- package/lib/components/calendar/Calendar.d.ts +83 -0
- package/lib/components/calendar/Calendar.js +542 -0
- package/lib/components/calendar/CalendarContainer.d.ts +10 -0
- package/lib/components/calendar/CalendarContainer.js +38 -0
- package/lib/components/calendar/DaysView.d.ts +184 -0
- package/lib/components/calendar/DaysView.js +547 -0
- package/lib/components/calendar/MonthsView.d.ts +133 -0
- package/lib/components/calendar/MonthsView.js +188 -0
- package/lib/components/calendar/QuartersView.d.ts +102 -0
- package/lib/components/calendar/QuartersView.js +138 -0
- package/lib/components/calendar/TimeView.d.ts +183 -0
- package/lib/components/calendar/TimeView.js +574 -0
- package/lib/components/calendar/YearsView.d.ts +102 -0
- package/lib/components/calendar/YearsView.js +135 -0
- package/lib/components/condition-builder/Expression.d.ts +292 -0
- package/lib/components/condition-builder/Expression.js +133 -0
- package/lib/components/condition-builder/Field.d.ts +272 -0
- package/lib/components/condition-builder/Field.js +44 -0
- package/lib/components/condition-builder/Formula.d.ts +261 -0
- package/lib/components/condition-builder/Func.d.ts +273 -0
- package/lib/components/condition-builder/Func.js +87 -0
- package/lib/components/condition-builder/Group.d.ts +310 -0
- package/lib/components/condition-builder/Group.js +203 -0
- package/lib/components/condition-builder/GroupOrItem.d.ts +87 -0
- package/lib/components/condition-builder/GroupOrItem.js +117 -0
- package/lib/components/condition-builder/InputSwitch.d.ts +47 -0
- package/lib/components/condition-builder/InputSwitch.js +36 -0
- package/lib/components/condition-builder/Item.d.ts +287 -0
- package/lib/components/condition-builder/Item.js +244 -0
- package/lib/components/condition-builder/Value.d.ts +274 -0
- package/lib/components/condition-builder/Value.js +127 -0
- package/lib/components/condition-builder/config.d.ts +36 -0
- package/lib/components/condition-builder/config.js +125 -0
- package/lib/components/condition-builder/index.d.ts +319 -0
- package/lib/components/condition-builder/index.js +240 -0
- package/lib/components/condition-builder/types.d.ts +116 -0
- package/lib/components/formula/CodeEditor.d.ts +92 -0
- package/lib/components/formula/CodeEditor.js +110 -0
- package/lib/components/formula/Editor.d.ts +516 -0
- package/lib/components/formula/Editor.js +460 -0
- package/lib/components/formula/FuncList.d.ts +46 -0
- package/lib/components/formula/FuncList.js +76 -0
- package/lib/components/formula/Input.d.ts +292 -0
- package/lib/components/formula/Input.js +134 -0
- package/lib/components/formula/Picker.d.ts +492 -0
- package/lib/components/formula/Picker.js +467 -0
- package/lib/components/formula/VariableList.d.ts +58 -0
- package/lib/components/formula/VariableList.js +194 -0
- package/lib/components/formula/plugin.d.ts +51 -0
- package/lib/components/formula/plugin.js +381 -0
- package/lib/components/icons.d.ts +61 -0
- package/lib/components/icons.js +486 -0
- package/lib/components/index.d.ts +138 -0
- package/lib/components/json-schema/Array.d.ts +3 -0
- package/lib/components/json-schema/Array.js +140 -0
- package/lib/components/json-schema/Item.d.ts +5 -0
- package/lib/components/json-schema/Item.js +75 -0
- package/lib/components/json-schema/Object.d.ts +5 -0
- package/lib/components/json-schema/Object.js +278 -0
- package/lib/components/json-schema/index.d.ts +272 -0
- package/lib/components/json-schema/index.js +40 -0
- package/lib/components/menu/MenuContext.d.ts +83 -0
- package/lib/components/menu/MenuContext.js +29 -0
- package/lib/components/menu/MenuItem.d.ts +81 -0
- package/lib/components/menu/MenuItem.js +120 -0
- package/lib/components/menu/PanelMenu.d.ts +46 -0
- package/lib/components/menu/PanelMenu.js +74 -0
- package/lib/components/menu/SubMenu.d.ts +84 -0
- package/lib/components/menu/SubMenu.js +145 -0
- package/lib/components/menu/index.d.ts +381 -0
- package/lib/components/menu/index.js +379 -0
- package/lib/components/schema-editor/Array.d.ts +11 -0
- package/lib/components/schema-editor/Array.js +95 -0
- package/lib/components/schema-editor/Common.d.ts +61 -0
- package/lib/components/schema-editor/Common.js +174 -0
- package/lib/components/schema-editor/Item.d.ts +8 -0
- package/lib/components/schema-editor/Item.js +35 -0
- package/lib/components/schema-editor/Object.d.ts +51 -0
- package/lib/components/schema-editor/Object.js +305 -0
- package/lib/components/schema-editor/SchemaVariableList.d.ts +186 -0
- package/lib/components/schema-editor/SchemaVariableList.js +86 -0
- package/lib/components/schema-editor/SchemaVariableListPicker.d.ts +179 -0
- package/lib/components/schema-editor/SchemaVariableListPicker.js +46 -0
- package/lib/components/schema-editor/index.d.ts +797 -0
- package/lib/components/schema-editor/index.js +131 -0
- package/lib/components/table/Cell.d.ts +36 -0
- package/lib/components/table/Cell.js +50 -0
- package/lib/components/table/ColGroup.d.ts +24 -0
- package/lib/components/table/ColGroup.js +69 -0
- package/lib/components/table/Head.d.ts +45 -0
- package/lib/components/table/Head.js +157 -0
- package/lib/components/table/HeadCellDropDown.d.ts +289 -0
- package/lib/components/table/HeadCellDropDown.js +63 -0
- package/lib/components/table/HeadCellFilter.d.ts +414 -0
- package/lib/components/table/HeadCellFilter.js +140 -0
- package/lib/components/table/HeadCellSelect.d.ts +357 -0
- package/lib/components/table/HeadCellSelect.js +60 -0
- package/lib/components/table/HeadCellSort.d.ts +278 -0
- package/lib/components/table/HeadCellSort.js +96 -0
- package/lib/components/table/ItemActionsWrapper.d.ts +10 -0
- package/lib/components/table/ItemActionsWrapper.js +40 -0
- package/lib/components/table/Row.d.ts +56 -0
- package/lib/components/table/Row.js +231 -0
- package/lib/components/table/SummaryRow.d.ts +28 -0
- package/lib/components/table/SummaryRow.js +81 -0
- package/lib/components/table/index.d.ts +852 -0
- package/lib/components/table/index.js +1083 -0
- package/lib/components/table/util.d.ts +56 -0
- package/lib/components/table/util.js +298 -0
- package/lib/components/virtual-list/AutoSizer.d.ts +19 -0
- package/lib/components/virtual-list/AutoSizer.js +76 -0
- package/lib/components/virtual-list/SizeAndPositionManager.d.ts +70 -0
- package/lib/components/virtual-list/SizeAndPositionManager.js +220 -0
- package/lib/components/virtual-list/constants.d.ts +34 -0
- package/lib/components/virtual-list/constants.js +53 -0
- package/lib/components/virtual-list/index.d.ts +99 -0
- package/lib/components/virtual-list/index.js +317 -0
- package/lib/components/withBadge.d.ts +2 -0
- package/lib/components/withBadge.js +14 -0
- package/lib/helper.css +47744 -0
- package/lib/hooks/index.d.ts +8 -0
- package/lib/hooks/use-click-away.d.ts +12 -0
- package/lib/hooks/use-click-away.js +59 -0
- package/lib/hooks/use-on-screen.d.ts +2 -0
- package/lib/hooks/use-on-screen.js +32 -0
- package/lib/hooks/use-set-state.d.ts +2 -0
- package/lib/hooks/use-set-state.js +27 -0
- package/lib/hooks/use-sub-form.d.ts +4 -0
- package/lib/hooks/use-sub-form.js +48 -0
- package/lib/hooks/use-touch.d.ts +16 -0
- package/lib/hooks/use-touch.js +81 -0
- package/lib/hooks/use-update-effect.d.ts +3 -0
- package/lib/hooks/use-update-effect.js +25 -0
- package/lib/hooks/use-validation-resolver.d.ts +7 -0
- package/lib/hooks/use-validation-resolver.js +125 -0
- package/lib/icons/alert-danger.svg.js +29 -0
- package/lib/icons/alert-info.svg.js +29 -0
- package/lib/icons/alert-success.svg.js +29 -0
- package/lib/icons/alert-warning.svg.js +29 -0
- package/lib/icons/arrow-double-left.svg.js +31 -0
- package/lib/icons/arrow-double-right.svg.js +31 -0
- package/lib/icons/back.svg.js +28 -0
- package/lib/icons/calendar.svg.js +38 -0
- package/lib/icons/caret.svg.js +28 -0
- package/lib/icons/check.svg.js +28 -0
- package/lib/icons/clock.svg.js +36 -0
- package/lib/icons/close-small.svg.js +31 -0
- package/lib/icons/close.svg.js +28 -0
- package/lib/icons/cloud-upload.svg.js +29 -0
- package/lib/icons/column-filter.svg.js +29 -0
- package/lib/icons/columns.svg.js +28 -0
- package/lib/icons/compress-alt.svg.js +28 -0
- package/lib/icons/copy.svg.js +33 -0
- package/lib/icons/date.svg.js +33 -0
- package/lib/icons/department.svg.js +59 -0
- package/lib/icons/desk-empty.svg.js +80 -0
- package/lib/icons/dot.svg.js +43 -0
- package/lib/icons/down-arrow-bold.svg.js +29 -0
- package/lib/icons/down.svg.js +30 -0
- package/lib/icons/download.svg.js +31 -0
- package/lib/icons/drag-bar.svg.js +60 -0
- package/lib/icons/drag.svg.js +29 -0
- package/lib/icons/edit.svg.js +28 -0
- package/lib/icons/ellipsis-v.svg.js +28 -0
- package/lib/icons/enter.svg.js +27 -0
- package/lib/icons/exchange.svg.js +28 -0
- package/lib/icons/expand-alt.svg.js +28 -0
- package/lib/icons/fail.svg.js +38 -0
- package/lib/icons/file.svg.js +29 -0
- package/lib/icons/filter.svg.js +28 -0
- package/lib/icons/folder.svg.js +31 -0
- package/lib/icons/fullscreen.svg.js +28 -0
- package/lib/icons/function.svg.js +28 -0
- package/lib/icons/home.svg.js +28 -0
- package/lib/icons/if.svg.js +28 -0
- package/lib/icons/image.svg.js +27 -0
- package/lib/icons/info-circle.svg.js +28 -0
- package/lib/icons/info.svg.js +34 -0
- package/lib/icons/input-clear.svg.js +27 -0
- package/lib/icons/invisible.svg.js +29 -0
- package/lib/icons/left-arrow.svg.js +30 -0
- package/lib/icons/loading-outline.svg.js +28 -0
- package/lib/icons/location.svg.js +27 -0
- package/lib/icons/menu.svg.js +27 -0
- package/lib/icons/minus.svg.js +28 -0
- package/lib/icons/move.svg.js +29 -0
- package/lib/icons/mute.svg.js +28 -0
- package/lib/icons/new-edit.svg.js +29 -0
- package/lib/icons/pause.svg.js +28 -0
- package/lib/icons/pencil.svg.js +28 -0
- package/lib/icons/play.svg.js +27 -0
- package/lib/icons/plus-cicle.svg.js +27 -0
- package/lib/icons/plus-fine.svg.js +28 -0
- package/lib/icons/plus.svg.js +28 -0
- package/lib/icons/post.svg.js +55 -0
- package/lib/icons/question-mark.svg.js +33 -0
- package/lib/icons/question.svg.js +28 -0
- package/lib/icons/question2.svg.js +41 -0
- package/lib/icons/redo.svg.js +28 -0
- package/lib/icons/refresh.svg.js +28 -0
- package/lib/icons/reload.svg.js +28 -0
- package/lib/icons/remove.svg.js +28 -0
- package/lib/icons/retry.svg.js +31 -0
- package/lib/icons/right-arrow-bold.svg.js +28 -0
- package/lib/icons/right-arrow.svg.js +30 -0
- package/lib/icons/right-double-arrow.svg.js +29 -0
- package/lib/icons/role.svg.js +50 -0
- package/lib/icons/rotate-left.svg.js +29 -0
- package/lib/icons/rotate-right.svg.js +29 -0
- package/lib/icons/rotate-screen.svg.js +28 -0
- package/lib/icons/scale-origin.svg.js +31 -0
- package/lib/icons/schedule.svg.js +31 -0
- package/lib/icons/search.svg.js +28 -0
- package/lib/icons/setting.svg.js +28 -0
- package/lib/icons/slider-handle-icon.svg.js +29 -0
- package/lib/icons/sort-asc.svg.js +28 -0
- package/lib/icons/sort-default.svg.js +28 -0
- package/lib/icons/sort-desc.svg.js +28 -0
- package/lib/icons/star.svg.js +28 -0
- package/lib/icons/status-close.svg.js +30 -0
- package/lib/icons/steps-finsh.svg.js +29 -0
- package/lib/icons/sub-plus.svg.js +27 -0
- package/lib/icons/success.svg.js +36 -0
- package/lib/icons/transparent.svg.js +45 -0
- package/lib/icons/trash.svg.js +29 -0
- package/lib/icons/tree-down.svg.js +28 -0
- package/lib/icons/undo-normal.svg.js +32 -0
- package/lib/icons/undo.svg.js +28 -0
- package/lib/icons/unfullscreen.svg.js +28 -0
- package/lib/icons/upload.svg.js +28 -0
- package/lib/icons/user-remove.svg.js +40 -0
- package/lib/icons/view.svg.js +29 -0
- package/lib/icons/volume.svg.js +31 -0
- package/lib/icons/warning-mark.svg.js +29 -0
- package/lib/icons/warning.svg.js +28 -0
- package/lib/icons/window-restore.svg.js +28 -0
- package/lib/icons/zoom-in.svg.js +28 -0
- package/lib/icons/zoom-out.svg.js +28 -0
- package/lib/index.d.ts +15 -0
- package/lib/index.js +348 -0
- package/lib/locale/de-DE.d.ts +1 -0
- package/lib/locale/de-DE.js +423 -0
- package/lib/locale/en-US.d.ts +1 -0
- package/lib/locale/en-US.js +429 -0
- package/lib/locale/zh-CN.d.ts +1 -0
- package/lib/locale/zh-CN.js +438 -0
- package/lib/scss/helper.scss.js +12 -0
- package/lib/scss/themes/ang.scss.js +12 -0
- package/lib/scss/themes/antd.scss.js +12 -0
- package/lib/scss/themes/cxd.scss.js +12 -0
- package/lib/scss/themes/dark.scss.js +12 -0
- package/lib/scss/themes/default.scss.js +12 -0
- package/lib/themes/ang.css +46414 -0
- package/lib/themes/ang.d.ts +3 -0
- package/lib/themes/ang.js +20 -0
- package/lib/themes/antd.css +46401 -0
- package/lib/themes/antd.d.ts +1 -0
- package/lib/themes/antd.js +44 -0
- package/lib/themes/cxd.css +46390 -0
- package/lib/themes/cxd.d.ts +3 -0
- package/lib/themes/cxd.js +459 -0
- package/lib/themes/dark.css +46421 -0
- package/lib/themes/dark.d.ts +3 -0
- package/lib/themes/dark.js +28 -0
- package/lib/themes/default.css +46390 -0
- package/lib/themes/default.d.ts +4 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/smoothSignature.d.ts +86 -0
- package/lib/utils/vectorComputed.d.ts +20 -0
- package/lib/utils/vectorComputed.js +84 -0
- package/lib/withRemoteConfig.d.ts +2 -0
- package/lib/withRemoteConfig.js +14 -0
- package/lib/withStore.d.ts +2 -0
- package/lib/withStore.js +14 -0
- package/package.json +8 -4
- package/scss/_components.scss +4 -7
- package/scss/_mixins.scss +1 -0
- package/scss/_properties.scss +1 -1
- package/scss/components/_auto-folder.scss +40 -0
- package/scss/components/_cascader.scss +22 -2
- package/scss/components/_condition-builder.scss +1 -0
- package/scss/components/_crud.scss +32 -0
- package/scss/components/_modal.scss +13 -0
- package/scss/components/_page.scss +0 -1
- package/scss/components/_pagination.scss +1 -2
- package/scss/components/_result-box.scss +15 -3
- package/scss/components/_table.scss +2 -0
- package/scss/components/form/_combo.scss +13 -0
- package/scss/components/form/_form.scss +14 -1
- package/scss/components/form/_icon-picker.scss +1 -0
- package/scss/components/form/_input-group.scss +23 -2
- package/scss/components/form/_nested-select.scss +10 -0
- package/scss/components/form/_picker.scss +33 -0
- package/scss/components/form/_select.scss +30 -4
- package/scss/components/form/_selection.scss +2 -0
- package/scss/components/form/_tree.scss +8 -9
- package/scss/layout/_layout.scss +1 -0
- package/scss/themes/_common.scss +1 -0
|
@@ -0,0 +1,1386 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-ui v6.13.0
|
|
3
|
+
* Copyright 2018-2025 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { __extends, __assign, __spreadArray, __read, __rest } from 'tslib';
|
|
7
|
+
import React__default from 'react';
|
|
8
|
+
import { findDOMNode } from 'react-dom';
|
|
9
|
+
import moment from 'moment';
|
|
10
|
+
import omit from 'lodash/omit';
|
|
11
|
+
import kebabCase from 'lodash/kebabCase';
|
|
12
|
+
import { filterDate, str2function, noop, isExpression, FormulaExec, getComputedStyle, ucFirst, Overlay, PopOver, themeable, localeable } from 'amis-core';
|
|
13
|
+
import { Icon } from './icons.js';
|
|
14
|
+
import Calendar from './calendar/Calendar.js';
|
|
15
|
+
import PopUp from './PopUp.js';
|
|
16
|
+
import CalendarMobile from './CalendarMobile.js';
|
|
17
|
+
import Input from './Input.js';
|
|
18
|
+
import Button from './Button.js';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @file DateRangePicker
|
|
22
|
+
* @description 自定义日期范围时间选择器组件
|
|
23
|
+
* @author fex
|
|
24
|
+
*/
|
|
25
|
+
var availableShortcuts = {
|
|
26
|
+
'today': {
|
|
27
|
+
label: 'Date.today',
|
|
28
|
+
startDate: function (now) {
|
|
29
|
+
return now.startOf('day');
|
|
30
|
+
},
|
|
31
|
+
endDate: function (now) {
|
|
32
|
+
return now;
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
'yesterday': {
|
|
36
|
+
label: 'Date.yesterday',
|
|
37
|
+
startDate: function (now) {
|
|
38
|
+
return now.add(-1, 'days').startOf('day');
|
|
39
|
+
},
|
|
40
|
+
endDate: function (now) {
|
|
41
|
+
return now.add(-1, 'days').endOf('day');
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
'tomorrow': {
|
|
45
|
+
label: 'Date.tomorrow',
|
|
46
|
+
startDate: function (now) {
|
|
47
|
+
return now.add(1, 'days').startOf('day');
|
|
48
|
+
},
|
|
49
|
+
endDate: function (now) {
|
|
50
|
+
return now.add(1, 'days').endOf('day');
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
// 兼容一下错误的用法
|
|
54
|
+
'1daysago': {
|
|
55
|
+
label: 'DateRange.1daysago',
|
|
56
|
+
startDate: function (now) {
|
|
57
|
+
return now.add(-1, 'days');
|
|
58
|
+
},
|
|
59
|
+
endDate: function (now) {
|
|
60
|
+
return now;
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
'1dayago': {
|
|
64
|
+
label: 'DateRange.1daysago',
|
|
65
|
+
startDate: function (now) {
|
|
66
|
+
return now.add(-1, 'days');
|
|
67
|
+
},
|
|
68
|
+
endDate: function (now) {
|
|
69
|
+
return now;
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
'7daysago': {
|
|
73
|
+
label: 'DateRange.7daysago',
|
|
74
|
+
startDate: function (now) {
|
|
75
|
+
return now.add(-7, 'days').startOf('day');
|
|
76
|
+
},
|
|
77
|
+
endDate: function (now) {
|
|
78
|
+
return now.add(-1, 'days').endOf('day');
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
'30daysago': {
|
|
82
|
+
label: 'DateRange.30daysago',
|
|
83
|
+
startDate: function (now) {
|
|
84
|
+
return now.add(-30, 'days').startOf('day');
|
|
85
|
+
},
|
|
86
|
+
endDate: function (now) {
|
|
87
|
+
return now.add(-1, 'days').endOf('day');
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
'90daysago': {
|
|
91
|
+
label: 'DateRange.90daysago',
|
|
92
|
+
startDate: function (now) {
|
|
93
|
+
return now.add(-90, 'days').startOf('day');
|
|
94
|
+
},
|
|
95
|
+
endDate: function (now) {
|
|
96
|
+
return now.add(-1, 'days').endOf('day');
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
'prevweek': {
|
|
100
|
+
label: 'DateRange.lastWeek',
|
|
101
|
+
startDate: function (now) {
|
|
102
|
+
return now.startOf('week').add(-1, 'weeks');
|
|
103
|
+
},
|
|
104
|
+
endDate: function (now) {
|
|
105
|
+
return now.startOf('week').add(-1, 'days').endOf('day');
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
'thisweek': {
|
|
109
|
+
label: 'DateRange.thisWeek',
|
|
110
|
+
startDate: function (now) {
|
|
111
|
+
return now.startOf('week');
|
|
112
|
+
},
|
|
113
|
+
endDate: function (now) {
|
|
114
|
+
return now.endOf('week');
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
'thismonth': {
|
|
118
|
+
label: 'DateRange.thisMonth',
|
|
119
|
+
startDate: function (now) {
|
|
120
|
+
return now.startOf('month');
|
|
121
|
+
},
|
|
122
|
+
endDate: function (now) {
|
|
123
|
+
return now.endOf('month');
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
'thisquarter': {
|
|
127
|
+
label: 'DateRange.thisQuarter',
|
|
128
|
+
startDate: function (now) {
|
|
129
|
+
return now.startOf('quarter');
|
|
130
|
+
},
|
|
131
|
+
endDate: function (now) {
|
|
132
|
+
return now.endOf('quarter');
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
'prevmonth': {
|
|
136
|
+
label: 'DateRange.lastMonth',
|
|
137
|
+
startDate: function (now) {
|
|
138
|
+
return now.startOf('month').add(-1, 'month');
|
|
139
|
+
},
|
|
140
|
+
endDate: function (now) {
|
|
141
|
+
return now.startOf('month').add(-1, 'day').endOf('day');
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
'prevquarter': {
|
|
145
|
+
label: 'DateRange.lastQuarter',
|
|
146
|
+
startDate: function (now) {
|
|
147
|
+
return now.startOf('quarter').add(-1, 'quarter');
|
|
148
|
+
},
|
|
149
|
+
endDate: function (now) {
|
|
150
|
+
return now.startOf('quarter').add(-1, 'day').endOf('day');
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
'thisyear': {
|
|
154
|
+
label: 'DateRange.thisYear',
|
|
155
|
+
startDate: function (now) {
|
|
156
|
+
return now.startOf('year');
|
|
157
|
+
},
|
|
158
|
+
endDate: function (now) {
|
|
159
|
+
return now.endOf('year');
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
// 兼容一下之前的用法 'lastYear'
|
|
163
|
+
'prevyear': {
|
|
164
|
+
label: 'DateRange.lastYear',
|
|
165
|
+
startDate: function (now) {
|
|
166
|
+
return now.startOf('year').add(-1, 'year');
|
|
167
|
+
},
|
|
168
|
+
endDate: function (now) {
|
|
169
|
+
return now.endOf('year').add(-1, 'year').endOf('day');
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
'lastYear': {
|
|
173
|
+
label: 'DateRange.lastYear',
|
|
174
|
+
startDate: function (now) {
|
|
175
|
+
return now.startOf('year').add(-1, 'year');
|
|
176
|
+
},
|
|
177
|
+
endDate: function (now) {
|
|
178
|
+
return now.endOf('year').add(-1, 'year').endOf('day');
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
var advancedRanges = [
|
|
183
|
+
{
|
|
184
|
+
regexp: /^(\d+)hoursago$/,
|
|
185
|
+
resolve: function (__, _, hours) {
|
|
186
|
+
return {
|
|
187
|
+
label: __('DateRange.hoursago', { hours: hours }),
|
|
188
|
+
startDate: function (now) {
|
|
189
|
+
return now.add(-hours, 'hours').startOf('hour');
|
|
190
|
+
},
|
|
191
|
+
endDate: function (now) {
|
|
192
|
+
return now.add(-1, 'hours').endOf('hours');
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
regexp: /^(\d+)hourslater$/,
|
|
199
|
+
resolve: function (__, _, hours) {
|
|
200
|
+
return {
|
|
201
|
+
label: __('DateRange.hourslater', { hours: hours }),
|
|
202
|
+
startDate: function (now) {
|
|
203
|
+
return now.startOf('hour');
|
|
204
|
+
},
|
|
205
|
+
endDate: function (now) {
|
|
206
|
+
return now.add(hours, 'hours').endOf('hour');
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
regexp: /^(\d+)daysago$/,
|
|
213
|
+
resolve: function (__, _, days) {
|
|
214
|
+
return {
|
|
215
|
+
label: __('DateRange.daysago', { days: days }),
|
|
216
|
+
startDate: function (now) {
|
|
217
|
+
return now.add(-days, 'days').startOf('day');
|
|
218
|
+
},
|
|
219
|
+
endDate: function (now) {
|
|
220
|
+
return now.add(-1, 'days').endOf('day');
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
regexp: /^(\d+)dayslater$/,
|
|
227
|
+
resolve: function (__, _, days) {
|
|
228
|
+
return {
|
|
229
|
+
label: __('DateRange.dayslater', { days: days }),
|
|
230
|
+
startDate: function (now) {
|
|
231
|
+
return now.startOf('day');
|
|
232
|
+
},
|
|
233
|
+
endDate: function (now) {
|
|
234
|
+
return now.add(days, 'days').endOf('day');
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
regexp: /^(\d+)weeksago$/,
|
|
241
|
+
resolve: function (__, _, weeks) {
|
|
242
|
+
return {
|
|
243
|
+
label: __('DateRange.weeksago', { weeks: weeks }),
|
|
244
|
+
startDate: function (now) {
|
|
245
|
+
return now.startOf('week').add(-weeks, 'weeks');
|
|
246
|
+
},
|
|
247
|
+
endDate: function (now) {
|
|
248
|
+
return now.startOf('week').add(-1, 'days').endOf('day');
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
regexp: /^(\d+)weekslater$/,
|
|
255
|
+
resolve: function (__, _, weeks) {
|
|
256
|
+
return {
|
|
257
|
+
label: __('DateRange.weekslater', { weeks: weeks }),
|
|
258
|
+
startDate: function (now) {
|
|
259
|
+
return now.startOf('week');
|
|
260
|
+
},
|
|
261
|
+
endDate: function (now) {
|
|
262
|
+
return now.startOf('week').add(weeks, 'weeks').endOf('day');
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
regexp: /^(\d+)monthsago$/,
|
|
269
|
+
resolve: function (__, _, months) {
|
|
270
|
+
return {
|
|
271
|
+
label: __('DateRange.monthsago', { months: months }),
|
|
272
|
+
startDate: function (now) {
|
|
273
|
+
return now.startOf('months').add(-months, 'months');
|
|
274
|
+
},
|
|
275
|
+
endDate: function (now) {
|
|
276
|
+
return now.startOf('month').add(-1, 'days').endOf('day');
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
regexp: /^(\d+)monthslater$/,
|
|
283
|
+
resolve: function (__, _, months) {
|
|
284
|
+
return {
|
|
285
|
+
label: __('DateRange.monthslater', { months: months }),
|
|
286
|
+
startDate: function (now) {
|
|
287
|
+
return now.startOf('month');
|
|
288
|
+
},
|
|
289
|
+
endDate: function (now) {
|
|
290
|
+
return now.startOf('month').add(months, 'months').endOf('day');
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
regexp: /^(\d+)quartersago$/,
|
|
297
|
+
resolve: function (__, _, quarters) {
|
|
298
|
+
return {
|
|
299
|
+
label: __('DateRange.quartersago', { quarters: quarters }),
|
|
300
|
+
startDate: function (now) {
|
|
301
|
+
return now.startOf('quarters').add(-quarters, 'quarters');
|
|
302
|
+
},
|
|
303
|
+
endDate: function (now) {
|
|
304
|
+
return now.startOf('quarter').add(-1, 'days').endOf('day');
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
regexp: /^(\d+)quarterslater$/,
|
|
311
|
+
resolve: function (__, _, quarters) {
|
|
312
|
+
return {
|
|
313
|
+
label: __('DateRange.quarterslater', { quarters: quarters }),
|
|
314
|
+
startDate: function (now) {
|
|
315
|
+
return now.startOf('quarter');
|
|
316
|
+
},
|
|
317
|
+
endDate: function (now) {
|
|
318
|
+
return now.startOf('quarter').add(quarters, 'quarters').endOf('day');
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
regexp: /^(\d+)yearsago$/,
|
|
325
|
+
resolve: function (__, _, years) {
|
|
326
|
+
return {
|
|
327
|
+
label: __('DateRange.yearsago', { years: years }),
|
|
328
|
+
startDate: function (now) {
|
|
329
|
+
return now.startOf('years').add(-years, 'years');
|
|
330
|
+
},
|
|
331
|
+
endDate: function (now) {
|
|
332
|
+
return now.startOf('year').add(-1, 'days').endOf('day');
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
regexp: /^(\d+)yearslater$/,
|
|
339
|
+
resolve: function (__, _, years) {
|
|
340
|
+
return {
|
|
341
|
+
label: __('DateRange.yearslater', { years: years }),
|
|
342
|
+
startDate: function (now) {
|
|
343
|
+
return now.startOf('year');
|
|
344
|
+
},
|
|
345
|
+
endDate: function (now) {
|
|
346
|
+
return now.startOf('year').add(years, 'years').endOf('day');
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
];
|
|
352
|
+
var dateFormats = {
|
|
353
|
+
Y: { format: 'YYYY' },
|
|
354
|
+
Q: { format: 'YYYY [Q]Q' },
|
|
355
|
+
M: { format: 'YYYY-MM' },
|
|
356
|
+
D: { format: 'YYYY-MM-DD' }
|
|
357
|
+
};
|
|
358
|
+
var timeFormats = {
|
|
359
|
+
h: { format: 'HH' },
|
|
360
|
+
H: { format: 'HH' },
|
|
361
|
+
m: { format: 'mm' },
|
|
362
|
+
s: { format: 'ss' },
|
|
363
|
+
S: { format: 'ss' }
|
|
364
|
+
};
|
|
365
|
+
var DateRangePicker = /** @class */ (function (_super) {
|
|
366
|
+
__extends(DateRangePicker, _super);
|
|
367
|
+
function DateRangePicker(props) {
|
|
368
|
+
var _this = _super.call(this, props) || this;
|
|
369
|
+
// 是否是第一次点击,如果是第一次点击就可以点任意地址
|
|
370
|
+
_this.isFirstClick = true;
|
|
371
|
+
_this.nextMonth = moment().add(1, 'months').startOf('day');
|
|
372
|
+
_this.currentMonth = moment().startOf('day');
|
|
373
|
+
_this.startInputRef = React__default.createRef();
|
|
374
|
+
_this.endInputRef = React__default.createRef();
|
|
375
|
+
_this.separatorRef = React__default.createRef();
|
|
376
|
+
_this.calendarRef = React__default.createRef();
|
|
377
|
+
_this.open = _this.open.bind(_this);
|
|
378
|
+
_this.openStart = _this.openStart.bind(_this);
|
|
379
|
+
_this.openEnd = _this.openEnd.bind(_this);
|
|
380
|
+
_this.close = _this.close.bind(_this);
|
|
381
|
+
_this.startInputChange = _this.startInputChange.bind(_this);
|
|
382
|
+
_this.endInputChange = _this.endInputChange.bind(_this);
|
|
383
|
+
_this.handleDateChange = _this.handleDateChange.bind(_this);
|
|
384
|
+
_this.handleStartDateChange = _this.handleStartDateChange.bind(_this);
|
|
385
|
+
_this.handelEndDateChange = _this.handelEndDateChange.bind(_this);
|
|
386
|
+
_this.handleTimeStartChange = _this.handleTimeStartChange.bind(_this);
|
|
387
|
+
_this.handleTimeEndChange = _this.handleTimeEndChange.bind(_this);
|
|
388
|
+
_this.handleFocus = _this.handleFocus.bind(_this);
|
|
389
|
+
_this.handleBlur = _this.handleBlur.bind(_this);
|
|
390
|
+
_this.checkStartIsValidDate = _this.checkStartIsValidDate.bind(_this);
|
|
391
|
+
_this.checkEndIsValidDate = _this.checkEndIsValidDate.bind(_this);
|
|
392
|
+
_this.confirm = _this.confirm.bind(_this);
|
|
393
|
+
_this.clearValue = _this.clearValue.bind(_this);
|
|
394
|
+
_this.dom = React__default.createRef();
|
|
395
|
+
_this.handleClick = _this.handleClick.bind(_this);
|
|
396
|
+
_this.handleKeyPress = _this.handleKeyPress.bind(_this);
|
|
397
|
+
_this.handlePopOverClick = _this.handlePopOverClick.bind(_this);
|
|
398
|
+
_this.renderDay = _this.renderDay.bind(_this);
|
|
399
|
+
_this.renderMonth = _this.renderMonth.bind(_this);
|
|
400
|
+
_this.renderQuarter = _this.renderQuarter.bind(_this);
|
|
401
|
+
_this.renderYear = _this.renderYear.bind(_this);
|
|
402
|
+
_this.handleMobileChange = _this.handleMobileChange.bind(_this);
|
|
403
|
+
_this.handleOutClick = _this.handleOutClick.bind(_this);
|
|
404
|
+
var _a = _this.props, format = _a.format, valueFormat = _a.valueFormat, joinValues = _a.joinValues, delimiter = _a.delimiter, value = _a.value, inputFormat = _a.inputFormat, displayFormat = _a.displayFormat, dateFormat = _a.dateFormat, timeFormat = _a.timeFormat, data = _a.data, utc = _a.utc;
|
|
405
|
+
var _b = DateRangePicker.unFormatValue(value, valueFormat || format, joinValues, delimiter, data, utc), startDate = _b.startDate, endDate = _b.endDate;
|
|
406
|
+
var curDateFormat = dateFormat !== null && dateFormat !== void 0 ? dateFormat : '';
|
|
407
|
+
var curTimeFormat = timeFormat !== null && timeFormat !== void 0 ? timeFormat : '';
|
|
408
|
+
var curTimeFormatArr = [];
|
|
409
|
+
!dateFormat &&
|
|
410
|
+
Object.keys(dateFormats).forEach(function (item) {
|
|
411
|
+
var _a;
|
|
412
|
+
if ((_a = (displayFormat || inputFormat)) === null || _a === void 0 ? void 0 : _a.includes(item)) {
|
|
413
|
+
curDateFormat = dateFormats[item].format;
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
!timeFormat &&
|
|
417
|
+
Object.keys(timeFormats).forEach(function (item) {
|
|
418
|
+
var _a;
|
|
419
|
+
if ((_a = (displayFormat || inputFormat)) === null || _a === void 0 ? void 0 : _a.includes(item)) {
|
|
420
|
+
curTimeFormatArr.push(timeFormats[item].format);
|
|
421
|
+
}
|
|
422
|
+
});
|
|
423
|
+
curTimeFormat = curTimeFormatArr.length
|
|
424
|
+
? curTimeFormatArr.join(':')
|
|
425
|
+
: curTimeFormat;
|
|
426
|
+
_this.state = {
|
|
427
|
+
isOpened: false,
|
|
428
|
+
isFocused: false,
|
|
429
|
+
editState: 'start',
|
|
430
|
+
startDate: startDate,
|
|
431
|
+
endDate: endDate,
|
|
432
|
+
oldStartDate: startDate,
|
|
433
|
+
oldEndDate: endDate,
|
|
434
|
+
startInputValue: startDate === null || startDate === void 0 ? void 0 : startDate.format(displayFormat || inputFormat),
|
|
435
|
+
endInputValue: endDate === null || endDate === void 0 ? void 0 : endDate.format(displayFormat || inputFormat),
|
|
436
|
+
endDateOpenedFirst: false,
|
|
437
|
+
curDateFormat: curDateFormat,
|
|
438
|
+
curTimeFormat: curTimeFormat
|
|
439
|
+
};
|
|
440
|
+
return _this;
|
|
441
|
+
}
|
|
442
|
+
DateRangePicker.formatValue = function (newValue, valueFormat, joinValues, delimiter, utc) {
|
|
443
|
+
var _a, _b;
|
|
444
|
+
if (utc === void 0) { utc = false; }
|
|
445
|
+
newValue = [
|
|
446
|
+
(_a = (utc ? moment.utc(newValue.startDate) : newValue.startDate)) === null || _a === void 0 ? void 0 : _a.format(valueFormat),
|
|
447
|
+
(_b = (utc ? moment.utc(newValue.endDate) : newValue.endDate)) === null || _b === void 0 ? void 0 : _b.format(valueFormat)
|
|
448
|
+
];
|
|
449
|
+
if (joinValues) {
|
|
450
|
+
newValue = newValue.join(delimiter);
|
|
451
|
+
}
|
|
452
|
+
return newValue;
|
|
453
|
+
};
|
|
454
|
+
/* 将日期时间转化为momemnt格式,如果输入的内容不合法则返回undefined */
|
|
455
|
+
DateRangePicker.unFormatValue = function (value, format, joinValues, delimiter, data, utc) {
|
|
456
|
+
if (!value) {
|
|
457
|
+
return {
|
|
458
|
+
startDate: undefined,
|
|
459
|
+
endDate: undefined
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
if (joinValues && typeof value === 'string') {
|
|
463
|
+
value = value.split(delimiter);
|
|
464
|
+
}
|
|
465
|
+
var startDate = filterDate(value === null || value === void 0 ? void 0 : value[0], data, format, utc);
|
|
466
|
+
var endDate = filterDate(value === null || value === void 0 ? void 0 : value[1], data, format, utc);
|
|
467
|
+
/**
|
|
468
|
+
* 不合法的value输入都丢弃
|
|
469
|
+
* 注意undefined被moment认为是合法的输入,moment会转化为now,所以需要结合在一起判断
|
|
470
|
+
* @reference https://github.com/moment/moment/issues/1639
|
|
471
|
+
*/
|
|
472
|
+
return {
|
|
473
|
+
startDate: value[0] && startDate.isValid() ? startDate : undefined,
|
|
474
|
+
endDate: value[1] && endDate.isValid() ? endDate : undefined
|
|
475
|
+
};
|
|
476
|
+
};
|
|
477
|
+
DateRangePicker.prototype.componentDidMount = function () {
|
|
478
|
+
var _a, _b;
|
|
479
|
+
document.body.addEventListener('click', this.handleOutClick, true);
|
|
480
|
+
(_b = (_a = this.props) === null || _a === void 0 ? void 0 : _a.onRef) === null || _b === void 0 ? void 0 : _b.call(_a, this);
|
|
481
|
+
};
|
|
482
|
+
DateRangePicker.prototype.componentWillUnmount = function () {
|
|
483
|
+
document.body.removeEventListener('click', this.handleOutClick, true);
|
|
484
|
+
};
|
|
485
|
+
DateRangePicker.prototype.handleOutClick = function (e) {
|
|
486
|
+
if (!e.target ||
|
|
487
|
+
!this.dom.current ||
|
|
488
|
+
this.dom.current.contains(e.target) ||
|
|
489
|
+
!this.calendarRef.current ||
|
|
490
|
+
this.calendarRef.current.contains(e.target)) {
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
if (this.state.isOpened) {
|
|
494
|
+
e.preventDefault();
|
|
495
|
+
this.close();
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
DateRangePicker.prototype.componentDidUpdate = function (prevProps) {
|
|
499
|
+
var props = this.props;
|
|
500
|
+
var value = props.value, format = props.format, valueFormat = props.valueFormat, joinValues = props.joinValues, inputFormat = props.inputFormat, displayFormat = props.displayFormat, dateFormat = props.dateFormat, timeFormat = props.timeFormat, delimiter = props.delimiter, data = props.data, utc = props.utc;
|
|
501
|
+
if (prevProps.displayFormat != displayFormat ||
|
|
502
|
+
prevProps.inputFormat != inputFormat) {
|
|
503
|
+
var curDateFormat_1 = dateFormat !== null && dateFormat !== void 0 ? dateFormat : '';
|
|
504
|
+
var curTimeFormat = timeFormat !== null && timeFormat !== void 0 ? timeFormat : '';
|
|
505
|
+
var curTimeFormatArr_1 = [];
|
|
506
|
+
!dateFormat &&
|
|
507
|
+
Object.keys(dateFormats).forEach(function (item) {
|
|
508
|
+
var _a;
|
|
509
|
+
if ((_a = (displayFormat || inputFormat)) === null || _a === void 0 ? void 0 : _a.includes(item)) {
|
|
510
|
+
curDateFormat_1 = dateFormats[item].format;
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
!timeFormat &&
|
|
514
|
+
Object.keys(timeFormats).forEach(function (item) {
|
|
515
|
+
var _a;
|
|
516
|
+
if ((_a = (displayFormat || inputFormat)) === null || _a === void 0 ? void 0 : _a.includes(item)) {
|
|
517
|
+
curTimeFormatArr_1.push(timeFormats[item].format);
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
this.setState({
|
|
521
|
+
curDateFormat: curDateFormat_1,
|
|
522
|
+
curTimeFormat: curTimeFormatArr_1.length
|
|
523
|
+
? curTimeFormatArr_1.join(':')
|
|
524
|
+
: curTimeFormat
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
if (prevProps.value !== value) {
|
|
528
|
+
var _a = DateRangePicker.unFormatValue(value, valueFormat || format, joinValues, delimiter, data, utc), startDate = _a.startDate, endDate = _a.endDate;
|
|
529
|
+
this.setState({
|
|
530
|
+
startDate: startDate,
|
|
531
|
+
endDate: endDate,
|
|
532
|
+
startInputValue: startDate && (startDate === null || startDate === void 0 ? void 0 : startDate.isValid())
|
|
533
|
+
? startDate === null || startDate === void 0 ? void 0 : startDate.format(displayFormat || inputFormat)
|
|
534
|
+
: '',
|
|
535
|
+
endInputValue: endDate && (endDate === null || endDate === void 0 ? void 0 : endDate.isValid())
|
|
536
|
+
? endDate === null || endDate === void 0 ? void 0 : endDate.format(displayFormat || inputFormat)
|
|
537
|
+
: ''
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
};
|
|
541
|
+
DateRangePicker.prototype.focus = function () {
|
|
542
|
+
if (!this.dom.current || this.props.disabled) {
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
this.dom.current.focus();
|
|
546
|
+
};
|
|
547
|
+
DateRangePicker.prototype.blur = function () {
|
|
548
|
+
if (!this.dom.current || this.props.disabled) {
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
this.dom.current.blur();
|
|
552
|
+
};
|
|
553
|
+
DateRangePicker.prototype.handleFocus = function (e) {
|
|
554
|
+
this.setState({
|
|
555
|
+
isFocused: true
|
|
556
|
+
});
|
|
557
|
+
var onFocus = this.props.onFocus;
|
|
558
|
+
onFocus && onFocus(e);
|
|
559
|
+
};
|
|
560
|
+
DateRangePicker.prototype.handleBlur = function (e) {
|
|
561
|
+
this.setState({
|
|
562
|
+
isFocused: false
|
|
563
|
+
});
|
|
564
|
+
var onBlur = this.props.onBlur;
|
|
565
|
+
onBlur && onBlur(e);
|
|
566
|
+
};
|
|
567
|
+
DateRangePicker.prototype.open = function () {
|
|
568
|
+
if (this.props.disabled) {
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
this.setState({
|
|
572
|
+
isOpened: true
|
|
573
|
+
});
|
|
574
|
+
};
|
|
575
|
+
DateRangePicker.prototype.openStart = function () {
|
|
576
|
+
if (this.props.disabled) {
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
this.setState({
|
|
580
|
+
isOpened: true,
|
|
581
|
+
editState: 'start'
|
|
582
|
+
});
|
|
583
|
+
};
|
|
584
|
+
DateRangePicker.prototype.openEnd = function () {
|
|
585
|
+
if (this.props.disabled) {
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
this.setState({
|
|
589
|
+
isOpened: true,
|
|
590
|
+
editState: 'end',
|
|
591
|
+
endDateOpenedFirst: true
|
|
592
|
+
});
|
|
593
|
+
};
|
|
594
|
+
DateRangePicker.prototype.close = function (isConfirm) {
|
|
595
|
+
if (isConfirm === void 0) { isConfirm = false; }
|
|
596
|
+
var newState = {};
|
|
597
|
+
if (!isConfirm) {
|
|
598
|
+
/** 未点击确认关闭时,将日期恢复至未做任何选择的状态 */
|
|
599
|
+
var _a = this.props, value = _a.value, format = _a.format, valueFormat = _a.valueFormat, joinValues = _a.joinValues, delimiter = _a.delimiter, inputFormat = _a.inputFormat, displayFormat = _a.displayFormat, data = _a.data, utc = _a.utc;
|
|
600
|
+
var _b = DateRangePicker.unFormatValue(value, valueFormat || format, joinValues, delimiter, data, utc), startDate = _b.startDate, endDate = _b.endDate;
|
|
601
|
+
Object.assign(newState, {
|
|
602
|
+
startDate: startDate,
|
|
603
|
+
endDate: endDate,
|
|
604
|
+
oldStartDate: startDate,
|
|
605
|
+
oldEndDate: endDate,
|
|
606
|
+
startInputValue: startDate && moment(startDate).isValid()
|
|
607
|
+
? startDate.format(displayFormat || inputFormat)
|
|
608
|
+
: '',
|
|
609
|
+
endInputValue: endDate && moment(endDate).isValid()
|
|
610
|
+
? endDate.format(displayFormat || inputFormat)
|
|
611
|
+
: ''
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
else {
|
|
615
|
+
Object.assign(newState, {
|
|
616
|
+
oldStartDate: this.state.startDate,
|
|
617
|
+
oldEndDate: this.state.endDate
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
this.setState(__assign(__assign({}, newState), { isOpened: false, editState: undefined, endDateOpenedFirst: false }), this.blur);
|
|
621
|
+
};
|
|
622
|
+
DateRangePicker.prototype.handleClick = function () {
|
|
623
|
+
this.state.isOpened ? this.close() : this.open();
|
|
624
|
+
};
|
|
625
|
+
DateRangePicker.prototype.handlePopOverClick = function (e) {
|
|
626
|
+
e.stopPropagation();
|
|
627
|
+
e.preventDefault();
|
|
628
|
+
};
|
|
629
|
+
DateRangePicker.prototype.handleKeyPress = function (e) {
|
|
630
|
+
if (e.key === ' ') {
|
|
631
|
+
this.handleClick();
|
|
632
|
+
e.preventDefault();
|
|
633
|
+
}
|
|
634
|
+
};
|
|
635
|
+
DateRangePicker.prototype.confirm = function () {
|
|
636
|
+
var _a = this.props, format = _a.format, valueFormat = _a.valueFormat, joinValues = _a.joinValues, delimiter = _a.delimiter, utc = _a.utc;
|
|
637
|
+
var _b = this.state, startDate = _b.startDate, endDate = _b.endDate;
|
|
638
|
+
if (!startDate && !endDate) {
|
|
639
|
+
return;
|
|
640
|
+
}
|
|
641
|
+
else if (endDate && (startDate === null || startDate === void 0 ? void 0 : startDate.isAfter(this.state.endDate))) {
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
this.props.onChange(DateRangePicker.formatValue({ startDate: startDate, endDate: endDate }, valueFormat || format, joinValues, delimiter, utc));
|
|
645
|
+
if (startDate && !endDate) {
|
|
646
|
+
this.setState({ editState: 'end', endDateOpenedFirst: false });
|
|
647
|
+
}
|
|
648
|
+
else {
|
|
649
|
+
this.close(true);
|
|
650
|
+
}
|
|
651
|
+
};
|
|
652
|
+
DateRangePicker.prototype.filterDate = function (date, options) {
|
|
653
|
+
if (options === void 0) { options = { type: 'start' }; }
|
|
654
|
+
var _a = options || {
|
|
655
|
+
type: 'start'
|
|
656
|
+
}, type = _a.type, originValue = _a.originValue, timeFormat = _a.timeFormat, subControlViewMode = _a.subControlViewMode, autoInitDefaultValue = _a.autoInitDefaultValue;
|
|
657
|
+
var value = date.clone();
|
|
658
|
+
var _b = this.props, transform = _b.transform, data = _b.data;
|
|
659
|
+
var _c = this.state, startDate = _c.startDate, endDate = _c.endDate;
|
|
660
|
+
/** 此时为点选后的值初始化设置,不应该被内部转化逻辑和transformFn限制 */
|
|
661
|
+
if (autoInitDefaultValue === true) {
|
|
662
|
+
var now_1 = moment();
|
|
663
|
+
/** 如果已经设置了结束时间且当前时间已经超出了结束时间,则开始时间不能超过结束时间 */
|
|
664
|
+
if (!startDate && endDate && type === 'start' && now_1.isAfter(endDate)) {
|
|
665
|
+
value = endDate.clone();
|
|
666
|
+
return value;
|
|
667
|
+
}
|
|
668
|
+
var timePart_1 = {
|
|
669
|
+
date: value.get('date'),
|
|
670
|
+
hour: value.get('hour'),
|
|
671
|
+
minute: value.get('minute'),
|
|
672
|
+
second: value.get('second'),
|
|
673
|
+
millisecond: value.get('millisecond')
|
|
674
|
+
};
|
|
675
|
+
Object.keys(timePart_1).forEach(function (unit) {
|
|
676
|
+
/** 首次选择时间,日期使用当前时间; 将未设置过的时间字段设置为当前值 */
|
|
677
|
+
if ((unit === 'date' && subControlViewMode === 'time') ||
|
|
678
|
+
(unit !== 'date' && timePart_1[unit] === 0)) {
|
|
679
|
+
timePart_1[unit] = now_1.get(unit);
|
|
680
|
+
}
|
|
681
|
+
});
|
|
682
|
+
value.set(timePart_1);
|
|
683
|
+
return value;
|
|
684
|
+
}
|
|
685
|
+
/** 日期时间选择器组件支持用户选择时间,如果用户手动选择了时间,则不需要走默认处理 */
|
|
686
|
+
if (subControlViewMode && subControlViewMode === 'time') {
|
|
687
|
+
return value;
|
|
688
|
+
}
|
|
689
|
+
var transformFn = transform && typeof transform === 'string'
|
|
690
|
+
? str2function(transform, 'value', 'config', 'props', 'data', 'moment')
|
|
691
|
+
: transform;
|
|
692
|
+
// 没有初始值
|
|
693
|
+
if (!originValue) {
|
|
694
|
+
value = value[type === 'start' ? 'startOf' : 'endOf']('day');
|
|
695
|
+
}
|
|
696
|
+
else if (typeof timeFormat === 'string' && /ss/.test(timeFormat)) {
|
|
697
|
+
value = value[type === 'start' ? 'startOf' : 'endOf']('second');
|
|
698
|
+
}
|
|
699
|
+
else if (typeof timeFormat === 'string' && /mm/.test(timeFormat)) {
|
|
700
|
+
value = value[type === 'start' ? 'startOf' : 'endOf']('minute');
|
|
701
|
+
}
|
|
702
|
+
else if (typeof timeFormat === 'string' && /HH/i.test(timeFormat)) {
|
|
703
|
+
value = value[type === 'start' ? 'startOf' : 'endOf']('hour');
|
|
704
|
+
}
|
|
705
|
+
else if (typeof timeFormat === 'string' && /Q/i.test(timeFormat)) {
|
|
706
|
+
value = value[type === 'start' ? 'startOf' : 'endOf']('quarter');
|
|
707
|
+
}
|
|
708
|
+
else {
|
|
709
|
+
value = value[type === 'start' ? 'startOf' : 'endOf']('day');
|
|
710
|
+
}
|
|
711
|
+
if (typeof transformFn === 'function') {
|
|
712
|
+
value = transformFn(value, { type: type, originValue: originValue, timeFormat: timeFormat }, this.props, data, moment);
|
|
713
|
+
}
|
|
714
|
+
return value;
|
|
715
|
+
};
|
|
716
|
+
DateRangePicker.prototype.handleDateChange = function (newValue, viewMode, status) {
|
|
717
|
+
var embed = this.props.embed;
|
|
718
|
+
var editState = embed
|
|
719
|
+
? this.state.editState || status
|
|
720
|
+
: this.state.editState;
|
|
721
|
+
if (editState === 'start') {
|
|
722
|
+
this.handleStartDateChange(newValue);
|
|
723
|
+
}
|
|
724
|
+
else if (editState === 'end') {
|
|
725
|
+
this.handelEndDateChange(newValue);
|
|
726
|
+
}
|
|
727
|
+
};
|
|
728
|
+
/**
|
|
729
|
+
* @param {Moment} newValue 当前选择的日期时间值
|
|
730
|
+
* @param {ViewMode=} subControlViewMode 子选择控件的类型,可选参数('time'),用于区分datetime选择器的触发控件
|
|
731
|
+
*/
|
|
732
|
+
DateRangePicker.prototype.handleStartDateChange = function (newValue, subControlViewMode) {
|
|
733
|
+
var _a = this.props, minDate = _a.minDate, inputFormat = _a.inputFormat, displayFormat = _a.displayFormat, type = _a.type; _a.value;
|
|
734
|
+
var _b = this.state, startDate = _b.startDate; _b.oldStartDate; var endDateOpenedFirst = _b.endDateOpenedFirst, timeFormat = _b.curTimeFormat;
|
|
735
|
+
if (minDate && newValue.isBefore(minDate)) {
|
|
736
|
+
newValue = minDate;
|
|
737
|
+
}
|
|
738
|
+
var date = this.filterDate(newValue, {
|
|
739
|
+
type: 'start',
|
|
740
|
+
originValue: startDate || minDate,
|
|
741
|
+
timeFormat: timeFormat,
|
|
742
|
+
subControlViewMode: subControlViewMode,
|
|
743
|
+
autoInitDefaultValue: !!timeFormat && newValue && !startDate
|
|
744
|
+
});
|
|
745
|
+
var newState = {
|
|
746
|
+
startDate: date,
|
|
747
|
+
startInputValue: date.format(displayFormat || inputFormat)
|
|
748
|
+
};
|
|
749
|
+
// 这些没有时间的选择点第一次后第二次就是选结束时间
|
|
750
|
+
if (!endDateOpenedFirst &&
|
|
751
|
+
(type === 'input-date-range' ||
|
|
752
|
+
type === 'input-year-range' ||
|
|
753
|
+
type === 'input-quarter-range' ||
|
|
754
|
+
type === 'input-month-range')) {
|
|
755
|
+
newState.editState = 'end';
|
|
756
|
+
}
|
|
757
|
+
this.setState(newState);
|
|
758
|
+
};
|
|
759
|
+
/**
|
|
760
|
+
* @param {Moment} newValue 当前选择的日期时间值
|
|
761
|
+
* @param {string=} subControlViewMode 子选择控件的类型的类型,可选参数('time'),用于区分datetime选择器的触发控件
|
|
762
|
+
*/
|
|
763
|
+
DateRangePicker.prototype.handelEndDateChange = function (newValue, subControlViewMode) {
|
|
764
|
+
var _this = this;
|
|
765
|
+
var _a = this.props, embed = _a.embed, inputFormat = _a.inputFormat, displayFormat = _a.displayFormat, type = _a.type; _a.value;
|
|
766
|
+
var _b = this.state; _b.startDate; var endDate = _b.endDate; _b.oldEndDate; var endDateOpenedFirst = _b.endDateOpenedFirst, timeFormat = _b.curTimeFormat;
|
|
767
|
+
newValue = this.getEndDateByDuration(newValue);
|
|
768
|
+
var editState = endDateOpenedFirst ? 'start' : 'end';
|
|
769
|
+
var date = this.filterDate(newValue, {
|
|
770
|
+
type: 'end',
|
|
771
|
+
originValue: endDate,
|
|
772
|
+
timeFormat: timeFormat,
|
|
773
|
+
subControlViewMode: subControlViewMode,
|
|
774
|
+
autoInitDefaultValue: !!timeFormat && newValue && !endDate
|
|
775
|
+
});
|
|
776
|
+
this.setState({
|
|
777
|
+
endDate: date,
|
|
778
|
+
endInputValue: date.format(displayFormat || inputFormat)
|
|
779
|
+
}, function () {
|
|
780
|
+
embed && _this.confirm();
|
|
781
|
+
});
|
|
782
|
+
if (type !== 'input-datetime-range') {
|
|
783
|
+
this.setState({ editState: editState });
|
|
784
|
+
}
|
|
785
|
+
};
|
|
786
|
+
// 手动控制输入时间
|
|
787
|
+
DateRangePicker.prototype.startInputChange = function (e) {
|
|
788
|
+
var _a = this.props, onChange = _a.onChange, displayFormat = _a.displayFormat, inputFormat = _a.inputFormat; _a.utc;
|
|
789
|
+
var value = e.currentTarget.value;
|
|
790
|
+
this.setState({ startInputValue: value });
|
|
791
|
+
if (value === '') {
|
|
792
|
+
onChange('');
|
|
793
|
+
}
|
|
794
|
+
else {
|
|
795
|
+
var newDate = this.getStartDateByDuration(moment(value, displayFormat || inputFormat));
|
|
796
|
+
this.setState({ startDate: newDate });
|
|
797
|
+
}
|
|
798
|
+
};
|
|
799
|
+
DateRangePicker.prototype.endInputChange = function (e) {
|
|
800
|
+
var _a = this.props, onChange = _a.onChange, displayFormat = _a.displayFormat, inputFormat = _a.inputFormat; _a.utc;
|
|
801
|
+
var value = e.currentTarget.value;
|
|
802
|
+
this.setState({ endInputValue: value });
|
|
803
|
+
if (value === '') {
|
|
804
|
+
onChange('');
|
|
805
|
+
}
|
|
806
|
+
else {
|
|
807
|
+
var newDate = this.getEndDateByDuration(moment(value, displayFormat || inputFormat));
|
|
808
|
+
this.setState({ endDate: newDate });
|
|
809
|
+
}
|
|
810
|
+
};
|
|
811
|
+
// 根据 duration 修复结束时间
|
|
812
|
+
DateRangePicker.prototype.getEndDateByDuration = function (newValue) {
|
|
813
|
+
var _a = this.props, minDuration = _a.minDuration, maxDuration = _a.maxDuration, type = _a.type, maxDate = _a.maxDate;
|
|
814
|
+
var _b = this.state, startDate = _b.startDate; _b.endDate; _b.editState;
|
|
815
|
+
if (!startDate) {
|
|
816
|
+
return newValue;
|
|
817
|
+
}
|
|
818
|
+
// 时间范围必须统一成同一天,不然会不一致
|
|
819
|
+
if (type === 'input-time-range' && startDate) {
|
|
820
|
+
newValue.set({
|
|
821
|
+
year: startDate.year(),
|
|
822
|
+
month: startDate.month(),
|
|
823
|
+
date: startDate.date()
|
|
824
|
+
});
|
|
825
|
+
}
|
|
826
|
+
if (minDuration && newValue.isBefore(startDate.clone().add(minDuration))) {
|
|
827
|
+
newValue = startDate.clone().add(minDuration);
|
|
828
|
+
}
|
|
829
|
+
if (maxDuration && newValue.isAfter(startDate.clone().add(maxDuration))) {
|
|
830
|
+
newValue = startDate.clone().add(maxDuration);
|
|
831
|
+
}
|
|
832
|
+
if (maxDate && newValue && newValue.isAfter(maxDate, 'second')) {
|
|
833
|
+
newValue = maxDate;
|
|
834
|
+
}
|
|
835
|
+
return newValue;
|
|
836
|
+
};
|
|
837
|
+
// 根据 duration 修复起始时间
|
|
838
|
+
DateRangePicker.prototype.getStartDateByDuration = function (newValue) {
|
|
839
|
+
var _a = this.props, minDuration = _a.minDuration, maxDuration = _a.maxDuration, type = _a.type;
|
|
840
|
+
var _b = this.state, endDate = _b.endDate; _b.editState;
|
|
841
|
+
if (!endDate) {
|
|
842
|
+
return newValue;
|
|
843
|
+
}
|
|
844
|
+
// 时间范围必须统一成同一天,不然会不一致
|
|
845
|
+
if (type === 'input-time-range' && endDate) {
|
|
846
|
+
newValue.set({
|
|
847
|
+
year: endDate.year(),
|
|
848
|
+
month: endDate.month(),
|
|
849
|
+
date: endDate.date()
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
if (minDuration &&
|
|
853
|
+
newValue.isBefore(endDate.clone().subtract(minDuration))) {
|
|
854
|
+
newValue = endDate.clone().subtract(minDuration);
|
|
855
|
+
}
|
|
856
|
+
if (maxDuration &&
|
|
857
|
+
newValue.isAfter(endDate.clone().subtract(maxDuration))) {
|
|
858
|
+
newValue = endDate.clone().subtract(maxDuration);
|
|
859
|
+
}
|
|
860
|
+
return newValue;
|
|
861
|
+
};
|
|
862
|
+
// 主要用于处理时间的情况
|
|
863
|
+
DateRangePicker.prototype.handleTimeStartChange = function (newValue) {
|
|
864
|
+
var _this = this;
|
|
865
|
+
var _a = this.props, embed = _a.embed, inputFormat = _a.inputFormat, displayFormat = _a.displayFormat; _a.minDuration; _a.maxDuration; var minDate = _a.minDate;
|
|
866
|
+
var _b = this.state; _b.startDate; var endDate = _b.endDate;
|
|
867
|
+
// 时间范围必须统一成同一天,不然会不一致
|
|
868
|
+
if (endDate) {
|
|
869
|
+
newValue.set({
|
|
870
|
+
year: endDate.year(),
|
|
871
|
+
month: endDate.month(),
|
|
872
|
+
date: endDate.date()
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
if (minDate && newValue && newValue.isBefore(minDate, 'second')) {
|
|
876
|
+
newValue = minDate;
|
|
877
|
+
}
|
|
878
|
+
this.setState({
|
|
879
|
+
startDate: newValue,
|
|
880
|
+
startInputValue: newValue.format(displayFormat || inputFormat)
|
|
881
|
+
}, function () {
|
|
882
|
+
embed && _this.confirm();
|
|
883
|
+
});
|
|
884
|
+
};
|
|
885
|
+
DateRangePicker.prototype.handleTimeEndChange = function (newValue) {
|
|
886
|
+
var _this = this;
|
|
887
|
+
var _a = this.props, embed = _a.embed, inputFormat = _a.inputFormat, displayFormat = _a.displayFormat, minDuration = _a.minDuration, maxDuration = _a.maxDuration, maxDate = _a.maxDate;
|
|
888
|
+
var _b = this.state, startDate = _b.startDate; _b.endDate;
|
|
889
|
+
if (startDate) {
|
|
890
|
+
newValue.set({
|
|
891
|
+
year: startDate.year(),
|
|
892
|
+
month: startDate.month(),
|
|
893
|
+
date: startDate.date()
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
if (maxDate && newValue && newValue.isAfter(maxDate, 'second')) {
|
|
897
|
+
newValue = maxDate;
|
|
898
|
+
}
|
|
899
|
+
if (startDate &&
|
|
900
|
+
minDuration &&
|
|
901
|
+
newValue.isBefore(startDate.clone().add(minDuration))) {
|
|
902
|
+
newValue = startDate.clone().add(minDuration);
|
|
903
|
+
}
|
|
904
|
+
if (startDate &&
|
|
905
|
+
maxDuration &&
|
|
906
|
+
newValue.isAfter(startDate.clone().add(maxDuration))) {
|
|
907
|
+
newValue = startDate.clone().add(maxDuration);
|
|
908
|
+
}
|
|
909
|
+
this.setState({
|
|
910
|
+
endDate: newValue,
|
|
911
|
+
endInputValue: newValue.format(displayFormat || inputFormat)
|
|
912
|
+
}, function () {
|
|
913
|
+
embed && _this.confirm();
|
|
914
|
+
});
|
|
915
|
+
};
|
|
916
|
+
DateRangePicker.prototype.handleMobileChange = function (data, callback) {
|
|
917
|
+
this.setState({
|
|
918
|
+
startDate: data.startDate,
|
|
919
|
+
endDate: data.endDate
|
|
920
|
+
}, callback);
|
|
921
|
+
};
|
|
922
|
+
DateRangePicker.prototype.selectShortcut = function (shortcut) {
|
|
923
|
+
var _a = this.props, closeOnSelect = _a.closeOnSelect, minDateRaw = _a.minDateRaw, maxDateRaw = _a.maxDateRaw, format = _a.format, valueFormat = _a.valueFormat, data = _a.data, mobileUI = _a.mobileUI;
|
|
924
|
+
var now = moment();
|
|
925
|
+
/** minDate和maxDate要实时计算,因为用户可能设置为${NOW()},暂时不考虑毫秒级的时间差 */
|
|
926
|
+
var minDate = minDateRaw
|
|
927
|
+
? filterDate(minDateRaw, data, valueFormat || format)
|
|
928
|
+
: undefined;
|
|
929
|
+
var maxDate = maxDateRaw
|
|
930
|
+
? filterDate(maxDateRaw, data, valueFormat || format)
|
|
931
|
+
: undefined;
|
|
932
|
+
var startDate = shortcut.startDate(now.clone());
|
|
933
|
+
var endDate = shortcut.endDate(now.clone());
|
|
934
|
+
this.setState({
|
|
935
|
+
startDate: minDate && (minDate === null || minDate === void 0 ? void 0 : minDate.isValid())
|
|
936
|
+
? moment.max(startDate, minDate)
|
|
937
|
+
: startDate,
|
|
938
|
+
endDate: maxDate && (maxDate === null || maxDate === void 0 ? void 0 : maxDate.isValid()) ? moment.min(maxDate, endDate) : endDate
|
|
939
|
+
}, closeOnSelect && !mobileUI ? this.confirm : noop);
|
|
940
|
+
};
|
|
941
|
+
DateRangePicker.prototype.renderShortcuts = function (shortcuts) {
|
|
942
|
+
var _this = this;
|
|
943
|
+
if (!shortcuts) {
|
|
944
|
+
return null;
|
|
945
|
+
}
|
|
946
|
+
var _a = this.props, ns = _a.classPrefix, format = _a.format, valueFormat = _a.valueFormat, data = _a.data, __ = _a.translate, testIdBuilder = _a.testIdBuilder;
|
|
947
|
+
var shortcutArr;
|
|
948
|
+
if (typeof shortcuts === 'string') {
|
|
949
|
+
shortcutArr = shortcuts.split(',');
|
|
950
|
+
}
|
|
951
|
+
else {
|
|
952
|
+
shortcutArr = shortcuts;
|
|
953
|
+
}
|
|
954
|
+
var TIDBuilder = testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('shortcut');
|
|
955
|
+
return (React__default.createElement("ul", { className: "".concat(ns, "DateRangePicker-rangers") }, shortcutArr.map(function (item, index) {
|
|
956
|
+
if (!item) {
|
|
957
|
+
return null;
|
|
958
|
+
}
|
|
959
|
+
var shortcut = {};
|
|
960
|
+
if (typeof item === 'string') {
|
|
961
|
+
if (availableShortcuts[item]) {
|
|
962
|
+
shortcut = availableShortcuts[item];
|
|
963
|
+
shortcut.key = item;
|
|
964
|
+
}
|
|
965
|
+
else {
|
|
966
|
+
// 通过正则尝试匹配
|
|
967
|
+
for (var i = 0, len = advancedRanges.length; i < len; i++) {
|
|
968
|
+
var value = advancedRanges[i];
|
|
969
|
+
var m = value.regexp.exec(item);
|
|
970
|
+
if (m) {
|
|
971
|
+
shortcut = value.resolve.apply(item, __spreadArray([__], __read(m), false));
|
|
972
|
+
shortcut.key = item;
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
else if (item.startDate &&
|
|
978
|
+
item.endDate) {
|
|
979
|
+
var shortcutRaw_1 = __assign({}, item);
|
|
980
|
+
shortcut = __assign(__assign({}, item), { startDate: function () {
|
|
981
|
+
var startDate = isExpression(shortcutRaw_1.startDate)
|
|
982
|
+
? moment(FormulaExec['formula'](shortcutRaw_1.startDate, data), valueFormat || format)
|
|
983
|
+
: typeof shortcutRaw_1.startDate === 'string'
|
|
984
|
+
? moment(shortcutRaw_1.startDate, valueFormat || format)
|
|
985
|
+
: shortcutRaw_1.startDate;
|
|
986
|
+
return startDate &&
|
|
987
|
+
moment.isMoment(startDate) &&
|
|
988
|
+
startDate.isValid()
|
|
989
|
+
? startDate
|
|
990
|
+
: item.startDate;
|
|
991
|
+
}, endDate: function () {
|
|
992
|
+
var endDate = isExpression(shortcutRaw_1.endDate)
|
|
993
|
+
? moment(FormulaExec['formula'](shortcutRaw_1.endDate, data), valueFormat || format)
|
|
994
|
+
: typeof shortcutRaw_1.endDate === 'string'
|
|
995
|
+
? moment(shortcutRaw_1.endDate, valueFormat || format)
|
|
996
|
+
: shortcutRaw_1.endDate;
|
|
997
|
+
return endDate && moment.isMoment(endDate) && endDate.isValid()
|
|
998
|
+
? endDate
|
|
999
|
+
: item.endDate;
|
|
1000
|
+
} });
|
|
1001
|
+
}
|
|
1002
|
+
if (Object.keys(shortcut).length) {
|
|
1003
|
+
return (React__default.createElement("li", { className: "".concat(ns, "DateRangePicker-ranger"), onClick: function () { return _this.selectShortcut(shortcut); }, key: index },
|
|
1004
|
+
React__default.createElement("a", __assign({}, TIDBuilder === null || TIDBuilder === void 0 ? void 0 : TIDBuilder.getChild(shortcut.key).getTestId()), __(shortcut.label))));
|
|
1005
|
+
}
|
|
1006
|
+
else {
|
|
1007
|
+
return null;
|
|
1008
|
+
}
|
|
1009
|
+
})));
|
|
1010
|
+
};
|
|
1011
|
+
DateRangePicker.prototype.clearValue = function (e) {
|
|
1012
|
+
e.preventDefault();
|
|
1013
|
+
e.stopPropagation();
|
|
1014
|
+
var onChange = this.props.onChange;
|
|
1015
|
+
this.setState({ startInputValue: '', endInputValue: '' });
|
|
1016
|
+
onChange('');
|
|
1017
|
+
};
|
|
1018
|
+
// 清空
|
|
1019
|
+
DateRangePicker.prototype.clear = function () {
|
|
1020
|
+
var onChange = this.props.onChange;
|
|
1021
|
+
this.setState({ startInputValue: '', endInputValue: '' });
|
|
1022
|
+
onChange('');
|
|
1023
|
+
};
|
|
1024
|
+
// 重置
|
|
1025
|
+
DateRangePicker.prototype.reset = function (resetValue) {
|
|
1026
|
+
var _a = this.props, onChange = _a.onChange, format = _a.format, valueFormat = _a.valueFormat, joinValues = _a.joinValues, delimiter = _a.delimiter, inputFormat = _a.inputFormat, displayFormat = _a.displayFormat, data = _a.data, utc = _a.utc;
|
|
1027
|
+
var tmpResetValue = resetValue !== null && resetValue !== void 0 ? resetValue : this.props.resetValue;
|
|
1028
|
+
var _b = DateRangePicker.unFormatValue(tmpResetValue, valueFormat || format, joinValues, delimiter, data, utc), startDate = _b.startDate, endDate = _b.endDate;
|
|
1029
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(tmpResetValue);
|
|
1030
|
+
this.setState({
|
|
1031
|
+
startInputValue: startDate === null || startDate === void 0 ? void 0 : startDate.format(displayFormat || inputFormat),
|
|
1032
|
+
endInputValue: endDate === null || endDate === void 0 ? void 0 : endDate.format(displayFormat || inputFormat)
|
|
1033
|
+
});
|
|
1034
|
+
};
|
|
1035
|
+
DateRangePicker.prototype.checkStartIsValidDate = function (currentDate) {
|
|
1036
|
+
var _a = this.state, endDate = _a.endDate; _a.startDate;
|
|
1037
|
+
var _b = this.props, minDate = _b.minDate, maxDate = _b.maxDate, minDuration = _b.minDuration, maxDuration = _b.maxDuration, viewMode = _b.viewMode;
|
|
1038
|
+
var precision = viewMode === 'time' ? 'hours' : viewMode || 'day';
|
|
1039
|
+
maxDate =
|
|
1040
|
+
maxDate && endDate
|
|
1041
|
+
? maxDate.isBefore(endDate)
|
|
1042
|
+
? maxDate
|
|
1043
|
+
: endDate
|
|
1044
|
+
: maxDate || endDate;
|
|
1045
|
+
if (minDate && currentDate.isBefore(minDate, precision)) {
|
|
1046
|
+
return false;
|
|
1047
|
+
}
|
|
1048
|
+
else if (maxDate && currentDate.isAfter(maxDate, precision)) {
|
|
1049
|
+
return false;
|
|
1050
|
+
}
|
|
1051
|
+
else if (
|
|
1052
|
+
// 如果配置了 minDuration 那么 EndDate - minDuration 之后的天数也不能选
|
|
1053
|
+
endDate &&
|
|
1054
|
+
minDuration &&
|
|
1055
|
+
currentDate.isAfter(endDate.clone().subtract(minDuration))) {
|
|
1056
|
+
return false;
|
|
1057
|
+
}
|
|
1058
|
+
else if (endDate &&
|
|
1059
|
+
maxDuration &&
|
|
1060
|
+
currentDate.isBefore(endDate.clone().subtract(maxDuration))) {
|
|
1061
|
+
return false;
|
|
1062
|
+
}
|
|
1063
|
+
return true;
|
|
1064
|
+
};
|
|
1065
|
+
DateRangePicker.prototype.checkEndIsValidDate = function (currentDate) {
|
|
1066
|
+
var startDate = this.state.startDate;
|
|
1067
|
+
var _a = this.props, minDate = _a.minDate, maxDate = _a.maxDate, minDuration = _a.minDuration, maxDuration = _a.maxDuration, viewMode = _a.viewMode;
|
|
1068
|
+
var precision = viewMode === 'time' ? 'hours' : viewMode || 'day';
|
|
1069
|
+
minDate =
|
|
1070
|
+
minDate && startDate
|
|
1071
|
+
? minDate.isAfter(startDate)
|
|
1072
|
+
? minDate
|
|
1073
|
+
: startDate
|
|
1074
|
+
: minDate || startDate;
|
|
1075
|
+
// 在 dateTimeRange 的场景下,如果选择了开始时间的时间点不为 0,比如 2020-10-1 10:10,这时 currentDate 传入的当天值是 2020-10-1 00:00,这个值在起始时间后面,导致没法再选这一天了,所以在这时需要先通过将时间都转成 00 再比较
|
|
1076
|
+
if (minDate &&
|
|
1077
|
+
currentDate
|
|
1078
|
+
.startOf('day')
|
|
1079
|
+
.isBefore(minDate.clone().startOf('day'), precision)) {
|
|
1080
|
+
return false;
|
|
1081
|
+
}
|
|
1082
|
+
else if (maxDate && currentDate.isAfter(maxDate, precision)) {
|
|
1083
|
+
return false;
|
|
1084
|
+
}
|
|
1085
|
+
else if (startDate &&
|
|
1086
|
+
minDuration &&
|
|
1087
|
+
currentDate.isBefore(startDate.clone().add(minDuration))) {
|
|
1088
|
+
return false;
|
|
1089
|
+
}
|
|
1090
|
+
else if (startDate &&
|
|
1091
|
+
maxDuration &&
|
|
1092
|
+
currentDate.isAfter(startDate.clone().add(maxDuration))) {
|
|
1093
|
+
return false;
|
|
1094
|
+
}
|
|
1095
|
+
return true;
|
|
1096
|
+
};
|
|
1097
|
+
DateRangePicker.prototype.renderDay = function (props, currentDate) {
|
|
1098
|
+
var _a;
|
|
1099
|
+
var _b = this.state, startDate = _b.startDate, endDate = _b.endDate;
|
|
1100
|
+
var testIdBuilder = this.props.testIdBuilder;
|
|
1101
|
+
if (startDate &&
|
|
1102
|
+
endDate &&
|
|
1103
|
+
currentDate.isBetween(startDate, endDate, 'day', '[]')) {
|
|
1104
|
+
props.className += ' rdtBetween';
|
|
1105
|
+
}
|
|
1106
|
+
// 如果已经选择了开始时间和结束时间,那么中间的时间都不应该高亮
|
|
1107
|
+
if (startDate && endDate && props.className.includes('rdtActive')) {
|
|
1108
|
+
props.className = props.className.replace('rdtActive', '');
|
|
1109
|
+
}
|
|
1110
|
+
if (startDate && currentDate.isSame(startDate, 'day')) {
|
|
1111
|
+
props.className += ' rdtActive rdtStart';
|
|
1112
|
+
}
|
|
1113
|
+
if (endDate && currentDate.isSame(endDate, 'day')) {
|
|
1114
|
+
props.className += ' rdtActive rdtEnd';
|
|
1115
|
+
}
|
|
1116
|
+
var _c = this.getDisabledElementProps(currentDate, 'day'), className = _c.className, others = __rest(_c, ["className"]);
|
|
1117
|
+
props.className += className;
|
|
1118
|
+
return (React__default.createElement("td", __assign({}, omit(props, ['todayActiveStyle']), others),
|
|
1119
|
+
React__default.createElement("span", __assign({}, (_a = testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild(props.key)) === null || _a === void 0 ? void 0 : _a.getTestId()), currentDate.date())));
|
|
1120
|
+
};
|
|
1121
|
+
DateRangePicker.prototype.renderMonth = function (props, month, year, date) {
|
|
1122
|
+
var currentDate = props.viewDate.year(year).month(month);
|
|
1123
|
+
var _a = this.state, startDate = _a.startDate, endDate = _a.endDate;
|
|
1124
|
+
var _b = this.props, __ = _b.translate, testIdBuilder = _b.testIdBuilder;
|
|
1125
|
+
var monthStr = currentDate.format(__('MMM'));
|
|
1126
|
+
var strLength = 3;
|
|
1127
|
+
// Because some months are up to 5 characters long, we want to
|
|
1128
|
+
// use a fixed string length for consistency
|
|
1129
|
+
var monthStrFixedLength = monthStr.substring(0, strLength);
|
|
1130
|
+
if (startDate &&
|
|
1131
|
+
endDate &&
|
|
1132
|
+
currentDate.isBetween(startDate, endDate, 'month', '[]')) {
|
|
1133
|
+
props.className += ' rdtBetween';
|
|
1134
|
+
}
|
|
1135
|
+
// 如果已经选择了开始时间和结束时间,那么中间的时间都不应该高亮
|
|
1136
|
+
if (startDate && endDate && props.className.includes('rdtActive')) {
|
|
1137
|
+
props.className = props.className.replace('rdtActive', '');
|
|
1138
|
+
}
|
|
1139
|
+
if (startDate && currentDate.isSame(startDate, 'month')) {
|
|
1140
|
+
props.className += ' rdtActive rdtStart';
|
|
1141
|
+
}
|
|
1142
|
+
if (endDate && currentDate.isSame(endDate, 'month')) {
|
|
1143
|
+
props.className += ' rdtActive rdtEnd';
|
|
1144
|
+
}
|
|
1145
|
+
var _c = this.getDisabledElementProps(currentDate, 'month'), className = _c.className, others = __rest(_c, ["className"]);
|
|
1146
|
+
props.className += className;
|
|
1147
|
+
return (React__default.createElement("td", __assign({}, omit(props, 'viewDate'), others),
|
|
1148
|
+
React__default.createElement("span", __assign({}, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild(props.key).getTestId()), monthStrFixedLength)));
|
|
1149
|
+
};
|
|
1150
|
+
DateRangePicker.prototype.renderQuarter = function (props, quarter, year) {
|
|
1151
|
+
var currentDate = moment().year(year).quarter(quarter);
|
|
1152
|
+
var _a = this.state, startDate = _a.startDate, endDate = _a.endDate;
|
|
1153
|
+
var testIdBuilder = this.props.testIdBuilder;
|
|
1154
|
+
if (startDate &&
|
|
1155
|
+
endDate &&
|
|
1156
|
+
currentDate.isBetween(startDate, endDate, 'quarter', '[]')) {
|
|
1157
|
+
props.className += ' rdtBetween';
|
|
1158
|
+
}
|
|
1159
|
+
// 如果已经选择了开始时间和结束时间,那么中间的时间都不应该高亮
|
|
1160
|
+
if (startDate && endDate && props.className.includes('rdtActive')) {
|
|
1161
|
+
props.className = props.className.replace('rdtActive', '');
|
|
1162
|
+
}
|
|
1163
|
+
if (startDate && currentDate.isSame(startDate, 'quarter')) {
|
|
1164
|
+
props.className += ' rdtActive rdtStart';
|
|
1165
|
+
}
|
|
1166
|
+
if (endDate && currentDate.isSame(endDate, 'quarter')) {
|
|
1167
|
+
props.className += ' rdtActive rdtEnd';
|
|
1168
|
+
}
|
|
1169
|
+
var _b = this.getDisabledElementProps(currentDate, 'quarter'), className = _b.className, others = __rest(_b, ["className"]);
|
|
1170
|
+
props.className += className;
|
|
1171
|
+
return (React__default.createElement("td", __assign({}, props, others),
|
|
1172
|
+
React__default.createElement("span", __assign({}, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild(props.key).getTestId()),
|
|
1173
|
+
"Q",
|
|
1174
|
+
quarter)));
|
|
1175
|
+
};
|
|
1176
|
+
DateRangePicker.prototype.renderYear = function (props, year) {
|
|
1177
|
+
var currentDate = moment().year(year);
|
|
1178
|
+
var _a = this.state, startDate = _a.startDate, endDate = _a.endDate;
|
|
1179
|
+
var testIdBuilder = this.props.testIdBuilder;
|
|
1180
|
+
if (startDate &&
|
|
1181
|
+
endDate &&
|
|
1182
|
+
currentDate.isBetween(startDate, endDate, 'year', '[]')) {
|
|
1183
|
+
props.className += ' rdtBetween';
|
|
1184
|
+
}
|
|
1185
|
+
// 如果已经选择了开始时间和结束时间,那么中间的时间都不应该高亮
|
|
1186
|
+
if (startDate && endDate && props.className.includes('rdtActive')) {
|
|
1187
|
+
props.className = props.className.replace('rdtActive', '');
|
|
1188
|
+
}
|
|
1189
|
+
if (startDate && currentDate.isSame(startDate, 'year')) {
|
|
1190
|
+
props.className += ' rdtActive rdtStart';
|
|
1191
|
+
}
|
|
1192
|
+
if (endDate && currentDate.isSame(endDate, 'year')) {
|
|
1193
|
+
props.className += ' rdtActive rdtEnd';
|
|
1194
|
+
}
|
|
1195
|
+
var _b = this.getDisabledElementProps(currentDate, 'year'), className = _b.className, others = __rest(_b, ["className"]);
|
|
1196
|
+
props.className += className;
|
|
1197
|
+
return (React__default.createElement("td", __assign({}, props, others),
|
|
1198
|
+
React__default.createElement("span", __assign({}, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild(props.key).getTestId()), year)));
|
|
1199
|
+
};
|
|
1200
|
+
DateRangePicker.prototype.renderCalendar = function () {
|
|
1201
|
+
var _this = this;
|
|
1202
|
+
var _a = this.props, ns = _a.classPrefix, cx = _a.classnames, inputFormat = _a.inputFormat, displayFormat = _a.displayFormat, ranges = _a.ranges, shortcuts = _a.shortcuts, locale = _a.locale, embed = _a.embed, type = _a.type, _b = _a.viewMode, viewMode = _b === void 0 ? 'days' : _b, label = _a.label, mobileUI = _a.mobileUI, testIdBuilder = _a.testIdBuilder;
|
|
1203
|
+
var __ = this.props.translate;
|
|
1204
|
+
var _c = this.state, startDate = _c.startDate, endDate = _c.endDate, editState = _c.editState, curDateFormat = _c.curDateFormat, curTimeFormat = _c.curTimeFormat;
|
|
1205
|
+
var isDateTimeRange = type === 'input-datetime-range';
|
|
1206
|
+
var isDateRange = type === 'input-date-range';
|
|
1207
|
+
// timeRange需要单独选择范围
|
|
1208
|
+
var isTimeRange = isDateTimeRange || viewMode === 'time';
|
|
1209
|
+
var isConfirmBtnDisbaled = (isTimeRange && editState === 'start' && !startDate) ||
|
|
1210
|
+
(isTimeRange && editState === 'end' && !endDate) ||
|
|
1211
|
+
(startDate && (endDate === null || endDate === void 0 ? void 0 : endDate.isBefore(this.state.startDate))) ||
|
|
1212
|
+
/** 日期范围选择之后会立即切换面板,所以开始/结束日期任意一个不合法就不允许更新数据 */
|
|
1213
|
+
(isDateRange &&
|
|
1214
|
+
(!startDate ||
|
|
1215
|
+
!endDate ||
|
|
1216
|
+
!(startDate === null || startDate === void 0 ? void 0 : startDate.isValid()) ||
|
|
1217
|
+
!(endDate === null || endDate === void 0 ? void 0 : endDate.isValid())));
|
|
1218
|
+
return (React__default.createElement("div", { className: cx("".concat(ns, "DateRangePicker-wrap"), { 'is-mobile': mobileUI }), ref: this.calendarRef },
|
|
1219
|
+
mobileUI && !embed ? (React__default.createElement("div", { className: cx('PickerColumns-header') },
|
|
1220
|
+
React__default.createElement(Button, { className: "PickerColumns-cancel", level: "link", onClick: function () { return _this.close(false); } }, __('cancel')),
|
|
1221
|
+
label && typeof label === 'string'
|
|
1222
|
+
? label
|
|
1223
|
+
: __('Calendar.datepicker'),
|
|
1224
|
+
React__default.createElement(Button, { className: "PickerColumns-confirm", level: "link", disabled: isConfirmBtnDisbaled || !startDate || !endDate, onClick: this.confirm }, __('confirm')))) : null,
|
|
1225
|
+
this.renderShortcuts(ranges || shortcuts),
|
|
1226
|
+
React__default.createElement("div", { className: cx("".concat(ns, "DateRangePicker-picker-wrap"), {
|
|
1227
|
+
'is-vertical': embed
|
|
1228
|
+
}) },
|
|
1229
|
+
(!isTimeRange ||
|
|
1230
|
+
(editState === 'start' && !embed) ||
|
|
1231
|
+
(mobileUI && isTimeRange)) && (React__default.createElement(Calendar, { className: "".concat(ns, "DateRangePicker-start"), value: startDate,
|
|
1232
|
+
// 区分的原因是 time-range 左侧就只能选起始时间,而其它都能在左侧同时同时选择起始和结束
|
|
1233
|
+
// TODO: 后续得把 time-range 代码拆分出来
|
|
1234
|
+
onChange: isDateTimeRange
|
|
1235
|
+
? this.handleStartDateChange
|
|
1236
|
+
: viewMode === 'time'
|
|
1237
|
+
? this.handleTimeStartChange
|
|
1238
|
+
: this.handleDateChange, requiredConfirm: false, dateFormat: curDateFormat, displayForamt: displayFormat || inputFormat, timeFormat: curTimeFormat, 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", embed: embed, status: "start", testIdBuilder: testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('calendar-start') })),
|
|
1239
|
+
(!isTimeRange ||
|
|
1240
|
+
(editState === 'end' && !embed) ||
|
|
1241
|
+
(mobileUI && isTimeRange)) && (React__default.createElement(Calendar, { className: "".concat(ns, "DateRangePicker-end"), value: endDate, onChange: isDateTimeRange
|
|
1242
|
+
? this.handelEndDateChange
|
|
1243
|
+
: viewMode === 'time'
|
|
1244
|
+
? this.handleTimeEndChange
|
|
1245
|
+
: this.handleDateChange, requiredConfirm: false, dateFormat: curDateFormat, displayForamt: displayFormat || inputFormat, timeFormat: curTimeFormat, viewDate: isDateTimeRange ? this.currentMonth : this.nextMonth,
|
|
1246
|
+
// isEndDate
|
|
1247
|
+
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", embed: embed, status: "end", testIdBuilder: testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('calendar-end') }))),
|
|
1248
|
+
embed || mobileUI ? null : (React__default.createElement("div", { key: "button", className: "".concat(ns, "DateRangePicker-actions") },
|
|
1249
|
+
React__default.createElement(Button, { size: "sm", onClick: function () { return _this.close(); } }, __('cancel')),
|
|
1250
|
+
React__default.createElement(Button, { level: "primary", size: "sm", className: cx('m-l-sm'), disabled: isConfirmBtnDisbaled, onClick: this.confirm }, __('confirm'))))));
|
|
1251
|
+
};
|
|
1252
|
+
DateRangePicker.prototype.getDisabledElementProps = function (currentDate, granularity) {
|
|
1253
|
+
var _a = this.state; _a.endDateOpenedFirst; var endDate = _a.endDate, startDate = _a.startDate, editState = _a.editState;
|
|
1254
|
+
var afterEndDate = editState === 'start' &&
|
|
1255
|
+
endDate &&
|
|
1256
|
+
currentDate.isAfter(endDate, granularity);
|
|
1257
|
+
var beforeStartDate = editState === 'end' &&
|
|
1258
|
+
startDate &&
|
|
1259
|
+
!currentDate.isSameOrAfter(startDate, granularity);
|
|
1260
|
+
if (afterEndDate || beforeStartDate) {
|
|
1261
|
+
return {
|
|
1262
|
+
className: ' is-disabled',
|
|
1263
|
+
onClick: undefined
|
|
1264
|
+
};
|
|
1265
|
+
}
|
|
1266
|
+
return {
|
|
1267
|
+
className: ''
|
|
1268
|
+
};
|
|
1269
|
+
};
|
|
1270
|
+
/** 获取宽度类型变量的值 */
|
|
1271
|
+
DateRangePicker.prototype.getValidWidthValue = function (element, propsName) {
|
|
1272
|
+
if (!element || !propsName) {
|
|
1273
|
+
return 0;
|
|
1274
|
+
}
|
|
1275
|
+
var propsValue = parseInt(getComputedStyle(element, kebabCase(propsName)), 10);
|
|
1276
|
+
return isNaN(propsValue) ? 0 : propsValue;
|
|
1277
|
+
};
|
|
1278
|
+
DateRangePicker.prototype.renderActiveCursor = function () {
|
|
1279
|
+
var _a, _b, _c, _d;
|
|
1280
|
+
var cx = this.props.classnames;
|
|
1281
|
+
var _e = this.state, editState = _e.editState, isFocused = _e.isFocused;
|
|
1282
|
+
var cursorWidth = 0;
|
|
1283
|
+
var cursorLeft = 0;
|
|
1284
|
+
var parentNode = (_a = this === null || this === void 0 ? void 0 : this.dom) === null || _a === void 0 ? void 0 : _a.current;
|
|
1285
|
+
var startInputNode = (_b = this === null || this === void 0 ? void 0 : this.startInputRef) === null || _b === void 0 ? void 0 : _b.current;
|
|
1286
|
+
var endInputNode = (_c = this === null || this === void 0 ? void 0 : this.endInputRef) === null || _c === void 0 ? void 0 : _c.current;
|
|
1287
|
+
var separatorNode = (_d = this === null || this === void 0 ? void 0 : this.separatorRef) === null || _d === void 0 ? void 0 : _d.current;
|
|
1288
|
+
if (parentNode && startInputNode && endInputNode && separatorNode) {
|
|
1289
|
+
if (editState === 'start') {
|
|
1290
|
+
var paddingWidth = this.getValidWidthValue(parentNode, 'paddingLeft');
|
|
1291
|
+
cursorLeft = paddingWidth;
|
|
1292
|
+
cursorWidth = startInputNode.offsetWidth;
|
|
1293
|
+
}
|
|
1294
|
+
else if (editState === 'end') {
|
|
1295
|
+
var separatorWidth = separatorNode.offsetWidth +
|
|
1296
|
+
this.getValidWidthValue(parentNode, 'paddingLeft') +
|
|
1297
|
+
this.getValidWidthValue(parentNode, 'marginLeft') +
|
|
1298
|
+
this.getValidWidthValue(parentNode, 'paddingRight') +
|
|
1299
|
+
this.getValidWidthValue(parentNode, 'marginRight');
|
|
1300
|
+
cursorLeft = startInputNode.offsetWidth + separatorWidth;
|
|
1301
|
+
cursorWidth = endInputNode.offsetWidth;
|
|
1302
|
+
}
|
|
1303
|
+
else {
|
|
1304
|
+
cursorWidth = 0;
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
return (React__default.createElement("div", { className: cx('DateRangePicker-activeCursor', { isFocused: isFocused }), style: {
|
|
1308
|
+
position: 'absolute',
|
|
1309
|
+
left: cursorLeft,
|
|
1310
|
+
width: cursorWidth
|
|
1311
|
+
} }));
|
|
1312
|
+
};
|
|
1313
|
+
DateRangePicker.prototype.getDefaultDate = function () {
|
|
1314
|
+
var _a;
|
|
1315
|
+
var _b = this.props, value = _b.value, data = _b.data, valueFormat = _b.valueFormat, format = _b.format, delimiter = _b.delimiter;
|
|
1316
|
+
if (value) {
|
|
1317
|
+
var startDate = filterDate(Array.isArray(value)
|
|
1318
|
+
? value[0] || value[1]
|
|
1319
|
+
: (_a = String(value).split(delimiter)) === null || _a === void 0 ? void 0 : _a[0], data, valueFormat || format);
|
|
1320
|
+
return startDate;
|
|
1321
|
+
}
|
|
1322
|
+
return undefined;
|
|
1323
|
+
};
|
|
1324
|
+
DateRangePicker.prototype.render = function () {
|
|
1325
|
+
var _a;
|
|
1326
|
+
var _this = this;
|
|
1327
|
+
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, popOverContainerSelector = _b.popOverContainerSelector, inputFormat = _b.inputFormat, displayFormat = _b.displayFormat; _b.joinValues; _b.delimiter; var clearable = _b.clearable, inputForbid = _b.inputForbid, disabled = _b.disabled, embed = _b.embed, overlayPlacement = _b.overlayPlacement, borderMode = _b.borderMode, mobileUI = _b.mobileUI; _b.timeFormat; var minDate = _b.minDate, maxDate = _b.maxDate, minDuration = _b.minDuration, maxDuration = _b.maxDuration; _b.dateFormat; var _c = _b.viewMode, viewMode = _c === void 0 ? 'days' : _c, ranges = _b.ranges, shortcuts = _b.shortcuts, label = _b.label, animation = _b.animation, testIdBuilder = _b.testIdBuilder, locale = _b.locale;
|
|
1328
|
+
var useCalendarMobile = mobileUI && ['days', 'months', 'quarters'].indexOf(viewMode) > -1;
|
|
1329
|
+
var _d = this.state, isOpened = _d.isOpened, isFocused = _d.isFocused, startDate = _d.startDate, endDate = _d.endDate, curDateFormat = _d.curDateFormat, curTimeFormat = _d.curTimeFormat;
|
|
1330
|
+
var __ = this.props.translate;
|
|
1331
|
+
var calendarMobile = (React__default.createElement(CalendarMobile, { popOverContainer: popOverContainer, timeFormat: curTimeFormat, displayForamt: displayFormat || inputFormat, defaultDate: this.getDefaultDate(), startDate: startDate, endDate: endDate, minDate: minDate, maxDate: maxDate, minDuration: minDuration, maxDuration: maxDuration, dateFormat: curDateFormat, embed: embed, viewMode: viewMode, close: this.close, confirm: this.confirm, onChange: this.handleMobileChange, footerExtra: this.renderShortcuts(ranges || shortcuts), locale: locale, showViewMode: viewMode === 'quarters' || viewMode === 'months' ? 'years' : 'months' }));
|
|
1332
|
+
if (embed) {
|
|
1333
|
+
return (React__default.createElement("div", { className: cx("".concat(ns, "DateRangeCalendar"), {
|
|
1334
|
+
'is-mobile': mobileUI
|
|
1335
|
+
}, {
|
|
1336
|
+
'is-disabled': disabled
|
|
1337
|
+
}, className) }, useCalendarMobile ? calendarMobile : this.renderCalendar()));
|
|
1338
|
+
}
|
|
1339
|
+
var CalendarMobileTitle = (React__default.createElement("div", { className: "".concat(ns, "CalendarMobile-title") }, label && typeof label === 'string' ? label : __('Calendar.datepicker')));
|
|
1340
|
+
/** 是否启用游标动画 */
|
|
1341
|
+
var useAnimation = animation !== false;
|
|
1342
|
+
return (React__default.createElement("div", { tabIndex: 0, onKeyPress: this.handleKeyPress, onFocus: this.handleFocus, onBlur: this.handleBlur, className: cx("".concat(ns, "DateRangePicker"), (_a = {
|
|
1343
|
+
'is-disabled': disabled,
|
|
1344
|
+
'is-focused': isFocused
|
|
1345
|
+
},
|
|
1346
|
+
_a["".concat(ns, "DateRangePicker--border").concat(ucFirst(borderMode))] = borderMode,
|
|
1347
|
+
_a['is-mobile'] = mobileUI,
|
|
1348
|
+
_a), className), ref: this.dom },
|
|
1349
|
+
React__default.createElement(Input, { className: cx('DateRangePicker-input', {
|
|
1350
|
+
isActive: !useAnimation && this.state.editState === 'start' && isOpened
|
|
1351
|
+
}), onChange: this.startInputChange, onClick: this.openStart, ref: this.startInputRef, placeholder: __(startPlaceholder), autoComplete: "off", value: this.state.startInputValue || '', disabled: disabled, readOnly: mobileUI || inputForbid, testIdBuilder: testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('start') }),
|
|
1352
|
+
React__default.createElement("span", { className: cx('DateRangePicker-input-separator'), ref: this.separatorRef },
|
|
1353
|
+
React__default.createElement("span", { className: cx('DateRangePicker-input-separator-line') })),
|
|
1354
|
+
React__default.createElement(Input, { className: cx('DateRangePicker-input', {
|
|
1355
|
+
isActive: !useAnimation && this.state.editState === 'end' && isOpened
|
|
1356
|
+
}), onChange: this.endInputChange, onClick: this.openEnd, ref: this.endInputRef, placeholder: __(endPlaceholder), autoComplete: "off", value: this.state.endInputValue || '', disabled: disabled, readOnly: mobileUI || inputForbid, testIdBuilder: testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('end') }),
|
|
1357
|
+
useAnimation ? this.renderActiveCursor() : null,
|
|
1358
|
+
clearable && !disabled && value ? (React__default.createElement("a", { className: "".concat(ns, "DateRangePicker-clear"), onClick: this.clearValue },
|
|
1359
|
+
React__default.createElement(Icon, { icon: "input-clear", className: "icon" }))) : null,
|
|
1360
|
+
React__default.createElement("a", { className: cx("DateRangePicker-toggler") },
|
|
1361
|
+
React__default.createElement(Icon, { icon: viewMode === 'time' ? 'clock' : 'date', className: "icon", iconContent: viewMode === 'time'
|
|
1362
|
+
? 'DatePicker-toggler-clock'
|
|
1363
|
+
: 'DatePicker-toggler-date' })),
|
|
1364
|
+
isOpened ? (mobileUI ? (React__default.createElement(PopUp, { isShow: isOpened, container: popOverContainer, className: cx("".concat(ns, "CalendarMobile-pop"), "".concat(ns, "CalendarMobile-pop--").concat(viewMode)), onHide: this.close, header: CalendarMobileTitle, showClose: false }, useCalendarMobile ? calendarMobile : this.renderCalendar())) : (React__default.createElement(Overlay, { target: function () { return _this.dom.current; }, onHide: this.close, container: popOverContainer || (function () { return findDOMNode(_this); }), containerSelector: popOverContainerSelector, rootClose: false, placement: overlayPlacement, show: true },
|
|
1365
|
+
React__default.createElement(PopOver, { classPrefix: ns, className: cx("".concat(ns, "DateRangePicker-popover"), popoverClassName), onHide: this.close, onClick: this.handlePopOverClick }, this.renderCalendar())))) : null));
|
|
1366
|
+
};
|
|
1367
|
+
DateRangePicker.defaultProps = {
|
|
1368
|
+
startPlaceholder: 'Calendar.startPick',
|
|
1369
|
+
endPlaceholder: 'Calendar.endPick',
|
|
1370
|
+
format: 'X',
|
|
1371
|
+
inputFormat: 'YYYY-MM-DD',
|
|
1372
|
+
joinValues: true,
|
|
1373
|
+
clearable: true,
|
|
1374
|
+
delimiter: ',',
|
|
1375
|
+
ranges: '',
|
|
1376
|
+
shortcuts: 'yesterday,7daysago,prevweek,thismonth,prevmonth,prevquarter',
|
|
1377
|
+
resetValue: '',
|
|
1378
|
+
closeOnSelect: true,
|
|
1379
|
+
overlayPlacement: 'auto',
|
|
1380
|
+
endDateOpenedFirst: false
|
|
1381
|
+
};
|
|
1382
|
+
return DateRangePicker;
|
|
1383
|
+
}(React__default.Component));
|
|
1384
|
+
var DateRangePicker$1 = themeable(localeable(DateRangePicker));
|
|
1385
|
+
|
|
1386
|
+
export { DateRangePicker, advancedRanges, availableShortcuts, DateRangePicker$1 as default };
|