@carbon/vue 3.0.6-alpha.0 → 3.0.8-alpha.0
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 +7 -0
- package/dist/carbon-vue-3.common.js +16111 -9105
- package/dist/carbon-vue-3.common.js.map +1 -1
- package/dist/carbon-vue-3.umd.js +16111 -9105
- package/dist/carbon-vue-3.umd.js.map +1 -1
- package/dist/carbon-vue-3.umd.min.js +4 -4
- package/dist/carbon-vue-3.umd.min.js.map +1 -1
- package/package.json +9 -6
- package/src/components/CvAccordion/CvAccordion.stories.js +1 -0
- package/src/components/CvButton/CvButton.stories.js +3 -3
- package/src/components/CvButton/CvButtonSkeleton.stories.js +79 -0
- package/src/components/CvButton/CvButtonSkeleton.vue +19 -0
- package/src/components/CvButton/index.js +8 -1
- package/src/components/CvCheckbox/CvCheckbox.stories.js +18 -7
- package/src/components/CvCheckbox/CvCheckbox.vue +19 -3
- package/src/components/CvCheckbox/CvCheckboxSkeleton.vue +16 -0
- package/src/components/CvCheckbox/__tests__/__snapshots__/CvCheckboxSkeleton.spec.js.snap +3 -0
- package/src/components/CvCheckbox/index.js +2 -1
- package/src/components/CvDatePicker/CvDatePicker.vue +1 -1
- package/src/components/CvDropdown/CvDropdown.stories.mdx +407 -0
- package/src/components/CvDropdown/CvDropdown.vue +416 -0
- package/src/components/CvDropdown/CvDropdownItem.vue +86 -0
- package/src/components/CvDropdown/CvDropdownSkeleton.vue +17 -0
- package/src/components/CvDropdown/index.js +5 -0
- package/src/components/CvFileUploader/CvFileUploader.stories.mdx +333 -0
- package/src/components/CvFileUploader/CvFileUploader.vue +286 -0
- package/src/components/CvFileUploader/CvFileUploaderItem.vue +92 -0
- package/src/components/CvFileUploader/CvFileUploaderSkeleton.vue +16 -0
- package/src/components/CvFileUploader/const.js +10 -0
- package/src/components/CvFileUploader/index.js +5 -0
- package/src/components/CvForm/CvFormGroup.vue +1 -1
- package/src/components/CvInlineLoading/CvInlineLoading.stories.mdx +87 -0
- package/src/components/CvInlineLoading/CvInlineLoading.vue +144 -0
- package/src/components/CvInlineLoading/consts.js +9 -0
- package/src/components/CvInlineLoading/index.js +4 -0
- package/src/components/CvModal/CvModal.stories.mdx +4 -2
- package/src/components/CvModal/CvModal.vue +3 -5
- package/src/components/CvMultiSelect/CvMultiSelect.stories.mdx +333 -0
- package/src/components/CvMultiSelect/CvMultiSelect.vue +705 -0
- package/src/components/CvMultiSelect/consts.js +16 -0
- package/src/components/CvMultiSelect/index.js +3 -0
- package/src/components/CvNumberInput/CvNumberInput.stories.js +265 -0
- package/src/components/CvNumberInput/CvNumberInput.vue +227 -0
- package/src/components/CvNumberInput/CvNumberInputSkeleton.stories.js +30 -0
- package/src/components/CvNumberInput/CvNumberInputSkeleton.vue +10 -0
- package/src/components/CvNumberInput/StorybookGroupConst.js +1 -0
- package/src/components/CvNumberInput/__tests__/__snapshots__/CvNumberInput.spec.js.snap +21 -0
- package/src/components/CvNumberInput/index.js +5 -0
- package/src/components/CvProgress/CvProgress.stories.mdx +202 -0
- package/src/components/CvProgress/CvProgress.vue +78 -0
- package/src/components/CvProgress/CvProgressStep.vue +124 -0
- package/src/components/CvProgress/index.js +4 -0
- package/src/components/CvRadioButton/CvRadioButton.stories.js +166 -0
- package/src/components/CvRadioButton/CvRadioButton.vue +57 -0
- package/src/components/CvRadioButton/CvRadioGroup.vue +27 -0
- package/src/components/CvRadioButton/__tests__/__snapshots__/CvRadioButton.spec.js.snap +27 -0
- package/src/components/CvRadioButton/index.js +6 -0
- package/src/components/CvSearch/CvSearch.stories.mdx +168 -0
- package/src/components/CvSearch/CvSearch.vue +250 -0
- package/src/components/CvSearch/index.js +3 -0
- package/src/components/CvSelect/CvSelect.vue +27 -6
- package/src/components/CvSlider/CvSlider.stories.js +166 -0
- package/src/components/CvSlider/CvSlider.vue +324 -0
- package/src/components/CvSlider/CvSliderSkeleton.stories.js +26 -0
- package/src/components/CvSlider/CvSliderSkeleton.vue +18 -0
- package/src/components/CvSlider/__tests__/__snapshots__/CvSlider.spec.js.snap +13 -0
- package/src/components/CvSlider/__tests__/__snapshots__/CvSliderSkeleton.spec.js.snap +13 -0
- package/src/components/CvSlider/index.js +5 -0
- package/src/components/CvSlider/sbSliderPrefix.js +2 -0
- package/src/components/CvTabs/CvTab.vue +77 -0
- package/src/components/CvTabs/CvTabs.stories.mdx +175 -0
- package/src/components/CvTabs/CvTabs.vue +406 -0
- package/src/components/CvTabs/CvTabsSkeleton.vue +24 -0
- package/src/components/CvTabs/_SbContainer.vue +22 -0
- package/src/components/CvTabs/index.js +5 -0
- package/src/components/CvTextArea/CvTextArea.stories.js +2 -2
- package/src/components/CvTextArea/CvTextAreaSkeleton.stories.js +29 -0
- package/src/components/CvTextArea/CvTextAreaSkeleton.vue +10 -0
- package/src/components/CvTextArea/StorybookGroupConst.js +1 -0
- package/src/components/CvTextArea/__tests__/__snapshots__/CvTextAreaSkeleton.spec.js.snap +7 -0
- package/src/components/CvTextArea/index.js +2 -1
- package/src/components/CvTimePicker/CvTimePicker.stories.mdx +325 -0
- package/src/components/CvTimePicker/CvTimePicker.vue +217 -0
- package/src/components/CvTimePicker/index.js +21 -0
- package/src/components/CvToggle/CvToggle-Skeleton.vue +44 -0
- package/src/components/CvToggle/CvToggle.stories.js +249 -0
- package/src/components/CvToggle/CvToggle.vue +87 -0
- package/src/components/CvToggle/__tests__/__snapshots__/CvToggle.spec.js.snap +7 -0
- package/src/components/CvToggle/index.js +4 -0
- package/src/components/CvTooltip/CvDefinitionTooltip.stories.js +80 -0
- package/src/components/CvTooltip/CvDefinitionTooltip.vue +61 -0
- package/src/components/CvTooltip/CvInteractiveTooltip.stories.js +90 -0
- package/src/components/CvTooltip/CvInteractiveTooltip.vue +267 -0
- package/src/components/CvTooltip/CvTooltip.stories.js +128 -0
- package/src/components/CvTooltip/CvTooltip.vue +44 -0
- package/src/components/CvTooltip/__tests__/__snapshots__/CvTooltip.spec.js.snap +525 -0
- package/src/components/CvTooltip/consts.js +15 -0
- package/src/components/CvTooltip/index.js +6 -0
- package/src/components/CvTooltip/sbTooltipPrefix.js +2 -0
- package/src/components/CvUIShell/CvSideNav.vue +10 -1
- package/src/components/CvUIShell/CvUIShell.stories.mdx +116 -50
- package/src/global/storybook-utils/story-source-code.js +1 -0
- package/src/index.d.ts +6 -0
- package/src/index.js +11 -0
- package/src/use/cvCheck.js +3 -0
- package/src/use/cvInput.js +34 -0
- package/src/use/index.js +2 -0
- package/src/use/useMethods.js +18 -0
- package/src/use/useRadio.js +25 -0
|
@@ -0,0 +1,525 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
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" id="test-1"><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 class="bx--assistive-text" id="test-1-label" role="tooltip">Brief description of the dotted, underlined term</div>
|
|
6
|
+
</div>
|
|
7
|
+
`;
|
|
8
|
+
|
|
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" id="test-1"><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 class="bx--assistive-text" id="test-1-label" role="tooltip">Brief description of the dotted, underlined term</div>
|
|
12
|
+
</div>
|
|
13
|
+
`;
|
|
14
|
+
|
|
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" id="test-1"><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 class="bx--assistive-text" id="test-1-label" role="tooltip">Brief description of the dotted, underlined term</div>
|
|
18
|
+
</div>
|
|
19
|
+
`;
|
|
20
|
+
|
|
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" id="test-1"><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 class="bx--assistive-text" id="test-1-label" role="tooltip">Brief description of the dotted, underlined term</div>
|
|
24
|
+
</div>
|
|
25
|
+
`;
|
|
26
|
+
|
|
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" id="test-1"><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 class="bx--assistive-text" id="test-1-label" role="tooltip">Brief description of the dotted, underlined term</div>
|
|
30
|
+
</div>
|
|
31
|
+
`;
|
|
32
|
+
|
|
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" id="test-1"><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 class="bx--assistive-text" id="test-1-label" role="tooltip">Brief description of the dotted, underlined term</div>
|
|
36
|
+
</div>
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
exports[`CvDefinitionTooltip should render definition tooltip: minimal as expected 1`] = `
|
|
40
|
+
<div class="cv-definition-tooltip bx--tooltip--definition bx--tooltip--a11y" id="test-1"><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 class="bx--assistive-text" id="test-1-label" role="tooltip">Brief description of the dotted, underlined term</div>
|
|
42
|
+
</div>
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
exports[`CvInteractiveTooltip should render interactive tooltip with direction and visible set as expected 1`] = `
|
|
46
|
+
<div class="cv-interactive-tooltip">
|
|
47
|
+
<div id="test-1-label" class="bx--tooltip__label"><button aria-expanded="false" aria-labelledby="test-1-label" class="bx--tooltip__trigger" aria-controls="test-1" aria-haspopup="true" type="button">
|
|
48
|
+
<anonymous-stub></anonymous-stub>
|
|
49
|
+
</button></div>
|
|
50
|
+
</div>
|
|
51
|
+
`;
|
|
52
|
+
|
|
53
|
+
exports[`CvInteractiveTooltip should render interactive tooltip with direction and visible set as expected 2`] = `
|
|
54
|
+
<div
|
|
55
|
+
aria-describedby="test-1-body"
|
|
56
|
+
aria-hidden="true"
|
|
57
|
+
aria-labelledby="test-1-label"
|
|
58
|
+
class="bx--tooltip bx--tooltip--left bx--tooltip--align-center"
|
|
59
|
+
data-floating-menu-direction="left"
|
|
60
|
+
id="test-1"
|
|
61
|
+
role="dialog"
|
|
62
|
+
style="left: -9999px; top: 0px;"
|
|
63
|
+
tabindex="-1"
|
|
64
|
+
>
|
|
65
|
+
<div
|
|
66
|
+
class="cv-interactive-tooltip__before-content"
|
|
67
|
+
style="position: absolute; left: -9999px; width: 1px; height: 1px;"
|
|
68
|
+
tabindex="0"
|
|
69
|
+
/>
|
|
70
|
+
<span
|
|
71
|
+
class="bx--tooltip__caret"
|
|
72
|
+
/>
|
|
73
|
+
<div
|
|
74
|
+
class="bx--tooltip__content"
|
|
75
|
+
>
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
</div>
|
|
79
|
+
<div
|
|
80
|
+
class="cv-interactive-tooltip__after-content"
|
|
81
|
+
style="position: absolute; left: -9999px; width: 1px; height: 1px;"
|
|
82
|
+
tabindex="0"
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
85
|
+
`;
|
|
86
|
+
|
|
87
|
+
exports[`CvInteractiveTooltip should render interactive tooltip with direction set to \`bottom\` as expected 1`] = `
|
|
88
|
+
<div class="cv-interactive-tooltip">
|
|
89
|
+
<div id="test-1-label" class="bx--tooltip__label"><button aria-expanded="false" aria-labelledby="test-1-label" class="bx--tooltip__trigger" aria-controls="test-1" aria-haspopup="true" type="button">
|
|
90
|
+
<anonymous-stub></anonymous-stub>
|
|
91
|
+
</button></div>
|
|
92
|
+
</div>
|
|
93
|
+
`;
|
|
94
|
+
|
|
95
|
+
exports[`CvInteractiveTooltip should render interactive tooltip with direction set to \`bottom\` as expected 2`] = `
|
|
96
|
+
<div
|
|
97
|
+
aria-describedby="test-1-body"
|
|
98
|
+
aria-hidden="true"
|
|
99
|
+
aria-labelledby="test-1-label"
|
|
100
|
+
class="bx--tooltip bx--tooltip--bottom bx--tooltip--align-center"
|
|
101
|
+
data-floating-menu-direction="bottom"
|
|
102
|
+
id="test-1"
|
|
103
|
+
role="dialog"
|
|
104
|
+
style="left: -9999px; top: 0px;"
|
|
105
|
+
tabindex="-1"
|
|
106
|
+
>
|
|
107
|
+
<div
|
|
108
|
+
class="cv-interactive-tooltip__before-content"
|
|
109
|
+
style="position: absolute; left: -9999px; width: 1px; height: 1px;"
|
|
110
|
+
tabindex="0"
|
|
111
|
+
/>
|
|
112
|
+
<span
|
|
113
|
+
class="bx--tooltip__caret"
|
|
114
|
+
/>
|
|
115
|
+
<div
|
|
116
|
+
class="bx--tooltip__content"
|
|
117
|
+
>
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
</div>
|
|
121
|
+
<div
|
|
122
|
+
class="cv-interactive-tooltip__after-content"
|
|
123
|
+
style="position: absolute; left: -9999px; width: 1px; height: 1px;"
|
|
124
|
+
tabindex="0"
|
|
125
|
+
/>
|
|
126
|
+
</div>
|
|
127
|
+
`;
|
|
128
|
+
|
|
129
|
+
exports[`CvInteractiveTooltip should render interactive tooltip with direction set to \`left\` as expected 1`] = `
|
|
130
|
+
<div class="cv-interactive-tooltip">
|
|
131
|
+
<div id="test-1-label" class="bx--tooltip__label"><button aria-expanded="false" aria-labelledby="test-1-label" class="bx--tooltip__trigger" aria-controls="test-1" aria-haspopup="true" type="button">
|
|
132
|
+
<anonymous-stub></anonymous-stub>
|
|
133
|
+
</button></div>
|
|
134
|
+
</div>
|
|
135
|
+
`;
|
|
136
|
+
|
|
137
|
+
exports[`CvInteractiveTooltip should render interactive tooltip with direction set to \`left\` as expected 2`] = `
|
|
138
|
+
<div
|
|
139
|
+
aria-describedby="test-1-body"
|
|
140
|
+
aria-hidden="true"
|
|
141
|
+
aria-labelledby="test-1-label"
|
|
142
|
+
class="bx--tooltip bx--tooltip--left bx--tooltip--align-center"
|
|
143
|
+
data-floating-menu-direction="left"
|
|
144
|
+
id="test-1"
|
|
145
|
+
role="dialog"
|
|
146
|
+
style="left: -9999px; top: 0px;"
|
|
147
|
+
tabindex="-1"
|
|
148
|
+
>
|
|
149
|
+
<div
|
|
150
|
+
class="cv-interactive-tooltip__before-content"
|
|
151
|
+
style="position: absolute; left: -9999px; width: 1px; height: 1px;"
|
|
152
|
+
tabindex="0"
|
|
153
|
+
/>
|
|
154
|
+
<span
|
|
155
|
+
class="bx--tooltip__caret"
|
|
156
|
+
/>
|
|
157
|
+
<div
|
|
158
|
+
class="bx--tooltip__content"
|
|
159
|
+
>
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
</div>
|
|
163
|
+
<div
|
|
164
|
+
class="cv-interactive-tooltip__after-content"
|
|
165
|
+
style="position: absolute; left: -9999px; width: 1px; height: 1px;"
|
|
166
|
+
tabindex="0"
|
|
167
|
+
/>
|
|
168
|
+
</div>
|
|
169
|
+
`;
|
|
170
|
+
|
|
171
|
+
exports[`CvInteractiveTooltip should render interactive tooltip with direction set to \`right\` as expected 1`] = `
|
|
172
|
+
<div class="cv-interactive-tooltip">
|
|
173
|
+
<div id="test-1-label" class="bx--tooltip__label"><button aria-expanded="false" aria-labelledby="test-1-label" class="bx--tooltip__trigger" aria-controls="test-1" aria-haspopup="true" type="button">
|
|
174
|
+
<anonymous-stub></anonymous-stub>
|
|
175
|
+
</button></div>
|
|
176
|
+
</div>
|
|
177
|
+
`;
|
|
178
|
+
|
|
179
|
+
exports[`CvInteractiveTooltip should render interactive tooltip with direction set to \`right\` as expected 2`] = `
|
|
180
|
+
<div
|
|
181
|
+
aria-describedby="test-1-body"
|
|
182
|
+
aria-hidden="true"
|
|
183
|
+
aria-labelledby="test-1-label"
|
|
184
|
+
class="bx--tooltip bx--tooltip--right bx--tooltip--align-center"
|
|
185
|
+
data-floating-menu-direction="right"
|
|
186
|
+
id="test-1"
|
|
187
|
+
role="dialog"
|
|
188
|
+
style="left: -9999px; top: 0px;"
|
|
189
|
+
tabindex="-1"
|
|
190
|
+
>
|
|
191
|
+
<div
|
|
192
|
+
class="cv-interactive-tooltip__before-content"
|
|
193
|
+
style="position: absolute; left: -9999px; width: 1px; height: 1px;"
|
|
194
|
+
tabindex="0"
|
|
195
|
+
/>
|
|
196
|
+
<span
|
|
197
|
+
class="bx--tooltip__caret"
|
|
198
|
+
/>
|
|
199
|
+
<div
|
|
200
|
+
class="bx--tooltip__content"
|
|
201
|
+
>
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
</div>
|
|
205
|
+
<div
|
|
206
|
+
class="cv-interactive-tooltip__after-content"
|
|
207
|
+
style="position: absolute; left: -9999px; width: 1px; height: 1px;"
|
|
208
|
+
tabindex="0"
|
|
209
|
+
/>
|
|
210
|
+
</div>
|
|
211
|
+
`;
|
|
212
|
+
|
|
213
|
+
exports[`CvInteractiveTooltip should render interactive tooltip with direction set to \`top\` as expected 1`] = `
|
|
214
|
+
<div class="cv-interactive-tooltip">
|
|
215
|
+
<div id="test-1-label" class="bx--tooltip__label"><button aria-expanded="false" aria-labelledby="test-1-label" class="bx--tooltip__trigger" aria-controls="test-1" aria-haspopup="true" type="button">
|
|
216
|
+
<anonymous-stub></anonymous-stub>
|
|
217
|
+
</button></div>
|
|
218
|
+
</div>
|
|
219
|
+
`;
|
|
220
|
+
|
|
221
|
+
exports[`CvInteractiveTooltip should render interactive tooltip with direction set to \`top\` as expected 2`] = `
|
|
222
|
+
<div
|
|
223
|
+
aria-describedby="test-1-body"
|
|
224
|
+
aria-hidden="true"
|
|
225
|
+
aria-labelledby="test-1-label"
|
|
226
|
+
class="bx--tooltip bx--tooltip--top bx--tooltip--align-center"
|
|
227
|
+
data-floating-menu-direction="top"
|
|
228
|
+
id="test-1"
|
|
229
|
+
role="dialog"
|
|
230
|
+
style="left: -9999px; top: 0px;"
|
|
231
|
+
tabindex="-1"
|
|
232
|
+
>
|
|
233
|
+
<div
|
|
234
|
+
class="cv-interactive-tooltip__before-content"
|
|
235
|
+
style="position: absolute; left: -9999px; width: 1px; height: 1px;"
|
|
236
|
+
tabindex="0"
|
|
237
|
+
/>
|
|
238
|
+
<span
|
|
239
|
+
class="bx--tooltip__caret"
|
|
240
|
+
/>
|
|
241
|
+
<div
|
|
242
|
+
class="bx--tooltip__content"
|
|
243
|
+
>
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
</div>
|
|
247
|
+
<div
|
|
248
|
+
class="cv-interactive-tooltip__after-content"
|
|
249
|
+
style="position: absolute; left: -9999px; width: 1px; height: 1px;"
|
|
250
|
+
tabindex="0"
|
|
251
|
+
/>
|
|
252
|
+
</div>
|
|
253
|
+
`;
|
|
254
|
+
|
|
255
|
+
exports[`CvInteractiveTooltip should render interactive tooltip with slot \`content\` as expected 1`] = `
|
|
256
|
+
<div class="cv-interactive-tooltip">
|
|
257
|
+
<div id="test-1-label" class="bx--tooltip__label"><button aria-expanded="false" aria-labelledby="test-1-label" class="bx--tooltip__trigger" aria-controls="test-1" aria-haspopup="true" type="button">
|
|
258
|
+
<anonymous-stub></anonymous-stub>
|
|
259
|
+
</button></div>
|
|
260
|
+
</div>
|
|
261
|
+
`;
|
|
262
|
+
|
|
263
|
+
exports[`CvInteractiveTooltip should render interactive tooltip with slot \`content\` as expected 2`] = `
|
|
264
|
+
<div
|
|
265
|
+
aria-describedby="test-1-body"
|
|
266
|
+
aria-hidden="true"
|
|
267
|
+
aria-labelledby="test-1-label"
|
|
268
|
+
class="bx--tooltip bx--tooltip--top bx--tooltip--align-center"
|
|
269
|
+
data-floating-menu-direction="top"
|
|
270
|
+
id="test-1"
|
|
271
|
+
role="dialog"
|
|
272
|
+
style="left: -9999px; top: 0px;"
|
|
273
|
+
tabindex="-1"
|
|
274
|
+
>
|
|
275
|
+
<div
|
|
276
|
+
class="cv-interactive-tooltip__before-content"
|
|
277
|
+
style="position: absolute; left: -9999px; width: 1px; height: 1px;"
|
|
278
|
+
tabindex="0"
|
|
279
|
+
/>
|
|
280
|
+
<span
|
|
281
|
+
class="bx--tooltip__caret"
|
|
282
|
+
/>
|
|
283
|
+
<div
|
|
284
|
+
class="bx--tooltip__content"
|
|
285
|
+
>
|
|
286
|
+
|
|
287
|
+
<div>
|
|
288
|
+
Interactive tooptip content
|
|
289
|
+
<button>
|
|
290
|
+
Close tooltip
|
|
291
|
+
</button>
|
|
292
|
+
</div>
|
|
293
|
+
|
|
294
|
+
</div>
|
|
295
|
+
<div
|
|
296
|
+
class="cv-interactive-tooltip__after-content"
|
|
297
|
+
style="position: absolute; left: -9999px; width: 1px; height: 1px;"
|
|
298
|
+
tabindex="0"
|
|
299
|
+
/>
|
|
300
|
+
</div>
|
|
301
|
+
`;
|
|
302
|
+
|
|
303
|
+
exports[`CvInteractiveTooltip should render interactive tooltip with slot \`label\` as expected 1`] = `
|
|
304
|
+
<div class="cv-interactive-tooltip">
|
|
305
|
+
<div id="test-1-label" class="bx--tooltip__label">
|
|
306
|
+
<div>Interactive tooptip label</div><button aria-expanded="false" aria-labelledby="test-1-label" class="bx--tooltip__trigger" aria-controls="test-1" aria-haspopup="true" type="button">
|
|
307
|
+
<anonymous-stub></anonymous-stub>
|
|
308
|
+
</button>
|
|
309
|
+
</div>
|
|
310
|
+
</div>
|
|
311
|
+
`;
|
|
312
|
+
|
|
313
|
+
exports[`CvInteractiveTooltip should render interactive tooltip with slot \`label\` as expected 2`] = `
|
|
314
|
+
<div
|
|
315
|
+
aria-describedby="test-1-body"
|
|
316
|
+
aria-hidden="true"
|
|
317
|
+
aria-labelledby="test-1-label"
|
|
318
|
+
class="bx--tooltip bx--tooltip--top bx--tooltip--align-center"
|
|
319
|
+
data-floating-menu-direction="top"
|
|
320
|
+
id="test-1"
|
|
321
|
+
role="dialog"
|
|
322
|
+
style="left: -9999px; top: 0px;"
|
|
323
|
+
tabindex="-1"
|
|
324
|
+
>
|
|
325
|
+
<div
|
|
326
|
+
class="cv-interactive-tooltip__before-content"
|
|
327
|
+
style="position: absolute; left: -9999px; width: 1px; height: 1px;"
|
|
328
|
+
tabindex="0"
|
|
329
|
+
/>
|
|
330
|
+
<span
|
|
331
|
+
class="bx--tooltip__caret"
|
|
332
|
+
/>
|
|
333
|
+
<div
|
|
334
|
+
class="bx--tooltip__content"
|
|
335
|
+
>
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
</div>
|
|
339
|
+
<div
|
|
340
|
+
class="cv-interactive-tooltip__after-content"
|
|
341
|
+
style="position: absolute; left: -9999px; width: 1px; height: 1px;"
|
|
342
|
+
tabindex="0"
|
|
343
|
+
/>
|
|
344
|
+
</div>
|
|
345
|
+
`;
|
|
346
|
+
|
|
347
|
+
exports[`CvInteractiveTooltip should render interactive tooltip with slot \`trigger\` as expected 1`] = `
|
|
348
|
+
<div class="cv-interactive-tooltip">
|
|
349
|
+
<div id="test-1-label" class="bx--tooltip__label"><button aria-expanded="false" aria-labelledby="test-1-label" class="bx--tooltip__trigger" aria-controls="test-1" aria-haspopup="true" type="button">
|
|
350
|
+
<div>Interactive tooptip trigger</div>
|
|
351
|
+
</button></div>
|
|
352
|
+
</div>
|
|
353
|
+
`;
|
|
354
|
+
|
|
355
|
+
exports[`CvInteractiveTooltip should render interactive tooltip with slot \`trigger\` as expected 2`] = `
|
|
356
|
+
<div
|
|
357
|
+
aria-describedby="test-1-body"
|
|
358
|
+
aria-hidden="true"
|
|
359
|
+
aria-labelledby="test-1-label"
|
|
360
|
+
class="bx--tooltip bx--tooltip--top bx--tooltip--align-center"
|
|
361
|
+
data-floating-menu-direction="top"
|
|
362
|
+
id="test-1"
|
|
363
|
+
role="dialog"
|
|
364
|
+
style="left: -9999px; top: 0px;"
|
|
365
|
+
tabindex="-1"
|
|
366
|
+
>
|
|
367
|
+
<div
|
|
368
|
+
class="cv-interactive-tooltip__before-content"
|
|
369
|
+
style="position: absolute; left: -9999px; width: 1px; height: 1px;"
|
|
370
|
+
tabindex="0"
|
|
371
|
+
/>
|
|
372
|
+
<span
|
|
373
|
+
class="bx--tooltip__caret"
|
|
374
|
+
/>
|
|
375
|
+
<div
|
|
376
|
+
class="bx--tooltip__content"
|
|
377
|
+
>
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
</div>
|
|
381
|
+
<div
|
|
382
|
+
class="cv-interactive-tooltip__after-content"
|
|
383
|
+
style="position: absolute; left: -9999px; width: 1px; height: 1px;"
|
|
384
|
+
tabindex="0"
|
|
385
|
+
/>
|
|
386
|
+
</div>
|
|
387
|
+
`;
|
|
388
|
+
|
|
389
|
+
exports[`CvInteractiveTooltip should render interactive tooltip with visible set to \`true\` as expected 1`] = `
|
|
390
|
+
<div class="cv-interactive-tooltip">
|
|
391
|
+
<div id="test-1-label" class="bx--tooltip__label"><button aria-expanded="false" aria-labelledby="test-1-label" class="bx--tooltip__trigger" aria-controls="test-1" aria-haspopup="true" type="button">
|
|
392
|
+
<anonymous-stub></anonymous-stub>
|
|
393
|
+
</button></div>
|
|
394
|
+
</div>
|
|
395
|
+
`;
|
|
396
|
+
|
|
397
|
+
exports[`CvInteractiveTooltip should render interactive tooltip with visible set to \`true\` as expected 2`] = `
|
|
398
|
+
<div
|
|
399
|
+
aria-describedby="test-1-body"
|
|
400
|
+
aria-hidden="true"
|
|
401
|
+
aria-labelledby="test-1-label"
|
|
402
|
+
class="bx--tooltip bx--tooltip--top bx--tooltip--align-center"
|
|
403
|
+
data-floating-menu-direction="top"
|
|
404
|
+
id="test-1"
|
|
405
|
+
role="dialog"
|
|
406
|
+
style="left: -9999px; top: 0px;"
|
|
407
|
+
tabindex="-1"
|
|
408
|
+
>
|
|
409
|
+
<div
|
|
410
|
+
class="cv-interactive-tooltip__before-content"
|
|
411
|
+
style="position: absolute; left: -9999px; width: 1px; height: 1px;"
|
|
412
|
+
tabindex="0"
|
|
413
|
+
/>
|
|
414
|
+
<span
|
|
415
|
+
class="bx--tooltip__caret"
|
|
416
|
+
/>
|
|
417
|
+
<div
|
|
418
|
+
class="bx--tooltip__content"
|
|
419
|
+
>
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
</div>
|
|
423
|
+
<div
|
|
424
|
+
class="cv-interactive-tooltip__after-content"
|
|
425
|
+
style="position: absolute; left: -9999px; width: 1px; height: 1px;"
|
|
426
|
+
tabindex="0"
|
|
427
|
+
/>
|
|
428
|
+
</div>
|
|
429
|
+
`;
|
|
430
|
+
|
|
431
|
+
exports[`CvInteractiveTooltip should render interactive tooltip: minimal as expected 1`] = `
|
|
432
|
+
<div class="cv-interactive-tooltip">
|
|
433
|
+
<div id="test-1-label" class="bx--tooltip__label"><button aria-expanded="false" aria-labelledby="test-1-label" class="bx--tooltip__trigger" aria-controls="test-1" aria-haspopup="true" type="button">
|
|
434
|
+
<anonymous-stub></anonymous-stub>
|
|
435
|
+
</button></div>
|
|
436
|
+
</div>
|
|
437
|
+
`;
|
|
438
|
+
|
|
439
|
+
exports[`CvInteractiveTooltip should render interactive tooltip: minimal as expected 2`] = `
|
|
440
|
+
<div
|
|
441
|
+
aria-describedby="test-1-body"
|
|
442
|
+
aria-hidden="true"
|
|
443
|
+
aria-labelledby="test-1-label"
|
|
444
|
+
class="bx--tooltip bx--tooltip--top bx--tooltip--align-center"
|
|
445
|
+
data-floating-menu-direction="top"
|
|
446
|
+
id="test-1"
|
|
447
|
+
role="dialog"
|
|
448
|
+
style="left: -9999px; top: 0px;"
|
|
449
|
+
tabindex="-1"
|
|
450
|
+
>
|
|
451
|
+
<div
|
|
452
|
+
class="cv-interactive-tooltip__before-content"
|
|
453
|
+
style="position: absolute; left: -9999px; width: 1px; height: 1px;"
|
|
454
|
+
tabindex="0"
|
|
455
|
+
/>
|
|
456
|
+
<span
|
|
457
|
+
class="bx--tooltip__caret"
|
|
458
|
+
/>
|
|
459
|
+
<div
|
|
460
|
+
class="bx--tooltip__content"
|
|
461
|
+
>
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
</div>
|
|
465
|
+
<div
|
|
466
|
+
class="cv-interactive-tooltip__after-content"
|
|
467
|
+
style="position: absolute; left: -9999px; width: 1px; height: 1px;"
|
|
468
|
+
tabindex="0"
|
|
469
|
+
/>
|
|
470
|
+
</div>
|
|
471
|
+
`;
|
|
472
|
+
|
|
473
|
+
exports[`CvToopltip should render tooltip with aligment and direction set as expected 1`] = `
|
|
474
|
+
<button class="cv-tooltip bx--tooltip__trigger bx--tooltip--a11y bx--tooltip--right bx--tooltip--align-end" type="button"><span class="bx--assistive-text">this is a tip</span>
|
|
475
|
+
<anonymous-stub></anonymous-stub>
|
|
476
|
+
</button>
|
|
477
|
+
`;
|
|
478
|
+
|
|
479
|
+
exports[`CvToopltip should render tooltip with aligment set to \`center\` as expected 1`] = `
|
|
480
|
+
<button class="cv-tooltip bx--tooltip__trigger bx--tooltip--a11y bx--tooltip--top bx--tooltip--align-center" type="button"><span class="bx--assistive-text">this is a tip</span>
|
|
481
|
+
<anonymous-stub></anonymous-stub>
|
|
482
|
+
</button>
|
|
483
|
+
`;
|
|
484
|
+
|
|
485
|
+
exports[`CvToopltip should render tooltip with aligment set to \`end\` as expected 1`] = `
|
|
486
|
+
<button class="cv-tooltip bx--tooltip__trigger bx--tooltip--a11y bx--tooltip--top bx--tooltip--align-end" type="button"><span class="bx--assistive-text">this is a tip</span>
|
|
487
|
+
<anonymous-stub></anonymous-stub>
|
|
488
|
+
</button>
|
|
489
|
+
`;
|
|
490
|
+
|
|
491
|
+
exports[`CvToopltip should render tooltip with aligment set to \`start\` as expected 1`] = `
|
|
492
|
+
<button class="cv-tooltip bx--tooltip__trigger bx--tooltip--a11y bx--tooltip--top bx--tooltip--align-start" type="button"><span class="bx--assistive-text">this is a tip</span>
|
|
493
|
+
<anonymous-stub></anonymous-stub>
|
|
494
|
+
</button>
|
|
495
|
+
`;
|
|
496
|
+
|
|
497
|
+
exports[`CvToopltip should render tooltip with direction set to \`bottom\` as expected 1`] = `
|
|
498
|
+
<button class="cv-tooltip bx--tooltip__trigger bx--tooltip--a11y bx--tooltip--bottom bx--tooltip--align-center" type="button"><span class="bx--assistive-text">this is a tip</span>
|
|
499
|
+
<anonymous-stub></anonymous-stub>
|
|
500
|
+
</button>
|
|
501
|
+
`;
|
|
502
|
+
|
|
503
|
+
exports[`CvToopltip should render tooltip with direction set to \`left\` as expected 1`] = `
|
|
504
|
+
<button class="cv-tooltip bx--tooltip__trigger bx--tooltip--a11y bx--tooltip--left bx--tooltip--align-center" type="button"><span class="bx--assistive-text">this is a tip</span>
|
|
505
|
+
<anonymous-stub></anonymous-stub>
|
|
506
|
+
</button>
|
|
507
|
+
`;
|
|
508
|
+
|
|
509
|
+
exports[`CvToopltip should render tooltip with direction set to \`right\` as expected 1`] = `
|
|
510
|
+
<button class="cv-tooltip bx--tooltip__trigger bx--tooltip--a11y bx--tooltip--right bx--tooltip--align-center" type="button"><span class="bx--assistive-text">this is a tip</span>
|
|
511
|
+
<anonymous-stub></anonymous-stub>
|
|
512
|
+
</button>
|
|
513
|
+
`;
|
|
514
|
+
|
|
515
|
+
exports[`CvToopltip should render tooltip with direction set to \`top\` as expected 1`] = `
|
|
516
|
+
<button class="cv-tooltip bx--tooltip__trigger bx--tooltip--a11y bx--tooltip--top bx--tooltip--align-center" type="button"><span class="bx--assistive-text">this is a tip</span>
|
|
517
|
+
<anonymous-stub></anonymous-stub>
|
|
518
|
+
</button>
|
|
519
|
+
`;
|
|
520
|
+
|
|
521
|
+
exports[`CvToopltip should render tooltip: minimal as expected 1`] = `
|
|
522
|
+
<button class="cv-tooltip bx--tooltip__trigger bx--tooltip--a11y bx--tooltip--top bx--tooltip--align-center" type="button"><span class="bx--assistive-text">this is a tip</span>
|
|
523
|
+
<anonymous-stub></anonymous-stub>
|
|
524
|
+
</button>
|
|
525
|
+
`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const TipAlignments = {
|
|
2
|
+
center: 'center',
|
|
3
|
+
end: 'end',
|
|
4
|
+
start: 'start',
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const TipDirections = {
|
|
8
|
+
bottom: 'bottom',
|
|
9
|
+
left: 'left',
|
|
10
|
+
top: 'top',
|
|
11
|
+
right: 'right',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const alignments = Object.values(TipAlignments);
|
|
15
|
+
export const directions = Object.values(TipDirections);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import CvTooltip from './CvTooltip.vue';
|
|
2
|
+
import CvDefinitionTooltip from './CvDefinitionTooltip.vue';
|
|
3
|
+
import CvInteractiveTooltip from './CvInteractiveTooltip.vue';
|
|
4
|
+
export { CvTooltip, CvDefinitionTooltip, CvInteractiveTooltip };
|
|
5
|
+
export { TipAlignments, TipDirections, alignments, directions } from './consts';
|
|
6
|
+
export default CvTooltip;
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
:id="id"
|
|
16
16
|
@focusout="onFocusout"
|
|
17
17
|
@mousedown="onMouseDown"
|
|
18
|
+
@mouseenter="onHoverToggle(true)"
|
|
19
|
+
@mouseleave="onHoverToggle(false)"
|
|
18
20
|
ref="el"
|
|
19
21
|
>
|
|
20
22
|
<slot></slot>
|
|
@@ -62,6 +64,7 @@ const props = defineProps({
|
|
|
62
64
|
});
|
|
63
65
|
|
|
64
66
|
const el = ref(null);
|
|
67
|
+
const expandedViaHoverState = ref(false);
|
|
65
68
|
const panelExpanded = computed({
|
|
66
69
|
get() {
|
|
67
70
|
return data.dataExpanded;
|
|
@@ -107,7 +110,10 @@ watch(
|
|
|
107
110
|
}
|
|
108
111
|
);
|
|
109
112
|
const emit = defineEmits(['update:expanded', 'panel-resize']);
|
|
110
|
-
|
|
113
|
+
const isPanelExpanded = computed(
|
|
114
|
+
() => panelExpanded.value || expandedViaHoverState.value
|
|
115
|
+
);
|
|
116
|
+
watch(isPanelExpanded, current => {
|
|
111
117
|
emit('update:expanded', current);
|
|
112
118
|
emit('panel-resize', { id: props.id, expanded: current });
|
|
113
119
|
});
|
|
@@ -125,6 +131,9 @@ function onMouseDown(ev) {
|
|
|
125
131
|
ev.preventDefault();
|
|
126
132
|
}
|
|
127
133
|
}
|
|
134
|
+
function onHoverToggle(value) {
|
|
135
|
+
if (props.rail) expandedViaHoverState.value = value;
|
|
136
|
+
}
|
|
128
137
|
function toggleExpand() {
|
|
129
138
|
panelExpanded.value = data.dataExpanded;
|
|
130
139
|
}
|