nuxt-glorious 2.0.0-develop-26 → 2.0.0-develop-28

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,5 +1,5 @@
1
1
  {
2
2
  "name": "nuxt-glorious",
3
3
  "configKey": "glorious",
4
- "version": "2.0.0-develop-26"
4
+ "version": "2.0.0-develop-28"
5
5
  }
@@ -72,12 +72,10 @@ const isSelected = (value: any): boolean => {
72
72
  if (typeof tags.value !== 'object' && typeof modelValue.value !== 'object')
73
73
  return false
74
74
 
75
- console.log()
76
-
77
75
  return (
78
- tags.value.some((item: any) => item.value === value) ||
76
+ tags.value.some((item: any) => item[props.keyOfValue] === value) ||
79
77
  (typeof modelValue.value === 'object' &&
80
- modelValue.value.some((item: any) => item.value === value))
78
+ modelValue.value.some((item: any) => item[props.keyOfValue] === value))
81
79
  )
82
80
  }
83
81
  const addTagViaOption = (option: any, event: any) => {
@@ -197,7 +195,6 @@ const inputClicked = (event: any) => {
197
195
  ></GIcon>
198
196
 
199
197
  <div
200
- v-if="props.options.length > 0"
201
198
  class="glorious-input-options hidden"
202
199
  :class="[`size-${props.size}`]"
203
200
  >
@@ -208,12 +205,22 @@ const inputClicked = (event: any) => {
208
205
  <GLoading color="green" />
209
206
  </div>
210
207
  <div v-else>
208
+ <div
209
+ v-if="props.options.length === 0"
210
+ class="text-center"
211
+ >
212
+ {{ props.noItemsFound }}
213
+ </div>
211
214
  <div
212
215
  v-for="(option, index) in props.options"
213
216
  :key="index"
214
217
  @click="addTagViaOption(option, $event)"
215
- :class="[isSelected(option.value) ? 'disabled' : '']"
218
+ :class="[isSelected(option[props.keyOfValue]) ? 'disabled' : '']"
216
219
  >
220
+ <slot
221
+ name="option"
222
+ :item="option"
223
+ ></slot>
217
224
  {{
218
225
  option[
219
226
  getAttribute(props.displayTextKey, 'input', 'displayTextKey')
@@ -231,6 +238,10 @@ const inputClicked = (event: any) => {
231
238
  v-for="(item, index) in tags"
232
239
  :key="index"
233
240
  >
241
+ <slot
242
+ name="option"
243
+ :item="item"
244
+ ></slot>
234
245
  {{
235
246
  typeof item === 'object'
236
247
  ? item[
@@ -29,6 +29,11 @@ declare const _default: {
29
29
  default: boolean;
30
30
  type: BooleanConstructor;
31
31
  };
32
+ noItemsFound: {
33
+ required: boolean;
34
+ default: string;
35
+ type: StringConstructor;
36
+ };
32
37
  loading: {
33
38
  required: boolean;
34
39
  default: boolean;
@@ -10,7 +10,8 @@ import {
10
10
  required,
11
11
  displayTextKey,
12
12
  keyOfValue,
13
- loading
13
+ loading,
14
+ noItemsFound
14
15
  } from "./common/index.mjs";
15
16
  export default {
16
17
  ...color(),
@@ -25,6 +26,7 @@ export default {
25
26
  ...disabled,
26
27
  ...options,
27
28
  ...loading,
29
+ ...noItemsFound(),
28
30
  type: {
29
31
  required: false,
30
32
  default: "text",
@@ -212,3 +212,10 @@ export declare const outline: () => {
212
212
  type: BooleanConstructor;
213
213
  };
214
214
  };
215
+ export declare const noItemsFound: () => {
216
+ noItemsFound: {
217
+ required: boolean;
218
+ default: string;
219
+ type: StringConstructor;
220
+ };
221
+ };
@@ -198,3 +198,10 @@ export const outline = () => ({
198
198
  type: Boolean
199
199
  }
200
200
  });
201
+ export const noItemsFound = () => ({
202
+ noItemsFound: {
203
+ required: false,
204
+ default: "No items found",
205
+ type: String
206
+ }
207
+ });
@@ -734,7 +734,7 @@ button:focus-visible {
734
734
  }
735
735
  }
736
736
  .glorious-scaffold-modal {
737
- @apply fixed bg-white md:top-[15%] z-50 right-0 left-0 mx-auto p-3 md:rounded-md rounded-t-md md:bottom-0 bottom-0 overflow-y-auto;
737
+ @apply fixed bg-white md:top-[15%] z-50 right-0 left-0 mx-auto p-3 md:rounded-md rounded-t-md md:bottom-0 bottom-0;
738
738
  }
739
739
  .glorious-scaffold-modal .close-modal-btn {
740
740
  @apply flex justify-center items-center w-6 h-6;
@@ -742,6 +742,9 @@ button:focus-visible {
742
742
  .glorious-scaffold-modal-header {
743
743
  @apply flex justify-between items-center;
744
744
  }
745
+ .glorious-scaffold-modal-content {
746
+ @apply overflow-y-auto max-h-150;
747
+ }
745
748
  .glorious-scaffold-modal-footer {
746
749
  @apply flex justify-center gap-3 mt-3;
747
750
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.0.0-develop-26",
2
+ "version": "2.0.0-develop-28",
3
3
  "name": "nuxt-glorious",
4
4
  "description": "This package provides many things needed by a project, including server requests and authentication, SEO and other requirements of a project.",
5
5
  "repository": "sajadhzj/nuxt-glorious",