tntd 2.0.13 → 2.0.14
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/array-input/index.js +31 -6
- package/es/columns/index.js +12 -6
- package/es/development-login/LoginModal.js +10 -4
- package/es/drawer/drawer.js +8 -4
- package/es/ellipsis/index.js +25 -14
- package/es/empty/empty.js +13 -9
- package/es/handle/index.js +27 -14
- package/es/img/Contain.js +19 -13
- package/es/img/Cover.js +24 -13
- package/es/img/index.js +21 -14
- package/es/index.js +1 -0
- package/es/loading-button/index.js +13 -6
- package/es/locale/default.js +2 -0
- package/es/locale/en_US.js +2 -0
- package/es/locale/zh_CN.js +2 -0
- package/es/page/Box.js +28 -19
- package/es/page/index.js +38 -22
- package/es/page/utils.js +5 -0
- package/es/prev-locale.js +3 -0
- package/es/query-form/Field/Checkbox.js +8 -4
- package/es/query-form/Field/Select.js +17 -10
- package/es/query-form/Field/SelectInput.js +18 -4
- package/es/query-form/Field/fieldsMap.js +1 -0
- package/es/query-form/Field/index.js +11 -2
- package/es/query-form/createActions.js +8 -0
- package/es/query-form/index.js +34 -2
- package/es/query-list-scene/List.js +39 -18
- package/es/query-list-scene/QueryForm.js +19 -10
- package/es/query-list-scene/QueryListScene.js +2 -0
- package/es/query-list-scene/Toolbar.js +10 -6
- package/es/query-list-scene/createActions.js +3 -0
- package/es/render-empty/render-empty.js +2 -0
- package/es/steps/steps.js +17 -9
- package/es/steps/style/nav.less +3 -1
- package/es/svg-components/illustration-403.js +2 -0
- package/es/svg-components/illustration-404.js +2 -0
- package/es/svg-components/illustration-500.js +2 -0
- package/es/svg-components/illustration-empty.js +2 -0
- package/es/svg-components/illustration-failure.js +2 -0
- package/es/svg-components/illustration-no-access.js +2 -0
- package/es/svg-components/illustration-no-chart.js +2 -0
- package/es/svg-components/illustration-no-result.js +2 -0
- package/es/svg-components/illustration-offline.js +2 -0
- package/es/svg-components/illustration-success.js +2 -0
- package/es/table/assets/image-loading-background.js +2 -0
- package/es/table/assets/image-loading.js +2 -0
- package/es/table/hooks/use-column-setting.js +1 -0
- package/es/table/table.js +19 -14
- package/es/table/table.stories.js +2 -0
- package/es/table/utils.js +6 -2
- package/es/title/index.js +14 -10
- package/es/tntd-cascader/AntdCascader/component/context.js +4 -2
- package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +2 -0
- package/es/tntd-cascader/AntdCascader/component/getIcons.js +15 -6
- package/es/tntd-cascader/AntdCascader/config/utils.js +2 -0
- package/es/tntd-cascader/AntdCascader/config/warning.js +8 -4
- package/es/tntd-cascader/AntdCascader/index.js +73 -51
- package/es/tntd-cascader/rc-cascader/Cascader.js +113 -86
- package/es/tntd-cascader/rc-cascader/OptionList/Column.js +26 -16
- package/es/tntd-cascader/rc-cascader/OptionList/index.js +43 -26
- package/es/tntd-cascader/rc-cascader/OptionList/useActive.js +7 -5
- package/es/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +41 -12
- package/es/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +10 -4
- package/es/tntd-cascader/rc-cascader/hooks/useEntities.js +4 -2
- package/es/tntd-cascader/rc-cascader/hooks/useMissingValues.js +1 -0
- package/es/tntd-cascader/rc-cascader/hooks/useRefFunc.js +1 -0
- package/es/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +7 -2
- package/es/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +15 -8
- package/es/tntd-cascader/rc-cascader/utils/commonUtil.js +6 -2
- package/es/tntd-cascader/rc-cascader/utils/treeUtil.js +4 -2
- package/es/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +7 -2
- package/es/tntd-icon/fonts/iconfont.js +12 -7
- package/es/tntd-icon/index.js +9 -5
- package/es/tntd-layout/ActionsContext.js +2 -2
- package/es/tntd-layout/AppList.js +14 -2
- package/es/tntd-layout/Application.js +4 -0
- package/es/tntd-layout/Avatar.js +4 -0
- package/es/tntd-layout/CompatibleLanguage.js +13 -0
- package/es/tntd-layout/EnterpriseLayout/Avatar.js +4 -0
- package/es/tntd-layout/EnterpriseLayout/Language.js +6 -0
- package/es/tntd-layout/EnterpriseLayout/Theme.js +4 -0
- package/es/tntd-layout/EnterpriseLayout/index.js +2 -2
- package/es/tntd-layout/GlobalNavigation/NavigationPopup.js +33 -2
- package/es/tntd-layout/GlobalNavigation/index.js +6 -0
- package/es/tntd-layout/HeaderActions.js +32 -28
- package/es/tntd-layout/HeaderNavs.js +14 -6
- package/es/tntd-layout/HeaderTabs.js +35 -14
- package/es/tntd-layout/Language.js +6 -0
- package/es/tntd-layout/Layout.js +7 -2
- package/es/tntd-layout/Logo.js +11 -4
- package/es/tntd-layout/OrgAppList.js +39 -22
- package/es/tntd-layout/SideMenu.js +45 -8
- package/es/tntd-layout/Theme.js +6 -0
- package/es/tntd-layout/index.js +17 -9
- package/es/tntd-layout/paaslayout/CompactSideMenu.js +15 -0
- package/es/tntd-layout/paaslayout/SideMenu.js +15 -0
- package/es/tntd-layout/paaslayout/index.js +13 -4
- package/es/tntd-layout/storage.js +2 -2
- package/es/tntd-modal/index.js +18 -12
- package/es/tntd-second-page/index.js +3 -0
- package/es/tntd-select/DropDownWrap.js +8 -4
- package/es/tntd-select/index.js +118 -74
- package/es/utils/checkAuth.js +1 -0
- package/es/utils/findMenuInfoByPath.js +3 -0
- package/es/utils/index.js +11 -2
- package/lib/affix/index.js +10 -4
- package/lib/alert/index.js +10 -4
- package/lib/anchor/index.js +10 -4
- package/lib/array-input/icon.js +7 -1
- package/lib/array-input/index.js +91 -41
- package/lib/auth-context/index.js +3 -0
- package/lib/auto-complete/index.js +10 -4
- package/lib/avatar/index.js +10 -4
- package/lib/back-top/index.js +10 -4
- package/lib/badge/index.js +10 -4
- package/lib/breadcrumb/index.js +10 -4
- package/lib/button/index.js +10 -4
- package/lib/calendar/index.js +10 -4
- package/lib/card/index.js +10 -4
- package/lib/carousel/index.js +10 -4
- package/lib/cascader/index.js +10 -4
- package/lib/checkbox/index.js +10 -4
- package/lib/col/index.js +10 -4
- package/lib/collapse/index.js +11 -4
- package/lib/columns/index.js +28 -14
- package/lib/comment/index.js +10 -4
- package/lib/config-provider/config-provider.js +2 -0
- package/lib/config-provider/index.js +10 -4
- package/lib/date-picker/index.js +10 -4
- package/lib/descriptions/index.js +10 -4
- package/lib/development-login/LoginModal.js +50 -25
- package/lib/development-login/index.js +22 -11
- package/lib/divider/index.js +10 -4
- package/lib/drawer/drawer.js +16 -6
- package/lib/drawer/index.js +5 -1
- package/lib/dropdown/index.js +10 -4
- package/lib/ellipsis/Svg/CopySVG.js +4 -0
- package/lib/ellipsis/Svg/TickSVG.js +4 -0
- package/lib/ellipsis/index.js +73 -42
- package/lib/empty/empty.js +30 -14
- package/lib/empty/empty.stories.js +21 -3
- package/lib/empty/index.js +5 -1
- package/lib/exception/exception.js +14 -7
- package/lib/exception/index.js +4 -1
- package/lib/form/index.js +10 -4
- package/lib/handle/index.js +46 -19
- package/lib/icon/index.js +10 -4
- package/lib/img/Contain.js +23 -12
- package/lib/img/Cover.js +53 -31
- package/lib/img/index.js +47 -29
- package/lib/index.js +187 -100
- package/lib/input/index.js +10 -4
- package/lib/input-number/index.js +10 -4
- package/lib/layout/index.js +10 -4
- package/lib/list/index.js +10 -4
- package/lib/loading-button/index.js +32 -15
- package/lib/locale/default.js +5 -0
- package/lib/locale/en_US.js +4 -0
- package/lib/locale/index.js +6 -3
- package/lib/locale/zh_CN.js +4 -0
- package/lib/locale-provider/index.js +10 -4
- package/lib/mention/index.js +10 -4
- package/lib/mentions/index.js +10 -4
- package/lib/menu/index.js +10 -4
- package/lib/message/index.js +11 -4
- package/lib/modal/index.js +11 -4
- package/lib/notification/index.js +10 -4
- package/lib/page/Box.js +37 -24
- package/lib/page/index.js +66 -37
- package/lib/page/utils.js +9 -1
- package/lib/page-header/index.js +10 -4
- package/lib/pagination/index.js +10 -4
- package/lib/popconfirm/index.js +10 -4
- package/lib/popover/index.js +10 -4
- package/lib/prev-locale.js +10 -1
- package/lib/progress/index.js +10 -4
- package/lib/query-form/Field/Checkbox.js +11 -2
- package/lib/query-form/Field/Select.js +45 -27
- package/lib/query-form/Field/SelectInput.js +46 -21
- package/lib/query-form/Field/fieldsMap.js +12 -1
- package/lib/query-form/Field/index.js +70 -38
- package/lib/query-form/createActions.js +7 -0
- package/lib/query-form/index.js +121 -52
- package/lib/query-form/useForm.js +4 -0
- package/lib/query-list-scene/List.js +111 -58
- package/lib/query-list-scene/QueryForm.js +67 -37
- package/lib/query-list-scene/QueryListScene.js +42 -21
- package/lib/query-list-scene/Title.js +5 -1
- package/lib/query-list-scene/Toolbar.js +15 -8
- package/lib/query-list-scene/createActions.js +6 -0
- package/lib/query-list-scene/index.js +10 -0
- package/lib/query-list-scene/useActions.js +4 -0
- package/lib/radio/index.js +10 -4
- package/lib/rate/index.js +10 -4
- package/lib/render-empty/index.js +2 -0
- package/lib/render-empty/render-empty.js +8 -0
- package/lib/result/index.js +10 -4
- package/lib/row/index.js +10 -4
- package/lib/select/index.js +10 -4
- package/lib/skeleton/index.js +10 -4
- package/lib/slider/index.js +10 -4
- package/lib/spin/index.js +10 -4
- package/lib/statistic/index.js +10 -4
- package/lib/steps/index.js +5 -1
- package/lib/steps/steps.js +29 -12
- package/lib/steps/style/nav.less +3 -1
- package/lib/svg-components/illustration-403.js +9 -3
- package/lib/svg-components/illustration-404.js +9 -3
- package/lib/svg-components/illustration-500.js +9 -3
- package/lib/svg-components/illustration-empty.js +9 -3
- package/lib/svg-components/illustration-failure.js +9 -3
- package/lib/svg-components/illustration-no-access.js +9 -3
- package/lib/svg-components/illustration-no-chart.js +9 -3
- package/lib/svg-components/illustration-no-result.js +9 -3
- package/lib/svg-components/illustration-offline.js +9 -3
- package/lib/svg-components/illustration-success.js +9 -3
- package/lib/svg-components/index.js +11 -0
- package/lib/switch/index.js +10 -4
- package/lib/table/assets/image-loading-background.js +9 -3
- package/lib/table/assets/image-loading.js +9 -3
- package/lib/table/context.js +2 -0
- package/lib/table/hooks/index.js +2 -1
- package/lib/table/hooks/use-column-setting.js +16 -8
- package/lib/table/index.js +5 -1
- package/lib/table/table.js +63 -34
- package/lib/table/table.stories.js +11 -2
- package/lib/table/utils.js +11 -2
- package/lib/tabs/index.js +10 -4
- package/lib/tag/index.js +10 -4
- package/lib/time-picker/index.js +10 -4
- package/lib/timeline/index.js +10 -4
- package/lib/title/index.js +20 -10
- package/lib/tntd-cascader/AntdCascader/component/DisabledContext.js +11 -4
- package/lib/tntd-cascader/AntdCascader/component/FormItemInputContext.js +8 -3
- package/lib/tntd-cascader/AntdCascader/component/SizeContext.js +8 -3
- package/lib/tntd-cascader/AntdCascader/component/context.js +9 -3
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +12 -4
- package/lib/tntd-cascader/AntdCascader/component/getIcons.js +37 -19
- package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +17 -8
- package/lib/tntd-cascader/AntdCascader/config/utils.js +15 -6
- package/lib/tntd-cascader/AntdCascader/config/warning.js +15 -7
- package/lib/tntd-cascader/AntdCascader/index.js +133 -80
- package/lib/tntd-cascader/AntdCascader/interface.js +3 -0
- package/lib/tntd-cascader/index.js +2 -0
- package/lib/tntd-cascader/rc-cascader/Cascader.js +188 -123
- package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +21 -11
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +88 -60
- package/lib/tntd-cascader/rc-cascader/OptionList/index.js +109 -65
- package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +33 -18
- package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +106 -56
- package/lib/tntd-cascader/rc-cascader/context.js +8 -3
- package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +31 -14
- package/lib/tntd-cascader/rc-cascader/hooks/useEntities.js +15 -5
- package/lib/tntd-cascader/rc-cascader/hooks/useMissingValues.js +11 -3
- package/lib/tntd-cascader/rc-cascader/hooks/useRefFunc.js +8 -3
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +15 -3
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +41 -26
- package/lib/tntd-cascader/rc-cascader/index.js +3 -0
- package/lib/tntd-cascader/rc-cascader/utils/commonUtil.js +20 -9
- package/lib/tntd-cascader/rc-cascader/utils/treeUtil.js +8 -0
- package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +14 -7
- package/lib/tntd-icon/fonts/iconfont.js +12 -7
- package/lib/tntd-icon/index.js +17 -6
- package/lib/tntd-layout/ActionsContext.js +3 -0
- package/lib/tntd-layout/AppList.js +105 -30
- package/lib/tntd-layout/Application.js +84 -22
- package/lib/tntd-layout/Avatar.js +72 -18
- package/lib/tntd-layout/CompatibleLanguage.js +105 -32
- package/lib/tntd-layout/EnterpriseLayout/Avatar.js +80 -24
- package/lib/tntd-layout/EnterpriseLayout/Language.js +45 -14
- package/lib/tntd-layout/EnterpriseLayout/Theme.js +46 -16
- package/lib/tntd-layout/EnterpriseLayout/index.js +12 -4
- package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +174 -45
- package/lib/tntd-layout/GlobalNavigation/index.js +70 -19
- package/lib/tntd-layout/Header.js +54 -20
- package/lib/tntd-layout/HeaderActions.js +64 -33
- package/lib/tntd-layout/HeaderNavs.js +59 -19
- package/lib/tntd-layout/HeaderTabs.js +111 -43
- package/lib/tntd-layout/Iconfont.js +5 -0
- package/lib/tntd-layout/Language.js +45 -14
- package/lib/tntd-layout/Layout.js +113 -74
- package/lib/tntd-layout/Logo.js +41 -14
- package/lib/tntd-layout/OrgAppList.js +119 -51
- package/lib/tntd-layout/SideMenu.js +120 -42
- package/lib/tntd-layout/Theme.js +71 -19
- package/lib/tntd-layout/createActions.js +5 -0
- package/lib/tntd-layout/images/index.js +28 -0
- package/lib/tntd-layout/index.js +49 -21
- package/lib/tntd-layout/paaslayout/CompactSideMenu.js +81 -29
- package/lib/tntd-layout/paaslayout/Header.js +47 -14
- package/lib/tntd-layout/paaslayout/Logo.js +19 -2
- package/lib/tntd-layout/paaslayout/SideMenu.js +82 -31
- package/lib/tntd-layout/paaslayout/index.js +108 -62
- package/lib/tntd-layout/storage.d.ts +1 -1
- package/lib/tntd-layout/storage.d.ts.map +1 -1
- package/lib/tntd-layout/storage.js +33 -3
- package/lib/tntd-modal/index.js +51 -32
- package/lib/tntd-second-page/index.js +24 -14
- package/lib/tntd-select/DropDownWrap.js +45 -24
- package/lib/tntd-select/index.js +206 -117
- package/lib/tooltip/index.js +10 -4
- package/lib/transfer/index.js +10 -4
- package/lib/tree/index.js +10 -4
- package/lib/tree-select/index.js +10 -4
- package/lib/typography/index.js +10 -4
- package/lib/upload/index.js +10 -4
- package/lib/utils/checkAuth.js +10 -4
- package/lib/utils/findMenuInfoByPath.js +7 -1
- package/lib/utils/index.js +41 -13
- package/lib/version/index.js +10 -4
- package/package.json +1 -1
- package/es/array-input/style/index.js +0 -1
- package/es/array-input/style/index.js.map +0 -1
- package/es/auth-context/style/index.js +0 -1
- package/es/auth-context/style/index.js.map +0 -1
- package/es/development-login/style/index.js +0 -1
- package/es/development-login/style/index.js.map +0 -1
- package/es/ellipsis/style/index.js +0 -1
- package/es/ellipsis/style/index.js.map +0 -1
- package/es/empty/render-empty.js +0 -22
- package/es/empty/render-empty.js.map +0 -1
- package/es/empty/style/index.js +0 -2
- package/es/empty/style/index.js.map +0 -1
- package/es/handle/style/index.js +0 -1
- package/es/handle/style/index.js.map +0 -1
- package/es/icon-list/style/index.js +0 -1
- package/es/icon-list/style/index.js.map +0 -1
- package/es/img/style/index.js +0 -1
- package/es/img/style/index.js.map +0 -1
- package/es/loading-button/style/index.js +0 -1
- package/es/loading-button/style/index.js.map +0 -1
- package/es/page/style/index.js +0 -1
- package/es/page/style/index.js.map +0 -1
- package/es/query-form/style/index.js +0 -1
- package/es/query-form/style/index.js.map +0 -1
- package/es/query-list-scene/style/index.js +0 -1
- package/es/query-list-scene/style/index.js.map +0 -1
- package/es/render-empty/style/index.js +0 -1
- package/es/render-empty/style/index.js.map +0 -1
- package/es/table/style/index.js +0 -2
- package/es/table/style/index.js.map +0 -1
- package/es/title/style/index.js +0 -1
- package/es/title/style/index.js.map +0 -1
- package/es/tntd-icon/style/index.js +0 -1
- package/es/tntd-icon/style/index.js.map +0 -1
- package/es/tntd-layout/style/index.js +0 -1
- package/es/tntd-layout/style/index.js.map +0 -1
- package/es/tntd-modal/style/index.js +0 -1
- package/es/tntd-modal/style/index.js.map +0 -1
- package/es/tntd-select/style/index.js +0 -1
- package/es/tntd-select/style/index.js.map +0 -1
- package/lib/array-input/style/index.d.ts +0 -1
- package/lib/array-input/style/index.d.ts.map +0 -1
- package/lib/array-input/style/index.js +0 -1
- package/lib/array-input/style/index.js.map +0 -1
- package/lib/auth-context/style/index.d.ts +0 -1
- package/lib/auth-context/style/index.d.ts.map +0 -1
- package/lib/auth-context/style/index.js +0 -1
- package/lib/auth-context/style/index.js.map +0 -1
- package/lib/development-login/style/index.d.ts +0 -1
- package/lib/development-login/style/index.d.ts.map +0 -1
- package/lib/development-login/style/index.js +0 -1
- package/lib/development-login/style/index.js.map +0 -1
- package/lib/ellipsis/style/index.d.ts +0 -1
- package/lib/ellipsis/style/index.d.ts.map +0 -1
- package/lib/ellipsis/style/index.js +0 -1
- package/lib/ellipsis/style/index.js.map +0 -1
- package/lib/empty/render-empty.d.ts +0 -3
- package/lib/empty/render-empty.d.ts.map +0 -1
- package/lib/empty/render-empty.js +0 -32
- package/lib/empty/render-empty.js.map +0 -1
- package/lib/empty/style/index.d.ts +0 -3
- package/lib/empty/style/index.d.ts.map +0 -1
- package/lib/empty/style/index.js +0 -4
- package/lib/empty/style/index.js.map +0 -1
- package/lib/handle/style/index.d.ts +0 -1
- package/lib/handle/style/index.d.ts.map +0 -1
- package/lib/handle/style/index.js +0 -1
- package/lib/handle/style/index.js.map +0 -1
- package/lib/icon-list/style/index.d.ts +0 -3
- package/lib/icon-list/style/index.d.ts.map +0 -1
- package/lib/icon-list/style/index.js +0 -8
- package/lib/icon-list/style/index.js.map +0 -1
- package/lib/img/style/index.d.ts +0 -1
- package/lib/img/style/index.d.ts.map +0 -1
- package/lib/img/style/index.js +0 -1
- package/lib/img/style/index.js.map +0 -1
- package/lib/loading-button/style/index.d.ts +0 -1
- package/lib/loading-button/style/index.d.ts.map +0 -1
- package/lib/loading-button/style/index.js +0 -1
- package/lib/loading-button/style/index.js.map +0 -1
- package/lib/page/style/index.d.ts +0 -1
- package/lib/page/style/index.d.ts.map +0 -1
- package/lib/page/style/index.js +0 -1
- package/lib/page/style/index.js.map +0 -1
- package/lib/query-form/style/index.d.ts +0 -1
- package/lib/query-form/style/index.d.ts.map +0 -1
- package/lib/query-form/style/index.js +0 -1
- package/lib/query-form/style/index.js.map +0 -1
- package/lib/query-list-scene/style/index.d.ts +0 -1
- package/lib/query-list-scene/style/index.d.ts.map +0 -1
- package/lib/query-list-scene/style/index.js +0 -1
- package/lib/query-list-scene/style/index.js.map +0 -1
- package/lib/render-empty/style/index.d.ts +0 -2
- package/lib/render-empty/style/index.d.ts.map +0 -1
- package/lib/render-empty/style/index.js +0 -3
- package/lib/render-empty/style/index.js.map +0 -1
- package/lib/table/style/index.d.ts +0 -3
- package/lib/table/style/index.d.ts.map +0 -1
- package/lib/table/style/index.js +0 -4
- package/lib/table/style/index.js.map +0 -1
- package/lib/title/style/index.d.ts +0 -1
- package/lib/title/style/index.d.ts.map +0 -1
- package/lib/title/style/index.js +0 -1
- package/lib/title/style/index.js.map +0 -1
- package/lib/tntd-icon/style/index.d.ts +0 -1
- package/lib/tntd-icon/style/index.d.ts.map +0 -1
- package/lib/tntd-icon/style/index.js +0 -1
- package/lib/tntd-icon/style/index.js.map +0 -1
- package/lib/tntd-layout/style/index.d.ts +0 -1
- package/lib/tntd-layout/style/index.d.ts.map +0 -1
- package/lib/tntd-layout/style/index.js +0 -1
- package/lib/tntd-layout/style/index.js.map +0 -1
- package/lib/tntd-modal/style/index.d.ts +0 -1
- package/lib/tntd-modal/style/index.d.ts.map +0 -1
- package/lib/tntd-modal/style/index.js +0 -1
- package/lib/tntd-modal/style/index.js.map +0 -1
- package/lib/tntd-select/style/index.d.ts +0 -1
- package/lib/tntd-select/style/index.d.ts.map +0 -1
- package/lib/tntd-select/style/index.js +0 -1
- package/lib/tntd-select/style/index.js.map +0 -1
package/es/img/index.js
CHANGED
|
@@ -1,37 +1,44 @@
|
|
|
1
1
|
var __rest = this && this.__rest || function (s, e) {
|
|
2
2
|
var t = {};
|
|
3
|
+
|
|
3
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
5
|
+
|
|
4
6
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5
7
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
6
8
|
}
|
|
7
9
|
return t;
|
|
8
10
|
};
|
|
11
|
+
|
|
9
12
|
import React, { Fragment, useState } from 'react';
|
|
10
13
|
import Cover from './Cover';
|
|
11
14
|
import Contain from './Contain';
|
|
12
15
|
export default (props => {
|
|
13
16
|
const _a = props || {},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
{
|
|
18
|
+
type = 'cover',
|
|
19
|
+
src,
|
|
20
|
+
shape = 'sharp',
|
|
21
|
+
title = '',
|
|
22
|
+
alt = '',
|
|
23
|
+
className,
|
|
24
|
+
style,
|
|
25
|
+
width = 'auto',
|
|
26
|
+
height = 'auto',
|
|
27
|
+
errorImgSrc,
|
|
28
|
+
onError
|
|
29
|
+
} = _a,
|
|
30
|
+
rest = __rest(_a, ["type", "src", "shape", "title", "alt", "className", "style", "width", "height", "errorImgSrc", "onError"]);
|
|
31
|
+
|
|
28
32
|
const [src2, setSrc2] = useState(src);
|
|
33
|
+
|
|
29
34
|
const handleImgLoadError = () => {
|
|
30
35
|
if (errorImgSrc) {
|
|
31
36
|
setSrc2(props.errorImgSrc);
|
|
32
37
|
}
|
|
38
|
+
|
|
33
39
|
props.onError && props.onError();
|
|
34
40
|
};
|
|
41
|
+
|
|
35
42
|
const params = Object.assign({
|
|
36
43
|
type,
|
|
37
44
|
src: src2,
|
package/es/index.js
CHANGED
|
@@ -1,31 +1,38 @@
|
|
|
1
1
|
var __rest = this && this.__rest || function (s, e) {
|
|
2
2
|
var t = {};
|
|
3
|
+
|
|
3
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
5
|
+
|
|
4
6
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5
7
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
6
8
|
}
|
|
7
9
|
return t;
|
|
8
10
|
};
|
|
11
|
+
|
|
9
12
|
import React, { useState, useEffect } from 'react';
|
|
10
13
|
import Button from '../button';
|
|
11
14
|
export default (_a => {
|
|
12
15
|
var {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
loadingText,
|
|
17
|
+
loading: pLoading,
|
|
18
|
+
onClick,
|
|
19
|
+
children
|
|
20
|
+
} = _a,
|
|
21
|
+
otherProps = __rest(_a, ["loadingText", "loading", "onClick", "children"]);
|
|
22
|
+
|
|
19
23
|
const [loading, setLoading] = useState(pLoading);
|
|
24
|
+
|
|
20
25
|
const doClick = evt => {
|
|
21
26
|
if (!loading) {
|
|
22
27
|
setLoading(true);
|
|
23
28
|
const returnVal = onClick && onClick(evt, () => setLoading(false));
|
|
29
|
+
|
|
24
30
|
if (returnVal instanceof Promise) {
|
|
25
31
|
returnVal.then(() => setLoading(false)).catch(() => setLoading(false));
|
|
26
32
|
}
|
|
27
33
|
}
|
|
28
34
|
};
|
|
35
|
+
|
|
29
36
|
useEffect(() => {
|
|
30
37
|
setLoading(pLoading);
|
|
31
38
|
}, [pLoading]);
|
package/es/locale/default.js
CHANGED
package/es/locale/en_US.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _merge from "lodash/merge";
|
|
2
2
|
import sourceLocale from 'antd/es/locale/en_US';
|
|
3
|
+
|
|
3
4
|
const en_US = _merge({}, sourceLocale, {
|
|
4
5
|
Table: {
|
|
5
6
|
loadingDescription: 'loading...',
|
|
@@ -28,4 +29,5 @@ const en_US = _merge({}, sourceLocale, {
|
|
|
28
29
|
back: 'Back'
|
|
29
30
|
}
|
|
30
31
|
});
|
|
32
|
+
|
|
31
33
|
export default en_US;
|
package/es/locale/zh_CN.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _merge from "lodash/merge";
|
|
2
2
|
import sourceLocale from 'antd/es/locale/zh_CN';
|
|
3
|
+
|
|
3
4
|
const zh_CN = _merge({}, sourceLocale, {
|
|
4
5
|
Table: {
|
|
5
6
|
loadingDescription: '数据加载中...',
|
|
@@ -28,4 +29,5 @@ const zh_CN = _merge({}, sourceLocale, {
|
|
|
28
29
|
back: '返回'
|
|
29
30
|
}
|
|
30
31
|
});
|
|
32
|
+
|
|
31
33
|
export default zh_CN;
|
package/es/page/Box.js
CHANGED
|
@@ -1,44 +1,52 @@
|
|
|
1
1
|
var __rest = this && this.__rest || function (s, e) {
|
|
2
2
|
var t = {};
|
|
3
|
+
|
|
3
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
5
|
+
|
|
4
6
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5
7
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
6
8
|
}
|
|
7
9
|
return t;
|
|
8
10
|
};
|
|
11
|
+
|
|
9
12
|
import React from 'react';
|
|
10
13
|
import { addUnitForValue } from './utils';
|
|
11
14
|
import Card from '../card';
|
|
15
|
+
|
|
12
16
|
const Box = _a => {
|
|
13
17
|
var {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
inLayout,
|
|
19
|
+
clsPrefix = 'tnt-page',
|
|
20
|
+
children,
|
|
21
|
+
noPadding = false,
|
|
22
|
+
headerHeight,
|
|
23
|
+
bordered = false,
|
|
24
|
+
bodyStyle = {},
|
|
25
|
+
headStyle = {},
|
|
26
|
+
height,
|
|
27
|
+
size = 'small',
|
|
28
|
+
contentTotalMargin = '0px'
|
|
29
|
+
} = _a,
|
|
30
|
+
restProps = __rest(_a, ["inLayout", "clsPrefix", "children", "noPadding", "headerHeight", "bordered", "bodyStyle", "headStyle", "height", "size", "contentTotalMargin"]);
|
|
31
|
+
|
|
27
32
|
let cardTitleHeight = 0;
|
|
33
|
+
|
|
28
34
|
if (restProps.title) {
|
|
29
35
|
// 根据Card的size,计算Card的title的高度值
|
|
30
|
-
cardTitleHeight = size === 'small' ? 40 : 60;
|
|
31
|
-
|
|
36
|
+
cardTitleHeight = size === 'small' ? 40 : 60; // 如果Card的自定义高度,Card的title就使用此高度
|
|
37
|
+
|
|
32
38
|
if (headStyle.hasOwnProperty(height)) {
|
|
33
39
|
cardTitleHeight = headStyle.height;
|
|
34
40
|
}
|
|
35
|
-
}
|
|
36
|
-
|
|
41
|
+
} // 如果设置了noPadding,优先级最高
|
|
42
|
+
|
|
43
|
+
|
|
37
44
|
if (noPadding) {
|
|
38
45
|
bodyStyle.padding = 0;
|
|
39
46
|
headStyle.padding = 0;
|
|
40
|
-
}
|
|
41
|
-
|
|
47
|
+
} // 如果传入只有数字,需要默认加px
|
|
48
|
+
|
|
49
|
+
|
|
42
50
|
cardTitleHeight = addUnitForValue(cardTitleHeight);
|
|
43
51
|
const cardBodyHeight = `calc(${height} - ${headerHeight} - ${contentTotalMargin} - ${cardTitleHeight})`;
|
|
44
52
|
return React.createElement(Card, Object.assign({
|
|
@@ -52,4 +60,5 @@ const Box = _a => {
|
|
|
52
60
|
headStyle: headStyle
|
|
53
61
|
}, restProps), children);
|
|
54
62
|
};
|
|
63
|
+
|
|
55
64
|
export default Box;
|
package/es/page/index.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
var __rest = this && this.__rest || function (s, e) {
|
|
2
2
|
var t = {};
|
|
3
|
+
|
|
3
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
5
|
+
|
|
4
6
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5
7
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
6
8
|
}
|
|
7
9
|
return t;
|
|
8
10
|
};
|
|
11
|
+
|
|
9
12
|
import cn from 'classnames';
|
|
10
13
|
import React from 'react';
|
|
11
14
|
import Icon from '../tntd-icon';
|
|
@@ -13,48 +16,57 @@ import Box from './Box';
|
|
|
13
16
|
import { addUnitForValue, computeWidth } from './utils';
|
|
14
17
|
import './index.less';
|
|
15
18
|
const clsPrefix = 'tnt-page';
|
|
19
|
+
|
|
16
20
|
const isPageBox = child => {
|
|
17
21
|
var _a;
|
|
22
|
+
|
|
18
23
|
return (child === null || child === void 0 ? void 0 : child.type) === Box || ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.pageBox);
|
|
19
24
|
};
|
|
25
|
+
|
|
20
26
|
const PageLayout = _a => {
|
|
21
27
|
var _b;
|
|
28
|
+
|
|
22
29
|
var {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
height = '100vh',
|
|
31
|
+
headerHeight = 50,
|
|
32
|
+
children,
|
|
33
|
+
title,
|
|
34
|
+
goBack,
|
|
35
|
+
goBackText,
|
|
36
|
+
center,
|
|
37
|
+
extra,
|
|
38
|
+
size = 'small',
|
|
39
|
+
inLayout = false,
|
|
40
|
+
className
|
|
41
|
+
} = _a,
|
|
42
|
+
restProps = __rest(_a, ["height", "headerHeight", "children", "title", "goBack", "goBackText", "center", "extra", "size", "inLayout", "className"]); // 如果传入只有数字,需要默认加px
|
|
43
|
+
|
|
44
|
+
|
|
37
45
|
let computedHeaderHeight = addUnitForValue(headerHeight);
|
|
38
|
-
let computedHeight = addUnitForValue(height);
|
|
39
|
-
|
|
46
|
+
let computedHeight = addUnitForValue(height); // 判断是否有标题栏
|
|
47
|
+
|
|
40
48
|
if (!(title || extra || center)) {
|
|
41
49
|
computedHeaderHeight = '0px';
|
|
42
50
|
}
|
|
51
|
+
|
|
43
52
|
if (inLayout) {
|
|
44
53
|
computedHeaderHeight = '40px';
|
|
45
|
-
}
|
|
46
|
-
|
|
54
|
+
} // 计算中间的zIndex,灰色递减,白色递增
|
|
55
|
+
|
|
56
|
+
|
|
47
57
|
let whiteCols = 0;
|
|
48
|
-
let childrenToArray = [];
|
|
49
|
-
|
|
50
|
-
let boxCount = 0;
|
|
51
|
-
|
|
58
|
+
let childrenToArray = []; // 计算children type是box的数量
|
|
59
|
+
|
|
60
|
+
let boxCount = 0; // 如果children是单个节点,统一转为数组处理计算层级
|
|
61
|
+
|
|
52
62
|
console.log('children', children);
|
|
63
|
+
|
|
53
64
|
if (typeof children === 'object') {
|
|
54
65
|
childrenToArray = [children];
|
|
55
66
|
} else if (Array.isArray(children)) {
|
|
56
67
|
childrenToArray = [...children];
|
|
57
68
|
}
|
|
69
|
+
|
|
58
70
|
console.log('React.Children', React.Children);
|
|
59
71
|
React.Children.map(children, child => {
|
|
60
72
|
if (isPageBox(child)) {
|
|
@@ -108,6 +120,7 @@ const PageLayout = _a => {
|
|
|
108
120
|
// console.log("没有type");
|
|
109
121
|
return React.cloneElement(React.createElement("div", null, child));
|
|
110
122
|
}
|
|
123
|
+
|
|
111
124
|
const extraProps = Object.assign({
|
|
112
125
|
headerHeight: computedHeaderHeight,
|
|
113
126
|
size,
|
|
@@ -115,9 +128,11 @@ const PageLayout = _a => {
|
|
|
115
128
|
contentTotalMargin: inLayout ? '32px' : '0px',
|
|
116
129
|
inLayout
|
|
117
130
|
}, child.props);
|
|
131
|
+
|
|
118
132
|
if (!isPageBox(child)) {
|
|
119
133
|
return React.cloneElement(child, extraProps);
|
|
120
134
|
}
|
|
135
|
+
|
|
121
136
|
const {
|
|
122
137
|
mode = 'gray',
|
|
123
138
|
width
|
|
@@ -134,5 +149,6 @@ const PageLayout = _a => {
|
|
|
134
149
|
}, React.cloneElement(child, extraProps));
|
|
135
150
|
})));
|
|
136
151
|
};
|
|
152
|
+
|
|
137
153
|
PageLayout.Box = Box;
|
|
138
154
|
export default PageLayout;
|
package/es/page/utils.js
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
const computeWidth = width => {
|
|
2
2
|
let flex = '1';
|
|
3
3
|
const validNumber = isValidNumber(width);
|
|
4
|
+
|
|
4
5
|
if (/(%|px)$/.test(width) && validNumber) {
|
|
5
6
|
flex = `0 0 ${width}`;
|
|
6
7
|
} else if (!isNaN(width)) {
|
|
7
8
|
flex = `0 0 ${width}px`;
|
|
8
9
|
}
|
|
10
|
+
|
|
9
11
|
return flex;
|
|
10
12
|
};
|
|
13
|
+
|
|
11
14
|
const isValidNumber = value => !isNaN(parseFloat(value));
|
|
15
|
+
|
|
12
16
|
const addUnitForValue = (value, unit = 'px') => !isNaN(value) ? `${value}${unit}` : value;
|
|
17
|
+
|
|
13
18
|
export { computeWidth, isValidNumber, addUnitForValue };
|
package/es/prev-locale.js
CHANGED
|
@@ -38,15 +38,18 @@ export const en_US = {
|
|
|
38
38
|
};
|
|
39
39
|
export const getText = (key, language = 'cn', ...params) => {
|
|
40
40
|
var _a;
|
|
41
|
+
|
|
41
42
|
const text = (_a = {
|
|
42
43
|
cn: zh_CN,
|
|
43
44
|
en: en_US
|
|
44
45
|
}[language] || zh_CN) === null || _a === void 0 ? void 0 : _a[key];
|
|
46
|
+
|
|
45
47
|
if (params === null || params === void 0 ? void 0 : params.length) {
|
|
46
48
|
return params.reduce((acc, cur) => {
|
|
47
49
|
return acc.replace(/%s/, cur);
|
|
48
50
|
}, text);
|
|
49
51
|
}
|
|
52
|
+
|
|
50
53
|
return text;
|
|
51
54
|
};
|
|
52
55
|
export const getLanguage = () => localStorage.getItem('lang') || 'cn';
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
var __rest = this && this.__rest || function (s, e) {
|
|
2
2
|
var t = {};
|
|
3
|
+
|
|
3
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
5
|
+
|
|
4
6
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5
7
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
6
8
|
}
|
|
7
9
|
return t;
|
|
8
10
|
};
|
|
11
|
+
|
|
9
12
|
import React from 'react';
|
|
10
13
|
import Checkbox from '../../checkbox';
|
|
11
14
|
export default (_a => {
|
|
12
15
|
var {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
value,
|
|
17
|
+
onChange
|
|
18
|
+
} = _a,
|
|
19
|
+
props = __rest(_a, ["value", "onChange"]);
|
|
20
|
+
|
|
17
21
|
return React.createElement(Checkbox, Object.assign({}, props, {
|
|
18
22
|
checked: value,
|
|
19
23
|
onChange: evt => {
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
var __rest = this && this.__rest || function (s, e) {
|
|
2
2
|
var t = {};
|
|
3
|
+
|
|
3
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
5
|
+
|
|
4
6
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5
7
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
6
8
|
}
|
|
7
9
|
return t;
|
|
8
10
|
};
|
|
11
|
+
|
|
9
12
|
import React, { useState, useEffect } from 'react';
|
|
10
13
|
import Select from '../../select';
|
|
11
14
|
const {
|
|
@@ -13,21 +16,24 @@ const {
|
|
|
13
16
|
} = Select;
|
|
14
17
|
export default (props => {
|
|
15
18
|
const {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
options,
|
|
20
|
+
params,
|
|
21
|
+
queryKey = 'name',
|
|
22
|
+
fieldNames = {
|
|
23
|
+
label: 'label',
|
|
24
|
+
value: 'value'
|
|
25
|
+
},
|
|
26
|
+
loadData
|
|
27
|
+
} = props,
|
|
28
|
+
rest = __rest(props, ["options", "params", "queryKey", "fieldNames", "loadData"]);
|
|
29
|
+
|
|
26
30
|
const [items, setItems] = useState(options || []);
|
|
27
31
|
const [query, setQuery] = useState('');
|
|
32
|
+
|
|
28
33
|
const onSearch = val => {
|
|
29
34
|
setQuery(val);
|
|
30
35
|
};
|
|
36
|
+
|
|
31
37
|
if (loadData) {
|
|
32
38
|
useEffect(() => {
|
|
33
39
|
loadData(Object.assign({
|
|
@@ -37,6 +43,7 @@ export default (props => {
|
|
|
37
43
|
});
|
|
38
44
|
}, [params, query]);
|
|
39
45
|
}
|
|
46
|
+
|
|
40
47
|
useEffect(() => {
|
|
41
48
|
setItems(options || []);
|
|
42
49
|
}, [options]);
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import _get from "lodash/get";
|
|
2
|
+
|
|
2
3
|
var __rest = this && this.__rest || function (s, e) {
|
|
3
4
|
var t = {};
|
|
5
|
+
|
|
4
6
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
7
|
+
|
|
5
8
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
6
9
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
7
10
|
}
|
|
8
11
|
return t;
|
|
9
12
|
};
|
|
13
|
+
|
|
10
14
|
import React, { useState, useEffect } from 'react';
|
|
11
15
|
import Select from '../../select';
|
|
12
16
|
import Input from '../../input';
|
|
@@ -15,30 +19,38 @@ const {
|
|
|
15
19
|
} = Select;
|
|
16
20
|
export default (props => {
|
|
17
21
|
const {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
options = [],
|
|
23
|
+
addonBeforeStyle
|
|
24
|
+
} = props,
|
|
25
|
+
inputProps = __rest(props, ["options", "addonBeforeStyle"]);
|
|
26
|
+
|
|
22
27
|
const [items, setItems] = useState(options);
|
|
28
|
+
|
|
23
29
|
const getInitialKey = () => {
|
|
24
30
|
let key = _get(options, '0.value');
|
|
31
|
+
|
|
25
32
|
if (inputProps.value) {
|
|
26
33
|
key = _get(Object.keys(inputProps.value), '0') || key;
|
|
27
34
|
}
|
|
35
|
+
|
|
28
36
|
return key;
|
|
29
37
|
};
|
|
38
|
+
|
|
30
39
|
const [key, setKey] = useState(getInitialKey());
|
|
40
|
+
|
|
31
41
|
const onKeyChange = key => {
|
|
32
42
|
setKey(key);
|
|
33
43
|
props.onChange({
|
|
34
44
|
[key]: ''
|
|
35
45
|
});
|
|
36
46
|
};
|
|
47
|
+
|
|
37
48
|
const onChange = evt => {
|
|
38
49
|
props.onChange({
|
|
39
50
|
[key]: evt.target.value
|
|
40
51
|
});
|
|
41
52
|
};
|
|
53
|
+
|
|
42
54
|
const addonBefore = React.createElement(Select, {
|
|
43
55
|
value: key,
|
|
44
56
|
onChange: onKeyChange,
|
|
@@ -52,9 +64,11 @@ export default (props => {
|
|
|
52
64
|
key: value,
|
|
53
65
|
value: value
|
|
54
66
|
}, label)));
|
|
67
|
+
|
|
55
68
|
const getInputValue = () => {
|
|
56
69
|
return _get(inputProps.value, key);
|
|
57
70
|
};
|
|
71
|
+
|
|
58
72
|
useEffect(() => {
|
|
59
73
|
setItems(options);
|
|
60
74
|
setKey(getInitialKey());
|
|
@@ -3,7 +3,9 @@ import React, { PureComponent } from 'react';
|
|
|
3
3
|
import fieldsMap, { getFieldWidth } from './fieldsMap';
|
|
4
4
|
import Form from '../../form';
|
|
5
5
|
const FormItem = Form.Item;
|
|
6
|
+
|
|
6
7
|
const isInput = type => ['input', 'string', 'search'].includes(type);
|
|
8
|
+
|
|
7
9
|
export default class Field extends PureComponent {
|
|
8
10
|
constructor(props) {
|
|
9
11
|
super(props);
|
|
@@ -34,11 +36,12 @@ export default class Field extends PureComponent {
|
|
|
34
36
|
const {
|
|
35
37
|
onChange
|
|
36
38
|
} = fieldProps || {};
|
|
37
|
-
onChange && onChange(...args);
|
|
38
|
-
|
|
39
|
+
onChange && onChange(...args); // Input onChange第一个参数为Event对象,取值特殊处理
|
|
40
|
+
|
|
39
41
|
if (!component && isInput(type)) {
|
|
40
42
|
args[0] = _get(args[0], 'target.value');
|
|
41
43
|
}
|
|
44
|
+
|
|
42
45
|
this.setState({
|
|
43
46
|
value: args[0]
|
|
44
47
|
});
|
|
@@ -59,8 +62,10 @@ export default class Field extends PureComponent {
|
|
|
59
62
|
value: props.initialValue
|
|
60
63
|
};
|
|
61
64
|
}
|
|
65
|
+
|
|
62
66
|
render() {
|
|
63
67
|
var _a;
|
|
68
|
+
|
|
64
69
|
const {
|
|
65
70
|
type = 'input',
|
|
66
71
|
title,
|
|
@@ -83,6 +88,7 @@ export default class Field extends PureComponent {
|
|
|
83
88
|
}, isInput(type) ? {
|
|
84
89
|
onPressEnter: evt => {
|
|
85
90
|
var _a;
|
|
91
|
+
|
|
86
92
|
return form.emit('search', {
|
|
87
93
|
[name]: (_a = evt === null || evt === void 0 ? void 0 : evt.target) === null || _a === void 0 ? void 0 : _a.value,
|
|
88
94
|
current: 1
|
|
@@ -95,6 +101,7 @@ export default class Field extends PureComponent {
|
|
|
95
101
|
onChange: this.onChange
|
|
96
102
|
})));
|
|
97
103
|
}
|
|
104
|
+
|
|
98
105
|
componentDidMount() {
|
|
99
106
|
const {
|
|
100
107
|
form
|
|
@@ -102,6 +109,7 @@ export default class Field extends PureComponent {
|
|
|
102
109
|
form.on('setValue', this.updateValue);
|
|
103
110
|
form.on('setValues', this.onFormChange);
|
|
104
111
|
}
|
|
112
|
+
|
|
105
113
|
componentWillUnmount() {
|
|
106
114
|
const {
|
|
107
115
|
form
|
|
@@ -109,4 +117,5 @@ export default class Field extends PureComponent {
|
|
|
109
117
|
form.off('setValue', this.updateValue);
|
|
110
118
|
form.off('setValues', this.onFormChange);
|
|
111
119
|
}
|
|
120
|
+
|
|
112
121
|
}
|
|
@@ -11,29 +11,37 @@ export default (() => {
|
|
|
11
11
|
setData(key, value) {
|
|
12
12
|
_set(data, key, value);
|
|
13
13
|
},
|
|
14
|
+
|
|
14
15
|
getData(key) {
|
|
15
16
|
_get(data, key);
|
|
16
17
|
},
|
|
18
|
+
|
|
17
19
|
setValues(values) {
|
|
18
20
|
data.values = values;
|
|
19
21
|
eventEmitter.emit('setValues', values);
|
|
20
22
|
},
|
|
23
|
+
|
|
21
24
|
getValues() {
|
|
22
25
|
return data.values;
|
|
23
26
|
},
|
|
27
|
+
|
|
24
28
|
resetValues() {
|
|
25
29
|
data.values = Object.assign({}, data.initialValues);
|
|
26
30
|
eventEmitter.emit('setValues', data.values);
|
|
27
31
|
},
|
|
32
|
+
|
|
28
33
|
setValue(name, value) {
|
|
29
34
|
data.values = data.values || {};
|
|
30
35
|
data.values[name] = value;
|
|
31
36
|
eventEmitter.emit('setValue', name, value);
|
|
32
37
|
},
|
|
38
|
+
|
|
33
39
|
getValue(name) {
|
|
34
40
|
var _a;
|
|
41
|
+
|
|
35
42
|
return (_a = data.values) === null || _a === void 0 ? void 0 : _a[name];
|
|
36
43
|
},
|
|
44
|
+
|
|
37
45
|
on: (eventName, callback) => {
|
|
38
46
|
eventEmitter.on(eventName, callback);
|
|
39
47
|
},
|