@bitrix24/b24ui-nuxt 0.6.8 → 0.7.0

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 (199) hide show
  1. package/.nuxt/b24ui/accordion.ts +20 -0
  2. package/.nuxt/b24ui/advice.ts +2 -10
  3. package/.nuxt/b24ui/alert.ts +2 -15
  4. package/.nuxt/b24ui/avatar-group.ts +2 -10
  5. package/.nuxt/b24ui/avatar.ts +3 -11
  6. package/.nuxt/b24ui/badge.ts +48 -13
  7. package/.nuxt/b24ui/button-group.ts +2 -22
  8. package/.nuxt/b24ui/button.ts +4 -17
  9. package/.nuxt/b24ui/calendar.ts +3 -11
  10. package/.nuxt/b24ui/checkbox.ts +75 -11
  11. package/.nuxt/b24ui/chip.ts +2 -10
  12. package/.nuxt/b24ui/collapsible.ts +2 -10
  13. package/.nuxt/b24ui/container.ts +2 -10
  14. package/.nuxt/b24ui/countdown.ts +2 -10
  15. package/.nuxt/b24ui/description-list.ts +2 -15
  16. package/.nuxt/b24ui/dropdown-menu.ts +4 -11
  17. package/.nuxt/b24ui/form-field.ts +3 -10
  18. package/.nuxt/b24ui/form.ts +2 -10
  19. package/.nuxt/b24ui/index.ts +1 -0
  20. package/.nuxt/b24ui/input-menu.ts +6 -30
  21. package/.nuxt/b24ui/input-number.ts +15 -10
  22. package/.nuxt/b24ui/input.ts +4 -17
  23. package/.nuxt/b24ui/kbd.ts +2 -10
  24. package/.nuxt/b24ui/link.ts +11 -17
  25. package/.nuxt/b24ui/modal.ts +3 -11
  26. package/.nuxt/b24ui/navbar-divider.ts +2 -10
  27. package/.nuxt/b24ui/navbar-section.ts +2 -10
  28. package/.nuxt/b24ui/navbar-spacer.ts +2 -10
  29. package/.nuxt/b24ui/navbar.ts +2 -10
  30. package/.nuxt/b24ui/navigation-menu.ts +69 -60
  31. package/.nuxt/b24ui/popover.ts +2 -10
  32. package/.nuxt/b24ui/progress.ts +2 -10
  33. package/.nuxt/b24ui/radio-group.ts +3 -11
  34. package/.nuxt/b24ui/range.ts +2 -10
  35. package/.nuxt/b24ui/select-menu.ts +10 -40
  36. package/.nuxt/b24ui/select.ts +10 -40
  37. package/.nuxt/b24ui/separator.ts +2 -10
  38. package/.nuxt/b24ui/sidebar-body.ts +2 -10
  39. package/.nuxt/b24ui/sidebar-footer.ts +2 -10
  40. package/.nuxt/b24ui/sidebar-header.ts +2 -10
  41. package/.nuxt/b24ui/sidebar-heading.ts +2 -10
  42. package/.nuxt/b24ui/sidebar-layout.ts +2 -10
  43. package/.nuxt/b24ui/sidebar-section.ts +2 -10
  44. package/.nuxt/b24ui/sidebar-spacer.ts +2 -10
  45. package/.nuxt/b24ui/sidebar.ts +2 -10
  46. package/.nuxt/b24ui/skeleton.ts +2 -10
  47. package/.nuxt/b24ui/slideover.ts +2 -10
  48. package/.nuxt/b24ui/stacked-layout.ts +2 -10
  49. package/.nuxt/b24ui/switch.ts +2 -10
  50. package/.nuxt/b24ui/tabs.ts +6 -13
  51. package/.nuxt/b24ui/textarea.ts +4 -17
  52. package/.nuxt/b24ui/toast.ts +2 -15
  53. package/.nuxt/b24ui/toaster.ts +3 -11
  54. package/.nuxt/b24ui/tooltip.ts +3 -11
  55. package/.nuxt/b24ui.css +1 -1
  56. package/cli/templates.mjs +2 -2
  57. package/dist/meta.d.mts +35333 -15836
  58. package/dist/meta.mjs +35333 -15836
  59. package/dist/module.json +1 -1
  60. package/dist/module.mjs +11 -3
  61. package/dist/runtime/components/Accordion.vue +96 -0
  62. package/dist/runtime/components/Accordion.vue.d.ts +78 -0
  63. package/dist/runtime/components/Advice.vue +1 -1
  64. package/dist/runtime/components/Alert.vue +1 -1
  65. package/dist/runtime/components/App.vue +1 -1
  66. package/dist/runtime/components/Avatar.vue +11 -3
  67. package/dist/runtime/components/Avatar.vue.d.ts +2 -1
  68. package/dist/runtime/components/AvatarGroup.vue +1 -1
  69. package/dist/runtime/components/Badge.vue +5 -3
  70. package/dist/runtime/components/Badge.vue.d.ts +2 -0
  71. package/dist/runtime/components/Button.vue +2 -3
  72. package/dist/runtime/components/Button.vue.d.ts +1 -1
  73. package/dist/runtime/components/Calendar.vue +1 -1
  74. package/dist/runtime/components/Checkbox.vue +13 -4
  75. package/dist/runtime/components/Checkbox.vue.d.ts +9 -0
  76. package/dist/runtime/components/Chip.vue +1 -1
  77. package/dist/runtime/components/Collapsible.vue +1 -1
  78. package/dist/runtime/components/Countdown.vue +1 -1
  79. package/dist/runtime/components/Countdown.vue.d.ts +2 -2
  80. package/dist/runtime/components/DescriptionList.vue +3 -2
  81. package/dist/runtime/components/DescriptionList.vue.d.ts +1 -1
  82. package/dist/runtime/components/DropdownMenu.vue +1 -1
  83. package/dist/runtime/components/DropdownMenu.vue.d.ts +2 -0
  84. package/dist/runtime/components/DropdownMenuContent.vue +74 -72
  85. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +4 -20
  86. package/dist/runtime/components/Form.vue +6 -6
  87. package/dist/runtime/components/Form.vue.d.ts +12 -11
  88. package/dist/runtime/components/FormField.vue +4 -4
  89. package/dist/runtime/components/Input.vue +12 -8
  90. package/dist/runtime/components/Input.vue.d.ts +31 -30
  91. package/dist/runtime/components/InputMenu.vue +23 -20
  92. package/dist/runtime/components/InputMenu.vue.d.ts +6 -4
  93. package/dist/runtime/components/InputNumber.vue +17 -10
  94. package/dist/runtime/components/InputNumber.vue.d.ts +6 -3
  95. package/dist/runtime/components/Link.vue +5 -13
  96. package/dist/runtime/components/Modal.vue +22 -14
  97. package/dist/runtime/components/Modal.vue.d.ts +18 -5
  98. package/dist/runtime/components/Navbar.vue +1 -1
  99. package/dist/runtime/components/NavbarDivider.vue +1 -1
  100. package/dist/runtime/components/NavbarSection.vue +1 -1
  101. package/dist/runtime/components/NavbarSpacer.vue +1 -1
  102. package/dist/runtime/components/NavigationMenu.vue +186 -44
  103. package/dist/runtime/components/NavigationMenu.vue.d.ts +39 -8
  104. package/dist/runtime/components/OverlayProvider.vue +2 -2
  105. package/dist/runtime/components/Popover.vue +4 -0
  106. package/dist/runtime/components/Popover.vue.d.ts +2 -1
  107. package/dist/runtime/components/Progress.vue +3 -2
  108. package/dist/runtime/components/Progress.vue.d.ts +2 -2
  109. package/dist/runtime/components/RadioGroup.vue +24 -8
  110. package/dist/runtime/components/RadioGroup.vue.d.ts +3 -1
  111. package/dist/runtime/components/Range.vue +2 -2
  112. package/dist/runtime/components/Range.vue.d.ts +19 -20
  113. package/dist/runtime/components/Select.vue +57 -31
  114. package/dist/runtime/components/Select.vue.d.ts +110 -2
  115. package/dist/runtime/components/SelectMenu.vue +77 -23
  116. package/dist/runtime/components/SelectMenu.vue.d.ts +111 -5
  117. package/dist/runtime/components/Separator.vue +3 -3
  118. package/dist/runtime/components/Sidebar.vue +1 -1
  119. package/dist/runtime/components/SidebarBody.vue +1 -1
  120. package/dist/runtime/components/SidebarFooter.vue +1 -1
  121. package/dist/runtime/components/SidebarHeader.vue +1 -1
  122. package/dist/runtime/components/SidebarHeading.vue +1 -1
  123. package/dist/runtime/components/SidebarLayout.vue +1 -1
  124. package/dist/runtime/components/SidebarSection.vue +1 -1
  125. package/dist/runtime/components/SidebarSpacer.vue +1 -1
  126. package/dist/runtime/components/Slideover.vue +23 -15
  127. package/dist/runtime/components/Slideover.vue.d.ts +18 -5
  128. package/dist/runtime/components/StackedLayout.vue +1 -1
  129. package/dist/runtime/components/Switch.vue +1 -1
  130. package/dist/runtime/components/Tabs.vue +28 -7
  131. package/dist/runtime/components/Tabs.vue.d.ts +6 -1
  132. package/dist/runtime/components/Textarea.vue +13 -9
  133. package/dist/runtime/components/Textarea.vue.d.ts +31 -30
  134. package/dist/runtime/components/Toast.vue +7 -6
  135. package/dist/runtime/components/Toast.vue.d.ts +6 -0
  136. package/dist/runtime/components/Toaster.vue +4 -4
  137. package/dist/runtime/components/Toaster.vue.d.ts +6 -0
  138. package/dist/runtime/components/Tooltip.vue +9 -2
  139. package/dist/runtime/components/Tooltip.vue.d.ts +2 -1
  140. package/dist/runtime/components/content/TableWrapper.vue +1 -1
  141. package/dist/runtime/composables/defineLocale.d.ts +2 -0
  142. package/dist/runtime/composables/defineLocale.js +4 -0
  143. package/dist/runtime/composables/defineShortcuts.js +8 -2
  144. package/dist/runtime/composables/useFormField.d.ts +1 -1
  145. package/dist/runtime/composables/useFormField.js +2 -1
  146. package/dist/runtime/composables/useKbd.d.ts +1 -0
  147. package/dist/runtime/composables/useKbd.js +4 -3
  148. package/dist/runtime/composables/useOverlay.d.ts +11 -11
  149. package/dist/runtime/composables/useOverlay.js +17 -11
  150. package/dist/runtime/inertia/components/Link.vue +45 -60
  151. package/dist/runtime/inertia/components/Link.vue.d.ts +1 -1
  152. package/dist/runtime/inertia/components/LinkBase.vue +68 -0
  153. package/dist/runtime/inertia/components/LinkBase.vue.d.ts +25 -0
  154. package/dist/runtime/inertia/stubs.d.ts +1 -1
  155. package/dist/runtime/inertia/stubs.js +1 -1
  156. package/dist/runtime/prose/A.vue +1 -1
  157. package/dist/runtime/prose/Blockquote.vue +1 -1
  158. package/dist/runtime/prose/Code.vue +1 -1
  159. package/dist/runtime/prose/Em.vue +1 -1
  160. package/dist/runtime/prose/H1.vue +1 -1
  161. package/dist/runtime/prose/H2.vue +1 -1
  162. package/dist/runtime/prose/H3.vue +1 -1
  163. package/dist/runtime/prose/H4.vue +1 -1
  164. package/dist/runtime/prose/H5.vue +1 -1
  165. package/dist/runtime/prose/H6.vue +1 -1
  166. package/dist/runtime/prose/Hr.vue +1 -1
  167. package/dist/runtime/prose/Img.vue +1 -1
  168. package/dist/runtime/prose/Li.vue +1 -1
  169. package/dist/runtime/prose/Ol.vue +1 -1
  170. package/dist/runtime/prose/P.vue +1 -1
  171. package/dist/runtime/prose/Pre.vue +1 -1
  172. package/dist/runtime/prose/Strong.vue +1 -1
  173. package/dist/runtime/prose/Table.vue +1 -1
  174. package/dist/runtime/prose/Tbody.vue +1 -1
  175. package/dist/runtime/prose/Td.vue +1 -1
  176. package/dist/runtime/prose/Th.vue +1 -1
  177. package/dist/runtime/prose/Thead.vue +1 -1
  178. package/dist/runtime/prose/Tr.vue +1 -1
  179. package/dist/runtime/prose/Ul.vue +1 -1
  180. package/dist/runtime/types/form.d.ts +11 -10
  181. package/dist/runtime/types/index.d.ts +1 -0
  182. package/dist/runtime/types/index.js +1 -0
  183. package/dist/runtime/types/locale.d.ts +1 -0
  184. package/dist/runtime/types/tv.d.ts +53 -0
  185. package/dist/runtime/types/tv.js +0 -0
  186. package/dist/runtime/types/utils.d.ts +4 -51
  187. package/dist/runtime/types/utils.js +1 -0
  188. package/dist/runtime/utils/link.d.ts +1 -0
  189. package/dist/runtime/utils/link.js +12 -0
  190. package/dist/runtime/vue/components/Link.vue +26 -40
  191. package/dist/runtime/vue/composables/useAppConfig.js +3 -1
  192. package/dist/runtime/vue/stubs.d.ts +1 -1
  193. package/dist/runtime/vue/stubs.js +1 -1
  194. package/dist/shared/{b24ui-nuxt.jU270f-Q.mjs → b24ui-nuxt.C-kZb5Ac.mjs} +267 -121
  195. package/dist/unplugin.d.mts +2 -2
  196. package/dist/unplugin.mjs +6 -3
  197. package/dist/vite.d.mts +1 -1
  198. package/dist/vite.mjs +2 -2
  199. package/package.json +30 -29
@@ -3,7 +3,8 @@ import theme from '#build/b24ui/textarea';
3
3
  import type { UseComponentIconsProps } from '../composables/useComponentIcons';
4
4
  import type { ComponentConfig } from '../types/utils';
5
5
  type Textarea = ComponentConfig<typeof theme, AppConfig, 'textarea'>;
6
- export interface TextareaProps extends UseComponentIconsProps {
6
+ type TextareaValue = string | number | null;
7
+ export interface TextareaProps<T extends TextareaValue = TextareaValue> extends UseComponentIconsProps {
7
8
  /**
8
9
  * The element or component this component should render as.
9
10
  * @defaultValue 'div'
@@ -81,11 +82,20 @@ export interface TextareaProps extends UseComponentIconsProps {
81
82
  * @defaultValue false
82
83
  */
83
84
  highlight?: boolean;
85
+ modelValue?: T;
86
+ defaultValue?: T;
87
+ modelModifiers?: {
88
+ string?: boolean;
89
+ number?: boolean;
90
+ trim?: boolean;
91
+ lazy?: boolean;
92
+ nullify?: boolean;
93
+ };
84
94
  class?: any;
85
95
  b24ui?: Textarea['slots'];
86
96
  }
87
- export interface TextareaEmits {
88
- (e: 'update:modelValue', payload: string | number): void;
97
+ export interface TextareaEmits<T extends TextareaValue = TextareaValue> {
98
+ (e: 'update:modelValue', payload: T): void;
89
99
  (e: 'blur', event: FocusEvent): void;
90
100
  (e: 'change', event: Event): void;
91
101
  }
@@ -94,31 +104,22 @@ export interface TextareaSlots {
94
104
  default(props?: {}): any;
95
105
  trailing(props?: {}): any;
96
106
  }
97
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<TextareaProps & {
98
- modelValue?: string | number | null;
99
- }, {
100
- textareaRef: import("vue").Ref<HTMLTextAreaElement | null, HTMLTextAreaElement | null>;
101
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
102
- "update:modelValue": (value: string | number | null | undefined) => any;
103
- } & {
104
- blur: (event: FocusEvent) => any;
105
- change: (event: Event) => any;
106
- "update:modelValue": (payload: string | number) => any;
107
- }, string, import("vue").PublicProps, Readonly<TextareaProps & {
108
- modelValue?: string | number | null;
109
- }> & Readonly<{
110
- onBlur?: ((event: FocusEvent) => any) | undefined;
111
- onChange?: ((event: Event) => any) | undefined;
112
- "onUpdate:modelValue"?: ((payload: string | number) => any) | undefined;
113
- }>, {
114
- autofocusDelay: number;
115
- autoresizeDelay: number;
116
- rows: number;
117
- maxrows: number;
118
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, TextareaSlots>;
119
- export default _default;
120
- type __VLS_WithSlots<T, S> = T & {
121
- new (): {
122
- $slots: S;
123
- };
107
+ declare const _default: <T extends TextareaValue>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
108
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
109
+ readonly onBlur?: ((event: FocusEvent) => any) | undefined;
110
+ readonly onChange?: ((event: Event) => any) | undefined;
111
+ readonly "onUpdate:modelValue"?: ((payload: T) => any) | undefined;
112
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onBlur" | "onChange" | "onUpdate:modelValue"> & TextareaProps<T> & Partial<{}>> & import("vue").PublicProps;
113
+ expose(exposed: import("vue").ShallowUnwrapRef<{
114
+ textareaRef: import("vue").Ref<HTMLTextAreaElement | null, HTMLTextAreaElement | null>;
115
+ }>): void;
116
+ attrs: any;
117
+ slots: TextareaSlots;
118
+ emit: TextareaEmits<T>;
119
+ }>) => import("vue").VNode & {
120
+ __ctx?: Awaited<typeof __VLS_setup>;
124
121
  };
122
+ export default _default;
123
+ type __VLS_PrettifyLocal<T> = {
124
+ [K in keyof T]: T[K];
125
+ } & {};
@@ -3,7 +3,7 @@ import theme from "#build/b24ui/toast";
3
3
  </script>
4
4
 
5
5
  <script setup>
6
- import { ref, computed, onMounted } from "vue";
6
+ import { ref, computed, onMounted, nextTick } from "vue";
7
7
  import { ToastRoot, ToastTitle, ToastDescription, ToastAction, ToastClose, useForwardPropsEmits } from "reka-ui";
8
8
  import { reactivePick } from "@vueuse/core";
9
9
  import { useAppConfig } from "#imports";
@@ -20,6 +20,7 @@ const props = defineProps({
20
20
  avatar: { type: Object, required: false },
21
21
  color: { type: null, required: false },
22
22
  orientation: { type: null, required: false, default: "vertical" },
23
+ progress: { type: Boolean, required: false, default: true },
23
24
  actions: { type: Array, required: false },
24
25
  close: { type: [Boolean, Object], required: false, default: true },
25
26
  closeIcon: { type: [Function, Object], required: false },
@@ -46,9 +47,9 @@ onMounted(() => {
46
47
  if (!el.value) {
47
48
  return;
48
49
  }
49
- setTimeout(() => {
50
- height.value = el.value.$el.getBoundingClientRect()?.height;
51
- }, 0);
50
+ nextTick(() => {
51
+ height.value = el.value?.$el?.getBoundingClientRect()?.height;
52
+ });
52
53
  });
53
54
  defineExpose({
54
55
  height
@@ -61,7 +62,7 @@ defineExpose({
61
62
  v-slot="{ remaining, duration }"
62
63
  v-bind="rootProps"
63
64
  :data-orientation="orientation"
64
- :class="b24ui.root({ class: [props.class, props.b24ui?.root] })"
65
+ :class="b24ui.root({ class: [props.b24ui?.root, props.class] })"
65
66
  :style="{ '--height': height }"
66
67
  >
67
68
  <slot name="leading">
@@ -127,6 +128,6 @@ defineExpose({
127
128
  </ToastClose>
128
129
  </div>
129
130
 
130
- <div v-if="remaining > 0 && duration" :class="b24ui.progress({ class: props.b24ui?.progress })" :style="{ width: `${remaining / duration * 100}%` }" />
131
+ <div v-if="progress && remaining > 0 && duration" :class="b24ui.progress({ class: props.b24ui?.progress })" :style="{ width: `${remaining / duration * 100}%` }" />
131
132
  </ToastRoot>
132
133
  </template>
@@ -26,6 +26,11 @@ export interface ToastProps extends Pick<ToastRootProps, 'defaultOpen' | 'open'
26
26
  * @defaultValue 'vertical'
27
27
  */
28
28
  orientation?: Toast['variants']['orientation'];
29
+ /**
30
+ * Whether to show the progress bar.
31
+ * @defaultValue true
32
+ */
33
+ progress?: boolean;
29
34
  /**
30
35
  * Display a list of actions:
31
36
  * - under the title and description when orientation is `vertical`
@@ -147,6 +152,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ToastProps
147
152
  }>, "currentTarget">) => any) | undefined;
148
153
  }>, {
149
154
  close: boolean | Partial<ButtonProps>;
155
+ progress: boolean;
150
156
  orientation: Toast["variants"]["orientation"];
151
157
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ToastSlots>;
152
158
  export default _default;
@@ -18,6 +18,7 @@ import B24Toast from "./Toast.vue";
18
18
  const props = defineProps({
19
19
  position: { type: null, required: false, default: "top-right" },
20
20
  expand: { type: Boolean, required: false, default: true },
21
+ progress: { type: Boolean, required: false, default: true },
21
22
  portal: { type: [Boolean, String], required: false, skipCheck: true, default: true },
22
23
  duration: { type: Number, required: false, default: 5e3 },
23
24
  class: { type: null, required: false },
@@ -76,6 +77,7 @@ function getOffset(index) {
76
77
  v-for="(toast, index) in toasts"
77
78
  :key="toast.id"
78
79
  ref="refs"
80
+ :progress="progress"
79
81
  v-bind="proxyToastProps(toast)"
80
82
  :close="toast.close"
81
83
  :data-expanded="expanded"
@@ -88,9 +90,7 @@ function getOffset(index) {
88
90
  '--translate': expanded ? 'calc(var(--offset) * var(--translate-factor))' : 'calc(var(--before) * var(--gap))',
89
91
  '--transform': 'translateY(var(--translate)) scale(var(--scale))'
90
92
  }"
91
- :class="[b24ui.base(), {
92
- 'cursor-pointer': !!toast.onClick
93
- }]"
93
+ :class="b24ui.base({ class: [props.b24ui?.base, toast.onClick ? 'cursor-pointer' : void 0] })"
94
94
  @update:open="onUpdateOpen($event, toast.id)"
95
95
  @click="toast.onClick && toast.onClick(toast)"
96
96
  />
@@ -98,7 +98,7 @@ function getOffset(index) {
98
98
  <ToastPortal v-bind="portalProps">
99
99
  <ToastViewport
100
100
  :data-expanded="expanded"
101
- :class="b24ui.viewport({ class: [props.class, props.b24ui?.viewport] })"
101
+ :class="b24ui.viewport({ class: [props.b24ui?.viewport, props.class] })"
102
102
  :style="{
103
103
  '--scale-factor': '0.05',
104
104
  '--translate-factor': position?.startsWith('top') ? '1px' : '-1px',
@@ -14,6 +14,11 @@ export interface ToasterProps extends Omit<ToastProviderProps, 'swipeDirection'>
14
14
  * @defaultValue true
15
15
  */
16
16
  expand?: boolean;
17
+ /**
18
+ * Whether to show the progress bar on all toasts.
19
+ * @defaultValue true
20
+ */
21
+ progress?: boolean;
17
22
  /**
18
23
  * Render the toaster in a portal.
19
24
  * @defaultValue true
@@ -30,6 +35,7 @@ export interface ToasterSlots {
30
35
  default(props?: {}): any;
31
36
  }
32
37
  declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ToasterProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ToasterProps> & Readonly<{}>, {
38
+ progress: boolean;
33
39
  position: Toaster["variants"]["position"];
34
40
  duration: number;
35
41
  expand: boolean;
@@ -17,6 +17,7 @@ const props = defineProps({
17
17
  content: { type: Object, required: false },
18
18
  arrow: { type: [Boolean, Object], required: false },
19
19
  portal: { type: [Boolean, String], required: false, skipCheck: true, default: true },
20
+ reference: { type: null, required: false },
20
21
  class: { type: null, required: false },
21
22
  b24ui: { type: null, required: false },
22
23
  defaultOpen: { type: Boolean, required: false },
@@ -41,12 +42,18 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.tooltip
41
42
 
42
43
  <template>
43
44
  <TooltipRoot v-slot="{ open }" v-bind="rootProps">
44
- <TooltipTrigger v-if="!!slots.default" v-bind="$attrs" as-child :class="props.class">
45
+ <TooltipTrigger
46
+ v-if="!!slots.default || !!reference"
47
+ v-bind="$attrs"
48
+ as-child
49
+ :reference="reference"
50
+ :class="props.class"
51
+ >
45
52
  <slot :open="open" />
46
53
  </TooltipTrigger>
47
54
 
48
55
  <TooltipPortal v-bind="portalProps">
49
- <TooltipContent v-bind="contentProps" :class="b24ui.content({ class: [!slots.default && props.class, props.b24ui?.content] })">
56
+ <TooltipContent v-bind="contentProps" :class="b24ui.content({ class: [!slots.default && props.b24ui?.content, props.class] })">
50
57
  <slot name="content">
51
58
  <span v-if="text" :class="b24ui.text({ class: props.b24ui?.text })">{{ text }}</span>
52
59
 
@@ -1,4 +1,4 @@
1
- import type { TooltipRootProps, TooltipRootEmits, TooltipContentProps, TooltipContentEmits, TooltipArrowProps } from 'reka-ui';
1
+ import type { TooltipRootProps, TooltipRootEmits, TooltipContentProps, TooltipContentEmits, TooltipArrowProps, TooltipTriggerProps } from 'reka-ui';
2
2
  import type { AppConfig } from '@nuxt/schema';
3
3
  import theme from '#build/b24ui/tooltip';
4
4
  import type { KbdProps } from '../types';
@@ -24,6 +24,7 @@ export interface TooltipProps extends TooltipRootProps {
24
24
  * @defaultValue true
25
25
  */
26
26
  portal?: boolean | string | HTMLElement;
27
+ reference?: TooltipTriggerProps['reference'];
27
28
  class?: any;
28
29
  b24ui?: Tooltip['slots'];
29
30
  }
@@ -37,7 +37,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.content
37
37
  <template>
38
38
  <Primitive
39
39
  :as="as"
40
- :class="b24ui.base({ class: [props.class, props.b24ui?.base] })"
40
+ :class="b24ui.base({ class: [props.b24ui?.base, props.class] })"
41
41
  >
42
42
  <slot />
43
43
  </Primitive>
@@ -1,4 +1,5 @@
1
1
  import type { Locale, Direction } from '../types/locale';
2
+ import type { DeepPartial } from '../types/utils';
2
3
  interface DefineLocaleOptions<M> {
3
4
  name: string;
4
5
  code: string;
@@ -7,4 +8,5 @@ interface DefineLocaleOptions<M> {
7
8
  messages: M;
8
9
  }
9
10
  export declare function defineLocale<M>(options: DefineLocaleOptions<M>): Locale<M>;
11
+ export declare function extendLocale<M>(locale: Locale<M>, options: Partial<DefineLocaleOptions<DeepPartial<M>>>): Locale<M>;
10
12
  export {};
@@ -3,3 +3,7 @@ import { defu } from "defu";
3
3
  export function defineLocale(options) {
4
4
  return defu(options, { dir: "ltr" });
5
5
  }
6
+ // @__NO_SIDE_EFFECTS__
7
+ export function extendLocale(locale, options) {
8
+ return defu(options, locale);
9
+ }
@@ -1,5 +1,6 @@
1
1
  import { ref, computed, toValue } from "vue";
2
2
  import { useEventListener, useActiveElement, useDebounceFn } from "@vueuse/core";
3
+ import { useKbd } from "./useKbd.js";
3
4
  const chainedShortcutRegex = /^[^-]+.*-.*[^-]+$/;
4
5
  const combinedShortcutRegex = /^[^_]+.*_.*[^_]+$/;
5
6
  export function extractShortcuts(items) {
@@ -27,6 +28,7 @@ export function defineShortcuts(config, options = {}) {
27
28
  chainedInputs.value.splice(0, chainedInputs.value.length);
28
29
  };
29
30
  const debouncedClearChainedInput = useDebounceFn(clearChainedInput, options.chainDelay ?? 800);
31
+ const { macOS } = useKbd();
30
32
  const activeElement = useActiveElement();
31
33
  const onKeyDown = (e) => {
32
34
  if (!e.key) {
@@ -86,13 +88,13 @@ export function defineShortcuts(config, options = {}) {
86
88
  return null;
87
89
  }
88
90
  let shortcut;
89
- if (key.includes("-") && key !== "-" && !key.match(chainedShortcutRegex)?.length) {
91
+ if (key.includes("-") && key !== "-" && !key.includes("_") && !key.match(chainedShortcutRegex)?.length) {
90
92
  console.trace(`[Shortcut] Invalid key: "${key}"`);
91
93
  }
92
94
  if (key.includes("_") && key !== "_" && !key.match(combinedShortcutRegex)?.length) {
93
95
  console.trace(`[Shortcut] Invalid key: "${key}"`);
94
96
  }
95
- const chained = key.includes("-") && key !== "-";
97
+ const chained = key.includes("-") && key !== "-" && !key.includes("_");
96
98
  if (chained) {
97
99
  shortcut = {
98
100
  key: key.toLowerCase(),
@@ -112,6 +114,10 @@ export function defineShortcuts(config, options = {}) {
112
114
  };
113
115
  }
114
116
  shortcut.chained = chained;
117
+ if (!macOS.value && shortcut.metaKey && !shortcut.ctrlKey) {
118
+ shortcut.metaKey = false;
119
+ shortcut.ctrlKey = true;
120
+ }
115
121
  if (typeof shortcutConfig === "function") {
116
122
  shortcut.handler = shortcutConfig;
117
123
  } else if (typeof shortcutConfig === "object") {
@@ -13,7 +13,7 @@ type Props<T> = {
13
13
  };
14
14
  export declare const formOptionsInjectionKey: InjectionKey<ComputedRef<FormInjectedOptions>>;
15
15
  export declare const formBusInjectionKey: InjectionKey<UseEventBusReturn<FormEvent<any>, string>>;
16
- export declare const formFieldInjectionKey: InjectionKey<ComputedRef<FormFieldInjectedOptions<FormFieldProps>>>;
16
+ export declare const formFieldInjectionKey: InjectionKey<ComputedRef<FormFieldInjectedOptions<FormFieldProps>> | undefined>;
17
17
  export declare const inputIdInjectionKey: InjectionKey<Ref<string | undefined>>;
18
18
  export declare const formInputsInjectionKey: InjectionKey<Ref<Record<string, {
19
19
  id?: string;
@@ -1,4 +1,4 @@
1
- import { inject, computed } from "vue";
1
+ import { inject, computed, provide } from "vue";
2
2
  import { useDebounceFn } from "@vueuse/core";
3
3
  export const formOptionsInjectionKey = Symbol("bitrix24-ui.form-options");
4
4
  export const formBusInjectionKey = Symbol("bitrix24-ui.form-events");
@@ -12,6 +12,7 @@ export function useFormField(props, opts) {
12
12
  const formField = inject(formFieldInjectionKey, void 0);
13
13
  const formInputs = inject(formInputsInjectionKey, void 0);
14
14
  const inputId = inject(inputIdInjectionKey, void 0);
15
+ provide(formFieldInjectionKey, void 0);
15
16
  if (formField && inputId) {
16
17
  if (opts?.bind === false) {
17
18
  inputId.value = void 0;
@@ -10,6 +10,7 @@ export declare const kbdKeysMap: {
10
10
  win: string;
11
11
  command: string;
12
12
  shift: string;
13
+ control: string;
13
14
  option: string;
14
15
  enter: string;
15
16
  delete: string;
@@ -7,6 +7,7 @@ export const kbdKeysMap = {
7
7
  win: "\u229E",
8
8
  command: "\u2318",
9
9
  shift: "\u21E7",
10
+ control: "\u2303",
10
11
  option: "\u2325",
11
12
  enter: "\u21B5",
12
13
  delete: "\u2326",
@@ -31,9 +32,9 @@ const _useKbd = () => {
31
32
  ctrl: " "
32
33
  });
33
34
  onMounted(() => {
34
- kbdKeysSpecificMap.meta = macOS.value ? kbdKeysMap.command : kbdKeysMap.win;
35
- kbdKeysSpecificMap.alt = macOS.value ? kbdKeysMap.option : "alt";
36
- kbdKeysSpecificMap.ctrl = macOS.value ? "\u2303" : "ctrl";
35
+ kbdKeysSpecificMap.meta = macOS.value ? kbdKeysMap.command : "Ctrl";
36
+ kbdKeysSpecificMap.ctrl = macOS.value ? kbdKeysMap.control : "Ctrl";
37
+ kbdKeysSpecificMap.alt = macOS.value ? kbdKeysMap.option : "Alt";
37
38
  });
38
39
  function getKbdKey(value) {
39
40
  if (!value) {
@@ -11,28 +11,28 @@ interface ManagedOverlayOptionsPrivate<T extends Component> {
11
11
  id: symbol;
12
12
  isMounted: boolean;
13
13
  isOpen: boolean;
14
+ originalProps?: ComponentProps<T>;
14
15
  resolvePromise?: (value: any) => void;
15
16
  }
16
17
  export type Overlay = OverlayOptions<Component> & ManagedOverlayOptionsPrivate<Component>;
17
- interface OverlayInstance<T extends Component> extends Omit<ManagedOverlayOptionsPrivate<T>, 'component'> {
18
+ type OverlayInstance<T extends Component> = Omit<ManagedOverlayOptionsPrivate<T>, 'component'> & {
18
19
  id: symbol;
19
- result: Promise<CloseEventArgType<ComponentEmit<T>>>;
20
- open: (props?: ComponentProps<T>) => Omit<OverlayInstance<T>, 'open' | 'close' | 'patch' | 'modelValue' | 'resolvePromise'>;
20
+ open: (props?: ComponentProps<T>) => OpenedOverlay<T>;
21
21
  close: (value?: any) => void;
22
22
  patch: (props: Partial<ComponentProps<T>>) => void;
23
- }
23
+ };
24
+ type OpenedOverlay<T extends Component> = Omit<OverlayInstance<T>, 'open' | 'close' | 'patch' | 'modelValue' | 'resolvePromise'> & {
25
+ result: Promise<CloseEventArgType<ComponentEmit<T>>>;
26
+ };
24
27
  declare function _useOverlay(): {
25
28
  overlays: import("vue").ShallowReactive<Overlay[]>;
26
- open: <T extends Component>(id: symbol, props?: ComponentProps<T>) => {
27
- id: symbol;
28
- isMounted: boolean;
29
- isOpen: boolean;
30
- result: Promise<any>;
31
- };
29
+ open: <T extends Component>(id: symbol, props?: ComponentProps<T>) => OpenedOverlay<T>;
32
30
  close: (id: symbol, value?: any) => void;
31
+ closeAll: () => void;
33
32
  create: <T extends Component>(component: T, _options?: OverlayOptions<ComponentProps<T>>) => OverlayInstance<T>;
34
33
  patch: <T extends Component>(id: symbol, props: Partial<ComponentProps<T>>) => void;
35
- unMount: (id: symbol) => void;
34
+ unmount: (id: symbol) => void;
35
+ isOpen: (id: symbol) => boolean;
36
36
  };
37
37
  export declare const useOverlay: typeof _useOverlay;
38
38
  export {};
@@ -10,13 +10,12 @@ function _useOverlay() {
10
10
  component: markRaw(component),
11
11
  isMounted: !!defaultOpen,
12
12
  destroyOnClose: !!destroyOnClose,
13
- props: props || {}
13
+ originalProps: props || {},
14
+ props: { ...props || {} }
14
15
  });
15
16
  overlays.push(options);
16
17
  return {
17
18
  ...options,
18
- result: new Promise(() => {
19
- }),
20
19
  open: (props2) => open(options.id, props2),
21
20
  close: (value) => close(options.id, value),
22
21
  patch: (props2) => patch(options.id, props2)
@@ -26,6 +25,8 @@ function _useOverlay() {
26
25
  const overlay = getOverlay(id);
27
26
  if (props) {
28
27
  patch(overlay.id, props);
28
+ } else {
29
+ patch(overlay.id, overlay.originalProps);
29
30
  }
30
31
  overlay.isOpen = true;
31
32
  overlay.isMounted = true;
@@ -33,9 +34,7 @@ function _useOverlay() {
33
34
  id,
34
35
  isMounted: overlay.isMounted,
35
36
  isOpen: overlay.isOpen,
36
- result: new Promise((resolve) => {
37
- overlay.resolvePromise = resolve;
38
- })
37
+ result: new Promise((resolve) => overlay.resolvePromise = resolve)
39
38
  };
40
39
  };
41
40
  const close = (id, value) => {
@@ -46,7 +45,10 @@ function _useOverlay() {
46
45
  overlay.resolvePromise = void 0;
47
46
  }
48
47
  };
49
- const unMount = (id) => {
48
+ const closeAll = () => {
49
+ overlays.forEach((overlay) => close(overlay.id));
50
+ };
51
+ const unmount = (id) => {
50
52
  const overlay = getOverlay(id);
51
53
  overlay.isMounted = false;
52
54
  if (overlay.destroyOnClose) {
@@ -56,9 +58,7 @@ function _useOverlay() {
56
58
  };
57
59
  const patch = (id, props) => {
58
60
  const overlay = getOverlay(id);
59
- Object.entries(props).forEach(([key, value]) => {
60
- overlay.props[key] = value;
61
- });
61
+ overlay.props = { ...props };
62
62
  };
63
63
  const getOverlay = (id) => {
64
64
  const overlay = overlays.find((overlay2) => overlay2.id === id);
@@ -67,13 +67,19 @@ function _useOverlay() {
67
67
  }
68
68
  return overlay;
69
69
  };
70
+ const isOpen = (id) => {
71
+ const overlay = getOverlay(id);
72
+ return overlay.isOpen;
73
+ };
70
74
  return {
71
75
  overlays,
72
76
  open,
73
77
  close,
78
+ closeAll,
74
79
  create,
75
80
  patch,
76
- unMount
81
+ unmount,
82
+ isOpen
77
83
  };
78
84
  }
79
85
  export const useOverlay = /* @__PURE__ */ createSharedComposable(_useOverlay);
@@ -7,7 +7,7 @@ import { computed } from "vue";
7
7
  import { defu } from "defu";
8
8
  import { useForwardProps } from "reka-ui";
9
9
  import { reactiveOmit } from "@vueuse/core";
10
- import { usePage, Link as InertiaLink } from "@inertiajs/vue3";
10
+ import { usePage } from "@inertiajs/vue3";
11
11
  import { hasProtocol } from "ufo";
12
12
  import { useAppConfig } from "#imports";
13
13
  import { tv } from "../../utils/tv";
@@ -33,7 +33,6 @@ const props = defineProps({
33
33
  data: { type: Object, required: false },
34
34
  method: { type: String, required: false },
35
35
  headers: { type: Object, required: false },
36
- onClick: { type: Function, required: false },
37
36
  preserveScroll: { type: [Boolean, String, Function], required: false },
38
37
  preserveState: { type: [Boolean, String, Function], required: false },
39
38
  replace: { type: Boolean, required: false },
@@ -53,8 +52,9 @@ const props = defineProps({
53
52
  cacheFor: { type: [Number, String, Array], required: false }
54
53
  });
55
54
  defineSlots();
55
+ const page = usePage();
56
56
  const appConfig = useAppConfig();
57
- const routerLinkProps = useForwardProps(reactiveOmit(props, "as", "type", "disabled", "active", "exact", "activeClass", "inactiveClass", "to", "raw", "class"));
57
+ const routerLinkProps = useForwardProps(reactiveOmit(props, "as", "type", "disabled", "active", "exact", "activeClass", "inactiveClass", "to", "href", "raw", "custom", "class"));
58
58
  const b24ui = computed(() => tv({
59
59
  extend: tv(theme),
60
60
  ...defu({
@@ -66,12 +66,33 @@ const b24ui = computed(() => tv({
66
66
  }
67
67
  }, appConfig.b24ui?.link || {})
68
68
  }));
69
+ const href = computed(() => props.to ?? props.href);
69
70
  const isExternal = computed(() => {
70
- if (!props.to) return false;
71
- return typeof props.to === "string" && hasProtocol(props.to, { acceptRelative: true });
71
+ if (props.external) {
72
+ return true;
73
+ }
74
+ if (!href.value) {
75
+ return false;
76
+ }
77
+ return typeof href.value === "string" && hasProtocol(href.value, { acceptRelative: true });
78
+ });
79
+ const isLinkActive = computed(() => {
80
+ if (props.active !== void 0) {
81
+ return props.active;
82
+ }
83
+ if (!href.value) {
84
+ return false;
85
+ }
86
+ if (props.exact && page.url === href.value) {
87
+ return true;
88
+ }
89
+ if (!props.exact && page.url.startsWith(href.value)) {
90
+ return true;
91
+ }
92
+ return false;
72
93
  });
73
94
  const linkClass = computed(() => {
74
- const active = isActive.value;
95
+ const active = isLinkActive.value;
75
96
  if (props.raw) {
76
97
  return [props.class, active ? props.activeClass : props.inactiveClass];
77
98
  }
@@ -82,72 +103,36 @@ const linkClass = computed(() => {
82
103
  isAction: Boolean(props.isAction)
83
104
  });
84
105
  });
85
- const page = usePage();
86
- const url = computed(() => props.to ?? props.href ?? "#");
87
- const isActive = computed(() => props.active || (props.exact ? url.value === props.href : page?.url.startsWith(url.value)));
88
106
  </script>
89
107
 
90
108
  <template>
91
- <template v-if="!isExternal">
92
- <InertiaLink v-bind="routerLinkProps" :href="url" custom>
93
- <template v-if="custom">
94
- <slot
95
- v-bind="{
96
- ...$attrs,
97
- as,
98
- type,
99
- disabled,
100
- href: url,
101
- active: isActive
102
- }"
103
- />
104
- </template>
105
- <B24LinkBase
106
- v-else
107
- v-bind="{
109
+ <template v-if="custom">
110
+ <slot
111
+ v-bind="{
108
112
  ...$attrs,
113
+ ...routerLinkProps,
109
114
  as,
110
115
  type,
111
116
  disabled,
112
- href: url,
113
- active: isActive
117
+ href,
118
+ active: isLinkActive,
119
+ isExternal
114
120
  }"
115
- :class="linkClass"
116
- >
117
- <slot :active="isActive" />
118
- </B24LinkBase>
119
- </InertiaLink>
121
+ />
120
122
  </template>
121
-
122
- <template v-else>
123
- <template v-if="custom">
124
- <slot
125
- v-bind="{
123
+ <B24LinkBase
124
+ v-else
125
+ v-bind="{
126
126
  ...$attrs,
127
+ ...routerLinkProps,
127
128
  as,
128
129
  type,
129
130
  disabled,
130
- href: to,
131
- target: isExternal ? '_blank' : void 0,
132
- active: isActive
131
+ href,
132
+ isExternal
133
133
  }"
134
- />
135
- </template>
136
- <B24LinkBase
137
- v-else
138
- v-bind="{
139
- ...$attrs,
140
- as,
141
- type,
142
- disabled,
143
- href: url,
144
- target: isExternal ? '_blank' : void 0,
145
- active: isActive
146
- }"
147
- :is-external="isExternal"
148
- :class="linkClass"
149
- >
150
- <slot :active="isActive" />
151
- </B24LinkBase>
152
- </template>
134
+ :class="linkClass"
135
+ >
136
+ <slot :active="isLinkActive" />
137
+ </B24LinkBase>
153
138
  </template>
@@ -1,6 +1,6 @@
1
1
  import type { ButtonHTMLAttributes } from 'vue';
2
2
  import type { InertiaLinkProps } from '@inertiajs/vue3';
3
- interface NuxtLinkProps extends Omit<InertiaLinkProps, 'href'> {
3
+ interface NuxtLinkProps extends Omit<InertiaLinkProps, 'href' | 'onClick'> {
4
4
  activeClass?: string;
5
5
  /**
6
6
  * Route Location the link should navigate to when clicked on.