@solcre-org/core-ui 2.12.45 → 2.12.47

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.
@@ -31,14 +31,21 @@ label.c-entry-item{
31
31
  margin-top: calc( var(--_entry-group-gap) * 0.5);
32
32
  }
33
33
 
34
- .c-entry-group--cols{
35
- grid-template-columns: repeat(var(--cols, 2), 1fr);
36
- column-gap: min( var(--space-x), var(--_entry-group-gap));
37
- }
38
-
39
34
  .c-entry-title{
40
35
  color: var(--_entry-title-color);
41
36
  font-size: calc((var(--_entry-title-fz) * var(--_size-factor, 1)));
42
37
  font-weight: var(--_entry-title-fw);
43
38
  margin-top: .5em;
39
+ }
40
+
41
+
42
+ /* ********************** desde TABLET ********************** */
43
+
44
+ @media (min-width: 48rem) /* 768px */ {
45
+
46
+ .c-entry-group--cols{
47
+ grid-template-columns: repeat(var(--cols, 2), 1fr);
48
+ column-gap: min( var(--space-x), var(--_entry-group-gap));
49
+ }
50
+
44
51
  }
@@ -87,6 +87,7 @@
87
87
  .c-main-nav{
88
88
  opacity: 0;
89
89
  transform: translate3d(-5rem,0,0);
90
+ border-radius: 0 var(--_br) var(--_br) 0;
90
91
  }
91
92
 
92
93
  .c-main-nav__close {
@@ -262,7 +262,6 @@ body:has(.c-modal.is-visible) {
262
262
  --_holder-px: calc(var(--wrapper-x)*1.2);
263
263
  --_holder-w: calc(100% - var(--_ouside-padding)*2);
264
264
  --_header-py: 1.8rem;
265
-
266
265
  }
267
266
 
268
267
  .c-modal.is-visible .c-modal__holder {
@@ -273,6 +272,10 @@ body:has(.c-modal.is-visible) {
273
272
  animation: hidemodalMobile var(--_modal-animation-out) ease-out forwards;
274
273
  }
275
274
 
275
+ .c-modal__close {
276
+ color: var(--app-main-header-mobile-text, inherit);
277
+ }
278
+
276
279
  .c-modal__holder {
277
280
  height: auto;
278
281
  top: auto;
@@ -291,9 +294,10 @@ body:has(.c-modal.is-visible) {
291
294
  border: none;
292
295
  }
293
296
 
294
- .c-modal__body{
295
- padding-top: 0;
297
+ .c-modal__header{
298
+ box-shadow: 0 0 0.8rem 0rem hsl(var(--color-neutral-800-hsl) / 8%);
296
299
  }
300
+
297
301
 
298
302
  }
299
303
 
@@ -81,7 +81,30 @@ app-generic-pagination{
81
81
  pointer-events: none;
82
82
  }
83
83
 
84
+ /* ********************** MOBILE & TABLET ********************** */
84
85
 
86
+ @media (max-width: 61.1875rem) /* up to 979px */ {
87
+
88
+ .c-pagination{
89
+ flex-wrap: wrap;
90
+ gap: 2rem 1rem;
91
+ }
92
+
93
+ .c-pagination .c-pager{
94
+ order: 1;
95
+ width: 100%;
96
+ text-align: center;
97
+ }
98
+
99
+ .c-pagination__summary{
100
+ order: 2;
101
+ }
102
+
103
+ .c-pagination__select{
104
+ order: 3;
105
+ }
106
+
107
+ }
85
108
 
86
109
  /* ********************** MEDIA HOVER ********************** */
87
110
 
@@ -404,6 +404,12 @@
404
404
  display: block;
405
405
  }
406
406
 
407
+ .c-table__inline-edit{
408
+ display: flex;
409
+ flex-direction: column;
410
+ gap: 0.6rem;
411
+ }
412
+
407
413
  .c-table thead {
408
414
  display: none;
409
415
  }
@@ -415,15 +421,27 @@
415
421
  }
416
422
 
417
423
  .c-table tr {
424
+ position: relative;
418
425
  border-radius: var(--app-br);
419
426
  padding: var(--_card-padding-y) var(--_card-padding-x);
420
427
  border: 1px solid hsl(var(--_bc));
428
+ overflow: hidden;
421
429
  }
422
430
 
423
431
  .c-table td {
424
432
  border: none;
425
433
  }
426
434
 
435
+ .c-table tbody tr.is-new td:first-child,
436
+ .c-table tbody tr.is-editable td:first-child{
437
+ position: initial !important;
438
+ }
439
+
440
+ .c-table tbody tr.is-new td:first-child::before,
441
+ .c-table tbody tr.is-editable td:first-child::before{
442
+ border-radius: 0;
443
+ }
444
+
427
445
  .c-table td:first-child {
428
446
  font-weight: 600;
429
447
  }
@@ -972,6 +972,167 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
972
972
  args: [{ selector: 'core-datetime-field', standalone: true, imports: [CommonModule, FormsModule, TranslateModule, ReactiveFormsModule, NgSelectModule, FieldErrorsComponent], hostDirectives: [CoreHostDirective], template: "<div class=\"c-entry-item\" [class.c-entry-item--inline]=\"field().inline\">\n <label class=\"c-entry-text\" *ngIf=\"field().label\" [for]=\"field().key.toString()\">\n {{ field().label | translate }}\n @if (hasRequiredValidators()) {\n <span class=\"c-required\">*</span>\n }\n </label>\n <div class=\"c-entry-datetime\">\n <span class=\"c-entry-input\" [class.is-invalid]=\"hasError()\">\n <input\n type=\"date\"\n [id]=\"field().key.toString()\"\n [name]=\"field().key.toString()\"\n [value]=\"formattedDate()\"\n [disabled]=\"isDisabled()\"\n (input)=\"onDateChange($event)\"\n (blur)=\"onBlur()\"\n (keydown.enter)=\"onEnter($any($event))\"\n />\n <button class=\"c-entry-input__addon icon-calendar-thin\" \n tabindex=\"-1\"\n type=\"button\"\n (click)=\"onCalendarClick($event)\"></button>\n </span>\n <span class=\"c-entry-input c-entry-input--ng-select\" [class.is-invalid]=\"hasError()\">\n <ng-select\n [items]=\"hoursOptions()\"\n bindValue=\"value\"\n bindLabel=\"label\"\n [ngModel]=\"selectedHour()\"\n (ngModelChange)=\"onHourChange($event)\"\n [disabled]=\"isDisabled()\"\n [clearable]=\"false\"\n [searchable]=\"false\"\n (blur)=\"onBlur()\"\n [placeholder]=\"isHourPlaceholderVisible() ? 'HH' : ''\"\n >\n <ng-template ng-option-tmp let-item=\"item\">\n {{ item.label }}\n </ng-template>\n <ng-template ng-label-tmp let-item=\"item\">\n {{ item.label }}\n </ng-template>\n </ng-select>\n <span class=\"c-entry-input__addon icon-select-arrow\"></span>\n </span>\n <span class=\"c-entry-datetime__separator\">:</span>\n <span class=\"c-entry-input c-entry-input--ng-select\" [class.is-invalid]=\"hasError()\">\n <ng-select\n [items]=\"minutesOptions()\"\n bindValue=\"value\"\n bindLabel=\"label\"\n [ngModel]=\"selectedMinute()\"\n (ngModelChange)=\"onMinuteChange($event)\"\n [disabled]=\"isDisabled()\"\n [clearable]=\"false\"\n [searchable]=\"false\"\n (blur)=\"onBlur()\"\n [placeholder]=\"isMinutePlaceholderVisible() ? 'MM' : ''\"\n >\n <ng-template ng-option-tmp let-item=\"item\">\n {{ item.label }}\n </ng-template>\n <ng-template ng-label-tmp let-item=\"item\">\n {{ item.label }}\n </ng-template>\n </ng-select>\n <span class=\"c-entry-input__addon icon-select-arrow\"></span>\n </span>\n </div>\n <core-field-errors [errors]=\"errors()\" />\n</div>\n\n\n", styles: [".ng-select .ng-select-container .ng-value-container{flex-wrap:wrap}.c-entry-input--ng-select.is-placeholder ::ng-deep .ng-select .ng-select-container .ng-value-container .ng-input input::placeholder{color:var(--_entry-input-placeholder-color);opacity:1}.c-entry-input--ng-select.is-placeholder ::ng-deep .ng-select .ng-select-container .ng-value-container .ng-input input{color:var(--_entry-input-placeholder-color)}.c-entry-input--ng-select:not(.is-placeholder) ::ng-deep .ng-select .ng-select-container .ng-value-container .ng-input input::placeholder{opacity:0}::ng-deep .ng-select{width:100%!important;display:contents}.c-entry-input--ng-select{position:relative}::ng-deep .ng-dropdown-panel{top:0;right:0}::ng-deep .ng-select .ng-select-container .ng-value-container .ng-value{background-color:var(--form-highlighted-color, var(--color-neutral-300));color:#3f4e6a;border-radius:var(--_entry-input-br);padding:.2em .8em;margin:.2em;border:none;border-radius:4px}::ng-deep .ng-select .ng-select-container .ng-value-container .ng-value .ng-value-icon{border:none;padding-right:.4em;color:#3f4e6a}::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items{border:none;min-height:auto;padding:0;position:relative;right:0;margin-top:3em;box-shadow:1em 2.4em 3.4em -2em hsl(var(--color-neutral-900-hsl)/25%);background-color:var(--color-neutral-100)}::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{padding:.6em .8em;color:#6a788c;cursor:pointer;transition:background-color .1s ease-out}::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-marked{color:var(--color-primary-400)}::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected{color:var(--color-primary-400);font-weight:500}::ng-deep .ng-dropdown-panel .scrollable-content{background:#f2f5fa}::ng-deep .ng-dropdown-panel-items.scroll-host{background:#f2f5fa;padding:1em;border-radius:var(--_entry-input-br)}::ng-deep app-server-select-field .ng-select:not(.ng-select-filtered):not(.ng-select-opened) .ng-dropdown-panel{opacity:0!important}::ng-deep .c-entry-input--ng-select{--_entry-input-padd-y: .76em}::ng-deep .c-entry-input--ng-select:has(.ng-value-container .ng-value){--_entry-input-padd-y: .35em}::ng-deep .c-entry-input--ng-select:has(.ng-value-container .ng-value) .ng-select .ng-select-container .ng-value-container .ng-input{margin-left:8px}::ng-deep .c-entry-input--ng-select:has(.ng-value-container .ng-value) .ng-select .ng-select-container .ng-value-container .ng-input>input{height:100%}::ng-deep .ng-dropdown-panel-items.scroll-host:has(.ng-select-notfound){background-color:hsl(from hsl(var(--color-context-error-hsl)) h s 94%);color:hsl(from hsl(var(--color-context-error-hsl)) h s 60%)}::ng-deep .ng-dropdown-panel-items.scroll-host:has(.ng-select-loading){background-color:hsl(from hsl(var(--color-alternative-800-hsl)) h s 96%);color:hsl(from hsl(var(--color-alternative-800-hsl)) h 90% 70%)}::ng-deep .ng-select.ng-select-single .ng-select-container .ng-value-container,.ng-select.ng-select-single .ng-select-container .ng-value-container{display:grid;justify-content:start}::ng-deep .ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input{height:-webkit-fill-available}::ng-deep .ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input>input{height:98%}::ng-deep .ng-select.ng-select-single .ng-select-container{overflow:visible;position:relative;cursor:pointer}::ng-deep .ng-select.ng-select-single .ng-select-container:before{content:\"\";position:absolute;left:calc(var(--_entry-input-padd-x) * -1);right:calc(var(--_entry-input-padd-x) * -1 - var(--_entry-input-addon-gap) - var(--_entry-input-addon-icon-fz));top:calc(max(var(--_entry-input-padd-y) * var(--_size-factor, 1),2px)*-1);bottom:calc(max(var(--_entry-input-padd-y) * var(--_size-factor, 1),2px)*-1)}::ng-deep .ng-select .ng-clear-wrapper .ng-clear{position:absolute;top:50%;transform:translateY(-50%)}@media (hover: hover){::ng-deep .ng-select .ng-clear-wrapper:is(:hover,:focus-visible){color:var(--color-hover)}}\n"] }]
973
973
  }], ctorParameters: () => [] });
974
974
 
975
+ var DocumentPayloadMode;
976
+ (function (DocumentPayloadMode) {
977
+ DocumentPayloadMode["OBJECT"] = "object";
978
+ DocumentPayloadMode["SEPARATE_KEYS"] = "separateKeys";
979
+ })(DocumentPayloadMode || (DocumentPayloadMode = {}));
980
+
981
+ class DocumentFieldComponent extends BaseFieldComponent {
982
+ documentTypeControl = new FormControl('');
983
+ documentNumberControl = new FormControl('');
984
+ isUserEditing = false;
985
+ defaultDocumentOptions = [
986
+ { value: 'CI', label: 'CI' },
987
+ { value: 'DNI', label: 'DNI' },
988
+ { value: 'PASSPORT', label: 'Pasaporte' },
989
+ { value: 'OTHER', label: 'Otro' }
990
+ ];
991
+ fieldConfig = computed(() => this.field());
992
+ documentTypeOptions = computed(() => {
993
+ return this.fieldConfig().documentTypeOptions || this.defaultDocumentOptions;
994
+ });
995
+ isDisabled = computed(() => {
996
+ return this.mode() === ModalMode.VIEW || this.evaluateReadonly() || this.evaluateDisabled();
997
+ });
998
+ documentTypeChars = computed(() => {
999
+ const chars = this.fieldConfig().documentTypeChars;
1000
+ return chars ? chars.toString() : '5';
1001
+ });
1002
+ documentNumberChars = computed(() => {
1003
+ const chars = this.fieldConfig().documentNumberChars;
1004
+ return chars ? chars.toString() : null;
1005
+ });
1006
+ constructor() {
1007
+ super();
1008
+ effect(() => {
1009
+ if (this.isUserEditing) {
1010
+ return;
1011
+ }
1012
+ const currentValue = this.value();
1013
+ const config = this.fieldConfig();
1014
+ const payloadMode = config.payloadMode || DocumentPayloadMode.OBJECT;
1015
+ if (currentValue) {
1016
+ let documentType = '';
1017
+ let documentNumber = '';
1018
+ if (payloadMode === DocumentPayloadMode.SEPARATE_KEYS) {
1019
+ const documentTypeKey = config.documentTypeKey || 'document_type';
1020
+ const documentNumberKey = config.documentNumberKey || 'document';
1021
+ if (currentValue._isSeparatedDocumentField) {
1022
+ documentType = currentValue[documentTypeKey] || '';
1023
+ documentNumber = currentValue[documentNumberKey] || '';
1024
+ }
1025
+ else {
1026
+ const formValue = this.formValue();
1027
+ if (formValue) {
1028
+ documentType = formValue[documentTypeKey] || '';
1029
+ documentNumber = formValue[documentNumberKey] || '';
1030
+ }
1031
+ }
1032
+ }
1033
+ else {
1034
+ const docValue = currentValue;
1035
+ documentType = docValue.documentType || '';
1036
+ documentNumber = docValue.documentNumber || '';
1037
+ }
1038
+ if (documentType !== this.documentTypeControl.value) {
1039
+ this.documentTypeControl.setValue(documentType, { emitEvent: false });
1040
+ }
1041
+ if (documentNumber !== this.documentNumberControl.value) {
1042
+ this.documentNumberControl.setValue(documentNumber, { emitEvent: false });
1043
+ }
1044
+ }
1045
+ else if (!this.documentTypeControl.value && !this.documentNumberControl.value) {
1046
+ this.documentTypeControl.setValue('', { emitEvent: false });
1047
+ this.documentNumberControl.setValue('', { emitEvent: false });
1048
+ }
1049
+ });
1050
+ this.documentTypeControl.valueChanges.subscribe(() => {
1051
+ this.emitValue();
1052
+ });
1053
+ this.documentNumberControl.valueChanges.subscribe(() => {
1054
+ this.emitValue();
1055
+ });
1056
+ effect(() => {
1057
+ if (this.isDisabled()) {
1058
+ this.documentTypeControl.disable({ emitEvent: false });
1059
+ this.documentNumberControl.disable({ emitEvent: false });
1060
+ }
1061
+ else {
1062
+ this.documentTypeControl.enable({ emitEvent: false });
1063
+ this.documentNumberControl.enable({ emitEvent: false });
1064
+ }
1065
+ });
1066
+ }
1067
+ emitValue() {
1068
+ const config = this.fieldConfig();
1069
+ const payloadMode = config.payloadMode || DocumentPayloadMode.OBJECT;
1070
+ const documentType = this.documentTypeControl.value || '';
1071
+ const documentNumber = this.documentNumberControl.value || '';
1072
+ const standardValue = {
1073
+ documentType,
1074
+ documentNumber
1075
+ };
1076
+ if (payloadMode === DocumentPayloadMode.SEPARATE_KEYS) {
1077
+ const documentTypeKey = config.documentTypeKey || 'document_type';
1078
+ const documentNumberKey = config.documentNumberKey || 'document';
1079
+ const separatedValue = {
1080
+ _isSeparatedDocumentField: true,
1081
+ [documentTypeKey]: documentType || null,
1082
+ [documentNumberKey]: documentNumber || null
1083
+ };
1084
+ this.valueChange.emit(separatedValue);
1085
+ super.onValueChange(standardValue);
1086
+ }
1087
+ else {
1088
+ this.valueChange.emit(standardValue);
1089
+ super.onValueChange(standardValue);
1090
+ }
1091
+ }
1092
+ onDocumentTypeChange(event) {
1093
+ const target = event.target;
1094
+ this.isUserEditing = true;
1095
+ this.documentTypeControl.setValue(target.value);
1096
+ setTimeout(() => {
1097
+ this.isUserEditing = false;
1098
+ }, 100);
1099
+ }
1100
+ onDocumentNumberChange(event) {
1101
+ const target = event.target;
1102
+ this.isUserEditing = true;
1103
+ this.documentNumberControl.setValue(target.value);
1104
+ setTimeout(() => {
1105
+ this.isUserEditing = false;
1106
+ }, 100);
1107
+ }
1108
+ onDocumentTypeFocus() {
1109
+ this.isUserEditing = true;
1110
+ }
1111
+ onDocumentNumberFocus() {
1112
+ this.isUserEditing = true;
1113
+ }
1114
+ onDocumentTypeBlur() {
1115
+ this.isUserEditing = false;
1116
+ this.onBlur();
1117
+ }
1118
+ onDocumentNumberBlur() {
1119
+ this.isUserEditing = false;
1120
+ this.onBlur();
1121
+ }
1122
+ getDocumentTypePlaceholder() {
1123
+ return this.fieldConfig().documentTypePlaceholder || 'Seleccione tipo';
1124
+ }
1125
+ getDocumentNumberPlaceholder() {
1126
+ return this.fieldConfig().documentNumberPlaceholder || 'Ingrese el número de documento';
1127
+ }
1128
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: DocumentFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1129
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: DocumentFieldComponent, isStandalone: true, selector: "core-document-field", usesInheritance: true, hostDirectives: [{ directive: CoreHostDirective }], ngImport: i0, template: "<div class=\"c-entry-group\">\n <label class=\"c-entry-item\" [class.c-entry-item--inline]=\"field().inline\">\n <span class=\"c-entry-text\" *ngIf=\"field().label\">\n {{ field().label | translate }}\n @if (hasRequiredValidators()) {\n <span class=\"c-required\">*</span>\n }\n </span>\n <div class=\"c-entry-grid\">\n <span class=\"c-entry-select\" [style.--chars]=\"documentTypeChars()\">\n <select \n [value]=\"documentTypeControl.value\"\n [disabled]=\"isDisabled()\"\n (focus)=\"onDocumentTypeFocus()\"\n (change)=\"onDocumentTypeChange($event)\"\n (blur)=\"onDocumentTypeBlur()\">\n <option value=\"\" disabled>{{ getDocumentTypePlaceholder() | translate }}</option>\n @for (option of documentTypeOptions(); track option.value) {\n <option [value]=\"option.value\">{{ option.label | translate }}</option>\n }\n </select>\n <span class=\"c-entry-select__arrow icon-arrow-down\"></span>\n </span>\n <span class=\"c-entry-input\" [style.--chars]=\"documentNumberChars()\">\n <input \n type=\"text\" \n [value]=\"documentNumberControl.value\"\n [placeholder]=\"getDocumentNumberPlaceholder() | translate\"\n [disabled]=\"isDisabled()\"\n (focus)=\"onDocumentNumberFocus()\"\n (input)=\"onDocumentNumberChange($event)\"\n (blur)=\"onDocumentNumberBlur()\">\n </span>\n </div>\n </label>\n</div>\n\n@if (hasError()) {\n <core-field-errors [errors]=\"errors()\"></core-field-errors>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: FieldErrorsComponent, selector: "core-field-errors", inputs: ["errors"] }] });
1130
+ }
1131
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: DocumentFieldComponent, decorators: [{
1132
+ type: Component,
1133
+ args: [{ selector: 'core-document-field', standalone: true, imports: [CommonModule, FormsModule, TranslateModule, ReactiveFormsModule, FieldErrorsComponent], hostDirectives: [CoreHostDirective], template: "<div class=\"c-entry-group\">\n <label class=\"c-entry-item\" [class.c-entry-item--inline]=\"field().inline\">\n <span class=\"c-entry-text\" *ngIf=\"field().label\">\n {{ field().label | translate }}\n @if (hasRequiredValidators()) {\n <span class=\"c-required\">*</span>\n }\n </span>\n <div class=\"c-entry-grid\">\n <span class=\"c-entry-select\" [style.--chars]=\"documentTypeChars()\">\n <select \n [value]=\"documentTypeControl.value\"\n [disabled]=\"isDisabled()\"\n (focus)=\"onDocumentTypeFocus()\"\n (change)=\"onDocumentTypeChange($event)\"\n (blur)=\"onDocumentTypeBlur()\">\n <option value=\"\" disabled>{{ getDocumentTypePlaceholder() | translate }}</option>\n @for (option of documentTypeOptions(); track option.value) {\n <option [value]=\"option.value\">{{ option.label | translate }}</option>\n }\n </select>\n <span class=\"c-entry-select__arrow icon-arrow-down\"></span>\n </span>\n <span class=\"c-entry-input\" [style.--chars]=\"documentNumberChars()\">\n <input \n type=\"text\" \n [value]=\"documentNumberControl.value\"\n [placeholder]=\"getDocumentNumberPlaceholder() | translate\"\n [disabled]=\"isDisabled()\"\n (focus)=\"onDocumentNumberFocus()\"\n (input)=\"onDocumentNumberChange($event)\"\n (blur)=\"onDocumentNumberBlur()\">\n </span>\n </div>\n </label>\n</div>\n\n@if (hasError()) {\n <core-field-errors [errors]=\"errors()\"></core-field-errors>\n}\n" }]
1134
+ }], ctorParameters: () => [] });
1135
+
975
1136
  // icon-compat.pipe.ts
976
1137
  class IconCompatPipe {
977
1138
  transform(value) {
@@ -2185,6 +2346,7 @@ var FieldType;
2185
2346
  FieldType["SERVER_SELECT"] = "server-select";
2186
2347
  FieldType["FILE"] = "file";
2187
2348
  FieldType["PHONE"] = "phone";
2349
+ FieldType["DOCUMENT"] = "document";
2188
2350
  })(FieldType || (FieldType = {}));
2189
2351
  var NumberFieldType;
2190
2352
  (function (NumberFieldType) {
@@ -4634,6 +4796,7 @@ class DynamicFieldDirective {
4634
4796
  datetime: DatetimeFieldComponent,
4635
4797
  time: TimeFieldComponent,
4636
4798
  password: PasswordFieldComponent,
4799
+ document: DocumentFieldComponent,
4637
4800
  file: FileFieldComponent,
4638
4801
  phone: PhoneFieldComponent,
4639
4802
  };
@@ -6642,6 +6805,22 @@ class GenericModalComponent {
6642
6805
  const modeConfig = field.modes?.[this.mode()];
6643
6806
  const defaultValue = modeConfig?.defaultValue ?? field.defaultValue;
6644
6807
  let initialValue = newInstance[fieldKey];
6808
+ if (field.type === FieldType.DOCUMENT) {
6809
+ const documentConfig = field;
6810
+ const payloadMode = documentConfig.payloadMode || DocumentPayloadMode.OBJECT;
6811
+ if (payloadMode === DocumentPayloadMode.SEPARATE_KEYS && this.mode() !== ModalMode.CREATE) {
6812
+ const documentTypeKey = documentConfig.documentTypeKey || 'documentType';
6813
+ const documentNumberKey = documentConfig.documentNumberKey || 'documentNumber';
6814
+ const documentType = newInstance[documentTypeKey];
6815
+ const documentNumber = newInstance[documentNumberKey];
6816
+ if (documentType && documentNumber) {
6817
+ initialValue = {
6818
+ type: documentType,
6819
+ number: documentNumber
6820
+ };
6821
+ }
6822
+ }
6823
+ }
6645
6824
  if (this.mode() === ModalMode.CREATE) {
6646
6825
  if (defaultValue !== undefined) {
6647
6826
  if (typeof defaultValue === 'function') {
@@ -6828,6 +7007,34 @@ class GenericModalComponent {
6828
7007
  const field = this.allFields().find(f => f.key === fieldKey);
6829
7008
  if (!field)
6830
7009
  return;
7010
+ if (value && typeof value === 'object' && value._isSeparatedDocumentField) {
7011
+ const { _isSeparatedDocumentField, ...separatedKeys } = value;
7012
+ this.editedData.update(data => {
7013
+ if (data) {
7014
+ Object.keys(separatedKeys).forEach(key => {
7015
+ const value = separatedKeys[key];
7016
+ if (value !== null && value !== undefined) {
7017
+ data[key] = value;
7018
+ }
7019
+ else {
7020
+ delete data[key];
7021
+ }
7022
+ });
7023
+ }
7024
+ return data;
7025
+ });
7026
+ Object.keys(separatedKeys).forEach(key => {
7027
+ const control = this.form().get(key);
7028
+ if (control) {
7029
+ control.setValue(separatedKeys[key], { emitEvent: false });
7030
+ }
7031
+ });
7032
+ const originalControl = this.form().get(fieldKey);
7033
+ if (originalControl) {
7034
+ originalControl.setValue(null, { emitEvent: false });
7035
+ }
7036
+ return;
7037
+ }
6831
7038
  const payloadKey = (field.keyToPayload ?? field.key);
6832
7039
  if (field.type === FieldType.FILE) {
6833
7040
  this.editedData.update(data => {
@@ -7768,14 +7975,33 @@ class DynamicFieldsHelper {
7768
7975
  const payloadKey = (field.keyToPayload ?? field.key);
7769
7976
  const modeConfig = field.modes?.[this.mode];
7770
7977
  const defaultValue = modeConfig?.defaultValue ?? field.defaultValue;
7978
+ let initialValue = newInstance[fieldKey];
7979
+ if (field.type === FieldType.DOCUMENT) {
7980
+ const documentConfig = field;
7981
+ const payloadMode = documentConfig.payloadMode || DocumentPayloadMode.OBJECT;
7982
+ if (payloadMode === DocumentPayloadMode.SEPARATE_KEYS && this.mode !== ModalMode.CREATE) {
7983
+ const documentTypeKey = documentConfig.documentTypeKey || 'documentType';
7984
+ const documentNumberKey = documentConfig.documentNumberKey || 'documentNumber';
7985
+ const documentType = newInstance[documentTypeKey];
7986
+ const documentNumber = newInstance[documentNumberKey];
7987
+ if (documentType && documentNumber) {
7988
+ initialValue = {
7989
+ type: documentType,
7990
+ number: documentNumber
7991
+ };
7992
+ }
7993
+ }
7994
+ }
7771
7995
  if (this.mode === ModalMode.CREATE) {
7772
- if (defaultValue !== undefined && newInstance[fieldKey] === undefined) {
7996
+ if (defaultValue !== undefined && initialValue === undefined) {
7773
7997
  if (typeof defaultValue === 'function') {
7774
7998
  const computedValue = defaultValue(newInstance);
7775
7999
  newInstance[payloadKey] = computedValue;
8000
+ initialValue = computedValue;
7776
8001
  }
7777
8002
  else {
7778
8003
  newInstance[payloadKey] = defaultValue;
8004
+ initialValue = defaultValue;
7779
8005
  }
7780
8006
  }
7781
8007
  }
@@ -7783,10 +8009,11 @@ class DynamicFieldsHelper {
7783
8009
  if (typeof defaultValue === 'function') {
7784
8010
  const computedValue = defaultValue(newInstance);
7785
8011
  newInstance[payloadKey] = computedValue;
8012
+ initialValue = computedValue;
7786
8013
  }
7787
8014
  }
7788
8015
  const validators = modeConfig?.validators ?? field.validators ?? [];
7789
- formGroup[fieldKey] = [newInstance[fieldKey], validators];
8016
+ formGroup[fieldKey] = [initialValue, validators];
7790
8017
  });
7791
8018
  this._form.set(this.formBuilder.group(formGroup));
7792
8019
  this.config.fields.forEach(field => {
@@ -7956,6 +8183,34 @@ class DynamicFieldsHelper {
7956
8183
  const field = this.config.fields.find(f => f.key === fieldKey);
7957
8184
  if (!field)
7958
8185
  return;
8186
+ if (value && typeof value === 'object' && value._isSeparatedDocumentField) {
8187
+ const { _isSeparatedDocumentField, ...separatedKeys } = value;
8188
+ this._editedData.update(data => {
8189
+ if (data) {
8190
+ Object.keys(separatedKeys).forEach(key => {
8191
+ const value = separatedKeys[key];
8192
+ if (value !== null && value !== undefined) {
8193
+ data[key] = value;
8194
+ }
8195
+ else {
8196
+ delete data[key];
8197
+ }
8198
+ });
8199
+ }
8200
+ return data;
8201
+ });
8202
+ Object.keys(separatedKeys).forEach(key => {
8203
+ const control = this._form().get(key);
8204
+ if (control) {
8205
+ control.setValue(separatedKeys[key], { emitEvent: false });
8206
+ }
8207
+ });
8208
+ const originalControl = this._form().get(fieldKey);
8209
+ if (originalControl) {
8210
+ originalControl.setValue(null, { emitEvent: false });
8211
+ }
8212
+ return;
8213
+ }
7959
8214
  const payloadKey = (field.keyToPayload ?? field.key);
7960
8215
  this._editedData.update(data => {
7961
8216
  if (data) {
@@ -14414,11 +14669,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
14414
14669
  // Este archivo es generado automáticamente por scripts/update-version.js
14415
14670
  // No edites manualmente este archivo
14416
14671
  const VERSION = {
14417
- full: '2.12.45',
14672
+ full: '2.12.47',
14418
14673
  major: 2,
14419
14674
  minor: 12,
14420
- patch: 45,
14421
- timestamp: '2025-09-23T14:31:24.373Z',
14675
+ patch: 47,
14676
+ timestamp: '2025-09-23T17:54:10.477Z',
14422
14677
  buildDate: '23/9/2025'
14423
14678
  };
14424
14679
 
@@ -17298,6 +17553,89 @@ function equalToValidator(targetKey) {
17298
17553
  };
17299
17554
  }
17300
17555
 
17556
+ class DocumentFieldValidators {
17557
+ static required = (control) => {
17558
+ const value = control.value;
17559
+ if (!value) {
17560
+ return { required: true };
17561
+ }
17562
+ if (typeof value === 'object' && 'documentType' in value && 'documentNumber' in value) {
17563
+ const docValue = value;
17564
+ if (!docValue.documentType || !docValue.documentNumber) {
17565
+ return { required: true };
17566
+ }
17567
+ return null;
17568
+ }
17569
+ if (typeof value === 'object' && value._isSeparatedDocumentField) {
17570
+ const keys = Object.keys(value).filter(k => k !== '_isSeparatedDocumentField');
17571
+ const hasEmptyValues = keys.some(key => !value[key]);
17572
+ if (hasEmptyValues) {
17573
+ return { required: true };
17574
+ }
17575
+ return null;
17576
+ }
17577
+ if (typeof value === 'string' && !value.trim()) {
17578
+ return { required: true };
17579
+ }
17580
+ return null;
17581
+ };
17582
+ static documentTypeRequired = (control) => {
17583
+ const value = control.value;
17584
+ if (!value) {
17585
+ return { documentTypeRequired: true };
17586
+ }
17587
+ if (typeof value === 'object' && 'documentType' in value) {
17588
+ const docValue = value;
17589
+ if (!docValue.documentType) {
17590
+ return { documentTypeRequired: true };
17591
+ }
17592
+ }
17593
+ return null;
17594
+ };
17595
+ static documentNumberRequired = (control) => {
17596
+ const value = control.value;
17597
+ if (!value) {
17598
+ return { documentNumberRequired: true };
17599
+ }
17600
+ if (typeof value === 'object' && 'documentNumber' in value) {
17601
+ const docValue = value;
17602
+ if (!docValue.documentNumber) {
17603
+ return { documentNumberRequired: true };
17604
+ }
17605
+ }
17606
+ return null;
17607
+ };
17608
+ static documentNumberFormat = (control) => {
17609
+ const value = control.value;
17610
+ if (!value || typeof value !== 'object' || !('documentType' in value) || !('documentNumber' in value)) {
17611
+ return null;
17612
+ }
17613
+ const docValue = value;
17614
+ const { documentType, documentNumber } = docValue;
17615
+ if (!documentType || !documentNumber) {
17616
+ return null;
17617
+ }
17618
+ switch (documentType.toUpperCase()) {
17619
+ case 'CI':
17620
+ if (!/^\d{7,8}$/.test(documentNumber)) {
17621
+ return { documentNumberFormat: { message: 'CI debe tener 7-8 dígitos numéricos' } };
17622
+ }
17623
+ break;
17624
+ case 'DNI':
17625
+ if (!/^\d{8}$/.test(documentNumber)) {
17626
+ return { documentNumberFormat: { message: 'DNI debe tener 8 dígitos numéricos' } };
17627
+ }
17628
+ break;
17629
+ case 'PASSPORT':
17630
+ if (!/^[A-Z0-9]{6,12}$/i.test(documentNumber)) {
17631
+ return { documentNumberFormat: { message: 'Pasaporte debe tener 6-12 caracteres alfanuméricos' } };
17632
+ }
17633
+ break;
17634
+ }
17635
+ return null;
17636
+ };
17637
+ }
17638
+
17301
17639
  function HttpLoaderFactory(http) {
17302
17640
  return new TranslateHttpLoader(http, './assets/i18n/', '/main.json');
17303
17641
  }
@@ -17397,5 +17735,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
17397
17735
  * Generated bundle index. Do not edit.
17398
17736
  */
17399
17737
 
17400
- export { ALL_COUNTRY_CODES, ActiveFiltersComponent, AgeValidationHelper, AlertComponent, AlertContainerComponent, AlertService, AlertType, ApiConfigurationProvider, BaseFieldComponent, ButtonContext, ButtonSize, ButtonType, COMMON_COUNTRIES, CacheBustingInterceptor, CardComponent, CarouselComponent, ChatMessagePosition, ChatMessageType, CheckboxFieldComponent, ConfigurationModel, ConfirmationDialogComponent, ConfirmationDialogService, CoreHostDirective, CoreManualRefreshComponent, CoreUiHttpLoaderFactory, CoreUiTranslateLoader, CoreUiTranslateService, CountryCode, DEFAULT_COUNTRIES, 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, LATIN_AMERICA_COUNTRIES, 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, PhoneFieldComponent, ProgressBarComponent, ProgressBarSize, RatingService, RatingSize, RatingType, ResetPasswordModel, RoleModel, SOUTH_AMERICA_COUNTRIES, 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, getCountryCodeStrings, getLatestBirthDateForAge, getRandomCi, getUruguayanDocumentValidationDigit, getValidationDigit, isSameDate, isValidCountryCode, provideCoreUiTranslateLoader, providePermissionActions, providePermissionEnums, providePermissionResources, providePermissionService, providePermissionServiceFactory, provideTranslateLoader, random, transform, transformUruguayanDocument, uruguayanDocumentValidator, validate, validateAge, validateCi, validateUruguayanDocument, validationDigit };
17738
+ export { ALL_COUNTRY_CODES, ActiveFiltersComponent, AgeValidationHelper, AlertComponent, AlertContainerComponent, AlertService, AlertType, ApiConfigurationProvider, BaseFieldComponent, ButtonContext, ButtonSize, ButtonType, COMMON_COUNTRIES, CacheBustingInterceptor, CardComponent, CarouselComponent, ChatMessagePosition, ChatMessageType, CheckboxFieldComponent, ConfigurationModel, ConfirmationDialogComponent, ConfirmationDialogService, CoreHostDirective, CoreManualRefreshComponent, CoreUiHttpLoaderFactory, CoreUiTranslateLoader, CoreUiTranslateService, CountryCode, DEFAULT_COUNTRIES, DataListComponent, DataListItemComponent, DateFieldComponent, DateUtility, DatetimeFieldComponent, DialogActions, DocumentAction, DocumentDisplayMode, DocumentFieldComponent, DocumentFieldValidators, DocumentPayloadMode, 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, LATIN_AMERICA_COUNTRIES, 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, PhoneFieldComponent, ProgressBarComponent, ProgressBarSize, RatingService, RatingSize, RatingType, ResetPasswordModel, RoleModel, SOUTH_AMERICA_COUNTRIES, 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, getCountryCodeStrings, getLatestBirthDateForAge, getRandomCi, getUruguayanDocumentValidationDigit, getValidationDigit, isSameDate, isValidCountryCode, provideCoreUiTranslateLoader, providePermissionActions, providePermissionEnums, providePermissionResources, providePermissionService, providePermissionServiceFactory, provideTranslateLoader, random, transform, transformUruguayanDocument, uruguayanDocumentValidator, validate, validateAge, validateCi, validateUruguayanDocument, validationDigit };
17401
17739
  //# sourceMappingURL=solcre-org-core-ui.mjs.map