pro-design-vue 1.2.8 → 1.2.10

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.
Files changed (27) hide show
  1. package/dist/index.full.js +33 -19
  2. package/dist/index.full.min.js +8 -8
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +8 -8
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +33 -19
  7. package/es/packages/components/config-provider/src/config-provider.vue2.mjs +9 -3
  8. package/es/packages/components/config-provider/src/config-provider.vue2.mjs.map +1 -1
  9. package/es/packages/components/config-provider/src/update-css-variables.mjs.map +1 -1
  10. package/es/packages/components/config-provider/src/useCssVariables.mjs +21 -13
  11. package/es/packages/components/config-provider/src/useCssVariables.mjs.map +1 -1
  12. package/es/packages/utils/color/generator.mjs +1 -1
  13. package/es/packages/utils/color/generator.mjs.map +1 -1
  14. package/es/version.d.ts +1 -1
  15. package/es/version.mjs +1 -1
  16. package/es/version.mjs.map +1 -1
  17. package/lib/packages/components/config-provider/src/config-provider.vue2.js +9 -3
  18. package/lib/packages/components/config-provider/src/config-provider.vue2.js.map +1 -1
  19. package/lib/packages/components/config-provider/src/update-css-variables.js.map +1 -1
  20. package/lib/packages/components/config-provider/src/useCssVariables.js +21 -13
  21. package/lib/packages/components/config-provider/src/useCssVariables.js.map +1 -1
  22. package/lib/packages/utils/color/generator.js +1 -1
  23. package/lib/packages/utils/color/generator.js.map +1 -1
  24. package/lib/version.d.ts +1 -1
  25. package/lib/version.js +1 -1
  26. package/lib/version.js.map +1 -1
  27. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- /*! Pro Design Vue v1.2.8 */
1
+ /*! Pro Design Vue v1.2.10 */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('ant-design-vue'), require('vue'), require('ant-design-vue/es/locale/zh_CN.js')) :
@@ -32,7 +32,7 @@
32
32
  const DEFAULT_NAMESPACE = "pro";
33
33
  const DEFAULT_LOCALE = "zh-CN";
34
34
 
35
- const version$1 = "1.2.8";
35
+ const version$1 = "1.2.10";
36
36
 
37
37
  const makeInstaller = (components = []) => {
38
38
  const install = (app) => {
@@ -3391,7 +3391,7 @@
3391
3391
  if (colorValue) {
3392
3392
  const hslColor = convertToHslCssVar(colorValue);
3393
3393
  colorVariables[`--${namespace}-${name}-${key}`] = hslColor;
3394
- if (alias) {
3394
+ if (alias && alias !== name) {
3395
3395
  colorVariables[`--${namespace}-${alias}-${key}`] = hslColor;
3396
3396
  }
3397
3397
  if (key === "500") {
@@ -8309,18 +8309,24 @@
8309
8309
  vue.watch(
8310
8310
  [token, isDark],
8311
8311
  ([newToken, dark], [oldToken]) => {
8312
+ const changedColorVariables = [
8313
+ { alias: "primary", color: newToken.colorPrimary, name: "primary", key: "colorPrimary" },
8314
+ { alias: "warning", color: newToken.colorWarning, name: "yellow", key: "colorWarning" },
8315
+ { alias: "success", color: newToken.colorSuccess, name: "green", key: "colorSuccess" },
8316
+ { alias: "error", color: newToken.colorError, name: "red", key: "colorError" }
8317
+ ].filter((item) => {
8318
+ const defaultColor = dark ? defaultDarkToken[item.key] : defaultToken[item.key];
8319
+ const oldColor = (oldToken == null ? void 0 : oldToken[item.key]) || defaultColor;
8320
+ return newToken[item.key] !== defaultColor || newToken[item.key] === defaultColor && oldColor !== defaultColor;
8321
+ });
8312
8322
  const colorVariables = generatorColorVariables(
8313
- [
8314
- { color: newToken.colorPrimary, name: "primary", key: "colorPrimary" },
8315
- { alias: "warning", color: newToken.colorWarning, name: "yellow", key: "colorWarning" },
8316
- { alias: "success", color: newToken.colorSuccess, name: "green", key: "colorSuccess" },
8317
- { alias: "error", color: newToken.colorError, name: "red", key: "colorError" }
8318
- ].filter((item) => {
8319
- const defaultColor = dark ? defaultDarkToken[item.key] : defaultToken[item.key];
8320
- const oldColor = (oldToken == null ? void 0 : oldToken[item.key]) || defaultColor;
8321
- return newToken[item.key] !== defaultColor || newToken[item.key] === defaultColor && oldColor !== defaultColor;
8322
- }),
8323
- dark,
8323
+ changedColorVariables,
8324
+ false,
8325
+ DEFAULT_NAMESPACE
8326
+ );
8327
+ const darkColorVariables = generatorColorVariables(
8328
+ changedColorVariables,
8329
+ true,
8324
8330
  DEFAULT_NAMESPACE
8325
8331
  );
8326
8332
  const colorMappings = {
@@ -8335,9 +8341,11 @@
8335
8341
  document.documentElement.style.setProperty(targetVar, colorValue);
8336
8342
  }
8337
8343
  });
8344
+ updateCSSVariables(colorVariables);
8338
8345
  updateCSSVariables(
8339
- colorVariables,
8340
- dark ? ".dark, .dark[data-theme='custom'], .dark[data-theme='default']" : ":root"
8346
+ darkColorVariables,
8347
+ ".dark, .dark[data-theme='custom'], .dark[data-theme='default']",
8348
+ "__pro-dark-styles__"
8341
8349
  );
8342
8350
  if (defaultToken.borderRadius !== newToken.borderRadius) {
8343
8351
  document.documentElement.style.setProperty(
@@ -8480,13 +8488,19 @@
8480
8488
  algorithm.push((_d = __props.theme) == null ? void 0 : _d.algorithm);
8481
8489
  }
8482
8490
  }
8491
+ const mergeToken = {
8492
+ ...defaultToken,
8493
+ ...(_e = __props.theme) == null ? void 0 : _e.token,
8494
+ ...__props.token
8495
+ };
8483
8496
  return {
8484
8497
  ...__props.theme,
8485
8498
  algorithm,
8486
8499
  token: {
8487
- ...defaultToken,
8488
- ...(_e = __props.theme) == null ? void 0 : _e.token,
8489
- ...__props.token
8500
+ ...mergeToken,
8501
+ colorLink: mergeToken.colorPrimary,
8502
+ colorLinkActive: "hsl(var(--pro-primary-600))",
8503
+ colorLinkHover: "hsl(var(--pro-primary-400))"
8490
8504
  }
8491
8505
  };
8492
8506
  });