@idds/js 1.0.51 → 1.0.52
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/dist/index.iife.js +16 -1
- package/dist/index.js +16 -1
- package/package.json +1 -1
package/dist/index.iife.js
CHANGED
|
@@ -85,14 +85,28 @@ var InaUI = (() => {
|
|
|
85
85
|
// src/js/components/stateless/accordion.js
|
|
86
86
|
function initAccordion(rootSelector = `.${PREFIX}-accordion-group`) {
|
|
87
87
|
const accordionGroups = document.querySelectorAll(rootSelector);
|
|
88
|
+
console.log(
|
|
89
|
+
"[InaUI] initAccordion called. Selector:",
|
|
90
|
+
rootSelector,
|
|
91
|
+
"Found groups:",
|
|
92
|
+
accordionGroups.length
|
|
93
|
+
);
|
|
88
94
|
accordionGroups.forEach((group) => {
|
|
89
95
|
const isMultiple = group.getAttribute("data-multiple-open") === "true" || group.getAttribute("data-behavior") === "multiple";
|
|
90
96
|
const accordions = group.querySelectorAll(`:scope > .${PREFIX}-accordion`);
|
|
97
|
+
console.log("[InaUI] Found direct accordions in group:", accordions.length);
|
|
91
98
|
accordions.forEach((accordion, _index) => {
|
|
92
99
|
const toggle = accordion.querySelector(`.${PREFIX}-accordion__toggle`);
|
|
93
100
|
const body = accordion.querySelector(`.${PREFIX}-accordion__content`);
|
|
94
|
-
if (!toggle || !body)
|
|
101
|
+
if (!toggle || !body) {
|
|
102
|
+
console.warn(
|
|
103
|
+
"[InaUI] Accordion item missing toggle or body",
|
|
104
|
+
accordion
|
|
105
|
+
);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
95
108
|
toggle.addEventListener("click", (e) => {
|
|
109
|
+
console.log("[InaUI] Accordion toggle clicked");
|
|
96
110
|
e.stopPropagation();
|
|
97
111
|
const isOpen = accordion.classList.contains(
|
|
98
112
|
`${PREFIX}-accordion--open`
|
|
@@ -152,6 +166,7 @@ var InaUI = (() => {
|
|
|
152
166
|
if (icon) icon.classList.add(`${PREFIX}-accordion__icon--open`);
|
|
153
167
|
body.classList.add(`${PREFIX}-accordion__content--open`);
|
|
154
168
|
if (body) {
|
|
169
|
+
console.log("[InaUI] Setting maxHeight to", body.scrollHeight);
|
|
155
170
|
body.style.maxHeight = `${body.scrollHeight}px`;
|
|
156
171
|
}
|
|
157
172
|
}
|
package/dist/index.js
CHANGED
|
@@ -73,14 +73,28 @@ function initToggle(rootSelector = `.${PREFIX}-toggle`) {
|
|
|
73
73
|
// src/js/components/stateless/accordion.js
|
|
74
74
|
function initAccordion(rootSelector = `.${PREFIX}-accordion-group`) {
|
|
75
75
|
const accordionGroups = document.querySelectorAll(rootSelector);
|
|
76
|
+
console.log(
|
|
77
|
+
"[InaUI] initAccordion called. Selector:",
|
|
78
|
+
rootSelector,
|
|
79
|
+
"Found groups:",
|
|
80
|
+
accordionGroups.length
|
|
81
|
+
);
|
|
76
82
|
accordionGroups.forEach((group) => {
|
|
77
83
|
const isMultiple = group.getAttribute("data-multiple-open") === "true" || group.getAttribute("data-behavior") === "multiple";
|
|
78
84
|
const accordions = group.querySelectorAll(`:scope > .${PREFIX}-accordion`);
|
|
85
|
+
console.log("[InaUI] Found direct accordions in group:", accordions.length);
|
|
79
86
|
accordions.forEach((accordion, _index) => {
|
|
80
87
|
const toggle = accordion.querySelector(`.${PREFIX}-accordion__toggle`);
|
|
81
88
|
const body = accordion.querySelector(`.${PREFIX}-accordion__content`);
|
|
82
|
-
if (!toggle || !body)
|
|
89
|
+
if (!toggle || !body) {
|
|
90
|
+
console.warn(
|
|
91
|
+
"[InaUI] Accordion item missing toggle or body",
|
|
92
|
+
accordion
|
|
93
|
+
);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
83
96
|
toggle.addEventListener("click", (e) => {
|
|
97
|
+
console.log("[InaUI] Accordion toggle clicked");
|
|
84
98
|
e.stopPropagation();
|
|
85
99
|
const isOpen = accordion.classList.contains(
|
|
86
100
|
`${PREFIX}-accordion--open`
|
|
@@ -140,6 +154,7 @@ function openItem(accordion, toggle, body) {
|
|
|
140
154
|
if (icon) icon.classList.add(`${PREFIX}-accordion__icon--open`);
|
|
141
155
|
body.classList.add(`${PREFIX}-accordion__content--open`);
|
|
142
156
|
if (body) {
|
|
157
|
+
console.log("[InaUI] Setting maxHeight to", body.scrollHeight);
|
|
143
158
|
body.style.maxHeight = `${body.scrollHeight}px`;
|
|
144
159
|
}
|
|
145
160
|
}
|