oolib 2.29.1 → 2.29.3
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.
|
@@ -5,9 +5,10 @@ export function PasswordInput({ enableValidation, ...props }: {
|
|
|
5
5
|
}): any;
|
|
6
6
|
export function EmailInput(props: any): any;
|
|
7
7
|
export function PhoneInput(props: any): any;
|
|
8
|
-
export function URLInput({ routesAreValidInputs, validationPlugin, ...props }: {
|
|
8
|
+
export function URLInput({ routesAreValidInputs, validationPlugin, validateOnMount, ...props }: {
|
|
9
9
|
[x: string]: any;
|
|
10
10
|
routesAreValidInputs?: boolean;
|
|
11
11
|
validationPlugin: any;
|
|
12
|
+
validateOnMount: any;
|
|
12
13
|
}): any;
|
|
13
14
|
export function NumberInput(props: any): any;
|
|
@@ -215,7 +215,7 @@ var PhoneInput = function (props) {
|
|
|
215
215
|
exports.PhoneInput = PhoneInput;
|
|
216
216
|
var URLInput = function (_a) {
|
|
217
217
|
var _b = _a.routesAreValidInputs, routesAreValidInputs = _b === void 0 ? false : _b, //if we want react route declarations to be considered as 'valid' then set this to true
|
|
218
|
-
validationPlugin = _a.validationPlugin, props = __rest(_a, ["routesAreValidInputs", "validationPlugin"]);
|
|
218
|
+
validationPlugin = _a.validationPlugin, validateOnMount = _a.validateOnMount, props = __rest(_a, ["routesAreValidInputs", "validationPlugin", "validateOnMount"]);
|
|
219
219
|
var handleValidation = function (value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
220
220
|
var pluginResponse, response, err_1;
|
|
221
221
|
return __generator(this, function (_a) {
|
|
@@ -257,6 +257,11 @@ var URLInput = function (_a) {
|
|
|
257
257
|
}
|
|
258
258
|
});
|
|
259
259
|
}); };
|
|
260
|
+
(0, react_1.useEffect)(function () {
|
|
261
|
+
if (value && validateOnMount) {
|
|
262
|
+
handleValidation(value);
|
|
263
|
+
}
|
|
264
|
+
}, [validateOnMount, value]);
|
|
260
265
|
return (react_1.default.createElement(exports.TextInput, __assign({ type: "url", validateOnBlur: handleValidation, placeholder: "Enter a valid url..." }, props)));
|
|
261
266
|
};
|
|
262
267
|
exports.URLInput = URLInput;
|