nuxt-glorious 1.3.1 → 1.3.2

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": "1.3.1"
4
+ "version": "1.3.2"
5
5
  }
@@ -1,10 +1,10 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <g clip-path="url(#clip0_138_29818)">
3
- <path d="M1.18091 12C2.12091 6.88 6.60791 3 11.9999 3C17.3919 3 21.8779 6.88 22.8189 12C21.8789 17.12 17.3919 21 11.9999 21C6.60791 21 2.12191 17.12 1.18091 12ZM11.9999 17C13.326 17 14.5978 16.4732 15.5354 15.5355C16.4731 14.5979 16.9999 13.3261 16.9999 12C16.9999 10.6739 16.4731 9.40215 15.5354 8.46447C14.5978 7.52678 13.326 7 11.9999 7C10.6738 7 9.40206 7.52678 8.46437 8.46447C7.52669 9.40215 6.99991 10.6739 6.99991 12C6.99991 13.3261 7.52669 14.5979 8.46437 15.5355C9.40206 16.4732 10.6738 17 11.9999 17ZM11.9999 15C11.2043 15 10.4412 14.6839 9.87859 14.1213C9.31598 13.5587 8.99991 12.7956 8.99991 12C8.99991 11.2044 9.31598 10.4413 9.87859 9.87868C10.4412 9.31607 11.2043 9 11.9999 9C12.7956 9 13.5586 9.31607 14.1212 9.87868C14.6838 10.4413 14.9999 11.2044 14.9999 12C14.9999 12.7956 14.6838 13.5587 14.1212 14.1213C13.5586 14.6839 12.7956 15 11.9999 15Z" fill="#6b7280"/>
4
- </g>
5
- <defs>
6
- <clipPath id="clip0_138_29818">
7
- <rect width="24" height="24" fill="white"/>
8
- </clipPath>
9
- </defs>
10
- </svg>
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_138_29818)">
3
+ <path d="M1.18091 12C2.12091 6.88 6.60791 3 11.9999 3C17.3919 3 21.8779 6.88 22.8189 12C21.8789 17.12 17.3919 21 11.9999 21C6.60791 21 2.12191 17.12 1.18091 12ZM11.9999 17C13.326 17 14.5978 16.4732 15.5354 15.5355C16.4731 14.5979 16.9999 13.3261 16.9999 12C16.9999 10.6739 16.4731 9.40215 15.5354 8.46447C14.5978 7.52678 13.326 7 11.9999 7C10.6738 7 9.40206 7.52678 8.46437 8.46447C7.52669 9.40215 6.99991 10.6739 6.99991 12C6.99991 13.3261 7.52669 14.5979 8.46437 15.5355C9.40206 16.4732 10.6738 17 11.9999 17ZM11.9999 15C11.2043 15 10.4412 14.6839 9.87859 14.1213C9.31598 13.5587 8.99991 12.7956 8.99991 12C8.99991 11.2044 9.31598 10.4413 9.87859 9.87868C10.4412 9.31607 11.2043 9 11.9999 9C12.7956 9 13.5586 9.31607 14.1212 9.87868C14.6838 10.4413 14.9999 11.2044 14.9999 12C14.9999 12.7956 14.6838 13.5587 14.1212 14.1213C13.5586 14.6839 12.7956 15 11.9999 15Z" fill="#6b7280"/>
4
+ </g>
5
+ <defs>
6
+ <clipPath id="clip0_138_29818">
7
+ <rect width="24" height="24" fill="white"/>
8
+ </clipPath>
9
+ </defs>
10
+ </svg>
@@ -1,10 +1,10 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <g clip-path="url(#clip0_138_29807)">
3
- <path d="M4.51991 5.93407L1.39291 2.80807L2.80791 1.39307L22.6069 21.1931L21.1919 22.6071L17.8819 19.2971C16.1231 20.4126 14.0826 21.0034 11.9999 21.0001C6.60791 21.0001 2.12191 17.1201 1.18091 12.0001C1.61094 9.67078 2.78254 7.54296 4.52091 5.93407H4.51991ZM14.7569 16.1721L13.2929 14.7081C12.733 14.976 12.1037 15.0636 11.4918 14.9589C10.88 14.8541 10.3157 14.5621 9.87678 14.1232C9.43785 13.6843 9.14588 13.12 9.04112 12.5081C8.93637 11.8963 9.02399 11.267 9.29191 10.7071L7.82791 9.24307C7.19162 10.2046 6.90718 11.3564 7.02274 12.5036C7.1383 13.6507 7.64676 14.7227 8.46203 15.5379C9.27729 16.3532 10.3493 16.8617 11.4964 16.9772C12.6436 17.0928 13.7954 16.8084 14.7569 16.1721ZM7.97391 3.76007C9.22091 3.27007 10.5799 3.00007 11.9999 3.00007C17.3919 3.00007 21.8779 6.88007 22.8189 12.0001C22.5125 13.6658 21.8238 15.2376 20.8069 16.5921L16.9469 12.7321C17.0616 11.9597 16.9937 11.1712 16.7488 10.4297C16.5039 9.68827 16.0888 9.01448 15.5366 8.46233C14.9845 7.91019 14.3107 7.49504 13.5693 7.25014C12.8278 7.00524 12.0393 6.93741 11.2669 7.05207L7.97391 3.76107V3.76007Z" fill="#6b7280"/>
4
- </g>
5
- <defs>
6
- <clipPath id="clip0_138_29807">
7
- <rect width="24" height="24" fill="white"/>
8
- </clipPath>
9
- </defs>
10
- </svg>
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_138_29807)">
3
+ <path d="M4.51991 5.93407L1.39291 2.80807L2.80791 1.39307L22.6069 21.1931L21.1919 22.6071L17.8819 19.2971C16.1231 20.4126 14.0826 21.0034 11.9999 21.0001C6.60791 21.0001 2.12191 17.1201 1.18091 12.0001C1.61094 9.67078 2.78254 7.54296 4.52091 5.93407H4.51991ZM14.7569 16.1721L13.2929 14.7081C12.733 14.976 12.1037 15.0636 11.4918 14.9589C10.88 14.8541 10.3157 14.5621 9.87678 14.1232C9.43785 13.6843 9.14588 13.12 9.04112 12.5081C8.93637 11.8963 9.02399 11.267 9.29191 10.7071L7.82791 9.24307C7.19162 10.2046 6.90718 11.3564 7.02274 12.5036C7.1383 13.6507 7.64676 14.7227 8.46203 15.5379C9.27729 16.3532 10.3493 16.8617 11.4964 16.9772C12.6436 17.0928 13.7954 16.8084 14.7569 16.1721ZM7.97391 3.76007C9.22091 3.27007 10.5799 3.00007 11.9999 3.00007C17.3919 3.00007 21.8779 6.88007 22.8189 12.0001C22.5125 13.6658 21.8238 15.2376 20.8069 16.5921L16.9469 12.7321C17.0616 11.9597 16.9937 11.1712 16.7488 10.4297C16.5039 9.68827 16.0888 9.01448 15.5366 8.46233C14.9845 7.91019 14.3107 7.49504 13.5693 7.25014C12.8278 7.00524 12.0393 6.93741 11.2669 7.05207L7.97391 3.76107V3.76007Z" fill="#6b7280"/>
4
+ </g>
5
+ <defs>
6
+ <clipPath id="clip0_138_29807">
7
+ <rect width="24" height="24" fill="white"/>
8
+ </clipPath>
9
+ </defs>
10
+ </svg>
@@ -1,3 +1,3 @@
1
- <svg width="20" height="19" viewBox="0 0 20 19" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M9.99999 15L4.12199 18.59L5.71999 11.89L0.48999 7.41L7.35499 6.86L9.99999 0.5L12.645 6.86L19.511 7.41L14.28 11.89L15.878 18.59L9.99999 15Z" fill="black"/>
3
- </svg>
1
+ <svg width="20" height="19" viewBox="0 0 20 19" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M9.99999 15L4.12199 18.59L5.71999 11.89L0.48999 7.41L7.35499 6.86L9.99999 0.5L12.645 6.86L19.511 7.41L14.28 11.89L15.878 18.59L9.99999 15Z" fill="black"/>
3
+ </svg>
@@ -1,3 +1,3 @@
1
- <svg width="20" height="19" viewBox="0 0 20 19" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M9.99999 12.656L12.817 14.376L12.051 11.166L14.558 9.019L11.268 8.755L9.99999 5.708V12.656ZM9.99999 15L4.12199 18.59L5.71999 11.89L0.48999 7.41L7.35499 6.86L9.99999 0.5L12.645 6.86L19.511 7.41L14.28 11.89L15.878 18.59L9.99999 15Z" fill="black"/>
3
- </svg>
1
+ <svg width="20" height="19" viewBox="0 0 20 19" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M9.99999 12.656L12.817 14.376L12.051 11.166L14.558 9.019L11.268 8.755L9.99999 5.708V12.656ZM9.99999 15L4.12199 18.59L5.71999 11.89L0.48999 7.41L7.35499 6.86L9.99999 0.5L12.645 6.86L19.511 7.41L14.28 11.89L15.878 18.59L9.99999 15Z" fill="black"/>
3
+ </svg>
@@ -1,3 +1,3 @@
1
- <svg width="24" height="23" viewBox="0 0 24 23" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M11.9999 18.26L4.94691 22.208L6.52191 14.28L0.586914 8.792L8.61391 7.84L11.9999 0.5L15.3859 7.84L23.4129 8.792L17.4779 14.28L19.0529 22.208L11.9999 18.26ZM11.9999 15.968L16.2469 18.345L15.2979 13.572L18.8709 10.267L14.0379 9.694L11.9999 5.275L9.96191 9.695L5.12891 10.267L8.70191 13.572L7.75291 18.345L11.9999 15.968Z" fill="black"/>
3
- </svg>
1
+ <svg width="24" height="23" viewBox="0 0 24 23" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M11.9999 18.26L4.94691 22.208L6.52191 14.28L0.586914 8.792L8.61391 7.84L11.9999 0.5L15.3859 7.84L23.4129 8.792L17.4779 14.28L19.0529 22.208L11.9999 18.26ZM11.9999 15.968L16.2469 18.345L15.2979 13.572L18.8709 10.267L14.0379 9.694L11.9999 5.275L9.96191 9.695L5.12891 10.267L8.70191 13.572L7.75291 18.345L11.9999 15.968Z" fill="black"/>
3
+ </svg>
@@ -1,11 +1,11 @@
1
1
  <script setup lang="ts">
2
- import { computed, ref, watch } from '#imports'
2
+ import { computed, ref, watch, useGloriousCore } from '#imports'
3
3
  import { hasValidationError } from '../helper'
4
- import { useGloriousCore } from '../../composables/useGloriousCore'
5
4
  import _props from '../props/Input'
6
5
 
7
6
  const props: any = defineProps(_props)
8
7
  const modelValue = defineModel()
8
+ const { numbersWithSeparateSamePrice } = useGloriousCore()
9
9
  modelValue.value = ''
10
10
  const inputValue: any = ref(null)
11
11
 
@@ -16,9 +16,7 @@ watch(
16
16
 
17
17
  switch (props.display) {
18
18
  case 'price':
19
- inputValue.value = useGloriousCore.numbersWithSeparateSamePrice(
20
- inputValue.value
21
- )
19
+ inputValue.value = numbersWithSeparateSamePrice(inputValue.value)
22
20
  modelValue.value = inputValue.value.toString().replaceAll(',', '')
23
21
  break
24
22
  default:
@@ -184,11 +182,19 @@ const inputClicked = (event: any) => {
184
182
  :class="[`size-${props.size}`]"
185
183
  >
186
184
  <div
187
- v-for="(option, index) in props.options"
188
- :key="index"
189
- @click="addTagViaOption(option, $event)"
185
+ v-if="props.loading"
186
+ class="flex justify-center"
190
187
  >
191
- {{ option[props.displayTextKey] }}
188
+ <GLoading color="green" />
189
+ </div>
190
+ <div v-else>
191
+ <div
192
+ v-for="(option, index) in props.options"
193
+ :key="index"
194
+ @click="addTagViaOption(option, $event)"
195
+ >
196
+ {{ option[props.displayTextKey] }}
197
+ </div>
192
198
  </div>
193
199
  </div>
194
200
  </div>
@@ -29,11 +29,20 @@ declare const _default: {
29
29
  default: boolean;
30
30
  type: BooleanConstructor;
31
31
  };
32
- required: {
32
+ loading: {
33
33
  required: boolean;
34
34
  default: boolean;
35
35
  type: BooleanConstructor;
36
36
  };
37
+ loadingOption: {
38
+ required: boolean;
39
+ default: {
40
+ color: string;
41
+ };
42
+ type: {
43
+ color: StringConstructor;
44
+ };
45
+ };
37
46
  options: {
38
47
  required: boolean;
39
48
  default: never[];
@@ -72,6 +81,11 @@ declare const _default: {
72
81
  default: string;
73
82
  type: StringConstructor;
74
83
  };
84
+ required: {
85
+ required: boolean;
86
+ default: boolean;
87
+ type: BooleanConstructor;
88
+ };
75
89
  displayTextKey: {
76
90
  required: boolean;
77
91
  default: string;
@@ -8,7 +8,8 @@ import {
8
8
  disabled,
9
9
  options,
10
10
  required,
11
- displayTextKey
11
+ displayTextKey,
12
+ loading
12
13
  } from "./common/index.mjs";
13
14
  export default {
14
15
  ...color(),
@@ -16,11 +17,12 @@ export default {
16
17
  ...title(),
17
18
  ...size(),
18
19
  ...displayTextKey(),
20
+ ...required(),
19
21
  ...error,
20
22
  ...icon,
21
23
  ...disabled,
22
24
  ...options,
23
- ...required(),
25
+ ...loading,
24
26
  type: {
25
27
  required: false,
26
28
  default: "text",
@@ -1,3 +1,5 @@
1
- export declare const useGloriousCore: {
1
+ declare const _default: () => {
2
+ debounce: (callback: () => void, delay: number) => void;
2
3
  numbersWithSeparateSamePrice: (value: String) => string;
3
4
  };
5
+ export default _default;
@@ -1,16 +1,28 @@
1
- export const useGloriousCore = {
2
- numbersWithSeparateSamePrice: (value) => {
3
- if (typeof value === "undefined") return "";
4
- let nStr = value.match(/\d+/g)?.join("") + "";
5
- nStr = nStr.replace(/\,/g, "");
6
- if (nStr === "undefined") nStr = "";
7
- const x = nStr.split(".");
8
- let x1 = x[0];
9
- const x2 = x.length > 1 ? "." + x[1] : "";
10
- let rgx = /(\d+)(\d{3})/;
11
- while (rgx.test(x1)) {
12
- x1 = x1.replace(rgx, "$1,$2");
13
- }
14
- return x1 + x2;
1
+ import { GloriousStore } from "../stores/GloriousStore.mjs";
2
+ const numbersWithSeparateSamePrice = (value) => {
3
+ if (typeof value === "undefined") return "";
4
+ let nStr = value.match(/\d+/g)?.join("") + "";
5
+ nStr = nStr.replace(/\,/g, "");
6
+ if (nStr === "undefined") nStr = "";
7
+ const x = nStr.split(".");
8
+ let x1 = x[0];
9
+ const x2 = x.length > 1 ? "." + x[1] : "";
10
+ let rgx = /(\d+)(\d{3})/;
11
+ while (rgx.test(x1)) {
12
+ x1 = x1.replace(rgx, "$1,$2");
15
13
  }
14
+ return x1 + x2;
15
+ };
16
+ const debounce = (callback, delay) => {
17
+ const gs = GloriousStore();
18
+ clearTimeout(gs.gloriousCoreDebounce);
19
+ gs.gloriousCoreDebounce = setTimeout(function() {
20
+ callback();
21
+ }, delay);
22
+ };
23
+ export default () => {
24
+ return {
25
+ debounce,
26
+ numbersWithSeparateSamePrice
27
+ };
16
28
  };
@@ -77,6 +77,12 @@ export const GloriousStore = defineStore("GloriousStore", {
77
77
  method: moduleConfig.public.glorious.auth.strategy.endpoints.userInfo.method
78
78
  }
79
79
  ).then((data) => {
80
+ if (data.status.value === "error") {
81
+ const moduleConfig2 = useRuntimeConfig();
82
+ const token2 = useCookie(moduleConfig2.public.glorious.auth.cookie.name);
83
+ token2.value = null;
84
+ this.auth.loaded = false;
85
+ }
80
86
  const pick = moduleConfig.public.glorious.auth.strategy.endpoints.userInfo.pick;
81
87
  if (pick !== "") this.auth.user = data.data.value[pick];
82
88
  else this.auth.user = data.data.value;
@@ -176,8 +176,8 @@
176
176
  .glorious-input-options {
177
177
  @apply p-1 shadow-lg fixed w-full bg-white rounded border-gray-200 border max-h-[200px] overflow-y-auto z-40;
178
178
  }
179
- .glorious-input-options > div {
180
- @apply py-2 hover:bg-gray-100 cursor-pointer rounded px-2;
179
+ .glorious-input-options > div > div {
180
+ @apply p-2 hover:bg-gray-100 cursor-pointer rounded;
181
181
  }
182
182
  .glorious-input div > input::placeholder {
183
183
  @apply text-gray-500;
@@ -72,8 +72,8 @@
72
72
  &-options {
73
73
  @apply p-1 shadow-lg fixed w-full bg-white rounded border-gray-200 border max-h-[200px] overflow-y-auto z-40;
74
74
 
75
- > div {
76
- @apply py-2 hover:bg-gray-100 cursor-pointer rounded px-2;
75
+ > div>div {
76
+ @apply p-2 hover:bg-gray-100 cursor-pointer rounded;
77
77
  }
78
78
 
79
79
  // &.size-md {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.3.1",
2
+ "version": "1.3.2",
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",