goodteditor-ui 1.0.75 → 1.0.77
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 +1 -1
- package/src/components/ui/Select.vue +58 -3
package/package.json
CHANGED
|
@@ -108,7 +108,32 @@
|
|
|
108
108
|
</template>
|
|
109
109
|
<template #option="{ option, index, cursorIndex }">
|
|
110
110
|
<!--
|
|
111
|
-
@slot
|
|
111
|
+
@slot before option slot
|
|
112
|
+
@binding {Object} option option
|
|
113
|
+
@binding {any} value option's value
|
|
114
|
+
@binding {String} label option's label
|
|
115
|
+
@binding {Number} index option's index
|
|
116
|
+
@binding {Boolean} isSelected option selection status
|
|
117
|
+
@binding {Number} cursorIndex current cursor index
|
|
118
|
+
@binding {Function} selectOption function that selects option
|
|
119
|
+
@binding {Function} deselectOption function that deselects option
|
|
120
|
+
@binding {Function} toggleOption function that toggles option selection
|
|
121
|
+
-->
|
|
122
|
+
<slot
|
|
123
|
+
name="option:before"
|
|
124
|
+
v-bind="{
|
|
125
|
+
option,
|
|
126
|
+
value: getOptionValue(option),
|
|
127
|
+
label: getOptionLabel(option),
|
|
128
|
+
index,
|
|
129
|
+
cursorIndex,
|
|
130
|
+
isSelected: isOptionSelected(option),
|
|
131
|
+
selectOption,
|
|
132
|
+
deselectOption,
|
|
133
|
+
toggleOption
|
|
134
|
+
}"></slot>
|
|
135
|
+
<!--
|
|
136
|
+
@slot option slot mode
|
|
112
137
|
@binding {Object} option option
|
|
113
138
|
@binding {any} value option's value
|
|
114
139
|
@binding {String} label option's label
|
|
@@ -168,7 +193,7 @@
|
|
|
168
193
|
</div>
|
|
169
194
|
<div class="text-truncate" style="min-height: calc(var(--line-height) * 1rem)" v-else>
|
|
170
195
|
<!--
|
|
171
|
-
@slot
|
|
196
|
+
@slot option content slot
|
|
172
197
|
-->
|
|
173
198
|
<slot
|
|
174
199
|
name="option-label"
|
|
@@ -185,6 +210,31 @@
|
|
|
185
210
|
</div>
|
|
186
211
|
</li>
|
|
187
212
|
</slot>
|
|
213
|
+
<!--
|
|
214
|
+
@slot after option slot
|
|
215
|
+
@binding {Object} option option
|
|
216
|
+
@binding {any} value option's value
|
|
217
|
+
@binding {String} label option's label
|
|
218
|
+
@binding {Number} index option's index
|
|
219
|
+
@binding {Boolean} isSelected option selection status
|
|
220
|
+
@binding {Number} cursorIndex current cursor index
|
|
221
|
+
@binding {Function} selectOption function that selects option
|
|
222
|
+
@binding {Function} deselectOption function that deselects option
|
|
223
|
+
@binding {Function} toggleOption function that toggles option selection
|
|
224
|
+
-->
|
|
225
|
+
<slot
|
|
226
|
+
name="option:after"
|
|
227
|
+
v-bind="{
|
|
228
|
+
option,
|
|
229
|
+
value: getOptionValue(option),
|
|
230
|
+
label: getOptionLabel(option),
|
|
231
|
+
index,
|
|
232
|
+
isSelected: isOptionSelected(option),
|
|
233
|
+
cursorIndex,
|
|
234
|
+
selectOption,
|
|
235
|
+
deselectOption,
|
|
236
|
+
toggleOption
|
|
237
|
+
}"></slot>
|
|
188
238
|
</template>
|
|
189
239
|
<template #footer>
|
|
190
240
|
<!--
|
|
@@ -348,10 +398,15 @@ export default {
|
|
|
348
398
|
importModel(model) {
|
|
349
399
|
const { options, isValueOfOption } = this;
|
|
350
400
|
const models = [model].flat();
|
|
351
|
-
const optionsSelected = options.filter((option) =>
|
|
401
|
+
const optionsSelected = options.filter((option) =>
|
|
402
|
+
models.some((modelItem) => isValueOfOption(option, modelItem))
|
|
403
|
+
);
|
|
352
404
|
if (optionsSelected.length > 0) {
|
|
353
405
|
this.dataListCursorIndex = this.getOptionIndex(optionsSelected[0]);
|
|
354
406
|
this.optionsSelected = this.multiple ? optionsSelected : [optionsSelected[0]];
|
|
407
|
+
} else {
|
|
408
|
+
this.dataListCursorIndex = -1;
|
|
409
|
+
this.optionsSelected = [];
|
|
355
410
|
}
|
|
356
411
|
},
|
|
357
412
|
exportModel() {
|