@abp/ng.theme.shared 5.3.0-rc.2 → 5.3.1
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/abstract-actions/abstract-actions.component.mjs +1 -1
- 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 +8 -15
- package/esm2020/extensions/lib/models/toolbar-actions.mjs +4 -1
- package/esm2020/extensions/lib/pipes/create-injector.pipe.mjs +36 -0
- package/esm2020/extensions/lib/ui-extensions.module.mjs +8 -3
- package/esm2020/extensions/public-api.mjs +2 -1
- package/esm2020/lib/constants/validation.mjs +5 -1
- 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/extensions/lib/components/abstract-actions/abstract-actions.component.d.ts +1 -3
- package/extensions/lib/components/page-toolbar/page-toolbar.component.d.ts +9 -4
- package/extensions/lib/models/toolbar-actions.d.ts +13 -4
- package/extensions/lib/pipes/create-injector.pipe.d.ts +8 -0
- package/extensions/lib/ui-extensions.module.d.ts +6 -5
- package/extensions/public-api.d.ts +1 -0
- package/fesm2015/abp-ng.theme.shared-extensions.mjs +54 -22
- package/fesm2015/abp-ng.theme.shared-extensions.mjs.map +1 -1
- package/fesm2015/abp-ng.theme.shared.mjs +36 -3
- package/fesm2015/abp-ng.theme.shared.mjs.map +1 -1
- package/fesm2020/abp-ng.theme.shared-extensions.mjs +54 -22
- package/fesm2020/abp-ng.theme.shared-extensions.mjs.map +1 -1
- package/fesm2020/abp-ng.theme.shared.mjs +36 -3
- 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 +3 -3
|
@@ -14,7 +14,7 @@ import { NgbInputDatepickerConfig, NgbTypeaheadConfig, NgbDateParserFormatter, N
|
|
|
14
14
|
import * as i1$2 from '@swimlane/ngx-datatable';
|
|
15
15
|
import { ColumnMode, NgxDatatableModule } from '@swimlane/ngx-datatable';
|
|
16
16
|
import { HttpErrorResponse } from '@angular/common/http';
|
|
17
|
-
import { NgxValidateCoreModule, VALIDATION_BLUEPRINTS, VALIDATION_MAP_ERRORS_FN, defaultMapErrorsFn, VALIDATION_VALIDATE_ON_SUBMIT,
|
|
17
|
+
import { NgxValidateCoreModule, VALIDATION_BLUEPRINTS, VALIDATION_MAP_ERRORS_FN, defaultMapErrorsFn, VALIDATION_VALIDATE_ON_SUBMIT, normalizeDiacritics } from '@ngx-validate/core';
|
|
18
18
|
import { Validators } from '@angular/forms';
|
|
19
19
|
|
|
20
20
|
const bounceIn = animation([
|
|
@@ -942,6 +942,10 @@ const DEFAULT_VALIDATION_BLUEPRINTS = {
|
|
|
942
942
|
range: 'AbpValidation::ThisFieldMustBeBetween{0}And{1}[{{ min }},{{ max }}]',
|
|
943
943
|
required: 'AbpValidation::ThisFieldIsRequired.',
|
|
944
944
|
url: 'AbpValidation::ThisFieldIsNotAValidFullyQualifiedHttpHttpsOrFtpUrl',
|
|
945
|
+
passwordRequiresLower: 'AbpIdentity::Volo.Abp.Identity:PasswordRequiresLower',
|
|
946
|
+
passwordRequiresUpper: 'AbpIdentity::Volo.Abp.Identity:PasswordRequiresUpper',
|
|
947
|
+
passwordRequiresDigit: 'AbpIdentity::Volo.Abp.Identity:PasswordRequiresDigit',
|
|
948
|
+
passwordRequiresNonAlphanumeric: 'AbpIdentity::Volo.Abp.Identity:PasswordRequiresNonAlphanumeric',
|
|
945
949
|
};
|
|
946
950
|
|
|
947
951
|
class EllipsisDirective {
|
|
@@ -2204,7 +2208,8 @@ function getPasswordValidators(injector) {
|
|
|
2204
2208
|
if (Number.isInteger(+getRule('RequiredLength'))) {
|
|
2205
2209
|
requiredLength = +getRule('RequiredLength');
|
|
2206
2210
|
}
|
|
2207
|
-
|
|
2211
|
+
const passwordValidators = passwordRulesArr.map(rule => validatePassword(rule));
|
|
2212
|
+
return [...passwordValidators, minLength(requiredLength), maxLength(128)];
|
|
2208
2213
|
}
|
|
2209
2214
|
function getRuleFn(injector) {
|
|
2210
2215
|
const configState = injector.get(ConfigStateService);
|
|
@@ -2212,6 +2217,34 @@ function getRuleFn(injector) {
|
|
|
2212
2217
|
const passwordRules = configState.getSettings('Identity.Password');
|
|
2213
2218
|
return (passwordRules[`Abp.Identity.Password.${key}`] || '').toLowerCase();
|
|
2214
2219
|
};
|
|
2220
|
+
}
|
|
2221
|
+
const errorMessageMap = {
|
|
2222
|
+
small: 'passwordRequiresLower',
|
|
2223
|
+
capital: 'passwordRequiresUpper',
|
|
2224
|
+
number: 'passwordRequiresDigit',
|
|
2225
|
+
special: 'passwordRequiresNonAlphanumeric',
|
|
2226
|
+
};
|
|
2227
|
+
function validatePassword(shouldContain) {
|
|
2228
|
+
return (control) => {
|
|
2229
|
+
if (!control.value)
|
|
2230
|
+
return null;
|
|
2231
|
+
const value = normalizeDiacritics(control.value);
|
|
2232
|
+
const regexMap = {
|
|
2233
|
+
small: /.*[a-z].*/,
|
|
2234
|
+
capital: /.*[A-Z].*/,
|
|
2235
|
+
number: /.*[0-9].*/,
|
|
2236
|
+
special: /.*[^0-9a-zA-Z].*/,
|
|
2237
|
+
};
|
|
2238
|
+
const regex = regexMap[shouldContain];
|
|
2239
|
+
const isValid = regex.test(value);
|
|
2240
|
+
if (isValid) {
|
|
2241
|
+
return null;
|
|
2242
|
+
}
|
|
2243
|
+
const error = errorMessageMap[shouldContain];
|
|
2244
|
+
return {
|
|
2245
|
+
[error]: true,
|
|
2246
|
+
};
|
|
2247
|
+
};
|
|
2215
2248
|
}
|
|
2216
2249
|
|
|
2217
2250
|
/*
|
|
@@ -2222,5 +2255,5 @@ function getRuleFn(injector) {
|
|
|
2222
2255
|
* Generated bundle index. Do not edit.
|
|
2223
2256
|
*/
|
|
2224
2257
|
|
|
2225
|
-
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 };
|
|
2258
|
+
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 };
|
|
2226
2259
|
//# sourceMappingURL=abp-ng.theme.shared.mjs.map
|