pukaad-ui-lib 1.28.0 → 1.30.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.28.0",
4
+ "version": "1.30.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -0,0 +1,55 @@
1
+ export interface DataListProps {
2
+ items?: Record<string, any>[];
3
+ height?: number | string;
4
+ maxHeight?: number | string;
5
+ fullHeight?: boolean;
6
+ disabledPagination?: boolean;
7
+ totalPage?: number;
8
+ }
9
+ type __VLS_Props = DataListProps;
10
+ type __VLS_ModelProps = {
11
+ "page"?: number;
12
+ };
13
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
14
+ declare var __VLS_6: {
15
+ items: Record<string, any>[];
16
+ }, __VLS_26: {
17
+ item: Record<string, any>;
18
+ index: number;
19
+ }, __VLS_28: {}, __VLS_35: {};
20
+ type __VLS_Slots = {} & {
21
+ body?: (props: typeof __VLS_6) => any;
22
+ } & {
23
+ item?: (props: typeof __VLS_26) => any;
24
+ } & {
25
+ empty?: (props: typeof __VLS_28) => any;
26
+ } & {
27
+ 'empty-content'?: (props: typeof __VLS_35) => any;
28
+ };
29
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
30
+ "update:page": (value: number) => any;
31
+ } & {
32
+ "select-page": (value: number) => any;
33
+ "change-page": (value: number) => any;
34
+ "click-row": (item: Record<string, any>, index: number) => any;
35
+ "change-item-per-page": (value: number) => any;
36
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
37
+ "onSelect-page"?: ((value: number) => any) | undefined;
38
+ "onChange-page"?: ((value: number) => any) | undefined;
39
+ "onClick-row"?: ((item: Record<string, any>, index: number) => any) | undefined;
40
+ "onChange-item-per-page"?: ((value: number) => any) | undefined;
41
+ "onUpdate:page"?: ((value: number) => any) | undefined;
42
+ }>, {
43
+ items: Record<string, any>[];
44
+ fullHeight: boolean;
45
+ disabledPagination: boolean;
46
+ totalPage: number;
47
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
48
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
49
+ declare const _default: typeof __VLS_export;
50
+ export default _default;
51
+ type __VLS_WithSlots<T, S> = T & {
52
+ new (): {
53
+ $slots: S;
54
+ };
55
+ };
@@ -0,0 +1,78 @@
1
+ <script setup>
2
+ import {
3
+ Table as ShadTable,
4
+ TableBody as ShadTableBody,
5
+ TableRow as ShadTableRow,
6
+ TableCell as ShadTableCell,
7
+ TableEmpty as ShadTableEmpty
8
+ } from "@/runtime/components/ui/table";
9
+ const emit = defineEmits(["select-page", "change-page", "click-row", "change-item-per-page"]);
10
+ const props = defineProps({
11
+ items: { type: Array, required: false, default: () => [] },
12
+ height: { type: [Number, String], required: false },
13
+ maxHeight: { type: [Number, String], required: false },
14
+ fullHeight: { type: Boolean, required: false, default: false },
15
+ disabledPagination: { type: Boolean, required: false, default: false },
16
+ totalPage: { type: Number, required: false, default: 1 }
17
+ });
18
+ const page = defineModel("page", { type: Number, ...{
19
+ default: 1
20
+ } });
21
+ </script>
22
+
23
+ <template>
24
+ <div class="bg-white rounded-lg flex flex-col">
25
+ <!-- List Container -->
26
+ <div
27
+ class="flex-1 overflow-auto"
28
+ :style="{
29
+ height: props.fullHeight ? '100%' : props.height ? `${props.height}px` : 'auto',
30
+ maxHeight: props.maxHeight ? `${props.maxHeight}px` : void 0
31
+ }"
32
+ >
33
+ <ShadTable>
34
+ <slot name="body" :items="props.items">
35
+ <ShadTableBody>
36
+ <template v-if="props.items.length > 0">
37
+ <ShadTableRow
38
+ v-for="(item, index) in props.items"
39
+ :key="index"
40
+ class="cursor-pointer"
41
+ @click="emit('click-row', item, index)"
42
+ >
43
+ <ShadTableCell class="w-full">
44
+ <slot name="item" :item="item" :index="index">
45
+ {{ item }}
46
+ </slot>
47
+ </ShadTableCell>
48
+ </ShadTableRow>
49
+ </template>
50
+
51
+ <!-- Empty State -->
52
+ <template v-else>
53
+ <slot name="empty">
54
+ <ShadTableEmpty :colspan="1">
55
+ <slot name="empty-content" />
56
+ </ShadTableEmpty>
57
+ </slot>
58
+ </template>
59
+ </ShadTableBody>
60
+ </slot>
61
+ </ShadTable>
62
+ </div>
63
+
64
+ <!-- Pagination -->
65
+ <div
66
+ v-if="props.items.length > 0 && !props.disabledPagination"
67
+ class="p-4 flex justify-center items-center border-t"
68
+ >
69
+ <Pagination
70
+ :totalPage="props.totalPage"
71
+ v-model="page"
72
+ @change-item-per-page="
73
+ (val) => emit('change-item-per-page', val)
74
+ "
75
+ />
76
+ </div>
77
+ </div>
78
+ </template>
@@ -0,0 +1,55 @@
1
+ export interface DataListProps {
2
+ items?: Record<string, any>[];
3
+ height?: number | string;
4
+ maxHeight?: number | string;
5
+ fullHeight?: boolean;
6
+ disabledPagination?: boolean;
7
+ totalPage?: number;
8
+ }
9
+ type __VLS_Props = DataListProps;
10
+ type __VLS_ModelProps = {
11
+ "page"?: number;
12
+ };
13
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
14
+ declare var __VLS_6: {
15
+ items: Record<string, any>[];
16
+ }, __VLS_26: {
17
+ item: Record<string, any>;
18
+ index: number;
19
+ }, __VLS_28: {}, __VLS_35: {};
20
+ type __VLS_Slots = {} & {
21
+ body?: (props: typeof __VLS_6) => any;
22
+ } & {
23
+ item?: (props: typeof __VLS_26) => any;
24
+ } & {
25
+ empty?: (props: typeof __VLS_28) => any;
26
+ } & {
27
+ 'empty-content'?: (props: typeof __VLS_35) => any;
28
+ };
29
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
30
+ "update:page": (value: number) => any;
31
+ } & {
32
+ "select-page": (value: number) => any;
33
+ "change-page": (value: number) => any;
34
+ "click-row": (item: Record<string, any>, index: number) => any;
35
+ "change-item-per-page": (value: number) => any;
36
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
37
+ "onSelect-page"?: ((value: number) => any) | undefined;
38
+ "onChange-page"?: ((value: number) => any) | undefined;
39
+ "onClick-row"?: ((item: Record<string, any>, index: number) => any) | undefined;
40
+ "onChange-item-per-page"?: ((value: number) => any) | undefined;
41
+ "onUpdate:page"?: ((value: number) => any) | undefined;
42
+ }>, {
43
+ items: Record<string, any>[];
44
+ fullHeight: boolean;
45
+ disabledPagination: boolean;
46
+ totalPage: number;
47
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
48
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
49
+ declare const _default: typeof __VLS_export;
50
+ export default _default;
51
+ type __VLS_WithSlots<T, S> = T & {
52
+ new (): {
53
+ $slots: S;
54
+ };
55
+ };
@@ -58,13 +58,13 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
58
58
  }>, {
59
59
  items: Record<string, any>[];
60
60
  fullHeight: boolean;
61
+ disabledPagination: boolean;
62
+ totalPage: number;
61
63
  itemHeader: TableHeader[];
62
64
  headerAlinement: TableHeaderAlignment;
63
65
  cellAlinement: TableHeaderAlignment;
64
66
  disabledHeader: boolean;
65
67
  disabledSort: boolean;
66
- disabledPagination: boolean;
67
- totalPage: number;
68
68
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
69
69
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
70
70
  declare const _default: typeof __VLS_export;
@@ -58,13 +58,13 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
58
58
  }>, {
59
59
  items: Record<string, any>[];
60
60
  fullHeight: boolean;
61
+ disabledPagination: boolean;
62
+ totalPage: number;
61
63
  itemHeader: TableHeader[];
62
64
  headerAlinement: TableHeaderAlignment;
63
65
  cellAlinement: TableHeaderAlignment;
64
66
  disabledHeader: boolean;
65
67
  disabledSort: boolean;
66
- disabledPagination: boolean;
67
- totalPage: number;
68
68
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
69
69
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
70
70
  declare const _default: typeof __VLS_export;
@@ -27,8 +27,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
27
27
  label: string;
28
28
  name: string;
29
29
  limit: number;
30
- disabledErrorMessage: boolean;
31
30
  accept: string;
31
+ disabledErrorMessage: boolean;
32
32
  labelIcon: string;
33
33
  disabledDrop: boolean;
34
34
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -27,8 +27,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
27
27
  label: string;
28
28
  name: string;
29
29
  limit: number;
30
- disabledErrorMessage: boolean;
31
30
  accept: string;
31
+ disabledErrorMessage: boolean;
32
32
  labelIcon: string;
33
33
  disabledDrop: boolean;
34
34
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -18,8 +18,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
18
18
  }>, {
19
19
  id: string;
20
20
  name: string;
21
- new: boolean;
22
21
  disabledForgotPassword: boolean;
22
+ new: boolean;
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
  }>, {
19
19
  id: string;
20
20
  name: string;
21
- new: boolean;
22
21
  disabledForgotPassword: boolean;
22
+ new: boolean;
23
23
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
24
  declare const _default: typeof __VLS_export;
25
25
  export default _default;
@@ -12,9 +12,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
12
12
  color: InputSliderColor;
13
13
  fullWidth: boolean;
14
14
  label: string;
15
+ step: number;
15
16
  min: number;
16
17
  max: number;
17
- step: number;
18
18
  lineHeight: number | string;
19
19
  appearance: boolean;
20
20
  thumbSize: number | string;
@@ -12,9 +12,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
12
12
  color: InputSliderColor;
13
13
  fullWidth: boolean;
14
14
  label: string;
15
+ step: number;
15
16
  min: number;
16
17
  max: number;
17
- step: number;
18
18
  lineHeight: number | string;
19
19
  appearance: boolean;
20
20
  thumbSize: number | string;
@@ -69,6 +69,7 @@
69
69
 
70
70
  <script setup>
71
71
  import { ref, onMounted, nextTick } from "vue";
72
+ import { InputGroupTextarea as ShadInputGroupTextarea } from "@/runtime/components/ui/input-group";
72
73
  const props = defineProps({
73
74
  id: { type: String, required: false, default: "input-textarea" },
74
75
  name: { type: String, required: false, default: "input-textarea" },
@@ -83,7 +84,7 @@ const props = defineProps({
83
84
  required: { type: Boolean, required: false, default: false },
84
85
  showCounter: { type: Boolean, required: false, default: false },
85
86
  limit: { type: Number, required: false, default: 0 },
86
- resize: { type: String, required: false, default: "both" },
87
+ resize: { type: String, required: false, default: "vertical" },
87
88
  rows: { type: Number, required: false, default: 4 },
88
89
  fullWidth: { type: Boolean, required: false, default: false },
89
90
  fullHeight: { type: Boolean, required: false, default: false },
@@ -107,7 +108,7 @@ const defaultRules = (v) => {
107
108
  return true;
108
109
  };
109
110
  const autoHeight = () => {
110
- const el = textareaRef.value;
111
+ const el = textareaRef.value?.$el;
111
112
  if (el) {
112
113
  el.style.height = "auto";
113
114
  if (!props.heightScroll) {
@@ -116,8 +117,9 @@ const autoHeight = () => {
116
117
  }
117
118
  };
118
119
  const focus = () => {
119
- if (!textareaRef.value) return;
120
- textareaRef.value.focus();
120
+ const el = textareaRef.value?.$el;
121
+ if (!el) return;
122
+ el.focus();
121
123
  };
122
124
  const setErrors = (errMsg) => {
123
125
  fieldRef.value?.setErrors(errMsg);
@@ -41,11 +41,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
41
41
  }>, {
42
42
  items: Record<string, any>[];
43
43
  fullHeight: false;
44
+ totalPage: number;
44
45
  itemHeader: TableHeader[];
45
46
  headerAlinement: "start" | "center" | "end";
46
47
  disabledHeader: false;
47
48
  disabledSort: false;
48
- totalPage: number;
49
49
  paginationVisible: number;
50
50
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
51
51
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -41,11 +41,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
41
41
  }>, {
42
42
  items: Record<string, any>[];
43
43
  fullHeight: false;
44
+ totalPage: number;
44
45
  itemHeader: TableHeader[];
45
46
  headerAlinement: "start" | "center" | "end";
46
47
  disabledHeader: false;
47
48
  disabledSort: false;
48
- totalPage: number;
49
49
  paginationVisible: number;
50
50
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
51
51
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.28.0",
3
+ "version": "1.30.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",