@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/lib/dropdown/dropdown.js
CHANGED
|
@@ -28,13 +28,12 @@ var findItem = function findItem(element) {
|
|
|
28
28
|
return element.parentNode ? findItem(element.parentNode) : null;
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
var Dropdown =
|
|
31
|
+
var Dropdown = React.forwardRef(function (props, ref) {
|
|
32
32
|
var _a, _b, _c, _d;
|
|
33
33
|
var _React$useContext = React.useContext(_ConfigContext.default),
|
|
34
34
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
35
35
|
pkgPrefixCls = _React$useContext.prefixCls,
|
|
36
36
|
userDefaultProps = _React$useContext.compDefaultProps;
|
|
37
|
-
// 属性需要合并一遍用户定义的默认属性
|
|
38
37
|
var allProps = (0, _utils.getCompProps)('Dropdown', userDefaultProps, props);
|
|
39
38
|
var menu = allProps.menu,
|
|
40
39
|
disabled = allProps.disabled,
|
|
@@ -60,10 +59,10 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
60
59
|
props.visible === undefined && setVisible(visible);
|
|
61
60
|
onVisibleChange && onVisibleChange(visible);
|
|
62
61
|
};
|
|
63
|
-
var child = children && ((_a = children === null || children === void 0 ? void 0 : children.type) === null || _a === void 0 ? void 0 : _a.displayName) === 'Input' ?
|
|
62
|
+
var child = children && ((_a = children === null || children === void 0 ? void 0 : children.type) === null || _a === void 0 ? void 0 : _a.displayName) === 'Input' ? React.createElement("span", {
|
|
64
63
|
className: (0, _classnames.default)("".concat(prefixCls, "-trigger"), "".concat(prefixCls, "-trigger-container")),
|
|
65
64
|
ref: ref
|
|
66
|
-
}, trigger === 'focus' ?
|
|
65
|
+
}, trigger === 'focus' ? React.cloneElement(React.Children.only(children), {
|
|
67
66
|
onFocus: function onFocus(e) {
|
|
68
67
|
children.props.onFocus && children.props.onFocus(e);
|
|
69
68
|
handleVisibleChange(true);
|
|
@@ -72,9 +71,9 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
72
71
|
children.props.onBlur && children.props.onBlur(e);
|
|
73
72
|
handleVisibleChange(false);
|
|
74
73
|
}
|
|
75
|
-
}) : children) :
|
|
76
|
-
ref:
|
|
77
|
-
className: (0, _classnames.default)("".concat(prefixCls, "-trigger"),
|
|
74
|
+
}) : children) : React.cloneElement(React.isValidElement(children) && !(0, _reactNode.isFragment)(children) ? children : React.createElement("span", null, children), {
|
|
75
|
+
ref: React.isValidElement(children) && !(0, _reactNode.isFragment)(children) && children.ref ? children.ref : ref,
|
|
76
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-trigger"), React.isValidElement(children) && !(0, _reactNode.isFragment)(children) && children.props && children.props.className, {
|
|
78
77
|
disabled: disabled
|
|
79
78
|
})
|
|
80
79
|
});
|
|
@@ -103,12 +102,12 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
103
102
|
props.visible === undefined && setVisible(false);
|
|
104
103
|
}
|
|
105
104
|
};
|
|
106
|
-
var cloneObj =
|
|
105
|
+
var cloneObj = React.cloneElement(menu, {
|
|
107
106
|
selectedKey: selectedKey,
|
|
108
107
|
onClick: handleItemClick,
|
|
109
108
|
selectable: menuSelectable
|
|
110
109
|
});
|
|
111
|
-
var menuElement = isMenu ? cloneObj :
|
|
110
|
+
var menuElement = isMenu ? cloneObj : React.createElement("ul", {
|
|
112
111
|
className: "".concat(prefixCls, "-menu"),
|
|
113
112
|
onClick: handleItemClick,
|
|
114
113
|
role: "menu"
|
|
@@ -126,7 +125,7 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
126
125
|
};
|
|
127
126
|
var key = itemKey || label;
|
|
128
127
|
var selected = selectable && String(selectedKey) === String(key);
|
|
129
|
-
return
|
|
128
|
+
return React.createElement("li", {
|
|
130
129
|
title: label,
|
|
131
130
|
key: key,
|
|
132
131
|
"data-key": key,
|
|
@@ -137,7 +136,7 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
137
136
|
selected: selected
|
|
138
137
|
}),
|
|
139
138
|
role: "menuitem"
|
|
140
|
-
}, href === undefined || disabled ?
|
|
139
|
+
}, href === undefined || disabled ? React.createElement("span", null, label) : React.createElement("a", (0, _extends2.default)({}, alinkProps), React.createElement("span", null, label)));
|
|
141
140
|
}));
|
|
142
141
|
var popperProps = (0, _extends2.default)((0, _extends2.default)({}, allProps), {
|
|
143
142
|
visible: visible,
|
package/lib/dropdown/menu.js
CHANGED
|
@@ -25,13 +25,12 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
25
25
|
}
|
|
26
26
|
return t;
|
|
27
27
|
};
|
|
28
|
-
var Menu =
|
|
28
|
+
var Menu = React.forwardRef(function (props, ref) {
|
|
29
29
|
var _context;
|
|
30
30
|
var _React$useContext = React.useContext(_configProvider.ConfigContext),
|
|
31
31
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
32
32
|
pkgPrefixCls = _React$useContext.prefixCls,
|
|
33
33
|
userDefaultProps = _React$useContext.compDefaultProps;
|
|
34
|
-
// 属性需要合并一遍用户定义的默认属性
|
|
35
34
|
var _a = (0, _utils.getCompProps)('DropdownMenu', userDefaultProps, props),
|
|
36
35
|
customPrefixcls = _a.prefixCls,
|
|
37
36
|
children = _a.children,
|
|
@@ -39,21 +38,20 @@ var Menu = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
39
38
|
selectedKey = _a.selectedKey,
|
|
40
39
|
className = _a.className,
|
|
41
40
|
restProps = __rest(_a, ["prefixCls", "children", "selectable", "selectedKey", "className"]);
|
|
42
|
-
// className前缀
|
|
43
41
|
var prefixCls = getPrefixCls(pkgPrefixCls, 'dropdown-menu', customPrefixcls);
|
|
44
42
|
var cloneItem = function cloneItem(item, index) {
|
|
45
|
-
if (!
|
|
43
|
+
if (!React.isValidElement(item)) {
|
|
46
44
|
return item;
|
|
47
45
|
}
|
|
48
46
|
var key = item.key || index;
|
|
49
47
|
var selected = selectable && String(selectedKey) === String(key);
|
|
50
|
-
return
|
|
48
|
+
return React.cloneElement(item, {
|
|
51
49
|
key: key,
|
|
52
50
|
selected: selected,
|
|
53
51
|
defaultKey: key
|
|
54
52
|
});
|
|
55
53
|
};
|
|
56
|
-
return
|
|
54
|
+
return React.createElement("ul", (0, _extends2.default)({
|
|
57
55
|
className: (0, _classnames.default)(prefixCls, className),
|
|
58
56
|
role: "menu"
|
|
59
57
|
}, restProps, {
|
|
@@ -67,7 +65,6 @@ var Item = function Item(props) {
|
|
|
67
65
|
getPrefixCls = _React$useContext2.getPrefixCls,
|
|
68
66
|
pkgPrefixCls = _React$useContext2.prefixCls,
|
|
69
67
|
userDefaultProps = _React$useContext2.compDefaultProps;
|
|
70
|
-
// 属性需要合并一遍用户定义的默认属性
|
|
71
68
|
var _c = (0, _utils.getCompProps)('DropdownItem', userDefaultProps, props),
|
|
72
69
|
customPrefixcls = _c.prefixCls,
|
|
73
70
|
danger = _c.danger,
|
|
@@ -78,12 +75,11 @@ var Item = function Item(props) {
|
|
|
78
75
|
defaultKey = _c.defaultKey,
|
|
79
76
|
className = _c.className,
|
|
80
77
|
restProps = __rest(_c, ["prefixCls", "danger", "divided", "disabled", "children", "selected", "defaultKey", "className"]);
|
|
81
|
-
// className前缀
|
|
82
78
|
var prefixCls = getPrefixCls(pkgPrefixCls, 'dropdown-menu-item', customPrefixcls);
|
|
83
79
|
var childrenIsLink = children.type === 'a';
|
|
84
|
-
var linkChildren =
|
|
80
|
+
var linkChildren = React.createElement("span", null, (_a = children.props) === null || _a === void 0 ? void 0 : _a.children);
|
|
85
81
|
var itemRef = React.useRef();
|
|
86
|
-
return
|
|
82
|
+
return React.createElement("li", (0, _extends2.default)({
|
|
87
83
|
ref: itemRef,
|
|
88
84
|
"data-key": defaultKey,
|
|
89
85
|
title: (_b = itemRef.current) === null || _b === void 0 ? void 0 : _b.textContent,
|
|
@@ -94,9 +90,9 @@ var Item = function Item(props) {
|
|
|
94
90
|
selected: selected
|
|
95
91
|
}),
|
|
96
92
|
role: "menuitem"
|
|
97
|
-
}, restProps), childrenIsLink ? disabled ? linkChildren :
|
|
93
|
+
}, restProps), childrenIsLink ? disabled ? linkChildren : React.cloneElement(children, {
|
|
98
94
|
children: linkChildren
|
|
99
|
-
}) :
|
|
95
|
+
}) : React.createElement("span", null, children));
|
|
100
96
|
};
|
|
101
97
|
exports.Item = Item;
|
|
102
98
|
Menu.displayName = 'DropdownMenu';
|
|
@@ -19,7 +19,7 @@ function DefaultEmptyImg(props) {
|
|
|
19
19
|
prefixCls = _useContext.prefixCls;
|
|
20
20
|
var emptyPrefixCls = getPrefixCls(prefixCls, 'empty');
|
|
21
21
|
var linearGradientId = (0, _uniqueId.default)(emptyPrefixCls + '-default-linearGradient');
|
|
22
|
-
return
|
|
22
|
+
return _react.default.createElement("svg", {
|
|
23
23
|
className: "".concat(emptyPrefixCls, "-image"),
|
|
24
24
|
width: "168px",
|
|
25
25
|
height: "96px",
|
|
@@ -27,77 +27,77 @@ function DefaultEmptyImg(props) {
|
|
|
27
27
|
version: "1.1",
|
|
28
28
|
xmlns: "http://www.w3.org/2000/svg",
|
|
29
29
|
style: props.style
|
|
30
|
-
},
|
|
30
|
+
}, _react.default.createElement("defs", null, _react.default.createElement("linearGradient", {
|
|
31
31
|
x1: "50%",
|
|
32
32
|
y1: "0%",
|
|
33
33
|
x2: "50%",
|
|
34
34
|
y2: "100%",
|
|
35
35
|
id: linearGradientId
|
|
36
|
-
},
|
|
36
|
+
}, _react.default.createElement("stop", {
|
|
37
37
|
stopColor: "#D6DCE7",
|
|
38
38
|
offset: "0%"
|
|
39
|
-
}),
|
|
39
|
+
}), _react.default.createElement("stop", {
|
|
40
40
|
stopColor: "#D6DCE7",
|
|
41
41
|
stopOpacity: "0",
|
|
42
42
|
offset: "100%"
|
|
43
|
-
}))),
|
|
43
|
+
}))), _react.default.createElement("g", {
|
|
44
44
|
id: "\u9875\u9762-1",
|
|
45
45
|
stroke: "none",
|
|
46
46
|
strokeWidth: "1",
|
|
47
47
|
fill: "none",
|
|
48
48
|
fillRule: "evenodd"
|
|
49
|
-
},
|
|
49
|
+
}, _react.default.createElement("g", {
|
|
50
50
|
id: "\u7F16\u7EC4"
|
|
51
|
-
},
|
|
51
|
+
}, _react.default.createElement("g", {
|
|
52
52
|
transform: "translate(36.000000, 0.000000)",
|
|
53
53
|
id: "\u7F16\u7EC4"
|
|
54
|
-
},
|
|
54
|
+
}, _react.default.createElement("path", {
|
|
55
55
|
d: "M63,9 L63,24 L78,24 L78,84 C78,85.6568542 76.6568542,87 75,87 L21,87 C19.3431458,87 18,85.6568542 18,84 L18,12 C18,10.3431458 19.3431458,9 21,9 L63,9 Z",
|
|
56
56
|
id: "\u8DEF\u5F84",
|
|
57
57
|
fill: "#E2E8F3"
|
|
58
|
-
}),
|
|
58
|
+
}), _react.default.createElement("rect", {
|
|
59
59
|
id: "\u77E9\u5F62",
|
|
60
60
|
fill: "#CAD0DB",
|
|
61
61
|
x: "24",
|
|
62
62
|
y: "24",
|
|
63
63
|
width: "9",
|
|
64
64
|
height: "9"
|
|
65
|
-
}),
|
|
65
|
+
}), _react.default.createElement("polygon", {
|
|
66
66
|
id: "\u77E9\u5F62",
|
|
67
67
|
fill: "#EEF4FF",
|
|
68
68
|
points: "63 9 78 24 63 24"
|
|
69
|
-
}),
|
|
69
|
+
}), _react.default.createElement("rect", {
|
|
70
70
|
id: "\u77E9\u5F62",
|
|
71
71
|
fill: "#CAD0DB",
|
|
72
72
|
x: "24",
|
|
73
73
|
y: "39",
|
|
74
74
|
width: "48",
|
|
75
75
|
height: "6"
|
|
76
|
-
}),
|
|
76
|
+
}), _react.default.createElement("rect", {
|
|
77
77
|
id: "\u77E9\u5F62",
|
|
78
78
|
fill: "#CAD0DB",
|
|
79
79
|
x: "24",
|
|
80
80
|
y: "51",
|
|
81
81
|
width: "24",
|
|
82
82
|
height: "6"
|
|
83
|
-
})),
|
|
83
|
+
})), _react.default.createElement("g", {
|
|
84
84
|
transform: "translate(108.000000, 40.000000)",
|
|
85
85
|
fill: "url(#".concat(linearGradientId, ")"),
|
|
86
86
|
id: "\u80CC\u666F/\u4E91",
|
|
87
87
|
opacity: "0.300000012"
|
|
88
|
-
},
|
|
88
|
+
}, _react.default.createElement("g", {
|
|
89
89
|
id: "\u5F62\u72B6\u7ED3\u5408"
|
|
90
|
-
},
|
|
90
|
+
}, _react.default.createElement("path", {
|
|
91
91
|
d: "M3,39 L3,24 C3,15.7157288 9.71572875,9 18,9 C25.4616776,9 31.6508469,14.4482558 32.8063948,21.5836543 C33.797875,21.2064779 34.8748247,21 36,21 C40.9705627,21 45,25.0294373 45,30 L45,39 L3,39 Z"
|
|
92
|
-
}))),
|
|
92
|
+
}))), _react.default.createElement("g", {
|
|
93
93
|
transform: "translate(12.000000, 32.000000)",
|
|
94
94
|
fill: "url(#".concat(linearGradientId, ")"),
|
|
95
95
|
id: "\u80CC\u666F/\u4E91",
|
|
96
96
|
opacity: "0.300000012"
|
|
97
|
-
},
|
|
97
|
+
}, _react.default.createElement("g", {
|
|
98
98
|
transform: "translate(24.000000, 24.000000) scale(-1, 1) translate(-24.000000, -24.000000) ",
|
|
99
99
|
id: "\u5F62\u72B6\u7ED3\u5408"
|
|
100
|
-
},
|
|
100
|
+
}, _react.default.createElement("path", {
|
|
101
101
|
d: "M3,39 L3,24 C3,15.7157288 9.71572875,9 18,9 C25.4616776,9 31.6508469,14.4482558 32.8063948,21.5836543 C33.797875,21.2064779 34.8748247,21 36,21 C40.9705627,21 45,25.0294373 45,30 L45,39 L3,39 Z"
|
|
102
102
|
}))))));
|
|
103
103
|
}
|
package/lib/empty/empty.js
CHANGED
|
@@ -26,8 +26,8 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
26
26
|
}
|
|
27
27
|
return t;
|
|
28
28
|
};
|
|
29
|
-
var defaultEmptyImg =
|
|
30
|
-
var illustrationEmptyImg =
|
|
29
|
+
var defaultEmptyImg = _react.default.createElement(_defaultEmptyImg.default, null);
|
|
30
|
+
var illustrationEmptyImg = _react.default.createElement(_illustrationEmptyImg.default, null);
|
|
31
31
|
var InteranalEmpty = function InteranalEmpty(props, ref) {
|
|
32
32
|
var _useContext = (0, _react.useContext)(_ConfigContext.default),
|
|
33
33
|
getPrefixCls = _useContext.getPrefixCls,
|
|
@@ -48,34 +48,33 @@ var InteranalEmpty = function InteranalEmpty(props, ref) {
|
|
|
48
48
|
var emptyLangMsg = locale.getCompLangMsg({
|
|
49
49
|
componentName: 'Empty'
|
|
50
50
|
});
|
|
51
|
-
// ref
|
|
52
51
|
var thisEmptyRef = (0, _react.useRef)();
|
|
53
52
|
var emptyRef = ref || thisEmptyRef;
|
|
54
53
|
var imgClasses = (0, _classnames.default)("".concat(emptyPrefixCls, "-image"));
|
|
55
|
-
var imgNode = typeof image === 'string' ?
|
|
54
|
+
var imgNode = typeof image === 'string' ? _react.default.createElement("img", {
|
|
56
55
|
src: image,
|
|
57
56
|
className: imgClasses,
|
|
58
57
|
style: imageStyle,
|
|
59
58
|
alt: "empty"
|
|
60
|
-
}) : typeof image === 'boolean' ? null :
|
|
59
|
+
}) : typeof image === 'boolean' ? null : _react.default.cloneElement(image, {
|
|
61
60
|
style: imageStyle
|
|
62
61
|
});
|
|
63
|
-
var descriptionNode = description === undefined ?
|
|
62
|
+
var descriptionNode = description === undefined ? _react.default.createElement("div", {
|
|
64
63
|
className: "".concat(emptyPrefixCls, "-description")
|
|
65
|
-
}, emptyLangMsg.emptyText) : description ?
|
|
64
|
+
}, emptyLangMsg.emptyText) : description ? _react.default.createElement("div", {
|
|
66
65
|
className: "".concat(emptyPrefixCls, "-description")
|
|
67
66
|
}, description) : null;
|
|
68
|
-
var emptyFooter = children ?
|
|
67
|
+
var emptyFooter = children ? _react.default.createElement("div", {
|
|
69
68
|
className: "".concat(emptyPrefixCls, "-footer")
|
|
70
69
|
}, children) : null;
|
|
71
70
|
var emptyClasses = (0, _classnames.default)(emptyPrefixCls, className);
|
|
72
|
-
return
|
|
71
|
+
return _react.default.createElement("div", (0, _extends2.default)({
|
|
73
72
|
ref: emptyRef,
|
|
74
73
|
className: emptyClasses,
|
|
75
74
|
style: style
|
|
76
75
|
}, others), imgNode, descriptionNode, emptyFooter);
|
|
77
76
|
};
|
|
78
|
-
var Empty =
|
|
77
|
+
var Empty = _react.default.forwardRef(InteranalEmpty);
|
|
79
78
|
Empty.displayName = 'Empty';
|
|
80
79
|
Empty.DEFAULT_IMG = defaultEmptyImg;
|
|
81
80
|
Empty.ILLUSTRATION_IMG = illustrationEmptyImg;
|