pukaad-ui-lib 1.356.0 → 1.357.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/dist/module.json +1 -1
- package/dist/module.mjs +1 -0
- package/dist/runtime/components/google-translate.client.d.vue.ts +3 -0
- package/dist/runtime/components/google-translate.client.vue +41 -0
- package/dist/runtime/components/google-translate.client.vue.d.ts +3 -0
- package/dist/runtime/components/image/image-cropper.d.vue.ts +2 -2
- package/dist/runtime/components/image/image-cropper.vue.d.ts +2 -2
- package/dist/runtime/components/input/input-autocomplete.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-autocomplete.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-combobox.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-combobox.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-localized-name.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-localized-name.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-suggest.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-suggest.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-tag.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-tag.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-textarea.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-textarea.vue.d.ts +1 -1
- package/dist/runtime/components/modal/modal-report.d.vue.ts +3 -9
- package/dist/runtime/components/modal/modal-report.vue +106 -45
- package/dist/runtime/components/modal/modal-report.vue.d.ts +3 -9
- package/dist/runtime/components/picker/picker-option-menu/picker-option-menu-user.d.vue.ts +2 -2
- package/dist/runtime/components/picker/picker-option-menu/picker-option-menu-user.vue.d.ts +2 -2
- package/dist/runtime/composables/useGoogleTranslate.d.ts +4 -0
- package/dist/runtime/composables/useGoogleTranslate.js +42 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -247,6 +247,7 @@ const module$1 = defineNuxtModule({
|
|
|
247
247
|
_nuxt.options.runtimeConfig.public.RECAPTCHA_KEY ??= process.env.RECAPTCHA_KEY ?? "";
|
|
248
248
|
_nuxt.hook("prepare:types", ({ references }) => {
|
|
249
249
|
references.push({ path: resolver.resolve("./types/convert.d.ts") });
|
|
250
|
+
references.push({ path: resolver.resolve("./types/google-translate.d.ts") });
|
|
250
251
|
});
|
|
251
252
|
}
|
|
252
253
|
});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div id="google_translate_element" class="hidden" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { onMounted, nextTick } from "vue";
|
|
7
|
+
import { useGoogleTranslate } from "#pukaad-ui/runtime/composables/useGoogleTranslate";
|
|
8
|
+
const { activeLanguage, setLanguage } = useGoogleTranslate();
|
|
9
|
+
const initGoogleTranslate = () => {
|
|
10
|
+
const googleTranslate = window.google?.translate;
|
|
11
|
+
if (!googleTranslate?.TranslateElement) return;
|
|
12
|
+
new googleTranslate.TranslateElement(
|
|
13
|
+
{
|
|
14
|
+
pageLanguage: "th",
|
|
15
|
+
includedLanguages: "th,en",
|
|
16
|
+
autoDisplay: false
|
|
17
|
+
},
|
|
18
|
+
"google_translate_element"
|
|
19
|
+
);
|
|
20
|
+
nextTick(() => setLanguage(activeLanguage.value));
|
|
21
|
+
};
|
|
22
|
+
onMounted(() => {
|
|
23
|
+
window.googleTranslateElementInit = initGoogleTranslate;
|
|
24
|
+
if (window.google?.translate) {
|
|
25
|
+
initGoogleTranslate();
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const existingScript = document.querySelector(
|
|
29
|
+
'script[src*="translate.google.com/translate_a/element.js"]'
|
|
30
|
+
);
|
|
31
|
+
if (existingScript) return;
|
|
32
|
+
const script = document.createElement("script");
|
|
33
|
+
script.src = "https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit";
|
|
34
|
+
script.async = true;
|
|
35
|
+
document.head.appendChild(script);
|
|
36
|
+
});
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<style>
|
|
40
|
+
.goog-te-banner-frame.skiptranslate,iframe.skiptranslate{display:none!important}body{top:0!important}
|
|
41
|
+
</style>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -64,15 +64,15 @@ declare const __VLS_export: import("vue").DefineComponent<ImageCropperProps, {
|
|
|
64
64
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImageCropperProps> & Readonly<{}>, {
|
|
65
65
|
src: string;
|
|
66
66
|
center: boolean;
|
|
67
|
+
background: boolean;
|
|
68
|
+
modal: boolean;
|
|
67
69
|
responsive: boolean;
|
|
68
70
|
restore: boolean;
|
|
69
71
|
checkCrossOrigin: boolean;
|
|
70
72
|
checkOrientation: boolean;
|
|
71
73
|
crossorigin: "" | "anonymous" | "use-credentials";
|
|
72
|
-
modal: boolean;
|
|
73
74
|
guides: boolean;
|
|
74
75
|
highlight: boolean;
|
|
75
|
-
background: boolean;
|
|
76
76
|
autoCrop: boolean;
|
|
77
77
|
movable: boolean;
|
|
78
78
|
rotatable: boolean;
|
|
@@ -64,15 +64,15 @@ declare const __VLS_export: import("vue").DefineComponent<ImageCropperProps, {
|
|
|
64
64
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImageCropperProps> & Readonly<{}>, {
|
|
65
65
|
src: string;
|
|
66
66
|
center: boolean;
|
|
67
|
+
background: boolean;
|
|
68
|
+
modal: boolean;
|
|
67
69
|
responsive: boolean;
|
|
68
70
|
restore: boolean;
|
|
69
71
|
checkCrossOrigin: boolean;
|
|
70
72
|
checkOrientation: boolean;
|
|
71
73
|
crossorigin: "" | "anonymous" | "use-credentials";
|
|
72
|
-
modal: boolean;
|
|
73
74
|
guides: boolean;
|
|
74
75
|
highlight: boolean;
|
|
75
|
-
background: boolean;
|
|
76
76
|
autoCrop: boolean;
|
|
77
77
|
movable: boolean;
|
|
78
78
|
rotatable: boolean;
|
|
@@ -50,9 +50,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
50
50
|
required: boolean;
|
|
51
51
|
options: AutocompleteOption[] | string[] | number[];
|
|
52
52
|
description: string;
|
|
53
|
+
limit: number;
|
|
53
54
|
labelKey: string;
|
|
54
55
|
placeholder: string;
|
|
55
|
-
limit: number;
|
|
56
56
|
disabledErrorMessage: boolean;
|
|
57
57
|
disabledBorder: boolean;
|
|
58
58
|
showCounter: boolean;
|
|
@@ -50,9 +50,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
50
50
|
required: boolean;
|
|
51
51
|
options: AutocompleteOption[] | string[] | number[];
|
|
52
52
|
description: string;
|
|
53
|
+
limit: number;
|
|
53
54
|
labelKey: string;
|
|
54
55
|
placeholder: string;
|
|
55
|
-
limit: number;
|
|
56
56
|
disabledErrorMessage: boolean;
|
|
57
57
|
disabledBorder: boolean;
|
|
58
58
|
showCounter: boolean;
|
|
@@ -12,8 +12,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
12
12
|
name: string;
|
|
13
13
|
modelValue: LocalizedNameItem[];
|
|
14
14
|
options: InputSelectItem[];
|
|
15
|
-
placeholder: string;
|
|
16
15
|
limit: number;
|
|
16
|
+
placeholder: string;
|
|
17
17
|
showCounter: boolean;
|
|
18
18
|
addLabel: string;
|
|
19
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -12,8 +12,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
12
12
|
name: string;
|
|
13
13
|
modelValue: LocalizedNameItem[];
|
|
14
14
|
options: InputSelectItem[];
|
|
15
|
-
placeholder: string;
|
|
16
15
|
limit: number;
|
|
16
|
+
placeholder: string;
|
|
17
17
|
showCounter: boolean;
|
|
18
18
|
addLabel: string;
|
|
19
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -20,9 +20,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
20
20
|
name: string;
|
|
21
21
|
required: boolean;
|
|
22
22
|
description: string;
|
|
23
|
+
limit: number;
|
|
23
24
|
labelKey: string;
|
|
24
25
|
placeholder: string;
|
|
25
|
-
limit: number;
|
|
26
26
|
disabledErrorMessage: boolean;
|
|
27
27
|
disabledBorder: boolean;
|
|
28
28
|
showCounter: boolean;
|
|
@@ -20,9 +20,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
20
20
|
name: string;
|
|
21
21
|
required: boolean;
|
|
22
22
|
description: string;
|
|
23
|
+
limit: number;
|
|
23
24
|
labelKey: string;
|
|
24
25
|
placeholder: string;
|
|
25
|
-
limit: number;
|
|
26
26
|
disabledErrorMessage: boolean;
|
|
27
27
|
disabledBorder: boolean;
|
|
28
28
|
showCounter: boolean;
|
|
@@ -26,8 +26,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
26
26
|
}>, {
|
|
27
27
|
name: string;
|
|
28
28
|
state: "user" | "admin";
|
|
29
|
-
placeholder: string;
|
|
30
29
|
limit: number;
|
|
30
|
+
placeholder: string;
|
|
31
31
|
ignore: string[];
|
|
32
32
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
33
|
declare const _default: typeof __VLS_export;
|
|
@@ -26,8 +26,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
26
26
|
}>, {
|
|
27
27
|
name: string;
|
|
28
28
|
state: "user" | "admin";
|
|
29
|
-
placeholder: string;
|
|
30
29
|
limit: number;
|
|
30
|
+
placeholder: string;
|
|
31
31
|
ignore: string[];
|
|
32
32
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
33
|
declare const _default: typeof __VLS_export;
|
|
@@ -46,8 +46,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
46
46
|
resize: "none" | "both" | "horizontal" | "vertical";
|
|
47
47
|
fullHeight: boolean;
|
|
48
48
|
fullWidth: boolean;
|
|
49
|
-
rows: number;
|
|
50
49
|
limit: number;
|
|
50
|
+
rows: number;
|
|
51
51
|
disabledErrorMessage: boolean;
|
|
52
52
|
disabledBorder: boolean;
|
|
53
53
|
showCounter: boolean;
|
|
@@ -46,8 +46,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
46
46
|
resize: "none" | "both" | "horizontal" | "vertical";
|
|
47
47
|
fullHeight: boolean;
|
|
48
48
|
fullWidth: boolean;
|
|
49
|
-
rows: number;
|
|
50
49
|
limit: number;
|
|
50
|
+
rows: number;
|
|
51
51
|
disabledErrorMessage: boolean;
|
|
52
52
|
disabledBorder: boolean;
|
|
53
53
|
showCounter: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ModalReportProps } from "#pukaad-ui/types/components/modal/modal-report";
|
|
1
|
+
import type { ModalReportProps, ModalReportSubmitPayload } from "#pukaad-ui/types/components/modal/modal-report";
|
|
2
2
|
type __VLS_Props = ModalReportProps;
|
|
3
3
|
type __VLS_ModelProps = {
|
|
4
4
|
modelValue?: boolean;
|
|
@@ -7,15 +7,9 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
|
7
7
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
8
|
"update:modelValue": (value: boolean) => any;
|
|
9
9
|
} & {
|
|
10
|
-
submit: (payload:
|
|
11
|
-
value: string;
|
|
12
|
-
detail: string;
|
|
13
|
-
}) => any;
|
|
10
|
+
submit: (payload: ModalReportSubmitPayload) => any;
|
|
14
11
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
15
|
-
onSubmit?: ((payload:
|
|
16
|
-
value: string;
|
|
17
|
-
detail: string;
|
|
18
|
-
}) => any) | undefined;
|
|
12
|
+
onSubmit?: ((payload: ModalReportSubmitPayload) => any) | undefined;
|
|
19
13
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
20
14
|
}>, {
|
|
21
15
|
loading: boolean;
|
|
@@ -17,33 +17,34 @@
|
|
|
17
17
|
name="report_value"
|
|
18
18
|
:label="item[0]?.label"
|
|
19
19
|
:items="item"
|
|
20
|
-
v-model="formState.
|
|
20
|
+
v-model="formState.selectedValue"
|
|
21
21
|
/>
|
|
22
22
|
<div
|
|
23
|
-
v-show="formState.
|
|
23
|
+
v-show="formState.selectedValue === item[0]?.value"
|
|
24
|
+
class="mt-[8px]"
|
|
24
25
|
>
|
|
25
26
|
<InputTextarea
|
|
26
27
|
name="report_detail"
|
|
27
28
|
rows="4"
|
|
28
29
|
height-scroll
|
|
29
|
-
placeholder="
|
|
30
|
-
v-model="formState.
|
|
30
|
+
:placeholder="placeholderText"
|
|
31
|
+
v-model="formState.description"
|
|
31
32
|
/>
|
|
32
33
|
</div>
|
|
33
34
|
</div>
|
|
34
35
|
</div>
|
|
35
36
|
<template #footer>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
<Button class="w-full" variant="outline" type="button" @click="onCancel">
|
|
38
|
+
ยกเลิก
|
|
39
|
+
</Button>
|
|
40
|
+
<Button
|
|
41
|
+
class="w-full"
|
|
42
|
+
type="submit"
|
|
43
|
+
color="primary"
|
|
44
|
+
:disabled="formState.selectedValue === ''"
|
|
45
|
+
>
|
|
46
|
+
ส่ง
|
|
47
|
+
</Button>
|
|
47
48
|
</template>
|
|
48
49
|
</Modal>
|
|
49
50
|
</template>
|
|
@@ -55,46 +56,102 @@ const props = defineProps({
|
|
|
55
56
|
state: { type: String, required: true },
|
|
56
57
|
loading: { type: Boolean, required: false, default: false }
|
|
57
58
|
});
|
|
58
|
-
const
|
|
59
|
-
"\
|
|
60
|
-
"\
|
|
61
|
-
"\
|
|
62
|
-
"\
|
|
63
|
-
"\
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"\
|
|
67
|
-
"\
|
|
68
|
-
"\
|
|
69
|
-
"\
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
"\
|
|
73
|
-
"\
|
|
59
|
+
const placeEditOptions = [
|
|
60
|
+
{ label: "\u0E1B\u0E34\u0E14\u0E2B\u0E23\u0E37\u0E2D\u0E2B\u0E22\u0E38\u0E14\u0E01\u0E34\u0E08\u0E01\u0E32\u0E23\u0E41\u0E25\u0E49\u0E27", value: "closed" },
|
|
61
|
+
{ label: "\u0E44\u0E21\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E17\u0E35\u0E48\u0E19\u0E35\u0E48", value: "not_exist" },
|
|
62
|
+
{ label: "\u0E0B\u0E49\u0E33\u0E01\u0E31\u0E1A\u0E2A\u0E16\u0E32\u0E19\u0E17\u0E35\u0E48\u0E2D\u0E37\u0E48\u0E19", value: "duplicate" },
|
|
63
|
+
{ label: "\u0E22\u0E49\u0E32\u0E22\u0E44\u0E1B\u0E22\u0E31\u0E07\u0E15\u0E33\u0E41\u0E2B\u0E19\u0E48\u0E07\u0E17\u0E35\u0E48\u0E15\u0E31\u0E49\u0E07\u0E43\u0E2B\u0E21\u0E48\u0E41\u0E25\u0E49\u0E27", value: "relocated" },
|
|
64
|
+
{ label: "\u0E2D\u0E37\u0E48\u0E19\u0E46", value: "other" }
|
|
65
|
+
];
|
|
66
|
+
const placeCloseDuplicateOptions = [
|
|
67
|
+
{ label: "\u0E1B\u0E34\u0E14\u0E2B\u0E23\u0E37\u0E2D\u0E2B\u0E22\u0E38\u0E14\u0E01\u0E34\u0E08\u0E01\u0E32\u0E23\u0E41\u0E25\u0E49\u0E27", value: "closed" },
|
|
68
|
+
{ label: "\u0E44\u0E21\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E17\u0E35\u0E48\u0E19\u0E35\u0E48", value: "not_exist" },
|
|
69
|
+
{ label: "\u0E0B\u0E49\u0E33\u0E01\u0E31\u0E1A\u0E2A\u0E16\u0E32\u0E19\u0E17\u0E35\u0E48\u0E2D\u0E37\u0E48\u0E19", value: "duplicate" },
|
|
70
|
+
{ label: "\u0E2D\u0E37\u0E48\u0E19\u0E46", value: "other" }
|
|
71
|
+
];
|
|
72
|
+
const placeReportOptions = [
|
|
73
|
+
{ label: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E2A\u0E16\u0E32\u0E19\u0E17\u0E35\u0E48\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07", value: "invalid_info" },
|
|
74
|
+
{ label: "\u0E2A\u0E16\u0E32\u0E19\u0E17\u0E35\u0E48\u0E19\u0E35\u0E49\u0E44\u0E21\u0E48\u0E21\u0E35\u0E2D\u0E22\u0E39\u0E48\u0E08\u0E23\u0E34\u0E07", value: "fake_place" },
|
|
75
|
+
{ label: "\u0E2A\u0E16\u0E32\u0E19\u0E17\u0E35\u0E48\u0E0B\u0E49\u0E33", value: "duplicate_place" },
|
|
76
|
+
{ label: "\u0E2B\u0E21\u0E27\u0E14\u0E2B\u0E21\u0E39\u0E48\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07", value: "invalid_category" },
|
|
77
|
+
{ label: "\u0E1E\u0E34\u0E01\u0E31\u0E14\u0E2A\u0E16\u0E32\u0E19\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07", value: "invalid_location" },
|
|
78
|
+
{ label: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E18\u0E38\u0E23\u0E01\u0E34\u0E08\u0E40\u0E1B\u0E47\u0E19\u0E40\u0E17\u0E47\u0E08\u0E2B\u0E23\u0E37\u0E2D\u0E41\u0E2D\u0E1A\u0E2D\u0E49\u0E32\u0E07", value: "impersonation_business" },
|
|
79
|
+
{ label: "\u0E0A\u0E37\u0E48\u0E2D\u0E2B\u0E23\u0E37\u0E2D\u0E23\u0E32\u0E22\u0E25\u0E30\u0E40\u0E2D\u0E35\u0E22\u0E14\u0E21\u0E35\u0E2A\u0E41\u0E1B\u0E21\u0E2B\u0E23\u0E37\u0E2D\u0E42\u0E06\u0E29\u0E13\u0E32", value: "spam_advertising" },
|
|
80
|
+
{ label: "\u0E23\u0E39\u0E1B\u0E20\u0E32\u0E1E\u0E2B\u0E23\u0E37\u0E2D\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E25\u0E30\u0E40\u0E21\u0E34\u0E14\u0E25\u0E34\u0E02\u0E2A\u0E34\u0E17\u0E18\u0E34\u0E4C", value: "copyright_infringement" },
|
|
81
|
+
{ label: "\u0E40\u0E19\u0E37\u0E49\u0E2D\u0E2B\u0E32\u0E44\u0E21\u0E48\u0E40\u0E2B\u0E21\u0E32\u0E30\u0E2A\u0E21\u0E2B\u0E23\u0E37\u0E2D\u0E1C\u0E34\u0E14\u0E01\u0E0E\u0E2B\u0E21\u0E32\u0E22", value: "inappropriate_illegal" },
|
|
82
|
+
{ label: "\u0E2D\u0E37\u0E48\u0E19\u0E46", value: "other" }
|
|
83
|
+
];
|
|
84
|
+
const mediaOptions = [
|
|
85
|
+
{ label: "\u0E23\u0E39\u0E1B\u0E20\u0E32\u0E1E\u0E2B\u0E23\u0E37\u0E2D\u0E27\u0E34\u0E14\u0E35\u0E42\u0E2D\u0E44\u0E21\u0E48\u0E40\u0E2B\u0E21\u0E32\u0E30\u0E2A\u0E21", value: "inappropriate" },
|
|
86
|
+
{ label: "\u0E02\u0E49\u0E2D\u0E01\u0E31\u0E07\u0E27\u0E25\u0E40\u0E01\u0E35\u0E48\u0E22\u0E27\u0E01\u0E31\u0E1A\u0E04\u0E27\u0E32\u0E21\u0E40\u0E1B\u0E47\u0E19\u0E2A\u0E48\u0E27\u0E19\u0E15\u0E31\u0E27", value: "privacy" },
|
|
87
|
+
{ label: "\u0E04\u0E38\u0E13\u0E20\u0E32\u0E1E\u0E15\u0E48\u0E33", value: "low_quality" },
|
|
88
|
+
{ label: "\u0E40\u0E19\u0E37\u0E49\u0E2D\u0E2B\u0E32\u0E17\u0E35\u0E48\u0E21\u0E38\u0E48\u0E07\u0E23\u0E49\u0E32\u0E22 \u0E40\u0E1B\u0E47\u0E19\u0E2D\u0E31\u0E19\u0E15\u0E23\u0E32\u0E22 \u0E2B\u0E23\u0E37\u0E2D\u0E21\u0E35\u0E04\u0E27\u0E32\u0E21\u0E23\u0E38\u0E19\u0E41\u0E23\u0E07", value: "harmful" },
|
|
89
|
+
{ label: "\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E23\u0E39\u0E1B\u0E20\u0E32\u0E1E\u0E2B\u0E23\u0E37\u0E2D\u0E27\u0E34\u0E14\u0E35\u0E42\u0E2D\u0E02\u0E2D\u0E07\u0E2A\u0E16\u0E32\u0E19\u0E17\u0E35\u0E48\u0E19\u0E35\u0E49", value: "wrong_place" },
|
|
90
|
+
{ label: "\u0E2D\u0E37\u0E48\u0E19\u0E46", value: "other" }
|
|
91
|
+
];
|
|
92
|
+
const reviewOptions = [
|
|
93
|
+
{ label: "\u0E40\u0E19\u0E37\u0E49\u0E2D\u0E2B\u0E32\u0E44\u0E21\u0E48\u0E40\u0E01\u0E35\u0E48\u0E22\u0E27\u0E02\u0E49\u0E2D\u0E07", value: "irrelevant" },
|
|
94
|
+
{ label: "\u0E2B\u0E22\u0E32\u0E1A\u0E04\u0E32\u0E22 / \u0E44\u0E21\u0E48\u0E40\u0E2B\u0E21\u0E32\u0E30\u0E2A\u0E21", value: "inappropriate" },
|
|
95
|
+
{ label: "\u0E25\u0E32\u0E21\u0E01\u0E2D\u0E19\u0E32\u0E08\u0E32\u0E23", value: "pornographic" },
|
|
96
|
+
{ label: "\u0E04\u0E27\u0E32\u0E21\u0E23\u0E38\u0E19\u0E41\u0E23\u0E07", value: "violence" },
|
|
97
|
+
{ label: "\u0E02\u0E48\u0E21\u0E02\u0E39\u0E48 \u0E04\u0E38\u0E01\u0E04\u0E32\u0E21", value: "harassment" },
|
|
98
|
+
{ label: "\u0E01\u0E25\u0E31\u0E48\u0E19\u0E41\u0E01\u0E25\u0E49\u0E07", value: "bullying" },
|
|
99
|
+
{ label: "\u0E2A\u0E23\u0E49\u0E32\u0E07\u0E04\u0E27\u0E32\u0E21\u0E40\u0E01\u0E25\u0E35\u0E22\u0E14\u0E0A\u0E31\u0E07\u0E2B\u0E23\u0E37\u0E2D\u0E02\u0E31\u0E14\u0E41\u0E22\u0E49\u0E07", value: "hate_speech" },
|
|
100
|
+
{ label: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E0B\u0E49\u0E33\u0E2B\u0E23\u0E37\u0E2D\u0E2A\u0E41\u0E1B\u0E21", value: "spam" },
|
|
101
|
+
{ label: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E40\u0E17\u0E47\u0E08", value: "fake_info" },
|
|
102
|
+
{ label: "\u0E25\u0E30\u0E40\u0E21\u0E34\u0E14\u0E17\u0E23\u0E31\u0E1E\u0E22\u0E4C\u0E2A\u0E34\u0E19\u0E17\u0E32\u0E07\u0E1B\u0E31\u0E0D\u0E0D\u0E32", value: "copyright" },
|
|
103
|
+
{ label: "\u0E25\u0E30\u0E40\u0E21\u0E34\u0E14\u0E02\u0E49\u0E2D\u0E15\u0E01\u0E25\u0E07\u0E01\u0E32\u0E23\u0E43\u0E0A\u0E49\u0E07\u0E32\u0E19", value: "terms_violation" },
|
|
104
|
+
{ label: "\u0E1C\u0E34\u0E14\u0E01\u0E0E\u0E2B\u0E21\u0E32\u0E22", value: "illegal" },
|
|
105
|
+
{ label: "\u0E2A\u0E48\u0E07\u0E1C\u0E25\u0E01\u0E23\u0E30\u0E17\u0E1A\u0E15\u0E48\u0E2D\u0E1A\u0E38\u0E04\u0E04\u0E25", value: "personal_impact" },
|
|
106
|
+
{ label: "\u0E40\u0E02\u0E49\u0E32\u0E02\u0E48\u0E32\u0E22\u0E2B\u0E25\u0E2D\u0E01\u0E25\u0E27\u0E07", value: "scam" },
|
|
107
|
+
{ label: "\u0E2D\u0E37\u0E48\u0E19\u0E46", value: "other" }
|
|
74
108
|
];
|
|
75
109
|
const title = computed(() => {
|
|
76
|
-
if (props.state === "place") return "\
|
|
77
|
-
if (props.state === "
|
|
78
|
-
if (props.state === "
|
|
79
|
-
if (props.state === "
|
|
80
|
-
if (props.state === "
|
|
81
|
-
|
|
82
|
-
|
|
110
|
+
if (props.state === "place-edit") return "\u0E41\u0E08\u0E49\u0E07\u0E41\u0E01\u0E49\u0E44\u0E02\u0E2A\u0E16\u0E32\u0E19\u0E17\u0E35\u0E48\u0E19\u0E35\u0E49";
|
|
111
|
+
if (props.state === "place-close-duplicate") return "\u0E41\u0E08\u0E49\u0E07\u0E1B\u0E34\u0E14\u0E2B\u0E23\u0E37\u0E2D\u0E0B\u0E49\u0E33";
|
|
112
|
+
if (props.state === "place") return "\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E2A\u0E16\u0E32\u0E19\u0E17\u0E35\u0E48\u0E19\u0E35\u0E49";
|
|
113
|
+
if (props.state === "media") return "\u0E41\u0E08\u0E49\u0E07\u0E41\u0E01\u0E49\u0E44\u0E02\u0E2A\u0E37\u0E48\u0E2D\u0E19\u0E35\u0E49";
|
|
114
|
+
if (props.state === "review") return "\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E23\u0E35\u0E27\u0E34\u0E27\u0E19\u0E35\u0E49";
|
|
115
|
+
return "";
|
|
116
|
+
});
|
|
117
|
+
const placeholderText = computed(() => {
|
|
118
|
+
if (props.state === "place" || props.state === "review") {
|
|
119
|
+
return "\u0E04\u0E33\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A\u0E01\u0E32\u0E23\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19";
|
|
120
|
+
}
|
|
121
|
+
return "\u0E04\u0E33\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07";
|
|
83
122
|
});
|
|
84
123
|
const modelValue = defineModel({ type: Boolean, ...{
|
|
85
124
|
default: false
|
|
86
125
|
} });
|
|
87
126
|
const formState = ref({
|
|
88
|
-
|
|
89
|
-
|
|
127
|
+
selectedValue: "",
|
|
128
|
+
description: ""
|
|
129
|
+
});
|
|
130
|
+
const currentOptions = computed(() => {
|
|
131
|
+
if (props.state === "place-edit") {
|
|
132
|
+
return placeEditOptions;
|
|
133
|
+
}
|
|
134
|
+
if (props.state === "place-close-duplicate") {
|
|
135
|
+
return placeCloseDuplicateOptions;
|
|
136
|
+
}
|
|
137
|
+
if (props.state === "place") {
|
|
138
|
+
return placeReportOptions;
|
|
139
|
+
}
|
|
140
|
+
if (props.state === "media") {
|
|
141
|
+
return mediaOptions;
|
|
142
|
+
}
|
|
143
|
+
if (props.state === "review") {
|
|
144
|
+
return reviewOptions;
|
|
145
|
+
}
|
|
146
|
+
return [];
|
|
90
147
|
});
|
|
91
148
|
const items = computed(() => {
|
|
92
|
-
return
|
|
149
|
+
return currentOptions.value.map((opt) => [opt]);
|
|
93
150
|
});
|
|
94
151
|
const reset = () => {
|
|
95
152
|
formState.value = {
|
|
96
|
-
|
|
97
|
-
|
|
153
|
+
selectedValue: "",
|
|
154
|
+
description: ""
|
|
98
155
|
};
|
|
99
156
|
};
|
|
100
157
|
const onCancel = () => {
|
|
@@ -102,9 +159,13 @@ const onCancel = () => {
|
|
|
102
159
|
modelValue.value = false;
|
|
103
160
|
};
|
|
104
161
|
const onSendReport = () => {
|
|
162
|
+
const selectedOpt = currentOptions.value.find(
|
|
163
|
+
(opt) => opt.value === formState.value.selectedValue
|
|
164
|
+
);
|
|
105
165
|
emit("submit", {
|
|
106
|
-
value: formState.value.
|
|
107
|
-
|
|
166
|
+
value: formState.value.selectedValue,
|
|
167
|
+
label: selectedOpt?.label || "",
|
|
168
|
+
description: formState.value.description
|
|
108
169
|
});
|
|
109
170
|
};
|
|
110
171
|
watch(modelValue, (isOpen) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ModalReportProps } from "#pukaad-ui/types/components/modal/modal-report";
|
|
1
|
+
import type { ModalReportProps, ModalReportSubmitPayload } from "#pukaad-ui/types/components/modal/modal-report";
|
|
2
2
|
type __VLS_Props = ModalReportProps;
|
|
3
3
|
type __VLS_ModelProps = {
|
|
4
4
|
modelValue?: boolean;
|
|
@@ -7,15 +7,9 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
|
7
7
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
8
|
"update:modelValue": (value: boolean) => any;
|
|
9
9
|
} & {
|
|
10
|
-
submit: (payload:
|
|
11
|
-
value: string;
|
|
12
|
-
detail: string;
|
|
13
|
-
}) => any;
|
|
10
|
+
submit: (payload: ModalReportSubmitPayload) => any;
|
|
14
11
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
15
|
-
onSubmit?: ((payload:
|
|
16
|
-
value: string;
|
|
17
|
-
detail: string;
|
|
18
|
-
}) => any) | undefined;
|
|
12
|
+
onSubmit?: ((payload: ModalReportSubmitPayload) => any) | undefined;
|
|
19
13
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
20
14
|
}>, {
|
|
21
15
|
loading: boolean;
|
|
@@ -12,6 +12,7 @@ declare const __VLS_export: import("vue").DefineComponent<PickerOptionMenuUserPr
|
|
|
12
12
|
"review-reply": () => any;
|
|
13
13
|
"reply-edit": () => any;
|
|
14
14
|
"profile-name-updated": (name: string) => any;
|
|
15
|
+
"place-close-duplicate": () => any;
|
|
15
16
|
"profile-edit": () => any;
|
|
16
17
|
"profile-share": () => any;
|
|
17
18
|
"profile-follower-delete": () => any;
|
|
@@ -19,7 +20,6 @@ declare const __VLS_export: import("vue").DefineComponent<PickerOptionMenuUserPr
|
|
|
19
20
|
"report-blog": () => any;
|
|
20
21
|
"report-place": () => any;
|
|
21
22
|
"report-profile": () => any;
|
|
22
|
-
"place-close-duplicate": () => any;
|
|
23
23
|
archive: () => any;
|
|
24
24
|
}, string, import("vue").PublicProps, Readonly<PickerOptionMenuUserProps> & Readonly<{
|
|
25
25
|
"onBlog-edit"?: (() => any) | undefined;
|
|
@@ -34,6 +34,7 @@ declare const __VLS_export: import("vue").DefineComponent<PickerOptionMenuUserPr
|
|
|
34
34
|
"onReview-reply"?: (() => any) | undefined;
|
|
35
35
|
"onReply-edit"?: (() => any) | undefined;
|
|
36
36
|
"onProfile-name-updated"?: ((name: string) => any) | undefined;
|
|
37
|
+
"onPlace-close-duplicate"?: (() => any) | undefined;
|
|
37
38
|
"onProfile-edit"?: (() => any) | undefined;
|
|
38
39
|
"onProfile-share"?: (() => any) | undefined;
|
|
39
40
|
"onProfile-follower-delete"?: (() => any) | undefined;
|
|
@@ -41,7 +42,6 @@ declare const __VLS_export: import("vue").DefineComponent<PickerOptionMenuUserPr
|
|
|
41
42
|
"onReport-blog"?: (() => any) | undefined;
|
|
42
43
|
"onReport-place"?: (() => any) | undefined;
|
|
43
44
|
"onReport-profile"?: (() => any) | undefined;
|
|
44
|
-
"onPlace-close-duplicate"?: (() => any) | undefined;
|
|
45
45
|
onArchive?: (() => any) | undefined;
|
|
46
46
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
47
47
|
declare const _default: typeof __VLS_export;
|
|
@@ -12,6 +12,7 @@ declare const __VLS_export: import("vue").DefineComponent<PickerOptionMenuUserPr
|
|
|
12
12
|
"review-reply": () => any;
|
|
13
13
|
"reply-edit": () => any;
|
|
14
14
|
"profile-name-updated": (name: string) => any;
|
|
15
|
+
"place-close-duplicate": () => any;
|
|
15
16
|
"profile-edit": () => any;
|
|
16
17
|
"profile-share": () => any;
|
|
17
18
|
"profile-follower-delete": () => any;
|
|
@@ -19,7 +20,6 @@ declare const __VLS_export: import("vue").DefineComponent<PickerOptionMenuUserPr
|
|
|
19
20
|
"report-blog": () => any;
|
|
20
21
|
"report-place": () => any;
|
|
21
22
|
"report-profile": () => any;
|
|
22
|
-
"place-close-duplicate": () => any;
|
|
23
23
|
archive: () => any;
|
|
24
24
|
}, string, import("vue").PublicProps, Readonly<PickerOptionMenuUserProps> & Readonly<{
|
|
25
25
|
"onBlog-edit"?: (() => any) | undefined;
|
|
@@ -34,6 +34,7 @@ declare const __VLS_export: import("vue").DefineComponent<PickerOptionMenuUserPr
|
|
|
34
34
|
"onReview-reply"?: (() => any) | undefined;
|
|
35
35
|
"onReply-edit"?: (() => any) | undefined;
|
|
36
36
|
"onProfile-name-updated"?: ((name: string) => any) | undefined;
|
|
37
|
+
"onPlace-close-duplicate"?: (() => any) | undefined;
|
|
37
38
|
"onProfile-edit"?: (() => any) | undefined;
|
|
38
39
|
"onProfile-share"?: (() => any) | undefined;
|
|
39
40
|
"onProfile-follower-delete"?: (() => any) | undefined;
|
|
@@ -41,7 +42,6 @@ declare const __VLS_export: import("vue").DefineComponent<PickerOptionMenuUserPr
|
|
|
41
42
|
"onReport-blog"?: (() => any) | undefined;
|
|
42
43
|
"onReport-place"?: (() => any) | undefined;
|
|
43
44
|
"onReport-profile"?: (() => any) | undefined;
|
|
44
|
-
"onPlace-close-duplicate"?: (() => any) | undefined;
|
|
45
45
|
onArchive?: (() => any) | undefined;
|
|
46
46
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
47
47
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ref, nextTick } from "vue";
|
|
2
|
+
const activeLanguage = ref("th");
|
|
3
|
+
const GOOGLE_TRANSLATE_COOKIE = "googtrans";
|
|
4
|
+
const getBrowserLanguage = () => {
|
|
5
|
+
if (import.meta.server) return "th";
|
|
6
|
+
return localStorage.getItem("google_translate_language") || "th";
|
|
7
|
+
};
|
|
8
|
+
const setTranslateCookie = (language) => {
|
|
9
|
+
if (import.meta.server) return;
|
|
10
|
+
const value = language === "th" ? "" : `/th/${language}`;
|
|
11
|
+
const expires = "expires=Thu, 01 Jan 1970 00:00:00 GMT";
|
|
12
|
+
if (!value) {
|
|
13
|
+
document.cookie = `${GOOGLE_TRANSLATE_COOKIE}=; path=/; ${expires}`;
|
|
14
|
+
document.cookie = `${GOOGLE_TRANSLATE_COOKIE}=; path=/; domain=.${location.hostname}; ${expires}`;
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
document.cookie = `${GOOGLE_TRANSLATE_COOKIE}=${value}; path=/`;
|
|
18
|
+
};
|
|
19
|
+
const applyGoogleTranslateLanguage = (language) => {
|
|
20
|
+
if (import.meta.server) return;
|
|
21
|
+
const select = document.querySelector(".goog-te-combo");
|
|
22
|
+
if (!select) return;
|
|
23
|
+
select.value = language;
|
|
24
|
+
select.dispatchEvent(new Event("change"));
|
|
25
|
+
};
|
|
26
|
+
export const useGoogleTranslate = () => {
|
|
27
|
+
const setLanguage = (language) => {
|
|
28
|
+
activeLanguage.value = language;
|
|
29
|
+
if (import.meta.client) {
|
|
30
|
+
localStorage.setItem("google_translate_language", language);
|
|
31
|
+
setTranslateCookie(language);
|
|
32
|
+
nextTick(() => applyGoogleTranslateLanguage(language));
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
if (import.meta.client && activeLanguage.value === "th") {
|
|
36
|
+
activeLanguage.value = getBrowserLanguage();
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
activeLanguage,
|
|
40
|
+
setLanguage
|
|
41
|
+
};
|
|
42
|
+
};
|