wave-ui 3.0.4 → 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.
@@ -729,7 +729,7 @@ const j = class {
729
729
  if (!he) {
730
730
  he = !0;
731
731
  const i = Be("$waveui"), { config: o } = i, r = document.querySelector(o.on) || document.body;
732
- r.classList.add("w-app"), o.colors[o.theme], o.theme === "auto" ? Ae(i) : i.switchTheme(o.theme, !0), Me(i), Te(r, a, i), t._context.mixins.find((d) => d.mounted && delete d.mounted);
732
+ r.classList.add("w-app"), o.theme === "auto" ? Ae(i) : i.switchTheme(o.theme, !0), Me(i), Te(r, a, i), t._context.mixins.find((d) => d.mounted && delete d.mounted);
733
733
  }
734
734
  }
735
735
  }), new j(t, l), te(j, q, !0);
@@ -3417,7 +3417,10 @@ const El = {
3417
3417
  }));
3418
3418
  },
3419
3419
  applySelectionOnItems(e) {
3420
- this.isMultipleSelect || this.listItems.forEach((t) => t._selected = !1), this.checkSelection(e).forEach((t) => this.listItems.find((l) => l._value === t)._selected = !0);
3420
+ this.isMultipleSelect || this.listItems.forEach((t) => t._selected = !1), this.checkSelection(e).forEach((t) => {
3421
+ const l = this.listItems.find((a) => a._value === t);
3422
+ l && (l._selected = !0);
3423
+ });
3421
3424
  }
3422
3425
  },
3423
3426
  created() {
@@ -4501,7 +4504,7 @@ const Ci = {
4501
4504
  }, Bi = /* @__PURE__ */ v(Ci, [["render", _i]]), Si = ["for"], $i = ["aria-expanded", "aria-owns", "aria-activedescendant"], Vi = {
4502
4505
  key: 1,
4503
4506
  class: "w-select__selection-slot"
4504
- }, Ii = ["value", "id", "placeholder", "disabled", "required", "tabindex"], Ri = ["value", "name"], Li = ["for"], xi = ["for"];
4507
+ }, Ii = ["contenteditable", "id", "disabled", "tabindex", "innerHTML"], Ri = ["value", "name"], Li = ["for"], xi = ["for"];
4505
4508
  function Ti(e, t, l, a, n, i) {
4506
4509
  const o = $("w-icon"), r = $("w-list"), d = $("w-menu");
4507
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 }, {
@@ -4559,23 +4562,20 @@ function Ti(e, t, l, a, n, i) {
4559
4562
  item: l.multiple ? e.inputValue : e.inputValue[0]
4560
4563
  })
4561
4564
  ])) : c("", !0),
4562
- w("input", {
4563
- class: "w-select__selection",
4565
+ w("div", {
4566
+ class: f(["w-select__selection", { "w-select__selection--placeholder": !e.$slots.selection && !i.selectionString && l.placeholder }]),
4564
4567
  ref: "selection-input",
4565
- type: "text",
4566
- value: e.$slots.selection ? "" : i.selectionString,
4568
+ contenteditable: e.isDisabled || e.isReadonly ? "false" : "true",
4567
4569
  onFocus: t[1] || (t[1] = (y) => !e.isDisabled && !e.isReadonly && i.onFocus(y)),
4568
4570
  onBlur: t[2] || (t[2] = (...y) => i.onBlur && i.onBlur(...y)),
4569
4571
  onKeydown: t[3] || (t[3] = (y) => !e.isDisabled && !e.isReadonly && i.onKeydown(y)),
4570
4572
  id: `w-select--${e._.uid}`,
4571
- placeholder: !e.$slots.selection && l.placeholder || null,
4572
4573
  disabled: e.isDisabled || null,
4573
4574
  readonly: "",
4574
4575
  "aria-readonly": "true",
4575
- required: e.required || null,
4576
4576
  tabindex: e.tabindex || null,
4577
- autocomplete: "off"
4578
- }, null, 40, Ii),
4577
+ innerHTML: e.$slots.selection ? "" : i.selectionString || l.placeholder
4578
+ }, null, 42, Ii),
4579
4579
  (s(!0), u(C, null, x(e.inputValue.length ? e.inputValue : [{}], (y, S) => (s(), u("input", {
4580
4580
  key: S,
4581
4581
  type: "hidden",
@@ -4695,7 +4695,8 @@ const Oi = {
4695
4695
  noUnselect: { type: Boolean },
4696
4696
  menuProps: { type: Object },
4697
4697
  dark: { type: Boolean },
4698
- light: { type: Boolean }
4698
+ light: { type: Boolean },
4699
+ fitToContent: { type: Boolean }
4699
4700
  },
4700
4701
  emits: ["input", "update:modelValue", "focus", "blur", "item-click", "item-select", "click:inner-icon-left", "click:inner-icon-right"],
4701
4702
  data: () => ({
@@ -4732,6 +4733,7 @@ const Oi = {
4732
4733
  "w-select--dark": this.dark,
4733
4734
  "w-select--light": this.light,
4734
4735
  "w-select--disabled": this.isDisabled,
4736
+ "w-select--fit-to-content": this.fitToContent,
4735
4737
  "w-select--readonly": this.isReadonly,
4736
4738
  [`w-select--${this.hasValue ? "filled" : "empty"}`]: !0,
4737
4739
  "w-select--focused": (this.isFocused || this.showMenu) && !this.isReadonly,
@@ -4758,13 +4760,13 @@ const Oi = {
4758
4760
  },
4759
4761
  methods: {
4760
4762
  onFocus(e) {
4761
- this.isFocused = !0, this.$emit("focus", e);
4763
+ return this.isFocused = !0, this.$emit("focus", e), !1;
4762
4764
  },
4763
4765
  onBlur(e) {
4764
4766
  this.isFocused = !1, this.$emit("blur", e);
4765
4767
  },
4766
4768
  onKeydown(e) {
4767
- 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)
4768
4770
  this.closeMenu();
4769
4771
  else if (e.keyCode === 13)
4770
4772
  this.openMenu();
@@ -4797,7 +4799,7 @@ const Oi = {
4797
4799
  this.$emit("update:modelValue", e), this.$emit("input", e);
4798
4800
  },
4799
4801
  checkSelection(e) {
4800
- console.log(e), e = Array.isArray(e) ? e : e !== void 0 ? [e] : [];
4802
+ e = Array.isArray(e) ? e : e !== void 0 ? [e] : [];
4801
4803
  const t = this.selectItems.map((l) => l.value);
4802
4804
  return e.map((l) => {
4803
4805
  let a = l;
@@ -6885,6 +6887,7 @@ const Ga = {
6885
6887
  counts: { type: Boolean },
6886
6888
  itemIconKey: { type: String, default: "icon" },
6887
6889
  iconColor: { type: String },
6890
+ itemLabelKey: { type: String, default: "label" },
6888
6891
  itemIconColorKey: { type: String, default: "iconColor" },
6889
6892
  itemRouteKey: { type: String, default: "route" },
6890
6893
  itemDisabledKey: { type: String, default: "disabled" },
@@ -6914,7 +6917,7 @@ const Ga = {
6914
6917
  this.currentDepthItems.push({
6915
6918
  originalItem: l,
6916
6919
  _uid: this.depth.toString() + (a + 1),
6917
- label: l.label,
6920
+ label: l[this.itemLabelKey],
6918
6921
  children: !!l.children,
6919
6922
  branch: l.branch,
6920
6923
  route: l[this.itemRouteKey],