@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/dist/module.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  const defu = require('defu');
4
4
  const kit = require('@nuxt/kit');
5
- const templates = require('./shared/b24ui-nuxt.DkKTVBhL.cjs');
5
+ const templates = require('./shared/b24ui-nuxt.ngV6AJEg.cjs');
6
6
  require('node:url');
7
7
  require('scule');
8
8
 
package/dist/module.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "nuxt": ">=3.13.1"
6
6
  },
7
7
  "docs": "https://bitrix24.github.io/b24ui/guide/installation-nuxt-app.html",
8
- "version": "0.3.1",
8
+ "version": "0.3.3",
9
9
  "builder": {
10
10
  "@nuxt/module-builder": "0.8.4",
11
11
  "unbuild": "2.0.0"
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.CxFyzKH7.mjs';
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<import("vue").FunctionalComponent<import("vue").HTMLAttributes & import("vue").VNodeProps, {}, any, {}> | undefined>;
19
- trailingIconName: import("vue").ComputedRef<import("vue").FunctionalComponent<import("vue").HTMLAttributes & import("vue").VNodeProps, {}, any, {}> | undefined>;
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 ? (isExternal ? to as string : href) : undefined,
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 ? (isExternal ? to as string : href) : undefined,
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 ? (isExternal ? to as string : href) : undefined,
276
- navigate: () => to && handleNavigation(to as string),
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: to ? (isExternal ? to as string : to as string) : href as string
260
+ href: (to as string),
261
+ target: isExternal ? '_blank' : undefined
289
262
  }"
290
- :class="resolveLinkClassNoRouter()"
291
- @click="to && handleNavigation(to as string)"
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: () => `@theme default {
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: () => `@theme default {
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.DkKTVBhL.cjs');
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. Nuxt UI includes `unplugin-auto-import` already, and you can configure it using `autoImport` option in Bitrix24 UI module options.");
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. Nuxt UI includes `unplugin-vue-components` already, and you can configure it using `components` option in Bitrix24 UI module options.");
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.CxFyzKH7.mjs';
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. Nuxt UI includes `unplugin-auto-import` already, and you can configure it using `autoImport` option in Bitrix24 UI module options.");
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. Nuxt UI includes `unplugin-vue-components` already, and you can configure it using `components` option in Bitrix24 UI module options.");
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
@@ -6,7 +6,7 @@ require('pathe');
6
6
  require('unplugin');
7
7
  require('defu');
8
8
  require('@tailwindcss/vite');
9
- require('./shared/b24ui-nuxt.DkKTVBhL.cjs');
9
+ require('./shared/b24ui-nuxt.ngV6AJEg.cjs');
10
10
  require('scule');
11
11
  require('@nuxt/kit');
12
12
  require('tinyglobby');
package/dist/vite.mjs CHANGED
@@ -4,7 +4,7 @@ import 'pathe';
4
4
  import 'unplugin';
5
5
  import 'defu';
6
6
  import '@tailwindcss/vite';
7
- import './shared/b24ui-nuxt.CxFyzKH7.mjs';
7
+ import './shared/b24ui-nuxt.BTln9cW-.mjs';
8
8
  import 'scule';
9
9
  import '@nuxt/kit';
10
10
  import 'tinyglobby';
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.1",
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.8",
75
- "@tailwindcss/vite": "^4.0.8",
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.8",
101
- "tinyglobby": "^0.2.11",
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.20.1",
115
- "happy-dom": "^17.1.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.6",
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",