@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
|
@@ -27,7 +27,6 @@ var PreviewGroup = function PreviewGroup(_ref) {
|
|
|
27
27
|
return image.props;
|
|
28
28
|
}) : [children !== undefined ? children.props : {}];
|
|
29
29
|
}, [children, items, hasItems]);
|
|
30
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
31
30
|
var refs = _mapInstanceProperty(images).call(images, function () {
|
|
32
31
|
return React.useRef();
|
|
33
32
|
});
|
|
@@ -107,14 +106,14 @@ var PreviewGroup = function PreviewGroup(_ref) {
|
|
|
107
106
|
onClose: onClose,
|
|
108
107
|
onPrevious: onPrevious
|
|
109
108
|
};
|
|
110
|
-
return
|
|
109
|
+
return React.createElement(React.Fragment, null, images.length > 1 ? _mapInstanceProperty(_context3 = React.Children).call(_context3, children, function (image, index) {
|
|
111
110
|
var _a, _b;
|
|
112
|
-
return
|
|
111
|
+
return React.cloneElement(image, {
|
|
113
112
|
key: image.key || index,
|
|
114
113
|
preview: false,
|
|
115
114
|
ref: refs[index],
|
|
116
115
|
onClick: ((_a = image === null || image === void 0 ? void 0 : image.props) === null || _a === void 0 ? void 0 : _a.preview) !== false ? onPreview.bind(null, index, (_b = image === null || image === void 0 ? void 0 : image.props) === null || _b === void 0 ? void 0 : _b.src) : undefined
|
|
117
116
|
});
|
|
118
|
-
}) : children, exit &&
|
|
117
|
+
}) : children, exit && React.createElement(Preview, _extends({}, previewProps)));
|
|
119
118
|
};
|
|
120
119
|
export default PreviewGroup;
|
package/es/image/preview.js
CHANGED
|
@@ -18,7 +18,6 @@ var Preview = function Preview(props) {
|
|
|
18
18
|
pkgPrefixCls = _React$useContext.prefixCls,
|
|
19
19
|
userDefaultProps = _React$useContext.compDefaultProps,
|
|
20
20
|
locale = _React$useContext.locale;
|
|
21
|
-
// 属性需要合并一遍用户定义的默认属性
|
|
22
21
|
var allProps = getCompProps('Image', userDefaultProps, props);
|
|
23
22
|
var imageLangMsg = locale.getCompLangMsg({
|
|
24
23
|
componentName: 'Image'
|
|
@@ -34,7 +33,6 @@ var Preview = function Preview(props) {
|
|
|
34
33
|
length = allProps.length,
|
|
35
34
|
operations = allProps.operations,
|
|
36
35
|
customPrefixcls = allProps.prefixCls;
|
|
37
|
-
// className前缀
|
|
38
36
|
var prefixCls = getPrefixCls(pkgPrefixCls, 'image', customPrefixcls);
|
|
39
37
|
var _React$useState = React.useState(visible),
|
|
40
38
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -107,51 +105,51 @@ var Preview = function Preview(props) {
|
|
|
107
105
|
return e.stopPropagation();
|
|
108
106
|
}
|
|
109
107
|
};
|
|
110
|
-
var peviewContainer =
|
|
108
|
+
var peviewContainer = React.createElement("div", {
|
|
111
109
|
className: classNames("".concat(prefixCls, "-preview"), props.className, {
|
|
112
110
|
show: show
|
|
113
111
|
}),
|
|
114
112
|
style: _extends({}, props.style)
|
|
115
|
-
},
|
|
113
|
+
}, React.createElement("div", {
|
|
116
114
|
className: "".concat(prefixCls, "-preview-mask"),
|
|
117
115
|
onClick: onClose
|
|
118
|
-
}),
|
|
116
|
+
}), React.createElement(Draggable, {
|
|
119
117
|
defaultClassName: "".concat(prefixCls, "-preview-wrap"),
|
|
120
118
|
position: {
|
|
121
119
|
x: 0,
|
|
122
120
|
y: 0
|
|
123
121
|
}
|
|
124
|
-
},
|
|
122
|
+
}, React.createElement("div", {
|
|
125
123
|
onClick: onClose
|
|
126
|
-
},
|
|
124
|
+
}, React.createElement("img", _extends({}, previewImgProps)))), React.createElement("div", {
|
|
127
125
|
className: "".concat(prefixCls, "-preview-action")
|
|
128
|
-
}, props.type !== 'upload' && length &&
|
|
126
|
+
}, props.type !== 'upload' && length && React.createElement(Icon, {
|
|
129
127
|
type: "arrow-left",
|
|
130
128
|
className: classNames({
|
|
131
129
|
disabled: current <= 0
|
|
132
130
|
}),
|
|
133
131
|
onClick: props.onPrevious
|
|
134
|
-
}),
|
|
132
|
+
}), React.createElement(Icon, {
|
|
135
133
|
type: "shrink",
|
|
136
134
|
className: classNames({
|
|
137
135
|
disabled: scale <= minScale
|
|
138
136
|
}),
|
|
139
137
|
onClick: handleZoomOut
|
|
140
|
-
}),
|
|
138
|
+
}), React.createElement(Icon, {
|
|
141
139
|
type: "zoom",
|
|
142
140
|
className: classNames({
|
|
143
141
|
disabled: scale >= maxScale
|
|
144
142
|
}),
|
|
145
143
|
onClick: handleZoomIn
|
|
146
|
-
}), props.type !== 'upload' && operations, props.type !== 'upload' && length &&
|
|
144
|
+
}), props.type !== 'upload' && operations, props.type !== 'upload' && length && React.createElement(Icon, {
|
|
147
145
|
type: "arrow-right",
|
|
148
146
|
className: classNames({
|
|
149
147
|
disabled: current >= length - 1
|
|
150
148
|
}),
|
|
151
149
|
onClick: props.onNext
|
|
152
|
-
})), props.type === 'upload' && length &&
|
|
150
|
+
})), props.type === 'upload' && length && React.createElement(React.Fragment, null, React.createElement("span", {
|
|
153
151
|
className: "".concat(prefixCls, "-preview-previous")
|
|
154
|
-
},
|
|
152
|
+
}, React.createElement(Icon, {
|
|
155
153
|
type: "arrow-left",
|
|
156
154
|
style: {
|
|
157
155
|
fontSize: 20
|
|
@@ -160,9 +158,9 @@ var Preview = function Preview(props) {
|
|
|
160
158
|
disabled: current <= 0
|
|
161
159
|
}),
|
|
162
160
|
onClick: props.onPrevious
|
|
163
|
-
})),
|
|
161
|
+
})), React.createElement("span", {
|
|
164
162
|
className: "".concat(prefixCls, "-preview-next")
|
|
165
|
-
},
|
|
163
|
+
}, React.createElement(Icon, {
|
|
166
164
|
type: "arrow-right",
|
|
167
165
|
style: {
|
|
168
166
|
fontSize: 20
|
|
@@ -171,25 +169,25 @@ var Preview = function Preview(props) {
|
|
|
171
169
|
disabled: current >= length - 1
|
|
172
170
|
}),
|
|
173
171
|
onClick: props.onNext
|
|
174
|
-
}))), props.type !== 'upload' &&
|
|
172
|
+
}))), props.type !== 'upload' && React.createElement(Icon, {
|
|
175
173
|
className: "".concat(prefixCls, "-preview-close"),
|
|
176
174
|
type: "close-solid",
|
|
177
175
|
onClick: onClose
|
|
178
|
-
}), props.type === 'upload' &&
|
|
176
|
+
}), props.type === 'upload' && React.createElement("div", {
|
|
179
177
|
className: "".concat(prefixCls, "-preview-topbar")
|
|
180
|
-
},
|
|
178
|
+
}, React.createElement("div", {
|
|
181
179
|
className: "".concat(prefixCls, "-preview-topbar-info")
|
|
182
|
-
},
|
|
180
|
+
}, React.createElement("span", {
|
|
183
181
|
className: "".concat(prefixCls, "-preview-topbar-info-name")
|
|
184
|
-
}, name),
|
|
182
|
+
}, name), React.createElement("span", {
|
|
185
183
|
className: "".concat(prefixCls, "-preview-topbar-info-size")
|
|
186
|
-
}, size)),
|
|
184
|
+
}, size)), React.createElement("div", {
|
|
187
185
|
className: "".concat(prefixCls, "-preview-topbar-action")
|
|
188
|
-
}, operations,
|
|
186
|
+
}, operations, React.createElement("span", {
|
|
189
187
|
onClick: onClose
|
|
190
|
-
},
|
|
188
|
+
}, React.createElement(Icon, {
|
|
191
189
|
type: "close-solid"
|
|
192
190
|
}), imageLangMsg.close))));
|
|
193
|
-
return
|
|
191
|
+
return ReactDOM.createPortal(peviewContainer, document.body);
|
|
194
192
|
};
|
|
195
193
|
export default Preview;
|
|
@@ -3,11 +3,8 @@ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instan
|
|
|
3
3
|
import React, { forwardRef, useEffect, useImperativeHandle, useRef, useMemo } from 'react';
|
|
4
4
|
import CropperJS from 'cropperjs';
|
|
5
5
|
import { tuple } from '../_utils/type';
|
|
6
|
-
// crop 形成新的裁剪框
|
|
7
|
-
// move 图片可移动
|
|
8
|
-
// none 都不能移动
|
|
9
6
|
export var DragModeTypes = tuple('crop', 'move', 'none');
|
|
10
|
-
var Cropper =
|
|
7
|
+
var Cropper = forwardRef(function (props, forwardedRef) {
|
|
11
8
|
var containerRef = useRef(null);
|
|
12
9
|
var imgRef = useRef(null);
|
|
13
10
|
var cropperRef = useRef(null);
|
|
@@ -101,10 +98,10 @@ var Cropper = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
|
|
|
101
98
|
var imgStyle = {
|
|
102
99
|
display: 'none'
|
|
103
100
|
};
|
|
104
|
-
return
|
|
101
|
+
return React.createElement("div", {
|
|
105
102
|
className: className,
|
|
106
103
|
ref: containerRef
|
|
107
|
-
},
|
|
104
|
+
}, React.createElement("img", {
|
|
108
105
|
ref: imgRef,
|
|
109
106
|
style: imgStyle,
|
|
110
107
|
src: imgSrc
|
|
@@ -84,7 +84,7 @@ var InternalImageCropper = function InternalImageCropper(props, forwardedRef) {
|
|
|
84
84
|
restProps = __rest(_a, ["prefixCls", "containerWidth", "containerHeight", "title", "visible", "onClose", "onCropSuccess", "onCropFailed", "dragMode", "viewMode", "aspectRatio", "modal", "okText", "okBtn", "image", "zoomOnWheel", "imageMaxSize", "cropBoxMovable", "customComponents", "showDeaultToolbar", "autoCropArea"]);
|
|
85
85
|
var prefixCls = getPrefixCls(pkgPrefixCls, 'image-cropper', customPrefixcls);
|
|
86
86
|
var handleOkClick = function handleOkClick() {
|
|
87
|
-
return __awaiter(void 0, void 0, void 0,
|
|
87
|
+
return __awaiter(void 0, void 0, void 0, _regeneratorRuntime.mark(function _callee() {
|
|
88
88
|
var imgFile;
|
|
89
89
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
90
90
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -119,7 +119,7 @@ var InternalImageCropper = function InternalImageCropper(props, forwardedRef) {
|
|
|
119
119
|
useEffect(function () {
|
|
120
120
|
setCropperSrc(image);
|
|
121
121
|
}, [image]);
|
|
122
|
-
var CropperNode =
|
|
122
|
+
var CropperNode = React.createElement(Cropper, {
|
|
123
123
|
className: "".concat(prefixCls, "-container"),
|
|
124
124
|
dragMode: dragMode,
|
|
125
125
|
viewMode: viewMode,
|
|
@@ -131,7 +131,7 @@ var InternalImageCropper = function InternalImageCropper(props, forwardedRef) {
|
|
|
131
131
|
autoCropArea: autoCropArea,
|
|
132
132
|
ref: cropperRef
|
|
133
133
|
});
|
|
134
|
-
var OperationBarNode =
|
|
134
|
+
var OperationBarNode = React.createElement(OperationBar, {
|
|
135
135
|
className: "".concat(prefixCls, "-bar-container"),
|
|
136
136
|
btnClassName: "".concat(prefixCls, "-btn-container"),
|
|
137
137
|
imageMaxSize: imageMaxSize,
|
|
@@ -146,7 +146,7 @@ var InternalImageCropper = function InternalImageCropper(props, forwardedRef) {
|
|
|
146
146
|
getCropper: cropperRef,
|
|
147
147
|
showDeaultToolbar: showDeaultToolbar
|
|
148
148
|
});
|
|
149
|
-
return
|
|
149
|
+
return React.createElement(Modal, _extends({
|
|
150
150
|
className: classNames("".concat(prefixCls, "-modal-container")),
|
|
151
151
|
bodyClassName: classNames("".concat(prefixCls, "-modal-body-container")),
|
|
152
152
|
width: containerWidth,
|
|
@@ -158,6 +158,6 @@ var InternalImageCropper = function InternalImageCropper(props, forwardedRef) {
|
|
|
158
158
|
onCancel: onClose
|
|
159
159
|
}, restProps));
|
|
160
160
|
};
|
|
161
|
-
var ImageCropper =
|
|
161
|
+
var ImageCropper = forwardRef(InternalImageCropper);
|
|
162
162
|
ImageCropper.displayName = 'ImageCropper';
|
|
163
163
|
export default ImageCropper;
|
|
@@ -64,33 +64,33 @@ var OperationBar = function OperationBar(props) {
|
|
|
64
64
|
showUploadList: false
|
|
65
65
|
};
|
|
66
66
|
}, [accept, beforeUpload]);
|
|
67
|
-
return
|
|
67
|
+
return React.createElement("div", {
|
|
68
68
|
className: className
|
|
69
|
-
}, showDeaultToolbar &&
|
|
69
|
+
}, showDeaultToolbar && React.createElement("div", {
|
|
70
70
|
className: classNames(btnClassName)
|
|
71
|
-
},
|
|
71
|
+
}, React.createElement(Icon, {
|
|
72
72
|
type: "reduction",
|
|
73
73
|
onClick: handleRevert
|
|
74
|
-
}),
|
|
74
|
+
}), React.createElement(Upload, _extends({}, uploadProps), React.createElement(Icon, {
|
|
75
75
|
type: "upload"
|
|
76
|
-
})),
|
|
76
|
+
})), React.createElement(Icon, {
|
|
77
77
|
type: "spin",
|
|
78
78
|
onClick: handleRotate
|
|
79
|
-
}),
|
|
79
|
+
}), React.createElement(Icon, {
|
|
80
80
|
type: "reduce",
|
|
81
81
|
onClick: function onClick() {
|
|
82
82
|
return handleZoom(-0.1);
|
|
83
83
|
}
|
|
84
|
-
}),
|
|
84
|
+
}), React.createElement(Icon, {
|
|
85
85
|
type: "add",
|
|
86
86
|
onClick: function onClick() {
|
|
87
87
|
return handleZoom(0.1);
|
|
88
88
|
}
|
|
89
89
|
})), customComponents && _mapInstanceProperty(customComponents).call(customComponents, function (Component, index) {
|
|
90
90
|
return Component(getCropper, index);
|
|
91
|
-
}), okBtn ?
|
|
91
|
+
}), okBtn ? React.createElement("div", {
|
|
92
92
|
onClick: handleBtnClick
|
|
93
|
-
}, okBtn) :
|
|
93
|
+
}, okBtn) : React.createElement(Button, {
|
|
94
94
|
className: classNames('ok-btn'),
|
|
95
95
|
type: "primary",
|
|
96
96
|
onClick: handleBtnClick
|
package/es/index.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
var ENV = process.env.NODE_ENV;
|
|
2
|
+
if (ENV !== 'production' && ENV !== 'test' && typeof console !== 'undefined' && console.warn && typeof window !== 'undefined') {
|
|
3
|
+
console.warn('You are using a whole package of kdesign, please use https://www.npmjs.com/package/babel-plugin-import to reduce app bundle size.');
|
|
4
|
+
}
|
|
1
5
|
export { default as Alert } from './alert';
|
|
2
6
|
export { default as Breadcrumb } from './breadcrumb';
|
|
3
7
|
export { default as Button } from './button';
|
|
@@ -57,20 +57,20 @@ var ClearableInput = function ClearableInput(props) {
|
|
|
57
57
|
}
|
|
58
58
|
var needClear = !disabled && value && isMouseEnter;
|
|
59
59
|
var clearIconCls = classNames((_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-textarea-clear-icon"), inputType === ClearableInputType[1]), _defineProperty(_classNames, "".concat(prefixCls, "-clear-icon"), inputType === ClearableInputType[0]), _defineProperty(_classNames, "".concat(prefixCls, "-clear-icon-hidden"), !needClear), _defineProperty(_classNames, "".concat(prefixCls, "-clear-icon-rightSpace"), suffix), _classNames));
|
|
60
|
-
return
|
|
60
|
+
return React.createElement("span", {
|
|
61
61
|
onMouseDown: mouseDownHandle,
|
|
62
62
|
onClick: handleReset,
|
|
63
63
|
className: clearIconCls
|
|
64
|
-
}, typeof allowClear === 'boolean' ?
|
|
64
|
+
}, typeof allowClear === 'boolean' ? React.createElement(Icon, {
|
|
65
65
|
type: "close-solid"
|
|
66
66
|
}) : allowClear);
|
|
67
67
|
};
|
|
68
68
|
var renderSuffix = function renderSuffix() {
|
|
69
69
|
if (suffix || inputCount) {
|
|
70
|
-
return
|
|
70
|
+
return React.createElement("span", {
|
|
71
71
|
className: "".concat(prefixCls, "-suffix"),
|
|
72
72
|
onMouseDown: mouseDownHandle
|
|
73
|
-
}, inputCount &&
|
|
73
|
+
}, inputCount && React.createElement("span", {
|
|
74
74
|
style: {
|
|
75
75
|
marginRight: suffix ? 9 : 0
|
|
76
76
|
}
|
|
@@ -84,19 +84,19 @@ var ClearableInput = function ClearableInput(props) {
|
|
|
84
84
|
return originElement;
|
|
85
85
|
}
|
|
86
86
|
var suffixNode = renderSuffix();
|
|
87
|
-
var prefixNode = prefix ?
|
|
87
|
+
var prefixNode = prefix ? React.createElement("span", {
|
|
88
88
|
className: "".concat(prefixCls, "-prefix"),
|
|
89
89
|
onMouseDown: mouseDownHandle
|
|
90
90
|
}, prefix) : null;
|
|
91
91
|
var inputWrapperClasses = classNames((_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefixCls, "-wrapper"), true), _defineProperty(_classNames2, "".concat(prefixCls, "-wrapper-focused"), focused && !disabled), _defineProperty(_classNames2, _concatInstanceProperty(_context = "".concat(prefixCls, "-wrapper-size-")).call(_context, size), size), _defineProperty(_classNames2, "".concat(prefixCls, "-wrapper-borderless"), borderType === 'none'), _defineProperty(_classNames2, "".concat(prefixCls, "-wrapper-underline"), borderType === 'underline'), _defineProperty(_classNames2, "".concat(prefixCls, "-error"), status === 'error'), _defineProperty(_classNames2, "".concat(prefixCls, "-wrapper-disabled"), disabled), _classNames2), _defineProperty({}, className, className && !addonBefore && !addonAfter));
|
|
92
|
-
return
|
|
92
|
+
return React.createElement("span", {
|
|
93
93
|
className: inputWrapperClasses,
|
|
94
94
|
ref: fixRef,
|
|
95
95
|
style: style,
|
|
96
96
|
onClick: clickHandle,
|
|
97
97
|
onMouseEnter: mouseEnterHandle,
|
|
98
98
|
onMouseLeave: mouseLeaveHandle
|
|
99
|
-
}, prefixNode,
|
|
99
|
+
}, prefixNode, React.cloneElement(originElement, {
|
|
100
100
|
style: null
|
|
101
101
|
}), renderClearIcon(), suffixNode);
|
|
102
102
|
};
|
|
@@ -106,19 +106,19 @@ var ClearableInput = function ClearableInput(props) {
|
|
|
106
106
|
return originElement;
|
|
107
107
|
}
|
|
108
108
|
var addonClassName = classNames("".concat(prefixCls, "-group-addon"), (_classNames4 = {}, _defineProperty(_classNames4, "".concat(prefixCls, "-group-addon-borderless"), borderType === 'none'), _defineProperty(_classNames4, "".concat(prefixCls, "-group-addon-underline"), borderType === 'underline'), _defineProperty(_classNames4, "".concat(prefixCls, "-error"), status === 'error'), _defineProperty(_classNames4, "".concat(prefixCls, "-group-addon-disabled"), disabled), _classNames4));
|
|
109
|
-
var addonBeforeNode = addonBefore ?
|
|
109
|
+
var addonBeforeNode = addonBefore ? React.createElement("span", {
|
|
110
110
|
className: addonClassName
|
|
111
111
|
}, addonBefore) : null;
|
|
112
|
-
var addonAfterNode = addonAfter ?
|
|
112
|
+
var addonAfterNode = addonAfter ? React.createElement("span", {
|
|
113
113
|
className: addonClassName
|
|
114
114
|
}, addonAfter) : null;
|
|
115
115
|
var inputGroupClasses = classNames(className, (_classNames5 = {}, _defineProperty(_classNames5, "".concat(prefixCls, "-group"), true), _defineProperty(_classNames5, _concatInstanceProperty(_context2 = "".concat(prefixCls, "-group-size-")).call(_context2, size), size), _classNames5));
|
|
116
|
-
return
|
|
116
|
+
return React.createElement("span", {
|
|
117
117
|
className: "".concat(prefixCls, "-group-wrapper")
|
|
118
|
-
},
|
|
118
|
+
}, React.createElement("span", {
|
|
119
119
|
className: inputGroupClasses,
|
|
120
120
|
style: style
|
|
121
|
-
}, addonBeforeNode,
|
|
121
|
+
}, addonBeforeNode, React.cloneElement(originElement, {
|
|
122
122
|
style: null
|
|
123
123
|
}), addonAfterNode));
|
|
124
124
|
};
|
|
@@ -147,7 +147,7 @@ var ClearableInput = function ClearableInput(props) {
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
var textAreaWrapperClasses = classNames(className, _defineProperty({}, "".concat(prefixCls, "-wrapper-textarea"), true));
|
|
150
|
-
return
|
|
150
|
+
return React.createElement("span", {
|
|
151
151
|
className: textAreaWrapperClasses,
|
|
152
152
|
style: wrapperStyle,
|
|
153
153
|
onMouseEnter: mouseEnterHandle,
|
package/es/input/TextArea.js
CHANGED
|
@@ -28,7 +28,7 @@ var InternalTextarea = function InternalTextarea(props, ref) {
|
|
|
28
28
|
getPrefixCls = _useContext.getPrefixCls,
|
|
29
29
|
prefixCls = _useContext.prefixCls,
|
|
30
30
|
userDefaultProps = _useContext.compDefaultProps;
|
|
31
|
-
var textAreaProps = getCompProps('TextArea', userDefaultProps, props);
|
|
31
|
+
var textAreaProps = getCompProps('TextArea', userDefaultProps, props);
|
|
32
32
|
var _useState = useState({}),
|
|
33
33
|
_useState2 = _slicedToArray(_useState, 2),
|
|
34
34
|
textareaStyles = _useState2[0],
|
|
@@ -53,7 +53,7 @@ var InternalTextarea = function InternalTextarea(props, ref) {
|
|
|
53
53
|
size = textAreaProps.size,
|
|
54
54
|
status = textAreaProps.status,
|
|
55
55
|
others = __rest(textAreaProps, ["value", "allowClear", "borderType", "defaultValue", "count", "countPosition", "autoSize", "className", "prefixCls", "canResize", "maxLength", "disabled", "onBlur", "onFocus", "onChange", "placeholder", "style", "size", "status"]);
|
|
56
|
-
var textAreaPrefixCls = getPrefixCls(prefixCls, 'input', customPrefixcls);
|
|
56
|
+
var textAreaPrefixCls = getPrefixCls(prefixCls, 'input', customPrefixcls);
|
|
57
57
|
devWarning(BorderTypes.indexOf(borderType) === -1, 'textarea', "cannot found textarea borderType '".concat(borderType, "'"));
|
|
58
58
|
var _useMergedState = useMergedState('', {
|
|
59
59
|
value: propsValue,
|
|
@@ -123,7 +123,7 @@ var InternalTextarea = function InternalTextarea(props, ref) {
|
|
|
123
123
|
if (count && (showNumberMark || numberMarkError) && !disabled && maxLength !== '' && maxLength >= 0) {
|
|
124
124
|
var _classNames;
|
|
125
125
|
var countClass = classNames("".concat(textAreaPrefixCls, "-textarea-mark"), (_classNames = {}, _defineProperty(_classNames, "".concat(textAreaPrefixCls, "-textarea-mark-inner"), countPosition === 'inner'), _defineProperty(_classNames, "".concat(textAreaPrefixCls, "-textarea-mark-error"), numberMarkError), _classNames));
|
|
126
|
-
return
|
|
126
|
+
return React.createElement("div", {
|
|
127
127
|
className: countClass
|
|
128
128
|
}, value ? value.length : 0, "/", maxLength);
|
|
129
129
|
}
|
|
@@ -171,7 +171,7 @@ var InternalTextarea = function InternalTextarea(props, ref) {
|
|
|
171
171
|
delete wrapperStyle[key];
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
-
var textarea =
|
|
174
|
+
var textarea = React.createElement("textarea", _extends({
|
|
175
175
|
ref: textareaRef,
|
|
176
176
|
disabled: disabled,
|
|
177
177
|
style: _extends({}, textareaStyles, hadCount || !!allowClear ? otherStyles : style),
|
|
@@ -183,12 +183,12 @@ var InternalTextarea = function InternalTextarea(props, ref) {
|
|
|
183
183
|
placeholder: placeholder,
|
|
184
184
|
maxLength: maxLength
|
|
185
185
|
}, others));
|
|
186
|
-
return hadCount ?
|
|
186
|
+
return hadCount ? React.createElement("span", {
|
|
187
187
|
style: wrapperStyle,
|
|
188
188
|
className: _concatInstanceProperty(_context2 = "".concat(prefixCls, "-countWrapper ")).call(_context2, className && !allowClear ? className : '')
|
|
189
189
|
}, textarea, renderNumberMark()) : textarea;
|
|
190
190
|
};
|
|
191
|
-
return
|
|
191
|
+
return React.createElement(ClearableInput, _extends({}, textAreaProps, {
|
|
192
192
|
handleReset: handleReset,
|
|
193
193
|
value: value,
|
|
194
194
|
inputType: "text",
|
|
@@ -197,6 +197,6 @@ var InternalTextarea = function InternalTextarea(props, ref) {
|
|
|
197
197
|
numberMark: renderNumberMark()
|
|
198
198
|
}));
|
|
199
199
|
};
|
|
200
|
-
var TextArea =
|
|
200
|
+
var TextArea = React.forwardRef(InternalTextarea);
|
|
201
201
|
TextArea.displayName = 'TextArea';
|
|
202
202
|
export default TextArea;
|
|
@@ -49,33 +49,28 @@ export default function calculateNodeHeight(uiTextNode) {
|
|
|
49
49
|
var maxHeight = _Number$MAX_SAFE_INTEGER;
|
|
50
50
|
var height = parseFloat(new Big(hiddenTextarea.scrollHeight).valueOf());
|
|
51
51
|
if (boxSizing === 'border-box') {
|
|
52
|
-
height = parseFloat(new Big(height).plus(borderSize).valueOf());
|
|
52
|
+
height = parseFloat(new Big(height).plus(borderSize).valueOf());
|
|
53
53
|
} else if (boxSizing === 'content-box') {
|
|
54
|
-
height = parseFloat(new Big(height).minus(paddingSize).valueOf());
|
|
54
|
+
height = parseFloat(new Big(height).minus(paddingSize).valueOf());
|
|
55
55
|
}
|
|
56
|
-
|
|
57
56
|
if (minRows !== null || maxRows !== null) {
|
|
58
57
|
hiddenTextarea.value = ' ';
|
|
59
58
|
var bigSingleRowHeight = new Big(hiddenTextarea.scrollHeight).minus(paddingSize);
|
|
60
59
|
if (minRows !== null) {
|
|
61
60
|
minHeight = parseFloat(bigSingleRowHeight.times(minRows).valueOf());
|
|
62
61
|
if (boxSizing === 'border-box') {
|
|
63
|
-
minHeight = parseFloat(new Big(minHeight).plus(paddingSize).plus(borderSize).valueOf());
|
|
62
|
+
minHeight = parseFloat(new Big(minHeight).plus(paddingSize).plus(borderSize).valueOf());
|
|
64
63
|
}
|
|
65
|
-
|
|
66
|
-
height = new Big(minHeight).gt(height) ? minHeight : height; // Math.max(minHeight, height)
|
|
64
|
+
height = new Big(minHeight).gt(height) ? minHeight : height;
|
|
67
65
|
}
|
|
68
|
-
|
|
69
66
|
if (maxRows !== null) {
|
|
70
67
|
maxHeight = parseFloat(bigSingleRowHeight.times(maxRows).valueOf());
|
|
71
68
|
if (boxSizing === 'border-box') {
|
|
72
|
-
maxHeight = parseFloat(new Big(maxHeight).plus(paddingSize).plus(borderSize).valueOf());
|
|
69
|
+
maxHeight = parseFloat(new Big(maxHeight).plus(paddingSize).plus(borderSize).valueOf());
|
|
73
70
|
}
|
|
74
|
-
|
|
75
|
-
height = new Big(maxHeight).lt(height) ? maxHeight : height; // Math.min(maxHeight, height)
|
|
71
|
+
height = new Big(maxHeight).lt(height) ? maxHeight : height;
|
|
76
72
|
}
|
|
77
73
|
}
|
|
78
|
-
|
|
79
74
|
var overflowY = new Big(height).lt(maxHeight) ? 'hidden' : '';
|
|
80
75
|
return {
|
|
81
76
|
height: height,
|
package/es/input/index.js
CHANGED
package/es/input/input.js
CHANGED
|
@@ -69,7 +69,7 @@ var InternalInput = function InternalInput(props, ref) {
|
|
|
69
69
|
showNumberMark = _useState4[0],
|
|
70
70
|
setShowNumberMark = _useState4[1];
|
|
71
71
|
var inputRef = useRef();
|
|
72
|
-
var inputPrefixCls = getPrefixCls(prefixCls, 'input', customPrefixcls);
|
|
72
|
+
var inputPrefixCls = getPrefixCls(prefixCls, 'input', customPrefixcls);
|
|
73
73
|
var addonBefore = others.addonBefore,
|
|
74
74
|
addonAfter = others.addonAfter;
|
|
75
75
|
var inputClasses = classNames(inputPrefixCls, (_classNames = {}, _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(inputPrefixCls, "-size-")).call(_context, size), size), _defineProperty(_classNames, "".concat(inputPrefixCls, "-borderless"), borderType === 'none'), _defineProperty(_classNames, "".concat(inputPrefixCls, "-underline"), borderType === 'underline'), _defineProperty(_classNames, "".concat(inputPrefixCls, "-error"), status === 'error'), _defineProperty(_classNames, "".concat(inputPrefixCls, "-disabled"), disabled), _classNames), _defineProperty({}, className, className && !hasPrefixSuffix(inputProps) && !addonBefore && !addonAfter));
|
|
@@ -118,14 +118,14 @@ var InternalInput = function InternalInput(props, ref) {
|
|
|
118
118
|
enteredLength = maxLength;
|
|
119
119
|
}
|
|
120
120
|
if (count && showNumberMark && !disabled) {
|
|
121
|
-
return
|
|
121
|
+
return React.createElement("div", {
|
|
122
122
|
className: classNames("".concat(inputPrefixCls, "-input-mark-inner"))
|
|
123
123
|
}, enteredLength, maxLength !== undefined ? "/".concat(maxLength) : null);
|
|
124
124
|
}
|
|
125
125
|
return null;
|
|
126
126
|
};
|
|
127
127
|
var renderInput = function renderInput() {
|
|
128
|
-
return
|
|
128
|
+
return React.createElement("input", _extends({
|
|
129
129
|
ref: inputRef,
|
|
130
130
|
type: type,
|
|
131
131
|
disabled: disabled,
|
|
@@ -166,7 +166,7 @@ var InternalInput = function InternalInput(props, ref) {
|
|
|
166
166
|
}
|
|
167
167
|
};
|
|
168
168
|
});
|
|
169
|
-
return
|
|
169
|
+
return React.createElement(ClearableInput, _extends({}, inputProps, {
|
|
170
170
|
handleReset: handleReset,
|
|
171
171
|
value: value,
|
|
172
172
|
inputType: "input",
|
|
@@ -177,6 +177,6 @@ var InternalInput = function InternalInput(props, ref) {
|
|
|
177
177
|
inputCount: renderCount()
|
|
178
178
|
}));
|
|
179
179
|
};
|
|
180
|
-
var Input =
|
|
180
|
+
var Input = React.forwardRef(InternalInput);
|
|
181
181
|
Input.displayName = 'Input';
|
|
182
182
|
export default Input;
|
|
@@ -79,7 +79,7 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
|
|
|
79
79
|
var isScopeValid = function isScopeValid(value) {
|
|
80
80
|
if (value === '') return true;
|
|
81
81
|
var numberValue = parseFloat(value) || 0;
|
|
82
|
-
if (min >= 0 && value.substr(0, 1) === '-') return false;
|
|
82
|
+
if (min >= 0 && value.substr(0, 1) === '-') return false;
|
|
83
83
|
if (minMark === '[' && numberValue < min || minMark === '(' && numberValue <= min || maxMark === ']' && numberValue > max || maxMark === ')' && numberValue >= max) return false;
|
|
84
84
|
return true;
|
|
85
85
|
};
|
|
@@ -97,15 +97,11 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
|
|
|
97
97
|
});
|
|
98
98
|
};
|
|
99
99
|
var verifiValue = function verifiValue(initValue) {
|
|
100
|
-
// 将 value 进行数字序列化 剔除非数字输入-复制粘贴的情况
|
|
101
100
|
var value = serialization(initValue);
|
|
102
|
-
// 校验数字合法性
|
|
103
101
|
if (!/^-?\d*\.?\d*$/.test(value)) return false;
|
|
104
|
-
// 输入内容超出数字范围不允许输入
|
|
105
102
|
if (mustInScope && !isScopeValid(value)) {
|
|
106
103
|
return false;
|
|
107
104
|
}
|
|
108
|
-
// 整数字段不允许输入小数点
|
|
109
105
|
if (decimalLength === 0 && _includesInstanceProperty(value).call(value, '.')) {
|
|
110
106
|
return false;
|
|
111
107
|
}
|
|
@@ -241,17 +237,14 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
|
|
|
241
237
|
_inputValue = '';
|
|
242
238
|
}
|
|
243
239
|
var bigValue = new Big(Number(_inputValue));
|
|
244
|
-
// 还原最小值
|
|
245
240
|
if (typeof min === 'number' && bigValue.lt(min)) {
|
|
246
241
|
_inputValue = min.toString();
|
|
247
242
|
onChange === null || onChange === void 0 ? void 0 : onChange(handleEventAttachValue(event, numberMode ? Number(_inputValue) : _inputValue));
|
|
248
243
|
}
|
|
249
|
-
// 还原最大值
|
|
250
244
|
if (typeof max === 'number' && bigValue.gt(max)) {
|
|
251
245
|
_inputValue = max.toString();
|
|
252
246
|
onChange === null || onChange === void 0 ? void 0 : onChange(handleEventAttachValue(event, numberMode ? Number(_inputValue) : _inputValue));
|
|
253
247
|
}
|
|
254
|
-
// 超过精度位数直接截断
|
|
255
248
|
_inputValue = handleNumericalAccuracy(_inputValue);
|
|
256
249
|
var formatValue = handleFormatValue(_inputValue, {
|
|
257
250
|
mask: mask,
|
|
@@ -336,7 +329,7 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
|
|
|
336
329
|
handleChange(e);
|
|
337
330
|
}
|
|
338
331
|
};
|
|
339
|
-
return
|
|
332
|
+
return React.createElement(Input, _extends({}, others, {
|
|
340
333
|
onCompositionStart: handleComposition,
|
|
341
334
|
onCompositionUpdate: handleComposition,
|
|
342
335
|
onCompositionEnd: handleComposition,
|
|
@@ -351,6 +344,6 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
|
|
|
351
344
|
className: classNames(inputPrefixCls, className)
|
|
352
345
|
}));
|
|
353
346
|
};
|
|
354
|
-
var InputNumber =
|
|
347
|
+
var InputNumber = React.forwardRef(InternalInputNumber);
|
|
355
348
|
InputNumber.displayName = 'InputNumber';
|
|
356
349
|
export default InputNumber;
|
package/es/layout/layout.js
CHANGED
|
@@ -17,7 +17,7 @@ import * as React from 'react';
|
|
|
17
17
|
import classNames from 'classnames';
|
|
18
18
|
import { getCompProps } from '../_utils';
|
|
19
19
|
import { ConfigContext } from '../config-provider';
|
|
20
|
-
export var LayoutContext =
|
|
20
|
+
export var LayoutContext = React.createContext({
|
|
21
21
|
siderHook: {
|
|
22
22
|
addSider: function addSider() {
|
|
23
23
|
return null;
|
|
@@ -37,12 +37,10 @@ function generator(_ref) {
|
|
|
37
37
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
38
38
|
pkgPrefixCls = _React$useContext.prefixCls,
|
|
39
39
|
userDefaultProps = _React$useContext.compDefaultProps;
|
|
40
|
-
// 属性需要合并一遍用户定义的默认属性
|
|
41
40
|
var _getCompProps = getCompProps('Layout', userDefaultProps, props),
|
|
42
41
|
customPrefixcls = _getCompProps.prefixCls;
|
|
43
|
-
// className前缀
|
|
44
42
|
var prefixCls = getPrefixCls(pkgPrefixCls, suffixCls, customPrefixcls);
|
|
45
|
-
return
|
|
43
|
+
return React.createElement(BasicComponent, _extends({
|
|
46
44
|
prefixCls: prefixCls,
|
|
47
45
|
tagName: tagName
|
|
48
46
|
}, props));
|
|
@@ -54,7 +52,6 @@ function generator(_ref) {
|
|
|
54
52
|
var Basic = function Basic(props) {
|
|
55
53
|
var _React$useContext2 = React.useContext(ConfigContext),
|
|
56
54
|
userDefaultProps = _React$useContext2.compDefaultProps;
|
|
57
|
-
// 属性需要合并一遍用户定义的默认属性
|
|
58
55
|
var _a = getCompProps('Layout', userDefaultProps, props),
|
|
59
56
|
className = _a.className,
|
|
60
57
|
children = _a.children,
|
|
@@ -62,14 +59,13 @@ var Basic = function Basic(props) {
|
|
|
62
59
|
tagName = _a.tagName,
|
|
63
60
|
others = __rest(_a, ["className", "children", "prefixCls", "tagName"]);
|
|
64
61
|
var classString = classNames(prefixCls, className);
|
|
65
|
-
return
|
|
62
|
+
return React.createElement(tagName, _extends({
|
|
66
63
|
className: classString
|
|
67
64
|
}, others), children);
|
|
68
65
|
};
|
|
69
66
|
var BasicLayout = function BasicLayout(props) {
|
|
70
67
|
var _React$useContext3 = React.useContext(ConfigContext),
|
|
71
68
|
userDefaultProps = _React$useContext3.compDefaultProps;
|
|
72
|
-
// 属性需要合并一遍用户定义的默认属性
|
|
73
69
|
var _a = getCompProps('Layout', userDefaultProps, props),
|
|
74
70
|
style = _a.style,
|
|
75
71
|
className = _a.className,
|
|
@@ -84,7 +80,7 @@ var BasicLayout = function BasicLayout(props) {
|
|
|
84
80
|
setSiders = _React$useState2[1];
|
|
85
81
|
var classString = classNames(prefixCls, _defineProperty({}, "".concat(prefixCls, "-has-sider"), typeof hasSider === 'boolean' ? hasSider : siders.length > 0), className);
|
|
86
82
|
var styleString = _extends({}, style);
|
|
87
|
-
return
|
|
83
|
+
return React.createElement(LayoutContext.Provider, {
|
|
88
84
|
value: {
|
|
89
85
|
siderHook: {
|
|
90
86
|
addSider: function addSider(id) {
|
|
@@ -102,7 +98,7 @@ var BasicLayout = function BasicLayout(props) {
|
|
|
102
98
|
}
|
|
103
99
|
}
|
|
104
100
|
}
|
|
105
|
-
},
|
|
101
|
+
}, React.createElement(Tag, _extends({
|
|
106
102
|
className: classString
|
|
107
103
|
}, others, {
|
|
108
104
|
style: styleString
|