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