pjc-fields 0.0.25 → 0.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/pjc-fields.mjs +283 -5
- package/fesm2022/pjc-fields.mjs.map +1 -1
- package/package.json +1 -1
- package/types/pjc-fields.d.ts +87 -4
package/fesm2022/pjc-fields.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, input, forwardRef, ChangeDetectionStrategy, inject, ElementRef, output, Directive,
|
|
2
|
+
import { Component, input, forwardRef, ChangeDetectionStrategy, signal, computed, inject, ElementRef, output, Directive, ChangeDetectorRef, DestroyRef, Injectable, InjectionToken, effect } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { FormsModule, NG_VALUE_ACCESSOR, NG_VALIDATORS, ControlContainer } from '@angular/forms';
|
|
5
5
|
import * as i2 from 'primeng/inputmask';
|
|
@@ -22,6 +22,11 @@ import { InputNumberModule } from 'primeng/inputnumber';
|
|
|
22
22
|
import { KeyValuePipe } from '@angular/common';
|
|
23
23
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
24
24
|
import { merge } from 'rxjs';
|
|
25
|
+
import * as i2$4 from 'primeng/autocomplete';
|
|
26
|
+
import { AutoCompleteModule } from 'primeng/autocomplete';
|
|
27
|
+
import { HttpClient } from '@angular/common/http';
|
|
28
|
+
import { map } from 'rxjs/operators';
|
|
29
|
+
import * as i3$2 from 'primeng/api';
|
|
25
30
|
|
|
26
31
|
class PjcFields {
|
|
27
32
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcFields, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -764,8 +769,16 @@ class PjcDataFieldComponent {
|
|
|
764
769
|
maxDate = input(undefined, ...(ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []));
|
|
765
770
|
labelVariant = input('on', ...(ngDevMode ? [{ debugName: "labelVariant" }] : /* istanbul ignore next */ []));
|
|
766
771
|
readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
772
|
+
mostrarAniversario = input(false, ...(ngDevMode ? [{ debugName: "mostrarAniversario" }] : /* istanbul ignore next */ []));
|
|
767
773
|
value = null;
|
|
768
774
|
disabled = false;
|
|
775
|
+
valueSignal = signal(null, ...(ngDevMode ? [{ debugName: "valueSignal" }] : /* istanbul ignore next */ []));
|
|
776
|
+
age = computed(() => {
|
|
777
|
+
const date = this.valueSignal();
|
|
778
|
+
if (!date)
|
|
779
|
+
return null;
|
|
780
|
+
return this.calculateAge(date);
|
|
781
|
+
}, ...(ngDevMode ? [{ debugName: "age" }] : /* istanbul ignore next */ []));
|
|
769
782
|
onChange = () => { };
|
|
770
783
|
onTouched = () => { };
|
|
771
784
|
el = inject(ElementRef);
|
|
@@ -828,8 +841,18 @@ class PjcDataFieldComponent {
|
|
|
828
841
|
this.disabled = isDisabled;
|
|
829
842
|
}
|
|
830
843
|
onValueChange(date) {
|
|
844
|
+
this.valueSignal.set(date);
|
|
831
845
|
this.onChange(date);
|
|
832
846
|
}
|
|
847
|
+
calculateAge(birthDate) {
|
|
848
|
+
const today = new Date();
|
|
849
|
+
let age = today.getFullYear() - birthDate.getFullYear();
|
|
850
|
+
const monthDiff = today.getMonth() - birthDate.getMonth();
|
|
851
|
+
if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birthDate.getDate())) {
|
|
852
|
+
age--;
|
|
853
|
+
}
|
|
854
|
+
return age;
|
|
855
|
+
}
|
|
833
856
|
validate(_control) {
|
|
834
857
|
const value = this.value;
|
|
835
858
|
if (!value)
|
|
@@ -845,7 +868,7 @@ class PjcDataFieldComponent {
|
|
|
845
868
|
return null;
|
|
846
869
|
}
|
|
847
870
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcDataFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
848
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: PjcDataFieldComponent, isStandalone: true, selector: "pjc-data-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, labelVariant: { classPropertyName: "labelVariant", publicName: "labelVariant", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
871
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: PjcDataFieldComponent, isStandalone: true, selector: "pjc-data-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, labelVariant: { classPropertyName: "labelVariant", publicName: "labelVariant", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, mostrarAniversario: { classPropertyName: "mostrarAniversario", publicName: "mostrarAniversario", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
849
872
|
{
|
|
850
873
|
provide: NG_VALUE_ACCESSOR,
|
|
851
874
|
useExisting: forwardRef(() => PjcDataFieldComponent),
|
|
@@ -856,7 +879,7 @@ class PjcDataFieldComponent {
|
|
|
856
879
|
useExisting: forwardRef(() => PjcDataFieldComponent),
|
|
857
880
|
multi: true,
|
|
858
881
|
},
|
|
859
|
-
], ngImport: i0, template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label()) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <p-datePicker\n [inputId]=\"id()\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onValueChange($event)\"\n (onBlur)=\"onTouched()\"\n dateFormat=\"dd/mm/yy\"\n [showIcon]=\"true\"\n [showClear]=\"true\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [disabled]=\"disabled\"\n [readonlyInput]=\"readonly()\"\n placeholder=\"dd/mm/aaaa\"\n appendTo=\"body\"\n class=\"w-full\"\n inputStyleClass=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500\"\n ></p-datePicker>\n <label [for]=\"id()\">{{ label() }}</label>\n </p-floatlabel>\n } @else {\n <p-datePicker\n [inputId]=\"id()\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onValueChange($event)\"\n (onBlur)=\"onTouched()\"\n dateFormat=\"dd/mm/yy\"\n [showIcon]=\"true\"\n [showClear]=\"true\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n placeholder=\"dd/mm/aaaa\"\n appendTo=\"body\"\n class=\"w-full\"\n inputStyleClass=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500\"\n ></p-datePicker>\n }\n\n <ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: DatePickerModule }, { kind: "component", type: i2$1.DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "styleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "readonlyInput", "shortYearCutoff", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "view", "defaultDate", "appendTo", "motionOptions"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i3.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
882
|
+
], ngImport: i0, template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label()) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <p-datePicker\n [inputId]=\"id()\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onValueChange($event)\"\n (onBlur)=\"onTouched()\"\n dateFormat=\"dd/mm/yy\"\n [showIcon]=\"true\"\n [showClear]=\"true\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [disabled]=\"disabled\"\n [readonlyInput]=\"readonly()\"\n placeholder=\"dd/mm/aaaa\"\n appendTo=\"body\"\n class=\"w-full\"\n inputStyleClass=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500\"\n ></p-datePicker>\n <label [for]=\"id()\">{{ label() }}</label>\n </p-floatlabel>\n } @else {\n <p-datePicker\n [inputId]=\"id()\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onValueChange($event)\"\n (onBlur)=\"onTouched()\"\n dateFormat=\"dd/mm/yy\"\n [showIcon]=\"true\"\n [showClear]=\"true\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n placeholder=\"dd/mm/aaaa\"\n appendTo=\"body\"\n class=\"w-full\"\n inputStyleClass=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500\"\n ></p-datePicker>\n }\n\n @if (mostrarAniversario() && age()) {\n <p class=\"text-xs text-surface-600\">Idade: {{ age() }} {{ age() === 1 ? 'ano' : 'anos' }}</p>\n }\n\n <ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: DatePickerModule }, { kind: "component", type: i2$1.DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "styleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "readonlyInput", "shortYearCutoff", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "view", "defaultDate", "appendTo", "motionOptions"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i3.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
860
883
|
}
|
|
861
884
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcDataFieldComponent, decorators: [{
|
|
862
885
|
type: Component,
|
|
@@ -871,7 +894,129 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
871
894
|
useExisting: forwardRef(() => PjcDataFieldComponent),
|
|
872
895
|
multi: true,
|
|
873
896
|
},
|
|
874
|
-
], template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label()) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <p-datePicker\n [inputId]=\"id()\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onValueChange($event)\"\n (onBlur)=\"onTouched()\"\n dateFormat=\"dd/mm/yy\"\n [showIcon]=\"true\"\n [showClear]=\"true\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [disabled]=\"disabled\"\n [readonlyInput]=\"readonly()\"\n placeholder=\"dd/mm/aaaa\"\n appendTo=\"body\"\n class=\"w-full\"\n inputStyleClass=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500\"\n ></p-datePicker>\n <label [for]=\"id()\">{{ label() }}</label>\n </p-floatlabel>\n } @else {\n <p-datePicker\n [inputId]=\"id()\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onValueChange($event)\"\n (onBlur)=\"onTouched()\"\n dateFormat=\"dd/mm/yy\"\n [showIcon]=\"true\"\n [showClear]=\"true\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n placeholder=\"dd/mm/aaaa\"\n appendTo=\"body\"\n class=\"w-full\"\n inputStyleClass=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500\"\n ></p-datePicker>\n }\n\n <ng-content></ng-content>\n</div>\n" }]
|
|
897
|
+
], template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label()) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <p-datePicker\n [inputId]=\"id()\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onValueChange($event)\"\n (onBlur)=\"onTouched()\"\n dateFormat=\"dd/mm/yy\"\n [showIcon]=\"true\"\n [showClear]=\"true\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [disabled]=\"disabled\"\n [readonlyInput]=\"readonly()\"\n placeholder=\"dd/mm/aaaa\"\n appendTo=\"body\"\n class=\"w-full\"\n inputStyleClass=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500\"\n ></p-datePicker>\n <label [for]=\"id()\">{{ label() }}</label>\n </p-floatlabel>\n } @else {\n <p-datePicker\n [inputId]=\"id()\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onValueChange($event)\"\n (onBlur)=\"onTouched()\"\n dateFormat=\"dd/mm/yy\"\n [showIcon]=\"true\"\n [showClear]=\"true\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n placeholder=\"dd/mm/aaaa\"\n appendTo=\"body\"\n class=\"w-full\"\n inputStyleClass=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500\"\n ></p-datePicker>\n }\n\n @if (mostrarAniversario() && age()) {\n <p class=\"text-xs text-surface-600\">Idade: {{ age() }} {{ age() === 1 ? 'ano' : 'anos' }}</p>\n }\n\n <ng-content></ng-content>\n</div>\n" }]
|
|
898
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], labelVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelVariant", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], mostrarAniversario: [{ type: i0.Input, args: [{ isSignal: true, alias: "mostrarAniversario", required: false }] }] } });
|
|
899
|
+
|
|
900
|
+
class PjcDataHoraFieldComponent {
|
|
901
|
+
label = input('Data e Hora', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
902
|
+
id = input(`pjc-data-hora-${Math.random().toString(36).substring(2, 9)}`, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
903
|
+
minDate = input(undefined, ...(ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []));
|
|
904
|
+
maxDate = input(undefined, ...(ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []));
|
|
905
|
+
labelVariant = input('on', ...(ngDevMode ? [{ debugName: "labelVariant" }] : /* istanbul ignore next */ []));
|
|
906
|
+
readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
907
|
+
value = null;
|
|
908
|
+
disabled = false;
|
|
909
|
+
onChange = () => { };
|
|
910
|
+
onTouched = () => { };
|
|
911
|
+
el = inject(ElementRef);
|
|
912
|
+
isFormatting = false;
|
|
913
|
+
ngAfterViewInit() {
|
|
914
|
+
const input = this.el.nativeElement.querySelector('input');
|
|
915
|
+
if (input) {
|
|
916
|
+
input.addEventListener('input', this.handleDateInput);
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
ngOnDestroy() {
|
|
920
|
+
const input = this.el.nativeElement.querySelector('input');
|
|
921
|
+
if (input) {
|
|
922
|
+
input.removeEventListener('input', this.handleDateInput);
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
handleDateInput = (event) => {
|
|
926
|
+
if (this.isFormatting)
|
|
927
|
+
return;
|
|
928
|
+
const input = event.target;
|
|
929
|
+
const raw = input.value;
|
|
930
|
+
const cursor = input.selectionStart ?? raw.length;
|
|
931
|
+
const digits = raw.replace(/\D/g, '').substring(0, 12);
|
|
932
|
+
let formatted = digits;
|
|
933
|
+
if (digits.length > 2) {
|
|
934
|
+
formatted = `${digits.substring(0, 2)}/${digits.substring(2)}`;
|
|
935
|
+
}
|
|
936
|
+
if (digits.length > 4) {
|
|
937
|
+
formatted = `${digits.substring(0, 2)}/${digits.substring(2, 4)}/${digits.substring(4)}`;
|
|
938
|
+
}
|
|
939
|
+
if (digits.length > 8) {
|
|
940
|
+
formatted = `${digits.substring(0, 2)}/${digits.substring(2, 4)}/${digits.substring(4, 8)} ${digits.substring(8)}`;
|
|
941
|
+
}
|
|
942
|
+
if (digits.length > 10) {
|
|
943
|
+
formatted = `${digits.substring(0, 2)}/${digits.substring(2, 4)}/${digits.substring(4, 8)} ${digits.substring(8, 10)}:${digits.substring(10)}`;
|
|
944
|
+
}
|
|
945
|
+
if (raw === formatted)
|
|
946
|
+
return;
|
|
947
|
+
const digitsBeforeCursor = raw.substring(0, cursor).replace(/\D/g, '').length;
|
|
948
|
+
this.isFormatting = true;
|
|
949
|
+
input.value = formatted;
|
|
950
|
+
this.isFormatting = false;
|
|
951
|
+
let newCursor = 0;
|
|
952
|
+
let digitCount = 0;
|
|
953
|
+
for (let i = 0; i < formatted.length; i++) {
|
|
954
|
+
if (/\d/.test(formatted[i]))
|
|
955
|
+
digitCount++;
|
|
956
|
+
if (digitCount === digitsBeforeCursor) {
|
|
957
|
+
newCursor = i + 1;
|
|
958
|
+
break;
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
input.setSelectionRange(newCursor, newCursor);
|
|
962
|
+
};
|
|
963
|
+
writeValue(val) {
|
|
964
|
+
this.value = val ?? null;
|
|
965
|
+
}
|
|
966
|
+
registerOnChange(fn) {
|
|
967
|
+
this.onChange = fn;
|
|
968
|
+
}
|
|
969
|
+
registerOnTouched(fn) {
|
|
970
|
+
this.onTouched = fn;
|
|
971
|
+
}
|
|
972
|
+
setDisabledState(isDisabled) {
|
|
973
|
+
this.disabled = isDisabled;
|
|
974
|
+
}
|
|
975
|
+
onValueChange(date) {
|
|
976
|
+
this.onChange(date);
|
|
977
|
+
}
|
|
978
|
+
validate(_control) {
|
|
979
|
+
const value = this.value;
|
|
980
|
+
if (!value)
|
|
981
|
+
return null;
|
|
982
|
+
const minDate = this.minDate();
|
|
983
|
+
if (minDate && value < minDate) {
|
|
984
|
+
return { dataMinima: { min: minDate, atual: value } };
|
|
985
|
+
}
|
|
986
|
+
const maxDate = this.maxDate();
|
|
987
|
+
if (maxDate && value > maxDate) {
|
|
988
|
+
return { dataMaxima: { max: maxDate, atual: value } };
|
|
989
|
+
}
|
|
990
|
+
return null;
|
|
991
|
+
}
|
|
992
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcDataHoraFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
993
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: PjcDataHoraFieldComponent, isStandalone: true, selector: "pjc-data-hora-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, labelVariant: { classPropertyName: "labelVariant", publicName: "labelVariant", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
994
|
+
{
|
|
995
|
+
provide: NG_VALUE_ACCESSOR,
|
|
996
|
+
useExisting: forwardRef(() => PjcDataHoraFieldComponent),
|
|
997
|
+
multi: true,
|
|
998
|
+
},
|
|
999
|
+
{
|
|
1000
|
+
provide: NG_VALIDATORS,
|
|
1001
|
+
useExisting: forwardRef(() => PjcDataHoraFieldComponent),
|
|
1002
|
+
multi: true,
|
|
1003
|
+
},
|
|
1004
|
+
], ngImport: i0, template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label()) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <p-datePicker\n [inputId]=\"id()\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onValueChange($event)\"\n (onBlur)=\"onTouched()\"\n dateFormat=\"dd/mm/yy\"\n [showTime]=\"true\"\n [hourFormat]=\"'24'\"\n [showIcon]=\"true\"\n [showClear]=\"true\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [disabled]=\"disabled\"\n [readonlyInput]=\"readonly()\"\n placeholder=\"dd/mm/aaaa HH:MM\"\n appendTo=\"body\"\n class=\"w-full\"\n inputStyleClass=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500\"\n ></p-datePicker>\n <label [for]=\"id()\">{{ label() }}</label>\n </p-floatlabel>\n } @else {\n <p-datePicker\n [inputId]=\"id()\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onValueChange($event)\"\n (onBlur)=\"onTouched()\"\n dateFormat=\"dd/mm/yy\"\n [showTime]=\"true\"\n [hourFormat]=\"'24'\"\n [showIcon]=\"true\"\n [showClear]=\"true\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [disabled]=\"disabled\"\n [readonlyInput]=\"readonly()\"\n placeholder=\"dd/mm/aaaa HH:MM\"\n appendTo=\"body\"\n class=\"w-full\"\n inputStyleClass=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500\"\n ></p-datePicker>\n }\n\n <ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: DatePickerModule }, { kind: "component", type: i2$1.DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "styleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "readonlyInput", "shortYearCutoff", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "view", "defaultDate", "appendTo", "motionOptions"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i3.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1005
|
+
}
|
|
1006
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcDataHoraFieldComponent, decorators: [{
|
|
1007
|
+
type: Component,
|
|
1008
|
+
args: [{ selector: 'pjc-data-hora-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [FormsModule, DatePickerModule, FloatLabelModule], providers: [
|
|
1009
|
+
{
|
|
1010
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1011
|
+
useExisting: forwardRef(() => PjcDataHoraFieldComponent),
|
|
1012
|
+
multi: true,
|
|
1013
|
+
},
|
|
1014
|
+
{
|
|
1015
|
+
provide: NG_VALIDATORS,
|
|
1016
|
+
useExisting: forwardRef(() => PjcDataHoraFieldComponent),
|
|
1017
|
+
multi: true,
|
|
1018
|
+
},
|
|
1019
|
+
], template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label()) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <p-datePicker\n [inputId]=\"id()\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onValueChange($event)\"\n (onBlur)=\"onTouched()\"\n dateFormat=\"dd/mm/yy\"\n [showTime]=\"true\"\n [hourFormat]=\"'24'\"\n [showIcon]=\"true\"\n [showClear]=\"true\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [disabled]=\"disabled\"\n [readonlyInput]=\"readonly()\"\n placeholder=\"dd/mm/aaaa HH:MM\"\n appendTo=\"body\"\n class=\"w-full\"\n inputStyleClass=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500\"\n ></p-datePicker>\n <label [for]=\"id()\">{{ label() }}</label>\n </p-floatlabel>\n } @else {\n <p-datePicker\n [inputId]=\"id()\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onValueChange($event)\"\n (onBlur)=\"onTouched()\"\n dateFormat=\"dd/mm/yy\"\n [showTime]=\"true\"\n [hourFormat]=\"'24'\"\n [showIcon]=\"true\"\n [showClear]=\"true\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [disabled]=\"disabled\"\n [readonlyInput]=\"readonly()\"\n placeholder=\"dd/mm/aaaa HH:MM\"\n appendTo=\"body\"\n class=\"w-full\"\n inputStyleClass=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500\"\n ></p-datePicker>\n }\n\n <ng-content></ng-content>\n</div>\n" }]
|
|
875
1020
|
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], labelVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelVariant", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }] } });
|
|
876
1021
|
|
|
877
1022
|
class PjcHoraFieldComponent {
|
|
@@ -1084,6 +1229,7 @@ const ESTADOS = [
|
|
|
1084
1229
|
{ uf: 'SE', descricao: 'Sergipe' },
|
|
1085
1230
|
{ uf: 'TO', descricao: 'Tocantins' },
|
|
1086
1231
|
];
|
|
1232
|
+
|
|
1087
1233
|
class PjcUfFieldComponent {
|
|
1088
1234
|
label = input('UF', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1089
1235
|
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
@@ -1693,6 +1839,138 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1693
1839
|
args: [{ selector: 'pjc-erro-validacao', changeDetection: ChangeDetectionStrategy.OnPush, imports: [KeyValuePipe], template: "@if (control; as ctrl) {\n @if (ctrl.touched && ctrl.errors) {\n @for (entry of erros() | keyvalue; track entry.key) {\n @if (ctrl.errors[entry.key]) {\n <small class=\"text-red-500 text-xs\">{{ entry.value }}</small>\n }\n }\n }\n}\n" }]
|
|
1694
1840
|
}], propDecorators: { controlName: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlName", required: true }] }], erros: [{ type: i0.Input, args: [{ isSignal: true, alias: "erros", required: true }] }] } });
|
|
1695
1841
|
|
|
1842
|
+
class PjcCidadeService {
|
|
1843
|
+
http = inject(HttpClient);
|
|
1844
|
+
API_URL = 'https://servicodados.ibge.gov.br/api/v1/localidades/estados';
|
|
1845
|
+
getMunicipiosByUf(uf) {
|
|
1846
|
+
return this.http
|
|
1847
|
+
.get(`${this.API_URL}/${uf}/municipios`)
|
|
1848
|
+
.pipe(map((data) => data
|
|
1849
|
+
.map((m) => ({ id: m.id, nome: m.nome, descricao: m.descricao }))
|
|
1850
|
+
.sort((a, b) => {
|
|
1851
|
+
const aDisplay = a.nome || a.descricao || '';
|
|
1852
|
+
const bDisplay = b.nome || b.descricao || '';
|
|
1853
|
+
return aDisplay.localeCompare(bDisplay);
|
|
1854
|
+
})));
|
|
1855
|
+
}
|
|
1856
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcCidadeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1857
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcCidadeService, providedIn: 'root' });
|
|
1858
|
+
}
|
|
1859
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcCidadeService, decorators: [{
|
|
1860
|
+
type: Injectable,
|
|
1861
|
+
args: [{
|
|
1862
|
+
providedIn: 'root',
|
|
1863
|
+
}]
|
|
1864
|
+
}] });
|
|
1865
|
+
|
|
1866
|
+
const PJC_CIDADE_SERVICE = new InjectionToken('PjcCidadeService');
|
|
1867
|
+
|
|
1868
|
+
class PjcCidadeFieldComponent {
|
|
1869
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1870
|
+
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
1871
|
+
placeholder = input('Digite o nome da cidade', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
1872
|
+
id = input(`pjc-cidade-${Math.random().toString(36).substring(2, 9)}`, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
1873
|
+
labelVariant = input('on', ...(ngDevMode ? [{ debugName: "labelVariant" }] : /* istanbul ignore next */ []));
|
|
1874
|
+
readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
1875
|
+
uf = input('', ...(ngDevMode ? [{ debugName: "uf" }] : /* istanbul ignore next */ []));
|
|
1876
|
+
service = inject(PJC_CIDADE_SERVICE, { optional: true }) ?? inject(PjcCidadeService);
|
|
1877
|
+
municipios = signal([], ...(ngDevMode ? [{ debugName: "municipios" }] : /* istanbul ignore next */ []));
|
|
1878
|
+
filteredMunicipios = signal([], ...(ngDevMode ? [{ debugName: "filteredMunicipios" }] : /* istanbul ignore next */ []));
|
|
1879
|
+
loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
1880
|
+
value = null;
|
|
1881
|
+
disabled = false;
|
|
1882
|
+
onChange = () => { };
|
|
1883
|
+
onTouched = () => { };
|
|
1884
|
+
constructor() {
|
|
1885
|
+
effect(() => {
|
|
1886
|
+
const uf = this.uf();
|
|
1887
|
+
if (uf) {
|
|
1888
|
+
this.fetchMunicipios(uf);
|
|
1889
|
+
}
|
|
1890
|
+
else {
|
|
1891
|
+
this.municipios.set([]);
|
|
1892
|
+
this.filteredMunicipios.set([]);
|
|
1893
|
+
}
|
|
1894
|
+
});
|
|
1895
|
+
}
|
|
1896
|
+
writeValue(val) {
|
|
1897
|
+
if (val === null || val === undefined) {
|
|
1898
|
+
this.value = null;
|
|
1899
|
+
}
|
|
1900
|
+
else if (typeof val === 'string') {
|
|
1901
|
+
const found = this.municipios().find(m => m.nome === val || m.descricao === val);
|
|
1902
|
+
this.value = found ?? { id: 0, nome: val };
|
|
1903
|
+
}
|
|
1904
|
+
else {
|
|
1905
|
+
this.value = val;
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
registerOnChange(fn) {
|
|
1909
|
+
this.onChange = fn;
|
|
1910
|
+
}
|
|
1911
|
+
registerOnTouched(fn) {
|
|
1912
|
+
this.onTouched = fn;
|
|
1913
|
+
}
|
|
1914
|
+
setDisabledState(isDisabled) {
|
|
1915
|
+
this.disabled = isDisabled;
|
|
1916
|
+
}
|
|
1917
|
+
onModelChange(value) {
|
|
1918
|
+
if (typeof value === 'string') {
|
|
1919
|
+
this.value = null;
|
|
1920
|
+
this.onChange(null);
|
|
1921
|
+
}
|
|
1922
|
+
else {
|
|
1923
|
+
this.value = value;
|
|
1924
|
+
this.onChange(value);
|
|
1925
|
+
}
|
|
1926
|
+
}
|
|
1927
|
+
onModelTouched() {
|
|
1928
|
+
this.onTouched();
|
|
1929
|
+
}
|
|
1930
|
+
getMunicipioDisplay(m) {
|
|
1931
|
+
return m.nome || m.descricao || '';
|
|
1932
|
+
}
|
|
1933
|
+
filterMunicipios(event) {
|
|
1934
|
+
const query = event.query.toLowerCase();
|
|
1935
|
+
this.filteredMunicipios.set(this.municipios().filter(m => this.getMunicipioDisplay(m).toLowerCase().includes(query)));
|
|
1936
|
+
}
|
|
1937
|
+
fetchMunicipios(uf) {
|
|
1938
|
+
this.loading.set(true);
|
|
1939
|
+
this.value = null;
|
|
1940
|
+
this.onChange(null);
|
|
1941
|
+
this.service.getMunicipiosByUf(uf).subscribe({
|
|
1942
|
+
next: (data) => {
|
|
1943
|
+
this.municipios.set(data);
|
|
1944
|
+
this.filteredMunicipios.set(data);
|
|
1945
|
+
this.loading.set(false);
|
|
1946
|
+
},
|
|
1947
|
+
error: () => {
|
|
1948
|
+
this.municipios.set([]);
|
|
1949
|
+
this.filteredMunicipios.set([]);
|
|
1950
|
+
this.loading.set(false);
|
|
1951
|
+
},
|
|
1952
|
+
});
|
|
1953
|
+
}
|
|
1954
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcCidadeFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1955
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: PjcCidadeFieldComponent, isStandalone: true, selector: "pjc-cidade-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, labelVariant: { classPropertyName: "labelVariant", publicName: "labelVariant", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, uf: { classPropertyName: "uf", publicName: "uf", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
1956
|
+
{
|
|
1957
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1958
|
+
useExisting: forwardRef(() => PjcCidadeFieldComponent),
|
|
1959
|
+
multi: true,
|
|
1960
|
+
},
|
|
1961
|
+
], ngImport: i0, template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label()) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <p-autocomplete\n [inputId]=\"id()\"\n [suggestions]=\"filteredMunicipios()\"\n [ngModel]=\"value\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onModelTouched()\"\n (completeMethod)=\"filterMunicipios($event)\"\n dataKey=\"id\"\n [forceSelection]=\"true\"\n [disabled]=\"disabled || readonly() || !uf() || loading()\"\n appendTo=\"body\"\n styleClass=\"w-full\"\n inputStyleClass=\"w-full\"\n >\n <ng-template pTemplate=\"item\" let-option>\n {{ getMunicipioDisplay(option) }}\n </ng-template>\n </p-autocomplete>\n <label [for]=\"id()\">{{ label() }}</label>\n </p-floatlabel>\n } @else {\n <p-autocomplete\n [inputId]=\"id()\"\n [suggestions]=\"filteredMunicipios()\"\n [ngModel]=\"value\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onModelTouched()\"\n (completeMethod)=\"filterMunicipios($event)\"\n dataKey=\"id\"\n [forceSelection]=\"true\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled || readonly() || !uf() || loading()\"\n appendTo=\"body\"\n styleClass=\"w-full\"\n inputStyleClass=\"w-full\"\n >\n <ng-template pTemplate=\"item\" let-option>\n {{ getMunicipioDisplay(option) }}\n </ng-template>\n </p-autocomplete>\n }\n\n @if (hint()) {\n <small class=\"text-xs text-surface-500\">{{ hint() }}</small>\n }\n\n <ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AutoCompleteModule }, { kind: "component", type: i2$4.AutoComplete, selector: "p-autoComplete, p-autocomplete, p-auto-complete", inputs: ["minLength", "minQueryLength", "delay", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "showClear", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "addOnTab", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "overlayOptions", "suggestions", "optionLabel", "optionValue", "id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "selectOnFocus", "searchLocale", "optionDisabled", "focusOnHover", "typeahead", "addOnBlur", "separator", "appendTo", "motionOptions"], outputs: ["completeMethod", "onSelect", "onUnselect", "onAdd", "onFocus", "onBlur", "onDropdownClick", "onClear", "onInputKeydown", "onKeyUp", "onShow", "onHide", "onLazyLoad"] }, { kind: "directive", type: i3$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i3.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1962
|
+
}
|
|
1963
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcCidadeFieldComponent, decorators: [{
|
|
1964
|
+
type: Component,
|
|
1965
|
+
args: [{ selector: 'pjc-cidade-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [FormsModule, AutoCompleteModule, FloatLabelModule], providers: [
|
|
1966
|
+
{
|
|
1967
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1968
|
+
useExisting: forwardRef(() => PjcCidadeFieldComponent),
|
|
1969
|
+
multi: true,
|
|
1970
|
+
},
|
|
1971
|
+
], template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label()) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <p-autocomplete\n [inputId]=\"id()\"\n [suggestions]=\"filteredMunicipios()\"\n [ngModel]=\"value\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onModelTouched()\"\n (completeMethod)=\"filterMunicipios($event)\"\n dataKey=\"id\"\n [forceSelection]=\"true\"\n [disabled]=\"disabled || readonly() || !uf() || loading()\"\n appendTo=\"body\"\n styleClass=\"w-full\"\n inputStyleClass=\"w-full\"\n >\n <ng-template pTemplate=\"item\" let-option>\n {{ getMunicipioDisplay(option) }}\n </ng-template>\n </p-autocomplete>\n <label [for]=\"id()\">{{ label() }}</label>\n </p-floatlabel>\n } @else {\n <p-autocomplete\n [inputId]=\"id()\"\n [suggestions]=\"filteredMunicipios()\"\n [ngModel]=\"value\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onModelTouched()\"\n (completeMethod)=\"filterMunicipios($event)\"\n dataKey=\"id\"\n [forceSelection]=\"true\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled || readonly() || !uf() || loading()\"\n appendTo=\"body\"\n styleClass=\"w-full\"\n inputStyleClass=\"w-full\"\n >\n <ng-template pTemplate=\"item\" let-option>\n {{ getMunicipioDisplay(option) }}\n </ng-template>\n </p-autocomplete>\n }\n\n @if (hint()) {\n <small class=\"text-xs text-surface-500\">{{ hint() }}</small>\n }\n\n <ng-content></ng-content>\n</div>\n" }]
|
|
1972
|
+
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], labelVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelVariant", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], uf: [{ type: i0.Input, args: [{ isSignal: true, alias: "uf", required: false }] }] } });
|
|
1973
|
+
|
|
1696
1974
|
/*
|
|
1697
1975
|
* Public API Surface of pjc-fields
|
|
1698
1976
|
*/
|
|
@@ -1701,5 +1979,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1701
1979
|
* Generated bundle index. Do not edit.
|
|
1702
1980
|
*/
|
|
1703
1981
|
|
|
1704
|
-
export { PjcCepFieldComponent, PjcChassiFieldComponent, PjcChassiInputDirective, PjcCnhFieldComponent, PjcCnpjFieldComponent, PjcCpfCnpjFieldComponent, PjcCpfFieldComponent, PjcDataFieldComponent, PjcEmailFieldComponent, PjcErroValidacaoComponent, PjcFields, PjcHoraFieldComponent, PjcIntegerFieldComponent, PjcMoedaFieldComponent, PjcNumeroCartaoFieldComponent, PjcPasswordFieldComponent, PjcPlacaFieldComponent, PjcRenavamFieldComponent, PjcTelefoneFieldComponent, PjcUfFieldComponent, PjcUppercaseFieldComponent, PjcValidators };
|
|
1982
|
+
export { ESTADOS, PJC_CIDADE_SERVICE, PjcCepFieldComponent, PjcChassiFieldComponent, PjcChassiInputDirective, PjcCidadeFieldComponent, PjcCidadeService, PjcCnhFieldComponent, PjcCnpjFieldComponent, PjcCpfCnpjFieldComponent, PjcCpfFieldComponent, PjcDataFieldComponent, PjcDataHoraFieldComponent, PjcEmailFieldComponent, PjcErroValidacaoComponent, PjcFields, PjcHoraFieldComponent, PjcIntegerFieldComponent, PjcMoedaFieldComponent, PjcNumeroCartaoFieldComponent, PjcPasswordFieldComponent, PjcPlacaFieldComponent, PjcRenavamFieldComponent, PjcTelefoneFieldComponent, PjcUfFieldComponent, PjcUppercaseFieldComponent, PjcValidators };
|
|
1705
1983
|
//# sourceMappingURL=pjc-fields.mjs.map
|