@kdcloudjs/kdesign 1.8.11 → 1.8.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kdesign.css +1 -1
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +93 -15
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +1 -1
- package/dist/kdesign.min.js +3 -3
- package/dist/kdesign.min.js.map +1 -1
- package/es/_utils/KeyCode.js +1 -333
- package/es/_utils/arrayUtil.js +0 -8
- package/es/_utils/formatUtil.js +9 -59
- package/es/_utils/getStringLength.js +0 -1
- package/es/_utils/hooks.js +2 -34
- package/es/_utils/index.js +1 -7
- package/es/_utils/numberUtil.js +0 -54
- package/es/_utils/raf.js +2 -2
- package/es/_utils/reactNode.js +1 -1
- package/es/_utils/resizeObserver.js +2 -4
- package/es/_utils/type.js +0 -1
- package/es/_utils/usePopper.js +3 -3
- package/es/alert/alert.js +8 -16
- package/es/anchor/anchor-link.js +3 -3
- package/es/anchor/anchor.js +23 -26
- package/es/anchor/context.js +1 -1
- package/es/avatar/avatar.js +8 -11
- package/es/badge/badge.js +7 -13
- package/es/base-data/base-data.js +42 -104
- package/es/breadcrumb/breadcrumb.js +12 -12
- package/es/breadcrumb/breadcrumbItem.js +5 -5
- package/es/button/button.js +13 -24
- package/es/button/group.js +13 -13
- package/es/card/card.js +12 -14
- package/es/carousel/carousel.js +13 -13
- package/es/carousel/displayList.js +3 -3
- package/es/carousel/fadeList.js +3 -3
- package/es/carousel/slideList.js +4 -4
- package/es/carousel/slidebar.js +3 -3
- package/es/cascader/cascader.js +31 -36
- package/es/checkbox/checkbox.js +25 -30
- package/es/checkbox/group.js +8 -9
- package/es/city-picker/city-picker.js +28 -38
- package/es/city-picker/interface.js +1 -1
- package/es/city-picker/option.js +4 -4
- package/es/clipboard/clipboard.js +5 -23
- package/es/clipboard/util.js +0 -60
- package/es/collapse/collapse.js +5 -5
- package/es/collapse/panel.js +15 -15
- package/es/color-picker/color-picker-panel.js +12 -13
- package/es/color-picker/color-picker.js +6 -10
- package/es/color-picker/utils/validateColor.js +0 -3
- package/es/config-provider/ConfigContext.js +1 -4
- package/es/config-provider/SizeContext.js +3 -3
- package/es/config-provider/compDefaultProps.js +3 -10
- package/es/config-provider/configProvider.js +1 -6
- package/es/config-provider/defaultConfig.js +0 -1
- package/es/date-picker/calendar.js +6 -23
- package/es/date-picker/context.js +1 -1
- package/es/date-picker/date-panel.js +12 -13
- package/es/date-picker/date-picker.js +7 -12
- package/es/date-picker/hooks/use-hover-value.js +0 -1
- package/es/date-picker/hooks/use-picker-input.js +0 -4
- package/es/date-picker/hooks/use-range-disabled.js +2 -6
- package/es/date-picker/hooks/use-range-view-dates.js +1 -9
- package/es/date-picker/hooks/use-text-value-mapping.js +0 -1
- package/es/date-picker/locale/zh_CN.js +0 -1
- package/es/date-picker/panel/date-time/date-time.js +4 -6
- package/es/date-picker/panel/header/header.js +14 -14
- package/es/date-picker/panel/month/month.js +5 -6
- package/es/date-picker/panel/quarter/quarter.js +4 -4
- package/es/date-picker/panel/time/time-column.js +4 -6
- package/es/date-picker/panel/time/time.js +10 -35
- package/es/date-picker/panel/week/week.js +5 -8
- package/es/date-picker/panel/year/year.js +4 -6
- package/es/date-picker/popper.js +3 -6
- package/es/date-picker/range/input-range.js +12 -13
- package/es/date-picker/range-picker.js +13 -36
- package/es/date-picker/single/input-date.js +8 -14
- package/es/date-picker/utils/date-fns.js +0 -35
- package/es/date-picker/utils/get-extra-footer.js +1 -1
- package/es/date-picker/utils/get-ranges.js +8 -8
- package/es/date-picker/utils/index.js +0 -3
- package/es/divider/divider.js +2 -2
- package/es/drawer/drawer.js +14 -39
- package/es/dropdown/dropdown.js +10 -11
- package/es/dropdown/menu.js +8 -12
- package/es/empty/defaultEmptyImg.js +18 -18
- package/es/empty/empty.js +9 -10
- package/es/empty/illustrationEmptyImg.js +106 -106
- package/es/filter/condition.js +10 -10
- package/es/filter/filter.js +17 -19
- package/es/filter/scheme.js +34 -41
- package/es/form/Field.js +5 -5
- package/es/form/FieldContext.js +1 -1
- package/es/form/FieldLabel.js +2 -2
- package/es/form/FieldWrapper.js +6 -6
- package/es/form/Form.js +2 -5
- package/es/form/FormContext.js +2 -4
- package/es/form/hooks/useForm.js +1 -14
- package/es/form/index.js +1 -1
- package/es/grid/col.js +1 -7
- package/es/grid/row.js +3 -9
- package/es/icon/icon.js +2 -2
- package/es/image/image.js +5 -7
- package/es/image/preview-group.js +3 -4
- package/es/image/preview.js +22 -24
- package/es/image-cropper/cropper.js +3 -6
- package/es/image-cropper/image-cropper.js +5 -5
- package/es/image-cropper/operation-bar.js +9 -9
- package/es/index.js +4 -0
- package/es/input/ClearableLabeledInput.js +13 -13
- package/es/input/TextArea.js +7 -7
- package/es/input/calculateNodeHeight.js +6 -11
- package/es/input/index.js +0 -1
- package/es/input/input.js +5 -5
- package/es/input-number/inputNumber.js +3 -10
- package/es/layout/layout.js +5 -9
- package/es/layout/sider.js +11 -14
- package/es/link/link.js +8 -12
- package/es/locale/locale.js +4 -34
- package/es/menu/menu.js +3 -4
- package/es/menu/menuItem.js +8 -13
- package/es/menu/subMenu.js +19 -27
- package/es/menu/util.js +0 -4
- package/es/message/content.js +13 -13
- package/es/message/index.js +1 -3
- package/es/modal/confirm.js +1 -1
- package/es/modal/modal.js +32 -40
- package/es/notification/content.js +18 -18
- package/es/notification/index.js +1 -1
- package/es/notification-base/index.js +1 -1
- package/es/notification-base/notice.js +2 -2
- package/es/notification-base/notification.js +3 -3
- package/es/pagination/pagination.js +48 -70
- package/es/popconfirm/popconfirm.js +8 -10
- package/es/popper/index.d.ts +4 -1
- package/es/popper/index.js +84 -22
- package/es/progress/circle.js +6 -8
- package/es/progress/line.js +3 -3
- package/es/progress/progress.js +11 -11
- package/es/qr-code/qr-code.js +6 -6
- package/es/radio/context.js +1 -1
- package/es/radio/group.js +9 -13
- package/es/radio/radio-button.js +2 -2
- package/es/radio/radio.js +19 -24
- package/es/rate/rate.js +11 -61
- package/es/search/option.js +4 -5
- package/es/search/quick-search.js +36 -57
- package/es/search/search-panel.js +56 -60
- package/es/search/search.js +9 -10
- package/es/select/interface.js +1 -1
- package/es/select/option.js +4 -4
- package/es/select/select.js +47 -87
- package/es/signature/drawingBoard.js +16 -16
- package/es/signature/signature.js +20 -20
- package/es/signature/utils/signature_pad.js +4 -12
- package/es/slider/marks.js +3 -5
- package/es/slider/slider.js +11 -32
- package/es/slider/sliderTooltip.js +3 -3
- package/es/slider/steps.js +2 -2
- package/es/slider/track.js +1 -1
- package/es/space/space.js +3 -5
- package/es/spin/spin.js +16 -18
- package/es/split-panel/split-panel.js +7 -18
- package/es/split-panel/trigger.js +6 -6
- package/es/stepper/stepper.js +11 -12
- package/es/steps/Step.js +8 -8
- package/es/steps/Steps.js +5 -5
- package/es/switch/switch.js +4 -6
- package/es/table/api.js +5 -22
- package/es/table/table.js +4 -15
- package/es/tabs/active-line.js +2 -6
- package/es/tabs/arrow-button.js +3 -3
- package/es/tabs/context.js +1 -1
- package/es/tabs/index.js +0 -1
- package/es/tabs/tab-pane.js +6 -6
- package/es/tabs/tabs.js +31 -34
- package/es/tag/tag.js +7 -15
- package/es/timeline/Timeline.js +5 -5
- package/es/timeline/TimelineItem.js +5 -5
- package/es/tooltip/tooltip.js +2 -2
- package/es/transfer/list-body.js +4 -4
- package/es/transfer/list-item.js +5 -6
- package/es/transfer/list.js +18 -22
- package/es/transfer/operation.js +7 -7
- package/es/transfer/search.js +5 -5
- package/es/transfer/transfer.js +8 -13
- package/es/tree/tree.js +9 -9
- package/es/tree/treeNode.js +18 -20
- package/es/tree/utils/treeUtils.js +1 -27
- package/es/tree-select/interface.js +1 -1
- package/es/tree-select/tree-select.js +35 -48
- package/es/typography/base.js +5 -5
- package/es/typography/index.js +0 -1
- package/es/typography/paragraph.js +1 -1
- package/es/typography/text.js +1 -1
- package/es/typography/title.js +1 -1
- package/es/typography/typography.js +4 -8
- package/es/upload/dragger.js +2 -2
- package/es/upload/request.js +0 -5
- package/es/upload/scan-files.js +0 -1
- package/es/upload/upload.js +34 -34
- package/es/upload/verify-file.js +0 -1
- package/es/view-container/context.js +1 -1
- package/es/view-container/view-container.js +4 -8
- package/es/virtual-list/Filler.js +2 -2
- package/es/virtual-list/utils/algorithmUtil.js +0 -13
- package/es/virtual-list/utils/itemUtil.js +0 -30
- package/es/virtual-list/virtual-list.js +8 -11
- package/lib/_utils/KeyCode.js +1 -333
- package/lib/_utils/arrayUtil.js +0 -8
- package/lib/_utils/formatUtil.js +9 -59
- package/lib/_utils/getStringLength.js +0 -1
- package/lib/_utils/hooks.js +2 -34
- package/lib/_utils/index.js +0 -7
- package/lib/_utils/numberUtil.js +0 -54
- package/lib/_utils/raf.js +2 -2
- package/lib/_utils/reactNode.js +1 -1
- package/lib/_utils/resizeObserver.js +2 -4
- package/lib/_utils/type.js +0 -1
- package/lib/_utils/usePopper.js +3 -3
- package/lib/alert/alert.js +8 -16
- package/lib/anchor/anchor-link.js +3 -3
- package/lib/anchor/anchor.js +23 -26
- package/lib/anchor/context.js +1 -1
- package/lib/avatar/avatar.js +8 -11
- package/lib/badge/badge.js +7 -13
- package/lib/base-data/base-data.js +42 -104
- package/lib/breadcrumb/breadcrumb.js +12 -12
- package/lib/breadcrumb/breadcrumbItem.js +5 -5
- package/lib/button/button.js +13 -24
- package/lib/button/group.js +13 -13
- package/lib/card/card.js +12 -14
- package/lib/carousel/carousel.js +13 -13
- package/lib/carousel/displayList.js +3 -3
- package/lib/carousel/fadeList.js +3 -3
- package/lib/carousel/slideList.js +4 -4
- package/lib/carousel/slidebar.js +3 -3
- package/lib/cascader/cascader.js +31 -36
- package/lib/checkbox/checkbox.js +25 -30
- package/lib/checkbox/group.js +8 -8
- package/lib/city-picker/city-picker.js +28 -38
- package/lib/city-picker/interface.js +1 -1
- package/lib/city-picker/option.js +4 -4
- package/lib/clipboard/clipboard.js +5 -23
- package/lib/clipboard/util.js +0 -60
- package/lib/collapse/collapse.js +5 -5
- package/lib/collapse/panel.js +15 -15
- package/lib/color-picker/color-picker-panel.js +12 -14
- package/lib/color-picker/color-picker.js +6 -10
- package/lib/color-picker/utils/validateColor.js +0 -3
- package/lib/config-provider/ConfigContext.js +1 -5
- package/lib/config-provider/SizeContext.js +3 -3
- package/lib/config-provider/compDefaultProps.js +3 -10
- package/lib/config-provider/configProvider.js +1 -7
- package/lib/config-provider/defaultConfig.js +0 -1
- package/lib/date-picker/calendar.js +6 -23
- package/lib/date-picker/context.js +1 -1
- package/lib/date-picker/date-panel.js +12 -13
- package/lib/date-picker/date-picker.js +7 -12
- package/lib/date-picker/hooks/use-hover-value.js +0 -1
- package/lib/date-picker/hooks/use-picker-input.js +0 -4
- package/lib/date-picker/hooks/use-range-disabled.js +2 -6
- package/lib/date-picker/hooks/use-range-view-dates.js +1 -9
- package/lib/date-picker/hooks/use-text-value-mapping.js +0 -1
- package/lib/date-picker/locale/zh_CN.js +0 -1
- package/lib/date-picker/panel/date-time/date-time.js +4 -6
- package/lib/date-picker/panel/header/header.js +14 -14
- package/lib/date-picker/panel/month/month.js +5 -6
- package/lib/date-picker/panel/quarter/quarter.js +4 -4
- package/lib/date-picker/panel/time/time-column.js +4 -6
- package/lib/date-picker/panel/time/time.js +10 -35
- package/lib/date-picker/panel/week/week.js +5 -8
- package/lib/date-picker/panel/year/year.js +4 -6
- package/lib/date-picker/popper.js +3 -6
- package/lib/date-picker/range/input-range.js +12 -13
- package/lib/date-picker/range-picker.js +13 -36
- package/lib/date-picker/single/input-date.js +8 -14
- package/lib/date-picker/utils/date-fns.js +0 -34
- package/lib/date-picker/utils/get-extra-footer.js +1 -1
- package/lib/date-picker/utils/get-ranges.js +8 -8
- package/lib/date-picker/utils/index.js +0 -3
- package/lib/divider/divider.js +2 -2
- package/lib/drawer/drawer.js +14 -40
- package/lib/dropdown/dropdown.js +10 -11
- package/lib/dropdown/menu.js +8 -12
- package/lib/empty/defaultEmptyImg.js +18 -18
- package/lib/empty/empty.js +9 -10
- package/lib/empty/illustrationEmptyImg.js +106 -106
- package/lib/filter/condition.js +10 -10
- package/lib/filter/filter.js +17 -19
- package/lib/filter/scheme.js +34 -41
- package/lib/form/Field.js +5 -5
- package/lib/form/FieldContext.js +1 -1
- package/lib/form/FieldLabel.js +2 -2
- package/lib/form/FieldWrapper.js +6 -6
- package/lib/form/Form.js +2 -5
- package/lib/form/FormContext.js +2 -4
- package/lib/form/hooks/useForm.js +1 -14
- package/lib/form/index.js +1 -1
- package/lib/grid/col.js +1 -7
- package/lib/grid/row.js +3 -9
- package/lib/icon/icon.js +2 -2
- package/lib/image/image.js +5 -7
- package/lib/image/preview-group.js +3 -4
- package/lib/image/preview.js +22 -24
- package/lib/image-cropper/cropper.js +3 -6
- package/lib/image-cropper/image-cropper.js +5 -5
- package/lib/image-cropper/operation-bar.js +9 -9
- package/lib/index.js +2 -8
- package/lib/input/ClearableLabeledInput.js +13 -13
- package/lib/input/TextArea.js +7 -7
- package/lib/input/calculateNodeHeight.js +6 -11
- package/lib/input/index.js +0 -1
- package/lib/input/input.js +5 -5
- package/lib/input-number/inputNumber.js +3 -10
- package/lib/layout/layout.js +5 -9
- package/lib/layout/sider.js +11 -14
- package/lib/link/link.js +8 -12
- package/lib/locale/locale.js +4 -34
- package/lib/menu/menu.js +3 -4
- package/lib/menu/menuItem.js +8 -13
- package/lib/menu/subMenu.js +19 -27
- package/lib/menu/util.js +0 -4
- package/lib/message/content.js +13 -13
- package/lib/message/index.js +1 -3
- package/lib/modal/confirm.js +1 -1
- package/lib/modal/modal.js +32 -40
- package/lib/notification/content.js +18 -18
- package/lib/notification/index.js +1 -1
- package/lib/notification-base/index.js +1 -1
- package/lib/notification-base/notice.js +2 -2
- package/lib/notification-base/notification.js +3 -3
- package/lib/pagination/pagination.js +48 -70
- package/lib/popconfirm/popconfirm.js +8 -10
- package/lib/popper/index.d.ts +4 -1
- package/lib/popper/index.js +84 -22
- package/lib/progress/circle.js +6 -8
- package/lib/progress/line.js +3 -3
- package/lib/progress/progress.js +11 -11
- package/lib/qr-code/qr-code.js +6 -6
- package/lib/radio/context.js +1 -1
- package/lib/radio/group.js +9 -13
- package/lib/radio/radio-button.js +2 -2
- package/lib/radio/radio.js +19 -24
- package/lib/rate/rate.js +11 -61
- package/lib/search/option.js +4 -5
- package/lib/search/quick-search.js +36 -57
- package/lib/search/search-panel.js +56 -60
- package/lib/search/search.js +9 -10
- package/lib/select/interface.js +1 -1
- package/lib/select/option.js +4 -4
- package/lib/select/select.js +47 -87
- package/lib/signature/drawingBoard.js +16 -16
- package/lib/signature/signature.js +20 -20
- package/lib/signature/utils/signature_pad.js +4 -12
- package/lib/slider/marks.js +3 -5
- package/lib/slider/slider.js +11 -32
- package/lib/slider/sliderTooltip.js +3 -3
- package/lib/slider/steps.js +2 -2
- package/lib/slider/track.js +1 -1
- package/lib/space/space.js +3 -5
- package/lib/spin/spin.js +16 -18
- package/lib/split-panel/split-panel.js +7 -18
- package/lib/split-panel/trigger.js +6 -6
- package/lib/stepper/stepper.js +11 -12
- package/lib/steps/Step.js +8 -8
- package/lib/steps/Steps.js +5 -5
- package/lib/switch/switch.js +4 -6
- package/lib/table/api.js +5 -22
- package/lib/table/table.js +4 -15
- package/lib/tabs/active-line.js +2 -6
- package/lib/tabs/arrow-button.js +3 -3
- package/lib/tabs/context.js +1 -1
- package/lib/tabs/index.js +0 -1
- package/lib/tabs/tab-pane.js +6 -6
- package/lib/tabs/tabs.js +31 -34
- package/lib/tag/tag.js +7 -15
- package/lib/timeline/Timeline.js +5 -5
- package/lib/timeline/TimelineItem.js +5 -5
- package/lib/tooltip/tooltip.js +2 -2
- package/lib/transfer/list-body.js +4 -4
- package/lib/transfer/list-item.js +5 -6
- package/lib/transfer/list.js +18 -22
- package/lib/transfer/operation.js +7 -7
- package/lib/transfer/search.js +5 -5
- package/lib/transfer/transfer.js +8 -13
- package/lib/tree/tree.js +9 -9
- package/lib/tree/treeNode.js +18 -20
- package/lib/tree/utils/treeUtils.js +1 -27
- package/lib/tree-select/interface.js +1 -1
- package/lib/tree-select/tree-select.js +35 -48
- package/lib/typography/base.js +5 -5
- package/lib/typography/index.js +0 -1
- package/lib/typography/paragraph.js +1 -1
- package/lib/typography/text.js +1 -1
- package/lib/typography/title.js +1 -1
- package/lib/typography/typography.js +4 -8
- package/lib/upload/dragger.js +2 -2
- package/lib/upload/request.js +0 -5
- package/lib/upload/scan-files.js +0 -1
- package/lib/upload/upload.js +34 -34
- package/lib/upload/verify-file.js +0 -1
- package/lib/view-container/context.js +1 -1
- package/lib/view-container/view-container.js +4 -8
- package/lib/virtual-list/Filler.js +2 -2
- package/lib/virtual-list/utils/algorithmUtil.js +0 -13
- package/lib/virtual-list/utils/itemUtil.js +0 -30
- package/lib/virtual-list/virtual-list.js +8 -12
- package/package.json +1 -3
package/es/filter/filter.js
CHANGED
|
@@ -24,7 +24,6 @@ var Filter = function Filter(props) {
|
|
|
24
24
|
var FilterLangMsg = locale.getCompLangMsg({
|
|
25
25
|
componentName: 'Filter'
|
|
26
26
|
});
|
|
27
|
-
// 属性需要合并一遍用户定义的默认属性
|
|
28
27
|
var _getCompProps = getCompProps('Filter', userDefaultProps, props),
|
|
29
28
|
style = _getCompProps.style,
|
|
30
29
|
fields = _getCompProps.fields,
|
|
@@ -37,7 +36,6 @@ var Filter = function Filter(props) {
|
|
|
37
36
|
onSpreadChange = _getCompProps.onSpreadChange,
|
|
38
37
|
getSchemeSettingMenu = _getCompProps.getSchemeSettingMenu,
|
|
39
38
|
customPrefixcls = _getCompProps.prefixCls;
|
|
40
|
-
// className前缀
|
|
41
39
|
var prefixCls = getPrefixCls(pkgPrefixCls, 'filter', customPrefixcls);
|
|
42
40
|
var _React$useRef = React.useRef(typeof props.value === 'undefined' ? props.defaultValue || {} : props.value || {}),
|
|
43
41
|
defaultValue = _React$useRef.current;
|
|
@@ -87,18 +85,18 @@ var Filter = function Filter(props) {
|
|
|
87
85
|
key: 'scheme',
|
|
88
86
|
name: FilterLangMsg.schemeQuery
|
|
89
87
|
}];
|
|
90
|
-
return
|
|
88
|
+
return React.createElement("div", {
|
|
91
89
|
className: classNames(prefixCls, className),
|
|
92
90
|
style: style
|
|
93
|
-
},
|
|
91
|
+
}, React.createElement("header", {
|
|
94
92
|
className: "".concat(prefixCls, "-header")
|
|
95
|
-
},
|
|
93
|
+
}, React.createElement("h3", {
|
|
96
94
|
className: "".concat(prefixCls, "-header-title")
|
|
97
|
-
}, props.title),
|
|
95
|
+
}, props.title), React.createElement("div", {
|
|
98
96
|
className: "".concat(prefixCls, "-header-condition")
|
|
99
|
-
},
|
|
97
|
+
}, React.createElement("span", {
|
|
100
98
|
className: "".concat(prefixCls, "-header-condition-label")
|
|
101
|
-
}, FilterLangMsg.filterCondition),
|
|
99
|
+
}, FilterLangMsg.filterCondition), React.createElement(Space, {
|
|
102
100
|
wrap: true,
|
|
103
101
|
size: [4, 4]
|
|
104
102
|
}, _mapInstanceProperty(_context = _Object$keys(value)).call(_context, function (conditionKey) {
|
|
@@ -130,37 +128,37 @@ var Filter = function Filter(props) {
|
|
|
130
128
|
type: 'edit',
|
|
131
129
|
onClose: onConditionRemove.bind(null, conditionKey)
|
|
132
130
|
};
|
|
133
|
-
return name &&
|
|
131
|
+
return name && React.createElement(Tag, _extends({
|
|
134
132
|
className: "".concat(prefixCls, "-header-condition-item"),
|
|
135
133
|
key: conditionKey
|
|
136
|
-
}, conditionProps),
|
|
134
|
+
}, conditionProps), React.createElement("span", {
|
|
137
135
|
className: "".concat(prefixCls, "-header-condition-item-text"),
|
|
138
136
|
title: options
|
|
139
137
|
}, name, "\uFF1A", options));
|
|
140
|
-
}))),
|
|
138
|
+
}))), React.createElement(Search, _extends({
|
|
141
139
|
className: "".concat(prefixCls, "-header-search"),
|
|
142
140
|
type: "quick-search"
|
|
143
|
-
}, props.search)),
|
|
141
|
+
}, props.search)), React.createElement("div", {
|
|
144
142
|
className: classNames("".concat(prefixCls, "-header-handle"), {
|
|
145
143
|
spread: spread
|
|
146
144
|
}),
|
|
147
145
|
onClick: handleSwitchSpread
|
|
148
|
-
}, FilterLangMsg[spread ? 'packup' : 'spread'], _filterInstanceProperty(FilterLangMsg), " ",
|
|
146
|
+
}, FilterLangMsg[spread ? 'packup' : 'spread'], _filterInstanceProperty(FilterLangMsg), " ", React.createElement(Icon, {
|
|
149
147
|
type: "arrow-down"
|
|
150
|
-
}))),
|
|
148
|
+
}))), React.createElement("div", {
|
|
151
149
|
className: classNames("".concat(prefixCls, "-body"), {
|
|
152
150
|
spread: spread
|
|
153
151
|
})
|
|
154
|
-
},
|
|
152
|
+
}, React.createElement(Space, {
|
|
155
153
|
size: 12,
|
|
156
154
|
className: "".concat(prefixCls, "-body-tabs"),
|
|
157
|
-
split:
|
|
155
|
+
split: React.createElement("span", {
|
|
158
156
|
className: "".concat(prefixCls, "-body-tabs-split")
|
|
159
157
|
})
|
|
160
158
|
}, _mapInstanceProperty(tabs).call(tabs, function (_ref3) {
|
|
161
159
|
var key = _ref3.key,
|
|
162
160
|
name = _ref3.name;
|
|
163
|
-
return
|
|
161
|
+
return React.createElement("span", {
|
|
164
162
|
key: key,
|
|
165
163
|
onClick: function onClick() {
|
|
166
164
|
return setTab(key);
|
|
@@ -169,7 +167,7 @@ var Filter = function Filter(props) {
|
|
|
169
167
|
active: key === tab
|
|
170
168
|
})
|
|
171
169
|
}, name);
|
|
172
|
-
})),
|
|
170
|
+
})), React.createElement(ConditionFilter, _extends({}, {
|
|
173
171
|
tab: tab,
|
|
174
172
|
prefixCls: prefixCls,
|
|
175
173
|
conditions: conditions,
|
|
@@ -177,7 +175,7 @@ var Filter = function Filter(props) {
|
|
|
177
175
|
onConditionChange: onConditionChange,
|
|
178
176
|
onConditionRemove: onConditionRemove,
|
|
179
177
|
value: value
|
|
180
|
-
})),
|
|
178
|
+
})), React.createElement(SchemeFilter, _extends({}, {
|
|
181
179
|
tab: tab,
|
|
182
180
|
fields: fields,
|
|
183
181
|
schemes: schemes,
|
package/es/filter/scheme.js
CHANGED
|
@@ -66,7 +66,6 @@ var SchemeFilter = function SchemeFilter(props) {
|
|
|
66
66
|
return item;
|
|
67
67
|
});
|
|
68
68
|
setScheme(nextScheme);
|
|
69
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
70
69
|
}, [value]);
|
|
71
70
|
React.useEffect(function () {
|
|
72
71
|
var nextScheme = _findInstanceProperty(schemes).call(schemes, function (_ref4) {
|
|
@@ -77,7 +76,6 @@ var SchemeFilter = function SchemeFilter(props) {
|
|
|
77
76
|
setScheme(defaultScheme);
|
|
78
77
|
onSchemeSearch && onSchemeSearch(defaultScheme);
|
|
79
78
|
}
|
|
80
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
81
79
|
}, [schemes]);
|
|
82
80
|
var handleSwitchScheme = function handleSwitchScheme(name) {
|
|
83
81
|
var _context3;
|
|
@@ -138,7 +136,6 @@ var SchemeFilter = function SchemeFilter(props) {
|
|
|
138
136
|
fieldName: fieldName,
|
|
139
137
|
value: defaultValue
|
|
140
138
|
};
|
|
141
|
-
// debugger
|
|
142
139
|
setScheme(nextScheme);
|
|
143
140
|
};
|
|
144
141
|
var handleChangeOperator = function handleChangeOperator(index, assignOptions, operator) {
|
|
@@ -168,39 +165,35 @@ var SchemeFilter = function SchemeFilter(props) {
|
|
|
168
165
|
onSchemeSearch && onSchemeSearch(scheme);
|
|
169
166
|
};
|
|
170
167
|
var SettingMenu = getSchemeSettingMenu && getSchemeSettingMenu(scheme);
|
|
171
|
-
return
|
|
168
|
+
return React.createElement("ul", {
|
|
172
169
|
className: classNames("".concat(prefixCls, "-body-scheme"), {
|
|
173
170
|
active: props.tab === 'scheme'
|
|
174
171
|
})
|
|
175
|
-
},
|
|
172
|
+
}, React.createElement("li", null, React.createElement("span", {
|
|
176
173
|
className: "".concat(prefixCls, "-body-scheme-label")
|
|
177
|
-
}, FilterLangMsg.commonScheme, ":"),
|
|
174
|
+
}, FilterLangMsg.commonScheme, ":"), React.createElement("ol", {
|
|
178
175
|
className: "".concat(prefixCls, "-body-scheme-list")
|
|
179
176
|
}, _mapInstanceProperty(schemes).call(schemes, function (_ref8) {
|
|
180
177
|
var name = _ref8.name;
|
|
181
|
-
return (
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
onClick: handleSwitchScheme.bind(null, name)
|
|
190
|
-
}, name)
|
|
191
|
-
);
|
|
192
|
-
})), SettingMenu && scheme.name && /*#__PURE__*/React.createElement("div", {
|
|
178
|
+
return React.createElement("li", {
|
|
179
|
+
key: name,
|
|
180
|
+
className: classNames("".concat(prefixCls, "-body-scheme-item"), {
|
|
181
|
+
active: name === scheme.name
|
|
182
|
+
}),
|
|
183
|
+
onClick: handleSwitchScheme.bind(null, name)
|
|
184
|
+
}, name);
|
|
185
|
+
})), SettingMenu && scheme.name && React.createElement("div", {
|
|
193
186
|
className: "".concat(prefixCls, "-body-scheme-action")
|
|
194
|
-
},
|
|
187
|
+
}, React.createElement(Dropdown, {
|
|
195
188
|
menu: SettingMenu,
|
|
196
189
|
trigger: "click",
|
|
197
190
|
placement: "bottomRight"
|
|
198
|
-
},
|
|
191
|
+
}, React.createElement(Button, {
|
|
199
192
|
type: "ghost",
|
|
200
193
|
size: "small"
|
|
201
|
-
}, FilterLangMsg.settings)))),
|
|
194
|
+
}, FilterLangMsg.settings)))), React.createElement("li", null, React.createElement("span", {
|
|
202
195
|
className: "".concat(prefixCls, "-body-scheme-label")
|
|
203
|
-
}, FilterLangMsg.advancedQuery, "\uFF1A"),
|
|
196
|
+
}, FilterLangMsg.advancedQuery, "\uFF1A"), React.createElement("ol", {
|
|
204
197
|
className: "".concat(prefixCls, "-body-scheme-detail")
|
|
205
198
|
}, _mapInstanceProperty(_context5 = scheme.items).call(_context5, function (_ref9, index) {
|
|
206
199
|
var fieldName = _ref9.fieldName,
|
|
@@ -211,11 +204,11 @@ var SchemeFilter = function SchemeFilter(props) {
|
|
|
211
204
|
var name = _ref10.name;
|
|
212
205
|
return name === fieldName;
|
|
213
206
|
});
|
|
214
|
-
return
|
|
207
|
+
return React.createElement("li", {
|
|
215
208
|
key: index
|
|
216
|
-
},
|
|
209
|
+
}, React.createElement("span", {
|
|
217
210
|
className: "".concat(prefixCls, "-body-scheme-detail-field")
|
|
218
|
-
}, required ? field === null || field === void 0 ? void 0 : field.label :
|
|
211
|
+
}, required ? field === null || field === void 0 ? void 0 : field.label : React.createElement(Select, {
|
|
219
212
|
borderType: "bordered",
|
|
220
213
|
style: {
|
|
221
214
|
width: '100%'
|
|
@@ -225,51 +218,51 @@ var SchemeFilter = function SchemeFilter(props) {
|
|
|
225
218
|
}, _mapInstanceProperty(fields).call(fields, function (_ref11) {
|
|
226
219
|
var name = _ref11.name,
|
|
227
220
|
label = _ref11.label;
|
|
228
|
-
return
|
|
221
|
+
return React.createElement(Option, {
|
|
229
222
|
key: name,
|
|
230
223
|
value: name,
|
|
231
224
|
title: label
|
|
232
225
|
}, label);
|
|
233
|
-
}))),
|
|
226
|
+
}))), React.createElement("span", {
|
|
234
227
|
className: "".concat(prefixCls, "-body-scheme-detail-operator")
|
|
235
|
-
}, (field === null || field === void 0 ? void 0 : field.operators) &&
|
|
228
|
+
}, (field === null || field === void 0 ? void 0 : field.operators) && React.cloneElement(field.operators, {
|
|
236
229
|
value: operator,
|
|
237
230
|
style: {
|
|
238
231
|
width: '100%'
|
|
239
232
|
},
|
|
240
233
|
onChange: handleChangeOperator.bind(null, index, field.assignOptions)
|
|
241
|
-
})),
|
|
234
|
+
})), React.createElement("span", {
|
|
242
235
|
className: "".concat(prefixCls, "-body-scheme-detail-value")
|
|
243
|
-
}, (field === null || field === void 0 ? void 0 : field.assignOptions) &&
|
|
236
|
+
}, (field === null || field === void 0 ? void 0 : field.assignOptions) && React.cloneElement(field.assignOptions[operator] || field.assignOptions.default, {
|
|
244
237
|
value: value,
|
|
245
238
|
style: {
|
|
246
239
|
width: '100%'
|
|
247
240
|
},
|
|
248
241
|
onChange: handleChangeOption.bind(null, index)
|
|
249
|
-
})),
|
|
242
|
+
})), React.createElement("span", {
|
|
250
243
|
className: "".concat(prefixCls, "-body-scheme-detail-and")
|
|
251
|
-
}, FilterLangMsg.and), !required &&
|
|
244
|
+
}, FilterLangMsg.and), !required && React.createElement("span", {
|
|
252
245
|
className: "".concat(prefixCls, "-body-scheme-detail-delete"),
|
|
253
246
|
onClick: handleDeleteCondition.bind(null, index)
|
|
254
|
-
},
|
|
247
|
+
}, React.createElement(Icon, {
|
|
255
248
|
type: "close-solid"
|
|
256
249
|
})));
|
|
257
|
-
}),
|
|
250
|
+
}), React.createElement("li", null, React.createElement(Button, {
|
|
258
251
|
type: "primary",
|
|
259
252
|
ghost: true,
|
|
260
253
|
size: "small",
|
|
261
254
|
onClick: handleAddCondition
|
|
262
|
-
},
|
|
255
|
+
}, React.createElement(Icon, {
|
|
263
256
|
type: "add",
|
|
264
257
|
style: {
|
|
265
258
|
verticalAlign: 'top',
|
|
266
259
|
marginRight: 5
|
|
267
260
|
}
|
|
268
|
-
}), FilterLangMsg.addCondition)))), onSchemeSave &&
|
|
261
|
+
}), FilterLangMsg.addCondition)))), onSchemeSave && React.createElement("li", null, React.createElement("span", {
|
|
269
262
|
className: "".concat(prefixCls, "-body-scheme-label")
|
|
270
|
-
}, FilterLangMsg.schemeName, "\uFF1A"),
|
|
263
|
+
}, FilterLangMsg.schemeName, "\uFF1A"), React.createElement("div", {
|
|
271
264
|
className: "".concat(prefixCls, "-body-scheme-edit")
|
|
272
|
-
},
|
|
265
|
+
}, React.createElement(Input, {
|
|
273
266
|
borderType: "bordered",
|
|
274
267
|
placeholder: FilterLangMsg.schemeNamePlaceholder,
|
|
275
268
|
style: {
|
|
@@ -277,15 +270,15 @@ var SchemeFilter = function SchemeFilter(props) {
|
|
|
277
270
|
},
|
|
278
271
|
value: scheme.name,
|
|
279
272
|
onChange: handleChangeSchemeName
|
|
280
|
-
}),
|
|
273
|
+
}), React.createElement(Button, {
|
|
281
274
|
type: "ghost",
|
|
282
275
|
style: {
|
|
283
276
|
marginLeft: 12
|
|
284
277
|
},
|
|
285
278
|
onClick: onSchemeSave.bind(null, scheme)
|
|
286
|
-
}, FilterLangMsg.saveScheme)),
|
|
279
|
+
}, FilterLangMsg.saveScheme)), React.createElement("div", {
|
|
287
280
|
className: "".concat(prefixCls, "-body-scheme-action")
|
|
288
|
-
},
|
|
281
|
+
}, React.createElement(Button, {
|
|
289
282
|
type: "primary",
|
|
290
283
|
onClick: handleSearch
|
|
291
284
|
}, FilterLangMsg.query))));
|
package/es/form/Field.js
CHANGED
|
@@ -63,7 +63,7 @@ export var INNER_VALUE_PROPS_LIST = [{
|
|
|
63
63
|
var Field = function Field(props) {
|
|
64
64
|
var _context, _classnames;
|
|
65
65
|
var _a;
|
|
66
|
-
devwarning(!
|
|
66
|
+
devwarning(!React.isValidElement(props.children), 'Form.Item', 'Children of Form.Item is not a valid element');
|
|
67
67
|
devwarning(!props.name, 'Form.Item', 'Form.Item must have a name');
|
|
68
68
|
var _useContext = useContext(ConfigContext),
|
|
69
69
|
getPrefixCls = _useContext.getPrefixCls,
|
|
@@ -274,15 +274,15 @@ var Field = function Field(props) {
|
|
|
274
274
|
});
|
|
275
275
|
return mergeResult;
|
|
276
276
|
};
|
|
277
|
-
return
|
|
277
|
+
return React.createElement("div", {
|
|
278
278
|
className: formItemClassName
|
|
279
|
-
},
|
|
279
|
+
}, React.createElement(FieldLabel, {
|
|
280
280
|
htmlFor: htmlFor,
|
|
281
281
|
value: label,
|
|
282
282
|
width: labelWidth,
|
|
283
283
|
textAlign: labelAlign,
|
|
284
284
|
requiredMark: mergedRequired
|
|
285
|
-
}),
|
|
285
|
+
}), React.createElement(FieldWrapper, {
|
|
286
286
|
width: wrapperWidth !== null && wrapperWidth !== void 0 ? wrapperWidth : wrapperWidthContext,
|
|
287
287
|
validateMessage: validateMessage,
|
|
288
288
|
extra: extra
|
|
@@ -292,7 +292,7 @@ var Field = function Field(props) {
|
|
|
292
292
|
status: typeof validateMessage !== 'undefined' ? 'error' : undefined,
|
|
293
293
|
id: customizeHtmlFor ? undefined : htmlFor
|
|
294
294
|
}), child);
|
|
295
|
-
return child ?
|
|
295
|
+
return child ? React.cloneElement(child, keys) : child;
|
|
296
296
|
})));
|
|
297
297
|
};
|
|
298
298
|
export default Field;
|
package/es/form/FieldContext.js
CHANGED
|
@@ -3,7 +3,7 @@ import devwarning from '../_utils/devwarning';
|
|
|
3
3
|
var warningFunc = function warningFunc() {
|
|
4
4
|
devwarning(false, 'Form', 'Can not find FormContext. Please make sure you wrap Field under Form.');
|
|
5
5
|
};
|
|
6
|
-
var context =
|
|
6
|
+
var context = React.createContext({
|
|
7
7
|
getFieldError: warningFunc,
|
|
8
8
|
getFieldsError: warningFunc,
|
|
9
9
|
getFieldsValue: warningFunc,
|
package/es/form/FieldLabel.js
CHANGED
|
@@ -29,10 +29,10 @@ var FieldLabel = function FieldLabel(props) {
|
|
|
29
29
|
var style = {
|
|
30
30
|
width: mergedLabelWidth
|
|
31
31
|
};
|
|
32
|
-
return
|
|
32
|
+
return React.createElement("div", {
|
|
33
33
|
className: labelWrapperClassName,
|
|
34
34
|
style: style
|
|
35
|
-
},
|
|
35
|
+
}, React.createElement("label", {
|
|
36
36
|
className: labelClassName,
|
|
37
37
|
title: value,
|
|
38
38
|
htmlFor: htmlFor
|
package/es/form/FieldWrapper.js
CHANGED
|
@@ -16,21 +16,21 @@ var FieldWrapper = function FieldWrapper(props) {
|
|
|
16
16
|
var wrapperPrefixCls = getPrefixCls === null || getPrefixCls === void 0 ? void 0 : getPrefixCls(prefixCls, 'form-field-wrapper', customizePrefixCls);
|
|
17
17
|
var wrapperClassName = classnames(["".concat(wrapperPrefixCls)]);
|
|
18
18
|
var messageClassName = classnames(["".concat(wrapperPrefixCls, "-message")]);
|
|
19
|
-
var validate = validateMessage ?
|
|
19
|
+
var validate = validateMessage ? React.createElement("p", {
|
|
20
20
|
className: messageClassName,
|
|
21
21
|
title: validateMessage
|
|
22
22
|
}, validateMessage) : null;
|
|
23
|
-
return
|
|
23
|
+
return React.createElement("div", {
|
|
24
24
|
className: wrapperClassName,
|
|
25
25
|
style: {
|
|
26
26
|
width: width
|
|
27
27
|
}
|
|
28
|
-
}, children, extra ?
|
|
28
|
+
}, children, extra ? React.createElement("div", {
|
|
29
29
|
className: "".concat(wrapperPrefixCls, "-extra")
|
|
30
|
-
},
|
|
30
|
+
}, React.createElement("div", {
|
|
31
31
|
className: "".concat(wrapperPrefixCls, "-extra-message")
|
|
32
|
-
}, validateMessage),
|
|
32
|
+
}, validateMessage), React.createElement("div", {
|
|
33
33
|
className: "".concat(wrapperPrefixCls, "-extra-text")
|
|
34
|
-
}, extra)) :
|
|
34
|
+
}, extra)) : React.createElement(React.Fragment, null, validate));
|
|
35
35
|
};
|
|
36
36
|
export default FieldWrapper;
|
package/es/form/Form.js
CHANGED
|
@@ -50,18 +50,15 @@ var Form = function Form(props, ref) {
|
|
|
50
50
|
var _useForm = useForm(form),
|
|
51
51
|
_useForm2 = _slicedToArray(_useForm, 1),
|
|
52
52
|
formInstance = _useForm2[0];
|
|
53
|
-
// 注册
|
|
54
53
|
useEffect(function () {
|
|
55
54
|
formContext.registerForm(name, formInstance);
|
|
56
55
|
return function () {
|
|
57
56
|
formContext.unregisterForm(name);
|
|
58
57
|
};
|
|
59
58
|
}, [name, formInstance, formContext]);
|
|
60
|
-
// 暴露 formInstance
|
|
61
59
|
React.useImperativeHandle(ref, function () {
|
|
62
60
|
return formInstance;
|
|
63
61
|
});
|
|
64
|
-
// 设置默认值及回调函数
|
|
65
62
|
var _formInstance$getInte = formInstance.getInternalHooks(INTERNAL_HOOK_KEY),
|
|
66
63
|
setDefaultValues = _formInstance$getInte.setDefaultValues,
|
|
67
64
|
setCallbacks = _formInstance$getInte.setCallbacks;
|
|
@@ -91,12 +88,12 @@ var Form = function Form(props, ref) {
|
|
|
91
88
|
evt.stopPropagation();
|
|
92
89
|
formInstance.resetFields();
|
|
93
90
|
};
|
|
94
|
-
return
|
|
91
|
+
return React.createElement("form", _extends({
|
|
95
92
|
className: formClassName
|
|
96
93
|
}, restProps, {
|
|
97
94
|
onSubmit: handleSubmit,
|
|
98
95
|
onReset: handleReset
|
|
99
|
-
}),
|
|
96
|
+
}), React.createElement(FieldContext.Provider, {
|
|
100
97
|
value: formContextValue
|
|
101
98
|
}, children));
|
|
102
99
|
};
|
package/es/form/FormContext.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
3
3
|
import React from 'react';
|
|
4
|
-
var FormContext =
|
|
5
|
-
// eslint-disable-next-line
|
|
4
|
+
var FormContext = React.createContext({
|
|
6
5
|
registerForm: function registerForm() {},
|
|
7
|
-
// eslint-disable-next-line
|
|
8
6
|
unregisterForm: function unregisterForm() {}
|
|
9
7
|
});
|
|
10
8
|
var FormProvider = function FormProvider(_ref) {
|
|
11
9
|
var children = _ref.children;
|
|
12
10
|
var formContext = React.useContext(FormContext);
|
|
13
11
|
var formsRef = React.useRef({});
|
|
14
|
-
return
|
|
12
|
+
return React.createElement(FormContext.Provider, {
|
|
15
13
|
value: _extends(_extends({}, formContext), {
|
|
16
14
|
registerForm: function registerForm(name, form) {
|
|
17
15
|
if (name) {
|
package/es/form/hooks/useForm.js
CHANGED
|
@@ -14,7 +14,7 @@ import merge from 'lodash/merge';
|
|
|
14
14
|
import set from 'lodash/set';
|
|
15
15
|
import devwarning from '../../_utils/devwarning';
|
|
16
16
|
export var INTERNAL_HOOK_KEY = '__KD_INTERNAL_FORM_HOOK__';
|
|
17
|
-
var FormStore =
|
|
17
|
+
var FormStore = _createClass(function FormStore() {
|
|
18
18
|
var _this = this;
|
|
19
19
|
_classCallCheck(this, FormStore);
|
|
20
20
|
this.isMounted = false;
|
|
@@ -55,10 +55,6 @@ var FormStore = /*#__PURE__*/_createClass(function FormStore() {
|
|
|
55
55
|
this.warningUnhooked = function () {
|
|
56
56
|
!_this.isMounted && devwarning(false, 'Form', 'Instance created by `useForm` is not connected to any Form element. Forget to pass `form` prop?');
|
|
57
57
|
};
|
|
58
|
-
/**
|
|
59
|
-
* Dispath. 用于 Field 触发数据变更
|
|
60
|
-
* @param action
|
|
61
|
-
*/
|
|
62
58
|
this.dispatch = function (action) {
|
|
63
59
|
_this.warningUnhooked();
|
|
64
60
|
var namePath = action.namePath;
|
|
@@ -149,8 +145,6 @@ var FormStore = /*#__PURE__*/_createClass(function FormStore() {
|
|
|
149
145
|
this.resetFields = function () {
|
|
150
146
|
_this.warningUnhooked();
|
|
151
147
|
var prevStore = cloneDeep(_this.store);
|
|
152
|
-
// 重置时,无默认值的 field value 不能设置为 undefined
|
|
153
|
-
// 部分控件 undefined 的话不会生效
|
|
154
148
|
var newStore = {};
|
|
155
149
|
for (var key in _this.store) {
|
|
156
150
|
newStore[key] = _this.defaultValues[key] ? _this.defaultValues[key] : '';
|
|
@@ -164,7 +158,6 @@ var FormStore = /*#__PURE__*/_createClass(function FormStore() {
|
|
|
164
158
|
var prevStore = cloneDeep(_this.store);
|
|
165
159
|
set(_this.store, name, value);
|
|
166
160
|
var trigger = get(_this.fields, [name, 'meta', 'trigger']);
|
|
167
|
-
// 默认是 onChange 触发校验
|
|
168
161
|
if (trigger === undefined || trigger === 'onChange' || _includesInstanceProperty(trigger).call(trigger, 'onChange')) {
|
|
169
162
|
_this.validateFields([name]);
|
|
170
163
|
} else {
|
|
@@ -188,7 +181,6 @@ var FormStore = /*#__PURE__*/_createClass(function FormStore() {
|
|
|
188
181
|
this.validateFields = function (namePathList) {
|
|
189
182
|
_this.warningUnhooked();
|
|
190
183
|
var rules = _this.getRules(namePathList);
|
|
191
|
-
// 没有设置校验规则的情况下,不做校验
|
|
192
184
|
if (!rules) return _Promise.resolve({
|
|
193
185
|
values: cloneDeep(_this.store)
|
|
194
186
|
});
|
|
@@ -201,9 +193,7 @@ var FormStore = /*#__PURE__*/_createClass(function FormStore() {
|
|
|
201
193
|
}).catch(function (_ref) {
|
|
202
194
|
var errors = _ref.errors,
|
|
203
195
|
fields = _ref.fields;
|
|
204
|
-
// eslint-disable-next-line
|
|
205
196
|
console.log(errors);
|
|
206
|
-
// eslint-disable-next-line prefer-promise-reject-errors
|
|
207
197
|
reject({
|
|
208
198
|
errors: errors,
|
|
209
199
|
errorInfos: {
|
|
@@ -213,9 +203,6 @@ var FormStore = /*#__PURE__*/_createClass(function FormStore() {
|
|
|
213
203
|
});
|
|
214
204
|
});
|
|
215
205
|
});
|
|
216
|
-
/**
|
|
217
|
-
* 内部校验用
|
|
218
|
-
*/
|
|
219
206
|
validatePromise.then(function () {
|
|
220
207
|
namePathList === null || namePathList === void 0 ? void 0 : namePathList.forEach(function (name) {
|
|
221
208
|
_this.errorMessages[name] && delete _this.errorMessages[name];
|
package/es/form/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import Item from './Field';
|
|
|
3
3
|
import useForm from './hooks/useForm';
|
|
4
4
|
import FieldForm from './Form';
|
|
5
5
|
import { FormProvider } from './FormContext';
|
|
6
|
-
var InternalForm =
|
|
6
|
+
var InternalForm = React.forwardRef(FieldForm);
|
|
7
7
|
var RefForm = InternalForm;
|
|
8
8
|
RefForm.FormProvider = FormProvider;
|
|
9
9
|
RefForm.Item = Item;
|
package/es/grid/col.js
CHANGED
|
@@ -20,7 +20,6 @@ var Col = function Col(props) {
|
|
|
20
20
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
21
21
|
pkgPrefixCls = _React$useContext.prefixCls,
|
|
22
22
|
userDefaultProps = _React$useContext.compDefaultProps;
|
|
23
|
-
// 属性需要合并一遍用户定义的默认属性
|
|
24
23
|
var _a = getCompProps('Col', userDefaultProps, props),
|
|
25
24
|
xs = _a.xs,
|
|
26
25
|
sm = _a.sm,
|
|
@@ -41,13 +40,9 @@ var Col = function Col(props) {
|
|
|
41
40
|
var rowGroup = useContext(GapContext);
|
|
42
41
|
var mergedWinWidth = rowGroup.winWidth;
|
|
43
42
|
var gap = rowGroup.gap;
|
|
44
|
-
// 判断当前浏览器是否支持row-gap,如果不支持则使用margin负值模拟
|
|
45
43
|
var notSupportRowGap = function notSupportRowGap() {
|
|
46
|
-
// 判断是否是搜狗浏览器
|
|
47
44
|
if (testBrowserType(/^sogou/i, 0)) return true;
|
|
48
|
-
// 判断是否是IE浏览器
|
|
49
45
|
if (/Trident|MSIE/.test(navigator.userAgent)) return true;
|
|
50
|
-
// 判断是否是chrome浏览器,chrome浏览器版本号小于83(统信浏览器)
|
|
51
46
|
if (/Chrome/.test(navigator.userAgent) && !/Chromium/.test(navigator.userAgent)) {
|
|
52
47
|
var version = navigator.userAgent.split('Chrome/')[1].split('.');
|
|
53
48
|
if (version[0] && parseInt(version[0]) <= 83) return true;
|
|
@@ -58,7 +53,6 @@ var Col = function Col(props) {
|
|
|
58
53
|
padding: "0 ".concat(gap.h / 2, "px")
|
|
59
54
|
};
|
|
60
55
|
if (notSupportRowGap() && gap.v) colGapStyle.marginBottom = gap.v;
|
|
61
|
-
// className前缀
|
|
62
56
|
var prefixCls = getPrefixCls(pkgPrefixCls, 'col', customPrefixcls);
|
|
63
57
|
var columns = 24;
|
|
64
58
|
var base = {
|
|
@@ -112,7 +106,7 @@ var Col = function Col(props) {
|
|
|
112
106
|
right: base.pull && base.pull / columns * 100 + '%',
|
|
113
107
|
marginLeft: base.offset && base.offset / columns * 100 + '%'
|
|
114
108
|
}, colGapStyle), style);
|
|
115
|
-
return
|
|
109
|
+
return React.createElement("div", _extends({
|
|
116
110
|
className: classNames(prefixCls, className),
|
|
117
111
|
style: styleString
|
|
118
112
|
}, others), children);
|
package/es/grid/row.js
CHANGED
|
@@ -20,7 +20,7 @@ function getGap(gutter, width) {
|
|
|
20
20
|
if (xl && width >= 1920) gap = xl;
|
|
21
21
|
return gap;
|
|
22
22
|
}
|
|
23
|
-
export var GapContext =
|
|
23
|
+
export var GapContext = createContext({
|
|
24
24
|
gap: {
|
|
25
25
|
h: 0,
|
|
26
26
|
v: 0
|
|
@@ -32,7 +32,6 @@ var Row = function Row(props) {
|
|
|
32
32
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
33
33
|
pkgPrefixCls = _React$useContext.prefixCls,
|
|
34
34
|
userDefaultProps = _React$useContext.compDefaultProps;
|
|
35
|
-
// 属性需要合并一遍用户定义的默认属性
|
|
36
35
|
var _getCompProps = getCompProps('Row', userDefaultProps, props),
|
|
37
36
|
style = _getCompProps.style,
|
|
38
37
|
className = _getCompProps.className,
|
|
@@ -42,20 +41,15 @@ var Row = function Row(props) {
|
|
|
42
41
|
align = _getCompProps.align,
|
|
43
42
|
justify = _getCompProps.justify,
|
|
44
43
|
customPrefixcls = _getCompProps.prefixCls;
|
|
45
|
-
// 判断当前浏览器是否支持row-gap,如果不支持则使用margin负值模拟
|
|
46
44
|
var notSupportRowGap = function notSupportRowGap() {
|
|
47
|
-
// 判断是否是搜狗浏览器
|
|
48
45
|
if (testBrowserType(/^sogou/i, 0)) return true;
|
|
49
|
-
// 判断是否是IE浏览器
|
|
50
46
|
if (/Trident|MSIE/.test(navigator.userAgent)) return true;
|
|
51
|
-
// 判断是否是chrome浏览器,chrome浏览器版本号小于83(统信浏览器)
|
|
52
47
|
if (/Chrome/.test(navigator.userAgent) && !/Chromium/.test(navigator.userAgent)) {
|
|
53
48
|
var version = navigator.userAgent.split('Chrome/')[1].split('.');
|
|
54
49
|
if (version[0] && parseInt(version[0]) <= 83) return true;
|
|
55
50
|
}
|
|
56
51
|
return false;
|
|
57
52
|
};
|
|
58
|
-
// className前缀
|
|
59
53
|
var prefixCls = getPrefixCls(pkgPrefixCls, 'row', customPrefixcls);
|
|
60
54
|
var _React$useState = React.useState(window.innerWidth),
|
|
61
55
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -103,12 +97,12 @@ var Row = function Row(props) {
|
|
|
103
97
|
alignItems: toalign[align] || align,
|
|
104
98
|
justifyContent: tojustify[justify] || justify
|
|
105
99
|
});
|
|
106
|
-
return
|
|
100
|
+
return React.createElement(GapContext.Provider, {
|
|
107
101
|
value: {
|
|
108
102
|
gap: gap,
|
|
109
103
|
winWidth: winWidth
|
|
110
104
|
}
|
|
111
|
-
},
|
|
105
|
+
}, React.createElement("div", {
|
|
112
106
|
className: classNames(prefixCls, className, {
|
|
113
107
|
nowrap: !wrap
|
|
114
108
|
}),
|
package/es/icon/icon.js
CHANGED
|
@@ -46,7 +46,7 @@ var InternalIcon = function InternalIcon(props, ref) {
|
|
|
46
46
|
if (rotate !== undefined) {
|
|
47
47
|
iconStyle.transform = "rotate(".concat(rotate, "deg)");
|
|
48
48
|
}
|
|
49
|
-
return
|
|
49
|
+
return React.createElement("i", _extends({
|
|
50
50
|
className: iconClass,
|
|
51
51
|
onClick: handleClick,
|
|
52
52
|
onMouseEnter: handleMouseEnter,
|
|
@@ -56,6 +56,6 @@ var InternalIcon = function InternalIcon(props, ref) {
|
|
|
56
56
|
ref: iconRef
|
|
57
57
|
}));
|
|
58
58
|
};
|
|
59
|
-
var Icon =
|
|
59
|
+
var Icon = React.forwardRef(InternalIcon);
|
|
60
60
|
Icon.displayName = 'Icon';
|
|
61
61
|
export default Icon;
|
package/es/image/image.js
CHANGED
|
@@ -12,7 +12,6 @@ var ImageInternal = function ImageInternal(props, ref) {
|
|
|
12
12
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
13
13
|
pkgPrefixCls = _React$useContext.prefixCls,
|
|
14
14
|
userDefaultProps = _React$useContext.compDefaultProps;
|
|
15
|
-
// 属性需要合并一遍用户定义的默认属性
|
|
16
15
|
var allProps = getCompProps('Image', userDefaultProps, props);
|
|
17
16
|
var innerRef = React.useRef();
|
|
18
17
|
var previewRef = ref || innerRef;
|
|
@@ -28,7 +27,6 @@ var ImageInternal = function ImageInternal(props, ref) {
|
|
|
28
27
|
_allProps$placeholder = allProps.placeholder,
|
|
29
28
|
placeholder = _allProps$placeholder === void 0 ? '' : _allProps$placeholder,
|
|
30
29
|
customPrefixcls = allProps.prefixCls;
|
|
31
|
-
// className前缀
|
|
32
30
|
var prefixCls = getPrefixCls(pkgPrefixCls, 'image', customPrefixcls);
|
|
33
31
|
var _React$useState = React.useState(false),
|
|
34
32
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -107,7 +105,7 @@ var ImageInternal = function ImageInternal(props, ref) {
|
|
|
107
105
|
operations: props.previewOperations,
|
|
108
106
|
onClose: onClose
|
|
109
107
|
};
|
|
110
|
-
return
|
|
108
|
+
return React.createElement("div", {
|
|
111
109
|
className: classNames(prefixCls, props.className, {
|
|
112
110
|
error: error
|
|
113
111
|
}),
|
|
@@ -115,13 +113,13 @@ var ImageInternal = function ImageInternal(props, ref) {
|
|
|
115
113
|
width: width,
|
|
116
114
|
height: height
|
|
117
115
|
}, props.style)
|
|
118
|
-
},
|
|
116
|
+
}, React.createElement("img", _extends({}, imgProps, {
|
|
119
117
|
ref: previewRef
|
|
120
|
-
})), (operations === null || operations === void 0 ? void 0 : operations.length) > 0 && !error &&
|
|
118
|
+
})), (operations === null || operations === void 0 ? void 0 : operations.length) > 0 && !error && React.createElement("div", {
|
|
121
119
|
className: "".concat(prefixCls, "-action")
|
|
122
|
-
}, operations), preview && exit &&
|
|
120
|
+
}, operations), preview && exit && React.createElement(Preview, _extends({}, previewProps)));
|
|
123
121
|
};
|
|
124
|
-
var Image =
|
|
122
|
+
var Image = React.forwardRef(ImageInternal);
|
|
125
123
|
var ImageOuter = Image;
|
|
126
124
|
ImageOuter.Preview = Preview;
|
|
127
125
|
ImageOuter.PreviewGroup = PreviewGroup;
|