@seniorsistemas/angular-components 19.1.1 → 19.3.0

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.
Files changed (70) hide show
  1. package/bignumber-input/lib/bignumber-input/bignumber-input.directive.d.ts +58 -25
  2. package/dynamic-form/dynamic-form/components/lookup/lookup.component.d.ts +8 -8
  3. package/dynamic-form/dynamic-form/dynamic-form.directive.d.ts +3 -0
  4. package/dynamic-form/dynamic-form/form-field/configurations/fields/field.d.ts +7 -0
  5. package/dynamic-form/public-api.d.ts +2 -3
  6. package/esm2022/bignumber-input/lib/bignumber-input/bignumber-input.directive.mjs +140 -99
  7. package/esm2022/dynamic-form/dynamic-form/components/lookup/lookup.component.mjs +12 -12
  8. package/esm2022/dynamic-form/dynamic-form/dynamic-form.directive.mjs +17 -1
  9. package/esm2022/dynamic-form/dynamic-form/form-field/configurations/fields/field.mjs +1 -1
  10. package/esm2022/dynamic-form/dynamic-form/form-field/fields/bignumber/bignumber-field.component.mjs +3 -3
  11. package/esm2022/dynamic-form/dynamic-form/form-field/fields/currency/currency-field.component.mjs +3 -3
  12. package/esm2022/dynamic-form/dynamic-form/form-field/fields/number/number-field.component.mjs +3 -3
  13. package/esm2022/dynamic-form/public-api.mjs +3 -4
  14. package/esm2022/inline-edit/lib/inline-edit/components/fields/inline-edit-number/inline-edit-number.component.mjs +1 -1
  15. package/esm2022/inline-edit/lib/inline-edit/fields/inline-edit-number-field.mjs +2 -3
  16. package/esm2022/lib/locale/fallback.mjs +10 -2
  17. package/esm2022/locale/lib/locale/apply-localized-mask.mjs +19 -0
  18. package/esm2022/locale/lib/locale/pipes/localized-bignumber-impure.pipe.mjs +1 -1
  19. package/esm2022/locale/lib/locale/pipes/localized-bignumber.pipe.mjs +5 -4
  20. package/esm2022/locale/public-api.mjs +2 -1
  21. package/esm2022/number-input/lib/number-input/number-input.directive.mjs +12 -148
  22. package/esm2022/number-input/lib/number-input/number-input.module.mjs +5 -5
  23. package/esm2022/numeric-mask/lib/numeric-mask/numeric-mask.directive.mjs +32 -35
  24. package/esm2022/spotlight/lib/spotlight/spotlight-overlay/spotlight-overlay.component.mjs +460 -0
  25. package/esm2022/spotlight/lib/spotlight/spotlight-step.directive.mjs +50 -0
  26. package/esm2022/spotlight/lib/spotlight/spotlight-tour.service.mjs +251 -0
  27. package/esm2022/spotlight/lib/spotlight/spotlight.component.mjs +193 -0
  28. package/esm2022/spotlight/lib/spotlight/types/spotlight-position.mjs +2 -0
  29. package/esm2022/spotlight/lib/spotlight/types/spotlight-step.mjs +2 -0
  30. package/esm2022/spotlight/lib/spotlight/types/spotlight-stop-event.mjs +2 -0
  31. package/esm2022/spotlight/public-api.mjs +4 -0
  32. package/esm2022/spotlight/seniorsistemas-angular-components-spotlight.mjs +5 -0
  33. package/esm2022/table/lib/table/table-column/table-columns.component.mjs +20 -4
  34. package/fesm2022/seniorsistemas-angular-components-bignumber-input.mjs +139 -98
  35. package/fesm2022/seniorsistemas-angular-components-bignumber-input.mjs.map +1 -1
  36. package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs +35 -19
  37. package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs.map +1 -1
  38. package/fesm2022/seniorsistemas-angular-components-inline-edit.mjs +2 -3
  39. package/fesm2022/seniorsistemas-angular-components-inline-edit.mjs.map +1 -1
  40. package/fesm2022/seniorsistemas-angular-components-locale.mjs +22 -4
  41. package/fesm2022/seniorsistemas-angular-components-locale.mjs.map +1 -1
  42. package/fesm2022/seniorsistemas-angular-components-number-input.mjs +14 -151
  43. package/fesm2022/seniorsistemas-angular-components-number-input.mjs.map +1 -1
  44. package/fesm2022/seniorsistemas-angular-components-numeric-mask.mjs +31 -34
  45. package/fesm2022/seniorsistemas-angular-components-numeric-mask.mjs.map +1 -1
  46. package/fesm2022/seniorsistemas-angular-components-spotlight.mjs +947 -0
  47. package/fesm2022/seniorsistemas-angular-components-spotlight.mjs.map +1 -0
  48. package/fesm2022/seniorsistemas-angular-components-table.mjs +20 -5
  49. package/fesm2022/seniorsistemas-angular-components-table.mjs.map +1 -1
  50. package/fesm2022/seniorsistemas-angular-components.mjs +9 -1
  51. package/fesm2022/seniorsistemas-angular-components.mjs.map +1 -1
  52. package/inline-edit/lib/inline-edit/fields/inline-edit-number-field.d.ts +2 -3
  53. package/locale/lib/locale/apply-localized-mask.d.ts +9 -0
  54. package/locale/lib/locale/pipes/localized-bignumber-impure.pipe.d.ts +2 -3
  55. package/locale/lib/locale/pipes/localized-bignumber.pipe.d.ts +3 -2
  56. package/locale/public-api.d.ts +1 -0
  57. package/number-input/lib/number-input/number-input.directive.d.ts +7 -47
  58. package/number-input/lib/number-input/number-input.module.d.ts +2 -2
  59. package/numeric-mask/lib/numeric-mask/numeric-mask.directive.d.ts +8 -9
  60. package/package.json +13 -7
  61. package/spotlight/README.md +311 -0
  62. package/spotlight/index.d.ts +5 -0
  63. package/spotlight/lib/spotlight/spotlight-overlay/spotlight-overlay.component.d.ts +70 -0
  64. package/spotlight/lib/spotlight/spotlight-step.directive.d.ts +28 -0
  65. package/spotlight/lib/spotlight/spotlight-tour.service.d.ts +146 -0
  66. package/spotlight/lib/spotlight/spotlight.component.d.ts +82 -0
  67. package/spotlight/lib/spotlight/types/spotlight-position.d.ts +1 -0
  68. package/spotlight/lib/spotlight/types/spotlight-step.d.ts +21 -0
  69. package/spotlight/lib/spotlight/types/spotlight-stop-event.d.ts +13 -0
  70. package/spotlight/public-api.d.ts +6 -0
@@ -1,9 +1,9 @@
1
- import { ElementRef, EventEmitter, KeyValueDiffers, OnChanges, OnInit, SimpleChanges } from '@angular/core';
2
- import { CurrencyMaskDirective } from 'ng2-currency-mask';
3
- import { LocaleService } from '@seniorsistemas/angular-components/locale';
1
+ import { OnInit, OnChanges, SimpleChanges } from '@angular/core';
2
+ import { AbstractControl, ValidationErrors } from '@angular/forms';
3
+ import { NumericMaskDirective } from '@seniorsistemas/angular-components/numeric-mask';
4
4
  import * as i0 from "@angular/core";
5
5
  /**
6
- * @deprecated Should use 'AlignmentOptions' from @seniorsistemas/ng2-currency-mask instead
6
+ * @deprecated Este enum não tem mais efeito. O alinhamento do campo é sempre `'right'`.
7
7
  */
8
8
  export declare enum BignumberAlignmentOption {
9
9
  RIGHT = "right",
@@ -22,66 +22,99 @@ export declare enum BignumberAlignmentOption {
22
22
  *
23
23
  * @category Inputs
24
24
  */
25
- export declare class BignumberInputDirective extends CurrencyMaskDirective implements OnInit, OnChanges {
26
- private readonly localeService;
25
+ export declare class BignumberInputDirective extends NumericMaskDirective implements OnInit, OnChanges {
27
26
  /**
28
- * @description Número total de dígitos significativos aceitos pelo campo.
27
+ * @description Número total de dígitos significativos aceitos pelo campo (parte inteira + parte decimal).
28
+ *
29
+ * Durante a digitação, o campo limita fisicamente o número de caracteres via `maxLength`.
30
+ * Ao colar um valor que ultrapasse o limite, o evento `pasteRejected` é emitido e a colagem é cancelada.
31
+ * Após sair do campo (blur) ou ao submeter o formulário, se o valor ultrapassar `precision`,
32
+ * o campo ficará inválido com o erro `exceedsPrecision: { precision, actual }`.
29
33
  *
30
34
  * @default 15
31
35
  */
32
- precision: number;
36
+ precision: import("@angular/core").InputSignal<number>;
33
37
  /**
38
+ * @deprecated Use `minDecimalPlaces` e `maxDecimalPlaces` ao invés deste.
34
39
  * @description Número de casas decimais exibidas e aceitas pelo campo.
40
+ * Quando informado, repassa o valor para `minDecimalPlaces` e `maxDecimalPlaces`.
41
+ *
42
+ * @default 0
43
+ */
44
+ scale: import("@angular/core").InputSignal<number>;
45
+ /**
46
+ * @description Número mínimo de casas decimais exibidas.
47
+ *
48
+ * @default 0
49
+ */
50
+ minDecimalPlaces: import("@angular/core").ModelSignal<number>;
51
+ /**
52
+ * @description Número máximo de casas decimais aceitas.
35
53
  *
36
54
  * @default 0
37
55
  */
38
- scale: number;
56
+ maxDecimalPlaces: import("@angular/core").ModelSignal<number>;
39
57
  /**
40
58
  * @description Separador decimal personalizado. Quando não informado,
41
59
  * utiliza o separador definido pelo locale ativo da aplicação.
42
60
  */
43
- decimalSeparator?: string;
61
+ decimalSeparator: import("@angular/core").ModelSignal<string>;
62
+ /**
63
+ * @deprecated Use `thousandSeparator` ao invés deste.
64
+ * @description Separador de milhar personalizado. Recomenda-se migrar para `thousandSeparator`.
65
+ */
66
+ thousandsSeparator: import("@angular/core").InputSignal<string | undefined>;
44
67
  /**
45
68
  * @description Separador de milhar personalizado. Quando não informado,
46
69
  * utiliza o separador definido pelo locale ativo da aplicação.
47
70
  */
48
- thousandsSeparator?: string;
71
+ thousandSeparator: import("@angular/core").ModelSignal<string>;
49
72
  /**
50
- * @description Alinhamento do conteúdo do campo. Aceita `'left'` ou `'right'`.
51
- *
52
- * @default 'left'
73
+ * @deprecated Este input não tem mais efeito e pode ser removido.
74
+ * O alinhamento do campo é sempre `'right'`, conforme o comportamento padrão da máscara numérica.
53
75
  */
54
- alignTo: 'left' | 'right';
76
+ alignTo: import("@angular/core").InputSignal<"right" | "left">;
55
77
  /**
56
78
  * @description Permite a entrada de valores negativos.
57
79
  *
58
80
  * @default true
59
81
  */
60
- allowNegative: boolean;
82
+ allowNegative: import("@angular/core").InputSignal<boolean>;
61
83
  /**
62
84
  * @description Texto de placeholder exibido quando o campo está vazio.
63
85
  */
64
- placeholder?: string;
86
+ placeholder: import("@angular/core").ModelSignal<string | undefined>;
65
87
  maxLength?: number;
66
88
  /**
67
- * @description Emitido quando uma colé (paste) é rejeitada pela validação do campo.
89
+ * @description Emitido quando uma colagem (paste) é rejeitada pela validação do campo.
68
90
  * Emite a string colada que foi recusada.
69
91
  */
70
- pasteRejected: EventEmitter<string>;
71
- private readonly regex;
72
- constructor(_elementRef: ElementRef, _keyValueDiffers: KeyValueDiffers, localeService: LocaleService);
92
+ pasteRejected: import("@angular/core").OutputEmitterRef<string>;
93
+ private _decimalSeparatorExplicit;
94
+ private _thousandSeparatorExplicit;
95
+ constructor();
73
96
  ngOnInit(): void;
74
97
  ngOnChanges(changes: SimpleChanges): void;
98
+ /**
99
+ * Overrides base paste handler to add precision validation.
100
+ * If the pasted value exceeds `precision` digits, the paste is rejected.
101
+ */
75
102
  onPaste(event: ClipboardEvent): void;
76
103
  /**
77
- * Update the options values according to the directive input values.
104
+ * Overrides locale-derived separators with explicitly set inputs, if provided.
105
+ * If no explicit separator is set, the locale-derived value is used.
106
+ */
107
+ protected updateSeparators(): void;
108
+ /**
109
+ * Overrides base validator to add precision validation.
110
+ * If the total number of significant digits exceeds `precision`, returns an `exceedsPrecision` error.
78
111
  */
79
- private updateVariables;
112
+ validate(control: AbstractControl): ValidationErrors | null;
80
113
  /**
81
114
  * Responsible to calculate the field maximum length considering the separators.
82
115
  */
83
116
  private calculateMaxLength;
84
- private onLocaleService;
117
+ private updatePlaceholder;
85
118
  static ɵfac: i0.ɵɵFactoryDeclaration<BignumberInputDirective, never>;
86
- static ɵdir: i0.ɵɵDirectiveDeclaration<BignumberInputDirective, "input[sBignumberInput]", never, { "precision": { "alias": "precision"; "required": false; }; "scale": { "alias": "scale"; "required": false; }; "decimalSeparator": { "alias": "decimalSeparator"; "required": false; }; "thousandsSeparator": { "alias": "thousandsSeparator"; "required": false; }; "alignTo": { "alias": "alignTo"; "required": false; }; "allowNegative": { "alias": "allowNegative"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; }, { "pasteRejected": "pasteRejected"; }, never, never, false, never>;
119
+ static ɵdir: i0.ɵɵDirectiveDeclaration<BignumberInputDirective, "input[sBignumberInput]", never, { "precision": { "alias": "precision"; "required": false; "isSignal": true; }; "scale": { "alias": "scale"; "required": false; "isSignal": true; }; "minDecimalPlaces": { "alias": "minDecimalPlaces"; "required": false; "isSignal": true; }; "maxDecimalPlaces": { "alias": "maxDecimalPlaces"; "required": false; "isSignal": true; }; "decimalSeparator": { "alias": "decimalSeparator"; "required": false; "isSignal": true; }; "thousandsSeparator": { "alias": "thousandsSeparator"; "required": false; "isSignal": true; }; "thousandSeparator": { "alias": "thousandSeparator"; "required": false; "isSignal": true; }; "alignTo": { "alias": "alignTo"; "required": false; "isSignal": true; }; "allowNegative": { "alias": "allowNegative"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; }, { "minDecimalPlaces": "minDecimalPlacesChange"; "maxDecimalPlaces": "maxDecimalPlacesChange"; "decimalSeparator": "decimalSeparatorChange"; "thousandSeparator": "thousandSeparatorChange"; "placeholder": "placeholderChange"; "pasteRejected": "pasteRejected"; }, never, never, false, never>;
87
120
  }
@@ -1,14 +1,12 @@
1
1
  import { ChangeDetectorRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
2
2
  import { ControlValueAccessor, FormGroup } from '@angular/forms';
3
3
  import { TranslateService } from '@ngx-translate/core';
4
- import { MaskConfig } from '@seniorsistemas/ng2-currency-mask';
4
+ import { LoadingStateIndicators } from '@seniorsistemas/angular-components/loading-state';
5
+ import { LocalizedBignumberOptions } from '@seniorsistemas/angular-components/locale';
5
6
  import { HotkeysService } from 'angular2-hotkeys';
6
7
  import { SortMeta } from 'primeng/api';
7
8
  import { AutoComplete, AutoCompleteCompleteEvent } from 'primeng/autocomplete';
8
9
  import { Table, TableLazyLoadEvent } from 'primeng/table';
9
- import { DefaultFilter } from './types/default-filter';
10
- import { LabelOptions } from './types/label-options';
11
- import { LoadingStateIndicators } from '@seniorsistemas/angular-components/loading-state';
12
10
  import { DynamicStructure } from '../../configurations/structure/structure';
13
11
  import { BignumberFieldConfig } from '../../form-field/configurations/fields/bignumber-field';
14
12
  import { CurrencyFieldConfig } from '../../form-field/configurations/fields/currency-field';
@@ -17,6 +15,8 @@ import { NumberFieldConfig } from '../../form-field/configurations/fields/number
17
15
  import { SelectFieldConfig } from '../../form-field/configurations/fields/select-field';
18
16
  import { TextFieldConfig } from '../../form-field/configurations/fields/text-field';
19
17
  import { LookupSearchRequest } from './models/lookup-api.model';
18
+ import { DefaultFilter } from './types/default-filter';
19
+ import { LabelOptions } from './types/label-options';
20
20
  import * as i0 from "@angular/core";
21
21
  export declare class LookupComponent implements ControlValueAccessor, OnChanges, OnInit, OnDestroy {
22
22
  private readonly hotkeysService;
@@ -128,10 +128,10 @@ export declare class LookupComponent implements ControlValueAccessor, OnChanges,
128
128
  getColWidth(label: string): string;
129
129
  getScale(scale: any): number;
130
130
  private isFunction;
131
- getDoubleMaskConfig(col: NumberFieldConfig | BignumberFieldConfig): MaskConfig;
132
- getMoneyMaskConfig(col: CurrencyFieldConfig): MaskConfig;
133
- getIntegerMaskConfig(col: BignumberFieldConfig | NumberFieldConfig): MaskConfig;
134
- getNumberMaskConfig(col: NumberFieldConfig | BignumberFieldConfig): MaskConfig;
131
+ getDoubleMaskConfig(col: NumberFieldConfig | BignumberFieldConfig): LocalizedBignumberOptions;
132
+ getMoneyMaskConfig(col: CurrencyFieldConfig): LocalizedBignumberOptions;
133
+ getIntegerMaskConfig(col: BignumberFieldConfig | NumberFieldConfig): LocalizedBignumberOptions;
134
+ getNumberMaskConfig(col: NumberFieldConfig | BignumberFieldConfig): LocalizedBignumberOptions;
135
135
  parseValueMaskValue(col: DynamicType, rowData: any): any;
136
136
  fieldHasMask(field: DynamicType): field is NumberFieldConfig | BignumberFieldConfig | TextFieldConfig;
137
137
  onTableRowDoubleClick(rowData: any): void;
@@ -17,12 +17,15 @@ export declare class DynamicFormDirective implements OnInit, OnChanges, OnDestro
17
17
  });
18
18
  component: ComponentRef<any> | null;
19
19
  private readonly viewContainerRef;
20
+ private readonly spotlightTourService;
20
21
  ngOnInit(): void;
21
22
  ngOnChanges(): void;
22
23
  ngOnDestroy(): void;
23
24
  private isField;
24
25
  private isStructure;
25
26
  private get getType();
27
+ private registerSpotlightStep;
28
+ private unregisterSpotlightStep;
26
29
  static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFormDirective, never>;
27
30
  static ɵdir: i0.ɵɵDirectiveDeclaration<DynamicFormDirective, "[sDynamicForm]", never, { "sDynamicForm": { "alias": "sDynamicForm"; "required": false; }; }, {}, never, never, true, never>;
28
31
  }
@@ -53,6 +53,13 @@ export interface FieldConfig {
53
53
  * Útil para garantir que o tooltip apareça próximo ao campo correto em layouts complexos.
54
54
  */
55
55
  useInfoSignFocusedInputRef?: boolean;
56
+ /**
57
+ * ID do passo do Spotlight Tour associado a este campo.
58
+ * Quando definido, o campo é automaticamente registrado no `SpotlightTourService`
59
+ * e pode ser usado como alvo de um passo de tour ou destaque.
60
+ * @example 'produto-nome'
61
+ */
62
+ spotlightStepId?: string;
56
63
  }
57
64
  export interface FieldTypeMap {
58
65
  }
@@ -6,8 +6,8 @@ export { LookupComponent } from './dynamic-form/components/lookup/lookup.compone
6
6
  export type { LookupSearchRequest } from './dynamic-form/components/lookup/models/lookup-api.model';
7
7
  export type { BaseFieldComponentConfig } from './dynamic-form/form-field/fields/base-field-component';
8
8
  export { type ExpandedDynamicType } from './dynamic-form/configurations/structure/row';
9
- export * from './dynamic-form/dynamic-form.component';
10
- export * from './dynamic-form/dynamic-form.directive';
9
+ export { DynamicFormComponent, dynamicTypeToDynamicStructure } from './dynamic-form/dynamic-form.component';
10
+ export { DynamicFormDirective } from './dynamic-form/dynamic-form.directive';
11
11
  export * from './dynamic-form/dynamic-form.module';
12
12
  export type { AutocompleteFieldConfig } from './dynamic-form/form-field/configurations/fields/autocomplete-field';
13
13
  export { type BignumberFieldConfig } from './dynamic-form/form-field/configurations/fields/bignumber-field';
@@ -28,7 +28,6 @@ export { RationButtonOption, type RadioButtonFieldConfig, } from './dynamic-form
28
28
  export { type SelectFieldConfig, type SelectOption, } from './dynamic-form/form-field/configurations/fields/select-field';
29
29
  export { type SliderFieldConfig } from './dynamic-form/form-field/configurations/fields/slider-field';
30
30
  export { type StarRatingFieldConfig } from './dynamic-form/form-field/configurations/fields/star-rating-field';
31
- export * from './dynamic-form/form-field/configurations/fields/text-area-field';
32
31
  export { type TextAreaFieldConfig } from './dynamic-form/form-field/configurations/fields/text-area-field';
33
32
  export { type ContentGeneratorFieldConfig } from './dynamic-form/form-field/configurations/fields/content-generator-field';
34
33
  export { type TextFieldConfig } from './dynamic-form/form-field/configurations/fields/text-field';