palin-core-lib
v0.0.130
Published
Biblioteca de Códigos compartilhados do sistema da Palin & Martins
Downloads
29
Readme
PalinCore
Biblioteca de código compartilhado entre os módulos do sistema da Palin & Martins desenvolvido em Angular.
Instalação
Para instalar a biblioteca execute o commando: npm install palin-core-lib
Conteúdo da Biblioteca
Components
- AppNaoAutorizado
- AppNoDataToDisplayComponent
- Inputs:
- message: string
- buttonText: string
- buttonIcon: string
- buttonColor: string
- Outputs:
- addNew()
- Inputs:
- AppShowInfoComponent (app-show-info)
- Inputs:
- bgClass: string('primary')
- messages: string[]
- maxHeight: number(-1)
- progressType: string 'progress|spinner' ('progress')
- progressMode: string 'determinate|indeterminate|buffer|query' ('indeterminate')
- positionX: string 'left|right|center' ('center')
- positionY: string 'top|center|bottom' ('bottom')
- Inputs:
- ConfirmModalComponent (confirm-modal)
- Inputs (options):
title
text
class
type
icon
showCloseButton
retorno
okButton
cancelButton
- Inputs (options):
- DialogPadraoComponent (pl-dialog)
- Inputs:
- Content:
- headerText: Conteúdo que será exibido no Cabeçalho
- dialogBody: Conteúdo que será exibido no Dialog
- Outputs:
- close(): Ação que será executada ao clicar no botão fechar
- iconClick(): Ação que será executada ao clicar no botão do Header
- MatInputFileComponent (mat-input-file)
- Inputs:
- accept: string
- multiple: boolean
- disabled: boolean
- Outputs:
- onFileSelect(File[])
- Métodos:
- resetFiles()
- onNativeInputFileSelect($event: any)
- selectFile()
- Inputs:
- ProgressStatus (progress-status)
- Inputs:
- importStatus: IImportStatus
- showSpinner: boolean
- Métodos:
- setImportStatus(data: IImportStatus)
- setField(field: string, value: any)
- setMessage(message: string)
- updatePerc()
- resetStatus()
- Inputs:
- SearchInputComponent (search-input)
- Inputs:
- placeHolder: string
- value: string
- field: string
- controlType: string
- class: string
- mask: any
- Outputs:
- valueChanged({field: string, value: string})
- Propriedades Públicas:
- frmFiltro: FormGroup
- Inputs:
- SpinnerComponent (pl-spinner)
- Inputs:
- containerClass: string[]
- color: string(#000)
- size: number(15)
- Inputs:
Pipes
- CepPipe (cep)
- CfopPipe (cfop)
- CodSituacaoPipe (codSit)
- CstPipe (cst)
- EnqLegalPipe (enqLegal)
- MaskPipe (mask)
- NcmPipe (ncm)
- OrderByPipe (orderBy)
- ProdCodDescPipe (prodCodDesc)
- TextFilterShowPipe (textFilterShow)
- TipoDocumentoPipe (tipo-documento)
- TitleCasePipe (titleCase)
Directives
- MaskDirective (mask)
- EqualValidatorDirective ([validateEqual][formControlName],[validateEqual][formControl],[validateEqual][ngModel])
Classes
CfopsCollection:
- Constants:
CFOPS_DEVOL_3A
CFOPS_DEVOL_3B
- Métodos Estáticos:
- CfopsSaidaValContabilA(): string[]
- CfopsSaidaValContabilB(): string[]
- CfopsSaida(): string[]
- CfopsEntradaValContabilA(): string[]
- CfopsEntradaBCA(): string[]
- CfopsEntradaValContabilB(): string[]
- CfopsEntradaBCB(): string[]
- CfopsPmcA(): string[]
- CfopsPmcB(): string[]
- CfopsEntrada(): string[]
- CfopsEntradaRevenda(): string[]
- Cfops(): string[]
- cfopsDatabase(): {cfop: string, descricao: string, descricaoParaBusca: string}[]
- Constants:
Utils:
- Métodos Estáticos:
- toggleInputs(form: FormGroup, disable: boolean, condition?: (value: string, index: number, array: string[]) => boolean)
- convertToFloat(value: string): number
- prepareDataToSave(data: any, obsToRemove: string[]): any
- formControlHasError(form: FormGroup, control: string): boolean
- formControlErrors(form: FormGroup, control: string, description: string, minlength?: string, maxlength?: string): string
- converter(convUnidade: IEmpresaConvUnidade, valor: number): number
- dateToString(val: string | Date, fullYear: boolean = false): string
- doChunk(list: Array, size: number): string[][]
- doChunkType(list: Array, size: number): T[][]
- gotoRoute(route: string, router: Router)
- strZero(value: any, totalLength: number, back?: boolean): string
- getUfs(): { uf: string, descricao: string, codigo: string }[]
- getUfCidades(uf: string): { uf: string, descricao: string, cidades: string[] }
- listaPaises(): IPaises[]
- removerExtendidos(data: string, maxCode: number, replaceWith: string): string
- removerAcentos(s: string, removerEspacos: boolean): string
- getCodigoIbgeCidade(uf: string, cidadeOuCodigo: string | number): string
- getGeneros(): { codigo: string, descricao: string }[]
- getCst(): { codigo: string, descricao: string }[]
- getCsosn(): { codigo: string, descricao: string }[]
- getOrigem(): { codigo: string, descricao: string }[]
- getCfopRetIcms(): { codigo: string }[]
- getTipoItem(): { codigo: string, descricao: string }[]
- getTiposDocumentos(): { codigoChave: string, codigo: string, descricao: string, modelo: string }[]
- isNumber(value: any): boolean
- setControlFocus(controlName: string, timeOut: number = 1000): void
- updateLoadingIds(loadingIds: string[], loadingInfo: {id: string, loading: boolean} ): void
Validadores:
cnpjInvalido
cpfInvalido
CustomPaginatorIntl: Customização do paginador do Angular Material
Constants
- app-config:
APP_CONFIG
API_URL
: carregada de localStorage devApiUrl - cod-modelo:
COD_MODELOS
- cod-situacao:
COD_SITUACAO
- csts:
CSTS
- enq-legal:
ENQ_LEGAIS
- external-tokens:
EXTERNAL_TOKENS
,PRATICKO_TOKENS
- sefaz:
SEFAZC100_FIELDS
SEFAZC113_FIELDS
SEFAZC140_FIELDS
SEFAZC141_FIELDS
SEFAZC170_FIELDS
SEFAZC190_FIELDS
Extensions
- Array:
remove
- Number:
toFixedVirgula
toFixedNumber
- Object:
equals
same
clone
- String:
replaceAll
Functions
- date-extensions:
parseDateTime
- permissoes:
getPermissao
getModuloPermissao
Interfaces
- cat83.interface:
ICat83
IApur0150
IApur0200
IApur0205
IApur0300
IApur0400
IApur5010
IApur5015
IApur5150
IApur5155
IApur5160
IApur5310
IApur5315
IApur5320
IApur5325
IApur5330
IApur5335
IApur5350
IApur5360
IApur5365
IApur5370
IApur5375
IApur5380
IApur5385
IApur5390
IApur5395
IApur5400
IApur5550
IApur5555
IApur5590
IApur5595
IApur9990
IApurMovItens
IProd1000
IProd1010
IEnqLegalCat83
TipoInsumoAcabado
ICredChartOrigin
ICat83Info
IMovDevolucao3A
IMovDevolucao3B
IApurCredReincorp
IApurDadosExportacao
IApurTransfProduto
IRegQuebraLancComplementar3A
IRegQuebraLancComplementar3B
ICodLancamentoFichaHipotesesCfops
IAutoPerdasGanhos
EMPTY_APUR5365
EMPTY_APUR5315
PARTICIPANTE_INTERNO
FICHAS_CODIGOS_3A
FICHAS_CODIGOS_3B
- cat207.interface:
ICat207R0000
ICat207R0150
ICat207R0300
ICat207R5315
ICat207R5320
ICat207R5325
ICat207R5330
ICat207R5335
ICat207R5340
ICat207R5350
ICat207IvaMediana
ICat207R5315CredOutorgado
ICat207R5315Movimento
IMovCfop
IMovCfopNcm
ICat207DevolInfo
- cep.interface:
ICepConsulta
- cidade.interface:
ICidade
ICepCidade
- competencia.interface:
ICompetencia
- empresa.interface:
IEmpresa
IEmpresaCredAcumOpcoes
IEmpresaUsuario
IEmpresaCfopNcmCred
IEmpresaNcmsCredOutorgado
IEmpresaCfopsDevol
IEmpresaRelatInt
IEmpresaConvUnidade
IEmpresaCat83Opcoes
ICat207CredOutorgado
IEmpresaRelatorioImportacao
IRelatorioImportacao
- empresa-participante.interface:
IEmpresaParticipante
EMPTY_EMPRESAPARTICIPANTE
- empresa-reg-esp.interface:
IEmpresaRegEsp
- enq-legal.interface:
IEnqLegal
IEmpresaCat207CfopEnqLegal
- external-token.interface:
IExternalToken
- global.interfaces:
ESortOrder (enum)
ISortOptions
IPageOptions
IPaises
- http-response.interface:
IHttpResponse
- import-status.interface:
IImportStatus
- items-page-result.interface:
IItemsPageResult<T>
- ncm.interface:
INcm
INcmCfop
EMPTY_NCMCFOP
INcmGerador
INcmGeradorPropriedade
- permissoes.interfaces:
IPermissao
IModuloPermissao
- produtos.interface:
IEmpresaProdServ
IEmpresaProdServCat83Opcoes
IEmpresaProdServConv0200ViewModel
EMPTY_EMPRESAPRODUTO
EMPTY_EMPRESAPRODSERVCAT83OPCOES
- propriedade.interface:
IPropriedade
EMPTY_PROPRIEDADE
IPropriedadeUsuario
EMPTY_PROPRIEDADEUSUARIO
IAspNetUser
- sefaz.interface:
ISefazC100
ISefazC113
ISefazC140
ISefazC141
ISefazC170
ISefazC190
- sistema.interface:
ISistema
- sistema-user.interface:
ISistemaUser
ISistemaModuloPermissao
ISistemaModulo
- sped.interface:
ISpedEfd
ISpedEfd0005
ISpedEfd0015
ISpedEfd0100
ISpedEfd0150
ISpedEfd0175
ISpedEfd0190
ISpedEfd0200
ISpedEfd0205
ISpedEfd0206
ISpedEfd0220
ISpedEfd0300
ISpedEfd0305
ISpedEfd0400
ISpedEfd0450
ISpedEfd0460
ISpedEfd0500
ISpedEfd0600
ISpedEfdC100
ISpedEfdC101
ISpedEfdC105
ISpedEfdC110
ISpedEfdC111
ISpedEfdC112
ISpedEfdC113
ISpedEfdC114
ISpedEfdC115
ISpedEfdC116
ISpedEfdC120
ISpedEfdC130
ISpedEfdC140
ISpedEfdC141
ISpedEfdC160
ISpedEfdC165
ISpedEfdC170
ISpedEfdC171
ISpedEfdC172
ISpedEfdC173
ISpedEfdC174
ISpedEfdC175
ISpedEfdC176
ISpedEfdC177
ISpedEfdC178
ISpedEfdC179
ISpedEfdC190
ISpedEfdC195
ISpedEfdC197
ISpedEfdC100ExpInd
ISpedEfdC500
ISpedEfdC510
ISpedEfdC590
ISpedEfdC600
ISpedEfdC601
ISpedEfdC610
ISpedEfdC690
ISpedEfdD100
ISpedEfdD101
ISpedEfdD110
ISpedEfdD120
ISpedEfdD130
ISpedEfdD140
ISpedEfdD150
ISpedEfdD160
ISpedEfdD161
ISpedEfdD170
ISpedEfdD180
ISpedEfdD190
ISpedEfdD195
ISpedEfdD197
ISpedEfdD500
ISpedEfdD510
ISpedEfdD530
ISpedEfdD590
ISpedEfdE100
ISpedEfdE110
ISpedEfdE111
ISpedEfdE112
ISpedEfdE113
ISpedEfdE115
ISpedEfdE116
ISpedEfdE200
ISpedEfdE210
ISpedEfdE220
ISpedEfdE230
ISpedEfdE240
ISpedEfdE250
ISpedEfdE500
ISpedEfdE510
IspedEfdE520
ISpedEfdE530
ISpedEfdG110
ISpedEfdG125
ISpedEfdG126
ISpedEfdG130
ISpedEfdG140
ISpedEfdH005
ISpedEfdH010
ICfopCruzamento
IEmpresaProdServInventario
IProdServInventarioConf
IProdServConferencia
IDiffImport
IAveVivaInfo
- user.interfaces:
IUser
IOldUser
IUsuario
Services
- CidadesService
- ProvideIn: root
- Provide:
CIDADES_TOKEN: _IExternalToken_
CIDADES_URL: _string_
- Métodos:
- getCidade(cidadeId: string): Observable
- getPorUf(uf: string): Observable<ICidade[]>
- getPorCodigoIbge(codigoIbge: number): Observable
- getCep(cep: string, useHttps: boolean): Observable
- IoService
- ProvideIn: root
- Provide: API_URL: string
- Getters:
- loading$: Observable
- Métodos:
- get(url: string, urlParams?: any, successStatus?: number[], params?: {name: string, value: any}, useApiUrl: boolean [true], showErrorMessage: boolean [true]): Observable
- postType(url: string, data: any, successStatus?: number[], useApiUrl: boolean [true], showErrorMessage: boolean [true]): Observable
- post(url: string, data: any, successStatus?: number[], useApiUrl: boolean [true], showErrorMessage: boolean [true]): Observable
- putType(url: string, registroId: string, data: T, successStatus?: number[], useApiUrl: boolean [true], showErrorMessage: boolean [true]): Observable
- put(url: string, registroId: string, data: T, successStatus?: number[], useApiUrl: boolean [true, showErrorMessage: boolean [true]]): Observable
- deleteType(url: string, registroId: string, successStatus?: [number[]], useApiUrl: boolean [true], showErrorMessage: boolean [true]): Observable
- delete(url: string, registroId: string, successStatus?: number[], useApiUrl: boolean [true], showErrorMessage: boolean [true]): Observable
- checkItemValidation(url: string, field: string, valor: string, isNew: boolean, valorOriginal?: string): Observable<{ asyncInvalid: boolean }>
- LocalStorageService
- ProvideIn: root
- Getters:
- shouldReloadEmpresaCompetencia? Observable
- shouldReloadPermisssions$: Observable
- user$: Observable
- userPermissoes: IModuloPermissao[]
- Métodos:
- setItem(name: string, value: any)
- getItem(name: string): any
- getItemType<T>(name: string): T
- getUser(): IUser
- deleteItem(name: string)
- setUser(user: IUser)
- setReloadPermissions(reload: boolean)
- comparePermissoes(permissoesA: IModuloPermissao[], permissoesB: IModuloPermissao[]): boolean
- NcmsService
- ProvideIn: root
- Provide:
NCMS_TOKEN: _IExternalToken_
NCMS_URL: _string_
- Getters:
- getNcmsLocalJson$: Observable<INcmLocal[]>
- loading$: Observable<loading: boolean, message: string>
- ncms$: Observable<INcm[]>
- Métodos:
- addUpdateNcm(ncm: INcm)
- getncmsPorCodigo(codigo: string): Observable<INcm[]>
- getNcmPorCodigoLocal(codigo: string): INcmLocal
- getNcmsPorCodigoLocal(codigo: string): INcmLocal[]
- updateNcmDescricao(codigo: string, descricao: string): Observable<{ codigo: string, result: boolean }>
- PermissoesService
- ProvideIn: root
- Constructor: (ioService: IoService, systemId: string, permissoesUrl: string)
- Getters:
- loading$: Observable<{loading: boolean, users: boolean}>
- Métodos:
- getPermissoes(): Observable<IModuloPermissao[]>
- getUsers(): Observable<{ id: string, name: string }[]>
- getUserPermissoes(userName: string, sistemaId?: string): Observable<IModuloPermissao[]>
- savePermissao(item: IModuloPermissao): Observable
- getSistemas(): Observable<ISistema[]>
- setAllowDenyPermissoes(sistemaId: string, userId: string, allow: boolean): Observable
- setUserPermissoes(sistemaId: string, userId: string, permissoes: IModuloPermissao[]): Observable
Interceptors
- AuthGuard (CanActivate)
- constructor: ( router: Router, localStorageService: LocalStorageService, permissoesService: PermissoesService, systemId: string, urlsPermitidas: string[], verificarItemInfo: { item: string, items: string, url: string })
- Métodos:
- canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot): void
- applyToken(currentUser: { user: IUser, token: string }): Observable
- logout(): void
- AuthInterceptor
- constructor: (router: Router, localStorageService: LocalStorageService, snackBar: MatSnackBar, systemId: _string, pathAuthExceptions: string[] )
- Métodos:
- intercept(req: HttpRequest, next: HttpHandler): Observable<HttpEvent>
- applyToken(url: string)
- applyHeaders(url: _string:, externalTokens: IExternalToken[], currentUser: {user: IUser, token: string}): HttpHeaders
- TrafficInterceptor
- Observables:
- progress$: Observable
- indeterminate$: Observable
- show$: Observable
- Métodos:
- intercept(req: HttpRequest, next: HttpHandler): Observable<HttpEvent>
- Observables:
Json Data
- Ncms (assets/ncms.json)