@bitrix24/b24ui-nuxt 0.6.8 → 0.7.1

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 (201) 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 +3 -11
  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/air-design-tokens.css +1 -0
  62. package/dist/runtime/components/Accordion.vue +96 -0
  63. package/dist/runtime/components/Accordion.vue.d.ts +78 -0
  64. package/dist/runtime/components/Advice.vue +1 -1
  65. package/dist/runtime/components/Alert.vue +1 -1
  66. package/dist/runtime/components/App.vue +1 -1
  67. package/dist/runtime/components/Avatar.vue +11 -3
  68. package/dist/runtime/components/Avatar.vue.d.ts +2 -1
  69. package/dist/runtime/components/AvatarGroup.vue +1 -1
  70. package/dist/runtime/components/Badge.vue +5 -3
  71. package/dist/runtime/components/Badge.vue.d.ts +2 -0
  72. package/dist/runtime/components/Button.vue +2 -3
  73. package/dist/runtime/components/Button.vue.d.ts +1 -1
  74. package/dist/runtime/components/Calendar.vue +1 -1
  75. package/dist/runtime/components/Checkbox.vue +13 -4
  76. package/dist/runtime/components/Checkbox.vue.d.ts +9 -0
  77. package/dist/runtime/components/Chip.vue +1 -1
  78. package/dist/runtime/components/Collapsible.vue +1 -1
  79. package/dist/runtime/components/Countdown.vue +1 -1
  80. package/dist/runtime/components/Countdown.vue.d.ts +2 -2
  81. package/dist/runtime/components/DescriptionList.vue +3 -2
  82. package/dist/runtime/components/DescriptionList.vue.d.ts +1 -1
  83. package/dist/runtime/components/DropdownMenu.vue +1 -1
  84. package/dist/runtime/components/DropdownMenu.vue.d.ts +2 -0
  85. package/dist/runtime/components/DropdownMenuContent.vue +74 -72
  86. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +4 -20
  87. package/dist/runtime/components/Form.vue +6 -6
  88. package/dist/runtime/components/Form.vue.d.ts +12 -11
  89. package/dist/runtime/components/FormField.vue +4 -4
  90. package/dist/runtime/components/Input.vue +12 -8
  91. package/dist/runtime/components/Input.vue.d.ts +31 -30
  92. package/dist/runtime/components/InputMenu.vue +23 -20
  93. package/dist/runtime/components/InputMenu.vue.d.ts +6 -4
  94. package/dist/runtime/components/InputNumber.vue +17 -10
  95. package/dist/runtime/components/InputNumber.vue.d.ts +6 -3
  96. package/dist/runtime/components/Link.vue +5 -13
  97. package/dist/runtime/components/Modal.vue +22 -14
  98. package/dist/runtime/components/Modal.vue.d.ts +18 -5
  99. package/dist/runtime/components/Navbar.vue +1 -1
  100. package/dist/runtime/components/NavbarDivider.vue +1 -1
  101. package/dist/runtime/components/NavbarSection.vue +1 -1
  102. package/dist/runtime/components/NavbarSpacer.vue +1 -1
  103. package/dist/runtime/components/NavigationMenu.vue +186 -44
  104. package/dist/runtime/components/NavigationMenu.vue.d.ts +39 -8
  105. package/dist/runtime/components/OverlayProvider.vue +2 -2
  106. package/dist/runtime/components/Popover.vue +4 -0
  107. package/dist/runtime/components/Popover.vue.d.ts +2 -1
  108. package/dist/runtime/components/Progress.vue +3 -2
  109. package/dist/runtime/components/Progress.vue.d.ts +2 -2
  110. package/dist/runtime/components/RadioGroup.vue +24 -8
  111. package/dist/runtime/components/RadioGroup.vue.d.ts +3 -1
  112. package/dist/runtime/components/Range.vue +2 -2
  113. package/dist/runtime/components/Range.vue.d.ts +19 -20
  114. package/dist/runtime/components/Select.vue +57 -31
  115. package/dist/runtime/components/Select.vue.d.ts +110 -2
  116. package/dist/runtime/components/SelectMenu.vue +77 -23
  117. package/dist/runtime/components/SelectMenu.vue.d.ts +111 -5
  118. package/dist/runtime/components/Separator.vue +3 -3
  119. package/dist/runtime/components/Sidebar.vue +1 -1
  120. package/dist/runtime/components/SidebarBody.vue +1 -1
  121. package/dist/runtime/components/SidebarFooter.vue +1 -1
  122. package/dist/runtime/components/SidebarHeader.vue +1 -1
  123. package/dist/runtime/components/SidebarHeading.vue +1 -1
  124. package/dist/runtime/components/SidebarLayout.vue +1 -1
  125. package/dist/runtime/components/SidebarSection.vue +1 -1
  126. package/dist/runtime/components/SidebarSpacer.vue +1 -1
  127. package/dist/runtime/components/Slideover.vue +23 -15
  128. package/dist/runtime/components/Slideover.vue.d.ts +18 -5
  129. package/dist/runtime/components/StackedLayout.vue +1 -1
  130. package/dist/runtime/components/Switch.vue +1 -1
  131. package/dist/runtime/components/Tabs.vue +28 -7
  132. package/dist/runtime/components/Tabs.vue.d.ts +6 -1
  133. package/dist/runtime/components/Textarea.vue +13 -9
  134. package/dist/runtime/components/Textarea.vue.d.ts +31 -30
  135. package/dist/runtime/components/Toast.vue +7 -6
  136. package/dist/runtime/components/Toast.vue.d.ts +6 -0
  137. package/dist/runtime/components/Toaster.vue +4 -4
  138. package/dist/runtime/components/Toaster.vue.d.ts +6 -0
  139. package/dist/runtime/components/Tooltip.vue +9 -2
  140. package/dist/runtime/components/Tooltip.vue.d.ts +2 -1
  141. package/dist/runtime/components/content/TableWrapper.vue +1 -1
  142. package/dist/runtime/composables/defineLocale.d.ts +2 -0
  143. package/dist/runtime/composables/defineLocale.js +4 -0
  144. package/dist/runtime/composables/defineShortcuts.js +8 -2
  145. package/dist/runtime/composables/useFormField.d.ts +1 -1
  146. package/dist/runtime/composables/useFormField.js +2 -1
  147. package/dist/runtime/composables/useKbd.d.ts +1 -0
  148. package/dist/runtime/composables/useKbd.js +4 -3
  149. package/dist/runtime/composables/useOverlay.d.ts +11 -11
  150. package/dist/runtime/composables/useOverlay.js +17 -11
  151. package/dist/runtime/index.css +1 -1
  152. package/dist/runtime/inertia/components/Link.vue +45 -60
  153. package/dist/runtime/inertia/components/Link.vue.d.ts +1 -1
  154. package/dist/runtime/inertia/components/LinkBase.vue +68 -0
  155. package/dist/runtime/inertia/components/LinkBase.vue.d.ts +25 -0
  156. package/dist/runtime/inertia/stubs.d.ts +1 -1
  157. package/dist/runtime/inertia/stubs.js +1 -1
  158. package/dist/runtime/prose/A.vue +1 -1
  159. package/dist/runtime/prose/Blockquote.vue +1 -1
  160. package/dist/runtime/prose/Code.vue +1 -1
  161. package/dist/runtime/prose/Em.vue +1 -1
  162. package/dist/runtime/prose/H1.vue +1 -1
  163. package/dist/runtime/prose/H2.vue +1 -1
  164. package/dist/runtime/prose/H3.vue +1 -1
  165. package/dist/runtime/prose/H4.vue +1 -1
  166. package/dist/runtime/prose/H5.vue +1 -1
  167. package/dist/runtime/prose/H6.vue +1 -1
  168. package/dist/runtime/prose/Hr.vue +1 -1
  169. package/dist/runtime/prose/Img.vue +1 -1
  170. package/dist/runtime/prose/Li.vue +1 -1
  171. package/dist/runtime/prose/Ol.vue +1 -1
  172. package/dist/runtime/prose/P.vue +1 -1
  173. package/dist/runtime/prose/Pre.vue +1 -1
  174. package/dist/runtime/prose/Strong.vue +1 -1
  175. package/dist/runtime/prose/Table.vue +1 -1
  176. package/dist/runtime/prose/Tbody.vue +1 -1
  177. package/dist/runtime/prose/Td.vue +1 -1
  178. package/dist/runtime/prose/Th.vue +1 -1
  179. package/dist/runtime/prose/Thead.vue +1 -1
  180. package/dist/runtime/prose/Tr.vue +1 -1
  181. package/dist/runtime/prose/Ul.vue +1 -1
  182. package/dist/runtime/types/form.d.ts +11 -10
  183. package/dist/runtime/types/index.d.ts +1 -0
  184. package/dist/runtime/types/index.js +1 -0
  185. package/dist/runtime/types/locale.d.ts +1 -0
  186. package/dist/runtime/types/tv.d.ts +53 -0
  187. package/dist/runtime/types/tv.js +0 -0
  188. package/dist/runtime/types/utils.d.ts +4 -51
  189. package/dist/runtime/types/utils.js +1 -0
  190. package/dist/runtime/utils/link.d.ts +1 -0
  191. package/dist/runtime/utils/link.js +12 -0
  192. package/dist/runtime/vue/components/Link.vue +26 -40
  193. package/dist/runtime/vue/composables/useAppConfig.js +3 -1
  194. package/dist/runtime/vue/stubs.d.ts +1 -1
  195. package/dist/runtime/vue/stubs.js +1 -1
  196. package/dist/shared/{b24ui-nuxt.jU270f-Q.mjs → b24ui-nuxt.CxsFEY3M.mjs} +268 -122
  197. package/dist/unplugin.d.mts +2 -2
  198. package/dist/unplugin.mjs +6 -3
  199. package/dist/vite.d.mts +1 -1
  200. package/dist/vite.mjs +2 -2
  201. package/package.json +30 -29
@@ -54,7 +54,7 @@ function onUpdate(value) {
54
54
  </script>
55
55
 
56
56
  <template>
57
- <Primitive :as="as" :class="b24ui.root({ class: [props.class, props.b24ui?.root] })">
57
+ <Primitive :as="as" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
58
58
  <div :class="b24ui.container({ class: props.b24ui?.container })">
59
59
  <SwitchRoot
60
60
  :id="id"
@@ -3,7 +3,7 @@ import theme from "#build/b24ui/tabs";
3
3
  </script>
4
4
 
5
5
  <script setup>
6
- import { computed } from "vue";
6
+ import { ref, computed } from "vue";
7
7
  import { TabsRoot, TabsList, TabsIndicator, TabsTrigger, TabsContent, useForwardPropsEmits } from "reka-ui";
8
8
  import { reactivePick } from "@vueuse/core";
9
9
  import { useAppConfig } from "#imports";
@@ -39,26 +39,42 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.tabs ||
39
39
  size: props.size,
40
40
  orientation: props.orientation
41
41
  }));
42
+ const triggersRef = ref([]);
43
+ defineExpose({
44
+ triggersRef
45
+ });
42
46
  </script>
43
47
 
44
48
  <template>
45
- <TabsRoot v-bind="rootProps" :class="b24ui.root({ class: [props.class, props.b24ui?.root] })">
49
+ <TabsRoot v-bind="rootProps" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
46
50
  <TabsList :class="b24ui.list({ class: props.b24ui?.list })">
47
51
  <TabsIndicator :class="b24ui.indicator({ class: props.b24ui?.indicator })" />
48
52
 
49
53
  <slot name="list-leading" />
50
54
 
51
- <TabsTrigger v-for="(item, index) in items" :key="index" :value="item.value || String(index)" :disabled="item.disabled" :class="b24ui.trigger({ class: props.b24ui?.trigger })">
55
+ <TabsTrigger
56
+ v-for="(item, index) in items"
57
+ :key="index"
58
+ :ref="(el) => triggersRef[index] = el"
59
+ :value="item.value || String(index)"
60
+ :disabled="item.disabled"
61
+ :class="b24ui.trigger({ class: [props.b24ui?.trigger, item.b24ui?.trigger] })"
62
+ >
52
63
  <slot name="leading" :item="item" :index="index">
53
64
  <Component
54
65
  :is="item.icon"
55
66
  v-if="item.icon"
56
- :class="b24ui.leadingIcon({ class: props.b24ui?.leadingIcon })"
67
+ :class="b24ui.leadingIcon({ class: [props.b24ui?.leadingIcon, item.b24ui?.leadingIcon] })"
68
+ />
69
+ <B24Avatar
70
+ v-else-if="item.avatar"
71
+ :size="item.b24ui?.leadingAvatarSize || props.b24ui?.leadingAvatarSize || b24ui.leadingAvatarSize()"
72
+ v-bind="item.avatar"
73
+ :class="b24ui.leadingAvatar({ class: [props.b24ui?.leadingAvatar, item.b24ui?.leadingAvatar] })"
57
74
  />
58
- <B24Avatar v-else-if="item.avatar" :size="props.b24ui?.leadingAvatarSize || b24ui.leadingAvatarSize()" v-bind="item.avatar" :class="b24ui.leadingAvatar({ class: props.b24ui?.leadingAvatar })" />
59
75
  </slot>
60
76
 
61
- <span v-if="getLabel(item) || !!slots.default" :class="b24ui.label({ class: props.b24ui?.label })">
77
+ <span v-if="getLabel(item) || !!slots.default" :class="b24ui.label({ class: [props.b24ui?.label, item.b24ui?.label] })">
62
78
  <slot :item="item" :index="index">{{ getLabel(item) }}</slot>
63
79
  </span>
64
80
 
@@ -69,7 +85,12 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.tabs ||
69
85
  </TabsList>
70
86
 
71
87
  <template v-if="!!content">
72
- <TabsContent v-for="(item, index) in items" :key="index" :value="item.value || String(index)" :class="b24ui.content({ class: props.b24ui?.content })">
88
+ <TabsContent
89
+ v-for="(item, index) in items"
90
+ :key="index"
91
+ :value="item.value || String(index)"
92
+ :class="b24ui.content({ class: [props.b24ui?.content, item.b24ui?.content, item.class] })"
93
+ >
73
94
  <slot :name="item.slot || 'content'" :item="item" :index="index">
74
95
  {{ item.content }}
75
96
  </slot>
@@ -1,3 +1,4 @@
1
+ import type { ComponentPublicInstance } from 'vue';
1
2
  import type { TabsRootProps, TabsRootEmits } from 'reka-ui';
2
3
  import type { AppConfig } from '@nuxt/schema';
3
4
  import theme from '#build/b24ui/tabs';
@@ -16,6 +17,8 @@ export interface TabsItem {
16
17
  /** A unique value for the tab item. Defaults to the index. */
17
18
  value?: string | number;
18
19
  disabled?: boolean;
20
+ class?: any;
21
+ b24ui?: Pick<Tabs['slots'], 'trigger' | 'leadingIcon' | 'leadingAvatarSize' | 'leadingAvatar' | 'label' | 'content'>;
19
22
  [key: string]: any;
20
23
  }
21
24
  export interface TabsProps<T extends TabsItem = TabsItem> extends Pick<TabsRootProps<string | number>, 'defaultValue' | 'modelValue' | 'activationMode' | 'unmountOnHide'> {
@@ -75,7 +78,9 @@ declare const _default: <T extends TabsItem>(__VLS_props: NonNullable<Awaited<ty
75
78
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
76
79
  readonly "onUpdate:modelValue"?: ((payload: string | number) => any) | undefined;
77
80
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue"> & TabsProps<T> & Partial<{}>> & import("vue").PublicProps;
78
- expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
81
+ expose(exposed: import("vue").ShallowUnwrapRef<{
82
+ triggersRef: import("vue").Ref<ComponentPublicInstance[], ComponentPublicInstance[]>;
83
+ }>): void;
79
84
  attrs: any;
80
85
  slots: TabsSlots<T>;
81
86
  emit: (evt: "update:modelValue", payload: string | number) => void;
@@ -5,6 +5,7 @@ import theme from "#build/b24ui/textarea";
5
5
  <script setup>
6
6
  import { ref, computed, onMounted, nextTick, watch } from "vue";
7
7
  import { Primitive } from "reka-ui";
8
+ import { useVModel } from "@vueuse/core";
8
9
  import { useAppConfig } from "#imports";
9
10
  import { useComponentIcons } from "../composables/useComponentIcons";
10
11
  import { useFormField } from "../composables/useFormField";
@@ -33,6 +34,9 @@ const props = defineProps({
33
34
  tag: { type: String, required: false },
34
35
  tagColor: { type: null, required: false },
35
36
  highlight: { type: Boolean, required: false },
37
+ modelValue: { type: null, required: false },
38
+ defaultValue: { type: null, required: false },
39
+ modelModifiers: { type: Object, required: false },
36
40
  class: { type: null, required: false },
37
41
  b24ui: { type: null, required: false },
38
42
  icon: { type: [Function, Object], required: false },
@@ -41,9 +45,9 @@ const props = defineProps({
41
45
  trailing: { type: Boolean, required: false },
42
46
  trailingIcon: { type: [Function, Object], required: false }
43
47
  });
44
- const slots = defineSlots();
45
48
  const emits = defineEmits(["update:modelValue", "blur", "change"]);
46
- const [modelValue, modelModifiers] = defineModel({ type: [String, Number, null] });
49
+ const slots = defineSlots();
50
+ const modelValue = useVModel(props, "modelValue", emits, { defaultValue: props.defaultValue });
47
51
  const appConfig = useAppConfig();
48
52
  const { emitFormFocus, emitFormBlur, emitFormInput, emitFormChange, color, id, name, highlight, disabled, ariaAttrs } = useFormField(props, { deferInputValidation: true });
49
53
  const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(props);
@@ -65,13 +69,13 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.textare
65
69
  }));
66
70
  const textareaRef = ref(null);
67
71
  function updateInput(value) {
68
- if (modelModifiers.trim) {
72
+ if (props.modelModifiers?.trim) {
69
73
  value = value?.trim() ?? null;
70
74
  }
71
- if (modelModifiers.number) {
75
+ if (props.modelModifiers?.number) {
72
76
  value = looseToNumber(value);
73
77
  }
74
- if (modelModifiers.nullify) {
78
+ if (props.modelModifiers?.nullify) {
75
79
  value ||= null;
76
80
  }
77
81
  modelValue.value = value;
@@ -79,16 +83,16 @@ function updateInput(value) {
79
83
  }
80
84
  function onInput(event) {
81
85
  autoResize();
82
- if (!modelModifiers.lazy) {
86
+ if (!props.modelModifiers?.lazy) {
83
87
  updateInput(event.target.value);
84
88
  }
85
89
  }
86
90
  function onChange(event) {
87
91
  const value = event.target.value;
88
- if (modelModifiers.lazy) {
92
+ if (props.modelModifiers?.lazy) {
89
93
  updateInput(value);
90
94
  }
91
- if (modelModifiers.trim) {
95
+ if (props.modelModifiers?.trim) {
92
96
  event.target.value = value.trim();
93
97
  }
94
98
  emitFormChange();
@@ -138,7 +142,7 @@ defineExpose({
138
142
  </script>
139
143
 
140
144
  <template>
141
- <Primitive :as="as" :class="b24ui.root({ class: [props.class, props.b24ui?.root] })">
145
+ <Primitive :as="as" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
142
146
  <div v-if="isTag" :class="b24ui.tag({ class: props.b24ui?.tag })">
143
147
  {{ props.tag }}
144
148
  </div>
@@ -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 {};