wave-ui 1.68.0 → 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.
- package/dist/wave-ui.cjs.js +1 -1
- package/dist/wave-ui.css +1 -1
- package/dist/wave-ui.es.js +125 -50
- package/dist/wave-ui.umd.js +1 -1
- package/package.json +14 -14
- package/src/wave-ui/components/w-button/button.vue +4 -1
- package/src/wave-ui/components/w-button/index.vue +2 -0
- package/src/wave-ui/components/w-checkbox.vue +11 -8
- package/src/wave-ui/components/w-checkboxes.vue +4 -1
- package/src/wave-ui/components/w-input.vue +2 -0
- package/src/wave-ui/components/w-list.vue +7 -7
- package/src/wave-ui/components/w-menu.vue +12 -1
- package/src/wave-ui/components/w-select.vue +30 -16
- package/src/wave-ui/components/w-table.vue +1 -1
- package/src/wave-ui/components/w-textarea.vue +1 -0
- package/src/wave-ui/components/w-toolbar.vue +1 -2
- package/src/wave-ui/components/w-tooltip.vue +44 -10
- package/src/wave-ui/core.js +36 -2
- package/src/wave-ui/mixins/detachable.js +27 -6
- package/src/wave-ui/scss/_base.scss +18 -0
- package/src/wave-ui/scss/_variables.scss +102 -8
- package/src/wave-ui/scss/index.scss +0 -1
- package/src/wave-ui/utils/dynamic-css.js +19 -8
package/dist/wave-ui.es.js
CHANGED
|
@@ -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
|
|
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
|
|
937
|
-
styles += `${cssScope} .${
|
|
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
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
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}",
|
|
@@ -1426,7 +1450,9 @@ var render$L = function() {
|
|
|
1426
1450
|
return _vm.tooltip ? _c("w-tooltip", _vm._b({ tag: "component", scopedSlots: _vm._u([{ key: "activator", fn: function(ref) {
|
|
1427
1451
|
var on = ref.on;
|
|
1428
1452
|
return [_c("button-partial", _vm._g(_vm._b({}, "button-partial", _vm.buttonProps, false), Object.assign({}, _vm.$listeners, on)), [_vm._t("default")], 2)];
|
|
1429
|
-
} }], null, true) }, "component", _vm.tooltipProps || {}, false), [_c("div", { domProps: { "innerHTML": _vm._s(_vm.tooltip) } })]) : _c("button-partial", _vm._g(_vm._b({
|
|
1453
|
+
} }], null, true) }, "component", _vm.tooltipProps || {}, false), [_c("div", { domProps: { "innerHTML": _vm._s(_vm.tooltip) } })]) : _c("button-partial", _vm._g(_vm._b({ scopedSlots: _vm._u([{ key: "loading", fn: function() {
|
|
1454
|
+
return [_vm._t("loading")];
|
|
1455
|
+
}, proxy: true }], null, true) }, "button-partial", _vm.buttonProps, false), _vm.$listeners), [_vm._t("default")], 2);
|
|
1430
1456
|
};
|
|
1431
1457
|
var staticRenderFns$L = [];
|
|
1432
1458
|
const __vue2_script$L = {
|
|
@@ -1697,8 +1723,9 @@ const __vue2_script$J = {
|
|
|
1697
1723
|
methods: {
|
|
1698
1724
|
onInput() {
|
|
1699
1725
|
this.isChecked = !this.isChecked;
|
|
1700
|
-
this
|
|
1701
|
-
this.$emit("
|
|
1726
|
+
const returnValue = this.isChecked && this.returnValue !== void 0 ? this.returnValue : this.isChecked;
|
|
1727
|
+
this.$emit("update:modelValue", returnValue);
|
|
1728
|
+
this.$emit("input", returnValue);
|
|
1702
1729
|
if (!this.noRipple) {
|
|
1703
1730
|
if (this.isChecked) {
|
|
1704
1731
|
this.ripple.start = true;
|
|
@@ -1763,6 +1790,7 @@ const __vue2_script$I = {
|
|
|
1763
1790
|
props: {
|
|
1764
1791
|
items: { type: Array, required: true },
|
|
1765
1792
|
value: { type: Array },
|
|
1793
|
+
returnValues: { type: Boolean },
|
|
1766
1794
|
labelOnLeft: { type: Boolean },
|
|
1767
1795
|
itemLabelKey: { type: String, default: "label" },
|
|
1768
1796
|
itemValueKey: { type: String, default: "value" },
|
|
@@ -1805,7 +1833,7 @@ const __vue2_script$I = {
|
|
|
1805
1833
|
},
|
|
1806
1834
|
toggleCheck(checkbox, isChecked) {
|
|
1807
1835
|
checkbox._isChecked = isChecked;
|
|
1808
|
-
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);
|
|
1809
1837
|
this.$emit("update:modelValue", selection);
|
|
1810
1838
|
this.$emit("input", selection);
|
|
1811
1839
|
},
|
|
@@ -2837,8 +2865,6 @@ function __vue2_injectStyles$y(context) {
|
|
|
2837
2865
|
var wIcon = /* @__PURE__ */ function() {
|
|
2838
2866
|
return __component__$y.exports;
|
|
2839
2867
|
}();
|
|
2840
|
-
const consoleWarn = (message) => console.warn(`Wave UI: ${message}`);
|
|
2841
|
-
const consoleError = (message) => console.error(`Wave UI: ${message}`);
|
|
2842
2868
|
var render$x = function() {
|
|
2843
2869
|
var _vm = this;
|
|
2844
2870
|
var _h = _vm.$createElement;
|
|
@@ -3027,7 +3053,7 @@ var render$w = function() {
|
|
|
3027
3053
|
return;
|
|
3028
3054
|
}
|
|
3029
3055
|
_vm.inputValue = $event.target.value;
|
|
3030
|
-
}, _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() {
|
|
3031
3057
|
return [_vm.$slots["no-file"] === void 0 ? [_vm._v("No file")] : _vm._e()];
|
|
3032
3058
|
})], 2) : _vm._e(), _vm._l(_vm.inputFiles, function(file, i) {
|
|
3033
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 : ""))]);
|
|
@@ -3392,8 +3418,8 @@ const __vue2_script$v = {
|
|
|
3392
3418
|
"w-list__item-label--focused": item._focused,
|
|
3393
3419
|
"w-list__item-label--hoverable": this.hover,
|
|
3394
3420
|
"w-list__item-label--selectable": this.isSelectable,
|
|
3395
|
-
[item.
|
|
3396
|
-
[this.SelectionColor]: item._selected && !item.
|
|
3421
|
+
[item[this.itemColorKey]]: !!item[this.itemColorKey],
|
|
3422
|
+
[this.SelectionColor]: item._selected && !item[this.itemColorKey] && this.SelectionColor,
|
|
3397
3423
|
[item[this.itemClassKey] || this.itemClass]: item[this.itemClassKey] || this.itemClass
|
|
3398
3424
|
};
|
|
3399
3425
|
},
|
|
@@ -3517,10 +3543,9 @@ const __vue2_script$v = {
|
|
|
3517
3543
|
applySelectionOnItems(selection) {
|
|
3518
3544
|
if (!this.isMultipleSelect)
|
|
3519
3545
|
this.listItems.forEach((item) => item._selected = false);
|
|
3520
|
-
this.checkSelection(selection)
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
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;
|
|
3524
3549
|
});
|
|
3525
3550
|
}
|
|
3526
3551
|
},
|
|
@@ -3589,7 +3614,8 @@ var DetachableMixin = {
|
|
|
3589
3614
|
detachableDefaultRoot: { default: null }
|
|
3590
3615
|
},
|
|
3591
3616
|
data: () => ({
|
|
3592
|
-
docEventListenersHandlers: []
|
|
3617
|
+
docEventListenersHandlers: [],
|
|
3618
|
+
openTimeout: null
|
|
3593
3619
|
}),
|
|
3594
3620
|
computed: {
|
|
3595
3621
|
appendToTarget() {
|
|
@@ -3646,12 +3672,17 @@ var DetachableMixin = {
|
|
|
3646
3672
|
},
|
|
3647
3673
|
alignment() {
|
|
3648
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;
|
|
3649
3678
|
}
|
|
3650
3679
|
},
|
|
3651
3680
|
methods: {
|
|
3652
3681
|
async open(e) {
|
|
3653
3682
|
if (this.delay)
|
|
3654
|
-
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;
|
|
3655
3686
|
this.detachableVisible = true;
|
|
3656
3687
|
if (this.activator)
|
|
3657
3688
|
this.activatorEl = e.target;
|
|
@@ -3793,15 +3824,17 @@ var DetachableMixin = {
|
|
|
3793
3824
|
if (this.activator)
|
|
3794
3825
|
this.bindActivatorEvents();
|
|
3795
3826
|
if (this.value)
|
|
3796
|
-
this.
|
|
3827
|
+
this.open({ target: this.activatorEl });
|
|
3797
3828
|
});
|
|
3798
3829
|
}
|
|
3799
3830
|
if (this.overlay) {
|
|
3800
3831
|
this.overlayEl = (_a = this.$refs.overlay) == null ? void 0 : _a.$el;
|
|
3801
3832
|
wrapper.parentNode.insertBefore(this.overlayEl, wrapper);
|
|
3802
3833
|
}
|
|
3803
|
-
if (this.value && this.activator)
|
|
3804
|
-
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 });
|
|
3805
3838
|
},
|
|
3806
3839
|
beforeDestroy() {
|
|
3807
3840
|
var _a;
|
|
@@ -3819,8 +3852,12 @@ var DetachableMixin = {
|
|
|
3819
3852
|
},
|
|
3820
3853
|
watch: {
|
|
3821
3854
|
value(bool) {
|
|
3822
|
-
if (!!bool !== this.detachableVisible)
|
|
3823
|
-
|
|
3855
|
+
if (!!bool !== this.detachableVisible) {
|
|
3856
|
+
if (bool)
|
|
3857
|
+
this.open({ target: this.activatorEl });
|
|
3858
|
+
else
|
|
3859
|
+
this.close();
|
|
3860
|
+
}
|
|
3824
3861
|
},
|
|
3825
3862
|
appendTo() {
|
|
3826
3863
|
this.removeFromDOM();
|
|
@@ -3875,6 +3912,7 @@ const __vue2_script$u = {
|
|
|
3875
3912
|
contentClass: { type: [String, Object, Array] },
|
|
3876
3913
|
arrow: { type: Boolean },
|
|
3877
3914
|
minWidth: { type: [Number, String] },
|
|
3915
|
+
maxWidth: { type: [Number, String] },
|
|
3878
3916
|
overlay: { type: Boolean },
|
|
3879
3917
|
overlayClass: { type: [String, Object, Array] },
|
|
3880
3918
|
overlayProps: { type: Object },
|
|
@@ -3912,6 +3950,12 @@ const __vue2_script$u = {
|
|
|
3912
3950
|
else
|
|
3913
3951
|
return isNaN(this.minWidth) ? this.minWidth : this.minWidth ? `${this.minWidth}px` : 0;
|
|
3914
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
|
+
},
|
|
3915
3959
|
menuClasses() {
|
|
3916
3960
|
return objectifyClasses(this.menuClass);
|
|
3917
3961
|
},
|
|
@@ -3948,7 +3992,8 @@ const __vue2_script$u = {
|
|
|
3948
3992
|
top: this.detachableCoords.top && `${~~this.detachableCoords.top}px` || null,
|
|
3949
3993
|
left: this.detachableCoords.left && `${~~this.detachableCoords.left}px` || null,
|
|
3950
3994
|
minWidth: this.minWidth && this.menuMinWidth || null,
|
|
3951
|
-
|
|
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))")
|
|
3952
3997
|
};
|
|
3953
3998
|
},
|
|
3954
3999
|
activatorEventHandlers() {
|
|
@@ -3998,6 +4043,7 @@ const __vue2_script$u = {
|
|
|
3998
4043
|
this.close();
|
|
3999
4044
|
},
|
|
4000
4045
|
async close(force = false) {
|
|
4046
|
+
this.openTimeout = clearTimeout(this.openTimeout);
|
|
4001
4047
|
if (!this.detachableVisible)
|
|
4002
4048
|
return;
|
|
4003
4049
|
if (this.showOnHover && !force) {
|
|
@@ -4965,23 +5011,23 @@ var render$l = function() {
|
|
|
4965
5011
|
var _c = _vm._self._c || _h;
|
|
4966
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) {
|
|
4967
5013
|
_vm.valid = $event;
|
|
4968
|
-
}, "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,
|
|
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() {
|
|
4969
5017
|
return [_vm._v(_vm._s(_vm.label))];
|
|
4970
|
-
})], 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(
|
|
4971
|
-
!$event && _vm.closeMenu();
|
|
4972
|
-
} }, 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) {
|
|
4973
5019
|
ref.on;
|
|
4974
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) {
|
|
4975
5021
|
!_vm.isDisabled && !_vm.isReadonly && _vm.onInputFieldClick();
|
|
4976
5022
|
} } }, [_vm.innerIconLeft ? _c("w-icon", { staticClass: "w-select__icon w-select__icon--inner-left", attrs: { "tag": "label" }, on: { "click": function($event) {
|
|
4977
5023
|
return _vm.$emit("click:inner-icon-left", $event);
|
|
4978
|
-
} } }, [_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", "
|
|
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) {
|
|
4979
5025
|
!_vm.isDisabled && !_vm.isReadonly && _vm.onFocus($event);
|
|
4980
5026
|
}, "blur": _vm.onBlur, "keydown": function($event) {
|
|
4981
5027
|
!_vm.isDisabled && !_vm.isReadonly && _vm.onKeydown($event);
|
|
4982
5028
|
} } }), _vm._l(_vm.inputValue.length ? _vm.inputValue : [{}], function(val, i) {
|
|
4983
5029
|
return _c("input", { key: i, attrs: { "type": "hidden", "name": _vm.inputName + (_vm.multiple ? "[]" : "") }, domProps: { "value": val.value === void 0 ? "" : val.value.toString() } });
|
|
4984
|
-
}), _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
|
|
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() {
|
|
4985
5031
|
return [_vm._v(_vm._s(_vm.label))];
|
|
4986
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) {
|
|
4987
5033
|
return _vm.$emit("click:inner-icon-right", $event);
|
|
@@ -4993,7 +5039,7 @@ var render$l = function() {
|
|
|
4993
5039
|
}, "item-select": _vm.onListItemSelect, "keydown:enter": function($event) {
|
|
4994
5040
|
_vm.noUnselect && !_vm.multiple && _vm.closeMenu();
|
|
4995
5041
|
}, "keydown:escape": function($event) {
|
|
4996
|
-
_vm.showMenu && (
|
|
5042
|
+
_vm.showMenu && (_vm.showMenu = false);
|
|
4997
5043
|
} }, scopedSlots: _vm._u([_vm._l(_vm.items.length, function(i) {
|
|
4998
5044
|
return { key: "item." + i, fn: function(ref) {
|
|
4999
5045
|
var item = ref.item;
|
|
@@ -5010,7 +5056,9 @@ var render$l = function() {
|
|
|
5010
5056
|
return [_vm._t("item", function() {
|
|
5011
5057
|
return [_vm._v(_vm._s(item[_vm.itemLabelKey]))];
|
|
5012
5058
|
}, { "item": item, "selected": selected, "index": index2 })];
|
|
5013
|
-
} }], 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,
|
|
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() {
|
|
5014
5062
|
return [_vm._v(_vm._s(_vm.label))];
|
|
5015
5063
|
})], 2) : _vm._e()] : _vm._e()], 2);
|
|
5016
5064
|
};
|
|
@@ -5131,7 +5179,7 @@ const __vue2_script$l = {
|
|
|
5131
5179
|
e.preventDefault();
|
|
5132
5180
|
if (e.keyCode === 27 && this.showMenu)
|
|
5133
5181
|
this.closeMenu();
|
|
5134
|
-
else if (e.keyCode
|
|
5182
|
+
else if ([13, 32].includes(e.keyCode))
|
|
5135
5183
|
this.openMenu();
|
|
5136
5184
|
else if ([38, 40].includes(e.keyCode)) {
|
|
5137
5185
|
if (this.multiple)
|
|
@@ -5145,7 +5193,22 @@ const __vue2_script$l = {
|
|
|
5145
5193
|
const direction = e.keyCode === 38 ? -1 : 1;
|
|
5146
5194
|
index2 = (index2 + items.length + direction) % items.length;
|
|
5147
5195
|
}
|
|
5148
|
-
|
|
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]);
|
|
5149
5212
|
}
|
|
5150
5213
|
}
|
|
5151
5214
|
},
|
|
@@ -5178,7 +5241,7 @@ const __vue2_script$l = {
|
|
|
5178
5241
|
const allValues = this.selectItems.map((item) => item.value);
|
|
5179
5242
|
return items.map((item) => {
|
|
5180
5243
|
let value = item;
|
|
5181
|
-
if (typeof item === "object") {
|
|
5244
|
+
if (item && typeof item === "object") {
|
|
5182
5245
|
value = item[this.itemValueKey] !== void 0 ? item[this.itemValueKey] : item[this.itemLabelKey] !== void 0 ? item[this.itemLabelKey] : item;
|
|
5183
5246
|
}
|
|
5184
5247
|
return this.selectItems[allValues.indexOf(value)];
|
|
@@ -6860,7 +6923,14 @@ const __vue2_script$9 = {
|
|
|
6860
6923
|
transition: { type: String },
|
|
6861
6924
|
tooltipClass: { type: [String, Object, Array] },
|
|
6862
6925
|
persistent: { type: Boolean },
|
|
6863
|
-
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 }
|
|
6864
6934
|
},
|
|
6865
6935
|
emits: ["input", "update:modelValue", "open", "close"],
|
|
6866
6936
|
data: () => ({
|
|
@@ -6881,6 +6951,9 @@ const __vue2_script$9 = {
|
|
|
6881
6951
|
const direction = this.position.replace(/top|bottom/, (m) => ({ top: "up", bottom: "down" })[m]);
|
|
6882
6952
|
return this.transition || `w-tooltip-slide-fade-${direction}`;
|
|
6883
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
|
+
},
|
|
6884
6957
|
classes() {
|
|
6885
6958
|
return {
|
|
6886
6959
|
[this.color]: this.color,
|
|
@@ -6890,6 +6963,8 @@ const __vue2_script$9 = {
|
|
|
6890
6963
|
[`w-tooltip--align-${this.alignment}`]: !this.noPosition && this.alignment,
|
|
6891
6964
|
"w-tooltip--tile": this.tile,
|
|
6892
6965
|
"w-tooltip--round": this.round,
|
|
6966
|
+
caption: this.caption,
|
|
6967
|
+
[`size--${this.size}`]: true,
|
|
6893
6968
|
"w-tooltip--shadow": this.shadow,
|
|
6894
6969
|
"w-tooltip--fixed": this.fixed,
|
|
6895
6970
|
"w-tooltip--no-border": this.noBorder || this.bgColor,
|
|
@@ -6901,17 +6976,16 @@ const __vue2_script$9 = {
|
|
|
6901
6976
|
zIndex: this.zIndex || this.zIndex === 0 || null,
|
|
6902
6977
|
top: this.detachableCoords.top && `${~~this.detachableCoords.top}px` || null,
|
|
6903
6978
|
left: this.detachableCoords.left && `${~~this.detachableCoords.left}px` || null,
|
|
6904
|
-
"--w-tooltip-bg-color": this.$waveui.colors[this.bgColor || "
|
|
6979
|
+
"--w-tooltip-bg-color": this.$waveui.colors[this.bgColor] || "rgb(var(--w-base-bg-color-rgb))"
|
|
6905
6980
|
};
|
|
6906
6981
|
},
|
|
6907
6982
|
activatorEventHandlers() {
|
|
6908
6983
|
let handlers = {};
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
else {
|
|
6984
|
+
const isTouchDevice = typeof window !== "undefined" && "ontouchstart" in window;
|
|
6985
|
+
if (!this.showOnClick && !isTouchDevice) {
|
|
6912
6986
|
handlers = {
|
|
6913
|
-
focus: this.
|
|
6914
|
-
blur: this.
|
|
6987
|
+
focus: this.open,
|
|
6988
|
+
blur: this.close,
|
|
6915
6989
|
mouseenter: (e) => {
|
|
6916
6990
|
this.hoveringActivator = true;
|
|
6917
6991
|
this.open(e);
|
|
@@ -6921,9 +6995,8 @@ const __vue2_script$9 = {
|
|
|
6921
6995
|
this.close();
|
|
6922
6996
|
}
|
|
6923
6997
|
};
|
|
6924
|
-
|
|
6925
|
-
|
|
6926
|
-
}
|
|
6998
|
+
} else if (this.enableTouch || this.showOnClick)
|
|
6999
|
+
handlers = { click: this.toggle };
|
|
6927
7000
|
return handlers;
|
|
6928
7001
|
}
|
|
6929
7002
|
},
|
|
@@ -6931,7 +7004,9 @@ const __vue2_script$9 = {
|
|
|
6931
7004
|
toggle(e) {
|
|
6932
7005
|
let shouldShowTooltip = this.detachableVisible;
|
|
6933
7006
|
if (typeof window !== "undefined" && "ontouchstart" in window) {
|
|
6934
|
-
if (
|
|
7007
|
+
if (!this.enableTouch && !this.showOnClick)
|
|
7008
|
+
shouldShowTooltip = false;
|
|
7009
|
+
else
|
|
6935
7010
|
shouldShowTooltip = !shouldShowTooltip;
|
|
6936
7011
|
} else if (e.type === "click" && this.showOnClick)
|
|
6937
7012
|
shouldShowTooltip = !shouldShowTooltip;
|