tntd 3.0.0-beta.1 → 3.0.0-beta.11
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/es/_util/context.js +5 -7
- package/es/_util/defaultRenderEmpty.js +21 -10
- package/es/_util/hooks/useFlexGapSupport.js +7 -8
- package/es/_util/hooks/useForceUpdate.js +3 -4
- package/es/_util/motion.js +36 -27
- package/es/_util/reactNode.js +10 -9
- package/es/_util/responsiveObserve.js +51 -50
- package/es/_util/styleChecker.js +19 -20
- package/es/_util/type.js +1 -2
- package/es/_util/warning.js +3 -4
- package/es/actions/index.js +22 -8
- package/es/affix/index.js +1 -2
- package/es/affix/style/index.js +1 -2
- package/es/alert/alert.js +52 -39
- package/es/alert/alert.js.map +1 -1
- package/es/alert/index.js +1 -2
- package/es/alert/style/index.js +1 -2
- package/es/anchor/index.js +1 -2
- package/es/anchor/style/index.js +1 -2
- package/es/array-input/1.png +1 -0
- package/es/array-input/111.gif +0 -0
- package/es/array-input/icon.js +24 -6
- package/es/array-input/index.js +203 -119
- package/es/auth-context/index.js +1 -2
- package/es/auto-complete/index.js +1 -2
- package/es/auto-complete/style/index.js +1 -2
- package/es/avatar/index.js +1 -2
- package/es/avatar/style/index.js +1 -2
- package/es/back-top/index.js +1 -2
- package/es/back-top/style/index.js +1 -2
- package/es/badge/index.js +1 -2
- package/es/badge/style/index.js +1 -2
- package/es/breadcrumb/index.js +1 -2
- package/es/breadcrumb/style/index.js +1 -2
- package/es/breadcrumb/style/index.less +2 -1
- package/es/button/button.js +52 -32
- package/es/button/button.less +17 -12
- package/es/button/index.js +1 -2
- package/es/button/style/index.js +1 -2
- package/es/calendar/index.js +1 -2
- package/es/calendar/style/index.js +1 -2
- package/es/card/card.js +19 -15
- package/es/card/index.js +1 -2
- package/es/card/style/index.js +1 -2
- package/es/carousel/index.js +1 -2
- package/es/carousel/style/index.js +1 -2
- package/es/cascader/cascader.js +30 -0
- package/es/cascader/cascader.js.map +1 -0
- package/es/cascader/cascader.less +16 -0
- package/es/cascader/index.js +4 -8
- package/es/cascader/index.js.map +1 -1
- package/es/cascader/style/index.js +1 -2
- package/es/cascader/style/index.less +2 -2
- package/es/check-card/group.js +186 -138
- package/es/check-card/index.js +149 -107
- package/es/check-card/index.js.map +1 -1
- package/es/checkbox/checkbox.js +36 -25
- package/es/checkbox/checkbox.js.map +1 -1
- package/es/checkbox/index.js +1 -2
- package/es/checkbox/style/index.js +1 -2
- package/es/col/index.js +1 -2
- package/es/col/style/index.js +1 -2
- package/es/collapse/collapse.less +3 -3
- package/es/collapse/index.js +1 -2
- package/es/collapse/style/index.js +1 -2
- package/es/collapse/style/index.less +2 -1
- package/es/color-picker/ColorPicker.js +126 -81
- package/es/color-picker/ColorPicker.js.map +1 -1
- package/es/color-picker/index.js +8 -5
- package/es/columns/index.js +66 -30
- package/es/columns/style/index.js +1 -2
- package/es/comment/index.js +1 -2
- package/es/comment/style/index.js +1 -2
- package/es/config-provider/DisabledContext.js +9 -5
- package/es/config-provider/SizeContext.js +7 -3
- package/es/config-provider/config-provider.js +1 -2
- package/es/config-provider/index.js +1 -2
- package/es/config-provider/style/index.js +1 -2
- package/es/connect/index.js +23 -20
- package/es/date-picker/DatePicker.js +90 -42
- package/es/date-picker/index.js +4 -5
- package/es/date-picker/style/Picker.less +2 -1
- package/es/date-picker/style/index.js +1 -2
- package/es/descriptions/descriptions.js +93 -51
- package/es/descriptions/index.js +1 -2
- package/es/descriptions/style/index.js +1 -2
- package/es/development-login/LoginModal.js +81 -46
- package/es/development-login/index.js +17 -8
- package/es/divider/index.js +1 -2
- package/es/divider/style/index.js +1 -2
- package/es/drawer/drawer.js +112 -55
- package/es/drawer/drawer.js.map +1 -1
- package/es/drawer/index.js +1 -2
- package/es/drawer/index.less +5 -2
- package/es/drawer/style/index.js +1 -2
- package/es/dropdown/index.js +1 -2
- package/es/dropdown/style/index.js +1 -2
- package/es/dropdown/style/index.less +2 -1
- package/es/ellipsis/Svg/CopySVG.js +63 -16
- package/es/ellipsis/Svg/TickSVG.js +41 -11
- package/es/ellipsis/index.js +139 -102
- package/es/empty/empty.js +58 -48
- package/es/empty/empty.stories.js +5 -6
- package/es/empty/index.js +1 -2
- package/es/empty/style/index.js +1 -2
- package/es/exception/exception.js +32 -19
- package/es/exception/index.js +1 -2
- package/es/form/form.js +63 -46
- package/es/form/form.js.map +1 -1
- package/es/form/index.js +1 -2
- package/es/form/style/index.js +1 -2
- package/es/grid/index.js +1 -2
- package/es/grid/style/index.js +1 -2
- package/es/grid-v4/RowContext.js +1 -2
- package/es/grid-v4/col.js +89 -64
- package/es/grid-v4/hooks/useBreakpoint.js +13 -14
- package/es/grid-v4/index.js +4 -3
- package/es/grid-v4/row.js +136 -123
- package/es/grid-v4/style/index.js +1 -2
- package/es/handle/index.js +135 -92
- package/es/handle/index.js.map +1 -1
- package/es/handle/index.less +16 -0
- package/es/icon/IconFont.js +46 -46
- package/es/icon/components/Icon.js +89 -71
- package/es/icon/components/index.js +1 -2
- package/es/icon/components/utils.js +64 -64
- package/es/icon/index.js +92 -78
- package/es/icon/index.js.map +1 -1
- package/es/icon/style/index.js +1 -1
- package/es/icon/style/index.js.map +1 -1
- package/es/icon/style/style.less +3 -1
- package/es/icon/twoTonePrimaryColor.js +6 -7
- package/es/icon/utils.js +48 -54
- package/es/icon-list/index.js +1 -120
- package/es/icon-old/index.js +1 -2
- package/es/icon-old/style/index.js +1 -2
- package/es/img/Contain.js +60 -39
- package/es/img/Cover.js +98 -72
- package/es/img/index.js +48 -32
- package/es/index.js +5 -2
- package/es/index.js.map +1 -1
- package/es/input/index.js +1 -2
- package/es/input/input.js +83 -46
- package/es/input/style/index.js +1 -2
- package/es/input/style/mixin.less +1 -2
- package/es/input-number/index.js +1 -2
- package/es/input-number/inputNumber.js +17 -15
- package/es/input-number/style/index.js +1 -2
- package/es/label/index.js +115 -98
- package/es/layout/index.js +1 -2
- package/es/layout/style/index.js +1 -2
- package/es/list/index.js +1 -2
- package/es/list/style/index.js +1 -2
- package/es/loading-button/index.js +33 -28
- package/es/locale/default.js +3 -4
- package/es/locale/en_US.js +55 -53
- package/es/locale/en_US.js.map +1 -1
- package/es/locale/index.js +1 -2
- package/es/locale/zh_CN.js +48 -46
- package/es/locale/zh_CN.js.map +1 -1
- package/es/locale-provider/index.js +2 -3
- package/es/locale-provider/style/index.js +1 -2
- package/es/mentions/index.js +1 -2
- package/es/mentions/style/index.js +1 -2
- package/es/menu/index.js +1 -2
- package/es/menu/style/index.js +1 -2
- package/es/message/index.js +1 -2
- package/es/message/style/index.js +1 -2
- package/es/modal/index.js +1 -2
- package/es/modal/modal.js +153 -61
- package/es/modal/style/confirm.less +7 -7
- package/es/modal/style/index.js +1 -2
- package/es/modal/style/modal.less +5 -1
- package/es/notification/assets/index.js +1 -2
- package/es/notification/assets/svg-error-tip.js +140 -30
- package/es/notification/assets/svg-success-tip.js +157 -34
- package/es/notification/index.js +1 -2
- package/es/notification/notification.js +71 -15
- package/es/notification/style/index.js +1 -2
- package/es/notification/style/index.less +4 -2
- package/es/page/Box.js +49 -33
- package/es/page/index.js +119 -84
- package/es/page/utils.js +12 -14
- package/es/page-container/index.js +13 -0
- package/es/page-container/index.js.map +1 -0
- package/es/page-container/index.less +38 -0
- package/es/page-header/index.js +1 -2
- package/es/page-header/style/index.js +1 -2
- package/es/page-loading/index.js +29 -0
- package/es/page-loading/index.js.map +1 -0
- package/es/page-loading/index.less +38 -0
- package/es/page-loading/loading.gif +0 -0
- package/es/pagination/index.js +1 -2
- package/es/pagination/style/index.js +1 -2
- package/es/popconfirm/index.js +1 -2
- package/es/popconfirm/index.less +10 -4
- package/es/popconfirm/popconfirm.js +36 -23
- package/es/popconfirm/popconfirm.js.map +1 -1
- package/es/popconfirm/style/index.js +1 -2
- package/es/popover/index.js +1 -2
- package/es/popover/index.less +6 -0
- package/es/popover/popover.js +25 -19
- package/es/popover/popover.js.map +1 -1
- package/es/popover/style/index.js +1 -2
- package/es/popover/style/index.less +2 -1
- package/es/prev-locale.js +49 -47
- package/es/preview-text/index.js +247 -177
- package/es/progress/index.js +1 -2
- package/es/progress/progress.js +115 -71
- package/es/progress/style/index.js +1 -2
- package/es/query-form/Field/Checkbox.js +20 -17
- package/es/query-form/Field/Checkbox.js.map +1 -1
- package/es/query-form/Field/Composition/FieldPopover.js +313 -196
- package/es/query-form/Field/Composition/FieldPopover.js.map +1 -1
- package/es/query-form/Field/Composition/Select.js +101 -69
- package/es/query-form/Field/Composition/Select.js.map +1 -1
- package/es/query-form/Field/Composition/index.js +188 -209
- package/es/query-form/Field/Composition/index.js.map +1 -1
- package/es/query-form/Field/Composition/index.less +13 -6
- package/es/query-form/Field/Composition/utils.js +119 -13
- package/es/query-form/Field/Composition/utils.js.map +1 -1
- package/es/query-form/Field/Select.js +54 -39
- package/es/query-form/Field/SelectInput.js +83 -45
- package/es/query-form/Field/SelectInput.js.map +1 -1
- package/es/query-form/Field/fieldsMap.js +19 -20
- package/es/query-form/Field/fieldsMap.js.map +1 -1
- package/es/query-form/Field/index.js +109 -67
- package/es/query-form/Field/index.js.map +1 -1
- package/es/query-form/createActions.js +46 -46
- package/es/query-form/index.js +151 -240
- package/es/query-form/index.js.map +1 -1
- package/es/query-form/index.less +16 -56
- package/es/query-form/useForm.js +3 -4
- package/es/query-form2/Field/Checkbox.js +23 -0
- package/es/query-form2/Field/Checkbox.js.map +1 -0
- package/es/query-form2/Field/Composition/FieldPopover.js +308 -0
- package/es/query-form2/Field/Composition/FieldPopover.js.map +1 -0
- package/es/query-form2/Field/Composition/FieldPopover.less +35 -0
- package/es/query-form2/Field/Composition/Select.js +104 -0
- package/es/query-form2/Field/Composition/Select.js.map +1 -0
- package/es/query-form2/Field/Composition/index.js +299 -0
- package/es/query-form2/Field/Composition/index.js.map +1 -0
- package/es/query-form2/Field/Composition/index.less +114 -0
- package/es/query-form2/Field/Composition/utils.js +19 -0
- package/es/query-form2/Field/Composition/utils.js.map +1 -0
- package/es/query-form2/Field/Select.js +59 -0
- package/es/query-form2/Field/Select.js.map +1 -0
- package/es/query-form2/Field/SelectInput.js +87 -0
- package/es/query-form2/Field/SelectInput.js.map +1 -0
- package/es/query-form2/Field/fieldsMap.js +28 -0
- package/es/query-form2/Field/fieldsMap.js.map +1 -0
- package/es/query-form2/Field/index.js +117 -0
- package/es/query-form2/Field/index.js.map +1 -0
- package/es/query-form2/createActions.js +47 -0
- package/es/query-form2/createActions.js.map +1 -0
- package/es/query-form2/index.js +345 -0
- package/es/query-form2/index.js.map +1 -0
- package/es/query-form2/index.less +136 -0
- package/es/query-form2/useForm.js +6 -0
- package/es/query-form2/useForm.js.map +1 -0
- package/es/query-list-scene/List.js +321 -255
- package/es/query-list-scene/QueryForm.js +130 -94
- package/es/query-list-scene/QueryForm.js.map +1 -1
- package/es/query-list-scene/QueryListScene.js +29 -21
- package/es/query-list-scene/Title.js +6 -4
- package/es/query-list-scene/Toolbar.js +21 -15
- package/es/query-list-scene/createActions.js +60 -60
- package/es/query-list-scene/index.js +1 -2
- package/es/query-list-scene/index.less +3 -3
- package/es/query-list-scene/useActions.js +3 -4
- package/es/radio/index.js +1 -2
- package/es/radio/radio.js +35 -24
- package/es/radio/radio.js.map +1 -1
- package/es/radio/style/index.js +1 -2
- package/es/rate/index.js +1 -2
- package/es/rate/style/index.js +1 -2
- package/es/render-empty/index.js +1 -2
- package/es/render-empty/render-empty.js +19 -16
- package/es/result/index.js +1 -2
- package/es/result/style/index.js +1 -2
- package/es/row/index.js +1 -2
- package/es/row/style/index.js +1 -2
- package/es/segmented/index.js +55 -38
- package/es/select/index.js +1 -2
- package/es/select/select.js +41 -27
- package/es/select/select.less +4 -1
- package/es/select/style/index.js +1 -2
- package/es/select/style/index.less +2 -1
- package/es/skeleton/index.js +1 -2
- package/es/skeleton/style/index.js +1 -2
- package/es/slider/index.js +1 -2
- package/es/slider/style/index.js +1 -2
- package/es/spin/index.js +1 -2
- package/es/spin/style/index.js +1 -2
- package/es/statistic/index.js +1 -2
- package/es/statistic/style/index.js +1 -2
- package/es/steps/index.js +1 -2
- package/es/steps/steps.js +76 -44
- package/es/steps/style/index.js +1 -2
- package/es/style/index.js +1 -2
- package/es/style/mixins/iconfont.less +3 -2
- package/es/style/themes/default.less +7 -6
- package/es/style/v2-compatible-reset.js +1 -2
- package/es/svg-components/illustration-403.js +206 -58
- package/es/svg-components/illustration-404.js +290 -75
- package/es/svg-components/illustration-500.js +321 -83
- package/es/svg-components/illustration-empty.js +54 -15
- package/es/svg-components/illustration-failure.js +112 -36
- package/es/svg-components/illustration-no-access.js +114 -35
- package/es/svg-components/illustration-no-chart.js +134 -37
- package/es/svg-components/illustration-no-result.js +92 -32
- package/es/svg-components/illustration-offline.js +131 -43
- package/es/svg-components/illustration-success.js +137 -43
- package/es/svg-components/index.js +1 -2
- package/es/switch/index.js +1 -2
- package/es/switch/style/index.js +1 -2
- package/es/switch/switch.js +39 -30
- package/es/table/assets/image-loading-background.js +45 -17
- package/es/table/assets/image-loading.js +26 -5
- package/es/table/constants.js +1 -2
- package/es/table/context.js +1 -2
- package/es/table/hooks/index.js +1 -2
- package/es/table/hooks/use-column-setting.js +13 -16
- package/es/table/index.js +1 -2
- package/es/table/style/index.js +1 -2
- package/es/table/style/index.less +34 -12
- package/es/table/style/size.less +4 -4
- package/es/table/table.js +189 -155
- package/es/table/table.js.map +1 -1
- package/es/table/table.less +2 -1
- package/es/table/table.stories.js +148 -139
- package/es/table/total-shower.js +8 -4
- package/es/table/utils.js +17 -18
- package/es/table-container/index.js +15 -0
- package/es/table-container/index.js.map +1 -0
- package/es/table-container/index.less +16 -0
- package/es/tabs/index.js +1 -2
- package/es/tabs/style/index.js +1 -2
- package/es/tabs/tabPane.js +1 -2
- package/es/tabs/tabs.js +54 -43
- package/es/tabs/tabs.less +23 -25
- package/es/tabs-container/index.js +13 -0
- package/es/tabs-container/index.js.map +1 -0
- package/es/tabs-container/index.less +51 -0
- package/es/tag/color.less +28 -18
- package/es/tag/index.js +2 -3
- package/es/tag/index.js.map +1 -1
- package/es/tag/style/index.js +1 -2
- package/es/tag/tag.js +140 -110
- package/es/tag/tag.less +41 -4
- package/es/time-picker/TimePicker.js +28 -20
- package/es/time-picker/index.js +1 -2
- package/es/time-picker/style/index.js +1 -2
- package/es/time-picker/style/index.less +2 -1
- package/es/timeline/index.js +1 -2
- package/es/timeline/style/index.js +1 -2
- package/es/timeline/style/index.less +1 -1
- package/es/title/index.js +32 -20
- package/es/tntd-action/Action.js +57 -35
- package/es/tntd-action/Action.js.map +1 -1
- package/es/tntd-action/index.js +58 -54
- package/es/tntd-action/index.js.map +1 -1
- package/es/tntd-action/index.less +17 -0
- package/es/tntd-cascader/AntdCascader/component/DisabledContext.js +9 -5
- package/es/tntd-cascader/AntdCascader/component/FormItemInputContext.js +1 -2
- package/es/tntd-cascader/AntdCascader/component/SizeContext.js +1 -2
- package/es/tntd-cascader/AntdCascader/component/context.js +5 -7
- package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +22 -10
- package/es/tntd-cascader/AntdCascader/component/getIcons.js +71 -50
- package/es/tntd-cascader/AntdCascader/component/getIcons.js.map +1 -1
- package/es/tntd-cascader/AntdCascader/component/useCompactItemContext.js +22 -20
- package/es/tntd-cascader/AntdCascader/config/utils.js +17 -18
- package/es/tntd-cascader/AntdCascader/config/warning.js +9 -10
- package/es/tntd-cascader/AntdCascader/index.js +188 -118
- package/es/tntd-cascader/AntdCascader/index.js.map +1 -1
- package/es/tntd-cascader/AntdCascader/interface.js +1 -2
- package/es/tntd-cascader/index.js +1 -2
- package/es/tntd-cascader/rc-cascader/Cascader.js +256 -239
- package/es/tntd-cascader/rc-cascader/OptionList/Checkbox.js +21 -11
- package/es/tntd-cascader/rc-cascader/OptionList/Column.js +175 -116
- package/es/tntd-cascader/rc-cascader/OptionList/index.js +179 -128
- package/es/tntd-cascader/rc-cascader/OptionList/useActive.js +21 -19
- package/es/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +144 -137
- package/es/tntd-cascader/rc-cascader/context.js +1 -2
- package/es/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +44 -37
- package/es/tntd-cascader/rc-cascader/hooks/useEntities.js +25 -24
- package/es/tntd-cascader/rc-cascader/hooks/useMissingValues.js +15 -17
- package/es/tntd-cascader/rc-cascader/hooks/useRefFunc.js +7 -8
- package/es/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +20 -21
- package/es/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +51 -41
- package/es/tntd-cascader/rc-cascader/index.js +1 -2
- package/es/tntd-cascader/rc-cascader/utils/commonUtil.js +33 -27
- package/es/tntd-cascader/rc-cascader/utils/treeUtil.js +29 -32
- package/es/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +26 -23
- package/es/tntd-form/ErrorList.js +75 -41
- package/es/tntd-form/Form.js +118 -97
- package/es/tntd-form/FormItem/ItemHolder.js +126 -117
- package/es/tntd-form/FormItem/index.js +232 -206
- package/es/tntd-form/FormItemInput.js +72 -31
- package/es/tntd-form/FormItemLabel.js +87 -62
- package/es/tntd-form/FormList.js +33 -27
- package/es/tntd-form/context.js +29 -24
- package/es/tntd-form/hooks/useDebounce.js +11 -12
- package/es/tntd-form/hooks/useForm.js +33 -28
- package/es/tntd-form/hooks/useFormInstance.js +5 -4
- package/es/tntd-form/hooks/useFormItemStatus.js +8 -5
- package/es/tntd-form/hooks/useFrameState.js +32 -33
- package/es/tntd-form/hooks/useItemRef.js +15 -14
- package/es/tntd-form/index.js +1 -2
- package/es/tntd-form/interface.js +1 -2
- package/es/tntd-form/style/index.js +1 -2
- package/es/tntd-form/util.js +10 -13
- package/es/tntd-form/validateMessagesContext.js +1 -2
- package/es/tntd-icon/fonts/iconfont.js +36 -53
- package/es/tntd-icon/index.js +23 -17
- package/es/tntd-layout/ActionsContext.js +1 -2
- package/es/tntd-layout/AppList.js +135 -77
- package/es/tntd-layout/Application.js +42 -29
- package/es/tntd-layout/Avatar.js +80 -42
- package/es/tntd-layout/CompatibleLanguage.js +93 -56
- package/es/tntd-layout/EnterpriseLayout/Avatar.js +93 -47
- package/es/tntd-layout/EnterpriseLayout/Language.js +56 -34
- package/es/tntd-layout/EnterpriseLayout/Theme.js +45 -24
- package/es/tntd-layout/EnterpriseLayout/index.js +17 -9
- package/es/tntd-layout/GlobalNavigation/NavigationPopup.js +212 -153
- package/es/tntd-layout/GlobalNavigation/index.js +84 -50
- package/es/tntd-layout/Header.js +59 -26
- package/es/tntd-layout/HeaderActions.js +84 -34
- package/es/tntd-layout/HeaderNavs.js +46 -35
- package/es/tntd-layout/HeaderTabs.js +176 -140
- package/es/tntd-layout/Iconfont.js +1 -2
- package/es/tntd-layout/Language.js +55 -33
- package/es/tntd-layout/Layout.js +176 -78
- package/es/tntd-layout/Logo.js +52 -40
- package/es/tntd-layout/OrgAppList.js +208 -139
- package/es/tntd-layout/SideMenu.js +230 -160
- package/es/tntd-layout/Theme.js +47 -29
- package/es/tntd-layout/createActions.js +28 -29
- package/es/tntd-layout/images/index.js +31 -32
- package/es/tntd-layout/index.js +91 -60
- package/es/tntd-layout/paaslayout/CompactSideMenu.js +109 -65
- package/es/tntd-layout/paaslayout/Header.js +37 -14
- package/es/tntd-layout/paaslayout/Logo.js +2 -3
- package/es/tntd-layout/paaslayout/SideMenu.js +109 -63
- package/es/tntd-layout/paaslayout/index.js +159 -79
- package/es/tntd-layout/storage.js +18 -11
- package/es/tntd-modal/index.js +73 -32
- package/es/tntd-rc-select/_util/DisabledContext.js +9 -5
- package/es/tntd-rc-select/_util/FormItemInputContext.js +1 -2
- package/es/tntd-rc-select/_util/PurePanel.js +59 -48
- package/es/tntd-rc-select/_util/SizeContext.js +1 -2
- package/es/tntd-rc-select/_util/context.js +5 -7
- package/es/tntd-rc-select/_util/defaultRenderEmpty.js +21 -10
- package/es/tntd-rc-select/_util/getIcons.js +71 -50
- package/es/tntd-rc-select/_util/getIcons.js.map +1 -1
- package/es/tntd-rc-select/_util/interface.js +1 -2
- package/es/tntd-rc-select/_util/motion.js +36 -27
- package/es/tntd-rc-select/_util/type.js +1 -2
- package/es/tntd-rc-select/_util/useCompactItemContext.js +22 -20
- package/es/tntd-rc-select/_util/warning.js +9 -10
- package/es/tntd-rc-select/index.js +131 -76
- package/es/tntd-second-page/index.js +47 -24
- package/es/tntd-select/DropDownWrap.js +73 -52
- package/es/tntd-select/index.js +593 -507
- package/es/tntd-select/index.js.map +1 -1
- package/es/tntd-select/index.less +7 -0
- package/es/tooltip/index.js +1 -2
- package/es/tooltip/index.less +5 -0
- package/es/tooltip/style/index.js +1 -2
- package/es/tooltip/tooltip.js +24 -19
- package/es/tooltip/tooltip.js.map +1 -1
- package/es/transfer/index.js +1 -2
- package/es/transfer/style/index.js +1 -2
- package/es/tree/index.js +1 -2
- package/es/tree/style/index.js +1 -2
- package/es/tree-select/index.js +1 -2
- package/es/tree-select/style/index.js +1 -2
- package/es/typography/index.js +1 -2
- package/es/typography/style/index.js +1 -2
- package/es/upload/index.js +4 -3
- package/es/upload/style/index.js +1 -2
- package/es/utils/checkAuth.js +24 -21
- package/es/utils/findMenuInfoByPath.js +33 -30
- package/es/utils/index.js +71 -65
- package/es/utils/lang.js +68 -115
- package/es/utils/simple-template.js +2 -3
- package/es/version/index.js +1 -2
- package/es/version/style/index.js +1 -2
- package/es/water-mark/index.js +98 -87
- package/lib/_util/context.js +15 -16
- package/lib/_util/defaultRenderEmpty.js +34 -39
- package/lib/_util/defaultRenderEmpty.js.map +1 -1
- package/lib/_util/hooks/useFlexGapSupport.js +25 -33
- package/lib/_util/hooks/useForceUpdate.js +21 -29
- package/lib/_util/motion.js +50 -36
- package/lib/_util/reactNode.js +19 -37
- package/lib/_util/responsiveObserve.js +67 -58
- package/lib/_util/styleChecker.js +37 -32
- package/lib/_util/type.js +16 -6
- package/lib/_util/warning.js +17 -30
- package/lib/actions/index.js +30 -14
- package/lib/affix/index.d.ts +2 -2
- package/lib/affix/index.js +21 -21
- package/lib/affix/index.js.map +1 -1
- package/lib/affix/style/index.js +2 -3
- package/lib/alert/alert.d.ts +3 -3
- package/lib/alert/alert.d.ts.map +1 -1
- package/lib/alert/alert.js +79 -76
- package/lib/alert/alert.js.map +1 -1
- package/lib/alert/index.d.ts +1 -1
- package/lib/alert/index.js +21 -22
- package/lib/alert/index.js.map +1 -1
- package/lib/alert/style/index.js +2 -3
- package/lib/anchor/index.d.ts +2 -2
- package/lib/anchor/index.js +21 -21
- package/lib/anchor/index.js.map +1 -1
- package/lib/anchor/style/index.js +2 -4
- package/lib/array-input/1.png +1 -0
- package/lib/array-input/111.gif +0 -0
- package/lib/array-input/icon.js +31 -12
- package/lib/array-input/index.js +252 -150
- package/lib/auth-context/index.js +9 -4
- package/lib/auto-complete/index.d.ts +2 -2
- package/lib/auto-complete/index.js +21 -21
- package/lib/auto-complete/index.js.map +1 -1
- package/lib/auto-complete/style/index.js +2 -4
- package/lib/avatar/index.d.ts +2 -2
- package/lib/avatar/index.js +21 -21
- package/lib/avatar/index.js.map +1 -1
- package/lib/avatar/style/index.js +2 -3
- package/lib/back-top/index.d.ts +2 -2
- package/lib/back-top/index.js +21 -21
- package/lib/back-top/index.js.map +1 -1
- package/lib/back-top/style/index.js +2 -3
- package/lib/badge/index.d.ts +2 -2
- package/lib/badge/index.js +21 -21
- package/lib/badge/index.js.map +1 -1
- package/lib/badge/style/index.js +2 -3
- package/lib/breadcrumb/index.d.ts +2 -2
- package/lib/breadcrumb/index.js +21 -21
- package/lib/breadcrumb/index.js.map +1 -1
- package/lib/breadcrumb/style/index.js +2 -3
- package/lib/breadcrumb/style/index.less +2 -1
- package/lib/button/button.d.ts +3 -3
- package/lib/button/button.js +81 -69
- package/lib/button/button.js.map +1 -1
- package/lib/button/button.less +17 -12
- package/lib/button/index.js +19 -19
- package/lib/button/style/index.js +2 -3
- package/lib/calendar/index.d.ts +2 -2
- package/lib/calendar/index.js +21 -21
- package/lib/calendar/index.js.map +1 -1
- package/lib/calendar/style/index.js +2 -4
- package/lib/card/card.d.ts +3 -3
- package/lib/card/card.js +42 -51
- package/lib/card/card.js.map +1 -1
- package/lib/card/index.js +19 -19
- package/lib/card/style/index.js +2 -4
- package/lib/carousel/index.d.ts +2 -2
- package/lib/carousel/index.js +21 -21
- package/lib/carousel/index.js.map +1 -1
- package/lib/carousel/style/index.js +2 -3
- package/lib/cascader/cascader.d.ts +10 -0
- package/lib/cascader/cascader.d.ts.map +1 -0
- package/lib/cascader/cascader.js +49 -0
- package/lib/cascader/cascader.js.map +1 -0
- package/lib/cascader/cascader.less +16 -0
- package/lib/cascader/index.d.ts +3 -7
- package/lib/cascader/index.d.ts.map +1 -1
- package/lib/cascader/index.js +22 -26
- package/lib/cascader/index.js.map +1 -1
- package/lib/cascader/style/index.js +2 -4
- package/lib/cascader/style/index.less +2 -2
- package/lib/check-card/group.js +224 -172
- package/lib/check-card/index.js +166 -141
- package/lib/check-card/index.js.map +1 -1
- package/lib/checkbox/check.png +0 -0
- package/lib/checkbox/checkbox.d.ts +3 -3
- package/lib/checkbox/checkbox.d.ts.map +1 -1
- package/lib/checkbox/checkbox.js +58 -61
- package/lib/checkbox/checkbox.js.map +1 -1
- package/lib/checkbox/index.js +21 -21
- package/lib/checkbox/style/index.js +2 -3
- package/lib/col/index.d.ts +2 -2
- package/lib/col/index.js +21 -21
- package/lib/col/index.js.map +1 -1
- package/lib/col/style/index.js +2 -5
- package/lib/collapse/collapse.less +3 -3
- package/lib/collapse/index.d.ts +2 -2
- package/lib/collapse/index.js +23 -23
- package/lib/collapse/index.js.map +1 -1
- package/lib/collapse/style/index.js +2 -3
- package/lib/collapse/style/index.less +2 -1
- package/lib/color-picker/ColorPicker.d.ts.map +1 -1
- package/lib/color-picker/ColorPicker.js +152 -114
- package/lib/color-picker/ColorPicker.js.map +1 -1
- package/lib/color-picker/index.js +18 -14
- package/lib/color-picker/index.js.map +1 -1
- package/lib/columns/index.js +78 -42
- package/lib/columns/style/index.js +1 -2
- package/lib/comment/index.d.ts +2 -2
- package/lib/comment/index.js +21 -21
- package/lib/comment/index.js.map +1 -1
- package/lib/comment/style/index.js +2 -3
- package/lib/config-provider/DisabledContext.js +17 -32
- package/lib/config-provider/SizeContext.js +18 -29
- package/lib/config-provider/config-provider.d.ts +1 -1
- package/lib/config-provider/config-provider.js +12 -8
- package/lib/config-provider/config-provider.js.map +1 -1
- package/lib/config-provider/index.d.ts +3 -3
- package/lib/config-provider/index.js +34 -23
- package/lib/config-provider/index.js.map +1 -1
- package/lib/config-provider/style/index.js +2 -3
- package/lib/connect/index.js +41 -29
- package/lib/date-picker/DatePicker.d.ts +3 -3
- package/lib/date-picker/DatePicker.js +122 -71
- package/lib/date-picker/DatePicker.js.map +1 -1
- package/lib/date-picker/index.d.ts +1 -1
- package/lib/date-picker/index.js +14 -12
- package/lib/date-picker/index.js.map +1 -1
- package/lib/date-picker/style/Picker.less +2 -1
- package/lib/date-picker/style/index.js +2 -5
- package/lib/descriptions/descriptions.d.ts +4 -4
- package/lib/descriptions/descriptions.js +117 -89
- package/lib/descriptions/descriptions.js.map +1 -1
- package/lib/descriptions/index.js +22 -22
- package/lib/descriptions/index.js.map +1 -1
- package/lib/descriptions/style/index.js +2 -3
- package/lib/development-login/LoginModal.js +110 -80
- package/lib/development-login/index.js +42 -34
- package/lib/divider/index.d.ts +2 -2
- package/lib/divider/index.js +21 -21
- package/lib/divider/index.js.map +1 -1
- package/lib/divider/style/index.js +2 -3
- package/lib/drawer/drawer.d.ts +5 -2
- package/lib/drawer/drawer.d.ts.map +1 -1
- package/lib/drawer/drawer.js +132 -90
- package/lib/drawer/drawer.js.map +1 -1
- package/lib/drawer/index.d.ts +1 -1
- package/lib/drawer/index.js +20 -19
- package/lib/drawer/index.js.map +1 -1
- package/lib/drawer/index.less +5 -2
- package/lib/drawer/style/index.js +2 -4
- package/lib/dropdown/index.d.ts +2 -2
- package/lib/dropdown/index.js +21 -21
- package/lib/dropdown/index.js.map +1 -1
- package/lib/dropdown/style/index.js +2 -4
- package/lib/dropdown/style/index.less +2 -1
- package/lib/ellipsis/Svg/CopySVG.js +70 -21
- package/lib/ellipsis/Svg/TickSVG.js +48 -16
- package/lib/ellipsis/index.js +178 -137
- package/lib/empty/empty.d.ts +2 -2
- package/lib/empty/empty.js +86 -75
- package/lib/empty/empty.js.map +1 -1
- package/lib/empty/empty.stories.js +18 -19
- package/lib/empty/index.js +19 -19
- package/lib/empty/style/index.js +2 -3
- package/lib/exception/exception.js +45 -31
- package/lib/exception/exception.js.map +1 -1
- package/lib/exception/index.js +18 -18
- package/lib/form/form.d.ts +4 -4
- package/lib/form/form.js +90 -83
- package/lib/form/form.js.map +1 -1
- package/lib/form/index.js +19 -19
- package/lib/form/style/index.js +2 -4
- package/lib/grid/index.d.ts +2 -2
- package/lib/grid/index.js +21 -21
- package/lib/grid/index.js.map +1 -1
- package/lib/grid/style/index.js +2 -3
- package/lib/grid-v4/RowContext.js +8 -5
- package/lib/grid-v4/col.js +90 -96
- package/lib/grid-v4/hooks/useBreakpoint.js +26 -22
- package/lib/grid-v4/index.js +25 -15
- package/lib/grid-v4/row.js +172 -158
- package/lib/grid-v4/style/index.js +2 -4
- package/lib/handle/index.d.ts.map +1 -1
- package/lib/handle/index.js +169 -126
- package/lib/handle/index.js.map +1 -1
- package/lib/handle/index.less +16 -0
- package/lib/icon/IconFont.js +56 -77
- package/lib/icon/components/Icon.js +128 -98
- package/lib/icon/components/index.js +12 -8
- package/lib/icon/components/utils.js +100 -94
- package/lib/icon/index.d.ts +1 -1
- package/lib/icon/index.d.ts.map +1 -1
- package/lib/icon/index.js +116 -118
- package/lib/icon/index.js.map +1 -1
- package/lib/icon/style/index.d.ts +1 -0
- package/lib/icon/style/index.d.ts.map +1 -1
- package/lib/icon/style/index.js +2 -2
- package/lib/icon/style/index.js.map +1 -1
- package/lib/icon/style/style.less +3 -1
- package/lib/icon/twoTonePrimaryColor.js +14 -15
- package/lib/icon/utils.js +63 -68
- package/lib/icon-list/index.js +6 -121
- package/lib/icon-old/index.d.ts +2 -2
- package/lib/icon-old/index.js +21 -21
- package/lib/icon-old/index.js.map +1 -1
- package/lib/icon-old/style/index.js +2 -3
- package/lib/img/Contain.js +67 -45
- package/lib/img/Cover.js +115 -79
- package/lib/img/index.js +72 -61
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +697 -203
- package/lib/index.js.map +1 -1
- package/lib/input/index.js +18 -18
- package/lib/input/input.d.ts +5 -5
- package/lib/input/input.js +87 -91
- package/lib/input/input.js.map +1 -1
- package/lib/input/style/index.js +2 -4
- package/lib/input/style/mixin.less +1 -2
- package/lib/input-number/index.js +21 -21
- package/lib/input-number/inputNumber.d.ts +3 -3
- package/lib/input-number/inputNumber.js +42 -52
- package/lib/input-number/inputNumber.js.map +1 -1
- package/lib/input-number/style/index.js +2 -3
- package/lib/label/index.d.ts +2 -2
- package/lib/label/index.js +128 -138
- package/lib/label/index.js.map +1 -1
- package/lib/layout/index.d.ts +2 -2
- package/lib/layout/index.js +21 -21
- package/lib/layout/index.js.map +1 -1
- package/lib/layout/style/index.js +2 -3
- package/lib/list/index.d.ts +2 -2
- package/lib/list/index.js +21 -21
- package/lib/list/index.js.map +1 -1
- package/lib/list/style/index.js +2 -4
- package/lib/loading-button/index.js +56 -56
- package/lib/locale/default.d.ts +3 -0
- package/lib/locale/default.d.ts.map +1 -1
- package/lib/locale/default.js +11 -10
- package/lib/locale/default.js.map +1 -1
- package/lib/locale/en_US.d.ts +3 -0
- package/lib/locale/en_US.d.ts.map +1 -1
- package/lib/locale/en_US.js +63 -58
- package/lib/locale/en_US.js.map +1 -1
- package/lib/locale/index.js +36 -18
- package/lib/locale/zh_CN.d.ts +3 -0
- package/lib/locale/zh_CN.d.ts.map +1 -1
- package/lib/locale/zh_CN.js +55 -51
- package/lib/locale/zh_CN.js.map +1 -1
- package/lib/locale-provider/index.d.ts +2 -2
- package/lib/locale-provider/index.js +25 -25
- package/lib/locale-provider/index.js.map +1 -1
- package/lib/locale-provider/style/index.js +2 -3
- package/lib/mentions/index.d.ts +2 -2
- package/lib/mentions/index.js +21 -21
- package/lib/mentions/index.js.map +1 -1
- package/lib/mentions/style/index.js +2 -4
- package/lib/menu/index.d.ts +2 -2
- package/lib/menu/index.js +21 -21
- package/lib/menu/index.js.map +1 -1
- package/lib/menu/style/index.js +2 -5
- package/lib/message/index.d.ts +2 -2
- package/lib/message/index.js +21 -21
- package/lib/message/index.js.map +1 -1
- package/lib/message/style/index.js +2 -3
- package/lib/modal/index.js +20 -20
- package/lib/modal/index.js.map +1 -1
- package/lib/modal/modal.d.ts +4 -4
- package/lib/modal/modal.js +167 -99
- package/lib/modal/modal.js.map +1 -1
- package/lib/modal/style/confirm.less +7 -7
- package/lib/modal/style/index.js +2 -4
- package/lib/modal/style/modal.less +5 -1
- package/lib/notification/assets/index.js +19 -10
- package/lib/notification/assets/svg-error-tip.js +150 -56
- package/lib/notification/assets/svg-success-tip.js +167 -60
- package/lib/notification/index.d.ts +1 -1
- package/lib/notification/index.js +21 -22
- package/lib/notification/index.js.map +1 -1
- package/lib/notification/notification.d.ts +2 -2
- package/lib/notification/notification.js +102 -40
- package/lib/notification/notification.js.map +1 -1
- package/lib/notification/style/index.js +2 -3
- package/lib/notification/style/index.less +4 -2
- package/lib/page/Box.js +63 -40
- package/lib/page/index.js +143 -95
- package/lib/page/utils.js +21 -18
- package/lib/page-container/index.d.ts +4 -0
- package/lib/page-container/index.d.ts.map +1 -0
- package/lib/page-container/index.js +22 -0
- package/lib/page-container/index.js.map +1 -0
- package/lib/page-container/index.less +38 -0
- package/lib/page-header/index.d.ts +2 -2
- package/lib/page-header/index.js +21 -21
- package/lib/page-header/index.js.map +1 -1
- package/lib/page-header/style/index.js +2 -4
- package/lib/page-loading/index.d.ts +4 -0
- package/lib/page-loading/index.d.ts.map +1 -0
- package/lib/page-loading/index.js +34 -0
- package/lib/page-loading/index.js.map +1 -0
- package/lib/page-loading/index.less +38 -0
- package/lib/page-loading/loading.gif +0 -0
- package/lib/pagination/index.d.ts +2 -2
- package/lib/pagination/index.js +21 -21
- package/lib/pagination/index.js.map +1 -1
- package/lib/pagination/style/index.js +2 -4
- package/lib/popconfirm/index.js +21 -21
- package/lib/popconfirm/index.less +10 -4
- package/lib/popconfirm/popconfirm.d.ts +5 -3
- package/lib/popconfirm/popconfirm.d.ts.map +1 -1
- package/lib/popconfirm/popconfirm.js +57 -45
- package/lib/popconfirm/popconfirm.js.map +1 -1
- package/lib/popconfirm/style/index.js +2 -5
- package/lib/popover/index.js +22 -22
- package/lib/popover/index.less +6 -0
- package/lib/popover/popover.d.ts +3 -2
- package/lib/popover/popover.d.ts.map +1 -1
- package/lib/popover/popover.js +50 -42
- package/lib/popover/popover.js.map +1 -1
- package/lib/popover/style/index.js +2 -5
- package/lib/popover/style/index.less +2 -1
- package/lib/prev-locale.js +65 -56
- package/lib/preview-text/index.d.ts +5 -5
- package/lib/preview-text/index.js +261 -209
- package/lib/preview-text/index.js.map +1 -1
- package/lib/progress/index.js +21 -21
- package/lib/progress/progress.d.ts +2 -2
- package/lib/progress/progress.js +141 -100
- package/lib/progress/progress.js.map +1 -1
- package/lib/progress/style/index.js +2 -3
- package/lib/query-form/Field/Checkbox.js +26 -23
- package/lib/query-form/Field/Checkbox.js.map +1 -1
- package/lib/query-form/Field/Composition/FieldPopover.d.ts +7 -5
- package/lib/query-form/Field/Composition/FieldPopover.d.ts.map +1 -1
- package/lib/query-form/Field/Composition/FieldPopover.js +351 -224
- package/lib/query-form/Field/Composition/FieldPopover.js.map +1 -1
- package/lib/query-form/Field/Composition/Select.d.ts.map +1 -1
- package/lib/query-form/Field/Composition/Select.js +127 -99
- package/lib/query-form/Field/Composition/Select.js.map +1 -1
- package/lib/query-form/Field/Composition/index.d.ts +1 -5
- package/lib/query-form/Field/Composition/index.js +236 -238
- package/lib/query-form/Field/Composition/index.js.map +1 -1
- package/lib/query-form/Field/Composition/index.less +13 -6
- package/lib/query-form/Field/Composition/utils.d.ts +16 -0
- package/lib/query-form/Field/Composition/utils.d.ts.map +1 -1
- package/lib/query-form/Field/Composition/utils.js +135 -19
- package/lib/query-form/Field/Composition/utils.js.map +1 -1
- package/lib/query-form/Field/Select.js +77 -69
- package/lib/query-form/Field/SelectInput.d.ts.map +1 -1
- package/lib/query-form/Field/SelectInput.js +97 -74
- package/lib/query-form/Field/SelectInput.js.map +1 -1
- package/lib/query-form/Field/fieldsMap.d.ts +8 -5
- package/lib/query-form/Field/fieldsMap.js +33 -34
- package/lib/query-form/Field/fieldsMap.js.map +1 -1
- package/lib/query-form/Field/index.d.ts.map +1 -1
- package/lib/query-form/Field/index.js +139 -96
- package/lib/query-form/Field/index.js.map +1 -1
- package/lib/query-form/createActions.js +53 -51
- package/lib/query-form/index.d.ts +15 -24
- package/lib/query-form/index.d.ts.map +1 -1
- package/lib/query-form/index.js +193 -276
- package/lib/query-form/index.js.map +1 -1
- package/lib/query-form/index.less +16 -56
- package/lib/query-form/useForm.js +11 -11
- package/lib/query-form2/Field/Checkbox.d.ts +8 -0
- package/lib/query-form2/Field/Checkbox.d.ts.map +1 -0
- package/lib/query-form2/Field/Checkbox.js +28 -0
- package/lib/query-form2/Field/Checkbox.js.map +1 -0
- package/lib/query-form2/Field/Composition/FieldPopover.d.ts +19 -0
- package/lib/query-form2/Field/Composition/FieldPopover.d.ts.map +1 -0
- package/lib/query-form2/Field/Composition/FieldPopover.js +347 -0
- package/lib/query-form2/Field/Composition/FieldPopover.js.map +1 -0
- package/lib/query-form2/Field/Composition/FieldPopover.less +35 -0
- package/lib/query-form2/Field/Composition/Select.d.ts +4 -0
- package/lib/query-form2/Field/Composition/Select.d.ts.map +1 -0
- package/lib/query-form2/Field/Composition/Select.js +128 -0
- package/lib/query-form2/Field/Composition/Select.js.map +1 -0
- package/lib/query-form2/Field/Composition/index.d.ts +14 -0
- package/lib/query-form2/Field/Composition/index.d.ts.map +1 -0
- package/lib/query-form2/Field/Composition/index.js +349 -0
- package/lib/query-form2/Field/Composition/index.js.map +1 -0
- package/lib/query-form2/Field/Composition/index.less +114 -0
- package/lib/query-form2/Field/Composition/utils.d.ts +6 -0
- package/lib/query-form2/Field/Composition/utils.d.ts.map +1 -0
- package/lib/query-form2/Field/Composition/utils.js +27 -0
- package/lib/query-form2/Field/Composition/utils.js.map +1 -0
- package/lib/query-form2/Field/Select.d.ts +4 -0
- package/lib/query-form2/Field/Select.d.ts.map +1 -0
- package/lib/query-form2/Field/Select.js +80 -0
- package/lib/query-form2/Field/Select.js.map +1 -0
- package/lib/query-form2/Field/SelectInput.d.ts +4 -0
- package/lib/query-form2/Field/SelectInput.d.ts.map +1 -0
- package/lib/query-form2/Field/SelectInput.js +100 -0
- package/lib/query-form2/Field/SelectInput.js.map +1 -0
- package/lib/query-form2/Field/fieldsMap.d.ts +27 -0
- package/lib/query-form2/Field/fieldsMap.d.ts.map +1 -0
- package/lib/query-form2/Field/fieldsMap.js +35 -0
- package/lib/query-form2/Field/fieldsMap.js.map +1 -0
- package/lib/query-form2/Field/index.d.ts +14 -0
- package/lib/query-form2/Field/index.d.ts.map +1 -0
- package/lib/query-form2/Field/index.js +147 -0
- package/lib/query-form2/Field/index.js.map +1 -0
- package/lib/query-form2/createActions.d.ts +14 -0
- package/lib/query-form2/createActions.d.ts.map +1 -0
- package/lib/query-form2/createActions.js +54 -0
- package/lib/query-form2/createActions.js.map +1 -0
- package/lib/query-form2/index.d.ts +36 -0
- package/lib/query-form2/index.d.ts.map +1 -0
- package/lib/query-form2/index.js +385 -0
- package/lib/query-form2/index.js.map +1 -0
- package/lib/query-form2/index.less +136 -0
- package/lib/query-form2/useForm.d.ts +13 -0
- package/lib/query-form2/useForm.d.ts.map +1 -0
- package/lib/query-form2/useForm.js +13 -0
- package/lib/query-form2/useForm.js.map +1 -0
- package/lib/query-list-scene/List.js +355 -289
- package/lib/query-list-scene/QueryForm.js +155 -103
- package/lib/query-list-scene/QueryForm.js.map +1 -1
- package/lib/query-list-scene/QueryListScene.js +62 -31
- package/lib/query-list-scene/Title.js +14 -9
- package/lib/query-list-scene/Toolbar.js +29 -21
- package/lib/query-list-scene/createActions.js +79 -65
- package/lib/query-list-scene/index.js +24 -24
- package/lib/query-list-scene/index.less +3 -3
- package/lib/query-list-scene/useActions.js +11 -11
- package/lib/radio/index.js +21 -21
- package/lib/radio/radio.d.ts +3 -3
- package/lib/radio/radio.d.ts.map +1 -1
- package/lib/radio/radio.js +60 -62
- package/lib/radio/radio.js.map +1 -1
- package/lib/radio/style/index.js +2 -3
- package/lib/rate/index.d.ts +2 -2
- package/lib/rate/index.js +21 -21
- package/lib/rate/index.js.map +1 -1
- package/lib/rate/style/index.js +2 -4
- package/lib/render-empty/index.js +7 -4
- package/lib/render-empty/render-empty.js +27 -22
- package/lib/render-empty/render-empty.js.map +1 -1
- package/lib/result/index.d.ts +2 -2
- package/lib/result/index.js +21 -21
- package/lib/result/index.js.map +1 -1
- package/lib/result/style/index.js +2 -3
- package/lib/row/index.d.ts +2 -2
- package/lib/row/index.js +21 -21
- package/lib/row/index.js.map +1 -1
- package/lib/row/style/index.js +2 -5
- package/lib/segmented/index.js +67 -69
- package/lib/select/index.d.ts +1 -1
- package/lib/select/index.js +20 -19
- package/lib/select/index.js.map +1 -1
- package/lib/select/select.d.ts +2 -2
- package/lib/select/select.js +56 -65
- package/lib/select/select.js.map +1 -1
- package/lib/select/select.less +4 -1
- package/lib/select/style/index.js +2 -4
- package/lib/select/style/index.less +2 -1
- package/lib/skeleton/index.d.ts +2 -2
- package/lib/skeleton/index.js +21 -21
- package/lib/skeleton/index.js.map +1 -1
- package/lib/skeleton/style/index.js +2 -3
- package/lib/slider/index.d.ts +2 -2
- package/lib/slider/index.js +21 -21
- package/lib/slider/index.js.map +1 -1
- package/lib/slider/style/index.js +2 -4
- package/lib/spin/index.d.ts +2 -2
- package/lib/spin/index.js +21 -21
- package/lib/spin/index.js.map +1 -1
- package/lib/spin/style/index.js +2 -3
- package/lib/statistic/index.d.ts +2 -2
- package/lib/statistic/index.js +21 -21
- package/lib/statistic/index.js.map +1 -1
- package/lib/statistic/style/index.js +2 -3
- package/lib/steps/index.js +20 -20
- package/lib/steps/steps.d.ts +3 -3
- package/lib/steps/steps.js +98 -70
- package/lib/steps/steps.js.map +1 -1
- package/lib/steps/style/index.js +2 -11
- package/lib/style/index.js +2 -3
- package/lib/style/mixins/iconfont.less +3 -2
- package/lib/style/themes/default.less +7 -6
- package/lib/style/v2-compatible-reset.js +2 -3
- package/lib/svg-components/illustration-403.js +216 -84
- package/lib/svg-components/illustration-404.js +300 -101
- package/lib/svg-components/illustration-500.js +331 -109
- package/lib/svg-components/illustration-empty.js +64 -41
- package/lib/svg-components/illustration-failure.js +122 -62
- package/lib/svg-components/illustration-no-access.js +124 -61
- package/lib/svg-components/illustration-no-chart.js +144 -63
- package/lib/svg-components/illustration-no-result.js +102 -58
- package/lib/svg-components/illustration-offline.js +141 -69
- package/lib/svg-components/illustration-success.js +147 -69
- package/lib/svg-components/index.js +75 -26
- package/lib/switch/index.js +21 -21
- package/lib/switch/style/index.js +2 -3
- package/lib/switch/switch.d.ts +3 -3
- package/lib/switch/switch.js +65 -66
- package/lib/switch/switch.js.map +1 -1
- package/lib/table/assets/image-loading-background.js +55 -43
- package/lib/table/assets/image-loading.js +36 -31
- package/lib/table/constants.js +5 -3
- package/lib/table/context.js +6 -4
- package/lib/table/hooks/index.js +14 -16
- package/lib/table/hooks/use-column-setting.d.ts +1 -1
- package/lib/table/hooks/use-column-setting.js +37 -21
- package/lib/table/hooks/use-column-setting.js.map +1 -1
- package/lib/table/index.js +19 -19
- package/lib/table/style/index.js +2 -5
- package/lib/table/style/index.less +34 -12
- package/lib/table/style/size.less +4 -4
- package/lib/table/table.d.ts +3 -3
- package/lib/table/table.js +224 -201
- package/lib/table/table.js.map +1 -1
- package/lib/table/table.less +2 -1
- package/lib/table/table.stories.js +177 -154
- package/lib/table/total-shower.d.ts +2 -2
- package/lib/table/total-shower.js +14 -11
- package/lib/table/total-shower.js.map +1 -1
- package/lib/table/utils.d.ts +1 -1
- package/lib/table/utils.js +24 -25
- package/lib/table/utils.js.map +1 -1
- package/lib/table-container/index.d.ts +3 -0
- package/lib/table-container/index.d.ts.map +1 -0
- package/lib/table-container/index.js +25 -0
- package/lib/table-container/index.js.map +1 -0
- package/lib/table-container/index.less +16 -0
- package/lib/tabs/index.js +19 -19
- package/lib/tabs/style/index.js +2 -3
- package/lib/tabs/tabPane.js +1 -2
- package/lib/tabs/tabs.d.ts +3 -3
- package/lib/tabs/tabs.js +81 -79
- package/lib/tabs/tabs.js.map +1 -1
- package/lib/tabs/tabs.less +23 -25
- package/lib/tabs-container/index.d.ts +4 -0
- package/lib/tabs-container/index.d.ts.map +1 -0
- package/lib/tabs-container/index.js +22 -0
- package/lib/tabs-container/index.js.map +1 -0
- package/lib/tabs-container/index.less +51 -0
- package/lib/tag/color.less +28 -18
- package/lib/tag/index.js +21 -21
- package/lib/tag/index.js.map +1 -1
- package/lib/tag/style/index.js +2 -3
- package/lib/tag/tag.d.ts +4 -4
- package/lib/tag/tag.js +161 -151
- package/lib/tag/tag.js.map +1 -1
- package/lib/tag/tag.less +41 -4
- package/lib/time-picker/TimePicker.d.ts +2 -2
- package/lib/time-picker/TimePicker.js +51 -43
- package/lib/time-picker/TimePicker.js.map +1 -1
- package/lib/time-picker/index.d.ts +1 -1
- package/lib/time-picker/index.js +10 -9
- package/lib/time-picker/style/index.js +2 -3
- package/lib/time-picker/style/index.less +2 -1
- package/lib/timeline/index.d.ts +2 -2
- package/lib/timeline/index.js +21 -21
- package/lib/timeline/index.js.map +1 -1
- package/lib/timeline/style/index.js +2 -3
- package/lib/timeline/style/index.less +1 -1
- package/lib/title/index.js +41 -27
- package/lib/tntd-action/Action.js +81 -68
- package/lib/tntd-action/Action.js.map +1 -1
- package/lib/tntd-action/index.js +75 -84
- package/lib/tntd-action/index.js.map +1 -1
- package/lib/tntd-action/index.less +17 -0
- package/lib/tntd-cascader/AntdCascader/component/DisabledContext.js +17 -32
- package/lib/tntd-cascader/AntdCascader/component/FormItemInputContext.js +8 -26
- package/lib/tntd-cascader/AntdCascader/component/SizeContext.js +8 -26
- package/lib/tntd-cascader/AntdCascader/component/context.js +15 -16
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +35 -39
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js.map +1 -1
- package/lib/tntd-cascader/AntdCascader/component/getIcons.js +80 -75
- package/lib/tntd-cascader/AntdCascader/component/getIcons.js.map +1 -1
- package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +29 -51
- package/lib/tntd-cascader/AntdCascader/config/utils.js +27 -29
- package/lib/tntd-cascader/AntdCascader/config/warning.js +18 -35
- package/lib/tntd-cascader/AntdCascader/index.d.ts.map +1 -1
- package/lib/tntd-cascader/AntdCascader/index.js +212 -162
- package/lib/tntd-cascader/AntdCascader/index.js.map +1 -1
- package/lib/tntd-cascader/AntdCascader/interface.js +13 -7
- package/lib/tntd-cascader/img/no-data-s.png +0 -0
- package/lib/tntd-cascader/index.js +12 -8
- package/lib/tntd-cascader/rc-cascader/Cascader.js +322 -284
- package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +29 -41
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +196 -152
- package/lib/tntd-cascader/rc-cascader/OptionList/index.js +220 -163
- package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +39 -49
- package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +178 -167
- package/lib/tntd-cascader/rc-cascader/context.js +10 -27
- package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +62 -64
- package/lib/tntd-cascader/rc-cascader/hooks/useEntities.js +39 -50
- package/lib/tntd-cascader/rc-cascader/hooks/useMissingValues.js +26 -42
- package/lib/tntd-cascader/rc-cascader/hooks/useRefFunc.js +16 -33
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +30 -51
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +73 -66
- package/lib/tntd-cascader/rc-cascader/index.js +8 -7
- package/lib/tntd-cascader/rc-cascader/utils/commonUtil.js +46 -38
- package/lib/tntd-cascader/rc-cascader/utils/treeUtil.js +42 -39
- package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +33 -30
- package/lib/tntd-form/ErrorList.js +99 -77
- package/lib/tntd-form/Form.js +166 -139
- package/lib/tntd-form/FormItem/ItemHolder.js +151 -155
- package/lib/tntd-form/FormItem/index.js +287 -252
- package/lib/tntd-form/FormItemInput.js +87 -62
- package/lib/tntd-form/FormItemLabel.js +95 -94
- package/lib/tntd-form/FormList.js +49 -58
- package/lib/tntd-form/context.js +44 -61
- package/lib/tntd-form/hooks/useDebounce.js +28 -37
- package/lib/tntd-form/hooks/useForm.js +56 -57
- package/lib/tntd-form/hooks/useFormInstance.js +11 -8
- package/lib/tntd-form/hooks/useFormItemStatus.js +17 -13
- package/lib/tntd-form/hooks/useFrameState.js +52 -63
- package/lib/tntd-form/hooks/useItemRef.js +24 -41
- package/lib/tntd-form/index.js +23 -42
- package/lib/tntd-form/interface.js +6 -4
- package/lib/tntd-form/style/index.js +2 -4
- package/lib/tntd-form/util.js +18 -19
- package/lib/tntd-form/validateMessagesContext.js +7 -4
- package/lib/tntd-icon/fonts/iconfont.js +36 -53
- package/lib/tntd-icon/index.js +37 -25
- package/lib/tntd-layout/ActionsContext.js +7 -4
- package/lib/tntd-layout/AppList.js +173 -225
- package/lib/tntd-layout/Application.js +75 -112
- package/lib/tntd-layout/Avatar.js +100 -136
- package/lib/tntd-layout/CompatibleLanguage.js +128 -181
- package/lib/tntd-layout/EnterpriseLayout/Avatar.js +117 -147
- package/lib/tntd-layout/EnterpriseLayout/Language.js +72 -90
- package/lib/tntd-layout/EnterpriseLayout/Theme.js +69 -103
- package/lib/tntd-layout/EnterpriseLayout/index.js +27 -17
- package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +283 -277
- package/lib/tntd-layout/GlobalNavigation/index.js +108 -116
- package/lib/tntd-layout/Header.js +76 -132
- package/lib/tntd-layout/HeaderActions.js +105 -108
- package/lib/tntd-layout/HeaderNavs.js +74 -107
- package/lib/tntd-layout/HeaderTabs.js +220 -316
- package/lib/tntd-layout/Iconfont.js +11 -8
- package/lib/tntd-layout/Language.js +69 -77
- package/lib/tntd-layout/Layout.js +214 -172
- package/lib/tntd-layout/Logo.js +69 -141
- package/lib/tntd-layout/OrgAppList.js +238 -389
- package/lib/tntd-layout/SideMenu.js +267 -409
- package/lib/tntd-layout/Theme.js +75 -94
- package/lib/tntd-layout/createActions.js +45 -35
- package/lib/tntd-layout/images/avatar/empty.png +0 -0
- package/lib/tntd-layout/images/avatar/female1.png +0 -0
- package/lib/tntd-layout/images/avatar/female2.png +0 -0
- package/lib/tntd-layout/images/avatar/female3.png +0 -0
- package/lib/tntd-layout/images/avatar/female4.png +0 -0
- package/lib/tntd-layout/images/avatar/female5.png +0 -0
- package/lib/tntd-layout/images/avatar/female6.png +0 -0
- package/lib/tntd-layout/images/avatar/male1.png +0 -0
- package/lib/tntd-layout/images/avatar/male2.png +0 -0
- package/lib/tntd-layout/images/avatar/male3.png +0 -0
- package/lib/tntd-layout/images/avatar/male4.png +0 -0
- package/lib/tntd-layout/images/avatar/male5.png +0 -0
- package/lib/tntd-layout/images/avatar/male6.png +0 -0
- package/lib/tntd-layout/images/index.js +66 -67
- package/lib/tntd-layout/index.js +133 -96
- package/lib/tntd-layout/paaslayout/CompactSideMenu.js +131 -183
- package/lib/tntd-layout/paaslayout/Header.js +51 -76
- package/lib/tntd-layout/paaslayout/Logo.js +15 -27
- package/lib/tntd-layout/paaslayout/SideMenu.js +131 -148
- package/lib/tntd-layout/paaslayout/index.js +205 -142
- package/lib/tntd-layout/storage.js +61 -46
- package/lib/tntd-modal/index.js +94 -62
- package/lib/tntd-rc-select/_util/DisabledContext.js +17 -32
- package/lib/tntd-rc-select/_util/FormItemInputContext.js +8 -26
- package/lib/tntd-rc-select/_util/PurePanel.js +84 -78
- package/lib/tntd-rc-select/_util/SizeContext.js +8 -26
- package/lib/tntd-rc-select/_util/context.js +15 -16
- package/lib/tntd-rc-select/_util/defaultRenderEmpty.js +34 -39
- package/lib/tntd-rc-select/_util/defaultRenderEmpty.js.map +1 -1
- package/lib/tntd-rc-select/_util/getIcons.js +80 -75
- package/lib/tntd-rc-select/_util/getIcons.js.map +1 -1
- package/lib/tntd-rc-select/_util/interface.js +13 -7
- package/lib/tntd-rc-select/_util/motion.js +50 -36
- package/lib/tntd-rc-select/_util/type.js +16 -6
- package/lib/tntd-rc-select/_util/useCompactItemContext.js +29 -51
- package/lib/tntd-rc-select/_util/warning.js +18 -35
- package/lib/tntd-rc-select/img/no-data-s.png +0 -0
- package/lib/tntd-rc-select/index.js +149 -123
- package/lib/tntd-second-page/index.js +60 -33
- package/lib/tntd-second-page/index.js.map +1 -1
- package/lib/tntd-select/DropDownWrap.js +99 -78
- package/lib/tntd-select/index.d.ts +2 -2
- package/lib/tntd-select/index.d.ts.map +1 -1
- package/lib/tntd-select/index.js +633 -542
- package/lib/tntd-select/index.js.map +1 -1
- package/lib/tntd-select/index.less +7 -0
- package/lib/tooltip/index.js +22 -22
- package/lib/tooltip/index.less +5 -0
- package/lib/tooltip/style/index.js +2 -3
- package/lib/tooltip/tooltip.d.ts +3 -2
- package/lib/tooltip/tooltip.d.ts.map +1 -1
- package/lib/tooltip/tooltip.js +48 -42
- package/lib/tooltip/tooltip.js.map +1 -1
- package/lib/transfer/index.d.ts +2 -2
- package/lib/transfer/index.js +21 -21
- package/lib/transfer/index.js.map +1 -1
- package/lib/transfer/style/index.js +2 -4
- package/lib/tree/index.d.ts +2 -2
- package/lib/tree/index.js +21 -21
- package/lib/tree/index.js.map +1 -1
- package/lib/tree/style/index.js +2 -3
- package/lib/tree-select/index.d.ts +4 -4
- package/lib/tree-select/index.js +27 -26
- package/lib/tree-select/index.js.map +1 -1
- package/lib/tree-select/style/index.js +2 -5
- package/lib/typography/index.d.ts +2 -2
- package/lib/typography/index.js +21 -21
- package/lib/typography/index.js.map +1 -1
- package/lib/typography/style/index.js +2 -4
- package/lib/upload/index.d.ts +1 -1
- package/lib/upload/index.js +30 -25
- package/lib/upload/index.js.map +1 -1
- package/lib/upload/style/index.js +2 -4
- package/lib/utils/checkAuth.js +33 -24
- package/lib/utils/findMenuInfoByPath.js +40 -35
- package/lib/utils/index.js +147 -94
- package/lib/utils/lang.js +83 -129
- package/lib/utils/simple-template.js +11 -7
- package/lib/version/index.d.ts +2 -2
- package/lib/version/index.js +21 -21
- package/lib/version/index.js.map +1 -1
- package/lib/version/style/index.js +2 -4
- package/lib/water-mark/index.js +129 -118
- package/package.json +3 -4
- package/themes/common/css2.x.css +35 -0
- package/themes/common/css3.x.css +35 -0
- package/themes/default/colorsVar.less +1 -1
- package/themes/default/lessToCssVar.less +39 -0
- package/themes/default/lessVars2.x.less +4 -4
- package/themes/default/lessVars3.x.less +0 -2
- package/themes/default/variables.less +3 -3
- package/themes/default/variablesVar.less +7 -7
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
+
var _icon = _interopRequireDefault(require("../../../icon"));
|
|
10
|
+
var _utils = require("./utils");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
14
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
15
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
19
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
20
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
21
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
22
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
23
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
24
|
+
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
25
|
+
var t = {};
|
|
26
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
27
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
28
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
29
|
+
}
|
|
30
|
+
return t;
|
|
31
|
+
};
|
|
32
|
+
var _default = exports["default"] = function _default(props) {
|
|
33
|
+
var options = props.options,
|
|
34
|
+
params = props.params,
|
|
35
|
+
_props$queryKey = props.queryKey,
|
|
36
|
+
queryKey = _props$queryKey === void 0 ? 'name' : _props$queryKey,
|
|
37
|
+
_props$fieldNames = props.fieldNames,
|
|
38
|
+
fieldNames = _props$fieldNames === void 0 ? {
|
|
39
|
+
label: 'label',
|
|
40
|
+
value: 'value'
|
|
41
|
+
} : _props$fieldNames,
|
|
42
|
+
loadData = props.loadData,
|
|
43
|
+
onChange = props.onChange,
|
|
44
|
+
_value = props.value,
|
|
45
|
+
mode = props.mode,
|
|
46
|
+
propItem = props.propItem,
|
|
47
|
+
searchText = props.searchText,
|
|
48
|
+
rest = __rest(props, ["options", "params", "queryKey", "fieldNames", "loadData", "onChange", "value", "mode", "propItem", "searchText"]);
|
|
49
|
+
var _useState = (0, _react.useState)(options || []),
|
|
50
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
51
|
+
items = _useState2[0],
|
|
52
|
+
setItems = _useState2[1];
|
|
53
|
+
(0, _react.useEffect)(function () {
|
|
54
|
+
if (loadData) {
|
|
55
|
+
loadData(Object.assign(_defineProperty({}, queryKey, searchText), params || {})).then(function (items) {
|
|
56
|
+
setItems(items);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}, [params, searchText]);
|
|
60
|
+
(0, _react.useEffect)(function () {
|
|
61
|
+
setItems(options || []);
|
|
62
|
+
}, [options]);
|
|
63
|
+
var onValueChange = function onValueChange(item) {
|
|
64
|
+
onChange(item, mode === 'multiple' || mode === 'tags');
|
|
65
|
+
};
|
|
66
|
+
return _react["default"].createElement("ul", {
|
|
67
|
+
className: "ant-select-dropdown-menu"
|
|
68
|
+
}, items.map(function (item) {
|
|
69
|
+
var labelKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label) || 'label';
|
|
70
|
+
var valueKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value) || 'value';
|
|
71
|
+
var value = item instanceof Object ? item[valueKey] : item;
|
|
72
|
+
var label = item instanceof Object ? item[labelKey] : item + '';
|
|
73
|
+
var optionProps = item instanceof Object ? item : {};
|
|
74
|
+
var isSelected = _typeof(_value) === 'object' ? (_value === null || _value === void 0 ? void 0 : _value.indexOf(value)) > -1 : value === _value;
|
|
75
|
+
if (searchText) {
|
|
76
|
+
if ((label === null || label === void 0 ? void 0 : label.indexOf(searchText)) > -1) {
|
|
77
|
+
return _react["default"].createElement("li", {
|
|
78
|
+
className: (0, _classnames["default"])({
|
|
79
|
+
'ant-select-dropdown-menu-item': true,
|
|
80
|
+
'ant-select-dropdown-menu-item-selected': isSelected
|
|
81
|
+
}),
|
|
82
|
+
key: value,
|
|
83
|
+
value: value,
|
|
84
|
+
onMouseDown: function onMouseDown(e) {
|
|
85
|
+
return e.preventDefault();
|
|
86
|
+
},
|
|
87
|
+
onClick: function onClick() {
|
|
88
|
+
onValueChange({
|
|
89
|
+
value: value,
|
|
90
|
+
label: label,
|
|
91
|
+
optionProps: optionProps,
|
|
92
|
+
propItem: propItem
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}, _react["default"].createElement("span", null, (propItem === null || propItem === void 0 ? void 0 : propItem.propsTitle) || (propItem === null || propItem === void 0 ? void 0 : propItem.name), ": "), _react["default"].createElement("span", {
|
|
96
|
+
dangerouslySetInnerHTML: {
|
|
97
|
+
__html: (0, _utils.highlightSubstring)(label, searchText)
|
|
98
|
+
}
|
|
99
|
+
}), isSelected && _react["default"].createElement(_icon["default"], {
|
|
100
|
+
type: "check",
|
|
101
|
+
className: "ant-select-selected-icon"
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
return _react["default"].createElement("li", {
|
|
107
|
+
className: (0, _classnames["default"])({
|
|
108
|
+
'ant-select-dropdown-menu-item': true,
|
|
109
|
+
'ant-select-dropdown-menu-item-selected': isSelected
|
|
110
|
+
}),
|
|
111
|
+
key: value,
|
|
112
|
+
value: value,
|
|
113
|
+
onMouseDown: function onMouseDown(e) {
|
|
114
|
+
return e.preventDefault();
|
|
115
|
+
},
|
|
116
|
+
onClick: function onClick() {
|
|
117
|
+
onValueChange({
|
|
118
|
+
value: value,
|
|
119
|
+
label: label,
|
|
120
|
+
optionProps: optionProps
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}, label, isSelected && _react["default"].createElement(_icon["default"], {
|
|
124
|
+
type: "check",
|
|
125
|
+
className: "ant-select-selected-icon"
|
|
126
|
+
}));
|
|
127
|
+
}));
|
|
128
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../../src/query-form2/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,CAAC;oBAED;wBAAO,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,UAAU,MAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,CAAA;6BAAU;oBACvD,wCACE,uBAAuB,EAAE;4BACvB,MAAM,EAAE,IAAA,0BAAkB,EAAC,KAAK,EAAE,UAAU,CAAC;yBAC9C,GACK;oBACP,UAAU,IAAI,8BAAC,cAAI,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,0BAA0B,GAAG,CACtE,CACN,CAAA;aACF;YACD,OAAO,IAAI,CAAA;SACZ;QACD,OAAO,CACL,sCACE,SAAS,EAAE,IAAA,oBAAU,EAAC;gBACpB,+BAA+B,EAAE,IAAI;gBACrC,wCAAwC,EAAE,UAAU;aACrD,CAAC,EACF,GAAG,EAAE,KAAK,EACV,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,EAAE,EACtC,OAAO,EAAE,GAAG,EAAE;gBACZ,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAA;YAC9C,CAAC;YAEA,KAAK;YACL,UAAU,IAAI,8BAAC,cAAI,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,0BAA0B,GAAG,CACtE,CACN,CAAA;IACH,CAAC,CAAC,CACC,CACN,CAAA;AACH,CAAC,CAAA","sourcesContent":["import React, { useState, useEffect } from 'react'\n\nimport classNames from 'classnames'\nimport Icon from '../../../icon'\nimport { highlightSubstring } from './utils'\n\nexport default (props) => {\n const {\n options,\n params,\n queryKey = 'name',\n fieldNames = {\n label: 'label',\n value: 'value',\n },\n loadData,\n onChange,\n value: _value,\n mode,\n propItem,\n searchText,\n ...rest\n } = props\n const [items, setItems] = useState(options || [])\n\n useEffect(() => {\n if (loadData) {\n loadData({\n [queryKey]: searchText,\n ...(params || {}),\n }).then((items) => {\n setItems(items)\n })\n }\n }, [params, searchText])\n\n useEffect(() => {\n setItems(options || [])\n }, [options])\n\n const onValueChange = (item) => {\n onChange(item, mode === 'multiple' || mode === 'tags')\n }\n \n return (\n <ul className=\"ant-select-dropdown-menu\">\n {items.map((item) => {\n const labelKey = fieldNames?.label || 'label'\n const valueKey = fieldNames?.value || 'value'\n const value = item instanceof Object ? item[valueKey] : item\n const label = item instanceof Object ? item[labelKey] : item + ''\n const optionProps = item instanceof Object ? item : {}\n\n const isSelected = typeof _value === 'object' ? _value?.indexOf(value) > -1 : value === _value\n if (searchText) {\n if (label?.indexOf(searchText) > -1) {\n return (\n <li\n className={classNames({\n 'ant-select-dropdown-menu-item': true,\n 'ant-select-dropdown-menu-item-selected': isSelected,\n })}\n key={value}\n value={value}\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => {\n onValueChange({ value, label, optionProps, propItem })\n }}\n >\n <span>{propItem?.propsTitle || propItem?.name}: </span>\n <span\n dangerouslySetInnerHTML={{\n __html: highlightSubstring(label, searchText),\n }}\n ></span>\n {isSelected && <Icon type=\"check\" className=\"ant-select-selected-icon\" />}\n </li>\n )\n }\n return null\n }\n return (\n <li\n className={classNames({\n 'ant-select-dropdown-menu-item': true,\n 'ant-select-dropdown-menu-item-selected': isSelected,\n })}\n key={value}\n value={value}\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => {\n onValueChange({ value, label, optionProps })\n }}\n >\n {label}\n {isSelected && <Icon type=\"check\" className=\"ant-select-selected-icon\" />}\n </li>\n )\n })}\n </ul>\n )\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare var _default: React.ForwardRefExoticComponent<{
|
|
2
|
+
value: any;
|
|
3
|
+
fieldItems: any;
|
|
4
|
+
initialValues: any;
|
|
5
|
+
onChange: any;
|
|
6
|
+
placeholder: any;
|
|
7
|
+
disabled: any;
|
|
8
|
+
form: any;
|
|
9
|
+
style: any;
|
|
10
|
+
clsPrefix: any;
|
|
11
|
+
} & React.RefAttributes<any>>;
|
|
12
|
+
export default _default;
|
|
13
|
+
import React from "react";
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/query-form2/Field/Composition/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _LocaleReceiver = _interopRequireDefault(require("antd/lib/locale-provider/LocaleReceiver"));
|
|
10
|
+
var _icon = _interopRequireDefault(require("../../../icon"));
|
|
11
|
+
var _tag = _interopRequireDefault(require("../../../tag"));
|
|
12
|
+
var _input = _interopRequireDefault(require("../../../input"));
|
|
13
|
+
var _FieldPopover = _interopRequireDefault(require("./FieldPopover"));
|
|
14
|
+
require("./index.less");
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
16
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
18
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
20
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
21
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
22
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
23
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
24
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
25
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
26
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
27
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
28
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
29
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
30
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
31
|
+
var parseObjectToArray = function parseObjectToArray(value, data) {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
return (_b = (_a = Object.keys(value)) === null || _a === void 0 ? void 0 : _a.map(function (key) {
|
|
34
|
+
var _a, _b, _c;
|
|
35
|
+
var target = data === null || data === void 0 ? void 0 : data.find(function (item) {
|
|
36
|
+
var _a;
|
|
37
|
+
return ((_a = item.props) === null || _a === void 0 ? void 0 : _a.name) === key;
|
|
38
|
+
});
|
|
39
|
+
if (!target) return null;
|
|
40
|
+
var dataItem = (target === null || target === void 0 ? void 0 : target.props) || {};
|
|
41
|
+
var _ref = dataItem || {},
|
|
42
|
+
type = _ref.type,
|
|
43
|
+
component = _ref.component,
|
|
44
|
+
setLabel = _ref.setLabel,
|
|
45
|
+
fieldProps = _ref.props,
|
|
46
|
+
propsTitle = _ref.propsTitle,
|
|
47
|
+
title = _ref.title,
|
|
48
|
+
name = _ref.name;
|
|
49
|
+
var _propsTitle = propsTitle || title || name;
|
|
50
|
+
var _ref2 = fieldProps || {},
|
|
51
|
+
options = _ref2.options;
|
|
52
|
+
var fieldNames = ((_a = dataItem === null || dataItem === void 0 ? void 0 : dataItem.props) === null || _a === void 0 ? void 0 : _a.fieldNames) || {
|
|
53
|
+
label: 'label',
|
|
54
|
+
value: 'value'
|
|
55
|
+
};
|
|
56
|
+
var labelValue = value[key];
|
|
57
|
+
if (!type && component) {
|
|
58
|
+
if (!setLabel) {
|
|
59
|
+
console.error('自定义组件需要传入setLabel()方法');
|
|
60
|
+
}
|
|
61
|
+
} else if (options) {
|
|
62
|
+
if (type === 'selectInput') {
|
|
63
|
+
var selectKey = (_b = Object.keys(labelValue)) === null || _b === void 0 ? void 0 : _b[0];
|
|
64
|
+
var inputValue = labelValue[selectKey];
|
|
65
|
+
var selectLabel = (_c = options === null || options === void 0 ? void 0 : options.find(function (v) {
|
|
66
|
+
return v.value === selectKey;
|
|
67
|
+
})) === null || _c === void 0 ? void 0 : _c.label;
|
|
68
|
+
return {
|
|
69
|
+
key: key,
|
|
70
|
+
value: value[key],
|
|
71
|
+
closable: true,
|
|
72
|
+
label: selectLabel + ':' + inputValue
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
var _target = options === null || options === void 0 ? void 0 : options.find(function (item) {
|
|
76
|
+
var valueKey = fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value;
|
|
77
|
+
var itemValue = item instanceof Object ? item[valueKey] : item;
|
|
78
|
+
return itemValue === value[key];
|
|
79
|
+
});
|
|
80
|
+
labelValue = _target instanceof Object ? _target === null || _target === void 0 ? void 0 : _target[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label] : _target;
|
|
81
|
+
}
|
|
82
|
+
// setLabel: 对于自定义组件,无法控制label的显示,可以通过setLabel方法控制
|
|
83
|
+
return {
|
|
84
|
+
key: key,
|
|
85
|
+
value: value[key],
|
|
86
|
+
closable: true,
|
|
87
|
+
label: setLabel ? setLabel(labelValue) : _propsTitle + ':' + labelValue
|
|
88
|
+
};
|
|
89
|
+
})) === null || _b === void 0 ? void 0 : _b.filter(function (item) {
|
|
90
|
+
return !!item;
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
var parseArrayToObject = function parseArrayToObject(value) {
|
|
94
|
+
return value === null || value === void 0 ? void 0 : value.reduce(function (acc, v) {
|
|
95
|
+
acc[v.key] = v.value;
|
|
96
|
+
return acc;
|
|
97
|
+
}, {});
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* @param value: [{
|
|
101
|
+
key: 'key1',
|
|
102
|
+
value: 'value1',
|
|
103
|
+
label: 'key1:value1'
|
|
104
|
+
}, {
|
|
105
|
+
key: 'key2',
|
|
106
|
+
value: ['value2', 'value3'],
|
|
107
|
+
label: 'key1:value2|value3'
|
|
108
|
+
}]
|
|
109
|
+
* @param {*} ref
|
|
110
|
+
* @returns
|
|
111
|
+
*/
|
|
112
|
+
var regex = /^.+:.*$/;
|
|
113
|
+
var CompositionInput = function CompositionInput(_ref3, ref) {
|
|
114
|
+
var _value = _ref3.value,
|
|
115
|
+
fieldItems = _ref3.fieldItems,
|
|
116
|
+
initialValues = _ref3.initialValues,
|
|
117
|
+
onChange = _ref3.onChange,
|
|
118
|
+
placeholder = _ref3.placeholder,
|
|
119
|
+
disabled = _ref3.disabled,
|
|
120
|
+
form = _ref3.form,
|
|
121
|
+
style = _ref3.style,
|
|
122
|
+
clsPrefix = _ref3.clsPrefix;
|
|
123
|
+
var prefix = "".concat(clsPrefix, "-composition-input");
|
|
124
|
+
var _useState = (0, _react.useState)([]),
|
|
125
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
126
|
+
value = _useState2[0],
|
|
127
|
+
setValue = _useState2[1];
|
|
128
|
+
var _useState3 = (0, _react.useState)(),
|
|
129
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
130
|
+
tempItem = _useState4[0],
|
|
131
|
+
setTempItem = _useState4[1];
|
|
132
|
+
var _useState5 = (0, _react.useState)(''),
|
|
133
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
134
|
+
searchText = _useState6[0],
|
|
135
|
+
setSearchText = _useState6[1];
|
|
136
|
+
var _useState7 = (0, _react.useState)(false),
|
|
137
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
138
|
+
visible = _useState8[0],
|
|
139
|
+
setVisible = _useState8[1];
|
|
140
|
+
var _useState9 = (0, _react.useState)(undefined),
|
|
141
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
142
|
+
fieldItem = _useState10[0],
|
|
143
|
+
setFieldItem = _useState10[1];
|
|
144
|
+
var _ref4 = fieldItem || {},
|
|
145
|
+
props = _ref4.props;
|
|
146
|
+
var inputRef = (0, _react.useRef)(null);
|
|
147
|
+
var widthRef = (0, _react.useRef)(null);
|
|
148
|
+
var fieldRef = (0, _react.useRef)(null);
|
|
149
|
+
var handleFocus = function handleFocus(e) {
|
|
150
|
+
var _a;
|
|
151
|
+
e.preventDefault();
|
|
152
|
+
(_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
153
|
+
if (!visible && !regex.test(searchText)) {
|
|
154
|
+
setVisible(true);
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
(0, _react.useImperativeHandle)(ref, function () {
|
|
158
|
+
return {
|
|
159
|
+
changeVal: function changeVal() {
|
|
160
|
+
return value;
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
});
|
|
164
|
+
(0, _react.useEffect)(function () {
|
|
165
|
+
var values = form.getValues();
|
|
166
|
+
if (values) {
|
|
167
|
+
setValue(parseObjectToArray(values, fieldItems));
|
|
168
|
+
}
|
|
169
|
+
}, [fieldItems, form]);
|
|
170
|
+
// useEffect(() => {
|
|
171
|
+
// if (!visible) {
|
|
172
|
+
// const newValues = value?.filter((v) => !!v?.value)
|
|
173
|
+
// if (newValues.length !== value?.length) {
|
|
174
|
+
// setValue(newValues)
|
|
175
|
+
// }
|
|
176
|
+
// }
|
|
177
|
+
// }, [visible, value])
|
|
178
|
+
(0, _react.useLayoutEffect)(function () {
|
|
179
|
+
var target = document.querySelector(".".concat(prefix, " .inputClass"));
|
|
180
|
+
if (!target) return;
|
|
181
|
+
if (searchText && widthRef.current.clientWidth > 50) {
|
|
182
|
+
target.style.width = widthRef.current.clientWidth + 10 + 'px';
|
|
183
|
+
} else if (!(value === null || value === void 0 ? void 0 : value.length)) {
|
|
184
|
+
target.style.width = '300px';
|
|
185
|
+
} else {
|
|
186
|
+
target.style.width = '100px';
|
|
187
|
+
}
|
|
188
|
+
}, [searchText, value]);
|
|
189
|
+
var onFormChange = function onFormChange(formData) {
|
|
190
|
+
setValue(parseObjectToArray(formData, data));
|
|
191
|
+
};
|
|
192
|
+
var onClear = function onClear(e) {
|
|
193
|
+
e.stopPropagation();
|
|
194
|
+
var deleteKeys = value === null || value === void 0 ? void 0 : value.map(function (_ref5) {
|
|
195
|
+
var key = _ref5.key;
|
|
196
|
+
return key;
|
|
197
|
+
});
|
|
198
|
+
setValue([]);
|
|
199
|
+
onChange([], deleteKeys);
|
|
200
|
+
};
|
|
201
|
+
var onDelete = function onDelete(key, e) {
|
|
202
|
+
e.preventDefault();
|
|
203
|
+
if (value.length > 0) {
|
|
204
|
+
var newValue = value.filter(function (v) {
|
|
205
|
+
return v.key !== key;
|
|
206
|
+
});
|
|
207
|
+
setValue(newValue);
|
|
208
|
+
var deleteKeys = [key];
|
|
209
|
+
onChange(parseArrayToObject(newValue), deleteKeys);
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
var handleFieldChange = function handleFieldChange(value, isInput, hasValue) {
|
|
213
|
+
if (isInput) {
|
|
214
|
+
setSearchText(value === null || value === void 0 ? void 0 : value.label);
|
|
215
|
+
setTempItem(value);
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
setValue(value);
|
|
219
|
+
setSearchText('');
|
|
220
|
+
setTempItem();
|
|
221
|
+
if (hasValue) onChange(parseArrayToObject(value));
|
|
222
|
+
};
|
|
223
|
+
// 输入框事件方法
|
|
224
|
+
var onInputChange = function onInputChange(e) {
|
|
225
|
+
var value = e.target.value;
|
|
226
|
+
if (tempItem) {
|
|
227
|
+
if (regex.test(value)) {
|
|
228
|
+
// 有输入值
|
|
229
|
+
setSearchText(value);
|
|
230
|
+
} else {
|
|
231
|
+
// 没有输入值, 清空选择的属性类型重新显示属性列表
|
|
232
|
+
setSearchText('');
|
|
233
|
+
setTempItem();
|
|
234
|
+
}
|
|
235
|
+
} else {
|
|
236
|
+
setSearchText(value);
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
var onPressEnter = function onPressEnter(e) {
|
|
240
|
+
var _a;
|
|
241
|
+
var inputValue = ((_a = searchText === null || searchText === void 0 ? void 0 : searchText.match(/[^:]+:(.*)/)) === null || _a === void 0 ? void 0 : _a[1]) || null;
|
|
242
|
+
if (tempItem && inputValue) {
|
|
243
|
+
setVisible(false);
|
|
244
|
+
tempItem.label = searchText;
|
|
245
|
+
tempItem.closable = true;
|
|
246
|
+
tempItem.value = inputValue; // 得到输入值
|
|
247
|
+
if (!(value === null || value === void 0 ? void 0 : value.find(function (v) {
|
|
248
|
+
return v.key === tempItem.key;
|
|
249
|
+
}))) {
|
|
250
|
+
var newValue = [].concat(_toConsumableArray(value), [tempItem]);
|
|
251
|
+
setValue(newValue);
|
|
252
|
+
onChange(parseArrayToObject(newValue));
|
|
253
|
+
} else {
|
|
254
|
+
var _newValue = value.map(function (v) {
|
|
255
|
+
return v.key === tempItem.key ? tempItem : v;
|
|
256
|
+
});
|
|
257
|
+
setValue(_newValue);
|
|
258
|
+
onChange(parseArrayToObject(_newValue));
|
|
259
|
+
}
|
|
260
|
+
e.target.value = inputValue;
|
|
261
|
+
form.emit('search', _defineProperty(_defineProperty({}, tempItem.key, inputValue), "current", 1));
|
|
262
|
+
(props === null || props === void 0 ? void 0 : props.onPressEnter) && props.onPressEnter(e);
|
|
263
|
+
}
|
|
264
|
+
setTempItem();
|
|
265
|
+
setSearchText('');
|
|
266
|
+
};
|
|
267
|
+
var handleTag = function handleTag(obj) {
|
|
268
|
+
var curItem = undefined;
|
|
269
|
+
for (var index = 0; index < fieldItems.length; index++) {
|
|
270
|
+
var item = fieldItems[index];
|
|
271
|
+
if (item.props.name === obj.key) {
|
|
272
|
+
curItem = item;
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
// setSearchText(obj.label)
|
|
277
|
+
fieldRef.current.onPropsClick(curItem.props);
|
|
278
|
+
};
|
|
279
|
+
return _react["default"].createElement(_LocaleReceiver["default"], {
|
|
280
|
+
componentName: "QueryForm"
|
|
281
|
+
}, function (locale) {
|
|
282
|
+
return _react["default"].createElement("div", {
|
|
283
|
+
className: prefix,
|
|
284
|
+
style: style,
|
|
285
|
+
onClick: handleFocus
|
|
286
|
+
}, _react["default"].createElement("span", {
|
|
287
|
+
className: "".concat(prefix, "-width"),
|
|
288
|
+
ref: widthRef
|
|
289
|
+
}, searchText), _react["default"].createElement("ul", {
|
|
290
|
+
className: "".concat(prefix, "-items")
|
|
291
|
+
}, value && value.map(function (item, index) {
|
|
292
|
+
return _react["default"].createElement("li", {
|
|
293
|
+
key: index,
|
|
294
|
+
className: "".concat(prefix, "-items-item")
|
|
295
|
+
}, _react["default"].createElement(_tag["default"], {
|
|
296
|
+
closable: !disabled && item.closable,
|
|
297
|
+
onClick: function onClick(e) {
|
|
298
|
+
e.preventDefault();
|
|
299
|
+
e.stopPropagation();
|
|
300
|
+
handleTag(item);
|
|
301
|
+
},
|
|
302
|
+
onClose: function onClose(e) {
|
|
303
|
+
return onDelete(item.key, e);
|
|
304
|
+
},
|
|
305
|
+
ellipsisOptions: {
|
|
306
|
+
widthLimit: "140px"
|
|
307
|
+
}
|
|
308
|
+
}, item === null || item === void 0 ? void 0 : item.label));
|
|
309
|
+
}), _react["default"].createElement("li", {
|
|
310
|
+
className: "".concat(prefix, "-items-input")
|
|
311
|
+
}, _react["default"].createElement(_FieldPopover["default"], {
|
|
312
|
+
ref: fieldRef,
|
|
313
|
+
onChange: handleFieldChange,
|
|
314
|
+
clsPrefix: clsPrefix,
|
|
315
|
+
fieldItems: fieldItems,
|
|
316
|
+
propItem: fieldItem,
|
|
317
|
+
setFieldItem: setFieldItem,
|
|
318
|
+
form: form,
|
|
319
|
+
regex: regex,
|
|
320
|
+
visible: visible,
|
|
321
|
+
value: value,
|
|
322
|
+
setVisible: setVisible,
|
|
323
|
+
searchText: searchText,
|
|
324
|
+
locale: locale
|
|
325
|
+
}, _react["default"].createElement(_input["default"], Object.assign({
|
|
326
|
+
ref: inputRef,
|
|
327
|
+
value: searchText,
|
|
328
|
+
className: "inputClass",
|
|
329
|
+
placeholder: !(value === null || value === void 0 ? void 0 : value.length) ? placeholder || locale.placeholder : undefined,
|
|
330
|
+
disabled: disabled
|
|
331
|
+
}, props, {
|
|
332
|
+
onPressEnter: onPressEnter,
|
|
333
|
+
onChange: function onChange(e) {
|
|
334
|
+
onInputChange(e);
|
|
335
|
+
}
|
|
336
|
+
}))))), _react["default"].createElement("div", {
|
|
337
|
+
className: "".concat(prefix, "-prefix")
|
|
338
|
+
}, _react["default"].createElement(_icon["default"], {
|
|
339
|
+
type: "filter"
|
|
340
|
+
})), _react["default"].createElement("div", {
|
|
341
|
+
className: "".concat(prefix, "-clear")
|
|
342
|
+
}, _react["default"].createElement(_icon["default"], {
|
|
343
|
+
onClick: onClear,
|
|
344
|
+
type: "close-circle",
|
|
345
|
+
theme: "filled"
|
|
346
|
+
})));
|
|
347
|
+
});
|
|
348
|
+
};
|
|
349
|
+
var _default = exports["default"] = (0, _react.forwardRef)(CompositionInput);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/query-form2/Field/Composition/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAOc;AACd,4FAAmE;AACnE,yDAAgC;AAEhC,uDAA8B;AAC9B,2DAAkC;AAClC,kEAAyC;AACzC,wBAAq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AAQ,EACb,QAAQ,EAAE,iBAAiB,EAC3B,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,SAAS,EACnB,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM;wBAEd,8BAAC,eAAK,kBACJ,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,UAAU,EACjB,SAAS,EAAC,YAAY,EACtB,WAAW,EAAE,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAA,CAAC,CAAC,CAAC,WAAW,IAAI,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAC3E,QAAQ,EAAE,QAAQ,IACd,KAAK,IACT,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;gCACd,aAAa,CAAC,CAAC,CAAC,CAAA;4BAClB,CAAC,IACD,CACW,CACZ,CACF;YACL,uCAAK,SAAS,EAAE,GAAG,MAAM,SAAS;gBAChC,8BAAC,cAAI,IAAC,IAAI,EAAC,QAAQ,GAAG,CAClB;YACN,uCAAK,SAAS,EAAE,GAAG,MAAM,QAAQ;gBAC/B,8BAAC,cAAI,IACH,OAAO,EAAE,OAAO,EAChB,IAAI,EAAC,cAAc,EACnB,KAAK,EAAC,QAAQ,GACd,CACE,CACF,CACP,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAA;AACD,kBAAe,IAAA,kBAAU,EAAC,gBAAgB,CAAC,CAAA","sourcesContent":["import React, {\n useEffect,\n useLayoutEffect,\n useState,\n useRef,\n useImperativeHandle,\n forwardRef,\n} from 'react'\nimport LocaleReceiver from 'antd/lib/locale-provider/LocaleReceiver'\nimport Icon from '../../../icon'\n\nimport Tag from '../../../tag'\nimport Input from '../../../input'\nimport FieldPopover from './FieldPopover'\nimport './index.less'\n\nconst parseObjectToArray = (value, data) => {\n return Object.keys(value)\n ?.map((key) => {\n const target = data?.find((item) => item.props?.name === key)\n if (!target) return null\n const dataItem = target?.props || {}\n const {\n type,\n component,\n setLabel,\n props: fieldProps,\n propsTitle,\n title,\n name,\n } = dataItem || {}\n const _propsTitle = propsTitle || title || name\n const { options } = fieldProps || {}\n const fieldNames = dataItem?.props?.fieldNames || {\n label: 'label',\n value: 'value',\n }\n let labelValue = value[key]\n if (!type && component) {\n if (!setLabel) {\n console.error('自定义组件需要传入setLabel()方法')\n }\n } else if (options) {\n if (type === 'selectInput') {\n const selectKey = Object.keys(labelValue)?.[0]\n const inputValue = labelValue[selectKey]\n const selectLabel = options?.find((v) => v.value === selectKey)?.label\n return {\n key,\n value: value[key],\n closable: true,\n label: selectLabel + ':' + inputValue,\n }\n }\n const target = options?.find((item) => {\n const valueKey = fieldNames?.value\n const itemValue = item instanceof Object ? item[valueKey] : item\n return itemValue === value[key]\n })\n labelValue = target instanceof Object ? target?.[fieldNames?.label] : target\n }\n // setLabel: 对于自定义组件,无法控制label的显示,可以通过setLabel方法控制\n return {\n key,\n value: value[key],\n closable: true,\n label: setLabel ? setLabel(labelValue) : _propsTitle + ':' + labelValue,\n }\n })\n ?.filter((item) => !!item)\n}\n\nconst parseArrayToObject = (value) =>\n value?.reduce((acc, v) => {\n acc[v.key] = v.value\n return acc\n }, {})\n\n/**\n * @param value: [{\n key: 'key1',\n value: 'value1',\n label: 'key1:value1'\n }, {\n key: 'key2',\n value: ['value2', 'value3'],\n label: 'key1:value2|value3'\n }]\n * @param {*} ref \n * @returns \n */\nconst regex = /^.+:.*$/\n\nconst CompositionInput = (\n { value: _value, fieldItems, initialValues, onChange, placeholder, disabled, form, style, clsPrefix },\n ref\n) => {\n const prefix = `${clsPrefix}-composition-input`;\n const [value, setValue] = useState([])\n const [tempItem, setTempItem] = useState()\n const [searchText, setSearchText] = useState('')\n const [visible, setVisible] = useState(false)\n const [fieldItem, setFieldItem] = useState(undefined)\n const { props } = fieldItem || {}\n\n const inputRef = useRef(null)\n const widthRef = useRef(null)\n const fieldRef = useRef(null)\n\n const handleFocus = (e) => {\n e.preventDefault()\n inputRef?.current?.focus()\n if (!visible && !regex.test(searchText)) {\n setVisible(true)\n }\n }\n useImperativeHandle(ref, () => ({\n changeVal: () => {\n return value\n },\n }))\n\n useEffect(() => {\n let values = form.getValues();\n if (values) {\n setValue(parseObjectToArray(values, fieldItems))\n }\n }, [fieldItems, form])\n\n // useEffect(() => {\n // if (!visible) {\n // const newValues = value?.filter((v) => !!v?.value)\n // if (newValues.length !== value?.length) {\n // setValue(newValues)\n // }\n // }\n // }, [visible, value])\n\n useLayoutEffect(() => {\n const target = document.querySelector(`.${prefix} .inputClass`)\n\n if (!target) return\n if (searchText && widthRef.current.clientWidth > 50) {\n target.style.width = widthRef.current.clientWidth + 10 + 'px'\n } else if (!value?.length) {\n target.style.width = '300px'\n } else {\n target.style.width = '100px'\n }\n }, [searchText, value])\n\n\n const onFormChange = (formData) => {\n setValue(parseObjectToArray(formData, data))\n }\n\n const onClear = (e) => {\n e.stopPropagation()\n const deleteKeys = value?.map(({ key }) => key)\n setValue([])\n onChange([], deleteKeys)\n }\n const onDelete = (key, e) => {\n e.preventDefault()\n if (value.length > 0) {\n const newValue = value.filter((v) => v.key !== key)\n setValue(newValue)\n const deleteKeys = [key]\n onChange(parseArrayToObject(newValue), deleteKeys)\n }\n }\n const handleFieldChange = (value, isInput, hasValue) => {\n if (isInput) {\n setSearchText(value?.label)\n setTempItem(value)\n return\n }\n setValue(value)\n setSearchText('')\n setTempItem()\n if (hasValue) onChange(parseArrayToObject(value))\n }\n\n // 输入框事件方法\n const onInputChange = (e) => {\n const value = e.target.value\n if (tempItem) {\n if (regex.test(value)) {\n // 有输入值\n setSearchText(value)\n } else {\n // 没有输入值, 清空选择的属性类型重新显示属性列表\n setSearchText('')\n setTempItem()\n }\n } else {\n setSearchText(value)\n }\n }\n\n const onPressEnter = (e) => {\n const inputValue = searchText?.match(/[^:]+:(.*)/)?.[1] || null\n if (tempItem && inputValue) {\n setVisible(false)\n tempItem.label = searchText\n tempItem.closable = true\n tempItem.value = inputValue // 得到输入值\n if (!value?.find((v) => v.key === tempItem.key)) {\n const newValue = [...value, tempItem]\n setValue(newValue)\n onChange(parseArrayToObject(newValue))\n } else {\n const newValue = value.map((v) => (v.key === tempItem.key ? tempItem : v))\n setValue(newValue)\n onChange(parseArrayToObject(newValue))\n }\n e.target.value = inputValue\n form.emit('search', { [tempItem.key]: inputValue, current: 1 })\n props?.onPressEnter && props.onPressEnter(e)\n }\n setTempItem()\n setSearchText('')\n }\n\n const handleTag = (obj) => {\n let curItem = undefined\n for (let index = 0; index < fieldItems.length; index++) {\n const item = fieldItems[index];\n if (item.props.name === obj.key) {\n curItem = item\n break;\n }\n }\n // setSearchText(obj.label)\n fieldRef.current.onPropsClick(curItem.props)\n }\n return (\n <LocaleReceiver componentName=\"QueryForm\">\n {(locale) => {\n return (\n <div className={prefix} style={style} onClick={handleFocus}>\n <span className={`${prefix}-width`} ref={widthRef}>\n {searchText}\n </span>\n <ul className={`${prefix}-items`}>\n {value &&\n value.map((item, index) => (\n <li key={index} className={`${prefix}-items-item`}>\n <Tag closable={!disabled && item.closable} onClick={(e) => {\n e.preventDefault()\n e.stopPropagation()\n handleTag(item)\n }} onClose={(e) => onDelete(item.key, e)} ellipsisOptions={{widthLimit:\"140px\"}}>\n {item?.label}\n </Tag>\n </li>\n ))}\n <li className={`${prefix}-items-input`}>\n <FieldPopover\n ref={fieldRef}\n onChange={handleFieldChange}\n clsPrefix={clsPrefix}\n fieldItems={fieldItems}\n propItem={fieldItem}\n setFieldItem={setFieldItem}\n form={form}\n regex={regex}\n visible={visible}\n value={value}\n setVisible={setVisible}\n searchText={searchText}\n locale={locale}\n >\n <Input\n ref={inputRef}\n value={searchText}\n className=\"inputClass\"\n placeholder={!value?.length ? placeholder || locale.placeholder : undefined}\n disabled={disabled}\n {...props}\n onPressEnter={onPressEnter}\n onChange={(e) => {\n onInputChange(e)\n }}\n />\n </FieldPopover>\n </li>\n </ul>\n <div className={`${prefix}-prefix`}>\n <Icon type=\"filter\" />\n </div>\n <div className={`${prefix}-clear`}>\n <Icon\n onClick={onClear}\n type=\"close-circle\"\n theme=\"filled\"\n />\n </div>\n </div>\n )\n }}\n </LocaleReceiver>\n )\n}\nexport default forwardRef(CompositionInput)\n"]}
|