wave-ui 2.29.0 → 2.30.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.
@@ -33,7 +33,7 @@ var __publicField = (obj, key, value) => {
33
33
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
34
34
  return value;
35
35
  };
36
- import { reactive, resolveComponent, openBlock, createElementBlock, normalizeClass, Fragment, renderList, createElementVNode, withKeys, createBlock, withModifiers, createCommentVNode, renderSlot, createVNode, withCtx, mergeProps, toHandlers, createTextVNode, toDisplayString, TransitionGroup, Transition, normalizeStyle, resolveDynamicComponent, createSlots, withDirectives, vModelText, vModelDynamic, resolveDirective, KeepAlive, vShow } from "vue";
36
+ import { reactive, resolveComponent, openBlock, createElementBlock, normalizeClass, Fragment, renderList, createElementVNode, withKeys, createBlock, withModifiers, createCommentVNode, renderSlot, createVNode, withCtx, mergeProps, toHandlers, createTextVNode, toDisplayString, TransitionGroup, Transition, normalizeStyle, resolveDynamicComponent, createSlots, withDirectives, vModelText, vModelDynamic, resolveDirective, KeepAlive } from "vue";
37
37
  const config = reactive({
38
38
  breakpoints: {
39
39
  xs: 600,
@@ -500,10 +500,10 @@ let WaveUI = _WaveUI;
500
500
  __publicField(WaveUI, "instance", null);
501
501
  __publicField(WaveUI, "vueInstance", null);
502
502
  WaveUI.version = "__VERSION__";
503
- const _hoisted_1$s = ["aria-expanded"];
504
- const _hoisted_2$f = ["onClick", "onFocus", "onKeypress", "tabindex"];
505
- const _hoisted_3$c = ["innerHTML"];
506
- const _hoisted_4$b = ["innerHTML"];
503
+ const _hoisted_1$t = ["aria-expanded"];
504
+ const _hoisted_2$e = ["onClick", "onFocus", "onKeypress", "tabindex"];
505
+ const _hoisted_3$b = ["innerHTML"];
506
+ const _hoisted_4$a = ["innerHTML"];
507
507
  function render$O(_ctx, _cache, $props, $setup, $data, $options) {
508
508
  const _component_w_button = resolveComponent("w-button");
509
509
  const _component_w_transition_expand = resolveComponent("w-transition-expand");
@@ -548,7 +548,7 @@ function render$O(_ctx, _cache, $props, $setup, $data, $options) {
548
548
  createElementVNode("div", {
549
549
  class: "grow",
550
550
  innerHTML: item[$props.itemTitleKey]
551
- }, null, 8, _hoisted_3$c)
551
+ }, null, 8, _hoisted_3$b)
552
552
  ]),
553
553
  $props.expandIcon && $props.expandIconRight ? (openBlock(), createBlock(_component_w_button, {
554
554
  key: 3,
@@ -559,7 +559,7 @@ function render$O(_ctx, _cache, $props, $setup, $data, $options) {
559
559
  }, ["stop"])),
560
560
  onClick: withModifiers(($event) => !item._disabled && $options.toggleItem(item, $event), ["stop"])
561
561
  }, null, 8, ["icon", "onClick", "class"])) : createCommentVNode("", true)
562
- ], 42, _hoisted_2$f),
562
+ ], 42, _hoisted_2$e),
563
563
  createVNode(_component_w_transition_expand, { y: "" }, {
564
564
  default: withCtx(() => [
565
565
  item._expanded ? (openBlock(), createElementBlock("div", {
@@ -579,13 +579,13 @@ function render$O(_ctx, _cache, $props, $setup, $data, $options) {
579
579
  }, () => [
580
580
  createElementVNode("div", {
581
581
  innerHTML: item[$props.itemContentKey]
582
- }, null, 8, _hoisted_4$b)
582
+ }, null, 8, _hoisted_4$a)
583
583
  ])
584
584
  ], 2)) : createCommentVNode("", true)
585
585
  ]),
586
586
  _: 2
587
587
  }, 1024)
588
- ], 10, _hoisted_1$s);
588
+ ], 10, _hoisted_1$t);
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$r = { class: "w-alert__content" };
673
+ const _hoisted_1$s = { 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$r, [
691
+ createElementVNode("div", _hoisted_1$s, [
692
692
  renderSlot(_ctx.$slots, "default")
693
693
  ]),
694
694
  $props.dismiss ? (openBlock(), createBlock(_component_w_button, {
@@ -1135,7 +1135,7 @@ const _sfc_main$K = {
1135
1135
  }
1136
1136
  };
1137
1137
  var wBadge = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["render", render$K]]);
1138
- const _hoisted_1$q = ["innerHTML"];
1138
+ const _hoisted_1$r = ["innerHTML"];
1139
1139
  function render$J(_ctx, _cache, $props, $setup, $data, $options) {
1140
1140
  const _component_w_icon = resolveComponent("w-icon");
1141
1141
  return openBlock(), createElementBlock("div", {
@@ -1187,7 +1187,7 @@ function render$J(_ctx, _cache, $props, $setup, $data, $options) {
1187
1187
  }) : (openBlock(), createElementBlock("span", {
1188
1188
  key: `${i}f`,
1189
1189
  innerHTML: item[$props.itemLabelKey]
1190
- }, null, 8, _hoisted_1$q))
1190
+ }, null, 8, _hoisted_1$r))
1191
1191
  ], 64);
1192
1192
  }), 256))
1193
1193
  ], 2);
@@ -1225,11 +1225,11 @@ const _sfc_main$J = {
1225
1225
  }
1226
1226
  };
1227
1227
  var wBreadcrumbs = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["render", render$J]]);
1228
- const _hoisted_1$p = {
1228
+ const _hoisted_1$q = {
1229
1229
  key: 0,
1230
1230
  class: "w-button__loader"
1231
1231
  };
1232
- const _hoisted_2$e = /* @__PURE__ */ createElementVNode("svg", { viewBox: "0 0 40 40" }, [
1232
+ const _hoisted_2$d = /* @__PURE__ */ createElementVNode("svg", { viewBox: "0 0 40 40" }, [
1233
1233
  /* @__PURE__ */ createElementVNode("circle", {
1234
1234
  cx: "20",
1235
1235
  cy: "20",
@@ -1257,9 +1257,9 @@ function render$I(_ctx, _cache, $props, $setup, $data, $options) {
1257
1257
  })) : renderSlot(_ctx.$slots, "default", { key: 1 }),
1258
1258
  createVNode(Transition, { name: "scale-fade" }, {
1259
1259
  default: withCtx(() => [
1260
- $props.loading ? (openBlock(), createElementBlock("div", _hoisted_1$p, [
1260
+ $props.loading ? (openBlock(), createElementBlock("div", _hoisted_1$q, [
1261
1261
  renderSlot(_ctx.$slots, "loading", {}, () => [
1262
- _hoisted_2$e
1262
+ _hoisted_2$d
1263
1263
  ])
1264
1264
  ])) : createCommentVNode("", true)
1265
1265
  ]),
@@ -1370,7 +1370,7 @@ const objectifyClasses = (classes = {}) => {
1370
1370
  classes = { [classes.join(" ")]: true };
1371
1371
  return classes;
1372
1372
  };
1373
- const _hoisted_1$o = ["innerHTML"];
1373
+ const _hoisted_1$p = ["innerHTML"];
1374
1374
  function render$H(_ctx, _cache, $props, $setup, $data, $options) {
1375
1375
  const _component_w_image = resolveComponent("w-image");
1376
1376
  return openBlock(), createElementBlock("div", {
@@ -1386,7 +1386,7 @@ function render$H(_ctx, _cache, $props, $setup, $data, $options) {
1386
1386
  key: 1,
1387
1387
  class: normalizeClass(["w-card__title", $options.titleClasses]),
1388
1388
  innerHTML: $props.title
1389
- }, null, 10, _hoisted_1$o)) : createCommentVNode("", true),
1389
+ }, null, 10, _hoisted_1$p)) : createCommentVNode("", true),
1390
1390
  $props.image ? (openBlock(), createBlock(_component_w_image, mergeProps({
1391
1391
  key: 2,
1392
1392
  class: "w-card__image",
@@ -1495,10 +1495,10 @@ var FormElementMixin = {
1495
1495
  }
1496
1496
  }
1497
1497
  };
1498
- const _hoisted_1$n = ["id", "name", "checked", "disabled", "required", "tabindex", "aria-checked"];
1499
- const _hoisted_2$d = ["for"];
1500
- const _hoisted_3$b = ["for", "innerHTML"];
1501
- const _hoisted_4$a = /* @__PURE__ */ createElementVNode("svg", {
1498
+ const _hoisted_1$o = ["id", "name", "checked", "disabled", "required", "tabindex", "aria-checked"];
1499
+ const _hoisted_2$c = ["for"];
1500
+ const _hoisted_3$a = ["for", "innerHTML"];
1501
+ const _hoisted_4$9 = /* @__PURE__ */ createElementVNode("svg", {
1502
1502
  width: "11px",
1503
1503
  height: "9px",
1504
1504
  viewbox: "0 0 12 9"
@@ -1506,7 +1506,7 @@ const _hoisted_4$a = /* @__PURE__ */ createElementVNode("svg", {
1506
1506
  /* @__PURE__ */ createElementVNode("polyline", { points: "1 5 4 8 10 2" })
1507
1507
  ], -1);
1508
1508
  const _hoisted_5$8 = [
1509
- _hoisted_4$a
1509
+ _hoisted_4$9
1510
1510
  ];
1511
1511
  const _hoisted_6$5 = ["for"];
1512
1512
  const _hoisted_7$5 = ["for", "innerHTML"];
@@ -1536,7 +1536,7 @@ function render$G(_ctx, _cache, $props, $setup, $data, $options) {
1536
1536
  onKeypress: _cache[3] || (_cache[3] = withKeys((...args) => $options.onInput && $options.onInput(...args), ["enter"])),
1537
1537
  "aria-checked": $data.isChecked || "false",
1538
1538
  role: "checkbox"
1539
- }, null, 40, _hoisted_1$n),
1539
+ }, null, 40, _hoisted_1$o),
1540
1540
  $options.hasLabel && $props.labelOnLeft ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1541
1541
  _ctx.$slots.default ? (openBlock(), createElementBlock("label", {
1542
1542
  key: 0,
@@ -1544,12 +1544,12 @@ function render$G(_ctx, _cache, $props, $setup, $data, $options) {
1544
1544
  for: `w-checkbox--${_ctx._.uid}`
1545
1545
  }, [
1546
1546
  renderSlot(_ctx.$slots, "default")
1547
- ], 8, _hoisted_2$d)) : $props.label ? (openBlock(), createElementBlock("label", {
1547
+ ], 8, _hoisted_2$c)) : $props.label ? (openBlock(), createElementBlock("label", {
1548
1548
  key: 1,
1549
1549
  class: "w-checkbox__label w-form-el-shakable pr2",
1550
1550
  for: `w-checkbox--${_ctx._.uid}`,
1551
1551
  innerHTML: $props.label
1552
- }, null, 8, _hoisted_3$b)) : createCommentVNode("", true)
1552
+ }, null, 8, _hoisted_3$a)) : createCommentVNode("", true)
1553
1553
  ], 64)) : createCommentVNode("", true),
1554
1554
  createElementVNode("div", {
1555
1555
  class: normalizeClass(["w-checkbox__input", this.color]),
@@ -1646,7 +1646,7 @@ const _sfc_main$G = {
1646
1646
  }
1647
1647
  };
1648
1648
  var wCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["render", render$G]]);
1649
- const _hoisted_1$m = ["innerHTML"];
1649
+ const _hoisted_1$n = ["innerHTML"];
1650
1650
  function render$F(_ctx, _cache, $props, $setup, $data, $options) {
1651
1651
  const _component_w_checkbox = resolveComponent("w-checkbox");
1652
1652
  return openBlock(), createBlock(resolveDynamicComponent(_ctx.formRegister ? "w-form-element" : "div"), mergeProps({ ref: "formEl" }, _ctx.formRegister && { validators: _ctx.validators, inputValue: $options.checkboxItems.some((item) => item._isChecked), disabled: _ctx.isDisabled }, {
@@ -1689,7 +1689,7 @@ function render$F(_ctx, _cache, $props, $setup, $data, $options) {
1689
1689
  }) : item.label ? (openBlock(), createElementBlock("div", {
1690
1690
  key: 2,
1691
1691
  innerHTML: item.label
1692
- }, null, 8, _hoisted_1$m)) : createCommentVNode("", true)
1692
+ }, null, 8, _hoisted_1$n)) : createCommentVNode("", true)
1693
1693
  ]),
1694
1694
  _: 2
1695
1695
  }, 1032, ["model-value", "name", "label", "label-on-left", "color", "round", "onUpdate:modelValue", "disabled", "readonly", "class"]);
@@ -1755,21 +1755,18 @@ const _sfc_main$F = {
1755
1755
  }
1756
1756
  };
1757
1757
  var wCheckboxes = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["render", render$F]]);
1758
- const _hoisted_1$l = { class: "w-confirm" };
1759
- const _hoisted_2$c = /* @__PURE__ */ createTextVNode("Are you sure?");
1760
- const _hoisted_3$a = /* @__PURE__ */ createTextVNode("Cancel");
1761
- const _hoisted_4$9 = /* @__PURE__ */ createTextVNode("Confirm");
1758
+ const _hoisted_1$m = { class: "w-confirm" };
1762
1759
  function render$E(_ctx, _cache, $props, $setup, $data, $options) {
1763
1760
  const _component_w_button = resolveComponent("w-button");
1764
1761
  const _component_w_flex = resolveComponent("w-flex");
1765
1762
  const _component_w_menu = resolveComponent("w-menu");
1766
- return openBlock(), createElementBlock("div", _hoisted_1$l, [
1763
+ return openBlock(), createElementBlock("div", _hoisted_1$m, [
1767
1764
  createVNode(_component_w_menu, mergeProps({
1768
1765
  modelValue: _ctx.showPopup,
1769
1766
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.showPopup = $event)
1770
1767
  }, $options.wMenuProps), {
1771
1768
  activator: withCtx(({ on }) => [
1772
- createVNode(_component_w_button, mergeProps({ class: "w-confirm__button" }, toHandlers(on), $options.buttonProps), {
1769
+ createVNode(_component_w_button, mergeProps({ class: "w-confirm__button" }, toHandlers(__spreadValues(__spreadValues({}, _ctx.$listeners), on)), $options.buttonProps), {
1773
1770
  default: withCtx(() => [
1774
1771
  renderSlot(_ctx.$slots, "default")
1775
1772
  ]),
@@ -1784,33 +1781,33 @@ function render$E(_ctx, _cache, $props, $setup, $data, $options) {
1784
1781
  default: withCtx(() => [
1785
1782
  createElementVNode("div", null, [
1786
1783
  renderSlot(_ctx.$slots, "question", {}, () => [
1787
- _hoisted_2$c
1784
+ createTextVNode(toDisplayString($props.question), 1)
1788
1785
  ])
1789
1786
  ]),
1790
1787
  createElementVNode("div", {
1791
1788
  class: normalizeClass(["w-flex justify-end", $props.inline ? "ml2" : "mt2"])
1792
1789
  }, [
1793
- !$props.noCancel ? (openBlock(), createBlock(_component_w_button, mergeProps({
1790
+ $props.cancel !== false ? (openBlock(), createBlock(_component_w_button, mergeProps({
1794
1791
  key: 0,
1795
1792
  class: "mr2"
1796
- }, $props.cancelButton, {
1797
- "bg-color": ($props.cancelButton || {}).bgColor || "error",
1793
+ }, $options.cancelButtonProps, {
1794
+ "bg-color": ($options.cancelButton || {}).bgColor || "error",
1798
1795
  onClick: $options.onCancel
1799
1796
  }), {
1800
1797
  default: withCtx(() => [
1801
1798
  renderSlot(_ctx.$slots, "cancel", {}, () => [
1802
- _hoisted_3$a
1799
+ createTextVNode(toDisplayString($options.cancelButton.label), 1)
1803
1800
  ])
1804
1801
  ]),
1805
1802
  _: 3
1806
1803
  }, 16, ["bg-color", "onClick"])) : createCommentVNode("", true),
1807
- createVNode(_component_w_button, mergeProps($props.confirmButton, {
1808
- "bg-color": ($props.confirmButton || {}).bgColor || "success",
1804
+ createVNode(_component_w_button, mergeProps($options.confirmButtonProps, {
1805
+ "bg-color": ($options.confirmButton || {}).bgColor || "success",
1809
1806
  onClick: $options.onConfirm
1810
1807
  }), {
1811
1808
  default: withCtx(() => [
1812
1809
  renderSlot(_ctx.$slots, "confirm", {}, () => [
1813
- _hoisted_4$9
1810
+ createTextVNode(toDisplayString($options.confirmButton.label), 1)
1814
1811
  ])
1815
1812
  ]),
1816
1813
  _: 3
@@ -1831,9 +1828,9 @@ const _sfc_main$E = {
1831
1828
  color: { type: String },
1832
1829
  icon: { type: String },
1833
1830
  mainButton: { type: Object },
1834
- noCancel: { type: Boolean },
1835
- cancelButton: { type: [Boolean, Object] },
1836
- confirmButton: { type: Object },
1831
+ question: { type: String, default: "Are you sure?" },
1832
+ cancel: { type: [Boolean, Object, String], default: void 0 },
1833
+ confirm: { type: [Object, String] },
1837
1834
  inline: { type: Boolean },
1838
1835
  menu: { type: Object },
1839
1836
  noArrow: { type: Boolean },
@@ -1854,6 +1851,26 @@ const _sfc_main$E = {
1854
1851
  props: []
1855
1852
  }),
1856
1853
  computed: {
1854
+ cancelButton() {
1855
+ let button = { label: typeof this.cancel === "string" ? this.cancel : "Cancel" };
1856
+ if (typeof this.cancel === "object")
1857
+ button = Object.assign({}, button, this.cancel);
1858
+ return button;
1859
+ },
1860
+ cancelButtonProps() {
1861
+ const _a = this.cancelButton, { label } = _a, props = __objRest(_a, ["label"]);
1862
+ return props;
1863
+ },
1864
+ confirmButton() {
1865
+ let button = { label: typeof this.confirm === "string" ? this.confirm : "Confirm" };
1866
+ if (typeof this.confirm === "object")
1867
+ button = Object.assign({}, button, this.confirm);
1868
+ return button;
1869
+ },
1870
+ confirmButtonProps() {
1871
+ const _a = this.confirmButton, { label } = _a, props = __objRest(_a, ["label"]);
1872
+ return props;
1873
+ },
1857
1874
  wMenuProps() {
1858
1875
  return __spreadValues({
1859
1876
  top: this.top,
@@ -2062,7 +2079,7 @@ const _sfc_main$B = {
2062
2079
  }
2063
2080
  };
2064
2081
  var wDivider = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", render$B]]);
2065
- const _hoisted_1$k = { class: "w-drawer-wrap__pushable" };
2082
+ const _hoisted_1$l = { class: "w-drawer-wrap__pushable" };
2066
2083
  function render$A(_ctx, _cache, $props, $setup, $data, $options) {
2067
2084
  const _component_w_overlay = resolveComponent("w-overlay");
2068
2085
  return $data.showWrapper || $props.pushContent ? (openBlock(), createElementBlock("div", {
@@ -2074,7 +2091,7 @@ function render$A(_ctx, _cache, $props, $setup, $data, $options) {
2074
2091
  class: "w-drawer-wrap__track",
2075
2092
  style: normalizeStyle($options.trackStyles)
2076
2093
  }, [
2077
- createElementVNode("div", _hoisted_1$k, [
2094
+ createElementVNode("div", _hoisted_1$l, [
2078
2095
  !$props.noOverlay ? (openBlock(), createBlock(_component_w_overlay, {
2079
2096
  key: 0,
2080
2097
  modelValue: $data.showDrawer,
@@ -2454,7 +2471,7 @@ const _sfc_main$y = {
2454
2471
  }
2455
2472
  };
2456
2473
  var wForm = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", render$y]]);
2457
- const _hoisted_1$j = {
2474
+ const _hoisted_1$k = {
2458
2475
  key: 0,
2459
2476
  class: "w-form-el__error error w-form-el__error w-form-el__error"
2460
2477
  };
@@ -2472,7 +2489,7 @@ function render$x(_ctx, _cache, $props, $setup, $data, $options) {
2472
2489
  createVNode(_component_w_transition_expand, { y: "" }, {
2473
2490
  default: withCtx(() => [
2474
2491
  _ctx.Validation.message ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2475
- _ctx.$slots["error-message"] ? (openBlock(), createElementBlock("div", _hoisted_1$j, [
2492
+ _ctx.$slots["error-message"] ? (openBlock(), createElementBlock("div", _hoisted_1$k, [
2476
2493
  renderSlot(_ctx.$slots, "error-message", {
2477
2494
  message: _ctx.Validation.message
2478
2495
  })
@@ -2652,7 +2669,7 @@ const _sfc_main$w = {
2652
2669
  }
2653
2670
  };
2654
2671
  var wIcon = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", render$w]]);
2655
- const _hoisted_1$i = {
2672
+ const _hoisted_1$j = {
2656
2673
  key: 0,
2657
2674
  class: "w-image__loader"
2658
2675
  };
@@ -2677,7 +2694,7 @@ function render$v(_ctx, _cache, $props, $setup, $data, $options) {
2677
2694
  ]),
2678
2695
  _: 1
2679
2696
  }, 8, ["name"]),
2680
- !$props.noSpinner && $data.loading ? (openBlock(), createElementBlock("div", _hoisted_1$i, [
2697
+ !$props.noSpinner && $data.loading ? (openBlock(), createElementBlock("div", _hoisted_1$j, [
2681
2698
  _ctx.$slots.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(_component_w_progress, {
2682
2699
  key: 1,
2683
2700
  circle: "",
@@ -2822,7 +2839,7 @@ const _sfc_main$v = {
2822
2839
  }
2823
2840
  };
2824
2841
  var wImage = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", render$v]]);
2825
- const _hoisted_1$h = ["name"];
2842
+ const _hoisted_1$i = ["name"];
2826
2843
  const _hoisted_2$a = ["for"];
2827
2844
  const _hoisted_3$9 = ["for", "innerHTML"];
2828
2845
  const _hoisted_4$8 = ["id", "type", "name", "placeholder", "step", "min", "max", "minlength", "maxlength", "readonly", "aria-readonly", "disabled", "required", "tabindex"];
@@ -2857,7 +2874,7 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
2857
2874
  type: "hidden",
2858
2875
  name: _ctx.name || null,
2859
2876
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.inputValue = $event)
2860
- }, null, 8, _hoisted_1$h)), [
2877
+ }, null, 8, _hoisted_1$i)), [
2861
2878
  [vModelText, $data.inputValue]
2862
2879
  ]) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2863
2880
  $props.labelPosition === "left" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
@@ -3154,6 +3171,8 @@ const _sfc_main$u = {
3154
3171
  return file;
3155
3172
  });
3156
3173
  this.$emit("update:modelValue", this.inputFiles);
3174
+ this.$emit("input", this.inputFiles);
3175
+ this.$emit("change", this.inputFiles);
3157
3176
  },
3158
3177
  filePreview(original, file) {
3159
3178
  const reader = new FileReader();
@@ -3171,7 +3190,7 @@ const _sfc_main$u = {
3171
3190
  },
3172
3191
  mounted() {
3173
3192
  setTimeout(() => {
3174
- if (this.$refs.input.matches(":-webkit-autofill"))
3193
+ if (this.$refs.input && this.$refs.input.matches(":-webkit-autofill"))
3175
3194
  this.isAutofilled = true;
3176
3195
  }, 400);
3177
3196
  },
@@ -3516,34 +3535,153 @@ const _sfc_main$t = {
3516
3535
  }
3517
3536
  };
3518
3537
  var wList = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", render$t]]);
3519
- const _hoisted_1$g = { class: "w-menu-wrap" };
3538
+ var DetachableMixin = {
3539
+ computed: {
3540
+ appendToTarget() {
3541
+ const defaultTarget = ".w-app";
3542
+ if (this.detachTo && !this.appendTo) {
3543
+ consoleWarn(`The ${this.$options.name} prop \`detach-to\` is deprecated. You can replace it with \`append-to\`.`);
3544
+ }
3545
+ let target = this.appendTo || this.detachTo || defaultTarget;
3546
+ if (target === true)
3547
+ target = defaultTarget;
3548
+ else if (this.appendTo === "activator")
3549
+ target = this.$el.previousElementSibling;
3550
+ else if (target && !["object", "string"].includes(typeof target))
3551
+ target = defaultTarget;
3552
+ else if (typeof target === "object" && !target.nodeType) {
3553
+ target = defaultTarget;
3554
+ consoleWarn(`Invalid node provided in ${this.$options.name} \`append-to\`. Falling back to .w-app.`);
3555
+ }
3556
+ if (typeof target === "string")
3557
+ target = document.querySelector(target);
3558
+ if (!target) {
3559
+ consoleWarn(`Unable to locate ${this.appendTo ? `target ${this.appendTo}` : defaultTarget}`);
3560
+ target = document.querySelector(defaultTarget);
3561
+ }
3562
+ return target;
3563
+ },
3564
+ detachableParentEl() {
3565
+ return this.appendToTarget;
3566
+ }
3567
+ },
3568
+ methods: {
3569
+ getActivatorCoordinates(e) {
3570
+ const { top, left, width, height } = (e ? e.target : this.activatorEl).getBoundingClientRect();
3571
+ let coords = { top, left, width, height };
3572
+ if (!this.fixed) {
3573
+ const { top: targetTop, left: targetLeft } = this.detachableParentEl.getBoundingClientRect();
3574
+ const computedStyles2 = window.getComputedStyle(this.detachableParentEl, null);
3575
+ coords = __spreadProps(__spreadValues({}, coords), {
3576
+ top: top - targetTop + this.detachableParentEl.scrollTop - parseInt(computedStyles2.getPropertyValue("border-top-width")),
3577
+ left: left - targetLeft + this.detachableParentEl.scrollLeft - parseInt(computedStyles2.getPropertyValue("border-left-width"))
3578
+ });
3579
+ }
3580
+ return coords;
3581
+ },
3582
+ computeDetachableCoords(e) {
3583
+ let { top, left, width, height } = this.getActivatorCoordinates(e);
3584
+ this.detachableEl.style.visibility = "hidden";
3585
+ this.detachableEl.style.display = "flex";
3586
+ const computedStyles2 = window.getComputedStyle(this.detachableEl, null);
3587
+ switch (this.position) {
3588
+ case "top": {
3589
+ top -= this.detachableEl.offsetHeight;
3590
+ if (this.alignRight) {
3591
+ left += width - this.detachableEl.offsetWidth + parseInt(computedStyles2.getPropertyValue("border-right-width"));
3592
+ } else if (!this.alignLeft)
3593
+ left += (width - this.detachableEl.offsetWidth) / 2;
3594
+ break;
3595
+ }
3596
+ case "bottom": {
3597
+ top += height;
3598
+ if (this.alignRight) {
3599
+ left += width - this.detachableEl.offsetWidth + parseInt(computedStyles2.getPropertyValue("border-right-width"));
3600
+ } else if (!this.alignLeft)
3601
+ left += (width - this.detachableEl.offsetWidth) / 2;
3602
+ break;
3603
+ }
3604
+ case "left": {
3605
+ left -= this.detachableEl.offsetWidth;
3606
+ if (this.alignBottom)
3607
+ top += height - this.detachableEl.offsetHeight;
3608
+ else if (!this.alignTop)
3609
+ top += (height - this.detachableEl.offsetHeight) / 2;
3610
+ break;
3611
+ }
3612
+ case "right": {
3613
+ left += width;
3614
+ if (this.alignBottom) {
3615
+ top += height - this.detachableEl.offsetHeight + parseInt(computedStyles2.getPropertyValue("margin-top"));
3616
+ } else if (!this.alignTop) {
3617
+ top += (height - this.detachableEl.offsetHeight) / 2 + parseInt(computedStyles2.getPropertyValue("margin-top"));
3618
+ }
3619
+ break;
3620
+ }
3621
+ }
3622
+ this.detachableEl.style.visibility = null;
3623
+ if (!this.detachableVisible)
3624
+ this.detachableEl.style.display = "none";
3625
+ this.detachableCoords = { top, left };
3626
+ },
3627
+ onResize() {
3628
+ if (this.minWidth === "activator")
3629
+ this.activatorWidth = this.activatorEl.offsetWidth;
3630
+ this.computeDetachableCoords();
3631
+ },
3632
+ onOutsideMousedown(e) {
3633
+ if (!this.detachableEl.contains(e.target) && !this.activatorEl.contains(e.target)) {
3634
+ this.$emit("update:modelValue", this.detachableVisible = false);
3635
+ this.$emit("input", false);
3636
+ this.$emit("close");
3637
+ document.removeEventListener("mousedown", this.onOutsideMousedown);
3638
+ window.removeEventListener("resize", this.onResize);
3639
+ }
3640
+ },
3641
+ insertInDOM() {
3642
+ return new Promise((resolve) => {
3643
+ this.$nextTick(() => {
3644
+ var _a;
3645
+ this.detachableEl = ((_a = this.$refs.detachable) == null ? void 0 : _a.$el) || this.$refs.detachable;
3646
+ this.appendToTarget.appendChild(this.detachableEl);
3647
+ resolve();
3648
+ });
3649
+ });
3650
+ },
3651
+ removeFromDOM() {
3652
+ if (this.detachableEl && this.detachableEl.parentNode)
3653
+ this.detachableEl.remove();
3654
+ }
3655
+ }
3656
+ };
3657
+ const _hoisted_1$h = { class: "w-menu-wrap" };
3520
3658
  function render$s(_ctx, _cache, $props, $setup, $data, $options) {
3521
3659
  const _component_w_card = resolveComponent("w-card");
3522
3660
  const _component_w_overlay = resolveComponent("w-overlay");
3523
- return openBlock(), createElementBlock("div", _hoisted_1$g, [
3661
+ return openBlock(), createElementBlock("div", _hoisted_1$h, [
3524
3662
  renderSlot(_ctx.$slots, "activator", { on: $options.activatorEventHandlers }),
3525
3663
  createVNode(Transition, {
3526
3664
  name: $options.transitionName,
3527
3665
  appear: ""
3528
3666
  }, {
3529
3667
  default: withCtx(() => [
3530
- $props.custom && _ctx.menuVisible ? (openBlock(), createElementBlock("div", {
3668
+ $props.custom && _ctx.detachableVisible ? (openBlock(), createElementBlock("div", {
3531
3669
  key: 0,
3532
3670
  class: normalizeClass(["w-menu", $options.classes]),
3533
- ref: "menu",
3534
- onClick: _cache[0] || (_cache[0] = ($event) => $props.hideOnMenuClick && $options.closeMenu(true)),
3671
+ ref: "detachable",
3672
+ onClick: _cache[0] || (_cache[0] = ($event) => $props.hideOnMenuClick && $options.close(true)),
3535
3673
  onMouseenter: _cache[1] || (_cache[1] = ($event) => $props.showOnHover && (_ctx.hoveringMenu = true)),
3536
- onMouseleave: _cache[2] || (_cache[2] = ($event) => $props.showOnHover && (_ctx.hoveringMenu = false, $options.closeMenu())),
3674
+ onMouseleave: _cache[2] || (_cache[2] = ($event) => $props.showOnHover && (_ctx.hoveringMenu = false, $options.close())),
3537
3675
  style: normalizeStyle($options.styles)
3538
3676
  }, [
3539
3677
  renderSlot(_ctx.$slots, "default")
3540
- ], 38)) : _ctx.menuVisible ? (openBlock(), createBlock(_component_w_card, {
3678
+ ], 38)) : _ctx.detachableVisible ? (openBlock(), createBlock(_component_w_card, {
3541
3679
  key: 1,
3542
3680
  class: normalizeClass(["w-menu", $options.classes]),
3543
- ref: "menu",
3544
- onClick: _cache[3] || (_cache[3] = ($event) => $props.hideOnMenuClick && $options.closeMenu(true)),
3681
+ ref: "detachable",
3682
+ onClick: _cache[3] || (_cache[3] = ($event) => $props.hideOnMenuClick && $options.close(true)),
3545
3683
  onMouseenter: _cache[4] || (_cache[4] = ($event) => $props.showOnHover && (_ctx.hoveringMenu = true)),
3546
- onMouseleave: _cache[5] || (_cache[5] = ($event) => $props.showOnHover && (_ctx.hoveringMenu = false, $options.closeMenu())),
3684
+ onMouseleave: _cache[5] || (_cache[5] = ($event) => $props.showOnHover && (_ctx.hoveringMenu = false, $options.close())),
3547
3685
  tile: $props.tile,
3548
3686
  "title-class": $options.titleClasses,
3549
3687
  "content-class": $options.contentClasses,
@@ -3575,18 +3713,19 @@ function render$s(_ctx, _cache, $props, $setup, $data, $options) {
3575
3713
  $props.overlay ? (openBlock(), createBlock(_component_w_overlay, mergeProps({
3576
3714
  key: 0,
3577
3715
  ref: "overlay",
3578
- "model-value": _ctx.menuVisible,
3716
+ "model-value": _ctx.detachableVisible,
3579
3717
  persistent: $props.persistent,
3580
3718
  class: $options.overlayClasses
3581
3719
  }, $props.overlayProps, {
3582
3720
  "z-index": ($props.zIndex || 200) - 1,
3583
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => _ctx.menuVisible = false)
3721
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => _ctx.detachableVisible = false)
3584
3722
  }), null, 16, ["model-value", "persistent", "class", "z-index"])) : createCommentVNode("", true)
3585
3723
  ]);
3586
3724
  }
3587
3725
  var wMenu_vue_vue_type_style_index_0_lang = "";
3588
3726
  const _sfc_main$s = {
3589
3727
  name: "w-menu",
3728
+ mixins: [DetachableMixin],
3590
3729
  props: {
3591
3730
  modelValue: {},
3592
3731
  showOnHover: { type: Boolean },
@@ -3603,7 +3742,8 @@ const _sfc_main$s = {
3603
3742
  titleClass: { type: [String, Object, Array] },
3604
3743
  contentClass: { type: [String, Object, Array] },
3605
3744
  arrow: { type: Boolean },
3606
- detachTo: { type: [String, Boolean, Object] },
3745
+ detachTo: { type: [String, Boolean, Object], deprecated: true },
3746
+ appendTo: { type: [String, Boolean, Object] },
3607
3747
  fixed: { type: Boolean },
3608
3748
  top: { type: Boolean },
3609
3749
  bottom: { type: Boolean },
@@ -3623,56 +3763,34 @@ const _sfc_main$s = {
3623
3763
  },
3624
3764
  emits: ["input", "update:modelValue", "open", "close"],
3625
3765
  data: () => ({
3626
- menuVisible: false,
3766
+ detachableVisible: false,
3627
3767
  hoveringActivator: false,
3628
3768
  hoveringMenu: false,
3629
- menuCoordinates: {
3769
+ detachableCoords: {
3630
3770
  top: 0,
3631
3771
  left: 0
3632
3772
  },
3633
3773
  activatorEl: null,
3634
3774
  activatorWidth: 0,
3635
- menuEl: null,
3775
+ detachableEl: null,
3636
3776
  timeoutId: null
3637
3777
  }),
3638
3778
  computed: {
3639
3779
  transitionName() {
3640
3780
  return this.transition || "scale-fade";
3641
3781
  },
3642
- detachToTarget() {
3643
- const defaultTarget = ".w-app";
3644
- let target = this.detachTo || defaultTarget;
3645
- if (target === true)
3646
- target = defaultTarget;
3647
- else if (target && !["object", "string"].includes(typeof target))
3648
- target = defaultTarget;
3649
- else if (typeof target === "object" && !target.nodeType) {
3650
- target = defaultTarget;
3651
- consoleWarn("Invalid node provided in w-menu `detach-to`. Falling back to .w-app.");
3652
- }
3653
- if (typeof target === "string")
3654
- target = document.querySelector(target);
3655
- if (!target) {
3656
- consoleWarn(`Unable to locate ${this.detachTo ? `target ${this.detachTo}` : defaultTarget}`);
3657
- target = document.querySelector(defaultTarget);
3658
- }
3659
- return target;
3660
- },
3661
- menuParentEl() {
3662
- return this.detachToTarget;
3663
- },
3664
3782
  position() {
3665
3783
  return this.top && "top" || this.bottom && "bottom" || this.left && "left" || this.right && "right" || "bottom";
3666
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
+ },
3667
3788
  menuMinWidth() {
3668
3789
  if (this.minWidth === "activator")
3669
3790
  return this.activatorWidth ? `${this.activatorWidth}px` : 0;
3670
3791
  else
3671
3792
  return isNaN(this.minWidth) ? this.minWidth : this.minWidth ? `${this.minWidth}px` : 0;
3672
3793
  },
3673
- alignment() {
3674
- return (this.top || this.bottom) && this.alignLeft && "left" || (this.top || this.bottom) && this.alignRight && "right" || (this.left || this.right) && this.alignTop && "top" || (this.left || this.right) && this.alignBottom && "bottom" || "";
3675
- },
3676
3794
  menuClasses() {
3677
3795
  return objectifyClasses(this.menuClass);
3678
3796
  },
@@ -3703,8 +3821,8 @@ const _sfc_main$s = {
3703
3821
  styles() {
3704
3822
  return {
3705
3823
  zIndex: this.zIndex || this.zIndex === 0 || this.overlay && !this.zIndex && 200 || null,
3706
- top: this.menuCoordinates.top && `${~~this.menuCoordinates.top}px` || null,
3707
- left: this.menuCoordinates.left && `${~~this.menuCoordinates.left}px` || null,
3824
+ top: this.detachableCoords.top && `${~~this.detachableCoords.top}px` || null,
3825
+ left: this.detachableCoords.left && `${~~this.detachableCoords.left}px` || null,
3708
3826
  minWidth: this.minWidth && this.menuMinWidth || null,
3709
3827
  "--w-menu-bg-color": this.arrow && this.$waveui.colors[this.bgColor || "white"]
3710
3828
  };
@@ -3717,13 +3835,13 @@ const _sfc_main$s = {
3717
3835
  blur: this.toggleMenu,
3718
3836
  mouseenter: (e) => {
3719
3837
  this.hoveringActivator = true;
3720
- this.openMenu(e);
3838
+ this.open(e);
3721
3839
  },
3722
3840
  mouseleave: (e) => {
3723
3841
  this.hoveringActivator = false;
3724
3842
  setTimeout(() => {
3725
3843
  if (!this.hoveringMenu)
3726
- this.closeMenu();
3844
+ this.close();
3727
3845
  }, 10);
3728
3846
  }
3729
3847
  };
@@ -3737,7 +3855,7 @@ const _sfc_main$s = {
3737
3855
  },
3738
3856
  methods: {
3739
3857
  toggleMenu(e) {
3740
- let shouldShowMenu = this.menuVisible;
3858
+ let shouldShowMenu = this.detachableVisible;
3741
3859
  if ("ontouchstart" in window && this.showOnHover && e.type === "click") {
3742
3860
  shouldShowMenu = !shouldShowMenu;
3743
3861
  } else if (e.type === "click" && !this.showOnHover)
@@ -3751,20 +3869,20 @@ const _sfc_main$s = {
3751
3869
  }
3752
3870
  this.timeoutId = clearTimeout(this.timeoutId);
3753
3871
  if (shouldShowMenu) {
3754
- this.$emit("update:modelValue", this.menuVisible = true);
3872
+ this.$emit("update:modelValue", this.detachableVisible = true);
3755
3873
  this.$emit("input", true);
3756
3874
  this.$emit("open");
3757
- this.openMenu(e);
3875
+ this.open(e);
3758
3876
  } else
3759
- this.closeMenu();
3877
+ this.close();
3760
3878
  },
3761
- async openMenu(e) {
3762
- this.menuVisible = true;
3763
- await this.insertMenu();
3879
+ async open(e) {
3880
+ this.detachableVisible = true;
3881
+ await this.insertInDOM();
3764
3882
  if (this.minWidth === "activator")
3765
3883
  this.activatorWidth = this.activatorEl.offsetWidth;
3766
3884
  if (!this.noPosition)
3767
- this.computeMenuPosition(e);
3885
+ this.computeDetachableCoords(e);
3768
3886
  this.timeoutId = setTimeout(() => {
3769
3887
  this.$emit("update:modelValue", true);
3770
3888
  this.$emit("input", true);
@@ -3775,105 +3893,19 @@ const _sfc_main$s = {
3775
3893
  if (!this.noPosition)
3776
3894
  window.addEventListener("resize", this.onResize);
3777
3895
  },
3778
- async closeMenu(force = false) {
3779
- if (!this.menuVisible)
3896
+ async close(force = false) {
3897
+ if (!this.detachableVisible)
3780
3898
  return;
3781
3899
  if (this.showOnHover && !force) {
3782
3900
  await new Promise((resolve) => setTimeout(resolve, 10));
3783
3901
  if (this.showOnHover && (this.hoveringMenu || this.hoveringActivator))
3784
3902
  return;
3785
3903
  }
3786
- this.$emit("update:modelValue", this.menuVisible = false);
3904
+ this.$emit("update:modelValue", this.detachableVisible = false);
3787
3905
  this.$emit("input", false);
3788
3906
  this.$emit("close");
3789
3907
  document.removeEventListener("mousedown", this.onOutsideMousedown);
3790
3908
  window.removeEventListener("resize", this.onResize);
3791
- },
3792
- onOutsideMousedown(e) {
3793
- if (!this.menuEl.contains(e.target) && !this.activatorEl.contains(e.target)) {
3794
- this.$emit("update:modelValue", this.menuVisible = false);
3795
- this.$emit("input", false);
3796
- this.$emit("close");
3797
- document.removeEventListener("mousedown", this.onOutsideMousedown);
3798
- window.removeEventListener("resize", this.onResize);
3799
- }
3800
- },
3801
- onResize() {
3802
- if (this.minWidth === "activator")
3803
- this.activatorWidth = this.activatorEl.offsetWidth;
3804
- this.computeMenuPosition();
3805
- },
3806
- getCoordinates(e) {
3807
- const { top, left, width, height } = (e ? e.target : this.activatorEl).getBoundingClientRect();
3808
- let coords = { top, left, width, height };
3809
- if (!this.fixed) {
3810
- const { top: targetTop, left: targetLeft } = this.menuParentEl.getBoundingClientRect();
3811
- const computedStyles2 = window.getComputedStyle(this.menuParentEl, null);
3812
- coords = __spreadProps(__spreadValues({}, coords), {
3813
- top: top - targetTop + this.menuParentEl.scrollTop - parseInt(computedStyles2.getPropertyValue("border-top-width")),
3814
- left: left - targetLeft + this.menuParentEl.scrollLeft - parseInt(computedStyles2.getPropertyValue("border-left-width"))
3815
- });
3816
- }
3817
- return coords;
3818
- },
3819
- computeMenuPosition(e) {
3820
- let { top, left, width, height } = this.getCoordinates(e);
3821
- this.menuEl.style.visibility = "hidden";
3822
- this.menuEl.style.display = "flex";
3823
- const computedStyles2 = window.getComputedStyle(this.menuEl, null);
3824
- switch (this.position) {
3825
- case "top": {
3826
- top -= this.menuEl.offsetHeight;
3827
- if (this.alignRight) {
3828
- left += width - this.menuEl.offsetWidth + parseInt(computedStyles2.getPropertyValue("border-right-width"));
3829
- } else if (!this.alignLeft)
3830
- left += (width - this.menuEl.offsetWidth) / 2;
3831
- break;
3832
- }
3833
- case "bottom": {
3834
- top += height;
3835
- if (this.alignRight) {
3836
- left += width - this.menuEl.offsetWidth + parseInt(computedStyles2.getPropertyValue("border-right-width"));
3837
- } else if (!this.alignLeft)
3838
- left += (width - this.menuEl.offsetWidth) / 2;
3839
- break;
3840
- }
3841
- case "left": {
3842
- left -= this.menuEl.offsetWidth;
3843
- if (this.alignBottom)
3844
- top += height - this.menuEl.offsetHeight;
3845
- else if (!this.alignTop)
3846
- top += (height - this.menuEl.offsetHeight) / 2;
3847
- break;
3848
- }
3849
- case "right": {
3850
- left += width;
3851
- if (this.alignBottom) {
3852
- top += height - this.menuEl.offsetHeight + parseInt(computedStyles2.getPropertyValue("margin-top"));
3853
- } else if (!this.alignTop) {
3854
- top += (height - this.menuEl.offsetHeight) / 2 + parseInt(computedStyles2.getPropertyValue("margin-top"));
3855
- }
3856
- break;
3857
- }
3858
- }
3859
- this.menuEl.style.visibility = null;
3860
- if (!this.menuVisible)
3861
- this.menuEl.style.display = "none";
3862
- this.menuCoordinates = { top, left };
3863
- },
3864
- insertMenu() {
3865
- return new Promise((resolve) => {
3866
- this.$nextTick(() => {
3867
- var _a;
3868
- this.menuEl = ((_a = this.$refs.menu) == null ? void 0 : _a.$el) || this.$refs.menu;
3869
- this.detachToTarget.appendChild(this.menuEl);
3870
- resolve();
3871
- });
3872
- });
3873
- },
3874
- removeMenu() {
3875
- if (this.menuEl && this.menuEl.parentNode)
3876
- this.menuEl.remove();
3877
3909
  }
3878
3910
  },
3879
3911
  mounted() {
@@ -3889,7 +3921,7 @@ const _sfc_main$s = {
3889
3921
  this.toggleMenu({ type: "click", target: this.activatorEl });
3890
3922
  },
3891
3923
  beforeUnmount() {
3892
- this.removeMenu();
3924
+ this.removeFromDOM();
3893
3925
  if (this.overlay && this.overlayEl.parentNode)
3894
3926
  this.overlayEl.remove();
3895
3927
  if (this.activatorEl && this.activatorEl.parentNode)
@@ -3897,12 +3929,16 @@ const _sfc_main$s = {
3897
3929
  },
3898
3930
  watch: {
3899
3931
  modelValue(bool) {
3900
- if (!!bool !== this.menuVisible)
3932
+ if (!!bool !== this.detachableVisible)
3901
3933
  this.toggleMenu({ type: "click", target: this.activatorEl });
3902
3934
  },
3903
3935
  detachTo() {
3904
- this.removeMenu();
3905
- this.insertMenu();
3936
+ this.removeFromDOM();
3937
+ this.insertInDOM();
3938
+ },
3939
+ appendTo() {
3940
+ this.removeFromDOM();
3941
+ this.insertInDOM();
3906
3942
  }
3907
3943
  }
3908
3944
  };
@@ -4140,9 +4176,9 @@ const _sfc_main$q = {
4140
4176
  }
4141
4177
  };
4142
4178
  var wOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", render$q]]);
4143
- const _hoisted_1$f = { class: "w-parallax" };
4179
+ const _hoisted_1$g = { class: "w-parallax" };
4144
4180
  function render$p(_ctx, _cache, $props, $setup, $data, $options) {
4145
- return openBlock(), createElementBlock("div", _hoisted_1$f);
4181
+ return openBlock(), createElementBlock("div", _hoisted_1$g);
4146
4182
  }
4147
4183
  var wParallax_vue_vue_type_style_index_0_lang = "";
4148
4184
  const _sfc_main$p = {
@@ -4152,7 +4188,7 @@ const _sfc_main$p = {
4152
4188
  data: () => ({})
4153
4189
  };
4154
4190
  var wParallax = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", render$p]]);
4155
- const _hoisted_1$e = ["viewBox"];
4191
+ const _hoisted_1$f = ["viewBox"];
4156
4192
  const _hoisted_2$9 = ["cx", "cy", "r", "stroke-dasharray", "stroke-width"];
4157
4193
  const _hoisted_3$8 = ["viewBox"];
4158
4194
  const _hoisted_4$7 = ["cx", "cy", "r", "stroke-width", "stroke-linecap", "stroke-dasharray"];
@@ -4179,7 +4215,7 @@ function render$o(_ctx, _cache, $props, $setup, $data, $options) {
4179
4215
  "stroke-dasharray": _ctx.circleCircumference,
4180
4216
  "stroke-width": $props.stroke
4181
4217
  }, null, 10, _hoisted_2$9)) : createCommentVNode("", true)
4182
- ], 8, _hoisted_1$e)),
4218
+ ], 8, _hoisted_1$f)),
4183
4219
  (openBlock(), createElementBlock("svg", {
4184
4220
  class: "w-progress__progress",
4185
4221
  viewBox: `${$options.circleCenter / 2} ${$options.circleCenter / 2} ${$options.circleCenter} ${$options.circleCenter}`,
@@ -4278,7 +4314,7 @@ const _sfc_main$o = {
4278
4314
  }
4279
4315
  };
4280
4316
  var wProgress = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", render$o]]);
4281
- const _hoisted_1$d = ["id", "name", "checked", "disabled", "required", "tabindex", "aria-checked"];
4317
+ const _hoisted_1$e = ["id", "name", "checked", "disabled", "required", "tabindex", "aria-checked"];
4282
4318
  const _hoisted_2$8 = ["for"];
4283
4319
  const _hoisted_3$7 = ["for", "innerHTML"];
4284
4320
  const _hoisted_4$6 = ["for"];
@@ -4307,7 +4343,7 @@ function render$n(_ctx, _cache, $props, $setup, $data, $options) {
4307
4343
  onChange: _cache[1] || (_cache[1] = ($event) => $options.onInput($event)),
4308
4344
  "aria-checked": _ctx.inputValue || "false",
4309
4345
  role: "radio"
4310
- }, null, 40, _hoisted_1$d),
4346
+ }, null, 40, _hoisted_1$e),
4311
4347
  $options.hasLabel && $props.labelOnLeft ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
4312
4348
  _ctx.$slots.default ? (openBlock(), createElementBlock("label", {
4313
4349
  key: 0,
@@ -4417,7 +4453,7 @@ const _sfc_main$n = {
4417
4453
  }
4418
4454
  };
4419
4455
  var wRadio = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", render$n]]);
4420
- const _hoisted_1$c = ["innerHTML"];
4456
+ const _hoisted_1$d = ["innerHTML"];
4421
4457
  function render$m(_ctx, _cache, $props, $setup, $data, $options) {
4422
4458
  const _component_w_radio = resolveComponent("w-radio");
4423
4459
  return openBlock(), createBlock(resolveDynamicComponent(_ctx.formRegister ? "w-form-element" : "div"), mergeProps({ ref: "formEl" }, _ctx.formRegister && { validators: _ctx.validators, inputValue: _ctx.inputValue, disabled: _ctx.isDisabled }, {
@@ -4462,7 +4498,7 @@ function render$m(_ctx, _cache, $props, $setup, $data, $options) {
4462
4498
  }) : item.label ? (openBlock(), createElementBlock("div", {
4463
4499
  key: 2,
4464
4500
  innerHTML: item.label
4465
- }, null, 8, _hoisted_1$c)) : createCommentVNode("", true)
4501
+ }, null, 8, _hoisted_1$d)) : createCommentVNode("", true)
4466
4502
  ]),
4467
4503
  _: 2
4468
4504
  }, 1032, ["model-value", "onUpdate:modelValue", "name", "label", "label-on-left", "color", "disabled", "readonly", "class"]);
@@ -4520,7 +4556,7 @@ const _sfc_main$m = {
4520
4556
  }
4521
4557
  };
4522
4558
  var wRadios = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", render$m]]);
4523
- const _hoisted_1$b = ["id", "name", "value"];
4559
+ const _hoisted_1$c = ["id", "name", "value"];
4524
4560
  const _hoisted_2$7 = ["disabled", "onMouseenter", "onClick", "tabindex"];
4525
4561
  function render$l(_ctx, _cache, $props, $setup, $data, $options) {
4526
4562
  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 }, {
@@ -4537,7 +4573,7 @@ function render$l(_ctx, _cache, $props, $setup, $data, $options) {
4537
4573
  name: _ctx.inputName,
4538
4574
  type: "hidden",
4539
4575
  value: $data.rating
4540
- }, null, 8, _hoisted_1$b),
4576
+ }, null, 8, _hoisted_1$c),
4541
4577
  (openBlock(true), createElementBlock(Fragment, null, renderList($props.max, (i) => {
4542
4578
  return openBlock(), createElementBlock(Fragment, { key: i }, [
4543
4579
  _ctx.$slots.item ? renderSlot(_ctx.$slots, "item", {
@@ -4676,7 +4712,7 @@ const _sfc_main$l = {
4676
4712
  }
4677
4713
  };
4678
4714
  var wRating = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", render$l]]);
4679
- const _hoisted_1$a = ["for"];
4715
+ const _hoisted_1$b = ["for"];
4680
4716
  const _hoisted_2$6 = ["for", "innerHTML"];
4681
4717
  const _hoisted_3$6 = ["aria-expanded", "aria-owns", "aria-activedescendant"];
4682
4718
  const _hoisted_4$5 = {
@@ -4708,7 +4744,7 @@ function render$k(_ctx, _cache, $props, $setup, $data, $options) {
4708
4744
  for: `w-select--${_ctx._.uid}`
4709
4745
  }, [
4710
4746
  renderSlot(_ctx.$slots, "default")
4711
- ], 8, _hoisted_1$a)) : $props.label ? (openBlock(), createElementBlock("label", {
4747
+ ], 8, _hoisted_1$b)) : $props.label ? (openBlock(), createElementBlock("label", {
4712
4748
  key: 1,
4713
4749
  class: "w-select__label w-select__label--left w-form-el-shakable",
4714
4750
  for: `w-select--${_ctx._.uid}`,
@@ -4720,7 +4756,7 @@ function render$k(_ctx, _cache, $props, $setup, $data, $options) {
4720
4756
  "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => _ctx.showMenu = $event),
4721
4757
  "menu-class": `w-select__menu ${$props.menuClass || ""}`,
4722
4758
  transition: "slide-fade-down",
4723
- "detach-to": ($props.menuProps || {}).detachTo !== void 0 ? ($props.menuProps || {}).detachTo : ".w-app",
4759
+ "append-to": ($props.menuProps || {}).appendTo !== void 0 ? ($props.menuProps || {}).appendTo : ".w-app",
4724
4760
  "align-left": "",
4725
4761
  custom: "",
4726
4762
  "min-width": "activator"
@@ -4849,7 +4885,7 @@ function render$k(_ctx, _cache, $props, $setup, $data, $options) {
4849
4885
  ]), 1032, ["model-value", "onUpdate:modelValue", "onItemSelect", "onKeydown:escape", "items", "multiple", "add-ids", "no-unselect", "selection-color", "item-color-key"])
4850
4886
  ]),
4851
4887
  _: 3
4852
- }, 16, ["modelValue", "menu-class", "detach-to"]),
4888
+ }, 16, ["modelValue", "menu-class", "append-to"]),
4853
4889
  $props.labelPosition === "right" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
4854
4890
  _ctx.$slots.default ? (openBlock(), createElementBlock("label", {
4855
4891
  key: 0,
@@ -5045,7 +5081,7 @@ const _sfc_main$k = {
5045
5081
  }
5046
5082
  };
5047
5083
  var wSelect = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", render$k]]);
5048
- const _hoisted_1$9 = ["for"];
5084
+ const _hoisted_1$a = ["for"];
5049
5085
  const _hoisted_2$5 = ["for", "innerHTML"];
5050
5086
  const _hoisted_3$5 = { class: "w-slider__track-wrap" };
5051
5087
  const _hoisted_4$4 = ["aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-readonly"];
@@ -5077,7 +5113,7 @@ function render$j(_ctx, _cache, $props, $setup, $data, $options) {
5077
5113
  for: `button--${_ctx._.uid}`
5078
5114
  }, [
5079
5115
  renderSlot(_ctx.$slots, "label-left")
5080
- ], 8, _hoisted_1$9)) : $props.labelLeft ? (openBlock(), createElementBlock("label", {
5116
+ ], 8, _hoisted_1$a)) : $props.labelLeft ? (openBlock(), createElementBlock("label", {
5081
5117
  key: 1,
5082
5118
  class: "w-slider__label w-slider__label--left w-form-el-shakable",
5083
5119
  for: `button--${_ctx._.uid}`,
@@ -5332,14 +5368,14 @@ const _sfc_main$j = {
5332
5368
  }
5333
5369
  };
5334
5370
  var wSlider = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", render$j]]);
5335
- const _hoisted_1$8 = { key: 0 };
5371
+ const _hoisted_1$9 = { key: 0 };
5336
5372
  function render$i(_ctx, _cache, $props, $setup, $data, $options) {
5337
5373
  return $props.value || $props.value === void 0 ? (openBlock(), createElementBlock("div", {
5338
5374
  key: 0,
5339
5375
  class: normalizeClass(["w-spinner", $options.classes]),
5340
5376
  style: normalizeStyle($options.styles)
5341
5377
  }, [
5342
- $options.isThreeDots ? (openBlock(), createElementBlock("span", _hoisted_1$8)) : createCommentVNode("", true)
5378
+ $options.isThreeDots ? (openBlock(), createElementBlock("span", _hoisted_1$9)) : createCommentVNode("", true)
5343
5379
  ], 6)) : createCommentVNode("", true);
5344
5380
  }
5345
5381
  var wSpinner_vue_vue_type_style_index_0_lang = "";
@@ -5383,9 +5419,9 @@ const _sfc_main$i = {
5383
5419
  }
5384
5420
  };
5385
5421
  var wSpinner = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", render$i]]);
5386
- const _hoisted_1$7 = { class: "w-steps" };
5422
+ const _hoisted_1$8 = { class: "w-steps" };
5387
5423
  function render$h(_ctx, _cache, $props, $setup, $data, $options) {
5388
- return openBlock(), createElementBlock("div", _hoisted_1$7);
5424
+ return openBlock(), createElementBlock("div", _hoisted_1$8);
5389
5425
  }
5390
5426
  var wSteps_vue_vue_type_style_index_0_lang = "";
5391
5427
  const _sfc_main$h = {
@@ -5395,7 +5431,7 @@ const _sfc_main$h = {
5395
5431
  data: () => ({})
5396
5432
  };
5397
5433
  var wSteps = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", render$h]]);
5398
- const _hoisted_1$6 = ["id", "name", "checked", "disabled", "readonly", "aria-readonly", "required", "tabindex", "aria-checked"];
5434
+ const _hoisted_1$7 = ["id", "name", "checked", "disabled", "readonly", "aria-readonly", "required", "tabindex", "aria-checked"];
5399
5435
  const _hoisted_2$4 = ["for"];
5400
5436
  const _hoisted_3$4 = ["for", "innerHTML"];
5401
5437
  const _hoisted_4$3 = ["for"];
@@ -5426,7 +5462,7 @@ function render$g(_ctx, _cache, $props, $setup, $data, $options) {
5426
5462
  onFocus: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("focus", $event)),
5427
5463
  "aria-checked": $data.isOn || "false",
5428
5464
  role: "switch"
5429
- }, null, 40, _hoisted_1$6),
5465
+ }, null, 40, _hoisted_1$7),
5430
5466
  $options.hasLabel && $props.labelOnLeft ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
5431
5467
  _ctx.$slots.default ? (openBlock(), createElementBlock("label", {
5432
5468
  key: 0,
@@ -5538,15 +5574,15 @@ const _sfc_main$g = {
5538
5574
  }
5539
5575
  };
5540
5576
  var wSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", render$g]]);
5541
- const _hoisted_1$5 = { class: "w-tabs__content" };
5577
+ const _hoisted_1$6 = { class: "w-tabs__content" };
5542
5578
  function render$f(_ctx, _cache, $props, $setup, $data, $options) {
5543
- return openBlock(), createElementBlock("div", _hoisted_1$5, [
5579
+ return openBlock(), createElementBlock("div", _hoisted_1$6, [
5544
5580
  renderSlot(_ctx.$slots, "default")
5545
5581
  ]);
5546
5582
  }
5547
5583
  const _sfc_main$f = {};
5548
5584
  var TabContent = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", render$f]]);
5549
- const _hoisted_1$4 = ["onClick", "onFocus", "tabindex", "onKeypress", "aria-selected"];
5585
+ const _hoisted_1$5 = ["onClick", "onFocus", "tabindex", "onKeypress", "aria-selected"];
5550
5586
  const _hoisted_2$3 = ["innerHTML"];
5551
5587
  const _hoisted_3$3 = {
5552
5588
  key: 0,
@@ -5592,7 +5628,7 @@ function render$e(_ctx, _cache, $props, $setup, $data, $options) {
5592
5628
  innerHTML: item[$props.itemTitleKey]
5593
5629
  }, null, 8, _hoisted_2$3)
5594
5630
  ])
5595
- ], 42, _hoisted_1$4);
5631
+ ], 42, _hoisted_1$5);
5596
5632
  }), 128)),
5597
5633
  _ctx.$slots["tabs-bar-extra"] ? (openBlock(), createElementBlock("div", _hoisted_3$3, [
5598
5634
  renderSlot(_ctx.$slots, "tabs-bar-extra")
@@ -5800,7 +5836,7 @@ const _sfc_main$e = {
5800
5836
  }
5801
5837
  };
5802
5838
  var index = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", render$e]]);
5803
- const _hoisted_1$3 = { ref: "colgroup" };
5839
+ const _hoisted_1$4 = { ref: "colgroup" };
5804
5840
  const _hoisted_2$2 = ["width"];
5805
5841
  const _hoisted_3$2 = { key: 0 };
5806
5842
  const _hoisted_4$1 = ["onClick"];
@@ -5843,7 +5879,7 @@ function render$d(_ctx, _cache, $props, $setup, $data, $options) {
5843
5879
  onMouseover: _cache[2] || (_cache[2] = (...args) => $options.onMouseOver && $options.onMouseOver(...args)),
5844
5880
  onMouseout: _cache[3] || (_cache[3] = (...args) => $options.onMouseOut && $options.onMouseOut(...args))
5845
5881
  }, [
5846
- createElementVNode("colgroup", _hoisted_1$3, [
5882
+ createElementVNode("colgroup", _hoisted_1$4, [
5847
5883
  (openBlock(true), createElementBlock(Fragment, null, renderList($props.headers, (header, i) => {
5848
5884
  return openBlock(), createElementBlock("col", {
5849
5885
  class: "w-table__col",
@@ -6281,7 +6317,7 @@ const _sfc_main$d = {
6281
6317
  }
6282
6318
  };
6283
6319
  var wTable = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", render$d]]);
6284
- const _hoisted_1$2 = ["role", "aria-pressed", "tabindex"];
6320
+ const _hoisted_1$3 = ["role", "aria-pressed", "tabindex"];
6285
6321
  function render$c(_ctx, _cache, $props, $setup, $data, $options) {
6286
6322
  return openBlock(), createElementBlock("span", mergeProps({ class: "w-tag" }, toHandlers(_ctx.$attrs), {
6287
6323
  onClick: _cache[1] || (_cache[1] = ($event) => {
@@ -6309,7 +6345,7 @@ function render$c(_ctx, _cache, $props, $setup, $data, $options) {
6309
6345
  role: "icon",
6310
6346
  "aria-hidden": "true"
6311
6347
  })) : createCommentVNode("", true)
6312
- ], 16, _hoisted_1$2);
6348
+ ], 16, _hoisted_1$3);
6313
6349
  }
6314
6350
  var wTag_vue_vue_type_style_index_0_lang = "";
6315
6351
  const _sfc_main$c = {
@@ -6361,7 +6397,7 @@ const _sfc_main$c = {
6361
6397
  }
6362
6398
  };
6363
6399
  var wTag = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", render$c]]);
6364
- const _hoisted_1$1 = ["for"];
6400
+ const _hoisted_1$2 = ["for"];
6365
6401
  const _hoisted_2$1 = ["for", "innerHTML"];
6366
6402
  const _hoisted_3$1 = ["id", "name", "placeholder", "rows", "cols", "readonly", "aria-readonly", "disabled", "required", "tabindex"];
6367
6403
  const _hoisted_4 = ["for"];
@@ -6388,7 +6424,7 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
6388
6424
  for: `w-textarea--${_ctx._.uid}`
6389
6425
  }, [
6390
6426
  renderSlot(_ctx.$slots, "default")
6391
- ], 8, _hoisted_1$1)) : $props.label ? (openBlock(), createElementBlock("label", {
6427
+ ], 8, _hoisted_1$2)) : $props.label ? (openBlock(), createElementBlock("label", {
6392
6428
  key: 1,
6393
6429
  class: "w-textarea__label w-textarea__label--left w-form-el-shakable",
6394
6430
  for: `w-textarea--${_ctx._.uid}`,
@@ -6612,11 +6648,11 @@ const _sfc_main$b = {
6612
6648
  }
6613
6649
  };
6614
6650
  var wTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", render$b]]);
6615
- const _hoisted_1 = { class: "w-timeline" };
6651
+ const _hoisted_1$1 = { class: "w-timeline" };
6616
6652
  const _hoisted_2 = ["innerHTML"];
6617
6653
  const _hoisted_3 = ["innerHTML"];
6618
6654
  function render$a(_ctx, _cache, $props, $setup, $data, $options) {
6619
- return openBlock(), createElementBlock("ul", _hoisted_1, [
6655
+ return openBlock(), createElementBlock("ul", _hoisted_1$1, [
6620
6656
  (openBlock(true), createElementBlock(Fragment, null, renderList($props.items, (item, i) => {
6621
6657
  return openBlock(), createElementBlock("li", {
6622
6658
  class: "w-timeline-item",
@@ -6711,35 +6747,32 @@ const _sfc_main$9 = {
6711
6747
  }
6712
6748
  };
6713
6749
  var wToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", render$9]]);
6750
+ const _hoisted_1 = { class: "w-tooltip-wrap" };
6714
6751
  function render$8(_ctx, _cache, $props, $setup, $data, $options) {
6715
- return openBlock(), createElementBlock("div", {
6716
- class: normalizeClass(["w-tooltip-wrap", { "w-tooltip-wrap--attached": !$props.detachTo }])
6717
- }, [
6752
+ return openBlock(), createElementBlock("div", _hoisted_1, [
6718
6753
  renderSlot(_ctx.$slots, "activator", { on: $options.eventHandlers }),
6719
6754
  createVNode(Transition, {
6720
6755
  name: $options.transitionName,
6721
6756
  appear: ""
6722
6757
  }, {
6723
6758
  default: withCtx(() => [
6724
- withDirectives((openBlock(), createElementBlock("div", {
6759
+ _ctx.detachableVisible ? (openBlock(), createElementBlock("div", {
6725
6760
  class: normalizeClass(["w-tooltip", $options.classes]),
6726
- ref: (el) => _ctx.tooltipEl = el,
6761
+ ref: "detachable",
6727
6762
  key: _ctx._.uid,
6728
6763
  style: normalizeStyle($options.styles)
6729
6764
  }, [
6730
6765
  renderSlot(_ctx.$slots, "default")
6731
- ], 6)), [
6732
- [vShow, _ctx.showTooltip]
6733
- ])
6766
+ ], 6)) : createCommentVNode("", true)
6734
6767
  ]),
6735
6768
  _: 3
6736
6769
  }, 8, ["name"])
6737
- ], 2);
6770
+ ]);
6738
6771
  }
6739
6772
  var wTooltip_vue_vue_type_style_index_0_lang = "";
6740
- const marginFromWindowSide = 4;
6741
6773
  const _sfc_main$8 = {
6742
6774
  name: "w-tooltip",
6775
+ mixins: [DetachableMixin],
6743
6776
  props: {
6744
6777
  modelValue: {},
6745
6778
  showOnClick: { type: Boolean },
@@ -6751,25 +6784,31 @@ const _sfc_main$8 = {
6751
6784
  round: { type: Boolean },
6752
6785
  transition: { type: String },
6753
6786
  tooltipClass: { type: [String, Object, Array] },
6754
- detachTo: {},
6787
+ detachTo: { type: [String, Boolean, Object], deprecated: true },
6788
+ appendTo: { type: [String, Boolean, Object] },
6755
6789
  fixed: { type: Boolean },
6756
6790
  top: { type: Boolean },
6757
6791
  bottom: { type: Boolean },
6758
6792
  left: { type: Boolean },
6759
6793
  right: { type: Boolean },
6760
- zIndex: { type: [Number, String, Boolean] }
6794
+ alignTop: { type: Boolean },
6795
+ alignBottom: { type: Boolean },
6796
+ alignLeft: { type: Boolean },
6797
+ alignRight: { type: Boolean },
6798
+ zIndex: { type: [Number, String, Boolean] },
6799
+ persistent: { type: Boolean },
6800
+ noPosition: { type: Boolean }
6761
6801
  },
6762
6802
  emits: ["input", "update:modelValue", "open", "close"],
6763
6803
  data: () => ({
6764
- showTooltip: false,
6765
- coordinates: {
6804
+ detachableVisible: false,
6805
+ hoveringActivator: false,
6806
+ detachableCoords: {
6766
6807
  top: 0,
6767
- left: 0,
6768
- width: 0,
6769
- height: 0
6808
+ left: 0
6770
6809
  },
6771
6810
  activatorEl: null,
6772
- tooltipEl: null,
6811
+ detachableEl: null,
6773
6812
  timeoutId: null
6774
6813
  }),
6775
6814
  computed: {
@@ -6780,69 +6819,23 @@ const _sfc_main$8 = {
6780
6819
  const direction = this.position.replace(/top|bottom/, (m) => ({ top: "up", bottom: "down" })[m]);
6781
6820
  return this.transition || `w-tooltip-slide-fade-${direction}`;
6782
6821
  },
6783
- detachToTarget() {
6784
- const defaultTarget = ".w-app";
6785
- let target = this.detachTo || defaultTarget;
6786
- if (target === true)
6787
- target = defaultTarget;
6788
- else if (target && !["object", "string"].includes(typeof target))
6789
- target = defaultTarget;
6790
- else if (typeof target === "object" && !target.nodeType) {
6791
- target = defaultTarget;
6792
- consoleWarn("Invalid node provided in w-tooltip `attach-to`. Falling back to .w-app.");
6793
- }
6794
- if (typeof target === "string")
6795
- target = document.querySelector(target);
6796
- if (!target) {
6797
- consoleWarn(`Unable to locate ${this.detachTo ? `target ${this.detachTo}` : defaultTarget}`);
6798
- target = document.querySelector(defaultTarget);
6799
- }
6800
- return target;
6801
- },
6802
- tooltipParentEl() {
6803
- return this.detachTo ? this.detachToTarget : this.$el;
6804
- },
6805
6822
  position() {
6806
6823
  return this.top && "top" || this.bottom && "bottom" || this.left && "left" || this.right && "right" || "bottom";
6807
6824
  },
6808
- tooltipCoordinates() {
6809
- const coords = {};
6810
- const { top, left, width, height } = this.coordinates;
6811
- switch (this.position) {
6812
- case "top": {
6813
- coords.top = top;
6814
- coords.left = left + width / 2;
6815
- break;
6816
- }
6817
- case "bottom": {
6818
- coords.top = top + height;
6819
- coords.left = left + width / 2;
6820
- break;
6821
- }
6822
- case "left": {
6823
- coords.top = top + height / 2;
6824
- coords.left = left;
6825
- break;
6826
- }
6827
- case "right": {
6828
- coords.top = top + height / 2;
6829
- coords.left = left + width;
6830
- break;
6831
- }
6832
- }
6833
- return coords;
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" || "";
6834
6827
  },
6835
6828
  classes() {
6836
6829
  return __spreadProps(__spreadValues({
6837
6830
  [this.color]: this.color,
6838
6831
  [`${this.bgColor}--bg`]: this.bgColor
6839
6832
  }, this.tooltipClasses), {
6840
- [`w-tooltip--${this.position}`]: true,
6833
+ [`w-tooltip--${this.position}`]: !this.noPosition,
6834
+ [`w-tooltip--align-${this.alignment}`]: !this.noPosition && this.alignment,
6841
6835
  "w-tooltip--tile": this.tile,
6842
6836
  "w-tooltip--round": this.round,
6843
6837
  "w-tooltip--shadow": this.shadow,
6844
6838
  "w-tooltip--fixed": this.fixed,
6845
- "w-tooltip--active": this.showTooltip,
6846
6839
  "w-tooltip--no-border": this.noBorder || this.bgColor,
6847
6840
  "w-tooltip--custom-transition": this.transition
6848
6841
  });
@@ -6850,8 +6843,8 @@ const _sfc_main$8 = {
6850
6843
  styles() {
6851
6844
  return {
6852
6845
  zIndex: this.zIndex || this.zIndex === 0 || null,
6853
- top: this.tooltipCoordinates.top && `${~~this.tooltipCoordinates.top}px` || null,
6854
- left: this.tooltipCoordinates.left && `${~~this.tooltipCoordinates.left}px` || null,
6846
+ top: this.detachableCoords.top && `${~~this.detachableCoords.top}px` || null,
6847
+ left: this.detachableCoords.left && `${~~this.detachableCoords.left}px` || null,
6855
6848
  "--w-tooltip-bg-color": this.$waveui.colors[this.bgColor || "white"]
6856
6849
  };
6857
6850
  },
@@ -6863,8 +6856,14 @@ const _sfc_main$8 = {
6863
6856
  handlers = {
6864
6857
  focus: this.toggle,
6865
6858
  blur: this.toggle,
6866
- mouseenter: this.toggle,
6867
- mouseleave: this.toggle
6859
+ mouseenter: (e) => {
6860
+ this.hoveringActivator = true;
6861
+ this.open(e);
6862
+ },
6863
+ mouseleave: (e) => {
6864
+ this.hoveringActivator = false;
6865
+ this.close();
6866
+ }
6868
6867
  };
6869
6868
  if (typeof window !== "undefined" && "ontouchstart" in window)
6870
6869
  handlers.click = this.toggle;
@@ -6874,7 +6873,7 @@ const _sfc_main$8 = {
6874
6873
  },
6875
6874
  methods: {
6876
6875
  toggle(e) {
6877
- let shouldShowTooltip = this.showTooltip;
6876
+ let shouldShowTooltip = this.detachableVisible;
6878
6877
  if (typeof window !== "undefined" && "ontouchstart" in window) {
6879
6878
  if (e.type === "click")
6880
6879
  shouldShowTooltip = !shouldShowTooltip;
@@ -6886,88 +6885,69 @@ const _sfc_main$8 = {
6886
6885
  shouldShowTooltip = false;
6887
6886
  this.timeoutId = clearTimeout(this.timeoutId);
6888
6887
  if (shouldShowTooltip) {
6889
- this.coordinates = this.getCoordinates(e);
6890
- this.timeoutId = setTimeout(() => {
6891
- this.showTooltip = true;
6892
- this.$emit("update:modelValue", true);
6893
- this.$emit("input", true);
6894
- this.$emit("open");
6895
- }, 10);
6896
- } else {
6897
- this.showTooltip = false;
6898
- this.$emit("update:modelValue", false);
6899
- this.$emit("input", false);
6900
- this.$emit("close");
6901
- }
6902
- },
6903
- getCoordinates() {
6904
- const { top, left, width, height } = this.activatorEl.getBoundingClientRect();
6905
- let coords = { top, left, width, height };
6906
- if (!this.fixed) {
6907
- const { top: targetTop, left: targetLeft } = this.tooltipParentEl.getBoundingClientRect();
6908
- coords = __spreadProps(__spreadValues({}, coords), { top: top - targetTop, left: left - targetLeft });
6909
- }
6910
- const tooltip = this.tooltipEl;
6911
- tooltip.style.visibility = "hidden";
6912
- tooltip.style.display = "table";
6913
- const computedStyles2 = window.getComputedStyle(tooltip, null);
6914
- if (this.position === "top" && top - tooltip.offsetHeight < 0) {
6915
- const margin = -parseInt(computedStyles2.getPropertyValue("margin-top"));
6916
- coords.top -= top - tooltip.offsetHeight - margin - marginFromWindowSide;
6917
- } else if (this.position === "left" && left - tooltip.offsetWidth < 0) {
6918
- const margin = -parseInt(computedStyles2.getPropertyValue("margin-left"));
6919
- coords.left -= left - tooltip.offsetWidth - margin - marginFromWindowSide;
6920
- } else if (this.position === "right" && left + width + tooltip.offsetWidth > window.innerWidth) {
6921
- const margin = parseInt(computedStyles2.getPropertyValue("margin-left"));
6922
- coords.left -= left + width + tooltip.offsetWidth - window.innerWidth + margin + marginFromWindowSide;
6923
- } else if (this.position === "bottom" && top + height + tooltip.offsetHeight > window.innerHeight) {
6924
- const margin = parseInt(computedStyles2.getPropertyValue("margin-top"));
6925
- coords.top -= top + height + tooltip.offsetHeight - window.innerHeight + margin + marginFromWindowSide;
6926
- }
6927
- if (this.transition) {
6928
- if (["top", "bottom"].includes(this.position))
6929
- coords.left -= tooltip.offsetWidth / 2;
6930
- if (["left", "right"].includes(this.position))
6931
- coords.top -= tooltip.offsetHeight / 2;
6932
- if (this.position === "left")
6933
- coords.left -= tooltip.offsetWidth;
6934
- if (this.position === "top")
6935
- coords.top -= tooltip.offsetHeight;
6936
- }
6937
- tooltip.style.visibility = null;
6938
- tooltip.style.display = "none";
6939
- return coords;
6888
+ this.$emit("update:modelValue", this.detachableVisible = true);
6889
+ this.$emit("input", true);
6890
+ this.$emit("open");
6891
+ this.open(e);
6892
+ } else
6893
+ this.close();
6940
6894
  },
6941
- insertTooltip() {
6942
- const wrapper = this.$el;
6943
- wrapper.parentNode.insertBefore(this.activatorEl, wrapper);
6944
- this.detachToTarget.appendChild(this.tooltipEl);
6895
+ async open(e) {
6896
+ this.detachableVisible = true;
6897
+ await this.insertInDOM();
6898
+ if (this.minWidth === "activator")
6899
+ this.activatorWidth = this.activatorEl.offsetWidth;
6900
+ if (!this.noPosition)
6901
+ this.computeDetachableCoords(e);
6902
+ this.timeoutId = setTimeout(() => {
6903
+ this.$emit("update:modelValue", true);
6904
+ this.$emit("input", true);
6905
+ this.$emit("open");
6906
+ }, 0);
6907
+ if (!this.persistent)
6908
+ document.addEventListener("mousedown", this.onOutsideMousedown);
6909
+ if (!this.noPosition)
6910
+ window.addEventListener("resize", this.onResize);
6945
6911
  },
6946
- removeTooltip() {
6947
- if (this.tooltipEl && this.tooltipEl.parentNode)
6948
- this.tooltipEl.remove();
6912
+ async close(force = false) {
6913
+ if (!this.detachableVisible)
6914
+ return;
6915
+ if (this.showOnHover && !force) {
6916
+ await new Promise((resolve) => setTimeout(resolve, 10));
6917
+ if (this.showOnHover && this.hoveringActivator)
6918
+ return;
6919
+ }
6920
+ this.$emit("update:modelValue", this.detachableVisible = false);
6921
+ this.$emit("input", false);
6922
+ this.$emit("close");
6923
+ document.removeEventListener("mousedown", this.onOutsideMousedown);
6924
+ window.removeEventListener("resize", this.onResize);
6949
6925
  }
6950
6926
  },
6951
6927
  mounted() {
6952
- this.activatorEl = this.$el.firstElementChild;
6953
- if (this.detachTo)
6954
- this.insertTooltip();
6928
+ const wrapper = this.$el;
6929
+ this.activatorEl = wrapper.firstElementChild;
6930
+ wrapper.parentNode.insertBefore(this.activatorEl, wrapper);
6955
6931
  if (this.modelValue)
6956
6932
  this.toggle({ type: "click", target: this.activatorEl });
6957
6933
  },
6958
6934
  beforeUnmount() {
6959
- this.removeTooltip();
6935
+ this.removeFromDOM();
6960
6936
  if (this.activatorEl && this.activatorEl.parentNode)
6961
6937
  this.activatorEl.remove();
6962
6938
  },
6963
6939
  watch: {
6964
6940
  modelValue(bool) {
6965
- if (bool !== this.showTooltip)
6941
+ if (bool !== this.detachableVisible)
6966
6942
  this.toggle({ type: "click", target: this.activatorEl });
6967
6943
  },
6968
6944
  detachTo() {
6969
- this.removeTooltip();
6970
- this.insertTooltip();
6945
+ this.removeFromDOM();
6946
+ this.insertInDOM();
6947
+ },
6948
+ appendTo() {
6949
+ this.removeFromDOM();
6950
+ this.insertInDOM();
6971
6951
  }
6972
6952
  }
6973
6953
  };