wave-ui 2.30.0 → 2.31.3
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/README.md +3 -3
- package/dist/wave-ui.cjs.js +1 -1
- package/dist/wave-ui.css +1 -1
- package/dist/wave-ui.es.js +226 -170
- package/dist/wave-ui.umd.js +1 -1
- package/package.json +13 -10
- package/src/wave-ui/components/w-confirm.vue +1 -1
- package/src/wave-ui/components/w-input.vue +111 -32
- package/src/wave-ui/components/w-menu.vue +24 -83
- package/src/wave-ui/components/w-notification-manager.vue +9 -2
- package/src/wave-ui/components/w-progress.vue +4 -1
- package/src/wave-ui/components/w-rating.vue +1 -1
- package/src/wave-ui/components/w-select.vue +1 -1
- package/src/wave-ui/components/w-spinner.vue +2 -2
- package/src/wave-ui/components/w-table.vue +2 -2
- package/src/wave-ui/components/w-tooltip.vue +22 -75
- package/src/wave-ui/core.js +0 -8
- package/src/wave-ui/mixins/detachable.js +134 -2
- package/src/wave-ui/scss/_mixins.scss +5 -8
package/dist/wave-ui.es.js
CHANGED
|
@@ -447,9 +447,6 @@ const _WaveUI = class {
|
|
|
447
447
|
app.use(_WaveUI);
|
|
448
448
|
notificationManager = reactive(new NotificationManager$1());
|
|
449
449
|
mergeConfig(options);
|
|
450
|
-
if (config.disableColorShades) {
|
|
451
|
-
consoleWarn("WARNING - Since version 1.30 (Vue 2) & 2.17 (Vue 3), the option `disableColorShades` is replaced with `css.colorShades`.\nhttps://antoniandre.github.io/wave-ui/release-notes");
|
|
452
|
-
}
|
|
453
450
|
if (config.css.colorShades) {
|
|
454
451
|
config.colorShades = {};
|
|
455
452
|
for (let color in config.colors) {
|
|
@@ -500,7 +497,7 @@ let WaveUI = _WaveUI;
|
|
|
500
497
|
__publicField(WaveUI, "instance", null);
|
|
501
498
|
__publicField(WaveUI, "vueInstance", null);
|
|
502
499
|
WaveUI.version = "__VERSION__";
|
|
503
|
-
const _hoisted_1$
|
|
500
|
+
const _hoisted_1$u = ["aria-expanded"];
|
|
504
501
|
const _hoisted_2$e = ["onClick", "onFocus", "onKeypress", "tabindex"];
|
|
505
502
|
const _hoisted_3$b = ["innerHTML"];
|
|
506
503
|
const _hoisted_4$a = ["innerHTML"];
|
|
@@ -585,7 +582,7 @@ function render$O(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
585
582
|
]),
|
|
586
583
|
_: 2
|
|
587
584
|
}, 1024)
|
|
588
|
-
], 10, _hoisted_1$
|
|
585
|
+
], 10, _hoisted_1$u);
|
|
589
586
|
}), 128))
|
|
590
587
|
], 2);
|
|
591
588
|
}
|
|
@@ -670,7 +667,7 @@ const _sfc_main$O = {
|
|
|
670
667
|
}
|
|
671
668
|
};
|
|
672
669
|
var wAccordion = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", render$O]]);
|
|
673
|
-
const _hoisted_1$
|
|
670
|
+
const _hoisted_1$t = { class: "w-alert__content" };
|
|
674
671
|
function render$N(_ctx, _cache, $props, $setup, $data, $options) {
|
|
675
672
|
const _component_w_icon = resolveComponent("w-icon");
|
|
676
673
|
const _component_w_button = resolveComponent("w-button");
|
|
@@ -688,7 +685,7 @@ function render$N(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
688
685
|
]),
|
|
689
686
|
_: 1
|
|
690
687
|
})) : createCommentVNode("", true),
|
|
691
|
-
createElementVNode("div", _hoisted_1$
|
|
688
|
+
createElementVNode("div", _hoisted_1$t, [
|
|
692
689
|
renderSlot(_ctx.$slots, "default")
|
|
693
690
|
]),
|
|
694
691
|
$props.dismiss ? (openBlock(), createBlock(_component_w_button, {
|
|
@@ -785,6 +782,7 @@ const _sfc_main$N = {
|
|
|
785
782
|
}
|
|
786
783
|
};
|
|
787
784
|
var wAlert = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["render", render$N]]);
|
|
785
|
+
const _hoisted_1$s = ["innerHTML"];
|
|
788
786
|
function render$M(_ctx, _cache, $props, $setup, $data, $options) {
|
|
789
787
|
const _component_w_alert = resolveComponent("w-alert");
|
|
790
788
|
return openBlock(), createBlock(TransitionGroup, {
|
|
@@ -803,9 +801,11 @@ function render$M(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
803
801
|
modelValue: notif._value,
|
|
804
802
|
"onUpdate:modelValue": ($event) => notif._value = $event,
|
|
805
803
|
onClose: ($event) => _ctx.notifManager.dismiss(notif._uid)
|
|
806
|
-
}, notif), {
|
|
804
|
+
}, $options.notifProps(notif)), {
|
|
807
805
|
default: withCtx(() => [
|
|
808
|
-
|
|
806
|
+
createElementVNode("div", {
|
|
807
|
+
innerHTML: notif.message
|
|
808
|
+
}, null, 8, _hoisted_1$s)
|
|
809
809
|
]),
|
|
810
810
|
_: 2
|
|
811
811
|
}, 1040, ["modelValue", "onUpdate:modelValue", "onClose"])) : createCommentVNode("", true)
|
|
@@ -833,6 +833,12 @@ const _sfc_main$M = {
|
|
|
833
833
|
return this.conf.transition ? this.conf.transition.replace("default", `slide-${this.conf.align === "left" ? "right" : "left"}`) : "";
|
|
834
834
|
}
|
|
835
835
|
},
|
|
836
|
+
methods: {
|
|
837
|
+
notifProps(notif) {
|
|
838
|
+
const _a = notif, { _value, _uid, message, timeout } = _a, props = __objRest(_a, ["_value", "_uid", "message", "timeout"]);
|
|
839
|
+
return props;
|
|
840
|
+
}
|
|
841
|
+
},
|
|
836
842
|
created() {
|
|
837
843
|
this.notifManager = new NotificationManager$1();
|
|
838
844
|
},
|
|
@@ -1766,7 +1772,7 @@ function render$E(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1766
1772
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.showPopup = $event)
|
|
1767
1773
|
}, $options.wMenuProps), {
|
|
1768
1774
|
activator: withCtx(({ on }) => [
|
|
1769
|
-
createVNode(_component_w_button, mergeProps({ class: "w-confirm__button" },
|
|
1775
|
+
createVNode(_component_w_button, mergeProps({ class: "w-confirm__button" }, __spreadValues(__spreadValues(__spreadValues({}, _ctx.$attrs), $options.buttonProps), on)), {
|
|
1770
1776
|
default: withCtx(() => [
|
|
1771
1777
|
renderSlot(_ctx.$slots, "default")
|
|
1772
1778
|
]),
|
|
@@ -2843,7 +2849,7 @@ const _hoisted_1$i = ["name"];
|
|
|
2843
2849
|
const _hoisted_2$a = ["for"];
|
|
2844
2850
|
const _hoisted_3$9 = ["for", "innerHTML"];
|
|
2845
2851
|
const _hoisted_4$8 = ["id", "type", "name", "placeholder", "step", "min", "max", "minlength", "maxlength", "readonly", "aria-readonly", "disabled", "required", "tabindex"];
|
|
2846
|
-
const _hoisted_5$7 = ["id", "name", "multiple"];
|
|
2852
|
+
const _hoisted_5$7 = ["id", "name", "multiple", "data-progress"];
|
|
2847
2853
|
const _hoisted_6$4 = {
|
|
2848
2854
|
class: "w-input__no-file",
|
|
2849
2855
|
key: "no-file"
|
|
@@ -2880,16 +2886,16 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2880
2886
|
$props.labelPosition === "left" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2881
2887
|
_ctx.$slots.default ? (openBlock(), createElementBlock("label", {
|
|
2882
2888
|
key: 0,
|
|
2883
|
-
class: "w-input__label w-input__label--left w-form-el-shakable",
|
|
2889
|
+
class: normalizeClass(["w-input__label w-input__label--left w-form-el-shakable", $options.validationClasses]),
|
|
2884
2890
|
for: `w-input--${_ctx._.uid}`
|
|
2885
2891
|
}, [
|
|
2886
2892
|
renderSlot(_ctx.$slots, "default")
|
|
2887
|
-
],
|
|
2893
|
+
], 10, _hoisted_2$a)) : $props.label ? (openBlock(), createElementBlock("label", {
|
|
2888
2894
|
key: 1,
|
|
2889
|
-
class: "w-input__label w-input__label--left w-form-el-shakable",
|
|
2895
|
+
class: normalizeClass(["w-input__label w-input__label--left w-form-el-shakable", $options.validationClasses]),
|
|
2890
2896
|
for: `w-input--${_ctx._.uid}`,
|
|
2891
2897
|
innerHTML: $props.label
|
|
2892
|
-
}, null,
|
|
2898
|
+
}, null, 10, _hoisted_3$9)) : createCommentVNode("", true)
|
|
2893
2899
|
], 64)) : createCommentVNode("", true),
|
|
2894
2900
|
createElementVNode("div", {
|
|
2895
2901
|
class: normalizeClass(["w-input__input-wrap", $options.inputWrapClasses])
|
|
@@ -2941,7 +2947,9 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2941
2947
|
onBlur: _cache[7] || (_cache[7] = (...args) => $options.onBlur && $options.onBlur(...args)),
|
|
2942
2948
|
onChange: _cache[8] || (_cache[8] = (...args) => $options.onFileChange && $options.onFileChange(...args)),
|
|
2943
2949
|
multiple: $props.multiple || null
|
|
2944
|
-
}, $options.attrs
|
|
2950
|
+
}, $options.attrs, {
|
|
2951
|
+
"data-progress": $options.overallFilesProgress
|
|
2952
|
+
}), null, 16, _hoisted_5$7),
|
|
2945
2953
|
createVNode(TransitionGroup, {
|
|
2946
2954
|
class: "w-input__input w-input__input--file",
|
|
2947
2955
|
tag: "label",
|
|
@@ -2965,7 +2973,7 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2965
2973
|
class: "filename",
|
|
2966
2974
|
key: `${i}b`
|
|
2967
2975
|
}, toDisplayString(file.base), 1)),
|
|
2968
|
-
createTextVNode(toDisplayString(file.extension), 1)
|
|
2976
|
+
createTextVNode(toDisplayString(file.extension ? `.${file.extension}` : ""), 1)
|
|
2969
2977
|
]);
|
|
2970
2978
|
}), 128))
|
|
2971
2979
|
]),
|
|
@@ -2975,13 +2983,13 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2975
2983
|
$props.labelPosition === "inside" && $options.showLabelInside ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
2976
2984
|
_ctx.$slots.default ? (openBlock(), createElementBlock("label", {
|
|
2977
2985
|
key: 0,
|
|
2978
|
-
class: normalizeClass(["w-input__label w-input__label--inside w-form-el-shakable", $
|
|
2986
|
+
class: normalizeClass(["w-input__label w-input__label--inside w-form-el-shakable", $options.validationClasses]),
|
|
2979
2987
|
for: `w-input--${_ctx._.uid}`
|
|
2980
2988
|
}, [
|
|
2981
2989
|
renderSlot(_ctx.$slots, "default")
|
|
2982
2990
|
], 10, _hoisted_8$3)) : $props.label ? (openBlock(), createElementBlock("label", {
|
|
2983
2991
|
key: 1,
|
|
2984
|
-
class: normalizeClass(["w-input__label w-input__label--inside w-form-el-shakable", $
|
|
2992
|
+
class: normalizeClass(["w-input__label w-input__label--inside w-form-el-shakable", $options.validationClasses]),
|
|
2985
2993
|
for: `w-input--${_ctx._.uid}`,
|
|
2986
2994
|
innerHTML: $props.label
|
|
2987
2995
|
}, null, 10, _hoisted_9$3)) : createCommentVNode("", true)
|
|
@@ -2997,9 +3005,16 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2997
3005
|
createTextVNode(toDisplayString($props.innerIconRight), 1)
|
|
2998
3006
|
]),
|
|
2999
3007
|
_: 1
|
|
3000
|
-
}, 8, ["for"])) : createCommentVNode("", true)
|
|
3008
|
+
}, 8, ["for"])) : createCommentVNode("", true),
|
|
3009
|
+
$options.hasLoading || $props.showProgress && ($options.uploadInProgress || $options.uploadComplete) ? (openBlock(), createBlock(_component_w_progress, {
|
|
3010
|
+
key: 5,
|
|
3011
|
+
class: "fill-width",
|
|
3012
|
+
size: "2",
|
|
3013
|
+
color: $props.progressColor || $props.color,
|
|
3014
|
+
"model-value": $props.showProgress ? ($options.uploadInProgress || $options.uploadComplete) && $options.overallFilesProgress : $options.loadingValue
|
|
3015
|
+
}, null, 8, ["color", "model-value"])) : createCommentVNode("", true)
|
|
3001
3016
|
], 2),
|
|
3002
|
-
$props.type === "file" && $data.inputFiles.length ? (openBlock(), createElementBlock("label", {
|
|
3017
|
+
$props.type === "file" && $props.preview && $data.inputFiles.length ? (openBlock(), createElementBlock("label", {
|
|
3003
3018
|
key: 1,
|
|
3004
3019
|
class: "d-flex",
|
|
3005
3020
|
for: `w-input--${_ctx._.uid}`
|
|
@@ -3015,32 +3030,26 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3015
3030
|
src: file.preview,
|
|
3016
3031
|
alt: ""
|
|
3017
3032
|
}, null, 8, _hoisted_11$2)) : (openBlock(), createElementBlock("i", {
|
|
3018
|
-
class: "w-icon
|
|
3033
|
+
class: normalizeClass(["w-icon w-input__file-preview primary size--md", $props.preview && typeof $props.preview === "string" ? $props.preview : "wi-file"]),
|
|
3019
3034
|
key: `${i}c`
|
|
3020
|
-
}))
|
|
3035
|
+
}, null, 2))
|
|
3021
3036
|
], 64);
|
|
3022
3037
|
}), 256))
|
|
3023
3038
|
], 8, _hoisted_10$3)) : createCommentVNode("", true),
|
|
3024
3039
|
$props.labelPosition === "right" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
3025
3040
|
_ctx.$slots.default ? (openBlock(), createElementBlock("label", {
|
|
3026
3041
|
key: 0,
|
|
3027
|
-
class: "w-input__label w-input__label--right w-form-el-shakable",
|
|
3042
|
+
class: normalizeClass(["w-input__label w-input__label--right w-form-el-shakable", $options.validationClasses]),
|
|
3028
3043
|
for: `w-input--${_ctx._.uid}`
|
|
3029
3044
|
}, [
|
|
3030
3045
|
renderSlot(_ctx.$slots, "default")
|
|
3031
|
-
],
|
|
3046
|
+
], 10, _hoisted_12$1)) : $props.label ? (openBlock(), createElementBlock("label", {
|
|
3032
3047
|
key: 1,
|
|
3033
|
-
class: "w-input__label w-input__label--right w-form-el-shakable",
|
|
3048
|
+
class: normalizeClass(["w-input__label w-input__label--right w-form-el-shakable", $options.validationClasses]),
|
|
3034
3049
|
for: `w-input--${_ctx._.uid}`,
|
|
3035
3050
|
innerHTML: $props.label
|
|
3036
|
-
}, null,
|
|
3037
|
-
], 64)) : createCommentVNode("", true)
|
|
3038
|
-
$props.loading ? (openBlock(), createBlock(_component_w_progress, {
|
|
3039
|
-
key: 3,
|
|
3040
|
-
class: "fill-width",
|
|
3041
|
-
size: "2",
|
|
3042
|
-
color: $props.progressColor || $props.color
|
|
3043
|
-
}, null, 8, ["color"])) : createCommentVNode("", true)
|
|
3051
|
+
}, null, 10, _hoisted_13$1)) : createCommentVNode("", true)
|
|
3052
|
+
], 64)) : createCommentVNode("", true)
|
|
3044
3053
|
], 64))
|
|
3045
3054
|
]),
|
|
3046
3055
|
_: 3
|
|
@@ -3073,10 +3082,12 @@ const _sfc_main$u = {
|
|
|
3073
3082
|
shadow: { type: Boolean },
|
|
3074
3083
|
tile: { type: Boolean },
|
|
3075
3084
|
multiple: { type: Boolean },
|
|
3076
|
-
preview: { type: Boolean },
|
|
3077
|
-
loading: { type: Boolean }
|
|
3085
|
+
preview: { type: [Boolean, String], default: true },
|
|
3086
|
+
loading: { type: [Boolean, Number], default: false },
|
|
3087
|
+
showProgress: { type: [Boolean] },
|
|
3088
|
+
files: { type: Array }
|
|
3078
3089
|
},
|
|
3079
|
-
emits: ["input", "update:modelValue", "focus", "blur", "click:inner-icon-left", "click:inner-icon-right"],
|
|
3090
|
+
emits: ["input", "update:modelValue", "focus", "blur", "click:inner-icon-left", "click:inner-icon-right", "update:overallProgress"],
|
|
3080
3091
|
data() {
|
|
3081
3092
|
return {
|
|
3082
3093
|
inputValue: this.modelValue,
|
|
@@ -3101,14 +3112,48 @@ const _sfc_main$u = {
|
|
|
3101
3112
|
return htmlAttrs;
|
|
3102
3113
|
},
|
|
3103
3114
|
hasValue() {
|
|
3104
|
-
|
|
3115
|
+
switch (this.type) {
|
|
3116
|
+
case "file":
|
|
3117
|
+
return !!this.inputFiles.length;
|
|
3118
|
+
case "number":
|
|
3119
|
+
return this.inputValue || this.inputValue === 0 || this.inputNumberError;
|
|
3120
|
+
case "date":
|
|
3121
|
+
case "time":
|
|
3122
|
+
return true;
|
|
3123
|
+
default:
|
|
3124
|
+
return this.inputValue || this.inputValue === 0;
|
|
3125
|
+
}
|
|
3105
3126
|
},
|
|
3106
3127
|
hasLabel() {
|
|
3107
3128
|
return this.label || this.$slots.default;
|
|
3108
3129
|
},
|
|
3130
|
+
hasLoading() {
|
|
3131
|
+
return ![void 0, false].includes(this.loading);
|
|
3132
|
+
},
|
|
3133
|
+
loadingValue() {
|
|
3134
|
+
let value;
|
|
3135
|
+
if (typeof this.loading === "number")
|
|
3136
|
+
value = this.loading;
|
|
3137
|
+
else if (this.loading) {
|
|
3138
|
+
value = this.type === "file" && this.overallFilesProgress ? this.overallFilesProgress : void 0;
|
|
3139
|
+
}
|
|
3140
|
+
return value;
|
|
3141
|
+
},
|
|
3109
3142
|
showLabelInside() {
|
|
3110
3143
|
return !this.staticLabel || !this.hasValue && !this.placeholder;
|
|
3111
3144
|
},
|
|
3145
|
+
overallFilesProgress() {
|
|
3146
|
+
const progress = this.inputFiles.reduce((total2, file) => total2 + file.progress, 0);
|
|
3147
|
+
const total = progress / this.inputFiles.length;
|
|
3148
|
+
this.$emit("update:overallProgress", this.inputFiles.length ? total : void 0);
|
|
3149
|
+
return total;
|
|
3150
|
+
},
|
|
3151
|
+
uploadInProgress() {
|
|
3152
|
+
return this.overallFilesProgress > 0 && this.overallFilesProgress < 100;
|
|
3153
|
+
},
|
|
3154
|
+
uploadComplete() {
|
|
3155
|
+
return this.overallFilesProgress === 100;
|
|
3156
|
+
},
|
|
3112
3157
|
classes() {
|
|
3113
3158
|
return {
|
|
3114
3159
|
"w-input": true,
|
|
@@ -3125,6 +3170,11 @@ const _sfc_main$u = {
|
|
|
3125
3170
|
"w-input--inner-icon-right": this.innerIconRight
|
|
3126
3171
|
};
|
|
3127
3172
|
},
|
|
3173
|
+
validationClasses() {
|
|
3174
|
+
return this.isFocused && {
|
|
3175
|
+
[this.valid === false ? "error" : this.color]: this.color || this.valid === false
|
|
3176
|
+
};
|
|
3177
|
+
},
|
|
3128
3178
|
inputWrapClasses() {
|
|
3129
3179
|
return {
|
|
3130
3180
|
[this.valid === false ? "error" : this.color]: this.color || this.valid === false,
|
|
@@ -3136,7 +3186,8 @@ const _sfc_main$u = {
|
|
|
3136
3186
|
"w-input__input-wrap--underline": !this.outline,
|
|
3137
3187
|
"w-input__input-wrap--shadow": this.shadow,
|
|
3138
3188
|
"w-input__input-wrap--no-padding": !this.outline && !this.bgColor && !this.shadow && !this.round,
|
|
3139
|
-
"w-input__input-wrap--loading": this.loading
|
|
3189
|
+
"w-input__input-wrap--loading": this.loading || this.showProgress && this.uploadInProgress,
|
|
3190
|
+
"w-input__input-wrap--upload-complete": this.uploadComplete
|
|
3140
3191
|
};
|
|
3141
3192
|
}
|
|
3142
3193
|
},
|
|
@@ -3156,31 +3207,34 @@ const _sfc_main$u = {
|
|
|
3156
3207
|
},
|
|
3157
3208
|
onFileChange(e) {
|
|
3158
3209
|
this.inputFiles = [...e.target.files].map((original) => {
|
|
3159
|
-
const [, base, extension] = original.name.match(/^(
|
|
3210
|
+
const [, base = "", extension = "", full = ""] = original.name.match(/^(.*?)\.([^.]*)$|(.*)/);
|
|
3160
3211
|
const file = reactive({
|
|
3161
3212
|
name: original.name,
|
|
3162
|
-
base,
|
|
3213
|
+
base: base || full,
|
|
3163
3214
|
extension,
|
|
3164
3215
|
type: original.type,
|
|
3165
3216
|
size: original.size,
|
|
3166
3217
|
lastModified: original.lastModified,
|
|
3167
3218
|
preview: null,
|
|
3168
|
-
progress: 0
|
|
3219
|
+
progress: 0,
|
|
3220
|
+
file: original
|
|
3169
3221
|
});
|
|
3170
|
-
this.
|
|
3222
|
+
this.readFile(original, file);
|
|
3171
3223
|
return file;
|
|
3172
3224
|
});
|
|
3173
3225
|
this.$emit("update:modelValue", this.inputFiles);
|
|
3174
3226
|
this.$emit("input", this.inputFiles);
|
|
3175
|
-
this.$emit("change", this.inputFiles);
|
|
3176
3227
|
},
|
|
3177
|
-
|
|
3228
|
+
readFile(original, file) {
|
|
3178
3229
|
const reader = new FileReader();
|
|
3179
|
-
|
|
3230
|
+
const isPreviewAnIcon = typeof this.preview === "string";
|
|
3231
|
+
const isFileAnImage = original.type && original.type.startsWith("image/");
|
|
3232
|
+
if (this.preview && !isPreviewAnIcon && isFileAnImage) {
|
|
3180
3233
|
reader.addEventListener("load", (e) => {
|
|
3181
3234
|
file.preview = e.target.result;
|
|
3182
3235
|
});
|
|
3183
|
-
}
|
|
3236
|
+
} else
|
|
3237
|
+
delete file.preview;
|
|
3184
3238
|
reader.addEventListener("progress", (e) => {
|
|
3185
3239
|
if (e.loaded && e.total)
|
|
3186
3240
|
file.progress = e.loaded * 100 / e.total;
|
|
@@ -3536,6 +3590,25 @@ const _sfc_main$t = {
|
|
|
3536
3590
|
};
|
|
3537
3591
|
var wList = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", render$t]]);
|
|
3538
3592
|
var DetachableMixin = {
|
|
3593
|
+
props: {
|
|
3594
|
+
detachTo: { type: [String, Boolean, Object], deprecated: true },
|
|
3595
|
+
appendTo: { type: [String, Boolean, Object] },
|
|
3596
|
+
fixed: { type: Boolean },
|
|
3597
|
+
top: { type: Boolean },
|
|
3598
|
+
bottom: { type: Boolean },
|
|
3599
|
+
left: { type: Boolean },
|
|
3600
|
+
right: { type: Boolean },
|
|
3601
|
+
alignTop: { type: Boolean },
|
|
3602
|
+
alignBottom: { type: Boolean },
|
|
3603
|
+
alignLeft: { type: Boolean },
|
|
3604
|
+
alignRight: { type: Boolean },
|
|
3605
|
+
noPosition: { type: Boolean },
|
|
3606
|
+
zIndex: { type: [Number, String, Boolean] },
|
|
3607
|
+
activator: { type: String }
|
|
3608
|
+
},
|
|
3609
|
+
data: () => ({
|
|
3610
|
+
docAEventListenersHandlers: []
|
|
3611
|
+
}),
|
|
3539
3612
|
computed: {
|
|
3540
3613
|
appendToTarget() {
|
|
3541
3614
|
const defaultTarget = ".w-app";
|
|
@@ -3563,6 +3636,24 @@ var DetachableMixin = {
|
|
|
3563
3636
|
},
|
|
3564
3637
|
detachableParentEl() {
|
|
3565
3638
|
return this.appendToTarget;
|
|
3639
|
+
},
|
|
3640
|
+
hasSeparateActivator() {
|
|
3641
|
+
return !this.$slots.activator && typeof this.activator === "string";
|
|
3642
|
+
},
|
|
3643
|
+
activatorEl: {
|
|
3644
|
+
get() {
|
|
3645
|
+
if (this.hasSeparateActivator)
|
|
3646
|
+
return document.querySelector(this.activator);
|
|
3647
|
+
return this.$el.firstElementChild;
|
|
3648
|
+
},
|
|
3649
|
+
set() {
|
|
3650
|
+
}
|
|
3651
|
+
},
|
|
3652
|
+
position() {
|
|
3653
|
+
return this.top && "top" || this.bottom && "bottom" || this.left && "left" || this.right && "right" || "bottom";
|
|
3654
|
+
},
|
|
3655
|
+
alignment() {
|
|
3656
|
+
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" || "";
|
|
3566
3657
|
}
|
|
3567
3658
|
},
|
|
3568
3659
|
methods: {
|
|
@@ -3643,14 +3734,72 @@ var DetachableMixin = {
|
|
|
3643
3734
|
this.$nextTick(() => {
|
|
3644
3735
|
var _a;
|
|
3645
3736
|
this.detachableEl = ((_a = this.$refs.detachable) == null ? void 0 : _a.$el) || this.$refs.detachable;
|
|
3646
|
-
|
|
3737
|
+
if (this.detachableEl)
|
|
3738
|
+
this.appendToTarget.appendChild(this.detachableEl);
|
|
3647
3739
|
resolve();
|
|
3648
3740
|
});
|
|
3649
3741
|
});
|
|
3650
3742
|
},
|
|
3651
3743
|
removeFromDOM() {
|
|
3652
|
-
|
|
3744
|
+
document.removeEventListener("mousedown", this.onOutsideMousedown);
|
|
3745
|
+
window.removeEventListener("resize", this.onResize);
|
|
3746
|
+
if (this.detachableEl && this.detachableEl.parentNode) {
|
|
3747
|
+
this.detachableVisible = false;
|
|
3653
3748
|
this.detachableEl.remove();
|
|
3749
|
+
this.detachableEl = null;
|
|
3750
|
+
}
|
|
3751
|
+
}
|
|
3752
|
+
},
|
|
3753
|
+
mounted() {
|
|
3754
|
+
var _a;
|
|
3755
|
+
const wrapper = this.$el;
|
|
3756
|
+
if (this.$slots.activator)
|
|
3757
|
+
wrapper.parentNode.insertBefore(this.activatorEl, wrapper);
|
|
3758
|
+
else if (this.activator) {
|
|
3759
|
+
Object.entries(this.activatorEventHandlers).forEach(([eventName, handler]) => {
|
|
3760
|
+
eventName = eventName.replace("mouseenter", "mouseover").replace("mouseleave", "mouseout");
|
|
3761
|
+
const handlerWrap = (e) => {
|
|
3762
|
+
var _a2;
|
|
3763
|
+
if (((_a2 = e.target) == null ? void 0 : _a2.matches) && e.target.matches(this.activator))
|
|
3764
|
+
handler(e);
|
|
3765
|
+
};
|
|
3766
|
+
document.addEventListener(eventName, handlerWrap);
|
|
3767
|
+
this.docAEventListenersHandlers.push({ eventName, handler: handlerWrap });
|
|
3768
|
+
});
|
|
3769
|
+
}
|
|
3770
|
+
if (this.overlay) {
|
|
3771
|
+
this.overlayEl = (_a = this.$refs.overlay) == null ? void 0 : _a.$el;
|
|
3772
|
+
wrapper.parentNode.insertBefore(this.overlayEl, wrapper);
|
|
3773
|
+
}
|
|
3774
|
+
if (this.modelValue)
|
|
3775
|
+
this.toggleMenu({ type: "click", target: this.activatorEl });
|
|
3776
|
+
},
|
|
3777
|
+
beforeUnmount() {
|
|
3778
|
+
var _a;
|
|
3779
|
+
this.close();
|
|
3780
|
+
this.removeFromDOM();
|
|
3781
|
+
if (this.docAEventListenersHandlers.length) {
|
|
3782
|
+
this.docAEventListenersHandlers.forEach(({ eventName, handler }) => {
|
|
3783
|
+
document.removeEventListener(eventName, handler);
|
|
3784
|
+
});
|
|
3785
|
+
}
|
|
3786
|
+
if (this.overlay && this.overlayEl.parentNode)
|
|
3787
|
+
this.overlayEl.remove();
|
|
3788
|
+
if (((_a = this.activatorEl) == null ? void 0 : _a.parentNode) && this.$slots.activator)
|
|
3789
|
+
this.activatorEl.remove();
|
|
3790
|
+
},
|
|
3791
|
+
watch: {
|
|
3792
|
+
modelValue(bool) {
|
|
3793
|
+
if (!!bool !== this.detachableVisible)
|
|
3794
|
+
this.toggle({ type: "click", target: this.activatorEl });
|
|
3795
|
+
},
|
|
3796
|
+
detachTo() {
|
|
3797
|
+
this.removeFromDOM();
|
|
3798
|
+
this.insertInDOM();
|
|
3799
|
+
},
|
|
3800
|
+
appendTo() {
|
|
3801
|
+
this.removeFromDOM();
|
|
3802
|
+
this.insertInDOM();
|
|
3654
3803
|
}
|
|
3655
3804
|
}
|
|
3656
3805
|
};
|
|
@@ -3717,7 +3866,7 @@ function render$s(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3717
3866
|
persistent: $props.persistent,
|
|
3718
3867
|
class: $options.overlayClasses
|
|
3719
3868
|
}, $props.overlayProps, {
|
|
3720
|
-
"z-index": (
|
|
3869
|
+
"z-index": (_ctx.zIndex || 200) - 1,
|
|
3721
3870
|
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => _ctx.detachableVisible = false)
|
|
3722
3871
|
}), null, 16, ["model-value", "persistent", "class", "z-index"])) : createCommentVNode("", true)
|
|
3723
3872
|
]);
|
|
@@ -3742,24 +3891,12 @@ const _sfc_main$s = {
|
|
|
3742
3891
|
titleClass: { type: [String, Object, Array] },
|
|
3743
3892
|
contentClass: { type: [String, Object, Array] },
|
|
3744
3893
|
arrow: { type: Boolean },
|
|
3745
|
-
detachTo: { type: [String, Boolean, Object], deprecated: true },
|
|
3746
|
-
appendTo: { type: [String, Boolean, Object] },
|
|
3747
|
-
fixed: { type: Boolean },
|
|
3748
|
-
top: { type: Boolean },
|
|
3749
|
-
bottom: { type: Boolean },
|
|
3750
|
-
left: { type: Boolean },
|
|
3751
|
-
right: { type: Boolean },
|
|
3752
|
-
alignTop: { type: Boolean },
|
|
3753
|
-
alignBottom: { type: Boolean },
|
|
3754
|
-
alignLeft: { type: Boolean },
|
|
3755
|
-
alignRight: { type: Boolean },
|
|
3756
|
-
zIndex: { type: [Number, String, Boolean] },
|
|
3757
3894
|
minWidth: { type: [Number, String] },
|
|
3758
3895
|
overlay: { type: Boolean },
|
|
3759
3896
|
overlayClass: { type: [String, Object, Array] },
|
|
3760
3897
|
overlayProps: { type: Object },
|
|
3761
3898
|
persistent: { type: Boolean },
|
|
3762
|
-
|
|
3899
|
+
delay: { type: Number }
|
|
3763
3900
|
},
|
|
3764
3901
|
emits: ["input", "update:modelValue", "open", "close"],
|
|
3765
3902
|
data: () => ({
|
|
@@ -3770,7 +3907,6 @@ const _sfc_main$s = {
|
|
|
3770
3907
|
top: 0,
|
|
3771
3908
|
left: 0
|
|
3772
3909
|
},
|
|
3773
|
-
activatorEl: null,
|
|
3774
3910
|
activatorWidth: 0,
|
|
3775
3911
|
detachableEl: null,
|
|
3776
3912
|
timeoutId: null
|
|
@@ -3779,12 +3915,6 @@ const _sfc_main$s = {
|
|
|
3779
3915
|
transitionName() {
|
|
3780
3916
|
return this.transition || "scale-fade";
|
|
3781
3917
|
},
|
|
3782
|
-
position() {
|
|
3783
|
-
return this.top && "top" || this.bottom && "bottom" || this.left && "left" || this.right && "right" || "bottom";
|
|
3784
|
-
},
|
|
3785
|
-
alignment() {
|
|
3786
|
-
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" || "";
|
|
3787
|
-
},
|
|
3788
3918
|
menuMinWidth() {
|
|
3789
3919
|
if (this.minWidth === "activator")
|
|
3790
3920
|
return this.activatorWidth ? `${this.activatorWidth}px` : 0;
|
|
@@ -3831,8 +3961,8 @@ const _sfc_main$s = {
|
|
|
3831
3961
|
let handlers = {};
|
|
3832
3962
|
if (this.showOnHover) {
|
|
3833
3963
|
handlers = {
|
|
3834
|
-
focus: this.
|
|
3835
|
-
blur: this.
|
|
3964
|
+
focus: this.toggle,
|
|
3965
|
+
blur: this.toggle,
|
|
3836
3966
|
mouseenter: (e) => {
|
|
3837
3967
|
this.hoveringActivator = true;
|
|
3838
3968
|
this.open(e);
|
|
@@ -3846,15 +3976,15 @@ const _sfc_main$s = {
|
|
|
3846
3976
|
}
|
|
3847
3977
|
};
|
|
3848
3978
|
if (typeof window !== "undefined" && "ontouchstart" in window) {
|
|
3849
|
-
handlers.click = this.
|
|
3979
|
+
handlers.click = this.toggle;
|
|
3850
3980
|
}
|
|
3851
3981
|
} else
|
|
3852
|
-
handlers = { click: this.
|
|
3982
|
+
handlers = { click: this.toggle };
|
|
3853
3983
|
return handlers;
|
|
3854
3984
|
}
|
|
3855
3985
|
},
|
|
3856
3986
|
methods: {
|
|
3857
|
-
|
|
3987
|
+
toggle(e) {
|
|
3858
3988
|
let shouldShowMenu = this.detachableVisible;
|
|
3859
3989
|
if ("ontouchstart" in window && this.showOnHover && e.type === "click") {
|
|
3860
3990
|
shouldShowMenu = !shouldShowMenu;
|
|
@@ -3868,16 +3998,17 @@ const _sfc_main$s = {
|
|
|
3868
3998
|
shouldShowMenu = false;
|
|
3869
3999
|
}
|
|
3870
4000
|
this.timeoutId = clearTimeout(this.timeoutId);
|
|
3871
|
-
if (shouldShowMenu)
|
|
3872
|
-
this.$emit("update:modelValue", this.detachableVisible = true);
|
|
3873
|
-
this.$emit("input", true);
|
|
3874
|
-
this.$emit("open");
|
|
4001
|
+
if (shouldShowMenu)
|
|
3875
4002
|
this.open(e);
|
|
3876
|
-
|
|
4003
|
+
else
|
|
3877
4004
|
this.close();
|
|
3878
4005
|
},
|
|
3879
4006
|
async open(e) {
|
|
4007
|
+
if (this.delay)
|
|
4008
|
+
await new Promise((resolve) => setTimeout(resolve, this.delay));
|
|
3880
4009
|
this.detachableVisible = true;
|
|
4010
|
+
if (this.activator)
|
|
4011
|
+
this.activatorEl = e.target;
|
|
3881
4012
|
await this.insertInDOM();
|
|
3882
4013
|
if (this.minWidth === "activator")
|
|
3883
4014
|
this.activatorWidth = this.activatorEl.offsetWidth;
|
|
@@ -3907,39 +4038,6 @@ const _sfc_main$s = {
|
|
|
3907
4038
|
document.removeEventListener("mousedown", this.onOutsideMousedown);
|
|
3908
4039
|
window.removeEventListener("resize", this.onResize);
|
|
3909
4040
|
}
|
|
3910
|
-
},
|
|
3911
|
-
mounted() {
|
|
3912
|
-
var _a;
|
|
3913
|
-
const wrapper = this.$el;
|
|
3914
|
-
this.activatorEl = wrapper.firstElementChild;
|
|
3915
|
-
wrapper.parentNode.insertBefore(this.activatorEl, wrapper);
|
|
3916
|
-
if (this.overlay) {
|
|
3917
|
-
this.overlayEl = (_a = this.$refs.overlay) == null ? void 0 : _a.$el;
|
|
3918
|
-
wrapper.parentNode.insertBefore(this.overlayEl, wrapper);
|
|
3919
|
-
}
|
|
3920
|
-
if (this.modelValue)
|
|
3921
|
-
this.toggleMenu({ type: "click", target: this.activatorEl });
|
|
3922
|
-
},
|
|
3923
|
-
beforeUnmount() {
|
|
3924
|
-
this.removeFromDOM();
|
|
3925
|
-
if (this.overlay && this.overlayEl.parentNode)
|
|
3926
|
-
this.overlayEl.remove();
|
|
3927
|
-
if (this.activatorEl && this.activatorEl.parentNode)
|
|
3928
|
-
this.activatorEl.remove();
|
|
3929
|
-
},
|
|
3930
|
-
watch: {
|
|
3931
|
-
modelValue(bool) {
|
|
3932
|
-
if (!!bool !== this.detachableVisible)
|
|
3933
|
-
this.toggleMenu({ type: "click", target: this.activatorEl });
|
|
3934
|
-
},
|
|
3935
|
-
detachTo() {
|
|
3936
|
-
this.removeFromDOM();
|
|
3937
|
-
this.insertInDOM();
|
|
3938
|
-
},
|
|
3939
|
-
appendTo() {
|
|
3940
|
-
this.removeFromDOM();
|
|
3941
|
-
this.insertInDOM();
|
|
3942
|
-
}
|
|
3943
4041
|
}
|
|
3944
4042
|
};
|
|
3945
4043
|
var wMenu = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", render$s]]);
|
|
@@ -4561,7 +4659,8 @@ const _hoisted_2$7 = ["disabled", "onMouseenter", "onClick", "tabindex"];
|
|
|
4561
4659
|
function render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4562
4660
|
return openBlock(), createBlock(resolveDynamicComponent(_ctx.formRegister ? "w-form-element" : "div"), mergeProps({ ref: "formEl" }, _ctx.formRegister && { validators: _ctx.validators, inputValue: $data.rating, disabled: _ctx.isDisabled, readonly: _ctx.isReadonly }, {
|
|
4563
4661
|
valid: _ctx.valid,
|
|
4564
|
-
|
|
4662
|
+
"onUpdate:valid": _cache[4] || (_cache[4] = ($event) => _ctx.valid = $event),
|
|
4663
|
+
onReset: _cache[5] || (_cache[5] = ($event) => {
|
|
4565
4664
|
_ctx.$emit("update:modelValue", $data.rating = null);
|
|
4566
4665
|
_ctx.$emit("input", null);
|
|
4567
4666
|
}),
|
|
@@ -5056,8 +5155,9 @@ const _sfc_main$k = {
|
|
|
5056
5155
|
openMenu() {
|
|
5057
5156
|
this.showMenu = true;
|
|
5058
5157
|
setTimeout(() => {
|
|
5158
|
+
var _a;
|
|
5059
5159
|
const itemIndex = this.inputValue.length ? this.inputValue[0].index : 0;
|
|
5060
|
-
this.$refs["w-list"].$el.querySelector(`#w-select-menu--${this._.uid}_item-${itemIndex + 1}`).focus();
|
|
5160
|
+
(_a = this.$refs["w-list"].$el.querySelector(`#w-select-menu--${this._.uid}_item-${itemIndex + 1}`)) == null ? void 0 : _a.focus();
|
|
5061
5161
|
}, 100);
|
|
5062
5162
|
},
|
|
5063
5163
|
closeMenu() {
|
|
@@ -5370,7 +5470,7 @@ const _sfc_main$j = {
|
|
|
5370
5470
|
var wSlider = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", render$j]]);
|
|
5371
5471
|
const _hoisted_1$9 = { key: 0 };
|
|
5372
5472
|
function render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5373
|
-
return $props.
|
|
5473
|
+
return $props.modelValue || $props.modelValue === void 0 ? (openBlock(), createElementBlock("div", {
|
|
5374
5474
|
key: 0,
|
|
5375
5475
|
class: normalizeClass(["w-spinner", $options.classes]),
|
|
5376
5476
|
style: normalizeStyle($options.styles)
|
|
@@ -5382,7 +5482,7 @@ var wSpinner_vue_vue_type_style_index_0_lang = "";
|
|
|
5382
5482
|
const _sfc_main$i = {
|
|
5383
5483
|
name: "w-spinner",
|
|
5384
5484
|
props: {
|
|
5385
|
-
|
|
5485
|
+
modelValue: {},
|
|
5386
5486
|
color: { type: String, default: "primary" },
|
|
5387
5487
|
xs: { type: Boolean },
|
|
5388
5488
|
sm: { type: Boolean },
|
|
@@ -6750,7 +6850,7 @@ var wToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", render$9]]);
|
|
|
6750
6850
|
const _hoisted_1 = { class: "w-tooltip-wrap" };
|
|
6751
6851
|
function render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
6752
6852
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
6753
|
-
renderSlot(_ctx.$slots, "activator", { on: $options.
|
|
6853
|
+
renderSlot(_ctx.$slots, "activator", { on: $options.activatorEventHandlers }),
|
|
6754
6854
|
createVNode(Transition, {
|
|
6755
6855
|
name: $options.transitionName,
|
|
6756
6856
|
appear: ""
|
|
@@ -6784,20 +6884,8 @@ const _sfc_main$8 = {
|
|
|
6784
6884
|
round: { type: Boolean },
|
|
6785
6885
|
transition: { type: String },
|
|
6786
6886
|
tooltipClass: { type: [String, Object, Array] },
|
|
6787
|
-
detachTo: { type: [String, Boolean, Object], deprecated: true },
|
|
6788
|
-
appendTo: { type: [String, Boolean, Object] },
|
|
6789
|
-
fixed: { type: Boolean },
|
|
6790
|
-
top: { type: Boolean },
|
|
6791
|
-
bottom: { type: Boolean },
|
|
6792
|
-
left: { type: Boolean },
|
|
6793
|
-
right: { type: Boolean },
|
|
6794
|
-
alignTop: { type: Boolean },
|
|
6795
|
-
alignBottom: { type: Boolean },
|
|
6796
|
-
alignLeft: { type: Boolean },
|
|
6797
|
-
alignRight: { type: Boolean },
|
|
6798
|
-
zIndex: { type: [Number, String, Boolean] },
|
|
6799
6887
|
persistent: { type: Boolean },
|
|
6800
|
-
|
|
6888
|
+
delay: { type: Number }
|
|
6801
6889
|
},
|
|
6802
6890
|
emits: ["input", "update:modelValue", "open", "close"],
|
|
6803
6891
|
data: () => ({
|
|
@@ -6807,7 +6895,6 @@ const _sfc_main$8 = {
|
|
|
6807
6895
|
top: 0,
|
|
6808
6896
|
left: 0
|
|
6809
6897
|
},
|
|
6810
|
-
activatorEl: null,
|
|
6811
6898
|
detachableEl: null,
|
|
6812
6899
|
timeoutId: null
|
|
6813
6900
|
}),
|
|
@@ -6819,12 +6906,6 @@ const _sfc_main$8 = {
|
|
|
6819
6906
|
const direction = this.position.replace(/top|bottom/, (m) => ({ top: "up", bottom: "down" })[m]);
|
|
6820
6907
|
return this.transition || `w-tooltip-slide-fade-${direction}`;
|
|
6821
6908
|
},
|
|
6822
|
-
position() {
|
|
6823
|
-
return this.top && "top" || this.bottom && "bottom" || this.left && "left" || this.right && "right" || "bottom";
|
|
6824
|
-
},
|
|
6825
|
-
alignment() {
|
|
6826
|
-
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" || "";
|
|
6827
|
-
},
|
|
6828
6909
|
classes() {
|
|
6829
6910
|
return __spreadProps(__spreadValues({
|
|
6830
6911
|
[this.color]: this.color,
|
|
@@ -6848,7 +6929,7 @@ const _sfc_main$8 = {
|
|
|
6848
6929
|
"--w-tooltip-bg-color": this.$waveui.colors[this.bgColor || "white"]
|
|
6849
6930
|
};
|
|
6850
6931
|
},
|
|
6851
|
-
|
|
6932
|
+
activatorEventHandlers() {
|
|
6852
6933
|
let handlers = {};
|
|
6853
6934
|
if (this.showOnClick)
|
|
6854
6935
|
handlers = { click: this.toggle };
|
|
@@ -6884,16 +6965,17 @@ const _sfc_main$8 = {
|
|
|
6884
6965
|
else if (["mouseleave", "blur"].includes(e.type) && !this.showOnClick)
|
|
6885
6966
|
shouldShowTooltip = false;
|
|
6886
6967
|
this.timeoutId = clearTimeout(this.timeoutId);
|
|
6887
|
-
if (shouldShowTooltip)
|
|
6888
|
-
this.$emit("update:modelValue", this.detachableVisible = true);
|
|
6889
|
-
this.$emit("input", true);
|
|
6890
|
-
this.$emit("open");
|
|
6968
|
+
if (shouldShowTooltip)
|
|
6891
6969
|
this.open(e);
|
|
6892
|
-
|
|
6970
|
+
else
|
|
6893
6971
|
this.close();
|
|
6894
6972
|
},
|
|
6895
6973
|
async open(e) {
|
|
6974
|
+
if (this.delay)
|
|
6975
|
+
await new Promise((resolve) => setTimeout(resolve, this.delay));
|
|
6896
6976
|
this.detachableVisible = true;
|
|
6977
|
+
if (this.activator)
|
|
6978
|
+
this.activatorEl = e.target;
|
|
6897
6979
|
await this.insertInDOM();
|
|
6898
6980
|
if (this.minWidth === "activator")
|
|
6899
6981
|
this.activatorWidth = this.activatorEl.offsetWidth;
|
|
@@ -6923,32 +7005,6 @@ const _sfc_main$8 = {
|
|
|
6923
7005
|
document.removeEventListener("mousedown", this.onOutsideMousedown);
|
|
6924
7006
|
window.removeEventListener("resize", this.onResize);
|
|
6925
7007
|
}
|
|
6926
|
-
},
|
|
6927
|
-
mounted() {
|
|
6928
|
-
const wrapper = this.$el;
|
|
6929
|
-
this.activatorEl = wrapper.firstElementChild;
|
|
6930
|
-
wrapper.parentNode.insertBefore(this.activatorEl, wrapper);
|
|
6931
|
-
if (this.modelValue)
|
|
6932
|
-
this.toggle({ type: "click", target: this.activatorEl });
|
|
6933
|
-
},
|
|
6934
|
-
beforeUnmount() {
|
|
6935
|
-
this.removeFromDOM();
|
|
6936
|
-
if (this.activatorEl && this.activatorEl.parentNode)
|
|
6937
|
-
this.activatorEl.remove();
|
|
6938
|
-
},
|
|
6939
|
-
watch: {
|
|
6940
|
-
modelValue(bool) {
|
|
6941
|
-
if (bool !== this.detachableVisible)
|
|
6942
|
-
this.toggle({ type: "click", target: this.activatorEl });
|
|
6943
|
-
},
|
|
6944
|
-
detachTo() {
|
|
6945
|
-
this.removeFromDOM();
|
|
6946
|
-
this.insertInDOM();
|
|
6947
|
-
},
|
|
6948
|
-
appendTo() {
|
|
6949
|
-
this.removeFromDOM();
|
|
6950
|
-
this.insertInDOM();
|
|
6951
|
-
}
|
|
6952
7008
|
}
|
|
6953
7009
|
};
|
|
6954
7010
|
var wTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", render$8]]);
|