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/array-input/index.js
CHANGED
|
@@ -4,14 +4,18 @@ import _set from "lodash/set";
|
|
|
4
4
|
import _isFunction from "lodash/isFunction";
|
|
5
5
|
import _isArray from "lodash/isArray";
|
|
6
6
|
import _get from "lodash/get";
|
|
7
|
+
|
|
7
8
|
var __rest = this && this.__rest || function (s, e) {
|
|
8
9
|
var t = {};
|
|
10
|
+
|
|
9
11
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
12
|
+
|
|
10
13
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
11
14
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
12
15
|
}
|
|
13
16
|
return t;
|
|
14
17
|
};
|
|
18
|
+
|
|
15
19
|
import React, { isValidElement, useCallback, useEffect, useState } from 'react';
|
|
16
20
|
import { deleteIcon, plusIcon } from './icon';
|
|
17
21
|
import Col from '../col';
|
|
@@ -22,7 +26,9 @@ import './index.less';
|
|
|
22
26
|
const {
|
|
23
27
|
Column
|
|
24
28
|
} = Table;
|
|
29
|
+
|
|
25
30
|
const getWidth = span => 1000 / span;
|
|
31
|
+
|
|
26
32
|
export default function ArrayInput({
|
|
27
33
|
children,
|
|
28
34
|
defaultValue,
|
|
@@ -38,10 +44,12 @@ export default function ArrayInput({
|
|
|
38
44
|
if (!_isFunction(children)) {
|
|
39
45
|
throw new Error('ArrayInput的children必须是函数');
|
|
40
46
|
}
|
|
47
|
+
|
|
41
48
|
const [_value, setValue] = useState(value || defaultValue);
|
|
42
49
|
useEffect(() => {
|
|
43
50
|
setValue(value);
|
|
44
51
|
}, [value]);
|
|
52
|
+
|
|
45
53
|
const _onChange = useCallback(value => {
|
|
46
54
|
if (onChange) {
|
|
47
55
|
onChange(value);
|
|
@@ -49,36 +57,47 @@ export default function ArrayInput({
|
|
|
49
57
|
setValue(value);
|
|
50
58
|
}
|
|
51
59
|
}, []);
|
|
60
|
+
|
|
52
61
|
let inValue = _value || [];
|
|
62
|
+
|
|
53
63
|
if (require && inValue.length === 0) {
|
|
54
64
|
inValue = [{}];
|
|
55
65
|
}
|
|
66
|
+
|
|
56
67
|
const changeValue = (index, name, value) => {
|
|
57
68
|
inValue[index] = Object.assign(Object.assign({}, inValue[index]), {
|
|
58
69
|
[name]: value
|
|
59
70
|
});
|
|
71
|
+
|
|
60
72
|
_onChange([...inValue]);
|
|
61
73
|
};
|
|
74
|
+
|
|
62
75
|
const onAdd = index => {
|
|
63
76
|
if (index === undefined) {
|
|
64
77
|
_onChange([...inValue, {}]);
|
|
65
78
|
} else {
|
|
66
79
|
inValue.splice(index + 1, 0, {});
|
|
80
|
+
|
|
67
81
|
_onChange([...inValue]);
|
|
68
82
|
}
|
|
69
83
|
};
|
|
84
|
+
|
|
70
85
|
const onDelete = i => {
|
|
71
86
|
inValue.splice(i, 1);
|
|
87
|
+
|
|
72
88
|
_onChange([...inValue]);
|
|
73
89
|
};
|
|
90
|
+
|
|
74
91
|
if (mode === 'list') {
|
|
75
92
|
return React.createElement("div", {
|
|
76
93
|
className: "tntd-array-input"
|
|
77
94
|
}, inValue.map((item, index) => {
|
|
78
95
|
let fields = children(item, index);
|
|
96
|
+
|
|
79
97
|
if (!_isArray(fields)) {
|
|
80
98
|
fields = _get(fields, 'props.children', []);
|
|
81
99
|
}
|
|
100
|
+
|
|
82
101
|
return React.createElement(Row, {
|
|
83
102
|
gutter: gutter,
|
|
84
103
|
key: index,
|
|
@@ -90,13 +109,15 @@ export default function ArrayInput({
|
|
|
90
109
|
key: i
|
|
91
110
|
}, field) : '';
|
|
92
111
|
}
|
|
112
|
+
|
|
93
113
|
const _a = field === null || field === void 0 ? void 0 : field.props,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
114
|
+
{
|
|
115
|
+
name,
|
|
116
|
+
span = 4,
|
|
117
|
+
onChange: fieldChange
|
|
118
|
+
} = _a,
|
|
119
|
+
other = __rest(_a, ["name", "span", "onChange"]);
|
|
120
|
+
|
|
100
121
|
return React.createElement(Col, {
|
|
101
122
|
span: span,
|
|
102
123
|
key: i
|
|
@@ -134,14 +155,17 @@ export default function ArrayInput({
|
|
|
134
155
|
}, addText));
|
|
135
156
|
} else {
|
|
136
157
|
let fields = children({}, 0);
|
|
158
|
+
|
|
137
159
|
if (!_isArray(fields)) {
|
|
138
160
|
fields = _get(fields, 'props.children', []);
|
|
139
161
|
}
|
|
162
|
+
|
|
140
163
|
const dataSource = inValue.map((value, index) => {
|
|
141
164
|
const fields = children(value, index);
|
|
142
165
|
const back = {};
|
|
143
166
|
fields.forEach(field => {
|
|
144
167
|
var _a;
|
|
168
|
+
|
|
145
169
|
const name = (_a = field === null || field === void 0 ? void 0 : field.props) === null || _a === void 0 ? void 0 : _a.name;
|
|
146
170
|
name && _set(back, name, field);
|
|
147
171
|
});
|
|
@@ -172,6 +196,7 @@ export default function ArrayInput({
|
|
|
172
196
|
if (!isValidElement(field)) {
|
|
173
197
|
return field;
|
|
174
198
|
}
|
|
199
|
+
|
|
175
200
|
const {
|
|
176
201
|
onChange: fieldChange
|
|
177
202
|
} = field.props;
|
package/es/columns/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 classnames from 'classnames';
|
|
10
13
|
import React from 'react';
|
|
11
14
|
import { Row, Col } from '../';
|
|
@@ -53,14 +56,16 @@ export const Item = props => {
|
|
|
53
56
|
className: `${clsPrefix}-col-body`
|
|
54
57
|
}, children)));
|
|
55
58
|
};
|
|
59
|
+
|
|
56
60
|
const Columns = props => {
|
|
57
61
|
const {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
children,
|
|
63
|
+
height,
|
|
64
|
+
gutter = 0,
|
|
65
|
+
style
|
|
66
|
+
} = props,
|
|
67
|
+
rest = __rest(props, ["children", "height", "gutter", "style"]);
|
|
68
|
+
|
|
64
69
|
const rowStyle = Object.assign(Object.assign({}, style), {
|
|
65
70
|
height: props.height ? `${props.height}px` : 'calc(100vh)'
|
|
66
71
|
});
|
|
@@ -71,5 +76,6 @@ const Columns = props => {
|
|
|
71
76
|
style: rowStyle
|
|
72
77
|
}, rest), children);
|
|
73
78
|
};
|
|
79
|
+
|
|
74
80
|
Columns.Item = Item;
|
|
75
81
|
export default Columns;
|
|
@@ -4,8 +4,8 @@ import Modal from '../modal';
|
|
|
4
4
|
import Input from '../input';
|
|
5
5
|
import Form from '../form';
|
|
6
6
|
import message from '../message';
|
|
7
|
-
const cookies = new Cookies();
|
|
8
|
-
|
|
7
|
+
const cookies = new Cookies(); // 默认
|
|
8
|
+
|
|
9
9
|
let accountInfoDefault = {
|
|
10
10
|
account: undefined,
|
|
11
11
|
password: undefined
|
|
@@ -15,22 +15,26 @@ export default (({
|
|
|
15
15
|
close,
|
|
16
16
|
signIn
|
|
17
17
|
}) => {
|
|
18
|
-
const [confirmLoading, setConfirmLoading] = useState(false);
|
|
19
|
-
|
|
18
|
+
const [confirmLoading, setConfirmLoading] = useState(false); // 如果storage中已存在,则取storage
|
|
19
|
+
|
|
20
20
|
const storageAccountInfo = localStorage.getItem('accountInfo');
|
|
21
|
+
|
|
21
22
|
if (storageAccountInfo) {
|
|
22
23
|
try {
|
|
23
24
|
accountInfoDefault = JSON.parse(storageAccountInfo);
|
|
24
25
|
} catch (e) {}
|
|
25
26
|
}
|
|
27
|
+
|
|
26
28
|
const [accountInfo, setAccountInfo] = useState(accountInfoDefault);
|
|
27
29
|
const {
|
|
28
30
|
account,
|
|
29
31
|
password
|
|
30
32
|
} = accountInfo;
|
|
33
|
+
|
|
31
34
|
const onSubmit = () => {
|
|
32
35
|
setConfirmLoading(true);
|
|
33
36
|
const returnVal = signIn && signIn(accountInfo);
|
|
37
|
+
|
|
34
38
|
if (returnVal && returnVal.then) {
|
|
35
39
|
returnVal.then(res => {
|
|
36
40
|
message.success('模拟登陆成功');
|
|
@@ -55,11 +59,13 @@ export default (({
|
|
|
55
59
|
});
|
|
56
60
|
}
|
|
57
61
|
};
|
|
62
|
+
|
|
58
63
|
const changeFieldValue = (key, evt) => {
|
|
59
64
|
setAccountInfo(Object.assign(Object.assign({}, accountInfo), {
|
|
60
65
|
[key]: evt.target.value
|
|
61
66
|
}));
|
|
62
67
|
};
|
|
68
|
+
|
|
63
69
|
return React.createElement(Modal, {
|
|
64
70
|
title: "\u5F00\u53D1\u8005\u6A21\u62DF\u767B\u9646",
|
|
65
71
|
visible: visible,
|
package/es/drawer/drawer.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 LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver';
|
|
10
13
|
import classNames from 'classnames';
|
|
11
14
|
import React from 'react';
|
|
@@ -13,10 +16,11 @@ import { ConfigConsumer } from 'antd/es/config-provider';
|
|
|
13
16
|
import { default as AntdDrawer } from 'antd/es/drawer';
|
|
14
17
|
export const Drawer = _a => {
|
|
15
18
|
var {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
closable,
|
|
20
|
+
className
|
|
21
|
+
} = _a,
|
|
22
|
+
rest = __rest(_a, ["closable", "className"]);
|
|
23
|
+
|
|
20
24
|
return React.createElement(ConfigConsumer, null, ({
|
|
21
25
|
getPrefixCls
|
|
22
26
|
}) => {
|
package/es/ellipsis/index.js
CHANGED
|
@@ -11,17 +11,23 @@ import CopySVG from './Svg/CopySVG';
|
|
|
11
11
|
import TickSVG from './Svg/TickSVG';
|
|
12
12
|
import './index.less';
|
|
13
13
|
const tolerance = 0; // In px. Depends on the font you are using
|
|
14
|
+
|
|
14
15
|
const isEllipsisActive = e => {
|
|
15
16
|
var _a, _b;
|
|
17
|
+
|
|
16
18
|
if (e.offsetWidth === e.scrollWidth && e.offsetHeight === e.scrollHeight) {
|
|
17
19
|
let styleStr = 'overflow:visible; ';
|
|
20
|
+
|
|
18
21
|
if (!((_b = (_a = e === null || e === void 0 ? void 0 : e.parentNode) === null || _a === void 0 ? void 0 : _a.getAttribute('style')) === null || _b === void 0 ? void 0 : _b.includes('width'))) {
|
|
19
22
|
styleStr += 'max-width:100%;';
|
|
20
23
|
}
|
|
24
|
+
|
|
21
25
|
e.parentNode.setAttribute('style', styleStr);
|
|
22
26
|
}
|
|
27
|
+
|
|
23
28
|
return e.offsetWidth + tolerance < e.scrollWidth || e.offsetHeight < e.scrollHeight;
|
|
24
29
|
};
|
|
30
|
+
|
|
25
31
|
export default (props => {
|
|
26
32
|
let {
|
|
27
33
|
_popover = props.Popover,
|
|
@@ -45,30 +51,33 @@ export default (props => {
|
|
|
45
51
|
prefix,
|
|
46
52
|
// 前缀dom
|
|
47
53
|
suffix // 后缀dom
|
|
48
|
-
|
|
49
|
-
// allow visible or not state
|
|
50
|
-
|
|
51
|
-
// visible[Tooltip/Popover] state
|
|
52
|
-
|
|
53
|
-
// copy animation state
|
|
54
|
+
|
|
55
|
+
} = props; // allow visible or not state
|
|
56
|
+
|
|
57
|
+
const [flag, setFlag] = useState(true); // visible[Tooltip/Popover] state
|
|
58
|
+
|
|
59
|
+
const [tipVisible, setTipVisible] = useState(false); // copy animation state
|
|
60
|
+
|
|
54
61
|
const [hasCopy, setHasCopy] = useState(false);
|
|
55
62
|
const elementRef = useRef();
|
|
56
63
|
useEffect(() => {
|
|
57
64
|
elementRef.current && isEllipsisActive(elementRef.current) ? setFlag(true) : (setFlag(false), setTipVisible(false));
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
const inner = typeof children === 'string' ? children : _popover ? content : title;
|
|
61
|
-
|
|
65
|
+
}); // original Node
|
|
66
|
+
|
|
67
|
+
const inner = typeof children === 'string' ? children : _popover ? content : title; // for className
|
|
68
|
+
|
|
62
69
|
const getClassName = () => {
|
|
63
70
|
return `overflow ${_lines ? 'ellipsis-wrap' : 'ellipsis-nowrap'} ${className || ''}`;
|
|
64
|
-
};
|
|
65
|
-
|
|
71
|
+
}; // Tooltip.trigger(default 'hover') ==trigger==> onVisibleChange(visible)
|
|
72
|
+
|
|
73
|
+
|
|
66
74
|
const handleVisibleChange = visible => {
|
|
67
75
|
// const { onVisibleChange } = props;
|
|
68
76
|
// onVisibleChange(visible);
|
|
69
77
|
flag && setTipVisible(visible);
|
|
70
|
-
};
|
|
71
|
-
|
|
78
|
+
}; // onClick Copy Button
|
|
79
|
+
|
|
80
|
+
|
|
72
81
|
const handleCopy = innerText => {
|
|
73
82
|
copy(innerText);
|
|
74
83
|
setHasCopy(!hasCopy);
|
|
@@ -76,6 +85,7 @@ export default (props => {
|
|
|
76
85
|
setHasCopy(false);
|
|
77
86
|
}, 1000);
|
|
78
87
|
};
|
|
88
|
+
|
|
79
89
|
const renderNode = () => {
|
|
80
90
|
const popoverNode = React.createElement(Popover, Object.assign({}, props, {
|
|
81
91
|
content: content || children,
|
|
@@ -101,6 +111,7 @@ export default (props => {
|
|
|
101
111
|
}, children || title));
|
|
102
112
|
return _popover ? popoverNode : tooltipNode;
|
|
103
113
|
};
|
|
114
|
+
|
|
104
115
|
return React.createElement(React.Fragment, null, React.createElement("div", {
|
|
105
116
|
className: "tnt-ellipsis",
|
|
106
117
|
style: Object.assign(Object.assign({}, style), {
|
package/es/empty/empty.js
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
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 LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver';
|
|
10
13
|
import classNames from 'classnames';
|
|
11
14
|
import React from 'react';
|
|
12
15
|
import { ConfigConsumer } from 'antd/es/config-provider';
|
|
13
16
|
import { default as AntdEmpty } from 'antd/es/empty';
|
|
14
17
|
import { Illustration403, Illustration404, Illustration500, IllustrationEmpty, IllustrationFailure, IllustrationNoAccess, IllustrationNoChart, IllustrationNoResult, IllustrationOffline, IllustrationSuccess } from '../svg-components';
|
|
15
|
-
export * from 'antd/es/empty';
|
|
16
|
-
|
|
18
|
+
export * from 'antd/es/empty'; // description map for evert type
|
|
19
|
+
|
|
17
20
|
export const EmptyDescriptionMap = {
|
|
18
21
|
empty: 'noData',
|
|
19
22
|
'no-result': 'noData',
|
|
@@ -40,13 +43,14 @@ const BuiltinEmptyImage = {
|
|
|
40
43
|
};
|
|
41
44
|
export function Empty(_a) {
|
|
42
45
|
var {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
className,
|
|
47
|
+
description,
|
|
48
|
+
size = 'middle',
|
|
49
|
+
type = 'empty',
|
|
50
|
+
locale
|
|
51
|
+
} = _a,
|
|
52
|
+
rest = __rest(_a, ["className", "description", "size", "type", "locale"]);
|
|
53
|
+
|
|
50
54
|
return React.createElement(ConfigConsumer, null, ({
|
|
51
55
|
getPrefixCls
|
|
52
56
|
}) => {
|
package/es/handle/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 React, { Fragment } from 'react';
|
|
10
13
|
import LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver';
|
|
11
14
|
import Icon from '../tntd-icon';
|
|
@@ -19,35 +22,41 @@ export default (props => {
|
|
|
19
22
|
componentName: "Handle"
|
|
20
23
|
}, (locale, localeCode) => {
|
|
21
24
|
const _a = props || {},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
{
|
|
26
|
+
children = [],
|
|
27
|
+
type,
|
|
28
|
+
num = 3,
|
|
29
|
+
lang,
|
|
30
|
+
divider = true,
|
|
31
|
+
lessOneMoreFit,
|
|
32
|
+
popConfirmHandle
|
|
33
|
+
} = _a,
|
|
34
|
+
rest = __rest(_a, ["children", "type", "num", "lang", "divider", "lessOneMoreFit", "popConfirmHandle"]);
|
|
35
|
+
|
|
32
36
|
let newChildren = [];
|
|
37
|
+
|
|
33
38
|
if (Array.isArray(children)) {
|
|
34
39
|
newChildren = (children === null || children === void 0 ? void 0 : children.filter(item => !!item)) || [];
|
|
35
40
|
} else if (children) {
|
|
36
41
|
newChildren.push(children);
|
|
37
42
|
}
|
|
43
|
+
|
|
38
44
|
if (localeCode === 'en' || popConfirmHandle) {
|
|
39
45
|
newChildren === null || newChildren === void 0 ? void 0 : newChildren.forEach((v, i) => {
|
|
40
46
|
const {
|
|
41
47
|
type,
|
|
42
48
|
props
|
|
43
49
|
} = v;
|
|
50
|
+
|
|
44
51
|
if ((type === null || type === void 0 ? void 0 : type.name) === 'Popconfirm' || props.hasOwnProperty('onConfirm') && typeof (props === null || props === void 0 ? void 0 : props.onConfirm) === 'function') {
|
|
45
52
|
let placement = {};
|
|
53
|
+
|
|
46
54
|
if (lang === 'en' || num && !isNaN(num) && i + 1 > num && !(lessOneMoreFit && newChildren.length - num === 1)) {
|
|
47
55
|
placement = {
|
|
48
56
|
placement: 'left'
|
|
49
57
|
};
|
|
50
58
|
}
|
|
59
|
+
|
|
51
60
|
newChildren[i] = React.cloneElement(v, Object.assign(Object.assign(Object.assign(Object.assign({
|
|
52
61
|
overlayStyle: {
|
|
53
62
|
width: 180
|
|
@@ -61,28 +70,31 @@ export default (props => {
|
|
|
61
70
|
}
|
|
62
71
|
});
|
|
63
72
|
}
|
|
64
|
-
|
|
65
|
-
// 只有1个时不适配
|
|
73
|
+
|
|
74
|
+
let [preChildPart, lastChildPart] = [newChildren, null]; // 只有1个时不适配
|
|
75
|
+
|
|
66
76
|
if (lessOneMoreFit && newChildren.length - num === 1) {
|
|
67
77
|
preChildPart = newChildren;
|
|
68
78
|
} else if (newChildren && num && !isNaN(num) && newChildren.length > num) {
|
|
69
79
|
preChildPart = newChildren.slice(0, num);
|
|
70
80
|
lastChildPart = newChildren.slice(num);
|
|
71
81
|
}
|
|
82
|
+
|
|
72
83
|
if (divider && preChildPart) {
|
|
73
84
|
const preChildLen = preChildPart.length;
|
|
74
85
|
preChildPart = preChildPart.map((dom, i) => React.createElement(Fragment, {
|
|
75
86
|
key: i
|
|
76
|
-
}, dom, !(i === preChildLen - 1 && !(lastChildPart === null || lastChildPart === void 0 ? void 0 : lastChildPart.length)
|
|
77
|
-
) && React.createElement(Divider, {
|
|
87
|
+
}, dom, !(i === preChildLen - 1 && !(lastChildPart === null || lastChildPart === void 0 ? void 0 : lastChildPart.length)) && React.createElement(Divider, {
|
|
78
88
|
type: "vertical"
|
|
79
89
|
})));
|
|
80
90
|
}
|
|
91
|
+
|
|
81
92
|
const menu = childArr => React.createElement(Menu, {
|
|
82
93
|
className: "org-pop-opera-btn"
|
|
83
94
|
}, childArr === null || childArr === void 0 ? void 0 : childArr.map((child, i) => React.createElement(Menu.Item, {
|
|
84
95
|
key: i
|
|
85
96
|
}, child)));
|
|
97
|
+
|
|
86
98
|
if (localeCode === "en") {
|
|
87
99
|
return React.createElement(Dropdown, {
|
|
88
100
|
overlay: menu(newChildren || []),
|
|
@@ -97,6 +109,7 @@ export default (props => {
|
|
|
97
109
|
type: "down"
|
|
98
110
|
}))));
|
|
99
111
|
}
|
|
112
|
+
|
|
100
113
|
return React.createElement("div", Object.assign({
|
|
101
114
|
onClick: e => {
|
|
102
115
|
e.stopPropagation();
|
package/es/img/Contain.js
CHANGED
|
@@ -1,39 +1,45 @@
|
|
|
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 classnames from 'classnames';
|
|
11
14
|
export default (props => {
|
|
12
15
|
const {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
alt,
|
|
17
|
+
title,
|
|
18
|
+
src,
|
|
19
|
+
width,
|
|
20
|
+
height,
|
|
21
|
+
style = {},
|
|
22
|
+
className,
|
|
23
|
+
onError,
|
|
24
|
+
shape,
|
|
25
|
+
errorImgSrc,
|
|
26
|
+
type
|
|
27
|
+
} = props,
|
|
28
|
+
others = __rest(props, ["alt", "title", "src", "width", "height", "style", "className", "onError", "shape", "errorImgSrc", "type"]);
|
|
29
|
+
|
|
26
30
|
const styles = Object.assign(Object.assign({}, style), {
|
|
27
31
|
display: 'inline-block',
|
|
28
32
|
width,
|
|
29
33
|
height,
|
|
30
34
|
overflow: 'hidden'
|
|
31
35
|
});
|
|
36
|
+
|
|
32
37
|
if (shape === 'rounded') {
|
|
33
38
|
styles.borderRadius = '5px';
|
|
34
39
|
} else if (shape === 'circle') {
|
|
35
40
|
styles.borderRadius = '50%';
|
|
36
41
|
}
|
|
42
|
+
|
|
37
43
|
const centerStyles = {
|
|
38
44
|
width,
|
|
39
45
|
height,
|
package/es/img/Cover.js
CHANGED
|
@@ -1,29 +1,33 @@
|
|
|
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 { useEffect, useState, useRef } from 'react';
|
|
11
14
|
import classnames from 'classnames';
|
|
12
15
|
export default (props => {
|
|
13
16
|
const {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
alt,
|
|
18
|
+
title,
|
|
19
|
+
src,
|
|
20
|
+
width,
|
|
21
|
+
height,
|
|
22
|
+
style = {},
|
|
23
|
+
className,
|
|
24
|
+
onError,
|
|
25
|
+
shape,
|
|
26
|
+
errorImgSrc,
|
|
27
|
+
type
|
|
28
|
+
} = props,
|
|
29
|
+
others = __rest(props, ["alt", "title", "src", "width", "height", "style", "className", "onError", "shape", "errorImgSrc", "type"]);
|
|
30
|
+
|
|
27
31
|
const imgRef = useRef();
|
|
28
32
|
const [imgStyles, setImgStyles] = useState({
|
|
29
33
|
display: 'block',
|
|
@@ -33,6 +37,7 @@ export default (props => {
|
|
|
33
37
|
// transition: 'opacity 0.2s ease',
|
|
34
38
|
opacity: 0
|
|
35
39
|
});
|
|
40
|
+
|
|
36
41
|
const getStyles = (wrapWidth, wrapHeight, imgWidth, imgHeight) => {
|
|
37
42
|
// 进行等比运算
|
|
38
43
|
const wrapRatio = wrapWidth / wrapHeight;
|
|
@@ -41,6 +46,7 @@ export default (props => {
|
|
|
41
46
|
let finalHeight = 0;
|
|
42
47
|
let finalMarginTop = 0;
|
|
43
48
|
let finalMarginLeft = 0;
|
|
49
|
+
|
|
44
50
|
if (wrapRatio > imgRatio) {
|
|
45
51
|
// 父框宽度更大,以父框的宽度为准,拉伸图片上移
|
|
46
52
|
finalWidth = wrapWidth;
|
|
@@ -52,6 +58,7 @@ export default (props => {
|
|
|
52
58
|
finalWidth = finalHeight * imgRatio;
|
|
53
59
|
finalMarginLeft = (finalWidth - wrapWidth) / 2 * -1;
|
|
54
60
|
}
|
|
61
|
+
|
|
55
62
|
return {
|
|
56
63
|
height: finalHeight,
|
|
57
64
|
width: finalWidth,
|
|
@@ -59,6 +66,7 @@ export default (props => {
|
|
|
59
66
|
marginTop: finalMarginTop
|
|
60
67
|
};
|
|
61
68
|
};
|
|
69
|
+
|
|
62
70
|
const imgOnload = () => {
|
|
63
71
|
const imgDOM = imgRef.current;
|
|
64
72
|
const {
|
|
@@ -72,6 +80,7 @@ export default (props => {
|
|
|
72
80
|
opacity: 1
|
|
73
81
|
}));
|
|
74
82
|
};
|
|
83
|
+
|
|
75
84
|
useEffect(() => {
|
|
76
85
|
if (width || height) {
|
|
77
86
|
imgOnload();
|
|
@@ -83,11 +92,13 @@ export default (props => {
|
|
|
83
92
|
width,
|
|
84
93
|
height
|
|
85
94
|
});
|
|
95
|
+
|
|
86
96
|
if (shape === 'rounded') {
|
|
87
97
|
styles.borderRadius = '5px';
|
|
88
98
|
} else if (shape === 'circle') {
|
|
89
99
|
styles.borderRadius = '50%';
|
|
90
100
|
}
|
|
101
|
+
|
|
91
102
|
const cls = classnames('tntd-img', shape, className);
|
|
92
103
|
return React.createElement("div", Object.assign({
|
|
93
104
|
className: cls,
|