@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/modal/modal.js
CHANGED
|
@@ -55,7 +55,7 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
55
55
|
getPrefixCls = _useContext.getPrefixCls,
|
|
56
56
|
prefixCls = _useContext.prefixCls,
|
|
57
57
|
userDefaultProps = _useContext.compDefaultProps;
|
|
58
|
-
var modalProps = getCompProps('Modal', userDefaultProps, props);
|
|
58
|
+
var modalProps = getCompProps('Modal', userDefaultProps, props);
|
|
59
59
|
var body = modalProps.body,
|
|
60
60
|
bodyClassName = modalProps.bodyClassName,
|
|
61
61
|
bodyStyle = modalProps.bodyStyle,
|
|
@@ -100,7 +100,7 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
100
100
|
var _useState = useState(isForceController ? visible : true),
|
|
101
101
|
_useState2 = _slicedToArray(_useState, 2),
|
|
102
102
|
innerVisible = _useState2[0],
|
|
103
|
-
setInnerVisible = _useState2[1];
|
|
103
|
+
setInnerVisible = _useState2[1];
|
|
104
104
|
var previousActiveElement = useRef(null);
|
|
105
105
|
var innerRef = useRef(null);
|
|
106
106
|
var wrapperRef = useRef(null);
|
|
@@ -139,7 +139,6 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
139
139
|
}, [isForceController, closeModal]);
|
|
140
140
|
var escapeToCloseModal = useCallback(function (evt) {
|
|
141
141
|
var _context;
|
|
142
|
-
// In Internet Explorer 9 and Firefox 36 and earlier, the Esc key returns "Esc" instead of "Escape"
|
|
143
142
|
var isModalVisible = destroyOnClose || (isForceController ? visible : innerVisible);
|
|
144
143
|
if (_includesInstanceProperty(_context = ['Escape', 'Esc']).call(_context, evt.key) && isModalVisible) {
|
|
145
144
|
evt.preventDefault();
|
|
@@ -149,8 +148,6 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
149
148
|
var enterToCloseModal = useCallback(function (evt) {
|
|
150
149
|
if (evt.key === 'Enter' && evt.target === containerRef.current) {
|
|
151
150
|
proxyCloseModal(onOk);
|
|
152
|
-
// 无效
|
|
153
|
-
// evt.stopPropagation()
|
|
154
151
|
}
|
|
155
152
|
}, [proxyCloseModal, onOk]);
|
|
156
153
|
var isConfirmType = _includesInstanceProperty(ConfirmModalTypes).call(ConfirmModalTypes, type);
|
|
@@ -175,35 +172,32 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
175
172
|
case 'error':
|
|
176
173
|
case 'warning':
|
|
177
174
|
{
|
|
178
|
-
return
|
|
175
|
+
return React.createElement("div", {
|
|
179
176
|
className: "".concat(modalPrefixCls, "-iknow-node")
|
|
180
|
-
},
|
|
177
|
+
}, React.createElement(Button, _extends({}, finalOkButtonProps), okText || getLangMsg('Modal', 'iknowText')));
|
|
181
178
|
}
|
|
182
179
|
case 'confirm':
|
|
183
180
|
case 'normal':
|
|
184
181
|
default:
|
|
185
182
|
{
|
|
186
|
-
return
|
|
183
|
+
return React.createElement(React.Fragment, null, React.createElement("div", {
|
|
187
184
|
className: "".concat(modalPrefixCls, "-cancel-node")
|
|
188
|
-
},
|
|
185
|
+
}, React.createElement(Button, _extends({}, finalCancelButtonProps), cancelText || getLangMsg('Modal', 'cancelText'))), React.createElement("div", {
|
|
189
186
|
className: "".concat(modalPrefixCls, "-ok-node")
|
|
190
|
-
},
|
|
187
|
+
}, React.createElement(Button, _extends({}, finalOkButtonProps), okText || getLangMsg('Modal', 'okText'))));
|
|
191
188
|
}
|
|
192
189
|
}
|
|
193
190
|
}, [modalPrefixCls, okText, cancelText, finalCancelButtonProps, finalOkButtonProps]);
|
|
194
191
|
useEffect(function () {
|
|
195
192
|
if (isForceController) {
|
|
196
|
-
// 强控制下只有下面该条件成立获取焦点
|
|
197
193
|
if (focusTriggerAfterClose && visible === true) {
|
|
198
194
|
!previousActiveElement.current && (previousActiveElement.current = document.activeElement);
|
|
199
195
|
}
|
|
200
196
|
} else {
|
|
201
|
-
// 不控制时, 只有下面该条件成立获取焦点
|
|
202
197
|
focusTriggerAfterClose && !previousActiveElement.current && (previousActiveElement.current = document.activeElement);
|
|
203
198
|
}
|
|
204
199
|
return function () {
|
|
205
200
|
if (focusTriggerAfterClose && previousActiveElement.current) {
|
|
206
|
-
// 这里可能有种情况,如果回车触发弹窗,由于回车又可以关闭弹窗,会导致连续触发回车
|
|
207
201
|
;
|
|
208
202
|
previousActiveElement.current.focus();
|
|
209
203
|
previousActiveElement.current = null;
|
|
@@ -378,7 +372,7 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
378
372
|
var isHidden = !destroyOnClose && !(isForceController ? visible : innerVisible);
|
|
379
373
|
var modalClasses = classNames(modalPrefixCls, className, (_classNames3 = {}, _defineProperty(_classNames3, "".concat(modalPrefixCls, "-container"), true), _defineProperty(_classNames3, "".concat(modalPrefixCls, "-container-ie"), isIE), _defineProperty(_classNames3, "".concat(modalPrefixCls, "-container-hidden"), isHidden), _defineProperty(_classNames3, "".concat(modalPrefixCls, "-container-show"), !isHidden), _classNames3));
|
|
380
374
|
var headerClass = "".concat(modalPrefixCls, "-header");
|
|
381
|
-
var container =
|
|
375
|
+
var container = React.createElement("div", {
|
|
382
376
|
className: classNames((_classNames4 = {}, _defineProperty(_classNames4, "".concat(modalPrefixCls, "-container-box"), true), _defineProperty(_classNames4, "".concat(modalPrefixCls, "-has-container-box"), modalContainer && !overroll), _defineProperty(_classNames4, "".concat(modalPrefixCls, "-showline"), showline), _classNames4)),
|
|
383
377
|
style: {
|
|
384
378
|
width: width,
|
|
@@ -387,56 +381,54 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
387
381
|
ref: containerRef,
|
|
388
382
|
tabIndex: -1,
|
|
389
383
|
onKeyDown: enterToCloseModal
|
|
390
|
-
}, resizable &&
|
|
384
|
+
}, resizable && React.createElement(React.Fragment, null, React.createElement("div", {
|
|
391
385
|
"data-type": "n",
|
|
392
386
|
className: _concatInstanceProperty(_context2 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context2, modalPrefixCls, "-resise-n")
|
|
393
|
-
}),
|
|
387
|
+
}), React.createElement("div", {
|
|
394
388
|
"data-type": "e",
|
|
395
389
|
className: _concatInstanceProperty(_context3 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context3, modalPrefixCls, "-resise-e")
|
|
396
|
-
}),
|
|
390
|
+
}), React.createElement("div", {
|
|
397
391
|
"data-type": "s",
|
|
398
392
|
className: _concatInstanceProperty(_context4 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context4, modalPrefixCls, "-resise-s")
|
|
399
|
-
}),
|
|
393
|
+
}), React.createElement("div", {
|
|
400
394
|
"data-type": "w",
|
|
401
395
|
className: _concatInstanceProperty(_context5 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context5, modalPrefixCls, "-resise-w")
|
|
402
|
-
}),
|
|
396
|
+
}), React.createElement("div", {
|
|
403
397
|
"data-type": "ne",
|
|
404
398
|
className: _concatInstanceProperty(_context6 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context6, modalPrefixCls, "-resise-ne")
|
|
405
|
-
}),
|
|
399
|
+
}), React.createElement("div", {
|
|
406
400
|
"data-type": "se",
|
|
407
401
|
className: _concatInstanceProperty(_context7 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context7, modalPrefixCls, "-resise-se")
|
|
408
|
-
}),
|
|
402
|
+
}), React.createElement("div", {
|
|
409
403
|
"data-type": "sw",
|
|
410
404
|
className: _concatInstanceProperty(_context8 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context8, modalPrefixCls, "-resise-sw")
|
|
411
|
-
}),
|
|
405
|
+
}), React.createElement("div", {
|
|
412
406
|
"data-type": "nw",
|
|
413
407
|
className: _concatInstanceProperty(_context9 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context9, modalPrefixCls, "-resise-nw")
|
|
414
|
-
})),
|
|
408
|
+
})), React.createElement("div", {
|
|
415
409
|
className: headerClass
|
|
416
|
-
},
|
|
410
|
+
}, React.createElement("div", {
|
|
417
411
|
className: "".concat(modalPrefixCls, "-title-container")
|
|
418
|
-
}, titleIcon !== undefined ? titleIcon : type !== 'normal' &&
|
|
412
|
+
}, titleIcon !== undefined ? titleIcon : type !== 'normal' && React.createElement("div", {
|
|
419
413
|
className: classNames("".concat(modalPrefixCls, "-title-icon"), _defineProperty({}, "modal-".concat(type, "-title-icon-bgcolor"), type))
|
|
420
|
-
}),
|
|
414
|
+
}), React.createElement("div", {
|
|
421
415
|
className: "".concat(modalPrefixCls, "-title")
|
|
422
|
-
}, title)), closable &&
|
|
416
|
+
}, title)), closable && React.createElement("div", {
|
|
423
417
|
className: "".concat(modalPrefixCls, "-close-icon"),
|
|
424
418
|
onClick: function onClick() {
|
|
425
419
|
return proxyCloseModal(onCancel);
|
|
426
420
|
}
|
|
427
|
-
}, closeIcon ||
|
|
421
|
+
}, closeIcon || React.createElement(Icon, {
|
|
428
422
|
type: "close"
|
|
429
|
-
}))),
|
|
423
|
+
}))), React.createElement("div", {
|
|
430
424
|
className: classNames("".concat(modalPrefixCls, "-body"), bodyClassName),
|
|
431
425
|
style: bodyStyle
|
|
432
|
-
}, body), footer !== null &&
|
|
426
|
+
}, body), footer !== null && React.createElement("div", {
|
|
433
427
|
className: classNames("".concat(modalPrefixCls, "-footer"), _concatInstanceProperty(_context10 = "".concat(modalPrefixCls, "-")).call(_context10, type, "-footer"), footerClassName),
|
|
434
428
|
style: _extends({
|
|
435
429
|
flexDirection: !footer && (!footerBtnOrder || footerBtnOrder === 'normal') ? 'row' : 'row-reverse'
|
|
436
430
|
}, footerStyle || {})
|
|
437
431
|
}, footer || generatorFooterByType(type)));
|
|
438
|
-
// 没有容器应该是不用居中的
|
|
439
|
-
// 但仍可拖拽
|
|
440
432
|
var handleDragStart = function handleDragStart(e, data) {
|
|
441
433
|
onDragStart === null || onDragStart === void 0 ? void 0 : onDragStart(e, data);
|
|
442
434
|
};
|
|
@@ -447,20 +439,20 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
447
439
|
});
|
|
448
440
|
onDrag === null || onDrag === void 0 ? void 0 : onDrag(e, ui);
|
|
449
441
|
};
|
|
450
|
-
var comp =
|
|
442
|
+
var comp = React.createElement("div", _extends({
|
|
451
443
|
className: modalClasses
|
|
452
|
-
}, others), mask &&
|
|
444
|
+
}, others), mask && React.createElement("div", {
|
|
453
445
|
onClick: handleMaskClick,
|
|
454
446
|
className: classNames(maskClassName, _defineProperty({}, "".concat(modalPrefixCls, "-mask"), true)),
|
|
455
447
|
style: maskStyle
|
|
456
|
-
}), overroll ?
|
|
448
|
+
}), overroll ? React.createElement("div", {
|
|
457
449
|
tabIndex: -1,
|
|
458
450
|
className: classNames(_defineProperty({}, "".concat(modalPrefixCls, "-wrapper"), modalContainer && ((isForceController ? visible : innerVisible) || !destroyOnClose))),
|
|
459
451
|
ref: wrapperRef,
|
|
460
452
|
onMouseDown: handleWrapperClick
|
|
461
|
-
},
|
|
453
|
+
}, React.createElement("div", {
|
|
462
454
|
className: "".concat(modalPrefixCls, "-dialog")
|
|
463
|
-
},
|
|
455
|
+
}, React.createElement(Draggable, {
|
|
464
456
|
position: position,
|
|
465
457
|
handle: ".".concat(headerClass),
|
|
466
458
|
disabled: !draggable,
|
|
@@ -469,7 +461,7 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
469
461
|
onStop: onDragStop,
|
|
470
462
|
bounds: bounds,
|
|
471
463
|
cancel: _concatInstanceProperty(_context11 = ".".concat(modalPrefixCls, "-title-container, .")).call(_context11, modalPrefixCls, "-close-icon")
|
|
472
|
-
}, container))) :
|
|
464
|
+
}, container))) : React.createElement(Draggable, {
|
|
473
465
|
handle: ".".concat(headerClass),
|
|
474
466
|
disabled: !draggable,
|
|
475
467
|
position: position,
|
|
@@ -480,9 +472,9 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
480
472
|
cancel: _concatInstanceProperty(_context12 = ".".concat(modalPrefixCls, "-title-container, .")).call(_context12, modalPrefixCls, "-close-icon")
|
|
481
473
|
}, container));
|
|
482
474
|
var renderComp = ((isForceController ? visible : innerVisible) || !destroyOnClose) && comp;
|
|
483
|
-
if (modalContainer && renderComp) return
|
|
475
|
+
if (modalContainer && renderComp) return ReactDOM.createPortal(renderComp, modalContainer);
|
|
484
476
|
return renderComp || null;
|
|
485
477
|
};
|
|
486
|
-
var Modal =
|
|
478
|
+
var Modal = React.forwardRef(InternalModal);
|
|
487
479
|
Modal.displayName = 'Modal';
|
|
488
480
|
export default Modal;
|
|
@@ -25,34 +25,34 @@ var Content = function Content(args) {
|
|
|
25
25
|
});
|
|
26
26
|
var classPrefix = _concatInstanceProperty(_context = "".concat(prefixCls, "-")).call(_context, suffixCls, "-content");
|
|
27
27
|
var iconMap = {
|
|
28
|
-
info:
|
|
28
|
+
info: React.createElement(Icon, {
|
|
29
29
|
type: "warning-solid"
|
|
30
30
|
}),
|
|
31
|
-
primary:
|
|
31
|
+
primary: React.createElement(Icon, {
|
|
32
32
|
type: "warning-solid"
|
|
33
33
|
})
|
|
34
34
|
};
|
|
35
35
|
var renderIcon = function renderIcon() {
|
|
36
|
-
if (icon) return
|
|
36
|
+
if (icon) return React.createElement("div", {
|
|
37
37
|
className: classNames("".concat(classPrefix, "-title-left-icon"))
|
|
38
38
|
}, icon);
|
|
39
39
|
if (!showIcon) return null;
|
|
40
|
-
return iconMap[type] ?
|
|
40
|
+
return iconMap[type] ? React.createElement("div", {
|
|
41
41
|
className: classNames("".concat(classPrefix, "-title-left-icon"))
|
|
42
42
|
}, iconMap[type]) : null;
|
|
43
43
|
};
|
|
44
44
|
var renderCloseIcon = function renderCloseIcon() {
|
|
45
45
|
if (!closable) return null;
|
|
46
46
|
if (closeNode) {
|
|
47
|
-
return
|
|
47
|
+
return React.createElement("div", {
|
|
48
48
|
className: "".concat(classPrefix, "-title-close"),
|
|
49
49
|
onClick: contentClose
|
|
50
50
|
}, closeNode);
|
|
51
51
|
}
|
|
52
|
-
return
|
|
52
|
+
return React.createElement("div", {
|
|
53
53
|
className: "".concat(classPrefix, "-title-close"),
|
|
54
54
|
onClick: contentClose
|
|
55
|
-
},
|
|
55
|
+
}, React.createElement(Icon, {
|
|
56
56
|
type: "close"
|
|
57
57
|
}));
|
|
58
58
|
};
|
|
@@ -60,30 +60,30 @@ var Content = function Content(args) {
|
|
|
60
60
|
if (_typeof(title) === null) {
|
|
61
61
|
return null;
|
|
62
62
|
}
|
|
63
|
-
if (
|
|
63
|
+
if (React.isValidElement(title)) {
|
|
64
64
|
return title;
|
|
65
65
|
}
|
|
66
|
-
return
|
|
66
|
+
return React.createElement("div", {
|
|
67
67
|
className: classNames("".concat(classPrefix, "-title"))
|
|
68
|
-
},
|
|
68
|
+
}, React.createElement("div", {
|
|
69
69
|
className: classNames("".concat(classPrefix, "-title-left"))
|
|
70
|
-
}, renderIcon(),
|
|
70
|
+
}, renderIcon(), React.createElement("div", {
|
|
71
71
|
className: classNames("".concat(classPrefix, "-title-left-text"))
|
|
72
72
|
}, typeof title === 'undefined' ? notificationLangMsg.title : title)), renderCloseIcon());
|
|
73
73
|
};
|
|
74
74
|
var getFooterElement = function getFooterElement() {
|
|
75
|
-
if (
|
|
75
|
+
if (React.isValidElement(footer)) {
|
|
76
76
|
return footer;
|
|
77
77
|
}
|
|
78
78
|
if (Array.isArray(footer)) {
|
|
79
79
|
var arr = footer;
|
|
80
|
-
return
|
|
80
|
+
return React.createElement("div", {
|
|
81
81
|
className: classNames("".concat(classPrefix, "-footer"))
|
|
82
82
|
}, _mapInstanceProperty(arr).call(arr, function (_ref) {
|
|
83
83
|
var name = _ref.name,
|
|
84
84
|
_onClick = _ref.onClick;
|
|
85
85
|
if (name) {
|
|
86
|
-
return
|
|
86
|
+
return React.createElement("div", {
|
|
87
87
|
key: name,
|
|
88
88
|
onClick: function onClick(e) {
|
|
89
89
|
if (e) {
|
|
@@ -91,7 +91,7 @@ var Content = function Content(args) {
|
|
|
91
91
|
}
|
|
92
92
|
_onClick && _onClick();
|
|
93
93
|
}
|
|
94
|
-
},
|
|
94
|
+
}, React.createElement("div", null, name));
|
|
95
95
|
}
|
|
96
96
|
return null;
|
|
97
97
|
}));
|
|
@@ -100,15 +100,15 @@ var Content = function Content(args) {
|
|
|
100
100
|
};
|
|
101
101
|
var getMainElement = function getMainElement() {
|
|
102
102
|
if (typeof content === 'string') {
|
|
103
|
-
return
|
|
103
|
+
return React.createElement("div", {
|
|
104
104
|
className: classNames("".concat(classPrefix, "-description"))
|
|
105
105
|
}, content);
|
|
106
106
|
}
|
|
107
|
-
if (
|
|
107
|
+
if (React.isValidElement(content)) {
|
|
108
108
|
return content;
|
|
109
109
|
}
|
|
110
110
|
return null;
|
|
111
111
|
};
|
|
112
|
-
return
|
|
112
|
+
return React.createElement(React.Fragment, null, getTitleElement(), getMainElement(), getFooterElement());
|
|
113
113
|
};
|
|
114
114
|
export default Content;
|
package/es/notification/index.js
CHANGED
|
@@ -55,7 +55,7 @@ var getNotificationProps = function getNotificationProps(args) {
|
|
|
55
55
|
key: key,
|
|
56
56
|
className: className,
|
|
57
57
|
style: style,
|
|
58
|
-
content:
|
|
58
|
+
content: React.createElement(Content, _extends({}, contentProps)),
|
|
59
59
|
type: type,
|
|
60
60
|
closable: false,
|
|
61
61
|
onClose: onClose,
|
|
@@ -29,7 +29,7 @@ var renderNotification = function renderNotification(properties, el, callback) {
|
|
|
29
29
|
called = true;
|
|
30
30
|
callback && callback(notices);
|
|
31
31
|
};
|
|
32
|
-
ReactDOM.render(
|
|
32
|
+
ReactDOM.render(React.createElement(Notification, _extends({}, props, {
|
|
33
33
|
ref: ref
|
|
34
34
|
})), el);
|
|
35
35
|
};
|
|
@@ -70,13 +70,13 @@ var Notice = function Notice(props) {
|
|
|
70
70
|
clearEventListener();
|
|
71
71
|
};
|
|
72
72
|
}, [duration]);
|
|
73
|
-
return
|
|
73
|
+
return React.createElement("div", {
|
|
74
74
|
className: noticeClasses,
|
|
75
75
|
style: style,
|
|
76
76
|
onMouseEnter: clearCloseTimer,
|
|
77
77
|
onMouseLeave: startCloseTimer,
|
|
78
78
|
ref: noticeRef
|
|
79
|
-
},
|
|
79
|
+
}, React.createElement("div", {
|
|
80
80
|
className: "".concat(noticePrefixCls, "-content")
|
|
81
81
|
}, content));
|
|
82
82
|
};
|
|
@@ -15,7 +15,7 @@ function getUuid() {
|
|
|
15
15
|
seed += 1;
|
|
16
16
|
return _concatInstanceProperty(_context = "msg_".concat(now, "_")).call(_context, id);
|
|
17
17
|
}
|
|
18
|
-
var Notification =
|
|
18
|
+
var Notification = React.forwardRef(function (props, ref) {
|
|
19
19
|
var placement = props.placement;
|
|
20
20
|
var _useState = useState([]),
|
|
21
21
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -57,8 +57,8 @@ var Notification = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
57
57
|
remove(notice.key || '');
|
|
58
58
|
notice.onClose && notice.onClose(notice.key);
|
|
59
59
|
};
|
|
60
|
-
return
|
|
61
|
-
return
|
|
60
|
+
return React.createElement(React.Fragment, null, _mapInstanceProperty(notices).call(notices, function (notice) {
|
|
61
|
+
return React.createElement(Notice, _extends({}, notice, {
|
|
62
62
|
key: notice.key,
|
|
63
63
|
onClose: function onClose() {
|
|
64
64
|
return _onClose(notice);
|