@seniorsistemas/angular-components 19.9.0 → 19.9.1

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 (28) hide show
  1. package/bignumber-input/lib/bignumber-input/bignumber-input.directive.d.ts +7 -1
  2. package/control-errors/lib/control-errors/control-errors.component.d.ts +11 -2
  3. package/esm2022/bignumber-input/lib/bignumber-input/bignumber-input.directive.mjs +8 -2
  4. package/esm2022/control-errors/lib/control-errors/control-errors.component.mjs +21 -1
  5. package/esm2022/drawer/lib/drawer/drawer.component.mjs +3 -3
  6. package/esm2022/dynamic-form/dynamic-form/form-field/fields/bignumber/bignumber-field.component.mjs +2 -2
  7. package/esm2022/inline-edit/lib/inline-edit/components/fields/inline-edit-number/inline-edit-number.component.mjs +1 -1
  8. package/esm2022/numeric-mask/lib/numeric-mask/numeric-mask.directive.mjs +62 -6
  9. package/esm2022/sidebar/public-api.mjs +12 -1
  10. package/fesm2022/seniorsistemas-angular-components-bignumber-input.mjs +7 -1
  11. package/fesm2022/seniorsistemas-angular-components-bignumber-input.mjs.map +1 -1
  12. package/fesm2022/seniorsistemas-angular-components-control-errors.mjs +20 -0
  13. package/fesm2022/seniorsistemas-angular-components-control-errors.mjs.map +1 -1
  14. package/fesm2022/seniorsistemas-angular-components-drawer.mjs +2 -2
  15. package/fesm2022/seniorsistemas-angular-components-drawer.mjs.map +1 -1
  16. package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs +1 -1
  17. package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs.map +1 -1
  18. package/fesm2022/seniorsistemas-angular-components-inline-edit.mjs +1 -1
  19. package/fesm2022/seniorsistemas-angular-components-inline-edit.mjs.map +1 -1
  20. package/fesm2022/seniorsistemas-angular-components-numeric-mask.mjs +61 -5
  21. package/fesm2022/seniorsistemas-angular-components-numeric-mask.mjs.map +1 -1
  22. package/fesm2022/seniorsistemas-angular-components-sidebar.mjs +12 -1
  23. package/fesm2022/seniorsistemas-angular-components-sidebar.mjs.map +1 -1
  24. package/numeric-mask/README.md +164 -60
  25. package/numeric-mask/lib/numeric-mask/numeric-mask.directive.d.ts +29 -2
  26. package/package.json +7 -7
  27. package/sidebar/README.md +3 -3
  28. package/sidebar/public-api.d.ts +10 -0
@@ -1 +1 @@
1
- {"version":3,"file":"seniorsistemas-angular-components-numeric-mask.mjs","sources":["../../projects/angular-components/numeric-mask/src/lib/numeric-mask/numeric-mask.directive.ts","../../projects/angular-components/numeric-mask/src/lib/numeric-mask/numeric-mask.module.ts","../../projects/angular-components/numeric-mask/src/seniorsistemas-angular-components-numeric-mask.ts"],"sourcesContent":["import {\n Directive,\n DestroyRef,\n ElementRef,\n forwardRef,\n inject,\n input,\n model,\n OnChanges,\n OnInit,\n Renderer2,\n SimpleChanges,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n ValidationErrors,\n Validator,\n} from '@angular/forms';\n\nimport { LocaleService } from '@seniorsistemas/angular-components/locale';\nimport BigNumber from 'bignumber.js';\n\n/**\n * @description Diretiva de máscara numérica com suporte a internacionalização.\n *\n * Formata valores numéricos de acordo com o locale especificado, aplicando\n * separadores de milhar e decimal adequados, com suporte a valores negativos,\n * controle de casas decimais mín/máx e notação científica.\n *\n * @example\n * ```html\n * <input\n * type=\"text\"\n * sNumericMask\n * [locale]=\"'pt-BR'\"\n * [minDecimalPlaces]=\"2\"\n * [maxDecimalPlaces]=\"2\"\n * [allowNegative]=\"true\"\n * [(ngModel)]=\"value\"\n * />\n * ```\n * @category Numeric\n */\n@Directive({\n selector: '[sNumericMask]',\n standalone: true,\n host: {\n '(input)': 'onInput($event)',\n '(focus)': 'onFocus()',\n '(blur)': 'onBlur()',\n '(paste)': 'onPaste($event)',\n '(keydown)': 'onKeyDown($event)',\n '(keypress)': 'onKeyPress($event)',\n '[style.text-align]': '\"right\"',\n },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => NumericMaskDirective),\n multi: true,\n },\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => NumericMaskDirective),\n multi: true,\n },\n ],\n})\nexport class NumericMaskDirective implements OnInit, OnChanges, ControlValueAccessor, Validator {\n /**\n * Locale for formatting (e.g. 'pt-BR', 'en-US', 'de-DE')\n * If not provided, uses the locale from LocaleService\n */\n public locale = input<string | undefined>(undefined);\n\n /**\n * Minimum number of decimal places to display\n * @default 0\n */\n public minDecimalPlaces = input(0);\n\n /**\n * Maximum number of decimal places allowed\n * @default 10\n */\n public maxDecimalPlaces = input(10);\n\n /**\n * Allows negative values\n * @default false\n */\n public allowNegative = input(false);\n\n /**\n * Enables scientific notation support\n * @default true\n */\n public allowScientificNotation = input(true);\n\n /**\n * Minimum value allowed\n */\n public min = input<number | undefined>(undefined);\n\n /**\n * Maximum value allowed\n */\n public max = input<number | undefined>(undefined);\n\n private readonly elementRef = inject(ElementRef<HTMLInputElement>);\n private readonly renderer = inject(Renderer2);\n private readonly localeService = inject(LocaleService, { optional: true });\n private readonly _destroyRef = inject(DestroyRef);\n\n private onChange: (value: string | null) => void = () => {};\n private onTouched: () => void = () => {};\n public decimalSeparator = model(',');\n public thousandSeparator = model('.');\n protected currentLocale = 'pt-BR';\n private lastModelValue: string | null = null;\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes['locale'] && !changes['locale'].firstChange && this.locale()) {\n this.currentLocale = this.locale()!;\n this.updateSeparators();\n this.setInputMode();\n }\n }\n\n public ngOnInit(): void {\n if (this.minDecimalPlaces() > this.maxDecimalPlaces()) {\n throw new Error(\n `NumericMaskDirective: minDecimalPlaces (${this.minDecimalPlaces()}) cannot be greater than maxDecimalPlaces (${this.maxDecimalPlaces()})`,\n );\n }\n\n if (this.locale()) {\n this.currentLocale = this.locale()!;\n this.updateSeparators();\n this.setInputMode();\n } else if (this.localeService) {\n this.localeService\n .get()\n .pipe(takeUntilDestroyed(this._destroyRef))\n .subscribe(() => {\n this.currentLocale = this.localeService!.getLocaleOptions()?.locale || 'pt-BR';\n this.updateSeparators();\n this.setInputMode();\n });\n } else {\n this.updateSeparators();\n this.setInputMode();\n }\n }\n\n /**\n * Listener for input events (typing)\n */\n public onInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n let value = input.value;\n value = this.normalizeSeparators(value);\n this.processInputValue(value);\n }\n\n /**\n * Listener for focus events (gaining focus)\n */\n public onFocus(): void {\n const input = this.elementRef.nativeElement;\n const currentValue = input.value;\n\n if (!currentValue || currentValue.trim() === '') {\n return;\n }\n\n if (this.lastModelValue) {\n const displayValue = this.lastModelValue.replace('.', this.decimalSeparator());\n this.renderer.setProperty(input, 'value', displayValue);\n input.select();\n return;\n }\n\n const modelValue = this.toModelValue(currentValue);\n\n if (!modelValue) {\n return;\n }\n\n const displayValue = modelValue.replace('.', this.decimalSeparator());\n this.renderer.setProperty(input, 'value', displayValue);\n input.select();\n }\n\n /**\n * Listener for blur events (focus loss)\n */\n public onBlur(): void {\n this.onTouched();\n\n const currentValue = this.elementRef.nativeElement.value;\n\n if (!currentValue || currentValue.trim() === '') {\n this.onChange(null);\n this.lastModelValue = null;\n return;\n }\n\n const modelValue = this.toModelValue(currentValue);\n\n if (!modelValue) {\n this.onChange(null);\n this.lastModelValue = null;\n return;\n }\n\n this.lastModelValue = modelValue;\n const displayValue = this.fromModelValue(modelValue);\n this.renderer.setProperty(this.elementRef.nativeElement, 'value', displayValue);\n this.onChange(modelValue);\n }\n\n /**\n * Listener for paste events (clipboard)\n */\n public onPaste(event: ClipboardEvent): void {\n event.preventDefault();\n\n const pastedText = event.clipboardData?.getData('text') || '';\n let value = this.parseClipboardValue(pastedText);\n\n this.processInputValue(value);\n }\n\n /**\n * Listener for special keys (+ and -)\n */\n public onKeyDown(event: KeyboardEvent): void {\n const key = event.key;\n\n if (key === '-' || key === '+') {\n const input = this.elementRef.nativeElement;\n const value = input.value;\n const cursorPosition = input.selectionStart || 0;\n\n if (key === '-' && this.allowScientificNotation()) {\n const charBeforeCursor = value[cursorPosition - 1];\n if (charBeforeCursor === 'e' || charBeforeCursor === 'E') {\n return;\n }\n }\n\n event.preventDefault();\n if (!this.allowNegative()) {\n return;\n }\n\n this.toggleSign(value, key === '-');\n }\n }\n\n /**\n * Listener for keypress to block invalid characters\n */\n public onKeyPress(event: KeyboardEvent): void {\n const key = event.key;\n const input = this.elementRef.nativeElement;\n const cursorPosition = input.selectionStart || 0;\n const value = input.value;\n\n if ((key === '-' || key === '+') && this.allowScientificNotation()) {\n const charBeforeCursor = value[cursorPosition - 1];\n if (charBeforeCursor === 'e' || charBeforeCursor === 'E') {\n return;\n }\n }\n\n if (key === '+' || key === '-') {\n event.preventDefault();\n return;\n }\n\n const isDigit = /^[0-9]$/.test(key);\n const isDecimalSeparator = key === ',' || key === '.';\n const isScientificNotation = (key === 'e' || key === 'E') && this.allowScientificNotation();\n const isControlKey = event.ctrlKey || event.metaKey || event.altKey;\n const isSpecialKey = [\n 'Backspace',\n 'Tab',\n 'Enter',\n 'Escape',\n 'ArrowLeft',\n 'ArrowRight',\n 'Delete',\n 'Home',\n 'End',\n ].includes(key);\n\n if (isScientificNotation) {\n if (value.includes('e') || value.includes('E')) {\n event.preventDefault();\n return;\n }\n\n const charBeforeCursor = value[cursorPosition - 1];\n if (!charBeforeCursor || !/^[0-9]$/.test(charBeforeCursor)) {\n event.preventDefault();\n return;\n }\n }\n\n if (!isDigit && !isDecimalSeparator && !isScientificNotation && !isControlKey && !isSpecialKey) {\n event.preventDefault();\n }\n }\n\n /**\n * Updates separators according to the locale\n */\n protected updateSeparators(): void {\n const formatted = new Intl.NumberFormat(this.currentLocale).format(1234.5);\n\n this.thousandSeparator.set(formatted[1]);\n this.decimalSeparator.set(formatted[5]);\n }\n\n /**\n * Processes input value and updates the input and model\n * @private\n */\n private processInputValue(value: string): void {\n if (!this.decimalSeparator() || !this.thousandSeparator()) {\n this.updateSeparators();\n }\n\n this.renderer.setProperty(this.elementRef.nativeElement, 'value', value);\n\n const modelValue = this.toModelValue(value);\n\n // During typing, clear the stored model value so onFocus will recalculate\n this.lastModelValue = null;\n\n this.onChange(modelValue);\n }\n\n /**\n * Sets inputmode for numeric keyboard on mobile devices\n * @private\n */\n private setInputMode(): void {\n this.renderer.setAttribute(this.elementRef.nativeElement, 'inputmode', 'decimal');\n this.renderer.setAttribute(this.elementRef.nativeElement, 'autocomplete', 'off');\n }\n\n /**\n * Removes separators from a formatted value\n * @private\n */\n private removeSeparators(value: string): string {\n if (!this.thousandSeparator()) {\n return value;\n }\n\n const thousandRegex = new RegExp(this.escapeRegex(this.thousandSeparator()), 'g');\n\n return value.replace(thousandRegex, '');\n }\n\n /**\n * Strips unnecessary trailing zeros from decimal part\n * @private\n */\n private stripTrailingZeros(value: string): string {\n const parts = value.split(this.decimalSeparator());\n if (parts.length === 2) {\n const decimalPart = parts[1].replace(/0+$/, '');\n return decimalPart.length > 0 ? parts[0] + this.decimalSeparator() + decimalPart : parts[0];\n }\n return value;\n }\n\n /**\n * Normalizes separators during typing\n * @private\n */\n private normalizeSeparators(value: string): string {\n value = this.removeSeparators(value);\n\n if (this.decimalSeparator() === ',') {\n value = value.replace(/\\./g, ',');\n } else if (this.decimalSeparator() === '.') {\n value = value.replace(/,/g, '.');\n }\n\n const parts = value.split(this.decimalSeparator());\n if (parts.length > 2) {\n value = parts[0] + this.decimalSeparator() + parts.slice(1).join('');\n }\n\n return value;\n }\n\n /**\n * Escapes special characters for use in regex\n * @private\n */\n private escapeRegex(str: string): string {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n }\n\n /**\n * Truncates a number to the specified decimal places (never rounds)\n * @private\n */\n private truncateToDecimalPlaces(bigNumber: BigNumber, decimalPlaces: number): BigNumber {\n if (decimalPlaces < 0) {\n return bigNumber;\n }\n const multiplier = new BigNumber(10).pow(decimalPlaces);\n return bigNumber.multipliedBy(multiplier).integerValue(BigNumber.ROUND_DOWN).dividedBy(multiplier);\n }\n\n /**\n * Parses a string value to its numeric representation, handling separators and sign\n * Returns BigNumber to preserve full precision and optional number conversion\n * @private\n */\n private parseStringToValue(value: string): { bigNumber: BigNumber; numeric: number; isNegative: boolean } {\n const isNegative = value.startsWith('-');\n let numericStr = value\n .replace(/^-/, '')\n .replace(new RegExp(`\\\\${this.thousandSeparator()}`, 'g'), '')\n .replace(new RegExp(`\\\\${this.decimalSeparator()}`, 'g'), '.');\n\n if (numericStr === '.' || numericStr === '') {\n numericStr = '0';\n } else if (numericStr.startsWith('.')) {\n numericStr = '0' + numericStr;\n }\n\n let bigNumber = new BigNumber(numericStr);\n if (bigNumber.isNaN()) {\n bigNumber = new BigNumber(0);\n }\n\n if (isNegative && this.allowNegative()) {\n bigNumber = bigNumber.negated();\n }\n\n return { bigNumber, numeric: bigNumber.toNumber(), isNegative };\n }\n\n /**\n * Formats a numeric value according to the locale\n * Truncates (never rounds) to maxDecimalPlaces and pads with zeros to minDecimalPlaces\n * @private\n */\n private formatNumeric(numeric: number | BigNumber): string {\n let bigNumeric = numeric instanceof BigNumber ? numeric : new BigNumber(numeric);\n\n const truncatedValue = this.truncateToDecimalPlaces(bigNumeric, this.maxDecimalPlaces());\n\n const valueStr = truncatedValue.toFixed(Math.max(this.minDecimalPlaces(), this.maxDecimalPlaces()));\n\n let formattedValue = valueStr.replace('.', this.decimalSeparator());\n\n const parts = formattedValue.split(this.decimalSeparator());\n const integerPart = parts[0];\n let decimalPart = parts[1] || '';\n\n const formattedInteger = new Intl.NumberFormat(this.currentLocale)\n .format(parseInt(integerPart, 10) || 0)\n .split(this.decimalSeparator())[0];\n\n const effectiveDecimalPlaces = decimalPart.replace(/0+$/, '').length;\n\n const decimalPlacesToShow = Math.max(\n this.minDecimalPlaces(),\n Math.min(effectiveDecimalPlaces, this.maxDecimalPlaces()),\n );\n\n decimalPart = decimalPart.substring(0, decimalPlacesToShow).padEnd(decimalPlacesToShow, '0');\n\n return decimalPart ? formattedInteger + this.decimalSeparator() + decimalPart : formattedInteger;\n }\n\n /**\n * Converts the formatted value to the model format (international standard string)\n * Always returns decimal notation, never scientific notation\n * Stores the full precision value without truncation\n * @private\n */\n private toModelValue(formattedValue: string): string | null {\n if (!formattedValue || formattedValue.trim() === '') {\n return null;\n }\n const { bigNumber } = this.parseStringToValue(formattedValue);\n return bigNumber.toFixed();\n }\n\n /**\n * Converts the model value to display format\n * @private\n */\n private fromModelValue(modelValue: string | null): string {\n if (modelValue === null || modelValue === undefined || modelValue === '') {\n return '';\n }\n const bigNumber = new BigNumber(modelValue);\n if (bigNumber.isNaN()) {\n return '';\n }\n return this.formatNumeric(bigNumber);\n }\n\n /**\n * Processes pasted value from clipboard\n * Converts scientific notation to decimal using BigNumber\n * @private\n */\n private parseClipboardValue(text: string): string {\n if (this.allowScientificNotation() && /[eE]/.test(text)) {\n try {\n const bigNumeric = new BigNumber(text);\n if (!bigNumeric.isNaN()) {\n return bigNumeric.toFixed().replace('.', this.decimalSeparator());\n }\n } catch {\n void 0;\n }\n }\n return this.normalizeSeparators(text);\n }\n\n /**\n * Toggles the sign (- or +) of a value\n * @private\n */\n private toggleSign(value: string, makeNegative: boolean): void {\n const input = this.elementRef.nativeElement;\n let newValue = value;\n\n if (makeNegative && !newValue.startsWith('-')) {\n newValue = '-' + newValue;\n } else if (!makeNegative && newValue.startsWith('-')) {\n newValue = newValue.substring(1);\n } else {\n return;\n }\n\n this.renderer.setProperty(input, 'value', newValue);\n const modelValue = this.toModelValue(newValue);\n this.lastModelValue = null;\n this.onChange(modelValue);\n }\n\n public writeValue(value: string | null): void {\n if (!this.decimalSeparator() || !this.thousandSeparator()) {\n this.updateSeparators();\n }\n const hasFocus = document.activeElement === this.elementRef.nativeElement;\n if (hasFocus) {\n const formattedValue = this.fromModelValue(value);\n const rawValue = this.stripTrailingZeros(this.removeSeparators(formattedValue));\n this.renderer.setProperty(this.elementRef.nativeElement, 'value', rawValue);\n } else {\n const formattedValue = this.fromModelValue(value);\n this.renderer.setProperty(this.elementRef.nativeElement, 'value', formattedValue);\n }\n }\n\n public registerOnChange(fn: (value: string | null) => void): void {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n public setDisabledState(isDisabled: boolean): void {\n this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', isDisabled);\n }\n\n public validate(control: AbstractControl): ValidationErrors | null {\n const value = control.value;\n\n if (!value) {\n return null;\n }\n\n const numericValue = parseFloat(value);\n\n if (isNaN(numericValue)) {\n return null;\n }\n\n if (!this.allowNegative() && numericValue < 0) {\n return { negativeNotAllowed: true };\n }\n\n const minValue = this.min();\n if (minValue !== undefined && numericValue < minValue) {\n return {\n min: {\n min: minValue,\n actual: numericValue,\n },\n };\n }\n\n const maxValue = this.max();\n if (maxValue !== undefined && numericValue > maxValue) {\n return {\n max: {\n max: maxValue,\n actual: numericValue,\n },\n };\n }\n\n const decimalPart = value.split('.')[1];\n\n if (decimalPart && decimalPart.length > this.maxDecimalPlaces()) {\n return {\n excessiveDecimalPlaces: {\n max: this.maxDecimalPlaces(),\n actual: decimalPart.length,\n },\n };\n }\n\n return null;\n }\n}\n\n","import { NgModule } from '@angular/core';\n\nimport { NumericMaskDirective } from './numeric-mask.directive';\n\n@NgModule({\n imports: [NumericMaskDirective],\n exports: [NumericMaskDirective],\n})\nexport class CurrencyMaskModule {}\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AA0BA;;;;;;;;;;;;;;;;;;;;AAoBG;MA0BU,oBAAoB,CAAA;AAC7B;;;AAGG;AACI,IAAA,MAAM,GAAG,KAAK,CAAqB,SAAS,CAAC,CAAC;AAErD;;;AAGG;AACI,IAAA,gBAAgB,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC;;;AAGG;AACI,IAAA,gBAAgB,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;AAEpC;;;AAGG;AACI,IAAA,aAAa,GAAG,KAA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AE,SAAS;AAClC,qBAAA;AACD,oBAAA,SAAS,EAAE;AACP,wBAAA;AACI,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,0BAA0B,CAAC;AACnD,4BAAA,KAAK,EAAE,IAAI;AACd,yBAAA;AACD,wBAAA;AACI,4BAAA,OAAO,EAAE,aAAa;AACtB,4BAAA,WAAW,EAAE,UAAU,CAAC,0BAA0B,CAAC;AACnD,4BAAA,KAAK,EAAE,IAAI;AACd,yBAAA;AACJ,qBAAA;AACJ,iBAAA,CAAA;;;MC/DY,kBAAkB,CAAA;wGAAlB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;yGAAlB,kBAAkB,EAAA,OAAA,EAAA,CAHjB,oBAAoB,CAAA,EAAA,OAAA,EAAA,CACpB,oBAAoB,CAAA,EAAA,CAAA,CAAA;yGAErB,kBAAkB,EAAA,CAAA,CAAA;;4FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,oBAAoB,CAAC;oBAC/B,OAAO,EAAE,CAAC,oBAAoB,CAAC;AAClC,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
1
+ {"version":3,"file":"seniorsistemas-angular-components-numeric-mask.mjs","sources":["../../projects/angular-components/numeric-mask/src/lib/numeric-mask/numeric-mask.directive.ts","../../projects/angular-components/numeric-mask/src/lib/numeric-mask/numeric-mask.module.ts","../../projects/angular-components/numeric-mask/src/seniorsistemas-angular-components-numeric-mask.ts"],"sourcesContent":["import {\n Directive,\n DestroyRef,\n ElementRef,\n forwardRef,\n inject,\n input,\n model,\n OnChanges,\n OnInit,\n Renderer2,\n SimpleChanges,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n ValidationErrors,\n Validator,\n} from '@angular/forms';\n\nimport { LocaleService } from '@seniorsistemas/angular-components/locale';\nimport BigNumber from 'bignumber.js';\n\n/**\n * @description Diretiva de máscara numérica com suporte a internacionalização.\n *\n * Formata valores numéricos de acordo com o locale especificado, aplicando\n * separadores de milhar e decimal adequados, com suporte a valores negativos,\n * controle de casas decimais mín/máx e notação científica.\n *\n * @example\n * ```html\n * <input\n * type=\"text\"\n * sNumericMask\n * [locale]=\"'pt-BR'\"\n * [minDecimalPlaces]=\"2\"\n * [maxDecimalPlaces]=\"2\"\n * [allowNegative]=\"true\"\n * [(ngModel)]=\"value\"\n * />\n * ```\n * @category Numeric\n */\n@Directive({\n selector: '[sNumericMask]',\n standalone: true,\n host: {\n '(input)': 'onInput($event)',\n '(focus)': 'onFocus()',\n '(blur)': 'onBlur()',\n '(paste)': 'onPaste($event)',\n '(keydown)': 'onKeyDown($event)',\n '(keypress)': 'onKeyPress($event)',\n '[style.text-align]': '\"right\"',\n },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => NumericMaskDirective),\n multi: true,\n },\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => NumericMaskDirective),\n multi: true,\n },\n ],\n})\nexport class NumericMaskDirective implements OnInit, OnChanges, ControlValueAccessor, Validator {\n /**\n * Locale for formatting (e.g. 'pt-BR', 'en-US', 'de-DE')\n * If not provided, uses the locale from LocaleService\n */\n public locale = input<string | undefined>(undefined);\n\n /**\n * Minimum number of decimal places to display\n * @default 0\n */\n public minDecimalPlaces = input(0);\n\n /**\n * Maximum number of decimal places allowed\n * @default 10\n */\n public maxDecimalPlaces = input(10);\n\n /**\n * Allows negative values\n * @default false\n */\n public allowNegative = input(false);\n\n /**\n * Enables scientific notation support\n * @default true\n */\n public allowScientificNotation = input(true);\n\n /**\n * Minimum value allowed\n */\n public min = input<number | undefined>(undefined);\n\n /**\n * Maximum value allowed\n */\n public max = input<number | undefined>(undefined);\n\n /**\n * Blocks typing/pasting decimal digits beyond maxDecimalPlaces.\n * When maxDecimalPlaces is 0, the decimal separator itself cannot be entered.\n * @default true\n */\n public blockDecimalOverflow = input(true);\n\n /**\n * Strategy applied on blur when blockDecimalOverflow is false.\n * 'preserve' keeps the model at full precision; only the display is truncated (legacy behavior).\n * 'truncate' cuts the excess decimals without rounding (towards zero), updating the model too.\n * 'roundUp' always rounds to the next representable value above (ceiling), updating the model too.\n * 'roundDown' always rounds to the next representable value below (floor), updating the model too.\n * Has no effect while blockDecimalOverflow is true.\n * @default 'preserve'\n */\n public decimalRoundingMode = input<'preserve' | 'truncate' | 'roundUp' | 'roundDown'>('preserve');\n\n private readonly elementRef = inject(ElementRef<HTMLInputElement>);\n private readonly renderer = inject(Renderer2);\n private readonly localeService = inject(LocaleService, { optional: true });\n private readonly _destroyRef = inject(DestroyRef);\n\n private onChange: (value: string | null) => void = () => {};\n private onTouched: () => void = () => {};\n public decimalSeparator = model(',');\n public thousandSeparator = model('.');\n protected currentLocale = 'pt-BR';\n private lastModelValue: string | null = null;\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes['locale'] && !changes['locale'].firstChange && this.locale()) {\n this.currentLocale = this.locale()!;\n this.updateSeparators();\n this.setInputMode();\n }\n }\n\n public ngOnInit(): void {\n if (this.minDecimalPlaces() > this.maxDecimalPlaces()) {\n throw new Error(\n `NumericMaskDirective: minDecimalPlaces (${this.minDecimalPlaces()}) cannot be greater than maxDecimalPlaces (${this.maxDecimalPlaces()})`,\n );\n }\n\n if (this.locale()) {\n this.currentLocale = this.locale()!;\n this.updateSeparators();\n this.setInputMode();\n } else if (this.localeService) {\n this.localeService\n .get()\n .pipe(takeUntilDestroyed(this._destroyRef))\n .subscribe(() => {\n this.currentLocale = this.localeService!.getLocaleOptions()?.locale || 'pt-BR';\n this.updateSeparators();\n this.setInputMode();\n });\n } else {\n this.updateSeparators();\n this.setInputMode();\n }\n }\n\n /**\n * Listener for input events (typing)\n */\n public onInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n let value = input.value;\n value = this.normalizeSeparators(value);\n this.processInputValue(value);\n }\n\n /**\n * Listener for focus events (gaining focus)\n */\n public onFocus(): void {\n const input = this.elementRef.nativeElement;\n const currentValue = input.value;\n\n if (!currentValue || currentValue.trim() === '') {\n return;\n }\n\n if (this.lastModelValue) {\n const displayValue = this.lastModelValue.replace('.', this.decimalSeparator());\n this.renderer.setProperty(input, 'value', displayValue);\n input.select();\n return;\n }\n\n const modelValue = this.toModelValue(currentValue);\n\n if (!modelValue) {\n return;\n }\n\n const displayValue = modelValue.replace('.', this.decimalSeparator());\n this.renderer.setProperty(input, 'value', displayValue);\n input.select();\n }\n\n /**\n * Listener for blur events (focus loss)\n */\n public onBlur(): void {\n this.onTouched();\n\n const currentValue = this.elementRef.nativeElement.value;\n\n if (!currentValue || currentValue.trim() === '') {\n this.onChange(null);\n this.lastModelValue = null;\n return;\n }\n\n let modelValue = this.toModelValue(currentValue);\n\n if (!modelValue) {\n this.onChange(null);\n this.lastModelValue = null;\n return;\n }\n\n const roundingMode = this.decimalRoundingMode();\n if (!this.blockDecimalOverflow() && roundingMode !== 'preserve') {\n const rounded = this.truncateToDecimalPlaces(\n new BigNumber(modelValue),\n this.maxDecimalPlaces(),\n this.resolveRoundingMode(roundingMode),\n );\n modelValue = rounded.toFixed();\n }\n\n this.lastModelValue = modelValue;\n const displayValue = this.fromModelValue(modelValue);\n this.renderer.setProperty(this.elementRef.nativeElement, 'value', displayValue);\n this.onChange(modelValue);\n }\n\n /**\n * Listener for paste events (clipboard)\n */\n public onPaste(event: ClipboardEvent): void {\n event.preventDefault();\n\n const pastedText = event.clipboardData?.getData('text') || '';\n let value = this.parseClipboardValue(pastedText);\n\n this.processInputValue(value);\n }\n\n /**\n * Listener for special keys (+ and -)\n */\n public onKeyDown(event: KeyboardEvent): void {\n const key = event.key;\n\n if (key === '-' || key === '+') {\n const input = this.elementRef.nativeElement;\n const value = input.value;\n const cursorPosition = input.selectionStart || 0;\n\n if (key === '-' && this.allowScientificNotation()) {\n const charBeforeCursor = value[cursorPosition - 1];\n if (charBeforeCursor === 'e' || charBeforeCursor === 'E') {\n return;\n }\n }\n\n event.preventDefault();\n if (!this.allowNegative()) {\n return;\n }\n\n this.toggleSign(value, key === '-');\n }\n }\n\n /**\n * Listener for keypress to block invalid characters\n */\n public onKeyPress(event: KeyboardEvent): void {\n const key = event.key;\n const input = this.elementRef.nativeElement;\n const cursorPosition = input.selectionStart || 0;\n const value = input.value;\n\n if ((key === '-' || key === '+') && this.allowScientificNotation()) {\n const charBeforeCursor = value[cursorPosition - 1];\n if (charBeforeCursor === 'e' || charBeforeCursor === 'E') {\n return;\n }\n }\n\n if (key === '+' || key === '-') {\n event.preventDefault();\n return;\n }\n\n const isDigit = /^[0-9]$/.test(key);\n const isDecimalSeparator = key === ',' || key === '.';\n const isScientificNotation = (key === 'e' || key === 'E') && this.allowScientificNotation();\n const isControlKey = event.ctrlKey || event.metaKey || event.altKey;\n const isSpecialKey = [\n 'Backspace',\n 'Tab',\n 'Enter',\n 'Escape',\n 'ArrowLeft',\n 'ArrowRight',\n 'Delete',\n 'Home',\n 'End',\n ].includes(key);\n\n if (isScientificNotation) {\n if (value.includes('e') || value.includes('E')) {\n event.preventDefault();\n return;\n }\n\n const charBeforeCursor = value[cursorPosition - 1];\n if (!charBeforeCursor || !/^[0-9]$/.test(charBeforeCursor)) {\n event.preventDefault();\n return;\n }\n }\n\n if (!isDigit && !isDecimalSeparator && !isScientificNotation && !isControlKey && !isSpecialKey) {\n event.preventDefault();\n }\n }\n\n /**\n * Updates separators according to the locale\n */\n protected updateSeparators(): void {\n const formatted = new Intl.NumberFormat(this.currentLocale).format(1234.5);\n\n this.thousandSeparator.set(formatted[1]);\n this.decimalSeparator.set(formatted[5]);\n }\n\n /**\n * Processes input value and updates the input and model\n * @private\n */\n private processInputValue(value: string): void {\n if (!this.decimalSeparator() || !this.thousandSeparator()) {\n this.updateSeparators();\n }\n\n if (this.blockDecimalOverflow()) {\n value = this.applyBlockLimit(value);\n }\n\n this.renderer.setProperty(this.elementRef.nativeElement, 'value', value);\n\n const modelValue = this.toModelValue(value);\n\n // During typing, clear the stored model value so onFocus will recalculate\n this.lastModelValue = null;\n\n this.onChange(modelValue);\n }\n\n /**\n * Sets inputmode for numeric keyboard on mobile devices\n * @private\n */\n private setInputMode(): void {\n this.renderer.setAttribute(this.elementRef.nativeElement, 'inputmode', 'decimal');\n this.renderer.setAttribute(this.elementRef.nativeElement, 'autocomplete', 'off');\n }\n\n /**\n * Removes separators from a formatted value\n * @private\n */\n private removeSeparators(value: string): string {\n if (!this.thousandSeparator()) {\n return value;\n }\n\n const thousandRegex = new RegExp(this.escapeRegex(this.thousandSeparator()), 'g');\n\n return value.replace(thousandRegex, '');\n }\n\n /**\n * Strips unnecessary trailing zeros from decimal part\n * @private\n */\n private stripTrailingZeros(value: string): string {\n const parts = value.split(this.decimalSeparator());\n if (parts.length === 2) {\n const decimalPart = parts[1].replace(/0+$/, '');\n return decimalPart.length > 0 ? parts[0] + this.decimalSeparator() + decimalPart : parts[0];\n }\n return value;\n }\n\n /**\n * Normalizes separators during typing\n * @private\n */\n private normalizeSeparators(value: string): string {\n value = this.removeSeparators(value);\n\n if (this.decimalSeparator() === ',') {\n value = value.replace(/\\./g, ',');\n } else if (this.decimalSeparator() === '.') {\n value = value.replace(/,/g, '.');\n }\n\n const parts = value.split(this.decimalSeparator());\n if (parts.length > 2) {\n value = parts[0] + this.decimalSeparator() + parts.slice(1).join('');\n }\n\n return value;\n }\n\n /**\n * Escapes special characters for use in regex\n * @private\n */\n private escapeRegex(str: string): string {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n }\n\n /**\n * Truncates (or rounds, depending on roundingMode) a number to the specified decimal places\n * @private\n */\n private truncateToDecimalPlaces(\n bigNumber: BigNumber,\n decimalPlaces: number,\n roundingMode: BigNumber.RoundingMode = BigNumber.ROUND_DOWN,\n ): BigNumber {\n if (decimalPlaces < 0) {\n return bigNumber;\n }\n const multiplier = new BigNumber(10).pow(decimalPlaces);\n return bigNumber.multipliedBy(multiplier).integerValue(roundingMode).dividedBy(multiplier);\n }\n\n /**\n * Maps decimalRoundingMode to the corresponding BigNumber rounding mode\n * @private\n */\n private resolveRoundingMode(mode: 'truncate' | 'roundUp' | 'roundDown'): BigNumber.RoundingMode {\n if (mode === 'roundUp') {\n return BigNumber.ROUND_CEIL;\n }\n if (mode === 'roundDown') {\n return BigNumber.ROUND_FLOOR;\n }\n return BigNumber.ROUND_DOWN;\n }\n\n /**\n * Limits the decimal part of a value being typed/pasted to maxDecimalPlaces,\n * preserving any scientific notation exponent untouched\n * @private\n */\n private applyBlockLimit(value: string): string {\n const maxDecimals = this.maxDecimalPlaces();\n const eIndex = value.search(/[eE]/);\n const mantissa = eIndex >= 0 ? value.slice(0, eIndex) : value;\n const exponent = eIndex >= 0 ? value.slice(eIndex) : '';\n\n const sepIndex = mantissa.indexOf(this.decimalSeparator());\n if (sepIndex === -1) {\n return value;\n }\n\n if (maxDecimals === 0) {\n return mantissa.slice(0, sepIndex) + exponent;\n }\n\n return mantissa.slice(0, sepIndex + 1 + maxDecimals) + exponent;\n }\n\n /**\n * Parses a string value to its numeric representation, handling separators and sign\n * Returns BigNumber to preserve full precision and optional number conversion\n * @private\n */\n private parseStringToValue(value: string): { bigNumber: BigNumber; numeric: number; isNegative: boolean } {\n const isNegative = value.startsWith('-');\n let numericStr = value\n .replace(/^-/, '')\n .replace(new RegExp(`\\\\${this.thousandSeparator()}`, 'g'), '')\n .replace(new RegExp(`\\\\${this.decimalSeparator()}`, 'g'), '.');\n\n if (numericStr === '.' || numericStr === '') {\n numericStr = '0';\n } else if (numericStr.startsWith('.')) {\n numericStr = '0' + numericStr;\n }\n\n let bigNumber = new BigNumber(numericStr);\n if (bigNumber.isNaN()) {\n bigNumber = new BigNumber(0);\n }\n\n if (isNegative && this.allowNegative()) {\n bigNumber = bigNumber.negated();\n }\n\n return { bigNumber, numeric: bigNumber.toNumber(), isNegative };\n }\n\n /**\n * Formats a numeric value according to the locale\n * Truncates (never rounds) to maxDecimalPlaces and pads with zeros to minDecimalPlaces\n * @private\n */\n private formatNumeric(numeric: number | BigNumber): string {\n let bigNumeric = numeric instanceof BigNumber ? numeric : new BigNumber(numeric);\n\n const truncatedValue = this.truncateToDecimalPlaces(bigNumeric, this.maxDecimalPlaces());\n\n const valueStr = truncatedValue.toFixed(Math.max(this.minDecimalPlaces(), this.maxDecimalPlaces()));\n\n let formattedValue = valueStr.replace('.', this.decimalSeparator());\n\n const parts = formattedValue.split(this.decimalSeparator());\n const integerPart = parts[0];\n let decimalPart = parts[1] || '';\n\n const formattedInteger = new Intl.NumberFormat(this.currentLocale)\n .format(parseInt(integerPart, 10) || 0)\n .split(this.decimalSeparator())[0];\n\n const effectiveDecimalPlaces = decimalPart.replace(/0+$/, '').length;\n\n const decimalPlacesToShow = Math.max(\n this.minDecimalPlaces(),\n Math.min(effectiveDecimalPlaces, this.maxDecimalPlaces()),\n );\n\n decimalPart = decimalPart.substring(0, decimalPlacesToShow).padEnd(decimalPlacesToShow, '0');\n\n return decimalPart ? formattedInteger + this.decimalSeparator() + decimalPart : formattedInteger;\n }\n\n /**\n * Converts the formatted value to the model format (international standard string)\n * Always returns decimal notation, never scientific notation\n * Stores the full precision value without truncation\n * @private\n */\n private toModelValue(formattedValue: string): string | null {\n if (!formattedValue || formattedValue.trim() === '') {\n return null;\n }\n const { bigNumber } = this.parseStringToValue(formattedValue);\n return bigNumber.toFixed();\n }\n\n /**\n * Converts the model value to display format\n * @private\n */\n private fromModelValue(modelValue: string | null): string {\n if (modelValue === null || modelValue === undefined || modelValue === '') {\n return '';\n }\n const bigNumber = new BigNumber(modelValue);\n if (bigNumber.isNaN()) {\n return '';\n }\n return this.formatNumeric(bigNumber);\n }\n\n /**\n * Processes pasted value from clipboard\n * Converts scientific notation to decimal using BigNumber\n * @private\n */\n private parseClipboardValue(text: string): string {\n if (this.allowScientificNotation() && /[eE]/.test(text)) {\n try {\n const bigNumeric = new BigNumber(text);\n if (!bigNumeric.isNaN()) {\n return bigNumeric.toFixed().replace('.', this.decimalSeparator());\n }\n } catch {\n void 0;\n }\n }\n return this.normalizeSeparators(text);\n }\n\n /**\n * Toggles the sign (- or +) of a value\n * @private\n */\n private toggleSign(value: string, makeNegative: boolean): void {\n const input = this.elementRef.nativeElement;\n let newValue = value;\n\n if (makeNegative && !newValue.startsWith('-')) {\n newValue = '-' + newValue;\n } else if (!makeNegative && newValue.startsWith('-')) {\n newValue = newValue.substring(1);\n } else {\n return;\n }\n\n this.renderer.setProperty(input, 'value', newValue);\n const modelValue = this.toModelValue(newValue);\n this.lastModelValue = null;\n this.onChange(modelValue);\n }\n\n public writeValue(value: string | null): void {\n if (!this.decimalSeparator() || !this.thousandSeparator()) {\n this.updateSeparators();\n }\n const hasFocus = document.activeElement === this.elementRef.nativeElement;\n if (hasFocus) {\n const formattedValue = this.fromModelValue(value);\n const rawValue = this.stripTrailingZeros(this.removeSeparators(formattedValue));\n this.renderer.setProperty(this.elementRef.nativeElement, 'value', rawValue);\n } else {\n const formattedValue = this.fromModelValue(value);\n this.renderer.setProperty(this.elementRef.nativeElement, 'value', formattedValue);\n }\n }\n\n public registerOnChange(fn: (value: string | null) => void): void {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n public setDisabledState(isDisabled: boolean): void {\n this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', isDisabled);\n }\n\n public validate(control: AbstractControl): ValidationErrors | null {\n const value = control.value;\n\n if (!value) {\n return null;\n }\n\n const numericValue = parseFloat(value);\n\n if (isNaN(numericValue)) {\n return null;\n }\n\n if (!this.allowNegative() && numericValue < 0) {\n return { negativeNotAllowed: true };\n }\n\n const minValue = this.min();\n if (minValue !== undefined && numericValue < minValue) {\n return {\n min: {\n min: minValue,\n actual: numericValue,\n },\n };\n }\n\n const maxValue = this.max();\n if (maxValue !== undefined && numericValue > maxValue) {\n return {\n max: {\n max: maxValue,\n actual: numericValue,\n },\n };\n }\n\n const decimalPart = value.split('.')[1];\n\n if (decimalPart && decimalPart.length > this.maxDecimalPlaces()) {\n return {\n excessiveDecimalPlaces: {\n max: this.maxDecimalPlaces(),\n actual: decimalPart.length,\n },\n };\n }\n\n return null;\n }\n}\n\n","import { NgModule } from '@angular/core';\n\nimport { NumericMaskDirective } from './numeric-mask.directive';\n\n@NgModule({\n imports: [NumericMaskDirective],\n exports: [NumericMaskDirective],\n})\nexport class CurrencyMaskModule {}\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AA0BA;;;;;;;;;;;;;;;;;;;;AAoBG;MA0BU,oBAAoB,CAAA;AAC7B;;;AAGG;AACI,IAAA,MAAM,GAAG,KAAK,CAAqB,SAAS,CAAC,CAAC;AAErD;;;AAGG;AACI,IAAA,gBAAgB,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC;;;AAGG;AACI,IAAA,gBAAgB,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;AAEpC;;;AAGG;AACI,IAAA,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;AAEpC;;;AAGG;AACI,IAAA,uBAAuB,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;AAE7C;;AAEG;AACI,IAAA,GAAG,GAAG,KAAK,CAAqB,SAAS,CAAC,CAAC;AAElD;;AAEG;AACI,IAAA,GAAG,GAAG,KAAK,CAAqB,SAAS,CAAC,CAAC;AAElD;;;;AAIG;AACI,IAAA,oBAAoB,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;AAE1C;;;;;;;;AAQG;AACI,IAAA,mBAAmB,GAAG,KAAK,CAAoD,UAAU,CAAC,CAAC;AAEjF,IAAA,UAAU,GAAG,MAAM,EAAC,UAA4B,EAAC,CAAC;AAClD,IAAA,QAAQ,GAAG,MAAM,CAAC,SA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1;
10
10
  * O pacote sidebar será removido na versão 20.0.0.
11
11
  */
12
12
  const DrawerModule = DrawerModule$1;
13
+ // Aliases com os nomes antigos para manter compatibilidade
14
+ /**
15
+ * @deprecated Use DrawerComponent from '@seniorsistemas/angular-components/drawer'.
16
+ * O pacote sidebar será removido na versão 20.0.0.
17
+ */
18
+ const SidebarComponent = DrawerComponent$1;
19
+ /**
20
+ * @deprecated Use DrawerModule from '@seniorsistemas/angular-components/drawer'.
21
+ * O pacote sidebar será removido na versão 20.0.0.
22
+ */
23
+ const SidebarModule = DrawerModule$1;
13
24
 
14
25
  /**
15
26
  * Generated bundle index. Do not edit.
16
27
  */
17
28
 
18
- export { DrawerComponent, DrawerModule };
29
+ export { DrawerComponent, DrawerModule, SidebarComponent, SidebarModule };
19
30
  //# sourceMappingURL=seniorsistemas-angular-components-sidebar.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"seniorsistemas-angular-components-sidebar.mjs","sources":["../../projects/angular-components/sidebar/src/public-api.ts","../../projects/angular-components/sidebar/src/seniorsistemas-angular-components-sidebar.ts"],"sourcesContent":["import {\n DrawerComponent as DrawerComponentOriginal,\n DrawerModule as DrawerModuleOriginal,\n} from '@seniorsistemas/angular-components/drawer';\n\n/**\n * @deprecated Use DrawerComponent from '@seniorsistemas/angular-components/drawer'.\n * O pacote sidebar será removido na versão 20.0.0.\n */\nexport const DrawerComponent = DrawerComponentOriginal;\n\n/**\n * @deprecated Use DrawerModule from '@seniorsistemas/angular-components/drawer'.\n * O pacote sidebar será removido na versão 20.0.0.\n */\nexport const DrawerModule = DrawerModuleOriginal;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["DrawerComponentOriginal","DrawerModuleOriginal"],"mappings":";;AAKA;;;AAGG;AACI,MAAM,eAAe,GAAGA,kBAAwB;AAEvD;;;AAGG;AACI,MAAM,YAAY,GAAGC;;ACf5B;;AAEG;;;;"}
1
+ {"version":3,"file":"seniorsistemas-angular-components-sidebar.mjs","sources":["../../projects/angular-components/sidebar/src/public-api.ts","../../projects/angular-components/sidebar/src/seniorsistemas-angular-components-sidebar.ts"],"sourcesContent":["import {\n DrawerComponent as DrawerComponentOriginal,\n DrawerModule as DrawerModuleOriginal,\n} from '@seniorsistemas/angular-components/drawer';\n\n/**\n * @deprecated Use DrawerComponent from '@seniorsistemas/angular-components/drawer'.\n * O pacote sidebar será removido na versão 20.0.0.\n */\nexport const DrawerComponent = DrawerComponentOriginal;\n\n/**\n * @deprecated Use DrawerModule from '@seniorsistemas/angular-components/drawer'.\n * O pacote sidebar será removido na versão 20.0.0.\n */\nexport const DrawerModule = DrawerModuleOriginal;\n\n// Aliases com os nomes antigos para manter compatibilidade\n/**\n * @deprecated Use DrawerComponent from '@seniorsistemas/angular-components/drawer'.\n * O pacote sidebar será removido na versão 20.0.0.\n */\nexport const SidebarComponent = DrawerComponentOriginal;\n\n/**\n * @deprecated Use DrawerModule from '@seniorsistemas/angular-components/drawer'.\n * O pacote sidebar será removido na versão 20.0.0.\n */\nexport const SidebarModule = DrawerModuleOriginal;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["DrawerComponentOriginal","DrawerModuleOriginal"],"mappings":";;AAKA;;;AAGG;AACI,MAAM,eAAe,GAAGA,kBAAwB;AAEvD;;;AAGG;AACI,MAAM,YAAY,GAAGC,eAAqB;AAEjD;AACA;;;AAGG;AACI,MAAM,gBAAgB,GAAGD,kBAAwB;AAExD;;;AAGG;AACI,MAAM,aAAa,GAAGC;;AC5B7B;;AAEG;;;;"}
@@ -22,11 +22,11 @@ Diretiva Angular para formatação de valores numéricos em campos de input com
22
22
  import { NumericMaskDirective } from '@seniorsistemas/angular-components/numeric-mask';
23
23
 
24
24
  @Component({
25
- standalone: true,
26
- imports: [NumericMaskDirective, FormsModule],
25
+ standalone: true,
26
+ imports: [NumericMaskDirective, FormsModule],
27
27
  })
28
28
  export class MeuComponent {
29
- valor: string | null = null;
29
+ valor: string | null = null;
30
30
  }
31
31
  ```
32
32
 
@@ -34,12 +34,12 @@ export class MeuComponent {
34
34
 
35
35
  ```html
36
36
  <input
37
- type="text"
38
- sNumericMask
39
- [locale]="'pt-BR'"
40
- [minDecimalPlaces]="2"
41
- [maxDecimalPlaces]="2"
42
- [(ngModel)]="valor"
37
+ type="text"
38
+ sNumericMask
39
+ [locale]="'pt-BR'"
40
+ [minDecimalPlaces]="2"
41
+ [maxDecimalPlaces]="2"
42
+ [(ngModel)]="valor"
43
43
  />
44
44
  ```
45
45
 
@@ -47,15 +47,17 @@ export class MeuComponent {
47
47
 
48
48
  ### Inputs
49
49
 
50
- | Propriedade | Tipo | Padrão | Obrigatório | Descrição |
51
- |-------------|------|--------|:-----------:|-----------|
52
- | `locale` | `string \| undefined` | Locale do `LocaleService` | Não | Locale para formatação (ex: `'pt-BR'`, `'en-US'`). Se omitido, usa o locale do `LocaleService` |
53
- | `minDecimalPlaces` | `number` | `0` | Não | Número mínimo de casas decimais a exibir |
54
- | `maxDecimalPlaces` | `number` | `10` | Não | Número máximo de casas decimais permitidas |
55
- | `allowNegative` | `boolean` | `false` | Não | Permite valores negativos. Use as teclas `+` ou `-` para alternar o sinal |
56
- | `allowScientificNotation` | `boolean` | `true` | Não | Habilita suporte a notação científica (ex: `1.5e10`) |
57
- | `min` | `number \| undefined` | `undefined` | Não | Valor mínimo permitido (validação de formulário) |
58
- | `max` | `number \| undefined` | `undefined` | Não | Valor máximo permitido (validação de formulário) |
50
+ | Propriedade | Tipo | Padrão | Obrigatório | Descrição |
51
+ | ------------------------- | ------------------------------------------------------ | ------------------------- | :---------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
52
+ | `locale` | `string \| undefined` | Locale do `LocaleService` | Não | Locale para formatação (ex: `'pt-BR'`, `'en-US'`). Se omitido, usa o locale do `LocaleService` |
53
+ | `minDecimalPlaces` | `number` | `0` | Não | Número mínimo de casas decimais a exibir |
54
+ | `maxDecimalPlaces` | `number` | `10` | Não | Número máximo de casas decimais permitidas |
55
+ | `allowNegative` | `boolean` | `false` | Não | Permite valores negativos. Use as teclas `+` ou `-` para alternar o sinal |
56
+ | `allowScientificNotation` | `boolean` | `true` | Não | Habilita suporte a notação científica (ex: `1.5e10`) |
57
+ | `min` | `number \| undefined` | `undefined` | Não | Valor mínimo permitido (validação de formulário) |
58
+ | `max` | `number \| undefined` | `undefined` | Não | Valor máximo permitido (validação de formulário) |
59
+ | `blockDecimalOverflow` | `boolean` | `true` | Não | Bloqueia a digitação e a colagem de casas decimais além de `maxDecimalPlaces`. Quando `maxDecimalPlaces` é `0`, o próprio separador decimal não pode ser digitado |
60
+ | `decimalRoundingMode` | `'preserve' \| 'truncate' \| 'roundUp' \| 'roundDown'` | `'preserve'` | Não | Estratégia aplicada no `blur` quando `blockDecimalOverflow` é `false`. Sem efeito enquanto `blockDecimalOverflow` for `true` |
59
61
 
60
62
  ### Tipos
61
63
 
@@ -69,16 +71,96 @@ type NumericMaskModelValue = string | null;
69
71
 
70
72
  ```typescript
71
73
  // Valor negativo quando allowNegative = false
72
- { negativeNotAllowed: true }
74
+ {
75
+ negativeNotAllowed: true;
76
+ }
73
77
 
74
78
  // Valor abaixo do mínimo
75
- { min: { min: number; actual: number } }
79
+ {
80
+ min: {
81
+ min: number;
82
+ actual: number;
83
+ }
84
+ }
76
85
 
77
86
  // Valor acima do máximo
78
- { max: { max: number; actual: number } }
87
+ {
88
+ max: {
89
+ max: number;
90
+ actual: number;
91
+ }
92
+ }
79
93
 
80
94
  // Casas decimais acima do máximo
81
- { excessiveDecimalPlaces: { max: number; actual: number } }
95
+ {
96
+ excessiveDecimalPlaces: {
97
+ max: number;
98
+ actual: number;
99
+ }
100
+ }
101
+ ```
102
+
103
+ ## Comportamento de excesso de casas decimais
104
+
105
+ Por padrão (`blockDecimalOverflow = true`), a digitação e a colagem de valores com mais casas decimais que `maxDecimalPlaces` são bloqueadas no momento da entrada: dígitos excedentes são ignorados imediatamente (sem esperar o `blur`) e, quando `maxDecimalPlaces` é `0`, o próprio separador decimal não pode ser digitado.
106
+
107
+ Desligando o bloqueio (`[blockDecimalOverflow]="false"`), a digitação volta a ser livre e o input `decimalRoundingMode` passa a controlar o que acontece ao perder o foco (`blur`):
108
+
109
+ | `decimalRoundingMode` | Comportamento no `blur` |
110
+ | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
111
+ | `'preserve'` (padrão) | Comportamento legado: a exibição é truncada, mas o modelo mantém a precisão total do que foi digitado |
112
+ | `'truncate'` | Corta as casas excedentes tanto na exibição quanto no modelo, sem arredondar (sempre em direção a zero) |
113
+ | `'roundUp'` | Arredonda sempre para o próximo valor representável **acima** (ceiling), mesmo que o excedente seja mínimo — não é arredondamento para o valor mais próximo |
114
+ | `'roundDown'` | Arredonda sempre para o próximo valor representável **abaixo** (floor), pelo mesmo motivo |
115
+
116
+ ```html
117
+ <!-- Padrão: bloqueia a digitação acima de 2 casas decimais -->
118
+ <input
119
+ type="text"
120
+ sNumericMask
121
+ [maxDecimalPlaces]="2"
122
+ [(ngModel)]="valor"
123
+ />
124
+
125
+ <!-- Comportamento legado explícito (digitação livre, modelo com precisão total) -->
126
+ <input
127
+ type="text"
128
+ sNumericMask
129
+ [maxDecimalPlaces]="2"
130
+ [blockDecimalOverflow]="false"
131
+ decimalRoundingMode="preserve"
132
+ [(ngModel)]="valor"
133
+ />
134
+
135
+ <!-- Trunca no blur (corta sem arredondar) -->
136
+ <input
137
+ type="text"
138
+ sNumericMask
139
+ [maxDecimalPlaces]="2"
140
+ [blockDecimalOverflow]="false"
141
+ decimalRoundingMode="truncate"
142
+ [(ngModel)]="valor"
143
+ />
144
+
145
+ <!-- Arredonda sempre para cima no blur -->
146
+ <input
147
+ type="text"
148
+ sNumericMask
149
+ [maxDecimalPlaces]="2"
150
+ [blockDecimalOverflow]="false"
151
+ decimalRoundingMode="roundUp"
152
+ [(ngModel)]="valor"
153
+ />
154
+
155
+ <!-- Arredonda sempre para baixo no blur -->
156
+ <input
157
+ type="text"
158
+ sNumericMask
159
+ [maxDecimalPlaces]="2"
160
+ [blockDecimalOverflow]="false"
161
+ decimalRoundingMode="roundDown"
162
+ [(ngModel)]="valor"
163
+ />
82
164
  ```
83
165
 
84
166
  ## Exemplos
@@ -87,13 +169,13 @@ type NumericMaskModelValue = string | null;
87
169
 
88
170
  ```html
89
171
  <input
90
- type="text"
91
- sNumericMask
92
- locale="pt-BR"
93
- [minDecimalPlaces]="2"
94
- [maxDecimalPlaces]="2"
95
- placeholder="0,00"
96
- [(ngModel)]="valorMonetario"
172
+ type="text"
173
+ sNumericMask
174
+ locale="pt-BR"
175
+ [minDecimalPlaces]="2"
176
+ [maxDecimalPlaces]="2"
177
+ placeholder="0,00"
178
+ [(ngModel)]="valorMonetario"
97
179
  />
98
180
  ```
99
181
 
@@ -101,14 +183,14 @@ type NumericMaskModelValue = string | null;
101
183
 
102
184
  ```html
103
185
  <input
104
- type="text"
105
- sNumericMask
106
- locale="pt-BR"
107
- [minDecimalPlaces]="2"
108
- [maxDecimalPlaces]="2"
109
- [allowNegative]="true"
110
- placeholder="-0,00"
111
- [(ngModel)]="variacao"
186
+ type="text"
187
+ sNumericMask
188
+ locale="pt-BR"
189
+ [minDecimalPlaces]="2"
190
+ [maxDecimalPlaces]="2"
191
+ [allowNegative]="true"
192
+ placeholder="-0,00"
193
+ [(ngModel)]="variacao"
112
194
  />
113
195
  <!-- Pressione + ou - para alternar entre positivo e negativo -->
114
196
  ```
@@ -117,15 +199,15 @@ type NumericMaskModelValue = string | null;
117
199
 
118
200
  ```html
119
201
  <input
120
- type="text"
121
- sNumericMask
122
- locale="pt-BR"
123
- [minDecimalPlaces]="2"
124
- [maxDecimalPlaces]="2"
125
- [min]="0"
126
- [max]="100"
127
- placeholder="0,00"
128
- [(ngModel)]="percentual"
202
+ type="text"
203
+ sNumericMask
204
+ locale="pt-BR"
205
+ [minDecimalPlaces]="2"
206
+ [maxDecimalPlaces]="2"
207
+ [min]="0"
208
+ [max]="100"
209
+ placeholder="0,00"
210
+ [(ngModel)]="percentual"
129
211
  />
130
212
  ```
131
213
 
@@ -133,13 +215,13 @@ type NumericMaskModelValue = string | null;
133
215
 
134
216
  ```html
135
217
  <input
136
- type="text"
137
- sNumericMask
138
- locale="en-US"
139
- [minDecimalPlaces]="2"
140
- [maxDecimalPlaces]="2"
141
- placeholder="0.00"
142
- [(ngModel)]="valor"
218
+ type="text"
219
+ sNumericMask
220
+ locale="en-US"
221
+ [minDecimalPlaces]="2"
222
+ [maxDecimalPlaces]="2"
223
+ placeholder="0.00"
224
+ [(ngModel)]="valor"
143
225
  />
144
226
  ```
145
227
 
@@ -147,13 +229,13 @@ type NumericMaskModelValue = string | null;
147
229
 
148
230
  ```html
149
231
  <input
150
- type="text"
151
- sNumericMask
152
- locale="pt-BR"
153
- [minDecimalPlaces]="0"
154
- [maxDecimalPlaces]="4"
155
- placeholder="0"
156
- [(ngModel)]="quantidade"
232
+ type="text"
233
+ sNumericMask
234
+ locale="pt-BR"
235
+ [minDecimalPlaces]="0"
236
+ [maxDecimalPlaces]="4"
237
+ placeholder="0"
238
+ [(ngModel)]="quantidade"
157
239
  />
158
240
  ```
159
241
 
@@ -168,3 +250,25 @@ type NumericMaskModelValue = string | null;
168
250
 
169
251
  - [`NumericPipe`](../numeric/README.md) — formatação de valores numéricos para exibição somente leitura
170
252
  - [`NumberInput`](../number-input/src/lib/number-input/README.md) — diretiva descontinuada, use `sNumericMask` em seu lugar
253
+
254
+ ## Migração
255
+
256
+ ### Mudança de comportamento padrão
257
+
258
+ A partir desta versão, `blockDecimalOverflow` passa a ser `true` por padrão: a digitação e a colagem de valores com mais casas decimais que `maxDecimalPlaces` passam a ser bloqueadas no momento da entrada, em vez de aceitas livremente e truncadas apenas na exibição ao perder o foco.
259
+
260
+ Para restaurar o comportamento anterior (digitação livre, modelo com precisão total, exibição truncada no `blur`):
261
+
262
+ ```html
263
+ <input
264
+ type="text"
265
+ sNumericMask
266
+ [maxDecimalPlaces]="2"
267
+ [blockDecimalOverflow]="false"
268
+ decimalRoundingMode="preserve"
269
+ [(ngModel)]="valor"
270
+ />
271
+ ```
272
+
273
+ `decimalRoundingMode="preserve"` já é o padrão — pode ser omitido, mas deixá-lo explícito reforça a intenção do comportamento legado.
274
+
@@ -56,6 +56,22 @@ export declare class NumericMaskDirective implements OnInit, OnChanges, ControlV
56
56
  * Maximum value allowed
57
57
  */
58
58
  max: import("@angular/core").InputSignal<number | undefined>;
59
+ /**
60
+ * Blocks typing/pasting decimal digits beyond maxDecimalPlaces.
61
+ * When maxDecimalPlaces is 0, the decimal separator itself cannot be entered.
62
+ * @default true
63
+ */
64
+ blockDecimalOverflow: import("@angular/core").InputSignal<boolean>;
65
+ /**
66
+ * Strategy applied on blur when blockDecimalOverflow is false.
67
+ * 'preserve' keeps the model at full precision; only the display is truncated (legacy behavior).
68
+ * 'truncate' cuts the excess decimals without rounding (towards zero), updating the model too.
69
+ * 'roundUp' always rounds to the next representable value above (ceiling), updating the model too.
70
+ * 'roundDown' always rounds to the next representable value below (floor), updating the model too.
71
+ * Has no effect while blockDecimalOverflow is true.
72
+ * @default 'preserve'
73
+ */
74
+ decimalRoundingMode: import("@angular/core").InputSignal<"preserve" | "truncate" | "roundUp" | "roundDown">;
59
75
  private readonly elementRef;
60
76
  private readonly renderer;
61
77
  private readonly localeService;
@@ -127,10 +143,21 @@ export declare class NumericMaskDirective implements OnInit, OnChanges, ControlV
127
143
  */
128
144
  private escapeRegex;
129
145
  /**
130
- * Truncates a number to the specified decimal places (never rounds)
146
+ * Truncates (or rounds, depending on roundingMode) a number to the specified decimal places
131
147
  * @private
132
148
  */
133
149
  private truncateToDecimalPlaces;
150
+ /**
151
+ * Maps decimalRoundingMode to the corresponding BigNumber rounding mode
152
+ * @private
153
+ */
154
+ private resolveRoundingMode;
155
+ /**
156
+ * Limits the decimal part of a value being typed/pasted to maxDecimalPlaces,
157
+ * preserving any scientific notation exponent untouched
158
+ * @private
159
+ */
160
+ private applyBlockLimit;
134
161
  /**
135
162
  * Parses a string value to its numeric representation, handling separators and sign
136
163
  * Returns BigNumber to preserve full precision and optional number conversion
@@ -172,5 +199,5 @@ export declare class NumericMaskDirective implements OnInit, OnChanges, ControlV
172
199
  setDisabledState(isDisabled: boolean): void;
173
200
  validate(control: AbstractControl): ValidationErrors | null;
174
201
  static ɵfac: i0.ɵɵFactoryDeclaration<NumericMaskDirective, never>;
175
- 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; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "decimalSeparator": { "alias": "decimalSeparator"; "required": false; "isSignal": true; }; "thousandSeparator": { "alias": "thousandSeparator"; "required": false; "isSignal": true; }; }, { "decimalSeparator": "decimalSeparatorChange"; "thousandSeparator": "thousandSeparatorChange"; }, never, never, true, never>;
202
+ 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; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "blockDecimalOverflow": { "alias": "blockDecimalOverflow"; "required": false; "isSignal": true; }; "decimalRoundingMode": { "alias": "decimalRoundingMode"; "required": false; "isSignal": true; }; "decimalSeparator": { "alias": "decimalSeparator"; "required": false; "isSignal": true; }; "thousandSeparator": { "alias": "thousandSeparator"; "required": false; "isSignal": true; }; }, { "decimalSeparator": "decimalSeparatorChange"; "thousandSeparator": "thousandSeparatorChange"; }, never, never, true, never>;
176
203
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seniorsistemas/angular-components",
3
- "version": "19.9.0",
3
+ "version": "19.9.1",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^18.2.14",
6
6
  "@angular/common": "^18.2.0",
@@ -97,18 +97,18 @@
97
97
  "esm": "./esm2022/accordion/seniorsistemas-angular-components-accordion.mjs",
98
98
  "default": "./fesm2022/seniorsistemas-angular-components-accordion.mjs"
99
99
  },
100
- "./autocomplete": {
101
- "types": "./autocomplete/index.d.ts",
102
- "esm2022": "./esm2022/autocomplete/seniorsistemas-angular-components-autocomplete.mjs",
103
- "esm": "./esm2022/autocomplete/seniorsistemas-angular-components-autocomplete.mjs",
104
- "default": "./fesm2022/seniorsistemas-angular-components-autocomplete.mjs"
105
- },
106
100
  "./alert": {
107
101
  "types": "./alert/index.d.ts",
108
102
  "esm2022": "./esm2022/alert/seniorsistemas-angular-components-alert.mjs",
109
103
  "esm": "./esm2022/alert/seniorsistemas-angular-components-alert.mjs",
110
104
  "default": "./fesm2022/seniorsistemas-angular-components-alert.mjs"
111
105
  },
106
+ "./autocomplete": {
107
+ "types": "./autocomplete/index.d.ts",
108
+ "esm2022": "./esm2022/autocomplete/seniorsistemas-angular-components-autocomplete.mjs",
109
+ "esm": "./esm2022/autocomplete/seniorsistemas-angular-components-autocomplete.mjs",
110
+ "default": "./fesm2022/seniorsistemas-angular-components-autocomplete.mjs"
111
+ },
112
112
  "./badge": {
113
113
  "types": "./badge/index.d.ts",
114
114
  "esm2022": "./esm2022/badge/seniorsistemas-angular-components-badge.mjs",