nuxt-hs-ui 2.12.7 → 4.0.0
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/README.md +202 -14
- package/dist/module.d.mts +3 -4
- package/dist/module.json +9 -6
- package/dist/module.mjs +109 -99
- package/dist/runtime/assets/flatpickr-dark.css +1 -1
- package/dist/runtime/assets/main.css +1 -0
- package/dist/runtime/assets/tabulator-custom.css +1 -1
- package/dist/runtime/components/form/_select/hidden-item-toggle.vue +28 -0
- package/dist/runtime/components/form/_select/hidden-item-toggle.vue.d.ts +10 -0
- package/dist/runtime/components/form/_select/item-container.vue +63 -0
- package/dist/runtime/components/form/_select/item-container.vue.d.ts +19 -0
- package/dist/runtime/components/form/_select/item-label.vue +31 -0
- package/dist/runtime/components/form/_select/item-label.vue.d.ts +13 -0
- package/dist/runtime/components/form/_select/item-row.vue +62 -0
- package/dist/runtime/components/form/_select/item-row.vue.d.ts +34 -0
- package/dist/runtime/components/form/btn-line-loading.vue +62 -81
- package/dist/runtime/components/form/btn-line-loading.vue.d.ts +14 -0
- package/dist/runtime/components/form/btn.vue +411 -494
- package/dist/runtime/components/form/btn.vue.d.ts +0 -0
- package/dist/runtime/components/form/check-box.vue +200 -315
- package/dist/runtime/components/form/check-box.vue.d.ts +71 -0
- package/dist/runtime/components/form/check-list.vue +234 -364
- package/dist/runtime/components/form/check-list.vue.d.ts +99 -0
- package/dist/runtime/components/form/combo-box.vue +340 -0
- package/dist/runtime/components/form/combo-box.vue.d.ts +69 -0
- package/dist/runtime/components/form/datepicker.vue +717 -883
- package/dist/runtime/components/form/datepicker.vue.d.ts +122 -0
- package/dist/runtime/components/form/input-frame.vue +174 -258
- package/dist/runtime/components/form/input-frame.vue.d.ts +88 -0
- package/dist/runtime/components/form/radio.vue +451 -614
- package/dist/runtime/components/form/radio.vue.d.ts +62 -0
- package/dist/runtime/components/form/select-img-icon.vue +38 -53
- package/dist/runtime/components/form/select-img-icon.vue.d.ts +15 -0
- package/dist/runtime/components/form/select.vue +733 -579
- package/dist/runtime/components/form/select.vue.d.ts +63 -0
- package/dist/runtime/components/form/text-box.vue +266 -365
- package/dist/runtime/components/form/text-box.vue.d.ts +105 -0
- package/dist/runtime/components/form/textarea.vue +338 -421
- package/dist/runtime/components/form/textarea.vue.d.ts +98 -0
- package/dist/runtime/components/form/value-box.vue +512 -641
- package/dist/runtime/components/form/value-box.vue.d.ts +128 -0
- package/dist/runtime/components/interactive/alert.vue +49 -113
- package/dist/runtime/components/interactive/alert.vue.d.ts +30 -0
- package/dist/runtime/components/interactive/block-loading.vue +91 -119
- package/dist/runtime/components/interactive/block-loading.vue.d.ts +22 -0
- package/dist/runtime/components/interactive/dialog.vue +252 -407
- package/dist/runtime/components/interactive/dialog.vue.d.ts +3 -0
- package/dist/runtime/components/interactive/modal-bg.vue +72 -82
- package/dist/runtime/components/interactive/modal-bg.vue.d.ts +11 -0
- package/dist/runtime/components/interactive/modal.vue +121 -169
- package/dist/runtime/components/interactive/modal.vue.d.ts +38 -0
- package/dist/runtime/components/interactive/toast.vue +164 -206
- package/dist/runtime/components/interactive/toast.vue.d.ts +3 -0
- package/dist/runtime/components/interactive/window-loader.vue +61 -84
- package/dist/runtime/components/interactive/window-loader.vue.d.ts +3 -0
- package/dist/runtime/components/layout/accordion-down.vue +72 -0
- package/dist/runtime/components/layout/accordion-down.vue.d.ts +26 -0
- package/dist/runtime/components/layout/accordion.vue +47 -78
- package/dist/runtime/components/layout/accordion.vue.d.ts +22 -0
- package/dist/runtime/components/layout/aspect-box.vue +29 -58
- package/dist/runtime/components/layout/aspect-box.vue.d.ts +29 -0
- package/dist/runtime/components/layout/card-item.vue +148 -193
- package/dist/runtime/components/layout/card-item.vue.d.ts +0 -0
- package/dist/runtime/components/layout/card.vue +27 -42
- package/dist/runtime/components/layout/card.vue.d.ts +23 -0
- package/dist/runtime/components/layout/container.vue +25 -40
- package/dist/runtime/components/layout/container.vue.d.ts +35 -0
- package/dist/runtime/components/layout/divider-h.vue +30 -50
- package/dist/runtime/components/layout/divider-h.vue.d.ts +18 -0
- package/dist/runtime/components/misc/breadcrumb.vue +47 -95
- package/dist/runtime/components/misc/breadcrumb.vue.d.ts +22 -0
- package/dist/runtime/components/misc/tabulator.vue +122 -190
- package/dist/runtime/components/misc/tabulator.vue.d.ts +28 -0
- package/dist/runtime/components/misc/view-name-display.vue +53 -68
- package/dist/runtime/components/misc/view-name-display.vue.d.ts +14 -0
- package/dist/runtime/components/test.vue +13 -0
- package/dist/runtime/components/test.vue.d.ts +3 -0
- package/dist/runtime/composables/test.d.ts +8 -0
- package/dist/runtime/composables/test.js +12 -0
- package/dist/runtime/composables/use-hs-dialog.d.ts +3 -20
- package/dist/runtime/composables/use-hs-dialog.js +3 -9
- package/dist/runtime/composables/use-hs-is-mobile.d.ts +8 -2
- package/dist/runtime/composables/use-hs-is-mobile.js +43 -25
- package/dist/runtime/composables/use-hs-misc.d.ts +8 -38
- package/dist/runtime/composables/use-hs-misc.js +9 -61
- package/dist/runtime/composables/use-hs-modal.js +1 -3
- package/dist/runtime/composables/use-hs-multi-lang.d.ts +23 -40
- package/dist/runtime/composables/use-hs-multi-lang.js +30 -74
- package/dist/runtime/composables/use-hs-scroll-lock.d.ts +1 -1
- package/dist/runtime/composables/use-hs-scroll-lock.js +2 -1
- package/dist/runtime/composables/use-hs-toast.d.ts +2 -2
- package/dist/runtime/composables/use-hs-toast.js +12 -4
- package/dist/runtime/composables/use-pinia.d.ts +1 -0
- package/dist/runtime/composables/use-pinia.js +2 -0
- package/dist/runtime/plugin.d.ts +2 -0
- package/dist/runtime/plugin.js +4 -0
- package/dist/runtime/server/tsconfig.json +3 -3
- package/dist/runtime/types/dialog.d.ts +11 -20
- package/dist/runtime/types/dialog.js +2 -1
- package/dist/runtime/types/flatpickr/default.js +2 -23
- package/dist/runtime/types/flatpickr/ja.js +3 -37
- package/dist/runtime/types/toast.d.ts +1 -1
- package/dist/runtime/utils/dayjs.d.ts +8 -6
- package/dist/runtime/utils/dayjs.js +12 -5
- package/dist/runtime/utils/modal.d.ts +9 -28
- package/dist/runtime/utils/modal.js +7 -36
- package/dist/runtime/utils/multi-lang-object.d.ts +2 -2
- package/dist/runtime/utils/multi-lang-object.js +1 -5
- package/dist/runtime/utils/multi-lang.js +12 -22
- package/dist/runtime/utils/object.js +1 -1
- package/dist/runtime/utils/select-item.d.ts +3 -1
- package/dist/runtime/utils/stop-watch.js +6 -4
- package/dist/runtime/utils/string.js +4 -4
- package/dist/runtime/utils/tabulator.d.ts +1 -42
- package/dist/runtime/utils/tabulator.js +2 -99
- package/dist/runtime/utils/theme.d.ts +20 -20
- package/dist/runtime/utils/theme.js +180 -30
- package/dist/runtime/utils/tv.d.ts +1 -101
- package/dist/runtime/utils/tv.js +0 -22
- package/dist/types.d.mts +3 -1
- package/package.json +61 -119
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -16
- package/dist/runtime/assets/vue-select.css +0 -1
- package/dist/runtime/components/misc/view-name-display-target.vue +0 -39
- package/dist/runtime/plugin/v-select.d.ts +0 -2
- package/dist/runtime/plugin/v-select.js +0 -5
- package/dist/runtime/style.css +0 -22
- package/dist/runtime/tailwind.css +0 -78
- package/dist/runtime/types/app.config.d.ts +0 -5
- package/dist/types.d.ts +0 -1
|
@@ -1,29 +1,47 @@
|
|
|
1
1
|
import { ref } from "vue";
|
|
2
2
|
import { defineStore } from "pinia";
|
|
3
3
|
import { useRequestHeaders } from "#app";
|
|
4
|
-
export const useHsIsMobile = defineStore(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
export const useHsIsMobile = defineStore(
|
|
5
|
+
"HsIsMobile",
|
|
6
|
+
() => {
|
|
7
|
+
const isMobile = ref(null);
|
|
8
|
+
const isIPhone = ref(null);
|
|
9
|
+
const GetUa = () => {
|
|
10
|
+
try {
|
|
11
|
+
if (import.meta.client) {
|
|
12
|
+
if (navigator === void 0) return "";
|
|
13
|
+
return navigator.userAgent.toLowerCase();
|
|
14
|
+
}
|
|
15
|
+
return useRequestHeaders(["User-Agent"])["user-agent"] || "";
|
|
16
|
+
} catch (err) {
|
|
17
|
+
console.error(err);
|
|
18
|
+
return "";
|
|
11
19
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
};
|
|
21
|
+
const checkIsIPhone = () => {
|
|
22
|
+
if (import.meta.server) return;
|
|
23
|
+
const ua = GetUa();
|
|
24
|
+
isIPhone.value = /iphone/.test(ua);
|
|
25
|
+
};
|
|
26
|
+
const checkIsMobile = () => {
|
|
27
|
+
if (import.meta.server) return;
|
|
28
|
+
const ua = GetUa();
|
|
29
|
+
const isOldIPad = /\(ipad.*os/.test(ua);
|
|
30
|
+
const isIpad = /macintosh/.test(ua) && navigator !== void 0 && navigator.maxTouchPoints > 1;
|
|
31
|
+
const isiOS = /ip(?:ad|hone|od)/.test(ua);
|
|
32
|
+
const isAndroid = /android|mobile/i.test(ua);
|
|
33
|
+
isMobile.value = isOldIPad || isIpad || isiOS || isAndroid;
|
|
34
|
+
};
|
|
35
|
+
const isInit = ref(false);
|
|
36
|
+
const init = () => {
|
|
37
|
+
if (isInit.value) return;
|
|
38
|
+
isInit.value = true;
|
|
39
|
+
checkIsMobile();
|
|
40
|
+
checkIsIPhone();
|
|
41
|
+
};
|
|
42
|
+
return { isMobile, init, isIPhone };
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
persist: true
|
|
46
|
+
}
|
|
47
|
+
);
|
|
@@ -2,51 +2,21 @@ export declare const useHsMisc: import("pinia").StoreDefinition<"HsMisc", Pick<{
|
|
|
2
2
|
state: {
|
|
3
3
|
isInit: boolean;
|
|
4
4
|
isReady: boolean;
|
|
5
|
-
isMobile: boolean;
|
|
6
|
-
readyDeray: number;
|
|
7
|
-
window: {
|
|
8
|
-
h: number;
|
|
9
|
-
w: number;
|
|
10
|
-
};
|
|
11
|
-
scrollbarWidth: number;
|
|
12
5
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
readyDeray?: number;
|
|
17
|
-
}) => Promise<void>;
|
|
18
|
-
}, "state">, Pick<{
|
|
6
|
+
init: (readyDeray?: number) => Promise<void>;
|
|
7
|
+
capsLockState: import("@vueuse/core").UseKeyModifierReturn<boolean | null>;
|
|
8
|
+
}, "state" | "capsLockState">, Pick<{
|
|
19
9
|
state: {
|
|
20
10
|
isInit: boolean;
|
|
21
11
|
isReady: boolean;
|
|
22
|
-
isMobile: boolean;
|
|
23
|
-
readyDeray: number;
|
|
24
|
-
window: {
|
|
25
|
-
h: number;
|
|
26
|
-
w: number;
|
|
27
|
-
};
|
|
28
|
-
scrollbarWidth: number;
|
|
29
12
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
Init: (arg?: {
|
|
33
|
-
readyDeray?: number;
|
|
34
|
-
}) => Promise<void>;
|
|
13
|
+
init: (readyDeray?: number) => Promise<void>;
|
|
14
|
+
capsLockState: import("@vueuse/core").UseKeyModifierReturn<boolean | null>;
|
|
35
15
|
}, never>, Pick<{
|
|
36
16
|
state: {
|
|
37
17
|
isInit: boolean;
|
|
38
18
|
isReady: boolean;
|
|
39
|
-
isMobile: boolean;
|
|
40
|
-
readyDeray: number;
|
|
41
|
-
window: {
|
|
42
|
-
h: number;
|
|
43
|
-
w: number;
|
|
44
|
-
};
|
|
45
|
-
scrollbarWidth: number;
|
|
46
19
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
readyDeray?: number;
|
|
51
|
-
}) => Promise<void>;
|
|
52
|
-
}, "Init" | "GetUa" | "IsMobile">>;
|
|
20
|
+
init: (readyDeray?: number) => Promise<void>;
|
|
21
|
+
capsLockState: import("@vueuse/core").UseKeyModifierReturn<boolean | null>;
|
|
22
|
+
}, "init">>;
|
|
@@ -1,76 +1,24 @@
|
|
|
1
1
|
import { defineStore } from "pinia";
|
|
2
|
+
import { useKeyModifier } from "@vueuse/core";
|
|
2
3
|
import { nextTick, reactive } from "vue";
|
|
3
|
-
import { useEventListener } from "@vueuse/core";
|
|
4
|
-
import { useRequestHeaders } from "#app";
|
|
5
4
|
import { Sleep } from "../utils/com.js";
|
|
6
5
|
export const useHsMisc = defineStore("HsMisc", () => {
|
|
7
|
-
const
|
|
8
|
-
try {
|
|
9
|
-
if (import.meta.client) {
|
|
10
|
-
if (navigator === void 0) return "";
|
|
11
|
-
return navigator.userAgent.toLowerCase();
|
|
12
|
-
}
|
|
13
|
-
if (import.meta.server) {
|
|
14
|
-
return useRequestHeaders(["User-Agent"])["user-agent"] || "";
|
|
15
|
-
}
|
|
16
|
-
return "";
|
|
17
|
-
} catch (err) {
|
|
18
|
-
console.error(err);
|
|
19
|
-
return "";
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
const IsMobile = () => {
|
|
23
|
-
const ua = GetUa();
|
|
24
|
-
const isOldIPad = /\(ipad.*os/.test(ua);
|
|
25
|
-
const isIpad = /macintosh/.test(ua) && navigator !== void 0 && navigator.maxTouchPoints > 1;
|
|
26
|
-
const isiOS = /ip(?:ad|hone|od)/.test(ua);
|
|
27
|
-
const isAndroid = /android|mobile/i.test(ua);
|
|
28
|
-
return isOldIPad || isIpad || isiOS || isAndroid;
|
|
29
|
-
};
|
|
6
|
+
const capsLockState = useKeyModifier("Control");
|
|
30
7
|
const state = reactive({
|
|
31
8
|
isInit: false,
|
|
32
|
-
isReady: false
|
|
33
|
-
isMobile: IsMobile(),
|
|
34
|
-
readyDeray: 10,
|
|
35
|
-
window: {
|
|
36
|
-
h: 0,
|
|
37
|
-
w: 0
|
|
38
|
-
},
|
|
39
|
-
scrollbarWidth: 0
|
|
9
|
+
isReady: false
|
|
40
10
|
});
|
|
41
|
-
const
|
|
11
|
+
const init = async (readyDeray = 10) => {
|
|
12
|
+
if (import.meta.server) return;
|
|
42
13
|
await Sleep(0);
|
|
43
|
-
|
|
44
|
-
if (arg?.readyDeray) {
|
|
45
|
-
state.readyDeray = arg.readyDeray;
|
|
46
|
-
}
|
|
14
|
+
await nextTick();
|
|
47
15
|
state.isInit = true;
|
|
48
|
-
|
|
49
|
-
const initWindow = () => {
|
|
50
|
-
useEventListener(window, "resize", () => {
|
|
51
|
-
state.window = {
|
|
52
|
-
h: window.innerHeight,
|
|
53
|
-
w: window.innerWidth
|
|
54
|
-
};
|
|
55
|
-
state.scrollbarWidth = window.innerWidth - document.body.clientWidth < 0 ? 0 : window.innerWidth - document.body.clientWidth;
|
|
56
|
-
});
|
|
57
|
-
state.window = {
|
|
58
|
-
h: window.innerHeight,
|
|
59
|
-
w: window.innerWidth
|
|
60
|
-
};
|
|
61
|
-
setTimeout(() => {
|
|
62
|
-
state.scrollbarWidth = window.innerWidth - document.body.clientWidth < 0 ? 0 : window.innerWidth - document.body.clientWidth;
|
|
63
|
-
}, 1e3);
|
|
64
|
-
};
|
|
65
|
-
initWindow();
|
|
66
|
-
await Sleep(state.readyDeray);
|
|
16
|
+
await Sleep(readyDeray);
|
|
67
17
|
state.isReady = true;
|
|
68
|
-
await nextTick();
|
|
69
18
|
};
|
|
70
19
|
return {
|
|
71
20
|
state,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
Init
|
|
21
|
+
init,
|
|
22
|
+
capsLockState
|
|
75
23
|
};
|
|
76
24
|
});
|
|
@@ -66,9 +66,7 @@ export const useHsModal = defineStore("HsModal", {
|
|
|
66
66
|
return zIndex;
|
|
67
67
|
},
|
|
68
68
|
remove(id) {
|
|
69
|
-
this.state.activeList = this.state.activeList.filter(
|
|
70
|
-
(row) => row.id !== id
|
|
71
|
-
);
|
|
69
|
+
this.state.activeList = this.state.activeList.filter((row) => row.id !== id);
|
|
72
70
|
if (this.state.activeList.length === 0) {
|
|
73
71
|
clearAllBodyScrollLocks();
|
|
74
72
|
}
|
|
@@ -1,40 +1,23 @@
|
|
|
1
|
-
import type { MultiLang } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
fallBack: string;
|
|
25
|
-
dateFormat: string;
|
|
26
|
-
isInit: boolean;
|
|
27
|
-
showLog: boolean;
|
|
28
|
-
};
|
|
29
|
-
} & import("pinia").PiniaCustomStateProperties<StoreState>): string;
|
|
30
|
-
}, {
|
|
31
|
-
init(arg: {
|
|
32
|
-
lang?: string;
|
|
33
|
-
changeLangFunc?: (lang: string) => Promise<void> | void;
|
|
34
|
-
}): void;
|
|
35
|
-
/** Text Ref */
|
|
36
|
-
tx(text: MultiLang, lang?: undefined): import("vue").ComputedRef<string>;
|
|
37
|
-
/** GetText */
|
|
38
|
-
gt(text: MultiLang, lang?: undefined): string;
|
|
39
|
-
}>;
|
|
40
|
-
export {};
|
|
1
|
+
import type { MultiLang } from '../utils/multi-lang.js';
|
|
2
|
+
export declare const useHsMultiLang: import("pinia").StoreDefinition<"HsMultiLang", Pick<{
|
|
3
|
+
lang: import("vue").Ref<string, string>;
|
|
4
|
+
fallBack: import("vue").Ref<string, string>;
|
|
5
|
+
tx: (text: MultiLang) => import("vue").ComputedRef<string>;
|
|
6
|
+
gt: (text: MultiLang) => string;
|
|
7
|
+
GetText: (text: MultiLang, lang: string, fallBackLang?: string | undefined, showLog?: boolean) => string;
|
|
8
|
+
setLangChange: (_langChange: (_lang: string) => void) => void;
|
|
9
|
+
}, "lang" | "fallBack">, Pick<{
|
|
10
|
+
lang: import("vue").Ref<string, string>;
|
|
11
|
+
fallBack: import("vue").Ref<string, string>;
|
|
12
|
+
tx: (text: MultiLang) => import("vue").ComputedRef<string>;
|
|
13
|
+
gt: (text: MultiLang) => string;
|
|
14
|
+
GetText: (text: MultiLang, lang: string, fallBackLang?: string | undefined, showLog?: boolean) => string;
|
|
15
|
+
setLangChange: (_langChange: (_lang: string) => void) => void;
|
|
16
|
+
}, never>, Pick<{
|
|
17
|
+
lang: import("vue").Ref<string, string>;
|
|
18
|
+
fallBack: import("vue").Ref<string, string>;
|
|
19
|
+
tx: (text: MultiLang) => import("vue").ComputedRef<string>;
|
|
20
|
+
gt: (text: MultiLang) => string;
|
|
21
|
+
GetText: (text: MultiLang, lang: string, fallBackLang?: string | undefined, showLog?: boolean) => string;
|
|
22
|
+
setLangChange: (_langChange: (_lang: string) => void) => void;
|
|
23
|
+
}, "tx" | "gt" | "GetText" | "setLangChange">>;
|
|
@@ -1,81 +1,37 @@
|
|
|
1
|
-
import dayjs from "dayjs
|
|
1
|
+
import { dayjs } from "../utils/dayjs.js";
|
|
2
2
|
import ja from "dayjs/esm/locale/ja.js";
|
|
3
3
|
import en from "dayjs/esm/locale/en.js";
|
|
4
4
|
import { defineStore } from "pinia";
|
|
5
|
-
import { computed, watch } from "vue";
|
|
5
|
+
import { computed, watch, ref } from "vue";
|
|
6
6
|
import { GetTextByMultiLang } from "../utils/multi-lang.js";
|
|
7
|
-
export const useHsMultiLang = defineStore("HsMultiLang", {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
},
|
|
19
|
-
getters: {
|
|
20
|
-
lang(state) {
|
|
21
|
-
return state.state.lang;
|
|
22
|
-
},
|
|
23
|
-
dateFormat(state) {
|
|
24
|
-
return state.state.dateFormat;
|
|
7
|
+
export const useHsMultiLang = defineStore("HsMultiLang", () => {
|
|
8
|
+
const lang = ref("ja");
|
|
9
|
+
const fallBack = ref("ja");
|
|
10
|
+
const langChange = ref((_lang) => {
|
|
11
|
+
if (import.meta.server) return;
|
|
12
|
+
if (_lang === "ja") {
|
|
13
|
+
dayjs.locale(ja);
|
|
14
|
+
} else {
|
|
15
|
+
dayjs.locale(en);
|
|
25
16
|
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
const changeLangFunc = arg.changeLangFunc === void 0 ? (lang) => {
|
|
36
|
-
if (lang === "ja") {
|
|
37
|
-
dayjs.locale(ja);
|
|
38
|
-
} else {
|
|
39
|
-
dayjs.locale(en);
|
|
40
|
-
}
|
|
41
|
-
} : arg.changeLangFunc;
|
|
42
|
-
watch(
|
|
43
|
-
() => this.state.lang,
|
|
44
|
-
(lang) => {
|
|
45
|
-
changeLangFunc(lang);
|
|
46
|
-
},
|
|
47
|
-
{ immediate: true }
|
|
48
|
-
);
|
|
49
|
-
},
|
|
50
|
-
// ---------------------
|
|
51
|
-
/** Text Ref */
|
|
52
|
-
tx(text, lang = void 0) {
|
|
53
|
-
const state = this.state;
|
|
54
|
-
return computed(() => {
|
|
55
|
-
if (lang) {
|
|
56
|
-
return GetTextByMultiLang(text, lang, state.fallBack, state.showLog);
|
|
57
|
-
}
|
|
58
|
-
return GetTextByMultiLang(
|
|
59
|
-
text,
|
|
60
|
-
state.lang,
|
|
61
|
-
state.fallBack,
|
|
62
|
-
state.showLog
|
|
63
|
-
);
|
|
64
|
-
});
|
|
17
|
+
});
|
|
18
|
+
const setLangChange = (_langChange) => {
|
|
19
|
+
langChange.value = _langChange;
|
|
20
|
+
};
|
|
21
|
+
watch(
|
|
22
|
+
() => lang.value,
|
|
23
|
+
(_lang) => {
|
|
24
|
+
langChange.value(_lang);
|
|
65
25
|
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
// ---------------------
|
|
80
|
-
}
|
|
26
|
+
{ immediate: true }
|
|
27
|
+
);
|
|
28
|
+
const tx = (text) => {
|
|
29
|
+
return computed(() => {
|
|
30
|
+
return GetTextByMultiLang(text, lang.value, fallBack.value);
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
const gt = (text) => {
|
|
34
|
+
return GetTextByMultiLang(text, lang.value, fallBack.value);
|
|
35
|
+
};
|
|
36
|
+
return { lang, fallBack, tx, gt, GetText: GetTextByMultiLang, setLangChange };
|
|
81
37
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const useHsScrollLockPinia: import("pinia").StoreDefinition<"HsScrollLockPinia", Pick<{
|
|
2
2
|
active: import("vue").Ref<boolean, boolean>;
|
|
3
3
|
key: import("vue").Ref<string, string>;
|
|
4
|
-
}, "
|
|
4
|
+
}, "active" | "key">, Pick<{
|
|
5
5
|
active: import("vue").Ref<boolean, boolean>;
|
|
6
6
|
key: import("vue").Ref<string, string>;
|
|
7
7
|
}, never>, Pick<{
|
|
@@ -2,6 +2,7 @@ import { defineStore } from "pinia";
|
|
|
2
2
|
import { GenerateUniqeKey } from "../utils/com.js";
|
|
3
3
|
import { disableBodyScroll, enableBodyScroll } from "body-scroll-lock";
|
|
4
4
|
import { ref, onUnmounted } from "vue";
|
|
5
|
+
import { useHsPinia } from "../composables/use-pinia.js";
|
|
5
6
|
export const useHsScrollLockPinia = defineStore("HsScrollLockPinia", () => {
|
|
6
7
|
const active = ref(false);
|
|
7
8
|
const key = ref("");
|
|
@@ -12,7 +13,7 @@ export const useHsScrollLock = () => {
|
|
|
12
13
|
const isIOS = ref(false);
|
|
13
14
|
const elm = ref(null);
|
|
14
15
|
const key = GenerateUniqeKey();
|
|
15
|
-
const hsScrollLockPinia = useHsScrollLockPinia();
|
|
16
|
+
const hsScrollLockPinia = useHsScrollLockPinia(useHsPinia());
|
|
16
17
|
onUnmounted(() => {
|
|
17
18
|
unlock();
|
|
18
19
|
});
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
import { defineStore } from "pinia";
|
|
2
2
|
import { GenerateUniqeKey } from "../utils/com.js";
|
|
3
3
|
import { Theme } from "../types/toast.js";
|
|
4
|
+
import { useHsPinia } from "../composables/use-pinia.js";
|
|
4
5
|
const toastShow = (message, title, hideAfter, theme) => {
|
|
5
|
-
const toast = useHsToast();
|
|
6
|
+
const toast = useHsToast(useHsPinia());
|
|
7
|
+
const key = GenerateUniqeKey();
|
|
6
8
|
const newToast = {
|
|
7
|
-
key
|
|
8
|
-
isShow: true,
|
|
9
|
+
key,
|
|
10
|
+
// isShow: true,
|
|
9
11
|
title,
|
|
10
12
|
message,
|
|
11
13
|
hideAfter,
|
|
12
14
|
barWidth: 0,
|
|
13
|
-
theme
|
|
15
|
+
theme,
|
|
16
|
+
setEvent: false
|
|
14
17
|
};
|
|
15
18
|
toast.state.pendingList.push(newToast);
|
|
19
|
+
if (newToast.hideAfter !== 0) {
|
|
20
|
+
setTimeout(() => {
|
|
21
|
+
toast.state.pendingList = toast.state.pendingList.filter((row) => row.key !== key);
|
|
22
|
+
}, newToast.hideAfter);
|
|
23
|
+
}
|
|
16
24
|
};
|
|
17
25
|
export const useHsToast = defineStore("HsUiToast", {
|
|
18
26
|
state: () => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useHsPinia: any;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../../.nuxt/tsconfig.server.json"
|
|
3
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../.nuxt/tsconfig.server.json"
|
|
3
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { MultiLang } from
|
|
2
|
-
import type { Theme } from "../utils/theme.js";
|
|
1
|
+
import type { MultiLang } from '../utils/multi-lang.js';
|
|
3
2
|
export declare const DialogDefaultZIndex = 3000;
|
|
4
3
|
export declare const DialogResult: {
|
|
5
4
|
readonly left: "left";
|
|
@@ -7,31 +6,23 @@ export declare const DialogResult: {
|
|
|
7
6
|
readonly cancel: "cancel";
|
|
8
7
|
};
|
|
9
8
|
export type DialogResult = (typeof DialogResult)[keyof typeof DialogResult];
|
|
9
|
+
export interface DialogBtn {
|
|
10
|
+
isShow: boolean;
|
|
11
|
+
title: MultiLang;
|
|
12
|
+
theme: Theme;
|
|
13
|
+
variant: 'flat' | 'text' | 'outlined';
|
|
14
|
+
}
|
|
10
15
|
/**
|
|
11
16
|
* Option interface
|
|
12
17
|
*/
|
|
13
18
|
export interface DialogOption {
|
|
14
19
|
zindex: number;
|
|
15
20
|
theme: Theme;
|
|
16
|
-
defaultBtn:
|
|
21
|
+
defaultBtn: 'left' | 'right' | 'cancel' | null;
|
|
17
22
|
bgClose?: boolean;
|
|
18
|
-
btnLeft:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
theme: Theme;
|
|
22
|
-
variant: "flat" | "text" | "outlined";
|
|
23
|
-
};
|
|
24
|
-
btnRight: {
|
|
25
|
-
isShow: boolean;
|
|
26
|
-
title: MultiLang;
|
|
27
|
-
theme: Theme;
|
|
28
|
-
variant: "flat" | "text" | "outlined";
|
|
29
|
-
};
|
|
30
|
-
btnCancel: {
|
|
31
|
-
isShow: boolean;
|
|
32
|
-
title: MultiLang;
|
|
33
|
-
theme: Theme;
|
|
34
|
-
};
|
|
23
|
+
btnLeft: DialogBtn;
|
|
24
|
+
btnRight: DialogBtn;
|
|
25
|
+
btnCancel: DialogBtn;
|
|
35
26
|
}
|
|
36
27
|
/**
|
|
37
28
|
* Option 初期化
|
|
@@ -1,31 +1,10 @@
|
|
|
1
1
|
export const en = {
|
|
2
2
|
weekdays: {
|
|
3
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
|
-
]
|
|
4
|
+
longhand: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
|
|
13
5
|
},
|
|
14
6
|
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
|
-
],
|
|
7
|
+
shorthand: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
|
29
8
|
longhand: [
|
|
30
9
|
"January",
|
|
31
10
|
"February",
|
|
@@ -1,45 +1,11 @@
|
|
|
1
1
|
export const ja = {
|
|
2
2
|
weekdays: {
|
|
3
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
|
-
]
|
|
4
|
+
longhand: ["\u65E5\u66DC\u65E5", "\u6708\u66DC\u65E5", "\u706B\u66DC\u65E5", "\u6C34\u66DC\u65E5", "\u6728\u66DC\u65E5", "\u91D1\u66DC\u65E5", "\u571F\u66DC\u65E5"]
|
|
13
5
|
},
|
|
14
6
|
months: {
|
|
15
|
-
shorthand: [
|
|
16
|
-
|
|
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
|
-
]
|
|
7
|
+
shorthand: ["1\u6708", "2\u6708", "3\u6708", "4\u6708", "5\u6708", "6\u6708", "7\u6708", "8\u6708", "9\u6708", "10\u6708", "11\u6708", "12\u6708"],
|
|
8
|
+
longhand: ["1\u6708", "2\u6708", "3\u6708", "4\u6708", "5\u6708", "6\u6708", "7\u6708", "8\u6708", "9\u6708", "10\u6708", "11\u6708", "12\u6708"]
|
|
43
9
|
},
|
|
44
10
|
time_24hr: true,
|
|
45
11
|
rangeSeparator: " \u304B\u3089 ",
|
|
@@ -10,10 +10,10 @@ export interface Message {
|
|
|
10
10
|
key: string;
|
|
11
11
|
title: MultiLang;
|
|
12
12
|
message: MultiLang;
|
|
13
|
-
isShow: boolean;
|
|
14
13
|
hideAfter: number;
|
|
15
14
|
barWidth: number;
|
|
16
15
|
theme: Theme;
|
|
16
|
+
setEvent: boolean;
|
|
17
17
|
}
|
|
18
18
|
export interface Controler {
|
|
19
19
|
Success: (message: MultiLang, title: MultiLang, hideAfter?: number) => void;
|