@carbon/vue 3.0.9 → 3.0.11
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 +1 -1
- package/dist/carbon-vue-3.common.js +19642 -19310
- 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 +19721 -19389
- 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/package.json +11 -43
- 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 +9 -9
- 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.stories.mdx +7 -66
- package/src/components/CvDropdown/CvDropdown.vue +13 -26
- package/src/components/CvDropdown/CvDropdownItem.vue +2 -2
- package/src/components/CvFileUploader/CvFileUploader.stories.mdx +79 -14
- package/src/components/CvFileUploader/CvFileUploader.vue +7 -7
- package/src/components/CvFileUploader/CvFileUploaderItem.vue +9 -8
- package/src/components/CvForm/CvFormGroup.vue +2 -2
- package/src/components/CvGrid/CvColumn.vue +5 -0
- package/src/components/CvLink/CvLink.vue +7 -2
- package/src/components/CvLoading/CvLoading.stories.js +1 -1
- package/src/components/CvLoading/CvLoading.vue +2 -2
- package/src/components/CvModal/CvModal.vue +19 -19
- package/src/components/CvMultiSelect/CvMultiSelect.stories.mdx +8 -18
- package/src/components/CvMultiSelect/CvMultiSelect.vue +17 -22
- 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.stories.mdx +23 -1
- package/src/components/CvProgress/CvProgress.vue +1 -1
- package/src/components/CvProgress/CvProgressSkeleton.vue +37 -0
- package/src/components/CvProgress/CvProgressStep.vue +6 -6
- package/src/components/CvProgress/index.js +3 -1
- package/src/components/CvRadioButton/CvRadioButton.vue +3 -3
- package/src/components/CvSearch/CvSearch.stories.mdx +4 -13
- package/src/components/CvSearch/CvSearch.vue +17 -28
- 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 +13 -13
- 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 +7 -7
- 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
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
storyParametersObject,
|
|
4
4
|
} from '../../global/storybook-utils';
|
|
5
5
|
|
|
6
|
-
import CvTextInput from '.';
|
|
6
|
+
import { CvTextInput, CvTextInputSkeleton } from '.';
|
|
7
7
|
import { ref } from 'vue';
|
|
8
8
|
|
|
9
9
|
export default {
|
|
@@ -34,8 +34,6 @@ export default {
|
|
|
34
34
|
type: { summary: 'string' },
|
|
35
35
|
category: 'props',
|
|
36
36
|
},
|
|
37
|
-
description:
|
|
38
|
-
'Provide text that is used alongside the control label for additional help',
|
|
39
37
|
},
|
|
40
38
|
hideLabel: {
|
|
41
39
|
type: 'boolean',
|
|
@@ -44,8 +42,6 @@ export default {
|
|
|
44
42
|
category: 'props',
|
|
45
43
|
defaultValue: false,
|
|
46
44
|
},
|
|
47
|
-
description:
|
|
48
|
-
'Specify whether you want the underlying label to be visually hidden',
|
|
49
45
|
},
|
|
50
46
|
invalidMessage: {
|
|
51
47
|
type: 'string',
|
|
@@ -53,8 +49,6 @@ export default {
|
|
|
53
49
|
type: { summary: 'string' },
|
|
54
50
|
category: 'props',
|
|
55
51
|
},
|
|
56
|
-
description:
|
|
57
|
-
'Provide the text that is displayed when the control is in an invalid state',
|
|
58
52
|
},
|
|
59
53
|
label: {
|
|
60
54
|
type: 'string',
|
|
@@ -62,7 +56,6 @@ export default {
|
|
|
62
56
|
type: { summary: 'string' },
|
|
63
57
|
category: 'props',
|
|
64
58
|
},
|
|
65
|
-
description: "Input's label",
|
|
66
59
|
},
|
|
67
60
|
light: {
|
|
68
61
|
type: 'boolean',
|
|
@@ -80,8 +73,6 @@ export default {
|
|
|
80
73
|
type: { summary: 'string' },
|
|
81
74
|
category: 'props',
|
|
82
75
|
},
|
|
83
|
-
description:
|
|
84
|
-
"Input's value, modelValue is the vue3 default 'prop' for two-way data binding with v-model",
|
|
85
76
|
},
|
|
86
77
|
passwordHideLabel: {
|
|
87
78
|
type: 'string',
|
|
@@ -89,7 +80,6 @@ export default {
|
|
|
89
80
|
type: { summary: 'string' },
|
|
90
81
|
category: 'props',
|
|
91
82
|
},
|
|
92
|
-
description: '"Hide password" tooltip text on password visibility toggle',
|
|
93
83
|
},
|
|
94
84
|
passwordShowLabel: {
|
|
95
85
|
type: 'string',
|
|
@@ -97,7 +87,6 @@ export default {
|
|
|
97
87
|
type: { summary: 'string' },
|
|
98
88
|
category: 'props',
|
|
99
89
|
},
|
|
100
|
-
description: '"Show password" tooltip text on password visibility toggle',
|
|
101
90
|
},
|
|
102
91
|
passwordVisible: {
|
|
103
92
|
type: 'boolean',
|
|
@@ -105,7 +94,6 @@ export default {
|
|
|
105
94
|
type: { summary: 'boolean' },
|
|
106
95
|
category: 'props',
|
|
107
96
|
},
|
|
108
|
-
description: 'Toggle password visibility.',
|
|
109
97
|
},
|
|
110
98
|
type: {
|
|
111
99
|
type: 'string',
|
|
@@ -118,7 +106,6 @@ export default {
|
|
|
118
106
|
control: {
|
|
119
107
|
type: 'select',
|
|
120
108
|
},
|
|
121
|
-
description: 'Input type, only `text` and `password` are available',
|
|
122
109
|
},
|
|
123
110
|
warnText: {
|
|
124
111
|
type: 'string',
|
|
@@ -126,8 +113,6 @@ export default {
|
|
|
126
113
|
type: { summary: 'string' },
|
|
127
114
|
category: 'props',
|
|
128
115
|
},
|
|
129
|
-
description:
|
|
130
|
-
'Provide the text that is displayed when the control is in warning state',
|
|
131
116
|
},
|
|
132
117
|
// slots
|
|
133
118
|
'helper-text': {
|
|
@@ -171,11 +156,13 @@ export default {
|
|
|
171
156
|
};
|
|
172
157
|
|
|
173
158
|
const template = `
|
|
159
|
+
<form @submit.prevent='()=>{}'>
|
|
174
160
|
<cv-text-input v-bind="args">
|
|
175
161
|
<template v-if="args['helper-text']" v-slot:helper-text />
|
|
176
162
|
<template v-if="args['warn-text']" v-slot:warn-text />
|
|
177
163
|
<template v-if="args['invalid-message']" v-slot:invalid-message />
|
|
178
164
|
</cv-text-input>
|
|
165
|
+
</form>
|
|
179
166
|
`;
|
|
180
167
|
const Template = args => {
|
|
181
168
|
return {
|
|
@@ -191,6 +178,7 @@ Default.args = {
|
|
|
191
178
|
label: 'Text input label',
|
|
192
179
|
placeholder: 'Sample placeholder',
|
|
193
180
|
};
|
|
181
|
+
|
|
194
182
|
Default.parameters = storyParametersObject(
|
|
195
183
|
Default.parameters,
|
|
196
184
|
template,
|
|
@@ -237,9 +225,33 @@ export const Password = Template.bind({});
|
|
|
237
225
|
Password.args = {
|
|
238
226
|
label: 'Password input label',
|
|
239
227
|
type: 'password',
|
|
228
|
+
autocomplete: 'password',
|
|
240
229
|
};
|
|
241
230
|
Password.parameters = storyParametersObject(
|
|
242
231
|
Password.parameters,
|
|
243
232
|
template,
|
|
244
233
|
Password.args
|
|
245
234
|
);
|
|
235
|
+
|
|
236
|
+
const templateSkeleton = `<cv-text-input-skeleton v-bind='args'/>`;
|
|
237
|
+
const TemplateSkeleton = args => {
|
|
238
|
+
return {
|
|
239
|
+
components: { CvTextInputSkeleton },
|
|
240
|
+
setup: () => ({ args }),
|
|
241
|
+
template: templateSkeleton,
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
export const Skeleton = TemplateSkeleton.bind({});
|
|
246
|
+
|
|
247
|
+
Skeleton.parameters = {
|
|
248
|
+
controls: {
|
|
249
|
+
include: ['hideLabel'],
|
|
250
|
+
},
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
Skeleton.parameters = storyParametersObject(
|
|
254
|
+
Skeleton.parameters,
|
|
255
|
+
templateSkeleton,
|
|
256
|
+
Skeleton.args
|
|
257
|
+
);
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
`${carbonPrefix}--text-input__field-wrapper`,
|
|
25
25
|
{ [`${carbonPrefix}--text-input__field-wrapper--warning`]: isWarn },
|
|
26
26
|
]"
|
|
27
|
-
:data-invalid="isInvalid"
|
|
27
|
+
:data-invalid="isInvalid || null"
|
|
28
28
|
>
|
|
29
29
|
<WarningFilled16
|
|
30
30
|
v-if="isInvalid"
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
:class="`${carbonPrefix}--text-input__invalid-icon ${carbonPrefix}--text-input__invalid-icon--warning`"
|
|
36
36
|
/>
|
|
37
37
|
<input
|
|
38
|
-
ref="input"
|
|
39
38
|
:id="cvId"
|
|
39
|
+
ref="input"
|
|
40
40
|
:class="[
|
|
41
41
|
`${carbonPrefix}--text-input`,
|
|
42
42
|
{
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
v-bind="$attrs"
|
|
50
50
|
:type="dataType"
|
|
51
51
|
:value="modelValue"
|
|
52
|
-
:data-toggle-password-visibility="isPassword"
|
|
52
|
+
:data-toggle-password-visibility="isPassword || null"
|
|
53
53
|
@input="$event => $emit('update:modelValue', $event.target.value)"
|
|
54
54
|
/>
|
|
55
55
|
<button
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
`${carbonPrefix}--tooltip--align-center`,
|
|
65
65
|
{ [`${carbonPrefix}--btn--disabled`]: $attrs.disabled },
|
|
66
66
|
]"
|
|
67
|
-
@click="togglePasswordVisibility"
|
|
68
67
|
type="button"
|
|
69
68
|
:disabled="$attrs.disabled"
|
|
69
|
+
@click="togglePasswordVisibility"
|
|
70
70
|
>
|
|
71
71
|
<span :class="`${carbonPrefix}--assistive-text`">
|
|
72
72
|
{{ passwordHideShowLabel }}
|
|
@@ -118,24 +118,54 @@ import { useIsLight, props as propsTheme } from '../../use/cvTheme';
|
|
|
118
118
|
import { inputTypes } from './const';
|
|
119
119
|
|
|
120
120
|
const props = defineProps({
|
|
121
|
+
/**
|
|
122
|
+
* Provide text that is used alongside the control label for additional help
|
|
123
|
+
*/
|
|
121
124
|
helperText: { type: String, default: undefined },
|
|
125
|
+
/**
|
|
126
|
+
* Specify whether you want the underlying label to be visually hidden
|
|
127
|
+
*/
|
|
122
128
|
hideLabel: { type: Boolean, default: false },
|
|
129
|
+
/**
|
|
130
|
+
* Provide the text that is displayed when the control is in an invalid state
|
|
131
|
+
*/
|
|
123
132
|
invalidMessage: { type: String, default: undefined },
|
|
124
|
-
|
|
125
|
-
|
|
133
|
+
/**
|
|
134
|
+
* Input's label
|
|
135
|
+
*/
|
|
136
|
+
label: { type: String, default: undefined },
|
|
137
|
+
/**
|
|
138
|
+
* Input's value, modelValue is the vue3 default 'prop' for two-way data binding with v-model
|
|
139
|
+
*/
|
|
140
|
+
modelValue: { type: String, default: undefined },
|
|
141
|
+
/**
|
|
142
|
+
* Hide password" tooltip text on password visibility toggle
|
|
143
|
+
*/
|
|
126
144
|
passwordHideLabel: { type: String, default: 'Hide password' },
|
|
145
|
+
/**
|
|
146
|
+
* Show password tooltip text on password visibility toggle
|
|
147
|
+
*/
|
|
127
148
|
passwordShowLabel: { type: String, default: 'Show password' },
|
|
149
|
+
/**
|
|
150
|
+
* Toggle password visibility
|
|
151
|
+
*/
|
|
128
152
|
passwordVisible: { type: Boolean, default: undefined },
|
|
153
|
+
/**
|
|
154
|
+
* Input type, only `text` and `password` are available
|
|
155
|
+
*/
|
|
129
156
|
type: {
|
|
130
157
|
type: String,
|
|
131
158
|
default: 'text',
|
|
132
159
|
validator: value => inputTypes.has(value),
|
|
133
160
|
},
|
|
161
|
+
/**
|
|
162
|
+
* Provide the text that is displayed when the control is in warning state
|
|
163
|
+
*/
|
|
134
164
|
warnText: { type: String, default: undefined },
|
|
135
165
|
...propsCvId,
|
|
136
166
|
...propsTheme,
|
|
137
167
|
});
|
|
138
|
-
|
|
168
|
+
defineEmits(['update:modelValue']);
|
|
139
169
|
const cvId = useCvId(props);
|
|
140
170
|
|
|
141
171
|
// DOM Elements
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="[`${carbonPrefix}--form-item`]">
|
|
3
|
+
<span
|
|
4
|
+
v-if="!hideLabel"
|
|
5
|
+
:class="[`${carbonPrefix}--label`, `${carbonPrefix}--skeleton`]"
|
|
6
|
+
></span>
|
|
7
|
+
<div
|
|
8
|
+
:class="[`${carbonPrefix}--text-input`, `${carbonPrefix}--skeleton`]"
|
|
9
|
+
></div>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup>
|
|
14
|
+
import { carbonPrefix } from '../../global/settings';
|
|
15
|
+
|
|
16
|
+
defineProps({ hideLabel: { type: Boolean, default: false } });
|
|
17
|
+
</script>
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
:is="tagType"
|
|
4
4
|
:checked="checkProp('checked', selected)"
|
|
5
5
|
:expanded="checkProp('expanded', expanded)"
|
|
6
|
-
:
|
|
7
|
-
:
|
|
6
|
+
:tile-collapsed-label="checkProp('tileCollapsedLabel', tileCollapsedLabel)"
|
|
7
|
+
:tile-expanded-label="checkProp('tileCollapsedLabel', tileExpandedLabel)"
|
|
8
8
|
:class="[
|
|
9
9
|
`cv-tile ${carbonPrefix}--tile`,
|
|
10
10
|
{ [`${carbonPrefix}--tile--light`]: isLight },
|
|
11
11
|
]"
|
|
12
12
|
>
|
|
13
|
-
<template v-for="(_, name) in $slots"
|
|
13
|
+
<template v-for="(_, name) in $slots" #[name]="slotData"
|
|
14
14
|
><slot :name="name" v-bind="slotData"
|
|
15
15
|
/></template>
|
|
16
16
|
</component>
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<button
|
|
3
|
+
ref="el"
|
|
3
4
|
type="button"
|
|
4
5
|
:style="data.styleObject"
|
|
5
|
-
@click="toggle"
|
|
6
6
|
:class="[
|
|
7
7
|
`cv-tile-expandable ${carbonPrefix}--tile--expandable`,
|
|
8
8
|
{ [`${carbonPrefix}--tile--is-expanded`]: data.internalExpanded },
|
|
9
9
|
]"
|
|
10
|
-
|
|
10
|
+
@click="toggle"
|
|
11
11
|
>
|
|
12
12
|
<div :class="`${carbonPrefix}--tile-content`">
|
|
13
13
|
<span
|
|
14
|
+
ref="aboveFold"
|
|
14
15
|
data-tile-atf
|
|
15
16
|
:class="`${carbonPrefix}--tile-content__above-the-fold`"
|
|
16
|
-
ref="aboveFold"
|
|
17
17
|
>
|
|
18
18
|
<slot>
|
|
19
19
|
<!-- Above the fold content here -->
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
<ChevronDown16 />
|
|
25
25
|
</div>
|
|
26
26
|
<span
|
|
27
|
-
:class="`${carbonPrefix}--tile-content__below-the-fold`"
|
|
28
|
-
ref="belowFold"
|
|
29
27
|
v-show="data.internalExpanded || data.initialized"
|
|
28
|
+
ref="belowFold"
|
|
29
|
+
:class="`${carbonPrefix}--tile-content__below-the-fold`"
|
|
30
30
|
>
|
|
31
31
|
<slot name="below">
|
|
32
32
|
<!-- Rest of the content here -->
|
|
@@ -43,8 +43,8 @@ import { computed, nextTick, reactive, ref, watch } from 'vue';
|
|
|
43
43
|
|
|
44
44
|
const props = defineProps({
|
|
45
45
|
expanded: Boolean,
|
|
46
|
-
tileCollapsedLabel: String,
|
|
47
|
-
tileExpandedLabel: String,
|
|
46
|
+
tileCollapsedLabel: { type: String, default: undefined },
|
|
47
|
+
tileExpandedLabel: { type: String, default: undefined },
|
|
48
48
|
});
|
|
49
49
|
const data = reactive({
|
|
50
50
|
styleObject: {
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
]"
|
|
9
9
|
data-tile="selectable"
|
|
10
10
|
tabindex="0"
|
|
11
|
-
:data-contained-checkbox-state="isChecked"
|
|
11
|
+
:data-contained-checkbox-state="isChecked || null"
|
|
12
12
|
>
|
|
13
13
|
<input
|
|
14
|
+
:id="uid"
|
|
14
15
|
tabindex="-1"
|
|
15
16
|
data-tile-input
|
|
16
|
-
:id="uid"
|
|
17
17
|
type="checkbox"
|
|
18
18
|
:checked="isChecked === true"
|
|
19
19
|
:aria-checked="`${isChecked}`"
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
`${carbonPrefix}--time-picker--${fieldSize}`,
|
|
8
8
|
{ [`${carbonPrefix}--time-picker--light`]: isLight },
|
|
9
9
|
]"
|
|
10
|
-
:data-invalid="isInvalid"
|
|
10
|
+
:data-invalid="isInvalid || null"
|
|
11
11
|
>
|
|
12
12
|
<div :class="`${carbonPrefix}--time-picker__input`">
|
|
13
13
|
<label :for="uid" :class="`${carbonPrefix}--label`">{{ label }}</label>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
:class="`cv-definition-tooltip ${carbonPrefix}--tooltip--definition ${carbonPrefix}--tooltip--a11y`"
|
|
4
3
|
:id="cvId"
|
|
4
|
+
:class="`cv-definition-tooltip ${carbonPrefix}--tooltip--definition ${carbonPrefix}--tooltip--a11y`"
|
|
5
5
|
>
|
|
6
6
|
<button
|
|
7
7
|
:aria-describedby="`${cvId}-label`"
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
</slot>
|
|
20
20
|
</button>
|
|
21
21
|
<div
|
|
22
|
-
:class="`${carbonPrefix}--assistive-text`"
|
|
23
22
|
:id="`${cvId}-label`"
|
|
23
|
+
:class="`${carbonPrefix}--assistive-text`"
|
|
24
24
|
role="tooltip"
|
|
25
25
|
>
|
|
26
26
|
<slot name="definition">
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="cv-interactive-tooltip"
|
|
2
|
+
<div ref="root" class="cv-interactive-tooltip">
|
|
3
3
|
<div :id="`${cvId}-label`" :class="`${carbonPrefix}--tooltip__label`">
|
|
4
4
|
<slot name="label"></slot>
|
|
5
5
|
|
|
6
6
|
<button
|
|
7
|
+
ref="trigger"
|
|
7
8
|
:aria-expanded="dataVisible ? 'true' : 'false'"
|
|
8
9
|
:aria-labelledby="`${cvId}-label`"
|
|
9
10
|
:class="`${carbonPrefix}--tooltip__trigger`"
|
|
10
11
|
:aria-controls="`${cvId}`"
|
|
11
12
|
aria-haspopup="true"
|
|
12
|
-
ref="trigger"
|
|
13
13
|
type="button"
|
|
14
14
|
@click="toggle(dataVisible)"
|
|
15
15
|
@keydown.tab="onTriggerTab"
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
|
|
24
24
|
<div
|
|
25
25
|
:id="cvId"
|
|
26
|
-
|
|
26
|
+
ref="popup"
|
|
27
|
+
:aria-hidden="`${!dataVisible}`"
|
|
27
28
|
:data-floating-menu-direction="direction"
|
|
28
29
|
:class="[
|
|
29
30
|
`${carbonPrefix}--tooltip`,
|
|
@@ -33,18 +34,17 @@
|
|
|
33
34
|
[`${carbonPrefix}--tooltip--align-${alignment}`]: alignment,
|
|
34
35
|
},
|
|
35
36
|
]"
|
|
36
|
-
ref="popup"
|
|
37
37
|
role="dialog"
|
|
38
38
|
:aria-describedby="`${cvId}-body`"
|
|
39
39
|
:aria-labelledby="`${cvId}-label`"
|
|
40
|
-
@focusout="checkFocusOut"
|
|
41
40
|
:style="{ left: left + 'px', top: top + 'px' }"
|
|
42
41
|
tabindex="-1"
|
|
42
|
+
@focusout="checkFocusOut"
|
|
43
43
|
@mousedown.prevent="preventFocusOut"
|
|
44
44
|
>
|
|
45
45
|
<div
|
|
46
|
-
class="cv-interactive-tooltip__before-content"
|
|
47
46
|
ref="beforeContent"
|
|
47
|
+
class="cv-interactive-tooltip__before-content"
|
|
48
48
|
tabindex="0"
|
|
49
49
|
style="position: absolute; left: -9999px; width: 1px; height: 1px"
|
|
50
50
|
@focus="focusBeforeContent"
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
<slot name="content"></slot>
|
|
55
55
|
</div>
|
|
56
56
|
<div
|
|
57
|
-
class="cv-interactive-tooltip__after-content"
|
|
58
57
|
ref="afterContent"
|
|
58
|
+
class="cv-interactive-tooltip__after-content"
|
|
59
59
|
tabindex="0"
|
|
60
60
|
style="position: absolute; left: -9999px; width: 1px; height: 1px"
|
|
61
61
|
@focus="focusAfterContent"
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`CvDefinitionTooltip should render definition tooltip with aligment and direction set as expected 1`] = `
|
|
4
|
-
<div class="cv-definition-tooltip bx--tooltip--definition bx--tooltip--a11y"
|
|
5
|
-
<div class="bx--assistive-text"
|
|
4
|
+
<div id="test-1" class="cv-definition-tooltip bx--tooltip--definition bx--tooltip--a11y"><button aria-describedby="test-1-label" class="bx--tooltip__trigger bx--tooltip--a11y bx--tooltip__trigger--definition bx--tooltip--bottom bx--tooltip--align-end" type="button">A term needeing definition</button>
|
|
5
|
+
<div id="test-1-label" class="bx--assistive-text" role="tooltip">Brief description of the dotted, underlined term</div>
|
|
6
6
|
</div>
|
|
7
7
|
`;
|
|
8
8
|
|
|
9
9
|
exports[`CvDefinitionTooltip should render definition tooltip with aligment set to \`center\` as expected 1`] = `
|
|
10
|
-
<div class="cv-definition-tooltip bx--tooltip--definition bx--tooltip--a11y"
|
|
11
|
-
<div class="bx--assistive-text"
|
|
10
|
+
<div id="test-1" class="cv-definition-tooltip bx--tooltip--definition bx--tooltip--a11y"><button aria-describedby="test-1-label" class="bx--tooltip__trigger bx--tooltip--a11y bx--tooltip__trigger--definition bx--tooltip--top bx--tooltip--align-center" type="button">A term needeing definition</button>
|
|
11
|
+
<div id="test-1-label" class="bx--assistive-text" role="tooltip">Brief description of the dotted, underlined term</div>
|
|
12
12
|
</div>
|
|
13
13
|
`;
|
|
14
14
|
|
|
15
15
|
exports[`CvDefinitionTooltip should render definition tooltip with aligment set to \`end\` as expected 1`] = `
|
|
16
|
-
<div class="cv-definition-tooltip bx--tooltip--definition bx--tooltip--a11y"
|
|
17
|
-
<div class="bx--assistive-text"
|
|
16
|
+
<div id="test-1" class="cv-definition-tooltip bx--tooltip--definition bx--tooltip--a11y"><button aria-describedby="test-1-label" class="bx--tooltip__trigger bx--tooltip--a11y bx--tooltip__trigger--definition bx--tooltip--top bx--tooltip--align-end" type="button">A term needeing definition</button>
|
|
17
|
+
<div id="test-1-label" class="bx--assistive-text" role="tooltip">Brief description of the dotted, underlined term</div>
|
|
18
18
|
</div>
|
|
19
19
|
`;
|
|
20
20
|
|
|
21
21
|
exports[`CvDefinitionTooltip should render definition tooltip with aligment set to \`start\` as expected 1`] = `
|
|
22
|
-
<div class="cv-definition-tooltip bx--tooltip--definition bx--tooltip--a11y"
|
|
23
|
-
<div class="bx--assistive-text"
|
|
22
|
+
<div id="test-1" class="cv-definition-tooltip bx--tooltip--definition bx--tooltip--a11y"><button aria-describedby="test-1-label" class="bx--tooltip__trigger bx--tooltip--a11y bx--tooltip__trigger--definition bx--tooltip--top bx--tooltip--align-start" type="button">A term needeing definition</button>
|
|
23
|
+
<div id="test-1-label" class="bx--assistive-text" role="tooltip">Brief description of the dotted, underlined term</div>
|
|
24
24
|
</div>
|
|
25
25
|
`;
|
|
26
26
|
|
|
27
27
|
exports[`CvDefinitionTooltip should render definition tooltip with direction set to \`bottom\` as expected 1`] = `
|
|
28
|
-
<div class="cv-definition-tooltip bx--tooltip--definition bx--tooltip--a11y"
|
|
29
|
-
<div class="bx--assistive-text"
|
|
28
|
+
<div id="test-1" class="cv-definition-tooltip bx--tooltip--definition bx--tooltip--a11y"><button aria-describedby="test-1-label" class="bx--tooltip__trigger bx--tooltip--a11y bx--tooltip__trigger--definition bx--tooltip--bottom bx--tooltip--align-center" type="button">A term needeing definition</button>
|
|
29
|
+
<div id="test-1-label" class="bx--assistive-text" role="tooltip">Brief description of the dotted, underlined term</div>
|
|
30
30
|
</div>
|
|
31
31
|
`;
|
|
32
32
|
|
|
33
33
|
exports[`CvDefinitionTooltip should render definition tooltip with direction set to \`top\` as expected 1`] = `
|
|
34
|
-
<div class="cv-definition-tooltip bx--tooltip--definition bx--tooltip--a11y"
|
|
35
|
-
<div class="bx--assistive-text"
|
|
34
|
+
<div id="test-1" class="cv-definition-tooltip bx--tooltip--definition bx--tooltip--a11y"><button aria-describedby="test-1-label" class="bx--tooltip__trigger bx--tooltip--a11y bx--tooltip__trigger--definition bx--tooltip--top bx--tooltip--align-center" type="button">A term needeing definition</button>
|
|
35
|
+
<div id="test-1-label" class="bx--assistive-text" role="tooltip">Brief description of the dotted, underlined term</div>
|
|
36
36
|
</div>
|
|
37
37
|
`;
|
|
38
38
|
|
|
39
39
|
exports[`CvDefinitionTooltip should render definition tooltip: minimal as expected 1`] = `
|
|
40
|
-
<div class="cv-definition-tooltip bx--tooltip--definition bx--tooltip--a11y"
|
|
41
|
-
<div class="bx--assistive-text"
|
|
40
|
+
<div id="test-1" class="cv-definition-tooltip bx--tooltip--definition bx--tooltip--a11y"><button aria-describedby="test-1-label" class="bx--tooltip__trigger bx--tooltip--a11y bx--tooltip__trigger--definition bx--tooltip--top bx--tooltip--align-center" type="button">A term needeing definition</button>
|
|
41
|
+
<div id="test-1-label" class="bx--assistive-text" role="tooltip">Brief description of the dotted, underlined term</div>
|
|
42
42
|
</div>
|
|
43
43
|
`;
|
|
44
44
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<header :class="`cv-header ${carbonPrefix}--header`" data-header
|
|
2
|
+
<header :id="uid" :class="`cv-header ${carbonPrefix}--header`" data-header>
|
|
3
3
|
<slot />
|
|
4
4
|
<div v-if="hasGlobalHeader" :class="`${carbonPrefix}--header__global`">
|
|
5
5
|
<slot name="header-global" />
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<cv-icon-button
|
|
3
|
+
:id="uid"
|
|
4
|
+
ref="el"
|
|
3
5
|
:class="[
|
|
4
6
|
`cv-header-global-action`,
|
|
5
7
|
`${carbonPrefix}--header__action`,
|
|
@@ -9,15 +11,13 @@
|
|
|
9
11
|
aria-haspopup="true"
|
|
10
12
|
:aria-controls="ariaControls"
|
|
11
13
|
:aria-expanded="active ? 'true' : 'false'"
|
|
14
|
+
:label="label"
|
|
15
|
+
:tip-alignment="tipAlignment"
|
|
16
|
+
:tip-position="tipPosition"
|
|
12
17
|
@click="gaToggle"
|
|
13
18
|
@focusout="gaFocusout"
|
|
14
|
-
:id="uid"
|
|
15
|
-
:label="label"
|
|
16
|
-
:tipAlignment="tipAlignment"
|
|
17
|
-
:tipPosition="tipPosition"
|
|
18
|
-
ref="el"
|
|
19
19
|
>
|
|
20
|
-
<template
|
|
20
|
+
<template #icon>
|
|
21
21
|
<slot />
|
|
22
22
|
</template>
|
|
23
23
|
</cv-icon-button>
|
|
@@ -39,7 +39,7 @@ import CvIconButton from '../CvButton/CvIconButton.vue';
|
|
|
39
39
|
|
|
40
40
|
const props = defineProps({
|
|
41
41
|
active: { type: Boolean, default: false },
|
|
42
|
-
ariaControls: { type: String },
|
|
42
|
+
ariaControls: { type: String, default: undefined },
|
|
43
43
|
label: { type: String, default: undefined },
|
|
44
44
|
tipPosition: {
|
|
45
45
|
type: String,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<li
|
|
3
|
+
ref="el"
|
|
3
4
|
:class="`cv-header-menu ${carbonPrefix}--header__submenu`"
|
|
4
5
|
@mouseenter="doHoverToggle(true)"
|
|
5
6
|
@mouseleave="doHoverToggle(false)"
|
|
6
|
-
ref="el"
|
|
7
7
|
>
|
|
8
8
|
<a
|
|
9
9
|
aria-haspopup="true"
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
/>
|
|
27
27
|
</a>
|
|
28
28
|
<ul
|
|
29
|
+
ref="menu"
|
|
29
30
|
:aria-label="$attrs.ariaLabel"
|
|
30
31
|
:aria-labelledby="$attrs.ariaLabelledBy"
|
|
31
32
|
:class="`${carbonPrefix}--header__menu`"
|
|
32
33
|
role="menu"
|
|
33
|
-
ref="menu"
|
|
34
34
|
@focusout="onFocusout"
|
|
35
35
|
>
|
|
36
36
|
<slot></slot>
|
|
@@ -44,7 +44,7 @@ import ChevronDownGlyph from '@carbon/icons-vue/es/chevron--down';
|
|
|
44
44
|
import { reactive, ref } from 'vue';
|
|
45
45
|
|
|
46
46
|
const props = defineProps({
|
|
47
|
-
title: String,
|
|
47
|
+
title: { type: String, default: undefined },
|
|
48
48
|
hoverToggle: { type: Boolean, default: true },
|
|
49
49
|
});
|
|
50
50
|
const data = reactive({
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<button
|
|
3
|
+
:id="uid"
|
|
4
|
+
ref="el"
|
|
3
5
|
class="cv-header-menu-button"
|
|
4
6
|
:class="[
|
|
5
7
|
`${carbonPrefix}--header__action`,
|
|
@@ -16,8 +18,6 @@
|
|
|
16
18
|
:aria-expanded="active ? 'true' : 'false'"
|
|
17
19
|
@click="gaToggle"
|
|
18
20
|
@focusout="gaFocusout"
|
|
19
|
-
:id="uid"
|
|
20
|
-
ref="el"
|
|
21
21
|
>
|
|
22
22
|
<close20 v-if="dataActive" />
|
|
23
23
|
<menu20 v-if="!dataActive" />
|
|
@@ -16,7 +16,7 @@ import { carbonPrefix } from '../../global/settings';
|
|
|
16
16
|
import { useTagType, useLinkProps, props as propsLink } from '../../use/cvLink';
|
|
17
17
|
|
|
18
18
|
const props = defineProps({
|
|
19
|
-
prefix: String,
|
|
19
|
+
prefix: { type: String, default: undefined },
|
|
20
20
|
...propsLink,
|
|
21
21
|
});
|
|
22
22
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
+
:id="id"
|
|
4
|
+
ref="el"
|
|
3
5
|
:class="[
|
|
4
6
|
`cv-header-panel`,
|
|
5
7
|
`${carbonPrefix}--header-panel`,
|
|
6
8
|
{ [`${carbonPrefix}--header-panel--expanded`]: panelExpanded },
|
|
7
9
|
]"
|
|
8
10
|
:aria-hidden="!panelExpanded ? 'true' : 'false'"
|
|
9
|
-
:id="id"
|
|
10
11
|
@focusout="onFocusout"
|
|
11
12
|
@mousedown="onMouseDown"
|
|
12
|
-
ref="el"
|
|
13
13
|
>
|
|
14
14
|
<slot></slot>
|
|
15
15
|
</div>
|
|
@@ -39,6 +39,7 @@ const props = defineProps({
|
|
|
39
39
|
}
|
|
40
40
|
return true;
|
|
41
41
|
},
|
|
42
|
+
default: undefined,
|
|
42
43
|
},
|
|
43
44
|
expanded: Boolean,
|
|
44
45
|
id: { type: String, required: true },
|