@kdcloudjs/kdesign 1.8.12 → 1.8.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kdesign.css +1 -1
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +5 -3
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +1 -1
- package/dist/kdesign.min.js +2 -2
- package/dist/kdesign.min.js.map +1 -1
- package/es/_utils/KeyCode.js +1 -333
- package/es/_utils/arrayUtil.js +0 -8
- package/es/_utils/formatUtil.js +9 -59
- package/es/_utils/getStringLength.js +0 -1
- package/es/_utils/hooks.js +2 -34
- package/es/_utils/index.js +1 -7
- package/es/_utils/numberUtil.js +0 -54
- package/es/_utils/raf.js +2 -2
- package/es/_utils/reactNode.js +1 -1
- package/es/_utils/resizeObserver.js +2 -4
- package/es/_utils/type.js +0 -1
- package/es/_utils/usePopper.js +3 -3
- package/es/alert/alert.js +8 -16
- package/es/anchor/anchor-link.js +3 -3
- package/es/anchor/anchor.js +23 -26
- package/es/anchor/context.js +1 -1
- package/es/avatar/avatar.js +8 -11
- package/es/badge/badge.js +7 -13
- package/es/base-data/base-data.js +34 -103
- package/es/breadcrumb/breadcrumb.js +12 -12
- package/es/breadcrumb/breadcrumbItem.js +5 -5
- package/es/button/button.js +13 -24
- package/es/button/group.js +13 -13
- package/es/card/card.js +12 -14
- package/es/carousel/carousel.js +13 -13
- package/es/carousel/displayList.js +3 -3
- package/es/carousel/fadeList.js +3 -3
- package/es/carousel/slideList.js +4 -4
- package/es/carousel/slidebar.js +3 -3
- package/es/cascader/cascader.js +31 -36
- package/es/checkbox/checkbox.js +25 -30
- package/es/checkbox/group.js +8 -9
- package/es/city-picker/city-picker.js +28 -38
- package/es/city-picker/interface.js +1 -1
- package/es/city-picker/option.js +4 -4
- package/es/clipboard/clipboard.js +5 -23
- package/es/clipboard/util.js +0 -60
- package/es/collapse/collapse.js +5 -5
- package/es/collapse/panel.js +15 -15
- package/es/color-picker/color-picker-panel.js +12 -13
- package/es/color-picker/color-picker.js +6 -10
- package/es/color-picker/utils/validateColor.js +0 -3
- package/es/config-provider/ConfigContext.js +1 -4
- package/es/config-provider/SizeContext.js +3 -3
- package/es/config-provider/compDefaultProps.js +3 -10
- package/es/config-provider/configProvider.js +1 -6
- package/es/config-provider/defaultConfig.js +0 -1
- package/es/date-picker/calendar.js +6 -23
- package/es/date-picker/context.js +1 -1
- package/es/date-picker/date-panel.js +12 -13
- package/es/date-picker/date-picker.js +7 -12
- package/es/date-picker/hooks/use-hover-value.js +0 -1
- package/es/date-picker/hooks/use-picker-input.js +0 -4
- package/es/date-picker/hooks/use-range-disabled.js +2 -6
- package/es/date-picker/hooks/use-range-view-dates.js +1 -9
- package/es/date-picker/hooks/use-text-value-mapping.js +0 -1
- package/es/date-picker/locale/zh_CN.js +0 -1
- package/es/date-picker/panel/date-time/date-time.js +4 -6
- package/es/date-picker/panel/header/header.js +14 -14
- package/es/date-picker/panel/month/month.js +5 -6
- package/es/date-picker/panel/quarter/quarter.js +4 -4
- package/es/date-picker/panel/time/time-column.js +4 -6
- package/es/date-picker/panel/time/time.js +10 -35
- package/es/date-picker/panel/week/week.js +5 -8
- package/es/date-picker/panel/year/year.js +4 -6
- package/es/date-picker/popper.js +3 -6
- package/es/date-picker/range/input-range.js +12 -13
- package/es/date-picker/range-picker.js +13 -36
- package/es/date-picker/single/input-date.js +8 -14
- package/es/date-picker/utils/date-fns.js +0 -35
- package/es/date-picker/utils/get-extra-footer.js +1 -1
- package/es/date-picker/utils/get-ranges.js +8 -8
- package/es/date-picker/utils/index.js +0 -3
- package/es/divider/divider.js +2 -2
- package/es/drawer/drawer.js +14 -39
- package/es/dropdown/dropdown.js +10 -11
- package/es/dropdown/menu.js +8 -12
- package/es/empty/defaultEmptyImg.js +18 -18
- package/es/empty/empty.js +9 -10
- package/es/empty/illustrationEmptyImg.js +106 -106
- package/es/filter/condition.js +10 -10
- package/es/filter/filter.js +17 -19
- package/es/filter/scheme.js +34 -41
- package/es/form/Field.js +5 -5
- package/es/form/FieldContext.js +1 -1
- package/es/form/FieldLabel.js +2 -2
- package/es/form/FieldWrapper.js +6 -6
- package/es/form/Form.js +2 -5
- package/es/form/FormContext.js +2 -4
- package/es/form/hooks/useForm.js +1 -14
- package/es/form/index.js +1 -1
- package/es/grid/col.js +1 -7
- package/es/grid/row.js +3 -9
- package/es/icon/icon.js +2 -2
- package/es/image/image.js +5 -7
- package/es/image/preview-group.js +3 -4
- package/es/image/preview.js +22 -24
- package/es/image-cropper/cropper.js +3 -6
- package/es/image-cropper/image-cropper.js +5 -5
- package/es/image-cropper/operation-bar.js +9 -9
- package/es/index.js +4 -0
- package/es/input/ClearableLabeledInput.js +13 -13
- package/es/input/TextArea.js +7 -7
- package/es/input/calculateNodeHeight.js +6 -11
- package/es/input/index.js +0 -1
- package/es/input/input.js +5 -5
- package/es/input-number/inputNumber.js +3 -10
- package/es/layout/layout.js +5 -9
- package/es/layout/sider.js +11 -14
- package/es/link/link.js +8 -12
- package/es/locale/locale.js +4 -34
- package/es/menu/menu.js +3 -4
- package/es/menu/menuItem.js +8 -13
- package/es/menu/subMenu.js +19 -27
- package/es/menu/util.js +0 -4
- package/es/message/content.js +13 -13
- package/es/message/index.js +1 -3
- package/es/modal/confirm.js +1 -1
- package/es/modal/modal.js +32 -40
- package/es/notification/content.js +18 -18
- package/es/notification/index.js +1 -1
- package/es/notification-base/index.js +1 -1
- package/es/notification-base/notice.js +2 -2
- package/es/notification-base/notification.js +3 -3
- package/es/pagination/pagination.js +48 -70
- package/es/popconfirm/popconfirm.js +8 -10
- package/es/popper/index.d.ts +2 -0
- package/es/popper/index.js +9 -15
- package/es/progress/circle.js +6 -8
- package/es/progress/line.js +3 -3
- package/es/progress/progress.js +11 -11
- package/es/qr-code/qr-code.js +6 -6
- package/es/radio/context.js +1 -1
- package/es/radio/group.js +9 -13
- package/es/radio/radio-button.js +2 -2
- package/es/radio/radio.js +19 -24
- package/es/rate/rate.js +11 -61
- package/es/search/option.js +4 -5
- package/es/search/quick-search.js +36 -57
- package/es/search/search-panel.js +56 -60
- package/es/search/search.js +9 -10
- package/es/select/interface.js +1 -1
- package/es/select/option.js +4 -4
- package/es/select/select.js +47 -87
- package/es/signature/drawingBoard.js +16 -16
- package/es/signature/signature.js +20 -20
- package/es/signature/utils/signature_pad.js +4 -12
- package/es/slider/marks.js +3 -5
- package/es/slider/slider.js +11 -32
- package/es/slider/sliderTooltip.js +3 -3
- package/es/slider/steps.js +2 -2
- package/es/slider/track.js +1 -1
- package/es/space/space.js +3 -5
- package/es/spin/spin.js +16 -18
- package/es/split-panel/split-panel.js +7 -18
- package/es/split-panel/trigger.js +6 -6
- package/es/stepper/stepper.js +11 -12
- package/es/steps/Step.js +8 -8
- package/es/steps/Steps.js +5 -5
- package/es/switch/switch.js +4 -6
- package/es/table/api.js +5 -22
- package/es/table/table.js +4 -15
- package/es/tabs/active-line.js +2 -6
- package/es/tabs/arrow-button.js +3 -3
- package/es/tabs/context.js +1 -1
- package/es/tabs/index.js +0 -1
- package/es/tabs/tab-pane.js +6 -6
- package/es/tabs/tabs.js +31 -34
- package/es/tag/tag.js +7 -15
- package/es/timeline/Timeline.js +5 -5
- package/es/timeline/TimelineItem.js +5 -5
- package/es/tooltip/tooltip.js +2 -2
- package/es/transfer/list-body.js +4 -4
- package/es/transfer/list-item.js +5 -6
- package/es/transfer/list.js +18 -22
- package/es/transfer/operation.js +7 -7
- package/es/transfer/search.js +5 -5
- package/es/transfer/transfer.js +8 -13
- package/es/tree/tree.js +9 -9
- package/es/tree/treeNode.js +18 -20
- package/es/tree/utils/treeUtils.js +1 -27
- package/es/tree-select/interface.js +1 -1
- package/es/tree-select/tree-select.js +35 -48
- package/es/typography/base.js +5 -5
- package/es/typography/index.js +0 -1
- package/es/typography/paragraph.js +1 -1
- package/es/typography/text.js +1 -1
- package/es/typography/title.js +1 -1
- package/es/typography/typography.js +4 -8
- package/es/upload/dragger.js +2 -2
- package/es/upload/request.js +0 -5
- package/es/upload/scan-files.js +0 -1
- package/es/upload/upload.js +34 -34
- package/es/upload/verify-file.js +0 -1
- package/es/view-container/context.js +1 -1
- package/es/view-container/view-container.js +4 -8
- package/es/virtual-list/Filler.js +2 -2
- package/es/virtual-list/utils/algorithmUtil.js +0 -13
- package/es/virtual-list/utils/itemUtil.js +0 -30
- package/es/virtual-list/virtual-list.js +8 -11
- package/lib/_utils/KeyCode.js +1 -333
- package/lib/_utils/arrayUtil.js +0 -8
- package/lib/_utils/formatUtil.js +9 -59
- package/lib/_utils/getStringLength.js +0 -1
- package/lib/_utils/hooks.js +2 -34
- package/lib/_utils/index.js +0 -7
- package/lib/_utils/numberUtil.js +0 -54
- package/lib/_utils/raf.js +2 -2
- package/lib/_utils/reactNode.js +1 -1
- package/lib/_utils/resizeObserver.js +2 -4
- package/lib/_utils/type.js +0 -1
- package/lib/_utils/usePopper.js +3 -3
- package/lib/alert/alert.js +8 -16
- package/lib/anchor/anchor-link.js +3 -3
- package/lib/anchor/anchor.js +23 -26
- package/lib/anchor/context.js +1 -1
- package/lib/avatar/avatar.js +8 -11
- package/lib/badge/badge.js +7 -13
- package/lib/base-data/base-data.js +34 -103
- package/lib/breadcrumb/breadcrumb.js +12 -12
- package/lib/breadcrumb/breadcrumbItem.js +5 -5
- package/lib/button/button.js +13 -24
- package/lib/button/group.js +13 -13
- package/lib/card/card.js +12 -14
- package/lib/carousel/carousel.js +13 -13
- package/lib/carousel/displayList.js +3 -3
- package/lib/carousel/fadeList.js +3 -3
- package/lib/carousel/slideList.js +4 -4
- package/lib/carousel/slidebar.js +3 -3
- package/lib/cascader/cascader.js +31 -36
- package/lib/checkbox/checkbox.js +25 -30
- package/lib/checkbox/group.js +8 -8
- package/lib/city-picker/city-picker.js +28 -38
- package/lib/city-picker/interface.js +1 -1
- package/lib/city-picker/option.js +4 -4
- package/lib/clipboard/clipboard.js +5 -23
- package/lib/clipboard/util.js +0 -60
- package/lib/collapse/collapse.js +5 -5
- package/lib/collapse/panel.js +15 -15
- package/lib/color-picker/color-picker-panel.js +12 -14
- package/lib/color-picker/color-picker.js +6 -10
- package/lib/color-picker/utils/validateColor.js +0 -3
- package/lib/config-provider/ConfigContext.js +1 -5
- package/lib/config-provider/SizeContext.js +3 -3
- package/lib/config-provider/compDefaultProps.js +3 -10
- package/lib/config-provider/configProvider.js +1 -7
- package/lib/config-provider/defaultConfig.js +0 -1
- package/lib/date-picker/calendar.js +6 -23
- package/lib/date-picker/context.js +1 -1
- package/lib/date-picker/date-panel.js +12 -13
- package/lib/date-picker/date-picker.js +7 -12
- package/lib/date-picker/hooks/use-hover-value.js +0 -1
- package/lib/date-picker/hooks/use-picker-input.js +0 -4
- package/lib/date-picker/hooks/use-range-disabled.js +2 -6
- package/lib/date-picker/hooks/use-range-view-dates.js +1 -9
- package/lib/date-picker/hooks/use-text-value-mapping.js +0 -1
- package/lib/date-picker/locale/zh_CN.js +0 -1
- package/lib/date-picker/panel/date-time/date-time.js +4 -6
- package/lib/date-picker/panel/header/header.js +14 -14
- package/lib/date-picker/panel/month/month.js +5 -6
- package/lib/date-picker/panel/quarter/quarter.js +4 -4
- package/lib/date-picker/panel/time/time-column.js +4 -6
- package/lib/date-picker/panel/time/time.js +10 -35
- package/lib/date-picker/panel/week/week.js +5 -8
- package/lib/date-picker/panel/year/year.js +4 -6
- package/lib/date-picker/popper.js +3 -6
- package/lib/date-picker/range/input-range.js +12 -13
- package/lib/date-picker/range-picker.js +13 -36
- package/lib/date-picker/single/input-date.js +8 -14
- package/lib/date-picker/utils/date-fns.js +0 -34
- package/lib/date-picker/utils/get-extra-footer.js +1 -1
- package/lib/date-picker/utils/get-ranges.js +8 -8
- package/lib/date-picker/utils/index.js +0 -3
- package/lib/divider/divider.js +2 -2
- package/lib/drawer/drawer.js +14 -40
- package/lib/dropdown/dropdown.js +10 -11
- package/lib/dropdown/menu.js +8 -12
- package/lib/empty/defaultEmptyImg.js +18 -18
- package/lib/empty/empty.js +9 -10
- package/lib/empty/illustrationEmptyImg.js +106 -106
- package/lib/filter/condition.js +10 -10
- package/lib/filter/filter.js +17 -19
- package/lib/filter/scheme.js +34 -41
- package/lib/form/Field.js +5 -5
- package/lib/form/FieldContext.js +1 -1
- package/lib/form/FieldLabel.js +2 -2
- package/lib/form/FieldWrapper.js +6 -6
- package/lib/form/Form.js +2 -5
- package/lib/form/FormContext.js +2 -4
- package/lib/form/hooks/useForm.js +1 -14
- package/lib/form/index.js +1 -1
- package/lib/grid/col.js +1 -7
- package/lib/grid/row.js +3 -9
- package/lib/icon/icon.js +2 -2
- package/lib/image/image.js +5 -7
- package/lib/image/preview-group.js +3 -4
- package/lib/image/preview.js +22 -24
- package/lib/image-cropper/cropper.js +3 -6
- package/lib/image-cropper/image-cropper.js +5 -5
- package/lib/image-cropper/operation-bar.js +9 -9
- package/lib/index.js +2 -8
- package/lib/input/ClearableLabeledInput.js +13 -13
- package/lib/input/TextArea.js +7 -7
- package/lib/input/calculateNodeHeight.js +6 -11
- package/lib/input/index.js +0 -1
- package/lib/input/input.js +5 -5
- package/lib/input-number/inputNumber.js +3 -10
- package/lib/layout/layout.js +5 -9
- package/lib/layout/sider.js +11 -14
- package/lib/link/link.js +8 -12
- package/lib/locale/locale.js +4 -34
- package/lib/menu/menu.js +3 -4
- package/lib/menu/menuItem.js +8 -13
- package/lib/menu/subMenu.js +19 -27
- package/lib/menu/util.js +0 -4
- package/lib/message/content.js +13 -13
- package/lib/message/index.js +1 -3
- package/lib/modal/confirm.js +1 -1
- package/lib/modal/modal.js +32 -40
- package/lib/notification/content.js +18 -18
- package/lib/notification/index.js +1 -1
- package/lib/notification-base/index.js +1 -1
- package/lib/notification-base/notice.js +2 -2
- package/lib/notification-base/notification.js +3 -3
- package/lib/pagination/pagination.js +48 -70
- package/lib/popconfirm/popconfirm.js +8 -10
- package/lib/popper/index.d.ts +2 -0
- package/lib/popper/index.js +9 -15
- package/lib/progress/circle.js +6 -8
- package/lib/progress/line.js +3 -3
- package/lib/progress/progress.js +11 -11
- package/lib/qr-code/qr-code.js +6 -6
- package/lib/radio/context.js +1 -1
- package/lib/radio/group.js +9 -13
- package/lib/radio/radio-button.js +2 -2
- package/lib/radio/radio.js +19 -24
- package/lib/rate/rate.js +11 -61
- package/lib/search/option.js +4 -5
- package/lib/search/quick-search.js +36 -57
- package/lib/search/search-panel.js +56 -60
- package/lib/search/search.js +9 -10
- package/lib/select/interface.js +1 -1
- package/lib/select/option.js +4 -4
- package/lib/select/select.js +47 -87
- package/lib/signature/drawingBoard.js +16 -16
- package/lib/signature/signature.js +20 -20
- package/lib/signature/utils/signature_pad.js +4 -12
- package/lib/slider/marks.js +3 -5
- package/lib/slider/slider.js +11 -32
- package/lib/slider/sliderTooltip.js +3 -3
- package/lib/slider/steps.js +2 -2
- package/lib/slider/track.js +1 -1
- package/lib/space/space.js +3 -5
- package/lib/spin/spin.js +16 -18
- package/lib/split-panel/split-panel.js +7 -18
- package/lib/split-panel/trigger.js +6 -6
- package/lib/stepper/stepper.js +11 -12
- package/lib/steps/Step.js +8 -8
- package/lib/steps/Steps.js +5 -5
- package/lib/switch/switch.js +4 -6
- package/lib/table/api.js +5 -22
- package/lib/table/table.js +4 -15
- package/lib/tabs/active-line.js +2 -6
- package/lib/tabs/arrow-button.js +3 -3
- package/lib/tabs/context.js +1 -1
- package/lib/tabs/index.js +0 -1
- package/lib/tabs/tab-pane.js +6 -6
- package/lib/tabs/tabs.js +31 -34
- package/lib/tag/tag.js +7 -15
- package/lib/timeline/Timeline.js +5 -5
- package/lib/timeline/TimelineItem.js +5 -5
- package/lib/tooltip/tooltip.js +2 -2
- package/lib/transfer/list-body.js +4 -4
- package/lib/transfer/list-item.js +5 -6
- package/lib/transfer/list.js +18 -22
- package/lib/transfer/operation.js +7 -7
- package/lib/transfer/search.js +5 -5
- package/lib/transfer/transfer.js +8 -13
- package/lib/tree/tree.js +9 -9
- package/lib/tree/treeNode.js +18 -20
- package/lib/tree/utils/treeUtils.js +1 -27
- package/lib/tree-select/interface.js +1 -1
- package/lib/tree-select/tree-select.js +35 -48
- package/lib/typography/base.js +5 -5
- package/lib/typography/index.js +0 -1
- package/lib/typography/paragraph.js +1 -1
- package/lib/typography/text.js +1 -1
- package/lib/typography/title.js +1 -1
- package/lib/typography/typography.js +4 -8
- package/lib/upload/dragger.js +2 -2
- package/lib/upload/request.js +0 -5
- package/lib/upload/scan-files.js +0 -1
- package/lib/upload/upload.js +34 -34
- package/lib/upload/verify-file.js +0 -1
- package/lib/view-container/context.js +1 -1
- package/lib/view-container/view-container.js +4 -8
- package/lib/virtual-list/Filler.js +2 -2
- package/lib/virtual-list/utils/algorithmUtil.js +0 -13
- package/lib/virtual-list/utils/itemUtil.js +0 -30
- package/lib/virtual-list/virtual-list.js +8 -12
- package/package.json +1 -3
package/lib/anchor/anchor.js
CHANGED
|
@@ -140,7 +140,7 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
140
140
|
affix = anchorProps.affix,
|
|
141
141
|
dropdownStyle = anchorProps.dropdownStyle,
|
|
142
142
|
onVisibleChange = anchorProps.onVisibleChange;
|
|
143
|
-
var anchorPrefixCls = getPrefixCls(prefixCls, 'anchor', customPrefixcls);
|
|
143
|
+
var anchorPrefixCls = getPrefixCls(prefixCls, 'anchor', customPrefixcls);
|
|
144
144
|
(0, _devwarning.default)(AnchorTypes.indexOf(type) === -1, 'anchor', "cannot found anchor type '".concat(type, "'"));
|
|
145
145
|
var _useState = (0, _react.useState)(null),
|
|
146
146
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -183,18 +183,16 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
183
183
|
isLocked = _useState20[0],
|
|
184
184
|
setIsLocked = _useState20[1];
|
|
185
185
|
var isAdcanced = type === 'advanced';
|
|
186
|
-
// ref
|
|
187
186
|
var wrapperRef = _react.default.useRef(null);
|
|
188
187
|
var inkRef = _react.default.useRef(null);
|
|
189
188
|
var linkContentRef = _react.default.useRef(null);
|
|
190
189
|
var iconRef = _react.default.useRef(null);
|
|
191
|
-
var menuWrapRef =
|
|
190
|
+
var menuWrapRef = _react.default.createRef();
|
|
192
191
|
var normalRef = _react.default.useRef(null);
|
|
193
192
|
var anchorRef = ref || normalRef;
|
|
194
193
|
var linksWidthRef = _react.default.useRef([]);
|
|
195
194
|
var animating = _react.default.useRef(false);
|
|
196
195
|
var wrapperClass = (0, _classnames.default)(className, (0, _defineProperty2.default)({}, "".concat(anchorPrefixCls, "-wrapper"), true));
|
|
197
|
-
// classes
|
|
198
196
|
var anchorMenuClass = (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(anchorPrefixCls, "-menu"), true));
|
|
199
197
|
var anchorAdvancedClass = (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(anchorPrefixCls, "-advanced"), true));
|
|
200
198
|
var inkClass = (0, _classnames.default)("".concat(anchorPrefixCls, "-line-slider"), {
|
|
@@ -212,7 +210,6 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
212
210
|
}
|
|
213
211
|
}, [anchorPrefixCls, anchorRef, isAdcanced]);
|
|
214
212
|
var mounting = _react.default.useRef(true);
|
|
215
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
216
213
|
(0, _react.useEffect)(function () {
|
|
217
214
|
var _a;
|
|
218
215
|
if (mounting.current) {
|
|
@@ -396,27 +393,27 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
396
393
|
var _context4;
|
|
397
394
|
return (0, _map.default)(_context4 = (0, _reactChildren.toArray)(linksChildren)).call(_context4, function (item, indx) {
|
|
398
395
|
if (!item) return item;
|
|
399
|
-
return
|
|
396
|
+
return _react.default.cloneElement(item, {
|
|
400
397
|
isFirstLevel: true,
|
|
401
398
|
key: indx
|
|
402
399
|
});
|
|
403
400
|
});
|
|
404
401
|
};
|
|
405
402
|
var anchorBookmarksContent = function anchorBookmarksContent(ref) {
|
|
406
|
-
return
|
|
403
|
+
return _react.default.createElement("div", {
|
|
407
404
|
ref: ref,
|
|
408
405
|
className: wrapperClass,
|
|
409
406
|
style: style
|
|
410
|
-
},
|
|
407
|
+
}, _react.default.createElement("div", {
|
|
411
408
|
className: anchorPrefixCls,
|
|
412
409
|
style: fixedTop ? {
|
|
413
410
|
position: 'fixed',
|
|
414
411
|
top: offsetTop || 0,
|
|
415
412
|
width: anchorPosition.width
|
|
416
413
|
} : undefined
|
|
417
|
-
},
|
|
414
|
+
}, _react.default.createElement("div", {
|
|
418
415
|
className: "".concat(anchorPrefixCls, "-line")
|
|
419
|
-
},
|
|
416
|
+
}, _react.default.createElement("span", {
|
|
420
417
|
className: inkClass,
|
|
421
418
|
ref: inkRef
|
|
422
419
|
})), addChildrenProps(children)));
|
|
@@ -430,10 +427,10 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
430
427
|
setPositionHistory(positions);
|
|
431
428
|
setListPosition(positions[positions.length - 1]);
|
|
432
429
|
};
|
|
433
|
-
return
|
|
430
|
+
return _react.default.createElement("span", {
|
|
434
431
|
className: leftClasses,
|
|
435
432
|
onClick: handleLeft
|
|
436
|
-
},
|
|
433
|
+
}, _react.default.createElement(_index.Icon, {
|
|
437
434
|
type: "arrow-left"
|
|
438
435
|
}));
|
|
439
436
|
};
|
|
@@ -460,20 +457,20 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
460
457
|
});
|
|
461
458
|
setListPosition(posiostion);
|
|
462
459
|
};
|
|
463
|
-
return
|
|
460
|
+
return _react.default.createElement("span", {
|
|
464
461
|
className: rightClasses,
|
|
465
462
|
onClick: handleRight
|
|
466
|
-
},
|
|
463
|
+
}, _react.default.createElement(_index.Icon, {
|
|
467
464
|
type: "arrow-right"
|
|
468
465
|
}));
|
|
469
466
|
};
|
|
470
|
-
var anchorMenuContent =
|
|
467
|
+
var anchorMenuContent = _react.default.createElement("div", {
|
|
471
468
|
ref: anchorRef,
|
|
472
469
|
className: "".concat(anchorPrefixCls, "-menu-wrapper"),
|
|
473
470
|
style: (0, _extends2.default)({
|
|
474
471
|
width: '100%'
|
|
475
472
|
}, style)
|
|
476
|
-
},
|
|
473
|
+
}, _react.default.createElement("div", {
|
|
477
474
|
className: anchorMenuClass,
|
|
478
475
|
style: fixedTop ? {
|
|
479
476
|
position: 'fixed',
|
|
@@ -482,13 +479,13 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
482
479
|
} : {
|
|
483
480
|
width: style === null || style === void 0 ? void 0 : style.width
|
|
484
481
|
}
|
|
485
|
-
}, renderLeftArrow(),
|
|
482
|
+
}, renderLeftArrow(), _react.default.createElement("div", {
|
|
486
483
|
className: "".concat(anchorPrefixCls, "-menu-wrap"),
|
|
487
484
|
ref: menuWrapRef,
|
|
488
485
|
style: {
|
|
489
486
|
maxWidth: listWidth
|
|
490
487
|
}
|
|
491
|
-
},
|
|
488
|
+
}, _react.default.createElement("div", {
|
|
492
489
|
ref: linkContentRef,
|
|
493
490
|
className: "".concat(anchorPrefixCls, "-menu-link-list"),
|
|
494
491
|
style: {
|
|
@@ -497,27 +494,27 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
497
494
|
}, children)), renderRightArrow()));
|
|
498
495
|
var renderAnchorAdvanced = function renderAnchorAdvanced() {
|
|
499
496
|
var iconList = (0, _reactChildren.toArray)(lockedIcon);
|
|
500
|
-
var unlock = iconList[0] ||
|
|
497
|
+
var unlock = iconList[0] || _react.default.createElement(_index.Icon, {
|
|
501
498
|
type: "unlock-solid"
|
|
502
499
|
});
|
|
503
|
-
var lock = iconList[1] ||
|
|
500
|
+
var lock = iconList[1] || _react.default.createElement(_index.Icon, {
|
|
504
501
|
type: "lock-solid"
|
|
505
502
|
});
|
|
506
|
-
return
|
|
503
|
+
return _react.default.createElement("div", {
|
|
507
504
|
ref: fixedRef,
|
|
508
505
|
className: anchorAdvancedClass,
|
|
509
506
|
style: dropdownStyle
|
|
510
|
-
}, lockedIcon !== false &&
|
|
507
|
+
}, lockedIcon !== false && _react.default.createElement("span", {
|
|
511
508
|
className: "".concat(anchorPrefixCls, "-advanced-lock"),
|
|
512
509
|
onClick: function onClick() {
|
|
513
510
|
return setIsLocked(!isLocked);
|
|
514
511
|
}
|
|
515
512
|
}, isLocked ? lock : unlock), anchorBookmarksContent(wrapperRef));
|
|
516
513
|
};
|
|
517
|
-
var anchorAdvancedContent = (0, _usePopper.default)(
|
|
514
|
+
var anchorAdvancedContent = (0, _usePopper.default)(_react.default.createElement("span", {
|
|
518
515
|
className: "".concat(anchorPrefixCls, "-advanced-arrows"),
|
|
519
516
|
ref: isAdcanced ? ref || iconRef : null
|
|
520
|
-
}, icon ||
|
|
517
|
+
}, icon || _react.default.createElement(_index.Icon, {
|
|
521
518
|
type: "location-solid"
|
|
522
519
|
})), renderAnchorAdvanced(), popperProps);
|
|
523
520
|
var renderAnchorContent = function renderAnchorContent(anchorType) {
|
|
@@ -532,7 +529,7 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
532
529
|
return anchorBookmarksContent(anchorRef);
|
|
533
530
|
}
|
|
534
531
|
};
|
|
535
|
-
return
|
|
532
|
+
return _react.default.createElement(_context6.default.Provider, {
|
|
536
533
|
value: {
|
|
537
534
|
registerLink: registerLink,
|
|
538
535
|
activeLink: activeLink,
|
|
@@ -542,7 +539,7 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
542
539
|
}
|
|
543
540
|
}, renderAnchorContent(type));
|
|
544
541
|
};
|
|
545
|
-
var Anchor =
|
|
542
|
+
var Anchor = _react.default.forwardRef(InternalAnchor);
|
|
546
543
|
Anchor.displayName = 'Anchor';
|
|
547
544
|
var _default = Anchor;
|
|
548
545
|
exports.default = _default;
|
package/lib/anchor/context.js
CHANGED
|
@@ -10,6 +10,6 @@ exports.default = void 0;
|
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
-
var AnchorContext =
|
|
13
|
+
var AnchorContext = React.createContext(null);
|
|
14
14
|
var _default = AnchorContext;
|
|
15
15
|
exports.default = _default;
|
package/lib/avatar/avatar.js
CHANGED
|
@@ -59,13 +59,11 @@ var InternalAvatar = function InternalAvatar(props, ref) {
|
|
|
59
59
|
_React$useState6 = (0, _slicedToArray2.default)(_React$useState5, 2),
|
|
60
60
|
mounted = _React$useState6[0],
|
|
61
61
|
setMounted = _React$useState6[1];
|
|
62
|
-
|
|
63
|
-
var avatarRef = ref || /*#__PURE__*/_react.default.createRef();
|
|
62
|
+
var avatarRef = ref || _react.default.createRef();
|
|
64
63
|
var avatarChildrenRef = _react.default.useRef();
|
|
65
|
-
// class
|
|
66
64
|
var avatarPrefixCls = getPrefixCls(prefixCls, 'avatar', customPrefixcls);
|
|
67
65
|
var sizeClasses = (0, _classnames.default)((_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(avatarPrefixCls, "-lg"), size === 'large'), (0, _defineProperty2.default)(_classNames, "".concat(avatarPrefixCls, "-md"), size === 'middle'), (0, _defineProperty2.default)(_classNames, "".concat(avatarPrefixCls, "-sm"), size === 'small'), (0, _defineProperty2.default)(_classNames, "".concat(avatarPrefixCls, "-xs"), size === 'extra-small'), _classNames));
|
|
68
|
-
var hasImageElement =
|
|
66
|
+
var hasImageElement = _react.default.isValidElement(src);
|
|
69
67
|
var isShowDefaultIcon = !src && !icon && !children;
|
|
70
68
|
var avatarClasses = (0, _classnames.default)(avatarPrefixCls, sizeClasses, (_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, (0, _concat.default)(_context = "".concat(avatarPrefixCls, "-")).call(_context, shape), !!shape), (0, _defineProperty2.default)(_classNames2, "".concat(avatarPrefixCls, "-image"), hasImageElement || src && isImgExist), (0, _defineProperty2.default)(_classNames2, "".concat(avatarPrefixCls, "-icon"), !!icon || isShowDefaultIcon), (0, _defineProperty2.default)(_classNames2, "".concat(avatarPrefixCls, "-disabled"), disabled), _classNames2), className);
|
|
71
69
|
var sizeStyle = typeof size === 'number' ? {
|
|
@@ -80,7 +78,6 @@ var InternalAvatar = function InternalAvatar(props, ref) {
|
|
|
80
78
|
}, [src]);
|
|
81
79
|
_react.default.useEffect(function () {
|
|
82
80
|
setScaleParam();
|
|
83
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
84
81
|
}, [gap]);
|
|
85
82
|
_react.default.useEffect(function () {
|
|
86
83
|
setMounted(true);
|
|
@@ -106,7 +103,7 @@ var InternalAvatar = function InternalAvatar(props, ref) {
|
|
|
106
103
|
};
|
|
107
104
|
var childrenToRender;
|
|
108
105
|
if (typeof src === 'string' && isImgExist) {
|
|
109
|
-
childrenToRender =
|
|
106
|
+
childrenToRender = _react.default.createElement("img", {
|
|
110
107
|
src: src,
|
|
111
108
|
srcSet: srcSet,
|
|
112
109
|
draggable: draggable,
|
|
@@ -118,7 +115,7 @@ var InternalAvatar = function InternalAvatar(props, ref) {
|
|
|
118
115
|
} else if (icon) {
|
|
119
116
|
childrenToRender = icon;
|
|
120
117
|
} else if (!children) {
|
|
121
|
-
childrenToRender =
|
|
118
|
+
childrenToRender = _react.default.createElement(_index.Icon, {
|
|
122
119
|
type: "avatar-solid"
|
|
123
120
|
});
|
|
124
121
|
} else if (mounted || scale !== 1) {
|
|
@@ -128,7 +125,7 @@ var InternalAvatar = function InternalAvatar(props, ref) {
|
|
|
128
125
|
var sizeChildrenStyle = typeof size === 'number' ? {
|
|
129
126
|
lineHeight: "".concat(size, "px")
|
|
130
127
|
} : {};
|
|
131
|
-
childrenToRender =
|
|
128
|
+
childrenToRender = _react.default.createElement("span", {
|
|
132
129
|
className: "".concat(avatarPrefixCls, "-string"),
|
|
133
130
|
ref: function ref(node) {
|
|
134
131
|
avatarChildrenRef.current = node;
|
|
@@ -136,7 +133,7 @@ var InternalAvatar = function InternalAvatar(props, ref) {
|
|
|
136
133
|
style: (0, _extends2.default)((0, _extends2.default)({}, sizeChildrenStyle), childrenStyle)
|
|
137
134
|
}, children);
|
|
138
135
|
} else {
|
|
139
|
-
childrenToRender =
|
|
136
|
+
childrenToRender = _react.default.createElement("span", {
|
|
140
137
|
className: "".concat(avatarPrefixCls, "-string"),
|
|
141
138
|
style: {
|
|
142
139
|
opacity: 0
|
|
@@ -146,13 +143,13 @@ var InternalAvatar = function InternalAvatar(props, ref) {
|
|
|
146
143
|
}
|
|
147
144
|
}, children);
|
|
148
145
|
}
|
|
149
|
-
return
|
|
146
|
+
return _react.default.createElement("span", {
|
|
150
147
|
ref: avatarRef,
|
|
151
148
|
className: avatarClasses,
|
|
152
149
|
style: (0, _extends2.default)((0, _extends2.default)({}, sizeStyle), style)
|
|
153
150
|
}, childrenToRender);
|
|
154
151
|
};
|
|
155
|
-
var Avatar =
|
|
152
|
+
var Avatar = _react.default.forwardRef(InternalAvatar);
|
|
156
153
|
Avatar.displayName = 'Avatar';
|
|
157
154
|
var _default = Avatar;
|
|
158
155
|
exports.default = _default;
|
package/lib/badge/badge.js
CHANGED
|
@@ -60,8 +60,7 @@ var Badge = function Badge(props) {
|
|
|
60
60
|
_badgeProps$showZero = badgeProps.showZero,
|
|
61
61
|
showZero = _badgeProps$showZero === void 0 ? false : _badgeProps$showZero,
|
|
62
62
|
restProps = __rest(badgeProps, ["prefixCls", "children", "status", "text", "color", "count", "overflowCount", "dot", "size", "title", "offset", "style", "className", "showZero"]);
|
|
63
|
-
var badgePrefixCls = getPrefixCls(prefixCls, 'badge', customPrefixcls);
|
|
64
|
-
// ================================ Misc ================================
|
|
63
|
+
var badgePrefixCls = getPrefixCls(prefixCls, 'badge', customPrefixcls);
|
|
65
64
|
var numberedDisplayCount = count > overflowCount ? "".concat(overflowCount, "+") : count;
|
|
66
65
|
var hasStatus = status !== null && status !== undefined || color !== null && color !== undefined;
|
|
67
66
|
var isZero = numberedDisplayCount === '0' || numberedDisplayCount === 0;
|
|
@@ -76,7 +75,6 @@ var Badge = function Badge(props) {
|
|
|
76
75
|
if (!isHidden) {
|
|
77
76
|
isDotRef.current = showAsDot;
|
|
78
77
|
}
|
|
79
|
-
// =============================== Styles ===============================
|
|
80
78
|
var mergedStyle = (0, _react.useMemo)(function () {
|
|
81
79
|
if (!offset) {
|
|
82
80
|
return (0, _extends2.default)({}, style);
|
|
@@ -87,7 +85,6 @@ var Badge = function Badge(props) {
|
|
|
87
85
|
offsetStyle.right = -parseInt(offset[0], 10);
|
|
88
86
|
return (0, _extends2.default)((0, _extends2.default)({}, offsetStyle), style);
|
|
89
87
|
}, [offset, style]);
|
|
90
|
-
// =============================== Render ===============================
|
|
91
88
|
var badgeClassName = (0, _classnames.default)(badgePrefixCls, (_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(badgePrefixCls, "-status"), hasStatus), (0, _defineProperty2.default)(_classNames, "".concat(badgePrefixCls, "-not-a-wrapper"), !children), _classNames), className);
|
|
92
89
|
var isDot = isDotRef.current;
|
|
93
90
|
var scrollNumberCls = (0, _classnames.default)((_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, "".concat(badgePrefixCls, "-dot"), isDot), (0, _defineProperty2.default)(_classNames2, "".concat(badgePrefixCls, "-count"), !isDot), (0, _defineProperty2.default)(_classNames2, "".concat(badgePrefixCls, "-count-sm"), size === 'small'), (0, _defineProperty2.default)(_classNames2, "".concat(badgePrefixCls, "-multiple-words"), !isDot && mergedCount && mergedCount.toString().length > 1), (0, _defineProperty2.default)(_classNames2, (0, _concat.default)(_context = "".concat(badgePrefixCls, "-status-")).call(_context, status), !!status), _classNames2));
|
|
@@ -96,14 +93,11 @@ var Badge = function Badge(props) {
|
|
|
96
93
|
if (color) {
|
|
97
94
|
statusStyle.background = color;
|
|
98
95
|
}
|
|
99
|
-
// Title
|
|
100
96
|
var titleNode = title !== null && title !== void 0 ? title : typeof count === 'string' || typeof count === 'number' ? count : undefined;
|
|
101
|
-
|
|
102
|
-
var statusTextNode = isHidden || !text ? null : /*#__PURE__*/_react.default.createElement("span", {
|
|
97
|
+
var statusTextNode = isHidden || !text ? null : _react.default.createElement("span", {
|
|
103
98
|
className: "".concat(prefixCls, "-status-text")
|
|
104
99
|
}, text);
|
|
105
|
-
|
|
106
|
-
var displayNode = isSingleNumber ? /*#__PURE__*/_react.default.createElement("sup", {
|
|
100
|
+
var displayNode = isSingleNumber ? _react.default.createElement("sup", {
|
|
107
101
|
className: scrollNumberCls,
|
|
108
102
|
style: (0, _extends2.default)((0, _extends2.default)({}, mergedStyle), {
|
|
109
103
|
backgroundColor: color
|
|
@@ -117,20 +111,20 @@ var Badge = function Badge(props) {
|
|
|
117
111
|
});
|
|
118
112
|
if (!children && hasStatus) {
|
|
119
113
|
var statusTextColor = mergedStyle.color;
|
|
120
|
-
return
|
|
114
|
+
return _react.default.createElement("span", (0, _extends2.default)({}, restProps, {
|
|
121
115
|
className: badgeClassName,
|
|
122
116
|
style: mergedStyle
|
|
123
|
-
}),
|
|
117
|
+
}), _react.default.createElement("span", {
|
|
124
118
|
className: statusCls,
|
|
125
119
|
style: statusStyle
|
|
126
|
-
}),
|
|
120
|
+
}), _react.default.createElement("span", {
|
|
127
121
|
style: {
|
|
128
122
|
color: statusTextColor
|
|
129
123
|
},
|
|
130
124
|
className: "".concat(badgePrefixCls, "-status-text")
|
|
131
125
|
}, text));
|
|
132
126
|
}
|
|
133
|
-
return
|
|
127
|
+
return _react.default.createElement("span", (0, _extends2.default)({}, restProps, {
|
|
134
128
|
className: badgeClassName
|
|
135
129
|
}), children, !isHidden && displayNode, statusTextNode);
|
|
136
130
|
};
|