@carbon/vue 3.0.12 → 3.0.13
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/carbon-vue-3.common.js +106 -47
- package/dist/carbon-vue-3.common.js.map +1 -1
- package/dist/carbon-vue-3.umd.js +106 -47
- package/dist/carbon-vue-3.umd.js.map +1 -1
- package/dist/carbon-vue-3.umd.min.js +2 -2
- package/dist/carbon-vue-3.umd.min.js.map +1 -1
- package/dist/web-types.json +40 -17
- package/package.json +2 -2
- package/src/components/CvAccordion/CvAccordion.stories.mdx +153 -0
- package/src/components/CvAccordion/CvAccordion.vue +18 -5
- package/src/components/CvAccordion/CvAccordionItem.vue +18 -6
- package/src/components/CvAccordion/consts.js +8 -9
- package/src/components/CvCheckbox/CvCheckbox.vue +6 -2
- package/src/components/CvDatePicker/CvDatePicker.stories.js +165 -14
- package/src/components/CvDatePicker/CvDatePicker.vue +24 -9
- package/src/components/CvRadioButton/CvRadioButton.stories.js +20 -1
- package/src/components/CvRadioButton/CvRadioButton.vue +7 -5
- package/src/components/CvRadioButton/CvRadioGroup.vue +18 -2
- package/src/components/CvRadioButton/__tests__/__snapshots__/CvRadioButton.spec.js.snap +6 -4
- package/src/components/CvAccordion/CvAccordion.stories.js +0 -55
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"framework": "vue",
|
|
3
3
|
"name": "@carbon/vue",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.12",
|
|
5
5
|
"contributions": {
|
|
6
6
|
"html": {
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -13,27 +13,27 @@
|
|
|
13
13
|
"attributes": [
|
|
14
14
|
{
|
|
15
15
|
"name": "align",
|
|
16
|
-
"description": "
|
|
16
|
+
"description": "Specify the alignment of the accordion heading title and chevron.",
|
|
17
17
|
"value": {
|
|
18
18
|
"kind": "expression",
|
|
19
19
|
"type": "string"
|
|
20
20
|
},
|
|
21
|
-
"default": "
|
|
21
|
+
"default": "''"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
"name": "size",
|
|
25
|
-
"description": "
|
|
25
|
+
"description": "Specify the size of the Accordion",
|
|
26
26
|
"value": {
|
|
27
27
|
"kind": "expression",
|
|
28
28
|
"type": "string"
|
|
29
29
|
},
|
|
30
|
-
"default": "
|
|
30
|
+
"default": "''"
|
|
31
31
|
}
|
|
32
32
|
],
|
|
33
33
|
"events": [
|
|
34
34
|
{
|
|
35
35
|
"name": "change",
|
|
36
|
-
"description": "Triggers when
|
|
36
|
+
"description": "Triggers when state of an accordion item changes"
|
|
37
37
|
}
|
|
38
38
|
],
|
|
39
39
|
"slots": [
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"attributes": [
|
|
53
53
|
{
|
|
54
54
|
"name": "disabled",
|
|
55
|
-
"description": "disables this
|
|
55
|
+
"description": "disables this accordion item",
|
|
56
56
|
"value": {
|
|
57
57
|
"kind": "expression",
|
|
58
58
|
"type": "boolean"
|
|
@@ -60,13 +60,18 @@
|
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
"name": "open",
|
|
63
|
-
"description": "
|
|
63
|
+
"description": "open state of the accordion item. available as a v-model",
|
|
64
64
|
"value": {
|
|
65
65
|
"kind": "expression",
|
|
66
66
|
"type": "boolean"
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
],
|
|
70
|
+
"events": [
|
|
71
|
+
{
|
|
72
|
+
"name": "update:open"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
70
75
|
"slots": [
|
|
71
76
|
{
|
|
72
77
|
"name": "title",
|
|
@@ -346,6 +351,7 @@
|
|
|
346
351
|
},
|
|
347
352
|
{
|
|
348
353
|
"name": "label",
|
|
354
|
+
"required": true,
|
|
349
355
|
"description": "Provide a label to provide a description of the Checkbox input that you are exposing to the user",
|
|
350
356
|
"value": {
|
|
351
357
|
"kind": "expression",
|
|
@@ -1381,6 +1387,7 @@
|
|
|
1381
1387
|
},
|
|
1382
1388
|
{
|
|
1383
1389
|
"name": "dateLabel",
|
|
1390
|
+
"description": "Date picker label",
|
|
1384
1391
|
"value": {
|
|
1385
1392
|
"kind": "expression",
|
|
1386
1393
|
"type": "string"
|
|
@@ -1389,22 +1396,16 @@
|
|
|
1389
1396
|
},
|
|
1390
1397
|
{
|
|
1391
1398
|
"name": "dateEndLabel",
|
|
1399
|
+
"description": "Date picker end label (when using kind=\"range\")",
|
|
1392
1400
|
"value": {
|
|
1393
1401
|
"kind": "expression",
|
|
1394
1402
|
"type": "string"
|
|
1395
1403
|
},
|
|
1396
1404
|
"default": "'End date'"
|
|
1397
1405
|
},
|
|
1398
|
-
{
|
|
1399
|
-
"name": "invalid",
|
|
1400
|
-
"value": {
|
|
1401
|
-
"kind": "expression",
|
|
1402
|
-
"type": "boolean"
|
|
1403
|
-
},
|
|
1404
|
-
"default": "false"
|
|
1405
|
-
},
|
|
1406
1406
|
{
|
|
1407
1407
|
"name": "disabled",
|
|
1408
|
+
"description": "If true, the date picker will be disabled",
|
|
1408
1409
|
"value": {
|
|
1409
1410
|
"kind": "expression",
|
|
1410
1411
|
"type": "boolean"
|
|
@@ -1413,6 +1414,7 @@
|
|
|
1413
1414
|
},
|
|
1414
1415
|
{
|
|
1415
1416
|
"name": "invalidMessage",
|
|
1417
|
+
"description": "Date picker text on invalid value",
|
|
1416
1418
|
"value": {
|
|
1417
1419
|
"kind": "expression",
|
|
1418
1420
|
"type": "string"
|
|
@@ -1421,6 +1423,7 @@
|
|
|
1421
1423
|
},
|
|
1422
1424
|
{
|
|
1423
1425
|
"name": "pattern",
|
|
1426
|
+
"description": "Regex pattern used for form validation, default \\d{1,2}/\\d{1,2}/\\d{4}",
|
|
1424
1427
|
"value": {
|
|
1425
1428
|
"kind": "expression",
|
|
1426
1429
|
"type": "string"
|
|
@@ -1429,6 +1432,7 @@
|
|
|
1429
1432
|
},
|
|
1430
1433
|
{
|
|
1431
1434
|
"name": "placeholder",
|
|
1435
|
+
"description": "Date picker input placeholder, shown when date picker is empty. Default 'mm/dd/yyyy'",
|
|
1432
1436
|
"value": {
|
|
1433
1437
|
"kind": "expression",
|
|
1434
1438
|
"type": "string"
|
|
@@ -1437,6 +1441,7 @@
|
|
|
1437
1441
|
},
|
|
1438
1442
|
{
|
|
1439
1443
|
"name": "calOptions",
|
|
1444
|
+
"description": "You can pass flatpickr options through this prop.\n See https://flatpickr.js.org/options/ for more details.\n Some of the options is not supported (for example, onChange, onReady, mode, nextArrow, prevArrow).\n Also, you have to pass dateFormat field in calOptions object if you use it.",
|
|
1440
1445
|
"value": {
|
|
1441
1446
|
"kind": "expression",
|
|
1442
1447
|
"type": "object"
|
|
@@ -1453,6 +1458,7 @@
|
|
|
1453
1458
|
},
|
|
1454
1459
|
{
|
|
1455
1460
|
"name": "kind",
|
|
1461
|
+
"description": "Date picker kind (also known as mode in flatpickr options).\n Possible values: 'short', 'simple', 'single', 'range'",
|
|
1456
1462
|
"value": {
|
|
1457
1463
|
"kind": "expression",
|
|
1458
1464
|
"type": "string"
|
|
@@ -3598,11 +3604,12 @@
|
|
|
3598
3604
|
},
|
|
3599
3605
|
{
|
|
3600
3606
|
"name": "label",
|
|
3607
|
+
"required": true,
|
|
3601
3608
|
"value": {
|
|
3602
3609
|
"kind": "expression",
|
|
3603
3610
|
"type": "string"
|
|
3604
3611
|
},
|
|
3605
|
-
"default": "
|
|
3612
|
+
"default": "null"
|
|
3606
3613
|
},
|
|
3607
3614
|
{
|
|
3608
3615
|
"name": "value",
|
|
@@ -3650,6 +3657,22 @@
|
|
|
3650
3657
|
"kind": "expression",
|
|
3651
3658
|
"type": "boolean"
|
|
3652
3659
|
}
|
|
3660
|
+
},
|
|
3661
|
+
{
|
|
3662
|
+
"name": "legendText",
|
|
3663
|
+
"required": true,
|
|
3664
|
+
"value": {
|
|
3665
|
+
"kind": "expression",
|
|
3666
|
+
"type": "string"
|
|
3667
|
+
},
|
|
3668
|
+
"default": "null"
|
|
3669
|
+
},
|
|
3670
|
+
{
|
|
3671
|
+
"name": "hideLegend",
|
|
3672
|
+
"value": {
|
|
3673
|
+
"kind": "expression",
|
|
3674
|
+
"type": "boolean"
|
|
3675
|
+
}
|
|
3653
3676
|
}
|
|
3654
3677
|
],
|
|
3655
3678
|
"events": [
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/vue",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.13",
|
|
5
5
|
"description": "A collection of components for the Carbon Design System built using Vue.js",
|
|
6
6
|
"packageManager": "yarn@3.2.0",
|
|
7
7
|
"main": "dist/carbon-vue-3.umd.min.js",
|
|
@@ -174,5 +174,5 @@
|
|
|
174
174
|
"url": "git+https://github.com/carbon-design-system/carbon-components-vue.git"
|
|
175
175
|
},
|
|
176
176
|
"sideEffects": true,
|
|
177
|
-
"gitHead": "
|
|
177
|
+
"gitHead": "44c7e6ba63dee51b7f6426b46283b40deaed413c"
|
|
178
178
|
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { Canvas, Meta, Story } from '@storybook/addon-docs';
|
|
2
|
+
import { action } from '@storybook/addon-actions';
|
|
3
|
+
import { CvAccordion, CvAccordionItem } from '.';
|
|
4
|
+
import { alignConsts, sizeConsts } from './consts';
|
|
5
|
+
import {
|
|
6
|
+
sbCompPrefix,
|
|
7
|
+
storyParametersObject,
|
|
8
|
+
} from '../../global/storybook-utils';
|
|
9
|
+
import { ref } from 'vue';
|
|
10
|
+
const open = ref({
|
|
11
|
+
accItem1: false,
|
|
12
|
+
accItem2: false,
|
|
13
|
+
accItem3: false,
|
|
14
|
+
accItem4: false,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
<Meta title={`${sbCompPrefix}/CvAccordion`} component={CvAccordion} />
|
|
18
|
+
|
|
19
|
+
export const Template = args => ({
|
|
20
|
+
components: { CvAccordion, CvAccordionItem },
|
|
21
|
+
setup() {
|
|
22
|
+
return {
|
|
23
|
+
...args,
|
|
24
|
+
align: alignConsts[alignConsts.$labels[args.align]],
|
|
25
|
+
size: sizeConsts[sizeConsts.$labels[args.size]],
|
|
26
|
+
onChange: action('change'),
|
|
27
|
+
open,
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
template: args.template,
|
|
31
|
+
});
|
|
32
|
+
const template = `<cv-accordion @change="onChange" :align="align" :size="size">
|
|
33
|
+
<cv-accordion-item v-for="n in 4" :key="\`acc-item-\${n}\`" :id="n % 2 ? \`acc-item-\${n}\` : ''">
|
|
34
|
+
<template v-slot:title>Episode {{n}} </template>
|
|
35
|
+
<template v-slot:content>
|
|
36
|
+
<p>Did you hear that? They've shut down the main reactor. We'll be destroyed for sure. This is madness! We're doomed! There'll be no escape for the Princess this time. What's that? R2! R2-D2, where are you? At last! Where have you been? They're heading in this direction.</p>
|
|
37
|
+
</template>
|
|
38
|
+
</cv-accordion-item>
|
|
39
|
+
</cv-accordion>`;
|
|
40
|
+
const Default = Template.bind({});
|
|
41
|
+
Default.args = {};
|
|
42
|
+
Default.parameters = storyParametersObject(
|
|
43
|
+
Default.parameters,
|
|
44
|
+
template,
|
|
45
|
+
Default.args
|
|
46
|
+
);
|
|
47
|
+
const templateVModel = `
|
|
48
|
+
<div>
|
|
49
|
+
<cv-accordion @change="onChange" :align="align" :size="size">
|
|
50
|
+
<cv-accordion-item v-for="n in 4" :key="\`acc-item-\${n}\`" :id="\`accItem\${n}\`" v-model:open="open[\`accItem\${n}\`]">
|
|
51
|
+
<template #title>Episode {{n}} </template>
|
|
52
|
+
<template #content>
|
|
53
|
+
<p>Give us a few minutes to lock it down. Large leak...very dangerous. Who is this? What's your operating number? Boring conversation anyway. Luke! We're going to have company! Aren't you a little short to be a stormtrooper? What? Oh...the uniform.</p>
|
|
54
|
+
</template>
|
|
55
|
+
</cv-accordion-item>
|
|
56
|
+
</cv-accordion>
|
|
57
|
+
<div style="margin-top:1rem; background-color: #888888; padding:1rem"><div style="font-size: 150%">Sample interaction</div>
|
|
58
|
+
<label for="checkbox">V-model: Check 1:</label>
|
|
59
|
+
<input id="checkbox" type="checkbox" v-model="open.accItem1"/>
|
|
60
|
+
<span>Checked: <span style="font-weight: bold;">{{open.accItem1}}</span></span><br/>
|
|
61
|
+
<label for="checkbox">V-model: Check 2:</label>
|
|
62
|
+
<input id="checkbox" type="checkbox" v-model="open.accItem2"/>
|
|
63
|
+
<span>Checked: <span style="font-weight: bold;">{{open.accItem2}}</span></span><br/>
|
|
64
|
+
<label for="checkbox">V-model: Check 3:</label>
|
|
65
|
+
<input id="checkbox" type="checkbox" v-model="open.accItem3"/>
|
|
66
|
+
<span>Checked: <span style="font-weight: bold;">{{open.accItem3}}</span></span><br/>
|
|
67
|
+
<label for="checkbox">V-model: Check 4:</label>
|
|
68
|
+
<input id="checkbox" type="checkbox" v-model="open.accItem4"/>
|
|
69
|
+
<span>Checked: <span style="font-weight: bold;">{{open.accItem4}}</span></span>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
`;
|
|
73
|
+
|
|
74
|
+
# CvAccordion
|
|
75
|
+
|
|
76
|
+
<Canvas>
|
|
77
|
+
<Story
|
|
78
|
+
name="Default"
|
|
79
|
+
parameters={{
|
|
80
|
+
docs: { source: { code: template } },
|
|
81
|
+
controls: {
|
|
82
|
+
include: ['align', 'size'],
|
|
83
|
+
},
|
|
84
|
+
}}
|
|
85
|
+
args={{
|
|
86
|
+
template: template,
|
|
87
|
+
}}
|
|
88
|
+
argTypes={{
|
|
89
|
+
align: {
|
|
90
|
+
control: 'select',
|
|
91
|
+
options: Object.keys(alignConsts.$labels),
|
|
92
|
+
},
|
|
93
|
+
size: {
|
|
94
|
+
control: 'select',
|
|
95
|
+
options: Object.keys(sizeConsts.$labels),
|
|
96
|
+
},
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
{Template.bind({})}
|
|
100
|
+
</Story>
|
|
101
|
+
</Canvas>
|
|
102
|
+
|
|
103
|
+
# Control open state with v-model
|
|
104
|
+
|
|
105
|
+
- Notes: The Vue 2 component does not support v-model. One interesting implementation using this would be to create an
|
|
106
|
+
"auto close" component such that opening one section closes other sections.
|
|
107
|
+
|
|
108
|
+
```javascript
|
|
109
|
+
// example auto close
|
|
110
|
+
// <cv-accordion @change="onAutoClose">
|
|
111
|
+
const open = ref({
|
|
112
|
+
accItem1: false,
|
|
113
|
+
accItem2: false,
|
|
114
|
+
accItem3: false,
|
|
115
|
+
accItem4: false,
|
|
116
|
+
});
|
|
117
|
+
function autoClose(ev) {
|
|
118
|
+
if (ev.change.open) {
|
|
119
|
+
for (let state in open.value) {
|
|
120
|
+
if (state !== ev.change.id) open.value[state] = false;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
<Canvas>
|
|
127
|
+
<Story
|
|
128
|
+
name="v-model"
|
|
129
|
+
parameters={{
|
|
130
|
+
docs: { source: { code: templateVModel } },
|
|
131
|
+
controls: {
|
|
132
|
+
include: ['align', 'size'],
|
|
133
|
+
},
|
|
134
|
+
}}
|
|
135
|
+
args={{
|
|
136
|
+
template: templateVModel,
|
|
137
|
+
}}
|
|
138
|
+
argTypes={{
|
|
139
|
+
align: {
|
|
140
|
+
control: 'select',
|
|
141
|
+
default: 'end',
|
|
142
|
+
options: Object.keys(alignConsts.$labels),
|
|
143
|
+
},
|
|
144
|
+
size: {
|
|
145
|
+
control: 'select',
|
|
146
|
+
default: 'md',
|
|
147
|
+
options: Object.keys(sizeConsts.$labels),
|
|
148
|
+
},
|
|
149
|
+
}}
|
|
150
|
+
>
|
|
151
|
+
{Template.bind({})}
|
|
152
|
+
</Story>
|
|
153
|
+
</Canvas>
|
|
@@ -26,26 +26,26 @@ import { alignConsts, sizeConsts } from './consts';
|
|
|
26
26
|
|
|
27
27
|
defineProps({
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Specify the alignment of the accordion heading title and chevron.
|
|
30
30
|
*/
|
|
31
31
|
align: {
|
|
32
32
|
type: String,
|
|
33
|
-
default:
|
|
33
|
+
default: '',
|
|
34
34
|
validator: val => alignConsts.includes(val),
|
|
35
35
|
},
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* Specify the size of the Accordion
|
|
38
38
|
*/
|
|
39
39
|
size: {
|
|
40
40
|
type: String,
|
|
41
|
-
default:
|
|
41
|
+
default: '',
|
|
42
42
|
validator: val => sizeConsts.includes(val),
|
|
43
43
|
},
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
const emit = defineEmits({
|
|
47
47
|
/**
|
|
48
|
-
* Triggers when
|
|
48
|
+
* Triggers when state of an accordion item changes
|
|
49
49
|
*/
|
|
50
50
|
change: payload => {
|
|
51
51
|
return (
|
|
@@ -83,6 +83,19 @@ provide('registerItem', (itemCvId, item) => {
|
|
|
83
83
|
provide('deregisterItem', itemCvId => {
|
|
84
84
|
items.delete(itemCvId);
|
|
85
85
|
});
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @typedef {Object} AccordionChangeElement
|
|
89
|
+
* @property {string} id
|
|
90
|
+
* @property {boolean} open
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @typedef {Object} AccordionChangeEvent
|
|
95
|
+
* @property {AccordionChangeElement} change
|
|
96
|
+
* @property {Array<AccordionChangeElement>} state
|
|
97
|
+
* @param ev
|
|
98
|
+
*/
|
|
86
99
|
provide('onAccItemChange', (clickedItemCvId, open) => {
|
|
87
100
|
items.get(clickedItemCvId).open = open;
|
|
88
101
|
emit('change', {
|
|
@@ -46,18 +46,18 @@ export default {
|
|
|
46
46
|
</script>
|
|
47
47
|
|
|
48
48
|
<script setup>
|
|
49
|
-
import { onMounted, onBeforeUnmount, inject, ref } from 'vue';
|
|
49
|
+
import { onMounted, onBeforeUnmount, inject, ref, watch } from 'vue';
|
|
50
50
|
import { carbonPrefix } from '../../global/settings';
|
|
51
51
|
import { useCvId, props as propsCvId } from '../../use/cvId';
|
|
52
52
|
import { ChevronRight16 } from '@carbon/icons-vue/';
|
|
53
53
|
|
|
54
54
|
const props = defineProps({
|
|
55
55
|
/**
|
|
56
|
-
* disables this
|
|
56
|
+
* disables this accordion item
|
|
57
57
|
*/
|
|
58
58
|
disabled: Boolean,
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
60
|
+
* open state of the accordion item. available as a v-model
|
|
61
61
|
*/
|
|
62
62
|
open: Boolean,
|
|
63
63
|
...propsCvId,
|
|
@@ -66,10 +66,21 @@ const props = defineProps({
|
|
|
66
66
|
// Accordion methods
|
|
67
67
|
const registerItem = inject('registerItem', () => {});
|
|
68
68
|
const deregisterItem = inject('deregisterItem', () => {});
|
|
69
|
-
const
|
|
69
|
+
const onAccItemChange = inject(
|
|
70
|
+
'onAccItemChange',
|
|
71
|
+
(clickedItemCvId, open) => {}
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
const emit = defineEmits(['update:open']);
|
|
75
|
+
watch(
|
|
76
|
+
() => props.open,
|
|
77
|
+
() => {
|
|
78
|
+
if (props.open !== isOpen.value) toggleOpen(props.open);
|
|
79
|
+
}
|
|
80
|
+
);
|
|
70
81
|
|
|
71
82
|
// Accordion item methods
|
|
72
|
-
const cvId = useCvId(props);
|
|
83
|
+
const cvId = useCvId(props, true);
|
|
73
84
|
const isOpen = ref(props.open);
|
|
74
85
|
const animation = ref('');
|
|
75
86
|
|
|
@@ -77,8 +88,9 @@ const toggleOpen = force => {
|
|
|
77
88
|
const newValue = typeof force !== 'undefined' ? force : !isOpen.value;
|
|
78
89
|
|
|
79
90
|
animation.value = newValue ? 'expanding' : 'collapsing';
|
|
91
|
+
if (newValue !== props.open) emit('update:open', newValue);
|
|
92
|
+
if (isOpen.value !== newValue) onAccItemChange(cvId.value, newValue);
|
|
80
93
|
isOpen.value = newValue;
|
|
81
|
-
onAccItemChagne(cvId.value, newValue);
|
|
82
94
|
};
|
|
83
95
|
|
|
84
96
|
const onClick = () => {
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
export const alignConsts = [
|
|
1
|
+
export const alignConsts = ['', 'start', 'end'];
|
|
2
2
|
alignConsts.$labels = {
|
|
3
|
-
'
|
|
4
|
-
Start: 1,
|
|
5
|
-
End: 2,
|
|
6
|
-
'Empty string': 3,
|
|
3
|
+
'Default (end)': 0,
|
|
4
|
+
'Start (start)': 1,
|
|
5
|
+
'End (end)': 2,
|
|
7
6
|
};
|
|
8
|
-
export const sizeConsts = [
|
|
7
|
+
export const sizeConsts = ['', 'sm', 'md', 'xl'];
|
|
9
8
|
sizeConsts.$labels = {
|
|
10
|
-
'
|
|
9
|
+
'Default (md)': 0,
|
|
11
10
|
'Small (sm)': 1,
|
|
12
|
-
'
|
|
13
|
-
'
|
|
11
|
+
'Medium (md)': 2,
|
|
12
|
+
'Extra large (xl)': 3,
|
|
14
13
|
};
|
|
15
14
|
|
|
16
15
|
const CvAccordionConsts = { alignConsts, sizeConsts };
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
type="checkbox"
|
|
14
14
|
:class="`${carbonPrefix}--checkbox`"
|
|
15
15
|
:checked="isChecked === true"
|
|
16
|
-
:aria-checked="`${isChecked}`"
|
|
17
16
|
:value="value"
|
|
18
17
|
:disabled="disabled || null"
|
|
19
18
|
@focus="onFocus"
|
|
@@ -55,7 +54,12 @@ const props = defineProps({
|
|
|
55
54
|
/**
|
|
56
55
|
* Provide a label to provide a description of the Checkbox input that you are exposing to the user
|
|
57
56
|
*/
|
|
58
|
-
label: {
|
|
57
|
+
label: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: null,
|
|
60
|
+
required: true,
|
|
61
|
+
validator: label => !!label.length,
|
|
62
|
+
},
|
|
59
63
|
/**
|
|
60
64
|
* Specify whether the "bx--form-item" style should be applied
|
|
61
65
|
*/
|