wave-ui 3.4.3 → 3.4.4

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.
@@ -4637,9 +4637,9 @@ const _i = {
4637
4637
  }, Ii = ["contenteditable", "id", "disabled", "tabindex", "innerHTML"], Ri = ["value", "name"], Ti = ["for"], Li = ["for"];
4638
4638
  function xi(e, t, l, a, r, i) {
4639
4639
  const o = $("w-icon"), n = $("w-list"), d = $("w-menu");
4640
- return s(), m(V(e.formRegister ? "w-form-element" : "div"), C({ ref: "formEl" }, e.formRegister && { validators: e.validators, inputValue: i.selectionString, disabled: e.isDisabled, readonly: e.isReadonly }, {
4640
+ return s(), m(V(e.formRegister ? "w-form-element" : "div"), C({ ref: "formEl" }, e.formRegister && { validators: e.validators, inputValue: i.selectionString, disabled: e.isDisabled, readonly: e.isReadonly, isFocused: e.isFocused }, {
4641
4641
  valid: e.valid,
4642
- "onUpdate:valid": t[9] || (t[9] = (h) => e.valid = h),
4642
+ "onUpdate:valid": t[11] || (t[11] = (h) => e.valid = h),
4643
4643
  onReset: i.onReset,
4644
4644
  wrap: i.hasLabel && l.labelPosition !== "inside",
4645
4645
  class: i.classes
@@ -4658,7 +4658,8 @@ function xi(e, t, l, a, r, i) {
4658
4658
  ], 64)) : c("", !0),
4659
4659
  I(d, C({
4660
4660
  modelValue: e.showMenu,
4661
- "onUpdate:modelValue": t[8] || (t[8] = (h) => e.showMenu = h),
4661
+ "onUpdate:modelValue": t[9] || (t[9] = (h) => e.showMenu = h),
4662
+ onClose: t[10] || (t[10] = (h) => !h && i.closeMenu()),
4662
4663
  "menu-class": `w-select__menu ${l.menuClass || ""}`,
4663
4664
  transition: "slide-fade-down",
4664
4665
  "append-to": (l.menuProps || {}).appendTo !== void 0 ? (l.menuProps || {}).appendTo : void 0,
@@ -4669,7 +4670,7 @@ function xi(e, t, l, a, r, i) {
4669
4670
  activator: g(({ on: h }) => [
4670
4671
  w("div", {
4671
4672
  class: f(["w-select__selection-wrap", i.inputWrapClasses]),
4672
- onClick: t[5] || (t[5] = (y) => !e.isDisabled && !e.isReadonly && (e.showMenu ? i.closeMenu : i.openMenu)()),
4673
+ onClick: t[5] || (t[5] = (y) => !e.isDisabled && !e.isReadonly && i.onInputFieldClick()),
4673
4674
  role: "button",
4674
4675
  "aria-haspopup": "listbox",
4675
4676
  "aria-expanded": e.showMenu ? "true" : "false",
@@ -4743,8 +4744,8 @@ function xi(e, t, l, a, r, i) {
4743
4744
  "onUpdate:modelValue": i.onInput,
4744
4745
  onItemClick: t[6] || (t[6] = (h) => e.$emit("item-click", h)),
4745
4746
  onItemSelect: i.onListItemSelect,
4746
- "onKeydown:enter": t[7] || (t[7] = (h) => l.noUnselect && !l.multiple && i.closeMenu()),
4747
- "onKeydown:escape": i.closeMenu,
4747
+ "onKeydown:enter": t[7] || (t[7] = (h) => l.noUnselect && !l.multiple && i.closeMenu("la3")),
4748
+ "onKeydown:escape": t[8] || (t[8] = (h) => e.showMenu && (this.showMenu = !1)),
4748
4749
  items: i.selectItems,
4749
4750
  multiple: l.multiple,
4750
4751
  "arrows-navigation": "",
@@ -4776,7 +4777,7 @@ function xi(e, t, l, a, r, i) {
4776
4777
  ])
4777
4778
  ])
4778
4779
  }))
4779
- ]), 1032, ["model-value", "onUpdate:modelValue", "onItemSelect", "onKeydown:escape", "items", "multiple", "add-ids", "no-unselect", "selection-color", "item-color-key"])
4780
+ ]), 1032, ["model-value", "onUpdate:modelValue", "onItemSelect", "items", "multiple", "add-ids", "no-unselect", "selection-color", "item-color-key"])
4780
4781
  ]),
4781
4782
  _: 3
4782
4783
  }, 16, ["modelValue", "menu-class", "append-to"]),
@@ -4893,14 +4894,15 @@ const Oi = {
4893
4894
  },
4894
4895
  methods: {
4895
4896
  onFocus(e) {
4896
- return this.isFocused = !0, this.$emit("focus", e), !1;
4897
+ if (!this.isFocused)
4898
+ return this.isFocused = !0, this.$emit("focus", e), !1;
4897
4899
  },
4898
4900
  onBlur(e) {
4899
- this.isFocused = !1, this.$emit("blur", e);
4901
+ this.showMenu || (this.isFocused = !1, this.$emit("blur", e));
4900
4902
  },
4901
4903
  onKeydown(e) {
4902
- if (e.preventDefault(), [13, 27, 38, 40].includes(e.keyCode) && e.preventDefault(), e.keyCode === 27)
4903
- this.closeMenu();
4904
+ if (!e.metaKey && !e.ctrlKey && e.keyCode !== 9 && e.preventDefault(), e.keyCode === 27 && this.showMenu)
4905
+ this.closeMenu("la5");
4904
4906
  else if (e.keyCode === 13)
4905
4907
  this.openMenu();
4906
4908
  else if ([38, 40].includes(e.keyCode))
@@ -4923,8 +4925,11 @@ const Oi = {
4923
4925
  const t = this.multiple ? e : e[0];
4924
4926
  this.$emit("update:modelValue", t), this.$emit("input", t);
4925
4927
  },
4928
+ onInputFieldClick() {
4929
+ this.showMenu ? this.showMenu = !1 : this.openMenu();
4930
+ },
4926
4931
  onListItemSelect(e) {
4927
- this.$emit("item-select", e), this.multiple || this.closeMenu();
4932
+ this.$emit("item-select", e), this.multiple || (this.showMenu = !1);
4928
4933
  },
4929
4934
  onReset() {
4930
4935
  this.inputValue = [];
@@ -4947,7 +4952,8 @@ const Oi = {
4947
4952
  }, 100);
4948
4953
  },
4949
4954
  closeMenu() {
4950
- (this.menuProps || {}).hideOnMenuClick !== !1 && (this.showMenu = !1, setTimeout(() => this.$refs["selection-input"].focus(), 50));
4955
+ var e;
4956
+ ((e = this.menuProps) == null ? void 0 : e.hideOnMenuClick) !== !1 && (this.showMenu = !1, setTimeout(() => this.$refs["selection-input"].focus(), 50));
4951
4957
  }
4952
4958
  },
4953
4959
  created() {