@bitrix24/b24ui-nuxt 0.7.2 → 1.0.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 (260) hide show
  1. package/.nuxt/b24ui/accordion.ts +3 -3
  2. package/.nuxt/b24ui/advice.ts +6 -5
  3. package/.nuxt/b24ui/alert.ts +102 -49
  4. package/.nuxt/b24ui/avatar-group.ts +10 -10
  5. package/.nuxt/b24ui/avatar.ts +18 -18
  6. package/.nuxt/b24ui/badge.ts +167 -176
  7. package/.nuxt/b24ui/button-group.ts +3 -1
  8. package/.nuxt/b24ui/button.ts +179 -170
  9. package/.nuxt/b24ui/calendar.ts +48 -28
  10. package/.nuxt/b24ui/checkbox.ts +82 -85
  11. package/.nuxt/b24ui/chip.ts +121 -32
  12. package/.nuxt/b24ui/container.ts +1 -1
  13. package/.nuxt/b24ui/content/table-wrapper.ts +11 -11
  14. package/.nuxt/b24ui/countdown.ts +11 -11
  15. package/.nuxt/b24ui/description-list.ts +6 -6
  16. package/.nuxt/b24ui/dropdown-menu.ts +111 -183
  17. package/.nuxt/b24ui/form-field.ts +19 -19
  18. package/.nuxt/b24ui/index.ts +0 -1
  19. package/.nuxt/b24ui/input-menu.ts +294 -357
  20. package/.nuxt/b24ui/input-number.ts +111 -259
  21. package/.nuxt/b24ui/input.ts +136 -259
  22. package/.nuxt/b24ui/kbd.ts +15 -13
  23. package/.nuxt/b24ui/link.ts +5 -5
  24. package/.nuxt/b24ui/modal.ts +14 -12
  25. package/.nuxt/b24ui/navbar-divider.ts +1 -1
  26. package/.nuxt/b24ui/navbar-section.ts +1 -1
  27. package/.nuxt/b24ui/navbar.ts +1 -1
  28. package/.nuxt/b24ui/navigation-menu.ts +70 -754
  29. package/.nuxt/b24ui/popover.ts +2 -2
  30. package/.nuxt/b24ui/progress.ts +58 -68
  31. package/.nuxt/b24ui/prose/a.ts +1 -1
  32. package/.nuxt/b24ui/prose/blockquote.ts +1 -1
  33. package/.nuxt/b24ui/prose/code.ts +45 -9
  34. package/.nuxt/b24ui/prose/h1.ts +21 -2
  35. package/.nuxt/b24ui/prose/h2.ts +21 -12
  36. package/.nuxt/b24ui/prose/h3.ts +21 -12
  37. package/.nuxt/b24ui/prose/h4.ts +21 -12
  38. package/.nuxt/b24ui/prose/h5.ts +21 -12
  39. package/.nuxt/b24ui/prose/h6.ts +21 -12
  40. package/.nuxt/b24ui/prose/hr.ts +1 -1
  41. package/.nuxt/b24ui/prose/ol.ts +1 -1
  42. package/.nuxt/b24ui/prose/p.ts +26 -1
  43. package/.nuxt/b24ui/prose/thead.ts +1 -1
  44. package/.nuxt/b24ui/prose/ul.ts +1 -1
  45. package/.nuxt/b24ui/radio-group.ts +115 -155
  46. package/.nuxt/b24ui/range.ts +38 -26
  47. package/.nuxt/b24ui/select-menu.ts +251 -306
  48. package/.nuxt/b24ui/select.ts +246 -301
  49. package/.nuxt/b24ui/separator.ts +40 -85
  50. package/.nuxt/b24ui/sidebar-header.ts +1 -1
  51. package/.nuxt/b24ui/sidebar-heading.ts +1 -1
  52. package/.nuxt/b24ui/sidebar-layout.ts +130 -19
  53. package/.nuxt/b24ui/sidebar-section.ts +1 -1
  54. package/.nuxt/b24ui/skeleton.ts +19 -1
  55. package/.nuxt/b24ui/slideover.ts +35 -34
  56. package/.nuxt/b24ui/switch.ts +59 -48
  57. package/.nuxt/b24ui/tabs.ts +26 -239
  58. package/.nuxt/b24ui/textarea.ts +50 -236
  59. package/.nuxt/b24ui/toast.ts +38 -30
  60. package/.nuxt/b24ui/toaster.ts +1 -1
  61. package/.nuxt/b24ui/tooltip.ts +5 -5
  62. package/cli/templates.mjs +2 -1
  63. package/dist/meta.d.mts +18759 -5002
  64. package/dist/meta.mjs +18759 -5002
  65. package/dist/module.d.mts +1 -0
  66. package/dist/module.json +2 -2
  67. package/dist/module.mjs +3 -5
  68. package/dist/runtime/air-design-tokens/001_b24_global.css +1 -0
  69. package/dist/runtime/air-design-tokens/002_b24_context_utility.css +0 -0
  70. package/dist/runtime/air-design-tokens/003_b24_context_light.css +1 -0
  71. package/dist/runtime/air-design-tokens/004_b24_context_dark.css +1 -0
  72. package/dist/runtime/air-design-tokens/005_b24_context_edge-light.css +1 -0
  73. package/dist/runtime/air-design-tokens/006_b24_context_edge-dark.css +1 -0
  74. package/dist/runtime/air-design-tokens/007_b24_global.css +1 -0
  75. package/dist/runtime/air-design-tokens/008_ui_global.css +1 -0
  76. package/dist/runtime/air-design-tokens/009_b24_tools.css +1 -0
  77. package/dist/runtime/air-design-tokens/components/badge-counter.css +1 -0
  78. package/dist/runtime/air-design-tokens/components/button.css +1 -0
  79. package/dist/runtime/air-design-tokens/components/navigation-menu.css +1 -0
  80. package/dist/runtime/air-design-tokens/components/popup.css +1 -0
  81. package/dist/runtime/air-design-tokens/components/scrollbar.css +2 -0
  82. package/dist/runtime/air-design-tokens/index.css +1 -0
  83. package/dist/runtime/components/Accordion.vue.d.ts +1 -1
  84. package/dist/runtime/components/Advice.vue +1 -13
  85. package/dist/runtime/components/Advice.vue.d.ts +1 -1
  86. package/dist/runtime/components/Alert.vue +6 -4
  87. package/dist/runtime/components/Alert.vue.d.ts +11 -4
  88. package/dist/runtime/components/App.vue.d.ts +1 -1
  89. package/dist/runtime/components/Avatar.vue.d.ts +1 -1
  90. package/dist/runtime/components/AvatarGroup.vue.d.ts +1 -1
  91. package/dist/runtime/components/Badge.vue +7 -11
  92. package/dist/runtime/components/Badge.vue.d.ts +6 -8
  93. package/dist/runtime/components/Button.vue +18 -15
  94. package/dist/runtime/components/Button.vue.d.ts +5 -7
  95. package/dist/runtime/components/ButtonGroup.vue.d.ts +1 -1
  96. package/dist/runtime/components/Calendar.vue +8 -8
  97. package/dist/runtime/components/Calendar.vue.d.ts +14 -8
  98. package/dist/runtime/components/Checkbox.vue.d.ts +2 -2
  99. package/dist/runtime/components/Chip.vue +28 -7
  100. package/dist/runtime/components/Chip.vue.d.ts +22 -2
  101. package/dist/runtime/components/Collapsible.vue.d.ts +1 -1
  102. package/dist/runtime/components/Container.vue.d.ts +1 -1
  103. package/dist/runtime/components/Countdown.vue.d.ts +5 -3
  104. package/dist/runtime/components/DescriptionList.vue.d.ts +1 -1
  105. package/dist/runtime/components/DropdownMenu.vue +20 -9
  106. package/dist/runtime/components/DropdownMenu.vue.d.ts +1 -5
  107. package/dist/runtime/components/DropdownMenuContent.vue +29 -7
  108. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +14 -6
  109. package/dist/runtime/components/Form.vue +3 -3
  110. package/dist/runtime/components/Form.vue.d.ts +6 -5
  111. package/dist/runtime/components/FormField.vue +2 -2
  112. package/dist/runtime/components/FormField.vue.d.ts +4 -4
  113. package/dist/runtime/components/Input.vue +8 -4
  114. package/dist/runtime/components/Input.vue.d.ts +9 -8
  115. package/dist/runtime/components/InputMenu.vue +44 -18
  116. package/dist/runtime/components/InputMenu.vue.d.ts +17 -223
  117. package/dist/runtime/components/InputNumber.vue +14 -11
  118. package/dist/runtime/components/InputNumber.vue.d.ts +13 -87
  119. package/dist/runtime/components/Kbd.vue +6 -3
  120. package/dist/runtime/components/Kbd.vue.d.ts +7 -3
  121. package/dist/runtime/components/Link.vue +6 -5
  122. package/dist/runtime/components/Link.vue.d.ts +1 -3
  123. package/dist/runtime/components/LinkBase.vue.d.ts +1 -1
  124. package/dist/runtime/components/Modal.vue +37 -33
  125. package/dist/runtime/components/Modal.vue.d.ts +2 -2
  126. package/dist/runtime/components/ModalDialogClose.vue.d.ts +1 -1
  127. package/dist/runtime/components/Navbar.vue.d.ts +1 -1
  128. package/dist/runtime/components/NavbarDivider.vue.d.ts +1 -1
  129. package/dist/runtime/components/NavbarSection.vue.d.ts +1 -1
  130. package/dist/runtime/components/NavbarSpacer.vue.d.ts +1 -1
  131. package/dist/runtime/components/NavigationMenu.vue +95 -84
  132. package/dist/runtime/components/NavigationMenu.vue.d.ts +31 -33
  133. package/dist/runtime/components/OverlayProvider.vue.d.ts +1 -1
  134. package/dist/runtime/components/Popover.vue +8 -2
  135. package/dist/runtime/components/Popover.vue.d.ts +9 -3
  136. package/dist/runtime/components/Progress.vue.d.ts +3 -3
  137. package/dist/runtime/components/RadioGroup.vue +1 -1
  138. package/dist/runtime/components/RadioGroup.vue.d.ts +6 -5
  139. package/dist/runtime/components/Range.vue.d.ts +6 -6
  140. package/dist/runtime/components/Select.vue +25 -11
  141. package/dist/runtime/components/Select.vue.d.ts +7 -7
  142. package/dist/runtime/components/SelectMenu.vue +38 -19
  143. package/dist/runtime/components/SelectMenu.vue.d.ts +11 -10
  144. package/dist/runtime/components/Separator.vue +4 -4
  145. package/dist/runtime/components/Separator.vue.d.ts +6 -3
  146. package/dist/runtime/components/Sidebar.vue.d.ts +4 -1
  147. package/dist/runtime/components/SidebarBody.vue.d.ts +4 -1
  148. package/dist/runtime/components/SidebarFooter.vue.d.ts +4 -1
  149. package/dist/runtime/components/SidebarHeader.vue.d.ts +4 -1
  150. package/dist/runtime/components/SidebarHeading.vue.d.ts +4 -1
  151. package/dist/runtime/components/SidebarLayout.vue +148 -63
  152. package/dist/runtime/components/SidebarLayout.vue.d.ts +61 -8
  153. package/dist/runtime/components/SidebarSection.vue.d.ts +4 -1
  154. package/dist/runtime/components/SidebarSpacer.vue.d.ts +4 -1
  155. package/dist/runtime/components/Skeleton.vue +7 -3
  156. package/dist/runtime/components/Skeleton.vue.d.ts +12 -1
  157. package/dist/runtime/components/Slideover.vue +120 -43
  158. package/dist/runtime/components/Slideover.vue.d.ts +22 -9
  159. package/dist/runtime/components/Switch.vue.d.ts +2 -2
  160. package/dist/runtime/components/Tabs.vue +11 -3
  161. package/dist/runtime/components/Tabs.vue.d.ts +8 -7
  162. package/dist/runtime/components/Textarea.vue +8 -4
  163. package/dist/runtime/components/Textarea.vue.d.ts +8 -7
  164. package/dist/runtime/components/Toast.vue +16 -8
  165. package/dist/runtime/components/Toast.vue.d.ts +16 -15
  166. package/dist/runtime/components/Toaster.vue.d.ts +2 -2
  167. package/dist/runtime/components/Tooltip.vue +9 -5
  168. package/dist/runtime/components/Tooltip.vue.d.ts +7 -1
  169. package/dist/runtime/components/content/TableWrapper.vue.d.ts +1 -1
  170. package/dist/runtime/composables/defineShortcuts.js +5 -3
  171. package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
  172. package/dist/runtime/composables/useButtonGroup.d.ts +1 -1
  173. package/dist/runtime/composables/useComponentIcons.d.ts +1 -1
  174. package/dist/runtime/composables/useFormField.d.ts +4 -7
  175. package/dist/runtime/composables/useFormField.js +6 -3
  176. package/dist/runtime/composables/useKbd.d.ts +1 -1
  177. package/dist/runtime/composables/useLocale.js +2 -2
  178. package/dist/runtime/composables/useOverlay.d.ts +29 -2
  179. package/dist/runtime/composables/useOverlay.js +8 -7
  180. package/dist/runtime/composables/usePortal.d.ts +1 -1
  181. package/dist/runtime/composables/useSidebarLayout.d.ts +20 -0
  182. package/dist/runtime/composables/useSidebarLayout.js +16 -0
  183. package/dist/runtime/dictionary/icons.js +7 -7
  184. package/dist/runtime/index.css +1 -1
  185. package/dist/runtime/inertia/components/Link.vue +3 -0
  186. package/dist/runtime/inertia/components/Link.vue.d.ts +1 -1
  187. package/dist/runtime/inertia/components/LinkBase.vue.d.ts +1 -1
  188. package/dist/runtime/inertia/stubs.d.ts +1 -0
  189. package/dist/runtime/inertia/stubs.js +4 -2
  190. package/dist/runtime/locale/ar.js +6 -0
  191. package/dist/runtime/locale/br.js +6 -0
  192. package/dist/runtime/locale/de.js +6 -0
  193. package/dist/runtime/locale/en.js +6 -0
  194. package/dist/runtime/locale/fr.js +6 -0
  195. package/dist/runtime/locale/id.js +6 -0
  196. package/dist/runtime/locale/it.js +6 -0
  197. package/dist/runtime/locale/ja.js +6 -0
  198. package/dist/runtime/locale/kz.js +6 -0
  199. package/dist/runtime/locale/la.js +6 -0
  200. package/dist/runtime/locale/ms.js +6 -0
  201. package/dist/runtime/locale/pl.js +6 -0
  202. package/dist/runtime/locale/ru.js +6 -0
  203. package/dist/runtime/locale/sc.js +6 -0
  204. package/dist/runtime/locale/tc.js +6 -0
  205. package/dist/runtime/locale/th.js +6 -0
  206. package/dist/runtime/locale/tr.js +6 -0
  207. package/dist/runtime/locale/ua.js +6 -0
  208. package/dist/runtime/locale/vn.js +6 -0
  209. package/dist/runtime/plugins/ui-version.d.ts +5 -0
  210. package/dist/runtime/plugins/ui-version.js +8 -0
  211. package/dist/runtime/prose/A.vue.d.ts +4 -1
  212. package/dist/runtime/prose/Blockquote.vue.d.ts +4 -1
  213. package/dist/runtime/prose/Code.vue.d.ts +4 -1
  214. package/dist/runtime/prose/Em.vue.d.ts +4 -1
  215. package/dist/runtime/prose/H1.vue +4 -1
  216. package/dist/runtime/prose/H1.vue.d.ts +7 -1
  217. package/dist/runtime/prose/H2.vue +4 -1
  218. package/dist/runtime/prose/H2.vue.d.ts +7 -1
  219. package/dist/runtime/prose/H3.vue +4 -1
  220. package/dist/runtime/prose/H3.vue.d.ts +7 -1
  221. package/dist/runtime/prose/H4.vue +4 -1
  222. package/dist/runtime/prose/H4.vue.d.ts +7 -1
  223. package/dist/runtime/prose/H5.vue +4 -1
  224. package/dist/runtime/prose/H5.vue.d.ts +7 -1
  225. package/dist/runtime/prose/H6.vue +4 -1
  226. package/dist/runtime/prose/H6.vue.d.ts +7 -1
  227. package/dist/runtime/prose/Hr.vue.d.ts +1 -1
  228. package/dist/runtime/prose/Img.vue.d.ts +1 -1
  229. package/dist/runtime/prose/Li.vue.d.ts +4 -1
  230. package/dist/runtime/prose/Ol.vue.d.ts +4 -1
  231. package/dist/runtime/prose/P.vue +6 -1
  232. package/dist/runtime/prose/P.vue.d.ts +12 -1
  233. package/dist/runtime/prose/Pre.vue.d.ts +4 -1
  234. package/dist/runtime/prose/Strong.vue.d.ts +4 -1
  235. package/dist/runtime/prose/Table.vue.d.ts +5 -2
  236. package/dist/runtime/prose/Tbody.vue.d.ts +4 -1
  237. package/dist/runtime/prose/Td.vue.d.ts +4 -1
  238. package/dist/runtime/prose/Th.vue.d.ts +4 -1
  239. package/dist/runtime/prose/Thead.vue.d.ts +4 -1
  240. package/dist/runtime/prose/Tr.vue.d.ts +4 -1
  241. package/dist/runtime/prose/Ul.vue.d.ts +4 -1
  242. package/dist/runtime/types/index.d.ts +0 -1
  243. package/dist/runtime/types/index.js +0 -1
  244. package/dist/runtime/types/locale.d.ts +6 -0
  245. package/dist/runtime/utils/index.d.ts +6 -0
  246. package/dist/runtime/utils/index.js +27 -0
  247. package/dist/runtime/utils/tv.js +66 -1
  248. package/dist/runtime/vue/components/Link.vue +3 -0
  249. package/dist/runtime/vue/components/Link.vue.d.ts +1 -1
  250. package/dist/runtime/vue/stubs.d.ts +1 -0
  251. package/dist/runtime/vue/stubs.js +3 -1
  252. package/dist/shared/b24ui-nuxt.dLc5H7ID.mjs +6100 -0
  253. package/dist/unplugin.mjs +1 -1
  254. package/dist/vite.mjs +1 -1
  255. package/package.json +40 -28
  256. package/.nuxt/b24ui/stacked-layout.ts +0 -34
  257. package/dist/runtime/air-design-tokens.css +0 -1
  258. package/dist/runtime/components/StackedLayout.vue +0 -117
  259. package/dist/runtime/components/StackedLayout.vue.d.ts +0 -44
  260. package/dist/shared/b24ui-nuxt.CxsFEY3M.mjs +0 -7895
@@ -12,9 +12,10 @@ import { useButtonGroup } from "../composables/useButtonGroup";
12
12
  import { useComponentIcons } from "../composables/useComponentIcons";
13
13
  import { useFormField } from "../composables/useFormField";
14
14
  import { usePortal } from "../composables/usePortal";
15
- import { compare, get, isArrayOfArray } from "../utils";
15
+ import { get, getDisplayValue, isArrayOfArray } from "../utils";
16
16
  import { tv } from "../utils/tv";
17
17
  import icons from "../dictionary/icons";
18
+ import B24Badge from "./Badge.vue";
18
19
  import B24Avatar from "./Avatar.vue";
19
20
  import B24Chip from "./Chip.vue";
20
21
  defineOptions({ inheritAttrs: false });
@@ -62,7 +63,7 @@ const appConfig = useAppConfig();
62
63
  const rootProps = useForwardPropsEmits(reactivePick(props, "open", "defaultOpen", "disabled", "autocomplete", "required", "multiple"), emits);
63
64
  const portalProps = usePortal(toRef(() => props.portal));
64
65
  const contentProps = toRef(() => defu(props.content, { side: "bottom", sideOffset: 8, collisionPadding: 8, position: "popper" }));
65
- const arrowProps = toRef(() => props.arrow);
66
+ const arrowProps = toRef(() => defu(typeof props.arrow === "boolean" ? {} : props.arrow, { width: 20, height: 10 }));
66
67
  const { emitFormChange, emitFormInput, emitFormBlur, emitFormFocus, size: formGroupSize, color, id, name, highlight, disabled, ariaAttrs } = useFormField(props);
67
68
  const { orientation, size: buttonGroupSize } = useButtonGroup(props);
68
69
  const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(toRef(() => defu(
@@ -82,7 +83,6 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.select
82
83
  noBorder: Boolean(props.noBorder),
83
84
  underline: Boolean(props.underline),
84
85
  highlight: highlight.value,
85
- tagColor: props.tagColor,
86
86
  leading: Boolean(isLeading.value || !!props.avatar || !!slots.leading),
87
87
  trailing: Boolean(isTrailing.value || !!slots.trailing),
88
88
  buttonGroup: orientation.value
@@ -93,11 +93,16 @@ const groups = computed(
93
93
  const items = computed(() => groups.value.flatMap((group) => group));
94
94
  function displayValue(value) {
95
95
  if (props.multiple && Array.isArray(value)) {
96
- const values = value.map((v) => displayValue(v)).filter(Boolean);
97
- return values?.length ? values.join(", ") : void 0;
96
+ const displayedValues = value.map((item) => getDisplayValue(items.value, item, {
97
+ labelKey: props.labelKey,
98
+ valueKey: props.valueKey
99
+ })).filter((v) => v != null && v !== "");
100
+ return displayedValues.length > 0 ? displayedValues.join(", ") : void 0;
98
101
  }
99
- const item = items.value.find((item2) => compare(typeof item2 === "object" ? get(item2, props.valueKey) : item2, value));
100
- return item && (typeof item === "object" ? get(item, props.labelKey) : item);
102
+ return getDisplayValue(items.value, value, {
103
+ labelKey: props.labelKey,
104
+ valueKey: props.valueKey
105
+ });
101
106
  }
102
107
  const triggerRef = ref(null);
103
108
  function autoFocus() {
@@ -156,9 +161,13 @@ defineExpose({
156
161
  :class="b24ui.base({ class: [props.b24ui?.base, props.class] })"
157
162
  v-bind="{ ...$attrs, ...ariaAttrs }"
158
163
  >
159
- <div v-if="isTag" :class="b24ui.tag({ class: props.b24ui?.tag })">
160
- {{ props.tag }}
161
- </div>
164
+ <B24Badge
165
+ v-if="isTag"
166
+ :class="b24ui.tag({ class: props.b24ui?.tag })"
167
+ :color="props.tagColor"
168
+ :label="props.tag"
169
+ size="xs"
170
+ />
162
171
 
163
172
  <span v-if="isLeading || !!avatar || !!slots.leading" :class="b24ui.leading({ class: props.b24ui?.leading })">
164
173
  <slot name="leading" :model-value="modelValue" :open="open" :b24ui="b24ui">
@@ -167,7 +176,12 @@ defineExpose({
167
176
  v-if="isLeading && leadingIconName"
168
177
  :class="b24ui.leadingIcon({ class: props.b24ui?.leadingIcon })"
169
178
  />
170
- <B24Avatar v-else-if="!!avatar" :size="props.b24ui?.itemLeadingAvatarSize || b24ui.itemLeadingAvatarSize()" v-bind="avatar" :class="b24ui.itemLeadingAvatar({ class: props.b24ui?.itemLeadingAvatar })" />
179
+ <B24Avatar
180
+ v-else-if="!!avatar"
181
+ :size="props.b24ui?.leadingAvatarSize || b24ui.leadingAvatarSize()"
182
+ v-bind="avatar"
183
+ :class="b24ui.leadingAvatar({ class: props.b24ui?.leadingAvatar })"
184
+ />
171
185
  </slot>
172
186
  </span>
173
187
 
@@ -2,7 +2,7 @@ import type { SelectRootProps, SelectRootEmits, SelectContentProps, SelectConten
2
2
  import type { AppConfig } from '@nuxt/schema';
3
3
  import theme from '#build/b24ui/select';
4
4
  import type { UseComponentIconsProps } from '../composables/useComponentIcons';
5
- import type { AvatarProps, ChipProps, IconComponent } from '../types';
5
+ import type { AvatarProps, ChipProps, BadgeProps, IconComponent } from '../types';
6
6
  import type { AcceptableValue, ArrayOrNested, GetItemKeys, GetModelValue, GetModelValueEmits, NestedItem, EmitsToProps, ComponentConfig } from '../types/utils';
7
7
  type Select = ComponentConfig<typeof theme, AppConfig, 'select'>;
8
8
  interface SelectItemBase {
@@ -33,7 +33,7 @@ export interface SelectProps<T extends ArrayOrNested<SelectItem> = ArrayOrNested
33
33
  /** The placeholder text when the select is empty. */
34
34
  placeholder?: string;
35
35
  /**
36
- * @defaultValue 'primary'
36
+ * @defaultValue 'air-primary'
37
37
  */
38
38
  color?: Select['variants']['color'];
39
39
  /**
@@ -62,9 +62,9 @@ export interface SelectProps<T extends ArrayOrNested<SelectItem> = ArrayOrNested
62
62
  rounded?: boolean;
63
63
  tag?: string;
64
64
  /**
65
- * @defaultValue 'primary'
65
+ * @defaultValue 'air-primary'
66
66
  */
67
- tagColor?: Select['variants']['tagColor'];
67
+ tagColor?: BadgeProps['color'];
68
68
  /**
69
69
  * The icon displayed to open the menu.
70
70
  * @defaultValue icons.chevronDown
@@ -219,7 +219,7 @@ declare const _default: <T extends ArrayOrNested<SelectItem>, VK extends GetItem
219
219
  as: import("reka-ui").AsTag | import("vue").Component;
220
220
  }> & Omit<Readonly<import("reka-ui").SelectTriggerProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
221
221
  $slots: {
222
- default?(_: {}): any;
222
+ default?: (props: {}) => any;
223
223
  };
224
224
  }) | null, ({
225
225
  $: import("vue").ComponentInternalInstance;
@@ -270,7 +270,7 @@ declare const _default: <T extends ArrayOrNested<SelectItem>, VK extends GetItem
270
270
  as: import("reka-ui").AsTag | import("vue").Component;
271
271
  }> & Omit<Readonly<import("reka-ui").SelectTriggerProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
272
272
  $slots: {
273
- default?(_: {}): any;
273
+ default?: (props: {}) => any;
274
274
  };
275
275
  }) | null>;
276
276
  }>): void;
@@ -282,5 +282,5 @@ declare const _default: <T extends ArrayOrNested<SelectItem>, VK extends GetItem
282
282
  };
283
283
  export default _default;
284
284
  type __VLS_PrettifyLocal<T> = {
285
- [K in keyof T]: T[K];
285
+ [K in keyof T as K]: T[K];
286
286
  } & {};
@@ -3,7 +3,7 @@ import theme from "#build/b24ui/select-menu";
3
3
  </script>
4
4
 
5
5
  <script setup>
6
- import { ref, computed, onMounted, toRef, toRaw } from "vue";
6
+ import { ref, computed, onMounted, toRef, toRaw, nextTick } from "vue";
7
7
  import {
8
8
  ComboboxRoot,
9
9
  ComboboxArrow,
@@ -31,9 +31,10 @@ import { useComponentIcons } from "../composables/useComponentIcons";
31
31
  import { useFormField } from "../composables/useFormField";
32
32
  import { useLocale } from "../composables/useLocale";
33
33
  import { usePortal } from "../composables/usePortal";
34
- import { compare, get, isArrayOfArray } from "../utils";
34
+ import { compare, get, getDisplayValue, isArrayOfArray } from "../utils";
35
35
  import { tv } from "../utils/tv";
36
36
  import icons from "../dictionary/icons";
37
+ import B24Badge from "./Badge.vue";
37
38
  import B24Avatar from "./Avatar.vue";
38
39
  import B24Chip from "./Chip.vue";
39
40
  import B24Input from "./Input.vue";
@@ -91,8 +92,8 @@ const { contains } = useFilter({ sensitivity: "base" });
91
92
  const rootProps = useForwardPropsEmits(reactivePick(props, "modelValue", "defaultValue", "open", "defaultOpen", "required", "multiple", "resetSearchTermOnBlur", "resetSearchTermOnSelect", "highlightOnHover"), emits);
92
93
  const portalProps = usePortal(toRef(() => props.portal));
93
94
  const contentProps = toRef(() => defu(props.content, { side: "bottom", sideOffset: 8, collisionPadding: 8, position: "popper" }));
94
- const arrowProps = toRef(() => props.arrow);
95
- const searchInputProps = toRef(() => defu(props.searchInput, { placeholder: t("selectMenu.search"), type: "search" }));
95
+ const arrowProps = toRef(() => defu(typeof props.arrow === "boolean" ? {} : props.arrow, { width: 20, height: 10 }));
96
+ const searchInputProps = toRef(() => defu(props.searchInput, { placeholder: t("selectMenu.search"), type: "text", size: "md" }));
96
97
  const { emitFormBlur, emitFormFocus, emitFormInput, emitFormChange, size: formGroupSize, color, id, name, highlight, disabled, ariaAttrs } = useFormField(props);
97
98
  const { orientation, size: buttonGroupSize } = useButtonGroup(props);
98
99
  const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(toRef(() => defu(
@@ -113,21 +114,22 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.selectM
113
114
  noBorder: Boolean(props.noBorder),
114
115
  underline: Boolean(props.underline),
115
116
  highlight: highlight.value,
116
- tagColor: props.tagColor,
117
117
  leading: Boolean(isLeading.value || !!props.avatar || !!slots.leading),
118
118
  trailing: Boolean(isTrailing.value || !!slots.trailing),
119
119
  buttonGroup: orientation.value
120
120
  }));
121
121
  function displayValue(value) {
122
122
  if (props.multiple && Array.isArray(value)) {
123
- const values = value.map((v) => displayValue(v)).filter(Boolean);
124
- return values?.length ? values.join(", ") : void 0;
123
+ const displayedValues = value.map((item) => getDisplayValue(items.value, item, {
124
+ labelKey: props.labelKey,
125
+ valueKey: props.valueKey
126
+ })).filter((v) => v != null && v !== "");
127
+ return displayedValues.length > 0 ? displayedValues.join(", ") : void 0;
125
128
  }
126
- if (!props.valueKey) {
127
- return value && (typeof value === "object" ? get(value, props.labelKey) : value);
128
- }
129
- const item = items.value.find((item2) => compare(typeof item2 === "object" ? get(item2, props.valueKey) : item2, value));
130
- return item && (typeof item === "object" ? get(item, props.labelKey) : item);
129
+ return getDisplayValue(items.value, value, {
130
+ labelKey: props.labelKey,
131
+ valueKey: props.valueKey
132
+ });
131
133
  }
132
134
  const groups = computed(
133
135
  () => props.items?.length ? isArrayOfArray(props.items) ? props.items : [props.items] : []
@@ -139,13 +141,19 @@ const filteredGroups = computed(() => {
139
141
  }
140
142
  const fields = Array.isArray(props.filterFields) ? props.filterFields : [props.labelKey];
141
143
  return groups.value.map((items2) => items2.filter((item) => {
142
- if (typeof item !== "object" || item === null) {
144
+ if (item === void 0 || item === null) {
145
+ return false;
146
+ }
147
+ if (typeof item !== "object") {
143
148
  return contains(String(item), searchTerm.value);
144
149
  }
145
150
  if (item.type && ["label", "separator"].includes(item.type)) {
146
151
  return true;
147
152
  }
148
- return fields.some((field) => contains(get(item, field), searchTerm.value));
153
+ return fields.some((field) => {
154
+ const value = get(item, field);
155
+ return value !== void 0 && value !== null && contains(String(value), searchTerm.value);
156
+ });
149
157
  })).filter((group) => group.filter(
150
158
  (item) => !isSelectItem(item) || isSelectItem(item) && (!item.type || !["label", "separator"].includes(item.type))
151
159
  ).length > 0);
@@ -171,6 +179,9 @@ function autoFocus() {
171
179
  }
172
180
  }
173
181
  onMounted(() => {
182
+ nextTick(() => {
183
+ searchTerm.value = "";
184
+ });
174
185
  setTimeout(() => {
175
186
  autoFocus();
176
187
  }, props.autofocusDelay);
@@ -265,9 +276,13 @@ defineExpose({
265
276
  :class="b24ui.base({ class: [props.b24ui?.base, props.class] })"
266
277
  tabindex="0"
267
278
  >
268
- <div v-if="isTag" :class="b24ui.tag({ class: props.b24ui?.tag })">
269
- {{ props.tag }}
270
- </div>
279
+ <B24Badge
280
+ v-if="isTag"
281
+ :class="b24ui.tag({ class: props.b24ui?.tag })"
282
+ :color="props.tagColor"
283
+ :label="props.tag"
284
+ size="xs"
285
+ />
271
286
  <span v-if="isLeading || !!avatar || !!slots.leading" :class="b24ui.leading({ class: props.b24ui?.leading })">
272
287
  <slot name="leading" :model-value="modelValue" :open="open" :b24ui="b24ui">
273
288
  <Component
@@ -275,7 +290,12 @@ defineExpose({
275
290
  v-if="isLeading && leadingIconName"
276
291
  :class="b24ui.leadingIcon({ class: props.b24ui?.leadingIcon })"
277
292
  />
278
- <B24Avatar v-else-if="!!avatar" :size="props.b24ui?.itemLeadingAvatarSize || b24ui.itemLeadingAvatarSize()" v-bind="avatar" :class="b24ui.itemLeadingAvatar({ class: props.b24ui?.itemLeadingAvatar })" />
293
+ <B24Avatar
294
+ v-else-if="!!avatar"
295
+ :size="props.b24ui?.leadingAvatarSize || b24ui.leadingAvatarSize()"
296
+ v-bind="avatar"
297
+ :class="b24ui.leadingAvatar({ class: props.b24ui?.leadingAvatar })"
298
+ />
279
299
  </slot>
280
300
  </span>
281
301
 
@@ -405,7 +425,6 @@ defineExpose({
405
425
  </ComboboxItem>
406
426
  </template>
407
427
  </ComboboxGroup>
408
-
409
428
  <ReuseCreateItemTemplate v-if="createItem && createItemPosition === 'bottom'" />
410
429
  </div>
411
430
 
@@ -1,8 +1,9 @@
1
+ import { nextTick } from 'vue';
1
2
  import type { ComboboxRootProps, ComboboxRootEmits, ComboboxContentProps, ComboboxContentEmits, ComboboxArrowProps } from 'reka-ui';
2
3
  import type { AppConfig } from '@nuxt/schema';
3
4
  import theme from '#build/b24ui/select-menu';
4
5
  import type { UseComponentIconsProps } from '../composables/useComponentIcons';
5
- import type { AvatarProps, ChipProps, InputProps, IconComponent } from '../types';
6
+ import type { AvatarProps, ChipProps, InputProps, BadgeProps, IconComponent } from '../types';
6
7
  import type { AcceptableValue, ArrayOrNested, GetItemKeys, GetModelValue, GetModelValueEmits, NestedItem, EmitsToProps, ComponentConfig } from '../types/utils';
7
8
  type SelectMenu = ComponentConfig<typeof theme, AppConfig, 'selectMenu'>;
8
9
  interface _SelectMenuItem {
@@ -34,12 +35,12 @@ export interface SelectMenuProps<T extends ArrayOrNested<SelectMenuItem> = Array
34
35
  /**
35
36
  * Whether to display the search input or not.
36
37
  * Can be an object to pass additional props to the input.
37
- * `{ placeholder: 'Search...', type: 'search' }`{lang="ts"}
38
+ * `{ placeholder: 'Search...', type: 'text', size: 'md' }`{lang="ts"}
38
39
  * @defaultValue true
39
40
  */
40
41
  searchInput?: boolean | InputProps;
41
42
  /**
42
- * @defaultValue 'primary'
43
+ * @defaultValue 'air-primary'
43
44
  */
44
45
  color?: SelectMenu['variants']['color'];
45
46
  /**
@@ -68,9 +69,9 @@ export interface SelectMenuProps<T extends ArrayOrNested<SelectMenuItem> = Array
68
69
  rounded?: boolean;
69
70
  tag?: string;
70
71
  /**
71
- * @defaultValue 'primary'
72
+ * @defaultValue 'air-primary'
72
73
  */
73
- tagColor?: SelectMenu['variants']['tagColor'];
74
+ tagColor?: BadgeProps['color'];
74
75
  /**
75
76
  * @defaultValue false
76
77
  */
@@ -262,13 +263,13 @@ declare const _default: <T extends ArrayOrNested<SelectMenuItem>, VK extends Get
262
263
  errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
263
264
  };
264
265
  $forceUpdate: () => void;
265
- $nextTick: typeof import("vue").nextTick;
266
+ $nextTick: typeof nextTick;
266
267
  $watch<T_1 extends string | ((...args: any) => any)>(source: T_1, cb: T_1 extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
267
268
  } & Readonly<{
268
269
  as: import("reka-ui").AsTag | import("vue").Component;
269
270
  }> & Omit<Readonly<import("reka-ui").ComboboxTriggerProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
270
271
  $slots: {
271
- default?(_: {}): any;
272
+ default?: (props: {}) => any;
272
273
  };
273
274
  }) | null, ({
274
275
  $: import("vue").ComponentInternalInstance;
@@ -312,13 +313,13 @@ declare const _default: <T extends ArrayOrNested<SelectMenuItem>, VK extends Get
312
313
  errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
313
314
  };
314
315
  $forceUpdate: () => void;
315
- $nextTick: typeof import("vue").nextTick;
316
+ $nextTick: typeof nextTick;
316
317
  $watch<T_1 extends string | ((...args: any) => any)>(source: T_1, cb: T_1 extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
317
318
  } & Readonly<{
318
319
  as: import("reka-ui").AsTag | import("vue").Component;
319
320
  }> & Omit<Readonly<import("reka-ui").ComboboxTriggerProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
320
321
  $slots: {
321
- default?(_: {}): any;
322
+ default?: (props: {}) => any;
322
323
  };
323
324
  }) | null>;
324
325
  }>): void;
@@ -333,5 +334,5 @@ declare const _default: <T extends ArrayOrNested<SelectMenuItem>, VK extends Get
333
334
  };
334
335
  export default _default;
335
336
  type __VLS_PrettifyLocal<T> = {
336
- [K in keyof T]: T[K];
337
+ [K in keyof T as K]: T[K];
337
338
  } & {};
@@ -14,9 +14,9 @@ const props = defineProps({
14
14
  label: { type: String, required: false },
15
15
  icon: { type: [Function, Object], required: false },
16
16
  avatar: { type: Object, required: false },
17
- color: { type: null, required: false },
18
- size: { type: null, required: false },
19
- type: { type: null, required: false },
17
+ accent: { type: null, required: false, default: "default" },
18
+ size: { type: null, required: false, default: "thin" },
19
+ type: { type: null, required: false, default: "solid" },
20
20
  orientation: { type: null, required: false, default: "horizontal" },
21
21
  class: { type: null, required: false },
22
22
  b24ui: { type: null, required: false },
@@ -26,7 +26,7 @@ const slots = defineSlots();
26
26
  const appConfig = useAppConfig();
27
27
  const rootProps = useForwardProps(reactivePick(props, "as", "decorative", "orientation"));
28
28
  const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.separator || {} })({
29
- color: props.color,
29
+ accent: props.accent,
30
30
  orientation: props.orientation,
31
31
  size: props.size,
32
32
  type: props.type
@@ -25,9 +25,9 @@ export interface SeparatorProps extends Pick<_SeparatorProps, 'decorative'> {
25
25
  /**
26
26
  * @defaultValue 'default'
27
27
  */
28
- color?: Separator['variants']['color'];
28
+ accent?: Separator['variants']['accent'];
29
29
  /**
30
- * @defaultValue 'xs'
30
+ * @defaultValue 'thin'
31
31
  */
32
32
  size?: Separator['variants']['size'];
33
33
  /**
@@ -45,7 +45,10 @@ export interface SeparatorProps extends Pick<_SeparatorProps, 'decorative'> {
45
45
  export interface SeparatorSlots {
46
46
  default(props?: {}): any;
47
47
  }
48
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SeparatorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SeparatorProps> & Readonly<{}>, {
48
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SeparatorProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SeparatorProps> & Readonly<{}>, {
49
+ size: Separator["variants"]["size"];
50
+ accent: Separator["variants"]["accent"];
51
+ type: Separator["variants"]["type"];
49
52
  orientation: "horizontal" | "vertical";
50
53
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SeparatorSlots>;
51
54
  export default _default;
@@ -11,10 +11,13 @@ export interface SidebarProps {
11
11
  class?: any;
12
12
  b24ui?: Sidebar['slots'];
13
13
  }
14
+ /**
15
+ * @todo add Pick<Xxxx
16
+ */
14
17
  export interface SidebarSlots {
15
18
  default(props?: {}): any;
16
19
  }
17
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SidebarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SidebarProps> & Readonly<{}>, {
20
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SidebarProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SidebarProps> & Readonly<{}>, {
18
21
  as: any;
19
22
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SidebarSlots>;
20
23
  export default _default;
@@ -15,10 +15,13 @@ export interface SidebarBodyProps {
15
15
  class?: any;
16
16
  b24ui?: SidebarBody['slots'];
17
17
  }
18
+ /**
19
+ * @todo add Pick<Xxxx
20
+ */
18
21
  export interface SidebarBodySlots {
19
22
  default(props?: {}): any;
20
23
  }
21
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SidebarBodyProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SidebarBodyProps> & Readonly<{}>, {
24
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SidebarBodyProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SidebarBodyProps> & Readonly<{}>, {
22
25
  as: any;
23
26
  scrollbarThin: boolean;
24
27
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SidebarBodySlots>;
@@ -11,10 +11,13 @@ export interface SidebarFooterProps {
11
11
  class?: any;
12
12
  b24ui?: SidebarFooter['slots'];
13
13
  }
14
+ /**
15
+ * @todo add Pick<Xxxx
16
+ */
14
17
  export interface SidebarFooterSlots {
15
18
  default(props?: {}): any;
16
19
  }
17
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SidebarFooterProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SidebarFooterProps> & Readonly<{}>, {
20
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SidebarFooterProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SidebarFooterProps> & Readonly<{}>, {
18
21
  as: any;
19
22
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SidebarFooterSlots>;
20
23
  export default _default;
@@ -11,10 +11,13 @@ export interface SidebarHeaderProps {
11
11
  class?: any;
12
12
  b24ui?: SidebarHeader['slots'];
13
13
  }
14
+ /**
15
+ * @todo add Pick<Xxxx
16
+ */
14
17
  export interface SidebarHeaderSlots {
15
18
  default(props?: {}): any;
16
19
  }
17
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SidebarHeaderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SidebarHeaderProps> & Readonly<{}>, {
20
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SidebarHeaderProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SidebarHeaderProps> & Readonly<{}>, {
18
21
  as: any;
19
22
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SidebarHeaderSlots>;
20
23
  export default _default;
@@ -11,10 +11,13 @@ export interface SidebarHeadingProps {
11
11
  class?: any;
12
12
  b24ui?: SidebarHeading['slots'];
13
13
  }
14
+ /**
15
+ * @todo add Pick<Xxxx
16
+ */
14
17
  export interface SidebarHeadingSlots {
15
18
  default(props?: {}): any;
16
19
  }
17
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SidebarHeadingProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SidebarHeadingProps> & Readonly<{}>, {
20
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SidebarHeadingProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SidebarHeadingProps> & Readonly<{}>, {
18
21
  as: any;
19
22
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SidebarHeadingSlots>;
20
23
  export default _default;