tntd 2.0.25 → 2.1.0
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/affix/index.js +1 -2
- package/es/alert/index.js +1 -2
- package/es/anchor/index.js +1 -2
- package/es/array-input/icon.js +24 -6
- package/es/array-input/index.js +203 -119
- package/es/array-input/style/index.js +1 -0
- package/es/array-input/style/index.js.map +1 -0
- package/es/auth-context/index.js +1 -2
- package/es/auth-context/style/index.js +1 -0
- package/es/auth-context/style/index.js.map +1 -0
- package/es/auto-complete/index.js +1 -2
- package/es/avatar/index.js +1 -2
- package/es/back-top/index.js +1 -2
- package/es/badge/index.js +1 -2
- package/es/breadcrumb/index.js +1 -2
- package/es/button/index.js +1 -2
- package/es/calendar/index.js +1 -2
- package/es/card/index.js +1 -2
- package/es/carousel/index.js +1 -2
- package/es/cascader/index.js +1 -2
- package/es/checkbox/index.js +1 -2
- package/es/col/index.js +1 -2
- package/es/collapse/index.js +1 -2
- package/es/columns/index.js +66 -30
- package/es/columns/style/index.js +1 -2
- package/es/comment/index.js +1 -2
- package/es/config-provider/config-provider.js +1 -2
- package/es/config-provider/index.js +1 -2
- package/es/date-picker/index.js +1 -2
- package/es/descriptions/descriptions.js +38 -30
- package/es/descriptions/index.js +1 -2
- package/es/development-login/LoginModal.js +81 -46
- package/es/development-login/index.js +17 -8
- package/es/development-login/style/index.js +1 -0
- package/es/development-login/style/index.js.map +1 -0
- package/es/divider/index.js +1 -2
- package/es/drawer/drawer.js +27 -20
- package/es/drawer/index.js +1 -2
- package/es/dropdown/index.js +1 -2
- package/es/ellipsis/Svg/CopySVG.js +63 -17
- package/es/ellipsis/Svg/CopySVG.js.map +1 -1
- package/es/ellipsis/Svg/TickSVG.js +41 -12
- package/es/ellipsis/Svg/TickSVG.js.map +1 -1
- package/es/ellipsis/index.js +115 -68
- package/es/ellipsis/index.js.map +1 -1
- package/es/ellipsis/index.less +1 -1
- package/es/ellipsis/style/index.js +1 -0
- package/es/ellipsis/style/index.js.map +1 -0
- 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/render-empty.js +22 -0
- package/es/empty/render-empty.js.map +1 -0
- package/es/empty/style/index.js +2 -0
- package/es/empty/style/index.js.map +1 -0
- package/es/exception/exception.js +32 -19
- package/es/exception/index.js +1 -2
- package/es/form/index.js +1 -2
- package/es/handle/index.js +110 -71
- package/es/handle/style/index.js +1 -0
- package/es/handle/style/index.js.map +1 -0
- package/es/icon/index.js +1 -2
- package/es/icon-list/index.js +1 -120
- package/es/icon-list/style/index.js +1 -0
- package/es/icon-list/style/index.js.map +1 -0
- package/es/img/Contain.js +60 -39
- package/es/img/Cover.js +98 -72
- package/es/img/index.js +48 -32
- package/es/img/style/index.js +1 -0
- package/es/img/style/index.js.map +1 -0
- package/es/index.js +1 -2
- package/es/input/index.js +1 -2
- package/es/input-number/index.js +1 -2
- package/es/layout/index.js +1 -2
- package/es/list/index.js +1 -2
- package/es/loading-button/index.js +33 -28
- package/es/loading-button/style/index.js +1 -0
- package/es/loading-button/style/index.js.map +1 -0
- package/es/locale/default.js +3 -4
- package/es/locale/en_US.js +29 -30
- package/es/locale/index.js +1 -2
- package/es/locale/zh_CN.js +29 -30
- package/es/locale-provider/index.js +2 -3
- package/es/mention/index.js +1 -2
- package/es/mentions/index.js +1 -2
- package/es/menu/index.js +1 -2
- package/es/message/index.js +1 -2
- package/es/modal/index.js +1 -2
- package/es/modal/modal.js +20 -17
- package/es/notification/index.js +1 -2
- package/es/page/Box.js +49 -33
- package/es/page/index.js +119 -88
- package/es/page/index.js.map +1 -1
- package/es/page/style/index.js +1 -0
- package/es/page/style/index.js.map +1 -0
- package/es/page/utils.js +12 -14
- package/es/page-header/index.js +1 -2
- package/es/pagination/index.js +1 -2
- package/es/popconfirm/index.js +1 -2
- package/es/popover/index.js +1 -2
- package/es/prev-locale.js +49 -47
- package/es/progress/index.js +1 -2
- package/es/query-form/Field/Checkbox.js +20 -17
- package/es/query-form/Field/Select.js +54 -39
- package/es/query-form/Field/SelectInput.js +63 -45
- package/es/query-form/Field/fieldsMap.js +19 -20
- package/es/query-form/Field/index.js +104 -66
- package/es/query-form/createActions.js +46 -46
- package/es/query-form/index.js +327 -247
- package/es/query-form/index.js.map +1 -1
- package/es/query-form/style/index.js +1 -0
- package/es/query-form/style/index.js.map +1 -0
- package/es/query-form/useForm.js +3 -4
- package/es/query-list-scene/List.js +319 -257
- package/es/query-list-scene/List.js.map +1 -1
- package/es/query-list-scene/QueryForm.js +132 -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/createActions.js.map +1 -1
- package/es/query-list-scene/index.js +1 -2
- package/es/query-list-scene/style/index.js +1 -0
- package/es/query-list-scene/style/index.js.map +1 -0
- package/es/query-list-scene/useActions.js +3 -4
- package/es/radio/index.js +1 -2
- package/es/rate/index.js +1 -2
- package/es/render-empty/index.js +1 -2
- package/es/render-empty/render-empty.js +19 -16
- package/es/render-empty/style/index.js +1 -0
- package/es/render-empty/style/index.js.map +1 -0
- package/es/result/index.js +1 -2
- package/es/row/index.js +1 -2
- package/es/select/index.js +1 -2
- package/es/skeleton/index.js +1 -2
- package/es/slider/index.js +1 -2
- package/es/spin/index.js +1 -2
- package/es/statistic/index.js +1 -2
- package/es/status/index.js +1 -0
- package/es/status/index.js.map +1 -0
- package/es/status/status.js +5 -0
- package/es/status/status.js.map +1 -0
- package/es/steps/index.js +1 -2
- package/es/steps/steps.js +51 -35
- 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/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 +2 -0
- package/es/table/style/index.js.map +1 -0
- package/es/table/table.js +76 -53
- package/es/table/table.stories.js +148 -139
- package/es/table/utils.js +17 -18
- package/es/tabs/index.js +1 -2
- package/es/tag/index.js +140 -3
- package/es/tag/index.js.map +1 -1
- package/es/tag/tag.less +46 -0
- package/es/time-picker/index.js +1 -2
- package/es/timeline/index.js +1 -2
- package/es/title/index.js +34 -20
- package/es/title/style/index.js +1 -0
- package/es/title/style/index.js.map +1 -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 +72 -50
- 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 +189 -118
- 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 +180 -128
- package/es/tntd-cascader/rc-cascader/OptionList/useActive.js +22 -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/TntdForm/components/Item.js +42 -30
- package/es/tntd-form/TntdForm/components/ItemComp.js +167 -158
- package/es/tntd-form/TntdForm/components/List.js +89 -78
- package/es/tntd-form/TntdForm/index.js +38 -33
- package/es/tntd-form/TntdForm/interface.js +1 -2
- package/es/tntd-form/TntdForm/store.js +1 -2
- package/es/tntd-form/TntdForm/utils.js +158 -168
- package/es/tntd-form/index.js +1 -2
- package/es/tntd-icon/fonts/iconfont.js +36 -53
- package/es/tntd-icon/index.js +23 -17
- package/es/tntd-icon/style/index.js +1 -0
- package/es/tntd-icon/style/index.js.map +1 -0
- 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 -154
- package/es/tntd-layout/GlobalNavigation/NavigationPopup.js.map +1 -1
- package/es/tntd-layout/GlobalNavigation/index.js +84 -50
- package/es/tntd-layout/Header.js +59 -26
- package/es/tntd-layout/HeaderActions.js +83 -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 +92 -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-layout/style/index.js +1 -0
- package/es/tntd-layout/style/index.js.map +1 -0
- package/es/tntd-modal/index.js +73 -32
- package/es/tntd-modal/style/index.js +1 -0
- package/es/tntd-modal/style/index.js.map +1 -0
- package/es/tntd-second-page/index.js +47 -24
- package/es/tntd-select/DropDownWrap.js +73 -52
- package/es/tntd-select/index.js +564 -482
- package/es/tntd-select/style/index.js +1 -0
- package/es/tntd-select/style/index.js.map +1 -0
- package/es/tooltip/index.js +1 -2
- package/es/transfer/index.js +1 -2
- package/es/tree/index.js +1 -2
- package/es/tree-select/index.js +1 -2
- package/es/typography/index.js +1 -2
- package/es/upload/index.js +1 -2
- package/es/utils/checkAuth.js +24 -21
- package/es/utils/findMenuInfoByPath.js +33 -30
- package/es/utils/index.js +65 -59
- package/es/version/index.js +1 -2
- package/lib/affix/index.d.ts +3 -3
- package/lib/affix/index.js +23 -22
- package/lib/affix/index.js.map +1 -1
- package/lib/alert/index.d.ts +3 -3
- package/lib/alert/index.js +23 -22
- package/lib/alert/index.js.map +1 -1
- package/lib/anchor/index.d.ts +3 -3
- package/lib/anchor/index.js +23 -22
- package/lib/anchor/index.js.map +1 -1
- package/lib/array-input/icon.js +33 -12
- package/lib/array-input/index.js +254 -150
- package/lib/array-input/style/index.d.ts +1 -0
- package/lib/array-input/style/index.d.ts.map +1 -0
- package/lib/array-input/style/index.js +1 -0
- package/lib/array-input/style/index.js.map +1 -0
- package/lib/auth-context/index.js +10 -4
- package/lib/auth-context/style/index.d.ts +1 -0
- package/lib/auth-context/style/index.d.ts.map +1 -0
- package/lib/auth-context/style/index.js +1 -0
- package/lib/auth-context/style/index.js.map +1 -0
- package/lib/auto-complete/index.d.ts +3 -3
- package/lib/auto-complete/index.js +23 -22
- package/lib/auto-complete/index.js.map +1 -1
- package/lib/avatar/index.d.ts +3 -3
- package/lib/avatar/index.js +23 -22
- package/lib/avatar/index.js.map +1 -1
- package/lib/back-top/index.d.ts +3 -3
- package/lib/back-top/index.js +23 -22
- package/lib/back-top/index.js.map +1 -1
- package/lib/badge/index.d.ts +3 -3
- package/lib/badge/index.js +23 -22
- package/lib/badge/index.js.map +1 -1
- package/lib/breadcrumb/index.d.ts +3 -3
- package/lib/breadcrumb/index.js +23 -22
- package/lib/breadcrumb/index.js.map +1 -1
- package/lib/button/index.d.ts +3 -3
- package/lib/button/index.js +23 -22
- package/lib/button/index.js.map +1 -1
- package/lib/calendar/index.d.ts +3 -3
- package/lib/calendar/index.js +23 -22
- package/lib/calendar/index.js.map +1 -1
- package/lib/card/index.d.ts +3 -3
- package/lib/card/index.js +23 -22
- package/lib/card/index.js.map +1 -1
- package/lib/carousel/index.d.ts +3 -3
- package/lib/carousel/index.js +23 -22
- package/lib/carousel/index.js.map +1 -1
- package/lib/cascader/index.d.ts +3 -3
- package/lib/cascader/index.js +23 -22
- package/lib/cascader/index.js.map +1 -1
- package/lib/checkbox/index.d.ts +3 -3
- package/lib/checkbox/index.js +23 -22
- package/lib/checkbox/index.js.map +1 -1
- package/lib/col/index.d.ts +3 -3
- package/lib/col/index.js +23 -22
- package/lib/col/index.js.map +1 -1
- package/lib/collapse/index.d.ts +3 -3
- package/lib/collapse/index.js +24 -23
- package/lib/collapse/index.js.map +1 -1
- package/lib/columns/index.js +81 -41
- package/lib/columns/style/index.js +1 -2
- package/lib/comment/index.d.ts +3 -3
- package/lib/comment/index.js +23 -22
- package/lib/comment/index.js.map +1 -1
- 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 +23 -22
- package/lib/config-provider/index.js.map +1 -1
- package/lib/date-picker/index.d.ts +3 -3
- package/lib/date-picker/index.js +23 -22
- package/lib/date-picker/index.js.map +1 -1
- package/lib/descriptions/descriptions.d.ts +4 -4
- package/lib/descriptions/descriptions.d.ts.map +1 -1
- package/lib/descriptions/descriptions.js +64 -55
- package/lib/descriptions/descriptions.js.map +1 -1
- package/lib/descriptions/index.d.ts +1 -1
- package/lib/descriptions/index.js +23 -22
- package/lib/descriptions/index.js.map +1 -1
- package/lib/development-login/LoginModal.js +110 -79
- package/lib/development-login/index.js +42 -35
- package/lib/development-login/style/index.d.ts +1 -0
- package/lib/development-login/style/index.d.ts.map +1 -0
- package/lib/development-login/style/index.js +1 -0
- package/lib/development-login/style/index.js.map +1 -0
- package/lib/divider/index.d.ts +3 -3
- package/lib/divider/index.js +23 -22
- package/lib/divider/index.js.map +1 -1
- package/lib/drawer/drawer.d.ts +1 -1
- package/lib/drawer/drawer.js +41 -30
- package/lib/drawer/drawer.js.map +1 -1
- package/lib/drawer/index.d.ts +2 -2
- package/lib/drawer/index.js +22 -20
- package/lib/drawer/index.js.map +1 -1
- package/lib/dropdown/index.d.ts +3 -3
- package/lib/dropdown/index.js +23 -22
- package/lib/dropdown/index.js.map +1 -1
- package/lib/ellipsis/Svg/CopySVG.d.ts.map +1 -1
- package/lib/ellipsis/Svg/CopySVG.js +70 -21
- package/lib/ellipsis/Svg/CopySVG.js.map +1 -1
- package/lib/ellipsis/Svg/TickSVG.d.ts.map +1 -1
- package/lib/ellipsis/Svg/TickSVG.js +48 -16
- package/lib/ellipsis/Svg/TickSVG.js.map +1 -1
- package/lib/ellipsis/index.d.ts.map +1 -1
- package/lib/ellipsis/index.js +146 -105
- package/lib/ellipsis/index.js.map +1 -1
- package/lib/ellipsis/index.less +1 -1
- package/lib/ellipsis/style/index.d.ts +1 -0
- package/lib/ellipsis/style/index.d.ts.map +1 -0
- package/lib/ellipsis/style/index.js +1 -0
- package/lib/ellipsis/style/index.js.map +1 -0
- package/lib/empty/empty.d.ts +2 -2
- package/lib/empty/empty.js +90 -75
- package/lib/empty/empty.js.map +1 -1
- package/lib/empty/empty.stories.js +19 -18
- package/lib/empty/index.d.ts +1 -1
- package/lib/empty/index.js +20 -19
- package/lib/empty/index.js.map +1 -1
- package/lib/empty/render-empty.d.ts +3 -0
- package/lib/empty/render-empty.d.ts.map +1 -0
- package/lib/empty/render-empty.js +32 -0
- package/lib/empty/render-empty.js.map +1 -0
- package/lib/empty/style/index.d.ts +3 -0
- package/lib/empty/style/index.d.ts.map +1 -0
- package/lib/empty/style/index.js +4 -0
- package/lib/empty/style/index.js.map +1 -0
- package/lib/exception/exception.js +46 -31
- package/lib/exception/exception.js.map +1 -1
- package/lib/exception/index.js +19 -18
- package/lib/form/index.d.ts +3 -3
- package/lib/form/index.js +23 -22
- package/lib/form/index.js.map +1 -1
- package/lib/handle/index.js +140 -104
- package/lib/handle/index.js.map +1 -1
- package/lib/handle/style/index.d.ts +1 -0
- package/lib/handle/style/index.d.ts.map +1 -0
- package/lib/handle/style/index.js +1 -0
- package/lib/handle/style/index.js.map +1 -0
- package/lib/icon/index.d.ts +3 -3
- package/lib/icon/index.js +23 -22
- package/lib/icon/index.js.map +1 -1
- package/lib/icon-list/index.js +7 -121
- package/lib/icon-list/style/index.d.ts +3 -0
- package/lib/icon-list/style/index.d.ts.map +1 -0
- package/lib/icon-list/style/index.js +8 -0
- package/lib/icon-list/style/index.js.map +1 -0
- package/lib/img/Contain.js +69 -44
- package/lib/img/Cover.js +117 -78
- package/lib/img/index.js +74 -60
- package/lib/img/style/index.d.ts +1 -0
- package/lib/img/style/index.d.ts.map +1 -0
- package/lib/img/style/index.js +1 -0
- package/lib/img/style/index.js.map +1 -0
- package/lib/index.js +614 -184
- package/lib/input/index.d.ts +3 -3
- package/lib/input/index.js +23 -22
- package/lib/input/index.js.map +1 -1
- package/lib/input-number/index.d.ts +3 -3
- package/lib/input-number/index.js +23 -22
- package/lib/input-number/index.js.map +1 -1
- package/lib/layout/index.d.ts +3 -3
- package/lib/layout/index.js +23 -22
- package/lib/layout/index.js.map +1 -1
- package/lib/list/index.d.ts +3 -3
- package/lib/list/index.js +23 -22
- package/lib/list/index.js.map +1 -1
- package/lib/loading-button/index.js +58 -55
- package/lib/loading-button/style/index.d.ts +1 -0
- package/lib/loading-button/style/index.d.ts.map +1 -0
- package/lib/loading-button/style/index.js +1 -0
- package/lib/loading-button/style/index.js.map +1 -0
- package/lib/locale/default.js +12 -10
- package/lib/locale/default.js.map +1 -1
- package/lib/locale/en_US.js +37 -35
- package/lib/locale/en_US.js.map +1 -1
- package/lib/locale/index.js +36 -18
- package/lib/locale/zh_CN.js +37 -35
- package/lib/locale/zh_CN.js.map +1 -1
- package/lib/locale-provider/index.d.ts +3 -3
- package/lib/locale-provider/index.js +26 -25
- package/lib/locale-provider/index.js.map +1 -1
- package/lib/mention/index.d.ts +3 -3
- package/lib/mention/index.js +23 -22
- package/lib/mention/index.js.map +1 -1
- package/lib/mentions/index.d.ts +3 -3
- package/lib/mentions/index.js +23 -22
- package/lib/mentions/index.js.map +1 -1
- package/lib/menu/index.d.ts +3 -3
- package/lib/menu/index.js +23 -22
- package/lib/menu/index.js.map +1 -1
- package/lib/message/index.d.ts +3 -3
- package/lib/message/index.js +23 -22
- package/lib/message/index.js.map +1 -1
- package/lib/modal/index.d.ts +1 -1
- package/lib/modal/index.js +22 -21
- package/lib/modal/index.js.map +1 -1
- package/lib/modal/modal.d.ts +9 -9
- package/lib/modal/modal.js +53 -49
- package/lib/modal/modal.js.map +1 -1
- package/lib/notification/index.d.ts +3 -3
- package/lib/notification/index.js +23 -22
- package/lib/notification/index.js.map +1 -1
- package/lib/page/Box.js +66 -40
- package/lib/page/index.d.ts.map +1 -1
- package/lib/page/index.js +147 -99
- package/lib/page/index.js.map +1 -1
- package/lib/page/style/index.d.ts +1 -0
- package/lib/page/style/index.d.ts.map +1 -0
- package/lib/page/style/index.js +1 -0
- package/lib/page/style/index.js.map +1 -0
- package/lib/page/utils.js +22 -16
- package/lib/page-header/index.d.ts +3 -3
- package/lib/page-header/index.js +23 -22
- package/lib/page-header/index.js.map +1 -1
- package/lib/pagination/index.d.ts +3 -3
- package/lib/pagination/index.js +23 -22
- package/lib/pagination/index.js.map +1 -1
- package/lib/popconfirm/index.d.ts +3 -3
- package/lib/popconfirm/index.js +23 -22
- package/lib/popconfirm/index.js.map +1 -1
- package/lib/popover/index.d.ts +3 -3
- package/lib/popover/index.js +23 -22
- package/lib/popover/index.js.map +1 -1
- package/lib/prev-locale.js +67 -53
- package/lib/progress/index.d.ts +3 -3
- package/lib/progress/index.js +23 -22
- package/lib/progress/index.js.map +1 -1
- package/lib/query-form/Field/Checkbox.js +28 -22
- package/lib/query-form/Field/Select.js +79 -68
- package/lib/query-form/Field/SelectInput.js +85 -73
- package/lib/query-form/Field/fieldsMap.d.ts +2 -2
- package/lib/query-form/Field/fieldsMap.js +34 -32
- package/lib/query-form/Field/index.js +139 -95
- package/lib/query-form/createActions.js +53 -50
- package/lib/query-form/index.js +377 -286
- package/lib/query-form/index.js.map +1 -1
- package/lib/query-form/style/index.d.ts +1 -0
- package/lib/query-form/style/index.d.ts.map +1 -0
- package/lib/query-form/style/index.js +1 -0
- package/lib/query-form/style/index.js.map +1 -0
- package/lib/query-form/useForm.js +11 -11
- package/lib/query-list-scene/List.d.ts.map +1 -1
- package/lib/query-list-scene/List.js +358 -291
- package/lib/query-list-scene/List.js.map +1 -1
- package/lib/query-list-scene/QueryForm.js +161 -103
- package/lib/query-list-scene/QueryForm.js.map +1 -1
- package/lib/query-list-scene/QueryListScene.js +66 -31
- package/lib/query-list-scene/Title.js +15 -9
- package/lib/query-list-scene/Toolbar.js +31 -20
- package/lib/query-list-scene/createActions.js +79 -64
- package/lib/query-list-scene/createActions.js.map +1 -1
- package/lib/query-list-scene/index.js +28 -24
- package/lib/query-list-scene/style/index.d.ts +1 -0
- package/lib/query-list-scene/style/index.d.ts.map +1 -0
- package/lib/query-list-scene/style/index.js +1 -0
- package/lib/query-list-scene/style/index.js.map +1 -0
- package/lib/query-list-scene/useActions.js +11 -11
- package/lib/radio/index.d.ts +3 -3
- package/lib/radio/index.js +23 -22
- package/lib/radio/index.js.map +1 -1
- package/lib/rate/index.d.ts +3 -3
- package/lib/rate/index.js +23 -22
- package/lib/rate/index.js.map +1 -1
- package/lib/render-empty/index.js +8 -4
- package/lib/render-empty/render-empty.js +28 -22
- package/lib/render-empty/render-empty.js.map +1 -1
- package/lib/render-empty/style/index.d.ts +2 -0
- package/lib/render-empty/style/index.d.ts.map +1 -0
- package/lib/render-empty/style/index.js +3 -0
- package/lib/render-empty/style/index.js.map +1 -0
- package/lib/result/index.d.ts +3 -3
- package/lib/result/index.js +23 -22
- package/lib/result/index.js.map +1 -1
- package/lib/row/index.d.ts +3 -3
- package/lib/row/index.js +23 -22
- package/lib/row/index.js.map +1 -1
- package/lib/select/index.d.ts +3 -3
- package/lib/select/index.js +23 -22
- package/lib/select/index.js.map +1 -1
- package/lib/skeleton/index.d.ts +3 -3
- package/lib/skeleton/index.js +23 -22
- package/lib/skeleton/index.js.map +1 -1
- package/lib/slider/index.d.ts +3 -3
- package/lib/slider/index.js +23 -22
- package/lib/slider/index.js.map +1 -1
- package/lib/spin/index.d.ts +3 -3
- package/lib/spin/index.js +23 -22
- package/lib/spin/index.js.map +1 -1
- package/lib/statistic/index.d.ts +3 -3
- package/lib/statistic/index.js +23 -22
- package/lib/statistic/index.js.map +1 -1
- package/lib/status/index.d.ts +2 -0
- package/lib/status/index.d.ts.map +1 -0
- package/lib/status/index.js +16 -0
- package/lib/status/index.js.map +1 -0
- package/lib/status/status.d.ts +6 -0
- package/lib/status/status.d.ts.map +1 -0
- package/lib/status/status.js +13 -0
- package/lib/status/status.js.map +1 -0
- package/lib/steps/index.d.ts +1 -1
- package/lib/steps/index.js +20 -19
- package/lib/steps/index.js.map +1 -1
- package/lib/steps/steps.d.ts +3 -3
- package/lib/steps/steps.js +72 -59
- package/lib/steps/steps.js.map +1 -1
- package/lib/svg-components/illustration-403.d.ts +1 -1
- package/lib/svg-components/illustration-403.js +217 -84
- package/lib/svg-components/illustration-404.d.ts +1 -1
- package/lib/svg-components/illustration-404.js +301 -101
- package/lib/svg-components/illustration-500.d.ts +1 -1
- package/lib/svg-components/illustration-500.js +332 -109
- package/lib/svg-components/illustration-empty.d.ts +1 -1
- package/lib/svg-components/illustration-empty.js +65 -41
- package/lib/svg-components/illustration-failure.d.ts +1 -1
- package/lib/svg-components/illustration-failure.js +123 -62
- package/lib/svg-components/illustration-no-access.d.ts +1 -1
- package/lib/svg-components/illustration-no-access.js +125 -61
- package/lib/svg-components/illustration-no-chart.d.ts +1 -1
- package/lib/svg-components/illustration-no-chart.js +145 -63
- package/lib/svg-components/illustration-no-result.d.ts +1 -1
- package/lib/svg-components/illustration-no-result.js +103 -58
- package/lib/svg-components/illustration-offline.d.ts +1 -1
- package/lib/svg-components/illustration-offline.js +142 -69
- package/lib/svg-components/illustration-success.d.ts +1 -1
- package/lib/svg-components/illustration-success.js +148 -69
- package/lib/svg-components/index.js +75 -26
- package/lib/switch/index.d.ts +3 -3
- package/lib/switch/index.js +23 -22
- package/lib/switch/index.js.map +1 -1
- package/lib/table/assets/image-loading-background.d.ts +1 -1
- package/lib/table/assets/image-loading-background.js +56 -43
- package/lib/table/assets/image-loading.d.ts +1 -1
- package/lib/table/assets/image-loading.js +37 -31
- package/lib/table/constants.js +6 -3
- package/lib/table/context.js +7 -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 -20
- package/lib/table/hooks/use-column-setting.js.map +1 -1
- package/lib/table/index.d.ts +1 -1
- package/lib/table/index.js +20 -19
- package/lib/table/index.js.map +1 -1
- package/lib/table/style/index.d.ts +3 -0
- package/lib/table/style/index.d.ts.map +1 -0
- package/lib/table/style/index.js +4 -0
- package/lib/table/style/index.js.map +1 -0
- package/lib/table/table.d.ts +3 -3
- package/lib/table/table.js +110 -92
- package/lib/table/table.js.map +1 -1
- package/lib/table/table.stories.js +182 -154
- 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/tabs/index.d.ts +3 -3
- package/lib/tabs/index.js +23 -22
- package/lib/tabs/index.js.map +1 -1
- package/lib/tag/index.d.ts +52 -3
- package/lib/tag/index.d.ts.map +1 -1
- package/lib/tag/index.js +162 -20
- package/lib/tag/index.js.map +1 -1
- package/lib/tag/tag.less +46 -0
- package/lib/time-picker/index.d.ts +3 -3
- package/lib/time-picker/index.js +23 -22
- package/lib/time-picker/index.js.map +1 -1
- package/lib/timeline/index.d.ts +3 -3
- package/lib/timeline/index.js +23 -22
- package/lib/timeline/index.js.map +1 -1
- package/lib/title/index.js +45 -26
- package/lib/title/style/index.d.ts +1 -0
- package/lib/title/style/index.d.ts.map +1 -0
- package/lib/title/style/index.js +1 -0
- package/lib/title/style/index.js.map +1 -0
- package/lib/tntd-cascader/AntdCascader/component/DisabledContext.js +18 -31
- package/lib/tntd-cascader/AntdCascader/component/FormItemInputContext.js +9 -26
- package/lib/tntd-cascader/AntdCascader/component/SizeContext.js +9 -26
- package/lib/tntd-cascader/AntdCascader/component/context.js +18 -16
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +36 -39
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js.map +1 -1
- package/lib/tntd-cascader/AntdCascader/component/getIcons.js +81 -75
- package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +31 -50
- package/lib/tntd-cascader/AntdCascader/config/utils.js +29 -27
- package/lib/tntd-cascader/AntdCascader/config/warning.js +19 -35
- package/lib/tntd-cascader/AntdCascader/index.js +216 -162
- package/lib/tntd-cascader/AntdCascader/interface.js +13 -6
- 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 +325 -284
- package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +30 -41
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +198 -152
- package/lib/tntd-cascader/rc-cascader/OptionList/index.js +223 -163
- package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +40 -48
- package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +179 -166
- package/lib/tntd-cascader/rc-cascader/context.js +11 -27
- package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +62 -63
- package/lib/tntd-cascader/rc-cascader/hooks/useEntities.js +39 -49
- package/lib/tntd-cascader/rc-cascader/hooks/useMissingValues.js +26 -41
- 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 +75 -65
- package/lib/tntd-cascader/rc-cascader/index.js +9 -7
- package/lib/tntd-cascader/rc-cascader/utils/commonUtil.js +49 -38
- package/lib/tntd-cascader/rc-cascader/utils/treeUtil.js +42 -39
- package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +34 -30
- package/lib/tntd-form/TntdForm/components/Item.js +55 -61
- package/lib/tntd-form/TntdForm/components/ItemComp.js +203 -190
- package/lib/tntd-form/TntdForm/components/List.js +118 -111
- package/lib/tntd-form/TntdForm/index.js +61 -67
- package/lib/tntd-form/TntdForm/interface.js +4 -2
- package/lib/tntd-form/TntdForm/store.js +8 -7
- package/lib/tntd-form/TntdForm/utils.js +182 -184
- package/lib/tntd-form/index.js +12 -8
- package/lib/tntd-icon/fonts/iconfont.js +36 -53
- package/lib/tntd-icon/index.js +40 -25
- package/lib/tntd-icon/style/index.d.ts +1 -0
- package/lib/tntd-icon/style/index.d.ts.map +1 -0
- package/lib/tntd-icon/style/index.js +1 -0
- package/lib/tntd-icon/style/index.js.map +1 -0
- package/lib/tntd-layout/ActionsContext.js +8 -4
- package/lib/tntd-layout/AppList.js +173 -224
- package/lib/tntd-layout/Application.js +75 -111
- package/lib/tntd-layout/Avatar.js +100 -135
- package/lib/tntd-layout/CompatibleLanguage.js +128 -180
- package/lib/tntd-layout/EnterpriseLayout/Avatar.js +117 -146
- package/lib/tntd-layout/EnterpriseLayout/Language.js +73 -90
- package/lib/tntd-layout/EnterpriseLayout/Theme.js +69 -102
- package/lib/tntd-layout/EnterpriseLayout/index.js +28 -17
- package/lib/tntd-layout/GlobalNavigation/NavigationPopup.d.ts.map +1 -1
- package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +283 -277
- package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js.map +1 -1
- package/lib/tntd-layout/GlobalNavigation/index.js +108 -115
- package/lib/tntd-layout/Header.js +77 -136
- package/lib/tntd-layout/HeaderActions.js +105 -106
- package/lib/tntd-layout/HeaderNavs.js +78 -107
- package/lib/tntd-layout/HeaderTabs.js +224 -316
- package/lib/tntd-layout/Iconfont.js +11 -7
- package/lib/tntd-layout/Language.js +69 -76
- package/lib/tntd-layout/Layout.js +214 -171
- package/lib/tntd-layout/Logo.js +69 -144
- package/lib/tntd-layout/OrgAppList.js +238 -388
- package/lib/tntd-layout/SideMenu.js +269 -408
- package/lib/tntd-layout/Theme.js +75 -93
- package/lib/tntd-layout/createActions.js +45 -34
- 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 +68 -66
- package/lib/tntd-layout/index.js +137 -95
- package/lib/tntd-layout/paaslayout/CompactSideMenu.js +131 -182
- package/lib/tntd-layout/paaslayout/Header.js +51 -79
- package/lib/tntd-layout/paaslayout/Logo.js +15 -30
- package/lib/tntd-layout/paaslayout/SideMenu.js +131 -147
- package/lib/tntd-layout/paaslayout/index.js +205 -141
- package/lib/tntd-layout/storage.js +58 -30
- package/lib/tntd-layout/style/index.d.ts +1 -0
- package/lib/tntd-layout/style/index.d.ts.map +1 -0
- package/lib/tntd-layout/style/index.js +1 -0
- package/lib/tntd-layout/style/index.js.map +1 -0
- package/lib/tntd-modal/index.js +98 -62
- package/lib/tntd-modal/style/index.d.ts +1 -0
- package/lib/tntd-modal/style/index.d.ts.map +1 -0
- package/lib/tntd-modal/style/index.js +1 -0
- package/lib/tntd-modal/style/index.js.map +1 -0
- 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 +102 -78
- package/lib/tntd-select/index.d.ts +3 -2
- package/lib/tntd-select/index.d.ts.map +1 -1
- package/lib/tntd-select/index.js +607 -519
- package/lib/tntd-select/style/index.d.ts +1 -0
- package/lib/tntd-select/style/index.d.ts.map +1 -0
- package/lib/tntd-select/style/index.js +1 -0
- package/lib/tntd-select/style/index.js.map +1 -0
- package/lib/tooltip/index.d.ts +3 -3
- package/lib/tooltip/index.js +23 -22
- package/lib/tooltip/index.js.map +1 -1
- package/lib/transfer/index.d.ts +3 -3
- package/lib/transfer/index.js +23 -22
- package/lib/transfer/index.js.map +1 -1
- package/lib/tree/index.d.ts +3 -3
- package/lib/tree/index.js +23 -22
- package/lib/tree/index.js.map +1 -1
- package/lib/tree-select/index.d.ts +3 -3
- package/lib/tree-select/index.js +23 -22
- package/lib/tree-select/index.js.map +1 -1
- package/lib/typography/index.d.ts +3 -3
- package/lib/typography/index.js +23 -22
- package/lib/typography/index.js.map +1 -1
- package/lib/upload/index.d.ts +3 -3
- package/lib/upload/index.js +23 -22
- package/lib/upload/index.js.map +1 -1
- package/lib/utils/checkAuth.js +34 -23
- package/lib/utils/findMenuInfoByPath.js +41 -34
- package/lib/utils/index.js +117 -80
- package/lib/version/index.d.ts +3 -3
- package/lib/version/index.js +23 -22
- package/lib/version/index.js.map +1 -1
- package/package.json +3 -2
- package/themes/default/variables.less +6 -7
|
@@ -1,37 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
exports.warningNullOptions = warningNullOptions;
|
|
8
|
+
var _warning = _interopRequireDefault(require("rc-util/lib/warning"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
7
10
|
// @ts-nocheck
|
|
8
|
-
|
|
11
|
+
|
|
9
12
|
function warningProps(props) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
var onPopupVisibleChange = props.onPopupVisibleChange,
|
|
14
|
+
popupVisible = props.popupVisible,
|
|
15
|
+
popupClassName = props.popupClassName,
|
|
16
|
+
popupPlacement = props.popupPlacement;
|
|
17
|
+
(0, _warning["default"])(!onPopupVisibleChange, '`onPopupVisibleChange` is deprecated. Please use `onDropdownVisibleChange` instead.');
|
|
18
|
+
(0, _warning["default"])(popupVisible === undefined, '`popupVisible` is deprecated. Please use `open` instead.');
|
|
19
|
+
(0, _warning["default"])(popupClassName === undefined, '`popupClassName` is deprecated. Please use `dropdownClassName` instead.');
|
|
20
|
+
(0, _warning["default"])(popupPlacement === undefined, '`popupPlacement` is deprecated. Please use `placement` instead.');
|
|
15
21
|
}
|
|
16
22
|
// value in Cascader options should not be null
|
|
17
23
|
function warningNullOptions(options, fieldNames) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
24
|
+
if (options) {
|
|
25
|
+
var recursiveOptions = function recursiveOptions(optionsList) {
|
|
26
|
+
for (var i = 0; i < optionsList.length; i++) {
|
|
27
|
+
var option = optionsList[i];
|
|
28
|
+
if (option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value] === null) {
|
|
29
|
+
(0, _warning["default"])(false, '`value` in Cascader options should not be `null`.');
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
if (Array.isArray(option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children]) && recursiveOptions(option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children])) {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
recursiveOptions(options);
|
|
38
|
+
}
|
|
34
39
|
}
|
|
35
|
-
|
|
36
|
-
exports
|
|
37
|
-
//# sourceMappingURL=warningPropsUtil.js.map
|
|
40
|
+
var _default = warningProps;
|
|
41
|
+
exports["default"] = _default;
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _isEqual2 = _interopRequireDefault(require("lodash/isEqual"));
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _ItemComp = _interopRequireDefault(require("./ItemComp"));
|
|
11
|
+
var _store = require("../store");
|
|
12
|
+
var _utils = require("../utils");
|
|
13
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
2
16
|
/*
|
|
3
17
|
* @Descripttion: TntdForm.Item
|
|
4
18
|
* @Author: 郑泳健
|
|
@@ -6,66 +20,46 @@
|
|
|
6
20
|
* @LastEditors: 郑泳健
|
|
7
21
|
* @LastEditTime: 2023-04-06 17:46:57
|
|
8
22
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
(0, react_1.useEffect)(() => {
|
|
45
|
-
compsRefs.current[(0, utils_1.getNames)(name).join('.')] = () => {
|
|
46
|
-
var _a, _b;
|
|
47
|
-
(_b = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.onRefresh) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
48
|
-
};
|
|
49
|
-
}, [compsRefs, name]);
|
|
50
|
-
return (react_1.default.createElement(ItemComp_1.default, Object.assign({}, {
|
|
51
|
-
form,
|
|
52
|
-
initialValues,
|
|
53
|
-
updateRefs,
|
|
54
|
-
compsRefs,
|
|
55
|
-
style,
|
|
56
|
-
rules,
|
|
57
|
-
name,
|
|
58
|
-
ref,
|
|
59
|
-
children,
|
|
60
|
-
initialValue,
|
|
61
|
-
shouldUpdate,
|
|
62
|
-
dependencies,
|
|
63
|
-
})));
|
|
23
|
+
|
|
24
|
+
var Item = function Item(_ref) {
|
|
25
|
+
var name = _ref.name,
|
|
26
|
+
children = _ref.children,
|
|
27
|
+
style = _ref.style,
|
|
28
|
+
rules = _ref.rules,
|
|
29
|
+
shouldUpdate = _ref.shouldUpdate,
|
|
30
|
+
initialValue = _ref.initialValue,
|
|
31
|
+
dependencies = _ref.dependencies;
|
|
32
|
+
var _useContext = (0, _react.useContext)(_store.FormContext),
|
|
33
|
+
form = _useContext.form,
|
|
34
|
+
initialValues = _useContext.initialValues,
|
|
35
|
+
updateRefs = _useContext.updateRefs,
|
|
36
|
+
compsRefs = _useContext.compsRefs;
|
|
37
|
+
var ref = (0, _react.useRef)();
|
|
38
|
+
(0, _react.useEffect)(function () {
|
|
39
|
+
compsRefs.current[(0, _utils.getNames)(name).join('.')] = function () {
|
|
40
|
+
var _a, _b;
|
|
41
|
+
(_b = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.onRefresh) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
42
|
+
};
|
|
43
|
+
}, [compsRefs, name]);
|
|
44
|
+
return _react["default"].createElement(_ItemComp["default"], Object.assign({}, {
|
|
45
|
+
form: form,
|
|
46
|
+
initialValues: initialValues,
|
|
47
|
+
updateRefs: updateRefs,
|
|
48
|
+
compsRefs: compsRefs,
|
|
49
|
+
style: style,
|
|
50
|
+
rules: rules,
|
|
51
|
+
name: name,
|
|
52
|
+
ref: ref,
|
|
53
|
+
children: children,
|
|
54
|
+
initialValue: initialValue,
|
|
55
|
+
shouldUpdate: shouldUpdate,
|
|
56
|
+
dependencies: dependencies
|
|
57
|
+
}));
|
|
64
58
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
59
|
+
var _default = (0, _react.memo)(Item, function (nextProps, prevProps) {
|
|
60
|
+
if ((0, _isEqual2["default"])(nextProps.name, prevProps.name) && !!prevProps.name) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
70
64
|
});
|
|
71
|
-
|
|
65
|
+
exports["default"] = _default;
|
|
@@ -1,202 +1,215 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* @Date: 2023-02-23 12:47:28
|
|
6
|
-
* @LastEditors: 郑泳健
|
|
7
|
-
* @LastEditTime: 2023-04-06 17:45:35
|
|
8
|
-
*/
|
|
9
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
-
}
|
|
15
|
-
Object.defineProperty(o, k2, desc);
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
-
}) : function(o, v) {
|
|
23
|
-
o["default"] = v;
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
24
5
|
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
const list = updateRefs.current.dependencies[(0, utils_1.getNames)(name).join('.')];
|
|
76
|
-
if (Array.isArray(list)) {
|
|
77
|
-
list.forEach((i) => {
|
|
78
|
-
var _a, _b;
|
|
79
|
-
(_b = (_a = compsRefs === null || compsRefs === void 0 ? void 0 : compsRefs.current) === null || _a === void 0 ? void 0 : _a[i]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
80
|
-
});
|
|
81
|
-
}
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _utils = require("../utils");
|
|
9
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
10
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
|
+
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; }
|
|
12
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
14
|
+
function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
|
|
15
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
16
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
17
|
+
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."); }
|
|
18
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
19
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
20
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
21
|
+
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."); }
|
|
22
|
+
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); }
|
|
23
|
+
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; }
|
|
24
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
25
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
|
+
var ItemComp = _react["default"].forwardRef(function (_ref, ref) {
|
|
27
|
+
var name = _ref.name,
|
|
28
|
+
children = _ref.children,
|
|
29
|
+
style = _ref.style,
|
|
30
|
+
initialValue = _ref.initialValue,
|
|
31
|
+
rules = _ref.rules,
|
|
32
|
+
shouldUpdate = _ref.shouldUpdate,
|
|
33
|
+
dependencies = _ref.dependencies,
|
|
34
|
+
form = _ref.form,
|
|
35
|
+
updateRefs = _ref.updateRefs,
|
|
36
|
+
initialValues = _ref.initialValues,
|
|
37
|
+
compsRefs = _ref.compsRefs;
|
|
38
|
+
var _useState = (0, _react.useState)(undefined),
|
|
39
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
40
|
+
value = _useState2[0],
|
|
41
|
+
setValue = _useState2[1];
|
|
42
|
+
var _useState3 = (0, _react.useState)(undefined),
|
|
43
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
44
|
+
errorMsg = _useState4[0],
|
|
45
|
+
setErrorMsg = _useState4[1];
|
|
46
|
+
var _useState5 = (0, _react.useState)(false),
|
|
47
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
48
|
+
refresh = _useState6[0],
|
|
49
|
+
setRefresh = _useState6[1];
|
|
50
|
+
(0, _react.useImperativeHandle)(ref, function () {
|
|
51
|
+
return {
|
|
52
|
+
onRefresh: function onRefresh() {
|
|
53
|
+
setRefresh(!refresh);
|
|
54
|
+
}
|
|
82
55
|
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
else {
|
|
103
|
-
form.formData[str] = {
|
|
104
|
-
[i]: {
|
|
105
|
-
value,
|
|
106
|
-
checkItem: () => {
|
|
107
|
-
const error = (0, utils_1.handleCheckItem)(value, rules);
|
|
108
|
-
setErrorMsg(error);
|
|
109
|
-
return error;
|
|
110
|
-
},
|
|
111
|
-
setItemValue: () => { },
|
|
112
|
-
errorMsg: undefined,
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
}
|
|
56
|
+
});
|
|
57
|
+
/** 根据shouldUpdate 和 dependencies收集修改某个字段后需要同步更新的字段 */
|
|
58
|
+
(0, _react.useEffect)(function () {
|
|
59
|
+
var _a;
|
|
60
|
+
var nameStr = (_a = (0, _utils.getNames)(name)) === null || _a === void 0 ? void 0 : _a.join('.');
|
|
61
|
+
if (shouldUpdate) {
|
|
62
|
+
updateRefs.current.shouldUpdateList.push(nameStr);
|
|
63
|
+
}
|
|
64
|
+
if (Array.isArray(dependencies)) {
|
|
65
|
+
var arr = dependencies.map(function (i) {
|
|
66
|
+
return (0, _utils.getNames)(i).join('.');
|
|
67
|
+
});
|
|
68
|
+
if (Array.isArray(arr)) {
|
|
69
|
+
arr.forEach(function (i) {
|
|
70
|
+
if (Array.isArray(updateRefs.current.dependencies[i])) {
|
|
71
|
+
updateRefs.current.dependencies[i] = [].concat(_toConsumableArray(updateRefs.current.dependencies[i]), [(0, _utils.getNames)(name).join('.')]);
|
|
72
|
+
} else {
|
|
73
|
+
updateRefs.current.dependencies[i] = [(0, _utils.getNames)(name).join('.')];
|
|
74
|
+
}
|
|
116
75
|
});
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}, [shouldUpdate, dependencies, name, updateRefs]);
|
|
79
|
+
var updateRender = function updateRender() {
|
|
80
|
+
if (Array.isArray(updateRefs.current.shouldUpdateList)) {
|
|
81
|
+
updateRefs.current.shouldUpdateList.forEach(function (i) {
|
|
82
|
+
var _a, _b;
|
|
83
|
+
(_b = (_a = compsRefs === null || compsRefs === void 0 ? void 0 : compsRefs.current) === null || _a === void 0 ? void 0 : _a[i]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
var list = updateRefs.current.dependencies[(0, _utils.getNames)(name).join('.')];
|
|
87
|
+
if (Array.isArray(list)) {
|
|
88
|
+
list.forEach(function (i) {
|
|
89
|
+
var _a, _b;
|
|
90
|
+
(_b = (_a = compsRefs === null || compsRefs === void 0 ? void 0 : compsRefs.current) === null || _a === void 0 ? void 0 : _a[i]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* 动态修改form内部的值,为啥不在useEffect里面处理的原因是子组件的useEffect会比父组件useEffect先执行,需要保证在子组件useEffect监听value变化的时候获取到的formData永远是最新的
|
|
96
|
+
* @param name
|
|
97
|
+
* @param value
|
|
98
|
+
* @returns
|
|
99
|
+
*/
|
|
100
|
+
var generateFormData = function generateFormData(name, value) {
|
|
101
|
+
if (!name || !form || _typeof(name) !== 'object') return;
|
|
102
|
+
var _name = _toArray(name),
|
|
103
|
+
str = _name[0],
|
|
104
|
+
rest = _name.slice(1);
|
|
105
|
+
rest.forEach(function (i) {
|
|
106
|
+
if (form.formData[str]) {
|
|
107
|
+
form.formData[str][i].value = value;
|
|
108
|
+
form.formData[str][i].checkItem = function () {
|
|
109
|
+
var error = (0, _utils.handleCheckItem)(value, rules);
|
|
110
|
+
setErrorMsg(error);
|
|
111
|
+
return error;
|
|
139
112
|
};
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
113
|
+
} else {
|
|
114
|
+
form.formData[str] = _defineProperty({}, i, {
|
|
115
|
+
value: value,
|
|
116
|
+
checkItem: function checkItem() {
|
|
117
|
+
var error = (0, _utils.handleCheckItem)(value, rules);
|
|
118
|
+
setErrorMsg(error);
|
|
119
|
+
return error;
|
|
120
|
+
},
|
|
121
|
+
setItemValue: function setItemValue() {},
|
|
122
|
+
errorMsg: undefined
|
|
149
123
|
});
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
setValue(_value);
|
|
165
|
-
generateFormData(name, _value);
|
|
166
|
-
updateRender();
|
|
167
|
-
}, []);
|
|
168
|
-
// 默认方法
|
|
169
|
-
const handleChange = (e) => {
|
|
170
|
-
var _a;
|
|
171
|
-
let val;
|
|
172
|
-
if (typeof e === 'object') {
|
|
173
|
-
val = (_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.value;
|
|
174
|
-
}
|
|
175
|
-
else {
|
|
176
|
-
val = e;
|
|
177
|
-
}
|
|
178
|
-
setValue(val);
|
|
179
|
-
generateFormData(name, val);
|
|
180
|
-
const error = (0, utils_1.handleCheckItem)(val, rules);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
// 为了给最外层提供方法去校验,比如保存的时候.
|
|
128
|
+
// 这里依赖不要添加value,因为子组件的useEffect会比父组件useEffect先执行,如果添加了依赖value会导致子组件获取到的formData永远是上一次的
|
|
129
|
+
(0, _react.useEffect)(function () {
|
|
130
|
+
if (!name || !form || _typeof(name) !== 'object') return;
|
|
131
|
+
var _name2 = _toArray(name),
|
|
132
|
+
str = _name2[0],
|
|
133
|
+
rest = _name2.slice(1);
|
|
134
|
+
var addItem = {
|
|
135
|
+
setItemValue: function setItemValue(_val, callback) {
|
|
136
|
+
var error = (0, _utils.handleCheckItem)(_val, rules);
|
|
137
|
+
setValue(_val);
|
|
181
138
|
setErrorMsg(error);
|
|
139
|
+
callback === null || callback === void 0 ? void 0 : callback();
|
|
182
140
|
updateRender();
|
|
141
|
+
},
|
|
142
|
+
checkItem: function checkItem() {
|
|
143
|
+
var error = (0, _utils.handleCheckItem)(value, rules);
|
|
144
|
+
setErrorMsg(error);
|
|
145
|
+
return error;
|
|
146
|
+
},
|
|
147
|
+
value: value,
|
|
148
|
+
errorMsg: errorMsg
|
|
183
149
|
};
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
150
|
+
rest.forEach(function (i) {
|
|
151
|
+
if (form.formData[str]) {
|
|
152
|
+
form.formData[str][i] = addItem;
|
|
153
|
+
} else {
|
|
154
|
+
form.formData[str] = _defineProperty({}, i, addItem);
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}, [rules, name, errorMsg, form]);
|
|
158
|
+
/** 这段代码不能删除,当增加/删除列的时候有些默认值需要更新 */
|
|
159
|
+
(0, _react.useEffect)(function () {
|
|
160
|
+
if (initialValue) {
|
|
161
|
+
setValue(initialValue);
|
|
162
|
+
generateFormData(name, initialValue);
|
|
163
|
+
updateRender();
|
|
164
|
+
}
|
|
165
|
+
}, [initialValue]);
|
|
166
|
+
// 初始化设置默认值,
|
|
167
|
+
(0, _react.useEffect)(function () {
|
|
168
|
+
var initValue = (0, _utils.getInitValue)(initialValues, name);
|
|
169
|
+
// @ts-ignore
|
|
170
|
+
var _value = ['', null, undefined].includes(initValue) ? initialValue : initValue;
|
|
171
|
+
setValue(_value);
|
|
172
|
+
generateFormData(name, _value);
|
|
173
|
+
updateRender();
|
|
174
|
+
}, []);
|
|
175
|
+
// 默认方法
|
|
176
|
+
var handleChange = function handleChange(e) {
|
|
177
|
+
var _a;
|
|
178
|
+
var val;
|
|
179
|
+
if (_typeof(e) === 'object') {
|
|
180
|
+
val = (_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.value;
|
|
181
|
+
} else {
|
|
182
|
+
val = e;
|
|
183
|
+
}
|
|
184
|
+
setValue(val);
|
|
185
|
+
generateFormData(name, val);
|
|
186
|
+
var error = (0, _utils.handleCheckItem)(val, rules);
|
|
187
|
+
setErrorMsg(error);
|
|
188
|
+
updateRender();
|
|
189
|
+
};
|
|
190
|
+
return _react["default"].createElement("div", {
|
|
191
|
+
className: errorMsg ? 'has-error custom-form-item-wrapper' : 'custom-form-item-wrapper',
|
|
192
|
+
style: style
|
|
193
|
+
}, _react["default"].Children.map(children, function (child) {
|
|
194
|
+
var _a;
|
|
195
|
+
if (_react["default"].isValidElement(child)) {
|
|
196
|
+
return _react["default"].cloneElement(child, Object.assign({
|
|
197
|
+
value: value,
|
|
198
|
+
form: form,
|
|
199
|
+
onChange: handleChange,
|
|
200
|
+
'data-key': (_a = (0, _utils.getNames)(name)) === null || _a === void 0 ? void 0 : _a.join('.')
|
|
201
|
+
}, child.props));
|
|
202
|
+
}
|
|
203
|
+
return null;
|
|
204
|
+
}), errorMsg && _react["default"].createElement("div", {
|
|
205
|
+
className: "ant-form-explain ant-form-item-explain-error"
|
|
206
|
+
}, errorMsg));
|
|
194
207
|
});
|
|
195
208
|
function arePropsEqual(prevProps, nextProps) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
209
|
+
if (!nextProps.shouldUpdate && Array.isArray(nextProps.dependencies)) {
|
|
210
|
+
return true;
|
|
211
|
+
}
|
|
212
|
+
return false;
|
|
200
213
|
}
|
|
201
|
-
|
|
202
|
-
|
|
214
|
+
var _default = (0, _react.memo)(ItemComp);
|
|
215
|
+
exports["default"] = _default;
|