@aurodesignsystem-dev/auro-accordion 0.0.0-pr214.0 → 0.0.0-pr214.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/README.md +99 -41
- package/custom-elements.json +27 -12
- package/demo/api.js +2 -0
- package/demo/api.md +781 -59
- package/demo/api.min.js +16 -3
- package/demo/auro-accordion.min.js +5 -11
- package/demo/index.md +76 -74
- package/dist/index.d.ts +247 -125
- package/package.json +2 -2
package/demo/api.min.js
CHANGED
|
@@ -2,22 +2,34 @@ import { A as AuroAccordion, a as AuroAccordionGroup } from './auro-accordion.mi
|
|
|
2
2
|
|
|
3
3
|
function expandedExample() {
|
|
4
4
|
const expandedExampleElem = document.querySelector(
|
|
5
|
-
"#
|
|
5
|
+
"#accordionExpandedExample",
|
|
6
6
|
);
|
|
7
7
|
|
|
8
8
|
document
|
|
9
|
-
.querySelector("#
|
|
9
|
+
.querySelector("#accordionExpandedExampleBtnTrue")
|
|
10
10
|
.addEventListener("click", () => {
|
|
11
11
|
expandedExampleElem.expanded = true;
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
document
|
|
15
|
-
.querySelector("#
|
|
15
|
+
.querySelector("#accordionExpandedExampleBtnFalse")
|
|
16
16
|
.addEventListener("click", () => {
|
|
17
17
|
expandedExampleElem.expanded = false;
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
function toggleExample() {
|
|
22
|
+
const expandedExampleElem = document.querySelector(
|
|
23
|
+
"#accordionToggleExample",
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
document
|
|
27
|
+
.querySelector("#accordionToggleExampleBtn")
|
|
28
|
+
.addEventListener("click", () => {
|
|
29
|
+
expandedExampleElem.toggle();
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
21
33
|
AuroAccordion.register();
|
|
22
34
|
AuroAccordionGroup.register();
|
|
23
35
|
|
|
@@ -27,6 +39,7 @@ function initExamples(initCount) {
|
|
|
27
39
|
|
|
28
40
|
try {
|
|
29
41
|
expandedExample();
|
|
42
|
+
toggleExample();
|
|
30
43
|
} catch {
|
|
31
44
|
if (initCount <= 20) {
|
|
32
45
|
// setTimeout handles issue where content is sometimes loaded after the functions get called
|
|
@@ -331,13 +331,8 @@ class AuroAccordionButton extends T {
|
|
|
331
331
|
|
|
332
332
|
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
333
333
|
/**
|
|
334
|
-
* Auro-accordion provides users a way to have collapsible content on a page.
|
|
335
|
-
* Use auro-accordion-group if you want to have auto closing accordion components when others are selected.
|
|
336
|
-
*
|
|
337
334
|
* @customElement auro-accordion-group
|
|
338
335
|
*/
|
|
339
|
-
|
|
340
|
-
// build the component class
|
|
341
336
|
class AuroAccordionGroup extends i$2 {
|
|
342
337
|
constructor() {
|
|
343
338
|
super();
|
|
@@ -409,8 +404,9 @@ class AuroAccordionGroup extends i$2 {
|
|
|
409
404
|
}
|
|
410
405
|
|
|
411
406
|
/**
|
|
412
|
-
* Updates the disabled state of all child
|
|
413
|
-
* to match the disabled state of the
|
|
407
|
+
* Updates the disabled state of all child `<auro-accordion>` elements
|
|
408
|
+
* to match the disabled state of the `<auro-accordion-group>` element.
|
|
409
|
+
* @private
|
|
414
410
|
*/
|
|
415
411
|
updateDisabledState() {
|
|
416
412
|
const accordions = this.querySelectorAll("auro-accordion");
|
|
@@ -509,8 +505,6 @@ var tokensCss = i$5`:host{--ds-auro-accordion-content-border-color: transparent;
|
|
|
509
505
|
|
|
510
506
|
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
511
507
|
/**
|
|
512
|
-
* Auro-accordion provides users a way to have collapsible content on a page.
|
|
513
|
-
* Use auro-accordion-group if you want to have auto closing accordion components when others are selected.
|
|
514
508
|
* @customElement auro-accordion
|
|
515
509
|
*
|
|
516
510
|
* @slot - Default slot for the accordion content.
|
|
@@ -580,7 +574,7 @@ class AuroAccordion extends i$2 {
|
|
|
580
574
|
},
|
|
581
575
|
|
|
582
576
|
/**
|
|
583
|
-
* If set, emphasis styles will be applied to the auro-
|
|
577
|
+
* If set, emphasis styles will be applied to the auro-accordion. This feature is best used on the auro-accordion-group component.
|
|
584
578
|
*/
|
|
585
579
|
emphasis: {
|
|
586
580
|
type: Boolean,
|
|
@@ -629,7 +623,7 @@ class AuroAccordion extends i$2 {
|
|
|
629
623
|
|
|
630
624
|
/**
|
|
631
625
|
* This will register this element with the browser.
|
|
632
|
-
* @param {string} [name="auro-accordion"] - The name of element that you want to register
|
|
626
|
+
* @param {string} [name="auro-accordion"] - The name of the element that you want to register.
|
|
633
627
|
*
|
|
634
628
|
* @example
|
|
635
629
|
* AuroAccordion.register("custom-accordion") // this will register this element to <custom-accordion/>
|
package/demo/index.md
CHANGED
|
@@ -47,33 +47,34 @@ The `<auro-accordion>` element should be used in situations where users may:
|
|
|
47
47
|
</div>
|
|
48
48
|
<auro-accordion alignRight>
|
|
49
49
|
<span slot="trigger">See code</span>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
</
|
|
68
|
-
|
|
69
|
-
|
|
50
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
|
|
51
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
|
|
52
|
+
|
|
53
|
+
```html
|
|
54
|
+
<auro-accordion>
|
|
55
|
+
<span slot="trigger">Trigger</span>
|
|
56
|
+
<p>
|
|
57
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
58
|
+
</p>
|
|
59
|
+
<p>
|
|
60
|
+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
61
|
+
</p>
|
|
62
|
+
<p>
|
|
63
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
64
|
+
</p>
|
|
65
|
+
<p>
|
|
66
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
67
|
+
</p>
|
|
68
|
+
</auro-accordion>
|
|
69
|
+
```
|
|
70
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
70
71
|
</auro-accordion>
|
|
71
72
|
|
|
72
73
|
### Accordion Group
|
|
73
74
|
|
|
74
75
|
<div class="exampleWrapper">
|
|
75
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
76
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
76
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/accordion-group.html) -->
|
|
77
|
+
<!-- The below content is automatically added from ./../apiExamples/accordion-group.html -->
|
|
77
78
|
<auro-accordion-group>
|
|
78
79
|
<auro-accordion>
|
|
79
80
|
<span slot="trigger">Trigger</span>
|
|
@@ -125,56 +126,57 @@ The `<auro-accordion>` element should be used in situations where users may:
|
|
|
125
126
|
</div>
|
|
126
127
|
<auro-accordion alignRight>
|
|
127
128
|
<span slot="trigger">See code</span>
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
</
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
</
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
</
|
|
177
|
-
</auro-accordion
|
|
178
|
-
|
|
179
|
-
|
|
129
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/accordion-group.html) -->
|
|
130
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/accordion-group.html -->
|
|
131
|
+
|
|
132
|
+
```html
|
|
133
|
+
<auro-accordion-group>
|
|
134
|
+
<auro-accordion>
|
|
135
|
+
<span slot="trigger">Trigger</span>
|
|
136
|
+
<p>
|
|
137
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
138
|
+
</p>
|
|
139
|
+
<p>
|
|
140
|
+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
141
|
+
</p>
|
|
142
|
+
<p>
|
|
143
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
144
|
+
</p>
|
|
145
|
+
<p>
|
|
146
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
147
|
+
</p>
|
|
148
|
+
</auro-accordion>
|
|
149
|
+
<auro-accordion>
|
|
150
|
+
<span slot="trigger">Trigger</span>
|
|
151
|
+
<p>
|
|
152
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
153
|
+
</p>
|
|
154
|
+
<p>
|
|
155
|
+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
156
|
+
</p>
|
|
157
|
+
<p>
|
|
158
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
159
|
+
</p>
|
|
160
|
+
<p>
|
|
161
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
162
|
+
</p>
|
|
163
|
+
</auro-accordion>
|
|
164
|
+
<auro-accordion>
|
|
165
|
+
<span slot="trigger">Trigger</span>
|
|
166
|
+
<p>
|
|
167
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
168
|
+
</p>
|
|
169
|
+
<p>
|
|
170
|
+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
171
|
+
</p>
|
|
172
|
+
<p>
|
|
173
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
174
|
+
</p>
|
|
175
|
+
<p>
|
|
176
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
177
|
+
</p>
|
|
178
|
+
</auro-accordion>
|
|
179
|
+
</auro-accordion-group>
|
|
180
|
+
```
|
|
181
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
180
182
|
</auro-accordion>
|