@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 +1 -1
- package/src/section.js +3 -22
- package/src/section.scss +1 -3
package/package.json
CHANGED
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
|
-
|
|
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', () => {
|