wave-ui 1.68.1 → 1.69.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.
@@ -34,6 +34,8 @@ var __privateWrapper = (obj, member, setter, getter) => {
34
34
  };
35
35
  var _instance, _uid, _notificationDefaults;
36
36
  import Vue from "vue";
37
+ const consoleWarn = (message) => console.warn(`Wave UI: ${message}`);
38
+ const consoleError = (message) => console.error(`Wave UI: ${message}`);
37
39
  const config = Vue.observable({
38
40
  breakpoints: {
39
41
  xs: 600,
@@ -506,8 +508,24 @@ const colorPalette = [
506
508
  { label: "inherit", color: "inherit" }
507
509
  ];
508
510
  const injectPresets = (component, presets) => {
511
+ var _a, _b;
509
512
  for (const preset in presets) {
510
- component.props[preset].default = presets[preset];
513
+ if (!((_a = component.props) == null ? void 0 : _a[preset])) {
514
+ let foundProp = false;
515
+ if (Array.isArray(component.mixins) && component.mixins.length) {
516
+ for (const mixin of component.mixins) {
517
+ if ((_b = mixin == null ? void 0 : mixin.props) == null ? void 0 : _b[preset]) {
518
+ mixin.props[preset].default = presets[preset];
519
+ foundProp = true;
520
+ break;
521
+ }
522
+ }
523
+ if (!foundProp)
524
+ consoleWarn(`Attempting to set a preset on a prop that doesn't exist: \`${component.name}.${preset}\`.`);
525
+ continue;
526
+ }
527
+ } else
528
+ component.props[preset].default = presets[preset];
511
529
  }
512
530
  };
513
531
  const _WaveUI = class {
@@ -931,10 +949,11 @@ const cssVars = {
931
949
  };
932
950
  const generateColors = (config2) => {
933
951
  let styles = "";
952
+ const cssVariables = {};
934
953
  const { cssScope } = cssVars;
935
954
  const { info, warning, success, error, ...colors } = config2.colors;
936
- for (const color in colors) {
937
- styles += `${cssScope} .${color}--bg{background-color:${config2.colors[color]}}${cssScope} .${color}{color:${config2.colors[color]}}`;
955
+ for (const colorName in colors) {
956
+ styles += `${cssScope} .${colorName}--bg{background-color:${config2.colors[colorName]}}${cssScope} .${colorName}{color:${config2.colors[colorName]}}`;
938
957
  }
939
958
  if (config2.css.colorShades && config2.shades) {
940
959
  Object.entries(config2.shades).forEach(([label, color]) => {
@@ -945,10 +964,14 @@ const generateColors = (config2) => {
945
964
  for (const color in statusColors) {
946
965
  styles += `${cssScope} .${color}--bg{background-color:${config2.colors[color]}}${cssScope} .${color}{color:${config2.colors[color]}}`;
947
966
  }
948
- const cssVariables = [];
949
- cssVariables.push(`--primary: ${config2.colors.primary}`);
950
- styles += `:root {${cssVariables.join(";")}}`;
951
- return styles;
967
+ const allColors = { ...colors, info, warning, success, error };
968
+ for (const colorName in allColors)
969
+ cssVariables[colorName] = allColors[colorName];
970
+ let cssVariablesString = "";
971
+ Object.entries(cssVariables).forEach(([colorName, colorHex]) => {
972
+ cssVariablesString += `--w-${colorName}-color: ${colorHex};`;
973
+ });
974
+ return `:root{${cssVariablesString}}${styles}`;
952
975
  };
953
976
  const generateBreakpoints = (breakpoints, grid) => {
954
977
  let styles = "";
@@ -984,6 +1007,7 @@ const genBreakpointLayoutClasses = (breakpoints) => {
984
1007
  "text-nowrap{white-space:nowrap}",
985
1008
  "row{flex-direction:row}",
986
1009
  "column{flex-direction:column}",
1010
+ "column-reverse{flex-direction:column-reverse}",
987
1011
  "grow{flex-grow:1;flex-basis:auto}",
988
1012
  "no-grow{flex-grow:0}",
989
1013
  "shrink{flex-shrink:1;margin-left:auto;margin-right:auto}",
@@ -1699,8 +1723,9 @@ const __vue2_script$J = {
1699
1723
  methods: {
1700
1724
  onInput() {
1701
1725
  this.isChecked = !this.isChecked;
1702
- this.$emit("update:modelValue", this.isChecked);
1703
- this.$emit("input", this.isChecked);
1726
+ const returnValue = this.isChecked && this.returnValue !== void 0 ? this.returnValue : this.isChecked;
1727
+ this.$emit("update:modelValue", returnValue);
1728
+ this.$emit("input", returnValue);
1704
1729
  if (!this.noRipple) {
1705
1730
  if (this.isChecked) {
1706
1731
  this.ripple.start = true;
@@ -1765,6 +1790,7 @@ const __vue2_script$I = {
1765
1790
  props: {
1766
1791
  items: { type: Array, required: true },
1767
1792
  value: { type: Array },
1793
+ returnValues: { type: Boolean },
1768
1794
  labelOnLeft: { type: Boolean },
1769
1795
  itemLabelKey: { type: String, default: "label" },
1770
1796
  itemValueKey: { type: String, default: "value" },
@@ -1807,7 +1833,7 @@ const __vue2_script$I = {
1807
1833
  },
1808
1834
  toggleCheck(checkbox, isChecked) {
1809
1835
  checkbox._isChecked = isChecked;
1810
- const selection = this.checkboxItems.filter((item) => item._isChecked).map((item) => item.value);
1836
+ const selection = this.checkboxItems.filter((item) => item._isChecked).map((item) => this.returnValues ? item.returnValue : item.value);
1811
1837
  this.$emit("update:modelValue", selection);
1812
1838
  this.$emit("input", selection);
1813
1839
  },
@@ -2839,8 +2865,6 @@ function __vue2_injectStyles$y(context) {
2839
2865
  var wIcon = /* @__PURE__ */ function() {
2840
2866
  return __component__$y.exports;
2841
2867
  }();
2842
- const consoleWarn = (message) => console.warn(`Wave UI: ${message}`);
2843
- const consoleError = (message) => console.error(`Wave UI: ${message}`);
2844
2868
  var render$x = function() {
2845
2869
  var _vm = this;
2846
2870
  var _h = _vm.$createElement;
@@ -3029,7 +3053,7 @@ var render$w = function() {
3029
3053
  return;
3030
3054
  }
3031
3055
  _vm.inputValue = $event.target.value;
3032
- }, _vm.onInput], "focus": _vm.onFocus, "blur": _vm.onBlur } }, "input", _vm.attrs, false), _vm.listeners)) : [_c("input", _vm._b({ ref: "input", attrs: { "id": "w-input--" + _vm._uid, "type": "file", "name": _vm.name || null, "multiple": _vm.multiple || null, "data-progress": _vm.overallFilesProgress }, on: { "focus": _vm.onFocus, "blur": _vm.onBlur, "change": _vm.onFileChange } }, "input", _vm.attrs, false)), _c("transition-group", { staticClass: "w-input__input w-input__input--file", attrs: { "tag": "label", "name": "fade", "for": "w-input--" + _vm._uid } }, [!_vm.inputFiles.length && _vm.isFocused ? _c("span", { key: "no-file", staticClass: "w-input__no-file" }, [_vm._t("no-file", function() {
3056
+ }, _vm.onInput], "focus": _vm.onFocus, "blur": _vm.onBlur } }, "input", _vm.attrs, false), _vm.listeners)) : [_c("input", _vm._b({ ref: "input", attrs: { "id": "w-input--" + _vm._uid, "type": "file", "name": _vm.name || null, "multiple": _vm.multiple || null, "disabled": _vm.isDisabled || null, "data-progress": _vm.overallFilesProgress }, on: { "focus": _vm.onFocus, "blur": _vm.onBlur, "change": _vm.onFileChange } }, "input", _vm.attrs, false)), _c("transition-group", { staticClass: "w-input__input w-input__input--file", attrs: { "tag": "label", "name": "fade", "for": "w-input--" + _vm._uid } }, [!_vm.inputFiles.length && _vm.isFocused ? _c("span", { key: "no-file", staticClass: "w-input__no-file" }, [_vm._t("no-file", function() {
3033
3057
  return [_vm.$slots["no-file"] === void 0 ? [_vm._v("No file")] : _vm._e()];
3034
3058
  })], 2) : _vm._e(), _vm._l(_vm.inputFiles, function(file, i) {
3035
3059
  return _c("span", { key: file.lastModified }, [_vm._v(_vm._s(i ? ", " : "")), _c("span", { key: i + "b", staticClass: "filename" }, [_vm._v(_vm._s(file.base))]), _vm._v(_vm._s(file.extension ? "." + file.extension : ""))]);
@@ -3394,8 +3418,8 @@ const __vue2_script$v = {
3394
3418
  "w-list__item-label--focused": item._focused,
3395
3419
  "w-list__item-label--hoverable": this.hover,
3396
3420
  "w-list__item-label--selectable": this.isSelectable,
3397
- [item.color]: !!item.color,
3398
- [this.SelectionColor]: item._selected && !item.color && this.SelectionColor,
3421
+ [item[this.itemColorKey]]: !!item[this.itemColorKey],
3422
+ [this.SelectionColor]: item._selected && !item[this.itemColorKey] && this.SelectionColor,
3399
3423
  [item[this.itemClassKey] || this.itemClass]: item[this.itemClassKey] || this.itemClass
3400
3424
  };
3401
3425
  },
@@ -3519,10 +3543,9 @@ const __vue2_script$v = {
3519
3543
  applySelectionOnItems(selection) {
3520
3544
  if (!this.isMultipleSelect)
3521
3545
  this.listItems.forEach((item) => item._selected = false);
3522
- this.checkSelection(selection).forEach((val) => {
3523
- const foundItem = this.listItems.find((item) => item._value === val);
3524
- if (foundItem)
3525
- foundItem._selected = true;
3546
+ const selectedItems = this.checkSelection(selection);
3547
+ this.listItems.forEach((item) => {
3548
+ item._selected = selectedItems.find((val) => item._value === val) !== void 0;
3526
3549
  });
3527
3550
  }
3528
3551
  },
@@ -3591,7 +3614,8 @@ var DetachableMixin = {
3591
3614
  detachableDefaultRoot: { default: null }
3592
3615
  },
3593
3616
  data: () => ({
3594
- docEventListenersHandlers: []
3617
+ docEventListenersHandlers: [],
3618
+ openTimeout: null
3595
3619
  }),
3596
3620
  computed: {
3597
3621
  appendToTarget() {
@@ -3648,12 +3672,17 @@ var DetachableMixin = {
3648
3672
  },
3649
3673
  alignment() {
3650
3674
  return ["top", "bottom"].includes(this.position) && this.alignLeft && "left" || ["top", "bottom"].includes(this.position) && this.alignRight && "right" || ["left", "right"].includes(this.position) && this.alignTop && "top" || ["left", "right"].includes(this.position) && this.alignBottom && "bottom" || "";
3675
+ },
3676
+ shouldShowOnClick() {
3677
+ return this.$options.props.showOnHover && !this.showOnHover || this.$options.props.showOnClick && this.showOnClick;
3651
3678
  }
3652
3679
  },
3653
3680
  methods: {
3654
3681
  async open(e) {
3655
3682
  if (this.delay)
3656
- await new Promise((resolve) => setTimeout(resolve, this.delay));
3683
+ await new Promise((resolve) => this.openTimeout = setTimeout(resolve, this.delay));
3684
+ if (this.delay && !this.openTimeout)
3685
+ return;
3657
3686
  this.detachableVisible = true;
3658
3687
  if (this.activator)
3659
3688
  this.activatorEl = e.target;
@@ -3795,15 +3824,17 @@ var DetachableMixin = {
3795
3824
  if (this.activator)
3796
3825
  this.bindActivatorEvents();
3797
3826
  if (this.value)
3798
- this.toggle({ type: "click", target: this.activatorEl });
3827
+ this.open({ target: this.activatorEl });
3799
3828
  });
3800
3829
  }
3801
3830
  if (this.overlay) {
3802
3831
  this.overlayEl = (_a = this.$refs.overlay) == null ? void 0 : _a.$el;
3803
3832
  wrapper.parentNode.insertBefore(this.overlayEl, wrapper);
3804
3833
  }
3805
- if (this.value && this.activator)
3806
- this.toggle({ type: "click", target: this.activatorEl });
3834
+ if (this.value && this.activator) {
3835
+ this.toggle({ type: this.shouldShowOnClick ? "click" : "mouseenter", target: this.activatorEl });
3836
+ } else if (this.value)
3837
+ this.open({ target: this.activatorEl });
3807
3838
  },
3808
3839
  beforeDestroy() {
3809
3840
  var _a;
@@ -3821,8 +3852,12 @@ var DetachableMixin = {
3821
3852
  },
3822
3853
  watch: {
3823
3854
  value(bool) {
3824
- if (!!bool !== this.detachableVisible)
3825
- this.toggle({ type: "click", target: this.activatorEl });
3855
+ if (!!bool !== this.detachableVisible) {
3856
+ if (bool)
3857
+ this.open({ target: this.activatorEl });
3858
+ else
3859
+ this.close();
3860
+ }
3826
3861
  },
3827
3862
  appendTo() {
3828
3863
  this.removeFromDOM();
@@ -3877,6 +3912,7 @@ const __vue2_script$u = {
3877
3912
  contentClass: { type: [String, Object, Array] },
3878
3913
  arrow: { type: Boolean },
3879
3914
  minWidth: { type: [Number, String] },
3915
+ maxWidth: { type: [Number, String] },
3880
3916
  overlay: { type: Boolean },
3881
3917
  overlayClass: { type: [String, Object, Array] },
3882
3918
  overlayProps: { type: Object },
@@ -3914,6 +3950,12 @@ const __vue2_script$u = {
3914
3950
  else
3915
3951
  return isNaN(this.minWidth) ? this.minWidth : this.minWidth ? `${this.minWidth}px` : 0;
3916
3952
  },
3953
+ menuMaxWidth() {
3954
+ if (this.maxWidth === "activator")
3955
+ return this.activatorWidth ? `${this.activatorWidth}px` : 0;
3956
+ else
3957
+ return isNaN(this.maxWidth) ? this.maxWidth : this.maxWidth ? `${this.maxWidth}px` : 0;
3958
+ },
3917
3959
  menuClasses() {
3918
3960
  return objectifyClasses(this.menuClass);
3919
3961
  },
@@ -3950,7 +3992,8 @@ const __vue2_script$u = {
3950
3992
  top: this.detachableCoords.top && `${~~this.detachableCoords.top}px` || null,
3951
3993
  left: this.detachableCoords.left && `${~~this.detachableCoords.left}px` || null,
3952
3994
  minWidth: this.minWidth && this.menuMinWidth || null,
3953
- "--w-menu-bg-color": this.arrow && this.$waveui.colors[this.bgColor || "white"]
3995
+ maxWidth: this.maxWidth && this.menuMaxWidth || null,
3996
+ "--w-menu-bg-color": this.arrow && (this.$waveui.colors[this.bgColor] || "rgb(var(--w-base-bg-color-rgb))")
3954
3997
  };
3955
3998
  },
3956
3999
  activatorEventHandlers() {
@@ -4000,6 +4043,7 @@ const __vue2_script$u = {
4000
4043
  this.close();
4001
4044
  },
4002
4045
  async close(force = false) {
4046
+ this.openTimeout = clearTimeout(this.openTimeout);
4003
4047
  if (!this.detachableVisible)
4004
4048
  return;
4005
4049
  if (this.showOnHover && !force) {
@@ -4967,23 +5011,23 @@ var render$l = function() {
4967
5011
  var _c = _vm._self._c || _h;
4968
5012
  return _c(_vm.formRegister ? "w-form-element" : "div", _vm._b({ ref: "formEl", tag: "component", class: _vm.classes, attrs: { "valid": _vm.valid, "wrap": _vm.hasLabel && _vm.labelPosition !== "inside" }, on: { "update:valid": function($event) {
4969
5013
  _vm.valid = $event;
4970
- }, "reset": _vm.onReset } }, "component", _vm.formRegister && { validators: _vm.validators, inputValue: _vm.selectionString, disabled: _vm.isDisabled, readonly: _vm.isReadonly, isFocused: _vm.isFocused }, false), [_vm.labelPosition === "left" ? [_vm.$slots.default || _vm.label ? _c("label", { staticClass: "w-select__label w-select__label--left w-form-el-shakable", class: _vm.labelClasses, attrs: { "for": "w-select--" + _vm._uid } }, [_vm._t("default", function() {
5014
+ }, "reset": _vm.onReset } }, "component", _vm.formRegister && { validators: _vm.validators, inputValue: _vm.selectionString, disabled: _vm.isDisabled, readonly: _vm.isReadonly, isFocused: _vm.isFocused }, false), [_vm.labelPosition === "left" ? [_vm.$slots.default || _vm.label ? _c("label", { staticClass: "w-select__label w-select__label--left w-form-el-shakable", class: _vm.labelClasses, on: { "click": function($event) {
5015
+ return _vm.$refs["selection-input"].click();
5016
+ } } }, [_vm._t("default", function() {
4971
5017
  return [_vm._v(_vm._s(_vm.label))];
4972
- })], 2) : _vm._e()] : _vm._e(), _c("w-menu", _vm._b({ attrs: { "menu-class": "w-select__menu " + (_vm.menuClass || ""), "transition": "slide-fade-down", "append-to": (_vm.menuProps || {}).appendTo !== void 0 ? (_vm.menuProps || {}).appendTo : void 0, "align-left": "", "custom": "", "min-width": "activator" }, on: { "close": function($event) {
4973
- !$event && _vm.closeMenu();
4974
- } }, scopedSlots: _vm._u([{ key: "activator", fn: function(ref) {
5018
+ })], 2) : _vm._e()] : _vm._e(), _c("w-menu", _vm._b({ attrs: { "menu-class": "w-select__menu " + (_vm.menuClass || ""), "transition": "slide-fade-down", "append-to": (_vm.menuProps || {}).appendTo !== void 0 ? (_vm.menuProps || {}).appendTo : void 0, "align-left": "", "custom": "", "min-width": "activator" }, on: { "close": _vm.closeMenu }, scopedSlots: _vm._u([{ key: "activator", fn: function(ref) {
4975
5019
  ref.on;
4976
5020
  return [_c("div", { staticClass: "w-select__selection-wrap", class: _vm.inputWrapClasses, attrs: { "role": "button", "aria-haspopup": "listbox", "aria-expanded": _vm.showMenu ? "true" : "false", "aria-owns": "w-select-menu--" + _vm._uid, "aria-activedescendant": "w-select-menu--" + _vm._uid + "_item-1" }, on: { "click": function($event) {
4977
5021
  !_vm.isDisabled && !_vm.isReadonly && _vm.onInputFieldClick();
4978
5022
  } } }, [_vm.innerIconLeft ? _c("w-icon", { staticClass: "w-select__icon w-select__icon--inner-left", attrs: { "tag": "label" }, on: { "click": function($event) {
4979
5023
  return _vm.$emit("click:inner-icon-left", $event);
4980
- } } }, [_vm._v(_vm._s(_vm.innerIconLeft))]) : _vm._e(), _vm.$scopedSlots.selection ? _c("div", { staticClass: "w-select__selection-slot" }, [_vm._t("selection", null, { "item": _vm.multiple ? _vm.inputValue : _vm.inputValue[0] })], 2) : _vm._e(), _c("div", { ref: "selection-input", staticClass: "w-select__selection", class: { "w-select__selection--placeholder": !_vm.$scopedSlots.selection && !_vm.selectionString && _vm.placeholder }, attrs: { "contenteditable": _vm.isDisabled || _vm.isReadonly ? "false" : "true", "id": "w-select--" + _vm._uid, "disabled": _vm.isDisabled || null, "readonly": "", "aria-readonly": "true", "tabindex": _vm.tabindex || null }, domProps: { "innerHTML": _vm._s((_vm.$scopedSlots.selection ? "" : _vm.selectionString) || _vm.placeholder) }, on: { "focus": function($event) {
5024
+ } } }, [_vm._v(_vm._s(_vm.innerIconLeft))]) : _vm._e(), _vm.$scopedSlots.selection ? _c("div", { staticClass: "w-select__selection-slot" }, [_vm._t("selection", null, { "item": _vm.multiple ? _vm.inputValue : _vm.inputValue[0] })], 2) : _vm._e(), _c("div", { ref: "selection-input", staticClass: "w-select__selection", class: { "w-select__selection--placeholder": !_vm.$scopedSlots.selection && !_vm.selectionString && _vm.placeholder }, attrs: { "contenteditable": _vm.isDisabled || _vm.isReadonly ? "false" : "true", "disabled": _vm.isDisabled || null, "readonly": "", "aria-readonly": "true", "tabindex": _vm.tabindex || null }, domProps: { "innerHTML": _vm._s((_vm.$scopedSlots.selection ? "" : _vm.selectionString) || _vm.placeholder) }, on: { "focus": function($event) {
4981
5025
  !_vm.isDisabled && !_vm.isReadonly && _vm.onFocus($event);
4982
5026
  }, "blur": _vm.onBlur, "keydown": function($event) {
4983
5027
  !_vm.isDisabled && !_vm.isReadonly && _vm.onKeydown($event);
4984
5028
  } } }), _vm._l(_vm.inputValue.length ? _vm.inputValue : [{}], function(val, i) {
4985
5029
  return _c("input", { key: i, attrs: { "type": "hidden", "name": _vm.inputName + (_vm.multiple ? "[]" : "") }, domProps: { "value": val.value === void 0 ? "" : val.value.toString() } });
4986
- }), _vm.labelPosition === "inside" && _vm.showLabelInside ? [_vm.$slots.default || _vm.label ? _c("label", { staticClass: "w-select__label w-select__label--inside w-form-el-shakable", class: _vm.labelClasses, attrs: { "for": "w-select--" + _vm._uid } }, [_vm._t("default", function() {
5030
+ }), _vm.labelPosition === "inside" && _vm.showLabelInside ? [_vm.$slots.default || _vm.label ? _c("label", { staticClass: "w-select__label w-select__label--inside w-form-el-shakable", class: _vm.labelClasses }, [_vm._t("default", function() {
4987
5031
  return [_vm._v(_vm._s(_vm.label))];
4988
5032
  })], 2) : _vm._e()] : _vm._e(), _vm.innerIconRight ? _c("w-icon", { staticClass: "w-select__icon w-select__icon--inner-right", attrs: { "tag": "label" }, on: { "click": function($event) {
4989
5033
  return _vm.$emit("click:inner-icon-right", $event);
@@ -4995,7 +5039,7 @@ var render$l = function() {
4995
5039
  }, "item-select": _vm.onListItemSelect, "keydown:enter": function($event) {
4996
5040
  _vm.noUnselect && !_vm.multiple && _vm.closeMenu();
4997
5041
  }, "keydown:escape": function($event) {
4998
- _vm.showMenu && (this.showMenu = false);
5042
+ _vm.showMenu && (_vm.showMenu = false);
4999
5043
  } }, scopedSlots: _vm._u([_vm._l(_vm.items.length, function(i) {
5000
5044
  return { key: "item." + i, fn: function(ref) {
5001
5045
  var item = ref.item;
@@ -5012,7 +5056,9 @@ var render$l = function() {
5012
5056
  return [_vm._t("item", function() {
5013
5057
  return [_vm._v(_vm._s(item[_vm.itemLabelKey]))];
5014
5058
  }, { "item": item, "selected": selected, "index": index2 })];
5015
- } }], null, true) })], 1), _vm.labelPosition === "right" ? [_vm.$slots.default || _vm.label ? _c("label", { staticClass: "w-select__label w-select__label--right w-form-el-shakable", class: _vm.labelClasses, attrs: { "for": "w-select--" + _vm._uid } }, [_vm._t("default", function() {
5059
+ } }], null, true) })], 1), _vm.labelPosition === "right" ? [_vm.$slots.default || _vm.label ? _c("label", { staticClass: "w-select__label w-select__label--right w-form-el-shakable", class: _vm.labelClasses, on: { "click": function($event) {
5060
+ return _vm.$refs["selection-input"].click();
5061
+ } } }, [_vm._t("default", function() {
5016
5062
  return [_vm._v(_vm._s(_vm.label))];
5017
5063
  })], 2) : _vm._e()] : _vm._e()], 2);
5018
5064
  };
@@ -5147,7 +5193,22 @@ const __vue2_script$l = {
5147
5193
  const direction = e.keyCode === 38 ? -1 : 1;
5148
5194
  index2 = (index2 + items.length + direction) % items.length;
5149
5195
  }
5150
- this.onInput(items[index2]);
5196
+ let allItemsAreDisabled = false;
5197
+ if (items[index2].disabled) {
5198
+ const direction = e.keyCode === 38 ? -1 : 1;
5199
+ let newIndex = (index2 + direction + items.length) % items.length;
5200
+ const itemsCount = items.length;
5201
+ let loop = 0;
5202
+ while (loop < itemsCount && items[newIndex].disabled) {
5203
+ newIndex = (newIndex + items.length + direction) % items.length;
5204
+ loop++;
5205
+ }
5206
+ if (loop >= itemsCount)
5207
+ allItemsAreDisabled = true;
5208
+ index2 = newIndex;
5209
+ }
5210
+ if (!allItemsAreDisabled)
5211
+ this.onInput(items[index2]);
5151
5212
  }
5152
5213
  }
5153
5214
  },
@@ -6862,7 +6923,14 @@ const __vue2_script$9 = {
6862
6923
  transition: { type: String },
6863
6924
  tooltipClass: { type: [String, Object, Array] },
6864
6925
  persistent: { type: Boolean },
6865
- delay: { type: Number }
6926
+ delay: { type: Number },
6927
+ caption: { type: Boolean },
6928
+ xs: { type: Boolean },
6929
+ sm: { type: Boolean },
6930
+ md: { type: Boolean },
6931
+ lg: { type: Boolean },
6932
+ xl: { type: Boolean },
6933
+ enableTouch: { type: Boolean }
6866
6934
  },
6867
6935
  emits: ["input", "update:modelValue", "open", "close"],
6868
6936
  data: () => ({
@@ -6883,6 +6951,9 @@ const __vue2_script$9 = {
6883
6951
  const direction = this.position.replace(/top|bottom/, (m) => ({ top: "up", bottom: "down" })[m]);
6884
6952
  return this.transition || `w-tooltip-slide-fade-${direction}`;
6885
6953
  },
6954
+ size() {
6955
+ return this.xs && "xs" || this.sm && "sm" || this.sm && "md" || this.lg && "lg" || this.xl && "xl" || (this.caption ? "sm" : "md");
6956
+ },
6886
6957
  classes() {
6887
6958
  return {
6888
6959
  [this.color]: this.color,
@@ -6892,6 +6963,8 @@ const __vue2_script$9 = {
6892
6963
  [`w-tooltip--align-${this.alignment}`]: !this.noPosition && this.alignment,
6893
6964
  "w-tooltip--tile": this.tile,
6894
6965
  "w-tooltip--round": this.round,
6966
+ caption: this.caption,
6967
+ [`size--${this.size}`]: true,
6895
6968
  "w-tooltip--shadow": this.shadow,
6896
6969
  "w-tooltip--fixed": this.fixed,
6897
6970
  "w-tooltip--no-border": this.noBorder || this.bgColor,
@@ -6903,17 +6976,16 @@ const __vue2_script$9 = {
6903
6976
  zIndex: this.zIndex || this.zIndex === 0 || null,
6904
6977
  top: this.detachableCoords.top && `${~~this.detachableCoords.top}px` || null,
6905
6978
  left: this.detachableCoords.left && `${~~this.detachableCoords.left}px` || null,
6906
- "--w-tooltip-bg-color": this.$waveui.colors[this.bgColor || "white"]
6979
+ "--w-tooltip-bg-color": this.$waveui.colors[this.bgColor] || "rgb(var(--w-base-bg-color-rgb))"
6907
6980
  };
6908
6981
  },
6909
6982
  activatorEventHandlers() {
6910
6983
  let handlers = {};
6911
- if (this.showOnClick)
6912
- handlers = { click: this.toggle };
6913
- else {
6984
+ const isTouchDevice = typeof window !== "undefined" && "ontouchstart" in window;
6985
+ if (!this.showOnClick && !isTouchDevice) {
6914
6986
  handlers = {
6915
- focus: this.toggle,
6916
- blur: this.toggle,
6987
+ focus: this.open,
6988
+ blur: this.close,
6917
6989
  mouseenter: (e) => {
6918
6990
  this.hoveringActivator = true;
6919
6991
  this.open(e);
@@ -6923,9 +6995,8 @@ const __vue2_script$9 = {
6923
6995
  this.close();
6924
6996
  }
6925
6997
  };
6926
- if (typeof window !== "undefined" && "ontouchstart" in window)
6927
- handlers.click = this.toggle;
6928
- }
6998
+ } else if (this.enableTouch || this.showOnClick)
6999
+ handlers = { click: this.toggle };
6929
7000
  return handlers;
6930
7001
  }
6931
7002
  },
@@ -6933,7 +7004,9 @@ const __vue2_script$9 = {
6933
7004
  toggle(e) {
6934
7005
  let shouldShowTooltip = this.detachableVisible;
6935
7006
  if (typeof window !== "undefined" && "ontouchstart" in window) {
6936
- if (e.type === "click")
7007
+ if (!this.enableTouch && !this.showOnClick)
7008
+ shouldShowTooltip = false;
7009
+ else
6937
7010
  shouldShowTooltip = !shouldShowTooltip;
6938
7011
  } else if (e.type === "click" && this.showOnClick)
6939
7012
  shouldShowTooltip = !shouldShowTooltip;