123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- // *********************************************************************************
- // Scheme for the variables list
- // *********************************************************************************
- export const variableScheme = {
- hash: 'UUID for the variable',
- name: 'Variable name',
- type: 'Varaible type',
- value: 'Variable value'
- };
- // *********************************************************************************
- // Variable types
- // *********************************************************************************
- export const variableTypes = [
- {
- name: 'inteiro',
- value: 'INTEGER',
- defaultValue: 0,
- htmlType: 'number',
- barrier: ''
- },
- {
- name: 'real',
- value: 'DOUBLE',
- defaultValue: 0.0,
- htmlType: 'number',
- barrier: ''
- },
- {
- name: 'cadeia',
- value: 'STRING',
- defaultValue: '',
- htmlType: 'text',
- barrier: '"'
- },
- {
- name: 'lógico',
- value: 'BOOLEAN',
- vales: [
- {
- name: 'verdadeiro',
- value: true
- },
- {
- name: 'falso',
- value: false
- }
- ],
- defaultValue: true,
- htmlType: 'select',
- barrier: ''
- }
- ];
- export function getVariableTypeByValue(value) {
- for (let i = 0; i < variableTypes.length; i++) {
- if (variableTypes[i].value === value)
- return variableTypes[i];
- }
- return null;
- }
- // *********************************************************************************
- // Html Schemes
- // *********************************************************************************
- let htmlVariableSchemeBuilt = '';
- export function htmlVariableScheme() {
- if (htmlVariableSchemeBuilt !== '')
- return htmlVariableSchemeBuilt;
- let variableTypesHtml = '';
- for (let i = 0; i < variableTypes.length; i++) {
- variableTypesHtml += `<option value="${variableTypes[i].value}">${variableTypes[i].name}</option>\n`;
- }
- return `<li id="variable<variableId>Li">
- <form id="variable<variableId>Form">
- <select name="tipo" title="tipo da variável" id="variable<variableId>Type" variable-id="<variableId>">
- ${variableTypesHtml}
- </select>
- <input type="text" title="nome da variável" id="variable<variableId>Name" value="<variableName>" variable-id="<variableId>">
- <label for="variable<variableId>Value" tabindex="0" tile="recebe">recebe</label>
- <input type="${variableTypes[0].htmlType}" id ="variable<variableId>Value" title="valor da variável" value="0" variable-id="<variableId>">
- <button id="variable<variableId>Delete" type="button" class="btn btn-danger">Excluir</button>
- </form>
- </li>`;
- }
- // *********************************************************************************
|