@watermarkinsights/ripple 3.7.0-3 → 3.7.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/README.md +3 -3
- package/dist/cjs/{functions-f0693632.js → functions-13b0e88e.js} +442 -442
- package/dist/cjs/{global-69ca443d.js → global-c802d13c.js} +65 -65
- package/dist/cjs/{http-service-494d81de.js → http-service-9e8c4dd5.js} +49 -49
- package/dist/cjs/{interfaces-a3338581.js → interfaces-30a74c1f.js} +29 -29
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/priv-chart-popover.cjs.entry.js +78 -78
- package/dist/cjs/priv-datepicker.cjs.entry.js +667 -667
- package/dist/cjs/priv-navigator-button.cjs.entry.js +18 -18
- package/dist/cjs/priv-navigator-item.cjs.entry.js +23 -23
- package/dist/cjs/ripple.cjs.js +1 -1
- package/dist/cjs/wm-action-menu_2.cjs.entry.js +341 -341
- package/dist/cjs/wm-button.cjs.entry.js +236 -236
- package/dist/cjs/wm-chart-slice.cjs.entry.js +13 -13
- package/dist/cjs/wm-chart.cjs.entry.js +474 -474
- package/dist/cjs/wm-datepicker.cjs.entry.js +262 -262
- package/dist/cjs/wm-input.cjs.entry.js +134 -134
- package/dist/cjs/wm-modal-footer.cjs.entry.js +31 -31
- package/dist/cjs/wm-modal-header.cjs.entry.js +34 -34
- package/dist/cjs/wm-modal.cjs.entry.js +161 -161
- package/dist/cjs/wm-navigator.cjs.entry.js +268 -268
- package/dist/cjs/wm-network-uploader.cjs.entry.js +420 -420
- package/dist/cjs/wm-option_2.cjs.entry.js +494 -494
- package/dist/cjs/wm-pagination.cjs.entry.js +167 -167
- package/dist/cjs/wm-search.cjs.entry.js +232 -231
- package/dist/cjs/wm-snackbar.cjs.entry.js +170 -170
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +296 -296
- package/dist/cjs/wm-tag-input.cjs.entry.js +570 -570
- package/dist/cjs/wm-timepicker.cjs.entry.js +380 -380
- package/dist/cjs/wm-toggletip.cjs.entry.js +124 -124
- package/dist/cjs/wm-uploader.cjs.entry.js +346 -346
- package/dist/cjs/wm-wrapper.cjs.entry.js +12 -12
- package/dist/collection/components/wm-action-menu/wm-action-menu.js +460 -460
- package/dist/collection/components/wm-button/wm-button.js +503 -503
- package/dist/collection/components/wm-chart/priv-chart-popover/priv-chart-popover.js +232 -232
- package/dist/collection/components/wm-chart/wm-chart-slice.js +64 -64
- package/dist/collection/components/wm-chart/wm-chart.js +718 -718
- package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.js +1015 -1015
- package/dist/collection/components/wm-datepicker/wm-datepicker.js +468 -468
- package/dist/collection/components/wm-input/wm-input.js +423 -423
- package/dist/collection/components/wm-menuitem/wm-menuitem.js +444 -444
- package/dist/collection/components/wm-modal/wm-modal-footer.js +141 -141
- package/dist/collection/components/wm-modal/wm-modal-header.js +92 -92
- package/dist/collection/components/wm-modal/wm-modal.js +459 -459
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +97 -97
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +114 -114
- package/dist/collection/components/wm-navigator/wm-navigator.js +468 -468
- package/dist/collection/components/wm-option/wm-option.js +422 -422
- package/dist/collection/components/wm-pagination/wm-pagination.js +368 -368
- package/dist/collection/components/wm-search/wm-search.js +480 -479
- package/dist/collection/components/wm-select/wm-select.js +720 -720
- package/dist/collection/components/wm-snackbar/wm-snackbar.js +297 -297
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +216 -216
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +330 -330
- package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +104 -104
- package/dist/collection/components/wm-tag-input/wm-tag-input.js +801 -801
- package/dist/collection/components/wm-timepicker/wm-timepicker.js +580 -580
- package/dist/collection/components/wm-toggletip/wm-toggletip.js +241 -241
- package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.js +753 -753
- package/dist/collection/components/wm-uploader/wm-uploader.js +748 -748
- package/dist/collection/components/wm-wrapper/wm-wrapper.js +27 -27
- package/dist/collection/dev/scripts.js +20 -20
- package/dist/collection/global/__mocks__/functions.js +6 -6
- package/dist/collection/global/functions.js +445 -445
- package/dist/collection/global/global.js +72 -72
- package/dist/collection/global/interfaces.js +49 -49
- package/dist/collection/global/services/__mocks__/http-service.js +130 -130
- package/dist/collection/global/services/http-service.js +50 -50
- package/dist/collection/lang/lang.js +5 -5
- package/dist/collection/lang/missing.js +39 -39
- package/dist/collection/lang/piglatin.js +93 -93
- package/dist/esm/{functions-cbfc81d1.js → functions-6ddad20e.js} +442 -442
- package/dist/esm/{global-a12289f9.js → global-a4da88c7.js} +65 -65
- package/dist/esm/{http-service-3dc3b3e7.js → http-service-5d037e16.js} +49 -49
- package/dist/esm/{interfaces-2b97fab2.js → interfaces-61c6305b.js} +29 -29
- package/dist/esm/loader.js +1 -1
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/priv-chart-popover.entry.js +78 -78
- package/dist/esm/priv-datepicker.entry.js +667 -667
- package/dist/esm/priv-navigator-button.entry.js +18 -18
- package/dist/esm/priv-navigator-item.entry.js +23 -23
- package/dist/esm/ripple.js +1 -1
- package/dist/esm/wm-action-menu_2.entry.js +341 -341
- package/dist/esm/wm-button.entry.js +236 -236
- package/dist/esm/wm-chart-slice.entry.js +13 -13
- package/dist/esm/wm-chart.entry.js +474 -474
- package/dist/esm/wm-datepicker.entry.js +262 -262
- package/dist/esm/wm-input.entry.js +134 -134
- package/dist/esm/wm-modal-footer.entry.js +31 -31
- package/dist/esm/wm-modal-header.entry.js +34 -34
- package/dist/esm/wm-modal.entry.js +161 -161
- package/dist/esm/wm-navigator.entry.js +268 -268
- package/dist/esm/wm-network-uploader.entry.js +420 -420
- package/dist/esm/wm-option_2.entry.js +494 -494
- package/dist/esm/wm-pagination.entry.js +167 -167
- package/dist/esm/wm-search.entry.js +232 -231
- package/dist/esm/wm-snackbar.entry.js +170 -170
- package/dist/esm/wm-tab-item_3.entry.js +296 -296
- package/dist/esm/wm-tag-input.entry.js +570 -570
- package/dist/esm/wm-timepicker.entry.js +380 -380
- package/dist/esm/wm-toggletip.entry.js +124 -124
- package/dist/esm/wm-uploader.entry.js +346 -346
- package/dist/esm/wm-wrapper.entry.js +12 -12
- package/dist/ripple/{p-5585f23e.entry.js → p-0068e871.entry.js} +1 -1
- package/dist/ripple/{p-7d9c18b9.entry.js → p-00999aeb.entry.js} +1 -1
- package/dist/ripple/{p-cd466a5b.entry.js → p-08b273ba.entry.js} +1 -1
- package/dist/ripple/{p-266e4bc2.entry.js → p-196b4c55.entry.js} +1 -1
- package/dist/ripple/{p-e3765b8e.entry.js → p-1a3df227.entry.js} +1 -1
- package/dist/ripple/{p-30f13477.entry.js → p-3590a57f.entry.js} +1 -1
- package/dist/ripple/{p-8a4bac13.entry.js → p-3a178ac8.entry.js} +1 -1
- package/dist/ripple/{p-74438aab.entry.js → p-46371fad.entry.js} +1 -1
- package/dist/ripple/p-5548fc7c.js +1 -0
- package/dist/ripple/{p-da1435f1.entry.js → p-5c73fd59.entry.js} +1 -1
- package/dist/ripple/{p-0c488d9d.entry.js → p-66513af1.entry.js} +1 -1
- package/dist/ripple/{p-bd05632b.entry.js → p-828316d6.entry.js} +1 -1
- package/dist/ripple/{p-b5edcf38.js → p-857a0bc0.js} +0 -0
- package/dist/ripple/{p-43f1298b.js → p-888bec42.js} +0 -0
- package/dist/ripple/{p-2caeca6b.entry.js → p-9624967f.entry.js} +1 -1
- package/dist/ripple/{p-938a5ba4.entry.js → p-99e2c5f6.entry.js} +1 -1
- package/dist/ripple/{p-fd8070fb.js → p-a6d6eae7.js} +0 -0
- package/dist/ripple/{p-b9656d44.entry.js → p-b495e06c.entry.js} +1 -1
- package/dist/ripple/{p-4870d369.entry.js → p-b8aa478f.entry.js} +1 -1
- package/dist/ripple/{p-4414cb64.entry.js → p-bf985c5d.entry.js} +1 -1
- package/dist/ripple/{p-c0b0510a.entry.js → p-cd6de442.entry.js} +1 -1
- package/dist/ripple/{p-111f705a.entry.js → p-cfdf1a79.entry.js} +1 -1
- package/dist/ripple/{p-ad73d523.entry.js → p-d22c957d.entry.js} +1 -1
- package/dist/ripple/{p-f3569e91.entry.js → p-e43b4eda.entry.js} +1 -1
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/types/components/wm-action-menu/wm-action-menu.d.ts +48 -48
- package/dist/types/components/wm-button/wm-button.d.ts +44 -44
- package/dist/types/components/wm-chart/priv-chart-popover/priv-chart-popover.d.ts +23 -23
- package/dist/types/components/wm-chart/wm-chart-slice.d.ts +8 -8
- package/dist/types/components/wm-chart/wm-chart.d.ts +82 -82
- package/dist/types/components/wm-datepicker/priv-datepicker/priv-datepicker.d.ts +76 -76
- package/dist/types/components/wm-datepicker/wm-datepicker.d.ts +41 -41
- package/dist/types/components/wm-input/wm-input.d.ts +46 -46
- package/dist/types/components/wm-menuitem/wm-menuitem.d.ts +34 -34
- package/dist/types/components/wm-modal/wm-modal-footer.d.ts +15 -15
- package/dist/types/components/wm-modal/wm-modal-header.d.ts +12 -12
- package/dist/types/components/wm-modal/wm-modal.d.ts +41 -41
- package/dist/types/components/wm-navigator/priv-navigator-button/priv-navigator-button.d.ts +10 -10
- package/dist/types/components/wm-navigator/priv-navigator-item/priv-navigator-item.d.ts +13 -13
- package/dist/types/components/wm-navigator/wm-navigator.d.ts +61 -61
- package/dist/types/components/wm-option/wm-option.d.ts +32 -32
- package/dist/types/components/wm-pagination/wm-pagination.d.ts +32 -32
- package/dist/types/components/wm-search/wm-search.d.ts +86 -86
- package/dist/types/components/wm-select/wm-select.d.ts +66 -66
- package/dist/types/components/wm-snackbar/wm-snackbar.d.ts +35 -35
- package/dist/types/components/wm-tabs/wm-tab-item/wm-tab-item.d.ts +38 -38
- package/dist/types/components/wm-tabs/wm-tab-list/wm-tab-list.d.ts +53 -53
- package/dist/types/components/wm-tabs/wm-tab-panel/wm-tab-panel.d.ts +20 -20
- package/dist/types/components/wm-tag-input/wm-tag-input.d.ts +92 -92
- package/dist/types/components/wm-timepicker/wm-timepicker.d.ts +61 -61
- package/dist/types/components/wm-toggletip/wm-toggletip.d.ts +27 -27
- package/dist/types/components/wm-uploader/wm-network-uploader/wm-network-uploader.d.ts +85 -85
- package/dist/types/components/wm-uploader/wm-uploader.d.ts +80 -80
- package/dist/types/components/wm-wrapper/wm-wrapper.d.ts +7 -7
- package/dist/types/components.d.ts +24 -24
- package/dist/types/global/__mocks__/functions.d.ts +6 -6
- package/dist/types/global/functions.d.ts +40 -40
- package/dist/types/global/global.d.ts +1 -1
- package/dist/types/global/interfaces.d.ts +34 -34
- package/dist/types/global/services/__mocks__/http-service.d.ts +6 -6
- package/dist/types/global/services/http-service.d.ts +4 -4
- package/dist/types/lang/lang.d.ts +5 -5
- package/package.json +47 -47
- package/dist/ripple/p-c296ff27.js +0 -1
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
const version = "3.7.0
|
|
1
|
+
const version = "3.7.0";
|
|
2
2
|
|
|
3
|
-
// PRINT RIPPLE VERSION IN CONSOLE
|
|
4
|
-
// test envs return 0 for plugin.length
|
|
5
|
-
// do not print version number there as it causes issues
|
|
6
|
-
if (window.navigator.plugins.length > 0) {
|
|
7
|
-
console.log("Ripple component library", version);
|
|
8
|
-
}
|
|
9
|
-
// USER-IS-TABBING CLASSES (FOR FOCUS INDICATORS)
|
|
10
|
-
// Dispatching events to track whether user is navigating with keyboard or mouse
|
|
11
|
-
function wmComponentKeys(ev) {
|
|
12
|
-
var key = ev.key || ev.keyCode;
|
|
13
|
-
if (key == "Tab" || key === 9) {
|
|
14
|
-
var event = new Event("wmUserIsTabbing");
|
|
15
|
-
window.dispatchEvent(event);
|
|
16
|
-
document.querySelector("body").classList.add("wmcl-user-is-tabbing");
|
|
17
|
-
}
|
|
18
|
-
if (key == "ArrowLeft" ||
|
|
19
|
-
key === 37 ||
|
|
20
|
-
key == "ArrowUp" ||
|
|
21
|
-
key === 38 ||
|
|
22
|
-
key == "ArrowRight" ||
|
|
23
|
-
key === 39 ||
|
|
24
|
-
key == "ArrowDown" ||
|
|
25
|
-
key === 40) {
|
|
26
|
-
var event = new Event("wmUserIsKeying");
|
|
27
|
-
window.dispatchEvent(event);
|
|
28
|
-
document.querySelector("body").classList.add("wmcl-user-is-keying");
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function wmComponentMouseDownOnce() {
|
|
32
|
-
var event = new Event("wmUserIsNotTabbing");
|
|
33
|
-
window.dispatchEvent(event);
|
|
34
|
-
document.querySelector("body").classList.remove("wmcl-user-is-tabbing");
|
|
35
|
-
document.querySelector("body").classList.remove("wmcl-user-is-keying");
|
|
36
|
-
}
|
|
37
|
-
window.addEventListener("keydown", wmComponentKeys);
|
|
38
|
-
window.addEventListener("mousedown", wmComponentMouseDownOnce);
|
|
39
|
-
// TOOLTIP
|
|
40
|
-
// Add a tooltip element
|
|
41
|
-
// This allows tooltips to be always at the highest stacking context (always on top)
|
|
42
|
-
// Element is added withing a container to avoid performance impact
|
|
43
|
-
const tooltipContainer = document.createElement("div");
|
|
44
|
-
tooltipContainer.id = "wm-tooltip-container";
|
|
45
|
-
const tooltipEl = document.createElement("div");
|
|
46
|
-
tooltipEl.id = "wm-tooltip";
|
|
47
|
-
tooltipEl.setAttribute("aria-hidden", "true");
|
|
48
|
-
tooltipEl.style.position = "fixed";
|
|
49
|
-
tooltipEl.style.overflow = "hidden";
|
|
50
|
-
tooltipEl.style.pointerEvents = "none";
|
|
51
|
-
tooltipEl.style.lineHeight = "normal";
|
|
52
|
-
tooltipEl.style.fontFamily = "inherit";
|
|
53
|
-
tooltipEl.style.fontSize = "0.875rem";
|
|
54
|
-
tooltipEl.style.textTransform = "none";
|
|
55
|
-
tooltipEl.style.fontWeight = "normal";
|
|
56
|
-
tooltipEl.style.background = "black";
|
|
57
|
-
tooltipEl.style.color = "#fff";
|
|
58
|
-
tooltipEl.style.zIndex = "999999";
|
|
59
|
-
tooltipEl.style.maxWidth = "13.75rem";
|
|
60
|
-
tooltipEl.style.marginRight = "1.5rem";
|
|
61
|
-
tooltipEl.style.padding = "0.375rem";
|
|
62
|
-
tooltipEl.style.transitionProperty = "opacity";
|
|
63
|
-
tooltipEl.style.transitionDelay = "opacity";
|
|
64
|
-
tooltipEl.style.opacity = "0";
|
|
65
|
-
tooltipContainer.appendChild(tooltipEl);
|
|
66
|
-
const body = document.querySelector("body");
|
|
3
|
+
// PRINT RIPPLE VERSION IN CONSOLE
|
|
4
|
+
// test envs return 0 for plugin.length
|
|
5
|
+
// do not print version number there as it causes issues
|
|
6
|
+
if (window.navigator.plugins.length > 0) {
|
|
7
|
+
console.log("Ripple component library", version);
|
|
8
|
+
}
|
|
9
|
+
// USER-IS-TABBING CLASSES (FOR FOCUS INDICATORS)
|
|
10
|
+
// Dispatching events to track whether user is navigating with keyboard or mouse
|
|
11
|
+
function wmComponentKeys(ev) {
|
|
12
|
+
var key = ev.key || ev.keyCode;
|
|
13
|
+
if (key == "Tab" || key === 9) {
|
|
14
|
+
var event = new Event("wmUserIsTabbing");
|
|
15
|
+
window.dispatchEvent(event);
|
|
16
|
+
document.querySelector("body").classList.add("wmcl-user-is-tabbing");
|
|
17
|
+
}
|
|
18
|
+
if (key == "ArrowLeft" ||
|
|
19
|
+
key === 37 ||
|
|
20
|
+
key == "ArrowUp" ||
|
|
21
|
+
key === 38 ||
|
|
22
|
+
key == "ArrowRight" ||
|
|
23
|
+
key === 39 ||
|
|
24
|
+
key == "ArrowDown" ||
|
|
25
|
+
key === 40) {
|
|
26
|
+
var event = new Event("wmUserIsKeying");
|
|
27
|
+
window.dispatchEvent(event);
|
|
28
|
+
document.querySelector("body").classList.add("wmcl-user-is-keying");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function wmComponentMouseDownOnce() {
|
|
32
|
+
var event = new Event("wmUserIsNotTabbing");
|
|
33
|
+
window.dispatchEvent(event);
|
|
34
|
+
document.querySelector("body").classList.remove("wmcl-user-is-tabbing");
|
|
35
|
+
document.querySelector("body").classList.remove("wmcl-user-is-keying");
|
|
36
|
+
}
|
|
37
|
+
window.addEventListener("keydown", wmComponentKeys);
|
|
38
|
+
window.addEventListener("mousedown", wmComponentMouseDownOnce);
|
|
39
|
+
// TOOLTIP
|
|
40
|
+
// Add a tooltip element
|
|
41
|
+
// This allows tooltips to be always at the highest stacking context (always on top)
|
|
42
|
+
// Element is added withing a container to avoid performance impact
|
|
43
|
+
const tooltipContainer = document.createElement("div");
|
|
44
|
+
tooltipContainer.id = "wm-tooltip-container";
|
|
45
|
+
const tooltipEl = document.createElement("div");
|
|
46
|
+
tooltipEl.id = "wm-tooltip";
|
|
47
|
+
tooltipEl.setAttribute("aria-hidden", "true");
|
|
48
|
+
tooltipEl.style.position = "fixed";
|
|
49
|
+
tooltipEl.style.overflow = "hidden";
|
|
50
|
+
tooltipEl.style.pointerEvents = "none";
|
|
51
|
+
tooltipEl.style.lineHeight = "normal";
|
|
52
|
+
tooltipEl.style.fontFamily = "inherit";
|
|
53
|
+
tooltipEl.style.fontSize = "0.875rem";
|
|
54
|
+
tooltipEl.style.textTransform = "none";
|
|
55
|
+
tooltipEl.style.fontWeight = "normal";
|
|
56
|
+
tooltipEl.style.background = "black";
|
|
57
|
+
tooltipEl.style.color = "#fff";
|
|
58
|
+
tooltipEl.style.zIndex = "999999";
|
|
59
|
+
tooltipEl.style.maxWidth = "13.75rem";
|
|
60
|
+
tooltipEl.style.marginRight = "1.5rem";
|
|
61
|
+
tooltipEl.style.padding = "0.375rem";
|
|
62
|
+
tooltipEl.style.transitionProperty = "opacity";
|
|
63
|
+
tooltipEl.style.transitionDelay = "opacity";
|
|
64
|
+
tooltipEl.style.opacity = "0";
|
|
65
|
+
tooltipContainer.appendChild(tooltipEl);
|
|
66
|
+
const body = document.querySelector("body");
|
|
67
67
|
body.appendChild(tooltipContainer);
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
const getRequest = async (url) => {
|
|
2
|
-
const response = await fetch(url);
|
|
3
|
-
if (!!response && !!response.ok) {
|
|
4
|
-
return await response.json();
|
|
5
|
-
}
|
|
6
|
-
else {
|
|
7
|
-
throw new Error(response.statusText);
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
const postRequest = async (url, payload) => {
|
|
11
|
-
const response = await fetch(url, {
|
|
12
|
-
method: "POST",
|
|
13
|
-
headers: { "Content-Type": "application/json; charset=utf-8" },
|
|
14
|
-
body: JSON.stringify(payload),
|
|
15
|
-
});
|
|
16
|
-
if (!!response && !!response.ok) {
|
|
17
|
-
return await response.json();
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
throw new Error(response.statusText);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
const deleteRequest = async (url) => {
|
|
24
|
-
const response = await fetch(url, { method: "DELETE" });
|
|
25
|
-
if (!!response && !!response.ok) {
|
|
26
|
-
return await response.json();
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
throw new Error(response.statusText);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
const putRequest = (url, file, onProgress) => {
|
|
33
|
-
return new Promise((resolve, reject) => {
|
|
34
|
-
// there's no way to track progress with the fetch API, so using XHR
|
|
35
|
-
const req = new XMLHttpRequest();
|
|
36
|
-
req.upload.addEventListener("progress", (ev) => onProgress(ev));
|
|
37
|
-
req.addEventListener("readystatechange", function () {
|
|
38
|
-
if (this.readyState === 4 && this.status === 200) {
|
|
39
|
-
resolve(this);
|
|
40
|
-
}
|
|
41
|
-
else if (this.readyState === 4 && this.status !== 200) {
|
|
42
|
-
reject();
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
req.onerror = () => reject();
|
|
46
|
-
req.open("PUT", url, true);
|
|
47
|
-
req.setRequestHeader("Content-Disposition", `attachment;filename="${file.name}"`);
|
|
48
|
-
req.send(file);
|
|
49
|
-
});
|
|
1
|
+
const getRequest = async (url) => {
|
|
2
|
+
const response = await fetch(url);
|
|
3
|
+
if (!!response && !!response.ok) {
|
|
4
|
+
return await response.json();
|
|
5
|
+
}
|
|
6
|
+
else {
|
|
7
|
+
throw new Error(response.statusText);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
const postRequest = async (url, payload) => {
|
|
11
|
+
const response = await fetch(url, {
|
|
12
|
+
method: "POST",
|
|
13
|
+
headers: { "Content-Type": "application/json; charset=utf-8" },
|
|
14
|
+
body: JSON.stringify(payload),
|
|
15
|
+
});
|
|
16
|
+
if (!!response && !!response.ok) {
|
|
17
|
+
return await response.json();
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
throw new Error(response.statusText);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const deleteRequest = async (url) => {
|
|
24
|
+
const response = await fetch(url, { method: "DELETE" });
|
|
25
|
+
if (!!response && !!response.ok) {
|
|
26
|
+
return await response.json();
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
throw new Error(response.statusText);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const putRequest = (url, file, onProgress) => {
|
|
33
|
+
return new Promise((resolve, reject) => {
|
|
34
|
+
// there's no way to track progress with the fetch API, so using XHR
|
|
35
|
+
const req = new XMLHttpRequest();
|
|
36
|
+
req.upload.addEventListener("progress", (ev) => onProgress(ev));
|
|
37
|
+
req.addEventListener("readystatechange", function () {
|
|
38
|
+
if (this.readyState === 4 && this.status === 200) {
|
|
39
|
+
resolve(this);
|
|
40
|
+
}
|
|
41
|
+
else if (this.readyState === 4 && this.status !== 200) {
|
|
42
|
+
reject();
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
req.onerror = () => reject();
|
|
46
|
+
req.open("PUT", url, true);
|
|
47
|
+
req.setRequestHeader("Content-Disposition", `attachment;filename="${file.name}"`);
|
|
48
|
+
req.send(file);
|
|
49
|
+
});
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
export { postRequest as a, deleteRequest as d, getRequest as g, putRequest as p };
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
//List of icon codes with more indicative descriptors to create labels for icon-only buttons
|
|
2
|
-
function getIconCodeFromName(icon) {
|
|
3
|
-
return iconCodes[icon] || icon;
|
|
4
|
-
}
|
|
5
|
-
const iconCodes = {
|
|
6
|
-
close: "f156",
|
|
7
|
-
pencil: "f3eb",
|
|
8
|
-
cancel: "f739",
|
|
9
|
-
check: "f12c",
|
|
10
|
-
delete: "f1c0",
|
|
11
|
-
magnify: "f349",
|
|
12
|
-
export: "f207",
|
|
13
|
-
"dots-vertical": "f1d9",
|
|
14
|
-
"arrow-left": "f04d",
|
|
15
|
-
"arrow-right": "f054",
|
|
16
|
-
"chevron-left": "f141",
|
|
17
|
-
"chevron-right": "f142",
|
|
18
|
-
"menu-left": "f35e",
|
|
19
|
-
"menu-down": "f35d",
|
|
20
|
-
"keyboard-backspace": "f30d",
|
|
21
|
-
"file-tree": "f645",
|
|
22
|
-
"sort-alphabetical": "f4bb",
|
|
23
|
-
"checkbox-marked-circle": "f133",
|
|
24
|
-
"account-settings": "f630",
|
|
25
|
-
"backup-restore": "f06f",
|
|
26
|
-
};
|
|
27
|
-
const defaultMode = "planning";
|
|
28
|
-
const getWmMode = (ref) => {
|
|
29
|
-
return ref.getAttribute("mode") || document.documentElement.getAttribute("mode") || defaultMode;
|
|
1
|
+
//List of icon codes with more indicative descriptors to create labels for icon-only buttons
|
|
2
|
+
function getIconCodeFromName(icon) {
|
|
3
|
+
return iconCodes[icon] || icon;
|
|
4
|
+
}
|
|
5
|
+
const iconCodes = {
|
|
6
|
+
close: "f156",
|
|
7
|
+
pencil: "f3eb",
|
|
8
|
+
cancel: "f739",
|
|
9
|
+
check: "f12c",
|
|
10
|
+
delete: "f1c0",
|
|
11
|
+
magnify: "f349",
|
|
12
|
+
export: "f207",
|
|
13
|
+
"dots-vertical": "f1d9",
|
|
14
|
+
"arrow-left": "f04d",
|
|
15
|
+
"arrow-right": "f054",
|
|
16
|
+
"chevron-left": "f141",
|
|
17
|
+
"chevron-right": "f142",
|
|
18
|
+
"menu-left": "f35e",
|
|
19
|
+
"menu-down": "f35d",
|
|
20
|
+
"keyboard-backspace": "f30d",
|
|
21
|
+
"file-tree": "f645",
|
|
22
|
+
"sort-alphabetical": "f4bb",
|
|
23
|
+
"checkbox-marked-circle": "f133",
|
|
24
|
+
"account-settings": "f630",
|
|
25
|
+
"backup-restore": "f06f",
|
|
26
|
+
};
|
|
27
|
+
const defaultMode = "planning";
|
|
28
|
+
const getWmMode = (ref) => {
|
|
29
|
+
return ref.getAttribute("mode") || document.documentElement.getAttribute("mode") || defaultMode;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
export { getWmMode as a, getIconCodeFromName as g };
|
package/dist/esm/loader.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,85 +1,85 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-66f8130e.js';
|
|
2
|
-
import { i as intl } from './functions-
|
|
2
|
+
import { i as intl } from './functions-6ddad20e.js';
|
|
3
3
|
|
|
4
4
|
const privChartPopoverCss = "priv-chart-popover{position:fixed;z-index:10;border-radius:0.1875rem;-webkit-box-shadow:0 11px 15px 0 rgba(0, 0, 0, 0.2), 0 7px 20px 0 rgba(0, 0, 0, 0.12);-moz-box-shadow:0 11px 15px 0 rgba(0, 0, 0, 0.2), 0 7px 20px 0 rgba(0, 0, 0, 0.12);box-shadow:0 11px 15px 0 rgba(0, 0, 0, 0.2), 0 7px 20px 0 rgba(0, 0, 0, 0.12);background-color:#fff;font-size:0.875rem;text-align:left}priv-chart-popover.user-is-tabbing .button-text{background:linear-gradient(90deg, #3862e9 66%, transparent 0) repeat-x;background-size:6px 3px;background-position:0 1em;border-radius:0;line-height:normal}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}.popover{width:10.5rem;padding:0.625rem 0.9375rem;box-sizing:border-box}.popover h1.title{font-size:1em;font-weight:500;margin:0;padding-top:0;padding-left:0;padding-bottom:0.25rem}.popover .text{margin:0;margin-bottom:0.5rem}.popover .popover-button{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;position:relative;display:inline-block;margin-left:1rem;padding-left:0;padding-right:0;height:auto;border:none;background:transparent;cursor:pointer;text-decoration:none;letter-spacing:0;text-transform:none;text-align:initial;font-size:0.875rem;font-weight:700;color:#575195;line-height:normal}.popover .popover-button .btn-icon{position:absolute;top:0.1875rem;left:-1rem}.popover .popover-button:focus{outline:none}.popover .popover-button::-moz-focus-inner{border:0;outline:none}.popover .popover-button:hover{text-decoration:none;background:none;color:#454077}.popover .popover-button:hover span{text-decoration:underline}";
|
|
5
5
|
|
|
6
|
-
const ChartPopover = class {
|
|
7
|
-
constructor(hostRef) {
|
|
8
|
-
registerInstance(this, hostRef);
|
|
9
|
-
this.wmChartPopoverButtonTriggered = createEvent(this, "wmChartPopoverButtonTriggered", 7);
|
|
10
|
-
this.open = false;
|
|
11
|
-
this.coords = {};
|
|
12
|
-
this.popoverWidth = 168;
|
|
13
|
-
this.popoverClicked = false;
|
|
14
|
-
}
|
|
15
|
-
handleClickOnDocument() {
|
|
16
|
-
// because this listener is set document-wide, whenever something inside it is clicked
|
|
17
|
-
// the event target returned will always be the host (wm-chart)
|
|
18
|
-
// the element within wm-chart is determined by the other listener and saved as var popoverClicked for use here
|
|
19
|
-
// capture = false in @Listen ensures order of execution
|
|
20
|
-
this.open = this.popoverClicked;
|
|
21
|
-
this.popoverClicked = false;
|
|
22
|
-
}
|
|
23
|
-
handleClick(ev) {
|
|
24
|
-
let popoverBtnClicked = false;
|
|
25
|
-
if (this.btnEl) {
|
|
26
|
-
popoverBtnClicked = ev.target === this.btnEl || this.btnEl.contains(ev.target);
|
|
27
|
-
}
|
|
28
|
-
// if the click is on the popover (except the popover button),
|
|
29
|
-
// set popoverClicked to true. It will be used by the other listener above
|
|
30
|
-
this.popoverClicked = !popoverBtnClicked && (ev.target === this.el || this.el.contains(ev.target));
|
|
31
|
-
}
|
|
32
|
-
renderLiveRegion() {
|
|
33
|
-
if (this.liveRegion) {
|
|
34
|
-
this.liveRegion.innerHTML = "";
|
|
35
|
-
const wrapper = document.createElement("div");
|
|
36
|
-
const titleEl = document.createElement("span");
|
|
37
|
-
titleEl.innerHTML = this.popoverTitle + " " || "";
|
|
38
|
-
wrapper.appendChild(titleEl);
|
|
39
|
-
const textEl = document.createElement("span");
|
|
40
|
-
textEl.innerHTML = this.popoverText + " " || "";
|
|
41
|
-
wrapper.appendChild(textEl);
|
|
42
|
-
if (this.buttonText) {
|
|
43
|
-
const buttonEl = document.createElement("span");
|
|
44
|
-
buttonEl.innerHTML =
|
|
45
|
-
this.buttonText +
|
|
46
|
-
" " +
|
|
47
|
-
intl.formatMessage({
|
|
48
|
-
id: "chart.infoButton",
|
|
49
|
-
defaultMessage: "Button. Click for more information.",
|
|
50
|
-
});
|
|
51
|
-
wrapper.appendChild(buttonEl);
|
|
52
|
-
}
|
|
53
|
-
this.liveRegion.appendChild(wrapper);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
positionPopover() {
|
|
57
|
-
this.el.style.top = this.coords.y + "px";
|
|
58
|
-
if (window.innerWidth - this.coords.x >= this.popoverWidth + 10) {
|
|
59
|
-
this.el.style.left = this.coords.x + "px"; // opens on the right
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
this.el.style.left = this.coords.x - this.popoverWidth + "px"; // opens on the left
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
render() {
|
|
66
|
-
return (h(Host, null, !!this.open ? (h("div", { "aria-hidden": "true", class: "popover" }, h("h1", { class: "title" }, this.popoverTitle), h("p", { class: "text" }, this.popoverText), this.buttonText ? (
|
|
67
|
-
// @ts-ignore
|
|
68
|
-
h("button", { tabindex: "-1",
|
|
69
|
-
// @ts-ignore
|
|
70
|
-
focusable: "false", ref: (el) => (this.btnEl = el), class: "popover-button", onClick: () => {
|
|
71
|
-
if (this.sliceRef) {
|
|
72
|
-
this.sliceRef.click();
|
|
73
|
-
this.wmChartPopoverButtonTriggered.emit(this.sliceRef);
|
|
74
|
-
}
|
|
75
|
-
this.open = false;
|
|
76
|
-
} }, 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.buttonText))) : (""))) : (""), h("div", { ref: (el) => (this.liveRegion = el), class: "live-region sr-only", "aria-live": "polite", "aria-atomic": "true" }, this.open && this.renderLiveRegion())));
|
|
77
|
-
}
|
|
78
|
-
get el() { return getElement(this); }
|
|
79
|
-
static get watchers() { return {
|
|
80
|
-
"coords": ["positionPopover"]
|
|
81
|
-
}; }
|
|
82
|
-
};
|
|
6
|
+
const ChartPopover = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.wmChartPopoverButtonTriggered = createEvent(this, "wmChartPopoverButtonTriggered", 7);
|
|
10
|
+
this.open = false;
|
|
11
|
+
this.coords = {};
|
|
12
|
+
this.popoverWidth = 168;
|
|
13
|
+
this.popoverClicked = false;
|
|
14
|
+
}
|
|
15
|
+
handleClickOnDocument() {
|
|
16
|
+
// because this listener is set document-wide, whenever something inside it is clicked
|
|
17
|
+
// the event target returned will always be the host (wm-chart)
|
|
18
|
+
// the element within wm-chart is determined by the other listener and saved as var popoverClicked for use here
|
|
19
|
+
// capture = false in @Listen ensures order of execution
|
|
20
|
+
this.open = this.popoverClicked;
|
|
21
|
+
this.popoverClicked = false;
|
|
22
|
+
}
|
|
23
|
+
handleClick(ev) {
|
|
24
|
+
let popoverBtnClicked = false;
|
|
25
|
+
if (this.btnEl) {
|
|
26
|
+
popoverBtnClicked = ev.target === this.btnEl || this.btnEl.contains(ev.target);
|
|
27
|
+
}
|
|
28
|
+
// if the click is on the popover (except the popover button),
|
|
29
|
+
// set popoverClicked to true. It will be used by the other listener above
|
|
30
|
+
this.popoverClicked = !popoverBtnClicked && (ev.target === this.el || this.el.contains(ev.target));
|
|
31
|
+
}
|
|
32
|
+
renderLiveRegion() {
|
|
33
|
+
if (this.liveRegion) {
|
|
34
|
+
this.liveRegion.innerHTML = "";
|
|
35
|
+
const wrapper = document.createElement("div");
|
|
36
|
+
const titleEl = document.createElement("span");
|
|
37
|
+
titleEl.innerHTML = this.popoverTitle + " " || "";
|
|
38
|
+
wrapper.appendChild(titleEl);
|
|
39
|
+
const textEl = document.createElement("span");
|
|
40
|
+
textEl.innerHTML = this.popoverText + " " || "";
|
|
41
|
+
wrapper.appendChild(textEl);
|
|
42
|
+
if (this.buttonText) {
|
|
43
|
+
const buttonEl = document.createElement("span");
|
|
44
|
+
buttonEl.innerHTML =
|
|
45
|
+
this.buttonText +
|
|
46
|
+
" " +
|
|
47
|
+
intl.formatMessage({
|
|
48
|
+
id: "chart.infoButton",
|
|
49
|
+
defaultMessage: "Button. Click for more information.",
|
|
50
|
+
});
|
|
51
|
+
wrapper.appendChild(buttonEl);
|
|
52
|
+
}
|
|
53
|
+
this.liveRegion.appendChild(wrapper);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
positionPopover() {
|
|
57
|
+
this.el.style.top = this.coords.y + "px";
|
|
58
|
+
if (window.innerWidth - this.coords.x >= this.popoverWidth + 10) {
|
|
59
|
+
this.el.style.left = this.coords.x + "px"; // opens on the right
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
this.el.style.left = this.coords.x - this.popoverWidth + "px"; // opens on the left
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
render() {
|
|
66
|
+
return (h(Host, null, !!this.open ? (h("div", { "aria-hidden": "true", class: "popover" }, h("h1", { class: "title" }, this.popoverTitle), h("p", { class: "text" }, this.popoverText), this.buttonText ? (
|
|
67
|
+
// @ts-ignore
|
|
68
|
+
h("button", { tabindex: "-1",
|
|
69
|
+
// @ts-ignore
|
|
70
|
+
focusable: "false", ref: (el) => (this.btnEl = el), class: "popover-button", onClick: () => {
|
|
71
|
+
if (this.sliceRef) {
|
|
72
|
+
this.sliceRef.click();
|
|
73
|
+
this.wmChartPopoverButtonTriggered.emit(this.sliceRef);
|
|
74
|
+
}
|
|
75
|
+
this.open = false;
|
|
76
|
+
} }, 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.buttonText))) : (""))) : (""), h("div", { ref: (el) => (this.liveRegion = el), class: "live-region sr-only", "aria-live": "polite", "aria-atomic": "true" }, this.open && this.renderLiveRegion())));
|
|
77
|
+
}
|
|
78
|
+
get el() { return getElement(this); }
|
|
79
|
+
static get watchers() { return {
|
|
80
|
+
"coords": ["positionPopover"]
|
|
81
|
+
}; }
|
|
82
|
+
};
|
|
83
83
|
ChartPopover.style = privChartPopoverCss;
|
|
84
84
|
|
|
85
85
|
export { ChartPopover as priv_chart_popover };
|