@pumpkin-tech/pumpkin-tech-ng 0.1.2 → 0.1.4

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.
@@ -7,18 +7,23 @@ export declare class CheckBoxComponent implements ControlValueAccessor {
7
7
  required: boolean;
8
8
  color: string;
9
9
  indeterminate: boolean;
10
+ /** ⚠️ mantém o nome para compatibilidade com o consumidor */
11
+ change: EventEmitter<boolean>;
10
12
  indeterminateChange: EventEmitter<boolean>;
11
- change: EventEmitter<any>;
12
- private _value;
13
+ _value: boolean;
14
+ /** Atualização programática NUNCA emite evento nem CVA */
15
+ set value(v: any);
13
16
  get value(): boolean;
14
- set value(v: boolean);
15
- onChange: any;
16
- onTouch: any;
17
- writeValue(value: any): void;
17
+ private onChangeFn;
18
+ private onTouchFn;
19
+ writeValue(v: any): void;
18
20
  registerOnChange(fn: any): void;
19
21
  registerOnTouched(fn: any): void;
20
22
  setDisabledState(isDisabled: boolean): void;
23
+ /** Apenas interação do usuário dispara tudo */
21
24
  onCheckboxChange(checked: boolean): void;
25
+ /** Coerção robusta para boolean */
26
+ private toBool;
22
27
  static ɵfac: i0.ɵɵFactoryDeclaration<CheckBoxComponent, never>;
23
- static ɵcmp: i0.ɵɵComponentDeclaration<CheckBoxComponent, "ptech-check-box", never, { "label": { "alias": "label"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "required": { "alias": "required"; "required": false; }; "color": { "alias": "color"; "required": false; }; "indeterminate": { "alias": "indeterminate"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, { "indeterminateChange": "indeterminateChange"; "change": "change"; }, never, never, true, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<CheckBoxComponent, "ptech-check-box", never, { "label": { "alias": "label"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "required": { "alias": "required"; "required": false; }; "color": { "alias": "color"; "required": false; }; "indeterminate": { "alias": "indeterminate"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, { "change": "change"; "indeterminateChange": "indeterminateChange"; }, never, never, true, never>;
24
29
  }
@@ -0,0 +1,21 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class FlagComponent {
4
+ /** ISO 3166-1 alpha-2 (ex.: 'BR', 'ES', 'US'). */
5
+ code: string | null | undefined;
6
+ /** Tamanho em px (controla a altura; largura acompanha 4:3). */
7
+ size: number;
8
+ /** Usa ícone quadrado do flag-icons. */
9
+ squared: boolean;
10
+ /** Tooltip (fallback para o próprio code). */
11
+ tooltip?: string;
12
+ /** Texto opcional ao lado da bandeira. */
13
+ label?: string;
14
+ /** Emite click opcionalmente e muda o cursor. */
15
+ clickable: boolean;
16
+ flagClick: EventEmitter<string>;
17
+ get classCode(): string;
18
+ handleClick(): void;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlagComponent, never>;
20
+ static ɵcmp: i0.ɵɵComponentDeclaration<FlagComponent, "ptech-flag", never, { "code": { "alias": "code"; "required": false; }; "size": { "alias": "size"; "required": false; }; "squared": { "alias": "squared"; "required": false; }; "tooltip": { "alias": "tooltip"; "required": false; }; "label": { "alias": "label"; "required": false; }; "clickable": { "alias": "clickable"; "required": false; }; }, { "flagClick": "flagClick"; }, never, never, true, never>;
21
+ }
@@ -0,0 +1 @@
1
+ export * from './flag.component';
@@ -4,6 +4,8 @@ import { MatFormFieldAppearance } from '@angular/material/form-field';
4
4
  import { BooleanInput } from '@angular/cdk/coercion';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class InputComponent implements ControlValueAccessor, OnInit {
7
+ private el;
8
+ constructor(el: ElementRef<HTMLElement>);
7
9
  _elementRef?: ElementRef<HTMLInputElement>;
8
10
  suffixRef?: TemplateRef<any>;
9
11
  buttonClick: EventEmitter<void>;
@@ -45,8 +47,9 @@ export declare class InputComponent implements ControlValueAccessor, OnInit {
45
47
  pattern?: string;
46
48
  fullWidth: boolean;
47
49
  private _col;
48
- set ptechCol(v: number | string | null | undefined);
49
- get gridColumn(): string;
50
+ set col(v: number | string | null | undefined);
51
+ private hasPtechColAttrs;
52
+ get gridColumn(): string | null;
50
53
  private _val;
51
54
  ngOnInit(): void;
52
55
  get value(): any;
@@ -61,5 +64,5 @@ export declare class InputComponent implements ControlValueAccessor, OnInit {
61
64
  isThemeColor(c: string | null | undefined, theme: 'primary' | 'accent' | 'warn'): boolean;
62
65
  get customIconColor(): string | null;
63
66
  static ɵfac: i0.ɵɵFactoryDeclaration<InputComponent, never>;
64
- static ɵcmp: i0.ɵɵComponentDeclaration<InputComponent, "ptech-input", never, { "required": { "alias": "required"; "required": false; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "maxlength": { "alias": "maxlength"; "required": false; }; "min": { "alias": "min"; "required": false; }; "max": { "alias": "max"; "required": false; }; "type": { "alias": "type"; "required": false; }; "name": { "alias": "name"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "iconColor": { "alias": "iconColor"; "required": false; }; "iconWidth": { "alias": "iconWidth"; "required": false; }; "iconHeight": { "alias": "iconHeight"; "required": false; }; "iconSize": { "alias": "iconSize"; "required": false; }; "iconPosition": { "alias": "iconPosition"; "required": false; }; "forceFixedIcon": { "alias": "forceFixedIcon"; "required": false; }; "tooltip": { "alias": "tooltip"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "autocomplete": { "alias": "autocomplete"; "required": false; }; "inputmode": { "alias": "inputmode"; "required": false; }; "pattern": { "alias": "pattern"; "required": false; }; "fullWidth": { "alias": "fullWidth"; "required": false; }; "ptechCol": { "alias": "ptechCol"; "required": false; }; }, { "buttonClick": "buttonClick"; }, ["suffixRef"], ["[matPrefix]", "[matSuffix]", "mat-hint, [mat-hint]", "mat-error, [mat-error]"], true, never>;
67
+ static ɵcmp: i0.ɵɵComponentDeclaration<InputComponent, "ptech-input", never, { "required": { "alias": "required"; "required": false; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "maxlength": { "alias": "maxlength"; "required": false; }; "min": { "alias": "min"; "required": false; }; "max": { "alias": "max"; "required": false; }; "type": { "alias": "type"; "required": false; }; "name": { "alias": "name"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "iconColor": { "alias": "iconColor"; "required": false; }; "iconWidth": { "alias": "iconWidth"; "required": false; }; "iconHeight": { "alias": "iconHeight"; "required": false; }; "iconSize": { "alias": "iconSize"; "required": false; }; "iconPosition": { "alias": "iconPosition"; "required": false; }; "forceFixedIcon": { "alias": "forceFixedIcon"; "required": false; }; "tooltip": { "alias": "tooltip"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "autocomplete": { "alias": "autocomplete"; "required": false; }; "inputmode": { "alias": "inputmode"; "required": false; }; "pattern": { "alias": "pattern"; "required": false; }; "fullWidth": { "alias": "fullWidth"; "required": false; }; "col": { "alias": "col"; "required": false; }; }, { "buttonClick": "buttonClick"; }, ["suffixRef"], ["[matPrefix]", "[matSuffix]", "mat-hint, [mat-hint]", "mat-error, [mat-error]"], true, never>;
65
68
  }
@@ -1,9 +1,16 @@
1
- import { OnDestroy } from '@angular/core';
1
+ import { ElementRef, NgZone, OnDestroy } from '@angular/core';
2
2
  import { BreakpointObserver } from '@angular/cdk/layout';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class PtechColDirective implements OnDestroy {
5
+ private el;
6
+ private ngZone;
5
7
  private bp;
6
8
  private destroy$;
9
+ private ro?;
10
+ private roScheduled;
11
+ private lastSpan;
12
+ /** Controla de onde vêm os breakpoints (viewport ou container). */
13
+ ptechColMode: 'viewport' | 'container' | 'auto';
7
14
  private _col;
8
15
  set ptechCol(v: number | string | null | undefined);
9
16
  ptechColXs?: number | string;
@@ -12,14 +19,16 @@ export declare class PtechColDirective implements OnDestroy {
12
19
  ptechColLg?: number | string;
13
20
  ptechColXl?: number | string;
14
21
  private activeBp;
22
+ private activeSource;
15
23
  gridColumn: string;
16
24
  minWidth: string;
17
- constructor(bp: BreakpointObserver);
25
+ constructor(el: ElementRef<HTMLElement>, ngZone: NgZone, bp: BreakpointObserver);
18
26
  ngOnDestroy(): void;
27
+ private findGridParent;
19
28
  private pickActive;
20
29
  private updateSpan;
21
30
  private resolveColForBp;
22
31
  private asNum;
23
32
  static ɵfac: i0.ɵɵFactoryDeclaration<PtechColDirective, never>;
24
- static ɵdir: i0.ɵɵDirectiveDeclaration<PtechColDirective, "[ptechCol]", never, { "ptechCol": { "alias": "ptechCol"; "required": false; }; "ptechColXs": { "alias": "ptechColXs"; "required": false; }; "ptechColSm": { "alias": "ptechColSm"; "required": false; }; "ptechColMd": { "alias": "ptechColMd"; "required": false; }; "ptechColLg": { "alias": "ptechColLg"; "required": false; }; "ptechColXl": { "alias": "ptechColXl"; "required": false; }; }, {}, never, never, true, never>;
33
+ static ɵdir: i0.ɵɵDirectiveDeclaration<PtechColDirective, "[ptechCol]", never, { "ptechColMode": { "alias": "ptechColMode"; "required": false; }; "ptechCol": { "alias": "ptechCol"; "required": false; }; "ptechColXs": { "alias": "ptechColXs"; "required": false; }; "ptechColSm": { "alias": "ptechColSm"; "required": false; }; "ptechColMd": { "alias": "ptechColMd"; "required": false; }; "ptechColLg": { "alias": "ptechColLg"; "required": false; }; "ptechColXl": { "alias": "ptechColXl"; "required": false; }; }, {}, never, never, true, never>;
25
34
  }
@@ -9,8 +9,10 @@ import * as i7 from "../pipes/memory-format.pipe";
9
9
  import * as i8 from "../pipes/phone-brazil.pipe";
10
10
  import * as i9 from "../pipes/phone-spain.pipe";
11
11
  import * as i10 from "../pipes/uptime-format.pipe";
12
+ import * as i11 from "../pipes/time.durantion.pipe";
13
+ import * as i12 from "../pipes/is-longer-than.pipe";
12
14
  export declare class PipesModule {
13
15
  static ɵfac: i0.ɵɵFactoryDeclaration<PipesModule, never>;
14
- static ɵmod: i0.ɵɵNgModuleDeclaration<PipesModule, never, [typeof i1.CommonModule, typeof i2.CurrencyBrlPipe, typeof i3.DateAgoPipe, typeof i4.GetFirstStringBeforeSpacePipe, typeof i5.LineBreakAfterPeriodPipe, typeof i6.LineBreakAfterPipe, typeof i7.MemoryFormatPipe, typeof i8.PhoneBrazilPipe, typeof i9.PhoneSpainPipe, typeof i10.UptimeFormatPipe], [typeof i2.CurrencyBrlPipe, typeof i3.DateAgoPipe, typeof i4.GetFirstStringBeforeSpacePipe, typeof i5.LineBreakAfterPeriodPipe, typeof i6.LineBreakAfterPipe, typeof i7.MemoryFormatPipe, typeof i8.PhoneBrazilPipe, typeof i9.PhoneSpainPipe, typeof i10.UptimeFormatPipe]>;
16
+ static ɵmod: i0.ɵɵNgModuleDeclaration<PipesModule, never, [typeof i1.CommonModule, typeof i2.CurrencyBrlPipe, typeof i3.DateAgoPipe, typeof i4.GetFirstStringBeforeSpacePipe, typeof i5.LineBreakAfterPeriodPipe, typeof i6.LineBreakAfterPipe, typeof i7.MemoryFormatPipe, typeof i8.PhoneBrazilPipe, typeof i9.PhoneSpainPipe, typeof i10.UptimeFormatPipe, typeof i11.TimeDurationPipe, typeof i12.IsLongerThanPipe], [typeof i2.CurrencyBrlPipe, typeof i3.DateAgoPipe, typeof i4.GetFirstStringBeforeSpacePipe, typeof i5.LineBreakAfterPeriodPipe, typeof i6.LineBreakAfterPipe, typeof i7.MemoryFormatPipe, typeof i8.PhoneBrazilPipe, typeof i9.PhoneSpainPipe, typeof i10.UptimeFormatPipe, typeof i11.TimeDurationPipe, typeof i12.IsLongerThanPipe]>;
15
17
  static ɵinj: i0.ɵɵInjectorDeclaration<PipesModule>;
16
18
  }
@@ -32,8 +32,9 @@ import * as i30 from "../components/profile-menu/profile-menu.component";
32
32
  import * as i31 from "../components/check-box/check-box.component";
33
33
  import * as i32 from "../components/progress-bar/progress-bar.component";
34
34
  import * as i33 from "../components/progress-bar-multiple/progress-bar-multiple.component";
35
+ import * as i34 from "../components/flag/flag.component";
35
36
  export declare class PumpkinTechModule {
36
37
  static ɵfac: i0.ɵɵFactoryDeclaration<PumpkinTechModule, never>;
37
- static ɵmod: i0.ɵɵNgModuleDeclaration<PumpkinTechModule, never, [typeof i1.CommonModule, typeof i2.CoreMaterialModule, typeof i3.InputComponent, typeof i4.TextareaComponent, typeof i5.InputDateComponent, typeof i6.InputDateRangeComponent, typeof i7.InputTimeComponent, typeof i8.InputCurrencyComponent, typeof i9.InfoDetailComponent, typeof i10.InfoDetailDialogComponent, typeof i11.ActionDialogComponent, typeof i12.ActionResultDialogComponent, typeof i13.ButtonComponent, typeof i14.BadgeComponent, typeof i15.BadgeStackComponent, typeof i16.BreadcrumbComponent, typeof i17.TitleComponent, typeof i18.ActionRowComponent, typeof i19.HeaderComponent, typeof i20.NavComponent, typeof i21.FooterComponent, typeof i22.IconComponent, typeof i23.SelectEntityComponent, typeof i24.SelectEnumComponent, typeof i25.RadioGroupEnumComponent, typeof i26.RadioGroupEntityComponent, typeof i27.SlideToggleComponent, typeof i28.QuantityItemsComponent, typeof i29.LoadingOverlayComponent, typeof i30.ProfileMenuComponent, typeof i31.CheckBoxComponent, typeof i32.ProgressBarComponent, typeof i33.ProgressBarMultipleComponent], [typeof i3.InputComponent, typeof i4.TextareaComponent, typeof i5.InputDateComponent, typeof i6.InputDateRangeComponent, typeof i7.InputTimeComponent, typeof i8.InputCurrencyComponent, typeof i9.InfoDetailComponent, typeof i10.InfoDetailDialogComponent, typeof i11.ActionDialogComponent, typeof i12.ActionResultDialogComponent, typeof i13.ButtonComponent, typeof i14.BadgeComponent, typeof i15.BadgeStackComponent, typeof i16.BreadcrumbComponent, typeof i17.TitleComponent, typeof i18.ActionRowComponent, typeof i19.HeaderComponent, typeof i20.NavComponent, typeof i21.FooterComponent, typeof i22.IconComponent, typeof i23.SelectEntityComponent, typeof i24.SelectEnumComponent, typeof i25.RadioGroupEnumComponent, typeof i26.RadioGroupEntityComponent, typeof i27.SlideToggleComponent, typeof i28.QuantityItemsComponent, typeof i29.LoadingOverlayComponent, typeof i30.ProfileMenuComponent, typeof i31.CheckBoxComponent, typeof i32.ProgressBarComponent, typeof i33.ProgressBarMultipleComponent, typeof i2.CoreMaterialModule]>;
38
+ static ɵmod: i0.ɵɵNgModuleDeclaration<PumpkinTechModule, never, [typeof i1.CommonModule, typeof i2.CoreMaterialModule, typeof i3.InputComponent, typeof i4.TextareaComponent, typeof i5.InputDateComponent, typeof i6.InputDateRangeComponent, typeof i7.InputTimeComponent, typeof i8.InputCurrencyComponent, typeof i9.InfoDetailComponent, typeof i10.InfoDetailDialogComponent, typeof i11.ActionDialogComponent, typeof i12.ActionResultDialogComponent, typeof i13.ButtonComponent, typeof i14.BadgeComponent, typeof i15.BadgeStackComponent, typeof i16.BreadcrumbComponent, typeof i17.TitleComponent, typeof i18.ActionRowComponent, typeof i19.HeaderComponent, typeof i20.NavComponent, typeof i21.FooterComponent, typeof i22.IconComponent, typeof i23.SelectEntityComponent, typeof i24.SelectEnumComponent, typeof i25.RadioGroupEnumComponent, typeof i26.RadioGroupEntityComponent, typeof i27.SlideToggleComponent, typeof i28.QuantityItemsComponent, typeof i29.LoadingOverlayComponent, typeof i30.ProfileMenuComponent, typeof i31.CheckBoxComponent, typeof i32.ProgressBarComponent, typeof i33.ProgressBarMultipleComponent, typeof i34.FlagComponent], [typeof i3.InputComponent, typeof i4.TextareaComponent, typeof i5.InputDateComponent, typeof i6.InputDateRangeComponent, typeof i7.InputTimeComponent, typeof i8.InputCurrencyComponent, typeof i9.InfoDetailComponent, typeof i10.InfoDetailDialogComponent, typeof i11.ActionDialogComponent, typeof i12.ActionResultDialogComponent, typeof i13.ButtonComponent, typeof i14.BadgeComponent, typeof i15.BadgeStackComponent, typeof i16.BreadcrumbComponent, typeof i17.TitleComponent, typeof i18.ActionRowComponent, typeof i19.HeaderComponent, typeof i20.NavComponent, typeof i21.FooterComponent, typeof i22.IconComponent, typeof i23.SelectEntityComponent, typeof i24.SelectEnumComponent, typeof i25.RadioGroupEnumComponent, typeof i26.RadioGroupEntityComponent, typeof i27.SlideToggleComponent, typeof i28.QuantityItemsComponent, typeof i29.LoadingOverlayComponent, typeof i30.ProfileMenuComponent, typeof i31.CheckBoxComponent, typeof i32.ProgressBarComponent, typeof i33.ProgressBarMultipleComponent, typeof i34.FlagComponent, typeof i2.CoreMaterialModule]>;
38
39
  static ɵinj: i0.ɵɵInjectorDeclaration<PumpkinTechModule>;
39
40
  }
@@ -8,3 +8,4 @@ export * from './phone-brazil.pipe';
8
8
  export * from './phone-spain.pipe';
9
9
  export * from './uptime-format.pipe';
10
10
  export * from './time.durantion.pipe';
11
+ export * from './is-longer-than.pipe';
@@ -0,0 +1,9 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class IsLongerThanPipe implements PipeTransform {
4
+ transform(input: Date | string | number | null | undefined, threshold: number | string, // horas (número) OU string: "00:30", "30m", "2h", "90s", "1:30:00"
5
+ now?: Date | null): boolean;
6
+ private parseThresholdToMs;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<IsLongerThanPipe, never>;
8
+ static ɵpipe: i0.ɵɵPipeDeclaration<IsLongerThanPipe, "isLongerThan", true>;
9
+ }
@@ -1,7 +1,7 @@
1
1
  import { PipeTransform } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class TimeDurationPipe implements PipeTransform {
4
- transform(input: Date | string | number | null | undefined): string;
4
+ transform(input: Date | string | number | null | undefined, now?: Date | null): string;
5
5
  static ɵfac: i0.ɵɵFactoryDeclaration<TimeDurationPipe, never>;
6
- static ɵpipe: i0.ɵɵPipeDeclaration<TimeDurationPipe, "timeDuration", false>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<TimeDurationPipe, "timeDuration", true>;
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pumpkin-tech/pumpkin-tech-ng",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Biblioteca Angular com utilitários e componentes Pumpkin Tech",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -19,14 +19,16 @@
19
19
  "@angular/animations": "18.2.13",
20
20
  "@angular/common": "18.2.13",
21
21
  "@angular/core": "18.2.13",
22
+ "@angular/forms": "18.2.13",
22
23
  "@angular/material": "18.2.13",
23
24
  "@angular/cdk": "18.2.13",
24
25
  "@angular/material-moment-adapter": "18.2.13",
25
26
  "moment": "^2.29.4",
26
27
  "@faker-js/faker": "^9.0.3",
27
- "@ngx-translate/core": "^16.0.4",
28
+ "@ngx-translate/core": "^17.0.0",
28
29
  "ngx-currency": "^18.0.0",
29
- "ngx-material-timepicker": "^13.1.1"
30
+ "ngx-material-timepicker": "^13.1.1",
31
+ "flag-icons": "^7.5.0"
30
32
  },
31
33
  "dependencies": {
32
34
  "tslib": "^2.5.0"
package/public-api.d.ts CHANGED
@@ -34,6 +34,7 @@ export * from './lib/components/input-date';
34
34
  export * from './lib/components/input-time';
35
35
  export * from './lib/components/input-currency';
36
36
  export * from './lib/components/title';
37
+ export * from './lib/components/flag';
37
38
  export * from './lib/modules/pumpkin-tech.module';
38
39
  export * from './lib/modules/directives.module';
39
40
  export * from './lib/modules/pipes.module';