@veritree/ui 0.52.2 → 0.54.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/package.json
CHANGED
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
: isPrimary
|
|
20
20
|
? 'bg-secondary-400 hover:bg-secondary-500 focus:bg-secondary-600 active:bg-secondary-600 border-transparent text-white disabled:bg-gray-200 disabled:text-gray-400'
|
|
21
21
|
: isSecondary
|
|
22
|
-
?
|
|
22
|
+
? isGhost
|
|
23
|
+
? 'border-gray-500 text-gray-100 hover:bg-white hover:text-gray-700'
|
|
24
|
+
: 'border-gray-400 bg-white text-gray-700 hover:bg-gray-100 focus:bg-gray-200 active:bg-gray-200 disabled:border-gray-300 disabled:text-gray-400'
|
|
23
25
|
: isTertiary
|
|
24
26
|
? 'border-transparent text-gray-600 hover:text-gray-800 focus:text-gray-800 active:text-gray-800 disabled:text-gray-400'
|
|
25
27
|
: isIcon
|
|
@@ -152,6 +154,11 @@ export default {
|
|
|
152
154
|
type: Boolean,
|
|
153
155
|
default: false,
|
|
154
156
|
},
|
|
157
|
+
|
|
158
|
+
appearance: {
|
|
159
|
+
type: String,
|
|
160
|
+
default: 'normal', // normal or ghost
|
|
161
|
+
},
|
|
155
162
|
},
|
|
156
163
|
|
|
157
164
|
computed: {
|
|
@@ -183,6 +190,10 @@ export default {
|
|
|
183
190
|
return this.disabled || this.busy;
|
|
184
191
|
},
|
|
185
192
|
|
|
193
|
+
isGhost() {
|
|
194
|
+
return this.appearance === 'ghost';
|
|
195
|
+
},
|
|
196
|
+
|
|
186
197
|
tag() {
|
|
187
198
|
return this.href ? 'a' : this.to ? 'NuxtLink' : 'button';
|
|
188
199
|
},
|
|
@@ -42,14 +42,11 @@ export default {
|
|
|
42
42
|
this.overlay = overlay;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
const hide = () => this.hide();
|
|
46
|
-
|
|
47
|
-
const emit = () => this.emit();
|
|
48
|
-
|
|
49
45
|
return {
|
|
50
46
|
componentId,
|
|
51
|
-
hide,
|
|
52
|
-
|
|
47
|
+
hide: this.hide,
|
|
48
|
+
emitHidden: this.emitHidden,
|
|
49
|
+
emitShown: this.emitShown,
|
|
53
50
|
registerContent,
|
|
54
51
|
registerOverlay,
|
|
55
52
|
full: this.full,
|
|
@@ -125,13 +122,19 @@ export default {
|
|
|
125
122
|
if (this.hasContent) this.content.hide();
|
|
126
123
|
},
|
|
127
124
|
|
|
128
|
-
|
|
125
|
+
emitHidden() {
|
|
129
126
|
this.$nextTick(() => {
|
|
130
127
|
this.$emit('input', false);
|
|
131
128
|
this.$emit('hidden');
|
|
132
129
|
});
|
|
133
130
|
},
|
|
134
131
|
|
|
132
|
+
emitShown() {
|
|
133
|
+
this.$nextTick(() => {
|
|
134
|
+
this.$emit('shown');
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
|
|
135
138
|
/**
|
|
136
139
|
* Hides the dialog when clicking outside its content.
|
|
137
140
|
*
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
leave-active-class="duration-300 ease-out"
|
|
7
7
|
leave-class="translate-y-0 opacity-100"
|
|
8
8
|
leave-to-class="translate-y-[50px] opacity-0"
|
|
9
|
+
@after-enter="showDialog"
|
|
9
10
|
@after-leave="hideDialog"
|
|
10
11
|
>
|
|
11
12
|
<div
|
|
@@ -83,7 +84,11 @@ export default {
|
|
|
83
84
|
},
|
|
84
85
|
|
|
85
86
|
hideDialog() {
|
|
86
|
-
this.apiDialog().
|
|
87
|
+
this.apiDialog().emitHidden();
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
showDialog() {
|
|
91
|
+
this.apiDialog().emitShown();
|
|
87
92
|
},
|
|
88
93
|
},
|
|
89
94
|
};
|