@watermarkinsights/ripple 5.7.0-6 → 5.7.0-8

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 (148) hide show
  1. package/dist/cjs/{app-globals-b78b1f4d.js → app-globals-1f689ab3.js} +1 -1
  2. package/dist/cjs/index-788526f5.js +8 -12
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/priv-navigator-button.cjs.entry.js +1 -1
  5. package/dist/cjs/priv-navigator-item.cjs.entry.js +1 -1
  6. package/dist/cjs/ripple.cjs.js +2 -2
  7. package/dist/cjs/wm-modal-pss_3.cjs.entry.js +216 -0
  8. package/dist/cjs/{wm-modal.cjs.entry.js → wm-modal_3.cjs.entry.js} +75 -0
  9. package/dist/cjs/wm-navigation_3.cjs.entry.js +4 -4
  10. package/dist/cjs/wm-nested-select.cjs.entry.js +37 -13
  11. package/dist/cjs/wm-option_2.cjs.entry.js +1 -1
  12. package/dist/cjs/wm-pagination.cjs.entry.js +1 -1
  13. package/dist/cjs/wm-search.cjs.entry.js +2 -2
  14. package/dist/cjs/wm-snackbar.cjs.entry.js +2 -2
  15. package/dist/cjs/wm-tab-item_3.cjs.entry.js +3 -3
  16. package/dist/cjs/wm-tag-input.cjs.entry.js +3 -3
  17. package/dist/cjs/wm-textarea.cjs.entry.js +1 -1
  18. package/dist/cjs/wm-timepicker.cjs.entry.js +2 -2
  19. package/dist/cjs/wm-toggletip.cjs.entry.js +2 -2
  20. package/dist/cjs/wm-uploader.cjs.entry.js +2 -2
  21. package/dist/collection/collection-manifest.json +17 -5
  22. package/dist/collection/components/selects/wm-nested-select/wm-nested-select.css +1 -1
  23. package/dist/collection/components/selects/wm-nested-select/wm-nested-select.js +43 -13
  24. package/dist/collection/components/selects/wm-option/wm-option.css +1 -1
  25. package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.css +61 -0
  26. package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.js +138 -0
  27. package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.css +55 -0
  28. package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.js +81 -0
  29. package/dist/collection/components/wm-modal-pss/wm-modal-pss.css +134 -0
  30. package/dist/collection/components/wm-modal-pss/wm-modal-pss.js +361 -0
  31. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +1 -1
  32. package/dist/collection/components/wm-navigation/wm-navigation-item.js +1 -1
  33. package/dist/collection/components/wm-navigation/wm-navigation.js +2 -2
  34. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +1 -1
  35. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +1 -1
  36. package/dist/collection/components/wm-pagination/wm-pagination.js +1 -1
  37. package/dist/collection/components/wm-search/wm-search.js +2 -2
  38. package/dist/collection/components/wm-snackbar/wm-snackbar.js +2 -2
  39. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +1 -1
  40. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +1 -1
  41. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +1 -1
  42. package/dist/collection/components/wm-tag-input/wm-tag-input.js +3 -3
  43. package/dist/collection/components/wm-textarea/wm-textarea.js +1 -1
  44. package/dist/collection/components/wm-timepicker/wm-timepicker.js +2 -2
  45. package/dist/collection/components/wm-toggletip/wm-toggletip.js +2 -2
  46. package/dist/collection/components/wm-uploader/wm-uploader.js +2 -2
  47. package/dist/esm/{app-globals-079cb2f3.js → app-globals-0f27630e.js} +1 -1
  48. package/dist/esm/index-130e07bb.js +8 -12
  49. package/dist/esm/loader.js +2 -2
  50. package/dist/esm/priv-navigator-button.entry.js +1 -1
  51. package/dist/esm/priv-navigator-item.entry.js +1 -1
  52. package/dist/esm/ripple.js +2 -2
  53. package/dist/esm/wm-modal-pss_3.entry.js +210 -0
  54. package/dist/esm/{wm-modal.entry.js → wm-modal_3.entry.js} +75 -2
  55. package/dist/esm/wm-navigation_3.entry.js +4 -4
  56. package/dist/esm/wm-nested-select.entry.js +37 -13
  57. package/dist/esm/wm-option_2.entry.js +1 -1
  58. package/dist/esm/wm-pagination.entry.js +1 -1
  59. package/dist/esm/wm-search.entry.js +2 -2
  60. package/dist/esm/wm-snackbar.entry.js +2 -2
  61. package/dist/esm/wm-tab-item_3.entry.js +3 -3
  62. package/dist/esm/wm-tag-input.entry.js +3 -3
  63. package/dist/esm/wm-textarea.entry.js +1 -1
  64. package/dist/esm/wm-timepicker.entry.js +2 -2
  65. package/dist/esm/wm-toggletip.entry.js +2 -2
  66. package/dist/esm/wm-uploader.entry.js +2 -2
  67. package/dist/esm-es5/{app-globals-079cb2f3.js → app-globals-0f27630e.js} +1 -1
  68. package/dist/esm-es5/index-130e07bb.js +1 -1
  69. package/dist/esm-es5/loader.js +1 -1
  70. package/dist/esm-es5/priv-navigator-button.entry.js +1 -1
  71. package/dist/esm-es5/priv-navigator-item.entry.js +1 -1
  72. package/dist/esm-es5/ripple.js +1 -1
  73. package/dist/esm-es5/wm-modal-pss_3.entry.js +1 -0
  74. package/dist/esm-es5/wm-modal_3.entry.js +1 -0
  75. package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
  76. package/dist/esm-es5/wm-nested-select.entry.js +1 -1
  77. package/dist/esm-es5/wm-option_2.entry.js +1 -1
  78. package/dist/esm-es5/wm-pagination.entry.js +1 -1
  79. package/dist/esm-es5/wm-search.entry.js +1 -1
  80. package/dist/esm-es5/wm-snackbar.entry.js +1 -1
  81. package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
  82. package/dist/esm-es5/wm-tag-input.entry.js +1 -1
  83. package/dist/esm-es5/wm-textarea.entry.js +1 -1
  84. package/dist/esm-es5/wm-timepicker.entry.js +1 -1
  85. package/dist/esm-es5/wm-toggletip.entry.js +1 -1
  86. package/dist/esm-es5/wm-uploader.entry.js +1 -1
  87. package/dist/ripple/{p-68434694.system.entry.js → p-0ba0c194.system.entry.js} +1 -1
  88. package/dist/ripple/{p-76df7747.system.entry.js → p-1073ab75.system.entry.js} +1 -1
  89. package/dist/ripple/{p-bf033357.entry.js → p-1344f4d2.entry.js} +1 -1
  90. package/dist/ripple/{p-4d0daa27.system.js → p-202cc2fe.system.js} +1 -1
  91. package/dist/ripple/{p-17825edb.entry.js → p-2300c07b.entry.js} +1 -1
  92. package/dist/ripple/{p-e1a3db79.system.entry.js → p-236ee735.system.entry.js} +1 -1
  93. package/dist/ripple/{p-506a85c0.system.entry.js → p-26e42263.system.entry.js} +1 -1
  94. package/dist/ripple/{p-45393c61.system.entry.js → p-2716532e.system.entry.js} +1 -1
  95. package/dist/ripple/{p-16eb5075.entry.js → p-30f148a7.entry.js} +1 -1
  96. package/dist/ripple/{p-772db278.entry.js → p-4b29da45.entry.js} +1 -1
  97. package/dist/ripple/{p-6b84c512.entry.js → p-4fae07d6.entry.js} +1 -1
  98. package/dist/ripple/{p-fc04e749.entry.js → p-524f0531.entry.js} +1 -1
  99. package/dist/ripple/{p-4f2be0ea.entry.js → p-563f37e8.entry.js} +1 -1
  100. package/dist/ripple/{p-f6752b25.system.entry.js → p-5a2431e1.system.entry.js} +1 -1
  101. package/dist/ripple/{p-b5276c34.entry.js → p-60cb3adc.entry.js} +1 -1
  102. package/dist/ripple/p-618b27e6.entry.js +1 -0
  103. package/dist/ripple/{p-2a3d94a9.system.entry.js → p-62bb8827.system.entry.js} +1 -1
  104. package/dist/ripple/{p-580a6225.system.entry.js → p-695391a9.system.entry.js} +1 -1
  105. package/dist/ripple/{p-6028695a.system.entry.js → p-6bb9402a.system.entry.js} +1 -1
  106. package/dist/ripple/{p-ba2fe2c3.system.entry.js → p-6d9acebc.system.entry.js} +1 -1
  107. package/dist/ripple/p-7136efd0.entry.js +1 -0
  108. package/dist/ripple/{p-c83bc1e9.entry.js → p-79979fb1.entry.js} +1 -1
  109. package/dist/ripple/{p-19c85f03.system.entry.js → p-89a862ae.system.entry.js} +1 -1
  110. package/dist/ripple/p-8ef8c943.system.entry.js +1 -0
  111. package/dist/ripple/{p-f3aa0c90.entry.js → p-9062cb9a.entry.js} +1 -1
  112. package/dist/ripple/p-9511f0c3.entry.js +1 -0
  113. package/dist/ripple/p-b8e97d05.system.js +1 -0
  114. package/dist/ripple/p-b9a8d85b.entry.js +1 -0
  115. package/dist/ripple/{p-b8dbae16.entry.js → p-bbcc61cf.entry.js} +1 -1
  116. package/dist/ripple/p-c94976c8.system.entry.js +1 -0
  117. package/dist/ripple/{p-43598413.js → p-e4c40125.js} +1 -1
  118. package/dist/ripple/{p-fde96980.system.entry.js → p-eaf16578.system.entry.js} +1 -1
  119. package/dist/ripple/p-f9df9765.system.entry.js +1 -0
  120. package/dist/ripple/p-fada6923.entry.js +1 -0
  121. package/dist/ripple/p-ff74ec46.system.entry.js +1 -0
  122. package/dist/ripple/ripple.esm.js +1 -1
  123. package/dist/ripple/ripple.js +1 -1
  124. package/dist/types/components/selects/wm-nested-select/wm-nested-select.d.ts +2 -2
  125. package/dist/types/components/wm-modal-pss/wm-modal-pss-footer.d.ts +14 -0
  126. package/dist/types/components/wm-modal-pss/wm-modal-pss-header.d.ts +10 -0
  127. package/dist/types/components/wm-modal-pss/wm-modal-pss.d.ts +33 -0
  128. package/dist/types/components.d.ts +88 -0
  129. package/package.json +1 -1
  130. package/dist/cjs/wm-modal-footer.cjs.entry.js +0 -48
  131. package/dist/cjs/wm-modal-header.cjs.entry.js +0 -40
  132. package/dist/esm/wm-modal-footer.entry.js +0 -44
  133. package/dist/esm/wm-modal-header.entry.js +0 -36
  134. package/dist/esm-es5/wm-modal-footer.entry.js +0 -1
  135. package/dist/esm-es5/wm-modal-header.entry.js +0 -1
  136. package/dist/esm-es5/wm-modal.entry.js +0 -1
  137. package/dist/ripple/p-3eae2cff.system.entry.js +0 -1
  138. package/dist/ripple/p-43c7c26e.entry.js +0 -1
  139. package/dist/ripple/p-54ee24ab.system.entry.js +0 -1
  140. package/dist/ripple/p-6e50bb9a.entry.js +0 -1
  141. package/dist/ripple/p-81ce5578.entry.js +0 -1
  142. package/dist/ripple/p-8933fa3d.system.entry.js +0 -1
  143. package/dist/ripple/p-aa52069c.entry.js +0 -1
  144. package/dist/ripple/p-baca1589.entry.js +0 -1
  145. package/dist/ripple/p-bae209b8.system.entry.js +0 -1
  146. package/dist/ripple/p-db706578.system.js +0 -1
  147. package/dist/ripple/p-e27dcd81.system.entry.js +0 -1
  148. package/dist/ripple/p-e6e1cd8b.entry.js +0 -1
@@ -123,6 +123,28 @@ export class NestedSelect {
123
123
  closePopupOnEscape() {
124
124
  this.close();
125
125
  }
126
+ handleKeyDown(ev) {
127
+ // when shift tabbing but component is still in focus, close dropdown
128
+ switch (ev.key) {
129
+ case "Tab":
130
+ if (ev.shiftKey) {
131
+ this.close();
132
+ }
133
+ break;
134
+ case "ArrowDown":
135
+ if (this.isExpanded === false) {
136
+ ev.preventDefault();
137
+ this.open();
138
+ }
139
+ break;
140
+ case "ArrowUp":
141
+ if (this.isExpanded === false) {
142
+ ev.preventDefault();
143
+ this.open(true);
144
+ }
145
+ break;
146
+ }
147
+ }
126
148
  close(returnFocus = true) {
127
149
  if (this.isExpanded) {
128
150
  this.isExpanded = false;
@@ -135,7 +157,7 @@ export class NestedSelect {
135
157
  }, 150);
136
158
  }
137
159
  }
138
- open() {
160
+ open(focusLast = false) {
139
161
  if (!this.isDisabled) {
140
162
  this.showClearSelectionButton = this.childOptions.some((o) => o.selected);
141
163
  this.isExpanded = true;
@@ -155,14 +177,16 @@ export class NestedSelect {
155
177
  ? spaceAbove
156
178
  : null;
157
179
  });
158
- window.requestAnimationFrame(() => {
159
- this.focusFirstMenuitem();
160
- });
161
- }
162
- }
163
- focusFirstMenuitem() {
164
- if (this.menuitemEls.length > 0) {
165
- this.menuitemEls[0].focus();
180
+ // scrollIntoView does not work when the container of the element it's called on is not rendered to the page (in our case the dropdown is still closed and has transform: scaleY(0))
181
+ // when opening the dropdown, scrollIntoView must be delayed to a point where the browser recognizes content within it as able to be scrolled to
182
+ // in Safari in particular, the soonest this seems to happen is 20ms. The longest we can wait before any jumping in the open dropdown is noticeable is 60ms
183
+ window.setTimeout(() => {
184
+ if (this.menuitemEls.length > 0) {
185
+ const menuitemToFocus = this.menuitemEls[focusLast ? this.menuitemEls.length - 1 : 0];
186
+ menuitemToFocus.scrollIntoView({ block: "nearest" });
187
+ menuitemToFocus.focus();
188
+ }
189
+ }, 60);
166
190
  }
167
191
  }
168
192
  moveDown(menuitemEl) {
@@ -292,16 +316,16 @@ export class NestedSelect {
292
316
  this.isExpanded ? this.close() : this.open();
293
317
  },
294
318
  };
295
- return (h(Host, { key: 'ed7b96e7d65c756fbbade7dfb2a8ae03da9d3277', onBlur: (ev) => this.handleComponentBlur(ev) }, h("div", { key: 'a2783684ed70b347fd5081b9679cad00c4c73af9', class: `wrapper ${getTextDir()} label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { key: 'dc6f0249ebbcd84df9108fdd2af2e3a7778c2a5a', class: "label-wrapper" }, h("label", { key: '6139f82a9c0a4c9ea569b0d6c74e694ca4924932', class: "label", id: "label", htmlFor: "selectbtn" }, this.label,
319
+ return (h(Host, { key: '854bfbccf53069ca95a2c7e3beb60ec7cef4fe52', onBlur: (ev) => this.handleComponentBlur(ev) }, h("div", { key: 'db844c36c341b311a1178899c3dd6f75b3cde901', class: `wrapper ${getTextDir()} label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { key: '57b77d879d3065c2fd6e51c86a4cf9589d2b69dd', class: "label-wrapper" }, h("label", { key: 'd175fa9541a93c22be70143a10b77a087913087e', class: "label", id: "label", htmlFor: "selectbtn" }, this.label,
296
320
  // we can't use aria-required or required attributes because it's invalid on the elements we're using (button controlling a listbox)
297
- this.requiredField ? (h("span", { class: "required" }, h("span", { class: "sr-only" }, globalMessages.requiredField), h("span", { "aria-hidden": "true" }, "*"))) : (""))), h("div", { key: '3198a4409abb6d880330ffadd64022835ee94ba6', class: "button-wrapper" }, h("button", Object.assign({ key: '112c79d84e039c8a9044fc86c2d360a3c88acfec' }, buttonProps, { class: `displayedoption ${this.isExpanded ? "expanded" : ""}`, ref: (el) => (this.buttonEl = el), onBlur: (ev) => this.handleButtonBlur(ev), onFocus: () => this.close() }), h("span", { key: 'ab91af492aac319d84cb48dccdb127e5649b658b', class: "overflowcontrol" }, h("span", { key: 'fb0370d92612ee4ae365634e8e7f845ef0d6194a', class: "button-text" }, this.renderButtonText())), this.renderOverflowCount(), h("div", { key: 'e61b2f40ed449bbb679bd4792197eeb34f23d5f9', ref: (el) => (this.measurementAreaEl = el), class: "measurement-area", "aria-hidden": "true" })), h("div", { key: '1490530463cfcdb5d010f722b7f3078e0e036ce0', class: `dropdown ${this.openUp ? "upwards" : ""}`, ref: (el) => (this.dropdownEl = el) }, h("div", { key: '072c737865ad17a47ff9b70f9ee681542b766674', ref: (el) => (this.menuEl = el), class: "menu", style: { "--max-height": this.constrainedMaxHeight } }, this.renderClearSelectionButton(), this.optgroupEls.map((optgroupEl) => {
321
+ this.requiredField ? (h("span", { class: "required" }, h("span", { class: "sr-only" }, globalMessages.requiredField), h("span", { "aria-hidden": "true" }, "*"))) : (""))), h("div", { key: '1e100f81edc7d1dd9c6e1224cd1d5cfeb68e37a7', class: "button-wrapper" }, h("button", Object.assign({ key: 'e8e68bc84666875a5a478aae79d04cc57d231f4b' }, buttonProps, { class: `displayedoption ${this.isExpanded ? "expanded" : ""}`, ref: (el) => (this.buttonEl = el), onBlur: (ev) => this.handleButtonBlur(ev) }), h("span", { key: 'e0dc1adac5cdcb76da590a065b8fc80cead8df69', class: "overflowcontrol" }, h("span", { key: '36427c454c08d30402f50424772c4c3fe6d764e3', class: "button-text" }, this.renderButtonText())), this.renderOverflowCount(), h("div", { key: '2725d1b3b564a3d6a879e598ef5b0bf192dcd1d6', ref: (el) => (this.measurementAreaEl = el), class: "measurement-area", "aria-hidden": "true" })), h("div", { key: '54b75659619de70978e10ab8e3739938686084f8', class: `dropdown ${this.openUp ? "upwards" : ""}`, ref: (el) => (this.dropdownEl = el) }, h("div", { key: 'a6894d7f78c6eb4a155c2b55f88f43a47377ce7d', ref: (el) => (this.menuEl = el), class: "menu", style: { "--max-height": this.constrainedMaxHeight } }, this.renderClearSelectionButton(), this.optgroupEls.map((optgroupEl) => {
298
322
  return (h("button", { class: `menuitem group-btn ${optgroupEl.disabled ? "disabled" : ""}`, role: "menuitem", "data-label": optgroupEl.label, tabindex: -1, "aria-disabled": optgroupEl.disabled, onClick: () => {
299
323
  if (!optgroupEl.disabled) {
300
324
  optgroupEl.isExpanded = !optgroupEl.isExpanded;
301
325
  forceUpdate(this.el);
302
326
  }
303
327
  }, onKeyDown: (ev) => this.handleMenuitemKeydown(ev) }, h("span", null, optgroupEl.label), this.renderSelectionCount(optgroupEl), optgroupEl.disabled && h("div", { class: "disabled-indication" }, "Disabled")));
304
- })), h("div", { key: '8e57555b287fb08eb92eac959ddd7259d560e33a', ref: (el) => (this.optListWrapperEl = el), class: "option-list-wrapper hidden" }, h("slot", { key: 'c22278aca4bd47298fdffeeb148896180e12da1e' }))), h("div", { key: '3180921d3e8e6a9dc7c7c34b5077e17f3da9ef88', id: "error", class: this.errorMessage ? "error-message" : "" }, this.errorMessage)))));
328
+ })), h("div", { key: '52fd5904572fe4691cbae1422ccaf285f4a408dd', ref: (el) => (this.optListWrapperEl = el), class: "option-list-wrapper hidden" }, h("slot", { key: '7e3cf958381b7035914cc7f40bd386b923b1ef31' }))), h("div", { key: '0b4dfb9684d0f61cef7781d3b20d87d0ce7771ee', id: "error", class: this.errorMessage ? "error-message" : "" }, this.errorMessage)))));
305
329
  }
306
330
  static get is() { return "wm-nested-select"; }
307
331
  static get encapsulation() { return "shadow"; }
@@ -534,7 +558,7 @@ export class NestedSelect {
534
558
  },
535
559
  "constrainedMaxHeight": {
536
560
  "type": "string",
537
- "mutable": false,
561
+ "mutable": true,
538
562
  "complexType": {
539
563
  "original": "string",
540
564
  "resolved": "string",
@@ -596,6 +620,12 @@ export class NestedSelect {
596
620
  "target": undefined,
597
621
  "capture": false,
598
622
  "passive": false
623
+ }, {
624
+ "name": "keydown",
625
+ "method": "handleKeyDown",
626
+ "target": undefined,
627
+ "capture": false,
628
+ "passive": false
599
629
  }, {
600
630
  "name": "click",
601
631
  "method": "handleClick",
@@ -151,7 +151,7 @@
151
151
  pointer-events: none;
152
152
  }
153
153
 
154
- :host(:focus) {
154
+ :host(:focus-visible) {
155
155
  outline: none;
156
156
  background: var(--wmcolor-select-option-background-focus);
157
157
  }
@@ -0,0 +1,61 @@
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
+ 7. Screen Reader Only
18
+ -------------------------------------- */
19
+ /* --------------------------------------
20
+ 8. Label styles
21
+ this mixin includes all the styles for the label
22
+ + flex rules on the parent container to switch between top and left position
23
+ + srOnly when label is hidden
24
+ Assumes the following markup:
25
+ div.wrapper[.label-left.invalid] > div.label-wrapper > label.label > span.required
26
+ .wrapper is for the flex rules
27
+ .label-wrapper is to set the height of the label when positioned left so it's the same height as
28
+ the input. It can't be done directly on .label because of possible line wrapping.
29
+ When the label is on top there's no line wrapping at all to ensure proper alignment of inlined elements
30
+ (they can't be aligned on the baseline because of possible description text and error message)
31
+ -------------------------------------- */
32
+ wm-modal-pss-footer {
33
+ border-radius: 0px 0px 5px 5px;
34
+ margin-top: -1px;
35
+ }
36
+ wm-modal-pss-footer .wm-wrapper {
37
+ display: flex;
38
+ justify-content: space-between;
39
+ align-items: center;
40
+ }
41
+ @media only screen and (max-width: 650px) {
42
+ wm-modal-pss-footer .wm-wrapper.footer-text {
43
+ flex-direction: column;
44
+ align-items: flex-start;
45
+ }
46
+ }
47
+ wm-modal-pss-footer .wm-wrapper wm-button + wm-button {
48
+ margin-left: 1rem;
49
+ }
50
+ wm-modal-pss-footer .wm-wrapper .wm-info {
51
+ font-size: 0.875rem;
52
+ font-style: italic;
53
+ }
54
+ @media only screen and (max-width: 650px) {
55
+ wm-modal-pss-footer .wm-wrapper .wm-info {
56
+ padding-bottom: 0.625rem;
57
+ }
58
+ }
59
+ wm-modal-pss-footer .wm-wrapper .wm-info:focus {
60
+ outline: none;
61
+ }
@@ -0,0 +1,138 @@
1
+ import { h } from "@stencil/core";
2
+ export class ModalFooter {
3
+ constructor() {
4
+ this.secondaryText = "";
5
+ this.primaryText = "";
6
+ this.infoText = "";
7
+ this.primaryActionDisabled = false;
8
+ this.deleteStyle = false;
9
+ }
10
+ componentWillLoad() {
11
+ this.uid = this.el.parentElement.uid;
12
+ // Trap focus when user shift+tabs past first element in modal
13
+ // NB @Listen doesn't allow to listen on a specific element (the parent modal)
14
+ // if we listen to the whole doc each modal on the page reacts to every event
15
+ this.el.parentElement.addEventListener("focusLastElement", () => {
16
+ this.lastElement.focus();
17
+ });
18
+ }
19
+ emitParentPrimaryEvent() {
20
+ const parentModal = this.el.parentElement;
21
+ //@ts-ignore
22
+ parentModal.emitPrimaryEvent();
23
+ }
24
+ emitParentSecondaryEvent() {
25
+ const parentModal = this.el.parentElement;
26
+ //@ts-ignore
27
+ parentModal.emitSecondaryEvent();
28
+ }
29
+ render() {
30
+ return (h("div", { key: '51a2d057d08fee9eb7cb20610b44b5bd9d3300a1', class: `wm-wrapper ${this.infoText ? " footer-text" : ""}` }, h("div", { key: '18b9805744abd577708add4f5c1d6bc0149927fb', class: "wm-info", "aria-live": "polite" }, this.infoText), h("div", { key: 'a449547065cb247a50f859ca5a4a82f070c06399', class: "wm-button-collection" }, this.secondaryText && (h("wm-button", { key: 'd1733ed5fe143f2e65433a667a40694fd5dbad43', onClick: () => this.emitParentSecondaryEvent(), id: `wm-secondary-${this.uid}`, ref: (el) => (this.primaryActionDisabled ? (this.lastElement = el) : null) }, this.secondaryText)), h("wm-button", { key: '2177e7af952bd16fa6cb4cf23dbf2acf18445ebc', "button-type": this.deleteStyle ? "secondary" : "primary", "permanently-delete": this.deleteStyle, onClick: () => this.emitParentPrimaryEvent(), disabled: this.primaryActionDisabled, id: `wm-primary-${this.uid}`, ref: (el) => (!this.primaryActionDisabled ? (this.lastElement = el) : null) }, this.primaryText))));
31
+ }
32
+ static get is() { return "wm-modal-pss-footer"; }
33
+ static get originalStyleUrls() {
34
+ return {
35
+ "$": ["wm-modal-pss-footer.scss"]
36
+ };
37
+ }
38
+ static get styleUrls() {
39
+ return {
40
+ "$": ["wm-modal-pss-footer.css"]
41
+ };
42
+ }
43
+ static get properties() {
44
+ return {
45
+ "secondaryText": {
46
+ "type": "string",
47
+ "mutable": false,
48
+ "complexType": {
49
+ "original": "string",
50
+ "resolved": "string | undefined",
51
+ "references": {}
52
+ },
53
+ "required": false,
54
+ "optional": true,
55
+ "docs": {
56
+ "tags": [],
57
+ "text": ""
58
+ },
59
+ "attribute": "secondary-text",
60
+ "reflect": false,
61
+ "defaultValue": "\"\""
62
+ },
63
+ "primaryText": {
64
+ "type": "string",
65
+ "mutable": false,
66
+ "complexType": {
67
+ "original": "string",
68
+ "resolved": "string | undefined",
69
+ "references": {}
70
+ },
71
+ "required": false,
72
+ "optional": true,
73
+ "docs": {
74
+ "tags": [],
75
+ "text": ""
76
+ },
77
+ "attribute": "primary-text",
78
+ "reflect": false,
79
+ "defaultValue": "\"\""
80
+ },
81
+ "infoText": {
82
+ "type": "string",
83
+ "mutable": false,
84
+ "complexType": {
85
+ "original": "string",
86
+ "resolved": "string | undefined",
87
+ "references": {}
88
+ },
89
+ "required": false,
90
+ "optional": true,
91
+ "docs": {
92
+ "tags": [],
93
+ "text": ""
94
+ },
95
+ "attribute": "info-text",
96
+ "reflect": false,
97
+ "defaultValue": "\"\""
98
+ },
99
+ "primaryActionDisabled": {
100
+ "type": "boolean",
101
+ "mutable": false,
102
+ "complexType": {
103
+ "original": "boolean",
104
+ "resolved": "boolean",
105
+ "references": {}
106
+ },
107
+ "required": false,
108
+ "optional": false,
109
+ "docs": {
110
+ "tags": [],
111
+ "text": ""
112
+ },
113
+ "attribute": "primary-action-disabled",
114
+ "reflect": false,
115
+ "defaultValue": "false"
116
+ },
117
+ "deleteStyle": {
118
+ "type": "boolean",
119
+ "mutable": false,
120
+ "complexType": {
121
+ "original": "boolean",
122
+ "resolved": "boolean",
123
+ "references": {}
124
+ },
125
+ "required": false,
126
+ "optional": false,
127
+ "docs": {
128
+ "tags": [],
129
+ "text": ""
130
+ },
131
+ "attribute": "delete-style",
132
+ "reflect": false,
133
+ "defaultValue": "false"
134
+ }
135
+ };
136
+ }
137
+ static get elementRef() { return "el"; }
138
+ }
@@ -0,0 +1,55 @@
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
+ 7. Screen Reader Only
18
+ -------------------------------------- */
19
+ /* --------------------------------------
20
+ 8. Label styles
21
+ this mixin includes all the styles for the label
22
+ + flex rules on the parent container to switch between top and left position
23
+ + srOnly when label is hidden
24
+ Assumes the following markup:
25
+ div.wrapper[.label-left.invalid] > div.label-wrapper > label.label > span.required
26
+ .wrapper is for the flex rules
27
+ .label-wrapper is to set the height of the label when positioned left so it's the same height as
28
+ the input. It can't be done directly on .label because of possible line wrapping.
29
+ When the label is on top there's no line wrapping at all to ensure proper alignment of inlined elements
30
+ (they can't be aligned on the baseline because of possible description text and error message)
31
+ -------------------------------------- */
32
+ wm-modal-pss-header {
33
+ border-radius: 5px 5px 0 0px;
34
+ margin-bottom: -1px;
35
+ }
36
+ wm-modal-pss-header .wm-wrapper {
37
+ display: flex;
38
+ justify-content: space-between;
39
+ align-items: center;
40
+ }
41
+ wm-modal-pss-header .wm-wrapper .title {
42
+ margin: 0;
43
+ font-weight: 600;
44
+ font-size: 1.125rem;
45
+ color: var(--wmcolor-modal-heading);
46
+ line-height: normal;
47
+ }
48
+ wm-modal-pss-header .wm-wrapper .title .subtitle {
49
+ display: block;
50
+ font-size: 0.875rem;
51
+ font-weight: normal;
52
+ }
53
+ wm-modal-pss-header .wm-wrapper .title:focus {
54
+ outline: none;
55
+ }
@@ -0,0 +1,81 @@
1
+ import { h, Host } from "@stencil/core";
2
+ export class ModalHeader {
3
+ constructor() {
4
+ this.heading = "";
5
+ this.subheading = "";
6
+ }
7
+ componentWillLoad() {
8
+ this.uid = this.el.parentElement.uid;
9
+ // Trap focus when user tabs past last element in modal
10
+ // NB @Listen doesn't allow to listen on a specific element (the parent modal)
11
+ // if we listen to the whole doc each modal on the page reacts to every event
12
+ this.el.parentElement.addEventListener("focusFirstElement", () => {
13
+ this.closeButtonEl.focus();
14
+ });
15
+ }
16
+ emitParentCloseEvent() {
17
+ const parentModal = this.el.parentElement;
18
+ //@ts-ignore
19
+ parentModal.emitCloseEvent();
20
+ }
21
+ // @Listen("click")
22
+ // directFocusOnClick() {
23
+ // this.headingElement.tabIndex = 0;
24
+ // this.headingElement.focus();
25
+ // }
26
+ render() {
27
+ return (h(Host, { key: '2b2dda4dcd73e99ead055334998d5ef97ea60df4' }, h("div", { key: '8a1f05da81b4663558e962f7b540fac35e2bbfa3', class: "wm-wrapper" }, h("div", { key: '2948adf911680be5ba5a4beb317ddd57303a9a15' }, h("h2", { key: 'f1068bac6d9692a6368f5662bbcde1aad83c3317', class: "title", id: `wm-modal-heading-text-${this.uid}` }, this.heading, h("span", { key: '9452c69404d41425a2bce3fbe15e457fc773a640', class: "subtitle" }, this.subheading))), h("wm-button", { key: '1961750a256f7ad40f8d06345994479b0e3ed541', "button-type": "navigational", icon: "f156", tooltip: "Close", "tooltip-position": "left", id: `wm-modal-close-${this.uid}`, ref: (el) => (this.closeButtonEl = el), onClick: () => this.emitParentCloseEvent() }))));
28
+ }
29
+ static get is() { return "wm-modal-pss-header"; }
30
+ static get originalStyleUrls() {
31
+ return {
32
+ "$": ["wm-modal-pss-header.scss"]
33
+ };
34
+ }
35
+ static get styleUrls() {
36
+ return {
37
+ "$": ["wm-modal-pss-header.css"]
38
+ };
39
+ }
40
+ static get properties() {
41
+ return {
42
+ "heading": {
43
+ "type": "string",
44
+ "mutable": false,
45
+ "complexType": {
46
+ "original": "string",
47
+ "resolved": "string | undefined",
48
+ "references": {}
49
+ },
50
+ "required": false,
51
+ "optional": true,
52
+ "docs": {
53
+ "tags": [],
54
+ "text": ""
55
+ },
56
+ "attribute": "heading",
57
+ "reflect": false,
58
+ "defaultValue": "\"\""
59
+ },
60
+ "subheading": {
61
+ "type": "string",
62
+ "mutable": false,
63
+ "complexType": {
64
+ "original": "string",
65
+ "resolved": "string | undefined",
66
+ "references": {}
67
+ },
68
+ "required": false,
69
+ "optional": true,
70
+ "docs": {
71
+ "tags": [],
72
+ "text": ""
73
+ },
74
+ "attribute": "subheading",
75
+ "reflect": false,
76
+ "defaultValue": "\"\""
77
+ }
78
+ };
79
+ }
80
+ static get elementRef() { return "el"; }
81
+ }
@@ -0,0 +1,134 @@
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
+ 7. Screen Reader Only
18
+ -------------------------------------- */
19
+ /* --------------------------------------
20
+ 8. Label styles
21
+ this mixin includes all the styles for the label
22
+ + flex rules on the parent container to switch between top and left position
23
+ + srOnly when label is hidden
24
+ Assumes the following markup:
25
+ div.wrapper[.label-left.invalid] > div.label-wrapper > label.label > span.required
26
+ .wrapper is for the flex rules
27
+ .label-wrapper is to set the height of the label when positioned left so it's the same height as
28
+ the input. It can't be done directly on .label because of possible line wrapping.
29
+ When the label is on top there's no line wrapping at all to ensure proper alignment of inlined elements
30
+ (they can't be aligned on the baseline because of possible description text and error message)
31
+ -------------------------------------- */
32
+ wm-modal-pss {
33
+ --wmcolor-modal-background: var(--wmcolor-background);
34
+ --wmcolor-modal-border: var(--wmcolor-border);
35
+ --wmcolor-modal-heading: var(--wmcolor-text);
36
+ --wmcolor-modal-overlay: var(--wmcolor-overlay);
37
+ display: flex;
38
+ justify-content: center;
39
+ align-items: center;
40
+ flex-direction: column;
41
+ position: fixed;
42
+ top: 50%;
43
+ left: 50%;
44
+ transform: translate(-50%, -50%);
45
+ z-index: 2001;
46
+ width: 80vw;
47
+ max-width: 750px;
48
+ max-height: 80vh;
49
+ box-shadow: 0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14);
50
+ }
51
+ wm-modal-pss * {
52
+ box-sizing: border-box;
53
+ }
54
+ wm-modal-pss > * {
55
+ width: 80vw;
56
+ max-width: 750px;
57
+ background: var(--wmcolor-modal-background);
58
+ }
59
+ wm-modal-pss > *:focus {
60
+ outline: none;
61
+ }
62
+ wm-modal-pss wm-modal-pss-header,
63
+ wm-modal-pss wm-modal-pss-footer {
64
+ padding: 20px 30px;
65
+ }
66
+ wm-modal-pss wm-modal-pss-header {
67
+ z-index: 2003;
68
+ }
69
+ wm-modal-pss wm-modal-pss-footer {
70
+ z-index: 2003;
71
+ }
72
+ wm-modal-pss > :not(wm-modal-pss-header):not(wm-modal-pss-footer) {
73
+ max-height: calc(80vh - 166px);
74
+ z-index: 2002;
75
+ }
76
+ wm-modal-pss.wm-modal wm-modal-pss-header {
77
+ border-bottom: 1px solid var(--wmcolor-modal-border);
78
+ }
79
+ wm-modal-pss.wm-modal wm-modal-pss-footer {
80
+ border-top: 1px solid var(--wmcolor-modal-border);
81
+ }
82
+ @media only screen and (max-width: 768px) {
83
+ wm-modal-pss.wm-modal {
84
+ height: 100%;
85
+ max-height: none;
86
+ max-width: none;
87
+ width: 100vw;
88
+ }
89
+ wm-modal-pss.wm-modal > * {
90
+ max-width: none;
91
+ width: 100vw;
92
+ }
93
+ wm-modal-pss.wm-modal > *:not(wm-modal-pss-header):not(wm-modal-pss-footer) {
94
+ max-height: none;
95
+ height: calc(100vh - 166px);
96
+ }
97
+ }
98
+ wm-modal-pss.wm-dialog > :not(wm-modal-pss-header):not(wm-modal-pss-footer) {
99
+ padding: 0 30px 20px 30px;
100
+ font-size: 0.875rem;
101
+ border: none;
102
+ }
103
+ wm-modal-pss .overlay {
104
+ width: 100vw;
105
+ height: 100vh;
106
+ max-width: none;
107
+ max-height: none;
108
+ position: fixed !important;
109
+ top: -1;
110
+ bottom: 1;
111
+ left: -1;
112
+ right: 1;
113
+ transform: translate(0%, 0%);
114
+ background-color: var(--wmcolor-modal-overlay);
115
+ transition: opacity 0.5s ease-out;
116
+ z-index: 2000;
117
+ }
118
+ wm-modal-pss.hide {
119
+ visibility: hidden;
120
+ }
121
+ wm-modal-pss .sr-only {
122
+ position: absolute !important;
123
+ width: 1px !important;
124
+ height: 1px !important;
125
+ padding: 0 !important;
126
+ border: 0 !important;
127
+ overflow: hidden !important;
128
+ clip: rect(0, 0, 0, 0) !important;
129
+ clip-path: inset(50%) !important;
130
+ white-space: nowrap !important;
131
+ margin: -1px !important;
132
+ top: 0;
133
+ left: 0;
134
+ }