@pine-ds/core 4.6.0 → 4.7.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 (74) hide show
  1. package/components/pds-combobox.js +1 -1
  2. package/components/pds-drawer.js +1 -1
  3. package/components/pds-dropdown-menu.js +1 -1
  4. package/components/pds-modal2.js +1 -1
  5. package/components/pds-multiselect.js +1 -1
  6. package/components/pds-popover.js +1 -1
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/pds-combobox.cjs.entry.js +33 -3
  9. package/dist/cjs/pds-drawer.cjs.entry.js +23 -10
  10. package/dist/cjs/pds-dropdown-menu.cjs.entry.js +9 -5
  11. package/dist/cjs/pds-modal.cjs.entry.js +116 -31
  12. package/dist/cjs/pds-multiselect.cjs.entry.js +6 -5
  13. package/dist/cjs/pds-popover.cjs.entry.js +170 -26
  14. package/dist/cjs/pine-core.cjs.js +1 -1
  15. package/dist/collection/components/pds-combobox/pds-combobox.js +33 -3
  16. package/dist/collection/components/pds-drawer/pds-drawer.css +4 -1
  17. package/dist/collection/components/pds-drawer/pds-drawer.js +54 -17
  18. package/dist/collection/components/pds-drawer/stories/pds-drawer.stories.js +6 -1
  19. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.js +15 -5
  20. package/dist/collection/components/pds-modal/pds-modal.js +117 -32
  21. package/dist/collection/components/pds-multiselect/pds-multiselect.js +8 -7
  22. package/dist/collection/components/pds-popover/pds-popover.js +171 -27
  23. package/dist/docs.json +42 -7
  24. package/dist/esm/loader.js +1 -1
  25. package/dist/esm/pds-combobox.entry.js +33 -3
  26. package/dist/esm/pds-drawer.entry.js +23 -10
  27. package/dist/esm/pds-dropdown-menu.entry.js +9 -5
  28. package/dist/esm/pds-modal.entry.js +116 -31
  29. package/dist/esm/pds-multiselect.entry.js +6 -5
  30. package/dist/esm/pds-popover.entry.js +171 -27
  31. package/dist/esm/pine-core.js +1 -1
  32. package/dist/esm-es5/loader.js +1 -1
  33. package/dist/esm-es5/pds-combobox.entry.js +1 -1
  34. package/dist/esm-es5/pds-drawer.entry.js +1 -1
  35. package/dist/esm-es5/pds-dropdown-menu.entry.js +1 -1
  36. package/dist/esm-es5/pds-modal.entry.js +1 -1
  37. package/dist/esm-es5/pds-multiselect.entry.js +1 -1
  38. package/dist/esm-es5/pds-popover.entry.js +1 -1
  39. package/dist/esm-es5/pine-core.js +1 -1
  40. package/dist/pine-core/p-153ba77b.entry.js +1 -0
  41. package/dist/pine-core/p-21fe6ee1.system.entry.js +1 -0
  42. package/dist/pine-core/p-24fbbb74.system.entry.js +1 -0
  43. package/dist/pine-core/{p-df539c42.system.entry.js → p-5a10784e.system.entry.js} +1 -1
  44. package/dist/pine-core/p-74a05bcc.entry.js +1 -0
  45. package/dist/pine-core/p-92ae6082.entry.js +1 -0
  46. package/dist/pine-core/p-945fb0b1.entry.js +1 -0
  47. package/dist/pine-core/p-CuSNnuFu.system.js +1 -1
  48. package/dist/pine-core/p-a0344e30.entry.js +2 -0
  49. package/dist/pine-core/p-a787b34a.system.entry.js +1 -0
  50. package/dist/pine-core/{p-646afbca.system.entry.js → p-b60ac7eb.system.entry.js} +1 -1
  51. package/dist/pine-core/p-bf5887e8.system.entry.js +1 -0
  52. package/dist/pine-core/p-e21ff692.entry.js +1 -0
  53. package/dist/pine-core/pine-core.esm.js +1 -1
  54. package/dist/types/components/pds-combobox/pds-combobox.d.ts +1 -0
  55. package/dist/types/components/pds-drawer/pds-drawer.d.ts +21 -9
  56. package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu.d.ts +1 -0
  57. package/dist/types/components/pds-modal/pds-modal.d.ts +10 -3
  58. package/dist/types/components/pds-multiselect/pds-multiselect.d.ts +2 -1
  59. package/dist/types/components/pds-popover/pds-popover.d.ts +31 -1
  60. package/dist/types/components.d.ts +45 -30
  61. package/dist/vscode.html-data.json +11 -4
  62. package/hydrate/index.js +369 -90
  63. package/hydrate/index.mjs +369 -90
  64. package/package.json +2 -2
  65. package/dist/pine-core/p-01c9b8f3.entry.js +0 -1
  66. package/dist/pine-core/p-3c27088f.system.entry.js +0 -1
  67. package/dist/pine-core/p-73eb47fa.entry.js +0 -1
  68. package/dist/pine-core/p-7f367db4.system.entry.js +0 -1
  69. package/dist/pine-core/p-9a0083dd.system.entry.js +0 -1
  70. package/dist/pine-core/p-a3735199.entry.js +0 -1
  71. package/dist/pine-core/p-da103a54.system.entry.js +0 -1
  72. package/dist/pine-core/p-ec5428fb.entry.js +0 -1
  73. package/dist/pine-core/p-ed4b979e.entry.js +0 -1
  74. package/dist/pine-core/p-f1f17940.entry.js +0 -2
@@ -2153,6 +2153,9 @@ const PdsCombobox = class {
2153
2153
  };
2154
2154
  // Handler for button trigger click
2155
2155
  this.onButtonTriggerClick = () => {
2156
+ // The button and chip triggers are divs, so a click reaches them even while disabled.
2157
+ if (this.disabled)
2158
+ return;
2156
2159
  this.isOpen = !this.isOpen;
2157
2160
  if (this.isOpen) {
2158
2161
  this.prepareExpandFilterListOnOpen();
@@ -2172,6 +2175,13 @@ const PdsCombobox = class {
2172
2175
  };
2173
2176
  // Handler for button trigger keyboard events
2174
2177
  this.onButtonTriggerKeyDown = (e) => {
2178
+ // Disabled takes it out of the tab order, but setFocus() or a click can still focus it.
2179
+ if (this.disabled) {
2180
+ // Keep Space from scrolling the page, as on a native disabled button.
2181
+ if (e.key === ' ')
2182
+ e.preventDefault();
2183
+ return;
2184
+ }
2175
2185
  // Escape closes an open group before the dropdown. Other keys reach the tree through handleKeyDown.
2176
2186
  if (this.isOpen && e.key === 'Escape' && this.handleGroupedPanelKey(e))
2177
2187
  return;
@@ -2192,8 +2202,9 @@ const PdsCombobox = class {
2192
2202
  }, 0);
2193
2203
  }
2194
2204
  else if (e.key === 'Escape') {
2195
- e.preventDefault();
2205
+ // Only an open dropdown claims Escape; a closed one leaves it to a modal or popover around it.
2196
2206
  if (this.isOpen) {
2207
+ e.preventDefault();
2197
2208
  this.isOpen = false;
2198
2209
  this.highlightedIndex = -1;
2199
2210
  this.clearExpandFilterList();
@@ -2438,6 +2449,22 @@ const PdsCombobox = class {
2438
2449
  if (this.isOpen && this.hidesPanelSearch && this.panelTreeEl)
2439
2450
  this.focusPanel(this.panelTreeEl);
2440
2451
  }
2452
+ disabledChanged(disabled) {
2453
+ var _a, _b, _c, _d, _e;
2454
+ if (!disabled || !this.isOpen)
2455
+ return;
2456
+ const shadowActive = (_b = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.activeElement) !== null && _b !== void 0 ? _b : null;
2457
+ const focusInDropdown = !!((_d = (_c = this.portalEl) === null || _c === void 0 ? void 0 : _c.shadowRoot) === null || _d === void 0 ? void 0 : _d.activeElement) || (!!shadowActive && !!((_e = this.listboxEl) === null || _e === void 0 ? void 0 : _e.contains(shadowActive)));
2458
+ this.isOpen = false;
2459
+ this.highlightedIndex = -1;
2460
+ this.isArrowKeyNavigationMode = false;
2461
+ this.clearExpandFilterList();
2462
+ this.updateAriaActiveDescendant();
2463
+ // Closing removes the search field or option that held focus. A button or chip trigger can still
2464
+ // take it (aria-disabled), so focus doesn't fall to the page; a disabled input can't, as natively.
2465
+ if (focusInDropdown && this.trigger !== 'input')
2466
+ this.restoreFocusToTrigger();
2467
+ }
2441
2468
  isOpenChanged(isOpen) {
2442
2469
  if (!isOpen) {
2443
2470
  this.revealedGroupLabel = null;
@@ -4152,13 +4179,13 @@ const PdsCombobox = class {
4152
4179
  ]
4153
4180
  .filter(Boolean)
4154
4181
  .join(' ');
4155
- return (h(Host, { key: 'e934b937916e45f715e6fb54d23a2a5e7c8ce4f6', "aria-disabled": this.disabled ? 'true' : null }, h("div", { key: '79d282907c4f218e124b4f9250e0aedb0e9ea51d', class: "pds-combobox", tabIndex: -1, onFocusout: this.onComboboxFocusOut, part: "combobox" }, this.hasVisibleLabel && (h("label", { key: 'd05a4a8fe5362b2b0a684f36115c127689c35c2f', htmlFor: this.trigger === 'input' ? this.componentId : undefined, id: this.labelId, class: "pds-combobox__label", onClick: this.onLabelClick }, this.label)), this.trigger === 'input' ? (h("div", { class: "pds-combobox__input-wrapper", style: { width: this.triggerWidth } }, h("input", { ref: el => {
4182
+ return (h(Host, { key: 'c3bda161c67bab75f306c7f38435d279e5a88756', "aria-disabled": this.disabled ? 'true' : null }, h("div", { key: '92b3f83c14a7296b3b2671eaef538a15743f695f', class: "pds-combobox", tabIndex: -1, onFocusout: this.onComboboxFocusOut, part: "combobox" }, this.hasVisibleLabel && (h("label", { key: '4a2dba09dd6db9893e21346b861b4c6cb891112b', htmlFor: this.trigger === 'input' ? this.componentId : undefined, id: this.labelId, class: "pds-combobox__label", onClick: this.onLabelClick }, this.label)), this.trigger === 'input' ? (h("div", { class: "pds-combobox__input-wrapper", style: { width: this.triggerWidth } }, h("input", { ref: el => {
4156
4183
  this.inputEl = el;
4157
4184
  this.triggerEl = el;
4158
4185
  }, class: {
4159
4186
  'pds-combobox__input': true,
4160
4187
  'pds-combobox__input--invalid': this.isInvalid(),
4161
- }, type: "text", role: "combobox", "aria-autocomplete": "list", "aria-haspopup": this.inputPopupRole === 'tree' ? 'tree' : undefined, "aria-controls": this.listboxId, "aria-describedby": assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-activedescendant": this.usesPanelSearch ? undefined : this.activeDescendantId, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.hideLabel ? this.label : undefined, id: this.componentId, value: this.displayText, placeholder: this.placeholder, disabled: this.disabled, onInput: this.handleInput, onClick: this.handleInputClick, onKeyDown: this.handleKeyDown, autocomplete: "off", part: "input" }), h("pds-icon", { icon: "enlarge", "aria-hidden": "true", class: "pds-combobox__input-icon" }))) : this.trigger === 'chip' ? (h("div", { class: this.getChipTriggerClass(), style: { width: this.triggerWidth }, role: this.usesPanelSearch ? 'button' : 'combobox', "aria-haspopup": this.triggerPopupRole, "aria-controls": this.listboxId, "aria-describedby": assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-activedescendant": this.usesPanelSearch ? undefined : this.activeDescendantId, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.triggerAriaLabel, "aria-labelledby": this.triggerLabelledBy, id: this.componentId, tabIndex: this.disabled ? -1 : 0, onClick: this.onButtonTriggerClick, "data-layout": this.customTriggerContent, onKeyDown: this.onButtonTriggerKeyDown, onKeyUp: this.onButtonTriggerKeyUp, ref: el => (this.triggerEl = el), part: "chip-trigger" }, this.renderChipTriggerContent())) : (h("div", { class: triggerClass, style: { width: this.triggerWidth }, role: this.usesPanelSearch ? 'button' : 'combobox', "aria-haspopup": this.triggerPopupRole, "aria-controls": this.listboxId, "aria-describedby": assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-activedescendant": this.usesPanelSearch ? undefined : this.activeDescendantId, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.triggerAriaLabel, "aria-labelledby": this.triggerLabelledBy, id: this.componentId, tabIndex: this.disabled ? -1 : 0, onClick: this.onButtonTriggerClick, "data-layout": this.customTriggerContent, onKeyDown: this.onButtonTriggerKeyDown, onKeyUp: this.onButtonTriggerKeyUp, ref: el => (this.triggerEl = el), part: "button-trigger" }, this.renderButtonTriggerContent())), this.renderMessages(), h("div", { key: '38d9c018d59472ef8b7eb3facb47bea5c73f5f1e', style: { display: 'none' } }, h("slot", { key: '26acb32e5f301b568485d52e29b68e526ef1d525', onSlotchange: () => this.updateOptions() })), this.renderDropdown(), this.groupDisplay !== 'inline' && [
4188
+ }, type: "text", role: "combobox", "aria-autocomplete": "list", "aria-haspopup": this.inputPopupRole === 'tree' ? 'tree' : undefined, "aria-controls": this.listboxId, "aria-describedby": assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-activedescendant": this.usesPanelSearch ? undefined : this.activeDescendantId, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.hideLabel ? this.label : undefined, id: this.componentId, value: this.displayText, placeholder: this.placeholder, disabled: this.disabled, onInput: this.handleInput, onClick: this.handleInputClick, onKeyDown: this.handleKeyDown, autocomplete: "off", part: "input" }), h("pds-icon", { icon: "enlarge", "aria-hidden": "true", class: "pds-combobox__input-icon" }))) : this.trigger === 'chip' ? (h("div", { class: this.getChipTriggerClass(), style: { width: this.triggerWidth }, role: this.usesPanelSearch ? 'button' : 'combobox', "aria-haspopup": this.triggerPopupRole, "aria-controls": this.listboxId, "aria-describedby": assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-activedescendant": this.usesPanelSearch ? undefined : this.activeDescendantId, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.triggerAriaLabel, "aria-labelledby": this.triggerLabelledBy, id: this.componentId, tabIndex: this.disabled ? -1 : 0, onClick: this.onButtonTriggerClick, "data-layout": this.customTriggerContent, onKeyDown: this.onButtonTriggerKeyDown, onKeyUp: this.onButtonTriggerKeyUp, ref: el => (this.triggerEl = el), part: "chip-trigger" }, this.renderChipTriggerContent())) : (h("div", { class: triggerClass, style: { width: this.triggerWidth }, role: this.usesPanelSearch ? 'button' : 'combobox', "aria-haspopup": this.triggerPopupRole, "aria-controls": this.listboxId, "aria-describedby": assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-activedescendant": this.usesPanelSearch ? undefined : this.activeDescendantId, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.triggerAriaLabel, "aria-labelledby": this.triggerLabelledBy, id: this.componentId, tabIndex: this.disabled ? -1 : 0, onClick: this.onButtonTriggerClick, "data-layout": this.customTriggerContent, onKeyDown: this.onButtonTriggerKeyDown, onKeyUp: this.onButtonTriggerKeyUp, ref: el => (this.triggerEl = el), part: "button-trigger" }, this.renderButtonTriggerContent())), this.renderMessages(), h("div", { key: 'b8d358339bb26037b6c3c464bd4e13fe978f7857', style: { display: 'none' } }, h("slot", { key: '4aa4c2b8f2b57e13d1e958cc745c61e39e800529', onSlotchange: () => this.updateOptions() })), this.renderDropdown(), this.groupDisplay !== 'inline' && [
4162
4189
  h("span", { key: "drill-status", class: "visually-hidden", role: "status", "aria-live": "polite" }, this.isOpen && this.effectiveGroupDisplay === 'drill-in' && this.openGroup !== null ? this.openGroup.label : ''),
4163
4190
  // Its own region: sharing one, revealing a row then opening it would leave the text the
4164
4191
  // same, and opening the group would go unannounced.
@@ -4177,6 +4204,9 @@ const PdsCombobox = class {
4177
4204
  "flyoutFallback": [{
4178
4205
  "flyoutFallbackChanged": 0
4179
4206
  }],
4207
+ "disabled": [{
4208
+ "disabledChanged": 0
4209
+ }],
4180
4210
  "isOpen": [{
4181
4211
  "isOpenChanged": 0
4182
4212
  }],
@@ -3,10 +3,11 @@ import { c as containsComposed, a as closest } from './closest-DHPzKMVS.js';
3
3
  import { u as unwrapReconnectedContent } from './reconnected-content-RFpTWV6r.js';
4
4
  import './keep-hydrated-BLG6RDBt.js';
5
5
 
6
- const pdsDrawerCss = () => `.pds-drawer__modal>.pds-modal__backdrop{-ms-flex-align:stretch;align-items:stretch;background-color:transparent;pointer-events:none}@supports ((-webkit-backdrop-filter: blur(3px)) or (backdrop-filter: blur(3px))){.pds-drawer__modal>.pds-modal__backdrop{-webkit-backdrop-filter:none;backdrop-filter:none}}.pds-drawer__modal>.pds-modal__backdrop[aria-modal]::before{content:none}.pds-drawer__modal>.pds-modal__backdrop>.pds-modal{border-radius:0;height:100%;margin:0;max-height:100%;max-width:100%;pointer-events:auto;width:var(--pds-drawer-width, 500px)}.pds-drawer{display:contents}.pds-drawer.pds-drawer--end .pds-drawer__modal>.pds-modal__backdrop{-ms-flex-pack:end;justify-content:flex-end}.pds-drawer.pds-drawer--start .pds-drawer__modal>.pds-modal__backdrop{-ms-flex-pack:start;justify-content:flex-start}.pds-drawer.pds-drawer--sm{--pds-drawer-width:360px}.pds-drawer.pds-drawer--md{--pds-drawer-width:500px}`;
6
+ const pdsDrawerCss = () => `.pds-drawer__modal>.pds-modal__backdrop{-ms-flex-align:stretch;align-items:stretch}.pds-drawer__modal:not(.pds-drawer__modal--modal)>.pds-modal__backdrop{background-color:transparent;pointer-events:none}@supports ((-webkit-backdrop-filter: blur(3px)) or (backdrop-filter: blur(3px))){.pds-drawer__modal:not(.pds-drawer__modal--modal)>.pds-modal__backdrop{-webkit-backdrop-filter:none;backdrop-filter:none}}.pds-drawer__modal>.pds-modal__backdrop[aria-modal]::before{content:none}.pds-drawer__modal>.pds-modal__backdrop>.pds-modal{border-radius:0;height:100%;margin:0;max-height:100%;max-width:100%;pointer-events:auto;width:var(--pds-drawer-width, 500px)}.pds-drawer{display:contents}.pds-drawer.pds-drawer--end .pds-drawer__modal>.pds-modal__backdrop{-ms-flex-pack:end;justify-content:flex-end}.pds-drawer.pds-drawer--start .pds-drawer__modal>.pds-modal__backdrop{-ms-flex-pack:start;justify-content:flex-start}.pds-drawer.pds-drawer--sm{--pds-drawer-width:360px}.pds-drawer.pds-drawer--md{--pds-drawer-width:500px}`;
7
7
 
8
- // Known selectors for content Pine components portal to document.body rather
9
- // than rendering in place — pds-popover, pds-tooltip, pds-combobox's dropdown.
8
+ // Known selectors for content Pine components portal out of place rather than
9
+ // rendering where they are — pds-tooltip and pds-combobox's dropdown in
10
+ // document.body, pds-popover in the body or the open dialog it's in.
10
11
  // A pointerdown landing on one of these is not "outside" the drawer in the
11
12
  // sense light dismiss cares about: it belongs to an overlay something inside
12
13
  // the drawer opened, even though it is not a DOM descendant of the drawer.
@@ -38,8 +39,18 @@ const PdsDrawer = class {
38
39
  */
39
40
  this.scrollable = true;
40
41
  /**
41
- * Whether the drawer can be dismissed with a pointerdown outside it.
42
- * Replaces `pds-modal`'s `backdropDismiss` — there is no backdrop to click.
42
+ * Whether the drawer is modal. A modal drawer dims the page behind it with a
43
+ * backdrop, makes the page inert, and keeps focus inside the drawer, like
44
+ * `pds-modal`. Use it for a task the page should wait on. Leave it off for a
45
+ * panel people work alongside the page. Read when the drawer opens; changing
46
+ * it while the drawer is open is not supported.
47
+ * @default false
48
+ */
49
+ this.modal = false;
50
+ /**
51
+ * Whether the drawer can be dismissed with a pointerdown outside it (in a
52
+ * `modal` drawer, a click on its backdrop).
53
+ * Replaces `pds-modal`'s `backdropDismiss`.
43
54
  * This also gates Escape, matching how `backdropDismiss` gates Escape on
44
55
  * `pds-modal` today: setting this to `false` means the close button is the
45
56
  * only way out.
@@ -58,7 +69,8 @@ const PdsDrawer = class {
58
69
  * background event while the user is mid-task elsewhere on the page —
59
70
  * moving focus there would interrupt them, and the page stays live under
60
71
  * a non-modal drawer, so it is a genuine data-entry risk, not just an
61
- * annoyance.
72
+ * annoyance. A `modal` drawer ignores `none`: the page behind it is inert,
73
+ * so focus starts in the drawer.
62
74
  * @default 'auto'
63
75
  */
64
76
  this.initialFocus = 'auto';
@@ -104,7 +116,8 @@ const PdsDrawer = class {
104
116
  // page underneath stays genuinely clickable, which means a click there
105
117
  // never reaches pds-modal's backdrop element at all.
106
118
  handleOutsidePointerDown(e) {
107
- if (!this.lightDismiss || !this.open)
119
+ // A modal drawer's backdrop takes the click instead, through pds-modal.
120
+ if (this.modal || !this.lightDismiss || !this.open)
108
121
  return;
109
122
  const target = e.target;
110
123
  if (!target)
@@ -114,7 +127,7 @@ const PdsDrawer = class {
114
127
  if (target.closest(PORTALED_OVERLAY_SELECTOR))
115
128
  return;
116
129
  // A datepicker's portaled calendar counts as inside only when its datepicker is in the drawer,
117
- // or in an overlay portaled from it (a pds-popover in the drawer puts its content on the body).
130
+ // or in an overlay portaled from it (a pds-popover in the drawer puts its content beside it).
118
131
  const calendar = target.closest('.pds-datepicker-calendar-portal');
119
132
  const owner = calendar === null || calendar === void 0 ? void 0 : calendar.pdsDatepicker;
120
133
  if (owner && (containsComposed(this.el, owner) || closest(PORTALED_OVERLAY_SELECTOR, owner)))
@@ -130,11 +143,11 @@ const PdsDrawer = class {
130
143
  this.open = false;
131
144
  }
132
145
  render() {
133
- return (h(Host, { key: 'ae7e67ed196ef95a39c2b729e859712ce5c41144', class: {
146
+ return (h(Host, { key: '287bf043c991209488eb1b617031acffb59ff9af', class: {
134
147
  'pds-drawer': true,
135
148
  [`pds-drawer--${this.side}`]: true,
136
149
  [`pds-drawer--${this.size}`]: true,
137
- } }, h("pds-modal", { key: '9b35ce377c84612a844a561d5540e98b08c0e499', class: "pds-drawer__modal", ref: (el) => (this.modalEl = el), componentId: this.componentId, open: this.open, scrollable: this.scrollable, disableTopLayer: true, backdropDismiss: this.lightDismiss, disableInitialFocus: this.initialFocus === 'none' }, h("slot", { key: 'dda01aa40dc41b3d17073238a8cad8d816571e18' }))));
150
+ } }, h("pds-modal", { key: 'cd86fb552353f5cc12fb36fc956033432a91847c', class: { 'pds-drawer__modal': true, 'pds-drawer__modal--modal': this.modal }, ref: (el) => (this.modalEl = el), componentId: this.componentId, open: this.open, scrollable: this.scrollable, disableTopLayer: !this.modal, backdropDismiss: this.lightDismiss, disableInitialFocus: !this.modal && this.initialFocus === 'none' }, h("slot", { key: '56bbe9b5c26b10b07c0f503ba147899a57a5de85' }))));
138
151
  }
139
152
  get el() { return getElement(this); }
140
153
  };
@@ -253,15 +253,19 @@ const PdsDropdownMenu = class {
253
253
  this.focusItemByIndex(prevIndex);
254
254
  }
255
255
  }
256
+ // Escape is taken in document's capture phase, before a modal around the menu hears it on
257
+ // document and closes too.
258
+ handleEscapeKeyDown(event) {
259
+ if (!this.isOpen || event.key !== 'Escape' || event.defaultPrevented)
260
+ return;
261
+ event.preventDefault();
262
+ this.closeDropdown();
263
+ }
256
264
  // Handle keyboard events for the dropdown
257
265
  handleKeyDown(event) {
258
266
  if (!this.isOpen)
259
267
  return;
260
268
  switch (event.key) {
261
- case 'Escape':
262
- event.preventDefault();
263
- this.closeDropdown();
264
- break;
265
269
  case 'ArrowDown':
266
270
  event.preventDefault();
267
271
  this.focusNextItem();
@@ -353,7 +357,7 @@ const PdsDropdownMenu = class {
353
357
  }
354
358
  }
355
359
  render() {
356
- return (h(Host, { key: '0dd585168e8fa86378c4812ce54fd09108861d5b', id: this.componentId }, h("slot", { key: 'c7144f8d6aaebe37b585c6c6230102c013230a9e', name: "trigger", onSlotchange: this.handleTriggerSlotChange }), h("pds-box", { key: '82292e051337141bc9fd83b90292b188b0bb3489', "border-radius": "sm", display: "flex", direction: "column", class: "pds-dropdown-menu--panel is-hidden", shadow: "100", part: "menu-panel" }, h("div", { key: 'c0f49dca14df0ba3885865c51562c380155bf8a8', class: { 'pds-dropdown-menu__header': true, 'is-hidden': !this.hasHeader } }, h("slot", { key: 'dc80c97a8dbb79ab4563524b3dea68d144e8570c', name: "header", onSlotchange: this.handleHeaderSlotChange })), h("div", { key: '29cb56bdf28a0438296f33e0fa86c9da7b51902c', class: "pds-dropdown-menu__items", role: "menu", "aria-orientation": "vertical" }, h("slot", { key: '8f91ceeb1eedc4acc79f09032dedc69a2ba1f99a', onSlotchange: this.handleSlotChange })))));
360
+ return (h(Host, { key: '18dac4d59ea236fe171f4c16f6571cb1547059c6', id: this.componentId }, h("slot", { key: '95201a75a33ccb70dbd51a5cf9d78c76ebf26f65', name: "trigger", onSlotchange: this.handleTriggerSlotChange }), h("pds-box", { key: '7fc588f40f607ad81ad70bf74a525d078d32a80b', "border-radius": "sm", display: "flex", direction: "column", class: "pds-dropdown-menu--panel is-hidden", shadow: "100", part: "menu-panel" }, h("div", { key: '73d13d94edccb68db7b703f930b50f729334efa8', class: { 'pds-dropdown-menu__header': true, 'is-hidden': !this.hasHeader } }, h("slot", { key: '7066f3a6f71c8961326f38f0509f1c0cc17098ae', name: "header", onSlotchange: this.handleHeaderSlotChange })), h("div", { key: '9f07ec488b688c58c6422b575015ccd364075fe8', class: "pds-dropdown-menu__items", role: "menu", "aria-orientation": "vertical" }, h("slot", { key: 'd0aad3f9ac3b58779669411523adbb8878dec61c', onSlotchange: this.handleSlotChange })))));
357
361
  }
358
362
  get host() { return getElement(this); }
359
363
  };
@@ -84,6 +84,34 @@ function containsComposed(ancestor, node) {
84
84
  }
85
85
  return false;
86
86
  }
87
+ /**
88
+ * Every open modal, with the order it opened in, which ranks top-layer modals and the modals
89
+ * inside them. Kept here rather than queried from the document, which can't see a modal inside
90
+ * another component's shadow root.
91
+ */
92
+ const openModals = new Map();
93
+ let openSequence = 0;
94
+ /** Whether an open auto popover's panel sits in `root`, including inside shadow roots under it. */
95
+ function hasOpenPopover(root) {
96
+ if (root.querySelector('[data-pds-popover-open]'))
97
+ return true;
98
+ return Array.from(root.querySelectorAll('*')).some(el => !!el.shadowRoot && hasOpenPopover(el.shadowRoot));
99
+ }
100
+ /**
101
+ * Whether `a` comes before `b` in the page. `compareDocumentPosition` is arbitrary across a shadow
102
+ * boundary, so each side climbs to its host until both are in the same tree.
103
+ */
104
+ function precedesComposed(a, b) {
105
+ // A document has no host, which ends each climb.
106
+ for (let x = a; x; x = x.getRootNode().host) {
107
+ for (let y = b; y; y = y.getRootNode().host) {
108
+ if (x.getRootNode() === y.getRootNode()) {
109
+ return !!(x.compareDocumentPosition(y) & Node.DOCUMENT_POSITION_FOLLOWING);
110
+ }
111
+ }
112
+ }
113
+ return false;
114
+ }
87
115
  /** The focused element, followed down through shadow roots to the control that has focus. */
88
116
  function deepActiveElement() {
89
117
  var _a;
@@ -99,7 +127,8 @@ const PdsModal = class {
99
127
  this.pdsModalClose = createEvent(this, "pdsModalClose");
100
128
  this.focusableElements = [];
101
129
  /**
102
- * Whether the modal can be dismissed by clicking the backdrop
130
+ * Whether the modal can be dismissed by clicking the backdrop, pressing Escape, or the browser's
131
+ * own close request (such as a back gesture)
103
132
  * @default true
104
133
  */
105
134
  this.backdropDismiss = true;
@@ -147,19 +176,33 @@ const PdsModal = class {
147
176
  * Stores the list of focusable elements in the modal
148
177
  */
149
178
  this.focusableElementsArray = [];
179
+ // The browser's own close request (an Escape nothing prevented, a back gesture) would close the
180
+ // dialog without updating `open`, so close it through hideModal() instead, or not at all.
181
+ this.handleCancel = (e) => {
182
+ e.preventDefault();
183
+ if (!this.open)
184
+ return;
185
+ // The request reaches the top-layer dialog even when a disableTopLayer modal inside it is on
186
+ // top; that one closes first, as it would on Escape.
187
+ const top = this.innermostOpenModal();
188
+ const target = (top && containsComposed(this.el, top) ? top : this.el);
189
+ if (target.backdropDismiss)
190
+ target.hideModal();
191
+ };
150
192
  this.handleBackdropClick = (e) => {
151
193
  if (!this.backdropDismiss || !this.open)
152
194
  return;
153
- if (e.target.classList.contains('pds-modal__backdrop')) {
195
+ // This modal's own backdrop; a nested modal's backdrop handles its own clicks.
196
+ if (e.target === this.modalRef) {
154
197
  e.stopPropagation();
155
198
  // Only close if this is the innermost modal
156
- if (this.isInnermostModal()) {
199
+ if (this.innermostOpenModal() === this.el) {
157
200
  this.hideModal();
158
201
  }
159
202
  }
160
203
  };
161
204
  this.handleKeyDown = (e) => {
162
- var _a, _b, _c;
205
+ var _a, _b, _c, _d;
163
206
  // If the modal is not open, don't handle any keyboard events
164
207
  if (!this.open)
165
208
  return;
@@ -182,24 +225,39 @@ const PdsModal = class {
182
225
  if (!('__pdsActiveElementAtEscape' in eventSnapshot)) {
183
226
  const activeAtDispatch = document.activeElement;
184
227
  eventSnapshot.__pdsActiveElementAtEscape = activeAtDispatch;
228
+ // Followed into shadow roots: for a modal inside one, document.activeElement is only the host.
229
+ eventSnapshot.__pdsDeepActiveElementAtEscape = deepActiveElement();
185
230
  const topLayerDialog = (_a = activeAtDispatch === null || activeAtDispatch === void 0 ? void 0 : activeAtDispatch.closest('dialog')) !== null && _a !== void 0 ? _a : null;
186
231
  eventSnapshot.__pdsTopLayerDialogAtEscape = topLayerDialog;
187
232
  eventSnapshot.__pdsTopLayerDialogWasModalAtEscape = !!(topLayerDialog && topLayerDialog.matches(':modal'));
233
+ // A control that closed on this Escape (a combobox on its own element, a dropdown menu or
234
+ // multiselect in document's capture phase) has prevented it before this bubble listener.
235
+ // Read before any modal prevents it below.
236
+ eventSnapshot.__pdsEscapeHandledInside = e.defaultPrevented;
237
+ // Which modal is innermost is read once too: the inner one closing first would make its
238
+ // outer modal the innermost by the time that modal's listener runs.
239
+ eventSnapshot.__pdsInnermostModalAtEscape = this.innermostOpenModal();
188
240
  }
241
+ if (eventSnapshot.__pdsEscapeHandledInside)
242
+ return;
189
243
  // Leave Escape to a genuinely stacked-above overlay (disableTopLayer's
190
244
  // reason for existing) — not just to anything outside this modal.
191
245
  const active = eventSnapshot.__pdsActiveElementAtEscape;
192
246
  if (this.disableTopLayer &&
193
247
  active &&
194
248
  active !== document.body &&
195
- !this.el.contains(active) &&
196
- this.isStackedAboveOverlay(active, (_b = eventSnapshot.__pdsTopLayerDialogAtEscape) !== null && _b !== void 0 ? _b : null, (_c = eventSnapshot.__pdsTopLayerDialogWasModalAtEscape) !== null && _c !== void 0 ? _c : false)) {
249
+ !containsComposed(this.el, (_b = eventSnapshot.__pdsDeepActiveElementAtEscape) !== null && _b !== void 0 ? _b : active) &&
250
+ this.isStackedAboveOverlay(active, (_c = eventSnapshot.__pdsTopLayerDialogAtEscape) !== null && _c !== void 0 ? _c : null, (_d = eventSnapshot.__pdsTopLayerDialogWasModalAtEscape) !== null && _d !== void 0 ? _d : false)) {
197
251
  return;
198
252
  }
253
+ // An open popover inside takes Escape from its own document listener, which runs after this
254
+ // one, so leave the key for it. Its preventDefault() keeps the native dialog open.
255
+ if (this.modalRef && hasOpenPopover(this.modalRef))
256
+ return;
199
257
  // Always prevent native dialog close behavior
200
258
  e.preventDefault();
201
259
  // Only close if backdropDismiss is enabled and this is the innermost modal
202
- if (this.backdropDismiss && this.isInnermostModal()) {
260
+ if (this.backdropDismiss && eventSnapshot.__pdsInnermostModalAtEscape === this.el) {
203
261
  this.hideModal();
204
262
  }
205
263
  return;
@@ -259,8 +317,6 @@ const PdsModal = class {
259
317
  }
260
318
  componentDidLoad() {
261
319
  this.modalRef = this.el.querySelector('.pds-modal__backdrop');
262
- // Add keyboard event listener
263
- document.addEventListener('keydown', this.handleKeyDown);
264
320
  // @Watch('open') only fires on a later change, not the prop's initial
265
321
  // value — a modal mounted with `open` already true (static markup, or a
266
322
  // framework passing it on first render) would otherwise never call
@@ -276,9 +332,18 @@ const PdsModal = class {
276
332
  componentDidRender() {
277
333
  unwrapReconnectedContent(this.el.querySelector('.pds-modal'), 'dialog.pds-modal__backdrop', '.pds-modal');
278
334
  }
335
+ // Here rather than in componentDidLoad, which runs once: a modal taken out of the page and put
336
+ // back (a morph or a framework moving it) gets its keyboard handling, and its place among the
337
+ // open modals, back too. Adding the same listener twice is a no-op.
338
+ connectedCallback() {
339
+ document.addEventListener('keydown', this.handleKeyDown);
340
+ if (this.open && !openModals.has(this.el))
341
+ openModals.set(this.el, ++openSequence);
342
+ }
279
343
  disconnectedCallback() {
280
344
  // Clean up event listener
281
345
  document.removeEventListener('keydown', this.handleKeyDown);
346
+ openModals.delete(this.el);
282
347
  }
283
348
  handleOpenChange(newValue) {
284
349
  if (newValue) {
@@ -343,6 +408,9 @@ const PdsModal = class {
343
408
  this.modalRef.showModal();
344
409
  }
345
410
  this.open = true;
411
+ // Showing an open modal again doesn't move it above one opened after it.
412
+ if (!openModals.has(this.el))
413
+ openModals.set(this.el, ++openSequence);
346
414
  // Update focusable elements and set initial focus
347
415
  // Using a longer timeout to ensure all components are fully rendered
348
416
  setTimeout(() => {
@@ -405,6 +473,7 @@ const PdsModal = class {
405
473
  const focusAlreadyMovedElsewhere = activeElement !== null && activeElement !== document.body && !this.modalRef.contains(activeElement);
406
474
  this.modalRef.close();
407
475
  this.open = false;
476
+ openModals.delete(this.el);
408
477
  // Restore focus to the element that was focused before the modal was opened
409
478
  if (!focusAlreadyMovedElsewhere &&
410
479
  this.previousActiveElement &&
@@ -423,7 +492,9 @@ const PdsModal = class {
423
492
  */
424
493
  getBackdropZIndex(modal) {
425
494
  const backdrop = modal.querySelector('.pds-modal__backdrop');
426
- return backdrop ? parseInt(getComputedStyle(backdrop).zIndex, 10) : -1;
495
+ // `auto` (no z-index token loaded) parses to NaN, which no comparison can rank.
496
+ const zIndex = backdrop ? parseInt(getComputedStyle(backdrop).zIndex, 10) : -1;
497
+ return Number.isNaN(zIndex) ? 0 : zIndex;
427
498
  }
428
499
  /**
429
500
  * Whether `active` sits inside a surface actually stacked above this modal.
@@ -450,7 +521,8 @@ const PdsModal = class {
450
521
  * lose that evidence depending on listener order.
451
522
  */
452
523
  isStackedAboveOverlay(active, topLayerDialog, topLayerDialogWasModal) {
453
- if (topLayerDialog && topLayerDialog !== this.modalRef && topLayerDialogWasModal) {
524
+ // A top-layer dialog this modal sits inside is underneath it, not an overlay above.
525
+ if (topLayerDialog && topLayerDialog !== this.modalRef && topLayerDialogWasModal && !containsComposed(topLayerDialog, this.el)) {
454
526
  return true;
455
527
  }
456
528
  const ownZIndex = this.getBackdropZIndex(this.el);
@@ -466,24 +538,37 @@ const PdsModal = class {
466
538
  return false;
467
539
  }
468
540
  /**
469
- * Checks if this modal is the innermost (highest z-index) modal
541
+ * The open modal that takes Escape or a backdrop click, among those with no other open modal
542
+ * inside them (a nested modal's backdrop can share its outer modal's z-index). A top-layer dialog
543
+ * (or a modal inside one) paints above anything outside it, and within the top layer the last
544
+ * opened is on top. Modals in the same layer (the page, or one top-layer dialog) then rank by
545
+ * the highest backdrop, then the one later in the page.
470
546
  */
471
- isInnermostModal() {
472
- // Find all open modals
473
- const openModals = Array.from(document.querySelectorAll('pds-modal')).filter(modal => modal.open);
474
- if (openModals.length === 0)
475
- return false;
476
- // Get this modal's backdrop element
477
- const thisBackdrop = this.el.querySelector('.pds-modal__backdrop');
478
- if (!thisBackdrop)
479
- return false;
480
- // Get computed z-index of all open modal backdrops
481
- const modalZIndexes = openModals.map(modal => this.getBackdropZIndex(modal));
482
- // Get the highest z-index
483
- const maxZIndex = Math.max(...modalZIndexes);
484
- // Check if this modal's backdrop has the highest z-index
485
- const thisZIndex = this.getBackdropZIndex(this.el);
486
- return thisZIndex === maxZIndex;
547
+ innermostOpenModal() {
548
+ const open = Array.from(openModals.keys()).filter(modal => modal.isConnected);
549
+ const innermost = open.filter(modal => !open.some(other => other !== modal && containsComposed(modal, other)));
550
+ const byDocumentOrder = [...innermost].sort((a, b) => (precedesComposed(a, b) ? -1 : 1));
551
+ // A modal inside a top-layer dialog paints in that dialog's place in the top layer, even when it
552
+ // isn't in the top layer itself (disableTopLayer), so that dialog's open order ranks it first.
553
+ const rank = (modal) => {
554
+ var _a;
555
+ const backdrop = modal.querySelector('.pds-modal__backdrop');
556
+ const topLayerDialog = backdrop ? closest('dialog:modal', backdrop) : null;
557
+ const topLayerModal = topLayerDialog === null || topLayerDialog === void 0 ? void 0 : topLayerDialog.closest('pds-modal');
558
+ const layer = topLayerDialog ? ((_a = (topLayerModal && openModals.get(topLayerModal))) !== null && _a !== void 0 ? _a : 0) : 0;
559
+ return [topLayerDialog ? 1 : 0, layer, this.getBackdropZIndex(modal), byDocumentOrder.indexOf(modal)];
560
+ };
561
+ let top = null;
562
+ let topRank = [-1, -1, -1, -1];
563
+ for (const modal of innermost) {
564
+ const modalRank = rank(modal);
565
+ const above = modalRank.findIndex((value, i) => value !== topRank[i]);
566
+ if (above >= 0 && modalRank[above] > topRank[above]) {
567
+ top = modal;
568
+ topRank = modalRank;
569
+ }
570
+ }
571
+ return top;
487
572
  }
488
573
  /** Whether a modal dialog other than this one sits between the focused element and this modal. */
489
574
  modalDialogAbove(active) {
@@ -523,14 +608,14 @@ const PdsModal = class {
523
608
  }
524
609
  render() {
525
610
  const [sizeClass = 'md', customSize] = this.resolveSize();
526
- return (h("dialog", { key: '12ea38928ea287f16ffa33e246caa2bfde6fc130', class: {
611
+ return (h("dialog", { key: '0633d4e8a7cb81f2f9280e754564960a00a4d60b', class: {
527
612
  'pds-modal__backdrop': true,
528
613
  'open': this.open
529
- }, "aria-modal": this.disableTopLayer ? 'false' : 'true', "aria-labelledby": `${this.componentId}-heading`, onClick: this.handleBackdropClick }, h("div", { key: 'b9d83cabda56c315d9115f7030e3bdbcf923ec08', class: {
614
+ }, "aria-modal": this.disableTopLayer ? 'false' : 'true', "aria-labelledby": `${this.componentId}-heading`, onClick: this.handleBackdropClick, onCancel: this.handleCancel }, h("div", { key: '466f8a3476cf066817554f47ec7d3a0e3ab10b89', class: {
530
615
  'pds-modal': true,
531
616
  [`pds-modal--${sizeClass}`]: true,
532
617
  'pds-modal--scrollable': this.scrollable
533
- }, style: customSize !== undefined ? { '--pds-modal-max-width': customSize } : undefined, part: "modal" }, h("slot", { key: '3c5edad1482cb124e503197adf411890573b076d' }))));
618
+ }, style: customSize !== undefined ? { '--pds-modal-max-width': customSize } : undefined, part: "modal" }, h("slot", { key: '01ca45c96540416216a1082bad52b137720f0f4d' }))));
534
619
  }
535
620
  get el() { return getElement(this); }
536
621
  static get watchers() { return {
@@ -537,11 +537,12 @@ const PdsMultiselect = class {
537
537
  }
538
538
  /**
539
539
  * Handle global keyboard events for accessibility.
540
- * Closes dropdown on Escape key press regardless of focus location.
540
+ * Closes dropdown on Escape key press regardless of focus location. Taken in document's capture
541
+ * phase, before a modal around the multiselect hears it on document and closes too.
541
542
  */
542
543
  handleWindowKeyDown(event) {
543
544
  var _a;
544
- if (!this.isOpen)
545
+ if (!this.isOpen || event.defaultPrevented)
545
546
  return;
546
547
  if (event.key === 'Escape') {
547
548
  event.preventDefault();
@@ -1231,10 +1232,10 @@ const PdsMultiselect = class {
1231
1232
  }
1232
1233
  render() {
1233
1234
  const hasSelections = this.selectedItems.length > 0;
1234
- return (h(Host, { key: '0ef6791666063e0d951d28f980b3bca89cf24287', "aria-disabled": this.disabled ? 'true' : null }, h("div", { key: 'f0ccbabfbd2dcf38f6df52f73f2152eb4bd2828e', class: "pds-multiselect", onFocusout: this.handleContainerFocusOut }, this.label && (h("label", { key: '88e01c744644ce1f75c8d5b71dfaeeb79d1ef7df', id: `${this.componentId}-label`, htmlFor: this.componentId, class: {
1235
+ return (h(Host, { key: 'fcc35a82c16d5cf35a49ce997f19618104f9cc45', "aria-disabled": this.disabled ? 'true' : null }, h("div", { key: '72d1fdf759d9173f54bac80ec50aff651fd2b357', class: "pds-multiselect", onFocusout: this.handleContainerFocusOut }, this.label && (h("label", { key: 'e28f02c2beb23dc2c0deefadbd0645b20d938d91', id: `${this.componentId}-label`, htmlFor: this.componentId, class: {
1235
1236
  'pds-multiselect__label': true,
1236
1237
  'visually-hidden': this.hideLabel,
1237
- } }, this.label)), h("div", { key: '0bf4a3b1378ff18e6d6b449507ebbae1bfb279e4', class: "pds-multiselect__wrapper", ref: el => (this.containerEl = el), style: { width: this.triggerWidth } }, this.slottedTriggerEl ? (h("slot", { name: "trigger" })) : this.selectedDisplay === 'pill' && this.pillPosition === 'inline' ? (h("div", { ref: el => (this.pillInlineTriggerEl = el || undefined), part: "trigger", class: {
1238
+ } }, this.label)), h("div", { key: '06539bf2c4b8da2889505a9f042d5cd6721b1853', class: "pds-multiselect__wrapper", ref: el => (this.containerEl = el), style: { width: this.triggerWidth } }, this.slottedTriggerEl ? (h("slot", { name: "trigger" })) : this.selectedDisplay === 'pill' && this.pillPosition === 'inline' ? (h("div", { ref: el => (this.pillInlineTriggerEl = el || undefined), part: "trigger", class: {
1238
1239
  'pds-multiselect__trigger': true,
1239
1240
  'pds-multiselect__trigger--open': this.isOpen,
1240
1241
  'pds-multiselect__trigger--disabled': this.disabled,
@@ -1250,7 +1251,7 @@ const PdsMultiselect = class {
1250
1251
  }, id: this.componentId, disabled: this.disabled, "aria-required": this.required ? 'true' : undefined, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-haspopup": "listbox", "aria-describedby": assignDescription(this.componentId, this.invalid || !!this.errorMessage, this.helperMessage, this.errorMessage), "aria-invalid": this.invalid || !!this.errorMessage ? 'true' : undefined, onClick: this.handleTriggerClick, onKeyDown: this.handleTriggerKeyDown }, h("span", { class: {
1251
1252
  'pds-multiselect__trigger-text': true,
1252
1253
  'pds-multiselect__trigger-text--placeholder': !hasSelections || (this.selectedDisplay === 'pill' && this.pillPosition === 'below'),
1253
- } }, this.getTriggerText()), h("pds-icon", { "aria-hidden": "true", class: "pds-multiselect__icon", icon: enlarge }))), this.renderDropdown()), this.selectedDisplay === 'pill' && this.pillPosition === 'below' && this.renderBelowPills(), h("span", { key: '5202a263b219d06891bda739f98db0162bf33c48', class: "visually-hidden", "aria-live": "polite", "aria-atomic": "true" }, this.removalAnnouncement), this.helperMessage && !(this.errorMessage && this.errorMessage.length > 0) && (h("p", { key: '47f7b55863c5b72d41c4ef1893b9364988fc0b56', class: "pds-multiselect__helper", id: messageId(this.componentId, 'helper') }, this.helperMessage)), this.errorMessage && (h("p", { key: '3930dc30b2df7179d178873c470aa1da0f6f258c', class: "pds-multiselect__error", id: messageId(this.componentId, 'error') }, h("pds-icon", { key: 'e31d55db3fd0173c56faa23e34e0be92371983d4', icon: danger, size: "small" }), this.errorMessage)), h("div", { key: 'b3326cc1a5e5886be05327a066e0a7ddd36ccefc', style: { display: 'none' } }, h("slot", { key: '91559cb9510abce6084348a17516460fd8545ef7' })))));
1254
+ } }, this.getTriggerText()), h("pds-icon", { "aria-hidden": "true", class: "pds-multiselect__icon", icon: enlarge }))), this.renderDropdown()), this.selectedDisplay === 'pill' && this.pillPosition === 'below' && this.renderBelowPills(), h("span", { key: '3364fc00bc744fcd599436a9cb6dc563564d89d9', class: "visually-hidden", "aria-live": "polite", "aria-atomic": "true" }, this.removalAnnouncement), this.helperMessage && !(this.errorMessage && this.errorMessage.length > 0) && (h("p", { key: 'bf712c65b9acb66e2998a43686fed408fc1ff48a', class: "pds-multiselect__helper", id: messageId(this.componentId, 'helper') }, this.helperMessage)), this.errorMessage && (h("p", { key: 'b485db6c2c3ae312cce2b90db60e850ad6dfdcf5', class: "pds-multiselect__error", id: messageId(this.componentId, 'error') }, h("pds-icon", { key: '20daf861cf9584f33f5a9574e9581acc487e7dfe', icon: danger, size: "small" }), this.errorMessage)), h("div", { key: '018d333254771695a8c191f1cea40af6e78427a2', style: { display: 'none' } }, h("slot", { key: '2ef4a01fbe5d294a9ead5cc1183c28341834539b' })))));
1254
1255
  }
1255
1256
  static get formAssociated() { return true; }
1256
1257
  get el() { return getElement(this); }