@kdcloudjs/kdesign 1.8.11 → 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 +93 -15
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +1 -1
- package/dist/kdesign.min.js +3 -3
- 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 +42 -104
- 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 +4 -1
- package/es/popper/index.js +84 -22
- 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 +42 -104
- 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 +4 -1
- package/lib/popper/index.js +84 -22
- 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
|
@@ -44,9 +44,7 @@ export default function usePickerInput(_ref) {
|
|
|
44
44
|
{
|
|
45
45
|
if (typing && open && !e.shiftKey) {
|
|
46
46
|
setTyping(false);
|
|
47
|
-
// e.preventDefault()
|
|
48
47
|
}
|
|
49
|
-
|
|
50
48
|
return;
|
|
51
49
|
}
|
|
52
50
|
case KeyCode.ESC:
|
|
@@ -69,7 +67,6 @@ export default function usePickerInput(_ref) {
|
|
|
69
67
|
},
|
|
70
68
|
onBlur: function onBlur(e) {
|
|
71
69
|
if (preventBlurRef.current || !isClickOutside(document.activeElement)) {
|
|
72
|
-
// preventBlurRef.current = false
|
|
73
70
|
return;
|
|
74
71
|
}
|
|
75
72
|
if (blurToCancel) {
|
|
@@ -87,7 +84,6 @@ export default function usePickerInput(_ref) {
|
|
|
87
84
|
}
|
|
88
85
|
}
|
|
89
86
|
};
|
|
90
|
-
// check if value changed
|
|
91
87
|
useEffect(function () {
|
|
92
88
|
valueChangedRef.current = false;
|
|
93
89
|
}, [open]);
|
|
@@ -44,9 +44,7 @@ export default function useRangeDisabled(_ref, disabledStart, disabledEnd) {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
return false;
|
|
47
|
-
},
|
|
48
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
49
|
-
[disabledDate, disabled[1], endDate, disabledStart]);
|
|
47
|
+
}, [disabledDate, disabled[1], endDate, disabledStart]);
|
|
50
48
|
var disabledEndDate = React.useCallback(function (date) {
|
|
51
49
|
var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
52
50
|
if (disabledDate && disabledDate(date, info)) {
|
|
@@ -68,8 +66,6 @@ export default function useRangeDisabled(_ref, disabledStart, disabledEnd) {
|
|
|
68
66
|
}
|
|
69
67
|
}
|
|
70
68
|
return false;
|
|
71
|
-
},
|
|
72
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
73
|
-
[disabledDate, disabled[0], startDate, disabledEnd]);
|
|
69
|
+
}, [disabledDate, disabled[0], startDate, disabledEnd]);
|
|
74
70
|
return [disabledStartDate, disabledEndDate];
|
|
75
71
|
}
|
|
@@ -3,7 +3,6 @@ import _valuesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/insta
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { getValue, updateValues, getClosingViewDate } from '../utils';
|
|
5
5
|
import { newDate, isSameYear, isSameMonth, isValid } from '../utils/date-fns';
|
|
6
|
-
// import { getClosingViewDate, isSameYear, isSameMonth, isSameDecade } from '../utils/dateUtil'
|
|
7
6
|
function getStartEndDistance(startDate, endDate, picker) {
|
|
8
7
|
var startNext = getClosingViewDate(startDate, picker, 1);
|
|
9
8
|
function getDistance(compareFunc) {
|
|
@@ -16,8 +15,6 @@ function getStartEndDistance(startDate, endDate, picker) {
|
|
|
16
15
|
return 'far';
|
|
17
16
|
}
|
|
18
17
|
switch (picker) {
|
|
19
|
-
// case 'year':
|
|
20
|
-
// return getDistance((start, end) => isSameDecade(start, end))
|
|
21
18
|
case 'quarter':
|
|
22
19
|
case 'month':
|
|
23
20
|
return getDistance(function (start, end) {
|
|
@@ -79,18 +76,13 @@ export default function useRangeViewDates(_ref) {
|
|
|
79
76
|
function setViewDate(viewDate, index) {
|
|
80
77
|
if (viewDate) {
|
|
81
78
|
var newViewDates = updateValues(viewDates, viewDate, index);
|
|
82
|
-
|
|
83
|
-
setDefaultViewDates(
|
|
84
|
-
// Should always be an array
|
|
85
|
-
updateValues(defaultViewDates, null, index) || [null, null]);
|
|
86
|
-
// Reset another one when not have value
|
|
79
|
+
setDefaultViewDates(updateValues(defaultViewDates, null, index) || [null, null]);
|
|
87
80
|
var anotherIndex = (index + 1) % 2;
|
|
88
81
|
if (!getValue(values, anotherIndex)) {
|
|
89
82
|
newViewDates = updateValues(newViewDates, viewDate, anotherIndex);
|
|
90
83
|
}
|
|
91
84
|
setInternalViewDates(newViewDates);
|
|
92
85
|
} else if (startDate || endDate) {
|
|
93
|
-
// Reset all when has values when `viewDate` is `null` which means from open trigger
|
|
94
86
|
setInternalViewDates(null);
|
|
95
87
|
}
|
|
96
88
|
}
|
|
@@ -22,13 +22,11 @@ function DatetimePanel(props) {
|
|
|
22
22
|
}
|
|
23
23
|
var timeProps = _typeof(showTime) === 'object' ? _extends({}, showTime) : {};
|
|
24
24
|
var disabledTimes = disabledTimePanel ? disabledTimePanel(value || null) : {};
|
|
25
|
-
return
|
|
26
|
-
className: classNames("".concat(prefixCls, "-datetime-panel"), {
|
|
27
|
-
|
|
28
|
-
})
|
|
29
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
return React.createElement("div", {
|
|
26
|
+
className: classNames("".concat(prefixCls, "-datetime-panel"), {})
|
|
27
|
+
}, React.createElement("div", {
|
|
30
28
|
className: classNames("".concat(prefixCls, "-date"))
|
|
31
|
-
}, dateHeader,
|
|
29
|
+
}, dateHeader, React.createElement(Calendar, _extends({}, props))), React.createElement(TimePanel, _extends({}, props, {
|
|
32
30
|
format: undefined
|
|
33
31
|
}, timeProps, disabledTimes, {
|
|
34
32
|
defaultValue: undefined
|
|
@@ -17,37 +17,37 @@ function Header(props) {
|
|
|
17
17
|
onSuperNext = props.onSuperNext;
|
|
18
18
|
var iconCls = classnames("".concat(prefixCls, "-header-icon"));
|
|
19
19
|
var textCls = classnames("".concat(prefixCls, "-header-text"));
|
|
20
|
-
return
|
|
20
|
+
return React.createElement("div", {
|
|
21
21
|
className: className
|
|
22
|
-
}, onSuperPrev ?
|
|
22
|
+
}, onSuperPrev ? React.createElement("span", {
|
|
23
23
|
className: iconCls,
|
|
24
24
|
onClick: onSuperPrev
|
|
25
|
-
}, superPrevIcon ||
|
|
25
|
+
}, superPrevIcon || React.createElement(Icon, {
|
|
26
26
|
type: "double-arrow-left"
|
|
27
|
-
})) :
|
|
27
|
+
})) : React.createElement("span", {
|
|
28
28
|
className: iconCls
|
|
29
|
-
}), onPrev ?
|
|
29
|
+
}), onPrev ? React.createElement("span", {
|
|
30
30
|
className: iconCls,
|
|
31
31
|
onClick: onPrev
|
|
32
|
-
}, prevIcon ||
|
|
32
|
+
}, prevIcon || React.createElement(Icon, {
|
|
33
33
|
type: "arrow-left"
|
|
34
|
-
})) :
|
|
34
|
+
})) : React.createElement("span", {
|
|
35
35
|
className: iconCls
|
|
36
|
-
}),
|
|
36
|
+
}), React.createElement("span", {
|
|
37
37
|
className: textCls
|
|
38
|
-
}, children), onNext ?
|
|
38
|
+
}, children), onNext ? React.createElement("span", {
|
|
39
39
|
className: iconCls,
|
|
40
40
|
onClick: onNext
|
|
41
|
-
}, nextIcon ||
|
|
41
|
+
}, nextIcon || React.createElement(Icon, {
|
|
42
42
|
type: "arrow-right"
|
|
43
|
-
})) :
|
|
43
|
+
})) : React.createElement("span", {
|
|
44
44
|
className: iconCls
|
|
45
|
-
}), onSuperNext ?
|
|
45
|
+
}), onSuperNext ? React.createElement("span", {
|
|
46
46
|
className: iconCls,
|
|
47
47
|
onClick: onSuperNext
|
|
48
|
-
}, superNextIcon ||
|
|
48
|
+
}, superNextIcon || React.createElement(Icon, {
|
|
49
49
|
type: "double-arrow-right"
|
|
50
|
-
})) :
|
|
50
|
+
})) : React.createElement("span", {
|
|
51
51
|
className: iconCls
|
|
52
52
|
}));
|
|
53
53
|
}
|
|
@@ -87,7 +87,6 @@ function Month(props) {
|
|
|
87
87
|
onSelect(date, 'mouse');
|
|
88
88
|
}
|
|
89
89
|
} else {
|
|
90
|
-
//
|
|
91
90
|
var _viewDate = viewDate;
|
|
92
91
|
onSelect(setYearOrMonthOfDate(_viewDate, date, 'month'), 'inner');
|
|
93
92
|
setInnerPicker(undefined);
|
|
@@ -97,7 +96,7 @@ function Month(props) {
|
|
|
97
96
|
var monthLayout = monthsThreeColumns;
|
|
98
97
|
var monthLineCls = classnames("".concat(prefixCls, "-month-line"));
|
|
99
98
|
return _mapInstanceProperty(monthLayout).call(monthLayout, function (month, i) {
|
|
100
|
-
return
|
|
99
|
+
return React.createElement("div", {
|
|
101
100
|
className: monthLineCls,
|
|
102
101
|
key: i
|
|
103
102
|
}, _mapInstanceProperty(month).call(month, function (m, j) {
|
|
@@ -118,10 +117,10 @@ function Month(props) {
|
|
|
118
117
|
}
|
|
119
118
|
};
|
|
120
119
|
var monthItemCls = classnames("".concat(prefixCls, "-month-item"), _defineProperty({}, "".concat(prefixCls, "-month-item-disabled"), disabledDate && disabledDate(month, disabledInfo)), getRangeCls(month));
|
|
121
|
-
var originNode =
|
|
120
|
+
var originNode = React.createElement("span", {
|
|
122
121
|
className: getMonthClassNames(m)
|
|
123
122
|
}, "".concat(locale.monthTitle[m]));
|
|
124
|
-
return
|
|
123
|
+
return React.createElement("div", _extends({
|
|
125
124
|
className: monthItemCls,
|
|
126
125
|
key: j
|
|
127
126
|
}, _props), typeof cellRender === 'function' ? cellRender(m + 1, {
|
|
@@ -135,9 +134,9 @@ function Month(props) {
|
|
|
135
134
|
};
|
|
136
135
|
var monthCls = classnames("".concat(prefixCls, "-month"));
|
|
137
136
|
var monthWarpperCls = classnames("".concat(prefixCls, "-month-warpper"));
|
|
138
|
-
return
|
|
137
|
+
return React.createElement("div", {
|
|
139
138
|
className: monthCls
|
|
140
|
-
},
|
|
139
|
+
}, React.createElement("div", {
|
|
141
140
|
className: monthWarpperCls
|
|
142
141
|
}, renderMonth()));
|
|
143
142
|
}
|
|
@@ -102,10 +102,10 @@ function Quarter(props) {
|
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
104
|
var quarterCls = classnames("".concat(prefixCls, "-quarter-item"), _defineProperty({}, "".concat(prefixCls, "-quarter-item-disabled"), disabledDate && disabledDate(quarter, disabledInfo)), getRangeCls(quarter));
|
|
105
|
-
var originNode =
|
|
105
|
+
var originNode = React.createElement("div", _extends({
|
|
106
106
|
className: getQuarterClassNames(i + 1)
|
|
107
107
|
}, _props), n);
|
|
108
|
-
return
|
|
108
|
+
return React.createElement("div", {
|
|
109
109
|
key: n,
|
|
110
110
|
className: quarterCls
|
|
111
111
|
}, typeof cellRender === 'function' ? cellRender(i + 1, {
|
|
@@ -118,9 +118,9 @@ function Quarter(props) {
|
|
|
118
118
|
};
|
|
119
119
|
var quarterCls = classnames("".concat(prefixCls, "-quarter"));
|
|
120
120
|
var quarterWarpperCls = classnames("".concat(prefixCls, "-quarter-warpper"));
|
|
121
|
-
return
|
|
121
|
+
return React.createElement("div", {
|
|
122
122
|
className: quarterCls
|
|
123
|
-
},
|
|
123
|
+
}, React.createElement("div", {
|
|
124
124
|
className: quarterWarpperCls
|
|
125
125
|
}, renderQuarter()));
|
|
126
126
|
}
|
|
@@ -42,10 +42,8 @@ function TimeUnitColumn(props) {
|
|
|
42
42
|
(_a = scrollRef.current) === null || _a === void 0 ? void 0 : _a.call(scrollRef);
|
|
43
43
|
};
|
|
44
44
|
}, [open]);
|
|
45
|
-
return
|
|
46
|
-
className: classNames("".concat(prefixCls, "-column"), {
|
|
47
|
-
// [`${prefixCls}-column-active`]: active,
|
|
48
|
-
}),
|
|
45
|
+
return React.createElement("ul", {
|
|
46
|
+
className: classNames("".concat(prefixCls, "-column"), {}),
|
|
49
47
|
ref: ulRef,
|
|
50
48
|
style: {
|
|
51
49
|
position: 'relative'
|
|
@@ -55,10 +53,10 @@ function TimeUnitColumn(props) {
|
|
|
55
53
|
if (hideDisabledOptions && unit.disabled) {
|
|
56
54
|
return null;
|
|
57
55
|
}
|
|
58
|
-
var originNode =
|
|
56
|
+
var originNode = React.createElement("div", {
|
|
59
57
|
className: "".concat(cellPrefixCls, "-inner")
|
|
60
58
|
}, unit.label);
|
|
61
|
-
return
|
|
59
|
+
return React.createElement("div", {
|
|
62
60
|
key: unit.value,
|
|
63
61
|
ref: function ref(element) {
|
|
64
62
|
liRefs.current.set(unit.value, element);
|
|
@@ -11,10 +11,6 @@ import Context from '../../context';
|
|
|
11
11
|
import useStateMemo from '../../hooks/use-state-memo';
|
|
12
12
|
import { leftPad } from '../../utils';
|
|
13
13
|
import Header from '../header/header';
|
|
14
|
-
// export interface TimePanelProps extends SharedTimeProps {
|
|
15
|
-
// format?: string
|
|
16
|
-
// // active?: boolean
|
|
17
|
-
// }
|
|
18
14
|
function shouldUnitsUpdate(prevUnits, nextUnits) {
|
|
19
15
|
if (prevUnits.length !== nextUnits.length) return true;
|
|
20
16
|
for (var i = 0; i < prevUnits.length; i += 1) {
|
|
@@ -51,29 +47,16 @@ function TimePanel(props) {
|
|
|
51
47
|
_props$use12Hours = props.use12Hours,
|
|
52
48
|
use12Hours = _props$use12Hours === void 0 ? false : _props$use12Hours,
|
|
53
49
|
hideDisabledOptions = props.hideDisabledOptions;
|
|
54
|
-
// console.log(rawHours)
|
|
55
50
|
if (disabledTimePanel) {
|
|
56
51
|
originHour = -1;
|
|
57
52
|
minute = -1;
|
|
58
53
|
second = -1;
|
|
59
54
|
}
|
|
60
|
-
// const bodyOperationRef = React.useRef<BodyOperationRef>()
|
|
61
|
-
// ======================= Keyboard =======================
|
|
62
|
-
// const [activeColumnIndex, setActiveColumnIndex] = React.useState(-1)
|
|
63
|
-
// debugger
|
|
64
55
|
var value = dateValue;
|
|
65
|
-
// if (mergedActivePickerIndex === 0) {
|
|
66
|
-
// value = rangeValue![0]
|
|
67
|
-
// } else if (mergedActivePickerIndex === 1) {
|
|
68
|
-
// value = rangeValue![1]
|
|
69
|
-
// }
|
|
70
56
|
var columns = [];
|
|
71
57
|
var columnPrefixCls = "".concat(prefixCls, "-time");
|
|
72
58
|
var isPM;
|
|
73
|
-
// const originHour = value ? getHours(value) : -1
|
|
74
59
|
var hour = originHour;
|
|
75
|
-
// const minute = value ? getMinutes(value) : -1
|
|
76
|
-
// const second = value ? getSeconds(value) : -1
|
|
77
60
|
var getDefaultDate = function getDefaultDate() {
|
|
78
61
|
if (panelPosition) {
|
|
79
62
|
if (rangeValue && rangeValue[0] && isValid(rangeValue[0])) {
|
|
@@ -108,7 +91,6 @@ function TimePanel(props) {
|
|
|
108
91
|
if (!_second && _second !== 0) {
|
|
109
92
|
_second = -1;
|
|
110
93
|
}
|
|
111
|
-
// 所有时或分或秒 disabled 时,返回空(date-time)
|
|
112
94
|
if (_hour > -1 && _minute > -1 && _second > -1) {
|
|
113
95
|
date = utilSetTime(date, {
|
|
114
96
|
hour: !use12Hours || !isPM ? _hour : _hour + 12,
|
|
@@ -119,7 +101,6 @@ function TimePanel(props) {
|
|
|
119
101
|
}
|
|
120
102
|
return null;
|
|
121
103
|
};
|
|
122
|
-
// const rawHours = generateUnits(0, 23, hourStep, disabledHours && disabledHours())
|
|
123
104
|
var memorizedRawHours = useStateMemo(function () {
|
|
124
105
|
return rawHours;
|
|
125
106
|
}, rawHours, shouldUnitsUpdate);
|
|
@@ -163,12 +144,10 @@ function TimePanel(props) {
|
|
|
163
144
|
});
|
|
164
145
|
});
|
|
165
146
|
}, [use12Hours, memorizedRawHours, isPM]);
|
|
166
|
-
// const minutes = generateUnits(0, 59, minuteStep, disabledMinutes && disabledMinutes(originHour))
|
|
167
|
-
// const seconds = generateUnits(0, 59, secondStep, disabledSeconds && disabledSeconds(originHour, minute))
|
|
168
147
|
function addColumnNode(condition, node, columnValue, units, onColumnSelect) {
|
|
169
148
|
if (condition !== false) {
|
|
170
149
|
columns.push({
|
|
171
|
-
node:
|
|
150
|
+
node: React.cloneElement(node, {
|
|
172
151
|
prefixCls: columnPrefixCls,
|
|
173
152
|
value: columnValue,
|
|
174
153
|
onSelect: onColumnSelect,
|
|
@@ -179,7 +158,7 @@ function TimePanel(props) {
|
|
|
179
158
|
});
|
|
180
159
|
}
|
|
181
160
|
}
|
|
182
|
-
addColumnNode(showHour,
|
|
161
|
+
addColumnNode(showHour, React.createElement(TimeColumn, {
|
|
183
162
|
key: "hour",
|
|
184
163
|
subType: 'hour'
|
|
185
164
|
}), hour, hours, function (num) {
|
|
@@ -188,7 +167,7 @@ function TimePanel(props) {
|
|
|
188
167
|
onSelect(time, 'mouse');
|
|
189
168
|
}
|
|
190
169
|
});
|
|
191
|
-
addColumnNode(showMinute,
|
|
170
|
+
addColumnNode(showMinute, React.createElement(TimeColumn, {
|
|
192
171
|
key: "minute",
|
|
193
172
|
subType: 'minute'
|
|
194
173
|
}), minute, minutes, function (num) {
|
|
@@ -197,7 +176,7 @@ function TimePanel(props) {
|
|
|
197
176
|
onSelect(time, 'mouse');
|
|
198
177
|
}
|
|
199
178
|
});
|
|
200
|
-
addColumnNode(showSecond,
|
|
179
|
+
addColumnNode(showSecond, React.createElement(TimeColumn, {
|
|
201
180
|
key: "second",
|
|
202
181
|
subType: 'second'
|
|
203
182
|
}), second, seconds, function (num) {
|
|
@@ -210,7 +189,7 @@ function TimePanel(props) {
|
|
|
210
189
|
if (typeof isPM === 'boolean') {
|
|
211
190
|
PMIndex = isPM ? 1 : 0;
|
|
212
191
|
}
|
|
213
|
-
addColumnNode(use12Hours === true,
|
|
192
|
+
addColumnNode(use12Hours === true, React.createElement(TimeColumn, {
|
|
214
193
|
key: "12hours",
|
|
215
194
|
subType: '12Hours'
|
|
216
195
|
}), PMIndex, [{
|
|
@@ -227,16 +206,12 @@ function TimePanel(props) {
|
|
|
227
206
|
onSelect(time, 'mouse');
|
|
228
207
|
}
|
|
229
208
|
});
|
|
230
|
-
return
|
|
231
|
-
className: classNames("".concat(prefixCls, "-time"), {
|
|
232
|
-
|
|
233
|
-
})
|
|
234
|
-
}, picker !== 'time' ? /*#__PURE__*/React.createElement(Header, {
|
|
209
|
+
return React.createElement("div", {
|
|
210
|
+
className: classNames("".concat(prefixCls, "-time"), {})
|
|
211
|
+
}, picker !== 'time' ? React.createElement(Header, {
|
|
235
212
|
className: "".concat(prefixCls, "-time-header")
|
|
236
|
-
}, !disabledTimePanel && value ? formatDate(value, format) : null) : null,
|
|
237
|
-
className: classNames("".concat(prefixCls, "-content"), {
|
|
238
|
-
// [`${panelPrefixCls}-active`]: active,
|
|
239
|
-
})
|
|
213
|
+
}, !disabledTimePanel && value ? formatDate(value, format) : null) : null, React.createElement("div", {
|
|
214
|
+
className: classNames("".concat(prefixCls, "-content"), {})
|
|
240
215
|
}, _mapInstanceProperty(columns).call(columns, function (_ref2) {
|
|
241
216
|
var node = _ref2.node;
|
|
242
217
|
return node;
|
|
@@ -67,7 +67,6 @@ function Week(props) {
|
|
|
67
67
|
var getToday = function getToday(date) {
|
|
68
68
|
if (hasFindToday) return false;
|
|
69
69
|
hasFindToday = isSameDay(date, newDate());
|
|
70
|
-
// 如果 today 被选中则返回 false
|
|
71
70
|
if (hasFindToday) {
|
|
72
71
|
if (Array.isArray(_dateValue)) {
|
|
73
72
|
return !(_dateValue[0] && isSameDay(_dateValue[0], date) || _dateValue[1] && isSameDay(_dateValue[1], date));
|
|
@@ -84,7 +83,6 @@ function Week(props) {
|
|
|
84
83
|
var getWeekSelected = function getWeekSelected(date) {
|
|
85
84
|
if (hasFindSelected) return false;
|
|
86
85
|
if (Array.isArray(_dateValue)) {
|
|
87
|
-
// 如果是 endSelected 需要判断选中的周最后一天是否为本月
|
|
88
86
|
return _dateValue[0] && isSameWeek(_dateValue[0], date) || _dateValue[1] && isSameWeek(_dateValue[1], date) && isSameMonth(getEndOfWeek(_dateValue[1]), viewDate);
|
|
89
87
|
} else {
|
|
90
88
|
if (_dateValue && isSameWeek(_dateValue, date)) {
|
|
@@ -128,7 +126,6 @@ function Week(props) {
|
|
|
128
126
|
});
|
|
129
127
|
var getEffectTime = function getEffectTime(date) {
|
|
130
128
|
if (showTime && !disabledTimePanel) {
|
|
131
|
-
// debugger
|
|
132
129
|
var dateHour = getHours(date);
|
|
133
130
|
var dateMinute = getMinutes(date);
|
|
134
131
|
var dateSecond = getSeconds(date);
|
|
@@ -161,7 +158,7 @@ function Week(props) {
|
|
|
161
158
|
var weekNumber = formatWeekNumber(startOfWeek);
|
|
162
159
|
if (showWeekNumber) {
|
|
163
160
|
var calenderWeekNumberCls = classnames("".concat(prefixCls, "-calendar-weeknumber"));
|
|
164
|
-
days.push(
|
|
161
|
+
days.push(React.createElement("div", {
|
|
165
162
|
key: "W",
|
|
166
163
|
className: calenderWeekNumberCls
|
|
167
164
|
}, weekNumber));
|
|
@@ -200,10 +197,10 @@ function Week(props) {
|
|
|
200
197
|
}
|
|
201
198
|
}
|
|
202
199
|
};
|
|
203
|
-
var originNode =
|
|
200
|
+
var originNode = React.createElement("div", {
|
|
204
201
|
className: getDayClassNames(day)
|
|
205
202
|
}, date);
|
|
206
|
-
return
|
|
203
|
+
return React.createElement("div", _extends({
|
|
207
204
|
key: day.valueOf(),
|
|
208
205
|
className: classnames("".concat(prefixCls, "-calendar-item"), (_classnames3 = {}, _defineProperty(_classnames3, "".concat(prefixCls, "-calendar-item-disabled"), disabledDate && disabledDate(day)), _defineProperty(_classnames3, "".concat(prefixCls, "-calendar-current"), currentMonth === getMonth(day)), _classnames3), getRangeCls(day))
|
|
209
206
|
}, _props), typeof cellRender === 'function' ? cellRender(day, {
|
|
@@ -213,7 +210,7 @@ function Week(props) {
|
|
|
213
210
|
date: day
|
|
214
211
|
}) || originNode : originNode);
|
|
215
212
|
}));
|
|
216
|
-
var originNode =
|
|
213
|
+
var originNode = React.createElement("div", {
|
|
217
214
|
className: classnames((_classnames4 = {}, _defineProperty(_classnames4, "".concat(prefixCls, "-calendar-line"), picker !== 'week'), _defineProperty(_classnames4, "".concat(prefixCls, "-calendar-week-line"), picker === 'week'), _defineProperty(_classnames4, "".concat(prefixCls, "-calendar-week-selected"), picker === 'week' && getWeekSelected(startOfWeek)), _classnames4))
|
|
218
215
|
}, week);
|
|
219
216
|
return typeof cellRender === 'function' ? cellRender(weekNumber, {
|
|
@@ -223,6 +220,6 @@ function Week(props) {
|
|
|
223
220
|
date: startOfWeek
|
|
224
221
|
}) || originNode : originNode;
|
|
225
222
|
};
|
|
226
|
-
return
|
|
223
|
+
return React.createElement(React.Fragment, null, renderDays());
|
|
227
224
|
}
|
|
228
225
|
export default Week;
|
|
@@ -88,12 +88,10 @@ function Year(props) {
|
|
|
88
88
|
onSelect(date, 'mouse');
|
|
89
89
|
}
|
|
90
90
|
} else {
|
|
91
|
-
//
|
|
92
91
|
var _viewDate = viewDate;
|
|
93
92
|
if (panelPosition) {
|
|
94
93
|
_viewDate = getClosingViewDate(viewDate, picker, -1);
|
|
95
94
|
}
|
|
96
|
-
// date = addYears(_viewDate, 1)
|
|
97
95
|
onSelect(setYearOrMonthOfDate(_viewDate, date), 'inner');
|
|
98
96
|
setInnerPicker(undefined);
|
|
99
97
|
}
|
|
@@ -120,10 +118,10 @@ function Year(props) {
|
|
|
120
118
|
}
|
|
121
119
|
}
|
|
122
120
|
};
|
|
123
|
-
var originNode =
|
|
121
|
+
var originNode = React.createElement("span", {
|
|
124
122
|
className: getYearClassNames(y)
|
|
125
123
|
}, y);
|
|
126
|
-
yearsList.push(
|
|
124
|
+
yearsList.push(React.createElement("div", _extends({
|
|
127
125
|
className: classnames("".concat(prefixCls, "-year-item"), _defineProperty({}, "".concat(prefixCls, "-year-item-disabled"), disabledDate && disabledDate(year, disabledInfo)), getRangeCls(year)),
|
|
128
126
|
key: y
|
|
129
127
|
}, _props), typeof cellRender === 'function' ? cellRender(y, {
|
|
@@ -140,9 +138,9 @@ function Year(props) {
|
|
|
140
138
|
}
|
|
141
139
|
var yearCls = classnames("".concat(prefixCls, "-year"));
|
|
142
140
|
var yearWarpperCls = classnames("".concat(prefixCls, "-year-warpper"));
|
|
143
|
-
return
|
|
141
|
+
return React.createElement("div", {
|
|
144
142
|
className: yearCls
|
|
145
|
-
},
|
|
143
|
+
}, React.createElement("div", {
|
|
146
144
|
className: yearWarpperCls
|
|
147
145
|
}, getYearList()));
|
|
148
146
|
}
|
package/es/date-picker/popper.js
CHANGED
|
@@ -18,8 +18,6 @@ function Popper(props, ref) {
|
|
|
18
18
|
isRange = props.isRange,
|
|
19
19
|
isShowTime = props.isShowTime,
|
|
20
20
|
picker = props.picker;
|
|
21
|
-
// ref
|
|
22
|
-
// const panelDivRef = React.useRef<HTMLDivElement>(null)
|
|
23
21
|
var _useState = useState(null),
|
|
24
22
|
_useState2 = _slicedToArray(_useState, 2),
|
|
25
23
|
arrowRef = _useState2[0],
|
|
@@ -30,7 +28,6 @@ function Popper(props, ref) {
|
|
|
30
28
|
useOnClickOutside([ref, inputDivRef], function () {
|
|
31
29
|
onClickOutside && onClickOutside();
|
|
32
30
|
});
|
|
33
|
-
// console.log(arrowLeft)
|
|
34
31
|
var _usePopper = usePopper(inputDivRef.current, ref.current, {
|
|
35
32
|
placement: 'bottom-start',
|
|
36
33
|
modifiers: [{
|
|
@@ -54,7 +51,7 @@ function Popper(props, ref) {
|
|
|
54
51
|
transform: "translate(".concat(20 + arrowLeft, "px, 0px)")
|
|
55
52
|
};
|
|
56
53
|
var popperStyle = _extends(_extends({}, styles.popper), popupStyle);
|
|
57
|
-
return
|
|
54
|
+
return React.createElement("div", _extends({
|
|
58
55
|
ref: ref,
|
|
59
56
|
style: popperStyle
|
|
60
57
|
}, attributes.popper, {
|
|
@@ -62,10 +59,10 @@ function Popper(props, ref) {
|
|
|
62
59
|
onMouseDown: function onMouseDown(e) {
|
|
63
60
|
e.preventDefault();
|
|
64
61
|
}
|
|
65
|
-
}),
|
|
62
|
+
}), React.createElement("div", {
|
|
66
63
|
ref: onSetArrowRef,
|
|
67
64
|
style: (styles.arrow, arrowPositionStyle),
|
|
68
65
|
className: arrowCls
|
|
69
66
|
}), props.children);
|
|
70
67
|
}
|
|
71
|
-
export default
|
|
68
|
+
export default React.forwardRef(Popper);
|
|
@@ -99,7 +99,7 @@ function InputDate(props, ref) {
|
|
|
99
99
|
};
|
|
100
100
|
var getSuffixNode = function getSuffixNode() {
|
|
101
101
|
if (isMouseEnter && (startHoverValue || endHoverValue || startText || endText) && allowClear && !mergedDisabled[0] && !mergedDisabled[1]) {
|
|
102
|
-
return
|
|
102
|
+
return React.createElement("span", {
|
|
103
103
|
onMouseUp: function onMouseUp(e) {
|
|
104
104
|
e.stopPropagation();
|
|
105
105
|
},
|
|
@@ -117,13 +117,13 @@ function InputDate(props, ref) {
|
|
|
117
117
|
setHoverRangedValue([null, null]);
|
|
118
118
|
},
|
|
119
119
|
className: "".concat(prefixCls, "-range-clear")
|
|
120
|
-
}, clearIcon ||
|
|
120
|
+
}, clearIcon || React.createElement(Icon, {
|
|
121
121
|
type: "close-solid"
|
|
122
122
|
}));
|
|
123
123
|
}
|
|
124
|
-
return
|
|
124
|
+
return React.createElement("span", {
|
|
125
125
|
className: "".concat(prefixCls, "-suffix")
|
|
126
|
-
}, suffixIcon ||
|
|
126
|
+
}, suffixIcon || React.createElement(Icon, {
|
|
127
127
|
type: picker === 'time' ? 'waiting' : 'date'
|
|
128
128
|
}));
|
|
129
129
|
};
|
|
@@ -186,7 +186,7 @@ function InputDate(props, ref) {
|
|
|
186
186
|
onMouseLeave(e);
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
|
-
return
|
|
189
|
+
return React.createElement("div", _extends({
|
|
190
190
|
ref: ref,
|
|
191
191
|
className: classnames(prefixCls, "".concat(prefixCls, "-range"), className, borderClass, (_classnames2 = {}, _defineProperty(_classnames2, _concatInstanceProperty(_context = "".concat(prefixCls, "-")).call(_context, size), size), _defineProperty(_classnames2, "".concat(prefixCls, "-disabled"), mergedDisabled[0] && mergedDisabled[1]), _defineProperty(_classnames2, "".concat(prefixCls, "-focused"), mergedActivePickerIndex === 0 ? startFocused : endFocused), _defineProperty(_classnames2, "".concat(prefixCls, "-error"), status === 'error'), _classnames2)),
|
|
192
192
|
style: style,
|
|
@@ -196,10 +196,10 @@ function InputDate(props, ref) {
|
|
|
196
196
|
onMouseLeave: mouseLeaveHandle,
|
|
197
197
|
onContextMenu: onContextMenu,
|
|
198
198
|
onClick: onInternalonClick
|
|
199
|
-
}, dataOrAriaProps),
|
|
199
|
+
}, dataOrAriaProps), React.createElement("div", {
|
|
200
200
|
className: classnames("".concat(prefixCls, "-input"), (_classnames3 = {}, _defineProperty(_classnames3, "".concat(prefixCls, "-input-active"), mergedActivePickerIndex === 0), _defineProperty(_classnames3, "".concat(prefixCls, "-input-placeholder"), !!startHoverValue), _defineProperty(_classnames3, _concatInstanceProperty(_context2 = "".concat(prefixCls, "-input-")).call(_context2, size), size), _classnames3)),
|
|
201
201
|
ref: startInputDivRef
|
|
202
|
-
},
|
|
202
|
+
}, React.createElement("input", _extends({
|
|
203
203
|
id: id,
|
|
204
204
|
ref: startInputRef,
|
|
205
205
|
disabled: mergedDisabled[0],
|
|
@@ -208,18 +208,17 @@ function InputDate(props, ref) {
|
|
|
208
208
|
onChange: function onChange(e) {
|
|
209
209
|
triggerStartTextChange(e.target.value);
|
|
210
210
|
},
|
|
211
|
-
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
212
211
|
autoFocus: autoFocus,
|
|
213
212
|
placeholder: getValue(placeholder, 0) || ''
|
|
214
213
|
}, startInputProps, {
|
|
215
214
|
size: getInputSize(picker, format)
|
|
216
|
-
}))),
|
|
215
|
+
}))), React.createElement("div", {
|
|
217
216
|
className: "".concat(prefixCls, "-range-separator"),
|
|
218
217
|
ref: separatorRef
|
|
219
|
-
}, separator),
|
|
218
|
+
}, separator), React.createElement("div", {
|
|
220
219
|
className: classnames("".concat(prefixCls, "-input"), (_classnames4 = {}, _defineProperty(_classnames4, "".concat(prefixCls, "-input-active"), mergedActivePickerIndex === 1), _defineProperty(_classnames4, "".concat(prefixCls, "-input-placeholder"), !!endHoverValue), _defineProperty(_classnames4, _concatInstanceProperty(_context3 = "".concat(prefixCls, "-input-")).call(_context3, size), size), _classnames4)),
|
|
221
220
|
ref: endInputDivRef
|
|
222
|
-
},
|
|
221
|
+
}, React.createElement("input", _extends({
|
|
223
222
|
ref: endInputRef,
|
|
224
223
|
disabled: mergedDisabled[1],
|
|
225
224
|
readOnly: readOnly || typeof format === 'function' || !endTyping,
|
|
@@ -230,7 +229,7 @@ function InputDate(props, ref) {
|
|
|
230
229
|
placeholder: getValue(placeholder, 1) || ''
|
|
231
230
|
}, endInputProps, {
|
|
232
231
|
size: getInputSize(picker, format)
|
|
233
|
-
}))),
|
|
232
|
+
}))), React.createElement("div", {
|
|
234
233
|
className: "".concat(prefixCls, "-active-bar"),
|
|
235
234
|
style: _extends(_extends({}, activeBarPositionStyle), {
|
|
236
235
|
width: activeBarWidth,
|
|
@@ -238,4 +237,4 @@ function InputDate(props, ref) {
|
|
|
238
237
|
})
|
|
239
238
|
}), getSuffixNode());
|
|
240
239
|
}
|
|
241
|
-
export default
|
|
240
|
+
export default React.forwardRef(InputDate);
|