bitboss-ui 2.0.117 → 2.0.118

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 (175) hide show
  1. package/dist/components/BaseDatePickerInput/BaseDatePickerInput.vue.d.ts +15 -3
  2. package/dist/components/BaseSelect/BaseSelect.vue.d.ts +29 -367
  3. package/dist/components/BbDropdown/BbDropdown.vue.d.ts +76 -89
  4. package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +75 -89
  5. package/dist/components/BbRows/BbRows.vue.d.ts +70 -85
  6. package/dist/components/BbSelect/BbSelect.vue.d.ts +1 -10
  7. package/dist/components/BbTable/BbTable.vue.d.ts +63 -91
  8. package/dist/components/BbTable/types.d.ts +46 -27
  9. package/dist/components/ListBox.vue.d.ts +40 -44
  10. package/dist/index100.js +91 -82
  11. package/dist/index101.js +7 -16
  12. package/dist/index111.js +235 -211
  13. package/dist/index119.js +2 -2
  14. package/dist/index121.js +6 -6
  15. package/dist/index123.js +1 -1
  16. package/dist/index125.js +1 -1
  17. package/dist/index127.js +1 -1
  18. package/dist/index128.js +1 -1
  19. package/dist/index129.js +1 -1
  20. package/dist/index13.js +2 -2
  21. package/dist/index131.js +1 -1
  22. package/dist/index132.js +2 -2
  23. package/dist/index133.js +2 -2
  24. package/dist/index15.js +5 -5
  25. package/dist/index17.js +3 -3
  26. package/dist/index19.js +8 -8
  27. package/dist/index205.js +2 -115
  28. package/dist/index206.js +126 -2
  29. package/dist/index207.js +5 -65
  30. package/dist/index208.js +127 -0
  31. package/dist/index209.js +16 -13
  32. package/dist/index21.js +16 -16
  33. package/dist/index210.js +15 -19
  34. package/dist/index211.js +19 -4
  35. package/dist/index212.js +15 -13
  36. package/dist/index213.js +2 -3
  37. package/dist/index214.js +2 -126
  38. package/dist/index215.js +41 -5
  39. package/dist/index216.js +13 -125
  40. package/dist/index217.js +19 -15
  41. package/dist/index218.js +6 -16
  42. package/dist/index219.js +15 -19
  43. package/dist/index220.js +65 -15
  44. package/dist/index222.js +13 -2
  45. package/dist/index223.js +5 -41
  46. package/dist/index224.js +2 -6
  47. package/dist/index225.js +369 -15
  48. package/dist/index226.js +3 -5
  49. package/dist/index227.js +7 -2
  50. package/dist/index228.js +7 -368
  51. package/dist/index229.js +19 -86
  52. package/dist/index23.js +19 -19
  53. package/dist/index230.js +29 -0
  54. package/dist/index231.js +3 -25
  55. package/dist/index232.js +250 -17
  56. package/dist/index233.js +50 -49
  57. package/dist/index234.js +44 -15
  58. package/dist/index235.js +5 -3
  59. package/dist/index236.js +60 -12
  60. package/dist/index237.js +3 -16
  61. package/dist/index238.js +115 -2
  62. package/dist/index239.js +4 -4
  63. package/dist/index240.js +2 -2
  64. package/dist/index241.js +4 -19
  65. package/dist/index242.js +2 -27
  66. package/dist/index243.js +84 -6
  67. package/dist/index245.js +24 -51
  68. package/dist/index246.js +17 -44
  69. package/dist/index247.js +51 -5
  70. package/dist/index248.js +15 -60
  71. package/dist/index249.js +12 -3
  72. package/dist/index25.js +7 -7
  73. package/dist/index250.js +16 -7
  74. package/dist/index253.js +18 -2
  75. package/dist/index254.js +105 -17
  76. package/dist/{index257.js → index256.js} +1 -1
  77. package/dist/index258.js +14 -0
  78. package/dist/index259.js +214 -12
  79. package/dist/index262.js +9 -6
  80. package/dist/index263.js +23 -16
  81. package/dist/index264.js +89 -8
  82. package/dist/index266.js +6 -90
  83. package/dist/index267.js +18 -0
  84. package/dist/index269.js +9 -224
  85. package/dist/index27.js +1 -1
  86. package/dist/index270.js +8 -3
  87. package/dist/index271.js +283 -0
  88. package/dist/index272.js +6 -7
  89. package/dist/index273.js +2 -176
  90. package/dist/index274.js +2 -7
  91. package/dist/index275.js +2 -11
  92. package/dist/index276.js +2 -281
  93. package/dist/index277.js +2 -6
  94. package/dist/index278.js +2 -2
  95. package/dist/index279.js +126 -2
  96. package/dist/index280.js +431 -2
  97. package/dist/index281.js +176 -2
  98. package/dist/index282.js +2 -2
  99. package/dist/index283.js +3 -2
  100. package/dist/index285.js +5 -429
  101. package/dist/index286.js +21 -1
  102. package/dist/index288.js +9 -0
  103. package/dist/index289.js +11 -3
  104. package/dist/index29.js +3 -3
  105. package/dist/index290.js +87 -15
  106. package/dist/index291.js +199 -8
  107. package/dist/index292.js +431 -23
  108. package/dist/index293.js +126 -3
  109. package/dist/index294.js +219 -431
  110. package/dist/index295.js +2 -127
  111. package/dist/index296.js +2 -200
  112. package/dist/index297.js +2 -2
  113. package/dist/index298.js +2 -2
  114. package/dist/index299.js +1 -1
  115. package/dist/index300.js +1 -1
  116. package/dist/index301.js +28 -2
  117. package/dist/index302.js +21 -1
  118. package/dist/index304.js +6 -0
  119. package/dist/index305.js +3 -8
  120. package/dist/index306.js +15 -87
  121. package/dist/index307.js +1 -1
  122. package/dist/index308.js +1 -1
  123. package/dist/index309.js +2 -214
  124. package/dist/index31.js +2 -2
  125. package/dist/index311.js +5 -3
  126. package/dist/index312.js +67 -3
  127. package/dist/index313.js +3 -58
  128. package/dist/index314.js +5 -5
  129. package/dist/index315.js +8 -67
  130. package/dist/index316.js +3 -7
  131. package/dist/index317.js +3 -19
  132. package/dist/index318.js +58 -3
  133. package/dist/index319.js +3 -32
  134. package/dist/index320.js +28 -21
  135. package/dist/index321.js +25 -52
  136. package/dist/index322.js +7 -53
  137. package/dist/index323.js +6 -4
  138. package/dist/index324.js +18 -7
  139. package/dist/index325.js +53 -7
  140. package/dist/index326.js +53 -4
  141. package/dist/index328.js +480 -2
  142. package/dist/index329.js +4 -0
  143. package/dist/index33.js +8 -8
  144. package/dist/index35.js +4 -4
  145. package/dist/index37.js +176 -175
  146. package/dist/index39.js +3 -3
  147. package/dist/index41.js +2 -2
  148. package/dist/index43.js +8 -8
  149. package/dist/index45.js +8 -8
  150. package/dist/index47.js +2 -2
  151. package/dist/index49.js +2 -2
  152. package/dist/index53.js +1 -1
  153. package/dist/index55.js +1 -1
  154. package/dist/index57.js +1 -1
  155. package/dist/index61.js +1 -1
  156. package/dist/index75.js +37 -35
  157. package/dist/index77.js +54 -50
  158. package/dist/index79.js +2 -2
  159. package/dist/index81.js +1 -1
  160. package/dist/index84.js +4 -4
  161. package/dist/index86.js +1 -1
  162. package/dist/index88.js +5 -5
  163. package/dist/index90.js +1 -1
  164. package/dist/types/ColumnName.d.ts +4 -0
  165. package/dist/types/Option.d.ts +2 -2
  166. package/dist/types/PrefixWith.d.ts +1 -0
  167. package/package.json +1 -1
  168. package/dist/index221.js +0 -4
  169. package/dist/index244.js +0 -252
  170. package/dist/index255.js +0 -108
  171. package/dist/index265.js +0 -25
  172. package/dist/index284.js +0 -128
  173. package/dist/index287.js +0 -24
  174. package/dist/index303.js +0 -24
  175. package/dist/index331.js +0 -482
@@ -1,63 +1,58 @@
1
1
  import { BaseColumn } from '../BbTable/types';
2
- import { Option as BaseOption } from '../../types/Option';
3
- export type BbRowsColumn = BaseColumn;
4
- type Props = {
5
- columns: BbRowsColumn[];
6
- /**
7
- * Defines an array of dependencies that will trigger actions in the component upon change.
8
- */
9
- dependencies?: any[];
10
- /**
11
- * Timeout used to debounce response to changes to dependencies.
12
- */
13
- depsDebounceTime?: number;
14
- /**
15
- * Disables the component
16
- */
17
- disabled?: boolean;
18
- items: any[] | ((prefill: boolean, modelValue?: any[]) => Promise<any[]>) | ((prefill: boolean, modelValue?: any[]) => any[]);
19
- itemValue?: string | ((item: any) => any);
20
- /**
21
- * Sets the component in a loading state, usually triggering some visual styles.
22
- */
23
- loading?: boolean;
24
- /**
25
- * Maximum number of items that can be selected.
26
- */
27
- max?: number;
28
- /**
29
- * Used by v-model. Can be any serializable type.
30
- */
31
- modelValue?: any;
32
- /**
33
- * Allows the selection of multiple items.
34
- */
35
- multiple?: boolean;
36
- /**
37
- * Defines whether the table is selectable.
38
- * Can be a global boolean that affects all rows or a function
39
- * that accepts an item and returns a boolean that only affects that item.
40
- */
41
- selectable?: boolean | ((item: any) => boolean);
42
- };
43
- declare let __VLS_typeProps: Props;
44
- /**
45
- * Projection that represents a row of cells with flags
46
- * linked to the state of the item
47
- */
48
- export type MappedItem = BaseOption & {
49
- columns: Record<string, ItemColumn>;
50
- };
51
- type ItemColumn = {
52
- key: string;
53
- label: string;
54
- value: any;
55
- };
56
- type __VLS_PublicProps = {
57
- 'unselected-items'?: any[];
58
- 'select-all'?: boolean;
59
- } & typeof __VLS_typeProps;
60
- declare function __VLS_template(): {
2
+ export type BbRowsColumn<T extends string, Item extends object> = BaseColumn<T, Item>;
3
+ declare const _default: <T extends string, Item extends object>(__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<{
4
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
5
+ readonly "onUpdate:modelValue"?: ((value: any) => any) | undefined;
6
+ readonly "onUpdate:unselectedItems"?: ((value: any[]) => any) | undefined;
7
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue" | "onUpdate:unselectedItems"> & {
8
+ columns: BbRowsColumn<T, Item>[];
9
+ /**
10
+ * Defines an array of dependencies that will trigger actions in the component upon change.
11
+ */
12
+ dependencies?: any[];
13
+ /**
14
+ * Timeout used to debounce response to changes to dependencies.
15
+ */
16
+ depsDebounceTime?: number;
17
+ /**
18
+ * Disables the component
19
+ */
20
+ disabled?: boolean;
21
+ items: any[] | ((prefill: boolean, modelValue?: any[]) => Promise<any[]>) | ((prefill: boolean, modelValue?: any[]) => any[]);
22
+ itemValue?: string | ((item: any) => any);
23
+ /**
24
+ * Sets the component in a loading state, usually triggering some visual styles.
25
+ */
26
+ loading?: boolean;
27
+ /**
28
+ * Maximum number of items that can be selected.
29
+ */
30
+ max?: number;
31
+ /**
32
+ * Used by v-model. Can be any serializable type.
33
+ */
34
+ modelValue?: any;
35
+ /**
36
+ * Allows the selection of multiple items.
37
+ */
38
+ multiple?: boolean;
39
+ /**
40
+ * Defines whether the table is selectable.
41
+ * Can be a global boolean that affects all rows or a function
42
+ * that accepts an item and returns a boolean that only affects that item.
43
+ */
44
+ selectable?: boolean | ((item: any) => boolean);
45
+ /**
46
+ * Defines whether the table allows the selection of all items.
47
+ */
48
+ selectAll?: boolean;
49
+ /**
50
+ * Items that are not selected.
51
+ */
52
+ unselectedItems?: any[];
53
+ }> & import('vue').PublicProps;
54
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
55
+ attrs: any;
61
56
  slots: {
62
57
  loading?(_: {
63
58
  items: any[];
@@ -68,7 +63,11 @@ declare function __VLS_template(): {
68
63
  default?(_: {
69
64
  key: string;
70
65
  checked: boolean | undefined;
71
- columns: Record<string, ItemColumn>;
66
+ columns: Record<string, {
67
+ key: string;
68
+ label: string;
69
+ value: any;
70
+ }>;
72
71
  disabled: boolean | undefined;
73
72
  index: number;
74
73
  item: any;
@@ -77,30 +76,16 @@ declare function __VLS_template(): {
77
76
  value: any;
78
77
  }): any;
79
78
  };
80
- refs: {};
81
- attrs: Partial<{}>;
82
- };
83
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
84
- declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
85
- "update:unselected-items": (args_0: unselected) => any;
86
- } & {
87
- "update:modelValue": (value: any) => any;
88
- }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
89
- "onUpdate:modelValue"?: ((value: any) => any) | undefined;
90
- "onUpdate:unselected-items"?: ((args_0: unselected) => any) | undefined;
91
- }>, {
92
- dependencies: any[];
93
- depsDebounceTime: number;
94
- multiple: boolean;
95
- modelValue: any;
96
- items: any[] | ((prefill: boolean, modelValue?: any[]) => Promise<any[]>) | ((prefill: boolean, modelValue?: any[]) => any[]);
97
- max: number;
98
- columns: BbRowsColumn[];
99
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
100
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
101
- export default _default;
102
- type __VLS_WithTemplateSlots<T, S> = T & {
103
- new (): {
104
- $slots: S;
79
+ emit: {
80
+ (e: "update:modelValue", value: any): void;
81
+ (e: "update:unselectedItems", value: any[]): void;
105
82
  };
83
+ }>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
84
+ [key: string]: any;
85
+ }> & {
86
+ __ctx?: Awaited<typeof __VLS_setup>;
106
87
  };
88
+ export default _default;
89
+ type __VLS_PrettifyLocal<T> = {
90
+ [K in keyof T]: T[K];
91
+ } & {};
@@ -229,18 +229,12 @@ export type BbSelectSlots<T> = {
229
229
  focused: boolean;
230
230
  index: number;
231
231
  hasErrors?: boolean;
232
- item: any;
232
+ item: T;
233
233
  loading: boolean;
234
234
  selected: boolean;
235
235
  text: string;
236
236
  value: any;
237
237
  }) => any;
238
- 'option:append'?: (props: {
239
- item: T;
240
- }) => any;
241
- 'option:prepend'?: (props: {
242
- item: T;
243
- }) => any;
244
238
  'options:append'?: (props: object) => any;
245
239
  'options:prepend'?: (props: object) => any;
246
240
  prefix?: (props: object) => any;
@@ -250,9 +244,6 @@ export type BbSelectSlots<T> = {
250
244
  'prepend-outer'?: (props: {
251
245
  query: string;
252
246
  }) => any;
253
- spinner?: (props: {
254
- loading: boolean;
255
- }) => any;
256
247
  suffix?: (props: object) => any;
257
248
  };
258
249
  declare const _default: <T = 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<{
@@ -1,11 +1,19 @@
1
- import { BbTableProps, BbTableColumn } from './types';
1
+ import { BbTableProps, BbTableEvents } from './types';
2
2
  import { Classes } from '../../types/Classes';
3
- declare let __VLS_typeProps: BbTableProps;
4
- type __VLS_PublicProps = {
5
- 'select-all'?: boolean;
6
- 'unselected-items'?: any[];
7
- } & typeof __VLS_typeProps;
8
- declare function __VLS_template(): {
3
+ import { ColumnName } from '../../types/ColumnName';
4
+ declare const _default: <T extends string, Item extends object = 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<{
5
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
6
+ readonly "onUpdate:modelValue"?: ((value: any) => any) | undefined;
7
+ readonly "onClick:row"?: ((event: MouseEvent, item: any, selected: boolean) => any) | undefined;
8
+ readonly "onContextmenu:row"?: ((event: MouseEvent, item: any, selected: boolean) => any) | undefined;
9
+ readonly "onDblclick:row"?: ((event: MouseEvent, item: any, selected: boolean) => any) | undefined;
10
+ readonly "onUpdate:selectAll"?: ((value: boolean) => any) | undefined;
11
+ readonly "onUpdate:unselectedItems"?: ((value: any[]) => any) | undefined;
12
+ readonly "onItem:selected"?: ((value: any) => any) | undefined;
13
+ readonly "onItem:unselected"?: ((value: any) => any) | undefined;
14
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue" | "onUpdate:unselectedItems" | "onClick:row" | "onContextmenu:row" | "onDblclick:row" | "onUpdate:selectAll" | "onItem:selected" | "onItem:unselected"> & BbTableProps<T, Item>> & import('vue').PublicProps;
15
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
16
+ attrs: any;
9
17
  slots: Readonly<{
10
18
  thead?: (props: object) => any;
11
19
  tbody?: (props: object) => any;
@@ -18,32 +26,33 @@ declare function __VLS_template(): {
18
26
  'header:actions'?: (props: {
19
27
  text: string;
20
28
  }) => any;
21
- loading?: (props: {
22
- items: any[];
23
- }) => any;
29
+ loading?: ((props: {
30
+ items: Item[];
31
+ }) => any) | undefined;
24
32
  'no-data'?: (props: object) => any;
25
- actions?: (props: {
26
- item: any;
33
+ actions?: ((props: {
34
+ item: Item;
27
35
  value: any;
28
- }) => any;
29
- select?: (props: {
30
- item: any;
36
+ }) => any) | undefined;
37
+ select?: ((props: {
38
+ item: Item;
31
39
  value: any;
32
40
  checked: boolean;
33
41
  disabled: boolean;
34
42
  inputName: string;
35
43
  readonly: boolean;
36
- }) => any;
37
- } & {
38
- [key: string]: (props: {
39
- classes?: Classes[];
40
- content?: any;
41
- items?: any[];
42
- item: any;
43
- label?: string;
44
- value?: any;
45
- }) => any;
46
- }> & {
44
+ }) => any) | undefined;
45
+ } & { [K in ColumnName<T>]?: ((props: {
46
+ classes?: Classes[];
47
+ content?: any;
48
+ item: Item;
49
+ value?: any;
50
+ }) => any) | undefined; } & { [K_1 in `header:${ColumnName<T>}`]?: ((props: {
51
+ classes?: Classes[];
52
+ content?: any;
53
+ items?: Item[] | undefined;
54
+ label?: string;
55
+ }) => any) | undefined; }> & {
47
56
  thead?: (props: object) => any;
48
57
  tbody?: (props: object) => any;
49
58
  tfoot?: (props: object) => any;
@@ -55,77 +64,40 @@ declare function __VLS_template(): {
55
64
  'header:actions'?: (props: {
56
65
  text: string;
57
66
  }) => any;
58
- loading?: (props: {
59
- items: any[];
60
- }) => any;
67
+ loading?: ((props: {
68
+ items: Item[];
69
+ }) => any) | undefined;
61
70
  'no-data'?: (props: object) => any;
62
- actions?: (props: {
63
- item: any;
71
+ actions?: ((props: {
72
+ item: Item;
64
73
  value: any;
65
- }) => any;
66
- select?: (props: {
67
- item: any;
74
+ }) => any) | undefined;
75
+ select?: ((props: {
76
+ item: Item;
68
77
  value: any;
69
78
  checked: boolean;
70
79
  disabled: boolean;
71
80
  inputName: string;
72
81
  readonly: boolean;
73
- }) => any;
74
- } & {
75
- [key: string]: (props: {
76
- classes?: Classes[];
77
- content?: any;
78
- items?: any[];
79
- item: any;
80
- label?: string;
81
- value?: any;
82
- }) => any;
83
- };
84
- refs: {
85
- container: unknown;
86
- };
87
- attrs: Partial<{}>;
82
+ }) => any) | undefined;
83
+ } & { [K in ColumnName<T>]?: ((props: {
84
+ classes?: Classes[];
85
+ content?: any;
86
+ item: Item;
87
+ value?: any;
88
+ }) => any) | undefined; } & { [K_1 in `header:${ColumnName<T>}`]?: ((props: {
89
+ classes?: Classes[];
90
+ content?: any;
91
+ items?: Item[] | undefined;
92
+ label?: string;
93
+ }) => any) | undefined; };
94
+ emit: BbTableEvents;
95
+ }>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
96
+ [key: string]: any;
97
+ }> & {
98
+ __ctx?: Awaited<typeof __VLS_setup>;
88
99
  };
89
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
90
- declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
91
- "update:select-all": (args_0: select) => any;
92
- } & {
93
- "update:modelValue": (value: any) => any;
94
- "click:row": (event: MouseEvent, item: any, selected: boolean) => any;
95
- "contextmenu:row": (event: MouseEvent, item: any, selected: boolean) => any;
96
- "dblclick:row": (event: MouseEvent, item: any, selected: boolean) => any;
97
- "update:selectAll": (value: boolean) => any;
98
- "item:selected": (value: any) => any;
99
- "item:unselected": (value: any) => any;
100
- }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
101
- "onUpdate:modelValue"?: ((value: any) => any) | undefined;
102
- "onClick:row"?: ((event: MouseEvent, item: any, selected: boolean) => any) | undefined;
103
- "onContextmenu:row"?: ((event: MouseEvent, item: any, selected: boolean) => any) | undefined;
104
- "onDblclick:row"?: ((event: MouseEvent, item: any, selected: boolean) => any) | undefined;
105
- "onUpdate:selectAll"?: ((value: boolean) => any) | undefined;
106
- "onItem:selected"?: ((value: any) => any) | undefined;
107
- "onItem:unselected"?: ((value: any) => any) | undefined;
108
- "onUpdate:select-all"?: ((args_0: select) => any) | undefined;
109
- }>, {
110
- dependencies: any[];
111
- depsDebounceTime: number;
112
- multiple: boolean;
113
- modelValue: any;
114
- items: any[] | ((prefill: boolean, modelValue?: any[]) => Promise<any[]>) | ((prefill: boolean, modelValue?: any[]) => any[]);
115
- max: number;
116
- align: "left" | "center" | "right";
117
- columns: BbTableColumn[];
118
- allowSelectAll: boolean;
119
- fixedColumns: (number | {
120
- index: number;
121
- position: "left" | "right";
122
- })[];
123
- actionsText: string;
124
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
125
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
126
100
  export default _default;
127
- type __VLS_WithTemplateSlots<T, S> = T & {
128
- new (): {
129
- $slots: S;
130
- };
131
- };
101
+ type __VLS_PrettifyLocal<T> = {
102
+ [K in keyof T]: T[K];
103
+ } & {};
@@ -1,7 +1,7 @@
1
1
  import { Classes } from '../../types/Classes';
2
2
  import { Option } from '../../types/Option';
3
3
  import { InputHTMLAttributes } from 'vue';
4
- export type BaseColumn = {
4
+ export type BaseColumn<T extends string, Item extends object> = {
5
5
  /**
6
6
  * When set to false the formatter will not run on nullish values.
7
7
  * By default is true so you can create virtual columns with keys that do not
@@ -15,11 +15,11 @@ export type BaseColumn = {
15
15
  * @param key Key of the column taken from the column definition.
16
16
  * @param item Item of the row.
17
17
  */
18
- formatter?: (content: any, key: string, item: any) => any;
18
+ formatter?: (content: any, key: string, item: Item) => any;
19
19
  /**
20
20
  * Key identifying the column.
21
21
  */
22
- key: string;
22
+ key: T;
23
23
  /**
24
24
  * Text used in the header for this column.
25
25
  */
@@ -32,26 +32,30 @@ export type BaseColumn = {
32
32
  /**
33
33
  * Type used to infer the bahaviour of a single column. You can either extract data or provide elements useful for styling.
34
34
  */
35
- export type BbTableColumn = BaseColumn & {
35
+ export type BbTableColumn<T extends string = string, Item extends object = any> = BaseColumn<T, Item> & {
36
36
  /**
37
37
  * Text alignment of the column.
38
38
  */
39
39
  align?: 'left' | 'right' | 'center';
40
+ /**
41
+ * Defines the sorting direction of the column.
42
+ */
43
+ sorted?: 'asc' | 'desc';
40
44
  /**
41
45
  * Defines the classes to be passed to the `<td>` elements. Can also be a function for dynamic values.
42
46
  */
43
- tdClass?: ColumnClasses;
47
+ tdClass?: ColumnClasses<Item>;
44
48
  /**
45
49
  * Defines the classes to be passed to the `<th>`.
46
50
  */
47
51
  thClass?: Classes;
48
52
  };
49
- export type BbTableProps = {
53
+ export type BbTableProps<T extends string, Item extends object> = {
50
54
  /**
51
55
  * Function that accepts the columns and the current item as
52
56
  * arguments and returns a label to be used for accessibility purposes.
53
57
  */
54
- accessibleLabel?: (columns: MappedCell[], item: any) => string;
58
+ accessibleLabel?: (columns: MappedCell<T>[], item: any) => string;
55
59
  /**
56
60
  * Displays the actions column.
57
61
  */
@@ -76,7 +80,7 @@ export type BbTableProps = {
76
80
  * Array of definitions of how the columns should be rendered.
77
81
  *
78
82
  */
79
- columns: BbTableColumn[];
83
+ columns: BbTableColumn<T, Item>[];
80
84
  /**
81
85
  * Adds a CSS class that applies a compact style to the component.
82
86
  */
@@ -116,8 +120,8 @@ export type BbTableProps = {
116
120
  * Boolean that sets the headers as sticky to the top of the table.
117
121
  */
118
122
  fixedHeaders?: boolean;
119
- items: any[] | ((prefill: boolean, modelValue?: any[]) => Promise<any[]>) | ((prefill: boolean, modelValue?: any[]) => any[]);
120
- itemValue?: string | ((item: any) => any);
123
+ items: Item[] | ((prefill: boolean, modelValue?: any[]) => Promise<Item[]>) | ((prefill: boolean, modelValue?: any[]) => Item[]);
124
+ itemValue?: string | ((item: Item) => any);
121
125
  /**
122
126
  * Text content of the legend.
123
127
  */
@@ -162,12 +166,16 @@ export type BbTableProps = {
162
166
  * Sets the input in a readonly state.
163
167
  */
164
168
  readonly?: boolean;
169
+ /**
170
+ * Defines whether the "Select all" checkbox is checked.
171
+ */
172
+ selectAll?: boolean;
165
173
  /**
166
174
  * Defines whether the table is selectable.
167
175
  * Can be a global boolean that affects all rows or a function
168
176
  * that accepts an item and returns a boolean that only affects that item.
169
177
  */
170
- selectable?: boolean | ((item: any) => boolean);
178
+ selectable?: boolean | ((item: Item) => boolean);
171
179
  /**
172
180
  * Text of the label used by the "Select all" boolean.
173
181
  */
@@ -179,7 +187,7 @@ export type BbTableProps = {
179
187
  /**
180
188
  * Defines the classes to be passed to the `<td>` elements. Can also be a function for dynamic values.
181
189
  */
182
- tdClass?: ColumnClasses;
190
+ tdClass?: ColumnClasses<Item>;
183
191
  /**
184
192
  * Defines the classes to be passed to the `<th>`.
185
193
  */
@@ -188,18 +196,22 @@ export type BbTableProps = {
188
196
  * Total number of items there is.
189
197
  */
190
198
  totalItems?: number;
199
+ /**
200
+ * Items that are not selected.
201
+ */
202
+ unselectedItems?: any[];
191
203
  };
192
204
  /**
193
205
  * We allow table data classes to be a function so it can depend on the item
194
206
  */
195
- export type ColumnClasses = Classes | ((content: any, key: string, item: any) => Classes);
207
+ export type ColumnClasses<Item extends object> = Classes | ((content: any, key: string, item: Item) => Classes);
196
208
  /**
197
209
  * Projection that represents a row of cells with flags
198
210
  * linked to the state of the item
199
211
  */
200
- export type MappedItem = Option & {
212
+ export type MappedItem<T extends string> = Option & {
201
213
  accessibleLabel: string;
202
- cols: MappedCell[];
214
+ cols: MappedCell<T>[];
203
215
  onRowClick: (event: MouseEvent) => void;
204
216
  onRowContextMenu: (event: MouseEvent) => void;
205
217
  onRowDblClick: (event: MouseEvent) => void;
@@ -208,23 +220,24 @@ export type MappedItem = Option & {
208
220
  /**
209
221
  * Projection that represnets a header
210
222
  */
211
- export type MappedHeader = {
223
+ export type MappedHeader<DynamicHeaderSlots extends string> = {
212
224
  align: HTMLTableCellElement['align'];
213
225
  classes?: Classes[];
214
226
  key: string;
215
227
  label: string;
216
- slotName: string;
228
+ slotName: DynamicHeaderSlots;
229
+ sortDirection?: 'ascending' | 'descending';
217
230
  };
218
231
  /**
219
232
  * Projection that represents a cell of data.
220
233
  */
221
- export type MappedCell = {
234
+ export type MappedCell<DynamicBodySlots extends string> = {
222
235
  align: string;
223
236
  classes: Classes[];
224
237
  content: string;
225
238
  key: string;
226
239
  label: string;
227
- slotName: string;
240
+ slotName: DynamicBodySlots;
228
241
  };
229
242
  export type BbTableEvents = {
230
243
  (e: 'click:row', event: MouseEvent, item: any, selected: boolean): void;
@@ -232,10 +245,11 @@ export type BbTableEvents = {
232
245
  (e: 'dblclick:row', event: MouseEvent, item: any, selected: boolean): void;
233
246
  (e: 'update:modelValue', value: any): void;
234
247
  (e: 'update:selectAll', value: boolean): void;
248
+ (e: 'update:unselectedItems', value: any[]): void;
235
249
  (e: 'item:selected', value: any): void;
236
250
  (e: 'item:unselected', value: any): void;
237
251
  };
238
- export type BbTableSlots = {
252
+ export type BbTableSlots<DynamicBodySlots extends string, DynamicHeaderSlots extends string, Item extends object> = {
239
253
  thead?: (props: object) => any;
240
254
  tbody?: (props: object) => any;
241
255
  tfoot?: (props: object) => any;
@@ -248,15 +262,15 @@ export type BbTableSlots = {
248
262
  text: string;
249
263
  }) => any;
250
264
  loading?: (props: {
251
- items: any[];
265
+ items: Item[];
252
266
  }) => any;
253
267
  'no-data'?: (props: object) => any;
254
268
  actions?: (props: {
255
- item: any;
269
+ item: Item;
256
270
  value: any;
257
271
  }) => any;
258
272
  select?: (props: {
259
- item: any;
273
+ item: Item;
260
274
  value: any;
261
275
  checked: boolean;
262
276
  disabled: boolean;
@@ -264,12 +278,17 @@ export type BbTableSlots = {
264
278
  readonly: boolean;
265
279
  }) => any;
266
280
  } & {
267
- [key: string]: (props: {
281
+ [K in DynamicBodySlots]?: (props: {
268
282
  classes?: Classes[];
269
283
  content?: any;
270
- items?: any[];
271
- item: any;
272
- label?: string;
284
+ item: Item;
273
285
  value?: any;
274
286
  }) => any;
287
+ } & {
288
+ [K in DynamicHeaderSlots]?: (props: {
289
+ classes?: Classes[];
290
+ content?: any;
291
+ items?: Item[];
292
+ label?: string;
293
+ }) => any;
275
294
  };