@bitrix24/b24ui-nuxt 0.3.1 → 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/.nuxt/b24ui.css +3 -2
- package/README.md +2 -12
- 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.cjs +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/composables/useComponentIcons.d.ts +2 -2
- package/dist/runtime/composables/useConfetti.d.ts +17 -0
- package/dist/runtime/composables/useConfetti.js +11 -0
- package/dist/runtime/types/index.d.ts +1 -1
- package/dist/runtime/types/index.js +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/dist/shared/{b24ui-nuxt.CxFyzKH7.mjs → b24ui-nuxt.BTln9cW-.mjs} +3 -2
- package/dist/shared/{b24ui-nuxt.DkKTVBhL.cjs → b24ui-nuxt.ngV6AJEg.cjs} +3 -2
- package/dist/unplugin.cjs +3 -3
- package/dist/unplugin.mjs +3 -3
- package/dist/vite.cjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +11 -8
package/dist/module.cjs
CHANGED
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, addVitePlugin, addPlugin, addComponentsDir, addImportsDir, hasNuxtModule, installModule } from '@nuxt/kit';
|
|
3
|
-
import { d as defaultOptions, a as getDefaultUiConfig, b as addTemplates } from './shared/b24ui-nuxt.
|
|
3
|
+
import { d as defaultOptions, a as getDefaultUiConfig, b as addTemplates } from './shared/b24ui-nuxt.BTln9cW-.mjs';
|
|
4
4
|
import 'node:url';
|
|
5
5
|
import 'scule';
|
|
6
6
|
|
|
@@ -15,6 +15,6 @@ export interface UseComponentIconsProps {
|
|
|
15
15
|
export declare function useComponentIcons(componentProps: MaybeRefOrGetter<UseComponentIconsProps>): {
|
|
16
16
|
isLeading: import("vue").ComputedRef<any>;
|
|
17
17
|
isTrailing: import("vue").ComputedRef<boolean>;
|
|
18
|
-
leadingIconName: import("vue").ComputedRef<
|
|
19
|
-
trailingIconName: import("vue").ComputedRef<
|
|
18
|
+
leadingIconName: import("vue").ComputedRef<IconComponent | undefined>;
|
|
19
|
+
trailingIconName: import("vue").ComputedRef<IconComponent | undefined>;
|
|
20
20
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Confetti
|
|
3
|
+
* Performant confetti animation in the browser
|
|
4
|
+
* ---
|
|
5
|
+
* @link https://github.com/catdad/canvas-confetti
|
|
6
|
+
* @link https://www.kirilv.com/canvas-confetti/
|
|
7
|
+
* @link /api_d7/bitrix/ui/confetti/index.php
|
|
8
|
+
* @see bitrix/js/ui/confetti
|
|
9
|
+
*/
|
|
10
|
+
import confetti from 'canvas-confetti';
|
|
11
|
+
import type { CreateTypes, GlobalOptions } from 'canvas-confetti';
|
|
12
|
+
declare function _useConfetti(): {
|
|
13
|
+
fire: (options?: confetti.Options) => Promise<undefined> | null;
|
|
14
|
+
create: (canvas?: HTMLCanvasElement, options?: GlobalOptions) => CreateTypes;
|
|
15
|
+
};
|
|
16
|
+
export declare const useConfetti: typeof _useConfetti;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import confetti from "canvas-confetti";
|
|
2
|
+
import { createSharedComposable } from "@vueuse/core";
|
|
3
|
+
function _useConfetti() {
|
|
4
|
+
const fire = confetti;
|
|
5
|
+
const create = confetti.create;
|
|
6
|
+
return {
|
|
7
|
+
fire,
|
|
8
|
+
create
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export const useConfetti = createSharedComposable(_useConfetti);
|
|
@@ -36,6 +36,6 @@ export * from '../components/Tooltip.vue';
|
|
|
36
36
|
export * from '../components/content/DescriptionList.vue';
|
|
37
37
|
export * from '../components/prose/TableWrapper.vue';
|
|
38
38
|
export * from './form';
|
|
39
|
-
export * from './locale';
|
|
40
39
|
export * from './icons';
|
|
40
|
+
export * from './locale';
|
|
41
41
|
export * from './utils';
|
|
@@ -36,6 +36,6 @@ export * from "../components/Tooltip.vue";
|
|
|
36
36
|
export * from "../components/content/DescriptionList.vue";
|
|
37
37
|
export * from "../components/prose/TableWrapper.vue";
|
|
38
38
|
export * from "./form.js";
|
|
39
|
-
export * from "./locale.js";
|
|
40
39
|
export * from "./icons.js";
|
|
40
|
+
export * from "./locale.js";
|
|
41
41
|
export * from "./utils.js";
|
|
@@ -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]) {
|
|
@@ -5333,8 +5333,9 @@ function getTemplates(options) {
|
|
|
5333
5333
|
templates.push({
|
|
5334
5334
|
filename: "b24ui.css",
|
|
5335
5335
|
write: true,
|
|
5336
|
-
getContents: () => `@
|
|
5337
|
-
|
|
5336
|
+
getContents: () => `@source "./b24ui";
|
|
5337
|
+
|
|
5338
|
+
@theme default static {}
|
|
5338
5339
|
`
|
|
5339
5340
|
});
|
|
5340
5341
|
templates.push({
|
|
@@ -5335,8 +5335,9 @@ function getTemplates(options) {
|
|
|
5335
5335
|
templates.push({
|
|
5336
5336
|
filename: "b24ui.css",
|
|
5337
5337
|
write: true,
|
|
5338
|
-
getContents: () => `@
|
|
5339
|
-
|
|
5338
|
+
getContents: () => `@source "./b24ui";
|
|
5339
|
+
|
|
5340
|
+
@theme default static {}
|
|
5340
5341
|
`
|
|
5341
5342
|
});
|
|
5342
5343
|
templates.push({
|
package/dist/unplugin.cjs
CHANGED
|
@@ -5,7 +5,7 @@ const pathe = require('pathe');
|
|
|
5
5
|
const unplugin = require('unplugin');
|
|
6
6
|
const defu = require('defu');
|
|
7
7
|
const tailwind = require('@tailwindcss/vite');
|
|
8
|
-
const templates = require('./shared/b24ui-nuxt.
|
|
8
|
+
const templates = require('./shared/b24ui-nuxt.ngV6AJEg.cjs');
|
|
9
9
|
const tinyglobby = require('tinyglobby');
|
|
10
10
|
const knitwork = require('knitwork');
|
|
11
11
|
const MagicString = require('magic-string');
|
|
@@ -217,10 +217,10 @@ const Bitrix24UIPlugin = unplugin.createUnplugin((_options = {}, meta) => {
|
|
|
217
217
|
configResolved(config) {
|
|
218
218
|
const plugins = config.plugins || [];
|
|
219
219
|
if (plugins.filter((i) => i.name === "unplugin-auto-import").length > 1) {
|
|
220
|
-
throw new Error("[Bitrix24 UI] Multiple instances of `unplugin-auto-import` detected.
|
|
220
|
+
throw new Error("[Bitrix24 UI] Multiple instances of `unplugin-auto-import` detected. Bitrix24 UI includes `unplugin-auto-import` already, and you can configure it using `autoImport` option in Bitrix24 UI module options.");
|
|
221
221
|
}
|
|
222
222
|
if (plugins.filter((i) => i.name === "unplugin-vue-components").length > 1) {
|
|
223
|
-
throw new Error("[Bitrix24 UI] Multiple instances of `unplugin-vue-components` detected.
|
|
223
|
+
throw new Error("[Bitrix24 UI] Multiple instances of `unplugin-vue-components` detected. Bitrix24 UI includes `unplugin-vue-components` already, and you can configure it using `components` option in Bitrix24 UI module options.");
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
}
|
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 getDefaultUiConfig } from './shared/b24ui-nuxt.
|
|
6
|
+
import { g as getTemplates, d as defaultOptions, a as getDefaultUiConfig } from './shared/b24ui-nuxt.BTln9cW-.mjs';
|
|
7
7
|
import { globSync } from 'tinyglobby';
|
|
8
8
|
import { genSafeVariableName } from 'knitwork';
|
|
9
9
|
import MagicString from 'magic-string';
|
|
@@ -207,10 +207,10 @@ const Bitrix24UIPlugin = createUnplugin((_options = {}, meta) => {
|
|
|
207
207
|
configResolved(config) {
|
|
208
208
|
const plugins = config.plugins || [];
|
|
209
209
|
if (plugins.filter((i) => i.name === "unplugin-auto-import").length > 1) {
|
|
210
|
-
throw new Error("[Bitrix24 UI] Multiple instances of `unplugin-auto-import` detected.
|
|
210
|
+
throw new Error("[Bitrix24 UI] Multiple instances of `unplugin-auto-import` detected. Bitrix24 UI includes `unplugin-auto-import` already, and you can configure it using `autoImport` option in Bitrix24 UI module options.");
|
|
211
211
|
}
|
|
212
212
|
if (plugins.filter((i) => i.name === "unplugin-vue-components").length > 1) {
|
|
213
|
-
throw new Error("[Bitrix24 UI] Multiple instances of `unplugin-vue-components` detected.
|
|
213
|
+
throw new Error("[Bitrix24 UI] Multiple instances of `unplugin-vue-components` detected. Bitrix24 UI includes `unplugin-vue-components` already, and you can configure it using `components` option in Bitrix24 UI module options.");
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
}
|
package/dist/vite.cjs
CHANGED
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": "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,12 +71,13 @@
|
|
|
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",
|
|
79
79
|
"@vueuse/integrations": "^12.7.0",
|
|
80
|
+
"canvas-confetti": "^1.9.3",
|
|
80
81
|
"colortranslator": "^4.1.0",
|
|
81
82
|
"consola": "^3.4.0",
|
|
82
83
|
"defu": "^6.1.4",
|
|
@@ -97,22 +98,23 @@
|
|
|
97
98
|
"scule": "^1.3.0",
|
|
98
99
|
"sirv": "^3.0.1",
|
|
99
100
|
"tailwind-variants": "^0.3.1",
|
|
100
|
-
"tailwindcss": "^4.0.
|
|
101
|
-
"tinyglobby": "^0.2.
|
|
101
|
+
"tailwindcss": "^4.0.9",
|
|
102
|
+
"tinyglobby": "^0.2.12",
|
|
102
103
|
"unplugin": "^2.2.0",
|
|
103
104
|
"unplugin-auto-import": "^19.1.0",
|
|
104
105
|
"unplugin-vue-components": "^28.4.0",
|
|
105
106
|
"vaul-vue": "^0.3.0"
|
|
106
107
|
},
|
|
107
108
|
"devDependencies": {
|
|
109
|
+
"@types/canvas-confetti": "^1.9.0",
|
|
108
110
|
"@nuxt/eslint-config": "^1.1.0",
|
|
109
111
|
"@nuxt/module-builder": "^0.8.4",
|
|
110
112
|
"@nuxt/test-utils": "^3.17.0",
|
|
111
113
|
"@standard-schema/spec": "^1.0.0",
|
|
112
114
|
"@vue/test-utils": "^2.4.6",
|
|
113
115
|
"embla-carousel": "^8.5.2",
|
|
114
|
-
"eslint": "^9.
|
|
115
|
-
"happy-dom": "^17.1.
|
|
116
|
+
"eslint": "^9.21.0",
|
|
117
|
+
"happy-dom": "^17.1.2",
|
|
116
118
|
"joi": "^17.13.3",
|
|
117
119
|
"knitwork": "^1.2.0",
|
|
118
120
|
"nuxt": "^3.15.4",
|
|
@@ -120,7 +122,7 @@
|
|
|
120
122
|
"superstruct": "^2.0.2",
|
|
121
123
|
"valibot": "^0.42.1",
|
|
122
124
|
"vitepress": "^1.5.0",
|
|
123
|
-
"vitest": "^3.0.
|
|
125
|
+
"vitest": "^3.0.7",
|
|
124
126
|
"vitest-environment-nuxt": "^1.0.1",
|
|
125
127
|
"vue-tsc": "^2.2.0",
|
|
126
128
|
"yup": "^1.6.1",
|
|
@@ -133,6 +135,7 @@
|
|
|
133
135
|
"@bitrix24/b24ui-nuxt": "workspace:*",
|
|
134
136
|
"chokidar": "3.6.0",
|
|
135
137
|
"debug": "4.3.7",
|
|
138
|
+
"happy-dom": "17.1.2",
|
|
136
139
|
"rollup": "4.32.1",
|
|
137
140
|
"typescript": "5.6.3",
|
|
138
141
|
"unimport": "3.14.5",
|