@vaadin/radio-group 24.6.0-alpha7 → 24.6.0-alpha9

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/radio-group",
3
- "version": "24.6.0-alpha7",
3
+ "version": "24.6.0-alpha9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -39,16 +39,16 @@
39
39
  "dependencies": {
40
40
  "@open-wc/dedupe-mixin": "^1.3.0",
41
41
  "@polymer/polymer": "^3.0.0",
42
- "@vaadin/a11y-base": "24.6.0-alpha7",
43
- "@vaadin/component-base": "24.6.0-alpha7",
44
- "@vaadin/field-base": "24.6.0-alpha7",
45
- "@vaadin/vaadin-lumo-styles": "24.6.0-alpha7",
46
- "@vaadin/vaadin-material-styles": "24.6.0-alpha7",
47
- "@vaadin/vaadin-themable-mixin": "24.6.0-alpha7",
42
+ "@vaadin/a11y-base": "24.6.0-alpha9",
43
+ "@vaadin/component-base": "24.6.0-alpha9",
44
+ "@vaadin/field-base": "24.6.0-alpha9",
45
+ "@vaadin/vaadin-lumo-styles": "24.6.0-alpha9",
46
+ "@vaadin/vaadin-material-styles": "24.6.0-alpha9",
47
+ "@vaadin/vaadin-themable-mixin": "24.6.0-alpha9",
48
48
  "lit": "^3.0.0"
49
49
  },
50
50
  "devDependencies": {
51
- "@vaadin/chai-plugins": "24.6.0-alpha7",
51
+ "@vaadin/chai-plugins": "24.6.0-alpha9",
52
52
  "@vaadin/testing-helpers": "^1.0.0",
53
53
  "sinon": "^18.0.0"
54
54
  },
@@ -56,5 +56,5 @@
56
56
  "web-types.json",
57
57
  "web-types.lit.json"
58
58
  ],
59
- "gitHead": "675d6fe0a08b8cc63ac00140c63f28fc3f52e4ea"
59
+ "gitHead": "e303d77ba20c3089c9998be9a318733d9ec5b53c"
60
60
  }
@@ -53,6 +53,11 @@ export declare function RadioGroupMixin<T extends Constructor<HTMLElement>>(
53
53
  T;
54
54
 
55
55
  export declare class RadioGroupMixinClass {
56
+ /**
57
+ * The name of the control, which is submitted with the form data.
58
+ */
59
+ name: string | null | undefined;
60
+
56
61
  /**
57
62
  * The value of the radio group.
58
63
  */
@@ -24,6 +24,15 @@ export const RadioGroupMixin = (superclass) =>
24
24
  class RadioGroupMixinClass extends FieldMixin(FocusMixin(DisabledMixin(KeyboardMixin(superclass)))) {
25
25
  static get properties() {
26
26
  return {
27
+ /**
28
+ * The name of the control, which is submitted with the form data.
29
+ */
30
+ name: {
31
+ type: String,
32
+ observer: '__nameChanged',
33
+ sync: true,
34
+ },
35
+
27
36
  /**
28
37
  * The value of the radio group.
29
38
  *
@@ -33,6 +42,7 @@ export const RadioGroupMixin = (superclass) =>
33
42
  type: String,
34
43
  notify: true,
35
44
  value: '',
45
+ sync: true,
36
46
  observer: '__valueChanged',
37
47
  },
38
48
 
@@ -48,6 +58,7 @@ export const RadioGroupMixin = (superclass) =>
48
58
  type: Boolean,
49
59
  value: false,
50
60
  reflectToAttribute: true,
61
+ sync: true,
51
62
  observer: '__readonlyChanged',
52
63
  },
53
64
 
@@ -190,6 +201,13 @@ export const RadioGroupMixin = (superclass) =>
190
201
  }
191
202
  }
192
203
 
204
+ /** @private */
205
+ __nameChanged(name) {
206
+ this.__radioButtons.forEach((radioButton) => {
207
+ radioButton.name = name || this._fieldName;
208
+ });
209
+ }
210
+
193
211
  /**
194
212
  * @param {number} index
195
213
  * @private
@@ -234,7 +252,7 @@ export const RadioGroupMixin = (superclass) =>
234
252
  * @private
235
253
  */
236
254
  __registerRadioButton(radioButton) {
237
- radioButton.name = this._fieldName;
255
+ radioButton.name = this.name || this._fieldName;
238
256
  radioButton.addEventListener('checked-changed', this.__onRadioButtonCheckedChange);
239
257
 
240
258
  if (this.disabled || this.readonly) {
@@ -303,7 +321,7 @@ export const RadioGroupMixin = (superclass) =>
303
321
  }
304
322
 
305
323
  if (oldValue !== undefined) {
306
- this.validate();
324
+ this._requestValidation();
307
325
  }
308
326
  }
309
327
 
@@ -380,7 +398,7 @@ export const RadioGroupMixin = (superclass) =>
380
398
  // Do not validate when focusout is caused by document
381
399
  // losing focus, which happens on browser tab switch.
382
400
  if (!focused && document.hasFocus()) {
383
- this.validate();
401
+ this._requestValidation();
384
402
  }
385
403
  }
386
404
 
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/radio-group",
4
- "version": "24.6.0-alpha7",
4
+ "version": "24.6.0-alpha9",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -198,6 +198,17 @@
198
198
  ]
199
199
  }
200
200
  },
201
+ {
202
+ "name": "manual-validation",
203
+ "description": "Set to true to enable manual validation mode. This mode disables automatic\nconstraint validation, allowing you to control the validation process yourself.\nYou can still trigger constraint validation manually with the `validate()` method\nor use `checkValidity()` to assess the component's validity without affecting\nthe invalid state. In manual validation mode, you can also manipulate\nthe `invalid` property directly through your application logic without conflicts\nwith the component's internal validation.",
204
+ "value": {
205
+ "type": [
206
+ "boolean",
207
+ "null",
208
+ "undefined"
209
+ ]
210
+ }
211
+ },
201
212
  {
202
213
  "name": "required",
203
214
  "description": "Specifies that the user must fill in a value.",
@@ -253,6 +264,17 @@
253
264
  ]
254
265
  }
255
266
  },
267
+ {
268
+ "name": "name",
269
+ "description": "The name of the control, which is submitted with the form data.",
270
+ "value": {
271
+ "type": [
272
+ "string",
273
+ "null",
274
+ "undefined"
275
+ ]
276
+ }
277
+ },
256
278
  {
257
279
  "name": "value",
258
280
  "description": "The value of the radio group.",
@@ -318,6 +340,17 @@
318
340
  ]
319
341
  }
320
342
  },
343
+ {
344
+ "name": "manualValidation",
345
+ "description": "Set to true to enable manual validation mode. This mode disables automatic\nconstraint validation, allowing you to control the validation process yourself.\nYou can still trigger constraint validation manually with the `validate()` method\nor use `checkValidity()` to assess the component's validity without affecting\nthe invalid state. In manual validation mode, you can also manipulate\nthe `invalid` property directly through your application logic without conflicts\nwith the component's internal validation.",
346
+ "value": {
347
+ "type": [
348
+ "boolean",
349
+ "null",
350
+ "undefined"
351
+ ]
352
+ }
353
+ },
321
354
  {
322
355
  "name": "required",
323
356
  "description": "Specifies that the user must fill in a value.",
@@ -373,6 +406,17 @@
373
406
  ]
374
407
  }
375
408
  },
409
+ {
410
+ "name": "name",
411
+ "description": "The name of the control, which is submitted with the form data.",
412
+ "value": {
413
+ "type": [
414
+ "string",
415
+ "null",
416
+ "undefined"
417
+ ]
418
+ }
419
+ },
376
420
  {
377
421
  "name": "value",
378
422
  "description": "The value of the radio group.",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/radio-group",
4
- "version": "24.6.0-alpha7",
4
+ "version": "24.6.0-alpha9",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -96,6 +96,13 @@
96
96
  "kind": "expression"
97
97
  }
98
98
  },
99
+ {
100
+ "name": "?manualValidation",
101
+ "description": "Set to true to enable manual validation mode. This mode disables automatic\nconstraint validation, allowing you to control the validation process yourself.\nYou can still trigger constraint validation manually with the `validate()` method\nor use `checkValidity()` to assess the component's validity without affecting\nthe invalid state. In manual validation mode, you can also manipulate\nthe `invalid` property directly through your application logic without conflicts\nwith the component's internal validation.",
102
+ "value": {
103
+ "kind": "expression"
104
+ }
105
+ },
99
106
  {
100
107
  "name": "?required",
101
108
  "description": "Specifies that the user must fill in a value.",
@@ -145,6 +152,13 @@
145
152
  "kind": "expression"
146
153
  }
147
154
  },
155
+ {
156
+ "name": ".name",
157
+ "description": "The name of the control, which is submitted with the form data.",
158
+ "value": {
159
+ "kind": "expression"
160
+ }
161
+ },
148
162
  {
149
163
  "name": ".value",
150
164
  "description": "The value of the radio group.",