@yh-ui/hooks 1.0.39 → 1.0.43

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,9 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
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 :
7
+ var dayjsObject = _interopRequireWildcard(require("dayjs"));
8
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
9
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
10
+ const dayjs = typeof dayjsObject === "function" ? dayjsObject :
10
11
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
- _dayjs.default.default || _dayjs.default;
12
+ dayjsObject.default || dayjsObject;
12
13
  module.exports = dayjs;
package/dist/dayjs.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import dayjsObject from "dayjs";
1
+ import * as dayjsObject from "dayjs";
2
2
  const dayjs = typeof dayjsObject === "function" ? dayjsObject : (
3
3
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
4
  dayjsObject.default || dayjsObject
@@ -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 path = `../../../../node_modules/dayjs/locale/${dayjsLocale}.js`;
84
- const loader = dayjsLocales[path];
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(["../../../../node_modules/dayjs/locale/*.js"], {
3
- eager: false
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 path = `../../../../node_modules/dayjs/locale/${dayjsLocale}.js`;
77
- const loader = dayjsLocales[path];
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.39",
3
+ "version": "1.0.43",
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.39",
36
- "@yh-ui/utils": "^1.0.39",
35
+ "@yh-ui/locale": "^1.0.43",
36
+ "@yh-ui/utils": "^1.0.43",
37
37
  "dayjs": "^1.11.19"
38
38
  },
39
39
  "devDependencies": {