@watermarkinsights/ripple 5.14.0 → 5.15.0-alpha.0
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/{app-globals-055b4db0.js → app-globals-d84804db.js} +1 -1
- package/dist/cjs/{chartFunctions-781589c1.js → chartFunctions-153f5288.js} +1 -1
- package/dist/cjs/{functions-c7404c42.js → functions-b6a2c8c1.js} +57 -7
- package/dist/cjs/{intl-88adb57d.js → intl-ae08308b.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/priv-calendar.cjs.entry.js +1 -1
- package/dist/cjs/priv-chart-popover.cjs.entry.js +17 -12
- package/dist/cjs/priv-option-list.cjs.entry.js +2 -2
- package/dist/cjs/ripple.cjs.js +1 -1
- package/dist/cjs/wm-action-menu_2.cjs.entry.js +1 -1
- package/dist/cjs/wm-button.cjs.entry.js +1 -1
- package/dist/cjs/wm-chart.cjs.entry.js +3 -3
- package/dist/cjs/wm-date-range.cjs.entry.js +1 -1
- package/dist/cjs/wm-datepicker.cjs.entry.js +1 -1
- package/dist/cjs/wm-file.cjs.entry.js +1 -1
- package/dist/cjs/wm-flyout.cjs.entry.js +2 -2
- package/dist/cjs/wm-input.cjs.entry.js +2 -2
- package/dist/cjs/wm-line-chart.cjs.entry.js +3 -3
- package/dist/cjs/wm-modal-pss_3.cjs.entry.js +2 -2
- package/dist/cjs/wm-modal_3.cjs.entry.js +2 -2
- package/dist/cjs/wm-navigation_3.cjs.entry.js +2 -2
- package/dist/cjs/wm-navigator.cjs.entry.js +1 -1
- package/dist/cjs/wm-nested-select.cjs.entry.js +2 -2
- package/dist/cjs/wm-optgroup.cjs.entry.js +1 -1
- package/dist/cjs/wm-option_2.cjs.entry.js +2 -2
- package/dist/cjs/wm-pagination.cjs.entry.js +2 -2
- package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +2 -2
- package/dist/cjs/wm-search.cjs.entry.js +9 -7
- package/dist/cjs/wm-snackbar.cjs.entry.js +2 -2
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +1 -1
- package/dist/cjs/wm-tag-input.cjs.entry.js +2 -2
- package/dist/cjs/wm-tag-option.cjs.entry.js +1 -1
- package/dist/cjs/wm-textarea.cjs.entry.js +2 -2
- package/dist/cjs/wm-timepicker.cjs.entry.js +1 -1
- package/dist/cjs/wm-toggletip.cjs.entry.js +30 -23
- package/dist/cjs/wm-uploader.cjs.entry.js +2 -2
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +17 -12
- package/dist/collection/components/wm-search/wm-search.js +7 -5
- package/dist/collection/components/wm-toggletip/wm-toggletip.js +30 -23
- package/dist/collection/dev/toggletip.js +3 -3
- package/dist/collection/global/functions.js +55 -6
- package/dist/esm/{app-globals-d3e3b925.js → app-globals-3753b41d.js} +1 -1
- package/dist/esm/{chartFunctions-246aabf9.js → chartFunctions-de9bcba9.js} +1 -1
- package/dist/esm/{functions-aad18286.js → functions-85bc4418.js} +56 -7
- package/dist/esm/{intl-c8686c73.js → intl-a0456c63.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/priv-calendar.entry.js +1 -1
- package/dist/esm/priv-chart-popover.entry.js +17 -12
- package/dist/esm/priv-option-list.entry.js +2 -2
- package/dist/esm/ripple.js +1 -1
- package/dist/esm/wm-action-menu_2.entry.js +1 -1
- package/dist/esm/wm-button.entry.js +1 -1
- package/dist/esm/wm-chart.entry.js +3 -3
- package/dist/esm/wm-date-range.entry.js +1 -1
- package/dist/esm/wm-datepicker.entry.js +1 -1
- package/dist/esm/wm-file.entry.js +1 -1
- package/dist/esm/wm-flyout.entry.js +2 -2
- package/dist/esm/wm-input.entry.js +2 -2
- package/dist/esm/wm-line-chart.entry.js +3 -3
- package/dist/esm/wm-modal-pss_3.entry.js +2 -2
- package/dist/esm/wm-modal_3.entry.js +2 -2
- package/dist/esm/wm-navigation_3.entry.js +2 -2
- package/dist/esm/wm-navigator.entry.js +1 -1
- package/dist/esm/wm-nested-select.entry.js +2 -2
- package/dist/esm/wm-optgroup.entry.js +1 -1
- package/dist/esm/wm-option_2.entry.js +2 -2
- package/dist/esm/wm-pagination.entry.js +2 -2
- package/dist/esm/wm-progress-indicator_3.entry.js +2 -2
- package/dist/esm/wm-search.entry.js +9 -7
- package/dist/esm/wm-snackbar.entry.js +2 -2
- package/dist/esm/wm-tab-item_3.entry.js +1 -1
- package/dist/esm/wm-tag-input.entry.js +2 -2
- package/dist/esm/wm-tag-option.entry.js +1 -1
- package/dist/esm/wm-textarea.entry.js +2 -2
- package/dist/esm/wm-timepicker.entry.js +1 -1
- package/dist/esm/wm-toggletip.entry.js +30 -23
- package/dist/esm/wm-uploader.entry.js +2 -2
- package/dist/esm-es5/app-globals-3753b41d.js +1 -0
- package/dist/esm-es5/{chartFunctions-246aabf9.js → chartFunctions-de9bcba9.js} +1 -1
- package/dist/esm-es5/{functions-aad18286.js → functions-85bc4418.js} +1 -1
- package/dist/esm-es5/{intl-c8686c73.js → intl-a0456c63.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/priv-calendar.entry.js +1 -1
- package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
- package/dist/esm-es5/priv-option-list.entry.js +1 -1
- package/dist/esm-es5/ripple.js +1 -1
- package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
- package/dist/esm-es5/wm-button.entry.js +1 -1
- package/dist/esm-es5/wm-chart.entry.js +1 -1
- package/dist/esm-es5/wm-date-range.entry.js +1 -1
- package/dist/esm-es5/wm-datepicker.entry.js +1 -1
- package/dist/esm-es5/wm-file.entry.js +1 -1
- package/dist/esm-es5/wm-flyout.entry.js +1 -1
- package/dist/esm-es5/wm-input.entry.js +1 -1
- package/dist/esm-es5/wm-line-chart.entry.js +1 -1
- package/dist/esm-es5/wm-modal-pss_3.entry.js +1 -1
- package/dist/esm-es5/wm-modal_3.entry.js +1 -1
- package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
- package/dist/esm-es5/wm-navigator.entry.js +1 -1
- package/dist/esm-es5/wm-nested-select.entry.js +1 -1
- package/dist/esm-es5/wm-optgroup.entry.js +1 -1
- package/dist/esm-es5/wm-option_2.entry.js +1 -1
- package/dist/esm-es5/wm-pagination.entry.js +1 -1
- package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
- package/dist/esm-es5/wm-search.entry.js +1 -1
- package/dist/esm-es5/wm-snackbar.entry.js +1 -1
- package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
- package/dist/esm-es5/wm-tag-input.entry.js +1 -1
- package/dist/esm-es5/wm-tag-option.entry.js +1 -1
- package/dist/esm-es5/wm-textarea.entry.js +1 -1
- package/dist/esm-es5/wm-timepicker.entry.js +1 -1
- package/dist/esm-es5/wm-toggletip.entry.js +1 -1
- package/dist/esm-es5/wm-uploader.entry.js +1 -1
- package/dist/ripple/{p-de13b15f.system.entry.js → p-021e46ae.system.entry.js} +1 -1
- package/dist/ripple/{p-b254cdce.entry.js → p-0c53ba0c.entry.js} +1 -1
- package/dist/ripple/{p-e455876c.system.entry.js → p-17498c9d.system.entry.js} +1 -1
- package/dist/ripple/{p-d837c7d4.entry.js → p-18c26666.entry.js} +1 -1
- package/dist/ripple/{p-86bd3990.system.entry.js → p-1c52ac0f.system.entry.js} +1 -1
- package/dist/ripple/{p-ed5dfa29.entry.js → p-22c205c0.entry.js} +1 -1
- package/dist/ripple/{p-6e7c833c.system.js → p-243c6b62.system.js} +1 -1
- package/dist/ripple/{p-723254b6.js → p-256e98c1.js} +1 -1
- package/dist/ripple/{p-07318072.system.entry.js → p-2aea4c9a.system.entry.js} +1 -1
- package/dist/ripple/{p-b26f4852.entry.js → p-2db5e316.entry.js} +1 -1
- package/dist/ripple/{p-fadea131.entry.js → p-2dd4af68.entry.js} +1 -1
- package/dist/ripple/{p-d4f082db.system.entry.js → p-315198e2.system.entry.js} +1 -1
- package/dist/ripple/{p-f912ce26.system.entry.js → p-35f260f9.system.entry.js} +1 -1
- package/dist/ripple/p-3a16d089.entry.js +1 -0
- package/dist/ripple/{p-f1b36057.entry.js → p-4f48dc05.entry.js} +1 -1
- package/dist/ripple/{p-c8ef0086.entry.js → p-50efe5f9.entry.js} +1 -1
- package/dist/ripple/{p-68b63f21.entry.js → p-51800e01.entry.js} +1 -1
- package/dist/ripple/{p-70c6d33e.system.entry.js → p-53f05aee.system.entry.js} +1 -1
- package/dist/ripple/{p-ee4026e0.system.entry.js → p-56517851.system.entry.js} +1 -1
- package/dist/ripple/{p-d332cc27.system.entry.js → p-56b2b902.system.entry.js} +1 -1
- package/dist/ripple/{p-94ef3015.entry.js → p-56ddcb43.entry.js} +1 -1
- package/dist/ripple/{p-1a0c51ee.system.entry.js → p-5b3f4f30.system.entry.js} +1 -1
- package/dist/ripple/{p-5acc08cd.system.entry.js → p-5d29ac58.system.entry.js} +1 -1
- package/dist/ripple/{p-02634e13.entry.js → p-5dff57fb.entry.js} +1 -1
- package/dist/ripple/{p-e156c0c2.entry.js → p-61af9bfc.entry.js} +1 -1
- package/dist/ripple/{p-d3adbf48.system.entry.js → p-66a90fbd.system.entry.js} +1 -1
- package/dist/ripple/{p-f37094fe.system.entry.js → p-74a2e246.system.entry.js} +1 -1
- package/dist/ripple/{p-35560f1c.system.js → p-7825cbab.system.js} +1 -1
- package/dist/ripple/{p-bf8e69a3.js → p-79c56ebe.js} +1 -1
- package/dist/ripple/p-7f2dd7a9.entry.js +1 -0
- package/dist/ripple/{p-1111367a.system.entry.js → p-8273a880.system.entry.js} +1 -1
- package/dist/ripple/{p-a81d3859.entry.js → p-857ed23b.entry.js} +1 -1
- package/dist/ripple/{p-a58ae308.system.entry.js → p-886b3dc1.system.entry.js} +1 -1
- package/dist/ripple/p-92d8c5bd.system.js +1 -0
- package/dist/ripple/{p-366193d0.system.entry.js → p-9772a990.system.entry.js} +1 -1
- package/dist/ripple/p-97b26258.entry.js +1 -0
- package/dist/ripple/{p-2c954741.system.entry.js → p-99ee6fbf.system.entry.js} +1 -1
- package/dist/ripple/{p-8cd81897.system.entry.js → p-9c4deec8.system.entry.js} +1 -1
- package/dist/ripple/p-9cfd9bd9.js +1 -0
- package/dist/ripple/{p-4eaab96c.system.entry.js → p-9e1c3aff.system.entry.js} +1 -1
- package/dist/ripple/{p-6d99517c.system.entry.js → p-9f29e5e4.system.entry.js} +1 -1
- package/dist/ripple/p-a2f5e287.system.entry.js +1 -0
- package/dist/ripple/{p-cbfb44b5.system.entry.js → p-a389ccd3.system.entry.js} +1 -1
- package/dist/ripple/{p-496564b3.entry.js → p-a5031dab.entry.js} +1 -1
- package/dist/ripple/{p-58361d0e.system.entry.js → p-ab9af951.system.entry.js} +1 -1
- package/dist/ripple/{p-0a4a2582.system.entry.js → p-ae5d9927.system.entry.js} +1 -1
- package/dist/ripple/{p-c94ce42f.js → p-af59f267.js} +1 -1
- package/dist/ripple/{p-6b41644b.entry.js → p-b02789de.entry.js} +1 -1
- package/dist/ripple/{p-73081234.entry.js → p-b94b321e.entry.js} +1 -1
- package/dist/ripple/{p-0be3f364.entry.js → p-bff9eb65.entry.js} +1 -1
- package/dist/ripple/{p-66e539e2.entry.js → p-c04b1220.entry.js} +1 -1
- package/dist/ripple/{p-2e8211ba.system.entry.js → p-c47e258d.system.entry.js} +1 -1
- package/dist/ripple/{p-07a4b825.entry.js → p-ca3b0bb2.entry.js} +1 -1
- package/dist/ripple/{p-9bfe715c.system.entry.js → p-d019d91e.system.entry.js} +1 -1
- package/dist/ripple/{p-ca6bf276.entry.js → p-d5994e7c.entry.js} +1 -1
- package/dist/ripple/{p-67f7aa48.system.entry.js → p-d748064a.system.entry.js} +1 -1
- package/dist/ripple/{p-948173a2.system.entry.js → p-d88a38be.system.entry.js} +1 -1
- package/dist/ripple/{p-c234c194.system.js → p-db9aa520.system.js} +1 -1
- package/dist/ripple/{p-936e4fc3.entry.js → p-dd4b472e.entry.js} +1 -1
- package/dist/ripple/{p-501aa9b9.entry.js → p-de1215f6.entry.js} +1 -1
- package/dist/ripple/{p-b65b9b4c.entry.js → p-e1d41109.entry.js} +1 -1
- package/dist/ripple/{p-703841a3.entry.js → p-e8325573.entry.js} +1 -1
- package/dist/ripple/{p-ff650269.system.entry.js → p-e870d3b6.system.entry.js} +1 -1
- package/dist/ripple/p-eb253749.system.js +1 -0
- package/dist/ripple/{p-2af01e17.system.entry.js → p-f07452f0.system.entry.js} +1 -1
- package/dist/ripple/{p-678483ca.entry.js → p-f3e5f455.entry.js} +1 -1
- package/dist/ripple/{p-91785165.entry.js → p-fcb7edda.entry.js} +1 -1
- package/dist/ripple/{p-eb74d85f.entry.js → p-fd045847.entry.js} +1 -1
- package/dist/ripple/{p-b55bb2ab.entry.js → p-ffe8376a.entry.js} +1 -1
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/wm-search/wm-search.d.ts +1 -1
- package/dist/types/components/wm-toggletip/wm-toggletip.d.ts +2 -1
- package/dist/types/global/functions.d.ts +5 -1
- package/package.json +2 -2
- package/dist/esm-es5/app-globals-d3e3b925.js +0 -1
- package/dist/ripple/p-0494eb2c.system.js +0 -1
- package/dist/ripple/p-2785c796.entry.js +0 -1
- package/dist/ripple/p-46a5ea42.system.js +0 -1
- package/dist/ripple/p-6d0b3395.entry.js +0 -1
- package/dist/ripple/p-a5bdcf1b.entry.js +0 -1
- package/dist/ripple/p-c0157b4d.js +0 -1
- package/dist/ripple/p-de5b5ff0.system.entry.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
-
import { debounce,
|
|
2
|
+
import { debounce, findAllScrollableParents, intl } from "../../../global/functions";
|
|
3
3
|
export class ChartPopover {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.chartEl = this.el.parentElement.getRootNode().host;
|
|
@@ -39,16 +39,21 @@ export class ChartPopover {
|
|
|
39
39
|
componentDidLoad() {
|
|
40
40
|
// set up event listeners for scrolling
|
|
41
41
|
// to close popover on page scroll
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
const scrollableParents = findAllScrollableParents(this.chartEl);
|
|
43
|
+
scrollableParents.forEach(scrollableParent => {
|
|
44
|
+
if (scrollableParent === document.documentElement) {
|
|
45
|
+
// For document element, listen to window scroll event
|
|
46
|
+
window.addEventListener("scroll", () => {
|
|
47
|
+
this.debouncedClosePopover();
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
// For regular elements, listen to their scroll event
|
|
52
|
+
scrollableParent.addEventListener("scroll", () => {
|
|
53
|
+
this.debouncedClosePopover();
|
|
54
|
+
});
|
|
55
|
+
}
|
|
44
56
|
});
|
|
45
|
-
// ... and on parent scroll
|
|
46
|
-
const scrollableParent = findScrollableParent(this.chartEl);
|
|
47
|
-
if (!!scrollableParent) {
|
|
48
|
-
scrollableParent.addEventListener("scroll", () => {
|
|
49
|
-
this.debouncedClosePopover();
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
57
|
}
|
|
53
58
|
handleOpenChange() {
|
|
54
59
|
this.intChartPopoverOpenChanged.emit(this.open);
|
|
@@ -111,11 +116,11 @@ export class ChartPopover {
|
|
|
111
116
|
const titleAffordance = this.sliceDetails &&
|
|
112
117
|
this.sliceDetails.title &&
|
|
113
118
|
(this.sliceDetails.title[0] === "-" ? "negative" : this.sliceDetails.title[0] === "+" ? "positive" : "");
|
|
114
|
-
return (h(Host, { key: '
|
|
119
|
+
return (h(Host, { key: '25275e7ca9b1744629a4da08abccc1b99f301286' }, !!this.open && this.sliceDetails ? (h("div", { "aria-hidden": "true", class: "popover" }, h("h1", { class: `title ${titleAffordance}` }, this.sliceDetails.title), h("p", { class: "text" }, this.sliceDetails.text), this.sliceDetails.buttonText ? (
|
|
115
120
|
// @ts-ignore
|
|
116
121
|
h("button", { tabindex: "-1",
|
|
117
122
|
// @ts-ignore
|
|
118
|
-
focusable: "false", class: "popover-button", onClick: () => this.handleButtonClick() }, h("svg", { class: "btn-icon", height: "9", width: "9" }, h("path", { fill: "#575195", d: "M0 3.38v2.25h9V3.38H0zM0 0v2.25h4.5V0H0zm6.19 6.75H0V9h6.19V6.75z" })), h("span", { class: "button-text" }, this.sliceDetails.buttonText))) : (""))) : (""), h("div", { key: '
|
|
123
|
+
focusable: "false", class: "popover-button", onClick: () => this.handleButtonClick() }, h("svg", { class: "btn-icon", height: "9", width: "9" }, h("path", { fill: "#575195", d: "M0 3.38v2.25h9V3.38H0zM0 0v2.25h4.5V0H0zm6.19 6.75H0V9h6.19V6.75z" })), h("span", { class: "button-text" }, this.sliceDetails.buttonText))) : (""))) : (""), h("div", { key: 'cdfdb9f58ebcbe375cc50214aac091c890587935', ref: (el) => (this.liveRegion = el), class: "live-region sr-only", "aria-live": "polite", "aria-atomic": "true" }, this.open && this.renderLiveRegion())));
|
|
119
124
|
}
|
|
120
125
|
static get is() { return "priv-chart-popover"; }
|
|
121
126
|
static get originalStyleUrls() {
|
|
@@ -84,11 +84,13 @@ export class Search {
|
|
|
84
84
|
//For search-and-find, the results should always restart at "[1 or 0] of ..." after any new input.
|
|
85
85
|
//Reset the highlight count here just in case the new value doesn't end up changing the number of results.
|
|
86
86
|
this.resetHighlightCountToStart();
|
|
87
|
+
// Results should be announced at every input, even if no change in results occurred
|
|
88
|
+
this.announceResults();
|
|
87
89
|
}
|
|
88
90
|
handleNumResultsUpdate() {
|
|
89
91
|
this.resetHighlightCountToStart();
|
|
90
92
|
if (this.value) {
|
|
91
|
-
this.
|
|
93
|
+
this.announceResults();
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
handleDisabledChange() {
|
|
@@ -105,7 +107,7 @@ export class Search {
|
|
|
105
107
|
}
|
|
106
108
|
this.announcement = message;
|
|
107
109
|
}
|
|
108
|
-
|
|
110
|
+
announceResults() {
|
|
109
111
|
window.requestAnimationFrame(() => {
|
|
110
112
|
// requestAnimationFrame to allow all changes to occur before announcing results
|
|
111
113
|
let messageToAnnounce = this.resultCount;
|
|
@@ -130,7 +132,7 @@ export class Search {
|
|
|
130
132
|
this.highlightedNum = newNum;
|
|
131
133
|
}
|
|
132
134
|
this.wmSearchBrowseResults.emit({ position: this.highlightedNum });
|
|
133
|
-
this.
|
|
135
|
+
this.announceResults();
|
|
134
136
|
}
|
|
135
137
|
}
|
|
136
138
|
handleBlur() {
|
|
@@ -166,10 +168,10 @@ export class Search {
|
|
|
166
168
|
* End search and find render helpers
|
|
167
169
|
*/
|
|
168
170
|
render() {
|
|
169
|
-
return (h(Host, { key: '
|
|
171
|
+
return (h(Host, { key: 'a6a5d00652d75c3f03ca996c283c0566ad229c68' }, h("div", { key: '1e7e8a9207a2ee1d5412cb2456c1c832060ac77d', id: "wm-search-wrapper", class: `wm-search-wrapper ${this.searchType}` }, h("input", { key: '1f36cf57bcfed0f808ef0b222d8eb65cb6518615', disabled: this.isDisabled, id: "wm-search-input", placeholder: this.placeholder, "aria-label": `${this.label ? this.label + ". " : ""}${intl.formatMessage({
|
|
170
172
|
id: "search.typeToFilterResults",
|
|
171
173
|
defaultMessage: "Type to filter the results",
|
|
172
|
-
})}`, onInput: (ev) => this.updateValue(ev.target.value), onBlur: () => this.handleBlur(), "aria-autocomplete": "none", autocomplete: "off", value: this.value }), h("span", { key: '
|
|
174
|
+
})}`, onInput: (ev) => this.updateValue(ev.target.value), onBlur: () => this.handleBlur(), "aria-autocomplete": "none", autocomplete: "off", value: this.value }), h("span", { key: 'bf128d74c7fdbd590989d7999b1187d34b01bb31', class: "svg-icon svg-search" }), this.searchType === "find" && this.renderResultsAndBrowseButtons(), h("div", { key: '9898db1a5c0c3c0e13fb32782aa98d88f124798b', id: "wm-search-live", class: "sr-only", "aria-live": "polite", "aria-atomic": "true", ref: (el) => (this.resultsLiveRegion = el) }, this.announcement)), this.searchType === "find" && this.renderJumpToLink()));
|
|
173
175
|
}
|
|
174
176
|
static get is() { return "wm-search"; }
|
|
175
177
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
import { showTooltip, hideTooltip, shouldOpenUp, shouldOpenDown, shouldShiftLeft, shouldShiftRight, intl, debounce,
|
|
2
|
+
import { showTooltip, hideTooltip, shouldOpenUp, shouldOpenDown, shouldShiftLeft, shouldShiftRight, intl, debounce, findAllScrollableParents, getCumulativeScrollOffset, } from "../../global/functions";
|
|
3
3
|
export class Toggletip {
|
|
4
4
|
constructor() {
|
|
5
|
+
this.scrollableParents = [];
|
|
5
6
|
this.tooltipMessage = intl.formatMessage({
|
|
6
7
|
id: "toggletip.moreInformation",
|
|
7
8
|
defaultMessage: "More information",
|
|
8
9
|
});
|
|
9
10
|
this.debouncedReveal = debounce(() => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
11
|
+
const { x, y } = getCumulativeScrollOffset(this.el);
|
|
12
|
+
this.el.style.setProperty("--offset-x", "-" + x + "px");
|
|
13
|
+
this.el.style.setProperty("--offset-y", "-" + y + "px");
|
|
14
14
|
this.isHidden = false;
|
|
15
15
|
}, 100);
|
|
16
16
|
this.debouncedResize = debounce(() => {
|
|
17
|
-
this.
|
|
17
|
+
this.scrollableParents = findAllScrollableParents(this.el);
|
|
18
18
|
}, 200);
|
|
19
19
|
this.label = undefined;
|
|
20
20
|
this.tooltip = undefined;
|
|
@@ -89,16 +89,18 @@ export class Toggletip {
|
|
|
89
89
|
}
|
|
90
90
|
componentDidLoad() {
|
|
91
91
|
if (!CSS.supports("top", "anchor(bottom)")) {
|
|
92
|
-
this.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
92
|
+
this.scrollableParents = findAllScrollableParents(this.el);
|
|
93
|
+
// Add scroll listeners to all scrollable parents
|
|
94
|
+
this.scrollableParents.forEach(parent => {
|
|
95
|
+
if (parent === document.documentElement) {
|
|
96
|
+
// For document element, listen to window scroll event
|
|
97
|
+
window.addEventListener("scroll", () => this.handleScroll());
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
// For regular elements, listen to their scroll event
|
|
101
|
+
parent.addEventListener("scroll", () => this.handleScroll());
|
|
102
|
+
}
|
|
103
|
+
});
|
|
102
104
|
}
|
|
103
105
|
}
|
|
104
106
|
handleResize() {
|
|
@@ -130,6 +132,13 @@ export class Toggletip {
|
|
|
130
132
|
}
|
|
131
133
|
}
|
|
132
134
|
}
|
|
135
|
+
handleScroll() {
|
|
136
|
+
if (this.isOpen) {
|
|
137
|
+
if (!this.isHidden)
|
|
138
|
+
this.isHidden = true;
|
|
139
|
+
this.debouncedReveal();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
133
142
|
open() {
|
|
134
143
|
// the popover API takes care of the actual opening.
|
|
135
144
|
// toggletip is visually hidden by default so it can be measured and repositioned.
|
|
@@ -139,11 +148,9 @@ export class Toggletip {
|
|
|
139
148
|
this.toggletipEl.classList.add(this.toggletipPosition);
|
|
140
149
|
// handling scroll offset for older browsers (currently FF and Safari)
|
|
141
150
|
if (!CSS.supports("top", "anchor(bottom)")) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
this.el.style.setProperty("--offset-y", "-" + this.scrollableParent.scrollTop + "px");
|
|
146
|
-
}
|
|
151
|
+
const { x, y } = getCumulativeScrollOffset(this.el);
|
|
152
|
+
this.el.style.setProperty("--offset-x", "-" + x + "px");
|
|
153
|
+
this.el.style.setProperty("--offset-y", "-" + y + "px");
|
|
147
154
|
}
|
|
148
155
|
this.toggletipEl.classList.remove("hidden");
|
|
149
156
|
});
|
|
@@ -162,9 +169,9 @@ export class Toggletip {
|
|
|
162
169
|
}, 10);
|
|
163
170
|
}
|
|
164
171
|
render() {
|
|
165
|
-
return (h(Host, { key: '
|
|
172
|
+
return (h(Host, { key: 'a55a8dfabeac705978cc92af0a9d08a146fc9be0', class: `size-${this.targetSize}` }, h("button", { key: '65a11752911b7f4db68c30c8da0a382fbf8ae687', class: "button", type: "button", "aria-label": this.label, popoverTarget: "toggletip", popoverTargetAction: "toggle", onClick: () => this.open(),
|
|
166
173
|
// In order to position the tooltip identically to the toggletip, its presence is determined by these four events
|
|
167
|
-
onMouseEnter: () => !this.isOpen && showTooltip(this.toggletipPosition, this.el, this.tooltipMessage), onMouseLeave: () => hideTooltip(), onFocus: () => !this.isOpen && showTooltip(this.toggletipPosition, this.el, this.tooltipMessage), onBlur: () => this.handleBlur() }, h("div", { key: '
|
|
174
|
+
onMouseEnter: () => !this.isOpen && showTooltip(this.toggletipPosition, this.el, this.tooltipMessage), onMouseLeave: () => hideTooltip(), onFocus: () => !this.isOpen && showTooltip(this.toggletipPosition, this.el, this.tooltipMessage), onBlur: () => this.handleBlur() }, h("div", { key: '371bd1c9111743351e856e8bf3573894cd252262', class: "svg-icon svg-info" })), h("div", { key: 'cc4b2547678bce5e6803a3d53358e9ccbc4aafca', popover: "", ref: (el) => (this.toggletipEl = el), class: `toggletip ${this.targetSize} ${this.isHidden ? "hidden" : ""}`, id: "toggletip" }, this.tooltip), h("div", { key: '1744407f0b73c50aa5972a8dda5eb8dd25ddcd44', ref: (el) => (this.liveRegionEl = el), class: "live-region sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true" })));
|
|
168
175
|
}
|
|
169
176
|
static get is() { return "wm-toggletip"; }
|
|
170
177
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
requestAnimationFrame(() => {
|
|
2
|
-
// put toggletip in shadow DOM
|
|
2
|
+
// put toggletip in shadow DOM (now inside scrollable wrapper)
|
|
3
3
|
const host = document.querySelector("#host");
|
|
4
4
|
const shadow = host.attachShadow({ mode: "open" });
|
|
5
5
|
const tsd = document.querySelector("#tsd");
|
|
6
|
-
tsd.label = "Toggletip in shadow DOM";
|
|
7
|
-
tsd.tooltip = "
|
|
6
|
+
tsd.label = "Toggletip in shadow DOM with scrollable parent";
|
|
7
|
+
tsd.tooltip = "This should account for the red container's scroll offset";
|
|
8
8
|
shadow.appendChild(tsd);
|
|
9
9
|
});
|
|
@@ -73,20 +73,69 @@ export function getPosition(el) {
|
|
|
73
73
|
}
|
|
74
74
|
return { x, y };
|
|
75
75
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
function getParentOrHost(el) {
|
|
77
|
+
let nextEl = el.parentElement;
|
|
78
|
+
if (!nextEl) {
|
|
79
|
+
// Check if we're at a shadow root boundary
|
|
80
|
+
const rootNode = el.getRootNode();
|
|
81
|
+
if (rootNode instanceof ShadowRoot && rootNode.host) {
|
|
82
|
+
nextEl = rootNode.host;
|
|
80
83
|
}
|
|
81
|
-
el = el.parentElement;
|
|
82
84
|
}
|
|
85
|
+
return nextEl;
|
|
86
|
+
}
|
|
87
|
+
export function findAllScrollableParents(el) {
|
|
88
|
+
const scrollableParents = [];
|
|
89
|
+
let currentEl = getParentOrHost(el);
|
|
90
|
+
// Traverse up to and including the document.documentElement (html element)
|
|
91
|
+
while (currentEl) {
|
|
92
|
+
const style = window.getComputedStyle(currentEl);
|
|
93
|
+
if (["scroll", "auto"].includes(style.overflowY) || ["scroll", "auto"].includes(style.overflowX)) {
|
|
94
|
+
scrollableParents.push(currentEl);
|
|
95
|
+
}
|
|
96
|
+
if (currentEl.assignedSlot) {
|
|
97
|
+
// Redirect to shadow dom if element is in a slot
|
|
98
|
+
currentEl = currentEl.assignedSlot;
|
|
99
|
+
}
|
|
100
|
+
currentEl = getParentOrHost(currentEl);
|
|
101
|
+
}
|
|
102
|
+
if (document.documentElement && !scrollableParents.includes(document.documentElement)) {
|
|
103
|
+
// Check if the document itself is scrollable (common case for page-level scrolling)
|
|
104
|
+
// Special case: document element can scroll even with overflow: visible when content overflows viewport
|
|
105
|
+
const htmlStyle = window.getComputedStyle(document.documentElement);
|
|
106
|
+
if (["scroll", "auto"].includes(htmlStyle.overflowY) || ["scroll", "auto"].includes(htmlStyle.overflowX) ||
|
|
107
|
+
// For document element only: also check if page content can actually scroll
|
|
108
|
+
document.documentElement.scrollHeight > document.documentElement.clientHeight ||
|
|
109
|
+
document.documentElement.scrollWidth > document.documentElement.clientWidth) {
|
|
110
|
+
scrollableParents.push(document.documentElement);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return scrollableParents;
|
|
114
|
+
}
|
|
115
|
+
export function getCumulativeScrollOffset(el) {
|
|
116
|
+
const scrollableParents = findAllScrollableParents(el);
|
|
117
|
+
let totalScrollX = 0;
|
|
118
|
+
let totalScrollY = 0;
|
|
119
|
+
scrollableParents.forEach(parent => {
|
|
120
|
+
if (parent === document.documentElement) {
|
|
121
|
+
// For the document element, use window scroll values
|
|
122
|
+
totalScrollX += window.scrollX || window.pageXOffset || 0;
|
|
123
|
+
totalScrollY += window.scrollY || window.pageYOffset || 0;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
// For regular elements, use scrollLeft/scrollTop
|
|
127
|
+
totalScrollX += parent.scrollLeft;
|
|
128
|
+
totalScrollY += parent.scrollTop;
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
return { x: totalScrollX, y: totalScrollY };
|
|
83
132
|
}
|
|
84
133
|
export function findParentWithHiddenOverflow(el) {
|
|
85
134
|
while (!!el) {
|
|
86
135
|
if (window.getComputedStyle(el).overflowY !== "visible") {
|
|
87
136
|
return el;
|
|
88
137
|
}
|
|
89
|
-
el = el
|
|
138
|
+
el = getParentOrHost(el);
|
|
90
139
|
}
|
|
91
140
|
}
|
|
92
141
|
export function isElOrChild(componentEl, el) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from './index-130e07bb.js';
|
|
2
|
-
import { i as intl, c as checkForActiveElInShadow, e as safeMultiplyFloat, f as getPosition } from './functions-
|
|
2
|
+
import { i as intl, c as checkForActiveElInShadow, e as safeMultiplyFloat, f as getPosition } from './functions-85bc4418.js';
|
|
3
3
|
|
|
4
4
|
const colors = {
|
|
5
5
|
salmon: "#ff5f4e",
|
|
@@ -9820,20 +9820,69 @@ function getPosition(el) {
|
|
|
9820
9820
|
}
|
|
9821
9821
|
return { x, y };
|
|
9822
9822
|
}
|
|
9823
|
-
function
|
|
9824
|
-
|
|
9825
|
-
|
|
9826
|
-
|
|
9823
|
+
function getParentOrHost(el) {
|
|
9824
|
+
let nextEl = el.parentElement;
|
|
9825
|
+
if (!nextEl) {
|
|
9826
|
+
// Check if we're at a shadow root boundary
|
|
9827
|
+
const rootNode = el.getRootNode();
|
|
9828
|
+
if (rootNode instanceof ShadowRoot && rootNode.host) {
|
|
9829
|
+
nextEl = rootNode.host;
|
|
9827
9830
|
}
|
|
9828
|
-
el = el.parentElement;
|
|
9829
9831
|
}
|
|
9832
|
+
return nextEl;
|
|
9833
|
+
}
|
|
9834
|
+
function findAllScrollableParents(el) {
|
|
9835
|
+
const scrollableParents = [];
|
|
9836
|
+
let currentEl = getParentOrHost(el);
|
|
9837
|
+
// Traverse up to and including the document.documentElement (html element)
|
|
9838
|
+
while (currentEl) {
|
|
9839
|
+
const style = window.getComputedStyle(currentEl);
|
|
9840
|
+
if (["scroll", "auto"].includes(style.overflowY) || ["scroll", "auto"].includes(style.overflowX)) {
|
|
9841
|
+
scrollableParents.push(currentEl);
|
|
9842
|
+
}
|
|
9843
|
+
if (currentEl.assignedSlot) {
|
|
9844
|
+
// Redirect to shadow dom if element is in a slot
|
|
9845
|
+
currentEl = currentEl.assignedSlot;
|
|
9846
|
+
}
|
|
9847
|
+
currentEl = getParentOrHost(currentEl);
|
|
9848
|
+
}
|
|
9849
|
+
if (document.documentElement && !scrollableParents.includes(document.documentElement)) {
|
|
9850
|
+
// Check if the document itself is scrollable (common case for page-level scrolling)
|
|
9851
|
+
// Special case: document element can scroll even with overflow: visible when content overflows viewport
|
|
9852
|
+
const htmlStyle = window.getComputedStyle(document.documentElement);
|
|
9853
|
+
if (["scroll", "auto"].includes(htmlStyle.overflowY) || ["scroll", "auto"].includes(htmlStyle.overflowX) ||
|
|
9854
|
+
// For document element only: also check if page content can actually scroll
|
|
9855
|
+
document.documentElement.scrollHeight > document.documentElement.clientHeight ||
|
|
9856
|
+
document.documentElement.scrollWidth > document.documentElement.clientWidth) {
|
|
9857
|
+
scrollableParents.push(document.documentElement);
|
|
9858
|
+
}
|
|
9859
|
+
}
|
|
9860
|
+
return scrollableParents;
|
|
9861
|
+
}
|
|
9862
|
+
function getCumulativeScrollOffset(el) {
|
|
9863
|
+
const scrollableParents = findAllScrollableParents(el);
|
|
9864
|
+
let totalScrollX = 0;
|
|
9865
|
+
let totalScrollY = 0;
|
|
9866
|
+
scrollableParents.forEach(parent => {
|
|
9867
|
+
if (parent === document.documentElement) {
|
|
9868
|
+
// For the document element, use window scroll values
|
|
9869
|
+
totalScrollX += window.scrollX || window.pageXOffset || 0;
|
|
9870
|
+
totalScrollY += window.scrollY || window.pageYOffset || 0;
|
|
9871
|
+
}
|
|
9872
|
+
else {
|
|
9873
|
+
// For regular elements, use scrollLeft/scrollTop
|
|
9874
|
+
totalScrollX += parent.scrollLeft;
|
|
9875
|
+
totalScrollY += parent.scrollTop;
|
|
9876
|
+
}
|
|
9877
|
+
});
|
|
9878
|
+
return { x: totalScrollX, y: totalScrollY };
|
|
9830
9879
|
}
|
|
9831
9880
|
function findParentWithHiddenOverflow(el) {
|
|
9832
9881
|
while (!!el) {
|
|
9833
9882
|
if (window.getComputedStyle(el).overflowY !== "visible") {
|
|
9834
9883
|
return el;
|
|
9835
9884
|
}
|
|
9836
|
-
el = el
|
|
9885
|
+
el = getParentOrHost(el);
|
|
9837
9886
|
}
|
|
9838
9887
|
}
|
|
9839
9888
|
function isElOrChild(componentEl, el) {
|
|
@@ -10487,4 +10536,4 @@ const weekdays = [
|
|
|
10487
10536
|
intl.formatMessage({ id: "date.saturday", defaultMessage: "Saturday" }),
|
|
10488
10537
|
];
|
|
10489
10538
|
|
|
10490
|
-
export {
|
|
10539
|
+
export { findPrev as A, getTextDir as B, isElOrChild as C, throttle as D, getContextMeasurements as E, dateFind as F, calendar_months as G, findParentWithHiddenOverflow as H, transposeMatrix as I, wrapAround as J, getSmallestSkipInterval as K, calcPercentageInRange as L, makeISO as M, getMonthLength as N, weekdays as O, handleDisabledAttribute as a, triggerFormSubmit as b, checkForActiveElInShadow as c, debounce as d, safeMultiplyFloat as e, getPosition as f, generateId as g, hideTooltip as h, intl as i, dateToISO as j, shouldOpenUp as k, hasRoomRight as l, truncateText as m, getLastFocusableDescendant as n, csvToArray as o, snakeCaseToCamelCase as p, getNewIndexToFocus as q, getCumulativeScrollOffset as r, showTooltip as s, toBool as t, findAllScrollableParents as u, shouldOpenDown as v, shouldShiftRight as w, shouldShiftLeft as x, measureText as y, findNext as z };
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { b as bootstrapLazy } from './index-130e07bb.js';
|
|
2
2
|
export { s as setNonce } from './index-130e07bb.js';
|
|
3
|
-
import { g as globalScripts } from './app-globals-
|
|
3
|
+
import { g as globalScripts } from './app-globals-3753b41d.js';
|
|
4
4
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|