@kdcloudjs/kdesign 1.8.12 → 1.8.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kdesign.css +1 -1
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +5 -3
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +1 -1
- package/dist/kdesign.min.js +2 -2
- package/dist/kdesign.min.js.map +1 -1
- package/es/_utils/KeyCode.js +1 -333
- package/es/_utils/arrayUtil.js +0 -8
- package/es/_utils/formatUtil.js +9 -59
- package/es/_utils/getStringLength.js +0 -1
- package/es/_utils/hooks.js +2 -34
- package/es/_utils/index.js +1 -7
- package/es/_utils/numberUtil.js +0 -54
- package/es/_utils/raf.js +2 -2
- package/es/_utils/reactNode.js +1 -1
- package/es/_utils/resizeObserver.js +2 -4
- package/es/_utils/type.js +0 -1
- package/es/_utils/usePopper.js +3 -3
- package/es/alert/alert.js +8 -16
- package/es/anchor/anchor-link.js +3 -3
- package/es/anchor/anchor.js +23 -26
- package/es/anchor/context.js +1 -1
- package/es/avatar/avatar.js +8 -11
- package/es/badge/badge.js +7 -13
- package/es/base-data/base-data.js +34 -103
- package/es/breadcrumb/breadcrumb.js +12 -12
- package/es/breadcrumb/breadcrumbItem.js +5 -5
- package/es/button/button.js +13 -24
- package/es/button/group.js +13 -13
- package/es/card/card.js +12 -14
- package/es/carousel/carousel.js +13 -13
- package/es/carousel/displayList.js +3 -3
- package/es/carousel/fadeList.js +3 -3
- package/es/carousel/slideList.js +4 -4
- package/es/carousel/slidebar.js +3 -3
- package/es/cascader/cascader.js +31 -36
- package/es/checkbox/checkbox.js +25 -30
- package/es/checkbox/group.js +8 -9
- package/es/city-picker/city-picker.js +28 -38
- package/es/city-picker/interface.js +1 -1
- package/es/city-picker/option.js +4 -4
- package/es/clipboard/clipboard.js +5 -23
- package/es/clipboard/util.js +0 -60
- package/es/collapse/collapse.js +5 -5
- package/es/collapse/panel.js +15 -15
- package/es/color-picker/color-picker-panel.js +12 -13
- package/es/color-picker/color-picker.js +6 -10
- package/es/color-picker/utils/validateColor.js +0 -3
- package/es/config-provider/ConfigContext.js +1 -4
- package/es/config-provider/SizeContext.js +3 -3
- package/es/config-provider/compDefaultProps.js +3 -10
- package/es/config-provider/configProvider.js +1 -6
- package/es/config-provider/defaultConfig.js +0 -1
- package/es/date-picker/calendar.js +6 -23
- package/es/date-picker/context.js +1 -1
- package/es/date-picker/date-panel.js +12 -13
- package/es/date-picker/date-picker.js +7 -12
- package/es/date-picker/hooks/use-hover-value.js +0 -1
- package/es/date-picker/hooks/use-picker-input.js +0 -4
- package/es/date-picker/hooks/use-range-disabled.js +2 -6
- package/es/date-picker/hooks/use-range-view-dates.js +1 -9
- package/es/date-picker/hooks/use-text-value-mapping.js +0 -1
- package/es/date-picker/locale/zh_CN.js +0 -1
- package/es/date-picker/panel/date-time/date-time.js +4 -6
- package/es/date-picker/panel/header/header.js +14 -14
- package/es/date-picker/panel/month/month.js +5 -6
- package/es/date-picker/panel/quarter/quarter.js +4 -4
- package/es/date-picker/panel/time/time-column.js +4 -6
- package/es/date-picker/panel/time/time.js +10 -35
- package/es/date-picker/panel/week/week.js +5 -8
- package/es/date-picker/panel/year/year.js +4 -6
- package/es/date-picker/popper.js +3 -6
- package/es/date-picker/range/input-range.js +12 -13
- package/es/date-picker/range-picker.js +13 -36
- package/es/date-picker/single/input-date.js +8 -14
- package/es/date-picker/utils/date-fns.js +0 -35
- package/es/date-picker/utils/get-extra-footer.js +1 -1
- package/es/date-picker/utils/get-ranges.js +8 -8
- package/es/date-picker/utils/index.js +0 -3
- package/es/divider/divider.js +2 -2
- package/es/drawer/drawer.js +14 -39
- package/es/dropdown/dropdown.js +10 -11
- package/es/dropdown/menu.js +8 -12
- package/es/empty/defaultEmptyImg.js +18 -18
- package/es/empty/empty.js +9 -10
- package/es/empty/illustrationEmptyImg.js +106 -106
- package/es/filter/condition.js +10 -10
- package/es/filter/filter.js +17 -19
- package/es/filter/scheme.js +34 -41
- package/es/form/Field.js +5 -5
- package/es/form/FieldContext.js +1 -1
- package/es/form/FieldLabel.js +2 -2
- package/es/form/FieldWrapper.js +6 -6
- package/es/form/Form.js +2 -5
- package/es/form/FormContext.js +2 -4
- package/es/form/hooks/useForm.js +1 -14
- package/es/form/index.js +1 -1
- package/es/grid/col.js +1 -7
- package/es/grid/row.js +3 -9
- package/es/icon/icon.js +2 -2
- package/es/image/image.js +5 -7
- package/es/image/preview-group.js +3 -4
- package/es/image/preview.js +22 -24
- package/es/image-cropper/cropper.js +3 -6
- package/es/image-cropper/image-cropper.js +5 -5
- package/es/image-cropper/operation-bar.js +9 -9
- package/es/index.js +4 -0
- package/es/input/ClearableLabeledInput.js +13 -13
- package/es/input/TextArea.js +7 -7
- package/es/input/calculateNodeHeight.js +6 -11
- package/es/input/index.js +0 -1
- package/es/input/input.js +5 -5
- package/es/input-number/inputNumber.js +3 -10
- package/es/layout/layout.js +5 -9
- package/es/layout/sider.js +11 -14
- package/es/link/link.js +8 -12
- package/es/locale/locale.js +4 -34
- package/es/menu/menu.js +3 -4
- package/es/menu/menuItem.js +8 -13
- package/es/menu/subMenu.js +19 -27
- package/es/menu/util.js +0 -4
- package/es/message/content.js +13 -13
- package/es/message/index.js +1 -3
- package/es/modal/confirm.js +1 -1
- package/es/modal/modal.js +32 -40
- package/es/notification/content.js +18 -18
- package/es/notification/index.js +1 -1
- package/es/notification-base/index.js +1 -1
- package/es/notification-base/notice.js +2 -2
- package/es/notification-base/notification.js +3 -3
- package/es/pagination/pagination.js +48 -70
- package/es/popconfirm/popconfirm.js +8 -10
- package/es/popper/index.d.ts +2 -0
- package/es/popper/index.js +9 -15
- package/es/progress/circle.js +6 -8
- package/es/progress/line.js +3 -3
- package/es/progress/progress.js +11 -11
- package/es/qr-code/qr-code.js +6 -6
- package/es/radio/context.js +1 -1
- package/es/radio/group.js +9 -13
- package/es/radio/radio-button.js +2 -2
- package/es/radio/radio.js +19 -24
- package/es/rate/rate.js +11 -61
- package/es/search/option.js +4 -5
- package/es/search/quick-search.js +36 -57
- package/es/search/search-panel.js +56 -60
- package/es/search/search.js +9 -10
- package/es/select/interface.js +1 -1
- package/es/select/option.js +4 -4
- package/es/select/select.js +47 -87
- package/es/signature/drawingBoard.js +16 -16
- package/es/signature/signature.js +20 -20
- package/es/signature/utils/signature_pad.js +4 -12
- package/es/slider/marks.js +3 -5
- package/es/slider/slider.js +11 -32
- package/es/slider/sliderTooltip.js +3 -3
- package/es/slider/steps.js +2 -2
- package/es/slider/track.js +1 -1
- package/es/space/space.js +3 -5
- package/es/spin/spin.js +16 -18
- package/es/split-panel/split-panel.js +7 -18
- package/es/split-panel/trigger.js +6 -6
- package/es/stepper/stepper.js +11 -12
- package/es/steps/Step.js +8 -8
- package/es/steps/Steps.js +5 -5
- package/es/switch/switch.js +4 -6
- package/es/table/api.js +5 -22
- package/es/table/table.js +4 -15
- package/es/tabs/active-line.js +2 -6
- package/es/tabs/arrow-button.js +3 -3
- package/es/tabs/context.js +1 -1
- package/es/tabs/index.js +0 -1
- package/es/tabs/tab-pane.js +6 -6
- package/es/tabs/tabs.js +31 -34
- package/es/tag/tag.js +7 -15
- package/es/timeline/Timeline.js +5 -5
- package/es/timeline/TimelineItem.js +5 -5
- package/es/tooltip/tooltip.js +2 -2
- package/es/transfer/list-body.js +4 -4
- package/es/transfer/list-item.js +5 -6
- package/es/transfer/list.js +18 -22
- package/es/transfer/operation.js +7 -7
- package/es/transfer/search.js +5 -5
- package/es/transfer/transfer.js +8 -13
- package/es/tree/tree.js +9 -9
- package/es/tree/treeNode.js +18 -20
- package/es/tree/utils/treeUtils.js +1 -27
- package/es/tree-select/interface.js +1 -1
- package/es/tree-select/tree-select.js +35 -48
- package/es/typography/base.js +5 -5
- package/es/typography/index.js +0 -1
- package/es/typography/paragraph.js +1 -1
- package/es/typography/text.js +1 -1
- package/es/typography/title.js +1 -1
- package/es/typography/typography.js +4 -8
- package/es/upload/dragger.js +2 -2
- package/es/upload/request.js +0 -5
- package/es/upload/scan-files.js +0 -1
- package/es/upload/upload.js +34 -34
- package/es/upload/verify-file.js +0 -1
- package/es/view-container/context.js +1 -1
- package/es/view-container/view-container.js +4 -8
- package/es/virtual-list/Filler.js +2 -2
- package/es/virtual-list/utils/algorithmUtil.js +0 -13
- package/es/virtual-list/utils/itemUtil.js +0 -30
- package/es/virtual-list/virtual-list.js +8 -11
- package/lib/_utils/KeyCode.js +1 -333
- package/lib/_utils/arrayUtil.js +0 -8
- package/lib/_utils/formatUtil.js +9 -59
- package/lib/_utils/getStringLength.js +0 -1
- package/lib/_utils/hooks.js +2 -34
- package/lib/_utils/index.js +0 -7
- package/lib/_utils/numberUtil.js +0 -54
- package/lib/_utils/raf.js +2 -2
- package/lib/_utils/reactNode.js +1 -1
- package/lib/_utils/resizeObserver.js +2 -4
- package/lib/_utils/type.js +0 -1
- package/lib/_utils/usePopper.js +3 -3
- package/lib/alert/alert.js +8 -16
- package/lib/anchor/anchor-link.js +3 -3
- package/lib/anchor/anchor.js +23 -26
- package/lib/anchor/context.js +1 -1
- package/lib/avatar/avatar.js +8 -11
- package/lib/badge/badge.js +7 -13
- package/lib/base-data/base-data.js +34 -103
- package/lib/breadcrumb/breadcrumb.js +12 -12
- package/lib/breadcrumb/breadcrumbItem.js +5 -5
- package/lib/button/button.js +13 -24
- package/lib/button/group.js +13 -13
- package/lib/card/card.js +12 -14
- package/lib/carousel/carousel.js +13 -13
- package/lib/carousel/displayList.js +3 -3
- package/lib/carousel/fadeList.js +3 -3
- package/lib/carousel/slideList.js +4 -4
- package/lib/carousel/slidebar.js +3 -3
- package/lib/cascader/cascader.js +31 -36
- package/lib/checkbox/checkbox.js +25 -30
- package/lib/checkbox/group.js +8 -8
- package/lib/city-picker/city-picker.js +28 -38
- package/lib/city-picker/interface.js +1 -1
- package/lib/city-picker/option.js +4 -4
- package/lib/clipboard/clipboard.js +5 -23
- package/lib/clipboard/util.js +0 -60
- package/lib/collapse/collapse.js +5 -5
- package/lib/collapse/panel.js +15 -15
- package/lib/color-picker/color-picker-panel.js +12 -14
- package/lib/color-picker/color-picker.js +6 -10
- package/lib/color-picker/utils/validateColor.js +0 -3
- package/lib/config-provider/ConfigContext.js +1 -5
- package/lib/config-provider/SizeContext.js +3 -3
- package/lib/config-provider/compDefaultProps.js +3 -10
- package/lib/config-provider/configProvider.js +1 -7
- package/lib/config-provider/defaultConfig.js +0 -1
- package/lib/date-picker/calendar.js +6 -23
- package/lib/date-picker/context.js +1 -1
- package/lib/date-picker/date-panel.js +12 -13
- package/lib/date-picker/date-picker.js +7 -12
- package/lib/date-picker/hooks/use-hover-value.js +0 -1
- package/lib/date-picker/hooks/use-picker-input.js +0 -4
- package/lib/date-picker/hooks/use-range-disabled.js +2 -6
- package/lib/date-picker/hooks/use-range-view-dates.js +1 -9
- package/lib/date-picker/hooks/use-text-value-mapping.js +0 -1
- package/lib/date-picker/locale/zh_CN.js +0 -1
- package/lib/date-picker/panel/date-time/date-time.js +4 -6
- package/lib/date-picker/panel/header/header.js +14 -14
- package/lib/date-picker/panel/month/month.js +5 -6
- package/lib/date-picker/panel/quarter/quarter.js +4 -4
- package/lib/date-picker/panel/time/time-column.js +4 -6
- package/lib/date-picker/panel/time/time.js +10 -35
- package/lib/date-picker/panel/week/week.js +5 -8
- package/lib/date-picker/panel/year/year.js +4 -6
- package/lib/date-picker/popper.js +3 -6
- package/lib/date-picker/range/input-range.js +12 -13
- package/lib/date-picker/range-picker.js +13 -36
- package/lib/date-picker/single/input-date.js +8 -14
- package/lib/date-picker/utils/date-fns.js +0 -34
- package/lib/date-picker/utils/get-extra-footer.js +1 -1
- package/lib/date-picker/utils/get-ranges.js +8 -8
- package/lib/date-picker/utils/index.js +0 -3
- package/lib/divider/divider.js +2 -2
- package/lib/drawer/drawer.js +14 -40
- package/lib/dropdown/dropdown.js +10 -11
- package/lib/dropdown/menu.js +8 -12
- package/lib/empty/defaultEmptyImg.js +18 -18
- package/lib/empty/empty.js +9 -10
- package/lib/empty/illustrationEmptyImg.js +106 -106
- package/lib/filter/condition.js +10 -10
- package/lib/filter/filter.js +17 -19
- package/lib/filter/scheme.js +34 -41
- package/lib/form/Field.js +5 -5
- package/lib/form/FieldContext.js +1 -1
- package/lib/form/FieldLabel.js +2 -2
- package/lib/form/FieldWrapper.js +6 -6
- package/lib/form/Form.js +2 -5
- package/lib/form/FormContext.js +2 -4
- package/lib/form/hooks/useForm.js +1 -14
- package/lib/form/index.js +1 -1
- package/lib/grid/col.js +1 -7
- package/lib/grid/row.js +3 -9
- package/lib/icon/icon.js +2 -2
- package/lib/image/image.js +5 -7
- package/lib/image/preview-group.js +3 -4
- package/lib/image/preview.js +22 -24
- package/lib/image-cropper/cropper.js +3 -6
- package/lib/image-cropper/image-cropper.js +5 -5
- package/lib/image-cropper/operation-bar.js +9 -9
- package/lib/index.js +2 -8
- package/lib/input/ClearableLabeledInput.js +13 -13
- package/lib/input/TextArea.js +7 -7
- package/lib/input/calculateNodeHeight.js +6 -11
- package/lib/input/index.js +0 -1
- package/lib/input/input.js +5 -5
- package/lib/input-number/inputNumber.js +3 -10
- package/lib/layout/layout.js +5 -9
- package/lib/layout/sider.js +11 -14
- package/lib/link/link.js +8 -12
- package/lib/locale/locale.js +4 -34
- package/lib/menu/menu.js +3 -4
- package/lib/menu/menuItem.js +8 -13
- package/lib/menu/subMenu.js +19 -27
- package/lib/menu/util.js +0 -4
- package/lib/message/content.js +13 -13
- package/lib/message/index.js +1 -3
- package/lib/modal/confirm.js +1 -1
- package/lib/modal/modal.js +32 -40
- package/lib/notification/content.js +18 -18
- package/lib/notification/index.js +1 -1
- package/lib/notification-base/index.js +1 -1
- package/lib/notification-base/notice.js +2 -2
- package/lib/notification-base/notification.js +3 -3
- package/lib/pagination/pagination.js +48 -70
- package/lib/popconfirm/popconfirm.js +8 -10
- package/lib/popper/index.d.ts +2 -0
- package/lib/popper/index.js +9 -15
- package/lib/progress/circle.js +6 -8
- package/lib/progress/line.js +3 -3
- package/lib/progress/progress.js +11 -11
- package/lib/qr-code/qr-code.js +6 -6
- package/lib/radio/context.js +1 -1
- package/lib/radio/group.js +9 -13
- package/lib/radio/radio-button.js +2 -2
- package/lib/radio/radio.js +19 -24
- package/lib/rate/rate.js +11 -61
- package/lib/search/option.js +4 -5
- package/lib/search/quick-search.js +36 -57
- package/lib/search/search-panel.js +56 -60
- package/lib/search/search.js +9 -10
- package/lib/select/interface.js +1 -1
- package/lib/select/option.js +4 -4
- package/lib/select/select.js +47 -87
- package/lib/signature/drawingBoard.js +16 -16
- package/lib/signature/signature.js +20 -20
- package/lib/signature/utils/signature_pad.js +4 -12
- package/lib/slider/marks.js +3 -5
- package/lib/slider/slider.js +11 -32
- package/lib/slider/sliderTooltip.js +3 -3
- package/lib/slider/steps.js +2 -2
- package/lib/slider/track.js +1 -1
- package/lib/space/space.js +3 -5
- package/lib/spin/spin.js +16 -18
- package/lib/split-panel/split-panel.js +7 -18
- package/lib/split-panel/trigger.js +6 -6
- package/lib/stepper/stepper.js +11 -12
- package/lib/steps/Step.js +8 -8
- package/lib/steps/Steps.js +5 -5
- package/lib/switch/switch.js +4 -6
- package/lib/table/api.js +5 -22
- package/lib/table/table.js +4 -15
- package/lib/tabs/active-line.js +2 -6
- package/lib/tabs/arrow-button.js +3 -3
- package/lib/tabs/context.js +1 -1
- package/lib/tabs/index.js +0 -1
- package/lib/tabs/tab-pane.js +6 -6
- package/lib/tabs/tabs.js +31 -34
- package/lib/tag/tag.js +7 -15
- package/lib/timeline/Timeline.js +5 -5
- package/lib/timeline/TimelineItem.js +5 -5
- package/lib/tooltip/tooltip.js +2 -2
- package/lib/transfer/list-body.js +4 -4
- package/lib/transfer/list-item.js +5 -6
- package/lib/transfer/list.js +18 -22
- package/lib/transfer/operation.js +7 -7
- package/lib/transfer/search.js +5 -5
- package/lib/transfer/transfer.js +8 -13
- package/lib/tree/tree.js +9 -9
- package/lib/tree/treeNode.js +18 -20
- package/lib/tree/utils/treeUtils.js +1 -27
- package/lib/tree-select/interface.js +1 -1
- package/lib/tree-select/tree-select.js +35 -48
- package/lib/typography/base.js +5 -5
- package/lib/typography/index.js +0 -1
- package/lib/typography/paragraph.js +1 -1
- package/lib/typography/text.js +1 -1
- package/lib/typography/title.js +1 -1
- package/lib/typography/typography.js +4 -8
- package/lib/upload/dragger.js +2 -2
- package/lib/upload/request.js +0 -5
- package/lib/upload/scan-files.js +0 -1
- package/lib/upload/upload.js +34 -34
- package/lib/upload/verify-file.js +0 -1
- package/lib/view-container/context.js +1 -1
- package/lib/view-container/view-container.js +4 -8
- package/lib/virtual-list/Filler.js +2 -2
- package/lib/virtual-list/utils/algorithmUtil.js +0 -13
- package/lib/virtual-list/utils/itemUtil.js +0 -30
- package/lib/virtual-list/virtual-list.js +8 -12
- package/package.json +1 -3
|
@@ -51,9 +51,7 @@ function usePickerInput(_ref) {
|
|
|
51
51
|
{
|
|
52
52
|
if (typing && open && !e.shiftKey) {
|
|
53
53
|
setTyping(false);
|
|
54
|
-
// e.preventDefault()
|
|
55
54
|
}
|
|
56
|
-
|
|
57
55
|
return;
|
|
58
56
|
}
|
|
59
57
|
case _KeyCode.default.ESC:
|
|
@@ -76,7 +74,6 @@ function usePickerInput(_ref) {
|
|
|
76
74
|
},
|
|
77
75
|
onBlur: function onBlur(e) {
|
|
78
76
|
if (preventBlurRef.current || !isClickOutside(document.activeElement)) {
|
|
79
|
-
// preventBlurRef.current = false
|
|
80
77
|
return;
|
|
81
78
|
}
|
|
82
79
|
if (blurToCancel) {
|
|
@@ -94,7 +91,6 @@ function usePickerInput(_ref) {
|
|
|
94
91
|
}
|
|
95
92
|
}
|
|
96
93
|
};
|
|
97
|
-
// check if value changed
|
|
98
94
|
(0, _react.useEffect)(function () {
|
|
99
95
|
valueChangedRef.current = false;
|
|
100
96
|
}, [open]);
|
|
@@ -55,9 +55,7 @@ function useRangeDisabled(_ref, disabledStart, disabledEnd) {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
return false;
|
|
58
|
-
},
|
|
59
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
60
|
-
[disabledDate, disabled[1], endDate, disabledStart]);
|
|
58
|
+
}, [disabledDate, disabled[1], endDate, disabledStart]);
|
|
61
59
|
var disabledEndDate = React.useCallback(function (date) {
|
|
62
60
|
var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
63
61
|
if (disabledDate && disabledDate(date, info)) {
|
|
@@ -79,8 +77,6 @@ function useRangeDisabled(_ref, disabledStart, disabledEnd) {
|
|
|
79
77
|
}
|
|
80
78
|
}
|
|
81
79
|
return false;
|
|
82
|
-
},
|
|
83
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
84
|
-
[disabledDate, disabled[0], startDate, disabledEnd]);
|
|
80
|
+
}, [disabledDate, disabled[0], startDate, disabledEnd]);
|
|
85
81
|
return [disabledStartDate, disabledEndDate];
|
|
86
82
|
}
|
|
@@ -15,7 +15,6 @@ var _utils = require("../utils");
|
|
|
15
15
|
var _dateFns = require("../utils/date-fns");
|
|
16
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
17
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
|
-
// import { getClosingViewDate, isSameYear, isSameMonth, isSameDecade } from '../utils/dateUtil'
|
|
19
18
|
function getStartEndDistance(startDate, endDate, picker) {
|
|
20
19
|
var startNext = (0, _utils.getClosingViewDate)(startDate, picker, 1);
|
|
21
20
|
function getDistance(compareFunc) {
|
|
@@ -28,8 +27,6 @@ function getStartEndDistance(startDate, endDate, picker) {
|
|
|
28
27
|
return 'far';
|
|
29
28
|
}
|
|
30
29
|
switch (picker) {
|
|
31
|
-
// case 'year':
|
|
32
|
-
// return getDistance((start, end) => isSameDecade(start, end))
|
|
33
30
|
case 'quarter':
|
|
34
31
|
case 'month':
|
|
35
32
|
return getDistance(function (start, end) {
|
|
@@ -91,18 +88,13 @@ function useRangeViewDates(_ref) {
|
|
|
91
88
|
function setViewDate(viewDate, index) {
|
|
92
89
|
if (viewDate) {
|
|
93
90
|
var newViewDates = (0, _utils.updateValues)(viewDates, viewDate, index);
|
|
94
|
-
|
|
95
|
-
setDefaultViewDates(
|
|
96
|
-
// Should always be an array
|
|
97
|
-
(0, _utils.updateValues)(defaultViewDates, null, index) || [null, null]);
|
|
98
|
-
// Reset another one when not have value
|
|
91
|
+
setDefaultViewDates((0, _utils.updateValues)(defaultViewDates, null, index) || [null, null]);
|
|
99
92
|
var anotherIndex = (index + 1) % 2;
|
|
100
93
|
if (!(0, _utils.getValue)(values, anotherIndex)) {
|
|
101
94
|
newViewDates = (0, _utils.updateValues)(newViewDates, viewDate, anotherIndex);
|
|
102
95
|
}
|
|
103
96
|
setInternalViewDates(newViewDates);
|
|
104
97
|
} else if (startDate || endDate) {
|
|
105
|
-
// Reset all when has values when `viewDate` is `null` which means from open trigger
|
|
106
98
|
setInternalViewDates(null);
|
|
107
99
|
}
|
|
108
100
|
}
|
|
@@ -34,13 +34,11 @@ function DatetimePanel(props) {
|
|
|
34
34
|
}
|
|
35
35
|
var timeProps = (0, _typeof2.default)(showTime) === 'object' ? (0, _extends2.default)({}, showTime) : {};
|
|
36
36
|
var disabledTimes = disabledTimePanel ? disabledTimePanel(value || null) : {};
|
|
37
|
-
return
|
|
38
|
-
className: (0, _classnames.default)("".concat(prefixCls, "-datetime-panel"), {
|
|
39
|
-
|
|
40
|
-
})
|
|
41
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
37
|
+
return React.createElement("div", {
|
|
38
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-datetime-panel"), {})
|
|
39
|
+
}, React.createElement("div", {
|
|
42
40
|
className: (0, _classnames.default)("".concat(prefixCls, "-date"))
|
|
43
|
-
}, dateHeader,
|
|
41
|
+
}, dateHeader, React.createElement(_calendar.default, (0, _extends2.default)({}, props))), React.createElement(_time.default, (0, _extends2.default)({}, props, {
|
|
44
42
|
format: undefined
|
|
45
43
|
}, timeProps, disabledTimes, {
|
|
46
44
|
defaultValue: undefined
|
|
@@ -29,37 +29,37 @@ function Header(props) {
|
|
|
29
29
|
onSuperNext = props.onSuperNext;
|
|
30
30
|
var iconCls = (0, _classnames.default)("".concat(prefixCls, "-header-icon"));
|
|
31
31
|
var textCls = (0, _classnames.default)("".concat(prefixCls, "-header-text"));
|
|
32
|
-
return
|
|
32
|
+
return _react.default.createElement("div", {
|
|
33
33
|
className: className
|
|
34
|
-
}, onSuperPrev ?
|
|
34
|
+
}, onSuperPrev ? _react.default.createElement("span", {
|
|
35
35
|
className: iconCls,
|
|
36
36
|
onClick: onSuperPrev
|
|
37
|
-
}, superPrevIcon ||
|
|
37
|
+
}, superPrevIcon || _react.default.createElement(_icon.default, {
|
|
38
38
|
type: "double-arrow-left"
|
|
39
|
-
})) :
|
|
39
|
+
})) : _react.default.createElement("span", {
|
|
40
40
|
className: iconCls
|
|
41
|
-
}), onPrev ?
|
|
41
|
+
}), onPrev ? _react.default.createElement("span", {
|
|
42
42
|
className: iconCls,
|
|
43
43
|
onClick: onPrev
|
|
44
|
-
}, prevIcon ||
|
|
44
|
+
}, prevIcon || _react.default.createElement(_icon.default, {
|
|
45
45
|
type: "arrow-left"
|
|
46
|
-
})) :
|
|
46
|
+
})) : _react.default.createElement("span", {
|
|
47
47
|
className: iconCls
|
|
48
|
-
}),
|
|
48
|
+
}), _react.default.createElement("span", {
|
|
49
49
|
className: textCls
|
|
50
|
-
}, children), onNext ?
|
|
50
|
+
}, children), onNext ? _react.default.createElement("span", {
|
|
51
51
|
className: iconCls,
|
|
52
52
|
onClick: onNext
|
|
53
|
-
}, nextIcon ||
|
|
53
|
+
}, nextIcon || _react.default.createElement(_icon.default, {
|
|
54
54
|
type: "arrow-right"
|
|
55
|
-
})) :
|
|
55
|
+
})) : _react.default.createElement("span", {
|
|
56
56
|
className: iconCls
|
|
57
|
-
}), onSuperNext ?
|
|
57
|
+
}), onSuperNext ? _react.default.createElement("span", {
|
|
58
58
|
className: iconCls,
|
|
59
59
|
onClick: onSuperNext
|
|
60
|
-
}, superNextIcon ||
|
|
60
|
+
}, superNextIcon || _react.default.createElement(_icon.default, {
|
|
61
61
|
type: "double-arrow-right"
|
|
62
|
-
})) :
|
|
62
|
+
})) : _react.default.createElement("span", {
|
|
63
63
|
className: iconCls
|
|
64
64
|
}));
|
|
65
65
|
}
|
|
@@ -99,7 +99,6 @@ function Month(props) {
|
|
|
99
99
|
onSelect(date, 'mouse');
|
|
100
100
|
}
|
|
101
101
|
} else {
|
|
102
|
-
//
|
|
103
102
|
var _viewDate = viewDate;
|
|
104
103
|
onSelect((0, _dateFns.setYearOrMonthOfDate)(_viewDate, date, 'month'), 'inner');
|
|
105
104
|
setInnerPicker(undefined);
|
|
@@ -109,7 +108,7 @@ function Month(props) {
|
|
|
109
108
|
var monthLayout = monthsThreeColumns;
|
|
110
109
|
var monthLineCls = (0, _classnames3.default)("".concat(prefixCls, "-month-line"));
|
|
111
110
|
return (0, _map.default)(monthLayout).call(monthLayout, function (month, i) {
|
|
112
|
-
return
|
|
111
|
+
return _react.default.createElement("div", {
|
|
113
112
|
className: monthLineCls,
|
|
114
113
|
key: i
|
|
115
114
|
}, (0, _map.default)(month).call(month, function (m, j) {
|
|
@@ -130,10 +129,10 @@ function Month(props) {
|
|
|
130
129
|
}
|
|
131
130
|
};
|
|
132
131
|
var monthItemCls = (0, _classnames3.default)("".concat(prefixCls, "-month-item"), (0, _defineProperty2.default)({}, "".concat(prefixCls, "-month-item-disabled"), disabledDate && disabledDate(month, disabledInfo)), getRangeCls(month));
|
|
133
|
-
var originNode =
|
|
132
|
+
var originNode = _react.default.createElement("span", {
|
|
134
133
|
className: getMonthClassNames(m)
|
|
135
134
|
}, "".concat(locale.monthTitle[m]));
|
|
136
|
-
return
|
|
135
|
+
return _react.default.createElement("div", (0, _extends2.default)({
|
|
137
136
|
className: monthItemCls,
|
|
138
137
|
key: j
|
|
139
138
|
}, _props), typeof cellRender === 'function' ? cellRender(m + 1, {
|
|
@@ -147,9 +146,9 @@ function Month(props) {
|
|
|
147
146
|
};
|
|
148
147
|
var monthCls = (0, _classnames3.default)("".concat(prefixCls, "-month"));
|
|
149
148
|
var monthWarpperCls = (0, _classnames3.default)("".concat(prefixCls, "-month-warpper"));
|
|
150
|
-
return
|
|
149
|
+
return _react.default.createElement("div", {
|
|
151
150
|
className: monthCls
|
|
152
|
-
},
|
|
151
|
+
}, _react.default.createElement("div", {
|
|
153
152
|
className: monthWarpperCls
|
|
154
153
|
}, renderMonth()));
|
|
155
154
|
}
|
|
@@ -114,10 +114,10 @@ function Quarter(props) {
|
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
116
|
var quarterCls = (0, _classnames3.default)("".concat(prefixCls, "-quarter-item"), (0, _defineProperty2.default)({}, "".concat(prefixCls, "-quarter-item-disabled"), disabledDate && disabledDate(quarter, disabledInfo)), getRangeCls(quarter));
|
|
117
|
-
var originNode =
|
|
117
|
+
var originNode = _react.default.createElement("div", (0, _extends2.default)({
|
|
118
118
|
className: getQuarterClassNames(i + 1)
|
|
119
119
|
}, _props), n);
|
|
120
|
-
return
|
|
120
|
+
return _react.default.createElement("div", {
|
|
121
121
|
key: n,
|
|
122
122
|
className: quarterCls
|
|
123
123
|
}, typeof cellRender === 'function' ? cellRender(i + 1, {
|
|
@@ -130,9 +130,9 @@ function Quarter(props) {
|
|
|
130
130
|
};
|
|
131
131
|
var quarterCls = (0, _classnames3.default)("".concat(prefixCls, "-quarter"));
|
|
132
132
|
var quarterWarpperCls = (0, _classnames3.default)("".concat(prefixCls, "-quarter-warpper"));
|
|
133
|
-
return
|
|
133
|
+
return _react.default.createElement("div", {
|
|
134
134
|
className: quarterCls
|
|
135
|
-
},
|
|
135
|
+
}, _react.default.createElement("div", {
|
|
136
136
|
className: quarterWarpperCls
|
|
137
137
|
}, renderQuarter()));
|
|
138
138
|
}
|
|
@@ -53,10 +53,8 @@ function TimeUnitColumn(props) {
|
|
|
53
53
|
(_a = scrollRef.current) === null || _a === void 0 ? void 0 : _a.call(scrollRef);
|
|
54
54
|
};
|
|
55
55
|
}, [open]);
|
|
56
|
-
return
|
|
57
|
-
className: (0, _classnames.default)("".concat(prefixCls, "-column"), {
|
|
58
|
-
// [`${prefixCls}-column-active`]: active,
|
|
59
|
-
}),
|
|
56
|
+
return React.createElement("ul", {
|
|
57
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-column"), {}),
|
|
60
58
|
ref: ulRef,
|
|
61
59
|
style: {
|
|
62
60
|
position: 'relative'
|
|
@@ -66,10 +64,10 @@ function TimeUnitColumn(props) {
|
|
|
66
64
|
if (hideDisabledOptions && unit.disabled) {
|
|
67
65
|
return null;
|
|
68
66
|
}
|
|
69
|
-
var originNode =
|
|
67
|
+
var originNode = React.createElement("div", {
|
|
70
68
|
className: "".concat(cellPrefixCls, "-inner")
|
|
71
69
|
}, unit.label);
|
|
72
|
-
return
|
|
70
|
+
return React.createElement("div", {
|
|
73
71
|
key: unit.value,
|
|
74
72
|
ref: function ref(element) {
|
|
75
73
|
liRefs.current.set(unit.value, element);
|
|
@@ -23,10 +23,6 @@ var _utils = require("../../utils");
|
|
|
23
23
|
var _header = _interopRequireDefault(require("../header/header"));
|
|
24
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
25
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
26
|
-
// export interface TimePanelProps extends SharedTimeProps {
|
|
27
|
-
// format?: string
|
|
28
|
-
// // active?: boolean
|
|
29
|
-
// }
|
|
30
26
|
function shouldUnitsUpdate(prevUnits, nextUnits) {
|
|
31
27
|
if (prevUnits.length !== nextUnits.length) return true;
|
|
32
28
|
for (var i = 0; i < prevUnits.length; i += 1) {
|
|
@@ -63,29 +59,16 @@ function TimePanel(props) {
|
|
|
63
59
|
_props$use12Hours = props.use12Hours,
|
|
64
60
|
use12Hours = _props$use12Hours === void 0 ? false : _props$use12Hours,
|
|
65
61
|
hideDisabledOptions = props.hideDisabledOptions;
|
|
66
|
-
// console.log(rawHours)
|
|
67
62
|
if (disabledTimePanel) {
|
|
68
63
|
originHour = -1;
|
|
69
64
|
minute = -1;
|
|
70
65
|
second = -1;
|
|
71
66
|
}
|
|
72
|
-
// const bodyOperationRef = React.useRef<BodyOperationRef>()
|
|
73
|
-
// ======================= Keyboard =======================
|
|
74
|
-
// const [activeColumnIndex, setActiveColumnIndex] = React.useState(-1)
|
|
75
|
-
// debugger
|
|
76
67
|
var value = dateValue;
|
|
77
|
-
// if (mergedActivePickerIndex === 0) {
|
|
78
|
-
// value = rangeValue![0]
|
|
79
|
-
// } else if (mergedActivePickerIndex === 1) {
|
|
80
|
-
// value = rangeValue![1]
|
|
81
|
-
// }
|
|
82
68
|
var columns = [];
|
|
83
69
|
var columnPrefixCls = "".concat(prefixCls, "-time");
|
|
84
70
|
var isPM;
|
|
85
|
-
// const originHour = value ? getHours(value) : -1
|
|
86
71
|
var hour = originHour;
|
|
87
|
-
// const minute = value ? getMinutes(value) : -1
|
|
88
|
-
// const second = value ? getSeconds(value) : -1
|
|
89
72
|
var getDefaultDate = function getDefaultDate() {
|
|
90
73
|
if (panelPosition) {
|
|
91
74
|
if (rangeValue && rangeValue[0] && (0, _dateFns.isValid)(rangeValue[0])) {
|
|
@@ -120,7 +103,6 @@ function TimePanel(props) {
|
|
|
120
103
|
if (!_second && _second !== 0) {
|
|
121
104
|
_second = -1;
|
|
122
105
|
}
|
|
123
|
-
// 所有时或分或秒 disabled 时,返回空(date-time)
|
|
124
106
|
if (_hour > -1 && _minute > -1 && _second > -1) {
|
|
125
107
|
date = (0, _dateFns.setTime)(date, {
|
|
126
108
|
hour: !use12Hours || !isPM ? _hour : _hour + 12,
|
|
@@ -131,7 +113,6 @@ function TimePanel(props) {
|
|
|
131
113
|
}
|
|
132
114
|
return null;
|
|
133
115
|
};
|
|
134
|
-
// const rawHours = generateUnits(0, 23, hourStep, disabledHours && disabledHours())
|
|
135
116
|
var memorizedRawHours = (0, _useStateMemo.default)(function () {
|
|
136
117
|
return rawHours;
|
|
137
118
|
}, rawHours, shouldUnitsUpdate);
|
|
@@ -175,12 +156,10 @@ function TimePanel(props) {
|
|
|
175
156
|
});
|
|
176
157
|
});
|
|
177
158
|
}, [use12Hours, memorizedRawHours, isPM]);
|
|
178
|
-
// const minutes = generateUnits(0, 59, minuteStep, disabledMinutes && disabledMinutes(originHour))
|
|
179
|
-
// const seconds = generateUnits(0, 59, secondStep, disabledSeconds && disabledSeconds(originHour, minute))
|
|
180
159
|
function addColumnNode(condition, node, columnValue, units, onColumnSelect) {
|
|
181
160
|
if (condition !== false) {
|
|
182
161
|
columns.push({
|
|
183
|
-
node:
|
|
162
|
+
node: React.cloneElement(node, {
|
|
184
163
|
prefixCls: columnPrefixCls,
|
|
185
164
|
value: columnValue,
|
|
186
165
|
onSelect: onColumnSelect,
|
|
@@ -191,7 +170,7 @@ function TimePanel(props) {
|
|
|
191
170
|
});
|
|
192
171
|
}
|
|
193
172
|
}
|
|
194
|
-
addColumnNode(showHour,
|
|
173
|
+
addColumnNode(showHour, React.createElement(_timeColumn.default, {
|
|
195
174
|
key: "hour",
|
|
196
175
|
subType: 'hour'
|
|
197
176
|
}), hour, hours, function (num) {
|
|
@@ -200,7 +179,7 @@ function TimePanel(props) {
|
|
|
200
179
|
onSelect(time, 'mouse');
|
|
201
180
|
}
|
|
202
181
|
});
|
|
203
|
-
addColumnNode(showMinute,
|
|
182
|
+
addColumnNode(showMinute, React.createElement(_timeColumn.default, {
|
|
204
183
|
key: "minute",
|
|
205
184
|
subType: 'minute'
|
|
206
185
|
}), minute, minutes, function (num) {
|
|
@@ -209,7 +188,7 @@ function TimePanel(props) {
|
|
|
209
188
|
onSelect(time, 'mouse');
|
|
210
189
|
}
|
|
211
190
|
});
|
|
212
|
-
addColumnNode(showSecond,
|
|
191
|
+
addColumnNode(showSecond, React.createElement(_timeColumn.default, {
|
|
213
192
|
key: "second",
|
|
214
193
|
subType: 'second'
|
|
215
194
|
}), second, seconds, function (num) {
|
|
@@ -222,7 +201,7 @@ function TimePanel(props) {
|
|
|
222
201
|
if (typeof isPM === 'boolean') {
|
|
223
202
|
PMIndex = isPM ? 1 : 0;
|
|
224
203
|
}
|
|
225
|
-
addColumnNode(use12Hours === true,
|
|
204
|
+
addColumnNode(use12Hours === true, React.createElement(_timeColumn.default, {
|
|
226
205
|
key: "12hours",
|
|
227
206
|
subType: '12Hours'
|
|
228
207
|
}), PMIndex, [{
|
|
@@ -239,16 +218,12 @@ function TimePanel(props) {
|
|
|
239
218
|
onSelect(time, 'mouse');
|
|
240
219
|
}
|
|
241
220
|
});
|
|
242
|
-
return
|
|
243
|
-
className: (0, _classnames.default)("".concat(prefixCls, "-time"), {
|
|
244
|
-
|
|
245
|
-
})
|
|
246
|
-
}, picker !== 'time' ? /*#__PURE__*/React.createElement(_header.default, {
|
|
221
|
+
return React.createElement("div", {
|
|
222
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-time"), {})
|
|
223
|
+
}, picker !== 'time' ? React.createElement(_header.default, {
|
|
247
224
|
className: "".concat(prefixCls, "-time-header")
|
|
248
|
-
}, !disabledTimePanel && value ? (0, _dateFns.formatDate)(value, format) : null) : null,
|
|
249
|
-
className: (0, _classnames.default)("".concat(prefixCls, "-content"), {
|
|
250
|
-
// [`${panelPrefixCls}-active`]: active,
|
|
251
|
-
})
|
|
225
|
+
}, !disabledTimePanel && value ? (0, _dateFns.formatDate)(value, format) : null) : null, React.createElement("div", {
|
|
226
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-content"), {})
|
|
252
227
|
}, (0, _map.default)(columns).call(columns, function (_ref2) {
|
|
253
228
|
var node = _ref2.node;
|
|
254
229
|
return node;
|
|
@@ -79,7 +79,6 @@ function Week(props) {
|
|
|
79
79
|
var getToday = function getToday(date) {
|
|
80
80
|
if (hasFindToday) return false;
|
|
81
81
|
hasFindToday = (0, _dateFns2.isSameDay)(date, (0, _dateFns.newDate)());
|
|
82
|
-
// 如果 today 被选中则返回 false
|
|
83
82
|
if (hasFindToday) {
|
|
84
83
|
if (Array.isArray(_dateValue)) {
|
|
85
84
|
return !(_dateValue[0] && (0, _dateFns2.isSameDay)(_dateValue[0], date) || _dateValue[1] && (0, _dateFns2.isSameDay)(_dateValue[1], date));
|
|
@@ -96,7 +95,6 @@ function Week(props) {
|
|
|
96
95
|
var getWeekSelected = function getWeekSelected(date) {
|
|
97
96
|
if (hasFindSelected) return false;
|
|
98
97
|
if (Array.isArray(_dateValue)) {
|
|
99
|
-
// 如果是 endSelected 需要判断选中的周最后一天是否为本月
|
|
100
98
|
return _dateValue[0] && (0, _dateFns2.isSameWeek)(_dateValue[0], date) || _dateValue[1] && (0, _dateFns2.isSameWeek)(_dateValue[1], date) && (0, _dateFns.isSameMonth)((0, _dateFns.getEndOfWeek)(_dateValue[1]), viewDate);
|
|
101
99
|
} else {
|
|
102
100
|
if (_dateValue && (0, _dateFns2.isSameWeek)(_dateValue, date)) {
|
|
@@ -140,7 +138,6 @@ function Week(props) {
|
|
|
140
138
|
});
|
|
141
139
|
var getEffectTime = function getEffectTime(date) {
|
|
142
140
|
if (showTime && !disabledTimePanel) {
|
|
143
|
-
// debugger
|
|
144
141
|
var dateHour = (0, _dateFns2.getHours)(date);
|
|
145
142
|
var dateMinute = (0, _dateFns2.getMinutes)(date);
|
|
146
143
|
var dateSecond = (0, _dateFns2.getSeconds)(date);
|
|
@@ -173,7 +170,7 @@ function Week(props) {
|
|
|
173
170
|
var weekNumber = formatWeekNumber(startOfWeek);
|
|
174
171
|
if (showWeekNumber) {
|
|
175
172
|
var calenderWeekNumberCls = (0, _classnames5.default)("".concat(prefixCls, "-calendar-weeknumber"));
|
|
176
|
-
days.push(
|
|
173
|
+
days.push(_react.default.createElement("div", {
|
|
177
174
|
key: "W",
|
|
178
175
|
className: calenderWeekNumberCls
|
|
179
176
|
}, weekNumber));
|
|
@@ -212,10 +209,10 @@ function Week(props) {
|
|
|
212
209
|
}
|
|
213
210
|
}
|
|
214
211
|
};
|
|
215
|
-
var originNode =
|
|
212
|
+
var originNode = _react.default.createElement("div", {
|
|
216
213
|
className: getDayClassNames(day)
|
|
217
214
|
}, date);
|
|
218
|
-
return
|
|
215
|
+
return _react.default.createElement("div", (0, _extends2.default)({
|
|
219
216
|
key: day.valueOf(),
|
|
220
217
|
className: (0, _classnames5.default)("".concat(prefixCls, "-calendar-item"), (_classnames3 = {}, (0, _defineProperty2.default)(_classnames3, "".concat(prefixCls, "-calendar-item-disabled"), disabledDate && disabledDate(day)), (0, _defineProperty2.default)(_classnames3, "".concat(prefixCls, "-calendar-current"), currentMonth === (0, _dateFns.getMonth)(day)), _classnames3), getRangeCls(day))
|
|
221
218
|
}, _props), typeof cellRender === 'function' ? cellRender(day, {
|
|
@@ -225,7 +222,7 @@ function Week(props) {
|
|
|
225
222
|
date: day
|
|
226
223
|
}) || originNode : originNode);
|
|
227
224
|
}));
|
|
228
|
-
var originNode =
|
|
225
|
+
var originNode = _react.default.createElement("div", {
|
|
229
226
|
className: (0, _classnames5.default)((_classnames4 = {}, (0, _defineProperty2.default)(_classnames4, "".concat(prefixCls, "-calendar-line"), picker !== 'week'), (0, _defineProperty2.default)(_classnames4, "".concat(prefixCls, "-calendar-week-line"), picker === 'week'), (0, _defineProperty2.default)(_classnames4, "".concat(prefixCls, "-calendar-week-selected"), picker === 'week' && getWeekSelected(startOfWeek)), _classnames4))
|
|
230
227
|
}, week);
|
|
231
228
|
return typeof cellRender === 'function' ? cellRender(weekNumber, {
|
|
@@ -235,7 +232,7 @@ function Week(props) {
|
|
|
235
232
|
date: startOfWeek
|
|
236
233
|
}) || originNode : originNode;
|
|
237
234
|
};
|
|
238
|
-
return
|
|
235
|
+
return _react.default.createElement(_react.default.Fragment, null, renderDays());
|
|
239
236
|
}
|
|
240
237
|
var _default = Week;
|
|
241
238
|
exports.default = _default;
|
|
@@ -100,12 +100,10 @@ function Year(props) {
|
|
|
100
100
|
onSelect(date, 'mouse');
|
|
101
101
|
}
|
|
102
102
|
} else {
|
|
103
|
-
//
|
|
104
103
|
var _viewDate = viewDate;
|
|
105
104
|
if (panelPosition) {
|
|
106
105
|
_viewDate = (0, _utils.getClosingViewDate)(viewDate, picker, -1);
|
|
107
106
|
}
|
|
108
|
-
// date = addYears(_viewDate, 1)
|
|
109
107
|
onSelect((0, _dateFns.setYearOrMonthOfDate)(_viewDate, date), 'inner');
|
|
110
108
|
setInnerPicker(undefined);
|
|
111
109
|
}
|
|
@@ -132,10 +130,10 @@ function Year(props) {
|
|
|
132
130
|
}
|
|
133
131
|
}
|
|
134
132
|
};
|
|
135
|
-
var originNode =
|
|
133
|
+
var originNode = _react.default.createElement("span", {
|
|
136
134
|
className: getYearClassNames(y)
|
|
137
135
|
}, y);
|
|
138
|
-
yearsList.push(
|
|
136
|
+
yearsList.push(_react.default.createElement("div", (0, _extends2.default)({
|
|
139
137
|
className: (0, _classnames3.default)("".concat(prefixCls, "-year-item"), (0, _defineProperty2.default)({}, "".concat(prefixCls, "-year-item-disabled"), disabledDate && disabledDate(year, disabledInfo)), getRangeCls(year)),
|
|
140
138
|
key: y
|
|
141
139
|
}, _props), typeof cellRender === 'function' ? cellRender(y, {
|
|
@@ -152,9 +150,9 @@ function Year(props) {
|
|
|
152
150
|
}
|
|
153
151
|
var yearCls = (0, _classnames3.default)("".concat(prefixCls, "-year"));
|
|
154
152
|
var yearWarpperCls = (0, _classnames3.default)("".concat(prefixCls, "-year-warpper"));
|
|
155
|
-
return
|
|
153
|
+
return _react.default.createElement("div", {
|
|
156
154
|
className: yearCls
|
|
157
|
-
},
|
|
155
|
+
}, _react.default.createElement("div", {
|
|
158
156
|
className: yearWarpperCls
|
|
159
157
|
}, getYearList()));
|
|
160
158
|
}
|
|
@@ -30,8 +30,6 @@ function Popper(props, ref) {
|
|
|
30
30
|
isRange = props.isRange,
|
|
31
31
|
isShowTime = props.isShowTime,
|
|
32
32
|
picker = props.picker;
|
|
33
|
-
// ref
|
|
34
|
-
// const panelDivRef = React.useRef<HTMLDivElement>(null)
|
|
35
33
|
var _useState = (0, _react.useState)(null),
|
|
36
34
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
37
35
|
arrowRef = _useState2[0],
|
|
@@ -42,7 +40,6 @@ function Popper(props, ref) {
|
|
|
42
40
|
(0, _hooks.useOnClickOutside)([ref, inputDivRef], function () {
|
|
43
41
|
onClickOutside && onClickOutside();
|
|
44
42
|
});
|
|
45
|
-
// console.log(arrowLeft)
|
|
46
43
|
var _usePopper = (0, _reactPopper.usePopper)(inputDivRef.current, ref.current, {
|
|
47
44
|
placement: 'bottom-start',
|
|
48
45
|
modifiers: [{
|
|
@@ -66,7 +63,7 @@ function Popper(props, ref) {
|
|
|
66
63
|
transform: "translate(".concat(20 + arrowLeft, "px, 0px)")
|
|
67
64
|
};
|
|
68
65
|
var popperStyle = (0, _extends2.default)((0, _extends2.default)({}, styles.popper), popupStyle);
|
|
69
|
-
return
|
|
66
|
+
return _react.default.createElement("div", (0, _extends2.default)({
|
|
70
67
|
ref: ref,
|
|
71
68
|
style: popperStyle
|
|
72
69
|
}, attributes.popper, {
|
|
@@ -74,11 +71,11 @@ function Popper(props, ref) {
|
|
|
74
71
|
onMouseDown: function onMouseDown(e) {
|
|
75
72
|
e.preventDefault();
|
|
76
73
|
}
|
|
77
|
-
}),
|
|
74
|
+
}), _react.default.createElement("div", {
|
|
78
75
|
ref: onSetArrowRef,
|
|
79
76
|
style: (styles.arrow, arrowPositionStyle),
|
|
80
77
|
className: arrowCls
|
|
81
78
|
}), props.children);
|
|
82
79
|
}
|
|
83
|
-
var _default =
|
|
80
|
+
var _default = _react.default.forwardRef(Popper);
|
|
84
81
|
exports.default = _default;
|
|
@@ -111,7 +111,7 @@ function InputDate(props, ref) {
|
|
|
111
111
|
};
|
|
112
112
|
var getSuffixNode = function getSuffixNode() {
|
|
113
113
|
if (isMouseEnter && (startHoverValue || endHoverValue || startText || endText) && allowClear && !mergedDisabled[0] && !mergedDisabled[1]) {
|
|
114
|
-
return
|
|
114
|
+
return _react.default.createElement("span", {
|
|
115
115
|
onMouseUp: function onMouseUp(e) {
|
|
116
116
|
e.stopPropagation();
|
|
117
117
|
},
|
|
@@ -129,13 +129,13 @@ function InputDate(props, ref) {
|
|
|
129
129
|
setHoverRangedValue([null, null]);
|
|
130
130
|
},
|
|
131
131
|
className: "".concat(prefixCls, "-range-clear")
|
|
132
|
-
}, clearIcon ||
|
|
132
|
+
}, clearIcon || _react.default.createElement(_index.Icon, {
|
|
133
133
|
type: "close-solid"
|
|
134
134
|
}));
|
|
135
135
|
}
|
|
136
|
-
return
|
|
136
|
+
return _react.default.createElement("span", {
|
|
137
137
|
className: "".concat(prefixCls, "-suffix")
|
|
138
|
-
}, suffixIcon ||
|
|
138
|
+
}, suffixIcon || _react.default.createElement(_index.Icon, {
|
|
139
139
|
type: picker === 'time' ? 'waiting' : 'date'
|
|
140
140
|
}));
|
|
141
141
|
};
|
|
@@ -198,7 +198,7 @@ function InputDate(props, ref) {
|
|
|
198
198
|
onMouseLeave(e);
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
return
|
|
201
|
+
return _react.default.createElement("div", (0, _extends2.default)({
|
|
202
202
|
ref: ref,
|
|
203
203
|
className: (0, _classnames5.default)(prefixCls, "".concat(prefixCls, "-range"), className, borderClass, (_classnames2 = {}, (0, _defineProperty2.default)(_classnames2, (0, _concat.default)(_context = "".concat(prefixCls, "-")).call(_context, size), size), (0, _defineProperty2.default)(_classnames2, "".concat(prefixCls, "-disabled"), mergedDisabled[0] && mergedDisabled[1]), (0, _defineProperty2.default)(_classnames2, "".concat(prefixCls, "-focused"), mergedActivePickerIndex === 0 ? startFocused : endFocused), (0, _defineProperty2.default)(_classnames2, "".concat(prefixCls, "-error"), status === 'error'), _classnames2)),
|
|
204
204
|
style: style,
|
|
@@ -208,10 +208,10 @@ function InputDate(props, ref) {
|
|
|
208
208
|
onMouseLeave: mouseLeaveHandle,
|
|
209
209
|
onContextMenu: onContextMenu,
|
|
210
210
|
onClick: onInternalonClick
|
|
211
|
-
}, dataOrAriaProps),
|
|
211
|
+
}, dataOrAriaProps), _react.default.createElement("div", {
|
|
212
212
|
className: (0, _classnames5.default)("".concat(prefixCls, "-input"), (_classnames3 = {}, (0, _defineProperty2.default)(_classnames3, "".concat(prefixCls, "-input-active"), mergedActivePickerIndex === 0), (0, _defineProperty2.default)(_classnames3, "".concat(prefixCls, "-input-placeholder"), !!startHoverValue), (0, _defineProperty2.default)(_classnames3, (0, _concat.default)(_context2 = "".concat(prefixCls, "-input-")).call(_context2, size), size), _classnames3)),
|
|
213
213
|
ref: startInputDivRef
|
|
214
|
-
},
|
|
214
|
+
}, _react.default.createElement("input", (0, _extends2.default)({
|
|
215
215
|
id: id,
|
|
216
216
|
ref: startInputRef,
|
|
217
217
|
disabled: mergedDisabled[0],
|
|
@@ -220,18 +220,17 @@ function InputDate(props, ref) {
|
|
|
220
220
|
onChange: function onChange(e) {
|
|
221
221
|
triggerStartTextChange(e.target.value);
|
|
222
222
|
},
|
|
223
|
-
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
224
223
|
autoFocus: autoFocus,
|
|
225
224
|
placeholder: (0, _utils.getValue)(placeholder, 0) || ''
|
|
226
225
|
}, startInputProps, {
|
|
227
226
|
size: (0, _utils.getInputSize)(picker, format)
|
|
228
|
-
}))),
|
|
227
|
+
}))), _react.default.createElement("div", {
|
|
229
228
|
className: "".concat(prefixCls, "-range-separator"),
|
|
230
229
|
ref: separatorRef
|
|
231
|
-
}, separator),
|
|
230
|
+
}, separator), _react.default.createElement("div", {
|
|
232
231
|
className: (0, _classnames5.default)("".concat(prefixCls, "-input"), (_classnames4 = {}, (0, _defineProperty2.default)(_classnames4, "".concat(prefixCls, "-input-active"), mergedActivePickerIndex === 1), (0, _defineProperty2.default)(_classnames4, "".concat(prefixCls, "-input-placeholder"), !!endHoverValue), (0, _defineProperty2.default)(_classnames4, (0, _concat.default)(_context3 = "".concat(prefixCls, "-input-")).call(_context3, size), size), _classnames4)),
|
|
233
232
|
ref: endInputDivRef
|
|
234
|
-
},
|
|
233
|
+
}, _react.default.createElement("input", (0, _extends2.default)({
|
|
235
234
|
ref: endInputRef,
|
|
236
235
|
disabled: mergedDisabled[1],
|
|
237
236
|
readOnly: readOnly || typeof format === 'function' || !endTyping,
|
|
@@ -242,7 +241,7 @@ function InputDate(props, ref) {
|
|
|
242
241
|
placeholder: (0, _utils.getValue)(placeholder, 1) || ''
|
|
243
242
|
}, endInputProps, {
|
|
244
243
|
size: (0, _utils.getInputSize)(picker, format)
|
|
245
|
-
}))),
|
|
244
|
+
}))), _react.default.createElement("div", {
|
|
246
245
|
className: "".concat(prefixCls, "-active-bar"),
|
|
247
246
|
style: (0, _extends2.default)((0, _extends2.default)({}, activeBarPositionStyle), {
|
|
248
247
|
width: activeBarWidth,
|
|
@@ -250,5 +249,5 @@ function InputDate(props, ref) {
|
|
|
250
249
|
})
|
|
251
250
|
}), getSuffixNode());
|
|
252
251
|
}
|
|
253
|
-
var _default =
|
|
252
|
+
var _default = _react.default.forwardRef(InputDate);
|
|
254
253
|
exports.default = _default;
|