@kdcloudjs/kdesign 1.8.11 → 1.8.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kdesign.css +1 -1
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +93 -15
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +1 -1
- package/dist/kdesign.min.js +3 -3
- package/dist/kdesign.min.js.map +1 -1
- package/es/_utils/KeyCode.js +1 -333
- package/es/_utils/arrayUtil.js +0 -8
- package/es/_utils/formatUtil.js +9 -59
- package/es/_utils/getStringLength.js +0 -1
- package/es/_utils/hooks.js +2 -34
- package/es/_utils/index.js +1 -7
- package/es/_utils/numberUtil.js +0 -54
- package/es/_utils/raf.js +2 -2
- package/es/_utils/reactNode.js +1 -1
- package/es/_utils/resizeObserver.js +2 -4
- package/es/_utils/type.js +0 -1
- package/es/_utils/usePopper.js +3 -3
- package/es/alert/alert.js +8 -16
- package/es/anchor/anchor-link.js +3 -3
- package/es/anchor/anchor.js +23 -26
- package/es/anchor/context.js +1 -1
- package/es/avatar/avatar.js +8 -11
- package/es/badge/badge.js +7 -13
- package/es/base-data/base-data.js +42 -104
- package/es/breadcrumb/breadcrumb.js +12 -12
- package/es/breadcrumb/breadcrumbItem.js +5 -5
- package/es/button/button.js +13 -24
- package/es/button/group.js +13 -13
- package/es/card/card.js +12 -14
- package/es/carousel/carousel.js +13 -13
- package/es/carousel/displayList.js +3 -3
- package/es/carousel/fadeList.js +3 -3
- package/es/carousel/slideList.js +4 -4
- package/es/carousel/slidebar.js +3 -3
- package/es/cascader/cascader.js +31 -36
- package/es/checkbox/checkbox.js +25 -30
- package/es/checkbox/group.js +8 -9
- package/es/city-picker/city-picker.js +28 -38
- package/es/city-picker/interface.js +1 -1
- package/es/city-picker/option.js +4 -4
- package/es/clipboard/clipboard.js +5 -23
- package/es/clipboard/util.js +0 -60
- package/es/collapse/collapse.js +5 -5
- package/es/collapse/panel.js +15 -15
- package/es/color-picker/color-picker-panel.js +12 -13
- package/es/color-picker/color-picker.js +6 -10
- package/es/color-picker/utils/validateColor.js +0 -3
- package/es/config-provider/ConfigContext.js +1 -4
- package/es/config-provider/SizeContext.js +3 -3
- package/es/config-provider/compDefaultProps.js +3 -10
- package/es/config-provider/configProvider.js +1 -6
- package/es/config-provider/defaultConfig.js +0 -1
- package/es/date-picker/calendar.js +6 -23
- package/es/date-picker/context.js +1 -1
- package/es/date-picker/date-panel.js +12 -13
- package/es/date-picker/date-picker.js +7 -12
- package/es/date-picker/hooks/use-hover-value.js +0 -1
- package/es/date-picker/hooks/use-picker-input.js +0 -4
- package/es/date-picker/hooks/use-range-disabled.js +2 -6
- package/es/date-picker/hooks/use-range-view-dates.js +1 -9
- package/es/date-picker/hooks/use-text-value-mapping.js +0 -1
- package/es/date-picker/locale/zh_CN.js +0 -1
- package/es/date-picker/panel/date-time/date-time.js +4 -6
- package/es/date-picker/panel/header/header.js +14 -14
- package/es/date-picker/panel/month/month.js +5 -6
- package/es/date-picker/panel/quarter/quarter.js +4 -4
- package/es/date-picker/panel/time/time-column.js +4 -6
- package/es/date-picker/panel/time/time.js +10 -35
- package/es/date-picker/panel/week/week.js +5 -8
- package/es/date-picker/panel/year/year.js +4 -6
- package/es/date-picker/popper.js +3 -6
- package/es/date-picker/range/input-range.js +12 -13
- package/es/date-picker/range-picker.js +13 -36
- package/es/date-picker/single/input-date.js +8 -14
- package/es/date-picker/utils/date-fns.js +0 -35
- package/es/date-picker/utils/get-extra-footer.js +1 -1
- package/es/date-picker/utils/get-ranges.js +8 -8
- package/es/date-picker/utils/index.js +0 -3
- package/es/divider/divider.js +2 -2
- package/es/drawer/drawer.js +14 -39
- package/es/dropdown/dropdown.js +10 -11
- package/es/dropdown/menu.js +8 -12
- package/es/empty/defaultEmptyImg.js +18 -18
- package/es/empty/empty.js +9 -10
- package/es/empty/illustrationEmptyImg.js +106 -106
- package/es/filter/condition.js +10 -10
- package/es/filter/filter.js +17 -19
- package/es/filter/scheme.js +34 -41
- package/es/form/Field.js +5 -5
- package/es/form/FieldContext.js +1 -1
- package/es/form/FieldLabel.js +2 -2
- package/es/form/FieldWrapper.js +6 -6
- package/es/form/Form.js +2 -5
- package/es/form/FormContext.js +2 -4
- package/es/form/hooks/useForm.js +1 -14
- package/es/form/index.js +1 -1
- package/es/grid/col.js +1 -7
- package/es/grid/row.js +3 -9
- package/es/icon/icon.js +2 -2
- package/es/image/image.js +5 -7
- package/es/image/preview-group.js +3 -4
- package/es/image/preview.js +22 -24
- package/es/image-cropper/cropper.js +3 -6
- package/es/image-cropper/image-cropper.js +5 -5
- package/es/image-cropper/operation-bar.js +9 -9
- package/es/index.js +4 -0
- package/es/input/ClearableLabeledInput.js +13 -13
- package/es/input/TextArea.js +7 -7
- package/es/input/calculateNodeHeight.js +6 -11
- package/es/input/index.js +0 -1
- package/es/input/input.js +5 -5
- package/es/input-number/inputNumber.js +3 -10
- package/es/layout/layout.js +5 -9
- package/es/layout/sider.js +11 -14
- package/es/link/link.js +8 -12
- package/es/locale/locale.js +4 -34
- package/es/menu/menu.js +3 -4
- package/es/menu/menuItem.js +8 -13
- package/es/menu/subMenu.js +19 -27
- package/es/menu/util.js +0 -4
- package/es/message/content.js +13 -13
- package/es/message/index.js +1 -3
- package/es/modal/confirm.js +1 -1
- package/es/modal/modal.js +32 -40
- package/es/notification/content.js +18 -18
- package/es/notification/index.js +1 -1
- package/es/notification-base/index.js +1 -1
- package/es/notification-base/notice.js +2 -2
- package/es/notification-base/notification.js +3 -3
- package/es/pagination/pagination.js +48 -70
- package/es/popconfirm/popconfirm.js +8 -10
- package/es/popper/index.d.ts +4 -1
- package/es/popper/index.js +84 -22
- package/es/progress/circle.js +6 -8
- package/es/progress/line.js +3 -3
- package/es/progress/progress.js +11 -11
- package/es/qr-code/qr-code.js +6 -6
- package/es/radio/context.js +1 -1
- package/es/radio/group.js +9 -13
- package/es/radio/radio-button.js +2 -2
- package/es/radio/radio.js +19 -24
- package/es/rate/rate.js +11 -61
- package/es/search/option.js +4 -5
- package/es/search/quick-search.js +36 -57
- package/es/search/search-panel.js +56 -60
- package/es/search/search.js +9 -10
- package/es/select/interface.js +1 -1
- package/es/select/option.js +4 -4
- package/es/select/select.js +47 -87
- package/es/signature/drawingBoard.js +16 -16
- package/es/signature/signature.js +20 -20
- package/es/signature/utils/signature_pad.js +4 -12
- package/es/slider/marks.js +3 -5
- package/es/slider/slider.js +11 -32
- package/es/slider/sliderTooltip.js +3 -3
- package/es/slider/steps.js +2 -2
- package/es/slider/track.js +1 -1
- package/es/space/space.js +3 -5
- package/es/spin/spin.js +16 -18
- package/es/split-panel/split-panel.js +7 -18
- package/es/split-panel/trigger.js +6 -6
- package/es/stepper/stepper.js +11 -12
- package/es/steps/Step.js +8 -8
- package/es/steps/Steps.js +5 -5
- package/es/switch/switch.js +4 -6
- package/es/table/api.js +5 -22
- package/es/table/table.js +4 -15
- package/es/tabs/active-line.js +2 -6
- package/es/tabs/arrow-button.js +3 -3
- package/es/tabs/context.js +1 -1
- package/es/tabs/index.js +0 -1
- package/es/tabs/tab-pane.js +6 -6
- package/es/tabs/tabs.js +31 -34
- package/es/tag/tag.js +7 -15
- package/es/timeline/Timeline.js +5 -5
- package/es/timeline/TimelineItem.js +5 -5
- package/es/tooltip/tooltip.js +2 -2
- package/es/transfer/list-body.js +4 -4
- package/es/transfer/list-item.js +5 -6
- package/es/transfer/list.js +18 -22
- package/es/transfer/operation.js +7 -7
- package/es/transfer/search.js +5 -5
- package/es/transfer/transfer.js +8 -13
- package/es/tree/tree.js +9 -9
- package/es/tree/treeNode.js +18 -20
- package/es/tree/utils/treeUtils.js +1 -27
- package/es/tree-select/interface.js +1 -1
- package/es/tree-select/tree-select.js +35 -48
- package/es/typography/base.js +5 -5
- package/es/typography/index.js +0 -1
- package/es/typography/paragraph.js +1 -1
- package/es/typography/text.js +1 -1
- package/es/typography/title.js +1 -1
- package/es/typography/typography.js +4 -8
- package/es/upload/dragger.js +2 -2
- package/es/upload/request.js +0 -5
- package/es/upload/scan-files.js +0 -1
- package/es/upload/upload.js +34 -34
- package/es/upload/verify-file.js +0 -1
- package/es/view-container/context.js +1 -1
- package/es/view-container/view-container.js +4 -8
- package/es/virtual-list/Filler.js +2 -2
- package/es/virtual-list/utils/algorithmUtil.js +0 -13
- package/es/virtual-list/utils/itemUtil.js +0 -30
- package/es/virtual-list/virtual-list.js +8 -11
- package/lib/_utils/KeyCode.js +1 -333
- package/lib/_utils/arrayUtil.js +0 -8
- package/lib/_utils/formatUtil.js +9 -59
- package/lib/_utils/getStringLength.js +0 -1
- package/lib/_utils/hooks.js +2 -34
- package/lib/_utils/index.js +0 -7
- package/lib/_utils/numberUtil.js +0 -54
- package/lib/_utils/raf.js +2 -2
- package/lib/_utils/reactNode.js +1 -1
- package/lib/_utils/resizeObserver.js +2 -4
- package/lib/_utils/type.js +0 -1
- package/lib/_utils/usePopper.js +3 -3
- package/lib/alert/alert.js +8 -16
- package/lib/anchor/anchor-link.js +3 -3
- package/lib/anchor/anchor.js +23 -26
- package/lib/anchor/context.js +1 -1
- package/lib/avatar/avatar.js +8 -11
- package/lib/badge/badge.js +7 -13
- package/lib/base-data/base-data.js +42 -104
- package/lib/breadcrumb/breadcrumb.js +12 -12
- package/lib/breadcrumb/breadcrumbItem.js +5 -5
- package/lib/button/button.js +13 -24
- package/lib/button/group.js +13 -13
- package/lib/card/card.js +12 -14
- package/lib/carousel/carousel.js +13 -13
- package/lib/carousel/displayList.js +3 -3
- package/lib/carousel/fadeList.js +3 -3
- package/lib/carousel/slideList.js +4 -4
- package/lib/carousel/slidebar.js +3 -3
- package/lib/cascader/cascader.js +31 -36
- package/lib/checkbox/checkbox.js +25 -30
- package/lib/checkbox/group.js +8 -8
- package/lib/city-picker/city-picker.js +28 -38
- package/lib/city-picker/interface.js +1 -1
- package/lib/city-picker/option.js +4 -4
- package/lib/clipboard/clipboard.js +5 -23
- package/lib/clipboard/util.js +0 -60
- package/lib/collapse/collapse.js +5 -5
- package/lib/collapse/panel.js +15 -15
- package/lib/color-picker/color-picker-panel.js +12 -14
- package/lib/color-picker/color-picker.js +6 -10
- package/lib/color-picker/utils/validateColor.js +0 -3
- package/lib/config-provider/ConfigContext.js +1 -5
- package/lib/config-provider/SizeContext.js +3 -3
- package/lib/config-provider/compDefaultProps.js +3 -10
- package/lib/config-provider/configProvider.js +1 -7
- package/lib/config-provider/defaultConfig.js +0 -1
- package/lib/date-picker/calendar.js +6 -23
- package/lib/date-picker/context.js +1 -1
- package/lib/date-picker/date-panel.js +12 -13
- package/lib/date-picker/date-picker.js +7 -12
- package/lib/date-picker/hooks/use-hover-value.js +0 -1
- package/lib/date-picker/hooks/use-picker-input.js +0 -4
- package/lib/date-picker/hooks/use-range-disabled.js +2 -6
- package/lib/date-picker/hooks/use-range-view-dates.js +1 -9
- package/lib/date-picker/hooks/use-text-value-mapping.js +0 -1
- package/lib/date-picker/locale/zh_CN.js +0 -1
- package/lib/date-picker/panel/date-time/date-time.js +4 -6
- package/lib/date-picker/panel/header/header.js +14 -14
- package/lib/date-picker/panel/month/month.js +5 -6
- package/lib/date-picker/panel/quarter/quarter.js +4 -4
- package/lib/date-picker/panel/time/time-column.js +4 -6
- package/lib/date-picker/panel/time/time.js +10 -35
- package/lib/date-picker/panel/week/week.js +5 -8
- package/lib/date-picker/panel/year/year.js +4 -6
- package/lib/date-picker/popper.js +3 -6
- package/lib/date-picker/range/input-range.js +12 -13
- package/lib/date-picker/range-picker.js +13 -36
- package/lib/date-picker/single/input-date.js +8 -14
- package/lib/date-picker/utils/date-fns.js +0 -34
- package/lib/date-picker/utils/get-extra-footer.js +1 -1
- package/lib/date-picker/utils/get-ranges.js +8 -8
- package/lib/date-picker/utils/index.js +0 -3
- package/lib/divider/divider.js +2 -2
- package/lib/drawer/drawer.js +14 -40
- package/lib/dropdown/dropdown.js +10 -11
- package/lib/dropdown/menu.js +8 -12
- package/lib/empty/defaultEmptyImg.js +18 -18
- package/lib/empty/empty.js +9 -10
- package/lib/empty/illustrationEmptyImg.js +106 -106
- package/lib/filter/condition.js +10 -10
- package/lib/filter/filter.js +17 -19
- package/lib/filter/scheme.js +34 -41
- package/lib/form/Field.js +5 -5
- package/lib/form/FieldContext.js +1 -1
- package/lib/form/FieldLabel.js +2 -2
- package/lib/form/FieldWrapper.js +6 -6
- package/lib/form/Form.js +2 -5
- package/lib/form/FormContext.js +2 -4
- package/lib/form/hooks/useForm.js +1 -14
- package/lib/form/index.js +1 -1
- package/lib/grid/col.js +1 -7
- package/lib/grid/row.js +3 -9
- package/lib/icon/icon.js +2 -2
- package/lib/image/image.js +5 -7
- package/lib/image/preview-group.js +3 -4
- package/lib/image/preview.js +22 -24
- package/lib/image-cropper/cropper.js +3 -6
- package/lib/image-cropper/image-cropper.js +5 -5
- package/lib/image-cropper/operation-bar.js +9 -9
- package/lib/index.js +2 -8
- package/lib/input/ClearableLabeledInput.js +13 -13
- package/lib/input/TextArea.js +7 -7
- package/lib/input/calculateNodeHeight.js +6 -11
- package/lib/input/index.js +0 -1
- package/lib/input/input.js +5 -5
- package/lib/input-number/inputNumber.js +3 -10
- package/lib/layout/layout.js +5 -9
- package/lib/layout/sider.js +11 -14
- package/lib/link/link.js +8 -12
- package/lib/locale/locale.js +4 -34
- package/lib/menu/menu.js +3 -4
- package/lib/menu/menuItem.js +8 -13
- package/lib/menu/subMenu.js +19 -27
- package/lib/menu/util.js +0 -4
- package/lib/message/content.js +13 -13
- package/lib/message/index.js +1 -3
- package/lib/modal/confirm.js +1 -1
- package/lib/modal/modal.js +32 -40
- package/lib/notification/content.js +18 -18
- package/lib/notification/index.js +1 -1
- package/lib/notification-base/index.js +1 -1
- package/lib/notification-base/notice.js +2 -2
- package/lib/notification-base/notification.js +3 -3
- package/lib/pagination/pagination.js +48 -70
- package/lib/popconfirm/popconfirm.js +8 -10
- package/lib/popper/index.d.ts +4 -1
- package/lib/popper/index.js +84 -22
- package/lib/progress/circle.js +6 -8
- package/lib/progress/line.js +3 -3
- package/lib/progress/progress.js +11 -11
- package/lib/qr-code/qr-code.js +6 -6
- package/lib/radio/context.js +1 -1
- package/lib/radio/group.js +9 -13
- package/lib/radio/radio-button.js +2 -2
- package/lib/radio/radio.js +19 -24
- package/lib/rate/rate.js +11 -61
- package/lib/search/option.js +4 -5
- package/lib/search/quick-search.js +36 -57
- package/lib/search/search-panel.js +56 -60
- package/lib/search/search.js +9 -10
- package/lib/select/interface.js +1 -1
- package/lib/select/option.js +4 -4
- package/lib/select/select.js +47 -87
- package/lib/signature/drawingBoard.js +16 -16
- package/lib/signature/signature.js +20 -20
- package/lib/signature/utils/signature_pad.js +4 -12
- package/lib/slider/marks.js +3 -5
- package/lib/slider/slider.js +11 -32
- package/lib/slider/sliderTooltip.js +3 -3
- package/lib/slider/steps.js +2 -2
- package/lib/slider/track.js +1 -1
- package/lib/space/space.js +3 -5
- package/lib/spin/spin.js +16 -18
- package/lib/split-panel/split-panel.js +7 -18
- package/lib/split-panel/trigger.js +6 -6
- package/lib/stepper/stepper.js +11 -12
- package/lib/steps/Step.js +8 -8
- package/lib/steps/Steps.js +5 -5
- package/lib/switch/switch.js +4 -6
- package/lib/table/api.js +5 -22
- package/lib/table/table.js +4 -15
- package/lib/tabs/active-line.js +2 -6
- package/lib/tabs/arrow-button.js +3 -3
- package/lib/tabs/context.js +1 -1
- package/lib/tabs/index.js +0 -1
- package/lib/tabs/tab-pane.js +6 -6
- package/lib/tabs/tabs.js +31 -34
- package/lib/tag/tag.js +7 -15
- package/lib/timeline/Timeline.js +5 -5
- package/lib/timeline/TimelineItem.js +5 -5
- package/lib/tooltip/tooltip.js +2 -2
- package/lib/transfer/list-body.js +4 -4
- package/lib/transfer/list-item.js +5 -6
- package/lib/transfer/list.js +18 -22
- package/lib/transfer/operation.js +7 -7
- package/lib/transfer/search.js +5 -5
- package/lib/transfer/transfer.js +8 -13
- package/lib/tree/tree.js +9 -9
- package/lib/tree/treeNode.js +18 -20
- package/lib/tree/utils/treeUtils.js +1 -27
- package/lib/tree-select/interface.js +1 -1
- package/lib/tree-select/tree-select.js +35 -48
- package/lib/typography/base.js +5 -5
- package/lib/typography/index.js +0 -1
- package/lib/typography/paragraph.js +1 -1
- package/lib/typography/text.js +1 -1
- package/lib/typography/title.js +1 -1
- package/lib/typography/typography.js +4 -8
- package/lib/upload/dragger.js +2 -2
- package/lib/upload/request.js +0 -5
- package/lib/upload/scan-files.js +0 -1
- package/lib/upload/upload.js +34 -34
- package/lib/upload/verify-file.js +0 -1
- package/lib/view-container/context.js +1 -1
- package/lib/view-container/view-container.js +4 -8
- package/lib/virtual-list/Filler.js +2 -2
- package/lib/virtual-list/utils/algorithmUtil.js +0 -13
- package/lib/virtual-list/utils/itemUtil.js +0 -30
- package/lib/virtual-list/virtual-list.js +8 -12
- package/package.json +1 -3
package/lib/message/content.js
CHANGED
|
@@ -27,24 +27,24 @@ var Content = function Content(args) {
|
|
|
27
27
|
prefixCls = _useContext.prefixCls;
|
|
28
28
|
var classPrefix = (0, _concat.default)(_context = "".concat(prefixCls, "-")).call(_context, suffixCls, "-content");
|
|
29
29
|
var iconMap = {
|
|
30
|
-
success:
|
|
30
|
+
success: _react.default.createElement(_icon.default, {
|
|
31
31
|
type: "right-solid"
|
|
32
32
|
}),
|
|
33
|
-
warning:
|
|
33
|
+
warning: _react.default.createElement(_icon.default, {
|
|
34
34
|
type: "warning-solid"
|
|
35
35
|
}),
|
|
36
|
-
error:
|
|
36
|
+
error: _react.default.createElement(_icon.default, {
|
|
37
37
|
type: "warning-solid"
|
|
38
38
|
}),
|
|
39
|
-
info:
|
|
39
|
+
info: _react.default.createElement(_icon.default, {
|
|
40
40
|
type: "notice"
|
|
41
41
|
})
|
|
42
42
|
};
|
|
43
43
|
var renderIcon = function renderIcon() {
|
|
44
|
-
if (icon) return
|
|
44
|
+
if (icon) return _react.default.createElement("div", {
|
|
45
45
|
className: "".concat(classPrefix, "-icon-wrapper")
|
|
46
46
|
}, icon);
|
|
47
|
-
return iconMap[type] ?
|
|
47
|
+
return iconMap[type] ? _react.default.createElement("div", {
|
|
48
48
|
className: "".concat(classPrefix, "-icon-wrapper")
|
|
49
49
|
}, iconMap[type]) : null;
|
|
50
50
|
};
|
|
@@ -57,29 +57,29 @@ var Content = function Content(args) {
|
|
|
57
57
|
var renderCloseIcon = function renderCloseIcon() {
|
|
58
58
|
if (!closable) return null;
|
|
59
59
|
if (closeNode) {
|
|
60
|
-
return
|
|
60
|
+
return _react.default.createElement("div", {
|
|
61
61
|
className: "".concat(classPrefix, "-close"),
|
|
62
62
|
onClick: handleClick
|
|
63
63
|
}, closeNode);
|
|
64
64
|
}
|
|
65
|
-
return
|
|
65
|
+
return _react.default.createElement("div", {
|
|
66
66
|
className: "".concat(classPrefix, "-close"),
|
|
67
67
|
onClick: handleClick
|
|
68
|
-
},
|
|
68
|
+
}, _react.default.createElement(_icon.default, {
|
|
69
69
|
type: "close"
|
|
70
70
|
}));
|
|
71
71
|
};
|
|
72
72
|
var getMainElement = function getMainElement() {
|
|
73
|
-
if (typeof content === 'string' ||
|
|
74
|
-
return
|
|
73
|
+
if (typeof content === 'string' || _react.default.isValidElement(content)) {
|
|
74
|
+
return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement("div", {
|
|
75
75
|
className: "".concat(classPrefix, "-main")
|
|
76
|
-
}, renderIcon(),
|
|
76
|
+
}, renderIcon(), _react.default.createElement("div", {
|
|
77
77
|
className: "".concat(classPrefix, "-text")
|
|
78
78
|
}, content)), renderCloseIcon());
|
|
79
79
|
}
|
|
80
80
|
return null;
|
|
81
81
|
};
|
|
82
|
-
return
|
|
82
|
+
return _react.default.createElement(_react.default.Fragment, null, getMainElement());
|
|
83
83
|
};
|
|
84
84
|
var _default = Content;
|
|
85
85
|
exports.default = _default;
|
package/lib/message/index.js
CHANGED
|
@@ -36,8 +36,6 @@ var getNotificationProps = function getNotificationProps(args) {
|
|
|
36
36
|
content = args.content,
|
|
37
37
|
icon = args.icon,
|
|
38
38
|
closeNode = args.closeNode;
|
|
39
|
-
// const placeStyle = getPlacementStyle(placement)
|
|
40
|
-
// const element = renderView(args)
|
|
41
39
|
var contentClose = function contentClose() {
|
|
42
40
|
onClose && onClose(key);
|
|
43
41
|
_notificationBase.default.destroy(key);
|
|
@@ -60,7 +58,7 @@ var getNotificationProps = function getNotificationProps(args) {
|
|
|
60
58
|
closable: closable,
|
|
61
59
|
onClose: onClose,
|
|
62
60
|
placement: defaultPlacement,
|
|
63
|
-
content:
|
|
61
|
+
content: _react.default.createElement(_content.default, (0, _extends2.default)({}, contentProps)),
|
|
64
62
|
suffixCls: defaultSuffixCls
|
|
65
63
|
};
|
|
66
64
|
};
|
package/lib/modal/confirm.js
CHANGED
|
@@ -29,7 +29,7 @@ function confirm(_a) {
|
|
|
29
29
|
document.body.appendChild(div);
|
|
30
30
|
function render(props) {
|
|
31
31
|
setTimeout(function () {
|
|
32
|
-
_reactDom.default.render(
|
|
32
|
+
_reactDom.default.render(_react.default.createElement(_modal.default, (0, _extends2.default)({}, props)), div);
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
render(restProps);
|
package/lib/modal/modal.js
CHANGED
|
@@ -69,7 +69,7 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
69
69
|
getPrefixCls = _useContext.getPrefixCls,
|
|
70
70
|
prefixCls = _useContext.prefixCls,
|
|
71
71
|
userDefaultProps = _useContext.compDefaultProps;
|
|
72
|
-
var modalProps = (0, _utils.getCompProps)('Modal', userDefaultProps, props);
|
|
72
|
+
var modalProps = (0, _utils.getCompProps)('Modal', userDefaultProps, props);
|
|
73
73
|
var body = modalProps.body,
|
|
74
74
|
bodyClassName = modalProps.bodyClassName,
|
|
75
75
|
bodyStyle = modalProps.bodyStyle,
|
|
@@ -114,7 +114,7 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
114
114
|
var _useState = (0, _react.useState)(isForceController ? visible : true),
|
|
115
115
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
116
116
|
innerVisible = _useState2[0],
|
|
117
|
-
setInnerVisible = _useState2[1];
|
|
117
|
+
setInnerVisible = _useState2[1];
|
|
118
118
|
var previousActiveElement = (0, _react.useRef)(null);
|
|
119
119
|
var innerRef = (0, _react.useRef)(null);
|
|
120
120
|
var wrapperRef = (0, _react.useRef)(null);
|
|
@@ -153,7 +153,6 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
153
153
|
}, [isForceController, closeModal]);
|
|
154
154
|
var escapeToCloseModal = (0, _react.useCallback)(function (evt) {
|
|
155
155
|
var _context;
|
|
156
|
-
// In Internet Explorer 9 and Firefox 36 and earlier, the Esc key returns "Esc" instead of "Escape"
|
|
157
156
|
var isModalVisible = destroyOnClose || (isForceController ? visible : innerVisible);
|
|
158
157
|
if ((0, _includes.default)(_context = ['Escape', 'Esc']).call(_context, evt.key) && isModalVisible) {
|
|
159
158
|
evt.preventDefault();
|
|
@@ -163,8 +162,6 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
163
162
|
var enterToCloseModal = (0, _react.useCallback)(function (evt) {
|
|
164
163
|
if (evt.key === 'Enter' && evt.target === containerRef.current) {
|
|
165
164
|
proxyCloseModal(onOk);
|
|
166
|
-
// 无效
|
|
167
|
-
// evt.stopPropagation()
|
|
168
165
|
}
|
|
169
166
|
}, [proxyCloseModal, onOk]);
|
|
170
167
|
var isConfirmType = (0, _includes.default)(ConfirmModalTypes).call(ConfirmModalTypes, type);
|
|
@@ -189,35 +186,32 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
189
186
|
case 'error':
|
|
190
187
|
case 'warning':
|
|
191
188
|
{
|
|
192
|
-
return
|
|
189
|
+
return _react.default.createElement("div", {
|
|
193
190
|
className: "".concat(modalPrefixCls, "-iknow-node")
|
|
194
|
-
},
|
|
191
|
+
}, _react.default.createElement(_button.default, (0, _extends2.default)({}, finalOkButtonProps), okText || (0, _locale.getLangMsg)('Modal', 'iknowText')));
|
|
195
192
|
}
|
|
196
193
|
case 'confirm':
|
|
197
194
|
case 'normal':
|
|
198
195
|
default:
|
|
199
196
|
{
|
|
200
|
-
return
|
|
197
|
+
return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement("div", {
|
|
201
198
|
className: "".concat(modalPrefixCls, "-cancel-node")
|
|
202
|
-
},
|
|
199
|
+
}, _react.default.createElement(_button.default, (0, _extends2.default)({}, finalCancelButtonProps), cancelText || (0, _locale.getLangMsg)('Modal', 'cancelText'))), _react.default.createElement("div", {
|
|
203
200
|
className: "".concat(modalPrefixCls, "-ok-node")
|
|
204
|
-
},
|
|
201
|
+
}, _react.default.createElement(_button.default, (0, _extends2.default)({}, finalOkButtonProps), okText || (0, _locale.getLangMsg)('Modal', 'okText'))));
|
|
205
202
|
}
|
|
206
203
|
}
|
|
207
204
|
}, [modalPrefixCls, okText, cancelText, finalCancelButtonProps, finalOkButtonProps]);
|
|
208
205
|
(0, _react.useEffect)(function () {
|
|
209
206
|
if (isForceController) {
|
|
210
|
-
// 强控制下只有下面该条件成立获取焦点
|
|
211
207
|
if (focusTriggerAfterClose && visible === true) {
|
|
212
208
|
!previousActiveElement.current && (previousActiveElement.current = document.activeElement);
|
|
213
209
|
}
|
|
214
210
|
} else {
|
|
215
|
-
// 不控制时, 只有下面该条件成立获取焦点
|
|
216
211
|
focusTriggerAfterClose && !previousActiveElement.current && (previousActiveElement.current = document.activeElement);
|
|
217
212
|
}
|
|
218
213
|
return function () {
|
|
219
214
|
if (focusTriggerAfterClose && previousActiveElement.current) {
|
|
220
|
-
// 这里可能有种情况,如果回车触发弹窗,由于回车又可以关闭弹窗,会导致连续触发回车
|
|
221
215
|
;
|
|
222
216
|
previousActiveElement.current.focus();
|
|
223
217
|
previousActiveElement.current = null;
|
|
@@ -392,7 +386,7 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
392
386
|
var isHidden = !destroyOnClose && !(isForceController ? visible : innerVisible);
|
|
393
387
|
var modalClasses = (0, _classnames.default)(modalPrefixCls, className, (_classNames3 = {}, (0, _defineProperty2.default)(_classNames3, "".concat(modalPrefixCls, "-container"), true), (0, _defineProperty2.default)(_classNames3, "".concat(modalPrefixCls, "-container-ie"), _ieUtil.isIE), (0, _defineProperty2.default)(_classNames3, "".concat(modalPrefixCls, "-container-hidden"), isHidden), (0, _defineProperty2.default)(_classNames3, "".concat(modalPrefixCls, "-container-show"), !isHidden), _classNames3));
|
|
394
388
|
var headerClass = "".concat(modalPrefixCls, "-header");
|
|
395
|
-
var container =
|
|
389
|
+
var container = _react.default.createElement("div", {
|
|
396
390
|
className: (0, _classnames.default)((_classNames4 = {}, (0, _defineProperty2.default)(_classNames4, "".concat(modalPrefixCls, "-container-box"), true), (0, _defineProperty2.default)(_classNames4, "".concat(modalPrefixCls, "-has-container-box"), modalContainer && !overroll), (0, _defineProperty2.default)(_classNames4, "".concat(modalPrefixCls, "-showline"), showline), _classNames4)),
|
|
397
391
|
style: {
|
|
398
392
|
width: width,
|
|
@@ -401,56 +395,54 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
401
395
|
ref: containerRef,
|
|
402
396
|
tabIndex: -1,
|
|
403
397
|
onKeyDown: enterToCloseModal
|
|
404
|
-
}, resizable &&
|
|
398
|
+
}, resizable && _react.default.createElement(_react.default.Fragment, null, _react.default.createElement("div", {
|
|
405
399
|
"data-type": "n",
|
|
406
400
|
className: (0, _concat.default)(_context2 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context2, modalPrefixCls, "-resise-n")
|
|
407
|
-
}),
|
|
401
|
+
}), _react.default.createElement("div", {
|
|
408
402
|
"data-type": "e",
|
|
409
403
|
className: (0, _concat.default)(_context3 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context3, modalPrefixCls, "-resise-e")
|
|
410
|
-
}),
|
|
404
|
+
}), _react.default.createElement("div", {
|
|
411
405
|
"data-type": "s",
|
|
412
406
|
className: (0, _concat.default)(_context4 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context4, modalPrefixCls, "-resise-s")
|
|
413
|
-
}),
|
|
407
|
+
}), _react.default.createElement("div", {
|
|
414
408
|
"data-type": "w",
|
|
415
409
|
className: (0, _concat.default)(_context5 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context5, modalPrefixCls, "-resise-w")
|
|
416
|
-
}),
|
|
410
|
+
}), _react.default.createElement("div", {
|
|
417
411
|
"data-type": "ne",
|
|
418
412
|
className: (0, _concat.default)(_context6 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context6, modalPrefixCls, "-resise-ne")
|
|
419
|
-
}),
|
|
413
|
+
}), _react.default.createElement("div", {
|
|
420
414
|
"data-type": "se",
|
|
421
415
|
className: (0, _concat.default)(_context7 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context7, modalPrefixCls, "-resise-se")
|
|
422
|
-
}),
|
|
416
|
+
}), _react.default.createElement("div", {
|
|
423
417
|
"data-type": "sw",
|
|
424
418
|
className: (0, _concat.default)(_context8 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context8, modalPrefixCls, "-resise-sw")
|
|
425
|
-
}),
|
|
419
|
+
}), _react.default.createElement("div", {
|
|
426
420
|
"data-type": "nw",
|
|
427
421
|
className: (0, _concat.default)(_context9 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context9, modalPrefixCls, "-resise-nw")
|
|
428
|
-
})),
|
|
422
|
+
})), _react.default.createElement("div", {
|
|
429
423
|
className: headerClass
|
|
430
|
-
},
|
|
424
|
+
}, _react.default.createElement("div", {
|
|
431
425
|
className: "".concat(modalPrefixCls, "-title-container")
|
|
432
|
-
}, titleIcon !== undefined ? titleIcon : type !== 'normal' &&
|
|
426
|
+
}, titleIcon !== undefined ? titleIcon : type !== 'normal' && _react.default.createElement("div", {
|
|
433
427
|
className: (0, _classnames.default)("".concat(modalPrefixCls, "-title-icon"), (0, _defineProperty2.default)({}, "modal-".concat(type, "-title-icon-bgcolor"), type))
|
|
434
|
-
}),
|
|
428
|
+
}), _react.default.createElement("div", {
|
|
435
429
|
className: "".concat(modalPrefixCls, "-title")
|
|
436
|
-
}, title)), closable &&
|
|
430
|
+
}, title)), closable && _react.default.createElement("div", {
|
|
437
431
|
className: "".concat(modalPrefixCls, "-close-icon"),
|
|
438
432
|
onClick: function onClick() {
|
|
439
433
|
return proxyCloseModal(onCancel);
|
|
440
434
|
}
|
|
441
|
-
}, closeIcon ||
|
|
435
|
+
}, closeIcon || _react.default.createElement(_index.Icon, {
|
|
442
436
|
type: "close"
|
|
443
|
-
}))),
|
|
437
|
+
}))), _react.default.createElement("div", {
|
|
444
438
|
className: (0, _classnames.default)("".concat(modalPrefixCls, "-body"), bodyClassName),
|
|
445
439
|
style: bodyStyle
|
|
446
|
-
}, body), footer !== null &&
|
|
440
|
+
}, body), footer !== null && _react.default.createElement("div", {
|
|
447
441
|
className: (0, _classnames.default)("".concat(modalPrefixCls, "-footer"), (0, _concat.default)(_context10 = "".concat(modalPrefixCls, "-")).call(_context10, type, "-footer"), footerClassName),
|
|
448
442
|
style: (0, _extends2.default)({
|
|
449
443
|
flexDirection: !footer && (!footerBtnOrder || footerBtnOrder === 'normal') ? 'row' : 'row-reverse'
|
|
450
444
|
}, footerStyle || {})
|
|
451
445
|
}, footer || generatorFooterByType(type)));
|
|
452
|
-
// 没有容器应该是不用居中的
|
|
453
|
-
// 但仍可拖拽
|
|
454
446
|
var handleDragStart = function handleDragStart(e, data) {
|
|
455
447
|
onDragStart === null || onDragStart === void 0 ? void 0 : onDragStart(e, data);
|
|
456
448
|
};
|
|
@@ -461,20 +453,20 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
461
453
|
});
|
|
462
454
|
onDrag === null || onDrag === void 0 ? void 0 : onDrag(e, ui);
|
|
463
455
|
};
|
|
464
|
-
var comp =
|
|
456
|
+
var comp = _react.default.createElement("div", (0, _extends2.default)({
|
|
465
457
|
className: modalClasses
|
|
466
|
-
}, others), mask &&
|
|
458
|
+
}, others), mask && _react.default.createElement("div", {
|
|
467
459
|
onClick: handleMaskClick,
|
|
468
460
|
className: (0, _classnames.default)(maskClassName, (0, _defineProperty2.default)({}, "".concat(modalPrefixCls, "-mask"), true)),
|
|
469
461
|
style: maskStyle
|
|
470
|
-
}), overroll ?
|
|
462
|
+
}), overroll ? _react.default.createElement("div", {
|
|
471
463
|
tabIndex: -1,
|
|
472
464
|
className: (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(modalPrefixCls, "-wrapper"), modalContainer && ((isForceController ? visible : innerVisible) || !destroyOnClose))),
|
|
473
465
|
ref: wrapperRef,
|
|
474
466
|
onMouseDown: handleWrapperClick
|
|
475
|
-
},
|
|
467
|
+
}, _react.default.createElement("div", {
|
|
476
468
|
className: "".concat(modalPrefixCls, "-dialog")
|
|
477
|
-
},
|
|
469
|
+
}, _react.default.createElement(_reactDraggable.default, {
|
|
478
470
|
position: position,
|
|
479
471
|
handle: ".".concat(headerClass),
|
|
480
472
|
disabled: !draggable,
|
|
@@ -483,7 +475,7 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
483
475
|
onStop: onDragStop,
|
|
484
476
|
bounds: bounds,
|
|
485
477
|
cancel: (0, _concat.default)(_context11 = ".".concat(modalPrefixCls, "-title-container, .")).call(_context11, modalPrefixCls, "-close-icon")
|
|
486
|
-
}, container))) :
|
|
478
|
+
}, container))) : _react.default.createElement(_reactDraggable.default, {
|
|
487
479
|
handle: ".".concat(headerClass),
|
|
488
480
|
disabled: !draggable,
|
|
489
481
|
position: position,
|
|
@@ -494,10 +486,10 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
494
486
|
cancel: (0, _concat.default)(_context12 = ".".concat(modalPrefixCls, "-title-container, .")).call(_context12, modalPrefixCls, "-close-icon")
|
|
495
487
|
}, container));
|
|
496
488
|
var renderComp = ((isForceController ? visible : innerVisible) || !destroyOnClose) && comp;
|
|
497
|
-
if (modalContainer && renderComp) return
|
|
489
|
+
if (modalContainer && renderComp) return _reactDom.default.createPortal(renderComp, modalContainer);
|
|
498
490
|
return renderComp || null;
|
|
499
491
|
};
|
|
500
|
-
var Modal =
|
|
492
|
+
var Modal = _react.default.forwardRef(InternalModal);
|
|
501
493
|
Modal.displayName = 'Modal';
|
|
502
494
|
var _default = Modal;
|
|
503
495
|
exports.default = _default;
|
|
@@ -37,34 +37,34 @@ var Content = function Content(args) {
|
|
|
37
37
|
});
|
|
38
38
|
var classPrefix = (0, _concat.default)(_context = "".concat(prefixCls, "-")).call(_context, suffixCls, "-content");
|
|
39
39
|
var iconMap = {
|
|
40
|
-
info:
|
|
40
|
+
info: _react.default.createElement(_icon.default, {
|
|
41
41
|
type: "warning-solid"
|
|
42
42
|
}),
|
|
43
|
-
primary:
|
|
43
|
+
primary: _react.default.createElement(_icon.default, {
|
|
44
44
|
type: "warning-solid"
|
|
45
45
|
})
|
|
46
46
|
};
|
|
47
47
|
var renderIcon = function renderIcon() {
|
|
48
|
-
if (icon) return
|
|
48
|
+
if (icon) return _react.default.createElement("div", {
|
|
49
49
|
className: (0, _classnames.default)("".concat(classPrefix, "-title-left-icon"))
|
|
50
50
|
}, icon);
|
|
51
51
|
if (!showIcon) return null;
|
|
52
|
-
return iconMap[type] ?
|
|
52
|
+
return iconMap[type] ? _react.default.createElement("div", {
|
|
53
53
|
className: (0, _classnames.default)("".concat(classPrefix, "-title-left-icon"))
|
|
54
54
|
}, iconMap[type]) : null;
|
|
55
55
|
};
|
|
56
56
|
var renderCloseIcon = function renderCloseIcon() {
|
|
57
57
|
if (!closable) return null;
|
|
58
58
|
if (closeNode) {
|
|
59
|
-
return
|
|
59
|
+
return _react.default.createElement("div", {
|
|
60
60
|
className: "".concat(classPrefix, "-title-close"),
|
|
61
61
|
onClick: contentClose
|
|
62
62
|
}, closeNode);
|
|
63
63
|
}
|
|
64
|
-
return
|
|
64
|
+
return _react.default.createElement("div", {
|
|
65
65
|
className: "".concat(classPrefix, "-title-close"),
|
|
66
66
|
onClick: contentClose
|
|
67
|
-
},
|
|
67
|
+
}, _react.default.createElement(_icon.default, {
|
|
68
68
|
type: "close"
|
|
69
69
|
}));
|
|
70
70
|
};
|
|
@@ -72,30 +72,30 @@ var Content = function Content(args) {
|
|
|
72
72
|
if ((0, _typeof2.default)(title) === null) {
|
|
73
73
|
return null;
|
|
74
74
|
}
|
|
75
|
-
if (
|
|
75
|
+
if (_react.default.isValidElement(title)) {
|
|
76
76
|
return title;
|
|
77
77
|
}
|
|
78
|
-
return
|
|
78
|
+
return _react.default.createElement("div", {
|
|
79
79
|
className: (0, _classnames.default)("".concat(classPrefix, "-title"))
|
|
80
|
-
},
|
|
80
|
+
}, _react.default.createElement("div", {
|
|
81
81
|
className: (0, _classnames.default)("".concat(classPrefix, "-title-left"))
|
|
82
|
-
}, renderIcon(),
|
|
82
|
+
}, renderIcon(), _react.default.createElement("div", {
|
|
83
83
|
className: (0, _classnames.default)("".concat(classPrefix, "-title-left-text"))
|
|
84
84
|
}, typeof title === 'undefined' ? notificationLangMsg.title : title)), renderCloseIcon());
|
|
85
85
|
};
|
|
86
86
|
var getFooterElement = function getFooterElement() {
|
|
87
|
-
if (
|
|
87
|
+
if (_react.default.isValidElement(footer)) {
|
|
88
88
|
return footer;
|
|
89
89
|
}
|
|
90
90
|
if (Array.isArray(footer)) {
|
|
91
91
|
var arr = footer;
|
|
92
|
-
return
|
|
92
|
+
return _react.default.createElement("div", {
|
|
93
93
|
className: (0, _classnames.default)("".concat(classPrefix, "-footer"))
|
|
94
94
|
}, (0, _map.default)(arr).call(arr, function (_ref) {
|
|
95
95
|
var name = _ref.name,
|
|
96
96
|
_onClick = _ref.onClick;
|
|
97
97
|
if (name) {
|
|
98
|
-
return
|
|
98
|
+
return _react.default.createElement("div", {
|
|
99
99
|
key: name,
|
|
100
100
|
onClick: function onClick(e) {
|
|
101
101
|
if (e) {
|
|
@@ -103,7 +103,7 @@ var Content = function Content(args) {
|
|
|
103
103
|
}
|
|
104
104
|
_onClick && _onClick();
|
|
105
105
|
}
|
|
106
|
-
},
|
|
106
|
+
}, _react.default.createElement("div", null, name));
|
|
107
107
|
}
|
|
108
108
|
return null;
|
|
109
109
|
}));
|
|
@@ -112,16 +112,16 @@ var Content = function Content(args) {
|
|
|
112
112
|
};
|
|
113
113
|
var getMainElement = function getMainElement() {
|
|
114
114
|
if (typeof content === 'string') {
|
|
115
|
-
return
|
|
115
|
+
return _react.default.createElement("div", {
|
|
116
116
|
className: (0, _classnames.default)("".concat(classPrefix, "-description"))
|
|
117
117
|
}, content);
|
|
118
118
|
}
|
|
119
|
-
if (
|
|
119
|
+
if (_react.default.isValidElement(content)) {
|
|
120
120
|
return content;
|
|
121
121
|
}
|
|
122
122
|
return null;
|
|
123
123
|
};
|
|
124
|
-
return
|
|
124
|
+
return _react.default.createElement(_react.default.Fragment, null, getTitleElement(), getMainElement(), getFooterElement());
|
|
125
125
|
};
|
|
126
126
|
var _default = Content;
|
|
127
127
|
exports.default = _default;
|
|
@@ -62,7 +62,7 @@ var getNotificationProps = function getNotificationProps(args) {
|
|
|
62
62
|
key: key,
|
|
63
63
|
className: className,
|
|
64
64
|
style: style,
|
|
65
|
-
content:
|
|
65
|
+
content: _react.default.createElement(_content.default, (0, _extends2.default)({}, contentProps)),
|
|
66
66
|
type: type,
|
|
67
67
|
closable: false,
|
|
68
68
|
onClose: onClose,
|
|
@@ -36,7 +36,7 @@ var renderNotification = function renderNotification(properties, el, callback) {
|
|
|
36
36
|
called = true;
|
|
37
37
|
callback && callback(notices);
|
|
38
38
|
};
|
|
39
|
-
_reactDom.default.render(
|
|
39
|
+
_reactDom.default.render(_react.default.createElement(_notification.default, (0, _extends2.default)({}, props, {
|
|
40
40
|
ref: ref
|
|
41
41
|
})), el);
|
|
42
42
|
};
|
|
@@ -83,13 +83,13 @@ var Notice = function Notice(props) {
|
|
|
83
83
|
clearEventListener();
|
|
84
84
|
};
|
|
85
85
|
}, [duration]);
|
|
86
|
-
return
|
|
86
|
+
return _react.default.createElement("div", {
|
|
87
87
|
className: noticeClasses,
|
|
88
88
|
style: style,
|
|
89
89
|
onMouseEnter: clearCloseTimer,
|
|
90
90
|
onMouseLeave: startCloseTimer,
|
|
91
91
|
ref: noticeRef
|
|
92
|
-
},
|
|
92
|
+
}, _react.default.createElement("div", {
|
|
93
93
|
className: "".concat(noticePrefixCls, "-content")
|
|
94
94
|
}, content));
|
|
95
95
|
};
|
|
@@ -27,7 +27,7 @@ function getUuid() {
|
|
|
27
27
|
seed += 1;
|
|
28
28
|
return (0, _concat.default)(_context = "msg_".concat(now, "_")).call(_context, id);
|
|
29
29
|
}
|
|
30
|
-
var Notification =
|
|
30
|
+
var Notification = _react.default.forwardRef(function (props, ref) {
|
|
31
31
|
var placement = props.placement;
|
|
32
32
|
var _useState = (0, _react.useState)([]),
|
|
33
33
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -69,8 +69,8 @@ var Notification = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
69
69
|
remove(notice.key || '');
|
|
70
70
|
notice.onClose && notice.onClose(notice.key);
|
|
71
71
|
};
|
|
72
|
-
return
|
|
73
|
-
return
|
|
72
|
+
return _react.default.createElement(_react.default.Fragment, null, (0, _map.default)(notices).call(notices, function (notice) {
|
|
73
|
+
return _react.default.createElement(_notice.default, (0, _extends2.default)({}, notice, {
|
|
74
74
|
key: notice.key,
|
|
75
75
|
onClose: function onClose() {
|
|
76
76
|
return _onClose(notice);
|