Skip to content

Commit 2fe2763

Browse files
author
Eduardo Parada
committed
Update: Include all styles to expandable
1 parent 0a22d1d commit 2fe2763

17 files changed

+169
-23
lines changed

WebFormulary/dist/bundle.js

+65-11
Large diffs are not rendered by default.

WebFormulary/src/aux/auxBoolean.html

+13-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<div class="containerTextFieldCenter optionalBooleanContainer">
1919
<div class="isEditingTextField">
2020
<input type="checkbox" name="isEditingTextField" value="isEditingTextField" id="isEditingTextField">
21-
<p>Es editable?</p>
21+
<p>Bloquear Editar?</p>
2222
</div>
2323

2424
<div class="isHiddenTextField">
@@ -73,6 +73,18 @@ <h4>Estilos de celda:</h4>
7373

7474
{{htmlImage}}
7575

76+
<div id="expandableStyles">
77+
<h4 id="titleExpandable">Estilos de vista expandida:</h4>
78+
<div id="colorContainerExpandable">
79+
<p class="colorTittleP">Text color:</p>
80+
<input type="color" value="#ffffff" id="expandedColor" class="cellColorCreate">
81+
<input id="expandedColorHex" class="inputColorHex" placeholder="#ffffff">
82+
</div>
83+
<div id="sizeContainerExpandable">
84+
<p>Tamaño texto expandido:</p>
85+
<input id="sizeExpandedButton" type="text" name="element">
86+
</div>
87+
</div>
7688
</div>
7789
<div class="spaceSeparate"></div>
7890
</div>

WebFormulary/src/aux/auxBooleanCreated.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<div class="containerTextFieldCenter optionalBooleanContainer">
1616
<div class="isEditingTextField">
1717
<input type="checkbox" name="isEditingTextField" value="isEditingTextField" id="isEditingTextField" {{isEditingValueCheck}} disabled readonly >
18-
<p>Es editable?</p>
18+
<p>Bloquear Editar?</p>
1919
</div>
2020

2121
<div class="isHiddenTextField">

WebFormulary/src/aux/auxDatePicker.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</div>
2424
<div class="isEditingTextField">
2525
<input type="checkbox" name="isEditingTextField" value="isEditingTextField" id="isEditingTextField">
26-
<p>Es editable?</p>
26+
<p>Bloquear Editar?</p>
2727
</div>
2828
</div>
2929

WebFormulary/src/aux/auxDatePickerCreated.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<div id="containerOptionalDatePicker">
2222
<div class="isEditingTextField">
2323
<input type="checkbox" name="isEditingTextField" value="isEditingTextField" id="isEditingTextField" {{isEditingCheck}} disabled readonly>
24-
<p>Es editable?</p>
24+
<p>Bloquear Editar?</p>
2525
</div>
2626

2727
<div class="isHiddenTextField">

WebFormulary/src/aux/auxPicker.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<div class="containerOptionalPicker">
2626
<div class="isEditingTextField">
2727
<input type="checkbox" name="isEditingTextField" value="isEditingTextField" id="isEditingTextField">
28-
<p>Es editable?</p>
28+
<p>Bloquear Editar?</p>
2929
</div>
3030

3131
<div class="isHiddenTextField">

WebFormulary/src/aux/auxPickerCreated.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<div class="containerOptionalPicker">
2424
<div class="isEditingTextField">
2525
<input type="checkbox" name="isEditingTextField" value="isEditingTextField" id="isEditingTextField" {{isEditingChecked}} disabled readonly>
26-
<p>Es editable?</p>
26+
<p>Bloquear Editar?</p>
2727
</div>
2828

2929
<div class="isHiddenTextField">

WebFormulary/src/aux/auxText.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
<div class="isEditingTextField">
3939
<input type="checkbox" name="isEditingTextField" value="isEditingTextField" id="isEditingTextField">
40-
<p>Es editable?</p>
40+
<p>Bloquear Editar?</p>
4141
</div>
4242

4343
<div class="isHiddenTextField">

WebFormulary/src/aux/auxTextCreated.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
<div class="isEditingTextField">
2929
<input type="checkbox" name="isEditingTextField" value="isEditingTextField" id="isEditingTextField" {{isEditingChecked}} disabled readonly>
30-
<p>Es editable?</p>
30+
<p>Bloquear Editar?</p>
3131
</div>
3232

3333
<div class="isHiddenTextField">

WebFormulary/src/css/style.css

+32
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,7 @@
705705
height: 51px;
706706
margin-left: 28px;
707707
width: 100%;
708+
float: left;
708709
}
709710
.imagesZone p {
710711
float: left;
@@ -1096,4 +1097,35 @@
10961097
margin-right: 10px;
10971098
}
10981099

1100+
#colorContainerExpandable {
1101+
margin-left: 20px;
1102+
height: 36px;
1103+
}
1104+
1105+
#colorContainerExpandable p {
1106+
float: left;
1107+
margin-top: 6px;
1108+
margin-right: 10px;
1109+
}
1110+
1111+
#titleExpandable {
1112+
margin-left: 10px;
1113+
}
10991114

1115+
#expandableStyles {
1116+
margin-left: 17px;
1117+
margin-bottom: 10px;
1118+
}
1119+
1120+
#sizeContainerExpandable {
1121+
margin-left: 30px;
1122+
}
1123+
#sizeContainerExpandable p {
1124+
float: left;
1125+
margin-top: 10px;
1126+
margin-right: 10px;
1127+
}
1128+
#sizeContainerExpandable input {
1129+
margin-top: 0px;width: 59px;
1130+
margin-right: 10px;
1131+
}

WebFormulary/src/js/colorZone.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
window.colorBasicZone = ' <p>Color de la celda:</p><input type="color" value="#ffffff" id="cellColor" class="cellColorCreate"><input id="cellColorHex" class="inputColorHex" placeholder="#ffffff"> <p class="colorTittleP">Color titulo:</p><input type="color" value="#ffffff" id="titleColor" class="cellColorCreate"><input id="titleColorHex" class="inputColorHex" placeholder="#ffffff"> <p class="colorTittleP">Color Error:</p><input type="color" value="#ffffff" id="errorColor" class="cellColorCreate"><input id="errorColorHex" class="inputColorHex" placeholder="#ffffff">';
1+
var html = '';
2+
html += '<p>Color de la celda:</p>';
3+
html += '<input type="color" value="#ffffff" id="cellColor" class="cellColorCreate">';
4+
html += '<input id="cellColorHex" class="inputColorHex" placeholder="#ffffff">';
5+
html += '<p class="colorTittleP">Color titulo:</p>';
6+
html += '<input type="color" value="#ffffff" id="titleColor" class="cellColorCreate">';
7+
html += '<input id="titleColorHex" class="inputColorHex" placeholder="#ffffff">';
8+
html += '<p class="colorTittleP">Color Error:</p>';
9+
html += '<input type="color" value="#ffffff" id="errorColor" class="cellColorCreate">';
10+
html += '<input id="errorColorHex" class="inputColorHex" placeholder="#ffffff">';
11+
12+
window.colorBasicZone = html;

WebFormulary/src/js/eventColor.js

+9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ window.errorColorEvent;
66
window.aceptColorEvent;
77
window.containerAceptColorEvent;
88
window.backgroundPickerColorEvent;
9+
window.expandedColorEvent;
910

1011
window.launchEventColors = function launchEventColors() {
1112
cellColorEvent = document.getElementById("cellColor");
@@ -14,6 +15,8 @@ window.launchEventColors = function launchEventColors() {
1415
aceptColorEvent = document.getElementById("aceptColor");
1516
containerAceptColorEvent = document.getElementById("containerAceptColor");
1617
backgroundPickerColorEvent = document.getElementById("backgroundPickerColor");
18+
backgroundPickerColorEvent = document.getElementById("backgroundPickerColor");
19+
expandedColorEvent = document.getElementById("expandedColor");
1720

1821
if (cellColorEvent) {
1922
cellColorEvent.addEventListener("input", function() {
@@ -50,4 +53,10 @@ window.launchEventColors = function launchEventColors() {
5053
$("#backgroundPickerColorHex").val(backgroundPickerColorEvent.value)
5154
}, false);
5255
}
56+
57+
if (expandedColorEvent) {
58+
expandedColorEvent.addEventListener("input", function() {
59+
$("#expandedColorHex").val(expandedColorEvent.value)
60+
}, false);
61+
}
5362
}

WebFormulary/src/js/expandable.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
window.generateDicExpandable = function generateDicExpandable(values) {
3+
if (values.isExpandable == false) {
4+
return null;
5+
}
6+
7+
var itemsExpandable = {}
8+
itemsExpandable["description"] = values.description
9+
itemsExpandable["textButtonReadMore"] = values.textbuttonReadMore
10+
itemsExpandable["textButtonReadLess"] = values.textbuttonReadLess
11+
return itemsExpandable;
12+
}

WebFormulary/src/js/fields/boolean.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,15 @@ window.saveBooleanField = function saveBooleanField(values, validator, styleM) {
7171
}
7272

7373
var itemsValidators = generateDicValidator(validator);
74-
7574
if (itemsValidators.length > 0) {
7675
itemSave["validator"] = itemsValidators;
7776
}
7877

78+
var itemsExpandable = generateDicExpandable(values);
79+
if (itemsExpandable != null) {
80+
itemSave["expandableInfo"] = itemsExpandable;
81+
}
82+
7983
//-- OPTIONAL FIELDS --
8084
var styles = getStylesJson(styleM);
8185

WebFormulary/src/js/fields/textField.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ window.createField = function createField(values, validator, style) {
3434
styles = htmlTypeCell + htmlFontSize + htmlBackgroundColor + htmlAlingFont + htmlImages;
3535
} else if (style.typeCell == "custom") {
3636
styles = htmlTypeCell + htmlCustom + htmlImages;
37-
} else if (htmlImages.length > 0) {
37+
} else if (htmlImages.length > 0) {
3838
styles = htmlImages;
3939
} else {
4040
styles = '<p class="styleDefault">Estilos por defecto</p>';

WebFormulary/src/js/main.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ require("./rules.js")
1111
require("./jsWeb.js")
1212
require("./createValidators.js")
1313
require("./typeCell.js")
14+
require("./expandable.js")
1415
require("./model/models.js")
1516
require("./model/RecoverData.js")
1617
require("./fields/textField.js")
1718
require("./fields/picker.js")
1819
require("./fields/datePicker.js")
1920
require("./fields/boolean.js")
20-
require("./fields/index.js")
21+
require("./fields/index.js")
22+

WebFormulary/src/js/typeCell.js

+10
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,16 @@ window.getStylesJson = function getStylesJson(styleModel) {
178178
var haveStyle = false;
179179

180180
//-- STYLES --
181+
182+
183+
if (styleModel.expandCollapseButtonTextColor != null && styleModel.expandCollapseButtonTextColor.length > 0) {
184+
style["expandCollapseButtonTextColor"] = styleModel.expandCollapseButtonTextColor
185+
haveStyle = true;
186+
}
187+
if (styleModel.expandCollapseButtonFontSize != null && styleModel.expandCollapseButtonFontSize.length > 0) {
188+
style["expandCollapseButtonFontSize"] = styleModel.expandCollapseButtonFontSize
189+
haveStyle = true;
190+
}
181191
if (styleModel.cellColor != null && styleModel.cellColor.length > 0) {
182192
style["backgroundColorField"] = styleModel.cellColor
183193
haveStyle = true;

0 commit comments

Comments
 (0)