wave-ui 2.30.0 → 2.31.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.
@@ -500,7 +500,7 @@ let WaveUI = _WaveUI;
500
500
  __publicField(WaveUI, "instance", null);
501
501
  __publicField(WaveUI, "vueInstance", null);
502
502
  WaveUI.version = "__VERSION__";
503
- const _hoisted_1$t = ["aria-expanded"];
503
+ const _hoisted_1$u = ["aria-expanded"];
504
504
  const _hoisted_2$e = ["onClick", "onFocus", "onKeypress", "tabindex"];
505
505
  const _hoisted_3$b = ["innerHTML"];
506
506
  const _hoisted_4$a = ["innerHTML"];
@@ -585,7 +585,7 @@ function render$O(_ctx, _cache, $props, $setup, $data, $options) {
585
585
  ]),
586
586
  _: 2
587
587
  }, 1024)
588
- ], 10, _hoisted_1$t);
588
+ ], 10, _hoisted_1$u);
589
589
  }), 128))
590
590
  ], 2);
591
591
  }
@@ -670,7 +670,7 @@ const _sfc_main$O = {
670
670
  }
671
671
  };
672
672
  var wAccordion = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", render$O]]);
673
- const _hoisted_1$s = { class: "w-alert__content" };
673
+ const _hoisted_1$t = { class: "w-alert__content" };
674
674
  function render$N(_ctx, _cache, $props, $setup, $data, $options) {
675
675
  const _component_w_icon = resolveComponent("w-icon");
676
676
  const _component_w_button = resolveComponent("w-button");
@@ -688,7 +688,7 @@ function render$N(_ctx, _cache, $props, $setup, $data, $options) {
688
688
  ]),
689
689
  _: 1
690
690
  })) : createCommentVNode("", true),
691
- createElementVNode("div", _hoisted_1$s, [
691
+ createElementVNode("div", _hoisted_1$t, [
692
692
  renderSlot(_ctx.$slots, "default")
693
693
  ]),
694
694
  $props.dismiss ? (openBlock(), createBlock(_component_w_button, {
@@ -785,6 +785,7 @@ const _sfc_main$N = {
785
785
  }
786
786
  };
787
787
  var wAlert = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["render", render$N]]);
788
+ const _hoisted_1$s = ["innerHTML"];
788
789
  function render$M(_ctx, _cache, $props, $setup, $data, $options) {
789
790
  const _component_w_alert = resolveComponent("w-alert");
790
791
  return openBlock(), createBlock(TransitionGroup, {
@@ -803,9 +804,11 @@ function render$M(_ctx, _cache, $props, $setup, $data, $options) {
803
804
  modelValue: notif._value,
804
805
  "onUpdate:modelValue": ($event) => notif._value = $event,
805
806
  onClose: ($event) => _ctx.notifManager.dismiss(notif._uid)
806
- }, notif), {
807
+ }, $options.notifProps(notif)), {
807
808
  default: withCtx(() => [
808
- createTextVNode(toDisplayString(notif.message), 1)
809
+ createElementVNode("div", {
810
+ innerHTML: notif.message
811
+ }, null, 8, _hoisted_1$s)
809
812
  ]),
810
813
  _: 2
811
814
  }, 1040, ["modelValue", "onUpdate:modelValue", "onClose"])) : createCommentVNode("", true)
@@ -833,6 +836,12 @@ const _sfc_main$M = {
833
836
  return this.conf.transition ? this.conf.transition.replace("default", `slide-${this.conf.align === "left" ? "right" : "left"}`) : "";
834
837
  }
835
838
  },
839
+ methods: {
840
+ notifProps(notif) {
841
+ const _a = notif, { _value, _uid, message, timeout } = _a, props = __objRest(_a, ["_value", "_uid", "message", "timeout"]);
842
+ return props;
843
+ }
844
+ },
836
845
  created() {
837
846
  this.notifManager = new NotificationManager$1();
838
847
  },
@@ -1766,7 +1775,7 @@ function render$E(_ctx, _cache, $props, $setup, $data, $options) {
1766
1775
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.showPopup = $event)
1767
1776
  }, $options.wMenuProps), {
1768
1777
  activator: withCtx(({ on }) => [
1769
- createVNode(_component_w_button, mergeProps({ class: "w-confirm__button" }, toHandlers(__spreadValues(__spreadValues({}, _ctx.$listeners), on)), $options.buttonProps), {
1778
+ createVNode(_component_w_button, mergeProps({ class: "w-confirm__button" }, __spreadValues(__spreadValues(__spreadValues({}, _ctx.$attrs), $options.buttonProps), on)), {
1770
1779
  default: withCtx(() => [
1771
1780
  renderSlot(_ctx.$slots, "default")
1772
1781
  ]),
@@ -2843,7 +2852,7 @@ const _hoisted_1$i = ["name"];
2843
2852
  const _hoisted_2$a = ["for"];
2844
2853
  const _hoisted_3$9 = ["for", "innerHTML"];
2845
2854
  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"];
2855
+ const _hoisted_5$7 = ["id", "name", "multiple", "data-progress"];
2847
2856
  const _hoisted_6$4 = {
2848
2857
  class: "w-input__no-file",
2849
2858
  key: "no-file"
@@ -2880,16 +2889,16 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
2880
2889
  $props.labelPosition === "left" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2881
2890
  _ctx.$slots.default ? (openBlock(), createElementBlock("label", {
2882
2891
  key: 0,
2883
- class: "w-input__label w-input__label--left w-form-el-shakable",
2892
+ class: normalizeClass(["w-input__label w-input__label--left w-form-el-shakable", $options.validationClasses]),
2884
2893
  for: `w-input--${_ctx._.uid}`
2885
2894
  }, [
2886
2895
  renderSlot(_ctx.$slots, "default")
2887
- ], 8, _hoisted_2$a)) : $props.label ? (openBlock(), createElementBlock("label", {
2896
+ ], 10, _hoisted_2$a)) : $props.label ? (openBlock(), createElementBlock("label", {
2888
2897
  key: 1,
2889
- class: "w-input__label w-input__label--left w-form-el-shakable",
2898
+ class: normalizeClass(["w-input__label w-input__label--left w-form-el-shakable", $options.validationClasses]),
2890
2899
  for: `w-input--${_ctx._.uid}`,
2891
2900
  innerHTML: $props.label
2892
- }, null, 8, _hoisted_3$9)) : createCommentVNode("", true)
2901
+ }, null, 10, _hoisted_3$9)) : createCommentVNode("", true)
2893
2902
  ], 64)) : createCommentVNode("", true),
2894
2903
  createElementVNode("div", {
2895
2904
  class: normalizeClass(["w-input__input-wrap", $options.inputWrapClasses])
@@ -2941,7 +2950,9 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
2941
2950
  onBlur: _cache[7] || (_cache[7] = (...args) => $options.onBlur && $options.onBlur(...args)),
2942
2951
  onChange: _cache[8] || (_cache[8] = (...args) => $options.onFileChange && $options.onFileChange(...args)),
2943
2952
  multiple: $props.multiple || null
2944
- }, $options.attrs), null, 16, _hoisted_5$7),
2953
+ }, $options.attrs, {
2954
+ "data-progress": $options.overallFilesProgress
2955
+ }), null, 16, _hoisted_5$7),
2945
2956
  createVNode(TransitionGroup, {
2946
2957
  class: "w-input__input w-input__input--file",
2947
2958
  tag: "label",
@@ -2965,7 +2976,7 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
2965
2976
  class: "filename",
2966
2977
  key: `${i}b`
2967
2978
  }, toDisplayString(file.base), 1)),
2968
- createTextVNode(toDisplayString(file.extension), 1)
2979
+ createTextVNode(toDisplayString(file.extension ? `.${file.extension}` : ""), 1)
2969
2980
  ]);
2970
2981
  }), 128))
2971
2982
  ]),
@@ -2975,13 +2986,13 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
2975
2986
  $props.labelPosition === "inside" && $options.showLabelInside ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
2976
2987
  _ctx.$slots.default ? (openBlock(), createElementBlock("label", {
2977
2988
  key: 0,
2978
- class: normalizeClass(["w-input__label w-input__label--inside w-form-el-shakable", $data.isFocused && { [_ctx.valid === false ? "error" : $props.color]: $props.color || _ctx.valid === false }]),
2989
+ class: normalizeClass(["w-input__label w-input__label--inside w-form-el-shakable", $options.validationClasses]),
2979
2990
  for: `w-input--${_ctx._.uid}`
2980
2991
  }, [
2981
2992
  renderSlot(_ctx.$slots, "default")
2982
2993
  ], 10, _hoisted_8$3)) : $props.label ? (openBlock(), createElementBlock("label", {
2983
2994
  key: 1,
2984
- class: normalizeClass(["w-input__label w-input__label--inside w-form-el-shakable", $data.isFocused && { [_ctx.valid === false ? "error" : $props.color]: $props.color || _ctx.valid === false }]),
2995
+ class: normalizeClass(["w-input__label w-input__label--inside w-form-el-shakable", $options.validationClasses]),
2985
2996
  for: `w-input--${_ctx._.uid}`,
2986
2997
  innerHTML: $props.label
2987
2998
  }, null, 10, _hoisted_9$3)) : createCommentVNode("", true)
@@ -2997,9 +3008,16 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
2997
3008
  createTextVNode(toDisplayString($props.innerIconRight), 1)
2998
3009
  ]),
2999
3010
  _: 1
3000
- }, 8, ["for"])) : createCommentVNode("", true)
3011
+ }, 8, ["for"])) : createCommentVNode("", true),
3012
+ $options.hasLoading || $props.showProgress && ($options.uploadInProgress || $options.uploadComplete) ? (openBlock(), createBlock(_component_w_progress, {
3013
+ key: 5,
3014
+ class: "fill-width",
3015
+ size: "2",
3016
+ color: $props.progressColor || $props.color,
3017
+ "model-value": $props.showProgress ? ($options.uploadInProgress || $options.uploadComplete) && $options.overallFilesProgress : $options.loadingValue
3018
+ }, null, 8, ["color", "model-value"])) : createCommentVNode("", true)
3001
3019
  ], 2),
3002
- $props.type === "file" && $data.inputFiles.length ? (openBlock(), createElementBlock("label", {
3020
+ $props.type === "file" && $props.preview && $data.inputFiles.length ? (openBlock(), createElementBlock("label", {
3003
3021
  key: 1,
3004
3022
  class: "d-flex",
3005
3023
  for: `w-input--${_ctx._.uid}`
@@ -3015,32 +3033,26 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
3015
3033
  src: file.preview,
3016
3034
  alt: ""
3017
3035
  }, null, 8, _hoisted_11$2)) : (openBlock(), createElementBlock("i", {
3018
- class: "w-icon wi-file w-input__file-preview primary",
3036
+ class: normalizeClass(["w-icon w-input__file-preview primary size--md", $props.preview && typeof $props.preview === "string" ? $props.preview : "wi-file"]),
3019
3037
  key: `${i}c`
3020
- }))
3038
+ }, null, 2))
3021
3039
  ], 64);
3022
3040
  }), 256))
3023
3041
  ], 8, _hoisted_10$3)) : createCommentVNode("", true),
3024
3042
  $props.labelPosition === "right" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
3025
3043
  _ctx.$slots.default ? (openBlock(), createElementBlock("label", {
3026
3044
  key: 0,
3027
- class: "w-input__label w-input__label--right w-form-el-shakable",
3045
+ class: normalizeClass(["w-input__label w-input__label--right w-form-el-shakable", $options.validationClasses]),
3028
3046
  for: `w-input--${_ctx._.uid}`
3029
3047
  }, [
3030
3048
  renderSlot(_ctx.$slots, "default")
3031
- ], 8, _hoisted_12$1)) : $props.label ? (openBlock(), createElementBlock("label", {
3049
+ ], 10, _hoisted_12$1)) : $props.label ? (openBlock(), createElementBlock("label", {
3032
3050
  key: 1,
3033
- class: "w-input__label w-input__label--right w-form-el-shakable",
3051
+ class: normalizeClass(["w-input__label w-input__label--right w-form-el-shakable", $options.validationClasses]),
3034
3052
  for: `w-input--${_ctx._.uid}`,
3035
3053
  innerHTML: $props.label
3036
- }, null, 8, _hoisted_13$1)) : createCommentVNode("", true)
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)
3054
+ }, null, 10, _hoisted_13$1)) : createCommentVNode("", true)
3055
+ ], 64)) : createCommentVNode("", true)
3044
3056
  ], 64))
3045
3057
  ]),
3046
3058
  _: 3
@@ -3073,10 +3085,12 @@ const _sfc_main$u = {
3073
3085
  shadow: { type: Boolean },
3074
3086
  tile: { type: Boolean },
3075
3087
  multiple: { type: Boolean },
3076
- preview: { type: Boolean },
3077
- loading: { type: Boolean }
3088
+ preview: { type: [Boolean, String], default: true },
3089
+ loading: { type: [Boolean, Number], default: false },
3090
+ showProgress: { type: [Boolean] },
3091
+ files: { type: Array }
3078
3092
  },
3079
- emits: ["input", "update:modelValue", "focus", "blur", "click:inner-icon-left", "click:inner-icon-right"],
3093
+ emits: ["input", "update:modelValue", "focus", "blur", "click:inner-icon-left", "click:inner-icon-right", "update:overallProgress"],
3080
3094
  data() {
3081
3095
  return {
3082
3096
  inputValue: this.modelValue,
@@ -3101,14 +3115,48 @@ const _sfc_main$u = {
3101
3115
  return htmlAttrs;
3102
3116
  },
3103
3117
  hasValue() {
3104
- return this.inputValue || this.inputValue === 0 || ["date", "time"].includes(this.type) || this.type === "number" && this.inputNumberError || this.type === "file" && this.inputFiles.length;
3118
+ switch (this.type) {
3119
+ case "file":
3120
+ return !!this.inputFiles.length;
3121
+ case "number":
3122
+ return this.inputNumberError;
3123
+ case "date":
3124
+ case "time":
3125
+ return true;
3126
+ default:
3127
+ return this.inputValue || this.inputValue === 0;
3128
+ }
3105
3129
  },
3106
3130
  hasLabel() {
3107
3131
  return this.label || this.$slots.default;
3108
3132
  },
3133
+ hasLoading() {
3134
+ return ![void 0, false].includes(this.loading);
3135
+ },
3136
+ loadingValue() {
3137
+ let value;
3138
+ if (typeof this.loading === "number")
3139
+ value = this.loading;
3140
+ else if (this.loading) {
3141
+ value = this.type === "file" && this.overallFilesProgress ? this.overallFilesProgress : void 0;
3142
+ }
3143
+ return value;
3144
+ },
3109
3145
  showLabelInside() {
3110
3146
  return !this.staticLabel || !this.hasValue && !this.placeholder;
3111
3147
  },
3148
+ overallFilesProgress() {
3149
+ const progress = this.inputFiles.reduce((total2, file) => total2 + file.progress, 0);
3150
+ const total = progress / this.inputFiles.length;
3151
+ this.$emit("update:overallProgress", this.inputFiles.length ? total : void 0);
3152
+ return total;
3153
+ },
3154
+ uploadInProgress() {
3155
+ return this.overallFilesProgress > 0 && this.overallFilesProgress < 100;
3156
+ },
3157
+ uploadComplete() {
3158
+ return this.overallFilesProgress === 100;
3159
+ },
3112
3160
  classes() {
3113
3161
  return {
3114
3162
  "w-input": true,
@@ -3125,6 +3173,11 @@ const _sfc_main$u = {
3125
3173
  "w-input--inner-icon-right": this.innerIconRight
3126
3174
  };
3127
3175
  },
3176
+ validationClasses() {
3177
+ return this.isFocused && {
3178
+ [this.valid === false ? "error" : this.color]: this.color || this.valid === false
3179
+ };
3180
+ },
3128
3181
  inputWrapClasses() {
3129
3182
  return {
3130
3183
  [this.valid === false ? "error" : this.color]: this.color || this.valid === false,
@@ -3136,7 +3189,8 @@ const _sfc_main$u = {
3136
3189
  "w-input__input-wrap--underline": !this.outline,
3137
3190
  "w-input__input-wrap--shadow": this.shadow,
3138
3191
  "w-input__input-wrap--no-padding": !this.outline && !this.bgColor && !this.shadow && !this.round,
3139
- "w-input__input-wrap--loading": this.loading
3192
+ "w-input__input-wrap--loading": this.loading || this.showProgress && this.uploadInProgress,
3193
+ "w-input__input-wrap--upload-complete": this.uploadComplete
3140
3194
  };
3141
3195
  }
3142
3196
  },
@@ -3156,31 +3210,34 @@ const _sfc_main$u = {
3156
3210
  },
3157
3211
  onFileChange(e) {
3158
3212
  this.inputFiles = [...e.target.files].map((original) => {
3159
- const [, base, extension] = original.name.match(/^(.*)(\..*?)$/);
3213
+ const [, base = "", extension = "", full = ""] = original.name.match(/^(.*?)\.([^.]*)$|(.*)/);
3160
3214
  const file = reactive({
3161
3215
  name: original.name,
3162
- base,
3216
+ base: base || full,
3163
3217
  extension,
3164
3218
  type: original.type,
3165
3219
  size: original.size,
3166
3220
  lastModified: original.lastModified,
3167
3221
  preview: null,
3168
- progress: 0
3222
+ progress: 0,
3223
+ file: original
3169
3224
  });
3170
- this.filePreview(original, file);
3225
+ this.readFile(original, file);
3171
3226
  return file;
3172
3227
  });
3173
3228
  this.$emit("update:modelValue", this.inputFiles);
3174
3229
  this.$emit("input", this.inputFiles);
3175
- this.$emit("change", this.inputFiles);
3176
3230
  },
3177
- filePreview(original, file) {
3231
+ readFile(original, file) {
3178
3232
  const reader = new FileReader();
3179
- if (original.type && original.type.startsWith("image/")) {
3233
+ const isPreviewAnIcon = typeof this.preview === "string";
3234
+ const isFileAnImage = original.type && original.type.startsWith("image/");
3235
+ if (this.preview && !isPreviewAnIcon && isFileAnImage) {
3180
3236
  reader.addEventListener("load", (e) => {
3181
3237
  file.preview = e.target.result;
3182
3238
  });
3183
- }
3239
+ } else
3240
+ delete file.preview;
3184
3241
  reader.addEventListener("progress", (e) => {
3185
3242
  if (e.loaded && e.total)
3186
3243
  file.progress = e.loaded * 100 / e.total;
@@ -3536,6 +3593,25 @@ const _sfc_main$t = {
3536
3593
  };
3537
3594
  var wList = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", render$t]]);
3538
3595
  var DetachableMixin = {
3596
+ props: {
3597
+ detachTo: { type: [String, Boolean, Object], deprecated: true },
3598
+ appendTo: { type: [String, Boolean, Object] },
3599
+ fixed: { type: Boolean },
3600
+ top: { type: Boolean },
3601
+ bottom: { type: Boolean },
3602
+ left: { type: Boolean },
3603
+ right: { type: Boolean },
3604
+ alignTop: { type: Boolean },
3605
+ alignBottom: { type: Boolean },
3606
+ alignLeft: { type: Boolean },
3607
+ alignRight: { type: Boolean },
3608
+ noPosition: { type: Boolean },
3609
+ zIndex: { type: [Number, String, Boolean] },
3610
+ activator: { type: String }
3611
+ },
3612
+ data: () => ({
3613
+ docAEventListenersHandlers: []
3614
+ }),
3539
3615
  computed: {
3540
3616
  appendToTarget() {
3541
3617
  const defaultTarget = ".w-app";
@@ -3563,6 +3639,24 @@ var DetachableMixin = {
3563
3639
  },
3564
3640
  detachableParentEl() {
3565
3641
  return this.appendToTarget;
3642
+ },
3643
+ hasSeparateActivator() {
3644
+ return !this.$slots.activator && typeof this.activator === "string";
3645
+ },
3646
+ activatorEl: {
3647
+ get() {
3648
+ if (this.hasSeparateActivator)
3649
+ return document.querySelector(this.activator);
3650
+ return this.$el.firstElementChild;
3651
+ },
3652
+ set() {
3653
+ }
3654
+ },
3655
+ position() {
3656
+ return this.top && "top" || this.bottom && "bottom" || this.left && "left" || this.right && "right" || "bottom";
3657
+ },
3658
+ alignment() {
3659
+ 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
3660
  }
3567
3661
  },
3568
3662
  methods: {
@@ -3643,14 +3737,72 @@ var DetachableMixin = {
3643
3737
  this.$nextTick(() => {
3644
3738
  var _a;
3645
3739
  this.detachableEl = ((_a = this.$refs.detachable) == null ? void 0 : _a.$el) || this.$refs.detachable;
3646
- this.appendToTarget.appendChild(this.detachableEl);
3740
+ if (this.detachableEl)
3741
+ this.appendToTarget.appendChild(this.detachableEl);
3647
3742
  resolve();
3648
3743
  });
3649
3744
  });
3650
3745
  },
3651
3746
  removeFromDOM() {
3652
- if (this.detachableEl && this.detachableEl.parentNode)
3747
+ document.removeEventListener("mousedown", this.onOutsideMousedown);
3748
+ window.removeEventListener("resize", this.onResize);
3749
+ if (this.detachableEl && this.detachableEl.parentNode) {
3750
+ this.detachableVisible = false;
3653
3751
  this.detachableEl.remove();
3752
+ this.detachableEl = null;
3753
+ }
3754
+ }
3755
+ },
3756
+ mounted() {
3757
+ var _a;
3758
+ const wrapper = this.$el;
3759
+ if (this.$slots.activator)
3760
+ wrapper.parentNode.insertBefore(this.activatorEl, wrapper);
3761
+ else if (this.activator) {
3762
+ Object.entries(this.activatorEventHandlers).forEach(([eventName, handler]) => {
3763
+ eventName = eventName.replace("mouseenter", "mouseover").replace("mouseleave", "mouseout");
3764
+ const handlerWrap = (e) => {
3765
+ var _a2;
3766
+ if (((_a2 = e.target) == null ? void 0 : _a2.matches) && e.target.matches(this.activator))
3767
+ handler(e);
3768
+ };
3769
+ document.addEventListener(eventName, handlerWrap);
3770
+ this.docAEventListenersHandlers.push({ eventName, handler: handlerWrap });
3771
+ });
3772
+ }
3773
+ if (this.overlay) {
3774
+ this.overlayEl = (_a = this.$refs.overlay) == null ? void 0 : _a.$el;
3775
+ wrapper.parentNode.insertBefore(this.overlayEl, wrapper);
3776
+ }
3777
+ if (this.modelValue)
3778
+ this.toggleMenu({ type: "click", target: this.activatorEl });
3779
+ },
3780
+ beforeUnmount() {
3781
+ var _a;
3782
+ this.close();
3783
+ this.removeFromDOM();
3784
+ if (this.docAEventListenersHandlers.length) {
3785
+ this.docAEventListenersHandlers.forEach(({ eventName, handler }) => {
3786
+ document.removeEventListener(eventName, handler);
3787
+ });
3788
+ }
3789
+ if (this.overlay && this.overlayEl.parentNode)
3790
+ this.overlayEl.remove();
3791
+ if (((_a = this.activatorEl) == null ? void 0 : _a.parentNode) && this.$slots.activator)
3792
+ this.activatorEl.remove();
3793
+ },
3794
+ watch: {
3795
+ modelValue(bool) {
3796
+ if (!!bool !== this.detachableVisible)
3797
+ this.toggle({ type: "click", target: this.activatorEl });
3798
+ },
3799
+ detachTo() {
3800
+ this.removeFromDOM();
3801
+ this.insertInDOM();
3802
+ },
3803
+ appendTo() {
3804
+ this.removeFromDOM();
3805
+ this.insertInDOM();
3654
3806
  }
3655
3807
  }
3656
3808
  };
@@ -3717,7 +3869,7 @@ function render$s(_ctx, _cache, $props, $setup, $data, $options) {
3717
3869
  persistent: $props.persistent,
3718
3870
  class: $options.overlayClasses
3719
3871
  }, $props.overlayProps, {
3720
- "z-index": ($props.zIndex || 200) - 1,
3872
+ "z-index": (_ctx.zIndex || 200) - 1,
3721
3873
  "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => _ctx.detachableVisible = false)
3722
3874
  }), null, 16, ["model-value", "persistent", "class", "z-index"])) : createCommentVNode("", true)
3723
3875
  ]);
@@ -3742,24 +3894,12 @@ const _sfc_main$s = {
3742
3894
  titleClass: { type: [String, Object, Array] },
3743
3895
  contentClass: { type: [String, Object, Array] },
3744
3896
  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
3897
  minWidth: { type: [Number, String] },
3758
3898
  overlay: { type: Boolean },
3759
3899
  overlayClass: { type: [String, Object, Array] },
3760
3900
  overlayProps: { type: Object },
3761
3901
  persistent: { type: Boolean },
3762
- noPosition: { type: Boolean }
3902
+ delay: { type: Number }
3763
3903
  },
3764
3904
  emits: ["input", "update:modelValue", "open", "close"],
3765
3905
  data: () => ({
@@ -3770,7 +3910,6 @@ const _sfc_main$s = {
3770
3910
  top: 0,
3771
3911
  left: 0
3772
3912
  },
3773
- activatorEl: null,
3774
3913
  activatorWidth: 0,
3775
3914
  detachableEl: null,
3776
3915
  timeoutId: null
@@ -3779,12 +3918,6 @@ const _sfc_main$s = {
3779
3918
  transitionName() {
3780
3919
  return this.transition || "scale-fade";
3781
3920
  },
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
3921
  menuMinWidth() {
3789
3922
  if (this.minWidth === "activator")
3790
3923
  return this.activatorWidth ? `${this.activatorWidth}px` : 0;
@@ -3831,8 +3964,8 @@ const _sfc_main$s = {
3831
3964
  let handlers = {};
3832
3965
  if (this.showOnHover) {
3833
3966
  handlers = {
3834
- focus: this.toggleMenu,
3835
- blur: this.toggleMenu,
3967
+ focus: this.toggle,
3968
+ blur: this.toggle,
3836
3969
  mouseenter: (e) => {
3837
3970
  this.hoveringActivator = true;
3838
3971
  this.open(e);
@@ -3846,15 +3979,15 @@ const _sfc_main$s = {
3846
3979
  }
3847
3980
  };
3848
3981
  if (typeof window !== "undefined" && "ontouchstart" in window) {
3849
- handlers.click = this.toggleMenu;
3982
+ handlers.click = this.toggle;
3850
3983
  }
3851
3984
  } else
3852
- handlers = { click: this.toggleMenu };
3985
+ handlers = { click: this.toggle };
3853
3986
  return handlers;
3854
3987
  }
3855
3988
  },
3856
3989
  methods: {
3857
- toggleMenu(e) {
3990
+ toggle(e) {
3858
3991
  let shouldShowMenu = this.detachableVisible;
3859
3992
  if ("ontouchstart" in window && this.showOnHover && e.type === "click") {
3860
3993
  shouldShowMenu = !shouldShowMenu;
@@ -3868,16 +4001,17 @@ const _sfc_main$s = {
3868
4001
  shouldShowMenu = false;
3869
4002
  }
3870
4003
  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");
4004
+ if (shouldShowMenu)
3875
4005
  this.open(e);
3876
- } else
4006
+ else
3877
4007
  this.close();
3878
4008
  },
3879
4009
  async open(e) {
4010
+ if (this.delay)
4011
+ await new Promise((resolve) => setTimeout(resolve, this.delay));
3880
4012
  this.detachableVisible = true;
4013
+ if (this.activator)
4014
+ this.activatorEl = e.target;
3881
4015
  await this.insertInDOM();
3882
4016
  if (this.minWidth === "activator")
3883
4017
  this.activatorWidth = this.activatorEl.offsetWidth;
@@ -3907,39 +4041,6 @@ const _sfc_main$s = {
3907
4041
  document.removeEventListener("mousedown", this.onOutsideMousedown);
3908
4042
  window.removeEventListener("resize", this.onResize);
3909
4043
  }
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
4044
  }
3944
4045
  };
3945
4046
  var wMenu = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", render$s]]);
@@ -4561,7 +4662,8 @@ const _hoisted_2$7 = ["disabled", "onMouseenter", "onClick", "tabindex"];
4561
4662
  function render$l(_ctx, _cache, $props, $setup, $data, $options) {
4562
4663
  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
4664
  valid: _ctx.valid,
4564
- onReset: _cache[4] || (_cache[4] = ($event) => {
4665
+ "onUpdate:valid": _cache[4] || (_cache[4] = ($event) => _ctx.valid = $event),
4666
+ onReset: _cache[5] || (_cache[5] = ($event) => {
4565
4667
  _ctx.$emit("update:modelValue", $data.rating = null);
4566
4668
  _ctx.$emit("input", null);
4567
4669
  }),
@@ -5056,8 +5158,9 @@ const _sfc_main$k = {
5056
5158
  openMenu() {
5057
5159
  this.showMenu = true;
5058
5160
  setTimeout(() => {
5161
+ var _a;
5059
5162
  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();
5163
+ (_a = this.$refs["w-list"].$el.querySelector(`#w-select-menu--${this._.uid}_item-${itemIndex + 1}`)) == null ? void 0 : _a.focus();
5061
5164
  }, 100);
5062
5165
  },
5063
5166
  closeMenu() {
@@ -6750,7 +6853,7 @@ var wToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", render$9]]);
6750
6853
  const _hoisted_1 = { class: "w-tooltip-wrap" };
6751
6854
  function render$8(_ctx, _cache, $props, $setup, $data, $options) {
6752
6855
  return openBlock(), createElementBlock("div", _hoisted_1, [
6753
- renderSlot(_ctx.$slots, "activator", { on: $options.eventHandlers }),
6856
+ renderSlot(_ctx.$slots, "activator", { on: $options.activatorEventHandlers }),
6754
6857
  createVNode(Transition, {
6755
6858
  name: $options.transitionName,
6756
6859
  appear: ""
@@ -6784,20 +6887,8 @@ const _sfc_main$8 = {
6784
6887
  round: { type: Boolean },
6785
6888
  transition: { type: String },
6786
6889
  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
6890
  persistent: { type: Boolean },
6800
- noPosition: { type: Boolean }
6891
+ delay: { type: Number }
6801
6892
  },
6802
6893
  emits: ["input", "update:modelValue", "open", "close"],
6803
6894
  data: () => ({
@@ -6807,7 +6898,6 @@ const _sfc_main$8 = {
6807
6898
  top: 0,
6808
6899
  left: 0
6809
6900
  },
6810
- activatorEl: null,
6811
6901
  detachableEl: null,
6812
6902
  timeoutId: null
6813
6903
  }),
@@ -6819,12 +6909,6 @@ const _sfc_main$8 = {
6819
6909
  const direction = this.position.replace(/top|bottom/, (m) => ({ top: "up", bottom: "down" })[m]);
6820
6910
  return this.transition || `w-tooltip-slide-fade-${direction}`;
6821
6911
  },
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
6912
  classes() {
6829
6913
  return __spreadProps(__spreadValues({
6830
6914
  [this.color]: this.color,
@@ -6848,7 +6932,7 @@ const _sfc_main$8 = {
6848
6932
  "--w-tooltip-bg-color": this.$waveui.colors[this.bgColor || "white"]
6849
6933
  };
6850
6934
  },
6851
- eventHandlers() {
6935
+ activatorEventHandlers() {
6852
6936
  let handlers = {};
6853
6937
  if (this.showOnClick)
6854
6938
  handlers = { click: this.toggle };
@@ -6884,16 +6968,17 @@ const _sfc_main$8 = {
6884
6968
  else if (["mouseleave", "blur"].includes(e.type) && !this.showOnClick)
6885
6969
  shouldShowTooltip = false;
6886
6970
  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");
6971
+ if (shouldShowTooltip)
6891
6972
  this.open(e);
6892
- } else
6973
+ else
6893
6974
  this.close();
6894
6975
  },
6895
6976
  async open(e) {
6977
+ if (this.delay)
6978
+ await new Promise((resolve) => setTimeout(resolve, this.delay));
6896
6979
  this.detachableVisible = true;
6980
+ if (this.activator)
6981
+ this.activatorEl = e.target;
6897
6982
  await this.insertInDOM();
6898
6983
  if (this.minWidth === "activator")
6899
6984
  this.activatorWidth = this.activatorEl.offsetWidth;
@@ -6923,32 +7008,6 @@ const _sfc_main$8 = {
6923
7008
  document.removeEventListener("mousedown", this.onOutsideMousedown);
6924
7009
  window.removeEventListener("resize", this.onResize);
6925
7010
  }
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
7011
  }
6953
7012
  };
6954
7013
  var wTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", render$8]]);