pukaad-ui-lib 1.417.0 → 1.419.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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
3
  "configKey": "pukaadUI",
4
- "version": "1.417.0",
4
+ "version": "1.419.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -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,9 +33,14 @@ 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(
39
+ () => props.item?.bookmarked ?? props.isBookmarked
40
+ );
34
41
  const actions = computed(() => {
35
42
  if (props.state === "my-content") {
36
- const pinAction = props.hidePin ? [] : [{ name: "pin", icon: "lucide:pin", isActive: props.isPinned }];
43
+ const pinAction = props.hidePin ? [] : [{ name: "pin", icon: "lucide:pin", isActive: isPinned.value }];
37
44
  return [
38
45
  ...pinAction,
39
46
  ...props.hidePreview ? [] : [{ name: "preview", icon: "lucide:tv-minimal-play" }],
@@ -45,9 +52,43 @@ const actions = computed(() => {
45
52
  }
46
53
  ];
47
54
  }
55
+ if (props.state === "business") {
56
+ const result = [];
57
+ if (!props.hidePin && !isHidden.value) {
58
+ result.push({
59
+ name: "pin",
60
+ icon: "lucide:pin",
61
+ isActive: isPinned.value
62
+ });
63
+ }
64
+ if (!isPinned.value) {
65
+ result.push({
66
+ name: "hide",
67
+ icon: isHidden.value ? "lucide:eye-off" : "lucide:eye",
68
+ isActive: isHidden.value
69
+ });
70
+ }
71
+ if (!props.hidePreview) {
72
+ result.push({
73
+ name: "preview",
74
+ icon: "lucide:tv-minimal-play"
75
+ });
76
+ }
77
+ result.push({
78
+ name: "renew",
79
+ icon: "lucide:history"
80
+ });
81
+ result.push({
82
+ name: "delete",
83
+ icon: "lucide:trash-2",
84
+ variant: "default",
85
+ color: "destructive"
86
+ });
87
+ return result;
88
+ }
48
89
  if (props.state === "content") {
49
90
  const result = [];
50
- if (props.isPinned) {
91
+ if (isPinned.value) {
51
92
  result.push({
52
93
  name: "pin",
53
94
  icon: "lucide:pin",
@@ -59,7 +100,7 @@ const actions = computed(() => {
59
100
  result.push({
60
101
  name: "bookmark",
61
102
  icon: "lucide:bookmark",
62
- isActive: props.isBookmarked
103
+ isActive: isBookmarked.value
63
104
  });
64
105
  }
65
106
  if (!props.hideBookmark && !props.hidePreview) {
@@ -67,6 +108,24 @@ const actions = computed(() => {
67
108
  }
68
109
  return result;
69
110
  }
111
+ if (props.state === "draft") {
112
+ return [
113
+ {
114
+ name: "preview",
115
+ icon: "lucide:tv-minimal-play"
116
+ },
117
+ {
118
+ name: "edit",
119
+ icon: "lucide:square-pen"
120
+ },
121
+ {
122
+ name: "delete",
123
+ icon: "lucide:trash-2",
124
+ variant: "default",
125
+ color: "destructive"
126
+ }
127
+ ];
128
+ }
70
129
  return [];
71
130
  });
72
131
  const visibleActions = computed(
@@ -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
  });
@@ -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
- crossorigin: "" | "anonymous" | "use-credentials";
68
- background: boolean;
69
- modal: boolean;
70
67
  responsive: boolean;
71
68
  restore: boolean;
72
69
  checkCrossOrigin: boolean;
73
70
  checkOrientation: boolean;
71
+ crossorigin: "" | "anonymous" | "use-credentials";
72
+ modal: boolean;
74
73
  guides: boolean;
75
74
  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
- crossorigin: "" | "anonymous" | "use-credentials";
68
- background: boolean;
69
- modal: boolean;
70
67
  responsive: boolean;
71
68
  restore: boolean;
72
69
  checkCrossOrigin: boolean;
73
70
  checkOrientation: boolean;
71
+ crossorigin: "" | "anonymous" | "use-credentials";
72
+ modal: boolean;
74
73
  guides: boolean;
75
74
  highlight: boolean;
75
+ background: boolean;
76
76
  autoCrop: boolean;
77
77
  movable: boolean;
78
78
  rotatable: boolean;
@@ -69,9 +69,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
69
69
  name: string;
70
70
  required: boolean;
71
71
  description: string;
72
+ options: AutocompleteOption[] | string[] | number[];
72
73
  labelKey: string;
73
74
  placeholder: string;
74
- options: AutocompleteOption[] | string[] | number[];
75
75
  limit: number;
76
76
  disabledErrorMessage: boolean;
77
77
  disabledBorder: boolean;
@@ -69,9 +69,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
69
69
  name: string;
70
70
  required: boolean;
71
71
  description: string;
72
+ options: AutocompleteOption[] | string[] | number[];
72
73
  labelKey: string;
73
74
  placeholder: string;
74
- options: AutocompleteOption[] | string[] | number[];
75
75
  limit: number;
76
76
  disabledErrorMessage: boolean;
77
77
  disabledBorder: boolean;
@@ -11,8 +11,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
11
11
  label: string;
12
12
  name: string;
13
13
  modelValue: LocalizedNameItem[];
14
- placeholder: string;
15
14
  options: InputSelectItem[];
15
+ placeholder: string;
16
16
  limit: number;
17
17
  showCounter: boolean;
18
18
  addLabel: string;
@@ -11,8 +11,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
11
11
  label: string;
12
12
  name: string;
13
13
  modelValue: LocalizedNameItem[];
14
- placeholder: string;
15
14
  options: InputSelectItem[];
15
+ placeholder: string;
16
16
  limit: number;
17
17
  showCounter: boolean;
18
18
  addLabel: string;
@@ -25,8 +25,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
25
25
  "onUpdate:modelValue"?: ((value: SelectedTag[]) => any) | undefined;
26
26
  }>, {
27
27
  name: string;
28
- placeholder: string;
29
28
  state: "user" | "admin";
29
+ placeholder: string;
30
30
  limit: number;
31
31
  ignore: string[];
32
32
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -25,8 +25,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
25
25
  "onUpdate:modelValue"?: ((value: SelectedTag[]) => any) | undefined;
26
26
  }>, {
27
27
  name: string;
28
- placeholder: string;
29
28
  state: "user" | "admin";
29
+ placeholder: string;
30
30
  limit: number;
31
31
  ignore: string[];
32
32
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -59,8 +59,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
59
59
  id: string;
60
60
  name: string;
61
61
  required: boolean;
62
- limit: number;
63
62
  readonly: boolean;
63
+ limit: number;
64
64
  disabledErrorMessage: boolean;
65
65
  disabledBorder: boolean;
66
66
  showCounter: boolean;
@@ -59,8 +59,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
59
59
  id: string;
60
60
  name: string;
61
61
  required: boolean;
62
- limit: number;
63
62
  readonly: boolean;
63
+ limit: number;
64
64
  disabledErrorMessage: boolean;
65
65
  disabledBorder: boolean;
66
66
  showCounter: boolean;
@@ -47,8 +47,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
47
47
  fullHeight: boolean;
48
48
  fullWidth: boolean;
49
49
  rows: number;
50
- limit: number;
51
50
  readonly: boolean;
51
+ limit: number;
52
52
  disabledErrorMessage: boolean;
53
53
  disabledBorder: boolean;
54
54
  showCounter: boolean;
@@ -47,8 +47,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
47
47
  fullHeight: boolean;
48
48
  fullWidth: boolean;
49
49
  rows: number;
50
- limit: number;
51
50
  readonly: boolean;
51
+ limit: number;
52
52
  disabledErrorMessage: boolean;
53
53
  disabledBorder: boolean;
54
54
  showCounter: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.417.0",
3
+ "version": "1.419.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",