vueless 0.0.678 → 0.0.679
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/package.json
CHANGED
package/ui.button-link/ULink.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, useSlots } from "vue";
|
|
3
|
-
import { RouterLink
|
|
3
|
+
import { RouterLink } from "vue-router";
|
|
4
4
|
|
|
5
5
|
import useUI from "../composables/useUI.ts";
|
|
6
6
|
import { hasSlotContent } from "../utils/helper.ts";
|
|
@@ -53,31 +53,7 @@ const isPresentRoute = computed(() => {
|
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
const safeTo = computed(() => {
|
|
56
|
-
|
|
57
|
-
return "/";
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return props.to;
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
const useLinkOptions = {
|
|
64
|
-
activeClass: props.activeClass,
|
|
65
|
-
ariaCurrentValue: props.ariaCurrentValue,
|
|
66
|
-
exactActiveClass: props.exactActiveClass,
|
|
67
|
-
custom: props.custom,
|
|
68
|
-
replace: props.replace,
|
|
69
|
-
to: safeTo.value,
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
const { route, isActive, isExactActive } = useLink(useLinkOptions);
|
|
73
|
-
|
|
74
|
-
const linkActiveClasses = computed(() => [
|
|
75
|
-
isActive.value && props.activeClass,
|
|
76
|
-
isExactActive.value && props.exactActiveClass,
|
|
77
|
-
]);
|
|
78
|
-
|
|
79
|
-
const targetValue = computed(() => {
|
|
80
|
-
return props.targetBlank ? "_blank" : "_self";
|
|
56
|
+
return props.to || "/";
|
|
81
57
|
});
|
|
82
58
|
|
|
83
59
|
const prefixedHref = computed(() => {
|
|
@@ -125,10 +101,15 @@ const { getDataTest, linkAttrs } = useUI<Config>(defaultConfig, mutatedProps);
|
|
|
125
101
|
<template>
|
|
126
102
|
<router-link
|
|
127
103
|
v-if="isPresentRoute"
|
|
128
|
-
:to="
|
|
129
|
-
:
|
|
104
|
+
:to="safeTo"
|
|
105
|
+
:custom="custom"
|
|
106
|
+
:replace="replace"
|
|
107
|
+
:target="target"
|
|
108
|
+
:active-class="activeClass"
|
|
109
|
+
:exact-active-class="exactActiveClass"
|
|
110
|
+
:aria-current-value="ariaCurrentValue"
|
|
111
|
+
:view-transition="viewTransition"
|
|
130
112
|
v-bind="linkAttrs"
|
|
131
|
-
:class="linkActiveClasses"
|
|
132
113
|
:data-test="getDataTest()"
|
|
133
114
|
tabindex="0"
|
|
134
115
|
@blur="onBlur"
|
|
@@ -143,10 +124,10 @@ const { getDataTest, linkAttrs } = useUI<Config>(defaultConfig, mutatedProps);
|
|
|
143
124
|
|
|
144
125
|
<a
|
|
145
126
|
v-else
|
|
127
|
+
:rel="rel"
|
|
146
128
|
:href="prefixedHref"
|
|
147
|
-
:target="
|
|
129
|
+
:target="target"
|
|
148
130
|
v-bind="linkAttrs"
|
|
149
|
-
:class="linkActiveClasses"
|
|
150
131
|
:data-test="getDataTest()"
|
|
151
132
|
tabindex="0"
|
|
152
133
|
@blur="onBlur"
|
package/ui.button-link/config.ts
CHANGED
|
@@ -55,16 +55,18 @@ export default /*tw*/ {
|
|
|
55
55
|
color: "brand",
|
|
56
56
|
type: "link",
|
|
57
57
|
size: "md",
|
|
58
|
-
|
|
58
|
+
target: "_self",
|
|
59
59
|
activeClass: "",
|
|
60
60
|
exactActiveClass: "",
|
|
61
|
+
ariaCurrentValue: "page",
|
|
62
|
+
rel: "noopener noreferrer",
|
|
61
63
|
underlined: undefined,
|
|
62
|
-
block: false,
|
|
63
64
|
ring: false,
|
|
65
|
+
block: false,
|
|
64
66
|
dashed: false,
|
|
65
|
-
disabled: false,
|
|
66
|
-
targetBlank: false,
|
|
67
67
|
custom: false,
|
|
68
68
|
replace: false,
|
|
69
|
+
disabled: false,
|
|
70
|
+
viewTransition: false,
|
|
69
71
|
},
|
|
70
72
|
};
|
package/ui.button-link/types.ts
CHANGED
|
@@ -12,14 +12,14 @@ export interface Props {
|
|
|
12
12
|
label?: string;
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Vue-router route object.
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
to?: RouteLocationRaw;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Link href url.
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
href?: string;
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Link size.
|
|
@@ -58,34 +58,29 @@ export interface Props {
|
|
|
58
58
|
type?: "phone" | "email" | "link";
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
62
|
-
*/
|
|
63
|
-
targetBlank?: boolean;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Pass value to the attribute aria-current when the link is exact active.
|
|
61
|
+
* Apply classes to the link when its route is active or when it matches any parent route.
|
|
67
62
|
*/
|
|
68
|
-
|
|
63
|
+
activeClass?: string;
|
|
69
64
|
|
|
70
65
|
/**
|
|
71
|
-
*
|
|
66
|
+
* Apply classes to the link when its route is active.
|
|
72
67
|
*/
|
|
73
|
-
|
|
68
|
+
exactActiveClass?: string;
|
|
74
69
|
|
|
75
70
|
/**
|
|
76
|
-
*
|
|
71
|
+
* Pass value to the attribute aria-current when the link is exact active.
|
|
77
72
|
*/
|
|
78
|
-
|
|
73
|
+
ariaCurrentValue?: "time" | "location" | "page" | "step" | "date" | "true" | "false";
|
|
79
74
|
|
|
80
75
|
/**
|
|
81
|
-
*
|
|
76
|
+
* Specifies where to open the linked page.
|
|
82
77
|
*/
|
|
83
|
-
|
|
78
|
+
target?: "_blank" | "_self" | "_parent" | "_top" | string;
|
|
84
79
|
|
|
85
80
|
/**
|
|
86
|
-
*
|
|
81
|
+
* A rel attribute value to apply on the external link.
|
|
87
82
|
*/
|
|
88
|
-
|
|
83
|
+
rel?: string;
|
|
89
84
|
|
|
90
85
|
/**
|
|
91
86
|
* Show underline.
|
|
@@ -112,6 +107,21 @@ export interface Props {
|
|
|
112
107
|
*/
|
|
113
108
|
ring?: boolean;
|
|
114
109
|
|
|
110
|
+
/**
|
|
111
|
+
* Whether RouterLink should not wrap its content in a tag.
|
|
112
|
+
*/
|
|
113
|
+
custom?: boolean;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Calls `router.replace` instead of `router.push`.
|
|
117
|
+
*/
|
|
118
|
+
replace?: boolean;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Pass the returned promise of `router.push()` to `document.startViewTransition()` if supported.
|
|
122
|
+
*/
|
|
123
|
+
viewTransition?: boolean;
|
|
124
|
+
|
|
115
125
|
/**
|
|
116
126
|
* Component config object.
|
|
117
127
|
*/
|
package/ui.data-table/UTable.vue
CHANGED
|
@@ -141,7 +141,9 @@ const sortedRows: ComputedRef<Row[]> = computed(() => {
|
|
|
141
141
|
|
|
142
142
|
const isFooterSticky = computed(() => {
|
|
143
143
|
return (
|
|
144
|
-
window
|
|
144
|
+
Number(window?.innerHeight) < tableHeight.value &&
|
|
145
|
+
props.stickyFooter &&
|
|
146
|
+
!isShownFooterPosition.value
|
|
145
147
|
);
|
|
146
148
|
});
|
|
147
149
|
|
|
@@ -165,15 +167,15 @@ const isShownActionsHeader = computed(
|
|
|
165
167
|
|
|
166
168
|
const isHeaderSticky = computed(() => {
|
|
167
169
|
const positionForFixHeader =
|
|
168
|
-
Number(headerRowRef.value?.getBoundingClientRect()?.top) + window
|
|
170
|
+
Number(headerRowRef.value?.getBoundingClientRect()?.top) + Number(window?.scrollY) || 0;
|
|
169
171
|
|
|
170
172
|
return positionForFixHeader <= pagePositionY.value && props.stickyHeader;
|
|
171
173
|
});
|
|
172
174
|
|
|
173
175
|
const isShownFooterPosition = computed(() => {
|
|
174
|
-
const pageBottom = pagePositionY.value + window
|
|
176
|
+
const pageBottom = pagePositionY.value + Number(window?.innerHeight);
|
|
175
177
|
const positionForFixFooter =
|
|
176
|
-
Number(footerRowRef.value?.getBoundingClientRect()?.bottom) + window
|
|
178
|
+
Number(footerRowRef.value?.getBoundingClientRect()?.bottom) + Number(window?.scrollY);
|
|
177
179
|
|
|
178
180
|
return pageBottom >= positionForFixFooter;
|
|
179
181
|
});
|
|
@@ -310,7 +312,7 @@ function setHeaderCellWidth() {
|
|
|
310
312
|
}
|
|
311
313
|
|
|
312
314
|
function onScroll() {
|
|
313
|
-
pagePositionY.value = window
|
|
315
|
+
pagePositionY.value = Number(window?.scrollY);
|
|
314
316
|
}
|
|
315
317
|
|
|
316
318
|
function synchronizeTableItemsWithProps() {
|