nuxt-hs-ui 2.0.28 → 2.0.30

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/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.15.0"
6
6
  },
7
- "version": "2.0.28",
7
+ "version": "2.0.30",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
package/dist/module.mjs CHANGED
@@ -88,7 +88,6 @@ const module = defineNuxtModule({
88
88
  _nuxt.options.appConfig.tv = {
89
89
  twMerge: true,
90
90
  twMergeConfig: {
91
- prefix: twConfig.prefix,
92
91
  theme: twConfig.theme
93
92
  }
94
93
  };
@@ -8,10 +8,8 @@
8
8
 
9
9
  // [ node-modules ]
10
10
  import dayjs from "dayjs/esm/index";
11
- import flatpickr from "flatpickr";
12
- import monthSelectPlugin from "flatpickr/dist/plugins/monthSelect";
13
- import { Japanese as ja } from "flatpickr/dist/l10n/ja";
14
- // import { english as en } from "flatpickr/dist/l10n/default";
11
+ // flatpickr cdn 経由で使用する
12
+ // import flatpickr from "flatpickr";
15
13
  // [ vueuse ]
16
14
  import { useMounted } from "@vueuse/core";
17
15
  // [ NUXT ]
@@ -27,6 +25,7 @@ import {
27
25
  useHead,
28
26
  } from "#imports";
29
27
  // [ utils ]
28
+ import { Sleep } from "../../utils/com";
30
29
  import type { ClassType } from "../../utils/class-style";
31
30
  import { GetTimeShiftValue, Dayjs, DayjsInit } from "../../utils/dayjs";
32
31
  // [ composables ]
@@ -40,6 +39,9 @@ import InputFrame from "./input-frame.vue";
40
39
  useHead({
41
40
  script: [
42
41
  //
42
+ // https://npmcdn.com/flatpickr@4.6.13/dist/plugins/monthSelect/index.js
43
+ { src: `https://npmcdn.com/flatpickr/dist/flatpickr.min.js` },
44
+ { src: `https://npmcdn.com/flatpickr/dist/plugins/monthSelect` },
43
45
  { src: `https://npmcdn.com/flatpickr/dist/l10n/ja.js` },
44
46
  { src: `https://npmcdn.com/flatpickr/dist/l10n/default.js` },
45
47
  ],
@@ -57,7 +59,7 @@ const hsMisc = useHsMisc();
57
59
  const isMounted = useMounted();
58
60
  // ----------------------------------------------------------------------------
59
61
  // flatpickr
60
- const MonthSelectPlugin: any = monthSelectPlugin;
62
+ // const MonthSelectPlugin: any = monthSelectPlugin;
61
63
  const timeDateFormat = "YYYY-MM-DD HH:mm:ss.SSS";
62
64
  const timeOutputDateFormat = "HH:mm:ss.SSS";
63
65
  const timeShowDateFormat = "HH:mm";
@@ -207,7 +209,7 @@ const state = reactive<State>({
207
209
  date: null,
208
210
  option: {
209
211
  dateFormat: "Z",
210
- locale: ja,
212
+ locale: "ja",
211
213
  time_24hr: true,
212
214
  minDate: undefined,
213
215
  maxDate: undefined,
@@ -263,12 +265,11 @@ watch(
263
265
  computed(() => {
264
266
  return [props.minDate, props.maxDate, multiLang.state.lang];
265
267
  }).value,
266
- () => {
268
+ async () => {
267
269
  // console.log('computed', props.minDate, props.maxDate, isMounted.value);
268
270
  if (!isMounted.value) return;
269
- setTimeout(() => {
270
- resetPicekr();
271
- }, 1);
271
+ await Sleep(1);
272
+ resetPicekr();
272
273
  }
273
274
  );
274
275
 
@@ -354,8 +355,9 @@ const initFlatPickerOption = () => {
354
355
  state.option.disableMobile = true;
355
356
  }
356
357
  if (props.mode === "month") {
358
+ const monthSelectPlugin = (window as any).monthSelectPlugin;
357
359
  state.option.plugins = [
358
- new MonthSelectPlugin({
360
+ new monthSelectPlugin({
359
361
  shorthand: true, // デフォルトはfalse
360
362
  dateFormat: "m.y", // デフォルトは"F Y"
361
363
  altFormat: "F Y", // デフォルトは"F Y"
@@ -397,18 +399,17 @@ const generateFlatPickerOption = () => {
397
399
  if (inputElement.value != null) {
398
400
  dayjs.locale(multiLang.state.lang);
399
401
  switch (multiLang.state.lang) {
402
+ case "jp":
400
403
  case "ja":
401
404
  state.option.locale = "ja";
402
405
  break;
403
- case "en":
404
- state.option.locale = "en";
405
- break;
406
406
  default:
407
407
  state.option.locale = "en";
408
408
  break;
409
409
  }
410
410
  // state.option.position = 'above';
411
411
  // state.option.static = true;
412
+ const flatpickr = (window as any).flatpickr;
412
413
  state.picker = flatpickr(inputElement.value, state.option);
413
414
  state.picker.config.onChange.push(onChange);
414
415
  state.picker.config.onOpen.push(onOpen);
@@ -624,11 +625,15 @@ watch(computedActivate, (value) => {
624
625
  }
625
626
  });
626
627
 
627
- onMounted(() => {
628
+ onMounted(async () => {
629
+ await Sleep(1);
630
+ // setTimeout(() => {
628
631
  initFlatPickerOption();
629
632
  generateFlatPickerOption();
633
+ // }, 1);
630
634
  });
631
- onUnmounted(() => {
635
+ onUnmounted(async () => {
636
+ await Sleep(1);
632
637
  if (state.picker != null) {
633
638
  state.picker.destroy();
634
639
  state.picker = null;
@@ -1,2 +1,2 @@
1
- declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
1
+ declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
2
2
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-hs-ui",
3
- "version": "2.0.28",
3
+ "version": "2.0.30",
4
4
  "description": "My new Nuxt module",
5
5
  "repository": "https://github.com/hare-systems-ryo/nuxt-hs-ui",
6
6
  "license": "MIT",