@carbon/vue 3.0.24 → 3.0.26

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "@carbon/vue",
4
- "version": "3.0.23",
4
+ "version": "3.0.25",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -3174,7 +3174,7 @@
3174
3174
  "kind": "expression",
3175
3175
  "type": "string|number"
3176
3176
  },
3177
- "default": "''"
3177
+ "default": "undefined"
3178
3178
  },
3179
3179
  {
3180
3180
  "name": "formItem",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/vue",
3
3
  "license": "Apache-2.0",
4
- "version": "3.0.24",
4
+ "version": "3.0.26",
5
5
  "description": "A collection of components for the Carbon Design System built using Vue.js",
6
6
  "packageManager": "yarn@3.2.0",
7
7
  "main": "dist/carbon-vue-3.umd.min.js",
@@ -1,3 +1,16 @@
1
1
  import CvDataTable from './CvDataTable.vue';
2
- export { CvDataTable };
2
+ import CvDataTableAction from './CvDataTableAction.vue';
3
+ import CvDataTableCell from './CvDataTableCell.vue';
4
+ import CvDataTableHeading from './CvDataTableHeading.vue';
5
+ import CvDataTableRow from './CvDataTableRow.vue';
6
+ import CvDataTableSkeleton from './CvDataTableSkeleton.vue';
7
+
8
+ export {
9
+ CvDataTable,
10
+ CvDataTableAction,
11
+ CvDataTableCell,
12
+ CvDataTableHeading,
13
+ CvDataTableSkeleton,
14
+ CvDataTableRow,
15
+ };
3
16
  export default CvDataTable;
@@ -114,7 +114,7 @@ const props = defineProps({
114
114
  disabled: Boolean,
115
115
  modelValue: {
116
116
  type: [String, Number],
117
- default: '',
117
+ default: undefined,
118
118
  },
119
119
  formItem: {
120
120
  type: Boolean,
@@ -190,18 +190,22 @@ const modelValueType = typeof props.modelValue;
190
190
  const valuesToNaN = ['', null, undefined];
191
191
 
192
192
  const formatInputValueType = value => {
193
- if (modelValueType === 'string') return value.toString();
193
+ if (modelValueType === 'string') return Number(value).toString();
194
194
  // According to Vue2 component if there is no value NaN is emitted
195
195
  return valuesToNaN.includes(value) ? NaN : Number(value);
196
196
  };
197
197
 
198
+ const displayValue = ref(props.modelValue || props.min);
198
199
  const internalValue = computed({
199
200
  get() {
200
- return props.modelValue;
201
+ return props.modelValue || displayValue.value;
201
202
  },
202
203
  set(value) {
203
- const valueFormatted = formatInputValueType(value);
204
- onInput(valueFormatted);
204
+ displayValue.value = formatInputValueType(value);
205
+ if (typeof value === 'string') {
206
+ input.value.value = '';
207
+ }
208
+ onInput(displayValue.value);
205
209
  },
206
210
  });
207
211
 
@@ -33,7 +33,7 @@ export default {
33
33
  return h(props.svg);
34
34
  } else if (isSvg.value) {
35
35
  // an SVG document
36
- return h('svg', { domProps: { innerHTML: props.svg } });
36
+ return h('svg', { innerHTML: props.svg });
37
37
  } else {
38
38
  if (isSymbol.value) {
39
39
  return h('svg', {}, [h('use', { attrs: { href: props.svg } })]);
@@ -0,0 +1,11 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Svg with fake icon renders the SVG inline 1`] = `
4
+ <svg>
5
+ <!--?xml version="1.0" encoding="utf-8"?--><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="root">
6
+ <g fill-rule="evenodd" id="g">
7
+ <path id="path" d="M7 7H4v2h3v3h2V9h3V7H9V4H7v3zm1 9A8 8 0 1 1 8 0a8 8 0 0 1 0 16z"></path>
8
+ </g>
9
+ </svg>
10
+ </svg>
11
+ `;