@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/badge/badge.js
CHANGED
|
@@ -46,8 +46,7 @@ var Badge = function Badge(props) {
|
|
|
46
46
|
_badgeProps$showZero = badgeProps.showZero,
|
|
47
47
|
showZero = _badgeProps$showZero === void 0 ? false : _badgeProps$showZero,
|
|
48
48
|
restProps = __rest(badgeProps, ["prefixCls", "children", "status", "text", "color", "count", "overflowCount", "dot", "size", "title", "offset", "style", "className", "showZero"]);
|
|
49
|
-
var badgePrefixCls = getPrefixCls(prefixCls, 'badge', customPrefixcls);
|
|
50
|
-
// ================================ Misc ================================
|
|
49
|
+
var badgePrefixCls = getPrefixCls(prefixCls, 'badge', customPrefixcls);
|
|
51
50
|
var numberedDisplayCount = count > overflowCount ? "".concat(overflowCount, "+") : count;
|
|
52
51
|
var hasStatus = status !== null && status !== undefined || color !== null && color !== undefined;
|
|
53
52
|
var isZero = numberedDisplayCount === '0' || numberedDisplayCount === 0;
|
|
@@ -62,7 +61,6 @@ var Badge = function Badge(props) {
|
|
|
62
61
|
if (!isHidden) {
|
|
63
62
|
isDotRef.current = showAsDot;
|
|
64
63
|
}
|
|
65
|
-
// =============================== Styles ===============================
|
|
66
64
|
var mergedStyle = useMemo(function () {
|
|
67
65
|
if (!offset) {
|
|
68
66
|
return _extends({}, style);
|
|
@@ -73,7 +71,6 @@ var Badge = function Badge(props) {
|
|
|
73
71
|
offsetStyle.right = -parseInt(offset[0], 10);
|
|
74
72
|
return _extends(_extends({}, offsetStyle), style);
|
|
75
73
|
}, [offset, style]);
|
|
76
|
-
// =============================== Render ===============================
|
|
77
74
|
var badgeClassName = classNames(badgePrefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(badgePrefixCls, "-status"), hasStatus), _defineProperty(_classNames, "".concat(badgePrefixCls, "-not-a-wrapper"), !children), _classNames), className);
|
|
78
75
|
var isDot = isDotRef.current;
|
|
79
76
|
var scrollNumberCls = classNames((_classNames2 = {}, _defineProperty(_classNames2, "".concat(badgePrefixCls, "-dot"), isDot), _defineProperty(_classNames2, "".concat(badgePrefixCls, "-count"), !isDot), _defineProperty(_classNames2, "".concat(badgePrefixCls, "-count-sm"), size === 'small'), _defineProperty(_classNames2, "".concat(badgePrefixCls, "-multiple-words"), !isDot && mergedCount && mergedCount.toString().length > 1), _defineProperty(_classNames2, _concatInstanceProperty(_context = "".concat(badgePrefixCls, "-status-")).call(_context, status), !!status), _classNames2));
|
|
@@ -82,14 +79,11 @@ var Badge = function Badge(props) {
|
|
|
82
79
|
if (color) {
|
|
83
80
|
statusStyle.background = color;
|
|
84
81
|
}
|
|
85
|
-
// Title
|
|
86
82
|
var titleNode = title !== null && title !== void 0 ? title : typeof count === 'string' || typeof count === 'number' ? count : undefined;
|
|
87
|
-
|
|
88
|
-
var statusTextNode = isHidden || !text ? null : /*#__PURE__*/React.createElement("span", {
|
|
83
|
+
var statusTextNode = isHidden || !text ? null : React.createElement("span", {
|
|
89
84
|
className: "".concat(prefixCls, "-status-text")
|
|
90
85
|
}, text);
|
|
91
|
-
|
|
92
|
-
var displayNode = isSingleNumber ? /*#__PURE__*/React.createElement("sup", {
|
|
86
|
+
var displayNode = isSingleNumber ? React.createElement("sup", {
|
|
93
87
|
className: scrollNumberCls,
|
|
94
88
|
style: _extends(_extends({}, mergedStyle), {
|
|
95
89
|
backgroundColor: color
|
|
@@ -103,20 +97,20 @@ var Badge = function Badge(props) {
|
|
|
103
97
|
});
|
|
104
98
|
if (!children && hasStatus) {
|
|
105
99
|
var statusTextColor = mergedStyle.color;
|
|
106
|
-
return
|
|
100
|
+
return React.createElement("span", _extends({}, restProps, {
|
|
107
101
|
className: badgeClassName,
|
|
108
102
|
style: mergedStyle
|
|
109
|
-
}),
|
|
103
|
+
}), React.createElement("span", {
|
|
110
104
|
className: statusCls,
|
|
111
105
|
style: statusStyle
|
|
112
|
-
}),
|
|
106
|
+
}), React.createElement("span", {
|
|
113
107
|
style: {
|
|
114
108
|
color: statusTextColor
|
|
115
109
|
},
|
|
116
110
|
className: "".concat(badgePrefixCls, "-status-text")
|
|
117
111
|
}, text));
|
|
118
112
|
}
|
|
119
|
-
return
|
|
113
|
+
return React.createElement("span", _extends({}, restProps, {
|
|
120
114
|
className: badgeClassName
|
|
121
115
|
}), children, !isHidden && displayNode, statusTextNode);
|
|
122
116
|
};
|
|
@@ -61,7 +61,7 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
61
61
|
onCollect = advancedSelectortProps.onCollect,
|
|
62
62
|
onShowMore = advancedSelectortProps.onShowMore,
|
|
63
63
|
onVisibleChange = advancedSelectortProps.onVisibleChange;
|
|
64
|
-
var isMultiple = mode === 'multiple';
|
|
64
|
+
var isMultiple = mode === 'multiple';
|
|
65
65
|
var _useState = useState([]),
|
|
66
66
|
_useState2 = _slicedToArray(_useState, 2),
|
|
67
67
|
seletedOptions = _useState2[0],
|
|
@@ -98,14 +98,11 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
98
98
|
deleteEndIndx: 0
|
|
99
99
|
});
|
|
100
100
|
var advancedSelectorfixCls = getPrefixCls(prefixCls, 'baseData', customPrefixcls);
|
|
101
|
-
// class
|
|
102
101
|
var advancedSelectorCls = classNames(advancedSelectorfixCls, className, _defineProperty({}, "".concat(advancedSelectorfixCls, "-disabled"), disabled));
|
|
103
|
-
// 多选模式下 维护新增选中的下标
|
|
104
102
|
useEffect(function () {
|
|
105
103
|
searchInfo.current.searchIndex = seletedOptions.length;
|
|
106
104
|
searchInfo.current.editOptions = seletedOptions;
|
|
107
105
|
}, [seletedOptions]);
|
|
108
|
-
// 记录每个选项的开始与结束下标
|
|
109
106
|
var setValIndxPosition = useCallback(function () {
|
|
110
107
|
var _context;
|
|
111
108
|
var str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
@@ -134,11 +131,9 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
134
131
|
}, [setValIndxPosition]);
|
|
135
132
|
useEffect(function () {
|
|
136
133
|
var seletedItems = [];
|
|
137
|
-
// 多选
|
|
138
134
|
if (isMultiple && Array.isArray(value)) {
|
|
139
135
|
seletedItems = value;
|
|
140
136
|
}
|
|
141
|
-
// 单选
|
|
142
137
|
if (!isMultiple && value) {
|
|
143
138
|
seletedItems = [value];
|
|
144
139
|
}
|
|
@@ -154,31 +149,22 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
154
149
|
var selectionStart = ((_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.selectionStart) || 0;
|
|
155
150
|
var index = findSelectionIndex(selectionStart, posList);
|
|
156
151
|
searchInfo.current.searchIndex = index;
|
|
157
|
-
// 新增一个
|
|
158
152
|
var list = _toConsumableArray(searchInfo.current.editOptions || []);
|
|
159
153
|
if (valueArr.length - preValueArr.length === 1) {
|
|
160
154
|
_spliceInstanceProperty(list).call(list, index, 0, null);
|
|
161
155
|
}
|
|
162
156
|
if (valueArr.length < preValueArr.length) {
|
|
163
157
|
var val = searchInfo.current.previousEditValue;
|
|
164
|
-
/**
|
|
165
|
-
* selectionStart 被删除的字符串开始下标
|
|
166
|
-
* deleteEndIndx 被删除的字符串结束下标
|
|
167
|
-
* 多选时,判断删除的字符包含了几个已选项
|
|
168
|
-
* 单选时,判断selectionStart与deleteEndIndx相等(都为0),则表示选项被删除
|
|
169
|
-
*/
|
|
170
158
|
var deleteEndIndx = isMultiple ? val.length - inputValue.length + selectionStart : 0;
|
|
171
159
|
var _findDeleteInterval = findDeleteInterval(selectionStart, deleteEndIndx, indxPosList),
|
|
172
160
|
start = _findDeleteInterval.start,
|
|
173
161
|
end = _findDeleteInterval.end;
|
|
174
162
|
list === null || list === void 0 ? void 0 : _spliceInstanceProperty(list).call(list, start, end - start + 1);
|
|
175
163
|
}
|
|
176
|
-
// 判断每次单个按del键时删除了分隔符后下一次触发
|
|
177
164
|
if (searchInfo.current.deleteEndIndx > 0 && selectionStart !== searchInfo.current.deleteEndIndx) {
|
|
178
165
|
var _findDeleteInterval2 = findDeleteInterval(selectionStart, searchInfo.current.deleteEndIndx, initIndexPos),
|
|
179
166
|
_start = _findDeleteInterval2.start,
|
|
180
167
|
_end = _findDeleteInterval2.end;
|
|
181
|
-
// 单个删除时找到合理的下标触发
|
|
182
168
|
if (_start !== null && _end !== null && _start <= _end) {
|
|
183
169
|
list === null || list === void 0 ? void 0 : _spliceInstanceProperty(list).call(list, _start, _end - _start + 1);
|
|
184
170
|
searchInfo.current.deleteEndIndx = 0;
|
|
@@ -186,7 +172,6 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
186
172
|
}
|
|
187
173
|
searchInfo.current.editOptions = list;
|
|
188
174
|
searchInfo.current.previousEditValue = inputValue;
|
|
189
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
190
175
|
}, [delimiter, inputValue, isMultiple, setValIndxPosition]);
|
|
191
176
|
var getStrToArr = function getStrToArr() {
|
|
192
177
|
var _context5;
|
|
@@ -207,11 +192,9 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
207
192
|
setShowTotal(false);
|
|
208
193
|
}
|
|
209
194
|
}, [inputValue, isMultiple]);
|
|
210
|
-
// 当选中项文字超出输入框时,显示共多少项
|
|
211
195
|
useLayoutEffect(function () {
|
|
212
196
|
handleShowTotal();
|
|
213
197
|
}, [handleShowTotal]);
|
|
214
|
-
// 通过选中项显示input文字, optionLabelProp为回填到选择框的属性
|
|
215
198
|
var setValueBySeleted = useCallback(function () {
|
|
216
199
|
var _context8;
|
|
217
200
|
var defaultInputValue = seletedOptions.reduce(function (pre, next, index, arr) {
|
|
@@ -242,17 +225,16 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
242
225
|
var textValue = e.target.value;
|
|
243
226
|
var val = textValue;
|
|
244
227
|
var inputDom = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input;
|
|
245
|
-
var selectionStart = inputDom.selectionStart || 0;
|
|
228
|
+
var selectionStart = inputDom.selectionStart || 0;
|
|
246
229
|
if (isMultiple && inputDom && textValue && textValue.length > inputValue.length) {
|
|
247
230
|
searchInfo.current.selectionStart = selectionStart;
|
|
248
|
-
var isInHead = selectionStart === 1 && textValue[1] !== delimiter && textValue.length !== 1;
|
|
231
|
+
var isInHead = selectionStart === 1 && textValue[1] !== delimiter && textValue.length !== 1;
|
|
249
232
|
var isInMid = selectionStart !== textValue.length && textValue[selectionStart - 2] === delimiter && textValue[selectionStart] !== delimiter;
|
|
250
233
|
if (isInHead || isInMid) {
|
|
251
234
|
inputDom.value = val = textValue.substring(0, selectionStart) + delimiter + textValue.substring(selectionStart, textValue.length);
|
|
252
235
|
setCursorPosition(inputDom, selectionStart);
|
|
253
236
|
}
|
|
254
237
|
}
|
|
255
|
-
// 单个删除时 当删除的字符为分隔符delimiter 记录位置
|
|
256
238
|
if (findDeletedChar(searchInfo.current.previousEditValue || '', textValue) === delimiter) {
|
|
257
239
|
searchInfo.current.deleteEndIndx = selectionStart;
|
|
258
240
|
}
|
|
@@ -271,13 +253,12 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
271
253
|
}
|
|
272
254
|
if (inputRef.current && queryStr) {
|
|
273
255
|
if (queryStr.indexOf(delimiter) < 0) {
|
|
274
|
-
// 只有一条记录
|
|
275
256
|
return queryStr;
|
|
276
257
|
}
|
|
277
258
|
var selectionStart = ((_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.selectionStart) || 0;
|
|
278
|
-
var startIndex = _sliceInstanceProperty(queryStr).call(queryStr, 0, selectionStart).lastIndexOf(delimiter) + 1;
|
|
259
|
+
var startIndex = _sliceInstanceProperty(queryStr).call(queryStr, 0, selectionStart).lastIndexOf(delimiter) + 1;
|
|
279
260
|
var endIndex = _sliceInstanceProperty(queryStr).call(queryStr, selectionStart).indexOf(delimiter);
|
|
280
|
-
endIndex = endIndex === -1 ? queryStr.length : selectionStart + endIndex;
|
|
261
|
+
endIndex = endIndex === -1 ? queryStr.length : selectionStart + endIndex;
|
|
281
262
|
queryStr = _sliceInstanceProperty(queryStr).call(queryStr, startIndex, endIndex);
|
|
282
263
|
return queryStr;
|
|
283
264
|
}
|
|
@@ -295,7 +276,6 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
295
276
|
setFocused(false);
|
|
296
277
|
setInputValue(searchInfo.current.previousInputValue);
|
|
297
278
|
searchInfo.current.previousEditValue = _concatInstanceProperty(_context10 = "".concat(searchInfo.current.previousInputValue)).call(_context10, delimiter);
|
|
298
|
-
// 多选失去焦点时,通过editOptions去改写选中项
|
|
299
279
|
var list = _filterInstanceProperty(_context11 = searchInfo.current.editOptions || []).call(_context11, function (item) {
|
|
300
280
|
return item;
|
|
301
281
|
}) || [];
|
|
@@ -334,14 +314,11 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
334
314
|
e.stopPropagation();
|
|
335
315
|
onShowMore === null || onShowMore === void 0 ? void 0 : onShowMore();
|
|
336
316
|
};
|
|
337
|
-
// 设置光标位置
|
|
338
317
|
var setCursorPosition = function setCursorPosition(element, prePosition) {
|
|
339
318
|
if (element.setSelectionRange) {
|
|
340
|
-
// Chrome Firefox
|
|
341
319
|
element.focus();
|
|
342
320
|
window.setTimeout(element.setSelectionRange(prePosition, prePosition), 0);
|
|
343
321
|
} else if (element.createTextRange) {
|
|
344
|
-
// 兼容IE
|
|
345
322
|
var range = element.createTextRange;
|
|
346
323
|
range.collapse(true);
|
|
347
324
|
range.moveEnd('character', prePosition);
|
|
@@ -349,7 +326,6 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
349
326
|
range.select();
|
|
350
327
|
}
|
|
351
328
|
};
|
|
352
|
-
// 双击选中当前项
|
|
353
329
|
var handleDoubleClick = function handleDoubleClick() {
|
|
354
330
|
var _a;
|
|
355
331
|
var inputDom = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input;
|
|
@@ -367,7 +343,6 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
367
343
|
}
|
|
368
344
|
return {};
|
|
369
345
|
};
|
|
370
|
-
// 多选,找到光标停留的当前项的下标
|
|
371
346
|
var findSelectionIndex = function findSelectionIndex(selectionStart, posList) {
|
|
372
347
|
var indx = 0;
|
|
373
348
|
for (var index = 0; index < posList.length; index++) {
|
|
@@ -378,13 +353,6 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
378
353
|
}
|
|
379
354
|
return indx;
|
|
380
355
|
};
|
|
381
|
-
/**
|
|
382
|
-
* 找出删除项的下标
|
|
383
|
-
*
|
|
384
|
-
* @param start 删除时文字光标的起始位置
|
|
385
|
-
* @param end 删除时文字光标的终止位置
|
|
386
|
-
* @param posList 每个选中项的下标区间
|
|
387
|
-
*/
|
|
388
356
|
var findDeleteInterval = function findDeleteInterval(start, end, posList) {
|
|
389
357
|
var delIndex = {
|
|
390
358
|
start: null,
|
|
@@ -410,7 +378,6 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
410
378
|
var _list = _filterInstanceProperty(seletedOptions).call(seletedOptions, function (v) {
|
|
411
379
|
return v.value !== item.value;
|
|
412
380
|
});
|
|
413
|
-
// 取消选中(非受控状态下)
|
|
414
381
|
isMultiple && value === undefined && setSeletedOptions(_list);
|
|
415
382
|
onChange === null || onChange === void 0 ? void 0 : onChange(_mapInstanceProperty(_context13 = _filterInstanceProperty(_list).call(_list, function (item) {
|
|
416
383
|
return item;
|
|
@@ -462,13 +429,13 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
462
429
|
var totalText = locale.getLangMsg('BaseData', 'total', {
|
|
463
430
|
total: seletedOptions.length
|
|
464
431
|
});
|
|
465
|
-
return
|
|
432
|
+
return React.createElement("div", {
|
|
466
433
|
className: advancedSelectorCls,
|
|
467
434
|
ref: advancedSelectorRef,
|
|
468
435
|
style: style
|
|
469
|
-
},
|
|
436
|
+
}, React.createElement(ResizeObserver, {
|
|
470
437
|
onResize: handleShowTotal
|
|
471
|
-
},
|
|
438
|
+
}, React.createElement(Input, {
|
|
472
439
|
ref: inputRef,
|
|
473
440
|
borderType: "none",
|
|
474
441
|
disabled: disabled,
|
|
@@ -478,48 +445,32 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
478
445
|
onDoubleClick: handleDoubleClick,
|
|
479
446
|
onFocus: handleFocus,
|
|
480
447
|
onBlur: handleBlur
|
|
481
|
-
})), showTotal && !isFocused && isMultiple &&
|
|
448
|
+
})), showTotal && !isFocused && isMultiple && React.createElement("span", {
|
|
482
449
|
className: "".concat(advancedSelectorfixCls, "-total"),
|
|
483
450
|
onClick: showInputTotal
|
|
484
|
-
}, totalText), isShowDetailBtn && !disabled &&
|
|
451
|
+
}, totalText), isShowDetailBtn && !disabled && React.createElement("span", {
|
|
485
452
|
className: "".concat(advancedSelectorfixCls, "-detail"),
|
|
486
453
|
onClick: handleShowDetail
|
|
487
|
-
},
|
|
454
|
+
}, React.createElement(Icon, {
|
|
488
455
|
type: "material"
|
|
489
|
-
})), !disabled &&
|
|
456
|
+
})), !disabled && React.createElement("span", {
|
|
490
457
|
className: "".concat(advancedSelectorfixCls, "-suffix"),
|
|
491
458
|
onClick: handleShowMore
|
|
492
|
-
},
|
|
459
|
+
}, React.createElement(Icon, {
|
|
493
460
|
type: "search"
|
|
494
461
|
})));
|
|
495
462
|
};
|
|
496
|
-
// 渲染下拉列表框
|
|
497
463
|
var renderContent = function renderContent() {
|
|
498
|
-
return
|
|
464
|
+
return React.createElement("div", {
|
|
499
465
|
className: "".concat(advancedSelectorfixCls, "-dropdown")
|
|
500
466
|
}, searchInfo.current.searchValue ? renderDropdownContent(options, columns, true, true) : renderHistoryContent());
|
|
501
467
|
};
|
|
502
|
-
/**
|
|
503
|
-
* 判断Checkbox半选状态
|
|
504
|
-
*
|
|
505
|
-
* @param {string[]} value 选中项数组
|
|
506
|
-
* @returns {boolean}
|
|
507
|
-
*/
|
|
508
468
|
var getIndeterminate = useCallback(function (value) {
|
|
509
469
|
return value.length > 0 && value.length < options.length;
|
|
510
470
|
}, [options]);
|
|
511
471
|
var getChecked = function getChecked(value) {
|
|
512
472
|
return options.length && value.length === options.length;
|
|
513
473
|
};
|
|
514
|
-
/**
|
|
515
|
-
* 渲染下拉列表
|
|
516
|
-
*
|
|
517
|
-
* @param {IOptionsProps} data 下拉列表的数据
|
|
518
|
-
* @param {IColumnsProps} myColumns 下拉列表的展示列
|
|
519
|
-
* @param {boolean} showFooter 是否显示下拉框footer
|
|
520
|
-
* @param {boolean} showCheckbox 是否显示多选框
|
|
521
|
-
* @returns {React.ReactNode}
|
|
522
|
-
*/
|
|
523
474
|
var renderDropdownContent = function renderDropdownContent(data, myColumns) {
|
|
524
475
|
var _context18;
|
|
525
476
|
var showFooter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
@@ -531,14 +482,14 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
531
482
|
}) : [];
|
|
532
483
|
var indeterminate = getIndeterminate(seletedOptions);
|
|
533
484
|
var checked = getChecked(seletedOptions);
|
|
534
|
-
return
|
|
485
|
+
return React.createElement(React.Fragment, null, myColumns && Array.isArray(myColumns) && React.createElement("div", {
|
|
535
486
|
className: "".concat(advancedSelectorfixCls, "-dropdown-columns")
|
|
536
487
|
}, _mapInstanceProperty(dropDownColumns).call(dropDownColumns, function (item, index) {
|
|
537
|
-
return
|
|
488
|
+
return React.createElement("span", {
|
|
538
489
|
key: item.key,
|
|
539
490
|
className: "".concat(advancedSelectorfixCls, "-dropdown-columns-item"),
|
|
540
491
|
title: item.title
|
|
541
|
-
}, isMultiple && index === 0 && showCheckbox &&
|
|
492
|
+
}, isMultiple && index === 0 && showCheckbox && React.createElement(Checkbox, {
|
|
542
493
|
style: {
|
|
543
494
|
marginRight: 5
|
|
544
495
|
},
|
|
@@ -546,33 +497,27 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
546
497
|
indeterminate: indeterminate,
|
|
547
498
|
onChange: handleSelectAll
|
|
548
499
|
}), item.title);
|
|
549
|
-
})), loading ?
|
|
500
|
+
})), loading ? React.createElement("div", {
|
|
550
501
|
className: "".concat(advancedSelectorfixCls, "-dropdown-loading")
|
|
551
|
-
},
|
|
502
|
+
}, React.createElement(Spin, null)) : data.length ? renderOptionsContent(data, dropDownColumns, showCheckbox) : renderNotContent(), showFooter && dropdownFooterRender && React.createElement("div", {
|
|
552
503
|
className: "".concat(advancedSelectorfixCls, "-dropdown-footer")
|
|
553
504
|
}, dropdownFooterRender));
|
|
554
505
|
};
|
|
555
|
-
/**
|
|
556
|
-
* 渲染收藏图标
|
|
557
|
-
*
|
|
558
|
-
* @param {IOptionsProps} item
|
|
559
|
-
* @returns {React.ReactNode}
|
|
560
|
-
*/
|
|
561
506
|
var renderCollect = useCallback(function (item) {
|
|
562
|
-
return
|
|
507
|
+
return React.createElement("span", {
|
|
563
508
|
className: "".concat(advancedSelectorfixCls, "-dropdown-options-item-collect"),
|
|
564
509
|
onMouseDown: function onMouseDown(e) {
|
|
565
510
|
return e.stopPropagation();
|
|
566
511
|
}
|
|
567
512
|
}, _findIndexInstanceProperty(collectList).call(collectList, function (v) {
|
|
568
513
|
return v.value === item.value;
|
|
569
|
-
}) === -1 ?
|
|
514
|
+
}) === -1 ? React.createElement(Icon, {
|
|
570
515
|
className: "".concat(advancedSelectorfixCls, "-dropdown-options-item-collect-not-icon"),
|
|
571
516
|
type: "collect",
|
|
572
517
|
onClick: function onClick() {
|
|
573
518
|
return handleCollect(item, true);
|
|
574
519
|
}
|
|
575
|
-
}) :
|
|
520
|
+
}) : React.createElement(Icon, {
|
|
576
521
|
className: "".concat(advancedSelectorfixCls, "-dropdown-options-item-collect-icon"),
|
|
577
522
|
type: "star",
|
|
578
523
|
onClick: function onClick() {
|
|
@@ -586,21 +531,13 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
586
531
|
var renderSearchValue = function renderSearchValue(item, column) {
|
|
587
532
|
return searchField === 'all' || searchField === column.key ? findSearchValue(item[column.key]) : item[column.key];
|
|
588
533
|
};
|
|
589
|
-
/**
|
|
590
|
-
* 渲染下拉项
|
|
591
|
-
*
|
|
592
|
-
* @param {IOptionsProps} data 下拉列表的数据
|
|
593
|
-
* @param {IColumnsProps} myColumns 下拉列表的展示列
|
|
594
|
-
* @param {boolean} showCheckbox 是否显示多选框
|
|
595
|
-
* @returns {React.ReactNode}
|
|
596
|
-
*/
|
|
597
534
|
var renderOptionsContent = function renderOptionsContent(data, myColumns) {
|
|
598
535
|
var showCheckbox = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
599
|
-
return
|
|
536
|
+
return React.createElement(React.Fragment, null, _mapInstanceProperty(data).call(data, function (item, index) {
|
|
600
537
|
if (index + 1 > size) {
|
|
601
538
|
return null;
|
|
602
539
|
}
|
|
603
|
-
return
|
|
540
|
+
return React.createElement("div", {
|
|
604
541
|
key: item.value,
|
|
605
542
|
className: classNames("".concat(advancedSelectorfixCls, "-dropdown-options"), {
|
|
606
543
|
selected: seletedOptions.some(function (v) {
|
|
@@ -611,11 +548,11 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
611
548
|
return handleSelect(item);
|
|
612
549
|
}
|
|
613
550
|
}, _mapInstanceProperty(myColumns).call(myColumns, function (column, index) {
|
|
614
|
-
return
|
|
551
|
+
return React.createElement("span", {
|
|
615
552
|
key: column.key,
|
|
616
553
|
className: "".concat(advancedSelectorfixCls, "-dropdown-options-item"),
|
|
617
554
|
title: item[column.key]
|
|
618
|
-
}, isMultiple && showCheckbox && index === 0 &&
|
|
555
|
+
}, isMultiple && showCheckbox && index === 0 && React.createElement(Checkbox, {
|
|
619
556
|
style: {
|
|
620
557
|
marginRight: 5
|
|
621
558
|
},
|
|
@@ -627,41 +564,35 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
627
564
|
}));
|
|
628
565
|
}));
|
|
629
566
|
};
|
|
630
|
-
/**
|
|
631
|
-
* 标注出搜索的文字
|
|
632
|
-
*
|
|
633
|
-
* @param {string} title 搜索的文字
|
|
634
|
-
* @returns {React.ReactNode}
|
|
635
|
-
*/
|
|
636
567
|
var findSearchValue = function findSearchValue(title) {
|
|
637
568
|
var _searchInfo$current$s = searchInfo.current.searchValue,
|
|
638
569
|
searchValue = _searchInfo$current$s === void 0 ? '' : _searchInfo$current$s;
|
|
639
570
|
var index = title.indexOf(searchValue);
|
|
640
571
|
var beforeStr = title.substr(0, index);
|
|
641
572
|
var afterStr = title.substr(index + searchValue.length);
|
|
642
|
-
var content = index > -1 ?
|
|
573
|
+
var content = index > -1 ? React.createElement("span", null, beforeStr, React.createElement("span", {
|
|
643
574
|
className: "".concat(advancedSelectorfixCls, "-dropdown-options-item-search")
|
|
644
|
-
}, searchValue), afterStr) :
|
|
575
|
+
}, searchValue), afterStr) : React.createElement("span", null, title);
|
|
645
576
|
return content;
|
|
646
577
|
};
|
|
647
578
|
var renderHistoryContent = function renderHistoryContent() {
|
|
648
579
|
if (!showFrequent) {
|
|
649
580
|
return null;
|
|
650
581
|
}
|
|
651
|
-
return
|
|
582
|
+
return React.createElement(Tabs, {
|
|
652
583
|
defaultActiveKey: "history"
|
|
653
|
-
},
|
|
584
|
+
}, React.createElement(Tabs.TabPane, {
|
|
654
585
|
key: "history",
|
|
655
586
|
tab: baseDataLangMsg.history
|
|
656
|
-
}, renderDropdownContent(historyList, columns)),
|
|
587
|
+
}, renderDropdownContent(historyList, columns)), React.createElement(Tabs.TabPane, {
|
|
657
588
|
key: "collect",
|
|
658
589
|
tab: baseDataLangMsg.favorites
|
|
659
590
|
}, renderDropdownContent(collectList, columns)));
|
|
660
591
|
};
|
|
661
592
|
var renderNotContent = useCallback(function () {
|
|
662
|
-
return
|
|
593
|
+
return React.createElement("div", {
|
|
663
594
|
className: "".concat(advancedSelectorfixCls, "-dropdown-empty")
|
|
664
|
-
},
|
|
595
|
+
}, React.createElement(Empty, null));
|
|
665
596
|
}, [advancedSelectorfixCls]);
|
|
666
597
|
var catchStyle = function catchStyle() {
|
|
667
598
|
if (advancedSelectorRef === null || advancedSelectorRef === void 0 ? void 0 : advancedSelectorRef.current) {
|
|
@@ -691,6 +622,6 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
691
622
|
});
|
|
692
623
|
return usePopper(renderAdvancedSelector(), renderContent(), popperProps);
|
|
693
624
|
};
|
|
694
|
-
var BaseData =
|
|
625
|
+
var BaseData = React.forwardRef(InternalBaseData);
|
|
695
626
|
BaseData.displayName = 'BaseData';
|
|
696
627
|
export default BaseData;
|
|
@@ -63,7 +63,7 @@ var Breadcrumb = function Breadcrumb(props) {
|
|
|
63
63
|
var _context, _context2, _classNames;
|
|
64
64
|
return classNames(item.className, "".concat(breadcrumbPrefixCls, "-item"), (_classNames = {}, _defineProperty(_classNames, "".concat(breadcrumbPrefixCls, "-item-link"), (item === null || item === void 0 ? void 0 : item.path) || (item === null || item === void 0 ? void 0 : item.href)), _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(breadcrumbPrefixCls, "-item-")).call(_context, colorModel || 'emphasize', "-model-current"), isLast), _defineProperty(_classNames, _concatInstanceProperty(_context2 = "".concat(breadcrumbPrefixCls, "-item-")).call(_context2, colorModel || 'emphasize', "-model"), !isLast), _classNames));
|
|
65
65
|
};
|
|
66
|
-
var MIN_ITEM = 3;
|
|
66
|
+
var MIN_ITEM = 3;
|
|
67
67
|
var isLastItem = function isLastItem(index, items) {
|
|
68
68
|
return index === (items === null || items === void 0 ? void 0 : items.length) - 1;
|
|
69
69
|
};
|
|
@@ -71,17 +71,17 @@ var Breadcrumb = function Breadcrumb(props) {
|
|
|
71
71
|
if (isLastItem(index, items)) {
|
|
72
72
|
return null;
|
|
73
73
|
} else {
|
|
74
|
-
return
|
|
74
|
+
return React.createElement("span", {
|
|
75
75
|
className: breadcrumbSeparatorClass
|
|
76
76
|
}, separator);
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
79
|
var getMoreIconContent = function getMoreIconContent(items) {
|
|
80
80
|
var MoreItems = function MoreItems() {
|
|
81
|
-
return
|
|
81
|
+
return React.createElement("div", {
|
|
82
82
|
className: breadcrumbMorePanelClass
|
|
83
83
|
}, _mapInstanceProperty(items).call(items, function (item, index) {
|
|
84
|
-
return
|
|
84
|
+
return React.createElement(BreadcrumbItem, {
|
|
85
85
|
key: "breadcrumb--more-item-".concat(index),
|
|
86
86
|
index: index,
|
|
87
87
|
item: _extends(_extends({}, item), {
|
|
@@ -91,13 +91,13 @@ var Breadcrumb = function Breadcrumb(props) {
|
|
|
91
91
|
});
|
|
92
92
|
}));
|
|
93
93
|
};
|
|
94
|
-
return
|
|
94
|
+
return React.createElement(React.Fragment, null, React.createElement(Tooltip, {
|
|
95
95
|
popperClassName: breadcrumbPopperClass,
|
|
96
96
|
arrow: false,
|
|
97
|
-
tip:
|
|
97
|
+
tip: React.createElement(MoreItems, null),
|
|
98
98
|
trigger: "hover",
|
|
99
99
|
placement: "bottomLeft"
|
|
100
|
-
},
|
|
100
|
+
}, React.createElement(Icon, {
|
|
101
101
|
type: "more"
|
|
102
102
|
})));
|
|
103
103
|
};
|
|
@@ -177,12 +177,12 @@ var Breadcrumb = function Breadcrumb(props) {
|
|
|
177
177
|
});
|
|
178
178
|
};
|
|
179
179
|
}, [itemsArray, breadcrumbWidth]);
|
|
180
|
-
return
|
|
180
|
+
return React.createElement(React.Fragment, null, React.createElement("div", _extends({
|
|
181
181
|
className: breadcrumbClass
|
|
182
182
|
}, others, {
|
|
183
183
|
ref: breadcrumbRef
|
|
184
184
|
}), (itemsConfig === null || itemsConfig === void 0 ? void 0 : itemsConfig.length) > 0 && _mapInstanceProperty(itemsConfig).call(itemsConfig, function (item, index) {
|
|
185
|
-
return
|
|
185
|
+
return React.createElement(BreadcrumbItem, {
|
|
186
186
|
key: "breadcrumb-item-".concat(index),
|
|
187
187
|
item: _extends(_extends({}, item), {
|
|
188
188
|
className: getBreadcrumbItemClass(item, isLastItem(index, itemsConfig))
|
|
@@ -192,12 +192,12 @@ var Breadcrumb = function Breadcrumb(props) {
|
|
|
192
192
|
separator: getSeparator(index, itemsConfig),
|
|
193
193
|
openEllipsis: isLastItem(index, itemsConfig) ? openEllipsis : false
|
|
194
194
|
});
|
|
195
|
-
})),
|
|
195
|
+
})), React.createElement("div", {
|
|
196
196
|
className: breadcrumbHideIconClass,
|
|
197
197
|
ref: breadcrumbHideIconRef
|
|
198
|
-
},
|
|
198
|
+
}, React.createElement(Icon, {
|
|
199
199
|
type: "more"
|
|
200
|
-
}),
|
|
200
|
+
}), React.createElement("span", {
|
|
201
201
|
className: breadcrumbSeparatorClass
|
|
202
202
|
}, separator)));
|
|
203
203
|
};
|
|
@@ -32,21 +32,21 @@ var BreadcrumbItem = function BreadcrumbItem(props) {
|
|
|
32
32
|
}
|
|
33
33
|
onItemClick && onItemClick(item, index);
|
|
34
34
|
};
|
|
35
|
-
return
|
|
35
|
+
return React.createElement(React.Fragment, null, React.createElement("div", {
|
|
36
36
|
className: className,
|
|
37
37
|
onClick: handleItemClick
|
|
38
|
-
}, icon &&
|
|
38
|
+
}, icon && React.createElement("div", {
|
|
39
39
|
className: itemIconCls
|
|
40
|
-
}, icon),
|
|
40
|
+
}, icon), React.createElement("div", {
|
|
41
41
|
className: itemTextCls,
|
|
42
42
|
title: typeof title === 'string' ? title : '',
|
|
43
43
|
style: {
|
|
44
44
|
maxWidth: openEllipsis ? '170px' : 'unset',
|
|
45
45
|
overflow: openEllipsis ? 'hidden' : 'inherit'
|
|
46
46
|
}
|
|
47
|
-
}, title), dropdownProps && 'menu' in dropdownProps &&
|
|
47
|
+
}, title), dropdownProps && 'menu' in dropdownProps && React.createElement(Dropdown, _extends({
|
|
48
48
|
placement: "bottomRight"
|
|
49
|
-
}, dropdownProps),
|
|
49
|
+
}, dropdownProps), React.createElement(Icon, {
|
|
50
50
|
type: "arrow-down"
|
|
51
51
|
})), separator));
|
|
52
52
|
};
|