@carbon/vue 2.40.0 → 2.42.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.40.0",
4
+ "version": "2.42.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -64,16 +64,16 @@
64
64
  },
65
65
  "sideEffects": true,
66
66
  "dependencies": {
67
- "@carbon/icons-vue": "10.27.0",
67
+ "@carbon/icons-vue": "10.41.0",
68
68
  "@carbon/telemetry": "^0.0.0-alpha.6",
69
- "carbon-components": "10.30.0",
69
+ "carbon-components": "10.46.0",
70
70
  "flatpickr": "4.6.9",
71
- "vue": "^2.6.12"
71
+ "vue": "^2.6.14"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@vue/cli-service": "^3.11.0",
75
75
  "eslint-plugin-prettier": "^3.3.1",
76
- "vue-template-compiler": "^2.6.12"
76
+ "vue-template-compiler": "^2.6.14"
77
77
  },
78
- "gitHead": "1db5405c2ab7fb83019637657bc637f2fc011848"
78
+ "gitHead": "ab0c2e9ac8f61f208d73291274108ce5c25cb527"
79
79
  }
@@ -29,7 +29,7 @@ export default {
29
29
  mixins: [buttonMixin, carbonPrefixMixin],
30
30
  components: { CvSvg },
31
31
  props: {
32
- label: { type: String, default: undefined },
32
+ label: { type: String, required: true },
33
33
  selected: Boolean,
34
34
  tipPosition: {
35
35
  type: String,
@@ -232,6 +232,7 @@ export default {
232
232
  searchLabel: { type: String, default: 'Search' },
233
233
  searchPlaceholder: { type: String, default: 'Search' },
234
234
  searchClearLabel: { type: String, default: 'Clear search' },
235
+ initialSearchValue: { type: String, default: '' },
235
236
  sortable: Boolean,
236
237
  title: String,
237
238
  columns: Array,
@@ -258,7 +259,7 @@ export default {
258
259
  batchActive: false,
259
260
  headingChecked: false,
260
261
  dataRowsSelected: this.rowsSelected,
261
- searchValue: '',
262
+ searchValue: this.initialSearchValue,
262
263
  clearSearchVisible: false,
263
264
  searchActive: false,
264
265
  registeredRows: [],
@@ -81,16 +81,6 @@ import { uidMixin, themeMixin, carbonPrefixMixin } from '../../mixins';
81
81
  import Calendar16 from '@carbon/icons-vue/es/calendar/16';
82
82
  import CvWrapper from '../cv-wrapper/_cv-wrapper';
83
83
 
84
- // Weekdays shorthand for english locale
85
- l10n.en.weekdays.shorthand.forEach((day, index) => {
86
- const currentDay = l10n.en.weekdays.shorthand;
87
- if (currentDay[index] === 'Thu' || currentDay[index] === 'Th') {
88
- currentDay[index] = 'Th';
89
- } else {
90
- currentDay[index] = currentDay[index].charAt(0);
91
- }
92
- });
93
-
94
84
  export default {
95
85
  name: 'CvDatePicker',
96
86
  mixins: [uidMixin, themeMixin, carbonPrefixMixin],
@@ -338,6 +328,17 @@ export default {
338
328
  this.$refs.todate.click();
339
329
  },
340
330
  },
331
+ created() {
332
+ // Weekdays shorthand for english locale
333
+ l10n.en.weekdays.shorthand.forEach((day, index) => {
334
+ const currentDay = l10n.en.weekdays.shorthand;
335
+ if (currentDay[index] === 'Thu' || currentDay[index] === 'Th') {
336
+ currentDay[index] = 'Th';
337
+ } else {
338
+ currentDay[index] = currentDay[index].charAt(0);
339
+ }
340
+ });
341
+ },
341
342
  mounted() {
342
343
  this.initFlatpickr();
343
344
  this.checkSlots();
@@ -131,6 +131,7 @@
131
131
  :name="item.name"
132
132
  :data-test="item.name"
133
133
  :label="item.label"
134
+ :disabled="item.disabled"
134
135
  style="pointer-events: none;"
135
136
  />
136
137
  </div>
@@ -407,7 +408,9 @@ export default {
407
408
  onEnter() {
408
409
  if (this.open) {
409
410
  this.onItemClick(this.highlighted);
410
- this.$refs.input.focus();
411
+ if (this.$refs.input) {
412
+ this.$refs.input.focus();
413
+ }
411
414
  this.filter = '';
412
415
 
413
416
  this.doOpen(false);
@@ -446,17 +449,20 @@ export default {
446
449
  this.highlighted = val;
447
450
  },
448
451
  onItemClick(val) {
449
- const index = this.dataValue.findIndex(item => val === item);
450
- if (index > -1) {
451
- this.dataValue.splice(index, 1);
452
- } else {
453
- this.dataValue.push(val);
454
- }
455
- if (this.selectionFeedback === selectionFeedbackOptions[TOP]) {
456
- this.updateOptions();
452
+ const option = this.options.find(item => item.value === val);
453
+ if (option && !option.disabled) {
454
+ const index = this.dataValue.findIndex(item => val === item);
455
+ if (index > -1) {
456
+ this.dataValue.splice(index, 1);
457
+ } else {
458
+ this.dataValue.push(val);
459
+ }
460
+ if (this.selectionFeedback === selectionFeedbackOptions[TOP]) {
461
+ this.updateOptions();
462
+ }
463
+ this.$refs.button.focus();
464
+ this.$emit('change', this.dataValue);
457
465
  }
458
- this.$refs.button.focus();
459
- this.$emit('change', this.dataValue);
460
466
  },
461
467
  inputClick() {
462
468
  if (!this.open) {
@@ -196,7 +196,7 @@ export default {
196
196
  },
197
197
  doScrollIntoView(index) {
198
198
  const tab = this.$refs.link[index];
199
- const scrollContainer = tab.parentNode ? tab.parentNode.parentNode : null;
199
+ const scrollContainer = tab && tab.parentNode ? tab.parentNode.parentNode : null;
200
200
  let newScrollLeft;
201
201
 
202
202
  if (tab && scrollContainer) {
@@ -2,7 +2,7 @@
2
2
  <div
3
3
  data-notification
4
4
  :class="[
5
- `cv-notifiation ${carbonPrefix}--toast-notification`,
5
+ `cv-notification ${carbonPrefix}--toast-notification`,
6
6
  `${carbonPrefix}--toast-notification--${kind.toLowerCase()}`,
7
7
  { [`${carbonPrefix}--toast-notification--low-contrast`]: lowContrast },
8
8
  ]"