nuxt-hs-ui 2.0.30 → 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 +22 -20
- 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
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
// [ node-modules ]
|
|
10
10
|
import dayjs from "dayjs/esm/index";
|
|
11
11
|
// flatpickr cdn 経由で使用する
|
|
12
|
-
|
|
12
|
+
import flatpickr from "flatpickr";
|
|
13
|
+
import monthSelectPlugin from "flatpickr/dist/plugins/monthSelect";
|
|
13
14
|
// [ vueuse ]
|
|
14
15
|
import { useMounted } from "@vueuse/core";
|
|
15
16
|
// [ NUXT ]
|
|
@@ -22,12 +23,16 @@ import {
|
|
|
22
23
|
onMounted,
|
|
23
24
|
nextTick,
|
|
24
25
|
onUnmounted,
|
|
25
|
-
useHead,
|
|
26
|
+
// useHead,
|
|
26
27
|
} from "#imports";
|
|
27
28
|
// [ utils ]
|
|
28
29
|
import { Sleep } from "../../utils/com";
|
|
29
30
|
import type { ClassType } from "../../utils/class-style";
|
|
30
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";
|
|
31
36
|
// [ composables ]
|
|
32
37
|
import { useHsMisc } from "../../composables/use-hs-misc";
|
|
33
38
|
import { useHsFocus } from "../../composables/use-hs-focus";
|
|
@@ -36,16 +41,16 @@ import { useHsMultiLang } from "../../composables/use-hs-multi-lang";
|
|
|
36
41
|
// [ Components ]
|
|
37
42
|
import InputFrame from "./input-frame.vue";
|
|
38
43
|
|
|
39
|
-
useHead({
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
});
|
|
44
|
+
// useHead({
|
|
45
|
+
// script: [
|
|
46
|
+
// //
|
|
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` },
|
|
50
|
+
// { src: `https://npmcdn.com/flatpickr/dist/l10n/ja.js` },
|
|
51
|
+
// { src: `https://npmcdn.com/flatpickr/dist/l10n/default.js` },
|
|
52
|
+
// ],
|
|
53
|
+
// });
|
|
49
54
|
|
|
50
55
|
// ----------------------------------------------------------------------------
|
|
51
56
|
// [ nac-stroe ]
|
|
@@ -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";
|
|
@@ -209,7 +213,7 @@ const state = reactive<State>({
|
|
|
209
213
|
date: null,
|
|
210
214
|
option: {
|
|
211
215
|
dateFormat: "Z",
|
|
212
|
-
locale:
|
|
216
|
+
locale: ja,
|
|
213
217
|
time_24hr: true,
|
|
214
218
|
minDate: undefined,
|
|
215
219
|
maxDate: undefined,
|
|
@@ -355,9 +359,8 @@ const initFlatPickerOption = () => {
|
|
|
355
359
|
state.option.disableMobile = true;
|
|
356
360
|
}
|
|
357
361
|
if (props.mode === "month") {
|
|
358
|
-
const monthSelectPlugin = (window as any).monthSelectPlugin;
|
|
359
362
|
state.option.plugins = [
|
|
360
|
-
new monthSelectPlugin({
|
|
363
|
+
new (monthSelectPlugin as any)({
|
|
361
364
|
shorthand: true, // デフォルトはfalse
|
|
362
365
|
dateFormat: "m.y", // デフォルトは"F Y"
|
|
363
366
|
altFormat: "F Y", // デフォルトは"F Y"
|
|
@@ -401,15 +404,14 @@ const generateFlatPickerOption = () => {
|
|
|
401
404
|
switch (multiLang.state.lang) {
|
|
402
405
|
case "jp":
|
|
403
406
|
case "ja":
|
|
404
|
-
state.option.locale =
|
|
407
|
+
state.option.locale = ja;
|
|
405
408
|
break;
|
|
406
409
|
default:
|
|
407
|
-
state.option.locale =
|
|
410
|
+
state.option.locale = en;
|
|
408
411
|
break;
|
|
409
412
|
}
|
|
410
413
|
// state.option.position = 'above';
|
|
411
414
|
// state.option.static = true;
|
|
412
|
-
const flatpickr = (window as any).flatpickr;
|
|
413
415
|
state.picker = flatpickr(inputElement.value, state.option);
|
|
414
416
|
state.picker.config.onChange.push(onChange);
|
|
415
417
|
state.picker.config.onOpen.push(onOpen);
|
|
@@ -846,7 +848,7 @@ const computedIsFocusOpenBtn = computed(() => {
|
|
|
846
848
|
{{ props.mode === "month" ? "Now" : "Today" }}
|
|
847
849
|
</span>
|
|
848
850
|
</div>
|
|
849
|
-
<template
|
|
851
|
+
<template #right-icons>
|
|
850
852
|
<template v-if="!props.hideDeleteBtn && !props.readonly">
|
|
851
853
|
<div
|
|
852
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
|
+
};
|