auth0-lock 11.34.2 → 12.0.0-beta.0
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/.browserslistrc +1 -0
- package/.circleci/config.yml +4 -2
- package/.eslintrc.json +5 -5
- package/.github/workflows/codeql.yml +41 -0
- package/.shiprc +4 -5
- package/CHANGELOG.md +26 -0
- package/EXAMPLES.md +626 -0
- package/README.md +77 -649
- package/karma.conf.js +1 -1
- package/lib/CSSCore.js +1 -4
- package/lib/__tests__/auth_button.js +12 -22
- package/lib/__tests__/connection/database/actions.js +48 -49
- package/lib/__tests__/connection/database/index.js +22 -28
- package/lib/__tests__/connection/database/login_pane.js +20 -41
- package/lib/__tests__/connection/database/password_reset_confirmation.js +19 -26
- package/lib/__tests__/connection/database/reset_password.js +17 -39
- package/lib/__tests__/connection/database/signed_up_confirmation.js +19 -26
- package/lib/__tests__/connection/enterprise/actions.js +22 -47
- package/lib/__tests__/connection/enterprise/hrd_pane.js +16 -33
- package/lib/__tests__/connection/enterprise/hrd_screen.js +26 -40
- package/lib/__tests__/connection/enterprise/quick_auth_screen.js +27 -68
- package/lib/__tests__/connection/passwordless/ask_vcode.js +29 -51
- package/lib/__tests__/connection/passwordless/email_sent_confirmation.js +19 -26
- package/lib/__tests__/connection/passwordless/passwordless.js +35 -97
- package/lib/__tests__/core/actions.js +23 -46
- package/lib/__tests__/core/client/index.js +10 -13
- package/lib/__tests__/core/index.js +46 -94
- package/lib/__tests__/core/remote_data.js +14 -20
- package/lib/__tests__/core/signed_in_confirmation.js +19 -26
- package/lib/__tests__/core/sso/last_login_screen.js +27 -50
- package/lib/__tests__/core/tenant.js +10 -12
- package/lib/__tests__/core/web_api/helper.js +6 -14
- package/lib/__tests__/core/web_api/p2_api.js +38 -33
- package/lib/__tests__/core/web_api.js +37 -33
- package/lib/__tests__/engine/classic/login.js +20 -41
- package/lib/__tests__/engine/classic/mfa_login_screen.js +6 -19
- package/lib/__tests__/engine/classic/sign_up_pane.js +33 -55
- package/lib/__tests__/engine/classic/sign_up_screen.js +18 -45
- package/lib/__tests__/engine/classic.js +13 -6
- package/lib/__tests__/engine/passwordless.js +2 -5
- package/lib/__tests__/field/captcha/recaptcha_enterprise.js +27 -27
- package/lib/__tests__/field/captcha/recaptchav2.js +27 -27
- package/lib/__tests__/field/captcha.js +39 -51
- package/lib/__tests__/field/custom_input.js +23 -47
- package/lib/__tests__/field/email.js +2 -3
- package/lib/__tests__/field/email_pane.js +25 -48
- package/lib/__tests__/field/field.js +9 -13
- package/lib/__tests__/field/login_pane.js +30 -34
- package/lib/__tests__/field/mfa_code_pane.js +13 -28
- package/lib/__tests__/field/option_selection_pane.js +7 -25
- package/lib/__tests__/field/password.js +6 -12
- package/lib/__tests__/field/password_pane.js +29 -46
- package/lib/__tests__/field/phone_number_pane.js +18 -41
- package/lib/__tests__/field/social_buttons_pane.js +30 -47
- package/lib/__tests__/field/username.js +27 -48
- package/lib/__tests__/field/username_pane.js +30 -47
- package/lib/__tests__/field/vcode.js +5 -13
- package/lib/__tests__/field/vcode_pane.js +20 -44
- package/lib/__tests__/i18n.js +28 -53
- package/lib/__tests__/quick-auth/actions.js +4 -27
- package/lib/__tests__/setup-tests.js +7 -9
- package/lib/__tests__/testUtils.js +41 -58
- package/lib/__tests__/ui/box/chrome.js +24 -49
- package/lib/__tests__/ui/box/confirmation_pane.js +19 -36
- package/lib/__tests__/ui/box/container.js +21 -46
- package/lib/__tests__/ui/box/global_message.js +60 -37
- package/lib/__tests__/ui/input/email_input.js +6 -17
- package/lib/__tests__/ui/input/input_wrap.js +6 -19
- package/lib/__tests__/ui/input/password/password_strength.js +13 -15
- package/lib/__tests__/ui/input/password_input.js +22 -27
- package/lib/__tests__/utils/format.js +10 -17
- package/lib/__tests__/utils/url_utils.js +2 -5
- package/lib/avatar/gravatar_provider.js +13 -28
- package/lib/avatar.js +22 -41
- package/lib/browser.js +372 -23
- package/lib/connection/captcha.js +14 -32
- package/lib/connection/database/actions.js +39 -108
- package/lib/connection/database/index.js +90 -191
- package/lib/connection/database/login_pane.js +107 -147
- package/lib/connection/database/login_sign_up_tabs.js +106 -125
- package/lib/connection/database/mfa_pane.js +50 -69
- package/lib/connection/database/password_reset_confirmation.js +51 -73
- package/lib/connection/database/reset_password.js +116 -132
- package/lib/connection/database/reset_password_pane.js +45 -56
- package/lib/connection/database/sign_up_terms.js +17 -23
- package/lib/connection/database/signed_up_confirmation.js +52 -75
- package/lib/connection/enterprise/actions.js +23 -52
- package/lib/connection/enterprise/hrd_pane.js +60 -76
- package/lib/connection/enterprise/hrd_screen.js +60 -75
- package/lib/connection/enterprise/kerberos_screen.js +46 -60
- package/lib/connection/enterprise/quick_auth_screen.js +46 -64
- package/lib/connection/enterprise/single_sign_on_notice.js +14 -26
- package/lib/connection/enterprise.js +51 -84
- package/lib/connection/passwordless/actions.js +29 -62
- package/lib/connection/passwordless/ask_vcode.js +53 -60
- package/lib/connection/passwordless/email_sent_confirmation.js +129 -179
- package/lib/connection/passwordless/index.js +36 -68
- package/lib/connection/social/index.js +12 -15
- package/lib/core/actions.js +33 -85
- package/lib/core/client/index.js +38 -58
- package/lib/core/client/settings.js +12 -20
- package/lib/core/error_screen.js +38 -52
- package/lib/core/index.js +152 -301
- package/lib/core/loading_screen.js +61 -71
- package/lib/core/pane_separator.js +10 -10
- package/lib/core/remote_data.js +28 -48
- package/lib/core/screen.js +85 -79
- package/lib/core/signed_in_confirmation.js +51 -73
- package/lib/core/sso/data.js +9 -17
- package/lib/core/sso/index.js +5 -6
- package/lib/core/sso/last_login_screen.js +46 -63
- package/lib/core/tenant/index.js +37 -59
- package/lib/core/tenant/settings.js +11 -15
- package/lib/core/web_api/helper.js +24 -30
- package/lib/core/web_api/p2_api.js +156 -165
- package/lib/core/web_api.js +101 -90
- package/lib/core.js +126 -160
- package/lib/engine/classic/login.js +92 -144
- package/lib/engine/classic/mfa_login_screen.js +61 -67
- package/lib/engine/classic/sign_up_pane.js +89 -123
- package/lib/engine/classic/sign_up_screen.js +112 -158
- package/lib/engine/classic.js +122 -183
- package/lib/engine/passwordless/social_or_email_login_screen.js +71 -106
- package/lib/engine/passwordless/social_or_phone_number_login_screen.js +70 -100
- package/lib/engine/passwordless.js +75 -104
- package/lib/field/actions.js +11 -17
- package/lib/field/captcha/captcha_pane.js +82 -102
- package/lib/field/captcha/recaptcha.js +140 -145
- package/lib/field/captcha.js +7 -10
- package/lib/field/custom_input.js +37 -50
- package/lib/field/email/email_pane.js +90 -109
- package/lib/field/email.js +17 -35
- package/lib/field/index.js +51 -88
- package/lib/field/mfa-code/mfa_code_pane.js +57 -71
- package/lib/field/mfa_code.js +15 -21
- package/lib/field/option_selection_pane.js +16 -22
- package/lib/field/password/password_pane.js +79 -91
- package/lib/field/password.js +8 -14
- package/lib/field/phone-number/locations.js +7 -3
- package/lib/field/phone-number/phone_number_pane.js +87 -124
- package/lib/field/phone_number.js +16 -30
- package/lib/field/social/event.js +9 -12
- package/lib/field/social/social_buttons_pane.js +93 -121
- package/lib/field/username/username_pane.js +105 -123
- package/lib/field/username.js +16 -26
- package/lib/field/vcode/vcode_pane.js +67 -93
- package/lib/field/vcode.js +5 -5
- package/lib/i18n/af.js +7 -4
- package/lib/i18n/ar.js +7 -4
- package/lib/i18n/az.js +7 -4
- package/lib/i18n/bg.js +7 -4
- package/lib/i18n/ca.js +7 -4
- package/lib/i18n/cs.js +7 -4
- package/lib/i18n/da.js +7 -4
- package/lib/i18n/de.js +7 -3
- package/lib/i18n/el.js +7 -4
- package/lib/i18n/en.js +9 -4
- package/lib/i18n/es.js +7 -3
- package/lib/i18n/et.js +7 -4
- package/lib/i18n/fa.js +7 -4
- package/lib/i18n/fi.js +7 -4
- package/lib/i18n/fr.js +7 -4
- package/lib/i18n/he.js +7 -4
- package/lib/i18n/hr.js +7 -4
- package/lib/i18n/hu.js +7 -4
- package/lib/i18n/id.js +7 -4
- package/lib/i18n/it.js +7 -3
- package/lib/i18n/ja.js +7 -4
- package/lib/i18n/ko.js +7 -4
- package/lib/i18n/lt.js +7 -4
- package/lib/i18n/lv.js +7 -4
- package/lib/i18n/ms.js +7 -4
- package/lib/i18n/nb.js +7 -4
- package/lib/i18n/nl.js +7 -4
- package/lib/i18n/nn.js +7 -4
- package/lib/i18n/no.js +7 -4
- package/lib/i18n/pl.js +7 -4
- package/lib/i18n/pt-br.js +7 -3
- package/lib/i18n/pt.js +7 -4
- package/lib/i18n/ro.js +7 -4
- package/lib/i18n/ru.js +7 -4
- package/lib/i18n/sk.js +7 -4
- package/lib/i18n/sl.js +7 -4
- package/lib/i18n/sr.js +7 -4
- package/lib/i18n/sv.js +7 -4
- package/lib/i18n/tr.js +7 -4
- package/lib/i18n/ua.js +7 -4
- package/lib/i18n/uk.js +7 -4
- package/lib/i18n/vi.js +7 -4
- package/lib/i18n/zh-tw.js +7 -4
- package/lib/i18n/zh.js +7 -4
- package/lib/i18n.js +38 -75
- package/lib/index.js +14 -17
- package/lib/lock.js +29 -32
- package/lib/passwordless.js +29 -31
- package/lib/quick-auth/actions.js +19 -26
- package/lib/quick_auth.js +8 -10
- package/lib/sanitizer.js +5 -5
- package/lib/store/index.js +22 -42
- package/lib/sync.js +21 -42
- package/lib/ui/box/button.js +85 -105
- package/lib/ui/box/chrome.js +463 -548
- package/lib/ui/box/confirmation_pane.js +34 -48
- package/lib/ui/box/container.js +305 -339
- package/lib/ui/box/global_message.js +51 -60
- package/lib/ui/box/header.js +155 -177
- package/lib/ui/box/multisize_slide.js +233 -229
- package/lib/ui/box/success_pane.js +34 -37
- package/lib/ui/box.js +88 -93
- package/lib/ui/button/auth_button.js +44 -51
- package/lib/ui/input/captcha_input.js +162 -181
- package/lib/ui/input/checkbox_input.js +57 -59
- package/lib/ui/input/email_input.js +117 -124
- package/lib/ui/input/input_wrap.js +65 -80
- package/lib/ui/input/location_input.js +130 -150
- package/lib/ui/input/mfa_code_input.js +98 -98
- package/lib/ui/input/password/password_strength.js +103 -127
- package/lib/ui/input/password_input.js +141 -147
- package/lib/ui/input/phone_number_input.js +101 -109
- package/lib/ui/input/select_input.js +120 -132
- package/lib/ui/input/text_input.js +89 -84
- package/lib/ui/input/username_input.js +109 -115
- package/lib/ui/input/vcode_input.js +110 -118
- package/lib/ui/list.js +224 -247
- package/lib/ui/pane/quick_auth_pane.js +55 -80
- package/lib/utils/atom.js +55 -48
- package/lib/utils/cache.js +54 -43
- package/lib/utils/cdn_utils.js +17 -31
- package/lib/utils/createRef.js +3 -1
- package/lib/utils/data_utils.js +10 -16
- package/lib/utils/fn_utils.js +5 -4
- package/lib/utils/format.js +6 -8
- package/lib/utils/id_utils.js +4 -3
- package/lib/utils/jsonp_utils.js +20 -17
- package/lib/utils/media_utils.js +4 -2
- package/lib/utils/preload_utils.js +4 -3
- package/lib/utils/string_utils.js +4 -4
- package/lib/utils/url_utils.js +4 -3
- package/opslevel.yml +6 -0
- package/package.json +53 -38
- package/webpack.config.js +36 -3
|
@@ -1,106 +1,111 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
var _input_wrap = require('./input_wrap');
|
|
12
|
-
|
|
13
|
-
var _input_wrap2 = _interopRequireDefault(_input_wrap);
|
|
14
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _input_wrap = _interopRequireDefault(require("./input_wrap"));
|
|
10
|
+
var _excluded = ["lockId", "iconUrl", "invalidHint", "isValid", "name", "ariaLabel", "onChange", "value"];
|
|
15
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
|
-
function _objectWithoutProperties(
|
|
18
|
-
|
|
12
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
14
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
19
15
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
20
|
-
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
17
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
18
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
19
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
20
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
21
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
22
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
23
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
24
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
25
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
26
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
27
|
+
var TextInput = /*#__PURE__*/function (_React$Component) {
|
|
26
28
|
_inherits(TextInput, _React$Component);
|
|
27
|
-
|
|
29
|
+
var _super = _createSuper(TextInput);
|
|
28
30
|
function TextInput(props) {
|
|
31
|
+
var _this;
|
|
29
32
|
_classCallCheck(this, TextInput);
|
|
30
|
-
|
|
31
|
-
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
|
|
32
|
-
|
|
33
|
+
_this = _super.call(this, props);
|
|
33
34
|
_this.state = {};
|
|
34
35
|
return _this;
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
TextInput.prototype.render = function render() {
|
|
42
|
-
var _props = this.props,
|
|
43
|
-
lockId = _props.lockId,
|
|
44
|
-
iconUrl = _props.iconUrl,
|
|
45
|
-
invalidHint = _props.invalidHint,
|
|
46
|
-
isValid = _props.isValid,
|
|
47
|
-
name = _props.name,
|
|
48
|
-
ariaLabel = _props.ariaLabel,
|
|
49
|
-
onChange = _props.onChange,
|
|
50
|
-
value = _props.value,
|
|
51
|
-
props = _objectWithoutProperties(_props, ['lockId', 'iconUrl', 'invalidHint', 'isValid', 'name', 'ariaLabel', 'onChange', 'value']);
|
|
52
|
-
|
|
53
|
-
var icon = this.props.icon;
|
|
54
|
-
var focused = this.state.focused;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (!icon && typeof iconUrl === 'string' && iconUrl) {
|
|
58
|
-
icon = _react2.default.createElement('img', { className: 'auth0-lock-custom-icon', alt: ariaLabel || name, src: iconUrl });
|
|
37
|
+
_createClass(TextInput, [{
|
|
38
|
+
key: "hasFocus",
|
|
39
|
+
value: function hasFocus() {
|
|
40
|
+
return this.state.focused;
|
|
59
41
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
42
|
+
}, {
|
|
43
|
+
key: "render",
|
|
44
|
+
value: function render() {
|
|
45
|
+
var _this$props = this.props,
|
|
46
|
+
lockId = _this$props.lockId,
|
|
47
|
+
iconUrl = _this$props.iconUrl,
|
|
48
|
+
invalidHint = _this$props.invalidHint,
|
|
49
|
+
isValid = _this$props.isValid,
|
|
50
|
+
name = _this$props.name,
|
|
51
|
+
ariaLabel = _this$props.ariaLabel,
|
|
52
|
+
onChange = _this$props.onChange,
|
|
53
|
+
value = _this$props.value,
|
|
54
|
+
props = _objectWithoutProperties(_this$props, _excluded);
|
|
55
|
+
var icon = this.props.icon;
|
|
56
|
+
var focused = this.state.focused;
|
|
57
|
+
if (!icon && typeof iconUrl === 'string' && iconUrl) {
|
|
58
|
+
icon = /*#__PURE__*/_react.default.createElement("img", {
|
|
59
|
+
className: "auth0-lock-custom-icon",
|
|
60
|
+
alt: ariaLabel || name,
|
|
61
|
+
src: iconUrl
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return /*#__PURE__*/_react.default.createElement(_input_wrap.default, {
|
|
64
65
|
focused: focused,
|
|
65
66
|
invalidHint: invalidHint,
|
|
66
67
|
isValid: isValid,
|
|
67
68
|
name: name,
|
|
68
69
|
icon: icon
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
type: 'text',
|
|
70
|
+
}, /*#__PURE__*/_react.default.createElement("input", _extends({
|
|
71
|
+
id: "".concat(lockId, "-").concat(name),
|
|
72
|
+
ref: "input",
|
|
73
|
+
type: "text",
|
|
74
74
|
name: name,
|
|
75
|
-
className:
|
|
76
|
-
autoComplete:
|
|
77
|
-
autoCapitalize:
|
|
75
|
+
className: "auth0-lock-input",
|
|
76
|
+
autoComplete: "off",
|
|
77
|
+
autoCapitalize: "off",
|
|
78
78
|
onChange: this.handleOnChange.bind(this),
|
|
79
79
|
onFocus: this.handleFocus.bind(this),
|
|
80
80
|
onBlur: this.handleBlur.bind(this),
|
|
81
81
|
value: value,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}, props))
|
|
86
|
-
);
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
TextInput.prototype.handleOnChange = function handleOnChange(e) {
|
|
90
|
-
if (this.props.onChange) {
|
|
91
|
-
this.props.onChange(e);
|
|
82
|
+
"aria-label": ariaLabel || name,
|
|
83
|
+
"aria-invalid": !isValid,
|
|
84
|
+
"aria-describedby": !isValid && invalidHint ? "auth0-lock-error-msg-".concat(name) : undefined
|
|
85
|
+
}, props)));
|
|
92
86
|
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
87
|
+
}, {
|
|
88
|
+
key: "handleOnChange",
|
|
89
|
+
value: function handleOnChange(e) {
|
|
90
|
+
if (this.props.onChange) {
|
|
91
|
+
this.props.onChange(e);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}, {
|
|
95
|
+
key: "handleFocus",
|
|
96
|
+
value: function handleFocus() {
|
|
97
|
+
this.setState({
|
|
98
|
+
focused: true
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}, {
|
|
102
|
+
key: "handleBlur",
|
|
103
|
+
value: function handleBlur() {
|
|
104
|
+
this.setState({
|
|
105
|
+
focused: false
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}]);
|
|
103
109
|
return TextInput;
|
|
104
|
-
}(
|
|
105
|
-
|
|
110
|
+
}(_react.default.Component);
|
|
106
111
|
exports.default = TextInput;
|
|
@@ -1,134 +1,128 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
var _input_wrap = require('./input_wrap');
|
|
12
|
-
|
|
13
|
-
var _input_wrap2 = _interopRequireDefault(_input_wrap);
|
|
14
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _input_wrap = _interopRequireDefault(require("./input_wrap"));
|
|
10
|
+
var _excluded = ["invalidHint", "isValid", "onChange", "autoComplete"];
|
|
15
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
|
-
function _objectWithoutProperties(
|
|
18
|
-
|
|
12
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
14
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
19
15
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
20
|
-
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
|
|
16
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
17
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
18
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
19
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
20
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
21
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
22
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
23
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
24
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
25
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
26
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
27
|
+
var IconSvg = /*#__PURE__*/_react.default.createElement("svg", {
|
|
28
|
+
"aria-hidden": "true",
|
|
29
|
+
focusable: "false",
|
|
30
|
+
width: "13px",
|
|
31
|
+
height: "14px",
|
|
32
|
+
viewBox: "0 0 15 16",
|
|
33
|
+
version: "1.1",
|
|
34
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
35
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
36
|
+
className: "auth0-lock-icon auth0-lock-icon-box"
|
|
37
|
+
}, /*#__PURE__*/_react.default.createElement("g", {
|
|
38
|
+
stroke: "none",
|
|
39
|
+
strokeWidth: "1",
|
|
40
|
+
fill: "none",
|
|
41
|
+
fillRule: "evenodd"
|
|
42
|
+
}, /*#__PURE__*/_react.default.createElement("g", {
|
|
43
|
+
transform: "translate(-11.000000, -1471.000000)",
|
|
44
|
+
fill: "#888888"
|
|
45
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
46
|
+
d: "M25.552,1486.998 L11.449,1486.998 C10.667,1485.799 10.984,1483.399 11.766,1482.6 C12.139,1482.219 14.931,1481.5 16.267,1481.172 C14.856,1480.076 13.995,1478.042 13.995,1476.103 C13.995,1473.284 14.813,1470.999 18.498,1470.999 C22.182,1470.999 23,1473.284 23,1476.103 C23,1478.037 22.145,1480.065 20.74,1481.163 C22.046,1481.489 24.88,1482.228 25.241,1482.601 C26.019,1483.399 26.328,1485.799 25.552,1486.998 L25.552,1486.998 Z M24.6,1483.443 C24.087,1483.169 21.881,1482.548 20,1482.097 L20,1480.513 C21.254,1479.659 21.997,1477.806 21.997,1476.12 C21.997,1473.841 21.414,1471.993 18.499,1471.993 C15.583,1471.993 15,1473.841 15,1476.12 C15,1477.807 15.744,1479.662 17,1480.515 L17,1482.112 C15.109,1482.556 12.914,1483.166 12.409,1483.442 C12.082,1483.854 11.797,1485.173 12,1486 L25,1486 C25.201,1485.174 24.922,1483.858 24.6,1483.443 L24.6,1483.443 Z"
|
|
47
|
+
}))));
|
|
48
|
+
var UsernameInput = /*#__PURE__*/function (_React$Component) {
|
|
50
49
|
_inherits(UsernameInput, _React$Component);
|
|
51
|
-
|
|
50
|
+
var _super = _createSuper(UsernameInput);
|
|
52
51
|
function UsernameInput(props) {
|
|
52
|
+
var _this;
|
|
53
53
|
_classCallCheck(this, UsernameInput);
|
|
54
|
-
|
|
55
|
-
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
|
|
56
|
-
|
|
54
|
+
_this = _super.call(this, props);
|
|
57
55
|
_this.state = {};
|
|
58
56
|
return _this;
|
|
59
57
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
invalidHint =
|
|
77
|
-
isValid =
|
|
78
|
-
onChange =
|
|
79
|
-
autoComplete =
|
|
80
|
-
props = _objectWithoutProperties(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return _react2.default.createElement(
|
|
86
|
-
_input_wrap2.default,
|
|
87
|
-
{
|
|
58
|
+
_createClass(UsernameInput, [{
|
|
59
|
+
key: "shouldComponentUpdate",
|
|
60
|
+
value: function shouldComponentUpdate(nextProps, nextState) {
|
|
61
|
+
var _this$props = this.props,
|
|
62
|
+
invalidHint = _this$props.invalidHint,
|
|
63
|
+
isValid = _this$props.isValid,
|
|
64
|
+
value = _this$props.value,
|
|
65
|
+
disabled = _this$props.disabled,
|
|
66
|
+
onChange = _this$props.onChange;
|
|
67
|
+
var focused = this.state.focused;
|
|
68
|
+
return invalidHint != nextProps.invalidHint || isValid != nextProps.isValid || value != nextProps.value || focused != nextState.focused || disabled != nextProps.disabled;
|
|
69
|
+
}
|
|
70
|
+
}, {
|
|
71
|
+
key: "render",
|
|
72
|
+
value: function render() {
|
|
73
|
+
var _this$props2 = this.props,
|
|
74
|
+
invalidHint = _this$props2.invalidHint,
|
|
75
|
+
isValid = _this$props2.isValid,
|
|
76
|
+
onChange = _this$props2.onChange,
|
|
77
|
+
autoComplete = _this$props2.autoComplete,
|
|
78
|
+
props = _objectWithoutProperties(_this$props2, _excluded);
|
|
79
|
+
var focused = this.state.focused;
|
|
80
|
+
return /*#__PURE__*/_react.default.createElement(_input_wrap.default, {
|
|
88
81
|
focused: focused,
|
|
89
82
|
invalidHint: invalidHint,
|
|
90
83
|
isValid: isValid,
|
|
91
|
-
name:
|
|
84
|
+
name: "username",
|
|
92
85
|
icon: IconSvg
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
placeholder: 'username',
|
|
86
|
+
}, /*#__PURE__*/_react.default.createElement("input", _extends({
|
|
87
|
+
ref: "input",
|
|
88
|
+
type: "text",
|
|
89
|
+
name: "username",
|
|
90
|
+
className: "auth0-lock-input",
|
|
91
|
+
placeholder: "username",
|
|
100
92
|
autoComplete: autoComplete ? 'on' : 'off',
|
|
101
|
-
autoCapitalize:
|
|
102
|
-
spellCheck:
|
|
103
|
-
autoCorrect:
|
|
93
|
+
autoCapitalize: "off",
|
|
94
|
+
spellCheck: "false",
|
|
95
|
+
autoCorrect: "off",
|
|
104
96
|
onChange: this.handleOnChange.bind(this),
|
|
105
97
|
onFocus: this.handleFocus.bind(this),
|
|
106
98
|
onBlur: this.handleBlur.bind(this),
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}, props))
|
|
111
|
-
);
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
UsernameInput.prototype.handleOnChange = function handleOnChange(e) {
|
|
115
|
-
if (this.props.onChange) {
|
|
116
|
-
this.props.onChange(e);
|
|
99
|
+
"aria-label": "User name",
|
|
100
|
+
"aria-invalid": !isValid,
|
|
101
|
+
"aria-describedby": !isValid && invalidHint ? "auth0-lock-error-msg-username" : undefined
|
|
102
|
+
}, props)));
|
|
117
103
|
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
104
|
+
}, {
|
|
105
|
+
key: "handleOnChange",
|
|
106
|
+
value: function handleOnChange(e) {
|
|
107
|
+
if (this.props.onChange) {
|
|
108
|
+
this.props.onChange(e);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}, {
|
|
112
|
+
key: "handleFocus",
|
|
113
|
+
value: function handleFocus() {
|
|
114
|
+
this.setState({
|
|
115
|
+
focused: true
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}, {
|
|
119
|
+
key: "handleBlur",
|
|
120
|
+
value: function handleBlur() {
|
|
121
|
+
this.setState({
|
|
122
|
+
focused: false
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}]);
|
|
128
126
|
return UsernameInput;
|
|
129
|
-
}(
|
|
130
|
-
|
|
131
|
-
// TODO: specify propTypes
|
|
132
|
-
|
|
133
|
-
|
|
127
|
+
}(_react.default.Component); // TODO: specify propTypes
|
|
134
128
|
exports.default = UsernameInput;
|