pukaad-ui-lib 1.108.0 → 1.110.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.108.0",
4
+ "version": "1.110.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -7,7 +7,8 @@ interface Props {
7
7
  showStatus?: boolean;
8
8
  online?: boolean;
9
9
  profileName?: string;
10
- profileID?: string;
10
+ profileID?: string | number;
11
+ disabledCopy?: boolean;
11
12
  }
12
13
  declare var __VLS_6: {}, __VLS_8: {}, __VLS_10: {};
13
14
  type __VLS_Slots = {} & {
@@ -22,7 +23,7 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
22
23
  showStatus: boolean;
23
24
  online: boolean;
24
25
  profileName: string;
25
- profileID: string;
26
+ profileID: string | number;
26
27
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
28
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
28
29
  declare const _default: typeof __VLS_export;
@@ -17,6 +17,7 @@
17
17
  <div>ID:</div>
18
18
  <div>{{ props.profileID }}</div>
19
19
  <Icon
20
+ v-if="!props.disabledCopy"
20
21
  name="lucide:copy"
21
22
  size="16"
22
23
  @click="copyID"
@@ -40,10 +41,11 @@ const props = defineProps({
40
41
  showStatus: { type: Boolean, required: false, default: true },
41
42
  online: { type: Boolean, required: false, default: false },
42
43
  profileName: { type: String, required: false, default: "" },
43
- profileID: { type: String, required: false, default: "" }
44
+ profileID: { type: [String, Number], required: false, default: "" },
45
+ disabledCopy: { type: Boolean, required: false }
44
46
  });
45
47
  const copyID = () => {
46
- navigator.clipboard.writeText(props.profileID);
48
+ navigator.clipboard.writeText(props.profileID.toString());
47
49
  $toast.success("\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E25\u0E34\u0E07\u0E04\u0E4C\u0E41\u0E25\u0E49\u0E27");
48
50
  };
49
51
  </script>
@@ -7,7 +7,8 @@ interface Props {
7
7
  showStatus?: boolean;
8
8
  online?: boolean;
9
9
  profileName?: string;
10
- profileID?: string;
10
+ profileID?: string | number;
11
+ disabledCopy?: boolean;
11
12
  }
12
13
  declare var __VLS_6: {}, __VLS_8: {}, __VLS_10: {};
13
14
  type __VLS_Slots = {} & {
@@ -22,7 +23,7 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
22
23
  showStatus: boolean;
23
24
  online: boolean;
24
25
  profileName: string;
25
- profileID: string;
26
+ profileID: string | number;
26
27
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
28
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
28
29
  declare const _default: typeof __VLS_export;
@@ -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;
39
40
  options: AutocompleteOption[] | string[] | number[];
40
41
  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;
39
40
  options: AutocompleteOption[] | string[] | number[];
40
41
  placeholder: string;
41
- limit: number;
42
42
  disabledErrorMessage: boolean;
43
43
  disabledBorder: boolean;
44
44
  showCounter: boolean;
@@ -1,4 +1,9 @@
1
1
  export interface InputContentProps {
2
+ id?: string;
3
+ name?: string;
4
+ label?: string;
5
+ description?: string;
6
+ required?: boolean;
2
7
  height?: string | number;
3
8
  placeholder?: string;
4
9
  disabledBorder?: boolean;
@@ -9,13 +14,30 @@ type __VLS_ModelProps = {
9
14
  modelValue?: any;
10
15
  };
11
16
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
12
- declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
+ declare var __VLS_21: {};
18
+ type __VLS_Slots = {} & {
19
+ label?: (props: typeof __VLS_21) => any;
20
+ };
21
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
22
+ setErrors: (errMsg: string[]) => void;
23
+ validate: () => Promise<any>;
24
+ fieldRef: import("vue").Ref<any, any>;
25
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
26
  "update:modelValue": (value: any) => any;
14
27
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
15
28
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
16
29
  }>, {
17
30
  height: string | number;
31
+ required: boolean;
32
+ id: string;
33
+ name: string;
18
34
  disableMedia: boolean;
19
35
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
36
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
20
37
  declare const _default: typeof __VLS_export;
21
38
  export default _default;
39
+ type __VLS_WithSlots<T, S> = T & {
40
+ new (): {
41
+ $slots: S;
42
+ };
43
+ };
@@ -1,14 +1,38 @@
1
1
  <template>
2
- <div>
3
- <div class="quill-wrapper" :class="{ 'drag-not-allowed': isDraggingMedia }">
2
+ <ShadFormField
3
+ ref="fieldRef"
4
+ :name="props.name"
5
+ :rules="defaultRules"
6
+ v-slot="{ componentField, errorMessage }"
7
+ v-model="modelValue"
8
+ >
9
+ <ShadFormItem>
10
+ <ShadFormLabel v-if="props.label || $slots.label" class="w-full">
11
+ <slot name="label">
12
+ <div class="flex-1">
13
+ {{ props.label }}
14
+ <span v-if="props.required" class="text-destructive">*</span>
15
+ </div>
16
+ </slot>
17
+ </ShadFormLabel>
18
+
4
19
  <div
5
- ref="contentRef"
6
- :style="{
20
+ class="quill-wrapper"
21
+ :class="{ 'drag-not-allowed': isDraggingMedia }"
22
+ >
23
+ <div
24
+ ref="contentRef"
25
+ :style="{
7
26
  '--height': `${props.height}px`
8
27
  }"
9
- />
10
- </div>
11
- </div>
28
+ />
29
+ </div>
30
+
31
+ <ShadFormDescription v-if="props.description">
32
+ {{ props.description }}
33
+ </ShadFormDescription>
34
+ </ShadFormItem>
35
+ </ShadFormField>
12
36
  </template>
13
37
 
14
38
  <script setup>
@@ -18,6 +42,11 @@ const { $quill } = useNuxtApp();
18
42
  const contentRef = ref(null);
19
43
  let quillEditor = null;
20
44
  const props = defineProps({
45
+ id: { type: String, required: false, default: "input-content" },
46
+ name: { type: String, required: false, default: "input-content" },
47
+ label: { type: String, required: false },
48
+ description: { type: String, required: false },
49
+ required: { type: Boolean, required: false, default: false },
21
50
  height: { type: [String, Number], required: false, default: 288 },
22
51
  placeholder: { type: String, required: false },
23
52
  disabledBorder: { type: Boolean, required: false },
@@ -25,6 +54,21 @@ const props = defineProps({
25
54
  });
26
55
  const modelValue = defineModel();
27
56
  const isDraggingMedia = ref(false);
57
+ const fieldRef = ref();
58
+ const defaultRules = () => {
59
+ return true;
60
+ };
61
+ const setErrors = (errMsg) => {
62
+ fieldRef.value?.setErrors(errMsg);
63
+ };
64
+ const validate = async () => {
65
+ return await fieldRef.value?.validate?.();
66
+ };
67
+ defineExpose({
68
+ setErrors,
69
+ validate,
70
+ fieldRef
71
+ });
28
72
  onMounted(() => {
29
73
  if (contentRef.value) {
30
74
  const toolbarOptions = [
@@ -1,4 +1,9 @@
1
1
  export interface InputContentProps {
2
+ id?: string;
3
+ name?: string;
4
+ label?: string;
5
+ description?: string;
6
+ required?: boolean;
2
7
  height?: string | number;
3
8
  placeholder?: string;
4
9
  disabledBorder?: boolean;
@@ -9,13 +14,30 @@ type __VLS_ModelProps = {
9
14
  modelValue?: any;
10
15
  };
11
16
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
12
- declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
+ declare var __VLS_21: {};
18
+ type __VLS_Slots = {} & {
19
+ label?: (props: typeof __VLS_21) => any;
20
+ };
21
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
22
+ setErrors: (errMsg: string[]) => void;
23
+ validate: () => Promise<any>;
24
+ fieldRef: import("vue").Ref<any, any>;
25
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
26
  "update:modelValue": (value: any) => any;
14
27
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
15
28
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
16
29
  }>, {
17
30
  height: string | number;
31
+ required: boolean;
32
+ id: string;
33
+ name: string;
18
34
  disableMedia: boolean;
19
35
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
36
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
20
37
  declare const _default: typeof __VLS_export;
21
38
  export default _default;
39
+ type __VLS_WithSlots<T, S> = T & {
40
+ new (): {
41
+ $slots: S;
42
+ };
43
+ };
@@ -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
- placeholder: string;
22
21
  limit: number;
22
+ placeholder: string;
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
- placeholder: string;
22
21
  limit: number;
22
+ placeholder: string;
23
23
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
24
  declare const _default: typeof __VLS_export;
25
25
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.108.0",
3
+ "version": "1.110.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",