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
|
@@ -1,28 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) {
|
|
3
|
+
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports["default"] = void 0;
|
|
9
|
+
|
|
8
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
9
12
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
10
14
|
var _storage = require("../storage");
|
|
15
|
+
|
|
11
16
|
var _row = _interopRequireDefault(require("../../row"));
|
|
17
|
+
|
|
12
18
|
require("../../tntd-icon");
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
|
|
20
|
+
var _this = void 0;
|
|
21
|
+
|
|
15
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
+
|
|
24
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
25
|
+
|
|
26
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
|
|
28
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
29
|
+
|
|
30
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
31
|
+
|
|
32
|
+
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
33
|
+
|
|
23
34
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
35
|
+
|
|
36
|
+
function _templateObject() {
|
|
37
|
+
var data = _taggedTemplateLiteral(["\n margin-top: 20px;\n .user-info-body-theme-row {\n > div {\n width: 90px;\n height: 36px;\n line-height: 36px;\n font-family: PingFangSC-Regular;\n font-size: 12px;\n border-radius: 2px;\n text-align: center;\n cursor: pointer;\n position: relative;\n &.themeS3 {\n background-image: linear-gradient(180deg, #213f83 0%, #0f75d6 100%);\n color: #ffffff;\n }\n &.themeS2 {\n background: #17233d;\n color: #ffffff;\n }\n &.themeS1 {\n background: #ffffff;\n box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.1);\n color: #17233d;\n }\n .icon-checked-wrap {\n width: 14px;\n height: 14px;\n border-radius: 100%;\n background: #126bfb;\n position: absolute;\n top: -5px;\n right: -5px;\n &:after {\n content: '';\n width: 4px;\n height: 6px;\n border-color: #ffffff;\n border-width: 0 1px 1px 0;\n border-style: solid;\n transform: rotate(45deg);\n position: absolute;\n top: 3px;\n left: 5px;\n }\n }\n }\n }\n"]);
|
|
38
|
+
|
|
39
|
+
_templateObject = function _templateObject() {
|
|
40
|
+
return data;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return data;
|
|
44
|
+
}
|
|
45
|
+
|
|
24
46
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
25
|
-
|
|
47
|
+
|
|
48
|
+
var Theme = _styledComponents["default"].li(_templateObject());
|
|
49
|
+
|
|
26
50
|
var themes = [{
|
|
27
51
|
value: 'themeS3',
|
|
28
52
|
label: '科技蓝',
|
|
@@ -36,8 +60,10 @@ var themes = [{
|
|
|
36
60
|
label: '极致白',
|
|
37
61
|
enLabel: 'White'
|
|
38
62
|
}];
|
|
63
|
+
|
|
39
64
|
var _default = function _default(props) {
|
|
40
65
|
var onChange = props.onChange;
|
|
66
|
+
|
|
41
67
|
var getTheme = function getTheme() {
|
|
42
68
|
var theme = (0, _storage.getThemeStore)() || props.theme || 'themeS3';
|
|
43
69
|
return themes.some(function (_ref) {
|
|
@@ -45,23 +71,26 @@ var _default = function _default(props) {
|
|
|
45
71
|
return value === theme;
|
|
46
72
|
}) ? theme : 'themeS3';
|
|
47
73
|
};
|
|
74
|
+
|
|
48
75
|
var _useState = (0, _react.useState)(getTheme()),
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
76
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
77
|
+
theme = _useState2[0],
|
|
78
|
+
setTheme = _useState2[1];
|
|
79
|
+
|
|
52
80
|
var changeTheme = function changeTheme(theme) {
|
|
53
81
|
setTheme(theme);
|
|
54
82
|
(0, _storage.setThemeStore)(theme);
|
|
55
83
|
onChange(theme);
|
|
56
84
|
};
|
|
85
|
+
|
|
57
86
|
return _react["default"].createElement(Theme, null, _react["default"].createElement(_row["default"], {
|
|
58
87
|
type: "flex",
|
|
59
88
|
justify: "space-between",
|
|
60
89
|
className: "user-info-body-theme-row"
|
|
61
90
|
}, themes.map(function (_ref2) {
|
|
62
91
|
var value = _ref2.value,
|
|
63
|
-
|
|
64
|
-
|
|
92
|
+
label = _ref2.label,
|
|
93
|
+
enLabel = _ref2.enLabel;
|
|
65
94
|
return _react["default"].createElement("div", {
|
|
66
95
|
className: value,
|
|
67
96
|
onClick: changeTheme.bind(_this, value)
|
|
@@ -70,4 +99,5 @@ var _default = function _default(props) {
|
|
|
70
99
|
}));
|
|
71
100
|
})));
|
|
72
101
|
};
|
|
102
|
+
|
|
73
103
|
exports["default"] = _default;
|
|
@@ -4,18 +4,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
+
|
|
7
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
8
10
|
var _styledComponents = require("styled-components");
|
|
11
|
+
|
|
9
12
|
var _Layout = _interopRequireDefault(require("../Layout"));
|
|
13
|
+
|
|
10
14
|
var _Avatar = _interopRequireDefault(require("./Avatar"));
|
|
15
|
+
|
|
11
16
|
var _storage = require("../storage");
|
|
17
|
+
|
|
12
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
13
20
|
var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
14
21
|
var _props$userInfo = props.userInfo,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
userInfo = _props$userInfo === void 0 ? {} : _props$userInfo,
|
|
23
|
+
_props$extendMap = props.extendMap,
|
|
24
|
+
extendMap = _props$extendMap === void 0 ? {} : _props$extendMap; // 企业级的默认蓝色主题
|
|
25
|
+
|
|
19
26
|
var theme = (0, _storage.getThemeStore)() || (extendMap === null || extendMap === void 0 ? void 0 : extendMap.defaultTheme) || userInfo.theme || 'themeS3';
|
|
20
27
|
theme = theme === 'default' ? 'themeS3' : theme;
|
|
21
28
|
var newProps = Object.assign(Object.assign({}, props), {
|
|
@@ -27,4 +34,5 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
27
34
|
AvatarCustom: _Avatar["default"]
|
|
28
35
|
}));
|
|
29
36
|
});
|
|
37
|
+
|
|
30
38
|
exports["default"] = _default;
|
|
@@ -1,29 +1,113 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) {
|
|
3
|
+
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports["default"] = void 0;
|
|
9
|
+
|
|
8
10
|
var _debounce2 = _interopRequireDefault(require("lodash/debounce"));
|
|
11
|
+
|
|
9
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
|
|
10
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
11
16
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
17
|
+
|
|
12
18
|
var _utils = require("../../utils");
|
|
19
|
+
|
|
13
20
|
var _Iconfont = _interopRequireDefault(require("../Iconfont"));
|
|
21
|
+
|
|
14
22
|
require("../../locale");
|
|
15
|
-
|
|
16
|
-
function _getRequireWildcardCache(
|
|
17
|
-
|
|
23
|
+
|
|
24
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
25
|
+
|
|
26
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
|
|
18
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
|
|
29
|
+
|
|
30
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
31
|
+
|
|
32
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
33
|
+
|
|
34
|
+
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
35
|
+
|
|
24
36
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
+
|
|
38
|
+
function _templateObject7() {
|
|
39
|
+
var data = _taggedTemplateLiteral(["\n background: #fff;\n max-height: 320px;\n overflow-y: auto;\n margin: 0;\n padding: 6px 0;\n list-style: none;\n font-size: 13px;\n position: absolute;\n top: 29px;\n width: 100%;\n box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05);\n li {\n cursor: pointer;\n line-height: 32px;\n padding: 0 10px;\n color: ", ";\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n }\n"]);
|
|
40
|
+
|
|
41
|
+
_templateObject7 = function _templateObject7() {
|
|
42
|
+
return data;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return data;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function _templateObject6() {
|
|
49
|
+
var data = _taggedTemplateLiteral(["\n display: block;\n line-height: 30px;\n font-size: 12px;\n cursor: pointer;\n a {\n color: ", ";\n &:hover {\n color: ", " !important;\n }\n }\n &.active a {\n color: ", ";\n }\n"]);
|
|
50
|
+
|
|
51
|
+
_templateObject6 = function _templateObject6() {
|
|
52
|
+
return data;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return data;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function _templateObject5() {
|
|
59
|
+
var data = _taggedTemplateLiteral(["\n list-style: none;\n padding: 0;\n margin: 0;\n"]);
|
|
60
|
+
|
|
61
|
+
_templateObject5 = function _templateObject5() {
|
|
62
|
+
return data;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return data;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function _templateObject4() {
|
|
69
|
+
var data = _taggedTemplateLiteral(["\n margin-bottom: 20px;\n & > h5 {\n line-height: 20px;\n margin: 0;\n margin-bottom: 6px;\n }\n"]);
|
|
70
|
+
|
|
71
|
+
_templateObject4 = function _templateObject4() {
|
|
72
|
+
return data;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
return data;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function _templateObject3() {
|
|
79
|
+
var data = _taggedTemplateLiteral(["\n height: ", ";\n overflow: auto;\n & > div {\n width: 200px;\n margin-right: 10px;\n display: inline-block;\n vertical-align: top;\n }\n"]);
|
|
80
|
+
|
|
81
|
+
_templateObject3 = function _templateObject3() {
|
|
82
|
+
return data;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
return data;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function _templateObject2() {
|
|
89
|
+
var data = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n color: ", ";\n line-height: 32px;\n margin: 0 0 16px;\n padding: 0;\n display: inline-block;\n\n & > li {\n padding: 0 20px;\n display: inline-block;\n cursor: pointer;\n &:not(:last-child) {\n border-right: 1px solid ", ";\n }\n &.active {\n background-color: ", ";\n color: #fff;\n }\n }\n"]);
|
|
90
|
+
|
|
91
|
+
_templateObject2 = function _templateObject2() {
|
|
92
|
+
return data;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
return data;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function _templateObject() {
|
|
99
|
+
var data = _taggedTemplateLiteral(["\n position: relative;\n font-size: 14px;\n margin-bottom: 20px;\n color: ", ";\n &.active {\n color: ", ";\n input {\n border-color: ", ";\n }\n }\n .tnt-icon {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n line-height: 1em;\n &[type='close'] {\n right: 0;\n top: 0;\n font-size: 18px;\n cursor: pointer;\n }\n }\n input {\n border-width: 0 0 1px;\n border-style: solid;\n border-color: ", ";\n width: 100%;\n padding: 4px 20px;\n line-height: 20px;\n background-color: transparent;\n outline: none;\n }\n"]);
|
|
100
|
+
|
|
101
|
+
_templateObject = function _templateObject() {
|
|
102
|
+
return data;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
return data;
|
|
106
|
+
}
|
|
107
|
+
|
|
25
108
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
26
|
-
|
|
109
|
+
|
|
110
|
+
var SearchArea = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
27
111
|
return props.theme.secondaryTextColor;
|
|
28
112
|
}, function (props) {
|
|
29
113
|
return props.theme.primaryColor;
|
|
@@ -32,7 +116,8 @@ var SearchArea = _styledComponents["default"].div(_templateObject || (_templateO
|
|
|
32
116
|
}, function (props) {
|
|
33
117
|
return props.theme.borderColor;
|
|
34
118
|
});
|
|
35
|
-
|
|
119
|
+
|
|
120
|
+
var ApplicationTabs = _styledComponents["default"].ul(_templateObject2(), function (props) {
|
|
36
121
|
return props.theme.borderColor;
|
|
37
122
|
}, function (props) {
|
|
38
123
|
return props.theme.primaryTextColor;
|
|
@@ -41,29 +126,35 @@ var ApplicationTabs = _styledComponents["default"].ul(_templateObject2 || (_temp
|
|
|
41
126
|
}, function (props) {
|
|
42
127
|
return props.theme.primaryColor;
|
|
43
128
|
});
|
|
44
|
-
|
|
129
|
+
|
|
130
|
+
var GroupMenus = _styledComponents["default"].div(_templateObject3(), function (props) {
|
|
45
131
|
return props.isLevel3 ? 'calc(100% - 80px)' : 'calc(100% - 50px)';
|
|
46
132
|
});
|
|
47
|
-
|
|
48
|
-
var
|
|
49
|
-
|
|
133
|
+
|
|
134
|
+
var GroupMenuItem = _styledComponents["default"].div(_templateObject4());
|
|
135
|
+
|
|
136
|
+
var MenuList = _styledComponents["default"].ul(_templateObject5());
|
|
137
|
+
|
|
138
|
+
var MenuItem = _styledComponents["default"].li(_templateObject6(), function (props) {
|
|
50
139
|
return props.theme.secondaryTextColor;
|
|
51
140
|
}, function (props) {
|
|
52
141
|
return props.theme.secondaryColor;
|
|
53
142
|
}, function (props) {
|
|
54
143
|
return props.theme.primaryColor;
|
|
55
144
|
});
|
|
56
|
-
|
|
145
|
+
|
|
146
|
+
var ListBox = _styledComponents["default"].ul(_templateObject7(), function (props) {
|
|
57
147
|
return props.theme.primaryTextColor;
|
|
58
148
|
}, function (props) {
|
|
59
149
|
return props.theme.secondaryColor;
|
|
60
150
|
}, function (props) {
|
|
61
151
|
return props.theme.lightBgColor;
|
|
62
152
|
});
|
|
153
|
+
|
|
63
154
|
var SearchList = function SearchList(_ref) {
|
|
64
155
|
var items = _ref.items,
|
|
65
|
-
|
|
66
|
-
|
|
156
|
+
onSelectMenu = _ref.onSelectMenu,
|
|
157
|
+
theme = _ref.theme;
|
|
67
158
|
return _react["default"].createElement(ListBox, {
|
|
68
159
|
theme: theme
|
|
69
160
|
}, items === null || items === void 0 ? void 0 : items.map(function (item) {
|
|
@@ -74,33 +165,41 @@ var SearchList = function SearchList(_ref) {
|
|
|
74
165
|
}, item === null || item === void 0 ? void 0 : item.menuName);
|
|
75
166
|
}));
|
|
76
167
|
};
|
|
168
|
+
|
|
77
169
|
var _default = function _default(_ref2) {
|
|
78
170
|
var theme = _ref2.theme,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
171
|
+
_ref2$menus = _ref2.menus,
|
|
172
|
+
menus = _ref2$menus === void 0 ? [] : _ref2$menus,
|
|
173
|
+
close = _ref2.close,
|
|
174
|
+
actions = _ref2.actions,
|
|
175
|
+
popupRef = _ref2.popupRef,
|
|
176
|
+
containerRef = _ref2.containerRef;
|
|
177
|
+
|
|
85
178
|
var _useState = (0, _react.useState)(false),
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
179
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
180
|
+
active = _useState2[0],
|
|
181
|
+
setActive = _useState2[1];
|
|
182
|
+
|
|
89
183
|
var _useState3 = (0, _react.useState)(),
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
184
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
185
|
+
searchValue = _useState4[0],
|
|
186
|
+
setSearchValue = _useState4[1];
|
|
187
|
+
|
|
93
188
|
var language = actions === null || actions === void 0 ? void 0 : actions.getLanguage();
|
|
94
189
|
var isLevel3 = (0, _utils.hasLevel3)(menus);
|
|
190
|
+
|
|
95
191
|
var _useState5 = (0, _react.useState)(isLevel3 ? menus === null || menus === void 0 ? void 0 : menus[0] : null),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
192
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
193
|
+
activeTopMenu = _useState6[0],
|
|
194
|
+
setActiveTopMenu = _useState6[1];
|
|
195
|
+
|
|
99
196
|
var selectedMenuKey = actions.getSelectedMenuKey();
|
|
197
|
+
|
|
100
198
|
var calcGroupMenus = function calcGroupMenus(menus) {
|
|
101
199
|
menus = menus === null || menus === void 0 ? void 0 : menus.reduce(function (acc, cur) {
|
|
102
|
-
var _a;
|
|
103
|
-
|
|
200
|
+
var _a; // 分组
|
|
201
|
+
|
|
202
|
+
|
|
104
203
|
if ((_a = cur === null || cur === void 0 ? void 0 : cur.children) === null || _a === void 0 ? void 0 : _a.length) {
|
|
105
204
|
acc.push(cur);
|
|
106
205
|
} else {
|
|
@@ -108,6 +207,7 @@ var _default = function _default(_ref2) {
|
|
|
108
207
|
var isDefaultGroup = _ref3.isDefaultGroup;
|
|
109
208
|
return isDefaultGroup;
|
|
110
209
|
});
|
|
210
|
+
|
|
111
211
|
if (!defaultGroup) {
|
|
112
212
|
acc.unshift({
|
|
113
213
|
isDefaultGroup: true,
|
|
@@ -117,38 +217,49 @@ var _default = function _default(_ref2) {
|
|
|
117
217
|
defaultGroup.children.push(cur);
|
|
118
218
|
}
|
|
119
219
|
}
|
|
220
|
+
|
|
120
221
|
return acc;
|
|
121
222
|
}, []);
|
|
122
223
|
return menus === null || menus === void 0 ? void 0 : menus.reduce(function (acc, cur) {
|
|
123
224
|
var _a;
|
|
225
|
+
|
|
124
226
|
var column = Math.max(1, ~~((containerRef.current.clientWidth - 32) / 210));
|
|
227
|
+
|
|
125
228
|
if (!acc.length) {
|
|
126
229
|
acc.push([cur]);
|
|
127
230
|
} else {
|
|
128
231
|
var calcGroupHeight = function calcGroupHeight(group) {
|
|
129
232
|
var _a;
|
|
233
|
+
|
|
130
234
|
return 46 + (((_a = group === null || group === void 0 ? void 0 : group.children) === null || _a === void 0 ? void 0 : _a.length) || 0) * 30;
|
|
131
235
|
};
|
|
236
|
+
|
|
132
237
|
var calcColumnHeight = function calcColumnHeight(columnGroups) {
|
|
133
238
|
return columnGroups === null || columnGroups === void 0 ? void 0 : columnGroups.reduce(function (acc, cur) {
|
|
134
239
|
acc += calcGroupHeight(cur);
|
|
135
240
|
return acc;
|
|
136
241
|
}, 0);
|
|
137
242
|
};
|
|
243
|
+
|
|
138
244
|
var currentColumnHeight = calcColumnHeight(acc[acc.length - 1]);
|
|
139
245
|
var nextGroupHeight = calcGroupHeight(cur);
|
|
246
|
+
|
|
140
247
|
var findMinHeightGroup = function findMinHeightGroup(groups) {
|
|
141
248
|
var minHeight = Infinity;
|
|
142
249
|
var index = 0;
|
|
250
|
+
|
|
143
251
|
for (var i = 0; i < groups.length; i++) {
|
|
144
252
|
var height = calcColumnHeight(groups[i]);
|
|
253
|
+
|
|
145
254
|
if (height < minHeight) {
|
|
146
255
|
index = i;
|
|
147
256
|
minHeight = height;
|
|
148
257
|
}
|
|
149
258
|
}
|
|
259
|
+
|
|
150
260
|
return groups[index];
|
|
151
261
|
};
|
|
262
|
+
|
|
152
263
|
if (acc.length >= column) {
|
|
153
264
|
var minHeightGroup = findMinHeightGroup(acc);
|
|
154
265
|
minHeightGroup === null || minHeightGroup === void 0 ? void 0 : minHeightGroup.push(cur);
|
|
@@ -160,14 +271,18 @@ var _default = function _default(_ref2) {
|
|
|
160
271
|
}
|
|
161
272
|
}
|
|
162
273
|
}
|
|
274
|
+
|
|
163
275
|
return acc;
|
|
164
276
|
}, []);
|
|
165
277
|
};
|
|
278
|
+
|
|
166
279
|
var groupMenus = calcGroupMenus((activeTopMenu === null || activeTopMenu === void 0 ? void 0 : activeTopMenu.children) || menus);
|
|
280
|
+
|
|
167
281
|
var _useState7 = (0, _react.useState)([]),
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
282
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
283
|
+
searchedMenus = _useState8[0],
|
|
284
|
+
setSearchedMenus = _useState8[1];
|
|
285
|
+
|
|
171
286
|
var onMenuClick = function onMenuClick(menu) {
|
|
172
287
|
actions.emit('menuSelect', {
|
|
173
288
|
key: menu.code,
|
|
@@ -177,54 +292,67 @@ var _default = function _default(_ref2) {
|
|
|
177
292
|
setSearchedMenus([]);
|
|
178
293
|
close();
|
|
179
294
|
};
|
|
295
|
+
|
|
180
296
|
var debounceSearch = (0, _debounce2["default"])(function (evt) {
|
|
181
297
|
var _a;
|
|
298
|
+
|
|
182
299
|
var value = (_a = evt.target.value) === null || _a === void 0 ? void 0 : _a.trim();
|
|
183
300
|
var matchedMenus = [];
|
|
301
|
+
|
|
184
302
|
if (value) {
|
|
185
303
|
(0, _utils.traverseTree)(menus, function (node) {
|
|
186
304
|
var _a;
|
|
305
|
+
|
|
187
306
|
if (node.path && ((_a = node === null || node === void 0 ? void 0 : node.menuName) === null || _a === void 0 ? void 0 : _a.includes(value))) {
|
|
188
307
|
matchedMenus.push(node);
|
|
189
308
|
}
|
|
190
309
|
});
|
|
191
310
|
}
|
|
311
|
+
|
|
192
312
|
setSearchedMenus(matchedMenus);
|
|
193
313
|
}, 100);
|
|
314
|
+
|
|
194
315
|
var onSearchChange = function onSearchChange(evt) {
|
|
195
316
|
evt.persist();
|
|
196
317
|
setSearchValue(evt.target.value);
|
|
197
318
|
debounceSearch(evt);
|
|
198
319
|
};
|
|
320
|
+
|
|
199
321
|
var onSelectAppTab = function onSelectAppTab(menu) {
|
|
200
322
|
setActiveTopMenu(menu);
|
|
201
323
|
};
|
|
324
|
+
|
|
202
325
|
(0, _react.useEffect)(function () {
|
|
203
326
|
var clickOutside = function clickOutside(evt) {
|
|
204
327
|
var clientX = evt.clientX,
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
328
|
+
clientY = evt.clientY,
|
|
329
|
+
pageX = evt.pageX,
|
|
330
|
+
pageY = evt.pageY;
|
|
331
|
+
|
|
208
332
|
var isOutside = function isOutside(evt, popup) {
|
|
209
333
|
if (popup === null || popup === void 0 ? void 0 : popup.contains) {
|
|
210
334
|
return !(popup === null || popup === void 0 ? void 0 : popup.contains(evt.target));
|
|
211
335
|
}
|
|
336
|
+
|
|
212
337
|
var _popup$getBoundingCli = popup.getBoundingClientRect(),
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
338
|
+
x = _popup$getBoundingCli.x,
|
|
339
|
+
y = _popup$getBoundingCli.y,
|
|
340
|
+
height = _popup$getBoundingCli.height,
|
|
341
|
+
width = _popup$getBoundingCli.width;
|
|
342
|
+
|
|
217
343
|
console.log('clickOutside...', [x, y], [clientX, clientY], [pageX, pageY]);
|
|
218
344
|
x += window.scrollX;
|
|
219
345
|
y += window.scrollY;
|
|
220
346
|
return pageX < x || pageX > x + width || pageY < y || pageY > y + height;
|
|
221
347
|
};
|
|
348
|
+
|
|
222
349
|
if (isOutside(evt, popupRef.current)) {
|
|
223
350
|
setSearchValue('');
|
|
224
351
|
setSearchedMenus([]);
|
|
225
352
|
close();
|
|
226
353
|
}
|
|
227
354
|
};
|
|
355
|
+
|
|
228
356
|
document.addEventListener('click', clickOutside);
|
|
229
357
|
return function () {
|
|
230
358
|
return document.removeEventListener('click', clickOutside);
|
|
@@ -292,4 +420,5 @@ var _default = function _default(_ref2) {
|
|
|
292
420
|
}));
|
|
293
421
|
})));
|
|
294
422
|
};
|
|
423
|
+
|
|
295
424
|
exports["default"] = _default;
|