PaymentRequestUI should have methods editSection(SectionType, EditorDescription) and addToSection(SectionType, EditorDescription).
The EditorDescription class should contain a double-array of fields to be arranged on the page:
[[ field 0 ]
,[ field 1 ]
,[ field 2 , field 3 ]]
Each field should be either: a text field, a drop down, or a checkbox.
A text field always has:
- id
- label
A text field may also have:
- Pre-filled value
- autocompletion candidates
- helper icons (e.g. [visa][mc][amex])
- floating action icon [scan card number]
- "required" flag
- "multi-line" flag
- validation callback
|---------------|------------------|
| [helper icon] | [helper icon] |
|---------------|------------------|
| [floating action icon] |
| ________________________________ |
|----------------------------------|
A drop down should have a list of id-label pairs. Changing the drop-down should immediately notify the PaymentRequestUI.Client, which may update the fields.
|----------------------------------|
| Default option label v |
|----------------------------------|
A checkbox should have a label, possibly with a link.
|-----|---------------------------|
| [ ] | This is some text that |
| | can break into multiple |
| | lines. This text can have |
| | spannable HTML links. |
|-----|---------------------------|
When user clicks [SAVE] button, PaymentRequestUI should send the state of the editor to PaymentRequestUI.Client.
Comment 1 by rouslan@chromium.org
, Jun 11 2016