pukaad-ui-lib 1.238.0 → 1.239.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
CHANGED
|
@@ -25,12 +25,16 @@ type __VLS_Props = {
|
|
|
25
25
|
};
|
|
26
26
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
27
27
|
"blog-edit": () => any;
|
|
28
|
-
"blog-
|
|
29
|
-
"blog-
|
|
28
|
+
"blog-pinned": (id: string) => any;
|
|
29
|
+
"blog-unpinned": (id: string) => any;
|
|
30
|
+
"blog-updated": (id: string, data: any) => any;
|
|
31
|
+
"blog-deleted": (id: string) => any;
|
|
30
32
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
31
33
|
"onBlog-edit"?: (() => any) | undefined;
|
|
32
|
-
"onBlog-
|
|
33
|
-
"onBlog-
|
|
34
|
+
"onBlog-pinned"?: ((id: string) => any) | undefined;
|
|
35
|
+
"onBlog-unpinned"?: ((id: string) => any) | undefined;
|
|
36
|
+
"onBlog-updated"?: ((id: string, data: any) => any) | undefined;
|
|
37
|
+
"onBlog-deleted"?: ((id: string) => any) | undefined;
|
|
34
38
|
}>, {
|
|
35
39
|
isMyProfile: boolean;
|
|
36
40
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -99,7 +99,7 @@ const props = defineProps({
|
|
|
99
99
|
isMyProfile: { type: Boolean, required: false, default: false }
|
|
100
100
|
});
|
|
101
101
|
const router = useRouter();
|
|
102
|
-
const emit = defineEmits(["blog-edit", "blog-updated", "blog-deleted"]);
|
|
102
|
+
const emit = defineEmits(["blog-edit", "blog-pinned", "blog-unpinned", "blog-updated", "blog-deleted"]);
|
|
103
103
|
const isPinned = ref(props.item.is_pinned);
|
|
104
104
|
const isEditDrawerOpen = ref(false);
|
|
105
105
|
const editBlogItem = ref(null);
|
|
@@ -117,6 +117,7 @@ const onBlogPin = async () => {
|
|
|
117
117
|
await api(`/blogs/${props.item.id}/pin`, { method: "POST" });
|
|
118
118
|
isPinned.value = true;
|
|
119
119
|
$toast.success("\u0E1B\u0E31\u0E01\u0E2B\u0E21\u0E38\u0E14\u0E1A\u0E17\u0E04\u0E27\u0E32\u0E21\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08");
|
|
120
|
+
emit("blog-pinned", props.item.id);
|
|
120
121
|
} catch (e) {
|
|
121
122
|
$toast.error(e?.data?.message?.description || "\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E1B\u0E31\u0E01\u0E2B\u0E21\u0E38\u0E14\u0E44\u0E14\u0E49");
|
|
122
123
|
}
|
|
@@ -126,6 +127,7 @@ const onBlogUnpin = async () => {
|
|
|
126
127
|
await api(`/blogs/${props.item.id}/pin`, { method: "DELETE" });
|
|
127
128
|
isPinned.value = false;
|
|
128
129
|
$toast.success("\u0E40\u0E2D\u0E32\u0E2B\u0E21\u0E38\u0E14\u0E2D\u0E2D\u0E01\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08");
|
|
130
|
+
emit("blog-unpinned", props.item.id);
|
|
129
131
|
} catch (e) {
|
|
130
132
|
$toast.error(e?.data?.message?.description || "\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E40\u0E2D\u0E32\u0E2B\u0E21\u0E38\u0E14\u0E2D\u0E2D\u0E01\u0E44\u0E14\u0E49");
|
|
131
133
|
}
|
|
@@ -154,8 +156,8 @@ const onBlogEdit = async () => {
|
|
|
154
156
|
);
|
|
155
157
|
}
|
|
156
158
|
};
|
|
157
|
-
const onEditSuccess = () => {
|
|
158
|
-
emit("blog-updated");
|
|
159
|
+
const onEditSuccess = (data) => {
|
|
160
|
+
emit("blog-updated", props.item.id, data);
|
|
159
161
|
};
|
|
160
162
|
const onBlogDelete = async () => {
|
|
161
163
|
const { isConfirmed } = await $alert.show({
|
|
@@ -170,7 +172,7 @@ const onBlogDelete = async () => {
|
|
|
170
172
|
try {
|
|
171
173
|
await api(`/blogs/${props.item.id}`, { method: "DELETE" });
|
|
172
174
|
$toast.success("\u0E25\u0E1A\u0E1A\u0E17\u0E04\u0E27\u0E32\u0E21\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08");
|
|
173
|
-
emit("blog-deleted");
|
|
175
|
+
emit("blog-deleted", props.item.id);
|
|
174
176
|
} catch (e) {
|
|
175
177
|
$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
178
|
}
|
|
@@ -25,12 +25,16 @@ type __VLS_Props = {
|
|
|
25
25
|
};
|
|
26
26
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
27
27
|
"blog-edit": () => any;
|
|
28
|
-
"blog-
|
|
29
|
-
"blog-
|
|
28
|
+
"blog-pinned": (id: string) => any;
|
|
29
|
+
"blog-unpinned": (id: string) => any;
|
|
30
|
+
"blog-updated": (id: string, data: any) => any;
|
|
31
|
+
"blog-deleted": (id: string) => any;
|
|
30
32
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
31
33
|
"onBlog-edit"?: (() => any) | undefined;
|
|
32
|
-
"onBlog-
|
|
33
|
-
"onBlog-
|
|
34
|
+
"onBlog-pinned"?: ((id: string) => any) | undefined;
|
|
35
|
+
"onBlog-unpinned"?: ((id: string) => any) | undefined;
|
|
36
|
+
"onBlog-updated"?: ((id: string, data: any) => any) | undefined;
|
|
37
|
+
"onBlog-deleted"?: ((id: string) => any) | undefined;
|
|
34
38
|
}>, {
|
|
35
39
|
isMyProfile: boolean;
|
|
36
40
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|