-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add u8 field type support (#433)
* Add u8 field type * Represent Vec<u8> as a Uint8Array * Add u8 widgets * Fix misplaced lables * Fix svelte slider props * Ensure correct TS type is generated for Vec<u8> * Skip ui generation for Vec<u8> types
- Loading branch information
Showing
35 changed files
with
104 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Array<{{field_type.type}}> | ||
{{#if (eq field_type.type "u8")}}Uint8Array{{else}}Array<{{field_type.type}}>{{/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{#if (eq cardinality "vector")}}[]{{else}}0{{/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
templates/ui-frameworks/lit/field-types/u8/Slider/detail/render.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
${ {{variable_to_read}} } |
9 changes: 9 additions & 0 deletions
9
templates/ui-frameworks/lit/field-types/u8/Slider/edit/render.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<label for="{{label}}">{{label}}</label> | ||
<input | ||
name="{{label}}" | ||
type="range" | ||
min="0" | ||
max="255" | ||
.value=${ {{variable_to_read}} } | ||
@change=${(e: any) => { {{variable_to_change}} = e.detail.value; } } | ||
> |
1 change: 1 addition & 0 deletions
1
templates/ui-frameworks/lit/field-types/u8/Slider/initial-value.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
templates/ui-frameworks/react/field-types/u8/NumberInput/detail/render.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ {{variable_to_read}} } |
2 changes: 2 additions & 0 deletions
2
templates/ui-frameworks/react/field-types/u8/NumberInput/edit/render.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<label htmlFor="{{label}}">{{label}}</label> | ||
<input type="number" name="{{label}}" {{#if variable_to_read}}value={ {{variable_to_read}} }{{/if}} onChange={e => set{{pascal_case variable_to_change}}(parseInt(e.target.value))} min="0" max="255" /> |
1 change: 1 addition & 0 deletions
1
templates/ui-frameworks/react/field-types/u8/NumberInput/initial-value.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0 |
1 change: 1 addition & 0 deletions
1
templates/ui-frameworks/react/field-types/u8/NumberInput/is-valid.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
templates/ui-frameworks/svelte/field-types/f32/Slider/edit/render.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<label for="{{label}}">{{label}}</label> | ||
<input name="{{label}}" type="range" min="0" bind:value="{{variable_to_read}}" /> | ||
<input name="{{label}}" type="range" min="0" bind:value={ {{variable_to_read}} } /> |
2 changes: 1 addition & 1 deletion
2
templates/ui-frameworks/svelte/field-types/i32/Slider/edit/render.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<label for="{{label}}">{{label}}</label> | ||
<input name=""{{label}} type="range" bind:value="{{variable_to_read}}" /> | ||
<input name="{{label}}" type="range" bind:value={ {{variable_to_read}} } /> |
2 changes: 1 addition & 1 deletion
2
templates/ui-frameworks/svelte/field-types/u32/Slider/edit/render.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<label for="{{label}}">{{label}}</label> | ||
<input name=""{{label}} type="range" min="0" bind:value="{{variable_to_read}}" /> | ||
<input name="{{label}}" type="range" min="0" bind:value={ {{variable_to_read}} } /> |
1 change: 1 addition & 0 deletions
1
templates/ui-frameworks/svelte/field-types/u8/Slider/detail/render.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ {{variable_to_read}} } |
2 changes: 2 additions & 0 deletions
2
templates/ui-frameworks/svelte/field-types/u8/Slider/edit/render.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<label for="{{label}}">{{label}}</label> | ||
<input name="{{label}}" type="range" min="0" max="255" bind:value={ {{variable_to_read}} } /> |
1 change: 1 addition & 0 deletions
1
templates/ui-frameworks/svelte/field-types/u8/Slider/initial-value.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0 |
1 change: 1 addition & 0 deletions
1
templates/ui-frameworks/svelte/field-types/u8/Slider/is-valid.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
templates/ui-frameworks/vue/field-types/f32/Slider/edit/render.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<label for="{{label}}">{{label}}</label> | ||
<input name=""{{label}} type="range" min="0" v-model="{{variable_to_read}}" /> | ||
<input name="{{label}}" type="range" min="0" v-model="{{variable_to_read}}" /> |
2 changes: 1 addition & 1 deletion
2
templates/ui-frameworks/vue/field-types/i32/Slider/edit/render.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<label for="{{label}}">{{label}}</label> | ||
<input name=""{{label}} type="range" v-model="{{variable_to_read}}" /> | ||
<input name="{{label}}" type="range" v-model="{{variable_to_read}}" /> |
2 changes: 1 addition & 1 deletion
2
templates/ui-frameworks/vue/field-types/u32/Slider/edit/render.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<label for="{{label}}">{{label}}</label> | ||
<input name=""{{label}} type="range" min="0" v-model="{{variable_to_read}}" /> | ||
<input name="{{label}}" type="range" min="0" v-model="{{variable_to_read}}" /> |
1 change: 1 addition & 0 deletions
1
templates/ui-frameworks/vue/field-types/u8/Slider/detail/render.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{{{raw}}}} {{ {{{{/raw}}}} {{variable_to_read}} {{{{raw}}}} }} {{{{/raw}}}} |
2 changes: 2 additions & 0 deletions
2
templates/ui-frameworks/vue/field-types/u8/Slider/edit/render.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<label for="{{label}}">{{label}}</label> | ||
<input name="{{label}}" type="range" min="0" max="255" v-model="{{variable_to_read}}" /> |
1 change: 1 addition & 0 deletions
1
templates/ui-frameworks/vue/field-types/u8/Slider/initial-value.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
true |