@veritree/ui 0.48.2 → 0.49.1
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/mixins/form-control.js
CHANGED
|
@@ -48,6 +48,10 @@ export const formControlMixin = {
|
|
|
48
48
|
isError() {
|
|
49
49
|
return this.variant === 'error';
|
|
50
50
|
},
|
|
51
|
+
|
|
52
|
+
isSuccess() {
|
|
53
|
+
return this.variant === 'success';
|
|
54
|
+
},
|
|
51
55
|
},
|
|
52
56
|
};
|
|
53
57
|
|
|
@@ -63,6 +67,8 @@ export const formControlStyleMixin = {
|
|
|
63
67
|
? `${this.name}--${this.variant}`
|
|
64
68
|
: this.isError
|
|
65
69
|
? 'border-error-300'
|
|
70
|
+
: this.isSuccess
|
|
71
|
+
? 'border-success-300'
|
|
66
72
|
: 'border-gray-300',
|
|
67
73
|
// height styles
|
|
68
74
|
this.headless
|
package/package.json
CHANGED
|
@@ -6,19 +6,7 @@
|
|
|
6
6
|
headless ? `form-feedback--${variant}` : null,
|
|
7
7
|
]"
|
|
8
8
|
>
|
|
9
|
-
<component
|
|
10
|
-
v-if="showIcon"
|
|
11
|
-
:is="icon"
|
|
12
|
-
:class="[
|
|
13
|
-
headless ? 'form-feedback__icon' : 'relative top-1 h-4 w-4 shrink-0',
|
|
14
|
-
// variant styles
|
|
15
|
-
headless
|
|
16
|
-
? `form-feedback__icon--${variant}`
|
|
17
|
-
: isError
|
|
18
|
-
? 'text-error-500'
|
|
19
|
-
: null,
|
|
20
|
-
]"
|
|
21
|
-
/>
|
|
9
|
+
<component v-if="showIcon" :is="icon" :class="iconClassComputed" />
|
|
22
10
|
<span
|
|
23
11
|
:class="[headless ? 'form-feedback--text' : 'text-caption text-gray-500']"
|
|
24
12
|
>
|
|
@@ -54,18 +42,38 @@ export default {
|
|
|
54
42
|
},
|
|
55
43
|
|
|
56
44
|
computed: {
|
|
57
|
-
isError() {
|
|
58
|
-
return this.variant === 'error';
|
|
59
|
-
},
|
|
60
|
-
|
|
61
45
|
icon() {
|
|
62
46
|
if (this.variant === 'success') return IconCheck;
|
|
63
47
|
return IconWarning;
|
|
64
48
|
},
|
|
65
49
|
|
|
50
|
+
iconClassComputed() {
|
|
51
|
+
return [
|
|
52
|
+
this.headless
|
|
53
|
+
? 'form-feedback__icon'
|
|
54
|
+
: 'relative top-1 h-4 w-4 shrink-0',
|
|
55
|
+
// variant styles
|
|
56
|
+
this.headless
|
|
57
|
+
? `form-feedback__icon--${this.variant}`
|
|
58
|
+
: this.isError
|
|
59
|
+
? 'text-error-500'
|
|
60
|
+
: this.isSuccess
|
|
61
|
+
? 'text-success-500'
|
|
62
|
+
: null,
|
|
63
|
+
];
|
|
64
|
+
},
|
|
65
|
+
|
|
66
66
|
showIcon() {
|
|
67
67
|
return !this.hideIcon;
|
|
68
68
|
},
|
|
69
|
+
|
|
70
|
+
isError() {
|
|
71
|
+
return this.variant === 'error';
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
isSuccess() {
|
|
75
|
+
return this.variant === 'success';
|
|
76
|
+
},
|
|
69
77
|
},
|
|
70
78
|
|
|
71
79
|
methods: {
|