pukaad-ui-lib 1.236.0 → 1.238.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/runtime/components/card/card-user-blog.d.vue.ts +4 -0
- package/dist/runtime/components/card/card-user-blog.vue +32 -11
- package/dist/runtime/components/card/card-user-blog.vue.d.ts +4 -0
- package/dist/runtime/components/picker/picker-option-menu/picker-option-menu-user.d.vue.ts +4 -4
- package/dist/runtime/components/picker/picker-option-menu/picker-option-menu-user.vue.d.ts +4 -4
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -24,9 +24,13 @@ type __VLS_Props = {
|
|
|
24
24
|
isMyProfile?: boolean;
|
|
25
25
|
};
|
|
26
26
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
27
|
+
"blog-edit": () => any;
|
|
27
28
|
"blog-updated": () => any;
|
|
29
|
+
"blog-deleted": () => any;
|
|
28
30
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
31
|
+
"onBlog-edit"?: (() => any) | undefined;
|
|
29
32
|
"onBlog-updated"?: (() => any) | undefined;
|
|
33
|
+
"onBlog-deleted"?: (() => any) | undefined;
|
|
30
34
|
}>, {
|
|
31
35
|
isMyProfile: boolean;
|
|
32
36
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
@blog-unpin="onBlogUnpin"
|
|
40
40
|
@blog-pin="onBlogPin"
|
|
41
41
|
@blog-edit="onBlogEdit"
|
|
42
|
+
@blog-delete="onBlogDelete"
|
|
42
43
|
/>
|
|
43
44
|
</div>
|
|
44
45
|
<div class="flex flex-col gap-[16px] cursor-pointer" @click="onBlogClick">
|
|
@@ -73,15 +74,15 @@
|
|
|
73
74
|
}"
|
|
74
75
|
state="blog"
|
|
75
76
|
/>
|
|
76
|
-
</div>
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
<!-- Edit Blog Drawer — อยู่ใน root เดียวกันเพื่อหลีกเลี่ยง fragment -->
|
|
79
|
+
<DrawerPostBlog
|
|
80
|
+
v-if="editBlogItem"
|
|
81
|
+
v-model="isEditDrawerOpen"
|
|
82
|
+
:item="editBlogItem"
|
|
83
|
+
@success="onEditSuccess"
|
|
84
|
+
/>
|
|
85
|
+
</div>
|
|
85
86
|
</template>
|
|
86
87
|
|
|
87
88
|
<script setup>
|
|
@@ -91,14 +92,14 @@ import { useNuxtApp } from "nuxt/app";
|
|
|
91
92
|
import { useConvert } from "@/runtime/composables/useConvert";
|
|
92
93
|
import { useApi } from "../../composables/useApi";
|
|
93
94
|
const { convertNumber, convertDateTorelativeText } = useConvert();
|
|
94
|
-
const { $toast } = useNuxtApp();
|
|
95
|
+
const { $toast, $alert } = useNuxtApp();
|
|
95
96
|
const api = useApi();
|
|
96
97
|
const props = defineProps({
|
|
97
98
|
item: { type: Object, required: true },
|
|
98
99
|
isMyProfile: { type: Boolean, required: false, default: false }
|
|
99
100
|
});
|
|
100
101
|
const router = useRouter();
|
|
101
|
-
const emit = defineEmits(["blog-updated"]);
|
|
102
|
+
const emit = defineEmits(["blog-edit", "blog-updated", "blog-deleted"]);
|
|
102
103
|
const isPinned = ref(props.item.is_pinned);
|
|
103
104
|
const isEditDrawerOpen = ref(false);
|
|
104
105
|
const editBlogItem = ref(null);
|
|
@@ -148,10 +149,30 @@ const onBlogEdit = async () => {
|
|
|
148
149
|
};
|
|
149
150
|
isEditDrawerOpen.value = true;
|
|
150
151
|
} catch (e) {
|
|
151
|
-
$toast.error(
|
|
152
|
+
$toast.error(
|
|
153
|
+
e?.data?.message?.description || "\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E42\u0E2B\u0E25\u0E14\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E1A\u0E17\u0E04\u0E27\u0E32\u0E21\u0E44\u0E14\u0E49"
|
|
154
|
+
);
|
|
152
155
|
}
|
|
153
156
|
};
|
|
154
157
|
const onEditSuccess = () => {
|
|
155
158
|
emit("blog-updated");
|
|
156
159
|
};
|
|
160
|
+
const onBlogDelete = async () => {
|
|
161
|
+
const { isConfirmed } = await $alert.show({
|
|
162
|
+
type: "warning",
|
|
163
|
+
title: "\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E25\u0E1A\u0E1A\u0E25\u0E47\u0E2D\u0E01\u0E19\u0E35\u0E49\u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48 ?",
|
|
164
|
+
description: "\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E01\u0E39\u0E49\u0E04\u0E37\u0E19\u0E42\u0E1E\u0E2A\u0E15\u0E4C\u0E17\u0E35\u0E48\u0E04\u0E38\u0E13\u0E25\u0E1A\u0E44\u0E1B\u0E41\u0E25\u0E49\u0E27\u0E44\u0E14\u0E49",
|
|
165
|
+
confirmText: "\u0E25\u0E1A",
|
|
166
|
+
cancelText: "\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01",
|
|
167
|
+
showCancelBtn: true
|
|
168
|
+
});
|
|
169
|
+
if (!isConfirmed) return;
|
|
170
|
+
try {
|
|
171
|
+
await api(`/blogs/${props.item.id}`, { method: "DELETE" });
|
|
172
|
+
$toast.success("\u0E25\u0E1A\u0E1A\u0E17\u0E04\u0E27\u0E32\u0E21\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08");
|
|
173
|
+
emit("blog-deleted");
|
|
174
|
+
} catch (e) {
|
|
175
|
+
$toast.error(e?.data?.message?.description || "\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E25\u0E1A\u0E1A\u0E17\u0E04\u0E27\u0E32\u0E21\u0E44\u0E14\u0E49");
|
|
176
|
+
}
|
|
177
|
+
};
|
|
157
178
|
</script>
|
|
@@ -24,9 +24,13 @@ type __VLS_Props = {
|
|
|
24
24
|
isMyProfile?: boolean;
|
|
25
25
|
};
|
|
26
26
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
27
|
+
"blog-edit": () => any;
|
|
27
28
|
"blog-updated": () => any;
|
|
29
|
+
"blog-deleted": () => any;
|
|
28
30
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
31
|
+
"onBlog-edit"?: (() => any) | undefined;
|
|
29
32
|
"onBlog-updated"?: (() => any) | undefined;
|
|
33
|
+
"onBlog-deleted"?: (() => any) | undefined;
|
|
30
34
|
}>, {
|
|
31
35
|
isMyProfile: boolean;
|
|
32
36
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { PickerOptionMenuUserProps } from "@/types/components/picker/picker-option-menu/picker-option-menu-user";
|
|
2
2
|
declare const __VLS_export: import("vue").DefineComponent<PickerOptionMenuUserProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
3
|
+
"blog-edit": () => any;
|
|
3
4
|
"report-announce": () => any;
|
|
4
5
|
"blog-unpin": () => any;
|
|
5
6
|
"blog-pin": () => any;
|
|
6
|
-
"blog-
|
|
7
|
+
"blog-delete": () => any;
|
|
7
8
|
"profile-name-updated": (name: string) => any;
|
|
8
9
|
"profile-edit": () => any;
|
|
9
10
|
"profile-share": () => any;
|
|
10
11
|
"profile-follower-delete": () => any;
|
|
11
12
|
"profile-block": () => any;
|
|
12
|
-
"blog-delete": () => any;
|
|
13
13
|
"report-blog": () => any;
|
|
14
14
|
"report-place": () => any;
|
|
15
15
|
"report-profile": () => any;
|
|
@@ -19,16 +19,16 @@ declare const __VLS_export: import("vue").DefineComponent<PickerOptionMenuUserPr
|
|
|
19
19
|
"review-delete": () => any;
|
|
20
20
|
archive: () => any;
|
|
21
21
|
}, string, import("vue").PublicProps, Readonly<PickerOptionMenuUserProps> & Readonly<{
|
|
22
|
+
"onBlog-edit"?: (() => any) | undefined;
|
|
22
23
|
"onReport-announce"?: (() => any) | undefined;
|
|
23
24
|
"onBlog-unpin"?: (() => any) | undefined;
|
|
24
25
|
"onBlog-pin"?: (() => any) | undefined;
|
|
25
|
-
"onBlog-
|
|
26
|
+
"onBlog-delete"?: (() => any) | undefined;
|
|
26
27
|
"onProfile-name-updated"?: ((name: string) => any) | undefined;
|
|
27
28
|
"onProfile-edit"?: (() => any) | undefined;
|
|
28
29
|
"onProfile-share"?: (() => any) | undefined;
|
|
29
30
|
"onProfile-follower-delete"?: (() => any) | undefined;
|
|
30
31
|
"onProfile-block"?: (() => any) | undefined;
|
|
31
|
-
"onBlog-delete"?: (() => any) | undefined;
|
|
32
32
|
"onReport-blog"?: (() => any) | undefined;
|
|
33
33
|
"onReport-place"?: (() => any) | undefined;
|
|
34
34
|
"onReport-profile"?: (() => any) | undefined;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { PickerOptionMenuUserProps } from "@/types/components/picker/picker-option-menu/picker-option-menu-user";
|
|
2
2
|
declare const __VLS_export: import("vue").DefineComponent<PickerOptionMenuUserProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
3
|
+
"blog-edit": () => any;
|
|
3
4
|
"report-announce": () => any;
|
|
4
5
|
"blog-unpin": () => any;
|
|
5
6
|
"blog-pin": () => any;
|
|
6
|
-
"blog-
|
|
7
|
+
"blog-delete": () => any;
|
|
7
8
|
"profile-name-updated": (name: string) => any;
|
|
8
9
|
"profile-edit": () => any;
|
|
9
10
|
"profile-share": () => any;
|
|
10
11
|
"profile-follower-delete": () => any;
|
|
11
12
|
"profile-block": () => any;
|
|
12
|
-
"blog-delete": () => any;
|
|
13
13
|
"report-blog": () => any;
|
|
14
14
|
"report-place": () => any;
|
|
15
15
|
"report-profile": () => any;
|
|
@@ -19,16 +19,16 @@ declare const __VLS_export: import("vue").DefineComponent<PickerOptionMenuUserPr
|
|
|
19
19
|
"review-delete": () => any;
|
|
20
20
|
archive: () => any;
|
|
21
21
|
}, string, import("vue").PublicProps, Readonly<PickerOptionMenuUserProps> & Readonly<{
|
|
22
|
+
"onBlog-edit"?: (() => any) | undefined;
|
|
22
23
|
"onReport-announce"?: (() => any) | undefined;
|
|
23
24
|
"onBlog-unpin"?: (() => any) | undefined;
|
|
24
25
|
"onBlog-pin"?: (() => any) | undefined;
|
|
25
|
-
"onBlog-
|
|
26
|
+
"onBlog-delete"?: (() => any) | undefined;
|
|
26
27
|
"onProfile-name-updated"?: ((name: string) => any) | undefined;
|
|
27
28
|
"onProfile-edit"?: (() => any) | undefined;
|
|
28
29
|
"onProfile-share"?: (() => any) | undefined;
|
|
29
30
|
"onProfile-follower-delete"?: (() => any) | undefined;
|
|
30
31
|
"onProfile-block"?: (() => any) | undefined;
|
|
31
|
-
"onBlog-delete"?: (() => any) | undefined;
|
|
32
32
|
"onReport-blog"?: (() => any) | undefined;
|
|
33
33
|
"onReport-place"?: (() => any) | undefined;
|
|
34
34
|
"onReport-profile"?: (() => any) | undefined;
|