@kdcloudjs/kdesign 1.8.11 → 1.8.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kdesign.css +1 -1
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +93 -15
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +1 -1
- package/dist/kdesign.min.js +3 -3
- package/dist/kdesign.min.js.map +1 -1
- package/es/_utils/KeyCode.js +1 -333
- package/es/_utils/arrayUtil.js +0 -8
- package/es/_utils/formatUtil.js +9 -59
- package/es/_utils/getStringLength.js +0 -1
- package/es/_utils/hooks.js +2 -34
- package/es/_utils/index.js +1 -7
- package/es/_utils/numberUtil.js +0 -54
- package/es/_utils/raf.js +2 -2
- package/es/_utils/reactNode.js +1 -1
- package/es/_utils/resizeObserver.js +2 -4
- package/es/_utils/type.js +0 -1
- package/es/_utils/usePopper.js +3 -3
- package/es/alert/alert.js +8 -16
- package/es/anchor/anchor-link.js +3 -3
- package/es/anchor/anchor.js +23 -26
- package/es/anchor/context.js +1 -1
- package/es/avatar/avatar.js +8 -11
- package/es/badge/badge.js +7 -13
- package/es/base-data/base-data.js +42 -104
- package/es/breadcrumb/breadcrumb.js +12 -12
- package/es/breadcrumb/breadcrumbItem.js +5 -5
- package/es/button/button.js +13 -24
- package/es/button/group.js +13 -13
- package/es/card/card.js +12 -14
- package/es/carousel/carousel.js +13 -13
- package/es/carousel/displayList.js +3 -3
- package/es/carousel/fadeList.js +3 -3
- package/es/carousel/slideList.js +4 -4
- package/es/carousel/slidebar.js +3 -3
- package/es/cascader/cascader.js +31 -36
- package/es/checkbox/checkbox.js +25 -30
- package/es/checkbox/group.js +8 -9
- package/es/city-picker/city-picker.js +28 -38
- package/es/city-picker/interface.js +1 -1
- package/es/city-picker/option.js +4 -4
- package/es/clipboard/clipboard.js +5 -23
- package/es/clipboard/util.js +0 -60
- package/es/collapse/collapse.js +5 -5
- package/es/collapse/panel.js +15 -15
- package/es/color-picker/color-picker-panel.js +12 -13
- package/es/color-picker/color-picker.js +6 -10
- package/es/color-picker/utils/validateColor.js +0 -3
- package/es/config-provider/ConfigContext.js +1 -4
- package/es/config-provider/SizeContext.js +3 -3
- package/es/config-provider/compDefaultProps.js +3 -10
- package/es/config-provider/configProvider.js +1 -6
- package/es/config-provider/defaultConfig.js +0 -1
- package/es/date-picker/calendar.js +6 -23
- package/es/date-picker/context.js +1 -1
- package/es/date-picker/date-panel.js +12 -13
- package/es/date-picker/date-picker.js +7 -12
- package/es/date-picker/hooks/use-hover-value.js +0 -1
- package/es/date-picker/hooks/use-picker-input.js +0 -4
- package/es/date-picker/hooks/use-range-disabled.js +2 -6
- package/es/date-picker/hooks/use-range-view-dates.js +1 -9
- package/es/date-picker/hooks/use-text-value-mapping.js +0 -1
- package/es/date-picker/locale/zh_CN.js +0 -1
- package/es/date-picker/panel/date-time/date-time.js +4 -6
- package/es/date-picker/panel/header/header.js +14 -14
- package/es/date-picker/panel/month/month.js +5 -6
- package/es/date-picker/panel/quarter/quarter.js +4 -4
- package/es/date-picker/panel/time/time-column.js +4 -6
- package/es/date-picker/panel/time/time.js +10 -35
- package/es/date-picker/panel/week/week.js +5 -8
- package/es/date-picker/panel/year/year.js +4 -6
- package/es/date-picker/popper.js +3 -6
- package/es/date-picker/range/input-range.js +12 -13
- package/es/date-picker/range-picker.js +13 -36
- package/es/date-picker/single/input-date.js +8 -14
- package/es/date-picker/utils/date-fns.js +0 -35
- package/es/date-picker/utils/get-extra-footer.js +1 -1
- package/es/date-picker/utils/get-ranges.js +8 -8
- package/es/date-picker/utils/index.js +0 -3
- package/es/divider/divider.js +2 -2
- package/es/drawer/drawer.js +14 -39
- package/es/dropdown/dropdown.js +10 -11
- package/es/dropdown/menu.js +8 -12
- package/es/empty/defaultEmptyImg.js +18 -18
- package/es/empty/empty.js +9 -10
- package/es/empty/illustrationEmptyImg.js +106 -106
- package/es/filter/condition.js +10 -10
- package/es/filter/filter.js +17 -19
- package/es/filter/scheme.js +34 -41
- package/es/form/Field.js +5 -5
- package/es/form/FieldContext.js +1 -1
- package/es/form/FieldLabel.js +2 -2
- package/es/form/FieldWrapper.js +6 -6
- package/es/form/Form.js +2 -5
- package/es/form/FormContext.js +2 -4
- package/es/form/hooks/useForm.js +1 -14
- package/es/form/index.js +1 -1
- package/es/grid/col.js +1 -7
- package/es/grid/row.js +3 -9
- package/es/icon/icon.js +2 -2
- package/es/image/image.js +5 -7
- package/es/image/preview-group.js +3 -4
- package/es/image/preview.js +22 -24
- package/es/image-cropper/cropper.js +3 -6
- package/es/image-cropper/image-cropper.js +5 -5
- package/es/image-cropper/operation-bar.js +9 -9
- package/es/index.js +4 -0
- package/es/input/ClearableLabeledInput.js +13 -13
- package/es/input/TextArea.js +7 -7
- package/es/input/calculateNodeHeight.js +6 -11
- package/es/input/index.js +0 -1
- package/es/input/input.js +5 -5
- package/es/input-number/inputNumber.js +3 -10
- package/es/layout/layout.js +5 -9
- package/es/layout/sider.js +11 -14
- package/es/link/link.js +8 -12
- package/es/locale/locale.js +4 -34
- package/es/menu/menu.js +3 -4
- package/es/menu/menuItem.js +8 -13
- package/es/menu/subMenu.js +19 -27
- package/es/menu/util.js +0 -4
- package/es/message/content.js +13 -13
- package/es/message/index.js +1 -3
- package/es/modal/confirm.js +1 -1
- package/es/modal/modal.js +32 -40
- package/es/notification/content.js +18 -18
- package/es/notification/index.js +1 -1
- package/es/notification-base/index.js +1 -1
- package/es/notification-base/notice.js +2 -2
- package/es/notification-base/notification.js +3 -3
- package/es/pagination/pagination.js +48 -70
- package/es/popconfirm/popconfirm.js +8 -10
- package/es/popper/index.d.ts +4 -1
- package/es/popper/index.js +84 -22
- package/es/progress/circle.js +6 -8
- package/es/progress/line.js +3 -3
- package/es/progress/progress.js +11 -11
- package/es/qr-code/qr-code.js +6 -6
- package/es/radio/context.js +1 -1
- package/es/radio/group.js +9 -13
- package/es/radio/radio-button.js +2 -2
- package/es/radio/radio.js +19 -24
- package/es/rate/rate.js +11 -61
- package/es/search/option.js +4 -5
- package/es/search/quick-search.js +36 -57
- package/es/search/search-panel.js +56 -60
- package/es/search/search.js +9 -10
- package/es/select/interface.js +1 -1
- package/es/select/option.js +4 -4
- package/es/select/select.js +47 -87
- package/es/signature/drawingBoard.js +16 -16
- package/es/signature/signature.js +20 -20
- package/es/signature/utils/signature_pad.js +4 -12
- package/es/slider/marks.js +3 -5
- package/es/slider/slider.js +11 -32
- package/es/slider/sliderTooltip.js +3 -3
- package/es/slider/steps.js +2 -2
- package/es/slider/track.js +1 -1
- package/es/space/space.js +3 -5
- package/es/spin/spin.js +16 -18
- package/es/split-panel/split-panel.js +7 -18
- package/es/split-panel/trigger.js +6 -6
- package/es/stepper/stepper.js +11 -12
- package/es/steps/Step.js +8 -8
- package/es/steps/Steps.js +5 -5
- package/es/switch/switch.js +4 -6
- package/es/table/api.js +5 -22
- package/es/table/table.js +4 -15
- package/es/tabs/active-line.js +2 -6
- package/es/tabs/arrow-button.js +3 -3
- package/es/tabs/context.js +1 -1
- package/es/tabs/index.js +0 -1
- package/es/tabs/tab-pane.js +6 -6
- package/es/tabs/tabs.js +31 -34
- package/es/tag/tag.js +7 -15
- package/es/timeline/Timeline.js +5 -5
- package/es/timeline/TimelineItem.js +5 -5
- package/es/tooltip/tooltip.js +2 -2
- package/es/transfer/list-body.js +4 -4
- package/es/transfer/list-item.js +5 -6
- package/es/transfer/list.js +18 -22
- package/es/transfer/operation.js +7 -7
- package/es/transfer/search.js +5 -5
- package/es/transfer/transfer.js +8 -13
- package/es/tree/tree.js +9 -9
- package/es/tree/treeNode.js +18 -20
- package/es/tree/utils/treeUtils.js +1 -27
- package/es/tree-select/interface.js +1 -1
- package/es/tree-select/tree-select.js +35 -48
- package/es/typography/base.js +5 -5
- package/es/typography/index.js +0 -1
- package/es/typography/paragraph.js +1 -1
- package/es/typography/text.js +1 -1
- package/es/typography/title.js +1 -1
- package/es/typography/typography.js +4 -8
- package/es/upload/dragger.js +2 -2
- package/es/upload/request.js +0 -5
- package/es/upload/scan-files.js +0 -1
- package/es/upload/upload.js +34 -34
- package/es/upload/verify-file.js +0 -1
- package/es/view-container/context.js +1 -1
- package/es/view-container/view-container.js +4 -8
- package/es/virtual-list/Filler.js +2 -2
- package/es/virtual-list/utils/algorithmUtil.js +0 -13
- package/es/virtual-list/utils/itemUtil.js +0 -30
- package/es/virtual-list/virtual-list.js +8 -11
- package/lib/_utils/KeyCode.js +1 -333
- package/lib/_utils/arrayUtil.js +0 -8
- package/lib/_utils/formatUtil.js +9 -59
- package/lib/_utils/getStringLength.js +0 -1
- package/lib/_utils/hooks.js +2 -34
- package/lib/_utils/index.js +0 -7
- package/lib/_utils/numberUtil.js +0 -54
- package/lib/_utils/raf.js +2 -2
- package/lib/_utils/reactNode.js +1 -1
- package/lib/_utils/resizeObserver.js +2 -4
- package/lib/_utils/type.js +0 -1
- package/lib/_utils/usePopper.js +3 -3
- package/lib/alert/alert.js +8 -16
- package/lib/anchor/anchor-link.js +3 -3
- package/lib/anchor/anchor.js +23 -26
- package/lib/anchor/context.js +1 -1
- package/lib/avatar/avatar.js +8 -11
- package/lib/badge/badge.js +7 -13
- package/lib/base-data/base-data.js +42 -104
- package/lib/breadcrumb/breadcrumb.js +12 -12
- package/lib/breadcrumb/breadcrumbItem.js +5 -5
- package/lib/button/button.js +13 -24
- package/lib/button/group.js +13 -13
- package/lib/card/card.js +12 -14
- package/lib/carousel/carousel.js +13 -13
- package/lib/carousel/displayList.js +3 -3
- package/lib/carousel/fadeList.js +3 -3
- package/lib/carousel/slideList.js +4 -4
- package/lib/carousel/slidebar.js +3 -3
- package/lib/cascader/cascader.js +31 -36
- package/lib/checkbox/checkbox.js +25 -30
- package/lib/checkbox/group.js +8 -8
- package/lib/city-picker/city-picker.js +28 -38
- package/lib/city-picker/interface.js +1 -1
- package/lib/city-picker/option.js +4 -4
- package/lib/clipboard/clipboard.js +5 -23
- package/lib/clipboard/util.js +0 -60
- package/lib/collapse/collapse.js +5 -5
- package/lib/collapse/panel.js +15 -15
- package/lib/color-picker/color-picker-panel.js +12 -14
- package/lib/color-picker/color-picker.js +6 -10
- package/lib/color-picker/utils/validateColor.js +0 -3
- package/lib/config-provider/ConfigContext.js +1 -5
- package/lib/config-provider/SizeContext.js +3 -3
- package/lib/config-provider/compDefaultProps.js +3 -10
- package/lib/config-provider/configProvider.js +1 -7
- package/lib/config-provider/defaultConfig.js +0 -1
- package/lib/date-picker/calendar.js +6 -23
- package/lib/date-picker/context.js +1 -1
- package/lib/date-picker/date-panel.js +12 -13
- package/lib/date-picker/date-picker.js +7 -12
- package/lib/date-picker/hooks/use-hover-value.js +0 -1
- package/lib/date-picker/hooks/use-picker-input.js +0 -4
- package/lib/date-picker/hooks/use-range-disabled.js +2 -6
- package/lib/date-picker/hooks/use-range-view-dates.js +1 -9
- package/lib/date-picker/hooks/use-text-value-mapping.js +0 -1
- package/lib/date-picker/locale/zh_CN.js +0 -1
- package/lib/date-picker/panel/date-time/date-time.js +4 -6
- package/lib/date-picker/panel/header/header.js +14 -14
- package/lib/date-picker/panel/month/month.js +5 -6
- package/lib/date-picker/panel/quarter/quarter.js +4 -4
- package/lib/date-picker/panel/time/time-column.js +4 -6
- package/lib/date-picker/panel/time/time.js +10 -35
- package/lib/date-picker/panel/week/week.js +5 -8
- package/lib/date-picker/panel/year/year.js +4 -6
- package/lib/date-picker/popper.js +3 -6
- package/lib/date-picker/range/input-range.js +12 -13
- package/lib/date-picker/range-picker.js +13 -36
- package/lib/date-picker/single/input-date.js +8 -14
- package/lib/date-picker/utils/date-fns.js +0 -34
- package/lib/date-picker/utils/get-extra-footer.js +1 -1
- package/lib/date-picker/utils/get-ranges.js +8 -8
- package/lib/date-picker/utils/index.js +0 -3
- package/lib/divider/divider.js +2 -2
- package/lib/drawer/drawer.js +14 -40
- package/lib/dropdown/dropdown.js +10 -11
- package/lib/dropdown/menu.js +8 -12
- package/lib/empty/defaultEmptyImg.js +18 -18
- package/lib/empty/empty.js +9 -10
- package/lib/empty/illustrationEmptyImg.js +106 -106
- package/lib/filter/condition.js +10 -10
- package/lib/filter/filter.js +17 -19
- package/lib/filter/scheme.js +34 -41
- package/lib/form/Field.js +5 -5
- package/lib/form/FieldContext.js +1 -1
- package/lib/form/FieldLabel.js +2 -2
- package/lib/form/FieldWrapper.js +6 -6
- package/lib/form/Form.js +2 -5
- package/lib/form/FormContext.js +2 -4
- package/lib/form/hooks/useForm.js +1 -14
- package/lib/form/index.js +1 -1
- package/lib/grid/col.js +1 -7
- package/lib/grid/row.js +3 -9
- package/lib/icon/icon.js +2 -2
- package/lib/image/image.js +5 -7
- package/lib/image/preview-group.js +3 -4
- package/lib/image/preview.js +22 -24
- package/lib/image-cropper/cropper.js +3 -6
- package/lib/image-cropper/image-cropper.js +5 -5
- package/lib/image-cropper/operation-bar.js +9 -9
- package/lib/index.js +2 -8
- package/lib/input/ClearableLabeledInput.js +13 -13
- package/lib/input/TextArea.js +7 -7
- package/lib/input/calculateNodeHeight.js +6 -11
- package/lib/input/index.js +0 -1
- package/lib/input/input.js +5 -5
- package/lib/input-number/inputNumber.js +3 -10
- package/lib/layout/layout.js +5 -9
- package/lib/layout/sider.js +11 -14
- package/lib/link/link.js +8 -12
- package/lib/locale/locale.js +4 -34
- package/lib/menu/menu.js +3 -4
- package/lib/menu/menuItem.js +8 -13
- package/lib/menu/subMenu.js +19 -27
- package/lib/menu/util.js +0 -4
- package/lib/message/content.js +13 -13
- package/lib/message/index.js +1 -3
- package/lib/modal/confirm.js +1 -1
- package/lib/modal/modal.js +32 -40
- package/lib/notification/content.js +18 -18
- package/lib/notification/index.js +1 -1
- package/lib/notification-base/index.js +1 -1
- package/lib/notification-base/notice.js +2 -2
- package/lib/notification-base/notification.js +3 -3
- package/lib/pagination/pagination.js +48 -70
- package/lib/popconfirm/popconfirm.js +8 -10
- package/lib/popper/index.d.ts +4 -1
- package/lib/popper/index.js +84 -22
- package/lib/progress/circle.js +6 -8
- package/lib/progress/line.js +3 -3
- package/lib/progress/progress.js +11 -11
- package/lib/qr-code/qr-code.js +6 -6
- package/lib/radio/context.js +1 -1
- package/lib/radio/group.js +9 -13
- package/lib/radio/radio-button.js +2 -2
- package/lib/radio/radio.js +19 -24
- package/lib/rate/rate.js +11 -61
- package/lib/search/option.js +4 -5
- package/lib/search/quick-search.js +36 -57
- package/lib/search/search-panel.js +56 -60
- package/lib/search/search.js +9 -10
- package/lib/select/interface.js +1 -1
- package/lib/select/option.js +4 -4
- package/lib/select/select.js +47 -87
- package/lib/signature/drawingBoard.js +16 -16
- package/lib/signature/signature.js +20 -20
- package/lib/signature/utils/signature_pad.js +4 -12
- package/lib/slider/marks.js +3 -5
- package/lib/slider/slider.js +11 -32
- package/lib/slider/sliderTooltip.js +3 -3
- package/lib/slider/steps.js +2 -2
- package/lib/slider/track.js +1 -1
- package/lib/space/space.js +3 -5
- package/lib/spin/spin.js +16 -18
- package/lib/split-panel/split-panel.js +7 -18
- package/lib/split-panel/trigger.js +6 -6
- package/lib/stepper/stepper.js +11 -12
- package/lib/steps/Step.js +8 -8
- package/lib/steps/Steps.js +5 -5
- package/lib/switch/switch.js +4 -6
- package/lib/table/api.js +5 -22
- package/lib/table/table.js +4 -15
- package/lib/tabs/active-line.js +2 -6
- package/lib/tabs/arrow-button.js +3 -3
- package/lib/tabs/context.js +1 -1
- package/lib/tabs/index.js +0 -1
- package/lib/tabs/tab-pane.js +6 -6
- package/lib/tabs/tabs.js +31 -34
- package/lib/tag/tag.js +7 -15
- package/lib/timeline/Timeline.js +5 -5
- package/lib/timeline/TimelineItem.js +5 -5
- package/lib/tooltip/tooltip.js +2 -2
- package/lib/transfer/list-body.js +4 -4
- package/lib/transfer/list-item.js +5 -6
- package/lib/transfer/list.js +18 -22
- package/lib/transfer/operation.js +7 -7
- package/lib/transfer/search.js +5 -5
- package/lib/transfer/transfer.js +8 -13
- package/lib/tree/tree.js +9 -9
- package/lib/tree/treeNode.js +18 -20
- package/lib/tree/utils/treeUtils.js +1 -27
- package/lib/tree-select/interface.js +1 -1
- package/lib/tree-select/tree-select.js +35 -48
- package/lib/typography/base.js +5 -5
- package/lib/typography/index.js +0 -1
- package/lib/typography/paragraph.js +1 -1
- package/lib/typography/text.js +1 -1
- package/lib/typography/title.js +1 -1
- package/lib/typography/typography.js +4 -8
- package/lib/upload/dragger.js +2 -2
- package/lib/upload/request.js +0 -5
- package/lib/upload/scan-files.js +0 -1
- package/lib/upload/upload.js +34 -34
- package/lib/upload/verify-file.js +0 -1
- package/lib/view-container/context.js +1 -1
- package/lib/view-container/view-container.js +4 -8
- package/lib/virtual-list/Filler.js +2 -2
- package/lib/virtual-list/utils/algorithmUtil.js +0 -13
- package/lib/virtual-list/utils/itemUtil.js +0 -30
- package/lib/virtual-list/virtual-list.js +8 -12
- package/package.json +1 -3
package/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
|
};
|
|
@@ -16,6 +16,7 @@ import ConfigContext from '../config-provider/ConfigContext';
|
|
|
16
16
|
import { getCompProps } from '../_utils';
|
|
17
17
|
import { Input, Icon, Tabs, Empty, Spin, Checkbox } from '../index';
|
|
18
18
|
import usePopper from '../_utils/usePopper';
|
|
19
|
+
import ResizeObserver from '../_utils/resizeObserver';
|
|
19
20
|
var InternalBaseData = function InternalBaseData(props, ref) {
|
|
20
21
|
var _context2;
|
|
21
22
|
var _useContext = useContext(ConfigContext),
|
|
@@ -60,7 +61,7 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
60
61
|
onCollect = advancedSelectortProps.onCollect,
|
|
61
62
|
onShowMore = advancedSelectortProps.onShowMore,
|
|
62
63
|
onVisibleChange = advancedSelectortProps.onVisibleChange;
|
|
63
|
-
var isMultiple = mode === 'multiple';
|
|
64
|
+
var isMultiple = mode === 'multiple';
|
|
64
65
|
var _useState = useState([]),
|
|
65
66
|
_useState2 = _slicedToArray(_useState, 2),
|
|
66
67
|
seletedOptions = _useState2[0],
|
|
@@ -97,14 +98,11 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
97
98
|
deleteEndIndx: 0
|
|
98
99
|
});
|
|
99
100
|
var advancedSelectorfixCls = getPrefixCls(prefixCls, 'baseData', customPrefixcls);
|
|
100
|
-
// class
|
|
101
101
|
var advancedSelectorCls = classNames(advancedSelectorfixCls, className, _defineProperty({}, "".concat(advancedSelectorfixCls, "-disabled"), disabled));
|
|
102
|
-
// 多选模式下 维护新增选中的下标
|
|
103
102
|
useEffect(function () {
|
|
104
103
|
searchInfo.current.searchIndex = seletedOptions.length;
|
|
105
104
|
searchInfo.current.editOptions = seletedOptions;
|
|
106
105
|
}, [seletedOptions]);
|
|
107
|
-
// 记录每个选项的开始与结束下标
|
|
108
106
|
var setValIndxPosition = useCallback(function () {
|
|
109
107
|
var _context;
|
|
110
108
|
var str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
@@ -133,11 +131,9 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
133
131
|
}, [setValIndxPosition]);
|
|
134
132
|
useEffect(function () {
|
|
135
133
|
var seletedItems = [];
|
|
136
|
-
// 多选
|
|
137
134
|
if (isMultiple && Array.isArray(value)) {
|
|
138
135
|
seletedItems = value;
|
|
139
136
|
}
|
|
140
|
-
// 单选
|
|
141
137
|
if (!isMultiple && value) {
|
|
142
138
|
seletedItems = [value];
|
|
143
139
|
}
|
|
@@ -153,31 +149,22 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
153
149
|
var selectionStart = ((_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.selectionStart) || 0;
|
|
154
150
|
var index = findSelectionIndex(selectionStart, posList);
|
|
155
151
|
searchInfo.current.searchIndex = index;
|
|
156
|
-
// 新增一个
|
|
157
152
|
var list = _toConsumableArray(searchInfo.current.editOptions || []);
|
|
158
153
|
if (valueArr.length - preValueArr.length === 1) {
|
|
159
154
|
_spliceInstanceProperty(list).call(list, index, 0, null);
|
|
160
155
|
}
|
|
161
156
|
if (valueArr.length < preValueArr.length) {
|
|
162
157
|
var val = searchInfo.current.previousEditValue;
|
|
163
|
-
/**
|
|
164
|
-
* selectionStart 被删除的字符串开始下标
|
|
165
|
-
* deleteEndIndx 被删除的字符串结束下标
|
|
166
|
-
* 多选时,判断删除的字符包含了几个已选项
|
|
167
|
-
* 单选时,判断selectionStart与deleteEndIndx相等(都为0),则表示选项被删除
|
|
168
|
-
*/
|
|
169
158
|
var deleteEndIndx = isMultiple ? val.length - inputValue.length + selectionStart : 0;
|
|
170
159
|
var _findDeleteInterval = findDeleteInterval(selectionStart, deleteEndIndx, indxPosList),
|
|
171
160
|
start = _findDeleteInterval.start,
|
|
172
161
|
end = _findDeleteInterval.end;
|
|
173
162
|
list === null || list === void 0 ? void 0 : _spliceInstanceProperty(list).call(list, start, end - start + 1);
|
|
174
163
|
}
|
|
175
|
-
// 判断每次单个按del键时删除了分隔符后下一次触发
|
|
176
164
|
if (searchInfo.current.deleteEndIndx > 0 && selectionStart !== searchInfo.current.deleteEndIndx) {
|
|
177
165
|
var _findDeleteInterval2 = findDeleteInterval(selectionStart, searchInfo.current.deleteEndIndx, initIndexPos),
|
|
178
166
|
_start = _findDeleteInterval2.start,
|
|
179
167
|
_end = _findDeleteInterval2.end;
|
|
180
|
-
// 单个删除时找到合理的下标触发
|
|
181
168
|
if (_start !== null && _end !== null && _start <= _end) {
|
|
182
169
|
list === null || list === void 0 ? void 0 : _spliceInstanceProperty(list).call(list, _start, _end - _start + 1);
|
|
183
170
|
searchInfo.current.deleteEndIndx = 0;
|
|
@@ -185,7 +172,6 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
185
172
|
}
|
|
186
173
|
searchInfo.current.editOptions = list;
|
|
187
174
|
searchInfo.current.previousEditValue = inputValue;
|
|
188
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
189
175
|
}, [delimiter, inputValue, isMultiple, setValIndxPosition]);
|
|
190
176
|
var getStrToArr = function getStrToArr() {
|
|
191
177
|
var _context5;
|
|
@@ -195,9 +181,9 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
195
181
|
return item;
|
|
196
182
|
});
|
|
197
183
|
};
|
|
198
|
-
|
|
199
|
-
useLayoutEffect(function () {
|
|
184
|
+
var handleShowTotal = useCallback(function () {
|
|
200
185
|
var _a;
|
|
186
|
+
if (!isMultiple) return;
|
|
201
187
|
var inputDom = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input;
|
|
202
188
|
if (!inputDom) return;
|
|
203
189
|
if (inputDom.scrollWidth - inputDom.offsetWidth > 0 && inputValue) {
|
|
@@ -205,8 +191,10 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
205
191
|
} else {
|
|
206
192
|
setShowTotal(false);
|
|
207
193
|
}
|
|
208
|
-
}, [
|
|
209
|
-
|
|
194
|
+
}, [inputValue, isMultiple]);
|
|
195
|
+
useLayoutEffect(function () {
|
|
196
|
+
handleShowTotal();
|
|
197
|
+
}, [handleShowTotal]);
|
|
210
198
|
var setValueBySeleted = useCallback(function () {
|
|
211
199
|
var _context8;
|
|
212
200
|
var defaultInputValue = seletedOptions.reduce(function (pre, next, index, arr) {
|
|
@@ -237,17 +225,16 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
237
225
|
var textValue = e.target.value;
|
|
238
226
|
var val = textValue;
|
|
239
227
|
var inputDom = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input;
|
|
240
|
-
var selectionStart = inputDom.selectionStart || 0;
|
|
228
|
+
var selectionStart = inputDom.selectionStart || 0;
|
|
241
229
|
if (isMultiple && inputDom && textValue && textValue.length > inputValue.length) {
|
|
242
230
|
searchInfo.current.selectionStart = selectionStart;
|
|
243
|
-
var isInHead = selectionStart === 1 && textValue[1] !== delimiter && textValue.length !== 1;
|
|
231
|
+
var isInHead = selectionStart === 1 && textValue[1] !== delimiter && textValue.length !== 1;
|
|
244
232
|
var isInMid = selectionStart !== textValue.length && textValue[selectionStart - 2] === delimiter && textValue[selectionStart] !== delimiter;
|
|
245
233
|
if (isInHead || isInMid) {
|
|
246
234
|
inputDom.value = val = textValue.substring(0, selectionStart) + delimiter + textValue.substring(selectionStart, textValue.length);
|
|
247
235
|
setCursorPosition(inputDom, selectionStart);
|
|
248
236
|
}
|
|
249
237
|
}
|
|
250
|
-
// 单个删除时 当删除的字符为分隔符delimiter 记录位置
|
|
251
238
|
if (findDeletedChar(searchInfo.current.previousEditValue || '', textValue) === delimiter) {
|
|
252
239
|
searchInfo.current.deleteEndIndx = selectionStart;
|
|
253
240
|
}
|
|
@@ -266,13 +253,12 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
266
253
|
}
|
|
267
254
|
if (inputRef.current && queryStr) {
|
|
268
255
|
if (queryStr.indexOf(delimiter) < 0) {
|
|
269
|
-
// 只有一条记录
|
|
270
256
|
return queryStr;
|
|
271
257
|
}
|
|
272
258
|
var selectionStart = ((_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.selectionStart) || 0;
|
|
273
|
-
var startIndex = _sliceInstanceProperty(queryStr).call(queryStr, 0, selectionStart).lastIndexOf(delimiter) + 1;
|
|
259
|
+
var startIndex = _sliceInstanceProperty(queryStr).call(queryStr, 0, selectionStart).lastIndexOf(delimiter) + 1;
|
|
274
260
|
var endIndex = _sliceInstanceProperty(queryStr).call(queryStr, selectionStart).indexOf(delimiter);
|
|
275
|
-
endIndex = endIndex === -1 ? queryStr.length : selectionStart + endIndex;
|
|
261
|
+
endIndex = endIndex === -1 ? queryStr.length : selectionStart + endIndex;
|
|
276
262
|
queryStr = _sliceInstanceProperty(queryStr).call(queryStr, startIndex, endIndex);
|
|
277
263
|
return queryStr;
|
|
278
264
|
}
|
|
@@ -290,7 +276,6 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
290
276
|
setFocused(false);
|
|
291
277
|
setInputValue(searchInfo.current.previousInputValue);
|
|
292
278
|
searchInfo.current.previousEditValue = _concatInstanceProperty(_context10 = "".concat(searchInfo.current.previousInputValue)).call(_context10, delimiter);
|
|
293
|
-
// 多选失去焦点时,通过editOptions去改写选中项
|
|
294
279
|
var list = _filterInstanceProperty(_context11 = searchInfo.current.editOptions || []).call(_context11, function (item) {
|
|
295
280
|
return item;
|
|
296
281
|
}) || [];
|
|
@@ -329,14 +314,11 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
329
314
|
e.stopPropagation();
|
|
330
315
|
onShowMore === null || onShowMore === void 0 ? void 0 : onShowMore();
|
|
331
316
|
};
|
|
332
|
-
// 设置光标位置
|
|
333
317
|
var setCursorPosition = function setCursorPosition(element, prePosition) {
|
|
334
318
|
if (element.setSelectionRange) {
|
|
335
|
-
// Chrome Firefox
|
|
336
319
|
element.focus();
|
|
337
320
|
window.setTimeout(element.setSelectionRange(prePosition, prePosition), 0);
|
|
338
321
|
} else if (element.createTextRange) {
|
|
339
|
-
// 兼容IE
|
|
340
322
|
var range = element.createTextRange;
|
|
341
323
|
range.collapse(true);
|
|
342
324
|
range.moveEnd('character', prePosition);
|
|
@@ -344,7 +326,6 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
344
326
|
range.select();
|
|
345
327
|
}
|
|
346
328
|
};
|
|
347
|
-
// 双击选中当前项
|
|
348
329
|
var handleDoubleClick = function handleDoubleClick() {
|
|
349
330
|
var _a;
|
|
350
331
|
var inputDom = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input;
|
|
@@ -362,7 +343,6 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
362
343
|
}
|
|
363
344
|
return {};
|
|
364
345
|
};
|
|
365
|
-
// 多选,找到光标停留的当前项的下标
|
|
366
346
|
var findSelectionIndex = function findSelectionIndex(selectionStart, posList) {
|
|
367
347
|
var indx = 0;
|
|
368
348
|
for (var index = 0; index < posList.length; index++) {
|
|
@@ -373,13 +353,6 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
373
353
|
}
|
|
374
354
|
return indx;
|
|
375
355
|
};
|
|
376
|
-
/**
|
|
377
|
-
* 找出删除项的下标
|
|
378
|
-
*
|
|
379
|
-
* @param start 删除时文字光标的起始位置
|
|
380
|
-
* @param end 删除时文字光标的终止位置
|
|
381
|
-
* @param posList 每个选中项的下标区间
|
|
382
|
-
*/
|
|
383
356
|
var findDeleteInterval = function findDeleteInterval(start, end, posList) {
|
|
384
357
|
var delIndex = {
|
|
385
358
|
start: null,
|
|
@@ -405,7 +378,6 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
405
378
|
var _list = _filterInstanceProperty(seletedOptions).call(seletedOptions, function (v) {
|
|
406
379
|
return v.value !== item.value;
|
|
407
380
|
});
|
|
408
|
-
// 取消选中(非受控状态下)
|
|
409
381
|
isMultiple && value === undefined && setSeletedOptions(_list);
|
|
410
382
|
onChange === null || onChange === void 0 ? void 0 : onChange(_mapInstanceProperty(_context13 = _filterInstanceProperty(_list).call(_list, function (item) {
|
|
411
383
|
return item;
|
|
@@ -457,11 +429,13 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
457
429
|
var totalText = locale.getLangMsg('BaseData', 'total', {
|
|
458
430
|
total: seletedOptions.length
|
|
459
431
|
});
|
|
460
|
-
return
|
|
432
|
+
return React.createElement("div", {
|
|
461
433
|
className: advancedSelectorCls,
|
|
462
434
|
ref: advancedSelectorRef,
|
|
463
435
|
style: style
|
|
464
|
-
},
|
|
436
|
+
}, React.createElement(ResizeObserver, {
|
|
437
|
+
onResize: handleShowTotal
|
|
438
|
+
}, React.createElement(Input, {
|
|
465
439
|
ref: inputRef,
|
|
466
440
|
borderType: "none",
|
|
467
441
|
disabled: disabled,
|
|
@@ -471,48 +445,32 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
471
445
|
onDoubleClick: handleDoubleClick,
|
|
472
446
|
onFocus: handleFocus,
|
|
473
447
|
onBlur: handleBlur
|
|
474
|
-
}), showTotal && !isFocused && isMultiple &&
|
|
448
|
+
})), showTotal && !isFocused && isMultiple && React.createElement("span", {
|
|
475
449
|
className: "".concat(advancedSelectorfixCls, "-total"),
|
|
476
450
|
onClick: showInputTotal
|
|
477
|
-
}, totalText), isShowDetailBtn && !disabled &&
|
|
451
|
+
}, totalText), isShowDetailBtn && !disabled && React.createElement("span", {
|
|
478
452
|
className: "".concat(advancedSelectorfixCls, "-detail"),
|
|
479
453
|
onClick: handleShowDetail
|
|
480
|
-
},
|
|
454
|
+
}, React.createElement(Icon, {
|
|
481
455
|
type: "material"
|
|
482
|
-
})), !disabled &&
|
|
456
|
+
})), !disabled && React.createElement("span", {
|
|
483
457
|
className: "".concat(advancedSelectorfixCls, "-suffix"),
|
|
484
458
|
onClick: handleShowMore
|
|
485
|
-
},
|
|
459
|
+
}, React.createElement(Icon, {
|
|
486
460
|
type: "search"
|
|
487
461
|
})));
|
|
488
462
|
};
|
|
489
|
-
// 渲染下拉列表框
|
|
490
463
|
var renderContent = function renderContent() {
|
|
491
|
-
return
|
|
464
|
+
return React.createElement("div", {
|
|
492
465
|
className: "".concat(advancedSelectorfixCls, "-dropdown")
|
|
493
466
|
}, searchInfo.current.searchValue ? renderDropdownContent(options, columns, true, true) : renderHistoryContent());
|
|
494
467
|
};
|
|
495
|
-
/**
|
|
496
|
-
* 判断Checkbox半选状态
|
|
497
|
-
*
|
|
498
|
-
* @param {string[]} value 选中项数组
|
|
499
|
-
* @returns {boolean}
|
|
500
|
-
*/
|
|
501
468
|
var getIndeterminate = useCallback(function (value) {
|
|
502
469
|
return value.length > 0 && value.length < options.length;
|
|
503
470
|
}, [options]);
|
|
504
471
|
var getChecked = function getChecked(value) {
|
|
505
472
|
return options.length && value.length === options.length;
|
|
506
473
|
};
|
|
507
|
-
/**
|
|
508
|
-
* 渲染下拉列表
|
|
509
|
-
*
|
|
510
|
-
* @param {IOptionsProps} data 下拉列表的数据
|
|
511
|
-
* @param {IColumnsProps} myColumns 下拉列表的展示列
|
|
512
|
-
* @param {boolean} showFooter 是否显示下拉框footer
|
|
513
|
-
* @param {boolean} showCheckbox 是否显示多选框
|
|
514
|
-
* @returns {React.ReactNode}
|
|
515
|
-
*/
|
|
516
474
|
var renderDropdownContent = function renderDropdownContent(data, myColumns) {
|
|
517
475
|
var _context18;
|
|
518
476
|
var showFooter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
@@ -524,14 +482,14 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
524
482
|
}) : [];
|
|
525
483
|
var indeterminate = getIndeterminate(seletedOptions);
|
|
526
484
|
var checked = getChecked(seletedOptions);
|
|
527
|
-
return
|
|
485
|
+
return React.createElement(React.Fragment, null, myColumns && Array.isArray(myColumns) && React.createElement("div", {
|
|
528
486
|
className: "".concat(advancedSelectorfixCls, "-dropdown-columns")
|
|
529
487
|
}, _mapInstanceProperty(dropDownColumns).call(dropDownColumns, function (item, index) {
|
|
530
|
-
return
|
|
488
|
+
return React.createElement("span", {
|
|
531
489
|
key: item.key,
|
|
532
490
|
className: "".concat(advancedSelectorfixCls, "-dropdown-columns-item"),
|
|
533
491
|
title: item.title
|
|
534
|
-
}, isMultiple && index === 0 && showCheckbox &&
|
|
492
|
+
}, isMultiple && index === 0 && showCheckbox && React.createElement(Checkbox, {
|
|
535
493
|
style: {
|
|
536
494
|
marginRight: 5
|
|
537
495
|
},
|
|
@@ -539,33 +497,27 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
539
497
|
indeterminate: indeterminate,
|
|
540
498
|
onChange: handleSelectAll
|
|
541
499
|
}), item.title);
|
|
542
|
-
})), loading ?
|
|
500
|
+
})), loading ? React.createElement("div", {
|
|
543
501
|
className: "".concat(advancedSelectorfixCls, "-dropdown-loading")
|
|
544
|
-
},
|
|
502
|
+
}, React.createElement(Spin, null)) : data.length ? renderOptionsContent(data, dropDownColumns, showCheckbox) : renderNotContent(), showFooter && dropdownFooterRender && React.createElement("div", {
|
|
545
503
|
className: "".concat(advancedSelectorfixCls, "-dropdown-footer")
|
|
546
504
|
}, dropdownFooterRender));
|
|
547
505
|
};
|
|
548
|
-
/**
|
|
549
|
-
* 渲染收藏图标
|
|
550
|
-
*
|
|
551
|
-
* @param {IOptionsProps} item
|
|
552
|
-
* @returns {React.ReactNode}
|
|
553
|
-
*/
|
|
554
506
|
var renderCollect = useCallback(function (item) {
|
|
555
|
-
return
|
|
507
|
+
return React.createElement("span", {
|
|
556
508
|
className: "".concat(advancedSelectorfixCls, "-dropdown-options-item-collect"),
|
|
557
509
|
onMouseDown: function onMouseDown(e) {
|
|
558
510
|
return e.stopPropagation();
|
|
559
511
|
}
|
|
560
512
|
}, _findIndexInstanceProperty(collectList).call(collectList, function (v) {
|
|
561
513
|
return v.value === item.value;
|
|
562
|
-
}) === -1 ?
|
|
514
|
+
}) === -1 ? React.createElement(Icon, {
|
|
563
515
|
className: "".concat(advancedSelectorfixCls, "-dropdown-options-item-collect-not-icon"),
|
|
564
516
|
type: "collect",
|
|
565
517
|
onClick: function onClick() {
|
|
566
518
|
return handleCollect(item, true);
|
|
567
519
|
}
|
|
568
|
-
}) :
|
|
520
|
+
}) : React.createElement(Icon, {
|
|
569
521
|
className: "".concat(advancedSelectorfixCls, "-dropdown-options-item-collect-icon"),
|
|
570
522
|
type: "star",
|
|
571
523
|
onClick: function onClick() {
|
|
@@ -579,21 +531,13 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
579
531
|
var renderSearchValue = function renderSearchValue(item, column) {
|
|
580
532
|
return searchField === 'all' || searchField === column.key ? findSearchValue(item[column.key]) : item[column.key];
|
|
581
533
|
};
|
|
582
|
-
/**
|
|
583
|
-
* 渲染下拉项
|
|
584
|
-
*
|
|
585
|
-
* @param {IOptionsProps} data 下拉列表的数据
|
|
586
|
-
* @param {IColumnsProps} myColumns 下拉列表的展示列
|
|
587
|
-
* @param {boolean} showCheckbox 是否显示多选框
|
|
588
|
-
* @returns {React.ReactNode}
|
|
589
|
-
*/
|
|
590
534
|
var renderOptionsContent = function renderOptionsContent(data, myColumns) {
|
|
591
535
|
var showCheckbox = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
592
|
-
return
|
|
536
|
+
return React.createElement(React.Fragment, null, _mapInstanceProperty(data).call(data, function (item, index) {
|
|
593
537
|
if (index + 1 > size) {
|
|
594
538
|
return null;
|
|
595
539
|
}
|
|
596
|
-
return
|
|
540
|
+
return React.createElement("div", {
|
|
597
541
|
key: item.value,
|
|
598
542
|
className: classNames("".concat(advancedSelectorfixCls, "-dropdown-options"), {
|
|
599
543
|
selected: seletedOptions.some(function (v) {
|
|
@@ -604,11 +548,11 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
604
548
|
return handleSelect(item);
|
|
605
549
|
}
|
|
606
550
|
}, _mapInstanceProperty(myColumns).call(myColumns, function (column, index) {
|
|
607
|
-
return
|
|
551
|
+
return React.createElement("span", {
|
|
608
552
|
key: column.key,
|
|
609
553
|
className: "".concat(advancedSelectorfixCls, "-dropdown-options-item"),
|
|
610
554
|
title: item[column.key]
|
|
611
|
-
}, isMultiple && showCheckbox && index === 0 &&
|
|
555
|
+
}, isMultiple && showCheckbox && index === 0 && React.createElement(Checkbox, {
|
|
612
556
|
style: {
|
|
613
557
|
marginRight: 5
|
|
614
558
|
},
|
|
@@ -620,41 +564,35 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
620
564
|
}));
|
|
621
565
|
}));
|
|
622
566
|
};
|
|
623
|
-
/**
|
|
624
|
-
* 标注出搜索的文字
|
|
625
|
-
*
|
|
626
|
-
* @param {string} title 搜索的文字
|
|
627
|
-
* @returns {React.ReactNode}
|
|
628
|
-
*/
|
|
629
567
|
var findSearchValue = function findSearchValue(title) {
|
|
630
568
|
var _searchInfo$current$s = searchInfo.current.searchValue,
|
|
631
569
|
searchValue = _searchInfo$current$s === void 0 ? '' : _searchInfo$current$s;
|
|
632
570
|
var index = title.indexOf(searchValue);
|
|
633
571
|
var beforeStr = title.substr(0, index);
|
|
634
572
|
var afterStr = title.substr(index + searchValue.length);
|
|
635
|
-
var content = index > -1 ?
|
|
573
|
+
var content = index > -1 ? React.createElement("span", null, beforeStr, React.createElement("span", {
|
|
636
574
|
className: "".concat(advancedSelectorfixCls, "-dropdown-options-item-search")
|
|
637
|
-
}, searchValue), afterStr) :
|
|
575
|
+
}, searchValue), afterStr) : React.createElement("span", null, title);
|
|
638
576
|
return content;
|
|
639
577
|
};
|
|
640
578
|
var renderHistoryContent = function renderHistoryContent() {
|
|
641
579
|
if (!showFrequent) {
|
|
642
580
|
return null;
|
|
643
581
|
}
|
|
644
|
-
return
|
|
582
|
+
return React.createElement(Tabs, {
|
|
645
583
|
defaultActiveKey: "history"
|
|
646
|
-
},
|
|
584
|
+
}, React.createElement(Tabs.TabPane, {
|
|
647
585
|
key: "history",
|
|
648
586
|
tab: baseDataLangMsg.history
|
|
649
|
-
}, renderDropdownContent(historyList, columns)),
|
|
587
|
+
}, renderDropdownContent(historyList, columns)), React.createElement(Tabs.TabPane, {
|
|
650
588
|
key: "collect",
|
|
651
589
|
tab: baseDataLangMsg.favorites
|
|
652
590
|
}, renderDropdownContent(collectList, columns)));
|
|
653
591
|
};
|
|
654
592
|
var renderNotContent = useCallback(function () {
|
|
655
|
-
return
|
|
593
|
+
return React.createElement("div", {
|
|
656
594
|
className: "".concat(advancedSelectorfixCls, "-dropdown-empty")
|
|
657
|
-
},
|
|
595
|
+
}, React.createElement(Empty, null));
|
|
658
596
|
}, [advancedSelectorfixCls]);
|
|
659
597
|
var catchStyle = function catchStyle() {
|
|
660
598
|
if (advancedSelectorRef === null || advancedSelectorRef === void 0 ? void 0 : advancedSelectorRef.current) {
|
|
@@ -684,6 +622,6 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
684
622
|
});
|
|
685
623
|
return usePopper(renderAdvancedSelector(), renderContent(), popperProps);
|
|
686
624
|
};
|
|
687
|
-
var BaseData =
|
|
625
|
+
var BaseData = React.forwardRef(InternalBaseData);
|
|
688
626
|
BaseData.displayName = 'BaseData';
|
|
689
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
|
};
|