@seniorsistemas/angular-components 18.0.0 → 18.0.2

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 (63) hide show
  1. package/badge/lib/badge/badge.component.d.ts +2 -1
  2. package/badge/lib/badge/badge.module.d.ts +3 -1
  3. package/esm2022/badge/lib/badge/badge.component.mjs +6 -4
  4. package/esm2022/badge/lib/badge/badge.module.mjs +6 -4
  5. package/esm2022/button/lib/button/button.component.mjs +2 -2
  6. package/esm2022/custom-fields/lib/custom-fields/custom-fields.component.mjs +10 -15
  7. package/esm2022/dynamic-form/lib/dynamic-form/components/lookup/lookup.component.mjs +2 -2
  8. package/esm2022/file-upload/lib/file-upload/file-upload.component.mjs +23 -6
  9. package/esm2022/file-upload/lib/file-upload/file-upload.module.mjs +7 -3
  10. package/esm2022/ia-insight/lib/ia-insight/components/ia-insight-card/ia-insight-card.component.mjs +1 -1
  11. package/esm2022/kanban/lib/kanban/components/kanban-item-dragging/kanban-item-dragging.component.mjs +1 -1
  12. package/esm2022/label-value/lib/label-value/label-value.component.mjs +1 -1
  13. package/esm2022/locale/lib/locale/locale.service.mjs +43 -20
  14. package/esm2022/locale/lib/locale/options/index.mjs +7 -6
  15. package/esm2022/locale/lib/locale/pipes/localized-date.pipe.mjs +1 -1
  16. package/esm2022/locale/lib/locale/pipes/localized-time.pipe.mjs +7 -7
  17. package/esm2022/numeric-mask/lib/numeric-mask/numeric-mask.directive.mjs +579 -0
  18. package/esm2022/numeric-mask/lib/numeric-mask/numeric-mask.module.mjs +16 -0
  19. package/esm2022/numeric-mask/public-api.mjs +3 -0
  20. package/esm2022/numeric-mask/seniorsistemas-angular-components-numeric-mask.mjs +5 -0
  21. package/esm2022/object-card/lib/object-card/elements/field/object-card-field.component.mjs +7 -4
  22. package/esm2022/object-card/lib/object-card/object-card.module.mjs +5 -4
  23. package/esm2022/table/lib/table/table-column/table-columns.component.mjs +1 -1
  24. package/esm2022/tooltip/lib/tooltip/tooltip.directive.mjs +26 -20
  25. package/fesm2022/seniorsistemas-angular-components-badge.mjs +10 -6
  26. package/fesm2022/seniorsistemas-angular-components-badge.mjs.map +1 -1
  27. package/fesm2022/seniorsistemas-angular-components-button.mjs +1 -1
  28. package/fesm2022/seniorsistemas-angular-components-button.mjs.map +1 -1
  29. package/fesm2022/seniorsistemas-angular-components-custom-fields.mjs +9 -14
  30. package/fesm2022/seniorsistemas-angular-components-custom-fields.mjs.map +1 -1
  31. package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs +1 -1
  32. package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs.map +1 -1
  33. package/fesm2022/seniorsistemas-angular-components-file-upload.mjs +27 -6
  34. package/fesm2022/seniorsistemas-angular-components-file-upload.mjs.map +1 -1
  35. package/fesm2022/seniorsistemas-angular-components-ia-insight.mjs +1 -1
  36. package/fesm2022/seniorsistemas-angular-components-ia-insight.mjs.map +1 -1
  37. package/fesm2022/seniorsistemas-angular-components-kanban.mjs +1 -1
  38. package/fesm2022/seniorsistemas-angular-components-kanban.mjs.map +1 -1
  39. package/fesm2022/seniorsistemas-angular-components-label-value.mjs +1 -1
  40. package/fesm2022/seniorsistemas-angular-components-label-value.mjs.map +1 -1
  41. package/fesm2022/seniorsistemas-angular-components-locale.mjs +41 -17
  42. package/fesm2022/seniorsistemas-angular-components-locale.mjs.map +1 -1
  43. package/fesm2022/seniorsistemas-angular-components-numeric-mask.mjs +599 -0
  44. package/fesm2022/seniorsistemas-angular-components-numeric-mask.mjs.map +1 -0
  45. package/fesm2022/seniorsistemas-angular-components-object-card.mjs +10 -6
  46. package/fesm2022/seniorsistemas-angular-components-object-card.mjs.map +1 -1
  47. package/fesm2022/seniorsistemas-angular-components-table.mjs +1 -1
  48. package/fesm2022/seniorsistemas-angular-components-table.mjs.map +1 -1
  49. package/fesm2022/seniorsistemas-angular-components-tooltip.mjs +23 -17
  50. package/fesm2022/seniorsistemas-angular-components-tooltip.mjs.map +1 -1
  51. package/file-upload/lib/file-upload/file-upload.component.d.ts +1 -0
  52. package/file-upload/lib/file-upload/file-upload.module.d.ts +2 -1
  53. package/locale/lib/locale/locale.service.d.ts +14 -4
  54. package/locale/lib/locale/options/index.d.ts +6 -5
  55. package/locale/lib/locale/pipes/localized-time.pipe.d.ts +2 -2
  56. package/numeric-mask/README.md +367 -0
  57. package/numeric-mask/index.d.ts +5 -0
  58. package/numeric-mask/lib/numeric-mask/numeric-mask.directive.d.ts +195 -0
  59. package/numeric-mask/lib/numeric-mask/numeric-mask.module.d.ts +7 -0
  60. package/numeric-mask/public-api.d.ts +2 -0
  61. package/object-card/lib/object-card/elements/field/object-card-field.component.d.ts +4 -1
  62. package/object-card/lib/object-card/object-card.module.d.ts +2 -1
  63. package/package.json +7 -1
@@ -0,0 +1,195 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { AbstractControl, ControlValueAccessor, ValidationErrors, Validator } from '@angular/forms';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Numeric mask directive with internationalization support.
6
+ *
7
+ * Formats numeric values according to the specified locale, applying
8
+ * appropriate thousand and decimal separators, with support for negative values,
9
+ * min/max decimal places control, and scientific notation.
10
+ *
11
+ * @example
12
+ * ```html
13
+ * <input
14
+ * type="text"
15
+ * sNumericMask
16
+ * [locale]="'pt-BR'"
17
+ * [minDecimalPlaces]="2"
18
+ * [maxDecimalPlaces]="2"
19
+ * [allowNegative]="true"
20
+ * [(ngModel)]="value"
21
+ * />
22
+ * ```
23
+ */
24
+ export declare class NumericMaskDirective implements OnInit, ControlValueAccessor, Validator {
25
+ /**
26
+ * Locale for formatting (e.g. 'pt-BR', 'en-US', 'de-DE')
27
+ * If not provided, uses the locale from LocaleService
28
+ */
29
+ locale: import("@angular/core").InputSignal<string | undefined>;
30
+ /**
31
+ * Minimum number of decimal places to display
32
+ * @default 0
33
+ */
34
+ minDecimalPlaces: import("@angular/core").InputSignal<number>;
35
+ /**
36
+ * Maximum number of decimal places allowed
37
+ * @default 10
38
+ */
39
+ maxDecimalPlaces: import("@angular/core").InputSignal<number>;
40
+ /**
41
+ * Allows negative values
42
+ * @default false
43
+ */
44
+ allowNegative: import("@angular/core").InputSignal<boolean>;
45
+ /**
46
+ * Enables scientific notation support
47
+ * @default true
48
+ */
49
+ allowScientificNotation: import("@angular/core").InputSignal<boolean>;
50
+ /**
51
+ * Text alignment in input
52
+ * @default 'right'
53
+ */
54
+ textAlign: import("@angular/core").InputSignal<"left" | "right">;
55
+ /**
56
+ * Minimum value allowed
57
+ */
58
+ min: import("@angular/core").InputSignal<number | undefined>;
59
+ /**
60
+ * Maximum value allowed
61
+ */
62
+ max: import("@angular/core").InputSignal<number | undefined>;
63
+ private readonly elementRef;
64
+ private readonly renderer;
65
+ private readonly localeService;
66
+ private onChange;
67
+ private onTouched;
68
+ private decimalSeparator;
69
+ private thousandSeparator;
70
+ private currentLocale;
71
+ private lastModelValue;
72
+ constructor();
73
+ ngOnInit(): void;
74
+ /**
75
+ * Listener for input events (typing)
76
+ */
77
+ onInput(event: Event): void;
78
+ /**
79
+ * Listener for focus events (gaining focus)
80
+ */
81
+ onFocus(): void;
82
+ /**
83
+ * Listener for blur events (focus loss)
84
+ */
85
+ onBlur(): void;
86
+ /**
87
+ * Listener for paste events (clipboard)
88
+ */
89
+ onPaste(event: ClipboardEvent): void;
90
+ /**
91
+ * Listener for special keys (+ and -)
92
+ */
93
+ onKeyDown(event: KeyboardEvent): void;
94
+ /**
95
+ * Listener for keypress to block invalid characters
96
+ */
97
+ onKeyPress(event: KeyboardEvent): void;
98
+ /**
99
+ * Updates separators according to the locale
100
+ * @private
101
+ */
102
+ private updateSeparators;
103
+ /**
104
+ * Processes input value and updates the input and model
105
+ * @private
106
+ */
107
+ private processInputValue;
108
+ /**
109
+ * Sets inputmode for numeric keyboard on mobile devices
110
+ * @private
111
+ */
112
+ private setInputMode;
113
+ /**
114
+ * Removes separators from a formatted value
115
+ * @private
116
+ */
117
+ private removeSeparators;
118
+ /**
119
+ * Strips unnecessary trailing zeros from decimal part
120
+ * @private
121
+ */
122
+ private stripTrailingZeros;
123
+ /**
124
+ * Normalizes separators during typing
125
+ * @private
126
+ */
127
+ private normalizeSeparators;
128
+ /**
129
+ * Escapes special characters for use in regex
130
+ * @private
131
+ */
132
+ private escapeRegex;
133
+ /**
134
+ * Truncates a number to the specified decimal places (never rounds)
135
+ * @private
136
+ */
137
+ private truncateToDecimalPlaces;
138
+ /**
139
+ * Checks if the value has excessive decimal places
140
+ * @private
141
+ */
142
+ private hasExcessiveDecimalPlaces;
143
+ /**
144
+ * Clears the input and notifies the model
145
+ * @private
146
+ */
147
+ private clearInput;
148
+ /**
149
+ * Parses a string value to its numeric representation, handling separators and sign
150
+ * Returns BigNumber to preserve full precision and optional number conversion
151
+ * @private
152
+ */
153
+ private parseStringToValue;
154
+ /**
155
+ * Formats a numeric value according to the locale
156
+ * Truncates (never rounds) to maxDecimalPlaces for display purposes only
157
+ * @private
158
+ */
159
+ private formatNumeric;
160
+ /**
161
+ * Formats the value according to the locale
162
+ * @private
163
+ */
164
+ private formatValue;
165
+ /**
166
+ * Converts the formatted value to the model format (international standard string)
167
+ * Always returns decimal notation, never scientific notation
168
+ * Stores the full precision value without truncation
169
+ * @private
170
+ */
171
+ private toModelValue;
172
+ /**
173
+ * Converts the model value to display format
174
+ * @private
175
+ */
176
+ private fromModelValue;
177
+ /**
178
+ * Processes pasted value from clipboard
179
+ * Converts scientific notation to decimal using BigNumber
180
+ * @private
181
+ */
182
+ private parseClipboardValue;
183
+ /**
184
+ * Toggles the sign (- or +) of a value
185
+ * @private
186
+ */
187
+ private toggleSign;
188
+ writeValue(value: string | null): void;
189
+ registerOnChange(fn: (value: string | null) => void): void;
190
+ registerOnTouched(fn: () => void): void;
191
+ setDisabledState(isDisabled: boolean): void;
192
+ validate(control: AbstractControl): ValidationErrors | null;
193
+ static ɵfac: i0.ɵɵFactoryDeclaration<NumericMaskDirective, never>;
194
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NumericMaskDirective, "[sNumericMask]", never, { "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "minDecimalPlaces": { "alias": "minDecimalPlaces"; "required": false; "isSignal": true; }; "maxDecimalPlaces": { "alias": "maxDecimalPlaces"; "required": false; "isSignal": true; }; "allowNegative": { "alias": "allowNegative"; "required": false; "isSignal": true; }; "allowScientificNotation": { "alias": "allowScientificNotation"; "required": false; "isSignal": true; }; "textAlign": { "alias": "textAlign"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
195
+ }
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./numeric-mask.directive";
3
+ export declare class CurrencyMaskModule {
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<CurrencyMaskModule, never>;
5
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CurrencyMaskModule, never, [typeof i1.NumericMaskDirective], [typeof i1.NumericMaskDirective]>;
6
+ static ɵinj: i0.ɵɵInjectorDeclaration<CurrencyMaskModule>;
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from './lib/numeric-mask/numeric-mask.directive';
2
+ export * from './lib/numeric-mask/numeric-mask.module';
@@ -1,4 +1,5 @@
1
1
  import { EventEmitter, TemplateRef } from '@angular/core';
2
+ import { BadgeColors } from '@seniorsistemas/angular-components/badge';
2
3
  import { ThumbnailComponent } from '@seniorsistemas/angular-components/thumbnail';
3
4
  import { TieredMenuItemData } from '@seniorsistemas/angular-components/tiered-menu';
4
5
  import * as i0 from "@angular/core";
@@ -15,6 +16,8 @@ export declare class ObjectCardFieldComponent {
15
16
  buttonClick: EventEmitter<any>;
16
17
  thumbnailComponent: ThumbnailComponent | null;
17
18
  content: TemplateRef<any> | null;
19
+ badge: import("@angular/core").InputSignal<string>;
20
+ badgeColor: import("@angular/core").InputSignal<BadgeColors>;
18
21
  static ɵfac: i0.ɵɵFactoryDeclaration<ObjectCardFieldComponent, never>;
19
- static ɵcmp: i0.ɵɵComponentDeclaration<ObjectCardFieldComponent, "s-object-card-field", never, { "id": { "alias": "id"; "required": false; }; "imageSource": { "alias": "imageSource"; "required": false; }; "imageAlt": { "alias": "imageAlt"; "required": false; }; "iconClass": { "alias": "iconClass"; "required": false; }; "label": { "alias": "label"; "required": false; }; "description": { "alias": "description"; "required": false; }; "buttonLabel": { "alias": "buttonLabel"; "required": false; }; "buttonModel": { "alias": "buttonModel"; "required": false; }; }, { "buttonClick": "buttonClick"; }, ["thumbnailComponent"], ["s-thumbnail", "[labelTemplate]", "[descriptionTemplate]"], false, never>;
22
+ static ɵcmp: i0.ɵɵComponentDeclaration<ObjectCardFieldComponent, "s-object-card-field", never, { "id": { "alias": "id"; "required": false; }; "imageSource": { "alias": "imageSource"; "required": false; }; "imageAlt": { "alias": "imageAlt"; "required": false; }; "iconClass": { "alias": "iconClass"; "required": false; }; "label": { "alias": "label"; "required": false; }; "description": { "alias": "description"; "required": false; }; "buttonLabel": { "alias": "buttonLabel"; "required": false; }; "buttonModel": { "alias": "buttonModel"; "required": false; }; "badge": { "alias": "badge"; "required": false; "isSignal": true; }; "badgeColor": { "alias": "badgeColor"; "required": false; "isSignal": true; }; }, { "buttonClick": "buttonClick"; }, ["thumbnailComponent"], ["s-thumbnail", "[labelTemplate]", "[descriptionTemplate]"], false, never>;
20
23
  }
@@ -7,8 +7,9 @@ import * as i5 from "@seniorsistemas/angular-components/tooltip";
7
7
  import * as i6 from "@seniorsistemas/angular-components/thumbnail";
8
8
  import * as i7 from "@seniorsistemas/angular-components/button";
9
9
  import * as i8 from "@seniorsistemas/angular-components/shared";
10
+ import * as i9 from "@seniorsistemas/angular-components/badge";
10
11
  export declare class ObjectCardModule {
11
12
  static ɵfac: i0.ɵɵFactoryDeclaration<ObjectCardModule, never>;
12
- static ɵmod: i0.ɵɵNgModuleDeclaration<ObjectCardModule, [typeof i1.ObjectCardComponent, typeof i2.ObjectCardMainComponent, typeof i3.ObjectCardFieldComponent], [typeof i4.CommonModule, typeof i5.TooltipModule, typeof i6.ThumbnailModule, typeof i7.ButtonModule, typeof i8.BorderButtonModule], [typeof i6.ThumbnailModule, typeof i1.ObjectCardComponent, typeof i2.ObjectCardMainComponent, typeof i3.ObjectCardFieldComponent]>;
13
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ObjectCardModule, [typeof i1.ObjectCardComponent, typeof i2.ObjectCardMainComponent, typeof i3.ObjectCardFieldComponent], [typeof i4.CommonModule, typeof i5.TooltipModule, typeof i6.ThumbnailModule, typeof i7.ButtonModule, typeof i8.BorderButtonModule, typeof i9.BadgeModule], [typeof i6.ThumbnailModule, typeof i1.ObjectCardComponent, typeof i2.ObjectCardMainComponent, typeof i3.ObjectCardFieldComponent]>;
13
14
  static ɵinj: i0.ɵɵInjectorDeclaration<ObjectCardModule>;
14
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seniorsistemas/angular-components",
3
- "version": "18.0.0",
3
+ "version": "18.0.2",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^18.2.14",
6
6
  "@angular/common": "^18.2.0",
@@ -316,6 +316,12 @@
316
316
  "esm": "./esm2022/numeric/seniorsistemas-angular-components-numeric.mjs",
317
317
  "default": "./fesm2022/seniorsistemas-angular-components-numeric.mjs"
318
318
  },
319
+ "./numeric-mask": {
320
+ "types": "./numeric-mask/index.d.ts",
321
+ "esm2022": "./esm2022/numeric-mask/seniorsistemas-angular-components-numeric-mask.mjs",
322
+ "esm": "./esm2022/numeric-mask/seniorsistemas-angular-components-numeric-mask.mjs",
323
+ "default": "./fesm2022/seniorsistemas-angular-components-numeric-mask.mjs"
324
+ },
319
325
  "./object-card": {
320
326
  "types": "./object-card/index.d.ts",
321
327
  "esm2022": "./esm2022/object-card/seniorsistemas-angular-components-object-card.mjs",