nuxt-glorious 1.2.2-4 → 1.2.2-5

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": "1.2.2-4"
4
+ "version": "1.2.2-5"
5
5
  }
@@ -22,7 +22,7 @@
22
22
  @apply rounded-md ring-1 ring-green-500;
23
23
  }
24
24
  .glorious-input-primary:disabled {
25
- @apply bg-green-300 cursor-not-allowed;
25
+ @apply bg-green-100 cursor-not-allowed;
26
26
  }
27
27
 
28
28
  .glorious-input-red {
@@ -1,42 +1,42 @@
1
- .g-scafold-modal {
1
+ .glorious-scaffold-modal {
2
2
  @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;
3
3
  }
4
- .g-scafold-modal-header {
4
+ .glorious-scaffold-modal-header {
5
5
  @apply flex justify-between items-center;
6
6
  }
7
- .g-scafold-modal-footer {
8
- @apply flex justify-center gap-3;
7
+ .glorious-scaffold-modal-footer {
8
+ @apply flex justify-center gap-3 mt-3;
9
9
  }
10
- .g-scafold-modal-footer > button {
10
+ .glorious-scaffold-modal-footer > button {
11
11
  @apply min-w-24;
12
12
  }
13
- .g-scafold-modal-bg-blur {
13
+ .glorious-scaffold-modal-bg-blur {
14
14
  @apply fixed top-0 right-0 backdrop-blur-sm bg-gray-500 bg-opacity-50 h-full w-full z-[40];
15
15
  }
16
- .g-scafold-modal.size-full {
16
+ .glorious-scaffold-modal.size-full {
17
17
  @apply w-full h-full top-0 rounded-none;
18
18
  }
19
- .g-scafold-modal.size-xl {
19
+ .glorious-scaffold-modal.size-xl {
20
20
  @apply md:w-[70%] w-full md:h-max max-h-[70%];
21
21
  }
22
- .g-scafold-modal.size-lg {
22
+ .glorious-scaffold-modal.size-lg {
23
23
  @apply md:w-[60%] w-full md:h-max max-h-[70%];
24
24
  }
25
- .g-scafold-modal.size-md {
25
+ .glorious-scaffold-modal.size-md {
26
26
  @apply md:w-[50%] w-full md:h-max max-h-[70%];
27
27
  }
28
- .g-scafold-modal.size-sm {
28
+ .glorious-scaffold-modal.size-sm {
29
29
  @apply lg:w-[25%] md:w-[35%] w-full md:h-max max-h-[70%];
30
30
  }
31
- .g-scafold-modal.close {
31
+ .glorious-scaffold-modal.close {
32
32
  @apply hidden;
33
33
  }
34
34
  @screen md {
35
- .g-scafold-modal.open {
35
+ .glorious-scaffold-modal.open {
36
36
  animation: animationOpacity 0.2s normal forwards;
37
37
  }
38
38
  }
39
- .g-scafold-modal.open {
39
+ .glorious-scaffold-modal.open {
40
40
  animation: animationMobile 0.3s normal forwards;
41
41
  }
42
42
  @keyframes animationOpacity {
@@ -264,7 +264,7 @@ const typeInput = ref(props.type);
264
264
  @apply rounded-md ring-1 ring-green-500;
265
265
  }
266
266
  .glorious-input-primary:disabled {
267
- @apply bg-green-300 cursor-not-allowed;
267
+ @apply bg-green-100 cursor-not-allowed;
268
268
  }
269
269
 
270
270
  .glorious-input-red {
@@ -1,5 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import { watch } from "#imports";
3
+ import { GloriousStore } from "../../stores/GloriousStore";
3
4
  const props = defineProps({
4
5
  modelValue: {
5
6
  required: true,
@@ -52,7 +53,7 @@ const emits = defineEmits(["ok", "close", "update:modelValue"]);
52
53
 
53
54
  const addBlurBackground = (): void => {
54
55
  const backgroundBlur = document.createElement("div");
55
- backgroundBlur.classList.add("g-scafold-modal-bg-blur");
56
+ backgroundBlur.classList.add("glorious-scaffold-modal-bg-blur");
56
57
  const nuxt: any = document.getElementById("__nuxt");
57
58
  nuxt.appendChild(backgroundBlur);
58
59
  backgroundBlur.addEventListener("click", () => {
@@ -69,7 +70,9 @@ watch(
69
70
  if (props.modelValue && props.blur) {
70
71
  addBlurBackground();
71
72
  } else {
72
- const blur: any = document.querySelector(".g-scafold-modal-bg-blur");
73
+ const blur: any = document.querySelector(
74
+ ".glorious-scaffold-modal-bg-blur"
75
+ );
73
76
  if (blur !== null) blur.remove();
74
77
  }
75
78
  }
@@ -78,11 +81,11 @@ watch(
78
81
 
79
82
  <template>
80
83
  <div
81
- class="g-scafold-modal"
84
+ class="glorious-scaffold-modal"
82
85
  :class="[props.modelValue ? 'open' : 'close', `size-${props.size}`]"
83
86
  >
84
87
  <!-- header -->
85
- <div v-show="props?.title !== ''" class="g-scafold-modal-header">
88
+ <div v-show="props?.title !== ''" class="glorious-scaffold-modal-header">
86
89
  <span class="font-medium">{{ props.title }}</span>
87
90
  <GButton
88
91
  class="flex justify-center items-center w-6 h-6"
@@ -94,14 +97,14 @@ watch(
94
97
  </GButton>
95
98
  </div>
96
99
  <hr v-show="props.title !== ''" class="my-3" />
97
- <!-- end hader -->
100
+ <!-- end header -->
98
101
 
99
- <div class="g-scafold-modal-header">
102
+ <div class="glorious-scaffold-modal-content">
100
103
  <slot />
101
104
  </div>
102
105
 
103
106
  <!-- start footer -->
104
- <div v-show="props.okBtn !== ''" class="g-scafold-modal-footer">
107
+ <div v-show="props.okBtn !== ''" class="glorious-scaffold-modal-footer">
105
108
  <GButton :loading="props.okBtnLoading" @click="emits('ok')">
106
109
  {{ props.okBtn }}
107
110
  </GButton>
@@ -117,45 +120,45 @@ watch(
117
120
  </template>
118
121
 
119
122
  <style>
120
- .g-scafold-modal {
123
+ .glorious-scaffold-modal {
121
124
  @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;
122
125
  }
123
- .g-scafold-modal-header {
126
+ .glorious-scaffold-modal-header {
124
127
  @apply flex justify-between items-center;
125
128
  }
126
- .g-scafold-modal-footer {
127
- @apply flex justify-center gap-3;
129
+ .glorious-scaffold-modal-footer {
130
+ @apply flex justify-center gap-3 mt-3;
128
131
  }
129
- .g-scafold-modal-footer > button {
132
+ .glorious-scaffold-modal-footer > button {
130
133
  @apply min-w-24;
131
134
  }
132
- .g-scafold-modal-bg-blur {
135
+ .glorious-scaffold-modal-bg-blur {
133
136
  @apply fixed top-0 right-0 backdrop-blur-sm bg-gray-500 bg-opacity-50 h-full w-full z-[40];
134
137
  }
135
- .g-scafold-modal.size-full {
138
+ .glorious-scaffold-modal.size-full {
136
139
  @apply w-full h-full top-0 rounded-none;
137
140
  }
138
- .g-scafold-modal.size-xl {
141
+ .glorious-scaffold-modal.size-xl {
139
142
  @apply md:w-[70%] w-full md:h-max max-h-[70%];
140
143
  }
141
- .g-scafold-modal.size-lg {
144
+ .glorious-scaffold-modal.size-lg {
142
145
  @apply md:w-[60%] w-full md:h-max max-h-[70%];
143
146
  }
144
- .g-scafold-modal.size-md {
147
+ .glorious-scaffold-modal.size-md {
145
148
  @apply md:w-[50%] w-full md:h-max max-h-[70%];
146
149
  }
147
- .g-scafold-modal.size-sm {
150
+ .glorious-scaffold-modal.size-sm {
148
151
  @apply lg:w-[25%] md:w-[35%] w-full md:h-max max-h-[70%];
149
152
  }
150
- .g-scafold-modal.close {
153
+ .glorious-scaffold-modal.close {
151
154
  @apply hidden;
152
155
  }
153
156
  @screen md {
154
- .g-scafold-modal.open {
157
+ .glorious-scaffold-modal.open {
155
158
  animation: animationOpacity 0.2s normal forwards;
156
159
  }
157
160
  }
158
- .g-scafold-modal.open {
161
+ .glorious-scaffold-modal.open {
159
162
  animation: animationMobile 0.3s normal forwards;
160
163
  }
161
164
  @keyframes animationOpacity {
@@ -13,37 +13,56 @@ const props = defineProps({
13
13
  required: true,
14
14
  type: Object,
15
15
  },
16
+ loading: {
17
+ required: false,
18
+ default: false,
19
+ type: Boolean,
20
+ },
21
+ loadingOption: {
22
+ required: false,
23
+ default: {
24
+ color: "green",
25
+ },
26
+ type: {
27
+ color: String,
28
+ },
29
+ },
16
30
  });
17
31
  </script>
18
32
 
19
33
  <template>
20
- <div class="glorious-table" :class="[`color-${props.color}`]">
21
- <table>
22
- <thead>
23
- <tr>
24
- <th v-for="(headItem, index) in props.header" :key="index">
25
- {{ headItem }}
26
- </th>
27
- </tr>
28
- </thead>
29
- <tbody>
30
- <tr v-for="(bodyItem, index) in props.body" :key="index">
31
- <td
32
- v-for="(headItem, headKey, headIndex) in props.header"
33
- :key="headIndex"
34
- >
35
- <slot
36
- v-if="typeof $slots[headKey] !== 'undefined'"
37
- :name="headKey"
38
- :item="bodyItem"
39
- />
40
- <template v-else>
41
- {{ bodyItem[headKey] }}
42
- </template>
43
- </td>
44
- </tr>
45
- </tbody>
46
- </table>
34
+ <div class="flex flex-col">
35
+ <div class="glorious-table" :class="[`color-${props.color}`]">
36
+ <table>
37
+ <thead>
38
+ <tr>
39
+ <th v-for="(headItem, index) in props.header" :key="index">
40
+ {{ headItem }}
41
+ </th>
42
+ </tr>
43
+ </thead>
44
+ <tbody>
45
+ <tr v-for="(bodyItem, index) in props.body" :key="index">
46
+ <td
47
+ v-for="(headItem, headKey, headIndex) in props.header"
48
+ :key="headIndex"
49
+ >
50
+ <slot
51
+ v-if="typeof $slots[headKey] !== 'undefined'"
52
+ :name="headKey"
53
+ :item="bodyItem"
54
+ />
55
+ <template v-else>
56
+ {{ bodyItem[headKey] }}
57
+ </template>
58
+ </td>
59
+ </tr>
60
+ </tbody>
61
+ </table>
62
+ </div>
63
+ <div class="flex justify-center">
64
+ <GLoading v-if="props.loading" :color="props.loadingOption.color" />
65
+ </div>
47
66
  </div>
48
67
  </template>
49
68
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.2.2-4",
2
+ "version": "1.2.2-5",
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",