wave-ui 3.0.5 → 3.1.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/dist/wave-ui.cjs.js +1 -1
- package/dist/wave-ui.css +1 -1
- package/dist/wave-ui.es.js +12 -13
- package/dist/wave-ui.umd.js +1 -1
- package/package.json +1 -1
- package/src/wave-ui/components/w-input.vue +4 -1
- package/src/wave-ui/components/w-select.vue +27 -16
- package/src/wave-ui/components/w-textarea.vue +1 -0
package/dist/wave-ui.es.js
CHANGED
|
@@ -4504,7 +4504,7 @@ const Ci = {
|
|
|
4504
4504
|
}, Bi = /* @__PURE__ */ v(Ci, [["render", _i]]), Si = ["for"], $i = ["aria-expanded", "aria-owns", "aria-activedescendant"], Vi = {
|
|
4505
4505
|
key: 1,
|
|
4506
4506
|
class: "w-select__selection-slot"
|
|
4507
|
-
}, Ii = ["
|
|
4507
|
+
}, Ii = ["contenteditable", "id", "disabled", "tabindex", "innerHTML"], Ri = ["value", "name"], Li = ["for"], xi = ["for"];
|
|
4508
4508
|
function Ti(e, t, l, a, n, i) {
|
|
4509
4509
|
const o = $("w-icon"), r = $("w-list"), d = $("w-menu");
|
|
4510
4510
|
return s(), g(I(e.formRegister ? "w-form-element" : "div"), _({ ref: "formEl" }, e.formRegister && { validators: e.validators, inputValue: i.selectionString, disabled: e.isDisabled, readonly: e.isReadonly }, {
|
|
@@ -4562,23 +4562,20 @@ function Ti(e, t, l, a, n, i) {
|
|
|
4562
4562
|
item: l.multiple ? e.inputValue : e.inputValue[0]
|
|
4563
4563
|
})
|
|
4564
4564
|
])) : c("", !0),
|
|
4565
|
-
w("
|
|
4566
|
-
class: "w-select__selection",
|
|
4565
|
+
w("div", {
|
|
4566
|
+
class: f(["w-select__selection", { "w-select__selection--placeholder": !e.$slots.selection && !i.selectionString && l.placeholder }]),
|
|
4567
4567
|
ref: "selection-input",
|
|
4568
|
-
|
|
4569
|
-
value: e.$slots.selection ? "" : i.selectionString,
|
|
4568
|
+
contenteditable: e.isDisabled || e.isReadonly ? "false" : "true",
|
|
4570
4569
|
onFocus: t[1] || (t[1] = (y) => !e.isDisabled && !e.isReadonly && i.onFocus(y)),
|
|
4571
4570
|
onBlur: t[2] || (t[2] = (...y) => i.onBlur && i.onBlur(...y)),
|
|
4572
4571
|
onKeydown: t[3] || (t[3] = (y) => !e.isDisabled && !e.isReadonly && i.onKeydown(y)),
|
|
4573
4572
|
id: `w-select--${e._.uid}`,
|
|
4574
|
-
placeholder: !e.$slots.selection && l.placeholder || null,
|
|
4575
4573
|
disabled: e.isDisabled || null,
|
|
4576
4574
|
readonly: "",
|
|
4577
4575
|
"aria-readonly": "true",
|
|
4578
|
-
required: e.required || null,
|
|
4579
4576
|
tabindex: e.tabindex || null,
|
|
4580
|
-
|
|
4581
|
-
}, null,
|
|
4577
|
+
innerHTML: e.$slots.selection ? "" : i.selectionString || l.placeholder
|
|
4578
|
+
}, null, 42, Ii),
|
|
4582
4579
|
(s(!0), u(C, null, x(e.inputValue.length ? e.inputValue : [{}], (y, S) => (s(), u("input", {
|
|
4583
4580
|
key: S,
|
|
4584
4581
|
type: "hidden",
|
|
@@ -4698,7 +4695,8 @@ const Oi = {
|
|
|
4698
4695
|
noUnselect: { type: Boolean },
|
|
4699
4696
|
menuProps: { type: Object },
|
|
4700
4697
|
dark: { type: Boolean },
|
|
4701
|
-
light: { type: Boolean }
|
|
4698
|
+
light: { type: Boolean },
|
|
4699
|
+
fitToContent: { type: Boolean }
|
|
4702
4700
|
},
|
|
4703
4701
|
emits: ["input", "update:modelValue", "focus", "blur", "item-click", "item-select", "click:inner-icon-left", "click:inner-icon-right"],
|
|
4704
4702
|
data: () => ({
|
|
@@ -4735,6 +4733,7 @@ const Oi = {
|
|
|
4735
4733
|
"w-select--dark": this.dark,
|
|
4736
4734
|
"w-select--light": this.light,
|
|
4737
4735
|
"w-select--disabled": this.isDisabled,
|
|
4736
|
+
"w-select--fit-to-content": this.fitToContent,
|
|
4738
4737
|
"w-select--readonly": this.isReadonly,
|
|
4739
4738
|
[`w-select--${this.hasValue ? "filled" : "empty"}`]: !0,
|
|
4740
4739
|
"w-select--focused": (this.isFocused || this.showMenu) && !this.isReadonly,
|
|
@@ -4761,13 +4760,13 @@ const Oi = {
|
|
|
4761
4760
|
},
|
|
4762
4761
|
methods: {
|
|
4763
4762
|
onFocus(e) {
|
|
4764
|
-
this.isFocused = !0, this.$emit("focus", e);
|
|
4763
|
+
return this.isFocused = !0, this.$emit("focus", e), !1;
|
|
4765
4764
|
},
|
|
4766
4765
|
onBlur(e) {
|
|
4767
4766
|
this.isFocused = !1, this.$emit("blur", e);
|
|
4768
4767
|
},
|
|
4769
4768
|
onKeydown(e) {
|
|
4770
|
-
if ([13, 27, 38, 40].includes(e.keyCode) && e.preventDefault(), e.keyCode === 27)
|
|
4769
|
+
if (e.preventDefault(), [13, 27, 38, 40].includes(e.keyCode) && e.preventDefault(), e.keyCode === 27)
|
|
4771
4770
|
this.closeMenu();
|
|
4772
4771
|
else if (e.keyCode === 13)
|
|
4773
4772
|
this.openMenu();
|
|
@@ -4800,7 +4799,7 @@ const Oi = {
|
|
|
4800
4799
|
this.$emit("update:modelValue", e), this.$emit("input", e);
|
|
4801
4800
|
},
|
|
4802
4801
|
checkSelection(e) {
|
|
4803
|
-
|
|
4802
|
+
e = Array.isArray(e) ? e : e !== void 0 ? [e] : [];
|
|
4804
4803
|
const t = this.selectItems.map((l) => l.value);
|
|
4805
4804
|
return e.map((l) => {
|
|
4806
4805
|
let a = l;
|