@carbon/vue 3.0.13 → 3.0.14
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/README.md +9 -0
- package/dist/carbon-vue-3.common.js +114 -65
- package/dist/carbon-vue-3.common.js.map +1 -1
- package/dist/carbon-vue-3.umd.js +114 -65
- 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 +10 -1
- package/package.json +6 -4
- package/src/components/CvAccordion/CvAccordion.stories.mdx +11 -2
- package/src/components/CvAccordion/CvAccordionItem.vue +1 -1
- package/src/components/CvButton/CvIconButton.vue +1 -1
- package/src/components/CvCheckbox/CvCheckbox.vue +2 -1
- package/src/components/CvComboBox/CvComboBox.vue +1 -1
- package/src/components/CvDataTable/CvDataTable.vue +26 -7
- package/src/components/CvDataTable/CvDataTableRow.vue +11 -3
- package/src/components/CvDataTable/_CvDataTableRowInner.vue +12 -3
- package/src/components/CvDataTable/cvDataTableStore.js +1 -0
- package/src/components/CvDatePicker/CvDatePicker.vue +9 -11
- package/src/components/CvDropdown/CvDropdown.stories.mdx +6 -2
- package/src/components/CvDropdown/CvDropdown.vue +3 -3
- package/src/components/CvFileUploader/CvFileUploader.vue +2 -2
- package/src/components/CvNotification/CvToastNotification.stories.js +65 -5
- package/src/components/CvNotification/CvToastNotificationTemplate.mdx +17 -0
- package/src/components/CvNumberInput/CvNumberInput.vue +3 -3
- package/src/components/CvOverflowMenu/CvOverflowMenuItem.vue +2 -2
- package/src/components/CvProgress/CvProgress.stories.mdx +29 -7
- package/src/components/CvProgress/CvProgress.vue +1 -0
- package/src/components/CvProgress/CvProgressStep.vue +2 -0
- package/src/components/CvSlider/CvSlider.vue +1 -1
- package/src/components/CvTag/CvTag.vue +1 -1
- package/telemetry.yml +8 -0
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.13",
|
|
5
5
|
"contributions": {
|
|
6
6
|
"html": {
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -1049,6 +1049,15 @@
|
|
|
1049
1049
|
},
|
|
1050
1050
|
"default": "false"
|
|
1051
1051
|
},
|
|
1052
|
+
{
|
|
1053
|
+
"name": "expandable",
|
|
1054
|
+
"description": "Table will have expandable rows",
|
|
1055
|
+
"value": {
|
|
1056
|
+
"kind": "expression",
|
|
1057
|
+
"type": "boolean"
|
|
1058
|
+
},
|
|
1059
|
+
"default": "false"
|
|
1060
|
+
},
|
|
1052
1061
|
{
|
|
1053
1062
|
"name": "title",
|
|
1054
1063
|
"value": {
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/vue",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.14",
|
|
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",
|
|
8
8
|
"types": "src/index.d.ts",
|
|
9
9
|
"web-types": "dist/web-types.json",
|
|
10
10
|
"scripts": {
|
|
11
|
-
"_postinstall": "node prepare.js && node .storybook/postinstall.js",
|
|
11
|
+
"_postinstall": "node prepare.js && node .storybook/postinstall.js && ibmtelemetry --config=telemetry.yml",
|
|
12
12
|
"prepack": "pinst --disable",
|
|
13
13
|
"postpack": "pinst --enable",
|
|
14
14
|
"build": "vue-cli-service build --target lib --name carbon-vue-3 ./src/index.js --no-clean",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@carbon/icons-vue": "^10.60.0",
|
|
32
|
+
"@ibm/telemetry-js": "^1.2.1",
|
|
32
33
|
"@vueuse/core": "^4.11.2",
|
|
33
34
|
"carbon-components": "^10.58.5",
|
|
34
35
|
"eslint-plugin-prettier-vue": "^4.2.0",
|
|
@@ -157,7 +158,8 @@
|
|
|
157
158
|
},
|
|
158
159
|
"files": [
|
|
159
160
|
"/dist",
|
|
160
|
-
"/src"
|
|
161
|
+
"/src",
|
|
162
|
+
"telemetry.yml"
|
|
161
163
|
],
|
|
162
164
|
"commitlint": {
|
|
163
165
|
"extends": [
|
|
@@ -174,5 +176,5 @@
|
|
|
174
176
|
"url": "git+https://github.com/carbon-design-system/carbon-components-vue.git"
|
|
175
177
|
},
|
|
176
178
|
"sideEffects": true,
|
|
177
|
-
"gitHead": "
|
|
179
|
+
"gitHead": "dd069f41ff788b4698a23fe9bfbc12874be40843"
|
|
178
180
|
}
|
|
@@ -13,6 +13,11 @@ const open = ref({
|
|
|
13
13
|
accItem3: false,
|
|
14
14
|
accItem4: false,
|
|
15
15
|
});
|
|
16
|
+
const disabledItems = ref(new Set())
|
|
17
|
+
function onToggleEpisode3(){
|
|
18
|
+
if (disabledItems.value.has(3)) disabledItems.value.delete(3)
|
|
19
|
+
else disabledItems.value.add(3)
|
|
20
|
+
}
|
|
16
21
|
|
|
17
22
|
<Meta title={`${sbCompPrefix}/CvAccordion`} component={CvAccordion} />
|
|
18
23
|
|
|
@@ -24,19 +29,23 @@ export const Template = args => ({
|
|
|
24
29
|
align: alignConsts[alignConsts.$labels[args.align]],
|
|
25
30
|
size: sizeConsts[sizeConsts.$labels[args.size]],
|
|
26
31
|
onChange: action('change'),
|
|
32
|
+
disabledItems,
|
|
33
|
+
onToggleEpisode3,
|
|
27
34
|
open,
|
|
28
35
|
};
|
|
29
36
|
},
|
|
30
37
|
template: args.template,
|
|
31
38
|
});
|
|
32
39
|
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}\` : ''">
|
|
40
|
+
<cv-accordion-item v-for="n in 4" :key="\`acc-item-\${n}\`" :id="n % 2 ? \`acc-item-\${n}\` : ''" :disabled="disabledItems.has(n)">
|
|
34
41
|
<template v-slot:title>Episode {{n}} </template>
|
|
35
42
|
<template v-slot:content>
|
|
36
43
|
<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
44
|
</template>
|
|
38
45
|
</cv-accordion-item>
|
|
39
|
-
</cv-accordion
|
|
46
|
+
</cv-accordion>
|
|
47
|
+
<div><button @click="onToggleEpisode3">Disable Episode 3</button></div>
|
|
48
|
+
`;
|
|
40
49
|
const Default = Template.bind({});
|
|
41
50
|
Default.args = {};
|
|
42
51
|
Default.parameters = storyParametersObject(
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
`${carbonPrefix}--tooltip--${tipPosition || 'bottom'}`,
|
|
8
8
|
`${carbonPrefix}--tooltip--align-${tipAlignment || 'center'}`,
|
|
9
9
|
]"
|
|
10
|
-
:disabled="disabled"
|
|
10
|
+
:disabled="disabled || null"
|
|
11
11
|
@click="$emit('click', $event)"
|
|
12
12
|
>
|
|
13
13
|
<span :class="`${carbonPrefix}--assistive-text`">{{ label }}</span>
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
<div
|
|
3
3
|
class="cv-checkbox"
|
|
4
4
|
:class="[
|
|
5
|
-
`${carbonPrefix}--checkbox--${inline ? 'inline' : 'wrapper'}`,
|
|
6
5
|
{ [`${carbonPrefix}--form-item`]: formItem },
|
|
6
|
+
{ [`${carbonPrefix}--checkbox--inline`]: inline },
|
|
7
|
+
{ [`${carbonPrefix}--checkbox-wrapper`]: !inline },
|
|
7
8
|
]"
|
|
8
9
|
>
|
|
9
10
|
<input
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
<thead>
|
|
133
133
|
<tr>
|
|
134
134
|
<th
|
|
135
|
-
v-if="
|
|
135
|
+
v-if="hasExpandingRows"
|
|
136
136
|
:class="`${carbonPrefix}--table-expand`"
|
|
137
137
|
:data-previous-value="
|
|
138
138
|
dataExpandAll ? 'collapsed' : 'expanded'
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
</tr>
|
|
182
182
|
</thead>
|
|
183
183
|
|
|
184
|
-
<component :is="
|
|
184
|
+
<component :is="hasExpandingRows ? Empty : 'tbody'">
|
|
185
185
|
<slot name="data">
|
|
186
186
|
<cv-data-table-row
|
|
187
187
|
v-for="(row, rowIndex) in data"
|
|
@@ -246,8 +246,10 @@ import {
|
|
|
246
246
|
unref,
|
|
247
247
|
useSlots,
|
|
248
248
|
watch,
|
|
249
|
+
provide,
|
|
249
250
|
} from 'vue';
|
|
250
251
|
import { props as propsCvId, useCvId } from '../../use/cvId';
|
|
252
|
+
//TODO: Remove this store and replace with provide/inject
|
|
251
253
|
import store from './cvDataTableStore';
|
|
252
254
|
import Empty from '../CvEmpty/_CvEmpty.vue';
|
|
253
255
|
|
|
@@ -316,6 +318,8 @@ const props = defineProps({
|
|
|
316
318
|
* can be sorted
|
|
317
319
|
*/
|
|
318
320
|
sortable: { type: Boolean, default: false },
|
|
321
|
+
/** Table will have expandable rows */
|
|
322
|
+
expandable: { type: Boolean, default: false },
|
|
319
323
|
title: { type: String, default: undefined },
|
|
320
324
|
/**
|
|
321
325
|
* An array containing a list of columns
|
|
@@ -375,6 +379,25 @@ watch(() => props.rowsSelected, updateRowsSelected);
|
|
|
375
379
|
const searchContainer = ref(null);
|
|
376
380
|
const magnifier = ref(null);
|
|
377
381
|
const search = ref(null);
|
|
382
|
+
|
|
383
|
+
/** @type {Ref<Set<String>>} */
|
|
384
|
+
const expandingRowIds = ref(new Set());
|
|
385
|
+
const hasExpandingRows = computed(() => {
|
|
386
|
+
return expandingRowIds.value.size > 0;
|
|
387
|
+
});
|
|
388
|
+
provide('expanding-row-ids', expandingRowIds);
|
|
389
|
+
provide('has-expanding-rows', hasExpandingRows);
|
|
390
|
+
onMounted(() => {
|
|
391
|
+
if (props.expandable) expandingRowIds.value.add('table-expand-row');
|
|
392
|
+
});
|
|
393
|
+
watch(
|
|
394
|
+
() => props.expandable,
|
|
395
|
+
() => {
|
|
396
|
+
if (props.expandable) expandingRowIds.value.add('table-expand-row');
|
|
397
|
+
else expandingRowIds.value.delete('table-expand-row');
|
|
398
|
+
}
|
|
399
|
+
);
|
|
400
|
+
|
|
378
401
|
onMounted(() => {
|
|
379
402
|
if (searchContainer.value) {
|
|
380
403
|
magnifier.value?.addEventListener('blur', checkSearchFocus);
|
|
@@ -382,7 +405,6 @@ onMounted(() => {
|
|
|
382
405
|
}
|
|
383
406
|
if (props.initialSearchValue) clearSearchVisible.value = true;
|
|
384
407
|
updateRowsSelected();
|
|
385
|
-
store.setSomeExpandingRows(uid);
|
|
386
408
|
});
|
|
387
409
|
|
|
388
410
|
onUnmounted(() => {
|
|
@@ -428,6 +450,7 @@ const isSortable = computed(() => {
|
|
|
428
450
|
// is any column sortable
|
|
429
451
|
return props.sortable || store.someSortableHeadings(uid.value);
|
|
430
452
|
});
|
|
453
|
+
|
|
431
454
|
function isColSortable(c) {
|
|
432
455
|
const col = unref(c);
|
|
433
456
|
// is specific column or all sortable
|
|
@@ -439,10 +462,6 @@ const hasTableHeader = computed(() => {
|
|
|
439
462
|
return props.title || isHelper.value;
|
|
440
463
|
});
|
|
441
464
|
|
|
442
|
-
const hasExpandables = computed(() => {
|
|
443
|
-
return store.someExpandingRows(uid);
|
|
444
|
-
});
|
|
445
|
-
|
|
446
465
|
const hasOverflowMenu = computed(() => {
|
|
447
466
|
return (
|
|
448
467
|
props.overflowMenu === true ||
|
|
@@ -53,6 +53,7 @@ import {
|
|
|
53
53
|
useAttrs,
|
|
54
54
|
useSlots,
|
|
55
55
|
watch,
|
|
56
|
+
inject,
|
|
56
57
|
} from 'vue';
|
|
57
58
|
import store from './cvDataTableStore';
|
|
58
59
|
import { getBus } from '../../global/component-utils/event-bus';
|
|
@@ -63,7 +64,16 @@ const props = defineProps({
|
|
|
63
64
|
});
|
|
64
65
|
const cvId = useCvId(props, true);
|
|
65
66
|
|
|
67
|
+
/** @type {Ref<Set<String>>} */
|
|
68
|
+
const expandingRowIds = inject('expanding-row-ids', ref(new Set()));
|
|
66
69
|
const dataExpandable = ref(false);
|
|
70
|
+
watch(dataExpandable, () => {
|
|
71
|
+
if (dataExpandable.value) expandingRowIds.value?.add(cvId.value);
|
|
72
|
+
else expandingRowIds.value?.delete(cvId.value);
|
|
73
|
+
});
|
|
74
|
+
const dataSomeExpandingRows = computed(() => {
|
|
75
|
+
return expandingRowIds.value?.size > 0;
|
|
76
|
+
});
|
|
67
77
|
|
|
68
78
|
const attrs = useAttrs();
|
|
69
79
|
const slots = useSlots();
|
|
@@ -118,9 +128,7 @@ watch(
|
|
|
118
128
|
});
|
|
119
129
|
}
|
|
120
130
|
);
|
|
121
|
-
|
|
122
|
-
return store.someExpandingRows(parent);
|
|
123
|
-
});
|
|
131
|
+
|
|
124
132
|
function onExpandedChange(val) {
|
|
125
133
|
const row = store.findRow(parent, cvId);
|
|
126
134
|
store.updateRow(parent, {
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
>
|
|
22
22
|
<ChevronRight16 :class="`${carbonPrefix}--table-expand__svg`" />
|
|
23
23
|
</button>
|
|
24
|
-
<div v-else>{{ expandingRow }}</div>
|
|
25
24
|
</td>
|
|
26
25
|
<td
|
|
27
26
|
v-if="hasBatchActions"
|
|
@@ -66,7 +65,15 @@ import CvCheckbox from '../CvCheckbox';
|
|
|
66
65
|
import CvOverflowMenu from '../CvOverflowMenu';
|
|
67
66
|
import CvOverflowMenuItem from '../CvOverflowMenu/CvOverflowMenuItem.vue';
|
|
68
67
|
import ChevronRight16 from '@carbon/icons-vue/es/chevron--right/16';
|
|
69
|
-
import {
|
|
68
|
+
import {
|
|
69
|
+
computed,
|
|
70
|
+
onMounted,
|
|
71
|
+
onUpdated,
|
|
72
|
+
ref,
|
|
73
|
+
useSlots,
|
|
74
|
+
watch,
|
|
75
|
+
inject,
|
|
76
|
+
} from 'vue';
|
|
70
77
|
import store from './cvDataTableStore';
|
|
71
78
|
import { getBus } from '../../global/component-utils/event-bus';
|
|
72
79
|
|
|
@@ -82,8 +89,10 @@ const props = defineProps({
|
|
|
82
89
|
rowId: { type: String, default: undefined },
|
|
83
90
|
});
|
|
84
91
|
|
|
92
|
+
/** @type {Ref<UnwrapRef<Set<>>>} */
|
|
93
|
+
const expandingRowIds = inject('expanding-row-ids', ref(new Set()));
|
|
85
94
|
const dataSomeExpandingRows = computed(() => {
|
|
86
|
-
return
|
|
95
|
+
return expandingRowIds.value.size > 0;
|
|
87
96
|
});
|
|
88
97
|
|
|
89
98
|
const overflowMenuButtons = computed(() => {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
'single',
|
|
25
25
|
'range',
|
|
26
26
|
].includes(getKind),
|
|
27
|
-
[`${carbonPrefix}--date-picker--nolabel`]: getDateLabel
|
|
27
|
+
[`${carbonPrefix}--date-picker--nolabel`]: !getDateLabel,
|
|
28
28
|
}"
|
|
29
29
|
>
|
|
30
30
|
<label
|
|
@@ -191,18 +191,16 @@ const getKind = computed({
|
|
|
191
191
|
},
|
|
192
192
|
});
|
|
193
193
|
|
|
194
|
-
const getDateLabel = computed({
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
const getDateLabel = computed(() => {
|
|
195
|
+
if (props.dateLabel !== undefined) {
|
|
196
|
+
return props.dateLabel;
|
|
197
|
+
} else {
|
|
198
|
+
if (props.kind === 'range') {
|
|
197
199
|
return 'Start date';
|
|
200
|
+
} else {
|
|
201
|
+
return 'Date';
|
|
198
202
|
}
|
|
199
|
-
|
|
200
|
-
if (!props.dateLabel) {
|
|
201
|
-
return 'Date label';
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
return props.dateLabel;
|
|
205
|
-
},
|
|
203
|
+
}
|
|
206
204
|
});
|
|
207
205
|
|
|
208
206
|
const isRange = computed(() => {
|
|
@@ -150,10 +150,14 @@ const skeletonTemplate = `
|
|
|
150
150
|
Notes:
|
|
151
151
|
|
|
152
152
|
- You can place a Dropdown inline with other content by using the inline variant
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
|
|
154
|
+
Migration notes:
|
|
155
|
+
- **Breaking**. The selected item contents are no longer copied directly to the "internal caption". If you are trying to style both
|
|
156
|
+
the drop-down item and its appearance after it is selected, please see the `internal-caption` slot. See the "Slots"
|
|
157
|
+
story for an example.- Added the `size` option to match Carbon React
|
|
155
158
|
- Added the `warningMessage` option to match Carbon React
|
|
156
159
|
|
|
160
|
+
|
|
157
161
|
<Canvas>
|
|
158
162
|
<Story
|
|
159
163
|
name="Default"
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
:aria-expanded="open ? 'true' : 'false'"
|
|
78
78
|
:aria-labelledby="ariaLabeledBy"
|
|
79
79
|
:class="`${carbonPrefix}--list-box__field`"
|
|
80
|
-
:disabled="disabled"
|
|
80
|
+
:disabled="disabled || null"
|
|
81
81
|
aria-haspopup="true"
|
|
82
82
|
type="button"
|
|
83
83
|
>
|
|
@@ -293,9 +293,9 @@ watch(open, () => {
|
|
|
293
293
|
});
|
|
294
294
|
const ariaLabeledBy = computed(() => {
|
|
295
295
|
if (props.label) {
|
|
296
|
-
return `${uid}-label ${uid}-value`;
|
|
296
|
+
return `${uid.value}-label ${uid.value}-value`;
|
|
297
297
|
} else {
|
|
298
|
-
return `${uid}-value`;
|
|
298
|
+
return `${uid.value}-value`;
|
|
299
299
|
}
|
|
300
300
|
});
|
|
301
301
|
const internalCaption = computed(() => {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
ref="fileInput"
|
|
35
35
|
:class="`${carbonPrefix}--file-input`"
|
|
36
36
|
:accept="accept"
|
|
37
|
-
:disabled="disabled"
|
|
37
|
+
:disabled="disabled || null"
|
|
38
38
|
type="file"
|
|
39
39
|
v-bind="$attrs"
|
|
40
40
|
data-file-uploader
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
ref="fileInput"
|
|
71
71
|
:class="`${carbonPrefix}--file-input`"
|
|
72
72
|
:accept="accept"
|
|
73
|
-
:disabled="disabled"
|
|
73
|
+
:disabled="disabled || null"
|
|
74
74
|
type="file"
|
|
75
75
|
v-bind="$attrs"
|
|
76
76
|
tabindex="-1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { action } from '@storybook/addon-actions';
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import DocumentationTemplate from './CvToastNotificationTemplate.mdx';
|
|
3
|
+
import { sbCompPrefix, storySourceCode } from '../../global/storybook-utils';
|
|
4
4
|
import { CvToastNotification, CvNotificationConsts } from '.';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
@@ -85,6 +85,11 @@ export default {
|
|
|
85
85
|
description: 'Caption slot for more custom content.',
|
|
86
86
|
},
|
|
87
87
|
},
|
|
88
|
+
parameters: {
|
|
89
|
+
docs: {
|
|
90
|
+
page: DocumentationTemplate,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
88
93
|
};
|
|
89
94
|
|
|
90
95
|
const template = `
|
|
@@ -118,58 +123,113 @@ const Template = args => {
|
|
|
118
123
|
};
|
|
119
124
|
};
|
|
120
125
|
|
|
121
|
-
export const
|
|
122
|
-
|
|
126
|
+
export const Default = Template.bind({});
|
|
127
|
+
Default.args = {
|
|
123
128
|
kind: CvNotificationConsts.notificationKinds[0],
|
|
129
|
+
title: 'info',
|
|
130
|
+
subTitle: 'subtitle',
|
|
131
|
+
caption: 'more information',
|
|
132
|
+
};
|
|
133
|
+
Default.parameters = {
|
|
134
|
+
docs: { source: { code: storySourceCode(template, Default.args) } },
|
|
124
135
|
};
|
|
125
136
|
|
|
126
137
|
export const InfoSquare = Template.bind({});
|
|
127
138
|
InfoSquare.storyName = 'Info square';
|
|
128
139
|
InfoSquare.args = {
|
|
129
140
|
kind: CvNotificationConsts.notificationKinds[1],
|
|
141
|
+
title: 'info²',
|
|
142
|
+
subTitle: 'subtitle',
|
|
143
|
+
caption: 'more information',
|
|
144
|
+
};
|
|
145
|
+
InfoSquare.parameters = {
|
|
146
|
+
docs: { source: { code: storySourceCode(template, InfoSquare.args) } },
|
|
130
147
|
};
|
|
131
148
|
|
|
132
149
|
export const Success = Template.bind({});
|
|
133
150
|
Success.args = {
|
|
134
151
|
kind: CvNotificationConsts.notificationKinds[2],
|
|
152
|
+
title: 'success',
|
|
153
|
+
subTitle: 'subtitle',
|
|
154
|
+
caption: 'more information',
|
|
155
|
+
};
|
|
156
|
+
Success.parameters = {
|
|
157
|
+
docs: { source: { code: storySourceCode(template, Success.args) } },
|
|
135
158
|
};
|
|
136
|
-
|
|
137
159
|
export const Warning = Template.bind({});
|
|
138
160
|
Warning.args = {
|
|
139
161
|
kind: CvNotificationConsts.notificationKinds[3],
|
|
162
|
+
title: 'warning',
|
|
163
|
+
subTitle: 'subtitle',
|
|
164
|
+
caption: 'more information',
|
|
165
|
+
};
|
|
166
|
+
Warning.parameters = {
|
|
167
|
+
docs: { source: { code: storySourceCode(template, Warning.args) } },
|
|
140
168
|
};
|
|
141
169
|
|
|
142
170
|
export const WarningAlt = Template.bind({});
|
|
143
171
|
WarningAlt.storyName = 'Warning (alt)';
|
|
144
172
|
WarningAlt.args = {
|
|
145
173
|
kind: CvNotificationConsts.notificationKinds[4],
|
|
174
|
+
title: 'warning △',
|
|
175
|
+
subTitle: 'subtitle',
|
|
176
|
+
caption: 'more information',
|
|
177
|
+
};
|
|
178
|
+
WarningAlt.parameters = {
|
|
179
|
+
docs: { source: { code: storySourceCode(template, WarningAlt.args) } },
|
|
146
180
|
};
|
|
147
181
|
|
|
148
182
|
export const Error = Template.bind({});
|
|
149
183
|
Error.args = {
|
|
150
184
|
kind: CvNotificationConsts.notificationKinds[5],
|
|
185
|
+
title: 'error',
|
|
186
|
+
subTitle: 'subtitle',
|
|
187
|
+
caption: 'more information',
|
|
188
|
+
};
|
|
189
|
+
Error.parameters = {
|
|
190
|
+
docs: { source: { code: storySourceCode(template, Error.args) } },
|
|
151
191
|
};
|
|
152
192
|
|
|
153
193
|
export const SlotDefault = Template.bind({});
|
|
154
194
|
SlotDefault.args = {
|
|
155
195
|
kind: CvNotificationConsts.notificationKinds[4],
|
|
196
|
+
title: 'title',
|
|
197
|
+
subTitle: 'subtitle',
|
|
156
198
|
defaultSlot: true,
|
|
157
199
|
};
|
|
200
|
+
SlotDefault.parameters = {
|
|
201
|
+
docs: { source: { code: storySourceCode(template, SlotDefault.args) } },
|
|
202
|
+
};
|
|
158
203
|
|
|
159
204
|
export const SlotTitle = Template.bind({});
|
|
160
205
|
SlotTitle.args = {
|
|
161
206
|
kind: CvNotificationConsts.notificationKinds[0],
|
|
162
207
|
titleSlot: true,
|
|
208
|
+
subTitle: 'subtitle',
|
|
209
|
+
caption: 'more information',
|
|
210
|
+
};
|
|
211
|
+
SlotTitle.parameters = {
|
|
212
|
+
docs: { source: { code: storySourceCode(template, SlotTitle.args) } },
|
|
163
213
|
};
|
|
164
214
|
|
|
165
215
|
export const SlotSubtitle = Template.bind({});
|
|
166
216
|
SlotSubtitle.args = {
|
|
167
217
|
kind: CvNotificationConsts.notificationKinds[3],
|
|
168
218
|
subtitleSlot: true,
|
|
219
|
+
title: 'title',
|
|
220
|
+
caption: 'more information',
|
|
221
|
+
};
|
|
222
|
+
SlotSubtitle.parameters = {
|
|
223
|
+
docs: { source: { code: storySourceCode(template, SlotSubtitle.args) } },
|
|
169
224
|
};
|
|
170
225
|
|
|
171
226
|
export const SlotCaption = Template.bind({});
|
|
172
227
|
SlotCaption.args = {
|
|
173
228
|
kind: CvNotificationConsts.notificationKinds[1],
|
|
174
229
|
captionSlot: true,
|
|
230
|
+
title: 'title',
|
|
231
|
+
subTitle: 'subtitle',
|
|
232
|
+
};
|
|
233
|
+
SlotCaption.parameters = {
|
|
234
|
+
docs: { source: { code: storySourceCode(template, SlotCaption.args) } },
|
|
175
235
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Meta, Title, Primary, Stories } from '@storybook/addon-docs';
|
|
2
|
+
|
|
3
|
+
<Meta isTemplate />
|
|
4
|
+
|
|
5
|
+
<Title />
|
|
6
|
+
|
|
7
|
+
Migration notes:
|
|
8
|
+
|
|
9
|
+
- **Breaking**. The `subTitle` property no longer renders html. Please use the `subtitle` slot instead.
|
|
10
|
+
- **Breaking**. The `caption` property no longer renders html. Please use the `caption` slot instead.
|
|
11
|
+
- The `title` content can now be provided in the `title` slot.
|
|
12
|
+
|
|
13
|
+
<Primary />
|
|
14
|
+
|
|
15
|
+
<Controls />
|
|
16
|
+
|
|
17
|
+
<Stories />
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
:data-invalid="isInvalid || null"
|
|
39
39
|
type="number"
|
|
40
40
|
v-bind="$attrs"
|
|
41
|
-
:disabled="disabled"
|
|
41
|
+
:disabled="disabled || null"
|
|
42
42
|
:step="step"
|
|
43
43
|
:min="min"
|
|
44
44
|
:max="max"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
:class="`${carbonPrefix}--number__control-btn down-icon`"
|
|
54
54
|
type="button"
|
|
55
55
|
:aria-label="ariaLabelForDownButton"
|
|
56
|
-
:disabled="disabled"
|
|
56
|
+
:disabled="disabled || null"
|
|
57
57
|
aria-live="polite"
|
|
58
58
|
aria-atomic="true"
|
|
59
59
|
@click="doDown"
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
:class="`${carbonPrefix}--number__control-btn up-icon`"
|
|
68
68
|
type="button"
|
|
69
69
|
:aria-label="ariaLabelForUpButton"
|
|
70
|
-
:disabled="disabled"
|
|
70
|
+
:disabled="disabled || null"
|
|
71
71
|
aria-live="polite"
|
|
72
72
|
aria-atomic="true"
|
|
73
73
|
@click="doUp"
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
<button
|
|
14
14
|
type="button"
|
|
15
15
|
:class="`${carbonPrefix}--overflow-menu-options__btn`"
|
|
16
|
-
:data-floating-menu-primary-focus="primaryFocus"
|
|
17
|
-
:disabled="disabled"
|
|
16
|
+
:data-floating-menu-primary-focus="primaryFocus || null"
|
|
17
|
+
:disabled="disabled || null"
|
|
18
18
|
@click="onClick"
|
|
19
19
|
>
|
|
20
20
|
<span :class="`${carbonPrefix}--overflow-menu-options__option-content`">
|