# palin-core-lib

> Biblioteca de Códigos compartilhados do sistema da Palin & Martins

Latest version **0.0.130** (published 2021-11-03) · GPL-3.0-or-later license · 0 weekly downloads

## Install

```sh
npm install palin-core-lib
pnpm add palin-core-lib
yarn add palin-core-lib
bun add palin-core-lib
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.130 |
| Published | 2021-11-03 |
| First published | 2018-08-15 |
| Weekly downloads | 0 |
| License | GPL-3.0-or-later |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ademir Rodrigues da Silva |
| Maintainers | ti_palinemartins |

## Links

- npm: https://www.npmjs.com/package/palin-core-lib
- Issues: https://ademirsjrp.visualstudio.com/palin-core/_backlogs/backlog/palin-core%20Team/Stories
- npm.io page: https://npm.io/package/palin-core-lib

## Recent versions

- 0.0.130 (latest) — 2021-11-03
- 0.0.129 — 2021-11-03
- 0.0.126 — 2021-11-03
- 0.0.125 — 2021-11-03
- 0.0.123 — 2021-03-12
- 0.0.122 — 2021-01-25
- 0.0.121 — 2020-12-29
- 0.0.120 — 2020-11-18
- 0.0.119 — 2020-11-17
- 0.0.118 — 2020-11-16
- 0.0.117 — 2020-11-16
- 0.0.116 — 2020-11-16
- 0.0.115 — 2020-07-07
- 0.0.114 — 2020-07-06
- 0.0.113 — 2020-06-24
- … 109 more at https://npm.io/package/palin-core-lib/versions

## 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()
* 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')_
* ConfirmModalComponent (confirm-modal)
    * Inputs (options):  `title` `text` `class` `type` `icon` `showCloseButton` `retorno` `okButton` `cancelButton`
* DialogPadraoComponent (pl-dialog)
    * Inputs:
        * dialogClasses: _string[]([])_
        * icon: _string_
        * iconClass: _string_
        * headerBgClass: _string('bg-primary')_
        * headerTextClass: _string('text-white')_
        * showCloseButton: _ boolean(true)_
        * bodyClasses: _string[]([])_
    * 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()
* ProgressStatus (progress-status)
    * Inputs: 
        * importStatus: _IImportStatus_
        * showSpinner: _boolean_
    * Métodos:
        * setImportStatus(data: _IImportStatus_)
        * setField(field: _string_, value: _any_)
        * setMessage(message: _string_)
        * updatePerc()
        * resetStatus()
* 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_
* SpinnerComponent (pl-spinner)
    * Inputs:
        * containerClass: _string[]_
        * color: _string(#000)_
        * size: _number(15)_
        
### 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}[]_
* 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<any>_, size: _number_): _string[][]_
    * doChunkType<T>(list: _Array<T>_, 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<ICidade>_
        * getPorUf(uf: _string_): _Observable<ICidade[]>_
        * getPorCodigoIbge(codigoIbge: _number_): _Observable<ICidade>_
        * getCep(cep: _string_, useHttps: _boolean_): _Observable<ICepCidade>_
* IoService
    * ProvideIn: _root_
    * Provide: API_URL: _string_
    * Getters:
        * loading$: _Observable<boolean>_
    * Métodos:
        * get<T>(url: _string_, urlParams?: _any_, successStatus?: _number[]_, params?: {name: _string_, value: _any_}, useApiUrl: _boolean_ [true], showErrorMessage: _boolean_ [true]): _Observable<T>_
        * postType<T>(url: _string_, data: _any_, successStatus?: _number[]_, useApiUrl: _boolean_ [true], showErrorMessage: _boolean_ [true]): _Observable<T>_
        * post(url: _string_, data: _any_, successStatus?: _number[]_, useApiUrl: _boolean_ [true], showErrorMessage: _boolean_ [true]): _Observable<boolean>_
        * putType<T>(url: _string_, registroId: _string_, data: _T_, successStatus?: _number[]_, useApiUrl: _boolean_ [true], showErrorMessage: _boolean_ [true]): _Observable<T>_
        * put<T>(url: _string_, registroId: _string_, data: _T_, successStatus?: _number[]_, useApiUrl: _boolean_ [true, showErrorMessage: _boolean_ [true]]): _Observable<boolean>_
        * deleteType<T>(url: _string_, registroId: _string_, successStatus?: [number[]], useApiUrl: _boolean_ [true], showErrorMessage: _boolean_ [true]): _Observable<T>_
        * delete(url: _string_, registroId: _string_, successStatus?: _number[]_, useApiUrl: _boolean_ [true], showErrorMessage: _boolean_ [true]): _Observable<boolean>_
        * checkItemValidation<T>(url: _string_, field: _string_, valor: _string_, isNew: _boolean_, valorOriginal?: _string_): _Observable<{ asyncInvalid: boolean }>_
* LocalStorageService
    * ProvideIn: _root_
    * Getters:
        * shouldReloadEmpresaCompetencia? _Observable<boolean>_
        * shouldReloadPermisssions$: _Observable<boolean>_
        * user$: _Observable<IUser>_
        * 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<boolean>_
        * getSistemas(): _Observable<ISistema[]>_
        * setAllowDenyPermissoes(sistemaId: _string_, userId: _string_, allow: _boolean_): _Observable<number>_
        * setUserPermissoes(sistemaId: _string_, userId: _string_, permissoes: _IModuloPermissao[]_): _Observable<boolean>_

### 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<boolean>_
        * logout(): _void_
* AuthInterceptor
    * constructor: (router: _Router_, localStorageService: _LocalStorageService_, snackBar: _MatSnackBar_, systemId: _string, pathAuthExceptions: _string[]_ )
    * Métodos:
        * intercept(req: _HttpRequest_, next: _HttpHandler_): _Observable<HttpEvent<any>>_
        * applyToken(url: _string_)
        * applyHeaders(url: _string:, externalTokens: _IExternalToken[]_, currentUser: {user: _IUser_, token: _string_}): _HttpHeaders_
* TrafficInterceptor
    * Observables:
        * progress$: _Observable<number>_
        * indeterminate$: _Observable<boolean>_
        * show$: _Observable<boolean>_
    * Métodos:
        * intercept(req: _HttpRequest<any>_, next: _HttpHandler_): _Observable<HttpEvent<any>>_

### Json Data
* Ncms (_assets/ncms.json_)

### (c) 2018 - [Palin & Martins](http://www.palinemartins.com.br) Consultores Associados

---
_Source: https://npm.io/package/palin-core-lib · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
