bangank36 / WP-Builder

JSON Schema-based forms with Wordpress Components renderer
https://gutenbuilder.wordpress.com
GNU General Public License v2.0
0 stars 0 forks source link

WP-Builder: Number controls #93

Open bangank36 opened 1 year ago

bangank36 commented 1 year ago

Summary

Implement the Number control using Gutenberg number control Current testers of jsonforms for number input are

  1. isRangeControl
  2. isNumberFormatControl
  3. isNumberControl https://github.com/bangank36/WP-Builder/pull/95
  4. isIntegerControl https://github.com/bangank36/WP-Builder/pull/94

Reference

3

bangank36 commented 1 year ago

Tester investigation

isNumberFormatControl

graph TD;
A[Start] --> B{uiTypeIs is 'Control'?};
  B --> |Yes| C{schemaType Is 'integer'?};
  B --> |No| D[Return false];
C --> |Yes| E{options 'format' is true ?};
  C --> |No| F[Return false];
E --> |Yes| G[Return isNumberFormatControl: true];

isRangeControl

graph TD;
  A[Start] --> B{uiTypeIs is 'Control'?};
  B --> |Yes| C{schemaType is 'number' or 'integer'?};
  B --> |No| D[Return false];
  C --> |Yes| E{schema has 'maximum', 'minimum', and 'default'?};
  C --> |No| F[Return false];
  E --> |Yes| G{options 'slider' is true ?};
  E --> |No| H[Return false];
  G --> |Yes| I[Return isRangeControl: true];

isNumberControl

graph TD;
  A[Start] --> B{uiTypeIs is 'Control'?};
  B --> |Yes| C{schemaType is 'number'?};
  B --> |No| D[Return false];
  C --> |Yes| E[Return isNumberControl: true];

isIntegerControl

graph TD;
  A[Start] --> B{uiTypeIs is 'Control'?};
  B --> |Yes| C{schemaType is 'integer'?};
  B --> |No| D[Return false];
  C --> |Yes| E[Return isIntegerControl: true];