@yh-ui/hooks 1.0.38 → 1.0.42
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/dayjs.cjs
CHANGED
|
@@ -4,8 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const dayjs = typeof _dayjs.default === "function" ? _dayjs.default :
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
+
_dayjs.default.default || _dayjs.default;
|
|
11
12
|
module.exports = dayjs;
|
package/dist/dayjs.mjs
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
const dayjs = "
|
|
1
|
+
import dayjsObject from "dayjs";
|
|
2
|
+
const dayjs = typeof dayjsObject === "function" ? dayjsObject : (
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
|
+
dayjsObject.default || dayjsObject
|
|
5
|
+
);
|
|
3
6
|
export default dayjs;
|
|
@@ -16,7 +16,7 @@ export declare const configProviderContextKey: InjectionKey<ComputedRef<ConfigPr
|
|
|
16
16
|
*/
|
|
17
17
|
export declare const useConfig: () => {
|
|
18
18
|
config: ComputedRef<ConfigProviderContext> | null;
|
|
19
|
-
globalSize: ComputedRef<"
|
|
19
|
+
globalSize: ComputedRef<"small" | "default" | "large">;
|
|
20
20
|
globalZIndex: ComputedRef<number>;
|
|
21
21
|
globalLocale: ComputedRef<Language | undefined>;
|
|
22
22
|
};
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.updateDayjsMonths = exports.setDayjsLocaleSync = exports.setDayjsLocale = exports.getDayjsLocale = void 0;
|
|
7
7
|
var _dayjs = _interopRequireDefault(require("../dayjs.cjs"));
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
const dayjsLocales = import.meta.glob(["../../../../node_modules/dayjs/locale/*.js"], {
|
|
9
|
+
const dayjsLocales = import.meta.glob(["../../../../node_modules/dayjs/locale/*.js", "../../../../dayjs/locale/*.js"], {
|
|
10
10
|
eager: false
|
|
11
11
|
});
|
|
12
12
|
const loadedLocales = /* @__PURE__ */new Set(["en"]);
|
|
@@ -80,8 +80,9 @@ const localeMapping = {
|
|
|
80
80
|
te: "te"
|
|
81
81
|
};
|
|
82
82
|
const loadDayjsLocale = async dayjsLocale => {
|
|
83
|
-
const
|
|
84
|
-
const
|
|
83
|
+
const pathWithNodeModules = `../../../../node_modules/dayjs/locale/${dayjsLocale}.js`;
|
|
84
|
+
const pathWithoutNodeModules = `../../../../dayjs/locale/${dayjsLocale}.js`;
|
|
85
|
+
const loader = dayjsLocales[pathWithNodeModules] || dayjsLocales[pathWithoutNodeModules];
|
|
85
86
|
if (loader) {
|
|
86
87
|
await loader();
|
|
87
88
|
return true;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import dayjs from "../dayjs.mjs";
|
|
2
|
-
const dayjsLocales = import.meta.glob(
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
const dayjsLocales = import.meta.glob(
|
|
3
|
+
["../../../../node_modules/dayjs/locale/*.js", "../../../../dayjs/locale/*.js"],
|
|
4
|
+
{
|
|
5
|
+
eager: false
|
|
6
|
+
}
|
|
7
|
+
);
|
|
5
8
|
const loadedLocales = /* @__PURE__ */ new Set(["en"]);
|
|
6
9
|
const localeMapping = {
|
|
7
10
|
"zh-cn": "zh-cn",
|
|
@@ -73,8 +76,9 @@ const localeMapping = {
|
|
|
73
76
|
te: "te"
|
|
74
77
|
};
|
|
75
78
|
const loadDayjsLocale = async (dayjsLocale) => {
|
|
76
|
-
const
|
|
77
|
-
const
|
|
79
|
+
const pathWithNodeModules = `../../../../node_modules/dayjs/locale/${dayjsLocale}.js`;
|
|
80
|
+
const pathWithoutNodeModules = `../../../../dayjs/locale/${dayjsLocale}.js`;
|
|
81
|
+
const loader = dayjsLocales[pathWithNodeModules] || dayjsLocales[pathWithoutNodeModules];
|
|
78
82
|
if (loader) {
|
|
79
83
|
await loader();
|
|
80
84
|
return true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yh-ui/hooks",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.42",
|
|
4
4
|
"description": "YH-UI composition hooks",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"lint": "eslint ."
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@yh-ui/locale": "^1.0.
|
|
36
|
-
"@yh-ui/utils": "^1.0.
|
|
35
|
+
"@yh-ui/locale": "^1.0.42",
|
|
36
|
+
"@yh-ui/utils": "^1.0.42",
|
|
37
37
|
"dayjs": "^1.11.19"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|