@yh-ui/components 0.1.43 → 0.1.44

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,7 +1,7 @@
1
1
  <script setup>
2
2
  import { ref, computed, watch, onMounted } from "vue";
3
3
  import dayjs from "../../dayjs";
4
- import isoWeekPlugin from "dayjs/plugin/isoWeek.js";
4
+ import * as isoWeekPluginModule from "dayjs/plugin/isoWeek.js";
5
5
  import { useNamespace, useLocale } from "@yh-ui/hooks";
6
6
  import { useComponentTheme } from "@yh-ui/theme";
7
7
  import {
@@ -10,7 +10,9 @@ import {
10
10
  DEFAULT_CHINA_HOLIDAYS_2026
11
11
  } from "./calendar";
12
12
  import { YhButton } from "../../button";
13
- dayjs.extend(isoWeekPlugin);
13
+ dayjs.extend(
14
+ typeof isoWeekPluginModule === "function" ? isoWeekPluginModule : isoWeekPluginModule.default ?? isoWeekPluginModule
15
+ );
14
16
  defineOptions({
15
17
  name: "YhCalendar"
16
18
  });
@@ -5,19 +5,30 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.parseDate = exports.generateCalendar = exports.formatDate = exports.DEFAULT_FORMATS = void 0;
7
7
  var _dayjs = _interopRequireDefault(require("../../dayjs.cjs"));
8
- var _isBetween = _interopRequireDefault(require("dayjs/plugin/isBetween.js"));
9
- var _weekOfYear = _interopRequireDefault(require("dayjs/plugin/weekOfYear.js"));
10
- var _isoWeek = _interopRequireDefault(require("dayjs/plugin/isoWeek.js"));
11
- var _quarterOfYear = _interopRequireDefault(require("dayjs/plugin/quarterOfYear.js"));
12
- var _advancedFormat = _interopRequireDefault(require("dayjs/plugin/advancedFormat.js"));
13
- var _customParseFormat = _interopRequireDefault(require("dayjs/plugin/customParseFormat.js"));
8
+ var isBetweenPluginModule = _interopRequireWildcard(require("dayjs/plugin/isBetween.js"));
9
+ var weekOfYearPluginModule = _interopRequireWildcard(require("dayjs/plugin/weekOfYear.js"));
10
+ var isoWeekPluginModule = _interopRequireWildcard(require("dayjs/plugin/isoWeek.js"));
11
+ var quarterOfYearPluginModule = _interopRequireWildcard(require("dayjs/plugin/quarterOfYear.js"));
12
+ var advancedFormatPluginModule = _interopRequireWildcard(require("dayjs/plugin/advancedFormat.js"));
13
+ var customParseFormatPluginModule = _interopRequireWildcard(require("dayjs/plugin/customParseFormat.js"));
14
+ 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); }
15
+ 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; }
14
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
- _dayjs.default.extend(_isBetween.default);
16
- _dayjs.default.extend(_weekOfYear.default);
17
- _dayjs.default.extend(_isoWeek.default);
18
- _dayjs.default.extend(_quarterOfYear.default);
19
- _dayjs.default.extend(_advancedFormat.default);
20
- _dayjs.default.extend(_customParseFormat.default);
17
+ function resolveDayjsPlugin(module) {
18
+ if (typeof module === "function") {
19
+ return module;
20
+ }
21
+ if (typeof module.default === "function") {
22
+ return module.default;
23
+ }
24
+ return module;
25
+ }
26
+ _dayjs.default.extend(resolveDayjsPlugin(isBetweenPluginModule));
27
+ _dayjs.default.extend(resolveDayjsPlugin(weekOfYearPluginModule));
28
+ _dayjs.default.extend(resolveDayjsPlugin(isoWeekPluginModule));
29
+ _dayjs.default.extend(resolveDayjsPlugin(quarterOfYearPluginModule));
30
+ _dayjs.default.extend(resolveDayjsPlugin(advancedFormatPluginModule));
31
+ _dayjs.default.extend(resolveDayjsPlugin(customParseFormatPluginModule));
21
32
  const DEFAULT_FORMATS = exports.DEFAULT_FORMATS = {
22
33
  date: "YYYY-MM-DD",
23
34
  datetime: "YYYY-MM-DD HH:mm:ss",
@@ -1,16 +1,25 @@
1
1
  import dayjs from "../../dayjs.mjs";
2
- import isBetweenPlugin from "dayjs/plugin/isBetween.js";
3
- import weekOfYearPlugin from "dayjs/plugin/weekOfYear.js";
4
- import isoWeekPlugin from "dayjs/plugin/isoWeek.js";
5
- import quarterOfYearPlugin from "dayjs/plugin/quarterOfYear.js";
6
- import advancedFormatPlugin from "dayjs/plugin/advancedFormat.js";
7
- import customParseFormatPlugin from "dayjs/plugin/customParseFormat.js";
8
- dayjs.extend(isBetweenPlugin);
9
- dayjs.extend(weekOfYearPlugin);
10
- dayjs.extend(isoWeekPlugin);
11
- dayjs.extend(quarterOfYearPlugin);
12
- dayjs.extend(advancedFormatPlugin);
13
- dayjs.extend(customParseFormatPlugin);
2
+ import * as isBetweenPluginModule from "dayjs/plugin/isBetween.js";
3
+ import * as weekOfYearPluginModule from "dayjs/plugin/weekOfYear.js";
4
+ import * as isoWeekPluginModule from "dayjs/plugin/isoWeek.js";
5
+ import * as quarterOfYearPluginModule from "dayjs/plugin/quarterOfYear.js";
6
+ import * as advancedFormatPluginModule from "dayjs/plugin/advancedFormat.js";
7
+ import * as customParseFormatPluginModule from "dayjs/plugin/customParseFormat.js";
8
+ function resolveDayjsPlugin(module) {
9
+ if (typeof module === "function") {
10
+ return module;
11
+ }
12
+ if (typeof module.default === "function") {
13
+ return module.default;
14
+ }
15
+ return module;
16
+ }
17
+ dayjs.extend(resolveDayjsPlugin(isBetweenPluginModule));
18
+ dayjs.extend(resolveDayjsPlugin(weekOfYearPluginModule));
19
+ dayjs.extend(resolveDayjsPlugin(isoWeekPluginModule));
20
+ dayjs.extend(resolveDayjsPlugin(quarterOfYearPluginModule));
21
+ dayjs.extend(resolveDayjsPlugin(advancedFormatPluginModule));
22
+ dayjs.extend(resolveDayjsPlugin(customParseFormatPluginModule));
14
23
  export const DEFAULT_FORMATS = {
15
24
  date: "YYYY-MM-DD",
16
25
  datetime: "YYYY-MM-DD HH:mm:ss",
@@ -1,17 +1,26 @@
1
1
  <script setup>
2
2
  import { ref, computed, watch } from "vue";
3
3
  import dayjs from "../../dayjs";
4
- import isBetweenPlugin from "dayjs/plugin/isBetween.js";
5
- import isoWeekPlugin from "dayjs/plugin/isoWeek.js";
6
- import quarterOfYearPlugin from "dayjs/plugin/quarterOfYear.js";
4
+ import * as isBetweenPluginModule from "dayjs/plugin/isBetween.js";
5
+ import * as isoWeekPluginModule from "dayjs/plugin/isoWeek.js";
6
+ import * as quarterOfYearPluginModule from "dayjs/plugin/quarterOfYear.js";
7
7
  import { useNamespace } from "@yh-ui/hooks";
8
8
  import { useComponentTheme } from "@yh-ui/theme";
9
9
  import { YhTooltip } from "../../tooltip";
10
10
  import { YhInput } from "../../input";
11
11
  import { YhRadioGroup, YhRadioButton } from "../../radio";
12
- dayjs.extend(isBetweenPlugin);
13
- dayjs.extend(isoWeekPlugin);
14
- dayjs.extend(quarterOfYearPlugin);
12
+ const resolveDayjsPlugin = (module) => {
13
+ if (typeof module === "function") {
14
+ return module;
15
+ }
16
+ if (typeof module.default === "function") {
17
+ return module.default;
18
+ }
19
+ return module;
20
+ };
21
+ dayjs.extend(resolveDayjsPlugin(isBetweenPluginModule));
22
+ dayjs.extend(resolveDayjsPlugin(isoWeekPluginModule));
23
+ dayjs.extend(resolveDayjsPlugin(quarterOfYearPluginModule));
15
24
  defineOptions({ name: "YhGanttChart" });
16
25
  const props = defineProps({
17
26
  data: { type: Array, required: true, default: () => [] },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yh-ui/components",
3
- "version": "0.1.43",
3
+ "version": "0.1.44",
4
4
  "description": "YH-UI Vue 3 Components",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -36,10 +36,10 @@
36
36
  "dependencies": {
37
37
  "@webcontainer/api": "^1.6.1",
38
38
  "@floating-ui/dom": "^1.7.4",
39
- "@yh-ui/hooks": "^0.1.43",
40
- "@yh-ui/locale": "^0.1.43",
41
- "@yh-ui/theme": "^0.1.43",
42
- "@yh-ui/utils": "^0.1.43",
39
+ "@yh-ui/hooks": "^0.1.44",
40
+ "@yh-ui/locale": "^0.1.44",
41
+ "@yh-ui/theme": "^0.1.44",
42
+ "@yh-ui/utils": "^0.1.44",
43
43
  "async-validator": "^4.2.5",
44
44
  "dayjs": "^1.11.19",
45
45
  "markdown-it": "^14.1.1",