@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/lib/progress/circle.js
CHANGED
|
@@ -51,14 +51,14 @@ var Circle = function Circle(props) {
|
|
|
51
51
|
var gradientArr = isGradient ? (0, _sort.default)(_context2 = (0, _keys.default)(gradientColor)).call(_context2, function (a, b) {
|
|
52
52
|
return stripPercentToNumber(a) - stripPercentToNumber(b);
|
|
53
53
|
}) : null;
|
|
54
|
-
var gradientDom = isGradient ?
|
|
54
|
+
var gradientDom = isGradient ? _react.default.createElement("defs", null, _react.default.createElement("linearGradient", {
|
|
55
55
|
id: (0, _concat.default)(_context3 = "".concat(prefixCls, "-gradient-")).call(_context3, gradientId),
|
|
56
56
|
x1: "100%",
|
|
57
57
|
y1: "0%",
|
|
58
58
|
x2: "0%",
|
|
59
59
|
y2: "0%"
|
|
60
60
|
}, gradientArr === null || gradientArr === void 0 ? void 0 : (0, _map.default)(gradientArr).call(gradientArr, function (key, index) {
|
|
61
|
-
return
|
|
61
|
+
return _react.default.createElement("stop", {
|
|
62
62
|
key: index,
|
|
63
63
|
offset: key,
|
|
64
64
|
stopColor: gradientColor[key]
|
|
@@ -73,27 +73,25 @@ var Circle = function Circle(props) {
|
|
|
73
73
|
stroke: pathColor
|
|
74
74
|
};
|
|
75
75
|
var wrapperClassName = (0, _classnames.default)("".concat(prefixCls, "-circle-box"), (0, _defineProperty2.default)({}, "".concat(prefixCls, "-circle-gradient"), isGradient));
|
|
76
|
-
return
|
|
76
|
+
return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement("div", {
|
|
77
77
|
className: wrapperClassName,
|
|
78
78
|
style: circleStyle
|
|
79
|
-
},
|
|
79
|
+
}, _react.default.createElement("svg", {
|
|
80
80
|
className: "".concat(prefixCls, "-circle"),
|
|
81
81
|
viewBox: "0 0 100 100",
|
|
82
82
|
strokeWidth: strokeWidth
|
|
83
|
-
}, gradientDom,
|
|
83
|
+
}, gradientDom, _react.default.createElement("path", {
|
|
84
84
|
className: "".concat(prefixCls, "-circle-trail"),
|
|
85
85
|
style: {
|
|
86
86
|
stroke: trailColor
|
|
87
87
|
},
|
|
88
88
|
d: pathString,
|
|
89
|
-
// stroke={trailColor}
|
|
90
89
|
strokeWidth: strokeWidth,
|
|
91
90
|
fillOpacity: "0",
|
|
92
91
|
strokeLinecap: "round"
|
|
93
|
-
}),
|
|
92
|
+
}), _react.default.createElement("path", {
|
|
94
93
|
className: "".concat(prefixCls, "-circle-path"),
|
|
95
94
|
d: pathString,
|
|
96
|
-
// stroke={pathColor}
|
|
97
95
|
strokeWidth: strokeWidth,
|
|
98
96
|
style: pathStyle,
|
|
99
97
|
fillOpacity: "0",
|
package/lib/progress/line.js
CHANGED
|
@@ -25,12 +25,12 @@ var Line = function Line(props) {
|
|
|
25
25
|
width: "".concat((0, _utils.validProgress)(percent), "%"),
|
|
26
26
|
height: strokeWidth && "".concat(strokeWidth, "px")
|
|
27
27
|
}, backgroundProps);
|
|
28
|
-
return
|
|
28
|
+
return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement("div", {
|
|
29
29
|
className: "".concat(prefixCls, "-outer")
|
|
30
|
-
},
|
|
30
|
+
}, _react.default.createElement("div", {
|
|
31
31
|
className: "".concat(prefixCls, "-inner"),
|
|
32
32
|
style: trailStyle
|
|
33
|
-
},
|
|
33
|
+
}, _react.default.createElement("div", {
|
|
34
34
|
className: "".concat(prefixCls, "-bg"),
|
|
35
35
|
style: percentStyle
|
|
36
36
|
}))), children);
|
package/lib/progress/progress.js
CHANGED
|
@@ -76,29 +76,29 @@ var Progress = function Progress(props) {
|
|
|
76
76
|
if (!showInfo && type !== 'circle' || infoPosition !== 'right' && isLoading) return null;
|
|
77
77
|
var text;
|
|
78
78
|
var textFormatter = format || function (percentNumber) {
|
|
79
|
-
return
|
|
79
|
+
return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement("span", {
|
|
80
80
|
className: "".concat(prefixCls, "-text-percent")
|
|
81
|
-
}, percentNumber),
|
|
81
|
+
}, percentNumber), _react.default.createElement("span", {
|
|
82
82
|
className: "".concat(prefixCls, "-text-unit")
|
|
83
83
|
}, "%"));
|
|
84
84
|
};
|
|
85
85
|
var successNodeMap = {
|
|
86
|
-
line:
|
|
86
|
+
line: _react.default.createElement(_icon.default, {
|
|
87
87
|
className: "".concat(prefixCls, "-icon"),
|
|
88
88
|
type: "right-solid"
|
|
89
89
|
}),
|
|
90
|
-
circle:
|
|
90
|
+
circle: _react.default.createElement(_icon.default, {
|
|
91
91
|
className: "".concat(prefixCls, "-icon"),
|
|
92
92
|
type: "right-bold"
|
|
93
93
|
}),
|
|
94
94
|
custom: successIcon
|
|
95
95
|
};
|
|
96
96
|
var failureNodeMap = {
|
|
97
|
-
line:
|
|
97
|
+
line: _react.default.createElement(_icon.default, {
|
|
98
98
|
className: "".concat(prefixCls, "-icon"),
|
|
99
99
|
type: "refresh-solid"
|
|
100
100
|
}),
|
|
101
|
-
circle:
|
|
101
|
+
circle: _react.default.createElement(_icon.default, {
|
|
102
102
|
className: "".concat(prefixCls, "-icon"),
|
|
103
103
|
type: "close-bold"
|
|
104
104
|
}),
|
|
@@ -111,7 +111,7 @@ var Progress = function Progress(props) {
|
|
|
111
111
|
} else if (progressStatus === 'success') {
|
|
112
112
|
text = successNodeMap.custom || successNodeMap[type];
|
|
113
113
|
}
|
|
114
|
-
return
|
|
114
|
+
return _react.default.createElement("span", {
|
|
115
115
|
className: "".concat(prefixCls, "-text")
|
|
116
116
|
}, text);
|
|
117
117
|
};
|
|
@@ -139,22 +139,22 @@ var Progress = function Progress(props) {
|
|
|
139
139
|
} else if (progressStatus === 'success') {
|
|
140
140
|
text = concatMap[2];
|
|
141
141
|
}
|
|
142
|
-
return
|
|
142
|
+
return _react.default.createElement("div", {
|
|
143
143
|
className: "".concat(prefixCls, "-special-text")
|
|
144
144
|
}, text);
|
|
145
145
|
};
|
|
146
|
-
var progress =
|
|
146
|
+
var progress = _react.default.createElement(_line.default, (0, _extends2.default)({}, progressProps, {
|
|
147
147
|
prefixCls: progressPrefixCls
|
|
148
148
|
}), renderProgressInfo(progressPrefixCls, progressStatus, progressProps));
|
|
149
149
|
if (type === 'circle') {
|
|
150
|
-
progress =
|
|
150
|
+
progress = _react.default.createElement(_circle.default, (0, _extends2.default)({}, progressProps, {
|
|
151
151
|
prefixCls: progressPrefixCls
|
|
152
152
|
}), renderProgressInfo(progressPrefixCls, progressStatus, progressProps));
|
|
153
153
|
}
|
|
154
154
|
(0, _react.useEffect)(function () {
|
|
155
155
|
onProcess && onProcess(percent);
|
|
156
156
|
}, [percent, onProcess]);
|
|
157
|
-
return
|
|
157
|
+
return _react.default.createElement("div", (0, _extends2.default)({}, (0, _omit.omit)(progressProps, ['status', 'format', 'width', 'strokeWidth', 'trailWidth', 'trailColor', 'strokeColor', 'percent', 'infoPosition', 'showInfo', 'textMap', 'onProcess']), {
|
|
158
158
|
className: progressClasses
|
|
159
159
|
}), progress, renderSpecialInfo(progressPrefixCls, progressStatus, progressProps));
|
|
160
160
|
};
|
package/lib/qr-code/qr-code.js
CHANGED
|
@@ -75,25 +75,25 @@ var QRCode = function QRCode(props) {
|
|
|
75
75
|
fgColor: color,
|
|
76
76
|
imageSettings: icon ? imageSettings : undefined
|
|
77
77
|
};
|
|
78
|
-
return
|
|
78
|
+
return _react.default.createElement("div", {
|
|
79
79
|
className: qrCodeClass,
|
|
80
80
|
style: (0, _extends2.default)((0, _extends2.default)({}, style), {
|
|
81
81
|
width: "".concat(containerSize, "px"),
|
|
82
82
|
height: "".concat(containerSize, "px"),
|
|
83
83
|
backgroundColor: bgColor
|
|
84
84
|
})
|
|
85
|
-
}, status !== 'active' &&
|
|
85
|
+
}, status !== 'active' && _react.default.createElement("div", {
|
|
86
86
|
className: "".concat(qrCodePrefixCls, "-mask")
|
|
87
|
-
}, status === 'loading' &&
|
|
87
|
+
}, status === 'loading' && _react.default.createElement(_spin.default, null), status === 'expired' && _react.default.createElement(_react.default.Fragment, null, _react.default.createElement("p", {
|
|
88
88
|
className: "".concat(qrCodePrefixCls, "-expired")
|
|
89
|
-
}, qrCodeLangMsg.qrCodeExpired), onRefresh &&
|
|
90
|
-
icon:
|
|
89
|
+
}, qrCodeLangMsg.qrCodeExpired), onRefresh && _react.default.createElement(_button.default, {
|
|
90
|
+
icon: _react.default.createElement(_icon.default, {
|
|
91
91
|
type: "refresh"
|
|
92
92
|
}),
|
|
93
93
|
type: "text",
|
|
94
94
|
onClick: onRefresh,
|
|
95
95
|
size: "middle"
|
|
96
|
-
}, qrCodeLangMsg.clickRefresh))), type === 'canvas' ?
|
|
96
|
+
}, qrCodeLangMsg.clickRefresh))), type === 'canvas' ? _react.default.createElement(_qrcode.QRCodeCanvas, (0, _extends2.default)({}, codeProps)) : _react.default.createElement(_qrcode.QRCodeSVG, (0, _extends2.default)({}, codeProps)));
|
|
97
97
|
};
|
|
98
98
|
QRCode.displayName = 'QRCode';
|
|
99
99
|
var _default = QRCode;
|
package/lib/radio/context.js
CHANGED
|
@@ -10,7 +10,7 @@ exports.default = exports.RadioGroupContextProvider = void 0;
|
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
-
var RadioGroupContext =
|
|
13
|
+
var RadioGroupContext = React.createContext(null);
|
|
14
14
|
var RadioGroupContextProvider = RadioGroupContext.Provider;
|
|
15
15
|
exports.RadioGroupContextProvider = RadioGroupContextProvider;
|
|
16
16
|
var _default = RadioGroupContext;
|
package/lib/radio/group.js
CHANGED
|
@@ -19,7 +19,7 @@ var _radio = _interopRequireDefault(require("./radio"));
|
|
|
19
19
|
var _context2 = require("./context");
|
|
20
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
|
-
var RadioGroup =
|
|
22
|
+
var RadioGroup = React.forwardRef(function (props, ref) {
|
|
23
23
|
var _React$useContext = React.useContext(_ConfigContext.default),
|
|
24
24
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
25
25
|
prefixCls = _React$useContext.prefixCls,
|
|
@@ -29,7 +29,6 @@ var RadioGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
29
29
|
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
30
30
|
value = _React$useState2[0],
|
|
31
31
|
setValue = _React$useState2[1];
|
|
32
|
-
// 从props更新value值
|
|
33
32
|
React.useEffect(function () {
|
|
34
33
|
if (typeof props.value !== 'undefined') {
|
|
35
34
|
setValue(props.value);
|
|
@@ -54,18 +53,16 @@ var RadioGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
54
53
|
children = _getCompProps.children,
|
|
55
54
|
className = _getCompProps.className,
|
|
56
55
|
optionType = _getCompProps.optionType,
|
|
57
|
-
customPrefixcls = _getCompProps.prefixCls;
|
|
58
|
-
var groupPrefixCls = getPrefixCls === null || getPrefixCls === void 0 ? void 0 : getPrefixCls(prefixCls, "radio-group", customPrefixcls);
|
|
59
|
-
var radioPrefixCls = getPrefixCls === null || getPrefixCls === void 0 ? void 0 : getPrefixCls(prefixCls, "radio", customPrefixcls);
|
|
56
|
+
customPrefixcls = _getCompProps.prefixCls;
|
|
57
|
+
var groupPrefixCls = getPrefixCls === null || getPrefixCls === void 0 ? void 0 : getPrefixCls(prefixCls, "radio-group", customPrefixcls);
|
|
58
|
+
var radioPrefixCls = getPrefixCls === null || getPrefixCls === void 0 ? void 0 : getPrefixCls(prefixCls, "radio", customPrefixcls);
|
|
60
59
|
var childrenToRender = children;
|
|
61
|
-
// 如果存在 options, 优先使用
|
|
62
60
|
if (options && options.length > 0) {
|
|
63
61
|
var _context;
|
|
64
62
|
var optionsPrefixCls = optionType === undefined ? radioPrefixCls : (0, _concat.default)(_context = "".concat(radioPrefixCls, "-")).call(_context, optionType);
|
|
65
63
|
childrenToRender = (0, _map.default)(options).call(options, function (option) {
|
|
66
64
|
if (typeof option === 'string') {
|
|
67
|
-
|
|
68
|
-
return /*#__PURE__*/React.createElement(_radio.default, {
|
|
65
|
+
return React.createElement(_radio.default, {
|
|
69
66
|
key: option,
|
|
70
67
|
prefixCls: optionsPrefixCls,
|
|
71
68
|
disabled: disabled,
|
|
@@ -73,8 +70,7 @@ var RadioGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
73
70
|
checked: value === option
|
|
74
71
|
}, option);
|
|
75
72
|
}
|
|
76
|
-
|
|
77
|
-
return /*#__PURE__*/React.createElement(_radio.default, {
|
|
73
|
+
return React.createElement(_radio.default, {
|
|
78
74
|
key: "radio-group-value-options-".concat(option.value),
|
|
79
75
|
prefixCls: optionsPrefixCls,
|
|
80
76
|
disabled: option.disabled || disabled,
|
|
@@ -84,14 +80,14 @@ var RadioGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
84
80
|
}, option.label);
|
|
85
81
|
});
|
|
86
82
|
}
|
|
87
|
-
return
|
|
83
|
+
return React.createElement("div", {
|
|
88
84
|
className: (0, _classnames.default)(groupPrefixCls, className),
|
|
89
85
|
style: style,
|
|
90
86
|
id: id,
|
|
91
87
|
ref: ref
|
|
92
88
|
}, childrenToRender);
|
|
93
89
|
};
|
|
94
|
-
return
|
|
90
|
+
return React.createElement(_context2.RadioGroupContextProvider, {
|
|
95
91
|
value: {
|
|
96
92
|
value: value,
|
|
97
93
|
name: props.name,
|
|
@@ -100,5 +96,5 @@ var RadioGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
100
96
|
}
|
|
101
97
|
}, renderGroup());
|
|
102
98
|
});
|
|
103
|
-
var _default =
|
|
99
|
+
var _default = React.memo(RadioGroup);
|
|
104
100
|
exports.default = _default;
|
|
@@ -44,7 +44,7 @@ var RadioButton = function RadioButton(props, ref) {
|
|
|
44
44
|
radioProps.checked = props.value === radioGroupContext.value;
|
|
45
45
|
radioProps.disabled = props.disabled || radioGroupContext.disabled;
|
|
46
46
|
}
|
|
47
|
-
return
|
|
47
|
+
return React.createElement(_radio.default, (0, _extends2.default)({
|
|
48
48
|
title: title,
|
|
49
49
|
prefixCls: radioButtonPrefixCls
|
|
50
50
|
}, radioProps, {
|
|
@@ -52,5 +52,5 @@ var RadioButton = function RadioButton(props, ref) {
|
|
|
52
52
|
ref: ref
|
|
53
53
|
}), children);
|
|
54
54
|
};
|
|
55
|
-
var _default =
|
|
55
|
+
var _default = React.forwardRef(RadioButton);
|
|
56
56
|
exports.default = _default;
|
package/lib/radio/radio.js
CHANGED
|
@@ -50,7 +50,7 @@ var InternalRadio = function InternalRadio(props, ref) {
|
|
|
50
50
|
disabled = _a.disabled,
|
|
51
51
|
defaultChecked = _a.defaultChecked,
|
|
52
52
|
customPrefixcls = _a.prefixCls,
|
|
53
|
-
restProps = __rest(_a, ["style", "checked", "children", "className", "radioType", "value", "disabled", "defaultChecked", "prefixCls"]);
|
|
53
|
+
restProps = __rest(_a, ["style", "checked", "children", "className", "radioType", "value", "disabled", "defaultChecked", "prefixCls"]);
|
|
54
54
|
(0, _devwarning.default)(!((0, _isNumber.default)(value) || (0, _isString.default)(value)) && value !== '', 'radio', 'radio `value` type must string or number ');
|
|
55
55
|
(0, _devwarning.default)(value === '', 'radio', 'radio value type is not empty string ');
|
|
56
56
|
var mergedDisabled = (context === null || context === void 0 ? void 0 : context.disabled) || restProps.disabled;
|
|
@@ -58,7 +58,7 @@ var InternalRadio = function InternalRadio(props, ref) {
|
|
|
58
58
|
var getPrefix = function getPrefix(radioType) {
|
|
59
59
|
return "radio".concat(radioType === 'square' ? "-".concat(radioType) : '');
|
|
60
60
|
};
|
|
61
|
-
var radioPrefixCls = getPrefixCls === null || getPrefixCls === void 0 ? void 0 : getPrefixCls(prefixCls, getPrefix(radioType), customPrefixcls);
|
|
61
|
+
var radioPrefixCls = getPrefixCls === null || getPrefixCls === void 0 ? void 0 : getPrefixCls(prefixCls, getPrefix(radioType), customPrefixcls);
|
|
62
62
|
var _React$useState = _react.default.useState(initValue),
|
|
63
63
|
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
64
64
|
isChecked = _React$useState2[0],
|
|
@@ -79,7 +79,7 @@ var InternalRadio = function InternalRadio(props, ref) {
|
|
|
79
79
|
context.onChange(e, value);
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
|
-
var classString = (0, _classnames.default)((_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(radioPrefixCls), true), (0, _defineProperty2.default)(_classNames, "".concat(radioPrefixCls, "-disabled"), disabled), (0, _defineProperty2.default)(_classNames, "".concat(radioPrefixCls, "-checked"), isChecked), _classNames), className);
|
|
82
|
+
var classString = (0, _classnames.default)((_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(radioPrefixCls), true), (0, _defineProperty2.default)(_classNames, "".concat(radioPrefixCls, "-disabled"), disabled), (0, _defineProperty2.default)(_classNames, "".concat(radioPrefixCls, "-checked"), isChecked), _classNames), className);
|
|
83
83
|
(0, _react.useEffect)(function () {
|
|
84
84
|
var _a;
|
|
85
85
|
var handleRepeatClick = function handleRepeatClick(e) {
|
|
@@ -92,31 +92,26 @@ var InternalRadio = function InternalRadio(props, ref) {
|
|
|
92
92
|
(_a = radioRef === null || radioRef === void 0 ? void 0 : radioRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('click', handleRepeatClick);
|
|
93
93
|
return function () {
|
|
94
94
|
var _a;
|
|
95
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
96
95
|
(_a = radioRef === null || radioRef === void 0 ? void 0 : radioRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('click', handleRepeatClick);
|
|
97
96
|
};
|
|
98
97
|
}, []);
|
|
99
|
-
return (
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
})), children !== undefined ? /*#__PURE__*/_react.default.createElement("span", {
|
|
115
|
-
className: "".concat(radioPrefixCls, "-text")
|
|
116
|
-
}, children) : null)
|
|
117
|
-
);
|
|
98
|
+
return _react.default.createElement("label", {
|
|
99
|
+
className: classString,
|
|
100
|
+
style: style,
|
|
101
|
+
ref: mergedRef
|
|
102
|
+
}, _react.default.createElement("input", (0, _extends2.default)({}, restProps, {
|
|
103
|
+
type: "radio",
|
|
104
|
+
className: "".concat(radioPrefixCls, "-input"),
|
|
105
|
+
checked: isChecked,
|
|
106
|
+
onChange: onChange,
|
|
107
|
+
value: value,
|
|
108
|
+
name: context === null || context === void 0 ? void 0 : context.name,
|
|
109
|
+
disabled: mergedDisabled
|
|
110
|
+
})), children !== undefined ? _react.default.createElement("span", {
|
|
111
|
+
className: "".concat(radioPrefixCls, "-text")
|
|
112
|
+
}, children) : null);
|
|
118
113
|
};
|
|
119
|
-
var Radio =
|
|
114
|
+
var Radio = _react.default.forwardRef(InternalRadio);
|
|
120
115
|
Radio.displayName = 'Radio';
|
|
121
116
|
var _default = Radio;
|
|
122
117
|
exports.default = _default;
|
package/lib/rate/rate.js
CHANGED
|
@@ -47,24 +47,20 @@ var Rate = function Rate(props) {
|
|
|
47
47
|
onHoverChange = _getCompProps.onHoverChange,
|
|
48
48
|
onFocus = _getCompProps.onFocus;
|
|
49
49
|
(0, _devwarning.default)(SizeTypes.indexOf(size) === -1, 'Rate', "cannot found SizeType '".concat(size, "'"));
|
|
50
|
-
// className前缀
|
|
51
50
|
var prefixCls = getPrefixCls(pkgPrefixCls, 'rate', customPrefixcls);
|
|
52
51
|
var _React$useState = React.useState(defaultValue),
|
|
53
52
|
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
54
53
|
selectedValue = _React$useState2[0],
|
|
55
|
-
setSelectedValue = _React$useState2[1];
|
|
54
|
+
setSelectedValue = _React$useState2[1];
|
|
56
55
|
var _React$useState3 = React.useState(0),
|
|
57
56
|
_React$useState4 = (0, _slicedToArray2.default)(_React$useState3, 2),
|
|
58
57
|
activeNumber = _React$useState4[0],
|
|
59
|
-
setActiveNumber = _React$useState4[1];
|
|
58
|
+
setActiveNumber = _React$useState4[1];
|
|
60
59
|
React.useEffect(function () {
|
|
61
60
|
if (value !== undefined && value !== selectedValue) {
|
|
62
61
|
setSelectedValue(value);
|
|
63
62
|
}
|
|
64
63
|
}, [value, selectedValue]);
|
|
65
|
-
// const shouldSetValue = (value: number) => {
|
|
66
|
-
// return value && value !== 0 && value !== selectedValue
|
|
67
|
-
// }
|
|
68
64
|
var handleClick = React.useCallback(function (value) {
|
|
69
65
|
setSelectedValue(value);
|
|
70
66
|
onChange && onChange(value);
|
|
@@ -82,31 +78,19 @@ var Rate = function Rate(props) {
|
|
|
82
78
|
var handleBlur = React.useCallback(function () {
|
|
83
79
|
onBlur && onBlur();
|
|
84
80
|
}, [onBlur]);
|
|
85
|
-
/**
|
|
86
|
-
*获取图标
|
|
87
|
-
* @param icon
|
|
88
|
-
* @param index
|
|
89
|
-
*/
|
|
90
81
|
var getIcon = function getIcon(icon, activeIcon, index, isActive) {
|
|
91
82
|
if (activeIcon && isActive) {
|
|
92
83
|
icon = activeIcon;
|
|
93
84
|
}
|
|
94
85
|
if (typeof icon === 'function') {
|
|
95
|
-
return
|
|
86
|
+
return React.createElement("span", {
|
|
96
87
|
className: "".concat(prefixCls, "-icon-wrapper")
|
|
97
88
|
}, icon(index));
|
|
98
89
|
}
|
|
99
|
-
return
|
|
90
|
+
return React.createElement("span", {
|
|
100
91
|
className: "".concat(prefixCls, "-icon-second-content")
|
|
101
92
|
}, icon);
|
|
102
93
|
};
|
|
103
|
-
/**
|
|
104
|
-
* 获取第一个图标状态
|
|
105
|
-
* @param value
|
|
106
|
-
* @param index
|
|
107
|
-
* @param onlyActiveCurrent
|
|
108
|
-
* @param isSecondIconActive
|
|
109
|
-
*/
|
|
110
94
|
var getFirstIconStatus = function getFirstIconStatus(value, index, onlyActiveCurrent, secondIconStatus) {
|
|
111
95
|
var half = 0.5;
|
|
112
96
|
var isInteger = (0, _isInteger.default)(value);
|
|
@@ -116,18 +100,14 @@ var Rate = function Rate(props) {
|
|
|
116
100
|
var isActiveFirst = value === index - half;
|
|
117
101
|
var mark;
|
|
118
102
|
if (secondIconStatus) {
|
|
119
|
-
// 第二个图标被激活则第一个也必须激活
|
|
120
103
|
mark = true;
|
|
121
104
|
} else if (!onlyActiveCurrent) {
|
|
122
|
-
// 激活点击位置所有左侧图标
|
|
123
105
|
mark = isActiveAllLeft;
|
|
124
106
|
} else if (isInteger) {
|
|
125
|
-
// 点击全图标只激活当前点击图标
|
|
126
107
|
mark = isActiveCurrent;
|
|
127
108
|
} else {
|
|
128
|
-
mark = isActiveFirst;
|
|
109
|
+
mark = isActiveFirst;
|
|
129
110
|
}
|
|
130
|
-
|
|
131
111
|
return mark;
|
|
132
112
|
};
|
|
133
113
|
var transferValue = function transferValue(value, index) {
|
|
@@ -138,34 +118,18 @@ var Rate = function Rate(props) {
|
|
|
138
118
|
return Math.round(value);
|
|
139
119
|
}
|
|
140
120
|
};
|
|
141
|
-
/**
|
|
142
|
-
* 获取第二个图标状态
|
|
143
|
-
* @param value
|
|
144
|
-
* @param index
|
|
145
|
-
* @param onlyActiveCurrent
|
|
146
|
-
*/
|
|
147
121
|
var getSecondIconStatus = function getSecondIconStatus(value, index, onlyActiveCurrent) {
|
|
148
122
|
if (!onlyActiveCurrent) {
|
|
149
|
-
// 激活所有左侧图标
|
|
150
123
|
return value >= index;
|
|
151
124
|
} else {
|
|
152
|
-
return value === index;
|
|
125
|
+
return value === index;
|
|
153
126
|
}
|
|
154
127
|
};
|
|
155
|
-
/**
|
|
156
|
-
* 返回图标的样式
|
|
157
|
-
* @param isActive
|
|
158
|
-
*/
|
|
159
128
|
var getIconStyle = function getIconStyle(isActive) {
|
|
160
129
|
if (isActive) return {
|
|
161
130
|
color: color
|
|
162
131
|
};
|
|
163
132
|
};
|
|
164
|
-
/**
|
|
165
|
-
*
|
|
166
|
-
* @param selectActive 当前图标是否被选中
|
|
167
|
-
* @param mouseActive 当前图标是否触发鼠标hover效果
|
|
168
|
-
*/
|
|
169
133
|
var isSelected = function isSelected(selectActive, mouseActive) {
|
|
170
134
|
return activeNumber !== 0 ? mouseActive : selectActive;
|
|
171
135
|
};
|
|
@@ -173,9 +137,6 @@ var Rate = function Rate(props) {
|
|
|
173
137
|
var _context, _classnames;
|
|
174
138
|
return (0, _classnames3.default)((_classnames = {}, (0, _defineProperty2.default)(_classnames, (0, _concat.default)(_context = "".concat(prefixCls, "-icon-")).call(_context, name), true), (0, _defineProperty2.default)(_classnames, "".concat(prefixCls, "-icon-selected"), isActive), _classnames));
|
|
175
139
|
};
|
|
176
|
-
/**
|
|
177
|
-
* 获取图标视图
|
|
178
|
-
*/
|
|
179
140
|
var getRateIconView = function getRateIconView() {
|
|
180
141
|
var half = 0.5;
|
|
181
142
|
var rateIconsView = [];
|
|
@@ -190,12 +151,12 @@ var Rate = function Rate(props) {
|
|
|
190
151
|
var firstIconStyle = getIconStyle(isFirstActive);
|
|
191
152
|
var firstIconClassName = getIconClassName('first', isFirstActive);
|
|
192
153
|
var secondIconClassName = getIconClassName('second', isSecondActive);
|
|
193
|
-
rateIconsView.push(
|
|
154
|
+
rateIconsView.push(React.createElement("span", {
|
|
194
155
|
className: "".concat(prefixCls, "-item"),
|
|
195
156
|
key: i
|
|
196
|
-
},
|
|
157
|
+
}, React.createElement("div", {
|
|
197
158
|
className: "".concat(prefixCls, "-icon-view")
|
|
198
|
-
}, allowHalf &&
|
|
159
|
+
}, allowHalf && React.createElement("span", {
|
|
199
160
|
style: firstIconStyle,
|
|
200
161
|
className: firstIconClassName,
|
|
201
162
|
onClick: function onClick() {
|
|
@@ -207,7 +168,7 @@ var Rate = function Rate(props) {
|
|
|
207
168
|
onMouseLeave: function onMouseLeave() {
|
|
208
169
|
return handleMouseLeave();
|
|
209
170
|
}
|
|
210
|
-
}, getIcon(icon, activeIcon, i, isFirstActive)),
|
|
171
|
+
}, getIcon(icon, activeIcon, i, isFirstActive)), React.createElement("span", {
|
|
211
172
|
style: IconStyle,
|
|
212
173
|
className: secondIconClassName,
|
|
213
174
|
onClick: function onClick() {
|
|
@@ -226,19 +187,8 @@ var Rate = function Rate(props) {
|
|
|
226
187
|
}
|
|
227
188
|
return rateIconsView;
|
|
228
189
|
};
|
|
229
|
-
/**
|
|
230
|
-
* 获取图标下方情感描述文字
|
|
231
|
-
* @param index 图标对应索引
|
|
232
|
-
*/
|
|
233
|
-
// const getEmotionalTextView = (index:number):React.ReactNode => {
|
|
234
|
-
// return (
|
|
235
|
-
// <span className={`${prefixCls}-item-text`}>
|
|
236
|
-
// {emotionalText[index] ? emotionalText[index] : null}
|
|
237
|
-
// </span>
|
|
238
|
-
// )
|
|
239
|
-
// }
|
|
240
190
|
var getRateClassName = (0, _classnames3.default)(prefixCls, className, (_classnames2 = {}, (0, _defineProperty2.default)(_classnames2, (0, _concat.default)(_context2 = "".concat(prefixCls, "-size-")).call(_context2, size), size), (0, _defineProperty2.default)(_classnames2, "".concat(prefixCls, "-disabled"), disabled), _classnames2));
|
|
241
|
-
var rate =
|
|
191
|
+
var rate = React.createElement("span", {
|
|
242
192
|
className: getRateClassName,
|
|
243
193
|
style: style,
|
|
244
194
|
onMouseLeave: function onMouseLeave() {
|
package/lib/search/option.js
CHANGED
|
@@ -35,7 +35,6 @@ var InternalOption = function InternalOption(props, ref) {
|
|
|
35
35
|
var optionTagCls = (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(optionPrefixCls, "-option-tag"), true));
|
|
36
36
|
var optionContentCls = (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(optionPrefixCls, "-option-content"), true));
|
|
37
37
|
var handleClick = function handleClick() {
|
|
38
|
-
// setSelected(!isSelected)
|
|
39
38
|
onChangeSelect && (onChangeSelect === null || onChangeSelect === void 0 ? void 0 : onChangeSelect({
|
|
40
39
|
tag: tag,
|
|
41
40
|
label: searchValue,
|
|
@@ -43,18 +42,18 @@ var InternalOption = function InternalOption(props, ref) {
|
|
|
43
42
|
}));
|
|
44
43
|
};
|
|
45
44
|
var formatSearchValue = isFormatVal ? (0, _arrayUtil.getStringToArray)(searchValue || '').join(" ".concat(getLangMsg('Search', 'or'), " ")) : searchValue;
|
|
46
|
-
return
|
|
45
|
+
return _react.default.createElement("div", {
|
|
47
46
|
ref: optionRef,
|
|
48
47
|
className: optionCls,
|
|
49
48
|
onClick: handleClick
|
|
50
|
-
},
|
|
49
|
+
}, _react.default.createElement("span", {
|
|
51
50
|
className: optionTagCls
|
|
52
|
-
}, "".concat(tag, "\uFF1A")),
|
|
51
|
+
}, "".concat(tag, "\uFF1A")), _react.default.createElement("span", {
|
|
53
52
|
className: optionContentCls,
|
|
54
53
|
title: formatSearchValue
|
|
55
54
|
}, formatSearchValue));
|
|
56
55
|
};
|
|
57
|
-
var Option =
|
|
56
|
+
var Option = _react.default.forwardRef(InternalOption);
|
|
58
57
|
Option.displayName = 'Option';
|
|
59
58
|
var _default = Option;
|
|
60
59
|
exports.default = _default;
|