pukaad-ui-lib 1.34.0 → 1.36.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.34.0",
4
+ "version": "1.36.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -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
  center: boolean;
66
66
  src: string;
67
+ background: boolean;
68
+ modal: boolean;
67
69
  responsive: boolean;
68
70
  restore: boolean;
69
71
  checkCrossOrigin: boolean;
70
72
  checkOrientation: boolean;
71
73
  crossorigin: "" | "anonymous" | "use-credentials";
72
- modal: boolean;
73
74
  guides: boolean;
74
75
  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
  center: boolean;
66
66
  src: string;
67
+ background: boolean;
68
+ modal: boolean;
67
69
  responsive: boolean;
68
70
  restore: boolean;
69
71
  checkCrossOrigin: boolean;
70
72
  checkOrientation: boolean;
71
73
  crossorigin: "" | "anonymous" | "use-credentials";
72
- modal: boolean;
73
74
  guides: boolean;
74
75
  highlight: boolean;
75
- background: boolean;
76
76
  autoCrop: boolean;
77
77
  movable: boolean;
78
78
  rotatable: boolean;
@@ -37,8 +37,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
37
37
  name: string;
38
38
  placeholder: string;
39
39
  description: string;
40
- options: AutocompleteOption[] | string[] | number[];
41
40
  limit: number;
41
+ options: AutocompleteOption[] | string[] | number[];
42
42
  disabledErrorMessage: boolean;
43
43
  disabledBorder: boolean;
44
44
  showCounter: boolean;
@@ -37,8 +37,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
37
37
  name: string;
38
38
  placeholder: string;
39
39
  description: string;
40
- options: AutocompleteOption[] | string[] | number[];
41
40
  limit: number;
41
+ options: AutocompleteOption[] | string[] | number[];
42
42
  disabledErrorMessage: boolean;
43
43
  disabledBorder: boolean;
44
44
  showCounter: boolean;
@@ -43,7 +43,13 @@
43
43
  role="combobox"
44
44
  class="w-full justify-between text-start"
45
45
  >
46
- {{ displayValue }}
46
+ <span
47
+ :class="{
48
+ 'text-cloud': props.placeholder && isShowingPlaceholder
49
+ }"
50
+ >
51
+ {{ displayValue }}
52
+ </span>
47
53
  <Icon name="lucide:chevrons-up-down" class="h-4 w-4" />
48
54
  </ShadButton>
49
55
  </ShadFormControl>
@@ -52,7 +58,7 @@
52
58
  <ShadCommand>
53
59
  <ShadCommandInput />
54
60
  <ShadCommandList>
55
- <ShadCommandGroup>
61
+ <ShadCommandGroup v-if="options && options.length > 0">
56
62
  <slot name="options">
57
63
  <ShadCommandItem
58
64
  v-for="option in options"
@@ -80,7 +86,9 @@
80
86
  </ShadCommandItem>
81
87
  </slot>
82
88
  </ShadCommandGroup>
83
- <ShadCommandEmpty />
89
+ <ShadCommandEmpty
90
+ :force-show="!options || options.length === 0"
91
+ />
84
92
  </ShadCommandList>
85
93
  </ShadCommand>
86
94
  </ShadPopoverContent>
@@ -132,6 +140,17 @@ const displayValue = computed(() => {
132
140
  return selectedOption?.label || props.placeholder || "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23";
133
141
  }
134
142
  });
143
+ const isShowingPlaceholder = computed(() => {
144
+ if (props.multiple) {
145
+ const selectedValues = modelValue.value;
146
+ return !selectedValues || selectedValues.length === 0;
147
+ } else {
148
+ const selectedOption = props.options?.find(
149
+ (opt) => opt.value === modelValue.value
150
+ );
151
+ return !selectedOption;
152
+ }
153
+ });
135
154
  const isLimitReached = computed(() => {
136
155
  if (!props.multiple || props.limit <= 0) return false;
137
156
  return modelValue.value.length >= props.limit;
@@ -26,8 +26,8 @@
26
26
  :class="
27
27
  cn(
28
28
  'w-full flex items-center justify-between gap-2 font-body-large',
29
- !modelValue && 'text-muted-foreground',
30
- errorMessage && 'border-destructive hover:border-destructive',
29
+ !modelValue && 'text-cloud',
30
+ errorMessage && 'border-destructive',
31
31
  props.class
32
32
  )
33
33
  "
@@ -1,13 +1,14 @@
1
1
  import type { PrimitiveProps } from "reka-ui";
2
2
  import type { HTMLAttributes } from "vue";
3
- type __VLS_Props = PrimitiveProps & {
3
+ interface CommandEmptyProps extends PrimitiveProps {
4
4
  class?: HTMLAttributes["class"];
5
- };
5
+ forceShow?: boolean;
6
+ }
6
7
  declare var __VLS_8: {};
7
8
  type __VLS_Slots = {} & {
8
9
  default?: (props: typeof __VLS_8) => any;
9
10
  };
10
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_base: import("vue").DefineComponent<CommandEmptyProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CommandEmptyProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
12
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
13
  declare const _default: typeof __VLS_export;
13
14
  export default _default;
@@ -5,15 +5,17 @@ import { computed } from "vue";
5
5
  import { cn } from "@/runtime/plugins/shadcn";
6
6
  import { useCommand } from ".";
7
7
  const props = defineProps({
8
+ class: { type: null, required: false },
9
+ forceShow: { type: Boolean, required: false },
8
10
  asChild: { type: Boolean, required: false },
9
- as: { type: null, required: false },
10
- class: { type: null, required: false }
11
+ as: { type: null, required: false }
11
12
  });
12
- const delegatedProps = reactiveOmit(props, "class");
13
+ const delegatedProps = reactiveOmit(props, "class", "forceShow");
13
14
  const { filterState } = useCommand();
14
- const isRender = computed(
15
- () => !!filterState.search && filterState.filtered.count === 0
16
- );
15
+ const isRender = computed(() => {
16
+ if (props.forceShow) return true;
17
+ return !!filterState.search && filterState.filtered.count === 0;
18
+ });
17
19
  </script>
18
20
 
19
21
  <template>
@@ -1,13 +1,14 @@
1
1
  import type { PrimitiveProps } from "reka-ui";
2
2
  import type { HTMLAttributes } from "vue";
3
- type __VLS_Props = PrimitiveProps & {
3
+ interface CommandEmptyProps extends PrimitiveProps {
4
4
  class?: HTMLAttributes["class"];
5
- };
5
+ forceShow?: boolean;
6
+ }
6
7
  declare var __VLS_8: {};
7
8
  type __VLS_Slots = {} & {
8
9
  default?: (props: typeof __VLS_8) => any;
9
10
  };
10
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_base: import("vue").DefineComponent<CommandEmptyProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CommandEmptyProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
12
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
13
  declare const _default: typeof __VLS_export;
13
14
  export default _default;
@@ -13,11 +13,12 @@ const props = defineProps({
13
13
  const delegatedProps = reactiveOmit(props, "class");
14
14
  const { allGroups, filterState } = useCommand();
15
15
  const id = useId();
16
- const isRender = computed(() => !filterState.search ? true : filterState.filtered.groups.has(id));
16
+ const isRender = computed(
17
+ () => !filterState.search ? true : filterState.filtered.groups.has(id)
18
+ );
17
19
  provideCommandGroupContext({ id });
18
20
  onMounted(() => {
19
- if (!allGroups.value.has(id))
20
- allGroups.value.set(id, /* @__PURE__ */ new Set());
21
+ if (!allGroups.value.has(id)) allGroups.value.set(id, /* @__PURE__ */ new Set());
21
22
  });
22
23
  onUnmounted(() => {
23
24
  allGroups.value.delete(id);
@@ -32,7 +33,11 @@ onUnmounted(() => {
32
33
  :class="cn('text-foreground overflow-hidden p-1', props.class)"
33
34
  :hidden="isRender ? void 0 : true"
34
35
  >
35
- <ListboxGroupLabel v-if="heading" data-slot="command-group-heading" class="px-2 py-1.5 text-xs font-medium text-muted-foreground">
36
+ <ListboxGroupLabel
37
+ v-if="heading"
38
+ data-slot="command-group-heading"
39
+ class="px-2 py-1.5 text-xs font-medium text-muted-foreground"
40
+ >
36
41
  {{ heading }}
37
42
  </ListboxGroupLabel>
38
43
  <slot />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.34.0",
3
+ "version": "1.36.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",