gant-core 0.1.0 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,9 @@
1
- <!DOCTYPE html>
1
+ <!doctype html>
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+ <link rel="icon" type="image/png" href="/public/favicon.ico" />
5
7
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
8
  </head>
7
9
  <body>
@@ -13,6 +13,7 @@
13
13
  "sourceMap": true,
14
14
  "baseUrl": "../../",
15
15
  "strict": true,
16
+ "noImplicitAny": false,
16
17
  "resolveJsonModule": true,
17
18
  "allowSyntheticDefaultImports": true,
18
19
  "paths": {}
package/lib/index.d.ts CHANGED
@@ -90,6 +90,11 @@ interface SeedToken extends PresetColorType {
90
90
  * @descEN Code font, used for code, pre and kbd elements in Typography
91
91
  */
92
92
  fontFamilyCode: string;
93
+ /**
94
+ * @nameZH 代 Weight
95
+ * @nameEN Font Weight
96
+ */
97
+ fontWeight: string | number;
93
98
  /**
94
99
  * @nameZH 默认字号
95
100
  * @nameEN Default Font Size
@@ -245,11 +250,21 @@ interface SeedToken extends PresetColorType {
245
250
  * @default 50
246
251
  */
247
252
  layoutHeaderHeight: number;
253
+ /**
254
+ * @nameZH layout icon
255
+ * @default 24
256
+ */
257
+ layoutIconSize: number;
248
258
  /**
249
259
  * @nameZH 菜单宽度
250
260
  * @default 200
251
261
  */
252
262
  layoutSiderWidth: number;
263
+ /**
264
+ * @nameZH 导航菜单高度
265
+ * @default 40
266
+ */
267
+ layoutNavHeight: number;
253
268
  }
254
269
 
255
270
  interface ColorNeutralMapToken {
@@ -1584,9 +1599,9 @@ type DerivativeFunc<DesignToken extends TokenType, DerivativeToken extends Token
1584
1599
  type MappingAlgorithm = DerivativeFunc<SeedToken, MapToken>;
1585
1600
  type GlobalToken = AliasToken;
1586
1601
 
1587
- type ThemeType = 'default' | 'dark' | 'compact';
1602
+ type ThemeType = 'default' | 'dark' | 'compact' | 'meeting';
1588
1603
 
1589
- declare const getAliasToken: (seed?: SeedToken, type?: ThemeType) => AliasToken;
1604
+ declare const getAliasToken: (token?: Partial<AliasToken>, type?: ThemeType) => AliasToken;
1590
1605
 
1591
1606
  declare const seedToken: SeedToken;
1592
1607
 
@@ -1614,9 +1629,8 @@ declare function formatToken(derivativeToken: RawMergedToken): AliasToken;
1614
1629
  * @returns {string} The processed color represented as HEX
1615
1630
  */
1616
1631
  declare function lighten(color: string, amount: number): string;
1617
- declare function mapTheme(data: any): any;
1618
- declare function setCssVar(data: any, prefix?: string): void;
1619
- declare function restCssVar(): void;
1632
+ declare function getTokenCssVar(data: any, prefix?: string): any;
1633
+ declare const getAlphaColor: (baseColor: string, alpha: number) => string;
1620
1634
 
1621
1635
  declare const token: AliasToken;
1622
1636
 
@@ -1638,6 +1652,7 @@ interface ConfigMPAS {
1638
1652
  name: string;
1639
1653
  entryPath: string;
1640
1654
  template?: string;
1655
+ paths?: string[];
1641
1656
  }[];
1642
1657
  }
1643
1658
  interface GantCustomConfig {
@@ -1663,7 +1678,7 @@ type CONFIG_TYPE = {
1663
1678
  MAIN_CONFIG?: MAIN_CONFIG_TYPE;
1664
1679
  SYSMGMT_CONFIG?: SYSMGMT_CONFIG_TYPE;
1665
1680
  WATER_MARK_CONFIG?: WATER_MARK_CONFIG_TYPE;
1666
- THEME_CONFIG?: THEME_CONFIG_TYPE;
1681
+ THEME?: THEME_TYPE;
1667
1682
  };
1668
1683
  type BASE_CONFIG_TYPE = {
1669
1684
  title?: {
@@ -1687,6 +1702,7 @@ type LOGIN_CONFIG = {
1687
1702
  type MAIN_CONFIG_TYPE = {
1688
1703
  requestTimeout?: number;
1689
1704
  siderMenuCollapsed?: boolean;
1705
+ headerMenu?: boolean;
1690
1706
  navType?: 'breadcrumb' | 'tabs';
1691
1707
  menuHistory?: boolean;
1692
1708
  initialDashboardLayout?: any[];
@@ -1761,9 +1777,8 @@ type WATER_MARK_CONFIG_TYPE = {
1761
1777
  showTime?: boolean;
1762
1778
  status?: 'none' | 'guest' | 'company' | 'custom';
1763
1779
  };
1764
- type THEME_CONFIG_TYPE = {
1765
- theme?: string;
1766
- themeType?: 'light' | 'drak';
1780
+ type THEME_TYPE = {
1781
+ themeType?: ThemeType;
1767
1782
  token?: AliasToken;
1768
1783
  };
1769
1784
 
@@ -1867,12 +1882,13 @@ interface ServerMenu {
1867
1882
  id: string;
1868
1883
  name: string;
1869
1884
  path: string;
1870
- icon: string;
1885
+ icon?: string;
1871
1886
  countKey?: number;
1872
1887
  parentResourceId: string;
1873
1888
  type?: string;
1874
- leaf: boolean;
1889
+ leaf?: boolean;
1875
1890
  children?: ServerMenu[];
1891
+ seqNum?: number;
1876
1892
  }
1877
1893
  type ServerMenuData = ServerMenu[];
1878
1894
  type ServerMenuMap = {
@@ -1884,6 +1900,15 @@ interface UserIdentityType {
1884
1900
  loginType: string;
1885
1901
  userLoginName: string;
1886
1902
  userToken: string;
1903
+ userLanguage: string;
1904
+ }
1905
+ interface UserAggregateInfo {
1906
+ functions: string[];
1907
+ delegations: any[];
1908
+ isSuperAdmin: boolean;
1909
+ roles: any[];
1910
+ startMenus: any[];
1911
+ user: any;
1887
1912
  }
1888
1913
  interface User {
1889
1914
  extOrganizationIds?: string[];
@@ -1894,6 +1919,9 @@ interface User {
1894
1919
  userName: string;
1895
1920
  pictureId?: string;
1896
1921
  }
1922
+ type Perferences = {
1923
+ numberFormat?: string;
1924
+ };
1897
1925
  type SSOConfigType = {
1898
1926
  sso?: boolean;
1899
1927
  ssoUrlSearchParams?: string[];
@@ -1918,14 +1946,19 @@ interface ProductInfo {
1918
1946
  isProdEnv: boolean;
1919
1947
  productName: string;
1920
1948
  }
1949
+ interface GlobalOptions {
1950
+ loginConfig?: LOGIN_CONFIG;
1951
+ base?: string;
1952
+ menuData?: ServerMenuData | ((res: UserAggregateInfo) => ServerMenuData);
1953
+ }
1921
1954
 
1922
1955
  declare const MENU_HISTORY_UPDATE = "MENU_HISTORY_UPDATE";
1923
1956
  declare const MENU_BREADCRUMBS_UPDATE = "MENU_BREADCRUMBS_UPDATE";
1924
1957
  declare class MenuStore {
1925
1958
  menuDataMaps: ServerMenuMap;
1926
1959
  menuData: ServerMenuData;
1927
- menuMaps: {
1928
- [name: string]: any;
1960
+ menuPathMaps: {
1961
+ [name: string]: string;
1929
1962
  };
1930
1963
  breadcrumbs: any[];
1931
1964
  menuHistorys: {
@@ -1938,13 +1971,13 @@ declare class MenuStore {
1938
1971
  removeListenerMenuHistorys: (listener: (...args: any[]) => void) => void;
1939
1972
  addListenerBreadcrumbs: (listener: (...args: any[]) => void) => void;
1940
1973
  removeListenerBreadcrumbs: (listener: (...args: any[]) => void) => void;
1941
- menuAuth: (pathname: string) => boolean;
1942
1974
  getTreeMenuData: (data: ServerMenuData, childrenGroup: {
1943
1975
  [name: string]: ServerMenuData;
1944
1976
  }, parentPath?: string) => ServerMenu[];
1945
1977
  init: (menuData: ServerMenuData, userId: string) => void;
1946
- updateMenuMaps: (menuMaps: any) => void;
1947
- updatehistory: (historys: {
1978
+ updateMenuMaps: (menuPathMaps: any) => void;
1979
+ liseterHistorys: (pathname: string) => void;
1980
+ updatehistorys: (historys: {
1948
1981
  pathname: string;
1949
1982
  name: string;
1950
1983
  }[]) => void;
@@ -1983,7 +2016,7 @@ declare class BaseLogin {
1983
2016
  getRealPath: (pathname: string) => string;
1984
2017
  chekToken: () => Promise<any>;
1985
2018
  getLoginMethod: () => Promise<any>;
1986
- redirectBaseLogin: () => Promise<void>;
2019
+ redirectBaseLogin: () => Promise<boolean>;
1987
2020
  checkPassword: () => Promise<boolean>;
1988
2021
  refactorToken: () => Promise<void>;
1989
2022
  login: (params: BaseLoginParams) => Promise<{
@@ -2018,7 +2051,7 @@ declare class LoginStore extends BaseLogin {
2018
2051
  isNoLoginRequiredPage: () => boolean;
2019
2052
  loginOut: () => Promise<void>;
2020
2053
  loginAuthentication: (params: BeforeLoginCheckCodeParams) => Promise<void>;
2021
- redirectLogin: () => Promise<void>;
2054
+ redirectLogin: () => Promise<boolean>;
2022
2055
  }
2023
2056
 
2024
2057
  declare class UserStore {
@@ -2156,11 +2189,8 @@ declare class GlobalStoreClass {
2156
2189
  get userInfo(): User;
2157
2190
  get menuData(): ServerMenuData;
2158
2191
  findPlantform: () => Promise<void>;
2159
- getAggregateInfo: () => Promise<void>;
2160
- init: (options: {
2161
- loginConfig?: LOGIN_CONFIG;
2162
- base?: string;
2163
- }) => Promise<boolean>;
2192
+ getAggregateInfo: (menus?: ServerMenuData | ((res: UserAggregateInfo) => ServerMenuData)) => Promise<void>;
2193
+ init: (options: GlobalOptions) => Promise<boolean>;
2164
2194
  }
2165
2195
  declare const globalStore: GlobalStoreClass;
2166
2196
 
@@ -2268,15 +2298,24 @@ declare const initDynamicLang: (language: string, options?: {
2268
2298
  i18nCallback?: Callback;
2269
2299
  }) => Promise<i18next.i18n>;
2270
2300
  declare const tr: (key: string, agrs?: string[], type?: 'fe' | 'workflow') => any;
2301
+
2302
+ declare const getTraceId: (response: any) => any;
2303
+
2304
+ declare const getAntdLocaleKey: (localeKey: string) => string;
2271
2305
  declare const getLocaleKey: () => any;
2272
2306
  declare const setLocaleKey: (locale: string) => string;
2273
2307
 
2274
- declare const _default: ({ microServiceMap, secret, loginConfig, getLocaleKey, }: {
2308
+ declare const getRoutes: (routesMaps: any) => any[];
2309
+
2310
+ declare const useRequestMicroSevices: (microServiceMap?: any) => (config: InternalAxiosRequestConfig) => InternalAxiosRequestConfig;
2311
+ declare const useRequestHeader: (userLanguage: string) => (config: InternalAxiosRequestConfig) => InternalAxiosRequestConfig;
2312
+ declare const useResponsedecryptParse: (response: AxiosResponse) => AxiosResponse<any, any>;
2313
+ interface MainOptions extends GlobalOptions {
2275
2314
  microServiceMap?: any;
2276
2315
  secret?: boolean;
2277
2316
  locale?: string;
2278
- loginConfig?: LOGIN_CONFIG;
2279
- getLocaleKey: () => string;
2280
- }) => Promise<boolean>;
2317
+ dynamicLangCallback?: () => void;
2318
+ }
2319
+ declare const _default: ({ microServiceMap, secret, dynamicLangCallback, ...globalOptions }: MainOptions) => Promise<boolean>;
2281
2320
 
2282
- export { type AliasToken, type BASE_CONFIG_TYPE, type CONFIG_TYPE, type ColorMapToken, type ColorNeutralMapToken, type ColorPalettes, type CommonMapToken, type DerivativeFunc, type FontMapToken, type GantAxiosRequestConfig, type GantServerOptions, type GlobalToken, type HeightMapToken, type InternalAxiosRequestConfig, type LegacyColorPalettes, type MAIN_CONFIG_TYPE, MENU_BREADCRUMBS_UPDATE, MENU_HISTORY_UPDATE, type MapToken, type MappingAlgorithm, PROGRESS_UPDEDATE, type PresetColorKey, type PresetColorType, PresetColors, type SYSMGMT_CONFIG_TYPE, type SeedToken, type SizeMapToken, type StyleMapToken, type THEME_CONFIG_TYPE, type ThemeType, type TokenType, type GantUserConfig as UserConfig, WS_CONTENT_CLOSE, WS_CONTENT_ERROR, WS_CONTENT_SUCCESS, codeListStore, derivative as compactAlgorithm, _default$1 as companydataStore, derivative$1 as darkAlgorithm, decryptByAES, derivative$2 as defaultAlgorithm, emitter, encryptByAES, expireCache, formatToken as formatAliasToken, getAliasToken, getLocaleKey, getMaskHeaderKey, getSecretKey, globalStore, _default as init, initDynamicLang, lighten, loginStore, mapTheme, menuStore, parameterStore, Progress as progress, request as requeset, requestInstance, restCssVar, seedToken as seed, setCssVar, setLocaleKey, storage as storageStore, toBase64, token, tr, userStore, websocket };
2321
+ export { type AliasToken, type BASE_CONFIG_TYPE, type CONFIG_TYPE, type ColorMapToken, type ColorNeutralMapToken, type ColorPalettes, type CommonMapToken, type DerivativeFunc, type FontMapToken, type GantAxiosRequestConfig, type GantServerOptions, type GlobalOptions, type GlobalToken, type HeightMapToken, type InternalAxiosRequestConfig, type LOGIN_CONFIG, type Language, type LegacyColorPalettes, type LoginResultData, type MAIN_CONFIG_TYPE, MENU_BREADCRUMBS_UPDATE, MENU_HISTORY_UPDATE, type MainOptions, type MapToken, type MappingAlgorithm, PROGRESS_UPDEDATE, type Perferences, type PresetColorKey, type PresetColorType, PresetColors, type ProductInfo, type SSOConfigType, type SYSMGMT_CONFIG_TYPE, type SeedToken, type ServerMenu, type ServerMenuData, type ServerMenuMap, type SizeMapToken, type StyleMapToken, type THEME_TYPE, type ThemeType, type TokenType, type User, type UserAggregateInfo, type GantUserConfig as UserConfig, type UserIdentityType, WS_CONTENT_CLOSE, WS_CONTENT_ERROR, WS_CONTENT_SUCCESS, codeListStore, derivative as compactAlgorithm, _default$1 as companydataStore, derivative$1 as darkAlgorithm, decryptByAES, derivative$2 as defaultAlgorithm, emitter, encryptByAES, expireCache, formatToken as formatAliasToken, getAliasToken, getAlphaColor, getAntdLocaleKey, getLocaleKey, getMaskHeaderKey, getRoutes, getSecretKey, getTokenCssVar, getTraceId, globalStore, _default as init, initDynamicLang, lighten, loginStore, menuStore, parameterStore, Progress as progress, request, requestInstance, seedToken as seed, setLocaleKey, storage as storageStore, toBase64, token, tr, useRequestHeader, useRequestMicroSevices, useResponsedecryptParse, userStore, websocket };