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/tntd-icon/index.js
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
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 './fonts/iconfont';
|
|
11
14
|
import './index.less';
|
|
12
15
|
export { default as iconList } from '../icon-list';
|
|
13
16
|
export default (_a => {
|
|
14
17
|
var {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
type,
|
|
19
|
+
prefix = 'tnt-',
|
|
20
|
+
className = ''
|
|
21
|
+
} = _a,
|
|
22
|
+
props = __rest(_a, ["type", "prefix", "className"]);
|
|
23
|
+
|
|
20
24
|
return React.createElement("i", Object.assign({
|
|
21
25
|
className: `tnt-icon ${className}`,
|
|
22
26
|
type: type
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { createContext } from 'react';
|
|
2
|
-
|
|
1
|
+
import { createContext } from 'react'; // import createActions from './createActions';
|
|
2
|
+
|
|
3
3
|
export default createContext({});
|
|
@@ -49,8 +49,8 @@ const MenuList = styled(Menu)`
|
|
|
49
49
|
.isInIframe & {
|
|
50
50
|
margin-left: 20px;
|
|
51
51
|
}
|
|
52
|
-
`;
|
|
53
|
-
|
|
52
|
+
`; // 新版UI
|
|
53
|
+
|
|
54
54
|
const AppsSelect = styled(Select)`
|
|
55
55
|
min-width: 160px;
|
|
56
56
|
height: 28px;
|
|
@@ -140,8 +140,10 @@ export default withTheme(props => {
|
|
|
140
140
|
items = [],
|
|
141
141
|
onChange
|
|
142
142
|
} = props;
|
|
143
|
+
|
|
143
144
|
const getInitialSelectedApp = () => {
|
|
144
145
|
const currentAppStore = getCurrentAppStore();
|
|
146
|
+
|
|
145
147
|
const findAppByKey = selectedKey => {
|
|
146
148
|
let findApp;
|
|
147
149
|
traverseTree(items, item => {
|
|
@@ -152,14 +154,17 @@ export default withTheme(props => {
|
|
|
152
154
|
});
|
|
153
155
|
return findApp;
|
|
154
156
|
};
|
|
157
|
+
|
|
155
158
|
const currentApp = findAppByKey(selectedKey || _get(currentAppStore, 'key'));
|
|
156
159
|
return currentApp || items[0];
|
|
157
160
|
};
|
|
161
|
+
|
|
158
162
|
const changeApp = app => {
|
|
159
163
|
setSelectedApp(app);
|
|
160
164
|
setCurrentAppStore(app);
|
|
161
165
|
onChange && onChange(app);
|
|
162
166
|
};
|
|
167
|
+
|
|
163
168
|
const [searchValue, setSearchValue] = useState();
|
|
164
169
|
const [selectedApp, setSelectedApp] = useState(getInitialSelectedApp());
|
|
165
170
|
const Menus = React.createElement(MenuList, {
|
|
@@ -180,9 +185,11 @@ export default withTheme(props => {
|
|
|
180
185
|
name
|
|
181
186
|
} = {}) => {
|
|
182
187
|
const regExp = new RegExp(searchValue, 'i');
|
|
188
|
+
|
|
183
189
|
if (searchValue) {
|
|
184
190
|
return regExp.test(key) || regExp.test(name);
|
|
185
191
|
}
|
|
192
|
+
|
|
186
193
|
return true;
|
|
187
194
|
}).map(item => React.createElement(Menu.Item, {
|
|
188
195
|
key: item.key,
|
|
@@ -190,13 +197,16 @@ export default withTheme(props => {
|
|
|
190
197
|
}, item.name)));
|
|
191
198
|
useEffect(() => {
|
|
192
199
|
const newApp = getInitialSelectedApp();
|
|
200
|
+
|
|
193
201
|
if ((newApp === null || newApp === void 0 ? void 0 : newApp.key) !== (selectedApp === null || selectedApp === void 0 ? void 0 : selectedApp.key)) {
|
|
194
202
|
changeApp(newApp);
|
|
195
203
|
}
|
|
196
204
|
}, [items, selectedKey]);
|
|
205
|
+
|
|
197
206
|
if (!props.theme.compatible) {
|
|
198
207
|
if (items === null || items === void 0 ? void 0 : items.some(item => {
|
|
199
208
|
var _a;
|
|
209
|
+
|
|
200
210
|
return (_a = item.children) === null || _a === void 0 ? void 0 : _a.length;
|
|
201
211
|
})) {
|
|
202
212
|
return React.createElement(AppTreeSelect, {
|
|
@@ -232,6 +242,7 @@ export default withTheme(props => {
|
|
|
232
242
|
}
|
|
233
243
|
});
|
|
234
244
|
}
|
|
245
|
+
|
|
235
246
|
return React.createElement(AppsSelect, {
|
|
236
247
|
placeholder: "\u8BF7\u9009\u62E9",
|
|
237
248
|
showSearch: true,
|
|
@@ -255,6 +266,7 @@ export default withTheme(props => {
|
|
|
255
266
|
value: key
|
|
256
267
|
}, name)));
|
|
257
268
|
}
|
|
269
|
+
|
|
258
270
|
return React.createElement(Dropdown, {
|
|
259
271
|
overlay: Menus,
|
|
260
272
|
trigger: ['click']
|
|
@@ -60,6 +60,7 @@ const AppContentWrapper = styled.div`
|
|
|
60
60
|
border-radius: 4px;
|
|
61
61
|
z-index: 1;
|
|
62
62
|
`;
|
|
63
|
+
|
|
63
64
|
const AppContent = props => {
|
|
64
65
|
const {
|
|
65
66
|
language,
|
|
@@ -67,10 +68,12 @@ const AppContent = props => {
|
|
|
67
68
|
onChange
|
|
68
69
|
} = props;
|
|
69
70
|
const [appKey, setAppKey] = useState(props.appKey);
|
|
71
|
+
|
|
70
72
|
const changeApp = appKey => {
|
|
71
73
|
setAppKey(appKey);
|
|
72
74
|
onChange && onChange(appKey);
|
|
73
75
|
};
|
|
76
|
+
|
|
74
77
|
return React.createElement(AppContentWrapper, null, React.createElement(AppList, null, apps.sort((a, b) => _get(applicationsMap, `${a.appKey}.sort`, 1) - _get(applicationsMap, `${b.appKey}.sort`, 1)).map(({
|
|
75
78
|
appKey: key
|
|
76
79
|
}) => React.createElement(AppItem, {
|
|
@@ -90,6 +93,7 @@ const AppContent = props => {
|
|
|
90
93
|
en: 'enName'
|
|
91
94
|
}[language || 'cn']}`, key))))));
|
|
92
95
|
};
|
|
96
|
+
|
|
93
97
|
export default (props => React.createElement(App, null, React.createElement(Popover, {
|
|
94
98
|
placement: "bottomRight",
|
|
95
99
|
title: null,
|
package/es/tntd-layout/Avatar.js
CHANGED
|
@@ -75,6 +75,7 @@ const UserInfoWrapper = styled.div`
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
`;
|
|
78
|
+
|
|
78
79
|
const UserInfoContent = props => {
|
|
79
80
|
const {
|
|
80
81
|
userInfo,
|
|
@@ -124,8 +125,10 @@ const UserInfoContent = props => {
|
|
|
124
125
|
}
|
|
125
126
|
}, getText('signOut'))));
|
|
126
127
|
};
|
|
128
|
+
|
|
127
129
|
export default (props => {
|
|
128
130
|
var _a;
|
|
131
|
+
|
|
129
132
|
const {
|
|
130
133
|
userInfo = {}
|
|
131
134
|
} = props;
|
|
@@ -142,6 +145,7 @@ export default (props => {
|
|
|
142
145
|
src: avatar.indexOf('base64') > 0 ? avatar : _get(images[avatar], 'default', images[avatar]),
|
|
143
146
|
onError: e => {
|
|
144
147
|
var _a;
|
|
148
|
+
|
|
145
149
|
e.target.onerror = null;
|
|
146
150
|
e.target.src = ((_a = images.empty) === null || _a === void 0 ? void 0 : _a.default) || images.empty;
|
|
147
151
|
}
|
|
@@ -119,6 +119,7 @@ const themes = [{
|
|
|
119
119
|
value: 'themeS2',
|
|
120
120
|
img: images.themeSymbol2
|
|
121
121
|
}];
|
|
122
|
+
|
|
122
123
|
const ThemeContent = props => {
|
|
123
124
|
const {
|
|
124
125
|
config,
|
|
@@ -129,31 +130,40 @@ const ThemeContent = props => {
|
|
|
129
130
|
language: languageVisible = true,
|
|
130
131
|
theme: themeVisible = true
|
|
131
132
|
} = config || {};
|
|
133
|
+
|
|
132
134
|
const getTheme = () => {
|
|
133
135
|
let theme = getThemeStore() || props.theme || 'themeS2';
|
|
134
136
|
return themes.some(({
|
|
135
137
|
value
|
|
136
138
|
}) => value === theme) ? theme : 'themeS2';
|
|
137
139
|
};
|
|
140
|
+
|
|
138
141
|
const [theme, setTheme] = useState(getTheme());
|
|
142
|
+
|
|
139
143
|
const changeTheme = theme => {
|
|
140
144
|
setTheme(theme);
|
|
141
145
|
setThemeStore(theme);
|
|
142
146
|
onThemeChange(theme);
|
|
143
147
|
};
|
|
148
|
+
|
|
144
149
|
const getLanguage = () => {
|
|
145
150
|
let lang = getLanguageStore() || props.language;
|
|
151
|
+
|
|
146
152
|
if (!languagesMap[lang]) {
|
|
147
153
|
lang = _get(languages, '0.value');
|
|
148
154
|
}
|
|
155
|
+
|
|
149
156
|
return lang;
|
|
150
157
|
};
|
|
158
|
+
|
|
151
159
|
const [language = 'cn', setLanguage] = useState(getLanguage());
|
|
160
|
+
|
|
152
161
|
const changeLanguage = language => {
|
|
153
162
|
setLanguage(language);
|
|
154
163
|
setLanguageStore(language);
|
|
155
164
|
onLanguageChange(language);
|
|
156
165
|
};
|
|
166
|
+
|
|
157
167
|
return React.createElement(ThemeContentWrapper, null, themeVisible && React.createElement(ThemeSwitch, null, themes.map(({
|
|
158
168
|
value,
|
|
159
169
|
img
|
|
@@ -177,13 +187,16 @@ const ThemeContent = props => {
|
|
|
177
187
|
onClick: changeLanguage.bind(this, value)
|
|
178
188
|
}, name))));
|
|
179
189
|
};
|
|
190
|
+
|
|
180
191
|
export default (props => {
|
|
181
192
|
const {
|
|
182
193
|
config
|
|
183
194
|
} = props;
|
|
195
|
+
|
|
184
196
|
if ((config === null || config === void 0 ? void 0 : config.language) === false && (config === null || config === void 0 ? void 0 : config.theme) === false) {
|
|
185
197
|
return null;
|
|
186
198
|
}
|
|
199
|
+
|
|
187
200
|
return React.createElement(Theme, null, React.createElement(Popover, {
|
|
188
201
|
placement: "bottomRight",
|
|
189
202
|
title: null,
|
|
@@ -81,6 +81,7 @@ const UserInfoWrapper = styled.div`
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
`;
|
|
84
|
+
|
|
84
85
|
const UserInfoContent = props => {
|
|
85
86
|
const {
|
|
86
87
|
userInfo,
|
|
@@ -142,8 +143,10 @@ const UserInfoContent = props => {
|
|
|
142
143
|
}
|
|
143
144
|
}, getText('signOut'))));
|
|
144
145
|
};
|
|
146
|
+
|
|
145
147
|
export default (props => {
|
|
146
148
|
var _a;
|
|
149
|
+
|
|
147
150
|
const {
|
|
148
151
|
userInfo = {}
|
|
149
152
|
} = props;
|
|
@@ -160,6 +163,7 @@ export default (props => {
|
|
|
160
163
|
src: avatar.indexOf('base64') > 0 ? avatar : _get(images[avatar], 'default', images[avatar]),
|
|
161
164
|
onError: e => {
|
|
162
165
|
var _a;
|
|
166
|
+
|
|
163
167
|
e.target.onerror = null;
|
|
164
168
|
e.target.src = ((_a = images.empty) === null || _a === void 0 ? void 0 : _a.default) || images.empty;
|
|
165
169
|
}
|
|
@@ -65,20 +65,26 @@ export default withTheme(props => {
|
|
|
65
65
|
const {
|
|
66
66
|
onChange
|
|
67
67
|
} = props;
|
|
68
|
+
|
|
68
69
|
const getLanguage = () => {
|
|
69
70
|
let lang = getLanguageStore() || props.language;
|
|
71
|
+
|
|
70
72
|
if (!languagesMap[lang]) {
|
|
71
73
|
lang = _get(languages, '0.value');
|
|
72
74
|
}
|
|
75
|
+
|
|
73
76
|
return lang;
|
|
74
77
|
};
|
|
78
|
+
|
|
75
79
|
const [language = 'cn', setLanguage] = useState(getLanguage());
|
|
80
|
+
|
|
76
81
|
const switchLanguage = () => {
|
|
77
82
|
const lang = language !== 'en' ? 'en' : 'cn';
|
|
78
83
|
setLanguage(lang);
|
|
79
84
|
setLanguageStore(lang);
|
|
80
85
|
onChange && onChange(lang);
|
|
81
86
|
};
|
|
87
|
+
|
|
82
88
|
const otherLanguage = useMemo(() => language === 'cn' ? 'en' : 'cn', [language]);
|
|
83
89
|
return React.createElement(Language, {
|
|
84
90
|
onClick: switchLanguage
|
|
@@ -70,18 +70,22 @@ export default (props => {
|
|
|
70
70
|
const {
|
|
71
71
|
onChange
|
|
72
72
|
} = props;
|
|
73
|
+
|
|
73
74
|
const getTheme = () => {
|
|
74
75
|
let theme = getThemeStore() || props.theme || 'themeS3';
|
|
75
76
|
return themes.some(({
|
|
76
77
|
value
|
|
77
78
|
}) => value === theme) ? theme : 'themeS3';
|
|
78
79
|
};
|
|
80
|
+
|
|
79
81
|
const [theme, setTheme] = useState(getTheme());
|
|
82
|
+
|
|
80
83
|
const changeTheme = theme => {
|
|
81
84
|
setTheme(theme);
|
|
82
85
|
setThemeStore(theme);
|
|
83
86
|
onChange(theme);
|
|
84
87
|
};
|
|
88
|
+
|
|
85
89
|
return React.createElement(Theme, null, React.createElement(Row, {
|
|
86
90
|
type: "flex",
|
|
87
91
|
justify: "space-between",
|
|
@@ -7,8 +7,8 @@ export default withTheme(props => {
|
|
|
7
7
|
const {
|
|
8
8
|
userInfo = {},
|
|
9
9
|
extendMap = {}
|
|
10
|
-
} = props;
|
|
11
|
-
|
|
10
|
+
} = props; // 企业级的默认蓝色主题
|
|
11
|
+
|
|
12
12
|
let theme = getThemeStore() || (extendMap === null || extendMap === void 0 ? void 0 : extendMap.defaultTheme) || userInfo.theme || 'themeS3';
|
|
13
13
|
theme = theme === 'default' ? 'themeS3' : theme;
|
|
14
14
|
const newProps = Object.assign(Object.assign({}, props), {
|
|
@@ -122,6 +122,7 @@ const ListBox = styled.ul`
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
`;
|
|
125
|
+
|
|
125
126
|
const SearchList = ({
|
|
126
127
|
items,
|
|
127
128
|
onSelectMenu,
|
|
@@ -131,6 +132,7 @@ const SearchList = ({
|
|
|
131
132
|
}, items === null || items === void 0 ? void 0 : items.map(item => React.createElement("li", {
|
|
132
133
|
onClick: () => onSelectMenu(item)
|
|
133
134
|
}, item === null || item === void 0 ? void 0 : item.menuName)));
|
|
135
|
+
|
|
134
136
|
export default (({
|
|
135
137
|
theme,
|
|
136
138
|
menus = [],
|
|
@@ -145,16 +147,19 @@ export default (({
|
|
|
145
147
|
const isLevel3 = hasLevel3(menus);
|
|
146
148
|
const [activeTopMenu, setActiveTopMenu] = useState(isLevel3 ? menus === null || menus === void 0 ? void 0 : menus[0] : null);
|
|
147
149
|
const selectedMenuKey = actions.getSelectedMenuKey();
|
|
150
|
+
|
|
148
151
|
const calcGroupMenus = menus => {
|
|
149
152
|
menus = menus === null || menus === void 0 ? void 0 : menus.reduce((acc, cur) => {
|
|
150
|
-
var _a;
|
|
151
|
-
|
|
153
|
+
var _a; // 分组
|
|
154
|
+
|
|
155
|
+
|
|
152
156
|
if ((_a = cur === null || cur === void 0 ? void 0 : cur.children) === null || _a === void 0 ? void 0 : _a.length) {
|
|
153
157
|
acc.push(cur);
|
|
154
158
|
} else {
|
|
155
159
|
const defaultGroup = acc.find(({
|
|
156
160
|
isDefaultGroup
|
|
157
161
|
}) => isDefaultGroup);
|
|
162
|
+
|
|
158
163
|
if (!defaultGroup) {
|
|
159
164
|
acc.unshift({
|
|
160
165
|
isDefaultGroup: true,
|
|
@@ -164,36 +169,47 @@ export default (({
|
|
|
164
169
|
defaultGroup.children.push(cur);
|
|
165
170
|
}
|
|
166
171
|
}
|
|
172
|
+
|
|
167
173
|
return acc;
|
|
168
174
|
}, []);
|
|
169
175
|
return menus === null || menus === void 0 ? void 0 : menus.reduce((acc, cur) => {
|
|
170
176
|
var _a;
|
|
177
|
+
|
|
171
178
|
const column = Math.max(1, ~~((containerRef.current.clientWidth - 32) / 210));
|
|
179
|
+
|
|
172
180
|
if (!acc.length) {
|
|
173
181
|
acc.push([cur]);
|
|
174
182
|
} else {
|
|
175
183
|
const calcGroupHeight = group => {
|
|
176
184
|
var _a;
|
|
185
|
+
|
|
177
186
|
return 46 + (((_a = group === null || group === void 0 ? void 0 : group.children) === null || _a === void 0 ? void 0 : _a.length) || 0) * 30;
|
|
178
187
|
};
|
|
188
|
+
|
|
179
189
|
const calcColumnHeight = columnGroups => columnGroups === null || columnGroups === void 0 ? void 0 : columnGroups.reduce((acc, cur) => {
|
|
180
190
|
acc += calcGroupHeight(cur);
|
|
181
191
|
return acc;
|
|
182
192
|
}, 0);
|
|
193
|
+
|
|
183
194
|
const currentColumnHeight = calcColumnHeight(acc[acc.length - 1]);
|
|
184
195
|
const nextGroupHeight = calcGroupHeight(cur);
|
|
196
|
+
|
|
185
197
|
const findMinHeightGroup = groups => {
|
|
186
198
|
let minHeight = Infinity;
|
|
187
199
|
let index = 0;
|
|
200
|
+
|
|
188
201
|
for (let i = 0; i < groups.length; i++) {
|
|
189
202
|
const height = calcColumnHeight(groups[i]);
|
|
203
|
+
|
|
190
204
|
if (height < minHeight) {
|
|
191
205
|
index = i;
|
|
192
206
|
minHeight = height;
|
|
193
207
|
}
|
|
194
208
|
}
|
|
209
|
+
|
|
195
210
|
return groups[index];
|
|
196
211
|
};
|
|
212
|
+
|
|
197
213
|
if (acc.length >= column) {
|
|
198
214
|
const minHeightGroup = findMinHeightGroup(acc);
|
|
199
215
|
minHeightGroup === null || minHeightGroup === void 0 ? void 0 : minHeightGroup.push(cur);
|
|
@@ -205,11 +221,14 @@ export default (({
|
|
|
205
221
|
}
|
|
206
222
|
}
|
|
207
223
|
}
|
|
224
|
+
|
|
208
225
|
return acc;
|
|
209
226
|
}, []);
|
|
210
227
|
};
|
|
228
|
+
|
|
211
229
|
const groupMenus = calcGroupMenus((activeTopMenu === null || activeTopMenu === void 0 ? void 0 : activeTopMenu.children) || menus);
|
|
212
230
|
const [searchedMenus, setSearchedMenus] = useState([]);
|
|
231
|
+
|
|
213
232
|
const onMenuClick = menu => {
|
|
214
233
|
actions.emit('menuSelect', {
|
|
215
234
|
key: menu.code,
|
|
@@ -219,28 +238,36 @@ export default (({
|
|
|
219
238
|
setSearchedMenus([]);
|
|
220
239
|
close();
|
|
221
240
|
};
|
|
241
|
+
|
|
222
242
|
const debounceSearch = _debounce(evt => {
|
|
223
243
|
var _a;
|
|
244
|
+
|
|
224
245
|
const value = (_a = evt.target.value) === null || _a === void 0 ? void 0 : _a.trim();
|
|
225
246
|
const matchedMenus = [];
|
|
247
|
+
|
|
226
248
|
if (value) {
|
|
227
249
|
traverseTree(menus, node => {
|
|
228
250
|
var _a;
|
|
251
|
+
|
|
229
252
|
if (node.path && ((_a = node === null || node === void 0 ? void 0 : node.menuName) === null || _a === void 0 ? void 0 : _a.includes(value))) {
|
|
230
253
|
matchedMenus.push(node);
|
|
231
254
|
}
|
|
232
255
|
});
|
|
233
256
|
}
|
|
257
|
+
|
|
234
258
|
setSearchedMenus(matchedMenus);
|
|
235
259
|
}, 100);
|
|
260
|
+
|
|
236
261
|
const onSearchChange = evt => {
|
|
237
262
|
evt.persist();
|
|
238
263
|
setSearchValue(evt.target.value);
|
|
239
264
|
debounceSearch(evt);
|
|
240
265
|
};
|
|
266
|
+
|
|
241
267
|
const onSelectAppTab = menu => {
|
|
242
268
|
setActiveTopMenu(menu);
|
|
243
269
|
};
|
|
270
|
+
|
|
244
271
|
useEffect(() => {
|
|
245
272
|
const clickOutside = evt => {
|
|
246
273
|
const {
|
|
@@ -249,10 +276,12 @@ export default (({
|
|
|
249
276
|
pageX,
|
|
250
277
|
pageY
|
|
251
278
|
} = evt;
|
|
279
|
+
|
|
252
280
|
const isOutside = (evt, popup) => {
|
|
253
281
|
if (popup === null || popup === void 0 ? void 0 : popup.contains) {
|
|
254
282
|
return !(popup === null || popup === void 0 ? void 0 : popup.contains(evt.target));
|
|
255
283
|
}
|
|
284
|
+
|
|
256
285
|
let {
|
|
257
286
|
x,
|
|
258
287
|
y,
|
|
@@ -264,12 +293,14 @@ export default (({
|
|
|
264
293
|
y += window.scrollY;
|
|
265
294
|
return pageX < x || pageX > x + width || pageY < y || pageY > y + height;
|
|
266
295
|
};
|
|
296
|
+
|
|
267
297
|
if (isOutside(evt, popupRef.current)) {
|
|
268
298
|
setSearchValue('');
|
|
269
299
|
setSearchedMenus([]);
|
|
270
300
|
close();
|
|
271
301
|
}
|
|
272
302
|
};
|
|
303
|
+
|
|
273
304
|
document.addEventListener('click', clickOutside);
|
|
274
305
|
return () => document.removeEventListener('click', clickOutside);
|
|
275
306
|
}, []);
|
|
@@ -47,11 +47,13 @@ const Navigation = styled.li`
|
|
|
47
47
|
display: none;
|
|
48
48
|
}
|
|
49
49
|
`;
|
|
50
|
+
|
|
50
51
|
const createPopupContainer = () => {
|
|
51
52
|
const div = document.createElement('div');
|
|
52
53
|
div.setAttribute('class', 'tnt-navigation-popup');
|
|
53
54
|
return div;
|
|
54
55
|
};
|
|
56
|
+
|
|
55
57
|
const GlobalStyle = createGlobalStyle`
|
|
56
58
|
.tnt-navigation-popup {
|
|
57
59
|
position: absolute;
|
|
@@ -85,15 +87,18 @@ export default withTheme(props => {
|
|
|
85
87
|
const popupRef = useRef();
|
|
86
88
|
useEffect(() => {
|
|
87
89
|
var _a;
|
|
90
|
+
|
|
88
91
|
popupRef.current = createPopupContainer();
|
|
89
92
|
(_a = headerRef === null || headerRef === void 0 ? void 0 : headerRef.current) === null || _a === void 0 ? void 0 : _a.appendChild(popupRef.current);
|
|
90
93
|
return () => {
|
|
91
94
|
var _a;
|
|
95
|
+
|
|
92
96
|
(_a = headerRef === null || headerRef === void 0 ? void 0 : headerRef.current) === null || _a === void 0 ? void 0 : _a.removeChild(popupRef.current);
|
|
93
97
|
};
|
|
94
98
|
}, []);
|
|
95
99
|
useEffect(() => {
|
|
96
100
|
const classNames = popupRef.current.getAttribute('class').split(' ');
|
|
101
|
+
|
|
97
102
|
if (visible) {
|
|
98
103
|
ReactDOM.render(React.createElement(NavigationPopup, {
|
|
99
104
|
actions: actions,
|
|
@@ -111,6 +116,7 @@ export default withTheme(props => {
|
|
|
111
116
|
return React.createElement(Navigation, {
|
|
112
117
|
onClick: evt => {
|
|
113
118
|
var _a, _b;
|
|
119
|
+
|
|
114
120
|
evt.stopPropagation();
|
|
115
121
|
(_a = evt.nativeEvent) === null || _a === void 0 ? void 0 : _a.stopImmediatePropagation();
|
|
116
122
|
(_b = evt.nativeEvent) === null || _b === void 0 ? void 0 : _b.stopPropagation();
|
|
@@ -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 from 'react';
|
|
10
13
|
import styled, { withTheme } from 'styled-components';
|
|
11
14
|
import Divider from '../divider';
|
|
@@ -61,34 +64,35 @@ const Actions = styled.ul`
|
|
|
61
64
|
`;
|
|
62
65
|
export default withTheme(props => {
|
|
63
66
|
const {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
67
|
+
type,
|
|
68
|
+
config: {
|
|
69
|
+
theme = true,
|
|
70
|
+
avatar = true,
|
|
71
|
+
language = true,
|
|
72
|
+
application = false,
|
|
73
|
+
globalNavigation = false
|
|
74
|
+
} = {},
|
|
75
|
+
theme: {
|
|
76
|
+
compatible
|
|
77
|
+
},
|
|
78
|
+
userInfo = {},
|
|
79
|
+
menus,
|
|
80
|
+
apps,
|
|
81
|
+
extraActions,
|
|
82
|
+
headerRef,
|
|
83
|
+
onLanguageChange,
|
|
84
|
+
onThemeChange,
|
|
85
|
+
onApplicationChange,
|
|
86
|
+
onAppChange,
|
|
87
|
+
onCollapseChange,
|
|
88
|
+
onPersonalSetting,
|
|
89
|
+
onChangePassword,
|
|
90
|
+
onLogout,
|
|
91
|
+
onLogoClick,
|
|
92
|
+
AvatarCustom
|
|
93
|
+
} = props,
|
|
94
|
+
rest = __rest(props, ["type", "config", "theme", "userInfo", "menus", "apps", "extraActions", "headerRef", "onLanguageChange", "onThemeChange", "onApplicationChange", "onAppChange", "onCollapseChange", "onPersonalSetting", "onChangePassword", "onLogout", "onLogoClick", "AvatarCustom"]);
|
|
95
|
+
|
|
92
96
|
return React.createElement(Actions, Object.assign({}, rest), extraActions, globalNavigation && React.createElement(GlobalNavigation, {
|
|
93
97
|
headerRef: headerRef,
|
|
94
98
|
menus: menus
|
|
@@ -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 styled, { withTheme } from 'styled-components';
|
|
12
16
|
import cn from 'classnames';
|
|
@@ -63,21 +67,25 @@ const NavItem = styled.li`
|
|
|
63
67
|
`;
|
|
64
68
|
export const HeaderNavs = withTheme(_a => {
|
|
65
69
|
var {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
theme,
|
|
71
|
+
navs = [],
|
|
72
|
+
onChange,
|
|
73
|
+
onSelect
|
|
74
|
+
} = _a,
|
|
75
|
+
props = __rest(_a, ["theme", "navs", "onChange", "onSelect"]);
|
|
76
|
+
|
|
72
77
|
const [selectedKey, setSelectedKey] = useState(props.selectedKey || _get(navs, '0.key'));
|
|
78
|
+
|
|
73
79
|
const onClickNav = nav => {
|
|
74
80
|
setSelectedKey(nav.key);
|
|
75
81
|
onSelect && onSelect(nav);
|
|
82
|
+
|
|
76
83
|
if (selectedKey !== nav.key) {
|
|
77
84
|
onChange && onChange(nav);
|
|
78
85
|
setSelectedKey(nav.key);
|
|
79
86
|
}
|
|
80
87
|
};
|
|
88
|
+
|
|
81
89
|
useEffect(() => {
|
|
82
90
|
setSelectedKey(props.selectedKey || _get(navs, '0.key'));
|
|
83
91
|
}, [navs, props.selectedKey]);
|