@bitrix24/b24ui-nuxt 2.1.5 → 2.1.7
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/.nuxt/b24ui.css +17 -0
- package/dist/meta.d.mts +4974 -4974
- package/dist/meta.mjs +4974 -4974
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/ChatPromptSubmit.d.vue.ts +6 -6
- package/dist/runtime/components/ChatPromptSubmit.vue +6 -6
- package/dist/runtime/components/ChatPromptSubmit.vue.d.ts +6 -6
- package/dist/runtime/components/Link.d.vue.ts +52 -2
- package/dist/runtime/components/Link.vue.d.ts +52 -2
- package/dist/runtime/components/Range.vue +2 -2
- package/dist/runtime/inertia/components/Link.d.vue.ts +5 -2
- package/dist/runtime/inertia/components/Link.vue +26 -7
- package/dist/runtime/inertia/components/Link.vue.d.ts +5 -2
- package/dist/runtime/inertia/components/LinkBase.d.vue.ts +1 -0
- package/dist/runtime/inertia/components/LinkBase.vue +5 -2
- package/dist/runtime/inertia/components/LinkBase.vue.d.ts +1 -0
- package/dist/runtime/vue/components/Link.d.vue.ts +4 -2
- package/dist/runtime/vue/components/Link.vue +31 -12
- package/dist/runtime/vue/components/Link.vue.d.ts +4 -2
- package/dist/shared/{b24ui-nuxt.Dspx5yCK.mjs → b24ui-nuxt.CIiXiDdZ.mjs} +19 -1
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +5 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defu } from 'defu';
|
|
2
2
|
import { defineNuxtModule, createResolver, addPlugin, hasNuxtModule, addComponentsDir, addImportsDir, installModule } from '@nuxt/kit';
|
|
3
|
-
import { d as defaultOptions, v as version, n as name, a as getDefaultConfig, b as addTemplates } from './shared/b24ui-nuxt.
|
|
3
|
+
import { d as defaultOptions, v as version, n as name, a as getDefaultConfig, b as addTemplates } from './shared/b24ui-nuxt.CIiXiDdZ.mjs';
|
|
4
4
|
import 'node:url';
|
|
5
5
|
import 'scule';
|
|
6
6
|
import 'knitwork';
|
|
@@ -54,15 +54,15 @@ export interface ChatPromptSubmitProps extends Omit<ButtonProps, 'icon' | 'color
|
|
|
54
54
|
class?: any;
|
|
55
55
|
}
|
|
56
56
|
export interface ChatPromptSubmitEmits {
|
|
57
|
-
stop: [];
|
|
58
|
-
reload: [];
|
|
57
|
+
stop: [event: MouseEvent];
|
|
58
|
+
reload: [event: MouseEvent];
|
|
59
59
|
}
|
|
60
60
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ChatPromptSubmitProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
61
|
-
stop: () => any;
|
|
62
|
-
reload: () => any;
|
|
61
|
+
stop: (event: MouseEvent) => any;
|
|
62
|
+
reload: (event: MouseEvent) => any;
|
|
63
63
|
}, string, import("vue").PublicProps, Readonly<ChatPromptSubmitProps> & Readonly<{
|
|
64
|
-
onStop?: (() => any) | undefined;
|
|
65
|
-
onReload?: (() => any) | undefined;
|
|
64
|
+
onStop?: ((event: MouseEvent) => any) | undefined;
|
|
65
|
+
onReload?: ((event: MouseEvent) => any) | undefined;
|
|
66
66
|
}>, {
|
|
67
67
|
status: ChatStatus;
|
|
68
68
|
color: "default" | "link" | "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary" | "danger" | "success" | "warning" | "primary" | "secondary" | "collab" | "ai" | "air-secondary-alert" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost";
|
|
@@ -80,22 +80,22 @@ const statusButtonProps = computed(() => ({
|
|
|
80
80
|
submitted: {
|
|
81
81
|
icon: props.submittedIcon || icons.stop,
|
|
82
82
|
color: props.submittedColor,
|
|
83
|
-
onClick() {
|
|
84
|
-
emits("stop");
|
|
83
|
+
onClick(e) {
|
|
84
|
+
emits("stop", e);
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
streaming: {
|
|
88
88
|
icon: props.streamingIcon || icons.stop,
|
|
89
89
|
color: props.streamingColor,
|
|
90
|
-
onClick() {
|
|
91
|
-
emits("stop");
|
|
90
|
+
onClick(e) {
|
|
91
|
+
emits("stop", e);
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
error: {
|
|
95
95
|
icon: props.errorIcon || icons.reload,
|
|
96
96
|
color: props.errorColor,
|
|
97
|
-
onClick() {
|
|
98
|
-
emits("reload");
|
|
97
|
+
onClick(e) {
|
|
98
|
+
emits("reload", e);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
})[props.status]);
|
|
@@ -54,15 +54,15 @@ export interface ChatPromptSubmitProps extends Omit<ButtonProps, 'icon' | 'color
|
|
|
54
54
|
class?: any;
|
|
55
55
|
}
|
|
56
56
|
export interface ChatPromptSubmitEmits {
|
|
57
|
-
stop: [];
|
|
58
|
-
reload: [];
|
|
57
|
+
stop: [event: MouseEvent];
|
|
58
|
+
reload: [event: MouseEvent];
|
|
59
59
|
}
|
|
60
60
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ChatPromptSubmitProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
61
|
-
stop: () => any;
|
|
62
|
-
reload: () => any;
|
|
61
|
+
stop: (event: MouseEvent) => any;
|
|
62
|
+
reload: (event: MouseEvent) => any;
|
|
63
63
|
}, string, import("vue").PublicProps, Readonly<ChatPromptSubmitProps> & Readonly<{
|
|
64
|
-
onStop?: (() => any) | undefined;
|
|
65
|
-
onReload?: (() => any) | undefined;
|
|
64
|
+
onStop?: ((event: MouseEvent) => any) | undefined;
|
|
65
|
+
onReload?: ((event: MouseEvent) => any) | undefined;
|
|
66
66
|
}>, {
|
|
67
67
|
status: ChatStatus;
|
|
68
68
|
color: "default" | "link" | "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary" | "danger" | "success" | "warning" | "primary" | "secondary" | "collab" | "ai" | "air-secondary-alert" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost";
|
|
@@ -1,6 +1,56 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RouterLinkProps, RouteLocationRaw } from 'vue-router';
|
|
2
2
|
import type { ButtonHTMLAttributes, AnchorHTMLAttributes } from '../types/html';
|
|
3
|
-
|
|
3
|
+
interface NuxtLinkProps extends Omit<RouterLinkProps, 'to'> {
|
|
4
|
+
/**
|
|
5
|
+
* Route Location the link should navigate to when clicked on.
|
|
6
|
+
*/
|
|
7
|
+
to?: RouteLocationRaw;
|
|
8
|
+
/**
|
|
9
|
+
* An alias for `to`. If used with `to`, `href` will be ignored
|
|
10
|
+
*/
|
|
11
|
+
href?: NuxtLinkProps['to'];
|
|
12
|
+
/**
|
|
13
|
+
* Forces the link to be considered as external (true) or internal (false). This is helpful to handle edge-cases
|
|
14
|
+
*/
|
|
15
|
+
external?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Where to display the linked URL, as the name for a browsing context.
|
|
18
|
+
*/
|
|
19
|
+
target?: '_blank' | '_parent' | '_self' | '_top' | (string & {}) | null;
|
|
20
|
+
/**
|
|
21
|
+
* A rel attribute value to apply on the link. Defaults to "noopener noreferrer" for external links.
|
|
22
|
+
*/
|
|
23
|
+
rel?: 'noopener' | 'noreferrer' | 'nofollow' | 'sponsored' | 'ugc' | (string & {}) | null;
|
|
24
|
+
/**
|
|
25
|
+
* If set to true, no rel attribute will be added to the link
|
|
26
|
+
*/
|
|
27
|
+
noRel?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* A class to apply to links that have been prefetched.
|
|
30
|
+
*/
|
|
31
|
+
prefetchedClass?: string;
|
|
32
|
+
/**
|
|
33
|
+
* When enabled will prefetch middleware, layouts and payloads of links in the viewport.
|
|
34
|
+
*/
|
|
35
|
+
prefetch?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Allows controlling when to prefetch links. By default, prefetch is triggered only on visibility.
|
|
38
|
+
*/
|
|
39
|
+
prefetchOn?: 'visibility' | 'interaction' | Partial<{
|
|
40
|
+
visibility: boolean;
|
|
41
|
+
interaction: boolean;
|
|
42
|
+
}>;
|
|
43
|
+
/**
|
|
44
|
+
* Escape hatch to disable `prefetch` attribute.
|
|
45
|
+
*/
|
|
46
|
+
noPrefetch?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* An option to either add or remove trailing slashes in the `href` for this specific link.
|
|
49
|
+
* Overrides the global `trailingSlash` option if provided.
|
|
50
|
+
*/
|
|
51
|
+
trailingSlash?: 'append' | 'remove';
|
|
52
|
+
}
|
|
53
|
+
export interface LinkProps extends NuxtLinkProps, /** @vue-ignore */ Omit<ButtonHTMLAttributes, 'type' | 'disabled'>, /** @vue-ignore */ Omit<AnchorHTMLAttributes, 'href' | 'target' | 'rel' | 'type'> {
|
|
4
54
|
/**
|
|
5
55
|
* The element or component this component should render as when not a link.
|
|
6
56
|
* @defaultValue 'button'
|
|
@@ -1,6 +1,56 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RouterLinkProps, RouteLocationRaw } from 'vue-router';
|
|
2
2
|
import type { ButtonHTMLAttributes, AnchorHTMLAttributes } from '../types/html';
|
|
3
|
-
|
|
3
|
+
interface NuxtLinkProps extends Omit<RouterLinkProps, 'to'> {
|
|
4
|
+
/**
|
|
5
|
+
* Route Location the link should navigate to when clicked on.
|
|
6
|
+
*/
|
|
7
|
+
to?: RouteLocationRaw;
|
|
8
|
+
/**
|
|
9
|
+
* An alias for `to`. If used with `to`, `href` will be ignored
|
|
10
|
+
*/
|
|
11
|
+
href?: NuxtLinkProps['to'];
|
|
12
|
+
/**
|
|
13
|
+
* Forces the link to be considered as external (true) or internal (false). This is helpful to handle edge-cases
|
|
14
|
+
*/
|
|
15
|
+
external?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Where to display the linked URL, as the name for a browsing context.
|
|
18
|
+
*/
|
|
19
|
+
target?: '_blank' | '_parent' | '_self' | '_top' | (string & {}) | null;
|
|
20
|
+
/**
|
|
21
|
+
* A rel attribute value to apply on the link. Defaults to "noopener noreferrer" for external links.
|
|
22
|
+
*/
|
|
23
|
+
rel?: 'noopener' | 'noreferrer' | 'nofollow' | 'sponsored' | 'ugc' | (string & {}) | null;
|
|
24
|
+
/**
|
|
25
|
+
* If set to true, no rel attribute will be added to the link
|
|
26
|
+
*/
|
|
27
|
+
noRel?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* A class to apply to links that have been prefetched.
|
|
30
|
+
*/
|
|
31
|
+
prefetchedClass?: string;
|
|
32
|
+
/**
|
|
33
|
+
* When enabled will prefetch middleware, layouts and payloads of links in the viewport.
|
|
34
|
+
*/
|
|
35
|
+
prefetch?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Allows controlling when to prefetch links. By default, prefetch is triggered only on visibility.
|
|
38
|
+
*/
|
|
39
|
+
prefetchOn?: 'visibility' | 'interaction' | Partial<{
|
|
40
|
+
visibility: boolean;
|
|
41
|
+
interaction: boolean;
|
|
42
|
+
}>;
|
|
43
|
+
/**
|
|
44
|
+
* Escape hatch to disable `prefetch` attribute.
|
|
45
|
+
*/
|
|
46
|
+
noPrefetch?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* An option to either add or remove trailing slashes in the `href` for this specific link.
|
|
49
|
+
* Overrides the global `trailingSlash` option if provided.
|
|
50
|
+
*/
|
|
51
|
+
trailingSlash?: 'append' | 'remove';
|
|
52
|
+
}
|
|
53
|
+
export interface LinkProps extends NuxtLinkProps, /** @vue-ignore */ Omit<ButtonHTMLAttributes, 'type' | 'disabled'>, /** @vue-ignore */ Omit<AnchorHTMLAttributes, 'href' | 'target' | 'rel' | 'type'> {
|
|
4
54
|
/**
|
|
5
55
|
* The element or component this component should render as when not a link.
|
|
6
56
|
* @defaultValue 'button'
|
|
@@ -87,9 +87,9 @@ function onChange(value) {
|
|
|
87
87
|
disable-closing-trigger
|
|
88
88
|
v-bind="typeof tooltip === 'object' ? tooltip : {}"
|
|
89
89
|
>
|
|
90
|
-
<SliderThumb data-slot="thumb" :class="b24ui.thumb({ class: props.b24ui?.thumb })" />
|
|
90
|
+
<SliderThumb data-slot="thumb" :class="b24ui.thumb({ class: props.b24ui?.thumb })" :aria-label="thumbs === 1 ? 'Thumb' : `Thumb ${thumb} of ${thumbs}`" />
|
|
91
91
|
</B24Tooltip>
|
|
92
|
-
<SliderThumb v-else data-slot="thumb" :class="b24ui.thumb({ class: props.b24ui?.thumb })" />
|
|
92
|
+
<SliderThumb v-else data-slot="thumb" :class="b24ui.thumb({ class: props.b24ui?.thumb })" :aria-label="thumbs === 1 ? 'Thumb' : `Thumb ${thumb} of ${thumbs}`" />
|
|
93
93
|
</template>
|
|
94
94
|
</SliderRoot>
|
|
95
95
|
</template>
|
|
@@ -27,6 +27,10 @@ export interface LinkProps extends Partial<Omit<InertiaLinkProps, 'href' | 'onCl
|
|
|
27
27
|
* A rel attribute value to apply on the link. Defaults to "noopener noreferrer" for external links.
|
|
28
28
|
*/
|
|
29
29
|
rel?: 'noopener' | 'noreferrer' | 'nofollow' | 'sponsored' | 'ugc' | (string & {}) | null;
|
|
30
|
+
/**
|
|
31
|
+
* If set to true, no rel attribute will be added to the link
|
|
32
|
+
*/
|
|
33
|
+
noRel?: boolean;
|
|
30
34
|
/**
|
|
31
35
|
* Value passed to the attribute `aria-current` when the link is exact active.
|
|
32
36
|
*
|
|
@@ -61,8 +65,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<LinkPr
|
|
|
61
65
|
as: any;
|
|
62
66
|
type: "reset" | "submit" | "button";
|
|
63
67
|
active: boolean;
|
|
64
|
-
|
|
65
|
-
inactiveClass: string;
|
|
68
|
+
ariaCurrentValue: "page" | "step" | "location" | "date" | "time" | "true" | "false";
|
|
66
69
|
isAction: boolean;
|
|
67
70
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, LinkSlots>;
|
|
68
71
|
declare const _default: typeof __VLS_export;
|
|
@@ -11,22 +11,24 @@ import { usePage } from "@inertiajs/vue3";
|
|
|
11
11
|
import { hasProtocol } from "ufo";
|
|
12
12
|
import { useAppConfig } from "#imports";
|
|
13
13
|
import { tv } from "../../utils/tv";
|
|
14
|
-
import
|
|
14
|
+
import { mergeClasses } from "../../utils";
|
|
15
|
+
import B24LinkBase from "../../components/LinkBase.vue";
|
|
15
16
|
defineOptions({ inheritAttrs: false });
|
|
16
17
|
const props = defineProps({
|
|
17
18
|
as: { type: null, required: false, default: "button" },
|
|
18
|
-
activeClass: { type: String, required: false
|
|
19
|
+
activeClass: { type: String, required: false },
|
|
19
20
|
to: { type: String, required: false },
|
|
20
21
|
href: { type: String, required: false },
|
|
21
22
|
external: { type: Boolean, required: false },
|
|
22
23
|
target: { type: [String, Object, null], required: false },
|
|
23
24
|
rel: { type: [String, Object, null], required: false },
|
|
24
|
-
|
|
25
|
+
noRel: { type: Boolean, required: false },
|
|
26
|
+
ariaCurrentValue: { type: String, required: false, default: "page" },
|
|
25
27
|
type: { type: null, required: false, default: "button" },
|
|
26
28
|
disabled: { type: Boolean, required: false },
|
|
27
29
|
active: { type: Boolean, required: false, default: void 0 },
|
|
28
30
|
exact: { type: Boolean, required: false },
|
|
29
|
-
inactiveClass: { type: String, required: false
|
|
31
|
+
inactiveClass: { type: String, required: false },
|
|
30
32
|
custom: { type: Boolean, required: false },
|
|
31
33
|
isAction: { type: Boolean, required: false, default: false },
|
|
32
34
|
raw: { type: Boolean, required: false },
|
|
@@ -61,14 +63,14 @@ const props = defineProps({
|
|
|
61
63
|
defineSlots();
|
|
62
64
|
const page = usePage();
|
|
63
65
|
const appConfig = useAppConfig();
|
|
64
|
-
const routerLinkProps = useForwardProps(reactiveOmit(props, "as", "type", "disabled", "active", "exact", "activeClass", "inactiveClass", "to", "href", "raw", "custom", "class"));
|
|
66
|
+
const routerLinkProps = useForwardProps(reactiveOmit(props, "as", "type", "disabled", "active", "exact", "activeClass", "inactiveClass", "to", "href", "raw", "custom", "class", "noRel"));
|
|
65
67
|
const b24ui = computed(() => tv({
|
|
66
68
|
extend: tv(theme),
|
|
67
69
|
...defu({
|
|
68
70
|
variants: {
|
|
69
71
|
active: {
|
|
70
|
-
true: props.activeClass,
|
|
71
|
-
false: props.inactiveClass
|
|
72
|
+
true: mergeClasses(appConfig.b24ui?.link?.variants?.active?.true, props.activeClass),
|
|
73
|
+
false: mergeClasses(appConfig.b24ui?.link?.variants?.active?.false, props.inactiveClass)
|
|
72
74
|
}
|
|
73
75
|
}
|
|
74
76
|
}, appConfig.b24ui?.link || {})
|
|
@@ -86,6 +88,19 @@ const isExternal = computed(() => {
|
|
|
86
88
|
}
|
|
87
89
|
return typeof href.value === "string" && hasProtocol(href.value, { acceptRelative: true });
|
|
88
90
|
});
|
|
91
|
+
const hasTarget = computed(() => !!props.target && props.target !== "_self");
|
|
92
|
+
const rel = computed(() => {
|
|
93
|
+
if (props.noRel) {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
if (props.rel !== void 0) {
|
|
97
|
+
return props.rel || null;
|
|
98
|
+
}
|
|
99
|
+
if (isExternal.value || hasTarget.value) {
|
|
100
|
+
return "noopener noreferrer";
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
});
|
|
89
104
|
const isLinkActive = computed(() => {
|
|
90
105
|
if (props.active !== void 0) {
|
|
91
106
|
return props.active;
|
|
@@ -125,6 +140,8 @@ const linkClass = computed(() => {
|
|
|
125
140
|
type,
|
|
126
141
|
disabled,
|
|
127
142
|
href,
|
|
143
|
+
rel,
|
|
144
|
+
target,
|
|
128
145
|
active: isLinkActive,
|
|
129
146
|
isExternal
|
|
130
147
|
}"
|
|
@@ -139,6 +156,8 @@ const linkClass = computed(() => {
|
|
|
139
156
|
type,
|
|
140
157
|
disabled,
|
|
141
158
|
href,
|
|
159
|
+
rel,
|
|
160
|
+
target,
|
|
142
161
|
isExternal
|
|
143
162
|
}"
|
|
144
163
|
:class="linkClass"
|
|
@@ -27,6 +27,10 @@ export interface LinkProps extends Partial<Omit<InertiaLinkProps, 'href' | 'onCl
|
|
|
27
27
|
* A rel attribute value to apply on the link. Defaults to "noopener noreferrer" for external links.
|
|
28
28
|
*/
|
|
29
29
|
rel?: 'noopener' | 'noreferrer' | 'nofollow' | 'sponsored' | 'ugc' | (string & {}) | null;
|
|
30
|
+
/**
|
|
31
|
+
* If set to true, no rel attribute will be added to the link
|
|
32
|
+
*/
|
|
33
|
+
noRel?: boolean;
|
|
30
34
|
/**
|
|
31
35
|
* Value passed to the attribute `aria-current` when the link is exact active.
|
|
32
36
|
*
|
|
@@ -61,8 +65,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<LinkPr
|
|
|
61
65
|
as: any;
|
|
62
66
|
type: "reset" | "submit" | "button";
|
|
63
67
|
active: boolean;
|
|
64
|
-
|
|
65
|
-
inactiveClass: string;
|
|
68
|
+
ariaCurrentValue: "page" | "step" | "location" | "date" | "time" | "true" | "false";
|
|
66
69
|
isAction: boolean;
|
|
67
70
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, LinkSlots>;
|
|
68
71
|
declare const _default: typeof __VLS_export;
|
|
@@ -13,6 +13,7 @@ const props = defineProps({
|
|
|
13
13
|
onClick: { type: [Function, Array], required: false },
|
|
14
14
|
href: { type: String, required: false },
|
|
15
15
|
target: { type: [String, Object, null], required: false },
|
|
16
|
+
rel: { type: [String, Object, null], required: false },
|
|
16
17
|
active: { type: Boolean, required: false },
|
|
17
18
|
isExternal: { type: Boolean, required: false }
|
|
18
19
|
});
|
|
@@ -35,7 +36,8 @@ function onClickWrapper(e) {
|
|
|
35
36
|
v-if="!!href && !isExternal && !disabled"
|
|
36
37
|
:href="href"
|
|
37
38
|
v-bind="{
|
|
38
|
-
|
|
39
|
+
rel,
|
|
40
|
+
target,
|
|
39
41
|
...$attrs
|
|
40
42
|
}"
|
|
41
43
|
@click="onClickWrapper"
|
|
@@ -50,7 +52,8 @@ function onClickWrapper(e) {
|
|
|
50
52
|
'aria-disabled': disabled ? 'true' : void 0,
|
|
51
53
|
'role': disabled ? 'link' : void 0,
|
|
52
54
|
'tabindex': disabled ? -1 : void 0,
|
|
53
|
-
'
|
|
55
|
+
'rel': rel,
|
|
56
|
+
'target': target,
|
|
54
57
|
...$attrs
|
|
55
58
|
} : as === 'button' ? {
|
|
56
59
|
as,
|
|
@@ -22,6 +22,10 @@ export interface LinkProps extends Partial<Omit<RouterLinkProps, 'custom'>>, /**
|
|
|
22
22
|
* A rel attribute value to apply on the link. Defaults to "noopener noreferrer" for external links.
|
|
23
23
|
*/
|
|
24
24
|
rel?: 'noopener' | 'noreferrer' | 'nofollow' | 'sponsored' | 'ugc' | (string & {}) | null;
|
|
25
|
+
/**
|
|
26
|
+
* If set to true, no rel attribute will be added to the link
|
|
27
|
+
*/
|
|
28
|
+
noRel?: boolean;
|
|
25
29
|
/**
|
|
26
30
|
* The type of the button when not a link.
|
|
27
31
|
* @defaultValue 'button'
|
|
@@ -54,9 +58,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<LinkPr
|
|
|
54
58
|
as: any;
|
|
55
59
|
type: "reset" | "submit" | "button";
|
|
56
60
|
active: boolean;
|
|
57
|
-
activeClass: string;
|
|
58
61
|
ariaCurrentValue: "page" | "step" | "location" | "date" | "time" | "true" | "false";
|
|
59
|
-
inactiveClass: string;
|
|
60
62
|
isAction: boolean;
|
|
61
63
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, LinkSlots>;
|
|
62
64
|
declare const _default: typeof __VLS_export;
|
|
@@ -12,6 +12,7 @@ import { hasProtocol } from "ufo";
|
|
|
12
12
|
import { useRoute, RouterLink } from "vue-router";
|
|
13
13
|
import { useAppConfig } from "#imports";
|
|
14
14
|
import { tv } from "../../utils/tv";
|
|
15
|
+
import { mergeClasses } from "../../utils";
|
|
15
16
|
import { isPartiallyEqual } from "../../utils/link";
|
|
16
17
|
import B24LinkBase from "../../components/LinkBase.vue";
|
|
17
18
|
defineOptions({ inheritAttrs: false });
|
|
@@ -21,18 +22,19 @@ const props = defineProps({
|
|
|
21
22
|
external: { type: Boolean, required: false },
|
|
22
23
|
target: { type: [String, Object, null], required: false },
|
|
23
24
|
rel: { type: [String, Object, null], required: false },
|
|
25
|
+
noRel: { type: Boolean, required: false },
|
|
24
26
|
type: { type: null, required: false, default: "button" },
|
|
25
27
|
disabled: { type: Boolean, required: false },
|
|
26
28
|
active: { type: Boolean, required: false, default: void 0 },
|
|
27
29
|
exact: { type: Boolean, required: false },
|
|
28
30
|
exactQuery: { type: [Boolean, String], required: false },
|
|
29
31
|
exactHash: { type: Boolean, required: false },
|
|
30
|
-
inactiveClass: { type: String, required: false
|
|
32
|
+
inactiveClass: { type: String, required: false },
|
|
31
33
|
custom: { type: Boolean, required: false },
|
|
32
34
|
isAction: { type: Boolean, required: false, default: false },
|
|
33
35
|
raw: { type: Boolean, required: false },
|
|
34
36
|
class: { type: null, required: false },
|
|
35
|
-
activeClass: { type: String, required: false
|
|
37
|
+
activeClass: { type: String, required: false },
|
|
36
38
|
exactActiveClass: { type: String, required: false },
|
|
37
39
|
ariaCurrentValue: { type: String, required: false, default: "page" },
|
|
38
40
|
viewTransition: { type: Boolean, required: false },
|
|
@@ -42,23 +44,20 @@ const props = defineProps({
|
|
|
42
44
|
defineSlots();
|
|
43
45
|
const route = useRoute();
|
|
44
46
|
const appConfig = useAppConfig();
|
|
45
|
-
const routerLinkProps = useForwardProps(reactiveOmit(props, "as", "type", "disabled", "active", "exact", "exactQuery", "exactHash", "activeClass", "inactiveClass", "to", "href", "raw", "custom", "class"));
|
|
47
|
+
const routerLinkProps = useForwardProps(reactiveOmit(props, "as", "type", "disabled", "active", "exact", "exactQuery", "exactHash", "activeClass", "inactiveClass", "to", "href", "raw", "custom", "class", "noRel"));
|
|
46
48
|
const b24ui = computed(() => tv({
|
|
47
49
|
extend: tv(theme),
|
|
48
50
|
...defu({
|
|
49
51
|
variants: {
|
|
50
52
|
active: {
|
|
51
|
-
true: props.activeClass,
|
|
52
|
-
false: props.inactiveClass
|
|
53
|
+
true: mergeClasses(appConfig.b24ui?.link?.variants?.active?.true, props.activeClass),
|
|
54
|
+
false: mergeClasses(appConfig.b24ui?.link?.variants?.active?.false, props.inactiveClass)
|
|
53
55
|
}
|
|
54
56
|
}
|
|
55
57
|
}, appConfig.b24ui?.link || {})
|
|
56
58
|
}));
|
|
57
59
|
const to = computed(() => props.to ?? props.href);
|
|
58
60
|
const isExternal = computed(() => {
|
|
59
|
-
if (props.target === "_blank") {
|
|
60
|
-
return true;
|
|
61
|
-
}
|
|
62
61
|
if (props.external) {
|
|
63
62
|
return true;
|
|
64
63
|
}
|
|
@@ -67,6 +66,19 @@ const isExternal = computed(() => {
|
|
|
67
66
|
}
|
|
68
67
|
return typeof to.value === "string" && hasProtocol(to.value, { acceptRelative: true });
|
|
69
68
|
});
|
|
69
|
+
const hasTarget = computed(() => !!props.target && props.target !== "_self");
|
|
70
|
+
const rel = computed(() => {
|
|
71
|
+
if (props.noRel) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
if (props.rel !== void 0) {
|
|
75
|
+
return props.rel || null;
|
|
76
|
+
}
|
|
77
|
+
if (isExternal.value || hasTarget.value) {
|
|
78
|
+
return "noopener noreferrer";
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
});
|
|
70
82
|
function isLinkActive({ route: linkRoute, isActive, isExactActive }) {
|
|
71
83
|
if (props.active !== void 0) {
|
|
72
84
|
return props.active;
|
|
@@ -115,9 +127,11 @@ function resolveLinkClass({ route: route2, isActive, isExactActive } = {}) {
|
|
|
115
127
|
as,
|
|
116
128
|
type,
|
|
117
129
|
disabled,
|
|
118
|
-
target: props.target ? props.target : void 0,
|
|
119
130
|
href,
|
|
120
131
|
navigate,
|
|
132
|
+
rel,
|
|
133
|
+
target,
|
|
134
|
+
isExternal,
|
|
121
135
|
active: isLinkActive({ route: linkRoute, isActive, isExactActive })
|
|
122
136
|
}"
|
|
123
137
|
/>
|
|
@@ -131,7 +145,10 @@ function resolveLinkClass({ route: route2, isActive, isExactActive } = {}) {
|
|
|
131
145
|
type,
|
|
132
146
|
disabled,
|
|
133
147
|
href,
|
|
134
|
-
navigate
|
|
148
|
+
navigate,
|
|
149
|
+
rel,
|
|
150
|
+
target,
|
|
151
|
+
isExternal
|
|
135
152
|
}"
|
|
136
153
|
:class="resolveLinkClass({ route: linkRoute, isActive, isExactActive })"
|
|
137
154
|
>
|
|
@@ -149,7 +166,8 @@ function resolveLinkClass({ route: route2, isActive, isExactActive } = {}) {
|
|
|
149
166
|
type,
|
|
150
167
|
disabled,
|
|
151
168
|
href: to,
|
|
152
|
-
|
|
169
|
+
rel,
|
|
170
|
+
target,
|
|
153
171
|
active,
|
|
154
172
|
isExternal
|
|
155
173
|
}"
|
|
@@ -163,7 +181,8 @@ function resolveLinkClass({ route: route2, isActive, isExactActive } = {}) {
|
|
|
163
181
|
type,
|
|
164
182
|
disabled,
|
|
165
183
|
href: to,
|
|
166
|
-
|
|
184
|
+
rel,
|
|
185
|
+
target,
|
|
167
186
|
isExternal
|
|
168
187
|
}"
|
|
169
188
|
:class="resolveLinkClass()"
|
|
@@ -22,6 +22,10 @@ export interface LinkProps extends Partial<Omit<RouterLinkProps, 'custom'>>, /**
|
|
|
22
22
|
* A rel attribute value to apply on the link. Defaults to "noopener noreferrer" for external links.
|
|
23
23
|
*/
|
|
24
24
|
rel?: 'noopener' | 'noreferrer' | 'nofollow' | 'sponsored' | 'ugc' | (string & {}) | null;
|
|
25
|
+
/**
|
|
26
|
+
* If set to true, no rel attribute will be added to the link
|
|
27
|
+
*/
|
|
28
|
+
noRel?: boolean;
|
|
25
29
|
/**
|
|
26
30
|
* The type of the button when not a link.
|
|
27
31
|
* @defaultValue 'button'
|
|
@@ -54,9 +58,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<LinkPr
|
|
|
54
58
|
as: any;
|
|
55
59
|
type: "reset" | "submit" | "button";
|
|
56
60
|
active: boolean;
|
|
57
|
-
activeClass: string;
|
|
58
61
|
ariaCurrentValue: "page" | "step" | "location" | "date" | "time" | "true" | "false";
|
|
59
|
-
inactiveClass: string;
|
|
60
62
|
isAction: boolean;
|
|
61
63
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, LinkSlots>;
|
|
62
64
|
declare const _default: typeof __VLS_export;
|
|
@@ -8,7 +8,7 @@ import { globSync } from 'tinyglobby';
|
|
|
8
8
|
import { defuFn } from 'defu';
|
|
9
9
|
|
|
10
10
|
const name = "@bitrix24/b24ui-nuxt";
|
|
11
|
-
const version = "2.1.
|
|
11
|
+
const version = "2.1.7";
|
|
12
12
|
|
|
13
13
|
function getDefaultConfig(theme) {
|
|
14
14
|
return {
|
|
@@ -9663,6 +9663,24 @@ const card = {
|
|
|
9663
9663
|
description: "group-hover:text-(--b24ui-border-color) [&_p]:group-hover:text-(--b24ui-border-color)",
|
|
9664
9664
|
externalIcon: "group-hover:text-(--b24ui-icon)"
|
|
9665
9665
|
}
|
|
9666
|
+
},
|
|
9667
|
+
{
|
|
9668
|
+
to: true,
|
|
9669
|
+
color: [
|
|
9670
|
+
"air-secondary",
|
|
9671
|
+
"air-secondary-alert",
|
|
9672
|
+
"air-secondary-accent",
|
|
9673
|
+
"air-secondary-accent-1",
|
|
9674
|
+
"air-secondary-accent-2",
|
|
9675
|
+
"air-secondary-no-accent",
|
|
9676
|
+
"air-tertiary"
|
|
9677
|
+
],
|
|
9678
|
+
class: {
|
|
9679
|
+
base: "hover:bg-(--ui-color-bg-content-secondary) hover:border-(--b24ui-border-color-hover)",
|
|
9680
|
+
title: "group-hover:text-(--b24ui-color)",
|
|
9681
|
+
description: "group-hover:text-(--b24ui-color) [&_p]:group-hover:text-(--b24ui-color)",
|
|
9682
|
+
externalIcon: "group-hover:text-(--b24ui-icon)"
|
|
9683
|
+
}
|
|
9666
9684
|
}
|
|
9667
9685
|
],
|
|
9668
9686
|
defaultVariants: {
|
package/dist/unplugin.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { join, normalize } from 'pathe';
|
|
|
3
3
|
import { createUnplugin } from 'unplugin';
|
|
4
4
|
import { defu } from 'defu';
|
|
5
5
|
import tailwind from '@tailwindcss/vite';
|
|
6
|
-
import { g as getTemplates, d as defaultOptions, a as getDefaultConfig } from './shared/b24ui-nuxt.
|
|
6
|
+
import { g as getTemplates, d as defaultOptions, a as getDefaultConfig } from './shared/b24ui-nuxt.CIiXiDdZ.mjs';
|
|
7
7
|
import fs from 'node:fs';
|
|
8
8
|
import path from 'node:path';
|
|
9
9
|
import MagicString from 'magic-string';
|
package/dist/vite.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitrix24/b24ui-nuxt",
|
|
3
3
|
"description": "Bitrix24 UI-Kit for developing web applications REST API for NUXT & VUE",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.7",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/bitrix24/b24ui.git"
|
|
@@ -90,6 +90,9 @@
|
|
|
90
90
|
]
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
|
+
"imports": {
|
|
94
|
+
"#build/b24ui.css": "./.nuxt/b24ui.css"
|
|
95
|
+
},
|
|
93
96
|
"bin": {
|
|
94
97
|
"bitrix24-ui": "./cli/index.mjs"
|
|
95
98
|
},
|
|
@@ -99,6 +102,7 @@
|
|
|
99
102
|
"README.md",
|
|
100
103
|
"README-AI.md",
|
|
101
104
|
"LICENSE",
|
|
105
|
+
".nuxt/b24ui.css",
|
|
102
106
|
"dist",
|
|
103
107
|
"cli",
|
|
104
108
|
"vue-plugin.d.ts"
|