@bitrix24/b24ui-nuxt 0.3.2 → 0.3.3
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/meta.cjs +229 -229
- package/dist/meta.d.cts +229 -229
- package/dist/meta.d.mts +229 -229
- package/dist/meta.d.ts +229 -229
- package/dist/meta.mjs +229 -229
- package/dist/module.json +1 -1
- package/dist/runtime/vue/components/Link.vue +10 -37
- package/dist/runtime/vue/stubs.d.ts +11 -0
- package/dist/runtime/vue/stubs.js +17 -0
- package/package.json +9 -8
package/dist/module.json
CHANGED
|
@@ -186,7 +186,7 @@ function isLinkActive({ route: linkRoute, isActive, isExactActive }: any) {
|
|
|
186
186
|
return false
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
function resolveLinkClass({ route, isActive, isExactActive }: any) {
|
|
189
|
+
function resolveLinkClass({ route, isActive, isExactActive }: any = {}) {
|
|
190
190
|
const active = isLinkActive({ route, isActive, isExactActive })
|
|
191
191
|
|
|
192
192
|
if (props.raw) {
|
|
@@ -200,38 +200,10 @@ function resolveLinkClass({ route, isActive, isExactActive }: any) {
|
|
|
200
200
|
isAction: Boolean(props.isAction)
|
|
201
201
|
})
|
|
202
202
|
}
|
|
203
|
-
|
|
204
|
-
function resolveLinkClassNoRouter() {
|
|
205
|
-
if (props.raw) {
|
|
206
|
-
return [props.class, props.inactiveClass]
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
return b24ui.value({
|
|
210
|
-
class: props.class,
|
|
211
|
-
disabled: props.disabled,
|
|
212
|
-
isAction: Boolean(props.isAction)
|
|
213
|
-
})
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
// Handle navigation without vue-router
|
|
217
|
-
const handleNavigation = (href: string) => {
|
|
218
|
-
if (isExternal.value) {
|
|
219
|
-
window.location.href = href
|
|
220
|
-
} else {
|
|
221
|
-
const [path, hash] = href.split('#')
|
|
222
|
-
|
|
223
|
-
window.location.pathname = path || ''
|
|
224
|
-
if (hash) {
|
|
225
|
-
window.location.hash = hash
|
|
226
|
-
} else {
|
|
227
|
-
window.location.hash = ''
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
203
|
</script>
|
|
232
204
|
|
|
233
205
|
<template>
|
|
234
|
-
<template v-if="hasRouter">
|
|
206
|
+
<template v-if="hasRouter && !isExternal">
|
|
235
207
|
<RouterLink v-slot="{ href, navigate, route: linkRoute, isActive, isExactActive }" v-bind="routerLinkProps" :to="to || '#'" custom>
|
|
236
208
|
<template v-if="custom">
|
|
237
209
|
<slot
|
|
@@ -241,7 +213,7 @@ const handleNavigation = (href: string) => {
|
|
|
241
213
|
type,
|
|
242
214
|
disabled,
|
|
243
215
|
target: props.target ? props.target : undefined,
|
|
244
|
-
href: to ?
|
|
216
|
+
href: to ? href : undefined,
|
|
245
217
|
navigate,
|
|
246
218
|
active: isLinkActive({ route: linkRoute, isActive, isExactActive })
|
|
247
219
|
}"
|
|
@@ -254,7 +226,7 @@ const handleNavigation = (href: string) => {
|
|
|
254
226
|
as,
|
|
255
227
|
type,
|
|
256
228
|
disabled,
|
|
257
|
-
href: to ?
|
|
229
|
+
href: to ? href : undefined,
|
|
258
230
|
navigate
|
|
259
231
|
}"
|
|
260
232
|
:class="resolveLinkClass({ route: linkRoute, isActive: isActive, isExactActive: isExactActive })"
|
|
@@ -272,8 +244,8 @@ const handleNavigation = (href: string) => {
|
|
|
272
244
|
as,
|
|
273
245
|
type,
|
|
274
246
|
disabled,
|
|
275
|
-
href: to
|
|
276
|
-
|
|
247
|
+
href: to,
|
|
248
|
+
target: isExternal ? '_blank' : undefined,
|
|
277
249
|
active: false
|
|
278
250
|
}"
|
|
279
251
|
/>
|
|
@@ -285,10 +257,11 @@ const handleNavigation = (href: string) => {
|
|
|
285
257
|
as,
|
|
286
258
|
type,
|
|
287
259
|
disabled,
|
|
288
|
-
href:
|
|
260
|
+
href: (to as string),
|
|
261
|
+
target: isExternal ? '_blank' : undefined
|
|
289
262
|
}"
|
|
290
|
-
:
|
|
291
|
-
|
|
263
|
+
:is-external="isExternal"
|
|
264
|
+
:class="resolveLinkClass()"
|
|
292
265
|
>
|
|
293
266
|
<slot :active="false" />
|
|
294
267
|
</B24LinkBase>
|
|
@@ -2,7 +2,18 @@ import type { Ref } from 'vue';
|
|
|
2
2
|
import type { NuxtApp } from '#app';
|
|
3
3
|
export { useHead } from '@unhead/vue';
|
|
4
4
|
export { useRoute, useRouter } from 'vue-router';
|
|
5
|
+
export { defineShortcuts } from '../composables/defineShortcuts';
|
|
6
|
+
export { useLocale } from '../composables/useLocale';
|
|
7
|
+
export { useConfetti } from '../composables/useConfetti';
|
|
5
8
|
export declare const useAppConfig: () => any;
|
|
9
|
+
export declare const useCookie: <T = string>(_name: string, _options?: Record<string, any>) => {
|
|
10
|
+
value: Ref<T, T>;
|
|
11
|
+
get: () => T;
|
|
12
|
+
set: () => void;
|
|
13
|
+
update: () => void;
|
|
14
|
+
refresh: () => Promise<Awaited<T>>;
|
|
15
|
+
remove: () => void;
|
|
16
|
+
};
|
|
6
17
|
export declare const useState: <T>(key: string, init: () => T) => Ref<T>;
|
|
7
18
|
export declare function useNuxtApp(): {
|
|
8
19
|
isHydrating: boolean;
|
|
@@ -2,7 +2,24 @@ import { ref } from "vue";
|
|
|
2
2
|
import appConfig from "#build/app.config";
|
|
3
3
|
export { useHead } from "@unhead/vue";
|
|
4
4
|
export { useRoute, useRouter } from "vue-router";
|
|
5
|
+
export { defineShortcuts } from "../composables/defineShortcuts.js";
|
|
6
|
+
export { useLocale } from "../composables/useLocale.js";
|
|
7
|
+
export { useConfetti } from "../composables/useConfetti.js";
|
|
5
8
|
export const useAppConfig = () => appConfig;
|
|
9
|
+
export const useCookie = (_name, _options = {}) => {
|
|
10
|
+
const value = ref(null);
|
|
11
|
+
return {
|
|
12
|
+
value,
|
|
13
|
+
get: () => value.value,
|
|
14
|
+
set: () => {
|
|
15
|
+
},
|
|
16
|
+
update: () => {
|
|
17
|
+
},
|
|
18
|
+
refresh: () => Promise.resolve(value.value),
|
|
19
|
+
remove: () => {
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
6
23
|
const state = {};
|
|
7
24
|
export const useState = (key, init) => {
|
|
8
25
|
if (state[key]) {
|
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": "0.3.
|
|
4
|
+
"version": "0.3.3",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/bitrix24/b24ui.git"
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
"@nuxt/kit": "^3.15.4",
|
|
72
72
|
"@nuxt/schema": "^3.15.4",
|
|
73
73
|
"@nuxtjs/color-mode": "^3.5.2",
|
|
74
|
-
"@tailwindcss/postcss": "^4.0.
|
|
75
|
-
"@tailwindcss/vite": "^4.0.
|
|
74
|
+
"@tailwindcss/postcss": "^4.0.9",
|
|
75
|
+
"@tailwindcss/vite": "^4.0.9",
|
|
76
76
|
"@tanstack/vue-table": "^8.21.2",
|
|
77
77
|
"@unhead/vue": "^1.11.19",
|
|
78
78
|
"@vueuse/core": "^12.7.0",
|
|
@@ -98,8 +98,8 @@
|
|
|
98
98
|
"scule": "^1.3.0",
|
|
99
99
|
"sirv": "^3.0.1",
|
|
100
100
|
"tailwind-variants": "^0.3.1",
|
|
101
|
-
"tailwindcss": "^4.0.
|
|
102
|
-
"tinyglobby": "^0.2.
|
|
101
|
+
"tailwindcss": "^4.0.9",
|
|
102
|
+
"tinyglobby": "^0.2.12",
|
|
103
103
|
"unplugin": "^2.2.0",
|
|
104
104
|
"unplugin-auto-import": "^19.1.0",
|
|
105
105
|
"unplugin-vue-components": "^28.4.0",
|
|
@@ -113,8 +113,8 @@
|
|
|
113
113
|
"@standard-schema/spec": "^1.0.0",
|
|
114
114
|
"@vue/test-utils": "^2.4.6",
|
|
115
115
|
"embla-carousel": "^8.5.2",
|
|
116
|
-
"eslint": "^9.
|
|
117
|
-
"happy-dom": "^17.1.
|
|
116
|
+
"eslint": "^9.21.0",
|
|
117
|
+
"happy-dom": "^17.1.2",
|
|
118
118
|
"joi": "^17.13.3",
|
|
119
119
|
"knitwork": "^1.2.0",
|
|
120
120
|
"nuxt": "^3.15.4",
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"superstruct": "^2.0.2",
|
|
123
123
|
"valibot": "^0.42.1",
|
|
124
124
|
"vitepress": "^1.5.0",
|
|
125
|
-
"vitest": "^3.0.
|
|
125
|
+
"vitest": "^3.0.7",
|
|
126
126
|
"vitest-environment-nuxt": "^1.0.1",
|
|
127
127
|
"vue-tsc": "^2.2.0",
|
|
128
128
|
"yup": "^1.6.1",
|
|
@@ -135,6 +135,7 @@
|
|
|
135
135
|
"@bitrix24/b24ui-nuxt": "workspace:*",
|
|
136
136
|
"chokidar": "3.6.0",
|
|
137
137
|
"debug": "4.3.7",
|
|
138
|
+
"happy-dom": "17.1.2",
|
|
138
139
|
"rollup": "4.32.1",
|
|
139
140
|
"typescript": "5.6.3",
|
|
140
141
|
"unimport": "3.14.5",
|