@aws-amplify/ui-react 1.2.25-unstable.1 → 2.0.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/dist/esm/index.css +1 -0
- package/dist/esm/index.css.map +7 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/legacy.js +1 -0
- package/dist/esm/legacy.js.map +7 -0
- package/dist/index.css +1 -0
- package/dist/index.css.map +7 -0
- package/dist/index.d.ts +7533 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +7 -0
- package/dist/legacy.d.ts +1 -0
- package/dist/legacy.js +1 -0
- package/dist/legacy.js.map +7 -0
- package/dist/primitives.json +22168 -0
- package/legacy/package.json +7 -0
- package/package.json +82 -40
- package/CHANGELOG.md +0 -331
- package/README.md +0 -1
- package/build.js +0 -5
- package/dist/0.js +0 -269
- package/dist/0.js.map +0 -1
- package/dist/1.js +0 -2111
- package/dist/1.js.map +0 -1
- package/dist/10.js +0 -707
- package/dist/10.js.map +0 -1
- package/dist/11.js +0 -45
- package/dist/11.js.map +0 -1
- package/dist/12.js +0 -1152
- package/dist/12.js.map +0 -1
- package/dist/13.js +0 -114
- package/dist/13.js.map +0 -1
- package/dist/14.js +0 -1194
- package/dist/14.js.map +0 -1
- package/dist/15.js +0 -61
- package/dist/15.js.map +0 -1
- package/dist/16.js +0 -37
- package/dist/16.js.map +0 -1
- package/dist/17.js +0 -127
- package/dist/17.js.map +0 -1
- package/dist/18.js +0 -90
- package/dist/18.js.map +0 -1
- package/dist/19.js +0 -267
- package/dist/19.js.map +0 -1
- package/dist/2.js +0 -766
- package/dist/2.js.map +0 -1
- package/dist/20.js +0 -74
- package/dist/20.js.map +0 -1
- package/dist/21.js +0 -50
- package/dist/21.js.map +0 -1
- package/dist/22.js +0 -57
- package/dist/22.js.map +0 -1
- package/dist/23.js +0 -50
- package/dist/23.js.map +0 -1
- package/dist/24.js +0 -271
- package/dist/24.js.map +0 -1
- package/dist/25.js +0 -102
- package/dist/25.js.map +0 -1
- package/dist/26.js +0 -64
- package/dist/26.js.map +0 -1
- package/dist/27.js +0 -379
- package/dist/27.js.map +0 -1
- package/dist/28.js +0 -47
- package/dist/28.js.map +0 -1
- package/dist/29.js +0 -46
- package/dist/29.js.map +0 -1
- package/dist/3.js +0 -2787
- package/dist/3.js.map +0 -1
- package/dist/30.js +0 -503
- package/dist/30.js.map +0 -1
- package/dist/31.js +0 -2
- package/dist/31.js.map +0 -1
- package/dist/32.js +0 -2
- package/dist/32.js.map +0 -1
- package/dist/33.js +0 -13
- package/dist/33.js.map +0 -1
- package/dist/4.js +0 -4126
- package/dist/4.js.map +0 -1
- package/dist/5.js +0 -817
- package/dist/5.js.map +0 -1
- package/dist/6.js +0 -619
- package/dist/6.js.map +0 -1
- package/dist/7.js +0 -662
- package/dist/7.js.map +0 -1
- package/dist/8.js +0 -614
- package/dist/8.js.map +0 -1
- package/dist/9.js +0 -665
- package/dist/9.js.map +0 -1
- package/dist/@aws-amplify/ui-react.js +0 -31875
- package/dist/@aws-amplify/ui-react.js.map +0 -1
- package/dist/aws-amplify-react.min.js +0 -28
- package/dist/aws-amplify-react.min.js.map +0 -1
- package/dist/polyfills-core-js.js +0 -5211
- package/dist/polyfills-core-js.js.map +0 -1
- package/dist/polyfills-css-shim.js +0 -467
- package/dist/polyfills-css-shim.js.map +0 -1
- package/dist/polyfills-dom.js +0 -2098
- package/dist/polyfills-dom.js.map +0 -1
- package/jest.config.js +0 -12
- package/lib/components.d.ts +0 -56
- package/lib/components.js +0 -64
- package/lib/components.js.map +0 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -9
- package/lib/index.js.map +0 -1
- package/lib/react-component-lib/createComponent.d.ts +0 -2
- package/lib/react-component-lib/createComponent.js +0 -91
- package/lib/react-component-lib/createComponent.js.map +0 -1
- package/lib/react-component-lib/createControllerComponent.d.ts +0 -43
- package/lib/react-component-lib/createControllerComponent.js +0 -152
- package/lib/react-component-lib/createControllerComponent.js.map +0 -1
- package/lib/react-component-lib/createOverlayComponent.d.ts +0 -45
- package/lib/react-component-lib/createOverlayComponent.js +0 -148
- package/lib/react-component-lib/createOverlayComponent.js.map +0 -1
- package/lib/react-component-lib/index.d.ts +0 -3
- package/lib/react-component-lib/index.js +0 -9
- package/lib/react-component-lib/index.js.map +0 -1
- package/lib/react-component-lib/utils/attachEventProps.d.ts +0 -8
- package/lib/react-component-lib/utils/attachEventProps.js +0 -85
- package/lib/react-component-lib/utils/attachEventProps.js.map +0 -1
- package/lib/react-component-lib/utils/index.d.ts +0 -8
- package/lib/react-component-lib/utils/index.js +0 -36
- package/lib/react-component-lib/utils/index.js.map +0 -1
- package/lib/withAuthenticator.d.ts +0 -3
- package/lib/withAuthenticator.js +0 -127
- package/lib/withAuthenticator.js.map +0 -1
- package/lib-esm/components.d.ts +0 -56
- package/lib-esm/components.js +0 -62
- package/lib-esm/components.js.map +0 -1
- package/lib-esm/index.d.ts +0 -2
- package/lib-esm/index.js +0 -3
- package/lib-esm/index.js.map +0 -1
- package/lib-esm/react-component-lib/createComponent.d.ts +0 -2
- package/lib-esm/react-component-lib/createComponent.js +0 -86
- package/lib-esm/react-component-lib/createComponent.js.map +0 -1
- package/lib-esm/react-component-lib/createControllerComponent.d.ts +0 -43
- package/lib-esm/react-component-lib/createControllerComponent.js +0 -146
- package/lib-esm/react-component-lib/createControllerComponent.js.map +0 -1
- package/lib-esm/react-component-lib/createOverlayComponent.d.ts +0 -45
- package/lib-esm/react-component-lib/createOverlayComponent.js +0 -142
- package/lib-esm/react-component-lib/createOverlayComponent.js.map +0 -1
- package/lib-esm/react-component-lib/index.d.ts +0 -3
- package/lib-esm/react-component-lib/index.js +0 -4
- package/lib-esm/react-component-lib/index.js.map +0 -1
- package/lib-esm/react-component-lib/utils/attachEventProps.d.ts +0 -8
- package/lib-esm/react-component-lib/utils/attachEventProps.js +0 -79
- package/lib-esm/react-component-lib/utils/attachEventProps.js.map +0 -1
- package/lib-esm/react-component-lib/utils/index.d.ts +0 -8
- package/lib-esm/react-component-lib/utils/index.js +0 -28
- package/lib-esm/react-component-lib/utils/index.js.map +0 -1
- package/lib-esm/withAuthenticator.d.ts +0 -3
- package/lib-esm/withAuthenticator.js +0 -121
- package/lib-esm/withAuthenticator.js.map +0 -1
- package/src/components.ts +0 -65
- package/src/index.ts +0 -3
- package/src/react-component-lib/createComponent.tsx +0 -69
- package/src/react-component-lib/createControllerComponent.tsx +0 -71
- package/src/react-component-lib/createOverlayComponent.tsx +0 -79
- package/src/react-component-lib/index.ts +0 -3
- package/src/react-component-lib/utils/attachEventProps.ts +0 -87
- package/src/react-component-lib/utils/index.tsx +0 -31
- package/src/withAuthenticator.tsx +0 -62
- package/webpack.config.dev.js +0 -6
- package/webpack.config.js +0 -56
package/dist/19.js
DELETED
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
(this["webpackJsonpaws_amplify_react"] = this["webpackJsonpaws_amplify_react"] || []).push([[19],{
|
|
2
|
-
|
|
3
|
-
/***/ "../amplify-ui-components/dist/esm-es5/amplify-form-field_4.entry.js":
|
|
4
|
-
/*!***************************************************************************!*\
|
|
5
|
-
!*** ../amplify-ui-components/dist/esm-es5/amplify-form-field_4.entry.js ***!
|
|
6
|
-
\***************************************************************************/
|
|
7
|
-
/*! exports provided: amplify_form_field, amplify_hint, amplify_input, amplify_label */
|
|
8
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
9
|
-
|
|
10
|
-
"use strict";
|
|
11
|
-
__webpack_require__.r(__webpack_exports__);
|
|
12
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "amplify_form_field", function() { return AmplifyFormField; });
|
|
13
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "amplify_hint", function() { return AmplifyHint; });
|
|
14
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "amplify_input", function() { return AmplifyInput; });
|
|
15
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "amplify_label", function() { return AmplifyLabel; });
|
|
16
|
-
/* harmony import */ var _index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index-83f2275b.js */ "../amplify-ui-components/dist/esm-es5/index-83f2275b.js");
|
|
17
|
-
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
|
|
18
|
-
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__);
|
|
19
|
-
/* harmony import */ var _auth_types_78df304e_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./auth-types-78df304e.js */ "../amplify-ui-components/dist/esm-es5/auth-types-78df304e.js");
|
|
20
|
-
/* harmony import */ var _aws_amplify_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @aws-amplify/auth */ "@aws-amplify/auth");
|
|
21
|
-
/* harmony import */ var _aws_amplify_auth__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_auth__WEBPACK_IMPORTED_MODULE_3__);
|
|
22
|
-
/* harmony import */ var _Translations_108d469f_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Translations-108d469f.js */ "../amplify-ui-components/dist/esm-es5/Translations-108d469f.js");
|
|
23
|
-
/* harmony import */ var _constants_c8ecaa24_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constants-c8ecaa24.js */ "../amplify-ui-components/dist/esm-es5/constants-c8ecaa24.js");
|
|
24
|
-
/* harmony import */ var _helpers_14fcb50c_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers-14fcb50c.js */ "../amplify-ui-components/dist/esm-es5/helpers-14fcb50c.js");
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var amplifyFormFieldCss = "amplify-form-field{--label-font-size:var(--amplify-text-md);--description-font-size:var(--amplify-text-sm)}.form-field{margin-bottom:15px}.form-field-label{display:block;font-size:var(--label-font-size);padding-bottom:0.5em}.form-field-description{font-size:var(--description-font-size);padding-top:0.5em}";
|
|
33
|
-
|
|
34
|
-
var AmplifyFormField =
|
|
35
|
-
/** @class */
|
|
36
|
-
function () {
|
|
37
|
-
function AmplifyFormField(hostRef) {
|
|
38
|
-
Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["r"])(this, hostRef);
|
|
39
|
-
/** The input type. Can be any HTML input type. */
|
|
40
|
-
|
|
41
|
-
this.type = 'text';
|
|
42
|
-
/** The required flag in order to make an input required prior to submitting a form */
|
|
43
|
-
|
|
44
|
-
this.required = false;
|
|
45
|
-
/** (Optional) The placeholder for the input element. Using hints is recommended, but placeholders can also be useful to convey information to users. */
|
|
46
|
-
|
|
47
|
-
this.placeholder = '';
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
AmplifyFormField.prototype.render = function () {
|
|
51
|
-
return Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", {
|
|
52
|
-
"class": "form-field"
|
|
53
|
-
}, this.label && Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", {
|
|
54
|
-
"class": "form-field-label"
|
|
55
|
-
}, Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("amplify-label", {
|
|
56
|
-
htmlFor: this.fieldId
|
|
57
|
-
}, this.label)), this.description && Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", {
|
|
58
|
-
id: this.fieldId + "-description",
|
|
59
|
-
"class": "form-field-description",
|
|
60
|
-
"data-test": "form-field-description"
|
|
61
|
-
}, this.description), Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", null, Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("slot", {
|
|
62
|
-
name: "input"
|
|
63
|
-
}, Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("amplify-input", {
|
|
64
|
-
fieldId: this.fieldId,
|
|
65
|
-
description: this.description,
|
|
66
|
-
type: this.type,
|
|
67
|
-
handleInputChange: this.handleInputChange,
|
|
68
|
-
placeholder: this.placeholder,
|
|
69
|
-
name: this.name,
|
|
70
|
-
value: this.value,
|
|
71
|
-
inputProps: this.inputProps,
|
|
72
|
-
disabled: this.disabled,
|
|
73
|
-
required: this.required
|
|
74
|
-
}))), this.hint && Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("amplify-hint", {
|
|
75
|
-
id: this.fieldId + "-hint"
|
|
76
|
-
}, this.hint));
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
return AmplifyFormField;
|
|
80
|
-
}();
|
|
81
|
-
|
|
82
|
-
AmplifyFormField.style = amplifyFormFieldCss;
|
|
83
|
-
var amplifyHintCss = ":host{--color:var(--amplify-grey);--font-family:var(--amplify-font-family);--font-size:var(--amplify-text-xs);--font-weight:var(--amplify-font-weight)}.hint{color:var(--color);font-family:var(--font-family);font-weight:var(--font-weight);font-size:var(--font-size);margin-bottom:2.625rem}";
|
|
84
|
-
|
|
85
|
-
var AmplifyHint =
|
|
86
|
-
/** @class */
|
|
87
|
-
function () {
|
|
88
|
-
function AmplifyHint(hostRef) {
|
|
89
|
-
Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["r"])(this, hostRef);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
AmplifyHint.prototype.render = function () {
|
|
93
|
-
return Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", {
|
|
94
|
-
"class": "hint"
|
|
95
|
-
}, Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("slot", null));
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
return AmplifyHint;
|
|
99
|
-
}();
|
|
100
|
-
|
|
101
|
-
AmplifyHint.style = amplifyHintCss;
|
|
102
|
-
var amplifyInputCss = "amplify-input{--color:var(--amplify-secondary-color);--background-color:var(--amplify-secondary-contrast);--border-color:var(--amplify-light-grey);--border-color-focus:var(--amplify-primary-color);--border:1px solid var(--border-color);--margin:0 0 0.625rem 0}[data-autocompleted]{background-color:#e8f0fe !important}.input-host{width:100%}.input{display:block;width:100%;padding:1rem;font-size:var(--amplify-text-sm);color:var(--color);background-color:var(--background-color);background-image:none;border:var(--border);border-radius:3px;-webkit-box-sizing:border-box;box-sizing:border-box;margin:var(--margin);height:3.125rem;line-height:1.1;-webkit-box-shadow:none;box-shadow:none}.input:focus{outline:none;border-color:var(--border-color-focus)}.input:disabled{opacity:0.5}";
|
|
103
|
-
|
|
104
|
-
var AmplifyInput =
|
|
105
|
-
/** @class */
|
|
106
|
-
function () {
|
|
107
|
-
function AmplifyInput(hostRef) {
|
|
108
|
-
Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["r"])(this, hostRef);
|
|
109
|
-
/** The input type. Can be any HTML input type. */
|
|
110
|
-
|
|
111
|
-
this.type = 'text';
|
|
112
|
-
/** The callback, called when the input is modified by the user. */
|
|
113
|
-
|
|
114
|
-
this.handleInputChange = function () {
|
|
115
|
-
return void 0;
|
|
116
|
-
};
|
|
117
|
-
/** (Optional) The placeholder for the input element. Using hints is recommended, but placeholders can also be useful to convey information to users. */
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
this.placeholder = '';
|
|
121
|
-
/** Whether the input is a required field */
|
|
122
|
-
|
|
123
|
-
this.required = false;
|
|
124
|
-
/** Whether the input has been autocompleted */
|
|
125
|
-
|
|
126
|
-
this.autoCompleted = false;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Sets the value of this input to the value in autofill input event.
|
|
130
|
-
*/
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
AmplifyInput.prototype.setAutoCompleteValue = function (value) {
|
|
134
|
-
var input = this.el.querySelector('input');
|
|
135
|
-
if (!input) return;
|
|
136
|
-
input.value = value; // dispatch an input event from this element to the parent form
|
|
137
|
-
|
|
138
|
-
input.dispatchEvent(new Event('input'));
|
|
139
|
-
this.autoCompleted = true;
|
|
140
|
-
};
|
|
141
|
-
/**
|
|
142
|
-
* Checks if the target dummy input in `amplify-auth-container` is present have been autofilled.
|
|
143
|
-
* If so, we update this.value with the autofilled value.
|
|
144
|
-
*/
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
AmplifyInput.prototype.checkAutoCompletion = function (targetInput) {
|
|
148
|
-
var _this = this;
|
|
149
|
-
|
|
150
|
-
if (!targetInput) return;
|
|
151
|
-
|
|
152
|
-
if (targetInput.value) {
|
|
153
|
-
// if value is already set, we set the value directly
|
|
154
|
-
this.setAutoCompleteValue(targetInput.value);
|
|
155
|
-
} else {
|
|
156
|
-
// if value is not set, we start listening for it
|
|
157
|
-
targetInput.addEventListener('input', function (e) {
|
|
158
|
-
var value = e.target.value;
|
|
159
|
-
|
|
160
|
-
_this.setAutoCompleteValue(value);
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
AmplifyInput.prototype.disconnectedCallback = function () {
|
|
166
|
-
this.removeHubListener && this.removeHubListener(); // stop listening to `onAuthUIStateChange`
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
AmplifyInput.prototype.componentWillLoad = function () {
|
|
170
|
-
var _this = this; // the below behaviors are only applicable if `amplify-input` is used by `amplify-authenticator`.
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
if (!Object(_helpers_14fcb50c_js__WEBPACK_IMPORTED_MODULE_6__["e"])('amplify-authenticator', this.el)) return;
|
|
174
|
-
this.removeHubListener = Object(_helpers_14fcb50c_js__WEBPACK_IMPORTED_MODULE_6__["o"])(function () {
|
|
175
|
-
/**
|
|
176
|
-
* When we're using slots, autofilled data will persist between different authState,
|
|
177
|
-
* even though input events are not triggered. This ends up in parent components
|
|
178
|
-
* not picking up input values. For now, we're emptying the input on authState change
|
|
179
|
-
* which is the existing behavior.
|
|
180
|
-
*/
|
|
181
|
-
var input = _this.el.querySelector('input');
|
|
182
|
-
|
|
183
|
-
if (input) input.value = '';
|
|
184
|
-
_this.autoCompleted = false;
|
|
185
|
-
});
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
AmplifyInput.prototype.componentDidLoad = function () {
|
|
189
|
-
// no-op if this field already has been autofilled or already has an value
|
|
190
|
-
if (this.autoCompleted || this.value) return;
|
|
191
|
-
if (/Firefox/.test(navigator.userAgent)) return; // firefox autofill works
|
|
192
|
-
|
|
193
|
-
var container = Object(_helpers_14fcb50c_js__WEBPACK_IMPORTED_MODULE_6__["e"])('amplify-auth-container', this.el);
|
|
194
|
-
var signIn = Object(_helpers_14fcb50c_js__WEBPACK_IMPORTED_MODULE_6__["e"])('amplify-sign-in', this.el); // only autocomplete if `amplify-auth-container` is present and input is under `sign-in`.
|
|
195
|
-
|
|
196
|
-
if (!container || !signIn) return;
|
|
197
|
-
var username = container.querySelector("input[name='username']");
|
|
198
|
-
var password = container.querySelector("input[name='password']");
|
|
199
|
-
|
|
200
|
-
if (this.name === 'username' || this.name === 'email' || this.name === 'phone') {
|
|
201
|
-
this.checkAutoCompletion(username);
|
|
202
|
-
} else if (this.name === 'password') {
|
|
203
|
-
this.checkAutoCompletion(password);
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
AmplifyInput.prototype.render = function () {
|
|
208
|
-
var _this = this;
|
|
209
|
-
|
|
210
|
-
return Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["H"], {
|
|
211
|
-
"class": "input-host"
|
|
212
|
-
}, Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("input", Object.assign({
|
|
213
|
-
id: this.fieldId,
|
|
214
|
-
"aria-describedby": this.fieldId && this.description ? this.fieldId + "-description" : null,
|
|
215
|
-
"data-autocompleted": this.autoCompleted,
|
|
216
|
-
type: this.type,
|
|
217
|
-
onInput: function onInput(event) {
|
|
218
|
-
_this.autoCompleted = false;
|
|
219
|
-
|
|
220
|
-
_this.handleInputChange(event);
|
|
221
|
-
},
|
|
222
|
-
placeholder: this.placeholder,
|
|
223
|
-
name: this.name,
|
|
224
|
-
"class": "input",
|
|
225
|
-
value: this.value,
|
|
226
|
-
disabled: this.disabled,
|
|
227
|
-
required: this.required
|
|
228
|
-
}, this.inputProps)));
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
Object.defineProperty(AmplifyInput.prototype, "el", {
|
|
232
|
-
get: function get() {
|
|
233
|
-
return Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["g"])(this);
|
|
234
|
-
},
|
|
235
|
-
enumerable: false,
|
|
236
|
-
configurable: true
|
|
237
|
-
});
|
|
238
|
-
return AmplifyInput;
|
|
239
|
-
}();
|
|
240
|
-
|
|
241
|
-
AmplifyInput.style = amplifyInputCss;
|
|
242
|
-
var amplifyLabelCss = ":host{--label-color:var(--amplify-secondary-color)}.label{color:var(--label-color);font-size:var(--amplify-text-sm);margin-bottom:16px}";
|
|
243
|
-
|
|
244
|
-
var AmplifyLabel =
|
|
245
|
-
/** @class */
|
|
246
|
-
function () {
|
|
247
|
-
function AmplifyLabel(hostRef) {
|
|
248
|
-
Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["r"])(this, hostRef);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
AmplifyLabel.prototype.render = function () {
|
|
252
|
-
return Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("label", {
|
|
253
|
-
"class": "label",
|
|
254
|
-
htmlFor: this.htmlFor
|
|
255
|
-
}, Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("slot", null));
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
return AmplifyLabel;
|
|
259
|
-
}();
|
|
260
|
-
|
|
261
|
-
AmplifyLabel.style = amplifyLabelCss;
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
/***/ })
|
|
265
|
-
|
|
266
|
-
}]);
|
|
267
|
-
//# sourceMappingURL=19.js.map
|
package/dist/19.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///./node_modules/@aws-amplify/ui-components/dist/esm-es5/amplify-form-field_4.entry.js"],"names":["amplifyFormFieldCss","AmplifyFormField","registerInstance","h","htmlFor","fieldId","id","name","description","type","handleInputChange","placeholder","value","inputProps","disabled","required","amplifyHintCss","AmplifyHint","amplifyInputCss","AmplifyInput","input","_this","targetInput","e","closestElement","onAuthUIStateChange","navigator","container","signIn","username","password","onInput","Object","get","getElement","enumerable","configurable","amplifyLabelCss","AmplifyLabel"],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIA,mBAAmB,GAAvB;;AACA,IAAIC,gBAAgB;AAAG;AAAe,YAAY;AAC9C,qCAAmC;AAC/BC,gEAAgB,OAAhBA,OAAgB,CAAhBA;AACA;;AACA;AACA;;AACA;AACA;;AACA;AACH;;AACDD,kBAAgB,CAAhBA,mBAAoC,YAAY;AAC5C,WAAQE,4DAAC,QAAQ;AAAE,eAAO;AAAT,KAAR,EAAiC,cAAeA,4DAAC,QAAQ;AAAE,eAAO;AAAT,KAAR,EAAuCA,4DAAC,kBAAkB;AAAEC,aAAO,EAAE,KAAKC;AAAhB,KAAlB,EAA6C,KAAtI,KAAyF,CAAxC,CAAjD,EAAqJ,oBAAqBF,4DAAC,QAAQ;AAAEG,QAAE,EAAE,eAAN;AAAqC,eAArC;AAAsE,mBAAa;AAAnF,KAAR,EAAuH,KAAlS,WAA2K,CAA3K,EAAsTH,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T;AADJmC;;AAGA;AAPJ,CAAkC,EAAlC;;AASAA,YAAY,CAAZA","file":"19.js","sourcesContent":["import { r as registerInstance, h, H as Host, g as getElement } from './index-83f2275b.js';\nimport '@aws-amplify/core';\nimport './auth-types-78df304e.js';\nimport '@aws-amplify/auth';\nimport './Translations-108d469f.js';\nimport './constants-c8ecaa24.js';\nimport { e as closestElement, o as onAuthUIStateChange } from './helpers-14fcb50c.js';\nvar amplifyFormFieldCss = \"amplify-form-field{--label-font-size:var(--amplify-text-md);--description-font-size:var(--amplify-text-sm)}.form-field{margin-bottom:15px}.form-field-label{display:block;font-size:var(--label-font-size);padding-bottom:0.5em}.form-field-description{font-size:var(--description-font-size);padding-top:0.5em}\";\nvar AmplifyFormField = /** @class */ (function () {\n function AmplifyFormField(hostRef) {\n registerInstance(this, hostRef);\n /** The input type. Can be any HTML input type. */\n this.type = 'text';\n /** The required flag in order to make an input required prior to submitting a form */\n this.required = false;\n /** (Optional) The placeholder for the input element. Using hints is recommended, but placeholders can also be useful to convey information to users. */\n this.placeholder = '';\n }\n AmplifyFormField.prototype.render = function () {\n return (h(\"div\", { class: \"form-field\" }, this.label && (h(\"div\", { class: \"form-field-label\" }, h(\"amplify-label\", { htmlFor: this.fieldId }, this.label))), this.description && (h(\"div\", { id: this.fieldId + \"-description\", class: \"form-field-description\", \"data-test\": \"form-field-description\" }, this.description)), h(\"div\", null, h(\"slot\", { name: \"input\" }, h(\"amplify-input\", { fieldId: this.fieldId, description: this.description, type: this.type, handleInputChange: this.handleInputChange, placeholder: this.placeholder, name: this.name, value: this.value, inputProps: this.inputProps, disabled: this.disabled, required: this.required }))), this.hint && (h(\"amplify-hint\", { id: this.fieldId + \"-hint\" }, this.hint))));\n };\n return AmplifyFormField;\n}());\nAmplifyFormField.style = amplifyFormFieldCss;\nvar amplifyHintCss = \":host{--color:var(--amplify-grey);--font-family:var(--amplify-font-family);--font-size:var(--amplify-text-xs);--font-weight:var(--amplify-font-weight)}.hint{color:var(--color);font-family:var(--font-family);font-weight:var(--font-weight);font-size:var(--font-size);margin-bottom:2.625rem}\";\nvar AmplifyHint = /** @class */ (function () {\n function AmplifyHint(hostRef) {\n registerInstance(this, hostRef);\n }\n AmplifyHint.prototype.render = function () {\n return (h(\"div\", { class: \"hint\" }, h(\"slot\", null)));\n };\n return AmplifyHint;\n}());\nAmplifyHint.style = amplifyHintCss;\nvar amplifyInputCss = \"amplify-input{--color:var(--amplify-secondary-color);--background-color:var(--amplify-secondary-contrast);--border-color:var(--amplify-light-grey);--border-color-focus:var(--amplify-primary-color);--border:1px solid var(--border-color);--margin:0 0 0.625rem 0}[data-autocompleted]{background-color:#e8f0fe !important}.input-host{width:100%}.input{display:block;width:100%;padding:1rem;font-size:var(--amplify-text-sm);color:var(--color);background-color:var(--background-color);background-image:none;border:var(--border);border-radius:3px;-webkit-box-sizing:border-box;box-sizing:border-box;margin:var(--margin);height:3.125rem;line-height:1.1;-webkit-box-shadow:none;box-shadow:none}.input:focus{outline:none;border-color:var(--border-color-focus)}.input:disabled{opacity:0.5}\";\nvar AmplifyInput = /** @class */ (function () {\n function AmplifyInput(hostRef) {\n registerInstance(this, hostRef);\n /** The input type. Can be any HTML input type. */\n this.type = 'text';\n /** The callback, called when the input is modified by the user. */\n this.handleInputChange = function () { return void 0; };\n /** (Optional) The placeholder for the input element. Using hints is recommended, but placeholders can also be useful to convey information to users. */\n this.placeholder = '';\n /** Whether the input is a required field */\n this.required = false;\n /** Whether the input has been autocompleted */\n this.autoCompleted = false;\n }\n /**\n * Sets the value of this input to the value in autofill input event.\n */\n AmplifyInput.prototype.setAutoCompleteValue = function (value) {\n var input = this.el.querySelector('input');\n if (!input)\n return;\n input.value = value;\n // dispatch an input event from this element to the parent form\n input.dispatchEvent(new Event('input'));\n this.autoCompleted = true;\n };\n /**\n * Checks if the target dummy input in `amplify-auth-container` is present have been autofilled.\n * If so, we update this.value with the autofilled value.\n */\n AmplifyInput.prototype.checkAutoCompletion = function (targetInput) {\n var _this = this;\n if (!targetInput)\n return;\n if (targetInput.value) {\n // if value is already set, we set the value directly\n this.setAutoCompleteValue(targetInput.value);\n }\n else {\n // if value is not set, we start listening for it\n targetInput.addEventListener('input', function (e) {\n var value = e.target.value;\n _this.setAutoCompleteValue(value);\n });\n }\n };\n AmplifyInput.prototype.disconnectedCallback = function () {\n this.removeHubListener && this.removeHubListener(); // stop listening to `onAuthUIStateChange`\n };\n AmplifyInput.prototype.componentWillLoad = function () {\n var _this = this;\n // the below behaviors are only applicable if `amplify-input` is used by `amplify-authenticator`.\n if (!closestElement('amplify-authenticator', this.el))\n return;\n this.removeHubListener = onAuthUIStateChange(function () {\n /**\n * When we're using slots, autofilled data will persist between different authState,\n * even though input events are not triggered. This ends up in parent components\n * not picking up input values. For now, we're emptying the input on authState change\n * which is the existing behavior.\n */\n var input = _this.el.querySelector('input');\n if (input)\n input.value = '';\n _this.autoCompleted = false;\n });\n };\n AmplifyInput.prototype.componentDidLoad = function () {\n // no-op if this field already has been autofilled or already has an value\n if (this.autoCompleted || this.value)\n return;\n if (/Firefox/.test(navigator.userAgent))\n return; // firefox autofill works\n var container = closestElement('amplify-auth-container', this.el);\n var signIn = closestElement('amplify-sign-in', this.el);\n // only autocomplete if `amplify-auth-container` is present and input is under `sign-in`.\n if (!container || !signIn)\n return;\n var username = container.querySelector(\"input[name='username']\");\n var password = container.querySelector(\"input[name='password']\");\n if (this.name === 'username' ||\n this.name === 'email' ||\n this.name === 'phone') {\n this.checkAutoCompletion(username);\n }\n else if (this.name === 'password') {\n this.checkAutoCompletion(password);\n }\n };\n AmplifyInput.prototype.render = function () {\n var _this = this;\n return (h(Host, { class: \"input-host\" }, h(\"input\", Object.assign({ id: this.fieldId, \"aria-describedby\": this.fieldId && this.description\n ? this.fieldId + \"-description\"\n : null, \"data-autocompleted\": this.autoCompleted, type: this.type, onInput: function (event) {\n _this.autoCompleted = false;\n _this.handleInputChange(event);\n }, placeholder: this.placeholder, name: this.name, class: \"input\", value: this.value, disabled: this.disabled, required: this.required }, this.inputProps))));\n };\n Object.defineProperty(AmplifyInput.prototype, \"el\", {\n get: function () { return getElement(this); },\n enumerable: false,\n configurable: true\n });\n return AmplifyInput;\n}());\nAmplifyInput.style = amplifyInputCss;\nvar amplifyLabelCss = \":host{--label-color:var(--amplify-secondary-color)}.label{color:var(--label-color);font-size:var(--amplify-text-sm);margin-bottom:16px}\";\nvar AmplifyLabel = /** @class */ (function () {\n function AmplifyLabel(hostRef) {\n registerInstance(this, hostRef);\n }\n AmplifyLabel.prototype.render = function () {\n return (h(\"label\", { class: \"label\", htmlFor: this.htmlFor }, h(\"slot\", null)));\n };\n return AmplifyLabel;\n}());\nAmplifyLabel.style = amplifyLabelCss;\nexport { AmplifyFormField as amplify_form_field, AmplifyHint as amplify_hint, AmplifyInput as amplify_input, AmplifyLabel as amplify_label };\n"],"sourceRoot":""}
|