Skip to content

Commit 87fab33

Browse files
Release 1.9.0
1 parent d6bd251 commit 87fab33

File tree

27 files changed

+1207
-71
lines changed

27 files changed

+1207
-71
lines changed

com_jdbuilder/jdbuilder.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<author>Team Joomdev</author>
99
<authorEmail>[email protected]</authorEmail>
1010
<authorUrl>https://www.joomdev.com</authorUrl>
11-
<version>1.8.0</version>
11+
<version>1.9.0</version>
1212
<description>{jdbcomdesc}</description>
1313
<install> <!-- Runs on install -->
1414
<sql>

mod_jdbuilder/mod_jdbuilder.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<authorUrl>https://www.joomdev.com</authorUrl>
88
<copyright>Copyright (C) 2020 Joomdev, Inc. All rights reserved.</copyright>
99
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
10-
<version>1.8.0</version>
10+
<version>1.9.0</version>
1111
<description>This Module allows you to create your own Module using the JD Builder.</description>
1212
<files>
1313
<filename>mod_jdbuilder.xml</filename>

pkg_jdbuilder.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<packagerurl>https://www.joomdev.com</packagerurl>
88
<author>Team JoomDev</author>
99
<creationDate>Aug 2020</creationDate>
10-
<version>1.8.0</version>
10+
<version>1.9.0</version>
1111
<url>https://www.joomdev.com</url>
1212
<copyright>Copyright (C) 2020 Joomdev, Inc. All rights reserved.</copyright>
1313
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<element type="icon-list">
3+
<title>Icon List</title>
4+
<icon>media/jdbuilder/images/icons/elements/icon-list.svg</icon>
5+
<creationDate>Aug 2020</creationDate>
6+
<author>JoomDev</author>
7+
<authorEmail>[email protected]</authorEmail>
8+
<authorUrl>https://www.joomdev.com</authorUrl>
9+
<copyright>Copyright (C) 2020 Joomdev, Inc. All rights reserved.</copyright>
10+
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
11+
<version>1.0</version>
12+
<description>Element Description Here</description>
13+
<documentation>https://docs.joomdev.com/article/icon-list-element/</documentation>
14+
<form>
15+
<fields>
16+
<fieldset name="general" label="JDB_GENERAL_TITLE">
17+
<field type="group" name="listOptions" label="JDB_ICONLIST"></field>
18+
<!-- List Options -->
19+
<field type="repeatable" name="list_items" label="JDB_ICONLIST_LIST_ITEMS" item-title-field="text" group="listOptions" default='[{"icon":"fas fa-star","text":"Lorem ipsum dolor sit amet, consectetur adipiscing elit."},{"icon":"fas fa-star","text":"Fusce a leo in erat elementum mattis."},{"icon":"fas fa-star","text":"Pellentesque ultrices erat quis enim consequat, a ultricies est aliquet."},{"icon":"fas fa-star","text":"Sed scelerisque enim a tellus tincidunt, sit amet viverra dui posuere."},{"icon":"fas fa-star","text":"Nulla finibus lectus a risus dapibus lobortis."},{"icon":"fas fa-star","text":"Maecenas vestibulum ligula sit amet libero malesuada ullamcorper."}]'>
20+
<form>
21+
<field name="icon" width="3" type="icon" label="JDB_ICON" default="" />
22+
<field name="text" width="9" type="text" label="JDB_TEXT" default="" />
23+
</form>
24+
</field>
25+
26+
<field name="list_layout" type="radio" radiotype="buttons" label="JDB_LAYOUT_TITLE" default="list" group="listOptions">
27+
<option value="list">JDB_DEFAULT</option>
28+
<option value="inline">JDB_INLINE</option>
29+
</field>
30+
<!-- List Options -->
31+
</fieldset>
32+
33+
<fieldset name="design" ordering="9" label="JDB_DESIGN_TITLE">
34+
<field type="group" name="listStyling" label="JDB_ICONLIST_LIST"></field>
35+
<field type="group" name="iconStyling" label="JDB_ICON"></field>
36+
<field type="group" name="textStyling" label="JDB_TEXT"></field>
37+
38+
<!-- List Styling -->
39+
<field type="slider" name="list_space_between" label="JDB_ICONLIST_SPACE_BETWEEN_ITEMS" default="" max="100" min="0" unit="px" responsive="true" group="listStyling" />
40+
41+
<field name="list_alignment" type="radio" radiotype="buttons" label="JDB_ALIGNMENT" responsive="true" default="left" group="listStyling">
42+
<option value="left">JDB_LEFT</option>
43+
<option value="center">JDB_CENTER</option>
44+
<option value="right">JDB_RIGHT</option>
45+
</field>
46+
47+
<field name="list_divider" type="switch" label="JDB_ICONLIST_ENABLE_DIVIDER" default="false" group="listStyling" />
48+
49+
<field type="list" name="list_divider_style" label="JDB_ICONLIST_DIVIDER_STYLE" default="solid" showon="params.list_divider" group="listStyling">
50+
<option value="dotted">JDB_BORDER_DOTTED</option>
51+
<option value="dashed">JDB_BORDER_DASHED</option>
52+
<option value="solid">JDB_BORDER_SOLID</option>
53+
<option value="double">JDB_BORDER_DOUBLE</option>
54+
</field>
55+
56+
<field type="slider" name="list_divider_weight" label="JDB_ICONLIST_DIVIDER_WEIGHT" default='{value:1,unit:"px"}' max="20" min="1" unit="px" responsive="true" showon="params.list_divider" group="listStyling" />
57+
58+
<field type="slider" name="list_divider_width" label="JDB_ICONLIST_DIVIDER_WIDTH" default='{"value":100,"unit":"%"}' max="500" min="0" units="px,%" showon="params.list_divider[AND]params.list_layout=='list'" group="listStyling" responsive="true" />
59+
60+
<field type="slider" name="list_divider_height" label="JDB_ICONLIST_DIVIDER_HEIGHT" default='{"value":25,"unit":"px"}' max="500" min="0" unit="px" showon="params.list_divider[AND]params.list_layout=='inline'" group="listStyling" responsive="true" />
61+
62+
<field type="color" name="list_divider_color" label="JDB_ICONLIST_DIVIDER_COLOR" showon="params.list_divider" default="" group="listStyling">
63+
</field>
64+
<!-- List Styling -->
65+
66+
67+
<!-- Icon Styling -->
68+
69+
<field type="color" name="icon_color" label="JDB_COLOR" default="" group="iconStyling" width="6"></field>
70+
71+
<field type="color" name="icon_hover_color" label="JDB_HOVER_COLOR" default="" group="iconStyling" width="6"></field>
72+
73+
<field type="color" name="icon_bg_color" label="JDB_BACKGROUND_COLOR" default="" group="iconStyling" width="6"></field>
74+
75+
<field type="color" name="icon_bg_hover_color" label="JDB_BACKGROUND_HOVER_COLOR" default="" group="iconStyling" width="6"></field>
76+
77+
<field type="slider" name="icon_size" label="JDB_SIZE" default='{value:null,unit:"px"}' max="100" min="5" unit="px" responsive="true" group="iconStyling" />
78+
79+
<field type="fieldsgroup" name="iconBorder" filename="border" group="iconStyling">
80+
</field>
81+
82+
<field type="spacing" name="icon_padding" min="0" label="JDB_PADDING" group="iconStyling" default='{"unit":"px","top":"","lock":1,"left":"","right":"","bottom":""}' responsive="true" />
83+
84+
<field type="slider" name="icon_space_between" label="JDB_ICONLIST_SPACE_BETWEEN_ICON_TEXT" default="" max="100" min="0" unit="px" responsive="true" group="iconStyling" />
85+
<!-- Icon Styling -->
86+
87+
<!-- Text Styling -->
88+
<field type="color" name="text_color" label="JDB_COLOR" default="" group="textStyling" width="6"></field>
89+
90+
<field type="color" name="text_hover_color" label="JDB_HOVER_COLOR" default="" group="textStyling" width="6"></field>
91+
92+
<field type="typography" name="text_typography" label="JDB_TYPOGRAPHY" default='{"family":"", "size":"", "sizeUnit":"px", "alignment":"", "weight":"", "transform":"", "style":"", "decoration":"", "lineHeight":"", "lineHeightUnit": "px", "letterSpacing":"", "letterSpacingUnit": "px"}' responsive="true" group="textStyling" />
93+
<!-- Text Styling -->
94+
</fieldset>
95+
</fields>
96+
</form>
97+
</element>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
; Icon List
2+
JDB_ICONLIST="Icon List"
3+
JDB_ICONLIST_LIST_ITEMS="List Items"
4+
JDB_ICONLIST_LIST="List"
5+
JDB_ICONLIST_SPACE_BETWEEN_ITEMS="Space Between Items"
6+
JDB_ICONLIST_ENABLE_DIVIDER="Enable Divider"
7+
JDB_ICONLIST_DIVIDER_STYLE="Divider Style"
8+
JDB_ICONLIST_DIVIDER_WEIGHT="Divider Weight"
9+
JDB_ICONLIST_DIVIDER_WIDTH="Divider Width"
10+
JDB_ICONLIST_DIVIDER_HEIGHT="Divider Height"
11+
JDB_ICONLIST_DIVIDER_COLOR="Divider Color"
12+
JDB_ICONLIST_SPACE_BETWEEN_ICON_TEXT="Space Between Icon &amp; Text"
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
(function () {
2+
3+
var JDBuilderElementIconList = function (element) {
4+
var html = [];
5+
var items = element.params.get('list_items', []);
6+
var layout = element.params.get('list_layout', 'list');
7+
var divider = element.params.get('list_divider', false);
8+
9+
html = [`<div class="jdb-iconlist jdb-iconlist-layout-${layout}${divider ? ' jdb-iconlist-has-divider' : ''}"><ul class="jdb-iconlist-items">`];
10+
11+
items.forEach(function (item) {
12+
if (item.text != '' || item.icon != '') {
13+
html.push(`<li class="jdb-iconlist-item">${item.icon ? `<span class="jdb-iconlist-icon"><i class="${item.icon}"></i></span>` : ``}<span class="jdb-iconlist-text">${item.text}</span></li>`);
14+
}
15+
});
16+
17+
html.push(`</ul></div>`);
18+
19+
listStyling(element);
20+
iconStyling(element);
21+
textStyling(element);
22+
23+
return html.join('');
24+
}
25+
26+
function listStyling(element) {
27+
var layout = element.params.get('list_layout', 'list');
28+
29+
var List = new JDBRenderer.ElementStyle(".jdb-iconlist");
30+
var ListContainer = new JDBRenderer.ElementStyle(".jdb-iconlist-layout-" + layout);
31+
var ListItems = new JDBRenderer.ElementStyle(".jdb-iconlist-layout-" + layout + " .jdb-iconlist-items");
32+
var ListItem = new JDBRenderer.ElementStyle(".jdb-iconlist-layout-" + layout + " .jdb-iconlist-item");
33+
var ListItemNotLast = new JDBRenderer.ElementStyle(".jdb-iconlist-layout-" + layout + " .jdb-iconlist-item:not(:last-child)");
34+
var ListItemNotFirst = new JDBRenderer.ElementStyle(".jdb-iconlist-layout-" + layout + " .jdb-iconlist-item:not(:first-child)");
35+
var ListItemHover = new JDBRenderer.ElementStyle(".jdb-iconlist-item:hover");
36+
var ListDivider = new JDBRenderer.ElementStyle(".jdb-iconlist-layout-" + layout + ".jdb-iconlist-has-divider .jdb-iconlist-item:not(:last-child):after");
37+
38+
var alignment = element.params.get('list_alignment', null);
39+
40+
JDBRenderer.DEVICES.forEach(function (_deviceObj) {
41+
if (_deviceObj.key in alignment) {
42+
ListContainer.addCss('text-align', alignment[_deviceObj.key], _deviceObj.type);
43+
ListItem.addCss('justify-content', alignment[_deviceObj.key] == 'left' ? 'flex-start' : (alignment[_deviceObj.key] == 'right' ? 'flex-end' : 'center'), _deviceObj.type);
44+
}
45+
});
46+
47+
48+
var space_between = element.params.get('list_space_between', null);
49+
if (space_between != null) {
50+
JDBRenderer.DEVICES.forEach(function (_deviceObj) {
51+
if ((_deviceObj.key in space_between) && JDBRenderer.Helper.checkSliderValue(space_between[_deviceObj.key])) {
52+
var marginSide = layout == 'list' ? 'bottom' : 'right';
53+
ListItemNotLast.addCss(`margin-${marginSide}`, `${space_between[_deviceObj.key].value / 2}px`, _deviceObj.type);
54+
ListItemNotLast.addCss(`padding-${marginSide}`, `${space_between[_deviceObj.key].value / 2}px`, _deviceObj.type);
55+
}
56+
});
57+
}
58+
59+
if (element.params.get('list_divider', false)) {
60+
var borderSide = layout == 'list' ? 'top' : 'right';
61+
ListDivider.addCss(`border-${borderSide}-style`, element.params.get('list_divider_style', 'solid'))
62+
ListDivider.addCss(`border-${borderSide}-color`, element.params.get('list_divider_color', ''))
63+
64+
var weight = element.params.get('list_divider_weight', null);
65+
if (weight != null) {
66+
JDBRenderer.DEVICES.forEach(function (_deviceObj) {
67+
if ((_deviceObj.key in weight) && JDBRenderer.Helper.checkSliderValue(weight[_deviceObj.key])) {
68+
ListDivider.addCss(`border-${borderSide}-width`, `${weight[_deviceObj.key].value}px`, _deviceObj.type);
69+
if (layout == 'list') {
70+
ListItemNotLast.addCss(`padding-bottom`, `${weight[_deviceObj.key].value}px`, _deviceObj.type);
71+
} else {
72+
ListItemNotLast.addCss(`padding-right`, `${weight[_deviceObj.key].value + 5}px`, _deviceObj.type);
73+
}
74+
}
75+
});
76+
}
77+
78+
if (layout == 'list') {
79+
var width = element.params.get('list_divider_width', null);
80+
if (width != null) {
81+
JDBRenderer.DEVICES.forEach(function (_deviceObj) {
82+
if ((_deviceObj.key in width) && JDBRenderer.Helper.checkSliderValue(width[_deviceObj.key])) {
83+
ListDivider.addCss(`width`, `${width[_deviceObj.key].value}${width[_deviceObj.key].unit}`, _deviceObj.type);
84+
}
85+
});
86+
}
87+
} else {
88+
var height = element.params.get('list_divider_height', null);
89+
if (height != null) {
90+
JDBRenderer.DEVICES.forEach(function (_deviceObj) {
91+
if ((_deviceObj.key in height) && JDBRenderer.Helper.checkSliderValue(height[_deviceObj.key])) {
92+
ListDivider.addCss(`height`, `${height[_deviceObj.key].value}${height[_deviceObj.key].unit}`, _deviceObj.type);
93+
}
94+
});
95+
}
96+
}
97+
98+
element.addChildStyle(ListDivider);
99+
}
100+
101+
102+
element.addChildStyle(List);
103+
element.addChildStyle(ListContainer);
104+
element.addChildStyle(ListItem);
105+
element.addChildStyle(ListItems);
106+
element.addChildStyle(ListItemNotLast);
107+
element.addChildStyle(ListItemNotFirst);
108+
element.addChildStyle(ListItemHover);
109+
}
110+
111+
function iconStyling(element) {
112+
var Icon = new JDBRenderer.ElementStyle(".jdb-iconlist-icon");
113+
var IconHover = new JDBRenderer.ElementStyle(".jdb-iconlist-item:hover .jdb-iconlist-icon");
114+
115+
Icon.addCss('color', element.params.get('icon_color', ''));
116+
Icon.addCss('background-color', element.params.get('icon_bg_color', ''));
117+
IconHover.addCss('color', element.params.get('icon_hover_color', ''));
118+
IconHover.addCss('background-color', element.params.get('icon_bg_hover_color', ''));
119+
120+
JDBRenderer.Helper.applyBorderValue(Icon, element.params, "iconBorder");
121+
122+
var icon_size = element.params.get('icon_size', null);
123+
if (icon_size != null) {
124+
JDBRenderer.DEVICES.forEach(function (_deviceObj) {
125+
if ((_deviceObj.key in icon_size) && JDBRenderer.Helper.checkSliderValue(icon_size[_deviceObj.key])) {
126+
Icon.addCss(`font-size`, `${icon_size[_deviceObj.key].value * 0.70}px`, _deviceObj.type);
127+
Icon.addCss(`line-height`, `${icon_size[_deviceObj.key].value}px`, _deviceObj.type);
128+
Icon.addCss(`width`, `${icon_size[_deviceObj.key].value}px`, _deviceObj.type);
129+
Icon.addCss(`height`, `${icon_size[_deviceObj.key].value}px`, _deviceObj.type);
130+
}
131+
});
132+
}
133+
134+
var padding = element.params.get('icon_padding', null);
135+
if (padding != null) {
136+
JDBRenderer.DEVICES.forEach(function (_deviceObj) {
137+
if (_deviceObj.key in padding) {
138+
Icon.addStyle(JDBRenderer.Helper.spacingValue(padding[_deviceObj.key], "padding"), _deviceObj.type);
139+
}
140+
});
141+
}
142+
143+
var space_between = element.params.get('icon_space_between', null);
144+
if (space_between != null) {
145+
JDBRenderer.DEVICES.forEach(function (_deviceObj) {
146+
if ((_deviceObj.key in space_between) && JDBRenderer.Helper.checkSliderValue(space_between[_deviceObj.key])) {
147+
Icon.addCss(`margin-right`, `${space_between[_deviceObj.key].value}px`, _deviceObj.type);
148+
}
149+
});
150+
}
151+
152+
element.addChildStyle(Icon);
153+
element.addChildStyle(IconHover);
154+
}
155+
156+
function textStyling(element) {
157+
var Text = new JDBRenderer.ElementStyle(".jdb-iconlist-text");
158+
var TextHover = new JDBRenderer.ElementStyle(".jdb-iconlist-item:hover .jdb-iconlist-text");
159+
160+
Text.addCss('color', element.params.get('text_color', ''));
161+
TextHover.addCss('color', element.params.get('text_hover_color', ''));
162+
163+
var typography = element.params.get('text_typography', null);
164+
if (typography !== null) {
165+
JDBRenderer.DEVICES.forEach(function (_deviceObj) {
166+
if (_deviceObj.key in typography) {
167+
Text.addStyle(JDBRenderer.Helper.typographyValue(typography[_deviceObj.key]), _deviceObj.type);
168+
}
169+
});
170+
}
171+
172+
element.addChildStyle(Text);
173+
element.addChildStyle(TextHover);
174+
}
175+
176+
window.JDBuilderElementIconList = JDBuilderElementIconList;
177+
178+
})();

0 commit comments

Comments
 (0)