@kdcloudjs/kdesign 1.8.12 → 1.8.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kdesign.css +1 -1
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +5 -3
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +1 -1
- package/dist/kdesign.min.js +2 -2
- package/dist/kdesign.min.js.map +1 -1
- package/es/_utils/KeyCode.js +1 -333
- package/es/_utils/arrayUtil.js +0 -8
- package/es/_utils/formatUtil.js +9 -59
- package/es/_utils/getStringLength.js +0 -1
- package/es/_utils/hooks.js +2 -34
- package/es/_utils/index.js +1 -7
- package/es/_utils/numberUtil.js +0 -54
- package/es/_utils/raf.js +2 -2
- package/es/_utils/reactNode.js +1 -1
- package/es/_utils/resizeObserver.js +2 -4
- package/es/_utils/type.js +0 -1
- package/es/_utils/usePopper.js +3 -3
- package/es/alert/alert.js +8 -16
- package/es/anchor/anchor-link.js +3 -3
- package/es/anchor/anchor.js +23 -26
- package/es/anchor/context.js +1 -1
- package/es/avatar/avatar.js +8 -11
- package/es/badge/badge.js +7 -13
- package/es/base-data/base-data.js +34 -103
- package/es/breadcrumb/breadcrumb.js +12 -12
- package/es/breadcrumb/breadcrumbItem.js +5 -5
- package/es/button/button.js +13 -24
- package/es/button/group.js +13 -13
- package/es/card/card.js +12 -14
- package/es/carousel/carousel.js +13 -13
- package/es/carousel/displayList.js +3 -3
- package/es/carousel/fadeList.js +3 -3
- package/es/carousel/slideList.js +4 -4
- package/es/carousel/slidebar.js +3 -3
- package/es/cascader/cascader.js +31 -36
- package/es/checkbox/checkbox.js +25 -30
- package/es/checkbox/group.js +8 -9
- package/es/city-picker/city-picker.js +28 -38
- package/es/city-picker/interface.js +1 -1
- package/es/city-picker/option.js +4 -4
- package/es/clipboard/clipboard.js +5 -23
- package/es/clipboard/util.js +0 -60
- package/es/collapse/collapse.js +5 -5
- package/es/collapse/panel.js +15 -15
- package/es/color-picker/color-picker-panel.js +12 -13
- package/es/color-picker/color-picker.js +6 -10
- package/es/color-picker/utils/validateColor.js +0 -3
- package/es/config-provider/ConfigContext.js +1 -4
- package/es/config-provider/SizeContext.js +3 -3
- package/es/config-provider/compDefaultProps.js +3 -10
- package/es/config-provider/configProvider.js +1 -6
- package/es/config-provider/defaultConfig.js +0 -1
- package/es/date-picker/calendar.js +6 -23
- package/es/date-picker/context.js +1 -1
- package/es/date-picker/date-panel.js +12 -13
- package/es/date-picker/date-picker.js +7 -12
- package/es/date-picker/hooks/use-hover-value.js +0 -1
- package/es/date-picker/hooks/use-picker-input.js +0 -4
- package/es/date-picker/hooks/use-range-disabled.js +2 -6
- package/es/date-picker/hooks/use-range-view-dates.js +1 -9
- package/es/date-picker/hooks/use-text-value-mapping.js +0 -1
- package/es/date-picker/locale/zh_CN.js +0 -1
- package/es/date-picker/panel/date-time/date-time.js +4 -6
- package/es/date-picker/panel/header/header.js +14 -14
- package/es/date-picker/panel/month/month.js +5 -6
- package/es/date-picker/panel/quarter/quarter.js +4 -4
- package/es/date-picker/panel/time/time-column.js +4 -6
- package/es/date-picker/panel/time/time.js +10 -35
- package/es/date-picker/panel/week/week.js +5 -8
- package/es/date-picker/panel/year/year.js +4 -6
- package/es/date-picker/popper.js +3 -6
- package/es/date-picker/range/input-range.js +12 -13
- package/es/date-picker/range-picker.js +13 -36
- package/es/date-picker/single/input-date.js +8 -14
- package/es/date-picker/utils/date-fns.js +0 -35
- package/es/date-picker/utils/get-extra-footer.js +1 -1
- package/es/date-picker/utils/get-ranges.js +8 -8
- package/es/date-picker/utils/index.js +0 -3
- package/es/divider/divider.js +2 -2
- package/es/drawer/drawer.js +14 -39
- package/es/dropdown/dropdown.js +10 -11
- package/es/dropdown/menu.js +8 -12
- package/es/empty/defaultEmptyImg.js +18 -18
- package/es/empty/empty.js +9 -10
- package/es/empty/illustrationEmptyImg.js +106 -106
- package/es/filter/condition.js +10 -10
- package/es/filter/filter.js +17 -19
- package/es/filter/scheme.js +34 -41
- package/es/form/Field.js +5 -5
- package/es/form/FieldContext.js +1 -1
- package/es/form/FieldLabel.js +2 -2
- package/es/form/FieldWrapper.js +6 -6
- package/es/form/Form.js +2 -5
- package/es/form/FormContext.js +2 -4
- package/es/form/hooks/useForm.js +1 -14
- package/es/form/index.js +1 -1
- package/es/grid/col.js +1 -7
- package/es/grid/row.js +3 -9
- package/es/icon/icon.js +2 -2
- package/es/image/image.js +5 -7
- package/es/image/preview-group.js +3 -4
- package/es/image/preview.js +22 -24
- package/es/image-cropper/cropper.js +3 -6
- package/es/image-cropper/image-cropper.js +5 -5
- package/es/image-cropper/operation-bar.js +9 -9
- package/es/index.js +4 -0
- package/es/input/ClearableLabeledInput.js +13 -13
- package/es/input/TextArea.js +7 -7
- package/es/input/calculateNodeHeight.js +6 -11
- package/es/input/index.js +0 -1
- package/es/input/input.js +5 -5
- package/es/input-number/inputNumber.js +3 -10
- package/es/layout/layout.js +5 -9
- package/es/layout/sider.js +11 -14
- package/es/link/link.js +8 -12
- package/es/locale/locale.js +4 -34
- package/es/menu/menu.js +3 -4
- package/es/menu/menuItem.js +8 -13
- package/es/menu/subMenu.js +19 -27
- package/es/menu/util.js +0 -4
- package/es/message/content.js +13 -13
- package/es/message/index.js +1 -3
- package/es/modal/confirm.js +1 -1
- package/es/modal/modal.js +32 -40
- package/es/notification/content.js +18 -18
- package/es/notification/index.js +1 -1
- package/es/notification-base/index.js +1 -1
- package/es/notification-base/notice.js +2 -2
- package/es/notification-base/notification.js +3 -3
- package/es/pagination/pagination.js +48 -70
- package/es/popconfirm/popconfirm.js +8 -10
- package/es/popper/index.d.ts +2 -0
- package/es/popper/index.js +9 -15
- package/es/progress/circle.js +6 -8
- package/es/progress/line.js +3 -3
- package/es/progress/progress.js +11 -11
- package/es/qr-code/qr-code.js +6 -6
- package/es/radio/context.js +1 -1
- package/es/radio/group.js +9 -13
- package/es/radio/radio-button.js +2 -2
- package/es/radio/radio.js +19 -24
- package/es/rate/rate.js +11 -61
- package/es/search/option.js +4 -5
- package/es/search/quick-search.js +36 -57
- package/es/search/search-panel.js +56 -60
- package/es/search/search.js +9 -10
- package/es/select/interface.js +1 -1
- package/es/select/option.js +4 -4
- package/es/select/select.js +47 -87
- package/es/signature/drawingBoard.js +16 -16
- package/es/signature/signature.js +20 -20
- package/es/signature/utils/signature_pad.js +4 -12
- package/es/slider/marks.js +3 -5
- package/es/slider/slider.js +11 -32
- package/es/slider/sliderTooltip.js +3 -3
- package/es/slider/steps.js +2 -2
- package/es/slider/track.js +1 -1
- package/es/space/space.js +3 -5
- package/es/spin/spin.js +16 -18
- package/es/split-panel/split-panel.js +7 -18
- package/es/split-panel/trigger.js +6 -6
- package/es/stepper/stepper.js +11 -12
- package/es/steps/Step.js +8 -8
- package/es/steps/Steps.js +5 -5
- package/es/switch/switch.js +4 -6
- package/es/table/api.js +5 -22
- package/es/table/table.js +4 -15
- package/es/tabs/active-line.js +2 -6
- package/es/tabs/arrow-button.js +3 -3
- package/es/tabs/context.js +1 -1
- package/es/tabs/index.js +0 -1
- package/es/tabs/tab-pane.js +6 -6
- package/es/tabs/tabs.js +31 -34
- package/es/tag/tag.js +7 -15
- package/es/timeline/Timeline.js +5 -5
- package/es/timeline/TimelineItem.js +5 -5
- package/es/tooltip/tooltip.js +2 -2
- package/es/transfer/list-body.js +4 -4
- package/es/transfer/list-item.js +5 -6
- package/es/transfer/list.js +18 -22
- package/es/transfer/operation.js +7 -7
- package/es/transfer/search.js +5 -5
- package/es/transfer/transfer.js +8 -13
- package/es/tree/tree.js +9 -9
- package/es/tree/treeNode.js +18 -20
- package/es/tree/utils/treeUtils.js +1 -27
- package/es/tree-select/interface.js +1 -1
- package/es/tree-select/tree-select.js +35 -48
- package/es/typography/base.js +5 -5
- package/es/typography/index.js +0 -1
- package/es/typography/paragraph.js +1 -1
- package/es/typography/text.js +1 -1
- package/es/typography/title.js +1 -1
- package/es/typography/typography.js +4 -8
- package/es/upload/dragger.js +2 -2
- package/es/upload/request.js +0 -5
- package/es/upload/scan-files.js +0 -1
- package/es/upload/upload.js +34 -34
- package/es/upload/verify-file.js +0 -1
- package/es/view-container/context.js +1 -1
- package/es/view-container/view-container.js +4 -8
- package/es/virtual-list/Filler.js +2 -2
- package/es/virtual-list/utils/algorithmUtil.js +0 -13
- package/es/virtual-list/utils/itemUtil.js +0 -30
- package/es/virtual-list/virtual-list.js +8 -11
- package/lib/_utils/KeyCode.js +1 -333
- package/lib/_utils/arrayUtil.js +0 -8
- package/lib/_utils/formatUtil.js +9 -59
- package/lib/_utils/getStringLength.js +0 -1
- package/lib/_utils/hooks.js +2 -34
- package/lib/_utils/index.js +0 -7
- package/lib/_utils/numberUtil.js +0 -54
- package/lib/_utils/raf.js +2 -2
- package/lib/_utils/reactNode.js +1 -1
- package/lib/_utils/resizeObserver.js +2 -4
- package/lib/_utils/type.js +0 -1
- package/lib/_utils/usePopper.js +3 -3
- package/lib/alert/alert.js +8 -16
- package/lib/anchor/anchor-link.js +3 -3
- package/lib/anchor/anchor.js +23 -26
- package/lib/anchor/context.js +1 -1
- package/lib/avatar/avatar.js +8 -11
- package/lib/badge/badge.js +7 -13
- package/lib/base-data/base-data.js +34 -103
- package/lib/breadcrumb/breadcrumb.js +12 -12
- package/lib/breadcrumb/breadcrumbItem.js +5 -5
- package/lib/button/button.js +13 -24
- package/lib/button/group.js +13 -13
- package/lib/card/card.js +12 -14
- package/lib/carousel/carousel.js +13 -13
- package/lib/carousel/displayList.js +3 -3
- package/lib/carousel/fadeList.js +3 -3
- package/lib/carousel/slideList.js +4 -4
- package/lib/carousel/slidebar.js +3 -3
- package/lib/cascader/cascader.js +31 -36
- package/lib/checkbox/checkbox.js +25 -30
- package/lib/checkbox/group.js +8 -8
- package/lib/city-picker/city-picker.js +28 -38
- package/lib/city-picker/interface.js +1 -1
- package/lib/city-picker/option.js +4 -4
- package/lib/clipboard/clipboard.js +5 -23
- package/lib/clipboard/util.js +0 -60
- package/lib/collapse/collapse.js +5 -5
- package/lib/collapse/panel.js +15 -15
- package/lib/color-picker/color-picker-panel.js +12 -14
- package/lib/color-picker/color-picker.js +6 -10
- package/lib/color-picker/utils/validateColor.js +0 -3
- package/lib/config-provider/ConfigContext.js +1 -5
- package/lib/config-provider/SizeContext.js +3 -3
- package/lib/config-provider/compDefaultProps.js +3 -10
- package/lib/config-provider/configProvider.js +1 -7
- package/lib/config-provider/defaultConfig.js +0 -1
- package/lib/date-picker/calendar.js +6 -23
- package/lib/date-picker/context.js +1 -1
- package/lib/date-picker/date-panel.js +12 -13
- package/lib/date-picker/date-picker.js +7 -12
- package/lib/date-picker/hooks/use-hover-value.js +0 -1
- package/lib/date-picker/hooks/use-picker-input.js +0 -4
- package/lib/date-picker/hooks/use-range-disabled.js +2 -6
- package/lib/date-picker/hooks/use-range-view-dates.js +1 -9
- package/lib/date-picker/hooks/use-text-value-mapping.js +0 -1
- package/lib/date-picker/locale/zh_CN.js +0 -1
- package/lib/date-picker/panel/date-time/date-time.js +4 -6
- package/lib/date-picker/panel/header/header.js +14 -14
- package/lib/date-picker/panel/month/month.js +5 -6
- package/lib/date-picker/panel/quarter/quarter.js +4 -4
- package/lib/date-picker/panel/time/time-column.js +4 -6
- package/lib/date-picker/panel/time/time.js +10 -35
- package/lib/date-picker/panel/week/week.js +5 -8
- package/lib/date-picker/panel/year/year.js +4 -6
- package/lib/date-picker/popper.js +3 -6
- package/lib/date-picker/range/input-range.js +12 -13
- package/lib/date-picker/range-picker.js +13 -36
- package/lib/date-picker/single/input-date.js +8 -14
- package/lib/date-picker/utils/date-fns.js +0 -34
- package/lib/date-picker/utils/get-extra-footer.js +1 -1
- package/lib/date-picker/utils/get-ranges.js +8 -8
- package/lib/date-picker/utils/index.js +0 -3
- package/lib/divider/divider.js +2 -2
- package/lib/drawer/drawer.js +14 -40
- package/lib/dropdown/dropdown.js +10 -11
- package/lib/dropdown/menu.js +8 -12
- package/lib/empty/defaultEmptyImg.js +18 -18
- package/lib/empty/empty.js +9 -10
- package/lib/empty/illustrationEmptyImg.js +106 -106
- package/lib/filter/condition.js +10 -10
- package/lib/filter/filter.js +17 -19
- package/lib/filter/scheme.js +34 -41
- package/lib/form/Field.js +5 -5
- package/lib/form/FieldContext.js +1 -1
- package/lib/form/FieldLabel.js +2 -2
- package/lib/form/FieldWrapper.js +6 -6
- package/lib/form/Form.js +2 -5
- package/lib/form/FormContext.js +2 -4
- package/lib/form/hooks/useForm.js +1 -14
- package/lib/form/index.js +1 -1
- package/lib/grid/col.js +1 -7
- package/lib/grid/row.js +3 -9
- package/lib/icon/icon.js +2 -2
- package/lib/image/image.js +5 -7
- package/lib/image/preview-group.js +3 -4
- package/lib/image/preview.js +22 -24
- package/lib/image-cropper/cropper.js +3 -6
- package/lib/image-cropper/image-cropper.js +5 -5
- package/lib/image-cropper/operation-bar.js +9 -9
- package/lib/index.js +2 -8
- package/lib/input/ClearableLabeledInput.js +13 -13
- package/lib/input/TextArea.js +7 -7
- package/lib/input/calculateNodeHeight.js +6 -11
- package/lib/input/index.js +0 -1
- package/lib/input/input.js +5 -5
- package/lib/input-number/inputNumber.js +3 -10
- package/lib/layout/layout.js +5 -9
- package/lib/layout/sider.js +11 -14
- package/lib/link/link.js +8 -12
- package/lib/locale/locale.js +4 -34
- package/lib/menu/menu.js +3 -4
- package/lib/menu/menuItem.js +8 -13
- package/lib/menu/subMenu.js +19 -27
- package/lib/menu/util.js +0 -4
- package/lib/message/content.js +13 -13
- package/lib/message/index.js +1 -3
- package/lib/modal/confirm.js +1 -1
- package/lib/modal/modal.js +32 -40
- package/lib/notification/content.js +18 -18
- package/lib/notification/index.js +1 -1
- package/lib/notification-base/index.js +1 -1
- package/lib/notification-base/notice.js +2 -2
- package/lib/notification-base/notification.js +3 -3
- package/lib/pagination/pagination.js +48 -70
- package/lib/popconfirm/popconfirm.js +8 -10
- package/lib/popper/index.d.ts +2 -0
- package/lib/popper/index.js +9 -15
- package/lib/progress/circle.js +6 -8
- package/lib/progress/line.js +3 -3
- package/lib/progress/progress.js +11 -11
- package/lib/qr-code/qr-code.js +6 -6
- package/lib/radio/context.js +1 -1
- package/lib/radio/group.js +9 -13
- package/lib/radio/radio-button.js +2 -2
- package/lib/radio/radio.js +19 -24
- package/lib/rate/rate.js +11 -61
- package/lib/search/option.js +4 -5
- package/lib/search/quick-search.js +36 -57
- package/lib/search/search-panel.js +56 -60
- package/lib/search/search.js +9 -10
- package/lib/select/interface.js +1 -1
- package/lib/select/option.js +4 -4
- package/lib/select/select.js +47 -87
- package/lib/signature/drawingBoard.js +16 -16
- package/lib/signature/signature.js +20 -20
- package/lib/signature/utils/signature_pad.js +4 -12
- package/lib/slider/marks.js +3 -5
- package/lib/slider/slider.js +11 -32
- package/lib/slider/sliderTooltip.js +3 -3
- package/lib/slider/steps.js +2 -2
- package/lib/slider/track.js +1 -1
- package/lib/space/space.js +3 -5
- package/lib/spin/spin.js +16 -18
- package/lib/split-panel/split-panel.js +7 -18
- package/lib/split-panel/trigger.js +6 -6
- package/lib/stepper/stepper.js +11 -12
- package/lib/steps/Step.js +8 -8
- package/lib/steps/Steps.js +5 -5
- package/lib/switch/switch.js +4 -6
- package/lib/table/api.js +5 -22
- package/lib/table/table.js +4 -15
- package/lib/tabs/active-line.js +2 -6
- package/lib/tabs/arrow-button.js +3 -3
- package/lib/tabs/context.js +1 -1
- package/lib/tabs/index.js +0 -1
- package/lib/tabs/tab-pane.js +6 -6
- package/lib/tabs/tabs.js +31 -34
- package/lib/tag/tag.js +7 -15
- package/lib/timeline/Timeline.js +5 -5
- package/lib/timeline/TimelineItem.js +5 -5
- package/lib/tooltip/tooltip.js +2 -2
- package/lib/transfer/list-body.js +4 -4
- package/lib/transfer/list-item.js +5 -6
- package/lib/transfer/list.js +18 -22
- package/lib/transfer/operation.js +7 -7
- package/lib/transfer/search.js +5 -5
- package/lib/transfer/transfer.js +8 -13
- package/lib/tree/tree.js +9 -9
- package/lib/tree/treeNode.js +18 -20
- package/lib/tree/utils/treeUtils.js +1 -27
- package/lib/tree-select/interface.js +1 -1
- package/lib/tree-select/tree-select.js +35 -48
- package/lib/typography/base.js +5 -5
- package/lib/typography/index.js +0 -1
- package/lib/typography/paragraph.js +1 -1
- package/lib/typography/text.js +1 -1
- package/lib/typography/title.js +1 -1
- package/lib/typography/typography.js +4 -8
- package/lib/upload/dragger.js +2 -2
- package/lib/upload/request.js +0 -5
- package/lib/upload/scan-files.js +0 -1
- package/lib/upload/upload.js +34 -34
- package/lib/upload/verify-file.js +0 -1
- package/lib/view-container/context.js +1 -1
- package/lib/view-container/view-container.js +4 -8
- package/lib/virtual-list/Filler.js +2 -2
- package/lib/virtual-list/utils/algorithmUtil.js +0 -13
- package/lib/virtual-list/utils/itemUtil.js +0 -30
- package/lib/virtual-list/virtual-list.js +8 -12
- package/package.json +1 -3
|
@@ -14,7 +14,7 @@ import ConfigContext from '../config-provider/ConfigContext';
|
|
|
14
14
|
import { getCompProps } from '../_utils';
|
|
15
15
|
import { Icon, Tag, Tree } from '../index';
|
|
16
16
|
import usePopper from '../_utils/usePopper';
|
|
17
|
-
var INPUT_MIN_WIDTH = 4;
|
|
17
|
+
var INPUT_MIN_WIDTH = 4;
|
|
18
18
|
function flattenTreeData(treeData) {
|
|
19
19
|
var map = new _Map();
|
|
20
20
|
function flatten(node) {
|
|
@@ -101,7 +101,7 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
101
101
|
onlyExpandOnClickIcon = treeSelectProps.onlyExpandOnClickIcon,
|
|
102
102
|
listHeight = treeSelectProps.listHeight,
|
|
103
103
|
status = treeSelectProps.status;
|
|
104
|
-
var isMultiple = mode === 'multiple';
|
|
104
|
+
var isMultiple = mode === 'multiple';
|
|
105
105
|
var _useMergedState = useMergedState(isMultiple ? [] : undefined, {
|
|
106
106
|
value: value,
|
|
107
107
|
defaultValue: defaultValue
|
|
@@ -119,22 +119,22 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
119
119
|
setSelectedKeys = _useState4[1];
|
|
120
120
|
var innerRef = useRef();
|
|
121
121
|
var selectRef = ref || innerRef;
|
|
122
|
-
var searchRef = useRef(null);
|
|
122
|
+
var searchRef = useRef(null);
|
|
123
123
|
var selectionRef = useRef(null);
|
|
124
124
|
var dropDownRef = useRef(null);
|
|
125
125
|
var measureRef = useRef(null);
|
|
126
126
|
var _useState5 = useState(!!props.visible || defaultOpen),
|
|
127
127
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
128
128
|
optionShow = _useState6[0],
|
|
129
|
-
setOptionShow = _useState6[1];
|
|
129
|
+
setOptionShow = _useState6[1];
|
|
130
130
|
var _useState7 = useState(''),
|
|
131
131
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
132
132
|
searchValue = _useState8[0],
|
|
133
|
-
setSearchValue = _useState8[1];
|
|
133
|
+
setSearchValue = _useState8[1];
|
|
134
134
|
var _useState9 = useState(INPUT_MIN_WIDTH),
|
|
135
135
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
136
136
|
inputWidth = _useState10[0],
|
|
137
|
-
setInputWidth = _useState10[1];
|
|
137
|
+
setInputWidth = _useState10[1];
|
|
138
138
|
var _useState11 = useState(autoFocus),
|
|
139
139
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
140
140
|
focusd = _useState12[0],
|
|
@@ -150,12 +150,9 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
150
150
|
return !!(selectTreeNodes === null || selectTreeNodes === void 0 ? void 0 : selectTreeNodes.length);
|
|
151
151
|
}, [selectTreeNodes]);
|
|
152
152
|
var selectPrefixCls = getPrefixCls(prefixCls, 'tree-select', customPrefixcls);
|
|
153
|
-
// 选择器样式
|
|
154
153
|
var selectCls = classNames(selectPrefixCls, className, _defineProperty({}, "".concat(selectPrefixCls, "-visible"), optionShow));
|
|
155
154
|
var selectionCls = classNames(_defineProperty({}, "".concat(selectPrefixCls, "-selector"), true));
|
|
156
|
-
// 下拉列表框样式
|
|
157
155
|
var dropDownCls = classNames(dropdownClassName, _defineProperty({}, "".concat(selectPrefixCls, "-dropdown"), true));
|
|
158
|
-
// 多选,单选公共样式
|
|
159
156
|
var commCls = classNames((_classNames4 = {}, _defineProperty(_classNames4, "".concat(selectPrefixCls, "-bordered"), borderType === 'bordered'), _defineProperty(_classNames4, "".concat(selectPrefixCls, "-underline"), borderType === 'underline'), _defineProperty(_classNames4, "".concat(selectPrefixCls, "-borderless"), borderType === 'none'), _defineProperty(_classNames4, _concatInstanceProperty(_context3 = "".concat(selectPrefixCls, "-size-")).call(_context3, size), size), _defineProperty(_classNames4, "".concat(selectPrefixCls, "-wrapper"), true), _defineProperty(_classNames4, "".concat(selectPrefixCls, "-error"), status === 'error'), _classNames4));
|
|
160
157
|
useEffect(function () {
|
|
161
158
|
var arr = [];
|
|
@@ -214,21 +211,18 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
214
211
|
var getTreeNodeLabel = function getTreeNodeLabel(node) {
|
|
215
212
|
return (node === null || node === void 0 ? void 0 : node[treeNodeLabelProp]) || (node === null || node === void 0 ? void 0 : node.title);
|
|
216
213
|
};
|
|
217
|
-
// 输入框变化搜索内容
|
|
218
214
|
var handleSearchChange = useCallback(function (event) {
|
|
219
215
|
var val = event.currentTarget.value;
|
|
220
216
|
handleVisibleChange(true);
|
|
221
217
|
setSearchValue(val);
|
|
222
218
|
onSearch === null || onSearch === void 0 ? void 0 : onSearch(val);
|
|
223
219
|
}, [onSearch]);
|
|
224
|
-
// 清除搜索内容
|
|
225
220
|
var handleClear = useCallback(function () {
|
|
226
221
|
if (searchRef.current) {
|
|
227
222
|
searchRef.current.value = '';
|
|
228
223
|
setSearchValue('');
|
|
229
224
|
}
|
|
230
225
|
}, [searchRef]);
|
|
231
|
-
// 清空选择器内容
|
|
232
226
|
var handleReset = function handleReset(e) {
|
|
233
227
|
e.stopPropagation();
|
|
234
228
|
if (isMultiple) {
|
|
@@ -240,7 +234,6 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
240
234
|
setSearchValue('');
|
|
241
235
|
isMultiple ? onChange === null || onChange === void 0 ? void 0 : onChange('', '') : onChange === null || onChange === void 0 ? void 0 : onChange(undefined, undefined);
|
|
242
236
|
};
|
|
243
|
-
// 多选模式下清除某一项
|
|
244
237
|
var handleRemove = function handleRemove(e, key) {
|
|
245
238
|
var _context4;
|
|
246
239
|
var _a, _b;
|
|
@@ -279,25 +272,23 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
279
272
|
!Object.hasOwnProperty.call(treeSelectProps, 'treeExpandedKeys') && setExpandedKeys(keys);
|
|
280
273
|
onTreeExpand === null || onTreeExpand === void 0 ? void 0 : onTreeExpand(keys, state);
|
|
281
274
|
};
|
|
282
|
-
// 渲染后缀图标
|
|
283
275
|
var renderSuffix = function renderSuffix() {
|
|
284
276
|
var _classNames5;
|
|
285
277
|
var suffixIcon = treeSelectProps.suffixIcon;
|
|
286
|
-
// 选择器下拉icon样式
|
|
287
278
|
var arrowIconCls = classNames((_classNames5 = {}, _defineProperty(_classNames5, "".concat(selectPrefixCls, "-icon-arrow"), true), _defineProperty(_classNames5, "".concat(selectPrefixCls, "-icon-arrow-up"), optionShow), _defineProperty(_classNames5, "".concat(selectPrefixCls, "-icon-arrow-down"), !optionShow), _defineProperty(_classNames5, "".concat(selectPrefixCls, "-icon-arrow-focus"), optionShow), _classNames5));
|
|
288
279
|
var iconShow = allowClear && !disabled && (isMultiple ? !!selectTreeNodes.length : (initValue !== null && initValue !== void 0 ? initValue : '') !== '' || searchValue);
|
|
289
280
|
var clearIconCls = classNames(_defineProperty({}, "".concat(selectPrefixCls, "-icon-clear"), true));
|
|
290
|
-
return
|
|
281
|
+
return React.createElement(React.Fragment, null, iconShow && React.createElement("span", {
|
|
291
282
|
onClick: handleReset,
|
|
292
283
|
onMouseDown: function onMouseDown(e) {
|
|
293
284
|
return e.preventDefault();
|
|
294
285
|
},
|
|
295
286
|
className: clearIconCls
|
|
296
|
-
}, clearIcon ||
|
|
287
|
+
}, clearIcon || React.createElement(Icon, {
|
|
297
288
|
type: "close-solid"
|
|
298
|
-
})), showArrow &&
|
|
289
|
+
})), showArrow && React.createElement("span", {
|
|
299
290
|
className: arrowIconCls
|
|
300
|
-
}, suffixIcon ||
|
|
291
|
+
}, suffixIcon || React.createElement(Icon, {
|
|
301
292
|
type: "arrow-down"
|
|
302
293
|
})));
|
|
303
294
|
};
|
|
@@ -339,15 +330,13 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
339
330
|
treeProps.checkedKeys = initValue;
|
|
340
331
|
treeProps.onCheck = handleCheck;
|
|
341
332
|
}
|
|
342
|
-
return
|
|
333
|
+
return React.createElement(Tree, _extends({}, treeProps));
|
|
343
334
|
};
|
|
344
|
-
// 下拉列表为空时显示的内容
|
|
345
335
|
var renderNotContent = function renderNotContent() {
|
|
346
|
-
// 下拉列表为空
|
|
347
336
|
var emptyListCls = classNames(_defineProperty({}, "".concat(selectPrefixCls, "-dropdown-empty"), true));
|
|
348
337
|
var notFoundContent = treeSelectProps.notFoundContent;
|
|
349
338
|
var emptyContent = notFoundContent || locale.getLangMsg('global', 'emptyText');
|
|
350
|
-
return
|
|
339
|
+
return React.createElement("div", {
|
|
351
340
|
className: emptyListCls
|
|
352
341
|
}, emptyContent);
|
|
353
342
|
};
|
|
@@ -363,29 +352,27 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
363
352
|
useEffect(function () {
|
|
364
353
|
setOptionShow(props.visible);
|
|
365
354
|
}, [props.visible]);
|
|
366
|
-
// 渲染下拉列表框
|
|
367
355
|
var renderContent = function renderContent() {
|
|
368
356
|
var dropDownStyle = _extends({
|
|
369
357
|
width: style === null || style === void 0 ? void 0 : style.width,
|
|
370
358
|
maxHeight: virtual ? 'unset' : ''
|
|
371
359
|
}, dropdownStyle);
|
|
372
|
-
return
|
|
360
|
+
return React.createElement(React.Fragment, null, React.createElement("div", {
|
|
373
361
|
className: dropDownCls,
|
|
374
362
|
style: dropDownStyle,
|
|
375
363
|
ref: dropDownRef
|
|
376
364
|
}, dropdownRender ? dropdownRender === null || dropdownRender === void 0 ? void 0 : dropdownRender(dropRender()) : dropRender()));
|
|
377
365
|
};
|
|
378
|
-
// 处理多选tag
|
|
379
366
|
var handleMaxTagHolder = useCallback(function () {
|
|
380
367
|
var maxTagPlaceholder = treeSelectProps.maxTagPlaceholder;
|
|
381
368
|
if (typeof maxTagPlaceholder === 'function') {
|
|
382
|
-
return
|
|
369
|
+
return React.createElement(Tag, {
|
|
383
370
|
type: "edit",
|
|
384
371
|
size: size,
|
|
385
372
|
disabled: disabled
|
|
386
373
|
}, maxTagPlaceholder(selectTreeNodes));
|
|
387
374
|
} else {
|
|
388
|
-
return
|
|
375
|
+
return React.createElement(Tag, {
|
|
389
376
|
type: "edit",
|
|
390
377
|
size: size,
|
|
391
378
|
disabled: disabled
|
|
@@ -397,13 +384,13 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
397
384
|
if (isSelected) {
|
|
398
385
|
label = getTreeNodeLabel(selectTreeNodes[0]);
|
|
399
386
|
}
|
|
400
|
-
return
|
|
387
|
+
return React.createElement(React.Fragment, null, React.createElement("div", {
|
|
401
388
|
className: singleCls,
|
|
402
389
|
ref: selectionRef,
|
|
403
390
|
title: typeof label === 'string' ? label : ''
|
|
404
|
-
},
|
|
391
|
+
}, React.createElement("span", {
|
|
405
392
|
className: "".concat(selectPrefixCls, "-selection-search")
|
|
406
|
-
},
|
|
393
|
+
}, React.createElement("input", {
|
|
407
394
|
ref: searchRef,
|
|
408
395
|
value: searchValue,
|
|
409
396
|
className: "".concat(selectPrefixCls, "-selection-search-input"),
|
|
@@ -411,11 +398,11 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
411
398
|
onFocus: handleFocus,
|
|
412
399
|
onBlur: handleBlur,
|
|
413
400
|
readOnly: !showSearch || !!disabled
|
|
414
|
-
})), isSelected && !searchValue &&
|
|
401
|
+
})), isSelected && !searchValue && React.createElement("span", {
|
|
415
402
|
className: "".concat(selectPrefixCls, "-selection-item")
|
|
416
|
-
}, label), !isSelected && !searchValue &&
|
|
403
|
+
}, label), !isSelected && !searchValue && React.createElement("span", {
|
|
417
404
|
className: "".concat(selectPrefixCls, "-placeholder")
|
|
418
|
-
}, placeholder),
|
|
405
|
+
}, placeholder), React.createElement("span", {
|
|
419
406
|
className: "".concat(selectPrefixCls, "-suffix")
|
|
420
407
|
}, renderSuffix())));
|
|
421
408
|
};
|
|
@@ -432,13 +419,13 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
432
419
|
var totalText = locale.getLangMsg('TreeSelect', 'total', {
|
|
433
420
|
total: selectTreeNodes.length
|
|
434
421
|
});
|
|
435
|
-
return
|
|
422
|
+
return React.createElement("div", {
|
|
436
423
|
className: multipleCls,
|
|
437
424
|
ref: selectionRef
|
|
438
|
-
}, Array.isArray(selectTreeNodes) &&
|
|
425
|
+
}, Array.isArray(selectTreeNodes) && React.createElement(React.Fragment, null, _mapInstanceProperty(selectTreeNodes).call(selectTreeNodes, function (item, index) {
|
|
439
426
|
var key = item.key;
|
|
440
427
|
var label = getTreeNodeLabel(item);
|
|
441
|
-
return (!maxTagCount || index <= maxTagCount - 1) &&
|
|
428
|
+
return (!maxTagCount || index <= maxTagCount - 1) && React.createElement("span", {
|
|
442
429
|
key: key,
|
|
443
430
|
className: classNames("".concat(selectPrefixCls, "-selection-tag")),
|
|
444
431
|
onMouseDown: function onMouseDown(e) {
|
|
@@ -448,7 +435,7 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
448
435
|
onClose: handleRemove,
|
|
449
436
|
disabled: disabled,
|
|
450
437
|
size: size
|
|
451
|
-
}, item)) :
|
|
438
|
+
}, item)) : React.createElement(Tag, {
|
|
452
439
|
type: "edit",
|
|
453
440
|
style: TagStyle,
|
|
454
441
|
size: size,
|
|
@@ -460,16 +447,16 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
460
447
|
"data-tag": key,
|
|
461
448
|
title: typeof label === 'string' ? label : ''
|
|
462
449
|
}, label));
|
|
463
|
-
}), maxTagCount && selectTreeNodes.length > maxTagCount ? maxTagPlaceholder ? handleMaxTagHolder() :
|
|
450
|
+
}), maxTagCount && selectTreeNodes.length > maxTagCount ? maxTagPlaceholder ? handleMaxTagHolder() : React.createElement("span", {
|
|
464
451
|
className: itemCls
|
|
465
|
-
},
|
|
452
|
+
}, React.createElement("span", {
|
|
466
453
|
className: "".concat(selectPrefixCls, "-selection-item-content")
|
|
467
|
-
}, totalText)) : null),
|
|
454
|
+
}, totalText)) : null), React.createElement("span", {
|
|
468
455
|
className: "".concat(selectPrefixCls, "-selection-search"),
|
|
469
456
|
style: {
|
|
470
457
|
width: inputWidth
|
|
471
458
|
}
|
|
472
|
-
},
|
|
459
|
+
}, React.createElement("input", {
|
|
473
460
|
ref: searchRef,
|
|
474
461
|
value: searchValue,
|
|
475
462
|
className: "".concat(selectPrefixCls, "-selection-search-input"),
|
|
@@ -477,22 +464,22 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
477
464
|
onFocus: handleFocus,
|
|
478
465
|
onBlur: handleBlur,
|
|
479
466
|
readOnly: !showSearch || !!disabled
|
|
480
|
-
}),
|
|
467
|
+
}), React.createElement("span", {
|
|
481
468
|
ref: measureRef,
|
|
482
469
|
className: "".concat(selectPrefixCls, "-selection-search-mirror")
|
|
483
|
-
}, searchValue, "\xA0")),
|
|
470
|
+
}, searchValue, "\xA0")), React.createElement("span", {
|
|
484
471
|
className: "".concat(selectPrefixCls, "-placeholder")
|
|
485
|
-
}, !(selectTreeNodes === null || selectTreeNodes === void 0 ? void 0 : selectTreeNodes.length) && !searchValue && placeholder),
|
|
472
|
+
}, !(selectTreeNodes === null || selectTreeNodes === void 0 ? void 0 : selectTreeNodes.length) && !searchValue && placeholder), React.createElement("span", {
|
|
486
473
|
className: "".concat(selectPrefixCls, "-suffix")
|
|
487
474
|
}, renderSuffix()));
|
|
488
475
|
};
|
|
489
476
|
var singleCls = classNames(commCls, (_classNames10 = {}, _defineProperty(_classNames10, "".concat(selectPrefixCls, "-single"), true), _defineProperty(_classNames10, "".concat(selectPrefixCls, "-single-disabled"), disabled), _defineProperty(_classNames10, "".concat(selectPrefixCls, "-single-focused"), focusd && !disabled || optionShow), _classNames10));
|
|
490
477
|
var renderSelect = function renderSelect() {
|
|
491
|
-
return
|
|
478
|
+
return React.createElement("div", {
|
|
492
479
|
className: selectCls,
|
|
493
480
|
ref: selectRef,
|
|
494
481
|
style: style
|
|
495
|
-
},
|
|
482
|
+
}, React.createElement("span", {
|
|
496
483
|
className: selectionCls,
|
|
497
484
|
tabIndex: disabled ? -1 : 0,
|
|
498
485
|
onFocus: function onFocus() {
|
|
@@ -534,6 +521,6 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
534
521
|
});
|
|
535
522
|
return usePopper(renderSelect(), renderContent(), popperProps);
|
|
536
523
|
};
|
|
537
|
-
var TreeSelect =
|
|
524
|
+
var TreeSelect = React.forwardRef(InternalTreeSelect);
|
|
538
525
|
TreeSelect.displayName = 'TreeSelect';
|
|
539
526
|
export default TreeSelect;
|
package/es/typography/base.js
CHANGED
|
@@ -30,7 +30,7 @@ function wrapperDecorations(_ref, content) {
|
|
|
30
30
|
var currentContent = content;
|
|
31
31
|
function wrap(needed, tag) {
|
|
32
32
|
if (!needed) return;
|
|
33
|
-
currentContent =
|
|
33
|
+
currentContent = React.createElement(tag, {}, currentContent);
|
|
34
34
|
}
|
|
35
35
|
wrap(strong, 'strong');
|
|
36
36
|
wrap(underline, 'u');
|
|
@@ -46,10 +46,10 @@ var InternalBase = function InternalBase(props, ref) {
|
|
|
46
46
|
getPrefixCls = _useContext.getPrefixCls,
|
|
47
47
|
prefixCls = _useContext.prefixCls,
|
|
48
48
|
userDefaultProps = _useContext.compDefaultProps;
|
|
49
|
-
var contentRef = ref ||
|
|
49
|
+
var contentRef = ref || React.createRef();
|
|
50
50
|
var typographyProps = getCompProps('Typography', userDefaultProps, props);
|
|
51
51
|
var customPrefixcls = typographyProps.prefixCls;
|
|
52
|
-
var typographyPrefixCls = getPrefixCls(prefixCls, 'typography', customPrefixcls);
|
|
52
|
+
var typographyPrefixCls = getPrefixCls(prefixCls, 'typography', customPrefixcls);
|
|
53
53
|
var renderContent = function renderContent() {
|
|
54
54
|
var _context, _classNames;
|
|
55
55
|
var component = props.component,
|
|
@@ -66,7 +66,7 @@ var InternalBase = function InternalBase(props, ref) {
|
|
|
66
66
|
var typographyClasses = classNames(className, (_classNames = {}, _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(typographyPrefixCls, "-")).call(_context, type), type), _defineProperty(_classNames, "".concat(typographyPrefixCls, "-disabled"), disabled), _classNames));
|
|
67
67
|
var textNode = children;
|
|
68
68
|
textNode = wrapperDecorations(props, textNode);
|
|
69
|
-
return
|
|
69
|
+
return React.createElement(Typography, _extends({
|
|
70
70
|
component: component,
|
|
71
71
|
style: style,
|
|
72
72
|
className: typographyClasses,
|
|
@@ -75,5 +75,5 @@ var InternalBase = function InternalBase(props, ref) {
|
|
|
75
75
|
};
|
|
76
76
|
return renderContent();
|
|
77
77
|
};
|
|
78
|
-
var Base =
|
|
78
|
+
var Base = React.forwardRef(InternalBase);
|
|
79
79
|
export default Base;
|
package/es/typography/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import Base from './base';
|
|
4
4
|
var Paragraph = function Paragraph(props) {
|
|
5
|
-
return
|
|
5
|
+
return React.createElement(Base, _extends({}, props, {
|
|
6
6
|
component: "div"
|
|
7
7
|
}));
|
|
8
8
|
};
|
package/es/typography/text.js
CHANGED
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import Base from './base';
|
|
4
4
|
var Text = function Text(props) {
|
|
5
|
-
return
|
|
5
|
+
return React.createElement(Base, _extends({}, props, {
|
|
6
6
|
component: "span"
|
|
7
7
|
}));
|
|
8
8
|
};
|
package/es/typography/title.js
CHANGED
|
@@ -24,7 +24,7 @@ var Title = function Title(props) {
|
|
|
24
24
|
devWarning(true, 'typography', "cannot found level '".concat(level, "'"));
|
|
25
25
|
component = 'h1';
|
|
26
26
|
}
|
|
27
|
-
return
|
|
27
|
+
return React.createElement(Base, _extends({}, restProps, {
|
|
28
28
|
component: component
|
|
29
29
|
}));
|
|
30
30
|
};
|
|
@@ -12,7 +12,6 @@ import React, { useContext } from 'react';
|
|
|
12
12
|
import classNames from 'classnames';
|
|
13
13
|
import ConfigContext from '../config-provider/ConfigContext';
|
|
14
14
|
import { getCompProps } from '../_utils';
|
|
15
|
-
// remove this line and code Typography component here
|
|
16
15
|
var InternalTypography = function InternalTypography(props, ref) {
|
|
17
16
|
var _useContext = useContext(ConfigContext),
|
|
18
17
|
getPrefixCls = _useContext.getPrefixCls,
|
|
@@ -26,18 +25,15 @@ var InternalTypography = function InternalTypography(props, ref) {
|
|
|
26
25
|
ariaLabel = typographyProps['aria-label'],
|
|
27
26
|
children = typographyProps.children,
|
|
28
27
|
restProps = __rest(typographyProps, ["prefixCls", "component", "className", 'aria-label', "children"]);
|
|
29
|
-
var typographyPrefixCls = getPrefixCls(prefixCls, 'typography', customPrefixcls);
|
|
30
|
-
var typographyClasses = classNames(typographyPrefixCls, className, {
|
|
31
|
-
// [`${typographyPrefixCls}-size-${size}`]: size,
|
|
32
|
-
// [`${typographyPrefixCls}-borderless`]: borderType === 'none',
|
|
33
|
-
});
|
|
28
|
+
var typographyPrefixCls = getPrefixCls(prefixCls, 'typography', customPrefixcls);
|
|
29
|
+
var typographyClasses = classNames(typographyPrefixCls, className, {});
|
|
34
30
|
var Component = component;
|
|
35
|
-
return
|
|
31
|
+
return React.createElement(Component, _extends({
|
|
36
32
|
className: typographyClasses,
|
|
37
33
|
"aria-label": ariaLabel,
|
|
38
34
|
ref: ref
|
|
39
35
|
}, restProps), children);
|
|
40
36
|
};
|
|
41
|
-
var Typography =
|
|
37
|
+
var Typography = React.forwardRef(InternalTypography);
|
|
42
38
|
Typography.displayName = 'Typography';
|
|
43
39
|
export default Typography;
|
package/es/upload/dragger.js
CHANGED
|
@@ -14,7 +14,7 @@ var InternalDragger = function InternalDragger(_a, ref) {
|
|
|
14
14
|
var style = _a.style,
|
|
15
15
|
height = _a.height,
|
|
16
16
|
restProps = __rest(_a, ["style", "height"]);
|
|
17
|
-
return
|
|
17
|
+
return React.createElement(Upload, _extends({
|
|
18
18
|
ref: ref
|
|
19
19
|
}, restProps, {
|
|
20
20
|
type: "drag",
|
|
@@ -23,6 +23,6 @@ var InternalDragger = function InternalDragger(_a, ref) {
|
|
|
23
23
|
})
|
|
24
24
|
}));
|
|
25
25
|
};
|
|
26
|
-
var Dragger =
|
|
26
|
+
var Dragger = React.forwardRef(InternalDragger);
|
|
27
27
|
Dragger.displayName = 'Dragger';
|
|
28
28
|
export default Dragger;
|
package/es/upload/request.js
CHANGED
|
@@ -34,11 +34,8 @@ export default function upload(option) {
|
|
|
34
34
|
if (option.data) {
|
|
35
35
|
_Object$keys(option.data).forEach(function (key) {
|
|
36
36
|
var value = option.data[key];
|
|
37
|
-
// support key-value array data
|
|
38
37
|
if (Array.isArray(value)) {
|
|
39
38
|
value.forEach(function (item) {
|
|
40
|
-
// { list: [ 11, 22 ] }
|
|
41
|
-
// formData.append('list[]', 11)
|
|
42
39
|
formData.append("".concat(key, "[]"), item);
|
|
43
40
|
});
|
|
44
41
|
return;
|
|
@@ -61,12 +58,10 @@ export default function upload(option) {
|
|
|
61
58
|
return option.onSuccess(getBody(xhr), xhr);
|
|
62
59
|
};
|
|
63
60
|
xhr.open(option.method, option.action, true);
|
|
64
|
-
// Has to be after `.open()`. See https://github.com/enyo/dropzone/issues/179
|
|
65
61
|
if (option.withCredentials && 'withCredentials' in xhr) {
|
|
66
62
|
xhr.withCredentials = true;
|
|
67
63
|
}
|
|
68
64
|
var headers = option.headers || {};
|
|
69
|
-
// when set headers['X-Requested-With'] = null , can close default XHR header
|
|
70
65
|
if (headers['X-Requested-With'] !== null) {
|
|
71
66
|
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
|
|
72
67
|
}
|
package/es/upload/scan-files.js
CHANGED
|
@@ -7,7 +7,6 @@ function loopFiles(item, callback) {
|
|
|
7
7
|
dirReader.readEntries(function (entries) {
|
|
8
8
|
var entryList = _sliceInstanceProperty(Array.prototype).apply(entries);
|
|
9
9
|
fileList = _concatInstanceProperty(fileList).call(fileList, entryList);
|
|
10
|
-
// Check if all the file has been viewed
|
|
11
10
|
var isFinished = !entryList.length;
|
|
12
11
|
if (isFinished) {
|
|
13
12
|
callback(fileList);
|
package/es/upload/upload.js
CHANGED
|
@@ -79,7 +79,7 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
79
79
|
pkgPrefixCls = _useContext.prefixCls,
|
|
80
80
|
userDefaultProps = _useContext.compDefaultProps;
|
|
81
81
|
var inputRef = useRef(null);
|
|
82
|
-
var allProps = getCompProps('Upload', userDefaultProps, props);
|
|
82
|
+
var allProps = getCompProps('Upload', userDefaultProps, props);
|
|
83
83
|
var type = allProps.type,
|
|
84
84
|
style = allProps.style,
|
|
85
85
|
accept = allProps.accept,
|
|
@@ -227,7 +227,7 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
227
227
|
onFileListChange(file, fileList);
|
|
228
228
|
},
|
|
229
229
|
onSuccess: function onSuccess(response, xhr) {
|
|
230
|
-
return __awaiter(void 0, void 0, void 0,
|
|
230
|
+
return __awaiter(void 0, void 0, void 0, _regeneratorRuntime.mark(function _callee() {
|
|
231
231
|
var url;
|
|
232
232
|
return _regeneratorRuntime.wrap(function _callee$(_context3) {
|
|
233
233
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -385,39 +385,39 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
385
385
|
input: inputRef.current
|
|
386
386
|
};
|
|
387
387
|
});
|
|
388
|
-
return
|
|
388
|
+
return React.createElement("div", {
|
|
389
389
|
className: classNames(prefixCls, {
|
|
390
390
|
disabled: disabled
|
|
391
391
|
}, className),
|
|
392
392
|
style: style
|
|
393
|
-
}, listType === 'text' && hasChildren &&
|
|
393
|
+
}, listType === 'text' && hasChildren && React.createElement("label", _extends({
|
|
394
394
|
className: classNames((_classNames = {}, _defineProperty(_classNames, _concatInstanceProperty(_context5 = "".concat(prefixCls, "-")).call(_context5, type), true), _defineProperty(_classNames, "hover", hover), _classNames))
|
|
395
|
-
}, dragEvents),
|
|
395
|
+
}, dragEvents), React.createElement("span", {
|
|
396
396
|
className: "".concat(prefixCls, "-handle")
|
|
397
|
-
}, children),
|
|
397
|
+
}, children), React.createElement("span", {
|
|
398
398
|
className: "".concat(prefixCls, "-input")
|
|
399
|
-
},
|
|
399
|
+
}, React.createElement("input", _extends({
|
|
400
400
|
title: "",
|
|
401
401
|
type: "file"
|
|
402
402
|
}, inputFileProps, {
|
|
403
403
|
ref: inputRef
|
|
404
|
-
})))), (listType === 'picture' || !(listType === 'text' && (!showUploadList || !fileList.length))) &&
|
|
404
|
+
})))), (listType === 'picture' || !(listType === 'text' && (!showUploadList || !fileList.length))) && React.createElement("ul", {
|
|
405
405
|
className: _concatInstanceProperty(_context6 = "".concat(prefixCls, "-")).call(_context6, listType, "-list")
|
|
406
|
-
}, listType === 'picture' && hasChildren &&
|
|
406
|
+
}, listType === 'picture' && hasChildren && React.createElement("li", {
|
|
407
407
|
className: classNames(_concatInstanceProperty(_context7 = "".concat(prefixCls, "-")).call(_context7, listType, "-list-item"))
|
|
408
|
-
},
|
|
408
|
+
}, React.createElement("label", {
|
|
409
409
|
className: "".concat(prefixCls, "-select")
|
|
410
|
-
},
|
|
410
|
+
}, React.createElement("span", {
|
|
411
411
|
className: "".concat(prefixCls, "-handle")
|
|
412
|
-
}, children),
|
|
412
|
+
}, children), React.createElement("span", {
|
|
413
413
|
className: "".concat(prefixCls, "-input")
|
|
414
|
-
},
|
|
414
|
+
}, React.createElement("input", _extends({
|
|
415
415
|
title: "",
|
|
416
416
|
type: "file"
|
|
417
417
|
}, inputFileProps, {
|
|
418
418
|
ref: inputRef
|
|
419
419
|
}))))), showUploadList && _mapInstanceProperty(fileList).call(fileList, function (file) {
|
|
420
|
-
return itemRender ? itemRender(
|
|
420
|
+
return itemRender ? itemRender(React.createElement(Item, _extends({}, {
|
|
421
421
|
file: file,
|
|
422
422
|
prefixCls: prefixCls,
|
|
423
423
|
listType: listType,
|
|
@@ -425,7 +425,7 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
425
425
|
handleRemove: handleRemove,
|
|
426
426
|
disabled: disabled,
|
|
427
427
|
onPreview: onPreview
|
|
428
|
-
})), file, fileList) :
|
|
428
|
+
})), file, fileList) : React.createElement(Item, _extends({
|
|
429
429
|
key: file.uid
|
|
430
430
|
}, {
|
|
431
431
|
file: file,
|
|
@@ -462,58 +462,58 @@ var Item = function Item(_ref3) {
|
|
|
462
462
|
var handlePreview = function handlePreview() {
|
|
463
463
|
onPreview && onPreview(file);
|
|
464
464
|
};
|
|
465
|
-
return
|
|
465
|
+
return React.createElement("li", {
|
|
466
466
|
className: classNames(_concatInstanceProperty(_context8 = "".concat(prefixCls, "-")).call(_context8, listType, "-list-item"), {
|
|
467
467
|
error: file.status === 'error'
|
|
468
468
|
})
|
|
469
|
-
}, listType === 'text' ?
|
|
469
|
+
}, listType === 'text' ? React.createElement(React.Fragment, null, React.createElement("span", {
|
|
470
470
|
className: _concatInstanceProperty(_context9 = "".concat(prefixCls, "-")).call(_context9, listType, "-list-item-icon"),
|
|
471
471
|
onClick: handlePreview
|
|
472
|
-
},
|
|
472
|
+
}, React.createElement(Icon, {
|
|
473
473
|
spin: file.status === 'uploading',
|
|
474
474
|
type: mapStatus[file.status]
|
|
475
|
-
})),
|
|
475
|
+
})), React.createElement("span", {
|
|
476
476
|
className: _concatInstanceProperty(_context10 = "".concat(prefixCls, "-")).call(_context10, listType, "-list-item-name"),
|
|
477
477
|
title: file.name,
|
|
478
478
|
onClick: handlePreview
|
|
479
|
-
}, file.name),
|
|
479
|
+
}, file.name), React.createElement("span", {
|
|
480
480
|
className: _concatInstanceProperty(_context11 = "".concat(prefixCls, "-")).call(_context11, listType, "-list-item-size")
|
|
481
|
-
}, "(", getFileSize(file.size), ")"),
|
|
481
|
+
}, "(", getFileSize(file.size), ")"), React.createElement("div", {
|
|
482
482
|
className: _concatInstanceProperty(_context12 = "".concat(prefixCls, "-")).call(_context12, listType, "-list-item-action")
|
|
483
|
-
}, file.status === 'error' &&
|
|
483
|
+
}, file.status === 'error' && React.createElement("a", {
|
|
484
484
|
href: "true",
|
|
485
485
|
className: _concatInstanceProperty(_context13 = "".concat(prefixCls, "-")).call(_context13, listType, "-list-item-reupload"),
|
|
486
486
|
onClick: handleReUpload.bind(_this, file)
|
|
487
|
-
}, uploadLangMsg.reUpload), !disabled &&
|
|
487
|
+
}, uploadLangMsg.reUpload), !disabled && React.createElement("a", {
|
|
488
488
|
href: "true",
|
|
489
489
|
className: _concatInstanceProperty(_context14 = "".concat(prefixCls, "-")).call(_context14, listType, "-list-item-delete"),
|
|
490
490
|
onClick: handleRemove.bind(_this, file)
|
|
491
|
-
}, uploadLangMsg.delete))) : file.status === 'uploading' ?
|
|
491
|
+
}, uploadLangMsg.delete))) : file.status === 'uploading' ? React.createElement("div", {
|
|
492
492
|
className: _concatInstanceProperty(_context15 = "".concat(prefixCls, "-")).call(_context15, listType, "-list-item-loading")
|
|
493
|
-
},
|
|
493
|
+
}, React.createElement(Progress, {
|
|
494
494
|
percent: file.percent,
|
|
495
495
|
textMap: [uploadLangMsg.uploading],
|
|
496
496
|
showInfo: false
|
|
497
|
-
})) : file.status === 'error' ?
|
|
497
|
+
})) : file.status === 'error' ? React.createElement("div", {
|
|
498
498
|
className: _concatInstanceProperty(_context16 = "".concat(prefixCls, "-")).call(_context16, listType, "-list-item-error")
|
|
499
|
-
},
|
|
499
|
+
}, React.createElement("div", {
|
|
500
500
|
className: _concatInstanceProperty(_context17 = "".concat(prefixCls, "-")).call(_context17, listType, "-list-item-error-text")
|
|
501
|
-
},
|
|
501
|
+
}, React.createElement(Icon, {
|
|
502
502
|
type: mapStatus[file.status],
|
|
503
503
|
style: {
|
|
504
504
|
verticalAlign: 'top'
|
|
505
505
|
}
|
|
506
|
-
}), uploadLangMsg.fail), !disabled &&
|
|
506
|
+
}), uploadLangMsg.fail), !disabled && React.createElement("div", {
|
|
507
507
|
className: _concatInstanceProperty(_context18 = "".concat(prefixCls, "-")).call(_context18, listType, "-list-item-action")
|
|
508
|
-
},
|
|
508
|
+
}, React.createElement("a", {
|
|
509
509
|
href: "true",
|
|
510
510
|
className: _concatInstanceProperty(_context19 = "".concat(prefixCls, "-")).call(_context19, listType, "-list-item-reupload"),
|
|
511
511
|
onClick: handleReUpload.bind(_this, file)
|
|
512
|
-
}, uploadLangMsg.reUpload),
|
|
512
|
+
}, uploadLangMsg.reUpload), React.createElement("a", {
|
|
513
513
|
href: "true",
|
|
514
514
|
className: _concatInstanceProperty(_context20 = "".concat(prefixCls, "-")).call(_context20, listType, "-list-item-delete"),
|
|
515
515
|
onClick: handleRemove.bind(_this, file)
|
|
516
|
-
}, uploadLangMsg.delete))) :
|
|
516
|
+
}, uploadLangMsg.delete))) : React.createElement(Image, {
|
|
517
517
|
onClick: handlePreview,
|
|
518
518
|
previewType: "upload",
|
|
519
519
|
name: file.name,
|
|
@@ -523,13 +523,13 @@ var Item = function Item(_ref3) {
|
|
|
523
523
|
width: '100%',
|
|
524
524
|
height: '100%'
|
|
525
525
|
},
|
|
526
|
-
operations: disabled ? [] : [
|
|
526
|
+
operations: disabled ? [] : [React.createElement(Icon, {
|
|
527
527
|
key: "1",
|
|
528
528
|
type: "delete",
|
|
529
529
|
onClick: handleRemove.bind(_this, file)
|
|
530
530
|
})]
|
|
531
531
|
}));
|
|
532
532
|
};
|
|
533
|
-
var Upload =
|
|
533
|
+
var Upload = forwardRef(InternalUpload);
|
|
534
534
|
Upload.displayName = 'Upload';
|
|
535
535
|
export default Upload;
|
package/es/upload/verify-file.js
CHANGED
|
@@ -14,7 +14,6 @@ export default (function (file, acceptedFiles) {
|
|
|
14
14
|
return endsWith(fileName.toLowerCase(), validType.toLowerCase());
|
|
15
15
|
}
|
|
16
16
|
if (/\/\*$/.test(validType)) {
|
|
17
|
-
// This is something like a image/* mime type
|
|
18
17
|
return baseMimeType === validType.replace(/\/.*$/, '');
|
|
19
18
|
}
|
|
20
19
|
return mimeType === validType;
|