Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dynamicform): adiciona tipo decimal #1792

Merged
merged 1 commit into from
Aug 29, 2023

Conversation

jcorrea97
Copy link
Contributor

@jcorrea97 jcorrea97 commented Aug 23, 2023

Dynamic-form

*DTHFUI-7516


PR Checklist [Revisor]

  • Padrão de Commit (Coeso, de acordo com o que está sendo realizado)
  • Código (Boas práticas, nome de variavéis/métodos, etc.)
  • Testes unitários (Cobre a situação implementada e coverage está mantido)
  • Documentação (Clara, objetiva e com exemplos caso necessário)
  • Samples (A implementação possui exemplo no Labs/Caso de uso)
  • Rodado em navegadores suportados (Chrome, FireFox, Edge)

Qual o comportamento atual?
caso seja passado currency com mask renderiza input

Qual o novo comportamento?
caso seja passado decimal com mask renderiza decimal

Simulação

//app.html
<po-dynamic-form [p-fields]="fields" [p-validate-on-input]="true"> </po-dynamic-form>

//app.ts
fields: Array<PoDynamicFormField> = [
    {
      property: 'exemple1',
      label: 'renderia decimal',
      placeholder: 'teste1',
      type: 'currency',
      decimalsLength: 0
    },
    {
      property: 'exemple2',
      label: 'renderiza input',
      placeholder: 'teste2 ',
      type: 'currency',
      decimalsLength: 0,
      mask: '999.999.999-99'
    },
    {
      property: 'exemple3',
      label: 'renderiza decimal',
      placeholder: 'teste3',
      type: 'decimal',
      decimalsLength: 0
    },
    {
      property: 'exemple4',
      label: 'renderiza decimal',
      placeholder: 'teste4',
      type: 'decimal',
      pattern: "^\\d*(\\,\\d{0,1})?$",
    }
  ];


Caso seja passado o tipo `decimal` irá sempre renderizar o po-decimal

fixes DTHFUI-7516
@rafaellmarques rafaellmarques merged commit 8df2611 into master Aug 29, 2023
7 checks passed
@rafaellmarques rafaellmarques deleted the decimal-form/DTHFUI-7516 branch August 29, 2023 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants