@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/button/button.js
CHANGED
|
@@ -28,7 +28,7 @@ var InternalButton = function InternalButton(props, ref) {
|
|
|
28
28
|
getPrefixCls = _useContext.getPrefixCls,
|
|
29
29
|
prefixCls = _useContext.prefixCls,
|
|
30
30
|
userDefaultProps = _useContext.compDefaultProps;
|
|
31
|
-
var buttonProps = getCompProps('Button', userDefaultProps, props);
|
|
31
|
+
var buttonProps = getCompProps('Button', userDefaultProps, props);
|
|
32
32
|
var type = buttonProps.type,
|
|
33
33
|
iconPlace = buttonProps.iconPlace,
|
|
34
34
|
children = buttonProps.children,
|
|
@@ -47,24 +47,16 @@ var InternalButton = function InternalButton(props, ref) {
|
|
|
47
47
|
htmlType = _buttonProps$htmlType === void 0 ? 'button' : _buttonProps$htmlType,
|
|
48
48
|
others = __rest(buttonProps, ["type", "iconPlace", "children", "className", "prefixCls", "size", "loading", "shape", "bordered", "onClick", "icon", "ghost", "block", "disabled", "htmlType"]);
|
|
49
49
|
devWarning(ButtonTypes.indexOf(type) === -1, 'button', "cannot found button type '".concat(type, "'"));
|
|
50
|
-
var btnPrefixCls = getPrefixCls(prefixCls, 'btn', customPrefixcls);
|
|
51
|
-
/**
|
|
52
|
-
* 按钮click事件处理
|
|
53
|
-
* @param {React.MouseEvent<HTMLButtonElement | HTMLAnchorElement, MouseEvent>} e 事件对象
|
|
54
|
-
*/
|
|
50
|
+
var btnPrefixCls = getPrefixCls(prefixCls, 'btn', customPrefixcls);
|
|
55
51
|
var handleClick = function handleClick(e) {
|
|
56
52
|
if (loading || disabled) {
|
|
57
|
-
// 加载中和禁用状态不触发点击事件
|
|
58
53
|
return;
|
|
59
54
|
}
|
|
60
55
|
var waveStatus = buttonRef.current.getAttribute('click-animating-wave');
|
|
61
|
-
// 进入时是否在加载动画
|
|
62
56
|
if (waveStatus === 'true') {
|
|
63
57
|
buttonRef.current.setAttribute('click-animating-wave', false);
|
|
64
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
65
58
|
window.getComputedStyle(buttonRef.current).animationPlayState;
|
|
66
59
|
}
|
|
67
|
-
// 启动动画
|
|
68
60
|
buttonRef.current.setAttribute('click-animating-wave', true);
|
|
69
61
|
buttonRef.current.addEventListener('animationend', onAnimationEnd);
|
|
70
62
|
onClick && onClick(e);
|
|
@@ -76,24 +68,21 @@ var InternalButton = function InternalButton(props, ref) {
|
|
|
76
68
|
e.target.setAttribute('click-animating-wave', 'false');
|
|
77
69
|
removeEventListener('animationend', onAnimationEnd);
|
|
78
70
|
};
|
|
79
|
-
|
|
80
|
-
var buttonRef = ref || /*#__PURE__*/React.createRef();
|
|
81
|
-
// 对children进行进一步处理,目前只处理typeof child === 'string'的情况,后续有特殊情况的在此方法处理
|
|
71
|
+
var buttonRef = ref || React.createRef();
|
|
82
72
|
var handleChild = function handleChild(child) {
|
|
83
73
|
if (typeof child === 'string') {
|
|
84
|
-
return
|
|
74
|
+
return React.createElement("span", null, child);
|
|
85
75
|
}
|
|
86
|
-
|
|
87
76
|
return child;
|
|
88
77
|
};
|
|
89
|
-
var isTextBtn = type === 'text';
|
|
78
|
+
var isTextBtn = type === 'text';
|
|
90
79
|
var btnClasses = classNames(btnPrefixCls, className, (_classNames = {}, _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(btnPrefixCls, "-")).call(_context, type), type), _defineProperty(_classNames, _concatInstanceProperty(_context2 = "".concat(btnPrefixCls, "-size-")).call(_context2, size), size), _defineProperty(_classNames, _concatInstanceProperty(_context3 = "".concat(btnPrefixCls, "-shape-")).call(_context3, shape), shape && !isTextBtn), _defineProperty(_classNames, "".concat(btnPrefixCls, "-no-border"), !bordered), _defineProperty(_classNames, "".concat(btnPrefixCls, "-background-ghost"), ghost && !disabled), _defineProperty(_classNames, "".concat(btnPrefixCls, "-loading"), loading && !isTextBtn), _defineProperty(_classNames, "".concat(btnPrefixCls, "-block"), block && !shape), _defineProperty(_classNames, "".concat(btnPrefixCls, "-icon-only"), !children && children !== 0 && icon), _classNames));
|
|
91
80
|
var iconWrapperClassName = _concatInstanceProperty(_context4 = "".concat(btnPrefixCls, "-iconWrapper-")).call(_context4, iconPlace === 'left' ? 'left' : 'right');
|
|
92
|
-
var iconNode = icon && !loading ?
|
|
81
|
+
var iconNode = icon && !loading ? React.createElement("span", {
|
|
93
82
|
className: iconWrapperClassName
|
|
94
|
-
}, icon) : loading ?
|
|
83
|
+
}, icon) : loading ? React.createElement("span", {
|
|
95
84
|
className: iconWrapperClassName
|
|
96
|
-
},
|
|
85
|
+
}, React.createElement(Icon, {
|
|
97
86
|
className: _concatInstanceProperty(_context5 = "".concat(btnPrefixCls, "-")).call(_context5, type === ButtonTypes[1] ? 'primary-loadingIcon' : 'loadingIcon'),
|
|
98
87
|
type: "loadding",
|
|
99
88
|
spin: true
|
|
@@ -101,14 +90,14 @@ var InternalButton = function InternalButton(props, ref) {
|
|
|
101
90
|
var btnChild = handleChild(children);
|
|
102
91
|
switch (type) {
|
|
103
92
|
case 'text':
|
|
104
|
-
return
|
|
93
|
+
return React.createElement("span", _extends({
|
|
105
94
|
ref: buttonRef,
|
|
106
95
|
className: btnClasses,
|
|
107
96
|
onClick: handleClick,
|
|
108
97
|
disabled: disabled
|
|
109
98
|
}, others), iconNode, children);
|
|
110
99
|
default:
|
|
111
|
-
return
|
|
100
|
+
return React.createElement("button", _extends({
|
|
112
101
|
ref: buttonRef,
|
|
113
102
|
className: btnClasses,
|
|
114
103
|
onClick: handleClick,
|
|
@@ -116,13 +105,13 @@ var InternalButton = function InternalButton(props, ref) {
|
|
|
116
105
|
type: htmlType
|
|
117
106
|
}, others, {
|
|
118
107
|
"click-animating-wave": "false"
|
|
119
|
-
}), iconPlace === 'left' ?
|
|
108
|
+
}), iconPlace === 'left' ? React.createElement(React.Fragment, null, iconNode, !!(iconNode && children) && React.createElement("span", {
|
|
120
109
|
className: "btn-space"
|
|
121
|
-
}), btnChild) :
|
|
110
|
+
}), btnChild) : React.createElement(React.Fragment, null, btnChild, !!(iconNode && children) && React.createElement("span", {
|
|
122
111
|
className: "btn-space"
|
|
123
112
|
}), iconNode));
|
|
124
113
|
}
|
|
125
114
|
};
|
|
126
|
-
var Button =
|
|
115
|
+
var Button = React.forwardRef(InternalButton);
|
|
127
116
|
Button.displayName = 'Button';
|
|
128
117
|
export default Button;
|
package/es/button/group.js
CHANGED
|
@@ -36,7 +36,7 @@ var InternalButtonGroup = function InternalButtonGroup(props, ref) {
|
|
|
36
36
|
var _useState = useState(false),
|
|
37
37
|
_useState2 = _slicedToArray(_useState, 2),
|
|
38
38
|
optionShow = _useState2[0],
|
|
39
|
-
setOptionShow = _useState2[1];
|
|
39
|
+
setOptionShow = _useState2[1];
|
|
40
40
|
var refBtnGroup = React.useRef(null) || ref;
|
|
41
41
|
var triggerRef = React.useRef(null);
|
|
42
42
|
var isBsicType = type === 'basic';
|
|
@@ -46,39 +46,39 @@ var InternalButtonGroup = function InternalButtonGroup(props, ref) {
|
|
|
46
46
|
var _toArray = toArray(icon),
|
|
47
47
|
_toArray2 = _slicedToArray(_toArray, 2),
|
|
48
48
|
_toArray2$ = _toArray2[0],
|
|
49
|
-
iconUp = _toArray2$ === void 0 ?
|
|
49
|
+
iconUp = _toArray2$ === void 0 ? React.createElement(Icon, {
|
|
50
50
|
type: "arrow-up"
|
|
51
51
|
}) : _toArray2$,
|
|
52
52
|
_toArray2$2 = _toArray2[1],
|
|
53
|
-
iconDown = _toArray2$2 === void 0 ?
|
|
53
|
+
iconDown = _toArray2$2 === void 0 ? React.createElement(Icon, {
|
|
54
54
|
type: "arrow-down"
|
|
55
55
|
}) : _toArray2$2;
|
|
56
|
-
return
|
|
56
|
+
return React.createElement("div", {
|
|
57
57
|
style: style,
|
|
58
58
|
className: btnGroupClasses,
|
|
59
59
|
ref: refBtnGroup
|
|
60
|
-
}, isBsicType &&
|
|
60
|
+
}, isBsicType && React.createElement(Button, {
|
|
61
61
|
type: buttonType,
|
|
62
62
|
size: size,
|
|
63
63
|
disabled: disabled,
|
|
64
64
|
loading: loading
|
|
65
|
-
}, children,
|
|
65
|
+
}, children, React.createElement("span", {
|
|
66
66
|
className: "".concat(btnGroupPrefixCls, "-basic-icon")
|
|
67
|
-
}, optionShow ? iconUp : iconDown)), !isBsicType &&
|
|
67
|
+
}, optionShow ? iconUp : iconDown)), !isBsicType && React.createElement(Button, {
|
|
68
68
|
type: buttonType,
|
|
69
69
|
size: size,
|
|
70
70
|
disabled: disabled,
|
|
71
71
|
onClick: onClick,
|
|
72
72
|
loading: loading
|
|
73
|
-
}, children), !isBsicType &&
|
|
73
|
+
}, children), !isBsicType && React.createElement("span", {
|
|
74
74
|
className: "".concat(btnGroupPrefixCls, "-trigger"),
|
|
75
75
|
ref: triggerRef
|
|
76
|
-
}, optionShow ?
|
|
76
|
+
}, optionShow ? React.createElement(Button, {
|
|
77
77
|
icon: iconUp,
|
|
78
78
|
type: buttonType,
|
|
79
79
|
size: size,
|
|
80
80
|
disabled: disabled
|
|
81
|
-
}) :
|
|
81
|
+
}) : React.createElement(Button, {
|
|
82
82
|
icon: iconDown,
|
|
83
83
|
type: buttonType,
|
|
84
84
|
size: size,
|
|
@@ -91,10 +91,10 @@ var InternalButtonGroup = function InternalButtonGroup(props, ref) {
|
|
|
91
91
|
}, [onItemClick]);
|
|
92
92
|
var renderContent = useCallback(function () {
|
|
93
93
|
var _context2;
|
|
94
|
-
return
|
|
94
|
+
return React.createElement("div", {
|
|
95
95
|
className: "".concat(btnGroupPrefixCls, "-dropdown")
|
|
96
96
|
}, _mapInstanceProperty(_context2 = overlay || []).call(_context2, function (item) {
|
|
97
|
-
return
|
|
97
|
+
return React.createElement("div", {
|
|
98
98
|
key: item.value,
|
|
99
99
|
className: "".concat(btnGroupPrefixCls, "-dropdown-item"),
|
|
100
100
|
onClick: function onClick() {
|
|
@@ -122,6 +122,6 @@ var InternalButtonGroup = function InternalButtonGroup(props, ref) {
|
|
|
122
122
|
});
|
|
123
123
|
return usePopper(renderTriggerButton(), renderContent(), popperProps);
|
|
124
124
|
};
|
|
125
|
-
var ButtonGroup =
|
|
125
|
+
var ButtonGroup = React.forwardRef(InternalButtonGroup);
|
|
126
126
|
ButtonGroup.displayName = 'ButtonGroup';
|
|
127
127
|
export default ButtonGroup;
|
package/es/card/card.js
CHANGED
|
@@ -13,12 +13,11 @@ import classNames from 'classnames';
|
|
|
13
13
|
import Checkbox from '../checkbox';
|
|
14
14
|
import { getCompProps } from '../_utils';
|
|
15
15
|
import { ConfigContext } from '../config-provider';
|
|
16
|
-
var Card =
|
|
16
|
+
var Card = React.forwardRef(function (props, ref) {
|
|
17
17
|
var _React$useContext = React.useContext(ConfigContext),
|
|
18
18
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
19
19
|
pkgPrefixCls = _React$useContext.prefixCls,
|
|
20
20
|
userDefaultProps = _React$useContext.compDefaultProps;
|
|
21
|
-
// 属性需要合并一遍用户定义的默认属性
|
|
22
21
|
var _a = getCompProps('Card', userDefaultProps, props),
|
|
23
22
|
tags = _a.tags,
|
|
24
23
|
style = _a.style,
|
|
@@ -35,38 +34,37 @@ var Card = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
35
34
|
checkboxProps = _a.checkboxProps,
|
|
36
35
|
customPrefixcls = _a.prefixCls,
|
|
37
36
|
others = __rest(_a, ["tags", "style", "title", "avatar", "actions", "extra", "children", "className", "hoverable", "headStyle", "bodyStyle", "selectable", "checkboxProps", "prefixCls"]);
|
|
38
|
-
// className前缀
|
|
39
37
|
var prefixCls = getPrefixCls(pkgPrefixCls, 'card', customPrefixcls);
|
|
40
38
|
var cardClassName = classNames(prefixCls, {
|
|
41
39
|
hoverable: hoverable
|
|
42
40
|
}, className);
|
|
43
|
-
return
|
|
41
|
+
return React.createElement("div", _extends({
|
|
44
42
|
ref: ref,
|
|
45
43
|
className: cardClassName,
|
|
46
44
|
style: style
|
|
47
|
-
}, others), title && !avatar &&
|
|
45
|
+
}, others), title && !avatar && React.createElement("header", {
|
|
48
46
|
className: "".concat(prefixCls, "-header"),
|
|
49
47
|
style: headStyle
|
|
50
|
-
}, title), avatar &&
|
|
48
|
+
}, title), avatar && React.createElement("header", {
|
|
51
49
|
className: "".concat(prefixCls, "-avatar")
|
|
52
|
-
},
|
|
50
|
+
}, React.createElement("div", {
|
|
53
51
|
className: classNames("".concat(prefixCls, "-avatar-img"), {
|
|
54
52
|
circle: !avatar.square
|
|
55
53
|
})
|
|
56
|
-
},
|
|
54
|
+
}, React.createElement("img", {
|
|
57
55
|
src: avatar.src
|
|
58
|
-
})),
|
|
56
|
+
})), React.createElement("div", null, React.createElement("h4", {
|
|
59
57
|
className: "".concat(prefixCls, "-avatar-title")
|
|
60
|
-
}, avatar.title),
|
|
58
|
+
}, avatar.title), React.createElement("span", {
|
|
61
59
|
className: "".concat(prefixCls, "-avatar-desc")
|
|
62
|
-
}, avatar.description))), selectable &&
|
|
60
|
+
}, avatar.description))), selectable && React.createElement(Checkbox, _extends({}, checkboxProps)), tags && React.createElement("div", {
|
|
63
61
|
className: "".concat(prefixCls, "-tags")
|
|
64
|
-
}, tags),
|
|
62
|
+
}, tags), React.createElement("div", {
|
|
65
63
|
className: "".concat(prefixCls, "-body"),
|
|
66
64
|
style: bodyStyle
|
|
67
|
-
}, children), actions &&
|
|
65
|
+
}, children), actions && React.createElement("div", {
|
|
68
66
|
className: "".concat(prefixCls, "-actions")
|
|
69
|
-
}, actions), extra &&
|
|
67
|
+
}, actions), extra && React.createElement("div", {
|
|
70
68
|
className: "".concat(prefixCls, "-extra")
|
|
71
69
|
}, extra));
|
|
72
70
|
});
|
package/es/carousel/carousel.js
CHANGED
|
@@ -38,7 +38,7 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
38
38
|
style = carouselProps.style;
|
|
39
39
|
devWarning(DotPositionTypes.indexOf(dotPosition) === -1, 'carousel', "cannot found dotPosition type '".concat(dotPosition, "'"));
|
|
40
40
|
devWarning(EffectTypes.indexOf(effect) === -1, 'carousel', "cannot found effect type '".concat(effect, "'"));
|
|
41
|
-
var carouselPrefixCls = getPrefixCls(prefixCls, 'carousel', customPrefixcls);
|
|
41
|
+
var carouselPrefixCls = getPrefixCls(prefixCls, 'carousel', customPrefixcls);
|
|
42
42
|
var _React$useState = React.useState(0),
|
|
43
43
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
44
44
|
itemWidth = _React$useState2[0],
|
|
@@ -125,7 +125,7 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
125
125
|
return;
|
|
126
126
|
}
|
|
127
127
|
var contentRect = entries[0].contentRect;
|
|
128
|
-
var hide = contentRect.width === 0 && contentRect.height === 0;
|
|
128
|
+
var hide = contentRect.width === 0 && contentRect.height === 0;
|
|
129
129
|
var bottom = contentRect.bottom,
|
|
130
130
|
height = contentRect.height,
|
|
131
131
|
left = contentRect.left,
|
|
@@ -209,7 +209,7 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
209
209
|
var tempChild = processChildren(children);
|
|
210
210
|
var content;
|
|
211
211
|
if (isFadeEffect) {
|
|
212
|
-
content =
|
|
212
|
+
content = React.createElement(FadeList, {
|
|
213
213
|
items: tempChild,
|
|
214
214
|
parentPrefixCls: carouselPrefixCls,
|
|
215
215
|
needAnimation: needAnimation,
|
|
@@ -218,14 +218,14 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
218
218
|
itemWidth: itemWidth
|
|
219
219
|
});
|
|
220
220
|
} else if (isNoneEffect) {
|
|
221
|
-
content =
|
|
221
|
+
content = React.createElement(DisplayList, {
|
|
222
222
|
items: tempChild,
|
|
223
223
|
parentPrefixCls: carouselPrefixCls,
|
|
224
224
|
currentIndex: currentIndex,
|
|
225
225
|
ref: listRef
|
|
226
226
|
});
|
|
227
227
|
} else {
|
|
228
|
-
content =
|
|
228
|
+
content = React.createElement(SlideList, {
|
|
229
229
|
items: tempChild,
|
|
230
230
|
parentPrefixCls: carouselPrefixCls,
|
|
231
231
|
currentIndex: currentIndex,
|
|
@@ -266,25 +266,25 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
266
266
|
onClick: onClick
|
|
267
267
|
});
|
|
268
268
|
};
|
|
269
|
-
var leftNode =
|
|
269
|
+
var leftNode = React.createElement("div", {
|
|
270
270
|
className: classNames(jumpClassPrefix, "".concat(jumpClassPrefix, "-left"), _defineProperty({}, "".concat(jumpClassPrefix, "-disabled"), currentIndex <= 0))
|
|
271
|
-
}, Array.isArray(jumpNode) && jumpNode.length > 0 &&
|
|
271
|
+
}, Array.isArray(jumpNode) && jumpNode.length > 0 && isValidElement(jumpNode[0]) ? React.cloneElement(jumpNode[0], mergeNode(jumpNode[0], 'left')) : React.createElement(Icon, {
|
|
272
272
|
className: "".concat(jumpClassPrefix, "-icon"),
|
|
273
273
|
type: 'arrow-left-circle-solid',
|
|
274
274
|
onClick: leftClick
|
|
275
275
|
}));
|
|
276
|
-
var rightNode =
|
|
276
|
+
var rightNode = React.createElement("div", {
|
|
277
277
|
className: classNames(jumpClassPrefix, "".concat(jumpClassPrefix, "-right"), _defineProperty({}, "".concat(jumpClassPrefix, "-disabled"), currentIndex >= tempChild.length - 1))
|
|
278
|
-
}, Array.isArray(jumpNode) && jumpNode.length > 1 &&
|
|
278
|
+
}, Array.isArray(jumpNode) && jumpNode.length > 1 && isValidElement(jumpNode[1]) ? React.cloneElement(jumpNode[1], mergeNode(jumpNode[1], 'right')) : React.createElement(Icon, {
|
|
279
279
|
className: "".concat(jumpClassPrefix, "-icon"),
|
|
280
280
|
type: 'arrow-right-circle-solid',
|
|
281
281
|
onClick: rightClick
|
|
282
282
|
}));
|
|
283
|
-
return
|
|
283
|
+
return React.createElement(React.Fragment, null, leftNode, rightNode);
|
|
284
284
|
}
|
|
285
285
|
return null;
|
|
286
286
|
};
|
|
287
|
-
return
|
|
287
|
+
return React.createElement("div", {
|
|
288
288
|
className: rootClassName,
|
|
289
289
|
ref: carouselRef,
|
|
290
290
|
onTransitionEnd: function onTransitionEnd() {
|
|
@@ -293,7 +293,7 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
293
293
|
style: style,
|
|
294
294
|
onMouseEnter: handleMouseEnter,
|
|
295
295
|
onMouseLeave: handleMouseLeave
|
|
296
|
-
}, (tempChild === null || tempChild === void 0 ? void 0 : tempChild.length) ? renderDisplayList() : null, (tempChild === null || tempChild === void 0 ? void 0 : tempChild.length) && showDot() ?
|
|
296
|
+
}, (tempChild === null || tempChild === void 0 ? void 0 : tempChild.length) ? renderDisplayList() : null, (tempChild === null || tempChild === void 0 ? void 0 : tempChild.length) && showDot() ? React.createElement(Slidebar, {
|
|
297
297
|
number: tempChild.length,
|
|
298
298
|
currentIndex: currentIndex,
|
|
299
299
|
dotsClassName: dots,
|
|
@@ -302,6 +302,6 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
302
302
|
onClick: handleClick
|
|
303
303
|
}) : null, renderJumpNode());
|
|
304
304
|
};
|
|
305
|
-
var Carousel =
|
|
305
|
+
var Carousel = React.forwardRef(InternalCarousel);
|
|
306
306
|
Carousel.displayName = 'Carousel';
|
|
307
307
|
export default Carousel;
|
|
@@ -2,7 +2,7 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
|
|
|
2
2
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
-
export var DisplayList =
|
|
5
|
+
export var DisplayList = React.forwardRef(function (props, ref) {
|
|
6
6
|
var _context;
|
|
7
7
|
var items = props.items,
|
|
8
8
|
parentPrefixCls = props.parentPrefixCls,
|
|
@@ -13,14 +13,14 @@ export var DisplayList = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
13
13
|
var renderItems = function renderItems() {
|
|
14
14
|
return _mapInstanceProperty(items).call(items, function (item, index) {
|
|
15
15
|
var opacityClassName = index === currentIndex ? "".concat(listPrefixCls, "-item-not-hidden") : "".concat(listPrefixCls, "-item-hidden");
|
|
16
|
-
return
|
|
16
|
+
return React.createElement("li", {
|
|
17
17
|
className: classNames("".concat(listPrefixCls, "-item"), opacityClassName),
|
|
18
18
|
key: index,
|
|
19
19
|
ref: itemRef
|
|
20
20
|
}, item);
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
|
-
return
|
|
23
|
+
return React.createElement("ul", {
|
|
24
24
|
className: _concatInstanceProperty(_context = "".concat(listPrefixCls, " ")).call(_context, displayListPrefixCls),
|
|
25
25
|
ref: ref
|
|
26
26
|
}, renderItems());
|
package/es/carousel/fadeList.js
CHANGED
|
@@ -2,7 +2,7 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
|
|
|
2
2
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
-
export var FadeList =
|
|
5
|
+
export var FadeList = React.forwardRef(function (props, ref) {
|
|
6
6
|
var _context;
|
|
7
7
|
var items = props.items,
|
|
8
8
|
parentPrefixCls = props.parentPrefixCls,
|
|
@@ -17,7 +17,7 @@ export var FadeList = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
17
17
|
var opacityClassName = index === currentIndex ? "".concat(listPrefixCls, "-item-not-hidden") : "".concat(listPrefixCls, "-item-hidden");
|
|
18
18
|
var animationClassName = needAnimation ? "".concat(listPrefixCls, "-item-animation") : "".concat(listPrefixCls, "-item-none-animation");
|
|
19
19
|
var posx = -1 * index * itemWidth;
|
|
20
|
-
return
|
|
20
|
+
return React.createElement("li", {
|
|
21
21
|
className: classNames("".concat(listPrefixCls, "-item"), opacityClassName, animationClassName),
|
|
22
22
|
key: index,
|
|
23
23
|
ref: itemRef,
|
|
@@ -27,7 +27,7 @@ export var FadeList = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
27
27
|
}, item);
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
|
-
return
|
|
30
|
+
return React.createElement("ul", {
|
|
31
31
|
className: _concatInstanceProperty(_context = "".concat(listPrefixCls, " ")).call(_context, fadeListPrefixCls),
|
|
32
32
|
ref: ref
|
|
33
33
|
}, renderItems());
|
package/es/carousel/slideList.js
CHANGED
|
@@ -4,7 +4,7 @@ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instan
|
|
|
4
4
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import React from 'react';
|
|
7
|
-
export var SlideList =
|
|
7
|
+
export var SlideList = React.forwardRef(function (props, ref) {
|
|
8
8
|
var _context2;
|
|
9
9
|
var items = props.items,
|
|
10
10
|
parentPrefixCls = props.parentPrefixCls,
|
|
@@ -13,15 +13,15 @@ export var SlideList = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
13
13
|
var listPrefixCls = "".concat(parentPrefixCls, "-list");
|
|
14
14
|
var renderItems = function renderItems() {
|
|
15
15
|
var _context;
|
|
16
|
-
var _items = items.length > 1 ? _concatInstanceProperty(_context = _sliceInstanceProperty(items).call(items, -1)).call(_context, items, _sliceInstanceProperty(items).call(items, 0, 1)) : items;
|
|
16
|
+
var _items = items.length > 1 ? _concatInstanceProperty(_context = _sliceInstanceProperty(items).call(items, -1)).call(_context, items, _sliceInstanceProperty(items).call(items, 0, 1)) : items;
|
|
17
17
|
return _mapInstanceProperty(_items).call(_items, function (item, index) {
|
|
18
|
-
return
|
|
18
|
+
return React.createElement("li", {
|
|
19
19
|
className: classNames("".concat(listPrefixCls, "-item"), _defineProperty({}, "".concat(listPrefixCls, "-item-active"), currentIndex === index - 1)),
|
|
20
20
|
key: index
|
|
21
21
|
}, item);
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
|
-
return
|
|
24
|
+
return React.createElement("ul", {
|
|
25
25
|
className: _concatInstanceProperty(_context2 = "".concat(listPrefixCls, " ")).call(_context2, slideListPrefixCls),
|
|
26
26
|
ref: ref
|
|
27
27
|
}, renderItems());
|
package/es/carousel/slidebar.js
CHANGED
|
@@ -18,10 +18,10 @@ export var Slidebar = function Slidebar(props) {
|
|
|
18
18
|
var _loop = function _loop(i) {
|
|
19
19
|
var _classNames2, _classNames3;
|
|
20
20
|
var dotClassName = isObject(dotsClassName) ? classNames((_classNames2 = {}, _defineProperty(_classNames2, "".concat(dotsClassName.dotsClassName), true), _defineProperty(_classNames2, "".concat(dotsClassName.activeDotsClassName), i === currentIndex), _classNames2)) : classNames((_classNames3 = {}, _defineProperty(_classNames3, "".concat(slideBarPrefixCls, "-dot"), true), _defineProperty(_classNames3, "".concat(slideBarPrefixCls, "-dot-active"), i === currentIndex), _classNames3));
|
|
21
|
-
var li =
|
|
21
|
+
var li = React.createElement("li", {
|
|
22
22
|
key: i,
|
|
23
23
|
className: dotClassName
|
|
24
|
-
},
|
|
24
|
+
}, React.createElement("button", {
|
|
25
25
|
onClick: function onClick() {
|
|
26
26
|
return _onClick(i);
|
|
27
27
|
}
|
|
@@ -33,7 +33,7 @@ export var Slidebar = function Slidebar(props) {
|
|
|
33
33
|
}
|
|
34
34
|
return element;
|
|
35
35
|
};
|
|
36
|
-
return
|
|
36
|
+
return React.createElement("ul", {
|
|
37
37
|
className: slideClassName
|
|
38
38
|
}, renderDot());
|
|
39
39
|
};
|
package/es/cascader/cascader.js
CHANGED
|
@@ -46,19 +46,18 @@ var CascaderMenuSubmenu = function CascaderMenuSubmenu(props) {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}, [selected]);
|
|
49
|
-
return
|
|
49
|
+
return React.createElement("li", _extends({
|
|
50
50
|
ref: ref
|
|
51
51
|
}, optionProps, {
|
|
52
52
|
title: label
|
|
53
53
|
}), children);
|
|
54
54
|
};
|
|
55
|
-
var Cascader =
|
|
55
|
+
var Cascader = React.forwardRef(function (props, ref) {
|
|
56
56
|
var _React$useContext = React.useContext(ConfigContext),
|
|
57
57
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
58
58
|
pkgPrefixCls = _React$useContext.prefixCls,
|
|
59
59
|
userDefaultProps = _React$useContext.compDefaultProps,
|
|
60
60
|
locale = _React$useContext.locale;
|
|
61
|
-
// 属性需要合并一遍用户定义的默认属性
|
|
62
61
|
var allProps = getCompProps('Cascader', userDefaultProps, props);
|
|
63
62
|
var mode = allProps.mode,
|
|
64
63
|
style = allProps.style,
|
|
@@ -88,10 +87,7 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
88
87
|
popupPlacement = allProps.popupPlacement,
|
|
89
88
|
maxTagCount = allProps.maxTagCount,
|
|
90
89
|
autoFocus = allProps.autoFocus,
|
|
91
|
-
otherProps = __rest(allProps
|
|
92
|
-
// className前缀
|
|
93
|
-
, ["mode", "style", "options", "bordered", "disabled", "children", "loadData", "clearIcon", "className", "fieldNames", "placeholder", "defaultValue", "maxTagPlaceholder", "displayRender", "expandTrigger", "changeOnSelect", "dropdownRender", "notFoundContent", "getPopupContainer", "defaultPopupVisible", "onPopupVisibleChange", "onPopperVisibleChange", "prefixCls", "allowClear", "popupPlacement", "maxTagCount", "autoFocus"]);
|
|
94
|
-
// className前缀
|
|
90
|
+
otherProps = __rest(allProps, ["mode", "style", "options", "bordered", "disabled", "children", "loadData", "clearIcon", "className", "fieldNames", "placeholder", "defaultValue", "maxTagPlaceholder", "displayRender", "expandTrigger", "changeOnSelect", "dropdownRender", "notFoundContent", "getPopupContainer", "defaultPopupVisible", "onPopupVisibleChange", "onPopperVisibleChange", "prefixCls", "allowClear", "popupPlacement", "maxTagCount", "autoFocus"]);
|
|
95
91
|
var prefixCls = getPrefixCls(pkgPrefixCls, 'cascader', customPrefixcls);
|
|
96
92
|
var mergeRef = useRef();
|
|
97
93
|
var inputRef = useRef();
|
|
@@ -269,29 +265,28 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
269
265
|
var renderSuffix = function renderSuffix() {
|
|
270
266
|
var _classNames;
|
|
271
267
|
var suffixIcon = allProps.suffixIcon;
|
|
272
|
-
// 选择器下拉icon样式
|
|
273
268
|
var arrowIconCls = classNames((_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-icon-arrow"), true), _defineProperty(_classNames, "".concat(prefixCls, "-icon-arrow-up"), visible), _defineProperty(_classNames, "".concat(prefixCls, "-icon-arrow-down"), !visible), _defineProperty(_classNames, "".concat(prefixCls, "-icon-arrow-focus"), visible), _classNames));
|
|
274
269
|
var iconShow = allowClear && !disabled && currentOptions.length > 0;
|
|
275
270
|
var clearIconCls = classNames(_defineProperty({}, "".concat(prefixCls, "-icon-clear"), true));
|
|
276
|
-
return
|
|
271
|
+
return React.createElement(React.Fragment, null, iconShow ? React.createElement("span", {
|
|
277
272
|
onClick: handleClear,
|
|
278
273
|
className: clearIconCls
|
|
279
|
-
},
|
|
274
|
+
}, React.createElement(Icon, {
|
|
280
275
|
type: "close-solid"
|
|
281
|
-
}) || clearIcon) : null,
|
|
276
|
+
}) || clearIcon) : null, React.createElement("span", {
|
|
282
277
|
className: arrowIconCls
|
|
283
|
-
}, suffixIcon ||
|
|
278
|
+
}, suffixIcon || React.createElement(Icon, {
|
|
284
279
|
type: "arrow-down"
|
|
285
280
|
})));
|
|
286
281
|
};
|
|
287
282
|
var handleMaxTagHolder = useCallback(function () {
|
|
288
283
|
if (typeof maxTagPlaceholder === 'function') {
|
|
289
|
-
return
|
|
284
|
+
return React.createElement(Tag, {
|
|
290
285
|
type: "edit",
|
|
291
286
|
disabled: disabled
|
|
292
287
|
}, maxTagPlaceholder(currentOptions));
|
|
293
288
|
} else {
|
|
294
|
-
return
|
|
289
|
+
return React.createElement(Tag, {
|
|
295
290
|
type: "edit",
|
|
296
291
|
disabled: disabled
|
|
297
292
|
}, maxTagPlaceholder);
|
|
@@ -312,20 +307,20 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
312
307
|
var totalText = locale.getLangMsg('Cascader', 'total', {
|
|
313
308
|
total: currentOptions.length
|
|
314
309
|
});
|
|
315
|
-
return
|
|
310
|
+
return React.createElement("div", _extends({
|
|
316
311
|
className: multipleCls,
|
|
317
312
|
ref: mergeRef,
|
|
318
313
|
style: style
|
|
319
314
|
}, otherProps, {
|
|
320
315
|
tabIndex: -1
|
|
321
|
-
}),
|
|
316
|
+
}), React.createElement("div", {
|
|
322
317
|
className: "".concat(prefixCls, "-multiple-wrapper"),
|
|
323
318
|
ref: wrapperRef
|
|
324
|
-
}, Array.isArray(currentOptions) ?
|
|
325
|
-
return
|
|
319
|
+
}, Array.isArray(currentOptions) ? React.createElement(React.Fragment, null, _mapInstanceProperty(currentOptions).call(currentOptions, function (option, index) {
|
|
320
|
+
return React.createElement("span", {
|
|
326
321
|
key: _JSON$stringify(values[index]),
|
|
327
322
|
className: classNames("".concat(prefixCls, "-selection-tag"))
|
|
328
|
-
}, !maxTagCount || index <= maxTagCount - 1 ?
|
|
323
|
+
}, !maxTagCount || index <= maxTagCount - 1 ? React.createElement(Tag, {
|
|
329
324
|
type: "edit",
|
|
330
325
|
disabled: disabled,
|
|
331
326
|
style: TagStyle,
|
|
@@ -334,13 +329,13 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
334
329
|
return handleRemove(e, option);
|
|
335
330
|
}
|
|
336
331
|
}, displayRender(labels[index], option)) : null);
|
|
337
|
-
}), maxTagCount && currentOptions.length > maxTagCount ? maxTagPlaceholder ? handleMaxTagHolder() :
|
|
332
|
+
}), maxTagCount && currentOptions.length > maxTagCount ? maxTagPlaceholder ? handleMaxTagHolder() : React.createElement("span", {
|
|
338
333
|
className: itemCls
|
|
339
|
-
},
|
|
334
|
+
}, React.createElement("span", {
|
|
340
335
|
className: "".concat(prefixCls, "-tag-describe-content")
|
|
341
|
-
}, totalText)) : null) : null,
|
|
336
|
+
}, totalText)) : null) : null, React.createElement("span", {
|
|
342
337
|
className: "".concat(prefixCls, "-placeholder")
|
|
343
|
-
}, !currentOptions.length ? placeholder : null)),
|
|
338
|
+
}, !currentOptions.length ? placeholder : null)), React.createElement("span", {
|
|
344
339
|
ref: suffixRef,
|
|
345
340
|
className: "".concat(prefixCls, "-suffix")
|
|
346
341
|
}, renderSuffix()));
|
|
@@ -357,7 +352,7 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
357
352
|
className: classNames("".concat(prefixCls, "-picker-input"), {
|
|
358
353
|
expand: visible
|
|
359
354
|
}),
|
|
360
|
-
suffix: props.suffixIcon ||
|
|
355
|
+
suffix: props.suffixIcon || React.createElement(Icon, {
|
|
361
356
|
type: "arrow-down",
|
|
362
357
|
className: classNames({
|
|
363
358
|
expand: visible
|
|
@@ -369,14 +364,14 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
369
364
|
tabIndex: 0,
|
|
370
365
|
className: classNames("".concat(prefixCls, "-picker"), className, (_classNames5 = {}, _defineProperty(_classNames5, "".concat(prefixCls, "-single"), true), _defineProperty(_classNames5, "".concat(prefixCls, "-expand"), visible), _defineProperty(_classNames5, "allowClear", allowClear), _defineProperty(_classNames5, "".concat(prefixCls, "-disabled"), disabled), _defineProperty(_classNames5, "".concat(prefixCls, "-bordered"), bordered), _classNames5))
|
|
371
366
|
};
|
|
372
|
-
return
|
|
367
|
+
return React.createElement("div", _extends({}, singleProps, {
|
|
373
368
|
ref: mergeRef
|
|
374
|
-
}, otherProps), React.Children.count(children) === 1 && children.type ?
|
|
369
|
+
}, otherProps), React.Children.count(children) === 1 && children.type ? React.cloneElement(children) : React.createElement(React.Fragment, null, React.createElement("div", {
|
|
375
370
|
className: "".concat(prefixCls, "-single-wrapper"),
|
|
376
371
|
ref: wrapperRef
|
|
377
|
-
},
|
|
372
|
+
}, React.createElement(Input, _extends({}, inputProps)), React.createElement("span", {
|
|
378
373
|
className: "".concat(prefixCls, "-picker-label")
|
|
379
|
-
}, (labels === null || labels === void 0 ? void 0 : labels.length) ? displayRender(labels, currentOptions) : ''), allowClear ?
|
|
374
|
+
}, (labels === null || labels === void 0 ? void 0 : labels.length) ? displayRender(labels, currentOptions) : ''), allowClear ? React.createElement(Icon, {
|
|
380
375
|
type: "close-solid",
|
|
381
376
|
className: "".concat(prefixCls, "-picker-close"),
|
|
382
377
|
onClick: handleClear
|
|
@@ -438,8 +433,8 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
438
433
|
onPopperVisibleChange && onPopperVisibleChange(v);
|
|
439
434
|
v && setSelectedOptions(_sliceInstanceProperty(currentOptions).call(currentOptions, 0));
|
|
440
435
|
};
|
|
441
|
-
var cascaderMenus =
|
|
442
|
-
return
|
|
436
|
+
var cascaderMenus = React.createElement(React.Fragment, null, (options === null || options === void 0 ? void 0 : options.length) ? (menus === null || menus === void 0 ? void 0 : menus.length) ? _mapInstanceProperty(menus).call(menus, function (opts, index) {
|
|
437
|
+
return React.createElement("ul", {
|
|
443
438
|
key: index,
|
|
444
439
|
className: "".concat(prefixCls, "-menu")
|
|
445
440
|
}, (opts === null || opts === void 0 ? void 0 : opts.length) ? _mapInstanceProperty(opts).call(opts, function (opt) {
|
|
@@ -461,22 +456,22 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
461
456
|
if (!opt.disabled) {
|
|
462
457
|
optionProps[expendEvent] = isMultiple ? onMultipleExpend.bind(null, index, opt, children) : onExpend.bind(null, index, opt, children);
|
|
463
458
|
}
|
|
464
|
-
var node =
|
|
459
|
+
var node = React.createElement(React.Fragment, null, React.createElement("span", {
|
|
465
460
|
className: "".concat(prefixCls, "-menu-item-label")
|
|
466
|
-
}, label), loading ?
|
|
461
|
+
}, label), loading ? React.createElement(Icon, {
|
|
467
462
|
type: "loadding-circle",
|
|
468
463
|
spin: true
|
|
469
|
-
}) : (children === null || children === void 0 ? void 0 : children.length) || isLeaf === false ? props.expandIcon ||
|
|
464
|
+
}) : (children === null || children === void 0 ? void 0 : children.length) || isLeaf === false ? props.expandIcon || React.createElement(Icon, {
|
|
470
465
|
type: "arrow-right"
|
|
471
466
|
}) : null);
|
|
472
|
-
return
|
|
467
|
+
return React.createElement(CascaderMenuSubmenu, _extends({
|
|
473
468
|
key: value
|
|
474
469
|
}, {
|
|
475
470
|
isMultiple: isMultiple,
|
|
476
471
|
optionProps: optionProps,
|
|
477
472
|
label: label,
|
|
478
473
|
selected: selected
|
|
479
|
-
}), isMultiple ?
|
|
474
|
+
}), isMultiple ? React.createElement(React.Fragment, null, React.createElement(Checkbox, {
|
|
480
475
|
checked: getChecked(checkedKeys, value),
|
|
481
476
|
indeterminate: getHalfChecked(halfCheckedKeys, value),
|
|
482
477
|
disabled: opt.disabled,
|
|
@@ -486,7 +481,7 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
486
481
|
className: "".concat(prefixCls, "-checkbox")
|
|
487
482
|
}), node) : node);
|
|
488
483
|
}) : null);
|
|
489
|
-
}) : null :
|
|
484
|
+
}) : null : React.createElement(Empty, {
|
|
490
485
|
description: notFoundContent
|
|
491
486
|
}));
|
|
492
487
|
var cascaderPopper = dropdownRender(cascaderMenus);
|