pukaad-ui-lib 1.76.0 → 1.78.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.76.0",
4
+ "version": "1.78.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -19,15 +19,7 @@ type __VLS_Props = {
19
19
  disabled?: boolean;
20
20
  iconSize?: number | string;
21
21
  };
22
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
23
- "update:liked": (value: boolean) => any;
24
- "update:bookmarked": (value: boolean) => any;
25
- share: () => any;
26
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
27
- "onUpdate:liked"?: ((value: boolean) => any) | undefined;
28
- "onUpdate:bookmarked"?: ((value: boolean) => any) | undefined;
29
- onShare?: (() => any) | undefined;
30
- }>, {
22
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
31
23
  disabled: boolean;
32
24
  disabledPadding: boolean;
33
25
  itemCount: Count;
@@ -32,8 +32,6 @@
32
32
 
33
33
  <script setup>
34
34
  import { computed, reactive, ref, watch } from "vue";
35
- import { useNuxtApp } from "nuxt/app";
36
- const { $format } = useNuxtApp();
37
35
  const isOpenModalShare = ref(false);
38
36
  const props = defineProps({
39
37
  itemCount: { type: Object, required: false, default: () => ({
@@ -54,7 +52,6 @@ const props = defineProps({
54
52
  disabled: { type: Boolean, required: false, default: false },
55
53
  iconSize: { type: [Number, String], required: false, default: 20 }
56
54
  });
57
- const emit = defineEmits(["update:liked", "update:bookmarked", "share"]);
58
55
  const computedPadding = computed(
59
56
  () => props.disabledPadding ? 0 : props.padding
60
57
  );
@@ -104,7 +101,8 @@ const reactions = [
104
101
  },
105
102
  {
106
103
  name: "commented",
107
- icon: "lucide:message-circle-more"
104
+ icon: "lucide:message-circle-more",
105
+ action: toggleComment
108
106
  },
109
107
  {
110
108
  name: "shared",
@@ -115,15 +113,15 @@ const reactions = [
115
113
  function toggleLike() {
116
114
  reaction.liked = !reaction.liked;
117
115
  counts.liked += reaction.liked ? 1 : -1;
118
- emit("update:liked", reaction.liked);
119
116
  }
120
117
  function toggleBookmark() {
121
118
  reaction.bookmarked = !reaction.bookmarked;
122
119
  counts.bookmarked += reaction.bookmarked ? 1 : -1;
123
- emit("update:bookmarked", reaction.bookmarked);
120
+ }
121
+ function toggleComment() {
122
+ console.log("comment ");
124
123
  }
125
124
  function toggleShared() {
126
125
  isOpenModalShare.value = !isOpenModalShare.value;
127
- emit("share");
128
126
  }
129
127
  </script>
@@ -19,15 +19,7 @@ type __VLS_Props = {
19
19
  disabled?: boolean;
20
20
  iconSize?: number | string;
21
21
  };
22
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
23
- "update:liked": (value: boolean) => any;
24
- "update:bookmarked": (value: boolean) => any;
25
- share: () => any;
26
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
27
- "onUpdate:liked"?: ((value: boolean) => any) | undefined;
28
- "onUpdate:bookmarked"?: ((value: boolean) => any) | undefined;
29
- onShare?: (() => any) | undefined;
30
- }>, {
22
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
31
23
  disabled: boolean;
32
24
  disabledPadding: boolean;
33
25
  itemCount: Count;
@@ -4,9 +4,12 @@ interface User {
4
4
  avatar: string;
5
5
  path_name: string;
6
6
  verified?: boolean;
7
- view_count: number;
8
7
  }
9
- interface Content {
8
+ interface CardUserBlogProps {
9
+ id: string;
10
+ ispinned?: boolean;
11
+ user: User;
12
+ view_count: number;
10
13
  create_at: string;
11
14
  title: string;
12
15
  description: string;
@@ -16,12 +19,6 @@ interface Content {
16
19
  shares_count: number;
17
20
  liked?: boolean;
18
21
  }
19
- interface CardUserBlogProps {
20
- id: string;
21
- ispinned?: boolean;
22
- user: User;
23
- content: Content;
24
- }
25
22
  type __VLS_Props = {
26
23
  item: CardUserBlogProps;
27
24
  isMyProfile?: boolean;
@@ -25,9 +25,9 @@
25
25
  />
26
26
  </div>
27
27
  <div class="text-gray font-body-small flex gap-[4px] items-center">
28
- <div>{{ props.item.content.create_at }}</div>
28
+ <div>{{ props.item.create_at }}</div>
29
29
  <div>•</div>
30
- <div>{{ $format.number(props.item.user.view_count) }} วิว</div>
30
+ <div>{{ $format.number(props.item.view_count) }} วิว</div>
31
31
  </div>
32
32
  </div>
33
33
  </div>
@@ -45,31 +45,31 @@
45
45
  />
46
46
  </div>
47
47
  <Image
48
- v-if="props.item.content.image"
49
- :src="props.item.content.image"
48
+ v-if="props.item.image"
49
+ :src="props.item.image"
50
50
  :width="668"
51
51
  :height="376"
52
52
  fit="fill"
53
53
  />
54
54
  <div class="font-title-medium-prominent">
55
- {{ props.item.content.title }}
55
+ {{ props.item.title }}
56
56
  </div>
57
57
  <div
58
- v-if="!props.item.content.image"
58
+ v-if="!props.item.image"
59
59
  class="text-gray font-body-large line-clamp-4"
60
60
  >
61
- {{ props.item.content.description }}
61
+ {{ props.item.description }}
62
62
  </div>
63
63
  <CardReaction
64
64
  disabled-divider-top
65
65
  disabled-divider-bottom
66
66
  :item-count="{
67
- liked: props.item.content.likes_count,
68
- commented: props.item.content.comments_count,
69
- shared: props.item.content.shares_count
67
+ liked: props.item.likes_count,
68
+ commented: props.item.comments_count,
69
+ shared: props.item.shares_count
70
70
  }"
71
71
  :itemActive="{
72
- liked: props.item.content.liked
72
+ liked: props.item.liked
73
73
  }"
74
74
  />
75
75
  </div>
@@ -4,9 +4,12 @@ interface User {
4
4
  avatar: string;
5
5
  path_name: string;
6
6
  verified?: boolean;
7
- view_count: number;
8
7
  }
9
- interface Content {
8
+ interface CardUserBlogProps {
9
+ id: string;
10
+ ispinned?: boolean;
11
+ user: User;
12
+ view_count: number;
10
13
  create_at: string;
11
14
  title: string;
12
15
  description: string;
@@ -16,12 +19,6 @@ interface Content {
16
19
  shares_count: number;
17
20
  liked?: boolean;
18
21
  }
19
- interface CardUserBlogProps {
20
- id: string;
21
- ispinned?: boolean;
22
- user: User;
23
- content: Content;
24
- }
25
22
  type __VLS_Props = {
26
23
  item: CardUserBlogProps;
27
24
  isMyProfile?: boolean;
@@ -117,6 +117,7 @@ const onSaveDraft = () => {
117
117
  };
118
118
  const onSubmit = () => {
119
119
  emit("submit", form.value);
120
+ console.log("onSubmit", form.value);
120
121
  isOpen.value = false;
121
122
  };
122
123
  </script>
@@ -36,9 +36,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
36
36
  id: string;
37
37
  name: string;
38
38
  description: string;
39
- limit: number;
40
39
  options: AutocompleteOption[] | string[] | number[];
41
40
  placeholder: string;
41
+ limit: number;
42
42
  disabledErrorMessage: boolean;
43
43
  disabledBorder: boolean;
44
44
  showCounter: boolean;
@@ -36,9 +36,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
36
36
  id: string;
37
37
  name: string;
38
38
  description: string;
39
- limit: number;
40
39
  options: AutocompleteOption[] | string[] | number[];
41
40
  placeholder: string;
41
+ limit: number;
42
42
  disabledErrorMessage: boolean;
43
43
  disabledBorder: boolean;
44
44
  showCounter: boolean;
@@ -18,8 +18,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
18
18
  "onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
19
19
  }>, {
20
20
  name: string;
21
- limit: number;
22
21
  placeholder: string;
22
+ limit: number;
23
23
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
24
  declare const _default: typeof __VLS_export;
25
25
  export default _default;
@@ -18,8 +18,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
18
18
  "onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
19
19
  }>, {
20
20
  name: string;
21
- limit: number;
22
21
  placeholder: string;
22
+ limit: number;
23
23
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
24
  declare const _default: typeof __VLS_export;
25
25
  export default _default;
@@ -1,19 +1,19 @@
1
1
  <template>
2
2
  <DialogPortal>
3
3
  <DialogOverlay />
4
- <Form v-slot="{ meta }" @submit="onSubmit">
5
- <DialogContent
6
- data-slot="dialog-content"
7
- v-bind="forwarded"
8
- :class="
4
+ <DialogContent
5
+ data-slot="dialog-content"
6
+ v-bind="forwarded"
7
+ :class="
9
8
  cn(
10
9
  'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',
11
10
  props.class
12
11
  )
13
12
  "
14
- @escape-key-down="onOutSideClick"
15
- @pointer-down-outside="onOutSideClick"
16
- >
13
+ @escape-key-down="onOutSideClick"
14
+ @pointer-down-outside="onOutSideClick"
15
+ >
16
+ <Form v-slot="{ meta }" @submit="onSubmit" class="grid w-full gap-4">
17
17
  <slot :meta="meta" />
18
18
  <DialogClose
19
19
  v-if="!props.disabledCloseBtn"
@@ -23,8 +23,8 @@
23
23
  <Icon name="lucide:x" size="24" />
24
24
  <span class="sr-only">Close</span>
25
25
  </DialogClose>
26
- </DialogContent>
27
- </Form>
26
+ </Form>
27
+ </DialogContent>
28
28
  </DialogPortal>
29
29
  </template>
30
30
 
@@ -1,10 +1,9 @@
1
1
  <template>
2
2
  <DialogPortal>
3
3
  <SheetOverlay />
4
- <Form v-slot="{ meta }" @submit="onSubmit">
5
- <DialogContent
6
- data-slot="sheet-content"
7
- :class="
4
+ <DialogContent
5
+ data-slot="sheet-content"
6
+ :class="
8
7
  cn(
9
8
  'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
10
9
  side === 'right' && 'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full min-w-full max-w-full sm:max-w-full sm:min-w-md border-l',
@@ -14,9 +13,14 @@
14
13
  props.class
15
14
  )
16
15
  "
17
- @escape-key-down="onOutSideClick"
18
- @pointer-down-outside="onOutSideClick"
19
- v-bind="{ ...forwarded, ...$attrs }"
16
+ @escape-key-down="onOutSideClick"
17
+ @pointer-down-outside="onOutSideClick"
18
+ v-bind="{ ...forwarded, ...$attrs }"
19
+ >
20
+ <Form
21
+ v-slot="{ meta }"
22
+ @submit="onSubmit"
23
+ class="h-full flex flex-col gap-4"
20
24
  >
21
25
  <slot :meta="meta" />
22
26
  <button
@@ -27,8 +31,8 @@
27
31
  <Icon name="lucide:x" :size="24" />
28
32
  <span class="sr-only">Closed</span>
29
33
  </button>
30
- </DialogContent>
31
- </Form>
34
+ </Form>
35
+ </DialogContent>
32
36
  </DialogPortal>
33
37
  </template>
34
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.76.0",
3
+ "version": "1.78.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",