@nys-cui/cui-section 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/section.js +24 -6
- package/src/section.scss +1 -0
package/package.json
CHANGED
package/src/section.js
CHANGED
|
@@ -14,6 +14,8 @@ export default class CUI_SECTION extends HTMLElement {
|
|
|
14
14
|
|
|
15
15
|
this.dSection = this;
|
|
16
16
|
|
|
17
|
+
this.sIconBasePath = null;
|
|
18
|
+
|
|
17
19
|
// Key Shadow DOM Fields
|
|
18
20
|
this.sdSection = null;
|
|
19
21
|
this.sdSectionTitle = null;
|
|
@@ -34,12 +36,26 @@ export default class CUI_SECTION extends HTMLElement {
|
|
|
34
36
|
|
|
35
37
|
if (!this.state.bHideControls) {
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
if (this.sIconBasePath) {
|
|
40
|
+
|
|
41
|
+
sTemplate += `
|
|
42
|
+
<div class="header-controls">
|
|
43
|
+
<button type="button" id="collapse-control">
|
|
44
|
+
<cui-icon src="caret-down" base="${this.sIconBasePath}"></cui-icon>
|
|
45
|
+
</button>
|
|
46
|
+
</div>`;
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
|
|
51
|
+
sTemplate += `
|
|
52
|
+
<div class="header-controls">
|
|
53
|
+
<button type="button" id="collapse-control">
|
|
54
|
+
<cui-icon src="caret-down"></cui-icon>
|
|
55
|
+
</button>
|
|
56
|
+
</div>`;
|
|
57
|
+
}
|
|
58
|
+
|
|
43
59
|
}
|
|
44
60
|
|
|
45
61
|
sTemplate += `</header><div class="container" id="container">
|
|
@@ -130,6 +146,8 @@ export default class CUI_SECTION extends HTMLElement {
|
|
|
130
146
|
asStyles: (this.getAttribute('styles')) ? this.getAttribute('styles').split(',') : null
|
|
131
147
|
}
|
|
132
148
|
|
|
149
|
+
this.sIconBasePath = this.getAttribute('iconbase') || null;
|
|
150
|
+
|
|
133
151
|
this.render();
|
|
134
152
|
}
|
|
135
153
|
|