pukaad-ui-lib 1.170.0 → 1.170.1
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-reaction.d.vue.ts +4 -0
- package/dist/runtime/components/card/card-reaction.vue +19 -3
- package/dist/runtime/components/card/card-reaction.vue.d.ts +4 -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/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -18,10 +18,14 @@ type __VLS_Props = {
|
|
|
18
18
|
disabledDividerBottom?: boolean;
|
|
19
19
|
disabled?: boolean;
|
|
20
20
|
iconSize?: number | string;
|
|
21
|
+
id?: string;
|
|
22
|
+
state?: string;
|
|
21
23
|
};
|
|
22
24
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
25
|
+
id: string;
|
|
23
26
|
disabled: boolean;
|
|
24
27
|
disabledPadding: boolean;
|
|
28
|
+
state: string;
|
|
25
29
|
itemCount: Count;
|
|
26
30
|
itemActive: Reacted;
|
|
27
31
|
padding: string | number;
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
<script setup>
|
|
34
34
|
import { computed, reactive, ref, watch } from "vue";
|
|
35
|
+
import { useApi } from "../../composables/useApi";
|
|
35
36
|
const isOpenModalShare = ref(false);
|
|
36
37
|
const props = defineProps({
|
|
37
38
|
itemCount: { type: Object, required: false, default: () => ({
|
|
@@ -50,7 +51,9 @@ const props = defineProps({
|
|
|
50
51
|
disabledDividerTop: { type: Boolean, required: false, default: false },
|
|
51
52
|
disabledDividerBottom: { type: Boolean, required: false, default: false },
|
|
52
53
|
disabled: { type: Boolean, required: false, default: false },
|
|
53
|
-
iconSize: { type: [Number, String], required: false, default: 20 }
|
|
54
|
+
iconSize: { type: [Number, String], required: false, default: 20 },
|
|
55
|
+
id: { type: String, required: false, default: "" },
|
|
56
|
+
state: { type: String, required: false, default: "" }
|
|
54
57
|
});
|
|
55
58
|
const computedPadding = computed(
|
|
56
59
|
() => props.disabledPadding ? 0 : props.padding
|
|
@@ -110,9 +113,22 @@ const reactions = [
|
|
|
110
113
|
action: toggleShared
|
|
111
114
|
}
|
|
112
115
|
];
|
|
113
|
-
function toggleLike() {
|
|
114
|
-
|
|
116
|
+
async function toggleLike() {
|
|
117
|
+
const previousLiked = reaction.liked;
|
|
118
|
+
reaction.liked = !previousLiked;
|
|
115
119
|
counts.liked += reaction.liked ? 1 : -1;
|
|
120
|
+
if (props.state === "blog" && props.id) {
|
|
121
|
+
try {
|
|
122
|
+
const api = useApi();
|
|
123
|
+
await api(`/blogs/${props.id}/like`, {
|
|
124
|
+
method: reaction.liked ? "POST" : "DELETE"
|
|
125
|
+
});
|
|
126
|
+
} catch (error) {
|
|
127
|
+
console.error(error);
|
|
128
|
+
reaction.liked = previousLiked;
|
|
129
|
+
counts.liked += previousLiked ? 1 : -1;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
116
132
|
}
|
|
117
133
|
function toggleBookmark() {
|
|
118
134
|
reaction.bookmarked = !reaction.bookmarked;
|
|
@@ -18,10 +18,14 @@ type __VLS_Props = {
|
|
|
18
18
|
disabledDividerBottom?: boolean;
|
|
19
19
|
disabled?: boolean;
|
|
20
20
|
iconSize?: number | string;
|
|
21
|
+
id?: string;
|
|
22
|
+
state?: string;
|
|
21
23
|
};
|
|
22
24
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
25
|
+
id: string;
|
|
23
26
|
disabled: boolean;
|
|
24
27
|
disabledPadding: boolean;
|
|
28
|
+
state: string;
|
|
25
29
|
itemCount: Count;
|
|
26
30
|
itemActive: Reacted;
|
|
27
31
|
padding: string | number;
|
|
@@ -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;
|