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,33 +1,86 @@
|
|
|
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 _get2 = _interopRequireDefault(require("lodash/get"));
|
|
11
|
+
|
|
9
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
10
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
|
|
11
16
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
17
|
+
|
|
12
18
|
var _popover = _interopRequireDefault(require("../popover"));
|
|
19
|
+
|
|
13
20
|
var _tntdIcon = _interopRequireDefault(require("../tntd-icon"));
|
|
21
|
+
|
|
14
22
|
var _images = _interopRequireDefault(require("./images"));
|
|
23
|
+
|
|
15
24
|
var _storage = require("./storage");
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
function
|
|
22
|
-
|
|
25
|
+
|
|
26
|
+
var _this = void 0;
|
|
27
|
+
|
|
28
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
23
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
24
|
-
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
function
|
|
28
|
-
|
|
33
|
+
|
|
34
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
35
|
+
|
|
36
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
37
|
+
|
|
38
|
+
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; }
|
|
39
|
+
|
|
29
40
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
|
+
|
|
42
|
+
function _templateObject4() {
|
|
43
|
+
var data = _taggedTemplateLiteral(["\n z-index: 1;\n background-color: #fff;\n border-radius: 4px;\n min-width: 203px;\n padding: 8px 4px 8px 8px;\n .line {\n background: #f0f0f0;\n height: 1px;\n margin: 20px 0;\n width: calc(100% + 44px);\n transform: translateX(-22px);\n }\n"]);
|
|
44
|
+
|
|
45
|
+
_templateObject4 = function _templateObject4() {
|
|
46
|
+
return data;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return data;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function _templateObject3() {
|
|
53
|
+
var data = _taggedTemplateLiteral(["\n margin-bottom: 20px;\n & > div {\n position: relative;\n display: inline-block;\n cursor: pointer;\n img {\n width: 48px;\n }\n &:first-child {\n margin-right: 10px;\n }\n &:last-child {\n margin-left: 10px;\n }\n & > i,\n & > .tnt-icon,\n & > .anticon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n color: #1890ff;\n }\n }\n"]);
|
|
54
|
+
|
|
55
|
+
_templateObject3 = function _templateObject3() {
|
|
56
|
+
return data;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
return data;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function _templateObject2() {
|
|
63
|
+
var data = _taggedTemplateLiteral(["\n margin-left: 20px;\n font-size: 20px;\n .tnt-themeS1 & {\n color: rgba(255, 255, 255, 0.85);\n }\n .isInIframe & {\n display: none;\n }\n .tnt-icon {\n font-size: 30px;\n vertical-align: middle;\n opacity: 0.75;\n color: #2b5696;\n .tnt-themeS1 & {\n /* color: #fff; */\n }\n }\n"]);
|
|
64
|
+
|
|
65
|
+
_templateObject2 = function _templateObject2() {
|
|
66
|
+
return data;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return data;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function _templateObject() {
|
|
73
|
+
var data = _taggedTemplateLiteral(["\n margin-bottom: 10px;\n\n & > div {\n padding: 10px 13px 10px 17px;\n border-radius: 20px 0 0 20px;\n border-right: none;\n display: inline-block;\n color: #fff;\n width: 49%;\n text-align: center;\n font-size: 14px;\n letter-spacing: 0 !important;\n color: #666;\n border: 1px solid #e5e5e5;\n vertical-align: middle;\n display: inline-block;\n letter-spacing: -4px;\n cursor: pointer;\n &:first-child {\n padding: 10px 13px 10px 17px;\n border-radius: 20px 0 0 20px;\n border-right: none;\n }\n &:last-child {\n padding: 10px 17px 10px 13px;\n border-radius: 0 20px 20px 0;\n border-left: none;\n }\n &.active {\n background-color: #4b93e5;\n border-color: #4b93e5;\n color: #fff;\n }\n }\n"]);
|
|
74
|
+
|
|
75
|
+
_templateObject = function _templateObject() {
|
|
76
|
+
return data;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
return data;
|
|
80
|
+
}
|
|
81
|
+
|
|
30
82
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
83
|
+
|
|
31
84
|
var languages = [{
|
|
32
85
|
value: 'cn',
|
|
33
86
|
name: '中文'
|
|
@@ -39,10 +92,15 @@ var languagesMap = languages.reduce(function (acc, cur) {
|
|
|
39
92
|
acc[cur.value] = cur;
|
|
40
93
|
return acc;
|
|
41
94
|
}, {});
|
|
42
|
-
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
var
|
|
95
|
+
|
|
96
|
+
var LanguageSwitch = _styledComponents["default"].div(_templateObject());
|
|
97
|
+
|
|
98
|
+
var Theme = _styledComponents["default"].li(_templateObject2());
|
|
99
|
+
|
|
100
|
+
var ThemeSwitch = _styledComponents["default"].div(_templateObject3());
|
|
101
|
+
|
|
102
|
+
var ThemeContentWrapper = _styledComponents["default"].div(_templateObject4());
|
|
103
|
+
|
|
46
104
|
var themes = [{
|
|
47
105
|
value: 'themeS1',
|
|
48
106
|
img: _images["default"].themeSymbol1
|
|
@@ -50,15 +108,18 @@ var themes = [{
|
|
|
50
108
|
value: 'themeS2',
|
|
51
109
|
img: _images["default"].themeSymbol2
|
|
52
110
|
}];
|
|
111
|
+
|
|
53
112
|
var ThemeContent = function ThemeContent(props) {
|
|
54
113
|
var config = props.config,
|
|
55
|
-
|
|
56
|
-
|
|
114
|
+
onLanguageChange = props.onLanguageChange,
|
|
115
|
+
onThemeChange = props.onThemeChange;
|
|
116
|
+
|
|
57
117
|
var _ref = config || {},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
118
|
+
_ref$language = _ref.language,
|
|
119
|
+
languageVisible = _ref$language === void 0 ? true : _ref$language,
|
|
120
|
+
_ref$theme = _ref.theme,
|
|
121
|
+
themeVisible = _ref$theme === void 0 ? true : _ref$theme;
|
|
122
|
+
|
|
62
123
|
var getTheme = function getTheme() {
|
|
63
124
|
var theme = (0, _storage.getThemeStore)() || props.theme || 'themeS2';
|
|
64
125
|
return themes.some(function (_ref2) {
|
|
@@ -66,35 +127,43 @@ var ThemeContent = function ThemeContent(props) {
|
|
|
66
127
|
return value === theme;
|
|
67
128
|
}) ? theme : 'themeS2';
|
|
68
129
|
};
|
|
130
|
+
|
|
69
131
|
var _useState = (0, _react.useState)(getTheme()),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
132
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
133
|
+
theme = _useState2[0],
|
|
134
|
+
setTheme = _useState2[1];
|
|
135
|
+
|
|
73
136
|
var changeTheme = function changeTheme(theme) {
|
|
74
137
|
setTheme(theme);
|
|
75
138
|
(0, _storage.setThemeStore)(theme);
|
|
76
139
|
onThemeChange(theme);
|
|
77
140
|
};
|
|
141
|
+
|
|
78
142
|
var getLanguage = function getLanguage() {
|
|
79
143
|
var lang = (0, _storage.getLanguageStore)() || props.language;
|
|
144
|
+
|
|
80
145
|
if (!languagesMap[lang]) {
|
|
81
146
|
lang = (0, _get2["default"])(languages, '0.value');
|
|
82
147
|
}
|
|
148
|
+
|
|
83
149
|
return lang;
|
|
84
150
|
};
|
|
151
|
+
|
|
85
152
|
var _useState3 = (0, _react.useState)(getLanguage()),
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
153
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
154
|
+
_useState4$ = _useState4[0],
|
|
155
|
+
language = _useState4$ === void 0 ? 'cn' : _useState4$,
|
|
156
|
+
setLanguage = _useState4[1];
|
|
157
|
+
|
|
90
158
|
var changeLanguage = function changeLanguage(language) {
|
|
91
159
|
setLanguage(language);
|
|
92
160
|
(0, _storage.setLanguageStore)(language);
|
|
93
161
|
onLanguageChange(language);
|
|
94
162
|
};
|
|
163
|
+
|
|
95
164
|
return _react["default"].createElement(ThemeContentWrapper, null, themeVisible && _react["default"].createElement(ThemeSwitch, null, themes.map(function (_ref3) {
|
|
96
165
|
var value = _ref3.value,
|
|
97
|
-
|
|
166
|
+
img = _ref3.img;
|
|
98
167
|
return _react["default"].createElement("div", {
|
|
99
168
|
key: value,
|
|
100
169
|
onClick: changeTheme.bind(_this, value)
|
|
@@ -107,7 +176,7 @@ var ThemeContent = function ThemeContent(props) {
|
|
|
107
176
|
className: "line"
|
|
108
177
|
}), languageVisible && _react["default"].createElement(LanguageSwitch, null, languages.map(function (_ref4) {
|
|
109
178
|
var value = _ref4.value,
|
|
110
|
-
|
|
179
|
+
name = _ref4.name;
|
|
111
180
|
return _react["default"].createElement("div", {
|
|
112
181
|
className: (0, _classnames["default"])({
|
|
113
182
|
active: value === language
|
|
@@ -117,11 +186,14 @@ var ThemeContent = function ThemeContent(props) {
|
|
|
117
186
|
}, name);
|
|
118
187
|
})));
|
|
119
188
|
};
|
|
189
|
+
|
|
120
190
|
var _default = function _default(props) {
|
|
121
191
|
var config = props.config;
|
|
192
|
+
|
|
122
193
|
if ((config === null || config === void 0 ? void 0 : config.language) === false && (config === null || config === void 0 ? void 0 : config.theme) === false) {
|
|
123
194
|
return null;
|
|
124
195
|
}
|
|
196
|
+
|
|
125
197
|
return _react["default"].createElement(Theme, null, _react["default"].createElement(_popover["default"], {
|
|
126
198
|
placement: "bottomRight",
|
|
127
199
|
title: null,
|
|
@@ -131,4 +203,5 @@ var _default = function _default(props) {
|
|
|
131
203
|
type: "daxiaoxie"
|
|
132
204
|
})));
|
|
133
205
|
};
|
|
206
|
+
|
|
134
207
|
exports["default"] = _default;
|
|
@@ -1,29 +1,77 @@
|
|
|
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 _get2 = _interopRequireDefault(require("lodash/get"));
|
|
11
|
+
|
|
9
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
|
|
10
14
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
15
|
+
|
|
11
16
|
var _images = _interopRequireDefault(require("../images"));
|
|
17
|
+
|
|
12
18
|
var _ActionsContext = _interopRequireDefault(require("../ActionsContext"));
|
|
19
|
+
|
|
13
20
|
var _Language = _interopRequireDefault(require("./Language"));
|
|
21
|
+
|
|
14
22
|
var _Theme = _interopRequireDefault(require("./Theme"));
|
|
23
|
+
|
|
15
24
|
var _storage = require("../storage");
|
|
25
|
+
|
|
16
26
|
var _divider = _interopRequireDefault(require("../../divider"));
|
|
27
|
+
|
|
17
28
|
var _popover = _interopRequireDefault(require("../../popover"));
|
|
29
|
+
|
|
18
30
|
var _row = _interopRequireDefault(require("../../row"));
|
|
19
|
-
|
|
20
|
-
function _getRequireWildcardCache(
|
|
21
|
-
|
|
31
|
+
|
|
32
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
|
|
22
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
37
|
+
|
|
38
|
+
function _templateObject3() {
|
|
39
|
+
var data = _taggedTemplateLiteral(["\n width: 330px;\n z-index: 1;\n background-color: #fff;\n border-radius: 4px;\n box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.1);\n .isInIframe & {\n display: none;\n }\n\n .user-info-body {\n padding: 20px 15px;\n line-height: 16px;\n list-style: none;\n margin: 0;\n .user-info-body-username {\n margin-top: 0px;\n font-family: PingFangSC-Regular;\n font-weight: normal;\n font-size: 14px;\n color: ", ";\n line-height: 14px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .user-info-body-account {\n margin-top: 0px;\n font-family: PingFangSC-Regular;\n font-size: 12px;\n color: #8b919e;\n margin-bottom: 14px;\n line-height: 14px;\n margin-left: 10px;\n }\n }\n .user-info-footer {\n border-top: ", ";\n background-color: #fff;\n height: 36px;\n line-height: 36px;\n padding: 0 15px;\n font-size: 12px;\n color: ", ";\n a {\n flex: 1;\n text-align: center;\n color: ", ";\n }\n }\n"]);
|
|
40
|
+
|
|
41
|
+
_templateObject3 = function _templateObject3() {
|
|
42
|
+
return data;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return data;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function _templateObject2() {
|
|
49
|
+
var data = _taggedTemplateLiteral(["\n .tnt-layout-personal-popover {\n .ant-popover-inner-content {\n padding: 0;\n }\n }\n"]);
|
|
50
|
+
|
|
51
|
+
_templateObject2 = function _templateObject2() {
|
|
52
|
+
return data;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return data;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function _templateObject() {
|
|
59
|
+
var data = _taggedTemplateLiteral(["\n margin-right: 0;\n font-size: 0;\n img {\n width: 26px;\n height: 26px;\n border-radius: 50%;\n cursor: pointer;\n .large-size & {\n width: 32px;\n height: 32px;\n }\n }\n"]);
|
|
60
|
+
|
|
61
|
+
_templateObject = function _templateObject() {
|
|
62
|
+
return data;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return data;
|
|
66
|
+
}
|
|
67
|
+
|
|
23
68
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
|
|
69
|
+
|
|
70
|
+
var Avatar = _styledComponents["default"].li(_templateObject());
|
|
71
|
+
|
|
72
|
+
var GlobalStyle = (0, _styledComponents.createGlobalStyle)(_templateObject2());
|
|
73
|
+
|
|
74
|
+
var UserInfoWrapper = _styledComponents["default"].div(_templateObject3(), function (props) {
|
|
27
75
|
return "".concat(props.theme.primaryTextColor);
|
|
28
76
|
}, function (props) {
|
|
29
77
|
return "1px solid ".concat(props.theme.dividerColor);
|
|
@@ -32,26 +80,30 @@ var UserInfoWrapper = _styledComponents["default"].div(_templateObject3 || (_tem
|
|
|
32
80
|
}, function (props) {
|
|
33
81
|
return "".concat(props.theme.primaryColor);
|
|
34
82
|
});
|
|
83
|
+
|
|
35
84
|
var UserInfoContent = function UserInfoContent(props) {
|
|
36
85
|
var userInfo = props.userInfo,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
86
|
+
_props$config = props.config,
|
|
87
|
+
config = _props$config === void 0 ? {} : _props$config,
|
|
88
|
+
onLogout = props.onLogout,
|
|
89
|
+
_props$onChangePasswo = props.onChangePassword,
|
|
90
|
+
onChangePassword = _props$onChangePasswo === void 0 ? function () {
|
|
91
|
+
return true;
|
|
92
|
+
} : _props$onChangePasswo,
|
|
93
|
+
_props$onPersonalSett = props.onPersonalSetting,
|
|
94
|
+
onPersonalSetting = _props$onPersonalSett === void 0 ? function () {
|
|
95
|
+
return true;
|
|
96
|
+
} : _props$onPersonalSett,
|
|
97
|
+
onLanguageChange = props.onLanguageChange,
|
|
98
|
+
onThemeChange = props.onThemeChange;
|
|
99
|
+
|
|
50
100
|
var _useContext = (0, _react.useContext)(_ActionsContext["default"]),
|
|
51
|
-
|
|
101
|
+
getText = _useContext.getText;
|
|
102
|
+
|
|
52
103
|
var _ref = config || {},
|
|
53
|
-
|
|
54
|
-
|
|
104
|
+
_ref$language = _ref.language,
|
|
105
|
+
language = _ref$language === void 0 ? true : _ref$language;
|
|
106
|
+
|
|
55
107
|
return _react["default"].createElement(UserInfoWrapper, {
|
|
56
108
|
className: "user-info-setting-wrap"
|
|
57
109
|
}, _react["default"].createElement("ul", {
|
|
@@ -97,10 +149,12 @@ var UserInfoContent = function UserInfoContent(props) {
|
|
|
97
149
|
}
|
|
98
150
|
}, getText('signOut'))));
|
|
99
151
|
};
|
|
152
|
+
|
|
100
153
|
var _default = function _default(props) {
|
|
101
154
|
var _a;
|
|
155
|
+
|
|
102
156
|
var _props$userInfo = props.userInfo,
|
|
103
|
-
|
|
157
|
+
userInfo = _props$userInfo === void 0 ? {} : _props$userInfo;
|
|
104
158
|
var avatar = userInfo.avatar;
|
|
105
159
|
return _react["default"].createElement(Avatar, null, _react["default"].createElement(_popover["default"], {
|
|
106
160
|
popupClassName: "tnt-layout-personal-popover",
|
|
@@ -112,6 +166,7 @@ var _default = function _default(props) {
|
|
|
112
166
|
src: avatar.indexOf('base64') > 0 ? avatar : (0, _get2["default"])(_images["default"][avatar], 'default', _images["default"][avatar]),
|
|
113
167
|
onError: function onError(e) {
|
|
114
168
|
var _a;
|
|
169
|
+
|
|
115
170
|
e.target.onerror = null;
|
|
116
171
|
e.target.src = ((_a = _images["default"].empty) === null || _a === void 0 ? void 0 : _a["default"]) || _images["default"].empty;
|
|
117
172
|
}
|
|
@@ -119,4 +174,5 @@ var _default = function _default(props) {
|
|
|
119
174
|
src: ((_a = _images["default"].empty) === null || _a === void 0 ? void 0 : _a["default"]) || _images["default"].empty
|
|
120
175
|
})), _react["default"].createElement(GlobalStyle, null));
|
|
121
176
|
};
|
|
177
|
+
|
|
122
178
|
exports["default"] = _default;
|
|
@@ -1,26 +1,48 @@
|
|
|
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 _get2 = _interopRequireDefault(require("lodash/get"));
|
|
11
|
+
|
|
9
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
|
|
10
14
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
15
|
+
|
|
11
16
|
var _Iconfont = _interopRequireDefault(require("../Iconfont"));
|
|
17
|
+
|
|
12
18
|
var _storage = require("../storage");
|
|
13
|
-
|
|
14
|
-
function _getRequireWildcardCache(
|
|
15
|
-
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
16
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
25
|
+
|
|
26
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
27
|
+
|
|
28
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
22
32
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
|
+
|
|
34
|
+
function _templateObject() {
|
|
35
|
+
var data = _taggedTemplateLiteral(["\n display: inline-block;\n padding: 0 10px;\n height: 32px;\n line-height: 32px;\n text-align: center;\n background: #ffffff;\n border: 1px solid #e1e6ee;\n border-radius: 2px;\n font-family: PingFangSC-Regular;\n color: #17233d;\n font-size: ", ";\n cursor: pointer;\n margin-top: 8px;\n\n .tnt-icon {\n font-size: ", ";\n margin-right: 4px;\n }\n\n span {\n position: relative;\n font-size: ", ";\n top: ", ";\n font-family: auto;\n }\n\n .isInIframe & {\n display: none;\n }\n"]);
|
|
36
|
+
|
|
37
|
+
_templateObject = function _templateObject() {
|
|
38
|
+
return data;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return data;
|
|
42
|
+
}
|
|
43
|
+
|
|
23
44
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
45
|
+
|
|
24
46
|
var languages = [{
|
|
25
47
|
value: 'cn',
|
|
26
48
|
name: '中文'
|
|
@@ -32,7 +54,8 @@ var languagesMap = languages.reduce(function (acc, cur) {
|
|
|
32
54
|
acc[cur.value] = cur;
|
|
33
55
|
return acc;
|
|
34
56
|
}, {});
|
|
35
|
-
|
|
57
|
+
|
|
58
|
+
var Language = _styledComponents["default"].li(_templateObject(), function (_ref) {
|
|
36
59
|
var size = _ref.theme.size;
|
|
37
60
|
return size === 'large' ? '14px' : '12px';
|
|
38
61
|
}, function (_ref2) {
|
|
@@ -45,26 +68,33 @@ var Language = _styledComponents["default"].li(_templateObject || (_templateObje
|
|
|
45
68
|
var size = _ref4.theme.size;
|
|
46
69
|
return size === 'large' ? '-3px' : '-2px';
|
|
47
70
|
});
|
|
71
|
+
|
|
48
72
|
var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
49
73
|
var onChange = props.onChange;
|
|
74
|
+
|
|
50
75
|
var getLanguage = function getLanguage() {
|
|
51
76
|
var lang = (0, _storage.getLanguageStore)() || props.language;
|
|
77
|
+
|
|
52
78
|
if (!languagesMap[lang]) {
|
|
53
79
|
lang = (0, _get2["default"])(languages, '0.value');
|
|
54
80
|
}
|
|
81
|
+
|
|
55
82
|
return lang;
|
|
56
83
|
};
|
|
84
|
+
|
|
57
85
|
var _useState = (0, _react.useState)(getLanguage()),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
86
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
87
|
+
_useState2$ = _useState2[0],
|
|
88
|
+
language = _useState2$ === void 0 ? 'cn' : _useState2$,
|
|
89
|
+
setLanguage = _useState2[1];
|
|
90
|
+
|
|
62
91
|
var switchLanguage = function switchLanguage() {
|
|
63
92
|
var lang = language !== 'en' ? 'en' : 'cn';
|
|
64
93
|
setLanguage(lang);
|
|
65
94
|
(0, _storage.setLanguageStore)(lang);
|
|
66
95
|
onChange && onChange(lang);
|
|
67
96
|
};
|
|
97
|
+
|
|
68
98
|
var otherLanguage = (0, _react.useMemo)(function () {
|
|
69
99
|
return language === 'cn' ? 'en' : 'cn';
|
|
70
100
|
}, [language]);
|
|
@@ -74,4 +104,5 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
74
104
|
type: "flag-".concat(otherLanguage)
|
|
75
105
|
}), _react["default"].createElement("span", null, (0, _get2["default"])(languagesMap[otherLanguage], 'name')));
|
|
76
106
|
});
|
|
107
|
+
|
|
77
108
|
exports["default"] = _default;
|