@vmz/ui 0.1.12 → 0.1.14
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/Select.vmz +14 -3
package/package.json
CHANGED
|
@@ -394,6 +394,10 @@ export default class Select {
|
|
|
394
394
|
} });
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
+
/** Parent-owned prop writes (bindComponentProp) — keep derived label/options in sync. */
|
|
398
|
+
__vmzOnParentProp(name: string) {
|
|
399
|
+
if (name === "value" || name === "values" || name === "options") this._rebuildVisible();
|
|
400
|
+
}
|
|
397
401
|
choose(next: string) {
|
|
398
402
|
if (!next && next !== "") return;
|
|
399
403
|
if (this.isMultiple) {
|
|
@@ -401,13 +405,20 @@ export default class Select {
|
|
|
401
405
|
const idx = cur.indexOf(String(next));
|
|
402
406
|
if (idx >= 0) cur.splice(idx, 1);
|
|
403
407
|
else cur.push(String(next));
|
|
404
|
-
this.
|
|
408
|
+
this.values = cur;
|
|
405
409
|
this._rebuildVisible();
|
|
410
|
+
this._emit(cur.join(","), cur);
|
|
406
411
|
return;
|
|
407
412
|
}
|
|
413
|
+
const nextStr = String(next);
|
|
414
|
+
if (nextStr === String(this.value)) {
|
|
415
|
+
this.close();
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
this.value = nextStr;
|
|
419
|
+
this._rebuildVisible();
|
|
420
|
+
this._emit(nextStr, nextStr ? [nextStr] : []);
|
|
408
421
|
this.close();
|
|
409
|
-
if (next === this.value) return;
|
|
410
|
-
this._emit(String(next), next ? [String(next)] : []);
|
|
411
422
|
}
|
|
412
423
|
onSearchInput(ev: Event) {
|
|
413
424
|
const t = ev?.target as HTMLInputElement | null;
|