@aws-amplify/ui-react 1.2.56-legacy-ui-tests.6 → 1.2.60-unstable.5
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/CHANGELOG.md +32 -0
- package/dist/0.js.map +1 -1
- package/dist/1.js +52 -220
- package/dist/1.js.map +1 -1
- package/dist/10.js +1 -8
- package/dist/10.js.map +1 -1
- package/dist/11.js +11 -110
- package/dist/11.js.map +1 -1
- package/dist/12.js +3 -29
- package/dist/12.js.map +1 -1
- package/dist/13.js +60 -339
- package/dist/13.js.map +1 -1
- package/dist/14.js +1 -12
- package/dist/14.js.map +1 -1
- package/dist/15.js +1 -8
- package/dist/15.js.map +1 -1
- package/dist/16.js +9 -31
- package/dist/16.js.map +1 -1
- package/dist/17.js +3 -17
- package/dist/17.js.map +1 -1
- package/dist/18.js +10 -61
- package/dist/18.js.map +1 -1
- package/dist/19.js +1 -11
- package/dist/19.js.map +1 -1
- package/dist/2.js +129 -736
- package/dist/2.js.map +1 -1
- package/dist/20.js +1 -10
- package/dist/20.js.map +1 -1
- package/dist/21.js +3 -13
- package/dist/21.js.map +1 -1
- package/dist/22.js +1 -9
- package/dist/22.js.map +1 -1
- package/dist/23.js +19 -77
- package/dist/23.js.map +1 -1
- package/dist/24.js +1 -18
- package/dist/24.js.map +1 -1
- package/dist/25.js +1 -11
- package/dist/25.js.map +1 -1
- package/dist/26.js +25 -94
- package/dist/26.js.map +1 -1
- package/dist/27.js +1 -8
- package/dist/27.js.map +1 -1
- package/dist/28.js +1 -9
- package/dist/28.js.map +1 -1
- package/dist/29.js +13 -96
- package/dist/29.js.map +1 -1
- package/dist/3.js +235 -859
- package/dist/3.js.map +1 -1
- package/dist/30.js.map +1 -1
- package/dist/4.js +45 -214
- package/dist/4.js.map +1 -1
- package/dist/5.js +39 -169
- package/dist/5.js.map +1 -1
- package/dist/6.js +45 -187
- package/dist/6.js.map +1 -1
- package/dist/7.js +38 -164
- package/dist/7.js.map +1 -1
- package/dist/8.js +45 -187
- package/dist/8.js.map +1 -1
- package/dist/9.js +34 -189
- package/dist/9.js.map +1 -1
- package/dist/@aws-amplify/ui-react.js +293 -1150
- package/dist/@aws-amplify/ui-react.js.map +1 -1
- package/dist/aws-amplify-react.min.js.map +1 -1
- package/dist/polyfills-core-js.js +1774 -2129
- package/dist/polyfills-core-js.js.map +1 -1
- package/dist/polyfills-css-shim.js +47 -113
- package/dist/polyfills-css-shim.js.map +1 -1
- package/dist/polyfills-dom.js +122 -391
- package/dist/polyfills-dom.js.map +1 -1
- package/package.json +3 -3
- package/lib/components.d.ts +0 -56
- package/lib/index.d.ts +0 -2
- package/lib/react-component-lib/createComponent.d.ts +0 -2
- package/lib/react-component-lib/createControllerComponent.d.ts +0 -43
- package/lib/react-component-lib/createOverlayComponent.d.ts +0 -45
- package/lib/react-component-lib/index.d.ts +0 -3
- package/lib/react-component-lib/utils/attachEventProps.d.ts +0 -8
- package/lib/react-component-lib/utils/index.d.ts +0 -8
- package/lib/withAuthenticator.d.ts +0 -3
package/dist/11.js
CHANGED
|
@@ -110,18 +110,13 @@ var componentFieldMapping = {
|
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
112
|
var amplifyAuthFieldsCss = ".auth-fields{margin-bottom:2rem}";
|
|
113
|
-
|
|
114
|
-
var AmplifyAuthFields =
|
|
115
|
-
/** @class */
|
|
116
|
-
function () {
|
|
113
|
+
var AmplifyAuthFields = /** @class */function () {
|
|
117
114
|
function AmplifyAuthFields(hostRef) {
|
|
118
115
|
Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["r"])(this, hostRef);
|
|
119
116
|
}
|
|
120
|
-
|
|
121
117
|
AmplifyAuthFields.prototype.componentWillLoad = function () {
|
|
122
118
|
console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');
|
|
123
119
|
};
|
|
124
|
-
|
|
125
120
|
AmplifyAuthFields.prototype.constructFormFieldOptions = function (formFields) {
|
|
126
121
|
var content = [];
|
|
127
122
|
if (formFields === undefined) return '';
|
|
@@ -136,41 +131,29 @@ function () {
|
|
|
136
131
|
});
|
|
137
132
|
return content;
|
|
138
133
|
};
|
|
139
|
-
|
|
140
134
|
AmplifyAuthFields.prototype.render = function () {
|
|
141
135
|
return Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", {
|
|
142
136
|
"class": "auth-fields"
|
|
143
137
|
}, this.constructFormFieldOptions(this.formFields));
|
|
144
138
|
};
|
|
145
|
-
|
|
146
139
|
return AmplifyAuthFields;
|
|
147
140
|
}();
|
|
148
|
-
|
|
149
141
|
AmplifyAuthFields.style = amplifyAuthFieldsCss;
|
|
150
|
-
|
|
151
|
-
var AmplifyCodeField =
|
|
152
|
-
/** @class */
|
|
153
|
-
function () {
|
|
142
|
+
var AmplifyCodeField = /** @class */function () {
|
|
154
143
|
function AmplifyCodeField(hostRef) {
|
|
155
144
|
Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["r"])(this, hostRef);
|
|
156
145
|
/** Based on the type of field e.g. sign in, sign up, forgot password, etc. */
|
|
157
|
-
|
|
158
146
|
this.fieldId = _constants_c8ecaa24_js__WEBPACK_IMPORTED_MODULE_4__["i"];
|
|
159
147
|
/** Used for the code label */
|
|
160
|
-
|
|
161
148
|
this.label = _Translations_108d469f_js__WEBPACK_IMPORTED_MODULE_3__["T"].CODE_LABEL;
|
|
162
149
|
/** Used for the placeholder label */
|
|
163
|
-
|
|
164
150
|
this.placeholder = _Translations_108d469f_js__WEBPACK_IMPORTED_MODULE_3__["T"].CODE_PLACEHOLDER;
|
|
165
151
|
/** The required flag in order to make an input required prior to submitting a form */
|
|
166
|
-
|
|
167
152
|
this.required = false;
|
|
168
153
|
}
|
|
169
|
-
|
|
170
154
|
AmplifyCodeField.prototype.componentWillLoad = function () {
|
|
171
155
|
console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');
|
|
172
156
|
};
|
|
173
|
-
|
|
174
157
|
AmplifyCodeField.prototype.render = function () {
|
|
175
158
|
return Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("amplify-form-field", {
|
|
176
159
|
fieldId: this.fieldId,
|
|
@@ -185,10 +168,8 @@ function () {
|
|
|
185
168
|
disabled: this.disabled
|
|
186
169
|
});
|
|
187
170
|
};
|
|
188
|
-
|
|
189
171
|
return AmplifyCodeField;
|
|
190
172
|
}();
|
|
191
|
-
|
|
192
173
|
var countryDialCodes = [{
|
|
193
174
|
label: '+1',
|
|
194
175
|
value: '+1'
|
|
@@ -808,32 +789,23 @@ var countryDialCodes = [{
|
|
|
808
789
|
label: '+998',
|
|
809
790
|
value: '+998'
|
|
810
791
|
}];
|
|
811
|
-
|
|
812
|
-
var AmplifyCountryDialCode =
|
|
813
|
-
/** @class */
|
|
814
|
-
function () {
|
|
792
|
+
var AmplifyCountryDialCode = /** @class */function () {
|
|
815
793
|
function AmplifyCountryDialCode(hostRef) {
|
|
816
794
|
Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["r"])(this, hostRef);
|
|
817
795
|
/** The ID of the field. Should match with its corresponding input's ID. */
|
|
818
|
-
|
|
819
796
|
this.fieldId = _constants_c8ecaa24_js__WEBPACK_IMPORTED_MODULE_4__["C"];
|
|
820
797
|
/** The options of the country dial code select input. */
|
|
821
|
-
|
|
822
798
|
this.options = countryDialCodes;
|
|
823
799
|
/** Default selected dial code */
|
|
824
|
-
|
|
825
800
|
this.dialCode = '+1';
|
|
826
801
|
}
|
|
827
|
-
|
|
828
802
|
AmplifyCountryDialCode.prototype.componentWillLoad = function () {
|
|
829
803
|
console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');
|
|
830
804
|
this.setSelectedDialCode();
|
|
831
805
|
};
|
|
832
|
-
|
|
833
806
|
AmplifyCountryDialCode.prototype.watchDialCodeHandler = function () {
|
|
834
807
|
this.setSelectedDialCode();
|
|
835
808
|
};
|
|
836
|
-
|
|
837
809
|
AmplifyCountryDialCode.prototype.setSelectedDialCode = function () {
|
|
838
810
|
if (typeof this.dialCode === 'number') {
|
|
839
811
|
this.selectedDialCode = "+" + this.dialCode;
|
|
@@ -841,7 +813,6 @@ function () {
|
|
|
841
813
|
this.selectedDialCode = this.dialCode;
|
|
842
814
|
}
|
|
843
815
|
};
|
|
844
|
-
|
|
845
816
|
AmplifyCountryDialCode.prototype.render = function () {
|
|
846
817
|
return Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("amplify-select", {
|
|
847
818
|
fieldId: this.fieldId,
|
|
@@ -850,7 +821,6 @@ function () {
|
|
|
850
821
|
selected: this.selectedDialCode
|
|
851
822
|
});
|
|
852
823
|
};
|
|
853
|
-
|
|
854
824
|
Object.defineProperty(AmplifyCountryDialCode, "watchers", {
|
|
855
825
|
get: function get() {
|
|
856
826
|
return {
|
|
@@ -862,30 +832,21 @@ function () {
|
|
|
862
832
|
});
|
|
863
833
|
return AmplifyCountryDialCode;
|
|
864
834
|
}();
|
|
865
|
-
|
|
866
|
-
var AmplifyEmailField =
|
|
867
|
-
/** @class */
|
|
868
|
-
function () {
|
|
835
|
+
var AmplifyEmailField = /** @class */function () {
|
|
869
836
|
function AmplifyEmailField(hostRef) {
|
|
870
837
|
Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["r"])(this, hostRef);
|
|
871
838
|
/** Based on the type of field e.g. sign in, sign up, forgot password, etc. */
|
|
872
|
-
|
|
873
839
|
this.fieldId = _constants_c8ecaa24_js__WEBPACK_IMPORTED_MODULE_4__["E"];
|
|
874
840
|
/** Used for the EMAIL label */
|
|
875
|
-
|
|
876
841
|
this.label = _Translations_108d469f_js__WEBPACK_IMPORTED_MODULE_3__["T"].EMAIL_LABEL;
|
|
877
842
|
/** Used for the placeholder label */
|
|
878
|
-
|
|
879
843
|
this.placeholder = _Translations_108d469f_js__WEBPACK_IMPORTED_MODULE_3__["T"].EMAIL_PLACEHOLDER;
|
|
880
844
|
/** The required flag in order to make an input required prior to submitting a form */
|
|
881
|
-
|
|
882
845
|
this.required = false;
|
|
883
846
|
}
|
|
884
|
-
|
|
885
847
|
AmplifyEmailField.prototype.componentWillLoad = function () {
|
|
886
848
|
console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');
|
|
887
849
|
};
|
|
888
|
-
|
|
889
850
|
AmplifyEmailField.prototype.render = function () {
|
|
890
851
|
return Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("amplify-form-field", {
|
|
891
852
|
fieldId: this.fieldId,
|
|
@@ -901,40 +862,28 @@ function () {
|
|
|
901
862
|
hint: this.hint
|
|
902
863
|
});
|
|
903
864
|
};
|
|
904
|
-
|
|
905
865
|
return AmplifyEmailField;
|
|
906
866
|
}();
|
|
907
|
-
|
|
908
867
|
var amplifyFormSectionCss = "amplify-form-section{--header-color:var(--amplify-secondary-color);--header-size:var(--amplify-text-md-sub);--subtitle-size:var(--amplify-grey);--subtitle-color:var(--amplify-grey);--footer-color:var(--amplify-grey);--footer-size:var(--amplify-text-sm);--font-family:var(--amplify-font-family);--font-weight:var(--amplify-font-weight)}.form-section-header{margin:1rem 0 1.5rem 0}.form-section-header .header{color:var(--header-color);font-size:var(--header-size);font-weight:700;margin-bottom:0.75rem}.form-section-header .subtitle{font-weight:400;font-size:var(--amplify-text-sm);color:var(--subtitle-color)}.form-section-footer{font-family:var(--font-family);font-weight:var(--font-weight);font-size:var(--footer-size);color:var(--footer-color);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:distribute;justify-content:space-around}@media (min-width: 672px){.form-section-footer{display:-ms-flexbox;display:flex;-ms-flex-direction:row-reverse;flex-direction:row-reverse;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:baseline;align-items:baseline}}.form-section-footer *+*{margin-top:15px}";
|
|
909
|
-
|
|
910
|
-
var AmplifyFormSection =
|
|
911
|
-
/** @class */
|
|
912
|
-
function () {
|
|
868
|
+
var AmplifyFormSection = /** @class */function () {
|
|
913
869
|
function AmplifyFormSection(hostRef) {
|
|
914
870
|
Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["r"])(this, hostRef);
|
|
915
871
|
/** (Optional) Used as a the default value within the default footer slot */
|
|
916
|
-
|
|
917
872
|
this.submitButtonText = 'Submit';
|
|
918
873
|
/** String prefix for the data-test attributes in this component primarily used for testing purposes */
|
|
919
|
-
|
|
920
874
|
this.testDataPrefix = 'form-section';
|
|
921
875
|
/** Loading state for the form */
|
|
922
|
-
|
|
923
876
|
this.loading = false;
|
|
924
877
|
/** Secondary footer component or text */
|
|
925
|
-
|
|
926
878
|
this.secondaryFooterContent = null;
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
|
|
879
|
+
}
|
|
880
|
+
// eslint-disable-next-line
|
|
930
881
|
AmplifyFormSection.prototype.handleFormSubmit = function (ev) {
|
|
931
882
|
this.handleSubmit(ev.detail);
|
|
932
883
|
};
|
|
933
|
-
|
|
934
884
|
AmplifyFormSection.prototype.componentWillLoad = function () {
|
|
935
885
|
console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');
|
|
936
886
|
};
|
|
937
|
-
|
|
938
887
|
AmplifyFormSection.prototype.render = function () {
|
|
939
888
|
return Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("form", {
|
|
940
889
|
onSubmit: this.handleSubmit
|
|
@@ -958,35 +907,24 @@ function () {
|
|
|
958
907
|
"data-test": this.testDataPrefix + '-' + this.testDataPrefix + '-button'
|
|
959
908
|
}, this.loading ? Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("amplify-loading-spinner", null) : Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("span", null, this.submitButtonText)), this.secondaryFooterContent)))));
|
|
960
909
|
};
|
|
961
|
-
|
|
962
910
|
return AmplifyFormSection;
|
|
963
911
|
}();
|
|
964
|
-
|
|
965
912
|
AmplifyFormSection.style = amplifyFormSectionCss;
|
|
966
|
-
|
|
967
|
-
var AmplifyPasswordField =
|
|
968
|
-
/** @class */
|
|
969
|
-
function () {
|
|
913
|
+
var AmplifyPasswordField = /** @class */function () {
|
|
970
914
|
function AmplifyPasswordField(hostRef) {
|
|
971
915
|
Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["r"])(this, hostRef);
|
|
972
916
|
/** Based on the type of field e.g. sign in, sign up, forgot password, etc. */
|
|
973
|
-
|
|
974
917
|
this.fieldId = _constants_c8ecaa24_js__WEBPACK_IMPORTED_MODULE_4__["j"];
|
|
975
918
|
/** Used for the password label */
|
|
976
|
-
|
|
977
919
|
this.label = _Translations_108d469f_js__WEBPACK_IMPORTED_MODULE_3__["T"].PASSWORD_LABEL;
|
|
978
920
|
/** Used for the placeholder label */
|
|
979
|
-
|
|
980
921
|
this.placeholder = _Translations_108d469f_js__WEBPACK_IMPORTED_MODULE_3__["T"].PASSWORD_PLACEHOLDER;
|
|
981
922
|
/** The required flag in order to make an input required prior to submitting a form */
|
|
982
|
-
|
|
983
923
|
this.required = false;
|
|
984
924
|
}
|
|
985
|
-
|
|
986
925
|
AmplifyPasswordField.prototype.componentWillLoad = function () {
|
|
987
926
|
console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');
|
|
988
927
|
};
|
|
989
|
-
|
|
990
928
|
AmplifyPasswordField.prototype.render = function () {
|
|
991
929
|
return Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("amplify-form-field", {
|
|
992
930
|
type: "password",
|
|
@@ -1002,35 +940,24 @@ function () {
|
|
|
1002
940
|
disabled: this.disabled
|
|
1003
941
|
});
|
|
1004
942
|
};
|
|
1005
|
-
|
|
1006
943
|
return AmplifyPasswordField;
|
|
1007
944
|
}();
|
|
1008
|
-
|
|
1009
945
|
var amplifyPhoneFieldCss = ".phone-field{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:start;align-items:flex-start;width:100%}.phone-field input{border-left:none;border-radius:0 3px 3px 0}";
|
|
1010
|
-
|
|
1011
|
-
var AmplifyPhoneField =
|
|
1012
|
-
/** @class */
|
|
1013
|
-
function () {
|
|
946
|
+
var AmplifyPhoneField = /** @class */function () {
|
|
1014
947
|
function AmplifyPhoneField(hostRef) {
|
|
1015
948
|
Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["r"])(this, hostRef);
|
|
1016
949
|
/** Based on the type of field e.g. sign in, sign up, forgot password, etc. */
|
|
1017
|
-
|
|
1018
950
|
this.fieldId = _constants_c8ecaa24_js__WEBPACK_IMPORTED_MODULE_4__["b"];
|
|
1019
951
|
/** Used for the Phone label */
|
|
1020
|
-
|
|
1021
952
|
this.label = _Translations_108d469f_js__WEBPACK_IMPORTED_MODULE_3__["T"].PHONE_LABEL;
|
|
1022
953
|
/** Used for the placeholder label */
|
|
1023
|
-
|
|
1024
954
|
this.placeholder = _Translations_108d469f_js__WEBPACK_IMPORTED_MODULE_3__["T"].PHONE_PLACEHOLDER;
|
|
1025
955
|
/** The required flag in order to make an input required prior to submitting a form */
|
|
1026
|
-
|
|
1027
956
|
this.required = false;
|
|
1028
957
|
}
|
|
1029
|
-
|
|
1030
958
|
AmplifyPhoneField.prototype.componentWillLoad = function () {
|
|
1031
959
|
console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');
|
|
1032
960
|
};
|
|
1033
|
-
|
|
1034
961
|
AmplifyPhoneField.prototype.render = function () {
|
|
1035
962
|
return Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", null, Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("amplify-form-field", {
|
|
1036
963
|
label: _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["I18n"].get(this.label),
|
|
@@ -1053,10 +980,8 @@ function () {
|
|
|
1053
980
|
required: this.required
|
|
1054
981
|
}))));
|
|
1055
982
|
};
|
|
1056
|
-
|
|
1057
983
|
return AmplifyPhoneField;
|
|
1058
984
|
}();
|
|
1059
|
-
|
|
1060
985
|
AmplifyPhoneField.style = amplifyPhoneFieldCss;
|
|
1061
986
|
var amplifySelectCss = ":host{--color:var(--amplify-secondary-color);--background-color:var(--amplify-secondary-contrast);--border-color:var(--amplify-light-grey);--border-focus:var(--amplify-primary-color);--background-image:linear-gradient(45deg, transparent 50%, gray 50%),\n \tlinear-gradient(135deg, gray 50%, transparent 50%),\n \tlinear-gradient(to right, #ccc, #ccc)}.select{padding:1rem 1.75rem 1rem 1rem;font-size:var(--amplify-text-sm);color:var(--color);background-color:var(--background-color);border:1px solid var(--border-color);border-radius:3px 0 0 3px;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;-ms-flex-preferred-size:auto;flex-basis:auto;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;margin:0;height:3.125rem;background-image:var(--background-image);background-position:calc(100% - 1rem) calc(1em + 0.5rem), calc(100% - 0.7rem) calc(1em + 0.5rem), calc(100% - 2.5em) 0.5em;background-size:6px 5px, 6px 5px, 0px 1.5em;background-repeat:no-repeat}.select :focus{outline:none;border-color:var(--border-focus)}";
|
|
1062
987
|
var DEFAULT_SELECT_OPTION = [{
|
|
@@ -1064,26 +989,19 @@ var DEFAULT_SELECT_OPTION = [{
|
|
|
1064
989
|
value: 1
|
|
1065
990
|
}];
|
|
1066
991
|
var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Logger"]('amplify-select');
|
|
1067
|
-
|
|
1068
|
-
var AmplifySelect =
|
|
1069
|
-
/** @class */
|
|
1070
|
-
function () {
|
|
992
|
+
var AmplifySelect = /** @class */function () {
|
|
1071
993
|
function AmplifySelect(hostRef) {
|
|
1072
994
|
Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["r"])(this, hostRef);
|
|
1073
995
|
/** The options of the select input. Must be an Array of Objects with an Object shape of {label: string, value: string|number} */
|
|
1074
|
-
|
|
1075
996
|
this.options = DEFAULT_SELECT_OPTION;
|
|
1076
997
|
}
|
|
1077
|
-
|
|
1078
998
|
AmplifySelect.prototype.componentWillLoad = function () {
|
|
1079
999
|
console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');
|
|
1080
1000
|
this.selectOptions = this.contructSelectOptions(this.options);
|
|
1081
1001
|
};
|
|
1082
|
-
|
|
1083
1002
|
AmplifySelect.prototype.handleSelectOptionsChange = function () {
|
|
1084
1003
|
this.selectOptions = this.contructSelectOptions(this.options);
|
|
1085
1004
|
};
|
|
1086
|
-
|
|
1087
1005
|
AmplifySelect.prototype.isSelectedOptionValid = function (selected) {
|
|
1088
1006
|
if (selected && !this.options.some(function (option) {
|
|
1089
1007
|
return option.value === selected;
|
|
@@ -1091,13 +1009,10 @@ function () {
|
|
|
1091
1009
|
logger.warn('Selected option does not exist in options values, falling back to initial option');
|
|
1092
1010
|
return false;
|
|
1093
1011
|
}
|
|
1094
|
-
|
|
1095
1012
|
return true;
|
|
1096
1013
|
};
|
|
1097
|
-
|
|
1098
1014
|
AmplifySelect.prototype.contructSelectOptions = function (opts) {
|
|
1099
1015
|
var _this = this;
|
|
1100
|
-
|
|
1101
1016
|
this.isSelectedOptionValid(this.selected);
|
|
1102
1017
|
var content = [];
|
|
1103
1018
|
opts.forEach(function (opt) {
|
|
@@ -1108,7 +1023,6 @@ function () {
|
|
|
1108
1023
|
});
|
|
1109
1024
|
return content;
|
|
1110
1025
|
};
|
|
1111
|
-
|
|
1112
1026
|
AmplifySelect.prototype.render = function () {
|
|
1113
1027
|
return Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("select", {
|
|
1114
1028
|
name: this.fieldId,
|
|
@@ -1117,7 +1031,6 @@ function () {
|
|
|
1117
1031
|
onChange: this.handleInputChange
|
|
1118
1032
|
}, this.selectOptions);
|
|
1119
1033
|
};
|
|
1120
|
-
|
|
1121
1034
|
Object.defineProperty(AmplifySelect, "watchers", {
|
|
1122
1035
|
get: function get() {
|
|
1123
1036
|
return {
|
|
@@ -1130,32 +1043,22 @@ function () {
|
|
|
1130
1043
|
});
|
|
1131
1044
|
return AmplifySelect;
|
|
1132
1045
|
}();
|
|
1133
|
-
|
|
1134
1046
|
AmplifySelect.style = amplifySelectCss;
|
|
1135
|
-
|
|
1136
|
-
var AmplifyUsernameField =
|
|
1137
|
-
/** @class */
|
|
1138
|
-
function () {
|
|
1047
|
+
var AmplifyUsernameField = /** @class */function () {
|
|
1139
1048
|
function AmplifyUsernameField(hostRef) {
|
|
1140
1049
|
Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["r"])(this, hostRef);
|
|
1141
1050
|
/** Based on the type of field e.g. sign in, sign up, forgot password, etc. */
|
|
1142
|
-
|
|
1143
1051
|
this.fieldId = _constants_c8ecaa24_js__WEBPACK_IMPORTED_MODULE_4__["k"];
|
|
1144
1052
|
/** Used for the username label */
|
|
1145
|
-
|
|
1146
1053
|
this.label = _Translations_108d469f_js__WEBPACK_IMPORTED_MODULE_3__["T"].USERNAME_LABEL;
|
|
1147
1054
|
/** Used for the placeholder label */
|
|
1148
|
-
|
|
1149
1055
|
this.placeholder = _Translations_108d469f_js__WEBPACK_IMPORTED_MODULE_3__["T"].USERNAME_PLACEHOLDER;
|
|
1150
1056
|
/** The required flag in order to make an input required prior to submitting a form */
|
|
1151
|
-
|
|
1152
1057
|
this.required = false;
|
|
1153
1058
|
}
|
|
1154
|
-
|
|
1155
1059
|
AmplifyUsernameField.prototype.componentWillLoad = function () {
|
|
1156
1060
|
console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');
|
|
1157
1061
|
};
|
|
1158
|
-
|
|
1159
1062
|
AmplifyUsernameField.prototype.render = function () {
|
|
1160
1063
|
return Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("amplify-form-field", {
|
|
1161
1064
|
name: "username",
|
|
@@ -1170,12 +1073,10 @@ function () {
|
|
|
1170
1073
|
hint: this.hint
|
|
1171
1074
|
});
|
|
1172
1075
|
};
|
|
1173
|
-
|
|
1174
1076
|
return AmplifyUsernameField;
|
|
1175
1077
|
}();
|
|
1176
1078
|
|
|
1177
1079
|
|
|
1178
|
-
|
|
1179
1080
|
/***/ })
|
|
1180
1081
|
|
|
1181
1082
|
}]);
|