@watermarkinsights/ripple 5.19.0-alpha.1 → 5.19.0-alpha.11

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 (98) hide show
  1. package/dist/cjs/{app-globals-c7500647.js → app-globals-d86fc316.js} +1 -1
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/priv-navigator-item.cjs.entry.js +1 -1
  4. package/dist/cjs/priv-option-list.cjs.entry.js +1 -1
  5. package/dist/cjs/ripple.cjs.js +2 -2
  6. package/dist/cjs/wm-action-menu_2.cjs.entry.js +1 -1
  7. package/dist/cjs/wm-file.cjs.entry.js +35 -19
  8. package/dist/cjs/wm-navigator.cjs.entry.js +12 -5
  9. package/dist/cjs/wm-nested-select.cjs.entry.js +1 -1
  10. package/dist/cjs/wm-option_2.cjs.entry.js +54 -13
  11. package/dist/cjs/wm-snackbar.cjs.entry.js +12 -16
  12. package/dist/cjs/wm-uploader.cjs.entry.js +4 -4
  13. package/dist/collection/components/datepickers/datepicker.css +0 -31
  14. package/dist/collection/components/selects/priv-option-list/priv-option-list.css +1 -1
  15. package/dist/collection/components/selects/wm-nested-select/wm-nested-select.css +1 -1
  16. package/dist/collection/components/selects/wm-option/wm-option.css +8 -3
  17. package/dist/collection/components/selects/wm-select/wm-select.css +31 -14
  18. package/dist/collection/components/selects/wm-select/wm-select.js +60 -13
  19. package/dist/collection/components/wm-file/wm-file.css +89 -13
  20. package/dist/collection/components/wm-file/wm-file.js +34 -18
  21. package/dist/collection/components/wm-menuitem/wm-menuitem.css +16 -43
  22. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.css +0 -31
  23. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.css +11 -2
  24. package/dist/collection/components/wm-navigator/wm-navigator.css +8 -2
  25. package/dist/collection/components/wm-navigator/wm-navigator.js +11 -4
  26. package/dist/collection/components/wm-pagination/wm-pagination.css +0 -31
  27. package/dist/collection/components/wm-search/wm-search.css +0 -31
  28. package/dist/collection/components/wm-snackbar/wm-snackbar.css +0 -31
  29. package/dist/collection/components/wm-snackbar/wm-snackbar.js +12 -16
  30. package/dist/collection/components/wm-timepicker/wm-timepicker.css +0 -31
  31. package/dist/collection/components/wm-uploader/wm-uploader.css +41 -37
  32. package/dist/collection/components/wm-uploader/wm-uploader.js +3 -3
  33. package/dist/esm/{app-globals-f089afb3.js → app-globals-c069a17b.js} +1 -1
  34. package/dist/esm/loader.js +2 -2
  35. package/dist/esm/polyfills/core-js.js +0 -0
  36. package/dist/esm/polyfills/dom.js +0 -0
  37. package/dist/esm/polyfills/es5-html-element.js +0 -0
  38. package/dist/esm/polyfills/index.js +0 -0
  39. package/dist/esm/polyfills/system.js +0 -0
  40. package/dist/esm/priv-navigator-item.entry.js +1 -1
  41. package/dist/esm/priv-option-list.entry.js +1 -1
  42. package/dist/esm/ripple.js +2 -2
  43. package/dist/esm/wm-action-menu_2.entry.js +1 -1
  44. package/dist/esm/wm-file.entry.js +35 -19
  45. package/dist/esm/wm-navigator.entry.js +12 -5
  46. package/dist/esm/wm-nested-select.entry.js +1 -1
  47. package/dist/esm/wm-option_2.entry.js +55 -14
  48. package/dist/esm/wm-snackbar.entry.js +12 -16
  49. package/dist/esm/wm-uploader.entry.js +4 -4
  50. package/dist/esm-es5/app-globals-c069a17b.js +1 -0
  51. package/dist/esm-es5/loader.js +1 -1
  52. package/dist/esm-es5/priv-navigator-item.entry.js +1 -1
  53. package/dist/esm-es5/priv-option-list.entry.js +1 -1
  54. package/dist/esm-es5/ripple.js +1 -1
  55. package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
  56. package/dist/esm-es5/wm-file.entry.js +1 -1
  57. package/dist/esm-es5/wm-navigator.entry.js +1 -1
  58. package/dist/esm-es5/wm-nested-select.entry.js +1 -1
  59. package/dist/esm-es5/wm-option_2.entry.js +1 -1
  60. package/dist/esm-es5/wm-snackbar.entry.js +1 -1
  61. package/dist/esm-es5/wm-uploader.entry.js +1 -1
  62. package/dist/ripple/p-02a15884.entry.js +1 -0
  63. package/dist/ripple/{p-7ca13016.system.entry.js → p-138491c8.system.entry.js} +1 -1
  64. package/dist/ripple/{p-85ac07c7.system.entry.js → p-1841c319.system.entry.js} +1 -1
  65. package/dist/ripple/p-1d209974.system.js +1 -0
  66. package/dist/ripple/p-1e37706b.system.js +1 -0
  67. package/dist/ripple/{p-5ecdb43e.system.entry.js → p-23e1112c.system.entry.js} +1 -1
  68. package/dist/ripple/{p-8fb8253e.entry.js → p-57f9c7c3.entry.js} +1 -1
  69. package/dist/ripple/p-6238044b.system.entry.js +1 -0
  70. package/dist/ripple/{p-8a32bd08.system.entry.js → p-65d3f9c4.system.entry.js} +1 -1
  71. package/dist/ripple/p-69ba61b7.entry.js +1 -0
  72. package/dist/ripple/{p-2d9328dd.system.entry.js → p-6bf103b8.system.entry.js} +1 -1
  73. package/dist/ripple/{p-386d990c.entry.js → p-6ec4129b.entry.js} +1 -1
  74. package/dist/ripple/p-7180e24a.entry.js +1 -0
  75. package/dist/ripple/{p-cf12dd5f.entry.js → p-a9ddfa2c.entry.js} +1 -1
  76. package/dist/ripple/p-ad10664f.entry.js +1 -0
  77. package/dist/ripple/{p-6e331d01.system.entry.js → p-c73882de.system.entry.js} +1 -1
  78. package/dist/ripple/{p-2c112c06.system.entry.js → p-d32a9831.system.entry.js} +1 -1
  79. package/dist/ripple/p-dbc3a44d.entry.js +1 -0
  80. package/dist/ripple/{p-2763a193.entry.js → p-ea10c498.entry.js} +1 -1
  81. package/dist/ripple/p-f3539bb3.js +1 -0
  82. package/dist/ripple/{p-daac445c.system.entry.js → p-f8fd7172.system.entry.js} +1 -1
  83. package/dist/ripple/ripple.esm.js +1 -1
  84. package/dist/ripple/ripple.js +1 -1
  85. package/dist/types/components/selects/wm-select/wm-select.d.ts +7 -1
  86. package/dist/types/components/wm-file/wm-file.d.ts +4 -1
  87. package/dist/types/components/wm-navigator/wm-navigator.d.ts +1 -1
  88. package/package.json +2 -2
  89. package/dist/esm-es5/app-globals-f089afb3.js +0 -1
  90. package/dist/ripple/p-00a48988.system.js +0 -1
  91. package/dist/ripple/p-39cf240f.entry.js +0 -1
  92. package/dist/ripple/p-494d52b3.js +0 -1
  93. package/dist/ripple/p-602ea108.entry.js +0 -1
  94. package/dist/ripple/p-91c12b65.entry.js +0 -1
  95. package/dist/ripple/p-99e4e12d.system.entry.js +0 -1
  96. package/dist/ripple/p-b29393d0.entry.js +0 -1
  97. package/dist/ripple/p-bb745e54.entry.js +0 -1
  98. package/dist/ripple/p-eb8461e0.system.js +0 -1
@@ -860,37 +860,6 @@
860
860
  mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z'/%3E%3C/svg%3E%0A");
861
861
  }
862
862
 
863
- /* --------------------------------------
864
- 1. Box-shadow
865
- -------------------------------------- */
866
- /* --------------------------------------
867
- 2. Border-radius
868
- -------------------------------------- */
869
- /* --------------------------------------
870
- 3. Transforms
871
- -------------------------------------- */
872
- /* --------------------------------------
873
- 4. Button Focus
874
- -------------------------------------- */
875
- /* --------------------------------------
876
- 5. Flex
877
- -------------------------------------- */
878
- /* --------------------------------------
879
- 7. Screen Reader Only
880
- -------------------------------------- */
881
- /* --------------------------------------
882
- 8. Label styles
883
- this mixin includes all the styles for the label
884
- + flex rules on the parent container to switch between top and left position
885
- + srOnly when label is hidden
886
- Assumes the following markup:
887
- div.wrapper[.label-left.invalid] > div.label-wrapper > label.label > span.required
888
- .wrapper is for the flex rules
889
- .label-wrapper is to set the height of the label when positioned left so it's the same height as
890
- the input. It can't be done directly on .label because of possible line wrapping.
891
- When the label is on top there's no line wrapping at all to ensure proper alignment of inlined elements
892
- (they can't be aligned on the baseline because of possible description text and error message)
893
- -------------------------------------- */
894
863
  :host * {
895
864
  box-sizing: border-box;
896
865
  }
@@ -926,7 +926,7 @@
926
926
  .select-all:focus {
927
927
  outline: none;
928
928
  background: var(--wmcolor-select-option-background-focus);
929
- color: #fff;
929
+ color: var(--wmcolor-interactive-text);
930
930
  }
931
931
 
932
932
  .return-btn,
@@ -1181,7 +1181,7 @@
1181
1181
  .menu .menuitem:focus-visible {
1182
1182
  outline: none;
1183
1183
  background: var(--wmcolor-interactive-background-focus);
1184
- color: #fff;
1184
+ color: var(--wmcolor-interactive-text);
1185
1185
  }
1186
1186
  .menu .menuitem:hover {
1187
1187
  background: var(--wmcolor-select-option-background-hover);
@@ -879,7 +879,7 @@
879
879
  :host:focus, :host.focus {
880
880
  outline: none;
881
881
  background: var(--wmcolor-select-option-background-focus);
882
- color: #fff;
882
+ color: var(--wmcolor-interactive-text);
883
883
  }
884
884
  :host.icon {
885
885
  color: var(--wmcolor-interactive);
@@ -996,15 +996,20 @@
996
996
  :host(:focus-visible) {
997
997
  outline: none;
998
998
  background: var(--wmcolor-select-option-background-focus);
999
- color: #fff;
999
+ color: var(--wmcolor-interactive-text);
1000
1000
  }
1001
1001
  :host(:focus-visible) .checkbox.svg-checkbox-blank,
1002
1002
  :host(:focus-visible) .checkbox.svg-checkbox-selected {
1003
- --icon-fill: #fff;
1003
+ --icon-fill: var(--wmcolor-interactive-text);
1004
1004
  }
1005
1005
 
1006
1006
  :host(:hover) {
1007
1007
  background: var(--wmcolor-select-option-background-hover);
1008
1008
  color: var(--wmcolor-select-option-text);
1009
1009
  outline: none;
1010
+ }
1011
+
1012
+ :host(:focus-visible:hover) .checkbox.svg-checkbox-blank,
1013
+ :host(:focus-visible:hover) .checkbox.svg-checkbox-selected {
1014
+ --icon-fill: var(--wmcolor-interactive);
1010
1015
  }
@@ -878,6 +878,8 @@
878
878
  --wmcolor-select-selectall-border: var(--wmcolor-select-option-border);
879
879
  --wmcolor-select-selectall-text: var(--wmcolor-interactive);
880
880
  --wmcolor-select-text: var(--wmcolor-interactive);
881
+ --offset-x: 0px;
882
+ --offset-y: 0px;
881
883
  position: relative;
882
884
  display: block;
883
885
  box-sizing: border-box;
@@ -1083,36 +1085,37 @@
1083
1085
  -webkit-transform-origin: center top;
1084
1086
  -moz-transform-origin: center top;
1085
1087
  transform-origin: center top;
1088
+ border: none;
1086
1089
  -webkit-border-radius: 3px;
1087
1090
  -moz-border-radius: 3px;
1088
1091
  -ms-border-radius: 3px;
1089
1092
  border-radius: 3px;
1090
- position: absolute;
1091
- top: 40px;
1092
- right: 0;
1093
1093
  background: var(--wmcolor-select-option-background);
1094
- z-index: 100;
1095
- width: 100%;
1096
1094
  font-size: 0.875rem;
1097
1095
  max-height: var(--max-height);
1098
1096
  overflow-y: auto;
1099
1097
  }
1100
- .wrapper .button-wrapper > .dropdown.upwards {
1101
- top: unset;
1102
- bottom: 100%;
1103
- -ms-transform-origin: center bottom;
1104
- -webkit-transform-origin: center bottom;
1105
- -moz-transform-origin: center bottom;
1106
- transform-origin: center bottom;
1107
- }
1108
1098
  .wrapper .button-wrapper > .dropdown.hidden {
1109
1099
  visibility: hidden;
1110
1100
  }
1111
- .wrapper .button-wrapper > .dropdown.open {
1101
+ .wrapper .button-wrapper > .dropdown:popover-open {
1112
1102
  -ms-transform: scale(1, 1);
1113
1103
  -webkit-transform: scale(1, 1);
1114
1104
  -moz-transform: scale(1, 1);
1115
1105
  transform: scale(1, 1);
1106
+ margin: 0;
1107
+ width: unset;
1108
+ top: anchor(bottom);
1109
+ left: anchor(left);
1110
+ right: anchor(right);
1111
+ }
1112
+ .wrapper .button-wrapper > .dropdown:popover-open.upwards {
1113
+ top: unset;
1114
+ bottom: anchor(top);
1115
+ -ms-transform-origin: center bottom;
1116
+ -webkit-transform-origin: center bottom;
1117
+ -moz-transform-origin: center bottom;
1118
+ transform-origin: center bottom;
1116
1119
  }
1117
1120
  .wrapper.invalid .button-wrapper .displayedoption {
1118
1121
  -webkit-box-shadow: 0 0 0 1px var(--wmcolor-border-error);
@@ -1159,4 +1162,18 @@
1159
1162
  .rtl > .displayedoption:before {
1160
1163
  right: auto;
1161
1164
  left: 0.5625rem;
1165
+ }
1166
+
1167
+ @supports not (top: anchor(bottom)) {
1168
+ :host {
1169
+ position: relative;
1170
+ }
1171
+ :host .button-wrapper {
1172
+ position: unset;
1173
+ }
1174
+ :host .button-wrapper .dropdown {
1175
+ z-index: 30;
1176
+ inset: auto;
1177
+ translate: var(--offset-x) var(--offset-y);
1178
+ }
1162
1179
  }
@@ -1,14 +1,24 @@
1
1
  import { h, Host } from "@stencil/core";
2
2
  import { forceUpdate } from "@stencil/core";
3
- import { getTextDir, shouldOpenUp, isElOrChild, toBool, handleDisabledAttribute, showTooltip, hideTooltip } from "../../../global/functions";
3
+ import { getTextDir, shouldOpenUp, isElOrChild, toBool, handleDisabledAttribute, showTooltip, hideTooltip, debounce, findAllScrollableParents, getCumulativeScrollOffset, } from "../../../global/functions";
4
4
  import { globalMessages, selectMessages } from "../../../global/intl";
5
5
  export class Select {
6
6
  constructor() {
7
+ this.scrollableParents = [];
7
8
  this.openUp = false;
8
9
  //////////////////////////////////////
9
10
  // for multiselect button text
10
11
  this.overflowCount = 0;
11
12
  this.displayedOptions = [];
13
+ this.debouncedReveal = debounce(() => {
14
+ const { x, y } = getCumulativeScrollOffset(this.el);
15
+ this.el.style.setProperty("--offset-x", "-" + x + "px");
16
+ this.el.style.setProperty("--offset-y", "-" + y + "px");
17
+ this.isHidden = false;
18
+ }, 100);
19
+ this.debouncedResize = debounce(() => {
20
+ this.scrollableParents = findAllScrollableParents(this.el);
21
+ }, 200);
12
22
  this.disabled = false;
13
23
  this.maxHeight = "200px";
14
24
  this.label = undefined;
@@ -21,12 +31,15 @@ export class Select {
21
31
  this.placeholder = selectMessages.multiPlaceholder;
22
32
  this.searchPlaceholder = selectMessages.searchPlaceholder;
23
33
  this.allSelectedMessage = selectMessages.allSelected;
24
- this.isExpanded = false;
34
+ this.isHidden = true;
25
35
  this.announcement = "";
26
36
  }
27
37
  get childOptions() {
28
38
  return Array.from(this.el.querySelectorAll("wm-option"));
29
39
  }
40
+ get isExpanded() {
41
+ return this.dropdownEl && this.dropdownEl.matches(":popover-open");
42
+ }
30
43
  get isDisabled() {
31
44
  // string "false" needs to be treated as bool False because react wrappers convert bool to string.
32
45
  return toBool(this.disabled);
@@ -91,6 +104,11 @@ export class Select {
91
104
  break;
92
105
  }
93
106
  }
107
+ handleResize() {
108
+ if (!CSS.supports("top", "anchor(bottom)")) {
109
+ this.debouncedResize();
110
+ }
111
+ }
94
112
  componentWillLoad() {
95
113
  if (!this.label) {
96
114
  console.error("For accessibility purposes, this component requires a label (even if `label-position` is set to `none`).");
@@ -118,16 +136,32 @@ export class Select {
118
136
  }
119
137
  componentDidLoad() {
120
138
  this.wmSelectDidLoad.emit();
121
- this.dropdownEl.classList.add("hidden");
122
- forceUpdate(this.el);
123
139
  this.setButtonText();
140
+ if (!CSS.supports("top", "anchor(bottom)")) {
141
+ this.scrollableParents = findAllScrollableParents(this.el);
142
+ // Add scroll listeners to all scrollable parents
143
+ this.scrollableParents.forEach((parent) => {
144
+ if (parent === document.documentElement) {
145
+ // For document element, listen to window scroll event
146
+ window.addEventListener("scroll", () => this.handleScroll());
147
+ }
148
+ else {
149
+ // For regular elements, listen to their scroll event
150
+ parent.addEventListener("scroll", () => this.handleScroll());
151
+ }
152
+ });
153
+ }
124
154
  }
125
155
  open(optionToSelect) {
126
156
  if (!this.isDisabled) {
127
157
  this.openUp = shouldOpenUp(this.el, this.dropdownEl.clientHeight, this.labelEl.clientHeight);
128
- this.isExpanded = true;
129
- this.dropdownEl.classList.add("open");
130
- this.dropdownEl.classList.remove("hidden");
158
+ // handling scroll offset for older browsers (currently FF and Safari)
159
+ if (!CSS.supports("top", "anchor(bottom)")) {
160
+ const { x, y } = getCumulativeScrollOffset(this.buttonEl);
161
+ this.el.style.setProperty("--offset-x", "-" + x + "px");
162
+ this.el.style.setProperty("--offset-y", "-" + y + "px");
163
+ }
164
+ this.isHidden = false;
131
165
  window.requestAnimationFrame(() => {
132
166
  this.optionListEl.handleInitialFocus(optionToSelect);
133
167
  });
@@ -135,11 +169,9 @@ export class Select {
135
169
  }
136
170
  close(returnFocus = true) {
137
171
  if (this.isExpanded) {
138
- this.isExpanded = false;
139
172
  this.optionListEl.unfocusAll();
140
- this.dropdownEl.classList.remove("open");
141
173
  window.setTimeout(() => {
142
- this.dropdownEl.classList.add("hidden");
174
+ this.isHidden = true;
143
175
  if (this.optionListEl.multiple) {
144
176
  this.optionListEl.updateOptionVisibility();
145
177
  }
@@ -178,6 +210,13 @@ export class Select {
178
210
  showTooltip("right", ev.target, this.label);
179
211
  }
180
212
  }
213
+ handleScroll() {
214
+ if (this.isExpanded) {
215
+ if (!this.isHidden)
216
+ this.isHidden = true;
217
+ this.debouncedReveal();
218
+ }
219
+ }
181
220
  setButtonText() {
182
221
  this.displayedOptions = this.childOptions.filter((x) => x.selected);
183
222
  // handle overflow + counter for multiselect
@@ -232,11 +271,13 @@ export class Select {
232
271
  ["aria-labelledby"]: "label selectbtn",
233
272
  ["aria-describedby"]: "error",
234
273
  ["aria-expanded"]: this.isExpanded ? "true" : "false",
274
+ ["popovertarget"]: "dropdown",
275
+ ["popovertargetaction"]: "toggle",
235
276
  onClick: () => (this.isExpanded ? this.close() : this.open()),
236
277
  };
237
- return (h(Host, { key: '27f57d30b836eac8dc27ae98a425015d86a0948b', onBlur: (ev) => this.handleComponentBlur(ev) }, h("div", { key: '8f48d8e8d616244350e61d6e81f350640131bbf0', class: `wrapper ${getTextDir()} label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { key: '39d3bcec9b67d671a6bdbb6a3ee738832189ea51', ref: (el) => (this.labelEl = el), class: "label-wrapper" }, h("label", { key: 'b0bb90a215ac20de94afa8dba56e839bdc590dc1', class: "label", id: "label", htmlFor: "selectbtn", onMouseEnter: (ev) => this.handleLabelMouseEnter(ev), onMouseLeave: () => hideTooltip() }, this.label),
278
+ return (h(Host, { key: '330408045b96bb9d56e5998d50706e74b2b094a7', onBlur: (ev) => this.handleComponentBlur(ev) }, h("div", { key: '82b457ba9b22107a26359d5f7f63c56333f33e46', class: `wrapper ${getTextDir()} label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { key: '9cfa0597409bd864b747b89ac2b843de0b085ca7', ref: (el) => (this.labelEl = el), class: "label-wrapper" }, h("label", { key: '7d0c9f4a985b6ab59a239d0cafa69d932125b91b', class: "label", id: "label", htmlFor: "selectbtn", onMouseEnter: (ev) => this.handleLabelMouseEnter(ev), onMouseLeave: () => hideTooltip() }, this.label),
238
279
  // we can't use aria-required because the listbox is in a sub-component and it is not announced
239
- this.requiredField && (h("span", { key: '4a5648503a023ff1eba34db936d49709e14da9f1', class: "required" }, h("span", { key: '3fe783c7174d3d827b20589cad412d32fa4cd978', class: "sr-only" }, globalMessages.requiredField), h("span", { key: '85ac4ca35f1077ade1bdda403b8888cc206ff28e', "aria-hidden": "true" }, "*")))), h("div", { key: 'c2e70d87db2d533713ac9c5a877ddba98a9a9a2f', class: "button-wrapper" }, h("button", Object.assign({ key: '460c6ac5cde8637b0098201966ca4268301ac2b7' }, buttonProps, { class: "displayedoption", ref: (el) => (this.buttonEl = el), onBlur: (ev) => this.handleButtonBlur(ev) }), h("span", { key: '3af3357f45ceacc5689e90e2bdc6459cab591c2f', class: `overflowcontrol ${showSubinfo ? "hassubinfo" : ""}` }, h("span", { key: 'bd9869db1146e54cc47c2965ebe2776873e2a18e', class: "button-text" }, this.renderButtonText()), showSubinfo && h("span", { key: 'b22d952625e93fab98ebb1b688101fd8891a4af7', class: "subinfo" }, this.selectedOptions[0].subinfo)), h("div", { key: '1f6448ee167d1847eff8fb5bc7a30e0a964e6efe', class: `expand-icon svg-icon ${this.isExpanded ? "svg-expand-less" : "svg-expand-more"}` }), this.renderOverflowCount(), h("div", { key: '0d550b97a3e08e9b708f2f4c3d91f9cac76ba5d8', ref: (el) => (this.measurementAreaEl = el), class: "measurement-area", "aria-hidden": "true" })), h("div", { key: '59cc7fcfa25d9d3eab8e4d70cdcd365e36e160ad', class: `dropdown ${this.isExpanded ? "open" : ""} ${this.openUp ? "upwards" : ""}`, ref: (el) => (this.dropdownEl = el) }, h("priv-option-list", { key: '9fb7d0396527bc18bb8f5d00d64c858470d0698d', ref: (el) => (this.optionListEl = el), multiple: this.multiple, search: this.search, selectAll: this.selectAll, maxHeight: this.maxHeight, searchPlaceholder: this.searchPlaceholder, onOptionListCloseRequested: () => this.close(), onOptionListAllSelected: () => this.wmSelectAllSelected.emit(), onOptionListAllDeselected: () => this.wmSelectAllDeselected.emit() }, h("slot", { key: '4c307bca5104ec962ca050b46adf882fb78bb74a' }))), h("div", { key: '06f11b61b475cc6cd78c2a8278b8455a79405e17', id: "error", class: this.errorMessage ? "error-message" : "" }, this.errorMessage), h("div", { key: '86cf865fbb7fd0e2c88290fe92e6062ada7d9ab6', id: "announcement", "aria-live": "polite", "aria-atomic": "true", class: "sr-only", ref: (el) => (this.liveRegionEl = el) }, this.announcement)))));
280
+ this.requiredField && (h("span", { key: '4a527a732bb04851b3d3fefc29bb4c317d3864b8', class: "required" }, h("span", { key: '8ac2a86df3f5b59d5275f55cca6c85d64c96559e', class: "sr-only" }, globalMessages.requiredField), h("span", { key: '023605d744293eaff5d924f23d5a604fd4fe8796', "aria-hidden": "true" }, "*")))), h("div", { key: '8d1a8b4e1499c3bc41af8231149c5be2da261fb5', class: "button-wrapper" }, h("button", Object.assign({ key: '2068a2077fb7e39c3c41b7e4bb2aa953bc60b9d8' }, buttonProps, { class: "displayedoption", ref: (el) => (this.buttonEl = el), onBlur: (ev) => this.handleButtonBlur(ev) }), h("span", { key: '71fadfcbc3f77637af1ab24878fcce0507d59012', class: `overflowcontrol ${showSubinfo ? "hassubinfo" : ""}` }, h("span", { key: 'c770393cfe04bb2c107c3052f8b23c83ff581b00', class: "button-text" }, this.renderButtonText()), showSubinfo && h("span", { key: 'e1087535c9c44974385e303ae928d76c071d555f', class: "subinfo" }, this.selectedOptions[0].subinfo)), h("div", { key: 'a3e291c520dd26a2512a59e3e3be95f6db72f17a', class: `expand-icon svg-icon ${this.isExpanded ? "svg-expand-less" : "svg-expand-more"}` }), this.renderOverflowCount(), h("div", { key: 'fd328a33e9c92561c1cd9ca0785349b12daa5cb7', ref: (el) => (this.measurementAreaEl = el), class: "measurement-area", "aria-hidden": "true" })), h("div", { key: '4d7308d974bd20a1fea40e946abdcd89247095a3', class: `dropdown ${this.isHidden ? "hidden" : ""} ${this.openUp ? "upwards" : ""}`, id: "dropdown", popover: "auto", ref: (el) => (this.dropdownEl = el) }, h("priv-option-list", { key: '1797c238d91272e4983b4e98f80bfd1519b4fc5f', ref: (el) => (this.optionListEl = el), multiple: this.multiple, search: this.search, selectAll: this.selectAll, maxHeight: this.maxHeight, searchPlaceholder: this.searchPlaceholder, onOptionListCloseRequested: () => this.close(), onOptionListAllSelected: () => this.wmSelectAllSelected.emit(), onOptionListAllDeselected: () => this.wmSelectAllDeselected.emit() }, h("slot", { key: 'de94c77063873993f52d46ab762b461cc3573f30' }))), h("div", { key: '717ee774cf69f04ad73825d717cec9c9e30adc6b', id: "error", class: this.errorMessage ? "error-message" : "" }, this.errorMessage), h("div", { key: '053db243c037e395a41f0cb2eade700c600a903d', id: "announcement", "aria-live": "polite", "aria-atomic": "true", class: "sr-only", ref: (el) => (this.liveRegionEl = el) }, this.announcement)))));
240
281
  }
241
282
  static get is() { return "wm-select"; }
242
283
  static get encapsulation() { return "shadow"; }
@@ -471,7 +512,7 @@ export class Select {
471
512
  }
472
513
  static get states() {
473
514
  return {
474
- "isExpanded": {},
515
+ "isHidden": {},
475
516
  "announcement": {}
476
517
  };
477
518
  }
@@ -585,6 +626,12 @@ export class Select {
585
626
  "target": undefined,
586
627
  "capture": false,
587
628
  "passive": false
629
+ }, {
630
+ "name": "resize",
631
+ "method": "handleResize",
632
+ "target": "window",
633
+ "capture": false,
634
+ "passive": true
588
635
  }];
589
636
  }
590
637
  }
@@ -894,47 +894,123 @@
894
894
  .file-wrapper .file.condensed {
895
895
  column-gap: 2.5rem;
896
896
  }
897
+ .file-wrapper .file.extra-condensed {
898
+ column-gap: 0.75rem;
899
+ }
897
900
  .file-wrapper .file .filename {
898
- display: inline-block;
901
+ font-weight: 600;
902
+ display: inline;
903
+ overflow-wrap: break-word;
904
+ }
905
+ .file-wrapper .file .filename.hidden {
906
+ display: none;
907
+ }
908
+ .file-wrapper .file .filename-measure {
899
909
  white-space: nowrap;
910
+ visibility: hidden;
911
+ position: absolute;
912
+ pointer-events: none;
900
913
  }
901
914
  .file-wrapper .file .left-group {
902
- overflow: hidden;
903
- min-inline-size: 5.3125rem;
915
+ min-inline-size: 0;
904
916
  flex-grow: 1;
905
917
  }
918
+ .file-wrapper .file .left-group:has(.-truncated) {
919
+ min-inline-size: fit-content;
920
+ }
906
921
  .file-wrapper .file .right-group {
907
- display: flex;
908
- justify-content: end;
922
+ display: grid;
923
+ grid-template-columns: auto min-content;
909
924
  align-items: center;
910
925
  gap: 1rem;
911
- min-inline-size: 0;
912
- max-inline-size: 50%;
913
926
  }
914
927
  .file-wrapper .file .right-group .file-controls {
915
928
  display: flex;
916
929
  gap: 1rem;
917
930
  }
931
+ .file-wrapper .file .right-group .file-controls wm-button {
932
+ --icon-size: 1.125rem;
933
+ }
918
934
  .file-wrapper .file .right-group .file-info {
935
+ min-inline-size: 4.375rem;
936
+ text-align: right;
937
+ align-items: end;
938
+ }
939
+ .file-wrapper .file .file-info {
919
940
  display: flex;
920
941
  flex-direction: column;
921
- align-items: end;
922
942
  gap: 0.25rem;
923
- text-align: right;
924
943
  max-inline-size: 28.125rem;
925
944
  }
926
- .file-wrapper .file .right-group .file-info .uploader-name {
927
- max-inline-size: 100%;
945
+ .file-wrapper .file .file-info * {
928
946
  overflow-wrap: break-word;
947
+ }
948
+ .file-wrapper .file .file-info .uploader-name {
949
+ max-inline-size: 100%;
929
950
  text-wrap: balance;
930
951
  }
931
- .file-wrapper .file .right-group .file-info:empty {
952
+ .file-wrapper .file .file-info:empty {
932
953
  display: none;
933
954
  }
955
+ .file-wrapper .file #file-details summary {
956
+ --icon-size: 24px;
957
+ display: block;
958
+ font-weight: 600;
959
+ color: var(--wmcolor-interactive);
960
+ }
961
+ .file-wrapper .file #file-details summary::before {
962
+ position: absolute;
963
+ transform: translate(0, -12%);
964
+ }
965
+ .file-wrapper .file #file-details summary:focus-visible {
966
+ outline: 3px solid var(--wmcolor-interactive-focus);
967
+ outline-offset: 2px;
968
+ }
969
+ .file-wrapper .file #file-details #summary-filename-trunc,
970
+ .file-wrapper .file #file-details #summary-filename-wrap,
971
+ .file-wrapper .file #file-details .file-info {
972
+ margin-inline-start: 1.5rem;
973
+ }
974
+ .file-wrapper .file #file-details[open] #summary-filename-trunc {
975
+ display: none;
976
+ }
977
+ .file-wrapper .file #file-details[open] summary:before {
978
+ content: "";
979
+ display: block;
980
+ background-color: var(--icon-fill, currentColor);
981
+ width: var(--icon-size, 0.875rem);
982
+ height: var(--icon-size, 0.875rem);
983
+ -webkit-mask-size: 100%;
984
+ mask-size: 100%;
985
+ }
986
+ .file-wrapper .file #file-details[open] summary:before {
987
+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M7,10L12,15L17,10H7Z'/%3E%3C/svg%3E%0A");
988
+ mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M7,10L12,15L17,10H7Z'/%3E%3C/svg%3E%0A");
989
+ }
990
+ .file-wrapper .file #file-details:not([open]) #summary-filename-wrap {
991
+ display: none;
992
+ }
993
+ .file-wrapper .file #file-details:not([open]) summary:before {
994
+ content: "";
995
+ display: block;
996
+ background-color: var(--icon-fill, currentColor);
997
+ width: var(--icon-size, 0.875rem);
998
+ height: var(--icon-size, 0.875rem);
999
+ -webkit-mask-size: 100%;
1000
+ mask-size: 100%;
1001
+ }
1002
+ .file-wrapper .file #file-details:not([open]) summary:before {
1003
+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M10,17L15,12L10,7V17Z'/%3E%3C/svg%3E%0A");
1004
+ mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M10,17L15,12L10,7V17Z'/%3E%3C/svg%3E%0A");
1005
+ }
1006
+ .file-wrapper .file #summary-filename-wrap {
1007
+ display: inline-block;
1008
+ overflow-wrap: anywhere;
1009
+ }
934
1010
  .file-wrapper .file.--error {
935
1011
  border: 1px solid var(--wmcolor-file-border-error);
936
1012
  background-color: var(--wmcolor-file-background-error);
937
- block-size: 3.75rem;
1013
+ min-block-size: 3.75rem;
938
1014
  }
939
1015
  .file-wrapper .file.--error .right-group {
940
1016
  flex-shrink: 0;
@@ -17,8 +17,21 @@ export class File {
17
17
  this.showInfo = "last-updated";
18
18
  }
19
19
  get isCondensed() {
20
+ // Breakpoint at which file actions are moved into an action menu
20
21
  return this.el.clientWidth < 500;
21
22
  }
23
+ get isExtraCondensed() {
24
+ // Breakpoint at which file info is moved into a details element
25
+ return this.el.clientWidth < 414;
26
+ }
27
+ get needsTruncation() {
28
+ const boundsEl = this.el.shadowRoot.querySelector(".left-group");
29
+ const measureEl = this.el.shadowRoot.querySelector(".filename-measure");
30
+ if (boundsEl && measureEl && boundsEl.clientWidth < measureEl.clientWidth) {
31
+ return true;
32
+ }
33
+ return false;
34
+ }
22
35
  get isUploading() {
23
36
  return this.progress !== undefined && this.progress < 100;
24
37
  }
@@ -107,22 +120,20 @@ export class File {
107
120
  const resizeObserver = new ResizeObserver(() => this.debouncedUpdate());
108
121
  resizeObserver.observe(this.el);
109
122
  }
110
- setFilename() {
111
- // calc is not accurate and last letter may be cropped if we don't wait
112
- requestAnimationFrame(() => {
113
- const fileNameEl = this.el.shadowRoot.querySelector(".filename");
114
- const leftBoundary = this.el.shadowRoot.querySelector(".left-group").getBoundingClientRect().left;
115
- const rightGroup = this.el.shadowRoot.querySelector(".right-group");
116
- const file = this.el.shadowRoot.querySelector(".file");
117
- const colGap = file ? getComputedStyle(file).getPropertyValue("column-gap") : "0";
118
- const rightBoundary = rightGroup
119
- ? rightGroup.getBoundingClientRect().left - parseFloat(colGap)
120
- : this.el.shadowRoot.querySelector(".file-wrapper").getBoundingClientRect().right - 20;
121
- fileNameEl.textContent = truncateText(fileNameEl, this.fullFilename, rightBoundary - leftBoundary, 7);
122
- });
123
+ truncateFilename() {
124
+ let summaryFilenameEl = this.el.shadowRoot.querySelector("#summary-filename-trunc");
125
+ if (summaryFilenameEl) {
126
+ summaryFilenameEl.textContent = truncateText(summaryFilenameEl, this.fullFilename, summaryFilenameEl.parentElement.clientWidth - 32, 7);
127
+ if (summaryFilenameEl.textContent === this.fullFilename) {
128
+ summaryFilenameEl.classList.remove("-truncated");
129
+ }
130
+ else {
131
+ summaryFilenameEl.classList.add("-truncated");
132
+ }
133
+ }
123
134
  }
124
135
  componentDidRender() {
125
- this.setFilename();
136
+ this.truncateFilename();
126
137
  }
127
138
  previewFile() {
128
139
  this.wmFilePreview.emit();
@@ -140,10 +151,11 @@ export class File {
140
151
  }
141
152
  }
142
153
  renderFileName() {
143
- return (h("div", { class: "left-group" }, h("div", { class: "name-wrapper" }, h("span", { class: "sr-only" }, this.fullFilename), h("span", { "aria-hidden": "true", class: "filename", onMouseEnter: (ev) => this.handleFilenameMouseEnter(ev), onMouseLeave: () => hideTooltip() }), this.isUploading && h("span", { class: "sr-only" }, "uploading"))));
154
+ const showDetailsToggle = this.isExtraCondensed && (this.needsTruncation || (this.showInfo !== "none" && !this.errorMessage));
155
+ return (h("div", { class: "left-group" }, h("div", { class: "name-wrapper" }, h("span", { class: "sr-only" }, this.fullFilename), h("span", { "aria-hidden": "true", class: `filename ${showDetailsToggle ? "hidden" : ""}` }, this.fullFilename), this.isUploading && h("span", { class: "sr-only" }, "uploading")), showDetailsToggle && this.renderDetailsToggle()));
144
156
  }
145
157
  renderFileInfo() {
146
- return (h("div", { class: "file-info" }, (this.showInfo === "uploaded-by" || this.showInfo === "all") && (h("div", { class: "details uploader-name" }, this.uploadedBy)), (this.showInfo === "last-updated" || this.showInfo === "all") && h("div", { class: "details" }, this.lastUpdated), (this.showInfo === "size" || this.showInfo === "all") && h("div", { class: "details" }, this.size)));
158
+ return (h("div", { class: "file-info" }, (this.showInfo === "uploaded-by" || this.showInfo === "all") && (h("div", { class: "uploader-name" }, this.uploadedBy)), (this.showInfo === "last-updated" || this.showInfo === "all") && h("div", null, this.lastUpdated), (this.showInfo === "size" || this.showInfo === "all") && h("div", null, this.size)));
147
159
  }
148
160
  renderActionMenu() {
149
161
  const previewItem = (h("wm-menuitem", { icon: "#show", onClick: () => this.previewFile() }, this.previewActionMessage));
@@ -167,11 +179,15 @@ export class File {
167
179
  const showActionMenu = this.isCondensed && !hasSingleFileAction;
168
180
  return showActionMenu ? this.renderActionMenu() : this.renderFileActionButtons();
169
181
  }
182
+ renderDetailsToggle() {
183
+ return (h("details", { id: "file-details" }, h("summary", null, h("div", { class: "filename-measure", "aria-hidden": "true" }, this.fullFilename), h("span", { id: "summary-filename-trunc", onMouseEnter: (ev) => this.handleFilenameMouseEnter(ev), onMouseLeave: () => hideTooltip() }, this.fullFilename), h("span", { id: "summary-filename-wrap" }, this.fullFilename)), !this.errorMessage && this.renderFileInfo()));
184
+ }
170
185
  renderFile() {
171
- return (h("div", { class: `file-wrapper` }, h("div", { class: `file ${this.errorMessage ? "--error" : ""} ${this.isCondensed ? "condensed" : ""}` }, this.renderFileName(), !this.errorMessage && (h("div", { class: "right-group" }, this.renderFileInfo(), this.fileActions !== "" && this.renderFileControls())), this.errorMessage && (h("div", { class: "right-group" }, h("wm-button", { "permanently-delete": true, "button-type": "textonly", "label-for-identical-buttons": this.generateClearButtonLabel(this.name), onClick: () => this.wmFileErrorCleared.emit() }, this.clearButtonText))), this.progress == 100 && h("span", { class: "svg-icon svg-success" })), this.errorMessage && h("div", { class: "error-message" }, this.errorMessage)));
186
+ const showRightGroup = !this.errorMessage && (this.fileActions !== "" || this.showInfo !== "none");
187
+ return (h("div", { class: `file-wrapper` }, h("div", { class: `file ${this.errorMessage ? "--error" : ""} ${this.isCondensed ? "condensed" : ""} ${this.isExtraCondensed ? "extra-condensed" : ""}` }, this.renderFileName(), showRightGroup && (h("div", { class: "right-group" }, !this.isExtraCondensed && this.renderFileInfo(), this.fileActions !== "" && this.renderFileControls())), this.errorMessage && (h("div", { class: "right-group" }, h("wm-button", { "permanently-delete": true, "button-type": "textonly", "label-for-identical-buttons": this.generateClearButtonLabel(this.name), onClick: () => this.wmFileErrorCleared.emit() }, this.clearButtonText))), this.progress == 100 && h("span", { class: "svg-icon svg-success" })), this.errorMessage && h("div", { class: "error-message" }, this.errorMessage)));
172
188
  }
173
189
  render() {
174
- return h(Host, { key: '88c61b45d6f48a00abeaaddb9a03e870f597df0c', role: "listitem" }, this.isUploading ? this.renderFileInProgress() : this.renderFile());
190
+ return h(Host, { key: '64184891986497ee7159216e7f9ffef22b046c1c', role: "listitem" }, this.isUploading ? this.renderFileInProgress() : this.renderFile());
175
191
  }
176
192
  static get is() { return "wm-file"; }
177
193
  static get encapsulation() { return "shadow"; }
@@ -860,37 +860,18 @@
860
860
  mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z'/%3E%3C/svg%3E%0A");
861
861
  }
862
862
 
863
- /* --------------------------------------
864
- 1. Box-shadow
865
- -------------------------------------- */
866
- /* --------------------------------------
867
- 2. Border-radius
868
- -------------------------------------- */
869
- /* --------------------------------------
870
- 3. Transforms
871
- -------------------------------------- */
872
- /* --------------------------------------
873
- 4. Button Focus
874
- -------------------------------------- */
875
- /* --------------------------------------
876
- 5. Flex
877
- -------------------------------------- */
878
- /* --------------------------------------
879
- 7. Screen Reader Only
880
- -------------------------------------- */
881
- /* --------------------------------------
882
- 8. Label styles
883
- this mixin includes all the styles for the label
884
- + flex rules on the parent container to switch between top and left position
885
- + srOnly when label is hidden
886
- Assumes the following markup:
887
- div.wrapper[.label-left.invalid] > div.label-wrapper > label.label > span.required
888
- .wrapper is for the flex rules
889
- .label-wrapper is to set the height of the label when positioned left so it's the same height as
890
- the input. It can't be done directly on .label because of possible line wrapping.
891
- When the label is on top there's no line wrapping at all to ensure proper alignment of inlined elements
892
- (they can't be aligned on the baseline because of possible description text and error message)
893
- -------------------------------------- */
863
+ :host(:focus-visible) {
864
+ outline: none;
865
+ }
866
+ :host(:focus-visible) .wrapper {
867
+ outline: none;
868
+ background: var(--wmcolor-actionmenu-item-background-focus);
869
+ color: var(--wmcolor-interactive-text);
870
+ }
871
+ :host(:focus-visible) .wrapper .description {
872
+ color: var(--wmcolor-interactive-text);
873
+ }
874
+
894
875
  :host {
895
876
  --wmcolor-actionmenu-item-background-hover: var(--wmcolor-option-background-hover);
896
877
  --wmcolor-actionmenu-item-background-focus: var(--wmcolor-option-background-focus);
@@ -920,6 +901,10 @@
920
901
  :host .wrapper:hover {
921
902
  background: var(--wmcolor-actionmenu-item-background-hover);
922
903
  outline: none;
904
+ color: var(--wmcolor-actionmenu-item-text);
905
+ }
906
+ :host .wrapper:hover .description {
907
+ color: var(--wmcolor-actionmenu-item-text-description);
923
908
  }
924
909
  :host .wrapper .description {
925
910
  color: var(--wmcolor-actionmenu-item-text-description);
@@ -954,18 +939,6 @@
954
939
  font-size: 1.12rem;
955
940
  }
956
941
 
957
- :host(:focus-visible) {
958
- outline: none;
959
- }
960
- :host(:focus-visible) .wrapper {
961
- outline: none;
962
- background: var(--wmcolor-actionmenu-item-background-focus);
963
- color: #fff;
964
- }
965
- :host(:focus-visible) .wrapper .description {
966
- color: #fff;
967
- }
968
-
969
942
  :host([aria-disabled=true]) {
970
943
  pointer-events: none;
971
944
  }