bitboss-ui 2.0.102 → 2.0.103
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.
- package/dist/components/BaseSelect/BaseSelect.vue.d.ts +10 -16
- package/dist/components/BaseSwitchGroup/BaseSwitchGroup.vue.d.ts +109 -7
- package/dist/components/BbSelect/BbSelect.vue.d.ts +2 -16
- package/dist/composables/useBaseOptions.d.ts +31 -0
- package/dist/composables/useCoherence.d.ts +20 -0
- package/dist/composables/useHashedWatcher.d.ts +2 -0
- package/dist/composables/useIndexById.d.ts +11 -0
- package/dist/composables/useItemsGetter.d.ts +12 -0
- package/dist/composables/usePrefill.d.ts +12 -0
- package/dist/index100.js +88 -60
- package/dist/index101.js +10 -13
- package/dist/index111.js +154 -126
- package/dist/index119.js +2 -2
- package/dist/index121.js +5 -5
- package/dist/index123.js +1 -1
- package/dist/index127.js +1 -1
- package/dist/index128.js +1 -1
- package/dist/index129.js +1 -1
- package/dist/index13.js +2 -2
- package/dist/index131.js +1 -1
- package/dist/index132.js +69 -65
- package/dist/index15.js +4 -4
- package/dist/index17.js +3 -3
- package/dist/index19.js +126 -82
- package/dist/index205.js +52 -80
- package/dist/index207.js +13 -5
- package/dist/index208.js +19 -15
- package/dist/index209.js +4 -16
- package/dist/index21.js +14 -14
- package/dist/index210.js +124 -17
- package/dist/index211.js +5 -19
- package/dist/index212.js +121 -23
- package/dist/index213.js +19 -3
- package/dist/index214.js +16 -2
- package/dist/index215.js +16 -8
- package/dist/index216.js +2 -250
- package/dist/index217.js +2 -52
- package/dist/index218.js +41 -44
- package/dist/index219.js +6 -5
- package/dist/index220.js +5 -60
- package/dist/index221.js +10 -51
- package/dist/index222.js +371 -0
- package/dist/index223.js +2 -13
- package/dist/index224.js +4 -2
- package/dist/index225.js +2 -4
- package/dist/index226.js +3 -2
- package/dist/index227.js +7 -20
- package/dist/index228.js +8 -4
- package/dist/index229.js +3 -3
- package/dist/index23.js +16 -16
- package/dist/index230.js +84 -168
- package/dist/index232.js +10 -0
- package/dist/index233.js +25 -8
- package/dist/index234.js +14 -123
- package/dist/index235.js +47 -124
- package/dist/index236.js +15 -2
- package/dist/index237.js +11 -40
- package/dist/index238.js +16 -6
- package/dist/index239.js +19 -5
- package/dist/index240.js +27 -12
- package/dist/index241.js +247 -366
- package/dist/index242.js +52 -3
- package/dist/index243.js +44 -7
- package/dist/index244.js +5 -2
- package/dist/index245.js +59 -17
- package/dist/index246.js +2 -106
- package/dist/index247.js +117 -0
- package/dist/index248.js +3 -100
- package/dist/index249.js +4 -0
- package/dist/index25.js +6 -6
- package/dist/index250.js +18 -2
- package/dist/index251.js +106 -2
- package/dist/index253.js +100 -3
- package/dist/index255.js +12 -23
- package/dist/index256.js +2 -89
- package/dist/index257.js +4 -0
- package/dist/index258.js +10 -9
- package/dist/index259.js +3 -6
- package/dist/index260.js +6 -16
- package/dist/index261.js +15 -8
- package/dist/index262.js +9 -8
- package/dist/index263.js +23 -281
- package/dist/index264.js +89 -6
- package/dist/index266.js +3 -2
- package/dist/index268.js +7 -2
- package/dist/index269.js +176 -2
- package/dist/index27.js +1 -1
- package/dist/index270.js +281 -2
- package/dist/index271.js +6 -2
- package/dist/index272.js +2 -2
- package/dist/index273.js +2 -2
- package/dist/index274.js +2 -2
- package/dist/index275.js +2 -28
- package/dist/index276.js +2 -22
- package/dist/index277.js +128 -0
- package/dist/index278.js +429 -5
- package/dist/index279.js +22 -3
- package/dist/index281.js +2 -4
- package/dist/index282.js +4 -224
- package/dist/index283.js +23 -171
- package/dist/index284.js +200 -3
- package/dist/index285.js +435 -11
- package/dist/index286.js +125 -7
- package/dist/index287.js +87 -15
- package/dist/index288.js +8 -3
- package/dist/index289.js +3 -7
- package/dist/index29.js +3 -3
- package/dist/index290.js +7 -11
- package/dist/index291.js +11 -2
- package/dist/index292.js +15 -124
- package/dist/index293.js +9 -431
- package/dist/index294.js +7 -21
- package/dist/index296.js +2 -2
- package/dist/index297.js +2 -89
- package/dist/index298.js +2 -200
- package/dist/index299.js +2 -436
- package/dist/index300.js +2 -127
- package/dist/index301.js +22 -2
- package/dist/index303.js +224 -3
- package/dist/index304.js +3 -213
- package/dist/index305.js +2 -65
- package/dist/index306.js +213 -5
- package/dist/index307.js +2 -3
- package/dist/index308.js +5 -3
- package/dist/index309.js +66 -3
- package/dist/index31.js +2 -2
- package/dist/index310.js +3 -58
- package/dist/index311.js +3 -33
- package/dist/index312.js +57 -7
- package/dist/index313.js +32 -7
- package/dist/index314.js +1 -1
- package/dist/index315.js +1 -1
- package/dist/index316.js +3 -7
- package/dist/index317.js +3 -18
- package/dist/index318.js +8 -7
- package/dist/index319.js +8 -4
- package/dist/index320.js +7 -2
- package/dist/index321.js +17 -45
- package/dist/index322.js +7 -480
- package/dist/index323.js +49 -0
- package/dist/index324.js +2 -424
- package/dist/index326.js +480 -2
- package/dist/index327.js +426 -0
- package/dist/index329.js +4 -0
- package/dist/index33.js +102 -61
- package/dist/index35.js +3 -3
- package/dist/index37.js +284 -244
- package/dist/index39.js +5 -5
- package/dist/index41.js +2 -2
- package/dist/index43.js +129 -84
- package/dist/index45.js +122 -120
- package/dist/index47.js +2 -2
- package/dist/index49.js +2 -2
- package/dist/index55.js +1 -1
- package/dist/index57.js +2 -2
- package/dist/index61.js +2 -2
- package/dist/index75.js +3 -3
- package/dist/index79.js +2 -2
- package/dist/index81.js +1 -1
- package/dist/index84.js +3 -3
- package/dist/index86.js +1 -1
- package/dist/index88.js +4 -4
- package/dist/index90.js +1 -1
- package/package.json +1 -1
- package/dist/composables/useOptions.d.ts +0 -43
- package/dist/index206.js +0 -4
- package/dist/index231.js +0 -86
- package/dist/index252.js +0 -12
- package/dist/index254.js +0 -11
- package/dist/index265.js +0 -4
- package/dist/index302.js +0 -5
- /package/dist/{index267.js → index295.js} +0 -0
- /package/dist/{index325.js → index328.js} +0 -0
@@ -1,13 +1,6 @@
|
|
1
1
|
import { nextTick, HTMLAttributes, InputHTMLAttributes } from 'vue';
|
2
2
|
import { Option as BaseOption } from '../../types/Option';
|
3
3
|
export type BaseSelectProps = {
|
4
|
-
/**
|
5
|
-
* Allows the user to add options to the list by
|
6
|
-
* inserting text in the input and pressing ENTER.
|
7
|
-
* The value and text of the option generated is a
|
8
|
-
* string equal to what has been inserted.
|
9
|
-
*/
|
10
|
-
addOptions?: boolean;
|
11
4
|
/**
|
12
5
|
* Allows typing into the input.
|
13
6
|
*/
|
@@ -151,14 +144,6 @@ export type BaseSelectProps = {
|
|
151
144
|
* Sets the input as required.
|
152
145
|
*/
|
153
146
|
required?: boolean;
|
154
|
-
/**
|
155
|
-
* If `true` when in multiple selection, reset the query immediately
|
156
|
-
* upon selecting an option. By default the query is
|
157
|
-
* not reset until focus is lost so the user can search
|
158
|
-
* for "Cath" and select "Cathy" and then write more to
|
159
|
-
* search for "Catherine"
|
160
|
-
*/
|
161
|
-
resetQueryOnOptionSelected?: boolean;
|
162
147
|
/**
|
163
148
|
* Adds a stash to accumulate selected values. Especially
|
164
149
|
* useful when searching in a big database of items.
|
@@ -183,6 +168,7 @@ export type BaseSelectEvents = {
|
|
183
168
|
(e: 'inactive'): void;
|
184
169
|
(e: 'input', event: Event): void;
|
185
170
|
(e: 'update:modelValue', value: any): void;
|
171
|
+
(e: 'option:add', text: string): void;
|
186
172
|
};
|
187
173
|
export type BaseSelectSlots = {
|
188
174
|
append?: (props: {
|
@@ -223,6 +209,12 @@ export type BaseSelectSlots = {
|
|
223
209
|
text: string;
|
224
210
|
value: any;
|
225
211
|
}) => any;
|
212
|
+
'option:append'?: (props: {
|
213
|
+
item: any;
|
214
|
+
}) => any;
|
215
|
+
'option:prepend'?: (props: {
|
216
|
+
item: any;
|
217
|
+
}) => any;
|
226
218
|
'options:append'?: (props: object) => any;
|
227
219
|
'options:prepend'?: (props: object) => any;
|
228
220
|
prefix?: (props: object) => any;
|
@@ -552,6 +544,7 @@ declare const __VLS_component: import('vue').DefineComponent<BaseSelectProps, {}
|
|
552
544
|
click: (event: MouseEvent) => any;
|
553
545
|
focus: (event: FocusEvent) => any;
|
554
546
|
inactive: () => any;
|
547
|
+
"option:add": (text: string) => any;
|
555
548
|
}, string, import('vue').PublicProps, Readonly<BaseSelectProps> & Readonly<{
|
556
549
|
onInput?: ((event: Event) => any) | undefined;
|
557
550
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
@@ -560,6 +553,7 @@ declare const __VLS_component: import('vue').DefineComponent<BaseSelectProps, {}
|
|
560
553
|
onClick?: ((event: MouseEvent) => any) | undefined;
|
561
554
|
onFocus?: ((event: FocusEvent) => any) | undefined;
|
562
555
|
onInactive?: (() => any) | undefined;
|
556
|
+
"onOption:add"?: ((text: string) => any) | undefined;
|
563
557
|
}>, {
|
564
558
|
autocomplete: string;
|
565
559
|
transitionDuration: number;
|
@@ -569,8 +563,8 @@ declare const __VLS_component: import('vue').DefineComponent<BaseSelectProps, {}
|
|
569
563
|
loadingText: string;
|
570
564
|
modelValueDebounceTime: number;
|
571
565
|
noDataText: string;
|
572
|
-
prefill: boolean | "focus";
|
573
566
|
max: number;
|
567
|
+
prefill: boolean | "focus";
|
574
568
|
filterBy: string | string[] | false | ((value: any, item: any) => boolean) | null;
|
575
569
|
maxSelectedLabels: number;
|
576
570
|
queryDebounceTime: number;
|
@@ -1,11 +1,113 @@
|
|
1
|
+
import { HTMLAttributes, InputHTMLAttributes, MaybeRefOrGetter } from 'vue';
|
2
|
+
import { NestedKeyOf } from '../../types/NestedKeyOf';
|
1
3
|
import { SlotAttributes } from '../BaseCheckbox/BaseCheckbox.vue';
|
2
|
-
|
3
|
-
|
4
|
-
|
4
|
+
export type BaseSwitchGroupProps<T> = {
|
5
|
+
/**
|
6
|
+
* Guides to the browser as to the type of information expected in the field.
|
7
|
+
*/
|
8
|
+
ariaDescribedby?: InputHTMLAttributes['aria-describedby'];
|
9
|
+
/**
|
10
|
+
* Sets autofocus on page load.
|
11
|
+
*/
|
12
|
+
autofocus?: InputHTMLAttributes['autofocus'];
|
13
|
+
/**
|
14
|
+
* Define a color for the component.
|
15
|
+
*
|
16
|
+
* Either a custom color or a coded color in common HEX, RGB, etc... format.
|
17
|
+
*/
|
18
|
+
color?: string;
|
19
|
+
/**
|
20
|
+
* Defines an array of dependencies that will trigger actions in the component upon change.
|
21
|
+
*/
|
22
|
+
dependencies?: any[];
|
23
|
+
/**
|
24
|
+
* Timeout used to debounce response to changes to dependencies.
|
25
|
+
*/
|
26
|
+
depsDebounceTime?: number;
|
27
|
+
/**
|
28
|
+
* Direction of the layout of the inputs inside the fieldset. It can be either `horizontal` or `vertical`
|
29
|
+
*/
|
30
|
+
direction?: 'horizontal' | 'vertical';
|
31
|
+
/**
|
32
|
+
* Disables the component
|
33
|
+
*/
|
34
|
+
disabled?: boolean;
|
35
|
+
/**
|
36
|
+
* If coherence is enforce the input cannot have a modelValue the is incoherent with its current items.
|
37
|
+
*
|
38
|
+
* e.g. You cannot set v-model to a user that is not present in the items passed.
|
39
|
+
*
|
40
|
+
* modelValue will be reset upon incoherence.
|
41
|
+
*/
|
42
|
+
enforceCoherence?: boolean;
|
43
|
+
/**
|
44
|
+
* Define if the component should be in an error state.
|
45
|
+
* It usually attaches a CSS class for styling purposes.
|
46
|
+
*/
|
47
|
+
hasErrors?: boolean;
|
48
|
+
/**
|
49
|
+
* Visually hides the label of the input while maintaining accessibility.
|
50
|
+
*/
|
51
|
+
hideLabel?: boolean;
|
52
|
+
/**
|
53
|
+
* The identifier of the component.
|
54
|
+
*/
|
55
|
+
id?: HTMLAttributes['id'];
|
56
|
+
/**
|
57
|
+
* Used to retrieve items can be an array or a function.
|
58
|
+
*/
|
59
|
+
items: T[] | ((prefill: boolean, modelValue?: any[]) => Promise<T[]>) | ((prefill: boolean, modelValue?: any[]) => T[]);
|
60
|
+
/**
|
61
|
+
* Defines a path that returns a property of the object to use as text or a function that returns a string
|
62
|
+
*/
|
63
|
+
itemText?: T extends object ? NestedKeyOf<T> | ((item: T) => string) : ((item: T) => string) | undefined;
|
64
|
+
/**
|
65
|
+
* Defines a path that returns a property of the object to use as value or a function that returns any value
|
66
|
+
*/
|
67
|
+
itemValue?: T extends object ? NestedKeyOf<T> | ((item: T) => string) : ((item: T) => any) | undefined;
|
68
|
+
/**
|
69
|
+
* String displayed while items are being loaded.
|
70
|
+
*/
|
71
|
+
loadingText?: string;
|
72
|
+
/**
|
73
|
+
* Maximum number of selected items.
|
74
|
+
*/
|
75
|
+
max?: number;
|
76
|
+
/**
|
77
|
+
* Used by v-model. Can be an array of any serializable type.
|
78
|
+
*/
|
79
|
+
modelValue: any[];
|
80
|
+
/**
|
81
|
+
* Timeout used to debounce response to changes to modelValue.
|
82
|
+
*/
|
83
|
+
modelValueDebounceTime?: number;
|
84
|
+
/**
|
85
|
+
* Defines the name of the input.
|
86
|
+
*/
|
87
|
+
name?: InputHTMLAttributes['name'];
|
88
|
+
/**
|
89
|
+
* String displayed when there are no items to display.
|
90
|
+
*/
|
91
|
+
noDataText?: MaybeRefOrGetter<string>;
|
92
|
+
/**
|
93
|
+
* Sets the input in a readonly state.
|
94
|
+
*/
|
95
|
+
readonly?: boolean;
|
96
|
+
};
|
97
|
+
export type BaseSwitchGroupEvents = {
|
98
|
+
(e: 'blur', event: FocusEvent): void;
|
99
|
+
(e: 'change', event: Event): void;
|
100
|
+
(e: 'click', event: MouseEvent): void;
|
101
|
+
(e: 'focus', event: FocusEvent): void;
|
102
|
+
(e: 'inactive'): void;
|
103
|
+
(e: 'input', event: Event): void;
|
104
|
+
(e: 'keydown', event: KeyboardEvent): void;
|
105
|
+
(e: 'mousedown', event: MouseEvent): void;
|
106
|
+
(e: 'mouseup', event: MouseEvent): void;
|
107
|
+
(e: 'update:modelValue', value: any): void;
|
108
|
+
};
|
5
109
|
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<{
|
6
|
-
props: __VLS_PrettifyLocal<
|
7
|
-
readonly [x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
|
8
|
-
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, `on${Capitalize<any>}`> & BaseSwitchGroupProps<T>> & import('vue').PublicProps;
|
110
|
+
props: __VLS_PrettifyLocal<any & BaseSwitchGroupProps<T>> & import('vue').PublicProps;
|
9
111
|
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
10
112
|
attrs: any;
|
11
113
|
slots: Readonly<{
|
@@ -65,7 +167,7 @@ declare const _default: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_
|
|
65
167
|
}) => any;
|
66
168
|
append?: (props: object) => any;
|
67
169
|
};
|
68
|
-
emit:
|
170
|
+
emit: BaseSwitchGroupEvents;
|
69
171
|
}>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
70
172
|
[key: string]: any;
|
71
173
|
}> & {
|
@@ -2,13 +2,6 @@ import { BaseSelectEvents } from '../BaseSelect/BaseSelect.vue';
|
|
2
2
|
import { NestedKeyOf } from '../../types/NestedKeyOf';
|
3
3
|
import { HTMLAttributes, InputHTMLAttributes } from 'vue';
|
4
4
|
export type BbSelectProps<T> = {
|
5
|
-
/**
|
6
|
-
* Allows the user to add options to the list by
|
7
|
-
* inserting text in the input and pressing ENTER.
|
8
|
-
* The value and text of the option generated is a
|
9
|
-
* string equal to what has been inserted.
|
10
|
-
*/
|
11
|
-
addOptions?: boolean;
|
12
5
|
/**
|
13
6
|
* Allows typing into the input.
|
14
7
|
*/
|
@@ -176,14 +169,6 @@ export type BbSelectProps<T> = {
|
|
176
169
|
* Sets the input in a readonly state.
|
177
170
|
*/
|
178
171
|
readonly?: boolean;
|
179
|
-
/**
|
180
|
-
* If `true` when in multiple selection, reset the query immediately
|
181
|
-
* upon selecting an option. By default the query is
|
182
|
-
* not reset until focus is lost so the user can search
|
183
|
-
* for "Cath" and select "Cathy" and then write more to
|
184
|
-
* search for "Catherine"
|
185
|
-
*/
|
186
|
-
resetQueryOnOptionSelected?: boolean;
|
187
172
|
/**
|
188
173
|
* Reverses the layout. Applicable in every direction the order of the label and the input is swapped.
|
189
174
|
*/
|
@@ -266,7 +251,8 @@ declare const _default: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_
|
|
266
251
|
readonly onClick?: ((event: MouseEvent) => any) | undefined;
|
267
252
|
readonly onFocus?: ((event: FocusEvent) => any) | undefined;
|
268
253
|
readonly onInactive?: (() => any) | undefined;
|
269
|
-
|
254
|
+
readonly "onOption:add"?: ((text: string) => any) | undefined;
|
255
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onFocus" | "onBlur" | "onChange" | "onInput" | "onClick" | "onUpdate:modelValue" | "onInactive" | "onOption:add"> & BbSelectProps<T>> & import('vue').PublicProps;
|
270
256
|
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
271
257
|
attrs: any;
|
272
258
|
slots: Readonly<BbSelectSlots<T>> & BbSelectSlots<T>;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { MaybeRef } from 'vue';
|
2
|
+
import { IndexById } from './useIndexById';
|
3
|
+
type Options = {
|
4
|
+
disabled: MaybeRef<boolean>;
|
5
|
+
selectable: boolean | ((item: any) => boolean);
|
6
|
+
max: number | undefined;
|
7
|
+
items: MaybeRef<any[]>;
|
8
|
+
selectedIndexedByHash: IndexById['data'];
|
9
|
+
itemText: MaybeRef<string | ((item: any) => string) | undefined>;
|
10
|
+
itemValue: MaybeRef<string | ((item: any) => string) | undefined>;
|
11
|
+
};
|
12
|
+
type BaseOption2 = {
|
13
|
+
item: any;
|
14
|
+
text: string;
|
15
|
+
value: any;
|
16
|
+
valueHash: string;
|
17
|
+
selected: boolean;
|
18
|
+
disabled: boolean;
|
19
|
+
};
|
20
|
+
export declare const useBaseOptions: ({ items, disabled, selectable, itemText, itemValue, selectedIndexedByHash, max, }: Options) => {
|
21
|
+
options: import('vue').ComputedRef<BaseOption2[]>;
|
22
|
+
createOption: (item: any) => {
|
23
|
+
item: any;
|
24
|
+
text: string;
|
25
|
+
value: any;
|
26
|
+
valueHash: string;
|
27
|
+
selected: boolean;
|
28
|
+
disabled: boolean;
|
29
|
+
};
|
30
|
+
};
|
31
|
+
export {};
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { MaybeRef } from 'vue';
|
2
|
+
type Options = {
|
3
|
+
/**
|
4
|
+
* The model value to check for coherence
|
5
|
+
*/
|
6
|
+
modelValue: MaybeRef<any[]>;
|
7
|
+
/**
|
8
|
+
* An iteratee that returns a boolean indicating whether the value is coherent or not
|
9
|
+
*/
|
10
|
+
iteratee: (item: any) => boolean;
|
11
|
+
multiple: boolean;
|
12
|
+
};
|
13
|
+
export declare const useCoherence: ({ modelValue, iteratee, multiple }: Options) => {
|
14
|
+
status: import('vue').ComputedRef<{
|
15
|
+
coherent: any[];
|
16
|
+
incoherent: any[];
|
17
|
+
}>;
|
18
|
+
coherent: import('vue').ComputedRef<boolean>;
|
19
|
+
};
|
20
|
+
export {};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { MaybeRef } from 'vue';
|
2
|
+
type Options = {
|
3
|
+
items: MaybeRef<any[]>;
|
4
|
+
key?: string;
|
5
|
+
};
|
6
|
+
export type IndexById = ReturnType<typeof useIndexById>;
|
7
|
+
export declare const useIndexById: ({ items, key }: Options) => {
|
8
|
+
data: import('vue').ComputedRef<Record<string, any>>;
|
9
|
+
get: (value: any) => any;
|
10
|
+
};
|
11
|
+
export {};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { MaybeRef } from 'vue';
|
2
|
+
type Options = {
|
3
|
+
items: MaybeRef<unknown>;
|
4
|
+
debounce?: number;
|
5
|
+
};
|
6
|
+
export declare const useItemsGetter: (options: Options) => {
|
7
|
+
getter: (...args: any[]) => Promise<void>;
|
8
|
+
debouncedGetter: import('@vueuse/shared').PromisifyFn<(...args: any[]) => Promise<void>>;
|
9
|
+
items: import('vue').Ref<any[], any[]>;
|
10
|
+
loading: import('vue').ComputedRef<boolean>;
|
11
|
+
};
|
12
|
+
export {};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
type Options = {
|
2
|
+
fn: (...args: any[]) => any;
|
3
|
+
onStart?: boolean;
|
4
|
+
multiple?: boolean;
|
5
|
+
currentValue?: any;
|
6
|
+
};
|
7
|
+
export declare const usePrefill: ({ fn, onStart, multiple, currentValue, }: Options) => {
|
8
|
+
isPrefilling: import('vue').Ref<boolean, boolean>;
|
9
|
+
hasPrefilled: import('vue').Ref<boolean, boolean>;
|
10
|
+
prefill: () => Promise<void>;
|
11
|
+
};
|
12
|
+
export {};
|
package/dist/index100.js
CHANGED
@@ -1,12 +1,16 @@
|
|
1
|
-
import { defineComponent as
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
|
1
|
+
import { defineComponent as L, mergeModels as V, computed as b, toRef as m, reactive as P, useModel as I, watch as R, openBlock as B, createElementBlock as g, Fragment as k, renderSlot as r, unref as j, createCommentVNode as E, renderList as G } from "vue";
|
2
|
+
import { useItemValue as U } from "./index293.js";
|
3
|
+
import { isNil as x } from "./index257.js";
|
4
|
+
import { indexBy as W } from "./index294.js";
|
5
|
+
import { hash as H } from "./index229.js";
|
6
|
+
import { useItemsGetter as q } from "./index233.js";
|
7
|
+
import { usePrefill as z } from "./index238.js";
|
8
|
+
import { useIndexById as J } from "./index234.js";
|
9
|
+
import { useBaseOptions as K } from "./index235.js";
|
10
|
+
import { useHashedWatcher as Q } from "./index237.js";
|
11
|
+
const ne = /* @__PURE__ */ L({
|
8
12
|
__name: "BbRows",
|
9
|
-
props: /* @__PURE__ */
|
13
|
+
props: /* @__PURE__ */ V({
|
10
14
|
columns: { default: () => [] },
|
11
15
|
dependencies: { default: () => [] },
|
12
16
|
depsDebounceTime: { default: 0 },
|
@@ -26,72 +30,96 @@ const X = /* @__PURE__ */ S({
|
|
26
30
|
"select-all": { type: Boolean, default: !1 },
|
27
31
|
"select-allModifiers": {}
|
28
32
|
}),
|
29
|
-
emits: /* @__PURE__ */
|
30
|
-
setup(d, { emit:
|
31
|
-
const l = d,
|
32
|
-
|
33
|
+
emits: /* @__PURE__ */ V(["update:modelValue"], ["update:unselected-items", "update:select-all"]),
|
34
|
+
setup(d, { emit: w }) {
|
35
|
+
const l = d, u = w, { getItemValue: M } = U(), p = b(() => !!(l.loading || O.value)), {
|
36
|
+
getter: f,
|
37
|
+
items: v,
|
38
|
+
loading: O
|
39
|
+
} = q({
|
40
|
+
items: m(l, "items")
|
41
|
+
}), { hasPrefilled: S } = z({
|
42
|
+
onStart: !0,
|
43
|
+
currentValue: l.modelValue,
|
44
|
+
multiple: l.multiple,
|
45
|
+
fn: async ({ prefill: e }) => {
|
46
|
+
await f(e, l.modelValue);
|
47
|
+
}
|
48
|
+
}), { data: y } = J({
|
49
|
+
items: m(l, "modelValue")
|
50
|
+
}), { options: F } = K({
|
51
|
+
disabled: m(l, "disabled"),
|
52
|
+
items: v,
|
33
53
|
itemText: void 0,
|
34
54
|
itemValue: l.itemValue,
|
35
55
|
max: l.max,
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
56
|
+
selectable: !0,
|
57
|
+
selectedIndexedByHash: y
|
58
|
+
}), N = async (e) => {
|
59
|
+
l.multiple ? u("update:modelValue", l.modelValue.concat(e.value)) : u("update:modelValue", e.value);
|
60
|
+
}, T = async (e) => {
|
61
|
+
if (l.multiple) {
|
62
|
+
const t = { ...y.value };
|
63
|
+
delete t[e.valueHash], u("update:modelValue", Object.values(t));
|
64
|
+
} else
|
65
|
+
u("update:modelValue", null);
|
66
|
+
};
|
67
|
+
Q(
|
68
|
+
() => [l.dependencies, l.items],
|
69
|
+
async () => {
|
70
|
+
S.value && await f(!1, l.modelValue);
|
71
|
+
},
|
72
|
+
{
|
73
|
+
debounce: l.depsDebounceTime
|
74
|
+
}
|
75
|
+
);
|
76
|
+
const h = b(() => F.value.map((e) => {
|
77
|
+
let t = !l.selectable;
|
78
|
+
return typeof l.selectable == "function" && (t = !l.selectable(e.item)), t = t || !!e.disabled, {
|
79
|
+
columns: W(
|
80
|
+
l.columns.map((a) => {
|
81
|
+
const { label: C, key: D } = a;
|
82
|
+
let o = M(e.item, a.key);
|
83
|
+
return a.formatter && // By default the formatter runs anyway
|
84
|
+
(!x(o) || a.formatOnNull !== !1) && (o = a.formatter(o, a.key, e.item)), a.placeholder && x(o) && (o = a.placeholder), {
|
57
85
|
value: o,
|
58
|
-
key:
|
59
|
-
label:
|
86
|
+
key: D,
|
87
|
+
label: C
|
60
88
|
};
|
61
89
|
}),
|
62
|
-
(
|
90
|
+
(a) => a.key
|
63
91
|
),
|
64
92
|
item: e.item,
|
65
93
|
text: e.text,
|
66
94
|
valueHash: e.valueHash,
|
67
95
|
value: e.value,
|
68
|
-
selected: !!(e.selected ||
|
69
|
-
disabled:
|
96
|
+
selected: !!(e.selected || i.value),
|
97
|
+
disabled: t
|
70
98
|
};
|
71
|
-
})),
|
72
|
-
|
73
|
-
(
|
99
|
+
})), $ = (e) => {
|
100
|
+
i.value || N(e), c.delete(e.valueHash), n.value = n.value.filter(
|
101
|
+
(t) => H(t) !== H(e.item)
|
74
102
|
);
|
75
|
-
},
|
76
|
-
|
77
|
-
},
|
78
|
-
let
|
79
|
-
return
|
80
|
-
|
81
|
-
}), (e,
|
103
|
+
}, A = (e) => {
|
104
|
+
c.add(e.valueHash), n.value.push(e.item), T(e);
|
105
|
+
}, c = P(/* @__PURE__ */ new Set()), n = I(d, "unselected-items");
|
106
|
+
let i = I(d, "select-all");
|
107
|
+
return R(i, () => {
|
108
|
+
c.clear(), n.value = [], u("update:modelValue", []);
|
109
|
+
}), (e, t) => (B(), g(k, null, [
|
82
110
|
p.value ? r(e.$slots, "loading", {
|
83
111
|
key: 0,
|
84
|
-
items:
|
85
|
-
}) :
|
86
|
-
|
87
|
-
key:
|
88
|
-
checked:
|
89
|
-
columns:
|
90
|
-
disabled:
|
91
|
-
item:
|
92
|
-
select: () =>
|
93
|
-
unselect: () =>
|
94
|
-
value:
|
112
|
+
items: j(v)
|
113
|
+
}) : E("", !0),
|
114
|
+
h.value.length ? (B(!0), g(k, { key: 2 }, G(h.value, (s) => r(e.$slots, "default", {
|
115
|
+
key: s.valueHash,
|
116
|
+
checked: s.selected,
|
117
|
+
columns: s.columns,
|
118
|
+
disabled: s.disabled,
|
119
|
+
item: s.item,
|
120
|
+
select: () => $(s),
|
121
|
+
unselect: () => A(s),
|
122
|
+
value: s.value
|
95
123
|
})), 128)) : r(e.$slots, "no-data", {
|
96
124
|
key: 1,
|
97
125
|
loading: p.value
|
@@ -100,5 +128,5 @@ const X = /* @__PURE__ */ S({
|
|
100
128
|
}
|
101
129
|
});
|
102
130
|
export {
|
103
|
-
|
131
|
+
ne as default
|
104
132
|
};
|
package/dist/index101.js
CHANGED
@@ -1,12 +1,11 @@
|
|
1
|
-
import { defineComponent as h, ref as y, computed as
|
1
|
+
import { defineComponent as h, ref as y, computed as v, openBlock as B, createBlock as g, withCtx as n, renderSlot as a, normalizeProps as i, guardReactiveProps as l, createVNode as $, mergeProps as T } from "vue";
|
2
2
|
import V from "./index27.js";
|
3
3
|
/* empty css */
|
4
|
-
import
|
4
|
+
import w from "./index37.js";
|
5
5
|
/* empty css */
|
6
|
-
const
|
6
|
+
const P = /* @__PURE__ */ h({
|
7
7
|
__name: "BbSelect",
|
8
8
|
props: {
|
9
|
-
addOptions: { type: Boolean },
|
10
9
|
allowWriting: { type: [Boolean, String], default: !0 },
|
11
10
|
"append:icon": {},
|
12
11
|
autocomplete: {},
|
@@ -45,18 +44,18 @@ const L = /* @__PURE__ */ h({
|
|
45
44
|
required: { type: Boolean },
|
46
45
|
queryDebounceTime: {},
|
47
46
|
readonly: { type: Boolean },
|
48
|
-
resetQueryOnOptionSelected: { type: Boolean },
|
49
47
|
reverse: { type: Boolean },
|
50
48
|
stash: { type: Boolean },
|
51
49
|
transitionDuration: {},
|
52
50
|
updateOnAnimationFrame: { type: Boolean }
|
53
51
|
},
|
54
|
-
emits: ["blur", "change", "click", "focus", "inactive", "input", "update:modelValue"],
|
52
|
+
emits: ["blur", "change", "click", "focus", "inactive", "input", "update:modelValue", "option:add"],
|
55
53
|
setup(d, { emit: m }) {
|
56
|
-
const r = d, t = m, p = y(!1), u =
|
54
|
+
const r = d, t = m, p = y(!1), u = v(() => r.persistentHint || p.value), c = {
|
57
55
|
onBlur: (e) => t("blur", e),
|
58
56
|
onChange: (e) => t("change", e),
|
59
57
|
onClick: (e) => t("click", e),
|
58
|
+
"onOption:add": (e) => t("option:add", e),
|
60
59
|
onFocus: (e) => {
|
61
60
|
p.value = !0, t("focus", e);
|
62
61
|
},
|
@@ -66,7 +65,7 @@ const L = /* @__PURE__ */ h({
|
|
66
65
|
onInput: (e) => t("input", e),
|
67
66
|
"onUpdate:modelValue": (e) => t("update:modelValue", e)
|
68
67
|
};
|
69
|
-
return (e,
|
68
|
+
return (e, D) => (B(), g(V, {
|
70
69
|
id: e.id,
|
71
70
|
class: "bb-select",
|
72
71
|
compact: e.compact,
|
@@ -86,9 +85,8 @@ const L = /* @__PURE__ */ h({
|
|
86
85
|
a(e.$slots, "label", i(l(s)))
|
87
86
|
]),
|
88
87
|
input: n(({ id: s, hasErrors: b, ariaDescribedby: f }) => [
|
89
|
-
$(
|
88
|
+
$(w, T({
|
90
89
|
id: s,
|
91
|
-
"add-options": e.addOptions,
|
92
90
|
"allow-writing": e.allowWriting,
|
93
91
|
"append:icon": r["append:icon"],
|
94
92
|
"aria-describedby": f,
|
@@ -120,7 +118,6 @@ const L = /* @__PURE__ */ h({
|
|
120
118
|
"query-debounce-time": e.queryDebounceTime,
|
121
119
|
readonly: e.readonly,
|
122
120
|
required: e.required,
|
123
|
-
"reset-query-on-option-selected": e.resetQueryOnOptionSelected,
|
124
121
|
stash: e.stash,
|
125
122
|
"transition-duration": e.transitionDuration,
|
126
123
|
"update-on-animation-frame": e.updateOnAnimationFrame
|
@@ -171,12 +168,12 @@ const L = /* @__PURE__ */ h({
|
|
171
168
|
a(e.$slots, "spinner", i(l(o)))
|
172
169
|
]),
|
173
170
|
_: 2
|
174
|
-
}, 1040, ["id", "
|
171
|
+
}, 1040, ["id", "allow-writing", "append:icon", "aria-describedby", "autocomplete", "autofocus", "comma", "compact", "dependencies", "deps-debounce-time", "disabled", "enforce-coherence", "filter-by", "has-errors", "item-text", "item-value", "items", "loading", "loading-text", "max", "max-selected-labels", "model-value", "model-value-debounce-time", "multiple", "name", "no-data-text", "placeholder", "prefill", "prepend:icon", "query-debounce-time", "readonly", "required", "stash", "transition-duration", "update-on-animation-frame"])
|
175
172
|
]),
|
176
173
|
_: 3
|
177
174
|
}, 8, ["id", "compact", "direction", "errors", "has-errors", "hide-label", "hint", "label", "label-position", "model-value", "name", "reverse", "show-hint"]));
|
178
175
|
}
|
179
176
|
});
|
180
177
|
export {
|
181
|
-
|
178
|
+
P as default
|
182
179
|
};
|