Commit 55e9d9fc2953643cec95c74b6ed34b0e68641fb6

Authored by Vben
1 parent 84d9300e

perf: optimize components and add comments

Showing 40 changed files with 533 additions and 527 deletions
package.json
@@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
35 "@iconify/iconify": "^2.0.1", 35 "@iconify/iconify": "^2.0.1",
36 "@logicflow/core": "^0.4.11", 36 "@logicflow/core": "^0.4.11",
37 "@logicflow/extension": "^0.4.12", 37 "@logicflow/extension": "^0.4.12",
38 - "@vueuse/core": "^4.11.2", 38 + "@vueuse/core": "^5.0.1",
39 "@zxcvbn-ts/core": "^0.3.0", 39 "@zxcvbn-ts/core": "^0.3.0",
40 "ant-design-vue": "2.1.2", 40 "ant-design-vue": "2.1.2",
41 "axios": "^0.21.1", 41 "axios": "^0.21.1",
@@ -63,7 +63,7 @@ @@ -63,7 +63,7 @@
63 "devDependencies": { 63 "devDependencies": {
64 "@commitlint/cli": "^12.1.4", 64 "@commitlint/cli": "^12.1.4",
65 "@commitlint/config-conventional": "^12.1.4", 65 "@commitlint/config-conventional": "^12.1.4",
66 - "@iconify/json": "^1.1.353", 66 + "@iconify/json": "^1.1.354",
67 "@purge-icons/generated": "^0.7.0", 67 "@purge-icons/generated": "^0.7.0",
68 "@types/codemirror": "^5.60.0", 68 "@types/codemirror": "^5.60.0",
69 "@types/crypto-js": "^4.0.1", 69 "@types/crypto-js": "^4.0.1",
@@ -71,13 +71,13 @@ @@ -71,13 +71,13 @@
71 "@types/inquirer": "^7.3.1", 71 "@types/inquirer": "^7.3.1",
72 "@types/lodash-es": "^4.17.4", 72 "@types/lodash-es": "^4.17.4",
73 "@types/mockjs": "^1.0.3", 73 "@types/mockjs": "^1.0.3",
74 - "@types/node": "^15.12.1", 74 + "@types/node": "^15.12.2",
75 "@types/nprogress": "^0.2.0", 75 "@types/nprogress": "^0.2.0",
76 "@types/qrcode": "^1.4.0", 76 "@types/qrcode": "^1.4.0",
77 "@types/qs": "^6.9.6", 77 "@types/qs": "^6.9.6",
78 "@types/sortablejs": "^1.10.6", 78 "@types/sortablejs": "^1.10.6",
79 - "@typescript-eslint/eslint-plugin": "^4.26.0",  
80 - "@typescript-eslint/parser": "^4.26.0", 79 + "@typescript-eslint/eslint-plugin": "^4.26.1",
  80 + "@typescript-eslint/parser": "^4.26.1",
81 "@vitejs/plugin-legacy": "^1.4.1", 81 "@vitejs/plugin-legacy": "^1.4.1",
82 "@vitejs/plugin-vue": "^1.2.3", 82 "@vitejs/plugin-vue": "^1.2.3",
83 "@vitejs/plugin-vue-jsx": "^1.1.5", 83 "@vitejs/plugin-vue-jsx": "^1.1.5",
@@ -92,7 +92,7 @@ @@ -92,7 +92,7 @@
92 "eslint-define-config": "^1.0.8", 92 "eslint-define-config": "^1.0.8",
93 "eslint-plugin-prettier": "^3.4.0", 93 "eslint-plugin-prettier": "^3.4.0",
94 "eslint-plugin-vue": "^7.10.0", 94 "eslint-plugin-vue": "^7.10.0",
95 - "esno": "^0.7.0", 95 + "esno": "^0.7.1",
96 "fs-extra": "^10.0.0", 96 "fs-extra": "^10.0.0",
97 "http-server": "^0.12.3", 97 "http-server": "^0.12.3",
98 "husky": "^6.0.0", 98 "husky": "^6.0.0",
@@ -121,14 +121,14 @@ @@ -121,14 +121,14 @@
121 "vite-plugin-style-import": "^0.10.1", 121 "vite-plugin-style-import": "^0.10.1",
122 "vite-plugin-svg-icons": "^0.7.0", 122 "vite-plugin-svg-icons": "^0.7.0",
123 "vite-plugin-theme": "^0.8.1", 123 "vite-plugin-theme": "^0.8.1",
124 - "vite-plugin-windicss": "^1.0.1", 124 + "vite-plugin-windicss": "^1.0.2",
125 "vue-eslint-parser": "^7.6.0", 125 "vue-eslint-parser": "^7.6.0",
126 "vue-tsc": "^0.1.7" 126 "vue-tsc": "^0.1.7"
127 }, 127 },
128 "resolutions": { 128 "resolutions": {
129 "//": "Used to install imagemin dependencies, because imagemin may not be installed in China. If it is abroad, you can delete it", 129 "//": "Used to install imagemin dependencies, because imagemin may not be installed in China. If it is abroad, you can delete it",
130 "bin-wrapper": "npm:bin-wrapper-china", 130 "bin-wrapper": "npm:bin-wrapper-china",
131 - "rollup": "^2.51.0" 131 + "rollup": "^2.51.1"
132 }, 132 },
133 "repository": { 133 "repository": {
134 "type": "git", 134 "type": "git",
src/components/Application/index.ts
1 -import AppLogo from './src/AppLogo.vue';  
2 -import AppProvider from './src/AppProvider.vue';  
3 -import AppSearch from './src/search/AppSearch.vue';  
4 -import AppLocalePicker from './src/AppLocalePicker.vue';  
5 -import AppDarkModeToggle from './src/AppDarkModeToggle.vue'; 1 +import { withInstall } from '/@/utils';
  2 +
  3 +import appLogo from './src/AppLogo.vue';
  4 +import appProvider from './src/AppProvider.vue';
  5 +import appSearch from './src/search/AppSearch.vue';
  6 +import appLocalePicker from './src/AppLocalePicker.vue';
  7 +import appDarkModeToggle from './src/AppDarkModeToggle.vue';
6 8
7 export { useAppProviderContext } from './src/useAppContext'; 9 export { useAppProviderContext } from './src/useAppContext';
8 -export { AppLogo, AppProvider, AppSearch, AppLocalePicker, AppDarkModeToggle }; 10 +
  11 +export const AppLogo = withInstall(appLogo);
  12 +export const AppProvider = withInstall(appProvider);
  13 +export const AppSearch = withInstall(appSearch);
  14 +export const AppLocalePicker = withInstall(appLocalePicker);
  15 +export const AppDarkModeToggle = withInstall(appDarkModeToggle);
src/components/Application/src/AppDarkModeToggle.vue
1 <template> 1 <template>
2 - <div  
3 - v-if="getShowDarkModeToggle"  
4 - :class="[  
5 - prefixCls,  
6 - {  
7 - [`${prefixCls}--dark`]: isDark,  
8 - },  
9 - ]"  
10 - @click="toggleDarkMode"  
11 - > 2 + <div v-if="getShowDarkModeToggle" :class="getClass" @click="toggleDarkMode">
12 <div :class="`${prefixCls}-inner`"> </div> 3 <div :class="`${prefixCls}-inner`"> </div>
13 <SvgIcon size="14" name="sun" /> 4 <SvgIcon size="14" name="sun" />
14 <SvgIcon size="14" name="moon" /> 5 <SvgIcon size="14" name="moon" />
@@ -16,25 +7,29 @@ @@ -16,25 +7,29 @@
16 </template> 7 </template>
17 <script lang="ts"> 8 <script lang="ts">
18 import { defineComponent, computed } from 'vue'; 9 import { defineComponent, computed } from 'vue';
19 -  
20 - import { useDesign } from '/@/hooks/web/useDesign';  
21 -  
22 import { SvgIcon } from '/@/components/Icon'; 10 import { SvgIcon } from '/@/components/Icon';
  11 + import { useDesign } from '/@/hooks/web/useDesign';
23 import { useRootSetting } from '/@/hooks/setting/useRootSetting'; 12 import { useRootSetting } from '/@/hooks/setting/useRootSetting';
24 import { updateHeaderBgColor, updateSidebarBgColor } from '/@/logics/theme/updateBackground'; 13 import { updateHeaderBgColor, updateSidebarBgColor } from '/@/logics/theme/updateBackground';
25 import { updateDarkTheme } from '/@/logics/theme/dark'; 14 import { updateDarkTheme } from '/@/logics/theme/dark';
26 -  
27 import { ThemeEnum } from '/@/enums/appEnum'; 15 import { ThemeEnum } from '/@/enums/appEnum';
28 16
29 export default defineComponent({ 17 export default defineComponent({
30 name: 'DarkModeToggle', 18 name: 'DarkModeToggle',
31 components: { SvgIcon }, 19 components: { SvgIcon },
32 setup() { 20 setup() {
33 - const { prefixCls } = useDesign('dark-mode-toggle'); 21 + const { prefixCls } = useDesign('dark-switch');
34 const { getDarkMode, setDarkMode, getShowDarkModeToggle } = useRootSetting(); 22 const { getDarkMode, setDarkMode, getShowDarkModeToggle } = useRootSetting();
35 23
36 const isDark = computed(() => getDarkMode.value === ThemeEnum.DARK); 24 const isDark = computed(() => getDarkMode.value === ThemeEnum.DARK);
37 25
  26 + const getClass = computed(() => [
  27 + prefixCls,
  28 + {
  29 + [`${prefixCls}--dark`]: isDark,
  30 + },
  31 + ]);
  32 +
38 function toggleDarkMode() { 33 function toggleDarkMode() {
39 const darkMode = getDarkMode.value === ThemeEnum.DARK ? ThemeEnum.LIGHT : ThemeEnum.DARK; 34 const darkMode = getDarkMode.value === ThemeEnum.DARK ? ThemeEnum.LIGHT : ThemeEnum.DARK;
40 setDarkMode(darkMode); 35 setDarkMode(darkMode);
@@ -44,6 +39,7 @@ @@ -44,6 +39,7 @@
44 } 39 }
45 40
46 return { 41 return {
  42 + getClass,
47 isDark, 43 isDark,
48 prefixCls, 44 prefixCls,
49 toggleDarkMode, 45 toggleDarkMode,
@@ -53,7 +49,7 @@ @@ -53,7 +49,7 @@
53 }); 49 });
54 </script> 50 </script>
55 <style lang="less" scoped> 51 <style lang="less" scoped>
56 - @prefix-cls: ~'@{namespace}-dark-mode-toggle'; 52 + @prefix-cls: ~'@{namespace}-dark-switch';
57 53
58 html[data-theme='dark'] { 54 html[data-theme='dark'] {
59 .@{prefix-cls} { 55 .@{prefix-cls} {
src/components/Application/src/AppLocalePicker.vue
@@ -13,39 +13,44 @@ @@ -13,39 +13,44 @@
13 > 13 >
14 <span class="cursor-pointer flex items-center"> 14 <span class="cursor-pointer flex items-center">
15 <Icon icon="ion:language" /> 15 <Icon icon="ion:language" />
16 - <span v-if="showText" class="ml-1">{{ getLangText }}</span> 16 + <span v-if="showText" class="ml-1">{{ getLocaleText }}</span>
17 </span> 17 </span>
18 </Dropdown> 18 </Dropdown>
19 </template> 19 </template>
20 <script lang="ts"> 20 <script lang="ts">
21 import type { LocaleType } from '/#/config'; 21 import type { LocaleType } from '/#/config';
22 import type { DropMenu } from '/@/components/Dropdown'; 22 import type { DropMenu } from '/@/components/Dropdown';
23 -  
24 import { defineComponent, ref, watchEffect, unref, computed } from 'vue'; 23 import { defineComponent, ref, watchEffect, unref, computed } from 'vue';
25 import { Dropdown } from '/@/components/Dropdown'; 24 import { Dropdown } from '/@/components/Dropdown';
26 - import Icon from '/@/components/Icon';  
27 - 25 + import { Icon } from '/@/components/Icon';
28 import { useLocale } from '/@/locales/useLocale'; 26 import { useLocale } from '/@/locales/useLocale';
29 import { localeList } from '/@/settings/localeSetting'; 27 import { localeList } from '/@/settings/localeSetting';
30 - import { propTypes } from '/@/utils/propTypes'; 28 +
  29 + const props = {
  30 + /**
  31 + * Whether to display text
  32 + */
  33 + showText: { type: Boolean, default: true },
  34 + /**
  35 + * Whether to refresh the interface when changing
  36 + */
  37 + reload: { type: Boolean },
  38 + };
31 39
32 export default defineComponent({ 40 export default defineComponent({
33 name: 'AppLocalPicker', 41 name: 'AppLocalPicker',
34 components: { Dropdown, Icon }, 42 components: { Dropdown, Icon },
35 - props: {  
36 - // Whether to display text  
37 - showText: propTypes.bool.def(true),  
38 - // Whether to refresh the interface when changing  
39 - reload: propTypes.bool,  
40 - }, 43 + props,
41 setup(props) { 44 setup(props) {
42 const selectedKeys = ref<string[]>([]); 45 const selectedKeys = ref<string[]>([]);
43 46
44 const { changeLocale, getLocale } = useLocale(); 47 const { changeLocale, getLocale } = useLocale();
45 48
46 - const getLangText = computed(() => { 49 + const getLocaleText = computed(() => {
47 const key = selectedKeys.value[0]; 50 const key = selectedKeys.value[0];
48 - if (!key) return ''; 51 + if (!key) {
  52 + return '';
  53 + }
49 return localeList.find((item) => item.event === key)?.text; 54 return localeList.find((item) => item.event === key)?.text;
50 }); 55 });
51 56
@@ -60,11 +65,13 @@ @@ -60,11 +65,13 @@
60 } 65 }
61 66
62 function handleMenuEvent(menu: DropMenu) { 67 function handleMenuEvent(menu: DropMenu) {
63 - if (unref(getLocale) === menu.event) return; 68 + if (unref(getLocale) === menu.event) {
  69 + return;
  70 + }
64 toggleLocale(menu.event as string); 71 toggleLocale(menu.event as string);
65 } 72 }
66 73
67 - return { localeList, handleMenuEvent, selectedKeys, getLangText }; 74 + return { localeList, handleMenuEvent, selectedKeys, getLocaleText };
68 }, 75 },
69 }); 76 });
70 </script> 77 </script>
src/components/Application/src/AppLogo.vue
@@ -3,63 +3,69 @@ @@ -3,63 +3,69 @@
3 * @Description: logo component 3 * @Description: logo component
4 --> 4 -->
5 <template> 5 <template>
6 - <div  
7 - class="anticon"  
8 - :class="[prefixCls, theme, { 'collapsed-show-title': getCollapsedShowTitle }]"  
9 - @click="handleGoHome"  
10 - > 6 + <div class="anticon" :class="getAppLogoClass" @click="goHome">
11 <img src="../../../assets/images/logo.png" /> 7 <img src="../../../assets/images/logo.png" />
12 - <div  
13 - class="ml-2 truncate md:opacity-100"  
14 - :class="[  
15 - `${prefixCls}__title`,  
16 - {  
17 - 'xs:opacity-0': !alwaysShowTitle,  
18 - },  
19 - ]"  
20 - v-show="showTitle"  
21 - > 8 + <div class="ml-2 truncate md:opacity-100" :class="getTitleClass" v-show="showTitle">
22 {{ title }} 9 {{ title }}
23 </div> 10 </div>
24 </div> 11 </div>
25 </template> 12 </template>
26 <script lang="ts"> 13 <script lang="ts">
27 - import { defineComponent } from 'vue';  
28 - 14 + import { defineComponent, computed, unref } from 'vue';
29 import { useGlobSetting } from '/@/hooks/setting'; 15 import { useGlobSetting } from '/@/hooks/setting';
30 import { useGo } from '/@/hooks/web/usePage'; 16 import { useGo } from '/@/hooks/web/usePage';
31 import { useMenuSetting } from '/@/hooks/setting/useMenuSetting'; 17 import { useMenuSetting } from '/@/hooks/setting/useMenuSetting';
32 import { useDesign } from '/@/hooks/web/useDesign'; 18 import { useDesign } from '/@/hooks/web/useDesign';
33 -  
34 import { PageEnum } from '/@/enums/pageEnum'; 19 import { PageEnum } from '/@/enums/pageEnum';
35 - import { propTypes } from '/@/utils/propTypes'; 20 +
  21 + const props = {
  22 + /**
  23 + * The theme of the current parent component
  24 + */
  25 + theme: { type: String, validator: (v) => ['light', 'dark'].includes(v) },
  26 + /**
  27 + * Whether to show title
  28 + */
  29 + showTitle: { type: Boolean, default: true },
  30 + /**
  31 + * The title is also displayed when the menu is collapsed
  32 + */
  33 + alwaysShowTitle: { type: Boolean },
  34 + };
36 35
37 export default defineComponent({ 36 export default defineComponent({
38 name: 'AppLogo', 37 name: 'AppLogo',
39 - props: {  
40 - /**  
41 - * The theme of the current parent component  
42 - */  
43 - theme: propTypes.oneOf(['light', 'dark']),  
44 - // Whether to show title  
45 - showTitle: propTypes.bool.def(true),  
46 - alwaysShowTitle: propTypes.bool.def(false),  
47 - },  
48 - setup() { 38 + props: props,
  39 + setup(props) {
49 const { prefixCls } = useDesign('app-logo'); 40 const { prefixCls } = useDesign('app-logo');
50 const { getCollapsedShowTitle } = useMenuSetting(); 41 const { getCollapsedShowTitle } = useMenuSetting();
51 const { title } = useGlobSetting(); 42 const { title } = useGlobSetting();
52 const go = useGo(); 43 const go = useGo();
53 44
54 - function handleGoHome(): void { 45 + const getAppLogoClass = computed(() => [
  46 + prefixCls,
  47 + props.theme,
  48 + { 'collapsed-show-title': unref(getCollapsedShowTitle) },
  49 + ]);
  50 +
  51 + const getTitleClass = computed(() => [
  52 + `${prefixCls}__title`,
  53 + {
  54 + 'xs:opacity-0': !props.alwaysShowTitle,
  55 + },
  56 + ]);
  57 +
  58 + function goHome() {
55 go(PageEnum.BASE_HOME); 59 go(PageEnum.BASE_HOME);
56 } 60 }
57 61
58 return { 62 return {
59 - handleGoHome, 63 + getAppLogoClass,
  64 + getTitleClass,
  65 + getCollapsedShowTitle,
  66 + goHome,
60 title, 67 title,
61 prefixCls, 68 prefixCls,
62 - getCollapsedShowTitle,  
63 }; 69 };
64 }, 70 },
65 }); 71 });
src/components/Application/src/AppProvider.vue
1 <script lang="ts"> 1 <script lang="ts">
2 import { defineComponent, toRefs, ref, unref } from 'vue'; 2 import { defineComponent, toRefs, ref, unref } from 'vue';
3 -  
4 import { createAppProviderContext } from './useAppContext'; 3 import { createAppProviderContext } from './useAppContext';
5 -  
6 - import { prefixCls } from '/@/settings/designSetting';  
7 import { createBreakpointListen } from '/@/hooks/event/useBreakpoint'; 4 import { createBreakpointListen } from '/@/hooks/event/useBreakpoint';
8 - import { propTypes } from '/@/utils/propTypes'; 5 + import { prefixCls } from '/@/settings/designSetting';
9 import { useAppStore } from '/@/store/modules/app'; 6 import { useAppStore } from '/@/store/modules/app';
10 import { MenuModeEnum, MenuTypeEnum } from '/@/enums/menuEnum'; 7 import { MenuModeEnum, MenuTypeEnum } from '/@/enums/menuEnum';
11 8
  9 + const props = {
  10 + /**
  11 + * class style prefix
  12 + */
  13 + prefixCls: { type: String, default: prefixCls },
  14 + };
  15 +
12 export default defineComponent({ 16 export default defineComponent({
13 name: 'AppProvider', 17 name: 'AppProvider',
14 inheritAttrs: false, 18 inheritAttrs: false,
15 - props: {  
16 - prefixCls: propTypes.string.def(prefixCls),  
17 - }, 19 + props,
18 setup(props, { slots }) { 20 setup(props, { slots }) {
19 const isMobile = ref(false); 21 const isMobile = ref(false);
20 const isSetState = ref(false); 22 const isSetState = ref(false);
21 23
22 const appStore = useAppStore(); 24 const appStore = useAppStore();
23 25
  26 + // Monitor screen breakpoint information changes
24 createBreakpointListen(({ screenMap, sizeEnum, width }) => { 27 createBreakpointListen(({ screenMap, sizeEnum, width }) => {
25 const lgWidth = screenMap.get(sizeEnum.LG); 28 const lgWidth = screenMap.get(sizeEnum.LG);
26 if (lgWidth) { 29 if (lgWidth) {
@@ -30,8 +33,13 @@ @@ -30,8 +33,13 @@
30 }); 33 });
31 34
32 const { prefixCls } = toRefs(props); 35 const { prefixCls } = toRefs(props);
  36 +
  37 + // Inject variables into the global
33 createAppProviderContext({ prefixCls, isMobile }); 38 createAppProviderContext({ prefixCls, isMobile });
34 39
  40 + /**
  41 + * Used to maintain the state before the window changes
  42 + */
35 function handleRestoreState() { 43 function handleRestoreState() {
36 if (unref(isMobile)) { 44 if (unref(isMobile)) {
37 if (!unref(isSetState)) { 45 if (!unref(isSetState)) {
src/components/Application/src/search/AppSearch.vue
@@ -4,11 +4,11 @@ @@ -4,11 +4,11 @@
4 import { SearchOutlined } from '@ant-design/icons-vue'; 4 import { SearchOutlined } from '@ant-design/icons-vue';
5 import AppSearchModal from './AppSearchModal.vue'; 5 import AppSearchModal from './AppSearchModal.vue';
6 import { useI18n } from '/@/hooks/web/useI18n'; 6 import { useI18n } from '/@/hooks/web/useI18n';
  7 +
7 export default defineComponent({ 8 export default defineComponent({
8 name: 'AppSearch', 9 name: 'AppSearch',
9 setup() { 10 setup() {
10 const showModal = ref(false); 11 const showModal = ref(false);
11 -  
12 const { t } = useI18n(); 12 const { t } = useI18n();
13 13
14 function changeModal(show: boolean) { 14 function changeModal(show: boolean) {
src/components/Application/src/search/AppSearchFooter.vue
1 <template> 1 <template>
2 <div :class="`${prefixCls}`"> 2 <div :class="`${prefixCls}`">
3 - <AppSearchKeyItem :class="`${prefixCls}__item`" icon="ant-design:enter-outlined" /> 3 + <AppSearchKeyItem :class="`${prefixCls}-item`" icon="ant-design:enter-outlined" />
4 <span>{{ t('component.app.toSearch') }}</span> 4 <span>{{ t('component.app.toSearch') }}</span>
5 - <AppSearchKeyItem :class="`${prefixCls}__item`" icon="ion:arrow-up-outline" />  
6 - <AppSearchKeyItem :class="`${prefixCls}__item`" icon="ion:arrow-down-outline" /> 5 + <AppSearchKeyItem :class="`${prefixCls}-item`" icon="ion:arrow-up-outline" />
  6 + <AppSearchKeyItem :class="`${prefixCls}-item`" icon="ion:arrow-down-outline" />
7 <span>{{ t('component.app.toNavigate') }}</span> 7 <span>{{ t('component.app.toNavigate') }}</span>
8 - <AppSearchKeyItem :class="`${prefixCls}__item`" icon="mdi:keyboard-esc" /> 8 + <AppSearchKeyItem :class="`${prefixCls}-item`" icon="mdi:keyboard-esc" />
9 <span>{{ t('common.closeText') }}</span> 9 <span>{{ t('common.closeText') }}</span>
10 </div> 10 </div>
11 </template> 11 </template>
@@ -21,10 +21,7 @@ @@ -21,10 +21,7 @@
21 setup() { 21 setup() {
22 const { prefixCls } = useDesign('app-search-footer'); 22 const { prefixCls } = useDesign('app-search-footer');
23 const { t } = useI18n(); 23 const { t } = useI18n();
24 - return {  
25 - prefixCls,  
26 - t,  
27 - }; 24 + return { prefixCls, t };
28 }, 25 },
29 }); 26 });
30 </script> 27 </script>
@@ -44,7 +41,7 @@ @@ -44,7 +41,7 @@
44 align-items: center; 41 align-items: center;
45 flex-shrink: 0; 42 flex-shrink: 0;
46 43
47 - &__item { 44 + &-item {
48 display: flex; 45 display: flex;
49 width: 20px; 46 width: 20px;
50 height: 18px; 47 height: 18px;
src/components/Application/src/search/AppSearchKeyItem.vue
@@ -8,8 +8,6 @@ @@ -8,8 +8,6 @@
8 import { Icon } from '/@/components/Icon'; 8 import { Icon } from '/@/components/Icon';
9 export default defineComponent({ 9 export default defineComponent({
10 components: { Icon }, 10 components: { Icon },
11 - props: {  
12 - icon: String,  
13 - }, 11 + props: { icon: String },
14 }); 12 });
15 </script> 13 </script>
src/components/Application/src/search/AppSearchModal.vue
@@ -12,7 +12,6 @@ @@ -12,7 +12,6 @@
12 @change="handleSearch" 12 @change="handleSearch"
13 > 13 >
14 <template #prefix> 14 <template #prefix>
15 - <!-- <Icon icon="ion:search"/> -->  
16 <SearchOutlined /> 15 <SearchOutlined />
17 </template> 16 </template>
18 </Input> 17 </Input>
@@ -59,21 +58,20 @@ @@ -59,21 +58,20 @@
59 </template> 58 </template>
60 <script lang="ts"> 59 <script lang="ts">
61 import { defineComponent, computed, unref, ref, watch, nextTick } from 'vue'; 60 import { defineComponent, computed, unref, ref, watch, nextTick } from 'vue';
62 -  
63 import { SearchOutlined } from '@ant-design/icons-vue'; 61 import { SearchOutlined } from '@ant-design/icons-vue';
64 import { Input } from 'ant-design-vue'; 62 import { Input } from 'ant-design-vue';
65 import AppSearchFooter from './AppSearchFooter.vue'; 63 import AppSearchFooter from './AppSearchFooter.vue';
66 import Icon from '/@/components/Icon'; 64 import Icon from '/@/components/Icon';
67 -  
68 import clickOutside from '/@/directives/clickOutside'; 65 import clickOutside from '/@/directives/clickOutside';
69 -  
70 import { useDesign } from '/@/hooks/web/useDesign'; 66 import { useDesign } from '/@/hooks/web/useDesign';
71 import { useRefs } from '/@/hooks/core/useRefs'; 67 import { useRefs } from '/@/hooks/core/useRefs';
72 import { useMenuSearch } from './useMenuSearch'; 68 import { useMenuSearch } from './useMenuSearch';
73 import { useI18n } from '/@/hooks/web/useI18n'; 69 import { useI18n } from '/@/hooks/web/useI18n';
74 import { useAppInject } from '/@/hooks/web/useAppInject'; 70 import { useAppInject } from '/@/hooks/web/useAppInject';
75 71
76 - import { propTypes } from '/@/utils/propTypes'; 72 + const props = {
  73 + visible: { type: Boolean },
  74 + };
77 75
78 export default defineComponent({ 76 export default defineComponent({
79 name: 'AppSearchModal', 77 name: 'AppSearchModal',
@@ -81,17 +79,16 @@ @@ -81,17 +79,16 @@
81 directives: { 79 directives: {
82 clickOutside, 80 clickOutside,
83 }, 81 },
84 - props: {  
85 - visible: propTypes.bool,  
86 - }, 82 + props,
87 emits: ['close'], 83 emits: ['close'],
88 setup(props, { emit }) { 84 setup(props, { emit }) {
89 const scrollWrap = ref<ElRef>(null); 85 const scrollWrap = ref<ElRef>(null);
90 - const { prefixCls } = useDesign('app-search-modal'); 86 + const inputRef = ref<Nullable<HTMLElement>>(null);
  87 +
91 const { t } = useI18n(); 88 const { t } = useI18n();
  89 + const { prefixCls } = useDesign('app-search-modal');
92 const [refs, setRefs] = useRefs(); 90 const [refs, setRefs] = useRefs();
93 const { getIsMobile } = useAppInject(); 91 const { getIsMobile } = useAppInject();
94 - const inputRef = ref<Nullable<HTMLElement>>(null);  
95 92
96 const { handleSearch, searchResult, keyword, activeIndex, handleEnter, handleMouseenter } = 93 const { handleSearch, searchResult, keyword, activeIndex, handleEnter, handleMouseenter } =
97 useMenuSearch(refs, scrollWrap, emit); 94 useMenuSearch(refs, scrollWrap, emit);
@@ -109,8 +106,8 @@ @@ -109,8 +106,8 @@
109 106
110 watch( 107 watch(
111 () => props.visible, 108 () => props.visible,
112 - (v: boolean) => {  
113 - v && 109 + (visible: boolean) => {
  110 + visible &&
114 nextTick(() => { 111 nextTick(() => {
115 unref(inputRef)?.focus(); 112 unref(inputRef)?.focus();
116 }); 113 });
src/components/Application/src/search/useMenuSearch.ts
1 import type { Menu } from '/@/router/types'; 1 import type { Menu } from '/@/router/types';
2 -  
3 import { ref, onBeforeMount, unref, Ref, nextTick } from 'vue'; 2 import { ref, onBeforeMount, unref, Ref, nextTick } from 'vue';
4 -  
5 import { getMenus } from '/@/router/menus'; 3 import { getMenus } from '/@/router/menus';
6 -  
7 import { cloneDeep } from 'lodash-es'; 4 import { cloneDeep } from 'lodash-es';
8 import { filter, forEach } from '/@/utils/helper/treeHelper'; 5 import { filter, forEach } from '/@/utils/helper/treeHelper';
9 -  
10 import { useGo } from '/@/hooks/web/usePage'; 6 import { useGo } from '/@/hooks/web/usePage';
11 import { useScrollTo } from '/@/hooks/event/useScrollTo'; 7 import { useScrollTo } from '/@/hooks/event/useScrollTo';
12 import { onKeyStroke, useDebounceFn } from '@vueuse/core'; 8 import { onKeyStroke, useDebounceFn } from '@vueuse/core';
@@ -67,7 +63,6 @@ export function useMenuSearch(refs: Ref&lt;HTMLElement[]&gt;, scrollWrap: Ref&lt;ElRef&gt;, @@ -67,7 +63,6 @@ export function useMenuSearch(refs: Ref&lt;HTMLElement[]&gt;, scrollWrap: Ref&lt;ElRef&gt;,
67 63
68 function handlerSearchResult(filterMenu: Menu[], reg: RegExp, parent?: Menu) { 64 function handlerSearchResult(filterMenu: Menu[], reg: RegExp, parent?: Menu) {
69 const ret: SearchResult[] = []; 65 const ret: SearchResult[] = [];
70 -  
71 filterMenu.forEach((item) => { 66 filterMenu.forEach((item) => {
72 const { name, path, icon, children } = item; 67 const { name, path, icon, children } = item;
73 if (reg.test(name) && !children?.length) { 68 if (reg.test(name) && !children?.length) {
@@ -84,11 +79,13 @@ export function useMenuSearch(refs: Ref&lt;HTMLElement[]&gt;, scrollWrap: Ref&lt;ElRef&gt;, @@ -84,11 +79,13 @@ export function useMenuSearch(refs: Ref&lt;HTMLElement[]&gt;, scrollWrap: Ref&lt;ElRef&gt;,
84 return ret; 79 return ret;
85 } 80 }
86 81
  82 + // Activate when the mouse moves to a certain line
87 function handleMouseenter(e: any) { 83 function handleMouseenter(e: any) {
88 const index = e.target.dataset.index; 84 const index = e.target.dataset.index;
89 activeIndex.value = Number(index); 85 activeIndex.value = Number(index);
90 } 86 }
91 87
  88 + // Arrow key up
92 function handleUp() { 89 function handleUp() {
93 if (!searchResult.value.length) return; 90 if (!searchResult.value.length) return;
94 activeIndex.value--; 91 activeIndex.value--;
@@ -98,6 +95,7 @@ export function useMenuSearch(refs: Ref&lt;HTMLElement[]&gt;, scrollWrap: Ref&lt;ElRef&gt;, @@ -98,6 +95,7 @@ export function useMenuSearch(refs: Ref&lt;HTMLElement[]&gt;, scrollWrap: Ref&lt;ElRef&gt;,
98 handleScroll(); 95 handleScroll();
99 } 96 }
100 97
  98 + // Arrow key down
101 function handleDown() { 99 function handleDown() {
102 if (!searchResult.value.length) return; 100 if (!searchResult.value.length) return;
103 activeIndex.value++; 101 activeIndex.value++;
@@ -107,15 +105,23 @@ export function useMenuSearch(refs: Ref&lt;HTMLElement[]&gt;, scrollWrap: Ref&lt;ElRef&gt;, @@ -107,15 +105,23 @@ export function useMenuSearch(refs: Ref&lt;HTMLElement[]&gt;, scrollWrap: Ref&lt;ElRef&gt;,
107 handleScroll(); 105 handleScroll();
108 } 106 }
109 107
  108 + // When the keyboard up and down keys move to an invisible place
  109 + // the scroll bar needs to scroll automatically
110 function handleScroll() { 110 function handleScroll() {
111 const refList = unref(refs); 111 const refList = unref(refs);
112 - if (!refList || !Array.isArray(refList) || refList.length === 0 || !unref(scrollWrap)) return; 112 + if (!refList || !Array.isArray(refList) || refList.length === 0 || !unref(scrollWrap)) {
  113 + return;
  114 + }
113 115
114 const index = unref(activeIndex); 116 const index = unref(activeIndex);
115 const currentRef = refList[index]; 117 const currentRef = refList[index];
116 - if (!currentRef) return; 118 + if (!currentRef) {
  119 + return;
  120 + }
117 const wrapEl = unref(scrollWrap); 121 const wrapEl = unref(scrollWrap);
118 - if (!wrapEl) return; 122 + if (!wrapEl) {
  123 + return;
  124 + }
119 const scrollHeight = currentRef.offsetTop + currentRef.offsetHeight; 125 const scrollHeight = currentRef.offsetTop + currentRef.offsetHeight;
120 const wrapHeight = wrapEl.offsetHeight; 126 const wrapHeight = wrapEl.offsetHeight;
121 const { start } = useScrollTo({ 127 const { start } = useScrollTo({
@@ -126,8 +132,11 @@ export function useMenuSearch(refs: Ref&lt;HTMLElement[]&gt;, scrollWrap: Ref&lt;ElRef&gt;, @@ -126,8 +132,11 @@ export function useMenuSearch(refs: Ref&lt;HTMLElement[]&gt;, scrollWrap: Ref&lt;ElRef&gt;,
126 start(); 132 start();
127 } 133 }
128 134
  135 + // enter keyboard event
129 async function handleEnter() { 136 async function handleEnter() {
130 - if (!searchResult.value.length) return; 137 + if (!searchResult.value.length) {
  138 + return;
  139 + }
131 const result = unref(searchResult); 140 const result = unref(searchResult);
132 const index = unref(activeIndex); 141 const index = unref(activeIndex);
133 if (result.length === 0 || index < 0) { 142 if (result.length === 0 || index < 0) {
@@ -139,14 +148,18 @@ export function useMenuSearch(refs: Ref&lt;HTMLElement[]&gt;, scrollWrap: Ref&lt;ElRef&gt;, @@ -139,14 +148,18 @@ export function useMenuSearch(refs: Ref&lt;HTMLElement[]&gt;, scrollWrap: Ref&lt;ElRef&gt;,
139 go(to.path); 148 go(to.path);
140 } 149 }
141 150
  151 + // close search modal
142 function handleClose() { 152 function handleClose() {
143 searchResult.value = []; 153 searchResult.value = [];
144 emit('close'); 154 emit('close');
145 } 155 }
146 156
  157 + // enter search
147 onKeyStroke('Enter', handleEnter); 158 onKeyStroke('Enter', handleEnter);
  159 + // Monitor keyboard arrow keys
148 onKeyStroke('ArrowUp', handleUp); 160 onKeyStroke('ArrowUp', handleUp);
149 onKeyStroke('ArrowDown', handleDown); 161 onKeyStroke('ArrowDown', handleDown);
  162 + // esc close
150 onKeyStroke('Escape', handleClose); 163 onKeyStroke('Escape', handleClose);
151 164
152 return { handleSearch, searchResult, keyword, activeIndex, handleMouseenter, handleEnter }; 165 return { handleSearch, searchResult, keyword, activeIndex, handleMouseenter, handleEnter };
src/components/Application/src/useAppContext.ts
@@ -3,7 +3,6 @@ import { createContext, useContext } from &#39;/@/hooks/core/useContext&#39;; @@ -3,7 +3,6 @@ import { createContext, useContext } from &#39;/@/hooks/core/useContext&#39;;
3 3
4 export interface AppProviderContextProps { 4 export interface AppProviderContextProps {
5 prefixCls: Ref<string>; 5 prefixCls: Ref<string>;
6 -  
7 isMobile: Ref<boolean>; 6 isMobile: Ref<boolean>;
8 } 7 }
9 8
src/components/Authority/index.ts
1 -import Authority from './src/Authority.vue'; 1 +import { withInstall } from '/@/utils';
  2 +import authority from './src/Authority.vue';
2 3
3 -export { Authority }; 4 +export const Authority = withInstall(authority);
src/components/Authority/src/Authority.vue
@@ -4,11 +4,8 @@ @@ -4,11 +4,8 @@
4 <script lang="ts"> 4 <script lang="ts">
5 import type { PropType } from 'vue'; 5 import type { PropType } from 'vue';
6 import { defineComponent } from 'vue'; 6 import { defineComponent } from 'vue';
7 -  
8 import { RoleEnum } from '/@/enums/roleEnum'; 7 import { RoleEnum } from '/@/enums/roleEnum';
9 -  
10 import { usePermission } from '/@/hooks/web/usePermission'; 8 import { usePermission } from '/@/hooks/web/usePermission';
11 -  
12 import { getSlot } from '/@/utils/helper/tsxHelper'; 9 import { getSlot } from '/@/utils/helper/tsxHelper';
13 10
14 export default defineComponent({ 11 export default defineComponent({
src/components/Basic/index.ts
1 -import BasicArrow from './src/BasicArrow.vue';  
2 -import BasicTitle from './src/BasicTitle.vue';  
3 -import BasicHelp from './src/BasicHelp.vue'; 1 +import { withInstall } from '/@/utils';
  2 +import basicArrow from './src/BasicArrow.vue';
  3 +import basicTitle from './src/BasicTitle.vue';
  4 +import basicHelp from './src/BasicHelp.vue';
4 5
5 -export { BasicArrow, BasicTitle, BasicHelp }; 6 +export const BasicArrow = withInstall(basicArrow);
  7 +export const BasicTitle = withInstall(basicTitle);
  8 +export const BasicHelp = withInstall(basicHelp);
src/components/Basic/src/BasicArrow.vue
@@ -9,41 +9,50 @@ @@ -9,41 +9,50 @@
9 </template> 9 </template>
10 <script lang="ts"> 10 <script lang="ts">
11 import { defineComponent, computed } from 'vue'; 11 import { defineComponent, computed } from 'vue';
12 - 12 + import { Icon } from '/@/components/Icon';
13 import { useDesign } from '/@/hooks/web/useDesign'; 13 import { useDesign } from '/@/hooks/web/useDesign';
14 14
15 - import { propTypes } from '/@/utils/propTypes';  
16 -  
17 - import { Icon } from '/@/components/Icon'; 15 + const props = {
  16 + /**
  17 + * Arrow expand state
  18 + */
  19 + expand: { type: Boolean },
  20 + /**
  21 + * Arrow up by default
  22 + */
  23 + up: { type: Boolean },
  24 + /**
  25 + * Arrow down by default
  26 + */
  27 + down: { type: Boolean },
  28 + /**
  29 + * Cancel padding/margin for inline
  30 + */
  31 + inset: { type: Boolean },
  32 + };
18 33
19 export default defineComponent({ 34 export default defineComponent({
20 name: 'BasicArrow', 35 name: 'BasicArrow',
21 components: { Icon }, 36 components: { Icon },
22 - props: {  
23 - expand: propTypes.bool,  
24 - top: propTypes.bool,  
25 - bottom: propTypes.bool,  
26 - inset: propTypes.bool,  
27 - }, 37 + props,
28 setup(props) { 38 setup(props) {
29 const { prefixCls } = useDesign('basic-arrow'); 39 const { prefixCls } = useDesign('basic-arrow');
30 40
  41 + // get component class
31 const getClass = computed(() => { 42 const getClass = computed(() => {
32 - const { expand, top, bottom, inset } = props; 43 + const { expand, up, down, inset } = props;
33 return [ 44 return [
34 prefixCls, 45 prefixCls,
35 { 46 {
36 [`${prefixCls}--active`]: expand, 47 [`${prefixCls}--active`]: expand,
37 - top, 48 + up,
38 inset, 49 inset,
39 - bottom, 50 + down,
40 }, 51 },
41 ]; 52 ];
42 }); 53 });
43 54
44 - return {  
45 - getClass,  
46 - }; 55 + return { getClass };
47 }, 56 },
48 }); 57 });
49 </script> 58 </script>
@@ -65,19 +74,19 @@ @@ -65,19 +74,19 @@
65 line-height: 0px; 74 line-height: 0px;
66 } 75 }
67 76
68 - &.top { 77 + &.up {
69 transform: rotate(-90deg); 78 transform: rotate(-90deg);
70 } 79 }
71 80
72 - &.bottom { 81 + &.down {
73 transform: rotate(90deg); 82 transform: rotate(90deg);
74 } 83 }
75 84
76 - &.top.@{prefix-cls}--active { 85 + &.up.@{prefix-cls}--active {
77 transform: rotate(90deg); 86 transform: rotate(90deg);
78 } 87 }
79 88
80 - &.bottom.@{prefix-cls}--active { 89 + &.down.@{prefix-cls}--active {
81 transform: rotate(-90deg); 90 transform: rotate(-90deg);
82 } 91 }
83 } 92 }
src/components/Basic/src/BasicHelp.vue
1 <script lang="tsx"> 1 <script lang="tsx">
2 import type { CSSProperties, PropType } from 'vue'; 2 import type { CSSProperties, PropType } from 'vue';
3 import { defineComponent, computed, unref } from 'vue'; 3 import { defineComponent, computed, unref } from 'vue';
4 -  
5 import { Tooltip } from 'ant-design-vue'; 4 import { Tooltip } from 'ant-design-vue';
6 import { InfoCircleOutlined } from '@ant-design/icons-vue'; 5 import { InfoCircleOutlined } from '@ant-design/icons-vue';
7 -  
8 import { getPopupContainer } from '/@/utils'; 6 import { getPopupContainer } from '/@/utils';
9 import { isString, isArray } from '/@/utils/is'; 7 import { isString, isArray } from '/@/utils/is';
10 import { getSlot } from '/@/utils/helper/tsxHelper'; 8 import { getSlot } from '/@/utils/helper/tsxHelper';
11 - import { propTypes } from '/@/utils/propTypes';  
12 -  
13 import { useDesign } from '/@/hooks/web/useDesign'; 9 import { useDesign } from '/@/hooks/web/useDesign';
14 10
  11 + const props = {
  12 + /**
  13 + * Help text max-width
  14 + * @default: 600px
  15 + */
  16 + maxWidth: { type: String, default: '600px' },
  17 + /**
  18 + * Whether to display the serial number
  19 + * @default: false
  20 + */
  21 + showIndex: { type: Boolean },
  22 + /**
  23 + * Help text font color
  24 + * @default: #ffffff
  25 + */
  26 + color: { type: String, default: '#ffffff' },
  27 + /**
  28 + * Help text font size
  29 + * @default: 14px
  30 + */
  31 + fontSize: { type: String, default: '14px' },
  32 + /**
  33 + * Help text list
  34 + */
  35 + placement: { type: String, default: 'right' },
  36 + /**
  37 + * Help text list
  38 + */
  39 + text: { type: [Array, String] as PropType<string[] | string> },
  40 + };
  41 +
15 export default defineComponent({ 42 export default defineComponent({
16 name: 'BasicHelp', 43 name: 'BasicHelp',
17 components: { Tooltip }, 44 components: { Tooltip },
18 - props: {  
19 - // max-width  
20 - maxWidth: propTypes.string.def('600px'),  
21 - // Whether to display the serial number  
22 - showIndex: propTypes.bool,  
23 - // color  
24 - color: propTypes.string.def('#ffffff'),  
25 - fontSize: propTypes.string.def('14px'),  
26 - placement: propTypes.string.def('right'),  
27 - absolute: propTypes.bool,  
28 - // Text list  
29 - text: {  
30 - type: [Array, String] as PropType<string[] | string>,  
31 - },  
32 - // ๅฎšไฝ  
33 - position: {  
34 - type: [Object] as PropType<any>,  
35 - default: () => ({  
36 - position: 'absolute',  
37 - left: 0,  
38 - bottom: 0,  
39 - }),  
40 - },  
41 - }, 45 + props,
42 setup(props, { slots }) { 46 setup(props, { slots }) {
43 const { prefixCls } = useDesign('basic-help'); 47 const { prefixCls } = useDesign('basic-help');
44 48
45 - const getOverlayStyle = computed(  
46 - (): CSSProperties => {  
47 - return {  
48 - maxWidth: props.maxWidth,  
49 - };  
50 - }  
51 - );  
52 -  
53 - const getWrapStyle = computed(  
54 - (): CSSProperties => {  
55 - return {  
56 - color: props.color,  
57 - fontSize: props.fontSize,  
58 - };  
59 - } 49 + const getTooltipStyle = computed(
  50 + (): CSSProperties => ({ color: props.color, fontSize: props.fontSize })
60 ); 51 );
61 52
62 - const getMainStyleRef = computed(() => {  
63 - return props.absolute ? props.position : {};  
64 - }); 53 + const getOverlayStyle = computed((): CSSProperties => ({ maxWidth: props.maxWidth }));
65 54
66 - const renderTitle = () => {  
67 - const list = props.text; 55 + function renderTitle() {
  56 + const textList = props.text;
68 57
69 - if (isString(list)) {  
70 - return <p>{list}</p>; 58 + if (isString(textList)) {
  59 + return <p>{textList}</p>;
71 } 60 }
72 61
73 - if (isArray(list)) {  
74 - return list.map((item, index) => { 62 + if (isArray(textList)) {
  63 + return textList.map((text, index) => {
75 return ( 64 return (
76 - <p key={item}> 65 + <p key={text}>
77 <> 66 <>
78 {props.showIndex ? `${index + 1}. ` : ''} 67 {props.showIndex ? `${index + 1}. ` : ''}
79 - {item} 68 + {text}
80 </> 69 </>
81 </p> 70 </p>
82 ); 71 );
83 }); 72 });
84 } 73 }
85 -  
86 return null; 74 return null;
87 - }; 75 + }
88 76
89 return () => { 77 return () => {
90 return ( 78 return (
91 <Tooltip 79 <Tooltip
92 - title={<div style={unref(getWrapStyle)}>{renderTitle()}</div>}  
93 overlayClassName={`${prefixCls}__wrap`} 80 overlayClassName={`${prefixCls}__wrap`}
  81 + title={<div style={unref(getTooltipStyle)}>{renderTitle()}</div>}
94 autoAdjustOverflow={true} 82 autoAdjustOverflow={true}
95 overlayStyle={unref(getOverlayStyle)} 83 overlayStyle={unref(getOverlayStyle)}
96 - placement={props.placement as 'left'} 84 + placement={props.placement as 'right'}
97 getPopupContainer={() => getPopupContainer()} 85 getPopupContainer={() => getPopupContainer()}
98 > 86 >
99 - <span class={prefixCls} style={unref(getMainStyleRef)}>  
100 - {getSlot(slots) || <InfoCircleOutlined />}  
101 - </span> 87 + <span class={prefixCls}>{getSlot(slots) || <InfoCircleOutlined />}</span>
102 </Tooltip> 88 </Tooltip>
103 ); 89 );
104 }; 90 };
src/components/Basic/src/BasicTitle.vue
1 <template> 1 <template>
2 <span :class="getClass"> 2 <span :class="getClass">
3 <slot></slot> 3 <slot></slot>
4 - <BasicHelp :class="`${prefixCls}__help`" v-if="helpMessage" :text="helpMessage" /> 4 + <BasicHelp :class="`${prefixCls}-help`" v-if="helpMessage" :text="helpMessage" />
5 </span> 5 </span>
6 </template> 6 </template>
7 <script lang="ts"> 7 <script lang="ts">
8 import type { PropType } from 'vue'; 8 import type { PropType } from 'vue';
9 -  
10 import { defineComponent, computed } from 'vue'; 9 import { defineComponent, computed } from 'vue';
11 import BasicHelp from './BasicHelp.vue'; 10 import BasicHelp from './BasicHelp.vue';
12 -  
13 import { useDesign } from '/@/hooks/web/useDesign'; 11 import { useDesign } from '/@/hooks/web/useDesign';
14 12
15 - import { propTypes } from '/@/utils/propTypes'; 13 + const props = {
  14 + /**
  15 + * Help text list or string
  16 + * @default: ''
  17 + */
  18 + helpMessage: {
  19 + type: [String, Array] as PropType<string | string[]>,
  20 + default: '',
  21 + },
  22 + /**
  23 + * Whether the color block on the left side of the title
  24 + * @default: false
  25 + */
  26 + span: { type: Boolean },
  27 + /**
  28 + * Whether to default the text, that is, not bold
  29 + * @default: false
  30 + */
  31 + normal: { type: Boolean },
  32 + };
16 33
17 export default defineComponent({ 34 export default defineComponent({
18 name: 'BasicTitle', 35 name: 'BasicTitle',
19 components: { BasicHelp }, 36 components: { BasicHelp },
20 - props: {  
21 - helpMessage: {  
22 - type: [String, Array] as PropType<string | string[]>,  
23 - default: '',  
24 - },  
25 - span: propTypes.bool,  
26 - normal: propTypes.bool.def(false),  
27 - }, 37 + props,
28 setup(props, { slots }) { 38 setup(props, { slots }) {
29 const { prefixCls } = useDesign('basic-title'); 39 const { prefixCls } = useDesign('basic-title');
30 40
@@ -33,6 +43,7 @@ @@ -33,6 +43,7 @@
33 { [`${prefixCls}-show-span`]: props.span && slots.default }, 43 { [`${prefixCls}-show-span`]: props.span && slots.default },
34 { [`${prefixCls}-normal`]: props.normal }, 44 { [`${prefixCls}-normal`]: props.normal },
35 ]); 45 ]);
  46 +
36 return { prefixCls, getClass }; 47 return { prefixCls, getClass };
37 }, 48 },
38 }); 49 });
@@ -67,7 +78,7 @@ @@ -67,7 +78,7 @@
67 content: ''; 78 content: '';
68 } 79 }
69 80
70 - &__help { 81 + &-help {
71 margin-left: 10px; 82 margin-left: 10px;
72 } 83 }
73 } 84 }
src/components/Button/index.ts
1 -import Button from './src/BasicButton.vue';  
2 -import PopConfirmButton from './src/PopConfirmButton.vue'; 1 +import { withInstall } from '/@/utils';
  2 +import button from './src/BasicButton.vue';
  3 +import popConfirmButton from './src/PopConfirmButton.vue';
3 4
4 -export { Button, PopConfirmButton }; 5 +export const Button = withInstall(button);
  6 +export const PopConfirmButton = withInstall(popConfirmButton);
src/components/Button/src/BasicButton.vue
@@ -13,11 +13,21 @@ @@ -13,11 +13,21 @@
13 import { Icon } from '/@/components/Icon'; 13 import { Icon } from '/@/components/Icon';
14 14
15 const props = { 15 const props = {
16 - color: { type: String, validate: (v) => ['error', 'warning', 'success', ''].includes(v) }, 16 + color: { type: String, validator: (v) => ['error', 'warning', 'success', ''].includes(v) },
17 loading: { type: Boolean }, 17 loading: { type: Boolean },
18 disabled: { type: Boolean }, 18 disabled: { type: Boolean },
  19 + /**
  20 + * Text before icon.
  21 + */
19 preIcon: { type: String }, 22 preIcon: { type: String },
  23 + /**
  24 + * Text after icon.
  25 + */
20 postIcon: { type: String }, 26 postIcon: { type: String },
  27 + /**
  28 + * preIcon and postIcon icon size.
  29 + * @default: 14
  30 + */
21 iconSize: { type: Number, default: 14 }, 31 iconSize: { type: Number, default: 14 },
22 onClick: { type: Function as PropType<(...args) => any>, default: null }, 32 onClick: { type: Function as PropType<(...args) => any>, default: null },
23 }; 33 };
src/components/Button/src/PopConfirmButton.vue
1 <script lang="ts"> 1 <script lang="ts">
2 import { defineComponent, h, unref, computed } from 'vue'; 2 import { defineComponent, h, unref, computed } from 'vue';
3 - import { Popconfirm } from 'ant-design-vue';  
4 import BasicButton from './BasicButton.vue'; 3 import BasicButton from './BasicButton.vue';
  4 + import { Popconfirm } from 'ant-design-vue';
5 import { extendSlots } from '/@/utils/helper/tsxHelper'; 5 import { extendSlots } from '/@/utils/helper/tsxHelper';
6 import { omit } from 'lodash-es'; 6 import { omit } from 'lodash-es';
7 import { useAttrs } from '/@/hooks/core/useAttrs'; 7 import { useAttrs } from '/@/hooks/core/useAttrs';
src/components/ClickOutSide/index.ts
1 -import ClickOutSide from './src/ClickOutSide.vue'; 1 +import { withInstall } from '/@/utils';
  2 +import clickOutSide from './src/ClickOutSide.vue';
2 3
3 -export { ClickOutSide }; 4 +export const ClickOutSide = withInstall(clickOutSide);
src/components/CodeEditor/index.ts
1 -import { install } from '/@/utils/install'; 1 +import { withInstall } from '/@/utils';
2 import codeEditor from './src/CodeEditor.vue'; 2 import codeEditor from './src/CodeEditor.vue';
3 import jsonPreview from './src/json-preview/JsonPreview.vue'; 3 import jsonPreview from './src/json-preview/JsonPreview.vue';
4 4
5 -export const CodeEditor = install(codeEditor);  
6 -export const JsonPreview = install(jsonPreview); 5 +export const CodeEditor = withInstall(codeEditor);
  6 +export const JsonPreview = withInstall(jsonPreview);
src/components/CodeEditor/src/CodeEditor.vue
1 <template> 1 <template>
2 <div class="h-full"> 2 <div class="h-full">
3 - <CodeMirrorEditor :value="getValue" @change="handleValueChange" :mode="mode" :readonly="readonly" /> 3 + <CodeMirrorEditor
  4 + :value="getValue"
  5 + @change="handleValueChange"
  6 + :mode="mode"
  7 + :readonly="readonly"
  8 + />
4 </div> 9 </div>
5 </template> 10 </template>
6 <script lang="ts"> 11 <script lang="ts">
@@ -13,43 +18,34 @@ @@ -13,43 +18,34 @@
13 html: 'htmlmixed', 18 html: 'htmlmixed',
14 js: 'javascript', 19 js: 'javascript',
15 }; 20 };
  21 +
  22 + const props = {
  23 + value: { type: [Object, String] as PropType<Record<string, any> | string> },
  24 + mode: { type: String, default: MODE.JSON },
  25 + readonly: { type: Boolean },
  26 + };
  27 +
16 export default defineComponent({ 28 export default defineComponent({
17 name: 'CodeEditor', 29 name: 'CodeEditor',
18 components: { CodeMirrorEditor }, 30 components: { CodeMirrorEditor },
19 - props: {  
20 - value: {  
21 - type: [Object, String],  
22 - },  
23 - mode: {  
24 - type: String,  
25 - default: MODE.JSON,  
26 - },  
27 - readonly: {  
28 - type: Boolean,  
29 - default: false,  
30 - },  
31 - }, 31 + props,
32 emits: ['change'], 32 emits: ['change'],
33 setup(props, { emit }) { 33 setup(props, { emit }) {
34 const getValue = computed(() => { 34 const getValue = computed(() => {
35 const { value, mode } = props; 35 const { value, mode } = props;
36 -  
37 - if (mode === MODE.JSON) {  
38 - return isString(value)  
39 - ? JSON.stringify(JSON.parse(value), null, 2)  
40 - : JSON.stringify(value, null, 2); 36 + if (mode !== MODE.JSON) {
  37 + return value as string;
41 } 38 }
42 - return value; 39 + return isString(value)
  40 + ? JSON.stringify(JSON.parse(value), null, 2)
  41 + : JSON.stringify(value, null, 2);
43 }); 42 });
44 43
45 function handleValueChange(v) { 44 function handleValueChange(v) {
46 emit('change', v); 45 emit('change', v);
47 } 46 }
48 47
49 - return {  
50 - handleValueChange,  
51 - getValue,  
52 - }; 48 + return { handleValueChange, getValue };
53 }, 49 },
54 }); 50 });
55 </script> 51 </script>
src/components/CodeEditor/src/codemirror/CodeMirror.vue
@@ -15,31 +15,25 @@ @@ -15,31 +15,25 @@
15 } from 'vue'; 15 } from 'vue';
16 import { useDebounceFn } from '@vueuse/core'; 16 import { useDebounceFn } from '@vueuse/core';
17 import { useAppStore } from '/@/store/modules/app'; 17 import { useAppStore } from '/@/store/modules/app';
18 - 18 + import { useWindowSizeFn } from '/@/hooks/event/useWindowSizeFn';
19 import CodeMirror from 'codemirror'; 19 import CodeMirror from 'codemirror';
  20 + // css
20 import './codemirror.css'; 21 import './codemirror.css';
21 import 'codemirror/theme/idea.css'; 22 import 'codemirror/theme/idea.css';
22 import 'codemirror/theme/material-palenight.css'; 23 import 'codemirror/theme/material-palenight.css';
23 -  
24 // modes 24 // modes
25 import 'codemirror/mode/javascript/javascript'; 25 import 'codemirror/mode/javascript/javascript';
26 import 'codemirror/mode/css/css'; 26 import 'codemirror/mode/css/css';
27 import 'codemirror/mode/htmlmixed/htmlmixed'; 27 import 'codemirror/mode/htmlmixed/htmlmixed';
  28 +
  29 + const props = {
  30 + mode: { type: String, default: 'application/json' },
  31 + value: { type: String, default: '' },
  32 + readonly: { type: Boolean, default: false },
  33 + };
  34 +
28 export default defineComponent({ 35 export default defineComponent({
29 - props: {  
30 - mode: {  
31 - type: String,  
32 - default: 'application/json',  
33 - },  
34 - value: {  
35 - type: String,  
36 - default: '',  
37 - },  
38 - readonly: {  
39 - type: Boolean,  
40 - default: false,  
41 - },  
42 - }, 36 + props,
43 emits: ['change'], 37 emits: ['change'],
44 setup(props, { emit }) { 38 setup(props, { emit }) {
45 const el = ref(); 39 const el = ref();
@@ -50,11 +44,11 @@ @@ -50,11 +44,11 @@
50 44
51 watch( 45 watch(
52 () => props.value, 46 () => props.value,
53 - async (v) => { 47 + async (value) => {
54 await nextTick(); 48 await nextTick();
55 const oldValue = editor?.getValue(); 49 const oldValue = editor?.getValue();
56 - if (v !== oldValue) {  
57 - editor?.setValue(v ? v : ''); 50 + if (value !== oldValue) {
  51 + editor?.setValue(value ? value : '');
58 } 52 }
59 }, 53 },
60 { flush: 'post' } 54 { flush: 'post' }
@@ -113,13 +107,13 @@ @@ -113,13 +107,13 @@
113 onMounted(async () => { 107 onMounted(async () => {
114 await nextTick(); 108 await nextTick();
115 init(); 109 init();
116 - window.addEventListener('resize', debounceRefresh); 110 + useWindowSizeFn(debounceRefresh);
117 }); 111 });
118 112
119 onUnmounted(() => { 113 onUnmounted(() => {
120 - window.removeEventListener('resize', debounceRefresh);  
121 editor = null; 114 editor = null;
122 }); 115 });
  116 +
123 return { el }; 117 return { el };
124 }, 118 },
125 }); 119 });
src/components/CodeEditor/src/codemirror/codemirror.css
@@ -12,20 +12,21 @@ @@ -12,20 +12,21 @@
12 --qualifier: #ff6032; 12 --qualifier: #ff6032;
13 --important: var(--string); 13 --important: var(--string);
14 14
  15 + position: relative;
15 height: auto; 16 height: auto;
16 height: 100%; 17 height: 100%;
  18 + overflow: hidden;
17 font-family: var(--font-code); 19 font-family: var(--font-code);
  20 + background: white;
18 direction: ltr; 21 direction: ltr;
19 } 22 }
20 23
21 /* PADDING */ 24 /* PADDING */
22 25
23 .CodeMirror-lines { 26 .CodeMirror-lines {
  27 + min-height: 1px; /* prevents collapsing before first draw */
24 padding: 4px 0; /* Vertical padding around content */ 28 padding: 4px 0; /* Vertical padding around content */
25 -}  
26 -  
27 -.CodeMirror pre {  
28 - padding: 0 4px; /* Horizontal padding of content */ 29 + cursor: text;
29 } 30 }
30 31
31 .CodeMirror-scrollbar-filler, 32 .CodeMirror-scrollbar-filler,
@@ -36,6 +37,11 @@ @@ -36,6 +37,11 @@
36 /* GUTTER */ 37 /* GUTTER */
37 38
38 .CodeMirror-gutters { 39 .CodeMirror-gutters {
  40 + position: absolute;
  41 + top: 0;
  42 + left: 0;
  43 + z-index: 3;
  44 + min-height: 100%;
39 white-space: nowrap; 45 white-space: nowrap;
40 background-color: transparent; 46 background-color: transparent;
41 border-right: 1px solid #ddd; 47 border-right: 1px solid #ddd;
@@ -96,7 +102,9 @@ @@ -96,7 +102,9 @@
96 /* CURSOR */ 102 /* CURSOR */
97 103
98 .CodeMirror-cursor { 104 .CodeMirror-cursor {
  105 + position: absolute;
99 width: 0; 106 width: 0;
  107 + pointer-events: none;
100 border-right: none; 108 border-right: none;
101 border-left: 1px solid black; 109 border-left: 1px solid black;
102 } 110 }
@@ -132,37 +140,19 @@ @@ -132,37 +140,19 @@
132 animation: blink 1.06s steps(1) infinite; 140 animation: blink 1.06s steps(1) infinite;
133 } 141 }
134 @-moz-keyframes blink { 142 @-moz-keyframes blink {
135 - 0% {  
136 - }  
137 -  
138 50% { 143 50% {
139 background-color: transparent; 144 background-color: transparent;
140 } 145 }
141 -  
142 - 100% {  
143 - }  
144 } 146 }
145 @-webkit-keyframes blink { 147 @-webkit-keyframes blink {
146 - 0% {  
147 - }  
148 -  
149 50% { 148 50% {
150 background-color: transparent; 149 background-color: transparent;
151 } 150 }
152 -  
153 - 100% {  
154 - }  
155 } 151 }
156 @keyframes blink { 152 @keyframes blink {
157 - 0% {  
158 - }  
159 -  
160 50% { 153 50% {
161 background-color: transparent; 154 background-color: transparent;
162 } 155 }
163 -  
164 - 100% {  
165 - }  
166 } 156 }
167 157
168 .cm-tab { 158 .cm-tab {
@@ -316,12 +306,6 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket { @@ -316,12 +306,6 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {
316 /* The rest of this file contains styles related to the mechanics of 306 /* The rest of this file contains styles related to the mechanics of
317 the editor. You probably shouldn't touch them. */ 307 the editor. You probably shouldn't touch them. */
318 308
319 -.CodeMirror {  
320 - position: relative;  
321 - overflow: hidden;  
322 - background: white;  
323 -}  
324 -  
325 .CodeMirror-scroll { 309 .CodeMirror-scroll {
326 position: relative; 310 position: relative;
327 height: 100%; 311 height: 100%;
@@ -378,14 +362,6 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket { @@ -378,14 +362,6 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {
378 left: 0; 362 left: 0;
379 } 363 }
380 364
381 -.CodeMirror-gutters {  
382 - position: absolute;  
383 - top: 0;  
384 - left: 0;  
385 - z-index: 3;  
386 - min-height: 100%;  
387 -}  
388 -  
389 .CodeMirror-gutter { 365 .CodeMirror-gutter {
390 display: inline-block; 366 display: inline-block;
391 height: 100%; 367 height: 100%;
@@ -422,14 +398,10 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket { @@ -422,14 +398,10 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {
422 background-color: transparent; 398 background-color: transparent;
423 } 399 }
424 400
425 -.CodeMirror-lines {  
426 - min-height: 1px; /* prevents collapsing before first draw */  
427 - cursor: text;  
428 -}  
429 -  
430 .CodeMirror pre { 401 .CodeMirror pre {
431 position: relative; 402 position: relative;
432 z-index: 2; 403 z-index: 2;
  404 + padding: 0 4px; /* Horizontal padding of content */
433 margin: 0; 405 margin: 0;
434 overflow: visible; 406 overflow: visible;
435 font-family: inherit; 407 font-family: inherit;
@@ -497,11 +469,6 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket { @@ -497,11 +469,6 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {
497 visibility: hidden; 469 visibility: hidden;
498 } 470 }
499 471
500 -.CodeMirror-cursor {  
501 - position: absolute;  
502 - pointer-events: none;  
503 -}  
504 -  
505 .CodeMirror-measure pre { 472 .CodeMirror-measure pre {
506 position: static; 473 position: static;
507 } 474 }
src/components/CodeEditor/src/json-preview/JsonPreview.vue
@@ -8,11 +8,7 @@ @@ -8,11 +8,7 @@
8 import { defineComponent } from 'vue'; 8 import { defineComponent } from 'vue';
9 export default defineComponent({ 9 export default defineComponent({
10 name: 'JsonPreview', 10 name: 'JsonPreview',
11 - components: {  
12 - VueJsonPretty,  
13 - },  
14 - props: {  
15 - data: Object,  
16 - }, 11 + components: { VueJsonPretty },
  12 + props: { data: Object },
17 }); 13 });
18 </script> 14 </script>
src/components/Container/index.ts
1 -import CollapseContainer from './src/collapse/CollapseContainer.vue';  
2 -import ScrollContainer from './src/ScrollContainer.vue';  
3 -import LazyContainer from './src/LazyContainer.vue'; 1 +import { withInstall } from '/@/utils';
  2 +import collapseContainer from './src/collapse/CollapseContainer.vue';
  3 +import scrollContainer from './src/ScrollContainer.vue';
  4 +import lazyContainer from './src/LazyContainer.vue';
4 5
5 -export { CollapseContainer, ScrollContainer, LazyContainer };  
6 -export * from './src/types'; 6 +export const CollapseContainer = withInstall(collapseContainer);
  7 +export const ScrollContainer = withInstall(scrollContainer);
  8 +export const LazyContainer = withInstall(lazyContainer);
  9 +
  10 +export * from './src/typing';
src/components/Container/src/LazyContainer.vue
@@ -18,13 +18,10 @@ @@ -18,13 +18,10 @@
18 </template> 18 </template>
19 <script lang="ts"> 19 <script lang="ts">
20 import type { PropType } from 'vue'; 20 import type { PropType } from 'vue';
21 -  
22 import { defineComponent, reactive, onMounted, ref, toRef, toRefs } from 'vue'; 21 import { defineComponent, reactive, onMounted, ref, toRef, toRefs } from 'vue';
23 -  
24 import { Skeleton } from 'ant-design-vue'; 22 import { Skeleton } from 'ant-design-vue';
25 import { useTimeoutFn } from '/@/hooks/core/useTimeout'; 23 import { useTimeoutFn } from '/@/hooks/core/useTimeout';
26 import { useIntersectionObserver } from '/@/hooks/event/useIntersectionObserver'; 24 import { useIntersectionObserver } from '/@/hooks/event/useIntersectionObserver';
27 - import { propTypes } from '/@/utils/propTypes';  
28 25
29 interface State { 26 interface State {
30 isInit: boolean; 27 isInit: boolean;
@@ -32,36 +29,47 @@ @@ -32,36 +29,47 @@
32 intersectionObserverInstance: IntersectionObserver | null; 29 intersectionObserverInstance: IntersectionObserver | null;
33 } 30 }
34 31
  32 + const props = {
  33 + /**
  34 + * Waiting time, if the time is specified, whether visible or not, it will be automatically loaded after the specified time
  35 + */
  36 + timeout: { type: Number },
  37 + /**
  38 + * The viewport where the component is located.
  39 + * If the component is scrolling in the page container, the viewport is the container
  40 + */
  41 + viewport: {
  42 + type: (typeof window !== 'undefined' ? window.HTMLElement : Object) as PropType<HTMLElement>,
  43 + default: () => null,
  44 + },
  45 + /**
  46 + * Preload threshold, css unit
  47 + */
  48 + threshold: { type: String, default: '0px' },
  49 + /**
  50 + * The scroll direction of the viewport, vertical represents the vertical direction, horizontal represents the horizontal direction
  51 + */
  52 + direction: {
  53 + type: String,
  54 + default: 'vertical',
  55 + validator: (v) => ['vertical', 'horizontal'].includes(v),
  56 + },
  57 + /**
  58 + * The label name of the outer container that wraps the component
  59 + */
  60 + tag: { type: String, default: 'div' },
  61 + maxWaitingTime: { type: Number, default: 80 },
  62 + /**
  63 + * transition name
  64 + */
  65 + transitionName: { type: String, default: 'lazy-container' },
  66 + };
  67 +
35 export default defineComponent({ 68 export default defineComponent({
36 name: 'LazyContainer', 69 name: 'LazyContainer',
37 components: { Skeleton }, 70 components: { Skeleton },
38 inheritAttrs: false, 71 inheritAttrs: false,
39 - props: {  
40 - // Waiting time, if the time is specified, whether visible or not, it will be automatically loaded after the specified time  
41 - timeout: propTypes.number,  
42 -  
43 - // The viewport where the component is located. If the component is scrolling in the page container, the viewport is the container  
44 - viewport: {  
45 - type: (typeof window !== 'undefined'  
46 - ? window.HTMLElement  
47 - : Object) as PropType<HTMLElement>,  
48 - default: () => null,  
49 - },  
50 -  
51 - // Preload threshold, css unit  
52 - threshold: propTypes.string.def('0px'),  
53 -  
54 - // The scroll direction of the viewport, vertical represents the vertical direction, horizontal represents the horizontal direction  
55 - direction: propTypes.oneOf(['vertical', 'horizontal']).def('vertical'),  
56 -  
57 - // The label name of the outer container that wraps the component  
58 - tag: propTypes.string.def('div'),  
59 -  
60 - maxWaitingTime: propTypes.number.def(80),  
61 -  
62 - // transition name  
63 - transitionName: propTypes.string.def('lazy-container'),  
64 - }, 72 + props,
65 emits: ['init'], 73 emits: ['init'],
66 setup(props, { emit }) { 74 setup(props, { emit }) {
67 const elRef = ref(); 75 const elRef = ref();
src/components/Container/src/ScrollContainer.vue
@@ -7,7 +7,6 @@ @@ -7,7 +7,6 @@
7 <script lang="ts"> 7 <script lang="ts">
8 import { defineComponent, ref, unref, nextTick } from 'vue'; 8 import { defineComponent, ref, unref, nextTick } from 'vue';
9 import { Scrollbar, ScrollbarType } from '/@/components/Scrollbar'; 9 import { Scrollbar, ScrollbarType } from '/@/components/Scrollbar';
10 -  
11 import { useScrollTo } from '/@/hooks/event/useScrollTo'; 10 import { useScrollTo } from '/@/hooks/event/useScrollTo';
12 11
13 export default defineComponent({ 12 export default defineComponent({
@@ -16,12 +15,14 @@ @@ -16,12 +15,14 @@
16 setup() { 15 setup() {
17 const scrollbarRef = ref<Nullable<ScrollbarType>>(null); 16 const scrollbarRef = ref<Nullable<ScrollbarType>>(null);
18 17
  18 + /**
  19 + * Scroll to the specified position
  20 + */
19 function scrollTo(to: number, duration = 500) { 21 function scrollTo(to: number, duration = 500) {
20 const scrollbar = unref(scrollbarRef); 22 const scrollbar = unref(scrollbarRef);
21 if (!scrollbar) { 23 if (!scrollbar) {
22 return; 24 return;
23 } 25 }
24 -  
25 nextTick(() => { 26 nextTick(() => {
26 const wrap = unref(scrollbar.wrap); 27 const wrap = unref(scrollbar.wrap);
27 if (!wrap) { 28 if (!wrap) {
@@ -44,12 +45,14 @@ @@ -44,12 +45,14 @@
44 return scrollbar.wrap; 45 return scrollbar.wrap;
45 } 46 }
46 47
  48 + /**
  49 + * Scroll to the bottom
  50 + */
47 function scrollBottom() { 51 function scrollBottom() {
48 const scrollbar = unref(scrollbarRef); 52 const scrollbar = unref(scrollbarRef);
49 if (!scrollbar) { 53 if (!scrollbar) {
50 return; 54 return;
51 } 55 }
52 -  
53 nextTick(() => { 56 nextTick(() => {
54 const wrap = unref(scrollbar.wrap); 57 const wrap = unref(scrollbar.wrap);
55 if (!wrap) { 58 if (!wrap) {
src/components/Container/src/collapse/CollapseContainer.vue
1 <template> 1 <template>
2 <div :class="prefixCls"> 2 <div :class="prefixCls">
3 - <CollapseHeader  
4 - v-bind="getBindValues"  
5 - :prefixCls="prefixCls"  
6 - :show="show"  
7 - @expand="handleExpand"  
8 - > 3 + <CollapseHeader v-bind="$props" :prefixCls="prefixCls" :show="show" @expand="handleExpand">
9 <template #title> 4 <template #title>
10 <slot name="title"></slot> 5 <slot name="title"></slot>
11 </template> 6 </template>
@@ -16,13 +11,12 @@ @@ -16,13 +11,12 @@
16 11
17 <div class="p-2"> 12 <div class="p-2">
18 <CollapseTransition :enable="canExpan"> 13 <CollapseTransition :enable="canExpan">
19 - <Skeleton v-if="loading" :active="active" /> 14 + <Skeleton v-if="loading" :active="loading" />
20 <div :class="`${prefixCls}__body`" v-else v-show="show"> 15 <div :class="`${prefixCls}__body`" v-else v-show="show">
21 <slot></slot> 16 <slot></slot>
22 </div> 17 </div>
23 </CollapseTransition> 18 </CollapseTransition>
24 </div> 19 </div>
25 -  
26 <div :class="`${prefixCls}__footer`" v-if="$slots.footer"> 20 <div :class="`${prefixCls}__footer`" v-if="$slots.footer">
27 <slot name="footer"></slot> 21 <slot name="footer"></slot>
28 </div> 22 </div>
@@ -30,20 +24,41 @@ @@ -30,20 +24,41 @@
30 </template> 24 </template>
31 <script lang="ts"> 25 <script lang="ts">
32 import type { PropType } from 'vue'; 26 import type { PropType } from 'vue';
33 -  
34 - import { defineComponent, ref, computed } from 'vue';  
35 - 27 + import { defineComponent, ref } from 'vue';
36 // component 28 // component
37 import { Skeleton } from 'ant-design-vue'; 29 import { Skeleton } from 'ant-design-vue';
38 import { CollapseTransition } from '/@/components/Transition'; 30 import { CollapseTransition } from '/@/components/Transition';
39 import CollapseHeader from './CollapseHeader.vue'; 31 import CollapseHeader from './CollapseHeader.vue';
40 -  
41 import { triggerWindowResize } from '/@/utils/event'; 32 import { triggerWindowResize } from '/@/utils/event';
42 // hook 33 // hook
43 import { useTimeoutFn } from '/@/hooks/core/useTimeout'; 34 import { useTimeoutFn } from '/@/hooks/core/useTimeout';
44 - import { propTypes } from '/@/utils/propTypes';  
45 import { useDesign } from '/@/hooks/web/useDesign'; 35 import { useDesign } from '/@/hooks/web/useDesign';
46 36
  37 + const props = {
  38 + title: { type: String, default: '' },
  39 + loading: { type: Boolean },
  40 + /**
  41 + * Can it be expanded
  42 + */
  43 + canExpan: { type: Boolean, default: true },
  44 + /**
  45 + * Warm reminder on the right side of the title
  46 + */
  47 + helpMessage: {
  48 + type: [Array, String] as PropType<string[] | string>,
  49 + default: '',
  50 + },
  51 + /**
  52 + * Whether to trigger window.resize when expanding and contracting,
  53 + * Can adapt to tables and forms, when the form shrinks, the form triggers resize to adapt to the height
  54 + */
  55 + triggerWindowResize: { type: Boolean },
  56 + /**
  57 + * Delayed loading time
  58 + */
  59 + lazyTime: { type: Number, default: 0 },
  60 + };
  61 +
47 export default defineComponent({ 62 export default defineComponent({
48 name: 'CollapseContainer', 63 name: 'CollapseContainer',
49 components: { 64 components: {
@@ -51,23 +66,7 @@ @@ -51,23 +66,7 @@
51 CollapseHeader, 66 CollapseHeader,
52 CollapseTransition, 67 CollapseTransition,
53 }, 68 },
54 - props: {  
55 - title: propTypes.string.def(''),  
56 - // Can it be expanded  
57 - canExpan: propTypes.bool.def(true),  
58 - // Warm reminder on the right side of the title  
59 - helpMessage: {  
60 - type: [Array, String] as PropType<string[] | string>,  
61 - default: '',  
62 - },  
63 - // Whether to trigger window.resize when expanding and contracting,  
64 - // Can adapt to tables and forms, when the form shrinks, the form triggers resize to adapt to the height  
65 - triggerWindowResize: propTypes.bool,  
66 - loading: propTypes.bool.def(false),  
67 - active: propTypes.bool.def(true),  
68 - // Delayed loading time  
69 - lazyTime: propTypes.number.def(0),  
70 - }, 69 + props,
71 setup(props) { 70 setup(props) {
72 const show = ref(true); 71 const show = ref(true);
73 72
@@ -84,15 +83,10 @@ @@ -84,15 +83,10 @@
84 } 83 }
85 } 84 }
86 85
87 - const getBindValues = computed((): any => {  
88 - return props;  
89 - });  
90 -  
91 return { 86 return {
92 show, 87 show,
93 handleExpand, 88 handleExpand,
94 prefixCls, 89 prefixCls,
95 - getBindValues,  
96 }; 90 };
97 }, 91 },
98 }); 92 });
src/components/Container/src/collapse/CollapseHeader.vue
@@ -8,28 +8,31 @@ @@ -8,28 +8,31 @@
8 <slot name="title"></slot> 8 <slot name="title"></slot>
9 </template> 9 </template>
10 </BasicTitle> 10 </BasicTitle>
11 -  
12 <div :class="`${prefixCls}__action`"> 11 <div :class="`${prefixCls}__action`">
13 <slot name="action"></slot> 12 <slot name="action"></slot>
14 - <BasicArrow v-if="canExpan" top :expand="show" @click="$emit('expand')" /> 13 + <BasicArrow v-if="canExpan" up :expand="show" @click="$emit('expand')" />
15 </div> 14 </div>
16 </div> 15 </div>
17 </template> 16 </template>
18 <script lang="ts"> 17 <script lang="ts">
19 import { defineComponent } from 'vue'; 18 import { defineComponent } from 'vue';
20 import { BasicArrow, BasicTitle } from '/@/components/Basic'; 19 import { BasicArrow, BasicTitle } from '/@/components/Basic';
21 - import { propTypes } from '/@/utils/propTypes'; 20 +
  21 + const props = {
  22 + prefixCls: { type: String },
  23 + helpMessage: {
  24 + type: [Array, String] as PropType<string[] | string>,
  25 + default: '',
  26 + },
  27 + title: { type: String },
  28 + show: { type: Boolean },
  29 + canExpan: { type: Boolean },
  30 + };
22 31
23 export default defineComponent({ 32 export default defineComponent({
24 components: { BasicArrow, BasicTitle }, 33 components: { BasicArrow, BasicTitle },
25 inheritAttrs: false, 34 inheritAttrs: false,
26 - props: {  
27 - prefixCls: propTypes.string,  
28 - helpMessage: propTypes.string,  
29 - title: propTypes.string,  
30 - show: propTypes.bool,  
31 - canExpan: propTypes.bool,  
32 - }, 35 + props,
33 emits: ['expand'], 36 emits: ['expand'],
34 }); 37 });
35 </script> 38 </script>
src/components/Container/src/types.ts renamed to src/components/Container/src/typing.ts
src/components/FlowChart/index.ts
1 -import { install } from '/@/utils/install'; 1 +import { withInstall } from '/@/utils';
2 import flowChart from './src/FlowChart.vue'; 2 import flowChart from './src/FlowChart.vue';
3 3
4 -export const FlowChart = install(flowChart); 4 +export const FlowChart = withInstall(flowChart);
src/components/Form/src/components/FormAction.vue
@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 v-if="showAdvancedButton && !hideAdvanceBtn" 31 v-if="showAdvancedButton && !hideAdvanceBtn"
32 > 32 >
33 {{ isAdvanced ? t('component.form.putAway') : t('component.form.unfold') }} 33 {{ isAdvanced ? t('component.form.putAway') : t('component.form.unfold') }}
34 - <BasicArrow class="ml-1" :expand="!isAdvanced" top /> 34 + <BasicArrow class="ml-1" :expand="!isAdvanced" up />
35 </Button> 35 </Button>
36 <slot name="advanceAfter"></slot> 36 <slot name="advanceAfter"></slot>
37 </FormItem> 37 </FormItem>
@@ -99,16 +99,14 @@ @@ -99,16 +99,14 @@
99 return actionColOpt; 99 return actionColOpt;
100 }); 100 });
101 101
102 - const getResetBtnOptions = computed(  
103 - (): ButtonOptions => {  
104 - return Object.assign(  
105 - {  
106 - text: t('common.resetText'),  
107 - },  
108 - props.resetButtonOptions  
109 - );  
110 - }  
111 - ); 102 + const getResetBtnOptions = computed((): ButtonOptions => {
  103 + return Object.assign(
  104 + {
  105 + text: t('common.resetText'),
  106 + },
  107 + props.resetButtonOptions
  108 + );
  109 + });
112 110
113 const getSubmitBtnOptions = computed(() => { 111 const getSubmitBtnOptions = computed(() => {
114 return Object.assign( 112 return Object.assign(
src/utils/index.ts
1 import type { RouteLocationNormalized, RouteRecordNormalized } from 'vue-router'; 1 import type { RouteLocationNormalized, RouteRecordNormalized } from 'vue-router';
  2 +import type { App, Plugin } from 'vue';
  3 +
2 import { unref } from 'vue'; 4 import { unref } from 'vue';
3 import { isObject } from '/@/utils/is'; 5 import { isObject } from '/@/utils/is';
4 6
@@ -76,3 +78,14 @@ export function getRawRoute(route: RouteLocationNormalized): RouteLocationNormal @@ -76,3 +78,14 @@ export function getRawRoute(route: RouteLocationNormalized): RouteLocationNormal
76 : undefined) as RouteRecordNormalized[], 78 : undefined) as RouteRecordNormalized[],
77 }; 79 };
78 } 80 }
  81 +
  82 +export const withInstall = <T>(component: T, alias?: string) => {
  83 + const comp = component as any;
  84 + comp.install = (app: App) => {
  85 + app.component(comp.name || comp.displayName, component);
  86 + if (alias) {
  87 + app.config.globalProperties[alias] = component;
  88 + }
  89 + };
  90 + return component as T & Plugin;
  91 +};
src/utils/install.ts deleted 100644 โ†’ 0
1 -import { App, Plugin } from 'vue';  
2 -  
3 -export const install = <T>(component: T, alias?: string) => {  
4 - const C = component as any;  
5 - C.install = (app: App) => {  
6 - app.component(C.name, component);  
7 - if (alias) {  
8 - app.config.globalProperties[alias] = component;  
9 - }  
10 - };  
11 - return component as T & Plugin;  
12 -};  
src/views/sys/login/Login.vue
@@ -35,8 +35,7 @@ @@ -35,8 +35,7 @@
35 class=" 35 class="
36 my-auto 36 my-auto
37 mx-auto 37 mx-auto
38 - xl:ml-20  
39 - xl:bg-transparent 38 + xl:ml-20 xl:bg-transparent
40 px-5 39 px-5
41 py-8 40 py-8
42 sm:px-8 41 sm:px-8
types/module.d.ts
1 declare module '*.vue' { 1 declare module '*.vue' {
2 - import { defineComponent } from 'vue';  
3 - const Component: ReturnType<typeof defineComponent>; 2 + import { DefineComponent } from 'vue';
  3 + const Component: DefineComponent<{}, {}, any>;
4 export default Component; 4 export default Component;
5 } 5 }
6 6
yarn.lock
@@ -1191,10 +1191,10 @@ @@ -1191,10 +1191,10 @@
1191 dependencies: 1191 dependencies:
1192 cross-fetch "^3.0.6" 1192 cross-fetch "^3.0.6"
1193 1193
1194 -"@iconify/json@^1.1.353":  
1195 - version "1.1.353"  
1196 - resolved "https://registry.npmjs.org/@iconify/json/-/json-1.1.353.tgz#f9fb632da9b13cd79bcbea09b289610c46b87426"  
1197 - integrity sha512-gN+DccJUhO6iB7gBPbZXodDaaxZpZTLORixrXaXNmkSW7N/jqfzMCCogoeRWOydZzSgR7VESc2tMI4llEonkjg== 1194 +"@iconify/json@^1.1.354":
  1195 + version "1.1.354"
  1196 + resolved "https://registry.npmjs.org/@iconify/json/-/json-1.1.354.tgz#a2024ba18a48931e46121413ea743cddd3638fa6"
  1197 + integrity sha512-zFW5iV4FQmu/Mhn5fUNDtESLJFuQ8Mr9B0vBM2DmKbWJmTuMoF3sfV1w3tXMCvKFAXSTUcBTdXeEYP2rWnA8jA==
1198 1198
1199 "@intlify/core-base@9.1.6": 1199 "@intlify/core-base@9.1.6":
1200 version "9.1.6" 1200 version "9.1.6"
@@ -1688,10 +1688,10 @@ @@ -1688,10 +1688,10 @@
1688 resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.1.tgz#5e07e0cb2ff793aa7a1b41deae76221e6166049f" 1688 resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.1.tgz#5e07e0cb2ff793aa7a1b41deae76221e6166049f"
1689 integrity sha512-/tpUyFD7meeooTRwl3sYlihx2BrJE7q9XF71EguPFIySj9B7qgnRtHsHTho+0AUm4m1SvWGm6uSncrR94q6Vtw== 1689 integrity sha512-/tpUyFD7meeooTRwl3sYlihx2BrJE7q9XF71EguPFIySj9B7qgnRtHsHTho+0AUm4m1SvWGm6uSncrR94q6Vtw==
1690 1690
1691 -"@types/node@^15.12.1":  
1692 - version "15.12.1"  
1693 - resolved "https://registry.npmjs.org/@types/node/-/node-15.12.1.tgz#9b60797dee1895383a725f828a869c86c6caa5c2"  
1694 - integrity sha512-zyxJM8I1c9q5sRMtVF+zdd13Jt6RU4r4qfhTd7lQubyThvLfx6yYekWSQjGCGV2Tkecgxnlpl/DNlb6Hg+dmEw== 1691 +"@types/node@^15.12.2":
  1692 + version "15.12.2"
  1693 + resolved "https://registry.npmjs.org/@types/node/-/node-15.12.2.tgz#1f2b42c4be7156ff4a6f914b2fb03d05fa84e38d"
  1694 + integrity sha512-zjQ69G564OCIWIOHSXyQEEDpdpGl+G348RAKY0XXy9Z5kU9Vzv1GMNnkar/ZJ8dzXB3COzD9Mo9NtRZ4xfgUww==
1695 1695
1696 "@types/normalize-package-data@^2.4.0": 1696 "@types/normalize-package-data@^2.4.0":
1697 version "2.4.0" 1697 version "2.4.0"
@@ -1787,13 +1787,13 @@ @@ -1787,13 +1787,13 @@
1787 "@types/unist" "*" 1787 "@types/unist" "*"
1788 "@types/vfile-message" "*" 1788 "@types/vfile-message" "*"
1789 1789
1790 -"@typescript-eslint/eslint-plugin@^4.26.0":  
1791 - version "4.26.0"  
1792 - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.26.0.tgz#12bbd6ebd5e7fabd32e48e1e60efa1f3554a3242"  
1793 - integrity sha512-yA7IWp+5Qqf+TLbd8b35ySFOFzUfL7i+4If50EqvjT6w35X8Lv0eBHb6rATeWmucks37w+zV+tWnOXI9JlG6Eg== 1790 +"@typescript-eslint/eslint-plugin@^4.26.1":
  1791 + version "4.26.1"
  1792 + resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.26.1.tgz#b9c7313321cb837e2bf8bebe7acc2220659e67d3"
  1793 + integrity sha512-aoIusj/8CR+xDWmZxARivZjbMBQTT9dImUtdZ8tVCVRXgBUuuZyM5Of5A9D9arQPxbi/0rlJLcuArclz/rCMJw==
1794 dependencies: 1794 dependencies:
1795 - "@typescript-eslint/experimental-utils" "4.26.0"  
1796 - "@typescript-eslint/scope-manager" "4.26.0" 1795 + "@typescript-eslint/experimental-utils" "4.26.1"
  1796 + "@typescript-eslint/scope-manager" "4.26.1"
1797 debug "^4.3.1" 1797 debug "^4.3.1"
1798 functional-red-black-tree "^1.0.1" 1798 functional-red-black-tree "^1.0.1"
1799 lodash "^4.17.21" 1799 lodash "^4.17.21"
@@ -1801,60 +1801,60 @@ @@ -1801,60 +1801,60 @@
1801 semver "^7.3.5" 1801 semver "^7.3.5"
1802 tsutils "^3.21.0" 1802 tsutils "^3.21.0"
1803 1803
1804 -"@typescript-eslint/experimental-utils@4.26.0":  
1805 - version "4.26.0"  
1806 - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.26.0.tgz#ba7848b3f088659cdf71bce22454795fc55be99a"  
1807 - integrity sha512-TH2FO2rdDm7AWfAVRB5RSlbUhWxGVuxPNzGT7W65zVfl8H/WeXTk1e69IrcEVsBslrQSTDKQSaJD89hwKrhdkw== 1804 +"@typescript-eslint/experimental-utils@4.26.1":
  1805 + version "4.26.1"
  1806 + resolved "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.26.1.tgz#a35980a2390da9232aa206b27f620eab66e94142"
  1807 + integrity sha512-sQHBugRhrXzRCs9PaGg6rowie4i8s/iD/DpTB+EXte8OMDfdCG5TvO73XlO9Wc/zi0uyN4qOmX9hIjQEyhnbmQ==
1808 dependencies: 1808 dependencies:
1809 "@types/json-schema" "^7.0.7" 1809 "@types/json-schema" "^7.0.7"
1810 - "@typescript-eslint/scope-manager" "4.26.0"  
1811 - "@typescript-eslint/types" "4.26.0"  
1812 - "@typescript-eslint/typescript-estree" "4.26.0" 1810 + "@typescript-eslint/scope-manager" "4.26.1"
  1811 + "@typescript-eslint/types" "4.26.1"
  1812 + "@typescript-eslint/typescript-estree" "4.26.1"
1813 eslint-scope "^5.1.1" 1813 eslint-scope "^5.1.1"
1814 eslint-utils "^3.0.0" 1814 eslint-utils "^3.0.0"
1815 1815
1816 -"@typescript-eslint/parser@^4.26.0":  
1817 - version "4.26.0"  
1818 - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.26.0.tgz#31b6b732c9454f757b020dab9b6754112aa5eeaf"  
1819 - integrity sha512-b4jekVJG9FfmjUfmM4VoOItQhPlnt6MPOBUL0AQbiTmm+SSpSdhHYlwayOm4IW9KLI/4/cRKtQCmDl1oE2OlPg== 1816 +"@typescript-eslint/parser@^4.26.1":
  1817 + version "4.26.1"
  1818 + resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.26.1.tgz#cecfdd5eb7a5c13aabce1c1cfd7fbafb5a0f1e8e"
  1819 + integrity sha512-q7F3zSo/nU6YJpPJvQveVlIIzx9/wu75lr6oDbDzoeIRWxpoc/HQ43G4rmMoCc5my/3uSj2VEpg/D83LYZF5HQ==
1820 dependencies: 1820 dependencies:
1821 - "@typescript-eslint/scope-manager" "4.26.0"  
1822 - "@typescript-eslint/types" "4.26.0"  
1823 - "@typescript-eslint/typescript-estree" "4.26.0" 1821 + "@typescript-eslint/scope-manager" "4.26.1"
  1822 + "@typescript-eslint/types" "4.26.1"
  1823 + "@typescript-eslint/typescript-estree" "4.26.1"
1824 debug "^4.3.1" 1824 debug "^4.3.1"
1825 1825
1826 -"@typescript-eslint/scope-manager@4.26.0":  
1827 - version "4.26.0"  
1828 - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.26.0.tgz#60d1a71df162404e954b9d1c6343ff3bee496194"  
1829 - integrity sha512-G6xB6mMo4xVxwMt5lEsNTz3x4qGDt0NSGmTBNBPJxNsrTXJSm21c6raeYroS2OwQsOyIXqKZv266L/Gln1BWqg== 1826 +"@typescript-eslint/scope-manager@4.26.1":
  1827 + version "4.26.1"
  1828 + resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.26.1.tgz#075a74a15ff33ee3a7ed33e5fce16ee86689f662"
  1829 + integrity sha512-TW1X2p62FQ8Rlne+WEShyd7ac2LA6o27S9i131W4NwDSfyeVlQWhw8ylldNNS8JG6oJB9Ha9Xyc+IUcqipvheQ==
1830 dependencies: 1830 dependencies:
1831 - "@typescript-eslint/types" "4.26.0"  
1832 - "@typescript-eslint/visitor-keys" "4.26.0" 1831 + "@typescript-eslint/types" "4.26.1"
  1832 + "@typescript-eslint/visitor-keys" "4.26.1"
1833 1833
1834 -"@typescript-eslint/types@4.26.0":  
1835 - version "4.26.0"  
1836 - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.26.0.tgz#7c6732c0414f0a69595f4f846ebe12616243d546"  
1837 - integrity sha512-rADNgXl1kS/EKnDr3G+m7fB9yeJNnR9kF7xMiXL6mSIWpr3Wg5MhxyfEXy/IlYthsqwBqHOr22boFbf/u6O88A== 1834 +"@typescript-eslint/types@4.26.1":
  1835 + version "4.26.1"
  1836 + resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.26.1.tgz#9e7c523f73c34b04a765e4167ca5650436ef1d38"
  1837 + integrity sha512-STyMPxR3cS+LaNvS8yK15rb8Y0iL0tFXq0uyl6gY45glyI7w0CsyqyEXl/Fa0JlQy+pVANeK3sbwPneCbWE7yg==
1838 1838
1839 -"@typescript-eslint/typescript-estree@4.26.0":  
1840 - version "4.26.0"  
1841 - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.26.0.tgz#aea17a40e62dc31c63d5b1bbe9a75783f2ce7109"  
1842 - integrity sha512-GHUgahPcm9GfBuy3TzdsizCcPjKOAauG9xkz9TR8kOdssz2Iz9jRCSQm6+aVFa23d5NcSpo1GdHGSQKe0tlcbg== 1839 +"@typescript-eslint/typescript-estree@4.26.1":
  1840 + version "4.26.1"
  1841 + resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.26.1.tgz#b2ce2e789233d62283fae2c16baabd4f1dbc9633"
  1842 + integrity sha512-l3ZXob+h0NQzz80lBGaykdScYaiEbFqznEs99uwzm8fPHhDjwaBFfQkjUC/slw6Sm7npFL8qrGEAMxcfBsBJUg==
1843 dependencies: 1843 dependencies:
1844 - "@typescript-eslint/types" "4.26.0"  
1845 - "@typescript-eslint/visitor-keys" "4.26.0" 1844 + "@typescript-eslint/types" "4.26.1"
  1845 + "@typescript-eslint/visitor-keys" "4.26.1"
1846 debug "^4.3.1" 1846 debug "^4.3.1"
1847 globby "^11.0.3" 1847 globby "^11.0.3"
1848 is-glob "^4.0.1" 1848 is-glob "^4.0.1"
1849 semver "^7.3.5" 1849 semver "^7.3.5"
1850 tsutils "^3.21.0" 1850 tsutils "^3.21.0"
1851 1851
1852 -"@typescript-eslint/visitor-keys@4.26.0":  
1853 - version "4.26.0"  
1854 - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.26.0.tgz#26d2583169222815be4dcd1da4fe5459bc3bcc23"  
1855 - integrity sha512-cw4j8lH38V1ycGBbF+aFiLUls9Z0Bw8QschP3mkth50BbWzgFS33ISIgBzUMuQ2IdahoEv/rXstr8Zhlz4B1Zg== 1852 +"@typescript-eslint/visitor-keys@4.26.1":
  1853 + version "4.26.1"
  1854 + resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.26.1.tgz#0d55ea735cb0d8903b198017d6d4f518fdaac546"
  1855 + integrity sha512-IGouNSSd+6x/fHtYRyLOM6/C+QxMDzWlDtN41ea+flWuSF9g02iqcIlX8wM53JkfljoIjP0U+yp7SiTS1onEkw==
1856 dependencies: 1856 dependencies:
1857 - "@typescript-eslint/types" "4.26.0" 1857 + "@typescript-eslint/types" "4.26.1"
1858 eslint-visitor-keys "^2.0.0" 1858 eslint-visitor-keys "^2.0.0"
1859 1859
1860 "@vitejs/plugin-legacy@^1.4.1": 1860 "@vitejs/plugin-legacy@^1.4.1":
@@ -2033,25 +2033,25 @@ @@ -2033,25 +2033,25 @@
2033 resolved "https://registry.npmjs.org/@vue/shared/-/shared-3.0.11.tgz#20d22dd0da7d358bb21c17f9bde8628152642c77" 2033 resolved "https://registry.npmjs.org/@vue/shared/-/shared-3.0.11.tgz#20d22dd0da7d358bb21c17f9bde8628152642c77"
2034 integrity sha512-b+zB8A2so8eCE0JsxjL24J7vdGl8rzPQ09hZNhystm+KqSbKcAej1A+Hbva1rCMmTTqA+hFnUSDc5kouEo0JzA== 2034 integrity sha512-b+zB8A2so8eCE0JsxjL24J7vdGl8rzPQ09hZNhystm+KqSbKcAej1A+Hbva1rCMmTTqA+hFnUSDc5kouEo0JzA==
2035 2035
2036 -"@vueuse/core@^4.11.2":  
2037 - version "4.11.2"  
2038 - resolved "https://registry.yarnpkg.com/@vueuse/core/-/core-4.11.2.tgz#d4f54bd38e7c289c6f6357992c02423774cb26d9"  
2039 - integrity sha512-4A17XvKXpMR6829EVWvrdSKEeAjTWaiC3+xh51KEtlyCwvWQwZ0xwKDrbMj+e15ANxjHrTw/0bJVaWDfPQt/Pw== 2036 +"@vueuse/core@^5.0.1":
  2037 + version "5.0.1"
  2038 + resolved "https://registry.npmjs.org/@vueuse/core/-/core-5.0.1.tgz#94bbb6c71d95b79efbdb24111915775e61723f1b"
  2039 + integrity sha512-hzcyYNvW1p9ZEwm+oBaWrHgGx6S93pJBiXLZUj2pgCNiJZjaedoePT9xzesi1SBxeKcYxwToaTISLeKdE4VKeg==
2040 dependencies: 2040 dependencies:
2041 - "@vueuse/shared" "4.11.2" 2041 + "@vueuse/shared" "5.0.1"
2042 vue-demi "*" 2042 vue-demi "*"
2043 2043
2044 -"@vueuse/shared@4.11.2":  
2045 - version "4.11.2"  
2046 - resolved "https://registry.yarnpkg.com/@vueuse/shared/-/shared-4.11.2.tgz#1d56e08937600e3e65abf76f27cb4a1bc182adfd"  
2047 - integrity sha512-vTbTi6ou7ljH3CkKVoaIaCAoWB5T1ewSogpL6VnO1duMPNuiv7x8K/LunMbnTg4tVyt6QwaiCuEq/kyS6AUBRg== 2044 +"@vueuse/shared@5.0.1":
  2045 + version "5.0.1"
  2046 + resolved "https://registry.npmjs.org/@vueuse/shared/-/shared-5.0.1.tgz#3b6607ffc9e19b322c39be8a2f6b584d203a7c5e"
  2047 + integrity sha512-/+kRII9chn45PhFfRuPVbSQApJHhhqXFhPrWjnYKckMfQE9ZOuNMb1bmQnDTqzuNkoS/ENeHBMq0rnV/cfz/3Q==
2048 dependencies: 2048 dependencies:
2049 vue-demi "*" 2049 vue-demi "*"
2050 2050
2051 -"@windicss/plugin-utils@1.0.1":  
2052 - version "1.0.1"  
2053 - resolved "https://registry.npmjs.org/@windicss/plugin-utils/-/plugin-utils-1.0.1.tgz#f6281c91a37be5ea48eb4573cb511ccb82cce16a"  
2054 - integrity sha512-EHsGC9LGHC/3rWNiOHzkgkexwgmxfHsqvxBoh0hLJv1MPPhEsKv8dQbt34pVZgRsS/rAjiVe4bRRM5NLTy8cWA== 2051 +"@windicss/plugin-utils@1.0.2":
  2052 + version "1.0.2"
  2053 + resolved "https://registry.npmjs.org/@windicss/plugin-utils/-/plugin-utils-1.0.2.tgz#c34d6498058d5f4291805027d2ef6e34638a572a"
  2054 + integrity sha512-W9fZoPNsD3NMVyqzt9eNb1DNp9p4oy7EscCfGVIg1KBxAC8S+AnXtkaR/rad09y+aqzbILKNfzDKdimDR2FA9g==
2055 dependencies: 2055 dependencies:
2056 "@antfu/utils" "^0.1.6" 2056 "@antfu/utils" "^0.1.6"
2057 debug "^4.3.2" 2057 debug "^4.3.2"
@@ -2059,7 +2059,7 @@ @@ -2059,7 +2059,7 @@
2059 jiti "^1.10.1" 2059 jiti "^1.10.1"
2060 magic-string "^0.25.7" 2060 magic-string "^0.25.7"
2061 micromatch "^4.0.4" 2061 micromatch "^4.0.4"
2062 - windicss "^3.1.0" 2062 + windicss "^3.1.3"
2063 2063
2064 "@zxcvbn-ts/core@^0.3.0": 2064 "@zxcvbn-ts/core@^0.3.0":
2065 version "0.3.0" 2065 version "0.3.0"
@@ -4237,11 +4237,6 @@ esbuild@^0.11.5: @@ -4237,11 +4237,6 @@ esbuild@^0.11.5:
4237 resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.11.10.tgz#f5d39e4d9cc130b78d751664fef1b663240f5545" 4237 resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.11.10.tgz#f5d39e4d9cc130b78d751664fef1b663240f5545"
4238 integrity sha512-XvGbf+UreVFA24Tlk6sNOqNcvF2z49XAZt4E7A4H80+yqn944QOLTTxaU0lkdYNtZKFiITNea+VxmtrfjvnLPA== 4238 integrity sha512-XvGbf+UreVFA24Tlk6sNOqNcvF2z49XAZt4E7A4H80+yqn944QOLTTxaU0lkdYNtZKFiITNea+VxmtrfjvnLPA==
4239 4239
4240 -esbuild@^0.12.5:  
4241 - version "0.12.5"  
4242 - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.12.5.tgz#36076a6bc1966ba2741981d30512e95e8aaff495"  
4243 - integrity sha512-vcuP53pA5XiwUU4FnlXM+2PnVjTfHGthM7uP1gtp+9yfheGvFFbq/KyuESThmtoHPUrfZH5JpxGVJIFDVD1Egw==  
4244 -  
4245 esbuild@^0.12.6: 4240 esbuild@^0.12.6:
4246 version "0.12.6" 4241 version "0.12.6"
4247 resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.12.6.tgz#85bc755c7cf3005d4f34b4f10f98049ce0ee67ce" 4242 resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.12.6.tgz#85bc755c7cf3005d4f34b4f10f98049ce0ee67ce"
@@ -4371,13 +4366,13 @@ eslint@^7.28.0: @@ -4371,13 +4366,13 @@ eslint@^7.28.0:
4371 text-table "^0.2.0" 4366 text-table "^0.2.0"
4372 v8-compile-cache "^2.0.3" 4367 v8-compile-cache "^2.0.3"
4373 4368
4374 -esno@^0.7.0:  
4375 - version "0.7.0"  
4376 - resolved "https://registry.npmjs.org/esno/-/esno-0.7.0.tgz#2bec5e80eff53b60d528d6cf244445677cce7d4c"  
4377 - integrity sha512-tOcvMYheRc7dfrxWkm4bYgmMkcNZUSt892qVY66int4L+jkEJGc64fZLx8+cZffMIcHp+4IfaTB+r+X7SoRh+g== 4369 +esno@^0.7.1:
  4370 + version "0.7.1"
  4371 + resolved "https://registry.npmjs.org/esno/-/esno-0.7.1.tgz#ccd08436e0ca6e452fac1a994a7f08c61d07b7f1"
  4372 + integrity sha512-LzI42UXMSWtt9Z7iLfytY1jqO5Mz0980NI/y8txwpBCQmXLOpkA+KFzhD3IAY+QjBOOtvFmGh2j0VR8EHY57Ww==
4378 dependencies: 4373 dependencies:
4379 cross-spawn "^7.0.3" 4374 cross-spawn "^7.0.3"
4380 - esbuild "^0.12.5" 4375 + esbuild "^0.12.6"
4381 esbuild-node-loader "^0.0.0" 4376 esbuild-node-loader "^0.0.0"
4382 esbuild-register "^2.5.0" 4377 esbuild-register "^2.5.0"
4383 4378
@@ -8876,10 +8871,10 @@ rollup-plugin-visualizer@5.5.0: @@ -8876,10 +8871,10 @@ rollup-plugin-visualizer@5.5.0:
8876 source-map "^0.7.3" 8871 source-map "^0.7.3"
8877 yargs "^16.2.0" 8872 yargs "^16.2.0"
8878 8873
8879 -rollup@^2.38.5, rollup@^2.43.1, rollup@^2.45.2, rollup@^2.51.0:  
8880 - version "2.51.0"  
8881 - resolved "https://registry.npmjs.org/rollup/-/rollup-2.51.0.tgz#ffd847882283998fc8611cd57af917f173b4ab5c"  
8882 - integrity sha512-ITLt9sScNCBVspSHauw/W49lEZ0vjN8LyCzSNsNaqT67vTss2lYEfOyxltX8hjrhr1l/rQwmZ2wazzEqhZ/fUg== 8874 +rollup@^2.38.5, rollup@^2.43.1, rollup@^2.45.2, rollup@^2.51.1:
  8875 + version "2.51.1"
  8876 + resolved "https://registry.npmjs.org/rollup/-/rollup-2.51.1.tgz#87bcd4095fe79b14c9bec0edc7ffa44e4827f793"
  8877 + integrity sha512-8xfDbAtBleXotb6qKEHWuo/jkn94a9dVqGc7Rwl3sqspCVlnCfbRek7ldhCARSi7h32H0xR4QThm1t9zHN+3uw==
8883 optionalDependencies: 8878 optionalDependencies:
8884 fsevents "~2.3.1" 8879 fsevents "~2.3.1"
8885 8880
@@ -10652,15 +10647,15 @@ vite-plugin-theme@^0.8.1: @@ -10652,15 +10647,15 @@ vite-plugin-theme@^0.8.1:
10652 esbuild-plugin-alias "^0.1.2" 10647 esbuild-plugin-alias "^0.1.2"
10653 tinycolor2 "^1.4.2" 10648 tinycolor2 "^1.4.2"
10654 10649
10655 -vite-plugin-windicss@^1.0.1:  
10656 - version "1.0.1"  
10657 - resolved "https://registry.npmjs.org/vite-plugin-windicss/-/vite-plugin-windicss-1.0.1.tgz#6e455228b6c1cb7ad52ed8fb9408b39888d572c0"  
10658 - integrity sha512-+6iFKUC00G9xkR967xqbbAquaWAmgYT1rlBP7Bp6XCd9ire3b7tJTETtwSPAPAIp38OA/Xbp1MSaHhbl2LRxJg== 10650 +vite-plugin-windicss@^1.0.2:
  10651 + version "1.0.2"
  10652 + resolved "https://registry.npmjs.org/vite-plugin-windicss/-/vite-plugin-windicss-1.0.2.tgz#0d0fd1ff36dc81d348be755e59a8ee471941095c"
  10653 + integrity sha512-iTmkxm8Yp+ZCFWLOs//9q3d4hYaBVDlkRGLzNBUNvRW9AQFVea57ZPhglMm9xOt1nW/O68n5Rkg4/In8rrEjHQ==
10659 dependencies: 10654 dependencies:
10660 - "@windicss/plugin-utils" "1.0.1" 10655 + "@windicss/plugin-utils" "1.0.2"
10661 chalk "^4.1.1" 10656 chalk "^4.1.1"
10662 debug "^4.3.2" 10657 debug "^4.3.2"
10663 - windicss "^3.1.0" 10658 + windicss "^3.1.3"
10664 10659
10665 vite@2.3.3: 10660 vite@2.3.3:
10666 version "2.3.3" 10661 version "2.3.3"
@@ -10952,10 +10947,10 @@ widest-line@^2.0.0: @@ -10952,10 +10947,10 @@ widest-line@^2.0.0:
10952 dependencies: 10947 dependencies:
10953 string-width "^2.1.1" 10948 string-width "^2.1.1"
10954 10949
10955 -windicss@^3.1.0:  
10956 - version "3.1.0"  
10957 - resolved "https://registry.npmjs.org/windicss/-/windicss-3.1.0.tgz#bd679d51b7cabeba09077085706b48dbc1515730"  
10958 - integrity sha512-z49xITq4X1ltHIZyL4NwFTR2LXPJ0rbOOrhDXfLX+OfG4Au7+GAzqvNlzUfAaIbA8HSpnI04alQHUWH24KfNYA== 10950 +windicss@^3.1.3:
  10951 + version "3.1.3"
  10952 + resolved "https://registry.npmjs.org/windicss/-/windicss-3.1.3.tgz#a4b80af48bdd5d4be13520f700b497af455df700"
  10953 + integrity sha512-l7fpoba2LY9AYRy4UgcuOpbPsed8UsbpEQYUVWRR1wdAwiKxK6bGIMfpiKJtjPAPdh0GOGUqr6KJar0EDZSxzg==
10959 10954
10960 with@^7.0.0: 10955 with@^7.0.0:
10961 version "7.0.2" 10956 version "7.0.2"