@nys-cui/cui-section 0.2.1 → 0.2.2

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.2.1",
9
+ "version": "0.2.2",
10
10
  "scripts": {
11
11
  "clean": "rm -rf ./dist",
12
12
  "build": "npm run clean && cui --dep",
package/src/section.js CHANGED
@@ -101,13 +101,13 @@ export default class CUI_SECTION extends HTMLElement {
101
101
  collapse(dContainer) {
102
102
 
103
103
  function transitionEnd(e) {
104
+
105
+ dContainer.style.height = "";
104
106
 
105
107
  // mark the section as "currently collapsed"
106
108
  dContainer.setAttribute('data-collapsed', 'true');
107
109
  dContainer.setAttribute('aria-expanded', 'false');
108
110
 
109
- dContainer.style.height = "";
110
-
111
111
  dContainer.removeEventListener('transitionend', transitionEnd, true);
112
112
  }
113
113
 
@@ -143,16 +143,6 @@ export default class CUI_SECTION extends HTMLElement {
143
143
 
144
144
  }
145
145
 
146
- animationstart() {
147
-
148
- console.log("Animation started");
149
- }
150
-
151
- animationend() {
152
-
153
- console.log("Animation ended");
154
- }
155
-
156
146
  connectedCallback() {
157
147
 
158
148
  this.state = {
@@ -175,17 +165,9 @@ export default class CUI_SECTION extends HTMLElement {
175
165
  this.sdSectionTitle = this.shadowRoot.querySelector(`#section-title`);
176
166
  this.sdContentsContainer = this.shadowRoot.querySelector(`#container`);
177
167
 
178
- if (this.bCollapsed) {
179
- this.sdContentsContainer.setAttribute('aria-expanded', 'false');
180
- }
181
- else {
182
- this.sdContentsContainer.setAttribute('aria-expanded', 'true');
183
- }
184
-
185
-
186
168
  this.sdSectionTitle.appendChild(document.createTextNode(this.state.sTitle));
187
169
 
188
- if (!this.state.bHideControls) {
170
+ if (!this.state.bHideControls) {
189
171
 
190
172
  this.sdSectionCollapseControl = this.shadowRoot.querySelector(`#collapse-control`);
191
173
 
@@ -197,7 +179,6 @@ export default class CUI_SECTION extends HTMLElement {
197
179
 
198
180
  this.sdSectionCollapseControl.classList.add('collapsed');
199
181
  this.sdContentsContainer.setAttribute('data-collapsed', "true");
200
- this.sdContentsContainer.setAttribute('aria-expanded', "false");
201
182
  }
202
183
 
203
184
  this.sdSectionCollapseControl.addEventListener('click', () => {
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;
@@ -72,9 +73,6 @@
72
73
  height: 0;
73
74
  }
74
75
 
75
- &[aria-expanded="false"] {
76
- display: none;
77
- }
78
76
 
79
77
  }
80
78
  }