@seniorsistemas/angular-components 19.9.0 → 19.9.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.
- package/bignumber-input/lib/bignumber-input/bignumber-input.directive.d.ts +7 -1
- package/control-errors/lib/control-errors/control-errors.component.d.ts +11 -2
- package/esm2022/bignumber-input/lib/bignumber-input/bignumber-input.directive.mjs +8 -2
- package/esm2022/control-errors/lib/control-errors/control-errors.component.mjs +21 -1
- package/esm2022/drawer/lib/drawer/drawer.component.mjs +3 -3
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/bignumber/bignumber-field.component.mjs +2 -2
- package/esm2022/inline-edit/lib/inline-edit/components/fields/inline-edit-number/inline-edit-number.component.mjs +1 -1
- package/esm2022/numeric-mask/lib/numeric-mask/numeric-mask.directive.mjs +62 -6
- package/esm2022/sidebar/public-api.mjs +12 -1
- package/esm2022/spotlight/lib/spotlight/spotlight-overlay/rect-stability.mjs +61 -0
- package/esm2022/spotlight/lib/spotlight/spotlight-overlay/spotlight-overlay.component.mjs +91 -21
- package/fesm2022/seniorsistemas-angular-components-bignumber-input.mjs +7 -1
- package/fesm2022/seniorsistemas-angular-components-bignumber-input.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-control-errors.mjs +20 -0
- package/fesm2022/seniorsistemas-angular-components-control-errors.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-drawer.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-drawer.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs +1 -1
- package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-inline-edit.mjs +1 -1
- package/fesm2022/seniorsistemas-angular-components-inline-edit.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-numeric-mask.mjs +61 -5
- package/fesm2022/seniorsistemas-angular-components-numeric-mask.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-sidebar.mjs +12 -1
- package/fesm2022/seniorsistemas-angular-components-sidebar.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-spotlight.mjs +150 -20
- package/fesm2022/seniorsistemas-angular-components-spotlight.mjs.map +1 -1
- package/numeric-mask/README.md +164 -60
- package/numeric-mask/lib/numeric-mask/numeric-mask.directive.d.ts +29 -2
- package/package.json +13 -13
- package/sidebar/README.md +3 -3
- package/sidebar/public-api.d.ts +10 -0
- package/spotlight/README.md +28 -0
- package/spotlight/lib/spotlight/spotlight-overlay/rect-stability.d.ts +32 -0
- package/spotlight/lib/spotlight/spotlight-overlay/spotlight-overlay.component.d.ts +33 -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,oBAAo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EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACF,wBAAA,SAAS,EAAE,iBAAiB;AAC5B,wBAAA,SAAS,EAAE,WAAW;AACtB,wBAAA,QAAQ,EAAE,UAAU;AACpB,wBAAA,SAAS,EAAE,iBAAiB;AAC5B,wBAAA,WAAW,EAAE,mBAAmB;AAChC,wBAAA,YAAY,EAAE,oBAAoB;AAClC,wBAAA,oBAAoB,EAAE,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,CA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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;;;;"}
|
|
@@ -10,10 +10,21 @@ const DrawerComponent = DrawerComponent$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;;
|
|
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;;;;"}
|
|
@@ -197,6 +197,67 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
197
197
|
args: [{ selector: 's-spotlight', standalone: true, imports: [CommonModule, ButtonModule, CheckboxComponent, TranslateModule], template: "<div\n [attr.role]=\"totalSteps() > 1 ? 'dialog' : 'tooltip'\"\n [attr.aria-modal]=\"totalSteps() > 1 ? 'true' : null\"\n [attr.aria-labelledby]=\"titleId\"\n [attr.aria-describedby]=\"descId\"\n class=\"flex max-w-[342px]\"\n [ngClass]=\"isArrowLeft || isArrowRight ? 'flex-row' : 'flex-col'\"\n>\n @if (isArrowTop) {\n <ng-container *ngTemplateOutlet=\"arrowTopTemplate\"></ng-container>\n }\n\n @if (isArrowLeft) {\n <ng-container *ngTemplateOutlet=\"arrowLeftTemplate\"></ng-container>\n }\n\n <div\n class=\"relative flex w-full flex-col overflow-hidden rounded-[4px] bg-grayscale-0\"\n style=\"\n box-shadow:\n 0 3px 5px rgba(0, 0, 0, 0.2),\n 0 1px 18px rgba(0, 0, 0, 0.12),\n 0 6px 10px rgba(0, 0, 0, 0.14);\n \"\n >\n <!-- Regi\u00E3o aria-live para anuncia\u00E7\u00E3o de mudan\u00E7a de passo para leitores de tela -->\n <span\n class=\"sr-only\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n @if (totalSteps() > 1) {\n {{\n 'platform.angular_components.step_progress'\n | translate: { current: currentStep(), total: totalSteps() }\n }}\n }\n </span>\n <div class=\"flex h-[40px] w-full items-center justify-between p-[12px]\">\n <div class=\"flex min-w-0 flex-1 items-center gap-[8px]\">\n <h2\n [id]=\"titleId\"\n class=\"flex-1 overflow-hidden overflow-ellipsis whitespace-nowrap font-open-sans text-[14px] font-bold leading-[1.5] text-grayscale-90\"\n >\n @if (titleTemplate) {\n <ng-container *ngTemplateOutlet=\"titleTemplate\"></ng-container>\n } @else {\n {{ titleString }}\n }\n </h2>\n </div>\n <button\n (click)=\"onClose()\"\n class=\"flex h-[16px] w-[16px] flex-none items-center justify-center text-grayscale-90 transition-colors hover:text-grayscale-100\"\n [attr.aria-label]=\"'platform.angular_components.close' | translate\"\n >\n <i class=\"fas fa-times\"></i>\n </button>\n </div>\n\n @if (content()) {\n <ng-container *ngTemplateOutlet=\"content()\"></ng-container>\n }\n\n <div class=\"flex w-full flex-col items-start gap-[20px] bg-grayscale-0 p-[12px]\">\n <div\n [id]=\"descId\"\n class=\"w-full whitespace-pre-wrap font-open-sans text-[14px] font-normal leading-[1.5] text-grayscale-90\"\n >\n @if (messageTemplate) {\n <ng-container *ngTemplateOutlet=\"messageTemplate\"></ng-container>\n } @else {\n {{ messageString }}\n }\n </div>\n\n <div class=\"flex w-full flex-wrap gap-3\">\n @if (totalSteps() > 1) {\n <p class=\"font-open-sans text-[14px] font-normal leading-[1.5] text-grayscale-90\">\n {{\n 'platform.angular_components.step_counter'\n | translate: { current: currentStep(), total: totalSteps() }\n }}\n </p>\n }\n\n @if (totalSteps() === 1 && showDoNotShowAgain()) {\n <s-checkbox\n [checked]=\"isDoNotShowAgainChecked()\"\n (checkedChange)=\"toggleDoNotShowAgain()\"\n [label]=\"'platform.angular_components.dont_show_again' | translate\"\n ></s-checkbox>\n }\n\n <div\n class=\"flex flex-wrap items-start justify-end gap-[8px]\"\n [ngClass]=\"totalSteps() > 1 ? 'w-full' : ''\"\n >\n @for (action of actions(); track action.label) {\n <s-button\n [label]=\"action.label\"\n (clicked)=\"action.handler()\"\n priority=\"default\"\n size=\"small\"\n class=\"flex-none\"\n ></s-button>\n }\n\n @if (totalSteps() > 1 && currentStep() > 1) {\n <s-button\n [label]=\"'platform.angular_components.back' | translate\"\n (clicked)=\"onPrevious()\"\n priority=\"default\"\n size=\"small\"\n class=\"flex-none\"\n ></s-button>\n }\n\n <s-button\n [label]=\"\n totalSteps() <= 1\n ? ('platform.angular_components.understood' | translate)\n : currentStep() < totalSteps()\n ? ('platform.angular_components.next' | translate)\n : ('platform.angular_components.complete' | translate)\n \"\n (clicked)=\"totalSteps() > 1 ? onNext() : onUnderstand()\"\n priority=\"secondary\"\n size=\"small\"\n class=\"flex-none\"\n ></s-button>\n </div>\n </div>\n </div>\n </div>\n\n @if (isArrowBottom) {\n <ng-container *ngTemplateOutlet=\"arrowBottomTemplate\"></ng-container>\n }\n\n @if (isArrowRight) {\n <ng-container *ngTemplateOutlet=\"arrowRightTemplate\"></ng-container>\n }\n</div>\n\n<!-- Arrow Templates -->\n<ng-template #arrowTopTemplate>\n <div\n class=\"relative z-10 flex h-[8px] w-full px-[12px] py-0\"\n [ngClass]=\"arrowAlignmentClass\"\n [ngStyle]=\"arrowPaddingStyle\"\n >\n <svg\n width=\"16\"\n height=\"8\"\n viewBox=\"0 0 16 8\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"text-grayscale-0\"\n [ngClass]=\"arrowRotation\"\n >\n <path\n d=\"M0 8L8 0L16 8\"\n fill=\"currentColor\"\n />\n </svg>\n </div>\n</ng-template>\n\n<ng-template #arrowBottomTemplate>\n <div\n class=\"relative z-10 flex h-[8px] w-full px-[12px] py-0\"\n [ngClass]=\"arrowAlignmentClass\"\n [ngStyle]=\"arrowPaddingStyle\"\n >\n <svg\n width=\"16\"\n height=\"8\"\n viewBox=\"0 0 16 8\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"text-grayscale-0\"\n [ngClass]=\"arrowRotation\"\n >\n <path\n d=\"M0 8L8 0L16 8\"\n fill=\"currentColor\"\n />\n </svg>\n </div>\n</ng-template>\n\n<ng-template #arrowLeftTemplate>\n <div\n class=\"relative z-10 flex w-[8px] flex-col items-center self-stretch px-0\"\n [ngClass]=\"arrowAlignmentClass\"\n [ngStyle]=\"arrowPaddingStyle\"\n >\n <svg\n width=\"16\"\n height=\"8\"\n viewBox=\"0 0 16 8\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"text-grayscale-0\"\n [ngClass]=\"arrowRotation\"\n >\n <path\n d=\"M0 8L8 0L16 8\"\n fill=\"currentColor\"\n />\n </svg>\n </div>\n</ng-template>\n\n<ng-template #arrowRightTemplate>\n <div\n class=\"relative z-10 flex w-[8px] flex-col items-center self-stretch px-0\"\n [ngClass]=\"arrowAlignmentClass\"\n [ngStyle]=\"arrowPaddingStyle\"\n >\n <svg\n width=\"16\"\n height=\"8\"\n viewBox=\"0 0 16 8\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"text-grayscale-0\"\n [ngClass]=\"arrowRotation\"\n >\n <path\n d=\"M0 8L8 0L16 8\"\n fill=\"currentColor\"\n />\n </svg>\n </div>\n</ng-template>\n\n" }]
|
|
198
198
|
}] });
|
|
199
199
|
|
|
200
|
+
/**
|
|
201
|
+
* Utilitário puro (sem dependência de Angular/NgZone) para aguardar até que a posição
|
|
202
|
+
* e o tamanho de um elemento parem de mudar — usado para medir corretamente elementos
|
|
203
|
+
* que podem estar em transição/animação (ex: um menu abrindo) no momento em que o
|
|
204
|
+
* Spotlight precisa apontar para eles.
|
|
205
|
+
*/
|
|
206
|
+
const DEFAULT_RECT_STABILITY_OPTIONS = {
|
|
207
|
+
requiredStableSamples: 3,
|
|
208
|
+
tolerancePx: 0.5,
|
|
209
|
+
maxWaitMs: 600,
|
|
210
|
+
};
|
|
211
|
+
function isRectStable(a, b, tolerancePx) {
|
|
212
|
+
return (Math.abs(a.top - b.top) <= tolerancePx &&
|
|
213
|
+
Math.abs(a.left - b.left) <= tolerancePx &&
|
|
214
|
+
Math.abs(a.width - b.width) <= tolerancePx &&
|
|
215
|
+
Math.abs(a.height - b.height) <= tolerancePx);
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Faz polling de `el.getBoundingClientRect()` em frames sucessivos até que
|
|
219
|
+
* `requiredStableSamples` amostras consecutivas sejam iguais (dentro de `tolerancePx`),
|
|
220
|
+
* ou até que `maxWaitMs` seja atingido — o que ocorrer primeiro.
|
|
221
|
+
*
|
|
222
|
+
* `scheduleFrame`/`cancelFrame`/`now` são injetáveis para permitir testes determinísticos;
|
|
223
|
+
* por padrão usam as APIs nativas do navegador.
|
|
224
|
+
*/
|
|
225
|
+
function waitForStableRect(el, options = DEFAULT_RECT_STABILITY_OPTIONS, scheduleFrame = requestAnimationFrame, cancelFrame = cancelAnimationFrame, now = () => performance.now()) {
|
|
226
|
+
let cancelled = false;
|
|
227
|
+
let frameHandle = 0;
|
|
228
|
+
let resolveFn;
|
|
229
|
+
const promise = new Promise((resolve) => {
|
|
230
|
+
resolveFn = resolve;
|
|
231
|
+
});
|
|
232
|
+
const startedAt = now();
|
|
233
|
+
let lastRect = el.getBoundingClientRect();
|
|
234
|
+
let stableCount = 1;
|
|
235
|
+
const tick = () => {
|
|
236
|
+
if (cancelled)
|
|
237
|
+
return;
|
|
238
|
+
const rect = el.getBoundingClientRect();
|
|
239
|
+
stableCount = isRectStable(rect, lastRect, options.tolerancePx) ? stableCount + 1 : 1;
|
|
240
|
+
lastRect = rect;
|
|
241
|
+
if (stableCount >= options.requiredStableSamples) {
|
|
242
|
+
resolveFn({ rect, timedOut: false });
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
if (now() - startedAt >= options.maxWaitMs) {
|
|
246
|
+
resolveFn({ rect, timedOut: true });
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
frameHandle = scheduleFrame(tick);
|
|
250
|
+
};
|
|
251
|
+
frameHandle = scheduleFrame(tick);
|
|
252
|
+
return {
|
|
253
|
+
promise,
|
|
254
|
+
cancel: () => {
|
|
255
|
+
cancelled = true;
|
|
256
|
+
cancelFrame(frameHandle);
|
|
257
|
+
},
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
|
|
200
261
|
const POPOVER_WIDTH = 342;
|
|
201
262
|
const SPOTLIGHT_PADDING = 8;
|
|
202
263
|
const ARROW_HALF_SIZE = 8;
|
|
@@ -206,6 +267,8 @@ const MASK_BG = 'rgba(0,0,0,0.5)';
|
|
|
206
267
|
const MASK_TRANSITION = 'all 0.2s ease';
|
|
207
268
|
const OVERLAY_Z = '10000';
|
|
208
269
|
const POPOVER_Z = '10001';
|
|
270
|
+
/** Tempo máximo de espera pelo registro do elemento-alvo (ex: criado dinamicamente dentro de `beforeNext`) antes de recorrer ao popover centralizado. */
|
|
271
|
+
const ELEMENT_WAIT_TIMEOUT_MS = 500;
|
|
209
272
|
function toConnectedPositions(position) {
|
|
210
273
|
const [direction, alignment] = position.split('-');
|
|
211
274
|
const p = SPOTLIGHT_PADDING + 2;
|
|
@@ -257,6 +320,13 @@ class SpotlightOverlayComponent {
|
|
|
257
320
|
totalSteps = this.tourService.totalSteps;
|
|
258
321
|
/** @internal*/
|
|
259
322
|
targetRect = signal(null);
|
|
323
|
+
/**
|
|
324
|
+
* Controla se a máscara deve animar a transição entre retângulos (reposicionamento
|
|
325
|
+
* em vivo, ex: scroll/resize) ou saltar instantaneamente (chegada/saída de um passo).
|
|
326
|
+
* Ver `setTargetRectImmediate`.
|
|
327
|
+
*/
|
|
328
|
+
maskTransitionEnabled = signal(true);
|
|
329
|
+
maskTransitionStyle = computed(() => this.maskTransitionEnabled() ? MASK_TRANSITION : 'none');
|
|
260
330
|
/** @internal */
|
|
261
331
|
topMaskStyle = computed(() => {
|
|
262
332
|
const rect = this.targetRect();
|
|
@@ -264,7 +334,7 @@ class SpotlightOverlayComponent {
|
|
|
264
334
|
position: 'fixed',
|
|
265
335
|
'z-index': OVERLAY_Z,
|
|
266
336
|
background: MASK_BG,
|
|
267
|
-
transition:
|
|
337
|
+
transition: this.maskTransitionStyle(),
|
|
268
338
|
cursor: 'default',
|
|
269
339
|
};
|
|
270
340
|
if (!rect) {
|
|
@@ -287,7 +357,7 @@ class SpotlightOverlayComponent {
|
|
|
287
357
|
position: 'fixed',
|
|
288
358
|
'z-index': OVERLAY_Z,
|
|
289
359
|
background: MASK_BG,
|
|
290
|
-
transition:
|
|
360
|
+
transition: this.maskTransitionStyle(),
|
|
291
361
|
cursor: 'default',
|
|
292
362
|
top: `${top}px`,
|
|
293
363
|
left: '0',
|
|
@@ -309,7 +379,7 @@ class SpotlightOverlayComponent {
|
|
|
309
379
|
position: 'fixed',
|
|
310
380
|
'z-index': OVERLAY_Z,
|
|
311
381
|
background: MASK_BG,
|
|
312
|
-
transition:
|
|
382
|
+
transition: this.maskTransitionStyle(),
|
|
313
383
|
cursor: 'default',
|
|
314
384
|
top: `${top}px`,
|
|
315
385
|
left: `${right}px`,
|
|
@@ -329,7 +399,7 @@ class SpotlightOverlayComponent {
|
|
|
329
399
|
position: 'fixed',
|
|
330
400
|
'z-index': OVERLAY_Z,
|
|
331
401
|
background: MASK_BG,
|
|
332
|
-
transition:
|
|
402
|
+
transition: this.maskTransitionStyle(),
|
|
333
403
|
cursor: 'default',
|
|
334
404
|
top: `${bottom}px`,
|
|
335
405
|
left: '0',
|
|
@@ -353,6 +423,9 @@ class SpotlightOverlayComponent {
|
|
|
353
423
|
popoverSubs = [];
|
|
354
424
|
focusTrap = null;
|
|
355
425
|
previouslyFocusedElement = null;
|
|
426
|
+
pendingArrival = null;
|
|
427
|
+
elementWaitTimerId = null;
|
|
428
|
+
stabilizeGeneration = 0;
|
|
356
429
|
constructor() {
|
|
357
430
|
combineLatest([
|
|
358
431
|
toObservable(this.currentStep),
|
|
@@ -362,34 +435,74 @@ class SpotlightOverlayComponent {
|
|
|
362
435
|
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
363
436
|
.subscribe(([step, active]) => {
|
|
364
437
|
this.disconnectResizeObserver();
|
|
438
|
+
this.cancelPendingArrival();
|
|
439
|
+
const generation = ++this.stabilizeGeneration;
|
|
365
440
|
if (!step || !active) {
|
|
366
|
-
this.
|
|
441
|
+
this.setTargetRectImmediate(null);
|
|
367
442
|
this.destroyPopoverOverlay();
|
|
368
443
|
return;
|
|
369
444
|
}
|
|
370
445
|
const el = this.tourService.getElement(step.stepId);
|
|
371
446
|
if (el?.nativeElement) {
|
|
372
447
|
el.nativeElement.scrollIntoView({ block: 'nearest' });
|
|
373
|
-
|
|
374
|
-
this.zone.runOutsideAngular(() => {
|
|
375
|
-
requestAnimationFrame(() => {
|
|
376
|
-
this.zone.run(() => {
|
|
377
|
-
if (!this.isActive()) {
|
|
378
|
-
return;
|
|
379
|
-
}
|
|
380
|
-
this.updateTargetRect(target);
|
|
381
|
-
this.observeElement(target);
|
|
382
|
-
this.updatePopoverOverlay(target, step);
|
|
383
|
-
});
|
|
384
|
-
});
|
|
385
|
-
});
|
|
448
|
+
this.beginArrivalSequence(el.nativeElement, step, generation);
|
|
386
449
|
}
|
|
387
450
|
else {
|
|
388
|
-
this.
|
|
389
|
-
this.updatePopoverOverlay(null, step);
|
|
451
|
+
this.awaitElementRegistration(step, generation);
|
|
390
452
|
}
|
|
391
453
|
});
|
|
392
454
|
}
|
|
455
|
+
/**
|
|
456
|
+
* Aguarda o layout do elemento-alvo estabilizar (ex: animação de abertura de um menu
|
|
457
|
+
* disparada pelo `beforeNext` do passo anterior) antes de medir sua posição definitiva
|
|
458
|
+
* e posicionar a máscara/popover. Substitui a antiga espera de um único frame, que
|
|
459
|
+
* capturava o retângulo no meio de animações de terceiros na tela.
|
|
460
|
+
*/
|
|
461
|
+
beginArrivalSequence(target, step, generation) {
|
|
462
|
+
this.zone.runOutsideAngular(() => {
|
|
463
|
+
const handle = waitForStableRect(target);
|
|
464
|
+
this.pendingArrival = handle;
|
|
465
|
+
handle.promise.then(({ rect, timedOut }) => {
|
|
466
|
+
this.zone.run(() => {
|
|
467
|
+
if (generation !== this.stabilizeGeneration || !this.isActive()) {
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
if (timedOut) {
|
|
471
|
+
console.warn(`[Spotlight] O layout do elemento do passo "${step.stepId}" não estabilizou a tempo; usando a última posição medida.`);
|
|
472
|
+
}
|
|
473
|
+
this.setTargetRectImmediate(rect);
|
|
474
|
+
this.observeElement(target);
|
|
475
|
+
this.updatePopoverOverlay(target, step);
|
|
476
|
+
});
|
|
477
|
+
});
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* Aguarda até `ELEMENT_WAIT_TIMEOUT_MS` pelo registro do elemento-alvo via
|
|
482
|
+
* `[sSpotlightStep]` (útil quando o `beforeNext` do passo anterior cria o elemento
|
|
483
|
+
* dinamicamente, ex: abrindo uma aba) antes de recorrer ao popover centralizado.
|
|
484
|
+
* Mantém o último quadro renderizado durante a espera para evitar um flash.
|
|
485
|
+
*/
|
|
486
|
+
awaitElementRegistration(step, generation) {
|
|
487
|
+
this.elementWaitTimerId = setTimeout(() => {
|
|
488
|
+
this.zone.run(() => {
|
|
489
|
+
if (generation !== this.stabilizeGeneration) {
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
console.warn(`[Spotlight] Elemento do passo "${step.stepId}" não foi registrado a tempo; exibindo popover centralizado sem destaque.`);
|
|
493
|
+
this.setTargetRectImmediate(null);
|
|
494
|
+
this.updatePopoverOverlay(null, step);
|
|
495
|
+
});
|
|
496
|
+
}, ELEMENT_WAIT_TIMEOUT_MS);
|
|
497
|
+
}
|
|
498
|
+
cancelPendingArrival() {
|
|
499
|
+
this.pendingArrival?.cancel();
|
|
500
|
+
this.pendingArrival = null;
|
|
501
|
+
if (this.elementWaitTimerId !== null) {
|
|
502
|
+
clearTimeout(this.elementWaitTimerId);
|
|
503
|
+
this.elementWaitTimerId = null;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
393
506
|
ngOnInit() {
|
|
394
507
|
this.zone.runOutsideAngular(() => {
|
|
395
508
|
const scrollOpts = { capture: true, passive: true };
|
|
@@ -417,6 +530,7 @@ class SpotlightOverlayComponent {
|
|
|
417
530
|
});
|
|
418
531
|
}
|
|
419
532
|
ngOnDestroy() {
|
|
533
|
+
this.cancelPendingArrival();
|
|
420
534
|
this.destroyPopoverOverlay();
|
|
421
535
|
}
|
|
422
536
|
/** @internal */
|
|
@@ -631,6 +745,22 @@ class SpotlightOverlayComponent {
|
|
|
631
745
|
updateTargetRect(el) {
|
|
632
746
|
this.targetRect.set(el.getBoundingClientRect());
|
|
633
747
|
}
|
|
748
|
+
/**
|
|
749
|
+
* Aplica um novo `targetRect` sem animação de transição na máscara — usado ao
|
|
750
|
+
* chegar/saltar para um alvo novo, onde animar a partir da posição do passo
|
|
751
|
+
* anterior criaria a falsa impressão de "apontou errado e corrigiu depois".
|
|
752
|
+
* A transição é reabilitada no frame seguinte para reposicionamentos legítimos
|
|
753
|
+
* (scroll/resize de um alvo já visível).
|
|
754
|
+
*/
|
|
755
|
+
setTargetRectImmediate(rect) {
|
|
756
|
+
this.maskTransitionEnabled.set(false);
|
|
757
|
+
this.targetRect.set(rect);
|
|
758
|
+
this.zone.runOutsideAngular(() => {
|
|
759
|
+
requestAnimationFrame(() => {
|
|
760
|
+
this.zone.run(() => this.maskTransitionEnabled.set(true));
|
|
761
|
+
});
|
|
762
|
+
});
|
|
763
|
+
}
|
|
634
764
|
refreshRect() {
|
|
635
765
|
const step = this.currentStep();
|
|
636
766
|
if (!step || !this.isActive()) {
|