123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- // *********************************************************************************
- // Scheme for the variables list
- // *********************************************************************************
- import {variables} from "./variables";
- export const variableScheme = {
- hash: 'UUID for the variable',
- name: 'Variable name',
- type: 'Varaible type',
- value: 'Variable value'
- };
- // *********************************************************************************
- // Variable types
- // *********************************************************************************
- export const VariableType = [
- {
- 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 < VariableType.length; i++) {
- if (VariableType[i].value === value)
- return VariableType[i];
- }
- return null;
- }
- // *********************************************************************************
- // Html Schemes
- // *********************************************************************************
- export function htmlVariableScheme () {
- let variableTypesHtml = '';
- for (let i = 0; i < VariableType.length; i++) {
- variableTypesHtml += `<option value="${VariableType[i].value}">${VariableType[i].name}</option>\n`;
- }
- return `<li id="variable<variableId>Li">
- <form id="variable<variableId>Form">
- <div class="row p-2 w-100 variable-item" style="background-color: antiquewhite;">
- <!-- <div class="col-1 text-center my-auto">
- <h5>${variables.length}</h5>
- </div> -->
- <div class="col-2">
- <select name="tipo" class="form-control" title="Tipo da variável" id="variable<variableId>Type" variable-id="<variableId>">
- ${variableTypesHtml}
- </select>
- </div>
- <div class="col-2">
- <input type="text" class="form-control" title="nome da variável" id="variable<variableId>Name" value="<variableName>" variable-id="<variableId>">
- </div>
- <div class="col-1 text-center my-auto" style="margin-bottom: 0px !important">
- <label for="variable<variableId>Value" tabindex="0" title="Recebe">recebe</label>
- </div>
- <div class="col-2">
- <input type="${VariableType[0].htmlType}" class="form-control" id ="variable<variableId>Value" title="Valor da variável" value="0" variable-id="<variableId>">
- </div>
- <div class="col my-auto" style="text-align: end;">
- <div class="row justify-content-end">
- <div class="col-1">
- <a id="variable<variableId>Resume" href="javascript:void(0)" class="text-info" variable-id="<variableId>">
- <i class="fas fa-eye"></i>
- </a>
- </div>
- <div class="col-1">
- <a id="variable<variableId>Delete" href="javascript:void(0)" class="text-danger" variable-id="<variableId>" title="Excluir">X</a>
- </div>
- </div>
- </div>
- </div>
- </form>
- </li>`;
- }
- // *********************************************************************************
|