@carbon/vue 1.0.2 → 1.1.3

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.
Files changed (89) hide show
  1. package/CHANGELOG.md +192 -0
  2. package/README.md +156 -211
  3. package/dist/carbon-vue.common.js +10567 -12509
  4. package/dist/carbon-vue.common.js.map +1 -1
  5. package/dist/carbon-vue.umd.js +10567 -12509
  6. package/dist/carbon-vue.umd.js.map +1 -1
  7. package/dist/carbon-vue.umd.min.js +31 -7
  8. package/dist/carbon-vue.umd.min.js.map +1 -1
  9. package/dist/demo.html +2 -2
  10. package/package.json +17 -157
  11. package/src/components/cv-accordion/_cv-accordion-item-skeleton.vue +3 -13
  12. package/src/components/cv-accordion/cv-accordion-item.vue +2 -9
  13. package/src/components/cv-breadcrumb/cv-breadcrumb-item.vue +3 -1
  14. package/src/components/cv-button/cv-button-skeleton.vue +1 -6
  15. package/src/components/cv-button/cv-button.vue +15 -37
  16. package/src/components/cv-checkbox/cv-checkbox.vue +42 -26
  17. package/src/components/cv-code-snippet/_cv-code-snippet-multiline.vue +13 -23
  18. package/src/components/cv-code-snippet/_cv-code-snippet-oneline.vue +11 -5
  19. package/src/components/cv-code-snippet/_cv-feedback-button.vue +1 -3
  20. package/src/components/cv-code-snippet/cv-code-snippet.vue +2 -7
  21. package/src/components/cv-content-switcher/cv-content-switcher-button.vue +20 -4
  22. package/src/components/cv-content-switcher/cv-content-switcher.vue +3 -10
  23. package/src/components/cv-data-table/cv-data-table-row.vue +15 -11
  24. package/src/components/cv-data-table/cv-data-table.vue +30 -28
  25. package/src/components/cv-date-picker/cv-date-picker.vue +53 -47
  26. package/src/components/cv-dropdown/_cv-dropdown-inner-c10.vue +226 -0
  27. package/src/components/cv-dropdown/_cv-dropdown-inner.vue +201 -0
  28. package/src/components/cv-dropdown/cv-dropdown-item.vue +6 -8
  29. package/src/components/cv-dropdown/cv-dropdown-skeleton.vue +1 -5
  30. package/src/components/cv-dropdown/cv-dropdown.vue +22 -169
  31. package/src/components/cv-file-uploader/cv-file-uploader.vue +44 -22
  32. package/src/components/cv-inline-loading/cv-inline-loading.vue +37 -0
  33. package/src/components/cv-inline-notification/cv-inline-notification.vue +22 -19
  34. package/src/components/cv-link/cv-link.vue +1 -6
  35. package/src/components/cv-loading/cv-loading.vue +13 -4
  36. package/src/components/cv-modal/cv-modal.vue +17 -15
  37. package/src/components/cv-number-input/cv-number-input.vue +20 -32
  38. package/src/components/cv-overflow-menu/cv-overflow-menu.vue +13 -19
  39. package/src/components/cv-pagination/cv-pagination.vue +61 -42
  40. package/src/components/cv-progress/_cv-progress-step-complete.vue +3 -12
  41. package/src/components/cv-progress/cv-progress-step.vue +97 -0
  42. package/src/components/cv-progress/cv-progress.vue +68 -13
  43. package/src/components/cv-radio-button/cv-radio-button.vue +1 -0
  44. package/src/components/cv-search/cv-search.vue +144 -15
  45. package/src/components/cv-select/cv-select-option.vue +3 -1
  46. package/src/components/cv-select/cv-select.vue +147 -15
  47. package/src/components/cv-slider/cv-slider.vue +14 -43
  48. package/src/components/cv-structured-list/_cv-structured-list-item-selectable.vue +18 -6
  49. package/src/components/cv-structured-list/cv-structured-list-item.vue +1 -3
  50. package/src/components/cv-structured-list/cv-structured-list.vue +10 -2
  51. package/src/components/cv-tabs/cv-tabs.vue +31 -15
  52. package/src/components/cv-tag/cv-tag.vue +23 -13
  53. package/src/components/cv-text-area/cv-text-area.vue +23 -10
  54. package/src/components/cv-text-input/cv-text-input.vue +80 -10
  55. package/src/components/cv-tile/_cv-tile-clickable.vue +1 -5
  56. package/src/components/cv-tile/_cv-tile-expandable.vue +11 -15
  57. package/src/components/cv-tile/_cv-tile-selectable.vue +14 -3
  58. package/src/components/cv-tile/cv-tile.vue +1 -4
  59. package/src/components/cv-time-picker/cv-time-picker.vue +27 -29
  60. package/src/components/cv-toast-notification/cv-toast-notification.vue +32 -6
  61. package/src/components/cv-toggle/cv-toggle.vue +3 -7
  62. package/src/components/cv-toolbar/cv-toolbar-option.vue +1 -4
  63. package/src/components/cv-toolbar/cv-toolbar-search.vue +5 -0
  64. package/src/components/cv-tooltip/cv-definition-tooltip.vue +1 -3
  65. package/src/components/cv-tooltip/cv-interactive-tooltip.vue +13 -28
  66. package/src/components/cv-tooltip/cv-tooltip.vue +11 -15
  67. package/src/components/cv-wrapper/_cv-wrapper.js +33 -0
  68. package/src/index-components-vue.js +1 -3
  69. package/src/index.js +1 -5
  70. package/src/{_internal/_feature-flags.js → internal/feature-flags.js} +30 -2
  71. package/dist/carbon-data-viz-vue.common.js +0 -23907
  72. package/dist/carbon-data-viz-vue.common.js.map +0 -1
  73. package/dist/carbon-data-viz-vue.css +0 -1
  74. package/dist/carbon-data-viz-vue.umd.js +0 -23917
  75. package/dist/carbon-data-viz-vue.umd.js.map +0 -1
  76. package/dist/carbon-data-viz-vue.umd.min.js +0 -2
  77. package/dist/carbon-data-viz-vue.umd.min.js.map +0 -1
  78. package/src/assets/styles/_carbon-helpers.scss +0 -8
  79. package/src/components/cv-checkbox/_cv-checkbox-inner-form-item.vue +0 -19
  80. package/src/components/cv-checkbox/_cv-checkbox-inner.vue +0 -59
  81. package/src/components/cv-progress/_cv-progress-step.vue +0 -51
  82. package/src/components/cv-search/_cv-search-inner-form-item.vue +0 -22
  83. package/src/components/cv-search/_cv-search-inner.vue +0 -162
  84. package/src/components/cv-select/_cv-select-inner-form-item.vue +0 -22
  85. package/src/components/cv-select/_cv-select-inner.vue +0 -78
  86. package/src/data-viz/cv-bar-graph/cv-bar-graph.vue +0 -495
  87. package/src/data-viz/cv-gauge/cv-gauge.vue +0 -196
  88. package/src/data-viz/cv-pie-chart/cv-pie-chart.vue +0 -194
  89. package/src/index-data-viz.js +0 -29
@@ -1,8 +0,0 @@
1
- //---------------------------------------------------------------------------
2
- // Carbon SCSS vars, mixins, functions, etc. for @import'ing into components.
3
- //---------------------------------------------------------------------------
4
-
5
- @import '~carbon-components/scss/globals/scss/colors';
6
- @import '~carbon-components/scss/globals/scss/layer';
7
- @import '~carbon-components/scss/globals/scss/typography';
8
- @import '~carbon-components/scss/globals/scss/vars';
@@ -1,19 +0,0 @@
1
- <template>
2
- <div class="bx--form-item">
3
- <cv-checkbox-inner v-bind="$attrs" v-on="$listeners">
4
- <slot />
5
- </cv-checkbox-inner>
6
- </div>
7
- </template>
8
-
9
- <script>
10
- import CvCheckboxInner from './_cv-checkbox-inner';
11
-
12
- export default {
13
- name: 'CvSelectInnerFormItem',
14
- components: { CvCheckboxInner },
15
- inheritAttrs: false,
16
- };
17
- </script>
18
-
19
- <style lang="scss"></style>
@@ -1,59 +0,0 @@
1
- <template>
2
- <div class="cv-checkbox bx--form-item bx--checkbox-wrapper">
3
- <label
4
- :class="[
5
- 'bx--checkbox-label',
6
- {
7
- 'bx--label--disabled':
8
- $attrs.disabled !== undefined && $attrs.disabled,
9
- 'bx--checkbox-label__focus': hasFocus,
10
- },
11
- ]"
12
- :data-contained-checkbox-state="isChecked"
13
- >
14
- <input
15
- ref="input"
16
- v-bind="$attrs"
17
- v-on="inputListeners"
18
- class="bx--checkbox"
19
- type="checkbox"
20
- :checked="isChecked === true"
21
- :aria-checked="`${isChecked}`"
22
- @focus="onFocus"
23
- @blur="onBlur"
24
- :value="value"
25
- />
26
- {{ label }}
27
- </label>
28
- </div>
29
- </template>
30
-
31
- <script>
32
- import checkMixin from '../../mixins/check-mixin';
33
-
34
- export default {
35
- name: 'CvCheckboxInner',
36
- mixins: [checkMixin],
37
- inheritAttrs: false,
38
- props: {
39
- label: String,
40
- mixed: Boolean,
41
- },
42
- data() {
43
- return {
44
- dataMixed: this.mixed,
45
- hasFocus: false,
46
- };
47
- },
48
- methods: {
49
- onFocus() {
50
- this.hasFocus = true;
51
- },
52
- onBlur() {
53
- this.hasFocus = false;
54
- },
55
- },
56
- };
57
- </script>
58
-
59
- <style lang="scss"></style>
@@ -1,51 +0,0 @@
1
- <template>
2
- <li class="cv-progress-step bx--progress-step" :class="stateClass">
3
- <cv-progress-step-complete v-if="isComplete" />
4
- <cv-progress-step-incomplete v-if="!isComplete" :is-current="isCurrent" />
5
- <p class="bx--progress-label">{{ label }}</p>
6
- <span class="bx--progress-line"></span>
7
- </li>
8
- </template>
9
-
10
- <script>
11
- import CvProgressStepComplete from './_cv-progress-step-complete';
12
- import CvProgressStepIncomplete from './_cv-progress-step-incomplete';
13
-
14
- const states = {
15
- incomplete: 'incomplete',
16
- current: 'current',
17
- complete: 'complete',
18
- };
19
-
20
- export default {
21
- name: 'CvProgressStep',
22
- components: {
23
- CvProgressStepComplete,
24
- CvProgressStepIncomplete,
25
- },
26
- props: {
27
- label: String,
28
- state: {
29
- type: String,
30
- validator(val) {
31
- return states[val] !== undefined;
32
- },
33
- },
34
- },
35
- computed: {
36
- isComplete() {
37
- return this.state === states.complete;
38
- },
39
- isCurrent() {
40
- return this.state === states.current;
41
- },
42
- stateClass() {
43
- if (this.state === states.incmoplete) {
44
- return '';
45
- } else {
46
- return `bx--progress-step--${this.state}`;
47
- }
48
- },
49
- },
50
- };
51
- </script>
@@ -1,22 +0,0 @@
1
- <template>
2
- <div class="bx--form-item">
3
- <cv-search-inner v-bind="$attrs" v-on="$listeners" :value="value">
4
- <slot></slot>
5
- </cv-search-inner>
6
- </div>
7
- </template>
8
-
9
- <script>
10
- import CvSearchInner from './_cv-search-inner';
11
-
12
- export default {
13
- name: 'CvSearchInnerFormItem',
14
- components: { CvSearchInner },
15
- inheritAttrs: false,
16
- props: {
17
- value: String,
18
- },
19
- };
20
- </script>
21
-
22
- <style lang="scss"></style>
@@ -1,162 +0,0 @@
1
- <template>
2
- <div class="bx--search" :class="searchClasses" role="search" ref="search">
3
- <label :id="uid" class="bx--label" for="search__input-1">{{ label }}</label>
4
-
5
- <input
6
- :id="uid"
7
- class="bx--search-input"
8
- v-bind="$attrs"
9
- v-model="internalValue"
10
- v-on="inputListeners"
11
- type="text"
12
- role="search"
13
- ref="input"
14
- :placeholder="placeholder"
15
- :aria-labelledby="uid"
16
- @focusout="checkFocus"
17
- />
18
-
19
- <button
20
- type="button"
21
- v-if="isToolbarKind"
22
- class="bx--toolbar-search__btn"
23
- aria-label="Toolbar search"
24
- @click="toggleActive(true)"
25
- @focusout="checkFocus"
26
- >
27
- <svg
28
- class="bx--search-magnifier"
29
- width="16"
30
- height="16"
31
- viewBox="0 0 16 16"
32
- >
33
- <path
34
- d="M6.5 12a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11zm4.936-1.27l4.563 4.557-.707.708-4.563-4.558a6.5 6.5 0 1 1 .707-.707z"
35
- fill-rule="nonzero"
36
- ></path>
37
- </svg>
38
- </button>
39
- <svg
40
- v-else
41
- class="bx--search-magnifier"
42
- width="16"
43
- height="16"
44
- viewBox="0 0 16 16"
45
- >
46
- <path
47
- d="M6.5 12a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11zm4.936-1.27l4.563 4.557-.707.708-4.563-4.558a6.5 6.5 0 1 1 .707-.707z"
48
- fill-rule="nonzero"
49
- ></path>
50
- </svg>
51
-
52
- <button
53
- type="button"
54
- class="bx--search-close"
55
- :class="{ 'bx--search-close--hidden': !clearVisible }"
56
- title="Clear search input"
57
- aria-label="Clear search input"
58
- @click="onClearClick"
59
- >
60
- <svg
61
- width="16"
62
- height="16"
63
- viewBox="0 0 16 16"
64
- xmlns="http://www.w3.org/2000/svg"
65
- >
66
- <path
67
- d="M8 6.586L5.879 4.464 4.464 5.88 6.586 8l-2.122 2.121 1.415 1.415L8 9.414l2.121 2.122 1.415-1.415L9.414 8l2.122-2.121-1.415-1.415L8 6.586zM8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16z"
68
- fill-rule="evenodd"
69
- ></path>
70
- </svg>
71
- </button>
72
- </div>
73
- </template>
74
-
75
- <script>
76
- import uidMixin from '../../mixins/uid-mixin';
77
- import themeMixin from '../../mixins/theme-mixin';
78
-
79
- export default {
80
- name: 'CvSearchInner',
81
- mixins: [uidMixin, themeMixin],
82
- inheritAttrs: false,
83
- props: {
84
- kind: { type: String, default: null },
85
- label: String,
86
- large: Boolean,
87
- value: String,
88
- placeholder: { type: String, default: 'Search' },
89
- },
90
- data() {
91
- return {
92
- clearVisible: this.value ? this.value.length : false,
93
- internalValue: this.value,
94
- toolbarActive: false,
95
- };
96
- },
97
- watch: {
98
- value() {
99
- this.clearVisible = this.value ? this.value.length : false;
100
- this.internalValue = this.value;
101
- },
102
- },
103
- computed: {
104
- // Bind listeners at the component level to the embedded input element and
105
- // add our own input listener to service the v-model. See:
106
- // https://vuejs.org/v2/guide/components-custom-events.html#Customizing-Component-v-model
107
- inputListeners() {
108
- return {
109
- ...this.$listeners,
110
- input: this.onInput,
111
- };
112
- },
113
- searchClasses() {
114
- const themeClass = this.theme.length ? `bx--search--${this.theme}` : '';
115
- const sizeClass = `bx--search--${this.large ? 'lg' : 'sm'}`;
116
- let toolbarClasses = '';
117
- if (this.isToolbarKind) {
118
- toolbarClasses = this.toolbarActive
119
- ? 'bx--toolbar-search bx--toolbar-search--active'
120
- : 'bx--toolbar-search';
121
- }
122
- return `${themeClass} ${sizeClass} ${toolbarClasses}`;
123
- },
124
- closeHiddenClass() {
125
- return this.clearVisible ? '' : 'bx--search-close--hidden';
126
- },
127
- isToolbarKind() {
128
- return this.kind === 'toolbar';
129
- },
130
- },
131
- methods: {
132
- onClearClick() {
133
- this.internalValue = '';
134
- this.clearVisible = false;
135
- this.$emit('input', this.internalValue);
136
- },
137
- onInput() {
138
- this.clearVisible = this.internalValue.length > 0;
139
- return this.$emit('input', this.internalValue);
140
- },
141
- toggleActive(force) {
142
- if (typeof force === 'boolean') {
143
- this.toolbarActive = force;
144
- } else {
145
- this.toolbarActive = !this.toolbarActive;
146
- }
147
- if (this.toolbarActive) {
148
- this.$refs.input.focus();
149
- }
150
- },
151
- checkFocus(ev) {
152
- if (this.isToolbarKind) {
153
- if (!this.$el.contains(ev.relatedTarget)) {
154
- this.toolbarActive = false;
155
- }
156
- }
157
- },
158
- },
159
- };
160
- </script>
161
-
162
- <style lang="scss"></style>
@@ -1,22 +0,0 @@
1
- <template>
2
- <div class="bx--form-item">
3
- <cv-select-inner v-bind="$attrs" v-on="$listeners" :value="value">
4
- <slot></slot>
5
- </cv-select-inner>
6
- </div>
7
- </template>
8
-
9
- <script>
10
- import CvSelectInner from './_cv-select-inner';
11
-
12
- export default {
13
- name: 'CvSelectInnerFormItem',
14
- components: { CvSelectInner },
15
- inheritAttrs: false,
16
- props: {
17
- value: String,
18
- },
19
- };
20
- </script>
21
-
22
- <style lang="scss"></style>
@@ -1,78 +0,0 @@
1
- <template>
2
- <!-- <div class="cv-select bx--form-item" :is="formItem ? 'div' : 'span'"> -->
3
- <div
4
- class="bx--select"
5
- :class="{
6
- 'bx--select--inline': inline,
7
- 'bx--select--light': theme === 'light',
8
- }"
9
- >
10
- <select
11
- v-bind="$attrs"
12
- :id="uid"
13
- class="bx--select-input"
14
- v-on="inputListeners"
15
- ref="select"
16
- :value="value"
17
- >
18
- <slot></slot>
19
- </select>
20
- <svg class="bx--select__arrow" width="10" height="5" viewBox="0 0 10 5">
21
- <path d="M0 0l5 4.998L10 0z" fill-rule="evenodd"></path>
22
- </svg>
23
- <label
24
- :for="uid"
25
- class="bx--label"
26
- :class="{ 'bx--visually-hidden': hideLabel }"
27
- >{{ label }}</label
28
- >
29
- </div>
30
- </template>
31
-
32
- <script>
33
- import uidMixin from '../../mixins/uid-mixin';
34
- import themeMixin from '../../mixins/theme-mixin';
35
-
36
- export default {
37
- name: 'CvSelectInner',
38
- inheritAttrs: false,
39
- mixins: [uidMixin, themeMixin],
40
- props: {
41
- inline: Boolean,
42
- hideLabel: Boolean,
43
- label: { type: String, required: true },
44
- // *********************
45
- // declare here to prevent the following from being added to the select
46
- // *********************
47
- // multiple does not work with styling from carbon-components 9.20
48
- multiple: {
49
- type: String,
50
- validator: () => {
51
- console.warn('property multiple not supported in CvSelect');
52
- return false;
53
- },
54
- },
55
- value: { type: String },
56
- },
57
- beforeCreate() {
58
- // *********************
59
- // delete here to prevent the following from being added to the select
60
- // *********************
61
- // multiple does not work with styling from carbon-components 9.20
62
- delete this.$attrs.multiple;
63
- },
64
- computed: {
65
- // Bind listeners at the component level to the embedded input element and
66
- // add our own input listener to service the v-model. See:
67
- // https://vuejs.org/v2/guide/components-custom-events.html#Customizing-Component-v-model
68
- inputListeners() {
69
- return {
70
- ...this.$listeners,
71
- input: event => this.$emit('input', event.target.value),
72
- };
73
- },
74
- },
75
- };
76
- </script>
77
-
78
- <style lang="scss"></style>