@redseed/redseed-ui-vue3 2.25.1 → 2.25.3
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
|
@@ -9,6 +9,10 @@ defineOptions({
|
|
|
9
9
|
})
|
|
10
10
|
|
|
11
11
|
const props = defineProps({
|
|
12
|
+
hasMedia: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: false,
|
|
15
|
+
},
|
|
12
16
|
removable: {
|
|
13
17
|
type: Boolean,
|
|
14
18
|
default: false,
|
|
@@ -83,6 +87,11 @@ const uploaderStateIconClass = computed(() => [
|
|
|
83
87
|
}
|
|
84
88
|
])
|
|
85
89
|
|
|
90
|
+
const showRemoveAction = computed(() => {
|
|
91
|
+
return (props.hasMedia || stateSuccess.value)
|
|
92
|
+
&& props.removable
|
|
93
|
+
})
|
|
94
|
+
|
|
86
95
|
function removeAction() {
|
|
87
96
|
setDefault()
|
|
88
97
|
emit('remove')
|
|
@@ -110,7 +119,7 @@ function removeAction() {
|
|
|
110
119
|
<div :class="uploaderContainerClass">
|
|
111
120
|
<div :class="uploaderContentClass">
|
|
112
121
|
<div :class="uploaderStateIconClass">
|
|
113
|
-
<slot name="state-icon-default" v-if="stateDefault">
|
|
122
|
+
<slot name="state-icon-default" v-if="stateDefault && !hasMedia">
|
|
114
123
|
<PlusIcon />
|
|
115
124
|
</slot>
|
|
116
125
|
<slot name="state-icon-uploading" v-if="stateUploading">
|
|
@@ -122,7 +131,7 @@ function removeAction() {
|
|
|
122
131
|
<slot name="state-icon-error" v-if="stateError">
|
|
123
132
|
<ExclamationCircleIcon />
|
|
124
133
|
</slot>
|
|
125
|
-
<slot name="state-icon-success" v-if="stateSuccess">
|
|
134
|
+
<slot name="state-icon-success" v-if="stateSuccess || hasMedia">
|
|
126
135
|
<DocumentIcon />
|
|
127
136
|
</slot>
|
|
128
137
|
</div>
|
|
@@ -164,7 +173,7 @@ function removeAction() {
|
|
|
164
173
|
</div>
|
|
165
174
|
|
|
166
175
|
</div>
|
|
167
|
-
<div v-if="
|
|
176
|
+
<div v-if="showRemoveAction"
|
|
168
177
|
class="rsui-form-field-uploader__action"
|
|
169
178
|
>
|
|
170
179
|
<div class="rsui-form-field-uploader__action-icon"
|
|
@@ -185,18 +194,15 @@ function removeAction() {
|
|
|
185
194
|
@apply relative select-none;
|
|
186
195
|
@apply rounded-md border border-rsui-grey-300 border-dashed;
|
|
187
196
|
@apply flex flex-nowrap justify-center items-center gap-4;
|
|
197
|
+
@apply px-4 py-2.5;
|
|
188
198
|
&--success {
|
|
189
|
-
@apply border-rsui-light border-solid
|
|
199
|
+
@apply border-rsui-light border-solid;
|
|
190
200
|
}
|
|
191
201
|
}
|
|
192
202
|
|
|
193
203
|
&__content {
|
|
194
204
|
@apply relative flex flex-nowrap justify-center items-center gap-4;
|
|
195
|
-
@apply
|
|
196
|
-
|
|
197
|
-
&--success {
|
|
198
|
-
@apply pr-0;
|
|
199
|
-
}
|
|
205
|
+
@apply text-rsui-default;
|
|
200
206
|
}
|
|
201
207
|
|
|
202
208
|
&__state-icon {
|
|
@@ -85,15 +85,11 @@ const statusClass = computed(() => [
|
|
|
85
85
|
&__status {
|
|
86
86
|
@apply absolute top-1.5 left-3 size-3 border border-current bg-current rounded-full;
|
|
87
87
|
@apply flex items-center justify-center transition;
|
|
88
|
-
|
|
89
|
-
&--active {
|
|
90
|
-
@apply bg-white;
|
|
91
|
-
}
|
|
92
88
|
}
|
|
93
89
|
|
|
94
90
|
&__active-icon {
|
|
95
91
|
:deep(svg), svg {
|
|
96
|
-
@apply size-2 text-
|
|
92
|
+
@apply size-2 text-white;
|
|
97
93
|
}
|
|
98
94
|
}
|
|
99
95
|
|