@watermarkinsights/ripple 3.1.0-3 → 3.1.0-7
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/global-5280d1f0.js +68 -0
- package/dist/cjs/global-b7f0bdf8.js +38 -0
- package/dist/cjs/global-bb4a2f19.js +68 -0
- package/dist/cjs/global-fd142fec.js +38 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/ripple.cjs.js +2 -2
- package/dist/cjs/wm-action-menu.cjs.entry.js +1 -1
- package/dist/cjs/wm-button.cjs.entry.js +51 -17
- package/dist/cjs/wm-input.cjs.entry.js +2 -1
- package/dist/cjs/wm-modal-footer.cjs.entry.js +1 -1
- package/dist/cjs/wm-modal-header.cjs.entry.js +1 -1
- package/dist/cjs/wm-network-uploader.cjs.entry.js +1 -1
- package/dist/cjs/wm-search.cjs.entry.js +2 -2
- package/dist/cjs/wm-select.cjs.entry.js +1 -1
- package/dist/cjs/wm-tab-list.cjs.entry.js +1 -1
- package/dist/cjs/wm-tab-panel.cjs.entry.js +1 -1
- package/dist/collection/components/wm-button/wm-button.css +0 -68
- package/dist/collection/components/wm-button/wm-button.js +57 -18
- package/dist/collection/components/wm-input/wm-input.js +7 -5
- package/dist/collection/components/wm-modal/wm-modal-footer.js +1 -1
- package/dist/collection/components/wm-modal/wm-modal-header.js +1 -1
- package/dist/collection/components/wm-search/wm-search.js +2 -2
- package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.js +2 -2
- package/dist/collection/global/global.js +35 -4
- package/dist/esm/global-024b68e0.js +36 -0
- package/dist/esm/global-178ff07b.js +66 -0
- package/dist/esm/global-78624c36.js +36 -0
- package/dist/esm/global-aa977b7d.js +66 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/ripple.js +2 -2
- package/dist/esm/wm-action-menu.entry.js +1 -1
- package/dist/esm/wm-button.entry.js +52 -18
- package/dist/esm/wm-input.entry.js +2 -1
- package/dist/esm/wm-modal-footer.entry.js +1 -1
- package/dist/esm/wm-modal-header.entry.js +1 -1
- package/dist/esm/wm-network-uploader.entry.js +1 -1
- package/dist/esm/wm-search.entry.js +2 -2
- package/dist/esm/wm-select.entry.js +1 -1
- package/dist/esm/wm-tab-list.entry.js +1 -1
- package/dist/esm/wm-tab-panel.entry.js +1 -1
- package/dist/ripple/p-27ce98ce.entry.js +1 -0
- package/dist/ripple/p-364476c0.entry.js +1 -0
- package/dist/ripple/p-3a564868.entry.js +1 -0
- package/dist/ripple/p-42704ee9.entry.js +1 -0
- package/dist/ripple/p-56398aeb.entry.js +1 -0
- package/dist/ripple/p-59f497e4.entry.js +1 -0
- package/dist/ripple/p-5c26c822.js +1 -0
- package/dist/ripple/p-5c5f2ad7.entry.js +1 -0
- package/dist/ripple/p-78e3fec8.js +1 -0
- package/dist/ripple/p-7ede1ea7.js +1 -0
- package/dist/ripple/p-8715e71c.entry.js +1 -0
- package/dist/ripple/p-87c432c3.entry.js +1 -0
- package/dist/ripple/p-96d28c1a.entry.js +1 -0
- package/dist/ripple/p-b45856b0.entry.js +1 -0
- package/dist/ripple/p-b4c164c3.entry.js +1 -0
- package/dist/ripple/p-c3d38530.entry.js +1 -0
- package/dist/ripple/p-c6893f82.entry.js +1 -0
- package/dist/ripple/p-d758818a.entry.js +1 -0
- package/dist/ripple/p-dcc5a2ab.entry.js +1 -0
- package/dist/ripple/p-f7d6e39e.js +1 -0
- package/dist/ripple/p-f86b8420.entry.js +1 -0
- package/dist/ripple/priv-chart-popover.entry.js +1 -1
- package/dist/ripple/priv-datepicker.entry.js +1 -1
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/wm-action-menu.entry.js +1 -1
- package/dist/ripple/wm-button.entry.js +1 -1
- package/dist/ripple/wm-chart.entry.js +1 -1
- package/dist/ripple/wm-datepicker.entry.js +1 -1
- package/dist/ripple/wm-input.entry.js +35 -17
- package/dist/ripple/wm-modal-header.entry.js +1 -1
- package/dist/ripple/wm-modal.entry.js +1 -1
- package/dist/ripple/wm-navigator.entry.js +1 -1
- package/dist/ripple/wm-network-uploader.entry.js +1 -1
- package/dist/ripple/wm-pagination.entry.js +1 -1
- package/dist/ripple/wm-search.entry.js +1 -1
- package/dist/ripple/wm-select.entry.js +1 -1
- package/dist/ripple/wm-snackbar.entry.js +1 -1
- package/dist/ripple/wm-tab-list.entry.js +1 -1
- package/dist/ripple/wm-tab-panel.entry.js +1 -1
- package/dist/ripple/wm-tag-input.entry.js +3 -6
- package/dist/ripple/wm-timepicker.entry.js +1 -1
- package/dist/ripple/wm-toggletip.entry.js +1 -1
- package/dist/ripple/wm-uploader.entry.js +1 -1
- package/dist/types/components/wm-button/wm-button.d.ts +4 -2
- package/dist/types/components/wm-input/wm-input.d.ts +1 -1
- package/dist/types/components.d.ts +2 -2
- package/package.json +1 -1
|
@@ -33,7 +33,7 @@ const ModalFooter = class {
|
|
|
33
33
|
parentModal.emitSecondaryEvent();
|
|
34
34
|
}
|
|
35
35
|
render() {
|
|
36
|
-
return (index.h("div", { class: `wm-wrapper ${this.infoText ? " footer-text" : ""}` }, index.h("div", { class: "wm-info" }, this.infoText), index.h("div", { class: "wm-button-collection" }, this.secondaryText && (index.h("wm-button", { onClick: () => this.emitParentSecondaryEvent(), id: `wm-secondary-${this.uid}`, ref: (el) => (this.primaryActionDisabled ? (this.lastElement = el) : null) }, this.secondaryText)), index.h("wm-button", {
|
|
36
|
+
return (index.h("div", { class: `wm-wrapper ${this.infoText ? " footer-text" : ""}` }, index.h("div", { class: "wm-info" }, this.infoText), index.h("div", { class: "wm-button-collection" }, this.secondaryText && (index.h("wm-button", { onClick: () => this.emitParentSecondaryEvent(), id: `wm-secondary-${this.uid}`, ref: (el) => (this.primaryActionDisabled ? (this.lastElement = el) : null) }, this.secondaryText)), index.h("wm-button", { buttonType: this.deleteStyle ? "secondary" : "primary", permanentlyDelete: this.deleteStyle, onClick: () => this.emitParentPrimaryEvent(), disabled: this.primaryActionDisabled, id: `wm-primary-${this.uid}`, ref: (el) => (!this.primaryActionDisabled ? (this.lastElement = el) : null) }, this.primaryText))));
|
|
37
37
|
}
|
|
38
38
|
get el() { return index.getElement(this); }
|
|
39
39
|
};
|
|
@@ -36,7 +36,7 @@ const ModalHeader = class {
|
|
|
36
36
|
// this.headingElement.focus();
|
|
37
37
|
// }
|
|
38
38
|
render() {
|
|
39
|
-
return (index.h(index.Host, null, index.h("div", { class: "wm-wrapper" }, index.h("div", null, index.h("h2", { class: "title", id: `wm-modal-heading-text-${this.uid}` }, this.heading, index.h("span", { class: "subtitle" }, this.subheading))), index.h("wm-button", { "button-
|
|
39
|
+
return (index.h(index.Host, null, index.h("div", { class: "wm-wrapper" }, index.h("div", null, index.h("h2", { class: "title", id: `wm-modal-heading-text-${this.uid}` }, this.heading, index.h("span", { class: "subtitle" }, this.subheading))), index.h("wm-button", { "button-type": "navigational", icon: "f156", tooltip: this.closeTooltipMessage, "tooltip-position": "left", id: `wm-modal-close-${this.uid}`, ref: (el) => (this.closeButtonEl = el), onClick: () => this.emitParentCloseEvent() }))));
|
|
40
40
|
}
|
|
41
41
|
get el() { return index.getElement(this); }
|
|
42
42
|
};
|
|
@@ -409,7 +409,7 @@ const NetworkUploader = class {
|
|
|
409
409
|
})));
|
|
410
410
|
}
|
|
411
411
|
renderFile(item) {
|
|
412
|
-
return (index.h("li", null, index.h("div", { class: "file --saved" }, index.h("div", { class: "file-info" }, index.h("span", { class: "filename" }, item.file_name), index.h("span", { class: "filedate" }, this.formatDate(item.updated_at, functions.intl.locale, Intl.DateTimeFormat().resolvedOptions().timeZone))), index.h("div", { class: "file-controls" }, index.h("wm-button", { class: "download-button", "button-
|
|
412
|
+
return (index.h("li", null, index.h("div", { class: "file --saved" }, index.h("div", { class: "file-info" }, index.h("span", { class: "filename" }, item.file_name), index.h("span", { class: "filedate" }, this.formatDate(item.updated_at, functions.intl.locale, Intl.DateTimeFormat().resolvedOptions().timeZone))), index.h("div", { class: "file-controls" }, index.h("wm-button", { class: "download-button", "button-type": "icononly", tooltip: "download", "label-for-identical-buttons": `download ${item.file_name}`, icon: "f1da", onClick: () => this.downloadFile(item.uuid, item.file_path) }), index.h("wm-button", { class: "delete-button", "button-type": "icononly", tooltip: "remove", "label-for-identical-buttons": `remove ${item.file_name}`, icon: "f1c0", onClick: () => this.deleteFile(item) })))));
|
|
413
413
|
}
|
|
414
414
|
renderFileList() {
|
|
415
415
|
return index.h("ul", { class: "file-list" }, this.fileList.map((item) => this.renderFile(item)));
|
|
@@ -196,14 +196,14 @@ const Search = class {
|
|
|
196
196
|
* Functions that return elements specifically for search-and-find.
|
|
197
197
|
*/
|
|
198
198
|
renderResultsAndBrowseButtons() {
|
|
199
|
-
return (index.h("div", { class: "wm-find-elements" }, index.h("div", { id: "results-display", class: "results" }, this.getResultsMessage()), index.h("div", { class: "wm-button-collection" }, index.h("wm-button", { "button-
|
|
199
|
+
return (index.h("div", { class: "wm-find-elements" }, index.h("div", { id: "results-display", class: "results" }, this.getResultsMessage()), index.h("div", { class: "wm-button-collection" }, index.h("wm-button", { "button-type": "icononly", icon: "f05d", tooltip: functions.intl.formatMessage({
|
|
200
200
|
id: "global.previous",
|
|
201
201
|
description: "button text",
|
|
202
202
|
defaultMessage: "previous",
|
|
203
203
|
}), "tooltip-position": "bottom", onClick: () => this.changeHighlightedNum(this.highlightedNum - 1), disabled: this.disabled || this.numResults < 2, "label-for-identical-buttons": functions.intl.formatMessage({
|
|
204
204
|
id: "search.previousResult",
|
|
205
205
|
defaultMessage: "Press to hear previous matching result",
|
|
206
|
-
}) }), index.h("wm-button", { "button-
|
|
206
|
+
}) }), index.h("wm-button", { "button-type": "icononly", icon: "f045", tooltip: functions.intl.formatMessage({
|
|
207
207
|
id: "global.next",
|
|
208
208
|
description: "button text",
|
|
209
209
|
defaultMessage: "next",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-ded52be4.js');
|
|
6
|
-
const functions = require('./functions-
|
|
6
|
+
const functions = require('./functions-cc566e1c.js');
|
|
7
7
|
|
|
8
8
|
const wmSelectCss = "@charset \"UTF-8\";:host{position:relative;display:block;box-sizing:border-box;font-family:inherit}:host .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}.wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;flex-direction:column;font-size:0.875rem}.wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}.wrapper .label .required{color:#c0392b}.wrapper.label-left{flex-direction:row}.wrapper.label-left .label-wrapper{line-height:2.5rem}.wrapper.label-left .label-wrapper .label{display:flex;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}.wrapper.label-none label{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}.wrapper.invalid .label{color:#c0392b}.wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\";margin-left:0.3125rem}[dir=RTL] .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}.wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}.wrapper .dropdown{position:relative;font-size:1.125rem;color:#575195;min-width:8.75rem}.wrapper .dropdown .displayedoption{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;display:flex;align-items:center;flex-wrap:nowrap;background:transparent;width:100%;border:solid 1px rgba(35, 35, 35, 0.6);padding:0 1.875rem 0 0.9375rem;cursor:pointer;height:2.5rem;line-height:normal;font-family:inherit;color:#575195;font-weight:400;font-size:0.875rem;text-transform:none;text-align:left}@media only screen and (max-width: 768px){.wrapper .dropdown .displayedoption{height:2.75rem}}.wrapper .dropdown .displayedoption:before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\";position:absolute;right:0.5625rem;pointer-events:none}.wrapper .dropdown .displayedoption:hover:not(:disabled):not(.-disabled):not(.-raised){background:transparent;text-decoration:none}.wrapper .dropdown .displayedoption:active{-ms-transform:scale(1, 1) !important;transform:scale(1, 1) !important}.wrapper .dropdown .displayedoption:focus{outline:none}.wrapper .dropdown .displayedoption::-moz-focus-inner{border:0}.wrapper .dropdown .displayedoption.user-is-tabbing:focus{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e;-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e;box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e}.wrapper .dropdown .displayedoption.user-is-tabbing:focus::-moz-focus-inner{border:0}.wrapper .dropdown .displayedoption .overflowcontrol{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex:1}.wrapper .dropdown .displayedoption .overflowcontrol.hassubinfo{display:flex}.wrapper .dropdown .displayedoption .overflowcontrol.hassubinfo .button-text{flex:1;text-overflow:ellipsis;overflow:hidden;min-width:0}.wrapper .dropdown .displayedoption .overflowcontrol.hassubinfo .subinfo{flex:none;font-style:italic}.wrapper .dropdown .displayedoption .overflow-counter{font-weight:bold;margin-left:0.5rem}.wrapper .dropdown>.displayedoption[disabled]{color:#6b6b6b;border-color:#8a8a8a;background:#f0f0f0;cursor:default}.wrapper .dropdown>.options{-webkit-overflow-scrolling:touch;overflow:auto;max-height:12.5rem;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;transition:transform 0.25s ease;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;position:absolute;top:0;right:0;background:#fff;z-index:100;width:100%;font-size:0.875rem}.wrapper .dropdown>.options.upwards{top:unset;bottom:calc(100% - 2.5rem);-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}.wrapper .dropdown>.options.hidden{visibility:hidden}.wrapper .dropdown>.options.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}.wrapper.invalid .dropdown .displayedoption{-webkit-box-shadow:0 0 0 1px #c0392b;-moz-box-shadow:0 0 0 1px #c0392b;box-shadow:0 0 0 1px #c0392b;border-color:#c0392b}.wrapper .error-message{color:#c0392b;font-size:0.875rem;margin-top:0.25rem;margin-bottom:0.25rem;display:block;top:100%;left:0;font-style:italic}.rtl>.options{-ms-transform-origin:left top;-webkit-transform-origin:left top;-moz-transform-origin:left top;transform-origin:left top;left:0;right:auto}.rtl>.options .option{padding-left:3rem;padding-right:1.25rem}.rtl>.displayedoption{padding:0 0.9375rem 0 1.875rem;text-align:right}.rtl>.displayedoption:before{right:auto;left:0.5625rem}";
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-ded52be4.js');
|
|
6
|
-
const functions = require('./functions-
|
|
6
|
+
const functions = require('./functions-cc566e1c.js');
|
|
7
7
|
|
|
8
8
|
const wmTabListCss = ":host,wm-tab-list{position:relative;white-space:nowrap;height:100%;display:block}:host *,wm-tab-list *{box-sizing:border-box}:host .tabcontainer,wm-tab-list .tabcontainer{margin:0;margin-left:-24px;width:100%;height:4.0625rem;display:flex;flex-direction:row;align-items:center;padding:0}:host .tabcontainer.dark,wm-tab-list .tabcontainer.dark{background:#353b48;margin:0}:host wm-select,wm-tab-list wm-select{padding:0.375rem 0}";
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-ded52be4.js');
|
|
6
|
-
const functions = require('./functions-
|
|
6
|
+
const functions = require('./functions-cc566e1c.js');
|
|
7
7
|
|
|
8
8
|
const wmTabPanelCss = "wm-tab-panel{visibility:inherit}wm-tab-panel.tab-hidden{display:none}wm-tab-panel:active{outline:none}wm-tab-panel:focus{outline:none}wm-tab-panel.user-is-tabbing:focus{outline:-webkit-focus-ring-color auto 5px}";
|
|
9
9
|
|
|
@@ -501,72 +501,4 @@ wm-button .sr-only {
|
|
|
501
501
|
clip-path: inset(50%) !important;
|
|
502
502
|
white-space: nowrap !important;
|
|
503
503
|
margin: -1px !important;
|
|
504
|
-
}
|
|
505
|
-
:host .tooltip,
|
|
506
|
-
wm-button .tooltip {
|
|
507
|
-
position: absolute;
|
|
508
|
-
overflow: hidden;
|
|
509
|
-
pointer-events: none;
|
|
510
|
-
line-height: normal;
|
|
511
|
-
font-family: inherit;
|
|
512
|
-
font-size: 0.875rem;
|
|
513
|
-
text-transform: none;
|
|
514
|
-
font-weight: normal;
|
|
515
|
-
background: black;
|
|
516
|
-
color: #fff;
|
|
517
|
-
z-index: 999999999;
|
|
518
|
-
white-space: nowrap;
|
|
519
|
-
opacity: 1;
|
|
520
|
-
transition: opacity 500ms 500ms;
|
|
521
|
-
padding: 0.375rem;
|
|
522
|
-
}
|
|
523
|
-
:host .tooltip.hidden,
|
|
524
|
-
wm-button .tooltip.hidden {
|
|
525
|
-
opacity: 0;
|
|
526
|
-
transition-delay: 0s;
|
|
527
|
-
}
|
|
528
|
-
:host .tooltip.top,
|
|
529
|
-
wm-button .tooltip.top {
|
|
530
|
-
right: auto;
|
|
531
|
-
left: 50%;
|
|
532
|
-
transform: translateX(-50%);
|
|
533
|
-
bottom: 2.9375rem;
|
|
534
|
-
}
|
|
535
|
-
:host .tooltip.bottom,
|
|
536
|
-
wm-button .tooltip.bottom {
|
|
537
|
-
right: auto;
|
|
538
|
-
left: 50%;
|
|
539
|
-
transform: translateX(-50%);
|
|
540
|
-
top: 2.9375rem;
|
|
541
|
-
}
|
|
542
|
-
:host .tooltip.left,
|
|
543
|
-
wm-button .tooltip.left {
|
|
544
|
-
top: 0.375rem;
|
|
545
|
-
right: 3rem;
|
|
546
|
-
}
|
|
547
|
-
:host .tooltip.right,
|
|
548
|
-
wm-button .tooltip.right {
|
|
549
|
-
top: 0.375rem;
|
|
550
|
-
left: 3rem;
|
|
551
|
-
}
|
|
552
|
-
:host .tooltip.bottom-left,
|
|
553
|
-
wm-button .tooltip.bottom-left {
|
|
554
|
-
left: auto;
|
|
555
|
-
right: 2.75rem;
|
|
556
|
-
}
|
|
557
|
-
:host .tooltip.bottom-right,
|
|
558
|
-
wm-button .tooltip.bottom-right {
|
|
559
|
-
top: 2.75rem;
|
|
560
|
-
left: 2.75rem;
|
|
561
|
-
}
|
|
562
|
-
:host .tooltip.top-right,
|
|
563
|
-
wm-button .tooltip.top-right {
|
|
564
|
-
bottom: 2.75rem;
|
|
565
|
-
left: 2.75rem;
|
|
566
|
-
}
|
|
567
|
-
:host .tooltip.top-left,
|
|
568
|
-
wm-button .tooltip.top-left {
|
|
569
|
-
bottom: 2.75rem;
|
|
570
|
-
left: auto;
|
|
571
|
-
right: 2.75rem;
|
|
572
504
|
}
|
|
@@ -14,8 +14,10 @@ export class Button {
|
|
|
14
14
|
this.permanentlyDelete = false;
|
|
15
15
|
this.textWrap = true;
|
|
16
16
|
this.isTabbing = false;
|
|
17
|
+
this.id = generateId();
|
|
17
18
|
this.clickFunc = null;
|
|
18
19
|
this.ariaPopup = false;
|
|
20
|
+
this.tooltipVisible = false;
|
|
19
21
|
}
|
|
20
22
|
get tempButtonType() {
|
|
21
23
|
// uses of this getter should be replaced with this.buttonType when buttonStyle is fully phased out
|
|
@@ -25,12 +27,21 @@ export class Button {
|
|
|
25
27
|
get isTruncated() {
|
|
26
28
|
return !!this.buttonEl && this.buttonEl.offsetWidth < this.buttonEl.scrollWidth;
|
|
27
29
|
}
|
|
30
|
+
get hasTooltip() {
|
|
31
|
+
// tooltip is only rendered for icononly and navigational types, or if the button text is truncated
|
|
32
|
+
return this.tempButtonType === "icononly" || this.tempButtonType === "navigational" || this.isTruncated;
|
|
33
|
+
}
|
|
28
34
|
toggleTabbingOn() {
|
|
29
35
|
this.isTabbing = true;
|
|
30
36
|
}
|
|
31
37
|
toggleTabbingOff() {
|
|
32
38
|
this.isTabbing = false;
|
|
33
39
|
}
|
|
40
|
+
handleScroll() {
|
|
41
|
+
if (this.tooltipVisible) {
|
|
42
|
+
this.hideTooltip();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
34
45
|
handleOnClick() {
|
|
35
46
|
// remove the onlick function when the component is disabled,
|
|
36
47
|
// to handle a bug in Edge 42 where the function would run
|
|
@@ -108,25 +119,48 @@ export class Button {
|
|
|
108
119
|
this.toggleTabbingOn();
|
|
109
120
|
}
|
|
110
121
|
this.ariaPopup = !!this.el.getAttribute("aria-haspopup");
|
|
111
|
-
forceUpdate(this.el); //
|
|
122
|
+
forceUpdate(this.el); // necessary to pass text-truncation tooltip test
|
|
112
123
|
}
|
|
113
124
|
showTooltip() {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
125
|
+
if (this.hasTooltip) {
|
|
126
|
+
const tooltipEl = document.querySelector(`#wm-tooltip`);
|
|
127
|
+
if (!!tooltipEl) {
|
|
128
|
+
// set tooltip text
|
|
129
|
+
tooltipEl.textContent = this.isTruncated ? this.el.textContent : this.tooltip;
|
|
130
|
+
// adjust position in case there is no space to place the tooltip where specified via prop
|
|
131
|
+
this.adjustedTooltipPosition = adjustTooltipPosition(this.tooltipPosition, this.buttonEl, tooltipEl);
|
|
132
|
+
// to get the center positions, calculate the difference between the button width and the tooltip width
|
|
133
|
+
const verticalDiff = (this.buttonEl.getBoundingClientRect().height - tooltipEl.getBoundingClientRect().height) / 2;
|
|
134
|
+
const horizontalDiff = (this.buttonEl.getBoundingClientRect().width - tooltipEl.getBoundingClientRect().width) / 2;
|
|
135
|
+
// center positions as default (at least one value will be changed below)
|
|
136
|
+
let verticalPos = this.buttonEl.getBoundingClientRect().top + verticalDiff;
|
|
137
|
+
let horizontalPos = this.buttonEl.getBoundingClientRect().left + horizontalDiff;
|
|
138
|
+
if (this.adjustedTooltipPosition.includes("top")) {
|
|
139
|
+
verticalPos = this.buttonEl.getBoundingClientRect().top - tooltipEl.getBoundingClientRect().height - 8;
|
|
140
|
+
}
|
|
141
|
+
if (this.adjustedTooltipPosition.includes("bottom")) {
|
|
142
|
+
verticalPos = this.buttonEl.getBoundingClientRect().bottom + 8;
|
|
143
|
+
}
|
|
144
|
+
if (this.adjustedTooltipPosition.includes("left")) {
|
|
145
|
+
horizontalPos = this.buttonEl.getBoundingClientRect().left - tooltipEl.getBoundingClientRect().width - 8;
|
|
146
|
+
}
|
|
147
|
+
if (this.adjustedTooltipPosition.includes("right")) {
|
|
148
|
+
horizontalPos = this.buttonEl.getBoundingClientRect().right + 8;
|
|
149
|
+
}
|
|
150
|
+
tooltipEl.style.top = (verticalPos / 16).toString() + "rem";
|
|
151
|
+
tooltipEl.style.left = (horizontalPos / 16).toString() + "rem";
|
|
152
|
+
tooltipEl.style.transitionDelay = "500ms";
|
|
153
|
+
tooltipEl.style.opacity = "1";
|
|
154
|
+
this.tooltipVisible = true;
|
|
155
|
+
}
|
|
119
156
|
}
|
|
120
157
|
}
|
|
121
158
|
hideTooltip() {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
// tooltip is only rendered for icononly and navigational types, or if the button text is truncated
|
|
128
|
-
if (this.tempButtonType === "icononly" || this.tempButtonType === "navigational" || this.isTruncated) {
|
|
129
|
-
return (h("div", { ref: (el) => (this.tooltipEl = el), "aria-hidden": "true", class: `tooltip hidden ${this.adjustedTooltipPosition}` }, this.isTruncated ? this.el.textContent : this.tooltip));
|
|
159
|
+
const tooltipEl = document.querySelector("#wm-tooltip");
|
|
160
|
+
if (!!tooltipEl) {
|
|
161
|
+
tooltipEl.style.transitionDelay = "0s";
|
|
162
|
+
tooltipEl.style.opacity = "0";
|
|
163
|
+
this.tooltipVisible = false;
|
|
130
164
|
}
|
|
131
165
|
}
|
|
132
166
|
getClasses() {
|
|
@@ -141,7 +175,7 @@ export class Button {
|
|
|
141
175
|
}
|
|
142
176
|
getAriaLabel() {
|
|
143
177
|
if (this.tempButtonType === "icononly" || this.tempButtonType === "navigational") {
|
|
144
|
-
return this.labelForIdenticalButtons
|
|
178
|
+
return this.labelForIdenticalButtons || this.tooltip;
|
|
145
179
|
}
|
|
146
180
|
if (this.labelForIdenticalButtons) {
|
|
147
181
|
return this.labelForIdenticalButtons;
|
|
@@ -149,11 +183,10 @@ export class Button {
|
|
|
149
183
|
}
|
|
150
184
|
render() {
|
|
151
185
|
return (h(Host, { class: this.disabled ? "button-disabled" : "" },
|
|
152
|
-
h("button", { id:
|
|
186
|
+
h("button", { id: this.id, class: `${this.getClasses()}`, disabled: this.disabled, ref: (el) => (this.buttonEl = el), "aria-label": this.getAriaLabel(), "aria-hasPopup": this.ariaPopup ? "menu" : null, onMouseEnter: () => this.showTooltip(), onMouseLeave: () => this.hideTooltip(), onFocus: () => this.showTooltip(), onBlur: () => this.hideTooltip(), onClick: () => this.hideTooltip() },
|
|
153
187
|
this.icon && (h("span", { class: "mdi", style: this.iconSize ? { fontSize: this.iconSize } : {} }, String.fromCodePoint(parseInt(`0x${this.icon}`)))),
|
|
154
188
|
h("span", { class: "button-text" },
|
|
155
|
-
h("slot", null)))
|
|
156
|
-
this.renderTooltip()));
|
|
189
|
+
h("slot", null)))));
|
|
157
190
|
}
|
|
158
191
|
static get is() { return "wm-button"; }
|
|
159
192
|
static get encapsulation() { return "shadow"; }
|
|
@@ -393,6 +426,12 @@ export class Button {
|
|
|
393
426
|
"target": "window",
|
|
394
427
|
"capture": false,
|
|
395
428
|
"passive": false
|
|
429
|
+
}, {
|
|
430
|
+
"name": "scroll",
|
|
431
|
+
"method": "handleScroll",
|
|
432
|
+
"target": "window",
|
|
433
|
+
"capture": false,
|
|
434
|
+
"passive": true
|
|
396
435
|
}, {
|
|
397
436
|
"name": "keydown",
|
|
398
437
|
"method": "handleKeydown",
|
|
@@ -7,6 +7,7 @@ export class Input {
|
|
|
7
7
|
this.disabled = false;
|
|
8
8
|
this.placeholder = "";
|
|
9
9
|
this.requiredField = false;
|
|
10
|
+
this.type = "text";
|
|
10
11
|
this.step = 1;
|
|
11
12
|
this.charCount = 0;
|
|
12
13
|
this.announcement = "";
|
|
@@ -19,7 +20,7 @@ export class Input {
|
|
|
19
20
|
});
|
|
20
21
|
this.numberErrorMessage = intl.formatMessage({
|
|
21
22
|
id: "input.numberError",
|
|
22
|
-
defaultMessage: "
|
|
23
|
+
defaultMessage: "Please enter a valid number.",
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
26
|
componentWillLoad() {
|
|
@@ -317,18 +318,19 @@ export class Input {
|
|
|
317
318
|
"type": "string",
|
|
318
319
|
"mutable": false,
|
|
319
320
|
"complexType": {
|
|
320
|
-
"original": "\"number\"",
|
|
321
|
-
"resolved": "\"number\" |
|
|
321
|
+
"original": "\"number\" | \"text\"",
|
|
322
|
+
"resolved": "\"number\" | \"text\"",
|
|
322
323
|
"references": {}
|
|
323
324
|
},
|
|
324
325
|
"required": false,
|
|
325
|
-
"optional":
|
|
326
|
+
"optional": false,
|
|
326
327
|
"docs": {
|
|
327
328
|
"tags": [],
|
|
328
329
|
"text": ""
|
|
329
330
|
},
|
|
330
331
|
"attribute": "type",
|
|
331
|
-
"reflect": false
|
|
332
|
+
"reflect": false,
|
|
333
|
+
"defaultValue": "\"text\""
|
|
332
334
|
},
|
|
333
335
|
"step": {
|
|
334
336
|
"type": "number",
|
|
@@ -29,7 +29,7 @@ export class ModalFooter {
|
|
|
29
29
|
h("div", { class: "wm-info" }, this.infoText),
|
|
30
30
|
h("div", { class: "wm-button-collection" },
|
|
31
31
|
this.secondaryText && (h("wm-button", { onClick: () => this.emitParentSecondaryEvent(), id: `wm-secondary-${this.uid}`, ref: (el) => (this.primaryActionDisabled ? (this.lastElement = el) : null) }, this.secondaryText)),
|
|
32
|
-
h("wm-button", {
|
|
32
|
+
h("wm-button", { buttonType: this.deleteStyle ? "secondary" : "primary", permanentlyDelete: this.deleteStyle, onClick: () => this.emitParentPrimaryEvent(), disabled: this.primaryActionDisabled, id: `wm-primary-${this.uid}`, ref: (el) => (!this.primaryActionDisabled ? (this.lastElement = el) : null) }, this.primaryText))));
|
|
33
33
|
}
|
|
34
34
|
static get is() { return "wm-modal-footer"; }
|
|
35
35
|
static get originalStyleUrls() { return {
|
|
@@ -34,7 +34,7 @@ export class ModalHeader {
|
|
|
34
34
|
h("h2", { class: "title", id: `wm-modal-heading-text-${this.uid}` },
|
|
35
35
|
this.heading,
|
|
36
36
|
h("span", { class: "subtitle" }, this.subheading))),
|
|
37
|
-
h("wm-button", { "button-
|
|
37
|
+
h("wm-button", { "button-type": "navigational", icon: "f156", tooltip: this.closeTooltipMessage, "tooltip-position": "left", id: `wm-modal-close-${this.uid}`, ref: (el) => (this.closeButtonEl = el), onClick: () => this.emitParentCloseEvent() }))));
|
|
38
38
|
}
|
|
39
39
|
static get is() { return "wm-modal-header"; }
|
|
40
40
|
static get originalStyleUrls() { return {
|
|
@@ -188,7 +188,7 @@ export class Search {
|
|
|
188
188
|
return (h("div", { class: "wm-find-elements" },
|
|
189
189
|
h("div", { id: "results-display", class: "results" }, this.getResultsMessage()),
|
|
190
190
|
h("div", { class: "wm-button-collection" },
|
|
191
|
-
h("wm-button", { "button-
|
|
191
|
+
h("wm-button", { "button-type": "icononly", icon: "f05d", tooltip: intl.formatMessage({
|
|
192
192
|
id: "global.previous",
|
|
193
193
|
description: "button text",
|
|
194
194
|
defaultMessage: "previous",
|
|
@@ -196,7 +196,7 @@ export class Search {
|
|
|
196
196
|
id: "search.previousResult",
|
|
197
197
|
defaultMessage: "Press to hear previous matching result",
|
|
198
198
|
}) }),
|
|
199
|
-
h("wm-button", { "button-
|
|
199
|
+
h("wm-button", { "button-type": "icononly", icon: "f045", tooltip: intl.formatMessage({
|
|
200
200
|
id: "global.next",
|
|
201
201
|
description: "button text",
|
|
202
202
|
defaultMessage: "next",
|
|
@@ -438,8 +438,8 @@ export class NetworkUploader {
|
|
|
438
438
|
h("span", { class: "filename" }, item.file_name),
|
|
439
439
|
h("span", { class: "filedate" }, this.formatDate(item.updated_at, intl.locale, Intl.DateTimeFormat().resolvedOptions().timeZone))),
|
|
440
440
|
h("div", { class: "file-controls" },
|
|
441
|
-
h("wm-button", { class: "download-button", "button-
|
|
442
|
-
h("wm-button", { class: "delete-button", "button-
|
|
441
|
+
h("wm-button", { class: "download-button", "button-type": "icononly", tooltip: "download", "label-for-identical-buttons": `download ${item.file_name}`, icon: "f1da", onClick: () => this.downloadFile(item.uuid, item.file_path) }),
|
|
442
|
+
h("wm-button", { class: "delete-button", "button-type": "icononly", tooltip: "remove", "label-for-identical-buttons": `remove ${item.file_name}`, icon: "f1c0", onClick: () => this.deleteFile(item) })))));
|
|
443
443
|
}
|
|
444
444
|
renderFileList() {
|
|
445
445
|
return h("ul", { class: "file-list" }, this.fileList.map((item) => this.renderFile(item)));
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { setMode } from "@stencil/core";
|
|
2
2
|
import { version } from "../../package.json";
|
|
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
|
|
3
6
|
if (window.navigator.plugins.length > 0) {
|
|
4
|
-
// excluding test envs (which will return 0 for plugin.length)
|
|
5
7
|
console.log("Ripple component library", version);
|
|
6
8
|
}
|
|
9
|
+
// USER-IS-TABBING CLASSES (FOR FOCUS INDICATORS)
|
|
7
10
|
// Dispatching events to track whether user is navigating with keyboard or mouse
|
|
8
|
-
// (for focus states)
|
|
9
|
-
window.addEventListener("keydown", wmComponentKeys);
|
|
10
|
-
window.addEventListener("mousedown", wmComponentMouseDownOnce);
|
|
11
11
|
function wmComponentKeys(ev) {
|
|
12
12
|
var key = ev.key || ev.keyCode;
|
|
13
13
|
if (key == "Tab" || key === 9) {
|
|
@@ -34,7 +34,38 @@ function wmComponentMouseDownOnce() {
|
|
|
34
34
|
document.querySelector("body").classList.remove("wmcl-user-is-tabbing");
|
|
35
35
|
document.querySelector("body").classList.remove("wmcl-user-is-keying");
|
|
36
36
|
}
|
|
37
|
+
window.addEventListener("keydown", wmComponentKeys);
|
|
38
|
+
window.addEventListener("mousedown", wmComponentMouseDownOnce);
|
|
39
|
+
// MODES (FOR PRODUCT-SPECIFIC STYLING)
|
|
37
40
|
//Checks for mode attribute explicitly set on the document. If "mode" is set on component, it will override the global mode. Falls back to default (Planning styles)
|
|
38
41
|
setMode((elm) => {
|
|
39
42
|
return elm.getAttribute("mode") || document.documentElement.getAttribute("mode") || "planning";
|
|
40
43
|
});
|
|
44
|
+
// TOOLTIP
|
|
45
|
+
// Add a tooltip element
|
|
46
|
+
// This allows tooltips to be always at the highest stacking context (always on top)
|
|
47
|
+
// Element is added withing a container to avoid performance impact
|
|
48
|
+
const tooltipContainer = document.createElement("div");
|
|
49
|
+
tooltipContainer.id = "wm-tooltip-container";
|
|
50
|
+
const tooltipEl = document.createElement("div");
|
|
51
|
+
tooltipEl.id = "wm-tooltip";
|
|
52
|
+
tooltipEl.setAttribute("aria-hidden", "true");
|
|
53
|
+
tooltipEl.style.position = "fixed";
|
|
54
|
+
tooltipEl.style.overflow = "hidden";
|
|
55
|
+
tooltipEl.style.pointerEvents = "none";
|
|
56
|
+
tooltipEl.style.lineHeight = "normal";
|
|
57
|
+
tooltipEl.style.fontFamily = "inherit";
|
|
58
|
+
tooltipEl.style.fontSize = "0.875rem";
|
|
59
|
+
tooltipEl.style.textTransform = "none";
|
|
60
|
+
tooltipEl.style.fontWeight = "normal";
|
|
61
|
+
tooltipEl.style.background = "black";
|
|
62
|
+
tooltipEl.style.color = "#fff";
|
|
63
|
+
tooltipEl.style.zIndex = "999999";
|
|
64
|
+
tooltipEl.style.whiteSpace = "nowrap";
|
|
65
|
+
tooltipEl.style.padding = "0.375rem";
|
|
66
|
+
tooltipEl.style.transitionProperty = "opacity";
|
|
67
|
+
tooltipEl.style.transitionDelay = "opacity";
|
|
68
|
+
tooltipEl.style.opacity = "0";
|
|
69
|
+
tooltipContainer.appendChild(tooltipEl);
|
|
70
|
+
const body = document.querySelector("body");
|
|
71
|
+
body.appendChild(tooltipContainer);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const version = "3.1.0-4";
|
|
2
|
+
|
|
3
|
+
if (window.navigator.plugins.length > 0) {
|
|
4
|
+
// excluding test envs (which will return 0 for plugin.length)
|
|
5
|
+
console.log("Ripple component library", version);
|
|
6
|
+
}
|
|
7
|
+
// Dispatching events to track whether user is navigating with keyboard or mouse
|
|
8
|
+
// (for focus states)
|
|
9
|
+
window.addEventListener("keydown", wmComponentKeys);
|
|
10
|
+
window.addEventListener("mousedown", wmComponentMouseDownOnce);
|
|
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
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const version = "3.1.0-7";
|
|
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.whiteSpace = "nowrap";
|
|
60
|
+
tooltipEl.style.padding = "0.375rem";
|
|
61
|
+
tooltipEl.style.transitionProperty = "opacity";
|
|
62
|
+
tooltipEl.style.transitionDelay = "opacity";
|
|
63
|
+
tooltipEl.style.opacity = "0";
|
|
64
|
+
tooltipContainer.appendChild(tooltipEl);
|
|
65
|
+
const body = document.querySelector("body");
|
|
66
|
+
body.appendChild(tooltipContainer);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const version = "3.1.0-5";
|
|
2
|
+
|
|
3
|
+
if (window.navigator.plugins.length > 0) {
|
|
4
|
+
// excluding test envs (which will return 0 for plugin.length)
|
|
5
|
+
console.log("Ripple component library", version);
|
|
6
|
+
}
|
|
7
|
+
// Dispatching events to track whether user is navigating with keyboard or mouse
|
|
8
|
+
// (for focus states)
|
|
9
|
+
window.addEventListener("keydown", wmComponentKeys);
|
|
10
|
+
window.addEventListener("mousedown", wmComponentMouseDownOnce);
|
|
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
|
+
}
|