@yh-ui/yh-ui 1.0.61 → 1.0.62

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.
package/dist/full.mjs CHANGED
@@ -2,7 +2,7 @@ import { inject, ref, unref, computed, onUnmounted, watch, useId as useId$1, sha
2
2
  import AsyncValidator from 'async-validator';
3
3
  import { autoUpdate, computePosition, offset, flip, shift, arrow } from '@floating-ui/dom';
4
4
 
5
- const version$1 = "1.0.61";
5
+ const version$1 = "1.0.62";
6
6
  const packageJson = {
7
7
  version: version$1};
8
8
 
@@ -476,6 +476,32 @@ const useNamespace = (block) => {
476
476
  };
477
477
  };
478
478
 
479
+ const configProviderContextKey = Symbol(
480
+ "configProviderContextKey"
481
+ );
482
+ const useConfig = () => {
483
+ const configRef = inject(configProviderContextKey, null);
484
+ const globalOptions = inject("yh-ui-options", null);
485
+ const globalSize = computed(() => {
486
+ const config = unref(configRef);
487
+ return config?.size || globalOptions?.size || "default";
488
+ });
489
+ const globalZIndex = computed(() => {
490
+ const config = unref(configRef);
491
+ return config?.zIndex || globalOptions?.zIndex || 2e3;
492
+ });
493
+ const globalLocale = computed(() => {
494
+ const config = unref(configRef);
495
+ return config?.locale || globalOptions?.locale;
496
+ });
497
+ return {
498
+ config: configRef,
499
+ globalSize,
500
+ globalZIndex,
501
+ globalLocale
502
+ };
503
+ };
504
+
479
505
  const defaultInitialZIndex = 2e3;
480
506
  const zIndexContextKey = Symbol("zIndexContextKey");
481
507
  const zIndexCounterKey = Symbol("zIndexCounterKey");
@@ -498,11 +524,11 @@ const createZIndexCounter = (initialValue = defaultInitialZIndex) => {
498
524
  return { current: initialValue };
499
525
  };
500
526
  const useZIndex = (zIndexOverrides) => {
501
- const injectedZIndex = inject(zIndexContextKey, void 0);
527
+ const { globalZIndex } = useConfig();
502
528
  const appCounter = inject(zIndexCounterKey, null);
503
529
  const initialZIndex = computed(() => {
504
530
  const override = unref(zIndexOverrides);
505
- return override ?? unref(injectedZIndex) ?? defaultInitialZIndex;
531
+ return override ?? unref(globalZIndex) ?? defaultInitialZIndex;
506
532
  });
507
533
  const currentZIndex = computed(() => initialZIndex.value);
508
534
  const nextZIndex = () => {
@@ -2232,32 +2258,6 @@ const en$1 = {
2232
2258
  }
2233
2259
  };
2234
2260
 
2235
- const configProviderContextKey = Symbol(
2236
- "configProviderContextKey"
2237
- );
2238
- const useConfig = () => {
2239
- const configRef = inject(configProviderContextKey, null);
2240
- const globalOptions = inject("yh-ui-options", null);
2241
- const globalSize = computed(() => {
2242
- const config = unref(configRef);
2243
- return config?.size || globalOptions?.size || "default";
2244
- });
2245
- const globalZIndex = computed(() => {
2246
- const config = unref(configRef);
2247
- return config?.zIndex || globalOptions?.zIndex || 2e3;
2248
- });
2249
- const globalLocale = computed(() => {
2250
- const config = unref(configRef);
2251
- return config?.locale || globalOptions?.locale;
2252
- });
2253
- return {
2254
- config: configRef,
2255
- globalSize,
2256
- globalZIndex,
2257
- globalLocale
2258
- };
2259
- };
2260
-
2261
2261
  var __create$2 = Object.create;
2262
2262
  var __defProp$2 = Object.defineProperty;
2263
2263
  var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
@@ -2567,12 +2567,7 @@ var dayjs$1 = typeof import_dayjs$1.default === "function" ? import_dayjs$1.defa
2567
2567
  );
2568
2568
  var dayjs_default$1 = dayjs$1;
2569
2569
 
2570
- const dayjsLocales = import.meta.glob(
2571
- ["../../../../node_modules/dayjs/locale/*.js", "../../../../dayjs/locale/*.js"],
2572
- {
2573
- eager: false
2574
- }
2575
- );
2570
+ const dayjsLocales = {};
2576
2571
  const loadedLocales = /* @__PURE__ */ new Set(["en"]);
2577
2572
  const localeMapping = {
2578
2573
  "zh-cn": "zh-cn",
@@ -30720,16 +30715,17 @@ const configProviderProps = {
30720
30715
  default: "default"
30721
30716
  },
30722
30717
  locale: {
30723
- type: Object,
30724
- default: zhCn
30718
+ type: Object
30725
30719
  },
30726
30720
  size: {
30727
- type: String,
30728
- default: "default"
30721
+ type: String
30729
30722
  },
30730
30723
  zIndex: {
30731
- type: Number,
30732
- default: 2e3
30724
+ type: Number
30725
+ },
30726
+ namespace: {
30727
+ type: String,
30728
+ default: ""
30733
30729
  },
30734
30730
  message: {
30735
30731
  type: Object,
@@ -30744,6 +30740,7 @@ const ConfigProvider = defineComponent({
30744
30740
  name: "YhConfigProvider",
30745
30741
  props: configProviderProps,
30746
30742
  setup(props, { slots }) {
30743
+ const globalOptions = inject("yh-ui-options", null);
30747
30744
  const containerRef = ref(null);
30748
30745
  const isMounted = ref(false);
30749
30746
  let themeManager = null;
@@ -30797,11 +30794,14 @@ const ConfigProvider = defineComponent({
30797
30794
  }
30798
30795
  );
30799
30796
  const config = computed(() => ({
30800
- size: props.size,
30801
- zIndex: props.zIndex,
30802
- locale: props.locale,
30797
+ size: props.size ?? globalOptions?.size ?? "default",
30798
+ zIndex: props.zIndex ?? globalOptions?.zIndex ?? 2e3,
30799
+ locale: props.locale ?? globalOptions?.locale ?? zhCn,
30803
30800
  message: props.message
30804
30801
  }));
30802
+ const mergedNamespace = computed(() => {
30803
+ return props.namespace || globalOptions?.namespace || defaultNamespace;
30804
+ });
30805
30805
  const themeStyles = computed(() => {
30806
30806
  const manager = getThemeManager();
30807
30807
  const themeState = manager.state;
@@ -30820,6 +30820,7 @@ const ConfigProvider = defineComponent({
30820
30820
  return manager.getThemeStyles(colors);
30821
30821
  });
30822
30822
  provide(configProviderContextKey, config);
30823
+ provide(namespaceContextKey, mergedNamespace);
30823
30824
  return () => {
30824
30825
  return h$2(
30825
30826
  "div",
package/dist/index.cjs CHANGED
@@ -186,7 +186,7 @@ Object.defineProperty(exports, "zhCn", {
186
186
  return _locale.zhCn;
187
187
  }
188
188
  });
189
- var _package = { default: { version: "1.0.61" } };
189
+ var _package = { default: { version: "1.0.62" } };
190
190
  var _components = _interopRequireWildcard(require("@yh-ui/components"));
191
191
  Object.keys(_components).forEach(function (key) {
192
192
  if (key === "default" || key === "__esModule") return;
@@ -280,4 +280,4 @@ module.exports = {
280
280
  install,
281
281
  createYhUI
282
282
  };
283
- const version = exports.version = "1.0.61";
283
+ const version = exports.version = "1.0.62";
package/dist/index.mjs CHANGED
@@ -45,4 +45,4 @@ export default {
45
45
  install,
46
46
  createYhUI
47
47
  };
48
- export const version = "1.0.61";
48
+ export const version = "1.0.62";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yh-ui/yh-ui",
3
- "version": "1.0.61",
3
+ "version": "1.0.62",
4
4
  "description": "YH-UI - A Modern Vue 3 Component Library",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -49,12 +49,12 @@
49
49
  ]
50
50
  },
51
51
  "dependencies": {
52
- "@yh-ui/components": "^1.0.61",
53
- "@yh-ui/hooks": "^1.0.61",
54
- "@yh-ui/icons": "^1.0.61",
55
- "@yh-ui/locale": "^1.0.61",
56
- "@yh-ui/theme": "^1.0.61",
57
- "@yh-ui/utils": "^1.0.61"
52
+ "@yh-ui/components": "^1.0.62",
53
+ "@yh-ui/hooks": "^1.0.62",
54
+ "@yh-ui/icons": "^1.0.62",
55
+ "@yh-ui/locale": "^1.0.62",
56
+ "@yh-ui/theme": "^1.0.62",
57
+ "@yh-ui/utils": "^1.0.62"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "vue": "^3.5.35",