nuxt-hs-ui 2.12.4 → 2.12.5
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
|
@@ -22,7 +22,9 @@ import type { MultiLang } from "../../utils/multi-lang";
|
|
|
22
22
|
// [ composables ]
|
|
23
23
|
import { useHsFocus } from "../../composables/use-hs-focus";
|
|
24
24
|
import { useHsMultiLang } from "../../composables/use-hs-multi-lang";
|
|
25
|
-
import { useHsMisc } from "../../composables/use-hs-misc";
|
|
25
|
+
// import { useHsMisc } from "../../composables/use-hs-misc";
|
|
26
|
+
import { useHsIsMobile } from "../../composables/use-hs-is-mobile";
|
|
27
|
+
|
|
26
28
|
// [ Components ]
|
|
27
29
|
import InputFrame from "./input-frame.vue";
|
|
28
30
|
import SelectImgIcon from "./select-img-icon.vue";
|
|
@@ -33,7 +35,7 @@ const hsFocus = useHsFocus();
|
|
|
33
35
|
const multiLang = useHsMultiLang();
|
|
34
36
|
const tx = multiLang.tx;
|
|
35
37
|
const gt = multiLang.gt;
|
|
36
|
-
const hsMisc = useHsMisc();
|
|
38
|
+
// const hsMisc = useHsMisc();
|
|
37
39
|
|
|
38
40
|
// ----------------------------------------------------------------------------
|
|
39
41
|
// [ Props ]
|
|
@@ -48,6 +50,7 @@ type Props = {
|
|
|
48
50
|
classImg?: ClassType;
|
|
49
51
|
classImgTag?: ClassType;
|
|
50
52
|
nullable?: boolean;
|
|
53
|
+
searchable?: boolean;
|
|
51
54
|
// ----------------------------------------------------------------------------
|
|
52
55
|
data: IdType | null;
|
|
53
56
|
diff?: IdType | null | undefined;
|
|
@@ -356,12 +359,13 @@ const inputElement = ref<HTMLElement | null>(null);
|
|
|
356
359
|
// return () => popper.destroy();
|
|
357
360
|
// };
|
|
358
361
|
// :calculate-position="withPopper"
|
|
359
|
-
|
|
362
|
+
const isMobile = useHsIsMobile();
|
|
360
363
|
// ----------------------------------------------------------------------------
|
|
361
364
|
// ----------------------------------------------------------------------------
|
|
362
365
|
</script>
|
|
363
366
|
|
|
364
367
|
<template>
|
|
368
|
+
{{ { a: isMobile.isMobile } }}
|
|
365
369
|
<InputFrame
|
|
366
370
|
:class="[props.class]"
|
|
367
371
|
:class-header="props.classHeader"
|
|
@@ -407,7 +411,7 @@ const inputElement = ref<HTMLElement | null>(null);
|
|
|
407
411
|
append-to-body
|
|
408
412
|
:options="displayList"
|
|
409
413
|
:loading="props.loading"
|
|
410
|
-
:searchable="!
|
|
414
|
+
:searchable="!isMobile.isMobile && searchable"
|
|
411
415
|
:clearable="!props.require && props.nullable"
|
|
412
416
|
:disabled="props.disabled || props.readonly"
|
|
413
417
|
:uid="uid"
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const useHsIsMobile: import("pinia").StoreDefinition<"HsIsMobile", Pick<{
|
|
2
|
+
isMobile: import("vue").Ref<boolean | null, boolean | null>;
|
|
3
|
+
}, "isMobile">, Pick<{
|
|
4
|
+
isMobile: import("vue").Ref<boolean | null, boolean | null>;
|
|
5
|
+
}, never>, Pick<{
|
|
6
|
+
isMobile: import("vue").Ref<boolean | null, boolean | null>;
|
|
7
|
+
}, never>>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ref } from "vue";
|
|
2
|
+
import { defineStore } from "pinia";
|
|
3
|
+
import { useRequestHeaders } from "#app";
|
|
4
|
+
export const useHsIsMobile = defineStore("HsIsMobile", () => {
|
|
5
|
+
const isMobile = ref(null);
|
|
6
|
+
const GetUa = () => {
|
|
7
|
+
try {
|
|
8
|
+
if (import.meta.client) {
|
|
9
|
+
if (navigator === void 0) return "";
|
|
10
|
+
return navigator.userAgent.toLowerCase();
|
|
11
|
+
}
|
|
12
|
+
return useRequestHeaders(["User-Agent"])["user-agent"] || "";
|
|
13
|
+
} catch (err) {
|
|
14
|
+
console.error(err);
|
|
15
|
+
return "";
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const checkIsMobile = () => {
|
|
19
|
+
if (import.meta.server && isMobile.value !== null) return;
|
|
20
|
+
const ua = GetUa();
|
|
21
|
+
const isOldIPad = /\(ipad.*os/.test(ua);
|
|
22
|
+
const isIpad = /macintosh/.test(ua) && navigator !== void 0 && navigator.maxTouchPoints > 1;
|
|
23
|
+
const isiOS = /ip(?:ad|hone|od)/.test(ua);
|
|
24
|
+
const isAndroid = /android|mobile/i.test(ua);
|
|
25
|
+
isMobile.value = isOldIPad || isIpad || isiOS || isAndroid;
|
|
26
|
+
};
|
|
27
|
+
checkIsMobile();
|
|
28
|
+
console.log("isMobile", isMobile.value);
|
|
29
|
+
return { isMobile };
|
|
30
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-hs-ui",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.5",
|
|
4
4
|
"description": "My new Nuxt module",
|
|
5
5
|
"repository": "https://github.com/hare-systems-ryo/nuxt-hs-ui",
|
|
6
6
|
"license": "MIT",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"@nuxt/kit": "^3.15.1",
|
|
117
117
|
"@nuxt/ui": "^2.21.0",
|
|
118
118
|
"@nuxtjs/tailwindcss": "^6.13.1",
|
|
119
|
-
"@pinia/nuxt": "0.11.
|
|
119
|
+
"@pinia/nuxt": "0.11.1",
|
|
120
120
|
"@popperjs/core": "^2.11.8",
|
|
121
121
|
"@vueuse/core": "^12.3.0",
|
|
122
122
|
"@vueuse/integrations": "^12.3.0",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"defu": "^6.1.4",
|
|
128
128
|
"flatpickr": "^4.6.13",
|
|
129
129
|
"focus-trap": "^7.6.2",
|
|
130
|
-
"pinia": "^3.0.
|
|
130
|
+
"pinia": "^3.0.3",
|
|
131
131
|
"tabulator-tables": "^6.3.0",
|
|
132
132
|
"tailwind-merge": "^2.6.0",
|
|
133
133
|
"tailwind-variants": "^0.3.0",
|