bitboss-ui 2.1.94 → 2.1.96

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 (197) hide show
  1. package/dist/components/BaseSelect/BaseSelect.vue.d.ts +13 -0
  2. package/dist/components/BbSelect/BbSelect.vue.d.ts +16 -0
  3. package/dist/components/FlatListBox.vue.d.ts +56 -0
  4. package/dist/components/GroupedListBox.vue.d.ts +67 -0
  5. package/dist/components/ListBox.vue.d.ts +58 -16
  6. package/dist/composables/useListboxFocus.d.ts +19 -0
  7. package/dist/index.css +1 -1
  8. package/dist/index108.js +9 -9
  9. package/dist/index109.js +17 -10
  10. package/dist/index115.js +1 -1
  11. package/dist/index121.js +4 -4
  12. package/dist/index123.js +13 -13
  13. package/dist/index131.js +1 -1
  14. package/dist/index133.js +5 -5
  15. package/dist/index135.js +1 -1
  16. package/dist/index137.js +2 -2
  17. package/dist/index14.js +1 -1
  18. package/dist/index140.js +1 -1
  19. package/dist/index142.js +2 -2
  20. package/dist/index144.js +1 -1
  21. package/dist/index16.js +5 -5
  22. package/dist/index18.js +3 -3
  23. package/dist/index20.js +8 -8
  24. package/dist/index216.js +138 -2
  25. package/dist/index217.js +2 -138
  26. package/dist/index218.js +2 -2
  27. package/dist/index219.js +1 -1
  28. package/dist/index22.js +14 -14
  29. package/dist/index220.js +1 -1
  30. package/dist/index221.js +5 -2
  31. package/dist/index222.js +5 -2
  32. package/dist/index223.js +5 -2
  33. package/dist/index224.js +5 -7
  34. package/dist/index225.js +3 -2
  35. package/dist/index226.js +2 -7
  36. package/dist/index227.js +6 -5
  37. package/dist/index228.js +8 -5
  38. package/dist/index229.js +268 -5
  39. package/dist/index230.js +52 -5
  40. package/dist/index231.js +52 -3
  41. package/dist/index232.js +32 -6
  42. package/dist/index233.js +58 -6
  43. package/dist/index234.js +12 -267
  44. package/dist/index235.js +4 -52
  45. package/dist/index236.js +19 -51
  46. package/dist/index237.js +195 -26
  47. package/dist/index239.js +134 -12
  48. package/dist/index24.js +11 -11
  49. package/dist/index241.js +32 -16
  50. package/dist/index242.js +26 -104
  51. package/dist/index244.js +2 -100
  52. package/dist/index245.js +4 -0
  53. package/dist/index246.js +51 -3
  54. package/dist/index247.js +17 -2
  55. package/dist/index248.js +106 -3
  56. package/dist/index250.js +100 -3
  57. package/dist/index252.js +3 -5
  58. package/dist/index253.js +5 -4
  59. package/dist/index254.js +5 -9
  60. package/dist/index255.js +5 -29
  61. package/dist/index256.js +2 -16
  62. package/dist/index257.js +34 -12
  63. package/dist/index258.js +85 -52
  64. package/dist/index26.js +3 -3
  65. package/dist/index260.js +27 -11
  66. package/dist/index261.js +15 -2
  67. package/dist/index262.js +12 -67
  68. package/dist/index263.js +15 -32
  69. package/dist/index264.js +188 -28
  70. package/dist/index265.js +5 -0
  71. package/dist/index266.js +8 -187
  72. package/dist/index267.js +18 -3
  73. package/dist/index268.js +12 -3
  74. package/dist/index269.js +4 -33
  75. package/dist/index270.js +103 -7
  76. package/dist/index271.js +13 -5
  77. package/dist/index272.js +11 -5
  78. package/dist/index273.js +5 -5
  79. package/dist/index274.js +2 -20
  80. package/dist/index275.js +3 -135
  81. package/dist/index277.js +22 -85
  82. package/dist/index278.js +11 -0
  83. package/dist/index279.js +23 -15
  84. package/dist/index28.js +1 -1
  85. package/dist/index280.js +2 -9
  86. package/dist/index281.js +7 -23
  87. package/dist/index282.js +6 -22
  88. package/dist/index283.js +33 -9
  89. package/dist/index284.js +13 -4
  90. package/dist/index285.js +59 -193
  91. package/dist/index287.js +3 -34
  92. package/dist/index288.js +6 -7
  93. package/dist/index289.js +14 -16
  94. package/dist/index290.js +9 -12
  95. package/dist/index291.js +20 -228
  96. package/dist/index293.js +3 -11
  97. package/dist/index294.js +3 -6
  98. package/dist/index295.js +3 -16
  99. package/dist/index296.js +2 -2
  100. package/dist/{index292.js → index297.js} +1 -1
  101. package/dist/index298.js +3 -3
  102. package/dist/index299.js +7 -280
  103. package/dist/index30.js +3 -3
  104. package/dist/index300.js +53 -2
  105. package/dist/index301.js +277 -13
  106. package/dist/index302.js +2 -2
  107. package/dist/index303.js +9 -9
  108. package/dist/index305.js +12 -23
  109. package/dist/index307.js +27 -2
  110. package/dist/index308.js +2 -2
  111. package/dist/index309.js +1 -1
  112. package/dist/index310.js +1 -1
  113. package/dist/index311.js +2 -28
  114. package/dist/index312.js +1 -1
  115. package/dist/index313.js +28 -3
  116. package/dist/index314.js +1 -1
  117. package/dist/index315.js +3 -4
  118. package/dist/index316.js +3 -17
  119. package/dist/index317.js +17 -3
  120. package/dist/index318.js +2 -3
  121. package/dist/index319.js +3 -125
  122. package/dist/index32.js +2 -2
  123. package/dist/index320.js +125 -2
  124. package/dist/index321.js +2 -15
  125. package/dist/index322.js +15 -2
  126. package/dist/index323.js +2 -19
  127. package/dist/index324.js +19 -2
  128. package/dist/index325.js +2 -3
  129. package/dist/index326.js +4 -3
  130. package/dist/index327.js +2 -5
  131. package/dist/index328.js +1 -1
  132. package/dist/index329.js +5 -4
  133. package/dist/index330.js +4 -4
  134. package/dist/index331.js +719 -6
  135. package/dist/index332.js +366 -2
  136. package/dist/index333.js +56 -57
  137. package/dist/index334.js +8 -58
  138. package/dist/index335.js +6 -719
  139. package/dist/index336.js +7 -365
  140. package/dist/index337.js +33 -55
  141. package/dist/index338.js +6 -7
  142. package/dist/index339.js +127 -17
  143. package/dist/index34.js +8 -8
  144. package/dist/index340.js +396 -7
  145. package/dist/index341.js +57 -14
  146. package/dist/index342.js +58 -5
  147. package/dist/index343.js +5 -6
  148. package/dist/index344.js +3 -34
  149. package/dist/index345.js +5 -6
  150. package/dist/index346.js +6 -128
  151. package/dist/index347.js +16 -395
  152. package/dist/index348.js +8 -7
  153. package/dist/index349.js +14 -5
  154. package/dist/index350.js +7 -8
  155. package/dist/index351.js +131 -225
  156. package/dist/index354.js +192 -133
  157. package/dist/index355.js +257 -46
  158. package/dist/index356.js +1 -1
  159. package/dist/index357.js +223 -436
  160. package/dist/index358.js +2 -128
  161. package/dist/index359.js +2 -520
  162. package/dist/index36.js +4 -4
  163. package/dist/index360.js +435 -44
  164. package/dist/index361.js +130 -0
  165. package/dist/index362.js +49 -0
  166. package/dist/index363.js +72 -0
  167. package/dist/index364.js +522 -0
  168. package/dist/index365.js +52 -0
  169. package/dist/index38.js +252 -232
  170. package/dist/index40.js +7 -7
  171. package/dist/index42.js +2 -2
  172. package/dist/index44.js +8 -8
  173. package/dist/index46.js +6 -6
  174. package/dist/index50.js +2 -2
  175. package/dist/index54.js +1 -1
  176. package/dist/index56.js +1 -1
  177. package/dist/index58.js +2 -2
  178. package/dist/index62.js +5 -5
  179. package/dist/index68.js +1 -1
  180. package/dist/index81.js +6 -6
  181. package/dist/index83.js +1 -1
  182. package/dist/index85.js +2 -2
  183. package/dist/index87.js +3 -3
  184. package/dist/index89.js +1 -1
  185. package/dist/index92.js +3 -3
  186. package/dist/index94.js +2 -2
  187. package/dist/index96.js +5 -5
  188. package/dist/index98.js +1 -1
  189. package/dist/types/Option.d.ts +5 -0
  190. package/dist/utilities/functions/groupBy.d.ts +4 -2
  191. package/dist/utilities/functions/indexBy.d.ts +9 -2
  192. package/package.json +1 -1
  193. package/dist/index238.js +0 -62
  194. package/dist/index240.js +0 -53
  195. package/dist/index259.js +0 -15
  196. /package/dist/{index251.js → index276.js} +0 -0
  197. /package/dist/{index249.js → index286.js} +0 -0
@@ -64,6 +64,12 @@ export type BaseSelectProps<Item> = {
64
64
  * @default () => []
65
65
  */
66
66
  filterBy?: string | string[] | false | 'not_stashed' | ((value: any, item: any, query: string | null) => boolean) | null;
67
+ groupBy?: string | ((item: Item) => string | number | symbol);
68
+ /**
69
+ * Height of group headers in the listbox (px). Defaults to 24px (compact) or 32px.
70
+ * Only applies when `groupBy` is set.
71
+ */
72
+ headerHeight?: number;
67
73
  /**
68
74
  * Apply error styling to the select.
69
75
  */
@@ -239,6 +245,13 @@ export type BaseSelectSlots<Item> = {
239
245
  text: string;
240
246
  value: any;
241
247
  }) => any;
248
+ group?: (props: {
249
+ text: string;
250
+ item: Item;
251
+ index: number;
252
+ length: number;
253
+ disabled: boolean;
254
+ }) => any;
242
255
  'options:append'?: (props: {
243
256
  focus: () => void;
244
257
  }) => any;
@@ -71,6 +71,10 @@ export type BbSelectProps<T> = {
71
71
  *
72
72
  */
73
73
  filterBy?: string | string[] | false | 'not_stashed' | ((value: any, item: T, query: string | null) => boolean) | null;
74
+ /**
75
+ * Path to item property for grouping options.
76
+ */
77
+ groupBy?: string | ((item: T) => string | number | symbol);
74
78
  /**
75
79
  * Define if the component should be in an error state.
76
80
  * It usually attaches a CSS class for styling purposes.
@@ -92,6 +96,11 @@ export type BbSelectProps<T> = {
92
96
  * Used to retrieve items can be an array or a function.
93
97
  */
94
98
  items: T[] | ((query: string, prefill: boolean, modelValue: any) => Promise<T[]>) | ((query: string, prefill: boolean, modelValue: any) => T[]);
99
+ /**
100
+ * Height of group headers in the listbox (px). Defaults to 24px (compact) or 32px.
101
+ * Only applies when `groupBy` is set.
102
+ */
103
+ headerHeight?: number;
95
104
  /**
96
105
  * Height of the options in the listbox. By default it will be 32px for the compact variant and 40px for the regular variant.
97
106
  * If you want to set a custom height you can pass a number in pixels. Existence of this value is necessary for the options to be virtualized.
@@ -244,6 +253,13 @@ export type BbSelectSlots<T> = {
244
253
  text: string;
245
254
  value: any;
246
255
  }) => any;
256
+ group?: (props: {
257
+ text: string;
258
+ item: T;
259
+ index: number;
260
+ length: number;
261
+ disabled: boolean;
262
+ }) => any;
247
263
  'options:append'?: (props: {
248
264
  focus: () => void;
249
265
  }) => any;
@@ -0,0 +1,56 @@
1
+ import { Option } from '../types/Option';
2
+ declare const _default: <Item = any>(__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<{
3
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
+ readonly "onOption:unselected"?: ((option: Option) => any) | undefined;
5
+ readonly "onOption:selected"?: ((option: Option) => any) | undefined;
6
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onOption:unselected" | "onOption:selected"> & {
7
+ /**
8
+ * Sets the listbox in a compact state.
9
+ */
10
+ compact?: boolean;
11
+ options: Option<Item>[];
12
+ open?: boolean;
13
+ loading?: boolean;
14
+ multiple?: boolean;
15
+ transitionDuration?: number;
16
+ loadingText?: string;
17
+ noDataText?: string;
18
+ optionHeight?: number;
19
+ } & Partial<{}>> & import('vue').PublicProps;
20
+ expose(exposed: import('vue').ShallowUnwrapRef<{
21
+ focusNext: () => void;
22
+ focusPrevious: () => void;
23
+ focusFirst: () => void;
24
+ focusFirstSelected: () => void;
25
+ focusLast: () => void;
26
+ focusLastSelected: () => void;
27
+ blur: () => void;
28
+ confirmOption: () => void;
29
+ focusByHash: (hash: Option["valueHash"]) => void;
30
+ getHighlighted: () => Option | undefined;
31
+ }>): void;
32
+ attrs: any;
33
+ slots: Partial<Record<"loading", (_: {}) => any>> & Partial<Record<"no-data", (_: {}) => any>> & {
34
+ 'options:prepend'?(_: {}): any;
35
+ option?(_: {
36
+ disabled: boolean;
37
+ focused: boolean;
38
+ index: number;
39
+ item: Item;
40
+ selected: boolean;
41
+ text: string;
42
+ value: any;
43
+ }): any;
44
+ 'options:append'?(_: {}): any;
45
+ };
46
+ emit: {
47
+ (e: "option:selected", option: Option): void;
48
+ (e: "option:unselected", option: Option): void;
49
+ };
50
+ }>) => import('vue').VNode & {
51
+ __ctx?: Awaited<typeof __VLS_setup>;
52
+ };
53
+ export default _default;
54
+ type __VLS_PrettifyLocal<T> = {
55
+ [K in keyof T]: T[K];
56
+ } & {};
@@ -0,0 +1,67 @@
1
+ import { GroupedOptions, Option } from '../types/Option';
2
+ declare const _default: <Item = any>(__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<{
3
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
+ readonly "onOption:unselected"?: ((option: Option) => any) | undefined;
5
+ readonly "onOption:selected"?: ((option: Option) => any) | undefined;
6
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onOption:unselected" | "onOption:selected"> & {
7
+ /**
8
+ * Sets the listbox in a compact state.
9
+ */
10
+ compact?: boolean;
11
+ groups: GroupedOptions[];
12
+ /**
13
+ * Height of group headers (px). Defaults to 24px (compact) or 32px.
14
+ */
15
+ headerHeight?: number;
16
+ loading?: boolean;
17
+ loadingText?: string;
18
+ multiple?: boolean;
19
+ noDataText?: string;
20
+ open?: boolean;
21
+ optionHeight?: number;
22
+ transitionDuration?: number;
23
+ } & Partial<{}>> & import('vue').PublicProps;
24
+ expose(exposed: import('vue').ShallowUnwrapRef<{
25
+ focusNext: () => void;
26
+ focusPrevious: () => void;
27
+ focusFirst: () => void;
28
+ focusFirstSelected: () => void;
29
+ focusLast: () => void;
30
+ focusLastSelected: () => void;
31
+ blur: () => void;
32
+ confirmOption: () => void;
33
+ focusByHash: (hash: Option["valueHash"]) => void;
34
+ getHighlighted: () => Option | undefined;
35
+ }>): void;
36
+ attrs: any;
37
+ slots: Partial<Record<"loading", (_: {}) => any>> & Partial<Record<"no-data", (_: {}) => any>> & {
38
+ 'options:prepend'?(_: {}): any;
39
+ group?(_: {
40
+ text: string;
41
+ item: any;
42
+ index: number;
43
+ length: number;
44
+ disabled: boolean;
45
+ }): any;
46
+ option?(_: {
47
+ disabled: boolean;
48
+ focused: boolean;
49
+ index: number;
50
+ item: any;
51
+ selected: boolean;
52
+ text: string;
53
+ value: any;
54
+ }): any;
55
+ 'options:append'?(_: {}): any;
56
+ };
57
+ emit: {
58
+ (e: "option:selected", option: Option): void;
59
+ (e: "option:unselected", option: Option): void;
60
+ };
61
+ }>) => import('vue').VNode & {
62
+ __ctx?: Awaited<typeof __VLS_setup>;
63
+ };
64
+ export default _default;
65
+ type __VLS_PrettifyLocal<T> = {
66
+ [K in keyof T]: T[K];
67
+ } & {};
@@ -1,14 +1,34 @@
1
- import { Option } from '../types/Option';
1
+ import { GroupedOptions, Option } from '../types/Option';
2
+ export type ListBoxExposed = {
3
+ focusNext: () => void;
4
+ focusPrevious: () => void;
5
+ focusFirst: () => void;
6
+ focusFirstSelected: () => void;
7
+ focusLast: () => void;
8
+ focusLastSelected: () => void;
9
+ blur: () => void;
10
+ confirmOption: () => void;
11
+ focusByHash: (hash: Option['valueHash']) => void;
12
+ getHighlighted: () => Option | undefined;
13
+ };
2
14
  declare const _default: <Item = any>(__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<{
3
15
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
16
  readonly "onOption:unselected"?: ((option: Option) => any) | undefined;
5
17
  readonly "onOption:selected"?: ((option: Option) => any) | undefined;
6
18
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onOption:unselected" | "onOption:selected"> & {
19
+ compact?: boolean;
7
20
  /**
8
- * Sets the listbox in a compact state.
21
+ * Flat option list. Used when `groups` is not provided.
9
22
  */
10
- compact?: boolean;
11
- options: Option<Item>[];
23
+ options?: Option<Item>[];
24
+ /**
25
+ * Grouped option list. When provided, the grouped listbox is rendered.
26
+ */
27
+ groups?: GroupedOptions[];
28
+ /**
29
+ * Height of group headers in the listbox (px).
30
+ */
31
+ headerHeight?: number;
12
32
  open?: boolean;
13
33
  loading?: boolean;
14
34
  multiple?: boolean;
@@ -18,20 +38,36 @@ declare const _default: <Item = any>(__VLS_props: NonNullable<Awaited<typeof __V
18
38
  optionHeight?: number;
19
39
  } & Partial<{}>> & import('vue').PublicProps;
20
40
  expose(exposed: import('vue').ShallowUnwrapRef<{
21
- focusNext: () => void;
22
- focusPrevious: () => Promise<void>;
23
- focusFirst: () => void;
24
- focusFirstSelected: () => void;
25
- focusLast: () => void;
26
- focusLastSelected: () => void;
27
- blur: () => void;
28
- confirmOption: () => void;
29
- focusByHash: (hash: Option["valueHash"]) => void;
30
- getHighlighted: () => Option<Item> | undefined;
41
+ focusNext: () => void | undefined;
42
+ focusPrevious: () => void | undefined;
43
+ focusFirst: () => void | undefined;
44
+ focusFirstSelected: () => void | undefined;
45
+ focusLast: () => void | undefined;
46
+ focusLastSelected: () => void | undefined;
47
+ blur: () => void | undefined;
48
+ confirmOption: () => void | undefined;
49
+ focusByHash: (hash: Option["valueHash"]) => void | undefined;
50
+ getHighlighted: () => Option | undefined;
31
51
  }>): void;
32
52
  attrs: any;
33
- slots: Partial<Record<"loading", (_: {}) => any>> & Partial<Record<"no-data", (_: {}) => any>> & {
53
+ slots: {
54
+ 'options:prepend'?(_: {}): any;
34
55
  'options:prepend'?(_: {}): any;
56
+ loading?(_: {}): any;
57
+ loading?(_: {}): any;
58
+ 'no-data'?(_: {}): any;
59
+ 'no-data'?(_: {}): any;
60
+ 'options:append'?(_: {}): any;
61
+ 'options:append'?(_: {}): any;
62
+ option?(_: {
63
+ disabled: boolean;
64
+ focused: boolean;
65
+ index: number;
66
+ item: any;
67
+ selected: boolean;
68
+ text: string;
69
+ value: any;
70
+ }): any;
35
71
  option?(_: {
36
72
  disabled: boolean;
37
73
  focused: boolean;
@@ -41,7 +77,13 @@ declare const _default: <Item = any>(__VLS_props: NonNullable<Awaited<typeof __V
41
77
  text: string;
42
78
  value: any;
43
79
  }): any;
44
- 'options:append'?(_: {}): any;
80
+ group?(_: {
81
+ text: string;
82
+ item: any;
83
+ index: number;
84
+ length: number;
85
+ disabled: boolean;
86
+ }): any;
45
87
  };
46
88
  emit: {
47
89
  (e: "option:selected", option: Option): void;
@@ -0,0 +1,19 @@
1
+ import { MaybeRefOrGetter } from 'vue';
2
+ import { Option } from '../types/Option';
3
+ interface UseListboxFocusOptions {
4
+ disabled?: MaybeRefOrGetter<boolean>;
5
+ }
6
+ export declare function useListboxFocus(options: MaybeRefOrGetter<Option[]>, { disabled }?: UseListboxFocusOptions): {
7
+ focusedIndex: import('vue').Ref<number | null, number | null>;
8
+ canFocus: import('vue').ComputedRef<boolean>;
9
+ focusNext: () => void;
10
+ focusPrevious: () => void;
11
+ focusFirst: () => void;
12
+ focusLast: () => void;
13
+ focusFirstSelected: () => void;
14
+ focusLastSelected: () => void;
15
+ focusByHash: (hash: Option["valueHash"]) => void;
16
+ blur: () => void;
17
+ getHighlighted: () => Option | undefined;
18
+ };
19
+ export {};