tntd 2.0.14 → 2.0.15
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 +6 -31
- package/es/array-input/style/index.js +1 -0
- package/es/array-input/style/index.js.map +1 -0
- package/es/auth-context/style/index.js +1 -0
- package/es/auth-context/style/index.js.map +1 -0
- package/es/columns/index.js +6 -12
- package/es/development-login/LoginModal.js +4 -10
- package/es/development-login/style/index.js +1 -0
- package/es/development-login/style/index.js.map +1 -0
- package/es/drawer/drawer.js +5 -9
- package/es/drawer/drawer.js.map +1 -1
- package/es/drawer/drawer.less +13 -11
- package/es/ellipsis/index.js +14 -25
- package/es/ellipsis/style/index.js +1 -0
- package/es/ellipsis/style/index.js.map +1 -0
- package/es/empty/empty.js +9 -13
- package/es/empty/render-empty.js +22 -0
- package/es/empty/render-empty.js.map +1 -0
- package/es/empty/style/index.js +2 -0
- package/es/empty/style/index.js.map +1 -0
- package/es/handle/index.js +14 -27
- package/es/handle/style/index.js +1 -0
- package/es/handle/style/index.js.map +1 -0
- package/es/icon-list/style/index.js +1 -0
- package/es/icon-list/style/index.js.map +1 -0
- package/es/img/Contain.js +13 -19
- package/es/img/Cover.js +13 -24
- package/es/img/index.js +14 -21
- package/es/img/style/index.js +1 -0
- package/es/img/style/index.js.map +1 -0
- package/es/index.js +0 -1
- package/es/loading-button/index.js +6 -13
- package/es/loading-button/style/index.js +1 -0
- package/es/loading-button/style/index.js.map +1 -0
- package/es/locale/default.js +0 -2
- package/es/locale/en_US.js +0 -2
- package/es/locale/zh_CN.js +0 -2
- package/es/modal/index.js +11 -2
- package/es/modal/index.js.map +1 -1
- package/es/modal/modal.js +44 -0
- package/es/modal/modal.js.map +1 -0
- package/es/modal/modal.less +27 -25
- package/es/page/Box.js +19 -28
- package/es/page/index.js +22 -38
- package/es/page/style/index.js +1 -0
- package/es/page/style/index.js.map +1 -0
- package/es/page/utils.js +0 -5
- package/es/prev-locale.js +0 -3
- package/es/query-form/Field/Checkbox.js +4 -8
- package/es/query-form/Field/Select.js +10 -17
- package/es/query-form/Field/SelectInput.js +4 -18
- package/es/query-form/Field/fieldsMap.js +0 -1
- package/es/query-form/Field/index.js +2 -11
- package/es/query-form/createActions.js +0 -8
- package/es/query-form/index.js +2 -34
- package/es/query-form/style/index.js +1 -0
- package/es/query-form/style/index.js.map +1 -0
- package/es/query-list-scene/List.js +18 -39
- package/es/query-list-scene/QueryForm.js +10 -19
- package/es/query-list-scene/QueryListScene.js +0 -2
- package/es/query-list-scene/Toolbar.js +6 -10
- package/es/query-list-scene/createActions.js +0 -3
- package/es/query-list-scene/style/index.js +1 -0
- package/es/query-list-scene/style/index.js.map +1 -0
- package/es/render-empty/render-empty.js +0 -2
- package/es/render-empty/style/index.js +1 -0
- package/es/render-empty/style/index.js.map +1 -0
- package/es/steps/steps.js +9 -17
- package/es/svg-components/illustration-403.js +0 -2
- package/es/svg-components/illustration-404.js +0 -2
- package/es/svg-components/illustration-500.js +0 -2
- package/es/svg-components/illustration-empty.js +0 -2
- package/es/svg-components/illustration-failure.js +0 -2
- package/es/svg-components/illustration-no-access.js +0 -2
- package/es/svg-components/illustration-no-chart.js +0 -2
- package/es/svg-components/illustration-no-result.js +0 -2
- package/es/svg-components/illustration-offline.js +0 -2
- package/es/svg-components/illustration-success.js +0 -2
- package/es/table/assets/image-loading-background.js +0 -2
- package/es/table/assets/image-loading.js +0 -2
- package/es/table/hooks/use-column-setting.js +0 -1
- package/es/table/style/index.js +2 -0
- package/es/table/style/index.js.map +1 -0
- package/es/table/table.js +14 -19
- package/es/table/table.stories.js +0 -2
- package/es/table/utils.js +2 -6
- package/es/title/index.js +10 -14
- package/es/title/style/index.js +1 -0
- package/es/title/style/index.js.map +1 -0
- package/es/tntd-cascader/AntdCascader/component/context.js +2 -4
- package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +0 -2
- package/es/tntd-cascader/AntdCascader/component/getIcons.js +6 -15
- package/es/tntd-cascader/AntdCascader/config/utils.js +0 -2
- package/es/tntd-cascader/AntdCascader/config/warning.js +4 -8
- package/es/tntd-cascader/AntdCascader/index.js +51 -73
- package/es/tntd-cascader/rc-cascader/Cascader.js +86 -113
- package/es/tntd-cascader/rc-cascader/OptionList/Column.js +16 -26
- package/es/tntd-cascader/rc-cascader/OptionList/index.js +26 -43
- package/es/tntd-cascader/rc-cascader/OptionList/useActive.js +5 -7
- package/es/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +12 -41
- package/es/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +4 -10
- package/es/tntd-cascader/rc-cascader/hooks/useEntities.js +2 -4
- package/es/tntd-cascader/rc-cascader/hooks/useMissingValues.js +0 -1
- package/es/tntd-cascader/rc-cascader/hooks/useRefFunc.js +0 -1
- package/es/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +2 -7
- package/es/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +8 -15
- package/es/tntd-cascader/rc-cascader/utils/commonUtil.js +2 -6
- package/es/tntd-cascader/rc-cascader/utils/treeUtil.js +2 -4
- package/es/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +2 -7
- package/es/tntd-icon/fonts/iconfont.js +7 -12
- package/es/tntd-icon/index.js +5 -9
- package/es/tntd-icon/style/index.js +1 -0
- package/es/tntd-icon/style/index.js.map +1 -0
- package/es/tntd-layout/ActionsContext.js +2 -2
- package/es/tntd-layout/AppList.js +2 -14
- package/es/tntd-layout/Application.js +0 -4
- package/es/tntd-layout/Avatar.js +0 -4
- package/es/tntd-layout/CompatibleLanguage.js +0 -13
- package/es/tntd-layout/EnterpriseLayout/Avatar.js +0 -4
- package/es/tntd-layout/EnterpriseLayout/Language.js +0 -6
- package/es/tntd-layout/EnterpriseLayout/Theme.js +0 -4
- package/es/tntd-layout/EnterpriseLayout/index.js +2 -2
- package/es/tntd-layout/GlobalNavigation/NavigationPopup.js +2 -33
- package/es/tntd-layout/GlobalNavigation/index.js +0 -6
- package/es/tntd-layout/HeaderActions.js +28 -32
- package/es/tntd-layout/HeaderNavs.js +6 -14
- package/es/tntd-layout/HeaderTabs.js +14 -35
- package/es/tntd-layout/Language.js +0 -6
- package/es/tntd-layout/Layout.js +2 -7
- package/es/tntd-layout/Logo.js +4 -11
- package/es/tntd-layout/OrgAppList.js +22 -39
- package/es/tntd-layout/SideMenu.js +8 -45
- package/es/tntd-layout/Theme.js +0 -6
- package/es/tntd-layout/index.js +9 -17
- package/es/tntd-layout/paaslayout/CompactSideMenu.js +0 -15
- package/es/tntd-layout/paaslayout/SideMenu.js +0 -15
- package/es/tntd-layout/paaslayout/index.js +4 -13
- package/es/tntd-layout/storage.js +2 -2
- package/es/tntd-layout/style/index.js +1 -0
- package/es/tntd-layout/style/index.js.map +1 -0
- package/es/tntd-modal/index.js +12 -18
- package/es/tntd-modal/style/index.js +1 -0
- package/es/tntd-modal/style/index.js.map +1 -0
- package/es/tntd-second-page/index.js +0 -3
- package/es/tntd-select/DropDownWrap.js +4 -8
- package/es/tntd-select/index.js +74 -118
- package/es/tntd-select/style/index.js +1 -0
- package/es/tntd-select/style/index.js.map +1 -0
- package/es/utils/checkAuth.js +0 -1
- package/es/utils/findMenuInfoByPath.js +0 -3
- package/es/utils/index.js +2 -11
- package/lib/affix/index.js +4 -10
- package/lib/alert/index.js +4 -10
- package/lib/anchor/index.js +4 -10
- package/lib/array-input/icon.js +1 -7
- package/lib/array-input/index.js +41 -91
- package/lib/array-input/style/index.d.ts +1 -0
- package/lib/array-input/style/index.d.ts.map +1 -0
- package/lib/array-input/style/index.js +1 -0
- package/lib/array-input/style/index.js.map +1 -0
- package/lib/auth-context/index.js +0 -3
- package/lib/auth-context/style/index.d.ts +1 -0
- package/lib/auth-context/style/index.d.ts.map +1 -0
- package/lib/auth-context/style/index.js +1 -0
- package/lib/auth-context/style/index.js.map +1 -0
- package/lib/auto-complete/index.js +4 -10
- package/lib/avatar/index.js +4 -10
- package/lib/back-top/index.js +4 -10
- package/lib/badge/index.js +4 -10
- package/lib/breadcrumb/index.js +4 -10
- package/lib/button/index.js +4 -10
- package/lib/calendar/index.js +4 -10
- package/lib/card/index.js +4 -10
- package/lib/carousel/index.js +4 -10
- package/lib/cascader/index.js +4 -10
- package/lib/checkbox/index.js +4 -10
- package/lib/col/index.js +4 -10
- package/lib/collapse/index.js +4 -11
- package/lib/columns/index.js +14 -28
- package/lib/comment/index.js +4 -10
- package/lib/config-provider/config-provider.js +0 -2
- package/lib/config-provider/index.js +4 -10
- package/lib/date-picker/index.js +4 -10
- package/lib/descriptions/index.js +4 -10
- package/lib/development-login/LoginModal.js +25 -50
- package/lib/development-login/index.js +11 -22
- package/lib/development-login/style/index.d.ts +1 -0
- package/lib/development-login/style/index.d.ts.map +1 -0
- package/lib/development-login/style/index.js +1 -0
- package/lib/development-login/style/index.js.map +1 -0
- package/lib/divider/index.js +4 -10
- package/lib/drawer/drawer.d.ts.map +1 -1
- package/lib/drawer/drawer.js +7 -17
- package/lib/drawer/drawer.js.map +1 -1
- package/lib/drawer/drawer.less +13 -11
- package/lib/drawer/index.js +1 -5
- package/lib/dropdown/index.js +4 -10
- package/lib/ellipsis/Svg/CopySVG.js +0 -4
- package/lib/ellipsis/Svg/TickSVG.js +0 -4
- package/lib/ellipsis/index.js +42 -73
- package/lib/ellipsis/style/index.d.ts +1 -0
- package/lib/ellipsis/style/index.d.ts.map +1 -0
- package/lib/ellipsis/style/index.js +1 -0
- package/lib/ellipsis/style/index.js.map +1 -0
- package/lib/empty/empty.js +14 -30
- package/lib/empty/empty.stories.js +3 -21
- package/lib/empty/index.js +1 -5
- package/lib/empty/render-empty.d.ts +3 -0
- package/lib/empty/render-empty.d.ts.map +1 -0
- package/lib/empty/render-empty.js +32 -0
- package/lib/empty/render-empty.js.map +1 -0
- package/lib/empty/style/index.d.ts +3 -0
- package/lib/empty/style/index.d.ts.map +1 -0
- package/lib/empty/style/index.js +4 -0
- package/lib/empty/style/index.js.map +1 -0
- package/lib/exception/exception.js +7 -14
- package/lib/exception/index.js +1 -4
- package/lib/form/index.js +4 -10
- package/lib/handle/index.js +19 -46
- package/lib/handle/style/index.d.ts +1 -0
- package/lib/handle/style/index.d.ts.map +1 -0
- package/lib/handle/style/index.js +1 -0
- package/lib/handle/style/index.js.map +1 -0
- package/lib/icon/index.js +4 -10
- package/lib/icon-list/style/index.d.ts +3 -0
- package/lib/icon-list/style/index.d.ts.map +1 -0
- package/lib/icon-list/style/index.js +8 -0
- package/lib/icon-list/style/index.js.map +1 -0
- package/lib/img/Contain.js +12 -23
- package/lib/img/Cover.js +31 -53
- package/lib/img/index.js +29 -47
- package/lib/img/style/index.d.ts +1 -0
- package/lib/img/style/index.d.ts.map +1 -0
- package/lib/img/style/index.js +1 -0
- package/lib/img/style/index.js.map +1 -0
- package/lib/index.js +100 -187
- package/lib/input/index.js +4 -10
- package/lib/input-number/index.js +4 -10
- package/lib/layout/index.js +4 -10
- package/lib/list/index.js +4 -10
- package/lib/loading-button/index.js +15 -32
- package/lib/loading-button/style/index.d.ts +1 -0
- package/lib/loading-button/style/index.d.ts.map +1 -0
- package/lib/loading-button/style/index.js +1 -0
- package/lib/loading-button/style/index.js.map +1 -0
- package/lib/locale/default.js +0 -5
- package/lib/locale/en_US.js +0 -4
- package/lib/locale/index.js +3 -6
- package/lib/locale/zh_CN.js +0 -4
- package/lib/locale-provider/index.js +4 -10
- package/lib/mention/index.js +4 -10
- package/lib/mentions/index.js +4 -10
- package/lib/menu/index.js +4 -10
- package/lib/message/index.js +4 -11
- package/lib/modal/index.d.ts +2 -2
- package/lib/modal/index.d.ts.map +1 -1
- package/lib/modal/index.js +13 -14
- package/lib/modal/index.js.map +1 -1
- package/lib/modal/modal.d.ts +15 -0
- package/lib/modal/modal.d.ts.map +1 -0
- package/lib/modal/modal.js +66 -0
- package/lib/modal/modal.js.map +1 -0
- package/lib/modal/modal.less +27 -25
- package/lib/notification/index.js +4 -10
- package/lib/page/Box.js +24 -37
- package/lib/page/index.js +37 -66
- package/lib/page/style/index.d.ts +1 -0
- package/lib/page/style/index.d.ts.map +1 -0
- package/lib/page/style/index.js +1 -0
- package/lib/page/style/index.js.map +1 -0
- package/lib/page/utils.js +1 -9
- package/lib/page-header/index.js +4 -10
- package/lib/pagination/index.js +4 -10
- package/lib/popconfirm/index.js +4 -10
- package/lib/popover/index.js +4 -10
- package/lib/prev-locale.js +1 -10
- package/lib/progress/index.js +4 -10
- package/lib/query-form/Field/Checkbox.js +2 -11
- package/lib/query-form/Field/Select.js +27 -45
- package/lib/query-form/Field/SelectInput.js +21 -46
- package/lib/query-form/Field/fieldsMap.js +1 -12
- package/lib/query-form/Field/index.js +38 -70
- package/lib/query-form/createActions.js +0 -7
- package/lib/query-form/index.js +52 -121
- package/lib/query-form/style/index.d.ts +1 -0
- package/lib/query-form/style/index.d.ts.map +1 -0
- package/lib/query-form/style/index.js +1 -0
- package/lib/query-form/style/index.js.map +1 -0
- package/lib/query-form/useForm.js +0 -4
- package/lib/query-list-scene/List.js +58 -111
- package/lib/query-list-scene/QueryForm.js +37 -67
- package/lib/query-list-scene/QueryListScene.js +21 -42
- package/lib/query-list-scene/Title.js +1 -5
- package/lib/query-list-scene/Toolbar.js +8 -15
- package/lib/query-list-scene/createActions.js +0 -6
- package/lib/query-list-scene/index.js +0 -10
- package/lib/query-list-scene/style/index.d.ts +1 -0
- package/lib/query-list-scene/style/index.d.ts.map +1 -0
- package/lib/query-list-scene/style/index.js +1 -0
- package/lib/query-list-scene/style/index.js.map +1 -0
- package/lib/query-list-scene/useActions.js +0 -4
- package/lib/radio/index.js +4 -10
- package/lib/rate/index.js +4 -10
- package/lib/render-empty/index.js +0 -2
- package/lib/render-empty/render-empty.js +0 -8
- package/lib/render-empty/style/index.d.ts +2 -0
- package/lib/render-empty/style/index.d.ts.map +1 -0
- package/lib/render-empty/style/index.js +3 -0
- package/lib/render-empty/style/index.js.map +1 -0
- package/lib/result/index.js +4 -10
- package/lib/row/index.js +4 -10
- package/lib/select/index.js +4 -10
- package/lib/skeleton/index.js +4 -10
- package/lib/slider/index.js +4 -10
- package/lib/spin/index.js +4 -10
- package/lib/statistic/index.js +4 -10
- package/lib/steps/index.js +1 -5
- package/lib/steps/steps.js +12 -29
- package/lib/svg-components/illustration-403.js +3 -9
- package/lib/svg-components/illustration-404.js +3 -9
- package/lib/svg-components/illustration-500.js +3 -9
- package/lib/svg-components/illustration-empty.js +3 -9
- package/lib/svg-components/illustration-failure.js +3 -9
- package/lib/svg-components/illustration-no-access.js +3 -9
- package/lib/svg-components/illustration-no-chart.js +3 -9
- package/lib/svg-components/illustration-no-result.js +3 -9
- package/lib/svg-components/illustration-offline.js +3 -9
- package/lib/svg-components/illustration-success.js +3 -9
- package/lib/svg-components/index.js +0 -11
- package/lib/switch/index.js +4 -10
- package/lib/table/assets/image-loading-background.js +3 -9
- package/lib/table/assets/image-loading.js +3 -9
- package/lib/table/context.js +0 -2
- package/lib/table/hooks/index.js +1 -2
- package/lib/table/hooks/use-column-setting.js +8 -16
- package/lib/table/index.js +1 -5
- package/lib/table/style/index.d.ts +3 -0
- package/lib/table/style/index.d.ts.map +1 -0
- package/lib/table/style/index.js +4 -0
- package/lib/table/style/index.js.map +1 -0
- package/lib/table/table.js +34 -63
- package/lib/table/table.stories.js +2 -11
- package/lib/table/utils.js +2 -11
- package/lib/tabs/index.js +4 -10
- package/lib/tag/index.js +4 -10
- package/lib/time-picker/index.js +4 -10
- package/lib/timeline/index.js +4 -10
- package/lib/title/index.js +10 -20
- package/lib/title/style/index.d.ts +1 -0
- package/lib/title/style/index.d.ts.map +1 -0
- package/lib/title/style/index.js +1 -0
- package/lib/title/style/index.js.map +1 -0
- package/lib/tntd-cascader/AntdCascader/component/DisabledContext.js +4 -11
- package/lib/tntd-cascader/AntdCascader/component/FormItemInputContext.js +3 -8
- package/lib/tntd-cascader/AntdCascader/component/SizeContext.js +3 -8
- package/lib/tntd-cascader/AntdCascader/component/context.js +3 -9
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +4 -12
- package/lib/tntd-cascader/AntdCascader/component/getIcons.js +19 -37
- package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +8 -17
- package/lib/tntd-cascader/AntdCascader/config/utils.js +6 -15
- package/lib/tntd-cascader/AntdCascader/config/warning.js +7 -15
- package/lib/tntd-cascader/AntdCascader/index.js +80 -133
- package/lib/tntd-cascader/AntdCascader/interface.js +0 -3
- package/lib/tntd-cascader/index.js +0 -2
- package/lib/tntd-cascader/rc-cascader/Cascader.js +123 -188
- package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +11 -21
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +60 -88
- package/lib/tntd-cascader/rc-cascader/OptionList/index.js +65 -109
- package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +18 -33
- package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +56 -106
- package/lib/tntd-cascader/rc-cascader/context.js +3 -8
- package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +14 -31
- package/lib/tntd-cascader/rc-cascader/hooks/useEntities.js +5 -15
- package/lib/tntd-cascader/rc-cascader/hooks/useMissingValues.js +3 -11
- package/lib/tntd-cascader/rc-cascader/hooks/useRefFunc.js +3 -8
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +3 -15
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +26 -41
- package/lib/tntd-cascader/rc-cascader/index.js +0 -3
- package/lib/tntd-cascader/rc-cascader/utils/commonUtil.js +9 -20
- package/lib/tntd-cascader/rc-cascader/utils/treeUtil.js +0 -8
- package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +7 -14
- package/lib/tntd-icon/fonts/iconfont.js +7 -12
- package/lib/tntd-icon/index.js +6 -17
- package/lib/tntd-icon/style/index.d.ts +1 -0
- package/lib/tntd-icon/style/index.d.ts.map +1 -0
- package/lib/tntd-icon/style/index.js +1 -0
- package/lib/tntd-icon/style/index.js.map +1 -0
- package/lib/tntd-layout/ActionsContext.js +0 -3
- package/lib/tntd-layout/AppList.js +30 -105
- package/lib/tntd-layout/Application.js +22 -84
- package/lib/tntd-layout/Avatar.js +18 -72
- package/lib/tntd-layout/CompatibleLanguage.js +32 -105
- package/lib/tntd-layout/EnterpriseLayout/Avatar.js +24 -80
- package/lib/tntd-layout/EnterpriseLayout/Language.js +14 -45
- package/lib/tntd-layout/EnterpriseLayout/Theme.js +16 -46
- package/lib/tntd-layout/EnterpriseLayout/index.js +4 -12
- package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +45 -174
- package/lib/tntd-layout/GlobalNavigation/index.js +19 -70
- package/lib/tntd-layout/Header.js +20 -54
- package/lib/tntd-layout/HeaderActions.js +33 -64
- package/lib/tntd-layout/HeaderNavs.js +19 -59
- package/lib/tntd-layout/HeaderTabs.js +43 -111
- package/lib/tntd-layout/Iconfont.js +0 -5
- package/lib/tntd-layout/Language.js +14 -45
- package/lib/tntd-layout/Layout.js +74 -113
- package/lib/tntd-layout/Logo.js +14 -41
- package/lib/tntd-layout/OrgAppList.js +51 -119
- package/lib/tntd-layout/SideMenu.js +42 -120
- package/lib/tntd-layout/Theme.js +19 -71
- package/lib/tntd-layout/createActions.js +0 -5
- package/lib/tntd-layout/images/index.js +0 -28
- package/lib/tntd-layout/index.js +21 -49
- package/lib/tntd-layout/paaslayout/CompactSideMenu.js +29 -81
- package/lib/tntd-layout/paaslayout/Header.js +14 -47
- package/lib/tntd-layout/paaslayout/Logo.js +2 -19
- package/lib/tntd-layout/paaslayout/SideMenu.js +31 -82
- package/lib/tntd-layout/paaslayout/index.js +62 -108
- 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 +3 -33
- package/lib/tntd-layout/style/index.d.ts +1 -0
- package/lib/tntd-layout/style/index.d.ts.map +1 -0
- package/lib/tntd-layout/style/index.js +1 -0
- package/lib/tntd-layout/style/index.js.map +1 -0
- package/lib/tntd-modal/index.js +32 -51
- package/lib/tntd-modal/style/index.d.ts +1 -0
- package/lib/tntd-modal/style/index.d.ts.map +1 -0
- package/lib/tntd-modal/style/index.js +1 -0
- package/lib/tntd-modal/style/index.js.map +1 -0
- package/lib/tntd-second-page/index.js +14 -24
- package/lib/tntd-select/DropDownWrap.js +24 -45
- package/lib/tntd-select/index.js +117 -206
- package/lib/tntd-select/style/index.d.ts +1 -0
- package/lib/tntd-select/style/index.d.ts.map +1 -0
- package/lib/tntd-select/style/index.js +1 -0
- package/lib/tntd-select/style/index.js.map +1 -0
- package/lib/tooltip/index.js +4 -10
- package/lib/transfer/index.js +4 -10
- package/lib/tree/index.js +4 -10
- package/lib/tree-select/index.js +4 -10
- package/lib/typography/index.js +4 -10
- package/lib/upload/index.js +4 -10
- package/lib/utils/checkAuth.js +4 -10
- package/lib/utils/findMenuInfoByPath.js +1 -7
- package/lib/utils/index.js +13 -41
- package/lib/version/index.js +4 -10
- package/package.json +1 -1
package/es/tntd-icon/index.js
CHANGED
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
var __rest = this && this.__rest || function (s, e) {
|
|
2
2
|
var t = {};
|
|
3
|
-
|
|
4
3
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
5
|
-
|
|
6
4
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
5
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
8
6
|
}
|
|
9
7
|
return t;
|
|
10
8
|
};
|
|
11
|
-
|
|
12
9
|
import React from 'react';
|
|
13
10
|
import './fonts/iconfont';
|
|
14
11
|
import './index.less';
|
|
15
12
|
export { default as iconList } from '../icon-list';
|
|
16
13
|
export default (_a => {
|
|
17
14
|
var {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
type,
|
|
16
|
+
prefix = 'tnt-',
|
|
17
|
+
className = ''
|
|
18
|
+
} = _a,
|
|
19
|
+
props = __rest(_a, ["type", "prefix", "className"]);
|
|
24
20
|
return React.createElement("i", Object.assign({
|
|
25
21
|
className: `tnt-icon ${className}`,
|
|
26
22
|
type: type
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tntd-icon/style/index.ts"],"names":[],"mappings":"","sourcesContent":[""]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { createContext } from 'react';
|
|
2
|
-
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
// import createActions from './createActions';
|
|
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
|
+
`;
|
|
53
|
+
// 新版UI
|
|
54
54
|
const AppsSelect = styled(Select)`
|
|
55
55
|
min-width: 160px;
|
|
56
56
|
height: 28px;
|
|
@@ -140,10 +140,8 @@ export default withTheme(props => {
|
|
|
140
140
|
items = [],
|
|
141
141
|
onChange
|
|
142
142
|
} = props;
|
|
143
|
-
|
|
144
143
|
const getInitialSelectedApp = () => {
|
|
145
144
|
const currentAppStore = getCurrentAppStore();
|
|
146
|
-
|
|
147
145
|
const findAppByKey = selectedKey => {
|
|
148
146
|
let findApp;
|
|
149
147
|
traverseTree(items, item => {
|
|
@@ -154,17 +152,14 @@ export default withTheme(props => {
|
|
|
154
152
|
});
|
|
155
153
|
return findApp;
|
|
156
154
|
};
|
|
157
|
-
|
|
158
155
|
const currentApp = findAppByKey(selectedKey || _get(currentAppStore, 'key'));
|
|
159
156
|
return currentApp || items[0];
|
|
160
157
|
};
|
|
161
|
-
|
|
162
158
|
const changeApp = app => {
|
|
163
159
|
setSelectedApp(app);
|
|
164
160
|
setCurrentAppStore(app);
|
|
165
161
|
onChange && onChange(app);
|
|
166
162
|
};
|
|
167
|
-
|
|
168
163
|
const [searchValue, setSearchValue] = useState();
|
|
169
164
|
const [selectedApp, setSelectedApp] = useState(getInitialSelectedApp());
|
|
170
165
|
const Menus = React.createElement(MenuList, {
|
|
@@ -185,11 +180,9 @@ export default withTheme(props => {
|
|
|
185
180
|
name
|
|
186
181
|
} = {}) => {
|
|
187
182
|
const regExp = new RegExp(searchValue, 'i');
|
|
188
|
-
|
|
189
183
|
if (searchValue) {
|
|
190
184
|
return regExp.test(key) || regExp.test(name);
|
|
191
185
|
}
|
|
192
|
-
|
|
193
186
|
return true;
|
|
194
187
|
}).map(item => React.createElement(Menu.Item, {
|
|
195
188
|
key: item.key,
|
|
@@ -197,16 +190,13 @@ export default withTheme(props => {
|
|
|
197
190
|
}, item.name)));
|
|
198
191
|
useEffect(() => {
|
|
199
192
|
const newApp = getInitialSelectedApp();
|
|
200
|
-
|
|
201
193
|
if ((newApp === null || newApp === void 0 ? void 0 : newApp.key) !== (selectedApp === null || selectedApp === void 0 ? void 0 : selectedApp.key)) {
|
|
202
194
|
changeApp(newApp);
|
|
203
195
|
}
|
|
204
196
|
}, [items, selectedKey]);
|
|
205
|
-
|
|
206
197
|
if (!props.theme.compatible) {
|
|
207
198
|
if (items === null || items === void 0 ? void 0 : items.some(item => {
|
|
208
199
|
var _a;
|
|
209
|
-
|
|
210
200
|
return (_a = item.children) === null || _a === void 0 ? void 0 : _a.length;
|
|
211
201
|
})) {
|
|
212
202
|
return React.createElement(AppTreeSelect, {
|
|
@@ -242,7 +232,6 @@ export default withTheme(props => {
|
|
|
242
232
|
}
|
|
243
233
|
});
|
|
244
234
|
}
|
|
245
|
-
|
|
246
235
|
return React.createElement(AppsSelect, {
|
|
247
236
|
placeholder: "\u8BF7\u9009\u62E9",
|
|
248
237
|
showSearch: true,
|
|
@@ -266,7 +255,6 @@ export default withTheme(props => {
|
|
|
266
255
|
value: key
|
|
267
256
|
}, name)));
|
|
268
257
|
}
|
|
269
|
-
|
|
270
258
|
return React.createElement(Dropdown, {
|
|
271
259
|
overlay: Menus,
|
|
272
260
|
trigger: ['click']
|
|
@@ -60,7 +60,6 @@ const AppContentWrapper = styled.div`
|
|
|
60
60
|
border-radius: 4px;
|
|
61
61
|
z-index: 1;
|
|
62
62
|
`;
|
|
63
|
-
|
|
64
63
|
const AppContent = props => {
|
|
65
64
|
const {
|
|
66
65
|
language,
|
|
@@ -68,12 +67,10 @@ const AppContent = props => {
|
|
|
68
67
|
onChange
|
|
69
68
|
} = props;
|
|
70
69
|
const [appKey, setAppKey] = useState(props.appKey);
|
|
71
|
-
|
|
72
70
|
const changeApp = appKey => {
|
|
73
71
|
setAppKey(appKey);
|
|
74
72
|
onChange && onChange(appKey);
|
|
75
73
|
};
|
|
76
|
-
|
|
77
74
|
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(({
|
|
78
75
|
appKey: key
|
|
79
76
|
}) => React.createElement(AppItem, {
|
|
@@ -93,7 +90,6 @@ const AppContent = props => {
|
|
|
93
90
|
en: 'enName'
|
|
94
91
|
}[language || 'cn']}`, key))))));
|
|
95
92
|
};
|
|
96
|
-
|
|
97
93
|
export default (props => React.createElement(App, null, React.createElement(Popover, {
|
|
98
94
|
placement: "bottomRight",
|
|
99
95
|
title: null,
|
package/es/tntd-layout/Avatar.js
CHANGED
|
@@ -75,7 +75,6 @@ const UserInfoWrapper = styled.div`
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
`;
|
|
78
|
-
|
|
79
78
|
const UserInfoContent = props => {
|
|
80
79
|
const {
|
|
81
80
|
userInfo,
|
|
@@ -125,10 +124,8 @@ const UserInfoContent = props => {
|
|
|
125
124
|
}
|
|
126
125
|
}, getText('signOut'))));
|
|
127
126
|
};
|
|
128
|
-
|
|
129
127
|
export default (props => {
|
|
130
128
|
var _a;
|
|
131
|
-
|
|
132
129
|
const {
|
|
133
130
|
userInfo = {}
|
|
134
131
|
} = props;
|
|
@@ -145,7 +142,6 @@ export default (props => {
|
|
|
145
142
|
src: avatar.indexOf('base64') > 0 ? avatar : _get(images[avatar], 'default', images[avatar]),
|
|
146
143
|
onError: e => {
|
|
147
144
|
var _a;
|
|
148
|
-
|
|
149
145
|
e.target.onerror = null;
|
|
150
146
|
e.target.src = ((_a = images.empty) === null || _a === void 0 ? void 0 : _a.default) || images.empty;
|
|
151
147
|
}
|
|
@@ -119,7 +119,6 @@ const themes = [{
|
|
|
119
119
|
value: 'themeS2',
|
|
120
120
|
img: images.themeSymbol2
|
|
121
121
|
}];
|
|
122
|
-
|
|
123
122
|
const ThemeContent = props => {
|
|
124
123
|
const {
|
|
125
124
|
config,
|
|
@@ -130,40 +129,31 @@ const ThemeContent = props => {
|
|
|
130
129
|
language: languageVisible = true,
|
|
131
130
|
theme: themeVisible = true
|
|
132
131
|
} = config || {};
|
|
133
|
-
|
|
134
132
|
const getTheme = () => {
|
|
135
133
|
let theme = getThemeStore() || props.theme || 'themeS2';
|
|
136
134
|
return themes.some(({
|
|
137
135
|
value
|
|
138
136
|
}) => value === theme) ? theme : 'themeS2';
|
|
139
137
|
};
|
|
140
|
-
|
|
141
138
|
const [theme, setTheme] = useState(getTheme());
|
|
142
|
-
|
|
143
139
|
const changeTheme = theme => {
|
|
144
140
|
setTheme(theme);
|
|
145
141
|
setThemeStore(theme);
|
|
146
142
|
onThemeChange(theme);
|
|
147
143
|
};
|
|
148
|
-
|
|
149
144
|
const getLanguage = () => {
|
|
150
145
|
let lang = getLanguageStore() || props.language;
|
|
151
|
-
|
|
152
146
|
if (!languagesMap[lang]) {
|
|
153
147
|
lang = _get(languages, '0.value');
|
|
154
148
|
}
|
|
155
|
-
|
|
156
149
|
return lang;
|
|
157
150
|
};
|
|
158
|
-
|
|
159
151
|
const [language = 'cn', setLanguage] = useState(getLanguage());
|
|
160
|
-
|
|
161
152
|
const changeLanguage = language => {
|
|
162
153
|
setLanguage(language);
|
|
163
154
|
setLanguageStore(language);
|
|
164
155
|
onLanguageChange(language);
|
|
165
156
|
};
|
|
166
|
-
|
|
167
157
|
return React.createElement(ThemeContentWrapper, null, themeVisible && React.createElement(ThemeSwitch, null, themes.map(({
|
|
168
158
|
value,
|
|
169
159
|
img
|
|
@@ -187,16 +177,13 @@ const ThemeContent = props => {
|
|
|
187
177
|
onClick: changeLanguage.bind(this, value)
|
|
188
178
|
}, name))));
|
|
189
179
|
};
|
|
190
|
-
|
|
191
180
|
export default (props => {
|
|
192
181
|
const {
|
|
193
182
|
config
|
|
194
183
|
} = props;
|
|
195
|
-
|
|
196
184
|
if ((config === null || config === void 0 ? void 0 : config.language) === false && (config === null || config === void 0 ? void 0 : config.theme) === false) {
|
|
197
185
|
return null;
|
|
198
186
|
}
|
|
199
|
-
|
|
200
187
|
return React.createElement(Theme, null, React.createElement(Popover, {
|
|
201
188
|
placement: "bottomRight",
|
|
202
189
|
title: null,
|
|
@@ -81,7 +81,6 @@ const UserInfoWrapper = styled.div`
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
`;
|
|
84
|
-
|
|
85
84
|
const UserInfoContent = props => {
|
|
86
85
|
const {
|
|
87
86
|
userInfo,
|
|
@@ -143,10 +142,8 @@ const UserInfoContent = props => {
|
|
|
143
142
|
}
|
|
144
143
|
}, getText('signOut'))));
|
|
145
144
|
};
|
|
146
|
-
|
|
147
145
|
export default (props => {
|
|
148
146
|
var _a;
|
|
149
|
-
|
|
150
147
|
const {
|
|
151
148
|
userInfo = {}
|
|
152
149
|
} = props;
|
|
@@ -163,7 +160,6 @@ export default (props => {
|
|
|
163
160
|
src: avatar.indexOf('base64') > 0 ? avatar : _get(images[avatar], 'default', images[avatar]),
|
|
164
161
|
onError: e => {
|
|
165
162
|
var _a;
|
|
166
|
-
|
|
167
163
|
e.target.onerror = null;
|
|
168
164
|
e.target.src = ((_a = images.empty) === null || _a === void 0 ? void 0 : _a.default) || images.empty;
|
|
169
165
|
}
|
|
@@ -65,26 +65,20 @@ export default withTheme(props => {
|
|
|
65
65
|
const {
|
|
66
66
|
onChange
|
|
67
67
|
} = props;
|
|
68
|
-
|
|
69
68
|
const getLanguage = () => {
|
|
70
69
|
let lang = getLanguageStore() || props.language;
|
|
71
|
-
|
|
72
70
|
if (!languagesMap[lang]) {
|
|
73
71
|
lang = _get(languages, '0.value');
|
|
74
72
|
}
|
|
75
|
-
|
|
76
73
|
return lang;
|
|
77
74
|
};
|
|
78
|
-
|
|
79
75
|
const [language = 'cn', setLanguage] = useState(getLanguage());
|
|
80
|
-
|
|
81
76
|
const switchLanguage = () => {
|
|
82
77
|
const lang = language !== 'en' ? 'en' : 'cn';
|
|
83
78
|
setLanguage(lang);
|
|
84
79
|
setLanguageStore(lang);
|
|
85
80
|
onChange && onChange(lang);
|
|
86
81
|
};
|
|
87
|
-
|
|
88
82
|
const otherLanguage = useMemo(() => language === 'cn' ? 'en' : 'cn', [language]);
|
|
89
83
|
return React.createElement(Language, {
|
|
90
84
|
onClick: switchLanguage
|
|
@@ -70,22 +70,18 @@ export default (props => {
|
|
|
70
70
|
const {
|
|
71
71
|
onChange
|
|
72
72
|
} = props;
|
|
73
|
-
|
|
74
73
|
const getTheme = () => {
|
|
75
74
|
let theme = getThemeStore() || props.theme || 'themeS3';
|
|
76
75
|
return themes.some(({
|
|
77
76
|
value
|
|
78
77
|
}) => value === theme) ? theme : 'themeS3';
|
|
79
78
|
};
|
|
80
|
-
|
|
81
79
|
const [theme, setTheme] = useState(getTheme());
|
|
82
|
-
|
|
83
80
|
const changeTheme = theme => {
|
|
84
81
|
setTheme(theme);
|
|
85
82
|
setThemeStore(theme);
|
|
86
83
|
onChange(theme);
|
|
87
84
|
};
|
|
88
|
-
|
|
89
85
|
return React.createElement(Theme, null, React.createElement(Row, {
|
|
90
86
|
type: "flex",
|
|
91
87
|
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,7 +122,6 @@ const ListBox = styled.ul`
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
`;
|
|
125
|
-
|
|
126
125
|
const SearchList = ({
|
|
127
126
|
items,
|
|
128
127
|
onSelectMenu,
|
|
@@ -132,7 +131,6 @@ const SearchList = ({
|
|
|
132
131
|
}, items === null || items === void 0 ? void 0 : items.map(item => React.createElement("li", {
|
|
133
132
|
onClick: () => onSelectMenu(item)
|
|
134
133
|
}, item === null || item === void 0 ? void 0 : item.menuName)));
|
|
135
|
-
|
|
136
134
|
export default (({
|
|
137
135
|
theme,
|
|
138
136
|
menus = [],
|
|
@@ -147,19 +145,16 @@ export default (({
|
|
|
147
145
|
const isLevel3 = hasLevel3(menus);
|
|
148
146
|
const [activeTopMenu, setActiveTopMenu] = useState(isLevel3 ? menus === null || menus === void 0 ? void 0 : menus[0] : null);
|
|
149
147
|
const selectedMenuKey = actions.getSelectedMenuKey();
|
|
150
|
-
|
|
151
148
|
const calcGroupMenus = menus => {
|
|
152
149
|
menus = menus === null || menus === void 0 ? void 0 : menus.reduce((acc, cur) => {
|
|
153
|
-
var _a;
|
|
154
|
-
|
|
155
|
-
|
|
150
|
+
var _a;
|
|
151
|
+
// 分组
|
|
156
152
|
if ((_a = cur === null || cur === void 0 ? void 0 : cur.children) === null || _a === void 0 ? void 0 : _a.length) {
|
|
157
153
|
acc.push(cur);
|
|
158
154
|
} else {
|
|
159
155
|
const defaultGroup = acc.find(({
|
|
160
156
|
isDefaultGroup
|
|
161
157
|
}) => isDefaultGroup);
|
|
162
|
-
|
|
163
158
|
if (!defaultGroup) {
|
|
164
159
|
acc.unshift({
|
|
165
160
|
isDefaultGroup: true,
|
|
@@ -169,47 +164,36 @@ export default (({
|
|
|
169
164
|
defaultGroup.children.push(cur);
|
|
170
165
|
}
|
|
171
166
|
}
|
|
172
|
-
|
|
173
167
|
return acc;
|
|
174
168
|
}, []);
|
|
175
169
|
return menus === null || menus === void 0 ? void 0 : menus.reduce((acc, cur) => {
|
|
176
170
|
var _a;
|
|
177
|
-
|
|
178
171
|
const column = Math.max(1, ~~((containerRef.current.clientWidth - 32) / 210));
|
|
179
|
-
|
|
180
172
|
if (!acc.length) {
|
|
181
173
|
acc.push([cur]);
|
|
182
174
|
} else {
|
|
183
175
|
const calcGroupHeight = group => {
|
|
184
176
|
var _a;
|
|
185
|
-
|
|
186
177
|
return 46 + (((_a = group === null || group === void 0 ? void 0 : group.children) === null || _a === void 0 ? void 0 : _a.length) || 0) * 30;
|
|
187
178
|
};
|
|
188
|
-
|
|
189
179
|
const calcColumnHeight = columnGroups => columnGroups === null || columnGroups === void 0 ? void 0 : columnGroups.reduce((acc, cur) => {
|
|
190
180
|
acc += calcGroupHeight(cur);
|
|
191
181
|
return acc;
|
|
192
182
|
}, 0);
|
|
193
|
-
|
|
194
183
|
const currentColumnHeight = calcColumnHeight(acc[acc.length - 1]);
|
|
195
184
|
const nextGroupHeight = calcGroupHeight(cur);
|
|
196
|
-
|
|
197
185
|
const findMinHeightGroup = groups => {
|
|
198
186
|
let minHeight = Infinity;
|
|
199
187
|
let index = 0;
|
|
200
|
-
|
|
201
188
|
for (let i = 0; i < groups.length; i++) {
|
|
202
189
|
const height = calcColumnHeight(groups[i]);
|
|
203
|
-
|
|
204
190
|
if (height < minHeight) {
|
|
205
191
|
index = i;
|
|
206
192
|
minHeight = height;
|
|
207
193
|
}
|
|
208
194
|
}
|
|
209
|
-
|
|
210
195
|
return groups[index];
|
|
211
196
|
};
|
|
212
|
-
|
|
213
197
|
if (acc.length >= column) {
|
|
214
198
|
const minHeightGroup = findMinHeightGroup(acc);
|
|
215
199
|
minHeightGroup === null || minHeightGroup === void 0 ? void 0 : minHeightGroup.push(cur);
|
|
@@ -221,14 +205,11 @@ export default (({
|
|
|
221
205
|
}
|
|
222
206
|
}
|
|
223
207
|
}
|
|
224
|
-
|
|
225
208
|
return acc;
|
|
226
209
|
}, []);
|
|
227
210
|
};
|
|
228
|
-
|
|
229
211
|
const groupMenus = calcGroupMenus((activeTopMenu === null || activeTopMenu === void 0 ? void 0 : activeTopMenu.children) || menus);
|
|
230
212
|
const [searchedMenus, setSearchedMenus] = useState([]);
|
|
231
|
-
|
|
232
213
|
const onMenuClick = menu => {
|
|
233
214
|
actions.emit('menuSelect', {
|
|
234
215
|
key: menu.code,
|
|
@@ -238,36 +219,28 @@ export default (({
|
|
|
238
219
|
setSearchedMenus([]);
|
|
239
220
|
close();
|
|
240
221
|
};
|
|
241
|
-
|
|
242
222
|
const debounceSearch = _debounce(evt => {
|
|
243
223
|
var _a;
|
|
244
|
-
|
|
245
224
|
const value = (_a = evt.target.value) === null || _a === void 0 ? void 0 : _a.trim();
|
|
246
225
|
const matchedMenus = [];
|
|
247
|
-
|
|
248
226
|
if (value) {
|
|
249
227
|
traverseTree(menus, node => {
|
|
250
228
|
var _a;
|
|
251
|
-
|
|
252
229
|
if (node.path && ((_a = node === null || node === void 0 ? void 0 : node.menuName) === null || _a === void 0 ? void 0 : _a.includes(value))) {
|
|
253
230
|
matchedMenus.push(node);
|
|
254
231
|
}
|
|
255
232
|
});
|
|
256
233
|
}
|
|
257
|
-
|
|
258
234
|
setSearchedMenus(matchedMenus);
|
|
259
235
|
}, 100);
|
|
260
|
-
|
|
261
236
|
const onSearchChange = evt => {
|
|
262
237
|
evt.persist();
|
|
263
238
|
setSearchValue(evt.target.value);
|
|
264
239
|
debounceSearch(evt);
|
|
265
240
|
};
|
|
266
|
-
|
|
267
241
|
const onSelectAppTab = menu => {
|
|
268
242
|
setActiveTopMenu(menu);
|
|
269
243
|
};
|
|
270
|
-
|
|
271
244
|
useEffect(() => {
|
|
272
245
|
const clickOutside = evt => {
|
|
273
246
|
const {
|
|
@@ -276,12 +249,10 @@ export default (({
|
|
|
276
249
|
pageX,
|
|
277
250
|
pageY
|
|
278
251
|
} = evt;
|
|
279
|
-
|
|
280
252
|
const isOutside = (evt, popup) => {
|
|
281
253
|
if (popup === null || popup === void 0 ? void 0 : popup.contains) {
|
|
282
254
|
return !(popup === null || popup === void 0 ? void 0 : popup.contains(evt.target));
|
|
283
255
|
}
|
|
284
|
-
|
|
285
256
|
let {
|
|
286
257
|
x,
|
|
287
258
|
y,
|
|
@@ -293,14 +264,12 @@ export default (({
|
|
|
293
264
|
y += window.scrollY;
|
|
294
265
|
return pageX < x || pageX > x + width || pageY < y || pageY > y + height;
|
|
295
266
|
};
|
|
296
|
-
|
|
297
267
|
if (isOutside(evt, popupRef.current)) {
|
|
298
268
|
setSearchValue('');
|
|
299
269
|
setSearchedMenus([]);
|
|
300
270
|
close();
|
|
301
271
|
}
|
|
302
272
|
};
|
|
303
|
-
|
|
304
273
|
document.addEventListener('click', clickOutside);
|
|
305
274
|
return () => document.removeEventListener('click', clickOutside);
|
|
306
275
|
}, []);
|
|
@@ -47,13 +47,11 @@ const Navigation = styled.li`
|
|
|
47
47
|
display: none;
|
|
48
48
|
}
|
|
49
49
|
`;
|
|
50
|
-
|
|
51
50
|
const createPopupContainer = () => {
|
|
52
51
|
const div = document.createElement('div');
|
|
53
52
|
div.setAttribute('class', 'tnt-navigation-popup');
|
|
54
53
|
return div;
|
|
55
54
|
};
|
|
56
|
-
|
|
57
55
|
const GlobalStyle = createGlobalStyle`
|
|
58
56
|
.tnt-navigation-popup {
|
|
59
57
|
position: absolute;
|
|
@@ -87,18 +85,15 @@ export default withTheme(props => {
|
|
|
87
85
|
const popupRef = useRef();
|
|
88
86
|
useEffect(() => {
|
|
89
87
|
var _a;
|
|
90
|
-
|
|
91
88
|
popupRef.current = createPopupContainer();
|
|
92
89
|
(_a = headerRef === null || headerRef === void 0 ? void 0 : headerRef.current) === null || _a === void 0 ? void 0 : _a.appendChild(popupRef.current);
|
|
93
90
|
return () => {
|
|
94
91
|
var _a;
|
|
95
|
-
|
|
96
92
|
(_a = headerRef === null || headerRef === void 0 ? void 0 : headerRef.current) === null || _a === void 0 ? void 0 : _a.removeChild(popupRef.current);
|
|
97
93
|
};
|
|
98
94
|
}, []);
|
|
99
95
|
useEffect(() => {
|
|
100
96
|
const classNames = popupRef.current.getAttribute('class').split(' ');
|
|
101
|
-
|
|
102
97
|
if (visible) {
|
|
103
98
|
ReactDOM.render(React.createElement(NavigationPopup, {
|
|
104
99
|
actions: actions,
|
|
@@ -116,7 +111,6 @@ export default withTheme(props => {
|
|
|
116
111
|
return React.createElement(Navigation, {
|
|
117
112
|
onClick: evt => {
|
|
118
113
|
var _a, _b;
|
|
119
|
-
|
|
120
114
|
evt.stopPropagation();
|
|
121
115
|
(_a = evt.nativeEvent) === null || _a === void 0 ? void 0 : _a.stopImmediatePropagation();
|
|
122
116
|
(_b = evt.nativeEvent) === null || _b === void 0 ? void 0 : _b.stopPropagation();
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
var __rest = this && this.__rest || function (s, e) {
|
|
2
2
|
var t = {};
|
|
3
|
-
|
|
4
3
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
5
|
-
|
|
6
4
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
5
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
8
6
|
}
|
|
9
7
|
return t;
|
|
10
8
|
};
|
|
11
|
-
|
|
12
9
|
import React from 'react';
|
|
13
10
|
import styled, { withTheme } from 'styled-components';
|
|
14
11
|
import Divider from '../divider';
|
|
@@ -64,35 +61,34 @@ const Actions = styled.ul`
|
|
|
64
61
|
`;
|
|
65
62
|
export default withTheme(props => {
|
|
66
63
|
const {
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
64
|
+
type,
|
|
65
|
+
config: {
|
|
66
|
+
theme = true,
|
|
67
|
+
avatar = true,
|
|
68
|
+
language = true,
|
|
69
|
+
application = false,
|
|
70
|
+
globalNavigation = false
|
|
71
|
+
} = {},
|
|
72
|
+
theme: {
|
|
73
|
+
compatible
|
|
74
|
+
},
|
|
75
|
+
userInfo = {},
|
|
76
|
+
menus,
|
|
77
|
+
apps,
|
|
78
|
+
extraActions,
|
|
79
|
+
headerRef,
|
|
80
|
+
onLanguageChange,
|
|
81
|
+
onThemeChange,
|
|
82
|
+
onApplicationChange,
|
|
83
|
+
onAppChange,
|
|
84
|
+
onCollapseChange,
|
|
85
|
+
onPersonalSetting,
|
|
86
|
+
onChangePassword,
|
|
87
|
+
onLogout,
|
|
88
|
+
onLogoClick,
|
|
89
|
+
AvatarCustom
|
|
90
|
+
} = props,
|
|
91
|
+
rest = __rest(props, ["type", "config", "theme", "userInfo", "menus", "apps", "extraActions", "headerRef", "onLanguageChange", "onThemeChange", "onApplicationChange", "onAppChange", "onCollapseChange", "onPersonalSetting", "onChangePassword", "onLogout", "onLogoClick", "AvatarCustom"]);
|
|
96
92
|
return React.createElement(Actions, Object.assign({}, rest), extraActions, globalNavigation && React.createElement(GlobalNavigation, {
|
|
97
93
|
headerRef: headerRef,
|
|
98
94
|
menus: menus
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import _get from "lodash/get";
|
|
2
|
-
|
|
3
2
|
var __rest = this && this.__rest || function (s, e) {
|
|
4
3
|
var t = {};
|
|
5
|
-
|
|
6
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
7
|
-
|
|
8
5
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
9
6
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
10
7
|
}
|
|
11
8
|
return t;
|
|
12
9
|
};
|
|
13
|
-
|
|
14
10
|
import React, { useState, useEffect } from 'react';
|
|
15
11
|
import styled, { withTheme } from 'styled-components';
|
|
16
12
|
import cn from 'classnames';
|
|
@@ -67,25 +63,21 @@ const NavItem = styled.li`
|
|
|
67
63
|
`;
|
|
68
64
|
export const HeaderNavs = withTheme(_a => {
|
|
69
65
|
var {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
66
|
+
theme,
|
|
67
|
+
navs = [],
|
|
68
|
+
onChange,
|
|
69
|
+
onSelect
|
|
70
|
+
} = _a,
|
|
71
|
+
props = __rest(_a, ["theme", "navs", "onChange", "onSelect"]);
|
|
77
72
|
const [selectedKey, setSelectedKey] = useState(props.selectedKey || _get(navs, '0.key'));
|
|
78
|
-
|
|
79
73
|
const onClickNav = nav => {
|
|
80
74
|
setSelectedKey(nav.key);
|
|
81
75
|
onSelect && onSelect(nav);
|
|
82
|
-
|
|
83
76
|
if (selectedKey !== nav.key) {
|
|
84
77
|
onChange && onChange(nav);
|
|
85
78
|
setSelectedKey(nav.key);
|
|
86
79
|
}
|
|
87
80
|
};
|
|
88
|
-
|
|
89
81
|
useEffect(() => {
|
|
90
82
|
setSelectedKey(props.selectedKey || _get(navs, '0.key'));
|
|
91
83
|
}, [navs, props.selectedKey]);
|