wave-ui 2.39.0 → 2.40.1
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 +132 -142
- package/dist/wave-ui.umd.js +1 -1
- package/package.json +2 -1
- package/src/wave-ui/components/w-app.vue +9 -12
- package/src/wave-ui/components/w-notification.vue +7 -1
- package/src/wave-ui/components/w-tabs/index.vue +2 -0
- package/src/wave-ui/core.js +3 -0
- package/src/wave-ui/utils/dynamic-css.js +26 -31
package/dist/wave-ui.es.js
CHANGED
|
@@ -1,34 +1,5 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
3
|
var __publicField = (obj, key, value) => {
|
|
33
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
34
5
|
return value;
|
|
@@ -92,16 +63,17 @@ const _NotificationManager$1 = class {
|
|
|
92
63
|
};
|
|
93
64
|
}
|
|
94
65
|
notify(...args) {
|
|
95
|
-
let notification =
|
|
66
|
+
let notification = { ...this._notificationDefaults, _uid: this._uid++ };
|
|
96
67
|
if (typeof args[0] === "object")
|
|
97
|
-
notification =
|
|
68
|
+
notification = { ...notification, ...args[0] };
|
|
98
69
|
else {
|
|
99
70
|
const [message, type, timeout] = args;
|
|
100
|
-
notification =
|
|
71
|
+
notification = {
|
|
72
|
+
...notification,
|
|
101
73
|
message: message || "",
|
|
102
74
|
[type === void 0 ? "info" : type]: true,
|
|
103
75
|
timeout: timeout || timeout === 0 ? parseFloat(timeout) : 4e3
|
|
104
|
-
}
|
|
76
|
+
};
|
|
105
77
|
}
|
|
106
78
|
this.notifications.push(notification);
|
|
107
79
|
if (~~notification.timeout !== 0)
|
|
@@ -437,7 +409,8 @@ const _WaveUI = class {
|
|
|
437
409
|
obj[color.label] = color.color;
|
|
438
410
|
color.shades.forEach((shade) => obj[shade.label] = shade.color);
|
|
439
411
|
return obj;
|
|
440
|
-
},
|
|
412
|
+
}, { ...config.colors, black: "#000", white: "#fff", transparent: "transparent", inherit: "inherit" }));
|
|
413
|
+
__publicField(this, "config", {});
|
|
441
414
|
if (_WaveUI.instance)
|
|
442
415
|
return _WaveUI.instance;
|
|
443
416
|
else {
|
|
@@ -463,6 +436,7 @@ const _WaveUI = class {
|
|
|
463
436
|
}
|
|
464
437
|
}
|
|
465
438
|
}
|
|
439
|
+
this.config = config;
|
|
466
440
|
_WaveUI.instance = this;
|
|
467
441
|
app.config.globalProperties.$waveui = reactive(this);
|
|
468
442
|
}
|
|
@@ -660,7 +634,8 @@ const _sfc_main$P = {
|
|
|
660
634
|
},
|
|
661
635
|
updateItems() {
|
|
662
636
|
const items = typeof this.items === "number" ? Array(this.items).fill({}) : this.items || [];
|
|
663
|
-
this.accordionItems = items.map((item, _index) =>
|
|
637
|
+
this.accordionItems = items.map((item, _index) => ({
|
|
638
|
+
...item,
|
|
664
639
|
_index,
|
|
665
640
|
_expanded: this.modelValue && this.modelValue[_index],
|
|
666
641
|
_disabled: !!item.disabled
|
|
@@ -851,7 +826,7 @@ const _sfc_main$N = {
|
|
|
851
826
|
},
|
|
852
827
|
methods: {
|
|
853
828
|
notifProps(notif) {
|
|
854
|
-
const
|
|
829
|
+
const { _value, _uid, message, timeout, ...props } = notif;
|
|
855
830
|
return props;
|
|
856
831
|
}
|
|
857
832
|
},
|
|
@@ -864,57 +839,50 @@ const _sfc_main$N = {
|
|
|
864
839
|
}
|
|
865
840
|
};
|
|
866
841
|
var NotificationManager = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["render", render$N]]);
|
|
867
|
-
const { css: cssConfig } = config;
|
|
868
|
-
const entries = Object.entries(config.breakpoints);
|
|
869
|
-
const breakpoints = entries.map(([label, max], i) => {
|
|
870
|
-
const [, value = 0] = entries[i - 1] || [];
|
|
871
|
-
return { label, min: value ? value + 1 : 0, max };
|
|
872
|
-
});
|
|
873
|
-
let computedStyles = null;
|
|
874
842
|
const cssVars = {
|
|
875
843
|
cssScope: ".w-app",
|
|
876
844
|
baseIncrement: 4
|
|
877
845
|
};
|
|
878
|
-
const generateColors = () => {
|
|
846
|
+
const generateColors = (config2) => {
|
|
879
847
|
let styles = "";
|
|
880
848
|
const { cssScope } = cssVars;
|
|
881
|
-
const
|
|
849
|
+
const { info, warning, success, error, ...colors2 } = config2.colors;
|
|
882
850
|
for (const color in colors2) {
|
|
883
|
-
styles += `${cssScope} .${color}--bg{background-color:${
|
|
851
|
+
styles += `${cssScope} .${color}--bg{background-color:${config2.colors[color]}}${cssScope} .${color}{color:${config2.colors[color]}}`;
|
|
884
852
|
}
|
|
885
|
-
if (
|
|
886
|
-
Object.entries(
|
|
853
|
+
if (config2.css.colorShades && config2.colorShades) {
|
|
854
|
+
Object.entries(config2.colorShades).forEach(([label, color]) => {
|
|
887
855
|
styles += `${cssScope} .${label}--bg{background-color:${color}}${cssScope} .${label}{color:${color}}`;
|
|
888
856
|
});
|
|
889
857
|
}
|
|
890
858
|
const statusColors = { info, warning, success, error };
|
|
891
859
|
for (const color in statusColors) {
|
|
892
|
-
styles += `${cssScope} .${color}--bg{background-color:${
|
|
860
|
+
styles += `${cssScope} .${color}--bg{background-color:${config2.colors[color]}}${cssScope} .${color}{color:${config2.colors[color]}}`;
|
|
893
861
|
}
|
|
894
862
|
const cssVariables = [];
|
|
895
|
-
cssVariables.push(`--primary: ${
|
|
863
|
+
cssVariables.push(`--primary: ${config2.colors.primary}`);
|
|
896
864
|
styles += `:root {${cssVariables.join(";")}}`;
|
|
897
865
|
return styles;
|
|
898
866
|
};
|
|
899
|
-
const generateBreakpoints = () => {
|
|
867
|
+
const generateBreakpoints = (breakpoints, grid) => {
|
|
900
868
|
let styles = "";
|
|
901
869
|
const { cssScope } = cssVars;
|
|
902
870
|
breakpoints.forEach(({ min, label }) => {
|
|
903
871
|
if (label === "xs") {
|
|
904
|
-
for (let i = 0; i <
|
|
905
|
-
styles += `${cssScope} .${label}${
|
|
872
|
+
for (let i = 0; i < grid; i++) {
|
|
873
|
+
styles += `${cssScope} .${label}${grid - i}{width:${parseFloat(((grid - i) * 100 / grid).toFixed(4))}%;}`;
|
|
906
874
|
}
|
|
907
875
|
} else {
|
|
908
876
|
styles += `@media(min-width:${min}px){`;
|
|
909
|
-
for (let i = 0; i <
|
|
910
|
-
styles += `${cssScope} .${label}${
|
|
877
|
+
for (let i = 0; i < grid; i++) {
|
|
878
|
+
styles += `${cssScope} .${label}${grid - i}{width:${parseFloat(((grid - i) * 100 / grid).toFixed(4))}%;}`;
|
|
911
879
|
}
|
|
912
880
|
styles += "}";
|
|
913
881
|
}
|
|
914
882
|
});
|
|
915
883
|
return styles;
|
|
916
884
|
};
|
|
917
|
-
const genBreakpointLayoutClasses = () => {
|
|
885
|
+
const genBreakpointLayoutClasses = (breakpoints) => {
|
|
918
886
|
let styles = "";
|
|
919
887
|
const { cssScope, baseIncrement } = cssVars;
|
|
920
888
|
const layoutClasses = [
|
|
@@ -967,15 +935,20 @@ const genBreakpointLayoutClasses = () => {
|
|
|
967
935
|
});
|
|
968
936
|
return styles;
|
|
969
937
|
};
|
|
970
|
-
var
|
|
971
|
-
|
|
972
|
-
|
|
938
|
+
var dynamicCSS = (config2) => {
|
|
939
|
+
const entries = Object.entries(config2.breakpoints);
|
|
940
|
+
const breakpointsDef2 = entries.map(([label, max], i) => {
|
|
941
|
+
const [, value = 0] = entries[i - 1] || [];
|
|
942
|
+
return { label, min: value ? value + 1 : 0, max };
|
|
943
|
+
});
|
|
944
|
+
const computedStyles = getComputedStyle(document.documentElement);
|
|
973
945
|
cssVars.cssScope = computedStyles.getPropertyValue("--css-scope");
|
|
974
946
|
cssVars.baseIncrement = parseInt(computedStyles.getPropertyValue("--base-increment"));
|
|
975
|
-
styles
|
|
976
|
-
styles +=
|
|
977
|
-
|
|
978
|
-
|
|
947
|
+
let styles = "";
|
|
948
|
+
styles += generateColors(config2);
|
|
949
|
+
styles += generateBreakpoints(breakpointsDef2, config2.css.grid);
|
|
950
|
+
if (config2.css.breakpointLayoutClasses)
|
|
951
|
+
styles += genBreakpointLayoutClasses(breakpointsDef2);
|
|
979
952
|
return styles;
|
|
980
953
|
};
|
|
981
954
|
function render$M(_ctx, _cache, $props, $setup, $data, $options) {
|
|
@@ -988,8 +961,7 @@ function render$M(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
988
961
|
], 2);
|
|
989
962
|
}
|
|
990
963
|
var wApp_vue_vue_type_style_index_0_lang = "";
|
|
991
|
-
|
|
992
|
-
const breakpointsValues = Object.values(config.breakpoints);
|
|
964
|
+
let breakpointsDef = { keys: [], values: [] };
|
|
993
965
|
const _sfc_main$M = {
|
|
994
966
|
name: "w-app",
|
|
995
967
|
props: {
|
|
@@ -1032,10 +1004,10 @@ const _sfc_main$M = {
|
|
|
1032
1004
|
methods: {
|
|
1033
1005
|
getBreakpoint() {
|
|
1034
1006
|
const width = window.innerWidth;
|
|
1035
|
-
const
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
const breakpoint =
|
|
1007
|
+
const breakpoints = breakpointsDef.values.slice(0);
|
|
1008
|
+
breakpoints.push(width);
|
|
1009
|
+
breakpoints.sort((a, b) => a - b);
|
|
1010
|
+
const breakpoint = breakpointsDef.keys[breakpoints.indexOf(width)] || "xl";
|
|
1039
1011
|
if (breakpoint !== this.currentBreakpoint) {
|
|
1040
1012
|
this.currentBreakpoint = breakpoint;
|
|
1041
1013
|
this.$waveui.breakpoint = {
|
|
@@ -1049,16 +1021,15 @@ const _sfc_main$M = {
|
|
|
1049
1021
|
};
|
|
1050
1022
|
}
|
|
1051
1023
|
this.$waveui.breakpoint.width = width;
|
|
1052
|
-
},
|
|
1053
|
-
dynamicStyles() {
|
|
1054
|
-
return DynamicCSS();
|
|
1055
1024
|
}
|
|
1056
1025
|
},
|
|
1057
1026
|
mounted() {
|
|
1027
|
+
const { config: config2 } = this.$waveui;
|
|
1028
|
+
breakpointsDef = { keys: Object.keys(config2.breakpoints), values: Object.values(config2.breakpoints) };
|
|
1058
1029
|
if (!document.getElementById("wave-ui-styles")) {
|
|
1059
1030
|
const css = document.createElement("style");
|
|
1060
1031
|
css.id = "wave-ui-styles";
|
|
1061
|
-
css.innerHTML =
|
|
1032
|
+
css.innerHTML = dynamicCSS(config2);
|
|
1062
1033
|
const firstStyle = document.head.querySelectorAll('style,link[rel="stylesheet"]')[0];
|
|
1063
1034
|
if (firstStyle)
|
|
1064
1035
|
firstStyle.before(css);
|
|
@@ -1338,7 +1309,8 @@ const _sfc_main$J = {
|
|
|
1338
1309
|
return this.hasRouter ? this.$router.resolve(this.route).href : this.route;
|
|
1339
1310
|
},
|
|
1340
1311
|
listeners() {
|
|
1341
|
-
return this.route && this.hasRouter && !this.forceLink && !this.externalLink ?
|
|
1312
|
+
return this.route && this.hasRouter && !this.forceLink && !this.externalLink ? {
|
|
1313
|
+
...this.$attrs,
|
|
1342
1314
|
click: (e) => {
|
|
1343
1315
|
if (this.$attrs.click)
|
|
1344
1316
|
this.$attrs.click(e);
|
|
@@ -1346,7 +1318,7 @@ const _sfc_main$J = {
|
|
|
1346
1318
|
e.stopPropagation();
|
|
1347
1319
|
e.preventDefault();
|
|
1348
1320
|
}
|
|
1349
|
-
}
|
|
1321
|
+
} : this.$attrs;
|
|
1350
1322
|
},
|
|
1351
1323
|
size() {
|
|
1352
1324
|
return this.xs && "xs" || this.sm && "sm" || this.lg && "lg" || this.xl && "xl" || "md";
|
|
@@ -1404,7 +1376,7 @@ function render$I(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1404
1376
|
}, [
|
|
1405
1377
|
_ctx.$slots.title || $props.title ? (openBlock(), createElementBlock("div", {
|
|
1406
1378
|
key: 0,
|
|
1407
|
-
class: normalizeClass(["w-card__title",
|
|
1379
|
+
class: normalizeClass(["w-card__title", { "w-card__title--has-toolbar": _ctx.$slots.title && $options.titleHasToolbar, ...$options.titleClasses }])
|
|
1408
1380
|
}, [
|
|
1409
1381
|
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
1410
1382
|
createTextVNode(toDisplayString($props.title), 1)
|
|
@@ -1465,10 +1437,11 @@ const _sfc_main$I = {
|
|
|
1465
1437
|
return actions && actions().map((vnode) => vnode.type.name).join("").includes("w-toolbar");
|
|
1466
1438
|
},
|
|
1467
1439
|
imgProps() {
|
|
1468
|
-
return
|
|
1440
|
+
return {
|
|
1469
1441
|
tag: "div",
|
|
1470
|
-
ratio: 1 / 2
|
|
1471
|
-
|
|
1442
|
+
ratio: 1 / 2,
|
|
1443
|
+
...this.imageProps
|
|
1444
|
+
};
|
|
1472
1445
|
},
|
|
1473
1446
|
classes() {
|
|
1474
1447
|
return {
|
|
@@ -1735,13 +1708,14 @@ const _sfc_main$G = {
|
|
|
1735
1708
|
checkboxItems() {
|
|
1736
1709
|
return (this.items || []).map((item, i) => {
|
|
1737
1710
|
const itemValue = item[this.itemValueKey] === void 0 ? item[this.itemLabelKey] || i : item[this.itemValueKey];
|
|
1738
|
-
return reactive(
|
|
1711
|
+
return reactive({
|
|
1712
|
+
...item,
|
|
1739
1713
|
label: item[this.itemLabelKey],
|
|
1740
1714
|
_index: i,
|
|
1741
1715
|
value: itemValue,
|
|
1742
1716
|
color: item[this.itemColorKey] || this.color,
|
|
1743
1717
|
_isChecked: this.modelValue && this.modelValue.includes(itemValue)
|
|
1744
|
-
})
|
|
1718
|
+
});
|
|
1745
1719
|
});
|
|
1746
1720
|
},
|
|
1747
1721
|
classes() {
|
|
@@ -1780,7 +1754,7 @@ function render$F(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1780
1754
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.showPopup = $event)
|
|
1781
1755
|
}, $options.wMenuProps), {
|
|
1782
1756
|
activator: withCtx(({ on }) => [
|
|
1783
|
-
createVNode(_component_w_button, mergeProps({ class: "w-confirm__button" },
|
|
1757
|
+
createVNode(_component_w_button, mergeProps({ class: "w-confirm__button" }, { ..._ctx.$attrs, ...$options.buttonProps, ...on }), {
|
|
1784
1758
|
default: withCtx(() => [
|
|
1785
1759
|
renderSlot(_ctx.$slots, "default")
|
|
1786
1760
|
]),
|
|
@@ -1872,7 +1846,7 @@ const _sfc_main$F = {
|
|
|
1872
1846
|
return button;
|
|
1873
1847
|
},
|
|
1874
1848
|
cancelButtonProps() {
|
|
1875
|
-
const
|
|
1849
|
+
const { label, ...props } = this.cancelButton;
|
|
1876
1850
|
return props;
|
|
1877
1851
|
},
|
|
1878
1852
|
confirmButton() {
|
|
@@ -1882,11 +1856,11 @@ const _sfc_main$F = {
|
|
|
1882
1856
|
return button;
|
|
1883
1857
|
},
|
|
1884
1858
|
confirmButtonProps() {
|
|
1885
|
-
const
|
|
1859
|
+
const { label, ...props } = this.confirmButton;
|
|
1886
1860
|
return props;
|
|
1887
1861
|
},
|
|
1888
1862
|
wMenuProps() {
|
|
1889
|
-
return
|
|
1863
|
+
return {
|
|
1890
1864
|
top: this.top,
|
|
1891
1865
|
bottom: this.bottom,
|
|
1892
1866
|
left: this.left,
|
|
@@ -1897,15 +1871,17 @@ const _sfc_main$F = {
|
|
|
1897
1871
|
alignLeft: this.alignLeft,
|
|
1898
1872
|
alignRight: this.alignRight,
|
|
1899
1873
|
persistent: this.persistent,
|
|
1900
|
-
transition: this.transition
|
|
1901
|
-
|
|
1874
|
+
transition: this.transition,
|
|
1875
|
+
...this.menu
|
|
1876
|
+
};
|
|
1902
1877
|
},
|
|
1903
1878
|
buttonProps() {
|
|
1904
|
-
return
|
|
1879
|
+
return {
|
|
1905
1880
|
bgColor: this.bgColor,
|
|
1906
1881
|
color: this.color,
|
|
1907
|
-
icon: this.icon
|
|
1908
|
-
|
|
1882
|
+
icon: this.icon,
|
|
1883
|
+
...this.mainButton
|
|
1884
|
+
};
|
|
1909
1885
|
}
|
|
1910
1886
|
},
|
|
1911
1887
|
methods: {
|
|
@@ -2671,7 +2647,10 @@ const _sfc_main$x = {
|
|
|
2671
2647
|
return obj;
|
|
2672
2648
|
}, {});
|
|
2673
2649
|
}
|
|
2674
|
-
return
|
|
2650
|
+
return {
|
|
2651
|
+
...breakpointsColumns || { [`columns${this.columns}`]: this.columns },
|
|
2652
|
+
...breakpointsGap || { [`gap${this.gap}`]: this.gap }
|
|
2653
|
+
};
|
|
2675
2654
|
}
|
|
2676
2655
|
}
|
|
2677
2656
|
};
|
|
@@ -3182,15 +3161,15 @@ const _sfc_main$u = {
|
|
|
3182
3161
|
},
|
|
3183
3162
|
computed: {
|
|
3184
3163
|
attrs() {
|
|
3185
|
-
const
|
|
3164
|
+
const { class: classes, ...attrs } = this.$attrs;
|
|
3186
3165
|
return attrs;
|
|
3187
3166
|
},
|
|
3188
3167
|
listeners() {
|
|
3189
|
-
const
|
|
3168
|
+
const { input, focus, blur, ...listeners } = this.$attrs;
|
|
3190
3169
|
return listeners;
|
|
3191
3170
|
},
|
|
3192
3171
|
attrs() {
|
|
3193
|
-
const
|
|
3172
|
+
const { class: Class, ...htmlAttrs } = this.$attrs;
|
|
3194
3173
|
return htmlAttrs;
|
|
3195
3174
|
},
|
|
3196
3175
|
hasValue() {
|
|
@@ -3606,7 +3585,7 @@ const _sfc_main$t = {
|
|
|
3606
3585
|
const items = this.selectedItems.map((item) => {
|
|
3607
3586
|
if (!this.returnObject)
|
|
3608
3587
|
return item._value;
|
|
3609
|
-
const
|
|
3588
|
+
const { _value, _selected, ...Item } = item;
|
|
3610
3589
|
return Item;
|
|
3611
3590
|
});
|
|
3612
3591
|
const selection = this.isMultipleSelect ? items : items[0] !== void 0 ? items[0] : null;
|
|
@@ -3621,12 +3600,13 @@ const _sfc_main$t = {
|
|
|
3621
3600
|
this.$el.querySelector(`#${this.listId}_item-${index2 + 1}`).focus();
|
|
3622
3601
|
},
|
|
3623
3602
|
cleanLi(li) {
|
|
3624
|
-
const
|
|
3603
|
+
const { _index, _value, _label, _selected, _focused, ...cleanLi } = li;
|
|
3625
3604
|
return cleanLi;
|
|
3626
3605
|
},
|
|
3627
3606
|
refreshListItems() {
|
|
3628
3607
|
const items = typeof this.items === "number" ? Array(this.items).fill({}) : this.items || [];
|
|
3629
|
-
this.listItems = items.map((item, i) =>
|
|
3608
|
+
this.listItems = items.map((item, i) => ({
|
|
3609
|
+
...item,
|
|
3630
3610
|
_index: i,
|
|
3631
3611
|
_value: item[this.itemValueKey] === void 0 ? item[this.itemLabelKey] || i : item[this.itemValueKey],
|
|
3632
3612
|
_selected: item._selected || false,
|
|
@@ -3773,11 +3753,12 @@ var DetachableMixin = {
|
|
|
3773
3753
|
let coords = { top, left, width, height };
|
|
3774
3754
|
if (!this.fixed) {
|
|
3775
3755
|
const { top: targetTop, left: targetLeft } = this.detachableParentEl.getBoundingClientRect();
|
|
3776
|
-
const
|
|
3777
|
-
coords =
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3756
|
+
const computedStyles = window.getComputedStyle(this.detachableParentEl, null);
|
|
3757
|
+
coords = {
|
|
3758
|
+
...coords,
|
|
3759
|
+
top: top - targetTop + this.detachableParentEl.scrollTop - parseInt(computedStyles.getPropertyValue("border-top-width")),
|
|
3760
|
+
left: left - targetLeft + this.detachableParentEl.scrollLeft - parseInt(computedStyles.getPropertyValue("border-left-width"))
|
|
3761
|
+
};
|
|
3781
3762
|
}
|
|
3782
3763
|
return coords;
|
|
3783
3764
|
},
|
|
@@ -3787,12 +3768,12 @@ var DetachableMixin = {
|
|
|
3787
3768
|
return;
|
|
3788
3769
|
this.detachableEl.style.visibility = "hidden";
|
|
3789
3770
|
this.detachableEl.style.display = "flex";
|
|
3790
|
-
const
|
|
3771
|
+
const computedStyles = window.getComputedStyle(this.detachableEl, null);
|
|
3791
3772
|
switch (this.position) {
|
|
3792
3773
|
case "top": {
|
|
3793
3774
|
top -= this.detachableEl.offsetHeight;
|
|
3794
3775
|
if (this.alignRight) {
|
|
3795
|
-
left += width - this.detachableEl.offsetWidth + parseInt(
|
|
3776
|
+
left += width - this.detachableEl.offsetWidth + parseInt(computedStyles.getPropertyValue("border-right-width"));
|
|
3796
3777
|
} else if (!this.alignLeft)
|
|
3797
3778
|
left += (width - this.detachableEl.offsetWidth) / 2;
|
|
3798
3779
|
break;
|
|
@@ -3800,7 +3781,7 @@ var DetachableMixin = {
|
|
|
3800
3781
|
case "bottom": {
|
|
3801
3782
|
top += height;
|
|
3802
3783
|
if (this.alignRight) {
|
|
3803
|
-
left += width - this.detachableEl.offsetWidth + parseInt(
|
|
3784
|
+
left += width - this.detachableEl.offsetWidth + parseInt(computedStyles.getPropertyValue("border-right-width"));
|
|
3804
3785
|
} else if (!this.alignLeft)
|
|
3805
3786
|
left += (width - this.detachableEl.offsetWidth) / 2;
|
|
3806
3787
|
break;
|
|
@@ -3816,9 +3797,9 @@ var DetachableMixin = {
|
|
|
3816
3797
|
case "right": {
|
|
3817
3798
|
left += width;
|
|
3818
3799
|
if (this.alignBottom) {
|
|
3819
|
-
top += height - this.detachableEl.offsetHeight + parseInt(
|
|
3800
|
+
top += height - this.detachableEl.offsetHeight + parseInt(computedStyles.getPropertyValue("margin-top"));
|
|
3820
3801
|
} else if (!this.alignTop) {
|
|
3821
|
-
top += (height - this.detachableEl.offsetHeight) / 2 + parseInt(
|
|
3802
|
+
top += (height - this.detachableEl.offsetHeight) / 2 + parseInt(computedStyles.getPropertyValue("margin-top"));
|
|
3822
3803
|
}
|
|
3823
3804
|
break;
|
|
3824
3805
|
}
|
|
@@ -4054,15 +4035,16 @@ const _sfc_main$s = {
|
|
|
4054
4035
|
return objectifyClasses(this.contentClass);
|
|
4055
4036
|
},
|
|
4056
4037
|
overlayClasses() {
|
|
4057
|
-
return
|
|
4038
|
+
return {
|
|
4039
|
+
...objectifyClasses(this.overlayClass),
|
|
4058
4040
|
"w-overlay--no-pointer-event": this.showOnHover
|
|
4059
|
-
}
|
|
4041
|
+
};
|
|
4060
4042
|
},
|
|
4061
4043
|
classes() {
|
|
4062
|
-
return
|
|
4044
|
+
return {
|
|
4063
4045
|
[this.color]: this.color,
|
|
4064
|
-
[`${this.bgColor}--bg`]: this.bgColor
|
|
4065
|
-
|
|
4046
|
+
[`${this.bgColor}--bg`]: this.bgColor,
|
|
4047
|
+
...this.menuClasses,
|
|
4066
4048
|
[`w-menu--${this.position}`]: !this.noPosition,
|
|
4067
4049
|
[`w-menu--align-${this.alignment}`]: !this.noPosition && this.alignment,
|
|
4068
4050
|
"w-menu--tile": this.tile,
|
|
@@ -4071,7 +4053,7 @@ const _sfc_main$s = {
|
|
|
4071
4053
|
"w-menu--arrow": this.arrow,
|
|
4072
4054
|
"w-menu--shadow": this.shadow,
|
|
4073
4055
|
"w-menu--fixed": this.fixed
|
|
4074
|
-
}
|
|
4056
|
+
};
|
|
4075
4057
|
},
|
|
4076
4058
|
styles() {
|
|
4077
4059
|
return {
|
|
@@ -4157,7 +4139,8 @@ function render$r(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4157
4139
|
class: normalizeClass(["w-notification", $options.classes]),
|
|
4158
4140
|
style: normalizeStyle($options.styles)
|
|
4159
4141
|
}, [
|
|
4160
|
-
createVNode(_component_w_alert, mergeProps(
|
|
4142
|
+
createVNode(_component_w_alert, mergeProps($options.alertProps, {
|
|
4143
|
+
class: $options.alertClasses,
|
|
4161
4144
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => {
|
|
4162
4145
|
_ctx.$emit("update:modelValue", false);
|
|
4163
4146
|
_ctx.$emit("input", false);
|
|
@@ -4167,7 +4150,7 @@ function render$r(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4167
4150
|
renderSlot(_ctx.$slots, "default")
|
|
4168
4151
|
]),
|
|
4169
4152
|
_: 3
|
|
4170
|
-
}, 16)
|
|
4153
|
+
}, 16, ["class"])
|
|
4171
4154
|
], 6)) : createCommentVNode("", true)
|
|
4172
4155
|
]),
|
|
4173
4156
|
_: 3
|
|
@@ -4274,6 +4257,11 @@ const _sfc_main$r = {
|
|
|
4274
4257
|
[`w-notification--${this.position.join(" w-notification--")}`]: true
|
|
4275
4258
|
};
|
|
4276
4259
|
},
|
|
4260
|
+
alertClasses() {
|
|
4261
|
+
if (this.bgColor || (this.success || this.info || this.warning || this.error) && this.plain)
|
|
4262
|
+
return null;
|
|
4263
|
+
return "white--bg";
|
|
4264
|
+
},
|
|
4277
4265
|
styles() {
|
|
4278
4266
|
return {
|
|
4279
4267
|
zIndex: this.zIndex || this.zIndex === 0 || null
|
|
@@ -4740,7 +4728,8 @@ const _sfc_main$m = {
|
|
|
4740
4728
|
}),
|
|
4741
4729
|
computed: {
|
|
4742
4730
|
radioItems() {
|
|
4743
|
-
return (this.items || []).map((item, i) =>
|
|
4731
|
+
return (this.items || []).map((item, i) => ({
|
|
4732
|
+
...item,
|
|
4744
4733
|
_index: i,
|
|
4745
4734
|
label: item[this.itemLabelKey],
|
|
4746
4735
|
value: item[this.itemValueKey] === void 0 ? item[this.itemLabelKey] || i : item[this.itemValueKey],
|
|
@@ -5145,7 +5134,7 @@ const _sfc_main$k = {
|
|
|
5145
5134
|
computed: {
|
|
5146
5135
|
selectItems() {
|
|
5147
5136
|
return this.items.map((item, i) => {
|
|
5148
|
-
const obj =
|
|
5137
|
+
const obj = { ...item };
|
|
5149
5138
|
obj.value = obj[this.itemValueKey] === void 0 ? obj[this.itemLabelKey] || i : obj[this.itemValueKey];
|
|
5150
5139
|
obj.index = i;
|
|
5151
5140
|
return obj;
|
|
@@ -5941,10 +5930,11 @@ const _sfc_main$e = {
|
|
|
5941
5930
|
},
|
|
5942
5931
|
tabsItems() {
|
|
5943
5932
|
const items = typeof this.items === "number" ? Array(this.items).fill({}) : this.items;
|
|
5944
|
-
return items.map((item, _index) => reactive(
|
|
5933
|
+
return items.map((item, _index) => reactive({
|
|
5934
|
+
...item,
|
|
5945
5935
|
_index,
|
|
5946
5936
|
_disabled: !!item.disabled
|
|
5947
|
-
}))
|
|
5937
|
+
}));
|
|
5948
5938
|
},
|
|
5949
5939
|
activeTab() {
|
|
5950
5940
|
return this.tabsItems[this.activeTabIndex] || this.tabsItems[0] || {};
|
|
@@ -6798,7 +6788,7 @@ const _sfc_main$b = {
|
|
|
6798
6788
|
},
|
|
6799
6789
|
computed: {
|
|
6800
6790
|
listeners() {
|
|
6801
|
-
const
|
|
6791
|
+
const { input, focus, blur, ...listeners } = this.$attrs;
|
|
6802
6792
|
return listeners;
|
|
6803
6793
|
},
|
|
6804
6794
|
hasValue() {
|
|
@@ -6867,10 +6857,10 @@ const _sfc_main$b = {
|
|
|
6867
6857
|
this.$refs.textarea.style.height = height + "px";
|
|
6868
6858
|
},
|
|
6869
6859
|
getLineHeight() {
|
|
6870
|
-
const
|
|
6871
|
-
this.lineHeight = parseFloat(
|
|
6872
|
-
this.paddingY = parseFloat(
|
|
6873
|
-
this.paddingY += parseFloat(
|
|
6860
|
+
const computedStyles = window.getComputedStyle(this.$refs.textarea, null);
|
|
6861
|
+
this.lineHeight = parseFloat(computedStyles.getPropertyValue("line-height"));
|
|
6862
|
+
this.paddingY = parseFloat(computedStyles.getPropertyValue("padding-top"));
|
|
6863
|
+
this.paddingY += parseFloat(computedStyles.getPropertyValue("padding-bottom"));
|
|
6874
6864
|
}
|
|
6875
6865
|
},
|
|
6876
6866
|
mounted() {
|
|
@@ -7069,10 +7059,10 @@ const _sfc_main$8 = {
|
|
|
7069
7059
|
return this.transition || `w-tooltip-slide-fade-${direction}`;
|
|
7070
7060
|
},
|
|
7071
7061
|
classes() {
|
|
7072
|
-
return
|
|
7062
|
+
return {
|
|
7073
7063
|
[this.color]: this.color,
|
|
7074
|
-
[`${this.bgColor}--bg`]: this.bgColor
|
|
7075
|
-
|
|
7064
|
+
[`${this.bgColor}--bg`]: this.bgColor,
|
|
7065
|
+
...this.tooltipClasses,
|
|
7076
7066
|
[`w-tooltip--${this.position}`]: !this.noPosition,
|
|
7077
7067
|
[`w-tooltip--align-${this.alignment}`]: !this.noPosition && this.alignment,
|
|
7078
7068
|
"w-tooltip--tile": this.tile,
|
|
@@ -7081,7 +7071,7 @@ const _sfc_main$8 = {
|
|
|
7081
7071
|
"w-tooltip--fixed": this.fixed,
|
|
7082
7072
|
"w-tooltip--no-border": this.noBorder || this.bgColor,
|
|
7083
7073
|
"w-tooltip--custom-transition": this.transition
|
|
7084
|
-
}
|
|
7074
|
+
};
|
|
7085
7075
|
},
|
|
7086
7076
|
styles() {
|
|
7087
7077
|
return {
|
|
@@ -7314,24 +7304,24 @@ const _sfc_main$6 = {
|
|
|
7314
7304
|
this.el.originalStyles = el.style.cssText;
|
|
7315
7305
|
},
|
|
7316
7306
|
show(el, done) {
|
|
7317
|
-
const
|
|
7307
|
+
const computedStyles = window.getComputedStyle(el, null);
|
|
7318
7308
|
if (this.animX) {
|
|
7319
7309
|
this.el.width = el.offsetWidth;
|
|
7320
|
-
this.el.marginLeft =
|
|
7321
|
-
this.el.marginRight =
|
|
7322
|
-
this.el.paddingLeft =
|
|
7323
|
-
this.el.paddingRight =
|
|
7324
|
-
this.el.borderLeftWidth =
|
|
7325
|
-
this.el.borderRightWidth =
|
|
7310
|
+
this.el.marginLeft = computedStyles.getPropertyValue("marginLeft");
|
|
7311
|
+
this.el.marginRight = computedStyles.getPropertyValue("marginRight");
|
|
7312
|
+
this.el.paddingLeft = computedStyles.getPropertyValue("paddingLeft");
|
|
7313
|
+
this.el.paddingRight = computedStyles.getPropertyValue("paddingRight");
|
|
7314
|
+
this.el.borderLeftWidth = computedStyles.getPropertyValue("borderLeftWidth");
|
|
7315
|
+
this.el.borderRightWidth = computedStyles.getPropertyValue("borderRightWidth");
|
|
7326
7316
|
}
|
|
7327
7317
|
if (this.animY) {
|
|
7328
7318
|
this.el.height = el.offsetHeight;
|
|
7329
|
-
this.el.marginTop =
|
|
7330
|
-
this.el.marginBottom =
|
|
7331
|
-
this.el.paddingTop =
|
|
7332
|
-
this.el.paddingBottom =
|
|
7333
|
-
this.el.borderTopWidth =
|
|
7334
|
-
this.el.borderBottomWidth =
|
|
7319
|
+
this.el.marginTop = computedStyles.getPropertyValue("marginTop");
|
|
7320
|
+
this.el.marginBottom = computedStyles.getPropertyValue("marginBottom");
|
|
7321
|
+
this.el.paddingTop = computedStyles.getPropertyValue("paddingTop");
|
|
7322
|
+
this.el.paddingBottom = computedStyles.getPropertyValue("paddingBottom");
|
|
7323
|
+
this.el.borderTopWidth = computedStyles.getPropertyValue("borderTopWidth");
|
|
7324
|
+
this.el.borderBottomWidth = computedStyles.getPropertyValue("borderBottomWidth");
|
|
7335
7325
|
}
|
|
7336
7326
|
this.applyHideStyles(el);
|
|
7337
7327
|
setTimeout(() => this.applyShowStyles(el), 20);
|
|
@@ -7521,5 +7511,5 @@ var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
|
|
|
7521
7511
|
WTransitionTwist: wTransitionTwist
|
|
7522
7512
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7523
7513
|
const install = WaveUI.install;
|
|
7524
|
-
WaveUI.install = (app, options = {}) => install.call(WaveUI, app,
|
|
7514
|
+
WaveUI.install = (app, options = {}) => install.call(WaveUI, app, { components, ...options });
|
|
7525
7515
|
export { WaveUI as default };
|