pukaad-ui-lib 1.416.0 → 1.418.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-content/card-content-menu.d.vue.ts +4 -1
- package/dist/runtime/components/card/card-content/card-content-menu.vue +41 -13
- package/dist/runtime/components/card/card-content/card-content-menu.vue.d.ts +4 -1
- package/dist/runtime/components/card/card-content/card-content.vue +5 -6
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { CardContentMenuState } from "#pukaad-ui/types/components/card/card-content";
|
|
1
|
+
import type { CardContentMenuState, CardContentItem } from "#pukaad-ui/types/components/card/card-content";
|
|
2
2
|
type __VLS_Props = {
|
|
3
|
+
item?: CardContentItem;
|
|
3
4
|
state?: CardContentMenuState;
|
|
4
5
|
isPinned?: boolean;
|
|
6
|
+
isHidden?: boolean;
|
|
5
7
|
isBookmarked?: boolean;
|
|
6
8
|
isShow?: boolean;
|
|
7
9
|
hidePin?: boolean;
|
|
@@ -14,6 +16,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
14
16
|
onAction?: ((name: string) => any) | undefined;
|
|
15
17
|
}>, {
|
|
16
18
|
isPinned: boolean;
|
|
19
|
+
isHidden: boolean;
|
|
17
20
|
isBookmarked: boolean;
|
|
18
21
|
isShow: boolean;
|
|
19
22
|
hidePin: boolean;
|
|
@@ -18,8 +18,10 @@
|
|
|
18
18
|
<script setup>
|
|
19
19
|
import { computed } from "vue";
|
|
20
20
|
const props = defineProps({
|
|
21
|
+
item: { type: Object, required: false },
|
|
21
22
|
state: { type: String, required: false },
|
|
22
23
|
isPinned: { type: Boolean, required: false, default: false },
|
|
24
|
+
isHidden: { type: Boolean, required: false, default: false },
|
|
23
25
|
isBookmarked: { type: Boolean, required: false, default: false },
|
|
24
26
|
isShow: { type: Boolean, required: false, default: false },
|
|
25
27
|
hidePin: { type: Boolean, required: false, default: false },
|
|
@@ -31,23 +33,47 @@ const onActionClick = (action) => {
|
|
|
31
33
|
if (action.clickable === false) return;
|
|
32
34
|
emit("action", action.name);
|
|
33
35
|
};
|
|
36
|
+
const isPinned = computed(() => props.item?.pinned ?? props.isPinned);
|
|
37
|
+
const isHidden = computed(() => props.item?.hidden ?? props.isHidden);
|
|
38
|
+
const isBookmarked = computed(() => props.item?.bookmarked ?? props.isBookmarked);
|
|
34
39
|
const actions = computed(() => {
|
|
35
40
|
if (props.state === "my-content") {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
const result = [];
|
|
42
|
+
if (!props.hidePin && !isHidden.value) {
|
|
43
|
+
result.push({
|
|
44
|
+
name: "pin",
|
|
45
|
+
icon: "lucide:pin",
|
|
46
|
+
isActive: isPinned.value
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
if (!isPinned.value) {
|
|
50
|
+
result.push({
|
|
51
|
+
name: "hide",
|
|
52
|
+
icon: isHidden.value ? "lucide:eye-off" : "lucide:eye",
|
|
53
|
+
isActive: isHidden.value
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (!props.hidePreview) {
|
|
57
|
+
result.push({
|
|
58
|
+
name: "preview",
|
|
59
|
+
icon: "lucide:tv-minimal-play"
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
result.push({
|
|
63
|
+
name: "renew",
|
|
64
|
+
icon: "lucide:history"
|
|
65
|
+
});
|
|
66
|
+
result.push({
|
|
67
|
+
name: "delete",
|
|
68
|
+
icon: "lucide:trash-2",
|
|
69
|
+
variant: "default",
|
|
70
|
+
color: "destructive"
|
|
71
|
+
});
|
|
72
|
+
return result;
|
|
47
73
|
}
|
|
48
74
|
if (props.state === "content") {
|
|
49
75
|
const result = [];
|
|
50
|
-
if (
|
|
76
|
+
if (isPinned.value) {
|
|
51
77
|
result.push({
|
|
52
78
|
name: "pin",
|
|
53
79
|
icon: "lucide:pin",
|
|
@@ -59,8 +85,10 @@ const actions = computed(() => {
|
|
|
59
85
|
result.push({
|
|
60
86
|
name: "bookmark",
|
|
61
87
|
icon: "lucide:bookmark",
|
|
62
|
-
isActive:
|
|
88
|
+
isActive: isBookmarked.value
|
|
63
89
|
});
|
|
90
|
+
}
|
|
91
|
+
if (!props.hideBookmark && !props.hidePreview) {
|
|
64
92
|
result.push({ name: "preview", icon: "lucide:tv-minimal-play" });
|
|
65
93
|
}
|
|
66
94
|
return result;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { CardContentMenuState } from "#pukaad-ui/types/components/card/card-content";
|
|
1
|
+
import type { CardContentMenuState, CardContentItem } from "#pukaad-ui/types/components/card/card-content";
|
|
2
2
|
type __VLS_Props = {
|
|
3
|
+
item?: CardContentItem;
|
|
3
4
|
state?: CardContentMenuState;
|
|
4
5
|
isPinned?: boolean;
|
|
6
|
+
isHidden?: boolean;
|
|
5
7
|
isBookmarked?: boolean;
|
|
6
8
|
isShow?: boolean;
|
|
7
9
|
hidePin?: boolean;
|
|
@@ -14,6 +16,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
14
16
|
onAction?: ((name: string) => any) | undefined;
|
|
15
17
|
}>, {
|
|
16
18
|
isPinned: boolean;
|
|
19
|
+
isHidden: boolean;
|
|
17
20
|
isBookmarked: boolean;
|
|
18
21
|
isShow: boolean;
|
|
19
22
|
hidePin: boolean;
|
|
@@ -25,13 +25,12 @@
|
|
|
25
25
|
|
|
26
26
|
<div v-if="hasMenu" class="absolute left-[146px] top-[8px] z-content">
|
|
27
27
|
<CardContentMenu
|
|
28
|
+
:item="props.item"
|
|
28
29
|
:state="props.state"
|
|
29
|
-
:is-pinned="!!props.item.pinned"
|
|
30
|
-
:is-bookmarked="!!props.item.bookmarked"
|
|
31
|
-
:hide-pin="!!props.hidePin"
|
|
32
|
-
:hide-preview="!!props.hidePreview"
|
|
33
|
-
:hide-bookmark="!!props.hideBookmark"
|
|
34
30
|
:is-show="isMenuShow"
|
|
31
|
+
:hide-pin="props.hidePin"
|
|
32
|
+
:hide-preview="props.hidePreview"
|
|
33
|
+
:hide-bookmark="props.hideBookmark"
|
|
35
34
|
@action="onMenuAction"
|
|
36
35
|
/>
|
|
37
36
|
</div>
|
|
@@ -104,7 +103,7 @@ const showTime = computed(() => !!props.item.expireAt);
|
|
|
104
103
|
const hasMenu = computed(() => {
|
|
105
104
|
if (props.selectable || !props.state) return false;
|
|
106
105
|
if (props.disable) {
|
|
107
|
-
return !!(props.item.pinned && !props.hidePin || props.item.bookmarked && !props.hideBookmark);
|
|
106
|
+
return !!(props.item.pinned && !props.hidePin || props.item.hidden || props.item.bookmarked && !props.hideBookmark);
|
|
108
107
|
}
|
|
109
108
|
return true;
|
|
110
109
|
});
|