mirror of
https://github.com/pebble-dev/clay.git
synced 2026-09-05 08:37:43 -04:00
introduce serilizeValueAs option to input, select, and radiogroup
This commit is contained in:
committed by
Jay Michalska
parent
847c651c2b
commit
3386e609a8
@@ -169,6 +169,7 @@ Standard text input field.
|
||||
| messageKey | string (unique) | The AppMessage key matching the `messageKey` item defined in your `package.json`. Set this to a unique string to allow this item to be looked up using `Clay.getItemsByMessageKey()` in your custom function. You must set this if you wish for the value of this item to be persisted after the user closes the config page. |
|
||||
| label | string | The label that should appear next to this item. |
|
||||
| defaultValue | string | The default value of the input field. |
|
||||
| serializeValueAs | string | target type to serialize value as. `string` means as is via cstring. `integer` means converted with `Math.trunc(Number.parseInt(value, 10))` as int32 (0 if NaN) |
|
||||
| description | string | Optional sub-text to include below the component |
|
||||
| attributes | object | An object containing HTML attributes to set on the input field. Set `type` to values such as "email", "time", "date" etc to adjust the behavior of the component. |
|
||||
| capabilities | array | Array of features that the connected watch must have for this item to be present |
|
||||
@@ -243,6 +244,7 @@ A dropdown menu containing multiple options.
|
||||
| defaultValue | string | The default value of the dropdown menu. Must match a value in the `options` array. |
|
||||
| description | string | Optional sub-text to include below the component |
|
||||
| options | array of objects | The options you want to appear in the dropdown menu. Each option is an object with a `label` and `value` property. |
|
||||
| serializeValueAs | string | target type to serialize value as. `string` means as is via cstring. `integer` means converted with `Math.trunc(Number.parseInt(value, 10))` as int32 (0 if NaN) |
|
||||
| capabilities | array | Array of features that the connected watch must have for this item to be present |
|
||||
| group | string | Set this to allow this item, along with other items sharing the same group to be looked up using `Clay.getItemsByGroup()` in your [custom function](#custom-function) |
|
||||
|
||||
@@ -417,6 +419,7 @@ A list of options allowing the user can only choose one option to submit.
|
||||
| defaultValue | string | The default selected item. Must match a value in the `options` array. |
|
||||
| description | string | Optional sub-text to include below the component |
|
||||
| options | array of objects | The options you want to appear in the radio group. Each option is an object with a `label` and `value` property. |
|
||||
| serializeValueAs | string | target type to serialize value as. `string` means as is via cstring. `integer` means converted with `Math.trunc(Number.parseInt(value, 10))` as int32. (0 if NaN) |
|
||||
| capabilities | array | Array of features that the connected watch must have for this item to be present |
|
||||
| group | string | Set this to allow this item, along with other items sharing the same group to be looked up using `Clay.getItemsByGroup()` in your [custom function](#custom-function) |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user