@solcre-org/core-ui 2.13.2 → 2.13.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.
|
@@ -1074,7 +1074,12 @@
|
|
|
1074
1074
|
"select-time": "Select a time",
|
|
1075
1075
|
"select-end-time": "Select end time",
|
|
1076
1076
|
"used": "Used",
|
|
1077
|
-
"unavailable": "Unavailable"
|
|
1077
|
+
"unavailable": "Unavailable",
|
|
1078
|
+
"errors": {
|
|
1079
|
+
"start-time-required": "Start time is required",
|
|
1080
|
+
"end-time-required": "End time is required",
|
|
1081
|
+
"end-time-after-start": "End time must be after start time"
|
|
1082
|
+
}
|
|
1078
1083
|
},
|
|
1079
1084
|
"multi-entry": {
|
|
1080
1085
|
"add-field": "Add field",
|
|
@@ -1076,7 +1076,12 @@
|
|
|
1076
1076
|
"select-time": "Selecciona una hora",
|
|
1077
1077
|
"select-end-time": "Selecciona hora de fin",
|
|
1078
1078
|
"used": "Ocupado",
|
|
1079
|
-
"unavailable": "No disponible"
|
|
1079
|
+
"unavailable": "No disponible",
|
|
1080
|
+
"errors": {
|
|
1081
|
+
"start-time-required": "La hora de inicio es obligatoria",
|
|
1082
|
+
"end-time-required": "La hora de fin es obligatoria",
|
|
1083
|
+
"end-time-after-start": "La hora de fin debe ser posterior a la de inicio"
|
|
1084
|
+
}
|
|
1080
1085
|
},
|
|
1081
1086
|
"multi-entry": {
|
|
1082
1087
|
"add-field": "Agregar campo",
|
|
@@ -4500,11 +4500,17 @@ class TimeFieldComponent {
|
|
|
4500
4500
|
valueChange = output();
|
|
4501
4501
|
onBlurEvent = output();
|
|
4502
4502
|
onEnterEvent = output();
|
|
4503
|
+
startTimeChange = output();
|
|
4504
|
+
endTimeChange = output();
|
|
4505
|
+
startTimeBlur = output();
|
|
4506
|
+
endTimeBlur = output();
|
|
4503
4507
|
ModalMode = ModalMode;
|
|
4504
4508
|
selectedStartTime = signal(null);
|
|
4505
4509
|
selectedEndTime = signal(null);
|
|
4506
4510
|
hasStartValue = signal(false);
|
|
4507
4511
|
hasEndValue = signal(false);
|
|
4512
|
+
startTimeErrors = signal([]);
|
|
4513
|
+
endTimeErrors = signal([]);
|
|
4508
4514
|
config = computed(() => this.field().config || {});
|
|
4509
4515
|
isStartPlaceholderVisible = computed(() => {
|
|
4510
4516
|
const hasVal = this.hasStartValue();
|
|
@@ -4565,6 +4571,28 @@ class TimeFieldComponent {
|
|
|
4565
4571
|
const validators = this.getCurrentValidators();
|
|
4566
4572
|
return validators.some((validator) => validator === Validators.required);
|
|
4567
4573
|
});
|
|
4574
|
+
validateStartTime(value) {
|
|
4575
|
+
const errors = [];
|
|
4576
|
+
if (this.hasRequiredValidators() && (!value || !value.trim())) {
|
|
4577
|
+
errors.push('time-field.errors.start-time-required');
|
|
4578
|
+
}
|
|
4579
|
+
return errors;
|
|
4580
|
+
}
|
|
4581
|
+
validateEndTime(value) {
|
|
4582
|
+
const errors = [];
|
|
4583
|
+
if (!this.includeEndTime()) {
|
|
4584
|
+
return errors;
|
|
4585
|
+
}
|
|
4586
|
+
if (this.hasRequiredValidators() && (!value || !value.trim())) {
|
|
4587
|
+
errors.push('time-field.errors.end-time-required');
|
|
4588
|
+
}
|
|
4589
|
+
if (this.config().enforceEndTimeAfterStart && value && this.selectedStartTime()) {
|
|
4590
|
+
if (this.isTimeBeforeOrEqual(value, this.selectedStartTime())) {
|
|
4591
|
+
errors.push('time-field.errors.end-time-after-start');
|
|
4592
|
+
}
|
|
4593
|
+
}
|
|
4594
|
+
return errors;
|
|
4595
|
+
}
|
|
4568
4596
|
getCurrentValidators() {
|
|
4569
4597
|
const modeConfig = this.field().modes?.[this.mode()];
|
|
4570
4598
|
const modeValidators = modeConfig?.validators;
|
|
@@ -4575,7 +4603,6 @@ class TimeFieldComponent {
|
|
|
4575
4603
|
return validatorConfig(this.formValue());
|
|
4576
4604
|
}
|
|
4577
4605
|
catch (error) {
|
|
4578
|
-
console.warn('Error evaluating dynamic validators:', error);
|
|
4579
4606
|
return [];
|
|
4580
4607
|
}
|
|
4581
4608
|
}
|
|
@@ -4593,16 +4620,22 @@ class TimeFieldComponent {
|
|
|
4593
4620
|
}
|
|
4594
4621
|
return readonly || false;
|
|
4595
4622
|
}
|
|
4623
|
+
userInteracted = signal(false);
|
|
4596
4624
|
constructor() {
|
|
4597
4625
|
effect(() => {
|
|
4598
4626
|
const newValue = this.value();
|
|
4599
|
-
this.
|
|
4600
|
-
|
|
4627
|
+
const hasUserInteracted = this.userInteracted();
|
|
4628
|
+
if (!hasUserInteracted) {
|
|
4629
|
+
this.initializeFromValue(newValue);
|
|
4630
|
+
}
|
|
4631
|
+
}, { allowSignalWrites: true });
|
|
4601
4632
|
effect(() => {
|
|
4602
4633
|
const mode = this.mode();
|
|
4603
4634
|
const currentValue = this.value();
|
|
4604
4635
|
const config = this.config();
|
|
4605
|
-
|
|
4636
|
+
const hasUserInteracted = this.userInteracted();
|
|
4637
|
+
if (!hasUserInteracted &&
|
|
4638
|
+
(mode === ModalMode.CREATE || mode === ModalMode.EDIT) &&
|
|
4606
4639
|
(!currentValue || this.isEmptyValue(currentValue)) &&
|
|
4607
4640
|
(config.defaultStartTime || config.defaultEndTime)) {
|
|
4608
4641
|
const hasCurrentStartTime = this.selectedStartTime();
|
|
@@ -4611,7 +4644,7 @@ class TimeFieldComponent {
|
|
|
4611
4644
|
this.applyDefaultValues();
|
|
4612
4645
|
}
|
|
4613
4646
|
}
|
|
4614
|
-
});
|
|
4647
|
+
}, { allowSignalWrites: true });
|
|
4615
4648
|
effect(() => {
|
|
4616
4649
|
const startTime = this.selectedStartTime();
|
|
4617
4650
|
this.hasStartValue.set(startTime !== null && startTime !== undefined && startTime !== '');
|
|
@@ -4623,17 +4656,16 @@ class TimeFieldComponent {
|
|
|
4623
4656
|
effect(() => {
|
|
4624
4657
|
const fieldCfg = this.field();
|
|
4625
4658
|
const formValue = this.formValue();
|
|
4626
|
-
|
|
4659
|
+
const hasUserInteracted = this.userInteracted();
|
|
4660
|
+
if (!hasUserInteracted && 'dynamicValue' in fieldCfg && typeof fieldCfg.dynamicValue === 'function') {
|
|
4627
4661
|
const newValue = fieldCfg.dynamicValue(formValue || {});
|
|
4628
4662
|
const currentValue = this.value();
|
|
4629
4663
|
if (newValue !== null && newValue !== undefined && newValue !== currentValue) {
|
|
4630
4664
|
this.initializeFromValue(newValue);
|
|
4631
|
-
|
|
4632
|
-
this.valueChange.emit(newValue);
|
|
4633
|
-
}, 0);
|
|
4665
|
+
this.valueChange.emit(newValue);
|
|
4634
4666
|
}
|
|
4635
4667
|
}
|
|
4636
|
-
});
|
|
4668
|
+
}, { allowSignalWrites: true });
|
|
4637
4669
|
}
|
|
4638
4670
|
initializeFromValue(value) {
|
|
4639
4671
|
if (!value) {
|
|
@@ -4682,28 +4714,43 @@ class TimeFieldComponent {
|
|
|
4682
4714
|
return options;
|
|
4683
4715
|
}
|
|
4684
4716
|
onStartTimeChange(value) {
|
|
4717
|
+
this.userInteracted.set(true);
|
|
4685
4718
|
this.selectedStartTime.set(value);
|
|
4719
|
+
const startTimeErrors = this.validateStartTime(value);
|
|
4720
|
+
this.startTimeErrors.set(startTimeErrors);
|
|
4686
4721
|
const currentEndTime = this.selectedEndTime();
|
|
4687
4722
|
const enforceEndTimeAfterStart = this.config().enforceEndTimeAfterStart || false;
|
|
4688
4723
|
if (value && currentEndTime) {
|
|
4689
4724
|
if (enforceEndTimeAfterStart && this.isTimeBeforeOrEqual(currentEndTime, value)) {
|
|
4690
4725
|
this.selectedEndTime.set(null);
|
|
4726
|
+
this.endTimeErrors.set(['time-field.errors.end-time-after-start']);
|
|
4691
4727
|
}
|
|
4692
4728
|
else if (!enforceEndTimeAfterStart && currentEndTime === value) {
|
|
4693
4729
|
this.selectedEndTime.set(null);
|
|
4694
4730
|
}
|
|
4695
4731
|
}
|
|
4732
|
+
if (this.includeEndTime()) {
|
|
4733
|
+
const endTimeErrors = this.validateEndTime(this.selectedEndTime());
|
|
4734
|
+
this.endTimeErrors.set(endTimeErrors);
|
|
4735
|
+
}
|
|
4736
|
+
this.startTimeChange.emit(value);
|
|
4696
4737
|
this.emitValue();
|
|
4697
4738
|
}
|
|
4698
4739
|
onEndTimeChange(value) {
|
|
4740
|
+
this.userInteracted.set(true);
|
|
4699
4741
|
const startTime = this.selectedStartTime();
|
|
4700
4742
|
const enforceEndTimeAfterStart = this.config().enforceEndTimeAfterStart || false;
|
|
4743
|
+
const endTimeErrors = this.validateEndTime(value);
|
|
4701
4744
|
if (value && startTime && enforceEndTimeAfterStart) {
|
|
4702
4745
|
if (this.isTimeBeforeOrEqual(value, startTime)) {
|
|
4746
|
+
endTimeErrors.push('time-field.errors.end-time-after-start');
|
|
4747
|
+
this.endTimeErrors.set(endTimeErrors);
|
|
4703
4748
|
return;
|
|
4704
4749
|
}
|
|
4705
4750
|
}
|
|
4706
4751
|
this.selectedEndTime.set(value);
|
|
4752
|
+
this.endTimeErrors.set(endTimeErrors);
|
|
4753
|
+
this.endTimeChange.emit(value);
|
|
4707
4754
|
this.emitValue();
|
|
4708
4755
|
}
|
|
4709
4756
|
emitValue() {
|
|
@@ -4712,7 +4759,7 @@ class TimeFieldComponent {
|
|
|
4712
4759
|
if (this.includeEndTime()) {
|
|
4713
4760
|
const timeFieldValue = {
|
|
4714
4761
|
startTime,
|
|
4715
|
-
endTime
|
|
4762
|
+
endTime: endTime || null
|
|
4716
4763
|
};
|
|
4717
4764
|
this.valueChange.emit(timeFieldValue);
|
|
4718
4765
|
}
|
|
@@ -4721,9 +4768,15 @@ class TimeFieldComponent {
|
|
|
4721
4768
|
}
|
|
4722
4769
|
}
|
|
4723
4770
|
onStartTimeBlur() {
|
|
4771
|
+
const startTimeErrors = this.validateStartTime(this.selectedStartTime());
|
|
4772
|
+
this.startTimeErrors.set(startTimeErrors);
|
|
4773
|
+
this.startTimeBlur.emit();
|
|
4724
4774
|
this.onBlurEvent.emit(this.field().key);
|
|
4725
4775
|
}
|
|
4726
4776
|
onEndTimeBlur() {
|
|
4777
|
+
const endTimeErrors = this.validateEndTime(this.selectedEndTime());
|
|
4778
|
+
this.endTimeErrors.set(endTimeErrors);
|
|
4779
|
+
this.endTimeBlur.emit();
|
|
4727
4780
|
this.onBlurEvent.emit(this.field().key);
|
|
4728
4781
|
}
|
|
4729
4782
|
isTimeBeforeOrEqual(time1, time2) {
|
|
@@ -4763,16 +4816,14 @@ class TimeFieldComponent {
|
|
|
4763
4816
|
this.selectedEndTime.set(defaultEndTime);
|
|
4764
4817
|
}
|
|
4765
4818
|
}
|
|
4766
|
-
|
|
4767
|
-
this.emitValue();
|
|
4768
|
-
}, 0);
|
|
4819
|
+
this.emitValue();
|
|
4769
4820
|
}
|
|
4770
4821
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: TimeFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4771
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: TimeFieldComponent, isStandalone: true, selector: "core-time-field", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: true, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, rowData: { classPropertyName: "rowData", publicName: "rowData", isSignal: true, isRequired: false, transformFunction: null }, formValue: { classPropertyName: "formValue", publicName: "formValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", onBlurEvent: "onBlurEvent", onEnterEvent: "onEnterEvent" }, hostDirectives: [{ directive: CoreHostDirective }], ngImport: i0, template: "<div class=\"c-entry-item\" [class.c-entry-item--inline]=\"field().inline\" [class.time-field-range]=\"includeEndTime()\">\n <!-- Start Time Field -->\n <div class=\"time-field-container\">\n <label class=\"c-entry-text\" [for]=\"field().key.toString() + '-start'\">\n {{ startTimeLabel() | translate }}\n @if (hasRequiredValidators()) {\n <span class=\"c-required\">*</span>\n }\n </label>\n \n <span class=\"c-entry-input c-entry-input--ng-select\" [class.is-invalid]=\"hasError()\">\n <ng-select\n [id]=\"field().key.toString() + '-start'\"\n [items]=\"startTimeOptions()\"\n bindLabel=\"label\"\n bindValue=\"value\"\n [clearable]=\"!hasRequiredValidators()\"\n [disabled]=\"isDisabled()\"\n [ngModel]=\"selectedStartTime()\"\n (ngModelChange)=\"onStartTimeChange($event)\"\n (blur)=\"onStartTimeBlur()\"\n [placeholder]=\"isStartPlaceholderVisible() ? ('time-field.select-time' | translate) : ''\"\n [searchable]=\"false\">\n \n <ng-template ng-option-tmp let-item=\"item\">\n {{ item.label }}\n @if (item.used) {\n <span class=\"used-indicator\"> ({{ 'time-field.used' | translate }})</span>\n }\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\n <!-- End Time Field (only if includeEndTime is true) -->\n @if (includeEndTime()) {\n <div class=\"time-field-container time-field-end\">\n <label class=\"c-entry-text\" [for]=\"field().key.toString() + '-end'\">\n {{ endTimeLabel() | translate }}\n @if (hasRequiredValidators()) {\n <span class=\"c-required\">*</span>\n }\n </label>\n \n <span class=\"c-entry-input c-entry-input--ng-select\" [class.is-invalid]=\"hasError()\">\n <ng-select\n [id]=\"field().key.toString() + '-end'\"\n [items]=\"endTimeOptions()\"\n bindLabel=\"label\"\n bindValue=\"value\"\n [clearable]=\"true\"\n [disabled]=\"isDisabled() || !selectedStartTime()\"\n [ngModel]=\"selectedEndTime()\"\n (ngModelChange)=\"onEndTimeChange($event)\"\n (blur)=\"onEndTimeBlur()\"\n [placeholder]=\"isEndPlaceholderVisible() ? ('time-field.select-end-time' | translate) : ''\"\n [searchable]=\"false\">\n \n <ng-template ng-option-tmp let-item=\"item\">\n {{ item.label }}\n @if (item.used) {\n <span class=\"used-indicator\"> ({{ 'time-field.used' | translate }})</span>\n }\n @if (selectedStartTime() && item.value === selectedStartTime()!) {\n <span class=\"unavailable-indicator\"> ({{ 'time-field.unavailable' | translate }})</span>\n }\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 }\n\n <!-- Error Messages -->\n @if (hasError()) {\n <core-field-errors [errors]=\"errors()\"></core-field-errors>\n }\n</div>\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"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i5.NgSelectComponent, selector: "ng-select", inputs: ["ariaLabelDropdown", "bindLabel", "bindValue", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "tabFocusOnClearButton", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick", "keyDownFn"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i5.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i5.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { kind: "component", type: FieldErrorsComponent, selector: "core-field-errors", inputs: ["errors"] }] });
|
|
4822
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: TimeFieldComponent, isStandalone: true, selector: "core-time-field", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: true, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, rowData: { classPropertyName: "rowData", publicName: "rowData", isSignal: true, isRequired: false, transformFunction: null }, formValue: { classPropertyName: "formValue", publicName: "formValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", onBlurEvent: "onBlurEvent", onEnterEvent: "onEnterEvent", startTimeChange: "startTimeChange", endTimeChange: "endTimeChange", startTimeBlur: "startTimeBlur", endTimeBlur: "endTimeBlur" }, hostDirectives: [{ directive: CoreHostDirective }], ngImport: i0, template: "<div class=\"c-entry-item\" [class.c-entry-item--inline]=\"field().inline\" [class.time-field-range]=\"includeEndTime()\">\n <!-- Start Time Field -->\n <div class=\"time-field-container\">\n <label class=\"c-entry-text\" [for]=\"field().key.toString() + '-start'\">\n {{ startTimeLabel() | translate }}\n @if (hasRequiredValidators()) {\n <span class=\"c-required\">*</span>\n }\n </label>\n \n <span class=\"c-entry-input c-entry-input--ng-select\" [class.is-invalid]=\"startTimeErrors().length > 0\">\n <ng-select\n [id]=\"field().key.toString() + '-start'\"\n [items]=\"startTimeOptions()\"\n bindLabel=\"label\"\n bindValue=\"value\"\n [clearable]=\"!hasRequiredValidators()\"\n [disabled]=\"isDisabled()\"\n [ngModel]=\"selectedStartTime()\"\n (ngModelChange)=\"onStartTimeChange($event)\"\n (blur)=\"onStartTimeBlur()\"\n [placeholder]=\"isStartPlaceholderVisible() ? ('time-field.select-time' | translate) : ''\"\n [searchable]=\"false\">\n \n <ng-template ng-option-tmp let-item=\"item\">\n {{ item.label }}\n @if (item.used) {\n <span class=\"used-indicator\"> ({{ 'time-field.used' | translate }})</span>\n }\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 \n <!-- Errores espec\u00EDficos para Start Time -->\n @if (startTimeErrors().length > 0) {\n <core-field-errors [errors]=\"startTimeErrors()\"></core-field-errors>\n }\n </div>\n\n <!-- End Time Field (only if includeEndTime is true) -->\n @if (includeEndTime()) {\n <div class=\"time-field-container time-field-end\">\n <label class=\"c-entry-text\" [for]=\"field().key.toString() + '-end'\">\n {{ endTimeLabel() | translate }}\n @if (hasRequiredValidators()) {\n <span class=\"c-required\">*</span>\n }\n </label>\n \n <span class=\"c-entry-input c-entry-input--ng-select\" [class.is-invalid]=\"endTimeErrors().length > 0\">\n <ng-select\n [id]=\"field().key.toString() + '-end'\"\n [items]=\"endTimeOptions()\"\n bindLabel=\"label\"\n bindValue=\"value\"\n [clearable]=\"true\"\n [disabled]=\"isDisabled()\"\n [ngModel]=\"selectedEndTime()\"\n (ngModelChange)=\"onEndTimeChange($event)\"\n (blur)=\"onEndTimeBlur()\"\n [placeholder]=\"isEndPlaceholderVisible() ? ('time-field.select-end-time' | translate) : ''\"\n [searchable]=\"false\">\n \n <ng-template ng-option-tmp let-item=\"item\">\n {{ item.label }}\n @if (item.used) {\n <span class=\"used-indicator\"> ({{ 'time-field.used' | translate }})</span>\n }\n @if (selectedStartTime() && item.value === selectedStartTime()!) {\n <span class=\"unavailable-indicator\"> ({{ 'time-field.unavailable' | translate }})</span>\n }\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 \n <!-- Errores espec\u00EDficos para End Time -->\n @if (endTimeErrors().length > 0) {\n <core-field-errors [errors]=\"endTimeErrors()\"></core-field-errors>\n }\n </div>\n }\n\n <!-- Error Messages Globales (si es necesario) -->\n @if (hasError() && errors().length > 0) {\n <core-field-errors [errors]=\"errors()\"></core-field-errors>\n }\n</div>\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"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i5.NgSelectComponent, selector: "ng-select", inputs: ["ariaLabelDropdown", "bindLabel", "bindValue", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "tabFocusOnClearButton", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick", "keyDownFn"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i5.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i5.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { kind: "component", type: FieldErrorsComponent, selector: "core-field-errors", inputs: ["errors"] }] });
|
|
4772
4823
|
}
|
|
4773
4824
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: TimeFieldComponent, decorators: [{
|
|
4774
4825
|
type: Component,
|
|
4775
|
-
args: [{ selector: 'core-time-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\" [class.time-field-range]=\"includeEndTime()\">\n <!-- Start Time Field -->\n <div class=\"time-field-container\">\n <label class=\"c-entry-text\" [for]=\"field().key.toString() + '-start'\">\n {{ startTimeLabel() | translate }}\n @if (hasRequiredValidators()) {\n <span class=\"c-required\">*</span>\n }\n </label>\n \n <span class=\"c-entry-input c-entry-input--ng-select\" [class.is-invalid]=\"
|
|
4826
|
+
args: [{ selector: 'core-time-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\" [class.time-field-range]=\"includeEndTime()\">\n <!-- Start Time Field -->\n <div class=\"time-field-container\">\n <label class=\"c-entry-text\" [for]=\"field().key.toString() + '-start'\">\n {{ startTimeLabel() | translate }}\n @if (hasRequiredValidators()) {\n <span class=\"c-required\">*</span>\n }\n </label>\n \n <span class=\"c-entry-input c-entry-input--ng-select\" [class.is-invalid]=\"startTimeErrors().length > 0\">\n <ng-select\n [id]=\"field().key.toString() + '-start'\"\n [items]=\"startTimeOptions()\"\n bindLabel=\"label\"\n bindValue=\"value\"\n [clearable]=\"!hasRequiredValidators()\"\n [disabled]=\"isDisabled()\"\n [ngModel]=\"selectedStartTime()\"\n (ngModelChange)=\"onStartTimeChange($event)\"\n (blur)=\"onStartTimeBlur()\"\n [placeholder]=\"isStartPlaceholderVisible() ? ('time-field.select-time' | translate) : ''\"\n [searchable]=\"false\">\n \n <ng-template ng-option-tmp let-item=\"item\">\n {{ item.label }}\n @if (item.used) {\n <span class=\"used-indicator\"> ({{ 'time-field.used' | translate }})</span>\n }\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 \n <!-- Errores espec\u00EDficos para Start Time -->\n @if (startTimeErrors().length > 0) {\n <core-field-errors [errors]=\"startTimeErrors()\"></core-field-errors>\n }\n </div>\n\n <!-- End Time Field (only if includeEndTime is true) -->\n @if (includeEndTime()) {\n <div class=\"time-field-container time-field-end\">\n <label class=\"c-entry-text\" [for]=\"field().key.toString() + '-end'\">\n {{ endTimeLabel() | translate }}\n @if (hasRequiredValidators()) {\n <span class=\"c-required\">*</span>\n }\n </label>\n \n <span class=\"c-entry-input c-entry-input--ng-select\" [class.is-invalid]=\"endTimeErrors().length > 0\">\n <ng-select\n [id]=\"field().key.toString() + '-end'\"\n [items]=\"endTimeOptions()\"\n bindLabel=\"label\"\n bindValue=\"value\"\n [clearable]=\"true\"\n [disabled]=\"isDisabled()\"\n [ngModel]=\"selectedEndTime()\"\n (ngModelChange)=\"onEndTimeChange($event)\"\n (blur)=\"onEndTimeBlur()\"\n [placeholder]=\"isEndPlaceholderVisible() ? ('time-field.select-end-time' | translate) : ''\"\n [searchable]=\"false\">\n \n <ng-template ng-option-tmp let-item=\"item\">\n {{ item.label }}\n @if (item.used) {\n <span class=\"used-indicator\"> ({{ 'time-field.used' | translate }})</span>\n }\n @if (selectedStartTime() && item.value === selectedStartTime()!) {\n <span class=\"unavailable-indicator\"> ({{ 'time-field.unavailable' | translate }})</span>\n }\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 \n <!-- Errores espec\u00EDficos para End Time -->\n @if (endTimeErrors().length > 0) {\n <core-field-errors [errors]=\"endTimeErrors()\"></core-field-errors>\n }\n </div>\n }\n\n <!-- Error Messages Globales (si es necesario) -->\n @if (hasError() && errors().length > 0) {\n <core-field-errors [errors]=\"errors()\"></core-field-errors>\n }\n</div>\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"] }]
|
|
4776
4827
|
}], ctorParameters: () => [] });
|
|
4777
4828
|
|
|
4778
4829
|
class DynamicFieldDirective {
|
|
@@ -14673,11 +14724,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
14673
14724
|
// Este archivo es generado automáticamente por scripts/update-version.js
|
|
14674
14725
|
// No edites manualmente este archivo
|
|
14675
14726
|
const VERSION = {
|
|
14676
|
-
full: '2.13.
|
|
14727
|
+
full: '2.13.3',
|
|
14677
14728
|
major: 2,
|
|
14678
14729
|
minor: 13,
|
|
14679
|
-
patch:
|
|
14680
|
-
timestamp: '2025-09-
|
|
14730
|
+
patch: 3,
|
|
14731
|
+
timestamp: '2025-09-26T11:56:05.062Z',
|
|
14681
14732
|
buildDate: '26/9/2025'
|
|
14682
14733
|
};
|
|
14683
14734
|
|
|
@@ -17651,6 +17702,144 @@ class DocumentFieldValidators {
|
|
|
17651
17702
|
};
|
|
17652
17703
|
}
|
|
17653
17704
|
|
|
17705
|
+
class TimeFieldValidators {
|
|
17706
|
+
static required = (control) => {
|
|
17707
|
+
const value = control.value;
|
|
17708
|
+
if (!value) {
|
|
17709
|
+
return { required: true };
|
|
17710
|
+
}
|
|
17711
|
+
if (typeof value === 'string') {
|
|
17712
|
+
return value.trim() ? null : { required: true };
|
|
17713
|
+
}
|
|
17714
|
+
if (typeof value === 'object' && 'startTime' in value) {
|
|
17715
|
+
const timeValue = value;
|
|
17716
|
+
if (!timeValue.startTime || !timeValue.startTime.trim()) {
|
|
17717
|
+
return { required: true };
|
|
17718
|
+
}
|
|
17719
|
+
return null;
|
|
17720
|
+
}
|
|
17721
|
+
return { required: true };
|
|
17722
|
+
};
|
|
17723
|
+
static requiredBoth = (control) => {
|
|
17724
|
+
const value = control.value;
|
|
17725
|
+
if (!value) {
|
|
17726
|
+
return { required: true };
|
|
17727
|
+
}
|
|
17728
|
+
if (typeof value === 'string') {
|
|
17729
|
+
return value.trim() ? null : { required: true };
|
|
17730
|
+
}
|
|
17731
|
+
if (typeof value === 'object' && 'startTime' in value) {
|
|
17732
|
+
const timeValue = value;
|
|
17733
|
+
if (!timeValue.startTime || !timeValue.startTime.trim()) {
|
|
17734
|
+
return { required: true };
|
|
17735
|
+
}
|
|
17736
|
+
if (!timeValue.endTime || !timeValue.endTime.trim()) {
|
|
17737
|
+
return { required: true };
|
|
17738
|
+
}
|
|
17739
|
+
return null;
|
|
17740
|
+
}
|
|
17741
|
+
return { required: true };
|
|
17742
|
+
};
|
|
17743
|
+
static requiredStartTime = (control) => {
|
|
17744
|
+
const value = control.value;
|
|
17745
|
+
if (!value || value.trim() === '') {
|
|
17746
|
+
return { required: true };
|
|
17747
|
+
}
|
|
17748
|
+
return null;
|
|
17749
|
+
};
|
|
17750
|
+
static requiredEndTime = (control) => {
|
|
17751
|
+
const value = control.value;
|
|
17752
|
+
if (!value || value.trim() === '') {
|
|
17753
|
+
return { required: true };
|
|
17754
|
+
}
|
|
17755
|
+
return null;
|
|
17756
|
+
};
|
|
17757
|
+
static noValidation = (control) => {
|
|
17758
|
+
return null;
|
|
17759
|
+
};
|
|
17760
|
+
static requiredBothSmart = (control) => {
|
|
17761
|
+
const value = control.value;
|
|
17762
|
+
if (!value) {
|
|
17763
|
+
return { required: true };
|
|
17764
|
+
}
|
|
17765
|
+
if (typeof value === 'string') {
|
|
17766
|
+
return value.trim() ? null : { required: true };
|
|
17767
|
+
}
|
|
17768
|
+
if (typeof value === 'object' && 'startTime' in value) {
|
|
17769
|
+
const timeValue = value;
|
|
17770
|
+
if (!timeValue.startTime || !timeValue.startTime.trim()) {
|
|
17771
|
+
return { required: true };
|
|
17772
|
+
}
|
|
17773
|
+
if (!timeValue.endTime || !timeValue.endTime.trim()) {
|
|
17774
|
+
if (!control.touched) {
|
|
17775
|
+
return null;
|
|
17776
|
+
}
|
|
17777
|
+
return { required: true };
|
|
17778
|
+
}
|
|
17779
|
+
return null;
|
|
17780
|
+
}
|
|
17781
|
+
return { required: true };
|
|
17782
|
+
};
|
|
17783
|
+
static endTimeAfterStart = (control) => {
|
|
17784
|
+
const value = control.value;
|
|
17785
|
+
if (!value || typeof value !== 'object' || !('startTime' in value)) {
|
|
17786
|
+
return null;
|
|
17787
|
+
}
|
|
17788
|
+
const timeValue = value;
|
|
17789
|
+
const { startTime, endTime } = timeValue;
|
|
17790
|
+
if (!startTime || !endTime) {
|
|
17791
|
+
return null;
|
|
17792
|
+
}
|
|
17793
|
+
if (!isTimeAfter(endTime, startTime)) {
|
|
17794
|
+
return { endTimeAfterStart: true };
|
|
17795
|
+
}
|
|
17796
|
+
return null;
|
|
17797
|
+
};
|
|
17798
|
+
static createValidator(includeEndTime, enforceEndTimeAfterStart = false) {
|
|
17799
|
+
return (control) => {
|
|
17800
|
+
const value = control.value;
|
|
17801
|
+
if (!value) {
|
|
17802
|
+
return { required: true };
|
|
17803
|
+
}
|
|
17804
|
+
if (!includeEndTime) {
|
|
17805
|
+
if (typeof value === 'string') {
|
|
17806
|
+
return value.trim() ? null : { required: true };
|
|
17807
|
+
}
|
|
17808
|
+
if (typeof value === 'object' && 'startTime' in value) {
|
|
17809
|
+
const timeValue = value;
|
|
17810
|
+
return timeValue.startTime && timeValue.startTime.trim() ? null : { required: true };
|
|
17811
|
+
}
|
|
17812
|
+
return { required: true };
|
|
17813
|
+
}
|
|
17814
|
+
if (typeof value === 'object' && 'startTime' in value) {
|
|
17815
|
+
const timeValue = value;
|
|
17816
|
+
if (!timeValue.startTime || !timeValue.startTime.trim()) {
|
|
17817
|
+
return { required: true };
|
|
17818
|
+
}
|
|
17819
|
+
if (control.touched || control.dirty) {
|
|
17820
|
+
if (!timeValue.endTime || !timeValue.endTime.trim()) {
|
|
17821
|
+
return { required: true };
|
|
17822
|
+
}
|
|
17823
|
+
if (enforceEndTimeAfterStart && !isTimeAfter(timeValue.endTime, timeValue.startTime)) {
|
|
17824
|
+
return { endTimeAfterStart: true };
|
|
17825
|
+
}
|
|
17826
|
+
}
|
|
17827
|
+
return null;
|
|
17828
|
+
}
|
|
17829
|
+
return { required: true };
|
|
17830
|
+
};
|
|
17831
|
+
}
|
|
17832
|
+
}
|
|
17833
|
+
function isTimeAfter(time1, time2) {
|
|
17834
|
+
if (!time1 || !time2)
|
|
17835
|
+
return false;
|
|
17836
|
+
const [hours1, minutes1] = time1.split(':').map(Number);
|
|
17837
|
+
const [hours2, minutes2] = time2.split(':').map(Number);
|
|
17838
|
+
const totalMinutes1 = hours1 * 60 + minutes1;
|
|
17839
|
+
const totalMinutes2 = hours2 * 60 + minutes2;
|
|
17840
|
+
return totalMinutes1 > totalMinutes2;
|
|
17841
|
+
}
|
|
17842
|
+
|
|
17654
17843
|
function HttpLoaderFactory(http) {
|
|
17655
17844
|
return new TranslateHttpLoader(http, './assets/i18n/', '/main.json');
|
|
17656
17845
|
}
|
|
@@ -17750,5 +17939,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
17750
17939
|
* Generated bundle index. Do not edit.
|
|
17751
17940
|
*/
|
|
17752
17941
|
|
|
17753
|
-
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 };
|
|
17942
|
+
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, TimeFieldValidators, 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 };
|
|
17754
17943
|
//# sourceMappingURL=solcre-org-core-ui.mjs.map
|