@carbon/vue 3.0.9 → 3.0.10
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 +19590 -19300
- package/dist/carbon-vue-3.common.js.map +1 -1
- package/dist/carbon-vue-3.css +1 -1
- package/dist/carbon-vue-3.umd.js +19541 -19251
- package/dist/carbon-vue-3.umd.js.map +1 -1
- package/dist/carbon-vue-3.umd.min.js +3 -3
- package/dist/carbon-vue-3.umd.min.js.map +1 -1
- package/dist/web-types.json +5477 -0
- package/package.json +10 -42
- package/src/components/CvAccordion/CvAccordionItem.vue +1 -1
- package/src/components/CvButton/CvButton.stories.js +1 -1
- package/src/components/CvButton/CvButton.vue +2 -2
- package/src/components/CvButton/CvIconButton.stories.js +14 -17
- package/src/components/CvButton/CvIconButton.vue +8 -7
- package/src/components/CvCheckbox/CvCheckbox.vue +4 -3
- package/src/components/CvCodeSnippet/CvCodeSnippet.vue +5 -5
- package/src/components/CvCodeSnippet/_CviCodeSnippetInline.vue +2 -2
- package/src/components/CvCodeSnippet/_CviCodeSnippetMultiline.vue +6 -6
- package/src/components/CvCodeSnippet/_CviCodeSnippetOneline.vue +3 -3
- package/src/components/CvComboBox/CvComboBox.vue +8 -8
- package/src/components/CvContentSwitcher/CvContentSwitcher.vue +1 -1
- package/src/components/CvContentSwitcher/CvContentSwitcherButton.vue +1 -1
- package/src/components/CvCopyButton/CvCopyButton.vue +1 -1
- package/src/components/CvCopyButton/_CviCopyButton.vue +2 -2
- package/src/components/CvDataTable/CvDataTable.vue +29 -27
- package/src/components/CvDataTable/CvDataTableHeading.vue +9 -9
- package/src/components/CvDataTable/CvDataTableRow.vue +6 -6
- package/src/components/CvDataTable/CvDataTableSkeleton.vue +3 -3
- package/src/components/CvDataTable/_CvDataTableRowInner.vue +9 -9
- package/src/components/CvDatePicker/CvDatePicker.vue +10 -10
- package/src/components/CvDatePicker/CvDatePickerSkeleton.vue +3 -3
- package/src/components/CvDropdown/CvDropdown.vue +7 -9
- package/src/components/CvDropdown/CvDropdownItem.vue +1 -1
- package/src/components/CvFileUploader/CvFileUploader.vue +7 -7
- package/src/components/CvFileUploader/CvFileUploaderItem.vue +1 -1
- package/src/components/CvForm/CvFormGroup.vue +2 -2
- package/src/components/CvGrid/CvColumn.vue +5 -0
- package/src/components/CvLink/CvLink.vue +1 -1
- package/src/components/CvLoading/CvLoading.stories.js +1 -1
- package/src/components/CvLoading/CvLoading.vue +1 -1
- package/src/components/CvModal/CvModal.vue +19 -19
- package/src/components/CvMultiSelect/CvMultiSelect.vue +4 -4
- package/src/components/CvNotification/CvToastNotification.stories.js +12 -15
- package/src/components/CvNotification/CvToastNotification.vue +1 -1
- package/src/components/CvNumberInput/CvNumberInput.vue +3 -6
- package/src/components/CvOverflowMenu/CvOverflowMenu.vue +11 -10
- package/src/components/CvOverflowMenu/CvOverflowMenuItem.vue +1 -1
- package/src/components/CvPagination/CvPagination.vue +11 -15
- package/src/components/CvProgress/CvProgress.vue +1 -1
- package/src/components/CvProgress/CvProgressStep.vue +5 -5
- package/src/components/CvRadioButton/CvRadioButton.vue +3 -3
- package/src/components/CvSearch/CvSearch.vue +11 -10
- package/src/components/CvSelect/CvSelect.vue +1 -1
- package/src/components/CvSlider/CvSlider.vue +7 -7
- package/src/components/CvSlider/__tests__/__snapshots__/CvSlider.spec.js.snap +1 -1
- package/src/components/CvStructuredList/CvStructuredListItem.vue +3 -3
- package/src/components/CvStructuredList/CvStructuredListItemSelectable.vue +1 -1
- package/src/components/CvStructuredList/__tests__/__snapshots__/CvStructuredListItem.spec.js.snap +3 -3
- package/src/components/CvSvg/__tests__/_TestIcon.vue +2 -2
- package/src/components/CvTabs/CvTab.vue +1 -1
- package/src/components/CvTabs/CvTabs.vue +12 -12
- package/src/components/CvTabs/__tests__/__snapshots__/CvTabs.spec.js.snap +6 -6
- package/src/components/CvTag/CvTag.stories.js +1 -1
- package/src/components/CvTag/CvTag.vue +1 -1
- package/src/components/CvTextArea/CvTextArea.vue +6 -6
- package/src/components/CvTextInput/CvTextInput.stories.js +28 -16
- package/src/components/CvTextInput/CvTextInput.vue +37 -7
- package/src/components/CvTextInput/CvTextInputSkeleton.vue +17 -0
- package/src/components/CvTextInput/index.js +2 -1
- package/src/components/CvTile/CvTile.vue +3 -3
- package/src/components/CvTile/CvTileExpandable.vue +7 -7
- package/src/components/CvTile/CvTileSelectable.vue +2 -2
- package/src/components/CvTimePicker/CvTimePicker.vue +1 -1
- package/src/components/CvTooltip/CvDefinitionTooltip.vue +2 -2
- package/src/components/CvTooltip/CvInteractiveTooltip.vue +6 -6
- package/src/components/CvTooltip/__tests__/__snapshots__/CvTooltip.spec.js.snap +14 -14
- package/src/components/CvUIShell/CvHeader.vue +1 -1
- package/src/components/CvUIShell/CvHeaderGlobalAction.vue +7 -7
- package/src/components/CvUIShell/CvHeaderMenu.vue +3 -3
- package/src/components/CvUIShell/CvHeaderMenuButton.vue +2 -2
- package/src/components/CvUIShell/CvHeaderMenuItem.vue +2 -2
- package/src/components/CvUIShell/CvHeaderName.vue +1 -1
- package/src/components/CvUIShell/CvHeaderNav.vue +1 -1
- package/src/components/CvUIShell/CvHeaderPanel.vue +3 -2
- package/src/components/CvUIShell/CvSideNav.vue +5 -4
- package/src/components/CvUIShell/CvSideNavItems.vue +1 -1
- package/src/components/CvUIShell/CvSideNavLink.vue +1 -1
- package/src/components/CvUIShell/_CvSideNavFooter.vue +2 -1
package/package.json
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/vue",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.10",
|
|
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
|
+
"web-types": "dist/web-types.json",
|
|
9
10
|
"scripts": {
|
|
10
11
|
"_postinstall": "node prepare.js",
|
|
11
12
|
"prepack": "pinst --disable",
|
|
12
13
|
"postpack": "pinst --enable",
|
|
13
14
|
"build": "vue-cli-service build --target lib --name carbon-vue-3 ./src/index.js --no-clean",
|
|
14
15
|
"lint": "vue-cli-service lint",
|
|
15
|
-
"
|
|
16
|
+
"build-web-types": "vue-docgen-web-types --outFile dist/web-types.json",
|
|
17
|
+
"ci-check": "yarn format:diff && yarn test && yarn build && yarn build-web-types",
|
|
16
18
|
"format": "prettier --write '**/*.{scss,css,js,md,vue}' '!**/{build,es,lib,storybook,ts,umd,.coverage}/**'",
|
|
17
19
|
"format:diff": "prettier --list-different '**/*.{scss,css,js,md,vue}' '!**/{dist,storybook-static,.coverage}/**'",
|
|
18
20
|
"format:staged": "prettier --write '**/*.{scss,css,js,md,vue}' '!**/{dist,storybook-static,.coverage}/**'",
|
|
@@ -20,8 +22,7 @@
|
|
|
20
22
|
"lint:es": "eslint src/**/*.{js,vue}",
|
|
21
23
|
"lint:style": "vue-cli-service lint:style",
|
|
22
24
|
"serve:storybook": "cd ./storybook && yarn run serve",
|
|
23
|
-
"test": "vue-cli-service test:unit --no-coverage"
|
|
24
|
-
"a11test": "node -v"
|
|
25
|
+
"test": "vue-cli-service test:unit --no-coverage"
|
|
25
26
|
},
|
|
26
27
|
"workspaces": [
|
|
27
28
|
"storybook"
|
|
@@ -50,6 +51,7 @@
|
|
|
50
51
|
"@vue/eslint-config-prettier": "^7.0.0",
|
|
51
52
|
"@vue/test-utils": "^2.2.4",
|
|
52
53
|
"@vue/vue3-jest": "^27.0.0",
|
|
54
|
+
"accessibility-checker": "^3.1.59",
|
|
53
55
|
"babel-core": "^6.26.3",
|
|
54
56
|
"babel-jest": "^27.5.1",
|
|
55
57
|
"babel-loader": "^8.3.0",
|
|
@@ -74,6 +76,7 @@
|
|
|
74
76
|
"stylelint-config-property-sort-order-smacss": "^9.0.0",
|
|
75
77
|
"stylelint-config-sass-guidelines": "^9.0.1",
|
|
76
78
|
"vue": "^3.3.4",
|
|
79
|
+
"vue-docgen-web-types": "^0.1.8",
|
|
77
80
|
"vue-loader": "^17.0.1",
|
|
78
81
|
"webpack": "^5.75.0"
|
|
79
82
|
},
|
|
@@ -83,9 +86,9 @@
|
|
|
83
86
|
"node": true
|
|
84
87
|
},
|
|
85
88
|
"extends": [
|
|
86
|
-
"plugin:vue/vue3-essential",
|
|
87
89
|
"eslint:recommended",
|
|
88
|
-
"
|
|
90
|
+
"plugin:vue/vue3-recommended",
|
|
91
|
+
"plugin:prettier-vue/recommended"
|
|
89
92
|
],
|
|
90
93
|
"rules": {
|
|
91
94
|
"no-console": [
|
|
@@ -145,41 +148,6 @@
|
|
|
145
148
|
"last 2 versions",
|
|
146
149
|
"not dead"
|
|
147
150
|
],
|
|
148
|
-
"jest": {
|
|
149
|
-
"collectCoverage": true,
|
|
150
|
-
"collectCoverageFrom": [
|
|
151
|
-
"src/*/**/*.{js,vue}",
|
|
152
|
-
"!**/node_modules/**",
|
|
153
|
-
"!**/*.stories.js",
|
|
154
|
-
"!**/*.spec.js",
|
|
155
|
-
"!**/*.test.js"
|
|
156
|
-
],
|
|
157
|
-
"coverageThreshold": {
|
|
158
|
-
"global": {
|
|
159
|
-
"branches": 100,
|
|
160
|
-
"functions": 100,
|
|
161
|
-
"lines": 100,
|
|
162
|
-
"statements": 0
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
"preset": "@vue/cli-plugin-unit-jest",
|
|
166
|
-
"transform": {
|
|
167
|
-
"^.+\\.vue$": "@vue/vue3-jest",
|
|
168
|
-
"^.+\\js$": "babel-jest"
|
|
169
|
-
},
|
|
170
|
-
"transformIgnorePatterns": [
|
|
171
|
-
"/node_modules/(?!@carbon)"
|
|
172
|
-
],
|
|
173
|
-
"moduleFileExtensions": [
|
|
174
|
-
"vue",
|
|
175
|
-
"js",
|
|
176
|
-
"json",
|
|
177
|
-
"jsx",
|
|
178
|
-
"ts",
|
|
179
|
-
"tsx",
|
|
180
|
-
"node"
|
|
181
|
-
]
|
|
182
|
-
},
|
|
183
151
|
"directories": {
|
|
184
152
|
"src": "src",
|
|
185
153
|
"test": "__tests__"
|
|
@@ -206,5 +174,5 @@
|
|
|
206
174
|
"url": "git+https://github.com/carbon-design-system/carbon-components-vue.git"
|
|
207
175
|
},
|
|
208
176
|
"sideEffects": true,
|
|
209
|
-
"gitHead": "
|
|
177
|
+
"gitHead": "337cb41677bb308c20c43938f3485faaf7db87c0"
|
|
210
178
|
}
|
|
@@ -48,7 +48,7 @@ export default {
|
|
|
48
48
|
},
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
const template = `<cv-button @click="onClick" v-bind="args">{{slotArgs.default}}</cv-button>`;
|
|
51
|
+
const template = `<cv-button @click="onClick" aria-label="button story" v-bind="args">{{slotArgs.default}}</cv-button>`;
|
|
52
52
|
const Template = (argsIn, { argTypes }) => {
|
|
53
53
|
let { args, slotArgs } = splitSlotArgs(argsIn, ['default']);
|
|
54
54
|
args = { ...args, icon: icons[args.icon] };
|
|
@@ -27,8 +27,7 @@ const { disabled, icon, kind, size } = commonCvButtonProps;
|
|
|
27
27
|
|
|
28
28
|
export default {
|
|
29
29
|
name: 'CvButton',
|
|
30
|
-
components: { CvSvg },
|
|
31
|
-
emits: ['click'], // emitted to allow testing of click
|
|
30
|
+
components: { CvSvg }, // emitted to allow testing of click
|
|
32
31
|
props: {
|
|
33
32
|
// Docgen comments added for storybook doc page
|
|
34
33
|
/**
|
|
@@ -52,6 +51,7 @@ export default {
|
|
|
52
51
|
*/
|
|
53
52
|
skeleton: Boolean,
|
|
54
53
|
},
|
|
54
|
+
emits: ['click'],
|
|
55
55
|
setup(props) {
|
|
56
56
|
const { buttonClasses } = useCvButtonCommon(
|
|
57
57
|
props.kind,
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
storybookControlsFromProps,
|
|
7
7
|
storyParametersObject,
|
|
8
8
|
} from '../../global/storybook-utils';
|
|
9
|
+
import { TipAlignments } from '../CvTooltip/consts.js';
|
|
9
10
|
import { sbBtnPrefix } from './sbBtnPrefix';
|
|
10
11
|
|
|
11
12
|
import { props as commonCvButtonProps } from './CvButtonCommon';
|
|
@@ -32,28 +33,24 @@ export default {
|
|
|
32
33
|
component: CvIconButton,
|
|
33
34
|
argTypes: {
|
|
34
35
|
...storybookControlsFromProps(commonCvButtonProps),
|
|
35
|
-
/**
|
|
36
|
-
* \@carbon/icons-vue icon, href, svg or symbol
|
|
37
|
-
*/
|
|
38
36
|
icon: {
|
|
39
|
-
control:
|
|
40
|
-
|
|
41
|
-
options: Object.keys(icons),
|
|
42
|
-
},
|
|
37
|
+
control: 'select',
|
|
38
|
+
options: Object.keys(icons),
|
|
43
39
|
},
|
|
44
|
-
/**
|
|
45
|
-
* Carbon button kind
|
|
46
|
-
*/
|
|
47
40
|
kind: {
|
|
48
|
-
control:
|
|
49
|
-
|
|
41
|
+
control: 'select',
|
|
42
|
+
options: buttonKinds,
|
|
43
|
+
default: CvIconButton.props.kind.default,
|
|
50
44
|
},
|
|
51
|
-
/**
|
|
52
|
-
* Size of the button
|
|
53
|
-
*/
|
|
54
45
|
size: {
|
|
55
|
-
control:
|
|
56
|
-
|
|
46
|
+
control: 'select',
|
|
47
|
+
options: buttonSizes,
|
|
48
|
+
default: CvIconButton.props.size.default,
|
|
49
|
+
},
|
|
50
|
+
tipAlignment: {
|
|
51
|
+
control: 'select',
|
|
52
|
+
options: Object.values(TipAlignments),
|
|
53
|
+
default: CvIconButton.props.tipAlignment.default,
|
|
57
54
|
},
|
|
58
55
|
},
|
|
59
56
|
};
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<span :class="`${carbonPrefix}--assistive-text`">{{ label }}</span>
|
|
14
14
|
|
|
15
15
|
<slot name="icon">
|
|
16
|
-
<cv-svg :svg="icon" :class="`${carbonPrefix}--btn__icon`" />
|
|
16
|
+
<cv-svg alt="" :svg="icon" :class="`${carbonPrefix}--btn__icon`" />
|
|
17
17
|
</slot>
|
|
18
18
|
</button>
|
|
19
19
|
</template>
|
|
@@ -24,14 +24,14 @@ import {
|
|
|
24
24
|
props as commonCvButtonProps,
|
|
25
25
|
useCvButtonCommon,
|
|
26
26
|
} from './CvButtonCommon';
|
|
27
|
+
import { TipAlignments } from '../CvTooltip/consts.js';
|
|
27
28
|
import CvSvg from '../CvSvg/_CvSvg.vue';
|
|
28
29
|
|
|
29
30
|
const { disabled, icon, kind, size } = commonCvButtonProps;
|
|
30
31
|
|
|
31
32
|
export default {
|
|
32
33
|
name: 'CvIconButton',
|
|
33
|
-
components: { CvSvg },
|
|
34
|
-
emits: ['click'], // emitted to allow testing of click
|
|
34
|
+
components: { CvSvg }, // emitted to allow testing of click
|
|
35
35
|
props: {
|
|
36
36
|
// Docgen comments added for storybook doc page
|
|
37
37
|
/**
|
|
@@ -39,7 +39,7 @@ export default {
|
|
|
39
39
|
*/
|
|
40
40
|
disabled,
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
42
|
+
* @carbon/icons-vue icon, href, svg or symbol
|
|
43
43
|
*/
|
|
44
44
|
icon,
|
|
45
45
|
/**
|
|
@@ -47,9 +47,9 @@ export default {
|
|
|
47
47
|
*/
|
|
48
48
|
kind,
|
|
49
49
|
/**
|
|
50
|
-
* label displayed as a tooltip for the icon
|
|
50
|
+
* label displayed as a tooltip for the icon. This is required for accessibility.
|
|
51
51
|
*/
|
|
52
|
-
label: { type: String, default: undefined },
|
|
52
|
+
label: { type: String, default: undefined, required: true },
|
|
53
53
|
/**
|
|
54
54
|
* Size of the button
|
|
55
55
|
*/
|
|
@@ -68,9 +68,10 @@ export default {
|
|
|
68
68
|
tipAlignment: {
|
|
69
69
|
type: String,
|
|
70
70
|
default: 'center',
|
|
71
|
-
validator: val =>
|
|
71
|
+
validator: val => Object.values(TipAlignments).includes(val),
|
|
72
72
|
},
|
|
73
73
|
},
|
|
74
|
+
emits: ['click'],
|
|
74
75
|
setup(props) {
|
|
75
76
|
const { buttonClasses } = useCvButtonCommon(
|
|
76
77
|
props.kind,
|
|
@@ -7,17 +7,18 @@
|
|
|
7
7
|
]"
|
|
8
8
|
>
|
|
9
9
|
<input
|
|
10
|
-
ref="input"
|
|
11
10
|
v-bind="$attrs"
|
|
11
|
+
:id="cvId"
|
|
12
|
+
ref="input"
|
|
12
13
|
type="checkbox"
|
|
13
14
|
:class="`${carbonPrefix}--checkbox`"
|
|
14
15
|
:checked="isChecked === true"
|
|
15
16
|
:aria-checked="`${isChecked}`"
|
|
17
|
+
:value="value"
|
|
18
|
+
:disabled="disabled || null"
|
|
16
19
|
@focus="onFocus"
|
|
17
20
|
@blur="onBlur"
|
|
18
21
|
@change="onChange"
|
|
19
|
-
:value="value"
|
|
20
|
-
:id="cvId"
|
|
21
22
|
/><label
|
|
22
23
|
:for="cvId"
|
|
23
24
|
:class="[
|
|
@@ -17,6 +17,11 @@ import CviCodeSnippetMultiline from './_CviCodeSnippetMultiline.vue';
|
|
|
17
17
|
|
|
18
18
|
export default {
|
|
19
19
|
name: 'CvCodeSnippet',
|
|
20
|
+
components: {
|
|
21
|
+
CviCodeSnippetInline,
|
|
22
|
+
CviCodeSnippetOneline,
|
|
23
|
+
CviCodeSnippetMultiline,
|
|
24
|
+
},
|
|
20
25
|
props: {
|
|
21
26
|
/** Type of code snippet */
|
|
22
27
|
kind: {
|
|
@@ -90,11 +95,6 @@ export default {
|
|
|
90
95
|
default: 16,
|
|
91
96
|
},
|
|
92
97
|
},
|
|
93
|
-
components: {
|
|
94
|
-
CviCodeSnippetInline,
|
|
95
|
-
CviCodeSnippetOneline,
|
|
96
|
-
CviCodeSnippetMultiline,
|
|
97
|
-
},
|
|
98
98
|
emits: [
|
|
99
99
|
/** Emitted when user uses the copy function */
|
|
100
100
|
'copy',
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
<cvi-copy-button
|
|
6
6
|
v-else
|
|
7
7
|
:class="classes"
|
|
8
|
-
@copy="handleCopy"
|
|
9
8
|
:feedback="copyFeedback"
|
|
10
9
|
:feedback-timeout="copyFeedbackTimeout"
|
|
11
10
|
:aria-describedby="codeId"
|
|
11
|
+
@copy="handleCopy"
|
|
12
12
|
>
|
|
13
13
|
<code :id="codeId" ref="text"><slot /></code>
|
|
14
14
|
</cvi-copy-button>
|
|
@@ -21,6 +21,7 @@ import { useCvId } from '../../use';
|
|
|
21
21
|
import CviCopyButton from '../CvCopyButton/_CviCopyButton.vue';
|
|
22
22
|
|
|
23
23
|
export default {
|
|
24
|
+
components: { CviCopyButton },
|
|
24
25
|
props: {
|
|
25
26
|
/** Text shown to user when copying code */
|
|
26
27
|
copyFeedback: {
|
|
@@ -44,7 +45,6 @@ export default {
|
|
|
44
45
|
},
|
|
45
46
|
},
|
|
46
47
|
emits: ['copy'],
|
|
47
|
-
components: { CviCopyButton },
|
|
48
48
|
setup(props, { emit }) {
|
|
49
49
|
const codeId = useCvId();
|
|
50
50
|
const classes = computed(() => [
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
:feedback="copyFeedback"
|
|
33
33
|
:feedback-timeout="copyFeedbackTimeout"
|
|
34
34
|
:icon-description="ariaLabel"
|
|
35
|
-
@copy="handleCopy"
|
|
36
35
|
:disabled="disabled"
|
|
36
|
+
@copy="handleCopy"
|
|
37
37
|
/>
|
|
38
38
|
<cv-button
|
|
39
39
|
v-if="showMoreLessButton"
|
|
@@ -67,6 +67,11 @@ import { ChevronDown16 } from '@carbon/icons-vue';
|
|
|
67
67
|
const ROW_HEIGHT_IN_PX = 16;
|
|
68
68
|
|
|
69
69
|
export default {
|
|
70
|
+
components: {
|
|
71
|
+
CvCopyButton,
|
|
72
|
+
CvButton,
|
|
73
|
+
ChevronDown16,
|
|
74
|
+
},
|
|
70
75
|
props: {
|
|
71
76
|
/** Text shown to user when copying code */
|
|
72
77
|
copyFeedback: {
|
|
@@ -135,11 +140,6 @@ export default {
|
|
|
135
140
|
},
|
|
136
141
|
},
|
|
137
142
|
emits: ['copy'],
|
|
138
|
-
components: {
|
|
139
|
-
CvCopyButton,
|
|
140
|
-
CvButton,
|
|
141
|
-
ChevronDown16,
|
|
142
|
-
},
|
|
143
143
|
setup: (props, { emit }) => {
|
|
144
144
|
const {
|
|
145
145
|
minCollapsedNumberOfRows: minCollapsed,
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
]"
|
|
12
12
|
>
|
|
13
13
|
<div
|
|
14
|
+
ref="container"
|
|
14
15
|
role="textbox"
|
|
15
16
|
:tabindex="disabled ? -1 : 0"
|
|
16
17
|
:class="`${carbonPrefix}--snippet-container`"
|
|
17
18
|
:aria-label="ariaLabel || 'code-snippet'"
|
|
18
|
-
ref="container"
|
|
19
19
|
>
|
|
20
20
|
<pre><code ref="text"><slot /></code></pre>
|
|
21
21
|
</div>
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
:feedback="copyFeedback"
|
|
33
33
|
:feedback-timeout="copyFeedbackTimeout"
|
|
34
34
|
:icon-description="ariaLabel"
|
|
35
|
-
@copy="handleCopy"
|
|
36
35
|
:disabled="disabled"
|
|
36
|
+
@copy="handleCopy"
|
|
37
37
|
/>
|
|
38
38
|
</div>
|
|
39
39
|
</template>
|
|
@@ -45,6 +45,7 @@ import { useElementHasOverflow } from '../../use/overflow';
|
|
|
45
45
|
import CvCopyButton from '../CvCopyButton/CvCopyButton.vue';
|
|
46
46
|
|
|
47
47
|
export default {
|
|
48
|
+
components: { CvCopyButton },
|
|
48
49
|
props: {
|
|
49
50
|
/** Text shown to user when copying code */
|
|
50
51
|
copyFeedback: {
|
|
@@ -83,7 +84,6 @@ export default {
|
|
|
83
84
|
},
|
|
84
85
|
},
|
|
85
86
|
emits: ['copy'],
|
|
86
|
-
components: { CvCopyButton },
|
|
87
87
|
setup: (props, { emit }) => {
|
|
88
88
|
const text = ref(null);
|
|
89
89
|
const container = ref(null);
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
[`${carbonPrefix}--list-box--disabled`]: disabled,
|
|
27
27
|
},
|
|
28
28
|
]"
|
|
29
|
-
:data-invalid="isInvalid
|
|
29
|
+
:data-invalid="isInvalid || null"
|
|
30
30
|
v-bind="$attrs"
|
|
31
31
|
@keydown.down.prevent="onDown"
|
|
32
32
|
@keydown.up.prevent="onUp"
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
@click="onClick"
|
|
36
36
|
>
|
|
37
37
|
<div
|
|
38
|
+
ref="button"
|
|
38
39
|
role="button"
|
|
39
40
|
aria-haspopup="true"
|
|
40
41
|
:aria-expanded="open ? 'true' : 'false'"
|
|
@@ -44,10 +45,10 @@
|
|
|
44
45
|
tabindex="-1"
|
|
45
46
|
:aria-label="open ? 'close menu' : 'open menu'"
|
|
46
47
|
data-toggle="true"
|
|
47
|
-
ref="button"
|
|
48
48
|
>
|
|
49
49
|
<input
|
|
50
50
|
ref="input"
|
|
51
|
+
v-model="filter"
|
|
51
52
|
:class="[
|
|
52
53
|
`${carbonPrefix}--text-input`,
|
|
53
54
|
{
|
|
@@ -63,7 +64,6 @@
|
|
|
63
64
|
autocomplete="off"
|
|
64
65
|
:disabled="disabled"
|
|
65
66
|
:placeholder="label"
|
|
66
|
-
v-model="filter"
|
|
67
67
|
@input="onInput"
|
|
68
68
|
@focus="inputFocus"
|
|
69
69
|
@click.stop.prevent="inputClick"
|
|
@@ -107,13 +107,14 @@
|
|
|
107
107
|
<div
|
|
108
108
|
v-show="open"
|
|
109
109
|
:id="cvId"
|
|
110
|
+
ref="list"
|
|
110
111
|
:class="[`${carbonPrefix}--list-box__menu`]"
|
|
111
112
|
role="listbox"
|
|
112
|
-
ref="list"
|
|
113
113
|
>
|
|
114
114
|
<div
|
|
115
115
|
v-for="(item, index) in dataOptions"
|
|
116
116
|
:key="`combo-box-${index}`"
|
|
117
|
+
ref="option"
|
|
117
118
|
:class="[
|
|
118
119
|
`${carbonPrefix}--list-box__menu-item`,
|
|
119
120
|
{
|
|
@@ -121,7 +122,6 @@
|
|
|
121
122
|
highlighted === item.value,
|
|
122
123
|
},
|
|
123
124
|
]"
|
|
124
|
-
ref="option"
|
|
125
125
|
role="option"
|
|
126
126
|
@click.stop.prevent="onItemClick(item.value)"
|
|
127
127
|
@mousemove="onMousemove(item.value)"
|
|
@@ -172,9 +172,9 @@ const props = defineProps({
|
|
|
172
172
|
isLight: { type: Boolean, default: false },
|
|
173
173
|
autoFilter: { type: Boolean, default: false },
|
|
174
174
|
autoHighlight: { type: Boolean, default: false },
|
|
175
|
-
value: { type: String },
|
|
176
|
-
highlight: { type: String },
|
|
177
|
-
modelValue: { type: String },
|
|
175
|
+
value: { type: String, default: undefined },
|
|
176
|
+
highlight: { type: String, default: undefined },
|
|
177
|
+
modelValue: { type: String, default: undefined },
|
|
178
178
|
options: {
|
|
179
179
|
type: Array,
|
|
180
180
|
required: true,
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
-->
|
|
12
12
|
<template>
|
|
13
13
|
<button
|
|
14
|
+
:id="cvId"
|
|
14
15
|
type="button"
|
|
15
16
|
role="tab"
|
|
16
17
|
class="cv-content-switcher-button"
|
|
@@ -22,7 +23,6 @@
|
|
|
22
23
|
]"
|
|
23
24
|
:data-target="contentSelector"
|
|
24
25
|
:aria-selected="isSelected ? 'true' : 'false'"
|
|
25
|
-
:id="cvId"
|
|
26
26
|
@click="open"
|
|
27
27
|
>
|
|
28
28
|
<CvSvg
|
|
@@ -18,6 +18,7 @@ import CviCopyButton from './_CviCopyButton.vue';
|
|
|
18
18
|
|
|
19
19
|
export default {
|
|
20
20
|
name: 'CvCopyButton',
|
|
21
|
+
components: { CviCopyButton, Copy16 },
|
|
21
22
|
props: {
|
|
22
23
|
/** Text shown when button is clicked */
|
|
23
24
|
feedback: {
|
|
@@ -39,7 +40,6 @@ export default {
|
|
|
39
40
|
/** Emitted when user clicks on the button */
|
|
40
41
|
'copy',
|
|
41
42
|
],
|
|
42
|
-
components: { CviCopyButton, Copy16 },
|
|
43
43
|
setup: () => ({ carbonPrefix }),
|
|
44
44
|
};
|
|
45
45
|
</script>
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
[`${carbonPrefix}--copy-btn--${activeAnimation}`]: isAnimating,
|
|
9
9
|
},
|
|
10
10
|
]"
|
|
11
|
-
@click="handleClick"
|
|
12
|
-
@animationend="handleAnimationEnd"
|
|
13
11
|
aria-live="polite"
|
|
14
12
|
:aria-label="feedback"
|
|
13
|
+
@click="handleClick"
|
|
14
|
+
@animationend="handleAnimationEnd"
|
|
15
15
|
>
|
|
16
16
|
<slot />
|
|
17
17
|
{{ feedback }}
|