wave-ui 2.27.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");
@@ -525,7 +525,7 @@ function render$O(_ctx, _cache, $props, $setup, $data, $options) {
525
525
  }, [
526
526
  $props.expandIcon && !$props.expandIconRight ? (openBlock(), createBlock(_component_w_button, {
527
527
  key: 0,
528
- class: "w-accordion__expand-icon",
528
+ class: normalizeClass(["w-accordion__expand-icon", { "w-accordion__expand-icon--expanded": item._expanded }]),
529
529
  icon: item._expanded && $props.collapseIcon || $props.expandIcon,
530
530
  disabled: item._disabled || null,
531
531
  tabindex: -1,
@@ -533,7 +533,7 @@ function render$O(_ctx, _cache, $props, $setup, $data, $options) {
533
533
  onKeypress: _cache[0] || (_cache[0] = withModifiers(() => {
534
534
  }, ["stop"])),
535
535
  onClick: withModifiers(($event) => !item._disabled && $options.toggleItem(item, $event), ["stop"])
536
- }, null, 8, ["icon", "disabled", "onClick"])) : createCommentVNode("", true),
536
+ }, null, 8, ["icon", "disabled", "onClick", "class"])) : createCommentVNode("", true),
537
537
  _ctx.$slots[`item-title.${item.id || i + 1}`] ? renderSlot(_ctx.$slots, `item-title.${item.id || i + 1}`, {
538
538
  key: 1,
539
539
  item: $options.getOriginalItem(item),
@@ -548,18 +548,18 @@ 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,
555
- class: "w-accordion__expand-icon",
555
+ class: normalizeClass(["w-accordion__expand-icon", { "w-accordion__expand-icon--expanded": item._expanded }]),
556
556
  icon: item._expanded && $props.collapseIcon || $props.expandIcon,
557
557
  text: "",
558
558
  onKeypress: _cache[1] || (_cache[1] = withModifiers(() => {
559
559
  }, ["stop"])),
560
560
  onClick: withModifiers(($event) => !item._disabled && $options.toggleItem(item, $event), ["stop"])
561
- }, null, 8, ["icon", "onClick"])) : createCommentVNode("", true)
562
- ], 42, _hoisted_2$f),
561
+ }, null, 8, ["icon", "onClick", "class"])) : createCommentVNode("", true)
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,22 +579,23 @@ 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
  }
592
592
  var wAccordion_vue_vue_type_style_index_0_lang = "";
593
593
  var _export_sfc = (sfc, props) => {
594
+ const target = sfc.__vccOpts || sfc;
594
595
  for (const [key, val] of props) {
595
- sfc[key] = val;
596
+ target[key] = val;
596
597
  }
597
- return sfc;
598
+ return target;
598
599
  };
599
600
  const _sfc_main$O = {
600
601
  name: "w-accordion",
@@ -669,7 +670,7 @@ const _sfc_main$O = {
669
670
  }
670
671
  };
671
672
  var wAccordion = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", render$O]]);
672
- const _hoisted_1$r = { class: "w-alert__content" };
673
+ const _hoisted_1$s = { class: "w-alert__content" };
673
674
  function render$N(_ctx, _cache, $props, $setup, $data, $options) {
674
675
  const _component_w_icon = resolveComponent("w-icon");
675
676
  const _component_w_button = resolveComponent("w-button");
@@ -687,7 +688,7 @@ function render$N(_ctx, _cache, $props, $setup, $data, $options) {
687
688
  ]),
688
689
  _: 1
689
690
  })) : createCommentVNode("", true),
690
- createElementVNode("div", _hoisted_1$r, [
691
+ createElementVNode("div", _hoisted_1$s, [
691
692
  renderSlot(_ctx.$slots, "default")
692
693
  ]),
693
694
  $props.dismiss ? (openBlock(), createBlock(_component_w_button, {
@@ -991,7 +992,7 @@ const _sfc_main$L = {
991
992
  classes() {
992
993
  return {
993
994
  "d-block": this.block,
994
- "row": this.row,
995
+ row: this.row,
995
996
  "align-center": this.alignCenter,
996
997
  "align-end": this.alignEnd,
997
998
  "justify-center": this.justifyCenter,
@@ -1134,7 +1135,7 @@ const _sfc_main$K = {
1134
1135
  }
1135
1136
  };
1136
1137
  var wBadge = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["render", render$K]]);
1137
- const _hoisted_1$q = ["innerHTML"];
1138
+ const _hoisted_1$r = ["innerHTML"];
1138
1139
  function render$J(_ctx, _cache, $props, $setup, $data, $options) {
1139
1140
  const _component_w_icon = resolveComponent("w-icon");
1140
1141
  return openBlock(), createElementBlock("div", {
@@ -1186,7 +1187,7 @@ function render$J(_ctx, _cache, $props, $setup, $data, $options) {
1186
1187
  }) : (openBlock(), createElementBlock("span", {
1187
1188
  key: `${i}f`,
1188
1189
  innerHTML: item[$props.itemLabelKey]
1189
- }, null, 8, _hoisted_1$q))
1190
+ }, null, 8, _hoisted_1$r))
1190
1191
  ], 64);
1191
1192
  }), 256))
1192
1193
  ], 2);
@@ -1224,11 +1225,11 @@ const _sfc_main$J = {
1224
1225
  }
1225
1226
  };
1226
1227
  var wBreadcrumbs = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["render", render$J]]);
1227
- const _hoisted_1$p = {
1228
+ const _hoisted_1$q = {
1228
1229
  key: 0,
1229
1230
  class: "w-button__loader"
1230
1231
  };
1231
- 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" }, [
1232
1233
  /* @__PURE__ */ createElementVNode("circle", {
1233
1234
  cx: "20",
1234
1235
  cy: "20",
@@ -1256,9 +1257,9 @@ function render$I(_ctx, _cache, $props, $setup, $data, $options) {
1256
1257
  })) : renderSlot(_ctx.$slots, "default", { key: 1 }),
1257
1258
  createVNode(Transition, { name: "scale-fade" }, {
1258
1259
  default: withCtx(() => [
1259
- $props.loading ? (openBlock(), createElementBlock("div", _hoisted_1$p, [
1260
+ $props.loading ? (openBlock(), createElementBlock("div", _hoisted_1$q, [
1260
1261
  renderSlot(_ctx.$slots, "loading", {}, () => [
1261
- _hoisted_2$e
1262
+ _hoisted_2$d
1262
1263
  ])
1263
1264
  ])) : createCommentVNode("", true)
1264
1265
  ]),
@@ -1365,11 +1366,11 @@ var wButton = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["render", render$I]]);
1365
1366
  const objectifyClasses = (classes = {}) => {
1366
1367
  if (typeof classes === "string")
1367
1368
  classes = { [classes]: true };
1368
- else if (typeof classes === "array")
1369
+ else if (Array.isArray(classes))
1369
1370
  classes = { [classes.join(" ")]: true };
1370
1371
  return classes;
1371
1372
  };
1372
- const _hoisted_1$o = ["innerHTML"];
1373
+ const _hoisted_1$p = ["innerHTML"];
1373
1374
  function render$H(_ctx, _cache, $props, $setup, $data, $options) {
1374
1375
  const _component_w_image = resolveComponent("w-image");
1375
1376
  return openBlock(), createElementBlock("div", {
@@ -1385,7 +1386,7 @@ function render$H(_ctx, _cache, $props, $setup, $data, $options) {
1385
1386
  key: 1,
1386
1387
  class: normalizeClass(["w-card__title", $options.titleClasses]),
1387
1388
  innerHTML: $props.title
1388
- }, null, 10, _hoisted_1$o)) : createCommentVNode("", true),
1389
+ }, null, 10, _hoisted_1$p)) : createCommentVNode("", true),
1389
1390
  $props.image ? (openBlock(), createBlock(_component_w_image, mergeProps({
1390
1391
  key: 2,
1391
1392
  class: "w-card__image",
@@ -1494,10 +1495,10 @@ var FormElementMixin = {
1494
1495
  }
1495
1496
  }
1496
1497
  };
1497
- const _hoisted_1$n = ["id", "name", "checked", "disabled", "required", "tabindex", "aria-checked"];
1498
- const _hoisted_2$d = ["for"];
1499
- const _hoisted_3$b = ["for", "innerHTML"];
1500
- 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", {
1501
1502
  width: "11px",
1502
1503
  height: "9px",
1503
1504
  viewbox: "0 0 12 9"
@@ -1505,7 +1506,7 @@ const _hoisted_4$a = /* @__PURE__ */ createElementVNode("svg", {
1505
1506
  /* @__PURE__ */ createElementVNode("polyline", { points: "1 5 4 8 10 2" })
1506
1507
  ], -1);
1507
1508
  const _hoisted_5$8 = [
1508
- _hoisted_4$a
1509
+ _hoisted_4$9
1509
1510
  ];
1510
1511
  const _hoisted_6$5 = ["for"];
1511
1512
  const _hoisted_7$5 = ["for", "innerHTML"];
@@ -1535,7 +1536,7 @@ function render$G(_ctx, _cache, $props, $setup, $data, $options) {
1535
1536
  onKeypress: _cache[3] || (_cache[3] = withKeys((...args) => $options.onInput && $options.onInput(...args), ["enter"])),
1536
1537
  "aria-checked": $data.isChecked || "false",
1537
1538
  role: "checkbox"
1538
- }, null, 40, _hoisted_1$n),
1539
+ }, null, 40, _hoisted_1$o),
1539
1540
  $options.hasLabel && $props.labelOnLeft ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1540
1541
  _ctx.$slots.default ? (openBlock(), createElementBlock("label", {
1541
1542
  key: 0,
@@ -1543,12 +1544,12 @@ function render$G(_ctx, _cache, $props, $setup, $data, $options) {
1543
1544
  for: `w-checkbox--${_ctx._.uid}`
1544
1545
  }, [
1545
1546
  renderSlot(_ctx.$slots, "default")
1546
- ], 8, _hoisted_2$d)) : $props.label ? (openBlock(), createElementBlock("label", {
1547
+ ], 8, _hoisted_2$c)) : $props.label ? (openBlock(), createElementBlock("label", {
1547
1548
  key: 1,
1548
1549
  class: "w-checkbox__label w-form-el-shakable pr2",
1549
1550
  for: `w-checkbox--${_ctx._.uid}`,
1550
1551
  innerHTML: $props.label
1551
- }, null, 8, _hoisted_3$b)) : createCommentVNode("", true)
1552
+ }, null, 8, _hoisted_3$a)) : createCommentVNode("", true)
1552
1553
  ], 64)) : createCommentVNode("", true),
1553
1554
  createElementVNode("div", {
1554
1555
  class: normalizeClass(["w-checkbox__input", this.color]),
@@ -1645,7 +1646,7 @@ const _sfc_main$G = {
1645
1646
  }
1646
1647
  };
1647
1648
  var wCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["render", render$G]]);
1648
- const _hoisted_1$m = ["innerHTML"];
1649
+ const _hoisted_1$n = ["innerHTML"];
1649
1650
  function render$F(_ctx, _cache, $props, $setup, $data, $options) {
1650
1651
  const _component_w_checkbox = resolveComponent("w-checkbox");
1651
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 }, {
@@ -1688,7 +1689,7 @@ function render$F(_ctx, _cache, $props, $setup, $data, $options) {
1688
1689
  }) : item.label ? (openBlock(), createElementBlock("div", {
1689
1690
  key: 2,
1690
1691
  innerHTML: item.label
1691
- }, null, 8, _hoisted_1$m)) : createCommentVNode("", true)
1692
+ }, null, 8, _hoisted_1$n)) : createCommentVNode("", true)
1692
1693
  ]),
1693
1694
  _: 2
1694
1695
  }, 1032, ["model-value", "name", "label", "label-on-left", "color", "round", "onUpdate:modelValue", "disabled", "readonly", "class"]);
@@ -1754,21 +1755,18 @@ const _sfc_main$F = {
1754
1755
  }
1755
1756
  };
1756
1757
  var wCheckboxes = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["render", render$F]]);
1757
- const _hoisted_1$l = { class: "w-confirm" };
1758
- const _hoisted_2$c = /* @__PURE__ */ createTextVNode("Are you sure?");
1759
- const _hoisted_3$a = /* @__PURE__ */ createTextVNode("Cancel");
1760
- const _hoisted_4$9 = /* @__PURE__ */ createTextVNode("Confirm");
1758
+ const _hoisted_1$m = { class: "w-confirm" };
1761
1759
  function render$E(_ctx, _cache, $props, $setup, $data, $options) {
1762
1760
  const _component_w_button = resolveComponent("w-button");
1763
1761
  const _component_w_flex = resolveComponent("w-flex");
1764
1762
  const _component_w_menu = resolveComponent("w-menu");
1765
- return openBlock(), createElementBlock("div", _hoisted_1$l, [
1763
+ return openBlock(), createElementBlock("div", _hoisted_1$m, [
1766
1764
  createVNode(_component_w_menu, mergeProps({
1767
1765
  modelValue: _ctx.showPopup,
1768
1766
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.showPopup = $event)
1769
1767
  }, $options.wMenuProps), {
1770
1768
  activator: withCtx(({ on }) => [
1771
- 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), {
1772
1770
  default: withCtx(() => [
1773
1771
  renderSlot(_ctx.$slots, "default")
1774
1772
  ]),
@@ -1783,33 +1781,33 @@ function render$E(_ctx, _cache, $props, $setup, $data, $options) {
1783
1781
  default: withCtx(() => [
1784
1782
  createElementVNode("div", null, [
1785
1783
  renderSlot(_ctx.$slots, "question", {}, () => [
1786
- _hoisted_2$c
1784
+ createTextVNode(toDisplayString($props.question), 1)
1787
1785
  ])
1788
1786
  ]),
1789
1787
  createElementVNode("div", {
1790
1788
  class: normalizeClass(["w-flex justify-end", $props.inline ? "ml2" : "mt2"])
1791
1789
  }, [
1792
- !$props.noCancel ? (openBlock(), createBlock(_component_w_button, mergeProps({
1790
+ $props.cancel !== false ? (openBlock(), createBlock(_component_w_button, mergeProps({
1793
1791
  key: 0,
1794
1792
  class: "mr2"
1795
- }, $props.cancelButton, {
1796
- "bg-color": ($props.cancelButton || {}).bgColor || "error",
1793
+ }, $options.cancelButtonProps, {
1794
+ "bg-color": ($options.cancelButton || {}).bgColor || "error",
1797
1795
  onClick: $options.onCancel
1798
1796
  }), {
1799
1797
  default: withCtx(() => [
1800
1798
  renderSlot(_ctx.$slots, "cancel", {}, () => [
1801
- _hoisted_3$a
1799
+ createTextVNode(toDisplayString($options.cancelButton.label), 1)
1802
1800
  ])
1803
1801
  ]),
1804
1802
  _: 3
1805
1803
  }, 16, ["bg-color", "onClick"])) : createCommentVNode("", true),
1806
- createVNode(_component_w_button, mergeProps($props.confirmButton, {
1807
- "bg-color": ($props.confirmButton || {}).bgColor || "success",
1804
+ createVNode(_component_w_button, mergeProps($options.confirmButtonProps, {
1805
+ "bg-color": ($options.confirmButton || {}).bgColor || "success",
1808
1806
  onClick: $options.onConfirm
1809
1807
  }), {
1810
1808
  default: withCtx(() => [
1811
1809
  renderSlot(_ctx.$slots, "confirm", {}, () => [
1812
- _hoisted_4$9
1810
+ createTextVNode(toDisplayString($options.confirmButton.label), 1)
1813
1811
  ])
1814
1812
  ]),
1815
1813
  _: 3
@@ -1830,9 +1828,9 @@ const _sfc_main$E = {
1830
1828
  color: { type: String },
1831
1829
  icon: { type: String },
1832
1830
  mainButton: { type: Object },
1833
- noCancel: { type: Boolean },
1834
- cancelButton: { type: [Boolean, Object] },
1835
- 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] },
1836
1834
  inline: { type: Boolean },
1837
1835
  menu: { type: Object },
1838
1836
  noArrow: { type: Boolean },
@@ -1853,6 +1851,26 @@ const _sfc_main$E = {
1853
1851
  props: []
1854
1852
  }),
1855
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
+ },
1856
1874
  wMenuProps() {
1857
1875
  return __spreadValues({
1858
1876
  top: this.top,
@@ -2061,7 +2079,7 @@ const _sfc_main$B = {
2061
2079
  }
2062
2080
  };
2063
2081
  var wDivider = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", render$B]]);
2064
- const _hoisted_1$k = { class: "w-drawer-wrap__pushable" };
2082
+ const _hoisted_1$l = { class: "w-drawer-wrap__pushable" };
2065
2083
  function render$A(_ctx, _cache, $props, $setup, $data, $options) {
2066
2084
  const _component_w_overlay = resolveComponent("w-overlay");
2067
2085
  return $data.showWrapper || $props.pushContent ? (openBlock(), createElementBlock("div", {
@@ -2073,7 +2091,7 @@ function render$A(_ctx, _cache, $props, $setup, $data, $options) {
2073
2091
  class: "w-drawer-wrap__track",
2074
2092
  style: normalizeStyle($options.trackStyles)
2075
2093
  }, [
2076
- createElementVNode("div", _hoisted_1$k, [
2094
+ createElementVNode("div", _hoisted_1$l, [
2077
2095
  !$props.noOverlay ? (openBlock(), createBlock(_component_w_overlay, {
2078
2096
  key: 0,
2079
2097
  modelValue: $data.showDrawer,
@@ -2283,6 +2301,7 @@ const _sfc_main$z = {
2283
2301
  justifyEnd: { type: Boolean },
2284
2302
  justifySpaceBetween: { type: Boolean },
2285
2303
  justifySpaceAround: { type: Boolean },
2304
+ justifySpaceEvenly: { type: Boolean },
2286
2305
  basisZero: { type: Boolean },
2287
2306
  gap: { type: Number, default: 0 }
2288
2307
  },
@@ -2304,6 +2323,7 @@ const _sfc_main$z = {
2304
2323
  "justify-end": this.justifyEnd,
2305
2324
  "justify-space-between": this.justifySpaceBetween,
2306
2325
  "justify-space-around": this.justifySpaceAround,
2326
+ "justify-space-evenly": this.justifySpaceEvenly,
2307
2327
  "basis-zero": this.basisZero,
2308
2328
  [`w-flex--gap${this.gap}`]: this.gap
2309
2329
  };
@@ -2451,7 +2471,7 @@ const _sfc_main$y = {
2451
2471
  }
2452
2472
  };
2453
2473
  var wForm = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", render$y]]);
2454
- const _hoisted_1$j = {
2474
+ const _hoisted_1$k = {
2455
2475
  key: 0,
2456
2476
  class: "w-form-el__error error w-form-el__error w-form-el__error"
2457
2477
  };
@@ -2469,7 +2489,7 @@ function render$x(_ctx, _cache, $props, $setup, $data, $options) {
2469
2489
  createVNode(_component_w_transition_expand, { y: "" }, {
2470
2490
  default: withCtx(() => [
2471
2491
  _ctx.Validation.message ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2472
- _ctx.$slots["error-message"] ? (openBlock(), createElementBlock("div", _hoisted_1$j, [
2492
+ _ctx.$slots["error-message"] ? (openBlock(), createElementBlock("div", _hoisted_1$k, [
2473
2493
  renderSlot(_ctx.$slots, "error-message", {
2474
2494
  message: _ctx.Validation.message
2475
2495
  })
@@ -2649,7 +2669,7 @@ const _sfc_main$w = {
2649
2669
  }
2650
2670
  };
2651
2671
  var wIcon = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", render$w]]);
2652
- const _hoisted_1$i = {
2672
+ const _hoisted_1$j = {
2653
2673
  key: 0,
2654
2674
  class: "w-image__loader"
2655
2675
  };
@@ -2674,7 +2694,7 @@ function render$v(_ctx, _cache, $props, $setup, $data, $options) {
2674
2694
  ]),
2675
2695
  _: 1
2676
2696
  }, 8, ["name"]),
2677
- !$props.noSpinner && $data.loading ? (openBlock(), createElementBlock("div", _hoisted_1$i, [
2697
+ !$props.noSpinner && $data.loading ? (openBlock(), createElementBlock("div", _hoisted_1$j, [
2678
2698
  _ctx.$slots.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(_component_w_progress, {
2679
2699
  key: 1,
2680
2700
  circle: "",
@@ -2819,7 +2839,7 @@ const _sfc_main$v = {
2819
2839
  }
2820
2840
  };
2821
2841
  var wImage = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", render$v]]);
2822
- const _hoisted_1$h = ["name"];
2842
+ const _hoisted_1$i = ["name"];
2823
2843
  const _hoisted_2$a = ["for"];
2824
2844
  const _hoisted_3$9 = ["for", "innerHTML"];
2825
2845
  const _hoisted_4$8 = ["id", "type", "name", "placeholder", "step", "min", "max", "minlength", "maxlength", "readonly", "aria-readonly", "disabled", "required", "tabindex"];
@@ -2854,7 +2874,7 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
2854
2874
  type: "hidden",
2855
2875
  name: _ctx.name || null,
2856
2876
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.inputValue = $event)
2857
- }, null, 8, _hoisted_1$h)), [
2877
+ }, null, 8, _hoisted_1$i)), [
2858
2878
  [vModelText, $data.inputValue]
2859
2879
  ]) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2860
2880
  $props.labelPosition === "left" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
@@ -2889,6 +2909,7 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
2889
2909
  $props.type !== "file" ? withDirectives((openBlock(), createElementBlock("input", mergeProps({
2890
2910
  key: 1,
2891
2911
  class: "w-input__input",
2912
+ ref: "input",
2892
2913
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.inputValue = $event)
2893
2914
  }, toHandlers($options.listeners), {
2894
2915
  onInput: _cache[3] || (_cache[3] = (...args) => $options.onInput && $options.onInput(...args)),
@@ -2910,9 +2931,9 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
2910
2931
  tabindex: _ctx.tabindex || null
2911
2932
  }, $options.attrs), null, 16, _hoisted_4$8)), [
2912
2933
  [vModelDynamic, $data.inputValue]
2913
- ]) : createCommentVNode("", true),
2914
- $props.type === "file" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
2934
+ ]) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
2915
2935
  createElementVNode("input", mergeProps({
2936
+ ref: "input",
2916
2937
  id: `w-input--${_ctx._.uid}`,
2917
2938
  type: "file",
2918
2939
  name: _ctx.name || null,
@@ -2950,7 +2971,7 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
2950
2971
  ]),
2951
2972
  _: 3
2952
2973
  }, 8, ["for"])
2953
- ], 64)) : createCommentVNode("", true),
2974
+ ], 64)),
2954
2975
  $props.labelPosition === "inside" && $options.showLabelInside ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
2955
2976
  _ctx.$slots.default ? (openBlock(), createElementBlock("label", {
2956
2977
  key: 0,
@@ -3062,7 +3083,8 @@ const _sfc_main$u = {
3062
3083
  inputNumberError: false,
3063
3084
  isFocused: false,
3064
3085
  inputFiles: [],
3065
- fileReader: null
3086
+ fileReader: null,
3087
+ isAutofilled: false
3066
3088
  };
3067
3089
  },
3068
3090
  computed: {
@@ -3079,7 +3101,7 @@ const _sfc_main$u = {
3079
3101
  return htmlAttrs;
3080
3102
  },
3081
3103
  hasValue() {
3082
- return this.inputValue || ["date", "time"].includes(this.type) || this.type === "number" && this.inputNumberError || this.type === "file" && this.inputFiles.length;
3104
+ return this.inputValue || this.inputValue === 0 || ["date", "time"].includes(this.type) || this.type === "number" && this.inputNumberError || this.type === "file" && this.inputFiles.length;
3083
3105
  },
3084
3106
  hasLabel() {
3085
3107
  return this.label || this.$slots.default;
@@ -3093,7 +3115,7 @@ const _sfc_main$u = {
3093
3115
  "w-input--file": this.type === "file",
3094
3116
  "w-input--disabled": this.isDisabled,
3095
3117
  "w-input--readonly": this.isReadonly,
3096
- [`w-input--${this.hasValue ? "filled" : "empty"}`]: true,
3118
+ [`w-input--${this.hasValue || this.isAutofilled ? "filled" : "empty"}`]: true,
3097
3119
  "w-input--focused": this.isFocused && !this.isReadonly,
3098
3120
  "w-input--dark": this.dark,
3099
3121
  "w-input--floating-label": this.hasLabel && this.labelPosition === "inside" && !this.staticLabel,
@@ -3149,6 +3171,8 @@ const _sfc_main$u = {
3149
3171
  return file;
3150
3172
  });
3151
3173
  this.$emit("update:modelValue", this.inputFiles);
3174
+ this.$emit("input", this.inputFiles);
3175
+ this.$emit("change", this.inputFiles);
3152
3176
  },
3153
3177
  filePreview(original, file) {
3154
3178
  const reader = new FileReader();
@@ -3164,9 +3188,17 @@ const _sfc_main$u = {
3164
3188
  reader.readAsDataURL(original);
3165
3189
  }
3166
3190
  },
3191
+ mounted() {
3192
+ setTimeout(() => {
3193
+ if (this.$refs.input && this.$refs.input.matches(":-webkit-autofill"))
3194
+ this.isAutofilled = true;
3195
+ }, 400);
3196
+ },
3167
3197
  watch: {
3168
3198
  modelValue(value) {
3169
3199
  this.inputValue = value;
3200
+ if (!value && value !== 0)
3201
+ this.isAutofilled = false;
3170
3202
  }
3171
3203
  }
3172
3204
  };
@@ -3503,34 +3535,153 @@ const _sfc_main$t = {
3503
3535
  }
3504
3536
  };
3505
3537
  var wList = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", render$t]]);
3506
- 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" };
3507
3658
  function render$s(_ctx, _cache, $props, $setup, $data, $options) {
3508
3659
  const _component_w_card = resolveComponent("w-card");
3509
3660
  const _component_w_overlay = resolveComponent("w-overlay");
3510
- return openBlock(), createElementBlock("div", _hoisted_1$g, [
3661
+ return openBlock(), createElementBlock("div", _hoisted_1$h, [
3511
3662
  renderSlot(_ctx.$slots, "activator", { on: $options.activatorEventHandlers }),
3512
3663
  createVNode(Transition, {
3513
3664
  name: $options.transitionName,
3514
3665
  appear: ""
3515
3666
  }, {
3516
3667
  default: withCtx(() => [
3517
- $props.custom && _ctx.menuVisible ? (openBlock(), createElementBlock("div", {
3668
+ $props.custom && _ctx.detachableVisible ? (openBlock(), createElementBlock("div", {
3518
3669
  key: 0,
3519
3670
  class: normalizeClass(["w-menu", $options.classes]),
3520
- ref: "menu",
3521
- 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)),
3522
3673
  onMouseenter: _cache[1] || (_cache[1] = ($event) => $props.showOnHover && (_ctx.hoveringMenu = true)),
3523
- 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())),
3524
3675
  style: normalizeStyle($options.styles)
3525
3676
  }, [
3526
3677
  renderSlot(_ctx.$slots, "default")
3527
- ], 38)) : _ctx.menuVisible ? (openBlock(), createBlock(_component_w_card, {
3678
+ ], 38)) : _ctx.detachableVisible ? (openBlock(), createBlock(_component_w_card, {
3528
3679
  key: 1,
3529
3680
  class: normalizeClass(["w-menu", $options.classes]),
3530
- ref: "menu",
3531
- 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)),
3532
3683
  onMouseenter: _cache[4] || (_cache[4] = ($event) => $props.showOnHover && (_ctx.hoveringMenu = true)),
3533
- 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())),
3534
3685
  tile: $props.tile,
3535
3686
  "title-class": $options.titleClasses,
3536
3687
  "content-class": $options.contentClasses,
@@ -3562,18 +3713,19 @@ function render$s(_ctx, _cache, $props, $setup, $data, $options) {
3562
3713
  $props.overlay ? (openBlock(), createBlock(_component_w_overlay, mergeProps({
3563
3714
  key: 0,
3564
3715
  ref: "overlay",
3565
- "model-value": _ctx.menuVisible,
3716
+ "model-value": _ctx.detachableVisible,
3566
3717
  persistent: $props.persistent,
3567
3718
  class: $options.overlayClasses
3568
3719
  }, $props.overlayProps, {
3569
3720
  "z-index": ($props.zIndex || 200) - 1,
3570
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => _ctx.menuVisible = false)
3721
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => _ctx.detachableVisible = false)
3571
3722
  }), null, 16, ["model-value", "persistent", "class", "z-index"])) : createCommentVNode("", true)
3572
3723
  ]);
3573
3724
  }
3574
3725
  var wMenu_vue_vue_type_style_index_0_lang = "";
3575
3726
  const _sfc_main$s = {
3576
3727
  name: "w-menu",
3728
+ mixins: [DetachableMixin],
3577
3729
  props: {
3578
3730
  modelValue: {},
3579
3731
  showOnHover: { type: Boolean },
@@ -3590,7 +3742,8 @@ const _sfc_main$s = {
3590
3742
  titleClass: { type: [String, Object, Array] },
3591
3743
  contentClass: { type: [String, Object, Array] },
3592
3744
  arrow: { type: Boolean },
3593
- detachTo: { type: [String, Boolean, Object] },
3745
+ detachTo: { type: [String, Boolean, Object], deprecated: true },
3746
+ appendTo: { type: [String, Boolean, Object] },
3594
3747
  fixed: { type: Boolean },
3595
3748
  top: { type: Boolean },
3596
3749
  bottom: { type: Boolean },
@@ -3610,55 +3763,34 @@ const _sfc_main$s = {
3610
3763
  },
3611
3764
  emits: ["input", "update:modelValue", "open", "close"],
3612
3765
  data: () => ({
3613
- menuVisible: false,
3766
+ detachableVisible: false,
3614
3767
  hoveringActivator: false,
3615
3768
  hoveringMenu: false,
3616
- menuCoordinates: {
3769
+ detachableCoords: {
3617
3770
  top: 0,
3618
3771
  left: 0
3619
3772
  },
3620
3773
  activatorEl: null,
3621
3774
  activatorWidth: 0,
3622
- menuEl: null,
3775
+ detachableEl: null,
3623
3776
  timeoutId: null
3624
3777
  }),
3625
3778
  computed: {
3626
3779
  transitionName() {
3627
3780
  return this.transition || "scale-fade";
3628
3781
  },
3629
- detachToTarget() {
3630
- let target = this.detachTo || ".w-app";
3631
- if (target === true)
3632
- target = ".w-app";
3633
- else if (target && !["object", "string"].includes(typeof target))
3634
- target = ".w-app";
3635
- else if (typeof target === "object" && !target.nodeType) {
3636
- target = ".w-app";
3637
- consoleWarn("Invalid node provided in w-menu `detach-to`. Falling back to .w-app.");
3638
- }
3639
- if (typeof target === "string")
3640
- target = document.querySelector(target);
3641
- if (!target) {
3642
- consoleWarn(`Unable to locate ${this.detachTo ? `target ${this.detachTo}` : ".w-app"}`);
3643
- target = document.querySelector(".w-app");
3644
- }
3645
- return target;
3646
- },
3647
- menuParentEl() {
3648
- return this.detachToTarget;
3649
- },
3650
3782
  position() {
3651
3783
  return this.top && "top" || this.bottom && "bottom" || this.left && "left" || this.right && "right" || "bottom";
3652
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
+ },
3653
3788
  menuMinWidth() {
3654
3789
  if (this.minWidth === "activator")
3655
3790
  return this.activatorWidth ? `${this.activatorWidth}px` : 0;
3656
3791
  else
3657
3792
  return isNaN(this.minWidth) ? this.minWidth : this.minWidth ? `${this.minWidth}px` : 0;
3658
3793
  },
3659
- alignment() {
3660
- 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" || "";
3661
- },
3662
3794
  menuClasses() {
3663
3795
  return objectifyClasses(this.menuClass);
3664
3796
  },
@@ -3689,8 +3821,8 @@ const _sfc_main$s = {
3689
3821
  styles() {
3690
3822
  return {
3691
3823
  zIndex: this.zIndex || this.zIndex === 0 || this.overlay && !this.zIndex && 200 || null,
3692
- top: this.menuCoordinates.top && `${~~this.menuCoordinates.top}px` || null,
3693
- 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,
3694
3826
  minWidth: this.minWidth && this.menuMinWidth || null,
3695
3827
  "--w-menu-bg-color": this.arrow && this.$waveui.colors[this.bgColor || "white"]
3696
3828
  };
@@ -3703,18 +3835,19 @@ const _sfc_main$s = {
3703
3835
  blur: this.toggleMenu,
3704
3836
  mouseenter: (e) => {
3705
3837
  this.hoveringActivator = true;
3706
- this.openMenu(e);
3838
+ this.open(e);
3707
3839
  },
3708
3840
  mouseleave: (e) => {
3709
3841
  this.hoveringActivator = false;
3710
3842
  setTimeout(() => {
3711
3843
  if (!this.hoveringMenu)
3712
- this.closeMenu();
3844
+ this.close();
3713
3845
  }, 10);
3714
3846
  }
3715
3847
  };
3716
- if ("ontouchstart" in window)
3848
+ if (typeof window !== "undefined" && "ontouchstart" in window) {
3717
3849
  handlers.click = this.toggleMenu;
3850
+ }
3718
3851
  } else
3719
3852
  handlers = { click: this.toggleMenu };
3720
3853
  return handlers;
@@ -3722,7 +3855,7 @@ const _sfc_main$s = {
3722
3855
  },
3723
3856
  methods: {
3724
3857
  toggleMenu(e) {
3725
- let shouldShowMenu = this.menuVisible;
3858
+ let shouldShowMenu = this.detachableVisible;
3726
3859
  if ("ontouchstart" in window && this.showOnHover && e.type === "click") {
3727
3860
  shouldShowMenu = !shouldShowMenu;
3728
3861
  } else if (e.type === "click" && !this.showOnHover)
@@ -3736,20 +3869,20 @@ const _sfc_main$s = {
3736
3869
  }
3737
3870
  this.timeoutId = clearTimeout(this.timeoutId);
3738
3871
  if (shouldShowMenu) {
3739
- this.$emit("update:modelValue", this.menuVisible = true);
3872
+ this.$emit("update:modelValue", this.detachableVisible = true);
3740
3873
  this.$emit("input", true);
3741
3874
  this.$emit("open");
3742
- this.openMenu(e);
3875
+ this.open(e);
3743
3876
  } else
3744
- this.closeMenu();
3877
+ this.close();
3745
3878
  },
3746
- async openMenu(e) {
3747
- this.menuVisible = true;
3748
- await this.insertMenu();
3879
+ async open(e) {
3880
+ this.detachableVisible = true;
3881
+ await this.insertInDOM();
3749
3882
  if (this.minWidth === "activator")
3750
3883
  this.activatorWidth = this.activatorEl.offsetWidth;
3751
3884
  if (!this.noPosition)
3752
- this.computeMenuPosition(e);
3885
+ this.computeDetachableCoords(e);
3753
3886
  this.timeoutId = setTimeout(() => {
3754
3887
  this.$emit("update:modelValue", true);
3755
3888
  this.$emit("input", true);
@@ -3760,105 +3893,19 @@ const _sfc_main$s = {
3760
3893
  if (!this.noPosition)
3761
3894
  window.addEventListener("resize", this.onResize);
3762
3895
  },
3763
- async closeMenu(force = false) {
3764
- if (!this.menuVisible)
3896
+ async close(force = false) {
3897
+ if (!this.detachableVisible)
3765
3898
  return;
3766
3899
  if (this.showOnHover && !force) {
3767
3900
  await new Promise((resolve) => setTimeout(resolve, 10));
3768
3901
  if (this.showOnHover && (this.hoveringMenu || this.hoveringActivator))
3769
3902
  return;
3770
3903
  }
3771
- this.$emit("update:modelValue", this.menuVisible = false);
3904
+ this.$emit("update:modelValue", this.detachableVisible = false);
3772
3905
  this.$emit("input", false);
3773
3906
  this.$emit("close");
3774
3907
  document.removeEventListener("mousedown", this.onOutsideMousedown);
3775
3908
  window.removeEventListener("resize", this.onResize);
3776
- },
3777
- onOutsideMousedown(e) {
3778
- if (!this.menuEl.contains(e.target) && !this.activatorEl.contains(e.target)) {
3779
- this.$emit("update:modelValue", this.menuVisible = false);
3780
- this.$emit("input", false);
3781
- this.$emit("close");
3782
- document.removeEventListener("mousedown", this.onOutsideMousedown);
3783
- window.removeEventListener("resize", this.onResize);
3784
- }
3785
- },
3786
- onResize() {
3787
- if (this.minWidth === "activator")
3788
- this.activatorWidth = this.activatorEl.offsetWidth;
3789
- this.computeMenuPosition();
3790
- },
3791
- getCoordinates(e) {
3792
- const { top, left, width, height } = (e ? e.target : this.activatorEl).getBoundingClientRect();
3793
- let coords = { top, left, width, height };
3794
- if (!this.fixed) {
3795
- const { top: targetTop, left: targetLeft } = this.menuParentEl.getBoundingClientRect();
3796
- const computedStyles2 = window.getComputedStyle(this.menuParentEl, null);
3797
- coords = __spreadProps(__spreadValues({}, coords), {
3798
- top: top - targetTop + this.menuParentEl.scrollTop - parseInt(computedStyles2.getPropertyValue("border-top-width")),
3799
- left: left - targetLeft + this.menuParentEl.scrollLeft - parseInt(computedStyles2.getPropertyValue("border-left-width"))
3800
- });
3801
- }
3802
- return coords;
3803
- },
3804
- computeMenuPosition(e) {
3805
- let { top, left, width, height } = this.getCoordinates(e);
3806
- this.menuEl.style.visibility = "hidden";
3807
- this.menuEl.style.display = "flex";
3808
- const computedStyles2 = window.getComputedStyle(this.menuEl, null);
3809
- switch (this.position) {
3810
- case "top": {
3811
- top -= this.menuEl.offsetHeight;
3812
- if (this.alignRight) {
3813
- left += width - this.menuEl.offsetWidth + parseInt(computedStyles2.getPropertyValue("border-right-width"));
3814
- } else if (!this.alignLeft)
3815
- left += (width - this.menuEl.offsetWidth) / 2;
3816
- break;
3817
- }
3818
- case "bottom": {
3819
- top += height;
3820
- if (this.alignRight) {
3821
- left += width - this.menuEl.offsetWidth + parseInt(computedStyles2.getPropertyValue("border-right-width"));
3822
- } else if (!this.alignLeft)
3823
- left += (width - this.menuEl.offsetWidth) / 2;
3824
- break;
3825
- }
3826
- case "left": {
3827
- left -= this.menuEl.offsetWidth;
3828
- if (this.alignBottom)
3829
- top += height - this.menuEl.offsetHeight;
3830
- else if (!this.alignTop)
3831
- top += (height - this.menuEl.offsetHeight) / 2;
3832
- break;
3833
- }
3834
- case "right": {
3835
- left += width;
3836
- if (this.alignBottom) {
3837
- top += height - this.menuEl.offsetHeight + parseInt(computedStyles2.getPropertyValue("margin-top"));
3838
- } else if (!this.alignTop) {
3839
- top += (height - this.menuEl.offsetHeight) / 2 + parseInt(computedStyles2.getPropertyValue("margin-top"));
3840
- }
3841
- break;
3842
- }
3843
- }
3844
- this.menuEl.style.visibility = null;
3845
- if (!this.menuVisible)
3846
- this.menuEl.style.display = "none";
3847
- this.menuCoordinates = { top, left };
3848
- },
3849
- insertMenu() {
3850
- return new Promise((resolve) => {
3851
- this.$nextTick(() => {
3852
- var _a;
3853
- this.menuEl = ((_a = this.$refs.menu) == null ? void 0 : _a.$el) || this.$refs.menu;
3854
- this.detachToTarget.appendChild(this.menuEl);
3855
- resolve();
3856
- });
3857
- });
3858
- },
3859
- removeMenu() {
3860
- if (this.menuEl && this.menuEl.parentNode)
3861
- this.menuEl.remove();
3862
3909
  }
3863
3910
  },
3864
3911
  mounted() {
@@ -3874,7 +3921,7 @@ const _sfc_main$s = {
3874
3921
  this.toggleMenu({ type: "click", target: this.activatorEl });
3875
3922
  },
3876
3923
  beforeUnmount() {
3877
- this.removeMenu();
3924
+ this.removeFromDOM();
3878
3925
  if (this.overlay && this.overlayEl.parentNode)
3879
3926
  this.overlayEl.remove();
3880
3927
  if (this.activatorEl && this.activatorEl.parentNode)
@@ -3882,12 +3929,16 @@ const _sfc_main$s = {
3882
3929
  },
3883
3930
  watch: {
3884
3931
  modelValue(bool) {
3885
- if (!!bool !== this.menuVisible)
3932
+ if (!!bool !== this.detachableVisible)
3886
3933
  this.toggleMenu({ type: "click", target: this.activatorEl });
3887
3934
  },
3888
3935
  detachTo() {
3889
- this.removeMenu();
3890
- this.insertMenu();
3936
+ this.removeFromDOM();
3937
+ this.insertInDOM();
3938
+ },
3939
+ appendTo() {
3940
+ this.removeFromDOM();
3941
+ this.insertInDOM();
3891
3942
  }
3892
3943
  }
3893
3944
  };
@@ -4125,9 +4176,9 @@ const _sfc_main$q = {
4125
4176
  }
4126
4177
  };
4127
4178
  var wOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", render$q]]);
4128
- const _hoisted_1$f = { class: "w-parallax" };
4179
+ const _hoisted_1$g = { class: "w-parallax" };
4129
4180
  function render$p(_ctx, _cache, $props, $setup, $data, $options) {
4130
- return openBlock(), createElementBlock("div", _hoisted_1$f);
4181
+ return openBlock(), createElementBlock("div", _hoisted_1$g);
4131
4182
  }
4132
4183
  var wParallax_vue_vue_type_style_index_0_lang = "";
4133
4184
  const _sfc_main$p = {
@@ -4137,7 +4188,7 @@ const _sfc_main$p = {
4137
4188
  data: () => ({})
4138
4189
  };
4139
4190
  var wParallax = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", render$p]]);
4140
- const _hoisted_1$e = ["viewBox"];
4191
+ const _hoisted_1$f = ["viewBox"];
4141
4192
  const _hoisted_2$9 = ["cx", "cy", "r", "stroke-dasharray", "stroke-width"];
4142
4193
  const _hoisted_3$8 = ["viewBox"];
4143
4194
  const _hoisted_4$7 = ["cx", "cy", "r", "stroke-width", "stroke-linecap", "stroke-dasharray"];
@@ -4164,7 +4215,7 @@ function render$o(_ctx, _cache, $props, $setup, $data, $options) {
4164
4215
  "stroke-dasharray": _ctx.circleCircumference,
4165
4216
  "stroke-width": $props.stroke
4166
4217
  }, null, 10, _hoisted_2$9)) : createCommentVNode("", true)
4167
- ], 8, _hoisted_1$e)),
4218
+ ], 8, _hoisted_1$f)),
4168
4219
  (openBlock(), createElementBlock("svg", {
4169
4220
  class: "w-progress__progress",
4170
4221
  viewBox: `${$options.circleCenter / 2} ${$options.circleCenter / 2} ${$options.circleCenter} ${$options.circleCenter}`,
@@ -4263,7 +4314,7 @@ const _sfc_main$o = {
4263
4314
  }
4264
4315
  };
4265
4316
  var wProgress = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", render$o]]);
4266
- 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"];
4267
4318
  const _hoisted_2$8 = ["for"];
4268
4319
  const _hoisted_3$7 = ["for", "innerHTML"];
4269
4320
  const _hoisted_4$6 = ["for"];
@@ -4292,7 +4343,7 @@ function render$n(_ctx, _cache, $props, $setup, $data, $options) {
4292
4343
  onChange: _cache[1] || (_cache[1] = ($event) => $options.onInput($event)),
4293
4344
  "aria-checked": _ctx.inputValue || "false",
4294
4345
  role: "radio"
4295
- }, null, 40, _hoisted_1$d),
4346
+ }, null, 40, _hoisted_1$e),
4296
4347
  $options.hasLabel && $props.labelOnLeft ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
4297
4348
  _ctx.$slots.default ? (openBlock(), createElementBlock("label", {
4298
4349
  key: 0,
@@ -4402,7 +4453,7 @@ const _sfc_main$n = {
4402
4453
  }
4403
4454
  };
4404
4455
  var wRadio = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", render$n]]);
4405
- const _hoisted_1$c = ["innerHTML"];
4456
+ const _hoisted_1$d = ["innerHTML"];
4406
4457
  function render$m(_ctx, _cache, $props, $setup, $data, $options) {
4407
4458
  const _component_w_radio = resolveComponent("w-radio");
4408
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 }, {
@@ -4447,7 +4498,7 @@ function render$m(_ctx, _cache, $props, $setup, $data, $options) {
4447
4498
  }) : item.label ? (openBlock(), createElementBlock("div", {
4448
4499
  key: 2,
4449
4500
  innerHTML: item.label
4450
- }, null, 8, _hoisted_1$c)) : createCommentVNode("", true)
4501
+ }, null, 8, _hoisted_1$d)) : createCommentVNode("", true)
4451
4502
  ]),
4452
4503
  _: 2
4453
4504
  }, 1032, ["model-value", "onUpdate:modelValue", "name", "label", "label-on-left", "color", "disabled", "readonly", "class"]);
@@ -4505,7 +4556,7 @@ const _sfc_main$m = {
4505
4556
  }
4506
4557
  };
4507
4558
  var wRadios = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", render$m]]);
4508
- const _hoisted_1$b = ["id", "name", "value"];
4559
+ const _hoisted_1$c = ["id", "name", "value"];
4509
4560
  const _hoisted_2$7 = ["disabled", "onMouseenter", "onClick", "tabindex"];
4510
4561
  function render$l(_ctx, _cache, $props, $setup, $data, $options) {
4511
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 }, {
@@ -4522,7 +4573,7 @@ function render$l(_ctx, _cache, $props, $setup, $data, $options) {
4522
4573
  name: _ctx.inputName,
4523
4574
  type: "hidden",
4524
4575
  value: $data.rating
4525
- }, null, 8, _hoisted_1$b),
4576
+ }, null, 8, _hoisted_1$c),
4526
4577
  (openBlock(true), createElementBlock(Fragment, null, renderList($props.max, (i) => {
4527
4578
  return openBlock(), createElementBlock(Fragment, { key: i }, [
4528
4579
  _ctx.$slots.item ? renderSlot(_ctx.$slots, "item", {
@@ -4661,7 +4712,7 @@ const _sfc_main$l = {
4661
4712
  }
4662
4713
  };
4663
4714
  var wRating = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", render$l]]);
4664
- const _hoisted_1$a = ["for"];
4715
+ const _hoisted_1$b = ["for"];
4665
4716
  const _hoisted_2$6 = ["for", "innerHTML"];
4666
4717
  const _hoisted_3$6 = ["aria-expanded", "aria-owns", "aria-activedescendant"];
4667
4718
  const _hoisted_4$5 = {
@@ -4693,7 +4744,7 @@ function render$k(_ctx, _cache, $props, $setup, $data, $options) {
4693
4744
  for: `w-select--${_ctx._.uid}`
4694
4745
  }, [
4695
4746
  renderSlot(_ctx.$slots, "default")
4696
- ], 8, _hoisted_1$a)) : $props.label ? (openBlock(), createElementBlock("label", {
4747
+ ], 8, _hoisted_1$b)) : $props.label ? (openBlock(), createElementBlock("label", {
4697
4748
  key: 1,
4698
4749
  class: "w-select__label w-select__label--left w-form-el-shakable",
4699
4750
  for: `w-select--${_ctx._.uid}`,
@@ -4705,7 +4756,7 @@ function render$k(_ctx, _cache, $props, $setup, $data, $options) {
4705
4756
  "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => _ctx.showMenu = $event),
4706
4757
  "menu-class": `w-select__menu ${$props.menuClass || ""}`,
4707
4758
  transition: "slide-fade-down",
4708
- "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",
4709
4760
  "align-left": "",
4710
4761
  custom: "",
4711
4762
  "min-width": "activator"
@@ -4834,7 +4885,7 @@ function render$k(_ctx, _cache, $props, $setup, $data, $options) {
4834
4885
  ]), 1032, ["model-value", "onUpdate:modelValue", "onItemSelect", "onKeydown:escape", "items", "multiple", "add-ids", "no-unselect", "selection-color", "item-color-key"])
4835
4886
  ]),
4836
4887
  _: 3
4837
- }, 16, ["modelValue", "menu-class", "detach-to"]),
4888
+ }, 16, ["modelValue", "menu-class", "append-to"]),
4838
4889
  $props.labelPosition === "right" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
4839
4890
  _ctx.$slots.default ? (openBlock(), createElementBlock("label", {
4840
4891
  key: 0,
@@ -5030,7 +5081,7 @@ const _sfc_main$k = {
5030
5081
  }
5031
5082
  };
5032
5083
  var wSelect = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", render$k]]);
5033
- const _hoisted_1$9 = ["for"];
5084
+ const _hoisted_1$a = ["for"];
5034
5085
  const _hoisted_2$5 = ["for", "innerHTML"];
5035
5086
  const _hoisted_3$5 = { class: "w-slider__track-wrap" };
5036
5087
  const _hoisted_4$4 = ["aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-readonly"];
@@ -5062,7 +5113,7 @@ function render$j(_ctx, _cache, $props, $setup, $data, $options) {
5062
5113
  for: `button--${_ctx._.uid}`
5063
5114
  }, [
5064
5115
  renderSlot(_ctx.$slots, "label-left")
5065
- ], 8, _hoisted_1$9)) : $props.labelLeft ? (openBlock(), createElementBlock("label", {
5116
+ ], 8, _hoisted_1$a)) : $props.labelLeft ? (openBlock(), createElementBlock("label", {
5066
5117
  key: 1,
5067
5118
  class: "w-slider__label w-slider__label--left w-form-el-shakable",
5068
5119
  for: `button--${_ctx._.uid}`,
@@ -5317,14 +5368,14 @@ const _sfc_main$j = {
5317
5368
  }
5318
5369
  };
5319
5370
  var wSlider = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", render$j]]);
5320
- const _hoisted_1$8 = { key: 0 };
5371
+ const _hoisted_1$9 = { key: 0 };
5321
5372
  function render$i(_ctx, _cache, $props, $setup, $data, $options) {
5322
5373
  return $props.value || $props.value === void 0 ? (openBlock(), createElementBlock("div", {
5323
5374
  key: 0,
5324
5375
  class: normalizeClass(["w-spinner", $options.classes]),
5325
5376
  style: normalizeStyle($options.styles)
5326
5377
  }, [
5327
- $options.isThreeDots ? (openBlock(), createElementBlock("span", _hoisted_1$8)) : createCommentVNode("", true)
5378
+ $options.isThreeDots ? (openBlock(), createElementBlock("span", _hoisted_1$9)) : createCommentVNode("", true)
5328
5379
  ], 6)) : createCommentVNode("", true);
5329
5380
  }
5330
5381
  var wSpinner_vue_vue_type_style_index_0_lang = "";
@@ -5368,9 +5419,9 @@ const _sfc_main$i = {
5368
5419
  }
5369
5420
  };
5370
5421
  var wSpinner = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", render$i]]);
5371
- const _hoisted_1$7 = { class: "w-steps" };
5422
+ const _hoisted_1$8 = { class: "w-steps" };
5372
5423
  function render$h(_ctx, _cache, $props, $setup, $data, $options) {
5373
- return openBlock(), createElementBlock("div", _hoisted_1$7);
5424
+ return openBlock(), createElementBlock("div", _hoisted_1$8);
5374
5425
  }
5375
5426
  var wSteps_vue_vue_type_style_index_0_lang = "";
5376
5427
  const _sfc_main$h = {
@@ -5380,7 +5431,7 @@ const _sfc_main$h = {
5380
5431
  data: () => ({})
5381
5432
  };
5382
5433
  var wSteps = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", render$h]]);
5383
- 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"];
5384
5435
  const _hoisted_2$4 = ["for"];
5385
5436
  const _hoisted_3$4 = ["for", "innerHTML"];
5386
5437
  const _hoisted_4$3 = ["for"];
@@ -5411,7 +5462,7 @@ function render$g(_ctx, _cache, $props, $setup, $data, $options) {
5411
5462
  onFocus: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("focus", $event)),
5412
5463
  "aria-checked": $data.isOn || "false",
5413
5464
  role: "switch"
5414
- }, null, 40, _hoisted_1$6),
5465
+ }, null, 40, _hoisted_1$7),
5415
5466
  $options.hasLabel && $props.labelOnLeft ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
5416
5467
  _ctx.$slots.default ? (openBlock(), createElementBlock("label", {
5417
5468
  key: 0,
@@ -5523,15 +5574,15 @@ const _sfc_main$g = {
5523
5574
  }
5524
5575
  };
5525
5576
  var wSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", render$g]]);
5526
- const _hoisted_1$5 = { class: "w-tabs__content" };
5577
+ const _hoisted_1$6 = { class: "w-tabs__content" };
5527
5578
  function render$f(_ctx, _cache, $props, $setup, $data, $options) {
5528
- return openBlock(), createElementBlock("div", _hoisted_1$5, [
5579
+ return openBlock(), createElementBlock("div", _hoisted_1$6, [
5529
5580
  renderSlot(_ctx.$slots, "default")
5530
5581
  ]);
5531
5582
  }
5532
5583
  const _sfc_main$f = {};
5533
5584
  var TabContent = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", render$f]]);
5534
- const _hoisted_1$4 = ["onClick", "onFocus", "tabindex", "onKeypress", "aria-selected"];
5585
+ const _hoisted_1$5 = ["onClick", "onFocus", "tabindex", "onKeypress", "aria-selected"];
5535
5586
  const _hoisted_2$3 = ["innerHTML"];
5536
5587
  const _hoisted_3$3 = {
5537
5588
  key: 0,
@@ -5577,7 +5628,7 @@ function render$e(_ctx, _cache, $props, $setup, $data, $options) {
5577
5628
  innerHTML: item[$props.itemTitleKey]
5578
5629
  }, null, 8, _hoisted_2$3)
5579
5630
  ])
5580
- ], 42, _hoisted_1$4);
5631
+ ], 42, _hoisted_1$5);
5581
5632
  }), 128)),
5582
5633
  _ctx.$slots["tabs-bar-extra"] ? (openBlock(), createElementBlock("div", _hoisted_3$3, [
5583
5634
  renderSlot(_ctx.$slots, "tabs-bar-extra")
@@ -5595,7 +5646,7 @@ function render$e(_ctx, _cache, $props, $setup, $data, $options) {
5595
5646
  }, {
5596
5647
  default: withCtx(() => [
5597
5648
  (openBlock(), createBlock(KeepAlive, null, [
5598
- createVNode(_component_tab_content, {
5649
+ (openBlock(), createBlock(_component_tab_content, {
5599
5650
  key: $options.activeTab._index,
5600
5651
  class: normalizeClass($props.contentClass)
5601
5652
  }, {
@@ -5617,7 +5668,7 @@ function render$e(_ctx, _cache, $props, $setup, $data, $options) {
5617
5668
  ])
5618
5669
  ]),
5619
5670
  _: 3
5620
- }, 8, ["class"])
5671
+ }, 8, ["class"]))
5621
5672
  ], 1024))
5622
5673
  ]),
5623
5674
  _: 3
@@ -5725,7 +5776,8 @@ const _sfc_main$e = {
5725
5776
  },
5726
5777
  updateSlider(domLookup = true) {
5727
5778
  if (domLookup) {
5728
- this.activeTabEl = this.$refs["tabs-bar"].querySelector(".w-tabs__bar-item--active");
5779
+ const ref = this.$refs["tabs-bar"];
5780
+ this.activeTabEl = ref && ref.querySelector(".w-tabs__bar-item--active");
5729
5781
  }
5730
5782
  if (!this.fillBar && this.activeTabEl) {
5731
5783
  const { left, width } = this.activeTabEl.getBoundingClientRect();
@@ -5784,38 +5836,40 @@ const _sfc_main$e = {
5784
5836
  }
5785
5837
  };
5786
5838
  var index = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", render$e]]);
5787
- const _hoisted_1$3 = ["width"];
5788
- const _hoisted_2$2 = { key: 0 };
5789
- const _hoisted_3$2 = ["onClick"];
5790
- const _hoisted_4$1 = /* @__PURE__ */ createTextVNode("wi-arrow-down");
5791
- const _hoisted_5$1 = ["innerHTML"];
5792
- const _hoisted_6$1 = /* @__PURE__ */ createTextVNode("wi-arrow-down");
5793
- const _hoisted_7$1 = {
5839
+ const _hoisted_1$4 = { ref: "colgroup" };
5840
+ const _hoisted_2$2 = ["width"];
5841
+ const _hoisted_3$2 = { key: 0 };
5842
+ const _hoisted_4$1 = ["onClick"];
5843
+ const _hoisted_5$1 = /* @__PURE__ */ createTextVNode("wi-arrow-down");
5844
+ const _hoisted_6$1 = ["innerHTML"];
5845
+ const _hoisted_7$1 = /* @__PURE__ */ createTextVNode("wi-arrow-down");
5846
+ const _hoisted_8 = {
5794
5847
  key: 0,
5795
5848
  class: "w-table__progress-bar"
5796
5849
  };
5797
- const _hoisted_8 = ["colspan"];
5798
- const _hoisted_9 = { class: "w-table__loading-text" };
5799
- const _hoisted_10 = /* @__PURE__ */ createTextVNode("Loading...");
5800
- const _hoisted_11 = {
5850
+ const _hoisted_9 = ["colspan"];
5851
+ const _hoisted_10 = { class: "w-table__loading-text" };
5852
+ const _hoisted_11 = /* @__PURE__ */ createTextVNode("Loading...");
5853
+ const _hoisted_12 = {
5801
5854
  key: 1,
5802
5855
  class: "no-data"
5803
5856
  };
5804
- const _hoisted_12 = ["colspan"];
5805
- const _hoisted_13 = /* @__PURE__ */ createTextVNode("No data to show.");
5806
- const _hoisted_14 = ["onClick"];
5807
- const _hoisted_15 = ["data-label"];
5857
+ const _hoisted_13 = ["colspan"];
5858
+ const _hoisted_14 = /* @__PURE__ */ createTextVNode("No data to show.");
5859
+ const _hoisted_15 = ["onClick"];
5808
5860
  const _hoisted_16 = ["data-label"];
5809
- const _hoisted_17 = ["innerHTML"];
5810
- const _hoisted_18 = {
5861
+ const _hoisted_17 = ["data-label"];
5862
+ const _hoisted_18 = ["innerHTML"];
5863
+ const _hoisted_19 = {
5811
5864
  key: 2,
5812
- class: "w-table__row w-table__row--expanded"
5865
+ class: "w-table__row w-table__row--expansion"
5813
5866
  };
5814
- const _hoisted_19 = ["colspan"];
5815
- const _hoisted_20 = { key: 0 };
5867
+ const _hoisted_20 = ["colspan"];
5868
+ const _hoisted_21 = { key: 0 };
5816
5869
  function render$d(_ctx, _cache, $props, $setup, $data, $options) {
5817
5870
  const _component_w_icon = resolveComponent("w-icon");
5818
5871
  const _component_w_progress = resolveComponent("w-progress");
5872
+ const _component_w_transition_expand = resolveComponent("w-transition-expand");
5819
5873
  return openBlock(), createElementBlock("div", {
5820
5874
  class: normalizeClass(["w-table-wrap", $options.wrapClasses])
5821
5875
  }, [
@@ -5825,16 +5879,16 @@ function render$d(_ctx, _cache, $props, $setup, $data, $options) {
5825
5879
  onMouseover: _cache[2] || (_cache[2] = (...args) => $options.onMouseOver && $options.onMouseOver(...args)),
5826
5880
  onMouseout: _cache[3] || (_cache[3] = (...args) => $options.onMouseOut && $options.onMouseOut(...args))
5827
5881
  }, [
5828
- createElementVNode("colgroup", null, [
5882
+ createElementVNode("colgroup", _hoisted_1$4, [
5829
5883
  (openBlock(true), createElementBlock(Fragment, null, renderList($props.headers, (header, i) => {
5830
5884
  return openBlock(), createElementBlock("col", {
5831
5885
  class: "w-table__col",
5832
5886
  key: i,
5833
5887
  width: header.width || null
5834
- }, null, 8, _hoisted_1$3);
5888
+ }, null, 8, _hoisted_2$2);
5835
5889
  }), 128))
5836
- ]),
5837
- !$props.noHeaders ? (openBlock(), createElementBlock("thead", _hoisted_2$2, [
5890
+ ], 512),
5891
+ !$props.noHeaders ? (openBlock(), createElementBlock("thead", _hoisted_3$2, [
5838
5892
  createElementVNode("tr", null, [
5839
5893
  (openBlock(true), createElementBlock(Fragment, null, renderList($props.headers, (header, i) => {
5840
5894
  return openBlock(), createElementBlock("th", {
@@ -5847,7 +5901,7 @@ function render$d(_ctx, _cache, $props, $setup, $data, $options) {
5847
5901
  class: normalizeClass(["w-table__header-sort", $options.headerSortClasses(header)])
5848
5902
  }, {
5849
5903
  default: withCtx(() => [
5850
- _hoisted_4$1
5904
+ _hoisted_5$1
5851
5905
  ]),
5852
5906
  _: 2
5853
5907
  }, 1032, ["class"])) : createCommentVNode("", true),
@@ -5862,14 +5916,14 @@ function render$d(_ctx, _cache, $props, $setup, $data, $options) {
5862
5916
  ]) : (openBlock(), createElementBlock("span", {
5863
5917
  key: 1,
5864
5918
  innerHTML: header.label || ""
5865
- }, null, 8, _hoisted_5$1))
5919
+ }, null, 8, _hoisted_6$1))
5866
5920
  ], 64)) : createCommentVNode("", true),
5867
5921
  header.sortable !== false && header.align !== "right" ? (openBlock(), createBlock(_component_w_icon, {
5868
5922
  key: 2,
5869
5923
  class: normalizeClass(["w-table__header-sort", $options.headerSortClasses(header)])
5870
5924
  }, {
5871
5925
  default: withCtx(() => [
5872
- _hoisted_6$1
5926
+ _hoisted_7$1
5873
5927
  ]),
5874
5928
  _: 2
5875
5929
  }, 1032, ["class"])) : createCommentVNode("", true),
@@ -5879,32 +5933,31 @@ function render$d(_ctx, _cache, $props, $setup, $data, $options) {
5879
5933
  onClick: _cache[0] || (_cache[0] = withModifiers(() => {
5880
5934
  }, ["stop"]))
5881
5935
  }, null, 2)) : createCommentVNode("", true)
5882
- ], 10, _hoisted_3$2);
5936
+ ], 10, _hoisted_4$1);
5883
5937
  }), 128))
5884
5938
  ])
5885
5939
  ])) : createCommentVNode("", true),
5886
5940
  createElementVNode("tbody", null, [
5887
- $props.loading ? (openBlock(), createElementBlock("tr", _hoisted_7$1, [
5941
+ $props.loading ? (openBlock(), createElementBlock("tr", _hoisted_8, [
5888
5942
  createElementVNode("td", {
5889
5943
  colspan: $props.headers.length
5890
5944
  }, [
5891
5945
  createVNode(_component_w_progress, { tile: "" }),
5892
- createElementVNode("div", _hoisted_9, [
5946
+ createElementVNode("div", _hoisted_10, [
5893
5947
  renderSlot(_ctx.$slots, "loading", {}, () => [
5894
- _hoisted_10
5948
+ _hoisted_11
5895
5949
  ])
5896
5950
  ])
5897
- ], 8, _hoisted_8)
5898
- ])) : createCommentVNode("", true),
5899
- !$options.tableItems.length ? (openBlock(), createElementBlock("tr", _hoisted_11, [
5951
+ ], 8, _hoisted_9)
5952
+ ])) : !$options.tableItems.length ? (openBlock(), createElementBlock("tr", _hoisted_12, [
5900
5953
  createElementVNode("td", {
5901
5954
  class: "w-table__cell text-center",
5902
5955
  colspan: $props.headers.length
5903
5956
  }, [
5904
5957
  renderSlot(_ctx.$slots, "no-data", {}, () => [
5905
- _hoisted_13
5958
+ _hoisted_14
5906
5959
  ])
5907
- ], 8, _hoisted_12)
5960
+ ], 8, _hoisted_13)
5908
5961
  ])) : (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList($options.sortedItems, (item, i) => {
5909
5962
  return openBlock(), createElementBlock(Fragment, { key: i }, [
5910
5963
  _ctx.$slots.item ? renderSlot(_ctx.$slots, "item", {
@@ -5912,10 +5965,10 @@ function render$d(_ctx, _cache, $props, $setup, $data, $options) {
5912
5965
  item,
5913
5966
  index: i + 1,
5914
5967
  select: () => $options.doSelectRow(item, i),
5915
- classes: { "w-table__row": true, "w-table__row--selected": $options.selectedRowsByUid[item._uid] !== void 0, "w-table__row--has-expanded": $options.expandedRowsByUid[item._uid] !== void 0 }
5968
+ classes: { "w-table__row": true, "w-table__row--selected": $options.selectedRowsByUid[item._uid] !== void 0, "w-table__row--expanded": $options.expandedRowsByUid[item._uid] !== void 0 }
5916
5969
  }) : (openBlock(), createElementBlock("tr", {
5917
5970
  key: 1,
5918
- class: normalizeClass(["w-table__row", { "w-table__row--selected": $options.selectedRowsByUid[item._uid] !== void 0, "w-table__row--has-expanded": $options.expandedRowsByUid[item._uid] !== void 0 }]),
5971
+ class: normalizeClass(["w-table__row", { "w-table__row--selected": $options.selectedRowsByUid[item._uid] !== void 0, "w-table__row--expanded": $options.expandedRowsByUid[item._uid] !== void 0 }]),
5919
5972
  onClick: ($event) => $options.doSelectRow(item, i)
5920
5973
  }, [
5921
5974
  (openBlock(true), createElementBlock(Fragment, null, renderList($props.headers, (header, j) => {
@@ -5948,38 +6001,43 @@ function render$d(_ctx, _cache, $props, $setup, $data, $options) {
5948
6001
  key: 3,
5949
6002
  class: normalizeClass(["w-table__col-resizer", { "w-table__col-resizer--hover": _ctx.colResizing.hover === j, "w-table__col-resizer--active": _ctx.colResizing.columnIndex === j }])
5950
6003
  }, null, 2)) : createCommentVNode("", true)
5951
- ], 10, _hoisted_15)) : (openBlock(), createElementBlock("td", {
6004
+ ], 10, _hoisted_16)) : (openBlock(), createElementBlock("td", {
5952
6005
  class: normalizeClass(["w-table__cell", `text-${header.align || "left"}`]),
5953
6006
  key: `${j}-b`,
5954
6007
  "data-label": header.label
5955
6008
  }, [
5956
6009
  createElementVNode("div", {
5957
6010
  innerHTML: item[header.key] || ""
5958
- }, null, 8, _hoisted_17),
6011
+ }, null, 8, _hoisted_18),
5959
6012
  j < $props.headers.length - 1 && $props.resizableColumns ? (openBlock(), createElementBlock("span", {
5960
6013
  key: 0,
5961
6014
  class: normalizeClass(["w-table__col-resizer", { "w-table__col-resizer--hover": _ctx.colResizing.hover === j, "w-table__col-resizer--active": _ctx.colResizing.columnIndex === j }])
5962
6015
  }, null, 2)) : createCommentVNode("", true)
5963
- ], 10, _hoisted_16))
6016
+ ], 10, _hoisted_17))
5964
6017
  ], 64);
5965
6018
  }), 256))
5966
- ], 10, _hoisted_14)),
5967
- $options.expandedRowsByUid[item._uid] ? (openBlock(), createElementBlock("tr", _hoisted_18, [
6019
+ ], 10, _hoisted_15)),
6020
+ $options.expandedRowsByUid[item._uid] ? (openBlock(), createElementBlock("tr", _hoisted_19, [
5968
6021
  createElementVNode("td", {
5969
6022
  class: "w-table__cell",
5970
6023
  colspan: $props.headers.length
5971
6024
  }, [
5972
- $options.expandedRowsByUid[item._uid] ? (openBlock(), createElementBlock("div", _hoisted_20, [
5973
- renderSlot(_ctx.$slots, "expanded-row", {
5974
- item,
5975
- index: i + 1
5976
- })
5977
- ])) : createCommentVNode("", true),
5978
- _ctx.j < $props.headers.length - 1 && $props.resizableColumns ? (openBlock(), createElementBlock("span", {
5979
- key: 1,
5980
- class: normalizeClass(["w-table__col-resizer", { "w-table__col-resizer--hover": _ctx.colResizing.hover === _ctx.j, "w-table__col-resizer--active": _ctx.colResizing.columnIndex === _ctx.j }])
5981
- }, null, 2)) : createCommentVNode("", true)
5982
- ], 8, _hoisted_19)
6025
+ createVNode(_component_w_transition_expand, { y: "" }, {
6026
+ default: withCtx(() => [
6027
+ $options.expandedRowsByUid[item._uid] ? (openBlock(), createElementBlock("div", _hoisted_21, [
6028
+ renderSlot(_ctx.$slots, "row-expansion", {
6029
+ item,
6030
+ index: i + 1
6031
+ })
6032
+ ])) : createCommentVNode("", true),
6033
+ i < $props.headers.length - 1 && $props.resizableColumns ? (openBlock(), createElementBlock("span", {
6034
+ key: 1,
6035
+ class: normalizeClass(["w-table__col-resizer", { "w-table__col-resizer--hover": _ctx.colResizing.hover === i, "w-table__col-resizer--active": _ctx.colResizing.columnIndex === _ctx.j }])
6036
+ }, null, 2)) : createCommentVNode("", true)
6037
+ ]),
6038
+ _: 2
6039
+ }, 1024)
6040
+ ], 8, _hoisted_20)
5983
6041
  ])) : createCommentVNode("", true)
5984
6042
  ], 64);
5985
6043
  }), 128))
@@ -6022,7 +6080,7 @@ const _sfc_main$d = {
6022
6080
  mobileBreakpoint: { type: Number, default: 0 },
6023
6081
  resizableColumns: { type: Boolean }
6024
6082
  },
6025
- emits: ["row-select", "row-expand", "row-click", "update:sort", "update:selected-rows", "update:expanded-rows"],
6083
+ emits: ["row-select", "row-expand", "row-click", "update:sort", "update:selected-rows", "update:expanded-rows", "column-resize"],
6026
6084
  data: () => ({
6027
6085
  activeSorting: [],
6028
6086
  selectedRowsInternal: [],
@@ -6046,9 +6104,7 @@ const _sfc_main$d = {
6046
6104
  });
6047
6105
  },
6048
6106
  filteredItems() {
6049
- if (typeof this.filter === "function")
6050
- return this.tableItems.filter(this.filter);
6051
- return this.tableItems;
6107
+ return typeof this.filter === "function" ? this.tableItems.filter(this.filter) : this.tableItems;
6052
6108
  },
6053
6109
  sortedItems() {
6054
6110
  if (!this.activeSorting.length)
@@ -6208,6 +6264,11 @@ const _sfc_main$d = {
6208
6264
  document.removeEventListener("mousemove", this.onResizerMouseMove);
6209
6265
  document.removeEventListener("mouseup", this.onResizerMouseUp);
6210
6266
  setTimeout(() => {
6267
+ const widths = [...this.$refs.colgroup.childNodes].map((column) => {
6268
+ var _a;
6269
+ return ((_a = column.style) == null ? void 0 : _a.width) || column.offsetWidth;
6270
+ });
6271
+ this.$emit("column-resize", { index: this.colResizing.columnIndex, widths });
6211
6272
  this.colResizing.dragging = false;
6212
6273
  this.colResizing.columnIndex = null;
6213
6274
  this.colResizing.startCursorX = null;
@@ -6256,7 +6317,7 @@ const _sfc_main$d = {
6256
6317
  }
6257
6318
  };
6258
6319
  var wTable = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", render$d]]);
6259
- const _hoisted_1$2 = ["role", "aria-pressed", "tabindex"];
6320
+ const _hoisted_1$3 = ["role", "aria-pressed", "tabindex"];
6260
6321
  function render$c(_ctx, _cache, $props, $setup, $data, $options) {
6261
6322
  return openBlock(), createElementBlock("span", mergeProps({ class: "w-tag" }, toHandlers(_ctx.$attrs), {
6262
6323
  onClick: _cache[1] || (_cache[1] = ($event) => {
@@ -6284,7 +6345,7 @@ function render$c(_ctx, _cache, $props, $setup, $data, $options) {
6284
6345
  role: "icon",
6285
6346
  "aria-hidden": "true"
6286
6347
  })) : createCommentVNode("", true)
6287
- ], 16, _hoisted_1$2);
6348
+ ], 16, _hoisted_1$3);
6288
6349
  }
6289
6350
  var wTag_vue_vue_type_style_index_0_lang = "";
6290
6351
  const _sfc_main$c = {
@@ -6336,7 +6397,7 @@ const _sfc_main$c = {
6336
6397
  }
6337
6398
  };
6338
6399
  var wTag = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", render$c]]);
6339
- const _hoisted_1$1 = ["for"];
6400
+ const _hoisted_1$2 = ["for"];
6340
6401
  const _hoisted_2$1 = ["for", "innerHTML"];
6341
6402
  const _hoisted_3$1 = ["id", "name", "placeholder", "rows", "cols", "readonly", "aria-readonly", "disabled", "required", "tabindex"];
6342
6403
  const _hoisted_4 = ["for"];
@@ -6363,7 +6424,7 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
6363
6424
  for: `w-textarea--${_ctx._.uid}`
6364
6425
  }, [
6365
6426
  renderSlot(_ctx.$slots, "default")
6366
- ], 8, _hoisted_1$1)) : $props.label ? (openBlock(), createElementBlock("label", {
6427
+ ], 8, _hoisted_1$2)) : $props.label ? (openBlock(), createElementBlock("label", {
6367
6428
  key: 1,
6368
6429
  class: "w-textarea__label w-textarea__label--left w-form-el-shakable",
6369
6430
  for: `w-textarea--${_ctx._.uid}`,
@@ -6490,7 +6551,7 @@ const _sfc_main$b = {
6490
6551
  return listeners;
6491
6552
  },
6492
6553
  hasValue() {
6493
- return this.inputValue;
6554
+ return this.inputValue || this.inputValue === 0;
6494
6555
  },
6495
6556
  hasLabel() {
6496
6557
  return this.label || this.$slots.default;
@@ -6587,11 +6648,11 @@ const _sfc_main$b = {
6587
6648
  }
6588
6649
  };
6589
6650
  var wTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", render$b]]);
6590
- const _hoisted_1 = { class: "w-timeline" };
6651
+ const _hoisted_1$1 = { class: "w-timeline" };
6591
6652
  const _hoisted_2 = ["innerHTML"];
6592
6653
  const _hoisted_3 = ["innerHTML"];
6593
6654
  function render$a(_ctx, _cache, $props, $setup, $data, $options) {
6594
- return openBlock(), createElementBlock("ul", _hoisted_1, [
6655
+ return openBlock(), createElementBlock("ul", _hoisted_1$1, [
6595
6656
  (openBlock(true), createElementBlock(Fragment, null, renderList($props.items, (item, i) => {
6596
6657
  return openBlock(), createElementBlock("li", {
6597
6658
  class: "w-timeline-item",
@@ -6686,41 +6747,32 @@ const _sfc_main$9 = {
6686
6747
  }
6687
6748
  };
6688
6749
  var wToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", render$9]]);
6750
+ const _hoisted_1 = { class: "w-tooltip-wrap" };
6689
6751
  function render$8(_ctx, _cache, $props, $setup, $data, $options) {
6690
- return openBlock(), createElementBlock("div", {
6691
- class: normalizeClass(["w-tooltip-wrap", { "w-tooltip-wrap--attached": !$props.detachTo }]),
6692
- ref: "wrapper"
6693
- }, [
6752
+ return openBlock(), createElementBlock("div", _hoisted_1, [
6694
6753
  renderSlot(_ctx.$slots, "activator", { on: $options.eventHandlers }),
6695
6754
  createVNode(Transition, {
6696
6755
  name: $options.transitionName,
6697
6756
  appear: ""
6698
6757
  }, {
6699
6758
  default: withCtx(() => [
6700
- withDirectives((openBlock(), createElementBlock("div", {
6759
+ _ctx.detachableVisible ? (openBlock(), createElementBlock("div", {
6701
6760
  class: normalizeClass(["w-tooltip", $options.classes]),
6702
- ref: (el) => _ctx.tooltipEl = el,
6761
+ ref: "detachable",
6703
6762
  key: _ctx._.uid,
6704
6763
  style: normalizeStyle($options.styles)
6705
6764
  }, [
6706
- $props.bgColor ? (openBlock(), createElementBlock("div", {
6707
- key: 0,
6708
- class: normalizeClass($props.color)
6709
- }, [
6710
- renderSlot(_ctx.$slots, "default")
6711
- ], 2)) : renderSlot(_ctx.$slots, "default", { key: 1 })
6712
- ], 6)), [
6713
- [vShow, _ctx.showTooltip]
6714
- ])
6765
+ renderSlot(_ctx.$slots, "default")
6766
+ ], 6)) : createCommentVNode("", true)
6715
6767
  ]),
6716
6768
  _: 3
6717
6769
  }, 8, ["name"])
6718
- ], 2);
6770
+ ]);
6719
6771
  }
6720
6772
  var wTooltip_vue_vue_type_style_index_0_lang = "";
6721
- const marginFromWindowSide = 4;
6722
6773
  const _sfc_main$8 = {
6723
6774
  name: "w-tooltip",
6775
+ mixins: [DetachableMixin],
6724
6776
  props: {
6725
6777
  modelValue: {},
6726
6778
  showOnClick: { type: Boolean },
@@ -6732,25 +6784,31 @@ const _sfc_main$8 = {
6732
6784
  round: { type: Boolean },
6733
6785
  transition: { type: String },
6734
6786
  tooltipClass: { type: [String, Object, Array] },
6735
- detachTo: {},
6787
+ detachTo: { type: [String, Boolean, Object], deprecated: true },
6788
+ appendTo: { type: [String, Boolean, Object] },
6736
6789
  fixed: { type: Boolean },
6737
6790
  top: { type: Boolean },
6738
6791
  bottom: { type: Boolean },
6739
6792
  left: { type: Boolean },
6740
6793
  right: { type: Boolean },
6741
- 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 }
6742
6801
  },
6743
6802
  emits: ["input", "update:modelValue", "open", "close"],
6744
6803
  data: () => ({
6745
- showTooltip: false,
6746
- coordinates: {
6804
+ detachableVisible: false,
6805
+ hoveringActivator: false,
6806
+ detachableCoords: {
6747
6807
  top: 0,
6748
- left: 0,
6749
- width: 0,
6750
- height: 0
6808
+ left: 0
6751
6809
  },
6752
6810
  activatorEl: null,
6753
- tooltipEl: null,
6811
+ detachableEl: null,
6754
6812
  timeoutId: null
6755
6813
  }),
6756
6814
  computed: {
@@ -6761,68 +6819,23 @@ const _sfc_main$8 = {
6761
6819
  const direction = this.position.replace(/top|bottom/, (m) => ({ top: "up", bottom: "down" })[m]);
6762
6820
  return this.transition || `w-tooltip-slide-fade-${direction}`;
6763
6821
  },
6764
- detachToTarget() {
6765
- let target = this.detachTo || ".w-app";
6766
- if (target === true)
6767
- target = ".w-app";
6768
- else if (target && !["object", "string"].includes(typeof target))
6769
- target = ".w-app";
6770
- else if (typeof target === "object" && !target.nodeType) {
6771
- target = ".w-app";
6772
- consoleWarn("Invalid node provided in w-tooltip `attach-to`. Falling back to .w-app.");
6773
- }
6774
- if (typeof target === "string")
6775
- target = document.querySelector(target);
6776
- if (!target) {
6777
- consoleWarn(`Unable to locate ${this.detachTo ? `target ${this.detachTo}` : ".w-app"}`);
6778
- target = document.querySelector(".w-app");
6779
- }
6780
- return target;
6781
- },
6782
- tooltipParentEl() {
6783
- return this.detachTo ? this.detachToTarget : this.$refs.wrapper;
6784
- },
6785
6822
  position() {
6786
6823
  return this.top && "top" || this.bottom && "bottom" || this.left && "left" || this.right && "right" || "bottom";
6787
6824
  },
6788
- tooltipCoordinates() {
6789
- const coords = {};
6790
- const { top, left, width, height } = this.coordinates;
6791
- switch (this.position) {
6792
- case "top": {
6793
- coords.top = top;
6794
- coords.left = left + width / 2;
6795
- break;
6796
- }
6797
- case "bottom": {
6798
- coords.top = top + height;
6799
- coords.left = left + width / 2;
6800
- break;
6801
- }
6802
- case "left": {
6803
- coords.top = top + height / 2;
6804
- coords.left = left;
6805
- break;
6806
- }
6807
- case "right": {
6808
- coords.top = top + height / 2;
6809
- coords.left = left + width;
6810
- break;
6811
- }
6812
- }
6813
- 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" || "";
6814
6827
  },
6815
6828
  classes() {
6816
6829
  return __spreadProps(__spreadValues({
6817
- [this.color]: !this.bgColor,
6818
- [`${this.bgColor} ${this.bgColor}--bg`]: this.bgColor
6830
+ [this.color]: this.color,
6831
+ [`${this.bgColor}--bg`]: this.bgColor
6819
6832
  }, this.tooltipClasses), {
6820
- [`w-tooltip--${this.position}`]: true,
6833
+ [`w-tooltip--${this.position}`]: !this.noPosition,
6834
+ [`w-tooltip--align-${this.alignment}`]: !this.noPosition && this.alignment,
6821
6835
  "w-tooltip--tile": this.tile,
6822
6836
  "w-tooltip--round": this.round,
6823
6837
  "w-tooltip--shadow": this.shadow,
6824
6838
  "w-tooltip--fixed": this.fixed,
6825
- "w-tooltip--active": this.showTooltip,
6826
6839
  "w-tooltip--no-border": this.noBorder || this.bgColor,
6827
6840
  "w-tooltip--custom-transition": this.transition
6828
6841
  });
@@ -6830,8 +6843,9 @@ const _sfc_main$8 = {
6830
6843
  styles() {
6831
6844
  return {
6832
6845
  zIndex: this.zIndex || this.zIndex === 0 || null,
6833
- top: `${~~this.tooltipCoordinates.top}px`,
6834
- left: `${~~this.tooltipCoordinates.left}px`
6846
+ top: this.detachableCoords.top && `${~~this.detachableCoords.top}px` || null,
6847
+ left: this.detachableCoords.left && `${~~this.detachableCoords.left}px` || null,
6848
+ "--w-tooltip-bg-color": this.$waveui.colors[this.bgColor || "white"]
6835
6849
  };
6836
6850
  },
6837
6851
  eventHandlers() {
@@ -6842,10 +6856,16 @@ const _sfc_main$8 = {
6842
6856
  handlers = {
6843
6857
  focus: this.toggle,
6844
6858
  blur: this.toggle,
6845
- mouseenter: this.toggle,
6846
- 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
+ }
6847
6867
  };
6848
- if ("ontouchstart" in window)
6868
+ if (typeof window !== "undefined" && "ontouchstart" in window)
6849
6869
  handlers.click = this.toggle;
6850
6870
  }
6851
6871
  return handlers;
@@ -6853,8 +6873,8 @@ const _sfc_main$8 = {
6853
6873
  },
6854
6874
  methods: {
6855
6875
  toggle(e) {
6856
- let shouldShowTooltip = this.showTooltip;
6857
- if ("ontouchstart" in window) {
6876
+ let shouldShowTooltip = this.detachableVisible;
6877
+ if (typeof window !== "undefined" && "ontouchstart" in window) {
6858
6878
  if (e.type === "click")
6859
6879
  shouldShowTooltip = !shouldShowTooltip;
6860
6880
  } else if (e.type === "click" && this.showOnClick)
@@ -6865,88 +6885,69 @@ const _sfc_main$8 = {
6865
6885
  shouldShowTooltip = false;
6866
6886
  this.timeoutId = clearTimeout(this.timeoutId);
6867
6887
  if (shouldShowTooltip) {
6868
- this.coordinates = this.getCoordinates(e);
6869
- this.timeoutId = setTimeout(() => {
6870
- this.showTooltip = true;
6871
- this.$emit("update:modelValue", true);
6872
- this.$emit("input", true);
6873
- this.$emit("open");
6874
- }, 10);
6875
- } else {
6876
- this.showTooltip = false;
6877
- this.$emit("update:modelValue", false);
6878
- this.$emit("input", false);
6879
- this.$emit("close");
6880
- }
6881
- },
6882
- getCoordinates() {
6883
- const { top, left, width, height } = this.activatorEl.getBoundingClientRect();
6884
- let coords = { top, left, width, height };
6885
- if (!this.fixed) {
6886
- const { top: targetTop, left: targetLeft } = this.tooltipParentEl.getBoundingClientRect();
6887
- coords = __spreadProps(__spreadValues({}, coords), { top: top - targetTop, left: left - targetLeft });
6888
- }
6889
- const tooltip = this.tooltipEl;
6890
- tooltip.style.visibility = "hidden";
6891
- tooltip.style.display = "table";
6892
- const computedStyles2 = window.getComputedStyle(tooltip, null);
6893
- if (this.position === "top" && top - tooltip.offsetHeight < 0) {
6894
- const margin = -parseInt(computedStyles2.getPropertyValue("margin-top"));
6895
- coords.top -= top - tooltip.offsetHeight - margin - marginFromWindowSide;
6896
- } else if (this.position === "left" && left - tooltip.offsetWidth < 0) {
6897
- const margin = -parseInt(computedStyles2.getPropertyValue("margin-left"));
6898
- coords.left -= left - tooltip.offsetWidth - margin - marginFromWindowSide;
6899
- } else if (this.position === "right" && left + width + tooltip.offsetWidth > window.innerWidth) {
6900
- const margin = parseInt(computedStyles2.getPropertyValue("margin-left"));
6901
- coords.left -= left + width + tooltip.offsetWidth - window.innerWidth + margin + marginFromWindowSide;
6902
- } else if (this.position === "bottom" && top + height + tooltip.offsetHeight > window.innerHeight) {
6903
- const margin = parseInt(computedStyles2.getPropertyValue("margin-top"));
6904
- coords.top -= top + height + tooltip.offsetHeight - window.innerHeight + margin + marginFromWindowSide;
6905
- }
6906
- if (this.transition) {
6907
- if (["top", "bottom"].includes(this.position))
6908
- coords.left -= tooltip.offsetWidth / 2;
6909
- if (["left", "right"].includes(this.position))
6910
- coords.top -= tooltip.offsetHeight / 2;
6911
- if (this.position === "left")
6912
- coords.left -= tooltip.offsetWidth;
6913
- if (this.position === "top")
6914
- coords.top -= tooltip.offsetHeight;
6915
- }
6916
- tooltip.style.visibility = null;
6917
- tooltip.style.display = "none";
6918
- 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();
6919
6894
  },
6920
- insertTooltip() {
6921
- const wrapper = this.$refs.wrapper;
6922
- wrapper.parentNode.insertBefore(this.activatorEl, wrapper);
6923
- 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);
6924
6911
  },
6925
- removeTooltip() {
6926
- if (this.tooltipEl && this.tooltipEl.parentNode)
6927
- 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);
6928
6925
  }
6929
6926
  },
6930
6927
  mounted() {
6931
- this.activatorEl = this.$refs.wrapper.firstElementChild;
6932
- if (this.detachTo)
6933
- this.insertTooltip();
6928
+ const wrapper = this.$el;
6929
+ this.activatorEl = wrapper.firstElementChild;
6930
+ wrapper.parentNode.insertBefore(this.activatorEl, wrapper);
6934
6931
  if (this.modelValue)
6935
6932
  this.toggle({ type: "click", target: this.activatorEl });
6936
6933
  },
6937
6934
  beforeUnmount() {
6938
- this.removeTooltip();
6935
+ this.removeFromDOM();
6939
6936
  if (this.activatorEl && this.activatorEl.parentNode)
6940
6937
  this.activatorEl.remove();
6941
6938
  },
6942
6939
  watch: {
6943
6940
  modelValue(bool) {
6944
- if (bool !== this.showTooltip)
6941
+ if (bool !== this.detachableVisible)
6945
6942
  this.toggle({ type: "click", target: this.activatorEl });
6946
6943
  },
6947
6944
  detachTo() {
6948
- this.removeTooltip();
6949
- this.insertTooltip();
6945
+ this.removeFromDOM();
6946
+ this.insertInDOM();
6947
+ },
6948
+ appendTo() {
6949
+ this.removeFromDOM();
6950
+ this.insertInDOM();
6950
6951
  }
6951
6952
  }
6952
6953
  };