@bitrix24/b24ui-nuxt 0.6.2 → 0.6.4

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.
Files changed (44) hide show
  1. package/.nuxt/b24ui/dropdown-menu.ts +1 -1
  2. package/.nuxt/b24ui/input-menu.ts +1 -1
  3. package/.nuxt/b24ui/popover.ts +1 -1
  4. package/.nuxt/b24ui/select-menu.ts +4 -1
  5. package/.nuxt/b24ui/select.ts +1 -1
  6. package/.nuxt/b24ui/tooltip.ts +1 -1
  7. package/dist/meta.d.mts +253 -134
  8. package/dist/meta.mjs +253 -134
  9. package/dist/module.json +1 -1
  10. package/dist/module.mjs +2 -2
  11. package/dist/runtime/components/Alert.vue +3 -3
  12. package/dist/runtime/components/App.vue +4 -0
  13. package/dist/runtime/components/App.vue.d.ts +1 -0
  14. package/dist/runtime/components/DropdownMenu.vue +1 -1
  15. package/dist/runtime/components/DropdownMenu.vue.d.ts +1 -1
  16. package/dist/runtime/components/DropdownMenuContent.vue +5 -3
  17. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +1 -1
  18. package/dist/runtime/components/Form.vue +2 -1
  19. package/dist/runtime/components/Form.vue.d.ts +17 -12
  20. package/dist/runtime/components/InputMenu.vue +4 -2
  21. package/dist/runtime/components/InputMenu.vue.d.ts +1 -1
  22. package/dist/runtime/components/Modal.vue +4 -2
  23. package/dist/runtime/components/Modal.vue.d.ts +2 -2
  24. package/dist/runtime/components/Popover.vue +4 -2
  25. package/dist/runtime/components/Popover.vue.d.ts +2 -2
  26. package/dist/runtime/components/Select.vue +4 -2
  27. package/dist/runtime/components/Select.vue.d.ts +1 -1
  28. package/dist/runtime/components/SelectMenu.vue +4 -2
  29. package/dist/runtime/components/SelectMenu.vue.d.ts +1 -1
  30. package/dist/runtime/components/Slideover.vue +4 -2
  31. package/dist/runtime/components/Slideover.vue.d.ts +2 -2
  32. package/dist/runtime/components/Toast.vue +3 -3
  33. package/dist/runtime/components/Toaster.vue +5 -3
  34. package/dist/runtime/components/Toaster.vue.d.ts +2 -2
  35. package/dist/runtime/components/Tooltip.vue +4 -2
  36. package/dist/runtime/components/Tooltip.vue.d.ts +2 -2
  37. package/dist/runtime/composables/usePortal.d.ts +6 -0
  38. package/dist/runtime/composables/usePortal.js +17 -0
  39. package/dist/runtime/types/form.d.ts +3 -1
  40. package/dist/runtime/utils/link.js +1 -0
  41. package/dist/shared/{b24ui-nuxt.wBs9vEU5.mjs → b24ui-nuxt.jU270f-Q.mjs} +13 -5
  42. package/dist/unplugin.mjs +14 -1
  43. package/dist/vite.mjs +1 -1
  44. package/package.json +7 -8
@@ -8,6 +8,7 @@ import { defu } from "defu";
8
8
  import { TooltipRoot, TooltipTrigger, TooltipPortal, TooltipContent, TooltipArrow, useForwardPropsEmits } from "reka-ui";
9
9
  import { reactivePick } from "@vueuse/core";
10
10
  import { useAppConfig } from "#imports";
11
+ import { usePortal } from "../composables/usePortal";
11
12
  import { tv } from "../utils/tv";
12
13
  import B24Kbd from "./Kbd.vue";
13
14
  const props = defineProps({
@@ -15,7 +16,7 @@ const props = defineProps({
15
16
  kbds: { type: Array, required: false },
16
17
  content: { type: Object, required: false },
17
18
  arrow: { type: [Boolean, Object], required: false },
18
- portal: { type: Boolean, required: false, default: true },
19
+ portal: { type: [Boolean, String], required: false, skipCheck: true, default: true },
19
20
  class: { type: null, required: false },
20
21
  b24ui: { type: null, required: false },
21
22
  defaultOpen: { type: Boolean, required: false },
@@ -30,6 +31,7 @@ const emits = defineEmits(["update:open"]);
30
31
  const slots = defineSlots();
31
32
  const appConfig = useAppConfig();
32
33
  const rootProps = useForwardPropsEmits(reactivePick(props, "defaultOpen", "open", "delayDuration", "disableHoverableContent", "disableClosingTrigger", "disabled", "ignoreNonKeyboardFocus"), emits);
34
+ const portalProps = usePortal(toRef(() => props.portal));
33
35
  const contentProps = toRef(() => defu(props.content, { side: "bottom", sideOffset: 8, collisionPadding: 8 }));
34
36
  const arrowProps = toRef(() => props.arrow);
35
37
  const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.tooltip || {} })({
@@ -43,7 +45,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.tooltip
43
45
  <slot :open="open" />
44
46
  </TooltipTrigger>
45
47
 
46
- <TooltipPortal :disabled="!portal">
48
+ <TooltipPortal v-bind="portalProps">
47
49
  <TooltipContent v-bind="contentProps" :class="b24ui.content({ class: [!slots.default && props.class, props.b24ui?.content] })">
48
50
  <slot name="content">
49
51
  <span v-if="text" :class="b24ui.text({ class: props.b24ui?.text })">{{ text }}</span>
@@ -23,7 +23,7 @@ export interface TooltipProps extends TooltipRootProps {
23
23
  * Render the tooltip in a portal.
24
24
  * @defaultValue true
25
25
  */
26
- portal?: boolean;
26
+ portal?: boolean | string | HTMLElement;
27
27
  class?: any;
28
28
  b24ui?: Tooltip['slots'];
29
29
  }
@@ -38,7 +38,7 @@ export interface TooltipSlots {
38
38
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<TooltipProps>, {
39
39
  portal: boolean;
40
40
  }>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {
41
- portal: boolean;
41
+ portal: boolean | string | HTMLElement;
42
42
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, Readonly<TooltipSlots> & TooltipSlots>;
43
43
  export default _default;
44
44
  type __VLS_WithDefaults<P, D> = {
@@ -0,0 +1,6 @@
1
+ import { type Ref, type InjectionKey } from 'vue';
2
+ export declare const portalTargetInjectionKey: InjectionKey<Ref<string | HTMLElement>>;
3
+ export declare function usePortal(portal: Ref<string | HTMLElement | boolean | undefined>): import("vue").ComputedRef<{
4
+ to: string | HTMLElement;
5
+ disabled: boolean;
6
+ }>;
@@ -0,0 +1,17 @@
1
+ import { inject, provide, computed } from "vue";
2
+ export const portalTargetInjectionKey = Symbol("bitrix24-ui.portal-target");
3
+ export function usePortal(portal) {
4
+ const portalTarget = inject(portalTargetInjectionKey, void 0);
5
+ const to = computed(() => {
6
+ if (typeof portal.value === "string" || portal.value instanceof HTMLElement) {
7
+ return portal.value;
8
+ }
9
+ return portalTarget?.value ?? "body";
10
+ });
11
+ const disabled = computed(() => typeof portal.value === "boolean" ? !portal.value : false);
12
+ provide(portalTargetInjectionKey, computed(() => to.value));
13
+ return computed(() => ({
14
+ to: to.value,
15
+ disabled: disabled.value
16
+ }));
17
+ }
@@ -23,7 +23,9 @@ export interface Form<T extends object> {
23
23
  touchedFields: DeepReadonly<Set<keyof T>>;
24
24
  blurredFields: DeepReadonly<Set<keyof T>>;
25
25
  }
26
- export type FormSchema<T extends object> = YupObjectSchema<T> | JoiSchema<T> | SuperstructSchema<any, any> | StandardSchemaV1;
26
+ export type FormSchema<I extends object = object, O extends object = I> = YupObjectSchema<I> | JoiSchema<I> | SuperstructSchema<any, any> | StandardSchemaV1<I, O>;
27
+ export type InferInput<Schema> = Schema extends StandardSchemaV1 ? StandardSchemaV1.InferInput<Schema> : Schema extends YupObjectSchema<infer I> ? I : Schema extends JoiSchema<infer I> ? I : Schema extends SuperstructSchema<infer I, any> ? I : Schema extends StandardSchemaV1 ? StandardSchemaV1.InferInput<Schema> : never;
28
+ export type InferOutput<Schema> = Schema extends StandardSchemaV1 ? StandardSchemaV1.InferOutput<Schema> : Schema extends YupObjectSchema<infer O> ? O : Schema extends JoiSchema<infer O> ? O : Schema extends SuperstructSchema<infer O, any> ? O : never;
27
29
  export type FormInputEvents = 'input' | 'blur' | 'change' | 'focus';
28
30
  export interface FormError<P extends string = string> {
29
31
  name?: P;
@@ -15,6 +15,7 @@ export function pickLinkProps(link) {
15
15
  "exactQuery",
16
16
  "external",
17
17
  "href",
18
+ "download",
18
19
  "inactiveClass",
19
20
  "noPrefetch",
20
21
  "noRel",
@@ -1,7 +1,7 @@
1
1
  import { fileURLToPath } from 'node:url';
2
2
  import { kebabCase } from 'scule';
3
3
  import { addTypeTemplate, addTemplate } from '@nuxt/kit';
4
- import { defuFn, defu } from 'defu';
4
+ import { defuFn } from 'defu';
5
5
 
6
6
  const getDefaultUiConfig = () => ({});
7
7
  const defaultOptions = {
@@ -1822,6 +1822,7 @@ const dropdownMenu = {
1822
1822
  "shadow-lg rounded-2xs ring ring-base-300 dark:ring-base-800",
1823
1823
  "overflow-y-auto",
1824
1824
  "motion-safe:data-[state=open]:animate-[scale-in_100ms_ease-out] motion-safe:data-[state=closed]:animate-[scale-out_100ms_ease-in]",
1825
+ "origin-(--reka-dropdown-menu-content-transform-origin)",
1825
1826
  "divide-y divide-base-master/10 dark:divide-base-100/20 scroll-py-1",
1826
1827
  "pointer-events-auto"
1827
1828
  ].join(" "),
@@ -2785,13 +2786,15 @@ const inputMenu = () => {
2785
2786
  trailing: "group absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75",
2786
2787
  arrow: "fill-base-master/10 dark:fill-base-100/20",
2787
2788
  content: [
2788
- "w-(--reka-popper-anchor-width)",
2789
+ "w-(--reka-combobox-trigger-width)",
2789
2790
  // 'max-h-60',
2791
+ "min-w-fit",
2790
2792
  // 'h-(--reka-popper-available-height)',
2791
2793
  "bg-white dark:bg-base-dark",
2792
2794
  "shadow-md rounded-2xs ring ring-base-300 dark:ring-base-800",
2793
2795
  "overflow-hidden",
2794
2796
  "data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
2797
+ "origin-(--reka-combobox-content-transform-origin)",
2795
2798
  "pointer-events-auto"
2796
2799
  ].join(" "),
2797
2800
  viewport: "divide-y divide-base-master/10 dark:divide-base-100/20 scroll-py-1",
@@ -4615,6 +4618,7 @@ const popover = {
4615
4618
  "bg-white dark:bg-base-dark",
4616
4619
  "shadow-lg rounded-2xs ring ring-base-300 dark:ring-base-800",
4617
4620
  "motion-safe:data-[state=open]:animate-[scale-in_100ms_ease-out] motion-safe:data-[state=closed]:animate-[scale-out_100ms_ease-in]",
4621
+ "origin-(--reka-popover-content-transform-origin)",
4618
4622
  "focus:outline-none pointer-events-auto"
4619
4623
  ].join(" "),
4620
4624
  arrow: "fill-white dark:fill-base-dark stroke-base-300 dark:stroke-base-800"
@@ -5407,13 +5411,15 @@ const select = () => {
5407
5411
  placeholder: "truncate text-base-400 dark:text-base-300",
5408
5412
  arrow: "fill-base-master/10 dark:fill-base-100/20",
5409
5413
  content: [
5410
- "w-(--reka-popper-anchor-width)",
5414
+ "w-(--reka-select-trigger-width)",
5411
5415
  // 'max-h-60',
5416
+ "min-w-fit",
5412
5417
  // 'h-(--reka-popper-available-height)',
5413
5418
  "bg-white dark:bg-base-dark",
5414
5419
  "shadow-md rounded-2xs ring ring-base-300 dark:ring-base-800",
5415
5420
  "overflow-hidden",
5416
5421
  "data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
5422
+ "origin-(--reka-select-content-transform-origin)",
5417
5423
  "pointer-events-auto"
5418
5424
  ].join(" "),
5419
5425
  scrollUpDownButton: [
@@ -5470,10 +5476,11 @@ const select = () => {
5470
5476
  };
5471
5477
 
5472
5478
  const selectMenu = () => {
5473
- return defu({
5479
+ return defuFn({
5474
5480
  slots: {
5475
5481
  input: "border-b border-base-300 dark:dark:border-base-800",
5476
- focusScope: "flex flex-col min-h-0"
5482
+ focusScope: "flex flex-col min-h-0",
5483
+ content: (content) => [content, "origin-(--reka-combobox-content-transform-origin) w-(--reka-combobox-trigger-width)"]
5477
5484
  },
5478
5485
  variants: {
5479
5486
  addNew: {
@@ -6739,6 +6746,7 @@ const tooltip = {
6739
6746
  "min-h-6 px-2 py-1 text-xs",
6740
6747
  "bg-base-dark text-white",
6741
6748
  "dark:bg-base-dark dark:text-base-150 dark:ring dark:ring-base-100/20",
6749
+ "origin-(--reka-tooltip-content-transform-origin)",
6742
6750
  "pointer-events-auto"
6743
6751
  ].join(" "),
6744
6752
  arrow: "fill-base-dark dark:fill-base-100/20",
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.wBs9vEU5.mjs';
6
+ import { g as getTemplates, d as defaultOptions, a as getDefaultUiConfig } from './shared/b24ui-nuxt.jU270f-Q.mjs';
7
7
  import { globSync } from 'tinyglobby';
8
8
  import { genSafeVariableName } from 'knitwork';
9
9
  import MagicString from 'magic-string';
@@ -98,6 +98,19 @@ function AppConfigPlugin(options, appConfig) {
98
98
  return `
99
99
  export default ${JSON.stringify(appConfig)}
100
100
  `;
101
+ },
102
+ vite: {
103
+ config() {
104
+ return {
105
+ test: {
106
+ server: {
107
+ deps: {
108
+ inline: ["@bitrix24/b24ui"]
109
+ }
110
+ }
111
+ }
112
+ };
113
+ }
101
114
  }
102
115
  };
103
116
  }
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.wBs9vEU5.mjs';
7
+ import './shared/b24ui-nuxt.jU270f-Q.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.6.2",
4
+ "version": "0.6.4",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/bitrix24/b24ui.git"
@@ -110,10 +110,10 @@
110
110
  "@standard-schema/spec": "^1.0.0",
111
111
  "@tailwindcss/postcss": "^4.1.4",
112
112
  "@tailwindcss/vite": "^4.1.4",
113
- "@tanstack/vue-table": "^8.21.2",
114
- "@unhead/vue": "^2.0.3",
115
- "@vueuse/core": "^13.0.0",
116
- "@vueuse/integrations": "^13.0.0",
113
+ "@tanstack/vue-table": "^8.21.3",
114
+ "@unhead/vue": "^2.0.8",
115
+ "@vueuse/core": "^13.1.0",
116
+ "@vueuse/integrations": "^13.1.0",
117
117
  "canvas-confetti": "^1.9.3",
118
118
  "colortranslator": "^4.1.0",
119
119
  "consola": "^3.4.2",
@@ -136,7 +136,7 @@
136
136
  "scule": "^1.3.0",
137
137
  "tailwind-variants": "^1.0.0",
138
138
  "tailwindcss": "^4.1.4",
139
- "tinyglobby": "^0.2.12",
139
+ "tinyglobby": "^0.2.13",
140
140
  "unplugin": "^2.3.2",
141
141
  "unplugin-auto-import": "^19.1.2",
142
142
  "unplugin-vue-components": "^28.5.0",
@@ -149,7 +149,7 @@
149
149
  "@types/canvas-confetti": "^1.9.0",
150
150
  "@vue/test-utils": "^2.4.6",
151
151
  "embla-carousel": "^8.6.0",
152
- "eslint": "^9.24.0",
152
+ "eslint": "^9.25.0",
153
153
  "happy-dom": "^17.4.4",
154
154
  "nuxt": "^3.16.2",
155
155
  "nuxt-component-meta": "^0.10.1",
@@ -237,7 +237,6 @@
237
237
  "lint": "eslint .",
238
238
  "lint:fix": "eslint . --fix",
239
239
  "typecheck": "vue-tsc --noEmit && nuxi typecheck playground && cd playground-vue && vue-tsc --noEmit",
240
- "typecheck-window": "vue-tsc --noEmit && nuxi typecheck playground && cd ../playground-vue && vue-tsc --noEmit",
241
240
  "test": "vitest",
242
241
  "test:vue": "vitest -c vitest.vue.config.ts"
243
242
  }