@dso-toolkit/core 48.0.0 → 49.0.1
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/cjs/dso-accordion-section.cjs.entry.js +72 -14
- package/dist/cjs/dso-accordion.cjs.entry.js +24 -4
- package/dist/cjs/dso-toolkit.cjs.js +1 -1
- package/dist/cjs/dso-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/accordion/accordion.js +29 -6
- package/dist/collection/components/accordion/components/accordion-section.js +93 -10
- package/dist/collection/components/accordion/components/handles/heading.handle.js +5 -5
- package/dist/collection/components/icon/icon.js +95 -95
- package/dist/collection/components/tooltip/tooltip.js +1 -1
- package/dist/components/dso-accordion-section.js +74 -15
- package/dist/components/dso-accordion.js +24 -4
- package/dist/components/tooltip.js +1 -1
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/p-bcd19ae7.entry.js +1 -0
- package/dist/dso-toolkit/{p-ec5412aa.entry.js → p-d8ba8db6.entry.js} +1 -1
- package/dist/esm/dso-accordion-section.entry.js +72 -14
- package/dist/esm/dso-accordion.entry.js +24 -4
- package/dist/esm/dso-toolkit.js +1 -1
- package/dist/esm/dso-tooltip.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/accordion/accordion.d.ts +7 -2
- package/dist/types/components/accordion/accordion.interfaces.d.ts +6 -1
- package/dist/types/components/accordion/components/accordion-section.d.ts +10 -3
- package/dist/types/components/accordion/components/handles/heading.handle.d.ts +1 -0
- package/dist/types/components/tree-view/tree-item.d.ts +1 -1
- package/dist/types/components.d.ts +9 -4
- package/package.json +13 -18
- package/dist/dso-toolkit/p-39a33b89.entry.js +0 -1
|
@@ -1327,17 +1327,17 @@ const HandleElement = ({ handleUrl, onClick, open }, children) => {
|
|
|
1327
1327
|
return (index.h("button", { type: "button", onClick: onClick, "aria-expanded": open ? "true" : "false" }, children));
|
|
1328
1328
|
};
|
|
1329
1329
|
|
|
1330
|
-
const Handle = ({ heading }, children) => {
|
|
1330
|
+
const Handle = ({ heading, ref }, children) => {
|
|
1331
1331
|
switch (heading) {
|
|
1332
1332
|
default:
|
|
1333
1333
|
case "h2":
|
|
1334
|
-
return index.h("h2", { class: "dso-section-handle" }, children);
|
|
1334
|
+
return (index.h("h2", { ref: ref, class: "dso-section-handle" }, children));
|
|
1335
1335
|
case "h3":
|
|
1336
|
-
return index.h("h3", { class: "dso-section-handle" }, children);
|
|
1336
|
+
return (index.h("h3", { ref: ref, class: "dso-section-handle" }, children));
|
|
1337
1337
|
case "h4":
|
|
1338
|
-
return index.h("h4", { class: "dso-section-handle" }, children);
|
|
1338
|
+
return (index.h("h4", { ref: ref, class: "dso-section-handle" }, children));
|
|
1339
1339
|
case "h5":
|
|
1340
|
-
return index.h("h5", { class: "dso-section-handle" }, children);
|
|
1340
|
+
return (index.h("h5", { ref: ref, class: "dso-section-handle" }, children));
|
|
1341
1341
|
}
|
|
1342
1342
|
};
|
|
1343
1343
|
|
|
@@ -1396,7 +1396,7 @@ const AccordionSection = class {
|
|
|
1396
1396
|
index.forceUpdate(this.host);
|
|
1397
1397
|
});
|
|
1398
1398
|
}
|
|
1399
|
-
this.
|
|
1399
|
+
this.prepareAnimationResizeObserver();
|
|
1400
1400
|
}
|
|
1401
1401
|
componentDidLoad() {
|
|
1402
1402
|
var _a, _b;
|
|
@@ -1409,15 +1409,65 @@ const AccordionSection = class {
|
|
|
1409
1409
|
var _a;
|
|
1410
1410
|
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
1411
1411
|
}
|
|
1412
|
-
/** Toggle this section
|
|
1413
|
-
|
|
1412
|
+
/** Toggle this section.
|
|
1413
|
+
* @param scrollIntoView boolean - defaults to true
|
|
1414
|
+
*/
|
|
1415
|
+
async toggleSection(scrollIntoView = true) {
|
|
1414
1416
|
var _a;
|
|
1415
|
-
|
|
1417
|
+
await ((_a = this.accordion) === null || _a === void 0 ? void 0 : _a.toggleSection(this.host).then(async () => {
|
|
1418
|
+
if (scrollIntoView) {
|
|
1419
|
+
await this.scrollIntoViewWhenNeeded(true);
|
|
1420
|
+
}
|
|
1421
|
+
}));
|
|
1422
|
+
}
|
|
1423
|
+
/** Scroll this section into view when needed. */
|
|
1424
|
+
async scrollSectionIntoView() {
|
|
1425
|
+
await this.scrollIntoViewWhenNeeded(false);
|
|
1426
|
+
}
|
|
1427
|
+
async scrollIntoViewWhenNeeded(sectionToggled) {
|
|
1428
|
+
var _a, _b, _c;
|
|
1429
|
+
AccordionSection.scrollCandidate = undefined;
|
|
1430
|
+
const bodyClientRect = (_a = this.sectionBody) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
1431
|
+
const headingClientRect = (_b = this.sectionHeading) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
|
|
1432
|
+
if (!bodyClientRect || !headingClientRect || !this.accordionState) {
|
|
1433
|
+
return;
|
|
1434
|
+
}
|
|
1435
|
+
const waitForAnimationBeforeScrolling = (state) => {
|
|
1436
|
+
var _a;
|
|
1437
|
+
const sectionBottomOffsetTop = this.host.offsetTop + headingClientRect.height + (this.open ? (_a = this.bodyHeight) !== null && _a !== void 0 ? _a : 0 : 0);
|
|
1438
|
+
return (sectionToggled && (sectionBottomOffsetTop > document.documentElement.scrollHeight || state.allowMultipleOpen));
|
|
1439
|
+
};
|
|
1440
|
+
if (waitForAnimationBeforeScrolling(this.accordionState)) {
|
|
1441
|
+
AccordionSection.scrollCandidate = this.host;
|
|
1442
|
+
return;
|
|
1443
|
+
}
|
|
1444
|
+
// this y is relative to the top of the viewport.
|
|
1445
|
+
const sectionBottomY = headingClientRect.top + headingClientRect.height + (this.open ? (_c = this.bodyHeight) !== null && _c !== void 0 ? _c : 0 : 0);
|
|
1446
|
+
if (sectionBottomY > window.innerHeight) {
|
|
1447
|
+
const expandedAccordionHeight = sectionBottomY - headingClientRect.top;
|
|
1448
|
+
const shouldScrollToTopOfSection = expandedAccordionHeight > window.innerHeight;
|
|
1449
|
+
window.scrollTo({
|
|
1450
|
+
top: shouldScrollToTopOfSection
|
|
1451
|
+
? this.host.offsetTop
|
|
1452
|
+
: this.host.offsetTop - (window.innerHeight - expandedAccordionHeight),
|
|
1453
|
+
behavior: "smooth",
|
|
1454
|
+
});
|
|
1455
|
+
}
|
|
1456
|
+
else if (headingClientRect.top < 0) {
|
|
1457
|
+
window.scrollTo({
|
|
1458
|
+
top: this.host.offsetTop,
|
|
1459
|
+
behavior: "smooth",
|
|
1460
|
+
});
|
|
1461
|
+
}
|
|
1416
1462
|
}
|
|
1417
1463
|
async toggle(e) {
|
|
1418
1464
|
var _a;
|
|
1419
1465
|
e === null || e === void 0 ? void 0 : e.preventDefault();
|
|
1420
|
-
|
|
1466
|
+
(_a = this.accordion) === null || _a === void 0 ? void 0 : _a.toggleSection(this.host, e).then(async (isOpen) => {
|
|
1467
|
+
if (isOpen) {
|
|
1468
|
+
await this.scrollIntoViewWhenNeeded(true);
|
|
1469
|
+
}
|
|
1470
|
+
});
|
|
1421
1471
|
}
|
|
1422
1472
|
render() {
|
|
1423
1473
|
var _a;
|
|
@@ -1428,12 +1478,14 @@ const AccordionSection = class {
|
|
|
1428
1478
|
["dso-accordion-" + variant]: true,
|
|
1429
1479
|
"dso-nested-accordion": this.hasNestedSection,
|
|
1430
1480
|
"dso-accordion-reverse-align": reverseAlign !== null && reverseAlign !== void 0 ? reverseAlign : false,
|
|
1431
|
-
}, hidden: !variant }, index.h(Handle, { heading: this.heading }, index.h(HandleElement, { handleUrl: this.handleUrl, onClick: async (event) => await this.toggle(event), open: this.open }, reverseAlign ? (index.h(index.Fragment, null, hasAddons && (index.h("div", { class: "dso-section-handle-addons" }, index.h(HandleIcon, { icon: this.icon }))), index.h("span", null, this.handleTitle), index.h("dso-icon", { class: "dso-section-handle-chevron", icon: "chevron-down" }))) : (index.h(index.Fragment, null, index.h("dso-icon", { class: "dso-section-handle-chevron", icon: "chevron-right" }), this.state && index.h("span", { class: "sr-only" }, stateMap[this.state]), index.h("span", null, this.handleTitle), hasAddons && (index.h("div", { class: "dso-section-handle-addons" }, this.status && index.h("span", { class: "dso-status" }, this.status), index.h(HandleIcon, { state: this.state, icon: this.icon, attachmentCount: this.attachmentCount }))))))), index.h("div", { class: { "dso-section-body": true, "dso-animate-ready": !!this.animeInstance }, ref: (element) => (this.sectionBody = element), "aria-hidden": this.open ? "false" : "true" }, index.h("div", { class: "dso-section-body-content" }, index.h("slot", null)))));
|
|
1481
|
+
}, hidden: !variant }, index.h(Handle, { heading: this.heading, ref: (element) => (this.sectionHeading = element) }, index.h(HandleElement, { handleUrl: this.handleUrl, onClick: async (event) => await this.toggle(event), open: this.open }, reverseAlign ? (index.h(index.Fragment, null, hasAddons && (index.h("div", { class: "dso-section-handle-addons" }, index.h(HandleIcon, { icon: this.icon }))), index.h("span", null, this.handleTitle), index.h("dso-icon", { class: "dso-section-handle-chevron", icon: "chevron-down" }))) : (index.h(index.Fragment, null, index.h("dso-icon", { class: "dso-section-handle-chevron", icon: "chevron-right" }), this.state && index.h("span", { class: "sr-only" }, stateMap[this.state]), index.h("span", null, this.handleTitle), hasAddons && (index.h("div", { class: "dso-section-handle-addons" }, this.status && index.h("span", { class: "dso-status" }, this.status), index.h(HandleIcon, { state: this.state, icon: this.icon, attachmentCount: this.attachmentCount }))))))), index.h("div", { class: { "dso-section-body": true, "dso-animate-ready": !!this.animeInstance }, ref: (element) => (this.sectionBody = element), "aria-hidden": this.open ? "false" : "true" }, index.h("div", { class: "dso-section-body-content" }, index.h("slot", null)))));
|
|
1432
1482
|
}
|
|
1433
|
-
|
|
1483
|
+
prepareAnimationResizeObserver() {
|
|
1434
1484
|
this.resizeObserver = new ResizeObserver(index$1.debounce_1(([entry]) => {
|
|
1435
|
-
|
|
1436
|
-
|
|
1485
|
+
// entry.contentRect does not include padding, so we use getBoundingClientRect.
|
|
1486
|
+
const height = entry.target.getBoundingClientRect().height;
|
|
1487
|
+
if (this.bodyHeight !== height) {
|
|
1488
|
+
this.bodyHeight = height;
|
|
1437
1489
|
this.instantiateAnimation();
|
|
1438
1490
|
}
|
|
1439
1491
|
}, 150));
|
|
@@ -1446,6 +1498,12 @@ const AccordionSection = class {
|
|
|
1446
1498
|
duration: 260,
|
|
1447
1499
|
autoplay: false,
|
|
1448
1500
|
direction: "normal",
|
|
1501
|
+
changeComplete: async () => {
|
|
1502
|
+
if (AccordionSection.scrollCandidate === this.host) {
|
|
1503
|
+
AccordionSection.scrollCandidate = undefined;
|
|
1504
|
+
await this.scrollSectionIntoView();
|
|
1505
|
+
}
|
|
1506
|
+
},
|
|
1449
1507
|
begin: () => {
|
|
1450
1508
|
if (this.sectionBody) {
|
|
1451
1509
|
if (this.open) {
|
|
@@ -207,6 +207,7 @@ const Accordion = class {
|
|
|
207
207
|
const { state } = createStore({
|
|
208
208
|
variant: this.variant || "default",
|
|
209
209
|
reverseAlign: this.reverseAlign,
|
|
210
|
+
allowMultipleOpen: this.allowMultipleOpen,
|
|
210
211
|
});
|
|
211
212
|
this.accordionState = state;
|
|
212
213
|
}
|
|
@@ -216,6 +217,9 @@ const Accordion = class {
|
|
|
216
217
|
updateReverseAlign(reverseAlign) {
|
|
217
218
|
this.accordionState.reverseAlign = reverseAlign;
|
|
218
219
|
}
|
|
220
|
+
updateAllowMultipleOpen(allowMultipleOpen) {
|
|
221
|
+
this.accordionState.allowMultipleOpen = allowMultipleOpen;
|
|
222
|
+
}
|
|
219
223
|
watchAllowMultiple(allowMultipleOpen) {
|
|
220
224
|
if (!allowMultipleOpen) {
|
|
221
225
|
const openSections = Array.from(this.host.querySelectorAll(":scope > dso-accordion-section[open]"));
|
|
@@ -227,7 +231,10 @@ const Accordion = class {
|
|
|
227
231
|
async getState() {
|
|
228
232
|
return this.accordionState;
|
|
229
233
|
}
|
|
230
|
-
/** Toggle a section. Pass the `<dso-accordion-section>` element or the index of the section
|
|
234
|
+
/** Toggle a section. Pass the `<dso-accordion-section>` element or the index of the section.\
|
|
235
|
+
* returns `undefined` when no section is toggled.\
|
|
236
|
+
* returns `true` when the section is opened and `false` when the section is closed.
|
|
237
|
+
*/
|
|
231
238
|
async toggleSection(sectionElement, event) {
|
|
232
239
|
const sections = Array.from(this.host.querySelectorAll(":scope > dso-accordion-section"));
|
|
233
240
|
if (typeof sectionElement === "number") {
|
|
@@ -240,16 +247,17 @@ const Accordion = class {
|
|
|
240
247
|
if (this.allowMultipleOpen) {
|
|
241
248
|
this.controlOpenAttribute(sectionElement, !sectionIsOpen);
|
|
242
249
|
this.emitToggleEvent(sectionElement, sections, event);
|
|
243
|
-
return;
|
|
250
|
+
return !sectionIsOpen;
|
|
244
251
|
}
|
|
245
252
|
if (sectionIsOpen) {
|
|
246
253
|
this.controlOpenAttribute(sectionElement, false);
|
|
247
254
|
this.emitToggleEvent(sectionElement, sections, event);
|
|
248
|
-
return;
|
|
255
|
+
return false;
|
|
249
256
|
}
|
|
250
257
|
await this.closeOpenSections();
|
|
251
258
|
this.controlOpenAttribute(sectionElement, true);
|
|
252
259
|
this.emitToggleEvent(sectionElement, sections, event);
|
|
260
|
+
return true;
|
|
253
261
|
}
|
|
254
262
|
/** Closes all sections belonging to this accordion. */
|
|
255
263
|
async closeOpenSections() {
|
|
@@ -257,6 +265,18 @@ const Accordion = class {
|
|
|
257
265
|
const openSections = sections.filter((s) => this.isSectionOpen(s));
|
|
258
266
|
openSections.forEach((section) => this.controlOpenAttribute(section, false));
|
|
259
267
|
}
|
|
268
|
+
// These checks are needed for a React timing issue.
|
|
269
|
+
componentWillLoad() {
|
|
270
|
+
if (this.accordionState.variant !== this.variant) {
|
|
271
|
+
this.accordionState.variant = this.variant || "default";
|
|
272
|
+
}
|
|
273
|
+
if (this.accordionState.reverseAlign !== this.reverseAlign) {
|
|
274
|
+
this.accordionState.reverseAlign = this.reverseAlign;
|
|
275
|
+
}
|
|
276
|
+
if (this.accordionState.allowMultipleOpen !== this.allowMultipleOpen) {
|
|
277
|
+
this.accordionState.allowMultipleOpen = this.allowMultipleOpen;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
260
280
|
render() {
|
|
261
281
|
return (index.h(index.Host, { class: {
|
|
262
282
|
"dso-accordion": true,
|
|
@@ -287,7 +307,7 @@ const Accordion = class {
|
|
|
287
307
|
static get watchers() { return {
|
|
288
308
|
"variant": ["updateVariant"],
|
|
289
309
|
"reverseAlign": ["updateReverseAlign"],
|
|
290
|
-
"allowMultipleOpen": ["watchAllowMultiple"]
|
|
310
|
+
"allowMultipleOpen": ["updateAllowMultipleOpen", "watchAllowMultiple"]
|
|
291
311
|
}; }
|
|
292
312
|
};
|
|
293
313
|
Accordion.style = accordionCss;
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["dso-icon.cjs",[[1,"dso-icon",{"icon":[1]}]]],["dso-map-base-layers.cjs",[[1,"dso-map-base-layers",{"group":[1],"baseLayers":[16]}]]],["dso-map-overlays.cjs",[[1,"dso-map-overlays",{"group":[1],"overlays":[16]}]]],["dso-toggletip.cjs",[[1,"dso-toggletip",{"label":[1],"position":[1],"small":[4],"secondary":[4],"active":[32]}]]],["dso-header.cjs",[[6,"dso-header",{"mainMenu":[16],"useDropDownMenu":[1,"use-drop-down-menu"],"authStatus":[1,"auth-status"],"loginUrl":[1,"login-url"],"logoutUrl":[1,"logout-url"],"userProfileName":[1,"user-profile-name"],"userProfileUrl":[1,"user-profile-url"],"userHomeUrl":[1,"user-home-url"],"showDropDown":[32],"hasSubLogo":[32],"overflowMenuItems":[32]}]]],["dso-label.cjs",[[1,"dso-label",{"compact":[4],"removable":[4],"status":[1],"truncate":[4],"removeHover":[32],"removeFocus":[32],"textHover":[32],"textFocus":[32],"truncatedContent":[32],"labelText":[32]}]]],["dso-pagination.cjs",[[1,"dso-pagination",{"totalPages":[2,"total-pages"],"currentPage":[2,"current-page"],"formatHref":[16],"availablePositions":[32]},[[0,"dsoSizeChange","sizeChangeHandler"]]]]],["dso-tree-view.cjs",[[1,"dso-tree-view",{"collection":[16],"focusItem":[64]}]]],["dso-accordion-section.cjs",[[1,"dso-accordion-section",{"handleTitle":[1,"handle-title"],"heading":[1],"handleUrl":[1,"handle-url"],"state":[1],"attachmentCount":[2,"attachment-count"],"icon":[1],"status":[1],"open":[1540],"hasNestedSection":[32],"toggleSection":[64]}]]],["dso-alert.cjs",[[1,"dso-alert",{"status":[1],"roleAlert":[4,"role-alert"]}]]],["dso-attachments-counter.cjs",[[1,"dso-attachments-counter",{"count":[2]}]]],["dso-autosuggest.cjs",[[6,"dso-autosuggest",{"suggestions":[16],"loading":[4],"loadingLabel":[1,"loading-label"],"loadingDelayed":[2,"loading-delayed"],"notFoundLabel":[1,"not-found-label"],"suggestOnFocus":[4,"suggest-on-focus"],"showSuggestions":[32],"selectedSuggestion":[32],"notFound":[32],"showLoading":[32]},[[4,"click","onDocumentClick"]]]]],["dso-date-picker.cjs",[[2,"dso-date-picker",{"name":[1],"identifier":[1],"disabled":[516],"role":[1],"direction":[1],"required":[4],"dsoAutofocus":[4,"dso-autofocus"],"value":[1537],"min":[1],"max":[1],"activeFocus":[32],"focusedDay":[32],"open":[32],"visible":[32],"setFocus":[64],"show":[64],"hide":[64]},[[6,"click","handleDocumentClick"]]]]],["dso-helpcenter-panel.cjs",[[1,"dso-helpcenter-panel",{"label":[1],"url":[1],"visibility":[32],"isOpen":[32],"slideState":[32],"loadIframe":[32]},[[8,"keydown","keyDownListener"]]]]],["dso-image-overlay.cjs",[[1,"dso-image-overlay",{"active":[32],"focused":[32],"zoomable":[32]},[[2,"load","loadListener"]]]]],["dso-map-controls.cjs",[[1,"dso-map-controls",{"open":[1540],"disableZoom":[1,"disable-zoom"],"hideContent":[32]}]]],["dso-modal.cjs",[[1,"dso-modal",{"modalTitle":[1,"modal-title"],"role":[1],"showCloseButton":[4,"show-close-button"],"ariaId":[32],"hasFooter":[32]}]]],["dso-table.cjs",[[1,"dso-table",{"noModal":[516,"no-modal"],"isResponsive":[516,"is-responsive"],"modalActive":[32],"placeholderHeight":[32]}]]],["dso-viewer-grid.cjs",[[1,"dso-viewer-grid",{"filterpanelOpen":[516,"filterpanel-open"],"overlayOpen":[516,"overlay-open"],"initialMainSize":[1,"initial-main-size"],"mainSize":[32]}]]],["dso-accordion.cjs",[[1,"dso-accordion",{"variant":[513],"reverseAlign":[516,"reverse-align"],"allowMultipleOpen":[516,"allow-multiple-open"],"getState":[64],"toggleSection":[64],"closeOpenSections":[64]}]]],["dso-badge.cjs",[[1,"dso-badge",{"status":[1]}]]],["dso-banner.cjs",[[1,"dso-banner",{"status":[513]}]]],["dso-card.cjs",[[1,"dso-card",{"isSelectable":[516,"is-selectable"],"hasImage":[516,"has-image"]}]]],["dso-card-container.cjs",[[1,"dso-card-container",{"mode":[513]}]]],["dso-highlight-box.cjs",[[1,"dso-highlight-box",{"yellow":[4],"border":[4],"white":[4],"dropShadow":[4,"drop-shadow"],"step":[2]}]]],["dso-ozon-content.cjs",[[6,"dso-ozon-content",{"content":[1],"inline":[516],"deleted":[516],"interactive":[520],"state":[32]}]]],["dso-progress-bar.cjs",[[1,"dso-progress-bar",{"progress":[2],"min":[2],"max":[2]}]]],["dso-dropdown-menu.cjs",[[1,"dso-dropdown-menu",{"open":[1540],"dropdownAlign":[1,"dropdown-align"],"checkable":[4]}]]],["dso-responsive-element.cjs",[[1,"dso-responsive-element",{"sizeAlias":[32],"sizeWidth":[32],"getSize":[64]}]]],["dso-progress-indicator.cjs",[[1,"dso-progress-indicator",{"label":[1],"size":[513],"block":[4]}]]],["dso-tooltip.cjs",[[1,"dso-tooltip",{"descriptive":[516],"position":[1],"strategy":[1],"noArrow":[4,"no-arrow"],"stateless":[4],"small":[4],"active":[1540],"hidden":[32],"activate":[64],"deactivate":[64]},[[0,"click","listenClick"]]]]],["dso-info-button.cjs",[[1,"dso-info-button",{"active":[1540],"secondary":[4],"label":[1],"hover":[32],"setFocus":[64]}]]],["dso-info_2.cjs",[[6,"dso-selectable",{"type":[1],"identifier":[1],"name":[1],"value":[1],"invalid":[4],"describedById":[1,"described-by-id"],"disabled":[4],"required":[4],"checked":[4],"indeterminate":[4],"infoFixed":[4,"info-fixed"],"infoActive":[32],"toggleInfo":[64]}],[1,"dso-info",{"fixed":[516],"active":[516]}]]]], options);
|
|
18
|
+
return index.bootstrapLazy([["dso-icon.cjs",[[1,"dso-icon",{"icon":[1]}]]],["dso-map-base-layers.cjs",[[1,"dso-map-base-layers",{"group":[1],"baseLayers":[16]}]]],["dso-map-overlays.cjs",[[1,"dso-map-overlays",{"group":[1],"overlays":[16]}]]],["dso-toggletip.cjs",[[1,"dso-toggletip",{"label":[1],"position":[1],"small":[4],"secondary":[4],"active":[32]}]]],["dso-header.cjs",[[6,"dso-header",{"mainMenu":[16],"useDropDownMenu":[1,"use-drop-down-menu"],"authStatus":[1,"auth-status"],"loginUrl":[1,"login-url"],"logoutUrl":[1,"logout-url"],"userProfileName":[1,"user-profile-name"],"userProfileUrl":[1,"user-profile-url"],"userHomeUrl":[1,"user-home-url"],"showDropDown":[32],"hasSubLogo":[32],"overflowMenuItems":[32]}]]],["dso-label.cjs",[[1,"dso-label",{"compact":[4],"removable":[4],"status":[1],"truncate":[4],"removeHover":[32],"removeFocus":[32],"textHover":[32],"textFocus":[32],"truncatedContent":[32],"labelText":[32]}]]],["dso-pagination.cjs",[[1,"dso-pagination",{"totalPages":[2,"total-pages"],"currentPage":[2,"current-page"],"formatHref":[16],"availablePositions":[32]},[[0,"dsoSizeChange","sizeChangeHandler"]]]]],["dso-tree-view.cjs",[[1,"dso-tree-view",{"collection":[16],"focusItem":[64]}]]],["dso-accordion-section.cjs",[[1,"dso-accordion-section",{"handleTitle":[1,"handle-title"],"heading":[1],"handleUrl":[1,"handle-url"],"state":[1],"attachmentCount":[2,"attachment-count"],"icon":[1],"status":[1],"open":[1540],"hasNestedSection":[32],"toggleSection":[64],"scrollSectionIntoView":[64]}]]],["dso-alert.cjs",[[1,"dso-alert",{"status":[1],"roleAlert":[4,"role-alert"]}]]],["dso-attachments-counter.cjs",[[1,"dso-attachments-counter",{"count":[2]}]]],["dso-autosuggest.cjs",[[6,"dso-autosuggest",{"suggestions":[16],"loading":[4],"loadingLabel":[1,"loading-label"],"loadingDelayed":[2,"loading-delayed"],"notFoundLabel":[1,"not-found-label"],"suggestOnFocus":[4,"suggest-on-focus"],"showSuggestions":[32],"selectedSuggestion":[32],"notFound":[32],"showLoading":[32]},[[4,"click","onDocumentClick"]]]]],["dso-date-picker.cjs",[[2,"dso-date-picker",{"name":[1],"identifier":[1],"disabled":[516],"role":[1],"direction":[1],"required":[4],"dsoAutofocus":[4,"dso-autofocus"],"value":[1537],"min":[1],"max":[1],"activeFocus":[32],"focusedDay":[32],"open":[32],"visible":[32],"setFocus":[64],"show":[64],"hide":[64]},[[6,"click","handleDocumentClick"]]]]],["dso-helpcenter-panel.cjs",[[1,"dso-helpcenter-panel",{"label":[1],"url":[1],"visibility":[32],"isOpen":[32],"slideState":[32],"loadIframe":[32]},[[8,"keydown","keyDownListener"]]]]],["dso-image-overlay.cjs",[[1,"dso-image-overlay",{"active":[32],"focused":[32],"zoomable":[32]},[[2,"load","loadListener"]]]]],["dso-map-controls.cjs",[[1,"dso-map-controls",{"open":[1540],"disableZoom":[1,"disable-zoom"],"hideContent":[32]}]]],["dso-modal.cjs",[[1,"dso-modal",{"modalTitle":[1,"modal-title"],"role":[1],"showCloseButton":[4,"show-close-button"],"ariaId":[32],"hasFooter":[32]}]]],["dso-table.cjs",[[1,"dso-table",{"noModal":[516,"no-modal"],"isResponsive":[516,"is-responsive"],"modalActive":[32],"placeholderHeight":[32]}]]],["dso-viewer-grid.cjs",[[1,"dso-viewer-grid",{"filterpanelOpen":[516,"filterpanel-open"],"overlayOpen":[516,"overlay-open"],"initialMainSize":[1,"initial-main-size"],"mainSize":[32]}]]],["dso-accordion.cjs",[[1,"dso-accordion",{"variant":[513],"reverseAlign":[516,"reverse-align"],"allowMultipleOpen":[516,"allow-multiple-open"],"getState":[64],"toggleSection":[64],"closeOpenSections":[64]}]]],["dso-badge.cjs",[[1,"dso-badge",{"status":[1]}]]],["dso-banner.cjs",[[1,"dso-banner",{"status":[513]}]]],["dso-card.cjs",[[1,"dso-card",{"isSelectable":[516,"is-selectable"],"hasImage":[516,"has-image"]}]]],["dso-card-container.cjs",[[1,"dso-card-container",{"mode":[513]}]]],["dso-highlight-box.cjs",[[1,"dso-highlight-box",{"yellow":[4],"border":[4],"white":[4],"dropShadow":[4,"drop-shadow"],"step":[2]}]]],["dso-ozon-content.cjs",[[6,"dso-ozon-content",{"content":[1],"inline":[516],"deleted":[516],"interactive":[520],"state":[32]}]]],["dso-progress-bar.cjs",[[1,"dso-progress-bar",{"progress":[2],"min":[2],"max":[2]}]]],["dso-dropdown-menu.cjs",[[1,"dso-dropdown-menu",{"open":[1540],"dropdownAlign":[1,"dropdown-align"],"checkable":[4]}]]],["dso-responsive-element.cjs",[[1,"dso-responsive-element",{"sizeAlias":[32],"sizeWidth":[32],"getSize":[64]}]]],["dso-progress-indicator.cjs",[[1,"dso-progress-indicator",{"label":[1],"size":[513],"block":[4]}]]],["dso-tooltip.cjs",[[1,"dso-tooltip",{"descriptive":[516],"position":[1],"strategy":[1],"noArrow":[4,"no-arrow"],"stateless":[4],"small":[4],"active":[1540],"hidden":[32],"activate":[64],"deactivate":[64]},[[0,"click","listenClick"]]]]],["dso-info-button.cjs",[[1,"dso-info-button",{"active":[1540],"secondary":[4],"label":[1],"hover":[32],"setFocus":[64]}]]],["dso-info_2.cjs",[[6,"dso-selectable",{"type":[1],"identifier":[1],"name":[1],"value":[1],"invalid":[4],"describedById":[1,"described-by-id"],"disabled":[4],"required":[4],"checked":[4],"indeterminate":[4],"infoFixed":[4,"info-fixed"],"infoActive":[32],"toggleInfo":[64]}],[1,"dso-info",{"fixed":[516],"active":[516]}]]]], options);
|
|
19
19
|
});
|
|
@@ -1839,7 +1839,7 @@ var maxSize = {
|
|
|
1839
1839
|
|
|
1840
1840
|
const tooltipCss = ":host(.hidden){visibility:hidden}:host-context(dso-toggletip){color:red !important}:host-context(dso-toggletip) *[data-popper-placement=top] .tooltip-arrow{margin-left:3px}:host-context(dso-toggletip) *[data-popper-placement=right] .tooltip-arrow{margin-top:0}:host-context(dso-toggletip) *[data-popper-placement=bottom] .tooltip-arrow{margin-left:3px}:host-context(dso-toggletip) *[data-popper-placement=left]{margin-right:-8px !important}:host-context(dso-toggletip) *[data-popper-placement=left] .tooltip-arrow{margin-top:0}*,*::after,*::before{box-sizing:border-box}.tooltip{font-family:Asap, sans-serif;font-style:normal;font-weight:400;line-height:1.5;line-break:auto;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;display:block;filter:drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));font-size:14px;opacity:0;position:absolute;transition:opacity 0.15s linear;z-index:410}.tooltip.in{opacity:1}.tooltip .tooltip-inner{background-color:#fff;border-radius:4px;color:#191919;display:inline-block;font-size:1rem;max-width:640px;padding:8px 16px;position:relative}.tooltip .tooltip-inner.dso-small{max-width:320px}.tooltip .tooltip-arrow{border-color:transparent;border-style:solid;height:0;width:0}.tooltip[data-popper-placement=top]{margin-top:-3px;padding:6px 0}.tooltip[data-popper-placement=top] .tooltip-arrow{border-top-color:#fff;border-width:6px 6px 0;bottom:0}.tooltip[data-popper-placement=top] .tooltip-arrow{margin-left:-3px}.tooltip[data-popper-placement=right]{margin-left:3px;padding:0 6px}.tooltip[data-popper-placement=right] .tooltip-arrow{border-right-color:#fff;border-width:6px 6px 6px 0;left:0}.tooltip[data-popper-placement=right] .tooltip-arrow{margin-top:-3px}.tooltip[data-popper-placement=bottom]{margin-top:3px;padding:6px 0}.tooltip[data-popper-placement=bottom] .tooltip-arrow{border-bottom-color:#fff;border-width:0 6px 6px;top:0}.tooltip[data-popper-placement=bottom] .tooltip-arrow{margin-left:-3px}.tooltip[data-popper-placement=left]{margin-left:-3px;padding:0 6px}.tooltip[data-popper-placement=left] .tooltip-arrow{border-left-color:#fff;border-width:6px 0 6px 6px;right:0}.tooltip[data-popper-placement=left] .tooltip-arrow{margin-top:-3px}";
|
|
1841
1841
|
|
|
1842
|
-
// Keep const in sync with $tooltip-transition-duration in
|
|
1842
|
+
// Keep const in sync with $tooltip-transition-duration in dso-toolkit/src/components/tooltip/tooltip.scss tooltip_root() mixin
|
|
1843
1843
|
const transitionDuration = 150;
|
|
1844
1844
|
function hasOverflow(el) {
|
|
1845
1845
|
const style = window.getComputedStyle(el);
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["dso-icon.cjs",[[1,"dso-icon",{"icon":[1]}]]],["dso-map-base-layers.cjs",[[1,"dso-map-base-layers",{"group":[1],"baseLayers":[16]}]]],["dso-map-overlays.cjs",[[1,"dso-map-overlays",{"group":[1],"overlays":[16]}]]],["dso-toggletip.cjs",[[1,"dso-toggletip",{"label":[1],"position":[1],"small":[4],"secondary":[4],"active":[32]}]]],["dso-header.cjs",[[6,"dso-header",{"mainMenu":[16],"useDropDownMenu":[1,"use-drop-down-menu"],"authStatus":[1,"auth-status"],"loginUrl":[1,"login-url"],"logoutUrl":[1,"logout-url"],"userProfileName":[1,"user-profile-name"],"userProfileUrl":[1,"user-profile-url"],"userHomeUrl":[1,"user-home-url"],"showDropDown":[32],"hasSubLogo":[32],"overflowMenuItems":[32]}]]],["dso-label.cjs",[[1,"dso-label",{"compact":[4],"removable":[4],"status":[1],"truncate":[4],"removeHover":[32],"removeFocus":[32],"textHover":[32],"textFocus":[32],"truncatedContent":[32],"labelText":[32]}]]],["dso-pagination.cjs",[[1,"dso-pagination",{"totalPages":[2,"total-pages"],"currentPage":[2,"current-page"],"formatHref":[16],"availablePositions":[32]},[[0,"dsoSizeChange","sizeChangeHandler"]]]]],["dso-tree-view.cjs",[[1,"dso-tree-view",{"collection":[16],"focusItem":[64]}]]],["dso-accordion-section.cjs",[[1,"dso-accordion-section",{"handleTitle":[1,"handle-title"],"heading":[1],"handleUrl":[1,"handle-url"],"state":[1],"attachmentCount":[2,"attachment-count"],"icon":[1],"status":[1],"open":[1540],"hasNestedSection":[32],"toggleSection":[64]}]]],["dso-alert.cjs",[[1,"dso-alert",{"status":[1],"roleAlert":[4,"role-alert"]}]]],["dso-attachments-counter.cjs",[[1,"dso-attachments-counter",{"count":[2]}]]],["dso-autosuggest.cjs",[[6,"dso-autosuggest",{"suggestions":[16],"loading":[4],"loadingLabel":[1,"loading-label"],"loadingDelayed":[2,"loading-delayed"],"notFoundLabel":[1,"not-found-label"],"suggestOnFocus":[4,"suggest-on-focus"],"showSuggestions":[32],"selectedSuggestion":[32],"notFound":[32],"showLoading":[32]},[[4,"click","onDocumentClick"]]]]],["dso-date-picker.cjs",[[2,"dso-date-picker",{"name":[1],"identifier":[1],"disabled":[516],"role":[1],"direction":[1],"required":[4],"dsoAutofocus":[4,"dso-autofocus"],"value":[1537],"min":[1],"max":[1],"activeFocus":[32],"focusedDay":[32],"open":[32],"visible":[32],"setFocus":[64],"show":[64],"hide":[64]},[[6,"click","handleDocumentClick"]]]]],["dso-helpcenter-panel.cjs",[[1,"dso-helpcenter-panel",{"label":[1],"url":[1],"visibility":[32],"isOpen":[32],"slideState":[32],"loadIframe":[32]},[[8,"keydown","keyDownListener"]]]]],["dso-image-overlay.cjs",[[1,"dso-image-overlay",{"active":[32],"focused":[32],"zoomable":[32]},[[2,"load","loadListener"]]]]],["dso-map-controls.cjs",[[1,"dso-map-controls",{"open":[1540],"disableZoom":[1,"disable-zoom"],"hideContent":[32]}]]],["dso-modal.cjs",[[1,"dso-modal",{"modalTitle":[1,"modal-title"],"role":[1],"showCloseButton":[4,"show-close-button"],"ariaId":[32],"hasFooter":[32]}]]],["dso-table.cjs",[[1,"dso-table",{"noModal":[516,"no-modal"],"isResponsive":[516,"is-responsive"],"modalActive":[32],"placeholderHeight":[32]}]]],["dso-viewer-grid.cjs",[[1,"dso-viewer-grid",{"filterpanelOpen":[516,"filterpanel-open"],"overlayOpen":[516,"overlay-open"],"initialMainSize":[1,"initial-main-size"],"mainSize":[32]}]]],["dso-accordion.cjs",[[1,"dso-accordion",{"variant":[513],"reverseAlign":[516,"reverse-align"],"allowMultipleOpen":[516,"allow-multiple-open"],"getState":[64],"toggleSection":[64],"closeOpenSections":[64]}]]],["dso-badge.cjs",[[1,"dso-badge",{"status":[1]}]]],["dso-banner.cjs",[[1,"dso-banner",{"status":[513]}]]],["dso-card.cjs",[[1,"dso-card",{"isSelectable":[516,"is-selectable"],"hasImage":[516,"has-image"]}]]],["dso-card-container.cjs",[[1,"dso-card-container",{"mode":[513]}]]],["dso-highlight-box.cjs",[[1,"dso-highlight-box",{"yellow":[4],"border":[4],"white":[4],"dropShadow":[4,"drop-shadow"],"step":[2]}]]],["dso-ozon-content.cjs",[[6,"dso-ozon-content",{"content":[1],"inline":[516],"deleted":[516],"interactive":[520],"state":[32]}]]],["dso-progress-bar.cjs",[[1,"dso-progress-bar",{"progress":[2],"min":[2],"max":[2]}]]],["dso-dropdown-menu.cjs",[[1,"dso-dropdown-menu",{"open":[1540],"dropdownAlign":[1,"dropdown-align"],"checkable":[4]}]]],["dso-responsive-element.cjs",[[1,"dso-responsive-element",{"sizeAlias":[32],"sizeWidth":[32],"getSize":[64]}]]],["dso-progress-indicator.cjs",[[1,"dso-progress-indicator",{"label":[1],"size":[513],"block":[4]}]]],["dso-tooltip.cjs",[[1,"dso-tooltip",{"descriptive":[516],"position":[1],"strategy":[1],"noArrow":[4,"no-arrow"],"stateless":[4],"small":[4],"active":[1540],"hidden":[32],"activate":[64],"deactivate":[64]},[[0,"click","listenClick"]]]]],["dso-info-button.cjs",[[1,"dso-info-button",{"active":[1540],"secondary":[4],"label":[1],"hover":[32],"setFocus":[64]}]]],["dso-info_2.cjs",[[6,"dso-selectable",{"type":[1],"identifier":[1],"name":[1],"value":[1],"invalid":[4],"describedById":[1,"described-by-id"],"disabled":[4],"required":[4],"checked":[4],"indeterminate":[4],"infoFixed":[4,"info-fixed"],"infoActive":[32],"toggleInfo":[64]}],[1,"dso-info",{"fixed":[516],"active":[516]}]]]], options);
|
|
17
|
+
return index.bootstrapLazy([["dso-icon.cjs",[[1,"dso-icon",{"icon":[1]}]]],["dso-map-base-layers.cjs",[[1,"dso-map-base-layers",{"group":[1],"baseLayers":[16]}]]],["dso-map-overlays.cjs",[[1,"dso-map-overlays",{"group":[1],"overlays":[16]}]]],["dso-toggletip.cjs",[[1,"dso-toggletip",{"label":[1],"position":[1],"small":[4],"secondary":[4],"active":[32]}]]],["dso-header.cjs",[[6,"dso-header",{"mainMenu":[16],"useDropDownMenu":[1,"use-drop-down-menu"],"authStatus":[1,"auth-status"],"loginUrl":[1,"login-url"],"logoutUrl":[1,"logout-url"],"userProfileName":[1,"user-profile-name"],"userProfileUrl":[1,"user-profile-url"],"userHomeUrl":[1,"user-home-url"],"showDropDown":[32],"hasSubLogo":[32],"overflowMenuItems":[32]}]]],["dso-label.cjs",[[1,"dso-label",{"compact":[4],"removable":[4],"status":[1],"truncate":[4],"removeHover":[32],"removeFocus":[32],"textHover":[32],"textFocus":[32],"truncatedContent":[32],"labelText":[32]}]]],["dso-pagination.cjs",[[1,"dso-pagination",{"totalPages":[2,"total-pages"],"currentPage":[2,"current-page"],"formatHref":[16],"availablePositions":[32]},[[0,"dsoSizeChange","sizeChangeHandler"]]]]],["dso-tree-view.cjs",[[1,"dso-tree-view",{"collection":[16],"focusItem":[64]}]]],["dso-accordion-section.cjs",[[1,"dso-accordion-section",{"handleTitle":[1,"handle-title"],"heading":[1],"handleUrl":[1,"handle-url"],"state":[1],"attachmentCount":[2,"attachment-count"],"icon":[1],"status":[1],"open":[1540],"hasNestedSection":[32],"toggleSection":[64],"scrollSectionIntoView":[64]}]]],["dso-alert.cjs",[[1,"dso-alert",{"status":[1],"roleAlert":[4,"role-alert"]}]]],["dso-attachments-counter.cjs",[[1,"dso-attachments-counter",{"count":[2]}]]],["dso-autosuggest.cjs",[[6,"dso-autosuggest",{"suggestions":[16],"loading":[4],"loadingLabel":[1,"loading-label"],"loadingDelayed":[2,"loading-delayed"],"notFoundLabel":[1,"not-found-label"],"suggestOnFocus":[4,"suggest-on-focus"],"showSuggestions":[32],"selectedSuggestion":[32],"notFound":[32],"showLoading":[32]},[[4,"click","onDocumentClick"]]]]],["dso-date-picker.cjs",[[2,"dso-date-picker",{"name":[1],"identifier":[1],"disabled":[516],"role":[1],"direction":[1],"required":[4],"dsoAutofocus":[4,"dso-autofocus"],"value":[1537],"min":[1],"max":[1],"activeFocus":[32],"focusedDay":[32],"open":[32],"visible":[32],"setFocus":[64],"show":[64],"hide":[64]},[[6,"click","handleDocumentClick"]]]]],["dso-helpcenter-panel.cjs",[[1,"dso-helpcenter-panel",{"label":[1],"url":[1],"visibility":[32],"isOpen":[32],"slideState":[32],"loadIframe":[32]},[[8,"keydown","keyDownListener"]]]]],["dso-image-overlay.cjs",[[1,"dso-image-overlay",{"active":[32],"focused":[32],"zoomable":[32]},[[2,"load","loadListener"]]]]],["dso-map-controls.cjs",[[1,"dso-map-controls",{"open":[1540],"disableZoom":[1,"disable-zoom"],"hideContent":[32]}]]],["dso-modal.cjs",[[1,"dso-modal",{"modalTitle":[1,"modal-title"],"role":[1],"showCloseButton":[4,"show-close-button"],"ariaId":[32],"hasFooter":[32]}]]],["dso-table.cjs",[[1,"dso-table",{"noModal":[516,"no-modal"],"isResponsive":[516,"is-responsive"],"modalActive":[32],"placeholderHeight":[32]}]]],["dso-viewer-grid.cjs",[[1,"dso-viewer-grid",{"filterpanelOpen":[516,"filterpanel-open"],"overlayOpen":[516,"overlay-open"],"initialMainSize":[1,"initial-main-size"],"mainSize":[32]}]]],["dso-accordion.cjs",[[1,"dso-accordion",{"variant":[513],"reverseAlign":[516,"reverse-align"],"allowMultipleOpen":[516,"allow-multiple-open"],"getState":[64],"toggleSection":[64],"closeOpenSections":[64]}]]],["dso-badge.cjs",[[1,"dso-badge",{"status":[1]}]]],["dso-banner.cjs",[[1,"dso-banner",{"status":[513]}]]],["dso-card.cjs",[[1,"dso-card",{"isSelectable":[516,"is-selectable"],"hasImage":[516,"has-image"]}]]],["dso-card-container.cjs",[[1,"dso-card-container",{"mode":[513]}]]],["dso-highlight-box.cjs",[[1,"dso-highlight-box",{"yellow":[4],"border":[4],"white":[4],"dropShadow":[4,"drop-shadow"],"step":[2]}]]],["dso-ozon-content.cjs",[[6,"dso-ozon-content",{"content":[1],"inline":[516],"deleted":[516],"interactive":[520],"state":[32]}]]],["dso-progress-bar.cjs",[[1,"dso-progress-bar",{"progress":[2],"min":[2],"max":[2]}]]],["dso-dropdown-menu.cjs",[[1,"dso-dropdown-menu",{"open":[1540],"dropdownAlign":[1,"dropdown-align"],"checkable":[4]}]]],["dso-responsive-element.cjs",[[1,"dso-responsive-element",{"sizeAlias":[32],"sizeWidth":[32],"getSize":[64]}]]],["dso-progress-indicator.cjs",[[1,"dso-progress-indicator",{"label":[1],"size":[513],"block":[4]}]]],["dso-tooltip.cjs",[[1,"dso-tooltip",{"descriptive":[516],"position":[1],"strategy":[1],"noArrow":[4,"no-arrow"],"stateless":[4],"small":[4],"active":[1540],"hidden":[32],"activate":[64],"deactivate":[64]},[[0,"click","listenClick"]]]]],["dso-info-button.cjs",[[1,"dso-info-button",{"active":[1540],"secondary":[4],"label":[1],"hover":[32],"setFocus":[64]}]]],["dso-info_2.cjs",[[6,"dso-selectable",{"type":[1],"identifier":[1],"name":[1],"value":[1],"invalid":[4],"describedById":[1,"described-by-id"],"disabled":[4],"required":[4],"checked":[4],"indeterminate":[4],"infoFixed":[4,"info-fixed"],"infoActive":[32],"toggleInfo":[64]}],[1,"dso-info",{"fixed":[516],"active":[516]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -8,6 +8,7 @@ export class Accordion {
|
|
|
8
8
|
const { state } = createStore({
|
|
9
9
|
variant: this.variant || "default",
|
|
10
10
|
reverseAlign: this.reverseAlign,
|
|
11
|
+
allowMultipleOpen: this.allowMultipleOpen,
|
|
11
12
|
});
|
|
12
13
|
this.accordionState = state;
|
|
13
14
|
}
|
|
@@ -17,6 +18,9 @@ export class Accordion {
|
|
|
17
18
|
updateReverseAlign(reverseAlign) {
|
|
18
19
|
this.accordionState.reverseAlign = reverseAlign;
|
|
19
20
|
}
|
|
21
|
+
updateAllowMultipleOpen(allowMultipleOpen) {
|
|
22
|
+
this.accordionState.allowMultipleOpen = allowMultipleOpen;
|
|
23
|
+
}
|
|
20
24
|
watchAllowMultiple(allowMultipleOpen) {
|
|
21
25
|
if (!allowMultipleOpen) {
|
|
22
26
|
const openSections = Array.from(this.host.querySelectorAll(":scope > dso-accordion-section[open]"));
|
|
@@ -28,7 +32,10 @@ export class Accordion {
|
|
|
28
32
|
async getState() {
|
|
29
33
|
return this.accordionState;
|
|
30
34
|
}
|
|
31
|
-
/** Toggle a section. Pass the `<dso-accordion-section>` element or the index of the section
|
|
35
|
+
/** Toggle a section. Pass the `<dso-accordion-section>` element or the index of the section.\
|
|
36
|
+
* returns `undefined` when no section is toggled.\
|
|
37
|
+
* returns `true` when the section is opened and `false` when the section is closed.
|
|
38
|
+
*/
|
|
32
39
|
async toggleSection(sectionElement, event) {
|
|
33
40
|
const sections = Array.from(this.host.querySelectorAll(":scope > dso-accordion-section"));
|
|
34
41
|
if (typeof sectionElement === "number") {
|
|
@@ -41,16 +48,17 @@ export class Accordion {
|
|
|
41
48
|
if (this.allowMultipleOpen) {
|
|
42
49
|
this.controlOpenAttribute(sectionElement, !sectionIsOpen);
|
|
43
50
|
this.emitToggleEvent(sectionElement, sections, event);
|
|
44
|
-
return;
|
|
51
|
+
return !sectionIsOpen;
|
|
45
52
|
}
|
|
46
53
|
if (sectionIsOpen) {
|
|
47
54
|
this.controlOpenAttribute(sectionElement, false);
|
|
48
55
|
this.emitToggleEvent(sectionElement, sections, event);
|
|
49
|
-
return;
|
|
56
|
+
return false;
|
|
50
57
|
}
|
|
51
58
|
await this.closeOpenSections();
|
|
52
59
|
this.controlOpenAttribute(sectionElement, true);
|
|
53
60
|
this.emitToggleEvent(sectionElement, sections, event);
|
|
61
|
+
return true;
|
|
54
62
|
}
|
|
55
63
|
/** Closes all sections belonging to this accordion. */
|
|
56
64
|
async closeOpenSections() {
|
|
@@ -58,6 +66,18 @@ export class Accordion {
|
|
|
58
66
|
const openSections = sections.filter((s) => this.isSectionOpen(s));
|
|
59
67
|
openSections.forEach((section) => this.controlOpenAttribute(section, false));
|
|
60
68
|
}
|
|
69
|
+
// These checks are needed for a React timing issue.
|
|
70
|
+
componentWillLoad() {
|
|
71
|
+
if (this.accordionState.variant !== this.variant) {
|
|
72
|
+
this.accordionState.variant = this.variant || "default";
|
|
73
|
+
}
|
|
74
|
+
if (this.accordionState.reverseAlign !== this.reverseAlign) {
|
|
75
|
+
this.accordionState.reverseAlign = this.reverseAlign;
|
|
76
|
+
}
|
|
77
|
+
if (this.accordionState.allowMultipleOpen !== this.allowMultipleOpen) {
|
|
78
|
+
this.accordionState.allowMultipleOpen = this.allowMultipleOpen;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
61
81
|
render() {
|
|
62
82
|
return (h(Host, { class: {
|
|
63
83
|
"dso-accordion": true,
|
|
@@ -206,7 +226,7 @@ export class Accordion {
|
|
|
206
226
|
},
|
|
207
227
|
"toggleSection": {
|
|
208
228
|
"complexType": {
|
|
209
|
-
"signature": "(sectionElement: HTMLElement | number, event?: MouseEvent) => Promise<
|
|
229
|
+
"signature": "(sectionElement: HTMLElement | number, event?: MouseEvent) => Promise<undefined | boolean>",
|
|
210
230
|
"parameters": [{
|
|
211
231
|
"tags": [],
|
|
212
232
|
"text": ""
|
|
@@ -225,10 +245,10 @@ export class Accordion {
|
|
|
225
245
|
"location": "global"
|
|
226
246
|
}
|
|
227
247
|
},
|
|
228
|
-
"return": "Promise<
|
|
248
|
+
"return": "Promise<boolean | undefined>"
|
|
229
249
|
},
|
|
230
250
|
"docs": {
|
|
231
|
-
"text": "Toggle a section. Pass the `<dso-accordion-section>` element or the index of the section.",
|
|
251
|
+
"text": "Toggle a section. Pass the `<dso-accordion-section>` element or the index of the section.\\\r\nreturns `undefined` when no section is toggled.\\\r\nreturns `true` when the section is opened and `false` when the section is closed.",
|
|
232
252
|
"tags": []
|
|
233
253
|
}
|
|
234
254
|
},
|
|
@@ -261,6 +281,9 @@ export class Accordion {
|
|
|
261
281
|
}, {
|
|
262
282
|
"propName": "reverseAlign",
|
|
263
283
|
"methodName": "updateReverseAlign"
|
|
284
|
+
}, {
|
|
285
|
+
"propName": "allowMultipleOpen",
|
|
286
|
+
"methodName": "updateAllowMultipleOpen"
|
|
264
287
|
}, {
|
|
265
288
|
"propName": "allowMultipleOpen",
|
|
266
289
|
"methodName": "watchAllowMultiple"
|
|
@@ -28,7 +28,7 @@ export class AccordionSection {
|
|
|
28
28
|
forceUpdate(this.host);
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
this.
|
|
31
|
+
this.prepareAnimationResizeObserver();
|
|
32
32
|
}
|
|
33
33
|
componentDidLoad() {
|
|
34
34
|
var _a, _b;
|
|
@@ -41,15 +41,65 @@ export class AccordionSection {
|
|
|
41
41
|
var _a;
|
|
42
42
|
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
43
43
|
}
|
|
44
|
-
/** Toggle this section
|
|
45
|
-
|
|
44
|
+
/** Toggle this section.
|
|
45
|
+
* @param scrollIntoView boolean - defaults to true
|
|
46
|
+
*/
|
|
47
|
+
async toggleSection(scrollIntoView = true) {
|
|
46
48
|
var _a;
|
|
47
|
-
|
|
49
|
+
await ((_a = this.accordion) === null || _a === void 0 ? void 0 : _a.toggleSection(this.host).then(async () => {
|
|
50
|
+
if (scrollIntoView) {
|
|
51
|
+
await this.scrollIntoViewWhenNeeded(true);
|
|
52
|
+
}
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
/** Scroll this section into view when needed. */
|
|
56
|
+
async scrollSectionIntoView() {
|
|
57
|
+
await this.scrollIntoViewWhenNeeded(false);
|
|
58
|
+
}
|
|
59
|
+
async scrollIntoViewWhenNeeded(sectionToggled) {
|
|
60
|
+
var _a, _b, _c;
|
|
61
|
+
AccordionSection.scrollCandidate = undefined;
|
|
62
|
+
const bodyClientRect = (_a = this.sectionBody) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
63
|
+
const headingClientRect = (_b = this.sectionHeading) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
|
|
64
|
+
if (!bodyClientRect || !headingClientRect || !this.accordionState) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const waitForAnimationBeforeScrolling = (state) => {
|
|
68
|
+
var _a;
|
|
69
|
+
const sectionBottomOffsetTop = this.host.offsetTop + headingClientRect.height + (this.open ? (_a = this.bodyHeight) !== null && _a !== void 0 ? _a : 0 : 0);
|
|
70
|
+
return (sectionToggled && (sectionBottomOffsetTop > document.documentElement.scrollHeight || state.allowMultipleOpen));
|
|
71
|
+
};
|
|
72
|
+
if (waitForAnimationBeforeScrolling(this.accordionState)) {
|
|
73
|
+
AccordionSection.scrollCandidate = this.host;
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
// this y is relative to the top of the viewport.
|
|
77
|
+
const sectionBottomY = headingClientRect.top + headingClientRect.height + (this.open ? (_c = this.bodyHeight) !== null && _c !== void 0 ? _c : 0 : 0);
|
|
78
|
+
if (sectionBottomY > window.innerHeight) {
|
|
79
|
+
const expandedAccordionHeight = sectionBottomY - headingClientRect.top;
|
|
80
|
+
const shouldScrollToTopOfSection = expandedAccordionHeight > window.innerHeight;
|
|
81
|
+
window.scrollTo({
|
|
82
|
+
top: shouldScrollToTopOfSection
|
|
83
|
+
? this.host.offsetTop
|
|
84
|
+
: this.host.offsetTop - (window.innerHeight - expandedAccordionHeight),
|
|
85
|
+
behavior: "smooth",
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
else if (headingClientRect.top < 0) {
|
|
89
|
+
window.scrollTo({
|
|
90
|
+
top: this.host.offsetTop,
|
|
91
|
+
behavior: "smooth",
|
|
92
|
+
});
|
|
93
|
+
}
|
|
48
94
|
}
|
|
49
95
|
async toggle(e) {
|
|
50
96
|
var _a;
|
|
51
97
|
e === null || e === void 0 ? void 0 : e.preventDefault();
|
|
52
|
-
|
|
98
|
+
(_a = this.accordion) === null || _a === void 0 ? void 0 : _a.toggleSection(this.host, e).then(async (isOpen) => {
|
|
99
|
+
if (isOpen) {
|
|
100
|
+
await this.scrollIntoViewWhenNeeded(true);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
53
103
|
}
|
|
54
104
|
render() {
|
|
55
105
|
var _a;
|
|
@@ -60,12 +110,14 @@ export class AccordionSection {
|
|
|
60
110
|
["dso-accordion-" + variant]: true,
|
|
61
111
|
"dso-nested-accordion": this.hasNestedSection,
|
|
62
112
|
"dso-accordion-reverse-align": reverseAlign !== null && reverseAlign !== void 0 ? reverseAlign : false,
|
|
63
|
-
}, hidden: !variant }, h(Handle, { heading: this.heading }, h(HandleElement, { handleUrl: this.handleUrl, onClick: async (event) => await this.toggle(event), open: this.open }, reverseAlign ? (h(Fragment, null, hasAddons && (h("div", { class: "dso-section-handle-addons" }, h(HandleIcon, { icon: this.icon }))), h("span", null, this.handleTitle), h("dso-icon", { class: "dso-section-handle-chevron", icon: "chevron-down" }))) : (h(Fragment, null, h("dso-icon", { class: "dso-section-handle-chevron", icon: "chevron-right" }), this.state && h("span", { class: "sr-only" }, stateMap[this.state]), h("span", null, this.handleTitle), hasAddons && (h("div", { class: "dso-section-handle-addons" }, this.status && h("span", { class: "dso-status" }, this.status), h(HandleIcon, { state: this.state, icon: this.icon, attachmentCount: this.attachmentCount }))))))), h("div", { class: { "dso-section-body": true, "dso-animate-ready": !!this.animeInstance }, ref: (element) => (this.sectionBody = element), "aria-hidden": this.open ? "false" : "true" }, h("div", { class: "dso-section-body-content" }, h("slot", null)))));
|
|
113
|
+
}, hidden: !variant }, h(Handle, { heading: this.heading, ref: (element) => (this.sectionHeading = element) }, h(HandleElement, { handleUrl: this.handleUrl, onClick: async (event) => await this.toggle(event), open: this.open }, reverseAlign ? (h(Fragment, null, hasAddons && (h("div", { class: "dso-section-handle-addons" }, h(HandleIcon, { icon: this.icon }))), h("span", null, this.handleTitle), h("dso-icon", { class: "dso-section-handle-chevron", icon: "chevron-down" }))) : (h(Fragment, null, h("dso-icon", { class: "dso-section-handle-chevron", icon: "chevron-right" }), this.state && h("span", { class: "sr-only" }, stateMap[this.state]), h("span", null, this.handleTitle), hasAddons && (h("div", { class: "dso-section-handle-addons" }, this.status && h("span", { class: "dso-status" }, this.status), h(HandleIcon, { state: this.state, icon: this.icon, attachmentCount: this.attachmentCount }))))))), h("div", { class: { "dso-section-body": true, "dso-animate-ready": !!this.animeInstance }, ref: (element) => (this.sectionBody = element), "aria-hidden": this.open ? "false" : "true" }, h("div", { class: "dso-section-body-content" }, h("slot", null)))));
|
|
64
114
|
}
|
|
65
|
-
|
|
115
|
+
prepareAnimationResizeObserver() {
|
|
66
116
|
this.resizeObserver = new ResizeObserver(debounce(([entry]) => {
|
|
67
|
-
|
|
68
|
-
|
|
117
|
+
// entry.contentRect does not include padding, so we use getBoundingClientRect.
|
|
118
|
+
const height = entry.target.getBoundingClientRect().height;
|
|
119
|
+
if (this.bodyHeight !== height) {
|
|
120
|
+
this.bodyHeight = height;
|
|
69
121
|
this.instantiateAnimation();
|
|
70
122
|
}
|
|
71
123
|
}, 150));
|
|
@@ -78,6 +130,12 @@ export class AccordionSection {
|
|
|
78
130
|
duration: 260,
|
|
79
131
|
autoplay: false,
|
|
80
132
|
direction: "normal",
|
|
133
|
+
changeComplete: async () => {
|
|
134
|
+
if (AccordionSection.scrollCandidate === this.host) {
|
|
135
|
+
AccordionSection.scrollCandidate = undefined;
|
|
136
|
+
await this.scrollSectionIntoView();
|
|
137
|
+
}
|
|
138
|
+
},
|
|
81
139
|
begin: () => {
|
|
82
140
|
if (this.sectionBody) {
|
|
83
141
|
if (this.open) {
|
|
@@ -295,6 +353,31 @@ export class AccordionSection {
|
|
|
295
353
|
static get methods() {
|
|
296
354
|
return {
|
|
297
355
|
"toggleSection": {
|
|
356
|
+
"complexType": {
|
|
357
|
+
"signature": "(scrollIntoView?: boolean) => Promise<void>",
|
|
358
|
+
"parameters": [{
|
|
359
|
+
"tags": [{
|
|
360
|
+
"name": "param",
|
|
361
|
+
"text": "scrollIntoView boolean - defaults to true"
|
|
362
|
+
}],
|
|
363
|
+
"text": "boolean - defaults to true"
|
|
364
|
+
}],
|
|
365
|
+
"references": {
|
|
366
|
+
"Promise": {
|
|
367
|
+
"location": "global"
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
"return": "Promise<void>"
|
|
371
|
+
},
|
|
372
|
+
"docs": {
|
|
373
|
+
"text": "Toggle this section.",
|
|
374
|
+
"tags": [{
|
|
375
|
+
"name": "param",
|
|
376
|
+
"text": "scrollIntoView boolean - defaults to true"
|
|
377
|
+
}]
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
"scrollSectionIntoView": {
|
|
298
381
|
"complexType": {
|
|
299
382
|
"signature": "() => Promise<void>",
|
|
300
383
|
"parameters": [],
|
|
@@ -306,7 +389,7 @@ export class AccordionSection {
|
|
|
306
389
|
"return": "Promise<void>"
|
|
307
390
|
},
|
|
308
391
|
"docs": {
|
|
309
|
-
"text": "
|
|
392
|
+
"text": "Scroll this section into view when needed.",
|
|
310
393
|
"tags": []
|
|
311
394
|
}
|
|
312
395
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
export const Handle = ({ heading }, children) => {
|
|
2
|
+
export const Handle = ({ heading, ref }, children) => {
|
|
3
3
|
switch (heading) {
|
|
4
4
|
default:
|
|
5
5
|
case "h2":
|
|
6
|
-
return h("h2", { class: "dso-section-handle" }, children);
|
|
6
|
+
return (h("h2", { ref: ref, class: "dso-section-handle" }, children));
|
|
7
7
|
case "h3":
|
|
8
|
-
return h("h3", { class: "dso-section-handle" }, children);
|
|
8
|
+
return (h("h3", { ref: ref, class: "dso-section-handle" }, children));
|
|
9
9
|
case "h4":
|
|
10
|
-
return h("h4", { class: "dso-section-handle" }, children);
|
|
10
|
+
return (h("h4", { ref: ref, class: "dso-section-handle" }, children));
|
|
11
11
|
case "h5":
|
|
12
|
-
return h("h5", { class: "dso-section-handle" }, children);
|
|
12
|
+
return (h("h5", { ref: ref, class: "dso-section-handle" }, children));
|
|
13
13
|
}
|
|
14
14
|
};
|