@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
package/es/collapse/collapse.js
CHANGED
|
@@ -13,7 +13,7 @@ import classNames from 'classnames';
|
|
|
13
13
|
import { tuple } from '../_utils/type';
|
|
14
14
|
import devwarning from '../_utils/devwarning';
|
|
15
15
|
export var IconPositionTypes = tuple('left', 'right');
|
|
16
|
-
var InternalCollapse =
|
|
16
|
+
var InternalCollapse = React.forwardRef(function (props, ref) {
|
|
17
17
|
var _React$useContext = React.useContext(ConfigContext),
|
|
18
18
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
19
19
|
prefixCls = _React$useContext.prefixCls,
|
|
@@ -30,7 +30,7 @@ var InternalCollapse = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
30
30
|
className = _getCompProps.className,
|
|
31
31
|
children = _getCompProps.children,
|
|
32
32
|
customPrefixcls = _getCompProps.prefixCls;
|
|
33
|
-
var CollapsePrefixCls = getPrefixCls(prefixCls, 'collapse', customPrefixcls);
|
|
33
|
+
var CollapsePrefixCls = getPrefixCls(prefixCls, 'collapse', customPrefixcls);
|
|
34
34
|
var _useState = useState([]),
|
|
35
35
|
_useState2 = _slicedToArray(_useState, 2),
|
|
36
36
|
innerKey = _useState2[0],
|
|
@@ -88,7 +88,7 @@ var InternalCollapse = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
88
88
|
devwarning(true, 'Collapse', 'children must be Collapse.Panel');
|
|
89
89
|
return item;
|
|
90
90
|
}
|
|
91
|
-
return
|
|
91
|
+
return React.cloneElement(item, _extends({
|
|
92
92
|
expandIcon: expandIcon,
|
|
93
93
|
expandIconPosition: expandIconPosition,
|
|
94
94
|
onChange: onPanelChange,
|
|
@@ -98,8 +98,8 @@ var InternalCollapse = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
98
98
|
});
|
|
99
99
|
};
|
|
100
100
|
var rootClassName = classNames(className, _defineProperty({}, "".concat(CollapsePrefixCls), true));
|
|
101
|
-
var collapseRef = ref ||
|
|
102
|
-
return
|
|
101
|
+
var collapseRef = ref || React.createRef();
|
|
102
|
+
return React.createElement("div", {
|
|
103
103
|
className: rootClassName,
|
|
104
104
|
style: style,
|
|
105
105
|
ref: collapseRef
|
package/es/collapse/panel.js
CHANGED
|
@@ -16,7 +16,7 @@ import classNames from 'classnames';
|
|
|
16
16
|
import ConfigContext from '../config-provider/ConfigContext';
|
|
17
17
|
import { getCompProps } from '../_utils';
|
|
18
18
|
import Icon from '../icon';
|
|
19
|
-
var Panel =
|
|
19
|
+
var Panel = React.forwardRef(function (props, ref) {
|
|
20
20
|
var _classNames6, _classNames7, _classNames8;
|
|
21
21
|
var _React$useContext = React.useContext(ConfigContext),
|
|
22
22
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
@@ -39,7 +39,7 @@ var Panel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
39
39
|
children = _a.children,
|
|
40
40
|
customPrefixcls = _a.prefixCls,
|
|
41
41
|
others = __rest(_a, ["disabled", "extra", "assist", "header", "onChange", "panelKey", "innerKey", "bordered", "expandIcon", "expandIconPosition", "style", "title", "className", "children", "prefixCls"]);
|
|
42
|
-
var panelPrefixCls = getPrefixCls(prefixCls, 'collapse-panel', customPrefixcls);
|
|
42
|
+
var panelPrefixCls = getPrefixCls(prefixCls, 'collapse-panel', customPrefixcls);
|
|
43
43
|
var childrenRef = useRef();
|
|
44
44
|
var setHeightTimerRef = useRef(null);
|
|
45
45
|
var setAutoHeightTimerRef = useRef(null);
|
|
@@ -65,10 +65,10 @@ var Panel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
65
65
|
var renderIcon = function renderIcon() {
|
|
66
66
|
var _classNames;
|
|
67
67
|
var iconClassName = classNames((_classNames = {}, _defineProperty(_classNames, "".concat(panelPrefixCls, "-icon"), true), _defineProperty(_classNames, "".concat(panelPrefixCls, "-animation-expand"), !expand), _defineProperty(_classNames, "".concat(panelPrefixCls, "-animation-collapse"), expand), _defineProperty(_classNames, "".concat(panelPrefixCls, "-disabled"), disabled), _classNames));
|
|
68
|
-
return
|
|
68
|
+
return React.createElement("span", {
|
|
69
69
|
className: iconClassName,
|
|
70
70
|
onClick: handleClick
|
|
71
|
-
}, expandIcon ? renderReactNode(expandIcon) :
|
|
71
|
+
}, expandIcon ? renderReactNode(expandIcon) : React.createElement(Icon, {
|
|
72
72
|
type: "arrow-right-solid"
|
|
73
73
|
}));
|
|
74
74
|
};
|
|
@@ -76,10 +76,10 @@ var Panel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
76
76
|
var _classNames2, _classNames3;
|
|
77
77
|
var className = classNames((_classNames2 = {}, _defineProperty(_classNames2, "".concat(panelPrefixCls, "-left"), true), _defineProperty(_classNames2, "".concat(panelPrefixCls, "-disabled"), disabled), _classNames2));
|
|
78
78
|
var headerClassName = classNames((_classNames3 = {}, _defineProperty(_classNames3, "".concat(panelPrefixCls, "-header"), true), _defineProperty(_classNames3, "".concat(panelPrefixCls, "-disabled"), disabled), _classNames3));
|
|
79
|
-
return
|
|
79
|
+
return React.createElement("span", {
|
|
80
80
|
className: className,
|
|
81
81
|
onClick: handleClick
|
|
82
|
-
}, expandIconPosition === 'left' ? renderIcon() : null, header &&
|
|
82
|
+
}, expandIconPosition === 'left' ? renderIcon() : null, header && React.createElement("span", {
|
|
83
83
|
className: headerClassName,
|
|
84
84
|
title: title
|
|
85
85
|
}, renderReactNode(header)));
|
|
@@ -88,9 +88,9 @@ var Panel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
88
88
|
var _classNames4;
|
|
89
89
|
if (typeof extra === 'undefined' && expandIconPosition !== 'right') return;
|
|
90
90
|
var className = classNames((_classNames4 = {}, _defineProperty(_classNames4, "".concat(panelPrefixCls, "-right"), true), _defineProperty(_classNames4, "".concat(panelPrefixCls, "-disabled"), disabled), _classNames4));
|
|
91
|
-
return
|
|
91
|
+
return React.createElement("span", {
|
|
92
92
|
className: className
|
|
93
|
-
}, extra &&
|
|
93
|
+
}, extra && React.createElement("span", {
|
|
94
94
|
className: "".concat(panelPrefixCls, "-extra")
|
|
95
95
|
}, renderReactNode(extra)), expandIconPosition === 'right' ? renderIcon() : null);
|
|
96
96
|
};
|
|
@@ -98,9 +98,9 @@ var Panel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
98
98
|
var _classNames5;
|
|
99
99
|
if (typeof assist === 'undefined') return;
|
|
100
100
|
var className = classNames((_classNames5 = {}, _defineProperty(_classNames5, "".concat(panelPrefixCls, "-middle"), true), _defineProperty(_classNames5, "".concat(panelPrefixCls, "-disabled"), disabled), _classNames5));
|
|
101
|
-
return
|
|
101
|
+
return React.createElement("span", {
|
|
102
102
|
className: className
|
|
103
|
-
}, assist &&
|
|
103
|
+
}, assist && React.createElement("span", {
|
|
104
104
|
className: "".concat(panelPrefixCls, "-assist")
|
|
105
105
|
}, renderReactNode(assist)));
|
|
106
106
|
};
|
|
@@ -140,7 +140,7 @@ var Panel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
140
140
|
element.style.height = 'auto';
|
|
141
141
|
element.style.opacity = '1';
|
|
142
142
|
};
|
|
143
|
-
var panelPrefixClsRef = ref ||
|
|
143
|
+
var panelPrefixClsRef = ref || React.createRef();
|
|
144
144
|
React.useLayoutEffect(function () {
|
|
145
145
|
if (!childrenRef.current) return;
|
|
146
146
|
if (expandAnimation) {
|
|
@@ -150,16 +150,16 @@ var Panel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
150
150
|
expand ? expandWidthoutAnimation(childrenRef.current) : runCollapseAnimation(childrenRef.current);
|
|
151
151
|
}
|
|
152
152
|
}, [childrenRef.current, expandAnimation, expand]);
|
|
153
|
-
return
|
|
153
|
+
return React.createElement("div", _extends({
|
|
154
154
|
className: rootClassName,
|
|
155
155
|
style: style,
|
|
156
156
|
ref: panelPrefixClsRef
|
|
157
|
-
}, others),
|
|
157
|
+
}, others), React.createElement("span", {
|
|
158
158
|
className: topClassName
|
|
159
|
-
}, renderLeft(), renderMiddle(), renderRight()),
|
|
159
|
+
}, renderLeft(), renderMiddle(), renderRight()), React.createElement("div", {
|
|
160
160
|
className: childrenClassName,
|
|
161
161
|
ref: childrenRef
|
|
162
|
-
},
|
|
162
|
+
}, React.createElement("div", {
|
|
163
163
|
className: childrenBorderedClassName
|
|
164
164
|
}, children)));
|
|
165
165
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
2
2
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
3
|
-
/* eslint-disable */
|
|
4
3
|
import React, { useContext, useRef } from 'react';
|
|
5
4
|
import { Input, Select, Switch } from '../index';
|
|
6
5
|
import classNames from 'classnames';
|
|
@@ -181,24 +180,24 @@ var ColorPickerPanel = function ColorPickerPanel(props) {
|
|
|
181
180
|
}
|
|
182
181
|
showPanel && onVisibleChange && onVisibleChange(false);
|
|
183
182
|
});
|
|
184
|
-
return
|
|
183
|
+
return React.createElement(React.Fragment, null, showColorPickerPanel && React.createElement("div", {
|
|
185
184
|
className: panelCls,
|
|
186
185
|
ref: panelClsRef
|
|
187
|
-
},
|
|
186
|
+
}, React.createElement(ChromePicker, {
|
|
188
187
|
className: panelChromePickerCls,
|
|
189
188
|
color: colTypeArr[2].value,
|
|
190
189
|
onChange: handleChromeChange
|
|
191
|
-
}), functionalColor && showSwitch &&
|
|
190
|
+
}), functionalColor && showSwitch && React.createElement("div", {
|
|
192
191
|
className: panelFollowThemeCls
|
|
193
|
-
},
|
|
192
|
+
}, React.createElement("span", null, (switchName === null || switchName === void 0 ? void 0 : switchName.internationalName) && locale.getLangMsg('ColorPicker', switchName.internationalName) || switchName.name), React.createElement(Switch, {
|
|
194
193
|
checked: isFollow,
|
|
195
194
|
onChange: handleSwitchChange
|
|
196
|
-
})), showColorTransfer &&
|
|
195
|
+
})), showColorTransfer && React.createElement("div", {
|
|
197
196
|
className: panelContainerCls
|
|
198
|
-
},
|
|
197
|
+
}, React.createElement("div", {
|
|
199
198
|
className: panelInputCls,
|
|
200
199
|
ref: panelInputRef
|
|
201
|
-
},
|
|
200
|
+
}, React.createElement(Select, {
|
|
202
201
|
disabled: isFollow,
|
|
203
202
|
borderType: "bordered",
|
|
204
203
|
value: correctColorValue,
|
|
@@ -209,7 +208,7 @@ var ColorPickerPanel = function ColorPickerPanel(props) {
|
|
|
209
208
|
return panelInputRef.current;
|
|
210
209
|
}
|
|
211
210
|
}, _mapInstanceProperty(colTypeArr).call(colTypeArr, function (obj, i) {
|
|
212
|
-
return
|
|
211
|
+
return React.createElement(Option, {
|
|
213
212
|
title: obj.value,
|
|
214
213
|
value: obj.value,
|
|
215
214
|
className: classNames({
|
|
@@ -217,17 +216,17 @@ var ColorPickerPanel = function ColorPickerPanel(props) {
|
|
|
217
216
|
}),
|
|
218
217
|
key: i
|
|
219
218
|
}, obj.type);
|
|
220
|
-
}))),
|
|
219
|
+
}))), React.createElement(Input, {
|
|
221
220
|
className: transparentCls,
|
|
222
221
|
onChange: handleAlphaChange,
|
|
223
222
|
onBlur: handleAlphaBlur,
|
|
224
223
|
borderType: "bordered",
|
|
225
224
|
value: alphaNoVerifyVal,
|
|
226
225
|
disabled: isFollow
|
|
227
|
-
})), showPresetColor &&
|
|
226
|
+
})), showPresetColor && React.createElement("div", {
|
|
228
227
|
className: colorDivContainerCls
|
|
229
228
|
}, _mapInstanceProperty(_context = checkUserPresetColor(presetColor) && presetColorToHEX(presetColor) || systemPresetColor).call(_context, function (colorValue, i) {
|
|
230
|
-
return
|
|
229
|
+
return React.createElement("li", {
|
|
231
230
|
key: i,
|
|
232
231
|
style: {
|
|
233
232
|
backgroundColor: "".concat(colorValue)
|
|
@@ -235,7 +234,7 @@ var ColorPickerPanel = function ColorPickerPanel(props) {
|
|
|
235
234
|
onClick: function onClick() {
|
|
236
235
|
colorLiClick(i, colorValue);
|
|
237
236
|
}
|
|
238
|
-
},
|
|
237
|
+
}, React.createElement("div", {
|
|
239
238
|
className: classNames('square', {
|
|
240
239
|
'square-click': clickedColorIndex === i
|
|
241
240
|
})
|
|
@@ -142,19 +142,19 @@ var ColorPicker = function ColorPicker(props) {
|
|
|
142
142
|
var afterIcon = function afterIcon() {
|
|
143
143
|
var _classNames;
|
|
144
144
|
var afterIconContainerCls = classNames("".concat(colorPickerPrefixCls, "-icon"), (_classNames = {}, _defineProperty(_classNames, "".concat(colorPickerPrefixCls, "-icon-underline"), borderType === 'underline'), _defineProperty(_classNames, "".concat(colorPickerPrefixCls, "-icon-bordered"), borderType === 'bordered'), _defineProperty(_classNames, "".concat(colorPickerPrefixCls, "-icon-up"), showPanel), _defineProperty(_classNames, "".concat(colorPickerPrefixCls, "-icon-down"), !showPanel), _classNames));
|
|
145
|
-
return
|
|
145
|
+
return React.createElement("div", {
|
|
146
146
|
className: afterIconContainerCls,
|
|
147
147
|
style: {
|
|
148
148
|
backgroundColor: "".concat(colTypeArr[2].value || defaultSystemColor)
|
|
149
149
|
}
|
|
150
|
-
}, showColorPickerPanel &&
|
|
150
|
+
}, showColorPickerPanel && React.createElement(Icon, {
|
|
151
151
|
type: "arrow-down"
|
|
152
152
|
}));
|
|
153
153
|
};
|
|
154
|
-
var colorInputEle =
|
|
154
|
+
var colorInputEle = React.createElement("div", {
|
|
155
155
|
className: containerCls,
|
|
156
156
|
ref: inputRef
|
|
157
|
-
},
|
|
157
|
+
}, React.createElement(Input, {
|
|
158
158
|
borderType: borderType,
|
|
159
159
|
placeholder: placeholder,
|
|
160
160
|
value: value !== null && value !== void 0 ? value : inputColorValue,
|
|
@@ -162,14 +162,11 @@ var ColorPicker = function ColorPicker(props) {
|
|
|
162
162
|
onChange: handleChange,
|
|
163
163
|
style: style,
|
|
164
164
|
onClick: handleClick
|
|
165
|
-
}),
|
|
165
|
+
}), React.createElement("div", {
|
|
166
166
|
onClick: handleClick,
|
|
167
167
|
className: "".concat(colorPickerPrefixCls, "-icon-container")
|
|
168
168
|
}, suffixIcon && suffixIcon(colTypeArr[2].value) || afterIcon()));
|
|
169
|
-
var panel =
|
|
170
|
-
// API
|
|
171
|
-
, {
|
|
172
|
-
// API
|
|
169
|
+
var panel = React.createElement(ColorPickerPanel, {
|
|
173
170
|
showSwitch: showSwitch,
|
|
174
171
|
showColorTransfer: showColorTransfer,
|
|
175
172
|
showPresetColor: showPresetColor,
|
|
@@ -182,7 +179,6 @@ var ColorPicker = function ColorPicker(props) {
|
|
|
182
179
|
visible: visible,
|
|
183
180
|
showPanel: showPanel,
|
|
184
181
|
onVisibleChange: onVisibleChange,
|
|
185
|
-
// private
|
|
186
182
|
setInputColorValue: setInputColorValue,
|
|
187
183
|
setCorrectColorValue: setCorrectColorValue,
|
|
188
184
|
correctColorValue: correctColorValue,
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
// 输入框颜色类型校验
|
|
2
1
|
export function validateColor(color) {
|
|
3
2
|
var hexReg = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
|
|
4
3
|
var hexaReg = /^#([0-9a-fA-F]{8})$/;
|
|
5
4
|
var hsbReg = /^hsb\(\s*(-?\d+|-?\d*\.\d+)(?:,\s*(-?\d+|-?\d*\.\d+|-?\d+%|-?\d*\.\d+%)){2}\s*\)$/;
|
|
6
5
|
var hsbaReg = /^hsba\(\s*(-?\d+|-?\d*\.\d+)(?:,\s*(-?\d+|-?\d*\.\d+|-?\d+%|-?\d*\.\d+%)){2}\s*,\s*(-?\d+|-?\d*\.\d+)\)$/;
|
|
7
|
-
// const rgbaReg = /^rgba\(\s*(-?\d+|-?\d*\.\d+)(?:,\s*(-?\d+|-?\d*\.\d+)){2},\s*(-?\d+|-?\d*\.\d+)|(^\d+%)\s*\)$/
|
|
8
6
|
var rgbaReg = /^rgba\(\s*(-?\d+|-?\d*\.\d+)(?:,\s*(-?\d+|-?\d*\.\d+)){2},\s*(-?\d+|-?\d*\.\d+)\)$/;
|
|
9
7
|
var rgbReg = /^rgb\(\s*(-?\d+|-?\d*\.\d+)(?:,\s*(-?\d+|-?\d*\.\d+)){2}\)$/;
|
|
10
8
|
var hslReg = /^hsl\(\s*(-?\d+|-?\d*\.\d+)(?:,\s*(-?\d+|-?\d*\.\d+|-?\d+%|-?\d*\.\d+%)){2}\s*\)$/;
|
|
11
9
|
var hslaReg = /^hsla\(\s*(-?\d+|-?\d*\.\d+)(?:,\s*(-?\d+|-?\d*\.\d+|-?\d+%|-?\d*\.\d+%)){2}\s*,\s*(-?\d+|-?\d*\.\d+)\)$/;
|
|
12
|
-
// const hslaReg = /^hsla\(\s*(-?\d+|-?\d*\.\d+)(?:,\s*(-?\d+|-?\d*\.\d+)){2}\s*,\s*(-?\d+|-?\d*\.\d+)|(^\d+%)\s*\)$/
|
|
13
10
|
var colorNameReg = /^(?:aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen)$/;
|
|
14
11
|
if (hexReg.test(color)) return 'HEX';
|
|
15
12
|
if (hexaReg.test(color)) return 'HEXA';
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 提供外层注入属性的context
|
|
3
|
-
*/
|
|
4
1
|
import { createContext } from 'react';
|
|
5
2
|
import defaultConfig from './defaultConfig';
|
|
6
|
-
var ConfigContext =
|
|
3
|
+
var ConfigContext = createContext(defaultConfig);
|
|
7
4
|
export default ConfigContext;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
var SizeContext =
|
|
2
|
+
var SizeContext = React.createContext(undefined);
|
|
3
3
|
export var SizeContextProvider = function SizeContextProvider(_ref) {
|
|
4
4
|
var children = _ref.children,
|
|
5
5
|
size = _ref.size;
|
|
6
|
-
return
|
|
7
|
-
return
|
|
6
|
+
return React.createElement(SizeContext.Consumer, null, function (originSize) {
|
|
7
|
+
return React.createElement(SizeContext.Provider, {
|
|
8
8
|
value: size || originSize
|
|
9
9
|
}, children);
|
|
10
10
|
});
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Icon } from '../index';
|
|
3
|
-
/**
|
|
4
|
-
* 组件默认属性,所有组件的默认属性都在这里写,
|
|
5
|
-
* 而不是在组件文件中以“componentName.defaultProps”的方式去写
|
|
6
|
-
* componentName: defaultPropsObj
|
|
7
|
-
* (用于处理用户自定义默认属性)
|
|
8
|
-
*/
|
|
9
3
|
var compDefaultProps = {
|
|
10
4
|
Alert: {
|
|
11
5
|
type: 'warning',
|
|
@@ -247,7 +241,6 @@ var compDefaultProps = {
|
|
|
247
241
|
},
|
|
248
242
|
Progress: {
|
|
249
243
|
type: 'line',
|
|
250
|
-
// width: 88,
|
|
251
244
|
trailColor: '#E5E5E5',
|
|
252
245
|
percent: 0,
|
|
253
246
|
showInfo: true,
|
|
@@ -263,7 +256,7 @@ var compDefaultProps = {
|
|
|
263
256
|
Rate: {
|
|
264
257
|
allowHalf: true,
|
|
265
258
|
icon: function icon() {
|
|
266
|
-
return
|
|
259
|
+
return React.createElement(Icon, {
|
|
267
260
|
type: "star"
|
|
268
261
|
});
|
|
269
262
|
},
|
|
@@ -355,7 +348,7 @@ var compDefaultProps = {
|
|
|
355
348
|
draggable: false,
|
|
356
349
|
virtual: true,
|
|
357
350
|
switcherIcon: function switcherIcon() {
|
|
358
|
-
return
|
|
351
|
+
return React.createElement(Icon, {
|
|
359
352
|
type: "arrow-right-solid"
|
|
360
353
|
});
|
|
361
354
|
},
|
|
@@ -469,7 +462,7 @@ var compDefaultProps = {
|
|
|
469
462
|
onlyExpandOnClickIcon: true,
|
|
470
463
|
showSearch: true,
|
|
471
464
|
switcherIcon: function switcherIcon() {
|
|
472
|
-
return
|
|
465
|
+
return React.createElement(Icon, {
|
|
473
466
|
type: "arrow-right-solid"
|
|
474
467
|
});
|
|
475
468
|
},
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 对外暴露用于注入全局配置属性的Context.Provider
|
|
3
|
-
*/
|
|
4
1
|
import React, { useMemo } from 'react';
|
|
5
2
|
import assign from 'lodash/assign';
|
|
6
3
|
import ConfigContext from './ConfigContext';
|
|
7
4
|
import defaultConfig from './defaultConfig';
|
|
8
5
|
import localeCacher, { getLangMsg as getLang, getCompLangMsg as getCompLang } from '../locale/index';
|
|
9
6
|
var ConfigProvider = function ConfigProvider(props) {
|
|
10
|
-
// 处理当前语言
|
|
11
7
|
var value = props.value;
|
|
12
8
|
var localeConfig = value && value.localeConfig;
|
|
13
9
|
if (localeConfig) {
|
|
@@ -27,13 +23,12 @@ var ConfigProvider = function ConfigProvider(props) {
|
|
|
27
23
|
locale: localeCacher.getLocal()
|
|
28
24
|
};
|
|
29
25
|
}, [localeConfig]);
|
|
30
|
-
// 处理组件默认属性
|
|
31
26
|
var providerValue = useMemo(function () {
|
|
32
27
|
return assign({}, defaultConfig, value, {
|
|
33
28
|
locale: locale
|
|
34
29
|
});
|
|
35
30
|
}, [locale, value]);
|
|
36
|
-
return
|
|
31
|
+
return React.createElement(ConfigContext.Provider, {
|
|
37
32
|
value: providerValue
|
|
38
33
|
}, props.children);
|
|
39
34
|
};
|
|
@@ -3,7 +3,6 @@ import { getLangMsg, getCompLangMsg } from '../locale';
|
|
|
3
3
|
var defaultConfig = {
|
|
4
4
|
getPrefixCls: function getPrefixCls(configPrefixCls, suffixCls, customizePrefixCls) {
|
|
5
5
|
var _context;
|
|
6
|
-
// 获取样式前缀方法
|
|
7
6
|
if (customizePrefixCls) return customizePrefixCls;
|
|
8
7
|
configPrefixCls = configPrefixCls || 'kd';
|
|
9
8
|
var t = suffixCls ? _concatInstanceProperty(_context = "".concat(configPrefixCls, "-")).call(_context, suffixCls) : configPrefixCls;
|
|
@@ -23,16 +23,16 @@ function Calendar(props) {
|
|
|
23
23
|
var weekTitleItemCls = classnames("".concat(prefixCls, "-weektitle-item"));
|
|
24
24
|
if (showWeekNumber) {
|
|
25
25
|
var weekTitleNumberItemCls = classnames("".concat(prefixCls, "-weektitle-weeknumber"));
|
|
26
|
-
dayNames.push(
|
|
26
|
+
dayNames.push(React.createElement("div", {
|
|
27
27
|
key: "W",
|
|
28
28
|
className: weekTitleNumberItemCls
|
|
29
29
|
}));
|
|
30
30
|
}
|
|
31
|
-
return
|
|
31
|
+
return React.createElement("div", {
|
|
32
32
|
className: weekTitleCls
|
|
33
33
|
}, _concatInstanceProperty(dayNames).call(dayNames, _mapInstanceProperty(_context = [0, 1, 2, 3, 4, 5, 6]).call(_context, function (offset) {
|
|
34
34
|
var weekDayName = locale.weekTitle[offset];
|
|
35
|
-
return
|
|
35
|
+
return React.createElement("div", {
|
|
36
36
|
key: offset,
|
|
37
37
|
className: weekTitleItemCls
|
|
38
38
|
}, weekDayName);
|
|
@@ -43,7 +43,7 @@ function Calendar(props) {
|
|
|
43
43
|
var weeks = [];
|
|
44
44
|
var i = 0;
|
|
45
45
|
while (true) {
|
|
46
|
-
weeks.push(
|
|
46
|
+
weeks.push(React.createElement(Week, {
|
|
47
47
|
key: i,
|
|
48
48
|
day: currentWeekStart,
|
|
49
49
|
picker: picker,
|
|
@@ -53,34 +53,17 @@ function Calendar(props) {
|
|
|
53
53
|
}));
|
|
54
54
|
i++;
|
|
55
55
|
currentWeekStart = addWeeks(currentWeekStart, 1);
|
|
56
|
-
// 最少保证面板包含有六周,保证左右面板及切换面板时周数一致
|
|
57
56
|
if (i >= DATE_ROW_COUNT) {
|
|
58
57
|
break;
|
|
59
58
|
}
|
|
60
|
-
// const isNonFixedAndOutOfMonth = !isWeekInMonth(currentWeekStart)
|
|
61
|
-
// if (panelPosition) {
|
|
62
|
-
// // range 模式时,最少保证面板包含有六周,保证左右面板周数一致
|
|
63
|
-
// if (i >= DATE_ROW_COUNT) {
|
|
64
|
-
// break
|
|
65
|
-
// }
|
|
66
|
-
// } else {
|
|
67
|
-
// if (isNonFixedAndOutOfMonth) {
|
|
68
|
-
// break
|
|
69
|
-
// }
|
|
70
|
-
// }
|
|
71
59
|
}
|
|
72
|
-
|
|
73
60
|
return weeks;
|
|
74
61
|
};
|
|
75
62
|
var calendarCls = classnames("".concat(prefixCls, "-calendar"));
|
|
76
63
|
var calendarWarpperCls = classnames("".concat(prefixCls, "-calendar-warpper"));
|
|
77
|
-
|
|
78
|
-
// if (picker === 'date' || picker === 'week') {
|
|
79
|
-
// _showWeeksTitle = showWeeksTitle
|
|
80
|
-
// }
|
|
81
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
64
|
+
return React.createElement("div", {
|
|
82
65
|
className: calendarCls
|
|
83
|
-
}, showWeeksTitle ? renderWeeksTitle() : null,
|
|
66
|
+
}, showWeeksTitle ? renderWeeksTitle() : null, React.createElement("div", {
|
|
84
67
|
className: calendarWarpperCls
|
|
85
68
|
}, renderWeeks()));
|
|
86
69
|
}
|
|
@@ -38,14 +38,14 @@ function Panel(props) {
|
|
|
38
38
|
showWeeksTitle = props.showWeeksTitle,
|
|
39
39
|
disabledDate = props.disabledDate;
|
|
40
40
|
var getHeader = function getHeader() {
|
|
41
|
-
return
|
|
41
|
+
return React.createElement(Header, _extends({}, headerProps, {
|
|
42
42
|
className: headerObj.className
|
|
43
43
|
}), headerObj.children);
|
|
44
44
|
};
|
|
45
45
|
var renderYearPanel = function renderYearPanel() {
|
|
46
46
|
var _props$yearItemNumber = props.yearItemNumber,
|
|
47
47
|
yearItemNumber = _props$yearItemNumber === void 0 ? DEFAULT_YEAR_ITEM_NUMBER : _props$yearItemNumber;
|
|
48
|
-
return
|
|
48
|
+
return React.createElement(Year, _extends({}, props, {
|
|
49
49
|
yearItemNumber: yearItemNumber
|
|
50
50
|
}));
|
|
51
51
|
};
|
|
@@ -53,13 +53,13 @@ function Panel(props) {
|
|
|
53
53
|
if (isInnerYear) {
|
|
54
54
|
return renderYearPanel();
|
|
55
55
|
}
|
|
56
|
-
return
|
|
56
|
+
return React.createElement(Month, _extends({}, props));
|
|
57
57
|
};
|
|
58
58
|
var renderQuarterPanel = function renderQuarterPanel() {
|
|
59
59
|
if (isInnerYear) {
|
|
60
60
|
return renderYearPanel();
|
|
61
61
|
}
|
|
62
|
-
return
|
|
62
|
+
return React.createElement(Quarter, _extends({}, props));
|
|
63
63
|
};
|
|
64
64
|
var renderDatePanel = function renderDatePanel() {
|
|
65
65
|
if (isInnerPicker) {
|
|
@@ -77,7 +77,7 @@ function Panel(props) {
|
|
|
77
77
|
showWeeksTitle: showWeeksTitle,
|
|
78
78
|
disabledDate: disabledDate
|
|
79
79
|
};
|
|
80
|
-
return
|
|
80
|
+
return React.createElement(Calendar, _extends({}, dateProps, {
|
|
81
81
|
picker: picker
|
|
82
82
|
}));
|
|
83
83
|
} else {
|
|
@@ -90,7 +90,7 @@ function Panel(props) {
|
|
|
90
90
|
}, props), {
|
|
91
91
|
picker: picker
|
|
92
92
|
})) : {});
|
|
93
|
-
return
|
|
93
|
+
return React.createElement(DateTime, _extends({}, _props, {
|
|
94
94
|
picker: picker,
|
|
95
95
|
dateHeader: getHeader()
|
|
96
96
|
}));
|
|
@@ -108,7 +108,7 @@ function Panel(props) {
|
|
|
108
108
|
}, props), {
|
|
109
109
|
picker: picker
|
|
110
110
|
})) : {});
|
|
111
|
-
return
|
|
111
|
+
return React.createElement(Time, _extends({}, _props));
|
|
112
112
|
};
|
|
113
113
|
var renderYearHeader = function renderYearHeader() {
|
|
114
114
|
var _props$yearItemNumber2 = props.yearItemNumber,
|
|
@@ -118,7 +118,7 @@ function Panel(props) {
|
|
|
118
118
|
endPeriod = _getYearsPeriod.endPeriod;
|
|
119
119
|
var headerCls = classnames("".concat(prefixCls, "-header"), "".concat(prefixCls, "-header-year"));
|
|
120
120
|
return {
|
|
121
|
-
children:
|
|
121
|
+
children: React.createElement(React.Fragment, null, startPeriod, " - ", endPeriod),
|
|
122
122
|
className: headerCls
|
|
123
123
|
};
|
|
124
124
|
};
|
|
@@ -132,7 +132,7 @@ function Panel(props) {
|
|
|
132
132
|
var year = getYear(viewDate);
|
|
133
133
|
var headerCls = classnames("".concat(prefixCls, "-header"), "".concat(prefixCls, "-header-month"), "".concat(prefixCls, "-header-text-inner-hover"), _defineProperty({}, "".concat(prefixCls, "-header-text-inner-active"), isInnerYear));
|
|
134
134
|
return {
|
|
135
|
-
children:
|
|
135
|
+
children: React.createElement("span", {
|
|
136
136
|
onClick: onHeaderYearClick
|
|
137
137
|
}, year + locale.year),
|
|
138
138
|
className: headerCls
|
|
@@ -143,10 +143,10 @@ function Panel(props) {
|
|
|
143
143
|
var month = getMonth(viewDate);
|
|
144
144
|
var headerCls = classnames("".concat(prefixCls, "-header"), "".concat(prefixCls, "-header-date"));
|
|
145
145
|
return {
|
|
146
|
-
children:
|
|
146
|
+
children: React.createElement(React.Fragment, null, React.createElement("span", {
|
|
147
147
|
className: classnames("".concat(prefixCls, "-header-text-inner"), "".concat(prefixCls, "-header-text-inner-hover"), _defineProperty({}, "".concat(prefixCls, "-header-text-inner-active"), isInnerYear)),
|
|
148
148
|
onClick: onHeaderYearClick
|
|
149
|
-
}, year + locale.year),
|
|
149
|
+
}, year + locale.year), React.createElement("span", {
|
|
150
150
|
className: classnames("".concat(prefixCls, "-header-text-inner"), "".concat(prefixCls, "-header-text-inner-hover"), _defineProperty({}, "".concat(prefixCls, "-header-text-inner-active"), isInnerMonth)),
|
|
151
151
|
onClick: onHeaderMonthClick
|
|
152
152
|
}, locale.monthTitle[month])),
|
|
@@ -225,7 +225,6 @@ function Panel(props) {
|
|
|
225
225
|
};
|
|
226
226
|
break;
|
|
227
227
|
}
|
|
228
|
-
// 时间面板,4个箭头的显隐,在时间范围时需要判断是否在快捷选择面板下
|
|
229
228
|
case 'date':
|
|
230
229
|
{
|
|
231
230
|
headerObj = renderDateHeader();
|
|
@@ -262,7 +261,7 @@ function Panel(props) {
|
|
|
262
261
|
}
|
|
263
262
|
var showHeader = !(picker === 'date' && showTime || picker === 'time') || innerPicker !== undefined;
|
|
264
263
|
var containerCls = classnames("".concat(prefixCls, "-warpper"));
|
|
265
|
-
return
|
|
264
|
+
return React.createElement("div", {
|
|
266
265
|
className: containerCls
|
|
267
266
|
}, showHeader ? getHeader() : null, panel);
|
|
268
267
|
}
|
|
@@ -214,9 +214,6 @@ var InternalDatePicker = function InternalDatePicker(props, ref) {
|
|
|
214
214
|
if (onOpenChange) {
|
|
215
215
|
onOpenChange(newOpen);
|
|
216
216
|
}
|
|
217
|
-
// if (!newOpen && operationRef.current && operationRef.current.onClose) {
|
|
218
|
-
// operationRef.current.onClose()
|
|
219
|
-
// }
|
|
220
217
|
}
|
|
221
218
|
}),
|
|
222
219
|
_useMergedState6 = _slicedToArray(_useMergedState5, 2),
|
|
@@ -252,13 +249,11 @@ var InternalDatePicker = function InternalDatePicker(props, ref) {
|
|
|
252
249
|
} else {
|
|
253
250
|
setInnerPicker(undefined);
|
|
254
251
|
}
|
|
255
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
256
252
|
}, [openValue, valueText]);
|
|
257
253
|
useEffect(function () {
|
|
258
254
|
if (!openValue) {
|
|
259
255
|
resetText();
|
|
260
256
|
}
|
|
261
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
262
257
|
}, [picker]);
|
|
263
258
|
useOnClickOutside([popperRef, inputDivRef], function () {
|
|
264
259
|
setViewDate(selectedValue || newDate());
|
|
@@ -330,7 +325,7 @@ var InternalDatePicker = function InternalDatePicker(props, ref) {
|
|
|
330
325
|
var now = newDate();
|
|
331
326
|
var todayCls = "".concat(datePickerPrefixCls, "-today-btn");
|
|
332
327
|
var _disabled = disabledDate && disabledDate(now);
|
|
333
|
-
todayNode =
|
|
328
|
+
todayNode = React.createElement("div", {
|
|
334
329
|
className: classnames(todayCls, _disabled && "".concat(datePickerPrefixCls, "-btn-disabled")),
|
|
335
330
|
"aria-disabled": _disabled,
|
|
336
331
|
onClick: function onClick() {
|
|
@@ -345,11 +340,11 @@ var InternalDatePicker = function InternalDatePicker(props, ref) {
|
|
|
345
340
|
onChange: setSelectedValue
|
|
346
341
|
});
|
|
347
342
|
var renderPanel = function renderPanel() {
|
|
348
|
-
var panelNode =
|
|
343
|
+
var panelNode = React.createElement(Panel, _extends({}, panelProps));
|
|
349
344
|
if (panelRender) {
|
|
350
345
|
panelNode = panelRender(panelNode);
|
|
351
346
|
}
|
|
352
|
-
return
|
|
347
|
+
return React.createElement(Context.Provider, {
|
|
353
348
|
value: {
|
|
354
349
|
hours: hours,
|
|
355
350
|
minutes: minutes,
|
|
@@ -371,7 +366,7 @@ var InternalDatePicker = function InternalDatePicker(props, ref) {
|
|
|
371
366
|
setInnerPicker: setInnerPicker,
|
|
372
367
|
cellRender: cellRender
|
|
373
368
|
}
|
|
374
|
-
}, panelNode, (extraFooter || rangesNode || todayNode) && innerPicker === undefined ?
|
|
369
|
+
}, panelNode, (extraFooter || rangesNode || todayNode) && innerPicker === undefined ? React.createElement("div", {
|
|
375
370
|
className: "".concat(datePickerPrefixCls, "-footer")
|
|
376
371
|
}, extraFooter, rangesNode, todayNode) : null);
|
|
377
372
|
};
|
|
@@ -417,9 +412,9 @@ var InternalDatePicker = function InternalDatePicker(props, ref) {
|
|
|
417
412
|
resetText: resetText,
|
|
418
413
|
status: status
|
|
419
414
|
};
|
|
420
|
-
return usePopper(
|
|
415
|
+
return usePopper(React.createElement(InputDate, _extends({
|
|
421
416
|
ref: inputDivRef
|
|
422
|
-
}, inputProps)),
|
|
417
|
+
}, inputProps)), React.createElement("div", {
|
|
423
418
|
ref: popperRef,
|
|
424
419
|
onMouseDown: function onMouseDown(e) {
|
|
425
420
|
e.preventDefault();
|
|
@@ -435,6 +430,6 @@ var InternalDatePicker = function InternalDatePicker(props, ref) {
|
|
|
435
430
|
getPopupContainer: getPopupContainer
|
|
436
431
|
});
|
|
437
432
|
};
|
|
438
|
-
var DatePicker =
|
|
433
|
+
var DatePicker = React.forwardRef(InternalDatePicker);
|
|
439
434
|
DatePicker.displayName = 'DatePicker';
|
|
440
435
|
export default DatePicker;
|