@pine-ds/core 4.7.2 → 4.8.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.
- package/components/pds-avatar.js +1 -1
- package/components/pds-button2.js +1 -1
- package/components/pds-checkbox2.js +1 -1
- package/components/pds-chip2.js +1 -1
- package/components/pds-combobox.js +1 -1
- package/components/pds-dropdown-menu-item.js +1 -1
- package/components/pds-dropdown-menu.js +1 -1
- package/components/pds-modal-content.js +1 -1
- package/components/pds-modal2.js +1 -1
- package/components/pds-multiselect.js +1 -1
- package/components/pds-popover.js +1 -1
- package/components/pds-radio-group.js +1 -1
- package/components/pds-radio.js +1 -1
- package/components/pds-switch.js +1 -1
- package/components/pds-table-head-cell2.js +1 -1
- package/components/pds-textarea.js +1 -1
- package/components/pds-toast.js +1 -1
- package/components/truncation-tooltip.js +1 -1
- package/dist/cjs/{index-5Azb8EQG.js → index-Do70atou.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pds-accordion.cjs.entry.js +1 -1
- package/dist/cjs/pds-avatar.cjs.entry.js +3 -3
- package/dist/cjs/pds-button.cjs.entry.js +24 -21
- package/dist/cjs/pds-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/pds-chip.cjs.entry.js +4 -4
- package/dist/cjs/pds-combobox.cjs.entry.js +4 -4
- package/dist/cjs/pds-copytext.cjs.entry.js +2 -2
- package/dist/cjs/pds-datepicker.cjs.entry.js +1 -1
- package/dist/cjs/pds-dropdown-menu-item.cjs.entry.js +31 -2
- package/dist/cjs/pds-dropdown-menu.cjs.entry.js +4 -4
- package/dist/cjs/pds-filter.cjs.entry.js +1 -1
- package/dist/cjs/pds-input.cjs.entry.js +1 -1
- package/dist/cjs/pds-link.cjs.entry.js +1 -1
- package/dist/cjs/pds-modal-content.cjs.entry.js +32 -30
- package/dist/cjs/pds-modal.cjs.entry.js +4 -4
- package/dist/cjs/pds-multiselect.cjs.entry.js +6 -6
- package/dist/cjs/pds-popover.cjs.entry.js +187 -11
- package/dist/cjs/pds-radio-group.cjs.entry.js +2 -2
- package/dist/cjs/pds-radio.cjs.entry.js +3 -3
- package/dist/cjs/pds-select.cjs.entry.js +1 -1
- package/dist/cjs/pds-sortable-item.cjs.entry.js +1 -1
- package/dist/cjs/pds-switch.cjs.entry.js +2 -2
- package/dist/cjs/pds-table-cell.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-head-cell.cjs.entry.js +2 -2
- package/dist/cjs/pds-text.cjs.entry.js +1 -1
- package/dist/cjs/pds-textarea.cjs.entry.js +2 -2
- package/dist/cjs/pds-toast.cjs.entry.js +1 -1
- package/dist/cjs/pine-core.cjs.js +1 -1
- package/dist/cjs/{truncation-tooltip-DO9xli2e.js → truncation-tooltip-BtuiXLV0.js} +31 -6
- package/dist/collection/components/pds-avatar/pds-avatar.js +2 -2
- package/dist/collection/components/pds-button/pds-button.js +24 -22
- package/dist/collection/components/pds-button/stories/pds-button.stories.js +3 -3
- package/dist/collection/components/pds-checkbox/pds-checkbox.js +1 -1
- package/dist/collection/components/pds-chip/pds-chip.js +2 -2
- package/dist/collection/components/pds-combobox/pds-combobox.js +4 -4
- package/dist/collection/components/pds-datepicker/stories/pds-datepicker.stories.js +1 -1
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.css +8 -0
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.js +58 -6
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.js +4 -4
- package/dist/collection/components/pds-dropdown-menu/stories/pds-dropdown-menu.stories.js +39 -0
- package/dist/collection/components/pds-modal/pds-modal-content/pds-modal-content.js +32 -30
- package/dist/collection/components/pds-modal/pds-modal.js +4 -4
- package/dist/collection/components/pds-multiselect/pds-multiselect.js +5 -5
- package/dist/collection/components/pds-popover/pds-popover.js +240 -11
- package/dist/collection/components/pds-popover/stories/pds-popover.stories.js +31 -0
- package/dist/collection/components/pds-radio/pds-radio.js +2 -2
- package/dist/collection/components/pds-radio-group/pds-radio-group.js +1 -1
- package/dist/collection/components/pds-switch/pds-switch.js +1 -1
- package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js +1 -1
- package/dist/collection/components/pds-table/stories/pds-table.stories.js +1 -1
- package/dist/collection/components/pds-text/stories/pds-text.stories.js +1 -1
- package/dist/collection/components/pds-textarea/pds-textarea.js +1 -1
- package/dist/collection/components/pds-toast/pds-toast.js +1 -1
- package/dist/collection/utils/truncation-tooltip.js +31 -6
- package/dist/docs.json +124 -7
- package/dist/esm/{index-BJXk71tO.js → index-BWDu62Mo.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pds-accordion.entry.js +1 -1
- package/dist/esm/pds-avatar.entry.js +3 -3
- package/dist/esm/pds-button.entry.js +24 -21
- package/dist/esm/pds-checkbox.entry.js +2 -2
- package/dist/esm/pds-chip.entry.js +4 -4
- package/dist/esm/pds-combobox.entry.js +4 -4
- package/dist/esm/pds-copytext.entry.js +2 -2
- package/dist/esm/pds-datepicker.entry.js +1 -1
- package/dist/esm/pds-dropdown-menu-item.entry.js +31 -2
- package/dist/esm/pds-dropdown-menu.entry.js +4 -4
- package/dist/esm/pds-filter.entry.js +1 -1
- package/dist/esm/pds-input.entry.js +1 -1
- package/dist/esm/pds-link.entry.js +1 -1
- package/dist/esm/pds-modal-content.entry.js +32 -30
- package/dist/esm/pds-modal.entry.js +4 -4
- package/dist/esm/pds-multiselect.entry.js +6 -6
- package/dist/esm/pds-popover.entry.js +187 -11
- package/dist/esm/pds-radio-group.entry.js +2 -2
- package/dist/esm/pds-radio.entry.js +3 -3
- package/dist/esm/pds-select.entry.js +1 -1
- package/dist/esm/pds-sortable-item.entry.js +1 -1
- package/dist/esm/pds-switch.entry.js +2 -2
- package/dist/esm/pds-table-cell.entry.js +1 -1
- package/dist/esm/pds-table-head-cell.entry.js +2 -2
- package/dist/esm/pds-text.entry.js +1 -1
- package/dist/esm/pds-textarea.entry.js +2 -2
- package/dist/esm/pds-toast.entry.js +1 -1
- package/dist/esm/pine-core.js +1 -1
- package/dist/esm/{truncation-tooltip-DRXsdKk1.js → truncation-tooltip-FaW67DiY.js} +31 -6
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/pds-accordion.entry.js +1 -1
- package/dist/esm-es5/pds-avatar.entry.js +1 -1
- package/dist/esm-es5/pds-button.entry.js +1 -1
- package/dist/esm-es5/pds-checkbox.entry.js +1 -1
- package/dist/esm-es5/pds-chip.entry.js +1 -1
- package/dist/esm-es5/pds-combobox.entry.js +1 -1
- package/dist/esm-es5/pds-copytext.entry.js +1 -1
- package/dist/esm-es5/pds-datepicker.entry.js +1 -1
- package/dist/esm-es5/pds-dropdown-menu-item.entry.js +1 -1
- package/dist/esm-es5/pds-dropdown-menu.entry.js +1 -1
- package/dist/esm-es5/pds-filter.entry.js +1 -1
- package/dist/esm-es5/pds-input.entry.js +1 -1
- package/dist/esm-es5/pds-link.entry.js +1 -1
- package/dist/esm-es5/pds-modal-content.entry.js +1 -1
- package/dist/esm-es5/pds-modal.entry.js +1 -1
- package/dist/esm-es5/pds-multiselect.entry.js +1 -1
- package/dist/esm-es5/pds-popover.entry.js +1 -1
- package/dist/esm-es5/pds-radio-group.entry.js +1 -1
- package/dist/esm-es5/pds-radio.entry.js +1 -1
- package/dist/esm-es5/pds-select.entry.js +1 -1
- package/dist/esm-es5/pds-sortable-item.entry.js +1 -1
- package/dist/esm-es5/pds-switch.entry.js +1 -1
- package/dist/esm-es5/pds-table-cell.entry.js +1 -1
- package/dist/esm-es5/pds-table-head-cell.entry.js +1 -1
- package/dist/esm-es5/pds-text.entry.js +1 -1
- package/dist/esm-es5/pds-textarea.entry.js +1 -1
- package/dist/esm-es5/pds-toast.entry.js +1 -1
- package/dist/esm-es5/pine-core.js +1 -1
- package/dist/esm-es5/truncation-tooltip-FaW67DiY.js +1 -0
- package/dist/pine-core/{p-e836f3ec.system.entry.js → p-00a50de5.system.entry.js} +2 -2
- package/dist/pine-core/{p-1437585e.system.entry.js → p-047433a4.system.entry.js} +1 -1
- package/dist/pine-core/{p-7fa66cad.entry.js → p-089c3e60.entry.js} +1 -1
- package/dist/pine-core/{p-341c38f1.system.entry.js → p-0af0d752.system.entry.js} +1 -1
- package/dist/pine-core/{p-3a959459.system.entry.js → p-121612a7.system.entry.js} +1 -1
- package/dist/pine-core/{p-cde8eb81.entry.js → p-138b278b.entry.js} +1 -1
- package/dist/pine-core/{p-cfd012d4.entry.js → p-158b2f51.entry.js} +1 -1
- package/dist/pine-core/p-17f97f1a.entry.js +1 -0
- package/dist/pine-core/{p-5c90091e.system.entry.js → p-19ba2788.system.entry.js} +1 -1
- package/dist/pine-core/{p-355e4cf9.entry.js → p-25ea48d1.entry.js} +1 -1
- package/dist/pine-core/{p-c81d8ac8.entry.js → p-295f64ea.entry.js} +1 -1
- package/dist/pine-core/{p-576cf904.system.entry.js → p-29cd4113.system.entry.js} +1 -1
- package/dist/pine-core/{p-1ee86d87.system.entry.js → p-332590c7.system.entry.js} +1 -1
- package/dist/pine-core/p-36cb4bf6.entry.js +1 -0
- package/dist/pine-core/{p-080cb087.system.entry.js → p-3c977d8d.system.entry.js} +1 -1
- package/dist/pine-core/p-3d51891a.entry.js +1 -0
- package/dist/pine-core/{p-72865997.entry.js → p-44f546ae.entry.js} +1 -1
- package/dist/pine-core/{p-b60ac7eb.system.entry.js → p-4bfc8b3e.system.entry.js} +1 -1
- package/dist/pine-core/p-5833a072.system.entry.js +1 -0
- package/dist/pine-core/p-5cfd4d41.system.entry.js +1 -0
- package/dist/pine-core/{p-f2c253d8.entry.js → p-62433f32.entry.js} +1 -1
- package/dist/pine-core/{p-ebd0bff2.entry.js → p-631f5bcc.entry.js} +1 -1
- package/dist/pine-core/p-717323e4.entry.js +1 -0
- package/dist/pine-core/{p-e7a95a49.system.entry.js → p-719542e1.system.entry.js} +1 -1
- package/dist/pine-core/p-73f931a1.entry.js +1 -0
- package/dist/pine-core/{p-f77905aa.system.entry.js → p-884cb31d.system.entry.js} +1 -1
- package/dist/pine-core/{p-4435fff6.system.entry.js → p-8987fd45.system.entry.js} +1 -1
- package/dist/pine-core/{p-02088776.entry.js → p-8c588ca0.entry.js} +1 -1
- package/dist/pine-core/p-8e3ff75d.entry.js +1 -0
- package/dist/pine-core/{p-bd26a5e8.entry.js → p-90d5edc6.entry.js} +1 -1
- package/dist/pine-core/p-91f60173.entry.js +1 -0
- package/dist/pine-core/{p-258770cf.system.entry.js → p-9265497e.system.entry.js} +1 -1
- package/dist/pine-core/p-99fdf70f.entry.js +1 -0
- package/dist/pine-core/{p-0a84d220.entry.js → p-9aaedded.entry.js} +1 -1
- package/dist/pine-core/p-9df5e204.entry.js +1 -0
- package/dist/pine-core/p-CuSNnuFu.system.js +1 -1
- package/dist/pine-core/p-D04W0cAO.system.js +1 -0
- package/dist/pine-core/{p-6d603d16.system.entry.js → p-acca5f7b.system.entry.js} +1 -1
- package/dist/pine-core/{p-a19cd59c.entry.js → p-aff411d0.entry.js} +1 -1
- package/dist/pine-core/{p-bb73ad66.entry.js → p-b182f806.entry.js} +1 -1
- package/dist/pine-core/{p-01aa382c.system.entry.js → p-b9d145f8.system.entry.js} +1 -1
- package/dist/pine-core/p-bdac8f2b.entry.js +1 -0
- package/dist/pine-core/{p-aa032a5e.system.entry.js → p-be9b6e63.system.entry.js} +1 -1
- package/dist/pine-core/{p-ff3de72e.entry.js → p-c483997a.entry.js} +1 -1
- package/dist/pine-core/p-c4e12f0a.entry.js +1 -0
- package/dist/pine-core/{p-e8cb76e8.entry.js → p-c97bfac9.entry.js} +1 -1
- package/dist/pine-core/{p-bd67156b.system.entry.js → p-ca4ee736.system.entry.js} +1 -1
- package/dist/pine-core/p-cccfe60f.system.entry.js +1 -0
- package/dist/pine-core/{p-c5c9ed36.system.entry.js → p-d3d69ca4.system.entry.js} +1 -1
- package/dist/pine-core/{p-f0d24298.system.entry.js → p-ea340c55.system.entry.js} +1 -1
- package/dist/pine-core/{p-88ff1604.entry.js → p-ea8f5d29.entry.js} +1 -1
- package/dist/pine-core/{p-d8570b4b.system.entry.js → p-eaf85be6.system.entry.js} +1 -1
- package/dist/pine-core/{p-fc25b956.system.entry.js → p-ecc7a531.system.entry.js} +1 -1
- package/dist/pine-core/{p-cfc52b95.system.entry.js → p-ee0e30bf.system.entry.js} +1 -1
- package/dist/pine-core/{p-e803f629.system.entry.js → p-ef13f665.system.entry.js} +1 -1
- package/dist/pine-core/{p-97d0b89e.system.entry.js → p-f3067d90.system.entry.js} +1 -1
- package/dist/pine-core/{p-JtdHT_W5.js → p-jrkGLEPe.js} +1 -1
- package/dist/pine-core/pine-core.esm.js +1 -1
- package/dist/types/components/pds-button/pds-button.d.ts +3 -4
- package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.d.ts +13 -3
- package/dist/types/components/pds-modal/pds-modal-content/pds-modal-content.d.ts +2 -0
- package/dist/types/components/pds-popover/pds-popover.d.ts +43 -1
- package/dist/types/components.d.ts +43 -10
- package/dist/types/utils/truncation-tooltip.d.ts +4 -4
- package/dist/types/utils/types.d.ts +1 -0
- package/dist/vscode.html-data.json +50 -7
- package/hydrate/index.js +340 -103
- package/hydrate/index.mjs +340 -103
- package/package.json +2 -2
- package/dist/esm-es5/truncation-tooltip-DRXsdKk1.js +0 -1
- package/dist/pine-core/p-153ba77b.entry.js +0 -1
- package/dist/pine-core/p-645a482b.system.entry.js +0 -1
- package/dist/pine-core/p-7bf6563a.system.entry.js +0 -1
- package/dist/pine-core/p-80a698ae.entry.js +0 -1
- package/dist/pine-core/p-82cf4ec6.entry.js +0 -1
- package/dist/pine-core/p-8d292b48.entry.js +0 -1
- package/dist/pine-core/p-92ae6082.entry.js +0 -1
- package/dist/pine-core/p-993d1043.entry.js +0 -1
- package/dist/pine-core/p-a787b34a.system.entry.js +0 -1
- package/dist/pine-core/p-b69f04b7.entry.js +0 -1
- package/dist/pine-core/p-beb23781.entry.js +0 -1
- package/dist/pine-core/p-c36b490e.entry.js +0 -1
- package/dist/pine-core/p-ca0d48e8.entry.js +0 -1
- package/dist/pine-core/p-f474d7de.entry.js +0 -1
- package/dist/pine-core/p-qhdoK1Jp.system.js +0 -1
- /package/dist/esm-es5/{index-BJXk71tO.js → index-BWDu62Mo.js} +0 -0
- /package/dist/pine-core/{p-BJXk71tO.js → p-BWDu62Mo.js} +0 -0
- /package/dist/pine-core/{p-n3_ytl_p.system.js → p-ClDiSG97.system.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
/**
|
|
3
|
-
* @part button
|
|
3
|
+
* @part button - Exposes the item's inner element for styling. Appears on button and informational items, not on links.
|
|
4
4
|
*/
|
|
5
5
|
export class PdsDropdownMenuItem {
|
|
6
6
|
constructor() {
|
|
@@ -14,9 +14,17 @@ export class PdsDropdownMenuItem {
|
|
|
14
14
|
* @defaultValue false
|
|
15
15
|
*/
|
|
16
16
|
this.disabled = false;
|
|
17
|
+
/**
|
|
18
|
+
* It determines whether or not the dropdown-item is informational: text that the arrow keys
|
|
19
|
+
* reach but that can't be activated. Takes precedence over `href` and `destructive`.
|
|
20
|
+
* Screen readers announce it as dimmed or unavailable, the same way as a disabled item.
|
|
21
|
+
* @defaultValue false
|
|
22
|
+
*/
|
|
23
|
+
this.informational = false;
|
|
17
24
|
/**
|
|
18
25
|
* Determines whether the link should open in a new tab and display an external icon.
|
|
19
26
|
* This is a simpler alternative to using `target="_blank"` for the common case.
|
|
27
|
+
* Ignored when `informational` is set.
|
|
20
28
|
* @defaultValue false
|
|
21
29
|
*/
|
|
22
30
|
this.external = false;
|
|
@@ -27,6 +35,12 @@ export class PdsDropdownMenuItem {
|
|
|
27
35
|
this.handleBlur = () => {
|
|
28
36
|
this.hasFocus = false;
|
|
29
37
|
};
|
|
38
|
+
// Space would otherwise scroll the page, since nothing in the item takes the key.
|
|
39
|
+
this.handleInformationalKeyDown = (event) => {
|
|
40
|
+
if (event.key === ' ') {
|
|
41
|
+
event.preventDefault();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
30
44
|
this.handleKeyDown = (event) => {
|
|
31
45
|
// Handle keyboard events
|
|
32
46
|
if (!this.disabled && (event.key === 'Enter')) {
|
|
@@ -48,6 +62,8 @@ export class PdsDropdownMenuItem {
|
|
|
48
62
|
;
|
|
49
63
|
handleClick() {
|
|
50
64
|
var _a;
|
|
65
|
+
if (this.informational)
|
|
66
|
+
return;
|
|
51
67
|
// Filter only pds-dropdown-menu-item elements and find the index of the current item
|
|
52
68
|
const menuItems = Array.from(this.host.parentNode.children).filter((child) => child.tagName.toLowerCase() === 'pds-dropdown-menu-item');
|
|
53
69
|
const itemIndex = menuItems.indexOf(this.host);
|
|
@@ -60,6 +76,12 @@ export class PdsDropdownMenuItem {
|
|
|
60
76
|
});
|
|
61
77
|
}
|
|
62
78
|
renderElement() {
|
|
79
|
+
if (this.informational) {
|
|
80
|
+
return (h("div", { class: {
|
|
81
|
+
'pds-dropdown-menu-item__content': true,
|
|
82
|
+
'has-focus': this.hasFocus
|
|
83
|
+
}, role: "menuitem", "aria-disabled": "true", part: "button", tabIndex: this.disabled ? -1 : 0, onKeyDown: this.handleInformationalKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("slot", null)));
|
|
84
|
+
}
|
|
63
85
|
if (this.href != null) {
|
|
64
86
|
return (h("pds-link", { download: this.download, href: this.disabled ? null : this.href, external: this.external, target: this.target, class: {
|
|
65
87
|
'pds-dropdown-menu-item__content': true,
|
|
@@ -72,7 +94,14 @@ export class PdsDropdownMenuItem {
|
|
|
72
94
|
}, tabIndex: this.disabled ? -1 : 0, type: "button", part: "button", onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur, disabled: this.disabled, "aria-disabled": this.disabled ? 'true' : null }, h("slot", null)));
|
|
73
95
|
}
|
|
74
96
|
render() {
|
|
75
|
-
return (h(Host, { key: '
|
|
97
|
+
return (h(Host, { key: '47a62550fde33f892d7af4f4e71b67ebf7aa2c3f', id: this.componentId, class: {
|
|
98
|
+
'is-disabled': this.disabled,
|
|
99
|
+
'is-informational': this.informational,
|
|
100
|
+
'destructive': !this.disabled && !this.informational && this.destructive
|
|
101
|
+
}, onClick: () => !this.disabled && this.handleClick(), role: "none",
|
|
102
|
+
// ARIA ignores role="none" on focusable elements, so a focusable host would sit between
|
|
103
|
+
// the menu and the informational menuitem as an unexpected child.
|
|
104
|
+
tabIndex: this.informational ? null : -1, "aria-disabled": this.disabled && !this.informational ? 'true' : null }, this.renderElement()));
|
|
76
105
|
}
|
|
77
106
|
static get is() { return "pds-dropdown-menu-item"; }
|
|
78
107
|
static get encapsulation() { return "shadow"; }
|
|
@@ -165,7 +194,7 @@ export class PdsDropdownMenuItem {
|
|
|
165
194
|
"optional": true,
|
|
166
195
|
"docs": {
|
|
167
196
|
"tags": [],
|
|
168
|
-
"text": "Prompts the user to save the linked URL instead of navigating to it.\nIt can be used without a value to download with the default filename,\nor with a string value to suggest a specific filename for the download.\nOnly applies when href is set."
|
|
197
|
+
"text": "Prompts the user to save the linked URL instead of navigating to it.\nIt can be used without a value to download with the default filename,\nor with a string value to suggest a specific filename for the download.\nOnly applies when href is set. Ignored when `informational` is set."
|
|
169
198
|
},
|
|
170
199
|
"getter": false,
|
|
171
200
|
"setter": false,
|
|
@@ -184,13 +213,36 @@ export class PdsDropdownMenuItem {
|
|
|
184
213
|
"optional": false,
|
|
185
214
|
"docs": {
|
|
186
215
|
"tags": [],
|
|
187
|
-
"text": "If provided, renders the dropdown-item as an anchor (`<a>`) element instead of a button."
|
|
216
|
+
"text": "If provided, renders the dropdown-item as an anchor (`<a>`) element instead of a button.\nIgnored when `informational` is set."
|
|
188
217
|
},
|
|
189
218
|
"getter": false,
|
|
190
219
|
"setter": false,
|
|
191
220
|
"reflect": false,
|
|
192
221
|
"attribute": "href"
|
|
193
222
|
},
|
|
223
|
+
"informational": {
|
|
224
|
+
"type": "boolean",
|
|
225
|
+
"mutable": false,
|
|
226
|
+
"complexType": {
|
|
227
|
+
"original": "boolean",
|
|
228
|
+
"resolved": "boolean",
|
|
229
|
+
"references": {}
|
|
230
|
+
},
|
|
231
|
+
"required": false,
|
|
232
|
+
"optional": false,
|
|
233
|
+
"docs": {
|
|
234
|
+
"tags": [{
|
|
235
|
+
"name": "defaultValue",
|
|
236
|
+
"text": "false"
|
|
237
|
+
}],
|
|
238
|
+
"text": "It determines whether or not the dropdown-item is informational: text that the arrow keys\nreach but that can't be activated. Takes precedence over `href` and `destructive`.\nScreen readers announce it as dimmed or unavailable, the same way as a disabled item."
|
|
239
|
+
},
|
|
240
|
+
"getter": false,
|
|
241
|
+
"setter": false,
|
|
242
|
+
"reflect": true,
|
|
243
|
+
"attribute": "informational",
|
|
244
|
+
"defaultValue": "false"
|
|
245
|
+
},
|
|
194
246
|
"external": {
|
|
195
247
|
"type": "boolean",
|
|
196
248
|
"mutable": false,
|
|
@@ -206,7 +258,7 @@ export class PdsDropdownMenuItem {
|
|
|
206
258
|
"name": "defaultValue",
|
|
207
259
|
"text": "false"
|
|
208
260
|
}],
|
|
209
|
-
"text": "Determines whether the link should open in a new tab and display an external icon.\nThis is a simpler alternative to using `target=\"_blank\"` for the common case."
|
|
261
|
+
"text": "Determines whether the link should open in a new tab and display an external icon.\nThis is a simpler alternative to using `target=\"_blank\"` for the common case.\nIgnored when `informational` is set."
|
|
210
262
|
},
|
|
211
263
|
"getter": false,
|
|
212
264
|
"setter": false,
|
|
@@ -229,7 +281,7 @@ export class PdsDropdownMenuItem {
|
|
|
229
281
|
"name": "defaultValue",
|
|
230
282
|
"text": "undefined"
|
|
231
283
|
}],
|
|
232
|
-
"text": "Specifies where to open the linked document when href is provided.\nTakes precedence over the `external` prop if both are set.\nOnly applies when href is set."
|
|
284
|
+
"text": "Specifies where to open the linked document when href is provided.\nTakes precedence over the `external` prop if both are set.\nOnly applies when href is set. Ignored when `informational` is set."
|
|
233
285
|
},
|
|
234
286
|
"getter": false,
|
|
235
287
|
"setter": false,
|
|
@@ -201,11 +201,11 @@ export class PdsDropdownMenu {
|
|
|
201
201
|
if (tagName === 'pds-dropdown-menu-item') {
|
|
202
202
|
// For pds-dropdown-menu-item, focus the inner element
|
|
203
203
|
const menuItem = item;
|
|
204
|
-
const
|
|
204
|
+
const innerControl = (_a = menuItem.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('button, [role="menuitem"]');
|
|
205
205
|
const innerLink = ((_d = (_c = (_b = menuItem.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('pds-link')) === null || _c === void 0 ? void 0 : _c.shadowRoot) === null || _d === void 0 ? void 0 : _d.querySelector('a'))
|
|
206
206
|
|| ((_e = menuItem.shadowRoot) === null || _e === void 0 ? void 0 : _e.querySelector('a'));
|
|
207
|
-
if (
|
|
208
|
-
|
|
207
|
+
if (innerControl) {
|
|
208
|
+
innerControl.focus();
|
|
209
209
|
}
|
|
210
210
|
else if (innerLink) {
|
|
211
211
|
innerLink.focus();
|
|
@@ -357,7 +357,7 @@ export class PdsDropdownMenu {
|
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
render() {
|
|
360
|
-
return (h(Host, { key: '
|
|
360
|
+
return (h(Host, { key: '1765909c8c3c140e52dc3f6b50693c97d6bcc003', id: this.componentId }, h("slot", { key: '0b566cd288428a0694a2d61d4a73bd79def4bfad', name: "trigger", onSlotchange: this.handleTriggerSlotChange }), h("pds-box", { key: '16cdfc208cfe7f6e074289c30aa0e1188a34876d', "border-radius": "sm", display: "flex", direction: "column", class: "pds-dropdown-menu--panel is-hidden", shadow: "100", part: "menu-panel" }, h("div", { key: 'a28c1736ad02e8ac3d82c0fe1933606a7216989b', class: { 'pds-dropdown-menu__header': true, 'is-hidden': !this.hasHeader } }, h("slot", { key: '9c6dfddefb266083f68aa27d6cc01127a69cd1cf', name: "header", onSlotchange: this.handleHeaderSlotChange })), h("div", { key: '8cfe85c10f92d4a4ec6b5d2d0264d054a74ba29b', class: "pds-dropdown-menu__items", role: "menu", "aria-orientation": "vertical" }, h("slot", { key: '1a5b4aa406d2706ca8cef49deb05140a5763be1c', onSlotchange: this.handleSlotChange })))));
|
|
361
361
|
}
|
|
362
362
|
static get is() { return "pds-dropdown-menu"; }
|
|
363
363
|
static get encapsulation() { return "shadow"; }
|
|
@@ -36,3 +36,42 @@ Default.args = {
|
|
|
36
36
|
componentId: 'base-dropdown',
|
|
37
37
|
placement: 'bottom-start',
|
|
38
38
|
}
|
|
39
|
+
|
|
40
|
+
const InformationalTemplate = (args) => html`
|
|
41
|
+
<div style="height: 200px">
|
|
42
|
+
<pds-dropdown-menu
|
|
43
|
+
component-id=${args.componentId}
|
|
44
|
+
placement=${args.placement}
|
|
45
|
+
>
|
|
46
|
+
<pds-button slot="trigger" variant="secondary">Used on</pds-button>
|
|
47
|
+
<pds-dropdown-menu-item href="#products">3 products</pds-dropdown-menu-item>
|
|
48
|
+
<pds-dropdown-menu-item informational>2 forms</pds-dropdown-menu-item>
|
|
49
|
+
<pds-dropdown-menu-item href="#emails">5 emails</pds-dropdown-menu-item>
|
|
50
|
+
<pds-dropdown-menu-item informational href="#pages">1 page</pds-dropdown-menu-item>
|
|
51
|
+
</pds-dropdown-menu>
|
|
52
|
+
</div>`;
|
|
53
|
+
|
|
54
|
+
export const Informational = InformationalTemplate.bind();
|
|
55
|
+
Informational.args = {
|
|
56
|
+
componentId: 'informational-dropdown',
|
|
57
|
+
placement: 'bottom-start',
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const InformationalOnlyTemplate = (args) => html`
|
|
61
|
+
<div style="height: 200px">
|
|
62
|
+
<pds-dropdown-menu
|
|
63
|
+
component-id=${args.componentId}
|
|
64
|
+
placement=${args.placement}
|
|
65
|
+
>
|
|
66
|
+
<pds-button slot="trigger" variant="secondary">Used on</pds-button>
|
|
67
|
+
<pds-dropdown-menu-item informational>3 products</pds-dropdown-menu-item>
|
|
68
|
+
<pds-dropdown-menu-item informational>2 forms</pds-dropdown-menu-item>
|
|
69
|
+
<pds-dropdown-menu-item informational>5 emails</pds-dropdown-menu-item>
|
|
70
|
+
</pds-dropdown-menu>
|
|
71
|
+
</div>`;
|
|
72
|
+
|
|
73
|
+
export const InformationalOnly = InformationalOnlyTemplate.bind();
|
|
74
|
+
InformationalOnly.args = {
|
|
75
|
+
componentId: 'informational-only-dropdown',
|
|
76
|
+
placement: 'bottom-start',
|
|
77
|
+
}
|
|
@@ -15,6 +15,21 @@ export class PdsModalContent {
|
|
|
15
15
|
* Tracks whether the border prop was explicitly set by the user
|
|
16
16
|
*/
|
|
17
17
|
this.userSetBorder = false;
|
|
18
|
+
this.hasLoaded = false;
|
|
19
|
+
/**
|
|
20
|
+
* Handle scroll events
|
|
21
|
+
*/
|
|
22
|
+
this.handleScroll = () => {
|
|
23
|
+
this.updateBorders();
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Handle resize events
|
|
27
|
+
*/
|
|
28
|
+
this.handleResize = () => {
|
|
29
|
+
this.calculateMaxHeight();
|
|
30
|
+
// Update borders after resize as content scrollability might change
|
|
31
|
+
setTimeout(() => this.updateBorders(), 50);
|
|
32
|
+
};
|
|
18
33
|
}
|
|
19
34
|
// Unwraps a nested .pds-modal-content left by a page-cache (Turbo, bfcache) reconnect.
|
|
20
35
|
componentDidRender() {
|
|
@@ -28,43 +43,30 @@ export class PdsModalContent {
|
|
|
28
43
|
this.userSetBorder = hasBorderAttribute || this.border !== 'none';
|
|
29
44
|
}
|
|
30
45
|
componentDidLoad() {
|
|
46
|
+
this.hasLoaded = true;
|
|
31
47
|
this.calculateMaxHeight();
|
|
32
|
-
// Set up resize listener
|
|
33
|
-
window.addEventListener('resize', this.handleResize.bind(this));
|
|
34
|
-
// Only set up scroll listener for border updates if borders are managed automatically
|
|
35
48
|
if (!this.userSetBorder) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
this.el.addEventListener('scroll', this.handleScroll.bind(this));
|
|
39
|
-
// Initial border update after everything is set up
|
|
40
|
-
setTimeout(() => this.updateBorders(), 100);
|
|
41
|
-
}, 100);
|
|
49
|
+
// Initial border update after everything is set up
|
|
50
|
+
setTimeout(() => this.updateBorders(), 200);
|
|
42
51
|
}
|
|
43
52
|
}
|
|
53
|
+
// Here rather than in componentDidLoad, which runs once: content taken out of the page and put
|
|
54
|
+
// back (a DOM morph or a framework moving it) gets its listeners and header/footer observer back.
|
|
55
|
+
connectedCallback() {
|
|
56
|
+
window.addEventListener('resize', this.handleResize);
|
|
57
|
+
// The scroll happens on the component element itself (this.el), not the inner div
|
|
58
|
+
this.el.addEventListener('scroll', this.handleScroll);
|
|
59
|
+
if (this.hasLoaded)
|
|
60
|
+
this.calculateMaxHeight();
|
|
61
|
+
}
|
|
44
62
|
disconnectedCallback() {
|
|
45
|
-
window.removeEventListener('resize', this.handleResize
|
|
46
|
-
|
|
47
|
-
if (!this.userSetBorder) {
|
|
48
|
-
this.el.removeEventListener('scroll', this.handleScroll.bind(this));
|
|
49
|
-
}
|
|
63
|
+
window.removeEventListener('resize', this.handleResize);
|
|
64
|
+
this.el.removeEventListener('scroll', this.handleScroll);
|
|
50
65
|
if (this.mutationObserver) {
|
|
51
66
|
this.mutationObserver.disconnect();
|
|
67
|
+
this.mutationObserver = undefined;
|
|
52
68
|
}
|
|
53
69
|
}
|
|
54
|
-
/**
|
|
55
|
-
* Handle scroll events
|
|
56
|
-
*/
|
|
57
|
-
handleScroll() {
|
|
58
|
-
this.updateBorders();
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Handle resize events
|
|
62
|
-
*/
|
|
63
|
-
handleResize() {
|
|
64
|
-
this.calculateMaxHeight();
|
|
65
|
-
// Update borders after resize as content scrollability might change
|
|
66
|
-
setTimeout(() => this.updateBorders(), 50);
|
|
67
|
-
}
|
|
68
70
|
/**
|
|
69
71
|
* Updates border visibility based on scroll state (only if not user-defined)
|
|
70
72
|
*/
|
|
@@ -181,10 +183,10 @@ export class PdsModalContent {
|
|
|
181
183
|
render() {
|
|
182
184
|
// Only apply max-height style if it's not 'none'
|
|
183
185
|
const styleObj = this.contentMaxHeight !== 'none' ? { maxHeight: this.contentMaxHeight } : {};
|
|
184
|
-
return (h(Host, { key: '
|
|
186
|
+
return (h(Host, { key: 'c83e230d23444e3d5358d995170e2b8386884fe8' }, h("div", { key: 'b91de2c71e693b5a1ba2b257d741e7b0418c2d76', class: {
|
|
185
187
|
'pds-modal-content': true,
|
|
186
188
|
[`pds-modal-content--border-${this.border}`]: true
|
|
187
|
-
}, style: styleObj, tabindex: "-1" }, h("slot", { key: '
|
|
189
|
+
}, style: styleObj, tabindex: "-1" }, h("slot", { key: '971cbd44ffeac4bb13a651948a119c603bed9e4f' }))));
|
|
188
190
|
}
|
|
189
191
|
static get is() { return "pds-modal-content"; }
|
|
190
192
|
static get originalStyleUrls() {
|
|
@@ -101,7 +101,7 @@ function containsComposed(ancestor, node) {
|
|
|
101
101
|
*/
|
|
102
102
|
const openModals = new Map();
|
|
103
103
|
let openSequence = 0;
|
|
104
|
-
/** Whether an open
|
|
104
|
+
/** Whether the panel of an open popover that takes Escape sits in `root`, including inside shadow roots under it. */
|
|
105
105
|
function hasOpenPopover(root) {
|
|
106
106
|
if (root.querySelector('[data-pds-popover-open]'))
|
|
107
107
|
return true;
|
|
@@ -645,14 +645,14 @@ export class PdsModal {
|
|
|
645
645
|
}
|
|
646
646
|
render() {
|
|
647
647
|
const [sizeClass = 'md', customSize] = this.resolveSize();
|
|
648
|
-
return (h("dialog", { key: '
|
|
648
|
+
return (h("dialog", { key: '0a3ea92246b5ae704bc7dcbadf4f4e0d5a54e9e6', class: {
|
|
649
649
|
'pds-modal__backdrop': true,
|
|
650
650
|
'open': this.open
|
|
651
|
-
}, "aria-modal": this.disableTopLayer ? 'false' : 'true', "aria-labelledby": `${this.componentId}-heading`, onClick: this.handleBackdropClick, onCancel: this.handleCancel }, h("div", { key: '
|
|
651
|
+
}, "aria-modal": this.disableTopLayer ? 'false' : 'true', "aria-labelledby": `${this.componentId}-heading`, onClick: this.handleBackdropClick, onCancel: this.handleCancel }, h("div", { key: 'a38029c2284ed345bec2ce7638fc3415818cd609', class: {
|
|
652
652
|
'pds-modal': true,
|
|
653
653
|
[`pds-modal--${sizeClass}`]: true,
|
|
654
654
|
'pds-modal--scrollable': this.scrollable
|
|
655
|
-
}, style: customSize !== undefined ? { '--pds-modal-max-width': customSize } : undefined, part: "modal" }, h("slot", { key: '
|
|
655
|
+
}, style: customSize !== undefined ? { '--pds-modal-max-width': customSize } : undefined, part: "modal" }, h("slot", { key: '396da81af42685f5c083f853afa207a6844e444e' }))));
|
|
656
656
|
}
|
|
657
657
|
static get is() { return "pds-modal"; }
|
|
658
658
|
static get originalStyleUrls() {
|
|
@@ -1178,7 +1178,7 @@ export class PdsMultiselect {
|
|
|
1178
1178
|
'pds-multiselect__option--selected': isSelected,
|
|
1179
1179
|
'pds-multiselect__option--create': isCreateOption,
|
|
1180
1180
|
'pds-multiselect__option--disabled': isDisabled || isCreateDisabled,
|
|
1181
|
-
}, role: "option", "aria-selected": isSelected ? 'true' : 'false', "aria-disabled": isDisabled || isCreateDisabled ? 'true' : undefined, "aria-label": isCreateOption ? formatMessage(this.createOptionAriaLabel, { text: option.text }) : undefined, "aria-describedby": hasAction ? `${optionId}-action-description` : undefined, "data-index": index, onMouseDown: this.handleOptionMouseDown(option), onClick: this.handleOptionClick, onMouseEnter: this.handleOptionMouseEnter(index, option) }, isCreateOption ? (h("pds-box", { class: "pds-multiselect__create-option", "align-items": "center", gap: "xs" }, h("pds-icon", { name: "add", size: "small" }), h("pds-text", null, formatMessage(this.createOptionLabel, { text: option.text })))) : (h("pds-checkbox", { componentId: `${this.componentId}-checkbox-${index}`, checked: isSelected, label: option.text, disabled: isDisabled, style: { pointerEvents: 'none' } }, this.optionDisplay === 'chip' && (h("pds-chip", { slot: "label", sentiment: "subtle", dot: !!option.dotColor, "dot-color": option.dotColor, "max-width": "100%" }, option.text)))), hasAction && this.renderOptionAction(option, optionId, isHighlighted)));
|
|
1181
|
+
}, role: "option", "aria-selected": isSelected ? 'true' : 'false', "aria-disabled": isDisabled || isCreateDisabled ? 'true' : undefined, "aria-label": isCreateOption ? formatMessage(this.createOptionAriaLabel, { text: option.text }) : undefined, "aria-describedby": hasAction ? `${optionId}-action-description` : undefined, "data-index": index, onMouseDown: this.handleOptionMouseDown(option), onClick: this.handleOptionClick, onMouseEnter: this.handleOptionMouseEnter(index, option) }, isCreateOption ? (h("pds-box", { class: "pds-multiselect__create-option", "align-items": "center", gap: "xs" }, h("pds-icon", { name: "add", size: "small", "aria-hidden": "true" }), h("pds-text", null, formatMessage(this.createOptionLabel, { text: option.text })))) : (h("pds-checkbox", { componentId: `${this.componentId}-checkbox-${index}`, checked: isSelected, label: option.text, disabled: isDisabled, style: { pointerEvents: 'none' } }, this.optionDisplay === 'chip' && (h("pds-chip", { slot: "label", sentiment: "subtle", dot: !!option.dotColor, "dot-color": option.dotColor, "max-width": "100%" }, option.text)))), hasAction && this.renderOptionAction(option, optionId, isHighlighted)));
|
|
1182
1182
|
}
|
|
1183
1183
|
renderOptionAction(option, optionId, isHighlighted) {
|
|
1184
1184
|
var _a;
|
|
@@ -1201,7 +1201,7 @@ export class PdsMultiselect {
|
|
|
1201
1201
|
const hasSlottedEmpty = !!this.el.querySelector('[slot="empty"]');
|
|
1202
1202
|
const hasSlottedLoading = !!this.el.querySelector('[slot="loading"]');
|
|
1203
1203
|
const hasSlottedFooter = !!this.el.querySelector('[slot="footer"]');
|
|
1204
|
-
return (h("div", { class: "pds-multiselect__panel", ref: el => (this.panelEl = el), style: { minWidth: this.minWidth } }, h("div", { class: "pds-multiselect__search" }, h("pds-icon", { name: "search", size: "small" }), h("input", { ref: el => (this.searchInputEl = el), type: "text", class: "pds-multiselect__search-input", placeholder: this.searchPlaceholder, value: this.searchQuery, "aria-label": this.searchOptionsLabel, "aria-controls": `${this.componentId}-listbox`, "aria-activedescendant": this.highlightedIndex >= 0 ? `${this.componentId}-option-${this.highlightedIndex}` : undefined, role: "combobox", "aria-haspopup": "listbox", "aria-expanded": "true", "aria-autocomplete": "list", autocomplete: "off", onInput: this.handleSearchInputChange, onKeyDown: this.handleSearchInputKeyDown })), this.renderSelectedItemsList(), h("ul", { class: "pds-multiselect__listbox", role: "listbox", "aria-multiselectable": "true", "aria-label": this.label || this.optionsLabel, id: `${this.componentId}-listbox`, ref: el => (this.listboxEl = el), style: { maxHeight: this.maxHeight }, onScroll: this.handleScroll }, this.loading && (h("li", { class: "pds-multiselect__loading", role: "presentation" }, hasSlottedLoading ? (h("slot", { name: "loading" })) : (h("pds-loader", { size: "small" })))), !this.loading && filteredOptions.length === 0 && (h("li", { class: "pds-multiselect__empty", role: "presentation" }, hasSlottedEmpty ? (h("slot", { name: "empty" })) : (h("span", null, this.noOptionsFoundLabel)))), this.getGroupedRenderItems(filteredOptions).map((item, itemIndex) => {
|
|
1204
|
+
return (h("div", { class: "pds-multiselect__panel", ref: el => (this.panelEl = el), style: { minWidth: this.minWidth } }, h("div", { class: "pds-multiselect__search" }, h("pds-icon", { name: "search", size: "small", "aria-hidden": "true" }), h("input", { ref: el => (this.searchInputEl = el), type: "text", class: "pds-multiselect__search-input", placeholder: this.searchPlaceholder, value: this.searchQuery, "aria-label": this.searchOptionsLabel, "aria-controls": `${this.componentId}-listbox`, "aria-activedescendant": this.highlightedIndex >= 0 ? `${this.componentId}-option-${this.highlightedIndex}` : undefined, role: "combobox", "aria-haspopup": "listbox", "aria-expanded": "true", "aria-autocomplete": "list", autocomplete: "off", onInput: this.handleSearchInputChange, onKeyDown: this.handleSearchInputKeyDown })), this.renderSelectedItemsList(), h("ul", { class: "pds-multiselect__listbox", role: "listbox", "aria-multiselectable": "true", "aria-label": this.label || this.optionsLabel, id: `${this.componentId}-listbox`, ref: el => (this.listboxEl = el), style: { maxHeight: this.maxHeight }, onScroll: this.handleScroll }, this.loading && (h("li", { class: "pds-multiselect__loading", role: "presentation" }, hasSlottedLoading ? (h("slot", { name: "loading" })) : (h("pds-loader", { size: "small" })))), !this.loading && filteredOptions.length === 0 && (h("li", { class: "pds-multiselect__empty", role: "presentation" }, hasSlottedEmpty ? (h("slot", { name: "empty" })) : (h("span", null, this.noOptionsFoundLabel)))), this.getGroupedRenderItems(filteredOptions).map((item, itemIndex) => {
|
|
1205
1205
|
if (item.type === 'group') {
|
|
1206
1206
|
return (h("li", { key: `group-${itemIndex}`, role: "group", "aria-label": item.group, class: "pds-multiselect__group" }, h("span", { class: "pds-multiselect__group-header", "aria-hidden": "true" }, item.group), h("ul", { class: "pds-multiselect__group-list", role: "presentation" }, item.options.map(({ option, index }) => this.renderOption(option, index, valueArray)))));
|
|
1207
1207
|
}
|
|
@@ -1260,10 +1260,10 @@ export class PdsMultiselect {
|
|
|
1260
1260
|
}
|
|
1261
1261
|
render() {
|
|
1262
1262
|
const hasSelections = this.selectedItems.length > 0;
|
|
1263
|
-
return (h(Host, { key: '
|
|
1263
|
+
return (h(Host, { key: 'd0879469e6ff943374c2f035c0a8d6d57c25dc5f', "aria-disabled": this.disabled ? 'true' : null }, h("div", { key: '80caa694099218561b85c93d547ec9208def0ec7', class: "pds-multiselect", onFocusout: this.handleContainerFocusOut }, this.label && (h("label", { key: 'b4eaa2c9e2901c28ecb0b8f55e63e33ad899e945', id: `${this.componentId}-label`, htmlFor: this.componentId, class: {
|
|
1264
1264
|
'pds-multiselect__label': true,
|
|
1265
1265
|
'visually-hidden': this.hideLabel,
|
|
1266
|
-
} }, this.label)), h("div", { key: '
|
|
1266
|
+
} }, this.label)), h("div", { key: '404ed58aa6bfb2248ffad5e56ebabfe65149b9a4', 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: {
|
|
1267
1267
|
'pds-multiselect__trigger': true,
|
|
1268
1268
|
'pds-multiselect__trigger--open': this.isOpen,
|
|
1269
1269
|
'pds-multiselect__trigger--disabled': this.disabled,
|
|
@@ -1279,7 +1279,7 @@ export class PdsMultiselect {
|
|
|
1279
1279
|
}, 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: {
|
|
1280
1280
|
'pds-multiselect__trigger-text': true,
|
|
1281
1281
|
'pds-multiselect__trigger-text--placeholder': !hasSelections || (this.selectedDisplay === 'pill' && this.pillPosition === 'below'),
|
|
1282
|
-
} }, 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: '
|
|
1282
|
+
} }, 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: '73f17916a37722fefebd6b5a184a7b3dca6f4a9d', class: "visually-hidden", "aria-live": "polite", "aria-atomic": "true" }, this.removalAnnouncement), this.helperMessage && !(this.errorMessage && this.errorMessage.length > 0) && (h("p", { key: '1a987562b21da6f8d2f8c9f94e93e8c99a7abd74', class: "pds-multiselect__helper", id: messageId(this.componentId, 'helper') }, this.helperMessage)), this.errorMessage && (h("p", { key: 'ce1f7f48d6f8dee320d87cb7088f084e68cb3ab5', class: "pds-multiselect__error", id: messageId(this.componentId, 'error') }, h("pds-icon", { key: '8347dfdec6ef1b81d4cf9f72cba3d9ec965dcf08', "aria-hidden": "true", icon: danger, size: "small" }), this.errorMessage)), h("div", { key: '74cd840e102ad635d2f4bc23cf3bcfaa61d5cea1', style: { display: 'none' } }, h("slot", { key: 'c2fd9e71363a9661062c8d88be0dd78fc98b964d' })))));
|
|
1283
1283
|
}
|
|
1284
1284
|
static get is() { return "pds-multiselect"; }
|
|
1285
1285
|
static get encapsulation() { return "shadow"; }
|