@nys-cui/cui-section 0.2.18 → 0.2.19
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 +25 -20
- package/src/section.scss +5 -0
package/package.json
CHANGED
package/src/section.js
CHANGED
|
@@ -29,6 +29,7 @@ export default class CUI_SECTION extends HTMLElement {
|
|
|
29
29
|
this.oPropsToStateNames = {
|
|
30
30
|
"sectiontitle": "sTitle",
|
|
31
31
|
"hideControls": "bHideControls",
|
|
32
|
+
"hideHeader": "bHideHeader",
|
|
32
33
|
"collapsed": "bCollapsed",
|
|
33
34
|
"styles": "asStyles",
|
|
34
35
|
"label": "sTitle",
|
|
@@ -42,31 +43,34 @@ export default class CUI_SECTION extends HTMLElement {
|
|
|
42
43
|
|
|
43
44
|
get template() {
|
|
44
45
|
|
|
45
|
-
let sTemplate = `<section part="root-section"><header part="section-header"
|
|
46
|
-
<div class='header-info' part='header-info'><h2 id="section-title" part="section-title"></h2><slot name='section-help-tag'></slot></div>`;
|
|
46
|
+
let sTemplate = `<section part="root-section"><header part="section-header ${this.state.bHideHeader ? `headless" class="headless"` : `"`}>`;
|
|
47
47
|
|
|
48
|
-
if
|
|
48
|
+
if(!this.state.bHideHeader) {
|
|
49
|
+
sTemplate += `<div class='header-info' part='header-info'><h2 id="section-title" part="section-title"></h2><slot name='section-help-tag'></slot></div>`;
|
|
49
50
|
|
|
50
|
-
if (this.
|
|
51
|
+
if (!this.state.bHideControls) {
|
|
51
52
|
|
|
52
|
-
|
|
53
|
-
<div class="header-controls" part="header-controls">
|
|
54
|
-
<button type="button" id="collapse-control" aria-controls="container" part="collapse-control">
|
|
55
|
-
<cui-icon src="caret-down" basePath="${this.sIconBasePath}" part="collapse-control-icon"></cui-icon>
|
|
56
|
-
</button>
|
|
57
|
-
</div>`;
|
|
53
|
+
if (this.sIconBasePath) {
|
|
58
54
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<cui-icon src="caret-down" part="collapse-control-icon"></cui-icon>
|
|
66
|
-
</button>
|
|
67
|
-
</div>`;
|
|
68
|
-
}
|
|
55
|
+
sTemplate += `
|
|
56
|
+
<div class="header-controls" part="header-controls">
|
|
57
|
+
<button type="button" id="collapse-control" aria-controls="container" part="collapse-control">
|
|
58
|
+
<cui-icon src="caret-down" basePath="${this.sIconBasePath}" part="collapse-control-icon"></cui-icon>
|
|
59
|
+
</button>
|
|
60
|
+
</div>`;
|
|
69
61
|
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
|
|
65
|
+
sTemplate += `
|
|
66
|
+
<div class="header-controls" part="header-controls">
|
|
67
|
+
<button type="button" id="collapse-control" aria-controls="container" part="collapse-control">
|
|
68
|
+
<cui-icon src="caret-down" part="collapse-control-icon"></cui-icon>
|
|
69
|
+
</button>
|
|
70
|
+
</div>`;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
}
|
|
70
74
|
}
|
|
71
75
|
|
|
72
76
|
sTemplate += `</header><div class="container" id="container" part="container">
|
|
@@ -202,6 +206,7 @@ export default class CUI_SECTION extends HTMLElement {
|
|
|
202
206
|
this.state = {
|
|
203
207
|
sTitle: this.state.sTitle || this.getAttribute('sectiontitle') || "SECTION TITLE",
|
|
204
208
|
bHideControls: this.state.bHideControls || this.hasAttribute("hideControls") ? true : false,
|
|
209
|
+
bHideHeader: this.state.bHideHeader || this.hasAttribute("hideHeader") ? true : false,
|
|
205
210
|
bCollapsed: this.state.bCollapsed || (this.getAttribute('collapsed') === "true") ? true : false,
|
|
206
211
|
asStyles: this.state.asStyles || (this.getAttribute('styles')) ? this.getAttribute('styles').split(',') : null,
|
|
207
212
|
oInstructions: this.state.oInstructions || null
|