@aurodesignsystem/auro-formkit 5.1.1 → 5.1.2

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 (44) hide show
  1. package/CHANGELOG.md +7 -2
  2. package/components/checkbox/demo/api.min.js +37 -9
  3. package/components/checkbox/demo/index.min.js +37 -9
  4. package/components/checkbox/dist/auro-checkbox.d.ts +7 -0
  5. package/components/checkbox/dist/index.js +37 -9
  6. package/components/checkbox/dist/registered.js +37 -9
  7. package/components/combobox/demo/api.min.js +51 -24
  8. package/components/combobox/demo/index.min.js +51 -24
  9. package/components/combobox/dist/index.js +51 -24
  10. package/components/combobox/dist/registered.js +51 -24
  11. package/components/counter/demo/api.min.js +25 -9
  12. package/components/counter/demo/index.min.js +25 -9
  13. package/components/counter/dist/index.js +25 -9
  14. package/components/counter/dist/registered.js +25 -9
  15. package/components/datepicker/demo/api.md +1 -0
  16. package/components/datepicker/demo/api.min.js +45 -19
  17. package/components/datepicker/demo/index.min.js +45 -19
  18. package/components/datepicker/dist/index.js +45 -19
  19. package/components/datepicker/dist/registered.js +45 -19
  20. package/components/dropdown/demo/api.min.js +8 -0
  21. package/components/dropdown/demo/index.min.js +8 -0
  22. package/components/dropdown/dist/index.js +8 -0
  23. package/components/dropdown/dist/registered.js +8 -0
  24. package/components/input/demo/api.min.js +17 -9
  25. package/components/input/demo/index.min.js +17 -9
  26. package/components/input/dist/index.js +17 -9
  27. package/components/input/dist/registered.js +17 -9
  28. package/components/layoutElement/dist/auroElement.d.ts +5 -0
  29. package/components/layoutElement/dist/index.js +8 -0
  30. package/components/layoutElement/dist/registered.js +8 -0
  31. package/components/menu/demo/api.min.js +8 -0
  32. package/components/menu/demo/index.min.js +8 -0
  33. package/components/menu/dist/index.js +8 -0
  34. package/components/menu/dist/registered.js +8 -0
  35. package/components/radio/demo/api.min.js +15 -13
  36. package/components/radio/demo/index.min.js +15 -13
  37. package/components/radio/dist/auro-radio.d.ts +1 -1
  38. package/components/radio/dist/index.js +15 -13
  39. package/components/radio/dist/registered.js +15 -13
  40. package/components/select/demo/api.min.js +25 -9
  41. package/components/select/demo/index.min.js +25 -9
  42. package/components/select/dist/index.js +25 -9
  43. package/components/select/dist/registered.js +25 -9
  44. package/package.json +1 -1
@@ -248,8 +248,8 @@ class AuroRadio extends i$2 {
248
248
  },
249
249
 
250
250
  /**
251
+ * Don't add to api.md since changing of this can easily break a11y.
251
252
  * @private
252
- * not to add to api.md since changing of this can easily break a11y.
253
253
  */
254
254
  role: {
255
255
  type: String,
@@ -1170,16 +1170,16 @@ class AuroFormValidation {
1170
1170
  }
1171
1171
 
1172
1172
  this.getErrorMessage(elem);
1173
-
1174
- elem.dispatchEvent(new CustomEvent('auroFormElement-validated', {
1175
- bubbles: true,
1176
- composed: true,
1177
- detail: {
1178
- validity: elem.validity,
1179
- message: elem.errorMessage
1180
- }
1181
- }));
1182
1173
  }
1174
+
1175
+ elem.dispatchEvent(new CustomEvent('auroFormElement-validated', {
1176
+ bubbles: true,
1177
+ composed: true,
1178
+ detail: {
1179
+ validity: elem.validity,
1180
+ message: elem.errorMessage
1181
+ }
1182
+ }));
1183
1183
  }
1184
1184
 
1185
1185
  /**
@@ -1796,13 +1796,15 @@ class AuroRadioGroup extends i$2 {
1796
1796
  * @returns {void}
1797
1797
  */
1798
1798
  initializeIndex() {
1799
- if (!this.disabled) {
1799
+ if (!this.disabled && this.items && this.items.length > 0) {
1800
1800
  const index = this.items.findIndex((item) => item.hasAttribute('checked') && !item.hasAttribute('disabled'));
1801
1801
  const nextEnabledIndex = this.items.findIndex((item) => !item.hasAttribute('disabled'));
1802
1802
 
1803
1803
  this.index = index >= 0 ? index : nextEnabledIndex;
1804
- this.items[this.index].setAttribute('tabindex', 0);
1805
- }
1804
+
1805
+ if (this.items[this.index]) {
1806
+ this.items[this.index].setAttribute('tabindex', 0);
1807
+ } }
1806
1808
  }
1807
1809
 
1808
1810
  /**
@@ -223,8 +223,8 @@ class AuroRadio extends i$2 {
223
223
  },
224
224
 
225
225
  /**
226
+ * Don't add to api.md since changing of this can easily break a11y.
226
227
  * @private
227
- * not to add to api.md since changing of this can easily break a11y.
228
228
  */
229
229
  role: {
230
230
  type: String,
@@ -1145,16 +1145,16 @@ class AuroFormValidation {
1145
1145
  }
1146
1146
 
1147
1147
  this.getErrorMessage(elem);
1148
-
1149
- elem.dispatchEvent(new CustomEvent('auroFormElement-validated', {
1150
- bubbles: true,
1151
- composed: true,
1152
- detail: {
1153
- validity: elem.validity,
1154
- message: elem.errorMessage
1155
- }
1156
- }));
1157
1148
  }
1149
+
1150
+ elem.dispatchEvent(new CustomEvent('auroFormElement-validated', {
1151
+ bubbles: true,
1152
+ composed: true,
1153
+ detail: {
1154
+ validity: elem.validity,
1155
+ message: elem.errorMessage
1156
+ }
1157
+ }));
1158
1158
  }
1159
1159
 
1160
1160
  /**
@@ -1771,13 +1771,15 @@ class AuroRadioGroup extends i$2 {
1771
1771
  * @returns {void}
1772
1772
  */
1773
1773
  initializeIndex() {
1774
- if (!this.disabled) {
1774
+ if (!this.disabled && this.items && this.items.length > 0) {
1775
1775
  const index = this.items.findIndex((item) => item.hasAttribute('checked') && !item.hasAttribute('disabled'));
1776
1776
  const nextEnabledIndex = this.items.findIndex((item) => !item.hasAttribute('disabled'));
1777
1777
 
1778
1778
  this.index = index >= 0 ? index : nextEnabledIndex;
1779
- this.items[this.index].setAttribute('tabindex', 0);
1780
- }
1779
+
1780
+ if (this.items[this.index]) {
1781
+ this.items[this.index].setAttribute('tabindex', 0);
1782
+ } }
1781
1783
  }
1782
1784
 
1783
1785
  /**
@@ -71,8 +71,8 @@ export class AuroRadio extends LitElement {
71
71
  attribute: boolean;
72
72
  };
73
73
  /**
74
+ * Don't add to api.md since changing of this can easily break a11y.
74
75
  * @private
75
- * not to add to api.md since changing of this can easily break a11y.
76
76
  */
77
77
  role: {
78
78
  type: StringConstructor;
@@ -183,8 +183,8 @@ class AuroRadio extends LitElement {
183
183
  },
184
184
 
185
185
  /**
186
+ * Don't add to api.md since changing of this can easily break a11y.
186
187
  * @private
187
- * not to add to api.md since changing of this can easily break a11y.
188
188
  */
189
189
  role: {
190
190
  type: String,
@@ -1098,16 +1098,16 @@ class AuroFormValidation {
1098
1098
  }
1099
1099
 
1100
1100
  this.getErrorMessage(elem);
1101
-
1102
- elem.dispatchEvent(new CustomEvent('auroFormElement-validated', {
1103
- bubbles: true,
1104
- composed: true,
1105
- detail: {
1106
- validity: elem.validity,
1107
- message: elem.errorMessage
1108
- }
1109
- }));
1110
1101
  }
1102
+
1103
+ elem.dispatchEvent(new CustomEvent('auroFormElement-validated', {
1104
+ bubbles: true,
1105
+ composed: true,
1106
+ detail: {
1107
+ validity: elem.validity,
1108
+ message: elem.errorMessage
1109
+ }
1110
+ }));
1111
1111
  }
1112
1112
 
1113
1113
  /**
@@ -1724,13 +1724,15 @@ class AuroRadioGroup extends LitElement {
1724
1724
  * @returns {void}
1725
1725
  */
1726
1726
  initializeIndex() {
1727
- if (!this.disabled) {
1727
+ if (!this.disabled && this.items && this.items.length > 0) {
1728
1728
  const index = this.items.findIndex((item) => item.hasAttribute('checked') && !item.hasAttribute('disabled'));
1729
1729
  const nextEnabledIndex = this.items.findIndex((item) => !item.hasAttribute('disabled'));
1730
1730
 
1731
1731
  this.index = index >= 0 ? index : nextEnabledIndex;
1732
- this.items[this.index].setAttribute('tabindex', 0);
1733
- }
1732
+
1733
+ if (this.items[this.index]) {
1734
+ this.items[this.index].setAttribute('tabindex', 0);
1735
+ } }
1734
1736
  }
1735
1737
 
1736
1738
  /**
@@ -183,8 +183,8 @@ class AuroRadio extends LitElement {
183
183
  },
184
184
 
185
185
  /**
186
+ * Don't add to api.md since changing of this can easily break a11y.
186
187
  * @private
187
- * not to add to api.md since changing of this can easily break a11y.
188
188
  */
189
189
  role: {
190
190
  type: String,
@@ -1098,16 +1098,16 @@ class AuroFormValidation {
1098
1098
  }
1099
1099
 
1100
1100
  this.getErrorMessage(elem);
1101
-
1102
- elem.dispatchEvent(new CustomEvent('auroFormElement-validated', {
1103
- bubbles: true,
1104
- composed: true,
1105
- detail: {
1106
- validity: elem.validity,
1107
- message: elem.errorMessage
1108
- }
1109
- }));
1110
1101
  }
1102
+
1103
+ elem.dispatchEvent(new CustomEvent('auroFormElement-validated', {
1104
+ bubbles: true,
1105
+ composed: true,
1106
+ detail: {
1107
+ validity: elem.validity,
1108
+ message: elem.errorMessage
1109
+ }
1110
+ }));
1111
1111
  }
1112
1112
 
1113
1113
  /**
@@ -1724,13 +1724,15 @@ class AuroRadioGroup extends LitElement {
1724
1724
  * @returns {void}
1725
1725
  */
1726
1726
  initializeIndex() {
1727
- if (!this.disabled) {
1727
+ if (!this.disabled && this.items && this.items.length > 0) {
1728
1728
  const index = this.items.findIndex((item) => item.hasAttribute('checked') && !item.hasAttribute('disabled'));
1729
1729
  const nextEnabledIndex = this.items.findIndex((item) => !item.hasAttribute('disabled'));
1730
1730
 
1731
1731
  this.index = index >= 0 ? index : nextEnabledIndex;
1732
- this.items[this.index].setAttribute('tabindex', 0);
1733
- }
1732
+
1733
+ if (this.items[this.index]) {
1734
+ this.items[this.index].setAttribute('tabindex', 0);
1735
+ } }
1734
1736
  }
1735
1737
 
1736
1738
  /**
@@ -170,6 +170,14 @@ let AuroElement$4 = class AuroElement extends i$2 {
170
170
  };
171
171
  }
172
172
 
173
+ /**
174
+ * Returns true if the element has focus.
175
+ * @returns {boolean} - Returns true if the element has focus.
176
+ */
177
+ get componentHasFocus() {
178
+ return this.matches(':focus');
179
+ }
180
+
173
181
  resetShapeClasses() {
174
182
  const wrapper = this.shadowRoot.querySelector('.wrapper');
175
183
 
@@ -1026,16 +1034,16 @@ class AuroFormValidation {
1026
1034
  }
1027
1035
 
1028
1036
  this.getErrorMessage(elem);
1029
-
1030
- elem.dispatchEvent(new CustomEvent('auroFormElement-validated', {
1031
- bubbles: true,
1032
- composed: true,
1033
- detail: {
1034
- validity: elem.validity,
1035
- message: elem.errorMessage
1036
- }
1037
- }));
1038
1037
  }
1038
+
1039
+ elem.dispatchEvent(new CustomEvent('auroFormElement-validated', {
1040
+ bubbles: true,
1041
+ composed: true,
1042
+ detail: {
1043
+ validity: elem.validity,
1044
+ message: elem.errorMessage
1045
+ }
1046
+ }));
1039
1047
  }
1040
1048
 
1041
1049
  /**
@@ -4531,6 +4539,14 @@ let AuroElement$3 = class AuroElement extends i$2 {
4531
4539
  };
4532
4540
  }
4533
4541
 
4542
+ /**
4543
+ * Returns true if the element has focus.
4544
+ * @returns {boolean} - Returns true if the element has focus.
4545
+ */
4546
+ get componentHasFocus() {
4547
+ return this.matches(':focus');
4548
+ }
4549
+
4534
4550
  resetShapeClasses() {
4535
4551
  const wrapper = this.shadowRoot.querySelector('.wrapper');
4536
4552
 
@@ -78,6 +78,14 @@ let AuroElement$4 = class AuroElement extends i$2 {
78
78
  };
79
79
  }
80
80
 
81
+ /**
82
+ * Returns true if the element has focus.
83
+ * @returns {boolean} - Returns true if the element has focus.
84
+ */
85
+ get componentHasFocus() {
86
+ return this.matches(':focus');
87
+ }
88
+
81
89
  resetShapeClasses() {
82
90
  const wrapper = this.shadowRoot.querySelector('.wrapper');
83
91
 
@@ -934,16 +942,16 @@ class AuroFormValidation {
934
942
  }
935
943
 
936
944
  this.getErrorMessage(elem);
937
-
938
- elem.dispatchEvent(new CustomEvent('auroFormElement-validated', {
939
- bubbles: true,
940
- composed: true,
941
- detail: {
942
- validity: elem.validity,
943
- message: elem.errorMessage
944
- }
945
- }));
946
945
  }
946
+
947
+ elem.dispatchEvent(new CustomEvent('auroFormElement-validated', {
948
+ bubbles: true,
949
+ composed: true,
950
+ detail: {
951
+ validity: elem.validity,
952
+ message: elem.errorMessage
953
+ }
954
+ }));
947
955
  }
948
956
 
949
957
  /**
@@ -4439,6 +4447,14 @@ let AuroElement$3 = class AuroElement extends i$2 {
4439
4447
  };
4440
4448
  }
4441
4449
 
4450
+ /**
4451
+ * Returns true if the element has focus.
4452
+ * @returns {boolean} - Returns true if the element has focus.
4453
+ */
4454
+ get componentHasFocus() {
4455
+ return this.matches(':focus');
4456
+ }
4457
+
4442
4458
  resetShapeClasses() {
4443
4459
  const wrapper = this.shadowRoot.querySelector('.wrapper');
4444
4460
 
@@ -38,6 +38,14 @@ let AuroElement$3 = class AuroElement extends LitElement {
38
38
  };
39
39
  }
40
40
 
41
+ /**
42
+ * Returns true if the element has focus.
43
+ * @returns {boolean} - Returns true if the element has focus.
44
+ */
45
+ get componentHasFocus() {
46
+ return this.matches(':focus');
47
+ }
48
+
41
49
  resetShapeClasses() {
42
50
  const wrapper = this.shadowRoot.querySelector('.wrapper');
43
51
 
@@ -894,16 +902,16 @@ class AuroFormValidation {
894
902
  }
895
903
 
896
904
  this.getErrorMessage(elem);
897
-
898
- elem.dispatchEvent(new CustomEvent('auroFormElement-validated', {
899
- bubbles: true,
900
- composed: true,
901
- detail: {
902
- validity: elem.validity,
903
- message: elem.errorMessage
904
- }
905
- }));
906
905
  }
906
+
907
+ elem.dispatchEvent(new CustomEvent('auroFormElement-validated', {
908
+ bubbles: true,
909
+ composed: true,
910
+ detail: {
911
+ validity: elem.validity,
912
+ message: elem.errorMessage
913
+ }
914
+ }));
907
915
  }
908
916
 
909
917
  /**
@@ -4393,6 +4401,14 @@ let AuroElement$2 = class AuroElement extends LitElement {
4393
4401
  };
4394
4402
  }
4395
4403
 
4404
+ /**
4405
+ * Returns true if the element has focus.
4406
+ * @returns {boolean} - Returns true if the element has focus.
4407
+ */
4408
+ get componentHasFocus() {
4409
+ return this.matches(':focus');
4410
+ }
4411
+
4396
4412
  resetShapeClasses() {
4397
4413
  const wrapper = this.shadowRoot.querySelector('.wrapper');
4398
4414
 
@@ -38,6 +38,14 @@ let AuroElement$3 = class AuroElement extends LitElement {
38
38
  };
39
39
  }
40
40
 
41
+ /**
42
+ * Returns true if the element has focus.
43
+ * @returns {boolean} - Returns true if the element has focus.
44
+ */
45
+ get componentHasFocus() {
46
+ return this.matches(':focus');
47
+ }
48
+
41
49
  resetShapeClasses() {
42
50
  const wrapper = this.shadowRoot.querySelector('.wrapper');
43
51
 
@@ -894,16 +902,16 @@ class AuroFormValidation {
894
902
  }
895
903
 
896
904
  this.getErrorMessage(elem);
897
-
898
- elem.dispatchEvent(new CustomEvent('auroFormElement-validated', {
899
- bubbles: true,
900
- composed: true,
901
- detail: {
902
- validity: elem.validity,
903
- message: elem.errorMessage
904
- }
905
- }));
906
905
  }
906
+
907
+ elem.dispatchEvent(new CustomEvent('auroFormElement-validated', {
908
+ bubbles: true,
909
+ composed: true,
910
+ detail: {
911
+ validity: elem.validity,
912
+ message: elem.errorMessage
913
+ }
914
+ }));
907
915
  }
908
916
 
909
917
  /**
@@ -4393,6 +4401,14 @@ let AuroElement$2 = class AuroElement extends LitElement {
4393
4401
  };
4394
4402
  }
4395
4403
 
4404
+ /**
4405
+ * Returns true if the element has focus.
4406
+ * @returns {boolean} - Returns true if the element has focus.
4407
+ */
4408
+ get componentHasFocus() {
4409
+ return this.matches(':focus');
4410
+ }
4411
+
4396
4412
  resetShapeClasses() {
4397
4413
  const wrapper = this.shadowRoot.querySelector('.wrapper');
4398
4414
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurodesignsystem/auro-formkit",
3
- "version": "5.1.1",
3
+ "version": "5.1.2",
4
4
  "description": "A collection of web components used to build forms.",
5
5
  "homepage": "https://github.com/AlaskaAirlines/auro-formkit#readme",
6
6
  "bugs": {