@pine-ds/core 4.6.0 → 4.7.1
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-box2.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-copytext.js +1 -1
- package/components/pds-drawer.js +1 -1
- package/components/pds-dropdown-menu-item.js +1 -1
- package/components/pds-dropdown-menu.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.js +1 -1
- package/components/pds-row.js +1 -1
- package/components/pds-switch.js +1 -1
- package/components/pds-table-cell2.js +1 -1
- package/components/pds-text2.js +1 -1
- package/components/truncation-tooltip.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pds-box.cjs.entry.js +96 -96
- package/dist/cjs/pds-checkbox.cjs.entry.js +16 -4
- package/dist/cjs/pds-chip.cjs.entry.js +34 -9
- package/dist/cjs/pds-combobox.cjs.entry.js +47 -4
- package/dist/cjs/pds-copytext.cjs.entry.js +7 -2
- package/dist/cjs/pds-drawer.cjs.entry.js +23 -10
- package/dist/cjs/pds-dropdown-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/pds-dropdown-menu.cjs.entry.js +9 -5
- package/dist/cjs/pds-modal.cjs.entry.js +175 -49
- package/dist/cjs/pds-multiselect.cjs.entry.js +40 -9
- package/dist/cjs/pds-popover.cjs.entry.js +170 -26
- package/dist/cjs/pds-radio.cjs.entry.js +1 -1
- package/dist/cjs/pds-row.cjs.entry.js +7 -7
- package/dist/cjs/pds-switch.cjs.entry.js +15 -3
- package/dist/cjs/pds-table-cell.cjs.entry.js +24 -4
- package/dist/cjs/pds-text.cjs.entry.js +17 -9
- package/dist/cjs/pine-core.cjs.js +1 -1
- package/dist/cjs/{truncation-tooltip-CYgQfBLt.js → truncation-tooltip-DO9xli2e.js} +7 -7
- package/dist/collection/components/pds-box/pds-box.js +96 -96
- package/dist/collection/components/pds-checkbox/pds-checkbox.css +4 -0
- package/dist/collection/components/pds-checkbox/pds-checkbox.js +15 -3
- package/dist/collection/components/pds-chip/pds-chip.js +33 -8
- package/dist/collection/components/pds-chip/stories/pds-chip.stories.js +17 -0
- package/dist/collection/components/pds-combobox/pds-combobox.js +48 -5
- package/dist/collection/components/pds-combobox/stories/pds-combobox.stories.js +1 -1
- package/dist/collection/components/pds-copytext/pds-copytext.js +6 -1
- package/dist/collection/components/pds-drawer/pds-drawer.css +4 -1
- package/dist/collection/components/pds-drawer/pds-drawer.js +54 -17
- package/dist/collection/components/pds-drawer/stories/pds-drawer.stories.js +6 -1
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.js +2 -2
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.js +15 -5
- package/dist/collection/components/pds-modal/pds-modal.js +180 -50
- package/dist/collection/components/pds-multiselect/pds-multiselect.css +4 -0
- package/dist/collection/components/pds-multiselect/pds-multiselect.js +42 -11
- package/dist/collection/components/pds-popover/pds-popover.js +171 -27
- package/dist/collection/components/pds-radio/pds-radio.css +6 -0
- package/dist/collection/components/pds-row/pds-row.js +7 -7
- package/dist/collection/components/pds-switch/pds-switch.js +15 -3
- package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js +23 -3
- package/dist/collection/components/pds-text/pds-text.js +16 -8
- package/dist/collection/utils/truncation-tooltip.js +7 -7
- package/dist/docs.json +48 -9
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pds-box.entry.js +96 -96
- package/dist/esm/pds-checkbox.entry.js +16 -4
- package/dist/esm/pds-chip.entry.js +34 -9
- package/dist/esm/pds-combobox.entry.js +47 -4
- package/dist/esm/pds-copytext.entry.js +7 -2
- package/dist/esm/pds-drawer.entry.js +23 -10
- package/dist/esm/pds-dropdown-menu-item.entry.js +2 -2
- package/dist/esm/pds-dropdown-menu.entry.js +9 -5
- package/dist/esm/pds-modal.entry.js +175 -49
- package/dist/esm/pds-multiselect.entry.js +40 -9
- package/dist/esm/pds-popover.entry.js +171 -27
- package/dist/esm/pds-radio.entry.js +1 -1
- package/dist/esm/pds-row.entry.js +7 -7
- package/dist/esm/pds-switch.entry.js +15 -3
- package/dist/esm/pds-table-cell.entry.js +24 -4
- package/dist/esm/pds-text.entry.js +17 -9
- package/dist/esm/pine-core.js +1 -1
- package/dist/esm/{truncation-tooltip-_902ENWC.js → truncation-tooltip-DRXsdKk1.js} +7 -7
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/pds-box.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-drawer.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-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.entry.js +1 -1
- package/dist/esm-es5/pds-row.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-text.entry.js +1 -1
- package/dist/esm-es5/pine-core.js +1 -1
- package/dist/esm-es5/truncation-tooltip-DRXsdKk1.js +1 -0
- package/dist/pine-core/{p-9af131d6.system.entry.js → p-11d98408.system.entry.js} +1 -1
- package/dist/pine-core/p-153ba77b.entry.js +1 -0
- package/dist/pine-core/p-355e4cf9.entry.js +1 -0
- package/dist/pine-core/p-4435fff6.system.entry.js +1 -0
- package/dist/pine-core/p-576cf904.system.entry.js +1 -0
- package/dist/pine-core/{p-4f94b4f1.system.entry.js → p-645a482b.system.entry.js} +1 -1
- package/dist/pine-core/{p-4fa63723.system.entry.js → p-6d603d16.system.entry.js} +1 -1
- package/dist/pine-core/p-74a05bcc.entry.js +1 -0
- package/dist/pine-core/p-7fa66cad.entry.js +1 -0
- package/dist/pine-core/p-80a698ae.entry.js +1 -0
- package/dist/pine-core/{p-bf7ee3b7.system.entry.js → p-80e6f3a0.system.entry.js} +1 -1
- package/dist/pine-core/p-88ff1604.entry.js +1 -0
- package/dist/pine-core/p-92ae6082.entry.js +1 -0
- package/dist/pine-core/{p-6eec23a7.system.entry.js → p-97d0b89e.system.entry.js} +1 -1
- package/dist/pine-core/p-993d1043.entry.js +1 -0
- package/dist/pine-core/p-CuSNnuFu.system.js +1 -1
- package/dist/pine-core/p-JtdHT_W5.js +1 -0
- package/dist/pine-core/p-a787b34a.system.entry.js +1 -0
- package/dist/pine-core/p-a939b471.entry.js +1 -0
- package/dist/pine-core/p-aa032a5e.system.entry.js +1 -0
- package/dist/pine-core/{p-646afbca.system.entry.js → p-b60ac7eb.system.entry.js} +1 -1
- package/dist/pine-core/p-bb73ad66.entry.js +2 -0
- package/dist/pine-core/p-bd26a5e8.entry.js +1 -0
- package/dist/pine-core/p-bf5887e8.system.entry.js +1 -0
- package/dist/pine-core/p-c36b490e.entry.js +1 -0
- package/dist/pine-core/p-c81d8ac8.entry.js +1 -0
- package/dist/pine-core/p-ca0a8f5c.entry.js +1 -0
- package/dist/pine-core/p-ca0d48e8.entry.js +1 -0
- package/dist/pine-core/p-cfc52b95.system.entry.js +1 -0
- package/dist/pine-core/{p-ba1f65c2.system.entry.js → p-d8570b4b.system.entry.js} +1 -1
- package/dist/pine-core/{p-9e0f920a.system.entry.js → p-e7a95a49.system.entry.js} +1 -1
- package/dist/pine-core/p-e803f629.system.entry.js +1 -0
- package/dist/pine-core/{p-df539c42.system.entry.js → p-e836f3ec.system.entry.js} +2 -2
- package/dist/pine-core/{p-b8e8a4ce.entry.js → p-f474d7de.entry.js} +1 -1
- package/dist/pine-core/{p-CBu9UrXr.system.js → p-qhdoK1Jp.system.js} +1 -1
- package/dist/pine-core/pine-core.esm.js +1 -1
- package/dist/types/components/pds-checkbox/pds-checkbox.d.ts +4 -0
- package/dist/types/components/pds-combobox/pds-combobox.d.ts +7 -1
- package/dist/types/components/pds-drawer/pds-drawer.d.ts +21 -9
- package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu.d.ts +1 -0
- package/dist/types/components/pds-modal/pds-modal.d.ts +16 -3
- package/dist/types/components/pds-multiselect/pds-multiselect.d.ts +10 -3
- package/dist/types/components/pds-popover/pds-popover.d.ts +31 -1
- package/dist/types/components/pds-switch/pds-switch.d.ts +4 -0
- package/dist/types/components/pds-table/pds-table-cell/pds-table-cell.d.ts +3 -0
- package/dist/types/components/pds-text/pds-text.d.ts +1 -0
- package/dist/types/components.d.ts +47 -32
- package/dist/types/utils/truncation-tooltip.d.ts +15 -2
- package/dist/vscode.html-data.json +11 -4
- package/hydrate/index.js +698 -253
- package/hydrate/index.mjs +698 -253
- package/package.json +2 -2
- package/dist/esm-es5/truncation-tooltip-_902ENWC.js +0 -1
- package/dist/pine-core/p-01c9b8f3.entry.js +0 -1
- package/dist/pine-core/p-258d5e83.entry.js +0 -1
- package/dist/pine-core/p-3c27088f.system.entry.js +0 -1
- package/dist/pine-core/p-4849fda7.entry.js +0 -1
- package/dist/pine-core/p-4de8f333.entry.js +0 -1
- package/dist/pine-core/p-550c2fd3.entry.js +0 -1
- package/dist/pine-core/p-6bf853c9.entry.js +0 -1
- package/dist/pine-core/p-6d3610f9.entry.js +0 -1
- package/dist/pine-core/p-73eb47fa.entry.js +0 -1
- package/dist/pine-core/p-7f367db4.system.entry.js +0 -1
- package/dist/pine-core/p-84e9b7da.entry.js +0 -1
- package/dist/pine-core/p-9a0083dd.system.entry.js +0 -1
- package/dist/pine-core/p-CnM3cCof.js +0 -1
- package/dist/pine-core/p-a3735199.entry.js +0 -1
- package/dist/pine-core/p-a85a6ab9.system.entry.js +0 -1
- package/dist/pine-core/p-cf08a6dd.system.entry.js +0 -1
- package/dist/pine-core/p-da103a54.system.entry.js +0 -1
- package/dist/pine-core/p-e800a2b1.entry.js +0 -1
- package/dist/pine-core/p-eb5465ce.entry.js +0 -1
- package/dist/pine-core/p-ec5428fb.entry.js +0 -1
- package/dist/pine-core/p-ed4b979e.entry.js +0 -1
- package/dist/pine-core/p-f1f17940.entry.js +0 -2
- package/dist/pine-core/p-f25e4731.system.entry.js +0 -1
package/hydrate/index.mjs
CHANGED
|
@@ -6449,18 +6449,18 @@ class PdsBox {
|
|
|
6449
6449
|
}
|
|
6450
6450
|
render() {
|
|
6451
6451
|
const boxClasses = `
|
|
6452
|
-
${this.alignItems
|
|
6453
|
-
${this.alignItemsXs
|
|
6454
|
-
${this.alignItemsSm
|
|
6455
|
-
${this.alignItemsMd
|
|
6456
|
-
${this.alignItemsLg
|
|
6457
|
-
${this.alignItemsXl
|
|
6458
|
-
${this.alignSelf
|
|
6459
|
-
${this.alignSelfXs
|
|
6460
|
-
${this.alignSelfSm
|
|
6461
|
-
${this.alignSelfMd
|
|
6462
|
-
${this.alignSelfLg
|
|
6463
|
-
${this.alignSelfXl
|
|
6452
|
+
${this.alignItems != null && this.alignItems.trim() !== '' ? `pds-align-items-${this.alignItems}` : ''}
|
|
6453
|
+
${this.alignItemsXs != null && this.alignItemsXs.trim() !== '' ? `pds-align-items-xs-${this.alignItemsXs}` : ''}
|
|
6454
|
+
${this.alignItemsSm != null && this.alignItemsSm.trim() !== '' ? `pds-align-items-sm-${this.alignItemsSm}` : ''}
|
|
6455
|
+
${this.alignItemsMd != null && this.alignItemsMd.trim() !== '' ? `pds-align-items-md-${this.alignItemsMd}` : ''}
|
|
6456
|
+
${this.alignItemsLg != null && this.alignItemsLg.trim() !== '' ? `pds-align-items-lg-${this.alignItemsLg}` : ''}
|
|
6457
|
+
${this.alignItemsXl != null && this.alignItemsXl.trim() !== '' ? `pds-align-items-xl-${this.alignItemsXl}` : ''}
|
|
6458
|
+
${this.alignSelf != null && this.alignSelf.trim() !== '' ? `pds-align-self-${this.alignSelf}` : ''}
|
|
6459
|
+
${this.alignSelfXs != null && this.alignSelfXs.trim() !== '' ? `pds-align-self-xs-${this.alignSelfXs}` : ''}
|
|
6460
|
+
${this.alignSelfSm != null && this.alignSelfSm.trim() !== '' ? `pds-align-self-sm-${this.alignSelfSm}` : ''}
|
|
6461
|
+
${this.alignSelfMd != null && this.alignSelfMd.trim() !== '' ? `pds-align-self-md-${this.alignSelfMd}` : ''}
|
|
6462
|
+
${this.alignSelfLg != null && this.alignSelfLg.trim() !== '' ? `pds-align-self-lg-${this.alignSelfLg}` : ''}
|
|
6463
|
+
${this.alignSelfXl != null && this.alignSelfXl.trim() !== '' ? `pds-align-self-xl-${this.alignSelfXl}` : ''}
|
|
6464
6464
|
${this.auto ? 'pds-box--auto' : ''}
|
|
6465
6465
|
${this.autoXs ? 'pds-box--auto-xs' : ''}
|
|
6466
6466
|
${this.autoSm ? 'pds-box--auto-sm' : ''}
|
|
@@ -6476,101 +6476,101 @@ class PdsBox {
|
|
|
6476
6476
|
${this.borderInlineStart === false ? 'pds-box--border-inline-start-none' : ''}
|
|
6477
6477
|
${this.borderInlineEnd === true ? 'pds-box--border-inline-end' : ''}
|
|
6478
6478
|
${this.borderInlineEnd === false ? 'pds-box--border-inline-end-none' : ''}
|
|
6479
|
-
${this.borderRadius
|
|
6480
|
-
${this.direction
|
|
6481
|
-
${this.display
|
|
6479
|
+
${this.borderRadius != null && this.borderRadius.trim() !== '' ? `pds-border-radius-${this.borderRadius}` : ''}
|
|
6480
|
+
${this.direction != null && this.direction.trim() !== '' ? `pds-box-direction-${this.direction}` : ''}
|
|
6481
|
+
${this.display != null && this.display.trim() !== '' ? `pds-box--display-${this.display}` : ''}
|
|
6482
6482
|
${this.fit ? 'pds-box--fit' : ''}
|
|
6483
6483
|
${this.fitXs ? 'pds-box--fit-xs' : ''}
|
|
6484
6484
|
${this.fitSm ? 'pds-box--fit-sm' : ''}
|
|
6485
6485
|
${this.fitMd ? 'pds-box--fit-md' : ''}
|
|
6486
6486
|
${this.fitLg ? 'pds-box--fit-lg' : ''}
|
|
6487
6487
|
${this.fitXl ? 'pds-box--fit-xl' : ''}
|
|
6488
|
-
${this.gap
|
|
6489
|
-
${this.gapXs
|
|
6490
|
-
${this.gapSm
|
|
6491
|
-
${this.gapMd
|
|
6492
|
-
${this.gapLg
|
|
6493
|
-
${this.gapXl
|
|
6488
|
+
${this.gap != null && this.gap.trim() !== '' ? `pds-box-gap-${this.gap}` : ''}
|
|
6489
|
+
${this.gapXs != null && this.gapXs.trim() !== '' ? `pds-box-gap-xs-${this.gapXs}` : ''}
|
|
6490
|
+
${this.gapSm != null && this.gapSm.trim() !== '' ? `pds-box-gap-sm-${this.gapSm}` : ''}
|
|
6491
|
+
${this.gapMd != null && this.gapMd.trim() !== '' ? `pds-box-gap-md-${this.gapMd}` : ''}
|
|
6492
|
+
${this.gapLg != null && this.gapLg.trim() !== '' ? `pds-box-gap-lg-${this.gapLg}` : ''}
|
|
6493
|
+
${this.gapXl != null && this.gapXl.trim() !== '' ? `pds-box-gap-xl-${this.gapXl}` : ''}
|
|
6494
6494
|
${this.wrap ? 'pds-box--wrap' : ''}
|
|
6495
6495
|
${this.wrapXs ? 'pds-box--wrap-xs' : ''}
|
|
6496
6496
|
${this.wrapSm ? 'pds-box--wrap-sm' : ''}
|
|
6497
6497
|
${this.wrapMd ? 'pds-box--wrap-md' : ''}
|
|
6498
6498
|
${this.wrapLg ? 'pds-box--wrap-lg' : ''}
|
|
6499
6499
|
${this.wrapXl ? 'pds-box--wrap-xl' : ''}
|
|
6500
|
-
${this.flex
|
|
6501
|
-
${this.justifyContent
|
|
6502
|
-
${this.justifyContentXs
|
|
6503
|
-
${this.justifyContentSm
|
|
6504
|
-
${this.justifyContentMd
|
|
6505
|
-
${this.justifyContentLg
|
|
6506
|
-
${this.justifyContentXl
|
|
6507
|
-
${this.marginBlockStart
|
|
6508
|
-
${this.marginBlockStartXs
|
|
6509
|
-
${this.marginBlockStartSm
|
|
6510
|
-
${this.marginBlockStartMd
|
|
6511
|
-
${this.marginBlockStartLg
|
|
6512
|
-
${this.marginBlockStartXl
|
|
6513
|
-
${this.marginInlineStart
|
|
6514
|
-
${this.marginInlineStartXs
|
|
6515
|
-
${this.marginInlineStartSm
|
|
6516
|
-
${this.marginInlineStartMd
|
|
6517
|
-
${this.marginInlineStartLg
|
|
6518
|
-
${this.marginInlineStartXl
|
|
6519
|
-
${this.marginInlineEnd
|
|
6520
|
-
${this.marginInlineEndXs
|
|
6521
|
-
${this.marginInlineEndSm
|
|
6522
|
-
${this.marginInlineEndMd
|
|
6523
|
-
${this.marginInlineEndLg
|
|
6524
|
-
${this.marginInlineEndXl
|
|
6525
|
-
${this.marginBlockEnd
|
|
6526
|
-
${this.marginBlockEndXs
|
|
6527
|
-
${this.marginBlockEndSm
|
|
6528
|
-
${this.marginBlockEndMd
|
|
6529
|
-
${this.marginBlockEndLg
|
|
6530
|
-
${this.marginBlockEndXl
|
|
6531
|
-
${this.offset
|
|
6532
|
-
${this.offsetXs
|
|
6533
|
-
${this.offsetSm
|
|
6534
|
-
${this.offsetMd
|
|
6535
|
-
${this.offsetLg
|
|
6536
|
-
${this.offsetXl
|
|
6537
|
-
${this.padding
|
|
6538
|
-
${this.paddingXs
|
|
6539
|
-
${this.paddingSm
|
|
6540
|
-
${this.paddingMd
|
|
6541
|
-
${this.paddingLg
|
|
6542
|
-
${this.paddingXl
|
|
6543
|
-
${this.paddingBlockStart
|
|
6544
|
-
${this.paddingBlockStartXs
|
|
6545
|
-
${this.paddingBlockStartSm
|
|
6546
|
-
${this.paddingBlockStartMd
|
|
6547
|
-
${this.paddingBlockStartLg
|
|
6548
|
-
${this.paddingBlockStartXl
|
|
6549
|
-
${this.paddingBlockEnd
|
|
6550
|
-
${this.paddingBlockEndXs
|
|
6551
|
-
${this.paddingBlockEndSm
|
|
6552
|
-
${this.paddingBlockEndMd
|
|
6553
|
-
${this.paddingBlockEndLg
|
|
6554
|
-
${this.paddingBlockEndXl
|
|
6555
|
-
${this.paddingInlineStart
|
|
6556
|
-
${this.paddingInlineStartXs
|
|
6557
|
-
${this.paddingInlineStartSm
|
|
6558
|
-
${this.paddingInlineStartMd
|
|
6559
|
-
${this.paddingInlineStartLg
|
|
6560
|
-
${this.paddingInlineStartXl
|
|
6561
|
-
${this.paddingInlineEnd
|
|
6562
|
-
${this.paddingInlineEndXs
|
|
6563
|
-
${this.paddingInlineEndSm
|
|
6564
|
-
${this.paddingInlineEndMd
|
|
6565
|
-
${this.paddingInlineEndLg
|
|
6566
|
-
${this.paddingInlineEndXl
|
|
6567
|
-
${this.shadow
|
|
6568
|
-
${this.size
|
|
6569
|
-
${this.sizeXs
|
|
6570
|
-
${this.sizeSm
|
|
6571
|
-
${this.sizeMd
|
|
6572
|
-
${this.sizeLg
|
|
6573
|
-
${this.sizeXl
|
|
6500
|
+
${this.flex != null && this.flex.trim() !== '' && ['none', 'grow', 'shrink'].includes(this.flex) ? `pds-box--flex-${this.flex}` : ''}
|
|
6501
|
+
${this.justifyContent != null && this.justifyContent.trim() !== '' ? `pds-justify-content-${this.justifyContent}` : ''}
|
|
6502
|
+
${this.justifyContentXs != null && this.justifyContentXs.trim() !== '' ? `pds-justify-content-xs-${this.justifyContentXs}` : ''}
|
|
6503
|
+
${this.justifyContentSm != null && this.justifyContentSm.trim() !== '' ? `pds-justify-content-sm-${this.justifyContentSm}` : ''}
|
|
6504
|
+
${this.justifyContentMd != null && this.justifyContentMd.trim() !== '' ? `pds-justify-content-md-${this.justifyContentMd}` : ''}
|
|
6505
|
+
${this.justifyContentLg != null && this.justifyContentLg.trim() !== '' ? `pds-justify-content-lg-${this.justifyContentLg}` : ''}
|
|
6506
|
+
${this.justifyContentXl != null && this.justifyContentXl.trim() !== '' ? `pds-justify-content-xl-${this.justifyContentXl}` : ''}
|
|
6507
|
+
${this.marginBlockStart != null && this.marginBlockStart.trim() !== '' ? `pds-margin-block-start-${this.marginBlockStart}` : ''}
|
|
6508
|
+
${this.marginBlockStartXs != null && this.marginBlockStartXs.trim() !== '' ? `pds-margin-block-start-xs-${this.marginBlockStartXs}` : ''}
|
|
6509
|
+
${this.marginBlockStartSm != null && this.marginBlockStartSm.trim() !== '' ? `pds-margin-block-start-sm-${this.marginBlockStartSm}` : ''}
|
|
6510
|
+
${this.marginBlockStartMd != null && this.marginBlockStartMd.trim() !== '' ? `pds-margin-block-start-md-${this.marginBlockStartMd}` : ''}
|
|
6511
|
+
${this.marginBlockStartLg != null && this.marginBlockStartLg.trim() !== '' ? `pds-margin-block-start-lg-${this.marginBlockStartLg}` : ''}
|
|
6512
|
+
${this.marginBlockStartXl != null && this.marginBlockStartXl.trim() !== '' ? `pds-margin-block-start-xl-${this.marginBlockStartXl}` : ''}
|
|
6513
|
+
${this.marginInlineStart != null && this.marginInlineStart.trim() !== '' ? `pds-margin-inline-start-${this.marginInlineStart}` : ''}
|
|
6514
|
+
${this.marginInlineStartXs != null && this.marginInlineStartXs.trim() !== '' ? `pds-margin-inline-start-xs-${this.marginInlineStartXs}` : ''}
|
|
6515
|
+
${this.marginInlineStartSm != null && this.marginInlineStartSm.trim() !== '' ? `pds-margin-inline-start-sm-${this.marginInlineStartSm}` : ''}
|
|
6516
|
+
${this.marginInlineStartMd != null && this.marginInlineStartMd.trim() !== '' ? `pds-margin-inline-start-md-${this.marginInlineStartMd}` : ''}
|
|
6517
|
+
${this.marginInlineStartLg != null && this.marginInlineStartLg.trim() !== '' ? `pds-margin-inline-start-lg-${this.marginInlineStartLg}` : ''}
|
|
6518
|
+
${this.marginInlineStartXl != null && this.marginInlineStartXl.trim() !== '' ? `pds-margin-inline-start-xl-${this.marginInlineStartXl}` : ''}
|
|
6519
|
+
${this.marginInlineEnd != null && this.marginInlineEnd.trim() !== '' ? `pds-margin-inline-end-${this.marginInlineEnd}` : ''}
|
|
6520
|
+
${this.marginInlineEndXs != null && this.marginInlineEndXs.trim() !== '' ? `pds-margin-inline-end-xs-${this.marginInlineEndXs}` : ''}
|
|
6521
|
+
${this.marginInlineEndSm != null && this.marginInlineEndSm.trim() !== '' ? `pds-margin-inline-end-sm-${this.marginInlineEndSm}` : ''}
|
|
6522
|
+
${this.marginInlineEndMd != null && this.marginInlineEndMd.trim() !== '' ? `pds-margin-inline-end-md-${this.marginInlineEndMd}` : ''}
|
|
6523
|
+
${this.marginInlineEndLg != null && this.marginInlineEndLg.trim() !== '' ? `pds-margin-inline-end-lg-${this.marginInlineEndLg}` : ''}
|
|
6524
|
+
${this.marginInlineEndXl != null && this.marginInlineEndXl.trim() !== '' ? `pds-margin-inline-end-xl-${this.marginInlineEndXl}` : ''}
|
|
6525
|
+
${this.marginBlockEnd != null && this.marginBlockEnd.trim() !== '' ? `pds-margin-block-end-${this.marginBlockEnd}` : ''}
|
|
6526
|
+
${this.marginBlockEndXs != null && this.marginBlockEndXs.trim() !== '' ? `pds-margin-block-end-xs-${this.marginBlockEndXs}` : ''}
|
|
6527
|
+
${this.marginBlockEndSm != null && this.marginBlockEndSm.trim() !== '' ? `pds-margin-block-end-sm-${this.marginBlockEndSm}` : ''}
|
|
6528
|
+
${this.marginBlockEndMd != null && this.marginBlockEndMd.trim() !== '' ? `pds-margin-block-end-md-${this.marginBlockEndMd}` : ''}
|
|
6529
|
+
${this.marginBlockEndLg != null && this.marginBlockEndLg.trim() !== '' ? `pds-margin-block-end-lg-${this.marginBlockEndLg}` : ''}
|
|
6530
|
+
${this.marginBlockEndXl != null && this.marginBlockEndXl.trim() !== '' ? `pds-margin-block-end-xl-${this.marginBlockEndXl}` : ''}
|
|
6531
|
+
${this.offset != null && this.offset.trim() !== '' ? `pds-box-offset-${this.offset}` : ''}
|
|
6532
|
+
${this.offsetXs != null && this.offsetXs.trim() !== '' ? `pds-box-offset-xs-${this.offsetXs}` : ''}
|
|
6533
|
+
${this.offsetSm != null && this.offsetSm.trim() !== '' ? `pds-box-offset-sm-${this.offsetSm}` : ''}
|
|
6534
|
+
${this.offsetMd != null && this.offsetMd.trim() !== '' ? `pds-box-offset-md-${this.offsetMd}` : ''}
|
|
6535
|
+
${this.offsetLg != null && this.offsetLg.trim() !== '' ? `pds-box-offset-lg-${this.offsetLg}` : ''}
|
|
6536
|
+
${this.offsetXl != null && this.offsetXl.trim() !== '' ? `pds-box-offset-xl-${this.offsetXl}` : ''}
|
|
6537
|
+
${this.padding != null && this.padding.trim() !== '' ? `pds-padding-${this.padding}` : ''}
|
|
6538
|
+
${this.paddingXs != null && this.paddingXs.trim() !== '' ? `pds-padding-xs-${this.paddingXs}` : ''}
|
|
6539
|
+
${this.paddingSm != null && this.paddingSm.trim() !== '' ? `pds-padding-sm-${this.paddingSm}` : ''}
|
|
6540
|
+
${this.paddingMd != null && this.paddingMd.trim() !== '' ? `pds-padding-md-${this.paddingMd}` : ''}
|
|
6541
|
+
${this.paddingLg != null && this.paddingLg.trim() !== '' ? `pds-padding-lg-${this.paddingLg}` : ''}
|
|
6542
|
+
${this.paddingXl != null && this.paddingXl.trim() !== '' ? `pds-padding-xl-${this.paddingXl}` : ''}
|
|
6543
|
+
${this.paddingBlockStart != null && this.paddingBlockStart.trim() !== '' ? `pds-padding-block-start-${this.paddingBlockStart}` : ''}
|
|
6544
|
+
${this.paddingBlockStartXs != null && this.paddingBlockStartXs.trim() !== '' ? `pds-padding-block-start-xs-${this.paddingBlockStartXs}` : ''}
|
|
6545
|
+
${this.paddingBlockStartSm != null && this.paddingBlockStartSm.trim() !== '' ? `pds-padding-block-start-sm-${this.paddingBlockStartSm}` : ''}
|
|
6546
|
+
${this.paddingBlockStartMd != null && this.paddingBlockStartMd.trim() !== '' ? `pds-padding-block-start-md-${this.paddingBlockStartMd}` : ''}
|
|
6547
|
+
${this.paddingBlockStartLg != null && this.paddingBlockStartLg.trim() !== '' ? `pds-padding-block-start-lg-${this.paddingBlockStartLg}` : ''}
|
|
6548
|
+
${this.paddingBlockStartXl != null && this.paddingBlockStartXl.trim() !== '' ? `pds-padding-block-start-xl-${this.paddingBlockStartXl}` : ''}
|
|
6549
|
+
${this.paddingBlockEnd != null && this.paddingBlockEnd.trim() !== '' ? `pds-padding-block-end-${this.paddingBlockEnd}` : ''}
|
|
6550
|
+
${this.paddingBlockEndXs != null && this.paddingBlockEndXs.trim() !== '' ? `pds-padding-block-end-xs-${this.paddingBlockEndXs}` : ''}
|
|
6551
|
+
${this.paddingBlockEndSm != null && this.paddingBlockEndSm.trim() !== '' ? `pds-padding-block-end-sm-${this.paddingBlockEndSm}` : ''}
|
|
6552
|
+
${this.paddingBlockEndMd != null && this.paddingBlockEndMd.trim() !== '' ? `pds-padding-block-end-md-${this.paddingBlockEndMd}` : ''}
|
|
6553
|
+
${this.paddingBlockEndLg != null && this.paddingBlockEndLg.trim() !== '' ? `pds-padding-block-end-lg-${this.paddingBlockEndLg}` : ''}
|
|
6554
|
+
${this.paddingBlockEndXl != null && this.paddingBlockEndXl.trim() !== '' ? `pds-padding-block-end-xl-${this.paddingBlockEndXl}` : ''}
|
|
6555
|
+
${this.paddingInlineStart != null && this.paddingInlineStart.trim() !== '' ? `pds-padding-inline-start-${this.paddingInlineStart}` : ''}
|
|
6556
|
+
${this.paddingInlineStartXs != null && this.paddingInlineStartXs.trim() !== '' ? `pds-padding-inline-start-xs-${this.paddingInlineStartXs}` : ''}
|
|
6557
|
+
${this.paddingInlineStartSm != null && this.paddingInlineStartSm.trim() !== '' ? `pds-padding-inline-start-sm-${this.paddingInlineStartSm}` : ''}
|
|
6558
|
+
${this.paddingInlineStartMd != null && this.paddingInlineStartMd.trim() !== '' ? `pds-padding-inline-start-md-${this.paddingInlineStartMd}` : ''}
|
|
6559
|
+
${this.paddingInlineStartLg != null && this.paddingInlineStartLg.trim() !== '' ? `pds-padding-inline-start-lg-${this.paddingInlineStartLg}` : ''}
|
|
6560
|
+
${this.paddingInlineStartXl != null && this.paddingInlineStartXl.trim() !== '' ? `pds-padding-inline-start-xl-${this.paddingInlineStartXl}` : ''}
|
|
6561
|
+
${this.paddingInlineEnd != null && this.paddingInlineEnd.trim() !== '' ? `pds-padding-inline-end-${this.paddingInlineEnd}` : ''}
|
|
6562
|
+
${this.paddingInlineEndXs != null && this.paddingInlineEndXs.trim() !== '' ? `pds-padding-inline-end-xs-${this.paddingInlineEndXs}` : ''}
|
|
6563
|
+
${this.paddingInlineEndSm != null && this.paddingInlineEndSm.trim() !== '' ? `pds-padding-inline-end-sm-${this.paddingInlineEndSm}` : ''}
|
|
6564
|
+
${this.paddingInlineEndMd != null && this.paddingInlineEndMd.trim() !== '' ? `pds-padding-inline-end-md-${this.paddingInlineEndMd}` : ''}
|
|
6565
|
+
${this.paddingInlineEndLg != null && this.paddingInlineEndLg.trim() !== '' ? `pds-padding-inline-end-lg-${this.paddingInlineEndLg}` : ''}
|
|
6566
|
+
${this.paddingInlineEndXl != null && this.paddingInlineEndXl.trim() !== '' ? `pds-padding-inline-end-xl-${this.paddingInlineEndXl}` : ''}
|
|
6567
|
+
${this.shadow != null && this.shadow.trim() !== '' ? `pds-shadow-${this.shadow}` : ''}
|
|
6568
|
+
${this.size != null && this.size.trim() !== '' ? `pds-box pds-box-${this.size}` : ''}
|
|
6569
|
+
${this.sizeXs != null && this.sizeXs.trim() !== '' ? `pds-box-xs-${this.sizeXs}` : ''}
|
|
6570
|
+
${this.sizeSm != null && this.sizeSm.trim() !== '' ? `pds-box-sm-${this.sizeSm}` : ''}
|
|
6571
|
+
${this.sizeMd != null && this.sizeMd.trim() !== '' ? `pds-box-md-${this.sizeMd}` : ''}
|
|
6572
|
+
${this.sizeLg != null && this.sizeLg.trim() !== '' ? `pds-box-lg-${this.sizeLg}` : ''}
|
|
6573
|
+
${this.sizeXl != null && this.sizeXl.trim() !== '' ? `pds-box-xl-${this.sizeXl}` : ''}
|
|
6574
6574
|
${this.size == undefined &&
|
|
6575
6575
|
this.sizeSm == undefined &&
|
|
6576
6576
|
this.sizeMd == undefined &&
|
|
@@ -6582,7 +6582,7 @@ class PdsBox {
|
|
|
6582
6582
|
const normalizedBorder = normalizeColorValue$1(this.borderColor);
|
|
6583
6583
|
const boxInlineStyles = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (normalizedBackground && { '--color-background-box': normalizedBackground })), (normalizedBorder && { '--color-border-box': normalizedBorder })), (this.minHeight && { '--sizing-min-height-box': this.minHeight })), (this.minWidth && { '--sizing-min-width-box': this.minWidth })), (this.flex && !['none', 'grow', 'shrink'].includes(this.flex) && { 'flex': this.flex }));
|
|
6584
6584
|
this.hostKeeper.record(boxClasses, boxInlineStyles);
|
|
6585
|
-
return (hAsync(Host, { key: '
|
|
6585
|
+
return (hAsync(Host, { key: '8a1348247b5a4c546759232f0f155721798797e5', class: boxClasses, style: boxInlineStyles }));
|
|
6586
6586
|
}
|
|
6587
6587
|
get el() { return getElement(this); }
|
|
6588
6588
|
static get style() { return pdsBoxCss(); }
|
|
@@ -7066,7 +7066,7 @@ const isSpecTest = () => {
|
|
|
7066
7066
|
|
|
7067
7067
|
const labelCss$5 = () => `:host{display:inline-block}:host([aria-disabled=true]) label{color:var(--pine-color-text-label-disabled)}:host([aria-readonly=true]) label{color:var(--pine-color-text-label-readonly)}label{color:var(--pine-color-text-label);font:var(--pine-typography-body-medium);letter-spacing:var(--pine-letter-spacing)}`;
|
|
7068
7068
|
|
|
7069
|
-
const pdsCheckboxCss = () => `:host{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap}:host(.is-invalid) input{border-color:var(--pine-color-border-danger)}:host(.is-invalid) input:checked{background:var(--pine-color-danger)}:host(.is-invalid) input:checked::after{border-color:var(--pine-color-white)}:host(.is-invalid) input:checked:hover{background:var(--pine-color-danger-hover);border-color:var(--pine-color-border-danger-hover)}:host(.is-invalid) input:focus-visible{outline-color:var(--pine-color-focus-ring-danger)}:host(.is-invalid) label,:host(.is-invalid) .pds-checkbox__message--error{color:var(--pine-color-text-message-danger)}:host(.is-indeterminate) input{background:var(--pine-color-accent);border-color:var(--pine-color-accent)}:host(.is-indeterminate) input:hover{background:var(--pine-color-accent);border-color:var(--pine-color-accent-hover)}:host(.is-indeterminate) input::after{border:1px solid var(--pine-color-text-primary);-webkit-border-after:var(--pine-border-width-none);border-block-end:var(--pine-border-width-none);-webkit-border-before:var(--pine-border-width-none);border-block-start:var(--pine-border-width-none);-webkit-border-start:var(--pine-border-width-none);border-inline-start:var(--pine-border-width-none);content:"";display:block;height:7px;inset-block-start:50%;inset-inline-start:50%;position:absolute;-webkit-transform:translate(-50%, -50%) rotate(90deg);transform:translate(-50%, -50%) rotate(90deg);width:4px}input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--pine-color-background-container);border:var(--pine-border);border-radius:var(--pine-dimension-2xs);-ms-flex:none;flex:none;height:var(--pine-dimension-sm);margin:0;-webkit-margin-before:var(--pine-dimension-025);margin-block-start:var(--pine-dimension-025);position:relative;width:var(--pine-dimension-sm)}input:hover{background:var(--pine-color-background-container-hover);border:var(--pine-border-hover)}input:checked{background:var(--pine-color-accent);border-color:var(--pine-color-accent)}input:checked:hover{background:var(--pine-color-accent-hover);border-color:var(--pine-color-accent-hover)}input:checked::after{border:1px solid var(--pine-color-text-primary);-webkit-border-before:var(--pine-border-width-none);border-block-start:var(--pine-border-width-none);-webkit-border-start:var(--pine-border-width-none);border-inline-start:var(--pine-border-width-none);content:"";display:block;height:7px;inset-block-start:50%;inset-inline-start:50%;position:absolute;-webkit-transform:translate(-50%, -60%) rotate(43deg);transform:translate(-50%, -60%) rotate(43deg);width:4px}input:disabled{background:var(--pine-color-background-container-disabled);border-color:var(--pine-color-border-disabled);cursor:not-allowed}input:disabled:checked{background:var(--pine-color-background-container-disabled);border-color:var(--pine-color-border-disabled)}input:disabled:checked::after{border-color:var(--pine-color-border)}input:disabled+label{cursor:not-allowed}input:disabled~.pds-checkbox__message{color:var(--pine-color-text-disabled)}input:focus-visible{outline:var(--pine-outline-focus)}:host-context([dir=rtl]) input:checked::after{-webkit-transform:translate(-50%, -60%) rotate(-43deg);transform:translate(-50%, -60%) rotate(-43deg)}label{display:-ms-flexbox;display:flex;gap:var(--pine-dimension-xs)}:host(.has-label-slot) label{-ms-flex-align:center;align-items:center}:host(.has-label-slot) input{-webkit-margin-before:0;margin-block-start:0}.visually-hidden{border:0;clip:rect(0 0 0 0);-webkit-clip-path:polygon(0 0, 0 0, 0 0);clip-path:polygon(0 0, 0 0, 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pds-checkbox__message{color:var(--pine-color-text-message);font:var(--pine-typography-body-sm-medium);-webkit-margin-before:6px;margin-block-start:6px;-webkit-margin-start:var(--pine-dimension-md);margin-inline-start:var(--pine-dimension-md);width:100%}.pds-checkbox__message--error{display:-ms-flexbox;display:flex;gap:var(--pine-dimension-2xs)}.pds-checkbox__message--error pds-icon{-webkit-margin-before:var(--pine-dimension-025);margin-block-start:var(--pine-dimension-025)}`;
|
|
7069
|
+
const pdsCheckboxCss = () => `:host{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap}:host(.is-invalid) input{border-color:var(--pine-color-border-danger)}:host(.is-invalid) input:checked{background:var(--pine-color-danger)}:host(.is-invalid) input:checked::after{border-color:var(--pine-color-white)}:host(.is-invalid) input:checked:hover{background:var(--pine-color-danger-hover);border-color:var(--pine-color-border-danger-hover)}:host(.is-invalid) input:focus-visible{outline-color:var(--pine-color-focus-ring-danger)}:host(.is-invalid) label,:host(.is-invalid) .pds-checkbox__message--error{color:var(--pine-color-text-message-danger)}:host(.is-indeterminate) input{background:var(--pine-color-accent);border-color:var(--pine-color-accent)}:host(.is-indeterminate) input:hover{background:var(--pine-color-accent);border-color:var(--pine-color-accent-hover)}:host(.is-indeterminate) input::after{border:1px solid var(--pine-color-text-primary);-webkit-border-after:var(--pine-border-width-none);border-block-end:var(--pine-border-width-none);-webkit-border-before:var(--pine-border-width-none);border-block-start:var(--pine-border-width-none);-webkit-border-start:var(--pine-border-width-none);border-inline-start:var(--pine-border-width-none);content:"";display:block;height:7px;inset-block-start:50%;inset-inline-start:50%;position:absolute;-webkit-transform:translate(-50%, -50%) rotate(90deg);transform:translate(-50%, -50%) rotate(90deg);width:4px}input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--pine-color-background-container);border:var(--pine-border);border-radius:var(--pine-dimension-2xs);-ms-flex:none;flex:none;height:var(--pine-dimension-sm);margin:0;-webkit-margin-before:var(--pine-dimension-025);margin-block-start:var(--pine-dimension-025);position:relative;width:var(--pine-dimension-sm)}input:hover{background:var(--pine-color-background-container-hover);border:var(--pine-border-hover)}input:checked{background:var(--pine-color-accent);border-color:var(--pine-color-accent)}input:checked:hover{background:var(--pine-color-accent-hover);border-color:var(--pine-color-accent-hover)}input:checked::after{border:1px solid var(--pine-color-text-primary);-webkit-border-before:var(--pine-border-width-none);border-block-start:var(--pine-border-width-none);-webkit-border-start:var(--pine-border-width-none);border-inline-start:var(--pine-border-width-none);content:"";display:block;height:7px;inset-block-start:50%;inset-inline-start:50%;position:absolute;-webkit-transform:translate(-50%, -60%) rotate(43deg);transform:translate(-50%, -60%) rotate(43deg);width:4px}input:disabled{background:var(--pine-color-background-container-disabled);border-color:var(--pine-color-border-disabled);cursor:not-allowed}input:disabled:checked{background:var(--pine-color-background-container-disabled);border-color:var(--pine-color-border-disabled)}input:disabled:checked::after{border-color:var(--pine-color-border)}input:disabled+label{cursor:not-allowed}input:disabled~.pds-checkbox__message{color:var(--pine-color-text-disabled)}input:focus-visible{outline:var(--pine-outline-focus)}:host-context([dir=rtl]) input:checked::after{-webkit-transform:translate(-50%, -60%) rotate(-43deg);transform:translate(-50%, -60%) rotate(-43deg)}label{display:-ms-flexbox;display:flex;gap:var(--pine-dimension-xs)}:host(.has-label-slot) label{-ms-flex-align:center;align-items:center}:host(.has-label-slot) label,:host(.has-label-slot) label>span{min-width:0}:host(.has-label-slot) input{-webkit-margin-before:0;margin-block-start:0}.visually-hidden{border:0;clip:rect(0 0 0 0);-webkit-clip-path:polygon(0 0, 0 0, 0 0);clip-path:polygon(0 0, 0 0, 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pds-checkbox__message{color:var(--pine-color-text-message);font:var(--pine-typography-body-sm-medium);-webkit-margin-before:6px;margin-block-start:6px;-webkit-margin-start:var(--pine-dimension-md);margin-inline-start:var(--pine-dimension-md);width:100%}.pds-checkbox__message--error{display:-ms-flexbox;display:flex;gap:var(--pine-dimension-2xs)}.pds-checkbox__message--error pds-icon{-webkit-margin-before:var(--pine-dimension-025);margin-block-start:var(--pine-dimension-025)}`;
|
|
7070
7070
|
|
|
7071
7071
|
/**
|
|
7072
7072
|
* @slot label - Content displayed as the checkbox label in place of the `label` text. Clicking it toggles the checkbox.
|
|
@@ -7166,6 +7166,18 @@ class PdsCheckbox {
|
|
|
7166
7166
|
this.checked = state === (this.value || 'on');
|
|
7167
7167
|
}
|
|
7168
7168
|
}
|
|
7169
|
+
/**
|
|
7170
|
+
* Form Associated Custom Elements API: Called when the form is disabled
|
|
7171
|
+
*/
|
|
7172
|
+
formDisabledCallback(disabled) {
|
|
7173
|
+
// Also fires when this element's own `disabled` attribute is merely present, even as the
|
|
7174
|
+
// literal string "false" (a consumer's or React's attribute serialization can write that) —
|
|
7175
|
+
// the platform treats any value as disabled, independent of fieldset state. A real disabled
|
|
7176
|
+
// fieldset ancestor confirms this is genuinely that, not this element's own attribute.
|
|
7177
|
+
if (disabled && !this.el.closest('fieldset[disabled]'))
|
|
7178
|
+
return;
|
|
7179
|
+
this.disabled = disabled;
|
|
7180
|
+
}
|
|
7169
7181
|
componentWillLoad() {
|
|
7170
7182
|
this.inheritedAttributes = Object.assign({}, inheritAriaAttributes(this.el));
|
|
7171
7183
|
this.updateHasLabelSlot();
|
|
@@ -7173,9 +7185,9 @@ class PdsCheckbox {
|
|
|
7173
7185
|
render() {
|
|
7174
7186
|
const hostClass = this.classNames();
|
|
7175
7187
|
this.hostKeeper.record(hostClass);
|
|
7176
|
-
return (hAsync(Host, { key: '
|
|
7177
|
-
hAsync("div", { key: '
|
|
7178
|
-
hAsync("div", { key: '
|
|
7188
|
+
return (hAsync(Host, { key: 'bbe09a5e9eb55f62b2921b09a04ddc9476a871ae', class: hostClass }, hAsync("label", { key: 'fa1856d9306eb8c0c19618ea5e2619ea20c3c51d', htmlFor: this.componentId }, hAsync("input", Object.assign({ key: '8537d97a8e69a17d0d563306dac179e393885dda', type: "checkbox", "aria-describedby": assignDescription(this.componentId, this.invalid, this.helperMessage, this.errorMessage), "aria-invalid": this.invalid ? "true" : undefined, id: this.componentId, indeterminate: this.indeterminate, name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onChange: this.handleCheckboxChange, onInput: this.handleInput }, this.inheritedAttributes)), hAsync("span", { key: 'e523922889c80a2d18243cb560cd855bab95803d', class: this.hideLabel ? 'visually-hidden' : '' }, hAsync("slot", { key: 'b6ff34ecbc346d254a0211bfa610823feedb486b', name: "label", onSlotchange: this.updateHasLabelSlot }), !this.hasLabelSlot && this.label)), this.helperMessage &&
|
|
7189
|
+
hAsync("div", { key: '55dcca850dff0aa93d9ba63d6827d9155ac35dab', class: 'pds-checkbox__message', id: messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
|
|
7190
|
+
hAsync("div", { key: '5af843679994d29f084d41e90e41e0939c951063', class: `pds-checkbox__message pds-checkbox__message--error`, id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, hAsync("pds-icon", { key: '10f7efe5d4b252d9dea6f398eff973ba32506898', icon: danger, size: "small" }), this.errorMessage)));
|
|
7179
7191
|
}
|
|
7180
7192
|
static get formAssociated() { return true; }
|
|
7181
7193
|
get el() { return getElement(this); }
|
|
@@ -8986,7 +8998,7 @@ function isOverflowing(el) {
|
|
|
8986
8998
|
* @returns A cleanup function that removes all listeners, observers, and DOM elements.
|
|
8987
8999
|
*/
|
|
8988
9000
|
function setupTruncationTooltip(options) {
|
|
8989
|
-
const { hostEl, contentEl, getTooltipText, placement = 'top', manageTabIndex = true } = options;
|
|
9001
|
+
const { hostEl, contentEl, getTooltipText, placement = 'top', reference = hostEl, manageTabIndex = true, focusEl = hostEl } = options;
|
|
8990
9002
|
injectStyles();
|
|
8991
9003
|
let portalEl = null;
|
|
8992
9004
|
let isHovering = false;
|
|
@@ -9081,7 +9093,7 @@ function setupTruncationTooltip(options) {
|
|
|
9081
9093
|
if (!portalEl)
|
|
9082
9094
|
return;
|
|
9083
9095
|
try {
|
|
9084
|
-
const { x, y } = await computePosition(
|
|
9096
|
+
const { x, y } = await computePosition(reference, portalEl, {
|
|
9085
9097
|
placement,
|
|
9086
9098
|
strategy: 'fixed',
|
|
9087
9099
|
middleware: [offset(4), flip(), shift({ padding: 5 })],
|
|
@@ -9094,7 +9106,7 @@ function setupTruncationTooltip(options) {
|
|
|
9094
9106
|
catch (_a) {
|
|
9095
9107
|
// Fallback: position above the element with bounds checking
|
|
9096
9108
|
if (portalEl) {
|
|
9097
|
-
const rect =
|
|
9109
|
+
const rect = reference.getBoundingClientRect();
|
|
9098
9110
|
const portalRect = portalEl.getBoundingClientRect();
|
|
9099
9111
|
const padding = 5;
|
|
9100
9112
|
// Ensure tooltip stays within viewport bounds
|
|
@@ -9180,8 +9192,8 @@ function setupTruncationTooltip(options) {
|
|
|
9180
9192
|
}
|
|
9181
9193
|
hostEl.addEventListener('mouseenter', handleMouseEnter);
|
|
9182
9194
|
hostEl.addEventListener('mouseleave', handleMouseLeave);
|
|
9183
|
-
|
|
9184
|
-
|
|
9195
|
+
focusEl.addEventListener('focusin', handleFocusIn);
|
|
9196
|
+
focusEl.addEventListener('focusout', handleFocusOut);
|
|
9185
9197
|
// Return cleanup function
|
|
9186
9198
|
return () => {
|
|
9187
9199
|
disposed = true;
|
|
@@ -9201,8 +9213,8 @@ function setupTruncationTooltip(options) {
|
|
|
9201
9213
|
}
|
|
9202
9214
|
hostEl.removeEventListener('mouseenter', handleMouseEnter);
|
|
9203
9215
|
hostEl.removeEventListener('mouseleave', handleMouseLeave);
|
|
9204
|
-
|
|
9205
|
-
|
|
9216
|
+
focusEl.removeEventListener('focusin', handleFocusIn);
|
|
9217
|
+
focusEl.removeEventListener('focusout', handleFocusOut);
|
|
9206
9218
|
removePortal();
|
|
9207
9219
|
};
|
|
9208
9220
|
}
|
|
@@ -9221,6 +9233,26 @@ const SENTIMENT_DOT_COLORS = {
|
|
|
9221
9233
|
success: 'var(--pine-chip-color-success-dot)',
|
|
9222
9234
|
warning: 'var(--pine-chip-color-warning-dot)',
|
|
9223
9235
|
};
|
|
9236
|
+
// Controls a chip can sit inside that already take focus, so a clipped label adds no tab stop of its own.
|
|
9237
|
+
// Not any `[tabindex]`: a focusable scroll region full of chips would show every chip's tooltip at once.
|
|
9238
|
+
const FOCUSABLE_WRAPPER = 'a[href], button, summary, pds-button, pds-link, pds-tab, pds-dropdown-menu-item, [role="option"]';
|
|
9239
|
+
// Beside the listbox and level with the option, so the tooltip never covers the other options.
|
|
9240
|
+
function besideListbox(wrapper) {
|
|
9241
|
+
const option = (wrapper === null || wrapper === void 0 ? void 0 : wrapper.matches('[role="option"]')) ? wrapper : null;
|
|
9242
|
+
const listbox = option === null || option === void 0 ? void 0 : option.closest('[role="listbox"]');
|
|
9243
|
+
if (!option || !listbox)
|
|
9244
|
+
return {};
|
|
9245
|
+
return {
|
|
9246
|
+
placement: 'right',
|
|
9247
|
+
reference: {
|
|
9248
|
+
getBoundingClientRect: () => {
|
|
9249
|
+
const { top, bottom, height } = option.getBoundingClientRect();
|
|
9250
|
+
const { left, right, width } = listbox.getBoundingClientRect();
|
|
9251
|
+
return { x: left, y: top, top, left, bottom, right, width, height };
|
|
9252
|
+
},
|
|
9253
|
+
},
|
|
9254
|
+
};
|
|
9255
|
+
}
|
|
9224
9256
|
/**
|
|
9225
9257
|
* @slot (default) - The chip's label text.
|
|
9226
9258
|
* @part button
|
|
@@ -9261,6 +9293,11 @@ class PdsChip {
|
|
|
9261
9293
|
}
|
|
9262
9294
|
connectedCallback() {
|
|
9263
9295
|
this.hostKeeper.connect(this.el);
|
|
9296
|
+
// A moved chip reconnects without re-rendering, so componentDidRender won't re-bind what
|
|
9297
|
+
// disconnectedCallback tore down. Before the first render there's no label, and it binds there.
|
|
9298
|
+
if (this.maxWidth && this.labelTextEl) {
|
|
9299
|
+
this.initTruncationTooltip();
|
|
9300
|
+
}
|
|
9264
9301
|
}
|
|
9265
9302
|
// Bind (and re-bind) here, not just on load: changing variant/size remounts
|
|
9266
9303
|
// the label span, so the tooltip has to re-attach to the current node or it
|
|
@@ -9285,16 +9322,15 @@ class PdsChip {
|
|
|
9285
9322
|
initTruncationTooltip() {
|
|
9286
9323
|
this.destroyTruncationTooltip();
|
|
9287
9324
|
if (this.labelTextEl) {
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
contentEl: this.labelTextEl,
|
|
9291
|
-
getTooltipText: () => this.el.textContent || '',
|
|
9325
|
+
const wrapper = this.el.closest(FOCUSABLE_WRAPPER);
|
|
9326
|
+
this.truncationCleanup = setupTruncationTooltip(Object.assign({ hostEl: this.el, contentEl: this.labelTextEl, getTooltipText: () => this.el.textContent || '',
|
|
9292
9327
|
// The dropdown variant's label span already sits inside
|
|
9293
9328
|
// `<button class="pds-chip__button">`, which is already focusable and
|
|
9294
9329
|
// bubbles focusin to the host — a tabindex on the span too would nest
|
|
9295
9330
|
// a second tab stop inside the button.
|
|
9296
|
-
manageTabIndex: this.effectiveVariant !== 'dropdown',
|
|
9297
|
-
|
|
9331
|
+
manageTabIndex: this.effectiveVariant !== 'dropdown' && !wrapper,
|
|
9332
|
+
// A wrapping control sits outside the host, so its focus never reaches the host's listener.
|
|
9333
|
+
focusEl: wrapper !== null && wrapper !== void 0 ? wrapper : this.el }, besideListbox(wrapper)));
|
|
9298
9334
|
this.tooltipBoundEl = this.labelTextEl;
|
|
9299
9335
|
}
|
|
9300
9336
|
}
|
|
@@ -9351,7 +9387,8 @@ class PdsChip {
|
|
|
9351
9387
|
// label span already sits inside `<button class="pds-chip__button">`,
|
|
9352
9388
|
// which is already focusable and bubbles focusin to the host, so
|
|
9353
9389
|
// initTruncationTooltip passes `manageTabIndex: false` there to avoid
|
|
9354
|
-
// nesting a second tab stop inside the button.
|
|
9390
|
+
// nesting a second tab stop inside the button. The same goes for a chip
|
|
9391
|
+
// inside a consumer's own focusable control (FOCUSABLE_WRAPPER).
|
|
9355
9392
|
const chipContent = isDropdown ? (hAsync("button", { class: "pds-chip__button", type: "button", part: "button" }, this.icon && hAsync("pds-icon", { class: "pds-chip__icon", part: "icon", icon: this.icon, size: this.iconSize, "aria-hidden": "true" }), showDot && hAsync("i", { class: "pds-chip__dot", part: "dot", "aria-hidden": "true" }), hAsync("span", { class: "pds-chip__label-text", ref: (el) => (this.labelTextEl = el) }, hAsync("slot", null)), hAsync("pds-icon", { icon: downSmall, size: this.iconSize, "aria-hidden": "true" }))) : (hAsync("span", { class: "pds-chip__label" }, this.icon && hAsync("pds-icon", { class: "pds-chip__icon", part: "icon", icon: this.icon, size: this.iconSize, "aria-hidden": "true" }), showDot && hAsync("i", { class: "pds-chip__dot", part: "dot", "aria-hidden": "true" }), hAsync("span", { class: "pds-chip__label-text", ref: (el) => (this.labelTextEl = el) }, hAsync("slot", null))));
|
|
9356
9393
|
return chipContent;
|
|
9357
9394
|
}
|
|
@@ -9425,7 +9462,7 @@ class PdsChip {
|
|
|
9425
9462
|
const hostClass = this.classNames();
|
|
9426
9463
|
const hostStyles = this.hostStyles;
|
|
9427
9464
|
this.hostKeeper.record(hostClass, hostStyles);
|
|
9428
|
-
return (hAsync(Host, { key: '
|
|
9465
|
+
return (hAsync(Host, { key: 'f82d84a7f0a4f1c980d47bf75cd4ffeef042607d', class: hostClass, id: this.componentId, style: hostStyles }, this.setChipContent(), this.effectiveVariant === 'tag' && this.renderCloseButton()));
|
|
9429
9466
|
}
|
|
9430
9467
|
get el() { return getElement(this); }
|
|
9431
9468
|
static get style() { return pdsChipTokensCss() + pdsChipCss(); }
|
|
@@ -11623,6 +11660,9 @@ class PdsCombobox {
|
|
|
11623
11660
|
};
|
|
11624
11661
|
// Handler for button trigger click
|
|
11625
11662
|
this.onButtonTriggerClick = () => {
|
|
11663
|
+
// The button and chip triggers are divs, so a click reaches them even while disabled.
|
|
11664
|
+
if (this.disabled)
|
|
11665
|
+
return;
|
|
11626
11666
|
this.isOpen = !this.isOpen;
|
|
11627
11667
|
if (this.isOpen) {
|
|
11628
11668
|
this.prepareExpandFilterListOnOpen();
|
|
@@ -11642,6 +11682,13 @@ class PdsCombobox {
|
|
|
11642
11682
|
};
|
|
11643
11683
|
// Handler for button trigger keyboard events
|
|
11644
11684
|
this.onButtonTriggerKeyDown = (e) => {
|
|
11685
|
+
// Disabled takes it out of the tab order, but setFocus() or a click can still focus it.
|
|
11686
|
+
if (this.disabled) {
|
|
11687
|
+
// Keep Space from scrolling the page, as on a native disabled button.
|
|
11688
|
+
if (e.key === ' ')
|
|
11689
|
+
e.preventDefault();
|
|
11690
|
+
return;
|
|
11691
|
+
}
|
|
11645
11692
|
// Escape closes an open group before the dropdown. Other keys reach the tree through handleKeyDown.
|
|
11646
11693
|
if (this.isOpen && e.key === 'Escape' && this.handleGroupedPanelKey(e))
|
|
11647
11694
|
return;
|
|
@@ -11662,8 +11709,9 @@ class PdsCombobox {
|
|
|
11662
11709
|
}, 0);
|
|
11663
11710
|
}
|
|
11664
11711
|
else if (e.key === 'Escape') {
|
|
11665
|
-
|
|
11712
|
+
// Only an open dropdown claims Escape; a closed one leaves it to a modal or popover around it.
|
|
11666
11713
|
if (this.isOpen) {
|
|
11714
|
+
e.preventDefault();
|
|
11667
11715
|
this.isOpen = false;
|
|
11668
11716
|
this.highlightedIndex = -1;
|
|
11669
11717
|
this.clearExpandFilterList();
|
|
@@ -11774,6 +11822,18 @@ class PdsCombobox {
|
|
|
11774
11822
|
this.internals = this.el.attachInternals();
|
|
11775
11823
|
}
|
|
11776
11824
|
}
|
|
11825
|
+
/**
|
|
11826
|
+
* Form Associated Custom Elements API: Called when the form is disabled
|
|
11827
|
+
*/
|
|
11828
|
+
formDisabledCallback(disabled) {
|
|
11829
|
+
// Also fires when this element's own `disabled` attribute is merely present, even as the
|
|
11830
|
+
// literal string "false" (a consumer's or React's attribute serialization can write that) —
|
|
11831
|
+
// the platform treats any value as disabled, independent of fieldset state. A real disabled
|
|
11832
|
+
// fieldset ancestor confirms this is genuinely that, not this element's own attribute.
|
|
11833
|
+
if (disabled && !this.el.closest('fieldset[disabled]'))
|
|
11834
|
+
return;
|
|
11835
|
+
this.disabled = disabled;
|
|
11836
|
+
}
|
|
11777
11837
|
componentWillLoad() {
|
|
11778
11838
|
this.originalSearchEmitter = this.pdsComboboxSearch;
|
|
11779
11839
|
this.updateOptions();
|
|
@@ -11908,6 +11968,22 @@ class PdsCombobox {
|
|
|
11908
11968
|
if (this.isOpen && this.hidesPanelSearch && this.panelTreeEl)
|
|
11909
11969
|
this.focusPanel(this.panelTreeEl);
|
|
11910
11970
|
}
|
|
11971
|
+
disabledChanged(disabled) {
|
|
11972
|
+
var _a, _b, _c, _d, _e;
|
|
11973
|
+
if (!disabled || !this.isOpen)
|
|
11974
|
+
return;
|
|
11975
|
+
const shadowActive = (_b = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.activeElement) !== null && _b !== void 0 ? _b : null;
|
|
11976
|
+
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)));
|
|
11977
|
+
this.isOpen = false;
|
|
11978
|
+
this.highlightedIndex = -1;
|
|
11979
|
+
this.isArrowKeyNavigationMode = false;
|
|
11980
|
+
this.clearExpandFilterList();
|
|
11981
|
+
this.updateAriaActiveDescendant();
|
|
11982
|
+
// Closing removes the search field or option that held focus. A button or chip trigger can still
|
|
11983
|
+
// take it (aria-disabled), so focus doesn't fall to the page; a disabled input can't, as natively.
|
|
11984
|
+
if (focusInDropdown && this.trigger !== 'input')
|
|
11985
|
+
this.restoreFocusToTrigger();
|
|
11986
|
+
}
|
|
11911
11987
|
isOpenChanged(isOpen) {
|
|
11912
11988
|
if (!isOpen) {
|
|
11913
11989
|
this.revealedGroupLabel = null;
|
|
@@ -13045,7 +13121,8 @@ class PdsCombobox {
|
|
|
13045
13121
|
return this.selectedOption ? this.selectedOption.value : null;
|
|
13046
13122
|
}
|
|
13047
13123
|
/**
|
|
13048
|
-
* Clears the selected value and resets the component.
|
|
13124
|
+
* Clears the selected value and resets the component. Works while disabled too, as setting a
|
|
13125
|
+
* native control's value from script does.
|
|
13049
13126
|
*/
|
|
13050
13127
|
async clear() {
|
|
13051
13128
|
const hadValue = this.value !== '' || this.displayText !== '';
|
|
@@ -13622,13 +13699,13 @@ class PdsCombobox {
|
|
|
13622
13699
|
]
|
|
13623
13700
|
.filter(Boolean)
|
|
13624
13701
|
.join(' ');
|
|
13625
|
-
return (hAsync(Host, { key: '
|
|
13702
|
+
return (hAsync(Host, { key: 'ead770a3b7ba531a1cfdc6b02aef6d7159481ed0', "aria-disabled": this.disabled ? 'true' : null }, hAsync("div", { key: '3ca6fd299acd1db8a0e476eee5f7606bc6153625', class: "pds-combobox", tabIndex: -1, onFocusout: this.onComboboxFocusOut, part: "combobox" }, this.hasVisibleLabel && (hAsync("label", { key: '44c72d099c5ccddce18400b9d3c66158f485de05', htmlFor: this.trigger === 'input' ? this.componentId : undefined, id: this.labelId, class: "pds-combobox__label", onClick: this.onLabelClick }, this.label)), this.trigger === 'input' ? (hAsync("div", { class: "pds-combobox__input-wrapper", style: { width: this.triggerWidth } }, hAsync("input", { ref: el => {
|
|
13626
13703
|
this.inputEl = el;
|
|
13627
13704
|
this.triggerEl = el;
|
|
13628
13705
|
}, class: {
|
|
13629
13706
|
'pds-combobox__input': true,
|
|
13630
13707
|
'pds-combobox__input--invalid': this.isInvalid(),
|
|
13631
|
-
}, 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" }), hAsync("pds-icon", { icon: "enlarge", "aria-hidden": "true", class: "pds-combobox__input-icon" }))) : this.trigger === 'chip' ? (hAsync("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())) : (hAsync("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(), hAsync("div", { key: '
|
|
13708
|
+
}, 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" }), hAsync("pds-icon", { icon: "enlarge", "aria-hidden": "true", class: "pds-combobox__input-icon" }))) : this.trigger === 'chip' ? (hAsync("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())) : (hAsync("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(), hAsync("div", { key: '349af9dc6fdae018d4443b178e21b1627fcc85ca', style: { display: 'none' } }, hAsync("slot", { key: '9af42db6d08f148b7d7b5e4b3199f7c9af7699a4', onSlotchange: () => this.updateOptions() })), this.renderDropdown(), this.groupDisplay !== 'inline' && [
|
|
13632
13709
|
hAsync("span", { key: "drill-status", class: "visually-hidden", role: "status", "aria-live": "polite" }, this.isOpen && this.effectiveGroupDisplay === 'drill-in' && this.openGroup !== null ? this.openGroup.label : ''),
|
|
13633
13710
|
// Its own region: sharing one, revealing a row then opening it would leave the text the
|
|
13634
13711
|
// same, and opening the group would go unannounced.
|
|
@@ -13647,6 +13724,9 @@ class PdsCombobox {
|
|
|
13647
13724
|
"flyoutFallback": [{
|
|
13648
13725
|
"flyoutFallbackChanged": 0
|
|
13649
13726
|
}],
|
|
13727
|
+
"disabled": [{
|
|
13728
|
+
"disabledChanged": 0
|
|
13729
|
+
}],
|
|
13650
13730
|
"isOpen": [{
|
|
13651
13731
|
"isOpenChanged": 0
|
|
13652
13732
|
}],
|
|
@@ -13823,6 +13903,11 @@ class PdsCopytext {
|
|
|
13823
13903
|
}
|
|
13824
13904
|
connectedCallback() {
|
|
13825
13905
|
this.hostKeeper.connect(this.el);
|
|
13906
|
+
// componentDidLoad runs once, so a moved element re-binds here what disconnectedCallback tore
|
|
13907
|
+
// down. Before the first render there's no valueSpanEl yet, and componentDidLoad binds it.
|
|
13908
|
+
if (this.truncate && this.valueSpanEl) {
|
|
13909
|
+
this.initTruncationTooltip();
|
|
13910
|
+
}
|
|
13826
13911
|
}
|
|
13827
13912
|
restoreBorderDefault(newValue) {
|
|
13828
13913
|
this.border = restoreReflectedDefault(this.el, 'border', newValue, true);
|
|
@@ -13885,7 +13970,7 @@ class PdsCopytext {
|
|
|
13885
13970
|
render() {
|
|
13886
13971
|
const hostClass = this.classNames();
|
|
13887
13972
|
this.hostKeeper.record(hostClass);
|
|
13888
|
-
return (hAsync(Host, { key: '
|
|
13973
|
+
return (hAsync(Host, { key: 'a3517b135fc3e3677e30b6ad5811c1170a819b65', class: hostClass, id: this.componentId }, hAsync("pds-button", { key: '02f56bed02ed3963a3d80a92148d6619a845224a', type: "button", variant: "unstyled", onClick: this.handleClick }, hAsync("span", { key: '95fd1284e3d227b74dab613eb71f5385c3a0be29', ref: (el) => this.valueSpanEl = el }, this.value), hAsync("pds-icon", { key: '21af67a8c9165e56d2d2b0cf19df7c7e3f290c72', "aria-hidden": "true", icon: copy, size: "16px" }))));
|
|
13889
13974
|
}
|
|
13890
13975
|
get el() { return getElement(this); }
|
|
13891
13976
|
static get watchers() { return {
|
|
@@ -16080,22 +16165,24 @@ function unwrapReconnectedContent(container, selector, contentSelector) {
|
|
|
16080
16165
|
}
|
|
16081
16166
|
}
|
|
16082
16167
|
|
|
16083
|
-
const pdsDrawerCss = () => `.pds-drawer__modal>.pds-modal__backdrop{-ms-flex-align:stretch;align-items:stretch
|
|
16168
|
+
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}`;
|
|
16084
16169
|
|
|
16085
|
-
// Known selectors for content Pine components portal
|
|
16086
|
-
//
|
|
16170
|
+
// Known selectors for content Pine components portal out of place rather than
|
|
16171
|
+
// rendering where they are — pds-tooltip and pds-combobox's dropdown in
|
|
16172
|
+
// document.body, pds-popover in the body or the open dialog it's in.
|
|
16087
16173
|
// A pointerdown landing on one of these is not "outside" the drawer in the
|
|
16088
16174
|
// sense light dismiss cares about: it belongs to an overlay something inside
|
|
16089
16175
|
// the drawer opened, even though it is not a DOM descendant of the drawer.
|
|
16090
16176
|
const PORTALED_OVERLAY_SELECTOR = '.pds-popover, .pds-tooltip, .pds-combobox-dropdown-portal';
|
|
16091
16177
|
/**
|
|
16092
|
-
* A
|
|
16178
|
+
* A side panel composed from `pds-modal`, non-modal by default.
|
|
16093
16179
|
*
|
|
16094
|
-
*
|
|
16095
|
-
* dimming, no blur, no scroll lock, no click blocking.
|
|
16096
|
-
* `pds-modal` internally with `disableTopLayer`
|
|
16097
|
-
* suppressed, and adds the edge, width and dismiss behavior a
|
|
16098
|
-
* needs on top.
|
|
16180
|
+
* By default, unlike `pds-modal`, the page stays interactive while a drawer
|
|
16181
|
+
* is open: no dimming, no blur, no scroll lock, no click blocking.
|
|
16182
|
+
* `pds-drawer` renders a `pds-modal` internally with `disableTopLayer` on and
|
|
16183
|
+
* its backdrop suppressed, and adds the edge, width and dismiss behavior a
|
|
16184
|
+
* side panel needs on top. With `modal`, it opens that `pds-modal` in the top
|
|
16185
|
+
* layer instead and keeps its backdrop. It does not reimplement focus, Escape or dialog semantics —
|
|
16099
16186
|
* those come from `pds-modal` unchanged.
|
|
16100
16187
|
* @lightDom renders-markup
|
|
16101
16188
|
*/
|
|
@@ -16126,8 +16213,18 @@ class PdsDrawer {
|
|
|
16126
16213
|
*/
|
|
16127
16214
|
this.scrollable = true;
|
|
16128
16215
|
/**
|
|
16129
|
-
* Whether the drawer
|
|
16130
|
-
*
|
|
16216
|
+
* Whether the drawer is modal. A modal drawer dims the page behind it with a
|
|
16217
|
+
* backdrop, makes the page inert, and keeps focus inside the drawer, like
|
|
16218
|
+
* `pds-modal`. Use it for a task the page should wait on. Leave it off for a
|
|
16219
|
+
* panel people work alongside the page. Read when the drawer opens; changing
|
|
16220
|
+
* it while the drawer is open is not supported.
|
|
16221
|
+
* @default false
|
|
16222
|
+
*/
|
|
16223
|
+
this.modal = false;
|
|
16224
|
+
/**
|
|
16225
|
+
* Whether the drawer can be dismissed with a pointerdown outside it (in a
|
|
16226
|
+
* `modal` drawer, a click on its backdrop).
|
|
16227
|
+
* Replaces `pds-modal`'s `backdropDismiss`.
|
|
16131
16228
|
* This also gates Escape, matching how `backdropDismiss` gates Escape on
|
|
16132
16229
|
* `pds-modal` today: setting this to `false` means the close button is the
|
|
16133
16230
|
* only way out.
|
|
@@ -16146,7 +16243,8 @@ class PdsDrawer {
|
|
|
16146
16243
|
* background event while the user is mid-task elsewhere on the page —
|
|
16147
16244
|
* moving focus there would interrupt them, and the page stays live under
|
|
16148
16245
|
* a non-modal drawer, so it is a genuine data-entry risk, not just an
|
|
16149
|
-
* annoyance.
|
|
16246
|
+
* annoyance. A `modal` drawer ignores `none`: the page behind it is inert,
|
|
16247
|
+
* so focus starts in the drawer.
|
|
16150
16248
|
* @default 'auto'
|
|
16151
16249
|
*/
|
|
16152
16250
|
this.initialFocus = 'auto';
|
|
@@ -16192,7 +16290,8 @@ class PdsDrawer {
|
|
|
16192
16290
|
// page underneath stays genuinely clickable, which means a click there
|
|
16193
16291
|
// never reaches pds-modal's backdrop element at all.
|
|
16194
16292
|
handleOutsidePointerDown(e) {
|
|
16195
|
-
|
|
16293
|
+
// A modal drawer's backdrop takes the click instead, through pds-modal.
|
|
16294
|
+
if (this.modal || !this.lightDismiss || !this.open)
|
|
16196
16295
|
return;
|
|
16197
16296
|
const target = e.target;
|
|
16198
16297
|
if (!target)
|
|
@@ -16202,7 +16301,7 @@ class PdsDrawer {
|
|
|
16202
16301
|
if (target.closest(PORTALED_OVERLAY_SELECTOR))
|
|
16203
16302
|
return;
|
|
16204
16303
|
// A datepicker's portaled calendar counts as inside only when its datepicker is in the drawer,
|
|
16205
|
-
// or in an overlay portaled from it (a pds-popover in the drawer puts its content
|
|
16304
|
+
// or in an overlay portaled from it (a pds-popover in the drawer puts its content beside it).
|
|
16206
16305
|
const calendar = target.closest('.pds-datepicker-calendar-portal');
|
|
16207
16306
|
const owner = calendar === null || calendar === void 0 ? void 0 : calendar.pdsDatepicker;
|
|
16208
16307
|
if (owner && (containsComposed$1(this.el, owner) || closest$1(PORTALED_OVERLAY_SELECTOR, owner)))
|
|
@@ -16218,11 +16317,11 @@ class PdsDrawer {
|
|
|
16218
16317
|
this.open = false;
|
|
16219
16318
|
}
|
|
16220
16319
|
render() {
|
|
16221
|
-
return (hAsync(Host, { key: '
|
|
16320
|
+
return (hAsync(Host, { key: '287bf043c991209488eb1b617031acffb59ff9af', class: {
|
|
16222
16321
|
'pds-drawer': true,
|
|
16223
16322
|
[`pds-drawer--${this.side}`]: true,
|
|
16224
16323
|
[`pds-drawer--${this.size}`]: true,
|
|
16225
|
-
} }, hAsync("pds-modal", { key: '
|
|
16324
|
+
} }, hAsync("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' }, hAsync("slot", { key: '56bbe9b5c26b10b07c0f503ba147899a57a5de85' }))));
|
|
16226
16325
|
}
|
|
16227
16326
|
get el() { return getElement(this); }
|
|
16228
16327
|
static get style() { return pdsDrawerCss(); }
|
|
@@ -16235,6 +16334,7 @@ class PdsDrawer {
|
|
|
16235
16334
|
"side": [1],
|
|
16236
16335
|
"size": [1],
|
|
16237
16336
|
"scrollable": [4],
|
|
16337
|
+
"modal": [4],
|
|
16238
16338
|
"lightDismiss": [4, "light-dismiss"],
|
|
16239
16339
|
"initialFocus": [1, "initial-focus"]
|
|
16240
16340
|
},
|
|
@@ -16586,15 +16686,19 @@ class PdsDropdownMenu {
|
|
|
16586
16686
|
this.focusItemByIndex(prevIndex);
|
|
16587
16687
|
}
|
|
16588
16688
|
}
|
|
16689
|
+
// Escape is taken in document's capture phase, before a modal around the menu hears it on
|
|
16690
|
+
// document and closes too.
|
|
16691
|
+
handleEscapeKeyDown(event) {
|
|
16692
|
+
if (!this.isOpen || event.key !== 'Escape' || event.defaultPrevented)
|
|
16693
|
+
return;
|
|
16694
|
+
event.preventDefault();
|
|
16695
|
+
this.closeDropdown();
|
|
16696
|
+
}
|
|
16589
16697
|
// Handle keyboard events for the dropdown
|
|
16590
16698
|
handleKeyDown(event) {
|
|
16591
16699
|
if (!this.isOpen)
|
|
16592
16700
|
return;
|
|
16593
16701
|
switch (event.key) {
|
|
16594
|
-
case 'Escape':
|
|
16595
|
-
event.preventDefault();
|
|
16596
|
-
this.closeDropdown();
|
|
16597
|
-
break;
|
|
16598
16702
|
case 'ArrowDown':
|
|
16599
16703
|
event.preventDefault();
|
|
16600
16704
|
this.focusNextItem();
|
|
@@ -16686,7 +16790,7 @@ class PdsDropdownMenu {
|
|
|
16686
16790
|
}
|
|
16687
16791
|
}
|
|
16688
16792
|
render() {
|
|
16689
|
-
return (hAsync(Host, { key: '
|
|
16793
|
+
return (hAsync(Host, { key: '18dac4d59ea236fe171f4c16f6571cb1547059c6', id: this.componentId }, hAsync("slot", { key: '95201a75a33ccb70dbd51a5cf9d78c76ebf26f65', name: "trigger", onSlotchange: this.handleTriggerSlotChange }), hAsync("pds-box", { key: '7fc588f40f607ad81ad70bf74a525d078d32a80b', "border-radius": "sm", display: "flex", direction: "column", class: "pds-dropdown-menu--panel is-hidden", shadow: "100", part: "menu-panel" }, hAsync("div", { key: '73d13d94edccb68db7b703f930b50f729334efa8', class: { 'pds-dropdown-menu__header': true, 'is-hidden': !this.hasHeader } }, hAsync("slot", { key: '7066f3a6f71c8961326f38f0509f1c0cc17098ae', name: "header", onSlotchange: this.handleHeaderSlotChange })), hAsync("div", { key: '9f07ec488b688c58c6422b575015ccd364075fe8', class: "pds-dropdown-menu__items", role: "menu", "aria-orientation": "vertical" }, hAsync("slot", { key: 'd0aad3f9ac3b58779669411523adbb8878dec61c', onSlotchange: this.handleSlotChange })))));
|
|
16690
16794
|
}
|
|
16691
16795
|
get host() { return getElement(this); }
|
|
16692
16796
|
static get style() { return pdsDropdownMenuCss(); }
|
|
@@ -16699,7 +16803,7 @@ class PdsDropdownMenu {
|
|
|
16699
16803
|
"currentFocusIndex": [32],
|
|
16700
16804
|
"hasHeader": [32]
|
|
16701
16805
|
},
|
|
16702
|
-
"$listeners$": [[8, "keydown", "handleKeyDown"], [8, "click", "handleWindowClick"]],
|
|
16806
|
+
"$listeners$": [[6, "keydown", "handleEscapeKeyDown"], [8, "keydown", "handleKeyDown"], [8, "click", "handleWindowClick"]],
|
|
16703
16807
|
"$lazyBundleId$": "-",
|
|
16704
16808
|
"$attrsToReflect$": []
|
|
16705
16809
|
}; }
|
|
@@ -16770,7 +16874,7 @@ class PdsDropdownMenuItem {
|
|
|
16770
16874
|
});
|
|
16771
16875
|
}
|
|
16772
16876
|
renderElement() {
|
|
16773
|
-
if (this.href
|
|
16877
|
+
if (this.href != null) {
|
|
16774
16878
|
return (hAsync("pds-link", { download: this.download, href: this.disabled ? null : this.href, external: this.external, target: this.target, class: {
|
|
16775
16879
|
'pds-dropdown-menu-item__content': true,
|
|
16776
16880
|
'has-focus': this.hasFocus
|
|
@@ -16782,7 +16886,7 @@ class PdsDropdownMenuItem {
|
|
|
16782
16886
|
}, 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 }, hAsync("slot", null)));
|
|
16783
16887
|
}
|
|
16784
16888
|
render() {
|
|
16785
|
-
return (hAsync(Host, { key: '
|
|
16889
|
+
return (hAsync(Host, { key: '2d499a06768bdc4b9a34774d16c1f1e10804b3d5', id: this.componentId, class: { 'is-disabled': this.disabled, 'destructive': !this.disabled && this.destructive }, onClick: () => !this.disabled && this.handleClick(), role: "none", tabIndex: -1, "aria-disabled": this.disabled ? 'true' : null }, this.renderElement()));
|
|
16786
16890
|
}
|
|
16787
16891
|
get host() { return getElement(this); }
|
|
16788
16892
|
static get style() { return pdsDropdownMenuItemCss(); }
|
|
@@ -18560,6 +18664,20 @@ function oneRadioPerGroup(elements) {
|
|
|
18560
18664
|
const stops = new Set(groups.map((radios) => { var _a; return (_a = radios.find((radio) => radio.checked)) !== null && _a !== void 0 ? _a : radios[0]; }));
|
|
18561
18665
|
return elements.filter((el) => groupedRadio(el) === null || stops.has(el));
|
|
18562
18666
|
}
|
|
18667
|
+
/** The controls Tab reaches in `root`, in order: visible ones, and one radio per group. */
|
|
18668
|
+
function tabbableIn(root) {
|
|
18669
|
+
const found = [];
|
|
18670
|
+
collectTabbable(root, found);
|
|
18671
|
+
// checkVisibility() also drops an element inside a hidden ancestor, whose own computed
|
|
18672
|
+
// display isn't none; such an element can't take focus.
|
|
18673
|
+
const visible = found.filter(el => {
|
|
18674
|
+
if (typeof el.checkVisibility === 'function')
|
|
18675
|
+
return el.checkVisibility({ checkVisibilityCSS: true });
|
|
18676
|
+
const style = window.getComputedStyle(el);
|
|
18677
|
+
return style.display !== 'none' && style.visibility !== 'hidden';
|
|
18678
|
+
});
|
|
18679
|
+
return oneRadioPerGroup(visible);
|
|
18680
|
+
}
|
|
18563
18681
|
/** Whether `node` is `ancestor` or inside it, crossing shadow roots, which `Node.contains` doesn't. */
|
|
18564
18682
|
function containsComposed(ancestor, node) {
|
|
18565
18683
|
for (let current = node; current; current = current instanceof ShadowRoot ? current.host : current.parentNode) {
|
|
@@ -18568,8 +18686,36 @@ function containsComposed(ancestor, node) {
|
|
|
18568
18686
|
}
|
|
18569
18687
|
return false;
|
|
18570
18688
|
}
|
|
18689
|
+
/**
|
|
18690
|
+
* Every open modal, with the order it opened in, which ranks top-layer modals and the modals
|
|
18691
|
+
* inside them. Kept here rather than queried from the document, which can't see a modal inside
|
|
18692
|
+
* another component's shadow root.
|
|
18693
|
+
*/
|
|
18694
|
+
const openModals = new Map();
|
|
18695
|
+
let openSequence = 0;
|
|
18696
|
+
/** Whether an open auto popover's panel sits in `root`, including inside shadow roots under it. */
|
|
18697
|
+
function hasOpenPopover(root) {
|
|
18698
|
+
if (root.querySelector('[data-pds-popover-open]'))
|
|
18699
|
+
return true;
|
|
18700
|
+
return Array.from(root.querySelectorAll('*')).some(el => !!el.shadowRoot && hasOpenPopover(el.shadowRoot));
|
|
18701
|
+
}
|
|
18702
|
+
/**
|
|
18703
|
+
* Whether `a` comes before `b` in the page. `compareDocumentPosition` is arbitrary across a shadow
|
|
18704
|
+
* boundary, so each side climbs to its host until both are in the same tree.
|
|
18705
|
+
*/
|
|
18706
|
+
function precedesComposed(a, b) {
|
|
18707
|
+
// A document has no host, which ends each climb.
|
|
18708
|
+
for (let x = a; x; x = x.getRootNode().host) {
|
|
18709
|
+
for (let y = b; y; y = y.getRootNode().host) {
|
|
18710
|
+
if (x.getRootNode() === y.getRootNode()) {
|
|
18711
|
+
return !!(x.compareDocumentPosition(y) & Node.DOCUMENT_POSITION_FOLLOWING);
|
|
18712
|
+
}
|
|
18713
|
+
}
|
|
18714
|
+
}
|
|
18715
|
+
return false;
|
|
18716
|
+
}
|
|
18571
18717
|
/** The focused element, followed down through shadow roots to the control that has focus. */
|
|
18572
|
-
function deepActiveElement() {
|
|
18718
|
+
function deepActiveElement$1() {
|
|
18573
18719
|
var _a;
|
|
18574
18720
|
let active = document.activeElement;
|
|
18575
18721
|
while ((_a = active === null || active === void 0 ? void 0 : active.shadowRoot) === null || _a === void 0 ? void 0 : _a.activeElement)
|
|
@@ -18586,7 +18732,8 @@ class PdsModal {
|
|
|
18586
18732
|
this.pdsModalClose = createEvent(this, "pdsModalClose");
|
|
18587
18733
|
this.focusableElements = [];
|
|
18588
18734
|
/**
|
|
18589
|
-
* Whether the modal can be dismissed by clicking the backdrop
|
|
18735
|
+
* Whether the modal can be dismissed by clicking the backdrop, pressing Escape, or the browser's
|
|
18736
|
+
* own close request (such as a back gesture)
|
|
18590
18737
|
* @default true
|
|
18591
18738
|
*/
|
|
18592
18739
|
this.backdropDismiss = true;
|
|
@@ -18634,19 +18781,33 @@ class PdsModal {
|
|
|
18634
18781
|
* Stores the list of focusable elements in the modal
|
|
18635
18782
|
*/
|
|
18636
18783
|
this.focusableElementsArray = [];
|
|
18784
|
+
// The browser's own close request (an Escape nothing prevented, a back gesture) would close the
|
|
18785
|
+
// dialog without updating `open`, so close it through hideModal() instead, or not at all.
|
|
18786
|
+
this.handleCancel = (e) => {
|
|
18787
|
+
e.preventDefault();
|
|
18788
|
+
if (!this.open)
|
|
18789
|
+
return;
|
|
18790
|
+
// The request reaches the top-layer dialog even when a disableTopLayer modal inside it is on
|
|
18791
|
+
// top; that one closes first, as it would on Escape.
|
|
18792
|
+
const top = this.innermostOpenModal();
|
|
18793
|
+
const target = (top && containsComposed(this.el, top) ? top : this.el);
|
|
18794
|
+
if (target.backdropDismiss)
|
|
18795
|
+
target.hideModal();
|
|
18796
|
+
};
|
|
18637
18797
|
this.handleBackdropClick = (e) => {
|
|
18638
18798
|
if (!this.backdropDismiss || !this.open)
|
|
18639
18799
|
return;
|
|
18640
|
-
|
|
18800
|
+
// This modal's own backdrop; a nested modal's backdrop handles its own clicks.
|
|
18801
|
+
if (e.target === this.modalRef) {
|
|
18641
18802
|
e.stopPropagation();
|
|
18642
18803
|
// Only close if this is the innermost modal
|
|
18643
|
-
if (this.
|
|
18804
|
+
if (this.innermostOpenModal() === this.el) {
|
|
18644
18805
|
this.hideModal();
|
|
18645
18806
|
}
|
|
18646
18807
|
}
|
|
18647
18808
|
};
|
|
18648
18809
|
this.handleKeyDown = (e) => {
|
|
18649
|
-
var _a, _b, _c;
|
|
18810
|
+
var _a, _b, _c, _d;
|
|
18650
18811
|
// If the modal is not open, don't handle any keyboard events
|
|
18651
18812
|
if (!this.open)
|
|
18652
18813
|
return;
|
|
@@ -18669,24 +18830,39 @@ class PdsModal {
|
|
|
18669
18830
|
if (!('__pdsActiveElementAtEscape' in eventSnapshot)) {
|
|
18670
18831
|
const activeAtDispatch = document.activeElement;
|
|
18671
18832
|
eventSnapshot.__pdsActiveElementAtEscape = activeAtDispatch;
|
|
18833
|
+
// Followed into shadow roots: for a modal inside one, document.activeElement is only the host.
|
|
18834
|
+
eventSnapshot.__pdsDeepActiveElementAtEscape = deepActiveElement$1();
|
|
18672
18835
|
const topLayerDialog = (_a = activeAtDispatch === null || activeAtDispatch === void 0 ? void 0 : activeAtDispatch.closest('dialog')) !== null && _a !== void 0 ? _a : null;
|
|
18673
18836
|
eventSnapshot.__pdsTopLayerDialogAtEscape = topLayerDialog;
|
|
18674
18837
|
eventSnapshot.__pdsTopLayerDialogWasModalAtEscape = !!(topLayerDialog && topLayerDialog.matches(':modal'));
|
|
18838
|
+
// A control that closed on this Escape (a combobox on its own element, a dropdown menu or
|
|
18839
|
+
// multiselect in document's capture phase) has prevented it before this bubble listener.
|
|
18840
|
+
// Read before any modal prevents it below.
|
|
18841
|
+
eventSnapshot.__pdsEscapeHandledInside = e.defaultPrevented;
|
|
18842
|
+
// Which modal is innermost is read once too: the inner one closing first would make its
|
|
18843
|
+
// outer modal the innermost by the time that modal's listener runs.
|
|
18844
|
+
eventSnapshot.__pdsInnermostModalAtEscape = this.innermostOpenModal();
|
|
18675
18845
|
}
|
|
18846
|
+
if (eventSnapshot.__pdsEscapeHandledInside)
|
|
18847
|
+
return;
|
|
18676
18848
|
// Leave Escape to a genuinely stacked-above overlay (disableTopLayer's
|
|
18677
18849
|
// reason for existing) — not just to anything outside this modal.
|
|
18678
18850
|
const active = eventSnapshot.__pdsActiveElementAtEscape;
|
|
18679
18851
|
if (this.disableTopLayer &&
|
|
18680
18852
|
active &&
|
|
18681
18853
|
active !== document.body &&
|
|
18682
|
-
!this.el.
|
|
18683
|
-
this.isStackedAboveOverlay(active, (
|
|
18854
|
+
!containsComposed(this.el, (_b = eventSnapshot.__pdsDeepActiveElementAtEscape) !== null && _b !== void 0 ? _b : active) &&
|
|
18855
|
+
this.isStackedAboveOverlay(active, (_c = eventSnapshot.__pdsTopLayerDialogAtEscape) !== null && _c !== void 0 ? _c : null, (_d = eventSnapshot.__pdsTopLayerDialogWasModalAtEscape) !== null && _d !== void 0 ? _d : false)) {
|
|
18684
18856
|
return;
|
|
18685
18857
|
}
|
|
18858
|
+
// An open popover inside takes Escape from its own document listener, which runs after this
|
|
18859
|
+
// one, so leave the key for it. Its preventDefault() keeps the native dialog open.
|
|
18860
|
+
if (this.modalRef && hasOpenPopover(this.modalRef))
|
|
18861
|
+
return;
|
|
18686
18862
|
// Always prevent native dialog close behavior
|
|
18687
18863
|
e.preventDefault();
|
|
18688
18864
|
// Only close if backdropDismiss is enabled and this is the innermost modal
|
|
18689
|
-
if (this.backdropDismiss && this.
|
|
18865
|
+
if (this.backdropDismiss && eventSnapshot.__pdsInnermostModalAtEscape === this.el) {
|
|
18690
18866
|
this.hideModal();
|
|
18691
18867
|
}
|
|
18692
18868
|
return;
|
|
@@ -18706,7 +18882,7 @@ class PdsModal {
|
|
|
18706
18882
|
// Every open modal hears this keydown. When focus is in a modal dialog opened above this one,
|
|
18707
18883
|
// that dialog traps Tab: this modal's list also holds its controls, so it would wrap first. A
|
|
18708
18884
|
// non-modal dialog inside (a disableTopLayer modal) doesn't trap, so this one still does.
|
|
18709
|
-
const activeElement = deepActiveElement();
|
|
18885
|
+
const activeElement = deepActiveElement$1();
|
|
18710
18886
|
if (!activeElement || this.modalDialogAbove(activeElement))
|
|
18711
18887
|
return;
|
|
18712
18888
|
// Content can change while the modal is open (rows fetched in, sections shown), so the
|
|
@@ -18746,8 +18922,6 @@ class PdsModal {
|
|
|
18746
18922
|
}
|
|
18747
18923
|
componentDidLoad() {
|
|
18748
18924
|
this.modalRef = this.el.querySelector('.pds-modal__backdrop');
|
|
18749
|
-
// Add keyboard event listener
|
|
18750
|
-
document.addEventListener('keydown', this.handleKeyDown);
|
|
18751
18925
|
// @Watch('open') only fires on a later change, not the prop's initial
|
|
18752
18926
|
// value — a modal mounted with `open` already true (static markup, or a
|
|
18753
18927
|
// framework passing it on first render) would otherwise never call
|
|
@@ -18763,9 +18937,18 @@ class PdsModal {
|
|
|
18763
18937
|
componentDidRender() {
|
|
18764
18938
|
unwrapReconnectedContent(this.el.querySelector('.pds-modal'), 'dialog.pds-modal__backdrop', '.pds-modal');
|
|
18765
18939
|
}
|
|
18940
|
+
// Here rather than in componentDidLoad, which runs once: a modal taken out of the page and put
|
|
18941
|
+
// back (a morph or a framework moving it) gets its keyboard handling, and its place among the
|
|
18942
|
+
// open modals, back too. Adding the same listener twice is a no-op.
|
|
18943
|
+
connectedCallback() {
|
|
18944
|
+
document.addEventListener('keydown', this.handleKeyDown);
|
|
18945
|
+
if (this.open && !openModals.has(this.el))
|
|
18946
|
+
openModals.set(this.el, ++openSequence);
|
|
18947
|
+
}
|
|
18766
18948
|
disconnectedCallback() {
|
|
18767
18949
|
// Clean up event listener
|
|
18768
18950
|
document.removeEventListener('keydown', this.handleKeyDown);
|
|
18951
|
+
openModals.delete(this.el);
|
|
18769
18952
|
}
|
|
18770
18953
|
handleOpenChange(newValue) {
|
|
18771
18954
|
if (newValue) {
|
|
@@ -18781,17 +18964,7 @@ class PdsModal {
|
|
|
18781
18964
|
updateFocusableElements() {
|
|
18782
18965
|
if (!this.modalRef)
|
|
18783
18966
|
return;
|
|
18784
|
-
this.focusableElements =
|
|
18785
|
-
collectTabbable(this.modalRef, this.focusableElements);
|
|
18786
|
-
// checkVisibility() also drops an element inside a hidden ancestor, whose own computed
|
|
18787
|
-
// display isn't none; such an element can't take focus, so it can't anchor the trap.
|
|
18788
|
-
this.focusableElements = this.focusableElements.filter(el => {
|
|
18789
|
-
if (typeof el.checkVisibility === 'function')
|
|
18790
|
-
return el.checkVisibility({ checkVisibilityCSS: true });
|
|
18791
|
-
const style = window.getComputedStyle(el);
|
|
18792
|
-
return style.display !== 'none' && style.visibility !== 'hidden';
|
|
18793
|
-
});
|
|
18794
|
-
this.focusableElements = oneRadioPerGroup(this.focusableElements);
|
|
18967
|
+
this.focusableElements = tabbableIn(this.modalRef);
|
|
18795
18968
|
}
|
|
18796
18969
|
/**
|
|
18797
18970
|
* Sets focus to the first focusable element in the modal
|
|
@@ -18815,10 +18988,13 @@ class PdsModal {
|
|
|
18815
18988
|
* Opens the modal
|
|
18816
18989
|
*/
|
|
18817
18990
|
async showModal() {
|
|
18991
|
+
var _a;
|
|
18818
18992
|
if (this.modalRef) {
|
|
18819
18993
|
try {
|
|
18820
|
-
// Store the currently focused element to restore focus when modal closes
|
|
18821
|
-
|
|
18994
|
+
// Store the currently focused element to restore focus when modal closes. Showing an open
|
|
18995
|
+
// modal again (the open watcher does) would record a control inside it instead.
|
|
18996
|
+
if (!this.modalRef.open)
|
|
18997
|
+
this.previousActiveElement = document.activeElement;
|
|
18822
18998
|
// showModal() promotes the dialog to the browser top layer (and makes the
|
|
18823
18999
|
// rest of the page inert), which prevents any overlay outside the dialog
|
|
18824
19000
|
// from ever painting above it. show() opens a non-modal dialog that stays
|
|
@@ -18830,11 +19006,25 @@ class PdsModal {
|
|
|
18830
19006
|
this.modalRef.showModal();
|
|
18831
19007
|
}
|
|
18832
19008
|
this.open = true;
|
|
19009
|
+
// Showing an open modal again doesn't move it above one opened after it.
|
|
19010
|
+
if (!openModals.has(this.el))
|
|
19011
|
+
openModals.set(this.el, ++openSequence);
|
|
18833
19012
|
// Update focusable elements and set initial focus
|
|
18834
19013
|
// Using a longer timeout to ensure all components are fully rendered
|
|
19014
|
+
const openedAs = (_a = openModals.get(this.el)) !== null && _a !== void 0 ? _a : 0;
|
|
18835
19015
|
setTimeout(() => {
|
|
18836
19016
|
var _a, _b;
|
|
18837
19017
|
this.updateFocusableElements();
|
|
19018
|
+
// A modal opened above this one in the meantime has focus; don't take it back. Not this
|
|
19019
|
+
// modal itself (moving it gives it a new place), and not a disableTopLayer modal outside
|
|
19020
|
+
// it while this one is in the top layer, which sits below it.
|
|
19021
|
+
const openedAbove = Array.from(openModals).some(([modal, sequence]) => sequence > openedAs &&
|
|
19022
|
+
modal !== this.el &&
|
|
19023
|
+
(containsComposed(this.el, modal) || !modal.disableTopLayer || this.disableTopLayer));
|
|
19024
|
+
if (openedAbove) {
|
|
19025
|
+
this.pdsModalOpen.emit();
|
|
19026
|
+
return;
|
|
19027
|
+
}
|
|
18838
19028
|
if (this.disableInitialFocus) {
|
|
18839
19029
|
// show()/showModal() also move focus into the dialog natively (the
|
|
18840
19030
|
// HTML spec's "dialog focusing steps") — that native step isn't
|
|
@@ -18878,6 +19068,7 @@ class PdsModal {
|
|
|
18878
19068
|
* Closes the modal
|
|
18879
19069
|
*/
|
|
18880
19070
|
async hideModal() {
|
|
19071
|
+
var _a;
|
|
18881
19072
|
if (this.modalRef) {
|
|
18882
19073
|
try {
|
|
18883
19074
|
// Capture before close(): with the async task queue, a prop change
|
|
@@ -18892,11 +19083,19 @@ class PdsModal {
|
|
|
18892
19083
|
const focusAlreadyMovedElsewhere = activeElement !== null && activeElement !== document.body && !this.modalRef.contains(activeElement);
|
|
18893
19084
|
this.modalRef.close();
|
|
18894
19085
|
this.open = false;
|
|
18895
|
-
|
|
18896
|
-
|
|
18897
|
-
|
|
18898
|
-
|
|
18899
|
-
|
|
19086
|
+
openModals.delete(this.el);
|
|
19087
|
+
// Restore focus to the element that was focused before the modal was opened. If that's
|
|
19088
|
+
// gone or can't take focus (disabled, hidden, or nothing), fall back to the open modal now
|
|
19089
|
+
// on top, so focus doesn't land on an inert page behind it.
|
|
19090
|
+
if (!focusAlreadyMovedElsewhere) {
|
|
19091
|
+
const previous = this.previousActiveElement;
|
|
19092
|
+
if (previous && previous !== document.body && previous.isConnected)
|
|
19093
|
+
(_a = previous.focus) === null || _a === void 0 ? void 0 : _a.call(previous);
|
|
19094
|
+
const active = deepActiveElement$1();
|
|
19095
|
+
// document.body isn't a real restore target — it's just where focus lands when nothing
|
|
19096
|
+
// was focused before opening, so landing back there never counts as a successful restore.
|
|
19097
|
+
if (!previous || previous === document.body || !containsComposed(previous, active) || containsComposed(this.el, active))
|
|
19098
|
+
this.focusTopModal();
|
|
18900
19099
|
}
|
|
18901
19100
|
this.pdsModalClose.emit();
|
|
18902
19101
|
}
|
|
@@ -18905,12 +19104,29 @@ class PdsModal {
|
|
|
18905
19104
|
}
|
|
18906
19105
|
}
|
|
18907
19106
|
}
|
|
19107
|
+
/**
|
|
19108
|
+
* Focuses the first control of the open modal now on top, when the page behind it is inert: that
|
|
19109
|
+
* modal is in the top layer (or paints there inside a top-layer one), or it wraps this one. A
|
|
19110
|
+
* non-modal one over an interactive page, like a drawer, is left alone.
|
|
19111
|
+
*/
|
|
19112
|
+
focusTopModal() {
|
|
19113
|
+
var _a;
|
|
19114
|
+
const top = this.innermostOpenModal();
|
|
19115
|
+
const dialog = top === null || top === void 0 ? void 0 : top.querySelector('.pds-modal__backdrop');
|
|
19116
|
+
if (!dialog)
|
|
19117
|
+
return;
|
|
19118
|
+
if (!closest$1('dialog:modal', dialog) && !containsComposed(top, this.el))
|
|
19119
|
+
return;
|
|
19120
|
+
(_a = tabbableIn(dialog).find(el => !containsComposed(this.el, el))) === null || _a === void 0 ? void 0 : _a.focus();
|
|
19121
|
+
}
|
|
18908
19122
|
/**
|
|
18909
19123
|
* Gets the z-index of a modal's backdrop element
|
|
18910
19124
|
*/
|
|
18911
19125
|
getBackdropZIndex(modal) {
|
|
18912
19126
|
const backdrop = modal.querySelector('.pds-modal__backdrop');
|
|
18913
|
-
|
|
19127
|
+
// `auto` (no z-index token loaded) parses to NaN, which no comparison can rank.
|
|
19128
|
+
const zIndex = backdrop ? parseInt(getComputedStyle(backdrop).zIndex, 10) : -1;
|
|
19129
|
+
return Number.isNaN(zIndex) ? 0 : zIndex;
|
|
18914
19130
|
}
|
|
18915
19131
|
/**
|
|
18916
19132
|
* Whether `active` sits inside a surface actually stacked above this modal.
|
|
@@ -18937,7 +19153,8 @@ class PdsModal {
|
|
|
18937
19153
|
* lose that evidence depending on listener order.
|
|
18938
19154
|
*/
|
|
18939
19155
|
isStackedAboveOverlay(active, topLayerDialog, topLayerDialogWasModal) {
|
|
18940
|
-
|
|
19156
|
+
// A top-layer dialog this modal sits inside is underneath it, not an overlay above.
|
|
19157
|
+
if (topLayerDialog && topLayerDialog !== this.modalRef && topLayerDialogWasModal && !containsComposed(topLayerDialog, this.el)) {
|
|
18941
19158
|
return true;
|
|
18942
19159
|
}
|
|
18943
19160
|
const ownZIndex = this.getBackdropZIndex(this.el);
|
|
@@ -18953,24 +19170,37 @@ class PdsModal {
|
|
|
18953
19170
|
return false;
|
|
18954
19171
|
}
|
|
18955
19172
|
/**
|
|
18956
|
-
*
|
|
19173
|
+
* The open modal that takes Escape or a backdrop click, among those with no other open modal
|
|
19174
|
+
* inside them (a nested modal's backdrop can share its outer modal's z-index). A top-layer dialog
|
|
19175
|
+
* (or a modal inside one) paints above anything outside it, and within the top layer the last
|
|
19176
|
+
* opened is on top. Modals in the same layer (the page, or one top-layer dialog) then rank by
|
|
19177
|
+
* the highest backdrop, then the one later in the page.
|
|
18957
19178
|
*/
|
|
18958
|
-
|
|
18959
|
-
|
|
18960
|
-
const
|
|
18961
|
-
|
|
18962
|
-
|
|
18963
|
-
//
|
|
18964
|
-
const
|
|
18965
|
-
|
|
18966
|
-
|
|
18967
|
-
|
|
18968
|
-
|
|
18969
|
-
|
|
18970
|
-
|
|
18971
|
-
|
|
18972
|
-
|
|
18973
|
-
|
|
19179
|
+
innermostOpenModal() {
|
|
19180
|
+
const open = Array.from(openModals.keys()).filter(modal => modal.isConnected);
|
|
19181
|
+
const innermost = open.filter(modal => !open.some(other => other !== modal && containsComposed(modal, other)));
|
|
19182
|
+
const byDocumentOrder = [...innermost].sort((a, b) => (precedesComposed(a, b) ? -1 : 1));
|
|
19183
|
+
// A modal inside a top-layer dialog paints in that dialog's place in the top layer, even when it
|
|
19184
|
+
// isn't in the top layer itself (disableTopLayer), so that dialog's open order ranks it first.
|
|
19185
|
+
const rank = (modal) => {
|
|
19186
|
+
var _a;
|
|
19187
|
+
const backdrop = modal.querySelector('.pds-modal__backdrop');
|
|
19188
|
+
const topLayerDialog = backdrop ? closest$1('dialog:modal', backdrop) : null;
|
|
19189
|
+
const topLayerModal = topLayerDialog === null || topLayerDialog === void 0 ? void 0 : topLayerDialog.closest('pds-modal');
|
|
19190
|
+
const layer = topLayerDialog ? ((_a = (topLayerModal && openModals.get(topLayerModal))) !== null && _a !== void 0 ? _a : 0) : 0;
|
|
19191
|
+
return [topLayerDialog ? 1 : 0, layer, this.getBackdropZIndex(modal), byDocumentOrder.indexOf(modal)];
|
|
19192
|
+
};
|
|
19193
|
+
let top = null;
|
|
19194
|
+
let topRank = [-1, -1, -1, -1];
|
|
19195
|
+
for (const modal of innermost) {
|
|
19196
|
+
const modalRank = rank(modal);
|
|
19197
|
+
const above = modalRank.findIndex((value, i) => value !== topRank[i]);
|
|
19198
|
+
if (above >= 0 && modalRank[above] > topRank[above]) {
|
|
19199
|
+
top = modal;
|
|
19200
|
+
topRank = modalRank;
|
|
19201
|
+
}
|
|
19202
|
+
}
|
|
19203
|
+
return top;
|
|
18974
19204
|
}
|
|
18975
19205
|
/** Whether a modal dialog other than this one sits between the focused element and this modal. */
|
|
18976
19206
|
modalDialogAbove(active) {
|
|
@@ -19010,14 +19240,14 @@ class PdsModal {
|
|
|
19010
19240
|
}
|
|
19011
19241
|
render() {
|
|
19012
19242
|
const [sizeClass = 'md', customSize] = this.resolveSize();
|
|
19013
|
-
return (hAsync("dialog", { key: '
|
|
19243
|
+
return (hAsync("dialog", { key: '0b187f36910a859afe57b891f1ebffd1d2d49ab7', class: {
|
|
19014
19244
|
'pds-modal__backdrop': true,
|
|
19015
19245
|
'open': this.open
|
|
19016
|
-
}, "aria-modal": this.disableTopLayer ? 'false' : 'true', "aria-labelledby": `${this.componentId}-heading`, onClick: this.handleBackdropClick }, hAsync("div", { key: '
|
|
19246
|
+
}, "aria-modal": this.disableTopLayer ? 'false' : 'true', "aria-labelledby": `${this.componentId}-heading`, onClick: this.handleBackdropClick, onCancel: this.handleCancel }, hAsync("div", { key: 'f5e652d4dae0e7c272b37b63eb9c65f04c69536a', class: {
|
|
19017
19247
|
'pds-modal': true,
|
|
19018
19248
|
[`pds-modal--${sizeClass}`]: true,
|
|
19019
19249
|
'pds-modal--scrollable': this.scrollable
|
|
19020
|
-
}, style: customSize !== undefined ? { '--pds-modal-max-width': customSize } : undefined, part: "modal" }, hAsync("slot", { key: '
|
|
19250
|
+
}, style: customSize !== undefined ? { '--pds-modal-max-width': customSize } : undefined, part: "modal" }, hAsync("slot", { key: 'a954e1694741f78230599c476b270079797a263e' }))));
|
|
19021
19251
|
}
|
|
19022
19252
|
get el() { return getElement(this); }
|
|
19023
19253
|
static get watchers() { return {
|
|
@@ -19310,7 +19540,7 @@ class PdsModalHeader {
|
|
|
19310
19540
|
}; }
|
|
19311
19541
|
}
|
|
19312
19542
|
|
|
19313
|
-
const pdsMultiselectCss = () => `:host{display:block}:host([aria-disabled=true]) .pds-multiselect__trigger{background:var(--pine-color-background-container-disabled);border-color:var(--pine-color-border-disabled);color:var(--pine-color-text-disabled);cursor:not-allowed}:host([aria-disabled=true]) .pds-multiselect__icon{color:var(--pine-color-text-disabled)}.pds-multiselect{position:relative}.pds-multiselect__label{color:var(--pine-color-text-label);display:block;font:var(--pine-typography-body-medium);letter-spacing:var(--pine-letter-spacing);-webkit-margin-after:var(--pine-dimension-2xs);margin-block-end:var(--pine-dimension-2xs)}.pds-multiselect__wrapper{position:relative}.pds-multiselect__trigger{-ms-flex-align:center;align-items:center;background:var(--pine-color-background-container);border:var(--pine-border);border-radius:var(--pine-dimension-125);cursor:pointer;display:-ms-flexbox;display:flex;font:var(--pine-typography-body-medium);gap:var(--pine-dimension-xs);-ms-flex-pack:justify;justify-content:space-between;letter-spacing:var(--pine-letter-spacing);min-height:var(--pine-dimension-450);padding:var(--pine-dimension-xs) var(--pine-dimension-sm);position:relative;text-align:start;-webkit-transition:border-color var(--pine-motion-duration-base) ease, -webkit-box-shadow var(--pine-motion-duration-base) ease;transition:border-color var(--pine-motion-duration-base) ease, -webkit-box-shadow var(--pine-motion-duration-base) ease;transition:border-color var(--pine-motion-duration-base) ease, box-shadow var(--pine-motion-duration-base) ease;transition:border-color var(--pine-motion-duration-base) ease, box-shadow var(--pine-motion-duration-base) ease, -webkit-box-shadow var(--pine-motion-duration-base) ease;width:100%}.pds-multiselect__trigger:hover:not(.pds-multiselect__trigger--disabled){border-color:var(--pine-color-border-hover)}.pds-multiselect__trigger:focus:not(.pds-multiselect__trigger--disabled){border-color:var(--pine-color-border-active);outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-multiselect__trigger.pds-multiselect__trigger--open{border-color:var(--pine-color-border-active)}.pds-multiselect__trigger.pds-multiselect__trigger--invalid{background-color:var(--pine-color-red-050);border-color:var(--pine-color-border-danger)}.pds-multiselect__trigger.pds-multiselect__trigger--invalid:focus{outline-color:var(--pine-color-focus-ring-danger)}.pds-multiselect__trigger.pds-multiselect__trigger--disabled{background:var(--pine-color-background-container-disabled);border-color:var(--pine-color-border-disabled);color:var(--pine-color-text-disabled);cursor:not-allowed}.pds-multiselect__trigger-text{color:var(--pine-color-text-strong);-ms-flex:1;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pds-multiselect__trigger-text.pds-multiselect__trigger-text--placeholder{color:var(--pine-color-text-placeholder)}.pds-multiselect__trigger--disabled .pds-multiselect__trigger-text{color:var(--pine-color-text-disabled)}.pds-multiselect__icon{color:var(--pine-color-icon);-ms-flex-negative:var(--pine-dimension-none);flex-shrink:var(--pine-dimension-none)}.pds-multiselect__pill-list{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--pine-dimension-2xs)}.pds-multiselect__pill-list--inline{-ms-flex:1;flex:1;min-width:0}.pds-multiselect__pill-list--below{-webkit-margin-before:var(--pine-dimension-2xs);margin-block-start:var(--pine-dimension-2xs)}.pds-multiselect__pill-overflow{color:var(--pine-color-text-muted);font:var(--pine-typography-body-sm-medium);white-space:nowrap}.pds-multiselect__trigger--pill-inline{-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--pine-dimension-2xs);min-height:var(--pine-dimension-450);padding:var(--pine-dimension-2xs) var(--pine-dimension-sm)}.pds-multiselect__trigger--pill-inline.pds-multiselect__trigger--open{border-color:var(--pine-color-border-active)}.pds-multiselect__trigger--pill-inline:focus-within:not(.pds-multiselect__trigger--disabled){border-color:var(--pine-color-border-active);outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-multiselect__trigger--pill-inline.pds-multiselect__trigger--invalid:focus-within{outline-color:var(--pine-color-focus-ring-danger)}.pds-multiselect__pill-toggle{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border-width:0;cursor:pointer;display:-ms-flexbox;display:flex;padding:0}.pds-multiselect__pill-toggle:focus{outline:3px solid transparent}.pds-multiselect__trigger--disabled .pds-multiselect__pill-toggle{cursor:not-allowed;pointer-events:none}.pds-multiselect__panel{background:var(--pine-color-background-overlay);border-radius:var(--pine-dimension-125);-webkit-box-shadow:var(--pine-box-shadow);box-shadow:var(--pine-box-shadow);-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:fixed;z-index:var(--pine-z-index-raised)}.pds-multiselect__search{-ms-flex-align:center;align-items:center;-webkit-border-after:var(--pine-border);border-block-end:var(--pine-border);border-block-end-color:var(--pine-color-border-subtle);display:-ms-flexbox;display:flex;gap:var(--pine-dimension-xs);padding:var(--pine-dimension-xs) var(--pine-dimension-sm)}.pds-multiselect__search pds-icon{color:var(--pine-color-text-muted);-ms-flex-negative:var(--pine-dimension-none);flex-shrink:var(--pine-dimension-none)}.pds-multiselect__search-input{background:transparent;border:var(--pine-dimension-none);color:var(--pine-color-text-strong);-ms-flex:1;flex:1;font:var(--pine-typography-body);letter-spacing:var(--pine-letter-spacing);min-width:var(--pine-dimension-none);outline:none}.pds-multiselect__search-input::-webkit-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-multiselect__search-input::-moz-placeholder{color:var(--pine-color-text-placeholder)}.pds-multiselect__search-input:-ms-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-multiselect__search-input::-ms-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-multiselect__search-input::placeholder{color:var(--pine-color-text-placeholder)}.pds-multiselect__selected-section{-webkit-border-after:var(--pine-border);border-block-end:var(--pine-border);border-block-end-color:var(--pine-color-border-subtle);padding:var(--pine-dimension-xs)}.pds-multiselect__selected-list{list-style:none;margin:var(--pine-dimension-none);padding:var(--pine-dimension-none)}.pds-multiselect__selected-item{color:var(--pine-color-text-strong);font:var(--pine-typography-body);letter-spacing:var(--pine-letter-spacing);overflow:hidden;padding:var(--pine-dimension-2xs) var(--pine-dimension-xs);text-overflow:ellipsis;white-space:nowrap}.pds-multiselect__listbox{background:transparent;border:var(--pine-dimension-none);-webkit-box-sizing:border-box;box-sizing:border-box;list-style:none;margin:var(--pine-dimension-none);overflow-y:auto;padding:var(--pine-dimension-xs)}.pds-multiselect__group-header{color:var(--pine-color-text-muted);display:block;font:var(--pine-typography-body-sm-medium);letter-spacing:var(--pine-letter-spacing);padding:var(--pine-dimension-sm) var(--pine-dimension-xs) var(--pine-dimension-2xs);text-transform:uppercase}.pds-multiselect__listbox>li:first-child>.pds-multiselect__group-header{-webkit-padding-before:var(--pine-dimension-xs);padding-block-start:var(--pine-dimension-xs)}.pds-multiselect__group-list{list-style:none;margin:var(--pine-dimension-none);padding:var(--pine-dimension-none)}.pds-multiselect__option{-ms-flex-align:center;align-items:center;background:transparent;border-radius:var(--pine-dimension-xs);cursor:pointer;display:-ms-flexbox;display:flex;padding:var(--pine-dimension-2xs) var(--pine-dimension-xs);-webkit-transition:background 0.15s;transition:background 0.15s}.pds-multiselect__option pds-checkbox{pointer-events:none;width:100%}.pds-multiselect__option:hover:not(.pds-multiselect__option--disabled),.pds-multiselect__option.pds-multiselect__option--highlighted:not(.pds-multiselect__option--disabled){background:var(--pine-color-background-muted)}.pds-multiselect__option.pds-multiselect__option--disabled{cursor:not-allowed;opacity:0.5}.pds-multiselect__option:focus-visible{outline:var(--pine-dimension-none)}.pds-multiselect__option-action{-ms-flex-align:center;align-items:center;block-size:var(--pine-dimension-md);color:var(--pine-color-icon);cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;inline-size:var(--pine-dimension-md);-ms-flex-pack:center;justify-content:center;-webkit-margin-start:var(--pine-dimension-xs);margin-inline-start:var(--pine-dimension-xs)}.pds-multiselect__create-option{color:var(--pine-color-text-strong);width:100%}.pds-multiselect__create-option pds-icon{color:var(--pine-color-text-muted);-ms-flex-negative:var(--pine-dimension-none);flex-shrink:var(--pine-dimension-none)}.pds-multiselect__empty,.pds-multiselect__loading{-ms-flex-align:center;align-items:center;color:var(--pine-color-text-muted);display:-ms-flexbox;display:flex;font:var(--pine-typography-body);-ms-flex-pack:center;justify-content:center;padding:var(--pine-dimension-sm)}.pds-multiselect__load-more{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;padding:var(--pine-dimension-xs)}.pds-multiselect__footer{-webkit-border-before:var(--pine-border);border-block-start:var(--pine-border);border-block-start-color:var(--pine-color-border-subtle);padding:var(--pine-dimension-xs) var(--pine-dimension-sm)}.pds-multiselect__helper{color:var(--pine-color-text-message);font:var(--pine-typography-body-sm-medium);-webkit-margin-before:var(--pine-dimension-2xs);margin-block-start:var(--pine-dimension-2xs);-webkit-margin-start:var(--pine-dimension-none);margin-inline-start:var(--pine-dimension-none)}.pds-multiselect__error{-ms-flex-align:start;align-items:flex-start;color:var(--pine-color-text-message-danger);display:-ms-flexbox;display:flex;font:var(--pine-typography-body-sm-medium);gap:var(--pine-dimension-2xs);-webkit-margin-before:var(--pine-dimension-2xs);margin-block-start:var(--pine-dimension-2xs);-webkit-margin-start:var(--pine-dimension-none);margin-inline-start:var(--pine-dimension-none)}.pds-multiselect__error pds-icon{-ms-flex-negative:var(--pine-dimension-none);flex-shrink:var(--pine-dimension-none);-webkit-margin-before:var(--pine-dimension-025);margin-block-start:var(--pine-dimension-025)}.visually-hidden{border:var(--pine-dimension-none);clip:rect(0 0 0 0);-webkit-clip-path:polygon(0 0, 0 0, 0 0);clip-path:polygon(0 0, 0 0, 0 0);height:1px;margin:-1px;overflow:hidden;padding:var(--pine-dimension-none);position:absolute;white-space:nowrap;width:1px}`;
|
|
19543
|
+
const pdsMultiselectCss = () => `:host{display:block}:host([aria-disabled=true]) .pds-multiselect__trigger{background:var(--pine-color-background-container-disabled);border-color:var(--pine-color-border-disabled);color:var(--pine-color-text-disabled);cursor:not-allowed}:host([aria-disabled=true]) .pds-multiselect__icon{color:var(--pine-color-text-disabled)}.pds-multiselect{position:relative}.pds-multiselect__label{color:var(--pine-color-text-label);display:block;font:var(--pine-typography-body-medium);letter-spacing:var(--pine-letter-spacing);-webkit-margin-after:var(--pine-dimension-2xs);margin-block-end:var(--pine-dimension-2xs)}.pds-multiselect__wrapper{position:relative}.pds-multiselect__trigger{-ms-flex-align:center;align-items:center;background:var(--pine-color-background-container);border:var(--pine-border);border-radius:var(--pine-dimension-125);cursor:pointer;display:-ms-flexbox;display:flex;font:var(--pine-typography-body-medium);gap:var(--pine-dimension-xs);-ms-flex-pack:justify;justify-content:space-between;letter-spacing:var(--pine-letter-spacing);min-height:var(--pine-dimension-450);padding:var(--pine-dimension-xs) var(--pine-dimension-sm);position:relative;text-align:start;-webkit-transition:border-color var(--pine-motion-duration-base) ease, -webkit-box-shadow var(--pine-motion-duration-base) ease;transition:border-color var(--pine-motion-duration-base) ease, -webkit-box-shadow var(--pine-motion-duration-base) ease;transition:border-color var(--pine-motion-duration-base) ease, box-shadow var(--pine-motion-duration-base) ease;transition:border-color var(--pine-motion-duration-base) ease, box-shadow var(--pine-motion-duration-base) ease, -webkit-box-shadow var(--pine-motion-duration-base) ease;width:100%}.pds-multiselect__trigger:hover:not(.pds-multiselect__trigger--disabled){border-color:var(--pine-color-border-hover)}.pds-multiselect__trigger:focus:not(.pds-multiselect__trigger--disabled){border-color:var(--pine-color-border-active);outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-multiselect__trigger.pds-multiselect__trigger--open{border-color:var(--pine-color-border-active)}.pds-multiselect__trigger.pds-multiselect__trigger--invalid{background-color:var(--pine-color-red-050);border-color:var(--pine-color-border-danger)}.pds-multiselect__trigger.pds-multiselect__trigger--invalid:focus{outline-color:var(--pine-color-focus-ring-danger)}.pds-multiselect__trigger.pds-multiselect__trigger--disabled{background:var(--pine-color-background-container-disabled);border-color:var(--pine-color-border-disabled);color:var(--pine-color-text-disabled);cursor:not-allowed}.pds-multiselect__trigger-text{color:var(--pine-color-text-strong);-ms-flex:1;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pds-multiselect__trigger-text.pds-multiselect__trigger-text--placeholder{color:var(--pine-color-text-placeholder)}.pds-multiselect__trigger--disabled .pds-multiselect__trigger-text{color:var(--pine-color-text-disabled)}.pds-multiselect__icon{color:var(--pine-color-icon);-ms-flex-negative:var(--pine-dimension-none);flex-shrink:var(--pine-dimension-none)}.pds-multiselect__pill-list{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--pine-dimension-2xs)}.pds-multiselect__pill-list--inline{-ms-flex:1;flex:1;min-width:0}.pds-multiselect__pill-list--below{-webkit-margin-before:var(--pine-dimension-2xs);margin-block-start:var(--pine-dimension-2xs)}.pds-multiselect__pill-overflow{color:var(--pine-color-text-muted);font:var(--pine-typography-body-sm-medium);white-space:nowrap}.pds-multiselect__trigger--pill-inline{-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--pine-dimension-2xs);min-height:var(--pine-dimension-450);padding:var(--pine-dimension-2xs) var(--pine-dimension-sm)}.pds-multiselect__trigger--pill-inline.pds-multiselect__trigger--open{border-color:var(--pine-color-border-active)}.pds-multiselect__trigger--pill-inline:focus-within:not(.pds-multiselect__trigger--disabled){border-color:var(--pine-color-border-active);outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-multiselect__trigger--pill-inline.pds-multiselect__trigger--invalid:focus-within{outline-color:var(--pine-color-focus-ring-danger)}.pds-multiselect__pill-toggle{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border-width:0;cursor:pointer;display:-ms-flexbox;display:flex;padding:0}.pds-multiselect__pill-toggle:focus{outline:3px solid transparent}.pds-multiselect__trigger--disabled .pds-multiselect__pill-toggle{cursor:not-allowed;pointer-events:none}.pds-multiselect__panel{background:var(--pine-color-background-overlay);border-radius:var(--pine-dimension-125);-webkit-box-shadow:var(--pine-box-shadow);box-shadow:var(--pine-box-shadow);-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:fixed;z-index:var(--pine-z-index-raised)}.pds-multiselect__search{-ms-flex-align:center;align-items:center;-webkit-border-after:var(--pine-border);border-block-end:var(--pine-border);border-block-end-color:var(--pine-color-border-subtle);display:-ms-flexbox;display:flex;gap:var(--pine-dimension-xs);padding:var(--pine-dimension-xs) var(--pine-dimension-sm)}.pds-multiselect__search pds-icon{color:var(--pine-color-text-muted);-ms-flex-negative:var(--pine-dimension-none);flex-shrink:var(--pine-dimension-none)}.pds-multiselect__search-input{background:transparent;border:var(--pine-dimension-none);color:var(--pine-color-text-strong);-ms-flex:1;flex:1;font:var(--pine-typography-body);letter-spacing:var(--pine-letter-spacing);min-width:var(--pine-dimension-none);outline:none}.pds-multiselect__search-input::-webkit-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-multiselect__search-input::-moz-placeholder{color:var(--pine-color-text-placeholder)}.pds-multiselect__search-input:-ms-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-multiselect__search-input::-ms-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-multiselect__search-input::placeholder{color:var(--pine-color-text-placeholder)}.pds-multiselect__selected-section{-webkit-border-after:var(--pine-border);border-block-end:var(--pine-border);border-block-end-color:var(--pine-color-border-subtle);padding:var(--pine-dimension-xs)}.pds-multiselect__selected-list{list-style:none;margin:var(--pine-dimension-none);padding:var(--pine-dimension-none)}.pds-multiselect__selected-item{color:var(--pine-color-text-strong);font:var(--pine-typography-body);letter-spacing:var(--pine-letter-spacing);overflow:hidden;padding:var(--pine-dimension-2xs) var(--pine-dimension-xs);text-overflow:ellipsis;white-space:nowrap}.pds-multiselect__listbox{background:transparent;border:var(--pine-dimension-none);-webkit-box-sizing:border-box;box-sizing:border-box;list-style:none;margin:var(--pine-dimension-none);overflow-y:auto;padding:var(--pine-dimension-xs)}.pds-multiselect__group-header{color:var(--pine-color-text-muted);display:block;font:var(--pine-typography-body-sm-medium);letter-spacing:var(--pine-letter-spacing);padding:var(--pine-dimension-sm) var(--pine-dimension-xs) var(--pine-dimension-2xs);text-transform:uppercase}.pds-multiselect__listbox>li:first-child>.pds-multiselect__group-header{-webkit-padding-before:var(--pine-dimension-xs);padding-block-start:var(--pine-dimension-xs)}.pds-multiselect__group-list{list-style:none;margin:var(--pine-dimension-none);padding:var(--pine-dimension-none)}.pds-multiselect__option{-ms-flex-align:center;align-items:center;background:transparent;border-radius:var(--pine-dimension-xs);cursor:pointer;display:-ms-flexbox;display:flex;padding:var(--pine-dimension-2xs) var(--pine-dimension-xs);-webkit-transition:background 0.15s;transition:background 0.15s}.pds-multiselect__option pds-checkbox{min-width:var(--pine-dimension-none);pointer-events:none;width:100%}.pds-multiselect__option pds-chip{pointer-events:auto}.pds-multiselect__option:hover:not(.pds-multiselect__option--disabled),.pds-multiselect__option.pds-multiselect__option--highlighted:not(.pds-multiselect__option--disabled){background:var(--pine-color-background-muted)}.pds-multiselect__option.pds-multiselect__option--disabled{cursor:not-allowed;opacity:0.5}.pds-multiselect__option:focus-visible{outline:var(--pine-dimension-none)}.pds-multiselect__option-action{-ms-flex-align:center;align-items:center;block-size:var(--pine-dimension-md);color:var(--pine-color-icon);cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;inline-size:var(--pine-dimension-md);-ms-flex-pack:center;justify-content:center;-webkit-margin-start:var(--pine-dimension-xs);margin-inline-start:var(--pine-dimension-xs)}.pds-multiselect__create-option{color:var(--pine-color-text-strong);width:100%}.pds-multiselect__create-option pds-icon{color:var(--pine-color-text-muted);-ms-flex-negative:var(--pine-dimension-none);flex-shrink:var(--pine-dimension-none)}.pds-multiselect__empty,.pds-multiselect__loading{-ms-flex-align:center;align-items:center;color:var(--pine-color-text-muted);display:-ms-flexbox;display:flex;font:var(--pine-typography-body);-ms-flex-pack:center;justify-content:center;padding:var(--pine-dimension-sm)}.pds-multiselect__load-more{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;padding:var(--pine-dimension-xs)}.pds-multiselect__footer{-webkit-border-before:var(--pine-border);border-block-start:var(--pine-border);border-block-start-color:var(--pine-color-border-subtle);padding:var(--pine-dimension-xs) var(--pine-dimension-sm)}.pds-multiselect__helper{color:var(--pine-color-text-message);font:var(--pine-typography-body-sm-medium);-webkit-margin-before:var(--pine-dimension-2xs);margin-block-start:var(--pine-dimension-2xs);-webkit-margin-start:var(--pine-dimension-none);margin-inline-start:var(--pine-dimension-none)}.pds-multiselect__error{-ms-flex-align:start;align-items:flex-start;color:var(--pine-color-text-message-danger);display:-ms-flexbox;display:flex;font:var(--pine-typography-body-sm-medium);gap:var(--pine-dimension-2xs);-webkit-margin-before:var(--pine-dimension-2xs);margin-block-start:var(--pine-dimension-2xs);-webkit-margin-start:var(--pine-dimension-none);margin-inline-start:var(--pine-dimension-none)}.pds-multiselect__error pds-icon{-ms-flex-negative:var(--pine-dimension-none);flex-shrink:var(--pine-dimension-none);-webkit-margin-before:var(--pine-dimension-025);margin-block-start:var(--pine-dimension-025)}.visually-hidden{border:var(--pine-dimension-none);clip:rect(0 0 0 0);-webkit-clip-path:polygon(0 0, 0 0, 0 0);clip-path:polygon(0 0, 0 0, 0 0);height:1px;margin:-1px;overflow:hidden;padding:var(--pine-dimension-none);position:absolute;white-space:nowrap;width:1px}`;
|
|
19314
19544
|
|
|
19315
19545
|
// Names only: pds-icon's `icon` prop also fetches URLs and data: SVGs, unsanitized.
|
|
19316
19546
|
const PINE_ICON_NAME = /^[a-z0-9-]+$/i;
|
|
@@ -19660,6 +19890,11 @@ class PdsMultiselect {
|
|
|
19660
19890
|
e.preventDefault(); // Prevent focus change
|
|
19661
19891
|
this.toggleOption(option);
|
|
19662
19892
|
};
|
|
19893
|
+
// mousedown already toggled the option. Without this, a click on the chip reaches the
|
|
19894
|
+
// checkbox through its label and toggles it a second time.
|
|
19895
|
+
this.handleOptionClick = (e) => {
|
|
19896
|
+
e.preventDefault();
|
|
19897
|
+
};
|
|
19663
19898
|
this.handleOptionMouseEnter = (index, option) => () => {
|
|
19664
19899
|
if (option.disabled)
|
|
19665
19900
|
return;
|
|
@@ -19718,6 +19953,18 @@ class PdsMultiselect {
|
|
|
19718
19953
|
this.internals = this.el.attachInternals();
|
|
19719
19954
|
}
|
|
19720
19955
|
}
|
|
19956
|
+
/**
|
|
19957
|
+
* Form Associated Custom Elements API: Called when the form is disabled
|
|
19958
|
+
*/
|
|
19959
|
+
formDisabledCallback(disabled) {
|
|
19960
|
+
// Also fires when this element's own `disabled` attribute is merely present, even as the
|
|
19961
|
+
// literal string "false" (a consumer's or React's attribute serialization can write that) —
|
|
19962
|
+
// the platform treats any value as disabled, independent of fieldset state. A real disabled
|
|
19963
|
+
// fieldset ancestor confirms this is genuinely that, not this element's own attribute.
|
|
19964
|
+
if (disabled && !this.el.closest('fieldset[disabled]'))
|
|
19965
|
+
return;
|
|
19966
|
+
this.disabled = disabled;
|
|
19967
|
+
}
|
|
19721
19968
|
componentWillLoad() {
|
|
19722
19969
|
this.originalSearchEmitter = this.pdsMultiselectSearch;
|
|
19723
19970
|
this.syncSelectedItems();
|
|
@@ -19816,8 +20063,20 @@ class PdsMultiselect {
|
|
|
19816
20063
|
var _a;
|
|
19817
20064
|
(_a = this.slottedTriggerEl) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-expanded', String(this.isOpen));
|
|
19818
20065
|
}
|
|
19819
|
-
disabledChanged() {
|
|
20066
|
+
disabledChanged(disabled) {
|
|
20067
|
+
var _a, _b;
|
|
19820
20068
|
this.syncSlottedTrigger();
|
|
20069
|
+
// A disabled control can't stay open, or its options could still be toggled.
|
|
20070
|
+
if (!disabled || !this.isOpen)
|
|
20071
|
+
return;
|
|
20072
|
+
const activeElement = document.activeElement;
|
|
20073
|
+
const focusInside = !!(((_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.contains(activeElement)) || this.el.contains(activeElement));
|
|
20074
|
+
this.closeDropdown();
|
|
20075
|
+
// A disabled built-in trigger can't take focus back (falls to <body>, as natively); a slotted
|
|
20076
|
+
// trigger without its own disabled property only gets aria-disabled and stays focusable, so
|
|
20077
|
+
// focus would otherwise stay stranded on the closed panel's former content.
|
|
20078
|
+
if (focusInside)
|
|
20079
|
+
(_b = this.activeTriggerEl) === null || _b === void 0 ? void 0 : _b.focus();
|
|
19821
20080
|
}
|
|
19822
20081
|
/**
|
|
19823
20082
|
* Sets focus on the trigger button.
|
|
@@ -19827,7 +20086,8 @@ class PdsMultiselect {
|
|
|
19827
20086
|
(_a = this.activeTriggerEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
19828
20087
|
}
|
|
19829
20088
|
/**
|
|
19830
|
-
* Clears all selected values and resets the component.
|
|
20089
|
+
* Clears all selected values and resets the component. Works while disabled too, as setting a
|
|
20090
|
+
* native control's value from script does.
|
|
19831
20091
|
*/
|
|
19832
20092
|
async clear() {
|
|
19833
20093
|
const hadValues = this.value.length > 0 || this.searchQuery !== '';
|
|
@@ -19850,11 +20110,12 @@ class PdsMultiselect {
|
|
|
19850
20110
|
}
|
|
19851
20111
|
/**
|
|
19852
20112
|
* Handle global keyboard events for accessibility.
|
|
19853
|
-
* Closes dropdown on Escape key press regardless of focus location.
|
|
20113
|
+
* Closes dropdown on Escape key press regardless of focus location. Taken in document's capture
|
|
20114
|
+
* phase, before a modal around the multiselect hears it on document and closes too.
|
|
19854
20115
|
*/
|
|
19855
20116
|
handleWindowKeyDown(event) {
|
|
19856
20117
|
var _a;
|
|
19857
|
-
if (!this.isOpen)
|
|
20118
|
+
if (!this.isOpen || event.defaultPrevented)
|
|
19858
20119
|
return;
|
|
19859
20120
|
if (event.key === 'Escape') {
|
|
19860
20121
|
event.preventDefault();
|
|
@@ -20462,7 +20723,7 @@ class PdsMultiselect {
|
|
|
20462
20723
|
'pds-multiselect__option--selected': isSelected,
|
|
20463
20724
|
'pds-multiselect__option--create': isCreateOption,
|
|
20464
20725
|
'pds-multiselect__option--disabled': isDisabled || isCreateDisabled,
|
|
20465
|
-
}, 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), onMouseEnter: this.handleOptionMouseEnter(index, option) }, isCreateOption ? (hAsync("pds-box", { class: "pds-multiselect__create-option", "align-items": "center", gap: "xs" }, hAsync("pds-icon", { name: "add", size: "small" }), hAsync("pds-text", null, formatMessage(this.createOptionLabel, { text: option.text })))) : (hAsync("pds-checkbox", { componentId: `${this.componentId}-checkbox-${index}`, checked: isSelected, label: option.text, disabled: isDisabled, style: { pointerEvents: 'none' } }, this.optionDisplay === 'chip' && (hAsync("pds-chip", { slot: "label", sentiment: "subtle", dot: !!option.dotColor, "dot-color": option.dotColor }, option.text)))), hasAction && this.renderOptionAction(option, optionId, isHighlighted)));
|
|
20726
|
+
}, 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 ? (hAsync("pds-box", { class: "pds-multiselect__create-option", "align-items": "center", gap: "xs" }, hAsync("pds-icon", { name: "add", size: "small" }), hAsync("pds-text", null, formatMessage(this.createOptionLabel, { text: option.text })))) : (hAsync("pds-checkbox", { componentId: `${this.componentId}-checkbox-${index}`, checked: isSelected, label: option.text, disabled: isDisabled, style: { pointerEvents: 'none' } }, this.optionDisplay === 'chip' && (hAsync("pds-chip", { slot: "label", sentiment: "subtle", dot: !!option.dotColor, "dot-color": option.dotColor, "max-width": "100%" }, option.text)))), hasAction && this.renderOptionAction(option, optionId, isHighlighted)));
|
|
20466
20727
|
}
|
|
20467
20728
|
renderOptionAction(option, optionId, isHighlighted) {
|
|
20468
20729
|
var _a;
|
|
@@ -20544,10 +20805,10 @@ class PdsMultiselect {
|
|
|
20544
20805
|
}
|
|
20545
20806
|
render() {
|
|
20546
20807
|
const hasSelections = this.selectedItems.length > 0;
|
|
20547
|
-
return (hAsync(Host, { key: '
|
|
20808
|
+
return (hAsync(Host, { key: 'a7806379c53598d41af91be63ee5bd300cc87755', "aria-disabled": this.disabled ? 'true' : null }, hAsync("div", { key: '0213d40953f1735b84c038e0e0afd1bc289d45ad', class: "pds-multiselect", onFocusout: this.handleContainerFocusOut }, this.label && (hAsync("label", { key: 'fa91c2337cdc9f5dea62173aeaa6b56e118a1316', id: `${this.componentId}-label`, htmlFor: this.componentId, class: {
|
|
20548
20809
|
'pds-multiselect__label': true,
|
|
20549
20810
|
'visually-hidden': this.hideLabel,
|
|
20550
|
-
} }, this.label)), hAsync("div", { key: '
|
|
20811
|
+
} }, this.label)), hAsync("div", { key: '54209b3edfb3583ab1bcecd2b1df973955abfcc3', class: "pds-multiselect__wrapper", ref: el => (this.containerEl = el), style: { width: this.triggerWidth } }, this.slottedTriggerEl ? (hAsync("slot", { name: "trigger" })) : this.selectedDisplay === 'pill' && this.pillPosition === 'inline' ? (hAsync("div", { ref: el => (this.pillInlineTriggerEl = el || undefined), part: "trigger", class: {
|
|
20551
20812
|
'pds-multiselect__trigger': true,
|
|
20552
20813
|
'pds-multiselect__trigger--open': this.isOpen,
|
|
20553
20814
|
'pds-multiselect__trigger--disabled': this.disabled,
|
|
@@ -20563,7 +20824,7 @@ class PdsMultiselect {
|
|
|
20563
20824
|
}, 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 }, hAsync("span", { class: {
|
|
20564
20825
|
'pds-multiselect__trigger-text': true,
|
|
20565
20826
|
'pds-multiselect__trigger-text--placeholder': !hasSelections || (this.selectedDisplay === 'pill' && this.pillPosition === 'below'),
|
|
20566
|
-
} }, this.getTriggerText()), hAsync("pds-icon", { "aria-hidden": "true", class: "pds-multiselect__icon", icon: enlarge }))), this.renderDropdown()), this.selectedDisplay === 'pill' && this.pillPosition === 'below' && this.renderBelowPills(), hAsync("span", { key: '
|
|
20827
|
+
} }, this.getTriggerText()), hAsync("pds-icon", { "aria-hidden": "true", class: "pds-multiselect__icon", icon: enlarge }))), this.renderDropdown()), this.selectedDisplay === 'pill' && this.pillPosition === 'below' && this.renderBelowPills(), hAsync("span", { key: 'e3c1bb5c484d851b332e994cd2a528ae95cbfc4d', class: "visually-hidden", "aria-live": "polite", "aria-atomic": "true" }, this.removalAnnouncement), this.helperMessage && !(this.errorMessage && this.errorMessage.length > 0) && (hAsync("p", { key: '2009f6487118252ef1ec14170ddd0c6853ad279f', class: "pds-multiselect__helper", id: messageId(this.componentId, 'helper') }, this.helperMessage)), this.errorMessage && (hAsync("p", { key: 'c740f4845ff0c1ccff4633810c1d9d92fb2e8a78', class: "pds-multiselect__error", id: messageId(this.componentId, 'error') }, hAsync("pds-icon", { key: 'b2406ab3b0957a440593b4b986c98476258349be', icon: danger, size: "small" }), this.errorMessage)), hAsync("div", { key: '6d2db6563864c71ab92ed9a8d4133efca23b1c55', style: { display: 'none' } }, hAsync("slot", { key: '2af0e0a7e2410b9850fd15ef524fb388c32dc320' })))));
|
|
20567
20828
|
}
|
|
20568
20829
|
static get formAssociated() { return true; }
|
|
20569
20830
|
get el() { return getElement(this); }
|
|
@@ -20653,7 +20914,7 @@ class PdsMultiselect {
|
|
|
20653
20914
|
"clear": [64],
|
|
20654
20915
|
"refreshOptions": [64]
|
|
20655
20916
|
},
|
|
20656
|
-
"$listeners$": [[
|
|
20917
|
+
"$listeners$": [[6, "keydown", "handleWindowKeyDown"]],
|
|
20657
20918
|
"$lazyBundleId$": "-",
|
|
20658
20919
|
"$attrsToReflect$": []
|
|
20659
20920
|
}; }
|
|
@@ -20703,6 +20964,16 @@ const cssEscape = (value) => {
|
|
|
20703
20964
|
|
|
20704
20965
|
const pdsPopoverCss = () => `:host{--sizing-max-width-default:352px;display:inline-block}:host .pds-popover__trigger-wrapper{display:inline-block}:host .pds-popover__content-slot-wrapper{display:none}`;
|
|
20705
20966
|
|
|
20967
|
+
/** Open auto popovers, in the order they opened: Escape goes to the last one it applies to. */
|
|
20968
|
+
const openAutoPopovers = [];
|
|
20969
|
+
/** The focused element, followed down through shadow roots to the control that has focus. */
|
|
20970
|
+
function deepActiveElement() {
|
|
20971
|
+
var _a;
|
|
20972
|
+
let active = document.activeElement;
|
|
20973
|
+
while ((_a = active === null || active === void 0 ? void 0 : active.shadowRoot) === null || _a === void 0 ? void 0 : _a.activeElement)
|
|
20974
|
+
active = active.shadowRoot.activeElement;
|
|
20975
|
+
return active;
|
|
20976
|
+
}
|
|
20706
20977
|
/**
|
|
20707
20978
|
* @slot trigger - The trigger element for the popover
|
|
20708
20979
|
* @slot (default) - The content to display inside the popover
|
|
@@ -20738,7 +21009,7 @@ class PdsPopover {
|
|
|
20738
21009
|
*/
|
|
20739
21010
|
this.triggerObserver = null;
|
|
20740
21011
|
/**
|
|
20741
|
-
* Portal element
|
|
21012
|
+
* Portal element: in document.body, or in the open dialog the popover is in
|
|
20742
21013
|
*/
|
|
20743
21014
|
this.portalEl = null;
|
|
20744
21015
|
/**
|
|
@@ -20834,6 +21105,26 @@ class PdsPopover {
|
|
|
20834
21105
|
break;
|
|
20835
21106
|
}
|
|
20836
21107
|
};
|
|
21108
|
+
/** The focus style copied into a shadow root the panel opened in, which `document.head` can't reach. */
|
|
21109
|
+
this.shadowFocusStyle = null;
|
|
21110
|
+
/** The dialog the panel was opened in, closed along with it. */
|
|
21111
|
+
this.watchedDialog = null;
|
|
21112
|
+
this.onDialogClose = () => {
|
|
21113
|
+
this.hide();
|
|
21114
|
+
};
|
|
21115
|
+
/**
|
|
21116
|
+
* Inside a dialog, the panel can sit in a form that wraps the dialog, which a body portal never
|
|
21117
|
+
* did. A submit from the panel (a button in it, or Enter in a field in it) is stopped, so the
|
|
21118
|
+
* panel behaves as it does in the body.
|
|
21119
|
+
*/
|
|
21120
|
+
this.handleSubmitFromPanel = (event) => {
|
|
21121
|
+
if (!this.portalEl || !containsComposed$1(event.target, this.portalEl))
|
|
21122
|
+
return;
|
|
21123
|
+
if (containsComposed$1(this.portalEl, event.submitter) || containsComposed$1(this.portalEl, deepActiveElement())) {
|
|
21124
|
+
event.preventDefault();
|
|
21125
|
+
event.stopPropagation();
|
|
21126
|
+
}
|
|
21127
|
+
};
|
|
20837
21128
|
}
|
|
20838
21129
|
restorePlacementDefault(newValue) {
|
|
20839
21130
|
this.placement = restoreReflectedDefault(this.el, 'placement', newValue, 'right');
|
|
@@ -20896,19 +21187,23 @@ class PdsPopover {
|
|
|
20896
21187
|
(_a = this.triggerEl) === null || _a === void 0 ? void 0 : _a.addEventListener('click', this.handleTriggerClick);
|
|
20897
21188
|
this.observeTrigger();
|
|
20898
21189
|
this.linkTriggerToPortal();
|
|
20899
|
-
// Still open after a move: the trigger moved, so the portal follows it
|
|
21190
|
+
// Still open after a move: the trigger moved, so the portal follows it, into the dialog it
|
|
21191
|
+
// is in now, if any.
|
|
20900
21192
|
if (this.active) {
|
|
21193
|
+
this.placePortal();
|
|
20901
21194
|
requestAnimationFrame(() => this.handlePopoverPositioning());
|
|
20902
21195
|
}
|
|
20903
21196
|
}
|
|
20904
21197
|
disconnectedCallback() {
|
|
20905
21198
|
var _a;
|
|
20906
21199
|
// Moved in one operation (a DOM morph, or a framework reparenting it), the popover is
|
|
20907
|
-
// already back in the page. Its portal is
|
|
20908
|
-
// where it was.
|
|
21200
|
+
// already back in the page. Its portal is outside the popover, so it stays open, with focus
|
|
21201
|
+
// where it was; connectedCallback moves it to follow the popover.
|
|
20909
21202
|
if (this.el.isConnected)
|
|
20910
21203
|
return;
|
|
20911
21204
|
this.isComponentMounted = false;
|
|
21205
|
+
this.unwatchDialogClose();
|
|
21206
|
+
this.forgetOpen();
|
|
20912
21207
|
// Open, the content sits in the portal; put it back before the portal goes. Only listeners on
|
|
20913
21208
|
// the popover itself hear the close event now, but those are the ones mirroring its state.
|
|
20914
21209
|
if (this.active) {
|
|
@@ -20929,6 +21224,7 @@ class PdsPopover {
|
|
|
20929
21224
|
// Clean up all event listeners
|
|
20930
21225
|
this.removeLightDismissListeners();
|
|
20931
21226
|
this.removeScrollAndResizeListeners();
|
|
21227
|
+
document.removeEventListener('submit', this.handleSubmitFromPanel, true);
|
|
20932
21228
|
// Clear any pending debounce timers
|
|
20933
21229
|
this.clearDebounceTimers();
|
|
20934
21230
|
// Remove portal from DOM
|
|
@@ -20973,9 +21269,6 @@ class PdsPopover {
|
|
|
20973
21269
|
else {
|
|
20974
21270
|
this.portalEl.id = `${this.componentId}-portal`;
|
|
20975
21271
|
}
|
|
20976
|
-
// Add accessibility attributes for screen readers
|
|
20977
|
-
// Note: Native Popover API doesn't add a specific role, keeping semantic HTML
|
|
20978
|
-
this.portalEl.setAttribute('aria-modal', 'false'); // Not a modal, can interact with rest of page
|
|
20979
21272
|
// Append to body
|
|
20980
21273
|
document.body.appendChild(this.portalEl);
|
|
20981
21274
|
// Add global focus styles to match Pine design system
|
|
@@ -21059,7 +21352,27 @@ class PdsPopover {
|
|
|
21059
21352
|
// Clear tracking array
|
|
21060
21353
|
this.movedNodes = [];
|
|
21061
21354
|
}
|
|
21355
|
+
copyFocusStylesInto(root) {
|
|
21356
|
+
var _a, _b, _c;
|
|
21357
|
+
// Outside a shadow root the document's own style applies, so drop a copy left in one.
|
|
21358
|
+
if (!(root instanceof ShadowRoot)) {
|
|
21359
|
+
(_a = this.shadowFocusStyle) === null || _a === void 0 ? void 0 : _a.remove();
|
|
21360
|
+
this.shadowFocusStyle = null;
|
|
21361
|
+
return;
|
|
21362
|
+
}
|
|
21363
|
+
if (((_b = this.shadowFocusStyle) === null || _b === void 0 ? void 0 : _b.parentNode) === root || !this.portalEl)
|
|
21364
|
+
return;
|
|
21365
|
+
const source = document.querySelector(`style[data-pds-popover-focus="${cssEscape(this.portalEl.id)}"]`);
|
|
21366
|
+
if (!source)
|
|
21367
|
+
return;
|
|
21368
|
+
(_c = this.shadowFocusStyle) === null || _c === void 0 ? void 0 : _c.remove();
|
|
21369
|
+
this.shadowFocusStyle = source.cloneNode(true);
|
|
21370
|
+
root.appendChild(this.shadowFocusStyle);
|
|
21371
|
+
}
|
|
21062
21372
|
removePortal() {
|
|
21373
|
+
var _a;
|
|
21374
|
+
(_a = this.shadowFocusStyle) === null || _a === void 0 ? void 0 : _a.remove();
|
|
21375
|
+
this.shadowFocusStyle = null;
|
|
21063
21376
|
if (this.portalEl) {
|
|
21064
21377
|
// Remove the portal element from DOM
|
|
21065
21378
|
if (this.portalEl.parentNode) {
|
|
@@ -21084,9 +21397,13 @@ class PdsPopover {
|
|
|
21084
21397
|
// Record open timestamp to prevent immediate close from opening click
|
|
21085
21398
|
this.openTimestamp = Date.now();
|
|
21086
21399
|
this.linkTriggerToPortal();
|
|
21400
|
+
this.placePortal();
|
|
21087
21401
|
// Update portal content with latest slot content
|
|
21088
21402
|
this.updatePortalContent();
|
|
21089
|
-
// Show portal
|
|
21403
|
+
// Show portal. The attribute tells a modal around it that this popover takes Escape first; only
|
|
21404
|
+
// an auto popover listens for Escape.
|
|
21405
|
+
if (this.popoverType === 'auto')
|
|
21406
|
+
this.portalEl.setAttribute('data-pds-popover-open', '');
|
|
21090
21407
|
this.portalEl.style.display = 'block';
|
|
21091
21408
|
this.portalEl.style.opacity = '1';
|
|
21092
21409
|
this.portalEl.style.visibility = 'visible';
|
|
@@ -21098,8 +21415,10 @@ class PdsPopover {
|
|
|
21098
21415
|
});
|
|
21099
21416
|
// Add scroll and resize listeners for repositioning (always)
|
|
21100
21417
|
this.addScrollAndResizeListeners();
|
|
21418
|
+
document.addEventListener('submit', this.handleSubmitFromPanel, true);
|
|
21101
21419
|
// Add document listeners for light dismiss and escape key (auto type only)
|
|
21102
21420
|
if (this.popoverType === 'auto') {
|
|
21421
|
+
openAutoPopovers.push(this);
|
|
21103
21422
|
this.addLightDismissListeners();
|
|
21104
21423
|
}
|
|
21105
21424
|
// Emit open event
|
|
@@ -21115,12 +21434,16 @@ class PdsPopover {
|
|
|
21115
21434
|
if (!this.active || !this.portalEl)
|
|
21116
21435
|
return;
|
|
21117
21436
|
this.active = false;
|
|
21118
|
-
|
|
21119
|
-
|
|
21437
|
+
this.unwatchDialogClose();
|
|
21438
|
+
// Restoring the content drops its focus to the body, so check where focus is first. In a
|
|
21439
|
+
// shadow root, document.activeElement is only its host.
|
|
21440
|
+
const focusWasInside = containsComposed$1(this.portalEl, deepActiveElement());
|
|
21120
21441
|
this.linkTriggerToPortal();
|
|
21121
21442
|
// Restore content back to original slot positions
|
|
21122
21443
|
this.restorePortalContent();
|
|
21123
|
-
// Hide portal
|
|
21444
|
+
// Hide portal. The dark-mode border set in a shadow root is worked out again on the next open.
|
|
21445
|
+
this.portalEl.style.border = '';
|
|
21446
|
+
this.portalEl.removeAttribute('data-pds-popover-open');
|
|
21124
21447
|
this.portalEl.style.display = 'none';
|
|
21125
21448
|
this.portalEl.style.opacity = '0';
|
|
21126
21449
|
this.portalEl.style.visibility = 'hidden';
|
|
@@ -21130,8 +21453,10 @@ class PdsPopover {
|
|
|
21130
21453
|
this.returnFocusToTrigger();
|
|
21131
21454
|
}
|
|
21132
21455
|
// Remove all listeners
|
|
21456
|
+
this.forgetOpen();
|
|
21133
21457
|
this.removeLightDismissListeners();
|
|
21134
21458
|
this.removeScrollAndResizeListeners();
|
|
21459
|
+
document.removeEventListener('submit', this.handleSubmitFromPanel, true);
|
|
21135
21460
|
// Clear any pending timers
|
|
21136
21461
|
this.clearDebounceTimers();
|
|
21137
21462
|
// Emit close event
|
|
@@ -21151,6 +21476,59 @@ class PdsPopover {
|
|
|
21151
21476
|
this.show();
|
|
21152
21477
|
}
|
|
21153
21478
|
}
|
|
21479
|
+
/**
|
|
21480
|
+
* Puts the panel where it shows above everything around the popover. In an open dialog, it goes
|
|
21481
|
+
* inside it: a modal dialog sits in the top layer above the body and makes the rest of the page
|
|
21482
|
+
* inert, and a non-modal one sits above it by z-index. Right after the popover, it's next in the
|
|
21483
|
+
* Tab order. In another component's slot, though, it would have no slot to render in, and in a
|
|
21484
|
+
* form its buttons would submit it, so there it goes at the end of the dialog.
|
|
21485
|
+
*/
|
|
21486
|
+
placePortal() {
|
|
21487
|
+
var _a, _b;
|
|
21488
|
+
if (!this.portalEl)
|
|
21489
|
+
return;
|
|
21490
|
+
const dialog = closest$1('dialog[open]', this.el);
|
|
21491
|
+
if (!dialog) {
|
|
21492
|
+
this.unwatchDialogClose();
|
|
21493
|
+
this.portalEl.style.border = '';
|
|
21494
|
+
if (this.portalEl.parentElement !== document.body)
|
|
21495
|
+
document.body.appendChild(this.portalEl);
|
|
21496
|
+
this.copyFocusStylesInto(document);
|
|
21497
|
+
return;
|
|
21498
|
+
}
|
|
21499
|
+
const form = closest$1('form', this.el);
|
|
21500
|
+
const besidePopover = !((_a = this.el.parentElement) === null || _a === void 0 ? void 0 : _a.shadowRoot) && !(form && containsComposed$1(dialog, form));
|
|
21501
|
+
if (besidePopover) {
|
|
21502
|
+
if (this.el.nextElementSibling !== this.portalEl)
|
|
21503
|
+
(_b = this.el.parentNode) === null || _b === void 0 ? void 0 : _b.insertBefore(this.portalEl, this.el.nextSibling);
|
|
21504
|
+
}
|
|
21505
|
+
else if (this.portalEl.parentNode !== dialog) {
|
|
21506
|
+
dialog.appendChild(this.portalEl);
|
|
21507
|
+
}
|
|
21508
|
+
this.watchDialogClose(dialog);
|
|
21509
|
+
const root = this.portalEl.getRootNode();
|
|
21510
|
+
this.copyFocusStylesInto(root);
|
|
21511
|
+
// In a shadow root, the copied dark-mode rule can't see a [data-theme="dark"] on the page.
|
|
21512
|
+
this.portalEl.style.border = root instanceof ShadowRoot && closest$1('[data-theme="dark"]', this.el) ? 'var(--pine-border)' : '';
|
|
21513
|
+
}
|
|
21514
|
+
forgetOpen() {
|
|
21515
|
+
const index = openAutoPopovers.indexOf(this);
|
|
21516
|
+
if (index >= 0)
|
|
21517
|
+
openAutoPopovers.splice(index, 1);
|
|
21518
|
+
}
|
|
21519
|
+
/**
|
|
21520
|
+
* Whether an Escape is this popover's. One from a dialog the popover isn't in belongs to that
|
|
21521
|
+
* dialog when it's above it: a top-layer dialog or a pds-modal. A plain non-modal dialog inside
|
|
21522
|
+
* the popover's modal doesn't close on Escape, so the popover takes it.
|
|
21523
|
+
*/
|
|
21524
|
+
takesEscapeFrom(event) {
|
|
21525
|
+
var _a, _b;
|
|
21526
|
+
const origin = ((_b = (_a = event.composedPath) === null || _a === void 0 ? void 0 : _a.call(event)[0]) !== null && _b !== void 0 ? _b : event.target);
|
|
21527
|
+
const dialog = closest$1('dialog[open]', origin);
|
|
21528
|
+
if (!dialog || containsComposed$1(dialog, this.portalEl))
|
|
21529
|
+
return true;
|
|
21530
|
+
return !(dialog.classList.contains('pds-modal__backdrop') || dialog.matches(':modal'));
|
|
21531
|
+
}
|
|
21154
21532
|
/**
|
|
21155
21533
|
* Adds light dismiss listeners (click outside and escape key)
|
|
21156
21534
|
*/
|
|
@@ -21159,6 +21537,19 @@ class PdsPopover {
|
|
|
21159
21537
|
document.addEventListener('click', this.boundClickOutsideHandler, true);
|
|
21160
21538
|
document.addEventListener('keydown', this.boundEscapeKeyHandler);
|
|
21161
21539
|
}
|
|
21540
|
+
/** Closes the popover when the dialog it opened in closes, so it isn't left open inside. */
|
|
21541
|
+
watchDialogClose(dialog) {
|
|
21542
|
+
if (this.watchedDialog === dialog)
|
|
21543
|
+
return;
|
|
21544
|
+
this.unwatchDialogClose();
|
|
21545
|
+
this.watchedDialog = dialog;
|
|
21546
|
+
dialog.addEventListener('close', this.onDialogClose);
|
|
21547
|
+
}
|
|
21548
|
+
unwatchDialogClose() {
|
|
21549
|
+
var _a;
|
|
21550
|
+
(_a = this.watchedDialog) === null || _a === void 0 ? void 0 : _a.removeEventListener('close', this.onDialogClose);
|
|
21551
|
+
this.watchedDialog = null;
|
|
21552
|
+
}
|
|
21162
21553
|
/**
|
|
21163
21554
|
* Removes light dismiss listeners
|
|
21164
21555
|
*/
|
|
@@ -21184,7 +21575,7 @@ class PdsPopover {
|
|
|
21184
21575
|
* Handles clicks outside the popover for light dismiss (auto type only)
|
|
21185
21576
|
*/
|
|
21186
21577
|
handleClickOutside(event) {
|
|
21187
|
-
var _a, _b
|
|
21578
|
+
var _a, _b;
|
|
21188
21579
|
// Ignore events that occurred at or before the popover opened
|
|
21189
21580
|
// This prevents the opening click from immediately closing the popover
|
|
21190
21581
|
// Convert event.timeStamp (DOMHighResTimeStamp from performance.now()) to epoch time
|
|
@@ -21195,16 +21586,18 @@ class PdsPopover {
|
|
|
21195
21586
|
if (eventTime <= this.openTimestamp) {
|
|
21196
21587
|
return;
|
|
21197
21588
|
}
|
|
21198
|
-
|
|
21589
|
+
// In a shadow root, event.target is only its host.
|
|
21590
|
+
const target = ((_b = (_a = event.composedPath) === null || _a === void 0 ? void 0 : _a.call(event)[0]) !== null && _b !== void 0 ? _b : event.target);
|
|
21199
21591
|
// A datepicker's calendar is portaled to the body: a click in the calendar of a datepicker
|
|
21200
|
-
// inside this popover, in its content or its trigger, isn't outside it.
|
|
21201
|
-
|
|
21592
|
+
// inside this popover, in its content or its trigger, isn't outside it. The target can be
|
|
21593
|
+
// inside the calendar's shadow root, so look up across it.
|
|
21594
|
+
const calendar = closest$1('.pds-datepicker-calendar-portal', target);
|
|
21202
21595
|
const owner = calendar === null || calendar === void 0 ? void 0 : calendar.pdsDatepicker;
|
|
21203
21596
|
if (owner && (containsComposed$1(this.portalEl, owner) || containsComposed$1(this.triggerEl, owner)))
|
|
21204
21597
|
return;
|
|
21205
21598
|
// Check if click is outside both the popover portal and the trigger
|
|
21206
|
-
const clickedInsidePopover = (
|
|
21207
|
-
const clickedInsideTrigger = (
|
|
21599
|
+
const clickedInsidePopover = containsComposed$1(this.portalEl, target);
|
|
21600
|
+
const clickedInsideTrigger = containsComposed$1(this.triggerEl, target);
|
|
21208
21601
|
if (!clickedInsidePopover && !clickedInsideTrigger) {
|
|
21209
21602
|
this.hide();
|
|
21210
21603
|
}
|
|
@@ -21225,14 +21618,19 @@ class PdsPopover {
|
|
|
21225
21618
|
* Mirrors native Popover API: Escape closes and returns focus to trigger
|
|
21226
21619
|
*/
|
|
21227
21620
|
handleEscapeKey(event) {
|
|
21228
|
-
|
|
21229
|
-
|
|
21230
|
-
|
|
21231
|
-
|
|
21232
|
-
|
|
21233
|
-
|
|
21234
|
-
|
|
21235
|
-
|
|
21621
|
+
// A control inside that closes on Escape (a datepicker, a combobox) has handled it already.
|
|
21622
|
+
if (event.key !== 'Escape' || event.defaultPrevented)
|
|
21623
|
+
return;
|
|
21624
|
+
// Like the native Popover API, Escape closes only the top popover: the last one opened that
|
|
21625
|
+
// it applies to. Every open popover hears it, so each checks whether it's that one.
|
|
21626
|
+
const top = [...openAutoPopovers].reverse().find(popover => popover.takesEscapeFrom(event));
|
|
21627
|
+
if (top !== this)
|
|
21628
|
+
return;
|
|
21629
|
+
// Take the key, so the dialog or modal around it doesn't close too.
|
|
21630
|
+
event.preventDefault();
|
|
21631
|
+
event.stopPropagation();
|
|
21632
|
+
// Close popover and return focus to trigger
|
|
21633
|
+
this.hide();
|
|
21236
21634
|
}
|
|
21237
21635
|
/**
|
|
21238
21636
|
* Handles scroll events to reposition the popover (debounced for performance)
|
|
@@ -21337,13 +21735,20 @@ class PdsPopover {
|
|
|
21337
21735
|
}
|
|
21338
21736
|
this.portalEl.style.top = `${top}px`;
|
|
21339
21737
|
this.portalEl.style.left = `${left}px`;
|
|
21738
|
+
// `position: fixed` measures from the viewport unless an ancestor becomes its containing block,
|
|
21739
|
+
// as a modal dialog does with its backdrop filter. Shift by however far it landed from the spot.
|
|
21740
|
+
const placed = this.portalEl.getBoundingClientRect();
|
|
21741
|
+
if (Math.abs(placed.top - top) > 0.5 || Math.abs(placed.left - left) > 0.5) {
|
|
21742
|
+
this.portalEl.style.top = `${2 * top - placed.top}px`;
|
|
21743
|
+
this.portalEl.style.left = `${2 * left - placed.left}px`;
|
|
21744
|
+
}
|
|
21340
21745
|
// Reset the repositioning guard after a short delay
|
|
21341
21746
|
setTimeout(() => {
|
|
21342
21747
|
this.isRepositioning = false;
|
|
21343
21748
|
}, 16); // ~1 frame at 60fps
|
|
21344
21749
|
}
|
|
21345
21750
|
render() {
|
|
21346
|
-
return (hAsync(Host, { key: '
|
|
21751
|
+
return (hAsync(Host, { key: 'da8a0c715df1199231b1265085f3f9ae0234032d', id: this.componentId }, hAsync("span", { key: 'f35023492399420829cec2e88556462f5ac1663e', class: "pds-popover__trigger-wrapper" }, hAsync("slot", { key: '38ebe92eebb87665467b3f92ff94dc8095450063', name: "trigger", onSlotchange: this.handleTriggerSlotChange })), hAsync("div", { key: '8917930f4520544d14bbd68b4c7936dd60af19e3', class: "pds-popover__content-slot-wrapper" }, hAsync("slot", { key: '28d3f9112256edd95721a79a7072a9e35a3712bf', onSlotchange: this.handleContentSlotChange }))));
|
|
21347
21752
|
}
|
|
21348
21753
|
get el() { return getElement(this); }
|
|
21349
21754
|
static get watchers() { return {
|
|
@@ -21461,7 +21866,7 @@ class PdsProperty {
|
|
|
21461
21866
|
|
|
21462
21867
|
const labelCss$3 = () => `.sc-pds-radio-h{display:inline-block}[aria-disabled=true].sc-pds-radio-h label.sc-pds-radio{color:var(--pine-color-text-label-disabled)}[aria-readonly=true].sc-pds-radio-h label.sc-pds-radio{color:var(--pine-color-text-label-readonly)}label.sc-pds-radio{color:var(--pine-color-text-label);font:var(--pine-typography-body-medium);letter-spacing:var(--pine-letter-spacing)}`;
|
|
21463
21868
|
|
|
21464
|
-
const pdsRadioCss = () => `.sc-pds-radio-h{--sizing-check-size:6px;--sizing-input-size:var(--pine-dimension-sm);--sizing-margin-block-start:6px;-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;position:relative}.is-invalid.sc-pds-radio-h .pds-radio__message--error.sc-pds-radio{color:var(--pine-color-text-message-danger)}.has-border.sc-pds-radio-h{-ms-flex-align:start;align-items:flex-start;border:var(--pine-border);border-radius:var(--pine-dimension-125);-webkit-column-gap:var(--pine-dimension-xs);-moz-column-gap:var(--pine-dimension-xs);column-gap:var(--pine-dimension-xs);display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;padding:var(--pine-dimension-md)}@media (max-width: 767px){.has-border.sc-pds-radio-h{-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex:1 1 100%;flex:1 1 100%;max-width:100%;min-width:0}}.has-border.sc-pds-radio-h:hover{border:var(--pine-border-hover)}.has-border.sc-pds-radio-h:has(input:checked){-webkit-box-shadow:0 0 0 2px var(--pine-color-primary-hover);box-shadow:0 0 0 2px var(--pine-color-primary-hover)}.has-border.sc-pds-radio-h label.sc-pds-radio{color:var(--pine-color-text);font-weight:var(--pine-font-weight-semi-bold)}.has-border.sc-pds-radio-h label.sc-pds-radio::after{content:"";cursor:pointer;height:100%;left:0;position:absolute;top:0;width:100%;z-index:1}.has-border.sc-pds-radio-h:has(input:disabled){background:var(--pine-color-background-container-disabled);border-color:var(--pine-color-border-disabled);cursor:not-allowed}.has-border.sc-pds-radio-h:has(input:disabled) label.sc-pds-radio{color:var(--pine-color-text-label-disabled);cursor:not-allowed}.has-border.sc-pds-radio-h:has(input:disabled) label.sc-pds-radio::after{cursor:not-allowed}.has-border.is-invalid.sc-pds-radio-h .pds-radio__message--error.sc-pds-radio{color:var(--pine-color-text-message-danger)}input.sc-pds-radio{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--pine-color-background-container);border:var(--pine-border);border-radius:var(--pine-border-radius-full);-ms-flex:none;flex:none;height:var(--sizing-input-size);margin:0;-webkit-margin-before:var(--pine-dimension-025);margin-block-start:var(--pine-dimension-025);position:relative;width:var(--sizing-input-size)}input.visually-hidden.sc-pds-radio{border:0;clip:rect(0 0 0 0);-webkit-clip-path:polygon(0 0, 0 0, 0 0);clip-path:polygon(0 0, 0 0, 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}input.sc-pds-radio:hover{background:var(--pine-color-background-container-hover);border:var(--pine-border-hover)}input.sc-pds-radio:checked{background:var(--pine-color-accent);border-color:var(--pine-color-accent)}input.sc-pds-radio:checked:hover{background:var(--pine-color-accent-hover);border-color:var(--pine-color-accent-hover)}input.sc-pds-radio:checked::after{background:var(--pine-color-text-primary);border-radius:var(--pine-border-radius-full);content:"";display:block;height:var(--sizing-check-size);left:50%;position:absolute;top:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);width:var(--sizing-check-size)}input.sc-pds-radio:disabled{background:var(--pine-color-background-container-disabled);border-color:var(--pine-color-border-disabled);cursor:not-allowed}input.sc-pds-radio:disabled:checked{background-color:var(--pine-color-accent-disabled);border-color:var(--pine-color-border-disabled)}input.sc-pds-radio:disabled:checked::after{border-color:var(--pine-color-border-disabled)}input.sc-pds-radio:focus-visible{outline:var(--pine-outline-focus)}label.sc-pds-radio{display:-ms-flexbox;display:flex;gap:var(--pine-dimension-xs)}label.sc-pds-radio:has(input:disabled){color:var(--pine-color-text-label-disabled);cursor:not-allowed}.sc-pds-radio-h:has(input:disabled) .pds-radio__message.sc-pds-radio{color:var(--pine-color-text-label-disabled)}.visually-hidden.sc-pds-radio{border:0;clip:rect(0 0 0 0);-webkit-clip-path:polygon(0 0, 0 0, 0 0);clip-path:polygon(0 0, 0 0, 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pds-radio__message.sc-pds-radio{color:var(--pine-color-text-message);-ms-flex-preferred-size:100%;flex-basis:100%;font:var(--pine-typography-body);-webkit-margin-start:var(--pine-dimension-md);margin-inline-start:var(--pine-dimension-md);width:100%}.pds-radio__message--error.sc-pds-radio{display:-ms-flexbox;display:flex;gap:var(--pine-dimension-2xs)}.pds-radio__message--error.sc-pds-radio pds-icon.sc-pds-radio{-webkit-margin-before:var(--pine-dimension-025);margin-block-start:var(--pine-dimension-025)}.has-image.sc-pds-radio-h{-ms-flex-align:center;align-items:center;border:var(--pine-border);border-radius:var(--pine-dimension-125);-webkit-column-gap:var(--pine-dimension-xs);-moz-column-gap:var(--pine-dimension-xs);column-gap:var(--pine-dimension-xs);display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;padding:var(--pine-dimension-md)}@media (max-width: 767px){.has-image.sc-pds-radio-h{-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex:1 1 100%;flex:1 1 100%;max-width:100%;min-width:0}}.has-image.sc-pds-radio-h:hover{border:var(--pine-border-hover)}.has-image.sc-pds-radio-h:has(input:checked){-webkit-box-shadow:0 0 0 2px var(--pine-color-primary-hover);box-shadow:0 0 0 2px var(--pine-color-primary-hover)}.has-image.sc-pds-radio-h label.sc-pds-radio{color:var(--pine-color-text);display:-ms-flexbox;display:flex;font-weight:var(--pine-font-weight-semi-bold);gap:var(--pine-dimension-xs)}.has-image.sc-pds-radio-h label.sc-pds-radio::after{content:"";cursor:pointer;height:100%;left:0;position:absolute;top:0;width:100%;z-index:1}.has-image.sc-pds-radio-h .pds-radio__image-container.sc-pds-radio{-ms-flex-align:center;align-items:center;align-self:center;border:var(--pine-border);border-radius:var(--pine-border-radius-full);cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex:none;flex:none;grid-area:image;-ms-flex-pack:center;justify-content:center;overflow:hidden;position:relative;-webkit-transition:all var(--pine-motion-duration-base) ease;transition:all var(--pine-motion-duration-base) ease}.has-image.sc-pds-radio-h .pds-radio__image-container.sc-pds-radio:hover{border-color:var(--pine-color-border-hover)}.has-image.sc-pds-radio-h .pds-radio__image-container.sc-pds-radio .pds-radio__image.sc-pds-radio{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.has-image.sc-pds-radio-h .pds-radio__message.sc-pds-radio{grid-area:message;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-start:0;margin-inline-start:0}.has-image.is-disabled.sc-pds-radio-h{background:var(--pine-color-background-container-disabled);border-color:var(--pine-color-border-disabled);cursor:not-allowed}.has-image.is-disabled.sc-pds-radio-h .pds-radio__image-container.sc-pds-radio{border-color:var(--pine-color-border-disabled);cursor:not-allowed;opacity:0.5}.has-image.is-disabled.sc-pds-radio-h .pds-radio__image-container.sc-pds-radio:hover{border-color:var(--pine-color-border-disabled)}.has-image.is-disabled.sc-pds-radio-h label.sc-pds-radio{color:var(--pine-color-text-label-disabled);cursor:not-allowed}.has-image.is-disabled.sc-pds-radio-h label.sc-pds-radio::after{cursor:not-allowed}.has-image.is-disabled.sc-pds-radio-h .pds-radio__message.sc-pds-radio{color:var(--pine-color-text-label-disabled)}.has-image.is-invalid.sc-pds-radio-h .pds-radio__message--error.sc-pds-radio{color:var(--pine-color-text-message-danger)}`;
|
|
21869
|
+
const pdsRadioCss = () => `.sc-pds-radio-h{--sizing-check-size:6px;--sizing-input-size:var(--pine-dimension-sm);--sizing-margin-block-start:6px;-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;position:relative}.is-invalid.sc-pds-radio-h .pds-radio__message--error.sc-pds-radio{color:var(--pine-color-text-message-danger)}.has-border.sc-pds-radio-h{-ms-flex-align:start;align-items:flex-start;border:var(--pine-border);border-radius:var(--pine-dimension-125);-webkit-column-gap:var(--pine-dimension-xs);-moz-column-gap:var(--pine-dimension-xs);column-gap:var(--pine-dimension-xs);display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;padding:var(--pine-dimension-md)}@media (max-width: 767px){.has-border.sc-pds-radio-h{-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex:1 1 100%;flex:1 1 100%;max-width:100%;min-width:0}}.has-border.sc-pds-radio-h:hover{border:var(--pine-border-hover)}.has-border.sc-pds-radio-h:has(input:checked){-webkit-box-shadow:0 0 0 2px var(--pine-color-primary-hover);box-shadow:0 0 0 2px var(--pine-color-primary-hover)}.has-border.sc-pds-radio-h label.sc-pds-radio{color:var(--pine-color-text);font-weight:var(--pine-font-weight-semi-bold)}.has-border.sc-pds-radio-h label.sc-pds-radio::after{content:"";cursor:pointer;height:100%;left:0;position:absolute;top:0;width:100%;z-index:1}.has-border.sc-pds-radio-h:has(input:disabled){background:var(--pine-color-background-container-disabled);border-color:var(--pine-color-border-disabled);cursor:not-allowed}.has-border.sc-pds-radio-h:has(input:disabled) label.sc-pds-radio{color:var(--pine-color-text-label-disabled);cursor:not-allowed}.has-border.sc-pds-radio-h:has(input:disabled) label.sc-pds-radio::after{cursor:not-allowed}.has-border.is-invalid.sc-pds-radio-h .pds-radio__message--error.sc-pds-radio{color:var(--pine-color-text-message-danger)}input.sc-pds-radio{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--pine-color-background-container);border:var(--pine-border);border-radius:var(--pine-border-radius-full);-ms-flex:none;flex:none;height:var(--sizing-input-size);margin:0;-webkit-margin-before:var(--pine-dimension-025);margin-block-start:var(--pine-dimension-025);position:relative;width:var(--sizing-input-size)}input.visually-hidden.sc-pds-radio{border:0;clip:rect(0 0 0 0);-webkit-clip-path:polygon(0 0, 0 0, 0 0);clip-path:polygon(0 0, 0 0, 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}input.sc-pds-radio:hover{background:var(--pine-color-background-container-hover);border:var(--pine-border-hover)}input.sc-pds-radio:checked{background:var(--pine-color-accent);border-color:var(--pine-color-accent)}input.sc-pds-radio:checked:hover{background:var(--pine-color-accent-hover);border-color:var(--pine-color-accent-hover)}input.sc-pds-radio:checked::after{background:var(--pine-color-text-primary);border-radius:var(--pine-border-radius-full);content:"";display:block;height:var(--sizing-check-size);left:50%;position:absolute;top:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);width:var(--sizing-check-size)}input.sc-pds-radio:disabled{background:var(--pine-color-background-container-disabled);border-color:var(--pine-color-border-disabled);cursor:not-allowed}input.sc-pds-radio:disabled:checked{background-color:var(--pine-color-accent-disabled);border-color:var(--pine-color-border-disabled)}input.sc-pds-radio:disabled:checked::after{border-color:var(--pine-color-border-disabled)}input.sc-pds-radio:focus-visible{outline:var(--pine-outline-focus)}label.sc-pds-radio{display:-ms-flexbox;display:flex;gap:var(--pine-dimension-xs)}label.sc-pds-radio:has(input:disabled){color:var(--pine-color-text-label-disabled);cursor:not-allowed}.sc-pds-radio-h:has(input:disabled) .pds-radio__message.sc-pds-radio{color:var(--pine-color-text-label-disabled)}.visually-hidden.sc-pds-radio{border:0;clip:rect(0 0 0 0);-webkit-clip-path:polygon(0 0, 0 0, 0 0);clip-path:polygon(0 0, 0 0, 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pds-radio__message.sc-pds-radio{color:var(--pine-color-text-message);-ms-flex-preferred-size:100%;flex-basis:100%;font:var(--pine-typography-body);-webkit-margin-start:var(--pine-dimension-md);margin-inline-start:var(--pine-dimension-md);width:100%}.pds-radio__message--error.sc-pds-radio{display:-ms-flexbox;display:flex;gap:var(--pine-dimension-2xs)}.pds-radio__message--error.sc-pds-radio pds-icon.sc-pds-radio{-webkit-margin-before:var(--pine-dimension-025);margin-block-start:var(--pine-dimension-025)}.has-image.sc-pds-radio-h{-ms-flex-align:center;align-items:center;border:var(--pine-border);border-radius:var(--pine-dimension-125);-webkit-column-gap:var(--pine-dimension-xs);-moz-column-gap:var(--pine-dimension-xs);column-gap:var(--pine-dimension-xs);display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:row;flex-direction:row;padding:var(--pine-dimension-md)}@media (max-width: 767px){.has-image.sc-pds-radio-h{-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex:1 1 100%;flex:1 1 100%;max-width:100%;min-width:0}}.has-image.sc-pds-radio-h:hover{border:var(--pine-border-hover)}.has-image.sc-pds-radio-h:has(input:checked){-webkit-box-shadow:0 0 0 2px var(--pine-color-primary-hover);box-shadow:0 0 0 2px var(--pine-color-primary-hover)}.has-image.sc-pds-radio-h label.sc-pds-radio{color:var(--pine-color-text);display:-ms-flexbox;display:flex;font-weight:var(--pine-font-weight-semi-bold);gap:var(--pine-dimension-xs)}.has-image.sc-pds-radio-h label.sc-pds-radio::after{content:"";cursor:pointer;height:100%;left:0;position:absolute;top:0;width:100%;z-index:1}.has-image.sc-pds-radio-h .pds-radio__image-container.sc-pds-radio{-ms-flex-align:center;align-items:center;align-self:center;border:var(--pine-border);border-radius:var(--pine-border-radius-full);cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex:none;flex:none;grid-area:image;-ms-flex-pack:center;justify-content:center;overflow:hidden;position:relative;-webkit-transition:all var(--pine-motion-duration-base) ease;transition:all var(--pine-motion-duration-base) ease}.has-image.sc-pds-radio-h .pds-radio__image-container.sc-pds-radio:hover{border-color:var(--pine-color-border-hover)}.has-image.sc-pds-radio-h .pds-radio__image-container.sc-pds-radio .pds-radio__image.sc-pds-radio{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.has-image.sc-pds-radio-h .pds-radio__content-wrapper.sc-pds-radio{-ms-flex:1;flex:1;min-width:0;overflow-wrap:anywhere}.has-image.sc-pds-radio-h .pds-radio__message.sc-pds-radio{grid-area:message;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-start:0;margin-inline-start:0}.has-image.is-disabled.sc-pds-radio-h{background:var(--pine-color-background-container-disabled);border-color:var(--pine-color-border-disabled);cursor:not-allowed}.has-image.is-disabled.sc-pds-radio-h .pds-radio__image-container.sc-pds-radio{border-color:var(--pine-color-border-disabled);cursor:not-allowed;opacity:0.5}.has-image.is-disabled.sc-pds-radio-h .pds-radio__image-container.sc-pds-radio:hover{border-color:var(--pine-color-border-disabled)}.has-image.is-disabled.sc-pds-radio-h label.sc-pds-radio{color:var(--pine-color-text-label-disabled);cursor:not-allowed}.has-image.is-disabled.sc-pds-radio-h label.sc-pds-radio::after{cursor:not-allowed}.has-image.is-disabled.sc-pds-radio-h .pds-radio__message.sc-pds-radio{color:var(--pine-color-text-label-disabled)}.has-image.is-invalid.sc-pds-radio-h .pds-radio__message--error.sc-pds-radio{color:var(--pine-color-text-message-danger)}`;
|
|
21465
21870
|
|
|
21466
21871
|
/**
|
|
21467
21872
|
* @slot image - Custom image content to display instead of the default radio input
|
|
@@ -21859,23 +22264,23 @@ class PdsRow {
|
|
|
21859
22264
|
}
|
|
21860
22265
|
render() {
|
|
21861
22266
|
const rowClasses = `
|
|
21862
|
-
${this.alignItems
|
|
22267
|
+
${this.alignItems != null && this.alignItems.trim() !== '' ? `pds-align-items-${this.alignItems}` : ''}
|
|
21863
22268
|
${this.border ? 'pds-row--border' : ''}
|
|
21864
|
-
${this.justifyContent
|
|
22269
|
+
${this.justifyContent != null && this.justifyContent.trim() !== '' ? `pds-justify-content-${this.justifyContent}` : ''}
|
|
21865
22270
|
${this.noWrap ? 'pds-row--no-wrap' : ''}
|
|
21866
22271
|
`;
|
|
21867
22272
|
const rowInlineStyles = Object.assign(Object.assign(Object.assign(Object.assign({}, (this.colGap && {
|
|
21868
|
-
'--row-gap-x': this.colGap
|
|
21869
|
-
'--row-gap-y': this.colGap
|
|
22273
|
+
'--row-gap-x': this.colGap != null && this.colGap.trim() !== '' ? this.colGapMap[this.colGap] : '',
|
|
22274
|
+
'--row-gap-y': this.colGap != null && this.colGap.trim() !== '' ? this.colGapMap[this.colGap] : '',
|
|
21870
22275
|
})), (this.colGapBlock && {
|
|
21871
|
-
'--row-gap-y': this.colGapBlock
|
|
22276
|
+
'--row-gap-y': this.colGapBlock != null && this.colGapBlock.trim() !== '' ? this.colGapMap[this.colGapBlock] : '',
|
|
21872
22277
|
})), (this.colGapInline && {
|
|
21873
|
-
'--row-gap-x': this.colGapInline
|
|
22278
|
+
'--row-gap-x': this.colGapInline != null && this.colGapInline.trim() !== '' ? this.colGapMap[this.colGapInline] : '',
|
|
21874
22279
|
})), (this.minHeight && {
|
|
21875
22280
|
'min-height': this.minHeight,
|
|
21876
22281
|
}));
|
|
21877
22282
|
this.hostKeeper.record(`pds-row ${rowClasses}`, rowInlineStyles);
|
|
21878
|
-
return hAsync(Host, { key: '
|
|
22283
|
+
return hAsync(Host, { key: '452882c1105868f5d392e7cb165311b1abc4a243', class: `pds-row ${rowClasses}`, style: rowInlineStyles });
|
|
21879
22284
|
}
|
|
21880
22285
|
get el() { return getElement(this); }
|
|
21881
22286
|
static get style() { return pdsRowCss(); }
|
|
@@ -25096,6 +25501,18 @@ class PdsSwitch {
|
|
|
25096
25501
|
this.checked = state === (this.value || 'on');
|
|
25097
25502
|
}
|
|
25098
25503
|
}
|
|
25504
|
+
/**
|
|
25505
|
+
* Form Associated Custom Elements API: Called when the form is disabled
|
|
25506
|
+
*/
|
|
25507
|
+
formDisabledCallback(disabled) {
|
|
25508
|
+
// Also fires when this element's own `disabled` attribute is merely present, even as the
|
|
25509
|
+
// literal string "false" (a consumer's or React's attribute serialization can write that) —
|
|
25510
|
+
// the platform treats any value as disabled, independent of fieldset state. A real disabled
|
|
25511
|
+
// fieldset ancestor confirms this is genuinely that, not this element's own attribute.
|
|
25512
|
+
if (disabled && !this.el.closest('fieldset[disabled]'))
|
|
25513
|
+
return;
|
|
25514
|
+
this.disabled = disabled;
|
|
25515
|
+
}
|
|
25099
25516
|
componentWillLoad() {
|
|
25100
25517
|
this.inheritedAttributes = Object.assign({}, inheritAriaAttributes(this.el));
|
|
25101
25518
|
this.updateHasLabelSlot();
|
|
@@ -25104,9 +25521,9 @@ class PdsSwitch {
|
|
|
25104
25521
|
const hostClass = this.switchClassNames();
|
|
25105
25522
|
const ariaDisabled = this.disabled ? 'true' : null;
|
|
25106
25523
|
this.hostKeeper.record(hostClass, {}, { 'aria-disabled': ariaDisabled });
|
|
25107
|
-
return (hAsync(Host, { key: '
|
|
25108
|
-
hAsync("div", { key: '
|
|
25109
|
-
hAsync("div", { key: '
|
|
25524
|
+
return (hAsync(Host, { key: 'b8bd2870be101081aa8a65cdee45397bc4c21435', class: hostClass, "aria-disabled": ariaDisabled }, hAsync("label", { key: '1e223f22f7fc6c576098353ad67dc11500def8b4', htmlFor: this.componentId }, hAsync("input", Object.assign({ key: 'edf59869e165a65b97465ea9de06f7ea82fbc9a6', "aria-describedby": assignDescription(this.componentId, this.invalid, this.helperMessage, this.errorMessage), "aria-invalid": this.invalid ? "true" : undefined, checked: this.checked, class: "pds-switch__input", disabled: this.disabled, id: this.componentId, name: this.name ? this.name : this.componentId, onChange: this.onSwitchUpdate, required: this.required, type: "checkbox", value: this.value }, this.inheritedAttributes)), hAsync("span", { key: '1c252b9455471069f8c6ea6c13f2e88c99308b41', class: this.hideLabel ? 'visually-hidden' : '' }, hAsync("slot", { key: 'ce0d471918bd3018f5e55d0d1e6c5c2247790f81', name: "label", onSlotchange: this.updateHasLabelSlot }), !this.hasLabelSlot && this.label)), this.helperMessage &&
|
|
25525
|
+
hAsync("div", { key: '64874b15403f1f42344715ac34febdfb8d94042a', class: `pds-switch__message`, id: messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
|
|
25526
|
+
hAsync("div", { key: '560ea486859124bb0ac2f75ab4bd34b0bca7efbc', class: `pds-switch__message pds-switch__message--error`, id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, hAsync("pds-icon", { key: 'f49caaba976579eb5588e442499595c7dba7ceff', icon: danger, size: "small" }), this.errorMessage)));
|
|
25110
25527
|
}
|
|
25111
25528
|
static get formAssociated() { return true; }
|
|
25112
25529
|
get el() { return getElement(this); }
|
|
@@ -25551,6 +25968,7 @@ class PdsTableCell {
|
|
|
25551
25968
|
this.scrollContainer = null;
|
|
25552
25969
|
this.setupRetries = 0;
|
|
25553
25970
|
this.truncationCleanup = null;
|
|
25971
|
+
this.hasLoaded = false;
|
|
25554
25972
|
/**
|
|
25555
25973
|
* Determines if the table is currently scrolling.
|
|
25556
25974
|
* @defaultValue false
|
|
@@ -25576,8 +25994,23 @@ class PdsTableCell {
|
|
|
25576
25994
|
componentWillRender() {
|
|
25577
25995
|
this.tableRef = this.hostElement.closest('pds-table');
|
|
25578
25996
|
}
|
|
25997
|
+
// Fires again each time the cell is moved (a sort re-appends every row), unlike componentDidLoad,
|
|
25998
|
+
// so it re-binds what disconnectedCallback tore down. The tooltip binds to the host, which exists before load.
|
|
25999
|
+
connectedCallback() {
|
|
26000
|
+
if (!this.hasLoaded)
|
|
26001
|
+
return;
|
|
26002
|
+
this.tableRef = this.hostElement.closest('pds-table');
|
|
26003
|
+
this.cleanupScrollListener();
|
|
26004
|
+
if (this.needsScrollShadow) {
|
|
26005
|
+
this.setupScrollListener();
|
|
26006
|
+
}
|
|
26007
|
+
if (this.truncate) {
|
|
26008
|
+
this.initTruncationTooltip();
|
|
26009
|
+
}
|
|
26010
|
+
}
|
|
25579
26011
|
componentDidLoad() {
|
|
25580
|
-
|
|
26012
|
+
this.hasLoaded = true;
|
|
26013
|
+
if (this.needsScrollShadow) {
|
|
25581
26014
|
// For responsive tables with fixed columns, set up scroll detection
|
|
25582
26015
|
// This enables the first column to show a shadow when the table is scrolled horizontally
|
|
25583
26016
|
this.setupScrollListener();
|
|
@@ -25590,6 +26023,10 @@ class PdsTableCell {
|
|
|
25590
26023
|
this.cleanupScrollListener();
|
|
25591
26024
|
this.destroyTruncationTooltip();
|
|
25592
26025
|
}
|
|
26026
|
+
get needsScrollShadow() {
|
|
26027
|
+
var _a;
|
|
26028
|
+
return Boolean(((_a = this.tableRef) === null || _a === void 0 ? void 0 : _a.responsive) && this.tableRef.fixedColumn);
|
|
26029
|
+
}
|
|
25593
26030
|
setupScrollListener() {
|
|
25594
26031
|
var _a;
|
|
25595
26032
|
if (!this.tableRef)
|
|
@@ -25668,11 +26105,11 @@ class PdsTableCell {
|
|
|
25668
26105
|
return classNames.join(' ');
|
|
25669
26106
|
}
|
|
25670
26107
|
render() {
|
|
25671
|
-
return (hAsync(Host, { key: '
|
|
26108
|
+
return (hAsync(Host, { key: 'de70a1002cc46e204f87349069b86ca43aa2129a', class: this.classNames(), role: "gridcell", part: "cell", style: this.tableRef &&
|
|
25672
26109
|
this.tableRef.fixedColumn &&
|
|
25673
26110
|
this.tableRef.selectable
|
|
25674
26111
|
? { '--fixed-cell-position': '40px' }
|
|
25675
|
-
: {} }, hAsync("slot", { key: '
|
|
26112
|
+
: {} }, hAsync("slot", { key: '5e2b3308291e480323d7a1ac0575035758fb3695' })));
|
|
25676
26113
|
}
|
|
25677
26114
|
get hostElement() { return getElement(this); }
|
|
25678
26115
|
static get watchers() { return {
|
|
@@ -26551,9 +26988,10 @@ class PdsText {
|
|
|
26551
26988
|
}
|
|
26552
26989
|
validateSize(newValue) {
|
|
26553
26990
|
// Skip when the prop is omitted or explicitly cleared (an empty string is a
|
|
26554
|
-
// common "unset" sentinel)
|
|
26991
|
+
// common "unset" sentinel), or its attribute was removed (Stencil sets the
|
|
26992
|
+
// prop to `null`). Any other unsupported value — including a
|
|
26555
26993
|
// whitespace-only string — is a developer mistake worth warning about.
|
|
26556
|
-
if (newValue
|
|
26994
|
+
if (newValue == null || newValue === '') {
|
|
26557
26995
|
return;
|
|
26558
26996
|
}
|
|
26559
26997
|
if (!TEXT_SIZES.includes(newValue)) {
|
|
@@ -26566,6 +27004,13 @@ class PdsText {
|
|
|
26566
27004
|
// any attempt to apply an unknown size class. @Watch covers later changes.
|
|
26567
27005
|
this.validateSize(this.size);
|
|
26568
27006
|
}
|
|
27007
|
+
// componentDidLoad runs once, so a moved element re-binds here what disconnectedCallback tore
|
|
27008
|
+
// down. Before the first render there's no contentEl yet, and componentDidLoad binds it.
|
|
27009
|
+
connectedCallback() {
|
|
27010
|
+
if (this.truncate && this.contentEl) {
|
|
27011
|
+
this.initTruncationTooltip();
|
|
27012
|
+
}
|
|
27013
|
+
}
|
|
26569
27014
|
componentDidLoad() {
|
|
26570
27015
|
if (this.truncate) {
|
|
26571
27016
|
this.initTruncationTooltip();
|
|
@@ -26595,23 +27040,23 @@ class PdsText {
|
|
|
26595
27040
|
const Tag = this.tag;
|
|
26596
27041
|
const typeClasses = `
|
|
26597
27042
|
pds-text
|
|
26598
|
-
${this.align
|
|
27043
|
+
${this.align != null && this.align.trim() !== ''
|
|
26599
27044
|
? `pds-text--align-${this.align}`
|
|
26600
27045
|
: ''}
|
|
26601
|
-
${this.gutter
|
|
27046
|
+
${this.gutter != null && this.gutter.trim() !== ''
|
|
26602
27047
|
? `pds-text--gutter-${this.gutter}`
|
|
26603
27048
|
: ''}
|
|
26604
|
-
${this.size
|
|
27049
|
+
${this.size != null && this.size.trim() !== ''
|
|
26605
27050
|
? `pds-text--size-${this.size}`
|
|
26606
27051
|
: ''}
|
|
26607
|
-
${this.weight
|
|
27052
|
+
${this.weight != null && this.weight.trim() !== ''
|
|
26608
27053
|
? `pds-text--weight-${this.weight}`
|
|
26609
27054
|
: ''}
|
|
26610
|
-
${this.decoration
|
|
27055
|
+
${this.decoration != null && this.decoration.trim() !== ''
|
|
26611
27056
|
? `pds-text--decoration-${this.decoration}`
|
|
26612
27057
|
: ''}
|
|
26613
27058
|
`;
|
|
26614
|
-
return (hAsync(Tag, { key: '
|
|
27059
|
+
return (hAsync(Tag, { key: '6460288f1d395080a39aec214e55cab87fdaec9f', ref: (el) => (this.contentEl = el), style: this.color && setColor(this.color), class: typeClasses, part: "content" }, hAsync("slot", { key: 'a8be0d96f72d8ee44288d7c8615155dc68d92663' })));
|
|
26615
27060
|
}
|
|
26616
27061
|
get el() { return getElement(this); }
|
|
26617
27062
|
static get watchers() { return {
|