oolib 2.21.2 → 2.21.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.
@@ -2,5 +2,8 @@ export function TextInput(props: any): JSX.Element;
2
2
  export function PasswordInput(props: any): JSX.Element;
3
3
  export function EmailInput(props: any): JSX.Element;
4
4
  export function PhoneInput(props: any): JSX.Element;
5
- export function URLInput(props: any): JSX.Element;
5
+ export function URLInput({ routesAreValidInputs, ...props }: {
6
+ [x: string]: any;
7
+ routesAreValidInputs?: boolean;
8
+ }): JSX.Element;
6
9
  export function NumberInput(props: any): JSX.Element;
@@ -69,16 +69,27 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
70
70
  }
71
71
  };
72
+ var __rest = (this && this.__rest) || function (s, e) {
73
+ var t = {};
74
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
75
+ t[p] = s[p];
76
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
77
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
78
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
79
+ t[p[i]] = s[p[i]];
80
+ }
81
+ return t;
82
+ };
72
83
  Object.defineProperty(exports, "__esModule", { value: true });
73
84
  exports.NumberInput = exports.URLInput = exports.PhoneInput = exports.EmailInput = exports.PasswordInput = exports.TextInput = void 0;
74
85
  var react_1 = __importStar(require("react"));
75
86
  var index_styled_1 = require("./index.styled");
76
87
  var icons_1 = require("../../icons");
77
- var LoadersAndProgress_1 = require("../LoadersAndProgress");
78
88
  var BlockLabel_1 = require("../BlockLabel");
79
89
  var Typo_1 = require("../Typo");
80
90
  var Buttons_1 = require("../Buttons");
81
91
  var _EXPORTS_1 = require("../../utils/_EXPORTS");
92
+ var LoadersAndProgress_1 = require("../LoadersAndProgress");
82
93
  var DisplayIcon = function (_a) {
83
94
  var icon = _a.icon, onClick = _a.onClick, size = _a.size;
84
95
  var IconComp = icons_1.icons[icon];
@@ -125,8 +136,8 @@ var TextInput = function (props) {
125
136
  react_1.default.createElement(index_styled_1.InputContainerStyled, { invert: invert, type: type, disabled: disabled, status: inputStatus === null || inputStatus === void 0 ? void 0 : inputStatus.type, eyeIcon: eyeIcon, composition: composition },
126
137
  icon && (react_1.default.createElement(DisplayIcon, { icon: icon, size: S ? 15 : 20, onClick: iconOnClick || null })),
127
138
  react_1.default.createElement(index_styled_1.InputStyled, { className: size === 'S' ? 'SANS_2' : 'SANS_3', id: id, type: type, name: type, placeholder: placeholder, value: value, onChange: handleOnChange, maxLength: maxNumLimiter, onBlur: handleValidateOnBlur, onFocus: onFocus, size: size, autoComplete: 'off' }),
128
- inputStatus === 'loading' && (react_1.default.createElement("div", { style: { padding: '1rem 0' } },
129
- react_1.default.createElement(LoadersAndProgress_1.Loader, { invert: invert, inline: true }))),
139
+ inputStatus === 'loading' && (react_1.default.createElement("div", null,
140
+ react_1.default.createElement(LoadersAndProgress_1.CircleLoader, { S: true, invert: invert }))),
130
141
  actionBtn && (react_1.default.createElement(Buttons_1.ButtonPrimary, { value: actionBtn.text, invert: actionBtn.invert, onClick: actionBtnEnabaled && actionBtn.onClick, disabled: !actionBtnEnabaled, style: { marginRight: '-2rem' } }))),
131
142
  (inputStatus === null || inputStatus === void 0 ? void 0 : inputStatus.msg) && (react_1.default.createElement(index_styled_1.MsgContainer, { invert: invert, status: inputStatus === null || inputStatus === void 0 ? void 0 : inputStatus.type },
132
143
  react_1.default.createElement(Typo_1.SANS_3, null, inputStatus.msg))))))));
@@ -190,12 +201,19 @@ var PhoneInput = function (props) {
190
201
  return (react_1.default.createElement(exports.TextInput, __assign({ type: "tel", placeholder: 'Enter Phone...', validateOnBlur: handleValidation, maxNumLimiter: 10 }, props)));
191
202
  };
192
203
  exports.PhoneInput = PhoneInput;
193
- var URLInput = function (props) {
204
+ var URLInput = function (_a) {
205
+ 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
206
+ props = __rest(_a, ["routesAreValidInputs"]);
194
207
  var handleValidation = function (value) { return __awaiter(void 0, void 0, void 0, function () {
195
208
  var response, err_1;
196
209
  return __generator(this, function (_a) {
197
210
  switch (_a.label) {
198
211
  case 0:
212
+ //if routesAreValidInputs, then first validate for a route
213
+ if (routesAreValidInputs && value.substring(0, 1) === '/') {
214
+ return [2 /*return*/, { type: 'success', msg: 'valid route' }];
215
+ }
216
+ //else validate for a url
199
217
  if (!/^https?:\/\//i.test(value)) {
200
218
  value = 'https://' + value;
201
219
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.21.2",
3
+ "version": "2.21.3",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",