@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 CHANGED
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "main": "./dist/js/section.js",
8
8
  "type": "module",
9
- "version": "0.1.2",
9
+ "version": "0.2.0",
10
10
  "scripts": {
11
11
  "clean": "rm -rf ./dist",
12
12
  "build": "npm run clean && cui --dep",
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
- sTemplate += `
38
- <div class="header-controls">
39
- <button type="button" id="collapse-control">
40
- <cui-icon src="caret-down"></cui-icon>
41
- </button>
42
- </div>`;
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
 
package/src/section.scss CHANGED
@@ -1,6 +1,7 @@
1
1
  :host {
2
2
  display: block;
3
3
  margin-bottom: 20px;
4
+ width: 100%;
4
5
 
5
6
  * {
6
7
  box-sizing: border-box;