wave-ui 2.29.0 → 2.31.2

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,
@@ -447,9 +447,6 @@ const _WaveUI = class {
447
447
  app.use(_WaveUI);
448
448
  notificationManager = reactive(new NotificationManager$1());
449
449
  mergeConfig(options);
450
- if (config.disableColorShades) {
451
- consoleWarn("WARNING - Since version 1.30 (Vue 2) & 2.17 (Vue 3), the option `disableColorShades` is replaced with `css.colorShades`.\nhttps://antoniandre.github.io/wave-ui/release-notes");
452
- }
453
450
  if (config.css.colorShades) {
454
451
  config.colorShades = {};
455
452
  for (let color in config.colors) {
@@ -500,10 +497,10 @@ let WaveUI = _WaveUI;
500
497
  __publicField(WaveUI, "instance", null);
501
498
  __publicField(WaveUI, "vueInstance", null);
502
499
  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"];
500
+ const _hoisted_1$u = ["aria-expanded"];
501
+ const _hoisted_2$e = ["onClick", "onFocus", "onKeypress", "tabindex"];
502
+ const _hoisted_3$b = ["innerHTML"];
503
+ const _hoisted_4$a = ["innerHTML"];
507
504
  function render$O(_ctx, _cache, $props, $setup, $data, $options) {
508
505
  const _component_w_button = resolveComponent("w-button");
509
506
  const _component_w_transition_expand = resolveComponent("w-transition-expand");
@@ -548,7 +545,7 @@ function render$O(_ctx, _cache, $props, $setup, $data, $options) {
548
545
  createElementVNode("div", {
549
546
  class: "grow",
550
547
  innerHTML: item[$props.itemTitleKey]
551
- }, null, 8, _hoisted_3$c)
548
+ }, null, 8, _hoisted_3$b)
552
549
  ]),
553
550
  $props.expandIcon && $props.expandIconRight ? (openBlock(), createBlock(_component_w_button, {
554
551
  key: 3,
@@ -559,7 +556,7 @@ function render$O(_ctx, _cache, $props, $setup, $data, $options) {
559
556
  }, ["stop"])),
560
557
  onClick: withModifiers(($event) => !item._disabled && $options.toggleItem(item, $event), ["stop"])
561
558
  }, null, 8, ["icon", "onClick", "class"])) : createCommentVNode("", true)
562
- ], 42, _hoisted_2$f),
559
+ ], 42, _hoisted_2$e),
563
560
  createVNode(_component_w_transition_expand, { y: "" }, {
564
561
  default: withCtx(() => [
565
562
  item._expanded ? (openBlock(), createElementBlock("div", {
@@ -579,13 +576,13 @@ function render$O(_ctx, _cache, $props, $setup, $data, $options) {
579
576
  }, () => [
580
577
  createElementVNode("div", {
581
578
  innerHTML: item[$props.itemContentKey]
582
- }, null, 8, _hoisted_4$b)
579
+ }, null, 8, _hoisted_4$a)
583
580
  ])
584
581
  ], 2)) : createCommentVNode("", true)
585
582
  ]),
586
583
  _: 2
587
584
  }, 1024)
588
- ], 10, _hoisted_1$s);
585
+ ], 10, _hoisted_1$u);
589
586
  }), 128))
590
587
  ], 2);
591
588
  }
@@ -670,7 +667,7 @@ const _sfc_main$O = {
670
667
  }
671
668
  };
672
669
  var wAccordion = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", render$O]]);
673
- const _hoisted_1$r = { class: "w-alert__content" };
670
+ const _hoisted_1$t = { class: "w-alert__content" };
674
671
  function render$N(_ctx, _cache, $props, $setup, $data, $options) {
675
672
  const _component_w_icon = resolveComponent("w-icon");
676
673
  const _component_w_button = resolveComponent("w-button");
@@ -688,7 +685,7 @@ function render$N(_ctx, _cache, $props, $setup, $data, $options) {
688
685
  ]),
689
686
  _: 1
690
687
  })) : createCommentVNode("", true),
691
- createElementVNode("div", _hoisted_1$r, [
688
+ createElementVNode("div", _hoisted_1$t, [
692
689
  renderSlot(_ctx.$slots, "default")
693
690
  ]),
694
691
  $props.dismiss ? (openBlock(), createBlock(_component_w_button, {
@@ -785,6 +782,7 @@ const _sfc_main$N = {
785
782
  }
786
783
  };
787
784
  var wAlert = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["render", render$N]]);
785
+ const _hoisted_1$s = ["innerHTML"];
788
786
  function render$M(_ctx, _cache, $props, $setup, $data, $options) {
789
787
  const _component_w_alert = resolveComponent("w-alert");
790
788
  return openBlock(), createBlock(TransitionGroup, {
@@ -803,9 +801,11 @@ function render$M(_ctx, _cache, $props, $setup, $data, $options) {
803
801
  modelValue: notif._value,
804
802
  "onUpdate:modelValue": ($event) => notif._value = $event,
805
803
  onClose: ($event) => _ctx.notifManager.dismiss(notif._uid)
806
- }, notif), {
804
+ }, $options.notifProps(notif)), {
807
805
  default: withCtx(() => [
808
- createTextVNode(toDisplayString(notif.message), 1)
806
+ createElementVNode("div", {
807
+ innerHTML: notif.message
808
+ }, null, 8, _hoisted_1$s)
809
809
  ]),
810
810
  _: 2
811
811
  }, 1040, ["modelValue", "onUpdate:modelValue", "onClose"])) : createCommentVNode("", true)
@@ -833,6 +833,12 @@ const _sfc_main$M = {
833
833
  return this.conf.transition ? this.conf.transition.replace("default", `slide-${this.conf.align === "left" ? "right" : "left"}`) : "";
834
834
  }
835
835
  },
836
+ methods: {
837
+ notifProps(notif) {
838
+ const _a = notif, { _value, _uid, message, timeout } = _a, props = __objRest(_a, ["_value", "_uid", "message", "timeout"]);
839
+ return props;
840
+ }
841
+ },
836
842
  created() {
837
843
  this.notifManager = new NotificationManager$1();
838
844
  },
@@ -1135,7 +1141,7 @@ const _sfc_main$K = {
1135
1141
  }
1136
1142
  };
1137
1143
  var wBadge = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["render", render$K]]);
1138
- const _hoisted_1$q = ["innerHTML"];
1144
+ const _hoisted_1$r = ["innerHTML"];
1139
1145
  function render$J(_ctx, _cache, $props, $setup, $data, $options) {
1140
1146
  const _component_w_icon = resolveComponent("w-icon");
1141
1147
  return openBlock(), createElementBlock("div", {
@@ -1187,7 +1193,7 @@ function render$J(_ctx, _cache, $props, $setup, $data, $options) {
1187
1193
  }) : (openBlock(), createElementBlock("span", {
1188
1194
  key: `${i}f`,
1189
1195
  innerHTML: item[$props.itemLabelKey]
1190
- }, null, 8, _hoisted_1$q))
1196
+ }, null, 8, _hoisted_1$r))
1191
1197
  ], 64);
1192
1198
  }), 256))
1193
1199
  ], 2);
@@ -1225,11 +1231,11 @@ const _sfc_main$J = {
1225
1231
  }
1226
1232
  };
1227
1233
  var wBreadcrumbs = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["render", render$J]]);
1228
- const _hoisted_1$p = {
1234
+ const _hoisted_1$q = {
1229
1235
  key: 0,
1230
1236
  class: "w-button__loader"
1231
1237
  };
1232
- const _hoisted_2$e = /* @__PURE__ */ createElementVNode("svg", { viewBox: "0 0 40 40" }, [
1238
+ const _hoisted_2$d = /* @__PURE__ */ createElementVNode("svg", { viewBox: "0 0 40 40" }, [
1233
1239
  /* @__PURE__ */ createElementVNode("circle", {
1234
1240
  cx: "20",
1235
1241
  cy: "20",
@@ -1257,9 +1263,9 @@ function render$I(_ctx, _cache, $props, $setup, $data, $options) {
1257
1263
  })) : renderSlot(_ctx.$slots, "default", { key: 1 }),
1258
1264
  createVNode(Transition, { name: "scale-fade" }, {
1259
1265
  default: withCtx(() => [
1260
- $props.loading ? (openBlock(), createElementBlock("div", _hoisted_1$p, [
1266
+ $props.loading ? (openBlock(), createElementBlock("div", _hoisted_1$q, [
1261
1267
  renderSlot(_ctx.$slots, "loading", {}, () => [
1262
- _hoisted_2$e
1268
+ _hoisted_2$d
1263
1269
  ])
1264
1270
  ])) : createCommentVNode("", true)
1265
1271
  ]),
@@ -1370,7 +1376,7 @@ const objectifyClasses = (classes = {}) => {
1370
1376
  classes = { [classes.join(" ")]: true };
1371
1377
  return classes;
1372
1378
  };
1373
- const _hoisted_1$o = ["innerHTML"];
1379
+ const _hoisted_1$p = ["innerHTML"];
1374
1380
  function render$H(_ctx, _cache, $props, $setup, $data, $options) {
1375
1381
  const _component_w_image = resolveComponent("w-image");
1376
1382
  return openBlock(), createElementBlock("div", {
@@ -1386,7 +1392,7 @@ function render$H(_ctx, _cache, $props, $setup, $data, $options) {
1386
1392
  key: 1,
1387
1393
  class: normalizeClass(["w-card__title", $options.titleClasses]),
1388
1394
  innerHTML: $props.title
1389
- }, null, 10, _hoisted_1$o)) : createCommentVNode("", true),
1395
+ }, null, 10, _hoisted_1$p)) : createCommentVNode("", true),
1390
1396
  $props.image ? (openBlock(), createBlock(_component_w_image, mergeProps({
1391
1397
  key: 2,
1392
1398
  class: "w-card__image",
@@ -1495,10 +1501,10 @@ var FormElementMixin = {
1495
1501
  }
1496
1502
  }
1497
1503
  };
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", {
1504
+ const _hoisted_1$o = ["id", "name", "checked", "disabled", "required", "tabindex", "aria-checked"];
1505
+ const _hoisted_2$c = ["for"];
1506
+ const _hoisted_3$a = ["for", "innerHTML"];
1507
+ const _hoisted_4$9 = /* @__PURE__ */ createElementVNode("svg", {
1502
1508
  width: "11px",
1503
1509
  height: "9px",
1504
1510
  viewbox: "0 0 12 9"
@@ -1506,7 +1512,7 @@ const _hoisted_4$a = /* @__PURE__ */ createElementVNode("svg", {
1506
1512
  /* @__PURE__ */ createElementVNode("polyline", { points: "1 5 4 8 10 2" })
1507
1513
  ], -1);
1508
1514
  const _hoisted_5$8 = [
1509
- _hoisted_4$a
1515
+ _hoisted_4$9
1510
1516
  ];
1511
1517
  const _hoisted_6$5 = ["for"];
1512
1518
  const _hoisted_7$5 = ["for", "innerHTML"];
@@ -1536,7 +1542,7 @@ function render$G(_ctx, _cache, $props, $setup, $data, $options) {
1536
1542
  onKeypress: _cache[3] || (_cache[3] = withKeys((...args) => $options.onInput && $options.onInput(...args), ["enter"])),
1537
1543
  "aria-checked": $data.isChecked || "false",
1538
1544
  role: "checkbox"
1539
- }, null, 40, _hoisted_1$n),
1545
+ }, null, 40, _hoisted_1$o),
1540
1546
  $options.hasLabel && $props.labelOnLeft ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1541
1547
  _ctx.$slots.default ? (openBlock(), createElementBlock("label", {
1542
1548
  key: 0,
@@ -1544,12 +1550,12 @@ function render$G(_ctx, _cache, $props, $setup, $data, $options) {
1544
1550
  for: `w-checkbox--${_ctx._.uid}`
1545
1551
  }, [
1546
1552
  renderSlot(_ctx.$slots, "default")
1547
- ], 8, _hoisted_2$d)) : $props.label ? (openBlock(), createElementBlock("label", {
1553
+ ], 8, _hoisted_2$c)) : $props.label ? (openBlock(), createElementBlock("label", {
1548
1554
  key: 1,
1549
1555
  class: "w-checkbox__label w-form-el-shakable pr2",
1550
1556
  for: `w-checkbox--${_ctx._.uid}`,
1551
1557
  innerHTML: $props.label
1552
- }, null, 8, _hoisted_3$b)) : createCommentVNode("", true)
1558
+ }, null, 8, _hoisted_3$a)) : createCommentVNode("", true)
1553
1559
  ], 64)) : createCommentVNode("", true),
1554
1560
  createElementVNode("div", {
1555
1561
  class: normalizeClass(["w-checkbox__input", this.color]),
@@ -1646,7 +1652,7 @@ const _sfc_main$G = {
1646
1652
  }
1647
1653
  };
1648
1654
  var wCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["render", render$G]]);
1649
- const _hoisted_1$m = ["innerHTML"];
1655
+ const _hoisted_1$n = ["innerHTML"];
1650
1656
  function render$F(_ctx, _cache, $props, $setup, $data, $options) {
1651
1657
  const _component_w_checkbox = resolveComponent("w-checkbox");
1652
1658
  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 +1695,7 @@ function render$F(_ctx, _cache, $props, $setup, $data, $options) {
1689
1695
  }) : item.label ? (openBlock(), createElementBlock("div", {
1690
1696
  key: 2,
1691
1697
  innerHTML: item.label
1692
- }, null, 8, _hoisted_1$m)) : createCommentVNode("", true)
1698
+ }, null, 8, _hoisted_1$n)) : createCommentVNode("", true)
1693
1699
  ]),
1694
1700
  _: 2
1695
1701
  }, 1032, ["model-value", "name", "label", "label-on-left", "color", "round", "onUpdate:modelValue", "disabled", "readonly", "class"]);
@@ -1755,21 +1761,18 @@ const _sfc_main$F = {
1755
1761
  }
1756
1762
  };
1757
1763
  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");
1764
+ const _hoisted_1$m = { class: "w-confirm" };
1762
1765
  function render$E(_ctx, _cache, $props, $setup, $data, $options) {
1763
1766
  const _component_w_button = resolveComponent("w-button");
1764
1767
  const _component_w_flex = resolveComponent("w-flex");
1765
1768
  const _component_w_menu = resolveComponent("w-menu");
1766
- return openBlock(), createElementBlock("div", _hoisted_1$l, [
1769
+ return openBlock(), createElementBlock("div", _hoisted_1$m, [
1767
1770
  createVNode(_component_w_menu, mergeProps({
1768
1771
  modelValue: _ctx.showPopup,
1769
1772
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.showPopup = $event)
1770
1773
  }, $options.wMenuProps), {
1771
1774
  activator: withCtx(({ on }) => [
1772
- createVNode(_component_w_button, mergeProps({ class: "w-confirm__button" }, toHandlers(on), $options.buttonProps), {
1775
+ createVNode(_component_w_button, mergeProps({ class: "w-confirm__button" }, __spreadValues(__spreadValues(__spreadValues({}, _ctx.$attrs), $options.buttonProps), on)), {
1773
1776
  default: withCtx(() => [
1774
1777
  renderSlot(_ctx.$slots, "default")
1775
1778
  ]),
@@ -1784,33 +1787,33 @@ function render$E(_ctx, _cache, $props, $setup, $data, $options) {
1784
1787
  default: withCtx(() => [
1785
1788
  createElementVNode("div", null, [
1786
1789
  renderSlot(_ctx.$slots, "question", {}, () => [
1787
- _hoisted_2$c
1790
+ createTextVNode(toDisplayString($props.question), 1)
1788
1791
  ])
1789
1792
  ]),
1790
1793
  createElementVNode("div", {
1791
1794
  class: normalizeClass(["w-flex justify-end", $props.inline ? "ml2" : "mt2"])
1792
1795
  }, [
1793
- !$props.noCancel ? (openBlock(), createBlock(_component_w_button, mergeProps({
1796
+ $props.cancel !== false ? (openBlock(), createBlock(_component_w_button, mergeProps({
1794
1797
  key: 0,
1795
1798
  class: "mr2"
1796
- }, $props.cancelButton, {
1797
- "bg-color": ($props.cancelButton || {}).bgColor || "error",
1799
+ }, $options.cancelButtonProps, {
1800
+ "bg-color": ($options.cancelButton || {}).bgColor || "error",
1798
1801
  onClick: $options.onCancel
1799
1802
  }), {
1800
1803
  default: withCtx(() => [
1801
1804
  renderSlot(_ctx.$slots, "cancel", {}, () => [
1802
- _hoisted_3$a
1805
+ createTextVNode(toDisplayString($options.cancelButton.label), 1)
1803
1806
  ])
1804
1807
  ]),
1805
1808
  _: 3
1806
1809
  }, 16, ["bg-color", "onClick"])) : createCommentVNode("", true),
1807
- createVNode(_component_w_button, mergeProps($props.confirmButton, {
1808
- "bg-color": ($props.confirmButton || {}).bgColor || "success",
1810
+ createVNode(_component_w_button, mergeProps($options.confirmButtonProps, {
1811
+ "bg-color": ($options.confirmButton || {}).bgColor || "success",
1809
1812
  onClick: $options.onConfirm
1810
1813
  }), {
1811
1814
  default: withCtx(() => [
1812
1815
  renderSlot(_ctx.$slots, "confirm", {}, () => [
1813
- _hoisted_4$9
1816
+ createTextVNode(toDisplayString($options.confirmButton.label), 1)
1814
1817
  ])
1815
1818
  ]),
1816
1819
  _: 3
@@ -1831,9 +1834,9 @@ const _sfc_main$E = {
1831
1834
  color: { type: String },
1832
1835
  icon: { type: String },
1833
1836
  mainButton: { type: Object },
1834
- noCancel: { type: Boolean },
1835
- cancelButton: { type: [Boolean, Object] },
1836
- confirmButton: { type: Object },
1837
+ question: { type: String, default: "Are you sure?" },
1838
+ cancel: { type: [Boolean, Object, String], default: void 0 },
1839
+ confirm: { type: [Object, String] },
1837
1840
  inline: { type: Boolean },
1838
1841
  menu: { type: Object },
1839
1842
  noArrow: { type: Boolean },
@@ -1854,6 +1857,26 @@ const _sfc_main$E = {
1854
1857
  props: []
1855
1858
  }),
1856
1859
  computed: {
1860
+ cancelButton() {
1861
+ let button = { label: typeof this.cancel === "string" ? this.cancel : "Cancel" };
1862
+ if (typeof this.cancel === "object")
1863
+ button = Object.assign({}, button, this.cancel);
1864
+ return button;
1865
+ },
1866
+ cancelButtonProps() {
1867
+ const _a = this.cancelButton, { label } = _a, props = __objRest(_a, ["label"]);
1868
+ return props;
1869
+ },
1870
+ confirmButton() {
1871
+ let button = { label: typeof this.confirm === "string" ? this.confirm : "Confirm" };
1872
+ if (typeof this.confirm === "object")
1873
+ button = Object.assign({}, button, this.confirm);
1874
+ return button;
1875
+ },
1876
+ confirmButtonProps() {
1877
+ const _a = this.confirmButton, { label } = _a, props = __objRest(_a, ["label"]);
1878
+ return props;
1879
+ },
1857
1880
  wMenuProps() {
1858
1881
  return __spreadValues({
1859
1882
  top: this.top,
@@ -2062,7 +2085,7 @@ const _sfc_main$B = {
2062
2085
  }
2063
2086
  };
2064
2087
  var wDivider = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", render$B]]);
2065
- const _hoisted_1$k = { class: "w-drawer-wrap__pushable" };
2088
+ const _hoisted_1$l = { class: "w-drawer-wrap__pushable" };
2066
2089
  function render$A(_ctx, _cache, $props, $setup, $data, $options) {
2067
2090
  const _component_w_overlay = resolveComponent("w-overlay");
2068
2091
  return $data.showWrapper || $props.pushContent ? (openBlock(), createElementBlock("div", {
@@ -2074,7 +2097,7 @@ function render$A(_ctx, _cache, $props, $setup, $data, $options) {
2074
2097
  class: "w-drawer-wrap__track",
2075
2098
  style: normalizeStyle($options.trackStyles)
2076
2099
  }, [
2077
- createElementVNode("div", _hoisted_1$k, [
2100
+ createElementVNode("div", _hoisted_1$l, [
2078
2101
  !$props.noOverlay ? (openBlock(), createBlock(_component_w_overlay, {
2079
2102
  key: 0,
2080
2103
  modelValue: $data.showDrawer,
@@ -2454,7 +2477,7 @@ const _sfc_main$y = {
2454
2477
  }
2455
2478
  };
2456
2479
  var wForm = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", render$y]]);
2457
- const _hoisted_1$j = {
2480
+ const _hoisted_1$k = {
2458
2481
  key: 0,
2459
2482
  class: "w-form-el__error error w-form-el__error w-form-el__error"
2460
2483
  };
@@ -2472,7 +2495,7 @@ function render$x(_ctx, _cache, $props, $setup, $data, $options) {
2472
2495
  createVNode(_component_w_transition_expand, { y: "" }, {
2473
2496
  default: withCtx(() => [
2474
2497
  _ctx.Validation.message ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2475
- _ctx.$slots["error-message"] ? (openBlock(), createElementBlock("div", _hoisted_1$j, [
2498
+ _ctx.$slots["error-message"] ? (openBlock(), createElementBlock("div", _hoisted_1$k, [
2476
2499
  renderSlot(_ctx.$slots, "error-message", {
2477
2500
  message: _ctx.Validation.message
2478
2501
  })
@@ -2652,7 +2675,7 @@ const _sfc_main$w = {
2652
2675
  }
2653
2676
  };
2654
2677
  var wIcon = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", render$w]]);
2655
- const _hoisted_1$i = {
2678
+ const _hoisted_1$j = {
2656
2679
  key: 0,
2657
2680
  class: "w-image__loader"
2658
2681
  };
@@ -2677,7 +2700,7 @@ function render$v(_ctx, _cache, $props, $setup, $data, $options) {
2677
2700
  ]),
2678
2701
  _: 1
2679
2702
  }, 8, ["name"]),
2680
- !$props.noSpinner && $data.loading ? (openBlock(), createElementBlock("div", _hoisted_1$i, [
2703
+ !$props.noSpinner && $data.loading ? (openBlock(), createElementBlock("div", _hoisted_1$j, [
2681
2704
  _ctx.$slots.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(_component_w_progress, {
2682
2705
  key: 1,
2683
2706
  circle: "",
@@ -2822,11 +2845,11 @@ const _sfc_main$v = {
2822
2845
  }
2823
2846
  };
2824
2847
  var wImage = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", render$v]]);
2825
- const _hoisted_1$h = ["name"];
2848
+ const _hoisted_1$i = ["name"];
2826
2849
  const _hoisted_2$a = ["for"];
2827
2850
  const _hoisted_3$9 = ["for", "innerHTML"];
2828
2851
  const _hoisted_4$8 = ["id", "type", "name", "placeholder", "step", "min", "max", "minlength", "maxlength", "readonly", "aria-readonly", "disabled", "required", "tabindex"];
2829
- const _hoisted_5$7 = ["id", "name", "multiple"];
2852
+ const _hoisted_5$7 = ["id", "name", "multiple", "data-progress"];
2830
2853
  const _hoisted_6$4 = {
2831
2854
  class: "w-input__no-file",
2832
2855
  key: "no-file"
@@ -2857,22 +2880,22 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
2857
2880
  type: "hidden",
2858
2881
  name: _ctx.name || null,
2859
2882
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.inputValue = $event)
2860
- }, null, 8, _hoisted_1$h)), [
2883
+ }, null, 8, _hoisted_1$i)), [
2861
2884
  [vModelText, $data.inputValue]
2862
2885
  ]) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2863
2886
  $props.labelPosition === "left" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2864
2887
  _ctx.$slots.default ? (openBlock(), createElementBlock("label", {
2865
2888
  key: 0,
2866
- class: "w-input__label w-input__label--left w-form-el-shakable",
2889
+ class: normalizeClass(["w-input__label w-input__label--left w-form-el-shakable", $options.validationClasses]),
2867
2890
  for: `w-input--${_ctx._.uid}`
2868
2891
  }, [
2869
2892
  renderSlot(_ctx.$slots, "default")
2870
- ], 8, _hoisted_2$a)) : $props.label ? (openBlock(), createElementBlock("label", {
2893
+ ], 10, _hoisted_2$a)) : $props.label ? (openBlock(), createElementBlock("label", {
2871
2894
  key: 1,
2872
- class: "w-input__label w-input__label--left w-form-el-shakable",
2895
+ class: normalizeClass(["w-input__label w-input__label--left w-form-el-shakable", $options.validationClasses]),
2873
2896
  for: `w-input--${_ctx._.uid}`,
2874
2897
  innerHTML: $props.label
2875
- }, null, 8, _hoisted_3$9)) : createCommentVNode("", true)
2898
+ }, null, 10, _hoisted_3$9)) : createCommentVNode("", true)
2876
2899
  ], 64)) : createCommentVNode("", true),
2877
2900
  createElementVNode("div", {
2878
2901
  class: normalizeClass(["w-input__input-wrap", $options.inputWrapClasses])
@@ -2924,7 +2947,9 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
2924
2947
  onBlur: _cache[7] || (_cache[7] = (...args) => $options.onBlur && $options.onBlur(...args)),
2925
2948
  onChange: _cache[8] || (_cache[8] = (...args) => $options.onFileChange && $options.onFileChange(...args)),
2926
2949
  multiple: $props.multiple || null
2927
- }, $options.attrs), null, 16, _hoisted_5$7),
2950
+ }, $options.attrs, {
2951
+ "data-progress": $options.overallFilesProgress
2952
+ }), null, 16, _hoisted_5$7),
2928
2953
  createVNode(TransitionGroup, {
2929
2954
  class: "w-input__input w-input__input--file",
2930
2955
  tag: "label",
@@ -2948,7 +2973,7 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
2948
2973
  class: "filename",
2949
2974
  key: `${i}b`
2950
2975
  }, toDisplayString(file.base), 1)),
2951
- createTextVNode(toDisplayString(file.extension), 1)
2976
+ createTextVNode(toDisplayString(file.extension ? `.${file.extension}` : ""), 1)
2952
2977
  ]);
2953
2978
  }), 128))
2954
2979
  ]),
@@ -2958,13 +2983,13 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
2958
2983
  $props.labelPosition === "inside" && $options.showLabelInside ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
2959
2984
  _ctx.$slots.default ? (openBlock(), createElementBlock("label", {
2960
2985
  key: 0,
2961
- 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 }]),
2986
+ class: normalizeClass(["w-input__label w-input__label--inside w-form-el-shakable", $options.validationClasses]),
2962
2987
  for: `w-input--${_ctx._.uid}`
2963
2988
  }, [
2964
2989
  renderSlot(_ctx.$slots, "default")
2965
2990
  ], 10, _hoisted_8$3)) : $props.label ? (openBlock(), createElementBlock("label", {
2966
2991
  key: 1,
2967
- 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 }]),
2992
+ class: normalizeClass(["w-input__label w-input__label--inside w-form-el-shakable", $options.validationClasses]),
2968
2993
  for: `w-input--${_ctx._.uid}`,
2969
2994
  innerHTML: $props.label
2970
2995
  }, null, 10, _hoisted_9$3)) : createCommentVNode("", true)
@@ -2980,9 +3005,16 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
2980
3005
  createTextVNode(toDisplayString($props.innerIconRight), 1)
2981
3006
  ]),
2982
3007
  _: 1
2983
- }, 8, ["for"])) : createCommentVNode("", true)
3008
+ }, 8, ["for"])) : createCommentVNode("", true),
3009
+ $options.hasLoading || $props.showProgress && ($options.uploadInProgress || $options.uploadComplete) ? (openBlock(), createBlock(_component_w_progress, {
3010
+ key: 5,
3011
+ class: "fill-width",
3012
+ size: "2",
3013
+ color: $props.progressColor || $props.color,
3014
+ "model-value": $props.showProgress ? ($options.uploadInProgress || $options.uploadComplete) && $options.overallFilesProgress : $options.loadingValue
3015
+ }, null, 8, ["color", "model-value"])) : createCommentVNode("", true)
2984
3016
  ], 2),
2985
- $props.type === "file" && $data.inputFiles.length ? (openBlock(), createElementBlock("label", {
3017
+ $props.type === "file" && $props.preview && $data.inputFiles.length ? (openBlock(), createElementBlock("label", {
2986
3018
  key: 1,
2987
3019
  class: "d-flex",
2988
3020
  for: `w-input--${_ctx._.uid}`
@@ -2998,32 +3030,26 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
2998
3030
  src: file.preview,
2999
3031
  alt: ""
3000
3032
  }, null, 8, _hoisted_11$2)) : (openBlock(), createElementBlock("i", {
3001
- class: "w-icon wi-file w-input__file-preview primary",
3033
+ class: normalizeClass(["w-icon w-input__file-preview primary size--md", $props.preview && typeof $props.preview === "string" ? $props.preview : "wi-file"]),
3002
3034
  key: `${i}c`
3003
- }))
3035
+ }, null, 2))
3004
3036
  ], 64);
3005
3037
  }), 256))
3006
3038
  ], 8, _hoisted_10$3)) : createCommentVNode("", true),
3007
3039
  $props.labelPosition === "right" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
3008
3040
  _ctx.$slots.default ? (openBlock(), createElementBlock("label", {
3009
3041
  key: 0,
3010
- class: "w-input__label w-input__label--right w-form-el-shakable",
3042
+ class: normalizeClass(["w-input__label w-input__label--right w-form-el-shakable", $options.validationClasses]),
3011
3043
  for: `w-input--${_ctx._.uid}`
3012
3044
  }, [
3013
3045
  renderSlot(_ctx.$slots, "default")
3014
- ], 8, _hoisted_12$1)) : $props.label ? (openBlock(), createElementBlock("label", {
3046
+ ], 10, _hoisted_12$1)) : $props.label ? (openBlock(), createElementBlock("label", {
3015
3047
  key: 1,
3016
- class: "w-input__label w-input__label--right w-form-el-shakable",
3048
+ class: normalizeClass(["w-input__label w-input__label--right w-form-el-shakable", $options.validationClasses]),
3017
3049
  for: `w-input--${_ctx._.uid}`,
3018
3050
  innerHTML: $props.label
3019
- }, null, 8, _hoisted_13$1)) : createCommentVNode("", true)
3020
- ], 64)) : createCommentVNode("", true),
3021
- $props.loading ? (openBlock(), createBlock(_component_w_progress, {
3022
- key: 3,
3023
- class: "fill-width",
3024
- size: "2",
3025
- color: $props.progressColor || $props.color
3026
- }, null, 8, ["color"])) : createCommentVNode("", true)
3051
+ }, null, 10, _hoisted_13$1)) : createCommentVNode("", true)
3052
+ ], 64)) : createCommentVNode("", true)
3027
3053
  ], 64))
3028
3054
  ]),
3029
3055
  _: 3
@@ -3056,10 +3082,12 @@ const _sfc_main$u = {
3056
3082
  shadow: { type: Boolean },
3057
3083
  tile: { type: Boolean },
3058
3084
  multiple: { type: Boolean },
3059
- preview: { type: Boolean },
3060
- loading: { type: Boolean }
3085
+ preview: { type: [Boolean, String], default: true },
3086
+ loading: { type: [Boolean, Number], default: false },
3087
+ showProgress: { type: [Boolean] },
3088
+ files: { type: Array }
3061
3089
  },
3062
- emits: ["input", "update:modelValue", "focus", "blur", "click:inner-icon-left", "click:inner-icon-right"],
3090
+ emits: ["input", "update:modelValue", "focus", "blur", "click:inner-icon-left", "click:inner-icon-right", "update:overallProgress"],
3063
3091
  data() {
3064
3092
  return {
3065
3093
  inputValue: this.modelValue,
@@ -3084,14 +3112,48 @@ const _sfc_main$u = {
3084
3112
  return htmlAttrs;
3085
3113
  },
3086
3114
  hasValue() {
3087
- return this.inputValue || this.inputValue === 0 || ["date", "time"].includes(this.type) || this.type === "number" && this.inputNumberError || this.type === "file" && this.inputFiles.length;
3115
+ switch (this.type) {
3116
+ case "file":
3117
+ return !!this.inputFiles.length;
3118
+ case "number":
3119
+ return this.inputValue || this.inputValue === 0 || this.inputNumberError;
3120
+ case "date":
3121
+ case "time":
3122
+ return true;
3123
+ default:
3124
+ return this.inputValue || this.inputValue === 0;
3125
+ }
3088
3126
  },
3089
3127
  hasLabel() {
3090
3128
  return this.label || this.$slots.default;
3091
3129
  },
3130
+ hasLoading() {
3131
+ return ![void 0, false].includes(this.loading);
3132
+ },
3133
+ loadingValue() {
3134
+ let value;
3135
+ if (typeof this.loading === "number")
3136
+ value = this.loading;
3137
+ else if (this.loading) {
3138
+ value = this.type === "file" && this.overallFilesProgress ? this.overallFilesProgress : void 0;
3139
+ }
3140
+ return value;
3141
+ },
3092
3142
  showLabelInside() {
3093
3143
  return !this.staticLabel || !this.hasValue && !this.placeholder;
3094
3144
  },
3145
+ overallFilesProgress() {
3146
+ const progress = this.inputFiles.reduce((total2, file) => total2 + file.progress, 0);
3147
+ const total = progress / this.inputFiles.length;
3148
+ this.$emit("update:overallProgress", this.inputFiles.length ? total : void 0);
3149
+ return total;
3150
+ },
3151
+ uploadInProgress() {
3152
+ return this.overallFilesProgress > 0 && this.overallFilesProgress < 100;
3153
+ },
3154
+ uploadComplete() {
3155
+ return this.overallFilesProgress === 100;
3156
+ },
3095
3157
  classes() {
3096
3158
  return {
3097
3159
  "w-input": true,
@@ -3108,6 +3170,11 @@ const _sfc_main$u = {
3108
3170
  "w-input--inner-icon-right": this.innerIconRight
3109
3171
  };
3110
3172
  },
3173
+ validationClasses() {
3174
+ return this.isFocused && {
3175
+ [this.valid === false ? "error" : this.color]: this.color || this.valid === false
3176
+ };
3177
+ },
3111
3178
  inputWrapClasses() {
3112
3179
  return {
3113
3180
  [this.valid === false ? "error" : this.color]: this.color || this.valid === false,
@@ -3119,7 +3186,8 @@ const _sfc_main$u = {
3119
3186
  "w-input__input-wrap--underline": !this.outline,
3120
3187
  "w-input__input-wrap--shadow": this.shadow,
3121
3188
  "w-input__input-wrap--no-padding": !this.outline && !this.bgColor && !this.shadow && !this.round,
3122
- "w-input__input-wrap--loading": this.loading
3189
+ "w-input__input-wrap--loading": this.loading || this.showProgress && this.uploadInProgress,
3190
+ "w-input__input-wrap--upload-complete": this.uploadComplete
3123
3191
  };
3124
3192
  }
3125
3193
  },
@@ -3139,29 +3207,34 @@ const _sfc_main$u = {
3139
3207
  },
3140
3208
  onFileChange(e) {
3141
3209
  this.inputFiles = [...e.target.files].map((original) => {
3142
- const [, base, extension] = original.name.match(/^(.*)(\..*?)$/);
3210
+ const [, base = "", extension = "", full = ""] = original.name.match(/^(.*?)\.([^.]*)$|(.*)/);
3143
3211
  const file = reactive({
3144
3212
  name: original.name,
3145
- base,
3213
+ base: base || full,
3146
3214
  extension,
3147
3215
  type: original.type,
3148
3216
  size: original.size,
3149
3217
  lastModified: original.lastModified,
3150
3218
  preview: null,
3151
- progress: 0
3219
+ progress: 0,
3220
+ file: original
3152
3221
  });
3153
- this.filePreview(original, file);
3222
+ this.readFile(original, file);
3154
3223
  return file;
3155
3224
  });
3156
3225
  this.$emit("update:modelValue", this.inputFiles);
3226
+ this.$emit("input", this.inputFiles);
3157
3227
  },
3158
- filePreview(original, file) {
3228
+ readFile(original, file) {
3159
3229
  const reader = new FileReader();
3160
- if (original.type && original.type.startsWith("image/")) {
3230
+ const isPreviewAnIcon = typeof this.preview === "string";
3231
+ const isFileAnImage = original.type && original.type.startsWith("image/");
3232
+ if (this.preview && !isPreviewAnIcon && isFileAnImage) {
3161
3233
  reader.addEventListener("load", (e) => {
3162
3234
  file.preview = e.target.result;
3163
3235
  });
3164
- }
3236
+ } else
3237
+ delete file.preview;
3165
3238
  reader.addEventListener("progress", (e) => {
3166
3239
  if (e.loaded && e.total)
3167
3240
  file.progress = e.loaded * 100 / e.total;
@@ -3171,7 +3244,7 @@ const _sfc_main$u = {
3171
3244
  },
3172
3245
  mounted() {
3173
3246
  setTimeout(() => {
3174
- if (this.$refs.input.matches(":-webkit-autofill"))
3247
+ if (this.$refs.input && this.$refs.input.matches(":-webkit-autofill"))
3175
3248
  this.isAutofilled = true;
3176
3249
  }, 400);
3177
3250
  },
@@ -3516,34 +3589,248 @@ const _sfc_main$t = {
3516
3589
  }
3517
3590
  };
3518
3591
  var wList = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", render$t]]);
3519
- const _hoisted_1$g = { class: "w-menu-wrap" };
3592
+ var DetachableMixin = {
3593
+ props: {
3594
+ detachTo: { type: [String, Boolean, Object], deprecated: true },
3595
+ appendTo: { type: [String, Boolean, Object] },
3596
+ fixed: { type: Boolean },
3597
+ top: { type: Boolean },
3598
+ bottom: { type: Boolean },
3599
+ left: { type: Boolean },
3600
+ right: { type: Boolean },
3601
+ alignTop: { type: Boolean },
3602
+ alignBottom: { type: Boolean },
3603
+ alignLeft: { type: Boolean },
3604
+ alignRight: { type: Boolean },
3605
+ noPosition: { type: Boolean },
3606
+ zIndex: { type: [Number, String, Boolean] },
3607
+ activator: { type: String }
3608
+ },
3609
+ data: () => ({
3610
+ docAEventListenersHandlers: []
3611
+ }),
3612
+ computed: {
3613
+ appendToTarget() {
3614
+ const defaultTarget = ".w-app";
3615
+ if (this.detachTo && !this.appendTo) {
3616
+ consoleWarn(`The ${this.$options.name} prop \`detach-to\` is deprecated. You can replace it with \`append-to\`.`);
3617
+ }
3618
+ let target = this.appendTo || this.detachTo || defaultTarget;
3619
+ if (target === true)
3620
+ target = defaultTarget;
3621
+ else if (this.appendTo === "activator")
3622
+ target = this.$el.previousElementSibling;
3623
+ else if (target && !["object", "string"].includes(typeof target))
3624
+ target = defaultTarget;
3625
+ else if (typeof target === "object" && !target.nodeType) {
3626
+ target = defaultTarget;
3627
+ consoleWarn(`Invalid node provided in ${this.$options.name} \`append-to\`. Falling back to .w-app.`);
3628
+ }
3629
+ if (typeof target === "string")
3630
+ target = document.querySelector(target);
3631
+ if (!target) {
3632
+ consoleWarn(`Unable to locate ${this.appendTo ? `target ${this.appendTo}` : defaultTarget}`);
3633
+ target = document.querySelector(defaultTarget);
3634
+ }
3635
+ return target;
3636
+ },
3637
+ detachableParentEl() {
3638
+ return this.appendToTarget;
3639
+ },
3640
+ hasSeparateActivator() {
3641
+ return !this.$slots.activator && typeof this.activator === "string";
3642
+ },
3643
+ activatorEl: {
3644
+ get() {
3645
+ if (this.hasSeparateActivator)
3646
+ return document.querySelector(this.activator);
3647
+ return this.$el.firstElementChild;
3648
+ },
3649
+ set() {
3650
+ }
3651
+ },
3652
+ position() {
3653
+ return this.top && "top" || this.bottom && "bottom" || this.left && "left" || this.right && "right" || "bottom";
3654
+ },
3655
+ alignment() {
3656
+ return ["top", "bottom"].includes(this.position) && this.alignLeft && "left" || ["top", "bottom"].includes(this.position) && this.alignRight && "right" || ["left", "right"].includes(this.position) && this.alignTop && "top" || ["left", "right"].includes(this.position) && this.alignBottom && "bottom" || "";
3657
+ }
3658
+ },
3659
+ methods: {
3660
+ getActivatorCoordinates(e) {
3661
+ const { top, left, width, height } = (e ? e.target : this.activatorEl).getBoundingClientRect();
3662
+ let coords = { top, left, width, height };
3663
+ if (!this.fixed) {
3664
+ const { top: targetTop, left: targetLeft } = this.detachableParentEl.getBoundingClientRect();
3665
+ const computedStyles2 = window.getComputedStyle(this.detachableParentEl, null);
3666
+ coords = __spreadProps(__spreadValues({}, coords), {
3667
+ top: top - targetTop + this.detachableParentEl.scrollTop - parseInt(computedStyles2.getPropertyValue("border-top-width")),
3668
+ left: left - targetLeft + this.detachableParentEl.scrollLeft - parseInt(computedStyles2.getPropertyValue("border-left-width"))
3669
+ });
3670
+ }
3671
+ return coords;
3672
+ },
3673
+ computeDetachableCoords(e) {
3674
+ let { top, left, width, height } = this.getActivatorCoordinates(e);
3675
+ this.detachableEl.style.visibility = "hidden";
3676
+ this.detachableEl.style.display = "flex";
3677
+ const computedStyles2 = window.getComputedStyle(this.detachableEl, null);
3678
+ switch (this.position) {
3679
+ case "top": {
3680
+ top -= this.detachableEl.offsetHeight;
3681
+ if (this.alignRight) {
3682
+ left += width - this.detachableEl.offsetWidth + parseInt(computedStyles2.getPropertyValue("border-right-width"));
3683
+ } else if (!this.alignLeft)
3684
+ left += (width - this.detachableEl.offsetWidth) / 2;
3685
+ break;
3686
+ }
3687
+ case "bottom": {
3688
+ top += height;
3689
+ if (this.alignRight) {
3690
+ left += width - this.detachableEl.offsetWidth + parseInt(computedStyles2.getPropertyValue("border-right-width"));
3691
+ } else if (!this.alignLeft)
3692
+ left += (width - this.detachableEl.offsetWidth) / 2;
3693
+ break;
3694
+ }
3695
+ case "left": {
3696
+ left -= this.detachableEl.offsetWidth;
3697
+ if (this.alignBottom)
3698
+ top += height - this.detachableEl.offsetHeight;
3699
+ else if (!this.alignTop)
3700
+ top += (height - this.detachableEl.offsetHeight) / 2;
3701
+ break;
3702
+ }
3703
+ case "right": {
3704
+ left += width;
3705
+ if (this.alignBottom) {
3706
+ top += height - this.detachableEl.offsetHeight + parseInt(computedStyles2.getPropertyValue("margin-top"));
3707
+ } else if (!this.alignTop) {
3708
+ top += (height - this.detachableEl.offsetHeight) / 2 + parseInt(computedStyles2.getPropertyValue("margin-top"));
3709
+ }
3710
+ break;
3711
+ }
3712
+ }
3713
+ this.detachableEl.style.visibility = null;
3714
+ if (!this.detachableVisible)
3715
+ this.detachableEl.style.display = "none";
3716
+ this.detachableCoords = { top, left };
3717
+ },
3718
+ onResize() {
3719
+ if (this.minWidth === "activator")
3720
+ this.activatorWidth = this.activatorEl.offsetWidth;
3721
+ this.computeDetachableCoords();
3722
+ },
3723
+ onOutsideMousedown(e) {
3724
+ if (!this.detachableEl.contains(e.target) && !this.activatorEl.contains(e.target)) {
3725
+ this.$emit("update:modelValue", this.detachableVisible = false);
3726
+ this.$emit("input", false);
3727
+ this.$emit("close");
3728
+ document.removeEventListener("mousedown", this.onOutsideMousedown);
3729
+ window.removeEventListener("resize", this.onResize);
3730
+ }
3731
+ },
3732
+ insertInDOM() {
3733
+ return new Promise((resolve) => {
3734
+ this.$nextTick(() => {
3735
+ var _a;
3736
+ this.detachableEl = ((_a = this.$refs.detachable) == null ? void 0 : _a.$el) || this.$refs.detachable;
3737
+ if (this.detachableEl)
3738
+ this.appendToTarget.appendChild(this.detachableEl);
3739
+ resolve();
3740
+ });
3741
+ });
3742
+ },
3743
+ removeFromDOM() {
3744
+ document.removeEventListener("mousedown", this.onOutsideMousedown);
3745
+ window.removeEventListener("resize", this.onResize);
3746
+ if (this.detachableEl && this.detachableEl.parentNode) {
3747
+ this.detachableVisible = false;
3748
+ this.detachableEl.remove();
3749
+ this.detachableEl = null;
3750
+ }
3751
+ }
3752
+ },
3753
+ mounted() {
3754
+ var _a;
3755
+ const wrapper = this.$el;
3756
+ if (this.$slots.activator)
3757
+ wrapper.parentNode.insertBefore(this.activatorEl, wrapper);
3758
+ else if (this.activator) {
3759
+ Object.entries(this.activatorEventHandlers).forEach(([eventName, handler]) => {
3760
+ eventName = eventName.replace("mouseenter", "mouseover").replace("mouseleave", "mouseout");
3761
+ const handlerWrap = (e) => {
3762
+ var _a2;
3763
+ if (((_a2 = e.target) == null ? void 0 : _a2.matches) && e.target.matches(this.activator))
3764
+ handler(e);
3765
+ };
3766
+ document.addEventListener(eventName, handlerWrap);
3767
+ this.docAEventListenersHandlers.push({ eventName, handler: handlerWrap });
3768
+ });
3769
+ }
3770
+ if (this.overlay) {
3771
+ this.overlayEl = (_a = this.$refs.overlay) == null ? void 0 : _a.$el;
3772
+ wrapper.parentNode.insertBefore(this.overlayEl, wrapper);
3773
+ }
3774
+ if (this.modelValue)
3775
+ this.toggleMenu({ type: "click", target: this.activatorEl });
3776
+ },
3777
+ beforeUnmount() {
3778
+ var _a;
3779
+ this.close();
3780
+ this.removeFromDOM();
3781
+ if (this.docAEventListenersHandlers.length) {
3782
+ this.docAEventListenersHandlers.forEach(({ eventName, handler }) => {
3783
+ document.removeEventListener(eventName, handler);
3784
+ });
3785
+ }
3786
+ if (this.overlay && this.overlayEl.parentNode)
3787
+ this.overlayEl.remove();
3788
+ if (((_a = this.activatorEl) == null ? void 0 : _a.parentNode) && this.$slots.activator)
3789
+ this.activatorEl.remove();
3790
+ },
3791
+ watch: {
3792
+ modelValue(bool) {
3793
+ if (!!bool !== this.detachableVisible)
3794
+ this.toggle({ type: "click", target: this.activatorEl });
3795
+ },
3796
+ detachTo() {
3797
+ this.removeFromDOM();
3798
+ this.insertInDOM();
3799
+ },
3800
+ appendTo() {
3801
+ this.removeFromDOM();
3802
+ this.insertInDOM();
3803
+ }
3804
+ }
3805
+ };
3806
+ const _hoisted_1$h = { class: "w-menu-wrap" };
3520
3807
  function render$s(_ctx, _cache, $props, $setup, $data, $options) {
3521
3808
  const _component_w_card = resolveComponent("w-card");
3522
3809
  const _component_w_overlay = resolveComponent("w-overlay");
3523
- return openBlock(), createElementBlock("div", _hoisted_1$g, [
3810
+ return openBlock(), createElementBlock("div", _hoisted_1$h, [
3524
3811
  renderSlot(_ctx.$slots, "activator", { on: $options.activatorEventHandlers }),
3525
3812
  createVNode(Transition, {
3526
3813
  name: $options.transitionName,
3527
3814
  appear: ""
3528
3815
  }, {
3529
3816
  default: withCtx(() => [
3530
- $props.custom && _ctx.menuVisible ? (openBlock(), createElementBlock("div", {
3817
+ $props.custom && _ctx.detachableVisible ? (openBlock(), createElementBlock("div", {
3531
3818
  key: 0,
3532
3819
  class: normalizeClass(["w-menu", $options.classes]),
3533
- ref: "menu",
3534
- onClick: _cache[0] || (_cache[0] = ($event) => $props.hideOnMenuClick && $options.closeMenu(true)),
3820
+ ref: "detachable",
3821
+ onClick: _cache[0] || (_cache[0] = ($event) => $props.hideOnMenuClick && $options.close(true)),
3535
3822
  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())),
3823
+ onMouseleave: _cache[2] || (_cache[2] = ($event) => $props.showOnHover && (_ctx.hoveringMenu = false, $options.close())),
3537
3824
  style: normalizeStyle($options.styles)
3538
3825
  }, [
3539
3826
  renderSlot(_ctx.$slots, "default")
3540
- ], 38)) : _ctx.menuVisible ? (openBlock(), createBlock(_component_w_card, {
3827
+ ], 38)) : _ctx.detachableVisible ? (openBlock(), createBlock(_component_w_card, {
3541
3828
  key: 1,
3542
3829
  class: normalizeClass(["w-menu", $options.classes]),
3543
- ref: "menu",
3544
- onClick: _cache[3] || (_cache[3] = ($event) => $props.hideOnMenuClick && $options.closeMenu(true)),
3830
+ ref: "detachable",
3831
+ onClick: _cache[3] || (_cache[3] = ($event) => $props.hideOnMenuClick && $options.close(true)),
3545
3832
  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())),
3833
+ onMouseleave: _cache[5] || (_cache[5] = ($event) => $props.showOnHover && (_ctx.hoveringMenu = false, $options.close())),
3547
3834
  tile: $props.tile,
3548
3835
  "title-class": $options.titleClasses,
3549
3836
  "content-class": $options.contentClasses,
@@ -3575,18 +3862,19 @@ function render$s(_ctx, _cache, $props, $setup, $data, $options) {
3575
3862
  $props.overlay ? (openBlock(), createBlock(_component_w_overlay, mergeProps({
3576
3863
  key: 0,
3577
3864
  ref: "overlay",
3578
- "model-value": _ctx.menuVisible,
3865
+ "model-value": _ctx.detachableVisible,
3579
3866
  persistent: $props.persistent,
3580
3867
  class: $options.overlayClasses
3581
3868
  }, $props.overlayProps, {
3582
- "z-index": ($props.zIndex || 200) - 1,
3583
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => _ctx.menuVisible = false)
3869
+ "z-index": (_ctx.zIndex || 200) - 1,
3870
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => _ctx.detachableVisible = false)
3584
3871
  }), null, 16, ["model-value", "persistent", "class", "z-index"])) : createCommentVNode("", true)
3585
3872
  ]);
3586
3873
  }
3587
3874
  var wMenu_vue_vue_type_style_index_0_lang = "";
3588
3875
  const _sfc_main$s = {
3589
3876
  name: "w-menu",
3877
+ mixins: [DetachableMixin],
3590
3878
  props: {
3591
3879
  modelValue: {},
3592
3880
  showOnHover: { type: Boolean },
@@ -3603,76 +3891,36 @@ const _sfc_main$s = {
3603
3891
  titleClass: { type: [String, Object, Array] },
3604
3892
  contentClass: { type: [String, Object, Array] },
3605
3893
  arrow: { type: Boolean },
3606
- detachTo: { type: [String, Boolean, Object] },
3607
- fixed: { type: Boolean },
3608
- top: { type: Boolean },
3609
- bottom: { type: Boolean },
3610
- left: { type: Boolean },
3611
- right: { type: Boolean },
3612
- alignTop: { type: Boolean },
3613
- alignBottom: { type: Boolean },
3614
- alignLeft: { type: Boolean },
3615
- alignRight: { type: Boolean },
3616
- zIndex: { type: [Number, String, Boolean] },
3617
3894
  minWidth: { type: [Number, String] },
3618
3895
  overlay: { type: Boolean },
3619
3896
  overlayClass: { type: [String, Object, Array] },
3620
3897
  overlayProps: { type: Object },
3621
3898
  persistent: { type: Boolean },
3622
- noPosition: { type: Boolean }
3899
+ delay: { type: Number }
3623
3900
  },
3624
3901
  emits: ["input", "update:modelValue", "open", "close"],
3625
3902
  data: () => ({
3626
- menuVisible: false,
3903
+ detachableVisible: false,
3627
3904
  hoveringActivator: false,
3628
3905
  hoveringMenu: false,
3629
- menuCoordinates: {
3906
+ detachableCoords: {
3630
3907
  top: 0,
3631
3908
  left: 0
3632
3909
  },
3633
- activatorEl: null,
3634
3910
  activatorWidth: 0,
3635
- menuEl: null,
3911
+ detachableEl: null,
3636
3912
  timeoutId: null
3637
3913
  }),
3638
3914
  computed: {
3639
3915
  transitionName() {
3640
3916
  return this.transition || "scale-fade";
3641
3917
  },
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
- position() {
3665
- return this.top && "top" || this.bottom && "bottom" || this.left && "left" || this.right && "right" || "bottom";
3666
- },
3667
3918
  menuMinWidth() {
3668
3919
  if (this.minWidth === "activator")
3669
3920
  return this.activatorWidth ? `${this.activatorWidth}px` : 0;
3670
3921
  else
3671
3922
  return isNaN(this.minWidth) ? this.minWidth : this.minWidth ? `${this.minWidth}px` : 0;
3672
3923
  },
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
3924
  menuClasses() {
3677
3925
  return objectifyClasses(this.menuClass);
3678
3926
  },
@@ -3703,8 +3951,8 @@ const _sfc_main$s = {
3703
3951
  styles() {
3704
3952
  return {
3705
3953
  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,
3954
+ top: this.detachableCoords.top && `${~~this.detachableCoords.top}px` || null,
3955
+ left: this.detachableCoords.left && `${~~this.detachableCoords.left}px` || null,
3708
3956
  minWidth: this.minWidth && this.menuMinWidth || null,
3709
3957
  "--w-menu-bg-color": this.arrow && this.$waveui.colors[this.bgColor || "white"]
3710
3958
  };
@@ -3713,31 +3961,31 @@ const _sfc_main$s = {
3713
3961
  let handlers = {};
3714
3962
  if (this.showOnHover) {
3715
3963
  handlers = {
3716
- focus: this.toggleMenu,
3717
- blur: this.toggleMenu,
3964
+ focus: this.toggle,
3965
+ blur: this.toggle,
3718
3966
  mouseenter: (e) => {
3719
3967
  this.hoveringActivator = true;
3720
- this.openMenu(e);
3968
+ this.open(e);
3721
3969
  },
3722
3970
  mouseleave: (e) => {
3723
3971
  this.hoveringActivator = false;
3724
3972
  setTimeout(() => {
3725
3973
  if (!this.hoveringMenu)
3726
- this.closeMenu();
3974
+ this.close();
3727
3975
  }, 10);
3728
3976
  }
3729
3977
  };
3730
3978
  if (typeof window !== "undefined" && "ontouchstart" in window) {
3731
- handlers.click = this.toggleMenu;
3979
+ handlers.click = this.toggle;
3732
3980
  }
3733
3981
  } else
3734
- handlers = { click: this.toggleMenu };
3982
+ handlers = { click: this.toggle };
3735
3983
  return handlers;
3736
3984
  }
3737
3985
  },
3738
3986
  methods: {
3739
- toggleMenu(e) {
3740
- let shouldShowMenu = this.menuVisible;
3987
+ toggle(e) {
3988
+ let shouldShowMenu = this.detachableVisible;
3741
3989
  if ("ontouchstart" in window && this.showOnHover && e.type === "click") {
3742
3990
  shouldShowMenu = !shouldShowMenu;
3743
3991
  } else if (e.type === "click" && !this.showOnHover)
@@ -3750,21 +3998,22 @@ const _sfc_main$s = {
3750
3998
  shouldShowMenu = false;
3751
3999
  }
3752
4000
  this.timeoutId = clearTimeout(this.timeoutId);
3753
- if (shouldShowMenu) {
3754
- this.$emit("update:modelValue", this.menuVisible = true);
3755
- this.$emit("input", true);
3756
- this.$emit("open");
3757
- this.openMenu(e);
3758
- } else
3759
- this.closeMenu();
3760
- },
3761
- async openMenu(e) {
3762
- this.menuVisible = true;
3763
- await this.insertMenu();
4001
+ if (shouldShowMenu)
4002
+ this.open(e);
4003
+ else
4004
+ this.close();
4005
+ },
4006
+ async open(e) {
4007
+ if (this.delay)
4008
+ await new Promise((resolve) => setTimeout(resolve, this.delay));
4009
+ this.detachableVisible = true;
4010
+ if (this.activator)
4011
+ this.activatorEl = e.target;
4012
+ await this.insertInDOM();
3764
4013
  if (this.minWidth === "activator")
3765
4014
  this.activatorWidth = this.activatorEl.offsetWidth;
3766
4015
  if (!this.noPosition)
3767
- this.computeMenuPosition(e);
4016
+ this.computeDetachableCoords(e);
3768
4017
  this.timeoutId = setTimeout(() => {
3769
4018
  this.$emit("update:modelValue", true);
3770
4019
  this.$emit("input", true);
@@ -3775,134 +4024,19 @@ const _sfc_main$s = {
3775
4024
  if (!this.noPosition)
3776
4025
  window.addEventListener("resize", this.onResize);
3777
4026
  },
3778
- async closeMenu(force = false) {
3779
- if (!this.menuVisible)
4027
+ async close(force = false) {
4028
+ if (!this.detachableVisible)
3780
4029
  return;
3781
4030
  if (this.showOnHover && !force) {
3782
4031
  await new Promise((resolve) => setTimeout(resolve, 10));
3783
4032
  if (this.showOnHover && (this.hoveringMenu || this.hoveringActivator))
3784
4033
  return;
3785
4034
  }
3786
- this.$emit("update:modelValue", this.menuVisible = false);
4035
+ this.$emit("update:modelValue", this.detachableVisible = false);
3787
4036
  this.$emit("input", false);
3788
4037
  this.$emit("close");
3789
4038
  document.removeEventListener("mousedown", this.onOutsideMousedown);
3790
4039
  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
- }
3878
- },
3879
- mounted() {
3880
- var _a;
3881
- const wrapper = this.$el;
3882
- this.activatorEl = wrapper.firstElementChild;
3883
- wrapper.parentNode.insertBefore(this.activatorEl, wrapper);
3884
- if (this.overlay) {
3885
- this.overlayEl = (_a = this.$refs.overlay) == null ? void 0 : _a.$el;
3886
- wrapper.parentNode.insertBefore(this.overlayEl, wrapper);
3887
- }
3888
- if (this.modelValue)
3889
- this.toggleMenu({ type: "click", target: this.activatorEl });
3890
- },
3891
- beforeUnmount() {
3892
- this.removeMenu();
3893
- if (this.overlay && this.overlayEl.parentNode)
3894
- this.overlayEl.remove();
3895
- if (this.activatorEl && this.activatorEl.parentNode)
3896
- this.activatorEl.remove();
3897
- },
3898
- watch: {
3899
- modelValue(bool) {
3900
- if (!!bool !== this.menuVisible)
3901
- this.toggleMenu({ type: "click", target: this.activatorEl });
3902
- },
3903
- detachTo() {
3904
- this.removeMenu();
3905
- this.insertMenu();
3906
4040
  }
3907
4041
  }
3908
4042
  };
@@ -4140,9 +4274,9 @@ const _sfc_main$q = {
4140
4274
  }
4141
4275
  };
4142
4276
  var wOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", render$q]]);
4143
- const _hoisted_1$f = { class: "w-parallax" };
4277
+ const _hoisted_1$g = { class: "w-parallax" };
4144
4278
  function render$p(_ctx, _cache, $props, $setup, $data, $options) {
4145
- return openBlock(), createElementBlock("div", _hoisted_1$f);
4279
+ return openBlock(), createElementBlock("div", _hoisted_1$g);
4146
4280
  }
4147
4281
  var wParallax_vue_vue_type_style_index_0_lang = "";
4148
4282
  const _sfc_main$p = {
@@ -4152,7 +4286,7 @@ const _sfc_main$p = {
4152
4286
  data: () => ({})
4153
4287
  };
4154
4288
  var wParallax = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", render$p]]);
4155
- const _hoisted_1$e = ["viewBox"];
4289
+ const _hoisted_1$f = ["viewBox"];
4156
4290
  const _hoisted_2$9 = ["cx", "cy", "r", "stroke-dasharray", "stroke-width"];
4157
4291
  const _hoisted_3$8 = ["viewBox"];
4158
4292
  const _hoisted_4$7 = ["cx", "cy", "r", "stroke-width", "stroke-linecap", "stroke-dasharray"];
@@ -4179,7 +4313,7 @@ function render$o(_ctx, _cache, $props, $setup, $data, $options) {
4179
4313
  "stroke-dasharray": _ctx.circleCircumference,
4180
4314
  "stroke-width": $props.stroke
4181
4315
  }, null, 10, _hoisted_2$9)) : createCommentVNode("", true)
4182
- ], 8, _hoisted_1$e)),
4316
+ ], 8, _hoisted_1$f)),
4183
4317
  (openBlock(), createElementBlock("svg", {
4184
4318
  class: "w-progress__progress",
4185
4319
  viewBox: `${$options.circleCenter / 2} ${$options.circleCenter / 2} ${$options.circleCenter} ${$options.circleCenter}`,
@@ -4278,7 +4412,7 @@ const _sfc_main$o = {
4278
4412
  }
4279
4413
  };
4280
4414
  var wProgress = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", render$o]]);
4281
- const _hoisted_1$d = ["id", "name", "checked", "disabled", "required", "tabindex", "aria-checked"];
4415
+ const _hoisted_1$e = ["id", "name", "checked", "disabled", "required", "tabindex", "aria-checked"];
4282
4416
  const _hoisted_2$8 = ["for"];
4283
4417
  const _hoisted_3$7 = ["for", "innerHTML"];
4284
4418
  const _hoisted_4$6 = ["for"];
@@ -4307,7 +4441,7 @@ function render$n(_ctx, _cache, $props, $setup, $data, $options) {
4307
4441
  onChange: _cache[1] || (_cache[1] = ($event) => $options.onInput($event)),
4308
4442
  "aria-checked": _ctx.inputValue || "false",
4309
4443
  role: "radio"
4310
- }, null, 40, _hoisted_1$d),
4444
+ }, null, 40, _hoisted_1$e),
4311
4445
  $options.hasLabel && $props.labelOnLeft ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
4312
4446
  _ctx.$slots.default ? (openBlock(), createElementBlock("label", {
4313
4447
  key: 0,
@@ -4417,7 +4551,7 @@ const _sfc_main$n = {
4417
4551
  }
4418
4552
  };
4419
4553
  var wRadio = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", render$n]]);
4420
- const _hoisted_1$c = ["innerHTML"];
4554
+ const _hoisted_1$d = ["innerHTML"];
4421
4555
  function render$m(_ctx, _cache, $props, $setup, $data, $options) {
4422
4556
  const _component_w_radio = resolveComponent("w-radio");
4423
4557
  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 +4596,7 @@ function render$m(_ctx, _cache, $props, $setup, $data, $options) {
4462
4596
  }) : item.label ? (openBlock(), createElementBlock("div", {
4463
4597
  key: 2,
4464
4598
  innerHTML: item.label
4465
- }, null, 8, _hoisted_1$c)) : createCommentVNode("", true)
4599
+ }, null, 8, _hoisted_1$d)) : createCommentVNode("", true)
4466
4600
  ]),
4467
4601
  _: 2
4468
4602
  }, 1032, ["model-value", "onUpdate:modelValue", "name", "label", "label-on-left", "color", "disabled", "readonly", "class"]);
@@ -4520,12 +4654,13 @@ const _sfc_main$m = {
4520
4654
  }
4521
4655
  };
4522
4656
  var wRadios = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", render$m]]);
4523
- const _hoisted_1$b = ["id", "name", "value"];
4657
+ const _hoisted_1$c = ["id", "name", "value"];
4524
4658
  const _hoisted_2$7 = ["disabled", "onMouseenter", "onClick", "tabindex"];
4525
4659
  function render$l(_ctx, _cache, $props, $setup, $data, $options) {
4526
4660
  return openBlock(), createBlock(resolveDynamicComponent(_ctx.formRegister ? "w-form-element" : "div"), mergeProps({ ref: "formEl" }, _ctx.formRegister && { validators: _ctx.validators, inputValue: $data.rating, disabled: _ctx.isDisabled, readonly: _ctx.isReadonly }, {
4527
4661
  valid: _ctx.valid,
4528
- onReset: _cache[4] || (_cache[4] = ($event) => {
4662
+ "onUpdate:valid": _cache[4] || (_cache[4] = ($event) => _ctx.valid = $event),
4663
+ onReset: _cache[5] || (_cache[5] = ($event) => {
4529
4664
  _ctx.$emit("update:modelValue", $data.rating = null);
4530
4665
  _ctx.$emit("input", null);
4531
4666
  }),
@@ -4537,7 +4672,7 @@ function render$l(_ctx, _cache, $props, $setup, $data, $options) {
4537
4672
  name: _ctx.inputName,
4538
4673
  type: "hidden",
4539
4674
  value: $data.rating
4540
- }, null, 8, _hoisted_1$b),
4675
+ }, null, 8, _hoisted_1$c),
4541
4676
  (openBlock(true), createElementBlock(Fragment, null, renderList($props.max, (i) => {
4542
4677
  return openBlock(), createElementBlock(Fragment, { key: i }, [
4543
4678
  _ctx.$slots.item ? renderSlot(_ctx.$slots, "item", {
@@ -4676,7 +4811,7 @@ const _sfc_main$l = {
4676
4811
  }
4677
4812
  };
4678
4813
  var wRating = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", render$l]]);
4679
- const _hoisted_1$a = ["for"];
4814
+ const _hoisted_1$b = ["for"];
4680
4815
  const _hoisted_2$6 = ["for", "innerHTML"];
4681
4816
  const _hoisted_3$6 = ["aria-expanded", "aria-owns", "aria-activedescendant"];
4682
4817
  const _hoisted_4$5 = {
@@ -4708,7 +4843,7 @@ function render$k(_ctx, _cache, $props, $setup, $data, $options) {
4708
4843
  for: `w-select--${_ctx._.uid}`
4709
4844
  }, [
4710
4845
  renderSlot(_ctx.$slots, "default")
4711
- ], 8, _hoisted_1$a)) : $props.label ? (openBlock(), createElementBlock("label", {
4846
+ ], 8, _hoisted_1$b)) : $props.label ? (openBlock(), createElementBlock("label", {
4712
4847
  key: 1,
4713
4848
  class: "w-select__label w-select__label--left w-form-el-shakable",
4714
4849
  for: `w-select--${_ctx._.uid}`,
@@ -4720,7 +4855,7 @@ function render$k(_ctx, _cache, $props, $setup, $data, $options) {
4720
4855
  "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => _ctx.showMenu = $event),
4721
4856
  "menu-class": `w-select__menu ${$props.menuClass || ""}`,
4722
4857
  transition: "slide-fade-down",
4723
- "detach-to": ($props.menuProps || {}).detachTo !== void 0 ? ($props.menuProps || {}).detachTo : ".w-app",
4858
+ "append-to": ($props.menuProps || {}).appendTo !== void 0 ? ($props.menuProps || {}).appendTo : ".w-app",
4724
4859
  "align-left": "",
4725
4860
  custom: "",
4726
4861
  "min-width": "activator"
@@ -4849,7 +4984,7 @@ function render$k(_ctx, _cache, $props, $setup, $data, $options) {
4849
4984
  ]), 1032, ["model-value", "onUpdate:modelValue", "onItemSelect", "onKeydown:escape", "items", "multiple", "add-ids", "no-unselect", "selection-color", "item-color-key"])
4850
4985
  ]),
4851
4986
  _: 3
4852
- }, 16, ["modelValue", "menu-class", "detach-to"]),
4987
+ }, 16, ["modelValue", "menu-class", "append-to"]),
4853
4988
  $props.labelPosition === "right" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
4854
4989
  _ctx.$slots.default ? (openBlock(), createElementBlock("label", {
4855
4990
  key: 0,
@@ -5020,8 +5155,9 @@ const _sfc_main$k = {
5020
5155
  openMenu() {
5021
5156
  this.showMenu = true;
5022
5157
  setTimeout(() => {
5158
+ var _a;
5023
5159
  const itemIndex = this.inputValue.length ? this.inputValue[0].index : 0;
5024
- this.$refs["w-list"].$el.querySelector(`#w-select-menu--${this._.uid}_item-${itemIndex + 1}`).focus();
5160
+ (_a = this.$refs["w-list"].$el.querySelector(`#w-select-menu--${this._.uid}_item-${itemIndex + 1}`)) == null ? void 0 : _a.focus();
5025
5161
  }, 100);
5026
5162
  },
5027
5163
  closeMenu() {
@@ -5045,7 +5181,7 @@ const _sfc_main$k = {
5045
5181
  }
5046
5182
  };
5047
5183
  var wSelect = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", render$k]]);
5048
- const _hoisted_1$9 = ["for"];
5184
+ const _hoisted_1$a = ["for"];
5049
5185
  const _hoisted_2$5 = ["for", "innerHTML"];
5050
5186
  const _hoisted_3$5 = { class: "w-slider__track-wrap" };
5051
5187
  const _hoisted_4$4 = ["aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-readonly"];
@@ -5077,7 +5213,7 @@ function render$j(_ctx, _cache, $props, $setup, $data, $options) {
5077
5213
  for: `button--${_ctx._.uid}`
5078
5214
  }, [
5079
5215
  renderSlot(_ctx.$slots, "label-left")
5080
- ], 8, _hoisted_1$9)) : $props.labelLeft ? (openBlock(), createElementBlock("label", {
5216
+ ], 8, _hoisted_1$a)) : $props.labelLeft ? (openBlock(), createElementBlock("label", {
5081
5217
  key: 1,
5082
5218
  class: "w-slider__label w-slider__label--left w-form-el-shakable",
5083
5219
  for: `button--${_ctx._.uid}`,
@@ -5332,21 +5468,21 @@ const _sfc_main$j = {
5332
5468
  }
5333
5469
  };
5334
5470
  var wSlider = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", render$j]]);
5335
- const _hoisted_1$8 = { key: 0 };
5471
+ const _hoisted_1$9 = { key: 0 };
5336
5472
  function render$i(_ctx, _cache, $props, $setup, $data, $options) {
5337
- return $props.value || $props.value === void 0 ? (openBlock(), createElementBlock("div", {
5473
+ return $props.modelValue || $props.modelValue === void 0 ? (openBlock(), createElementBlock("div", {
5338
5474
  key: 0,
5339
5475
  class: normalizeClass(["w-spinner", $options.classes]),
5340
5476
  style: normalizeStyle($options.styles)
5341
5477
  }, [
5342
- $options.isThreeDots ? (openBlock(), createElementBlock("span", _hoisted_1$8)) : createCommentVNode("", true)
5478
+ $options.isThreeDots ? (openBlock(), createElementBlock("span", _hoisted_1$9)) : createCommentVNode("", true)
5343
5479
  ], 6)) : createCommentVNode("", true);
5344
5480
  }
5345
5481
  var wSpinner_vue_vue_type_style_index_0_lang = "";
5346
5482
  const _sfc_main$i = {
5347
5483
  name: "w-spinner",
5348
5484
  props: {
5349
- value: {},
5485
+ modelValue: {},
5350
5486
  color: { type: String, default: "primary" },
5351
5487
  xs: { type: Boolean },
5352
5488
  sm: { type: Boolean },
@@ -5383,9 +5519,9 @@ const _sfc_main$i = {
5383
5519
  }
5384
5520
  };
5385
5521
  var wSpinner = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", render$i]]);
5386
- const _hoisted_1$7 = { class: "w-steps" };
5522
+ const _hoisted_1$8 = { class: "w-steps" };
5387
5523
  function render$h(_ctx, _cache, $props, $setup, $data, $options) {
5388
- return openBlock(), createElementBlock("div", _hoisted_1$7);
5524
+ return openBlock(), createElementBlock("div", _hoisted_1$8);
5389
5525
  }
5390
5526
  var wSteps_vue_vue_type_style_index_0_lang = "";
5391
5527
  const _sfc_main$h = {
@@ -5395,7 +5531,7 @@ const _sfc_main$h = {
5395
5531
  data: () => ({})
5396
5532
  };
5397
5533
  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"];
5534
+ const _hoisted_1$7 = ["id", "name", "checked", "disabled", "readonly", "aria-readonly", "required", "tabindex", "aria-checked"];
5399
5535
  const _hoisted_2$4 = ["for"];
5400
5536
  const _hoisted_3$4 = ["for", "innerHTML"];
5401
5537
  const _hoisted_4$3 = ["for"];
@@ -5426,7 +5562,7 @@ function render$g(_ctx, _cache, $props, $setup, $data, $options) {
5426
5562
  onFocus: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("focus", $event)),
5427
5563
  "aria-checked": $data.isOn || "false",
5428
5564
  role: "switch"
5429
- }, null, 40, _hoisted_1$6),
5565
+ }, null, 40, _hoisted_1$7),
5430
5566
  $options.hasLabel && $props.labelOnLeft ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
5431
5567
  _ctx.$slots.default ? (openBlock(), createElementBlock("label", {
5432
5568
  key: 0,
@@ -5538,15 +5674,15 @@ const _sfc_main$g = {
5538
5674
  }
5539
5675
  };
5540
5676
  var wSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", render$g]]);
5541
- const _hoisted_1$5 = { class: "w-tabs__content" };
5677
+ const _hoisted_1$6 = { class: "w-tabs__content" };
5542
5678
  function render$f(_ctx, _cache, $props, $setup, $data, $options) {
5543
- return openBlock(), createElementBlock("div", _hoisted_1$5, [
5679
+ return openBlock(), createElementBlock("div", _hoisted_1$6, [
5544
5680
  renderSlot(_ctx.$slots, "default")
5545
5681
  ]);
5546
5682
  }
5547
5683
  const _sfc_main$f = {};
5548
5684
  var TabContent = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", render$f]]);
5549
- const _hoisted_1$4 = ["onClick", "onFocus", "tabindex", "onKeypress", "aria-selected"];
5685
+ const _hoisted_1$5 = ["onClick", "onFocus", "tabindex", "onKeypress", "aria-selected"];
5550
5686
  const _hoisted_2$3 = ["innerHTML"];
5551
5687
  const _hoisted_3$3 = {
5552
5688
  key: 0,
@@ -5592,7 +5728,7 @@ function render$e(_ctx, _cache, $props, $setup, $data, $options) {
5592
5728
  innerHTML: item[$props.itemTitleKey]
5593
5729
  }, null, 8, _hoisted_2$3)
5594
5730
  ])
5595
- ], 42, _hoisted_1$4);
5731
+ ], 42, _hoisted_1$5);
5596
5732
  }), 128)),
5597
5733
  _ctx.$slots["tabs-bar-extra"] ? (openBlock(), createElementBlock("div", _hoisted_3$3, [
5598
5734
  renderSlot(_ctx.$slots, "tabs-bar-extra")
@@ -5800,7 +5936,7 @@ const _sfc_main$e = {
5800
5936
  }
5801
5937
  };
5802
5938
  var index = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", render$e]]);
5803
- const _hoisted_1$3 = { ref: "colgroup" };
5939
+ const _hoisted_1$4 = { ref: "colgroup" };
5804
5940
  const _hoisted_2$2 = ["width"];
5805
5941
  const _hoisted_3$2 = { key: 0 };
5806
5942
  const _hoisted_4$1 = ["onClick"];
@@ -5843,7 +5979,7 @@ function render$d(_ctx, _cache, $props, $setup, $data, $options) {
5843
5979
  onMouseover: _cache[2] || (_cache[2] = (...args) => $options.onMouseOver && $options.onMouseOver(...args)),
5844
5980
  onMouseout: _cache[3] || (_cache[3] = (...args) => $options.onMouseOut && $options.onMouseOut(...args))
5845
5981
  }, [
5846
- createElementVNode("colgroup", _hoisted_1$3, [
5982
+ createElementVNode("colgroup", _hoisted_1$4, [
5847
5983
  (openBlock(true), createElementBlock(Fragment, null, renderList($props.headers, (header, i) => {
5848
5984
  return openBlock(), createElementBlock("col", {
5849
5985
  class: "w-table__col",
@@ -6281,7 +6417,7 @@ const _sfc_main$d = {
6281
6417
  }
6282
6418
  };
6283
6419
  var wTable = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", render$d]]);
6284
- const _hoisted_1$2 = ["role", "aria-pressed", "tabindex"];
6420
+ const _hoisted_1$3 = ["role", "aria-pressed", "tabindex"];
6285
6421
  function render$c(_ctx, _cache, $props, $setup, $data, $options) {
6286
6422
  return openBlock(), createElementBlock("span", mergeProps({ class: "w-tag" }, toHandlers(_ctx.$attrs), {
6287
6423
  onClick: _cache[1] || (_cache[1] = ($event) => {
@@ -6309,7 +6445,7 @@ function render$c(_ctx, _cache, $props, $setup, $data, $options) {
6309
6445
  role: "icon",
6310
6446
  "aria-hidden": "true"
6311
6447
  })) : createCommentVNode("", true)
6312
- ], 16, _hoisted_1$2);
6448
+ ], 16, _hoisted_1$3);
6313
6449
  }
6314
6450
  var wTag_vue_vue_type_style_index_0_lang = "";
6315
6451
  const _sfc_main$c = {
@@ -6361,7 +6497,7 @@ const _sfc_main$c = {
6361
6497
  }
6362
6498
  };
6363
6499
  var wTag = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", render$c]]);
6364
- const _hoisted_1$1 = ["for"];
6500
+ const _hoisted_1$2 = ["for"];
6365
6501
  const _hoisted_2$1 = ["for", "innerHTML"];
6366
6502
  const _hoisted_3$1 = ["id", "name", "placeholder", "rows", "cols", "readonly", "aria-readonly", "disabled", "required", "tabindex"];
6367
6503
  const _hoisted_4 = ["for"];
@@ -6388,7 +6524,7 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
6388
6524
  for: `w-textarea--${_ctx._.uid}`
6389
6525
  }, [
6390
6526
  renderSlot(_ctx.$slots, "default")
6391
- ], 8, _hoisted_1$1)) : $props.label ? (openBlock(), createElementBlock("label", {
6527
+ ], 8, _hoisted_1$2)) : $props.label ? (openBlock(), createElementBlock("label", {
6392
6528
  key: 1,
6393
6529
  class: "w-textarea__label w-textarea__label--left w-form-el-shakable",
6394
6530
  for: `w-textarea--${_ctx._.uid}`,
@@ -6612,11 +6748,11 @@ const _sfc_main$b = {
6612
6748
  }
6613
6749
  };
6614
6750
  var wTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", render$b]]);
6615
- const _hoisted_1 = { class: "w-timeline" };
6751
+ const _hoisted_1$1 = { class: "w-timeline" };
6616
6752
  const _hoisted_2 = ["innerHTML"];
6617
6753
  const _hoisted_3 = ["innerHTML"];
6618
6754
  function render$a(_ctx, _cache, $props, $setup, $data, $options) {
6619
- return openBlock(), createElementBlock("ul", _hoisted_1, [
6755
+ return openBlock(), createElementBlock("ul", _hoisted_1$1, [
6620
6756
  (openBlock(true), createElementBlock(Fragment, null, renderList($props.items, (item, i) => {
6621
6757
  return openBlock(), createElementBlock("li", {
6622
6758
  class: "w-timeline-item",
@@ -6711,35 +6847,32 @@ const _sfc_main$9 = {
6711
6847
  }
6712
6848
  };
6713
6849
  var wToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", render$9]]);
6850
+ const _hoisted_1 = { class: "w-tooltip-wrap" };
6714
6851
  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
- }, [
6718
- renderSlot(_ctx.$slots, "activator", { on: $options.eventHandlers }),
6852
+ return openBlock(), createElementBlock("div", _hoisted_1, [
6853
+ renderSlot(_ctx.$slots, "activator", { on: $options.activatorEventHandlers }),
6719
6854
  createVNode(Transition, {
6720
6855
  name: $options.transitionName,
6721
6856
  appear: ""
6722
6857
  }, {
6723
6858
  default: withCtx(() => [
6724
- withDirectives((openBlock(), createElementBlock("div", {
6859
+ _ctx.detachableVisible ? (openBlock(), createElementBlock("div", {
6725
6860
  class: normalizeClass(["w-tooltip", $options.classes]),
6726
- ref: (el) => _ctx.tooltipEl = el,
6861
+ ref: "detachable",
6727
6862
  key: _ctx._.uid,
6728
6863
  style: normalizeStyle($options.styles)
6729
6864
  }, [
6730
6865
  renderSlot(_ctx.$slots, "default")
6731
- ], 6)), [
6732
- [vShow, _ctx.showTooltip]
6733
- ])
6866
+ ], 6)) : createCommentVNode("", true)
6734
6867
  ]),
6735
6868
  _: 3
6736
6869
  }, 8, ["name"])
6737
- ], 2);
6870
+ ]);
6738
6871
  }
6739
6872
  var wTooltip_vue_vue_type_style_index_0_lang = "";
6740
- const marginFromWindowSide = 4;
6741
6873
  const _sfc_main$8 = {
6742
6874
  name: "w-tooltip",
6875
+ mixins: [DetachableMixin],
6743
6876
  props: {
6744
6877
  modelValue: {},
6745
6878
  showOnClick: { type: Boolean },
@@ -6751,25 +6884,18 @@ const _sfc_main$8 = {
6751
6884
  round: { type: Boolean },
6752
6885
  transition: { type: String },
6753
6886
  tooltipClass: { type: [String, Object, Array] },
6754
- detachTo: {},
6755
- fixed: { type: Boolean },
6756
- top: { type: Boolean },
6757
- bottom: { type: Boolean },
6758
- left: { type: Boolean },
6759
- right: { type: Boolean },
6760
- zIndex: { type: [Number, String, Boolean] }
6887
+ persistent: { type: Boolean },
6888
+ delay: { type: Number }
6761
6889
  },
6762
6890
  emits: ["input", "update:modelValue", "open", "close"],
6763
6891
  data: () => ({
6764
- showTooltip: false,
6765
- coordinates: {
6892
+ detachableVisible: false,
6893
+ hoveringActivator: false,
6894
+ detachableCoords: {
6766
6895
  top: 0,
6767
- left: 0,
6768
- width: 0,
6769
- height: 0
6896
+ left: 0
6770
6897
  },
6771
- activatorEl: null,
6772
- tooltipEl: null,
6898
+ detachableEl: null,
6773
6899
  timeoutId: null
6774
6900
  }),
6775
6901
  computed: {
@@ -6780,69 +6906,17 @@ const _sfc_main$8 = {
6780
6906
  const direction = this.position.replace(/top|bottom/, (m) => ({ top: "up", bottom: "down" })[m]);
6781
6907
  return this.transition || `w-tooltip-slide-fade-${direction}`;
6782
6908
  },
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
- position() {
6806
- return this.top && "top" || this.bottom && "bottom" || this.left && "left" || this.right && "right" || "bottom";
6807
- },
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;
6834
- },
6835
6909
  classes() {
6836
6910
  return __spreadProps(__spreadValues({
6837
6911
  [this.color]: this.color,
6838
6912
  [`${this.bgColor}--bg`]: this.bgColor
6839
6913
  }, this.tooltipClasses), {
6840
- [`w-tooltip--${this.position}`]: true,
6914
+ [`w-tooltip--${this.position}`]: !this.noPosition,
6915
+ [`w-tooltip--align-${this.alignment}`]: !this.noPosition && this.alignment,
6841
6916
  "w-tooltip--tile": this.tile,
6842
6917
  "w-tooltip--round": this.round,
6843
6918
  "w-tooltip--shadow": this.shadow,
6844
6919
  "w-tooltip--fixed": this.fixed,
6845
- "w-tooltip--active": this.showTooltip,
6846
6920
  "w-tooltip--no-border": this.noBorder || this.bgColor,
6847
6921
  "w-tooltip--custom-transition": this.transition
6848
6922
  });
@@ -6850,12 +6924,12 @@ const _sfc_main$8 = {
6850
6924
  styles() {
6851
6925
  return {
6852
6926
  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,
6927
+ top: this.detachableCoords.top && `${~~this.detachableCoords.top}px` || null,
6928
+ left: this.detachableCoords.left && `${~~this.detachableCoords.left}px` || null,
6855
6929
  "--w-tooltip-bg-color": this.$waveui.colors[this.bgColor || "white"]
6856
6930
  };
6857
6931
  },
6858
- eventHandlers() {
6932
+ activatorEventHandlers() {
6859
6933
  let handlers = {};
6860
6934
  if (this.showOnClick)
6861
6935
  handlers = { click: this.toggle };
@@ -6863,8 +6937,14 @@ const _sfc_main$8 = {
6863
6937
  handlers = {
6864
6938
  focus: this.toggle,
6865
6939
  blur: this.toggle,
6866
- mouseenter: this.toggle,
6867
- mouseleave: this.toggle
6940
+ mouseenter: (e) => {
6941
+ this.hoveringActivator = true;
6942
+ this.open(e);
6943
+ },
6944
+ mouseleave: (e) => {
6945
+ this.hoveringActivator = false;
6946
+ this.close();
6947
+ }
6868
6948
  };
6869
6949
  if (typeof window !== "undefined" && "ontouchstart" in window)
6870
6950
  handlers.click = this.toggle;
@@ -6874,7 +6954,7 @@ const _sfc_main$8 = {
6874
6954
  },
6875
6955
  methods: {
6876
6956
  toggle(e) {
6877
- let shouldShowTooltip = this.showTooltip;
6957
+ let shouldShowTooltip = this.detachableVisible;
6878
6958
  if (typeof window !== "undefined" && "ontouchstart" in window) {
6879
6959
  if (e.type === "click")
6880
6960
  shouldShowTooltip = !shouldShowTooltip;
@@ -6885,89 +6965,45 @@ const _sfc_main$8 = {
6885
6965
  else if (["mouseleave", "blur"].includes(e.type) && !this.showOnClick)
6886
6966
  shouldShowTooltip = false;
6887
6967
  this.timeoutId = clearTimeout(this.timeoutId);
6888
- 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
- }
6968
+ if (shouldShowTooltip)
6969
+ this.open(e);
6970
+ else
6971
+ this.close();
6972
+ },
6973
+ async open(e) {
6974
+ if (this.delay)
6975
+ await new Promise((resolve) => setTimeout(resolve, this.delay));
6976
+ this.detachableVisible = true;
6977
+ if (this.activator)
6978
+ this.activatorEl = e.target;
6979
+ await this.insertInDOM();
6980
+ if (this.minWidth === "activator")
6981
+ this.activatorWidth = this.activatorEl.offsetWidth;
6982
+ if (!this.noPosition)
6983
+ this.computeDetachableCoords(e);
6984
+ this.timeoutId = setTimeout(() => {
6985
+ this.$emit("update:modelValue", true);
6986
+ this.$emit("input", true);
6987
+ this.$emit("open");
6988
+ }, 0);
6989
+ if (!this.persistent)
6990
+ document.addEventListener("mousedown", this.onOutsideMousedown);
6991
+ if (!this.noPosition)
6992
+ window.addEventListener("resize", this.onResize);
6902
6993
  },
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;
6994
+ async close(force = false) {
6995
+ if (!this.detachableVisible)
6996
+ return;
6997
+ if (this.showOnHover && !force) {
6998
+ await new Promise((resolve) => setTimeout(resolve, 10));
6999
+ if (this.showOnHover && this.hoveringActivator)
7000
+ return;
6936
7001
  }
6937
- tooltip.style.visibility = null;
6938
- tooltip.style.display = "none";
6939
- return coords;
6940
- },
6941
- insertTooltip() {
6942
- const wrapper = this.$el;
6943
- wrapper.parentNode.insertBefore(this.activatorEl, wrapper);
6944
- this.detachToTarget.appendChild(this.tooltipEl);
6945
- },
6946
- removeTooltip() {
6947
- if (this.tooltipEl && this.tooltipEl.parentNode)
6948
- this.tooltipEl.remove();
6949
- }
6950
- },
6951
- mounted() {
6952
- this.activatorEl = this.$el.firstElementChild;
6953
- if (this.detachTo)
6954
- this.insertTooltip();
6955
- if (this.modelValue)
6956
- this.toggle({ type: "click", target: this.activatorEl });
6957
- },
6958
- beforeUnmount() {
6959
- this.removeTooltip();
6960
- if (this.activatorEl && this.activatorEl.parentNode)
6961
- this.activatorEl.remove();
6962
- },
6963
- watch: {
6964
- modelValue(bool) {
6965
- if (bool !== this.showTooltip)
6966
- this.toggle({ type: "click", target: this.activatorEl });
6967
- },
6968
- detachTo() {
6969
- this.removeTooltip();
6970
- this.insertTooltip();
7002
+ this.$emit("update:modelValue", this.detachableVisible = false);
7003
+ this.$emit("input", false);
7004
+ this.$emit("close");
7005
+ document.removeEventListener("mousedown", this.onOutsideMousedown);
7006
+ window.removeEventListener("resize", this.onResize);
6971
7007
  }
6972
7008
  }
6973
7009
  };