@watermarkinsights/ripple 3.0.1-0 → 3.0.2-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.
Files changed (224) hide show
  1. package/dist/{ripple/functions-316c1b23.js → cjs/functions-e3f5ae65.js} +188 -2391
  2. package/dist/cjs/global-1e540de6.js +38 -0
  3. package/dist/cjs/http-service-9e8c4dd5.js +57 -0
  4. package/dist/cjs/index-d930307d.js +1392 -0
  5. package/dist/cjs/index.cjs.js +2 -0
  6. package/dist/cjs/interfaces-30a74c1f.js +35 -0
  7. package/dist/cjs/loader.cjs.js +22 -0
  8. package/dist/cjs/priv-chart-popover.cjs.entry.js +89 -0
  9. package/dist/cjs/priv-datepicker.cjs.entry.js +672 -0
  10. package/dist/cjs/priv-navigator-button.cjs.entry.js +29 -0
  11. package/dist/cjs/priv-navigator-item.cjs.entry.js +34 -0
  12. package/dist/cjs/ripple.cjs.js +20 -0
  13. package/dist/cjs/wm-action-menu_2.cjs.entry.js +318 -0
  14. package/dist/cjs/wm-button.cjs.entry.js +152 -0
  15. package/dist/cjs/wm-chart-slice.cjs.entry.js +22 -0
  16. package/dist/cjs/wm-chart.cjs.entry.js +508 -0
  17. package/dist/cjs/wm-datepicker.cjs.entry.js +257 -0
  18. package/dist/cjs/wm-input.cjs.entry.js +110 -0
  19. package/dist/cjs/wm-modal-footer.cjs.entry.js +43 -0
  20. package/dist/cjs/wm-modal-header.cjs.entry.js +45 -0
  21. package/dist/cjs/wm-modal.cjs.entry.js +149 -0
  22. package/dist/cjs/wm-navigator.cjs.entry.js +279 -0
  23. package/dist/cjs/wm-network-uploader.cjs.entry.js +431 -0
  24. package/dist/cjs/wm-option_2.cjs.entry.js +483 -0
  25. package/dist/cjs/wm-pagination.cjs.entry.js +176 -0
  26. package/dist/cjs/wm-search.cjs.entry.js +231 -0
  27. package/dist/cjs/wm-snackbar.cjs.entry.js +160 -0
  28. package/dist/cjs/wm-tab-item_3.cjs.entry.js +316 -0
  29. package/dist/cjs/wm-tag-input.cjs.entry.js +538 -0
  30. package/dist/cjs/wm-timepicker.cjs.entry.js +386 -0
  31. package/dist/cjs/wm-toggletip.cjs.entry.js +128 -0
  32. package/dist/cjs/wm-uploader.cjs.entry.js +342 -0
  33. package/dist/cjs/wm-wrapper.cjs.entry.js +21 -0
  34. package/dist/collection/collection-manifest.json +131 -0
  35. package/dist/{ripple/ripple.css → collection/components/wm-action-menu/wm-action-menu.css} +80 -42
  36. package/dist/collection/components/wm-action-menu/wm-action-menu.js +392 -0
  37. package/dist/collection/components/wm-button/wm-button.css +572 -0
  38. package/dist/collection/components/wm-button/wm-button.js +365 -0
  39. package/dist/collection/components/wm-chart/priv-chart-popover/priv-chart-popover.css +132 -0
  40. package/dist/collection/components/wm-chart/priv-chart-popover/priv-chart-popover.js +232 -0
  41. package/dist/collection/components/wm-chart/wm-chart-slice.js +64 -0
  42. package/dist/collection/components/wm-chart/wm-chart.css +337 -0
  43. package/dist/collection/components/wm-chart/wm-chart.js +710 -0
  44. package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.css +374 -0
  45. package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.js +1003 -0
  46. package/dist/collection/components/wm-datepicker/wm-datepicker.css +211 -0
  47. package/dist/collection/components/wm-datepicker/wm-datepicker.js +439 -0
  48. package/dist/collection/components/wm-input/wm-input.css +220 -0
  49. package/dist/collection/components/wm-input/wm-input.js +302 -0
  50. package/dist/collection/components/wm-menuitem/wm-menuitem.css +118 -0
  51. package/dist/collection/components/wm-menuitem/wm-menuitem.js +411 -0
  52. package/dist/collection/components/wm-modal/wm-modal-footer.css +84 -0
  53. package/dist/collection/components/wm-modal/wm-modal-footer.js +159 -0
  54. package/dist/collection/components/wm-modal/wm-modal-header.css +78 -0
  55. package/dist/collection/components/wm-modal/wm-modal-header.js +109 -0
  56. package/dist/collection/components/wm-modal/wm-modal.css +155 -0
  57. package/dist/collection/components/wm-modal/wm-modal.js +356 -0
  58. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.css +94 -0
  59. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +97 -0
  60. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.css +67 -0
  61. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +114 -0
  62. package/dist/collection/components/wm-navigator/wm-navigator.css +137 -0
  63. package/dist/collection/components/wm-navigator/wm-navigator.js +468 -0
  64. package/dist/collection/components/wm-option/wm-option.css +162 -0
  65. package/dist/collection/components/wm-option/wm-option.js +394 -0
  66. package/dist/collection/components/wm-pagination/wm-pagination.css +217 -0
  67. package/dist/collection/components/wm-pagination/wm-pagination.js +348 -0
  68. package/dist/collection/components/wm-search/wm-search.css +155 -0
  69. package/dist/collection/components/wm-search/wm-search.js +439 -0
  70. package/dist/collection/components/wm-select/wm-select.css +315 -0
  71. package/dist/collection/components/wm-select/wm-select.js +676 -0
  72. package/dist/collection/components/wm-snackbar/wm-snackbar.css +331 -0
  73. package/dist/collection/components/wm-snackbar/wm-snackbar.js +240 -0
  74. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.css +104 -0
  75. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +202 -0
  76. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.css +73 -0
  77. package/dist/{ripple/wm-tab-list.entry.js → collection/components/wm-tabs/wm-tab-list/wm-tab-list.js} +131 -17
  78. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.css +57 -0
  79. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +104 -0
  80. package/dist/collection/components/wm-tag-input/wm-tag-input.css +431 -0
  81. package/dist/collection/components/wm-tag-input/wm-tag-input.js +754 -0
  82. package/dist/collection/components/wm-timepicker/wm-timepicker.css +370 -0
  83. package/dist/collection/components/wm-timepicker/wm-timepicker.js +567 -0
  84. package/dist/collection/components/wm-toggletip/wm-toggletip.css +350 -0
  85. package/dist/collection/components/wm-toggletip/wm-toggletip.js +217 -0
  86. package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.css +642 -0
  87. package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.js +753 -0
  88. package/dist/collection/components/wm-uploader/wm-uploader.css +666 -0
  89. package/dist/collection/components/wm-uploader/wm-uploader.js +673 -0
  90. package/dist/collection/components/wm-wrapper/wm-wrapper.js +27 -0
  91. package/dist/collection/dev/scripts.js +20 -0
  92. package/dist/collection/global/__mocks__/functions.js +5 -0
  93. package/dist/collection/global/functions.js +420 -0
  94. package/dist/{ripple/app-globals-b5693c90.js → collection/global/global.js} +3 -8
  95. package/dist/{ripple/interfaces-50753346.js → collection/global/interfaces.js} +4 -6
  96. package/dist/collection/global/services/__mocks__/http-service.js +130 -0
  97. package/dist/collection/global/services/http-service.js +50 -0
  98. package/dist/collection/lang/lang.js +5 -0
  99. package/dist/collection/lang/piglatin.js +93 -0
  100. package/dist/esm/functions-0deb7f8e.js +6117 -0
  101. package/dist/esm/global-d6b49e98.js +36 -0
  102. package/dist/{ripple → esm}/http-service-5d037e16.js +0 -0
  103. package/dist/esm/index-5a842e48.js +1363 -0
  104. package/dist/esm/index.js +1 -0
  105. package/dist/esm/interfaces-61c6305b.js +32 -0
  106. package/dist/esm/loader.js +18 -0
  107. package/dist/esm/polyfills/core-js.js +11 -0
  108. package/dist/esm/polyfills/css-shim.js +1 -0
  109. package/dist/esm/polyfills/dom.js +79 -0
  110. package/dist/esm/polyfills/es5-html-element.js +1 -0
  111. package/dist/esm/polyfills/index.js +34 -0
  112. package/dist/esm/polyfills/system.js +6 -0
  113. package/dist/{ripple → esm}/priv-chart-popover.entry.js +2 -2
  114. package/dist/{ripple → esm}/priv-datepicker.entry.js +3 -3
  115. package/dist/{ripple → esm}/priv-navigator-button.entry.js +1 -1
  116. package/dist/{ripple → esm}/priv-navigator-item.entry.js +1 -1
  117. package/dist/esm/ripple.js +18 -0
  118. package/dist/{ripple/wm-action-menu.entry.js → esm/wm-action-menu_2.entry.js} +114 -3
  119. package/dist/{ripple → esm}/wm-button.entry.js +3 -3
  120. package/dist/{ripple → esm}/wm-chart-slice.entry.js +1 -1
  121. package/dist/{ripple → esm}/wm-chart.entry.js +2 -2
  122. package/dist/{ripple → esm}/wm-datepicker.entry.js +27 -32
  123. package/dist/{ripple → esm}/wm-input.entry.js +2 -2
  124. package/dist/{ripple → esm}/wm-modal-footer.entry.js +2 -2
  125. package/dist/{ripple → esm}/wm-modal-header.entry.js +2 -2
  126. package/dist/{ripple → esm}/wm-modal.entry.js +2 -2
  127. package/dist/{ripple → esm}/wm-navigator.entry.js +3 -3
  128. package/dist/{ripple → esm}/wm-network-uploader.entry.js +2 -2
  129. package/dist/{ripple/wm-select.entry.js → esm/wm-option_2.entry.js} +119 -3
  130. package/dist/{ripple → esm}/wm-pagination.entry.js +2 -2
  131. package/dist/{ripple → esm}/wm-search.entry.js +2 -2
  132. package/dist/{ripple → esm}/wm-snackbar.entry.js +2 -2
  133. package/dist/esm/wm-tab-item_3.entry.js +310 -0
  134. package/dist/{ripple → esm}/wm-tag-input.entry.js +2 -2
  135. package/dist/{ripple → esm}/wm-timepicker.entry.js +2 -2
  136. package/dist/{ripple → esm}/wm-toggletip.entry.js +2 -2
  137. package/dist/{ripple → esm}/wm-uploader.entry.js +2 -2
  138. package/dist/{ripple → esm}/wm-wrapper.entry.js +1 -1
  139. package/dist/index.cjs.js +1 -0
  140. package/dist/index.js +1 -0
  141. package/dist/loader/cdn.js +3 -0
  142. package/dist/loader/index.cjs.js +3 -0
  143. package/dist/loader/index.d.ts +13 -0
  144. package/dist/loader/index.es2017.js +3 -0
  145. package/dist/loader/index.js +4 -0
  146. package/dist/loader/package.json +10 -0
  147. package/dist/ripple/index.esm.js +0 -1
  148. package/dist/ripple/p-103f8cae.entry.js +1 -0
  149. package/dist/ripple/p-129d94fa.entry.js +1 -0
  150. package/dist/ripple/p-139fe143.entry.js +1 -0
  151. package/dist/ripple/p-16367805.entry.js +1 -0
  152. package/dist/ripple/p-1d334060.entry.js +1 -0
  153. package/dist/ripple/p-2562f330.entry.js +1 -0
  154. package/dist/ripple/p-278b26ef.entry.js +1 -0
  155. package/dist/ripple/p-2c21bb72.entry.js +1 -0
  156. package/dist/ripple/p-2f5fda71.entry.js +1 -0
  157. package/dist/ripple/p-3e6f04d5.entry.js +1 -0
  158. package/dist/ripple/p-7185de7f.entry.js +1 -0
  159. package/dist/ripple/p-770d0798.entry.js +1 -0
  160. package/dist/ripple/p-846b4c5f.entry.js +1 -0
  161. package/dist/ripple/p-888bec42.js +1 -0
  162. package/dist/ripple/p-90779d53.entry.js +1 -0
  163. package/dist/ripple/p-934543f2.js +1 -0
  164. package/dist/ripple/p-9a087fee.entry.js +1 -0
  165. package/dist/ripple/p-a6d6eae7.js +1 -0
  166. package/dist/ripple/p-a942ad10.entry.js +1 -0
  167. package/dist/ripple/p-bfb4652d.entry.js +1 -0
  168. package/dist/ripple/p-c0fe5201.entry.js +1 -0
  169. package/dist/ripple/p-c2e27acc.entry.js +1 -0
  170. package/dist/ripple/p-c2edda64.entry.js +1 -0
  171. package/dist/ripple/p-d1fdcbcf.entry.js +1 -0
  172. package/dist/ripple/p-d40b6afb.entry.js +1 -0
  173. package/dist/ripple/p-da73db1c.entry.js +1 -0
  174. package/dist/ripple/p-e3843249.js +1 -0
  175. package/dist/ripple/p-ea5cd8b8.js +16 -0
  176. package/dist/ripple/p-ed0f43f4.entry.js +1 -0
  177. package/dist/ripple/p-ffafd363.entry.js +1 -0
  178. package/dist/ripple/ripple.esm.js +1 -125
  179. package/dist/types/components/wm-action-menu/wm-action-menu.d.ts +43 -0
  180. package/dist/types/components/wm-button/wm-button.d.ts +36 -0
  181. package/dist/types/components/wm-chart/priv-chart-popover/priv-chart-popover.d.ts +23 -0
  182. package/dist/types/components/wm-chart/wm-chart-slice.d.ts +8 -0
  183. package/dist/types/components/wm-chart/wm-chart.d.ts +77 -0
  184. package/dist/types/components/wm-datepicker/priv-datepicker/priv-datepicker.d.ts +75 -0
  185. package/dist/types/components/wm-datepicker/wm-datepicker.d.ts +39 -0
  186. package/dist/types/components/wm-input/wm-input.d.ts +30 -0
  187. package/dist/types/components/wm-menuitem/wm-menuitem.d.ts +30 -0
  188. package/dist/types/components/wm-modal/wm-modal-footer.d.ts +15 -0
  189. package/dist/types/components/wm-modal/wm-modal-header.d.ts +12 -0
  190. package/dist/types/components/wm-modal/wm-modal.d.ts +34 -0
  191. package/dist/types/components/wm-navigator/priv-navigator-button/priv-navigator-button.d.ts +10 -0
  192. package/dist/types/components/wm-navigator/priv-navigator-item/priv-navigator-item.d.ts +13 -0
  193. package/dist/types/components/wm-navigator/wm-navigator.d.ts +61 -0
  194. package/dist/types/components/wm-option/wm-option.d.ts +28 -0
  195. package/dist/types/components/wm-pagination/wm-pagination.d.ts +31 -0
  196. package/dist/types/components/wm-search/wm-search.d.ts +78 -0
  197. package/dist/types/components/wm-select/wm-select.d.ts +63 -0
  198. package/dist/types/components/wm-snackbar/wm-snackbar.d.ts +32 -0
  199. package/dist/types/components/wm-tabs/wm-tab-item/wm-tab-item.d.ts +35 -0
  200. package/dist/types/components/wm-tabs/wm-tab-list/wm-tab-list.d.ts +50 -0
  201. package/dist/types/components/wm-tabs/wm-tab-panel/wm-tab-panel.d.ts +20 -0
  202. package/dist/types/components/wm-tag-input/{wm-tag-input.d.ts~ds312_tagInputMaxTags → wm-tag-input.d.ts} +1 -1
  203. package/dist/types/components/wm-timepicker/wm-timepicker.d.ts +59 -0
  204. package/dist/types/components/wm-toggletip/wm-toggletip.d.ts +25 -0
  205. package/dist/types/components/wm-uploader/wm-network-uploader/wm-network-uploader.d.ts +85 -0
  206. package/dist/types/components/wm-uploader/wm-uploader.d.ts +75 -0
  207. package/dist/types/components/wm-wrapper/wm-wrapper.d.ts +7 -0
  208. package/dist/types/{components.d.ts~ds312_tagInputMaxTags → components.d.ts} +0 -0
  209. package/dist/types/global/__mocks__/functions.d.ts +5 -0
  210. package/dist/types/global/global.d.ts +1 -0
  211. package/dist/types/global/interfaces.d.ts +33 -0
  212. package/dist/types/global/services/__mocks__/http-service.d.ts +6 -0
  213. package/dist/types/global/services/http-service.d.ts +4 -0
  214. package/dist/types/lang/lang.d.ts +5 -0
  215. package/dist/types/{stencil-public-runtime.d.ts~ds312_tagInputMaxTags → stencil-public-runtime.d.ts} +190 -182
  216. package/package.json +1 -1
  217. package/dist/ripple/css-shim-bbdf0cc6.js +0 -4
  218. package/dist/ripple/dom-1f98a75f.js +0 -73
  219. package/dist/ripple/index-20b65f86.js +0 -2938
  220. package/dist/ripple/shadow-css-67b66845.js +0 -389
  221. package/dist/ripple/wm-menuitem.entry.js +0 -114
  222. package/dist/ripple/wm-option.entry.js +0 -119
  223. package/dist/ripple/wm-tab-item.entry.js +0 -78
  224. package/dist/ripple/wm-tab-panel.entry.js +0 -38
@@ -0,0 +1,365 @@
1
+ import { h, Component, Prop, Element, Listen, Watch, Host, State } from "@stencil/core";
2
+ import { forceUpdate } from "@stencil/core";
3
+ import { getIconCodeFromName } from "../../global/interfaces";
4
+ import { generateId, adjustTooltipPosition } from "../../global/functions";
5
+ export class Button {
6
+ constructor() {
7
+ // icon and tooltip have reflect set to true. Without reflect, the react wrappers don't expose the attribute
8
+ // and the component throws errors when they are required (when buttonStyle is icononly or navigational)
9
+ this.disabled = false;
10
+ this.buttonStyle = "secondary";
11
+ this.tooltipPosition = "bottom-right";
12
+ this.adjustedTooltipPosition = this.tooltipPosition;
13
+ this.permanentlyDelete = false;
14
+ this.textWrap = true;
15
+ this.isTabbing = false;
16
+ this.clickFunc = null;
17
+ this.ariaPopup = false;
18
+ }
19
+ get isTruncated() {
20
+ return !!this.buttonEl && this.buttonEl.offsetWidth < this.buttonEl.scrollWidth;
21
+ }
22
+ toggleTabbingOn() {
23
+ this.isTabbing = true;
24
+ }
25
+ toggleTabbingOff() {
26
+ this.isTabbing = false;
27
+ }
28
+ handleOnClick() {
29
+ // remove the onlick function when the component is disabled,
30
+ // to handle a bug in Edge 42 where the function would run
31
+ this.el.onclick = this.disabled ? null : this.clickFunc;
32
+ }
33
+ validateStyle(newValue) {
34
+ const valid = ["primary", "secondary", "textonly", "icononly", "navigational", "selectoronly"].includes(newValue);
35
+ if (!valid) {
36
+ this.buttonStyle = "secondary";
37
+ }
38
+ this.validateIcon();
39
+ }
40
+ updateIcon() {
41
+ this.icon = getIconCodeFromName(this.icon);
42
+ }
43
+ validateIcon() {
44
+ // if the style is icononly or navigational...
45
+ if (this.buttonStyle === "icononly" || this.buttonStyle === "navigational") {
46
+ // - an icon must be provided
47
+ if (!this.icon) {
48
+ console.error("wm-button should have a valid 'icon' property when button-style is set to 'icononly' or 'navigational'.");
49
+ }
50
+ // - if no tooltip text was passed and we couldn't generate one, throw an error
51
+ if (!this.tooltip) {
52
+ console.error("wm-button should have a valid 'tooltip' property when button-style is set to 'icononly' or 'navigational'.");
53
+ }
54
+ }
55
+ }
56
+ handleKeydown(ev) {
57
+ switch (ev.key) {
58
+ case "Enter":
59
+ ev.preventDefault();
60
+ if (!this.disabled) {
61
+ this.el.click();
62
+ }
63
+ break;
64
+ }
65
+ }
66
+ componentWillLoad() {
67
+ this.validateStyle(this.buttonStyle);
68
+ // replacing the prototype's focus event by our own
69
+ // to delegate focus to the appropriate el in the shadow root
70
+ // we could replace by ShadowRoot.delegatesFocus()
71
+ // when there's enough support for it
72
+ // @ts-ignore
73
+ this.el.focus = function () {
74
+ if (!this.disabled) {
75
+ this.shadowRoot.querySelector("button").focus();
76
+ }
77
+ };
78
+ if (this.icon) {
79
+ this.icon = this.icon = getIconCodeFromName(this.icon);
80
+ }
81
+ }
82
+ componentDidLoad() {
83
+ // store a reference of the onclick function if there is one
84
+ // so we can remove it when the button is disabled
85
+ // (to handle a bug in Edge 42)
86
+ if (this.el.onclick) {
87
+ this.clickFunc = this.el.onclick;
88
+ }
89
+ // this.handleOnClick();
90
+ if (document.body.classList.contains("wmcl-user-is-tabbing")) {
91
+ this.toggleTabbingOn();
92
+ }
93
+ this.ariaPopup = !!this.el.getAttribute("aria-haspopup");
94
+ forceUpdate(this.el); // originally here to renderTooltip(), now necessary to pass text-truncation tooltip test
95
+ }
96
+ showTooltip() {
97
+ // Because a :hover pseudoclass would apply before the tooltip is repositioned, hover styles must be applied through a class
98
+ // Otherwise, the tooltip will flash on-screen and possibly create scrollbars
99
+ if (!!this.tooltipEl) {
100
+ this.adjustedTooltipPosition = adjustTooltipPosition(this.tooltipPosition, this.el, this.tooltipEl);
101
+ this.tooltipEl.classList.remove("hidden");
102
+ }
103
+ }
104
+ hideTooltip() {
105
+ if (!!this.tooltipEl) {
106
+ this.tooltipEl.classList.add("hidden");
107
+ }
108
+ }
109
+ renderTooltip() {
110
+ // tooltip is only rendered for icononly and navigational types, or if the button text is truncated
111
+ if (this.buttonStyle === "icononly" || this.buttonStyle === "navigational" || this.isTruncated) {
112
+ return (h("div", { ref: (el) => (this.tooltipEl = el), "aria-hidden": "true", class: `tooltip hidden ${this.adjustedTooltipPosition}` }, this.isTruncated ? this.el.textContent : this.tooltip));
113
+ }
114
+ }
115
+ getClasses() {
116
+ let classes = "wm-button";
117
+ classes += this.permanentlyDelete ? " -permanentlydelete" : "";
118
+ classes += this.buttonStyle ? " -" + this.buttonStyle : " -secondary";
119
+ classes += this.textWrap ? "" : " nowrap";
120
+ classes += this.isTabbing ? " user-is-tabbing" : "";
121
+ classes += this.isTruncated ? " -truncated" : "";
122
+ classes += this.customBackground === "dark" ? " dark" : "";
123
+ return classes;
124
+ }
125
+ getAriaLabel() {
126
+ if (this.buttonStyle === "icononly" || this.buttonStyle === "navigational") {
127
+ return this.labelForIdenticalButtons ? this.labelForIdenticalButtons : this.tooltip;
128
+ }
129
+ if (this.labelForIdenticalButtons) {
130
+ return this.labelForIdenticalButtons;
131
+ }
132
+ }
133
+ render() {
134
+ return (h(Host, { class: this.disabled ? "button-disabled" : "" },
135
+ h("button", { id: generateId(), 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() },
136
+ this.icon && (h("span", { class: "mdi", style: this.iconSize ? { fontSize: this.iconSize } : {} }, String.fromCodePoint(parseInt(`0x${this.icon}`)))),
137
+ h("span", { class: "button-text" },
138
+ h("slot", null))),
139
+ this.renderTooltip()));
140
+ }
141
+ static get is() { return "wm-button"; }
142
+ static get encapsulation() { return "shadow"; }
143
+ static get originalStyleUrls() { return {
144
+ "$": ["wm-button.scss"]
145
+ }; }
146
+ static get styleUrls() { return {
147
+ "$": ["wm-button.css"]
148
+ }; }
149
+ static get properties() { return {
150
+ "disabled": {
151
+ "type": "boolean",
152
+ "mutable": false,
153
+ "complexType": {
154
+ "original": "boolean",
155
+ "resolved": "boolean",
156
+ "references": {}
157
+ },
158
+ "required": false,
159
+ "optional": false,
160
+ "docs": {
161
+ "tags": [],
162
+ "text": ""
163
+ },
164
+ "attribute": "disabled",
165
+ "reflect": true,
166
+ "defaultValue": "false"
167
+ },
168
+ "buttonStyle": {
169
+ "type": "string",
170
+ "mutable": true,
171
+ "complexType": {
172
+ "original": "string",
173
+ "resolved": "string",
174
+ "references": {}
175
+ },
176
+ "required": false,
177
+ "optional": false,
178
+ "docs": {
179
+ "tags": [],
180
+ "text": ""
181
+ },
182
+ "attribute": "button-style",
183
+ "reflect": false,
184
+ "defaultValue": "\"secondary\""
185
+ },
186
+ "icon": {
187
+ "type": "string",
188
+ "mutable": true,
189
+ "complexType": {
190
+ "original": "string",
191
+ "resolved": "string | undefined",
192
+ "references": {}
193
+ },
194
+ "required": false,
195
+ "optional": true,
196
+ "docs": {
197
+ "tags": [],
198
+ "text": ""
199
+ },
200
+ "attribute": "icon",
201
+ "reflect": true
202
+ },
203
+ "iconSize": {
204
+ "type": "string",
205
+ "mutable": false,
206
+ "complexType": {
207
+ "original": "string",
208
+ "resolved": "string | undefined",
209
+ "references": {}
210
+ },
211
+ "required": false,
212
+ "optional": true,
213
+ "docs": {
214
+ "tags": [],
215
+ "text": ""
216
+ },
217
+ "attribute": "icon-size",
218
+ "reflect": false
219
+ },
220
+ "tooltip": {
221
+ "type": "string",
222
+ "mutable": true,
223
+ "complexType": {
224
+ "original": "string",
225
+ "resolved": "string | undefined",
226
+ "references": {}
227
+ },
228
+ "required": false,
229
+ "optional": true,
230
+ "docs": {
231
+ "tags": [],
232
+ "text": ""
233
+ },
234
+ "attribute": "tooltip",
235
+ "reflect": true
236
+ },
237
+ "labelForIdenticalButtons": {
238
+ "type": "string",
239
+ "mutable": false,
240
+ "complexType": {
241
+ "original": "string",
242
+ "resolved": "string | undefined",
243
+ "references": {}
244
+ },
245
+ "required": false,
246
+ "optional": true,
247
+ "docs": {
248
+ "tags": [],
249
+ "text": ""
250
+ },
251
+ "attribute": "label-for-identical-buttons",
252
+ "reflect": false
253
+ },
254
+ "tooltipPosition": {
255
+ "type": "string",
256
+ "mutable": false,
257
+ "complexType": {
258
+ "original": "TooltipPosition",
259
+ "resolved": "\"bottom\" | \"bottom-left\" | \"bottom-right\" | \"left\" | \"right\" | \"top\" | \"top-left\" | \"top-right\"",
260
+ "references": {
261
+ "TooltipPosition": {
262
+ "location": "import",
263
+ "path": "../../global/interfaces"
264
+ }
265
+ }
266
+ },
267
+ "required": false,
268
+ "optional": false,
269
+ "docs": {
270
+ "tags": [],
271
+ "text": ""
272
+ },
273
+ "attribute": "tooltip-position",
274
+ "reflect": false,
275
+ "defaultValue": "\"bottom-right\""
276
+ },
277
+ "permanentlyDelete": {
278
+ "type": "boolean",
279
+ "mutable": false,
280
+ "complexType": {
281
+ "original": "boolean",
282
+ "resolved": "boolean | undefined",
283
+ "references": {}
284
+ },
285
+ "required": false,
286
+ "optional": true,
287
+ "docs": {
288
+ "tags": [],
289
+ "text": ""
290
+ },
291
+ "attribute": "permanently-delete",
292
+ "reflect": false,
293
+ "defaultValue": "false"
294
+ },
295
+ "textWrap": {
296
+ "type": "boolean",
297
+ "mutable": false,
298
+ "complexType": {
299
+ "original": "boolean",
300
+ "resolved": "boolean",
301
+ "references": {}
302
+ },
303
+ "required": false,
304
+ "optional": false,
305
+ "docs": {
306
+ "tags": [],
307
+ "text": ""
308
+ },
309
+ "attribute": "text-wrap",
310
+ "reflect": false,
311
+ "defaultValue": "true"
312
+ },
313
+ "customBackground": {
314
+ "type": "string",
315
+ "mutable": false,
316
+ "complexType": {
317
+ "original": "string",
318
+ "resolved": "string | undefined",
319
+ "references": {}
320
+ },
321
+ "required": false,
322
+ "optional": true,
323
+ "docs": {
324
+ "tags": [],
325
+ "text": ""
326
+ },
327
+ "attribute": "custom-background",
328
+ "reflect": false
329
+ }
330
+ }; }
331
+ static get states() { return {
332
+ "adjustedTooltipPosition": {},
333
+ "isTabbing": {}
334
+ }; }
335
+ static get elementRef() { return "el"; }
336
+ static get watchers() { return [{
337
+ "propName": "disabled",
338
+ "methodName": "handleOnClick"
339
+ }, {
340
+ "propName": "buttonStyle",
341
+ "methodName": "validateStyle"
342
+ }, {
343
+ "propName": "icon",
344
+ "methodName": "updateIcon"
345
+ }]; }
346
+ static get listeners() { return [{
347
+ "name": "wmUserIsTabbing",
348
+ "method": "toggleTabbingOn",
349
+ "target": "window",
350
+ "capture": false,
351
+ "passive": false
352
+ }, {
353
+ "name": "wmUserIsNotTabbing",
354
+ "method": "toggleTabbingOff",
355
+ "target": "window",
356
+ "capture": false,
357
+ "passive": false
358
+ }, {
359
+ "name": "keydown",
360
+ "method": "handleKeydown",
361
+ "target": undefined,
362
+ "capture": false,
363
+ "passive": false
364
+ }]; }
365
+ }
@@ -0,0 +1,132 @@
1
+ /* --------------------------------------
2
+ 1. Box-shadow
3
+ -------------------------------------- */
4
+ /* --------------------------------------
5
+ 2. Border-radius
6
+ -------------------------------------- */
7
+ /* --------------------------------------
8
+ 3. Transforms
9
+ -------------------------------------- */
10
+ /* --------------------------------------
11
+ 4. Button Focus
12
+ -------------------------------------- */
13
+ /* --------------------------------------
14
+ 5. Flex
15
+ -------------------------------------- */
16
+ /* --------------------------------------
17
+ 6. Button Hover
18
+ -------------------------------------- */
19
+ /* --------------------------------------
20
+ 7. Screen Reader Only
21
+ -------------------------------------- */
22
+ /* --------------------------------------
23
+ 8. Label styles
24
+ this mixin includes all the styles for the label
25
+ + flex rules on the parent container to switch between top and left position
26
+ + srOnly when label is hidden
27
+ Assumes the following markup:
28
+ div.wrapper[.label-left.invalid] > div.label-wrapper > label.label > span.required
29
+ .wrapper is for the flex rules
30
+ .label-wrapper is to set the height of the label when positioned left so it's the same height as
31
+ the input. It can't be done directly on .label because of possible line wrapping.
32
+ When the label is on top there's no line wrapping at all to ensure proper alignment of inlined elements
33
+ (they can't be aligned on the baseline because of possible description text and error message)
34
+ -------------------------------------- */
35
+ /********************************************************************************************/
36
+ /* DO NOT USE THESE DIRECTLY, ASSIGN THEM TO VARIABLES NAMED AFTER FUNCTIONALITY, SEE BELOW */
37
+ /********************************************************************************************/
38
+ /* USAGE */
39
+ /* BELOW IS BEFORE WE HAD THE COLOR PALETTE FROM UI */
40
+ /* TODO: replace with vars above whenever possible */
41
+ /* Buttons */
42
+ /* VIA */
43
+ priv-chart-popover {
44
+ position: fixed;
45
+ z-index: 10;
46
+ border-radius: 0.1875rem;
47
+ -webkit-box-shadow: 0 11px 15px 0 rgba(0, 0, 0, 0.2), 0 7px 20px 0 rgba(0, 0, 0, 0.12);
48
+ -moz-box-shadow: 0 11px 15px 0 rgba(0, 0, 0, 0.2), 0 7px 20px 0 rgba(0, 0, 0, 0.12);
49
+ box-shadow: 0 11px 15px 0 rgba(0, 0, 0, 0.2), 0 7px 20px 0 rgba(0, 0, 0, 0.12);
50
+ background-color: #fff;
51
+ font-size: 0.875rem;
52
+ text-align: left;
53
+ }
54
+ priv-chart-popover.user-is-tabbing .button-text {
55
+ background: linear-gradient(90deg, #3862e9 66%, transparent 0) repeat-x;
56
+ background-size: 6px 3px;
57
+ background-position: 0 1em;
58
+ border-radius: 0;
59
+ line-height: normal;
60
+ }
61
+
62
+ .sr-only {
63
+ position: absolute !important;
64
+ width: 1px !important;
65
+ height: 1px !important;
66
+ padding: 0 !important;
67
+ border: 0 !important;
68
+ overflow: hidden !important;
69
+ clip: rect(0, 0, 0, 0) !important;
70
+ clip-path: inset(50%) !important;
71
+ white-space: nowrap !important;
72
+ margin: -1px !important;
73
+ }
74
+
75
+ .popover {
76
+ width: 10.5rem;
77
+ padding: 0.625rem 0.9375rem;
78
+ box-sizing: border-box;
79
+ }
80
+ .popover h1.title {
81
+ font-size: 1em;
82
+ font-weight: 500;
83
+ margin: 0;
84
+ padding-top: 0;
85
+ padding-left: 0;
86
+ padding-bottom: 0.25rem;
87
+ }
88
+ .popover .text {
89
+ margin: 0;
90
+ margin-bottom: 0.5rem;
91
+ }
92
+ .popover .popover-button {
93
+ -webkit-box-shadow: none;
94
+ -moz-box-shadow: none;
95
+ box-shadow: none;
96
+ position: relative;
97
+ display: inline-block;
98
+ margin-left: 1rem;
99
+ padding-left: 0;
100
+ padding-right: 0;
101
+ height: auto;
102
+ border: none;
103
+ background: transparent;
104
+ text-decoration: none;
105
+ letter-spacing: 0;
106
+ text-transform: none;
107
+ text-align: initial;
108
+ font-size: 0.875rem;
109
+ font-weight: 700;
110
+ color: #575195;
111
+ line-height: normal;
112
+ }
113
+ .popover .popover-button .btn-icon {
114
+ position: absolute;
115
+ top: 0.1875rem;
116
+ left: -1rem;
117
+ }
118
+ .popover .popover-button:focus {
119
+ outline: none;
120
+ }
121
+ .popover .popover-button::-moz-focus-inner {
122
+ border: 0;
123
+ outline: none;
124
+ }
125
+ .popover .popover-button:hover {
126
+ text-decoration: none;
127
+ background: none;
128
+ color: #454077;
129
+ }
130
+ .popover .popover-button:hover span {
131
+ text-decoration: underline;
132
+ }