Variable Configurations Editor Examples
vce-variable-configurations-editor
<vce-variable-configurations-editor variable-configurations="[]">
<vce-variables-list vce-variables-list="vce-variables-list"></vce-variables-list>
<vce-variable-editor-dialog reserved-ids="[]" has-image-type="true" string-editable="true" use-editable-image="true" vce-variable-editor-dialog="vce-variable-editor-dialog"></vce-variable-editor-dialog>
</vce-variable-configurations-editor>
vce-variable-configurations-editor
<vce-variable-configurations-editor id="vceVarEditor" variable-configurations="[{"id":"apple","display_name":"juicy apple","default_value":"apple","is_overridable":false,"type":"string"},{"display_name":"pear","id":"pear","default_value":"pear","is_overridable":false,"type":"string"},{"display_name":"Orange","id":"orange","default_value":10,"is_overridable":true,"type":"integer"},{"id":"lemon","display_name":"Lemon","default_value":100,"is_overridable":true,"type":"integer"},{"id":"background","display_name":"Background","default_value":"#cccccc","is_overridable":true,"type":"color"},{"id":"fruit","default_value":"lemon","is_overridable":true,"type":"select","type_config":{"options":[{"id":"1","name":"Apple","value":"apple"},{"id":"2","name":"Lemon","value":"lemon"},{"id":"3","name":"Pear","value":"pear"},{"id":"4","name":"Tomato","value":"tomato"}]}},{"display_name":"inject","id":"inject","default_value":"inject","is_overridable":false,"type":"string"}]">
<vce-variables-list vce-variables-list="vce-variables-list"></vce-variables-list>
<vce-variable-editor-dialog reserved-ids="[]" has-image-type="true" string-editable="true" use-editable-image="true" vce-variable-editor-dialog="vce-variable-editor-dialog"></vce-variable-editor-dialog>
</vce-variable-configurations-editor>
const vceVarEditor = document.getElementById('vceVarEditor');
vceVarEditor.addEventListener('update',(e) => {
console.log(e.detail);
vceVarEditor.setAttribute('variable-configurations', JSON.stringify(e.detail));
});
vce-variable-configurations-editor
<vce-variable-configurations-editor id="vceVarEditor" variable-configurations="[{"id":"apple","display_name":"juicy apple","default_value":"apple","is_overridable":false,"type":"string"},{"display_name":"pear","id":"pear","default_value":"pear","is_overridable":false,"type":"string"},{"display_name":"Orange","id":"orange","default_value":10,"is_overridable":true,"type":"integer"},{"id":"lemon","display_name":"Lemon","default_value":100,"is_overridable":true,"type":"integer"},{"id":"background","display_name":"Background","default_value":"#cccccc","is_overridable":true,"type":"color"},{"id":"fruit","default_value":"lemon","is_overridable":true,"type":"select","type_config":{"options":[{"id":"1","name":"Apple","value":"apple"},{"id":"2","name":"Lemon","value":"lemon"},{"id":"3","name":"Pear","value":"pear"},{"id":"4","name":"Tomato","value":"tomato"}]}},{"display_name":"inject","id":"inject","default_value":"inject","is_overridable":false,"type":"string"}]">
<vce-variables-list vce-variables-list="vce-variables-list" show-search="true" show-copy-action="show-copy-action"></vce-variables-list>
<vce-variable-editor-dialog reserved-ids="[]" has-image-type="true" string-editable="true" use-editable-image="true" vce-variable-editor-dialog="vce-variable-editor-dialog"></vce-variable-editor-dialog>
</vce-variable-configurations-editor>
const vceVarEditor = document.getElementById('vceVarEditor');
vceVarEditor.addEventListener('update',(e) => {
vceVarEditor.setAttribute('variable-configurations', JSON.stringify(e.detail));
});