pjc-fields 0.0.8 → 0.0.10
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 +129 -111
- package/fesm2022/pjc-fields.mjs.map +1 -1
- package/package.json +1 -1
- package/types/pjc-fields.d.ts +80 -76
package/fesm2022/pjc-fields.mjs
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, input, forwardRef, ChangeDetectionStrategy,
|
|
2
|
+
import { Component, input, forwardRef, ChangeDetectionStrategy, inject, ElementRef, output } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { FormsModule, NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
|
|
5
5
|
import * as i2 from 'primeng/inputmask';
|
|
6
6
|
import { InputMaskModule } from 'primeng/inputmask';
|
|
7
7
|
import * as i3 from 'primeng/floatlabel';
|
|
8
8
|
import { FloatLabelModule } from 'primeng/floatlabel';
|
|
9
|
-
import { CommonModule } from '@angular/common';
|
|
10
9
|
import * as i2$1 from 'primeng/inputtext';
|
|
11
10
|
import { InputTextModule } from 'primeng/inputtext';
|
|
12
11
|
import * as i2$2 from 'primeng/datepicker';
|
|
@@ -153,6 +152,14 @@ class PjcValidators {
|
|
|
153
152
|
return emailRegex.test(value) ? null : { emailInvalido: true };
|
|
154
153
|
};
|
|
155
154
|
}
|
|
155
|
+
static cep() {
|
|
156
|
+
return (control) => {
|
|
157
|
+
const digits = control.value?.replace(/\D/g, '');
|
|
158
|
+
if (!digits)
|
|
159
|
+
return null;
|
|
160
|
+
return digits.length === 8 ? null : { cepInvalido: true };
|
|
161
|
+
};
|
|
162
|
+
}
|
|
156
163
|
}
|
|
157
164
|
|
|
158
165
|
class PjcCpfFieldComponent {
|
|
@@ -280,8 +287,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
280
287
|
}], 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 }] }] } });
|
|
281
288
|
|
|
282
289
|
class PjcCpfCnpjFieldComponent {
|
|
283
|
-
label = 'CPF/CNPJ';
|
|
284
|
-
id = `pjc-cpf-cnpj-${Math.random().toString(36).substring(2, 9)}
|
|
290
|
+
label = input('CPF/CNPJ', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
291
|
+
id = input(`pjc-cpf-cnpj-${Math.random().toString(36).substring(2, 9)}`, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
285
292
|
labelVariant = input('over', ...(ngDevMode ? [{ debugName: "labelVariant" }] : /* istanbul ignore next */ []));
|
|
286
293
|
displayValue = '';
|
|
287
294
|
placeholder = '000.000.000-00';
|
|
@@ -306,13 +313,21 @@ class PjcCpfCnpjFieldComponent {
|
|
|
306
313
|
onInputChange(event) {
|
|
307
314
|
const input = event.target;
|
|
308
315
|
const cursorPos = input.selectionStart ?? 0;
|
|
309
|
-
const
|
|
316
|
+
const digitsBeforeCursor = input.value.substring(0, cursorPos).replace(/\D/g, '').length;
|
|
310
317
|
this.rawValue = input.value.replaceAll(/\D/g, '').substring(0, 14);
|
|
311
318
|
this.displayValue = this.formatValue(this.rawValue);
|
|
312
319
|
this.updatePlaceholder();
|
|
313
320
|
this.onChange(this.rawValue);
|
|
314
|
-
|
|
315
|
-
|
|
321
|
+
let newCursor = this.displayValue.length;
|
|
322
|
+
let digitCount = 0;
|
|
323
|
+
for (let i = 0; i < this.displayValue.length; i++) {
|
|
324
|
+
if (/\d/.test(this.displayValue[i]))
|
|
325
|
+
digitCount++;
|
|
326
|
+
if (digitCount === digitsBeforeCursor) {
|
|
327
|
+
newCursor = i + 1;
|
|
328
|
+
break;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
316
331
|
setTimeout(() => input.setSelectionRange(newCursor, newCursor));
|
|
317
332
|
}
|
|
318
333
|
onModelTouched() {
|
|
@@ -345,7 +360,7 @@ class PjcCpfCnpjFieldComponent {
|
|
|
345
360
|
return PjcValidators.cpfCnpj()(control);
|
|
346
361
|
}
|
|
347
362
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcCpfCnpjFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
348
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: PjcCpfCnpjFieldComponent, isStandalone: true, selector: "pjc-cpf-cnpj-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal:
|
|
363
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: PjcCpfCnpjFieldComponent, isStandalone: true, selector: "pjc-cpf-cnpj-field", inputs: { label: { classPropertyName: "label", publicName: "label", 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 } }, providers: [
|
|
349
364
|
{
|
|
350
365
|
provide: NG_VALUE_ACCESSOR,
|
|
351
366
|
useExisting: forwardRef(() => PjcCpfCnpjFieldComponent),
|
|
@@ -356,11 +371,11 @@ class PjcCpfCnpjFieldComponent {
|
|
|
356
371
|
useExisting: forwardRef(() => PjcCpfCnpjFieldComponent),
|
|
357
372
|
multi: true,
|
|
358
373
|
},
|
|
359
|
-
], ngImport: i0, template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <input\n pInputText\n [id]=\"id\"\n [value]=\"displayValue\"\n (input)=\"onInputChange($event)\"\n (blur)=\"onModelTouched()\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n maxlength=\"18\"\n class=\"w-full p-2 outline-none bg-transparent border border-surface-300 rounded-md focus:border-primary-500\"\n />\n <label [for]=\"id\">{{ label }}</label>\n </p-floatlabel>\n } @else {\n <input\n pInputText\n [id]=\"id\"\n [value]=\"displayValue\"\n (input)=\"onInputChange($event)\"\n (blur)=\"onModelTouched()\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n maxlength=\"18\"\n class=\"w-full p-2 outline-none bg-transparent border border-surface-300 rounded-md focus:border-primary-500\"\n />\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type:
|
|
374
|
+
], ngImport: i0, template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label()) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <input\n pInputText\n [id]=\"id()\"\n [value]=\"displayValue\"\n (input)=\"onInputChange($event)\"\n (blur)=\"onModelTouched()\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n maxlength=\"18\"\n class=\"w-full p-2 outline-none bg-transparent border border-surface-300 rounded-md focus:border-primary-500\"\n />\n <label [for]=\"id()\">{{ label() }}</label>\n </p-floatlabel>\n } @else {\n <input\n pInputText\n [id]=\"id()\"\n [value]=\"displayValue\"\n (input)=\"onInputChange($event)\"\n (blur)=\"onModelTouched()\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n maxlength=\"18\"\n class=\"w-full p-2 outline-none bg-transparent border border-surface-300 rounded-md focus:border-primary-500\"\n />\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i3.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i2$1.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
360
375
|
}
|
|
361
376
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcCpfCnpjFieldComponent, decorators: [{
|
|
362
377
|
type: Component,
|
|
363
|
-
args: [{ selector: 'pjc-cpf-cnpj-field', imports: [
|
|
378
|
+
args: [{ selector: 'pjc-cpf-cnpj-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [FormsModule, FloatLabelModule, InputTextModule], providers: [
|
|
364
379
|
{
|
|
365
380
|
provide: NG_VALUE_ACCESSOR,
|
|
366
381
|
useExisting: forwardRef(() => PjcCpfCnpjFieldComponent),
|
|
@@ -371,17 +386,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
371
386
|
useExisting: forwardRef(() => PjcCpfCnpjFieldComponent),
|
|
372
387
|
multi: true,
|
|
373
388
|
},
|
|
374
|
-
], template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <input\n pInputText\n [id]=\"id\"\n [value]=\"displayValue\"\n (input)=\"onInputChange($event)\"\n (blur)=\"onModelTouched()\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n maxlength=\"18\"\n class=\"w-full p-2 outline-none bg-transparent border border-surface-300 rounded-md focus:border-primary-500\"\n />\n <label [for]=\"id\">{{ label }}</label>\n </p-floatlabel>\n } @else {\n <input\n pInputText\n [id]=\"id\"\n [value]=\"displayValue\"\n (input)=\"onInputChange($event)\"\n (blur)=\"onModelTouched()\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n maxlength=\"18\"\n class=\"w-full p-2 outline-none bg-transparent border border-surface-300 rounded-md focus:border-primary-500\"\n />\n }\n</div>\n" }]
|
|
375
|
-
}], propDecorators: { label: [{
|
|
376
|
-
type: Input
|
|
377
|
-
}], id: [{
|
|
378
|
-
type: Input
|
|
379
|
-
}], labelVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelVariant", required: false }] }] } });
|
|
389
|
+
], template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label()) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <input\n pInputText\n [id]=\"id()\"\n [value]=\"displayValue\"\n (input)=\"onInputChange($event)\"\n (blur)=\"onModelTouched()\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n maxlength=\"18\"\n class=\"w-full p-2 outline-none bg-transparent border border-surface-300 rounded-md focus:border-primary-500\"\n />\n <label [for]=\"id()\">{{ label() }}</label>\n </p-floatlabel>\n } @else {\n <input\n pInputText\n [id]=\"id()\"\n [value]=\"displayValue\"\n (input)=\"onInputChange($event)\"\n (blur)=\"onModelTouched()\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n maxlength=\"18\"\n class=\"w-full p-2 outline-none bg-transparent border border-surface-300 rounded-md focus:border-primary-500\"\n />\n }\n</div>\n" }]
|
|
390
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], labelVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelVariant", required: false }] }] } });
|
|
380
391
|
|
|
381
392
|
class PjcPlacaFieldComponent {
|
|
382
|
-
label = 'Placa do Veículo';
|
|
383
|
-
placeholder = 'ABC-1234';
|
|
384
|
-
id = `pjc-placa-${Math.random().toString(36).substring(2, 9)}
|
|
393
|
+
label = input('Placa do Veículo', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
394
|
+
placeholder = input('ABC-1234', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
395
|
+
id = input(`pjc-placa-${Math.random().toString(36).substring(2, 9)}`, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
385
396
|
labelVariant = input('over', ...(ngDevMode ? [{ debugName: "labelVariant" }] : /* istanbul ignore next */ []));
|
|
386
397
|
value = '';
|
|
387
398
|
onChange = () => { };
|
|
@@ -403,36 +414,38 @@ class PjcPlacaFieldComponent {
|
|
|
403
414
|
return PjcValidators.placaVeiculo()(control);
|
|
404
415
|
}
|
|
405
416
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcPlacaFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
406
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: PjcPlacaFieldComponent, isStandalone: true, selector: "pjc-placa-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal:
|
|
417
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: PjcPlacaFieldComponent, isStandalone: true, selector: "pjc-placa-field", inputs: { label: { classPropertyName: "label", publicName: "label", 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 } }, providers: [
|
|
407
418
|
{
|
|
408
419
|
provide: NG_VALUE_ACCESSOR,
|
|
409
420
|
useExisting: forwardRef(() => PjcPlacaFieldComponent),
|
|
410
421
|
multi: true,
|
|
411
422
|
},
|
|
412
|
-
{
|
|
413
|
-
|
|
423
|
+
{
|
|
424
|
+
provide: NG_VALIDATORS,
|
|
425
|
+
useExisting: forwardRef(() => PjcPlacaFieldComponent),
|
|
426
|
+
multi: true,
|
|
427
|
+
},
|
|
428
|
+
], 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-inputMask\n [id]=\"id()\"\n mask=\"aaa-9*99\"\n [(ngModel)]=\"value\"\n (onInput)=\"onModelChange($event)\"\n (onBlur)=\"onTouched()\"\n [unmask]=\"false\"\n [autoClear]=\"false\"\n [placeholder]=\"placeholder()\"\n styleClass=\"w-full border border-surface-300 rounded-md focus:border-primary-500 p-2 outline-none bg-transparent uppercase\"\n ></p-inputMask>\n <label [for]=\"id()\">{{ label() }}</label>\n </p-floatlabel>\n } @else {\n <p-inputMask\n [id]=\"id()\"\n mask=\"aaa-9*99\"\n [(ngModel)]=\"value\"\n (onInput)=\"onModelChange($event)\"\n (onBlur)=\"onTouched()\"\n [unmask]=\"false\"\n [autoClear]=\"false\"\n [placeholder]=\"placeholder()\"\n styleClass=\"w-full border border-surface-300 rounded-md focus:border-primary-500 p-2 outline-none bg-transparent uppercase\"\n ></p-inputMask>\n }\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: InputMaskModule }, { kind: "component", type: i2.InputMask, selector: "p-inputmask, p-inputMask, p-input-mask", inputs: ["type", "slotChar", "autoClear", "showClear", "style", "inputId", "styleClass", "placeholder", "tabindex", "title", "ariaLabel", "ariaLabelledBy", "ariaRequired", "readonly", "unmask", "characterPattern", "autofocus", "autocomplete", "keepBuffer", "mask"], outputs: ["onComplete", "onFocus", "onBlur", "onInput", "onKeydown", "onClear"] }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i3.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
414
429
|
}
|
|
415
430
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcPlacaFieldComponent, decorators: [{
|
|
416
431
|
type: Component,
|
|
417
|
-
args: [{ selector: 'pjc-placa-field', imports: [
|
|
432
|
+
args: [{ selector: 'pjc-placa-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [FormsModule, InputMaskModule, FloatLabelModule], providers: [
|
|
418
433
|
{
|
|
419
434
|
provide: NG_VALUE_ACCESSOR,
|
|
420
435
|
useExisting: forwardRef(() => PjcPlacaFieldComponent),
|
|
421
436
|
multi: true,
|
|
422
437
|
},
|
|
423
|
-
{
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
type: Input
|
|
431
|
-
}], labelVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelVariant", required: false }] }] } });
|
|
438
|
+
{
|
|
439
|
+
provide: NG_VALIDATORS,
|
|
440
|
+
useExisting: forwardRef(() => PjcPlacaFieldComponent),
|
|
441
|
+
multi: true,
|
|
442
|
+
},
|
|
443
|
+
], template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label()) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <p-inputMask\n [id]=\"id()\"\n mask=\"aaa-9*99\"\n [(ngModel)]=\"value\"\n (onInput)=\"onModelChange($event)\"\n (onBlur)=\"onTouched()\"\n [unmask]=\"false\"\n [autoClear]=\"false\"\n [placeholder]=\"placeholder()\"\n styleClass=\"w-full border border-surface-300 rounded-md focus:border-primary-500 p-2 outline-none bg-transparent uppercase\"\n ></p-inputMask>\n <label [for]=\"id()\">{{ label() }}</label>\n </p-floatlabel>\n } @else {\n <p-inputMask\n [id]=\"id()\"\n mask=\"aaa-9*99\"\n [(ngModel)]=\"value\"\n (onInput)=\"onModelChange($event)\"\n (onBlur)=\"onTouched()\"\n [unmask]=\"false\"\n [autoClear]=\"false\"\n [placeholder]=\"placeholder()\"\n styleClass=\"w-full border border-surface-300 rounded-md focus:border-primary-500 p-2 outline-none bg-transparent uppercase\"\n ></p-inputMask>\n }\n</div>\n" }]
|
|
444
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", 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 }] }] } });
|
|
432
445
|
|
|
433
446
|
class PjcTelefoneFieldComponent {
|
|
434
|
-
label = 'Telefone';
|
|
435
|
-
id = `pjc-telefone-${Math.random().toString(36).substring(2, 9)}
|
|
447
|
+
label = input('Telefone', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
448
|
+
id = input(`pjc-telefone-${Math.random().toString(36).substring(2, 9)}`, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
436
449
|
labelVariant = input('over', ...(ngDevMode ? [{ debugName: "labelVariant" }] : /* istanbul ignore next */ []));
|
|
437
450
|
displayValue = '';
|
|
438
451
|
placeholder = '(00) 0000-0000';
|
|
@@ -457,13 +470,21 @@ class PjcTelefoneFieldComponent {
|
|
|
457
470
|
onInputChange(event) {
|
|
458
471
|
const input = event.target;
|
|
459
472
|
const cursorPos = input.selectionStart ?? 0;
|
|
460
|
-
const
|
|
473
|
+
const digitsBeforeCursor = input.value.substring(0, cursorPos).replace(/\D/g, '').length;
|
|
461
474
|
this.rawValue = input.value.replaceAll(/\D/g, '').substring(0, 11);
|
|
462
475
|
this.displayValue = this.formatValue(this.rawValue);
|
|
463
476
|
this.updatePlaceholder();
|
|
464
477
|
this.onChange(this.rawValue);
|
|
465
|
-
|
|
466
|
-
|
|
478
|
+
let newCursor = this.displayValue.length;
|
|
479
|
+
let digitCount = 0;
|
|
480
|
+
for (let i = 0; i < this.displayValue.length; i++) {
|
|
481
|
+
if (/\d/.test(this.displayValue[i]))
|
|
482
|
+
digitCount++;
|
|
483
|
+
if (digitCount === digitsBeforeCursor) {
|
|
484
|
+
newCursor = i + 1;
|
|
485
|
+
break;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
467
488
|
setTimeout(() => input.setSelectionRange(newCursor, newCursor));
|
|
468
489
|
}
|
|
469
490
|
onModelTouched() {
|
|
@@ -495,7 +516,7 @@ class PjcTelefoneFieldComponent {
|
|
|
495
516
|
return PjcValidators.telefone()(control);
|
|
496
517
|
}
|
|
497
518
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcTelefoneFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
498
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: PjcTelefoneFieldComponent, isStandalone: true, selector: "pjc-telefone-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal:
|
|
519
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: PjcTelefoneFieldComponent, isStandalone: true, selector: "pjc-telefone-field", inputs: { label: { classPropertyName: "label", publicName: "label", 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 } }, providers: [
|
|
499
520
|
{
|
|
500
521
|
provide: NG_VALUE_ACCESSOR,
|
|
501
522
|
useExisting: forwardRef(() => PjcTelefoneFieldComponent),
|
|
@@ -506,11 +527,11 @@ class PjcTelefoneFieldComponent {
|
|
|
506
527
|
useExisting: forwardRef(() => PjcTelefoneFieldComponent),
|
|
507
528
|
multi: true,
|
|
508
529
|
},
|
|
509
|
-
], ngImport: i0, template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <input\n pInputText\n [id]=\"id\"\n [value]=\"displayValue\"\n (input)=\"onInputChange($event)\"\n (blur)=\"onModelTouched()\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n maxlength=\"15\"\n class=\"w-full p-2 outline-none bg-transparent border border-surface-300 rounded-md focus:border-primary-500\"\n />\n <label [for]=\"id\">{{ label }}</label>\n </p-floatlabel>\n } @else {\n <input\n pInputText\n [id]=\"id\"\n [value]=\"displayValue\"\n (input)=\"onInputChange($event)\"\n (blur)=\"onModelTouched()\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n maxlength=\"15\"\n class=\"w-full p-2 outline-none bg-transparent border border-surface-300 rounded-md focus:border-primary-500\"\n />\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type:
|
|
530
|
+
], ngImport: i0, template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label()) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <input\n pInputText\n [id]=\"id()\"\n [value]=\"displayValue\"\n (input)=\"onInputChange($event)\"\n (blur)=\"onModelTouched()\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n maxlength=\"15\"\n class=\"w-full p-2 outline-none bg-transparent border border-surface-300 rounded-md focus:border-primary-500\"\n />\n <label [for]=\"id()\">{{ label() }}</label>\n </p-floatlabel>\n } @else {\n <input\n pInputText\n [id]=\"id()\"\n [value]=\"displayValue\"\n (input)=\"onInputChange($event)\"\n (blur)=\"onModelTouched()\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n maxlength=\"15\"\n class=\"w-full p-2 outline-none bg-transparent border border-surface-300 rounded-md focus:border-primary-500\"\n />\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i3.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i2$1.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
510
531
|
}
|
|
511
532
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcTelefoneFieldComponent, decorators: [{
|
|
512
533
|
type: Component,
|
|
513
|
-
args: [{ selector: 'pjc-telefone-field', imports: [
|
|
534
|
+
args: [{ selector: 'pjc-telefone-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [FormsModule, FloatLabelModule, InputTextModule], providers: [
|
|
514
535
|
{
|
|
515
536
|
provide: NG_VALUE_ACCESSOR,
|
|
516
537
|
useExisting: forwardRef(() => PjcTelefoneFieldComponent),
|
|
@@ -521,18 +542,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
521
542
|
useExisting: forwardRef(() => PjcTelefoneFieldComponent),
|
|
522
543
|
multi: true,
|
|
523
544
|
},
|
|
524
|
-
], template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <input\n pInputText\n [id]=\"id\"\n [value]=\"displayValue\"\n (input)=\"onInputChange($event)\"\n (blur)=\"onModelTouched()\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n maxlength=\"15\"\n class=\"w-full p-2 outline-none bg-transparent border border-surface-300 rounded-md focus:border-primary-500\"\n />\n <label [for]=\"id\">{{ label }}</label>\n </p-floatlabel>\n } @else {\n <input\n pInputText\n [id]=\"id\"\n [value]=\"displayValue\"\n (input)=\"onInputChange($event)\"\n (blur)=\"onModelTouched()\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n maxlength=\"15\"\n class=\"w-full p-2 outline-none bg-transparent border border-surface-300 rounded-md focus:border-primary-500\"\n />\n }\n</div>\n" }]
|
|
525
|
-
}], propDecorators: { label: [{
|
|
526
|
-
type: Input
|
|
527
|
-
}], id: [{
|
|
528
|
-
type: Input
|
|
529
|
-
}], labelVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelVariant", required: false }] }] } });
|
|
545
|
+
], template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label()) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <input\n pInputText\n [id]=\"id()\"\n [value]=\"displayValue\"\n (input)=\"onInputChange($event)\"\n (blur)=\"onModelTouched()\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n maxlength=\"15\"\n class=\"w-full p-2 outline-none bg-transparent border border-surface-300 rounded-md focus:border-primary-500\"\n />\n <label [for]=\"id()\">{{ label() }}</label>\n </p-floatlabel>\n } @else {\n <input\n pInputText\n [id]=\"id()\"\n [value]=\"displayValue\"\n (input)=\"onInputChange($event)\"\n (blur)=\"onModelTouched()\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n maxlength=\"15\"\n class=\"w-full p-2 outline-none bg-transparent border border-surface-300 rounded-md focus:border-primary-500\"\n />\n }\n</div>\n" }]
|
|
546
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], labelVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelVariant", required: false }] }] } });
|
|
530
547
|
|
|
531
548
|
class PjcDataFieldComponent {
|
|
532
|
-
label = 'Data';
|
|
533
|
-
id = `pjc-data-${Math.random().toString(36).substring(2, 9)}
|
|
534
|
-
minDate;
|
|
535
|
-
maxDate;
|
|
549
|
+
label = input('Data', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
550
|
+
id = input(`pjc-data-${Math.random().toString(36).substring(2, 9)}`, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
551
|
+
minDate = input(undefined, ...(ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []));
|
|
552
|
+
maxDate = input(undefined, ...(ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []));
|
|
536
553
|
labelVariant = input('over', ...(ngDevMode ? [{ debugName: "labelVariant" }] : /* istanbul ignore next */ []));
|
|
537
554
|
value = null;
|
|
538
555
|
onChange = () => { };
|
|
@@ -600,16 +617,18 @@ class PjcDataFieldComponent {
|
|
|
600
617
|
const value = this.value;
|
|
601
618
|
if (!value)
|
|
602
619
|
return null;
|
|
603
|
-
|
|
604
|
-
|
|
620
|
+
const minDate = this.minDate();
|
|
621
|
+
if (minDate && value < minDate) {
|
|
622
|
+
return { dataMinima: { min: minDate, atual: value } };
|
|
605
623
|
}
|
|
606
|
-
|
|
607
|
-
|
|
624
|
+
const maxDate = this.maxDate();
|
|
625
|
+
if (maxDate && value > maxDate) {
|
|
626
|
+
return { dataMaxima: { max: maxDate, atual: value } };
|
|
608
627
|
}
|
|
609
628
|
return null;
|
|
610
629
|
}
|
|
611
630
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcDataFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
612
|
-
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:
|
|
631
|
+
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 } }, providers: [
|
|
613
632
|
{
|
|
614
633
|
provide: NG_VALUE_ACCESSOR,
|
|
615
634
|
useExisting: forwardRef(() => PjcDataFieldComponent),
|
|
@@ -620,11 +639,11 @@ class PjcDataFieldComponent {
|
|
|
620
639
|
useExisting: forwardRef(() => PjcDataFieldComponent),
|
|
621
640
|
multi: true,
|
|
622
641
|
},
|
|
623
|
-
], 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 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</div>\n", dependencies: [{ kind: "ngmodule", type:
|
|
642
|
+
], 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 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</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$2.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 });
|
|
624
643
|
}
|
|
625
644
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcDataFieldComponent, decorators: [{
|
|
626
645
|
type: Component,
|
|
627
|
-
args: [{ selector: 'pjc-data-field', imports: [
|
|
646
|
+
args: [{ selector: 'pjc-data-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [FormsModule, DatePickerModule, FloatLabelModule], providers: [
|
|
628
647
|
{
|
|
629
648
|
provide: NG_VALUE_ACCESSOR,
|
|
630
649
|
useExisting: forwardRef(() => PjcDataFieldComponent),
|
|
@@ -635,22 +654,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
635
654
|
useExisting: forwardRef(() => PjcDataFieldComponent),
|
|
636
655
|
multi: true,
|
|
637
656
|
},
|
|
638
|
-
], 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 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</div>\n" }]
|
|
639
|
-
}], propDecorators: { label: [{
|
|
640
|
-
type: Input
|
|
641
|
-
}], id: [{
|
|
642
|
-
type: Input
|
|
643
|
-
}], minDate: [{
|
|
644
|
-
type: Input
|
|
645
|
-
}], maxDate: [{
|
|
646
|
-
type: Input
|
|
647
|
-
}], labelVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelVariant", required: false }] }] } });
|
|
657
|
+
], 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 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</div>\n" }]
|
|
658
|
+
}], 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 }] }] } });
|
|
648
659
|
|
|
649
660
|
class PjcHoraFieldComponent {
|
|
650
661
|
label = input('Hora', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
651
662
|
id = input(`pjc-hora-${Math.random().toString(36).substring(2, 9)}`, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
652
663
|
labelVariant = input('over', ...(ngDevMode ? [{ debugName: "labelVariant" }] : /* istanbul ignore next */ []));
|
|
653
664
|
value = '';
|
|
665
|
+
disabled = false;
|
|
654
666
|
onChange = () => { };
|
|
655
667
|
onTouched = () => { };
|
|
656
668
|
writeValue(val) {
|
|
@@ -662,9 +674,16 @@ class PjcHoraFieldComponent {
|
|
|
662
674
|
registerOnTouched(fn) {
|
|
663
675
|
this.onTouched = fn;
|
|
664
676
|
}
|
|
665
|
-
|
|
677
|
+
setDisabledState(isDisabled) {
|
|
678
|
+
this.disabled = isDisabled;
|
|
679
|
+
}
|
|
680
|
+
onModelChange(value) {
|
|
681
|
+
this.value = value ?? '';
|
|
666
682
|
this.onChange(this.value);
|
|
667
683
|
}
|
|
684
|
+
onModelTouched() {
|
|
685
|
+
this.onTouched();
|
|
686
|
+
}
|
|
668
687
|
validate(control) {
|
|
669
688
|
return PjcValidators.hora()(control);
|
|
670
689
|
}
|
|
@@ -680,7 +699,7 @@ class PjcHoraFieldComponent {
|
|
|
680
699
|
useExisting: forwardRef(() => PjcHoraFieldComponent),
|
|
681
700
|
multi: true,
|
|
682
701
|
},
|
|
683
|
-
], 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-inputMask\n [id]=\"id()\"\n mask=\"99:99\"\n [
|
|
702
|
+
], 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-inputMask\n [id]=\"id()\"\n mask=\"99:99\"\n [ngModel]=\"value\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onModelTouched()\"\n [unmask]=\"false\"\n [autoClear]=\"false\"\n placeholder=\"HH:MM\"\n styleClass=\"w-full border border-surface-300 rounded-md focus:border-primary-500\"\n inputStyleClass=\"w-full p-2 outline-none bg-transparent\"\n ></p-inputMask>\n <label [for]=\"id()\">{{ label() }}</label>\n </p-floatlabel>\n } @else {\n <p-inputMask\n [id]=\"id()\"\n mask=\"99:99\"\n [ngModel]=\"value\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onModelTouched()\"\n [unmask]=\"false\"\n [autoClear]=\"false\"\n placeholder=\"HH:MM\"\n styleClass=\"w-full border border-surface-300 rounded-md focus:border-primary-500\"\n inputStyleClass=\"w-full p-2 outline-none bg-transparent\"\n ></p-inputMask>\n }\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: InputMaskModule }, { kind: "component", type: i2.InputMask, selector: "p-inputmask, p-inputMask, p-input-mask", inputs: ["type", "slotChar", "autoClear", "showClear", "style", "inputId", "styleClass", "placeholder", "tabindex", "title", "ariaLabel", "ariaLabelledBy", "ariaRequired", "readonly", "unmask", "characterPattern", "autofocus", "autocomplete", "keepBuffer", "mask"], outputs: ["onComplete", "onFocus", "onBlur", "onInput", "onKeydown", "onClear"] }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i3.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
684
703
|
}
|
|
685
704
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcHoraFieldComponent, decorators: [{
|
|
686
705
|
type: Component,
|
|
@@ -695,13 +714,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
695
714
|
useExisting: forwardRef(() => PjcHoraFieldComponent),
|
|
696
715
|
multi: true,
|
|
697
716
|
},
|
|
698
|
-
], template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label()) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <p-inputMask\n [id]=\"id()\"\n mask=\"99:99\"\n [
|
|
717
|
+
], template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label()) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <p-inputMask\n [id]=\"id()\"\n mask=\"99:99\"\n [ngModel]=\"value\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onModelTouched()\"\n [unmask]=\"false\"\n [autoClear]=\"false\"\n placeholder=\"HH:MM\"\n styleClass=\"w-full border border-surface-300 rounded-md focus:border-primary-500\"\n inputStyleClass=\"w-full p-2 outline-none bg-transparent\"\n ></p-inputMask>\n <label [for]=\"id()\">{{ label() }}</label>\n </p-floatlabel>\n } @else {\n <p-inputMask\n [id]=\"id()\"\n mask=\"99:99\"\n [ngModel]=\"value\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onModelTouched()\"\n [unmask]=\"false\"\n [autoClear]=\"false\"\n placeholder=\"HH:MM\"\n styleClass=\"w-full border border-surface-300 rounded-md focus:border-primary-500\"\n inputStyleClass=\"w-full p-2 outline-none bg-transparent\"\n ></p-inputMask>\n }\n</div>\n" }]
|
|
699
718
|
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], labelVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelVariant", required: false }] }] } });
|
|
700
719
|
|
|
701
|
-
class
|
|
702
|
-
label = 'Nome';
|
|
703
|
-
placeholder = 'Digite o nome';
|
|
704
|
-
id = `pjc-
|
|
720
|
+
class PjcUppercaseFieldComponent {
|
|
721
|
+
label = input('Nome', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
722
|
+
placeholder = input('Digite o nome', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
723
|
+
id = input(`pjc-uppercase-${Math.random().toString(36).substring(2, 9)}`, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
705
724
|
labelVariant = input('over', ...(ngDevMode ? [{ debugName: "labelVariant" }] : /* istanbul ignore next */ []));
|
|
706
725
|
value = '';
|
|
707
726
|
onChange = () => { };
|
|
@@ -720,44 +739,37 @@ class PjcNomeFieldComponent {
|
|
|
720
739
|
this.value = upper;
|
|
721
740
|
this.onChange(upper);
|
|
722
741
|
}
|
|
723
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type:
|
|
724
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type:
|
|
742
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcUppercaseFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
743
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: PjcUppercaseFieldComponent, isStandalone: true, selector: "pjc-uppercase-field", inputs: { label: { classPropertyName: "label", publicName: "label", 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 } }, providers: [
|
|
725
744
|
{
|
|
726
745
|
provide: NG_VALUE_ACCESSOR,
|
|
727
|
-
useExisting: forwardRef(() =>
|
|
746
|
+
useExisting: forwardRef(() => PjcUppercaseFieldComponent),
|
|
728
747
|
multi: true,
|
|
729
748
|
},
|
|
730
|
-
], ngImport: i0, template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <input\n pInputText\n [id]=\"id\"\n [value]=\"value\"\n (input)=\"onInput($event)\"\n (blur)=\"onTouched()\"\n [placeholder]=\"placeholder\"\n class=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500 uppercase\"\n />\n <label [for]=\"id\">{{ label }}</label>\n </p-floatlabel>\n } @else {\n <input\n pInputText\n [id]=\"id\"\n [value]=\"value\"\n (input)=\"onInput($event)\"\n (blur)=\"onTouched()\"\n [placeholder]=\"placeholder\"\n class=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500 uppercase\"\n />\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type:
|
|
749
|
+
], ngImport: i0, template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label()) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <input\n pInputText\n [id]=\"id()\"\n [value]=\"value\"\n (input)=\"onInput($event)\"\n (blur)=\"onTouched()\"\n [placeholder]=\"placeholder()\"\n class=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500 uppercase\"\n />\n <label [for]=\"id()\">{{ label() }}</label>\n </p-floatlabel>\n } @else {\n <input\n pInputText\n [id]=\"id()\"\n [value]=\"value\"\n (input)=\"onInput($event)\"\n (blur)=\"onTouched()\"\n [placeholder]=\"placeholder()\"\n class=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500 uppercase\"\n />\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i2$1.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i3.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
731
750
|
}
|
|
732
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type:
|
|
751
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcUppercaseFieldComponent, decorators: [{
|
|
733
752
|
type: Component,
|
|
734
|
-
args: [{ selector: 'pjc-
|
|
753
|
+
args: [{ selector: 'pjc-uppercase-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [FormsModule, InputTextModule, FloatLabelModule], providers: [
|
|
735
754
|
{
|
|
736
755
|
provide: NG_VALUE_ACCESSOR,
|
|
737
|
-
useExisting: forwardRef(() =>
|
|
756
|
+
useExisting: forwardRef(() => PjcUppercaseFieldComponent),
|
|
738
757
|
multi: true,
|
|
739
758
|
},
|
|
740
|
-
], template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <input\n pInputText\n [id]=\"id\"\n [value]=\"value\"\n (input)=\"onInput($event)\"\n (blur)=\"onTouched()\"\n [placeholder]=\"placeholder\"\n class=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500 uppercase\"\n />\n <label [for]=\"id\">{{ label }}</label>\n </p-floatlabel>\n } @else {\n <input\n pInputText\n [id]=\"id\"\n [value]=\"value\"\n (input)=\"onInput($event)\"\n (blur)=\"onTouched()\"\n [placeholder]=\"placeholder\"\n class=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500 uppercase\"\n />\n }\n</div>\n" }]
|
|
741
|
-
}], propDecorators: { label: [{
|
|
742
|
-
type: Input
|
|
743
|
-
}], placeholder: [{
|
|
744
|
-
type: Input
|
|
745
|
-
}], id: [{
|
|
746
|
-
type: Input
|
|
747
|
-
}], labelVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelVariant", required: false }] }] } });
|
|
759
|
+
], template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label()) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <input\n pInputText\n [id]=\"id()\"\n [value]=\"value\"\n (input)=\"onInput($event)\"\n (blur)=\"onTouched()\"\n [placeholder]=\"placeholder()\"\n class=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500 uppercase\"\n />\n <label [for]=\"id()\">{{ label() }}</label>\n </p-floatlabel>\n } @else {\n <input\n pInputText\n [id]=\"id()\"\n [value]=\"value\"\n (input)=\"onInput($event)\"\n (blur)=\"onTouched()\"\n [placeholder]=\"placeholder()\"\n class=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500 uppercase\"\n />\n }\n</div>\n" }]
|
|
760
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", 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 }] }] } });
|
|
748
761
|
|
|
749
762
|
class PjcCepFieldComponent {
|
|
750
|
-
label = '';
|
|
751
|
-
hint = '';
|
|
752
|
-
placeholder = '00000-000';
|
|
753
|
-
id = `pjc-cep-${Math.random().toString(36).substring(2, 9)}
|
|
763
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
764
|
+
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
765
|
+
placeholder = input('00000-000', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
766
|
+
id = input(`pjc-cep-${Math.random().toString(36).substring(2, 9)}`, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
754
767
|
labelVariant = input('over', ...(ngDevMode ? [{ debugName: "labelVariant" }] : /* istanbul ignore next */ []));
|
|
755
768
|
busca = output();
|
|
756
769
|
value = '';
|
|
757
770
|
disabled = false;
|
|
758
771
|
onChange = () => { };
|
|
759
772
|
onTouched = () => { };
|
|
760
|
-
// --- ControlValueAccessor ---
|
|
761
773
|
writeValue(val) {
|
|
762
774
|
this.value = val ?? '';
|
|
763
775
|
}
|
|
@@ -770,7 +782,8 @@ class PjcCepFieldComponent {
|
|
|
770
782
|
setDisabledState(isDisabled) {
|
|
771
783
|
this.disabled = isDisabled;
|
|
772
784
|
}
|
|
773
|
-
onModelChange() {
|
|
785
|
+
onModelChange(value) {
|
|
786
|
+
this.value = value ?? '';
|
|
774
787
|
this.onChange(this.value);
|
|
775
788
|
}
|
|
776
789
|
onModelTouched() {
|
|
@@ -784,33 +797,38 @@ class PjcCepFieldComponent {
|
|
|
784
797
|
this.busca.emit(this.value);
|
|
785
798
|
}
|
|
786
799
|
}
|
|
800
|
+
validate(control) {
|
|
801
|
+
return PjcValidators.cep()(control);
|
|
802
|
+
}
|
|
787
803
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcCepFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
788
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: PjcCepFieldComponent, isStandalone: true, selector: "pjc-cep-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal:
|
|
804
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: PjcCepFieldComponent, isStandalone: true, selector: "pjc-cep-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 } }, outputs: { busca: "busca" }, providers: [
|
|
789
805
|
{
|
|
790
806
|
provide: NG_VALUE_ACCESSOR,
|
|
791
807
|
useExisting: forwardRef(() => PjcCepFieldComponent),
|
|
792
808
|
multi: true,
|
|
793
809
|
},
|
|
794
|
-
|
|
810
|
+
{
|
|
811
|
+
provide: NG_VALIDATORS,
|
|
812
|
+
useExisting: forwardRef(() => PjcCepFieldComponent),
|
|
813
|
+
multi: true,
|
|
814
|
+
},
|
|
815
|
+
], 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-inputgroup [class.opacity-60]=\"disabled\">\n <p-inputMask\n [id]=\"id()\"\n mask=\"99999-999\"\n [ngModel]=\"value\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onModelTouched()\"\n (onComplete)=\"onComplete()\"\n [unmask]=\"true\"\n [autoClear]=\"false\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled\"\n inputStyleClass=\"w-full outline-none bg-transparent\"\n ></p-inputMask>\n\n <p-inputgroup-addon>\n <button\n type=\"button\"\n (click)=\"onSearch()\"\n [disabled]=\"disabled\"\n class=\"cursor-pointer bg-transparent border-none text-surface-500 hover:text-surface-700 disabled:text-surface-300 disabled:cursor-not-allowed transition-colors\"\n aria-label=\"Buscar CEP\"\n >\n <i class=\"pi pi-search\"></i>\n </button>\n </p-inputgroup-addon>\n </p-inputgroup>\n <label [for]=\"id()\">{{ label() }}</label>\n </p-floatlabel>\n } @else {\n <p-inputgroup [class.opacity-60]=\"disabled\">\n <p-inputMask\n [id]=\"id()\"\n mask=\"99999-999\"\n [ngModel]=\"value\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onModelTouched()\"\n (onComplete)=\"onComplete()\"\n [unmask]=\"true\"\n [autoClear]=\"false\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled\"\n inputStyleClass=\"w-full outline-none bg-transparent\"\n ></p-inputMask>\n\n <p-inputgroup-addon>\n <button\n type=\"button\"\n (click)=\"onSearch()\"\n [disabled]=\"disabled\"\n class=\"cursor-pointer bg-transparent border-none text-surface-500 hover:text-surface-700 disabled:text-surface-300 disabled:cursor-not-allowed transition-colors\"\n aria-label=\"Buscar CEP\"\n >\n <i class=\"pi pi-search\"></i>\n </button>\n </p-inputgroup-addon>\n </p-inputgroup>\n }\n\n @if (hint()) {\n <small class=\"text-xs text-surface-500\">{{ hint() }}</small>\n }\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: InputMaskModule }, { kind: "component", type: i2.InputMask, selector: "p-inputmask, p-inputMask, p-input-mask", inputs: ["type", "slotChar", "autoClear", "showClear", "style", "inputId", "styleClass", "placeholder", "tabindex", "title", "ariaLabel", "ariaLabelledBy", "ariaRequired", "readonly", "unmask", "characterPattern", "autofocus", "autocomplete", "keepBuffer", "mask"], outputs: ["onComplete", "onFocus", "onBlur", "onInput", "onKeydown", "onClear"] }, { kind: "ngmodule", type: InputGroupModule }, { kind: "component", type: i3$1.InputGroup, selector: "p-inputgroup, p-inputGroup, p-input-group", inputs: ["styleClass"] }, { kind: "ngmodule", type: InputGroupAddonModule }, { kind: "component", type: i4.InputGroupAddon, selector: "p-inputgroup-addon, p-inputGroupAddon", inputs: ["style", "styleClass"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i3.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
795
816
|
}
|
|
796
817
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcCepFieldComponent, decorators: [{
|
|
797
818
|
type: Component,
|
|
798
|
-
args: [{ selector: 'pjc-cep-field', imports: [
|
|
819
|
+
args: [{ selector: 'pjc-cep-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [FormsModule, InputMaskModule, InputGroupModule, InputGroupAddonModule, ButtonModule, FloatLabelModule], providers: [
|
|
799
820
|
{
|
|
800
821
|
provide: NG_VALUE_ACCESSOR,
|
|
801
822
|
useExisting: forwardRef(() => PjcCepFieldComponent),
|
|
802
823
|
multi: true,
|
|
803
824
|
},
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
}], id: [{
|
|
812
|
-
type: Input
|
|
813
|
-
}], labelVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelVariant", required: false }] }], busca: [{ type: i0.Output, args: ["busca"] }] } });
|
|
825
|
+
{
|
|
826
|
+
provide: NG_VALIDATORS,
|
|
827
|
+
useExisting: forwardRef(() => PjcCepFieldComponent),
|
|
828
|
+
multi: true,
|
|
829
|
+
},
|
|
830
|
+
], template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label()) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <p-inputgroup [class.opacity-60]=\"disabled\">\n <p-inputMask\n [id]=\"id()\"\n mask=\"99999-999\"\n [ngModel]=\"value\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onModelTouched()\"\n (onComplete)=\"onComplete()\"\n [unmask]=\"true\"\n [autoClear]=\"false\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled\"\n inputStyleClass=\"w-full outline-none bg-transparent\"\n ></p-inputMask>\n\n <p-inputgroup-addon>\n <button\n type=\"button\"\n (click)=\"onSearch()\"\n [disabled]=\"disabled\"\n class=\"cursor-pointer bg-transparent border-none text-surface-500 hover:text-surface-700 disabled:text-surface-300 disabled:cursor-not-allowed transition-colors\"\n aria-label=\"Buscar CEP\"\n >\n <i class=\"pi pi-search\"></i>\n </button>\n </p-inputgroup-addon>\n </p-inputgroup>\n <label [for]=\"id()\">{{ label() }}</label>\n </p-floatlabel>\n } @else {\n <p-inputgroup [class.opacity-60]=\"disabled\">\n <p-inputMask\n [id]=\"id()\"\n mask=\"99999-999\"\n [ngModel]=\"value\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onModelTouched()\"\n (onComplete)=\"onComplete()\"\n [unmask]=\"true\"\n [autoClear]=\"false\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled\"\n inputStyleClass=\"w-full outline-none bg-transparent\"\n ></p-inputMask>\n\n <p-inputgroup-addon>\n <button\n type=\"button\"\n (click)=\"onSearch()\"\n [disabled]=\"disabled\"\n class=\"cursor-pointer bg-transparent border-none text-surface-500 hover:text-surface-700 disabled:text-surface-300 disabled:cursor-not-allowed transition-colors\"\n aria-label=\"Buscar CEP\"\n >\n <i class=\"pi pi-search\"></i>\n </button>\n </p-inputgroup-addon>\n </p-inputgroup>\n }\n\n @if (hint()) {\n <small class=\"text-xs text-surface-500\">{{ hint() }}</small>\n }\n</div>\n" }]
|
|
831
|
+
}], 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 }] }], busca: [{ type: i0.Output, args: ["busca"] }] } });
|
|
814
832
|
|
|
815
833
|
const ESTADOS = [
|
|
816
834
|
{ uf: 'AC', descricao: 'Acre' },
|
|
@@ -928,11 +946,11 @@ class PjcEmailFieldComponent {
|
|
|
928
946
|
useExisting: forwardRef(() => PjcEmailFieldComponent),
|
|
929
947
|
multi: true,
|
|
930
948
|
},
|
|
931
|
-
], ngImport: i0, template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label()) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <input\n pInputText\n type=\"email\"\n [id]=\"id()\"\n [value]=\"value\"\n (input)=\"onInput($event)\"\n (blur)=\"onTouched()\"\n [placeholder]=\"placeholder()\"\n class=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500\"\n />\n <label [for]=\"id()\">{{ label() }}</label>\n </p-floatlabel>\n } @else {\n <input\n pInputText\n type=\"email\"\n [id]=\"id()\"\n [value]=\"value\"\n (input)=\"onInput($event)\"\n (blur)=\"onTouched()\"\n [placeholder]=\"placeholder()\"\n class=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500\"\n />\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type:
|
|
949
|
+
], ngImport: i0, template: "<div class=\"flex flex-col gap-1 w-full\">\n @if (label()) {\n <p-floatlabel [variant]=\"labelVariant()\" class=\"w-full\">\n <input\n pInputText\n type=\"email\"\n [id]=\"id()\"\n [value]=\"value\"\n (input)=\"onInput($event)\"\n (blur)=\"onTouched()\"\n [placeholder]=\"placeholder()\"\n class=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500\"\n />\n <label [for]=\"id()\">{{ label() }}</label>\n </p-floatlabel>\n } @else {\n <input\n pInputText\n type=\"email\"\n [id]=\"id()\"\n [value]=\"value\"\n (input)=\"onInput($event)\"\n (blur)=\"onTouched()\"\n [placeholder]=\"placeholder()\"\n class=\"w-full p-2 border border-surface-300 rounded-md outline-none bg-transparent focus:border-primary-500\"\n />\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i2$1.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i3.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
932
950
|
}
|
|
933
951
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PjcEmailFieldComponent, decorators: [{
|
|
934
952
|
type: Component,
|
|
935
|
-
args: [{ selector: 'pjc-email-field', imports: [
|
|
953
|
+
args: [{ selector: 'pjc-email-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [FormsModule, InputTextModule, FloatLabelModule], providers: [
|
|
936
954
|
{
|
|
937
955
|
provide: NG_VALUE_ACCESSOR,
|
|
938
956
|
useExisting: forwardRef(() => PjcEmailFieldComponent),
|
|
@@ -954,5 +972,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
954
972
|
* Generated bundle index. Do not edit.
|
|
955
973
|
*/
|
|
956
974
|
|
|
957
|
-
export { PjcCepFieldComponent, PjcCnpjFieldComponent, PjcCpfCnpjFieldComponent, PjcCpfFieldComponent, PjcDataFieldComponent, PjcEmailFieldComponent, PjcFields, PjcHoraFieldComponent,
|
|
975
|
+
export { PjcCepFieldComponent, PjcCnpjFieldComponent, PjcCpfCnpjFieldComponent, PjcCpfFieldComponent, PjcDataFieldComponent, PjcEmailFieldComponent, PjcFields, PjcHoraFieldComponent, PjcPlacaFieldComponent, PjcTelefoneFieldComponent, PjcUfFieldComponent, PjcUppercaseFieldComponent, PjcValidators };
|
|
958
976
|
//# sourceMappingURL=pjc-fields.mjs.map
|