@fastkit/vui 0.19.33 → 0.19.34
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/vui.mjs +78 -156
- package/dist/vui.mjs.map +1 -1
- package/package.json +18 -18
package/dist/vui.mjs
CHANGED
|
@@ -238,8 +238,7 @@ function createControlProps() {
|
|
|
238
238
|
size: {
|
|
239
239
|
type: String,
|
|
240
240
|
validator: (value) => {
|
|
241
|
-
if (value == null)
|
|
242
|
-
return true;
|
|
241
|
+
if (value == null) return true;
|
|
243
242
|
return CONTROL_SIZES.includes(value);
|
|
244
243
|
}
|
|
245
244
|
},
|
|
@@ -267,8 +266,7 @@ function createControlFieldProviderProps() {
|
|
|
267
266
|
variant: {
|
|
268
267
|
type: String,
|
|
269
268
|
validator: (value) => {
|
|
270
|
-
if (value == null)
|
|
271
|
-
return true;
|
|
269
|
+
if (value == null) return true;
|
|
272
270
|
return CONTROL_FIELD_VARIANTS.includes(value);
|
|
273
271
|
}
|
|
274
272
|
}
|
|
@@ -293,8 +291,7 @@ function rawIconProp() {
|
|
|
293
291
|
return _rawIconProp;
|
|
294
292
|
}
|
|
295
293
|
function resolveRawIconProp(payload, prop, extraProps) {
|
|
296
|
-
if (!prop)
|
|
297
|
-
return;
|
|
294
|
+
if (!prop) return;
|
|
298
295
|
return typeof prop === "function" ? prop((input) => createVNode(VIcon, mergeProps(input, extraProps), null), payload) : createVNode(VIcon, mergeProps(extraProps, {
|
|
299
296
|
"name": prop
|
|
300
297
|
}), null);
|
|
@@ -397,14 +394,12 @@ var {
|
|
|
397
394
|
} = createFormNodeWrapperSettings();
|
|
398
395
|
function createRequiredChipRenderer(required, props12, vui = useVui()) {
|
|
399
396
|
return () => {
|
|
400
|
-
if (!required())
|
|
401
|
-
return;
|
|
397
|
+
if (!required()) return;
|
|
402
398
|
let chip;
|
|
403
399
|
const {
|
|
404
400
|
requiredChip
|
|
405
401
|
} = props12;
|
|
406
|
-
if (requiredChip === false)
|
|
407
|
-
return;
|
|
402
|
+
if (requiredChip === false) return;
|
|
408
403
|
if (requiredChip) {
|
|
409
404
|
if (typeof requiredChip === "string") {
|
|
410
405
|
chip = requiredChip;
|
|
@@ -894,8 +889,7 @@ function splitAttrs(attrs) {
|
|
|
894
889
|
var NUMBERISH_PROP = [Number, String];
|
|
895
890
|
var DEFAULT_HEIGHT = 150;
|
|
896
891
|
var resolveBusyImageSizeValue = (source) => {
|
|
897
|
-
if (source == null)
|
|
898
|
-
return;
|
|
892
|
+
if (source == null) return;
|
|
899
893
|
return isNaN(source) ? String(source) : `${source}px`;
|
|
900
894
|
};
|
|
901
895
|
var slots3 = defineSlots();
|
|
@@ -977,8 +971,7 @@ var VBusyImage = defineComponent({
|
|
|
977
971
|
let booted = false;
|
|
978
972
|
const mounted = ref(false);
|
|
979
973
|
watch(() => [ctx.attrs.src, mounted.value], ([src, _mounted]) => {
|
|
980
|
-
if (!_mounted)
|
|
981
|
-
return;
|
|
974
|
+
if (!_mounted) return;
|
|
982
975
|
coverImageRef.value = void 0;
|
|
983
976
|
if (isAvailableSrc(src)) {
|
|
984
977
|
loadStateRef.value = "loading";
|
|
@@ -1008,11 +1001,9 @@ var VBusyImage = defineComponent({
|
|
|
1008
1001
|
};
|
|
1009
1002
|
onMounted(() => {
|
|
1010
1003
|
mounted.value = true;
|
|
1011
|
-
if (booted || props12.cover)
|
|
1012
|
-
return;
|
|
1004
|
+
if (booted || props12.cover) return;
|
|
1013
1005
|
const image = nodeRef.value;
|
|
1014
|
-
if (!image)
|
|
1015
|
-
return;
|
|
1006
|
+
if (!image) return;
|
|
1016
1007
|
const loadType = imageIsReady(image);
|
|
1017
1008
|
if (loadType) {
|
|
1018
1009
|
setManualState(loadType);
|
|
@@ -1063,8 +1054,7 @@ var VBusyImage = defineComponent({
|
|
|
1063
1054
|
}
|
|
1064
1055
|
});
|
|
1065
1056
|
function imageIsReady(image) {
|
|
1066
|
-
if (!image.complete)
|
|
1067
|
-
return false;
|
|
1057
|
+
if (!image.complete) return false;
|
|
1068
1058
|
return image.naturalWidth + image.naturalHeight > 0 ? "load" : "error";
|
|
1069
1059
|
}
|
|
1070
1060
|
function isAvailableSrc(src) {
|
|
@@ -1315,8 +1305,7 @@ var VAvatar = defineComponent({
|
|
|
1315
1305
|
const {
|
|
1316
1306
|
size
|
|
1317
1307
|
} = props12;
|
|
1318
|
-
if (typeof size !== "number")
|
|
1319
|
-
return;
|
|
1308
|
+
if (typeof size !== "number") return;
|
|
1320
1309
|
return {
|
|
1321
1310
|
"--avatar-size": `${size}px`
|
|
1322
1311
|
};
|
|
@@ -1357,13 +1346,11 @@ function createChipProps() {
|
|
|
1357
1346
|
};
|
|
1358
1347
|
}
|
|
1359
1348
|
function resolveRawVChipIcon(raw, type) {
|
|
1360
|
-
if (!raw)
|
|
1361
|
-
return;
|
|
1349
|
+
if (!raw) return;
|
|
1362
1350
|
if (typeof raw === "function") {
|
|
1363
1351
|
return () => {
|
|
1364
1352
|
const child = raw();
|
|
1365
|
-
if (child == null)
|
|
1366
|
-
return;
|
|
1353
|
+
if (child == null) return;
|
|
1367
1354
|
return createVNode("span", {
|
|
1368
1355
|
"class": ["v-chip__icon", `v-chip__icon--${type}`]
|
|
1369
1356
|
}, [child]);
|
|
@@ -1467,8 +1454,7 @@ var VCardActions = defineComponent({
|
|
|
1467
1454
|
});
|
|
1468
1455
|
var BUTTON_ALIGNS = ["left", "center", "right"];
|
|
1469
1456
|
function resolveRawVButtonIcon(raw, type = "main") {
|
|
1470
|
-
if (!raw)
|
|
1471
|
-
return;
|
|
1457
|
+
if (!raw) return;
|
|
1472
1458
|
return typeof raw === "function" ? raw : () => createVNode(VIcon, {
|
|
1473
1459
|
"class": ["v-button__icon", `v-button__icon--${type}`],
|
|
1474
1460
|
"name": raw
|
|
@@ -1521,8 +1507,7 @@ var VButton = defineComponent({
|
|
|
1521
1507
|
const isLoading = computed(() => props12.loading);
|
|
1522
1508
|
const spacer = computed(() => {
|
|
1523
1509
|
const _spacer = props12.spacer;
|
|
1524
|
-
if (!_spacer)
|
|
1525
|
-
return;
|
|
1510
|
+
if (!_spacer) return;
|
|
1526
1511
|
return _spacer === true ? "left" : _spacer;
|
|
1527
1512
|
});
|
|
1528
1513
|
const classes = computed(() => [color.colorClasses.value, spacer.value ? `v-button--spacer-${spacer.value}` : void 0, `v-button--${control.size.value}`, `v-button--align-${props12.align}`, {
|
|
@@ -1661,8 +1646,7 @@ var VPagination = defineComponent({
|
|
|
1661
1646
|
const itemSize = ref(0);
|
|
1662
1647
|
const capacityLength = computed(() => {
|
|
1663
1648
|
const _itemSize = itemSize.value;
|
|
1664
|
-
if (!_itemSize)
|
|
1665
|
-
return 0;
|
|
1649
|
+
if (!_itemSize) return 0;
|
|
1666
1650
|
return Math.floor(containerWidth.value / _itemSize);
|
|
1667
1651
|
});
|
|
1668
1652
|
const colorScope = useScopeColorClass({
|
|
@@ -1729,22 +1713,18 @@ var VPagination = defineComponent({
|
|
|
1729
1713
|
[`v-pagination--${props12.align}`]: true
|
|
1730
1714
|
}, colorScope.value.className]);
|
|
1731
1715
|
async function setPage(value) {
|
|
1732
|
-
if (isDisabled.value)
|
|
1733
|
-
return;
|
|
1716
|
+
if (isDisabled.value) return;
|
|
1734
1717
|
const {
|
|
1735
1718
|
beforeChange,
|
|
1736
1719
|
routeQuery
|
|
1737
1720
|
} = props12;
|
|
1738
1721
|
const newPage = resolveNumberish(value);
|
|
1739
|
-
if (computedPage.value === newPage)
|
|
1740
|
-
return;
|
|
1722
|
+
if (computedPage.value === newPage) return;
|
|
1741
1723
|
if (beforeChange) {
|
|
1742
1724
|
try {
|
|
1743
1725
|
let result = beforeChange(newPage);
|
|
1744
|
-
if (isPromise(result))
|
|
1745
|
-
|
|
1746
|
-
if (result === false)
|
|
1747
|
-
return;
|
|
1726
|
+
if (isPromise(result)) result = await result;
|
|
1727
|
+
if (result === false) return;
|
|
1748
1728
|
} catch (e) {
|
|
1749
1729
|
}
|
|
1750
1730
|
}
|
|
@@ -1819,8 +1799,7 @@ var VPagination = defineComponent({
|
|
|
1819
1799
|
})();
|
|
1820
1800
|
const onClick = (ev) => {
|
|
1821
1801
|
ev.preventDefault();
|
|
1822
|
-
if (page === void 0 || active || disabled)
|
|
1823
|
-
return;
|
|
1802
|
+
if (page === void 0 || active || disabled) return;
|
|
1824
1803
|
setPage(page);
|
|
1825
1804
|
};
|
|
1826
1805
|
const key = `${source}-${index}`;
|
|
@@ -1851,8 +1830,7 @@ var VPagination = defineComponent({
|
|
|
1851
1830
|
immediate: true
|
|
1852
1831
|
});
|
|
1853
1832
|
return () => {
|
|
1854
|
-
if (!isActive.value)
|
|
1855
|
-
return void 0;
|
|
1833
|
+
if (!isActive.value) return void 0;
|
|
1856
1834
|
const $items = ["prev", ...computedItems.value, "next"].map((i, index) => genItem(i, index));
|
|
1857
1835
|
return withDirectives(createVNode("nav", {
|
|
1858
1836
|
"class": ["v-pagination", classes.value],
|
|
@@ -1915,8 +1893,7 @@ var VListTile = defineComponent({
|
|
|
1915
1893
|
to: ctx.attrs.to || ""
|
|
1916
1894
|
});
|
|
1917
1895
|
const isActive = computed(() => {
|
|
1918
|
-
if (!hasTo.value)
|
|
1919
|
-
return false;
|
|
1896
|
+
if (!hasTo.value) return false;
|
|
1920
1897
|
return props12.exactMatch ? link.isExactActive.value : link.isActive.value;
|
|
1921
1898
|
});
|
|
1922
1899
|
const color = useScopeColorClass(props12);
|
|
@@ -2104,11 +2081,9 @@ var VNavigationItem = defineComponent({
|
|
|
2104
2081
|
if (match2) {
|
|
2105
2082
|
return (Array.isArray(match2) ? match2 : [match2]).map(trimEndSlash);
|
|
2106
2083
|
}
|
|
2107
|
-
if (!to2)
|
|
2108
|
-
return;
|
|
2084
|
+
if (!to2) return;
|
|
2109
2085
|
const toPath = typeof to2 === "string" ? to2 : to2.path;
|
|
2110
|
-
if (!toPath)
|
|
2111
|
-
return;
|
|
2086
|
+
if (!toPath) return;
|
|
2112
2087
|
return [trimEndSlash(toPath)];
|
|
2113
2088
|
});
|
|
2114
2089
|
const classes = computed(() => [{
|
|
@@ -2156,8 +2131,7 @@ var VNavigationItem = defineComponent({
|
|
|
2156
2131
|
};
|
|
2157
2132
|
});
|
|
2158
2133
|
function open() {
|
|
2159
|
-
if (!children.value)
|
|
2160
|
-
return;
|
|
2134
|
+
if (!children.value) return;
|
|
2161
2135
|
opened.value = true;
|
|
2162
2136
|
}
|
|
2163
2137
|
function close() {
|
|
@@ -2243,8 +2217,7 @@ var VNavigation = defineComponent({
|
|
|
2243
2217
|
key,
|
|
2244
2218
|
ref: ref10
|
|
2245
2219
|
}) => {
|
|
2246
|
-
if (key === item.key)
|
|
2247
|
-
return;
|
|
2220
|
+
if (key === item.key) return;
|
|
2248
2221
|
ref10.close();
|
|
2249
2222
|
});
|
|
2250
2223
|
}
|
|
@@ -2340,8 +2313,7 @@ var VControlField = defineComponent({
|
|
|
2340
2313
|
} else {
|
|
2341
2314
|
child = resolvedSlots.value[position]?.();
|
|
2342
2315
|
}
|
|
2343
|
-
if (!child)
|
|
2344
|
-
return;
|
|
2316
|
+
if (!child) return;
|
|
2345
2317
|
return createVNode("div", {
|
|
2346
2318
|
"class": ["v-control-field__adornment", `v-control-field__adornment--${position}`]
|
|
2347
2319
|
}, [child]);
|
|
@@ -2754,43 +2726,34 @@ var VSelect = defineComponent({
|
|
|
2754
2726
|
};
|
|
2755
2727
|
const clearKeyFocused = () => {
|
|
2756
2728
|
const menu = menuRef.value?.menu;
|
|
2757
|
-
if (!menu)
|
|
2758
|
-
return;
|
|
2729
|
+
if (!menu) return;
|
|
2759
2730
|
const bodyEl = menu.bodyRef.value;
|
|
2760
|
-
if (!bodyEl)
|
|
2761
|
-
return;
|
|
2731
|
+
if (!bodyEl) return;
|
|
2762
2732
|
const els = Array.from(bodyEl.querySelectorAll(".v-option"));
|
|
2763
2733
|
els.forEach((el) => el.classList.remove("v-option--key-focused"));
|
|
2764
2734
|
};
|
|
2765
2735
|
const getItemElements = () => {
|
|
2766
2736
|
const menu = menuRef.value?.menu;
|
|
2767
|
-
if (!menu)
|
|
2768
|
-
return;
|
|
2737
|
+
if (!menu) return;
|
|
2769
2738
|
const bodyEl = menu.bodyRef.value;
|
|
2770
|
-
if (!bodyEl)
|
|
2771
|
-
return;
|
|
2739
|
+
if (!bodyEl) return;
|
|
2772
2740
|
const els = Array.from(bodyEl.querySelectorAll(".v-option")).filter((el) => {
|
|
2773
|
-
if (el.tabIndex === -1)
|
|
2774
|
-
return false;
|
|
2741
|
+
if (el.tabIndex === -1) return false;
|
|
2775
2742
|
const disabled = el.getAttribute("disabled");
|
|
2776
2743
|
const ariaDisabled = el.getAttribute("aria-disabled");
|
|
2777
|
-
if (ariaDisabled === "true")
|
|
2778
|
-
return false;
|
|
2744
|
+
if (ariaDisabled === "true") return false;
|
|
2779
2745
|
return disabled == null || disabled === "";
|
|
2780
2746
|
});
|
|
2781
|
-
if (!els.length)
|
|
2782
|
-
return;
|
|
2747
|
+
if (!els.length) return;
|
|
2783
2748
|
return els;
|
|
2784
2749
|
};
|
|
2785
2750
|
const arrowKeyHandler = (ev) => {
|
|
2786
2751
|
const {
|
|
2787
2752
|
key
|
|
2788
2753
|
} = ev;
|
|
2789
|
-
if (!menuOpened.value || !ARROW_KEY_TYPES.includes(key))
|
|
2790
|
-
return;
|
|
2754
|
+
if (!menuOpened.value || !ARROW_KEY_TYPES.includes(key)) return;
|
|
2791
2755
|
const els = getItemElements();
|
|
2792
|
-
if (!els)
|
|
2793
|
-
return;
|
|
2756
|
+
if (!els) return;
|
|
2794
2757
|
const currentEl = els.find((el) => el.classList.contains("v-option--key-focused"));
|
|
2795
2758
|
const currentIndex = currentEl && els.indexOf(currentEl);
|
|
2796
2759
|
let nextIndex;
|
|
@@ -2825,11 +2788,9 @@ var VSelect = defineComponent({
|
|
|
2825
2788
|
const {
|
|
2826
2789
|
key
|
|
2827
2790
|
} = ev;
|
|
2828
|
-
if (!menuOpened.value || !CHOICE_KEY_TYPES.includes(key))
|
|
2829
|
-
return;
|
|
2791
|
+
if (!menuOpened.value || !CHOICE_KEY_TYPES.includes(key)) return;
|
|
2830
2792
|
const els = getItemElements();
|
|
2831
|
-
if (!els)
|
|
2832
|
-
return;
|
|
2793
|
+
if (!els) return;
|
|
2833
2794
|
const currentEl = els.find((el) => el.classList.contains("v-option--key-focused"));
|
|
2834
2795
|
if (currentEl) {
|
|
2835
2796
|
const ev2 = new MouseEvent("click", {
|
|
@@ -2845,10 +2806,8 @@ var VSelect = defineComponent({
|
|
|
2845
2806
|
}
|
|
2846
2807
|
};
|
|
2847
2808
|
const keyboardEventHandler = (ev) => {
|
|
2848
|
-
if (ARROW_KEY_TYPES.includes(ev.key))
|
|
2849
|
-
|
|
2850
|
-
if (CHOICE_KEY_TYPES.includes(ev.key))
|
|
2851
|
-
return choiceKeyHandler(ev);
|
|
2809
|
+
if (ARROW_KEY_TYPES.includes(ev.key)) return arrowKeyHandler(ev);
|
|
2810
|
+
if (CHOICE_KEY_TYPES.includes(ev.key)) return choiceKeyHandler(ev);
|
|
2852
2811
|
};
|
|
2853
2812
|
useKeyboard([{
|
|
2854
2813
|
key: KEYBOARD_EVENT_TYPES,
|
|
@@ -3047,8 +3006,7 @@ var VTextField = defineComponent({
|
|
|
3047
3006
|
const {
|
|
3048
3007
|
counterResult
|
|
3049
3008
|
} = inputControl;
|
|
3050
|
-
if (!counterResult)
|
|
3051
|
-
return;
|
|
3009
|
+
if (!counterResult) return;
|
|
3052
3010
|
return createVNode(VTextCounter, counterResult, null);
|
|
3053
3011
|
};
|
|
3054
3012
|
ctx.expose({
|
|
@@ -3071,17 +3029,13 @@ var VTextField = defineComponent({
|
|
|
3071
3029
|
}
|
|
3072
3030
|
});
|
|
3073
3031
|
var toString = (value) => {
|
|
3074
|
-
if (value == null)
|
|
3075
|
-
return "";
|
|
3032
|
+
if (value == null) return "";
|
|
3076
3033
|
return String(value);
|
|
3077
3034
|
};
|
|
3078
3035
|
var toNumber = (value) => {
|
|
3079
|
-
if (value == null)
|
|
3080
|
-
|
|
3081
|
-
if (
|
|
3082
|
-
return value;
|
|
3083
|
-
if (value.trim() === "")
|
|
3084
|
-
return null;
|
|
3036
|
+
if (value == null) return null;
|
|
3037
|
+
if (typeof value === "number") return value;
|
|
3038
|
+
if (value.trim() === "") return null;
|
|
3085
3039
|
return Number(value);
|
|
3086
3040
|
};
|
|
3087
3041
|
var VNumberField = defineComponent({
|
|
@@ -3109,8 +3063,7 @@ var VNumberField = defineComponent({
|
|
|
3109
3063
|
const {
|
|
3110
3064
|
inputmode: inputmode2
|
|
3111
3065
|
} = ctx.attrs;
|
|
3112
|
-
if (inputmode2)
|
|
3113
|
-
return inputmode2;
|
|
3066
|
+
if (inputmode2) return inputmode2;
|
|
3114
3067
|
return hasNumberMask.value ? "decimal" : void 0;
|
|
3115
3068
|
});
|
|
3116
3069
|
const onUpdateModelValue = (value) => {
|
|
@@ -3173,8 +3126,7 @@ var VTextarea = defineComponent({
|
|
|
3173
3126
|
const {
|
|
3174
3127
|
counterResult
|
|
3175
3128
|
} = inputControl;
|
|
3176
|
-
if (!counterResult)
|
|
3177
|
-
return;
|
|
3129
|
+
if (!counterResult) return;
|
|
3178
3130
|
return createVNode(VTextCounter, counterResult, null);
|
|
3179
3131
|
};
|
|
3180
3132
|
return () => createVNode(VFormControl, {
|
|
@@ -3419,8 +3371,7 @@ var VTabs = defineComponent({
|
|
|
3419
3371
|
let value = props12.modelValue;
|
|
3420
3372
|
if (value == null || value === "") {
|
|
3421
3373
|
const firstItem = props12.items[0];
|
|
3422
|
-
if (!firstItem)
|
|
3423
|
-
return;
|
|
3374
|
+
if (!firstItem) return;
|
|
3424
3375
|
value = firstItem.value;
|
|
3425
3376
|
}
|
|
3426
3377
|
if (internalValueRef.value !== value) {
|
|
@@ -3429,22 +3380,18 @@ var VTabs = defineComponent({
|
|
|
3429
3380
|
const {
|
|
3430
3381
|
router
|
|
3431
3382
|
} = props12;
|
|
3432
|
-
if (!router)
|
|
3433
|
-
return;
|
|
3383
|
+
if (!router) return;
|
|
3434
3384
|
const hit = computedItemsRef.value.find((item) => item.value === value);
|
|
3435
|
-
if (!hit)
|
|
3436
|
-
return;
|
|
3385
|
+
if (!hit) return;
|
|
3437
3386
|
const {
|
|
3438
3387
|
location
|
|
3439
3388
|
} = hit;
|
|
3440
|
-
if (!location)
|
|
3441
|
-
return;
|
|
3389
|
+
if (!location) return;
|
|
3442
3390
|
const {
|
|
3443
3391
|
to: to2,
|
|
3444
3392
|
route
|
|
3445
3393
|
} = location;
|
|
3446
|
-
if (route.fullPath === vui.location.currentRoute.fullPath)
|
|
3447
|
-
return;
|
|
3394
|
+
if (route.fullPath === vui.location.currentRoute.fullPath) return;
|
|
3448
3395
|
vui.router[to2.replace ? "replace" : "push"](to2);
|
|
3449
3396
|
} else if (!props12.router && props12.modelValue !== value) {
|
|
3450
3397
|
ctx.emit("update:modelValue", value);
|
|
@@ -3482,17 +3429,13 @@ var VTabs = defineComponent({
|
|
|
3482
3429
|
const findTab = (tab) => tabRefs.value.find((t) => t.value === tab);
|
|
3483
3430
|
function scrollToTab(tabValue) {
|
|
3484
3431
|
const tab = findTab(tabValue);
|
|
3485
|
-
if (!tab)
|
|
3486
|
-
return;
|
|
3432
|
+
if (!tab) return;
|
|
3487
3433
|
const $tab = tab.$el;
|
|
3488
|
-
if (!$tab)
|
|
3489
|
-
return;
|
|
3434
|
+
if (!$tab) return;
|
|
3490
3435
|
const scroller2 = ScrollerRef.instance;
|
|
3491
|
-
if (!scroller2)
|
|
3492
|
-
return;
|
|
3436
|
+
if (!scroller2) return;
|
|
3493
3437
|
const container = scroller2.scroller.element();
|
|
3494
|
-
if (!container)
|
|
3495
|
-
return;
|
|
3438
|
+
if (!container) return;
|
|
3496
3439
|
const {
|
|
3497
3440
|
autoScrollOffset
|
|
3498
3441
|
} = props12;
|
|
@@ -3507,10 +3450,8 @@ var VTabs = defineComponent({
|
|
|
3507
3450
|
} = container;
|
|
3508
3451
|
hiddenLeft = Math.max(scrollLeft - tabLeft, 0);
|
|
3509
3452
|
hiddenRight = Math.max(tabRight - scrollerWidth - scrollLeft, 0);
|
|
3510
|
-
if (hiddenLeft > 0)
|
|
3511
|
-
|
|
3512
|
-
if (hiddenRight > 0)
|
|
3513
|
-
hiddenRight += autoScrollOffset;
|
|
3453
|
+
if (hiddenLeft > 0) hiddenLeft += autoScrollOffset;
|
|
3454
|
+
if (hiddenRight > 0) hiddenRight += autoScrollOffset;
|
|
3514
3455
|
let scrollAmount = 0;
|
|
3515
3456
|
if (hiddenRight > 0) {
|
|
3516
3457
|
scrollAmount = hiddenRight;
|
|
@@ -3533,8 +3474,7 @@ var VTabs = defineComponent({
|
|
|
3533
3474
|
scrollToTab(newValue);
|
|
3534
3475
|
});
|
|
3535
3476
|
vui.location.watchRoute((route) => {
|
|
3536
|
-
if (!props12.router)
|
|
3537
|
-
return;
|
|
3477
|
+
if (!props12.router) return;
|
|
3538
3478
|
const path = props12.withQuery ? route.fullPath : route.path;
|
|
3539
3479
|
const hit = computedItemsRef.value.find(({
|
|
3540
3480
|
location
|
|
@@ -3642,8 +3582,7 @@ var VBreadcrumbs = defineComponent({
|
|
|
3642
3582
|
"class": "v-breadcrumbs__divider__icon"
|
|
3643
3583
|
}, null)];
|
|
3644
3584
|
return () => {
|
|
3645
|
-
if (lengthRef.value < 1)
|
|
3646
|
-
return;
|
|
3585
|
+
if (lengthRef.value < 1) return;
|
|
3647
3586
|
let dividerSlot;
|
|
3648
3587
|
const propDivider = props12.divider;
|
|
3649
3588
|
if (propDivider) {
|
|
@@ -3677,8 +3616,7 @@ var VBreadcrumbs = defineComponent({
|
|
|
3677
3616
|
myChildren.push($icon);
|
|
3678
3617
|
}
|
|
3679
3618
|
}
|
|
3680
|
-
if (text)
|
|
3681
|
-
myChildren.push(text);
|
|
3619
|
+
if (text) myChildren.push(text);
|
|
3682
3620
|
const itemChild = to ? createVNode(VAction, {
|
|
3683
3621
|
"class": "v-breadcrumbs__link",
|
|
3684
3622
|
"to": to,
|
|
@@ -3736,10 +3674,8 @@ var VContentSwitcher = defineComponent({
|
|
|
3736
3674
|
let {
|
|
3737
3675
|
autotop: settings
|
|
3738
3676
|
} = props12;
|
|
3739
|
-
if (settings === true)
|
|
3740
|
-
|
|
3741
|
-
if (!settings)
|
|
3742
|
-
return;
|
|
3677
|
+
if (settings === true) settings = {};
|
|
3678
|
+
if (!settings) return;
|
|
3743
3679
|
return {
|
|
3744
3680
|
...settings
|
|
3745
3681
|
};
|
|
@@ -3761,20 +3697,16 @@ var VContentSwitcher = defineComponent({
|
|
|
3761
3697
|
return el;
|
|
3762
3698
|
}
|
|
3763
3699
|
watch(() => props12.modelValue, (value, beforeValue) => {
|
|
3764
|
-
if (value == null)
|
|
3765
|
-
return;
|
|
3700
|
+
if (value == null) return;
|
|
3766
3701
|
internalValueRef.value = value;
|
|
3767
|
-
if (beforeValue == null)
|
|
3768
|
-
return;
|
|
3702
|
+
if (beforeValue == null) return;
|
|
3769
3703
|
const order = computedOrderRef.value;
|
|
3770
3704
|
const index = order.indexOf(value);
|
|
3771
3705
|
const beforeIndex = order.indexOf(beforeValue);
|
|
3772
3706
|
let transition = "fade";
|
|
3773
3707
|
if (index !== -1 && beforeIndex !== -1) {
|
|
3774
|
-
if (index > beforeIndex)
|
|
3775
|
-
|
|
3776
|
-
if (index < beforeIndex)
|
|
3777
|
-
transition = "v-content-switcher-prev";
|
|
3708
|
+
if (index > beforeIndex) transition = "v-content-switcher-next";
|
|
3709
|
+
if (index < beforeIndex) transition = "v-content-switcher-prev";
|
|
3778
3710
|
}
|
|
3779
3711
|
transitionRef.value = transition;
|
|
3780
3712
|
}, {
|
|
@@ -3950,8 +3882,7 @@ var VDataTable = defineComponent({
|
|
|
3950
3882
|
const {
|
|
3951
3883
|
rowSettings: rowSettings2
|
|
3952
3884
|
} = props12;
|
|
3953
|
-
if (!rowSettings2)
|
|
3954
|
-
return () => ({});
|
|
3885
|
+
if (!rowSettings2) return () => ({});
|
|
3955
3886
|
return typeof rowSettings2 === "function" ? rowSettings2 : () => rowSettings2;
|
|
3956
3887
|
});
|
|
3957
3888
|
const containedVariant = vui.setting("containedVariant");
|
|
@@ -4010,8 +3941,7 @@ var VDataTable = defineComponent({
|
|
|
4010
3941
|
}]);
|
|
4011
3942
|
const layout = VueAppLayout.use();
|
|
4012
3943
|
const bodyInnerStylesRef = computed(() => {
|
|
4013
|
-
if (!bootedRef.value)
|
|
4014
|
-
return;
|
|
3944
|
+
if (!bootedRef.value) return;
|
|
4015
3945
|
const {
|
|
4016
3946
|
fixedHeader,
|
|
4017
3947
|
maxHeight
|
|
@@ -4071,8 +4001,7 @@ var VDataTable = defineComponent({
|
|
|
4071
4001
|
total
|
|
4072
4002
|
} = props12;
|
|
4073
4003
|
const _limit = limitRef.value;
|
|
4074
|
-
if (!total)
|
|
4075
|
-
return 0;
|
|
4004
|
+
if (!total) return 0;
|
|
4076
4005
|
return Math.ceil(total / _limit);
|
|
4077
4006
|
});
|
|
4078
4007
|
const lengthRef = computed(() => props12.items.length);
|
|
@@ -4100,8 +4029,7 @@ var VDataTable = defineComponent({
|
|
|
4100
4029
|
sort,
|
|
4101
4030
|
order
|
|
4102
4031
|
} = settings;
|
|
4103
|
-
if ((sort === void 0 || sortByRef.value === sort) && (order === void 0 || orderByRef.value === order))
|
|
4104
|
-
return;
|
|
4032
|
+
if ((sort === void 0 || sortByRef.value === sort) && (order === void 0 || orderByRef.value === order)) return;
|
|
4105
4033
|
const queries = {};
|
|
4106
4034
|
if (sort) {
|
|
4107
4035
|
queries[props12.sortQuery] = sort;
|
|
@@ -4132,10 +4060,8 @@ var VDataTable = defineComponent({
|
|
|
4132
4060
|
values.sort((a, b) => {
|
|
4133
4061
|
const ai = sortedKeys.indexOf(a);
|
|
4134
4062
|
const bi = sortedKeys.indexOf(b);
|
|
4135
|
-
if (ai < bi)
|
|
4136
|
-
|
|
4137
|
-
if (ai > bi)
|
|
4138
|
-
return 1;
|
|
4063
|
+
if (ai < bi) return -1;
|
|
4064
|
+
if (ai > bi) return 1;
|
|
4139
4065
|
return 0;
|
|
4140
4066
|
});
|
|
4141
4067
|
internalValues.value = values;
|
|
@@ -4169,8 +4095,7 @@ var VDataTable = defineComponent({
|
|
|
4169
4095
|
const {
|
|
4170
4096
|
sortQuery
|
|
4171
4097
|
} = header;
|
|
4172
|
-
if (!sortQuery)
|
|
4173
|
-
return;
|
|
4098
|
+
if (!sortQuery) return;
|
|
4174
4099
|
if (sortByRef.value === sortQuery) {
|
|
4175
4100
|
return toggleOrderBy();
|
|
4176
4101
|
}
|
|
@@ -4293,8 +4218,7 @@ var VDataTable = defineComponent({
|
|
|
4293
4218
|
"key": header.key,
|
|
4294
4219
|
"tabindex": sortQuery ? 0 : void 0,
|
|
4295
4220
|
"onClick": (ev) => {
|
|
4296
|
-
if (!sortQuery)
|
|
4297
|
-
return;
|
|
4221
|
+
if (!sortQuery) return;
|
|
4298
4222
|
handleClickSortHeader(header);
|
|
4299
4223
|
}
|
|
4300
4224
|
}, [createVNode("div", {
|
|
@@ -4794,8 +4718,7 @@ var VuiService = class {
|
|
|
4794
4718
|
setDefaultActionableClassName("clickable");
|
|
4795
4719
|
var scroller = getDocumentScroller();
|
|
4796
4720
|
function mergeVuiPluginOptions(base, override) {
|
|
4797
|
-
if (!override)
|
|
4798
|
-
return base;
|
|
4721
|
+
if (!override) return base;
|
|
4799
4722
|
const merged = mergeVuiServiceOptions(base, override);
|
|
4800
4723
|
if (override.stack) {
|
|
4801
4724
|
merged.stack = {
|
|
@@ -4828,8 +4751,7 @@ var VuiPlugin = class {
|
|
|
4828
4751
|
},
|
|
4829
4752
|
// eslint-disable-next-line no-shadow
|
|
4830
4753
|
fn: (el, opts2) => {
|
|
4831
|
-
if (window.getComputedStyle(el).scrollMargin)
|
|
4832
|
-
return;
|
|
4754
|
+
if (window.getComputedStyle(el).scrollMargin) return;
|
|
4833
4755
|
const duration = opts2?.behavior === "smooth" ? void 0 : 0;
|
|
4834
4756
|
return scroller.toElement(el, {
|
|
4835
4757
|
offset: $vui.getAutoScrollToElementOffsetTop(),
|