@seniorsistemas/angular-components 19.1.1 → 19.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bignumber-input/lib/bignumber-input/bignumber-input.directive.d.ts +58 -25
- package/dynamic-form/dynamic-form/components/lookup/lookup.component.d.ts +8 -8
- package/esm2022/bignumber-input/lib/bignumber-input/bignumber-input.directive.mjs +140 -99
- package/esm2022/dynamic-form/dynamic-form/components/lookup/lookup.component.mjs +12 -12
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/bignumber/bignumber-field.component.mjs +3 -3
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/currency/currency-field.component.mjs +3 -3
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/number/number-field.component.mjs +3 -3
- package/esm2022/inline-edit/lib/inline-edit/components/fields/inline-edit-number/inline-edit-number.component.mjs +1 -1
- package/esm2022/inline-edit/lib/inline-edit/fields/inline-edit-number-field.mjs +2 -3
- package/esm2022/locale/lib/locale/apply-localized-mask.mjs +19 -0
- package/esm2022/locale/lib/locale/pipes/localized-bignumber-impure.pipe.mjs +1 -1
- package/esm2022/locale/lib/locale/pipes/localized-bignumber.pipe.mjs +5 -4
- package/esm2022/locale/public-api.mjs +2 -1
- package/esm2022/number-input/lib/number-input/number-input.directive.mjs +12 -148
- package/esm2022/number-input/lib/number-input/number-input.module.mjs +5 -5
- package/esm2022/numeric-mask/lib/numeric-mask/numeric-mask.directive.mjs +32 -35
- package/esm2022/table/lib/table/table-column/table-columns.component.mjs +20 -4
- package/fesm2022/seniorsistemas-angular-components-bignumber-input.mjs +139 -98
- package/fesm2022/seniorsistemas-angular-components-bignumber-input.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs +19 -19
- package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-inline-edit.mjs +2 -3
- package/fesm2022/seniorsistemas-angular-components-inline-edit.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-locale.mjs +22 -4
- package/fesm2022/seniorsistemas-angular-components-locale.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-number-input.mjs +14 -151
- package/fesm2022/seniorsistemas-angular-components-number-input.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-numeric-mask.mjs +31 -34
- package/fesm2022/seniorsistemas-angular-components-numeric-mask.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-table.mjs +20 -5
- package/fesm2022/seniorsistemas-angular-components-table.mjs.map +1 -1
- package/inline-edit/lib/inline-edit/fields/inline-edit-number-field.d.ts +2 -3
- package/locale/lib/locale/apply-localized-mask.d.ts +9 -0
- package/locale/lib/locale/pipes/localized-bignumber-impure.pipe.d.ts +2 -3
- package/locale/lib/locale/pipes/localized-bignumber.pipe.d.ts +3 -2
- package/locale/public-api.d.ts +1 -0
- package/number-input/lib/number-input/number-input.directive.d.ts +7 -47
- package/number-input/lib/number-input/number-input.module.d.ts +2 -2
- package/numeric-mask/lib/numeric-mask/numeric-mask.directive.d.ts +8 -9
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seniorsistemas-angular-components-locale.mjs","sources":["../../projects/angular-components/locale/src/lib/locale/options/calendar.ts","../../projects/angular-components/locale/src/lib/locale/options/number.ts","../../projects/angular-components/locale/src/lib/locale/options/index.ts","../../projects/angular-components/locale/src/lib/locale/locale.service.ts","../../projects/angular-components/locale/src/lib/locale/pipes/localized-bignumber.pipe.ts","../../projects/angular-components/locale/src/lib/locale/pipes/localized-bignumber-impure.pipe.ts","../../projects/angular-components/locale/src/lib/locale/pipes/localized-currency.pipe.ts","../../projects/angular-components/locale/src/lib/locale/pipes/localized-currency-impure.pipe.ts","../../projects/angular-components/locale/src/lib/locale/pipes/localized-date.pipe.ts","../../projects/angular-components/locale/src/lib/locale/pipes/localized-date-impure.pipe.ts","../../projects/angular-components/locale/src/lib/locale/pipes/localized-number.pipe.ts","../../projects/angular-components/locale/src/lib/locale/pipes/localized-time.pipe.ts","../../projects/angular-components/locale/src/lib/locale/pipes/localized-time-impure.pipe.ts","../../projects/angular-components/locale/src/lib/locale/locale.module.ts","../../projects/angular-components/locale/src/seniorsistemas-angular-components-locale.ts"],"sourcesContent":["export interface ICalendarLocaleOptions {\n hourFormat?: string;\n dateFormat?: string;\n firstDayOfWeek?: number;\n today?: string;\n clear?: string;\n dayNames?: string[];\n dayNamesShort?: string[];\n dayNamesMin?: string[];\n monthNamesShort?: string[];\n monthNames?: string[];\n}\n\nexport class CalendarLocaleOptions implements ICalendarLocaleOptions {\n public hourFormat? = '24';\n public dateFormat? = 'dd/mm/yy';\n public firstDayOfWeek? = 0;\n public today? = 'Hoje';\n public clear? = 'Limpar';\n public dayNames?: string[] = ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado'];\n public dayNamesShort?: string[] = ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'];\n public dayNamesMin?: string[] = ['D', 'S', 'T', 'Q', 'Q', 'S', 'S'];\n public monthNamesShort?: string[] = ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'];\n public monthNames?: string[] = ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'];\n\n constructor(config: ICalendarLocaleOptions = {}) {\n this.clear = config?.clear ?? this.clear;\n this.dateFormat = config?.dateFormat ?? this.dateFormat;\n this.dayNames = config?.dayNames ?? this.dayNames;\n this.dayNamesMin = config?.dayNamesMin ?? this.dayNamesMin;\n this.firstDayOfWeek = config?.firstDayOfWeek ?? this.firstDayOfWeek;\n this.hourFormat = config?.hourFormat ?? this.hourFormat;\n this.monthNames = config?.monthNames ?? this.monthNames;\n this.monthNamesShort = config?.monthNamesShort ?? this.monthNamesShort;\n this.today = config?.today ?? this.today;\n }\n}\n","export interface INumberLocaleOptions {\n thousandsSeparator?: string;\n decimalSeparator?: string;\n currencySymbol?: string;\n}\n\nexport class NumberLocaleOptions implements INumberLocaleOptions {\n public thousandsSeparator? = \".\";\n public decimalSeparator? = \",\";\n public currencySymbol? = \"R$\";\n\n constructor(config: INumberLocaleOptions = {}) {\n Object.assign(this, config);\n }\n}\n","import { CalendarLocaleOptions } from './calendar';\nimport { NumberLocaleOptions } from './number';\n\nexport interface ILocaleOptions {\n locale?: string;\n calendar?: CalendarLocaleOptions;\n number?: NumberLocaleOptions;\n}\n\nexport class LocaleOptions implements ILocaleOptions {\n locale? = 'pt-BR';\n calendar = new CalendarLocaleOptions({});\n number = new NumberLocaleOptions();\n\n constructor(config: ILocaleOptions = {}) {\n this.calendar = config.calendar ?? this.calendar;\n this.number = config.number ?? this.number;\n this.locale = config.locale ?? this.locale;\n // Object.keys(config).forEach(key => (this[key] = config[key] || this[key]));\n }\n}\n\n// /**\n// * @deprecated\n// */\n// export const DEFAULT_CALENDAR_LOCALE_OPTIONS = new CalendarLocaleOptions();\n\n// /**\n// * @deprecated\n// */\n// export const DEFAULT_NUMBER_LOCALE_OPTIONS = new NumberLocaleOptions();\n\n// /**\n// * @deprecated\n// */\n// export const DEFAULT_LOCALE_OPTIONS = new LocaleOptions();\n\nexport * from './calendar';\nexport * from './number';\n\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\n\nimport { user } from '@seniorsistemas/senior-platform-data';\nimport moment from 'moment';\nimport { from, Observable, of } from 'rxjs';\nimport { catchError, map, switchMap, tap } from 'rxjs/operators';\nimport { CookieService } from 'ngx-cookie-service';\n\nimport { ILocaleOptions, LocaleOptions } from './options/index';\n\nimport 'moment/locale/es';\nimport 'moment/locale/pt-br';\n\n/**\n * @description Serviço de localização que obtém e armazena o locale do usuário\n * a partir da plataforma Senior. Fornece separadores decimais e de milhar,\n * configurações de calendário e opções de formato PrimeNG com base no locale ativo.\n *\n * @category Locale\n */\n@Injectable()\nexport class LocaleService {\n private locale?: string;\n private localeOptions?: LocaleOptions;\n private readonly localeOptionsAddress = 'https://cdn.senior.com.br/primeng/locales';\n private readonly localeOptionsVersion = '3.0.0';\n private readonly VALID_MOMENT_LANGUAGES = {\n spanish: ['es-do', 'es-mx', 'es-us', 'es'],\n english: ['en', 'en-au', 'en-ca', 'en-gb', 'en-ie', 'en-il', 'en-in', 'en-nz', 'en-sg'],\n };\n\n constructor(\n private readonly http: HttpClient,\n private readonly cookieService: CookieService,\n ) {}\n\n get(): Observable<LocaleOptions> {\n return this.localeOptions\n ? of(this.localeOptions)\n : this.getLocaleConfig().pipe(\n tap(\n (localeOptions: LocaleOptions) =>\n (this.localeOptions = { ...localeOptions, locale: this.locale }),\n ),\n );\n }\n\n getLocale(): Observable<string> {\n return this.locale\n ? of(this.locale)\n : from(this.getUserData()).pipe(\n map((userData: any) => {\n const locale = <string>userData.locale || <string>userData.tenantLocale || 'pt-BR';\n this.locale = locale;\n return this.locale;\n }),\n );\n }\n\n /**\n * Returns an object with the locale options based on the user's locale(platform locale).\n * @return The locale options object.\n */\n getLocaleOptions(): LocaleOptions | undefined {\n return this.localeOptions;\n }\n\n private getUserData() {\n try {\n return of(JSON.parse(this.cookieService.get('com.senior.token')));\n } catch (ex) {\n console.warn('Unable to obtain user locale from cookie, calling getUser');\n return user.getUserData();\n }\n }\n\n /**\n * Set valid locale for moment js locale based on user current locale.\n * Sometimes the locale from user not exists in locale of moment, for example, is valid user with language 'es-CO' but for the momentjs the locale 'es-CO' not exist, so with this function will be applied the 'es' locale.\n * @param userLocale\n * @returns valid locale based in user locale.\n */\n private parseUserLocaleToMoment(userLocale: string): string {\n userLocale = userLocale.toLowerCase();\n if (userLocale.startsWith('es') && !this.VALID_MOMENT_LANGUAGES.spanish.includes(userLocale)) {\n userLocale = 'es';\n }\n if (userLocale.startsWith('en') && !this.VALID_MOMENT_LANGUAGES.english.includes(userLocale)) {\n userLocale = 'en';\n }\n return userLocale;\n }\n\n private getLocaleConfig(): Observable<LocaleOptions> {\n return this.getLocale().pipe(\n switchMap((locale: string) => {\n moment.locale(this.parseUserLocaleToMoment(locale));\n\n return this.http\n .get<ILocaleOptions>(`${this.localeOptionsAddress}/${this.localeOptionsVersion}/${locale}.json`)\n .pipe(map((response) => new LocaleOptions({ ...response, locale })));\n }),\n catchError((err: any) => {\n console.warn(`Error getting locale configuration. Using fallback.`, err);\n return user.getUserData();\n }),\n );\n }\n\n getGroupingSeparator(): string | undefined {\n const numberFormat = new Intl.NumberFormat(this.locale, {\n style: 'decimal',\n useGrouping: true,\n minimumFractionDigits: 5,\n maximumFractionDigits: 5,\n });\n\n // The default groupingSeparator for 'fr' is the character code 8239. We need it to be the regular space.\n if (this.locale?.includes('fr')) return ' ';\n\n return numberFormat.formatToParts(1000).find((part) => part.type === 'group')?.value;\n }\n\n getDecimalSeparator(): string | undefined {\n const numberFormat = new Intl.NumberFormat(this.locale, {\n style: 'decimal',\n minimumFractionDigits: 5,\n maximumFractionDigits: 5,\n });\n\n return numberFormat.formatToParts(1.2).find((part) => part.type === 'decimal')?.value;\n }\n}\n\n","import { Pipe, PipeTransform } from \"@angular/core\";\nimport { LocaleService } from \"../locale.service\";\nimport { map } from \"rxjs/operators\";\nimport { of } from \"rxjs\";\nimport { applyMask, MaskConfig } from \"@seniorsistemas/ng2-currency-mask\";\nimport BigNumber from \"bignumber.js\";\n\n@Pipe({\n name: \"localizedBignumber\",\n})\nexport class LocalizedBignumberPipe implements PipeTransform {\n constructor(\n private localeService: LocaleService\n ) {}\n\n public transform(value?: any, options?: MaskConfig): any {\n return value !== undefined && value !== null ? this.applyMask(value, options) : of(value);\n }\n\n private applyMask(value?: any, options?: MaskConfig) {\n return this.localeService.get().pipe(\n map(localeConfig => {\n const configs: MaskConfig = {\n prefix: options?.prefix ?? localeConfig?.number?.currencySymbol ?? \"R$\",\n thousandsSeparator: options?.thousandsSeparator ?? localeConfig?.number?.thousandsSeparator ?? \".\",\n decimalSeparator: options?.decimalSeparator ?? localeConfig?.number?.decimalSeparator ?? \",\",\n scale: options?.scale ?? 2,\n allowNegative: options?.allowNegative ?? true\n };\n const isNumber = !(new BigNumber(value).isNaN());\n return applyMask(value, configs, isNumber);\n })\n );\n }\n}\n","import { Pipe, PipeTransform } from \"@angular/core\";\n\nimport { MaskConfig } from \"@seniorsistemas/ng2-currency-mask\";\n\nimport { LocalizedBignumberPipe } from \"./localized-bignumber.pipe\";\n\n@Pipe({\n name: \"localizedBignumberImpure\",\n pure: false,\n})\nexport class LocalizedBignumberImpurePipe extends LocalizedBignumberPipe implements PipeTransform {\n public override transform(value?: any, options?: MaskConfig): any {\n return super.transform(value, options);\n }\n}\n","import { Pipe, PipeTransform } from \"@angular/core\";\nimport { LocaleService } from \"../locale.service\";\nimport { map } from \"rxjs/operators\";\nimport { of } from \"rxjs\";\nimport { INumberLocaleOptions, NumberLocaleOptions } from \"../options\";\n\nexport interface ILocalizedCurrencyPipeOptions extends INumberLocaleOptions {\n scale?: number;\n}\n\nexport class LocalizedCurrencyPipeOptions extends NumberLocaleOptions implements ILocalizedCurrencyPipeOptions {\n public scale = 2;\n\n constructor(config: ILocalizedCurrencyPipeOptions = {}) {\n super(config);\n }\n}\n\n/**\n * @deprecated Should use localizedBignumberPipe instead\n */\n@Pipe({\n name: \"localizedCurrency\",\n})\nexport class LocalizedCurrencyPipe implements PipeTransform {\n constructor(private localeService: LocaleService) { }\n\n public transform(value?: any, options?: LocalizedCurrencyPipeOptions): any {\n if (!options) {\n options = new LocalizedCurrencyPipeOptions();\n }\n return value !== undefined && value !== null ? this.applyMask(value, options) : of(value);\n }\n\n private applyMask(value: any, options: LocalizedCurrencyPipeOptions) {\n return this.localeService.get().pipe(\n map(localeConfig => {\n const config = { ...localeConfig.number, ...options };\n const { scale, currencySymbol, thousandsSeparator, decimalSeparator } = config;\n\n const rawValue = Number(value).toFixed(scale);\n const onlyNumbers = rawValue.replace(/[^0-9]/g, ``);\n const integerPart =\n onlyNumbers\n .slice(0, onlyNumbers.length - scale)\n .replace(/^0*/g, ``)\n .replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousandsSeparator!) || `0`;\n const decimalPart = onlyNumbers.slice(onlyNumbers.length - scale);\n const newValue = scale ? integerPart + decimalSeparator + decimalPart : integerPart;\n const isZero = !Number(onlyNumbers);\n const operator = rawValue.includes(\"-\") && !isZero ? \"-\" : \"\";\n return `${operator}${currencySymbol}${newValue}`;\n })\n );\n }\n}\n","import { Pipe, PipeTransform } from \"@angular/core\";\n\nimport { LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions } from \"./localized-currency.pipe\";\n\n/**\n * @deprecated Should use localizedBignumberPipe instead\n */\n@Pipe({\n name: \"localizedCurrencyImpure\",\n pure: false,\n})\nexport class LocalizedCurrencyImpurePipe extends LocalizedCurrencyPipe implements PipeTransform {\n public override transform(value?: any, options: LocalizedCurrencyPipeOptions = new LocalizedCurrencyPipeOptions()): any {\n return super.transform(value, options);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport moment from 'moment';\nimport { map } from 'rxjs/operators';\n\nimport { LocaleService } from '../locale.service';\n\n@Pipe({\n name: 'localizedDate',\n})\nexport class LocalizedDatePipe implements PipeTransform {\n constructor(private localeService: LocaleService) {}\n\n public transform(value: any, format: string = 'L LTS'): any {\n return this.localeService.get().pipe(map(() => (value ? moment(value).format(format) : value)));\n }\n}\n\n","import { Pipe, PipeTransform } from \"@angular/core\";\nimport { LocalizedDatePipe } from \"./localized-date.pipe\";\n\n@Pipe({\n name: \"localizedDateImpure\",\n pure: false,\n})\nexport class LocalizedDateImpurePipe extends LocalizedDatePipe implements PipeTransform {}\n","import { Pipe, PipeTransform } from \"@angular/core\";\nimport { from } from \"rxjs\";\nimport { map } from \"rxjs/operators\";\nimport { LocaleService } from \"../locale.service\";\n\n/**\n * @deprecated Should use localizedBignumberPipe instead\n */\n@Pipe({ name: \"localizedNumber\" })\nexport class LocalizedNumberPipe implements PipeTransform {\n constructor(private localeService: LocaleService) {}\n\n transform(value: number | string, minimumFractionDigits?: number) {\n return from(this.localeService.getLocale()).pipe(\n map((locale: string) => {\n const numericValue = Number(value);\n\n if (!value && isNaN(numericValue)) return;\n\n return new Intl.NumberFormat(locale, {\n minimumFractionDigits: minimumFractionDigits || 0,\n }).format(Number(value));\n })\n );\n }\n}\n\nexport interface Locale {\n localidade?: string;\n tenantLocale?: string;\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport moment from 'moment';\nimport { map } from 'rxjs/operators';\n\nimport { LocaleService } from '../locale.service';\n\n@Pipe({\n name: 'localizedTime',\n})\nexport class LocalizedTimePipe implements PipeTransform {\n constructor(private localeService: LocaleService) {}\n\n public transform(value: any, format: string = 'LTS'): any {\n return this.localeService.get().pipe(map(() => (value ? moment(value, 'HH:mm:ss').format(format) : value)));\n }\n}\n\n","import { Pipe, PipeTransform } from \"@angular/core\";\nimport { LocalizedTimePipe } from \"./localized-time.pipe\";\n\n@Pipe({\n name: \"localizedTimeImpure\",\n pure: false,\n})\nexport class LocalizedTimeImpurePipe extends LocalizedTimePipe implements PipeTransform {}\n","import { CommonModule } from '@angular/common';\nimport { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport { LocaleService } from './locale.service';\nimport { LocalizedBignumberImpurePipe } from './pipes/localized-bignumber-impure.pipe';\nimport { LocalizedBignumberPipe } from './pipes/localized-bignumber.pipe';\nimport { LocalizedCurrencyImpurePipe } from './pipes/localized-currency-impure.pipe';\nimport { LocalizedCurrencyPipe } from './pipes/localized-currency.pipe';\nimport { LocalizedDateImpurePipe } from './pipes/localized-date-impure.pipe';\nimport { LocalizedDatePipe } from './pipes/localized-date.pipe';\nimport { LocalizedNumberPipe } from './pipes/localized-number.pipe';\nimport { LocalizedTimeImpurePipe } from './pipes/localized-time-impure.pipe';\nimport { LocalizedTimePipe } from './pipes/localized-time.pipe';\n\n@NgModule({\n imports: [CommonModule],\n exports: [\n LocalizedCurrencyPipe,\n LocalizedDatePipe,\n LocalizedTimePipe,\n LocalizedNumberPipe,\n LocalizedCurrencyImpurePipe,\n LocalizedDateImpurePipe,\n LocalizedTimeImpurePipe,\n LocalizedBignumberPipe,\n LocalizedBignumberImpurePipe,\n ],\n declarations: [\n LocalizedCurrencyPipe,\n LocalizedDatePipe,\n LocalizedTimePipe,\n LocalizedNumberPipe,\n LocalizedCurrencyImpurePipe,\n LocalizedDateImpurePipe,\n LocalizedTimeImpurePipe,\n LocalizedBignumberPipe,\n LocalizedBignumberImpurePipe,\n ],\n})\nexport class LocaleModule {\n public static forRoot(): ModuleWithProviders<LocaleModule> {\n return {\n ngModule: LocaleModule,\n providers: [\n LocaleService,\n LocalizedCurrencyPipe,\n LocalizedDatePipe,\n LocalizedTimePipe,\n LocalizedNumberPipe,\n LocalizedCurrencyImpurePipe,\n LocalizedDateImpurePipe,\n LocalizedTimeImpurePipe,\n LocalizedBignumberPipe,\n LocalizedBignumberImpurePipe,\n ],\n };\n }\n\n public static forChild(): ModuleWithProviders<LocaleModule> {\n return {\n ngModule: LocaleModule,\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.LocaleService"],"mappings":";;;;;;;;;;;;;;MAaa,qBAAqB,CAAA;IACvB,UAAU,GAAI,IAAI,CAAC;IACnB,UAAU,GAAI,UAAU,CAAC;IACzB,cAAc,GAAI,CAAC,CAAC;IACpB,KAAK,GAAI,MAAM,CAAC;IAChB,KAAK,GAAI,QAAQ,CAAC;AAClB,IAAA,QAAQ,GAAc,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC7F,IAAA,aAAa,GAAc,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAC7E,IAAA,WAAW,GAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,E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A,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,YAxBX,YAAY,CAAA,EAAA,CAAA,CAAA;;4FAwBb,YAAY,EAAA,UAAA,EAAA,CAAA;kBAzBxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,YAAY,CAAC;AACvB,oBAAA,OAAO,EAAE;wBACL,qBAAqB;wBACrB,iBAAiB;wBACjB,iBAAiB;wBACjB,mBAAmB;wBACnB,2BAA2B;wBAC3B,uBAAuB;wBACvB,uBAAuB;wBACvB,sBAAsB;wBACtB,4BAA4B;AAC/B,qBAAA;AACD,oBAAA,YAAY,EAAE;wBACV,qBAAqB;wBACrB,iBAAiB;wBACjB,iBAAiB;wBACjB,mBAAmB;wBACnB,2BAA2B;wBAC3B,uBAAuB;wBACvB,uBAAuB;wBACvB,sBAAsB;wBACtB,4BAA4B;AAC/B,qBAAA;AACJ,iBAAA,CAAA;;;ACtCD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"seniorsistemas-angular-components-locale.mjs","sources":["../../projects/angular-components/locale/src/lib/locale/options/calendar.ts","../../projects/angular-components/locale/src/lib/locale/options/number.ts","../../projects/angular-components/locale/src/lib/locale/options/index.ts","../../projects/angular-components/locale/src/lib/locale/locale.service.ts","../../projects/angular-components/locale/src/lib/locale/apply-localized-mask.ts","../../projects/angular-components/locale/src/lib/locale/pipes/localized-bignumber.pipe.ts","../../projects/angular-components/locale/src/lib/locale/pipes/localized-bignumber-impure.pipe.ts","../../projects/angular-components/locale/src/lib/locale/pipes/localized-currency.pipe.ts","../../projects/angular-components/locale/src/lib/locale/pipes/localized-currency-impure.pipe.ts","../../projects/angular-components/locale/src/lib/locale/pipes/localized-date.pipe.ts","../../projects/angular-components/locale/src/lib/locale/pipes/localized-date-impure.pipe.ts","../../projects/angular-components/locale/src/lib/locale/pipes/localized-number.pipe.ts","../../projects/angular-components/locale/src/lib/locale/pipes/localized-time.pipe.ts","../../projects/angular-components/locale/src/lib/locale/pipes/localized-time-impure.pipe.ts","../../projects/angular-components/locale/src/lib/locale/locale.module.ts","../../projects/angular-components/locale/src/seniorsistemas-angular-components-locale.ts"],"sourcesContent":["export interface ICalendarLocaleOptions {\n hourFormat?: string;\n dateFormat?: string;\n firstDayOfWeek?: number;\n today?: string;\n clear?: string;\n dayNames?: string[];\n dayNamesShort?: string[];\n dayNamesMin?: string[];\n monthNamesShort?: string[];\n monthNames?: string[];\n}\n\nexport class CalendarLocaleOptions implements ICalendarLocaleOptions {\n public hourFormat? = '24';\n public dateFormat? = 'dd/mm/yy';\n public firstDayOfWeek? = 0;\n public today? = 'Hoje';\n public clear? = 'Limpar';\n public dayNames?: string[] = ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado'];\n public dayNamesShort?: string[] = ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'];\n public dayNamesMin?: string[] = ['D', 'S', 'T', 'Q', 'Q', 'S', 'S'];\n public monthNamesShort?: string[] = ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'];\n public monthNames?: string[] = ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'];\n\n constructor(config: ICalendarLocaleOptions = {}) {\n this.clear = config?.clear ?? this.clear;\n this.dateFormat = config?.dateFormat ?? this.dateFormat;\n this.dayNames = config?.dayNames ?? this.dayNames;\n this.dayNamesMin = config?.dayNamesMin ?? this.dayNamesMin;\n this.firstDayOfWeek = config?.firstDayOfWeek ?? this.firstDayOfWeek;\n this.hourFormat = config?.hourFormat ?? this.hourFormat;\n this.monthNames = config?.monthNames ?? this.monthNames;\n this.monthNamesShort = config?.monthNamesShort ?? this.monthNamesShort;\n this.today = config?.today ?? this.today;\n }\n}\n","export interface INumberLocaleOptions {\n thousandsSeparator?: string;\n decimalSeparator?: string;\n currencySymbol?: string;\n}\n\nexport class NumberLocaleOptions implements INumberLocaleOptions {\n public thousandsSeparator? = \".\";\n public decimalSeparator? = \",\";\n public currencySymbol? = \"R$\";\n\n constructor(config: INumberLocaleOptions = {}) {\n Object.assign(this, config);\n }\n}\n","import { CalendarLocaleOptions } from './calendar';\nimport { NumberLocaleOptions } from './number';\n\nexport interface ILocaleOptions {\n locale?: string;\n calendar?: CalendarLocaleOptions;\n number?: NumberLocaleOptions;\n}\n\nexport class LocaleOptions implements ILocaleOptions {\n locale? = 'pt-BR';\n calendar = new CalendarLocaleOptions({});\n number = new NumberLocaleOptions();\n\n constructor(config: ILocaleOptions = {}) {\n this.calendar = config.calendar ?? this.calendar;\n this.number = config.number ?? this.number;\n this.locale = config.locale ?? this.locale;\n // Object.keys(config).forEach(key => (this[key] = config[key] || this[key]));\n }\n}\n\n// /**\n// * @deprecated\n// */\n// export const DEFAULT_CALENDAR_LOCALE_OPTIONS = new CalendarLocaleOptions();\n\n// /**\n// * @deprecated\n// */\n// export const DEFAULT_NUMBER_LOCALE_OPTIONS = new NumberLocaleOptions();\n\n// /**\n// * @deprecated\n// */\n// export const DEFAULT_LOCALE_OPTIONS = new LocaleOptions();\n\nexport * from './calendar';\nexport * from './number';\n\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\n\nimport { user } from '@seniorsistemas/senior-platform-data';\nimport moment from 'moment';\nimport { from, Observable, of } from 'rxjs';\nimport { catchError, map, switchMap, tap } from 'rxjs/operators';\nimport { CookieService } from 'ngx-cookie-service';\n\nimport { ILocaleOptions, LocaleOptions } from './options/index';\n\nimport 'moment/locale/es';\nimport 'moment/locale/pt-br';\n\n/**\n * @description Serviço de localização que obtém e armazena o locale do usuário\n * a partir da plataforma Senior. Fornece separadores decimais e de milhar,\n * configurações de calendário e opções de formato PrimeNG com base no locale ativo.\n *\n * @category Locale\n */\n@Injectable()\nexport class LocaleService {\n private locale?: string;\n private localeOptions?: LocaleOptions;\n private readonly localeOptionsAddress = 'https://cdn.senior.com.br/primeng/locales';\n private readonly localeOptionsVersion = '3.0.0';\n private readonly VALID_MOMENT_LANGUAGES = {\n spanish: ['es-do', 'es-mx', 'es-us', 'es'],\n english: ['en', 'en-au', 'en-ca', 'en-gb', 'en-ie', 'en-il', 'en-in', 'en-nz', 'en-sg'],\n };\n\n constructor(\n private readonly http: HttpClient,\n private readonly cookieService: CookieService,\n ) {}\n\n get(): Observable<LocaleOptions> {\n return this.localeOptions\n ? of(this.localeOptions)\n : this.getLocaleConfig().pipe(\n tap(\n (localeOptions: LocaleOptions) =>\n (this.localeOptions = { ...localeOptions, locale: this.locale }),\n ),\n );\n }\n\n getLocale(): Observable<string> {\n return this.locale\n ? of(this.locale)\n : from(this.getUserData()).pipe(\n map((userData: any) => {\n const locale = <string>userData.locale || <string>userData.tenantLocale || 'pt-BR';\n this.locale = locale;\n return this.locale;\n }),\n );\n }\n\n /**\n * Returns an object with the locale options based on the user's locale(platform locale).\n * @return The locale options object.\n */\n getLocaleOptions(): LocaleOptions | undefined {\n return this.localeOptions;\n }\n\n private getUserData() {\n try {\n return of(JSON.parse(this.cookieService.get('com.senior.token')));\n } catch (ex) {\n console.warn('Unable to obtain user locale from cookie, calling getUser');\n return user.getUserData();\n }\n }\n\n /**\n * Set valid locale for moment js locale based on user current locale.\n * Sometimes the locale from user not exists in locale of moment, for example, is valid user with language 'es-CO' but for the momentjs the locale 'es-CO' not exist, so with this function will be applied the 'es' locale.\n * @param userLocale\n * @returns valid locale based in user locale.\n */\n private parseUserLocaleToMoment(userLocale: string): string {\n userLocale = userLocale.toLowerCase();\n if (userLocale.startsWith('es') && !this.VALID_MOMENT_LANGUAGES.spanish.includes(userLocale)) {\n userLocale = 'es';\n }\n if (userLocale.startsWith('en') && !this.VALID_MOMENT_LANGUAGES.english.includes(userLocale)) {\n userLocale = 'en';\n }\n return userLocale;\n }\n\n private getLocaleConfig(): Observable<LocaleOptions> {\n return this.getLocale().pipe(\n switchMap((locale: string) => {\n moment.locale(this.parseUserLocaleToMoment(locale));\n\n return this.http\n .get<ILocaleOptions>(`${this.localeOptionsAddress}/${this.localeOptionsVersion}/${locale}.json`)\n .pipe(map((response) => new LocaleOptions({ ...response, locale })));\n }),\n catchError((err: any) => {\n console.warn(`Error getting locale configuration. Using fallback.`, err);\n return user.getUserData();\n }),\n );\n }\n\n getGroupingSeparator(): string | undefined {\n const numberFormat = new Intl.NumberFormat(this.locale, {\n style: 'decimal',\n useGrouping: true,\n minimumFractionDigits: 5,\n maximumFractionDigits: 5,\n });\n\n // The default groupingSeparator for 'fr' is the character code 8239. We need it to be the regular space.\n if (this.locale?.includes('fr')) return ' ';\n\n return numberFormat.formatToParts(1000).find((part) => part.type === 'group')?.value;\n }\n\n getDecimalSeparator(): string | undefined {\n const numberFormat = new Intl.NumberFormat(this.locale, {\n style: 'decimal',\n minimumFractionDigits: 5,\n maximumFractionDigits: 5,\n });\n\n return numberFormat.formatToParts(1.2).find((part) => part.type === 'decimal')?.value;\n }\n}\n\n","import BigNumber from 'bignumber.js';\n\nexport interface LocalizedBignumberOptions {\n decimalSeparator?: string;\n thousandsSeparator?: string;\n scale?: number;\n prefix?: string;\n suffix?: string;\n allowNegative?: boolean;\n}\n\nexport function applyLocalizedMask(\n rawValue: any,\n options: Required<LocalizedBignumberOptions>,\n isNumber: boolean,\n): string {\n const { allowNegative, decimalSeparator, scale, prefix, suffix, thousandsSeparator } = options;\n const value = isNumber ? new BigNumber(rawValue).toFixed(scale).toString() : String(rawValue);\n const onlyNumbers = value.replace(/\\D/g, '');\n if (!onlyNumbers) {\n return '';\n }\n const integerPart =\n onlyNumbers\n .slice(0, onlyNumbers.length - scale)\n .replace(/^0*/g, '')\n .replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousandsSeparator) || '0';\n const decimalPart = onlyNumbers.slice(onlyNumbers.length - scale);\n const newValue = scale ? integerPart + decimalSeparator + decimalPart : integerPart;\n const isZero = !integerPart && !decimalPart;\n const operator = String(value).includes('-') && allowNegative && !isZero ? '-' : '';\n return `${operator}${prefix}${newValue}${suffix}`;\n}\n","import { Pipe, PipeTransform } from \"@angular/core\";\nimport { LocaleService } from \"../locale.service\";\nimport { map } from \"rxjs/operators\";\nimport { of } from \"rxjs\";\nimport BigNumber from \"bignumber.js\";\nimport { applyLocalizedMask, LocalizedBignumberOptions } from \"../apply-localized-mask\";\n\nexport type { LocalizedBignumberOptions };\n\n@Pipe({\n name: \"localizedBignumber\",\n})\nexport class LocalizedBignumberPipe implements PipeTransform {\n constructor(\n private localeService: LocaleService\n ) {}\n\n public transform(value?: any, options?: LocalizedBignumberOptions): any {\n return value !== undefined && value !== null ? this.applyMask(value, options) : of(value);\n }\n\n private applyMask(value?: any, options?: LocalizedBignumberOptions) {\n return this.localeService.get().pipe(\n map(localeConfig => {\n const configs: Required<LocalizedBignumberOptions> = {\n prefix: options?.prefix ?? localeConfig?.number?.currencySymbol ?? \"R$\",\n thousandsSeparator: options?.thousandsSeparator ?? localeConfig?.number?.thousandsSeparator ?? \".\",\n decimalSeparator: options?.decimalSeparator ?? localeConfig?.number?.decimalSeparator ?? \",\",\n scale: options?.scale ?? 2,\n suffix: options?.suffix ?? \"\",\n allowNegative: options?.allowNegative ?? true,\n };\n const isNumber = !(new BigNumber(value).isNaN());\n return applyLocalizedMask(value, configs, isNumber);\n })\n );\n }\n}\n","import { Pipe, PipeTransform } from \"@angular/core\";\n\nimport { LocalizedBignumberOptions, LocalizedBignumberPipe } from \"./localized-bignumber.pipe\";\n\n@Pipe({\n name: \"localizedBignumberImpure\",\n pure: false,\n})\nexport class LocalizedBignumberImpurePipe extends LocalizedBignumberPipe implements PipeTransform {\n public override transform(value?: any, options?: LocalizedBignumberOptions): any {\n return super.transform(value, options);\n }\n}\n","import { Pipe, PipeTransform } from \"@angular/core\";\nimport { LocaleService } from \"../locale.service\";\nimport { map } from \"rxjs/operators\";\nimport { of } from \"rxjs\";\nimport { INumberLocaleOptions, NumberLocaleOptions } from \"../options\";\n\nexport interface ILocalizedCurrencyPipeOptions extends INumberLocaleOptions {\n scale?: number;\n}\n\nexport class LocalizedCurrencyPipeOptions extends NumberLocaleOptions implements ILocalizedCurrencyPipeOptions {\n public scale = 2;\n\n constructor(config: ILocalizedCurrencyPipeOptions = {}) {\n super(config);\n }\n}\n\n/**\n * @deprecated Should use localizedBignumberPipe instead\n */\n@Pipe({\n name: \"localizedCurrency\",\n})\nexport class LocalizedCurrencyPipe implements PipeTransform {\n constructor(private localeService: LocaleService) { }\n\n public transform(value?: any, options?: LocalizedCurrencyPipeOptions): any {\n if (!options) {\n options = new LocalizedCurrencyPipeOptions();\n }\n return value !== undefined && value !== null ? this.applyMask(value, options) : of(value);\n }\n\n private applyMask(value: any, options: LocalizedCurrencyPipeOptions) {\n return this.localeService.get().pipe(\n map(localeConfig => {\n const config = { ...localeConfig.number, ...options };\n const { scale, currencySymbol, thousandsSeparator, decimalSeparator } = config;\n\n const rawValue = Number(value).toFixed(scale);\n const onlyNumbers = rawValue.replace(/[^0-9]/g, ``);\n const integerPart =\n onlyNumbers\n .slice(0, onlyNumbers.length - scale)\n .replace(/^0*/g, ``)\n .replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousandsSeparator!) || `0`;\n const decimalPart = onlyNumbers.slice(onlyNumbers.length - scale);\n const newValue = scale ? integerPart + decimalSeparator + decimalPart : integerPart;\n const isZero = !Number(onlyNumbers);\n const operator = rawValue.includes(\"-\") && !isZero ? \"-\" : \"\";\n return `${operator}${currencySymbol}${newValue}`;\n })\n );\n }\n}\n","import { Pipe, PipeTransform } from \"@angular/core\";\n\nimport { LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions } from \"./localized-currency.pipe\";\n\n/**\n * @deprecated Should use localizedBignumberPipe instead\n */\n@Pipe({\n name: \"localizedCurrencyImpure\",\n pure: false,\n})\nexport class LocalizedCurrencyImpurePipe extends LocalizedCurrencyPipe implements PipeTransform {\n public override transform(value?: any, options: LocalizedCurrencyPipeOptions = new LocalizedCurrencyPipeOptions()): any {\n return super.transform(value, options);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport moment from 'moment';\nimport { map } from 'rxjs/operators';\n\nimport { LocaleService } from '../locale.service';\n\n@Pipe({\n name: 'localizedDate',\n})\nexport class LocalizedDatePipe implements PipeTransform {\n constructor(private localeService: LocaleService) {}\n\n public transform(value: any, format: string = 'L LTS'): any {\n return this.localeService.get().pipe(map(() => (value ? moment(value).format(format) : value)));\n }\n}\n\n","import { Pipe, PipeTransform } from \"@angular/core\";\nimport { LocalizedDatePipe } from \"./localized-date.pipe\";\n\n@Pipe({\n name: \"localizedDateImpure\",\n pure: false,\n})\nexport class LocalizedDateImpurePipe extends LocalizedDatePipe implements PipeTransform {}\n","import { Pipe, PipeTransform } from \"@angular/core\";\nimport { from } from \"rxjs\";\nimport { map } from \"rxjs/operators\";\nimport { LocaleService } from \"../locale.service\";\n\n/**\n * @deprecated Should use localizedBignumberPipe instead\n */\n@Pipe({ name: \"localizedNumber\" })\nexport class LocalizedNumberPipe implements PipeTransform {\n constructor(private localeService: LocaleService) {}\n\n transform(value: number | string, minimumFractionDigits?: number) {\n return from(this.localeService.getLocale()).pipe(\n map((locale: string) => {\n const numericValue = Number(value);\n\n if (!value && isNaN(numericValue)) return;\n\n return new Intl.NumberFormat(locale, {\n minimumFractionDigits: minimumFractionDigits || 0,\n }).format(Number(value));\n })\n );\n }\n}\n\nexport interface Locale {\n localidade?: string;\n tenantLocale?: string;\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport moment from 'moment';\nimport { map } from 'rxjs/operators';\n\nimport { LocaleService } from '../locale.service';\n\n@Pipe({\n name: 'localizedTime',\n})\nexport class LocalizedTimePipe implements PipeTransform {\n constructor(private localeService: LocaleService) {}\n\n public transform(value: any, format: string = 'LTS'): any {\n return this.localeService.get().pipe(map(() => (value ? moment(value, 'HH:mm:ss').format(format) : value)));\n }\n}\n\n","import { Pipe, PipeTransform } from \"@angular/core\";\nimport { LocalizedTimePipe } from \"./localized-time.pipe\";\n\n@Pipe({\n name: \"localizedTimeImpure\",\n pure: false,\n})\nexport class LocalizedTimeImpurePipe extends LocalizedTimePipe implements PipeTransform {}\n","import { CommonModule } from '@angular/common';\nimport { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport { LocaleService } from './locale.service';\nimport { LocalizedBignumberImpurePipe } from './pipes/localized-bignumber-impure.pipe';\nimport { LocalizedBignumberPipe } from './pipes/localized-bignumber.pipe';\nimport { LocalizedCurrencyImpurePipe } from './pipes/localized-currency-impure.pipe';\nimport { LocalizedCurrencyPipe } from './pipes/localized-currency.pipe';\nimport { LocalizedDateImpurePipe } from './pipes/localized-date-impure.pipe';\nimport { LocalizedDatePipe } from './pipes/localized-date.pipe';\nimport { LocalizedNumberPipe } from './pipes/localized-number.pipe';\nimport { LocalizedTimeImpurePipe } from './pipes/localized-time-impure.pipe';\nimport { LocalizedTimePipe } from './pipes/localized-time.pipe';\n\n@NgModule({\n imports: [CommonModule],\n exports: [\n LocalizedCurrencyPipe,\n LocalizedDatePipe,\n LocalizedTimePipe,\n LocalizedNumberPipe,\n LocalizedCurrencyImpurePipe,\n LocalizedDateImpurePipe,\n LocalizedTimeImpurePipe,\n LocalizedBignumberPipe,\n LocalizedBignumberImpurePipe,\n ],\n declarations: [\n LocalizedCurrencyPipe,\n LocalizedDatePipe,\n LocalizedTimePipe,\n LocalizedNumberPipe,\n LocalizedCurrencyImpurePipe,\n LocalizedDateImpurePipe,\n LocalizedTimeImpurePipe,\n LocalizedBignumberPipe,\n LocalizedBignumberImpurePipe,\n ],\n})\nexport class LocaleModule {\n public static forRoot(): ModuleWithProviders<LocaleModule> {\n return {\n ngModule: LocaleModule,\n providers: [\n LocaleService,\n LocalizedCurrencyPipe,\n LocalizedDatePipe,\n LocalizedTimePipe,\n LocalizedNumberPipe,\n LocalizedCurrencyImpurePipe,\n LocalizedDateImpurePipe,\n LocalizedTimeImpurePipe,\n LocalizedBignumberPipe,\n LocalizedBignumberImpurePipe,\n ],\n };\n }\n\n public static forChild(): ModuleWithProviders<LocaleModule> {\n return {\n ngModule: LocaleModule,\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.LocaleService"],"mappings":";;;;;;;;;;;;;MAaa,qBAAqB,CAAA;IACvB,UAAU,GAAI,IAAI,CAAC;IACnB,UAAU,GAAI,UAAU,CAAC;IACzB,cAAc,GAAI,CAAC,CAAC;IACpB,KAAK,GAAI,MAAM,CAAC;IAChB,KAAK,GAAI,QAAQ,CAAC;AAClB,IAAA,QAAQ,GAAc,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC7F,IAAA,aAAa,GAAc,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAC7E,IAAA,WAAW,GAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC7D,eAAe,GAAc,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAClH,UAAU,GAAc,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AAE7J,IAAA,WAAA,CAAY,SAAiC,EAAE,EAAA;QAC3C,IAAI,CAAC,KAAK,GAAG,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BAA4B;AAC/B,qBAAA;AACD,oBAAA,YAAY,EAAE;wBACV,qBAAqB;wBACrB,iBAAiB;wBACjB,iBAAiB;wBACjB,mBAAmB;wBACnB,2BAA2B;wBAC3B,uBAAuB;wBACvB,uBAAuB;wBACvB,sBAAsB;wBACtB,4BAA4B;AAC/B,qBAAA;AACJ,iBAAA,CAAA;;;ACtCD;;AAEG;;;;"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { forwardRef, Directive, NgModule } from '@angular/core';
|
|
3
3
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
-
import {
|
|
5
|
-
import { first } from 'rxjs/operators';
|
|
6
|
-
import * as i1 from '@seniorsistemas/angular-components/locale';
|
|
7
|
-
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { BignumberInputDirective, BignumberInputModule } from '@seniorsistemas/angular-components/bignumber-input';
|
|
8
5
|
|
|
9
6
|
/**
|
|
10
|
-
* @deprecated
|
|
7
|
+
* @deprecated Este enum é mantido apenas por compatibilidade. Utilize as strings `'left'` ou `'right'` diretamente.
|
|
11
8
|
*/
|
|
12
9
|
var NumberAlignmentOption;
|
|
13
10
|
(function (NumberAlignmentOption) {
|
|
@@ -15,9 +12,9 @@ var NumberAlignmentOption;
|
|
|
15
12
|
NumberAlignmentOption["LEFT"] = "left";
|
|
16
13
|
})(NumberAlignmentOption || (NumberAlignmentOption = {}));
|
|
17
14
|
/**
|
|
18
|
-
* @deprecated Use a diretiva `
|
|
19
|
-
* @description
|
|
20
|
-
*
|
|
15
|
+
* @deprecated Use a diretiva `sNumericMask` em vez desta.
|
|
16
|
+
* @description Alias de `BignumberInputDirective` mantido por compatibilidade.
|
|
17
|
+
* Todos os inputs e outputs são idênticos ao `sBignumberInput`.
|
|
21
18
|
*
|
|
22
19
|
* @example
|
|
23
20
|
* ```html
|
|
@@ -26,127 +23,15 @@ var NumberAlignmentOption;
|
|
|
26
23
|
*
|
|
27
24
|
* @category Inputs
|
|
28
25
|
*/
|
|
29
|
-
class NumberInputDirective extends
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/** @description Número total de dígitos (inteiros + decimais). @default 15 */
|
|
33
|
-
precision = 15;
|
|
34
|
-
/** @description Número de casas decimais. @default 0 */
|
|
35
|
-
scale = 0;
|
|
36
|
-
/** @description Separador decimal personalizado. Usa o do locale ativo se não informado. */
|
|
37
|
-
decimalSeparator;
|
|
38
|
-
/** @description Separador de milhar personalizado. Usa o do locale ativo se não informado. */
|
|
39
|
-
thousandsSeparator;
|
|
40
|
-
/** @description Alinhamento do texto no campo. @default NumberAlignmentOption.LEFT */
|
|
41
|
-
alignTo = NumberAlignmentOption.LEFT;
|
|
42
|
-
/** @description Habilita a entrada de valores negativos. @default true */
|
|
43
|
-
allowNegative = true;
|
|
44
|
-
/** @description Placeholder exibido quando o campo está vazio. */
|
|
45
|
-
placeholder;
|
|
46
|
-
/** @description Comprimento máximo do valor permitido. */
|
|
47
|
-
maxLength;
|
|
48
|
-
/** @description Emitido quando o conteúdo colado pelo usuário é rejeitado por ser inválido. */
|
|
49
|
-
pasteRejected = new EventEmitter();
|
|
50
|
-
pasteListener;
|
|
51
|
-
_maxLength = 0;
|
|
52
|
-
keypressListener;
|
|
53
|
-
constructor(_elementRef, _keyValueDiffers, localeService) {
|
|
54
|
-
super({}, _elementRef, _keyValueDiffers);
|
|
55
|
-
this._elementRef = _elementRef;
|
|
56
|
-
this.localeService = localeService;
|
|
57
|
-
this.onLocaleService();
|
|
58
|
-
}
|
|
59
|
-
ngOnInit() {
|
|
60
|
-
this.updateVariables();
|
|
61
|
-
super.ngOnInit();
|
|
62
|
-
this.pasteListener = this._onPaste.bind(this);
|
|
63
|
-
this._elementRef.nativeElement.addEventListener('paste', this.pasteListener);
|
|
64
|
-
this.keypressListener = this._onKeypress.bind(this);
|
|
65
|
-
this._elementRef.nativeElement.addEventListener('keypress', this.keypressListener);
|
|
66
|
-
}
|
|
67
|
-
ngOnChanges(changes) {
|
|
68
|
-
const placeholderChange = changes['placeholder'] && changes['placeholder'].currentValue;
|
|
69
|
-
if (!placeholderChange && this.scale)
|
|
70
|
-
this.placeholder = `0${this.decimalSeparator}${''.padEnd(this.scale, '0')}`;
|
|
71
|
-
if (changes['scale'] ||
|
|
72
|
-
changes['decimalSeparator'] ||
|
|
73
|
-
changes['thousandsSeparator'] ||
|
|
74
|
-
changes['alignTo'] ||
|
|
75
|
-
changes['precision'] ||
|
|
76
|
-
changes['allowNegative']) {
|
|
77
|
-
this.updateVariables();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
ngOnDestroy() {
|
|
81
|
-
this._elementRef.nativeElement.removeEventListener('paste', this.pasteListener);
|
|
82
|
-
this._elementRef.nativeElement.removeEventListener('keypress', this.keypressListener);
|
|
83
|
-
}
|
|
84
|
-
_onPaste(event) {
|
|
85
|
-
const pastedText = event.clipboardData?.getData('text') ?? '';
|
|
86
|
-
const numericText = pastedText
|
|
87
|
-
.replace(new RegExp(`\\${this.thousandsSeparator}`, 'g'), '')
|
|
88
|
-
.replace(this.decimalSeparator, '.');
|
|
89
|
-
const [intPart, decimalPart = ''] = numericText.split('.');
|
|
90
|
-
const totalDigits = intPart.replace(/\D/g, '').length + decimalPart.slice(0, this.scale).length;
|
|
91
|
-
if (totalDigits > this.precision) {
|
|
92
|
-
event.preventDefault();
|
|
93
|
-
event.stopPropagation();
|
|
94
|
-
this.pasteRejected.emit(pastedText);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
_onKeypress(event) {
|
|
98
|
-
const code = event.code;
|
|
99
|
-
if (code === 'Minus' || code === 'NumpadSubtract') {
|
|
100
|
-
if (this.allowNegative) {
|
|
101
|
-
this.maxLength = this._maxLength + 1;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
else if (code === 'Equal' || code === 'NumpadAdd') {
|
|
105
|
-
this.maxLength = this._maxLength;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Update the options values according to the directive input values.
|
|
110
|
-
*/
|
|
111
|
-
updateVariables() {
|
|
112
|
-
this.options = {
|
|
113
|
-
align: this.alignTo,
|
|
114
|
-
decimal: this.decimalSeparator,
|
|
115
|
-
thousands: this.thousandsSeparator,
|
|
116
|
-
precision: this.scale || 0,
|
|
117
|
-
prefix: '',
|
|
118
|
-
suffix: '',
|
|
119
|
-
allowNegative: this.allowNegative,
|
|
120
|
-
};
|
|
121
|
-
this.calculateMaxLength();
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Responsible to calculate the field maximum length considering the separators.
|
|
125
|
-
*/
|
|
126
|
-
calculateMaxLength() {
|
|
127
|
-
const decSepLength = this.decimalSeparator?.length ?? 0;
|
|
128
|
-
const thoSepLength = this.thousandsSeparator?.length ?? 0;
|
|
129
|
-
let maxLength = this.precision + (this.scale ? decSepLength : 0);
|
|
130
|
-
maxLength += Math.ceil((this.precision - (this.scale ? this.scale : 0)) / 3 - 1) * thoSepLength;
|
|
131
|
-
this.maxLength = maxLength;
|
|
132
|
-
}
|
|
133
|
-
onLocaleService() {
|
|
134
|
-
this.localeService
|
|
135
|
-
.getLocale()
|
|
136
|
-
.pipe(first())
|
|
137
|
-
.subscribe(() => {
|
|
138
|
-
this.decimalSeparator = this.decimalSeparator ?? this.localeService.getDecimalSeparator();
|
|
139
|
-
this.thousandsSeparator = this.thousandsSeparator ?? this.localeService.getGroupingSeparator();
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NumberInputDirective, deps: [{ token: i0.ElementRef }, { token: i0.KeyValueDiffers }, { token: i1.LocaleService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
143
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: NumberInputDirective, selector: "input[sNumberInput]", inputs: { precision: "precision", scale: "scale", decimalSeparator: "decimalSeparator", thousandsSeparator: "thousandsSeparator", alignTo: "alignTo", allowNegative: "allowNegative", placeholder: "placeholder" }, outputs: { pasteRejected: "pasteRejected" }, host: { properties: { "attr.placeholder": "this.placeholder", "attr.maxLength": "this.maxLength" } }, providers: [
|
|
26
|
+
class NumberInputDirective extends BignumberInputDirective {
|
|
27
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NumberInputDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
28
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: NumberInputDirective, selector: "input[sNumberInput]", providers: [
|
|
144
29
|
{
|
|
145
30
|
provide: NG_VALUE_ACCESSOR,
|
|
146
31
|
useExisting: forwardRef(() => NumberInputDirective),
|
|
147
32
|
multi: true,
|
|
148
33
|
},
|
|
149
|
-
], usesInheritance: true,
|
|
34
|
+
], usesInheritance: true, ngImport: i0 });
|
|
150
35
|
}
|
|
151
36
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NumberInputDirective, decorators: [{
|
|
152
37
|
type: Directive,
|
|
@@ -160,42 +45,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
160
45
|
},
|
|
161
46
|
],
|
|
162
47
|
}]
|
|
163
|
-
}]
|
|
164
|
-
type: Input
|
|
165
|
-
}], scale: [{
|
|
166
|
-
type: Input
|
|
167
|
-
}], decimalSeparator: [{
|
|
168
|
-
type: Input
|
|
169
|
-
}], thousandsSeparator: [{
|
|
170
|
-
type: Input
|
|
171
|
-
}], alignTo: [{
|
|
172
|
-
type: Input
|
|
173
|
-
}], allowNegative: [{
|
|
174
|
-
type: Input
|
|
175
|
-
}], placeholder: [{
|
|
176
|
-
type: Input
|
|
177
|
-
}, {
|
|
178
|
-
type: HostBinding,
|
|
179
|
-
args: ['attr.placeholder']
|
|
180
|
-
}], maxLength: [{
|
|
181
|
-
type: HostBinding,
|
|
182
|
-
args: ['attr.maxLength']
|
|
183
|
-
}], pasteRejected: [{
|
|
184
|
-
type: Output
|
|
185
|
-
}] } });
|
|
48
|
+
}] });
|
|
186
49
|
|
|
187
50
|
/**
|
|
188
51
|
* @deprecated Should use 'BignumberInputModule' instead
|
|
189
52
|
*/
|
|
190
53
|
class NumberInputModule {
|
|
191
54
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NumberInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
192
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: NumberInputModule, declarations: [NumberInputDirective], imports: [
|
|
193
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NumberInputModule, imports: [
|
|
55
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: NumberInputModule, declarations: [NumberInputDirective], imports: [BignumberInputModule], exports: [NumberInputDirective] });
|
|
56
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NumberInputModule, imports: [BignumberInputModule] });
|
|
194
57
|
}
|
|
195
58
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NumberInputModule, decorators: [{
|
|
196
59
|
type: NgModule,
|
|
197
60
|
args: [{
|
|
198
|
-
imports: [
|
|
61
|
+
imports: [BignumberInputModule],
|
|
199
62
|
declarations: [NumberInputDirective],
|
|
200
63
|
exports: [NumberInputDirective],
|
|
201
64
|
}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seniorsistemas-angular-components-number-input.mjs","sources":["../../projects/angular-components/number-input/src/lib/number-input/number-input.directive.ts","../../projects/angular-components/number-input/src/lib/number-input/number-input.module.ts","../../projects/angular-components/number-input/src/seniorsistemas-angular-components-number-input.ts"],"sourcesContent":["import {\n Directive,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostBinding,\n HostListener,\n Input,\n KeyValueDiffers,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { LocaleService } from '@seniorsistemas/angular-components/locale';\n\nimport { CurrencyMaskDirective, CurrencyMaskConfig } from 'ng2-currency-mask';\nimport { first } from 'rxjs/operators';\n\n/**\n * @deprecated Should use 'AlignmentOptions' from @seniorsistemas/ng2-currency-mask instead\n */\nexport enum NumberAlignmentOption {\n RIGHT = 'right',\n LEFT = 'left',\n}\n\n/**\n * @deprecated Use a diretiva `BigNumberInput` em vez desta.\n * @description Diretiva de entrada numérica com formatação localizada (separador decimal\n * e de milhar), suporte a precisão, escala e alinhamento. Extende `CurrencyMaskDirective`.\n *\n * @example\n * ```html\n * <input sNumberInput [precision]=\"10\" [scale]=\"2\" />\n * ```\n *\n * @category Inputs\n */\n@Directive({\n selector: 'input[sNumberInput]',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => NumberInputDirective),\n multi: true,\n },\n ],\n})\nexport class NumberInputDirective extends CurrencyMaskDirective implements OnInit, OnChanges, OnDestroy {\n /** @description Número total de dígitos (inteiros + decimais). @default 15 */\n @Input()\n public precision = 15;\n\n /** @description Número de casas decimais. @default 0 */\n @Input()\n public scale = 0;\n\n /** @description Separador decimal personalizado. Usa o do locale ativo se não informado. */\n @Input()\n public decimalSeparator?: string;\n\n /** @description Separador de milhar personalizado. Usa o do locale ativo se não informado. */\n @Input()\n public thousandsSeparator?: string;\n\n /** @description Alinhamento do texto no campo. @default NumberAlignmentOption.LEFT */\n @Input()\n public alignTo = NumberAlignmentOption.LEFT;\n\n /** @description Habilita a entrada de valores negativos. @default true */\n @Input()\n public allowNegative = true;\n\n /** @description Placeholder exibido quando o campo está vazio. */\n @Input()\n @HostBinding('attr.placeholder')\n public placeholder?: string;\n\n /** @description Comprimento máximo do valor permitido. */\n @HostBinding('attr.maxLength')\n public maxLength?: number;\n\n /** @description Emitido quando o conteúdo colado pelo usuário é rejeitado por ser inválido. */\n @Output()\n public pasteRejected = new EventEmitter<string>();\n\n private pasteListener: any;\n private _maxLength = 0;\n\n private keypressListener: any;\n\n constructor(\n private readonly _elementRef: ElementRef,\n _keyValueDiffers: KeyValueDiffers,\n private readonly localeService: LocaleService,\n ) {\n super({} as CurrencyMaskConfig, _elementRef, _keyValueDiffers);\n\n this.onLocaleService();\n }\n\n public override ngOnInit(): void {\n this.updateVariables();\n\n super.ngOnInit();\n this.pasteListener = this._onPaste.bind(this);\n this._elementRef.nativeElement.addEventListener('paste', this.pasteListener);\n\n this.keypressListener = this._onKeypress.bind(this);\n this._elementRef.nativeElement.addEventListener('keypress', this.keypressListener);\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n const placeholderChange = changes['placeholder'] && changes['placeholder'].currentValue;\n if (!placeholderChange && this.scale)\n this.placeholder = `0${this.decimalSeparator}${''.padEnd(this.scale, '0')}`;\n\n if (\n changes['scale'] ||\n changes['decimalSeparator'] ||\n changes['thousandsSeparator'] ||\n changes['alignTo'] ||\n changes['precision'] ||\n changes['allowNegative']\n ) {\n this.updateVariables();\n }\n }\n\n public ngOnDestroy(): void {\n this._elementRef.nativeElement.removeEventListener('paste', this.pasteListener);\n this._elementRef.nativeElement.removeEventListener('keypress', this.keypressListener);\n }\n\n private _onPaste(event: ClipboardEvent): void {\n const pastedText = event.clipboardData?.getData('text') ?? '';\n const numericText = pastedText\n .replace(new RegExp(`\\\\${this.thousandsSeparator}`, 'g'), '')\n .replace(this.decimalSeparator as string, '.');\n const [intPart, decimalPart = ''] = numericText.split('.');\n const totalDigits = intPart.replace(/\\D/g, '').length + decimalPart.slice(0, this.scale).length;\n\n if (totalDigits > this.precision) {\n event.preventDefault();\n event.stopPropagation();\n this.pasteRejected.emit(pastedText);\n }\n }\n\n private _onKeypress(event: KeyboardEvent): void {\n const code = event.code;\n\n if (code === 'Minus' || code === 'NumpadSubtract') {\n if (this.allowNegative) {\n this.maxLength = this._maxLength + 1;\n }\n } else if (code === 'Equal' || code === 'NumpadAdd') {\n this.maxLength = this._maxLength;\n }\n }\n\n /**\n * Update the options values according to the directive input values.\n */\n private updateVariables(): void {\n this.options = {\n align: this.alignTo,\n decimal: this.decimalSeparator,\n thousands: this.thousandsSeparator,\n precision: this.scale || 0,\n prefix: '',\n suffix: '',\n allowNegative: this.allowNegative,\n };\n this.calculateMaxLength();\n }\n\n /**\n * Responsible to calculate the field maximum length considering the separators.\n */\n private calculateMaxLength(): void {\n const decSepLength = this.decimalSeparator?.length ?? 0;\n const thoSepLength = this.thousandsSeparator?.length ?? 0;\n\n let maxLength = this.precision + (this.scale ? decSepLength : 0);\n maxLength += Math.ceil((this.precision - (this.scale ? this.scale : 0)) / 3 - 1) * thoSepLength;\n\n this.maxLength = maxLength;\n }\n\n private onLocaleService(): void {\n this.localeService\n .getLocale()\n .pipe(first())\n .subscribe(() => {\n this.decimalSeparator = this.decimalSeparator ?? this.localeService.getDecimalSeparator();\n this.thousandsSeparator = this.thousandsSeparator ?? this.localeService.getGroupingSeparator();\n });\n }\n}\n\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { NumberInputDirective } from './number-input.directive';\n\n/**\n * @deprecated Should use 'BignumberInputModule' instead\n */\n@NgModule({\n imports: [CommonModule],\n declarations: [NumberInputDirective],\n exports: [NumberInputDirective],\n})\nexport class NumberInputModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAqBA;;AAEG;IACS,sBAGX;AAHD,CAAA,UAAY,qBAAqB,EAAA;AAC7B,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;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mjs","sources":["../../projects/angular-components/number-input/src/lib/number-input/number-input.directive.ts","../../projects/angular-components/number-input/src/lib/number-input/number-input.module.ts","../../projects/angular-components/number-input/src/seniorsistemas-angular-components-number-input.ts"],"sourcesContent":["import { Directive, forwardRef } from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport { BignumberInputDirective } from '@seniorsistemas/angular-components/bignumber-input';\n\n/**\n * @deprecated Este enum é mantido apenas por compatibilidade. Utilize as strings `'left'` ou `'right'` diretamente.\n */\nexport enum NumberAlignmentOption {\n RIGHT = 'right',\n LEFT = 'left',\n}\n\n/**\n * @deprecated Use a diretiva `sNumericMask` em vez desta.\n * @description Alias de `BignumberInputDirective` mantido por compatibilidade.\n * Todos os inputs e outputs são idênticos ao `sBignumberInput`.\n *\n * @example\n * ```html\n * <input sNumberInput [precision]=\"10\" [scale]=\"2\" />\n * ```\n *\n * @category Inputs\n */\n@Directive({\n selector: 'input[sNumberInput]',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => NumberInputDirective),\n multi: true,\n },\n ],\n})\nexport class NumberInputDirective extends BignumberInputDirective {}\n\n","import { NgModule } from '@angular/core';\n\nimport { BignumberInputModule } from '@seniorsistemas/angular-components/bignumber-input';\n\nimport { NumberInputDirective } from './number-input.directive';\n\n/**\n * @deprecated Should use 'BignumberInputModule' instead\n */\n@NgModule({\n imports: [BignumberInputModule],\n declarations: [NumberInputDirective],\n exports: [NumberInputDirective],\n})\nexport class NumberInputModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAKA;;AAEG;IACS,sBAGX;AAHD,CAAA,UAAY,qBAAqB,EAAA;AAC7B,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,qBAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACjB,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,GAGhC,EAA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BAAoB,CADzB,EAAA,OAAA,EAAA,CAAA,oBAAoB,aAEpB,oBAAoB,CAAA,EAAA,CAAA,CAAA;AAErB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAJhB,oBAAoB,CAAA,EAAA,CAAA,CAAA;;4FAIrB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAL7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,oBAAoB,CAAC;oBAC/B,YAAY,EAAE,CAAC,oBAAoB,CAAC;oBACpC,OAAO,EAAE,CAAC,oBAAoB,CAAC;AAClC,iBAAA,CAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, inject, ElementRef, Renderer2,
|
|
2
|
+
import { input, inject, ElementRef, Renderer2, model, forwardRef, Directive, NgModule } from '@angular/core';
|
|
3
3
|
import { NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
|
|
4
4
|
import { LocaleService } from '@seniorsistemas/angular-components/locale';
|
|
5
5
|
import BigNumber from 'bignumber.js';
|
|
@@ -64,18 +64,16 @@ class NumericMaskDirective {
|
|
|
64
64
|
localeService = inject(LocaleService, { optional: true });
|
|
65
65
|
onChange = () => { };
|
|
66
66
|
onTouched = () => { };
|
|
67
|
-
decimalSeparator = ',';
|
|
68
|
-
thousandSeparator = '.';
|
|
67
|
+
decimalSeparator = model(',');
|
|
68
|
+
thousandSeparator = model('.');
|
|
69
69
|
currentLocale = 'pt-BR';
|
|
70
70
|
lastModelValue = null;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
});
|
|
71
|
+
ngOnChanges(changes) {
|
|
72
|
+
if (changes['locale'] && !changes['locale'].firstChange && this.locale()) {
|
|
73
|
+
this.currentLocale = this.locale();
|
|
74
|
+
this.updateSeparators();
|
|
75
|
+
this.setInputMode();
|
|
76
|
+
}
|
|
79
77
|
}
|
|
80
78
|
ngOnInit() {
|
|
81
79
|
if (this.minDecimalPlaces() > this.maxDecimalPlaces()) {
|
|
@@ -117,7 +115,7 @@ class NumericMaskDirective {
|
|
|
117
115
|
return;
|
|
118
116
|
}
|
|
119
117
|
if (this.lastModelValue) {
|
|
120
|
-
const displayValue = this.lastModelValue.replace('.', this.decimalSeparator);
|
|
118
|
+
const displayValue = this.lastModelValue.replace('.', this.decimalSeparator());
|
|
121
119
|
this.renderer.setProperty(input, 'value', displayValue);
|
|
122
120
|
input.select();
|
|
123
121
|
return;
|
|
@@ -126,7 +124,7 @@ class NumericMaskDirective {
|
|
|
126
124
|
if (!modelValue) {
|
|
127
125
|
return;
|
|
128
126
|
}
|
|
129
|
-
const displayValue = modelValue.replace('.', this.decimalSeparator);
|
|
127
|
+
const displayValue = modelValue.replace('.', this.decimalSeparator());
|
|
130
128
|
this.renderer.setProperty(input, 'value', displayValue);
|
|
131
129
|
input.select();
|
|
132
130
|
}
|
|
@@ -233,19 +231,18 @@ class NumericMaskDirective {
|
|
|
233
231
|
}
|
|
234
232
|
/**
|
|
235
233
|
* Updates separators according to the locale
|
|
236
|
-
* @private
|
|
237
234
|
*/
|
|
238
235
|
updateSeparators() {
|
|
239
236
|
const formatted = new Intl.NumberFormat(this.currentLocale).format(1234.5);
|
|
240
|
-
this.thousandSeparator
|
|
241
|
-
this.decimalSeparator
|
|
237
|
+
this.thousandSeparator.set(formatted[1]);
|
|
238
|
+
this.decimalSeparator.set(formatted[5]);
|
|
242
239
|
}
|
|
243
240
|
/**
|
|
244
241
|
* Processes input value and updates the input and model
|
|
245
242
|
* @private
|
|
246
243
|
*/
|
|
247
244
|
processInputValue(value) {
|
|
248
|
-
if (!this.decimalSeparator || !this.thousandSeparator) {
|
|
245
|
+
if (!this.decimalSeparator() || !this.thousandSeparator()) {
|
|
249
246
|
this.updateSeparators();
|
|
250
247
|
}
|
|
251
248
|
this.renderer.setProperty(this.elementRef.nativeElement, 'value', value);
|
|
@@ -267,7 +264,7 @@ class NumericMaskDirective {
|
|
|
267
264
|
* @private
|
|
268
265
|
*/
|
|
269
266
|
removeSeparators(value) {
|
|
270
|
-
const thousandRegex = new RegExp(`\\${this.escapeRegex(this.thousandSeparator)}`, 'g');
|
|
267
|
+
const thousandRegex = new RegExp(`\\${this.escapeRegex(this.thousandSeparator())}`, 'g');
|
|
271
268
|
return value.replace(thousandRegex, '');
|
|
272
269
|
}
|
|
273
270
|
/**
|
|
@@ -275,10 +272,10 @@ class NumericMaskDirective {
|
|
|
275
272
|
* @private
|
|
276
273
|
*/
|
|
277
274
|
stripTrailingZeros(value) {
|
|
278
|
-
const parts = value.split(this.decimalSeparator);
|
|
275
|
+
const parts = value.split(this.decimalSeparator());
|
|
279
276
|
if (parts.length === 2) {
|
|
280
277
|
const decimalPart = parts[1].replace(/0+$/, '');
|
|
281
|
-
return decimalPart.length > 0 ? parts[0] + this.decimalSeparator + decimalPart : parts[0];
|
|
278
|
+
return decimalPart.length > 0 ? parts[0] + this.decimalSeparator() + decimalPart : parts[0];
|
|
282
279
|
}
|
|
283
280
|
return value;
|
|
284
281
|
}
|
|
@@ -288,15 +285,15 @@ class NumericMaskDirective {
|
|
|
288
285
|
*/
|
|
289
286
|
normalizeSeparators(value) {
|
|
290
287
|
value = this.removeSeparators(value);
|
|
291
|
-
if (this.decimalSeparator === ',') {
|
|
288
|
+
if (this.decimalSeparator() === ',') {
|
|
292
289
|
value = value.replace(/\./g, ',');
|
|
293
290
|
}
|
|
294
|
-
else if (this.decimalSeparator === '.') {
|
|
291
|
+
else if (this.decimalSeparator() === '.') {
|
|
295
292
|
value = value.replace(/,/g, '.');
|
|
296
293
|
}
|
|
297
|
-
const parts = value.split(this.decimalSeparator);
|
|
294
|
+
const parts = value.split(this.decimalSeparator());
|
|
298
295
|
if (parts.length > 2) {
|
|
299
|
-
value = parts[0] + this.decimalSeparator + parts.slice(1).join('');
|
|
296
|
+
value = parts[0] + this.decimalSeparator() + parts.slice(1).join('');
|
|
300
297
|
}
|
|
301
298
|
return value;
|
|
302
299
|
}
|
|
@@ -327,8 +324,8 @@ class NumericMaskDirective {
|
|
|
327
324
|
const isNegative = value.startsWith('-');
|
|
328
325
|
let numericStr = value
|
|
329
326
|
.replace(/^-/, '')
|
|
330
|
-
.replace(new RegExp(`\\${this.thousandSeparator}`, 'g'), '')
|
|
331
|
-
.replace(new RegExp(`\\${this.decimalSeparator}`, 'g'), '.');
|
|
327
|
+
.replace(new RegExp(`\\${this.thousandSeparator()}`, 'g'), '')
|
|
328
|
+
.replace(new RegExp(`\\${this.decimalSeparator()}`, 'g'), '.');
|
|
332
329
|
if (numericStr === '.' || numericStr === '') {
|
|
333
330
|
numericStr = '0';
|
|
334
331
|
}
|
|
@@ -353,17 +350,17 @@ class NumericMaskDirective {
|
|
|
353
350
|
let bigNumeric = numeric instanceof BigNumber ? numeric : new BigNumber(numeric);
|
|
354
351
|
const truncatedValue = this.truncateToDecimalPlaces(bigNumeric, this.maxDecimalPlaces());
|
|
355
352
|
const valueStr = truncatedValue.toFixed(Math.max(this.minDecimalPlaces(), this.maxDecimalPlaces()));
|
|
356
|
-
let formattedValue = valueStr.replace('.', this.decimalSeparator);
|
|
357
|
-
const parts = formattedValue.split(this.decimalSeparator);
|
|
353
|
+
let formattedValue = valueStr.replace('.', this.decimalSeparator());
|
|
354
|
+
const parts = formattedValue.split(this.decimalSeparator());
|
|
358
355
|
const integerPart = parts[0];
|
|
359
356
|
let decimalPart = parts[1] || '';
|
|
360
357
|
const formattedInteger = new Intl.NumberFormat(this.currentLocale)
|
|
361
358
|
.format(parseInt(integerPart, 10) || 0)
|
|
362
|
-
.split(this.decimalSeparator)[0];
|
|
359
|
+
.split(this.decimalSeparator())[0];
|
|
363
360
|
const effectiveDecimalPlaces = decimalPart.replace(/0+$/, '').length;
|
|
364
361
|
const decimalPlacesToShow = Math.max(this.minDecimalPlaces(), Math.min(effectiveDecimalPlaces, this.maxDecimalPlaces()));
|
|
365
362
|
decimalPart = decimalPart.substring(0, decimalPlacesToShow).padEnd(decimalPlacesToShow, '0');
|
|
366
|
-
return decimalPart ? formattedInteger + this.decimalSeparator + decimalPart : formattedInteger;
|
|
363
|
+
return decimalPart ? formattedInteger + this.decimalSeparator() + decimalPart : formattedInteger;
|
|
367
364
|
}
|
|
368
365
|
/**
|
|
369
366
|
* Converts the formatted value to the model format (international standard string)
|
|
@@ -433,7 +430,7 @@ class NumericMaskDirective {
|
|
|
433
430
|
this.onChange(modelValue);
|
|
434
431
|
}
|
|
435
432
|
writeValue(value) {
|
|
436
|
-
if (!this.decimalSeparator || !this.thousandSeparator) {
|
|
433
|
+
if (!this.decimalSeparator() || !this.thousandSeparator()) {
|
|
437
434
|
this.updateSeparators();
|
|
438
435
|
}
|
|
439
436
|
const hasFocus = document.activeElement === this.elementRef.nativeElement;
|
|
@@ -498,7 +495,7 @@ class NumericMaskDirective {
|
|
|
498
495
|
return null;
|
|
499
496
|
}
|
|
500
497
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NumericMaskDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
501
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.14", type: NumericMaskDirective, isStandalone: true, selector: "[sNumericMask]", inputs: { locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, minDecimalPlaces: { classPropertyName: "minDecimalPlaces", publicName: "minDecimalPlaces", isSignal: true, isRequired: false, transformFunction: null }, maxDecimalPlaces: { classPropertyName: "maxDecimalPlaces", publicName: "maxDecimalPlaces", isSignal: true, isRequired: false, transformFunction: null }, allowNegative: { classPropertyName: "allowNegative", publicName: "allowNegative", isSignal: true, isRequired: false, transformFunction: null }, allowScientificNotation: { classPropertyName: "allowScientificNotation", publicName: "allowScientificNotation", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "input": "onInput($event)", "focus": "onFocus()", "blur": "onBlur()", "paste": "onPaste($event)", "keydown": "onKeyDown($event)", "keypress": "onKeyPress($event)" }, properties: { "style.text-align": "\"right\"" } }, providers: [
|
|
498
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.14", type: NumericMaskDirective, isStandalone: true, selector: "[sNumericMask]", inputs: { locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, minDecimalPlaces: { classPropertyName: "minDecimalPlaces", publicName: "minDecimalPlaces", isSignal: true, isRequired: false, transformFunction: null }, maxDecimalPlaces: { classPropertyName: "maxDecimalPlaces", publicName: "maxDecimalPlaces", isSignal: true, isRequired: false, transformFunction: null }, allowNegative: { classPropertyName: "allowNegative", publicName: "allowNegative", isSignal: true, isRequired: false, transformFunction: null }, allowScientificNotation: { classPropertyName: "allowScientificNotation", publicName: "allowScientificNotation", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, decimalSeparator: { classPropertyName: "decimalSeparator", publicName: "decimalSeparator", isSignal: true, isRequired: false, transformFunction: null }, thousandSeparator: { classPropertyName: "thousandSeparator", publicName: "thousandSeparator", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { decimalSeparator: "decimalSeparatorChange", thousandSeparator: "thousandSeparatorChange" }, host: { listeners: { "input": "onInput($event)", "focus": "onFocus()", "blur": "onBlur()", "paste": "onPaste($event)", "keydown": "onKeyDown($event)", "keypress": "onKeyPress($event)" }, properties: { "style.text-align": "\"right\"" } }, providers: [
|
|
502
499
|
{
|
|
503
500
|
provide: NG_VALUE_ACCESSOR,
|
|
504
501
|
useExisting: forwardRef(() => NumericMaskDirective),
|
|
@@ -509,7 +506,7 @@ class NumericMaskDirective {
|
|
|
509
506
|
useExisting: forwardRef(() => NumericMaskDirective),
|
|
510
507
|
multi: true,
|
|
511
508
|
},
|
|
512
|
-
], ngImport: i0 });
|
|
509
|
+
], usesOnChanges: true, ngImport: i0 });
|
|
513
510
|
}
|
|
514
511
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NumericMaskDirective, decorators: [{
|
|
515
512
|
type: Directive,
|
|
@@ -538,7 +535,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
538
535
|
},
|
|
539
536
|
],
|
|
540
537
|
}]
|
|
541
|
-
}]
|
|
538
|
+
}] });
|
|
542
539
|
|
|
543
540
|
class CurrencyMaskModule {
|
|
544
541
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CurrencyMaskModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|