@abp/ng.theme.shared 5.3.0 → 5.3.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.
- package/esm2020/extensions/lib/components/extensible-form/extensible-form-prop.component.mjs +3 -3
- package/esm2020/extensions/lib/components/extensible-table/extensible-table.component.mjs +3 -3
- package/esm2020/extensions/lib/components/grid-actions/grid-actions.component.mjs +3 -3
- package/esm2020/extensions/lib/components/page-toolbar/page-toolbar.component.mjs +3 -3
- package/esm2020/lib/constants/validation.mjs +7 -3
- package/esm2020/lib/models/index.mjs +2 -1
- package/esm2020/lib/models/validation.mjs +2 -0
- package/esm2020/lib/utils/validation-utils.mjs +32 -3
- package/fesm2015/abp-ng.theme.shared-extensions.mjs +8 -8
- package/fesm2015/abp-ng.theme.shared-extensions.mjs.map +1 -1
- package/fesm2015/abp-ng.theme.shared.mjs +38 -5
- package/fesm2015/abp-ng.theme.shared.mjs.map +1 -1
- package/fesm2020/abp-ng.theme.shared-extensions.mjs +8 -8
- package/fesm2020/abp-ng.theme.shared-extensions.mjs.map +1 -1
- package/fesm2020/abp-ng.theme.shared.mjs +38 -5
- package/fesm2020/abp-ng.theme.shared.mjs.map +1 -1
- package/lib/constants/validation.d.ts +4 -0
- package/lib/models/index.d.ts +1 -0
- package/lib/models/validation.d.ts +1 -0
- package/lib/utils/validation-utils.d.ts +2 -0
- package/package.json +2 -2
|
@@ -15,7 +15,7 @@ import { NgbInputDatepickerConfig, NgbTypeaheadConfig, NgbDateParserFormatter, N
|
|
|
15
15
|
import * as i1$2 from '@swimlane/ngx-datatable';
|
|
16
16
|
import { ColumnMode, NgxDatatableModule } from '@swimlane/ngx-datatable';
|
|
17
17
|
import { HttpErrorResponse } from '@angular/common/http';
|
|
18
|
-
import { NgxValidateCoreModule, VALIDATION_BLUEPRINTS, VALIDATION_MAP_ERRORS_FN, defaultMapErrorsFn, VALIDATION_VALIDATE_ON_SUBMIT,
|
|
18
|
+
import { NgxValidateCoreModule, VALIDATION_BLUEPRINTS, VALIDATION_MAP_ERRORS_FN, defaultMapErrorsFn, VALIDATION_VALIDATE_ON_SUBMIT, normalizeDiacritics } from '@ngx-validate/core';
|
|
19
19
|
import { Validators } from '@angular/forms';
|
|
20
20
|
|
|
21
21
|
const bounceIn = animation([
|
|
@@ -940,15 +940,19 @@ const DEFAULT_VALIDATION_BLUEPRINTS = {
|
|
|
940
940
|
creditCard: 'AbpValidation::ThisFieldIsNotAValidCreditCardNumber.',
|
|
941
941
|
email: 'AbpValidation::ThisFieldIsNotAValidEmailAddress.',
|
|
942
942
|
invalid: 'AbpValidation::ThisFieldIsNotValid.',
|
|
943
|
-
max: 'AbpValidation::
|
|
943
|
+
max: 'AbpValidation::ThisFieldMustBeLessOrEqual{0}[{{ max }}]',
|
|
944
944
|
maxlength: 'AbpValidation::ThisFieldMustBeAStringOrArrayTypeWithAMaximumLengthOf{0}[{{ requiredLength }}]',
|
|
945
|
-
min: 'AbpValidation::
|
|
945
|
+
min: 'AbpValidation::ThisFieldMustBeGreaterThanOrEqual{0}[{{ min }}]',
|
|
946
946
|
minlength: 'AbpValidation::ThisFieldMustBeAStringOrArrayTypeWithAMinimumLengthOf{0}[{{ requiredLength }}]',
|
|
947
947
|
ngbDate: 'AbpValidation::ThisFieldIsNotValid.',
|
|
948
948
|
passwordMismatch: 'AbpIdentity::Volo.Abp.Identity:PasswordConfirmationFailed',
|
|
949
949
|
range: 'AbpValidation::ThisFieldMustBeBetween{0}And{1}[{{ min }},{{ max }}]',
|
|
950
950
|
required: 'AbpValidation::ThisFieldIsRequired.',
|
|
951
951
|
url: 'AbpValidation::ThisFieldIsNotAValidFullyQualifiedHttpHttpsOrFtpUrl',
|
|
952
|
+
passwordRequiresLower: 'AbpIdentity::Volo.Abp.Identity:PasswordRequiresLower',
|
|
953
|
+
passwordRequiresUpper: 'AbpIdentity::Volo.Abp.Identity:PasswordRequiresUpper',
|
|
954
|
+
passwordRequiresDigit: 'AbpIdentity::Volo.Abp.Identity:PasswordRequiresDigit',
|
|
955
|
+
passwordRequiresNonAlphanumeric: 'AbpIdentity::Volo.Abp.Identity:PasswordRequiresNonAlphanumeric',
|
|
952
956
|
};
|
|
953
957
|
|
|
954
958
|
class EllipsisDirective {
|
|
@@ -2213,7 +2217,8 @@ function getPasswordValidators(injector) {
|
|
|
2213
2217
|
if (Number.isInteger(+getRule('RequiredLength'))) {
|
|
2214
2218
|
requiredLength = +getRule('RequiredLength');
|
|
2215
2219
|
}
|
|
2216
|
-
|
|
2220
|
+
const passwordValidators = passwordRulesArr.map(rule => validatePassword(rule));
|
|
2221
|
+
return [...passwordValidators, minLength(requiredLength), maxLength(128)];
|
|
2217
2222
|
}
|
|
2218
2223
|
function getRuleFn(injector) {
|
|
2219
2224
|
const configState = injector.get(ConfigStateService);
|
|
@@ -2221,6 +2226,34 @@ function getRuleFn(injector) {
|
|
|
2221
2226
|
const passwordRules = configState.getSettings('Identity.Password');
|
|
2222
2227
|
return (passwordRules[`Abp.Identity.Password.${key}`] || '').toLowerCase();
|
|
2223
2228
|
};
|
|
2229
|
+
}
|
|
2230
|
+
const errorMessageMap = {
|
|
2231
|
+
small: 'passwordRequiresLower',
|
|
2232
|
+
capital: 'passwordRequiresUpper',
|
|
2233
|
+
number: 'passwordRequiresDigit',
|
|
2234
|
+
special: 'passwordRequiresNonAlphanumeric',
|
|
2235
|
+
};
|
|
2236
|
+
function validatePassword(shouldContain) {
|
|
2237
|
+
return (control) => {
|
|
2238
|
+
if (!control.value)
|
|
2239
|
+
return null;
|
|
2240
|
+
const value = normalizeDiacritics(control.value);
|
|
2241
|
+
const regexMap = {
|
|
2242
|
+
small: /.*[a-z].*/,
|
|
2243
|
+
capital: /.*[A-Z].*/,
|
|
2244
|
+
number: /.*[0-9].*/,
|
|
2245
|
+
special: /.*[^0-9a-zA-Z].*/,
|
|
2246
|
+
};
|
|
2247
|
+
const regex = regexMap[shouldContain];
|
|
2248
|
+
const isValid = regex.test(value);
|
|
2249
|
+
if (isValid) {
|
|
2250
|
+
return null;
|
|
2251
|
+
}
|
|
2252
|
+
const error = errorMessageMap[shouldContain];
|
|
2253
|
+
return {
|
|
2254
|
+
[error]: true,
|
|
2255
|
+
};
|
|
2256
|
+
};
|
|
2224
2257
|
}
|
|
2225
2258
|
|
|
2226
2259
|
/*
|
|
@@ -2231,5 +2264,5 @@ function getRuleFn(injector) {
|
|
|
2231
2264
|
* Generated bundle index. Do not edit.
|
|
2232
2265
|
*/
|
|
2233
2266
|
|
|
2234
|
-
export { BaseThemeSharedModule, BreadcrumbComponent, BreadcrumbItemsComponent, ButtonComponent, Confirmation, ConfirmationComponent, ConfirmationService, DEFAULT_ERROR_LOCALIZATIONS, DEFAULT_ERROR_MESSAGES, DEFAULT_VALIDATION_BLUEPRINTS, DateParserFormatter, DocumentDirHandlerService, EllipsisDirective, EllipsisModule, ErrorHandler, HTTP_ERROR_CONFIG, HTTP_ERROR_HANDLER, HttpErrorWrapperComponent, LoaderBarComponent, LoadingComponent, LoadingDirective, ModalCloseDirective, ModalComponent, ModalRefService, NGX_DATATABLE_MESSAGES, NG_BOOTSTRAP_CONFIG_PROVIDERS, NavItem, NavItemsService, NgxDatatableDefaultDirective, NgxDatatableListDirective, PageAlertService, SUPPRESS_UNSAVED_CHANGES_WARNING, THEME_SHARED_APPEND_CONTENT, THEME_SHARED_ROUTE_PROVIDERS, ThemeSharedModule, ToastComponent, ToastContainerComponent, ToasterService, UserMenu, UserMenuService, bounceIn, collapse, collapseLinearWithMargin, collapseWithMargin, collapseX, collapseY, collapseYWithMargin, configureNgBootstrap, configureRoutes, defaultNgxDatatableMessages, dialogAnimation, expandX, expandY, expandYWithMargin, fadeAnimation, fadeIn, fadeInDown, fadeInLeft, fadeInRight, fadeInUp, fadeOut, fadeOutDown, fadeOutLeft, fadeOutRight, fadeOutUp, getPasswordValidators, httpErrorConfigFactory, slideFromBottom, toastInOut };
|
|
2267
|
+
export { BaseThemeSharedModule, BreadcrumbComponent, BreadcrumbItemsComponent, ButtonComponent, Confirmation, ConfirmationComponent, ConfirmationService, DEFAULT_ERROR_LOCALIZATIONS, DEFAULT_ERROR_MESSAGES, DEFAULT_VALIDATION_BLUEPRINTS, DateParserFormatter, DocumentDirHandlerService, EllipsisDirective, EllipsisModule, ErrorHandler, HTTP_ERROR_CONFIG, HTTP_ERROR_HANDLER, HttpErrorWrapperComponent, LoaderBarComponent, LoadingComponent, LoadingDirective, ModalCloseDirective, ModalComponent, ModalRefService, NGX_DATATABLE_MESSAGES, NG_BOOTSTRAP_CONFIG_PROVIDERS, NavItem, NavItemsService, NgxDatatableDefaultDirective, NgxDatatableListDirective, PageAlertService, SUPPRESS_UNSAVED_CHANGES_WARNING, THEME_SHARED_APPEND_CONTENT, THEME_SHARED_ROUTE_PROVIDERS, ThemeSharedModule, ToastComponent, ToastContainerComponent, ToasterService, UserMenu, UserMenuService, bounceIn, collapse, collapseLinearWithMargin, collapseWithMargin, collapseX, collapseY, collapseYWithMargin, configureNgBootstrap, configureRoutes, defaultNgxDatatableMessages, dialogAnimation, expandX, expandY, expandYWithMargin, fadeAnimation, fadeIn, fadeInDown, fadeInLeft, fadeInRight, fadeInUp, fadeOut, fadeOutDown, fadeOutLeft, fadeOutRight, fadeOutUp, getPasswordValidators, httpErrorConfigFactory, slideFromBottom, toastInOut, validatePassword };
|
|
2235
2268
|
//# sourceMappingURL=abp-ng.theme.shared.mjs.map
|