@kengic/vue 0.25.4-beta.9 → 0.25.5-beta.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,6 @@ import windiCSS from 'vite-plugin-windicss';
11
11
  import { configCompressPlugin } from './compress';
12
12
  import { configHtmlPlugin } from './html';
13
13
  import { configImageminPlugin } from './imagemin';
14
- // import { configMockPlugin } from './mock';
15
14
  import { configPwaConfig } from './pwa';
16
15
  import { configStyleImportPlugin } from './styleImport';
17
16
  import { configSvgIconsPlugin } from './svgSprite';
@@ -46,9 +45,6 @@ export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
46
45
  // vite-plugin-svg-icons
47
46
  vitePlugins.push(configSvgIconsPlugin(isBuild));
48
47
 
49
- // vite-plugin-mock
50
- // VITE_USE_MOCK && vitePlugins.push(configMockPlugin(isBuild));
51
-
52
48
  // vite-plugin-purge-icons
53
49
  vitePlugins.push(purgeIcons());
54
50
 
@@ -1,3 +1,3 @@
1
+ export * from './setup/index';
1
2
  export * from './index.hooks';
2
3
  export * from './index.store';
3
- export * from './setup';
@@ -0,0 +1,3 @@
1
+ export * from './setup';
2
+ export * from './setupKgLocale';
3
+ export * from './setupKgStore';
@@ -1,24 +1,7 @@
1
- import { Pinia, StoreDefinition } from 'pinia';
1
+ import { StoreDefinition } from 'pinia';
2
2
  import { App } from 'vue';
3
3
  import { Router } from 'vue-router';
4
- import { IKgOption, P } from './index.store';
5
- /**
6
- * 配置 pinia 实例.
7
- * @param pinia pinia 实例.
8
- */
9
- export declare function setPinia(pinia: Pinia): void;
10
- /**
11
- * 获取 pinia 实例.
12
- * @return {} pinia 实例.
13
- * @throws Error 如果 pinia 实例为空, 抛错.
14
- */
15
- export declare function getPinia(): Pinia | null;
16
- /**
17
- * 设置 pinia.
18
- *
19
- * @param pinia pinia.
20
- */
21
- export declare function setupKgStore(pinia: Pinia): void;
4
+ import { IKgOption, P } from '../index.store';
22
5
  export declare type IKgOptions = {
23
6
  /**
24
7
  * 语言数据.
@@ -38,6 +21,7 @@ export declare type IKgOptions = {
38
21
  };
39
22
  /**
40
23
  * 初始化组件库.
24
+ *
41
25
  * @param options 参数.
42
26
  */
43
- export declare function setup(options: IKgOptions): void;
27
+ export declare function setup(options: IKgOptions): Promise<void>;
@@ -0,0 +1,29 @@
1
+ import { DropMenu } from '../../project/src/components/Dropdown/src/typing';
2
+ import { LocaleSetting, LocaleType } from '../../project/types/config';
3
+ export declare const LOCALE: {
4
+ KO_KR: LocaleType;
5
+ EN: LocaleType;
6
+ VI_VN: LocaleType;
7
+ ZH_CN: LocaleType;
8
+ ES_ES: LocaleType;
9
+ FR_FR: LocaleType;
10
+ KM_KH: LocaleType;
11
+ };
12
+ export declare let localeList: DropMenu[];
13
+ export declare const localeSetting: LocaleSetting;
14
+ export declare type IKgLocaleOptions = {
15
+ /**
16
+ * <p>可选语言. 如果为空则为所有语言.</p>
17
+ */
18
+ availableLocales?: Array<LocaleType>;
19
+ /**
20
+ * 默认语言.
21
+ *
22
+ * @default 'zh_CN'.
23
+ */
24
+ defaultLocale?: LocaleType;
25
+ };
26
+ /**
27
+ * 配置语言.
28
+ */
29
+ export declare function setupKgLocale(options?: IKgLocaleOptions): void;
@@ -0,0 +1,18 @@
1
+ import { Pinia } from 'pinia';
2
+ /**
3
+ * 配置 pinia 实例.
4
+ * @param pinia pinia 实例.
5
+ */
6
+ export declare function setPinia(pinia: Pinia): void;
7
+ /**
8
+ * 获取 pinia 实例.
9
+ * @return {} pinia 实例.
10
+ * @throws Error 如果 pinia 实例为空, 抛错.
11
+ */
12
+ export declare function getPinia(): Pinia | null;
13
+ /**
14
+ * 设置 pinia.
15
+ *
16
+ * @param pinia pinia.
17
+ */
18
+ export declare function setupKgStore(pinia: Pinia): void;
@@ -2,7 +2,7 @@ export interface DropMenu {
2
2
  onClick?: Fn;
3
3
  to?: string;
4
4
  icon?: string;
5
- event: string | number;
5
+ event: any;
6
6
  text: string;
7
7
  disabled?: boolean;
8
8
  divider?: boolean;
@@ -1,6 +1,6 @@
1
1
  export declare const TOKEN_KEY = "TOKEN__";
2
- export declare const LOCALE_KEY = "LOCALE__";
3
2
  export declare const USER_INFO_KEY = "USER__INFO__";
3
+ export declare const LOCALE_KEY = "LOCALE__";
4
4
  export declare const ROLES_KEY = "ROLES__KEY__";
5
5
  export declare const USER_WAREHOUSE_KEY = "USER_WAREHOUSE__KEY__";
6
6
  export declare const DB_DICT_DATA_KEY = "UI_CACHE_DB_DICT_DATA";
@@ -1,2 +1,3 @@
1
1
  export * from './helper';
2
+ export * from './setupI18n';
2
3
  export * from './useLocale';
@@ -0,0 +1,4 @@
1
+ import type { App } from 'vue';
2
+ import { createI18n } from 'vue-i18n';
3
+ export declare let i18n: ReturnType<typeof createI18n>;
4
+ export declare function setupI18n(app: App): Promise<void>;
@@ -1,4 +1,3 @@
1
1
  export * from './encryptionSetting';
2
2
  export * from './componentSetting';
3
- export * from './localeSetting';
4
3
  export * from './designSetting';
@@ -16,15 +16,7 @@ export declare const _useLocaleStore: import("pinia").StoreDefinition<"app-local
16
16
  pathTitleMap: object;
17
17
  } & import("pinia").PiniaCustomStateProperties<LocaleState>) => (path: any) => any;
18
18
  }, {
19
- /**
20
- * Set up multilingual information and cache
21
- * @param info multilingual info
22
- */
23
19
  setLocaleInfo(info: Partial<LocaleSetting>): void;
24
- /**
25
- * Initialize multilingual information and load the existing configuration from the local cache
26
- */
27
- initLocale(): void;
28
20
  setPathTitle(path: any, title: any): void;
29
21
  }>;
30
22
  export declare function useLocaleStore(): import("pinia").Store<"app-locale", LocaleState, {
@@ -40,15 +32,7 @@ export declare function useLocaleStore(): import("pinia").Store<"app-locale", Lo
40
32
  pathTitleMap: object;
41
33
  } & import("pinia").PiniaCustomStateProperties<LocaleState>) => (path: any) => any;
42
34
  }, {
43
- /**
44
- * Set up multilingual information and cache
45
- * @param info multilingual info
46
- */
47
35
  setLocaleInfo(info: Partial<LocaleSetting>): void;
48
- /**
49
- * Initialize multilingual information and load the existing configuration from the local cache
50
- */
51
- initLocale(): void;
52
36
  setPathTitle(path: any, title: any): void;
53
37
  }>;
54
38
  export {};
@@ -35,7 +35,7 @@ declare class KgLogger {
35
35
  * @param collapsed 是否折叠.
36
36
  * @param style 样式.
37
37
  */
38
- static log(level: "error" | "debug" | "info" | "warn" | "deprecated" | undefined, message: string, args?: Record<string, any>, collapsed?: boolean, style?: string | null): void;
38
+ static log(level: "debug" | "info" | "warn" | "error" | "deprecated" | undefined, message: string, args?: Record<string, any>, collapsed?: boolean, style?: string | null): void;
39
39
  /**
40
40
  * 打印警告日志.
41
41
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/vue",
3
- "version": "0.25.4-beta.9",
3
+ "version": "0.25.5-beta.0",
4
4
  "scripts": {
5
5
  "build": "npm run switch-node-version && rimraf dist && vue-tsc && vite build",
6
6
  "build:dev": "npm run switch-node-version && rimraf dist && vue-tsc && vite build --mode development",
@@ -1,7 +0,0 @@
1
- import { LocaleSetting, LocaleType } from '../../types/config';
2
- import { DropMenu } from '../components/Dropdown/src/typing';
3
- export declare const LOCALE: {
4
- [key: string]: LocaleType;
5
- };
6
- export declare const localeList: DropMenu[];
7
- export declare const localeSetting: LocaleSetting;