@thecb/components 6.1.0-beta.7 → 6.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.
- package/dist/index.cjs.js +10 -17
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +10 -17
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/checkbox/Checkbox.js +2 -0
- package/src/components/molecules/periscope-dashboard-iframe/PeriscopeDashboardIframe.js +4 -2
- package/src/util/focusFirstInvalidInputHook.js +1 -3
- package/src/util/general.js +1 -12
- package/src/.DS_Store +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -6100,17 +6100,9 @@ var safeChildren = function safeChildren(children) {
|
|
|
6100
6100
|
|
|
6101
6101
|
return unsafeValues.includes(children) ? replacement : children;
|
|
6102
6102
|
};
|
|
6103
|
-
var generateClickHandler = function generateClickHandler(form, handleErrors, submitForm
|
|
6103
|
+
var generateClickHandler = function generateClickHandler(form, handleErrors, submitForm) {
|
|
6104
6104
|
return function (e) {
|
|
6105
6105
|
e.preventDefault();
|
|
6106
|
-
|
|
6107
|
-
if (resetErrors) {
|
|
6108
|
-
console.log("reset errors", resetErrors); // if provided, will reset error state tracker
|
|
6109
|
-
// allows hooks that depend on error state to re-run
|
|
6110
|
-
|
|
6111
|
-
resetErrors(false);
|
|
6112
|
-
}
|
|
6113
|
-
|
|
6114
6106
|
var formHasError = Object.values(form.fields).reduce(function (acc, curr) {
|
|
6115
6107
|
return acc || curr.hasErrors;
|
|
6116
6108
|
}, false);
|
|
@@ -19177,7 +19169,9 @@ var Checkbox = function Checkbox(_ref4) {
|
|
|
19177
19169
|
"aria-label": name,
|
|
19178
19170
|
checked: checked,
|
|
19179
19171
|
onChange: onChange,
|
|
19180
|
-
tabIndex: "-1"
|
|
19172
|
+
tabIndex: "-1",
|
|
19173
|
+
"aria-invalid": error,
|
|
19174
|
+
"aria-describedby": "".concat(name, "-error-message")
|
|
19181
19175
|
}), /*#__PURE__*/React__default.createElement(StyledCheckbox, {
|
|
19182
19176
|
error: error,
|
|
19183
19177
|
disabled: disabled,
|
|
@@ -43325,12 +43319,14 @@ var PeriscopeDashboardIframe = function PeriscopeDashboardIframe(_ref) {
|
|
|
43325
43319
|
};
|
|
43326
43320
|
React.useEffect(function () {
|
|
43327
43321
|
time.timer = setTimeout(function () {
|
|
43328
|
-
|
|
43322
|
+
if (!periscopeDataSuccess) {
|
|
43323
|
+
periscopeDataRequestFailure();
|
|
43324
|
+
}
|
|
43329
43325
|
}, 10000);
|
|
43330
43326
|
return function () {
|
|
43331
43327
|
return clearTimeout(time.timer);
|
|
43332
43328
|
};
|
|
43333
|
-
}, []);
|
|
43329
|
+
}, [periscopeDataSuccess]);
|
|
43334
43330
|
|
|
43335
43331
|
var Dashboard = function Dashboard(height) {
|
|
43336
43332
|
return function (url) {
|
|
@@ -43665,18 +43661,15 @@ var index$4 = /*#__PURE__*/Object.freeze({
|
|
|
43665
43661
|
|
|
43666
43662
|
var useFocusInvalidInput = function useFocusInvalidInput(hasErrors) {
|
|
43667
43663
|
var resetHasErrors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
|
|
43668
|
-
|
|
43664
|
+
// Only move focus when "hasErrors" is true
|
|
43669
43665
|
// "hasErrors" is managed by container page of form
|
|
43670
43666
|
// typically set to "true" on attempted form submission, if errors exist
|
|
43671
|
-
|
|
43667
|
+
// Reset errors, if provided, resets the error state tracking in order to properly re-run
|
|
43672
43668
|
React.useEffect(function () {
|
|
43673
|
-
console.log("inside use effect show errors", hasErrors);
|
|
43674
|
-
|
|
43675
43669
|
if (hasErrors) {
|
|
43676
43670
|
var _inputsWithErrors$;
|
|
43677
43671
|
|
|
43678
43672
|
var inputsWithErrors = document.querySelectorAll("input[aria-invalid=true]");
|
|
43679
|
-
console.log("inputs with errors is", inputsWithErrors);
|
|
43680
43673
|
inputsWithErrors === null || inputsWithErrors === void 0 ? void 0 : (_inputsWithErrors$ = inputsWithErrors[0]) === null || _inputsWithErrors$ === void 0 ? void 0 : _inputsWithErrors$.focus();
|
|
43681
43674
|
}
|
|
43682
43675
|
|