@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
|
@@ -20,18 +20,18 @@ export class PdsBox {
|
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
22
|
const boxClasses = `
|
|
23
|
-
${this.alignItems
|
|
24
|
-
${this.alignItemsXs
|
|
25
|
-
${this.alignItemsSm
|
|
26
|
-
${this.alignItemsMd
|
|
27
|
-
${this.alignItemsLg
|
|
28
|
-
${this.alignItemsXl
|
|
29
|
-
${this.alignSelf
|
|
30
|
-
${this.alignSelfXs
|
|
31
|
-
${this.alignSelfSm
|
|
32
|
-
${this.alignSelfMd
|
|
33
|
-
${this.alignSelfLg
|
|
34
|
-
${this.alignSelfXl
|
|
23
|
+
${this.alignItems != null && this.alignItems.trim() !== '' ? `pds-align-items-${this.alignItems}` : ''}
|
|
24
|
+
${this.alignItemsXs != null && this.alignItemsXs.trim() !== '' ? `pds-align-items-xs-${this.alignItemsXs}` : ''}
|
|
25
|
+
${this.alignItemsSm != null && this.alignItemsSm.trim() !== '' ? `pds-align-items-sm-${this.alignItemsSm}` : ''}
|
|
26
|
+
${this.alignItemsMd != null && this.alignItemsMd.trim() !== '' ? `pds-align-items-md-${this.alignItemsMd}` : ''}
|
|
27
|
+
${this.alignItemsLg != null && this.alignItemsLg.trim() !== '' ? `pds-align-items-lg-${this.alignItemsLg}` : ''}
|
|
28
|
+
${this.alignItemsXl != null && this.alignItemsXl.trim() !== '' ? `pds-align-items-xl-${this.alignItemsXl}` : ''}
|
|
29
|
+
${this.alignSelf != null && this.alignSelf.trim() !== '' ? `pds-align-self-${this.alignSelf}` : ''}
|
|
30
|
+
${this.alignSelfXs != null && this.alignSelfXs.trim() !== '' ? `pds-align-self-xs-${this.alignSelfXs}` : ''}
|
|
31
|
+
${this.alignSelfSm != null && this.alignSelfSm.trim() !== '' ? `pds-align-self-sm-${this.alignSelfSm}` : ''}
|
|
32
|
+
${this.alignSelfMd != null && this.alignSelfMd.trim() !== '' ? `pds-align-self-md-${this.alignSelfMd}` : ''}
|
|
33
|
+
${this.alignSelfLg != null && this.alignSelfLg.trim() !== '' ? `pds-align-self-lg-${this.alignSelfLg}` : ''}
|
|
34
|
+
${this.alignSelfXl != null && this.alignSelfXl.trim() !== '' ? `pds-align-self-xl-${this.alignSelfXl}` : ''}
|
|
35
35
|
${this.auto ? 'pds-box--auto' : ''}
|
|
36
36
|
${this.autoXs ? 'pds-box--auto-xs' : ''}
|
|
37
37
|
${this.autoSm ? 'pds-box--auto-sm' : ''}
|
|
@@ -47,101 +47,101 @@ export class PdsBox {
|
|
|
47
47
|
${this.borderInlineStart === false ? 'pds-box--border-inline-start-none' : ''}
|
|
48
48
|
${this.borderInlineEnd === true ? 'pds-box--border-inline-end' : ''}
|
|
49
49
|
${this.borderInlineEnd === false ? 'pds-box--border-inline-end-none' : ''}
|
|
50
|
-
${this.borderRadius
|
|
51
|
-
${this.direction
|
|
52
|
-
${this.display
|
|
50
|
+
${this.borderRadius != null && this.borderRadius.trim() !== '' ? `pds-border-radius-${this.borderRadius}` : ''}
|
|
51
|
+
${this.direction != null && this.direction.trim() !== '' ? `pds-box-direction-${this.direction}` : ''}
|
|
52
|
+
${this.display != null && this.display.trim() !== '' ? `pds-box--display-${this.display}` : ''}
|
|
53
53
|
${this.fit ? 'pds-box--fit' : ''}
|
|
54
54
|
${this.fitXs ? 'pds-box--fit-xs' : ''}
|
|
55
55
|
${this.fitSm ? 'pds-box--fit-sm' : ''}
|
|
56
56
|
${this.fitMd ? 'pds-box--fit-md' : ''}
|
|
57
57
|
${this.fitLg ? 'pds-box--fit-lg' : ''}
|
|
58
58
|
${this.fitXl ? 'pds-box--fit-xl' : ''}
|
|
59
|
-
${this.gap
|
|
60
|
-
${this.gapXs
|
|
61
|
-
${this.gapSm
|
|
62
|
-
${this.gapMd
|
|
63
|
-
${this.gapLg
|
|
64
|
-
${this.gapXl
|
|
59
|
+
${this.gap != null && this.gap.trim() !== '' ? `pds-box-gap-${this.gap}` : ''}
|
|
60
|
+
${this.gapXs != null && this.gapXs.trim() !== '' ? `pds-box-gap-xs-${this.gapXs}` : ''}
|
|
61
|
+
${this.gapSm != null && this.gapSm.trim() !== '' ? `pds-box-gap-sm-${this.gapSm}` : ''}
|
|
62
|
+
${this.gapMd != null && this.gapMd.trim() !== '' ? `pds-box-gap-md-${this.gapMd}` : ''}
|
|
63
|
+
${this.gapLg != null && this.gapLg.trim() !== '' ? `pds-box-gap-lg-${this.gapLg}` : ''}
|
|
64
|
+
${this.gapXl != null && this.gapXl.trim() !== '' ? `pds-box-gap-xl-${this.gapXl}` : ''}
|
|
65
65
|
${this.wrap ? 'pds-box--wrap' : ''}
|
|
66
66
|
${this.wrapXs ? 'pds-box--wrap-xs' : ''}
|
|
67
67
|
${this.wrapSm ? 'pds-box--wrap-sm' : ''}
|
|
68
68
|
${this.wrapMd ? 'pds-box--wrap-md' : ''}
|
|
69
69
|
${this.wrapLg ? 'pds-box--wrap-lg' : ''}
|
|
70
70
|
${this.wrapXl ? 'pds-box--wrap-xl' : ''}
|
|
71
|
-
${this.flex
|
|
72
|
-
${this.justifyContent
|
|
73
|
-
${this.justifyContentXs
|
|
74
|
-
${this.justifyContentSm
|
|
75
|
-
${this.justifyContentMd
|
|
76
|
-
${this.justifyContentLg
|
|
77
|
-
${this.justifyContentXl
|
|
78
|
-
${this.marginBlockStart
|
|
79
|
-
${this.marginBlockStartXs
|
|
80
|
-
${this.marginBlockStartSm
|
|
81
|
-
${this.marginBlockStartMd
|
|
82
|
-
${this.marginBlockStartLg
|
|
83
|
-
${this.marginBlockStartXl
|
|
84
|
-
${this.marginInlineStart
|
|
85
|
-
${this.marginInlineStartXs
|
|
86
|
-
${this.marginInlineStartSm
|
|
87
|
-
${this.marginInlineStartMd
|
|
88
|
-
${this.marginInlineStartLg
|
|
89
|
-
${this.marginInlineStartXl
|
|
90
|
-
${this.marginInlineEnd
|
|
91
|
-
${this.marginInlineEndXs
|
|
92
|
-
${this.marginInlineEndSm
|
|
93
|
-
${this.marginInlineEndMd
|
|
94
|
-
${this.marginInlineEndLg
|
|
95
|
-
${this.marginInlineEndXl
|
|
96
|
-
${this.marginBlockEnd
|
|
97
|
-
${this.marginBlockEndXs
|
|
98
|
-
${this.marginBlockEndSm
|
|
99
|
-
${this.marginBlockEndMd
|
|
100
|
-
${this.marginBlockEndLg
|
|
101
|
-
${this.marginBlockEndXl
|
|
102
|
-
${this.offset
|
|
103
|
-
${this.offsetXs
|
|
104
|
-
${this.offsetSm
|
|
105
|
-
${this.offsetMd
|
|
106
|
-
${this.offsetLg
|
|
107
|
-
${this.offsetXl
|
|
108
|
-
${this.padding
|
|
109
|
-
${this.paddingXs
|
|
110
|
-
${this.paddingSm
|
|
111
|
-
${this.paddingMd
|
|
112
|
-
${this.paddingLg
|
|
113
|
-
${this.paddingXl
|
|
114
|
-
${this.paddingBlockStart
|
|
115
|
-
${this.paddingBlockStartXs
|
|
116
|
-
${this.paddingBlockStartSm
|
|
117
|
-
${this.paddingBlockStartMd
|
|
118
|
-
${this.paddingBlockStartLg
|
|
119
|
-
${this.paddingBlockStartXl
|
|
120
|
-
${this.paddingBlockEnd
|
|
121
|
-
${this.paddingBlockEndXs
|
|
122
|
-
${this.paddingBlockEndSm
|
|
123
|
-
${this.paddingBlockEndMd
|
|
124
|
-
${this.paddingBlockEndLg
|
|
125
|
-
${this.paddingBlockEndXl
|
|
126
|
-
${this.paddingInlineStart
|
|
127
|
-
${this.paddingInlineStartXs
|
|
128
|
-
${this.paddingInlineStartSm
|
|
129
|
-
${this.paddingInlineStartMd
|
|
130
|
-
${this.paddingInlineStartLg
|
|
131
|
-
${this.paddingInlineStartXl
|
|
132
|
-
${this.paddingInlineEnd
|
|
133
|
-
${this.paddingInlineEndXs
|
|
134
|
-
${this.paddingInlineEndSm
|
|
135
|
-
${this.paddingInlineEndMd
|
|
136
|
-
${this.paddingInlineEndLg
|
|
137
|
-
${this.paddingInlineEndXl
|
|
138
|
-
${this.shadow
|
|
139
|
-
${this.size
|
|
140
|
-
${this.sizeXs
|
|
141
|
-
${this.sizeSm
|
|
142
|
-
${this.sizeMd
|
|
143
|
-
${this.sizeLg
|
|
144
|
-
${this.sizeXl
|
|
71
|
+
${this.flex != null && this.flex.trim() !== '' && ['none', 'grow', 'shrink'].includes(this.flex) ? `pds-box--flex-${this.flex}` : ''}
|
|
72
|
+
${this.justifyContent != null && this.justifyContent.trim() !== '' ? `pds-justify-content-${this.justifyContent}` : ''}
|
|
73
|
+
${this.justifyContentXs != null && this.justifyContentXs.trim() !== '' ? `pds-justify-content-xs-${this.justifyContentXs}` : ''}
|
|
74
|
+
${this.justifyContentSm != null && this.justifyContentSm.trim() !== '' ? `pds-justify-content-sm-${this.justifyContentSm}` : ''}
|
|
75
|
+
${this.justifyContentMd != null && this.justifyContentMd.trim() !== '' ? `pds-justify-content-md-${this.justifyContentMd}` : ''}
|
|
76
|
+
${this.justifyContentLg != null && this.justifyContentLg.trim() !== '' ? `pds-justify-content-lg-${this.justifyContentLg}` : ''}
|
|
77
|
+
${this.justifyContentXl != null && this.justifyContentXl.trim() !== '' ? `pds-justify-content-xl-${this.justifyContentXl}` : ''}
|
|
78
|
+
${this.marginBlockStart != null && this.marginBlockStart.trim() !== '' ? `pds-margin-block-start-${this.marginBlockStart}` : ''}
|
|
79
|
+
${this.marginBlockStartXs != null && this.marginBlockStartXs.trim() !== '' ? `pds-margin-block-start-xs-${this.marginBlockStartXs}` : ''}
|
|
80
|
+
${this.marginBlockStartSm != null && this.marginBlockStartSm.trim() !== '' ? `pds-margin-block-start-sm-${this.marginBlockStartSm}` : ''}
|
|
81
|
+
${this.marginBlockStartMd != null && this.marginBlockStartMd.trim() !== '' ? `pds-margin-block-start-md-${this.marginBlockStartMd}` : ''}
|
|
82
|
+
${this.marginBlockStartLg != null && this.marginBlockStartLg.trim() !== '' ? `pds-margin-block-start-lg-${this.marginBlockStartLg}` : ''}
|
|
83
|
+
${this.marginBlockStartXl != null && this.marginBlockStartXl.trim() !== '' ? `pds-margin-block-start-xl-${this.marginBlockStartXl}` : ''}
|
|
84
|
+
${this.marginInlineStart != null && this.marginInlineStart.trim() !== '' ? `pds-margin-inline-start-${this.marginInlineStart}` : ''}
|
|
85
|
+
${this.marginInlineStartXs != null && this.marginInlineStartXs.trim() !== '' ? `pds-margin-inline-start-xs-${this.marginInlineStartXs}` : ''}
|
|
86
|
+
${this.marginInlineStartSm != null && this.marginInlineStartSm.trim() !== '' ? `pds-margin-inline-start-sm-${this.marginInlineStartSm}` : ''}
|
|
87
|
+
${this.marginInlineStartMd != null && this.marginInlineStartMd.trim() !== '' ? `pds-margin-inline-start-md-${this.marginInlineStartMd}` : ''}
|
|
88
|
+
${this.marginInlineStartLg != null && this.marginInlineStartLg.trim() !== '' ? `pds-margin-inline-start-lg-${this.marginInlineStartLg}` : ''}
|
|
89
|
+
${this.marginInlineStartXl != null && this.marginInlineStartXl.trim() !== '' ? `pds-margin-inline-start-xl-${this.marginInlineStartXl}` : ''}
|
|
90
|
+
${this.marginInlineEnd != null && this.marginInlineEnd.trim() !== '' ? `pds-margin-inline-end-${this.marginInlineEnd}` : ''}
|
|
91
|
+
${this.marginInlineEndXs != null && this.marginInlineEndXs.trim() !== '' ? `pds-margin-inline-end-xs-${this.marginInlineEndXs}` : ''}
|
|
92
|
+
${this.marginInlineEndSm != null && this.marginInlineEndSm.trim() !== '' ? `pds-margin-inline-end-sm-${this.marginInlineEndSm}` : ''}
|
|
93
|
+
${this.marginInlineEndMd != null && this.marginInlineEndMd.trim() !== '' ? `pds-margin-inline-end-md-${this.marginInlineEndMd}` : ''}
|
|
94
|
+
${this.marginInlineEndLg != null && this.marginInlineEndLg.trim() !== '' ? `pds-margin-inline-end-lg-${this.marginInlineEndLg}` : ''}
|
|
95
|
+
${this.marginInlineEndXl != null && this.marginInlineEndXl.trim() !== '' ? `pds-margin-inline-end-xl-${this.marginInlineEndXl}` : ''}
|
|
96
|
+
${this.marginBlockEnd != null && this.marginBlockEnd.trim() !== '' ? `pds-margin-block-end-${this.marginBlockEnd}` : ''}
|
|
97
|
+
${this.marginBlockEndXs != null && this.marginBlockEndXs.trim() !== '' ? `pds-margin-block-end-xs-${this.marginBlockEndXs}` : ''}
|
|
98
|
+
${this.marginBlockEndSm != null && this.marginBlockEndSm.trim() !== '' ? `pds-margin-block-end-sm-${this.marginBlockEndSm}` : ''}
|
|
99
|
+
${this.marginBlockEndMd != null && this.marginBlockEndMd.trim() !== '' ? `pds-margin-block-end-md-${this.marginBlockEndMd}` : ''}
|
|
100
|
+
${this.marginBlockEndLg != null && this.marginBlockEndLg.trim() !== '' ? `pds-margin-block-end-lg-${this.marginBlockEndLg}` : ''}
|
|
101
|
+
${this.marginBlockEndXl != null && this.marginBlockEndXl.trim() !== '' ? `pds-margin-block-end-xl-${this.marginBlockEndXl}` : ''}
|
|
102
|
+
${this.offset != null && this.offset.trim() !== '' ? `pds-box-offset-${this.offset}` : ''}
|
|
103
|
+
${this.offsetXs != null && this.offsetXs.trim() !== '' ? `pds-box-offset-xs-${this.offsetXs}` : ''}
|
|
104
|
+
${this.offsetSm != null && this.offsetSm.trim() !== '' ? `pds-box-offset-sm-${this.offsetSm}` : ''}
|
|
105
|
+
${this.offsetMd != null && this.offsetMd.trim() !== '' ? `pds-box-offset-md-${this.offsetMd}` : ''}
|
|
106
|
+
${this.offsetLg != null && this.offsetLg.trim() !== '' ? `pds-box-offset-lg-${this.offsetLg}` : ''}
|
|
107
|
+
${this.offsetXl != null && this.offsetXl.trim() !== '' ? `pds-box-offset-xl-${this.offsetXl}` : ''}
|
|
108
|
+
${this.padding != null && this.padding.trim() !== '' ? `pds-padding-${this.padding}` : ''}
|
|
109
|
+
${this.paddingXs != null && this.paddingXs.trim() !== '' ? `pds-padding-xs-${this.paddingXs}` : ''}
|
|
110
|
+
${this.paddingSm != null && this.paddingSm.trim() !== '' ? `pds-padding-sm-${this.paddingSm}` : ''}
|
|
111
|
+
${this.paddingMd != null && this.paddingMd.trim() !== '' ? `pds-padding-md-${this.paddingMd}` : ''}
|
|
112
|
+
${this.paddingLg != null && this.paddingLg.trim() !== '' ? `pds-padding-lg-${this.paddingLg}` : ''}
|
|
113
|
+
${this.paddingXl != null && this.paddingXl.trim() !== '' ? `pds-padding-xl-${this.paddingXl}` : ''}
|
|
114
|
+
${this.paddingBlockStart != null && this.paddingBlockStart.trim() !== '' ? `pds-padding-block-start-${this.paddingBlockStart}` : ''}
|
|
115
|
+
${this.paddingBlockStartXs != null && this.paddingBlockStartXs.trim() !== '' ? `pds-padding-block-start-xs-${this.paddingBlockStartXs}` : ''}
|
|
116
|
+
${this.paddingBlockStartSm != null && this.paddingBlockStartSm.trim() !== '' ? `pds-padding-block-start-sm-${this.paddingBlockStartSm}` : ''}
|
|
117
|
+
${this.paddingBlockStartMd != null && this.paddingBlockStartMd.trim() !== '' ? `pds-padding-block-start-md-${this.paddingBlockStartMd}` : ''}
|
|
118
|
+
${this.paddingBlockStartLg != null && this.paddingBlockStartLg.trim() !== '' ? `pds-padding-block-start-lg-${this.paddingBlockStartLg}` : ''}
|
|
119
|
+
${this.paddingBlockStartXl != null && this.paddingBlockStartXl.trim() !== '' ? `pds-padding-block-start-xl-${this.paddingBlockStartXl}` : ''}
|
|
120
|
+
${this.paddingBlockEnd != null && this.paddingBlockEnd.trim() !== '' ? `pds-padding-block-end-${this.paddingBlockEnd}` : ''}
|
|
121
|
+
${this.paddingBlockEndXs != null && this.paddingBlockEndXs.trim() !== '' ? `pds-padding-block-end-xs-${this.paddingBlockEndXs}` : ''}
|
|
122
|
+
${this.paddingBlockEndSm != null && this.paddingBlockEndSm.trim() !== '' ? `pds-padding-block-end-sm-${this.paddingBlockEndSm}` : ''}
|
|
123
|
+
${this.paddingBlockEndMd != null && this.paddingBlockEndMd.trim() !== '' ? `pds-padding-block-end-md-${this.paddingBlockEndMd}` : ''}
|
|
124
|
+
${this.paddingBlockEndLg != null && this.paddingBlockEndLg.trim() !== '' ? `pds-padding-block-end-lg-${this.paddingBlockEndLg}` : ''}
|
|
125
|
+
${this.paddingBlockEndXl != null && this.paddingBlockEndXl.trim() !== '' ? `pds-padding-block-end-xl-${this.paddingBlockEndXl}` : ''}
|
|
126
|
+
${this.paddingInlineStart != null && this.paddingInlineStart.trim() !== '' ? `pds-padding-inline-start-${this.paddingInlineStart}` : ''}
|
|
127
|
+
${this.paddingInlineStartXs != null && this.paddingInlineStartXs.trim() !== '' ? `pds-padding-inline-start-xs-${this.paddingInlineStartXs}` : ''}
|
|
128
|
+
${this.paddingInlineStartSm != null && this.paddingInlineStartSm.trim() !== '' ? `pds-padding-inline-start-sm-${this.paddingInlineStartSm}` : ''}
|
|
129
|
+
${this.paddingInlineStartMd != null && this.paddingInlineStartMd.trim() !== '' ? `pds-padding-inline-start-md-${this.paddingInlineStartMd}` : ''}
|
|
130
|
+
${this.paddingInlineStartLg != null && this.paddingInlineStartLg.trim() !== '' ? `pds-padding-inline-start-lg-${this.paddingInlineStartLg}` : ''}
|
|
131
|
+
${this.paddingInlineStartXl != null && this.paddingInlineStartXl.trim() !== '' ? `pds-padding-inline-start-xl-${this.paddingInlineStartXl}` : ''}
|
|
132
|
+
${this.paddingInlineEnd != null && this.paddingInlineEnd.trim() !== '' ? `pds-padding-inline-end-${this.paddingInlineEnd}` : ''}
|
|
133
|
+
${this.paddingInlineEndXs != null && this.paddingInlineEndXs.trim() !== '' ? `pds-padding-inline-end-xs-${this.paddingInlineEndXs}` : ''}
|
|
134
|
+
${this.paddingInlineEndSm != null && this.paddingInlineEndSm.trim() !== '' ? `pds-padding-inline-end-sm-${this.paddingInlineEndSm}` : ''}
|
|
135
|
+
${this.paddingInlineEndMd != null && this.paddingInlineEndMd.trim() !== '' ? `pds-padding-inline-end-md-${this.paddingInlineEndMd}` : ''}
|
|
136
|
+
${this.paddingInlineEndLg != null && this.paddingInlineEndLg.trim() !== '' ? `pds-padding-inline-end-lg-${this.paddingInlineEndLg}` : ''}
|
|
137
|
+
${this.paddingInlineEndXl != null && this.paddingInlineEndXl.trim() !== '' ? `pds-padding-inline-end-xl-${this.paddingInlineEndXl}` : ''}
|
|
138
|
+
${this.shadow != null && this.shadow.trim() !== '' ? `pds-shadow-${this.shadow}` : ''}
|
|
139
|
+
${this.size != null && this.size.trim() !== '' ? `pds-box pds-box-${this.size}` : ''}
|
|
140
|
+
${this.sizeXs != null && this.sizeXs.trim() !== '' ? `pds-box-xs-${this.sizeXs}` : ''}
|
|
141
|
+
${this.sizeSm != null && this.sizeSm.trim() !== '' ? `pds-box-sm-${this.sizeSm}` : ''}
|
|
142
|
+
${this.sizeMd != null && this.sizeMd.trim() !== '' ? `pds-box-md-${this.sizeMd}` : ''}
|
|
143
|
+
${this.sizeLg != null && this.sizeLg.trim() !== '' ? `pds-box-lg-${this.sizeLg}` : ''}
|
|
144
|
+
${this.sizeXl != null && this.sizeXl.trim() !== '' ? `pds-box-xl-${this.sizeXl}` : ''}
|
|
145
145
|
${this.size == undefined &&
|
|
146
146
|
this.sizeSm == undefined &&
|
|
147
147
|
this.sizeMd == undefined &&
|
|
@@ -153,7 +153,7 @@ export class PdsBox {
|
|
|
153
153
|
const normalizedBorder = normalizeColorValue(this.borderColor);
|
|
154
154
|
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 }));
|
|
155
155
|
this.hostKeeper.record(boxClasses, boxInlineStyles);
|
|
156
|
-
return (h(Host, { key: '
|
|
156
|
+
return (h(Host, { key: '8a1348247b5a4c546759232f0f155721798797e5', class: boxClasses, style: boxInlineStyles }));
|
|
157
157
|
}
|
|
158
158
|
static get is() { return "pds-box"; }
|
|
159
159
|
static get originalStyleUrls() {
|
|
@@ -97,6 +97,18 @@ export class PdsCheckbox {
|
|
|
97
97
|
this.checked = state === (this.value || 'on');
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Form Associated Custom Elements API: Called when the form is disabled
|
|
102
|
+
*/
|
|
103
|
+
formDisabledCallback(disabled) {
|
|
104
|
+
// Also fires when this element's own `disabled` attribute is merely present, even as the
|
|
105
|
+
// literal string "false" (a consumer's or React's attribute serialization can write that) —
|
|
106
|
+
// the platform treats any value as disabled, independent of fieldset state. A real disabled
|
|
107
|
+
// fieldset ancestor confirms this is genuinely that, not this element's own attribute.
|
|
108
|
+
if (disabled && !this.el.closest('fieldset[disabled]'))
|
|
109
|
+
return;
|
|
110
|
+
this.disabled = disabled;
|
|
111
|
+
}
|
|
100
112
|
componentWillLoad() {
|
|
101
113
|
this.inheritedAttributes = Object.assign({}, inheritAriaAttributes(this.el));
|
|
102
114
|
this.updateHasLabelSlot();
|
|
@@ -104,9 +116,9 @@ export class PdsCheckbox {
|
|
|
104
116
|
render() {
|
|
105
117
|
const hostClass = this.classNames();
|
|
106
118
|
this.hostKeeper.record(hostClass);
|
|
107
|
-
return (h(Host, { key: '
|
|
108
|
-
h("div", { key: '
|
|
109
|
-
h("div", { key: '
|
|
119
|
+
return (h(Host, { key: 'bbe09a5e9eb55f62b2921b09a04ddc9476a871ae', class: hostClass }, h("label", { key: 'fa1856d9306eb8c0c19618ea5e2619ea20c3c51d', htmlFor: this.componentId }, h("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)), h("span", { key: 'e523922889c80a2d18243cb560cd855bab95803d', class: this.hideLabel ? 'visually-hidden' : '' }, h("slot", { key: 'b6ff34ecbc346d254a0211bfa610823feedb486b', name: "label", onSlotchange: this.updateHasLabelSlot }), !this.hasLabelSlot && this.label)), this.helperMessage &&
|
|
120
|
+
h("div", { key: '55dcca850dff0aa93d9ba63d6827d9155ac35dab', class: 'pds-checkbox__message', id: messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
|
|
121
|
+
h("div", { key: '5af843679994d29f084d41e90e41e0939c951063', class: `pds-checkbox__message pds-checkbox__message--error`, id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, h("pds-icon", { key: '10f7efe5d4b252d9dea6f398eff973ba32506898', icon: danger, size: "small" }), this.errorMessage)));
|
|
110
122
|
}
|
|
111
123
|
static get is() { return "pds-checkbox"; }
|
|
112
124
|
static get encapsulation() { return "shadow"; }
|
|
@@ -13,6 +13,26 @@ const SENTIMENT_DOT_COLORS = {
|
|
|
13
13
|
success: 'var(--pine-chip-color-success-dot)',
|
|
14
14
|
warning: 'var(--pine-chip-color-warning-dot)',
|
|
15
15
|
};
|
|
16
|
+
// Controls a chip can sit inside that already take focus, so a clipped label adds no tab stop of its own.
|
|
17
|
+
// Not any `[tabindex]`: a focusable scroll region full of chips would show every chip's tooltip at once.
|
|
18
|
+
const FOCUSABLE_WRAPPER = 'a[href], button, summary, pds-button, pds-link, pds-tab, pds-dropdown-menu-item, [role="option"]';
|
|
19
|
+
// Beside the listbox and level with the option, so the tooltip never covers the other options.
|
|
20
|
+
function besideListbox(wrapper) {
|
|
21
|
+
const option = (wrapper === null || wrapper === void 0 ? void 0 : wrapper.matches('[role="option"]')) ? wrapper : null;
|
|
22
|
+
const listbox = option === null || option === void 0 ? void 0 : option.closest('[role="listbox"]');
|
|
23
|
+
if (!option || !listbox)
|
|
24
|
+
return {};
|
|
25
|
+
return {
|
|
26
|
+
placement: 'right',
|
|
27
|
+
reference: {
|
|
28
|
+
getBoundingClientRect: () => {
|
|
29
|
+
const { top, bottom, height } = option.getBoundingClientRect();
|
|
30
|
+
const { left, right, width } = listbox.getBoundingClientRect();
|
|
31
|
+
return { x: left, y: top, top, left, bottom, right, width, height };
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
16
36
|
/**
|
|
17
37
|
* @slot (default) - The chip's label text.
|
|
18
38
|
* @part button
|
|
@@ -51,6 +71,11 @@ export class PdsChip {
|
|
|
51
71
|
}
|
|
52
72
|
connectedCallback() {
|
|
53
73
|
this.hostKeeper.connect(this.el);
|
|
74
|
+
// A moved chip reconnects without re-rendering, so componentDidRender won't re-bind what
|
|
75
|
+
// disconnectedCallback tore down. Before the first render there's no label, and it binds there.
|
|
76
|
+
if (this.maxWidth && this.labelTextEl) {
|
|
77
|
+
this.initTruncationTooltip();
|
|
78
|
+
}
|
|
54
79
|
}
|
|
55
80
|
// Bind (and re-bind) here, not just on load: changing variant/size remounts
|
|
56
81
|
// the label span, so the tooltip has to re-attach to the current node or it
|
|
@@ -75,16 +100,15 @@ export class PdsChip {
|
|
|
75
100
|
initTruncationTooltip() {
|
|
76
101
|
this.destroyTruncationTooltip();
|
|
77
102
|
if (this.labelTextEl) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
contentEl: this.labelTextEl,
|
|
81
|
-
getTooltipText: () => this.el.textContent || '',
|
|
103
|
+
const wrapper = this.el.closest(FOCUSABLE_WRAPPER);
|
|
104
|
+
this.truncationCleanup = setupTruncationTooltip(Object.assign({ hostEl: this.el, contentEl: this.labelTextEl, getTooltipText: () => this.el.textContent || '',
|
|
82
105
|
// The dropdown variant's label span already sits inside
|
|
83
106
|
// `<button class="pds-chip__button">`, which is already focusable and
|
|
84
107
|
// bubbles focusin to the host — a tabindex on the span too would nest
|
|
85
108
|
// a second tab stop inside the button.
|
|
86
|
-
manageTabIndex: this.effectiveVariant !== 'dropdown',
|
|
87
|
-
|
|
109
|
+
manageTabIndex: this.effectiveVariant !== 'dropdown' && !wrapper,
|
|
110
|
+
// A wrapping control sits outside the host, so its focus never reaches the host's listener.
|
|
111
|
+
focusEl: wrapper !== null && wrapper !== void 0 ? wrapper : this.el }, besideListbox(wrapper)));
|
|
88
112
|
this.tooltipBoundEl = this.labelTextEl;
|
|
89
113
|
}
|
|
90
114
|
}
|
|
@@ -141,7 +165,8 @@ export class PdsChip {
|
|
|
141
165
|
// label span already sits inside `<button class="pds-chip__button">`,
|
|
142
166
|
// which is already focusable and bubbles focusin to the host, so
|
|
143
167
|
// initTruncationTooltip passes `manageTabIndex: false` there to avoid
|
|
144
|
-
// nesting a second tab stop inside the button.
|
|
168
|
+
// nesting a second tab stop inside the button. The same goes for a chip
|
|
169
|
+
// inside a consumer's own focusable control (FOCUSABLE_WRAPPER).
|
|
145
170
|
const chipContent = isDropdown ? (h("button", { class: "pds-chip__button", type: "button", part: "button" }, this.icon && h("pds-icon", { class: "pds-chip__icon", part: "icon", icon: this.icon, size: this.iconSize, "aria-hidden": "true" }), showDot && h("i", { class: "pds-chip__dot", part: "dot", "aria-hidden": "true" }), h("span", { class: "pds-chip__label-text", ref: (el) => (this.labelTextEl = el) }, h("slot", null)), h("pds-icon", { icon: downSmall, size: this.iconSize, "aria-hidden": "true" }))) : (h("span", { class: "pds-chip__label" }, this.icon && h("pds-icon", { class: "pds-chip__icon", part: "icon", icon: this.icon, size: this.iconSize, "aria-hidden": "true" }), showDot && h("i", { class: "pds-chip__dot", part: "dot", "aria-hidden": "true" }), h("span", { class: "pds-chip__label-text", ref: (el) => (this.labelTextEl = el) }, h("slot", null))));
|
|
146
171
|
return chipContent;
|
|
147
172
|
}
|
|
@@ -215,7 +240,7 @@ export class PdsChip {
|
|
|
215
240
|
const hostClass = this.classNames();
|
|
216
241
|
const hostStyles = this.hostStyles;
|
|
217
242
|
this.hostKeeper.record(hostClass, hostStyles);
|
|
218
|
-
return (h(Host, { key: '
|
|
243
|
+
return (h(Host, { key: 'f82d84a7f0a4f1c980d47bf75cd4ffeef042607d', class: hostClass, id: this.componentId, style: hostStyles }, this.setChipContent(), this.effectiveVariant === 'tag' && this.renderCloseButton()));
|
|
219
244
|
}
|
|
220
245
|
static get is() { return "pds-chip"; }
|
|
221
246
|
static get encapsulation() { return "shadow"; }
|
|
@@ -200,3 +200,20 @@ TruncatedLabel.args = {
|
|
|
200
200
|
variant: "tag",
|
|
201
201
|
maxWidth: "200px",
|
|
202
202
|
}
|
|
203
|
+
|
|
204
|
+
const InButtonTemplate = (args) => html`
|
|
205
|
+
<pds-button variant="unstyled">
|
|
206
|
+
<pds-chip
|
|
207
|
+
sentiment="${args.sentiment}"
|
|
208
|
+
variant="${args.variant}"
|
|
209
|
+
max-width="${args.maxWidth}"
|
|
210
|
+
>${args.slot}</pds-chip>
|
|
211
|
+
</pds-button>`;
|
|
212
|
+
|
|
213
|
+
export const TruncatedLabelInButton = InButtonTemplate.bind();
|
|
214
|
+
TruncatedLabelInButton.args = {
|
|
215
|
+
sentiment: "neutral",
|
|
216
|
+
slot: "A very long label that would otherwise overflow the chip",
|
|
217
|
+
variant: "text",
|
|
218
|
+
maxWidth: "200px",
|
|
219
|
+
}
|
|
@@ -487,6 +487,9 @@ export class PdsCombobox {
|
|
|
487
487
|
};
|
|
488
488
|
// Handler for button trigger click
|
|
489
489
|
this.onButtonTriggerClick = () => {
|
|
490
|
+
// The button and chip triggers are divs, so a click reaches them even while disabled.
|
|
491
|
+
if (this.disabled)
|
|
492
|
+
return;
|
|
490
493
|
this.isOpen = !this.isOpen;
|
|
491
494
|
if (this.isOpen) {
|
|
492
495
|
this.prepareExpandFilterListOnOpen();
|
|
@@ -506,6 +509,13 @@ export class PdsCombobox {
|
|
|
506
509
|
};
|
|
507
510
|
// Handler for button trigger keyboard events
|
|
508
511
|
this.onButtonTriggerKeyDown = (e) => {
|
|
512
|
+
// Disabled takes it out of the tab order, but setFocus() or a click can still focus it.
|
|
513
|
+
if (this.disabled) {
|
|
514
|
+
// Keep Space from scrolling the page, as on a native disabled button.
|
|
515
|
+
if (e.key === ' ')
|
|
516
|
+
e.preventDefault();
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
509
519
|
// Escape closes an open group before the dropdown. Other keys reach the tree through handleKeyDown.
|
|
510
520
|
if (this.isOpen && e.key === 'Escape' && this.handleGroupedPanelKey(e))
|
|
511
521
|
return;
|
|
@@ -526,8 +536,9 @@ export class PdsCombobox {
|
|
|
526
536
|
}, 0);
|
|
527
537
|
}
|
|
528
538
|
else if (e.key === 'Escape') {
|
|
529
|
-
|
|
539
|
+
// Only an open dropdown claims Escape; a closed one leaves it to a modal or popover around it.
|
|
530
540
|
if (this.isOpen) {
|
|
541
|
+
e.preventDefault();
|
|
531
542
|
this.isOpen = false;
|
|
532
543
|
this.highlightedIndex = -1;
|
|
533
544
|
this.clearExpandFilterList();
|
|
@@ -638,6 +649,18 @@ export class PdsCombobox {
|
|
|
638
649
|
this.internals = this.el.attachInternals();
|
|
639
650
|
}
|
|
640
651
|
}
|
|
652
|
+
/**
|
|
653
|
+
* Form Associated Custom Elements API: Called when the form is disabled
|
|
654
|
+
*/
|
|
655
|
+
formDisabledCallback(disabled) {
|
|
656
|
+
// Also fires when this element's own `disabled` attribute is merely present, even as the
|
|
657
|
+
// literal string "false" (a consumer's or React's attribute serialization can write that) —
|
|
658
|
+
// the platform treats any value as disabled, independent of fieldset state. A real disabled
|
|
659
|
+
// fieldset ancestor confirms this is genuinely that, not this element's own attribute.
|
|
660
|
+
if (disabled && !this.el.closest('fieldset[disabled]'))
|
|
661
|
+
return;
|
|
662
|
+
this.disabled = disabled;
|
|
663
|
+
}
|
|
641
664
|
componentWillLoad() {
|
|
642
665
|
this.originalSearchEmitter = this.pdsComboboxSearch;
|
|
643
666
|
this.updateOptions();
|
|
@@ -772,6 +795,22 @@ export class PdsCombobox {
|
|
|
772
795
|
if (this.isOpen && this.hidesPanelSearch && this.panelTreeEl)
|
|
773
796
|
this.focusPanel(this.panelTreeEl);
|
|
774
797
|
}
|
|
798
|
+
disabledChanged(disabled) {
|
|
799
|
+
var _a, _b, _c, _d, _e;
|
|
800
|
+
if (!disabled || !this.isOpen)
|
|
801
|
+
return;
|
|
802
|
+
const shadowActive = (_b = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.activeElement) !== null && _b !== void 0 ? _b : null;
|
|
803
|
+
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)));
|
|
804
|
+
this.isOpen = false;
|
|
805
|
+
this.highlightedIndex = -1;
|
|
806
|
+
this.isArrowKeyNavigationMode = false;
|
|
807
|
+
this.clearExpandFilterList();
|
|
808
|
+
this.updateAriaActiveDescendant();
|
|
809
|
+
// Closing removes the search field or option that held focus. A button or chip trigger can still
|
|
810
|
+
// take it (aria-disabled), so focus doesn't fall to the page; a disabled input can't, as natively.
|
|
811
|
+
if (focusInDropdown && this.trigger !== 'input')
|
|
812
|
+
this.restoreFocusToTrigger();
|
|
813
|
+
}
|
|
775
814
|
isOpenChanged(isOpen) {
|
|
776
815
|
if (!isOpen) {
|
|
777
816
|
this.revealedGroupLabel = null;
|
|
@@ -1910,7 +1949,8 @@ export class PdsCombobox {
|
|
|
1910
1949
|
return this.selectedOption ? this.selectedOption.value : null;
|
|
1911
1950
|
}
|
|
1912
1951
|
/**
|
|
1913
|
-
* Clears the selected value and resets the component.
|
|
1952
|
+
* Clears the selected value and resets the component. Works while disabled too, as setting a
|
|
1953
|
+
* native control's value from script does.
|
|
1914
1954
|
*/
|
|
1915
1955
|
async clear() {
|
|
1916
1956
|
const hadValue = this.value !== '' || this.displayText !== '';
|
|
@@ -2487,13 +2527,13 @@ export class PdsCombobox {
|
|
|
2487
2527
|
]
|
|
2488
2528
|
.filter(Boolean)
|
|
2489
2529
|
.join(' ');
|
|
2490
|
-
return (h(Host, { key: '
|
|
2530
|
+
return (h(Host, { key: 'ead770a3b7ba531a1cfdc6b02aef6d7159481ed0', "aria-disabled": this.disabled ? 'true' : null }, h("div", { key: '3ca6fd299acd1db8a0e476eee5f7606bc6153625', class: "pds-combobox", tabIndex: -1, onFocusout: this.onComboboxFocusOut, part: "combobox" }, this.hasVisibleLabel && (h("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' ? (h("div", { class: "pds-combobox__input-wrapper", style: { width: this.triggerWidth } }, h("input", { ref: el => {
|
|
2491
2531
|
this.inputEl = el;
|
|
2492
2532
|
this.triggerEl = el;
|
|
2493
2533
|
}, class: {
|
|
2494
2534
|
'pds-combobox__input': true,
|
|
2495
2535
|
'pds-combobox__input--invalid': this.isInvalid(),
|
|
2496
|
-
}, type: "text", role: "combobox", "aria-autocomplete": "list", "aria-haspopup": this.inputPopupRole === 'tree' ? 'tree' : undefined, "aria-controls": this.listboxId, "aria-describedby": assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-activedescendant": this.usesPanelSearch ? undefined : this.activeDescendantId, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.hideLabel ? this.label : undefined, id: this.componentId, value: this.displayText, placeholder: this.placeholder, disabled: this.disabled, onInput: this.handleInput, onClick: this.handleInputClick, onKeyDown: this.handleKeyDown, autocomplete: "off", part: "input" }), h("pds-icon", { icon: "enlarge", "aria-hidden": "true", class: "pds-combobox__input-icon" }))) : this.trigger === 'chip' ? (h("div", { class: this.getChipTriggerClass(), style: { width: this.triggerWidth }, role: this.usesPanelSearch ? 'button' : 'combobox', "aria-haspopup": this.triggerPopupRole, "aria-controls": this.listboxId, "aria-describedby": assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-activedescendant": this.usesPanelSearch ? undefined : this.activeDescendantId, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.triggerAriaLabel, "aria-labelledby": this.triggerLabelledBy, id: this.componentId, tabIndex: this.disabled ? -1 : 0, onClick: this.onButtonTriggerClick, "data-layout": this.customTriggerContent, onKeyDown: this.onButtonTriggerKeyDown, onKeyUp: this.onButtonTriggerKeyUp, ref: el => (this.triggerEl = el), part: "chip-trigger" }, this.renderChipTriggerContent())) : (h("div", { class: triggerClass, style: { width: this.triggerWidth }, role: this.usesPanelSearch ? 'button' : 'combobox', "aria-haspopup": this.triggerPopupRole, "aria-controls": this.listboxId, "aria-describedby": assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-activedescendant": this.usesPanelSearch ? undefined : this.activeDescendantId, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.triggerAriaLabel, "aria-labelledby": this.triggerLabelledBy, id: this.componentId, tabIndex: this.disabled ? -1 : 0, onClick: this.onButtonTriggerClick, "data-layout": this.customTriggerContent, onKeyDown: this.onButtonTriggerKeyDown, onKeyUp: this.onButtonTriggerKeyUp, ref: el => (this.triggerEl = el), part: "button-trigger" }, this.renderButtonTriggerContent())), this.renderMessages(), h("div", { key: '
|
|
2536
|
+
}, type: "text", role: "combobox", "aria-autocomplete": "list", "aria-haspopup": this.inputPopupRole === 'tree' ? 'tree' : undefined, "aria-controls": this.listboxId, "aria-describedby": assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-activedescendant": this.usesPanelSearch ? undefined : this.activeDescendantId, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.hideLabel ? this.label : undefined, id: this.componentId, value: this.displayText, placeholder: this.placeholder, disabled: this.disabled, onInput: this.handleInput, onClick: this.handleInputClick, onKeyDown: this.handleKeyDown, autocomplete: "off", part: "input" }), h("pds-icon", { icon: "enlarge", "aria-hidden": "true", class: "pds-combobox__input-icon" }))) : this.trigger === 'chip' ? (h("div", { class: this.getChipTriggerClass(), style: { width: this.triggerWidth }, role: this.usesPanelSearch ? 'button' : 'combobox', "aria-haspopup": this.triggerPopupRole, "aria-controls": this.listboxId, "aria-describedby": assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-activedescendant": this.usesPanelSearch ? undefined : this.activeDescendantId, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.triggerAriaLabel, "aria-labelledby": this.triggerLabelledBy, id: this.componentId, tabIndex: this.disabled ? -1 : 0, onClick: this.onButtonTriggerClick, "data-layout": this.customTriggerContent, onKeyDown: this.onButtonTriggerKeyDown, onKeyUp: this.onButtonTriggerKeyUp, ref: el => (this.triggerEl = el), part: "chip-trigger" }, this.renderChipTriggerContent())) : (h("div", { class: triggerClass, style: { width: this.triggerWidth }, role: this.usesPanelSearch ? 'button' : 'combobox', "aria-haspopup": this.triggerPopupRole, "aria-controls": this.listboxId, "aria-describedby": assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-activedescendant": this.usesPanelSearch ? undefined : this.activeDescendantId, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.triggerAriaLabel, "aria-labelledby": this.triggerLabelledBy, id: this.componentId, tabIndex: this.disabled ? -1 : 0, onClick: this.onButtonTriggerClick, "data-layout": this.customTriggerContent, onKeyDown: this.onButtonTriggerKeyDown, onKeyUp: this.onButtonTriggerKeyUp, ref: el => (this.triggerEl = el), part: "button-trigger" }, this.renderButtonTriggerContent())), this.renderMessages(), h("div", { key: '349af9dc6fdae018d4443b178e21b1627fcc85ca', style: { display: 'none' } }, h("slot", { key: '9af42db6d08f148b7d7b5e4b3199f7c9af7699a4', onSlotchange: () => this.updateOptions() })), this.renderDropdown(), this.groupDisplay !== 'inline' && [
|
|
2497
2537
|
h("span", { key: "drill-status", class: "visually-hidden", role: "status", "aria-live": "polite" }, this.isOpen && this.effectiveGroupDisplay === 'drill-in' && this.openGroup !== null ? this.openGroup.label : ''),
|
|
2498
2538
|
// Its own region: sharing one, revealing a row then opening it would leave the text the
|
|
2499
2539
|
// same, and opening the group would go unannounced.
|
|
@@ -3518,7 +3558,7 @@ export class PdsCombobox {
|
|
|
3518
3558
|
"return": "Promise<void>"
|
|
3519
3559
|
},
|
|
3520
3560
|
"docs": {
|
|
3521
|
-
"text": "Clears the selected value and resets the component.",
|
|
3561
|
+
"text": "Clears the selected value and resets the component. Works while disabled too, as setting a\nnative control's value from script does.",
|
|
3522
3562
|
"tags": []
|
|
3523
3563
|
}
|
|
3524
3564
|
}
|
|
@@ -3535,6 +3575,9 @@ export class PdsCombobox {
|
|
|
3535
3575
|
}, {
|
|
3536
3576
|
"propName": "flyoutFallback",
|
|
3537
3577
|
"methodName": "flyoutFallbackChanged"
|
|
3578
|
+
}, {
|
|
3579
|
+
"propName": "disabled",
|
|
3580
|
+
"methodName": "disabledChanged"
|
|
3538
3581
|
}, {
|
|
3539
3582
|
"propName": "isOpen",
|
|
3540
3583
|
"methodName": "isOpenChanged"
|
|
@@ -40,7 +40,7 @@ const BaseTemplate = (args) => html`
|
|
|
40
40
|
name=${args.name}
|
|
41
41
|
custom-option-layouts=${args.customOptionLayouts}
|
|
42
42
|
custom-trigger-content=${args.customTriggerContent}
|
|
43
|
-
disabled=${args.disabled}
|
|
43
|
+
?disabled=${args.disabled}
|
|
44
44
|
dropdown-placement=${args.dropdownPlacement}
|
|
45
45
|
dropdown-mount=${args.dropdownMount}
|
|
46
46
|
dropdown-width=${args.dropdownWidth}
|
|
@@ -40,6 +40,11 @@ export class PdsCopytext {
|
|
|
40
40
|
}
|
|
41
41
|
connectedCallback() {
|
|
42
42
|
this.hostKeeper.connect(this.el);
|
|
43
|
+
// componentDidLoad runs once, so a moved element re-binds here what disconnectedCallback tore
|
|
44
|
+
// down. Before the first render there's no valueSpanEl yet, and componentDidLoad binds it.
|
|
45
|
+
if (this.truncate && this.valueSpanEl) {
|
|
46
|
+
this.initTruncationTooltip();
|
|
47
|
+
}
|
|
43
48
|
}
|
|
44
49
|
restoreBorderDefault(newValue) {
|
|
45
50
|
this.border = restoreReflectedDefault(this.el, 'border', newValue, true);
|
|
@@ -102,7 +107,7 @@ export class PdsCopytext {
|
|
|
102
107
|
render() {
|
|
103
108
|
const hostClass = this.classNames();
|
|
104
109
|
this.hostKeeper.record(hostClass);
|
|
105
|
-
return (h(Host, { key: '
|
|
110
|
+
return (h(Host, { key: 'a3517b135fc3e3677e30b6ad5811c1170a819b65', class: hostClass, id: this.componentId }, h("pds-button", { key: '02f56bed02ed3963a3d80a92148d6619a845224a', type: "button", variant: "unstyled", onClick: this.handleClick }, h("span", { key: '95fd1284e3d227b74dab613eb71f5385c3a0be29', ref: (el) => this.valueSpanEl = el }, this.value), h("pds-icon", { key: '21af67a8c9165e56d2d2b0cf19df7c7e3f290c72', "aria-hidden": "true", icon: copyIcon, size: "16px" }))));
|
|
106
111
|
}
|
|
107
112
|
static get is() { return "pds-copytext"; }
|
|
108
113
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
.pds-drawer__modal > .pds-modal__backdrop {
|
|
2
2
|
align-items: stretch;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.pds-drawer__modal:not(.pds-drawer__modal--modal) > .pds-modal__backdrop {
|
|
3
6
|
background-color: transparent;
|
|
4
7
|
pointer-events: none;
|
|
5
8
|
}
|
|
6
9
|
@supports (backdrop-filter: blur(3px)) {
|
|
7
|
-
.pds-drawer__modal > .pds-modal__backdrop {
|
|
10
|
+
.pds-drawer__modal:not(.pds-drawer__modal--modal) > .pds-modal__backdrop {
|
|
8
11
|
backdrop-filter: none;
|
|
9
12
|
}
|
|
10
13
|
}
|