gant-core 0.1.6 → 0.1.8

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,17 +1,29 @@
1
1
  const loaderUtils = require('loader-utils');
2
- const cssLoader = require('css-loader');
3
- const lessLoader = require('less-loader');
4
2
 
5
- module.exports = function (source) {
6
- const options = loaderUtils.getOptions(this) || {};
3
+ module.exports = function (source, ...ags) {
4
+ const { resourcePath } = this;
5
+ // 匹配 import 变量名 from 'xxx' 的正则表达式,同时找到.less、.css 或 .sass 文件
6
+ const importRegex = /import (\w*) from ['"](.+\.(less|css|sass))['"]/g;
7
+ let match = importRegex.exec(source);
8
+ console.log('\nresourcePath', source, ags, this);
7
9
 
8
- if (options.modules) {
9
- if (this.resourceQuery) {
10
- return cssLoader.call(this, source);
10
+ if (match) {
11
+ console.log('match', match);
12
+ const importVariable = match[1].trim();
13
+ const importPath = match[2];
14
+
15
+ if (!!importVariable) {
16
+ // 在 import styles from '.less'、'.css' 或 '.sass' 文件后添加参数启用 CSS Modules
17
+ const modifiedImport = `import ${importVariable} from '${importPath}?modules';`;
18
+ const modifiedSource = source.replace(match[0], modifiedImport);
19
+ console.log('modifiedSource', modifiedSource);
20
+ return modifiedSource;
11
21
  } else {
12
- return cssLoader.call(this, lessLoader.call(this, source));
22
+ // 处理其他情况
23
+ return source;
13
24
  }
14
25
  } else {
15
- return cssLoader.call(this, source);
26
+ // 处理 import 'xxx' 的情况
27
+ return source;
16
28
  }
17
29
  };
@@ -1,145 +1,145 @@
1
- // This file is generated by Umi automatically
2
1
  // DO NOT CHANGE IT MANUALLY!
3
- import { CONFIG_TYPE } from 'gant-core'
2
+ import { CONFIG_TYPE } from 'gant-core';
4
3
  type CSSModuleClasses = { readonly [key: string]: string };
5
- declare module '*.css' {
6
- const classes: CSSModuleClasses;
7
- export default classes;
8
- }
9
- declare module '*.scss' {
10
- const classes: CSSModuleClasses;
11
- export default classes;
12
- }
13
- declare module '*.sass' {
14
- const classes: CSSModuleClasses;
15
- export default classes;
16
- }
17
- declare module '*.less' {
18
- const classes: CSSModuleClasses;
19
- export default classes;
20
- }
21
- declare module '*.styl' {
22
- const classes: CSSModuleClasses;
23
- export default classes;
24
- }
25
- declare module '*.stylus' {
26
- const classes: CSSModuleClasses;
27
- export default classes;
28
- }
29
4
 
30
- // images
31
- declare module '*.jpg' {
32
- const src: string;
33
- export default src;
34
- }
35
- declare module '*.jpeg' {
36
- const src: string;
37
- export default src;
38
- }
39
- declare module '*.png' {
40
- const src: string;
41
- export default src;
42
- }
43
- declare module '*.gif' {
44
- const src: string;
45
- export default src;
46
- }
47
- declare module '*.svg' {
48
- export const ReactComponent: React.FunctionComponent<
49
- React.SVGProps<SVGSVGElement> & { title?: string }
50
- >;
5
+ declare global {
6
+ const tr: (name: string, ags?: any[], type?: 'fe' | 'workflow') => string;
7
+ type SizeType = 'small' | 'middle' | 'large' | undefined;
8
+ const BASE: string;
9
+ const microServiceMap: any;
10
+ const SETTING: CONFIG_TYPE;
11
+ declare module '*.css' {
12
+ const classes: CSSModuleClasses;
13
+ export default classes;
14
+ }
15
+ declare module '*.scss' {
16
+ const classes: CSSModuleClasses;
17
+ export default classes;
18
+ }
19
+ declare module '*.sass' {
20
+ const classes: CSSModuleClasses;
21
+ export default classes;
22
+ }
23
+ declare module '*.less' {
24
+ const classes: CSSModuleClasses;
25
+ export default classes;
26
+ }
27
+ declare module '*.styl' {
28
+ const classes: CSSModuleClasses;
29
+ export default classes;
30
+ }
31
+ declare module '*.stylus' {
32
+ const classes: CSSModuleClasses;
33
+ export default classes;
34
+ }
51
35
 
52
- const src: string;
53
- export default src;
54
- }
55
- declare module '*.ico' {
56
- const src: string;
57
- export default src;
58
- }
59
- declare module '*.webp' {
60
- const src: string;
61
- export default src;
62
- }
63
- declare module '*.avif' {
64
- const src: string;
65
- export default src;
66
- }
36
+ // images
37
+ declare module '*.jpg' {
38
+ const src: string;
39
+ export default src;
40
+ }
41
+ declare module '*.jpeg' {
42
+ const src: string;
43
+ export default src;
44
+ }
45
+ declare module '*.png' {
46
+ const src: string;
47
+ export default src;
48
+ }
49
+ declare module '*.gif' {
50
+ const src: string;
51
+ export default src;
52
+ }
53
+ declare module '*.svg' {
54
+ export const ReactComponent: React.FunctionComponent<
55
+ React.SVGProps<SVGSVGElement> & { title?: string }
56
+ >;
67
57
 
68
- // media
69
- declare module '*.mp4' {
70
- const src: string;
71
- export default src;
72
- }
73
- declare module '*.webm' {
74
- const src: string;
75
- export default src;
76
- }
77
- declare module '*.ogg' {
78
- const src: string;
79
- export default src;
80
- }
81
- declare module '*.mp3' {
82
- const src: string;
83
- export default src;
84
- }
85
- declare module '*.wav' {
86
- const src: string;
87
- export default src;
88
- }
89
- declare module '*.flac' {
90
- const src: string;
91
- export default src;
92
- }
93
- declare module '*.aac' {
94
- const src: string;
95
- export default src;
96
- }
58
+ const src: string;
59
+ export default src;
60
+ }
61
+ declare module '*.ico' {
62
+ const src: string;
63
+ export default src;
64
+ }
65
+ declare module '*.webp' {
66
+ const src: string;
67
+ export default src;
68
+ }
69
+ declare module '*.avif' {
70
+ const src: string;
71
+ export default src;
72
+ }
97
73
 
98
- // fonts
99
- declare module '*.woff' {
100
- const src: string;
101
- export default src;
102
- }
103
- declare module '*.woff2' {
104
- const src: string;
105
- export default src;
106
- }
107
- declare module '*.eot' {
108
- const src: string;
109
- export default src;
110
- }
111
- declare module '*.ttf' {
112
- const src: string;
113
- export default src;
114
- }
115
- declare module '*.otf' {
116
- const src: string;
117
- export default src;
118
- }
74
+ // media
75
+ declare module '*.mp4' {
76
+ const src: string;
77
+ export default src;
78
+ }
79
+ declare module '*.webm' {
80
+ const src: string;
81
+ export default src;
82
+ }
83
+ declare module '*.ogg' {
84
+ const src: string;
85
+ export default src;
86
+ }
87
+ declare module '*.mp3' {
88
+ const src: string;
89
+ export default src;
90
+ }
91
+ declare module '*.wav' {
92
+ const src: string;
93
+ export default src;
94
+ }
95
+ declare module '*.flac' {
96
+ const src: string;
97
+ export default src;
98
+ }
99
+ declare module '*.aac' {
100
+ const src: string;
101
+ export default src;
102
+ }
119
103
 
120
- // other
121
- declare module '*.wasm' {
122
- const initWasm: (
123
- options: WebAssembly.Imports,
124
- ) => Promise<WebAssembly.Exports>;
125
- export default initWasm;
126
- }
127
- declare module '*.webmanifest' {
128
- const src: string;
129
- export default src;
130
- }
131
- declare module '*.pdf' {
132
- const src: string;
133
- export default src;
134
- }
135
- declare module '*.txt' {
136
- const src: string;
137
- export default src;
138
- }
139
- declare global {
140
- const tr: (name: string, ags?: any[],type?:'fe' | 'workflow') => string;
141
- type SizeType = 'small' | 'middle' | 'large' | undefined;
142
- const BASE: string;
143
- const microServiceMap: any;
144
- const SETTING: CONFIG_TYPE;
104
+ // fonts
105
+ declare module '*.woff' {
106
+ const src: string;
107
+ export default src;
108
+ }
109
+ declare module '*.woff2' {
110
+ const src: string;
111
+ export default src;
112
+ }
113
+ declare module '*.eot' {
114
+ const src: string;
115
+ export default src;
116
+ }
117
+ declare module '*.ttf' {
118
+ const src: string;
119
+ export default src;
120
+ }
121
+ declare module '*.otf' {
122
+ const src: string;
123
+ export default src;
124
+ }
125
+
126
+ // other
127
+ declare module '*.wasm' {
128
+ const initWasm: (
129
+ options: WebAssembly.Imports,
130
+ ) => Promise<WebAssembly.Exports>;
131
+ export default initWasm;
132
+ }
133
+ declare module '*.webmanifest' {
134
+ const src: string;
135
+ export default src;
136
+ }
137
+ declare module '*.pdf' {
138
+ const src: string;
139
+ export default src;
140
+ }
141
+ declare module '*.txt' {
142
+ const src: string;
143
+ export default src;
144
+ }
145
145
  }
package/lib/index.d.ts CHANGED
@@ -1631,11 +1631,13 @@ declare function formatToken(derivativeToken: RawMergedToken): AliasToken;
1631
1631
  declare function lighten(color: string, amount: number): string;
1632
1632
  declare function getTokenCssVar(data: any, prefix?: string): any;
1633
1633
  declare const getAlphaColor: (baseColor: string, alpha: number) => string;
1634
+ declare const getDarkenSolidColor: (baseColor: string, brightness: number) => string;
1635
+ declare const getLightenSolidColor: (baseColor: string, brightness: number) => string;
1634
1636
 
1635
1637
  declare const token: AliasToken;
1636
1638
 
1637
1639
  declare global {
1638
- declare const __gant_start_time: string;
1640
+ const __gant_start_time: string;
1639
1641
  }
1640
1642
 
1641
1643
  interface Route {
@@ -2318,4 +2320,4 @@ interface MainOptions extends GlobalOptions {
2318
2320
  }
2319
2321
  declare const _default: ({ microServiceMap, secret, dynamicLangCallback, ...globalOptions }: MainOptions) => Promise<boolean>;
2320
2322
 
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 };
2323
+ 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, getDarkenSolidColor, getLightenSolidColor, 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 };
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import axios__default from 'axios';
2
2
  export * from 'axios';
3
- import { forEach, groupBy, reduce, find, pick, get as get$1, uniqueId, omit, isEmpty, cloneDeep, mapValues, uniqBy, mergeWith, toLower, isObject, has, join } from 'lodash-es';
3
+ import { forEach, groupBy, reduce, find, pick, get as get$1, uniqueId, omit, isEmpty, cloneDeep, mapValues, uniqBy, toLower, isObject, mergeWith, has, join } from 'lodash-es';
4
4
  import mitt from 'mitt';
5
5
  import CryptoJS from 'crypto-js';
6
6
 
@@ -5570,11 +5570,55 @@ function genCommonMapToken(token) {
5570
5570
  };
5571
5571
  }
5572
5572
 
5573
- const getAlphaColor$4 = (baseColor, alpha) => new TinyColor(baseColor).setAlpha(alpha).toRgbString();
5574
- const getSolidColor$2 = (baseColor, brightness) => {
5573
+ /**
5574
+ * Sums the passed percentage to the R, G or B of a HEX color
5575
+ * @param {string} color The color to change
5576
+ * @param {number} amount The amount to change the color by
5577
+ * @returns {string} The processed part of the color
5578
+ */
5579
+ function addLight(color, amount) {
5580
+ const cc = parseInt(color, 16) + amount;
5581
+ const c = cc > 255 ? 255 : cc;
5582
+ return c.toString(16).length > 1 ? c.toString(16) : `0${c.toString(16)}`;
5583
+ }
5584
+ /**
5585
+ * Lightens a 6 char HEX color according to the passed percentage
5586
+ * @param {string} color The color to change
5587
+ * @param {number} amount The amount to change the color by
5588
+ * @returns {string} The processed color represented as HEX
5589
+ */
5590
+ function lighten(color, amount) {
5591
+ color = color.indexOf('#') >= 0 ? color.substring(1, color.length) : color;
5592
+ amount = Math.trunc((255 * amount) / 100);
5593
+ return `#${addLight(color.substring(0, 2), amount)}${addLight(color.substring(2, 4), amount)}${addLight(color.substring(4, 6), amount)}`;
5594
+ }
5595
+ function getTokenCssVar(data, prefix) {
5596
+ if (typeof data !== 'object' || Array.isArray(data))
5597
+ return;
5598
+ const tokenCss = {};
5599
+ mapValues(data, (itemValue, name) => {
5600
+ const varName = prefix ? '--' + `${prefix}-` + name : '--' + name;
5601
+ const value = typeof itemValue === 'number' &&
5602
+ !['lineheight', 'opacity', 'weight'].some((key) => toLower(name).includes(key))
5603
+ ? itemValue + 'px'
5604
+ : itemValue;
5605
+ if (isObject(itemValue))
5606
+ return getTokenCssVar(value, name);
5607
+ tokenCss[varName] = value;
5608
+ });
5609
+ return tokenCss;
5610
+ }
5611
+ const getAlphaColor$1 = (baseColor, alpha) => {
5612
+ return new TinyColor(baseColor).setAlpha(alpha).toRgbString();
5613
+ };
5614
+ const getDarkenSolidColor = (baseColor, brightness) => {
5575
5615
  const instance = new TinyColor(baseColor);
5576
5616
  return instance.darken(brightness).toHexString();
5577
5617
  };
5618
+ const getLightenSolidColor = (baseColor, brightness) => {
5619
+ const instance = new TinyColor(baseColor);
5620
+ return instance.lighten(brightness).toHexString();
5621
+ };
5578
5622
 
5579
5623
  const generateColorPalettes$1 = (baseColor) => {
5580
5624
  const colors = generate(baseColor);
@@ -5600,20 +5644,20 @@ const generateNeutralColorPalettes$1 = (bgBaseColor, textBaseColor) => {
5600
5644
  return {
5601
5645
  colorBgBase,
5602
5646
  colorTextBase,
5603
- colorText: getAlphaColor$4(colorTextBase, 0.88),
5604
- colorTextSecondary: getAlphaColor$4(colorTextBase, 0.65),
5605
- colorTextTertiary: getAlphaColor$4(colorTextBase, 0.45),
5606
- colorTextQuaternary: getAlphaColor$4(colorTextBase, 0.25),
5607
- colorFill: getAlphaColor$4(colorTextBase, 0.15),
5608
- colorFillSecondary: getAlphaColor$4(colorTextBase, 0.06),
5609
- colorFillTertiary: getAlphaColor$4(colorTextBase, 0.04),
5610
- colorFillQuaternary: getAlphaColor$4(colorTextBase, 0.02),
5611
- colorBgLayout: getSolidColor$2(colorBgBase, 4),
5612
- colorBgContainer: getSolidColor$2(colorBgBase, 0),
5613
- colorBgElevated: getSolidColor$2(colorBgBase, 0),
5614
- colorBgSpotlight: getAlphaColor$4(colorTextBase, 0.85),
5615
- colorBorder: getSolidColor$2(colorBgBase, 15),
5616
- colorBorderSecondary: getSolidColor$2(colorBgBase, 6),
5647
+ colorText: getAlphaColor$1(colorTextBase, 0.88),
5648
+ colorTextSecondary: getAlphaColor$1(colorTextBase, 0.65),
5649
+ colorTextTertiary: getAlphaColor$1(colorTextBase, 0.45),
5650
+ colorTextQuaternary: getAlphaColor$1(colorTextBase, 0.25),
5651
+ colorFill: getAlphaColor$1(colorTextBase, 0.15),
5652
+ colorFillSecondary: getAlphaColor$1(colorTextBase, 0.06),
5653
+ colorFillTertiary: getAlphaColor$1(colorTextBase, 0.04),
5654
+ colorFillQuaternary: getAlphaColor$1(colorTextBase, 0.02),
5655
+ colorBgLayout: getDarkenSolidColor(colorBgBase, 4),
5656
+ colorBgContainer: getDarkenSolidColor(colorBgBase, 0),
5657
+ colorBgElevated: getDarkenSolidColor(colorBgBase, 0),
5658
+ colorBgSpotlight: getAlphaColor$1(colorTextBase, 0.85),
5659
+ colorBorder: getDarkenSolidColor(colorBgBase, 15),
5660
+ colorBorderSecondary: getDarkenSolidColor(colorBgBase, 6),
5617
5661
  };
5618
5662
  };
5619
5663
 
@@ -5697,12 +5741,6 @@ function derivative$3(token) {
5697
5741
  };
5698
5742
  }
5699
5743
 
5700
- const getAlphaColor$3 = (baseColor, alpha) => new TinyColor(baseColor).setAlpha(alpha).toRgbString();
5701
- const getSolidColor$1 = (baseColor, brightness) => {
5702
- const instance = new TinyColor(baseColor);
5703
- return instance.lighten(brightness).toHexString();
5704
- };
5705
-
5706
5744
  const generateColorPalettes = (baseColor) => {
5707
5745
  const colors = generate(baseColor, { theme: 'dark' });
5708
5746
  return {
@@ -5727,20 +5765,20 @@ const generateNeutralColorPalettes = (bgBaseColor, textBaseColor) => {
5727
5765
  return {
5728
5766
  colorBgBase,
5729
5767
  colorTextBase,
5730
- colorText: getAlphaColor$3(colorTextBase, 0.85),
5731
- colorTextSecondary: getAlphaColor$3(colorTextBase, 0.65),
5732
- colorTextTertiary: getAlphaColor$3(colorTextBase, 0.45),
5733
- colorTextQuaternary: getAlphaColor$3(colorTextBase, 0.25),
5734
- colorFill: getAlphaColor$3(colorTextBase, 0.18),
5735
- colorFillSecondary: getAlphaColor$3(colorTextBase, 0.12),
5736
- colorFillTertiary: getAlphaColor$3(colorTextBase, 0.08),
5737
- colorFillQuaternary: getAlphaColor$3(colorTextBase, 0.04),
5738
- colorBgElevated: getSolidColor$1(colorBgBase, 12),
5739
- colorBgContainer: getSolidColor$1(colorBgBase, 8),
5740
- colorBgLayout: getSolidColor$1(colorBgBase, 0),
5741
- colorBgSpotlight: getSolidColor$1(colorBgBase, 26),
5742
- colorBorder: getSolidColor$1(colorBgBase, 26),
5743
- colorBorderSecondary: getSolidColor$1(colorBgBase, 19),
5768
+ colorText: getAlphaColor$1(colorTextBase, 0.85),
5769
+ colorTextSecondary: getAlphaColor$1(colorTextBase, 0.65),
5770
+ colorTextTertiary: getAlphaColor$1(colorTextBase, 0.45),
5771
+ colorTextQuaternary: getAlphaColor$1(colorTextBase, 0.25),
5772
+ colorFill: getAlphaColor$1(colorTextBase, 0.18),
5773
+ colorFillSecondary: getAlphaColor$1(colorTextBase, 0.12),
5774
+ colorFillTertiary: getAlphaColor$1(colorTextBase, 0.08),
5775
+ colorFillQuaternary: getAlphaColor$1(colorTextBase, 0.04),
5776
+ colorBgElevated: getLightenSolidColor(colorBgBase, 12),
5777
+ colorBgContainer: getLightenSolidColor(colorBgBase, 8),
5778
+ colorBgLayout: getLightenSolidColor(colorBgBase, 0),
5779
+ colorBgSpotlight: getLightenSolidColor(colorBgBase, 26),
5780
+ colorBorder: getLightenSolidColor(colorBgBase, 26),
5781
+ colorBorderSecondary: getLightenSolidColor(colorBgBase, 19),
5744
5782
  };
5745
5783
  };
5746
5784
 
@@ -5805,32 +5843,26 @@ const derivative$1 = (token, mapToken) => {
5805
5843
  };
5806
5844
  };
5807
5845
 
5808
- const getAlphaColor$2 = (baseColor, alpha) => new TinyColor(baseColor).setAlpha(alpha).toRgbString();
5809
- const getSolidColor = (baseColor, brightness) => {
5810
- const instance = new TinyColor(baseColor);
5811
- return instance.darken(brightness).toHexString();
5812
- };
5813
-
5814
5846
  const generateMettingNeutralColorPalettes = (bgBaseColor, textBaseColor) => {
5815
5847
  const colorBgBase = bgBaseColor || '#fff';
5816
5848
  const colorTextBase = textBaseColor || '#000';
5817
5849
  return {
5818
5850
  colorBgBase,
5819
5851
  colorTextBase,
5820
- colorText: getAlphaColor$2(colorTextBase, 1),
5821
- colorTextSecondary: getAlphaColor$2(colorTextBase, 0.9),
5822
- colorTextTertiary: getAlphaColor$2(colorTextBase, 0.8),
5823
- colorTextQuaternary: getAlphaColor$2(colorTextBase, 0.7),
5824
- colorFill: getAlphaColor$2(colorTextBase, 0.5),
5825
- colorFillSecondary: getAlphaColor$2(colorTextBase, 0.4),
5826
- colorFillTertiary: getAlphaColor$2(colorTextBase, 0.3),
5827
- colorFillQuaternary: getAlphaColor$2(colorTextBase, 0.2),
5828
- colorBgLayout: getSolidColor(colorBgBase, 10),
5829
- colorBgContainer: getSolidColor(colorBgBase, 0),
5830
- colorBgElevated: getSolidColor(colorBgBase, 0),
5831
- colorBgSpotlight: getAlphaColor$2(colorTextBase, 0.1),
5832
- colorBorder: getSolidColor(colorBgBase, 30),
5833
- colorBorderSecondary: getSolidColor(colorBgBase, 24),
5852
+ colorText: getAlphaColor$1(colorTextBase, 1),
5853
+ colorTextSecondary: getAlphaColor$1(colorTextBase, 0.9),
5854
+ colorTextTertiary: getAlphaColor$1(colorTextBase, 0.8),
5855
+ colorTextQuaternary: getAlphaColor$1(colorTextBase, 0.7),
5856
+ colorFill: getAlphaColor$1(colorTextBase, 0.5),
5857
+ colorFillSecondary: getAlphaColor$1(colorTextBase, 0.4),
5858
+ colorFillTertiary: getAlphaColor$1(colorTextBase, 0.3),
5859
+ colorFillQuaternary: getAlphaColor$1(colorTextBase, 0.2),
5860
+ colorBgLayout: getDarkenSolidColor(colorBgBase, 10),
5861
+ colorBgContainer: getDarkenSolidColor(colorBgBase, 0),
5862
+ colorBgElevated: getDarkenSolidColor(colorBgBase, 0),
5863
+ colorBgSpotlight: getAlphaColor$1(colorTextBase, 0.1),
5864
+ colorBorder: getDarkenSolidColor(colorBgBase, 30),
5865
+ colorBorderSecondary: getDarkenSolidColor(colorBgBase, 24),
5834
5866
  };
5835
5867
  };
5836
5868
 
@@ -5869,7 +5901,7 @@ function derivative(token, mapToken) {
5869
5901
  function isStableColor(color) {
5870
5902
  return color >= 0 && color <= 255;
5871
5903
  }
5872
- function getAlphaColor$1(frontColor, backgroundColor) {
5904
+ function getAlphaColor(frontColor, backgroundColor) {
5873
5905
  const { r: fR, g: fG, b: fB, a: originAlpha } = new TinyColor(frontColor).toRgb();
5874
5906
  if (originAlpha < 1) {
5875
5907
  return frontColor;
@@ -5926,7 +5958,7 @@ function formatToken(derivativeToken) {
5926
5958
  colorBgContainerDisabled: mergedToken.colorFillTertiary,
5927
5959
  // ============== Split ============== //
5928
5960
  colorBorderBg: mergedToken.colorBgContainer,
5929
- colorSplit: getAlphaColor$1(mergedToken.colorBorderSecondary, mergedToken.colorBgContainer),
5961
+ colorSplit: getAlphaColor(mergedToken.colorBorderSecondary, mergedToken.colorBgContainer),
5930
5962
  // ============== Text ============== //
5931
5963
  colorTextPlaceholder: mergedToken.colorTextQuaternary,
5932
5964
  colorTextDisabled: mergedToken.colorTextQuaternary,
@@ -5939,8 +5971,8 @@ function formatToken(derivativeToken) {
5939
5971
  colorBgTextActive: mergedToken.colorFill,
5940
5972
  colorIcon: mergedToken.colorTextTertiary,
5941
5973
  colorIconHover: mergedToken.colorText,
5942
- colorErrorOutline: getAlphaColor$1(mergedToken.colorErrorBg, mergedToken.colorBgContainer),
5943
- colorWarningOutline: getAlphaColor$1(mergedToken.colorWarningBg, mergedToken.colorBgContainer),
5974
+ colorErrorOutline: getAlphaColor(mergedToken.colorErrorBg, mergedToken.colorBgContainer),
5975
+ colorWarningOutline: getAlphaColor(mergedToken.colorWarningBg, mergedToken.colorBgContainer),
5944
5976
  // Font
5945
5977
  fontSizeIcon: mergedToken.fontSizeSM,
5946
5978
  // Line
@@ -5955,7 +5987,7 @@ function formatToken(derivativeToken) {
5955
5987
  controlItemBgActiveHover: mergedToken.colorPrimaryBgHover,
5956
5988
  controlItemBgActiveDisabled: mergedToken.colorFill,
5957
5989
  controlTmpOutline: mergedToken.colorFillQuaternary,
5958
- controlOutline: getAlphaColor$1(mergedToken.colorPrimaryBg, mergedToken.colorBgContainer),
5990
+ controlOutline: getAlphaColor(mergedToken.colorPrimaryBg, mergedToken.colorBgContainer),
5959
5991
  lineType: mergedToken.lineType,
5960
5992
  borderRadius: mergedToken.borderRadius,
5961
5993
  borderRadiusXS: mergedToken.borderRadiusXS,
@@ -6096,46 +6128,6 @@ const PresetColors = [
6096
6128
  'gold',
6097
6129
  ];
6098
6130
 
6099
- /**
6100
- * Sums the passed percentage to the R, G or B of a HEX color
6101
- * @param {string} color The color to change
6102
- * @param {number} amount The amount to change the color by
6103
- * @returns {string} The processed part of the color
6104
- */
6105
- function addLight(color, amount) {
6106
- const cc = parseInt(color, 16) + amount;
6107
- const c = cc > 255 ? 255 : cc;
6108
- return c.toString(16).length > 1 ? c.toString(16) : `0${c.toString(16)}`;
6109
- }
6110
- /**
6111
- * Lightens a 6 char HEX color according to the passed percentage
6112
- * @param {string} color The color to change
6113
- * @param {number} amount The amount to change the color by
6114
- * @returns {string} The processed color represented as HEX
6115
- */
6116
- function lighten(color, amount) {
6117
- color = color.indexOf('#') >= 0 ? color.substring(1, color.length) : color;
6118
- amount = Math.trunc((255 * amount) / 100);
6119
- return `#${addLight(color.substring(0, 2), amount)}${addLight(color.substring(2, 4), amount)}${addLight(color.substring(4, 6), amount)}`;
6120
- }
6121
- function getTokenCssVar(data, prefix) {
6122
- if (typeof data !== 'object' || Array.isArray(data))
6123
- return;
6124
- const tokenCss = {};
6125
- mapValues(data, (itemValue, name) => {
6126
- const varName = prefix ? '--' + `${prefix}-` + name : '--' + name;
6127
- const value = typeof itemValue === 'number' &&
6128
- !['lineheight', 'opacity', 'weight'].some((key) => toLower(name).includes(key))
6129
- ? itemValue + 'px'
6130
- : itemValue;
6131
- if (isObject(itemValue))
6132
- return getTokenCssVar(value, name);
6133
- tokenCss[varName] = value;
6134
- });
6135
- return tokenCss;
6136
- }
6137
- const getAlphaColor = (baseColor, alpha) => new TinyColor(baseColor).setAlpha(alpha).toRgbString();
6138
-
6139
6131
  const token = getAliasToken();
6140
6132
 
6141
6133
  /**
@@ -6261,5 +6253,5 @@ var main = async ({ microServiceMap, secret, dynamicLangCallback, ...globalOptio
6261
6253
  return res;
6262
6254
  };
6263
6255
 
6264
- export { MENU_BREADCRUMBS_UPDATE, MENU_HISTORY_UPDATE, PROGRESS_UPDEDATE, PresetColors, WS_CONTENT_CLOSE, WS_CONTENT_ERROR, WS_CONTENT_SUCCESS, codeListStore, derivative$1 as compactAlgorithm, index as companydataStore, derivative$2 as darkAlgorithm, decryptByAES, derivative$3 as defaultAlgorithm, emitter, encryptByAES, expireCache, formatToken as formatAliasToken, getAliasToken, getAlphaColor, getAntdLocaleKey, getLocaleKey, getMaskHeaderKey, getRoutes, getSecretKey, getTokenCssVar, getTraceId, globalStore, main 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 };
6256
+ export { MENU_BREADCRUMBS_UPDATE, MENU_HISTORY_UPDATE, PROGRESS_UPDEDATE, PresetColors, WS_CONTENT_CLOSE, WS_CONTENT_ERROR, WS_CONTENT_SUCCESS, codeListStore, derivative$1 as compactAlgorithm, index as companydataStore, derivative$2 as darkAlgorithm, decryptByAES, derivative$3 as defaultAlgorithm, emitter, encryptByAES, expireCache, formatToken as formatAliasToken, getAliasToken, getAlphaColor$1 as getAlphaColor, getAntdLocaleKey, getDarkenSolidColor, getLightenSolidColor, getLocaleKey, getMaskHeaderKey, getRoutes, getSecretKey, getTokenCssVar, getTraceId, globalStore, main 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 };
6265
6257
  //# sourceMappingURL=index.js.map