@supersoniks/concorde 1.1.23 → 1.1.24

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.
@@ -9,6 +9,7 @@ declare const Button_base: {
9
9
  radio: true | null;
10
10
  _checked: true | null;
11
11
  checked: true | null;
12
+ validateFormElement(): void;
12
13
  setCheckedValue(checked: true | null): void;
13
14
  handleChange(): void;
14
15
  getValueForFormPublisher(): any;
@@ -10,6 +10,7 @@ declare const Checkbox_base: {
10
10
  radio: true | null;
11
11
  _checked: true | null;
12
12
  checked: true | null;
13
+ validateFormElement(): void;
13
14
  setCheckedValue(checked: true | null): void;
14
15
  handleChange(): void;
15
16
  getValueForFormPublisher(): any;
@@ -25,6 +25,7 @@ declare const Form: <T extends Constructor<FormElementInterface>>(superClass: T)
25
25
  */
26
26
  _checked: true | null;
27
27
  checked: true | null;
28
+ validateFormElement(): void;
28
29
  setCheckedValue(checked: true | null): void;
29
30
  handleChange(): void;
30
31
  /**
@@ -64,6 +64,18 @@ const Form = (superClass) => {
64
64
  set checked(checked) {
65
65
  this.setCheckedValue(checked);
66
66
  }
67
+ validateFormElement() {
68
+ var _a;
69
+ const that = this;
70
+ const input = (_a = that.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("input");
71
+ if (!input || input.checkValidity())
72
+ return;
73
+ let value = this.getFormPublisher()[this.name].get();
74
+ if ((this.unique || this.radio) && (value !== null && value.toString().length > 0))
75
+ return;
76
+ this.getFormPublisher().isFormValid = false;
77
+ input.reportValidity();
78
+ }
67
79
  setCheckedValue(checked) {
68
80
  if (this._checked == checked)
69
81
  return;
package/mixins.d.ts CHANGED
@@ -47,6 +47,7 @@ export declare const FormCheckable: <T extends new (...args: any[]) => myFormEle
47
47
  radio: true | null;
48
48
  _checked: true | null;
49
49
  checked: true | null;
50
+ validateFormElement(): void;
50
51
  setCheckedValue(checked: true | null): void;
51
52
  handleChange(): void;
52
53
  getValueForFormPublisher(): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supersoniks/concorde",
3
- "version": "1.1.23",
3
+ "version": "1.1.24",
4
4
  "customElements": "custom-elements.json",
5
5
  "license": "MIT",
6
6
  "publishConfig": {