@patternfly/elements 3.0.1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +8857 -8783
- package/form-control.css +127 -0
- package/package.json +12 -25
- package/pf-accordion/pf-accordion-header.css +23 -0
- package/pf-accordion/pf-accordion-header.d.ts +52 -43
- package/pf-accordion/pf-accordion-header.js +130 -87
- package/pf-accordion/pf-accordion-header.js.map +1 -1
- package/pf-accordion/pf-accordion-panel.css +15 -0
- package/pf-accordion/pf-accordion-panel.d.ts +27 -25
- package/pf-accordion/pf-accordion-panel.js +29 -43
- package/pf-accordion/pf-accordion-panel.js.map +1 -1
- package/pf-accordion/pf-accordion.d.ts +122 -65
- package/pf-accordion/pf-accordion.js +283 -94
- package/pf-accordion/pf-accordion.js.map +1 -1
- package/pf-accordion/test/pf-accordion.e2e.js +12 -0
- package/pf-accordion/test/pf-accordion.e2e.js.map +1 -1
- package/pf-accordion/test/pf-accordion.spec.js +366 -350
- package/pf-accordion/test/pf-accordion.spec.js.map +1 -1
- package/pf-avatar/pf-avatar.css +50 -24
- package/pf-avatar/pf-avatar.d.ts +29 -3
- package/pf-avatar/pf-avatar.js +51 -9
- package/pf-avatar/pf-avatar.js.map +1 -1
- package/pf-avatar/test/pf-avatar.e2e.js +12 -0
- package/pf-avatar/test/pf-avatar.e2e.js.map +1 -1
- package/pf-avatar/test/pf-avatar.spec.js +2 -3
- package/pf-avatar/test/pf-avatar.spec.js.map +1 -1
- package/pf-back-to-top/pf-back-to-top.css +10 -0
- package/pf-back-to-top/pf-back-to-top.d.ts +14 -18
- package/pf-back-to-top/pf-back-to-top.js +9 -30
- package/pf-back-to-top/pf-back-to-top.js.map +1 -1
- package/pf-back-to-top/test/pf-back-to-top.e2e.js +12 -0
- package/pf-back-to-top/test/pf-back-to-top.e2e.js.map +1 -1
- package/pf-background-image/pf-background-image.d.ts +4 -4
- package/pf-background-image/pf-background-image.js +1 -12
- package/pf-background-image/pf-background-image.js.map +1 -1
- package/pf-background-image/test/pf-background-image.e2e.js +12 -0
- package/pf-background-image/test/pf-background-image.e2e.js.map +1 -1
- package/pf-badge/pf-badge.css +4 -0
- package/pf-badge/pf-badge.d.ts +26 -22
- package/pf-badge/pf-badge.js +14 -27
- package/pf-badge/pf-badge.js.map +1 -1
- package/pf-badge/test/pf-badge.e2e.js +12 -0
- package/pf-badge/test/pf-badge.e2e.js.map +1 -1
- package/pf-banner/pf-banner.d.ts +16 -16
- package/pf-banner/pf-banner.js +1 -24
- package/pf-banner/pf-banner.js.map +1 -1
- package/pf-banner/test/pf-banner.e2e.js +12 -0
- package/pf-banner/test/pf-banner.e2e.js.map +1 -1
- package/pf-button/pf-button.css +22 -12
- package/pf-button/pf-button.d.ts +128 -122
- package/pf-button/pf-button.js +95 -172
- package/pf-button/pf-button.js.map +1 -1
- package/pf-button/test/pf-button.e2e.js +12 -0
- package/pf-button/test/pf-button.e2e.js.map +1 -1
- package/pf-card/pf-card.css +172 -43
- package/pf-card/pf-card.d.ts +41 -38
- package/pf-card/pf-card.js +37 -54
- package/pf-card/pf-card.js.map +1 -1
- package/pf-card/test/pf-card.e2e.js +12 -0
- package/pf-card/test/pf-card.e2e.js.map +1 -1
- package/pf-chip/pf-chip-group.css +9 -6
- package/pf-chip/pf-chip-group.d.ts +27 -14
- package/pf-chip/pf-chip-group.js +65 -94
- package/pf-chip/pf-chip-group.js.map +1 -1
- package/pf-chip/pf-chip.d.ts +20 -9
- package/pf-chip/pf-chip.js +1 -8
- package/pf-chip/pf-chip.js.map +1 -1
- package/pf-chip/test/pf-chip-group.spec.js +42 -22
- package/pf-chip/test/pf-chip-group.spec.js.map +1 -1
- package/pf-chip/test/pf-chip.e2e.js +12 -0
- package/pf-chip/test/pf-chip.e2e.js.map +1 -1
- package/pf-clipboard-copy/pf-clipboard-copy.css +83 -85
- package/pf-clipboard-copy/pf-clipboard-copy.d.ts +53 -18
- package/pf-clipboard-copy/pf-clipboard-copy.js +55 -44
- package/pf-clipboard-copy/pf-clipboard-copy.js.map +1 -1
- package/pf-clipboard-copy/test/pf-clipboard-copy.e2e.js +12 -0
- package/pf-clipboard-copy/test/pf-clipboard-copy.e2e.js.map +1 -1
- package/pf-code-block/pf-code-block.css +7 -4
- package/pf-code-block/pf-code-block.d.ts +4 -25
- package/pf-code-block/pf-code-block.js +44 -23
- package/pf-code-block/pf-code-block.js.map +1 -1
- package/pf-code-block/test/pf-code-block.e2e.js +12 -0
- package/pf-code-block/test/pf-code-block.e2e.js.map +1 -1
- package/pf-dropdown/context.d.ts +2 -3
- package/pf-dropdown/context.js.map +1 -1
- package/pf-dropdown/pf-dropdown-group.d.ts +3 -9
- package/pf-dropdown/pf-dropdown-group.js +1 -5
- package/pf-dropdown/pf-dropdown-group.js.map +1 -1
- package/pf-dropdown/pf-dropdown-item.d.ts +21 -27
- package/pf-dropdown/pf-dropdown-item.js +1 -37
- package/pf-dropdown/pf-dropdown-item.js.map +1 -1
- package/pf-dropdown/pf-dropdown-menu.d.ts +4 -10
- package/pf-dropdown/pf-dropdown-menu.js +23 -23
- package/pf-dropdown/pf-dropdown-menu.js.map +1 -1
- package/pf-dropdown/pf-dropdown.d.ts +8 -24
- package/pf-dropdown/pf-dropdown.js +1 -26
- package/pf-dropdown/pf-dropdown.js.map +1 -1
- package/pf-dropdown/test/pf-dropdown.e2e.js +12 -0
- package/pf-dropdown/test/pf-dropdown.e2e.js.map +1 -1
- package/pf-icon/pf-icon.css +22 -0
- package/pf-icon/pf-icon.d.ts +93 -4
- package/pf-icon/pf-icon.js +191 -13
- package/pf-icon/pf-icon.js.map +1 -1
- package/pf-icon/test/pf-icon.e2e.js +12 -0
- package/pf-icon/test/pf-icon.e2e.js.map +1 -1
- package/pf-icon/test/pf-icon.spec.js +102 -88
- package/pf-icon/test/pf-icon.spec.js.map +1 -1
- package/pf-jump-links/pf-jump-links-item.d.ts +4 -11
- package/pf-jump-links/pf-jump-links-item.js +8 -15
- package/pf-jump-links/pf-jump-links-item.js.map +1 -1
- package/pf-jump-links/pf-jump-links-list.d.ts +2 -2
- package/pf-jump-links/pf-jump-links-list.js +1 -5
- package/pf-jump-links/pf-jump-links-list.js.map +1 -1
- package/pf-jump-links/pf-jump-links.d.ts +2 -2
- package/pf-jump-links/pf-jump-links.js +23 -62
- package/pf-jump-links/pf-jump-links.js.map +1 -1
- package/pf-jump-links/test/pf-jump-links.e2e.js +12 -0
- package/pf-jump-links/test/pf-jump-links.e2e.js.map +1 -1
- package/pf-label/pf-label.css +38 -5
- package/pf-label/pf-label.d.ts +65 -69
- package/pf-label/pf-label.js +49 -90
- package/pf-label/pf-label.js.map +1 -1
- package/pf-label/test/pf-label.e2e.js +12 -0
- package/pf-label/test/pf-label.e2e.js.map +1 -1
- package/pf-label/test/pf-label.spec.js +26 -16
- package/pf-label/test/pf-label.spec.js.map +1 -1
- package/pf-modal/pf-modal.d.ts +17 -22
- package/pf-modal/pf-modal.js +13 -39
- package/pf-modal/pf-modal.js.map +1 -1
- package/pf-modal/test/pf-modal.e2e.js +12 -0
- package/pf-modal/test/pf-modal.e2e.js.map +1 -1
- package/pf-panel/pf-panel.d.ts +31 -3
- package/pf-panel/pf-panel.js +1 -10
- package/pf-panel/pf-panel.js.map +1 -1
- package/pf-panel/test/pf-panel.e2e.js +12 -0
- package/pf-panel/test/pf-panel.e2e.js.map +1 -1
- package/pf-popover/pf-popover.d.ts +66 -84
- package/pf-popover/pf-popover.js +33 -150
- package/pf-popover/pf-popover.js.map +1 -1
- package/pf-popover/test/pf-popover.e2e.js +12 -0
- package/pf-popover/test/pf-popover.e2e.js.map +1 -1
- package/pf-popover/test/pf-popover.spec.js +0 -11
- package/pf-popover/test/pf-popover.spec.js.map +1 -1
- package/pf-progress/pf-progress.d.ts +40 -40
- package/pf-progress/pf-progress.js +1 -61
- package/pf-progress/pf-progress.js.map +1 -1
- package/pf-progress/test/pf-progress.e2e.js +12 -0
- package/pf-progress/test/pf-progress.e2e.js.map +1 -1
- package/pf-progress-stepper/pf-progress-step.d.ts +2 -3
- package/pf-progress-stepper/pf-progress-step.js +4 -14
- package/pf-progress-stepper/pf-progress-step.js.map +1 -1
- package/pf-progress-stepper/pf-progress-stepper.d.ts +118 -2
- package/pf-progress-stepper/pf-progress-stepper.js +10 -12
- package/pf-progress-stepper/pf-progress-stepper.js.map +1 -1
- package/pf-progress-stepper/test/pf-progress-stepper.e2e.js +12 -0
- package/pf-progress-stepper/test/pf-progress-stepper.e2e.js.map +1 -1
- package/pf-select/pf-option-group.d.ts +2 -2
- package/pf-select/pf-option-group.js +1 -5
- package/pf-select/pf-option-group.js.map +1 -1
- package/pf-select/pf-option.css +1 -1
- package/pf-select/pf-option.d.ts +4 -4
- package/pf-select/pf-option.js +20 -30
- package/pf-select/pf-option.js.map +1 -1
- package/pf-select/pf-select.css +14 -6
- package/pf-select/pf-select.d.ts +183 -40
- package/pf-select/pf-select.js +185 -260
- package/pf-select/pf-select.js.map +1 -1
- package/pf-select/test/pf-select.e2e.js +12 -0
- package/pf-select/test/pf-select.e2e.js.map +1 -1
- package/pf-select/test/pf-select.spec.js +1292 -613
- package/pf-select/test/pf-select.spec.js.map +1 -1
- package/pf-spinner/pf-spinner.css +27 -17
- package/pf-spinner/pf-spinner.d.ts +21 -17
- package/pf-spinner/pf-spinner.js +20 -24
- package/pf-spinner/pf-spinner.js.map +1 -1
- package/pf-spinner/test/pf-spinner.e2e.js +12 -0
- package/pf-spinner/test/pf-spinner.e2e.js.map +1 -1
- package/pf-switch/pf-switch.css +39 -13
- package/pf-switch/pf-switch.d.ts +48 -34
- package/pf-switch/pf-switch.js +114 -43
- package/pf-switch/pf-switch.js.map +1 -1
- package/pf-switch/test/pf-switch.e2e.js +12 -0
- package/pf-switch/test/pf-switch.e2e.js.map +1 -1
- package/pf-table/pf-caption.d.ts +2 -2
- package/pf-table/pf-caption.js +1 -4
- package/pf-table/pf-caption.js.map +1 -1
- package/pf-table/pf-table.d.ts +424 -424
- package/pf-table/pf-table.js +7 -645
- package/pf-table/pf-table.js.map +1 -1
- package/pf-table/pf-tbody.d.ts +2 -2
- package/pf-table/pf-tbody.js +1 -4
- package/pf-table/pf-tbody.js.map +1 -1
- package/pf-table/pf-td.d.ts +2 -2
- package/pf-table/pf-td.js +1 -4
- package/pf-table/pf-td.js.map +1 -1
- package/pf-table/pf-th.d.ts +2 -2
- package/pf-table/pf-th.js +1 -4
- package/pf-table/pf-th.js.map +1 -1
- package/pf-table/pf-thead.d.ts +2 -2
- package/pf-table/pf-thead.js +1 -4
- package/pf-table/pf-thead.js.map +1 -1
- package/pf-table/pf-tr.d.ts +1 -1
- package/pf-table/pf-tr.js +1 -4
- package/pf-table/pf-tr.js.map +1 -1
- package/pf-table/test/pf-table.e2e.js +12 -0
- package/pf-table/test/pf-table.e2e.js.map +1 -1
- package/pf-tabs/context.d.ts +2 -3
- package/pf-tabs/context.js.map +1 -1
- package/pf-tabs/pf-tab-panel.d.ts +3 -5
- package/pf-tabs/pf-tab-panel.js +1 -7
- package/pf-tabs/pf-tab-panel.js.map +1 -1
- package/pf-tabs/pf-tab.d.ts +37 -37
- package/pf-tabs/pf-tab.js +16 -54
- package/pf-tabs/pf-tab.js.map +1 -1
- package/pf-tabs/pf-tabs.d.ts +36 -37
- package/pf-tabs/pf-tabs.js +40 -78
- package/pf-tabs/pf-tabs.js.map +1 -1
- package/pf-tabs/test/pf-tabs.e2e.js +12 -0
- package/pf-tabs/test/pf-tabs.e2e.js.map +1 -1
- package/pf-tabs/test/pf-tabs.spec.js +11 -12
- package/pf-tabs/test/pf-tabs.spec.js.map +1 -1
- package/pf-text-area/pf-text-area.d.ts +128 -134
- package/pf-text-area/pf-text-area.js +7 -131
- package/pf-text-area/pf-text-area.js.map +1 -1
- package/pf-text-area/test/pf-text-area.e2e.js +12 -0
- package/pf-text-area/test/pf-text-area.e2e.js.map +1 -1
- package/pf-text-input/pf-text-input.d.ts +129 -135
- package/pf-text-input/pf-text-input.js +7 -132
- package/pf-text-input/pf-text-input.js.map +1 -1
- package/pf-text-input/test/pf-text-input.e2e.js +12 -0
- package/pf-text-input/test/pf-text-input.e2e.js.map +1 -1
- package/pf-tile/pf-tile.d.ts +21 -20
- package/pf-tile/pf-tile.js +18 -35
- package/pf-tile/pf-tile.js.map +1 -1
- package/pf-tile/test/pf-tile.e2e.js +12 -0
- package/pf-tile/test/pf-tile.e2e.js.map +1 -1
- package/pf-timestamp/pf-timestamp.d.ts +2 -2
- package/pf-timestamp/pf-timestamp.js +1 -3
- package/pf-timestamp/pf-timestamp.js.map +1 -1
- package/pf-timestamp/test/pf-timestamp.e2e.js +12 -0
- package/pf-timestamp/test/pf-timestamp.e2e.js.map +1 -1
- package/pf-tooltip/pf-tooltip.d.ts +51 -50
- package/pf-tooltip/pf-tooltip.js +26 -106
- package/pf-tooltip/pf-tooltip.js.map +1 -1
- package/pf-tooltip/test/pf-tooltip.e2e.js +12 -0
- package/pf-tooltip/test/pf-tooltip.e2e.js.map +1 -1
- package/pfe.min.js +1194 -1002
- package/pfe.min.js.map +4 -4
- package/react/pf-accordion/pf-accordion-header.js +2 -2
- package/react/pf-accordion/pf-accordion-panel.js +2 -2
- package/react/pf-accordion/pf-accordion.js +2 -2
- package/react/pf-avatar/pf-avatar.d.ts +1 -1
- package/react/pf-avatar/pf-avatar.js +5 -3
- package/react/pf-back-to-top/pf-back-to-top.js +2 -2
- package/react/pf-background-image/pf-background-image.js +2 -2
- package/react/pf-badge/pf-badge.js +2 -2
- package/react/pf-banner/pf-banner.js +2 -2
- package/react/pf-button/pf-button.js +2 -2
- package/react/pf-card/pf-card.js +2 -2
- package/react/pf-chip/pf-chip-group.js +2 -2
- package/react/pf-chip/pf-chip.js +2 -2
- package/react/pf-clipboard-copy/pf-clipboard-copy.d.ts +1 -1
- package/react/pf-clipboard-copy/pf-clipboard-copy.js +5 -3
- package/react/pf-code-block/pf-code-block.js +2 -2
- package/react/pf-dropdown/pf-dropdown-group.js +2 -2
- package/react/pf-dropdown/pf-dropdown-item.js +2 -2
- package/react/pf-dropdown/pf-dropdown-menu.js +2 -2
- package/react/pf-dropdown/pf-dropdown.js +2 -2
- package/react/pf-icon/pf-icon.js +2 -2
- package/react/pf-jump-links/pf-jump-links-item.js +2 -2
- package/react/pf-jump-links/pf-jump-links-list.js +2 -2
- package/react/pf-jump-links/pf-jump-links.js +2 -2
- package/react/pf-label/pf-label.js +2 -2
- package/react/pf-modal/pf-modal.js +2 -2
- package/react/pf-panel/pf-panel.js +2 -2
- package/react/pf-popover/pf-popover.js +2 -2
- package/react/pf-progress/pf-progress.js +2 -2
- package/react/pf-progress-stepper/pf-progress-step.js +2 -2
- package/react/pf-progress-stepper/pf-progress-stepper.js +2 -2
- package/react/pf-select/pf-option-group.js +2 -2
- package/react/pf-select/pf-option.js +2 -2
- package/react/pf-select/pf-select.d.ts +1 -1
- package/react/pf-select/pf-select.js +2 -3
- package/react/pf-spinner/pf-spinner.js +2 -2
- package/react/pf-switch/pf-switch.js +2 -2
- package/react/pf-table/pf-caption.js +2 -2
- package/react/pf-table/pf-table.js +2 -2
- package/react/pf-table/pf-tbody.js +2 -2
- package/react/pf-table/pf-td.js +2 -2
- package/react/pf-table/pf-th.js +2 -2
- package/react/pf-table/pf-thead.js +2 -2
- package/react/pf-table/pf-tr.js +2 -2
- package/react/pf-tabs/pf-tab-panel.js +2 -2
- package/react/pf-tabs/pf-tab.js +2 -2
- package/react/pf-tabs/pf-tabs.js +2 -2
- package/react/pf-text-area/pf-text-area.js +2 -2
- package/react/pf-text-input/pf-text-input.js +2 -2
- package/react/pf-tile/pf-tile.js +2 -2
- package/react/pf-timestamp/pf-timestamp.js +2 -2
- package/react/pf-tooltip/pf-tooltip.js +2 -2
- package/pf-accordion/BaseAccordion.d.ts +0 -61
- package/pf-accordion/BaseAccordion.js +0 -269
- package/pf-accordion/BaseAccordion.js.map +0 -1
- package/pf-accordion/BaseAccordionHeader.css +0 -39
- package/pf-accordion/BaseAccordionHeader.d.ts +0 -29
- package/pf-accordion/BaseAccordionHeader.js +0 -128
- package/pf-accordion/BaseAccordionHeader.js.map +0 -1
- package/pf-accordion/BaseAccordionPanel.css +0 -27
- package/pf-accordion/BaseAccordionPanel.d.ts +0 -7
- package/pf-accordion/BaseAccordionPanel.js +0 -33
- package/pf-accordion/BaseAccordionPanel.js.map +0 -1
- package/pf-avatar/BaseAvatar.css +0 -13
- package/pf-avatar/BaseAvatar.d.ts +0 -23
- package/pf-avatar/BaseAvatar.js +0 -62
- package/pf-avatar/BaseAvatar.js.map +0 -1
- package/pf-back-to-top/demo/demo.css +0 -25
- package/pf-badge/BaseBadge.css +0 -6
- package/pf-badge/BaseBadge.d.ts +0 -18
- package/pf-badge/BaseBadge.js +0 -16
- package/pf-badge/BaseBadge.js.map +0 -1
- package/pf-button/BaseButton.css +0 -68
- package/pf-button/BaseButton.d.ts +0 -51
- package/pf-button/BaseButton.js +0 -84
- package/pf-button/BaseButton.js.map +0 -1
- package/pf-card/BaseCard.css +0 -36
- package/pf-card/BaseCard.d.ts +0 -24
- package/pf-card/BaseCard.js +0 -51
- package/pf-card/BaseCard.js.map +0 -1
- package/pf-clipboard-copy/BaseClipboardCopy.css +0 -6
- package/pf-clipboard-copy/BaseClipboardCopy.d.ts +0 -18
- package/pf-clipboard-copy/BaseClipboardCopy.js +0 -25
- package/pf-clipboard-copy/BaseClipboardCopy.js.map +0 -1
- package/pf-code-block/BaseCodeBlock.css +0 -7
- package/pf-code-block/BaseCodeBlock.d.ts +0 -8
- package/pf-code-block/BaseCodeBlock.js +0 -22
- package/pf-code-block/BaseCodeBlock.js.map +0 -1
- package/pf-icon/BaseIcon.css +0 -22
- package/pf-icon/BaseIcon.d.ts +0 -41
- package/pf-icon/BaseIcon.js +0 -144
- package/pf-icon/BaseIcon.js.map +0 -1
- package/pf-label/BaseLabel.css +0 -44
- package/pf-label/BaseLabel.d.ts +0 -30
- package/pf-label/BaseLabel.js +0 -29
- package/pf-label/BaseLabel.js.map +0 -1
- package/pf-spinner/BaseSpinner.css +0 -20
- package/pf-spinner/BaseSpinner.d.ts +0 -27
- package/pf-spinner/BaseSpinner.js +0 -45
- package/pf-spinner/BaseSpinner.js.map +0 -1
- package/pf-switch/BaseSwitch.css +0 -36
- package/pf-switch/BaseSwitch.d.ts +0 -19
- package/pf-switch/BaseSwitch.js +0 -109
- package/pf-switch/BaseSwitch.js.map +0 -1
- package/pf-tabs/BaseTab.css +0 -60
- package/pf-tabs/BaseTab.d.ts +0 -32
- package/pf-tabs/BaseTab.js +0 -83
- package/pf-tabs/BaseTab.js.map +0 -1
- package/pf-tabs/BaseTabPanel.css +0 -7
- package/pf-tabs/BaseTabPanel.d.ts +0 -7
- package/pf-tabs/BaseTabPanel.js +0 -36
- package/pf-tabs/BaseTabPanel.js.map +0 -1
- package/pf-tabs/BaseTabs.css +0 -86
- package/pf-tabs/BaseTabs.d.ts +0 -38
- package/pf-tabs/BaseTabs.js +0 -221
- package/pf-tabs/BaseTabs.js.map +0 -1
- package/pf-tile/BaseTile.d.ts +0 -13
- package/pf-tile/BaseTile.js +0 -28
- package/pf-tile/BaseTile.js.map +0 -1
- package/pf-tooltip/BaseTooltip.css +0 -70
- package/pf-tooltip/BaseTooltip.d.ts +0 -16
- package/pf-tooltip/BaseTooltip.js +0 -54
- package/pf-tooltip/BaseTooltip.js.map +0 -1
|
@@ -1,103 +1,137 @@
|
|
|
1
|
-
var _PfAccordionHeader_slots;
|
|
2
|
-
import { __classPrivateFieldGet, __decorate } from "tslib";
|
|
3
|
-
import { html } from 'lit';
|
|
1
|
+
var _PfAccordionHeader_instances, _PfAccordionHeader_generatedHtag, _PfAccordionHeader_logger, _PfAccordionHeader_header, _PfAccordionHeader_slots, _PfAccordionHeader_initHeader, _PfAccordionHeader_getOrCreateHeader, _PfAccordionHeader_onClick;
|
|
2
|
+
import { __classPrivateFieldGet, __classPrivateFieldSet, __decorate } from "tslib";
|
|
3
|
+
import { LitElement, html } from 'lit';
|
|
4
4
|
import { customElement } from 'lit/decorators/custom-element.js';
|
|
5
5
|
import { property } from 'lit/decorators/property.js';
|
|
6
6
|
import { SlotController } from '@patternfly/pfe-core/controllers/slot-controller.js';
|
|
7
|
-
import {
|
|
7
|
+
import { Logger } from '@patternfly/pfe-core/controllers/logger.js';
|
|
8
|
+
import { getRandomId } from '@patternfly/pfe-core/functions/random.js';
|
|
8
9
|
import { css } from "lit";
|
|
9
|
-
const style = css `:host {\n --pf-icon--size: var(--pf-c-accordion__toggle--IconSize, 10px);\n\n color: var(--pf-c-accordion__toggle--Color, var(--pf-global--Color--100, #151515));\n background-color: var(--pf-global--BackgroundColor--100, #ffffff);\n}\n\n:host([large]) {\n --pf-c-accordion__toggle--PaddingTop: var(--pf-global--spacer--md, 1rem);\n --pf-c-accordion__toggle--PaddingRight: var(--pf-global--spacer--md, 1rem);\n --pf-c-accordion__toggle--PaddingBottom: var(--pf-global--spacer--md, 1rem);\n --pf-c-accordion__toggle--PaddingLeft: var(--pf-global--spacer--lg, 1.5rem);\n --pf-c-accordion__toggle--FontFamily:\n var(--pf-global--FontFamily--redhat-updated--heading--sans-serif,\n "RedHatDisplayUpdated",\n "Overpass",\n overpass,\n helvetica,\n arial,\n sans-serif\n );\n --pf-c-accordion__toggle--FontSize: var(--pf-global--FontSize--xl, 1.25rem);\n --pf-c-accordion__toggle--hover-text--Color: var(--pf-global--Color--100, #151515);\n --pf-c-accordion__toggle--active-text--Color: var(--pf-global--Color--100, #151515);\n --pf-c-accordion__toggle--active-text--FontWeight: var(--pf-global--FontWeight--normal, 400);\n --pf-c-accordion__toggle--focus-text--Color: var(--pf-global--Color--100, #151515);\n --pf-c-accordion__toggle--focus-text--FontWeight: var(--pf-global--FontWeight--normal, 400);\n --pf-c-accordion__toggle--expanded-text--Color: var(--pf-global--Color--100, #151515);\n --pf-c-accordion__toggle--expanded-text--FontWeight: var(--pf-global--FontWeight--normal, 400);\n --pf-icon--size: var(--pf-c-accordion__toggle--IconSize, 12px);\n}\n\n#heading {\n font-weight: var(--pf-c-accordion__toggle--FontWeight, var(--pf-global--FontWeight--normal, 400));\n}\n\n.toggle,\n.toggle:before,\n.toggle:after {\n background-color: var(--pf-c-accordion__toggle--BackgroundColor, transparent);\n}\n\n.icon {\n transition: var(--pf-c-accordion__toggle-icon--Transition, 0.2s ease-in 0s);\n}\n\n.toggle {\n padding:\n var(--pf-c-accordion__toggle--PaddingTop, var(--pf-global--spacer--md, 0.5rem))\n var(--pf-c-accordion__toggle--PaddingRight, var(--pf-global--spacer--md, 1rem))\n var(--pf-c-accordion__toggle--PaddingBottom, var(--pf-global--spacer--sm, 0.5rem))\n var(--pf-c-accordion__toggle--PaddingLeft, var(--pf-global--spacer--md, 1rem));\n font-family:\n var(--pf-c-accordion__toggle--FontFamily,\n var(--pf-global--FontFamily--redhat-updated--heading--sans-serif,\n "RedHatTextUpdated",\n helvetica,\n arial,\n sans-serif));\n font-size: var(--pf-c-accordion__toggle--FontSize, var(--pf-global--FontSize--lg, 1rem));\n font-weight: var(--pf-c-accordion__toggle--FontWeight, var(--pf-global--FontWeight--normal, 400));\n color: var(--pf-c-accordion__toggle--Color, var(--pf-global--Color--100, #151515));\n}\n\n.toggle[aria-expanded="true"] {\n --pf-c-accordion__toggle--after--BackgroundColor:\n var(\n --pf-c-accordion__toggle--expanded--before--BackgroundColor,\n var(\n --pf-global--primary-color--100,\n #0066cc\n )\n );\n}\n\n.toggle:after {\n top: var(--pf-c-accordion__toggle--before--Top, -1px);\n width: var(--pf-c-accordion__toggle--before--Width, var(--pf-global--BorderWidth--lg, 3px));\n background-color: var(--pf-c-accordion__toggle--after--BackgroundColor, transparent);\n}\n\nspan {\n max-width: var(--pf-c-accordion__toggle-text--MaxWidth,\n calc(100% - var(--pf-global--spacer--lg, 1.5rem)));\n}\n\n.toggle[aria-expanded="true"] .icon {\n rotate: var(--pf-c-accordion__toggle--expanded-icon--Rotate, 90deg);\n}\n\n.toggle:hover,\n.toggle:active,\n.toggle:focus {\n background-color:\n var(--pf-c-accordion__toggle--active--BackgroundColor,\n var(--pf-global--BackgroundColor--200, #f0f0f0));\n}\n\n.toggle:hover span,\n.toggle:focus span,\n.toggle:active span {\n color: var(--pf-c-accordion__toggle--active-text--Color, var(--pf-global--link--Color, #0066cc));\n}\n\n.toggle:focus span,\n.toggle:active span {\n font-weight: var(--pf-c-accordion__toggle--active-text--FontWeight,\n var(--pf-global--FontWeight--semi-bold, 700));\n}\n`;
|
|
10
|
+
const style = css `:host {\n --pf-icon--size: var(--pf-c-accordion__toggle--IconSize, 10px);\n\n color: var(--pf-c-accordion__toggle--Color, var(--pf-global--Color--100, #151515));\n background-color: var(--pf-global--BackgroundColor--100, #ffffff);\n}\n\n:host([large]) {\n --pf-c-accordion__toggle--PaddingTop: var(--pf-global--spacer--md, 1rem);\n --pf-c-accordion__toggle--PaddingRight: var(--pf-global--spacer--md, 1rem);\n --pf-c-accordion__toggle--PaddingBottom: var(--pf-global--spacer--md, 1rem);\n --pf-c-accordion__toggle--PaddingLeft: var(--pf-global--spacer--lg, 1.5rem);\n --pf-c-accordion__toggle--FontFamily:\n var(--pf-global--FontFamily--redhat-updated--heading--sans-serif,\n "RedHatDisplayUpdated",\n "Overpass",\n overpass,\n helvetica,\n arial,\n sans-serif\n );\n --pf-c-accordion__toggle--FontSize: var(--pf-global--FontSize--xl, 1.25rem);\n --pf-c-accordion__toggle--hover-text--Color: var(--pf-global--Color--100, #151515);\n --pf-c-accordion__toggle--active-text--Color: var(--pf-global--Color--100, #151515);\n --pf-c-accordion__toggle--active-text--FontWeight: var(--pf-global--FontWeight--normal, 400);\n --pf-c-accordion__toggle--focus-text--Color: var(--pf-global--Color--100, #151515);\n --pf-c-accordion__toggle--focus-text--FontWeight: var(--pf-global--FontWeight--normal, 400);\n --pf-c-accordion__toggle--expanded-text--Color: var(--pf-global--Color--100, #151515);\n --pf-c-accordion__toggle--expanded-text--FontWeight: var(--pf-global--FontWeight--normal, 400);\n --pf-icon--size: var(--pf-c-accordion__toggle--IconSize, 12px);\n}\n\n#heading {\n font-weight: var(--pf-c-accordion__toggle--FontWeight, var(--pf-global--FontWeight--normal, 400));\n font-size: 100%;\n padding: 0;\n margin: 0;\n}\n\nbutton,\na {\n cursor: pointer;\n}\n\n.toggle,\n.toggle:before,\n.toggle:after {\n padding: 0;\n margin: 0;\n background-color: var(--pf-c-accordion__toggle--BackgroundColor, transparent);\n}\n\n.icon {\n transition: var(--pf-c-accordion__toggle-icon--Transition, 0.2s ease-in 0s);\n}\n\n.toggle {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n border: 0;\n padding:\n var(--pf-c-accordion__toggle--PaddingTop, var(--pf-global--spacer--md, 0.5rem))\n var(--pf-c-accordion__toggle--PaddingRight, var(--pf-global--spacer--md, 1rem))\n var(--pf-c-accordion__toggle--PaddingBottom, var(--pf-global--spacer--sm, 0.5rem))\n var(--pf-c-accordion__toggle--PaddingLeft, var(--pf-global--spacer--md, 1rem));\n font-family:\n var(--pf-c-accordion__toggle--FontFamily,\n var(--pf-global--FontFamily--redhat-updated--heading--sans-serif,\n "RedHatTextUpdated",\n helvetica,\n arial,\n sans-serif));\n font-size: var(--pf-c-accordion__toggle--FontSize, var(--pf-global--FontSize--lg, 1rem));\n font-weight: var(--pf-c-accordion__toggle--FontWeight, var(--pf-global--FontWeight--normal, 400));\n color: var(--pf-c-accordion__toggle--Color, var(--pf-global--Color--100, #151515));\n}\n\n.toggle[aria-expanded="true"] {\n --pf-c-accordion__toggle--after--BackgroundColor:\n var(\n --pf-c-accordion__toggle--expanded--before--BackgroundColor,\n var(\n --pf-global--primary-color--100,\n #0066cc\n )\n );\n}\n\n.toggle:after {\n top: var(--pf-c-accordion__toggle--before--Top, -1px);\n width: var(--pf-c-accordion__toggle--before--Width, var(--pf-global--BorderWidth--lg, 3px));\n background-color: var(--pf-c-accordion__toggle--after--BackgroundColor, transparent);\n content: "";\n position: absolute;\n bottom: 0;\n left: 0;\n}\n\nspan {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: var(--pf-c-accordion__toggle-text--MaxWidth,\n calc(100% - var(--pf-global--spacer--lg, 1.5rem)));\n}\n\n.toggle[aria-expanded="true"] .icon {\n rotate: var(--pf-c-accordion__toggle--expanded-icon--Rotate, 90deg);\n}\n\n.toggle:hover,\n.toggle:active,\n.toggle:focus {\n background-color:\n var(--pf-c-accordion__toggle--active--BackgroundColor,\n var(--pf-global--BackgroundColor--200, #f0f0f0));\n}\n\n.toggle:hover span,\n.toggle:focus span,\n.toggle:active span {\n color: var(--pf-c-accordion__toggle--active-text--Color, var(--pf-global--link--Color, #0066cc));\n}\n\n.toggle:focus span,\n.toggle:active span {\n font-weight: var(--pf-c-accordion__toggle--active-text--FontWeight,\n var(--pf-global--FontWeight--semi-bold, 700));\n}\n`;
|
|
10
11
|
import '@patternfly/elements/pf-icon/pf-icon.js';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
* These elements will appear inline with the accordion header, between the header and the chevron
|
|
22
|
-
* (or after the chevron and header in disclosure mode).
|
|
23
|
-
*
|
|
24
|
-
* @fires {AccordionHeaderChangeEvent} change - when the open panels change
|
|
25
|
-
*
|
|
26
|
-
* @cssprop {<color>} --pf-c-accordion__toggle--Color
|
|
27
|
-
* Sets the font color for the accordion header.
|
|
28
|
-
* {@default `var(--pf-global--Color--100, #151515)`}
|
|
29
|
-
* @cssprop {<color>} --pf-c-accordion__toggle--BackgroundColor
|
|
30
|
-
* Sets the background color for the accordion header toggle element.
|
|
31
|
-
* {@default `transparent`}
|
|
32
|
-
* @cssprop {<color>} --pf-c-accordion__toggle--after--BackgroundColor
|
|
33
|
-
* Sets the background color for the after element for the accordion header toggle element.
|
|
34
|
-
* {@default `transparent`}
|
|
35
|
-
* @cssprop {<length>} --pf-c-accordion__toggle--PaddingTop
|
|
36
|
-
* Sets the top padding for the accordion header.
|
|
37
|
-
* {@default `var(--pf-global--spacer--sm, 0.5rem)`}
|
|
38
|
-
* @cssprop {<length>} --pf-c-accordion__toggle--PaddingRight
|
|
39
|
-
* Sets the right padding for the accordion header.
|
|
40
|
-
* {@default `var(--pf-global--spacer--md, 1rem)`}
|
|
41
|
-
* @cssprop {<length>} --pf-c-accordion__toggle--PaddingBottom
|
|
42
|
-
* Sets the bottom padding for the accordion header.
|
|
43
|
-
* {@default `var(--pf-global--spacer--sm, 0.5rem)`}
|
|
44
|
-
* @cssprop {<length>} --pf-c-accordion__toggle--PaddingLeft
|
|
45
|
-
* Sets the left padding for the accordion header.
|
|
46
|
-
* {@default `var(--pf-global--spacer--md, 1rem)`}
|
|
47
|
-
* @cssprop {<length>} --pf-c-accordion__toggle--FontSize
|
|
48
|
-
* Sets the sidebar background color for the accordion header.
|
|
49
|
-
* {@default `var(--pf-global--FontSize--lg, 1rem)`}
|
|
50
|
-
* @cssprop {<color>} --pf-c-accordion__toggle--FontFamily
|
|
51
|
-
* Sets the font family for the accordion header.
|
|
52
|
-
* {@default `var(--pf-global--FontFamily--redhat-updated--heading--sans-serif, "RedHatDisplayUpdated", helvetica, arial, sans-serif)`}
|
|
53
|
-
* @cssprop --pf-c-accordion__toggle--FontWeight
|
|
54
|
-
* Sets the font weight for the accordion header.
|
|
55
|
-
* {@default `var(--pf-global--FontWeight--normal, 400)`}
|
|
56
|
-
* @cssprop {<color>} --pf-c-accordion__toggle--active--BackgroundColor
|
|
57
|
-
* Sets the active backgrdound color for the accordion header.
|
|
58
|
-
* {@default `var(--pf-global--BackgroundColor--200, #f0f0f0)`}
|
|
59
|
-
* @cssprop {<color>} --pf-c-accordion__toggle--active-text--Color
|
|
60
|
-
* Sets the active text color for the accordion header.
|
|
61
|
-
* {@default `var(--pf-global--link--Color, #0066cc)`}
|
|
62
|
-
* @cssprop --pf-c-accordion__toggle--active-text--FontWeight
|
|
63
|
-
* Sets the active text font weight for the accordion header.
|
|
64
|
-
* {@default `var(--pf-global--FontWeight--semi-bold, 700)`}
|
|
65
|
-
* @cssprop {<color>} --pf-c-accordion__toggle--expanded--before--BackgroundColor
|
|
66
|
-
* Sets the hover expanded before background color for the accordion header.
|
|
67
|
-
* {@default `var(--pf-global--link--Color, #0066cc)`}
|
|
68
|
-
* @cssprop --pf-c-accordion__toggle--expanded-icon--Rotate
|
|
69
|
-
* Sets the expanded icon rotation degrees for the accordion header.
|
|
70
|
-
* {@default `90deg`}
|
|
71
|
-
* @cssprop {<length>} --pf-c-accordion__toggle-text--MaxWidth
|
|
72
|
-
* Sets the max width for the text inside the accordion header.
|
|
73
|
-
* {@default `calc(100% - var(--pf-global--spacer--lg, 1.5rem))`}
|
|
74
|
-
* @cssprop --pf-c-accordion__toggle--before--Width
|
|
75
|
-
* Sets the sidebar width for the accordion header.
|
|
76
|
-
* {@default `var(--pf-global--BorderWidth--lg, 3px)`}
|
|
77
|
-
* @cssprop --pf-c-accordion__toggle-icon--Transition
|
|
78
|
-
* Sets the transition animation for the accordion header.
|
|
79
|
-
* {@default `0.2s ease-in 0s`}
|
|
80
|
-
*/
|
|
81
|
-
let PfAccordionHeader = class PfAccordionHeader extends BaseAccordionHeader {
|
|
12
|
+
const isPorHeader = (el) => el instanceof HTMLElement && !!el.tagName.match(/P|^H[1-6]/);
|
|
13
|
+
export class PfAccordionHeaderChangeEvent extends Event {
|
|
14
|
+
constructor(expanded, toggle, accordion) {
|
|
15
|
+
super('change', { bubbles: true });
|
|
16
|
+
this.expanded = expanded;
|
|
17
|
+
this.toggle = toggle;
|
|
18
|
+
this.accordion = accordion;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
let PfAccordionHeader = class PfAccordionHeader extends LitElement {
|
|
82
22
|
constructor() {
|
|
83
23
|
super(...arguments);
|
|
24
|
+
_PfAccordionHeader_instances.add(this);
|
|
25
|
+
this.expanded = false;
|
|
26
|
+
_PfAccordionHeader_generatedHtag.set(this, void 0);
|
|
27
|
+
_PfAccordionHeader_logger.set(this, new Logger(this));
|
|
28
|
+
_PfAccordionHeader_header.set(this, void 0);
|
|
84
29
|
_PfAccordionHeader_slots.set(this, new SlotController(this, 'accents', null));
|
|
85
30
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
31
|
+
connectedCallback() {
|
|
32
|
+
super.connectedCallback();
|
|
33
|
+
this.id || (this.id = getRandomId(this.localName));
|
|
34
|
+
__classPrivateFieldGet(this, _PfAccordionHeader_instances, "m", _PfAccordionHeader_initHeader).call(this);
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
const headingText = this.headingText?.trim() ?? __classPrivateFieldGet(this, _PfAccordionHeader_header, "f")?.textContent?.trim();
|
|
38
|
+
const content = html `
|
|
39
|
+
<button id="button"
|
|
40
|
+
class="toggle"
|
|
41
|
+
@click="${__classPrivateFieldGet(this, _PfAccordionHeader_instances, "m", _PfAccordionHeader_onClick)}"
|
|
42
|
+
aria-expanded="${String(!!this.expanded)}">
|
|
43
|
+
<span part="text">${headingText ?? html `
|
|
44
|
+
<slot></slot>`}
|
|
45
|
+
</span>
|
|
46
|
+
<span part="accents" ?hidden="${__classPrivateFieldGet(this, _PfAccordionHeader_slots, "f").isEmpty('accents')}">
|
|
47
|
+
<slot name="accents"></slot>
|
|
48
|
+
</span>
|
|
49
|
+
<pf-icon part="icon"
|
|
50
|
+
class="icon"
|
|
51
|
+
size="lg"
|
|
52
|
+
set="${this.iconSet ?? 'fas'}"
|
|
53
|
+
icon="${this.icon ?? 'angle-right'}"
|
|
54
|
+
></pf-icon>
|
|
55
|
+
</button>
|
|
96
56
|
`;
|
|
57
|
+
switch (this.headingTag) {
|
|
58
|
+
case 'h1': return html `<h1 id="heading">${content}</h1>`;
|
|
59
|
+
case 'h2': return html `<h2 id="heading">${content}</h2>`;
|
|
60
|
+
case 'h3': return html `<h3 id="heading">${content}</h3>`;
|
|
61
|
+
case 'h4': return html `<h4 id="heading">${content}</h4>`;
|
|
62
|
+
case 'h5': return html `<h5 id="heading">${content}</h5>`;
|
|
63
|
+
case 'h6': return html `<h6 id="heading">${content}</h6>`;
|
|
64
|
+
default: return content;
|
|
65
|
+
}
|
|
97
66
|
}
|
|
98
67
|
};
|
|
68
|
+
_PfAccordionHeader_generatedHtag = new WeakMap();
|
|
69
|
+
_PfAccordionHeader_logger = new WeakMap();
|
|
70
|
+
_PfAccordionHeader_header = new WeakMap();
|
|
99
71
|
_PfAccordionHeader_slots = new WeakMap();
|
|
100
|
-
|
|
72
|
+
_PfAccordionHeader_instances = new WeakSet();
|
|
73
|
+
_PfAccordionHeader_initHeader = async function _PfAccordionHeader_initHeader() {
|
|
74
|
+
if (this.headingText) {
|
|
75
|
+
this.headingTag || (this.headingTag = 'h3');
|
|
76
|
+
}
|
|
77
|
+
__classPrivateFieldSet(this, _PfAccordionHeader_header, __classPrivateFieldGet(this, _PfAccordionHeader_instances, "m", _PfAccordionHeader_getOrCreateHeader).call(this), "f");
|
|
78
|
+
// prevent double-logging
|
|
79
|
+
if (__classPrivateFieldGet(this, _PfAccordionHeader_header, "f") !== __classPrivateFieldGet(this, _PfAccordionHeader_generatedHtag, "f")) {
|
|
80
|
+
__classPrivateFieldSet(this, _PfAccordionHeader_generatedHtag, undefined, "f");
|
|
81
|
+
}
|
|
82
|
+
do {
|
|
83
|
+
await this.updateComplete;
|
|
84
|
+
} while (!await this.updateComplete);
|
|
85
|
+
// Remove the hidden attribute after upgrade
|
|
86
|
+
this.hidden = false;
|
|
87
|
+
};
|
|
88
|
+
_PfAccordionHeader_getOrCreateHeader = function _PfAccordionHeader_getOrCreateHeader() {
|
|
89
|
+
// Check if there is no nested element or nested textNodes
|
|
90
|
+
if (!this.firstElementChild && !this.firstChild) {
|
|
91
|
+
return void __classPrivateFieldGet(this, _PfAccordionHeader_logger, "f").warn('No header content provided');
|
|
92
|
+
}
|
|
93
|
+
else if (this.firstElementChild) {
|
|
94
|
+
const [heading, ...otherContent] = Array.from(this.children)
|
|
95
|
+
.filter((x) => !x.hasAttribute('slot') && isPorHeader(x));
|
|
96
|
+
// If there is no content inside the slot, return empty with a warning
|
|
97
|
+
// else, if there is more than 1 element in the slot, capture the first h-tag
|
|
98
|
+
if (!heading) {
|
|
99
|
+
return void __classPrivateFieldGet(this, _PfAccordionHeader_logger, "f").warn('No heading information was provided.');
|
|
100
|
+
}
|
|
101
|
+
else if (otherContent.length) {
|
|
102
|
+
__classPrivateFieldGet(this, _PfAccordionHeader_logger, "f").warn('Heading currently only supports 1 tag; extra tags will be ignored.');
|
|
103
|
+
}
|
|
104
|
+
return heading;
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
if (!__classPrivateFieldGet(this, _PfAccordionHeader_generatedHtag, "f")) {
|
|
108
|
+
__classPrivateFieldGet(this, _PfAccordionHeader_logger, "f").warn('Header should contain at least 1 heading tag for correct semantics.');
|
|
109
|
+
}
|
|
110
|
+
__classPrivateFieldSet(this, _PfAccordionHeader_generatedHtag, document.createElement('h3'), "f");
|
|
111
|
+
// If a text node was provided but no semantics, default to an h3
|
|
112
|
+
// otherwise, incorrect semantics were used, create an H3 and try to capture the content
|
|
113
|
+
if (this.firstChild?.nodeType === Node.TEXT_NODE) {
|
|
114
|
+
__classPrivateFieldGet(this, _PfAccordionHeader_generatedHtag, "f").textContent = this.firstChild.textContent;
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
__classPrivateFieldGet(this, _PfAccordionHeader_generatedHtag, "f").textContent = this.textContent;
|
|
118
|
+
}
|
|
119
|
+
return __classPrivateFieldGet(this, _PfAccordionHeader_generatedHtag, "f");
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
_PfAccordionHeader_onClick = function _PfAccordionHeader_onClick() {
|
|
123
|
+
const expanded = !this.expanded;
|
|
124
|
+
const acc = this.closest('pf-accordion');
|
|
125
|
+
if (acc) {
|
|
126
|
+
this.dispatchEvent(new PfAccordionHeaderChangeEvent(expanded, this, acc));
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
PfAccordionHeader.styles = [style];
|
|
130
|
+
PfAccordionHeader.shadowRootOptions = {
|
|
131
|
+
...LitElement.shadowRootOptions,
|
|
132
|
+
delegatesFocus: true,
|
|
133
|
+
};
|
|
134
|
+
PfAccordionHeader.version = "4.0.0";
|
|
101
135
|
__decorate([
|
|
102
136
|
property({ reflect: true })
|
|
103
137
|
], PfAccordionHeader.prototype, "bordered", void 0);
|
|
@@ -107,6 +141,15 @@ __decorate([
|
|
|
107
141
|
__decorate([
|
|
108
142
|
property({ reflect: true, attribute: 'icon-set' })
|
|
109
143
|
], PfAccordionHeader.prototype, "iconSet", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
property({ type: Boolean, reflect: true })
|
|
146
|
+
], PfAccordionHeader.prototype, "expanded", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
property({ reflect: true, attribute: 'heading-text' })
|
|
149
|
+
], PfAccordionHeader.prototype, "headingText", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
property({ reflect: true, attribute: 'heading-tag' })
|
|
152
|
+
], PfAccordionHeader.prototype, "headingTag", void 0);
|
|
110
153
|
PfAccordionHeader = __decorate([
|
|
111
154
|
customElement('pf-accordion-header')
|
|
112
155
|
], PfAccordionHeader);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pf-accordion-header.js","sourceRoot":"","sources":["pf-accordion-header.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AAErF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;;;AAI/D,OAAO,yCAAyC,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AAEI,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,mBAAmB;IAAnD;;QASL,mCAAS,IAAI,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,EAAC;IAcrD,CAAC;IAZC,iBAAiB;QACf,OAAO,IAAI,CAAA,GAAG,CAAC,uBAAA,IAAI,gCAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;;;cAGlD;;wBAEU,IAAI,CAAC,IAAI,IAAI,aAAa;uBAC3B,IAAI,CAAC,OAAO,IAAI,KAAK;;;KAGvC,CAAC;IACJ,CAAC;;;AArBe,wBAAM,GAAG,CAAC,GAAG,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,AAAzC,CAA0C;AAEnC;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDAA6B;AAE5B;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CAAe;AAES;IAAnD,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;kDAAkB;AAP1D,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CAuB7B","sourcesContent":["import { html } from 'lit';\nimport { customElement } from 'lit/decorators/custom-element.js';\nimport { property } from 'lit/decorators/property.js';\n\nimport { SlotController } from '@patternfly/pfe-core/controllers/slot-controller.js';\n\nimport { BaseAccordionHeader } from './BaseAccordionHeader.js';\n\nimport style from './pf-accordion-header.css';\n\nimport '@patternfly/elements/pf-icon/pf-icon.js';\n\n/**\n * Accordion Header\n *\n * @csspart text - inline element containing the heading text or slotted heading content\n * @csspart accents - container for accents within the header\n * @csspart icon - caret icon\n *\n * @slot\n * We expect the light DOM of the pf-accordion-header to be a heading level tag (h1, h2, h3, h4, h5, h6)\n * @slot accents\n * These elements will appear inline with the accordion header, between the header and the chevron\n * (or after the chevron and header in disclosure mode).\n *\n * @fires {AccordionHeaderChangeEvent} change - when the open panels change\n *\n * @cssprop {<color>} --pf-c-accordion__toggle--Color\n * Sets the font color for the accordion header.\n * {@default `var(--pf-global--Color--100, #151515)`}\n * @cssprop {<color>} --pf-c-accordion__toggle--BackgroundColor\n * Sets the background color for the accordion header toggle element.\n * {@default `transparent`}\n * @cssprop {<color>} --pf-c-accordion__toggle--after--BackgroundColor\n * Sets the background color for the after element for the accordion header toggle element.\n * {@default `transparent`}\n * @cssprop {<length>} --pf-c-accordion__toggle--PaddingTop\n * Sets the top padding for the accordion header.\n * {@default `var(--pf-global--spacer--sm, 0.5rem)`}\n * @cssprop {<length>} --pf-c-accordion__toggle--PaddingRight\n * Sets the right padding for the accordion header.\n * {@default `var(--pf-global--spacer--md, 1rem)`}\n * @cssprop {<length>} --pf-c-accordion__toggle--PaddingBottom\n * Sets the bottom padding for the accordion header.\n * {@default `var(--pf-global--spacer--sm, 0.5rem)`}\n * @cssprop {<length>} --pf-c-accordion__toggle--PaddingLeft\n * Sets the left padding for the accordion header.\n * {@default `var(--pf-global--spacer--md, 1rem)`}\n * @cssprop {<length>} --pf-c-accordion__toggle--FontSize\n * Sets the sidebar background color for the accordion header.\n * {@default `var(--pf-global--FontSize--lg, 1rem)`}\n * @cssprop {<color>} --pf-c-accordion__toggle--FontFamily\n * Sets the font family for the accordion header.\n * {@default `var(--pf-global--FontFamily--redhat-updated--heading--sans-serif, \"RedHatDisplayUpdated\", helvetica, arial, sans-serif)`}\n * @cssprop --pf-c-accordion__toggle--FontWeight\n * Sets the font weight for the accordion header.\n * {@default `var(--pf-global--FontWeight--normal, 400)`}\n * @cssprop {<color>} --pf-c-accordion__toggle--active--BackgroundColor\n * Sets the active backgrdound color for the accordion header.\n * {@default `var(--pf-global--BackgroundColor--200, #f0f0f0)`}\n * @cssprop {<color>} --pf-c-accordion__toggle--active-text--Color\n * Sets the active text color for the accordion header.\n * {@default `var(--pf-global--link--Color, #0066cc)`}\n * @cssprop --pf-c-accordion__toggle--active-text--FontWeight\n * Sets the active text font weight for the accordion header.\n * {@default `var(--pf-global--FontWeight--semi-bold, 700)`}\n * @cssprop {<color>} --pf-c-accordion__toggle--expanded--before--BackgroundColor\n * Sets the hover expanded before background color for the accordion header.\n * {@default `var(--pf-global--link--Color, #0066cc)`}\n * @cssprop --pf-c-accordion__toggle--expanded-icon--Rotate\n * Sets the expanded icon rotation degrees for the accordion header.\n * {@default `90deg`}\n * @cssprop {<length>} --pf-c-accordion__toggle-text--MaxWidth\n * Sets the max width for the text inside the accordion header.\n * {@default `calc(100% - var(--pf-global--spacer--lg, 1.5rem))`}\n * @cssprop --pf-c-accordion__toggle--before--Width\n * Sets the sidebar width for the accordion header.\n * {@default `var(--pf-global--BorderWidth--lg, 3px)`}\n * @cssprop --pf-c-accordion__toggle-icon--Transition\n * Sets the transition animation for the accordion header.\n * {@default `0.2s ease-in 0s`}\n */\n@customElement('pf-accordion-header')\nexport class PfAccordionHeader extends BaseAccordionHeader {\n static readonly styles = [...BaseAccordionHeader.styles, style];\n\n @property({ reflect: true }) bordered?: 'true' | 'false';\n\n @property({ reflect: true }) icon?: string;\n\n @property({ reflect: true, attribute: 'icon-set' }) iconSet?: string;\n\n #slots = new SlotController(this, 'accents', null);\n\n renderAfterButton() {\n return html`${!this.#slots.hasSlotted('accents') ? '' : html`\n <span part=\"accents\">\n <slot name=\"accents\"></slot>\n </span>`}\n <pf-icon part=\"icon\"\n icon=\"${this.icon ?? 'angle-right'}\"\n set=\"${this.iconSet ?? 'fas'}\"\n class=\"icon\"\n size=\"lg\"></pf-icon>\n `;\n }\n}\n\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'pf-accordion-header': PfAccordionHeader;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pf-accordion-header.js","sourceRoot":"","sources":["pf-accordion-header.ts"],"names":[],"mappings":"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","sourcesContent":["import type { PfAccordion } from './pf-accordion.js';\n\nimport { LitElement, html, type TemplateResult } from 'lit';\nimport { customElement } from 'lit/decorators/custom-element.js';\nimport { property } from 'lit/decorators/property.js';\n\nimport { SlotController } from '@patternfly/pfe-core/controllers/slot-controller.js';\nimport { Logger } from '@patternfly/pfe-core/controllers/logger.js';\n\nimport { getRandomId } from '@patternfly/pfe-core/functions/random.js';\n\nimport style from './pf-accordion-header.css';\n\nimport '@patternfly/elements/pf-icon/pf-icon.js';\n\nconst isPorHeader =\n (el: Node): el is HTMLElement =>\n el instanceof HTMLElement && !!el.tagName.match(/P|^H[1-6]/);\n\nexport class PfAccordionHeaderChangeEvent extends Event {\n declare target: PfAccordionHeader;\n constructor(\n public expanded: boolean,\n public toggle: PfAccordionHeader,\n public accordion: PfAccordion\n ) {\n super('change', { bubbles: true });\n }\n}\n\n/**\n * Accordion Header\n * @csspart text - inline element containing the heading text or slotted heading content\n * @csspart accents - container for accents within the header\n * @csspart icon - caret icon\n * @slot\n * We expect the light DOM of the pf-accordion-header to be a heading level tag (h1, h2, h3, h4, h5, h6)\n * @slot accents\n * These elements will appear inline with the accordion header, between the header and the chevron\n * (or after the chevron and header in disclosure mode).\n * @fires {AccordionHeaderChangeEvent} change - when the open panels change\n * @cssprop {<color>} [--pf-c-accordion__toggle--Color=var(--pf-global--Color--100, #151515)]\n * Sets the font color for the accordion header.\n *\n * @cssprop {<color>} [--pf-c-accordion__toggle--BackgroundColor=transparent]\n * Sets the background color for the accordion header toggle element.\n *\n * @cssprop {<color>} [--pf-c-accordion__toggle--after--BackgroundColor=transparent]\n * Sets the background color for the after element for the accordion header toggle element.\n *\n * @cssprop {<length>} [--pf-c-accordion__toggle--PaddingTop=var(--pf-global--spacer--sm, 0.5rem)]\n * Sets the top padding for the accordion header.\n *\n * @cssprop {<length>} [--pf-c-accordion__toggle--PaddingRight=var(--pf-global--spacer--md, 1rem)]\n * Sets the right padding for the accordion header.\n *\n * @cssprop {<length>} [--pf-c-accordion__toggle--PaddingBottom=var(--pf-global--spacer--sm, 0.5rem)]\n * Sets the bottom padding for the accordion header.\n *\n * @cssprop {<length>} [--pf-c-accordion__toggle--PaddingLeft=var(--pf-global--spacer--md, 1rem)]\n * Sets the left padding for the accordion header.\n *\n * @cssprop {<length>} [--pf-c-accordion__toggle--FontSize=var(--pf-global--FontSize--lg, 1rem)]\n * Sets the sidebar background color for the accordion header.\n *\n * @cssprop {<color>} [--pf-c-accordion__toggle--FontFamily=var(--pf-global--FontFamily--redhat-updated--heading--sans-serif, \"RedHatDisplayUpdated\", helvetica, arial, sans-serif)]\n * Sets the font family for the accordion header.\n *\n * @cssprop [--pf-c-accordion__toggle--FontWeight=var(--pf-global--FontWeight--normal, 400)]\n * Sets the font weight for the accordion header.\n *\n * @cssprop {<color>} [--pf-c-accordion__toggle--active--BackgroundColor=var(--pf-global--BackgroundColor--200, #f0f0f0)]\n * Sets the active backgrdound color for the accordion header.\n *\n * @cssprop {<color>} [--pf-c-accordion__toggle--active-text--Color=var(--pf-global--link--Color, #0066cc)]\n * Sets the active text color for the accordion header.\n *\n * @cssprop [--pf-c-accordion__toggle--active-text--FontWeight=var(--pf-global--FontWeight--semi-bold, 700)]\n * Sets the active text font weight for the accordion header.\n *\n * @cssprop {<color>} [--pf-c-accordion__toggle--expanded--before--BackgroundColor=var(--pf-global--link--Color, #0066cc)]\n * Sets the hover expanded before background color for the accordion header.\n *\n * @cssprop [--pf-c-accordion__toggle--expanded-icon--Rotate=90deg]\n * Sets the expanded icon rotation degrees for the accordion header.\n *\n * @cssprop {<length>} [--pf-c-accordion__toggle-text--MaxWidth=calc(100 - var(--pf-global--spacer--lg, 1.5rem))]\n * Sets the max width for the text inside the accordion header.\n *\n * @cssprop [--pf-c-accordion__toggle--before--Width=var(--pf-global--BorderWidth--lg, 3px)]\n * Sets the sidebar width for the accordion header.\n *\n * @cssprop [--pf-c-accordion__toggle-icon--Transition=0.2s ease-in 0s]\n * Sets the transition animation for the accordion header.\n *\n */\n@customElement('pf-accordion-header')\nexport class PfAccordionHeader extends LitElement {\n static readonly styles: CSSStyleSheet[] = [style];\n\n static override readonly shadowRootOptions: ShadowRootInit = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n @property({ reflect: true }) bordered?: 'true' | 'false';\n\n @property({ reflect: true }) icon?: string;\n\n @property({ reflect: true, attribute: 'icon-set' }) iconSet?: string;\n\n @property({ type: Boolean, reflect: true }) expanded = false;\n\n @property({ reflect: true, attribute: 'heading-text' }) headingText?: string;\n\n @property({ reflect: true, attribute: 'heading-tag' }) headingTag?: string;\n\n #generatedHtag?: HTMLHeadingElement;\n\n #logger = new Logger(this);\n\n #header?: HTMLElement;\n\n #slots = new SlotController(this, 'accents', null);\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.id ||= getRandomId(this.localName);\n this.#initHeader();\n }\n\n override render(): TemplateResult<1> {\n const headingText = this.headingText?.trim() ?? this.#header?.textContent?.trim();\n const content = html`\n <button id=\"button\"\n class=\"toggle\"\n @click=\"${this.#onClick}\"\n aria-expanded=\"${String(!!this.expanded) as 'true' | 'false'}\">\n <span part=\"text\">${headingText ?? html`\n <slot></slot>`}\n </span>\n <span part=\"accents\" ?hidden=\"${this.#slots.isEmpty('accents')}\">\n <slot name=\"accents\"></slot>\n </span>\n <pf-icon part=\"icon\"\n class=\"icon\"\n size=\"lg\"\n set=\"${this.iconSet ?? 'fas'}\"\n icon=\"${this.icon ?? 'angle-right'}\"\n ></pf-icon>\n </button>\n `;\n switch (this.headingTag) {\n case 'h1': return html`<h1 id=\"heading\">${content}</h1>`;\n case 'h2': return html`<h2 id=\"heading\">${content}</h2>`;\n case 'h3': return html`<h3 id=\"heading\">${content}</h3>`;\n case 'h4': return html`<h4 id=\"heading\">${content}</h4>`;\n case 'h5': return html`<h5 id=\"heading\">${content}</h5>`;\n case 'h6': return html`<h6 id=\"heading\">${content}</h6>`;\n default: return content;\n }\n }\n\n async #initHeader() {\n if (this.headingText) {\n this.headingTag ||= 'h3';\n }\n this.#header = this.#getOrCreateHeader();\n\n // prevent double-logging\n if (this.#header !== this.#generatedHtag) {\n this.#generatedHtag = undefined;\n }\n\n do {\n await this.updateComplete;\n } while (!await this.updateComplete);\n\n // Remove the hidden attribute after upgrade\n this.hidden = false;\n }\n\n #getOrCreateHeader(): HTMLElement | undefined {\n // Check if there is no nested element or nested textNodes\n if (!this.firstElementChild && !this.firstChild) {\n return void this.#logger.warn('No header content provided');\n } else if (this.firstElementChild) {\n const [heading, ...otherContent] = Array.from(this.children)\n .filter((x): x is HTMLElement => !x.hasAttribute('slot') && isPorHeader(x));\n\n // If there is no content inside the slot, return empty with a warning\n // else, if there is more than 1 element in the slot, capture the first h-tag\n if (!heading) {\n return void this.#logger.warn('No heading information was provided.');\n } else if (otherContent.length) {\n this.#logger.warn('Heading currently only supports 1 tag; extra tags will be ignored.');\n }\n return heading;\n } else {\n if (!this.#generatedHtag) {\n this.#logger.warn('Header should contain at least 1 heading tag for correct semantics.');\n }\n this.#generatedHtag = document.createElement('h3');\n\n // If a text node was provided but no semantics, default to an h3\n // otherwise, incorrect semantics were used, create an H3 and try to capture the content\n if (this.firstChild?.nodeType === Node.TEXT_NODE) {\n this.#generatedHtag.textContent = this.firstChild.textContent;\n } else {\n this.#generatedHtag.textContent = this.textContent;\n }\n\n return this.#generatedHtag;\n }\n }\n\n #onClick() {\n const expanded = !this.expanded;\n const acc = this.closest('pf-accordion');\n if (acc) {\n this.dispatchEvent(new PfAccordionHeaderChangeEvent(expanded, this, acc));\n }\n }\n}\n\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'pf-accordion-header': PfAccordionHeader;\n }\n}\n"]}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
:host {
|
|
2
|
+
display: none;
|
|
3
|
+
position: relative;
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
will-change: height;
|
|
2
6
|
color: var(--pf-global--Color--100, #151515);
|
|
3
7
|
background-color:
|
|
4
8
|
var(
|
|
@@ -16,6 +20,11 @@
|
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
.body:after {
|
|
23
|
+
content: "";
|
|
24
|
+
position: absolute;
|
|
25
|
+
top: 0;
|
|
26
|
+
bottom: 0;
|
|
27
|
+
left: 0;
|
|
19
28
|
width: var(--pf-c-accordion__panel-body--before--Width, var(--pf-global--BorderWidth--lg, 3px));
|
|
20
29
|
background-color: var(--pf-c-accordion__panel-body--before--BackgroundColor, transparent);
|
|
21
30
|
}
|
|
@@ -46,9 +55,15 @@
|
|
|
46
55
|
}
|
|
47
56
|
|
|
48
57
|
:host([fixed]) {
|
|
58
|
+
overflow-y: auto;
|
|
49
59
|
max-height: var(--pf-c-accordion__panel--m-fixed--MaxHeight, 9.375rem);
|
|
50
60
|
}
|
|
51
61
|
|
|
62
|
+
:host([expanded]) {
|
|
63
|
+
display: block;
|
|
64
|
+
position: relative;
|
|
65
|
+
}
|
|
66
|
+
|
|
52
67
|
.content[expanded],
|
|
53
68
|
:host([expanded]) .content {
|
|
54
69
|
--pf-c-accordion__panel-body--before--BackgroundColor:
|
|
@@ -1,46 +1,48 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
2
2
|
/**
|
|
3
3
|
* Accordion Panel
|
|
4
|
-
*
|
|
5
4
|
* @slot - Panel content
|
|
6
|
-
* @cssprop {<color>} --pf-c-accordion--BackgroundColor
|
|
5
|
+
* @cssprop {<color>} [--pf-c-accordion--BackgroundColor=var(--pf-global--BackgroundColor--light-100, #ffffff)]
|
|
7
6
|
* Sets the background color for the panel content.
|
|
8
|
-
*
|
|
9
|
-
* @cssprop {<color>} --pf-c-accordion__panel--Color
|
|
7
|
+
*
|
|
8
|
+
* @cssprop {<color>} [--pf-c-accordion__panel--Color=var(--pf-global--Color--dark-200, #6a6e73)]
|
|
10
9
|
* Sets the font color for the panel content.
|
|
11
|
-
*
|
|
12
|
-
* @cssprop {<length>} --pf-c-accordion__panel--FontSize
|
|
10
|
+
*
|
|
11
|
+
* @cssprop {<length>} [--pf-c-accordion__panel--FontSize=var(--pf-global--FontSize--sm, 0.875rem)]
|
|
13
12
|
* Sets the font size for the panel content.
|
|
14
|
-
*
|
|
15
|
-
* @cssprop {<color>} --pf-c-accordion__panel--content-body--before--BackgroundColor
|
|
13
|
+
*
|
|
14
|
+
* @cssprop {<color>} [--pf-c-accordion__panel--content-body--before--BackgroundColor=var(--pf-global--primary-color--100, #0066cc)]
|
|
16
15
|
* Sets the sidebar color for the panel when the context is expanded.
|
|
17
|
-
*
|
|
18
|
-
* @cssprop {<length>} --pf-c-accordion__panel--m-fixed--MaxHeight
|
|
16
|
+
*
|
|
17
|
+
* @cssprop {<length>} [--pf-c-accordion__panel--m-fixed--MaxHeight=9.375rem]
|
|
19
18
|
* Sets the maximum height for the panel content.
|
|
20
19
|
* Will only be used if the `fixed` attribute is used.
|
|
21
|
-
*
|
|
22
|
-
* @cssprop {<length>} --pf-c-accordion__panel-body--PaddingTop
|
|
20
|
+
*
|
|
21
|
+
* @cssprop {<length>} [--pf-c-accordion__panel-body--PaddingTop=var(--pf-global--spacer--sm, 0.5rem)]
|
|
23
22
|
* Sets the padding top for the panel content.
|
|
24
|
-
*
|
|
25
|
-
* @cssprop {<length>} --pf-c-accordion__panel-body--PaddingRight
|
|
23
|
+
*
|
|
24
|
+
* @cssprop {<length>} [--pf-c-accordion__panel-body--PaddingRight=var(--pf-global--spacer--md, 1rem)]
|
|
26
25
|
* Sets the padding right for the panel content.
|
|
27
|
-
*
|
|
28
|
-
* @cssprop {<length>} --pf-c-accordion__panel-body--PaddingBottom
|
|
26
|
+
*
|
|
27
|
+
* @cssprop {<length>} [--pf-c-accordion__panel-body--PaddingBottom=var(--pf-global--spacer--sm, 0.5rem)]
|
|
29
28
|
* Sets the padding bottom for the panel content.
|
|
30
|
-
*
|
|
31
|
-
* @cssprop {<length>} --pf-c-accordion__panel-body--PaddingLeft
|
|
29
|
+
*
|
|
30
|
+
* @cssprop {<length>} [--pf-c-accordion__panel-body--PaddingLeft=var(--pf-global--spacer--md, 1rem)]
|
|
32
31
|
* Sets the padding left for the panel content.
|
|
33
|
-
*
|
|
34
|
-
* @cssprop {<color>} --pf-c-accordion__panel-body--before--BackgroundColor
|
|
32
|
+
*
|
|
33
|
+
* @cssprop {<color>} [--pf-c-accordion__panel-body--before--BackgroundColor=transparent]
|
|
35
34
|
* Sets the background color for the panel content.
|
|
36
|
-
*
|
|
37
|
-
* @cssprop --pf-c-accordion__panel-body--before--Width
|
|
35
|
+
*
|
|
36
|
+
* @cssprop [--pf-c-accordion__panel-body--before--Width=var(--pf-global--BorderWidth--lg, 3px)]
|
|
38
37
|
* Sets the before width for the panel content.
|
|
39
|
-
*
|
|
38
|
+
*
|
|
40
39
|
*/
|
|
41
|
-
export declare class PfAccordionPanel extends
|
|
40
|
+
export declare class PfAccordionPanel extends LitElement {
|
|
42
41
|
static readonly styles: CSSStyleSheet[];
|
|
42
|
+
expanded: boolean;
|
|
43
43
|
bordered?: 'true' | 'false';
|
|
44
|
+
connectedCallback(): void;
|
|
45
|
+
render(): TemplateResult<1>;
|
|
44
46
|
}
|
|
45
47
|
declare global {
|
|
46
48
|
interface HTMLElementTagNameMap {
|
|
@@ -1,51 +1,37 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
+
import { LitElement, html } from 'lit';
|
|
2
3
|
import { customElement } from 'lit/decorators/custom-element.js';
|
|
3
4
|
import { property } from 'lit/decorators/property.js';
|
|
4
|
-
import {
|
|
5
|
+
import { getRandomId } from '@patternfly/pfe-core/functions/random.js';
|
|
5
6
|
import { css } from "lit";
|
|
6
|
-
const style = css `:host {\n color: var(--pf-global--Color--100, #151515);\n background-color:\n var(\n --pf-c-accordion--BackgroundColor,\n var(--pf-global--BackgroundColor--light-100, #ffffff)\n );\n}\n\n.body {\n padding:\n var(--pf-c-accordion__panel-body--PaddingTop, var(--pf-global--spacer--sm, 0.5rem))\n var(--pf-c-accordion__panel-body--PaddingRight, var(--pf-global--spacer--md, 1rem))\n var(--pf-c-accordion__panel-body--PaddingBottom, var(--pf-global--spacer--sm, 0.5rem))\n var(--pf-c-accordion__panel-body--PaddingLeft, var(--pf-global--spacer--md, 1rem));\n}\n\n.body:after {\n width: var(--pf-c-accordion__panel-body--before--Width, var(--pf-global--BorderWidth--lg, 3px));\n background-color: var(--pf-c-accordion__panel-body--before--BackgroundColor, transparent);\n}\n\n:host([large]) {\n --pf-c-accordion__panel-body--PaddingTop:\n var(--pf-c-accordion--m-display-lg__expanded-content-body--PaddingTop, 0);\n --pf-c-accordion__panel-body--PaddingRight:\n var(--pf-c-accordion--m-display-lg__expanded-content-body--PaddingRight, 1rem);\n --pf-c-accordion__panel-body--PaddingBottom:\n var(--pf-c-accordion--m-display-lg__expanded-content-body--PaddingBottom, 1.5rem);\n --pf-c-accordion__panel-body--PaddingLeft:\n var(--pf-c-accordion--m-display-lg__expanded-content-body--PaddingLeft, 1.5rem);\n --pf-c-accordion__panel--FontSize:\n var(--pf-c-accordion--m-display-lg__expanded-content--FontSize, 1rem);\n --pf-c-accordion__panel--Color:\n var(--pf-c-accordion--m-display-lg__expanded-content--Color, #151515);\n}\n\n:host([large]) .body:last-child {\n --pf-c-accordion__panel-body--PaddingBottom:\n var(--pf-c-accordion--m-display-lg__expanded-content-body--last-child--PaddingBottom, 1.5rem);\n}\n\n.content {\n color: var(--pf-c-accordion__panel--Color, var(--pf-global--Color--dark-200, #6a6e73));\n font-size: var(--pf-c-accordion__panel--FontSize, var(--pf-global--FontSize--sm, 0.875rem));\n}\n\n:host([fixed]) {\n max-height: var(--pf-c-accordion__panel--m-fixed--MaxHeight, 9.375rem);\n}\n\n.content[expanded],\n:host([expanded]) .content {\n --pf-c-accordion__panel-body--before--BackgroundColor:\n var(\n --pf-c-accordion__panel--content-body--before--BackgroundColor,\n var(--pf-global--primary-color--100, #0066cc));\n}\n`;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
* Sets the padding top for the panel content.
|
|
29
|
-
* {@default `var(--pf-global--spacer--sm, 0.5rem)`}
|
|
30
|
-
* @cssprop {<length>} --pf-c-accordion__panel-body--PaddingRight
|
|
31
|
-
* Sets the padding right for the panel content.
|
|
32
|
-
* {@default `var(--pf-global--spacer--md, 1rem)`}
|
|
33
|
-
* @cssprop {<length>} --pf-c-accordion__panel-body--PaddingBottom
|
|
34
|
-
* Sets the padding bottom for the panel content.
|
|
35
|
-
* {@default `var(--pf-global--spacer--sm, 0.5rem)`}
|
|
36
|
-
* @cssprop {<length>} --pf-c-accordion__panel-body--PaddingLeft
|
|
37
|
-
* Sets the padding left for the panel content.
|
|
38
|
-
* {@default `var(--pf-global--spacer--md, 1rem)`}
|
|
39
|
-
* @cssprop {<color>} --pf-c-accordion__panel-body--before--BackgroundColor
|
|
40
|
-
* Sets the background color for the panel content.
|
|
41
|
-
* {@default `transparent`}
|
|
42
|
-
* @cssprop --pf-c-accordion__panel-body--before--Width
|
|
43
|
-
* Sets the before width for the panel content.
|
|
44
|
-
* {@default `var(--pf-global--BorderWidth--lg, 3px)`}
|
|
45
|
-
*/
|
|
46
|
-
let PfAccordionPanel = class PfAccordionPanel extends BaseAccordionPanel {
|
|
7
|
+
const style = css `:host {\n display: none;\n position: relative;\n overflow: hidden;\n will-change: height;\n color: var(--pf-global--Color--100, #151515);\n background-color:\n var(\n --pf-c-accordion--BackgroundColor,\n var(--pf-global--BackgroundColor--light-100, #ffffff)\n );\n}\n\n.body {\n padding:\n var(--pf-c-accordion__panel-body--PaddingTop, var(--pf-global--spacer--sm, 0.5rem))\n var(--pf-c-accordion__panel-body--PaddingRight, var(--pf-global--spacer--md, 1rem))\n var(--pf-c-accordion__panel-body--PaddingBottom, var(--pf-global--spacer--sm, 0.5rem))\n var(--pf-c-accordion__panel-body--PaddingLeft, var(--pf-global--spacer--md, 1rem));\n}\n\n.body:after {\n content: "";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: var(--pf-c-accordion__panel-body--before--Width, var(--pf-global--BorderWidth--lg, 3px));\n background-color: var(--pf-c-accordion__panel-body--before--BackgroundColor, transparent);\n}\n\n:host([large]) {\n --pf-c-accordion__panel-body--PaddingTop:\n var(--pf-c-accordion--m-display-lg__expanded-content-body--PaddingTop, 0);\n --pf-c-accordion__panel-body--PaddingRight:\n var(--pf-c-accordion--m-display-lg__expanded-content-body--PaddingRight, 1rem);\n --pf-c-accordion__panel-body--PaddingBottom:\n var(--pf-c-accordion--m-display-lg__expanded-content-body--PaddingBottom, 1.5rem);\n --pf-c-accordion__panel-body--PaddingLeft:\n var(--pf-c-accordion--m-display-lg__expanded-content-body--PaddingLeft, 1.5rem);\n --pf-c-accordion__panel--FontSize:\n var(--pf-c-accordion--m-display-lg__expanded-content--FontSize, 1rem);\n --pf-c-accordion__panel--Color:\n var(--pf-c-accordion--m-display-lg__expanded-content--Color, #151515);\n}\n\n:host([large]) .body:last-child {\n --pf-c-accordion__panel-body--PaddingBottom:\n var(--pf-c-accordion--m-display-lg__expanded-content-body--last-child--PaddingBottom, 1.5rem);\n}\n\n.content {\n color: var(--pf-c-accordion__panel--Color, var(--pf-global--Color--dark-200, #6a6e73));\n font-size: var(--pf-c-accordion__panel--FontSize, var(--pf-global--FontSize--sm, 0.875rem));\n}\n\n:host([fixed]) {\n overflow-y: auto;\n max-height: var(--pf-c-accordion__panel--m-fixed--MaxHeight, 9.375rem);\n}\n\n:host([expanded]) {\n display: block;\n position: relative;\n}\n\n.content[expanded],\n:host([expanded]) .content {\n --pf-c-accordion__panel-body--before--BackgroundColor:\n var(\n --pf-c-accordion__panel--content-body--before--BackgroundColor,\n var(--pf-global--primary-color--100, #0066cc));\n}\n`;
|
|
8
|
+
let PfAccordionPanel = class PfAccordionPanel extends LitElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.expanded = false;
|
|
12
|
+
}
|
|
13
|
+
connectedCallback() {
|
|
14
|
+
super.connectedCallback();
|
|
15
|
+
this.id || (this.id = getRandomId(this.localName));
|
|
16
|
+
this.setAttribute('role', 'region');
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
return html `
|
|
20
|
+
<div tabindex="-1">
|
|
21
|
+
<div id="container" class="content" part="container">
|
|
22
|
+
<div class="body">
|
|
23
|
+
<slot></slot>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
`;
|
|
28
|
+
}
|
|
47
29
|
};
|
|
48
|
-
PfAccordionPanel.styles = [
|
|
30
|
+
PfAccordionPanel.styles = [style];
|
|
31
|
+
PfAccordionPanel.version = "4.0.0";
|
|
32
|
+
__decorate([
|
|
33
|
+
property({ type: Boolean, reflect: true })
|
|
34
|
+
], PfAccordionPanel.prototype, "expanded", void 0);
|
|
49
35
|
__decorate([
|
|
50
36
|
property({ reflect: true })
|
|
51
37
|
], PfAccordionPanel.prototype, "bordered", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pf-accordion-panel.js","sourceRoot":"","sources":["pf-accordion-panel.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"pf-accordion-panel.js","sourceRoot":"","sources":["pf-accordion-panel.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;;;AA2ChE,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;IAAzC;;QAGuC,aAAQ,GAAG,KAAK,CAAC;;IAIpD,iBAAiB;QACxB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,EAAE,KAAP,IAAI,CAAC,EAAE,GAAK,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,EAAC;QACxC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;IAEQ,MAAM;QACb,OAAO,IAAI,CAAA;;;;;;;;KAQV,CAAC;IACJ,CAAC;;AAtBe,uBAAM,GAAoB,CAAC,KAAK,CAAC,AAA3B,CAA4B;;AAEN;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAAkB;AAEhC;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAA6B;AAL9C,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB","sourcesContent":["import { LitElement, html, type TemplateResult } from 'lit';\nimport { customElement } from 'lit/decorators/custom-element.js';\nimport { property } from 'lit/decorators/property.js';\n\nimport { getRandomId } from '@patternfly/pfe-core/functions/random.js';\n\nimport style from './pf-accordion-panel.css';\n\n/**\n * Accordion Panel\n * @slot - Panel content\n * @cssprop {<color>} [--pf-c-accordion--BackgroundColor=var(--pf-global--BackgroundColor--light-100, #ffffff)]\n * Sets the background color for the panel content.\n *\n * @cssprop {<color>} [--pf-c-accordion__panel--Color=var(--pf-global--Color--dark-200, #6a6e73)]\n * Sets the font color for the panel content.\n *\n * @cssprop {<length>} [--pf-c-accordion__panel--FontSize=var(--pf-global--FontSize--sm, 0.875rem)]\n * Sets the font size for the panel content.\n *\n * @cssprop {<color>} [--pf-c-accordion__panel--content-body--before--BackgroundColor=var(--pf-global--primary-color--100, #0066cc)]\n * Sets the sidebar color for the panel when the context is expanded.\n *\n * @cssprop {<length>} [--pf-c-accordion__panel--m-fixed--MaxHeight=9.375rem]\n * Sets the maximum height for the panel content.\n * Will only be used if the `fixed` attribute is used.\n *\n * @cssprop {<length>} [--pf-c-accordion__panel-body--PaddingTop=var(--pf-global--spacer--sm, 0.5rem)]\n * Sets the padding top for the panel content.\n *\n * @cssprop {<length>} [--pf-c-accordion__panel-body--PaddingRight=var(--pf-global--spacer--md, 1rem)]\n * Sets the padding right for the panel content.\n *\n * @cssprop {<length>} [--pf-c-accordion__panel-body--PaddingBottom=var(--pf-global--spacer--sm, 0.5rem)]\n * Sets the padding bottom for the panel content.\n *\n * @cssprop {<length>} [--pf-c-accordion__panel-body--PaddingLeft=var(--pf-global--spacer--md, 1rem)]\n * Sets the padding left for the panel content.\n *\n * @cssprop {<color>} [--pf-c-accordion__panel-body--before--BackgroundColor=transparent]\n * Sets the background color for the panel content.\n *\n * @cssprop [--pf-c-accordion__panel-body--before--Width=var(--pf-global--BorderWidth--lg, 3px)]\n * Sets the before width for the panel content.\n *\n */\n@customElement('pf-accordion-panel')\nexport class PfAccordionPanel extends LitElement {\n static readonly styles: CSSStyleSheet[] = [style];\n\n @property({ type: Boolean, reflect: true }) expanded = false;\n\n @property({ reflect: true }) bordered?: 'true' | 'false';\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.id ||= getRandomId(this.localName);\n this.setAttribute('role', 'region');\n }\n\n override render(): TemplateResult<1> {\n return html`\n <div tabindex=\"-1\">\n <div id=\"container\" class=\"content\" part=\"container\">\n <div class=\"body\">\n <slot></slot>\n </div>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'pf-accordion-panel': PfAccordionPanel;\n }\n}\n"]}
|