@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/tabs/tabs.js
CHANGED
|
@@ -21,7 +21,7 @@ import Carousel from '../carousel';
|
|
|
21
21
|
export var TabsTypes = tuple('line', 'card', 'grid', 'dynamic');
|
|
22
22
|
export var TabsSizes = tuple('middle', 'small');
|
|
23
23
|
export var TabsPositions = tuple('top', 'left', 'right', 'bottom');
|
|
24
|
-
export var EffectTypes = tuple('scrollx', 'fade', 'none');
|
|
24
|
+
export var EffectTypes = tuple('scrollx', 'fade', 'none');
|
|
25
25
|
function getDefaultActiveKey(props) {
|
|
26
26
|
var activeKey;
|
|
27
27
|
React.Children.forEach(props.children, function (child) {
|
|
@@ -127,7 +127,6 @@ var Tabs = function Tabs(props) {
|
|
|
127
127
|
setBoxWidth(((_a = tabRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) || 0);
|
|
128
128
|
}
|
|
129
129
|
var offset = 0;
|
|
130
|
-
// TODO margin需要是变量的形式,不能写死
|
|
131
130
|
var margin = type === 'line' ? 24 : 0;
|
|
132
131
|
var curOffset = ((_b = tabListRef.current) === null || _b === void 0 ? void 0 : _b.offsetLeft) || 0;
|
|
133
132
|
var boxWidth = ((_c = tabRef.current) === null || _c === void 0 ? void 0 : _c.offsetWidth) || 0;
|
|
@@ -139,7 +138,6 @@ var Tabs = function Tabs(props) {
|
|
|
139
138
|
if (left + curOffset < 48 && curOffset) {
|
|
140
139
|
offset = left > 48 ? 48 - left : 0;
|
|
141
140
|
setListPosition(offset);
|
|
142
|
-
// return
|
|
143
141
|
}
|
|
144
142
|
}, [tabRef, left, width, type, ListWidth]);
|
|
145
143
|
var tabsClasses = classNames(tabsPrefixCls, className, (_classNames = {}, _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(tabsPrefixCls, "-")).call(_context, position), position), _defineProperty(_classNames, "".concat(tabsPrefixCls, "-noContainer"), noContainer), _classNames));
|
|
@@ -172,7 +170,7 @@ var Tabs = function Tabs(props) {
|
|
|
172
170
|
});
|
|
173
171
|
var formatTabPane = function formatTabPane(child) {
|
|
174
172
|
if (Object.prototype.toString.call(child) === '[object Object]' && child.type.displayName === 'TabPane') {
|
|
175
|
-
return
|
|
173
|
+
return React.createElement(TabPane, _extends({}, child.props, {
|
|
176
174
|
key: child.key,
|
|
177
175
|
id: child.key,
|
|
178
176
|
onChange: handleActive
|
|
@@ -181,7 +179,7 @@ var Tabs = function Tabs(props) {
|
|
|
181
179
|
return null;
|
|
182
180
|
};
|
|
183
181
|
var renderActiveLine = function renderActiveLine() {
|
|
184
|
-
return ['line', 'dynamic'].indexOf(type) > -1 && !disabled ?
|
|
182
|
+
return ['line', 'dynamic'].indexOf(type) > -1 && !disabled ? React.createElement(Line, {
|
|
185
183
|
left: left,
|
|
186
184
|
width: width
|
|
187
185
|
}) : null;
|
|
@@ -195,9 +193,9 @@ var Tabs = function Tabs(props) {
|
|
|
195
193
|
var offset = ListPostion + boxWidth > 0 ? 0 : ListPostion + boxWidth;
|
|
196
194
|
setListPosition(offset);
|
|
197
195
|
};
|
|
198
|
-
return
|
|
196
|
+
return React.createElement("div", {
|
|
199
197
|
className: leftClasses
|
|
200
|
-
},
|
|
198
|
+
}, React.createElement(ArrowButton, {
|
|
201
199
|
direction: "left",
|
|
202
200
|
disabled: ListPostion === 0,
|
|
203
201
|
onClick: handleLeft
|
|
@@ -227,31 +225,31 @@ var Tabs = function Tabs(props) {
|
|
|
227
225
|
handleActive(value);
|
|
228
226
|
};
|
|
229
227
|
if (type === 'grid') {
|
|
230
|
-
return
|
|
228
|
+
return React.createElement("div", {
|
|
231
229
|
className: rightClasses
|
|
232
|
-
},
|
|
230
|
+
}, React.createElement(Dropdown, {
|
|
233
231
|
menu: menu,
|
|
234
232
|
trigger: ['click'],
|
|
235
233
|
onItemClick: handleSelectItem
|
|
236
|
-
},
|
|
234
|
+
}, React.createElement("span", {
|
|
237
235
|
className: "".concat(tabsPrefixCls, "-more-btn")
|
|
238
|
-
},
|
|
236
|
+
}, React.createElement(Icon, {
|
|
239
237
|
type: "more"
|
|
240
238
|
}))));
|
|
241
239
|
}
|
|
242
|
-
return
|
|
240
|
+
return React.createElement("div", {
|
|
243
241
|
className: rightClasses
|
|
244
|
-
}, showScrollArrow ?
|
|
242
|
+
}, showScrollArrow ? React.createElement(ArrowButton, {
|
|
245
243
|
direction: "right",
|
|
246
244
|
disabled: ListWidth + ListPostion === boxWidth,
|
|
247
245
|
onClick: handleRight
|
|
248
|
-
}) : null,
|
|
246
|
+
}) : null, React.createElement(Dropdown, {
|
|
249
247
|
menu: menu,
|
|
250
248
|
trigger: ['click'],
|
|
251
249
|
onItemClick: handleSelectItem
|
|
252
|
-
},
|
|
250
|
+
}, React.createElement("span", {
|
|
253
251
|
className: "".concat(tabsPrefixCls, "-more-btn")
|
|
254
|
-
},
|
|
252
|
+
}, React.createElement(Icon, {
|
|
255
253
|
type: "arrow-down"
|
|
256
254
|
}))));
|
|
257
255
|
};
|
|
@@ -259,16 +257,16 @@ var Tabs = function Tabs(props) {
|
|
|
259
257
|
if (type !== 'dynamic' || !leftOperations || !leftOperations.props.children) return null;
|
|
260
258
|
var classes = classNames("".concat(tabsPrefixCls, "-left-operations"), {});
|
|
261
259
|
var children = Object.prototype.toString.call(leftOperations.props.children) === '[object Array]' ? leftOperations.props.children : [leftOperations.props.children];
|
|
262
|
-
return
|
|
260
|
+
return React.createElement("div", {
|
|
263
261
|
className: classes
|
|
264
262
|
}, _mapInstanceProperty(children).call(children, function (child, index) {
|
|
265
263
|
var event = function event() {
|
|
266
264
|
child.props.onClick && child.props.onClick();
|
|
267
265
|
};
|
|
268
|
-
return
|
|
266
|
+
return React.createElement("span", {
|
|
269
267
|
className: "".concat(tabsPrefixCls, "-left-operations-item"),
|
|
270
268
|
key: index
|
|
271
|
-
},
|
|
269
|
+
}, React.createElement("span", {
|
|
272
270
|
onClick: event
|
|
273
271
|
}, child));
|
|
274
272
|
}));
|
|
@@ -277,16 +275,16 @@ var Tabs = function Tabs(props) {
|
|
|
277
275
|
if (type !== 'dynamic' || !rightOperations || !rightOperations.props.children) return null;
|
|
278
276
|
var classes = classNames("".concat(tabsPrefixCls, "-right-operations"), {});
|
|
279
277
|
var children = Object.prototype.toString.call(rightOperations.props.children) === '[object Array]' ? rightOperations.props.children : [rightOperations.props.children];
|
|
280
|
-
return
|
|
278
|
+
return React.createElement("div", {
|
|
281
279
|
className: classes
|
|
282
280
|
}, _mapInstanceProperty(children).call(children, function (child, index) {
|
|
283
281
|
var event = function event() {
|
|
284
282
|
child.props.onClick && child.props.onClick();
|
|
285
283
|
};
|
|
286
|
-
return
|
|
284
|
+
return React.createElement("span", {
|
|
287
285
|
className: "".concat(tabsPrefixCls, "-right-operations-item"),
|
|
288
286
|
key: index
|
|
289
|
-
},
|
|
287
|
+
}, React.createElement("span", {
|
|
290
288
|
onClick: event
|
|
291
289
|
}, child));
|
|
292
290
|
}));
|
|
@@ -311,7 +309,7 @@ var Tabs = function Tabs(props) {
|
|
|
311
309
|
var listPositionStyle = {
|
|
312
310
|
left: "".concat(ListPostion, "px")
|
|
313
311
|
};
|
|
314
|
-
var renderWrap =
|
|
312
|
+
var renderWrap = React.createElement("div", {
|
|
315
313
|
ref: tabListRef,
|
|
316
314
|
className: "".concat(tabsPrefixCls, "-tab-list"),
|
|
317
315
|
style: listPositionStyle
|
|
@@ -319,25 +317,25 @@ var Tabs = function Tabs(props) {
|
|
|
319
317
|
if (!contextMenuList) return renderWrap;
|
|
320
318
|
var children = Object.prototype.toString.call(contextMenuList.props.children) === '[object Array]' ? contextMenuList.props.children : [contextMenuList.props.children];
|
|
321
319
|
var eventMap = [];
|
|
322
|
-
var menu =
|
|
320
|
+
var menu = React.createElement(Dropdown.Menu, null, _mapInstanceProperty(children).call(children, function (child, index) {
|
|
323
321
|
eventMap.push(child.props.onClick);
|
|
324
|
-
return
|
|
322
|
+
return React.createElement(Dropdown.Item, {
|
|
325
323
|
key: index
|
|
326
|
-
},
|
|
324
|
+
}, React.createElement("span", null, child));
|
|
327
325
|
}));
|
|
328
326
|
var handleItemClick = function handleItemClick(key) {
|
|
329
327
|
var event = eventMap[key];
|
|
330
328
|
event && event(triggerKey);
|
|
331
329
|
};
|
|
332
|
-
return
|
|
330
|
+
return React.createElement(Dropdown, {
|
|
333
331
|
menu: menu,
|
|
334
332
|
trigger: ['contextMenu'],
|
|
335
333
|
onItemClick: handleItemClick
|
|
336
334
|
}, renderWrap);
|
|
337
335
|
};
|
|
338
|
-
return
|
|
336
|
+
return React.createElement("div", _extends({}, omit(tabsProps, ['activeKey', 'defaultActiveKey', 'showScrollArrow', 'noContainer']), {
|
|
339
337
|
className: tabNavsClasses
|
|
340
|
-
}), renderLeftOperations(), renderLeftArrow(),
|
|
338
|
+
}), renderLeftOperations(), renderLeftArrow(), React.createElement("div", {
|
|
341
339
|
ref: tabRef,
|
|
342
340
|
className: "".concat(tabsPrefixCls, "-tab-wrap")
|
|
343
341
|
}, renderTabWrap()), renderRightArrows(childrenToRender), renderRightOperations());
|
|
@@ -348,7 +346,6 @@ var Tabs = function Tabs(props) {
|
|
|
348
346
|
_mapInstanceProperty(containerPanes).call(containerPanes, function (pane) {
|
|
349
347
|
var props = pane.props,
|
|
350
348
|
key = pane.key;
|
|
351
|
-
// 如果没有children传入那就以tab为准
|
|
352
349
|
var item = {
|
|
353
350
|
key: key
|
|
354
351
|
};
|
|
@@ -359,18 +356,18 @@ var Tabs = function Tabs(props) {
|
|
|
359
356
|
}
|
|
360
357
|
carouselData.push(item);
|
|
361
358
|
});
|
|
362
|
-
return
|
|
359
|
+
return React.createElement(Carousel, {
|
|
363
360
|
ref: carouselRef,
|
|
364
361
|
dots: false,
|
|
365
362
|
autoplay: false,
|
|
366
363
|
effect: effect
|
|
367
364
|
}, _mapInstanceProperty(carouselData).call(carouselData, function (item) {
|
|
368
|
-
return
|
|
365
|
+
return React.createElement(React.Fragment, {
|
|
369
366
|
key: item.key
|
|
370
367
|
}, item.content);
|
|
371
368
|
}));
|
|
372
369
|
};
|
|
373
|
-
return
|
|
370
|
+
return React.createElement(TabsContextProvider, {
|
|
374
371
|
value: {
|
|
375
372
|
type: type,
|
|
376
373
|
size: size,
|
|
@@ -380,7 +377,7 @@ var Tabs = function Tabs(props) {
|
|
|
380
377
|
getActiveLinePosition: getActiveLinePosition,
|
|
381
378
|
getTriggerKey: getTriggerKey
|
|
382
379
|
}
|
|
383
|
-
},
|
|
380
|
+
}, React.createElement("div", {
|
|
384
381
|
className: tabsClasses
|
|
385
382
|
}, renderTabPane(), renderContainer()));
|
|
386
383
|
};
|
package/es/tag/tag.js
CHANGED
|
@@ -20,7 +20,6 @@ import devWarning from '../_utils/devwarning';
|
|
|
20
20
|
export var TagTypes = tuple('status', 'attribute', 'text', 'edit');
|
|
21
21
|
export var TagColors = tuple('process', 'success', 'warning', 'error', 'end', 'expired');
|
|
22
22
|
export var TagSizes = tuple('small', 'middle', 'large');
|
|
23
|
-
// remove this line and code Tag component here
|
|
24
23
|
var InteranalTag = function InteranalTag(props, ref) {
|
|
25
24
|
var _context, _context2, _context3, _classNames;
|
|
26
25
|
var _useContext = useContext(ConfigContext),
|
|
@@ -56,54 +55,47 @@ var InteranalTag = function InteranalTag(props, ref) {
|
|
|
56
55
|
if (e.defaultPrevented) {
|
|
57
56
|
return;
|
|
58
57
|
}
|
|
59
|
-
// 删除标签
|
|
60
58
|
var tagWrapper = e.currentTarget.parentNode;
|
|
61
59
|
(_a = tagWrapper === null || tagWrapper === void 0 ? void 0 : tagWrapper.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(tagWrapper);
|
|
62
60
|
};
|
|
63
|
-
// ref
|
|
64
61
|
var thisTagRef = useRef();
|
|
65
62
|
var tagRef = ref || thisTagRef;
|
|
66
|
-
// 对children进行进一步处理 当标签包含图标时 文本内容需要用标签包裹设置外边距
|
|
67
63
|
var handleChild = function handleChild(child) {
|
|
68
64
|
if (!child) return null;
|
|
69
65
|
if (typeof child === 'string' && icon) {
|
|
70
|
-
return
|
|
66
|
+
return React.createElement("span", {
|
|
71
67
|
className: "".concat(tagPrefixCls, "-text")
|
|
72
68
|
}, child);
|
|
73
69
|
}
|
|
74
|
-
return
|
|
70
|
+
return React.createElement("span", {
|
|
75
71
|
className: "".concat(tagPrefixCls, "-ellipsis")
|
|
76
72
|
}, child);
|
|
77
73
|
};
|
|
78
|
-
// 预设的颜色值
|
|
79
74
|
var isPresetColor = ['process', 'success', 'warning', 'error', 'end', 'expired'].indexOf(color) > -1;
|
|
80
75
|
var tagClasses = classNames(tagPrefixCls, className, (_classNames = {}, _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(tagPrefixCls, "-shape-")).call(_context, type), type), _defineProperty(_classNames, _concatInstanceProperty(_context2 = "".concat(tagPrefixCls, "-")).call(_context2, color), isPresetColor), _defineProperty(_classNames, "".concat(tagPrefixCls, "-has-color"), !isPresetColor && color && type === 'attribute'), _defineProperty(_classNames, "".concat(tagPrefixCls, "-clickable"), clickable), _defineProperty(_classNames, "".concat(tagPrefixCls, "-closable"), closable), _defineProperty(_classNames, _concatInstanceProperty(_context3 = "".concat(tagPrefixCls, "-size-")).call(_context3, size), size), _defineProperty(_classNames, "".concat(tagPrefixCls, "-closable-disabled"), type === 'edit' && disabled), _classNames));
|
|
81
|
-
// 设置自定义颜色值的样式
|
|
82
76
|
var tagColorStyle = !isPresetColor && color && type === 'attribute' ? {
|
|
83
77
|
backgroundColor: color
|
|
84
78
|
} : {};
|
|
85
79
|
var tagStyle = _extends(_extends({}, tagColorStyle), style);
|
|
86
|
-
// 图标
|
|
87
80
|
var iconNode = icon || null;
|
|
88
81
|
var tagChild = handleChild(children);
|
|
89
|
-
|
|
90
|
-
var closeIconNode = closeIcon || /*#__PURE__*/React.createElement(Icon, {
|
|
82
|
+
var closeIconNode = closeIcon || React.createElement(Icon, {
|
|
91
83
|
type: "close",
|
|
92
84
|
className: "".concat(tagPrefixCls, "-close-icon")
|
|
93
85
|
});
|
|
94
|
-
var closeNode = closable && type === 'edit' ? disabled ?
|
|
86
|
+
var closeNode = closable && type === 'edit' ? disabled ? React.createElement("span", {
|
|
95
87
|
className: "".concat(tagPrefixCls, "-closeWrapper")
|
|
96
|
-
}, closeIconNode) :
|
|
88
|
+
}, closeIconNode) : React.createElement("span", {
|
|
97
89
|
className: "".concat(tagPrefixCls, "-closeWrapper"),
|
|
98
90
|
onClick: handleClose
|
|
99
91
|
}, closeIconNode) : null;
|
|
100
|
-
return
|
|
92
|
+
return React.createElement("span", _extends({
|
|
101
93
|
ref: tagRef,
|
|
102
94
|
onClick: handleClick,
|
|
103
95
|
className: tagClasses,
|
|
104
96
|
style: tagStyle
|
|
105
97
|
}, others), iconNode, tagChild, closeNode);
|
|
106
98
|
};
|
|
107
|
-
var Tag =
|
|
99
|
+
var Tag = React.forwardRef(InteranalTag);
|
|
108
100
|
Tag.displayName = 'Tag';
|
|
109
101
|
export default Tag;
|
package/es/timeline/Timeline.js
CHANGED
|
@@ -40,9 +40,9 @@ var Timeline = function Timeline(props) {
|
|
|
40
40
|
restProps = __rest(_a, ["prefixCls", "pending", "pendingDot", "children", "className", "reverse", "mode", "style", "lineHeight", "labelWidth"]);
|
|
41
41
|
var prefixCls = getPrefixCls(pkgPrefixCls, 'timeline', customizePrefixCls);
|
|
42
42
|
var pendingNode = typeof pending === 'boolean' ? null : pending;
|
|
43
|
-
var pendingItem = pending ?
|
|
43
|
+
var pendingItem = pending ? React.createElement(TimelineItem, {
|
|
44
44
|
pending: !!pending,
|
|
45
|
-
dot: pendingDot ||
|
|
45
|
+
dot: pendingDot || React.createElement(Icon, {
|
|
46
46
|
type: "loadding",
|
|
47
47
|
spin: true
|
|
48
48
|
})
|
|
@@ -55,7 +55,7 @@ var Timeline = function Timeline(props) {
|
|
|
55
55
|
var items = _mapInstanceProperty(_context3 = React.Children).call(_context3, truthyItems, function (ele, index) {
|
|
56
56
|
var pendingClass = index === itemsCount - 2 ? 'last' : '';
|
|
57
57
|
var readyClass = index === itemsCount - 1 ? 'last' : '';
|
|
58
|
-
return
|
|
58
|
+
return React.cloneElement(ele, {
|
|
59
59
|
className: classNames([ele.props.className, !reverse && !!pending ? pendingClass : readyClass])
|
|
60
60
|
});
|
|
61
61
|
});
|
|
@@ -70,11 +70,11 @@ var Timeline = function Timeline(props) {
|
|
|
70
70
|
paddingLeft: hasLabelItem && mode === 'left' ? "".concat(labelWidth, "px") : undefined,
|
|
71
71
|
paddingRight: hasLabelItem && mode === 'right' ? "".concat(labelWidth, "px") : undefined
|
|
72
72
|
});
|
|
73
|
-
return
|
|
73
|
+
return React.createElement("ul", _extends({}, restProps, {
|
|
74
74
|
className: classString,
|
|
75
75
|
style: styleString
|
|
76
76
|
}), items === null || items === void 0 ? void 0 : _mapInstanceProperty(items).call(items, function (item) {
|
|
77
|
-
return
|
|
77
|
+
return React.cloneElement(item, {
|
|
78
78
|
mode: mode,
|
|
79
79
|
labelWidth: labelWidth,
|
|
80
80
|
lineHeight: lineHeight,
|
|
@@ -44,22 +44,22 @@ var TimelineItem = function TimelineItem(props) {
|
|
|
44
44
|
width: "".concat(labelWidth, "px")
|
|
45
45
|
}, _concatInstanceProperty(_context = "margin".concat(mode === null || mode === void 0 ? void 0 : mode.substring(0, 1).toUpperCase())).call(_context, mode === null || mode === void 0 ? void 0 : mode.substring(1)), "-".concat(labelWidth, "px")) : {};
|
|
46
46
|
var marginDistance = pending ? Math.round(lineHeight / 2 + 12 / 2 + 2) : Math.round(lineHeight / 2 + 9 / 2 + 2);
|
|
47
|
-
return
|
|
47
|
+
return React.createElement("li", _extends({}, restProps, {
|
|
48
48
|
className: itemClassName
|
|
49
|
-
}), label &&
|
|
49
|
+
}), label && React.createElement("div", {
|
|
50
50
|
className: "".concat(prefixCls, "-label"),
|
|
51
51
|
style: _extends(_extends({}, labelStyle), {
|
|
52
52
|
lineHeight: lineHeight + 'px'
|
|
53
53
|
})
|
|
54
|
-
}, label),
|
|
54
|
+
}, label), React.createElement("div", {
|
|
55
55
|
className: "".concat(prefixCls, "-tail"),
|
|
56
56
|
style: {
|
|
57
57
|
marginTop: marginDistance
|
|
58
58
|
}
|
|
59
|
-
}),
|
|
59
|
+
}), React.createElement("div", {
|
|
60
60
|
className: dotClassName,
|
|
61
61
|
style: dotStyle
|
|
62
|
-
}, dot),
|
|
62
|
+
}, dot), React.createElement("div", {
|
|
63
63
|
className: "".concat(prefixCls, "-content"),
|
|
64
64
|
style: {
|
|
65
65
|
lineHeight: lineHeight + 'px'
|
package/es/tooltip/tooltip.js
CHANGED
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { getCompProps } from '../_utils';
|
|
4
4
|
import { ConfigContext } from '../config-provider';
|
|
5
5
|
import Popper from '../popper';
|
|
6
|
-
var Tooltip =
|
|
6
|
+
var Tooltip = React.forwardRef(function (props, ref) {
|
|
7
7
|
var _React$useContext = React.useContext(ConfigContext),
|
|
8
8
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
9
9
|
pkgPrefixCls = _React$useContext.prefixCls,
|
|
@@ -14,7 +14,7 @@ var Tooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
14
14
|
ref: ref,
|
|
15
15
|
prefixCls: prefixCls
|
|
16
16
|
}, allProps);
|
|
17
|
-
return
|
|
17
|
+
return React.createElement(Popper, _extends({}, popperProps));
|
|
18
18
|
});
|
|
19
19
|
Tooltip.displayName = 'Tooltip';
|
|
20
20
|
export default Tooltip;
|
package/es/transfer/list-body.js
CHANGED
|
@@ -65,9 +65,9 @@ var ListBody = function ListBody(props) {
|
|
|
65
65
|
}, [mergedPagination, filteredRenderItems]);
|
|
66
66
|
var paginationNode = null;
|
|
67
67
|
if (mergedPagination) {
|
|
68
|
-
paginationNode =
|
|
68
|
+
paginationNode = React.createElement("div", {
|
|
69
69
|
className: "".concat(prefixCls, "-pagination")
|
|
70
|
-
},
|
|
70
|
+
}, React.createElement(Pagination, {
|
|
71
71
|
pageType: "simple",
|
|
72
72
|
disabled: globalDisabled,
|
|
73
73
|
current: current,
|
|
@@ -77,7 +77,7 @@ var ListBody = function ListBody(props) {
|
|
|
77
77
|
onChange: onPageChange
|
|
78
78
|
}));
|
|
79
79
|
}
|
|
80
|
-
return
|
|
80
|
+
return React.createElement(React.Fragment, null, React.createElement("ul", {
|
|
81
81
|
className: classNames("".concat(prefixCls, "-content"))
|
|
82
82
|
}, _mapInstanceProperty(_context = getItems()).call(_context, function (_ref) {
|
|
83
83
|
var renderedEl = _ref.renderedEl,
|
|
@@ -85,7 +85,7 @@ var ListBody = function ListBody(props) {
|
|
|
85
85
|
item = _ref.item;
|
|
86
86
|
var disabled = item.disabled;
|
|
87
87
|
var checked = selectedKeys.indexOf(item.key) >= 0;
|
|
88
|
-
return
|
|
88
|
+
return React.createElement(ListItem, {
|
|
89
89
|
disabled: globalDisabled || disabled,
|
|
90
90
|
key: item.key,
|
|
91
91
|
item: item,
|
package/es/transfer/list-item.js
CHANGED
|
@@ -24,28 +24,27 @@ var ListItem = function ListItem(props) {
|
|
|
24
24
|
className: className,
|
|
25
25
|
title: title
|
|
26
26
|
};
|
|
27
|
-
var labelNode =
|
|
27
|
+
var labelNode = React.createElement("span", {
|
|
28
28
|
className: "".concat(prefixCls, "-content-item-text")
|
|
29
29
|
}, renderedEl);
|
|
30
30
|
if (showRemove) {
|
|
31
|
-
return
|
|
31
|
+
return React.createElement("li", _extends({}, liProps), labelNode, React.createElement("span", {
|
|
32
32
|
className: "".concat(prefixCls, "-content-item-remove"),
|
|
33
33
|
onClick: function onClick() {
|
|
34
34
|
return onRemove && onRemove(item);
|
|
35
35
|
}
|
|
36
|
-
},
|
|
36
|
+
}, React.createElement(Icon, {
|
|
37
37
|
type: "close-solid"
|
|
38
38
|
})));
|
|
39
39
|
}
|
|
40
|
-
// Default click to select
|
|
41
40
|
liProps.onClick = function (e) {
|
|
42
41
|
if (disabled || item.disabled) return;
|
|
43
42
|
e.preventDefault();
|
|
44
43
|
onClick(item);
|
|
45
44
|
};
|
|
46
|
-
return
|
|
45
|
+
return React.createElement("li", _extends({}, liProps), React.createElement(Checkbox, {
|
|
47
46
|
checked: checked,
|
|
48
47
|
disabled: disabled || item.disabled
|
|
49
48
|
}), labelNode);
|
|
50
49
|
};
|
|
51
|
-
export default
|
|
50
|
+
export default React.memo(ListItem);
|
package/es/transfer/list.js
CHANGED
|
@@ -14,7 +14,7 @@ var defaultRender = function defaultRender() {
|
|
|
14
14
|
return null;
|
|
15
15
|
};
|
|
16
16
|
function isRenderResultPlainObject(result) {
|
|
17
|
-
return result && !
|
|
17
|
+
return result && !React.isValidElement(result) && Object.prototype.toString.call(result) === '[object Object]';
|
|
18
18
|
}
|
|
19
19
|
var ITransferList = function ITransferList(props, ref) {
|
|
20
20
|
var _classNames;
|
|
@@ -42,7 +42,6 @@ var ITransferList = function ITransferList(props, ref) {
|
|
|
42
42
|
_useState2 = _slicedToArray(_useState, 2),
|
|
43
43
|
filterValue = _useState2[0],
|
|
44
44
|
setFilterValue = _useState2[1];
|
|
45
|
-
// 自定义底部渲染
|
|
46
45
|
var footerDom = footer && footer(props);
|
|
47
46
|
useImperativeHandle(ref, function () {
|
|
48
47
|
return {
|
|
@@ -64,7 +63,6 @@ var ITransferList = function ITransferList(props, ref) {
|
|
|
64
63
|
dataSource.forEach(function (item) {
|
|
65
64
|
var renderedItem = renderItem(item);
|
|
66
65
|
var renderedText = renderedItem.renderedText;
|
|
67
|
-
// Filter skip
|
|
68
66
|
if (filterValue && !matchFilter(renderedText, item)) {
|
|
69
67
|
return null;
|
|
70
68
|
}
|
|
@@ -95,7 +93,7 @@ var ITransferList = function ITransferList(props, ref) {
|
|
|
95
93
|
var bodyContent = renderList ? renderList(props) : null;
|
|
96
94
|
var customize = !!bodyContent;
|
|
97
95
|
if (!customize) {
|
|
98
|
-
bodyContent =
|
|
96
|
+
bodyContent = React.createElement(DefaultListBody, _extends({}, props));
|
|
99
97
|
}
|
|
100
98
|
return {
|
|
101
99
|
customize: customize,
|
|
@@ -104,9 +102,9 @@ var ITransferList = function ITransferList(props, ref) {
|
|
|
104
102
|
};
|
|
105
103
|
var getListBody = function getListBody(prefixCls, placeholder, filterValue, filteredItems, noDataContent, filteredRenderItems, checkedKeys, renderList, showSearch, disabled) {
|
|
106
104
|
var _context;
|
|
107
|
-
var search = showSearch ?
|
|
105
|
+
var search = showSearch ? React.createElement("div", {
|
|
108
106
|
className: "".concat(prefixCls, "-body-search-wrapper")
|
|
109
|
-
},
|
|
107
|
+
}, React.createElement(Search, {
|
|
110
108
|
prefixCls: "".concat(prefixCls, "-search"),
|
|
111
109
|
onChange: onFilterChange,
|
|
112
110
|
handleClear: onClear,
|
|
@@ -122,26 +120,25 @@ var ITransferList = function ITransferList(props, ref) {
|
|
|
122
120
|
bodyContent = _renderListBody.bodyContent,
|
|
123
121
|
customize = _renderListBody.customize;
|
|
124
122
|
var bodyNode;
|
|
125
|
-
// We should wrap customize list body in a classNamed div to use flex layout.
|
|
126
123
|
if (customize) {
|
|
127
|
-
bodyNode =
|
|
124
|
+
bodyNode = React.createElement("div", {
|
|
128
125
|
className: "".concat(prefixCls, "-body-customize-wrapper")
|
|
129
126
|
}, bodyContent);
|
|
130
127
|
} else {
|
|
131
|
-
bodyNode = filteredItems.length ? bodyContent :
|
|
128
|
+
bodyNode = filteredItems.length ? bodyContent : React.createElement("div", {
|
|
132
129
|
className: "".concat(prefixCls, "-body-not-found")
|
|
133
130
|
}, noDataContent);
|
|
134
131
|
}
|
|
135
|
-
return
|
|
132
|
+
return React.createElement("div", {
|
|
136
133
|
className: classNames(showSearch ? _concatInstanceProperty(_context = "".concat(prefixCls, "-body ")).call(_context, prefixCls, "-body-with-search") : "".concat(prefixCls, "-body"))
|
|
137
134
|
}, search, bodyNode);
|
|
138
135
|
};
|
|
139
136
|
var getSelectAllLabel = function getSelectAllLabel(selectedCount, totalCount) {
|
|
140
137
|
var _context2;
|
|
141
138
|
if (showRemove) {
|
|
142
|
-
return
|
|
139
|
+
return React.createElement(React.Fragment, null, "".concat(totalCount));
|
|
143
140
|
}
|
|
144
|
-
return
|
|
141
|
+
return React.createElement(React.Fragment, null, _concatInstanceProperty(_context2 = "(".concat(selectedCount, "/")).call(_context2, totalCount, ")"));
|
|
145
142
|
};
|
|
146
143
|
var getCheckStatus = function getCheckStatus(filteredItems) {
|
|
147
144
|
if (checkedKeys.length === 0) {
|
|
@@ -157,15 +154,14 @@ var ITransferList = function ITransferList(props, ref) {
|
|
|
157
154
|
var getCheckBox = function getCheckBox(filteredItems, onItemSelectAll, showSelectAll, disabled) {
|
|
158
155
|
var checkStatus = getCheckStatus(filteredItems);
|
|
159
156
|
var checkedAll = checkStatus === 'all';
|
|
160
|
-
var checkAllCheckbox =
|
|
157
|
+
var checkAllCheckbox = React.createElement("div", {
|
|
161
158
|
className: "".concat(prefixCls, "-header-select-all")
|
|
162
|
-
}, showSelectAll !== false &&
|
|
159
|
+
}, showSelectAll !== false && React.createElement(Checkbox, {
|
|
163
160
|
disabled: disabled,
|
|
164
161
|
checked: checkedAll,
|
|
165
162
|
indeterminate: checkStatus === 'part',
|
|
166
163
|
onChange: function onChange() {
|
|
167
164
|
var _context3;
|
|
168
|
-
// Only select enabled items
|
|
169
165
|
onItemSelectAll(_mapInstanceProperty(_context3 = _filterInstanceProperty(filteredItems).call(filteredItems, function (item) {
|
|
170
166
|
return !item.disabled;
|
|
171
167
|
})).call(_context3, function (_ref) {
|
|
@@ -176,7 +172,7 @@ var ITransferList = function ITransferList(props, ref) {
|
|
|
176
172
|
}));
|
|
177
173
|
return checkAllCheckbox;
|
|
178
174
|
};
|
|
179
|
-
var listFooter = footerDom ?
|
|
175
|
+
var listFooter = footerDom ? React.createElement("div", {
|
|
180
176
|
className: "".concat(prefixCls, "-footer")
|
|
181
177
|
}, footerDom) : null;
|
|
182
178
|
var _getFilteredItems = getFilteredItems(dataSource, filterValue),
|
|
@@ -185,20 +181,20 @@ var ITransferList = function ITransferList(props, ref) {
|
|
|
185
181
|
var checkAllCheckbox = !showRemove && getCheckBox(filteredItems, onItemSelectAll, showSelectAll, disabled);
|
|
186
182
|
var listBody = getListBody(prefixCls, placeholder, filterValue, filteredItems, noDataContent, filteredRenderItems, checkedKeys, renderList, showSearch, disabled);
|
|
187
183
|
var listCls = classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-with-pagination"), pagination), _defineProperty(_classNames, "".concat(prefixCls, "-with-footer"), footerDom), _classNames));
|
|
188
|
-
return
|
|
184
|
+
return React.createElement("div", {
|
|
189
185
|
className: listCls,
|
|
190
186
|
style: style
|
|
191
|
-
},
|
|
187
|
+
}, React.createElement("div", {
|
|
192
188
|
className: "".concat(prefixCls, "-header")
|
|
193
|
-
},
|
|
189
|
+
}, React.createElement("div", {
|
|
194
190
|
className: "".concat(prefixCls, "-header-left")
|
|
195
|
-
}, checkAllCheckbox,
|
|
191
|
+
}, checkAllCheckbox, React.createElement("span", {
|
|
196
192
|
className: "".concat(prefixCls, "-header-title")
|
|
197
|
-
}, titleText)),
|
|
193
|
+
}, titleText)), React.createElement("span", {
|
|
198
194
|
className: "".concat(prefixCls, "-header-selected")
|
|
199
195
|
}, getSelectAllLabel(checkedKeys.length, filteredItems.length))), listBody, listFooter);
|
|
200
196
|
};
|
|
201
|
-
var TransferList =
|
|
197
|
+
var TransferList = React.forwardRef(ITransferList);
|
|
202
198
|
TransferList.defaultProps = {
|
|
203
199
|
dataSource: [],
|
|
204
200
|
titleText: '',
|
package/es/transfer/operation.js
CHANGED
|
@@ -15,27 +15,27 @@ var Operation = function Operation(_ref) {
|
|
|
15
15
|
style = _ref.style,
|
|
16
16
|
direction = _ref.direction,
|
|
17
17
|
oneWay = _ref.oneWay;
|
|
18
|
-
return
|
|
18
|
+
return React.createElement("div", {
|
|
19
19
|
className: className,
|
|
20
20
|
style: style
|
|
21
|
-
},
|
|
21
|
+
}, React.createElement(Button, {
|
|
22
22
|
type: disabled || !rightActive ? 'ghost' : 'primary',
|
|
23
23
|
size: "small",
|
|
24
24
|
disabled: disabled || !rightActive,
|
|
25
25
|
onClick: moveToRight,
|
|
26
|
-
icon: direction !== 'rtl' ?
|
|
26
|
+
icon: direction !== 'rtl' ? React.createElement(Icon, {
|
|
27
27
|
type: "arrow-right"
|
|
28
|
-
}) :
|
|
28
|
+
}) : React.createElement(Icon, {
|
|
29
29
|
type: "arrow-left"
|
|
30
30
|
})
|
|
31
|
-
}, rightArrowText), !oneWay &&
|
|
31
|
+
}, rightArrowText), !oneWay && React.createElement(Button, {
|
|
32
32
|
type: disabled || !leftActive ? 'ghost' : 'primary',
|
|
33
33
|
size: "small",
|
|
34
34
|
disabled: disabled || !leftActive,
|
|
35
35
|
onClick: moveToLeft,
|
|
36
|
-
icon: direction !== 'rtl' ?
|
|
36
|
+
icon: direction !== 'rtl' ? React.createElement(Icon, {
|
|
37
37
|
type: "arrow-left"
|
|
38
|
-
}) :
|
|
38
|
+
}) : React.createElement(Icon, {
|
|
39
39
|
type: "arrow-right"
|
|
40
40
|
})
|
|
41
41
|
}, leftArrowText));
|
package/es/transfer/search.js
CHANGED
|
@@ -19,18 +19,18 @@ var transferSearch = function transferSearch(props) {
|
|
|
19
19
|
handleClear(e);
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
var prefixIcon =
|
|
22
|
+
var prefixIcon = React.createElement("span", {
|
|
23
23
|
className: "".concat(prefixCls, "-prefix")
|
|
24
|
-
},
|
|
24
|
+
}, React.createElement(Icon, {
|
|
25
25
|
type: "search"
|
|
26
26
|
}));
|
|
27
|
-
var suffixIcon = value && value.length > 0 ?
|
|
27
|
+
var suffixIcon = value && value.length > 0 ? React.createElement("span", {
|
|
28
28
|
className: "".concat(prefixCls, "-suffix"),
|
|
29
29
|
onClick: handleClearFn
|
|
30
|
-
},
|
|
30
|
+
}, React.createElement(Icon, {
|
|
31
31
|
type: "close-solid"
|
|
32
32
|
})) : null;
|
|
33
|
-
return
|
|
33
|
+
return React.createElement(React.Fragment, null, React.createElement(Input, {
|
|
34
34
|
borderType: "bordered",
|
|
35
35
|
placeholder: placeholder,
|
|
36
36
|
className: prefixCls,
|