pukaad-ui-lib 1.264.0 → 1.265.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-blog.d.vue.ts +39 -0
- package/dist/runtime/components/card/card-blog.vue +72 -0
- package/dist/runtime/components/card/card-blog.vue.d.ts +39 -0
- package/package.json +1 -1
- /package/dist/runtime/assets/svg/socials/{Whatsapp.svg → WhatsApp.svg} +0 -0
package/dist/module.json
CHANGED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
interface User {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
avatar: string;
|
|
5
|
+
path_name: string;
|
|
6
|
+
}
|
|
7
|
+
interface CardBlogProps {
|
|
8
|
+
id: string;
|
|
9
|
+
is_pinned?: boolean;
|
|
10
|
+
user: User;
|
|
11
|
+
create_at: string;
|
|
12
|
+
title: string;
|
|
13
|
+
description: string;
|
|
14
|
+
image?: string;
|
|
15
|
+
like_count: number;
|
|
16
|
+
comment_count: number;
|
|
17
|
+
share_count: number;
|
|
18
|
+
}
|
|
19
|
+
type __VLS_Props = {
|
|
20
|
+
item: CardBlogProps;
|
|
21
|
+
isMyProfile?: boolean;
|
|
22
|
+
};
|
|
23
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
24
|
+
"blog-edit": () => any;
|
|
25
|
+
"blog-pinned": (id: string) => any;
|
|
26
|
+
"blog-unpinned": (id: string) => any;
|
|
27
|
+
"blog-updated": (id: string, data: any) => any;
|
|
28
|
+
"blog-deleted": (id: string) => any;
|
|
29
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
30
|
+
"onBlog-edit"?: (() => any) | undefined;
|
|
31
|
+
"onBlog-pinned"?: ((id: string) => any) | undefined;
|
|
32
|
+
"onBlog-unpinned"?: ((id: string) => any) | undefined;
|
|
33
|
+
"onBlog-updated"?: ((id: string, data: any) => any) | undefined;
|
|
34
|
+
"onBlog-deleted"?: ((id: string) => any) | undefined;
|
|
35
|
+
}>, {
|
|
36
|
+
isMyProfile: boolean;
|
|
37
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
38
|
+
declare const _default: typeof __VLS_export;
|
|
39
|
+
export default _default;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex gap-[16px] cursor-pointer items-start" @click="onClick">
|
|
3
|
+
<Image v-if="props.item.image" :src="props.item.image" :width="227" :height="128" class="rounded-[4px]"
|
|
4
|
+
fit="cover" />
|
|
5
|
+
<div class="flex flex-col gap-[4px] w-full">
|
|
6
|
+
<div class="font-title-small-prominent line-clamp-2">
|
|
7
|
+
{{ props.item.title }}
|
|
8
|
+
</div>
|
|
9
|
+
<div class="flex gap-[4px] text-body-medium items-center flex-wrap">
|
|
10
|
+
<div class="flex gap-[4px] items-center">
|
|
11
|
+
<div>{{ props.item.user.name }}</div>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="text-gray flex gap-[4px] items-center">
|
|
14
|
+
<div>•</div>
|
|
15
|
+
<div>{{ convertDateTorelativeText(props.item.create_at) }}</div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="text-body-large text-gray line-clamp-2">
|
|
19
|
+
{{ props.item.description }}
|
|
20
|
+
</div>
|
|
21
|
+
<div class="flex justify-between">
|
|
22
|
+
<div class="flex gap-[24px] text-body-large text-gray">
|
|
23
|
+
<div class="flex items-center gap-[4px]">
|
|
24
|
+
<Icon name="pukaad:thumbs-up-regular" :size="20" />
|
|
25
|
+
<div>{{ convertNumber(props.item.like_count) }}</div>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="flex items-center gap-[4px]">
|
|
28
|
+
<Icon name="lucide:message-circle-more" :size="20" />
|
|
29
|
+
<div>{{ convertNumber(props.item.comment_count) }}</div>
|
|
30
|
+
</div>
|
|
31
|
+
<div class="flex items-center gap-[4px]">
|
|
32
|
+
<Icon name="uil:share" :size="20" />
|
|
33
|
+
<div>{{ convertNumber(props.item.share_count) }}</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div class="flex items-center gap-[8px] text-gray" @click.stop>
|
|
38
|
+
<Icon v-if="isPinned" name="mage:pin-fill" :size="20" />
|
|
39
|
+
<PickerOptionMenuUser :state="
|
|
40
|
+
props.isMyProfile ? isPinned ? 'my-blog-pined' : 'my-blog' : 'report-announce'
|
|
41
|
+
" disabled-padding @blog-unpin="$emit('blog-unpinned', props.item.id)"
|
|
42
|
+
@blog-pin="$emit('blog-pinned', props.item.id)" @blog-edit="$emit('blog-edit')"
|
|
43
|
+
@blog-delete="$emit('blog-deleted', props.item.id)" />
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script setup>
|
|
52
|
+
import { useConvert } from "#pukaad-ui/runtime/composables/useConvert";
|
|
53
|
+
import { useRouter } from "vue-router";
|
|
54
|
+
import { ref, watch } from "vue";
|
|
55
|
+
const { convertNumber, convertDateTorelativeText } = useConvert();
|
|
56
|
+
const router = useRouter();
|
|
57
|
+
const props = defineProps({
|
|
58
|
+
item: { type: Object, required: true },
|
|
59
|
+
isMyProfile: { type: Boolean, required: false, default: false }
|
|
60
|
+
});
|
|
61
|
+
const emit = defineEmits(["blog-edit", "blog-pinned", "blog-unpinned", "blog-updated", "blog-deleted"]);
|
|
62
|
+
const isPinned = ref(props.item.is_pinned);
|
|
63
|
+
watch(
|
|
64
|
+
() => props.item.is_pinned,
|
|
65
|
+
(val) => {
|
|
66
|
+
isPinned.value = !!val;
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
const onClick = () => {
|
|
70
|
+
router.push(`/blog/${props.item.id}`);
|
|
71
|
+
};
|
|
72
|
+
</script>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
interface User {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
avatar: string;
|
|
5
|
+
path_name: string;
|
|
6
|
+
}
|
|
7
|
+
interface CardBlogProps {
|
|
8
|
+
id: string;
|
|
9
|
+
is_pinned?: boolean;
|
|
10
|
+
user: User;
|
|
11
|
+
create_at: string;
|
|
12
|
+
title: string;
|
|
13
|
+
description: string;
|
|
14
|
+
image?: string;
|
|
15
|
+
like_count: number;
|
|
16
|
+
comment_count: number;
|
|
17
|
+
share_count: number;
|
|
18
|
+
}
|
|
19
|
+
type __VLS_Props = {
|
|
20
|
+
item: CardBlogProps;
|
|
21
|
+
isMyProfile?: boolean;
|
|
22
|
+
};
|
|
23
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
24
|
+
"blog-edit": () => any;
|
|
25
|
+
"blog-pinned": (id: string) => any;
|
|
26
|
+
"blog-unpinned": (id: string) => any;
|
|
27
|
+
"blog-updated": (id: string, data: any) => any;
|
|
28
|
+
"blog-deleted": (id: string) => any;
|
|
29
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
30
|
+
"onBlog-edit"?: (() => any) | undefined;
|
|
31
|
+
"onBlog-pinned"?: ((id: string) => any) | undefined;
|
|
32
|
+
"onBlog-unpinned"?: ((id: string) => any) | undefined;
|
|
33
|
+
"onBlog-updated"?: ((id: string, data: any) => any) | undefined;
|
|
34
|
+
"onBlog-deleted"?: ((id: string) => any) | undefined;
|
|
35
|
+
}>, {
|
|
36
|
+
isMyProfile: boolean;
|
|
37
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
38
|
+
declare const _default: typeof __VLS_export;
|
|
39
|
+
export default _default;
|
package/package.json
CHANGED
|
File without changes
|