@solcre-org/core-ui 2.12.35 → 2.12.36

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.
@@ -6904,6 +6904,81 @@ const uruguayanDocumentValidator = (control) => {
6904
6904
  return validateUruguayanDocument(value) ? null : { invalidUruguayanDocument: true };
6905
6905
  };
6906
6906
 
6907
+ const toDate = (value) => {
6908
+ if (value === null || value === undefined) {
6909
+ return null;
6910
+ }
6911
+ if (value instanceof Date) {
6912
+ const cloned = new Date(value.getTime());
6913
+ return Number.isNaN(cloned.getTime()) ? null : cloned;
6914
+ }
6915
+ if (typeof value === 'number') {
6916
+ const dateFromNumber = new Date(value);
6917
+ return Number.isNaN(dateFromNumber.getTime()) ? null : dateFromNumber;
6918
+ }
6919
+ if (typeof value === 'string') {
6920
+ const dateFromString = new Date(value);
6921
+ return Number.isNaN(dateFromString.getTime()) ? null : dateFromString;
6922
+ }
6923
+ return null;
6924
+ };
6925
+ function calculateAge(birthDateInput, referenceInput = new Date()) {
6926
+ const birthDate = toDate(birthDateInput);
6927
+ const referenceDate = toDate(referenceInput);
6928
+ if (!birthDate || !referenceDate) {
6929
+ return Number.NaN;
6930
+ }
6931
+ let age = referenceDate.getFullYear() - birthDate.getFullYear();
6932
+ const hasNotHadBirthdayThisYear = referenceDate.getMonth() < birthDate.getMonth() ||
6933
+ (referenceDate.getMonth() === birthDate.getMonth() && referenceDate.getDate() < birthDate.getDate());
6934
+ if (hasNotHadBirthdayThisYear) {
6935
+ age -= 1;
6936
+ }
6937
+ return age;
6938
+ }
6939
+ function getLatestBirthDateForAge(age, referenceInput = new Date()) {
6940
+ const referenceDate = toDate(referenceInput);
6941
+ if (!referenceDate || !Number.isFinite(age)) {
6942
+ return null;
6943
+ }
6944
+ const latest = new Date(referenceDate.getTime());
6945
+ latest.setFullYear(latest.getFullYear() - Math.trunc(age));
6946
+ return latest;
6947
+ }
6948
+ function validateAge(birthDateInput, requiredAge, options = {}) {
6949
+ const comparison = options.comparison ?? 'min';
6950
+ const referenceDate = options.referenceDate ?? new Date();
6951
+ const age = calculateAge(birthDateInput, referenceDate);
6952
+ if (!Number.isFinite(age) || !Number.isFinite(requiredAge)) {
6953
+ return false;
6954
+ }
6955
+ switch (comparison) {
6956
+ case 'exact':
6957
+ return age === Math.trunc(requiredAge);
6958
+ case 'max':
6959
+ return age <= requiredAge;
6960
+ case 'min':
6961
+ default:
6962
+ return age >= requiredAge;
6963
+ }
6964
+ }
6965
+ const AgeValidationHelper = {
6966
+ calculateAge,
6967
+ validateAge,
6968
+ getLatestBirthDateForAge,
6969
+ };
6970
+ const ageValidator = (minimumAge) => {
6971
+ return (control) => {
6972
+ const value = control.value;
6973
+ if (!value) {
6974
+ return null;
6975
+ }
6976
+ return validateAge(value, minimumAge, { comparison: 'min' })
6977
+ ? null
6978
+ : { minimumAge: true };
6979
+ };
6980
+ };
6981
+
6907
6982
  class FileModel {
6908
6983
  id;
6909
6984
  filename;
@@ -13191,11 +13266,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
13191
13266
  // Este archivo es generado automáticamente por scripts/update-version.js
13192
13267
  // No edites manualmente este archivo
13193
13268
  const VERSION = {
13194
- full: '2.12.35',
13269
+ full: '2.12.36',
13195
13270
  major: 2,
13196
13271
  minor: 12,
13197
- patch: 35,
13198
- timestamp: '2025-09-17T11:24:57.851Z',
13272
+ patch: 36,
13273
+ timestamp: '2025-09-17T12:01:23.677Z',
13199
13274
  buildDate: '17/9/2025'
13200
13275
  };
13201
13276
 
@@ -16174,5 +16249,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
16174
16249
  * Generated bundle index. Do not edit.
16175
16250
  */
16176
16251
 
16177
- export { ActiveFiltersComponent, AlertComponent, AlertContainerComponent, AlertService, AlertType, ApiConfigurationProvider, BaseFieldComponent, ButtonContext, ButtonSize, ButtonType, CacheBustingInterceptor, CardComponent, CarouselComponent, ChatMessagePosition, ChatMessageType, CheckboxFieldComponent, ConfigurationModel, ConfirmationDialogComponent, ConfirmationDialogService, CoreHostDirective, CoreManualRefreshComponent, CoreUiHttpLoaderFactory, CoreUiTranslateLoader, CoreUiTranslateService, DataListComponent, DataListItemComponent, DateFieldComponent, DateUtility, DatetimeFieldComponent, DialogActions, DocumentAction, DocumentDisplayMode, DropdownComponent, DropdownDirection, DropdownService, DynamicFieldDirective, DynamicFieldsHelper, FieldErrorsComponent, FieldType, FileFieldComponent, FileModel, FilePreviewActionType, FileTemplateModel, FileTemplateType, FileType, FileTypeModel, FileUploadService, FilterModalComponent, FilterService, FilterType, GalleryAnimationType, GalleryLayoutType, GalleryModalComponent, GalleryModalGlobalService, GenericButtonComponent, GenericChatComponent, GenericChatService, GenericDocumentationComponent, GenericGalleryComponent, GenericModalComponent, GenericPaginationComponent, GenericRatingComponent, GenericSidebarComponent, GenericSkeletonComponent, GenericStepsComponent, GenericTableComponent, GenericTabsComponent, GenericTimelineComponent, GlobalApiConfigService, HeaderComponent, HeaderConfigurationService, HeaderElementType, HeaderService, HttpLoaderFactory, ImageModalComponent, ImageModalService, ImagePreviewComponent, LayoutAuth, LayoutBreakpoint, LayoutComponent, LayoutService, LayoutStateService, LayoutType, LoaderComponent, LoaderService, MainNavComponent, MainNavService, ManualRefreshService, ModalMode, ModelApiService, MultiEntryFieldComponent, MultiEntryOutputFormat, NumberFieldComponent, NumberFieldConfigType, NumberFieldType, NumberRange, PERMISSION_ACTIONS_PROVIDER, PERMISSION_PROVIDER, PERMISSION_RESOURCES_PROVIDER, PaginationService, PasswordFieldComponent, PermissionEnumsService, PermissionModel, PermissionService, PermissionWrapperService, PermissionsActions, PermissionsInterceptor, PermissionsResources, ProgressBarComponent, ProgressBarSize, RatingService, RatingSize, RatingType, ResetPasswordModel, RoleModel, SelectFieldComponent, ServerSelectFieldComponent, ServerSelectService, SidebarCustomModalComponent, SidebarCustomModalService, SidebarHeight, SidebarMobileModalService, SidebarMobileType, SidebarPosition, SidebarService, SidebarState, SidebarTemplateRegistryService, SidebarVisibility, SidebarWidth, SkeletonAnimation, SkeletonService, SkeletonSize, SkeletonType, SmartFieldComponent, SortDirection, SortMode, StepSize, StepStatus, StepType, StepsService, SwitchFieldComponent, TableAction, TableActionService, TableDataService, TableSortService, TextAreaFieldComponent, TextFieldComponent, TimeFieldComponent, TimeInterval, TimelineService, TimelineStatus, TimelineType, TranslationMergeService, UruguayanDocumentValidationHelper, UsersModel, VERSION, equalToValidator, generateRandomUruguayanDocument, getRandomCi, getUruguayanDocumentValidationDigit, getValidationDigit, isSameDate, provideCoreUiTranslateLoader, providePermissionActions, providePermissionEnums, providePermissionResources, providePermissionService, providePermissionServiceFactory, provideTranslateLoader, random, transform, transformUruguayanDocument, uruguayanDocumentValidator, validate, validateCi, validateUruguayanDocument, validationDigit };
16252
+ export { ActiveFiltersComponent, AgeValidationHelper, AlertComponent, AlertContainerComponent, AlertService, AlertType, ApiConfigurationProvider, BaseFieldComponent, ButtonContext, ButtonSize, ButtonType, CacheBustingInterceptor, CardComponent, CarouselComponent, ChatMessagePosition, ChatMessageType, CheckboxFieldComponent, ConfigurationModel, ConfirmationDialogComponent, ConfirmationDialogService, CoreHostDirective, CoreManualRefreshComponent, CoreUiHttpLoaderFactory, CoreUiTranslateLoader, CoreUiTranslateService, DataListComponent, DataListItemComponent, DateFieldComponent, DateUtility, DatetimeFieldComponent, DialogActions, DocumentAction, DocumentDisplayMode, DropdownComponent, DropdownDirection, DropdownService, DynamicFieldDirective, DynamicFieldsHelper, FieldErrorsComponent, FieldType, FileFieldComponent, FileModel, FilePreviewActionType, FileTemplateModel, FileTemplateType, FileType, FileTypeModel, FileUploadService, FilterModalComponent, FilterService, FilterType, GalleryAnimationType, GalleryLayoutType, GalleryModalComponent, GalleryModalGlobalService, GenericButtonComponent, GenericChatComponent, GenericChatService, GenericDocumentationComponent, GenericGalleryComponent, GenericModalComponent, GenericPaginationComponent, GenericRatingComponent, GenericSidebarComponent, GenericSkeletonComponent, GenericStepsComponent, GenericTableComponent, GenericTabsComponent, GenericTimelineComponent, GlobalApiConfigService, HeaderComponent, HeaderConfigurationService, HeaderElementType, HeaderService, HttpLoaderFactory, ImageModalComponent, ImageModalService, ImagePreviewComponent, LayoutAuth, LayoutBreakpoint, LayoutComponent, LayoutService, LayoutStateService, LayoutType, LoaderComponent, LoaderService, MainNavComponent, MainNavService, ManualRefreshService, ModalMode, ModelApiService, MultiEntryFieldComponent, MultiEntryOutputFormat, NumberFieldComponent, NumberFieldConfigType, NumberFieldType, NumberRange, PERMISSION_ACTIONS_PROVIDER, PERMISSION_PROVIDER, PERMISSION_RESOURCES_PROVIDER, PaginationService, PasswordFieldComponent, PermissionEnumsService, PermissionModel, PermissionService, PermissionWrapperService, PermissionsActions, PermissionsInterceptor, PermissionsResources, ProgressBarComponent, ProgressBarSize, RatingService, RatingSize, RatingType, ResetPasswordModel, RoleModel, SelectFieldComponent, ServerSelectFieldComponent, ServerSelectService, SidebarCustomModalComponent, SidebarCustomModalService, SidebarHeight, SidebarMobileModalService, SidebarMobileType, SidebarPosition, SidebarService, SidebarState, SidebarTemplateRegistryService, SidebarVisibility, SidebarWidth, SkeletonAnimation, SkeletonService, SkeletonSize, SkeletonType, SmartFieldComponent, SortDirection, SortMode, StepSize, StepStatus, StepType, StepsService, SwitchFieldComponent, TableAction, TableActionService, TableDataService, TableSortService, TextAreaFieldComponent, TextFieldComponent, TimeFieldComponent, TimeInterval, TimelineService, TimelineStatus, TimelineType, TranslationMergeService, UruguayanDocumentValidationHelper, UsersModel, VERSION, ageValidator, calculateAge, equalToValidator, generateRandomUruguayanDocument, getLatestBirthDateForAge, getRandomCi, getUruguayanDocumentValidationDigit, getValidationDigit, isSameDate, provideCoreUiTranslateLoader, providePermissionActions, providePermissionEnums, providePermissionResources, providePermissionService, providePermissionServiceFactory, provideTranslateLoader, random, transform, transformUruguayanDocument, uruguayanDocumentValidator, validate, validateAge, validateCi, validateUruguayanDocument, validationDigit };
16178
16253
  //# sourceMappingURL=solcre-org-core-ui.mjs.map