@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,220 @@
1
+ @charset "UTF-8";
2
+ /* --------------------------------------
3
+ 1. Box-shadow
4
+ -------------------------------------- */
5
+ /* --------------------------------------
6
+ 2. Border-radius
7
+ -------------------------------------- */
8
+ /* --------------------------------------
9
+ 3. Transforms
10
+ -------------------------------------- */
11
+ /* --------------------------------------
12
+ 4. Button Focus
13
+ -------------------------------------- */
14
+ /* --------------------------------------
15
+ 5. Flex
16
+ -------------------------------------- */
17
+ /* --------------------------------------
18
+ 6. Button Hover
19
+ -------------------------------------- */
20
+ /* --------------------------------------
21
+ 7. Screen Reader Only
22
+ -------------------------------------- */
23
+ /* --------------------------------------
24
+ 8. Label styles
25
+ this mixin includes all the styles for the label
26
+ + flex rules on the parent container to switch between top and left position
27
+ + srOnly when label is hidden
28
+ Assumes the following markup:
29
+ div.wrapper[.label-left.invalid] > div.label-wrapper > label.label > span.required
30
+ .wrapper is for the flex rules
31
+ .label-wrapper is to set the height of the label when positioned left so it's the same height as
32
+ the input. It can't be done directly on .label because of possible line wrapping.
33
+ When the label is on top there's no line wrapping at all to ensure proper alignment of inlined elements
34
+ (they can't be aligned on the baseline because of possible description text and error message)
35
+ -------------------------------------- */
36
+ /********************************************************************************************/
37
+ /* DO NOT USE THESE DIRECTLY, ASSIGN THEM TO VARIABLES NAMED AFTER FUNCTIONALITY, SEE BELOW */
38
+ /********************************************************************************************/
39
+ /* USAGE */
40
+ /* BELOW IS BEFORE WE HAD THE COLOR PALETTE FROM UI */
41
+ /* TODO: replace with vars above whenever possible */
42
+ /* Buttons */
43
+ /* VIA */
44
+ :host,
45
+ wm-input {
46
+ font-family: inherit;
47
+ width: 100%;
48
+ }
49
+ :host *,
50
+ wm-input * {
51
+ box-sizing: border-box;
52
+ }
53
+ :host .wrapper,
54
+ wm-input .wrapper {
55
+ display: -webkit-box;
56
+ display: -webkit-flex;
57
+ display: -ms-flexbox;
58
+ display: flex;
59
+ flex-direction: column;
60
+ font-size: 0.875rem;
61
+ }
62
+ :host .wrapper .label,
63
+ wm-input .wrapper .label {
64
+ display: block;
65
+ line-height: normal;
66
+ font-weight: 600;
67
+ white-space: nowrap;
68
+ margin-bottom: 0.25rem;
69
+ }
70
+ :host .wrapper .label .required,
71
+ wm-input .wrapper .label .required {
72
+ color: #c0392b;
73
+ }
74
+ :host .wrapper.label-left,
75
+ wm-input .wrapper.label-left {
76
+ flex-direction: row;
77
+ }
78
+ :host .wrapper.label-left .label-wrapper,
79
+ wm-input .wrapper.label-left .label-wrapper {
80
+ line-height: 2.5rem;
81
+ }
82
+ :host .wrapper.label-left .label-wrapper .label,
83
+ wm-input .wrapper.label-left .label-wrapper .label {
84
+ display: flex;
85
+ align-items: center;
86
+ min-height: 2.5rem;
87
+ white-space: normal;
88
+ margin-bottom: 0;
89
+ margin-right: 0.75rem;
90
+ }
91
+ :host .wrapper.label-none label,
92
+ wm-input .wrapper.label-none label {
93
+ position: absolute !important;
94
+ width: 1px !important;
95
+ height: 1px !important;
96
+ padding: 0 !important;
97
+ border: 0 !important;
98
+ overflow: hidden !important;
99
+ clip: rect(0, 0, 0, 0) !important;
100
+ clip-path: inset(50%) !important;
101
+ white-space: nowrap !important;
102
+ margin: -1px !important;
103
+ }
104
+ :host .wrapper.invalid .label,
105
+ wm-input .wrapper.invalid .label {
106
+ color: #c0392b;
107
+ }
108
+ :host .wrapper.invalid .label:after,
109
+ wm-input .wrapper.invalid .label:after {
110
+ display: inline-block;
111
+ font: normal normal normal 24px/1 "Material Design Icons";
112
+ font-size: inherit;
113
+ text-rendering: auto;
114
+ line-height: inherit;
115
+ -webkit-font-smoothing: antialiased;
116
+ -moz-osx-font-smoothing: grayscale;
117
+ content: "";
118
+ margin-left: 0.3125rem;
119
+ }
120
+ [dir=RTL] :host .wrapper.invalid .label:after,
121
+ [dir=RTL] wm-input .wrapper.invalid .label:after {
122
+ margin-left: 0;
123
+ margin-right: 0.3125rem;
124
+ }
125
+ :host .wrapper.rtl.label-left .label,
126
+ wm-input .wrapper.rtl.label-left .label {
127
+ margin-right: 0;
128
+ margin-left: 0.75rem;
129
+ }
130
+ :host .wrapper .inner-wrapper,
131
+ wm-input .wrapper .inner-wrapper {
132
+ width: 100%;
133
+ }
134
+ :host .wrapper .inputfield-wrapper,
135
+ wm-input .wrapper .inputfield-wrapper {
136
+ height: 2.5rem;
137
+ border: 1px solid #4a4a4a;
138
+ -webkit-border-radius: 3px;
139
+ -moz-border-radius: 3px;
140
+ -ms-border-radius: 3px;
141
+ border-radius: 3px;
142
+ display: flex;
143
+ }
144
+ :host .wrapper .character-count,
145
+ wm-input .wrapper .character-count {
146
+ display: flex;
147
+ align-items: center;
148
+ justify-content: center;
149
+ min-width: 5rem;
150
+ background-color: rgba(74, 74, 74, 0.05);
151
+ font-size: 0.875rem;
152
+ font-weight: 500;
153
+ align-self: stretch;
154
+ }
155
+ :host .wrapper input,
156
+ wm-input .wrapper input {
157
+ -webkit-border-radius: 3px;
158
+ -moz-border-radius: 3px;
159
+ -ms-border-radius: 3px;
160
+ border-radius: 3px;
161
+ border: none;
162
+ font-family: inherit;
163
+ font-size: 0.875rem;
164
+ height: 100%;
165
+ flex: 1;
166
+ padding: 0.75rem 1rem;
167
+ width: 100%;
168
+ }
169
+ :host .wrapper input:disabled,
170
+ wm-input .wrapper input:disabled {
171
+ background-color: #f0f0f0;
172
+ color: #737373;
173
+ }
174
+ :host .wrapper input:focus,
175
+ wm-input .wrapper input:focus {
176
+ outline: none;
177
+ }
178
+ :host .wrapper .info,
179
+ wm-input .wrapper .info {
180
+ font-style: italic;
181
+ line-height: 100%;
182
+ margin: 4px 0;
183
+ }
184
+ :host .wrapper.invalid .inputfield-wrapper,
185
+ wm-input .wrapper.invalid .inputfield-wrapper {
186
+ -webkit-box-shadow: 0 0 0 1px #c0392b;
187
+ -moz-box-shadow: 0 0 0 1px #c0392b;
188
+ box-shadow: 0 0 0 1px #c0392b;
189
+ border-color: #c0392b;
190
+ }
191
+ :host .wrapper.invalid .error-message,
192
+ wm-input .wrapper.invalid .error-message {
193
+ color: #c0392b;
194
+ margin: 4px 0;
195
+ display: block;
196
+ font-style: italic;
197
+ line-height: 100%;
198
+ }
199
+ :host .wrapper:focus .inputfield-wrapper, :host .wrapper.focus .inputfield-wrapper,
200
+ wm-input .wrapper:focus .inputfield-wrapper,
201
+ wm-input .wrapper.focus .inputfield-wrapper {
202
+ -webkit-box-shadow: 0 0 0 1px #20cbd4;
203
+ -moz-box-shadow: 0 0 0 1px #20cbd4;
204
+ box-shadow: 0 0 0 1px #20cbd4;
205
+ outline: none;
206
+ border-color: #20cbd4;
207
+ }
208
+ :host .sr-only,
209
+ wm-input .sr-only {
210
+ position: absolute !important;
211
+ width: 1px !important;
212
+ height: 1px !important;
213
+ padding: 0 !important;
214
+ border: 0 !important;
215
+ overflow: hidden !important;
216
+ clip: rect(0, 0, 0, 0) !important;
217
+ clip-path: inset(50%) !important;
218
+ white-space: nowrap !important;
219
+ margin: -1px !important;
220
+ }
@@ -0,0 +1,302 @@
1
+ import { h, Component, Element, Host, Prop, State } from "@stencil/core";
2
+ import { intl, generateId, isRelatedTarget } from "../../global/functions";
3
+ export class Input {
4
+ constructor() {
5
+ this.labelPosition = "top";
6
+ this.value = "";
7
+ this.disabled = false;
8
+ this.placeholder = "";
9
+ this.requiredField = false;
10
+ this.charCount = 0;
11
+ this.announcement = "";
12
+ this.uid = "";
13
+ this.requiredErrorMessage = intl.formatMessage({
14
+ id: "global.requiredError",
15
+ defaultMessage: "This field is required.",
16
+ });
17
+ }
18
+ componentWillLoad() {
19
+ this.uid = this.el.id ? this.el.id : generateId();
20
+ this.el.focus = function () {
21
+ if (!this.disabled) {
22
+ this.shadowRoot.querySelector("input").focus();
23
+ }
24
+ };
25
+ if (!this.label) {
26
+ console.error("wm-input requires the label property");
27
+ }
28
+ }
29
+ componentDidLoad() {
30
+ if (this.value) {
31
+ this.inputEl.value = this.value;
32
+ }
33
+ }
34
+ handleKeyDown(ev) {
35
+ // in most browsers, onInput doesn't fire if the input's maxLength is reached
36
+ // to handle the case where a user continues to type after reaching the character limit, the keyDown event must be used
37
+ const isModifierKey = ev.ctrlKey || ev.metaKey || ev.altKey;
38
+ const isCharacter = /^.$/.test(ev.key) && !isModifierKey;
39
+ const hasReachedCharacterLimit = isCharacter && this.characterLimit && this.inputEl.value.length >= this.characterLimit;
40
+ if (hasReachedCharacterLimit) {
41
+ this.announce(this.generateCharacterLimitWarning(this.charCount, this.characterLimit));
42
+ }
43
+ }
44
+ handleBlur(ev) {
45
+ // do not validate if clicking to an element that should prevent validation (e.g. close button on modal)
46
+ const shouldPreventValidation = this.preventValidation && isRelatedTarget(ev, this.preventValidation);
47
+ if (this.requiredField && !shouldPreventValidation) {
48
+ this.errorMessage = this.updateRequiredError(this.errorMessage, this.requiredErrorMessage, this.value);
49
+ }
50
+ this.inputWrapperEl.classList.remove("focus");
51
+ }
52
+ handleInput(ev) {
53
+ this.value = ev.target.value;
54
+ this.charCount = this.value.length;
55
+ if (this.characterLimit && this.charCount >= this.characterLimit - 5) {
56
+ this.announce(this.generateCharacterLimitWarning(this.charCount, this.characterLimit));
57
+ }
58
+ }
59
+ handleFocus() {
60
+ this.inputWrapperEl.classList.add("focus");
61
+ }
62
+ updateRequiredError(errorMessage, requiredErrorMessage, value) {
63
+ const errorPresent = !!errorMessage && errorMessage !== "";
64
+ let newErrorMessage = errorMessage || "";
65
+ // no error and empty value generates required error message
66
+ if (!errorPresent && value === "") {
67
+ newErrorMessage = requiredErrorMessage;
68
+ }
69
+ // if there is an error and a value, clear error message
70
+ // unless it's a custom error set by the dev
71
+ else if (errorPresent && value !== "") {
72
+ if (errorMessage === requiredErrorMessage) {
73
+ newErrorMessage = "";
74
+ }
75
+ }
76
+ return newErrorMessage;
77
+ }
78
+ announce(message) {
79
+ if (this.liveRegionEl.textContent === message) {
80
+ message += "\u00A0";
81
+ }
82
+ this.announcement = message;
83
+ }
84
+ generateCharacterLimitWarning(charCount, charLimit) {
85
+ const charactersEnteredMessage = intl.formatMessage({
86
+ id: "input.charactersEntered",
87
+ defaultMessage: "{x, number} of {y, number} characters entered.",
88
+ }, { x: charCount, y: charLimit });
89
+ const characterLimitReachedMessage = intl.formatMessage({
90
+ id: "input.characterLimitReached",
91
+ defaultMessage: "No additional characters will be entered.",
92
+ });
93
+ return `${charactersEnteredMessage}${charCount >= charLimit ? " " + characterLimitReachedMessage : ""}`;
94
+ }
95
+ render() {
96
+ return (h(Host, { id: this.uid },
97
+ h("div", { class: `wrapper label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}`, ref: (el) => (this.inputWrapperEl = el) },
98
+ h("div", { class: "label-wrapper" }, this.labelPosition !== "none" && (h("label", { htmlFor: `inputfield-${this.uid}`, class: "label" },
99
+ this.label,
100
+ this.requiredField && (h("span", { class: "required", "aria-hidden": "true" }, "*"))))),
101
+ h("div", { class: "inner-wrapper" },
102
+ h("div", { class: "inputfield-wrapper" },
103
+ h("input", { ref: (el) => (this.inputEl = el), id: `inputfield-${this.uid}`, disabled: this.disabled, "aria-label": this.label, "aria-describedby": `info-${this.uid} error-${this.uid}`, onInput: (ev) => this.handleInput(ev), onKeyDown: (ev) => this.handleKeyDown(ev), onBlur: (ev) => this.handleBlur(ev), onFocus: this.handleFocus.bind(this), placeholder: this.placeholder, autocomplete: "off", required: this.requiredField, maxLength: this.characterLimit || undefined }),
104
+ this.characterLimit && typeof this.characterLimit === "number" ? (h("div", { class: "character-count" },
105
+ this.charCount,
106
+ "/",
107
+ this.characterLimit)) : ("")),
108
+ this.info && (h("div", { id: `info-${this.uid}`, class: "info" }, this.info)),
109
+ h("div", { id: `error-${this.uid}`, "aria-live": "assertive", class: "error-message", "aria-atomic": "true" }, this.errorMessage),
110
+ h("div", { class: "sr-only", "aria-live": "polite", "aria-atomic": "true", ref: (el) => (this.liveRegionEl = el) }, this.announcement)))));
111
+ }
112
+ static get is() { return "wm-input"; }
113
+ static get encapsulation() { return "shadow"; }
114
+ static get originalStyleUrls() { return {
115
+ "$": ["wm-input.scss"]
116
+ }; }
117
+ static get styleUrls() { return {
118
+ "$": ["wm-input.css"]
119
+ }; }
120
+ static get properties() { return {
121
+ "label": {
122
+ "type": "string",
123
+ "mutable": false,
124
+ "complexType": {
125
+ "original": "string",
126
+ "resolved": "string",
127
+ "references": {}
128
+ },
129
+ "required": true,
130
+ "optional": false,
131
+ "docs": {
132
+ "tags": [],
133
+ "text": ""
134
+ },
135
+ "attribute": "label",
136
+ "reflect": false
137
+ },
138
+ "labelPosition": {
139
+ "type": "string",
140
+ "mutable": false,
141
+ "complexType": {
142
+ "original": "\"top\" | \"left\" | \"none\"",
143
+ "resolved": "\"left\" | \"none\" | \"top\"",
144
+ "references": {}
145
+ },
146
+ "required": false,
147
+ "optional": false,
148
+ "docs": {
149
+ "tags": [],
150
+ "text": ""
151
+ },
152
+ "attribute": "label-position",
153
+ "reflect": false,
154
+ "defaultValue": "\"top\""
155
+ },
156
+ "value": {
157
+ "type": "string",
158
+ "mutable": true,
159
+ "complexType": {
160
+ "original": "string",
161
+ "resolved": "string",
162
+ "references": {}
163
+ },
164
+ "required": false,
165
+ "optional": false,
166
+ "docs": {
167
+ "tags": [],
168
+ "text": ""
169
+ },
170
+ "attribute": "value",
171
+ "reflect": true,
172
+ "defaultValue": "\"\""
173
+ },
174
+ "disabled": {
175
+ "type": "boolean",
176
+ "mutable": false,
177
+ "complexType": {
178
+ "original": "boolean",
179
+ "resolved": "boolean",
180
+ "references": {}
181
+ },
182
+ "required": false,
183
+ "optional": false,
184
+ "docs": {
185
+ "tags": [],
186
+ "text": ""
187
+ },
188
+ "attribute": "disabled",
189
+ "reflect": true,
190
+ "defaultValue": "false"
191
+ },
192
+ "info": {
193
+ "type": "string",
194
+ "mutable": false,
195
+ "complexType": {
196
+ "original": "string",
197
+ "resolved": "string | undefined",
198
+ "references": {}
199
+ },
200
+ "required": false,
201
+ "optional": true,
202
+ "docs": {
203
+ "tags": [],
204
+ "text": ""
205
+ },
206
+ "attribute": "info",
207
+ "reflect": false
208
+ },
209
+ "placeholder": {
210
+ "type": "string",
211
+ "mutable": false,
212
+ "complexType": {
213
+ "original": "string",
214
+ "resolved": "string",
215
+ "references": {}
216
+ },
217
+ "required": false,
218
+ "optional": false,
219
+ "docs": {
220
+ "tags": [],
221
+ "text": ""
222
+ },
223
+ "attribute": "placeholder",
224
+ "reflect": false,
225
+ "defaultValue": "\"\""
226
+ },
227
+ "requiredField": {
228
+ "type": "boolean",
229
+ "mutable": false,
230
+ "complexType": {
231
+ "original": "boolean",
232
+ "resolved": "boolean",
233
+ "references": {}
234
+ },
235
+ "required": false,
236
+ "optional": false,
237
+ "docs": {
238
+ "tags": [],
239
+ "text": ""
240
+ },
241
+ "attribute": "required-field",
242
+ "reflect": false,
243
+ "defaultValue": "false"
244
+ },
245
+ "errorMessage": {
246
+ "type": "string",
247
+ "mutable": false,
248
+ "complexType": {
249
+ "original": "string",
250
+ "resolved": "string | undefined",
251
+ "references": {}
252
+ },
253
+ "required": false,
254
+ "optional": true,
255
+ "docs": {
256
+ "tags": [],
257
+ "text": ""
258
+ },
259
+ "attribute": "error-message",
260
+ "reflect": true
261
+ },
262
+ "characterLimit": {
263
+ "type": "number",
264
+ "mutable": false,
265
+ "complexType": {
266
+ "original": "number",
267
+ "resolved": "number | undefined",
268
+ "references": {}
269
+ },
270
+ "required": false,
271
+ "optional": true,
272
+ "docs": {
273
+ "tags": [],
274
+ "text": ""
275
+ },
276
+ "attribute": "character-limit",
277
+ "reflect": false
278
+ },
279
+ "preventValidation": {
280
+ "type": "string",
281
+ "mutable": false,
282
+ "complexType": {
283
+ "original": "string",
284
+ "resolved": "string | undefined",
285
+ "references": {}
286
+ },
287
+ "required": false,
288
+ "optional": true,
289
+ "docs": {
290
+ "tags": [],
291
+ "text": ""
292
+ },
293
+ "attribute": "prevent-validation",
294
+ "reflect": false
295
+ }
296
+ }; }
297
+ static get states() { return {
298
+ "charCount": {},
299
+ "announcement": {}
300
+ }; }
301
+ static get elementRef() { return "el"; }
302
+ }
@@ -0,0 +1,118 @@
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
+ :host,
44
+ wm-menuitem {
45
+ contain: content;
46
+ font-family: inherit;
47
+ }
48
+ :host .wrapper,
49
+ wm-menuitem .wrapper {
50
+ display: block;
51
+ min-width: 8.75rem;
52
+ cursor: pointer;
53
+ padding: 1.25rem;
54
+ border-radius: 0px 0px 0px 0px;
55
+ background: #fff;
56
+ font-family: inherit;
57
+ font-weight: 500;
58
+ list-style: none;
59
+ border-bottom: 2px solid rgba(46, 27, 70, 0.05);
60
+ color: #575195;
61
+ font-weight: 700;
62
+ }
63
+ :host .wrapper:focus, :host .wrapper.focus,
64
+ wm-menuitem .wrapper:focus,
65
+ wm-menuitem .wrapper.focus {
66
+ outline: none;
67
+ background: #f4f3f6;
68
+ }
69
+ :host .wrapper:hover,
70
+ wm-menuitem .wrapper:hover {
71
+ background: #f4f3f6;
72
+ outline: none;
73
+ }
74
+ :host .wrapper .description,
75
+ wm-menuitem .wrapper .description {
76
+ color: #4a4a4a;
77
+ font-size: 0.875rem;
78
+ padding-top: 0.5rem;
79
+ white-space: normal;
80
+ font-weight: 400;
81
+ }
82
+ :host .wrapper[aria-disabled=true],
83
+ wm-menuitem .wrapper[aria-disabled=true] {
84
+ font-style: italic;
85
+ color: #6b6b6b;
86
+ }
87
+ :host .wrapper:not(:last-child),
88
+ wm-menuitem .wrapper:not(:last-child) {
89
+ border-bottom: 2px solid rgba(46, 27, 70, 0.05);
90
+ }
91
+ :host ::slotted,
92
+ wm-menuitem ::slotted {
93
+ font-family: inherit;
94
+ }
95
+ :host .mdi,
96
+ wm-menuitem .mdi {
97
+ display: inline-block;
98
+ font: normal normal normal 24px/1 "Material Design Icons";
99
+ font-size: inherit;
100
+ text-rendering: auto;
101
+ line-height: inherit;
102
+ -webkit-font-smoothing: antialiased;
103
+ -moz-osx-font-smoothing: grayscale;
104
+ display: inline-block;
105
+ margin-right: 0.625rem;
106
+ pointer-events: none;
107
+ }
108
+
109
+ :host(:focus),
110
+ wm-menuitem:focus {
111
+ outline: none;
112
+ background: #f4f3f6;
113
+ }
114
+
115
+ :host([aria-disabled=true]),
116
+ wm-menuitem[aria-disabled=true] {
117
+ pointer-events: none;
118
+ }