forked from bootstrap-vue-next/bootstrap-vue-next
/
formCheckbox.data.ts
352 lines (351 loc) · 11.3 KB
/
formCheckbox.data.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
import type {ComponentReference} from './ComponentReference'
export default {
load: (): ComponentReference[] => [
{
component: 'BFormCheckbox',
props: [
{
prop: 'ariaLabel',
type: 'string',
default: undefined,
description: 'Sets the value of `aria-label` attribute on the rendered element',
},
{
prop: 'ariaLabelledBy',
type: 'string',
default: undefined,
description:
'The ID of the element that provides a label for this component. Used as the value for the `aria-labelledby` attribute',
},
{
prop: 'autofocus',
type: 'boolean',
default: false,
description:
'When set to `true`, attempts to auto-focus the control when it is mounted, or re-activated when in a keep-alive. Does not set the `autofocus` attribute on the control',
},
{
prop: 'button',
type: 'boolean',
default: false,
description: 'When set, renders the checkbox with the appearance of a button',
},
{
prop: 'buttonGroup',
type: 'boolean',
default: false,
description: '',
},
{
prop: 'buttonVariant',
type: 'ButtonVariant | null',
default: null,
description: "Applies one of Bootstrap's theme colors when in `button` mode",
},
{
prop: 'disabled',
type: 'boolean',
default: false,
description:
"When set to `true`, disables the component's functionality and places it in a disabled state",
},
{
prop: 'form',
type: 'string',
default: undefined,
description:
'ID of the form that the form control belongs to. Sets the `form` attribute on the control',
},
{
prop: 'id',
type: 'string',
default: undefined,
description:
'Used to set the `id` attribute on the rendered content, and used as the base to generate any additional element IDs as needed',
},
{
prop: 'indeterminate',
type: 'boolean',
default: false,
description:
'Set to true to show the checkbox as indeterminate, false to show its normal checked/unchecked.',
},
{
prop: 'inline',
type: 'boolean',
default: false,
description:
'When set, renders the checkbox as an inline element rather than as a 100% width block',
},
{
prop: 'modelValue',
type: 'CheckboxValue | readonly CheckboxValue[]',
default: undefined,
description:
'The current value of the checkbox(es). Must be an array when there are multiple checkboxes bound to the same v-model',
},
{
prop: 'name',
type: 'string',
default: undefined,
description: 'Sets the value of the `name` attribute on the form control',
},
{
prop: 'plain',
type: 'boolean',
default: false,
description: 'Render the form control in plain mode, rather than custom styled mode',
},
{
prop: 'required',
type: 'boolean',
default: undefined,
description: 'Adds the `required` attribute to the form control',
},
{
prop: 'size',
type: 'Size',
default: undefined,
description: "Set the size of the component's appearance. 'sm', 'md' (default), or 'lg'",
},
{
prop: 'state',
type: 'boolean | null',
default: undefined,
description:
'Controls the validation state appearance of the component. `true` for valid, `false` for invalid, or `null` for no validation state',
},
{
prop: 'reverse',
type: 'boolean',
default: false,
description: 'When set, renders the checkbox or switch on the opposite side',
},
{
prop: 'switch',
type: 'boolean',
default: false,
description: 'When set, renders the checkbox with the appearance of a switch',
},
{
prop: 'uncheckedValue',
type: 'CheckboxValue',
default: false,
description:
'Value returned when this checkbox is unchecked. Note not applicable when multiple checkboxes bound to the same v-model array',
},
{
prop: 'value',
type: 'CheckboxValue',
default: true,
description: 'Value returned when this checkbox is checked',
},
],
emits: [
{
event: 'update:modelValue',
description: 'Emitted when the checked value is changed',
args: [
{
arg: 'checked',
description:
'Value of the checkbox. Value will be an array for grouped checkboxes or a single value for standalone checkboxes.',
type: 'CheckboxValue | readonly CheckboxValue[]',
},
],
},
{
event: 'update:indeterminate',
description: 'Emitted when the indeterminaate state of the checkbox is changed',
args: [
{
arg: 'checked',
description:
'Value of the indeterminate state - true for indeterminate, false for determinstic state.',
type: 'boolean',
},
],
},
],
slots: [
{
name: 'default',
description: 'Content to place in the label of the form checkbox',
},
],
},
{
component: 'BFormCheckboxGroup',
props: [
{
prop: 'ariaInvalid',
type: 'AriaInvalid',
default: undefined,
description:
'Sets the `aria-invalid` attribute value on the wrapper element. When not provided, the `state` prop will control the attribute',
},
{
prop: 'autofocus',
type: 'boolean',
default: false,
description:
'When set to `true`, attempts to auto-focus the control when it is mounted, or re-activated when in a keep-alive. Does not set the `autofocus` attribute on the control',
},
{
prop: 'buttonVariant',
type: 'ButtonVariant | null',
default: 'secondary',
description:
'Specifies the Bootstrap contextual color theme variant the apply to the button style checkboxes',
},
{
prop: 'buttons',
type: 'boolean',
default: false,
description: 'When set, renderes the checkboxes in this group with button styling',
},
{
prop: 'disabled',
type: 'boolean',
default: false,
description:
"When set to `true`, disables the component's functionality and places it in a disabled state",
},
{
prop: 'disabledField',
type: 'string',
default: 'disabled',
description:
'Field name in the `options` array that should be used for the disabled state',
},
{
prop: 'form',
type: 'string',
default: undefined,
description:
'ID of the form that the form control belongs to. Sets the `form` attribute on the control',
},
{
prop: 'htmlField',
type: 'string',
default: 'html',
description:
'Field name in the `options` array that should be used for the html label instead of text field',
},
{
prop: 'id',
type: 'string',
default: undefined,
description:
'Used to set the `id` attribute on the rendered content, and used as the base to generate any additional element IDs as needed',
},
{
prop: 'modelValue',
type: 'readonly CheckboxValue[]',
default: '() => []',
description:
'The current value of the checked checkboxes in the group. Must be an array when there are multiple checkboxes',
},
{
prop: 'name',
type: 'string',
default: undefined,
description: 'Sets the value of the `name` attribute on the form control',
},
{
prop: 'options',
type: 'readonly CheckboxOptionRaw[]',
default: '() => []',
description: 'Array of items to render in the component',
},
{
prop: 'plain',
type: 'boolean',
default: false,
description: 'Render the form control in plain mode, rather than custom styled mode',
},
{
prop: 'required',
type: 'boolean',
default: false,
description: 'Adds the `required` attribute to the form control',
},
{
prop: 'reverse',
type: 'boolean',
default: false,
description: 'When set, renders the checkboxes and switches on the opposite side',
},
{
prop: 'size',
type: 'Size',
default: 'md',
description: "Set the size of the component's appearance. 'sm', 'md' (default), or 'lg'",
},
{
prop: 'stacked',
type: 'boolean',
default: false,
description: 'When set, renders the checkbox group in stacked mode',
},
{
prop: 'state',
type: 'boolean | null',
default: null,
description:
'Controls the validation state appearance of the component. `true` for valid, `false` for invalid, or `null` for no validation state',
},
{
prop: 'switches',
type: 'boolean',
default: false,
description: 'When set, renders the checkboxes in the group with switch styling',
},
{
prop: 'textField',
type: 'string',
default: 'text',
description: 'Field name in the `options` array that should be used for the text label',
},
{
prop: 'validated',
type: 'boolean',
default: false,
description: 'When set, adds the Bootstrap class `was-validated` to the group wrapper',
},
{
prop: 'valueField',
type: 'string',
default: 'value',
description: 'Field name in the `options` array that should be used for the value',
},
],
emits: [
{
event: 'update:modelValue',
description: 'Emitted when the selected value(s) are changed',
args: [
{
arg: 'update:modelValue',
type: 'CheckboxValue[]',
description: 'Value of the checkboxes. Value will be an array.',
},
],
},
],
slots: [
{
name: 'default',
description: 'Content (form checkboxes) to place in the form checkbox group',
scope: [],
},
{
name: 'first',
description:
'Slot to place for checkboxes so that they appear before checks generated from options prop',
scope: [],
},
],
},
],
}