wave-ui 2.28.1 → 2.29.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 +56 -45
- package/dist/wave-ui.umd.js +1 -1
- package/package.json +9 -9
- package/src/wave-ui/components/w-accordion.vue +6 -4
- package/src/wave-ui/components/w-app.vue +1 -1
- package/src/wave-ui/components/w-flex.vue +2 -0
- package/src/wave-ui/components/w-input.vue +19 -3
- package/src/wave-ui/components/w-menu.vue +21 -9
- package/src/wave-ui/components/w-textarea.vue +1 -1
- package/src/wave-ui/components/w-tooltip.vue +31 -102
- package/src/wave-ui/utils/index.js +1 -1
package/dist/wave-ui.es.js
CHANGED
|
@@ -525,7 +525,7 @@ function render$O(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
525
525
|
}, [
|
|
526
526
|
$props.expandIcon && !$props.expandIconRight ? (openBlock(), createBlock(_component_w_button, {
|
|
527
527
|
key: 0,
|
|
528
|
-
class: "w-accordion__expand-icon",
|
|
528
|
+
class: normalizeClass(["w-accordion__expand-icon", { "w-accordion__expand-icon--expanded": item._expanded }]),
|
|
529
529
|
icon: item._expanded && $props.collapseIcon || $props.expandIcon,
|
|
530
530
|
disabled: item._disabled || null,
|
|
531
531
|
tabindex: -1,
|
|
@@ -533,7 +533,7 @@ function render$O(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
533
533
|
onKeypress: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
534
534
|
}, ["stop"])),
|
|
535
535
|
onClick: withModifiers(($event) => !item._disabled && $options.toggleItem(item, $event), ["stop"])
|
|
536
|
-
}, null, 8, ["icon", "disabled", "onClick"])) : createCommentVNode("", true),
|
|
536
|
+
}, null, 8, ["icon", "disabled", "onClick", "class"])) : createCommentVNode("", true),
|
|
537
537
|
_ctx.$slots[`item-title.${item.id || i + 1}`] ? renderSlot(_ctx.$slots, `item-title.${item.id || i + 1}`, {
|
|
538
538
|
key: 1,
|
|
539
539
|
item: $options.getOriginalItem(item),
|
|
@@ -552,13 +552,13 @@ function render$O(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
552
552
|
]),
|
|
553
553
|
$props.expandIcon && $props.expandIconRight ? (openBlock(), createBlock(_component_w_button, {
|
|
554
554
|
key: 3,
|
|
555
|
-
class: "w-accordion__expand-icon",
|
|
555
|
+
class: normalizeClass(["w-accordion__expand-icon", { "w-accordion__expand-icon--expanded": item._expanded }]),
|
|
556
556
|
icon: item._expanded && $props.collapseIcon || $props.expandIcon,
|
|
557
557
|
text: "",
|
|
558
558
|
onKeypress: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
559
559
|
}, ["stop"])),
|
|
560
560
|
onClick: withModifiers(($event) => !item._disabled && $options.toggleItem(item, $event), ["stop"])
|
|
561
|
-
}, null, 8, ["icon", "onClick"])) : createCommentVNode("", true)
|
|
561
|
+
}, null, 8, ["icon", "onClick", "class"])) : createCommentVNode("", true)
|
|
562
562
|
], 42, _hoisted_2$f),
|
|
563
563
|
createVNode(_component_w_transition_expand, { y: "" }, {
|
|
564
564
|
default: withCtx(() => [
|
|
@@ -591,10 +591,11 @@ function render$O(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
591
591
|
}
|
|
592
592
|
var wAccordion_vue_vue_type_style_index_0_lang = "";
|
|
593
593
|
var _export_sfc = (sfc, props) => {
|
|
594
|
+
const target = sfc.__vccOpts || sfc;
|
|
594
595
|
for (const [key, val] of props) {
|
|
595
|
-
|
|
596
|
+
target[key] = val;
|
|
596
597
|
}
|
|
597
|
-
return
|
|
598
|
+
return target;
|
|
598
599
|
};
|
|
599
600
|
const _sfc_main$O = {
|
|
600
601
|
name: "w-accordion",
|
|
@@ -991,7 +992,7 @@ const _sfc_main$L = {
|
|
|
991
992
|
classes() {
|
|
992
993
|
return {
|
|
993
994
|
"d-block": this.block,
|
|
994
|
-
|
|
995
|
+
row: this.row,
|
|
995
996
|
"align-center": this.alignCenter,
|
|
996
997
|
"align-end": this.alignEnd,
|
|
997
998
|
"justify-center": this.justifyCenter,
|
|
@@ -1365,7 +1366,7 @@ var wButton = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["render", render$I]]);
|
|
|
1365
1366
|
const objectifyClasses = (classes = {}) => {
|
|
1366
1367
|
if (typeof classes === "string")
|
|
1367
1368
|
classes = { [classes]: true };
|
|
1368
|
-
else if (
|
|
1369
|
+
else if (Array.isArray(classes))
|
|
1369
1370
|
classes = { [classes.join(" ")]: true };
|
|
1370
1371
|
return classes;
|
|
1371
1372
|
};
|
|
@@ -2283,6 +2284,7 @@ const _sfc_main$z = {
|
|
|
2283
2284
|
justifyEnd: { type: Boolean },
|
|
2284
2285
|
justifySpaceBetween: { type: Boolean },
|
|
2285
2286
|
justifySpaceAround: { type: Boolean },
|
|
2287
|
+
justifySpaceEvenly: { type: Boolean },
|
|
2286
2288
|
basisZero: { type: Boolean },
|
|
2287
2289
|
gap: { type: Number, default: 0 }
|
|
2288
2290
|
},
|
|
@@ -2304,6 +2306,7 @@ const _sfc_main$z = {
|
|
|
2304
2306
|
"justify-end": this.justifyEnd,
|
|
2305
2307
|
"justify-space-between": this.justifySpaceBetween,
|
|
2306
2308
|
"justify-space-around": this.justifySpaceAround,
|
|
2309
|
+
"justify-space-evenly": this.justifySpaceEvenly,
|
|
2307
2310
|
"basis-zero": this.basisZero,
|
|
2308
2311
|
[`w-flex--gap${this.gap}`]: this.gap
|
|
2309
2312
|
};
|
|
@@ -2889,6 +2892,7 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2889
2892
|
$props.type !== "file" ? withDirectives((openBlock(), createElementBlock("input", mergeProps({
|
|
2890
2893
|
key: 1,
|
|
2891
2894
|
class: "w-input__input",
|
|
2895
|
+
ref: "input",
|
|
2892
2896
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.inputValue = $event)
|
|
2893
2897
|
}, toHandlers($options.listeners), {
|
|
2894
2898
|
onInput: _cache[3] || (_cache[3] = (...args) => $options.onInput && $options.onInput(...args)),
|
|
@@ -2910,9 +2914,9 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2910
2914
|
tabindex: _ctx.tabindex || null
|
|
2911
2915
|
}, $options.attrs), null, 16, _hoisted_4$8)), [
|
|
2912
2916
|
[vModelDynamic, $data.inputValue]
|
|
2913
|
-
]) :
|
|
2914
|
-
$props.type === "file" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
2917
|
+
]) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
2915
2918
|
createElementVNode("input", mergeProps({
|
|
2919
|
+
ref: "input",
|
|
2916
2920
|
id: `w-input--${_ctx._.uid}`,
|
|
2917
2921
|
type: "file",
|
|
2918
2922
|
name: _ctx.name || null,
|
|
@@ -2950,7 +2954,7 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2950
2954
|
]),
|
|
2951
2955
|
_: 3
|
|
2952
2956
|
}, 8, ["for"])
|
|
2953
|
-
], 64))
|
|
2957
|
+
], 64)),
|
|
2954
2958
|
$props.labelPosition === "inside" && $options.showLabelInside ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
2955
2959
|
_ctx.$slots.default ? (openBlock(), createElementBlock("label", {
|
|
2956
2960
|
key: 0,
|
|
@@ -3062,7 +3066,8 @@ const _sfc_main$u = {
|
|
|
3062
3066
|
inputNumberError: false,
|
|
3063
3067
|
isFocused: false,
|
|
3064
3068
|
inputFiles: [],
|
|
3065
|
-
fileReader: null
|
|
3069
|
+
fileReader: null,
|
|
3070
|
+
isAutofilled: false
|
|
3066
3071
|
};
|
|
3067
3072
|
},
|
|
3068
3073
|
computed: {
|
|
@@ -3079,7 +3084,7 @@ const _sfc_main$u = {
|
|
|
3079
3084
|
return htmlAttrs;
|
|
3080
3085
|
},
|
|
3081
3086
|
hasValue() {
|
|
3082
|
-
return this.inputValue || ["date", "time"].includes(this.type) || this.type === "number" && this.inputNumberError || this.type === "file" && this.inputFiles.length;
|
|
3087
|
+
return this.inputValue || this.inputValue === 0 || ["date", "time"].includes(this.type) || this.type === "number" && this.inputNumberError || this.type === "file" && this.inputFiles.length;
|
|
3083
3088
|
},
|
|
3084
3089
|
hasLabel() {
|
|
3085
3090
|
return this.label || this.$slots.default;
|
|
@@ -3093,7 +3098,7 @@ const _sfc_main$u = {
|
|
|
3093
3098
|
"w-input--file": this.type === "file",
|
|
3094
3099
|
"w-input--disabled": this.isDisabled,
|
|
3095
3100
|
"w-input--readonly": this.isReadonly,
|
|
3096
|
-
[`w-input--${this.hasValue ? "filled" : "empty"}`]: true,
|
|
3101
|
+
[`w-input--${this.hasValue || this.isAutofilled ? "filled" : "empty"}`]: true,
|
|
3097
3102
|
"w-input--focused": this.isFocused && !this.isReadonly,
|
|
3098
3103
|
"w-input--dark": this.dark,
|
|
3099
3104
|
"w-input--floating-label": this.hasLabel && this.labelPosition === "inside" && !this.staticLabel,
|
|
@@ -3164,9 +3169,17 @@ const _sfc_main$u = {
|
|
|
3164
3169
|
reader.readAsDataURL(original);
|
|
3165
3170
|
}
|
|
3166
3171
|
},
|
|
3172
|
+
mounted() {
|
|
3173
|
+
setTimeout(() => {
|
|
3174
|
+
if (this.$refs.input.matches(":-webkit-autofill"))
|
|
3175
|
+
this.isAutofilled = true;
|
|
3176
|
+
}, 400);
|
|
3177
|
+
},
|
|
3167
3178
|
watch: {
|
|
3168
3179
|
modelValue(value) {
|
|
3169
3180
|
this.inputValue = value;
|
|
3181
|
+
if (!value && value !== 0)
|
|
3182
|
+
this.isAutofilled = false;
|
|
3170
3183
|
}
|
|
3171
3184
|
}
|
|
3172
3185
|
};
|
|
@@ -3627,20 +3640,21 @@ const _sfc_main$s = {
|
|
|
3627
3640
|
return this.transition || "scale-fade";
|
|
3628
3641
|
},
|
|
3629
3642
|
detachToTarget() {
|
|
3630
|
-
|
|
3643
|
+
const defaultTarget = ".w-app";
|
|
3644
|
+
let target = this.detachTo || defaultTarget;
|
|
3631
3645
|
if (target === true)
|
|
3632
|
-
target =
|
|
3646
|
+
target = defaultTarget;
|
|
3633
3647
|
else if (target && !["object", "string"].includes(typeof target))
|
|
3634
|
-
target =
|
|
3648
|
+
target = defaultTarget;
|
|
3635
3649
|
else if (typeof target === "object" && !target.nodeType) {
|
|
3636
|
-
target =
|
|
3650
|
+
target = defaultTarget;
|
|
3637
3651
|
consoleWarn("Invalid node provided in w-menu `detach-to`. Falling back to .w-app.");
|
|
3638
3652
|
}
|
|
3639
3653
|
if (typeof target === "string")
|
|
3640
3654
|
target = document.querySelector(target);
|
|
3641
3655
|
if (!target) {
|
|
3642
|
-
consoleWarn(`Unable to locate ${this.detachTo ? `target ${this.detachTo}` :
|
|
3643
|
-
target = document.querySelector(
|
|
3656
|
+
consoleWarn(`Unable to locate ${this.detachTo ? `target ${this.detachTo}` : defaultTarget}`);
|
|
3657
|
+
target = document.querySelector(defaultTarget);
|
|
3644
3658
|
}
|
|
3645
3659
|
return target;
|
|
3646
3660
|
},
|
|
@@ -3713,8 +3727,9 @@ const _sfc_main$s = {
|
|
|
3713
3727
|
}, 10);
|
|
3714
3728
|
}
|
|
3715
3729
|
};
|
|
3716
|
-
if ("ontouchstart" in window)
|
|
3730
|
+
if (typeof window !== "undefined" && "ontouchstart" in window) {
|
|
3717
3731
|
handlers.click = this.toggleMenu;
|
|
3732
|
+
}
|
|
3718
3733
|
} else
|
|
3719
3734
|
handlers = { click: this.toggleMenu };
|
|
3720
3735
|
return handlers;
|
|
@@ -6500,7 +6515,7 @@ const _sfc_main$b = {
|
|
|
6500
6515
|
return listeners;
|
|
6501
6516
|
},
|
|
6502
6517
|
hasValue() {
|
|
6503
|
-
return this.inputValue;
|
|
6518
|
+
return this.inputValue || this.inputValue === 0;
|
|
6504
6519
|
},
|
|
6505
6520
|
hasLabel() {
|
|
6506
6521
|
return this.label || this.$slots.default;
|
|
@@ -6698,8 +6713,7 @@ const _sfc_main$9 = {
|
|
|
6698
6713
|
var wToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", render$9]]);
|
|
6699
6714
|
function render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
6700
6715
|
return openBlock(), createElementBlock("div", {
|
|
6701
|
-
class: normalizeClass(["w-tooltip-wrap", { "w-tooltip-wrap--attached": !$props.detachTo }])
|
|
6702
|
-
ref: "wrapper"
|
|
6716
|
+
class: normalizeClass(["w-tooltip-wrap", { "w-tooltip-wrap--attached": !$props.detachTo }])
|
|
6703
6717
|
}, [
|
|
6704
6718
|
renderSlot(_ctx.$slots, "activator", { on: $options.eventHandlers }),
|
|
6705
6719
|
createVNode(Transition, {
|
|
@@ -6713,12 +6727,7 @@ function render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6713
6727
|
key: _ctx._.uid,
|
|
6714
6728
|
style: normalizeStyle($options.styles)
|
|
6715
6729
|
}, [
|
|
6716
|
-
|
|
6717
|
-
key: 0,
|
|
6718
|
-
class: normalizeClass($props.color)
|
|
6719
|
-
}, [
|
|
6720
|
-
renderSlot(_ctx.$slots, "default")
|
|
6721
|
-
], 2)) : renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
6730
|
+
renderSlot(_ctx.$slots, "default")
|
|
6722
6731
|
], 6)), [
|
|
6723
6732
|
[vShow, _ctx.showTooltip]
|
|
6724
6733
|
])
|
|
@@ -6772,25 +6781,26 @@ const _sfc_main$8 = {
|
|
|
6772
6781
|
return this.transition || `w-tooltip-slide-fade-${direction}`;
|
|
6773
6782
|
},
|
|
6774
6783
|
detachToTarget() {
|
|
6775
|
-
|
|
6784
|
+
const defaultTarget = ".w-app";
|
|
6785
|
+
let target = this.detachTo || defaultTarget;
|
|
6776
6786
|
if (target === true)
|
|
6777
|
-
target =
|
|
6787
|
+
target = defaultTarget;
|
|
6778
6788
|
else if (target && !["object", "string"].includes(typeof target))
|
|
6779
|
-
target =
|
|
6789
|
+
target = defaultTarget;
|
|
6780
6790
|
else if (typeof target === "object" && !target.nodeType) {
|
|
6781
|
-
target =
|
|
6791
|
+
target = defaultTarget;
|
|
6782
6792
|
consoleWarn("Invalid node provided in w-tooltip `attach-to`. Falling back to .w-app.");
|
|
6783
6793
|
}
|
|
6784
6794
|
if (typeof target === "string")
|
|
6785
6795
|
target = document.querySelector(target);
|
|
6786
6796
|
if (!target) {
|
|
6787
|
-
consoleWarn(`Unable to locate ${this.detachTo ? `target ${this.detachTo}` :
|
|
6788
|
-
target = document.querySelector(
|
|
6797
|
+
consoleWarn(`Unable to locate ${this.detachTo ? `target ${this.detachTo}` : defaultTarget}`);
|
|
6798
|
+
target = document.querySelector(defaultTarget);
|
|
6789
6799
|
}
|
|
6790
6800
|
return target;
|
|
6791
6801
|
},
|
|
6792
6802
|
tooltipParentEl() {
|
|
6793
|
-
return this.detachTo ? this.detachToTarget : this.$
|
|
6803
|
+
return this.detachTo ? this.detachToTarget : this.$el;
|
|
6794
6804
|
},
|
|
6795
6805
|
position() {
|
|
6796
6806
|
return this.top && "top" || this.bottom && "bottom" || this.left && "left" || this.right && "right" || "bottom";
|
|
@@ -6824,8 +6834,8 @@ const _sfc_main$8 = {
|
|
|
6824
6834
|
},
|
|
6825
6835
|
classes() {
|
|
6826
6836
|
return __spreadProps(__spreadValues({
|
|
6827
|
-
[this.color]:
|
|
6828
|
-
[`${this.bgColor}
|
|
6837
|
+
[this.color]: this.color,
|
|
6838
|
+
[`${this.bgColor}--bg`]: this.bgColor
|
|
6829
6839
|
}, this.tooltipClasses), {
|
|
6830
6840
|
[`w-tooltip--${this.position}`]: true,
|
|
6831
6841
|
"w-tooltip--tile": this.tile,
|
|
@@ -6840,8 +6850,9 @@ const _sfc_main$8 = {
|
|
|
6840
6850
|
styles() {
|
|
6841
6851
|
return {
|
|
6842
6852
|
zIndex: this.zIndex || this.zIndex === 0 || null,
|
|
6843
|
-
top: `${~~this.tooltipCoordinates.top}px
|
|
6844
|
-
left: `${~~this.tooltipCoordinates.left}px`
|
|
6853
|
+
top: this.tooltipCoordinates.top && `${~~this.tooltipCoordinates.top}px` || null,
|
|
6854
|
+
left: this.tooltipCoordinates.left && `${~~this.tooltipCoordinates.left}px` || null,
|
|
6855
|
+
"--w-tooltip-bg-color": this.$waveui.colors[this.bgColor || "white"]
|
|
6845
6856
|
};
|
|
6846
6857
|
},
|
|
6847
6858
|
eventHandlers() {
|
|
@@ -6855,7 +6866,7 @@ const _sfc_main$8 = {
|
|
|
6855
6866
|
mouseenter: this.toggle,
|
|
6856
6867
|
mouseleave: this.toggle
|
|
6857
6868
|
};
|
|
6858
|
-
if ("ontouchstart" in window)
|
|
6869
|
+
if (typeof window !== "undefined" && "ontouchstart" in window)
|
|
6859
6870
|
handlers.click = this.toggle;
|
|
6860
6871
|
}
|
|
6861
6872
|
return handlers;
|
|
@@ -6864,7 +6875,7 @@ const _sfc_main$8 = {
|
|
|
6864
6875
|
methods: {
|
|
6865
6876
|
toggle(e) {
|
|
6866
6877
|
let shouldShowTooltip = this.showTooltip;
|
|
6867
|
-
if ("ontouchstart" in window) {
|
|
6878
|
+
if (typeof window !== "undefined" && "ontouchstart" in window) {
|
|
6868
6879
|
if (e.type === "click")
|
|
6869
6880
|
shouldShowTooltip = !shouldShowTooltip;
|
|
6870
6881
|
} else if (e.type === "click" && this.showOnClick)
|
|
@@ -6928,7 +6939,7 @@ const _sfc_main$8 = {
|
|
|
6928
6939
|
return coords;
|
|
6929
6940
|
},
|
|
6930
6941
|
insertTooltip() {
|
|
6931
|
-
const wrapper = this.$
|
|
6942
|
+
const wrapper = this.$el;
|
|
6932
6943
|
wrapper.parentNode.insertBefore(this.activatorEl, wrapper);
|
|
6933
6944
|
this.detachToTarget.appendChild(this.tooltipEl);
|
|
6934
6945
|
},
|
|
@@ -6938,7 +6949,7 @@ const _sfc_main$8 = {
|
|
|
6938
6949
|
}
|
|
6939
6950
|
},
|
|
6940
6951
|
mounted() {
|
|
6941
|
-
this.activatorEl = this.$
|
|
6952
|
+
this.activatorEl = this.$el.firstElementChild;
|
|
6942
6953
|
if (this.detachTo)
|
|
6943
6954
|
this.insertTooltip();
|
|
6944
6955
|
if (this.modelValue)
|