wave-ui 2.28.0 → 2.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/wave-ui.cjs.js +1 -1
- package/dist/wave-ui.css +1 -1
- package/dist/wave-ui.es.js +567 -516
- package/dist/wave-ui.umd.js +1 -1
- package/package.json +14 -11
- package/src/wave-ui/components/w-accordion.vue +6 -4
- package/src/wave-ui/components/w-alert.vue +0 -1
- package/src/wave-ui/components/w-app.vue +1 -1
- package/src/wave-ui/components/w-confirm.vue +35 -10
- package/src/wave-ui/components/w-flex.vue +2 -0
- package/src/wave-ui/components/w-input.vue +130 -33
- package/src/wave-ui/components/w-menu.vue +76 -270
- package/src/wave-ui/components/w-notification-manager.vue +9 -2
- package/src/wave-ui/components/w-rating.vue +1 -1
- package/src/wave-ui/components/w-select.vue +2 -2
- package/src/wave-ui/components/w-table.vue +2 -2
- package/src/wave-ui/components/w-tabs/index.vue +2 -1
- package/src/wave-ui/components/w-tag.vue +17 -6
- package/src/wave-ui/components/w-textarea.vue +1 -1
- package/src/wave-ui/components/w-tooltip.vue +121 -308
- package/src/wave-ui/mixins/detachable.js +321 -0
- package/src/wave-ui/scss/_mixins.scss +18 -4
- package/src/wave-ui/scss/_variables.scss +1 -1
- package/src/wave-ui/utils/index.js +1 -1
package/dist/wave-ui.es.js
CHANGED
|
@@ -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
|
|
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$
|
|
504
|
-
const _hoisted_2$
|
|
505
|
-
const _hoisted_3$
|
|
506
|
-
const _hoisted_4$
|
|
503
|
+
const _hoisted_1$u = ["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$
|
|
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$
|
|
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$
|
|
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$
|
|
588
|
+
], 10, _hoisted_1$u);
|
|
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
|
-
|
|
596
|
+
target[key] = val;
|
|
596
597
|
}
|
|
597
|
-
return
|
|
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$
|
|
673
|
+
const _hoisted_1$t = { 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$
|
|
691
|
+
createElementVNode("div", _hoisted_1$t, [
|
|
691
692
|
renderSlot(_ctx.$slots, "default")
|
|
692
693
|
]),
|
|
693
694
|
$props.dismiss ? (openBlock(), createBlock(_component_w_button, {
|
|
@@ -784,6 +785,7 @@ const _sfc_main$N = {
|
|
|
784
785
|
}
|
|
785
786
|
};
|
|
786
787
|
var wAlert = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["render", render$N]]);
|
|
788
|
+
const _hoisted_1$s = ["innerHTML"];
|
|
787
789
|
function render$M(_ctx, _cache, $props, $setup, $data, $options) {
|
|
788
790
|
const _component_w_alert = resolveComponent("w-alert");
|
|
789
791
|
return openBlock(), createBlock(TransitionGroup, {
|
|
@@ -802,9 +804,11 @@ function render$M(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
802
804
|
modelValue: notif._value,
|
|
803
805
|
"onUpdate:modelValue": ($event) => notif._value = $event,
|
|
804
806
|
onClose: ($event) => _ctx.notifManager.dismiss(notif._uid)
|
|
805
|
-
}, notif), {
|
|
807
|
+
}, $options.notifProps(notif)), {
|
|
806
808
|
default: withCtx(() => [
|
|
807
|
-
|
|
809
|
+
createElementVNode("div", {
|
|
810
|
+
innerHTML: notif.message
|
|
811
|
+
}, null, 8, _hoisted_1$s)
|
|
808
812
|
]),
|
|
809
813
|
_: 2
|
|
810
814
|
}, 1040, ["modelValue", "onUpdate:modelValue", "onClose"])) : createCommentVNode("", true)
|
|
@@ -832,6 +836,12 @@ const _sfc_main$M = {
|
|
|
832
836
|
return this.conf.transition ? this.conf.transition.replace("default", `slide-${this.conf.align === "left" ? "right" : "left"}`) : "";
|
|
833
837
|
}
|
|
834
838
|
},
|
|
839
|
+
methods: {
|
|
840
|
+
notifProps(notif) {
|
|
841
|
+
const _a = notif, { _value, _uid, message, timeout } = _a, props = __objRest(_a, ["_value", "_uid", "message", "timeout"]);
|
|
842
|
+
return props;
|
|
843
|
+
}
|
|
844
|
+
},
|
|
835
845
|
created() {
|
|
836
846
|
this.notifManager = new NotificationManager$1();
|
|
837
847
|
},
|
|
@@ -991,7 +1001,7 @@ const _sfc_main$L = {
|
|
|
991
1001
|
classes() {
|
|
992
1002
|
return {
|
|
993
1003
|
"d-block": this.block,
|
|
994
|
-
|
|
1004
|
+
row: this.row,
|
|
995
1005
|
"align-center": this.alignCenter,
|
|
996
1006
|
"align-end": this.alignEnd,
|
|
997
1007
|
"justify-center": this.justifyCenter,
|
|
@@ -1134,7 +1144,7 @@ const _sfc_main$K = {
|
|
|
1134
1144
|
}
|
|
1135
1145
|
};
|
|
1136
1146
|
var wBadge = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["render", render$K]]);
|
|
1137
|
-
const _hoisted_1$
|
|
1147
|
+
const _hoisted_1$r = ["innerHTML"];
|
|
1138
1148
|
function render$J(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1139
1149
|
const _component_w_icon = resolveComponent("w-icon");
|
|
1140
1150
|
return openBlock(), createElementBlock("div", {
|
|
@@ -1186,7 +1196,7 @@ function render$J(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1186
1196
|
}) : (openBlock(), createElementBlock("span", {
|
|
1187
1197
|
key: `${i}f`,
|
|
1188
1198
|
innerHTML: item[$props.itemLabelKey]
|
|
1189
|
-
}, null, 8, _hoisted_1$
|
|
1199
|
+
}, null, 8, _hoisted_1$r))
|
|
1190
1200
|
], 64);
|
|
1191
1201
|
}), 256))
|
|
1192
1202
|
], 2);
|
|
@@ -1224,11 +1234,11 @@ const _sfc_main$J = {
|
|
|
1224
1234
|
}
|
|
1225
1235
|
};
|
|
1226
1236
|
var wBreadcrumbs = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["render", render$J]]);
|
|
1227
|
-
const _hoisted_1$
|
|
1237
|
+
const _hoisted_1$q = {
|
|
1228
1238
|
key: 0,
|
|
1229
1239
|
class: "w-button__loader"
|
|
1230
1240
|
};
|
|
1231
|
-
const _hoisted_2$
|
|
1241
|
+
const _hoisted_2$d = /* @__PURE__ */ createElementVNode("svg", { viewBox: "0 0 40 40" }, [
|
|
1232
1242
|
/* @__PURE__ */ createElementVNode("circle", {
|
|
1233
1243
|
cx: "20",
|
|
1234
1244
|
cy: "20",
|
|
@@ -1256,9 +1266,9 @@ function render$I(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1256
1266
|
})) : renderSlot(_ctx.$slots, "default", { key: 1 }),
|
|
1257
1267
|
createVNode(Transition, { name: "scale-fade" }, {
|
|
1258
1268
|
default: withCtx(() => [
|
|
1259
|
-
$props.loading ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
1269
|
+
$props.loading ? (openBlock(), createElementBlock("div", _hoisted_1$q, [
|
|
1260
1270
|
renderSlot(_ctx.$slots, "loading", {}, () => [
|
|
1261
|
-
_hoisted_2$
|
|
1271
|
+
_hoisted_2$d
|
|
1262
1272
|
])
|
|
1263
1273
|
])) : createCommentVNode("", true)
|
|
1264
1274
|
]),
|
|
@@ -1365,11 +1375,11 @@ var wButton = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["render", render$I]]);
|
|
|
1365
1375
|
const objectifyClasses = (classes = {}) => {
|
|
1366
1376
|
if (typeof classes === "string")
|
|
1367
1377
|
classes = { [classes]: true };
|
|
1368
|
-
else if (
|
|
1378
|
+
else if (Array.isArray(classes))
|
|
1369
1379
|
classes = { [classes.join(" ")]: true };
|
|
1370
1380
|
return classes;
|
|
1371
1381
|
};
|
|
1372
|
-
const _hoisted_1$
|
|
1382
|
+
const _hoisted_1$p = ["innerHTML"];
|
|
1373
1383
|
function render$H(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1374
1384
|
const _component_w_image = resolveComponent("w-image");
|
|
1375
1385
|
return openBlock(), createElementBlock("div", {
|
|
@@ -1385,7 +1395,7 @@ function render$H(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1385
1395
|
key: 1,
|
|
1386
1396
|
class: normalizeClass(["w-card__title", $options.titleClasses]),
|
|
1387
1397
|
innerHTML: $props.title
|
|
1388
|
-
}, null, 10, _hoisted_1$
|
|
1398
|
+
}, null, 10, _hoisted_1$p)) : createCommentVNode("", true),
|
|
1389
1399
|
$props.image ? (openBlock(), createBlock(_component_w_image, mergeProps({
|
|
1390
1400
|
key: 2,
|
|
1391
1401
|
class: "w-card__image",
|
|
@@ -1494,10 +1504,10 @@ var FormElementMixin = {
|
|
|
1494
1504
|
}
|
|
1495
1505
|
}
|
|
1496
1506
|
};
|
|
1497
|
-
const _hoisted_1$
|
|
1498
|
-
const _hoisted_2$
|
|
1499
|
-
const _hoisted_3$
|
|
1500
|
-
const _hoisted_4$
|
|
1507
|
+
const _hoisted_1$o = ["id", "name", "checked", "disabled", "required", "tabindex", "aria-checked"];
|
|
1508
|
+
const _hoisted_2$c = ["for"];
|
|
1509
|
+
const _hoisted_3$a = ["for", "innerHTML"];
|
|
1510
|
+
const _hoisted_4$9 = /* @__PURE__ */ createElementVNode("svg", {
|
|
1501
1511
|
width: "11px",
|
|
1502
1512
|
height: "9px",
|
|
1503
1513
|
viewbox: "0 0 12 9"
|
|
@@ -1505,7 +1515,7 @@ const _hoisted_4$a = /* @__PURE__ */ createElementVNode("svg", {
|
|
|
1505
1515
|
/* @__PURE__ */ createElementVNode("polyline", { points: "1 5 4 8 10 2" })
|
|
1506
1516
|
], -1);
|
|
1507
1517
|
const _hoisted_5$8 = [
|
|
1508
|
-
_hoisted_4$
|
|
1518
|
+
_hoisted_4$9
|
|
1509
1519
|
];
|
|
1510
1520
|
const _hoisted_6$5 = ["for"];
|
|
1511
1521
|
const _hoisted_7$5 = ["for", "innerHTML"];
|
|
@@ -1535,7 +1545,7 @@ function render$G(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1535
1545
|
onKeypress: _cache[3] || (_cache[3] = withKeys((...args) => $options.onInput && $options.onInput(...args), ["enter"])),
|
|
1536
1546
|
"aria-checked": $data.isChecked || "false",
|
|
1537
1547
|
role: "checkbox"
|
|
1538
|
-
}, null, 40, _hoisted_1$
|
|
1548
|
+
}, null, 40, _hoisted_1$o),
|
|
1539
1549
|
$options.hasLabel && $props.labelOnLeft ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1540
1550
|
_ctx.$slots.default ? (openBlock(), createElementBlock("label", {
|
|
1541
1551
|
key: 0,
|
|
@@ -1543,12 +1553,12 @@ function render$G(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1543
1553
|
for: `w-checkbox--${_ctx._.uid}`
|
|
1544
1554
|
}, [
|
|
1545
1555
|
renderSlot(_ctx.$slots, "default")
|
|
1546
|
-
], 8, _hoisted_2$
|
|
1556
|
+
], 8, _hoisted_2$c)) : $props.label ? (openBlock(), createElementBlock("label", {
|
|
1547
1557
|
key: 1,
|
|
1548
1558
|
class: "w-checkbox__label w-form-el-shakable pr2",
|
|
1549
1559
|
for: `w-checkbox--${_ctx._.uid}`,
|
|
1550
1560
|
innerHTML: $props.label
|
|
1551
|
-
}, null, 8, _hoisted_3$
|
|
1561
|
+
}, null, 8, _hoisted_3$a)) : createCommentVNode("", true)
|
|
1552
1562
|
], 64)) : createCommentVNode("", true),
|
|
1553
1563
|
createElementVNode("div", {
|
|
1554
1564
|
class: normalizeClass(["w-checkbox__input", this.color]),
|
|
@@ -1645,7 +1655,7 @@ const _sfc_main$G = {
|
|
|
1645
1655
|
}
|
|
1646
1656
|
};
|
|
1647
1657
|
var wCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["render", render$G]]);
|
|
1648
|
-
const _hoisted_1$
|
|
1658
|
+
const _hoisted_1$n = ["innerHTML"];
|
|
1649
1659
|
function render$F(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1650
1660
|
const _component_w_checkbox = resolveComponent("w-checkbox");
|
|
1651
1661
|
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 +1698,7 @@ function render$F(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1688
1698
|
}) : item.label ? (openBlock(), createElementBlock("div", {
|
|
1689
1699
|
key: 2,
|
|
1690
1700
|
innerHTML: item.label
|
|
1691
|
-
}, null, 8, _hoisted_1$
|
|
1701
|
+
}, null, 8, _hoisted_1$n)) : createCommentVNode("", true)
|
|
1692
1702
|
]),
|
|
1693
1703
|
_: 2
|
|
1694
1704
|
}, 1032, ["model-value", "name", "label", "label-on-left", "color", "round", "onUpdate:modelValue", "disabled", "readonly", "class"]);
|
|
@@ -1754,21 +1764,18 @@ const _sfc_main$F = {
|
|
|
1754
1764
|
}
|
|
1755
1765
|
};
|
|
1756
1766
|
var wCheckboxes = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["render", render$F]]);
|
|
1757
|
-
const _hoisted_1$
|
|
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");
|
|
1767
|
+
const _hoisted_1$m = { class: "w-confirm" };
|
|
1761
1768
|
function render$E(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1762
1769
|
const _component_w_button = resolveComponent("w-button");
|
|
1763
1770
|
const _component_w_flex = resolveComponent("w-flex");
|
|
1764
1771
|
const _component_w_menu = resolveComponent("w-menu");
|
|
1765
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1772
|
+
return openBlock(), createElementBlock("div", _hoisted_1$m, [
|
|
1766
1773
|
createVNode(_component_w_menu, mergeProps({
|
|
1767
1774
|
modelValue: _ctx.showPopup,
|
|
1768
1775
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.showPopup = $event)
|
|
1769
1776
|
}, $options.wMenuProps), {
|
|
1770
1777
|
activator: withCtx(({ on }) => [
|
|
1771
|
-
createVNode(_component_w_button, mergeProps({ class: "w-confirm__button" },
|
|
1778
|
+
createVNode(_component_w_button, mergeProps({ class: "w-confirm__button" }, __spreadValues(__spreadValues(__spreadValues({}, _ctx.$attrs), $options.buttonProps), on)), {
|
|
1772
1779
|
default: withCtx(() => [
|
|
1773
1780
|
renderSlot(_ctx.$slots, "default")
|
|
1774
1781
|
]),
|
|
@@ -1783,33 +1790,33 @@ function render$E(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1783
1790
|
default: withCtx(() => [
|
|
1784
1791
|
createElementVNode("div", null, [
|
|
1785
1792
|
renderSlot(_ctx.$slots, "question", {}, () => [
|
|
1786
|
-
|
|
1793
|
+
createTextVNode(toDisplayString($props.question), 1)
|
|
1787
1794
|
])
|
|
1788
1795
|
]),
|
|
1789
1796
|
createElementVNode("div", {
|
|
1790
1797
|
class: normalizeClass(["w-flex justify-end", $props.inline ? "ml2" : "mt2"])
|
|
1791
1798
|
}, [
|
|
1792
|
-
|
|
1799
|
+
$props.cancel !== false ? (openBlock(), createBlock(_component_w_button, mergeProps({
|
|
1793
1800
|
key: 0,
|
|
1794
1801
|
class: "mr2"
|
|
1795
|
-
}, $
|
|
1796
|
-
"bg-color": ($
|
|
1802
|
+
}, $options.cancelButtonProps, {
|
|
1803
|
+
"bg-color": ($options.cancelButton || {}).bgColor || "error",
|
|
1797
1804
|
onClick: $options.onCancel
|
|
1798
1805
|
}), {
|
|
1799
1806
|
default: withCtx(() => [
|
|
1800
1807
|
renderSlot(_ctx.$slots, "cancel", {}, () => [
|
|
1801
|
-
|
|
1808
|
+
createTextVNode(toDisplayString($options.cancelButton.label), 1)
|
|
1802
1809
|
])
|
|
1803
1810
|
]),
|
|
1804
1811
|
_: 3
|
|
1805
1812
|
}, 16, ["bg-color", "onClick"])) : createCommentVNode("", true),
|
|
1806
|
-
createVNode(_component_w_button, mergeProps($
|
|
1807
|
-
"bg-color": ($
|
|
1813
|
+
createVNode(_component_w_button, mergeProps($options.confirmButtonProps, {
|
|
1814
|
+
"bg-color": ($options.confirmButton || {}).bgColor || "success",
|
|
1808
1815
|
onClick: $options.onConfirm
|
|
1809
1816
|
}), {
|
|
1810
1817
|
default: withCtx(() => [
|
|
1811
1818
|
renderSlot(_ctx.$slots, "confirm", {}, () => [
|
|
1812
|
-
|
|
1819
|
+
createTextVNode(toDisplayString($options.confirmButton.label), 1)
|
|
1813
1820
|
])
|
|
1814
1821
|
]),
|
|
1815
1822
|
_: 3
|
|
@@ -1830,9 +1837,9 @@ const _sfc_main$E = {
|
|
|
1830
1837
|
color: { type: String },
|
|
1831
1838
|
icon: { type: String },
|
|
1832
1839
|
mainButton: { type: Object },
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1840
|
+
question: { type: String, default: "Are you sure?" },
|
|
1841
|
+
cancel: { type: [Boolean, Object, String], default: void 0 },
|
|
1842
|
+
confirm: { type: [Object, String] },
|
|
1836
1843
|
inline: { type: Boolean },
|
|
1837
1844
|
menu: { type: Object },
|
|
1838
1845
|
noArrow: { type: Boolean },
|
|
@@ -1853,6 +1860,26 @@ const _sfc_main$E = {
|
|
|
1853
1860
|
props: []
|
|
1854
1861
|
}),
|
|
1855
1862
|
computed: {
|
|
1863
|
+
cancelButton() {
|
|
1864
|
+
let button = { label: typeof this.cancel === "string" ? this.cancel : "Cancel" };
|
|
1865
|
+
if (typeof this.cancel === "object")
|
|
1866
|
+
button = Object.assign({}, button, this.cancel);
|
|
1867
|
+
return button;
|
|
1868
|
+
},
|
|
1869
|
+
cancelButtonProps() {
|
|
1870
|
+
const _a = this.cancelButton, { label } = _a, props = __objRest(_a, ["label"]);
|
|
1871
|
+
return props;
|
|
1872
|
+
},
|
|
1873
|
+
confirmButton() {
|
|
1874
|
+
let button = { label: typeof this.confirm === "string" ? this.confirm : "Confirm" };
|
|
1875
|
+
if (typeof this.confirm === "object")
|
|
1876
|
+
button = Object.assign({}, button, this.confirm);
|
|
1877
|
+
return button;
|
|
1878
|
+
},
|
|
1879
|
+
confirmButtonProps() {
|
|
1880
|
+
const _a = this.confirmButton, { label } = _a, props = __objRest(_a, ["label"]);
|
|
1881
|
+
return props;
|
|
1882
|
+
},
|
|
1856
1883
|
wMenuProps() {
|
|
1857
1884
|
return __spreadValues({
|
|
1858
1885
|
top: this.top,
|
|
@@ -2061,7 +2088,7 @@ const _sfc_main$B = {
|
|
|
2061
2088
|
}
|
|
2062
2089
|
};
|
|
2063
2090
|
var wDivider = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", render$B]]);
|
|
2064
|
-
const _hoisted_1$
|
|
2091
|
+
const _hoisted_1$l = { class: "w-drawer-wrap__pushable" };
|
|
2065
2092
|
function render$A(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2066
2093
|
const _component_w_overlay = resolveComponent("w-overlay");
|
|
2067
2094
|
return $data.showWrapper || $props.pushContent ? (openBlock(), createElementBlock("div", {
|
|
@@ -2073,7 +2100,7 @@ function render$A(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2073
2100
|
class: "w-drawer-wrap__track",
|
|
2074
2101
|
style: normalizeStyle($options.trackStyles)
|
|
2075
2102
|
}, [
|
|
2076
|
-
createElementVNode("div", _hoisted_1$
|
|
2103
|
+
createElementVNode("div", _hoisted_1$l, [
|
|
2077
2104
|
!$props.noOverlay ? (openBlock(), createBlock(_component_w_overlay, {
|
|
2078
2105
|
key: 0,
|
|
2079
2106
|
modelValue: $data.showDrawer,
|
|
@@ -2283,6 +2310,7 @@ const _sfc_main$z = {
|
|
|
2283
2310
|
justifyEnd: { type: Boolean },
|
|
2284
2311
|
justifySpaceBetween: { type: Boolean },
|
|
2285
2312
|
justifySpaceAround: { type: Boolean },
|
|
2313
|
+
justifySpaceEvenly: { type: Boolean },
|
|
2286
2314
|
basisZero: { type: Boolean },
|
|
2287
2315
|
gap: { type: Number, default: 0 }
|
|
2288
2316
|
},
|
|
@@ -2304,6 +2332,7 @@ const _sfc_main$z = {
|
|
|
2304
2332
|
"justify-end": this.justifyEnd,
|
|
2305
2333
|
"justify-space-between": this.justifySpaceBetween,
|
|
2306
2334
|
"justify-space-around": this.justifySpaceAround,
|
|
2335
|
+
"justify-space-evenly": this.justifySpaceEvenly,
|
|
2307
2336
|
"basis-zero": this.basisZero,
|
|
2308
2337
|
[`w-flex--gap${this.gap}`]: this.gap
|
|
2309
2338
|
};
|
|
@@ -2451,7 +2480,7 @@ const _sfc_main$y = {
|
|
|
2451
2480
|
}
|
|
2452
2481
|
};
|
|
2453
2482
|
var wForm = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", render$y]]);
|
|
2454
|
-
const _hoisted_1$
|
|
2483
|
+
const _hoisted_1$k = {
|
|
2455
2484
|
key: 0,
|
|
2456
2485
|
class: "w-form-el__error error w-form-el__error w-form-el__error"
|
|
2457
2486
|
};
|
|
@@ -2469,7 +2498,7 @@ function render$x(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2469
2498
|
createVNode(_component_w_transition_expand, { y: "" }, {
|
|
2470
2499
|
default: withCtx(() => [
|
|
2471
2500
|
_ctx.Validation.message ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2472
|
-
_ctx.$slots["error-message"] ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2501
|
+
_ctx.$slots["error-message"] ? (openBlock(), createElementBlock("div", _hoisted_1$k, [
|
|
2473
2502
|
renderSlot(_ctx.$slots, "error-message", {
|
|
2474
2503
|
message: _ctx.Validation.message
|
|
2475
2504
|
})
|
|
@@ -2649,7 +2678,7 @@ const _sfc_main$w = {
|
|
|
2649
2678
|
}
|
|
2650
2679
|
};
|
|
2651
2680
|
var wIcon = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", render$w]]);
|
|
2652
|
-
const _hoisted_1$
|
|
2681
|
+
const _hoisted_1$j = {
|
|
2653
2682
|
key: 0,
|
|
2654
2683
|
class: "w-image__loader"
|
|
2655
2684
|
};
|
|
@@ -2674,7 +2703,7 @@ function render$v(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2674
2703
|
]),
|
|
2675
2704
|
_: 1
|
|
2676
2705
|
}, 8, ["name"]),
|
|
2677
|
-
!$props.noSpinner && $data.loading ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2706
|
+
!$props.noSpinner && $data.loading ? (openBlock(), createElementBlock("div", _hoisted_1$j, [
|
|
2678
2707
|
_ctx.$slots.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(_component_w_progress, {
|
|
2679
2708
|
key: 1,
|
|
2680
2709
|
circle: "",
|
|
@@ -2819,11 +2848,11 @@ const _sfc_main$v = {
|
|
|
2819
2848
|
}
|
|
2820
2849
|
};
|
|
2821
2850
|
var wImage = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", render$v]]);
|
|
2822
|
-
const _hoisted_1$
|
|
2851
|
+
const _hoisted_1$i = ["name"];
|
|
2823
2852
|
const _hoisted_2$a = ["for"];
|
|
2824
2853
|
const _hoisted_3$9 = ["for", "innerHTML"];
|
|
2825
2854
|
const _hoisted_4$8 = ["id", "type", "name", "placeholder", "step", "min", "max", "minlength", "maxlength", "readonly", "aria-readonly", "disabled", "required", "tabindex"];
|
|
2826
|
-
const _hoisted_5$7 = ["id", "name", "multiple"];
|
|
2855
|
+
const _hoisted_5$7 = ["id", "name", "multiple", "data-progress"];
|
|
2827
2856
|
const _hoisted_6$4 = {
|
|
2828
2857
|
class: "w-input__no-file",
|
|
2829
2858
|
key: "no-file"
|
|
@@ -2854,22 +2883,22 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2854
2883
|
type: "hidden",
|
|
2855
2884
|
name: _ctx.name || null,
|
|
2856
2885
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.inputValue = $event)
|
|
2857
|
-
}, null, 8, _hoisted_1$
|
|
2886
|
+
}, null, 8, _hoisted_1$i)), [
|
|
2858
2887
|
[vModelText, $data.inputValue]
|
|
2859
2888
|
]) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2860
2889
|
$props.labelPosition === "left" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2861
2890
|
_ctx.$slots.default ? (openBlock(), createElementBlock("label", {
|
|
2862
2891
|
key: 0,
|
|
2863
|
-
class: "w-input__label w-input__label--left w-form-el-shakable",
|
|
2892
|
+
class: normalizeClass(["w-input__label w-input__label--left w-form-el-shakable", $options.validationClasses]),
|
|
2864
2893
|
for: `w-input--${_ctx._.uid}`
|
|
2865
2894
|
}, [
|
|
2866
2895
|
renderSlot(_ctx.$slots, "default")
|
|
2867
|
-
],
|
|
2896
|
+
], 10, _hoisted_2$a)) : $props.label ? (openBlock(), createElementBlock("label", {
|
|
2868
2897
|
key: 1,
|
|
2869
|
-
class: "w-input__label w-input__label--left w-form-el-shakable",
|
|
2898
|
+
class: normalizeClass(["w-input__label w-input__label--left w-form-el-shakable", $options.validationClasses]),
|
|
2870
2899
|
for: `w-input--${_ctx._.uid}`,
|
|
2871
2900
|
innerHTML: $props.label
|
|
2872
|
-
}, null,
|
|
2901
|
+
}, null, 10, _hoisted_3$9)) : createCommentVNode("", true)
|
|
2873
2902
|
], 64)) : createCommentVNode("", true),
|
|
2874
2903
|
createElementVNode("div", {
|
|
2875
2904
|
class: normalizeClass(["w-input__input-wrap", $options.inputWrapClasses])
|
|
@@ -2889,6 +2918,7 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2889
2918
|
$props.type !== "file" ? withDirectives((openBlock(), createElementBlock("input", mergeProps({
|
|
2890
2919
|
key: 1,
|
|
2891
2920
|
class: "w-input__input",
|
|
2921
|
+
ref: "input",
|
|
2892
2922
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.inputValue = $event)
|
|
2893
2923
|
}, toHandlers($options.listeners), {
|
|
2894
2924
|
onInput: _cache[3] || (_cache[3] = (...args) => $options.onInput && $options.onInput(...args)),
|
|
@@ -2910,9 +2940,9 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2910
2940
|
tabindex: _ctx.tabindex || null
|
|
2911
2941
|
}, $options.attrs), null, 16, _hoisted_4$8)), [
|
|
2912
2942
|
[vModelDynamic, $data.inputValue]
|
|
2913
|
-
]) :
|
|
2914
|
-
$props.type === "file" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
2943
|
+
]) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
2915
2944
|
createElementVNode("input", mergeProps({
|
|
2945
|
+
ref: "input",
|
|
2916
2946
|
id: `w-input--${_ctx._.uid}`,
|
|
2917
2947
|
type: "file",
|
|
2918
2948
|
name: _ctx.name || null,
|
|
@@ -2920,7 +2950,9 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2920
2950
|
onBlur: _cache[7] || (_cache[7] = (...args) => $options.onBlur && $options.onBlur(...args)),
|
|
2921
2951
|
onChange: _cache[8] || (_cache[8] = (...args) => $options.onFileChange && $options.onFileChange(...args)),
|
|
2922
2952
|
multiple: $props.multiple || null
|
|
2923
|
-
}, $options.attrs
|
|
2953
|
+
}, $options.attrs, {
|
|
2954
|
+
"data-progress": $options.overallFilesProgress
|
|
2955
|
+
}), null, 16, _hoisted_5$7),
|
|
2924
2956
|
createVNode(TransitionGroup, {
|
|
2925
2957
|
class: "w-input__input w-input__input--file",
|
|
2926
2958
|
tag: "label",
|
|
@@ -2944,23 +2976,23 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2944
2976
|
class: "filename",
|
|
2945
2977
|
key: `${i}b`
|
|
2946
2978
|
}, toDisplayString(file.base), 1)),
|
|
2947
|
-
createTextVNode(toDisplayString(file.extension), 1)
|
|
2979
|
+
createTextVNode(toDisplayString(file.extension ? `.${file.extension}` : ""), 1)
|
|
2948
2980
|
]);
|
|
2949
2981
|
}), 128))
|
|
2950
2982
|
]),
|
|
2951
2983
|
_: 3
|
|
2952
2984
|
}, 8, ["for"])
|
|
2953
|
-
], 64))
|
|
2985
|
+
], 64)),
|
|
2954
2986
|
$props.labelPosition === "inside" && $options.showLabelInside ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
2955
2987
|
_ctx.$slots.default ? (openBlock(), createElementBlock("label", {
|
|
2956
2988
|
key: 0,
|
|
2957
|
-
class: normalizeClass(["w-input__label w-input__label--inside w-form-el-shakable", $
|
|
2989
|
+
class: normalizeClass(["w-input__label w-input__label--inside w-form-el-shakable", $options.validationClasses]),
|
|
2958
2990
|
for: `w-input--${_ctx._.uid}`
|
|
2959
2991
|
}, [
|
|
2960
2992
|
renderSlot(_ctx.$slots, "default")
|
|
2961
2993
|
], 10, _hoisted_8$3)) : $props.label ? (openBlock(), createElementBlock("label", {
|
|
2962
2994
|
key: 1,
|
|
2963
|
-
class: normalizeClass(["w-input__label w-input__label--inside w-form-el-shakable", $
|
|
2995
|
+
class: normalizeClass(["w-input__label w-input__label--inside w-form-el-shakable", $options.validationClasses]),
|
|
2964
2996
|
for: `w-input--${_ctx._.uid}`,
|
|
2965
2997
|
innerHTML: $props.label
|
|
2966
2998
|
}, null, 10, _hoisted_9$3)) : createCommentVNode("", true)
|
|
@@ -2976,9 +3008,16 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2976
3008
|
createTextVNode(toDisplayString($props.innerIconRight), 1)
|
|
2977
3009
|
]),
|
|
2978
3010
|
_: 1
|
|
2979
|
-
}, 8, ["for"])) : createCommentVNode("", true)
|
|
3011
|
+
}, 8, ["for"])) : createCommentVNode("", true),
|
|
3012
|
+
$options.hasLoading || $props.showProgress && ($options.uploadInProgress || $options.uploadComplete) ? (openBlock(), createBlock(_component_w_progress, {
|
|
3013
|
+
key: 5,
|
|
3014
|
+
class: "fill-width",
|
|
3015
|
+
size: "2",
|
|
3016
|
+
color: $props.progressColor || $props.color,
|
|
3017
|
+
"model-value": $props.showProgress ? ($options.uploadInProgress || $options.uploadComplete) && $options.overallFilesProgress : $options.loadingValue
|
|
3018
|
+
}, null, 8, ["color", "model-value"])) : createCommentVNode("", true)
|
|
2980
3019
|
], 2),
|
|
2981
|
-
$props.type === "file" && $data.inputFiles.length ? (openBlock(), createElementBlock("label", {
|
|
3020
|
+
$props.type === "file" && $props.preview && $data.inputFiles.length ? (openBlock(), createElementBlock("label", {
|
|
2982
3021
|
key: 1,
|
|
2983
3022
|
class: "d-flex",
|
|
2984
3023
|
for: `w-input--${_ctx._.uid}`
|
|
@@ -2994,32 +3033,26 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2994
3033
|
src: file.preview,
|
|
2995
3034
|
alt: ""
|
|
2996
3035
|
}, null, 8, _hoisted_11$2)) : (openBlock(), createElementBlock("i", {
|
|
2997
|
-
class: "w-icon
|
|
3036
|
+
class: normalizeClass(["w-icon w-input__file-preview primary size--md", $props.preview && typeof $props.preview === "string" ? $props.preview : "wi-file"]),
|
|
2998
3037
|
key: `${i}c`
|
|
2999
|
-
}))
|
|
3038
|
+
}, null, 2))
|
|
3000
3039
|
], 64);
|
|
3001
3040
|
}), 256))
|
|
3002
3041
|
], 8, _hoisted_10$3)) : createCommentVNode("", true),
|
|
3003
3042
|
$props.labelPosition === "right" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
3004
3043
|
_ctx.$slots.default ? (openBlock(), createElementBlock("label", {
|
|
3005
3044
|
key: 0,
|
|
3006
|
-
class: "w-input__label w-input__label--right w-form-el-shakable",
|
|
3045
|
+
class: normalizeClass(["w-input__label w-input__label--right w-form-el-shakable", $options.validationClasses]),
|
|
3007
3046
|
for: `w-input--${_ctx._.uid}`
|
|
3008
3047
|
}, [
|
|
3009
3048
|
renderSlot(_ctx.$slots, "default")
|
|
3010
|
-
],
|
|
3049
|
+
], 10, _hoisted_12$1)) : $props.label ? (openBlock(), createElementBlock("label", {
|
|
3011
3050
|
key: 1,
|
|
3012
|
-
class: "w-input__label w-input__label--right w-form-el-shakable",
|
|
3051
|
+
class: normalizeClass(["w-input__label w-input__label--right w-form-el-shakable", $options.validationClasses]),
|
|
3013
3052
|
for: `w-input--${_ctx._.uid}`,
|
|
3014
3053
|
innerHTML: $props.label
|
|
3015
|
-
}, null,
|
|
3016
|
-
], 64)) : createCommentVNode("", true)
|
|
3017
|
-
$props.loading ? (openBlock(), createBlock(_component_w_progress, {
|
|
3018
|
-
key: 3,
|
|
3019
|
-
class: "fill-width",
|
|
3020
|
-
size: "2",
|
|
3021
|
-
color: $props.progressColor || $props.color
|
|
3022
|
-
}, null, 8, ["color"])) : createCommentVNode("", true)
|
|
3054
|
+
}, null, 10, _hoisted_13$1)) : createCommentVNode("", true)
|
|
3055
|
+
], 64)) : createCommentVNode("", true)
|
|
3023
3056
|
], 64))
|
|
3024
3057
|
]),
|
|
3025
3058
|
_: 3
|
|
@@ -3052,17 +3085,20 @@ const _sfc_main$u = {
|
|
|
3052
3085
|
shadow: { type: Boolean },
|
|
3053
3086
|
tile: { type: Boolean },
|
|
3054
3087
|
multiple: { type: Boolean },
|
|
3055
|
-
preview: { type: Boolean },
|
|
3056
|
-
loading: { type: Boolean }
|
|
3088
|
+
preview: { type: [Boolean, String], default: true },
|
|
3089
|
+
loading: { type: [Boolean, Number], default: false },
|
|
3090
|
+
showProgress: { type: [Boolean] },
|
|
3091
|
+
files: { type: Array }
|
|
3057
3092
|
},
|
|
3058
|
-
emits: ["input", "update:modelValue", "focus", "blur", "click:inner-icon-left", "click:inner-icon-right"],
|
|
3093
|
+
emits: ["input", "update:modelValue", "focus", "blur", "click:inner-icon-left", "click:inner-icon-right", "update:overallProgress"],
|
|
3059
3094
|
data() {
|
|
3060
3095
|
return {
|
|
3061
3096
|
inputValue: this.modelValue,
|
|
3062
3097
|
inputNumberError: false,
|
|
3063
3098
|
isFocused: false,
|
|
3064
3099
|
inputFiles: [],
|
|
3065
|
-
fileReader: null
|
|
3100
|
+
fileReader: null,
|
|
3101
|
+
isAutofilled: false
|
|
3066
3102
|
};
|
|
3067
3103
|
},
|
|
3068
3104
|
computed: {
|
|
@@ -3079,21 +3115,55 @@ const _sfc_main$u = {
|
|
|
3079
3115
|
return htmlAttrs;
|
|
3080
3116
|
},
|
|
3081
3117
|
hasValue() {
|
|
3082
|
-
|
|
3118
|
+
switch (this.type) {
|
|
3119
|
+
case "file":
|
|
3120
|
+
return !!this.inputFiles.length;
|
|
3121
|
+
case "number":
|
|
3122
|
+
return this.inputNumberError;
|
|
3123
|
+
case "date":
|
|
3124
|
+
case "time":
|
|
3125
|
+
return true;
|
|
3126
|
+
default:
|
|
3127
|
+
return this.inputValue || this.inputValue === 0;
|
|
3128
|
+
}
|
|
3083
3129
|
},
|
|
3084
3130
|
hasLabel() {
|
|
3085
3131
|
return this.label || this.$slots.default;
|
|
3086
3132
|
},
|
|
3133
|
+
hasLoading() {
|
|
3134
|
+
return ![void 0, false].includes(this.loading);
|
|
3135
|
+
},
|
|
3136
|
+
loadingValue() {
|
|
3137
|
+
let value;
|
|
3138
|
+
if (typeof this.loading === "number")
|
|
3139
|
+
value = this.loading;
|
|
3140
|
+
else if (this.loading) {
|
|
3141
|
+
value = this.type === "file" && this.overallFilesProgress ? this.overallFilesProgress : void 0;
|
|
3142
|
+
}
|
|
3143
|
+
return value;
|
|
3144
|
+
},
|
|
3087
3145
|
showLabelInside() {
|
|
3088
3146
|
return !this.staticLabel || !this.hasValue && !this.placeholder;
|
|
3089
3147
|
},
|
|
3148
|
+
overallFilesProgress() {
|
|
3149
|
+
const progress = this.inputFiles.reduce((total2, file) => total2 + file.progress, 0);
|
|
3150
|
+
const total = progress / this.inputFiles.length;
|
|
3151
|
+
this.$emit("update:overallProgress", this.inputFiles.length ? total : void 0);
|
|
3152
|
+
return total;
|
|
3153
|
+
},
|
|
3154
|
+
uploadInProgress() {
|
|
3155
|
+
return this.overallFilesProgress > 0 && this.overallFilesProgress < 100;
|
|
3156
|
+
},
|
|
3157
|
+
uploadComplete() {
|
|
3158
|
+
return this.overallFilesProgress === 100;
|
|
3159
|
+
},
|
|
3090
3160
|
classes() {
|
|
3091
3161
|
return {
|
|
3092
3162
|
"w-input": true,
|
|
3093
3163
|
"w-input--file": this.type === "file",
|
|
3094
3164
|
"w-input--disabled": this.isDisabled,
|
|
3095
3165
|
"w-input--readonly": this.isReadonly,
|
|
3096
|
-
[`w-input--${this.hasValue ? "filled" : "empty"}`]: true,
|
|
3166
|
+
[`w-input--${this.hasValue || this.isAutofilled ? "filled" : "empty"}`]: true,
|
|
3097
3167
|
"w-input--focused": this.isFocused && !this.isReadonly,
|
|
3098
3168
|
"w-input--dark": this.dark,
|
|
3099
3169
|
"w-input--floating-label": this.hasLabel && this.labelPosition === "inside" && !this.staticLabel,
|
|
@@ -3103,6 +3173,11 @@ const _sfc_main$u = {
|
|
|
3103
3173
|
"w-input--inner-icon-right": this.innerIconRight
|
|
3104
3174
|
};
|
|
3105
3175
|
},
|
|
3176
|
+
validationClasses() {
|
|
3177
|
+
return this.isFocused && {
|
|
3178
|
+
[this.valid === false ? "error" : this.color]: this.color || this.valid === false
|
|
3179
|
+
};
|
|
3180
|
+
},
|
|
3106
3181
|
inputWrapClasses() {
|
|
3107
3182
|
return {
|
|
3108
3183
|
[this.valid === false ? "error" : this.color]: this.color || this.valid === false,
|
|
@@ -3114,7 +3189,8 @@ const _sfc_main$u = {
|
|
|
3114
3189
|
"w-input__input-wrap--underline": !this.outline,
|
|
3115
3190
|
"w-input__input-wrap--shadow": this.shadow,
|
|
3116
3191
|
"w-input__input-wrap--no-padding": !this.outline && !this.bgColor && !this.shadow && !this.round,
|
|
3117
|
-
"w-input__input-wrap--loading": this.loading
|
|
3192
|
+
"w-input__input-wrap--loading": this.loading || this.showProgress && this.uploadInProgress,
|
|
3193
|
+
"w-input__input-wrap--upload-complete": this.uploadComplete
|
|
3118
3194
|
};
|
|
3119
3195
|
}
|
|
3120
3196
|
},
|
|
@@ -3134,29 +3210,34 @@ const _sfc_main$u = {
|
|
|
3134
3210
|
},
|
|
3135
3211
|
onFileChange(e) {
|
|
3136
3212
|
this.inputFiles = [...e.target.files].map((original) => {
|
|
3137
|
-
const [, base, extension] = original.name.match(/^(
|
|
3213
|
+
const [, base = "", extension = "", full = ""] = original.name.match(/^(.*?)\.([^.]*)$|(.*)/);
|
|
3138
3214
|
const file = reactive({
|
|
3139
3215
|
name: original.name,
|
|
3140
|
-
base,
|
|
3216
|
+
base: base || full,
|
|
3141
3217
|
extension,
|
|
3142
3218
|
type: original.type,
|
|
3143
3219
|
size: original.size,
|
|
3144
3220
|
lastModified: original.lastModified,
|
|
3145
3221
|
preview: null,
|
|
3146
|
-
progress: 0
|
|
3222
|
+
progress: 0,
|
|
3223
|
+
file: original
|
|
3147
3224
|
});
|
|
3148
|
-
this.
|
|
3225
|
+
this.readFile(original, file);
|
|
3149
3226
|
return file;
|
|
3150
3227
|
});
|
|
3151
3228
|
this.$emit("update:modelValue", this.inputFiles);
|
|
3229
|
+
this.$emit("input", this.inputFiles);
|
|
3152
3230
|
},
|
|
3153
|
-
|
|
3231
|
+
readFile(original, file) {
|
|
3154
3232
|
const reader = new FileReader();
|
|
3155
|
-
|
|
3233
|
+
const isPreviewAnIcon = typeof this.preview === "string";
|
|
3234
|
+
const isFileAnImage = original.type && original.type.startsWith("image/");
|
|
3235
|
+
if (this.preview && !isPreviewAnIcon && isFileAnImage) {
|
|
3156
3236
|
reader.addEventListener("load", (e) => {
|
|
3157
3237
|
file.preview = e.target.result;
|
|
3158
3238
|
});
|
|
3159
|
-
}
|
|
3239
|
+
} else
|
|
3240
|
+
delete file.preview;
|
|
3160
3241
|
reader.addEventListener("progress", (e) => {
|
|
3161
3242
|
if (e.loaded && e.total)
|
|
3162
3243
|
file.progress = e.loaded * 100 / e.total;
|
|
@@ -3164,9 +3245,17 @@ const _sfc_main$u = {
|
|
|
3164
3245
|
reader.readAsDataURL(original);
|
|
3165
3246
|
}
|
|
3166
3247
|
},
|
|
3248
|
+
mounted() {
|
|
3249
|
+
setTimeout(() => {
|
|
3250
|
+
if (this.$refs.input && this.$refs.input.matches(":-webkit-autofill"))
|
|
3251
|
+
this.isAutofilled = true;
|
|
3252
|
+
}, 400);
|
|
3253
|
+
},
|
|
3167
3254
|
watch: {
|
|
3168
3255
|
modelValue(value) {
|
|
3169
3256
|
this.inputValue = value;
|
|
3257
|
+
if (!value && value !== 0)
|
|
3258
|
+
this.isAutofilled = false;
|
|
3170
3259
|
}
|
|
3171
3260
|
}
|
|
3172
3261
|
};
|
|
@@ -3503,34 +3592,248 @@ const _sfc_main$t = {
|
|
|
3503
3592
|
}
|
|
3504
3593
|
};
|
|
3505
3594
|
var wList = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", render$t]]);
|
|
3506
|
-
|
|
3595
|
+
var DetachableMixin = {
|
|
3596
|
+
props: {
|
|
3597
|
+
detachTo: { type: [String, Boolean, Object], deprecated: true },
|
|
3598
|
+
appendTo: { type: [String, Boolean, Object] },
|
|
3599
|
+
fixed: { type: Boolean },
|
|
3600
|
+
top: { type: Boolean },
|
|
3601
|
+
bottom: { type: Boolean },
|
|
3602
|
+
left: { type: Boolean },
|
|
3603
|
+
right: { type: Boolean },
|
|
3604
|
+
alignTop: { type: Boolean },
|
|
3605
|
+
alignBottom: { type: Boolean },
|
|
3606
|
+
alignLeft: { type: Boolean },
|
|
3607
|
+
alignRight: { type: Boolean },
|
|
3608
|
+
noPosition: { type: Boolean },
|
|
3609
|
+
zIndex: { type: [Number, String, Boolean] },
|
|
3610
|
+
activator: { type: String }
|
|
3611
|
+
},
|
|
3612
|
+
data: () => ({
|
|
3613
|
+
docAEventListenersHandlers: []
|
|
3614
|
+
}),
|
|
3615
|
+
computed: {
|
|
3616
|
+
appendToTarget() {
|
|
3617
|
+
const defaultTarget = ".w-app";
|
|
3618
|
+
if (this.detachTo && !this.appendTo) {
|
|
3619
|
+
consoleWarn(`The ${this.$options.name} prop \`detach-to\` is deprecated. You can replace it with \`append-to\`.`);
|
|
3620
|
+
}
|
|
3621
|
+
let target = this.appendTo || this.detachTo || defaultTarget;
|
|
3622
|
+
if (target === true)
|
|
3623
|
+
target = defaultTarget;
|
|
3624
|
+
else if (this.appendTo === "activator")
|
|
3625
|
+
target = this.$el.previousElementSibling;
|
|
3626
|
+
else if (target && !["object", "string"].includes(typeof target))
|
|
3627
|
+
target = defaultTarget;
|
|
3628
|
+
else if (typeof target === "object" && !target.nodeType) {
|
|
3629
|
+
target = defaultTarget;
|
|
3630
|
+
consoleWarn(`Invalid node provided in ${this.$options.name} \`append-to\`. Falling back to .w-app.`);
|
|
3631
|
+
}
|
|
3632
|
+
if (typeof target === "string")
|
|
3633
|
+
target = document.querySelector(target);
|
|
3634
|
+
if (!target) {
|
|
3635
|
+
consoleWarn(`Unable to locate ${this.appendTo ? `target ${this.appendTo}` : defaultTarget}`);
|
|
3636
|
+
target = document.querySelector(defaultTarget);
|
|
3637
|
+
}
|
|
3638
|
+
return target;
|
|
3639
|
+
},
|
|
3640
|
+
detachableParentEl() {
|
|
3641
|
+
return this.appendToTarget;
|
|
3642
|
+
},
|
|
3643
|
+
hasSeparateActivator() {
|
|
3644
|
+
return !this.$slots.activator && typeof this.activator === "string";
|
|
3645
|
+
},
|
|
3646
|
+
activatorEl: {
|
|
3647
|
+
get() {
|
|
3648
|
+
if (this.hasSeparateActivator)
|
|
3649
|
+
return document.querySelector(this.activator);
|
|
3650
|
+
return this.$el.firstElementChild;
|
|
3651
|
+
},
|
|
3652
|
+
set() {
|
|
3653
|
+
}
|
|
3654
|
+
},
|
|
3655
|
+
position() {
|
|
3656
|
+
return this.top && "top" || this.bottom && "bottom" || this.left && "left" || this.right && "right" || "bottom";
|
|
3657
|
+
},
|
|
3658
|
+
alignment() {
|
|
3659
|
+
return ["top", "bottom"].includes(this.position) && this.alignLeft && "left" || ["top", "bottom"].includes(this.position) && this.alignRight && "right" || ["left", "right"].includes(this.position) && this.alignTop && "top" || ["left", "right"].includes(this.position) && this.alignBottom && "bottom" || "";
|
|
3660
|
+
}
|
|
3661
|
+
},
|
|
3662
|
+
methods: {
|
|
3663
|
+
getActivatorCoordinates(e) {
|
|
3664
|
+
const { top, left, width, height } = (e ? e.target : this.activatorEl).getBoundingClientRect();
|
|
3665
|
+
let coords = { top, left, width, height };
|
|
3666
|
+
if (!this.fixed) {
|
|
3667
|
+
const { top: targetTop, left: targetLeft } = this.detachableParentEl.getBoundingClientRect();
|
|
3668
|
+
const computedStyles2 = window.getComputedStyle(this.detachableParentEl, null);
|
|
3669
|
+
coords = __spreadProps(__spreadValues({}, coords), {
|
|
3670
|
+
top: top - targetTop + this.detachableParentEl.scrollTop - parseInt(computedStyles2.getPropertyValue("border-top-width")),
|
|
3671
|
+
left: left - targetLeft + this.detachableParentEl.scrollLeft - parseInt(computedStyles2.getPropertyValue("border-left-width"))
|
|
3672
|
+
});
|
|
3673
|
+
}
|
|
3674
|
+
return coords;
|
|
3675
|
+
},
|
|
3676
|
+
computeDetachableCoords(e) {
|
|
3677
|
+
let { top, left, width, height } = this.getActivatorCoordinates(e);
|
|
3678
|
+
this.detachableEl.style.visibility = "hidden";
|
|
3679
|
+
this.detachableEl.style.display = "flex";
|
|
3680
|
+
const computedStyles2 = window.getComputedStyle(this.detachableEl, null);
|
|
3681
|
+
switch (this.position) {
|
|
3682
|
+
case "top": {
|
|
3683
|
+
top -= this.detachableEl.offsetHeight;
|
|
3684
|
+
if (this.alignRight) {
|
|
3685
|
+
left += width - this.detachableEl.offsetWidth + parseInt(computedStyles2.getPropertyValue("border-right-width"));
|
|
3686
|
+
} else if (!this.alignLeft)
|
|
3687
|
+
left += (width - this.detachableEl.offsetWidth) / 2;
|
|
3688
|
+
break;
|
|
3689
|
+
}
|
|
3690
|
+
case "bottom": {
|
|
3691
|
+
top += height;
|
|
3692
|
+
if (this.alignRight) {
|
|
3693
|
+
left += width - this.detachableEl.offsetWidth + parseInt(computedStyles2.getPropertyValue("border-right-width"));
|
|
3694
|
+
} else if (!this.alignLeft)
|
|
3695
|
+
left += (width - this.detachableEl.offsetWidth) / 2;
|
|
3696
|
+
break;
|
|
3697
|
+
}
|
|
3698
|
+
case "left": {
|
|
3699
|
+
left -= this.detachableEl.offsetWidth;
|
|
3700
|
+
if (this.alignBottom)
|
|
3701
|
+
top += height - this.detachableEl.offsetHeight;
|
|
3702
|
+
else if (!this.alignTop)
|
|
3703
|
+
top += (height - this.detachableEl.offsetHeight) / 2;
|
|
3704
|
+
break;
|
|
3705
|
+
}
|
|
3706
|
+
case "right": {
|
|
3707
|
+
left += width;
|
|
3708
|
+
if (this.alignBottom) {
|
|
3709
|
+
top += height - this.detachableEl.offsetHeight + parseInt(computedStyles2.getPropertyValue("margin-top"));
|
|
3710
|
+
} else if (!this.alignTop) {
|
|
3711
|
+
top += (height - this.detachableEl.offsetHeight) / 2 + parseInt(computedStyles2.getPropertyValue("margin-top"));
|
|
3712
|
+
}
|
|
3713
|
+
break;
|
|
3714
|
+
}
|
|
3715
|
+
}
|
|
3716
|
+
this.detachableEl.style.visibility = null;
|
|
3717
|
+
if (!this.detachableVisible)
|
|
3718
|
+
this.detachableEl.style.display = "none";
|
|
3719
|
+
this.detachableCoords = { top, left };
|
|
3720
|
+
},
|
|
3721
|
+
onResize() {
|
|
3722
|
+
if (this.minWidth === "activator")
|
|
3723
|
+
this.activatorWidth = this.activatorEl.offsetWidth;
|
|
3724
|
+
this.computeDetachableCoords();
|
|
3725
|
+
},
|
|
3726
|
+
onOutsideMousedown(e) {
|
|
3727
|
+
if (!this.detachableEl.contains(e.target) && !this.activatorEl.contains(e.target)) {
|
|
3728
|
+
this.$emit("update:modelValue", this.detachableVisible = false);
|
|
3729
|
+
this.$emit("input", false);
|
|
3730
|
+
this.$emit("close");
|
|
3731
|
+
document.removeEventListener("mousedown", this.onOutsideMousedown);
|
|
3732
|
+
window.removeEventListener("resize", this.onResize);
|
|
3733
|
+
}
|
|
3734
|
+
},
|
|
3735
|
+
insertInDOM() {
|
|
3736
|
+
return new Promise((resolve) => {
|
|
3737
|
+
this.$nextTick(() => {
|
|
3738
|
+
var _a;
|
|
3739
|
+
this.detachableEl = ((_a = this.$refs.detachable) == null ? void 0 : _a.$el) || this.$refs.detachable;
|
|
3740
|
+
if (this.detachableEl)
|
|
3741
|
+
this.appendToTarget.appendChild(this.detachableEl);
|
|
3742
|
+
resolve();
|
|
3743
|
+
});
|
|
3744
|
+
});
|
|
3745
|
+
},
|
|
3746
|
+
removeFromDOM() {
|
|
3747
|
+
document.removeEventListener("mousedown", this.onOutsideMousedown);
|
|
3748
|
+
window.removeEventListener("resize", this.onResize);
|
|
3749
|
+
if (this.detachableEl && this.detachableEl.parentNode) {
|
|
3750
|
+
this.detachableVisible = false;
|
|
3751
|
+
this.detachableEl.remove();
|
|
3752
|
+
this.detachableEl = null;
|
|
3753
|
+
}
|
|
3754
|
+
}
|
|
3755
|
+
},
|
|
3756
|
+
mounted() {
|
|
3757
|
+
var _a;
|
|
3758
|
+
const wrapper = this.$el;
|
|
3759
|
+
if (this.$slots.activator)
|
|
3760
|
+
wrapper.parentNode.insertBefore(this.activatorEl, wrapper);
|
|
3761
|
+
else if (this.activator) {
|
|
3762
|
+
Object.entries(this.activatorEventHandlers).forEach(([eventName, handler]) => {
|
|
3763
|
+
eventName = eventName.replace("mouseenter", "mouseover").replace("mouseleave", "mouseout");
|
|
3764
|
+
const handlerWrap = (e) => {
|
|
3765
|
+
var _a2;
|
|
3766
|
+
if (((_a2 = e.target) == null ? void 0 : _a2.matches) && e.target.matches(this.activator))
|
|
3767
|
+
handler(e);
|
|
3768
|
+
};
|
|
3769
|
+
document.addEventListener(eventName, handlerWrap);
|
|
3770
|
+
this.docAEventListenersHandlers.push({ eventName, handler: handlerWrap });
|
|
3771
|
+
});
|
|
3772
|
+
}
|
|
3773
|
+
if (this.overlay) {
|
|
3774
|
+
this.overlayEl = (_a = this.$refs.overlay) == null ? void 0 : _a.$el;
|
|
3775
|
+
wrapper.parentNode.insertBefore(this.overlayEl, wrapper);
|
|
3776
|
+
}
|
|
3777
|
+
if (this.modelValue)
|
|
3778
|
+
this.toggleMenu({ type: "click", target: this.activatorEl });
|
|
3779
|
+
},
|
|
3780
|
+
beforeUnmount() {
|
|
3781
|
+
var _a;
|
|
3782
|
+
this.close();
|
|
3783
|
+
this.removeFromDOM();
|
|
3784
|
+
if (this.docAEventListenersHandlers.length) {
|
|
3785
|
+
this.docAEventListenersHandlers.forEach(({ eventName, handler }) => {
|
|
3786
|
+
document.removeEventListener(eventName, handler);
|
|
3787
|
+
});
|
|
3788
|
+
}
|
|
3789
|
+
if (this.overlay && this.overlayEl.parentNode)
|
|
3790
|
+
this.overlayEl.remove();
|
|
3791
|
+
if (((_a = this.activatorEl) == null ? void 0 : _a.parentNode) && this.$slots.activator)
|
|
3792
|
+
this.activatorEl.remove();
|
|
3793
|
+
},
|
|
3794
|
+
watch: {
|
|
3795
|
+
modelValue(bool) {
|
|
3796
|
+
if (!!bool !== this.detachableVisible)
|
|
3797
|
+
this.toggle({ type: "click", target: this.activatorEl });
|
|
3798
|
+
},
|
|
3799
|
+
detachTo() {
|
|
3800
|
+
this.removeFromDOM();
|
|
3801
|
+
this.insertInDOM();
|
|
3802
|
+
},
|
|
3803
|
+
appendTo() {
|
|
3804
|
+
this.removeFromDOM();
|
|
3805
|
+
this.insertInDOM();
|
|
3806
|
+
}
|
|
3807
|
+
}
|
|
3808
|
+
};
|
|
3809
|
+
const _hoisted_1$h = { class: "w-menu-wrap" };
|
|
3507
3810
|
function render$s(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3508
3811
|
const _component_w_card = resolveComponent("w-card");
|
|
3509
3812
|
const _component_w_overlay = resolveComponent("w-overlay");
|
|
3510
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
3813
|
+
return openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
3511
3814
|
renderSlot(_ctx.$slots, "activator", { on: $options.activatorEventHandlers }),
|
|
3512
3815
|
createVNode(Transition, {
|
|
3513
3816
|
name: $options.transitionName,
|
|
3514
3817
|
appear: ""
|
|
3515
3818
|
}, {
|
|
3516
3819
|
default: withCtx(() => [
|
|
3517
|
-
$props.custom && _ctx.
|
|
3820
|
+
$props.custom && _ctx.detachableVisible ? (openBlock(), createElementBlock("div", {
|
|
3518
3821
|
key: 0,
|
|
3519
3822
|
class: normalizeClass(["w-menu", $options.classes]),
|
|
3520
|
-
ref: "
|
|
3521
|
-
onClick: _cache[0] || (_cache[0] = ($event) => $props.hideOnMenuClick && $options.
|
|
3823
|
+
ref: "detachable",
|
|
3824
|
+
onClick: _cache[0] || (_cache[0] = ($event) => $props.hideOnMenuClick && $options.close(true)),
|
|
3522
3825
|
onMouseenter: _cache[1] || (_cache[1] = ($event) => $props.showOnHover && (_ctx.hoveringMenu = true)),
|
|
3523
|
-
onMouseleave: _cache[2] || (_cache[2] = ($event) => $props.showOnHover && (_ctx.hoveringMenu = false, $options.
|
|
3826
|
+
onMouseleave: _cache[2] || (_cache[2] = ($event) => $props.showOnHover && (_ctx.hoveringMenu = false, $options.close())),
|
|
3524
3827
|
style: normalizeStyle($options.styles)
|
|
3525
3828
|
}, [
|
|
3526
3829
|
renderSlot(_ctx.$slots, "default")
|
|
3527
|
-
], 38)) : _ctx.
|
|
3830
|
+
], 38)) : _ctx.detachableVisible ? (openBlock(), createBlock(_component_w_card, {
|
|
3528
3831
|
key: 1,
|
|
3529
3832
|
class: normalizeClass(["w-menu", $options.classes]),
|
|
3530
|
-
ref: "
|
|
3531
|
-
onClick: _cache[3] || (_cache[3] = ($event) => $props.hideOnMenuClick && $options.
|
|
3833
|
+
ref: "detachable",
|
|
3834
|
+
onClick: _cache[3] || (_cache[3] = ($event) => $props.hideOnMenuClick && $options.close(true)),
|
|
3532
3835
|
onMouseenter: _cache[4] || (_cache[4] = ($event) => $props.showOnHover && (_ctx.hoveringMenu = true)),
|
|
3533
|
-
onMouseleave: _cache[5] || (_cache[5] = ($event) => $props.showOnHover && (_ctx.hoveringMenu = false, $options.
|
|
3836
|
+
onMouseleave: _cache[5] || (_cache[5] = ($event) => $props.showOnHover && (_ctx.hoveringMenu = false, $options.close())),
|
|
3534
3837
|
tile: $props.tile,
|
|
3535
3838
|
"title-class": $options.titleClasses,
|
|
3536
3839
|
"content-class": $options.contentClasses,
|
|
@@ -3562,18 +3865,19 @@ function render$s(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3562
3865
|
$props.overlay ? (openBlock(), createBlock(_component_w_overlay, mergeProps({
|
|
3563
3866
|
key: 0,
|
|
3564
3867
|
ref: "overlay",
|
|
3565
|
-
"model-value": _ctx.
|
|
3868
|
+
"model-value": _ctx.detachableVisible,
|
|
3566
3869
|
persistent: $props.persistent,
|
|
3567
3870
|
class: $options.overlayClasses
|
|
3568
3871
|
}, $props.overlayProps, {
|
|
3569
|
-
"z-index": (
|
|
3570
|
-
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => _ctx.
|
|
3872
|
+
"z-index": (_ctx.zIndex || 200) - 1,
|
|
3873
|
+
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => _ctx.detachableVisible = false)
|
|
3571
3874
|
}), null, 16, ["model-value", "persistent", "class", "z-index"])) : createCommentVNode("", true)
|
|
3572
3875
|
]);
|
|
3573
3876
|
}
|
|
3574
3877
|
var wMenu_vue_vue_type_style_index_0_lang = "";
|
|
3575
3878
|
const _sfc_main$s = {
|
|
3576
3879
|
name: "w-menu",
|
|
3880
|
+
mixins: [DetachableMixin],
|
|
3577
3881
|
props: {
|
|
3578
3882
|
modelValue: {},
|
|
3579
3883
|
showOnHover: { type: Boolean },
|
|
@@ -3590,75 +3894,36 @@ const _sfc_main$s = {
|
|
|
3590
3894
|
titleClass: { type: [String, Object, Array] },
|
|
3591
3895
|
contentClass: { type: [String, Object, Array] },
|
|
3592
3896
|
arrow: { type: Boolean },
|
|
3593
|
-
detachTo: { type: [String, Boolean, Object] },
|
|
3594
|
-
fixed: { type: Boolean },
|
|
3595
|
-
top: { type: Boolean },
|
|
3596
|
-
bottom: { type: Boolean },
|
|
3597
|
-
left: { type: Boolean },
|
|
3598
|
-
right: { type: Boolean },
|
|
3599
|
-
alignTop: { type: Boolean },
|
|
3600
|
-
alignBottom: { type: Boolean },
|
|
3601
|
-
alignLeft: { type: Boolean },
|
|
3602
|
-
alignRight: { type: Boolean },
|
|
3603
|
-
zIndex: { type: [Number, String, Boolean] },
|
|
3604
3897
|
minWidth: { type: [Number, String] },
|
|
3605
3898
|
overlay: { type: Boolean },
|
|
3606
3899
|
overlayClass: { type: [String, Object, Array] },
|
|
3607
3900
|
overlayProps: { type: Object },
|
|
3608
3901
|
persistent: { type: Boolean },
|
|
3609
|
-
|
|
3902
|
+
delay: { type: Number }
|
|
3610
3903
|
},
|
|
3611
3904
|
emits: ["input", "update:modelValue", "open", "close"],
|
|
3612
3905
|
data: () => ({
|
|
3613
|
-
|
|
3906
|
+
detachableVisible: false,
|
|
3614
3907
|
hoveringActivator: false,
|
|
3615
3908
|
hoveringMenu: false,
|
|
3616
|
-
|
|
3909
|
+
detachableCoords: {
|
|
3617
3910
|
top: 0,
|
|
3618
3911
|
left: 0
|
|
3619
3912
|
},
|
|
3620
|
-
activatorEl: null,
|
|
3621
3913
|
activatorWidth: 0,
|
|
3622
|
-
|
|
3914
|
+
detachableEl: null,
|
|
3623
3915
|
timeoutId: null
|
|
3624
3916
|
}),
|
|
3625
3917
|
computed: {
|
|
3626
3918
|
transitionName() {
|
|
3627
3919
|
return this.transition || "scale-fade";
|
|
3628
3920
|
},
|
|
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
|
-
position() {
|
|
3651
|
-
return this.top && "top" || this.bottom && "bottom" || this.left && "left" || this.right && "right" || "bottom";
|
|
3652
|
-
},
|
|
3653
3921
|
menuMinWidth() {
|
|
3654
3922
|
if (this.minWidth === "activator")
|
|
3655
3923
|
return this.activatorWidth ? `${this.activatorWidth}px` : 0;
|
|
3656
3924
|
else
|
|
3657
3925
|
return isNaN(this.minWidth) ? this.minWidth : this.minWidth ? `${this.minWidth}px` : 0;
|
|
3658
3926
|
},
|
|
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
3927
|
menuClasses() {
|
|
3663
3928
|
return objectifyClasses(this.menuClass);
|
|
3664
3929
|
},
|
|
@@ -3689,8 +3954,8 @@ const _sfc_main$s = {
|
|
|
3689
3954
|
styles() {
|
|
3690
3955
|
return {
|
|
3691
3956
|
zIndex: this.zIndex || this.zIndex === 0 || this.overlay && !this.zIndex && 200 || null,
|
|
3692
|
-
top: this.
|
|
3693
|
-
left: this.
|
|
3957
|
+
top: this.detachableCoords.top && `${~~this.detachableCoords.top}px` || null,
|
|
3958
|
+
left: this.detachableCoords.left && `${~~this.detachableCoords.left}px` || null,
|
|
3694
3959
|
minWidth: this.minWidth && this.menuMinWidth || null,
|
|
3695
3960
|
"--w-menu-bg-color": this.arrow && this.$waveui.colors[this.bgColor || "white"]
|
|
3696
3961
|
};
|
|
@@ -3699,30 +3964,31 @@ const _sfc_main$s = {
|
|
|
3699
3964
|
let handlers = {};
|
|
3700
3965
|
if (this.showOnHover) {
|
|
3701
3966
|
handlers = {
|
|
3702
|
-
focus: this.
|
|
3703
|
-
blur: this.
|
|
3967
|
+
focus: this.toggle,
|
|
3968
|
+
blur: this.toggle,
|
|
3704
3969
|
mouseenter: (e) => {
|
|
3705
3970
|
this.hoveringActivator = true;
|
|
3706
|
-
this.
|
|
3971
|
+
this.open(e);
|
|
3707
3972
|
},
|
|
3708
3973
|
mouseleave: (e) => {
|
|
3709
3974
|
this.hoveringActivator = false;
|
|
3710
3975
|
setTimeout(() => {
|
|
3711
3976
|
if (!this.hoveringMenu)
|
|
3712
|
-
this.
|
|
3977
|
+
this.close();
|
|
3713
3978
|
}, 10);
|
|
3714
3979
|
}
|
|
3715
3980
|
};
|
|
3716
|
-
if ("ontouchstart" in window)
|
|
3717
|
-
handlers.click = this.
|
|
3981
|
+
if (typeof window !== "undefined" && "ontouchstart" in window) {
|
|
3982
|
+
handlers.click = this.toggle;
|
|
3983
|
+
}
|
|
3718
3984
|
} else
|
|
3719
|
-
handlers = { click: this.
|
|
3985
|
+
handlers = { click: this.toggle };
|
|
3720
3986
|
return handlers;
|
|
3721
3987
|
}
|
|
3722
3988
|
},
|
|
3723
3989
|
methods: {
|
|
3724
|
-
|
|
3725
|
-
let shouldShowMenu = this.
|
|
3990
|
+
toggle(e) {
|
|
3991
|
+
let shouldShowMenu = this.detachableVisible;
|
|
3726
3992
|
if ("ontouchstart" in window && this.showOnHover && e.type === "click") {
|
|
3727
3993
|
shouldShowMenu = !shouldShowMenu;
|
|
3728
3994
|
} else if (e.type === "click" && !this.showOnHover)
|
|
@@ -3735,21 +4001,22 @@ const _sfc_main$s = {
|
|
|
3735
4001
|
shouldShowMenu = false;
|
|
3736
4002
|
}
|
|
3737
4003
|
this.timeoutId = clearTimeout(this.timeoutId);
|
|
3738
|
-
if (shouldShowMenu)
|
|
3739
|
-
this
|
|
3740
|
-
|
|
3741
|
-
this
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
this.
|
|
3748
|
-
|
|
4004
|
+
if (shouldShowMenu)
|
|
4005
|
+
this.open(e);
|
|
4006
|
+
else
|
|
4007
|
+
this.close();
|
|
4008
|
+
},
|
|
4009
|
+
async open(e) {
|
|
4010
|
+
if (this.delay)
|
|
4011
|
+
await new Promise((resolve) => setTimeout(resolve, this.delay));
|
|
4012
|
+
this.detachableVisible = true;
|
|
4013
|
+
if (this.activator)
|
|
4014
|
+
this.activatorEl = e.target;
|
|
4015
|
+
await this.insertInDOM();
|
|
3749
4016
|
if (this.minWidth === "activator")
|
|
3750
4017
|
this.activatorWidth = this.activatorEl.offsetWidth;
|
|
3751
4018
|
if (!this.noPosition)
|
|
3752
|
-
this.
|
|
4019
|
+
this.computeDetachableCoords(e);
|
|
3753
4020
|
this.timeoutId = setTimeout(() => {
|
|
3754
4021
|
this.$emit("update:modelValue", true);
|
|
3755
4022
|
this.$emit("input", true);
|
|
@@ -3760,134 +4027,19 @@ const _sfc_main$s = {
|
|
|
3760
4027
|
if (!this.noPosition)
|
|
3761
4028
|
window.addEventListener("resize", this.onResize);
|
|
3762
4029
|
},
|
|
3763
|
-
async
|
|
3764
|
-
if (!this.
|
|
4030
|
+
async close(force = false) {
|
|
4031
|
+
if (!this.detachableVisible)
|
|
3765
4032
|
return;
|
|
3766
4033
|
if (this.showOnHover && !force) {
|
|
3767
4034
|
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
3768
4035
|
if (this.showOnHover && (this.hoveringMenu || this.hoveringActivator))
|
|
3769
4036
|
return;
|
|
3770
4037
|
}
|
|
3771
|
-
this.$emit("update:modelValue", this.
|
|
4038
|
+
this.$emit("update:modelValue", this.detachableVisible = false);
|
|
3772
4039
|
this.$emit("input", false);
|
|
3773
4040
|
this.$emit("close");
|
|
3774
4041
|
document.removeEventListener("mousedown", this.onOutsideMousedown);
|
|
3775
4042
|
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
|
-
}
|
|
3863
|
-
},
|
|
3864
|
-
mounted() {
|
|
3865
|
-
var _a;
|
|
3866
|
-
const wrapper = this.$el;
|
|
3867
|
-
this.activatorEl = wrapper.firstElementChild;
|
|
3868
|
-
wrapper.parentNode.insertBefore(this.activatorEl, wrapper);
|
|
3869
|
-
if (this.overlay) {
|
|
3870
|
-
this.overlayEl = (_a = this.$refs.overlay) == null ? void 0 : _a.$el;
|
|
3871
|
-
wrapper.parentNode.insertBefore(this.overlayEl, wrapper);
|
|
3872
|
-
}
|
|
3873
|
-
if (this.modelValue)
|
|
3874
|
-
this.toggleMenu({ type: "click", target: this.activatorEl });
|
|
3875
|
-
},
|
|
3876
|
-
beforeUnmount() {
|
|
3877
|
-
this.removeMenu();
|
|
3878
|
-
if (this.overlay && this.overlayEl.parentNode)
|
|
3879
|
-
this.overlayEl.remove();
|
|
3880
|
-
if (this.activatorEl && this.activatorEl.parentNode)
|
|
3881
|
-
this.activatorEl.remove();
|
|
3882
|
-
},
|
|
3883
|
-
watch: {
|
|
3884
|
-
modelValue(bool) {
|
|
3885
|
-
if (!!bool !== this.menuVisible)
|
|
3886
|
-
this.toggleMenu({ type: "click", target: this.activatorEl });
|
|
3887
|
-
},
|
|
3888
|
-
detachTo() {
|
|
3889
|
-
this.removeMenu();
|
|
3890
|
-
this.insertMenu();
|
|
3891
4043
|
}
|
|
3892
4044
|
}
|
|
3893
4045
|
};
|
|
@@ -4125,9 +4277,9 @@ const _sfc_main$q = {
|
|
|
4125
4277
|
}
|
|
4126
4278
|
};
|
|
4127
4279
|
var wOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", render$q]]);
|
|
4128
|
-
const _hoisted_1$
|
|
4280
|
+
const _hoisted_1$g = { class: "w-parallax" };
|
|
4129
4281
|
function render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4130
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
4282
|
+
return openBlock(), createElementBlock("div", _hoisted_1$g);
|
|
4131
4283
|
}
|
|
4132
4284
|
var wParallax_vue_vue_type_style_index_0_lang = "";
|
|
4133
4285
|
const _sfc_main$p = {
|
|
@@ -4137,7 +4289,7 @@ const _sfc_main$p = {
|
|
|
4137
4289
|
data: () => ({})
|
|
4138
4290
|
};
|
|
4139
4291
|
var wParallax = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", render$p]]);
|
|
4140
|
-
const _hoisted_1$
|
|
4292
|
+
const _hoisted_1$f = ["viewBox"];
|
|
4141
4293
|
const _hoisted_2$9 = ["cx", "cy", "r", "stroke-dasharray", "stroke-width"];
|
|
4142
4294
|
const _hoisted_3$8 = ["viewBox"];
|
|
4143
4295
|
const _hoisted_4$7 = ["cx", "cy", "r", "stroke-width", "stroke-linecap", "stroke-dasharray"];
|
|
@@ -4164,7 +4316,7 @@ function render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4164
4316
|
"stroke-dasharray": _ctx.circleCircumference,
|
|
4165
4317
|
"stroke-width": $props.stroke
|
|
4166
4318
|
}, null, 10, _hoisted_2$9)) : createCommentVNode("", true)
|
|
4167
|
-
], 8, _hoisted_1$
|
|
4319
|
+
], 8, _hoisted_1$f)),
|
|
4168
4320
|
(openBlock(), createElementBlock("svg", {
|
|
4169
4321
|
class: "w-progress__progress",
|
|
4170
4322
|
viewBox: `${$options.circleCenter / 2} ${$options.circleCenter / 2} ${$options.circleCenter} ${$options.circleCenter}`,
|
|
@@ -4263,7 +4415,7 @@ const _sfc_main$o = {
|
|
|
4263
4415
|
}
|
|
4264
4416
|
};
|
|
4265
4417
|
var wProgress = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", render$o]]);
|
|
4266
|
-
const _hoisted_1$
|
|
4418
|
+
const _hoisted_1$e = ["id", "name", "checked", "disabled", "required", "tabindex", "aria-checked"];
|
|
4267
4419
|
const _hoisted_2$8 = ["for"];
|
|
4268
4420
|
const _hoisted_3$7 = ["for", "innerHTML"];
|
|
4269
4421
|
const _hoisted_4$6 = ["for"];
|
|
@@ -4292,7 +4444,7 @@ function render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4292
4444
|
onChange: _cache[1] || (_cache[1] = ($event) => $options.onInput($event)),
|
|
4293
4445
|
"aria-checked": _ctx.inputValue || "false",
|
|
4294
4446
|
role: "radio"
|
|
4295
|
-
}, null, 40, _hoisted_1$
|
|
4447
|
+
}, null, 40, _hoisted_1$e),
|
|
4296
4448
|
$options.hasLabel && $props.labelOnLeft ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
4297
4449
|
_ctx.$slots.default ? (openBlock(), createElementBlock("label", {
|
|
4298
4450
|
key: 0,
|
|
@@ -4402,7 +4554,7 @@ const _sfc_main$n = {
|
|
|
4402
4554
|
}
|
|
4403
4555
|
};
|
|
4404
4556
|
var wRadio = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", render$n]]);
|
|
4405
|
-
const _hoisted_1$
|
|
4557
|
+
const _hoisted_1$d = ["innerHTML"];
|
|
4406
4558
|
function render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4407
4559
|
const _component_w_radio = resolveComponent("w-radio");
|
|
4408
4560
|
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 +4599,7 @@ function render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4447
4599
|
}) : item.label ? (openBlock(), createElementBlock("div", {
|
|
4448
4600
|
key: 2,
|
|
4449
4601
|
innerHTML: item.label
|
|
4450
|
-
}, null, 8, _hoisted_1$
|
|
4602
|
+
}, null, 8, _hoisted_1$d)) : createCommentVNode("", true)
|
|
4451
4603
|
]),
|
|
4452
4604
|
_: 2
|
|
4453
4605
|
}, 1032, ["model-value", "onUpdate:modelValue", "name", "label", "label-on-left", "color", "disabled", "readonly", "class"]);
|
|
@@ -4505,12 +4657,13 @@ const _sfc_main$m = {
|
|
|
4505
4657
|
}
|
|
4506
4658
|
};
|
|
4507
4659
|
var wRadios = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", render$m]]);
|
|
4508
|
-
const _hoisted_1$
|
|
4660
|
+
const _hoisted_1$c = ["id", "name", "value"];
|
|
4509
4661
|
const _hoisted_2$7 = ["disabled", "onMouseenter", "onClick", "tabindex"];
|
|
4510
4662
|
function render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4511
4663
|
return openBlock(), createBlock(resolveDynamicComponent(_ctx.formRegister ? "w-form-element" : "div"), mergeProps({ ref: "formEl" }, _ctx.formRegister && { validators: _ctx.validators, inputValue: $data.rating, disabled: _ctx.isDisabled, readonly: _ctx.isReadonly }, {
|
|
4512
4664
|
valid: _ctx.valid,
|
|
4513
|
-
|
|
4665
|
+
"onUpdate:valid": _cache[4] || (_cache[4] = ($event) => _ctx.valid = $event),
|
|
4666
|
+
onReset: _cache[5] || (_cache[5] = ($event) => {
|
|
4514
4667
|
_ctx.$emit("update:modelValue", $data.rating = null);
|
|
4515
4668
|
_ctx.$emit("input", null);
|
|
4516
4669
|
}),
|
|
@@ -4522,7 +4675,7 @@ function render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4522
4675
|
name: _ctx.inputName,
|
|
4523
4676
|
type: "hidden",
|
|
4524
4677
|
value: $data.rating
|
|
4525
|
-
}, null, 8, _hoisted_1$
|
|
4678
|
+
}, null, 8, _hoisted_1$c),
|
|
4526
4679
|
(openBlock(true), createElementBlock(Fragment, null, renderList($props.max, (i) => {
|
|
4527
4680
|
return openBlock(), createElementBlock(Fragment, { key: i }, [
|
|
4528
4681
|
_ctx.$slots.item ? renderSlot(_ctx.$slots, "item", {
|
|
@@ -4661,7 +4814,7 @@ const _sfc_main$l = {
|
|
|
4661
4814
|
}
|
|
4662
4815
|
};
|
|
4663
4816
|
var wRating = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", render$l]]);
|
|
4664
|
-
const _hoisted_1$
|
|
4817
|
+
const _hoisted_1$b = ["for"];
|
|
4665
4818
|
const _hoisted_2$6 = ["for", "innerHTML"];
|
|
4666
4819
|
const _hoisted_3$6 = ["aria-expanded", "aria-owns", "aria-activedescendant"];
|
|
4667
4820
|
const _hoisted_4$5 = {
|
|
@@ -4693,7 +4846,7 @@ function render$k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4693
4846
|
for: `w-select--${_ctx._.uid}`
|
|
4694
4847
|
}, [
|
|
4695
4848
|
renderSlot(_ctx.$slots, "default")
|
|
4696
|
-
], 8, _hoisted_1$
|
|
4849
|
+
], 8, _hoisted_1$b)) : $props.label ? (openBlock(), createElementBlock("label", {
|
|
4697
4850
|
key: 1,
|
|
4698
4851
|
class: "w-select__label w-select__label--left w-form-el-shakable",
|
|
4699
4852
|
for: `w-select--${_ctx._.uid}`,
|
|
@@ -4705,7 +4858,7 @@ function render$k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4705
4858
|
"onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => _ctx.showMenu = $event),
|
|
4706
4859
|
"menu-class": `w-select__menu ${$props.menuClass || ""}`,
|
|
4707
4860
|
transition: "slide-fade-down",
|
|
4708
|
-
"
|
|
4861
|
+
"append-to": ($props.menuProps || {}).appendTo !== void 0 ? ($props.menuProps || {}).appendTo : ".w-app",
|
|
4709
4862
|
"align-left": "",
|
|
4710
4863
|
custom: "",
|
|
4711
4864
|
"min-width": "activator"
|
|
@@ -4834,7 +4987,7 @@ function render$k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4834
4987
|
]), 1032, ["model-value", "onUpdate:modelValue", "onItemSelect", "onKeydown:escape", "items", "multiple", "add-ids", "no-unselect", "selection-color", "item-color-key"])
|
|
4835
4988
|
]),
|
|
4836
4989
|
_: 3
|
|
4837
|
-
}, 16, ["modelValue", "menu-class", "
|
|
4990
|
+
}, 16, ["modelValue", "menu-class", "append-to"]),
|
|
4838
4991
|
$props.labelPosition === "right" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
4839
4992
|
_ctx.$slots.default ? (openBlock(), createElementBlock("label", {
|
|
4840
4993
|
key: 0,
|
|
@@ -5005,8 +5158,9 @@ const _sfc_main$k = {
|
|
|
5005
5158
|
openMenu() {
|
|
5006
5159
|
this.showMenu = true;
|
|
5007
5160
|
setTimeout(() => {
|
|
5161
|
+
var _a;
|
|
5008
5162
|
const itemIndex = this.inputValue.length ? this.inputValue[0].index : 0;
|
|
5009
|
-
this.$refs["w-list"].$el.querySelector(`#w-select-menu--${this._.uid}_item-${itemIndex + 1}`).focus();
|
|
5163
|
+
(_a = this.$refs["w-list"].$el.querySelector(`#w-select-menu--${this._.uid}_item-${itemIndex + 1}`)) == null ? void 0 : _a.focus();
|
|
5010
5164
|
}, 100);
|
|
5011
5165
|
},
|
|
5012
5166
|
closeMenu() {
|
|
@@ -5030,7 +5184,7 @@ const _sfc_main$k = {
|
|
|
5030
5184
|
}
|
|
5031
5185
|
};
|
|
5032
5186
|
var wSelect = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", render$k]]);
|
|
5033
|
-
const _hoisted_1$
|
|
5187
|
+
const _hoisted_1$a = ["for"];
|
|
5034
5188
|
const _hoisted_2$5 = ["for", "innerHTML"];
|
|
5035
5189
|
const _hoisted_3$5 = { class: "w-slider__track-wrap" };
|
|
5036
5190
|
const _hoisted_4$4 = ["aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-readonly"];
|
|
@@ -5062,7 +5216,7 @@ function render$j(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5062
5216
|
for: `button--${_ctx._.uid}`
|
|
5063
5217
|
}, [
|
|
5064
5218
|
renderSlot(_ctx.$slots, "label-left")
|
|
5065
|
-
], 8, _hoisted_1$
|
|
5219
|
+
], 8, _hoisted_1$a)) : $props.labelLeft ? (openBlock(), createElementBlock("label", {
|
|
5066
5220
|
key: 1,
|
|
5067
5221
|
class: "w-slider__label w-slider__label--left w-form-el-shakable",
|
|
5068
5222
|
for: `button--${_ctx._.uid}`,
|
|
@@ -5317,14 +5471,14 @@ const _sfc_main$j = {
|
|
|
5317
5471
|
}
|
|
5318
5472
|
};
|
|
5319
5473
|
var wSlider = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", render$j]]);
|
|
5320
|
-
const _hoisted_1$
|
|
5474
|
+
const _hoisted_1$9 = { key: 0 };
|
|
5321
5475
|
function render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5322
5476
|
return $props.value || $props.value === void 0 ? (openBlock(), createElementBlock("div", {
|
|
5323
5477
|
key: 0,
|
|
5324
5478
|
class: normalizeClass(["w-spinner", $options.classes]),
|
|
5325
5479
|
style: normalizeStyle($options.styles)
|
|
5326
5480
|
}, [
|
|
5327
|
-
$options.isThreeDots ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
5481
|
+
$options.isThreeDots ? (openBlock(), createElementBlock("span", _hoisted_1$9)) : createCommentVNode("", true)
|
|
5328
5482
|
], 6)) : createCommentVNode("", true);
|
|
5329
5483
|
}
|
|
5330
5484
|
var wSpinner_vue_vue_type_style_index_0_lang = "";
|
|
@@ -5368,9 +5522,9 @@ const _sfc_main$i = {
|
|
|
5368
5522
|
}
|
|
5369
5523
|
};
|
|
5370
5524
|
var wSpinner = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", render$i]]);
|
|
5371
|
-
const _hoisted_1$
|
|
5525
|
+
const _hoisted_1$8 = { class: "w-steps" };
|
|
5372
5526
|
function render$h(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5373
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
5527
|
+
return openBlock(), createElementBlock("div", _hoisted_1$8);
|
|
5374
5528
|
}
|
|
5375
5529
|
var wSteps_vue_vue_type_style_index_0_lang = "";
|
|
5376
5530
|
const _sfc_main$h = {
|
|
@@ -5380,7 +5534,7 @@ const _sfc_main$h = {
|
|
|
5380
5534
|
data: () => ({})
|
|
5381
5535
|
};
|
|
5382
5536
|
var wSteps = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", render$h]]);
|
|
5383
|
-
const _hoisted_1$
|
|
5537
|
+
const _hoisted_1$7 = ["id", "name", "checked", "disabled", "readonly", "aria-readonly", "required", "tabindex", "aria-checked"];
|
|
5384
5538
|
const _hoisted_2$4 = ["for"];
|
|
5385
5539
|
const _hoisted_3$4 = ["for", "innerHTML"];
|
|
5386
5540
|
const _hoisted_4$3 = ["for"];
|
|
@@ -5411,7 +5565,7 @@ function render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5411
5565
|
onFocus: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("focus", $event)),
|
|
5412
5566
|
"aria-checked": $data.isOn || "false",
|
|
5413
5567
|
role: "switch"
|
|
5414
|
-
}, null, 40, _hoisted_1$
|
|
5568
|
+
}, null, 40, _hoisted_1$7),
|
|
5415
5569
|
$options.hasLabel && $props.labelOnLeft ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
5416
5570
|
_ctx.$slots.default ? (openBlock(), createElementBlock("label", {
|
|
5417
5571
|
key: 0,
|
|
@@ -5523,15 +5677,15 @@ const _sfc_main$g = {
|
|
|
5523
5677
|
}
|
|
5524
5678
|
};
|
|
5525
5679
|
var wSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", render$g]]);
|
|
5526
|
-
const _hoisted_1$
|
|
5680
|
+
const _hoisted_1$6 = { class: "w-tabs__content" };
|
|
5527
5681
|
function render$f(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5528
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
5682
|
+
return openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
5529
5683
|
renderSlot(_ctx.$slots, "default")
|
|
5530
5684
|
]);
|
|
5531
5685
|
}
|
|
5532
5686
|
const _sfc_main$f = {};
|
|
5533
5687
|
var TabContent = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", render$f]]);
|
|
5534
|
-
const _hoisted_1$
|
|
5688
|
+
const _hoisted_1$5 = ["onClick", "onFocus", "tabindex", "onKeypress", "aria-selected"];
|
|
5535
5689
|
const _hoisted_2$3 = ["innerHTML"];
|
|
5536
5690
|
const _hoisted_3$3 = {
|
|
5537
5691
|
key: 0,
|
|
@@ -5577,7 +5731,7 @@ function render$e(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5577
5731
|
innerHTML: item[$props.itemTitleKey]
|
|
5578
5732
|
}, null, 8, _hoisted_2$3)
|
|
5579
5733
|
])
|
|
5580
|
-
], 42, _hoisted_1$
|
|
5734
|
+
], 42, _hoisted_1$5);
|
|
5581
5735
|
}), 128)),
|
|
5582
5736
|
_ctx.$slots["tabs-bar-extra"] ? (openBlock(), createElementBlock("div", _hoisted_3$3, [
|
|
5583
5737
|
renderSlot(_ctx.$slots, "tabs-bar-extra")
|
|
@@ -5725,7 +5879,8 @@ const _sfc_main$e = {
|
|
|
5725
5879
|
},
|
|
5726
5880
|
updateSlider(domLookup = true) {
|
|
5727
5881
|
if (domLookup) {
|
|
5728
|
-
|
|
5882
|
+
const ref = this.$refs["tabs-bar"];
|
|
5883
|
+
this.activeTabEl = ref && ref.querySelector(".w-tabs__bar-item--active");
|
|
5729
5884
|
}
|
|
5730
5885
|
if (!this.fillBar && this.activeTabEl) {
|
|
5731
5886
|
const { left, width } = this.activeTabEl.getBoundingClientRect();
|
|
@@ -5784,7 +5939,7 @@ const _sfc_main$e = {
|
|
|
5784
5939
|
}
|
|
5785
5940
|
};
|
|
5786
5941
|
var index = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", render$e]]);
|
|
5787
|
-
const _hoisted_1$
|
|
5942
|
+
const _hoisted_1$4 = { ref: "colgroup" };
|
|
5788
5943
|
const _hoisted_2$2 = ["width"];
|
|
5789
5944
|
const _hoisted_3$2 = { key: 0 };
|
|
5790
5945
|
const _hoisted_4$1 = ["onClick"];
|
|
@@ -5827,7 +5982,7 @@ function render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5827
5982
|
onMouseover: _cache[2] || (_cache[2] = (...args) => $options.onMouseOver && $options.onMouseOver(...args)),
|
|
5828
5983
|
onMouseout: _cache[3] || (_cache[3] = (...args) => $options.onMouseOut && $options.onMouseOut(...args))
|
|
5829
5984
|
}, [
|
|
5830
|
-
createElementVNode("colgroup", _hoisted_1$
|
|
5985
|
+
createElementVNode("colgroup", _hoisted_1$4, [
|
|
5831
5986
|
(openBlock(true), createElementBlock(Fragment, null, renderList($props.headers, (header, i) => {
|
|
5832
5987
|
return openBlock(), createElementBlock("col", {
|
|
5833
5988
|
class: "w-table__col",
|
|
@@ -6265,7 +6420,7 @@ const _sfc_main$d = {
|
|
|
6265
6420
|
}
|
|
6266
6421
|
};
|
|
6267
6422
|
var wTable = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", render$d]]);
|
|
6268
|
-
const _hoisted_1$
|
|
6423
|
+
const _hoisted_1$3 = ["role", "aria-pressed", "tabindex"];
|
|
6269
6424
|
function render$c(_ctx, _cache, $props, $setup, $data, $options) {
|
|
6270
6425
|
return openBlock(), createElementBlock("span", mergeProps({ class: "w-tag" }, toHandlers(_ctx.$attrs), {
|
|
6271
6426
|
onClick: _cache[1] || (_cache[1] = ($event) => {
|
|
@@ -6293,7 +6448,7 @@ function render$c(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6293
6448
|
role: "icon",
|
|
6294
6449
|
"aria-hidden": "true"
|
|
6295
6450
|
})) : createCommentVNode("", true)
|
|
6296
|
-
], 16, _hoisted_1$
|
|
6451
|
+
], 16, _hoisted_1$3);
|
|
6297
6452
|
}
|
|
6298
6453
|
var wTag_vue_vue_type_style_index_0_lang = "";
|
|
6299
6454
|
const _sfc_main$c = {
|
|
@@ -6345,7 +6500,7 @@ const _sfc_main$c = {
|
|
|
6345
6500
|
}
|
|
6346
6501
|
};
|
|
6347
6502
|
var wTag = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", render$c]]);
|
|
6348
|
-
const _hoisted_1$
|
|
6503
|
+
const _hoisted_1$2 = ["for"];
|
|
6349
6504
|
const _hoisted_2$1 = ["for", "innerHTML"];
|
|
6350
6505
|
const _hoisted_3$1 = ["id", "name", "placeholder", "rows", "cols", "readonly", "aria-readonly", "disabled", "required", "tabindex"];
|
|
6351
6506
|
const _hoisted_4 = ["for"];
|
|
@@ -6372,7 +6527,7 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6372
6527
|
for: `w-textarea--${_ctx._.uid}`
|
|
6373
6528
|
}, [
|
|
6374
6529
|
renderSlot(_ctx.$slots, "default")
|
|
6375
|
-
], 8, _hoisted_1$
|
|
6530
|
+
], 8, _hoisted_1$2)) : $props.label ? (openBlock(), createElementBlock("label", {
|
|
6376
6531
|
key: 1,
|
|
6377
6532
|
class: "w-textarea__label w-textarea__label--left w-form-el-shakable",
|
|
6378
6533
|
for: `w-textarea--${_ctx._.uid}`,
|
|
@@ -6499,7 +6654,7 @@ const _sfc_main$b = {
|
|
|
6499
6654
|
return listeners;
|
|
6500
6655
|
},
|
|
6501
6656
|
hasValue() {
|
|
6502
|
-
return this.inputValue;
|
|
6657
|
+
return this.inputValue || this.inputValue === 0;
|
|
6503
6658
|
},
|
|
6504
6659
|
hasLabel() {
|
|
6505
6660
|
return this.label || this.$slots.default;
|
|
@@ -6596,11 +6751,11 @@ const _sfc_main$b = {
|
|
|
6596
6751
|
}
|
|
6597
6752
|
};
|
|
6598
6753
|
var wTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", render$b]]);
|
|
6599
|
-
const _hoisted_1 = { class: "w-timeline" };
|
|
6754
|
+
const _hoisted_1$1 = { class: "w-timeline" };
|
|
6600
6755
|
const _hoisted_2 = ["innerHTML"];
|
|
6601
6756
|
const _hoisted_3 = ["innerHTML"];
|
|
6602
6757
|
function render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
6603
|
-
return openBlock(), createElementBlock("ul", _hoisted_1, [
|
|
6758
|
+
return openBlock(), createElementBlock("ul", _hoisted_1$1, [
|
|
6604
6759
|
(openBlock(true), createElementBlock(Fragment, null, renderList($props.items, (item, i) => {
|
|
6605
6760
|
return openBlock(), createElementBlock("li", {
|
|
6606
6761
|
class: "w-timeline-item",
|
|
@@ -6695,41 +6850,32 @@ const _sfc_main$9 = {
|
|
|
6695
6850
|
}
|
|
6696
6851
|
};
|
|
6697
6852
|
var wToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", render$9]]);
|
|
6853
|
+
const _hoisted_1 = { class: "w-tooltip-wrap" };
|
|
6698
6854
|
function render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
6699
|
-
return openBlock(), createElementBlock("div",
|
|
6700
|
-
|
|
6701
|
-
ref: "wrapper"
|
|
6702
|
-
}, [
|
|
6703
|
-
renderSlot(_ctx.$slots, "activator", { on: $options.eventHandlers }),
|
|
6855
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
6856
|
+
renderSlot(_ctx.$slots, "activator", { on: $options.activatorEventHandlers }),
|
|
6704
6857
|
createVNode(Transition, {
|
|
6705
6858
|
name: $options.transitionName,
|
|
6706
6859
|
appear: ""
|
|
6707
6860
|
}, {
|
|
6708
6861
|
default: withCtx(() => [
|
|
6709
|
-
|
|
6862
|
+
_ctx.detachableVisible ? (openBlock(), createElementBlock("div", {
|
|
6710
6863
|
class: normalizeClass(["w-tooltip", $options.classes]),
|
|
6711
|
-
ref:
|
|
6864
|
+
ref: "detachable",
|
|
6712
6865
|
key: _ctx._.uid,
|
|
6713
6866
|
style: normalizeStyle($options.styles)
|
|
6714
6867
|
}, [
|
|
6715
|
-
|
|
6716
|
-
|
|
6717
|
-
class: normalizeClass($props.color)
|
|
6718
|
-
}, [
|
|
6719
|
-
renderSlot(_ctx.$slots, "default")
|
|
6720
|
-
], 2)) : renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
6721
|
-
], 6)), [
|
|
6722
|
-
[vShow, _ctx.showTooltip]
|
|
6723
|
-
])
|
|
6868
|
+
renderSlot(_ctx.$slots, "default")
|
|
6869
|
+
], 6)) : createCommentVNode("", true)
|
|
6724
6870
|
]),
|
|
6725
6871
|
_: 3
|
|
6726
6872
|
}, 8, ["name"])
|
|
6727
|
-
]
|
|
6873
|
+
]);
|
|
6728
6874
|
}
|
|
6729
6875
|
var wTooltip_vue_vue_type_style_index_0_lang = "";
|
|
6730
|
-
const marginFromWindowSide = 4;
|
|
6731
6876
|
const _sfc_main$8 = {
|
|
6732
6877
|
name: "w-tooltip",
|
|
6878
|
+
mixins: [DetachableMixin],
|
|
6733
6879
|
props: {
|
|
6734
6880
|
modelValue: {},
|
|
6735
6881
|
showOnClick: { type: Boolean },
|
|
@@ -6741,25 +6887,18 @@ const _sfc_main$8 = {
|
|
|
6741
6887
|
round: { type: Boolean },
|
|
6742
6888
|
transition: { type: String },
|
|
6743
6889
|
tooltipClass: { type: [String, Object, Array] },
|
|
6744
|
-
|
|
6745
|
-
|
|
6746
|
-
top: { type: Boolean },
|
|
6747
|
-
bottom: { type: Boolean },
|
|
6748
|
-
left: { type: Boolean },
|
|
6749
|
-
right: { type: Boolean },
|
|
6750
|
-
zIndex: { type: [Number, String, Boolean] }
|
|
6890
|
+
persistent: { type: Boolean },
|
|
6891
|
+
delay: { type: Number }
|
|
6751
6892
|
},
|
|
6752
6893
|
emits: ["input", "update:modelValue", "open", "close"],
|
|
6753
6894
|
data: () => ({
|
|
6754
|
-
|
|
6755
|
-
|
|
6895
|
+
detachableVisible: false,
|
|
6896
|
+
hoveringActivator: false,
|
|
6897
|
+
detachableCoords: {
|
|
6756
6898
|
top: 0,
|
|
6757
|
-
left: 0
|
|
6758
|
-
width: 0,
|
|
6759
|
-
height: 0
|
|
6899
|
+
left: 0
|
|
6760
6900
|
},
|
|
6761
|
-
|
|
6762
|
-
tooltipEl: null,
|
|
6901
|
+
detachableEl: null,
|
|
6763
6902
|
timeoutId: null
|
|
6764
6903
|
}),
|
|
6765
6904
|
computed: {
|
|
@@ -6770,68 +6909,17 @@ const _sfc_main$8 = {
|
|
|
6770
6909
|
const direction = this.position.replace(/top|bottom/, (m) => ({ top: "up", bottom: "down" })[m]);
|
|
6771
6910
|
return this.transition || `w-tooltip-slide-fade-${direction}`;
|
|
6772
6911
|
},
|
|
6773
|
-
detachToTarget() {
|
|
6774
|
-
let target = this.detachTo || ".w-app";
|
|
6775
|
-
if (target === true)
|
|
6776
|
-
target = ".w-app";
|
|
6777
|
-
else if (target && !["object", "string"].includes(typeof target))
|
|
6778
|
-
target = ".w-app";
|
|
6779
|
-
else if (typeof target === "object" && !target.nodeType) {
|
|
6780
|
-
target = ".w-app";
|
|
6781
|
-
consoleWarn("Invalid node provided in w-tooltip `attach-to`. Falling back to .w-app.");
|
|
6782
|
-
}
|
|
6783
|
-
if (typeof target === "string")
|
|
6784
|
-
target = document.querySelector(target);
|
|
6785
|
-
if (!target) {
|
|
6786
|
-
consoleWarn(`Unable to locate ${this.detachTo ? `target ${this.detachTo}` : ".w-app"}`);
|
|
6787
|
-
target = document.querySelector(".w-app");
|
|
6788
|
-
}
|
|
6789
|
-
return target;
|
|
6790
|
-
},
|
|
6791
|
-
tooltipParentEl() {
|
|
6792
|
-
return this.detachTo ? this.detachToTarget : this.$refs.wrapper;
|
|
6793
|
-
},
|
|
6794
|
-
position() {
|
|
6795
|
-
return this.top && "top" || this.bottom && "bottom" || this.left && "left" || this.right && "right" || "bottom";
|
|
6796
|
-
},
|
|
6797
|
-
tooltipCoordinates() {
|
|
6798
|
-
const coords = {};
|
|
6799
|
-
const { top, left, width, height } = this.coordinates;
|
|
6800
|
-
switch (this.position) {
|
|
6801
|
-
case "top": {
|
|
6802
|
-
coords.top = top;
|
|
6803
|
-
coords.left = left + width / 2;
|
|
6804
|
-
break;
|
|
6805
|
-
}
|
|
6806
|
-
case "bottom": {
|
|
6807
|
-
coords.top = top + height;
|
|
6808
|
-
coords.left = left + width / 2;
|
|
6809
|
-
break;
|
|
6810
|
-
}
|
|
6811
|
-
case "left": {
|
|
6812
|
-
coords.top = top + height / 2;
|
|
6813
|
-
coords.left = left;
|
|
6814
|
-
break;
|
|
6815
|
-
}
|
|
6816
|
-
case "right": {
|
|
6817
|
-
coords.top = top + height / 2;
|
|
6818
|
-
coords.left = left + width;
|
|
6819
|
-
break;
|
|
6820
|
-
}
|
|
6821
|
-
}
|
|
6822
|
-
return coords;
|
|
6823
|
-
},
|
|
6824
6912
|
classes() {
|
|
6825
6913
|
return __spreadProps(__spreadValues({
|
|
6826
|
-
[this.color]:
|
|
6827
|
-
[`${this.bgColor}
|
|
6914
|
+
[this.color]: this.color,
|
|
6915
|
+
[`${this.bgColor}--bg`]: this.bgColor
|
|
6828
6916
|
}, this.tooltipClasses), {
|
|
6829
|
-
[`w-tooltip--${this.position}`]:
|
|
6917
|
+
[`w-tooltip--${this.position}`]: !this.noPosition,
|
|
6918
|
+
[`w-tooltip--align-${this.alignment}`]: !this.noPosition && this.alignment,
|
|
6830
6919
|
"w-tooltip--tile": this.tile,
|
|
6831
6920
|
"w-tooltip--round": this.round,
|
|
6832
6921
|
"w-tooltip--shadow": this.shadow,
|
|
6833
6922
|
"w-tooltip--fixed": this.fixed,
|
|
6834
|
-
"w-tooltip--active": this.showTooltip,
|
|
6835
6923
|
"w-tooltip--no-border": this.noBorder || this.bgColor,
|
|
6836
6924
|
"w-tooltip--custom-transition": this.transition
|
|
6837
6925
|
});
|
|
@@ -6839,11 +6927,12 @@ const _sfc_main$8 = {
|
|
|
6839
6927
|
styles() {
|
|
6840
6928
|
return {
|
|
6841
6929
|
zIndex: this.zIndex || this.zIndex === 0 || null,
|
|
6842
|
-
top: `${~~this.
|
|
6843
|
-
left: `${~~this.
|
|
6930
|
+
top: this.detachableCoords.top && `${~~this.detachableCoords.top}px` || null,
|
|
6931
|
+
left: this.detachableCoords.left && `${~~this.detachableCoords.left}px` || null,
|
|
6932
|
+
"--w-tooltip-bg-color": this.$waveui.colors[this.bgColor || "white"]
|
|
6844
6933
|
};
|
|
6845
6934
|
},
|
|
6846
|
-
|
|
6935
|
+
activatorEventHandlers() {
|
|
6847
6936
|
let handlers = {};
|
|
6848
6937
|
if (this.showOnClick)
|
|
6849
6938
|
handlers = { click: this.toggle };
|
|
@@ -6851,10 +6940,16 @@ const _sfc_main$8 = {
|
|
|
6851
6940
|
handlers = {
|
|
6852
6941
|
focus: this.toggle,
|
|
6853
6942
|
blur: this.toggle,
|
|
6854
|
-
mouseenter:
|
|
6855
|
-
|
|
6943
|
+
mouseenter: (e) => {
|
|
6944
|
+
this.hoveringActivator = true;
|
|
6945
|
+
this.open(e);
|
|
6946
|
+
},
|
|
6947
|
+
mouseleave: (e) => {
|
|
6948
|
+
this.hoveringActivator = false;
|
|
6949
|
+
this.close();
|
|
6950
|
+
}
|
|
6856
6951
|
};
|
|
6857
|
-
if ("ontouchstart" in window)
|
|
6952
|
+
if (typeof window !== "undefined" && "ontouchstart" in window)
|
|
6858
6953
|
handlers.click = this.toggle;
|
|
6859
6954
|
}
|
|
6860
6955
|
return handlers;
|
|
@@ -6862,8 +6957,8 @@ const _sfc_main$8 = {
|
|
|
6862
6957
|
},
|
|
6863
6958
|
methods: {
|
|
6864
6959
|
toggle(e) {
|
|
6865
|
-
let shouldShowTooltip = this.
|
|
6866
|
-
if ("ontouchstart" in window) {
|
|
6960
|
+
let shouldShowTooltip = this.detachableVisible;
|
|
6961
|
+
if (typeof window !== "undefined" && "ontouchstart" in window) {
|
|
6867
6962
|
if (e.type === "click")
|
|
6868
6963
|
shouldShowTooltip = !shouldShowTooltip;
|
|
6869
6964
|
} else if (e.type === "click" && this.showOnClick)
|
|
@@ -6873,89 +6968,45 @@ const _sfc_main$8 = {
|
|
|
6873
6968
|
else if (["mouseleave", "blur"].includes(e.type) && !this.showOnClick)
|
|
6874
6969
|
shouldShowTooltip = false;
|
|
6875
6970
|
this.timeoutId = clearTimeout(this.timeoutId);
|
|
6876
|
-
if (shouldShowTooltip)
|
|
6877
|
-
this.
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
this
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6971
|
+
if (shouldShowTooltip)
|
|
6972
|
+
this.open(e);
|
|
6973
|
+
else
|
|
6974
|
+
this.close();
|
|
6975
|
+
},
|
|
6976
|
+
async open(e) {
|
|
6977
|
+
if (this.delay)
|
|
6978
|
+
await new Promise((resolve) => setTimeout(resolve, this.delay));
|
|
6979
|
+
this.detachableVisible = true;
|
|
6980
|
+
if (this.activator)
|
|
6981
|
+
this.activatorEl = e.target;
|
|
6982
|
+
await this.insertInDOM();
|
|
6983
|
+
if (this.minWidth === "activator")
|
|
6984
|
+
this.activatorWidth = this.activatorEl.offsetWidth;
|
|
6985
|
+
if (!this.noPosition)
|
|
6986
|
+
this.computeDetachableCoords(e);
|
|
6987
|
+
this.timeoutId = setTimeout(() => {
|
|
6988
|
+
this.$emit("update:modelValue", true);
|
|
6989
|
+
this.$emit("input", true);
|
|
6990
|
+
this.$emit("open");
|
|
6991
|
+
}, 0);
|
|
6992
|
+
if (!this.persistent)
|
|
6993
|
+
document.addEventListener("mousedown", this.onOutsideMousedown);
|
|
6994
|
+
if (!this.noPosition)
|
|
6995
|
+
window.addEventListener("resize", this.onResize);
|
|
6890
6996
|
},
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
if (
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
const tooltip = this.tooltipEl;
|
|
6899
|
-
tooltip.style.visibility = "hidden";
|
|
6900
|
-
tooltip.style.display = "table";
|
|
6901
|
-
const computedStyles2 = window.getComputedStyle(tooltip, null);
|
|
6902
|
-
if (this.position === "top" && top - tooltip.offsetHeight < 0) {
|
|
6903
|
-
const margin = -parseInt(computedStyles2.getPropertyValue("margin-top"));
|
|
6904
|
-
coords.top -= top - tooltip.offsetHeight - margin - marginFromWindowSide;
|
|
6905
|
-
} else if (this.position === "left" && left - tooltip.offsetWidth < 0) {
|
|
6906
|
-
const margin = -parseInt(computedStyles2.getPropertyValue("margin-left"));
|
|
6907
|
-
coords.left -= left - tooltip.offsetWidth - margin - marginFromWindowSide;
|
|
6908
|
-
} else if (this.position === "right" && left + width + tooltip.offsetWidth > window.innerWidth) {
|
|
6909
|
-
const margin = parseInt(computedStyles2.getPropertyValue("margin-left"));
|
|
6910
|
-
coords.left -= left + width + tooltip.offsetWidth - window.innerWidth + margin + marginFromWindowSide;
|
|
6911
|
-
} else if (this.position === "bottom" && top + height + tooltip.offsetHeight > window.innerHeight) {
|
|
6912
|
-
const margin = parseInt(computedStyles2.getPropertyValue("margin-top"));
|
|
6913
|
-
coords.top -= top + height + tooltip.offsetHeight - window.innerHeight + margin + marginFromWindowSide;
|
|
6914
|
-
}
|
|
6915
|
-
if (this.transition) {
|
|
6916
|
-
if (["top", "bottom"].includes(this.position))
|
|
6917
|
-
coords.left -= tooltip.offsetWidth / 2;
|
|
6918
|
-
if (["left", "right"].includes(this.position))
|
|
6919
|
-
coords.top -= tooltip.offsetHeight / 2;
|
|
6920
|
-
if (this.position === "left")
|
|
6921
|
-
coords.left -= tooltip.offsetWidth;
|
|
6922
|
-
if (this.position === "top")
|
|
6923
|
-
coords.top -= tooltip.offsetHeight;
|
|
6997
|
+
async close(force = false) {
|
|
6998
|
+
if (!this.detachableVisible)
|
|
6999
|
+
return;
|
|
7000
|
+
if (this.showOnHover && !force) {
|
|
7001
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
7002
|
+
if (this.showOnHover && this.hoveringActivator)
|
|
7003
|
+
return;
|
|
6924
7004
|
}
|
|
6925
|
-
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
|
|
6930
|
-
const wrapper = this.$refs.wrapper;
|
|
6931
|
-
wrapper.parentNode.insertBefore(this.activatorEl, wrapper);
|
|
6932
|
-
this.detachToTarget.appendChild(this.tooltipEl);
|
|
6933
|
-
},
|
|
6934
|
-
removeTooltip() {
|
|
6935
|
-
if (this.tooltipEl && this.tooltipEl.parentNode)
|
|
6936
|
-
this.tooltipEl.remove();
|
|
6937
|
-
}
|
|
6938
|
-
},
|
|
6939
|
-
mounted() {
|
|
6940
|
-
this.activatorEl = this.$refs.wrapper.firstElementChild;
|
|
6941
|
-
if (this.detachTo)
|
|
6942
|
-
this.insertTooltip();
|
|
6943
|
-
if (this.modelValue)
|
|
6944
|
-
this.toggle({ type: "click", target: this.activatorEl });
|
|
6945
|
-
},
|
|
6946
|
-
beforeUnmount() {
|
|
6947
|
-
this.removeTooltip();
|
|
6948
|
-
if (this.activatorEl && this.activatorEl.parentNode)
|
|
6949
|
-
this.activatorEl.remove();
|
|
6950
|
-
},
|
|
6951
|
-
watch: {
|
|
6952
|
-
modelValue(bool) {
|
|
6953
|
-
if (bool !== this.showTooltip)
|
|
6954
|
-
this.toggle({ type: "click", target: this.activatorEl });
|
|
6955
|
-
},
|
|
6956
|
-
detachTo() {
|
|
6957
|
-
this.removeTooltip();
|
|
6958
|
-
this.insertTooltip();
|
|
7005
|
+
this.$emit("update:modelValue", this.detachableVisible = false);
|
|
7006
|
+
this.$emit("input", false);
|
|
7007
|
+
this.$emit("close");
|
|
7008
|
+
document.removeEventListener("mousedown", this.onOutsideMousedown);
|
|
7009
|
+
window.removeEventListener("resize", this.onResize);
|
|
6959
7010
|
}
|
|
6960
7011
|
}
|
|
6961
7012
|
};
|