nuxt-glorious 0.8.2-oteacher → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
package/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "glorious",
3
3
  "configKey": "glorious",
4
- "version": "0.8.2-oteacher"
4
+ "version": "0.8.3"
5
5
  }
@@ -30,7 +30,7 @@
30
30
  }
31
31
 
32
32
  .outline.glorious-button-orange, .outline.glorious-button-blue, .outline.glorious-button-gray, .outline.glorious-button-red, .outline.glorious-button-primary {
33
- @apply border outline-none;
33
+ @apply bg-transparent border outline-none;
34
34
  }
35
35
 
36
36
  .glorious-button-orange > div.loading, .glorious-button-blue > div.loading, .glorious-button-gray > div.loading, .glorious-button-red > div.loading, .glorious-button-primary > div.loading {
@@ -38,7 +38,7 @@
38
38
  }
39
39
 
40
40
  .glorious-button-primary {
41
- @apply bg-green-700 hover:bg-green-600 rounded-md border-green-500 px-3;
41
+ @apply bg-green-700 hover:bg-green-600 rounded-md text-white border-green-500 px-3;
42
42
  }
43
43
  .glorious-button-primary.outline {
44
44
  @apply text-gray-500 hover:bg-green-100;
@@ -48,7 +48,7 @@
48
48
  }
49
49
 
50
50
  .glorious-button-red {
51
- @apply bg-red-500 hover:bg-red-600 rounded-md border-red-500 px-3;
51
+ @apply bg-red-500 hover:bg-red-600 rounded-md text-white border-red-500 px-3;
52
52
  }
53
53
  .glorious-button-red.outline {
54
54
  @apply text-gray-500 hover:bg-red-100;
@@ -58,7 +58,7 @@
58
58
  }
59
59
 
60
60
  .glorious-button-gray {
61
- @apply bg-gray-500 hover:bg-gray-600 rounded-md border-gray-500 px-3;
61
+ @apply bg-gray-500 hover:bg-gray-600 rounded-md text-white border-gray-500 px-3;
62
62
  }
63
63
  .glorious-button-gray.outline {
64
64
  @apply text-gray-500 hover:bg-gray-100;
@@ -68,7 +68,7 @@
68
68
  }
69
69
 
70
70
  .glorious-button-blue {
71
- @apply bg-blue-500 hover:bg-blue-600 rounded-md border-blue-500 px-3;
71
+ @apply bg-blue-500 hover:bg-blue-600 rounded-md text-white border-blue-500 px-3;
72
72
  }
73
73
  .glorious-button-blue.outline {
74
74
  @apply text-gray-500 hover:bg-blue-100;
@@ -78,7 +78,7 @@
78
78
  }
79
79
 
80
80
  .glorious-button-orange {
81
- @apply bg-orange-500 hover:bg-orange-600 rounded-md border-orange-500 px-3;
81
+ @apply bg-orange-500 hover:bg-orange-600 rounded-md text-white border-orange-500 px-3;
82
82
  }
83
83
  .glorious-button-orange.outline {
84
84
  @apply text-gray-500 hover:bg-orange-100;
@@ -3,7 +3,7 @@
3
3
  }
4
4
 
5
5
  .drawer {
6
- @apply fixed top-0 h-full w-[300px] z-[50];
6
+ @apply fixed top-0 bg-white h-full w-[300px] z-[50];
7
7
  }
8
8
  .drawer.close.rtl {
9
9
  animation: drawer-close-right 250ms normal forwards;
@@ -14,5 +14,5 @@
14
14
  @apply absolute top-0 bottom-0 my-auto z-[20];
15
15
  }
16
16
  .glorious-dropdown.open > div:last-child {
17
- @apply px-2 py-2 rounded-md shadow absolute z-[41] left-[16px] top-5 flex;
17
+ @apply bg-white px-2 py-2 rounded-md shadow absolute z-[41] left-[16px] top-5 flex;
18
18
  }
@@ -18,7 +18,7 @@
18
18
  @apply rounded-md ring-1 ring-green-500 overflow-hidden cursor-pointer relative;
19
19
  }
20
20
  .glorious-file-primary > div.placeholder {
21
- @apply bg-green-500 px-3 w-max;
21
+ @apply bg-green-500 text-white px-3 w-max;
22
22
  }
23
23
  .glorious-file-primary > div:last-child {
24
24
  @apply absolute left-3 hidden;
@@ -28,7 +28,7 @@
28
28
  @apply rounded-md ring-1 ring-red-500 px-3 cursor-pointer relative;
29
29
  }
30
30
  .glorious-file-red > div.placeholder {
31
- @apply bg-green-500 px-3 w-max;
31
+ @apply bg-green-500 text-white px-3 w-max;
32
32
  }
33
33
  .glorious-file-red > div:last-child {
34
34
  @apply absolute left-3;
@@ -38,7 +38,7 @@
38
38
  @apply rounded-md ring-1 ring-gray-500 px-3 cursor-pointer relative;
39
39
  }
40
40
  .glorious-file-gray > div.placeholder {
41
- @apply bg-green-500 px-3 w-max;
41
+ @apply bg-green-500 text-white px-3 w-max;
42
42
  }
43
43
  .glorious-file-gray > div:last-child {
44
44
  @apply absolute left-3;
@@ -48,7 +48,7 @@
48
48
  @apply rounded-md ring-1 ring-blue-500 px-3 cursor-pointer relative;
49
49
  }
50
50
  .glorious-file-blue > div.placeholder {
51
- @apply bg-green-500 px-3 w-max;
51
+ @apply bg-green-500 text-white px-3 w-max;
52
52
  }
53
53
  .glorious-file-blue > div:last-child {
54
54
  @apply absolute left-3;
@@ -58,7 +58,7 @@
58
58
  @apply rounded-md ring-1 ring-orange-500 px-3 cursor-pointer relative;
59
59
  }
60
60
  .glorious-file-orange > div.placeholder {
61
- @apply bg-green-500 px-3 w-max;
61
+ @apply bg-green-500 text-white px-3 w-max;
62
62
  }
63
63
  .glorious-file-orange > div:last-child {
64
64
  @apply absolute left-3;
@@ -87,5 +87,5 @@
87
87
  @apply mt-3 gap-2 flex flex-wrap;
88
88
  }
89
89
  .glorious-input-tag > div {
90
- @apply bg-green-500 px-1 rounded flex items-center gap-2 cursor-pointer;
90
+ @apply bg-green-500 px-1 rounded text-white flex items-center gap-2 cursor-pointer;
91
91
  }
@@ -3,7 +3,7 @@
3
3
  }
4
4
 
5
5
  .glorious-modal {
6
- @apply fixed 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;
6
+ @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;
7
7
  }
8
8
  .glorious-modal.size-full {
9
9
  @apply w-full h-full top-0 rounded-none;
@@ -1,5 +1,5 @@
1
1
  .glorious-paginate > div {
2
- @apply border border-gray-50 rounded-xl h-8 flex items-center px-1 shadow-md gap-1 w-max;
2
+ @apply border border-gray-50 rounded-xl h-8 flex items-center px-1 bg-white shadow-md gap-1 w-max;
3
3
  direction: rtl;
4
4
  }
5
5
  .glorious-paginate > div > div {
@@ -13,5 +13,5 @@
13
13
  @apply text-[13px];
14
14
  }
15
15
  .paginate.active {
16
- @apply bg-green-500 rounded-lg font-bold text-[13px];
16
+ @apply bg-green-500 rounded-lg text-white font-bold text-[13px];
17
17
  }
@@ -5,5 +5,5 @@
5
5
  @apply text-gray-700 text-[14px] hover:bg-green-200 hover:text-gray-800 cursor-pointer px-2 py-1 rounded-lg;
6
6
  }
7
7
  .glorious-tab > div > button.active {
8
- @apply font-bold bg-green-700;
8
+ @apply font-bold text-white bg-green-700;
9
9
  }
@@ -104,7 +104,7 @@ const props = defineProps({
104
104
  }
105
105
 
106
106
  .outline.glorious-button-orange, .outline.glorious-button-blue, .outline.glorious-button-gray, .outline.glorious-button-red, .outline.glorious-button-primary {
107
- @apply border outline-none;
107
+ @apply bg-transparent border outline-none;
108
108
  }
109
109
 
110
110
  .glorious-button-orange > div.loading, .glorious-button-blue > div.loading, .glorious-button-gray > div.loading, .glorious-button-red > div.loading, .glorious-button-primary > div.loading {
@@ -112,7 +112,7 @@ const props = defineProps({
112
112
  }
113
113
 
114
114
  .glorious-button-primary {
115
- @apply bg-green-700 hover:bg-green-600 rounded-md border-green-500 px-3;
115
+ @apply bg-green-700 hover:bg-green-600 rounded-md text-white border-green-500 px-3;
116
116
  }
117
117
  .glorious-button-primary.outline {
118
118
  @apply text-gray-500 hover:bg-green-100;
@@ -122,7 +122,7 @@ const props = defineProps({
122
122
  }
123
123
 
124
124
  .glorious-button-red {
125
- @apply bg-red-500 hover:bg-red-600 rounded-md border-red-500 px-3;
125
+ @apply bg-red-500 hover:bg-red-600 rounded-md text-white border-red-500 px-3;
126
126
  }
127
127
  .glorious-button-red.outline {
128
128
  @apply text-gray-500 hover:bg-red-100;
@@ -132,7 +132,7 @@ const props = defineProps({
132
132
  }
133
133
 
134
134
  .glorious-button-gray {
135
- @apply bg-gray-500 hover:bg-gray-600 rounded-md border-gray-500 px-3;
135
+ @apply bg-gray-500 hover:bg-gray-600 rounded-md text-white border-gray-500 px-3;
136
136
  }
137
137
  .glorious-button-gray.outline {
138
138
  @apply text-gray-500 hover:bg-gray-100;
@@ -142,7 +142,7 @@ const props = defineProps({
142
142
  }
143
143
 
144
144
  .glorious-button-blue {
145
- @apply bg-blue-500 hover:bg-blue-600 rounded-md border-blue-500 px-3;
145
+ @apply bg-blue-500 hover:bg-blue-600 rounded-md text-white border-blue-500 px-3;
146
146
  }
147
147
  .glorious-button-blue.outline {
148
148
  @apply text-gray-500 hover:bg-blue-100;
@@ -152,7 +152,7 @@ const props = defineProps({
152
152
  }
153
153
 
154
154
  .glorious-button-orange {
155
- @apply bg-orange-500 hover:bg-orange-600 rounded-md border-orange-500 px-3;
155
+ @apply bg-orange-500 hover:bg-orange-600 rounded-md text-white border-orange-500 px-3;
156
156
  }
157
157
  .glorious-button-orange.outline {
158
158
  @apply text-gray-500 hover:bg-orange-100;
@@ -27,7 +27,7 @@ const props = defineProps({
27
27
  }
28
28
 
29
29
  .drawer {
30
- @apply fixed top-0 h-full w-[300px] z-[50];
30
+ @apply fixed top-0 bg-white h-full w-[300px] z-[50];
31
31
  }
32
32
  .drawer.close.rtl {
33
33
  animation: drawer-close-right 250ms normal forwards;
@@ -58,6 +58,6 @@ onMounted(() => {
58
58
  @apply absolute top-0 bottom-0 my-auto z-[20];
59
59
  }
60
60
  .glorious-dropdown.open > div:last-child {
61
- @apply px-2 py-2 rounded-md shadow absolute z-[41] left-[16px] top-5 flex;
61
+ @apply bg-white px-2 py-2 rounded-md shadow absolute z-[41] left-[16px] top-5 flex;
62
62
  }
63
63
  </style>
@@ -4,7 +4,7 @@ const props = defineProps({
4
4
  modelValue: {
5
5
  required: false,
6
6
  default: "",
7
- type: String,
7
+ type: [String, Object],
8
8
  },
9
9
  color: {
10
10
  required: false,
@@ -67,7 +67,10 @@ const deleteFile = (event: any) => {
67
67
  @click.prevent="deleteFile($event)"
68
68
  />
69
69
  </label>
70
- <span v-if="gs.forms[error[0]]?.errors[error[1]]" class="text-red-500">
70
+ <span
71
+ v-if="gs.forms[error[0]]?.errors[error[1]]"
72
+ class="text-red-500 text-[14px]"
73
+ >
71
74
  {{ gs.forms[error[0]].errors[error[1]][0] }}
72
75
  </span>
73
76
  </div>
@@ -94,7 +97,7 @@ const deleteFile = (event: any) => {
94
97
  @apply rounded-md ring-1 ring-green-500 overflow-hidden cursor-pointer relative;
95
98
  }
96
99
  .glorious-file-primary > div.placeholder {
97
- @apply bg-green-500 px-3 w-max;
100
+ @apply bg-green-500 text-white px-3 w-max;
98
101
  }
99
102
  .glorious-file-primary > div:last-child {
100
103
  @apply absolute left-3 hidden;
@@ -104,7 +107,7 @@ const deleteFile = (event: any) => {
104
107
  @apply rounded-md ring-1 ring-red-500 px-3 cursor-pointer relative;
105
108
  }
106
109
  .glorious-file-red > div.placeholder {
107
- @apply bg-green-500 px-3 w-max;
110
+ @apply bg-green-500 text-white px-3 w-max;
108
111
  }
109
112
  .glorious-file-red > div:last-child {
110
113
  @apply absolute left-3;
@@ -114,7 +117,7 @@ const deleteFile = (event: any) => {
114
117
  @apply rounded-md ring-1 ring-gray-500 px-3 cursor-pointer relative;
115
118
  }
116
119
  .glorious-file-gray > div.placeholder {
117
- @apply bg-green-500 px-3 w-max;
120
+ @apply bg-green-500 text-white px-3 w-max;
118
121
  }
119
122
  .glorious-file-gray > div:last-child {
120
123
  @apply absolute left-3;
@@ -124,7 +127,7 @@ const deleteFile = (event: any) => {
124
127
  @apply rounded-md ring-1 ring-blue-500 px-3 cursor-pointer relative;
125
128
  }
126
129
  .glorious-file-blue > div.placeholder {
127
- @apply bg-green-500 px-3 w-max;
130
+ @apply bg-green-500 text-white px-3 w-max;
128
131
  }
129
132
  .glorious-file-blue > div:last-child {
130
133
  @apply absolute left-3;
@@ -134,7 +137,7 @@ const deleteFile = (event: any) => {
134
137
  @apply rounded-md ring-1 ring-orange-500 px-3 cursor-pointer relative;
135
138
  }
136
139
  .glorious-file-orange > div.placeholder {
137
- @apply bg-green-500 px-3 w-max;
140
+ @apply bg-green-500 text-white px-3 w-max;
138
141
  }
139
142
  .glorious-file-orange > div:last-child {
140
143
  @apply absolute left-3;
@@ -1,5 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, ref, watch, GloriousStore } from "#imports";
3
+ import { useGloriousCore } from "../../composables/useGloriousCore";
3
4
  const props = defineProps({
4
5
  modelValue: {
5
6
  required: false,
@@ -56,6 +57,11 @@ const props = defineProps({
56
57
  default: "normal",
57
58
  type: String,
58
59
  },
60
+ display: {
61
+ required: false,
62
+ default: "",
63
+ type: String as () => "price",
64
+ },
59
65
  });
60
66
 
61
67
  const inputValue: any = ref(null);
@@ -66,7 +72,21 @@ watch(
66
72
  () => inputValue.value,
67
73
  () => {
68
74
  if (props.mode === "tag") return;
69
- emits("update:modelValue", inputValue.value);
75
+
76
+ switch (props.display) {
77
+ case "price":
78
+ inputValue.value = useGloriousCore.numbersWithSeperateSamePrice(
79
+ inputValue.value
80
+ );
81
+ emits(
82
+ "update:modelValue",
83
+ inputValue.value.toString().replaceAll(",", "")
84
+ );
85
+ break;
86
+ default:
87
+ emits("update:modelValue", inputValue.value);
88
+ break;
89
+ }
70
90
  }
71
91
  );
72
92
 
@@ -168,7 +188,11 @@ watch(
168
188
  :color="$tailwindColor('gray', '500')"
169
189
  />
170
190
  </div>
171
- <span v-if="gs.forms[error[0]]?.errors[error[1]]" class="text-red-500">
191
+
192
+ <span
193
+ v-if="gs.forms[error[0]]?.errors[error[1]]"
194
+ class="text-red-500 text-[14px]"
195
+ >
172
196
  {{ gs.forms[error[0]].errors[error[1]][0] }}
173
197
  </span>
174
198
  </div>
@@ -264,6 +288,6 @@ watch(
264
288
  @apply mt-3 gap-2 flex flex-wrap;
265
289
  }
266
290
  .glorious-input-tag > div {
267
- @apply bg-green-500 px-1 rounded flex items-center gap-2 cursor-pointer;
291
+ @apply bg-green-500 px-1 rounded text-white flex items-center gap-2 cursor-pointer;
268
292
  }
269
293
  </style>
@@ -28,7 +28,7 @@ const props = defineProps({
28
28
  <div v-if="props?.title !== ''" class="flex justify-between items-center">
29
29
  <span class="font-medium">{{ props.title }}</span>
30
30
  <GButton
31
- class="flex justify-center items-center w-[10px]"
31
+ class="flex justify-center items-center w-6 h-6"
32
32
  size="sm"
33
33
  @click="$modal(`${props.id}`)"
34
34
  >
@@ -48,7 +48,7 @@ const props = defineProps({
48
48
  }
49
49
 
50
50
  .glorious-modal {
51
- @apply fixed 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;
51
+ @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;
52
52
  }
53
53
  .glorious-modal.size-full {
54
54
  @apply w-full h-full top-0 rounded-none;
@@ -1,117 +1,98 @@
1
1
  <script lang="ts" setup>
2
- import { reactive, watch } from "#imports";
2
+ import { watch } from "#imports";
3
3
  const props = defineProps({
4
- data: {
4
+ currentPage: {
5
5
  required: true,
6
- type: Object,
6
+ type: Number,
7
+ default: 1,
8
+ },
9
+ lastPage: {
10
+ required: true,
11
+ type: Number,
12
+ default: 1,
13
+ },
14
+ numberSugestPage: {
15
+ required: false,
16
+ type: Number,
17
+ default: 3,
7
18
  },
8
19
  modelValue: {
9
20
  required: true,
10
21
  type: Number,
11
22
  },
12
23
  });
13
- const el = reactive({
14
- pageList: [],
15
- });
16
24
 
17
25
  const emits = defineEmits(["update:modelValue"]);
18
- const methods = {
19
- emit: (item: any) => {
20
- if (props.data?.current_page !== item) emits("update:modelValue", item);
21
- },
22
- computePageList: () => {
23
- let count: number = 0;
24
26
 
25
- for (
26
- let i: number = props.data?.current_page;
27
- i > 0 && el.pageList.length <= 2;
28
- i--
29
- ) {
30
- if (!el.pageList.includes(i)) el.pageList.push(i);
31
-
32
- count++;
33
- }
34
-
35
- let page: number = props.data?.current_page;
36
- while (count < 5 && page < props.data?.last_page) {
37
- page++;
38
-
39
- if (!el.pageList.includes(page)) el.pageList.push(page);
27
+ const emit = (item: any) => {
28
+ if (props.currentPage !== item) emits("update:modelValue", item);
29
+ };
40
30
 
41
- count++;
42
- }
31
+ const listPage = ref<Array<Number>>([]);
43
32
 
44
- if (!el.pageList.includes(props.data?.current_page))
45
- el.pageList.push(props.data?.current_page);
33
+ const computeListPage = () => {
34
+ listPage.value = [];
35
+ let firstPage = props.currentPage - props.numberSugestPage;
36
+ const endPage = props.currentPage + (props.numberSugestPage + 1);
46
37
 
47
- el.pageList = el.pageList.sort((a: number, b: number) => a - b);
48
- },
38
+ while (firstPage < endPage) {
39
+ if (firstPage > 0 && firstPage <= props.lastPage)
40
+ listPage.value.push(firstPage);
41
+ firstPage++;
42
+ }
49
43
  };
50
- methods.computePageList();
44
+ computeListPage();
51
45
  watch(
52
- () => props.data,
53
- () => methods.computePageList(),
54
- { deep: true }
46
+ () => props.currentPage,
47
+ () => computeListPage()
55
48
  );
49
+
50
+ const arrowPrevious = () => {
51
+ if (props.currentPage !== 1) emit(props.currentPage - 1);
52
+ };
53
+ const arrowNext = () => {
54
+ if (props.currentPage !== props.lastPage) emit(props.currentPage + 1);
55
+ };
56
56
  </script>
57
57
 
58
58
  <template>
59
59
  <div
60
- v-if="props.data?.current_page && props.data?.last_page !== 1"
60
+ v-if="props.currentPage && props.lastPage !== 1"
61
61
  class="w-max glorious-paginate"
62
62
  >
63
63
  <div>
64
- <ClientOnly>
65
- <GIcon
66
- v-if="props.data?.current_page !== 1"
67
- class="ml-2 cursor-pointer"
68
- name="glorious-arrow"
69
- :size="15"
70
- @click="methods.emit(props.data?.current_page - 1)"
71
- />
72
- <GIcon
73
- v-else
74
- name="glorious-arrow"
75
- :size="15"
76
- class="ml-2"
77
- color="#cbd5e1"
78
- />
79
- </ClientOnly>
64
+ <GIcon
65
+ :color="props.currentPage !== 1 ? '#000' : '#cbd5e1'"
66
+ class="ml-2 cursor-pointer"
67
+ name="glorious-arrow"
68
+ :size="15"
69
+ @click="arrowPrevious()"
70
+ />
80
71
 
81
72
  <div
82
- v-for="(item, index) in el.pageList"
73
+ v-for="(item, index) in listPage"
83
74
  :key="index"
84
75
  class="w-6 h-6 rounded-lg flex items-center justify-center paginate"
85
- :class="[
86
- props.data?.current_page === item ? 'active' : 'cursor-pointer',
87
- ]"
88
- @click="methods.emit(item)"
76
+ :class="[props.currentPage === item ? 'active' : 'cursor-pointer']"
77
+ @click="emit(item)"
89
78
  >
90
79
  {{ item }}
91
80
  </div>
92
81
 
93
- <ClientOnly>
94
- <GIcon
95
- v-if="props.data?.current_page !== props.data?.last_page"
96
- name="glorious-arrow"
97
- class="mr-2 cursor-pointer"
98
- :size="15"
99
- @click="methods.emit(props.data?.current_page + 1)"
100
- />
101
- <GIcon
102
- v-else
103
- name="glorious-arrow"
104
- color="#cbd5e1"
105
- class="mr-2 cursor-pointer"
106
- />
107
- </ClientOnly>
82
+ <GIcon
83
+ :color="props.currentPage !== props.lastPage ? '#000' : '#cbd5e1'"
84
+ name="glorious-arrow"
85
+ class="mr-2 cursor-pointer"
86
+ :size="15"
87
+ @click="arrowNext"
88
+ />
108
89
  </div>
109
90
  </div>
110
91
  </template>
111
92
 
112
93
  <style>
113
94
  .glorious-paginate > div {
114
- @apply border border-gray-50 rounded-xl h-8 flex items-center px-1 shadow-md gap-1 w-max;
95
+ @apply border border-gray-50 rounded-xl h-8 flex items-center px-1 bg-white shadow-md gap-1 w-max;
115
96
  direction: rtl;
116
97
  }
117
98
  .glorious-paginate > div > div {
@@ -125,6 +106,6 @@ watch(
125
106
  @apply text-[13px];
126
107
  }
127
108
  .paginate.active {
128
- @apply bg-green-500 rounded-lg font-bold text-[13px];
109
+ @apply bg-green-500 rounded-lg text-white font-bold text-[13px];
129
110
  }
130
111
  </style>
@@ -36,11 +36,6 @@ const props = defineProps({
36
36
  default: false,
37
37
  type: Boolean,
38
38
  },
39
- placeholder: {
40
- required: false,
41
- default: "",
42
- type: String,
43
- },
44
39
  });
45
40
  const selectValue = ref(null);
46
41
  const emits = defineEmits(["update:modelValue"]);
@@ -81,7 +76,10 @@ watch(
81
76
  {{ item.text }}
82
77
  </option>
83
78
  </select>
84
- <span v-if="gs.forms[error[0]]?.errors[error[1]]" class="text-red-500">
79
+ <span
80
+ v-if="gs.forms[error[0]]?.errors[error[1]]"
81
+ class="text-red-500 text-[14px]"
82
+ >
85
83
  {{ gs.forms[error[0]].errors[error[1]][0] }}
86
84
  </span>
87
85
  </div>
@@ -52,6 +52,6 @@ const tabClicked: any = (key: string, event: any) => {
52
52
  @apply text-gray-700 text-[14px] hover:bg-green-200 hover:text-gray-800 cursor-pointer px-2 py-1 rounded-lg;
53
53
  }
54
54
  .glorious-tab > div > button.active {
55
- @apply font-bold bg-green-700;
55
+ @apply font-bold text-white bg-green-700;
56
56
  }
57
57
  </style>
@@ -67,7 +67,10 @@ const error: any = props.error.split("|");
67
67
  :disabled="props.disabled"
68
68
  />
69
69
  </div>
70
- <span v-if="gs.forms[error[0]]?.errors[error[1]]" class="text-red-500">
70
+ <span
71
+ v-if="gs.forms[error[0]]?.errors[error[1]]"
72
+ class="text-red-500 text-[14px]"
73
+ >
71
74
  {{ gs.forms[error[0]].errors[error[1]][0] }}
72
75
  </span>
73
76
  </div>
@@ -0,0 +1,3 @@
1
+ export declare const useGloriousCore: {
2
+ numbersWithSeperateSamePrice: (value: String) => string;
3
+ };
@@ -0,0 +1,16 @@
1
+ export const useGloriousCore = {
2
+ numbersWithSeperateSamePrice: (value) => {
3
+ let nStr = value.match(/\d+/g)?.join("") + "";
4
+ nStr = nStr.replace(/\,/g, "");
5
+ if (nStr === "undefined")
6
+ 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;
15
+ }
16
+ };
@@ -6,9 +6,10 @@ interface gloriousFetchOptions {
6
6
  lazy?: Boolean;
7
7
  headers?: Object;
8
8
  body?: Object;
9
- bodyType: "formData" | "formDataCustom" | "normal";
9
+ bodyType?: "formData" | "formDataCustom" | "normal";
10
10
  method?: "POST" | "GET" | "PATCH" | "PUT" | "DELETE" | "HEAD";
11
11
  credentials?: "same-origin" | "include";
12
+ watch?: Array<Object>;
12
13
  }
13
14
  export default function (url: string, options: gloriousFetchOptions): Promise<unknown>;
14
15
  export {};
@@ -55,11 +55,8 @@ export default function(url, options) {
55
55
  } catch (e) {
56
56
  }
57
57
  }
58
- if (res.status === 401 && process.client) {
59
- const cookieToken = useCookie(moduleConfig.auth.cookie.name);
60
- if (typeof cookieToken.value !== "undefined")
61
- gs.authLogout();
62
- }
58
+ if (res.status === 401 && process.client)
59
+ gs.authLogout();
63
60
  }
64
61
  }
65
62
  };
@@ -91,6 +88,7 @@ function computeAuth() {
91
88
  return header;
92
89
  }
93
90
  function computeFormData(options) {
91
+ console.log(options.body);
94
92
  const form = new FormData();
95
93
  Object.entries(options.body).forEach((item) => {
96
94
  if (item[1] === null)
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.8.2-oteacher",
2
+ "version": "0.8.3",
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",