bitboss-ui 2.1.95 → 2.1.97

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 (203) 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/index11.js +18 -18
  11. package/dist/index115.js +1 -1
  12. package/dist/index121.js +6 -7
  13. package/dist/index123.js +13 -13
  14. package/dist/index131.js +1 -1
  15. package/dist/index133.js +5 -5
  16. package/dist/index135.js +1 -1
  17. package/dist/index137.js +2 -2
  18. package/dist/index14.js +1 -1
  19. package/dist/index140.js +1 -1
  20. package/dist/index142.js +2 -2
  21. package/dist/index145.js +2 -2
  22. package/dist/index16.js +5 -5
  23. package/dist/index18.js +3 -3
  24. package/dist/index20.js +8 -8
  25. package/dist/index216.js +138 -2
  26. package/dist/index217.js +2 -138
  27. package/dist/index219.js +32 -4
  28. package/dist/index22.js +14 -14
  29. package/dist/index220.js +28 -8
  30. package/dist/index222.js +5 -2
  31. package/dist/index223.js +8 -2
  32. package/dist/index224.js +2 -7
  33. package/dist/index225.js +4 -2
  34. package/dist/index226.js +34 -7
  35. package/dist/index227.js +2 -5
  36. package/dist/index228.js +3 -5
  37. package/dist/index229.js +2 -5
  38. package/dist/index230.js +13 -5
  39. package/dist/index231.js +3 -3
  40. package/dist/index232.js +187 -5
  41. package/dist/index233.js +3 -8
  42. package/dist/index234.js +9 -268
  43. package/dist/index235.js +4 -52
  44. package/dist/index236.js +19 -51
  45. package/dist/index237.js +195 -26
  46. package/dist/index239.js +134 -12
  47. package/dist/index24.js +11 -11
  48. package/dist/index241.js +2 -17
  49. package/dist/index242.js +50 -105
  50. package/dist/index243.js +19 -0
  51. package/dist/index244.js +53 -47
  52. package/dist/index246.js +100 -3
  53. package/dist/index248.js +3 -3
  54. package/dist/index249.js +86 -10
  55. package/dist/index251.js +29 -4
  56. package/dist/index252.js +16 -5
  57. package/dist/index253.js +15 -4
  58. package/dist/index254.js +3 -9
  59. package/dist/index255.js +11 -28
  60. package/dist/index256.js +12 -15
  61. package/dist/index257.js +4 -12
  62. package/dist/index258.js +22 -52
  63. package/dist/index259.js +31 -11
  64. package/dist/index26.js +3 -3
  65. package/dist/index260.js +2 -13
  66. package/dist/index261.js +8 -2
  67. package/dist/index262.js +8 -66
  68. package/dist/index263.js +23 -33
  69. package/dist/index264.js +3 -28
  70. package/dist/index265.js +15 -0
  71. package/dist/index266.js +9 -188
  72. package/dist/index267.js +53 -3
  73. package/dist/index268.js +10 -3
  74. package/dist/index269.js +2 -32
  75. package/dist/index270.js +66 -7
  76. package/dist/index271.js +5 -5
  77. package/dist/index272.js +2 -5
  78. package/dist/index273.js +7 -5
  79. package/dist/index274.js +7 -20
  80. package/dist/index275.js +17 -134
  81. package/dist/index276.js +14 -0
  82. package/dist/index277.js +98 -80
  83. package/dist/index278.js +13 -0
  84. package/dist/index279.js +5 -15
  85. package/dist/index28.js +1 -1
  86. package/dist/index280.js +5 -9
  87. package/dist/index281.js +5 -23
  88. package/dist/index282.js +5 -23
  89. package/dist/index283.js +5 -8
  90. package/dist/index284.js +268 -4
  91. package/dist/index285.js +41 -190
  92. package/dist/index286.js +54 -0
  93. package/dist/index287.js +26 -28
  94. package/dist/index288.js +60 -7
  95. package/dist/index289.js +6 -17
  96. package/dist/index290.js +5 -12
  97. package/dist/index291.js +5 -229
  98. package/dist/index292.js +5 -3
  99. package/dist/index293.js +6 -11
  100. package/dist/index294.js +16 -6
  101. package/dist/index295.js +20 -15
  102. package/dist/index297.js +5 -0
  103. package/dist/index298.js +4 -3
  104. package/dist/index299.js +7 -280
  105. package/dist/index30.js +3 -3
  106. package/dist/index300.js +2 -2
  107. package/dist/index301.js +5 -16
  108. package/dist/index302.js +3 -2
  109. package/dist/index303.js +3 -16
  110. package/dist/index304.js +3 -2
  111. package/dist/index305.js +3 -27
  112. package/dist/index306.js +17 -2
  113. package/dist/index307.js +3 -2
  114. package/dist/index308.js +28 -2
  115. package/dist/index309.js +5 -2
  116. package/dist/index310.js +1 -1
  117. package/dist/index311.js +2 -28
  118. package/dist/index312.js +280 -2
  119. package/dist/index313.js +2 -3
  120. package/dist/index314.js +16 -2
  121. package/dist/index315.js +2 -4
  122. package/dist/index316.js +16 -17
  123. package/dist/index317.js +2 -3
  124. package/dist/index318.js +27 -3
  125. package/dist/index319.js +2 -125
  126. package/dist/index32.js +2 -2
  127. package/dist/index320.js +2 -2
  128. package/dist/index321.js +2 -15
  129. package/dist/index322.js +2 -2
  130. package/dist/index323.js +2 -19
  131. package/dist/index324.js +2 -2
  132. package/dist/index325.js +4 -3
  133. package/dist/index326.js +719 -3
  134. package/dist/index327.js +366 -5
  135. package/dist/index328.js +57 -2
  136. package/dist/index329.js +124 -3
  137. package/dist/index330.js +2 -5
  138. package/dist/index331.js +14 -5
  139. package/dist/index332.js +2 -2
  140. package/dist/index333.js +19 -58
  141. package/dist/index334.js +2 -58
  142. package/dist/index335.js +57 -718
  143. package/dist/index336.js +57 -365
  144. package/dist/index337.js +221 -50
  145. package/dist/index338.js +5 -6
  146. package/dist/index339.js +91 -17
  147. package/dist/index34.js +8 -8
  148. package/dist/index340.js +7 -8
  149. package/dist/index341.js +5 -14
  150. package/dist/index342.js +8 -5
  151. package/dist/index343.js +34 -6
  152. package/dist/index344.js +6 -35
  153. package/dist/index345.js +129 -6
  154. package/dist/index346.js +382 -113
  155. package/dist/index347.js +114 -378
  156. package/dist/index348.js +193 -8
  157. package/dist/index349.js +258 -6
  158. package/dist/index350.js +7 -8
  159. package/dist/index351.js +17 -226
  160. package/dist/index352.js +9 -22
  161. package/dist/index353.js +17 -0
  162. package/dist/index354.js +5 -134
  163. package/dist/index355.js +6 -46
  164. package/dist/index356.js +2 -93
  165. package/dist/index357.js +2 -441
  166. package/dist/index358.js +21 -127
  167. package/dist/index36.js +4 -4
  168. package/dist/index360.js +435 -44
  169. package/dist/index361.js +130 -0
  170. package/dist/index362.js +49 -0
  171. package/dist/index363.js +72 -0
  172. package/dist/{index359.js → index364.js} +1 -1
  173. package/dist/index365.js +52 -0
  174. package/dist/index38.js +252 -232
  175. package/dist/index40.js +7 -7
  176. package/dist/index42.js +2 -2
  177. package/dist/index44.js +8 -8
  178. package/dist/index46.js +6 -6
  179. package/dist/index50.js +2 -2
  180. package/dist/index54.js +1 -1
  181. package/dist/index56.js +1 -1
  182. package/dist/index58.js +2 -2
  183. package/dist/index62.js +5 -5
  184. package/dist/index68.js +1 -1
  185. package/dist/index81.js +6 -6
  186. package/dist/index83.js +1 -1
  187. package/dist/index85.js +2 -2
  188. package/dist/index87.js +3 -3
  189. package/dist/index89.js +1 -1
  190. package/dist/index92.js +3 -3
  191. package/dist/index94.js +2 -2
  192. package/dist/index96.js +5 -5
  193. package/dist/index98.js +1 -1
  194. package/dist/types/Option.d.ts +5 -0
  195. package/dist/utilities/functions/groupBy.d.ts +4 -2
  196. package/dist/utilities/functions/indexBy.d.ts +9 -2
  197. package/package.json +2 -2
  198. package/dist/index221.js +0 -4
  199. package/dist/index238.js +0 -62
  200. package/dist/index240.js +0 -53
  201. package/dist/index247.js +0 -4
  202. package/dist/index250.js +0 -5
  203. package/dist/index296.js +0 -9
@@ -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 {};