nuxt-glorious 1.2.9-9-9-0 → 1.3.0

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.2.9-9-9-0"
4
+ "version": "1.3.0"
5
5
  }
@@ -18,7 +18,10 @@ const deleteFile = (event: any) => {
18
18
  </script>
19
19
  <template>
20
20
  <div class="flex flex-col">
21
- <span class="text-sm font-medium text-gray-500">
21
+ <span
22
+ v-if="props.title !== ''"
23
+ class="glorious-title text-sm font-medium text-gray-500"
24
+ >
22
25
  {{ props.title }}
23
26
  <span
24
27
  v-if="props.required"
@@ -66,7 +66,7 @@ const firstVal = selectValue.value
66
66
  <option
67
67
  v-for="(item, index) in props.options"
68
68
  :key="index"
69
- :value="item.value"
69
+ :value="item[props.keyOfValue]"
70
70
  >
71
71
  {{ item[props.displayTextKey] }}
72
72
  </option>
@@ -1,6 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { ref, watch } from '#imports'
3
3
  import _props from '../props/Textarea'
4
+ import { hasValidationError } from '../helper'
4
5
  const props = defineProps(_props)
5
6
  const modelValue = defineModel()
6
7
 
@@ -30,13 +31,16 @@ watch(
30
31
  <div class="glorious-textarea">
31
32
  <textarea
32
33
  v-model="inputValue"
33
- :class="[`glorious-textarea-${props.color}`]"
34
+ :class="[
35
+ `glorious-textarea-${props.color}`,
36
+ hasValidationError(props.error) ? 'validation-error' : '',
37
+ ]"
34
38
  :placeholder="props.placeholder"
35
39
  :disabled="props.disabled"
36
40
  :rows="props.rows"
37
41
  />
42
+ <GErrorText :error="props.error" />
38
43
  </div>
39
- <GErrorText :error="props.error" />
40
44
  </div>
41
45
  </template>
42
46
 
@@ -32,6 +32,11 @@ declare const _default: {
32
32
  default: string;
33
33
  type: StringConstructor;
34
34
  };
35
+ keyOfValue: {
36
+ required: boolean;
37
+ default: string;
38
+ type: StringConstructor;
39
+ };
35
40
  displayTextKey: {
36
41
  required: boolean;
37
42
  default: string;
@@ -7,7 +7,8 @@ import {
7
7
  disabled,
8
8
  placeholder,
9
9
  required,
10
- displayTextKey
10
+ displayTextKey,
11
+ keyOfValue
11
12
  } from "./common/index.mjs";
12
13
  export default {
13
14
  ...size(),
@@ -16,6 +17,7 @@ export default {
16
17
  ...color(),
17
18
  ...required(),
18
19
  ...displayTextKey(),
20
+ ...keyOfValue(),
19
21
  ...error,
20
22
  ...disabled,
21
23
  ...options
@@ -173,3 +173,10 @@ export declare const displayTextKey: () => {
173
173
  type: StringConstructor;
174
174
  };
175
175
  };
176
+ export declare const keyOfValue: () => {
177
+ keyOfValue: {
178
+ required: boolean;
179
+ default: string;
180
+ type: StringConstructor;
181
+ };
182
+ };
@@ -159,3 +159,10 @@ export const displayTextKey = () => ({
159
159
  type: String
160
160
  }
161
161
  });
162
+ export const keyOfValue = () => ({
163
+ keyOfValue: {
164
+ required: false,
165
+ default: "value",
166
+ type: String
167
+ }
168
+ });
@@ -39,7 +39,7 @@
39
39
  }
40
40
 
41
41
  .glorious-select {
42
- @apply rounded-md ring-1 px-3 text-gray-500 text-sm;
42
+ @apply rounded-md ring-1 px-3 text-gray-500 text-sm h-max;
43
43
  }
44
44
  .glorious-select:disabled {
45
45
  @apply cursor-not-allowed;
@@ -31,7 +31,7 @@
31
31
  }
32
32
 
33
33
  .glorious-select {
34
- @apply rounded-md ring-1 px-3 text-gray-500 text-sm;
34
+ @apply rounded-md ring-1 px-3 text-gray-500 text-sm h-max;
35
35
  @extend %select-size, %focus;
36
36
 
37
37
  &:disabled {
@@ -54,10 +54,13 @@
54
54
  }
55
55
 
56
56
  .glorious-textarea {
57
- @apply relative w-full;
57
+ @apply relative w-full flex flex-col;
58
58
  }
59
59
  .glorious-textarea > textarea {
60
- @apply w-full;
60
+ @apply w-full p-2;
61
+ }
62
+ .glorious-textarea > textarea.validation-error {
63
+ @apply ring-red-500 bg-red-50;
61
64
  }
62
65
  .glorious-textarea > textarea::placeholder {
63
66
  @apply text-[14px];
@@ -33,9 +33,13 @@
33
33
  }
34
34
 
35
35
  .glorious-textarea {
36
- @apply relative w-full;
36
+ @apply relative w-full flex flex-col;
37
37
  > textarea {
38
- @apply w-full;
38
+ @apply w-full p-2;
39
+
40
+ &.validation-error{
41
+ @apply ring-red-500 bg-red-50
42
+ }
39
43
  }
40
44
  > textarea::placeholder {
41
45
  @apply text-[14px];
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.2.9-9-9-0",
2
+ "version": "1.3.0",
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",