@carbon/vue 2.27.0-canary.1 → 2.27.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/vue",
3
3
  "description": "A collection of components for the Carbon Design System built using Vue.js",
4
- "version": "2.27.0-canary.1",
4
+ "version": "2.27.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -73,5 +73,5 @@
73
73
  "eslint-plugin-prettier": "^3.1.1",
74
74
  "vue-template-compiler": "^2.6.10"
75
75
  },
76
- "gitHead": "7fbfffa31a8dbe70c1317e690c0d285dd62c7fdb"
76
+ "gitHead": "48ffc15e8d83bb013b01139b1d88d4b542895796"
77
77
  }
@@ -12,7 +12,7 @@
12
12
  </template>
13
13
 
14
14
  <script>
15
- import CvFeedbackButton from './_cv-feedback-button';
15
+ import CvFeedbackButton from '../cv-feedback-button/_cv-feedback-button';
16
16
  import themeMixin from '../../mixins/theme-mixin';
17
17
 
18
18
  export default {
@@ -21,7 +21,7 @@
21
21
  </template>
22
22
 
23
23
  <script>
24
- import CvFeedbackButton from './_cv-feedback-button';
24
+ import CvFeedbackButton from '../cv-feedback-button/_cv-feedback-button';
25
25
  import CvButton from '../cv-button/cv-button';
26
26
 
27
27
  import Copy16 from '@carbon/icons-vue/es/copy/16';
@@ -12,7 +12,7 @@
12
12
  </template>
13
13
 
14
14
  <script>
15
- import CvFeedbackButton from './_cv-feedback-button';
15
+ import CvFeedbackButton from '../cv-feedback-button/_cv-feedback-button';
16
16
 
17
17
  import Copy16 from '@carbon/icons-vue/es/copy/16';
18
18
 
@@ -1,10 +1,8 @@
1
1
  <template>
2
2
  <div class="cv-combo-box bx--list-box__wrapper" @focusout="onFocusOut">
3
- <label v-if="title" :for="uid" class="bx--label" :class="{ 'bx--label--disabled': $attrs.disabled }">
4
- {{ title }}
5
- </label>
3
+ <label v-if="title" :for="uid" class="bx--label" :class="{ 'bx--label--disabled': disabled }">{{ title }}</label>
6
4
 
7
- <div v-if="isHelper" class="bx--form__helper-text" :class="{ 'bx--form__helper-text--disabled': $attrs.disabled }">
5
+ <div v-if="isHelper" class="bx--form__helper-text" :class="{ 'bx--form__helper-text--disabled': disabled }">
8
6
  <slot name="helper-text">{{ helperText }}</slot>
9
7
  </div>
10
8
 
@@ -16,10 +14,10 @@
16
14
  'bx--list-box--light': theme === 'light',
17
15
  'bx--combo-box--expanded': open,
18
16
  'bx--list-box--expanded': open,
19
- 'bx--combo-box--disabled bx--list-box--disabled': $attrs.disabled,
17
+ 'bx--combo-box--disabled bx--list-box--disabled': disabled,
20
18
  }"
21
19
  :data-invalid="isInvalid"
22
- v-bind="$attrs"
20
+ v-bind="$attr"
23
21
  @keydown.down.prevent="onDown"
24
22
  @keydown.up.prevent="onUp"
25
23
  @keydown.enter.prevent="onEnter"
@@ -46,8 +44,10 @@
46
44
  :aria-controls="uid"
47
45
  aria-autocomplete="list"
48
46
  role="combobox"
47
+ :aria-disabled="disabled"
49
48
  :aria-expanded="open"
50
49
  autocomplete="off"
50
+ :disabled="disabled"
51
51
  :placeholder="label"
52
52
  v-model="filter"
53
53
  @input="onInput"
@@ -109,6 +109,7 @@ export default {
109
109
  props: {
110
110
  autoFilter: Boolean,
111
111
  autoHighlight: Boolean,
112
+ disabled: Boolean,
112
113
  invalidMessage: { type: String, default: undefined },
113
114
  helperText: { type: String, default: undefined },
114
115
  title: String,
@@ -209,6 +210,7 @@ export default {
209
210
  this.isHelper = !!(this.$slots['helper-text'] || (this.helperText && this.helperText.length));
210
211
  },
211
212
  clearFilter() {
213
+ if (this.disabled) return;
212
214
  this.internalUpdateValue('');
213
215
  this.filter = '';
214
216
  this.$refs.input.focus();
@@ -280,6 +282,7 @@ export default {
280
282
  }
281
283
  },
282
284
  onInput() {
285
+ if (this.disabled) return;
283
286
  this.doOpen(true);
284
287
 
285
288
  this.updateOptions();
@@ -289,6 +292,7 @@ export default {
289
292
  this.open = newVal;
290
293
  },
291
294
  onDown() {
295
+ if (this.disabled) return;
292
296
  if (!this.open) {
293
297
  this.doOpen(true);
294
298
  } else {
@@ -296,15 +300,18 @@ export default {
296
300
  }
297
301
  },
298
302
  onUp() {
303
+ if (this.disabled) return;
299
304
  if (this.open) {
300
305
  this.doMove(true);
301
306
  }
302
307
  },
303
308
  onEsc() {
309
+ if (this.disabled) return;
304
310
  this.doOpen(false);
305
311
  this.$el.focus();
306
312
  },
307
313
  onEnter() {
314
+ if (this.disabled) return;
308
315
  this.doOpen(!this.open);
309
316
  if (!this.open) {
310
317
  this.onItemClick(this.highlighted);
@@ -312,6 +319,7 @@ export default {
312
319
  }
313
320
  },
314
321
  onClick() {
322
+ if (this.disabled) return;
315
323
  this.doOpen(!this.open);
316
324
  if (this.open) {
317
325
  this.$refs.input.focus();
@@ -340,17 +348,20 @@ export default {
340
348
  }
341
349
  },
342
350
  onItemClick(val) {
351
+ if (this.disabled) return;
343
352
  this.internalUpdateValue(val);
344
353
  this.$refs.input.focus();
345
354
  this.open = false; // close after user makes a selection
346
355
  this.$emit('change', this.dataValue);
347
356
  },
348
357
  inputClick() {
358
+ if (this.disabled) return;
349
359
  if (!this.open) {
350
360
  this.doOpen(true);
351
361
  }
352
362
  },
353
363
  inputFocus() {
364
+ if (this.disabled) return;
354
365
  this.doOpen(true);
355
366
  },
356
367
  },
@@ -22,9 +22,9 @@
22
22
  </td>
23
23
  <slot />
24
24
  <td v-if="hasOverflowMenu" class="bx--table-column-menu">
25
- <cv-overflow-menu flip-menu>
25
+ <cv-overflow-menu v-bind="overflowMenuOptions">
26
26
  <cv-overflow-menu-item
27
- v-for="(item, index) in overflowMenu"
27
+ v-for="(item, index) in overflowMenuButtons"
28
28
  :key="`${index}`"
29
29
  @click="
30
30
  onMenuItemClick({
@@ -97,6 +97,14 @@ export default {
97
97
  isChecked() {
98
98
  return this.dataChecked;
99
99
  },
100
+ overflowMenuButtons() {
101
+ return this.overflowMenu.filter(item => typeof item === 'string');
102
+ },
103
+ overflowMenuOptions() {
104
+ const incomingOptions = this.overflowMenu.find(item => typeof item === 'object') || {};
105
+ const defaultOptions = { flipMenu: true, label: 'Row overflow menu', tipPosition: 'left' };
106
+ return { ...defaultOptions, ...incomingOptions };
107
+ },
100
108
  },
101
109
  methods: {
102
110
  checkSlots() {
@@ -142,7 +142,7 @@
142
142
  :key="`cell:${colIndex}:${rowIndex}`"
143
143
  :style="dataStyle(colIndex)"
144
144
  >
145
- <cv-wrapper :tag-type="skeleton && rowIndex < 1 ? 'span' : ''">{{ cell }}</cv-wrapper>
145
+ <cv-wrapper :tag-type="skeleton ? 'span' : ''">{{ cell }}</cv-wrapper>
146
146
  </cv-data-table-cell>
147
147
  </cv-data-table-row>
148
148
  </slot>
@@ -22,9 +22,9 @@
22
22
  :class="{ 'bx--dropdown__wrapper--inline': inline, 'cv-dropdown': !formItem }"
23
23
  :style="wrapperStyleOverride"
24
24
  >
25
- <span v-if="label" :id="`${uid}-label`" class="bx--label" :class="{ 'bx--label--disabled': disabled }">
26
- {{ label }}
27
- </span>
25
+ <span v-if="label" :id="`${uid}-label`" class="bx--label" :class="{ 'bx--label--disabled': disabled }">{{
26
+ label
27
+ }}</span>
28
28
 
29
29
  <div
30
30
  v-if="!inline && isHelper"
@@ -58,10 +58,12 @@
58
58
  >
59
59
  <button
60
60
  class="bx--dropdown-text"
61
+ :aria-disabled="disabled"
61
62
  aria-haspopup="true"
62
63
  :aria-expanded="open"
63
64
  :aria-controls="`${uid}-menu`"
64
- :aria-labelledby="`${uid}-label ${uid}-value`"
65
+ :aria-labelledby="ariaLabeledBy"
66
+ :disabled="disabled"
65
67
  type="button"
66
68
  >
67
69
  <WarningFilled16 v-if="isInvalid && inline" class="bx--dropdown__invalid-icon" />
@@ -161,6 +163,13 @@ export default {
161
163
  },
162
164
  },
163
165
  computed: {
166
+ ariaLabeledBy() {
167
+ if (this.label) {
168
+ return `${this.uid}-label ${this.uid}-value`;
169
+ } else {
170
+ return `${this.uid}-value`;
171
+ }
172
+ },
164
173
  internalCaption() {
165
174
  if (this.selectedChild) {
166
175
  return this.selectedChild.internalContent;
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <button
3
+ aria-label="ariaLabel"
3
4
  type="button"
4
5
  class="cv-feedback-button"
5
6
  v-bind="$attrs"
@@ -27,6 +28,7 @@ export default {
27
28
  name: 'cvFeedbackButton',
28
29
  inheritAttrs: false,
29
30
  props: {
31
+ ariaLabel: { type: String, default: 'Feedback button' },
30
32
  feedback: { type: String, required: true },
31
33
  inline: Boolean,
32
34
  timeout: { type: Number, default: 2000 },
@@ -16,7 +16,13 @@
16
16
  @keyup.space.prevent="$emit('remove')"
17
17
  >
18
18
  <span class="bx--tag__label">{{ label }}</span>
19
- <button v-if="isFilter" class="bx--tag__close-icon" :aria-label="clearAriaLabel" @click.stop.prevent="onRemove">
19
+ <button
20
+ v-if="isFilter"
21
+ class="bx--tag__close-icon"
22
+ :aria-label="clearAriaLabel"
23
+ @click.stop.prevent="onRemove"
24
+ :disabled="disabled"
25
+ >
20
26
  <Close16 />
21
27
  </button>
22
28
  </span>