@y14e/accordion 2.1.3 → 2.1.5
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 +3 -3
- package/dist/index.bundle.cjs +5 -14
- package/dist/index.bundle.js +5 -14
- package/dist/index.cjs +5 -14
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,11 +13,11 @@ npm i @y14e/accordion
|
|
|
13
13
|
import { Accordion } from '@y14e/accordion';
|
|
14
14
|
|
|
15
15
|
// CDNs
|
|
16
|
-
import { Accordion } from 'https://esm.sh/@y14e/accordion@2.1.
|
|
16
|
+
import { Accordion } from 'https://esm.sh/@y14e/accordion@2.1.5';
|
|
17
17
|
// or
|
|
18
|
-
import { Accordion } from 'https://cdn.jsdelivr.net/npm/@y14e/accordion@2.1.
|
|
18
|
+
import { Accordion } from 'https://cdn.jsdelivr.net/npm/@y14e/accordion@2.1.5/+esm';
|
|
19
19
|
// or
|
|
20
|
-
import { Accordion } from 'https://esm.unpkg.com/@y14e/accordion@2.1.
|
|
20
|
+
import { Accordion } from 'https://esm.unpkg.com/@y14e/accordion@2.1.5';
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Usage
|
package/dist/index.bundle.cjs
CHANGED
|
@@ -1009,25 +1009,16 @@ var Accordion = class _Accordion {
|
|
|
1009
1009
|
console.warn(`Invalid collapsible option. Fallback: ${collapsible}.`);
|
|
1010
1010
|
merged.collapsible = collapsible;
|
|
1011
1011
|
}
|
|
1012
|
-
const
|
|
1013
|
-
function resolveSelector(name, target2, source2) {
|
|
1012
|
+
for (const [key, value] of Object.entries(defaults.selector)) {
|
|
1014
1013
|
try {
|
|
1015
|
-
document.querySelector(
|
|
1016
|
-
return source2;
|
|
1014
|
+
document.querySelector(value);
|
|
1017
1015
|
} catch {
|
|
1018
1016
|
console.warn(
|
|
1019
|
-
`Invalid ${
|
|
1017
|
+
`Invalid ${key.replace(/[A-Z]/g, (c) => ` ${c.toLowerCase()}`)} selector. Fallback: '${value}'.`
|
|
1020
1018
|
);
|
|
1021
|
-
|
|
1019
|
+
merged.selector[key] = value;
|
|
1022
1020
|
}
|
|
1023
1021
|
}
|
|
1024
|
-
for (const name of ["content", "trigger"]) {
|
|
1025
|
-
selector[name] = resolveSelector(
|
|
1026
|
-
name,
|
|
1027
|
-
defaults.selector[name],
|
|
1028
|
-
selector[name]
|
|
1029
|
-
);
|
|
1030
|
-
}
|
|
1031
1022
|
return merged;
|
|
1032
1023
|
}
|
|
1033
1024
|
async #waitAnimationsFinish() {
|
|
@@ -1048,7 +1039,7 @@ function waitAnimationFinish(animation) {
|
|
|
1048
1039
|
* Accordion
|
|
1049
1040
|
* WAI-ARIA compliant accordion pattern implementation in TypeScript.
|
|
1050
1041
|
*
|
|
1051
|
-
* @version 2.1.
|
|
1042
|
+
* @version 2.1.5
|
|
1052
1043
|
* @author Yusuke Kamiyamane
|
|
1053
1044
|
* @license MIT
|
|
1054
1045
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.bundle.js
CHANGED
|
@@ -1007,25 +1007,16 @@ var Accordion = class _Accordion {
|
|
|
1007
1007
|
console.warn(`Invalid collapsible option. Fallback: ${collapsible}.`);
|
|
1008
1008
|
merged.collapsible = collapsible;
|
|
1009
1009
|
}
|
|
1010
|
-
const
|
|
1011
|
-
function resolveSelector(name, target2, source2) {
|
|
1010
|
+
for (const [key, value] of Object.entries(defaults.selector)) {
|
|
1012
1011
|
try {
|
|
1013
|
-
document.querySelector(
|
|
1014
|
-
return source2;
|
|
1012
|
+
document.querySelector(value);
|
|
1015
1013
|
} catch {
|
|
1016
1014
|
console.warn(
|
|
1017
|
-
`Invalid ${
|
|
1015
|
+
`Invalid ${key.replace(/[A-Z]/g, (c) => ` ${c.toLowerCase()}`)} selector. Fallback: '${value}'.`
|
|
1018
1016
|
);
|
|
1019
|
-
|
|
1017
|
+
merged.selector[key] = value;
|
|
1020
1018
|
}
|
|
1021
1019
|
}
|
|
1022
|
-
for (const name of ["content", "trigger"]) {
|
|
1023
|
-
selector[name] = resolveSelector(
|
|
1024
|
-
name,
|
|
1025
|
-
defaults.selector[name],
|
|
1026
|
-
selector[name]
|
|
1027
|
-
);
|
|
1028
|
-
}
|
|
1029
1020
|
return merged;
|
|
1030
1021
|
}
|
|
1031
1022
|
async #waitAnimationsFinish() {
|
|
@@ -1046,7 +1037,7 @@ function waitAnimationFinish(animation) {
|
|
|
1046
1037
|
* Accordion
|
|
1047
1038
|
* WAI-ARIA compliant accordion pattern implementation in TypeScript.
|
|
1048
1039
|
*
|
|
1049
|
-
* @version 2.1.
|
|
1040
|
+
* @version 2.1.5
|
|
1050
1041
|
* @author Yusuke Kamiyamane
|
|
1051
1042
|
* @license MIT
|
|
1052
1043
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.cjs
CHANGED
|
@@ -285,25 +285,16 @@ var Accordion = class _Accordion {
|
|
|
285
285
|
console.warn(`Invalid collapsible option. Fallback: ${collapsible}.`);
|
|
286
286
|
merged.collapsible = collapsible;
|
|
287
287
|
}
|
|
288
|
-
const
|
|
289
|
-
function resolveSelector(name, target2, source2) {
|
|
288
|
+
for (const [key, value] of Object.entries(defaults.selector)) {
|
|
290
289
|
try {
|
|
291
|
-
document.querySelector(
|
|
292
|
-
return source2;
|
|
290
|
+
document.querySelector(value);
|
|
293
291
|
} catch {
|
|
294
292
|
console.warn(
|
|
295
|
-
`Invalid ${
|
|
293
|
+
`Invalid ${key.replace(/[A-Z]/g, (c) => ` ${c.toLowerCase()}`)} selector. Fallback: '${value}'.`
|
|
296
294
|
);
|
|
297
|
-
|
|
295
|
+
merged.selector[key] = value;
|
|
298
296
|
}
|
|
299
297
|
}
|
|
300
|
-
for (const name of ["content", "trigger"]) {
|
|
301
|
-
selector[name] = resolveSelector(
|
|
302
|
-
name,
|
|
303
|
-
defaults.selector[name],
|
|
304
|
-
selector[name]
|
|
305
|
-
);
|
|
306
|
-
}
|
|
307
298
|
return merged;
|
|
308
299
|
}
|
|
309
300
|
async #waitAnimationsFinish() {
|
|
@@ -324,7 +315,7 @@ function waitAnimationFinish(animation) {
|
|
|
324
315
|
* Accordion
|
|
325
316
|
* WAI-ARIA compliant accordion pattern implementation in TypeScript.
|
|
326
317
|
*
|
|
327
|
-
* @version 2.1.
|
|
318
|
+
* @version 2.1.5
|
|
328
319
|
* @author Yusuke Kamiyamane
|
|
329
320
|
* @license MIT
|
|
330
321
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -283,25 +283,16 @@ var Accordion = class _Accordion {
|
|
|
283
283
|
console.warn(`Invalid collapsible option. Fallback: ${collapsible}.`);
|
|
284
284
|
merged.collapsible = collapsible;
|
|
285
285
|
}
|
|
286
|
-
const
|
|
287
|
-
function resolveSelector(name, target2, source2) {
|
|
286
|
+
for (const [key, value] of Object.entries(defaults.selector)) {
|
|
288
287
|
try {
|
|
289
|
-
document.querySelector(
|
|
290
|
-
return source2;
|
|
288
|
+
document.querySelector(value);
|
|
291
289
|
} catch {
|
|
292
290
|
console.warn(
|
|
293
|
-
`Invalid ${
|
|
291
|
+
`Invalid ${key.replace(/[A-Z]/g, (c) => ` ${c.toLowerCase()}`)} selector. Fallback: '${value}'.`
|
|
294
292
|
);
|
|
295
|
-
|
|
293
|
+
merged.selector[key] = value;
|
|
296
294
|
}
|
|
297
295
|
}
|
|
298
|
-
for (const name of ["content", "trigger"]) {
|
|
299
|
-
selector[name] = resolveSelector(
|
|
300
|
-
name,
|
|
301
|
-
defaults.selector[name],
|
|
302
|
-
selector[name]
|
|
303
|
-
);
|
|
304
|
-
}
|
|
305
296
|
return merged;
|
|
306
297
|
}
|
|
307
298
|
async #waitAnimationsFinish() {
|
|
@@ -322,7 +313,7 @@ function waitAnimationFinish(animation) {
|
|
|
322
313
|
* Accordion
|
|
323
314
|
* WAI-ARIA compliant accordion pattern implementation in TypeScript.
|
|
324
315
|
*
|
|
325
|
-
* @version 2.1.
|
|
316
|
+
* @version 2.1.5
|
|
326
317
|
* @author Yusuke Kamiyamane
|
|
327
318
|
* @license MIT
|
|
328
319
|
* @copyright Copyright (c) Yusuke Kamiyamane
|