nuxt-glorious 1.1.9-2 → 1.1.9-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": "1.1.9-2"
4
+ "version": "1.1.9-3"
5
5
  }
@@ -1,7 +1,3 @@
1
- button:focus-visible {
2
- outline: none;
3
- }
4
-
5
1
  .xl.glorious-button-orange, .xl.glorious-button-blue, .xl.glorious-button-gray, .xl.glorious-button-red, .xl.glorious-button-primary {
6
2
  @apply py-2.5;
7
3
  }
@@ -48,7 +44,7 @@ button:focus-visible {
48
44
  @apply text-gray-500 hover:bg-green-100;
49
45
  }
50
46
  .glorious-button-primary:disabled {
51
- @apply cursor-not-allowed opacity-50;
47
+ @apply cursor-not-allowed;
52
48
  }
53
49
  .glorious-button-primary:disabled:not(:disabled) {
54
50
  @apply bg-green-300;
@@ -61,7 +57,7 @@ button:focus-visible {
61
57
  @apply text-gray-500 hover:bg-red-100;
62
58
  }
63
59
  .glorious-button-red:disabled {
64
- @apply cursor-not-allowed opacity-50;
60
+ @apply cursor-not-allowed;
65
61
  }
66
62
  .glorious-button-red:disabled:not(:disabled) {
67
63
  @apply bg-red-300;
@@ -74,7 +70,7 @@ button:focus-visible {
74
70
  @apply text-gray-500 hover:bg-gray-100;
75
71
  }
76
72
  .glorious-button-gray:disabled {
77
- @apply cursor-not-allowed opacity-50;
73
+ @apply cursor-not-allowed;
78
74
  }
79
75
  .glorious-button-gray:disabled:not(:disabled) {
80
76
  @apply bg-gray-300;
@@ -87,7 +83,7 @@ button:focus-visible {
87
83
  @apply text-gray-500 hover:bg-blue-100;
88
84
  }
89
85
  .glorious-button-blue:disabled {
90
- @apply cursor-not-allowed opacity-50;
86
+ @apply cursor-not-allowed;
91
87
  }
92
88
  .glorious-button-blue:disabled:not(:disabled) {
93
89
  @apply bg-blue-300;
@@ -100,7 +96,7 @@ button:focus-visible {
100
96
  @apply text-gray-500 hover:bg-orange-100;
101
97
  }
102
98
  .glorious-button-orange:disabled {
103
- @apply cursor-not-allowed opacity-50;
99
+ @apply cursor-not-allowed;
104
100
  }
105
101
  .glorious-button-orange:disabled:not(:disabled) {
106
102
  @apply bg-orange-300;
@@ -36,13 +36,6 @@ const props = defineProps({
36
36
  type: String,
37
37
  },
38
38
  });
39
-
40
- const emits = defineEmits(["click"]);
41
- const click = () => {
42
- if (props.loading) return;
43
-
44
- emits("click");
45
- };
46
39
  </script>
47
40
 
48
41
  <template>
@@ -55,7 +48,6 @@ const click = () => {
55
48
  props.outline ? 'outline' : '',
56
49
  ]"
57
50
  :disabled="props.disabled"
58
- @click="click"
59
51
  >
60
52
  <div v-if="props.loading" class="loading">
61
53
  <GLoading />
@@ -72,15 +64,14 @@ const click = () => {
72
64
  ]"
73
65
  :disabled="props.disabled"
74
66
  >
75
- <slot />
67
+ <div v-if="props.loading" class="loading">
68
+ <GLoading />
69
+ </div>
70
+ <slot v-else />
76
71
  </NuxtLink>
77
72
  </template>
78
73
 
79
74
  <style>
80
- button:focus-visible {
81
- outline: none;
82
- }
83
-
84
75
  .xl.glorious-button-orange, .xl.glorious-button-blue, .xl.glorious-button-gray, .xl.glorious-button-red, .xl.glorious-button-primary {
85
76
  @apply py-2.5;
86
77
  }
@@ -127,7 +118,7 @@ button:focus-visible {
127
118
  @apply text-gray-500 hover:bg-green-100;
128
119
  }
129
120
  .glorious-button-primary:disabled {
130
- @apply cursor-not-allowed opacity-50;
121
+ @apply cursor-not-allowed;
131
122
  }
132
123
  .glorious-button-primary:disabled:not(:disabled) {
133
124
  @apply bg-green-300;
@@ -140,7 +131,7 @@ button:focus-visible {
140
131
  @apply text-gray-500 hover:bg-red-100;
141
132
  }
142
133
  .glorious-button-red:disabled {
143
- @apply cursor-not-allowed opacity-50;
134
+ @apply cursor-not-allowed;
144
135
  }
145
136
  .glorious-button-red:disabled:not(:disabled) {
146
137
  @apply bg-red-300;
@@ -153,7 +144,7 @@ button:focus-visible {
153
144
  @apply text-gray-500 hover:bg-gray-100;
154
145
  }
155
146
  .glorious-button-gray:disabled {
156
- @apply cursor-not-allowed opacity-50;
147
+ @apply cursor-not-allowed;
157
148
  }
158
149
  .glorious-button-gray:disabled:not(:disabled) {
159
150
  @apply bg-gray-300;
@@ -166,7 +157,7 @@ button:focus-visible {
166
157
  @apply text-gray-500 hover:bg-blue-100;
167
158
  }
168
159
  .glorious-button-blue:disabled {
169
- @apply cursor-not-allowed opacity-50;
160
+ @apply cursor-not-allowed;
170
161
  }
171
162
  .glorious-button-blue:disabled:not(:disabled) {
172
163
  @apply bg-blue-300;
@@ -179,7 +170,7 @@ button:focus-visible {
179
170
  @apply text-gray-500 hover:bg-orange-100;
180
171
  }
181
172
  .glorious-button-orange:disabled {
182
- @apply cursor-not-allowed opacity-50;
173
+ @apply cursor-not-allowed;
183
174
  }
184
175
  .glorious-button-orange:disabled:not(:disabled) {
185
176
  @apply bg-orange-300;
@@ -109,7 +109,7 @@ watch(
109
109
  v-show="props.closeBtn !== ''"
110
110
  @click="emits('update:modelValue', false)"
111
111
  >
112
- {{ props.closeBtn }}Z
112
+ {{ props.closeBtn }}
113
113
  </GButton>
114
114
  </div>
115
115
  <!-- end footer -->
@@ -41,11 +41,6 @@ const props = defineProps({
41
41
  default: "off",
42
42
  type: String,
43
43
  },
44
- rows: {
45
- require: false,
46
- default: 3,
47
- type: Number,
48
- },
49
44
  });
50
45
 
51
46
  const inputValue: any = ref(null);
@@ -71,7 +66,6 @@ watch(
71
66
  :class="[props.size, `glorious-textarea-${props.color}`]"
72
67
  :placeholder="props.placeholder"
73
68
  :disabled="props.disabled"
74
- :rows="props.rows"
75
69
  />
76
70
  </div>
77
71
  <GErrorText :error="props.error" />
@@ -21,6 +21,8 @@ export default function(url, options = defaultOptions) {
21
21
  options.params = computeParams(options.params);
22
22
  options.headers = { ...options.headers, ...computeAuth() };
23
23
  if (options.bodyType === "formData") options.body = computeFormData(options);
24
+ if (options.bodyType === "normal" && Object.entries(options.body).length === 0)
25
+ delete options.body;
24
26
  const opt = {
25
27
  ...options,
26
28
  onRequest() {
@@ -8,8 +8,7 @@ export const GloriousStore = defineStore("GloriousStore", {
8
8
  },
9
9
  loading: {},
10
10
  keepData: {},
11
- forms: {},
12
- modals: {}
11
+ forms: {}
13
12
  }),
14
13
  getters: {
15
14
  authIsLogin() {
@@ -40,8 +39,7 @@ export const GloriousStore = defineStore("GloriousStore", {
40
39
  show: false,
41
40
  keepData: {}
42
41
  };
43
- if (typeof key === "string")
44
- this.modals[key] = defaultValue;
42
+ if (typeof key === "string") this.modals[key] = defaultValue;
45
43
  else
46
44
  key.map((item) => {
47
45
  this.modals[item] = defaultValue;
@@ -0,0 +1 @@
1
+ export default function modal(key?: string, keepData?: {}): void;
@@ -0,0 +1,26 @@
1
+ import { GloriousStore } from "#imports";
2
+ export default function modal(key = "modal", keepData = {}) {
3
+ const addBlurBackground = (key2) => {
4
+ const backgroundBlur = document.createElement("div");
5
+ backgroundBlur.classList.add("bg-blur-modal");
6
+ const nuxt = document.getElementById("__nuxt");
7
+ nuxt.appendChild(backgroundBlur);
8
+ backgroundBlur.addEventListener("click", () => {
9
+ const componentId = document.getElementById(key2);
10
+ componentId.classList.replace("open", "close");
11
+ backgroundBlur.remove();
12
+ });
13
+ };
14
+ const modal2 = document.getElementById(key);
15
+ const gloriousStore = GloriousStore();
16
+ gloriousStore.keepData = keepData;
17
+ if (modal2?.classList.contains("close")) {
18
+ modal2?.classList.replace("close", "open");
19
+ modal2.style.bottom = `-${modal2.offsetHeight}px`;
20
+ addBlurBackground(key);
21
+ } else {
22
+ modal2?.classList.add("close");
23
+ const bgBlur = document.querySelector(".bg-blur-modal");
24
+ bgBlur?.remove();
25
+ }
26
+ }
package/package.json CHANGED
@@ -1,53 +1,53 @@
1
- {
2
- "version": "1.1.9-2",
3
- "name": "nuxt-glorious",
4
- "description": "This package provides many things needed by a project, including server requests and authentication, SEO and other requirements of a project.",
5
- "repository": "sajadhzj/nuxt-glorious",
6
- "author": "sajad hossein zadeh (https://github.com/sajadhzj)",
7
- "license": "MIT",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/types.d.ts",
11
- "import": "./dist/module.mjs",
12
- "require": "./dist/module.cjs"
13
- }
14
- },
15
- "main": "./dist/module.cjs",
16
- "types": "./dist/types.d.ts",
17
- "files": [
18
- "dist"
19
- ],
20
- "scripts": {
21
- "prepack": "nuxt-module-build build",
22
- "dev": "nuxi dev playground",
23
- "dev:build": "nuxi build playground",
24
- "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
25
- "release": "npm run prepack && npm publish",
26
- "lint": "eslint .",
27
- "test": "vitest run",
28
- "test:watch": "vitest watch"
29
- },
30
- "dependencies": {
31
- "@nuxt/kit": "^3.11.1",
32
- "@nuxtjs/tailwindcss": "^6.12.0",
33
- "@pinia/nuxt": "^0.5.1",
34
- "defu": "^6.1.4",
35
- "pinia": "^2.1.7",
36
- "sass": "^1.77.5"
37
- },
38
- "devDependencies": {
39
- "@nuxt/devtools": "latest",
40
- "@nuxt/eslint-config": "^0.2.0",
41
- "@nuxt/module-builder": "^0.5.5",
42
- "@nuxt/schema": "^3.11.1",
43
- "@nuxt/test-utils": "^3.12.0",
44
- "@types/node": "^20.11.29",
45
- "changelogen": "^0.5.5",
46
- "eslint": "^8.57.0",
47
- "nuxt": "^3.13.2",
48
- "vitest": "^1.4.0"
49
- },
50
- "overrides": {
51
- "vue": "latest"
52
- }
53
- }
1
+ {
2
+ "version": "1.1.9-3",
3
+ "name": "nuxt-glorious",
4
+ "description": "This package provides many things needed by a project, including server requests and authentication, SEO and other requirements of a project.",
5
+ "repository": "sajadhzj/nuxt-glorious",
6
+ "author": "sajad hossein zadeh (https://github.com/sajadhzj)",
7
+ "license": "MIT",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/types.d.ts",
11
+ "import": "./dist/module.mjs",
12
+ "require": "./dist/module.cjs"
13
+ }
14
+ },
15
+ "main": "./dist/module.cjs",
16
+ "types": "./dist/types.d.ts",
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "scripts": {
21
+ "prepack": "nuxt-module-build build",
22
+ "dev": "nuxi dev playground",
23
+ "dev:build": "nuxi build playground",
24
+ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
25
+ "release": "npm run prepack && npm publish",
26
+ "lint": "eslint .",
27
+ "test": "vitest run",
28
+ "test:watch": "vitest watch"
29
+ },
30
+ "dependencies": {
31
+ "@nuxt/kit": "^3.11.1",
32
+ "@nuxtjs/tailwindcss": "^6.12.0",
33
+ "@pinia/nuxt": "^0.5.1",
34
+ "defu": "^6.1.4",
35
+ "pinia": "^2.1.7",
36
+ "sass": "^1.77.5"
37
+ },
38
+ "devDependencies": {
39
+ "@nuxt/devtools": "latest",
40
+ "@nuxt/eslint-config": "^0.2.0",
41
+ "@nuxt/module-builder": "^0.5.5",
42
+ "@nuxt/schema": "^3.11.1",
43
+ "@nuxt/test-utils": "^3.12.0",
44
+ "@types/node": "^20.11.29",
45
+ "changelogen": "^0.5.5",
46
+ "eslint": "^8.57.0",
47
+ "nuxt": "^3.11.1",
48
+ "vitest": "^1.4.0"
49
+ },
50
+ "overrides": {
51
+ "vue": "latest"
52
+ }
53
+ }