@vaadin/form-layout 23.1.0-alpha3 → 23.1.0-alpha4
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/form-layout",
|
|
3
|
-
"version": "23.1.0-
|
|
3
|
+
"version": "23.1.0-alpha4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -34,17 +34,17 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@polymer/polymer": "^3.0.0",
|
|
37
|
-
"@vaadin/component-base": "23.1.0-
|
|
38
|
-
"@vaadin/vaadin-lumo-styles": "23.1.0-
|
|
39
|
-
"@vaadin/vaadin-material-styles": "23.1.0-
|
|
40
|
-
"@vaadin/vaadin-themable-mixin": "23.1.0-
|
|
37
|
+
"@vaadin/component-base": "23.1.0-alpha4",
|
|
38
|
+
"@vaadin/vaadin-lumo-styles": "23.1.0-alpha4",
|
|
39
|
+
"@vaadin/vaadin-material-styles": "23.1.0-alpha4",
|
|
40
|
+
"@vaadin/vaadin-themable-mixin": "23.1.0-alpha4"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@esm-bundle/chai": "^4.3.4",
|
|
44
|
-
"@vaadin/custom-field": "23.1.0-
|
|
44
|
+
"@vaadin/custom-field": "23.1.0-alpha4",
|
|
45
45
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
46
|
-
"@vaadin/text-field": "23.1.0-
|
|
46
|
+
"@vaadin/text-field": "23.1.0-alpha4",
|
|
47
47
|
"sinon": "^13.0.2"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "aacdb7fe09811894751f0378ff7fb66071892c71"
|
|
50
50
|
}
|
package/src/vaadin-form-item.js
CHANGED
|
@@ -290,7 +290,7 @@ class FormItem extends ThemableMixin(PolymerElement) {
|
|
|
290
290
|
if (fieldNodes.length > 1) {
|
|
291
291
|
console.warn(
|
|
292
292
|
`WARNING: Since Vaadin 23, placing multiple fields directly to a <vaadin-form-item> is deprecated.
|
|
293
|
-
Please wrap fields with a <vaadin-custom-field> instead
|
|
293
|
+
Please wrap fields with a <vaadin-custom-field> instead.`,
|
|
294
294
|
);
|
|
295
295
|
}
|
|
296
296
|
|
|
@@ -217,10 +217,10 @@ class FormLayout extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))
|
|
|
217
217
|
return [
|
|
218
218
|
{ minWidth: 0, columns: 1, labelsPosition: 'top' },
|
|
219
219
|
{ minWidth: '20em', columns: 1 },
|
|
220
|
-
{ minWidth: '40em', columns: 2 }
|
|
220
|
+
{ minWidth: '40em', columns: 2 },
|
|
221
221
|
];
|
|
222
222
|
},
|
|
223
|
-
observer: '_responsiveStepsChanged'
|
|
223
|
+
observer: '_responsiveStepsChanged',
|
|
224
224
|
},
|
|
225
225
|
|
|
226
226
|
/**
|
|
@@ -228,7 +228,7 @@ class FormLayout extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))
|
|
|
228
228
|
* @private
|
|
229
229
|
*/
|
|
230
230
|
_columnCount: {
|
|
231
|
-
type: Number
|
|
231
|
+
type: Number,
|
|
232
232
|
},
|
|
233
233
|
|
|
234
234
|
/**
|
|
@@ -236,8 +236,8 @@ class FormLayout extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))
|
|
|
236
236
|
* @private
|
|
237
237
|
*/
|
|
238
238
|
_labelsOnTop: {
|
|
239
|
-
type: Boolean
|
|
240
|
-
}
|
|
239
|
+
type: Boolean,
|
|
240
|
+
},
|
|
241
241
|
};
|
|
242
242
|
}
|
|
243
243
|
|
|
@@ -314,7 +314,7 @@ class FormLayout extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))
|
|
|
314
314
|
_getObservableNodes(nodeList) {
|
|
315
315
|
const ignore = ['template', 'style', 'dom-repeat', 'dom-if'];
|
|
316
316
|
return Array.from(nodeList).filter(
|
|
317
|
-
(node) => node.nodeType === Node.ELEMENT_NODE && ignore.indexOf(node.localName.toLowerCase()) === -1
|
|
317
|
+
(node) => node.nodeType === Node.ELEMENT_NODE && ignore.indexOf(node.localName.toLowerCase()) === -1,
|
|
318
318
|
);
|
|
319
319
|
}
|
|
320
320
|
|
|
@@ -376,7 +376,7 @@ class FormLayout extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))
|
|
|
376
376
|
|
|
377
377
|
if (step.labelsPosition !== undefined && ['aside', 'top'].indexOf(step.labelsPosition) === -1) {
|
|
378
378
|
throw new Error(
|
|
379
|
-
`Invalid 'labelsPosition' value of ${step.labelsPosition}, 'aside' or 'top' string is required
|
|
379
|
+
`Invalid 'labelsPosition' value of ${step.labelsPosition}, 'aside' or 'top' string is required.`,
|
|
380
380
|
);
|
|
381
381
|
}
|
|
382
382
|
});
|
|
@@ -389,7 +389,7 @@ class FormLayout extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))
|
|
|
389
389
|
this.responsiveSteps = [
|
|
390
390
|
{ minWidth: 0, columns: 1, labelsPosition: 'top' },
|
|
391
391
|
{ minWidth: '20em', columns: 1 },
|
|
392
|
-
{ minWidth: '40em', columns: 2 }
|
|
392
|
+
{ minWidth: '40em', columns: 2 },
|
|
393
393
|
];
|
|
394
394
|
}
|
|
395
395
|
}
|
|
@@ -443,7 +443,7 @@ class FormLayout extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))
|
|
|
443
443
|
*/
|
|
444
444
|
updateStyles(properties = {}) {
|
|
445
445
|
console.warn(
|
|
446
|
-
`WARNING: Since Vaadin 23, updateStyles() is deprecated. Use the native element.style.setProperty API to set custom CSS property values
|
|
446
|
+
`WARNING: Since Vaadin 23, updateStyles() is deprecated. Use the native element.style.setProperty API to set custom CSS property values.`,
|
|
447
447
|
);
|
|
448
448
|
|
|
449
449
|
Object.entries(properties).forEach(([key, value]) => {
|
|
@@ -471,8 +471,8 @@ class FormLayout extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))
|
|
|
471
471
|
const columnSpacing = style.getPropertyValue('--vaadin-form-layout-column-spacing');
|
|
472
472
|
|
|
473
473
|
const direction = style.direction;
|
|
474
|
-
const marginStartProp =
|
|
475
|
-
const marginEndProp =
|
|
474
|
+
const marginStartProp = `margin-${direction === 'ltr' ? 'left' : 'right'}`;
|
|
475
|
+
const marginEndProp = `margin-${direction === 'ltr' ? 'right' : 'left'}`;
|
|
476
476
|
|
|
477
477
|
const containerWidth = this.offsetWidth;
|
|
478
478
|
|
|
@@ -520,7 +520,7 @@ class FormLayout extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))
|
|
|
520
520
|
const colspanRatio = (this._columnCount - col - colspan) / this._columnCount;
|
|
521
521
|
child.style.setProperty(
|
|
522
522
|
marginEndProp,
|
|
523
|
-
`calc(${colspanRatio * containerWidth}px + ${colspanRatio} * ${columnSpacing})
|
|
523
|
+
`calc(${colspanRatio * containerWidth}px + ${colspanRatio} * ${columnSpacing})`,
|
|
524
524
|
);
|
|
525
525
|
} else {
|
|
526
526
|
child.style.removeProperty(marginEndProp);
|