nuxt-hs-ui 2.0.29 → 2.0.31
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 +1 -1
- package/dist/runtime/components/form/datepicker.vue +20 -13
- package/dist/runtime/types/flatpickr/default.d.ts +1 -0
- package/dist/runtime/types/flatpickr/default.js +70 -0
- package/dist/runtime/types/flatpickr/ja.d.ts +17 -0
- package/dist/runtime/types/flatpickr/ja.js +51 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -8,10 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
// [ node-modules ]
|
|
10
10
|
import dayjs from "dayjs/esm/index";
|
|
11
|
+
// flatpickr cdn 経由で使用する
|
|
11
12
|
import flatpickr from "flatpickr";
|
|
12
13
|
import monthSelectPlugin from "flatpickr/dist/plugins/monthSelect";
|
|
13
|
-
import { Japanese as ja } from "flatpickr/dist/l10n/ja.js";
|
|
14
|
-
import { english as en } from "flatpickr/dist/l10n/default.js";
|
|
15
14
|
// [ vueuse ]
|
|
16
15
|
import { useMounted } from "@vueuse/core";
|
|
17
16
|
// [ NUXT ]
|
|
@@ -27,8 +26,13 @@ import {
|
|
|
27
26
|
// useHead,
|
|
28
27
|
} from "#imports";
|
|
29
28
|
// [ utils ]
|
|
29
|
+
import { Sleep } from "../../utils/com";
|
|
30
30
|
import type { ClassType } from "../../utils/class-style";
|
|
31
31
|
import { GetTimeShiftValue, Dayjs, DayjsInit } from "../../utils/dayjs";
|
|
32
|
+
// [ utils ]
|
|
33
|
+
|
|
34
|
+
import { ja } from "../../types/flatpickr/ja";
|
|
35
|
+
import { en } from "../../types/flatpickr/default";
|
|
32
36
|
// [ composables ]
|
|
33
37
|
import { useHsMisc } from "../../composables/use-hs-misc";
|
|
34
38
|
import { useHsFocus } from "../../composables/use-hs-focus";
|
|
@@ -40,8 +44,9 @@ import InputFrame from "./input-frame.vue";
|
|
|
40
44
|
// useHead({
|
|
41
45
|
// script: [
|
|
42
46
|
// //
|
|
43
|
-
|
|
44
|
-
// { src: `https://npmcdn.com/flatpickr/dist/flatpickr.min.js` },
|
|
47
|
+
// // https://npmcdn.com/flatpickr@4.6.13/dist/plugins/monthSelect/index.js
|
|
48
|
+
// //{ src: `https://npmcdn.com/flatpickr/dist/flatpickr.min.js` },
|
|
49
|
+
// { src: `https://npmcdn.com/flatpickr/dist/plugins/monthSelect` },
|
|
45
50
|
// { src: `https://npmcdn.com/flatpickr/dist/l10n/ja.js` },
|
|
46
51
|
// { src: `https://npmcdn.com/flatpickr/dist/l10n/default.js` },
|
|
47
52
|
// ],
|
|
@@ -59,7 +64,6 @@ const hsMisc = useHsMisc();
|
|
|
59
64
|
const isMounted = useMounted();
|
|
60
65
|
// ----------------------------------------------------------------------------
|
|
61
66
|
// flatpickr
|
|
62
|
-
const MonthSelectPlugin: any = monthSelectPlugin;
|
|
63
67
|
const timeDateFormat = "YYYY-MM-DD HH:mm:ss.SSS";
|
|
64
68
|
const timeOutputDateFormat = "HH:mm:ss.SSS";
|
|
65
69
|
const timeShowDateFormat = "HH:mm";
|
|
@@ -265,12 +269,11 @@ watch(
|
|
|
265
269
|
computed(() => {
|
|
266
270
|
return [props.minDate, props.maxDate, multiLang.state.lang];
|
|
267
271
|
}).value,
|
|
268
|
-
() => {
|
|
272
|
+
async () => {
|
|
269
273
|
// console.log('computed', props.minDate, props.maxDate, isMounted.value);
|
|
270
274
|
if (!isMounted.value) return;
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
}, 1);
|
|
275
|
+
await Sleep(1);
|
|
276
|
+
resetPicekr();
|
|
274
277
|
}
|
|
275
278
|
);
|
|
276
279
|
|
|
@@ -357,7 +360,7 @@ const initFlatPickerOption = () => {
|
|
|
357
360
|
}
|
|
358
361
|
if (props.mode === "month") {
|
|
359
362
|
state.option.plugins = [
|
|
360
|
-
new
|
|
363
|
+
new (monthSelectPlugin as any)({
|
|
361
364
|
shorthand: true, // デフォルトはfalse
|
|
362
365
|
dateFormat: "m.y", // デフォルトは"F Y"
|
|
363
366
|
altFormat: "F Y", // デフォルトは"F Y"
|
|
@@ -624,11 +627,15 @@ watch(computedActivate, (value) => {
|
|
|
624
627
|
}
|
|
625
628
|
});
|
|
626
629
|
|
|
627
|
-
onMounted(() => {
|
|
630
|
+
onMounted(async () => {
|
|
631
|
+
await Sleep(1);
|
|
632
|
+
// setTimeout(() => {
|
|
628
633
|
initFlatPickerOption();
|
|
629
634
|
generateFlatPickerOption();
|
|
635
|
+
// }, 1);
|
|
630
636
|
});
|
|
631
|
-
onUnmounted(() => {
|
|
637
|
+
onUnmounted(async () => {
|
|
638
|
+
await Sleep(1);
|
|
632
639
|
if (state.picker != null) {
|
|
633
640
|
state.picker.destroy();
|
|
634
641
|
state.picker = null;
|
|
@@ -841,7 +848,7 @@ const computedIsFocusOpenBtn = computed(() => {
|
|
|
841
848
|
{{ props.mode === "month" ? "Now" : "Today" }}
|
|
842
849
|
</span>
|
|
843
850
|
</div>
|
|
844
|
-
<template
|
|
851
|
+
<template #right-icons>
|
|
845
852
|
<template v-if="!props.hideDeleteBtn && !props.readonly">
|
|
846
853
|
<div
|
|
847
854
|
:class="
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const en: any;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export const en = {
|
|
2
|
+
weekdays: {
|
|
3
|
+
shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
4
|
+
longhand: [
|
|
5
|
+
"Sunday",
|
|
6
|
+
"Monday",
|
|
7
|
+
"Tuesday",
|
|
8
|
+
"Wednesday",
|
|
9
|
+
"Thursday",
|
|
10
|
+
"Friday",
|
|
11
|
+
"Saturday"
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
months: {
|
|
15
|
+
shorthand: [
|
|
16
|
+
"Jan",
|
|
17
|
+
"Feb",
|
|
18
|
+
"Mar",
|
|
19
|
+
"Apr",
|
|
20
|
+
"May",
|
|
21
|
+
"Jun",
|
|
22
|
+
"Jul",
|
|
23
|
+
"Aug",
|
|
24
|
+
"Sep",
|
|
25
|
+
"Oct",
|
|
26
|
+
"Nov",
|
|
27
|
+
"Dec"
|
|
28
|
+
],
|
|
29
|
+
longhand: [
|
|
30
|
+
"January",
|
|
31
|
+
"February",
|
|
32
|
+
"March",
|
|
33
|
+
"April",
|
|
34
|
+
"May",
|
|
35
|
+
"June",
|
|
36
|
+
"July",
|
|
37
|
+
"August",
|
|
38
|
+
"September",
|
|
39
|
+
"October",
|
|
40
|
+
"November",
|
|
41
|
+
"December"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
|
|
45
|
+
firstDayOfWeek: 0,
|
|
46
|
+
ordinal: (nth) => {
|
|
47
|
+
const s = nth % 100;
|
|
48
|
+
if (s > 3 && s < 21) return "th";
|
|
49
|
+
switch (s % 10) {
|
|
50
|
+
case 1:
|
|
51
|
+
return "st";
|
|
52
|
+
case 2:
|
|
53
|
+
return "nd";
|
|
54
|
+
case 3:
|
|
55
|
+
return "rd";
|
|
56
|
+
default:
|
|
57
|
+
return "th";
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
rangeSeparator: " to ",
|
|
61
|
+
weekAbbreviation: "Wk",
|
|
62
|
+
scrollTitle: "Scroll to increment",
|
|
63
|
+
toggleTitle: "Click to toggle",
|
|
64
|
+
amPM: ["AM", "PM"],
|
|
65
|
+
yearAriaLabel: "Year",
|
|
66
|
+
monthAriaLabel: "Month",
|
|
67
|
+
hourAriaLabel: "Hour",
|
|
68
|
+
minuteAriaLabel: "Minute",
|
|
69
|
+
time_24hr: false
|
|
70
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const ja: {
|
|
2
|
+
weekdays: {
|
|
3
|
+
shorthand: string[];
|
|
4
|
+
longhand: string[];
|
|
5
|
+
};
|
|
6
|
+
months: {
|
|
7
|
+
shorthand: string[];
|
|
8
|
+
longhand: string[];
|
|
9
|
+
};
|
|
10
|
+
time_24hr: boolean;
|
|
11
|
+
rangeSeparator: string;
|
|
12
|
+
monthAriaLabel: string;
|
|
13
|
+
amPM: string[];
|
|
14
|
+
yearAriaLabel: string;
|
|
15
|
+
hourAriaLabel: string;
|
|
16
|
+
minuteAriaLabel: string;
|
|
17
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export const ja = {
|
|
2
|
+
weekdays: {
|
|
3
|
+
shorthand: ["\u65E5", "\u6708", "\u706B", "\u6C34", "\u6728", "\u91D1", "\u571F"],
|
|
4
|
+
longhand: [
|
|
5
|
+
"\u65E5\u66DC\u65E5",
|
|
6
|
+
"\u6708\u66DC\u65E5",
|
|
7
|
+
"\u706B\u66DC\u65E5",
|
|
8
|
+
"\u6C34\u66DC\u65E5",
|
|
9
|
+
"\u6728\u66DC\u65E5",
|
|
10
|
+
"\u91D1\u66DC\u65E5",
|
|
11
|
+
"\u571F\u66DC\u65E5"
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
months: {
|
|
15
|
+
shorthand: [
|
|
16
|
+
"1\u6708",
|
|
17
|
+
"2\u6708",
|
|
18
|
+
"3\u6708",
|
|
19
|
+
"4\u6708",
|
|
20
|
+
"5\u6708",
|
|
21
|
+
"6\u6708",
|
|
22
|
+
"7\u6708",
|
|
23
|
+
"8\u6708",
|
|
24
|
+
"9\u6708",
|
|
25
|
+
"10\u6708",
|
|
26
|
+
"11\u6708",
|
|
27
|
+
"12\u6708"
|
|
28
|
+
],
|
|
29
|
+
longhand: [
|
|
30
|
+
"1\u6708",
|
|
31
|
+
"2\u6708",
|
|
32
|
+
"3\u6708",
|
|
33
|
+
"4\u6708",
|
|
34
|
+
"5\u6708",
|
|
35
|
+
"6\u6708",
|
|
36
|
+
"7\u6708",
|
|
37
|
+
"8\u6708",
|
|
38
|
+
"9\u6708",
|
|
39
|
+
"10\u6708",
|
|
40
|
+
"11\u6708",
|
|
41
|
+
"12\u6708"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
time_24hr: true,
|
|
45
|
+
rangeSeparator: " \u304B\u3089 ",
|
|
46
|
+
monthAriaLabel: "\u6708",
|
|
47
|
+
amPM: ["\u5348\u524D", "\u5348\u5F8C"],
|
|
48
|
+
yearAriaLabel: "\u5E74",
|
|
49
|
+
hourAriaLabel: "\u6642\u9593",
|
|
50
|
+
minuteAriaLabel: "\u5206"
|
|
51
|
+
};
|