@postnord/pn-marketweb-components 3.5.2 → 3.5.3
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/cjs/alert_exclamation_circle-24f29a5b.js +8 -0
- package/cjs/alert_exclamation_circle-24f29a5b.js.map +1 -0
- package/cjs/loader.cjs.js +1 -1
- package/cjs/pn-address-autofill.cjs.entry.js +47 -72
- package/cjs/pn-address-autofill.cjs.entry.js.map +1 -1
- package/cjs/pn-dropdown-choice-adds-row.cjs.entry.js +18 -6
- package/cjs/pn-dropdown-choice-adds-row.cjs.entry.js.map +1 -1
- package/cjs/pn-market-web-components.cjs.js +1 -1
- package/cjs/pn-marketweb-input.cjs.entry.js +2 -4
- package/cjs/pn-marketweb-input.cjs.entry.js.map +1 -1
- package/collection/components/input/pn-address-autofill/pn-address-autofill.css +6 -1
- package/collection/components/input/pn-address-autofill/pn-address-autofill.js +58 -68
- package/collection/components/input/pn-address-autofill/pn-address-autofill.js.map +1 -1
- package/collection/components/input/pn-address-autofill/pn-address-autofill.stories.js +2 -1
- package/collection/components/input/pn-address-autofill/translations.js +6 -3
- package/collection/components/input/pn-address-autofill/translations.js.map +1 -1
- package/collection/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.js +18 -6
- package/collection/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.js.map +1 -1
- package/components/alert_exclamation_circle.js +6 -0
- package/components/alert_exclamation_circle.js.map +1 -0
- package/components/pn-address-autofill.js +48 -72
- package/components/pn-address-autofill.js.map +1 -1
- package/components/pn-dropdown-choice-adds-row.js +18 -6
- package/components/pn-dropdown-choice-adds-row.js.map +1 -1
- package/components/pn-marketweb-input2.js +1 -3
- package/components/pn-marketweb-input2.js.map +1 -1
- package/esm/alert_exclamation_circle-f0fe7c7b.js +6 -0
- package/esm/alert_exclamation_circle-f0fe7c7b.js.map +1 -0
- package/esm/loader.js +1 -1
- package/esm/pn-address-autofill.entry.js +47 -72
- package/esm/pn-address-autofill.entry.js.map +1 -1
- package/esm/pn-dropdown-choice-adds-row.entry.js +18 -6
- package/esm/pn-dropdown-choice-adds-row.entry.js.map +1 -1
- package/esm/pn-market-web-components.js +1 -1
- package/esm/pn-marketweb-input.entry.js +1 -3
- package/esm/pn-marketweb-input.entry.js.map +1 -1
- package/package.json +1 -1
- package/pn-market-web-components/p-0ac30ee9.entry.js +2 -0
- package/pn-market-web-components/p-0ac30ee9.entry.js.map +1 -0
- package/pn-market-web-components/p-15d70aaf.entry.js +2 -0
- package/pn-market-web-components/p-15d70aaf.entry.js.map +1 -0
- package/pn-market-web-components/p-76c2c01f.js +2 -0
- package/pn-market-web-components/p-76c2c01f.js.map +1 -0
- package/pn-market-web-components/p-a11fdf9f.entry.js +2 -0
- package/pn-market-web-components/p-a11fdf9f.entry.js.map +1 -0
- package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
- package/pn-market-web-components/pn-market-web-components.esm.js.map +1 -1
- package/types/components/input/pn-address-autofill/pn-address-autofill.d.ts +2 -3
- package/types/components/input/pn-address-autofill/translations.d.ts +3 -0
- package/types/components.d.ts +2 -0
- package/umd/modules/@postnord/web-components/cjs/{angle_down-0b63ebde.js → chevron_down-83e72319.js} +3 -3
- package/umd/modules/@postnord/web-components/cjs/chevron_down-83e72319.js.map +1 -0
- package/umd/modules/@postnord/web-components/cjs/{angle_right-c8c55b43.js → chevron_right-aeb6aef3.js} +5 -5
- package/umd/modules/@postnord/web-components/cjs/chevron_right-aeb6aef3.js.map +1 -0
- package/umd/modules/@postnord/web-components/cjs/loader.cjs.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-accordion-row.cjs.entry.js +2 -2
- package/umd/modules/@postnord/web-components/cjs/pn-accordion-row.cjs.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-action-menu.cjs.entry.js +42 -12
- package/umd/modules/@postnord/web-components/cjs/pn-action-menu.cjs.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-button_2.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-card.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-checkbox.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-choice-chip.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-counter.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-date-picker.cjs.entry.js +22 -6
- package/umd/modules/@postnord/web-components/cjs/pn-date-picker.cjs.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-fieldset.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-file-upload.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-footer.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-header.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-input.cjs.entry.js +2 -2
- package/umd/modules/@postnord/web-components/cjs/pn-modal.cjs.entry.js +21 -7
- package/umd/modules/@postnord/web-components/cjs/pn-modal.cjs.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-multiselect.cjs.entry.js +2 -2
- package/umd/modules/@postnord/web-components/cjs/pn-multiselect.cjs.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-ocr-search.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-page-nav-dropdown-item.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-page-nav-item.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-page-nav.cjs.entry.js +2 -2
- package/umd/modules/@postnord/web-components/cjs/pn-page-nav.cjs.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-pagination.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-progress-bar.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-progress-indicator-step.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-progress-indicator-step.cjs.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-progress-indicator.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-progress-indicator.cjs.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-progress-stepper.cjs.entry.js +26 -41
- package/umd/modules/@postnord/web-components/cjs/pn-progress-stepper.cjs.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-radio-button.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-search-field.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-segment.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-segmented-control.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-select.cjs.entry.js +2 -2
- package/umd/modules/@postnord/web-components/cjs/pn-select.cjs.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-tab.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-tablist.cjs.entry.js +2 -2
- package/umd/modules/@postnord/web-components/cjs/pn-tablist.cjs.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-text-link.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-textarea.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-tile.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-toast.cjs.entry.js +25 -16
- package/umd/modules/@postnord/web-components/cjs/pn-toast.cjs.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-toggle-switch.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-tooltip.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-zipcode-search.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/postnord-web-components.cjs.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/buttons/pn-action-menu/pn-action-menu.js +41 -11
- package/umd/modules/@postnord/web-components/collection/components/buttons/pn-action-menu/pn-action-menu.js.map +1 -1
- package/umd/modules/@postnord/web-components/collection/components/content/pn-accordion/row/pn-accordion-row.js +2 -2
- package/umd/modules/@postnord/web-components/collection/components/content/pn-accordion/row/pn-accordion-row.js.map +1 -1
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-modal/pn-modal.css +92 -40
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-modal/pn-modal.js +35 -9
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-modal/pn-modal.js.map +1 -1
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-progress-bar/pn-progress-bar.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-progress-indicator/pn-progress-indicator-step/pn-progress-indicator-step.js +5 -1
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-progress-indicator/pn-progress-indicator-step/pn-progress-indicator-step.js.map +1 -1
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-progress-indicator/pn-progress-indicator.js +5 -1
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-progress-indicator/pn-progress-indicator.js.map +1 -1
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-progress-stepper/pn-progress-stepper.css +85 -9
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-progress-stepper/pn-progress-stepper.js +100 -97
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-progress-stepper/pn-progress-stepper.js.map +1 -1
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-spinner/pn-spinner.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-toast/pn-toast.css +0 -1
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-toast/pn-toast.js +24 -15
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-toast/pn-toast.js.map +1 -1
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-tooltip/pn-tooltip.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-checkbox/pn-checkbox.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-choice-chip/pn-choice-chip.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-counter/pn-counter.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-date-picker/pn-date-picker.css +2 -3
- package/umd/modules/@postnord/web-components/collection/components/input/pn-date-picker/pn-date-picker.js +22 -6
- package/umd/modules/@postnord/web-components/collection/components/input/pn-date-picker/pn-date-picker.js.map +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-fieldset/pn-fieldset.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-file-upload/pn-file-upload.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-input/pn-input.js +2 -2
- package/umd/modules/@postnord/web-components/collection/components/input/pn-multiselect/pn-multiselect.js +2 -2
- package/umd/modules/@postnord/web-components/collection/components/input/pn-multiselect/pn-multiselect.js.map +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-radio-button/pn-radio-button.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-search-field/pn-search-field.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-segmented-control/pn-segmented-control.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-segmented-control/segment/pn-segment.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-select/pn-select.js +2 -2
- package/umd/modules/@postnord/web-components/collection/components/input/pn-select/pn-select.js.map +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-textarea/pn-textarea.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-toggle-switch/pn-toggle-switch.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/layout/pn-header/pn-header.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-card/pn-card.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-footer/pn-footer.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-page-nav/dropdown-item/pn-page-nav-dropdown-item.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-page-nav/item/pn-page-nav-item.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-page-nav/menu/pn-page-nav.js +2 -2
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-page-nav/menu/pn-page-nav.js.map +1 -1
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-pagination/pn-pagination.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-tablist/pn-tablist.js +2 -2
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-tablist/pn-tablist.js.map +1 -1
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-tablist/tab/pn-tab.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-text-link/pn-text-link.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-tile/pn-tile.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/web-components/pn-ocr-search/pn-ocr-search.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/web-components/pn-zipcode-search/pn-zipcode-search.js +1 -1
- package/umd/modules/@postnord/web-components/collection/globals/types.js.map +1 -1
- package/umd/modules/@postnord/web-components/components/{angle_down.js → chevron_down.js} +3 -3
- package/umd/modules/@postnord/web-components/components/chevron_down.js.map +1 -0
- package/umd/modules/@postnord/web-components/{esm/angle_right-b52095c9.js → components/chevron_right.js} +4 -4
- package/umd/modules/@postnord/web-components/components/chevron_right.js.map +1 -0
- package/umd/modules/@postnord/web-components/components/pn-accordion-row.js +2 -2
- package/umd/modules/@postnord/web-components/components/pn-accordion-row.js.map +1 -1
- package/umd/modules/@postnord/web-components/components/pn-action-menu.js +42 -12
- package/umd/modules/@postnord/web-components/components/pn-action-menu.js.map +1 -1
- package/umd/modules/@postnord/web-components/components/pn-card.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-checkbox.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-choice-chip.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-counter.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-date-picker.js +23 -7
- package/umd/modules/@postnord/web-components/components/pn-date-picker.js.map +1 -1
- package/umd/modules/@postnord/web-components/components/pn-fieldset.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-file-upload.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-footer.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-header.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-input.js +2 -2
- package/umd/modules/@postnord/web-components/components/pn-modal.js +25 -10
- package/umd/modules/@postnord/web-components/components/pn-modal.js.map +1 -1
- package/umd/modules/@postnord/web-components/components/pn-multiselect.js +2 -2
- package/umd/modules/@postnord/web-components/components/pn-multiselect.js.map +1 -1
- package/umd/modules/@postnord/web-components/components/pn-ocr-search.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-page-nav-dropdown-item.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-page-nav-item.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-page-nav.js +2 -2
- package/umd/modules/@postnord/web-components/components/pn-page-nav.js.map +1 -1
- package/umd/modules/@postnord/web-components/components/pn-pagination.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-progress-bar2.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-progress-indicator-step.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-progress-indicator-step.js.map +1 -1
- package/umd/modules/@postnord/web-components/components/pn-progress-indicator.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-progress-indicator.js.map +1 -1
- package/umd/modules/@postnord/web-components/components/pn-progress-stepper.js +34 -48
- package/umd/modules/@postnord/web-components/components/pn-progress-stepper.js.map +1 -1
- package/umd/modules/@postnord/web-components/components/pn-radio-button.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-search-field2.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-segment.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-segmented-control.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-select2.js +2 -2
- package/umd/modules/@postnord/web-components/components/pn-select2.js.map +1 -1
- package/umd/modules/@postnord/web-components/components/pn-spinner2.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-tab.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-tablist.js +2 -2
- package/umd/modules/@postnord/web-components/components/pn-tablist.js.map +1 -1
- package/umd/modules/@postnord/web-components/components/pn-text-link2.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-textarea.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-tile.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-toast.js +25 -16
- package/umd/modules/@postnord/web-components/components/pn-toast.js.map +1 -1
- package/umd/modules/@postnord/web-components/components/pn-toggle-switch.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-tooltip.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-zipcode-search.js +1 -1
- package/umd/modules/@postnord/web-components/esm/{angle_down-d788f691.js → chevron_down-6e3fb42f.js} +3 -3
- package/umd/modules/@postnord/web-components/esm/chevron_down-6e3fb42f.js.map +1 -0
- package/umd/modules/@postnord/web-components/{components/angle_right.js → esm/chevron_right-9d9305e8.js} +4 -4
- package/umd/modules/@postnord/web-components/esm/chevron_right-9d9305e8.js.map +1 -0
- package/umd/modules/@postnord/web-components/esm/loader.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-accordion-row.entry.js +2 -2
- package/umd/modules/@postnord/web-components/esm/pn-accordion-row.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-action-menu.entry.js +42 -12
- package/umd/modules/@postnord/web-components/esm/pn-action-menu.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-button_2.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-card.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-checkbox.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-choice-chip.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-counter.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-date-picker.entry.js +23 -7
- package/umd/modules/@postnord/web-components/esm/pn-date-picker.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-fieldset.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-file-upload.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-footer.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-header.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-input.entry.js +2 -2
- package/umd/modules/@postnord/web-components/esm/pn-modal.entry.js +22 -8
- package/umd/modules/@postnord/web-components/esm/pn-modal.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-multiselect.entry.js +2 -2
- package/umd/modules/@postnord/web-components/esm/pn-multiselect.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-ocr-search.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-page-nav-dropdown-item.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-page-nav-item.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-page-nav.entry.js +2 -2
- package/umd/modules/@postnord/web-components/esm/pn-page-nav.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-pagination.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-progress-bar.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-progress-indicator-step.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-progress-indicator-step.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-progress-indicator.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-progress-indicator.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-progress-stepper.entry.js +26 -41
- package/umd/modules/@postnord/web-components/esm/pn-progress-stepper.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-radio-button.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-search-field.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-segment.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-segmented-control.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-select.entry.js +2 -2
- package/umd/modules/@postnord/web-components/esm/pn-select.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-tab.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-tablist.entry.js +2 -2
- package/umd/modules/@postnord/web-components/esm/pn-tablist.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-text-link.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-textarea.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-tile.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-toast.entry.js +25 -16
- package/umd/modules/@postnord/web-components/esm/pn-toast.entry.js.map +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-toggle-switch.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-tooltip.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-zipcode-search.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/postnord-web-components.js +1 -1
- package/umd/modules/@postnord/web-components/hydrate/index.js +204 -137
- package/umd/modules/@postnord/web-components/hydrate/index.mjs +204 -137
- package/umd/modules/@postnord/web-components/package.json +16 -14
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-7e88df1f.entry.js → p-01472170.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-ed4271af.entry.js → p-06c7e91b.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/p-06c7e91b.entry.js.map +1 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-8773152d.entry.js → p-10532427.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-ffe79fa4.entry.js → p-11ef58ab.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/p-16fb83d9.entry.js +6 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-16fb83d9.entry.js.map +1 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-d74ccbb2.entry.js → p-1cd57319.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-adc6404b.entry.js → p-1e7c31ed.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/p-1e7c31ed.entry.js.map +1 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-c2bbbcaa.entry.js → p-1fe6fc61.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-203ad7de.entry.js → p-23fdc4b6.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/p-23fdc4b6.entry.js.map +1 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-240f6613.entry.js +6 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-7ae9c053.entry.js.map → p-240f6613.entry.js.map} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-4f67fffa.entry.js → p-28357e12.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/p-28357e12.entry.js.map +1 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-c96ff403.js → p-2f7bb5e8.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/p-2f7bb5e8.js.map +1 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-5b0000e9.entry.js → p-363f578a.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-c0d19737.entry.js → p-37297b9a.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/p-49a39ea1.entry.js +6 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-49a39ea1.entry.js.map +1 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-bc95d4b0.entry.js → p-49f5fdd2.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/p-49f5fdd2.entry.js.map +1 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-b556b835.entry.js → p-4d371963.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-ab29b9c0.entry.js → p-4eaab357.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-da713fc1.entry.js → p-5ed7e9b7.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/p-617a946d.entry.js +6 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-617a946d.entry.js.map +1 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-e087c5c5.entry.js → p-63aa3911.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/p-65ae6360.entry.js +6 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-65ae6360.entry.js.map +1 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-bf015c0f.entry.js → p-699b7bde.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-9bc1d14f.entry.js → p-6f9a21be.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/p-75c5fb41.entry.js +6 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-75c5fb41.entry.js.map +1 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-bd14cdca.entry.js → p-8e07bc17.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-7bd6d804.entry.js → p-8eaa2540.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-bf967b50.js → p-99600bc7.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/p-99600bc7.js.map +1 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-ff068744.entry.js → p-9cecd28d.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-605d99df.entry.js → p-a440734f.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-b9a494ae.entry.js → p-ab553e80.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-936ed2a1.entry.js → p-ae04e001.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/p-ae04e001.entry.js.map +1 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-a4df55c4.entry.js → p-b202a599.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/p-b83e6373.entry.js +6 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-b83e6373.entry.js.map +1 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-fcd5028f.entry.js → p-bdb9bdc3.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-81f9f367.entry.js → p-cebe3a25.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-76b020f0.entry.js → p-d2f7b4a9.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-c45dc75d.entry.js → p-e8050420.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-412fc8d6.entry.js → p-eee2d131.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-d3521b5d.entry.js → p-fb5d6d47.entry.js} +2 -2
- package/umd/modules/@postnord/web-components/postnord-web-components/postnord-web-components.esm.js +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/postnord-web-components.esm.js.map +1 -1
- package/umd/modules/@postnord/web-components/types/components/buttons/pn-action-menu/pn-action-menu.d.ts +3 -0
- package/umd/modules/@postnord/web-components/types/components/feedback/pn-modal/pn-modal.d.ts +12 -2
- package/umd/modules/@postnord/web-components/types/components/feedback/pn-progress-indicator/pn-progress-indicator-step/pn-progress-indicator-step.d.ts +4 -0
- package/umd/modules/@postnord/web-components/types/components/feedback/pn-progress-indicator/pn-progress-indicator.d.ts +4 -0
- package/umd/modules/@postnord/web-components/types/components/feedback/pn-progress-stepper/pn-progress-stepper.d.ts +27 -22
- package/umd/modules/@postnord/web-components/types/components/feedback/pn-toast/pn-toast.d.ts +2 -1
- package/umd/modules/@postnord/web-components/types/components.d.ts +60 -12
- package/umd/modules/@postnord/web-components/types/globals/types.d.ts +2 -1
- package/umd/modules/@postnord/web-components/vscode-data.json +7 -3
- package/vscode-data.json +4 -0
- package/pn-market-web-components/p-59cb7166.entry.js +0 -2
- package/pn-market-web-components/p-59cb7166.entry.js.map +0 -1
- package/pn-market-web-components/p-7c3091eb.entry.js +0 -2
- package/pn-market-web-components/p-7c3091eb.entry.js.map +0 -1
- package/pn-market-web-components/p-94a69959.entry.js +0 -2
- package/pn-market-web-components/p-94a69959.entry.js.map +0 -1
- package/umd/modules/@postnord/web-components/cjs/angle_down-0b63ebde.js.map +0 -1
- package/umd/modules/@postnord/web-components/cjs/angle_right-c8c55b43.js.map +0 -1
- package/umd/modules/@postnord/web-components/components/angle_down.js.map +0 -1
- package/umd/modules/@postnord/web-components/components/angle_right.js.map +0 -1
- package/umd/modules/@postnord/web-components/esm/angle_down-d788f691.js.map +0 -1
- package/umd/modules/@postnord/web-components/esm/angle_right-b52095c9.js.map +0 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-203ad7de.entry.js.map +0 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-2615282e.entry.js +0 -6
- package/umd/modules/@postnord/web-components/postnord-web-components/p-2615282e.entry.js.map +0 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-3bd59ac8.entry.js +0 -6
- package/umd/modules/@postnord/web-components/postnord-web-components/p-3bd59ac8.entry.js.map +0 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-4f67fffa.entry.js.map +0 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-514107a5.entry.js +0 -6
- package/umd/modules/@postnord/web-components/postnord-web-components/p-514107a5.entry.js.map +0 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-6a30576b.entry.js +0 -6
- package/umd/modules/@postnord/web-components/postnord-web-components/p-6a30576b.entry.js.map +0 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-7ae9c053.entry.js +0 -6
- package/umd/modules/@postnord/web-components/postnord-web-components/p-8bc8f614.entry.js +0 -6
- package/umd/modules/@postnord/web-components/postnord-web-components/p-8bc8f614.entry.js.map +0 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-936ed2a1.entry.js.map +0 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-adc6404b.entry.js.map +0 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-bc95d4b0.entry.js.map +0 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-bf967b50.js.map +0 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-c96ff403.js.map +0 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-ed4271af.entry.js.map +0 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-fc5f9092.entry.js +0 -6
- package/umd/modules/@postnord/web-components/postnord-web-components/p-fc5f9092.entry.js.map +0 -1
- package/umd/modules/@postnord/web-components/readme.md +0 -32
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-7e88df1f.entry.js.map → p-01472170.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-8773152d.entry.js.map → p-10532427.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-ffe79fa4.entry.js.map → p-11ef58ab.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-d74ccbb2.entry.js.map → p-1cd57319.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-c2bbbcaa.entry.js.map → p-1fe6fc61.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-5b0000e9.entry.js.map → p-363f578a.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-c0d19737.entry.js.map → p-37297b9a.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-b556b835.entry.js.map → p-4d371963.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-ab29b9c0.entry.js.map → p-4eaab357.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-da713fc1.entry.js.map → p-5ed7e9b7.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-e087c5c5.entry.js.map → p-63aa3911.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-bf015c0f.entry.js.map → p-699b7bde.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-9bc1d14f.entry.js.map → p-6f9a21be.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-bd14cdca.entry.js.map → p-8e07bc17.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-7bd6d804.entry.js.map → p-8eaa2540.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-ff068744.entry.js.map → p-9cecd28d.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-605d99df.entry.js.map → p-a440734f.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-b9a494ae.entry.js.map → p-ab553e80.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-a4df55c4.entry.js.map → p-b202a599.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-fcd5028f.entry.js.map → p-bdb9bdc3.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-81f9f367.entry.js.map → p-cebe3a25.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-76b020f0.entry.js.map → p-d2f7b4a9.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-c45dc75d.entry.js.map → p-e8050420.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-412fc8d6.entry.js.map → p-eee2d131.entry.js.map} +0 -0
- /package/umd/modules/@postnord/web-components/postnord-web-components/{p-d3521b5d.entry.js.map → p-fb5d6d47.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pn-page-nav.js","sourceRoot":"","sources":["../../../../../src/components/navigation/pn-page-nav/menu/pn-page-nav.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,MAAM,EACN,KAAK,EACL,KAAK,EACL,WAAW,EAEX,KAAK,GACN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAE1F;;;;;GAKG;AAKH,MAAM,OAAO,SAAS;;;gCAuBiB,KAAK;6BACR,KAAK;8BACJ,KAAK;4BACP,KAAK;6BACE,EAAE;8BACP,KAAK;;wBAKH,KAAK;qBAElB,eAAe,MAAM,EAAE,EAAE;;IAlCjD,EAAE,CAAmB;IAErB,YAAY,CAAmB;IAC/B,UAAU,CAAc;IACxB,QAAQ,GAA+B,EAAE,CAAC;IAE1C,cAAc,CAAc;IAC5B,UAAU,CAAc;IACxB,aAAa,CAA6B;IAC1C,WAAW,CAAqC;IAEhD,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9C,kBAAkB,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAElD,QAAQ,CAAiB;IAC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AQ;wBACR,2DAAI,KAAK,EAAC,uBAAuB,EAAC,IAAI,EAAC,cAAc,GAAM;wBAC3D,2DAAI,KAAK,EAAC,sBAAsB,EAAC,IAAI,EAAC,cAAc,GAAM,CACvD,CACD;gBAEL,IAAI,CAAC,gBAAgB,IAAI,CACxB,4DAAK,KAAK,EAAE,IAAI,CAAC,kBAAkB,EAAE;oBACnC,+DAAQ,KAAK,EAAC,kBAAkB,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAC,IAAI;wBAC9E,gEAAS,IAAI,EAAE,UAAU,EAAE,KAAK,EAAC,OAAO,GAAW,CAC5C;oBAET,+DAAQ,KAAK,EAAC,mBAAmB,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAC,IAAI;wBAC9E,gEAAS,IAAI,EAAE,WAAW,EAAE,KAAK,EAAC,SAAS,GAAW,CAC/C,CACL,CACP,CACG;YAEL,IAAI,CAAC,cAAc,IAAI,CACtB,2DAAI,EAAE,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE;gBAC/C,6DAAM,IAAI,EAAC,eAAe,GAAG,CAC1B,CACN,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Element,\n Prop,\n h,\n Host,\n Listen,\n State,\n Watch,\n forceUpdate,\n EventEmitter,\n Event,\n} from '@stencil/core';\nimport { uuidv4 } from '@/globals/helpers';\nimport { angle_down, arrow_left, arrow_right } from 'pn-design-assets/pn-assets/icons.js';\n\n/**\n * @deprecated This component will be removed in v8. Please use the `pn-tablist` instead.\n * @see {@link https://portal.postnord.com/web-components/?path=/docs/components-navigation-tablist--docs} Use `pn-tablist` instead.\n *\n * @slot dropdown-item - Place your `pn-page-nav-dropdown-item` components here.\n */\n@Component({\n tag: 'pn-page-nav',\n styleUrl: 'pn-page-nav.scss',\n})\nexport class PnPageNav {\n mo: MutationObserver;\n\n navContainer: HTMLUListElement;\n navWrapper: HTMLElement;\n navItems: HTMLPnPageNavItemElement[] = [];\n\n dropdownButton: HTMLElement;\n dropdownEl: HTMLElement;\n dropdownItems: HTMLPnPageNavItemElement[];\n dropdownEls: HTMLPnPageNavDropdownItemElement[];\n\n eventHandler = this.keyboardEvents.bind(this);\n globalEventHandler = this.globalEvents.bind(this);\n\n activeBg: HTMLDivElement;\n hoverBg: HTMLDivElement;\n\n scrollRegistered: boolean = false;\n\n @Element() hostElement: HTMLElement;\n\n @State() currentSelection: HTMLElement;\n @State() showScrollArrows: boolean = false;\n @State() showLeftArrow: boolean = false;\n @State() showRightArrow: boolean = false;\n @State() dropdownOpen: boolean = false;\n @State() dropdownLinks: Array<string> = [];\n @State() dropdownActive: boolean = false;\n\n /** Currently active menu item value */\n @Prop({ mutable: true }) value: string;\n /** Pass a string which will be the text on the dropdown button. */\n @Prop() dropdown: string | boolean = false;\n /** Set a unique HTML ID. */\n @Prop() navid: string = `pn-page-nav-${uuidv4()}`;\n\n /** Emits the value of the selected item. */\n @Event() navchange: EventEmitter<string>;\n\n @Listen('itemselection')\n changeHandler({ target }) {\n this.currentSelection = target.closest('pn-page-nav-item');\n if (target.value) this.value = target.value;\n\n if (this.dropdownOpen) this.dropdownOpen = false;\n }\n\n @Listen('resize', { target: 'window' })\n handleResize() {\n this.rerender();\n }\n\n @Watch('value')\n valueHandler() {\n if (!this.value) this.currentSelection = null;\n this.calcHighlight(this.currentSelection, this.activeBg);\n\n this.navchange.emit(this.value);\n\n if (!this.dropdownActive) return;\n this.isDropdownItemActive();\n }\n\n @Watch('dropdownOpen')\n dropdownHandler() {\n if (this.dropdownOpen) {\n requestAnimationFrame(() => {\n this.addGlobalEventListeners();\n });\n\n return;\n }\n\n this.removeGlobalEventListeners();\n }\n\n /* ---------------------------------------LIFECYCLE--------------------------------------- */\n componentWillLoad() {\n if (!this.dropdown) return;\n this.dropdownEls = Array.from(this.hostElement.querySelectorAll('pn-page-nav-dropdown-item'));\n if (this.dropdownEls.length) {\n this.dropdownActive = true;\n this.initiateDropdown();\n }\n }\n\n componentDidLoad() {\n if (this.mo) this.mo.disconnect();\n this.mo = new MutationObserver(() => {\n forceUpdate(this.hostElement);\n this.setActiveNavItem();\n this.rerender();\n });\n this.mo.observe(this.hostElement, { childList: true, subtree: true });\n\n this.navWrapper = this.hostElement.querySelector('.pn-page-nav');\n this.navContainer = this.hostElement.querySelector('.pn-page-nav-items');\n this.activeBg = this.hostElement.querySelector('.pn-pn-active');\n this.hoverBg = this.hostElement.querySelector('.pn-pn-hover');\n\n this.hostElement.addEventListener('mouseover', ({ target }) =>\n this.calcHighlight(target as HTMLElement, this.hoverBg),\n );\n\n this.setActiveNavItem();\n this.rerender();\n }\n /* ---------------------------------------/LIFECYCLE--------------------------------------- */\n\n setActiveNavItem() {\n this.navItems = Array.from(this.hostElement.querySelectorAll('pn-page-nav-item'));\n this.navItems.forEach(navItemEl => {\n if (this.value === navItemEl.value) {\n this.currentSelection = navItemEl;\n } else {\n navItemEl.removeAttribute('selected');\n }\n\n navItemEl\n .querySelector('a')\n .addEventListener('focus', ({ target }) => this.calcHighlight(target as HTMLElement, this.hoverBg));\n });\n\n /* -----------------dropdown------------------ */\n if (!this.dropdownActive) return;\n this.dropdownItems = Array.from(this.hostElement.querySelectorAll('.pn-page-nav-dropdown-item'));\n\n //Check active state on each item\n this.isDropdownItemActive();\n\n //Store all values to check if dropdown button should be active\n this.dropdownLinks = this.dropdownItems.map((el, i) => {\n el.setAttribute('data-index', `${i}`);\n return (el.closest('pn-page-nav-dropdown-item') as any).value;\n });\n /* -----------------/dropdown------------------ */\n }\n\n rerender() {\n requestAnimationFrame(() => {\n this.calcHighlight(this.currentSelection, this.activeBg);\n this.scrollArrowRender();\n });\n }\n\n /*---------------------------------------HIGHLIGHT LOGIC-------------------------------------------*/\n calcHighlight(el: HTMLElement, bgEl: HTMLElement) {\n if (!el?.closest('pn-page-nav-item')) {\n bgEl?.classList.add('hidden');\n return;\n }\n\n if (bgEl) bgEl.classList.remove('hidden');\n\n const elRect = el.closest('pn-page-nav-item').getBoundingClientRect();\n const { left: hostLeft } = this.navContainer.getBoundingClientRect();\n const { left: navLeft, height: navHeight, width: navWidth } = elRect;\n\n const offset = navLeft - hostLeft + this.navContainer.scrollLeft;\n\n bgEl.style.setProperty('transform', `translate(${offset}px, -50%`);\n bgEl.style.setProperty('width', `${navWidth}px`);\n bgEl.style.setProperty('height', `${navHeight}px`);\n }\n /*---------------------------------------/HIGHLIGHT LOGIC-------------------------------------------*/\n\n /*---------------------------------------SCROLL ARROW LOGIC-------------------------------------------*/\n scrollArrowRender() {\n if (!this.navWrapper) return;\n if (this.navWrapper.scrollWidth > this.navWrapper.clientWidth) {\n this.showScrollArrows = true;\n\n if (!this.scrollRegistered) {\n this.navWrapper.addEventListener('scroll', this.scrollArrowRender.bind(this));\n this.scrollRegistered = true;\n }\n\n const amountScrolled = Math.round(this.navWrapper.scrollWidth - this.navWrapper.scrollLeft);\n const distanceToEnd = amountScrolled - this.navWrapper.clientWidth;\n const distanceToStart = this.navWrapper.scrollLeft;\n\n this.showLeftArrow = distanceToStart > 0;\n this.showRightArrow = distanceToEnd > 0;\n\n return;\n }\n\n this.showLeftArrow = false;\n this.showRightArrow = false;\n this.showScrollArrows = false;\n }\n\n scroll(val: number) {\n let amount = this.navWrapper.scrollLeft + val;\n\n this.navWrapper.scroll({\n left: amount,\n behavior: 'smooth',\n });\n }\n\n scrollArrowClasses() {\n let classNames = 'pn-pn-arrows ';\n\n if (this.showLeftArrow) classNames += 'pn-pn-left-visible ';\n if (this.showRightArrow) classNames += 'pn-pn-right-visible ';\n\n return classNames;\n }\n /*---------------------------------------/SCROLL ARROW LOGIC-------------------------------------------*/\n\n /* ---------------------------------------DROPDOWN LOGIC--------------------------------------- */\n\n initiateDropdown() {\n requestAnimationFrame(() => {\n this.dropdownButton = this.hostElement.querySelector('.pn-page-nav-dropdown-button');\n this.dropdownEl = this.hostElement.querySelector('.pn-page-nav-dropdown');\n\n this.addDropdownEventListeners();\n });\n }\n\n toggleDropdown() {\n this.dropdownOpen = !this.dropdownOpen;\n }\n\n isDropdownItemActive() {\n this.dropdownEls.forEach(el => {\n if (el.value && this.value === el.value) {\n el.setAttribute('active', 'true');\n return;\n }\n\n el.removeAttribute('active');\n });\n }\n\n /* -----------------events------------------ */\n /* -----------------temporary events------------------ */\n addDropdownEventListeners() {\n this.hostElement.addEventListener('keydown', this.eventHandler);\n this.hostElement.addEventListener('click', this.eventHandler);\n }\n\n addGlobalEventListeners() {\n const root: Document = this.hostElement.getRootNode() as Document;\n\n root.addEventListener('focusin', this.globalEventHandler);\n root.addEventListener('keydown', this.globalEventHandler);\n root.addEventListener('click', this.globalEventHandler);\n }\n\n removeGlobalEventListeners() {\n const root: Document = this.hostElement.getRootNode() as Document;\n\n root.removeEventListener('focusin', this.globalEventHandler);\n root.removeEventListener('keydown', this.globalEventHandler);\n root.removeEventListener('click', this.globalEventHandler);\n }\n /* -----------------/temporary events------------------ */\n\n /* -----------------Open dropdown with keyboard------------------ */\n keyboardEvents(e: KeyboardEvent) {\n const target: Element = e.composedPath()[0] as Element;\n\n // As long as the dropdown is closed, we only want it to react to keyboard input\n // is the user has focus on the button\n if (e.type === 'keydown') {\n if (!this.dropdownOpen && target === this.dropdownButton && ['ArrowUp', 'ArrowDown'].includes(e.code)) {\n this.dropdownOpen = true;\n\n requestAnimationFrame(() => {\n this.focusNextDropdownItem();\n });\n }\n }\n }\n /* -----------------/Open dropdown with keyboard------------------ */\n\n globalEvents(e) {\n const target: Element = e.composedPath()[0] as Element;\n\n if (e.type === 'keydown' && e.code === 'Escape') {\n this.dropdownOpen = false;\n this.dropdownButton.focus();\n }\n\n if (e.code === 'ArrowDown') this.focusNextDropdownItem();\n if (e.code === 'ArrowUp') this.focusPrevDropdownItem();\n\n if ((e.type === 'click' || e.type === 'focusin') && !this.dropdownEl.contains(target)) {\n this.dropdownOpen = false;\n }\n }\n /* -----------------/events------------------ */\n\n /* -----------------focusing------------------ */\n focusNextDropdownItem() {\n const { activeElement }: Document = this.hostElement.getRootNode() as Document;\n\n if (!activeElement.classList.contains('pn-page-nav-dropdown-item')) {\n this.dropdownItems[0].focus();\n return;\n }\n\n // focus next item\n const index = parseInt(activeElement.getAttribute('data-index'));\n\n if (index < this.dropdownItems.length - 1) {\n this.dropdownItems[index + 1].focus();\n }\n }\n\n focusPrevDropdownItem() {\n const { activeElement }: Document = this.hostElement.getRootNode() as Document;\n\n if (!activeElement.classList.contains('dropdown-item')) {\n this.dropdownItems[this.dropdownItems.length - 1].focus();\n }\n\n // focus previous item\n const index = parseInt(activeElement.getAttribute('data-index'));\n\n if (index > 0) {\n this.dropdownItems[index - 1].focus();\n return;\n }\n\n this.dropdownButton.focus();\n }\n /* -----------------/focusing------------------ */\n\n dropdownButtonClasses() {\n let classList = 'pn-page-nav-dropdown-button ';\n if (this.dropdownLinks.includes(this.value)) classList += 'pn-page-nav-dropdown-active ';\n\n return classList;\n }\n\n dropdownClasses() {\n let classList = 'pn-page-nav-dropdown ';\n\n if (this.dropdownOpen) classList += 'pn-page-nav-dropdown-open ';\n\n return classList;\n }\n /* ---------------------------------------/DROPDOWN LOGIC--------------------------------------- */\n\n render() {\n return (\n <Host>\n <div class=\"pn-page-nav-wrapper\">\n <nav class=\"pn-page-nav\">\n {this.dropdownActive && (\n <button\n type=\"button\"\n class={this.dropdownButtonClasses()}\n onClick={() => this.toggleDropdown()}\n aria-controls=\"page-nav-dropdown\"\n aria-expanded={`${this.dropdownOpen}`}\n >\n {this.dropdown}\n <pn-icon icon={angle_down} color=\"white\" small></pn-icon>\n <div class=\"pn-page-nav-divider\"></div>\n </button>\n )}\n\n <ul class=\"pn-page-nav-items\">\n <slot />\n <li class=\"pn-pn-bg pn-pn-active\" role=\"presentation\"></li>\n <li class=\"pn-pn-bg pn-pn-hover\" role=\"presentation\"></li>\n </ul>\n </nav>\n\n {this.showScrollArrows && (\n <div class={this.scrollArrowClasses()}>\n <button class=\"pn-pn-arrow-left\" onClick={() => this.scroll(-120)} tabindex=\"-1\">\n <pn-icon icon={arrow_left} color=\"white\"></pn-icon>\n </button>\n\n <button class=\"pn-pn-arrow-right\" onClick={() => this.scroll(120)} tabindex=\"-1\">\n <pn-icon icon={arrow_right} color=\"blue700\"></pn-icon>\n </button>\n </div>\n )}\n </div>\n\n {this.dropdownActive && (\n <ul id={this.navid} class={this.dropdownClasses()}>\n <slot name=\"dropdown-item\" />\n </ul>\n )}\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pn-page-nav.js","sourceRoot":"","sources":["../../../../../src/components/navigation/pn-page-nav/menu/pn-page-nav.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,MAAM,EACN,KAAK,EACL,KAAK,EACL,WAAW,EAEX,KAAK,GACN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAE5F;;;;;GAKG;AAKH,MAAM,OAAO,SAAS;;;gCAuBiB,KAAK;6BACR,KAAK;8BACJ,KAAK;4BACP,KAAK;6BACE,EAAE;8BACP,KAAK;;wBAKH,KAAK;qBAElB,eAAe,MAAM,EAAE,EAAE;;IAlCjD,EAAE,CAAmB;IAErB,YAAY,CAAmB;IAC/B,UAAU,CAAc;IACxB,QAAQ,GAA+B,EAAE,CAAC;IAE1C,cAAc,CAAc;IAC5B,UAAU,CAAc;IACxB,aAAa,CAA6B;IAC1C,WAAW,CAAqC;IA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\n EventEmitter,\n Event,\n} from '@stencil/core';\nimport { uuidv4 } from '@/globals/helpers';\nimport { chevron_down, arrow_left, arrow_right } from 'pn-design-assets/pn-assets/icons.js';\n\n/**\n * @deprecated This component will be removed in v8. Please use the `pn-tablist` instead.\n * @see {@link https://portal.postnord.com/web-components/?path=/docs/components-navigation-tablist--docs} Use `pn-tablist` instead.\n *\n * @slot dropdown-item - Place your `pn-page-nav-dropdown-item` components here.\n */\n@Component({\n tag: 'pn-page-nav',\n styleUrl: 'pn-page-nav.scss',\n})\nexport class PnPageNav {\n mo: MutationObserver;\n\n navContainer: HTMLUListElement;\n navWrapper: HTMLElement;\n navItems: HTMLPnPageNavItemElement[] = [];\n\n dropdownButton: HTMLElement;\n dropdownEl: HTMLElement;\n dropdownItems: HTMLPnPageNavItemElement[];\n dropdownEls: HTMLPnPageNavDropdownItemElement[];\n\n eventHandler = this.keyboardEvents.bind(this);\n globalEventHandler = this.globalEvents.bind(this);\n\n activeBg: HTMLDivElement;\n hoverBg: HTMLDivElement;\n\n scrollRegistered: boolean = false;\n\n @Element() hostElement: HTMLElement;\n\n @State() currentSelection: HTMLElement;\n @State() showScrollArrows: boolean = false;\n @State() showLeftArrow: boolean = false;\n @State() showRightArrow: boolean = false;\n @State() dropdownOpen: boolean = false;\n @State() dropdownLinks: Array<string> = [];\n @State() dropdownActive: boolean = false;\n\n /** Currently active menu item value */\n @Prop({ mutable: true }) value: string;\n /** Pass a string which will be the text on the dropdown button. */\n @Prop() dropdown: string | boolean = false;\n /** Set a unique HTML ID. */\n @Prop() navid: string = `pn-page-nav-${uuidv4()}`;\n\n /** Emits the value of the selected item. */\n @Event() navchange: EventEmitter<string>;\n\n @Listen('itemselection')\n changeHandler({ target }) {\n this.currentSelection = target.closest('pn-page-nav-item');\n if (target.value) this.value = target.value;\n\n if (this.dropdownOpen) this.dropdownOpen = false;\n }\n\n @Listen('resize', { target: 'window' })\n handleResize() {\n this.rerender();\n }\n\n @Watch('value')\n valueHandler() {\n if (!this.value) this.currentSelection = null;\n this.calcHighlight(this.currentSelection, this.activeBg);\n\n this.navchange.emit(this.value);\n\n if (!this.dropdownActive) return;\n this.isDropdownItemActive();\n }\n\n @Watch('dropdownOpen')\n dropdownHandler() {\n if (this.dropdownOpen) {\n requestAnimationFrame(() => {\n this.addGlobalEventListeners();\n });\n\n return;\n }\n\n this.removeGlobalEventListeners();\n }\n\n /* ---------------------------------------LIFECYCLE--------------------------------------- */\n componentWillLoad() {\n if (!this.dropdown) return;\n this.dropdownEls = Array.from(this.hostElement.querySelectorAll('pn-page-nav-dropdown-item'));\n if (this.dropdownEls.length) {\n this.dropdownActive = true;\n this.initiateDropdown();\n }\n }\n\n componentDidLoad() {\n if (this.mo) this.mo.disconnect();\n this.mo = new MutationObserver(() => {\n forceUpdate(this.hostElement);\n this.setActiveNavItem();\n this.rerender();\n });\n this.mo.observe(this.hostElement, { childList: true, subtree: true });\n\n this.navWrapper = this.hostElement.querySelector('.pn-page-nav');\n this.navContainer = this.hostElement.querySelector('.pn-page-nav-items');\n this.activeBg = this.hostElement.querySelector('.pn-pn-active');\n this.hoverBg = this.hostElement.querySelector('.pn-pn-hover');\n\n this.hostElement.addEventListener('mouseover', ({ target }) =>\n this.calcHighlight(target as HTMLElement, this.hoverBg),\n );\n\n this.setActiveNavItem();\n this.rerender();\n }\n /* ---------------------------------------/LIFECYCLE--------------------------------------- */\n\n setActiveNavItem() {\n this.navItems = Array.from(this.hostElement.querySelectorAll('pn-page-nav-item'));\n this.navItems.forEach(navItemEl => {\n if (this.value === navItemEl.value) {\n this.currentSelection = navItemEl;\n } else {\n navItemEl.removeAttribute('selected');\n }\n\n navItemEl\n .querySelector('a')\n .addEventListener('focus', ({ target }) => this.calcHighlight(target as HTMLElement, this.hoverBg));\n });\n\n /* -----------------dropdown------------------ */\n if (!this.dropdownActive) return;\n this.dropdownItems = Array.from(this.hostElement.querySelectorAll('.pn-page-nav-dropdown-item'));\n\n //Check active state on each item\n this.isDropdownItemActive();\n\n //Store all values to check if dropdown button should be active\n this.dropdownLinks = this.dropdownItems.map((el, i) => {\n el.setAttribute('data-index', `${i}`);\n return (el.closest('pn-page-nav-dropdown-item') as any).value;\n });\n /* -----------------/dropdown------------------ */\n }\n\n rerender() {\n requestAnimationFrame(() => {\n this.calcHighlight(this.currentSelection, this.activeBg);\n this.scrollArrowRender();\n });\n }\n\n /*---------------------------------------HIGHLIGHT LOGIC-------------------------------------------*/\n calcHighlight(el: HTMLElement, bgEl: HTMLElement) {\n if (!el?.closest('pn-page-nav-item')) {\n bgEl?.classList.add('hidden');\n return;\n }\n\n if (bgEl) bgEl.classList.remove('hidden');\n\n const elRect = el.closest('pn-page-nav-item').getBoundingClientRect();\n const { left: hostLeft } = this.navContainer.getBoundingClientRect();\n const { left: navLeft, height: navHeight, width: navWidth } = elRect;\n\n const offset = navLeft - hostLeft + this.navContainer.scrollLeft;\n\n bgEl.style.setProperty('transform', `translate(${offset}px, -50%`);\n bgEl.style.setProperty('width', `${navWidth}px`);\n bgEl.style.setProperty('height', `${navHeight}px`);\n }\n /*---------------------------------------/HIGHLIGHT LOGIC-------------------------------------------*/\n\n /*---------------------------------------SCROLL ARROW LOGIC-------------------------------------------*/\n scrollArrowRender() {\n if (!this.navWrapper) return;\n if (this.navWrapper.scrollWidth > this.navWrapper.clientWidth) {\n this.showScrollArrows = true;\n\n if (!this.scrollRegistered) {\n this.navWrapper.addEventListener('scroll', this.scrollArrowRender.bind(this));\n this.scrollRegistered = true;\n }\n\n const amountScrolled = Math.round(this.navWrapper.scrollWidth - this.navWrapper.scrollLeft);\n const distanceToEnd = amountScrolled - this.navWrapper.clientWidth;\n const distanceToStart = this.navWrapper.scrollLeft;\n\n this.showLeftArrow = distanceToStart > 0;\n this.showRightArrow = distanceToEnd > 0;\n\n return;\n }\n\n this.showLeftArrow = false;\n this.showRightArrow = false;\n this.showScrollArrows = false;\n }\n\n scroll(val: number) {\n let amount = this.navWrapper.scrollLeft + val;\n\n this.navWrapper.scroll({\n left: amount,\n behavior: 'smooth',\n });\n }\n\n scrollArrowClasses() {\n let classNames = 'pn-pn-arrows ';\n\n if (this.showLeftArrow) classNames += 'pn-pn-left-visible ';\n if (this.showRightArrow) classNames += 'pn-pn-right-visible ';\n\n return classNames;\n }\n /*---------------------------------------/SCROLL ARROW LOGIC-------------------------------------------*/\n\n /* ---------------------------------------DROPDOWN LOGIC--------------------------------------- */\n\n initiateDropdown() {\n requestAnimationFrame(() => {\n this.dropdownButton = this.hostElement.querySelector('.pn-page-nav-dropdown-button');\n this.dropdownEl = this.hostElement.querySelector('.pn-page-nav-dropdown');\n\n this.addDropdownEventListeners();\n });\n }\n\n toggleDropdown() {\n this.dropdownOpen = !this.dropdownOpen;\n }\n\n isDropdownItemActive() {\n this.dropdownEls.forEach(el => {\n if (el.value && this.value === el.value) {\n el.setAttribute('active', 'true');\n return;\n }\n\n el.removeAttribute('active');\n });\n }\n\n /* -----------------events------------------ */\n /* -----------------temporary events------------------ */\n addDropdownEventListeners() {\n this.hostElement.addEventListener('keydown', this.eventHandler);\n this.hostElement.addEventListener('click', this.eventHandler);\n }\n\n addGlobalEventListeners() {\n const root: Document = this.hostElement.getRootNode() as Document;\n\n root.addEventListener('focusin', this.globalEventHandler);\n root.addEventListener('keydown', this.globalEventHandler);\n root.addEventListener('click', this.globalEventHandler);\n }\n\n removeGlobalEventListeners() {\n const root: Document = this.hostElement.getRootNode() as Document;\n\n root.removeEventListener('focusin', this.globalEventHandler);\n root.removeEventListener('keydown', this.globalEventHandler);\n root.removeEventListener('click', this.globalEventHandler);\n }\n /* -----------------/temporary events------------------ */\n\n /* -----------------Open dropdown with keyboard------------------ */\n keyboardEvents(e: KeyboardEvent) {\n const target: Element = e.composedPath()[0] as Element;\n\n // As long as the dropdown is closed, we only want it to react to keyboard input\n // is the user has focus on the button\n if (e.type === 'keydown') {\n if (!this.dropdownOpen && target === this.dropdownButton && ['ArrowUp', 'ArrowDown'].includes(e.code)) {\n this.dropdownOpen = true;\n\n requestAnimationFrame(() => {\n this.focusNextDropdownItem();\n });\n }\n }\n }\n /* -----------------/Open dropdown with keyboard------------------ */\n\n globalEvents(e) {\n const target: Element = e.composedPath()[0] as Element;\n\n if (e.type === 'keydown' && e.code === 'Escape') {\n this.dropdownOpen = false;\n this.dropdownButton.focus();\n }\n\n if (e.code === 'ArrowDown') this.focusNextDropdownItem();\n if (e.code === 'ArrowUp') this.focusPrevDropdownItem();\n\n if ((e.type === 'click' || e.type === 'focusin') && !this.dropdownEl.contains(target)) {\n this.dropdownOpen = false;\n }\n }\n /* -----------------/events------------------ */\n\n /* -----------------focusing------------------ */\n focusNextDropdownItem() {\n const { activeElement }: Document = this.hostElement.getRootNode() as Document;\n\n if (!activeElement.classList.contains('pn-page-nav-dropdown-item')) {\n this.dropdownItems[0].focus();\n return;\n }\n\n // focus next item\n const index = parseInt(activeElement.getAttribute('data-index'));\n\n if (index < this.dropdownItems.length - 1) {\n this.dropdownItems[index + 1].focus();\n }\n }\n\n focusPrevDropdownItem() {\n const { activeElement }: Document = this.hostElement.getRootNode() as Document;\n\n if (!activeElement.classList.contains('dropdown-item')) {\n this.dropdownItems[this.dropdownItems.length - 1].focus();\n }\n\n // focus previous item\n const index = parseInt(activeElement.getAttribute('data-index'));\n\n if (index > 0) {\n this.dropdownItems[index - 1].focus();\n return;\n }\n\n this.dropdownButton.focus();\n }\n /* -----------------/focusing------------------ */\n\n dropdownButtonClasses() {\n let classList = 'pn-page-nav-dropdown-button ';\n if (this.dropdownLinks.includes(this.value)) classList += 'pn-page-nav-dropdown-active ';\n\n return classList;\n }\n\n dropdownClasses() {\n let classList = 'pn-page-nav-dropdown ';\n\n if (this.dropdownOpen) classList += 'pn-page-nav-dropdown-open ';\n\n return classList;\n }\n /* ---------------------------------------/DROPDOWN LOGIC--------------------------------------- */\n\n render() {\n return (\n <Host>\n <div class=\"pn-page-nav-wrapper\">\n <nav class=\"pn-page-nav\">\n {this.dropdownActive && (\n <button\n type=\"button\"\n class={this.dropdownButtonClasses()}\n onClick={() => this.toggleDropdown()}\n aria-controls=\"page-nav-dropdown\"\n aria-expanded={`${this.dropdownOpen}`}\n >\n {this.dropdown}\n <pn-icon icon={chevron_down} color=\"white\" small></pn-icon>\n <div class=\"pn-page-nav-divider\"></div>\n </button>\n )}\n\n <ul class=\"pn-page-nav-items\">\n <slot />\n <li class=\"pn-pn-bg pn-pn-active\" role=\"presentation\"></li>\n <li class=\"pn-pn-bg pn-pn-hover\" role=\"presentation\"></li>\n </ul>\n </nav>\n\n {this.showScrollArrows && (\n <div class={this.scrollArrowClasses()}>\n <button class=\"pn-pn-arrow-left\" onClick={() => this.scroll(-120)} tabindex=\"-1\">\n <pn-icon icon={arrow_left} color=\"white\"></pn-icon>\n </button>\n\n <button class=\"pn-pn-arrow-right\" onClick={() => this.scroll(120)} tabindex=\"-1\">\n <pn-icon icon={arrow_right} color=\"blue700\"></pn-icon>\n </button>\n </div>\n )}\n </div>\n\n {this.dropdownActive && (\n <ul id={this.navid} class={this.dropdownClasses()}>\n <slot name=\"dropdown-item\" />\n </ul>\n )}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -158,7 +158,7 @@ export class PnPagination {
|
|
|
158
158
|
return (h("pn-button", { arialabel: label, ariacurrent: current ? 'page' : null, href: this.getUrl(page), rel: current ? null : rel, appearance: "light", small: true, icon: icon, iconOnly: true, onPnClick: ({ detail }) => this.navigate({ page, event: detail }) }));
|
|
159
159
|
}
|
|
160
160
|
render() {
|
|
161
|
-
return (h(Host, { key: '
|
|
161
|
+
return (h(Host, { key: '1f33db59423d42f0e7803588c1792eab786b8de7' }, h("nav", { key: '540f96e45b8d9f57ee74fa64873c4386ec5c5886', id: this.paginationId, class: "pn-pagination", "aria-label": this.label || this.translate('PAGINATION') }, this.useRowList() && (h("pn-select", { key: '4819db7a03b6ce337210679a72d0e33b684015e3', class: "pn-pagination-rows", label: this.rowsLabel || this.translate('ROWS_PAGE'), onChange: event => this.setRows(event) }, this.getRowList().map(item => (h("option", { value: item, selected: this.rows === Number(item), innerHTML: `${item}` }))))), h("div", { key: '653ae1faeda706b1f58b10597f392f582e758e52', class: "pn-pagination-container", "data-right": this.useRowList() }, this.renderJumpButton(), this.renderButton({ page: 1, dataAttr: 'first' }), this.renderDivider(), h("ol", { key: 'df640b8caf32ae986dbd0523b1a782df4910026f', class: "pn-pagination-list", ref: el => (this.listElement = el) }, this.getPagination().map(item => this.renderItem(item))), this.renderDivider(true), this.renderButton({ page: this.pages, dataAttr: 'last' }), this.renderJumpButton(true)))));
|
|
162
162
|
}
|
|
163
163
|
static get is() { return "pn-pagination"; }
|
|
164
164
|
static get originalStyleUrls() {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* By PostNord.
|
|
4
4
|
*/
|
|
5
5
|
import { h, Host, forceUpdate, } from "@stencil/core";
|
|
6
|
-
import {
|
|
6
|
+
import { chevron_left, chevron_right } from "pn-design-assets/pn-assets/icons.js";
|
|
7
7
|
import translations from "./translations";
|
|
8
8
|
import { awaitTopbar, en } from "../../../globals/helpers";
|
|
9
9
|
/**
|
|
@@ -135,7 +135,7 @@ export class PnTablist {
|
|
|
135
135
|
return translations?.[prop]?.[this.language || en];
|
|
136
136
|
}
|
|
137
137
|
render() {
|
|
138
|
-
return (h(Host, { key: '
|
|
138
|
+
return (h(Host, { key: '6018119e45b053e16de64bae803b3baaaeafa41d' }, h("nav", { key: '747235504d6129e765cb87de674b7ffeac293b20', class: "pn-tablist", role: this.isMenu ? null : 'tablist', "aria-label": this.label, "data-stacked": this.stackedicons, "data-small": !this.isMenu && this.small, "data-large": this.isMenu, "data-scroll": this.showScrollArrows, ref: el => (this.tabListEl = el) }, h("slot", { key: 'a4e2d984d78fcf9d31d740865fdeb3df588dc772' }), h("div", { key: '29ee0561e19d48d4f974d3844772ca72ad6577af', class: "pn-tablist-line" }, h("div", { key: 'e6a2b93e8e1c696356ddbaff76ecaa3e7bfd3924', ref: el => (this.lineActive = el), class: "pn-tablist-line-item pn-tablist-line-active" }), h("div", { key: '2d884eeeaff74af37abbb46b6e6d6475aeafee0c', ref: el => (this.lineHovered = el), class: "pn-tablist-line-item pn-tablist-line-hovered" }))), h("div", { key: '4674ccbc7aea1a08721b11b121c2a00c56af50a6', class: "pn-tablist-scroll" }, h("pn-button", { key: '8da1137191ccf9f3e76aa05879b76634323553f8', class: "pn-tablist-arrow", "data-show": this.arrowLeft, onClick: () => this.scroll(), noTab: true, appearance: "light", variant: "outlined", icon: chevron_left, iconOnly: true, arialabel: this.translate('LEFT'), small: true }), h("pn-button", { key: '99ce43b13ad34b0326f58e92354265b8bca047e1', class: "pn-tablist-arrow", "data-show": this.arrowRight, onClick: () => this.scroll({ right: true }), noTab: true, appearance: "light", variant: "outlined", icon: chevron_right, iconOnly: true, arialabel: this.translate('RIGHT'), small: true }))));
|
|
139
139
|
}
|
|
140
140
|
static get is() { return "pn-tablist"; }
|
|
141
141
|
static get originalStyleUrls() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pn-tablist.js","sourceRoot":"","sources":["../../../../src/components/navigation/pn-tablist/pn-tablist.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,MAAM,EACN,OAAO,EACP,KAAK,EAEL,KAAK,EACL,CAAC,EACD,IAAI,EACJ,KAAK,EACL,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAGpD;;GAEG;AAKH,MAAM,OAAO,SAAS;;gCAcyB,KAAK;yBAEZ,KAAK;0BAEJ,KAAK;;;;4BASZ,KAAK;wBAEJ,IAAI;;IA5B7B,EAAE,CAAmB;IAErB,MAAM,GAAY,KAAK,CAAC;IACxB,YAAY,GAAY,KAAK,CAAC;IAE9B,SAAS,CAAc;IACvB,UAAU,CAAiB;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;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Prop,\n Listen,\n Element,\n Event,\n EventEmitter,\n State,\n h,\n Host,\n Watch,\n forceUpdate,\n} from '@stencil/core';\nimport { angle_left, angle_right } from 'pn-design-assets/pn-assets/icons.js';\nimport translations from './translations';\nimport { awaitTopbar, en } from '@/globals/helpers';\nimport type { PnLanguages } from '@/globals/types';\n\n/**\n * @slot menu - Can only be used inside of a `pn-header`. Allows the `href` attribute on the `pn-tab` when active.\n */\n@Component({\n tag: 'pn-tablist',\n styleUrl: 'pn-tablist.scss',\n})\nexport class PnTablist {\n private mo: MutationObserver;\n\n private isMenu: boolean = false;\n private isTabHovered: boolean = false;\n\n private tabListEl: HTMLElement;\n private lineActive: HTMLDivElement;\n private lineHovered: HTMLDivElement;\n private tabElement: HTMLPnTabElement;\n\n @Element() hostElement: HTMLElement;\n\n /** Display the scrolling arrows */\n @State() private showScrollArrows: boolean = false;\n /** Display the scroll arrow to the left */\n @State() private arrowLeft: boolean = false;\n /** Display the scroll arrow to the right */\n @State() private arrowRight: boolean = false;\n\n /** Give the tablist a name for screenreaders */\n @Prop() label!: string;\n /** The value of the tab that is currently active, each `<pn-tab value=\"example-value\">` also expects a unique value */\n @Prop({ reflect: true, mutable: true }) value!: string;\n /** Make the tablist smaller */\n @Prop() small?: boolean;\n /** Icons are stacked vertically instead of the default rows */\n @Prop() stackedicons: boolean = false;\n /** Manually set the language. */\n @Prop() language?: PnLanguages = null;\n\n /**\n * This will emit when a tab is changed. The detail property of the event will contain the value of the selected tab.\n * This is the event and value you listen to when you toggle the visibility among your tabpanels.\n **/\n @Event() tabchange: EventEmitter<string>;\n\n @Watch('value')\n setValue() {\n const tabs = Array.from(this.hostElement.querySelectorAll('pn-tab'));\n\n tabs.forEach(tab => {\n tab.activeTab = this.value;\n });\n }\n\n @Watch('showScrollArrows')\n scrollHandler() {\n if (this.showScrollArrows) {\n this.tabListEl.addEventListener('scroll', this.scrollIndicators.bind(this));\n } else {\n this.tabListEl.removeEventListener('scroll', this.scrollIndicators);\n }\n }\n\n @Listen('setActiveTab')\n setActiveTabHandler({ detail }) {\n this.tabElement = detail.el;\n requestAnimationFrame(() => this.activateTab(detail.el));\n if (this.value === detail.val) return;\n this.value = detail.val;\n this.tabchange.emit(this.value);\n this.tabElement.querySelector(this.isMenu ? 'a' : 'button').focus();\n }\n\n @Listen('resize', { target: 'window' })\n rerender() {\n requestAnimationFrame(() => {\n this.scrollIndicators();\n this.isTabHovered = false;\n });\n }\n\n @Listen('tabEnter')\n handleEnter(e: { target: HTMLPnTabElement }) {\n this.isTabHovered = true;\n this.styleLines(e.target);\n }\n\n @Listen('tabLeave')\n handleLeave() {\n this.isTabHovered = false;\n setTimeout(() => {\n if (!this.isTabHovered) this.lineHovered.style.setProperty('--pn-hover-opacity', '0');\n }, 500);\n }\n\n async componentWillLoad() {\n this.isMenu = this.hostElement.slot === 'menu';\n\n if (this.language === null) await awaitTopbar(this.hostElement);\n }\n\n componentDidLoad() {\n if (this.mo) this.mo.disconnect();\n this.mo = new MutationObserver(() => {\n forceUpdate(this.hostElement);\n this.rerender();\n });\n\n this.mo.observe(this.hostElement, { childList: true, subtree: true });\n }\n\n componentDidRender() {\n this.rerender();\n this.setValue();\n }\n\n private getRect(element: HTMLElement | HTMLPnTablistElement): DOMRect {\n return element.getBoundingClientRect();\n }\n\n private activateTab(element: HTMLPnTabElement) {\n this.styleLines(element, true);\n }\n\n private styleLines(element: HTMLElement, active: boolean = false) {\n const tabListCoords = this.getRect(this.tabListEl);\n const scrollOffset = this.tabListEl.scrollLeft;\n\n const line = this.getRect(element);\n\n const width = line.width;\n const offset = line.left + scrollOffset - tabListCoords.left;\n\n const cssVar = active ? 'active' : 'hover';\n const prop = active ? 'lineActive' : 'lineHovered';\n\n this[prop].style.setProperty(`--pn-${cssVar}-width`, `${width}px`);\n this[prop].style.setProperty(`--pn-${cssVar}-offset`, `${offset}px`);\n this[prop].style.setProperty(`--pn-${cssVar}-opacity`, '1');\n }\n\n private scrollIndicators() {\n const { scrollWidth, scrollLeft } = this.tabListEl;\n\n const { clientWidth } = this.hostElement;\n\n this.showScrollArrows = scrollWidth > clientWidth;\n\n this.arrowLeft = this.showScrollArrows && scrollLeft > 0;\n this.arrowRight = this.showScrollArrows && clientWidth + 16 + scrollLeft < scrollWidth;\n }\n\n private scroll({ right = false }: { right?: boolean } = {}) {\n const tabList = this.tabListEl;\n const { scrollLeft, clientWidth } = tabList;\n\n let left: number = scrollLeft;\n // The width of the scroll arrow is 32px, so we remove that from this calculation so the scroll\n const scrollAmount = clientWidth - 64;\n\n if (right) left += scrollAmount;\n else left -= scrollAmount;\n\n tabList.scrollTo({\n left,\n behavior: 'smooth',\n });\n }\n\n private translate(prop: string): string {\n return translations?.[prop]?.[this.language || en];\n }\n\n render() {\n return (\n <Host>\n <nav\n class=\"pn-tablist\"\n role={this.isMenu ? null : 'tablist'}\n aria-label={this.label}\n data-stacked={this.stackedicons}\n data-small={!this.isMenu && this.small}\n data-large={this.isMenu}\n data-scroll={this.showScrollArrows}\n ref={el => (this.tabListEl = el)}\n >\n <slot />\n <div class=\"pn-tablist-line\">\n <div ref={el => (this.lineActive = el)} class=\"pn-tablist-line-item pn-tablist-line-active\" />\n <div ref={el => (this.lineHovered = el)} class=\"pn-tablist-line-item pn-tablist-line-hovered\" />\n </div>\n </nav>\n\n <div class=\"pn-tablist-scroll\">\n <pn-button\n class=\"pn-tablist-arrow\"\n data-show={this.arrowLeft}\n onClick={() => this.scroll()}\n noTab={true}\n appearance=\"light\"\n variant=\"outlined\"\n icon={angle_left}\n iconOnly={true}\n arialabel={this.translate('LEFT')}\n small\n />\n\n <pn-button\n class=\"pn-tablist-arrow\"\n data-show={this.arrowRight}\n onClick={() => this.scroll({ right: true })}\n noTab={true}\n appearance=\"light\"\n variant=\"outlined\"\n icon={angle_right}\n iconOnly={true}\n arialabel={this.translate('RIGHT')}\n small\n />\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version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AAQ,EAAE,IAAI,EACd,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EACjC,KAAK,SACL;gBAEF,kEACE,KAAK,EAAC,kBAAkB,eACb,IAAI,CAAC,UAAU,EAC1B,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAC3C,KAAK,EAAE,IAAI,EACX,UAAU,EAAC,OAAO,EAClB,OAAO,EAAC,UAAU,EAClB,IAAI,EAAE,aAAa,EACnB,QAAQ,EAAE,IAAI,EACd,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAClC,KAAK,SACL,CACE,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Prop,\n Listen,\n Element,\n Event,\n EventEmitter,\n State,\n h,\n Host,\n Watch,\n forceUpdate,\n} from '@stencil/core';\nimport { chevron_left, chevron_right } from 'pn-design-assets/pn-assets/icons.js';\nimport translations from './translations';\nimport { awaitTopbar, en } from '@/globals/helpers';\nimport type { PnLanguages } from '@/globals/types';\n\n/**\n * @slot menu - Can only be used inside of a `pn-header`. Allows the `href` attribute on the `pn-tab` when active.\n */\n@Component({\n tag: 'pn-tablist',\n styleUrl: 'pn-tablist.scss',\n})\nexport class PnTablist {\n private mo: MutationObserver;\n\n private isMenu: boolean = false;\n private isTabHovered: boolean = false;\n\n private tabListEl: HTMLElement;\n private lineActive: HTMLDivElement;\n private lineHovered: HTMLDivElement;\n private tabElement: HTMLPnTabElement;\n\n @Element() hostElement: HTMLElement;\n\n /** Display the scrolling arrows */\n @State() private showScrollArrows: boolean = false;\n /** Display the scroll arrow to the left */\n @State() private arrowLeft: boolean = false;\n /** Display the scroll arrow to the right */\n @State() private arrowRight: boolean = false;\n\n /** Give the tablist a name for screenreaders */\n @Prop() label!: string;\n /** The value of the tab that is currently active, each `<pn-tab value=\"example-value\">` also expects a unique value */\n @Prop({ reflect: true, mutable: true }) value!: string;\n /** Make the tablist smaller */\n @Prop() small?: boolean;\n /** Icons are stacked vertically instead of the default rows */\n @Prop() stackedicons: boolean = false;\n /** Manually set the language. */\n @Prop() language?: PnLanguages = null;\n\n /**\n * This will emit when a tab is changed. The detail property of the event will contain the value of the selected tab.\n * This is the event and value you listen to when you toggle the visibility among your tabpanels.\n **/\n @Event() tabchange: EventEmitter<string>;\n\n @Watch('value')\n setValue() {\n const tabs = Array.from(this.hostElement.querySelectorAll('pn-tab'));\n\n tabs.forEach(tab => {\n tab.activeTab = this.value;\n });\n }\n\n @Watch('showScrollArrows')\n scrollHandler() {\n if (this.showScrollArrows) {\n this.tabListEl.addEventListener('scroll', this.scrollIndicators.bind(this));\n } else {\n this.tabListEl.removeEventListener('scroll', this.scrollIndicators);\n }\n }\n\n @Listen('setActiveTab')\n setActiveTabHandler({ detail }) {\n this.tabElement = detail.el;\n requestAnimationFrame(() => this.activateTab(detail.el));\n if (this.value === detail.val) return;\n this.value = detail.val;\n this.tabchange.emit(this.value);\n this.tabElement.querySelector(this.isMenu ? 'a' : 'button').focus();\n }\n\n @Listen('resize', { target: 'window' })\n rerender() {\n requestAnimationFrame(() => {\n this.scrollIndicators();\n this.isTabHovered = false;\n });\n }\n\n @Listen('tabEnter')\n handleEnter(e: { target: HTMLPnTabElement }) {\n this.isTabHovered = true;\n this.styleLines(e.target);\n }\n\n @Listen('tabLeave')\n handleLeave() {\n this.isTabHovered = false;\n setTimeout(() => {\n if (!this.isTabHovered) this.lineHovered.style.setProperty('--pn-hover-opacity', '0');\n }, 500);\n }\n\n async componentWillLoad() {\n this.isMenu = this.hostElement.slot === 'menu';\n\n if (this.language === null) await awaitTopbar(this.hostElement);\n }\n\n componentDidLoad() {\n if (this.mo) this.mo.disconnect();\n this.mo = new MutationObserver(() => {\n forceUpdate(this.hostElement);\n this.rerender();\n });\n\n this.mo.observe(this.hostElement, { childList: true, subtree: true });\n }\n\n componentDidRender() {\n this.rerender();\n this.setValue();\n }\n\n private getRect(element: HTMLElement | HTMLPnTablistElement): DOMRect {\n return element.getBoundingClientRect();\n }\n\n private activateTab(element: HTMLPnTabElement) {\n this.styleLines(element, true);\n }\n\n private styleLines(element: HTMLElement, active: boolean = false) {\n const tabListCoords = this.getRect(this.tabListEl);\n const scrollOffset = this.tabListEl.scrollLeft;\n\n const line = this.getRect(element);\n\n const width = line.width;\n const offset = line.left + scrollOffset - tabListCoords.left;\n\n const cssVar = active ? 'active' : 'hover';\n const prop = active ? 'lineActive' : 'lineHovered';\n\n this[prop].style.setProperty(`--pn-${cssVar}-width`, `${width}px`);\n this[prop].style.setProperty(`--pn-${cssVar}-offset`, `${offset}px`);\n this[prop].style.setProperty(`--pn-${cssVar}-opacity`, '1');\n }\n\n private scrollIndicators() {\n const { scrollWidth, scrollLeft } = this.tabListEl;\n\n const { clientWidth } = this.hostElement;\n\n this.showScrollArrows = scrollWidth > clientWidth;\n\n this.arrowLeft = this.showScrollArrows && scrollLeft > 0;\n this.arrowRight = this.showScrollArrows && clientWidth + 16 + scrollLeft < scrollWidth;\n }\n\n private scroll({ right = false }: { right?: boolean } = {}) {\n const tabList = this.tabListEl;\n const { scrollLeft, clientWidth } = tabList;\n\n let left: number = scrollLeft;\n // The width of the scroll arrow is 32px, so we remove that from this calculation so the scroll\n const scrollAmount = clientWidth - 64;\n\n if (right) left += scrollAmount;\n else left -= scrollAmount;\n\n tabList.scrollTo({\n left,\n behavior: 'smooth',\n });\n }\n\n private translate(prop: string): string {\n return translations?.[prop]?.[this.language || en];\n }\n\n render() {\n return (\n <Host>\n <nav\n class=\"pn-tablist\"\n role={this.isMenu ? null : 'tablist'}\n aria-label={this.label}\n data-stacked={this.stackedicons}\n data-small={!this.isMenu && this.small}\n data-large={this.isMenu}\n data-scroll={this.showScrollArrows}\n ref={el => (this.tabListEl = el)}\n >\n <slot />\n <div class=\"pn-tablist-line\">\n <div ref={el => (this.lineActive = el)} class=\"pn-tablist-line-item pn-tablist-line-active\" />\n <div ref={el => (this.lineHovered = el)} class=\"pn-tablist-line-item pn-tablist-line-hovered\" />\n </div>\n </nav>\n\n <div class=\"pn-tablist-scroll\">\n <pn-button\n class=\"pn-tablist-arrow\"\n data-show={this.arrowLeft}\n onClick={() => this.scroll()}\n noTab={true}\n appearance=\"light\"\n variant=\"outlined\"\n icon={chevron_left}\n iconOnly={true}\n arialabel={this.translate('LEFT')}\n small\n />\n\n <pn-button\n class=\"pn-tablist-arrow\"\n data-show={this.arrowRight}\n onClick={() => this.scroll({ right: true })}\n noTab={true}\n appearance=\"light\"\n variant=\"outlined\"\n icon={chevron_right}\n iconOnly={true}\n arialabel={this.translate('RIGHT')}\n small\n />\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -98,7 +98,7 @@ export class PnTab {
|
|
|
98
98
|
}
|
|
99
99
|
render() {
|
|
100
100
|
const Tag = this.tag;
|
|
101
|
-
return (h(Host, { key: '
|
|
101
|
+
return (h(Host, { key: '50c638d4e12ae9011d8efa3606499e906c9cb8c3' }, h(Tag, { key: '79baf88094716a8499801d0becaeb3a5cb3698d4', id: this.tabid, class: "pn-tab", ...this.renderProperties(), onClick: (e) => this.handleClick(e), onMouseEnter: (e) => this.triggerEnter(e), onFocus: (e) => this.triggerEnter(e), onMouseLeave: (e) => this.triggerLeave(e), onBlur: (e) => this.triggerLeave(e), onKeyDown: (e) => this.arrowKeyNav(e) }, !!this.icon && h("pn-icon", { key: '4fd00fa65a2921a5c8197085fc7c2528773b084b', icon: this.icon }), h("slot", { key: '5c72c7d4813f0644a5777b0f4d2575409fcf8c36' }), h("span", { key: 'b6ee7be6b34ac3dc234ec2bc07f948ba612992e4' }, this.label))));
|
|
102
102
|
}
|
|
103
103
|
static get is() { return "pn-tab"; }
|
|
104
104
|
static get originalStyleUrls() {
|
|
@@ -21,7 +21,7 @@ export class PnTextLink {
|
|
|
21
21
|
}
|
|
22
22
|
hostElement;
|
|
23
23
|
render() {
|
|
24
|
-
return (h("a", { key: '
|
|
24
|
+
return (h("a", { key: '88ee2cf28a906eecb3b77f3bb4c25103368a6be1', id: this.linkid, class: "pn-text-link", href: this.href, rel: this.rel, target: this.target, download: this.download, hreflang: this.hreflang, media: this.media, referrerPolicy: this.referrerpolicy, "data-icon": !!this.icon, "data-icon-left": this.leftIcon, "data-light": this.light }, this.label, h("slot", { key: 'a0ceda16a5282b86356334e0f68872bdf6ddc8dd' }), this.icon && h("pn-icon", { key: '85a9dc141e364134bb258bbdb5a7b76ad76b37bf', icon: this.icon })));
|
|
25
25
|
}
|
|
26
26
|
static get is() { return "pn-text-link"; }
|
|
27
27
|
static get originalStyleUrls() {
|
package/umd/modules/@postnord/web-components/collection/components/navigation/pn-tile/pn-tile.js
CHANGED
|
@@ -65,7 +65,7 @@ export class PnTile {
|
|
|
65
65
|
this.pnTile.emit({ click: event });
|
|
66
66
|
}
|
|
67
67
|
render() {
|
|
68
|
-
return (h(Host, { key: '
|
|
68
|
+
return (h(Host, { key: 'c24ec58a47482a67e27c1266accd657cf3e8c54a' }, h("div", { key: '23727e1b4212192010c81fcb7af59f60fede0152', class: "pn-tile", "data-horizontal": this.horizontal, "data-href": !!this.url, "data-focus": this.visibleOutline, ref: el => (this.tile = el) }, h("div", { key: 'b4bd44255ab53ef2dfb130e02aac7809aebcc16b', class: "pn-tile-illustration", "data-circle": !!this.url, "data-icon": this.showIcon(), role: "presentation", hidden: !this.showImage() }, this.showPropIllustration() ? (h("pn-illustration", { illustration: this.illustration })) : (this.showIcon() && h("pn-icon", { color: "blue700", icon: this.icon })), h("div", { key: '3133bd22a2be6d3625dcbe879f98d6aa0c0de723', class: "pn-tile-illustration-slot", hidden: !this.showSlotIllustration(), ref: el => (this.illustrationSlot = el) }, h("slot", { key: '6a87734eb323047682be191c51d58c1f857df589', name: "illustration" }))), h("div", { key: '2a96a865bc30e22c0d4133273b7bbeea81564bce', class: "pn-tile-text" }, h("h3", { key: 'bb9762e899ddb2b879151031b0ad65e61521956e', class: "pn-tile-title" }, this.url ? (h("a", { class: "pn-tile-link", href: this.url, target: this.target, rel: !this.rel && this.isExternal() ? 'noopener noreferrer' : this.rel, onClick: e => this.clickHandler(e), onFocus: event => this.handleFocus(event), onBlur: event => this.handleFocus(event) }, this.label)) : (this.label), this.isExternal() && h("pn-icon", { key: '97a513fdb9c6daedbf5a8b2614a06bbc5baafb01', icon: open_in_new, small: true, color: "blue700" })), h("div", { key: '9d136471d950acd8c7934da681a9a5f332f0fa95', class: "pn-tile-slot" }, !!this.text && h("p", { key: 'abc6a5b7bef04f7708ff22550a8354db625ad94c', class: "pn-tile-paragraph" }, this.text), h("slot", { key: '7df167c895e2b9cde15326b5f22f222e89690971' }))))));
|
|
69
69
|
}
|
|
70
70
|
static get is() { return "pn-tile"; }
|
|
71
71
|
static get originalStyleUrls() {
|
|
@@ -73,7 +73,7 @@ export class PnOcrSearch {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
render() {
|
|
76
|
-
return (h(Host, { key: '
|
|
76
|
+
return (h(Host, { key: '917961782b3f330e4271aa6f25427c36398c252e' }, h("pn-search-field", { key: 'e04856aba0427ece6d332e8375313d87212106af', loading: this.loading, label: this.getTranslation('SEARCH_BUTTON'), button: "icon", buttonLabel: this.getTranslation('SEARCH_BUTTON'), placeholder: this.getTranslation('PLACEHOLDER_TEXT'), onSearch: e => this.handleSearch(e) }), this.renderSearchResult(), this.renderErrorMessage()));
|
|
77
77
|
}
|
|
78
78
|
static get is() { return "pn-ocr-search"; }
|
|
79
79
|
static get originalStyleUrls() {
|
|
@@ -84,7 +84,7 @@ export class PnZipcodeSearch {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
render() {
|
|
87
|
-
return (h(Host, { key: '
|
|
87
|
+
return (h(Host, { key: 'cc6f1ccb014330d11b8b75fa09e2f39da079a7f4' }, h("pn-search-field", { key: '60bbf5751e937c820afbf997a3f51ba9ac85d762', label: this.translation('PLACEHOLDER_TEXT'), value: this.value, searchid: this.searchId, loading: this.loading, button: "icon", buttonLabel: this.translation('SEARCH'), placeholder: this.translation('PLACEHOLDER_TEXT'), onSearch: e => this.handleSearch(e.detail) }), this.renderSearchResult(), this.renderErrorMessage()));
|
|
88
88
|
}
|
|
89
89
|
static get is() { return "pn-zipcode-search"; }
|
|
90
90
|
static get originalStyleUrls() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/globals/types.ts"],"names":[],"mappings":"","sourcesContent":["import { SE, DK, FI, NO, sv, en, da, fi, no } from './helpers';\nimport * as colors from 'pn-design-assets/pn-assets/colors.js';\n\nexport interface PnUploadFileItem {\n uuid: string;\n filename: string;\n filesize: number;\n progress: number;\n status: 'queue' | 'start' | 'completed' | 'error';\n base64: string;\n contentType: string;\n error: any;\n errorMessage: string;\n file: File;\n xhr: XMLHttpRequest;\n xhrPromise?: () => Promise<any>;\n}\n\nexport type PnMarkets = '' | typeof SE | typeof DK | typeof FI | typeof NO;\nexport type PnLanguages = '' | typeof sv | typeof en | typeof da | typeof fi | typeof no;\n\nexport type PnButtonAppearance = '' | 'light' | 'warning';\nexport type PnButtonVariant = '' | 'outlined' | 'borderless';\n\nexport type PnColors = keyof typeof colors;\n\
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/globals/types.ts"],"names":[],"mappings":"","sourcesContent":["import { SE, DK, FI, NO, sv, en, da, fi, no } from './helpers';\nimport * as colors from 'pn-design-assets/pn-assets/colors.js';\n\nexport interface PnUploadFileItem {\n uuid: string;\n filename: string;\n filesize: number;\n progress: number;\n status: 'queue' | 'start' | 'completed' | 'error';\n base64: string;\n contentType: string;\n error: any;\n errorMessage: string;\n file: File;\n xhr: XMLHttpRequest;\n xhrPromise?: () => Promise<any>;\n}\n\nexport type PnMarkets = '' | typeof SE | typeof DK | typeof FI | typeof NO;\nexport type PnLanguages = '' | typeof sv | typeof en | typeof da | typeof fi | typeof no;\n\nexport type PnButtonAppearance = '' | 'light' | 'warning';\nexport type PnButtonVariant = '' | 'outlined' | 'borderless';\n\nexport type PnColors = keyof typeof colors;\n\n/** @deprecated Its just numbers now. */\nexport type PnSteps = number;\nexport type PnStepProps = 'totalSteps' | 'currentStep';\n\nexport interface PnTopbar {\n hasLoaded: boolean;\n market: PnMarkets;\n language: PnLanguages;\n}\n\nexport interface PnMultiselectSubOption {\n /** Set the label for the option, **required**. */\n label: string;\n /** Set the value for the option, **required**. */\n value: string;\n /** Set the status of the option, **required**. */\n checked: boolean;\n /** Display a helpertext for the option, optional. */\n helpertext?: string;\n /** Display an icon for the option. optional. */\n icon?: string;\n /** Use a custom HTML id, optional. */\n id?: string;\n /** Invalid */\n invalid?: boolean;\n /** Set the option as disabled, optional. */\n disabled?: boolean;\n /** Internal use for the search feature. Do not use manually. */\n hide?: boolean;\n}\n\nexport interface PnMultiselectOption extends PnMultiselectSubOption {\n /** The list of items that will be nested under this option. */\n group?: PnMultiselectSubOption[];\n}\n\n/** This is the default option. A `label` and `value` is required. */\nexport interface PnActionMenuOption {\n /** The label of the button. */\n label: string;\n /**\n * Used as a unique identifier when toggling the menus.\n * Also acts as the value for the checkbox/radio if the `input` prop is used.\n **/\n value: string;\n /** Set a custom SVG icon for the option. */\n icon?: string;\n /** Set a custom SVG icon that appears as a suffix. */\n trailingIcon?: string;\n /** Set a short `string` suffix for the option. */\n suffix?: string;\n /** Disable the button. @see Requires {@link PnActionMenuInput.input input} or default button. */\n disabled?: boolean;\n /** Display a helpertext for the option. Has no effect on {@link PnActionMenuLink}. */\n helpertext?: string;\n}\n\n/** Create a link inside the action menu. */\nexport interface PnActionMenuLink extends PnActionMenuOption {\n /** Setting a `href` will turn the option into a link option. **/\n href?: string;\n /** Set the `href` target. The value `_blank` will add the `open_in_new` icon automatically. @see **Requires** {@link href} */\n target?: string;\n}\n\n/** Allow the user to toggle the option with the {@link PnActionMenuInput.input input} prop. */\nexport interface PnActionMenuInput extends PnActionMenuOption {\n /** Turn the option into a `checkbox` or `radio` button. */\n input?: 'checkbox' | 'radio';\n /** Pre-check the option. @see **Requires** {@link input} */\n checked?: boolean;\n /** The `name` property used for the input. @see **Requires** {@link input} */\n name?: string;\n}\n\n/** Create a group of options. */\nexport interface PnActionMenuGroup extends PnActionMenuOption {\n /**\n * Create a collection of `PnActionMenuOption`s. This group will be visible without the need to toggle.\n * @see {@link label} will act as the label for this collection. Not a separate button.\n */\n group?: PnActionMenuItem[];\n}\n\n/** Create a nested sub menu that you must explicitly toggle to view. */\nexport interface PnActionMenuSubMenu extends PnActionMenuOption {\n /** Assign the array of {@link PnActionMenuItem} objects. */\n options?: PnActionMenuItem[];\n}\n\n/**\n * The label and value property are required for every `pn-action-menu` option.\n *\n * See individual items for exact type:\n * - {@link PnActionMenuOption}\n * - {@link PnActionMenuLink}\n * - {@link PnActionMenuInput}\n *\n * Group multiple items inside one of the following:\n * - {@link PnActionMenuGroup}\n * - {@link PnActionMenuSubMenu}\n */\nexport interface PnActionMenuItem\n extends PnActionMenuOption,\n PnActionMenuLink,\n PnActionMenuInput,\n PnActionMenuGroup,\n PnActionMenuSubMenu {}\nexport interface PnPaginationItem {\n page: number;\n index: number;\n}\n\nexport type PnZipCodeSearchLanguages = '' | typeof sv | typeof en;\n\nexport type PnMeasurements = {\n /** The elements height upwards. */\n hUp: number;\n /** The elements height downwards. */\n hDown: number;\n /** Space available upwards */\n sUp: number;\n /** Space available downwards */\n sDown: number;\n};\n"]}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* By PostNord.
|
|
4
4
|
*/
|
|
5
5
|
const icon = '<svg class="pn-icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M12.707 16.707a1 1 0 0 1-1.414 0l-8-8a1 1 0 0 1 1.414-1.414L12 14.586l7.293-7.293a1 1 0 1 1 1.414 1.414z" clip-rule="evenodd"/></svg>';
|
|
6
|
-
const
|
|
6
|
+
const chevron_down = icon;
|
|
7
7
|
|
|
8
|
-
export {
|
|
8
|
+
export { chevron_down as c };
|
|
9
9
|
|
|
10
|
-
//# sourceMappingURL=
|
|
10
|
+
//# sourceMappingURL=chevron_down.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"chevron_down.js","mappings":";;;;AAAA,MAAM,IAAI,GAAG,4QAA4Q,CAAC;AAC9Q,MAAC,YAAY,GAAG;;;;","names":[],"sources":["node_modules/pn-design-assets/pn-assets/icons/chevron_down.js"],"sourcesContent":["const icon = '<svg class=\"pn-icon-svg\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"#000\" fill-rule=\"evenodd\" d=\"M12.707 16.707a1 1 0 0 1-1.414 0l-8-8a1 1 0 0 1 1.414-1.414L12 14.586l7.293-7.293a1 1 0 1 1 1.414 1.414z\" clip-rule=\"evenodd\"/></svg>';\nexport const chevron_down = icon;\nexport const chevronDown = icon;\n"],"version":3}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* By PostNord.
|
|
4
4
|
*/
|
|
5
5
|
const icon$1 = '<svg class="pn-icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M6.293 12.707a1 1 0 0 1 0-1.414l8-8a1 1 0 1 1 1.414 1.414L8.414 12l7.293 7.293a1 1 0 0 1-1.414 1.414z" clip-rule="evenodd"/></svg>';
|
|
6
|
-
const
|
|
6
|
+
const chevron_left = icon$1;
|
|
7
7
|
|
|
8
8
|
const icon = '<svg class="pn-icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M17.707 11.293a1 1 0 0 1 0 1.414l-8 8a1 1 0 0 1-1.414-1.414L15.586 12 8.293 4.707a1 1 0 0 1 1.414-1.414z" clip-rule="evenodd"/></svg>';
|
|
9
|
-
const
|
|
9
|
+
const chevron_right = icon;
|
|
10
10
|
|
|
11
|
-
export {
|
|
11
|
+
export { chevron_right as a, chevron_left as c };
|
|
12
12
|
|
|
13
|
-
//# sourceMappingURL=
|
|
13
|
+
//# sourceMappingURL=chevron_right.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"chevron_right.js","mappings":";;;;AAAA,MAAMA,MAAI,GAAG,yQAAyQ,CAAC;AAC3Q,MAAC,YAAY,GAAGA;;ACD5B,MAAM,IAAI,GAAG,4QAA4Q,CAAC;AAC9Q,MAAC,aAAa,GAAG;;;;","names":["icon"],"sources":["node_modules/pn-design-assets/pn-assets/icons/chevron_left.js","node_modules/pn-design-assets/pn-assets/icons/chevron_right.js"],"sourcesContent":["const icon = '<svg class=\"pn-icon-svg\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"#000\" fill-rule=\"evenodd\" d=\"M6.293 12.707a1 1 0 0 1 0-1.414l8-8a1 1 0 1 1 1.414 1.414L8.414 12l7.293 7.293a1 1 0 0 1-1.414 1.414z\" clip-rule=\"evenodd\"/></svg>';\nexport const chevron_left = icon;\nexport const chevronLeft = icon;\n","const icon = '<svg class=\"pn-icon-svg\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"#000\" fill-rule=\"evenodd\" d=\"M17.707 11.293a1 1 0 0 1 0 1.414l-8 8a1 1 0 0 1-1.414-1.414L15.586 12 8.293 4.707a1 1 0 0 1 1.414-1.414z\" clip-rule=\"evenodd\"/></svg>';\nexport const chevron_right = icon;\nexport const chevronRight = icon;\n"],"version":3}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* By PostNord.
|
|
4
4
|
*/
|
|
5
5
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
6
|
-
import {
|
|
6
|
+
import { c as chevron_down } from './chevron_down.js';
|
|
7
7
|
import { o as ripple, r as reduceMotion } from './helpers.js';
|
|
8
8
|
import { d as defineCustomElement$2 } from './pn-icon2.js';
|
|
9
9
|
|
|
@@ -110,7 +110,7 @@ const PnAccordionRow$1 = /*@__PURE__*/ proxyCustomElement(class PnAccordionRow e
|
|
|
110
110
|
this.animation.cancel();
|
|
111
111
|
}
|
|
112
112
|
render() {
|
|
113
|
-
return (h(Host, { key: '
|
|
113
|
+
return (h(Host, { key: '0dcedaab706f95589734c04230abbdbeca16cdf1' }, h("details", { key: '58bead8dce64594af81aae11a42beea75ba0db88', class: "pn-accordion-row", open: this.state, ref: (el) => (this.details = el) }, h("summary", { key: '7447539647210cb5b132ce16d7019e310c8ca1f4', id: this.buttonid, class: "pn-accordion-row-summary", onClick: e => this.clickHandler(e), ref: el => (this.summary = el) }, h("div", { key: '83c87346e27703cab3203920848691fc8d3d007f', class: "pn-accordion-row-text", "data-transparent": this.transparent }, this.label ? this.label : '', h("slot", { key: '8904be6cbec811925b0fa935ed10c4b7bc12fb5d', name: "label" }), h("pn-icon", { key: 'cf71062d11b3a20c106dec2bec2aab1dc4bf0c7f', class: "pn-accordion-row-icon", icon: chevron_down }))), h("div", { key: 'ae73f9fa6e7121352979ec2dad9a4620cff58a91', id: this.contentid, class: "pn-accordion-row-content", ref: (el) => (this.content = el) }, h("slot", { key: '4d7d894af656c1b7e95028832611530d04f3d439' })))));
|
|
114
114
|
}
|
|
115
115
|
static get style() { return PnAccordionRowStyle0; }
|
|
116
116
|
}, [4, "pn-accordion-row", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"pn-accordion-row.js","mappings":";;;;;;;;;AAAA,MAAM,iBAAiB,GAAG,ykEAAykE,CAAC;AACpmE,6BAAe,iBAAiB;;MCkBnBA,gBAAc;;;;;yBAWJ,KAAK;2BACH,KAAK;;qBAKe,KAAK;;;2BAOjB,KA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AC,OAAO,GAAG,EAAE,CAAC,IACtG,gEACE,EAAE,EAAE,IAAI,CAAC,QAAQ,EACjB,KAAK,EAAC,0BAA0B,EAChC,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAClC,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,IAE9B,4DAAK,KAAK,EAAC,uBAAuB,sBAAmB,IAAI,CAAC,WAAW,IAClE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,EAAE,EAC7B,6DAAM,IAAI,EAAC,OAAO,GAAG,EAErB,gEAAS,KAAK,EAAC,uBAAuB,EAAC,IAAI,EAAE,UAAU,GAAI,CACvD,CACE,EAEV,4DAAK,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,EAAC,0BAA0B,EAAC,GAAG,EAAE,CAAC,EAAkB,MAAM,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,IACxG,8DAAQ,CACJ,CACE,CACL,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["PnAccordionRow"],"sources":["src/components/content/pn-accordion/row/pn-accordion-row.scss?tag=pn-accordion-row","src/components/content/pn-accordion/row/pn-accordion-row.tsx"],"sourcesContent":["@use 'src/globals/main';\n\npn-accordion-row {\n position: relative;\n margin: 0 -0.25em 0;\n}\n\npn-accordion-row .pn-accordion-row {\n width: 100%;\n display: flex;\n flex-direction: column;\n\n &-summary {\n color: main.$gray900;\n position: relative;\n border: none;\n outline: 0;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n\n width: 100%;\n padding: 0.25em;\n font-size: 1em;\n font-weight: 400;\n border-radius: 0.5em;\n\n list-style: none;\n\n &:hover > .pn-accordion-row-text {\n background-color: main.$blue50;\n }\n\n &:focus-visible > .pn-accordion-row-text {\n @include main.pn-focus-visible();\n }\n\n &::-webkit-details-marker {\n display: none;\n }\n }\n\n &-text {\n position: relative;\n overflow: hidden;\n display: flex;\n align-items: center;\n padding: 0.75em;\n background-color: main.$white;\n border-radius: 0.5em;\n -webkit-tap-highlight-color: transparent;\n\n &[data-transparent] {\n background-color: transparent;\n }\n\n @include main.pn-focus-base();\n @include main.pn-transition('background-color, outline-color');\n @include main.pn-ripple(main.$blue700);\n }\n\n &-icon {\n margin-left: auto;\n flex-shrink: 0;\n @include main.pn-transition('transform');\n path {\n fill: main.$blue700;\n }\n }\n\n &[open] .pn-accordion-row-icon {\n transform: rotate(-180deg);\n }\n\n &-content {\n color: main.$gray900;\n display: block;\n padding: 1em;\n }\n}\n","import { Component, h, Host, Element, Event, EventEmitter, Prop, State, Listen } from '@stencil/core';\nimport { angle_down } from 'pn-design-assets/pn-assets/icons.js';\nimport { reduceMotion, ripple } from '@/index';\n\n/**\n * Use this row component inside a `pn-accordion` to create an accordion group.\n *\n * **Note**: you can use the `pn-accordion-row` without the parent accordion.\n * But you will have to style the gap between each row.\n *\n * @slot label - Include your own HTML as the label.\n * ```\n * <h3 slot=\"label\">Custom title</h3>\n * ```\n */\n@Component({\n tag: 'pn-accordion-row',\n styleUrl: 'pn-accordion-row.scss',\n})\nexport class PnAccordionRow {\n private details: HTMLDetailsElement;\n private summary: HTMLElement;\n private content: HTMLDivElement;\n private animation: Animation;\n\n private readonly defaultAnimationDuration: number = 400;\n private animationDuration: number = this.defaultAnimationDuration;\n\n @Element() hostElement: HTMLElement;\n\n @State() isClosing = false;\n @State() isExpanding = false;\n\n /** The label/title of the accordion row, you can also pass a slot with the name \"label\" if you want to put custom HTML content in there. */\n @Prop({ mutable: true }) label: string;\n /** The open/close status of the accordion row. */\n @Prop({ mutable: true }) state?: boolean = false;\n\n /** Optional unique id for the `summary` element. @category ID */\n @Prop() buttonid?: string;\n /** Optional unique id for the `div` element containing the content. @category ID */\n @Prop() contentid?: string;\n /** Optional prop that removes the default white background on the accordion row */\n @Prop() transparent: boolean = false;\n\n /** Dispatched every time the row is toggled. Includes the row element and the boolean `state` prop. */\n @Event() togglerow: EventEmitter<{ element: HTMLElement; state: Boolean }>;\n\n /** Internal function for closing rows when using the `single` prop on the `pn-accordion`. */\n @Listen('rowstate')\n handleRowState(event: CustomEvent) {\n if (event.detail !== this.state) {\n this.details.style.overflow = 'hidden';\n this.closeAccordion();\n }\n }\n\n componentWillLoad() {\n const slottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.label = slottedLabel ? null : this.label;\n }\n\n private toggleOpen(open?: boolean) {\n const state = open ?? !this.state;\n if (this.state !== open) this.togglerow.emit({ element: this.details, state });\n this.state = state;\n }\n\n private clickHandler(e: MouseEvent) {\n e.preventDefault();\n\n this.details.style.overflow = 'hidden';\n\n if (this.isClosing || !this.state) this.openAccordion();\n else if (this.isClosing || this.state) this.closeAccordion();\n\n const { x, width, y, top } = this.hostElement.getBoundingClientRect();\n const clientCor = e.clientX === 0 && e.clientY === 0 ? { clientX: x + width - 24, clientY: y - top } : e;\n\n ripple(clientCor, this.hostElement, '.pn-accordion-row-text');\n }\n\n private openAccordion() {\n this.details.style.height = `${this.details.offsetHeight}px`;\n this.toggleOpen(true);\n\n requestAnimationFrame(() => {\n this.isExpanding = true;\n\n const startHeight = `${this.details.offsetHeight}px`;\n const endHeight = `${this.summary.offsetHeight + this.content.offsetHeight}px`;\n\n this.cancelAnimations();\n\n this.animate(true, startHeight, endHeight);\n });\n }\n\n private closeAccordion() {\n this.isClosing = true;\n\n const startHeight = `${this.details.offsetHeight}px`;\n const endHeight = `${this.summary.offsetHeight}px`;\n\n this.cancelAnimations();\n\n this.animate(false, startHeight, endHeight);\n }\n\n private animate(open: boolean, startHeight: string, endHeight: string) {\n if (reduceMotion()) this.animationDuration = 0;\n else this.animationDuration = this.defaultAnimationDuration;\n\n this.animation = this.details.animate(\n {\n height: [startHeight, endHeight],\n },\n {\n duration: this.animationDuration,\n easing: 'cubic-bezier(0.6, 0, 0.2, 1)',\n },\n );\n\n this.animation.onfinish = () => this.animationFinish(open);\n\n this.animation.oncancel = () => {\n if (open) this.isExpanding = false;\n else this.isClosing = false;\n };\n }\n\n private animationFinish(open: boolean) {\n this.toggleOpen(open);\n this.cancelAnimations();\n\n this.isClosing = false;\n this.isExpanding = false;\n\n this.details.style.height = '';\n this.details.style.overflow = '';\n }\n\n private cancelAnimations() {\n if (this.animation) this.animation.cancel();\n }\n\n render() {\n return (\n <Host>\n <details class=\"pn-accordion-row\" open={this.state} ref={(el: HTMLDetailsElement) => (this.details = el)}>\n <summary\n id={this.buttonid}\n class=\"pn-accordion-row-summary\"\n onClick={e => this.clickHandler(e)}\n ref={el => (this.summary = el)}\n >\n <div class=\"pn-accordion-row-text\" data-transparent={this.transparent}>\n {this.label ? this.label : ''}\n <slot name=\"label\" />\n\n <pn-icon class=\"pn-accordion-row-icon\" icon={angle_down} />\n </div>\n </summary>\n\n <div id={this.contentid} class=\"pn-accordion-row-content\" ref={(el: HTMLDivElement) => (this.content = el)}>\n <slot />\n </div>\n </details>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"pn-accordion-row.js","mappings":";;;;;;;;;AAAA,MAAM,iBAAiB,GAAG,ykEAAykE,CAAC;AACpmE,6BAAe,iBAAiB;;MCkBnBA,gBAAc;;;;;yBAWJ,KAAK;2BACH,KAAK;;qBAKe,KAAK;;;2BAOjB,KAAK;;IAvB5B,OAAO,CAAqB;IAC5B,OAAO,CAAc;IACrB,OAAO,CAAiB;IACxB,SAAS,CAAY;IAEZ,wBAAwB,GAAW,GAAG,CAAC;IAChD,iBAAiB,GAAW,IAAI,CAAC,wBAAwB,CAAC;;;IAoBzD,SAAS,CAAyD;;IAI3E,cAAc,CAAC,KAAkB;QAC/B,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,KAAK,EAAE;YAC/B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;YACvC,IAAI,CAAC,cAAc,EAAE,CAAC;SACvB;KACF;IAED,iBAAiB;QACf,MAAM,YAAY,GA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AC,IAAI,EAAE,YAAY,GAAI,CACzD,CACE,EAEV,4DAAK,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,EAAC,0BAA0B,EAAC,GAAG,EAAE,CAAC,EAAkB,MAAM,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,IACxG,8DAAQ,CACJ,CACE,CACL,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["PnAccordionRow"],"sources":["src/components/content/pn-accordion/row/pn-accordion-row.scss?tag=pn-accordion-row","src/components/content/pn-accordion/row/pn-accordion-row.tsx"],"sourcesContent":["@use 'src/globals/main';\n\npn-accordion-row {\n position: relative;\n margin: 0 -0.25em 0;\n}\n\npn-accordion-row .pn-accordion-row {\n width: 100%;\n display: flex;\n flex-direction: column;\n\n &-summary {\n color: main.$gray900;\n position: relative;\n border: none;\n outline: 0;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n\n width: 100%;\n padding: 0.25em;\n font-size: 1em;\n font-weight: 400;\n border-radius: 0.5em;\n\n list-style: none;\n\n &:hover > .pn-accordion-row-text {\n background-color: main.$blue50;\n }\n\n &:focus-visible > .pn-accordion-row-text {\n @include main.pn-focus-visible();\n }\n\n &::-webkit-details-marker {\n display: none;\n }\n }\n\n &-text {\n position: relative;\n overflow: hidden;\n display: flex;\n align-items: center;\n padding: 0.75em;\n background-color: main.$white;\n border-radius: 0.5em;\n -webkit-tap-highlight-color: transparent;\n\n &[data-transparent] {\n background-color: transparent;\n }\n\n @include main.pn-focus-base();\n @include main.pn-transition('background-color, outline-color');\n @include main.pn-ripple(main.$blue700);\n }\n\n &-icon {\n margin-left: auto;\n flex-shrink: 0;\n @include main.pn-transition('transform');\n path {\n fill: main.$blue700;\n }\n }\n\n &[open] .pn-accordion-row-icon {\n transform: rotate(-180deg);\n }\n\n &-content {\n color: main.$gray900;\n display: block;\n padding: 1em;\n }\n}\n","import { Component, h, Host, Element, Event, EventEmitter, Prop, State, Listen } from '@stencil/core';\nimport { chevron_down } from 'pn-design-assets/pn-assets/icons.js';\nimport { reduceMotion, ripple } from '@/index';\n\n/**\n * Use this row component inside a `pn-accordion` to create an accordion group.\n *\n * **Note**: you can use the `pn-accordion-row` without the parent accordion.\n * But you will have to style the gap between each row.\n *\n * @slot label - Include your own HTML as the label.\n * ```\n * <h3 slot=\"label\">Custom title</h3>\n * ```\n */\n@Component({\n tag: 'pn-accordion-row',\n styleUrl: 'pn-accordion-row.scss',\n})\nexport class PnAccordionRow {\n private details: HTMLDetailsElement;\n private summary: HTMLElement;\n private content: HTMLDivElement;\n private animation: Animation;\n\n private readonly defaultAnimationDuration: number = 400;\n private animationDuration: number = this.defaultAnimationDuration;\n\n @Element() hostElement: HTMLElement;\n\n @State() isClosing = false;\n @State() isExpanding = false;\n\n /** The label/title of the accordion row, you can also pass a slot with the name \"label\" if you want to put custom HTML content in there. */\n @Prop({ mutable: true }) label: string;\n /** The open/close status of the accordion row. */\n @Prop({ mutable: true }) state?: boolean = false;\n\n /** Optional unique id for the `summary` element. @category ID */\n @Prop() buttonid?: string;\n /** Optional unique id for the `div` element containing the content. @category ID */\n @Prop() contentid?: string;\n /** Optional prop that removes the default white background on the accordion row */\n @Prop() transparent: boolean = false;\n\n /** Dispatched every time the row is toggled. Includes the row element and the boolean `state` prop. */\n @Event() togglerow: EventEmitter<{ element: HTMLElement; state: Boolean }>;\n\n /** Internal function for closing rows when using the `single` prop on the `pn-accordion`. */\n @Listen('rowstate')\n handleRowState(event: CustomEvent) {\n if (event.detail !== this.state) {\n this.details.style.overflow = 'hidden';\n this.closeAccordion();\n }\n }\n\n componentWillLoad() {\n const slottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.label = slottedLabel ? null : this.label;\n }\n\n private toggleOpen(open?: boolean) {\n const state = open ?? !this.state;\n if (this.state !== open) this.togglerow.emit({ element: this.details, state });\n this.state = state;\n }\n\n private clickHandler(e: MouseEvent) {\n e.preventDefault();\n\n this.details.style.overflow = 'hidden';\n\n if (this.isClosing || !this.state) this.openAccordion();\n else if (this.isClosing || this.state) this.closeAccordion();\n\n const { x, width, y, top } = this.hostElement.getBoundingClientRect();\n const clientCor = e.clientX === 0 && e.clientY === 0 ? { clientX: x + width - 24, clientY: y - top } : e;\n\n ripple(clientCor, this.hostElement, '.pn-accordion-row-text');\n }\n\n private openAccordion() {\n this.details.style.height = `${this.details.offsetHeight}px`;\n this.toggleOpen(true);\n\n requestAnimationFrame(() => {\n this.isExpanding = true;\n\n const startHeight = `${this.details.offsetHeight}px`;\n const endHeight = `${this.summary.offsetHeight + this.content.offsetHeight}px`;\n\n this.cancelAnimations();\n\n this.animate(true, startHeight, endHeight);\n });\n }\n\n private closeAccordion() {\n this.isClosing = true;\n\n const startHeight = `${this.details.offsetHeight}px`;\n const endHeight = `${this.summary.offsetHeight}px`;\n\n this.cancelAnimations();\n\n this.animate(false, startHeight, endHeight);\n }\n\n private animate(open: boolean, startHeight: string, endHeight: string) {\n if (reduceMotion()) this.animationDuration = 0;\n else this.animationDuration = this.defaultAnimationDuration;\n\n this.animation = this.details.animate(\n {\n height: [startHeight, endHeight],\n },\n {\n duration: this.animationDuration,\n easing: 'cubic-bezier(0.6, 0, 0.2, 1)',\n },\n );\n\n this.animation.onfinish = () => this.animationFinish(open);\n\n this.animation.oncancel = () => {\n if (open) this.isExpanding = false;\n else this.isClosing = false;\n };\n }\n\n private animationFinish(open: boolean) {\n this.toggleOpen(open);\n this.cancelAnimations();\n\n this.isClosing = false;\n this.isExpanding = false;\n\n this.details.style.height = '';\n this.details.style.overflow = '';\n }\n\n private cancelAnimations() {\n if (this.animation) this.animation.cancel();\n }\n\n render() {\n return (\n <Host>\n <details class=\"pn-accordion-row\" open={this.state} ref={(el: HTMLDetailsElement) => (this.details = el)}>\n <summary\n id={this.buttonid}\n class=\"pn-accordion-row-summary\"\n onClick={e => this.clickHandler(e)}\n ref={el => (this.summary = el)}\n >\n <div class=\"pn-accordion-row-text\" data-transparent={this.transparent}>\n {this.label ? this.label : ''}\n <slot name=\"label\" />\n\n <pn-icon class=\"pn-accordion-row-icon\" icon={chevron_down} />\n </div>\n </summary>\n\n <div id={this.contentid} class=\"pn-accordion-row-content\" ref={(el: HTMLDivElement) => (this.content = el)}>\n <slot />\n </div>\n </details>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
6
6
|
import { u as uuidv4, k as awaitTopbar, e as en, r as reduceMotion, j as getTotalHeightOffset, h as getMenuWidth, o as ripple, i as isSmallScreen } from './helpers.js';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { c as chevron_down } from './chevron_down.js';
|
|
8
|
+
import { c as chevron_left, a as chevron_right } from './chevron_right.js';
|
|
9
9
|
import { o as open_in_new } from './open_in_new.js';
|
|
10
10
|
import { d as defineCustomElement$4 } from './pn-button2.js';
|
|
11
11
|
import { d as defineCustomElement$3 } from './pn-icon2.js';
|
|
@@ -113,6 +113,20 @@ const PnActionMenu$1 = /*@__PURE__*/ proxyCustomElement(class PnActionMenu exten
|
|
|
113
113
|
translate(prop) {
|
|
114
114
|
return translations[prop][this.language || en];
|
|
115
115
|
}
|
|
116
|
+
globalEvents = (event) => {
|
|
117
|
+
const target = event.target;
|
|
118
|
+
const isWithinActionMenu = target?.closest(this.hostElement.localName);
|
|
119
|
+
if (!isWithinActionMenu)
|
|
120
|
+
this.closeEachSubMenu(true);
|
|
121
|
+
};
|
|
122
|
+
addGlobalEventListeners() {
|
|
123
|
+
const root = this.hostElement.getRootNode();
|
|
124
|
+
root.addEventListener('click', this.globalEvents);
|
|
125
|
+
}
|
|
126
|
+
removeGlobalEventListeners() {
|
|
127
|
+
const root = this.hostElement.getRootNode();
|
|
128
|
+
root.removeEventListener('click', this.globalEvents);
|
|
129
|
+
}
|
|
116
130
|
/** Open/close the action menu. */
|
|
117
131
|
toggleActionMenu(state) {
|
|
118
132
|
this.open = state ?? !this.open;
|
|
@@ -182,11 +196,24 @@ const PnActionMenu$1 = /*@__PURE__*/ proxyCustomElement(class PnActionMenu exten
|
|
|
182
196
|
}
|
|
183
197
|
setOffset() {
|
|
184
198
|
const data = this.getRect(this.hostElement);
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
const
|
|
199
|
+
const sideMenuWidth = getMenuWidth();
|
|
200
|
+
// Calculate potential menu position
|
|
201
|
+
const menuLeft = data.left;
|
|
202
|
+
const menuRight = data.left + this.menuWidth;
|
|
203
|
+
// Define boundaries
|
|
204
|
+
const leftBoundary = sideMenuWidth + 16; // Left menu + buffer
|
|
205
|
+
const rightBoundary = innerWidth - 16; // Right edge - buffer
|
|
206
|
+
let offset = 0;
|
|
207
|
+
// Check if menu would overlap left menu or go off left edge
|
|
208
|
+
if (menuLeft < leftBoundary) {
|
|
209
|
+
offset = leftBoundary - menuLeft;
|
|
210
|
+
}
|
|
211
|
+
// Check if menu would go off right edge
|
|
212
|
+
else if (menuRight > rightBoundary) {
|
|
213
|
+
offset = rightBoundary - menuRight;
|
|
214
|
+
}
|
|
188
215
|
if (this.menuContainer)
|
|
189
|
-
this.menuContainer.style.setProperty('--pn-action-menu-offset',
|
|
216
|
+
this.menuContainer.style.setProperty('--pn-action-menu-offset', `${offset}px`);
|
|
190
217
|
}
|
|
191
218
|
getListId(option) {
|
|
192
219
|
return `pn-menu-${option.value}-list`;
|
|
@@ -197,7 +224,7 @@ const PnActionMenu$1 = /*@__PURE__*/ proxyCustomElement(class PnActionMenu exten
|
|
|
197
224
|
getTriggerIcon() {
|
|
198
225
|
if (this.button?.icon)
|
|
199
226
|
return;
|
|
200
|
-
return
|
|
227
|
+
return chevron_down;
|
|
201
228
|
}
|
|
202
229
|
/** Set the path of open sub menus. */
|
|
203
230
|
getSubMenuPath(options, value, path = []) {
|
|
@@ -213,8 +240,9 @@ const PnActionMenu$1 = /*@__PURE__*/ proxyCustomElement(class PnActionMenu exten
|
|
|
213
240
|
}
|
|
214
241
|
return null;
|
|
215
242
|
}
|
|
216
|
-
closeEachSubMenu() {
|
|
217
|
-
|
|
243
|
+
closeEachSubMenu(preventFocus = false) {
|
|
244
|
+
if (!preventFocus)
|
|
245
|
+
this.menuTrigger?.querySelector('button')?.focus({ preventScroll: true });
|
|
218
246
|
const interval = setInterval(() => {
|
|
219
247
|
if (this.smallMenu || this.activeSubmenu.length === 0) {
|
|
220
248
|
clearInterval(interval);
|
|
@@ -242,6 +270,7 @@ const PnActionMenu$1 = /*@__PURE__*/ proxyCustomElement(class PnActionMenu exten
|
|
|
242
270
|
this.closeGrid();
|
|
243
271
|
}
|
|
244
272
|
openGrid() {
|
|
273
|
+
this.addGlobalEventListeners();
|
|
245
274
|
const list = this.getRect(this.menuList);
|
|
246
275
|
const { clientHeight } = this.menuContainer;
|
|
247
276
|
const height = this.isClosing ? clientHeight : 0;
|
|
@@ -250,6 +279,7 @@ const PnActionMenu$1 = /*@__PURE__*/ proxyCustomElement(class PnActionMenu exten
|
|
|
250
279
|
this.animateGrid(true, `${height}px`, `${list.height}px`);
|
|
251
280
|
}
|
|
252
281
|
closeGrid() {
|
|
282
|
+
this.removeGlobalEventListeners();
|
|
253
283
|
const list = this.getRect(this.menuList);
|
|
254
284
|
const { clientHeight } = this.menuContainer;
|
|
255
285
|
const height = this.isExpanding ? clientHeight : list.height;
|
|
@@ -340,7 +370,7 @@ const PnActionMenu$1 = /*@__PURE__*/ proxyCustomElement(class PnActionMenu exten
|
|
|
340
370
|
return Boolean(this.activeSubmenu[this.activeSubmenu.length - 1] === value);
|
|
341
371
|
}
|
|
342
372
|
getOptionTrailing(option) {
|
|
343
|
-
const useButtonIcon = option.options?.length &&
|
|
373
|
+
const useButtonIcon = option.options?.length && chevron_right;
|
|
344
374
|
const useTrailingIcon = option.trailingIcon;
|
|
345
375
|
const useLinkIcon = option.target === '_blank' && open_in_new;
|
|
346
376
|
/** If the user has defined a trialing icon, use it first. */
|
|
@@ -382,7 +412,7 @@ const PnActionMenu$1 = /*@__PURE__*/ proxyCustomElement(class PnActionMenu exten
|
|
|
382
412
|
disabled: option.disabled,
|
|
383
413
|
};
|
|
384
414
|
const Tag = isLink ? 'a' : 'button';
|
|
385
|
-
return isGroup ? (h("div", { class: "pn-action-menu-group-label" }, h("p", { class: "pn-action-menu-p" }, option.label), option.helpertext && h("p", { class: "pn-action-menu-group-helpertext" }, option.helpertext))) : (h("div", { class: "pn-action-menu-item-content", "data-close": isCloseButton }, h(Tag, { id: this.getButtonId(option) + appendedId, class: "pn-action-menu-button", ...subMenuAttrs, ...attrs, tabIndex: this.open ? null : -1, onClick: event => this.optionSelect(option, event), onKeyDown: (event) => this.escButton(event, option) }, hasIcon && h("pn-icon", { icon: isCloseButton ?
|
|
415
|
+
return isGroup ? (h("div", { class: "pn-action-menu-group-label" }, h("p", { class: "pn-action-menu-p" }, option.label), option.helpertext && h("p", { class: "pn-action-menu-group-helpertext" }, option.helpertext))) : (h("div", { class: "pn-action-menu-item-content", "data-close": isCloseButton }, h(Tag, { id: this.getButtonId(option) + appendedId, class: "pn-action-menu-button", ...subMenuAttrs, ...attrs, tabIndex: this.open ? null : -1, onClick: event => this.optionSelect(option, event), onKeyDown: (event) => this.escButton(event, option) }, hasIcon && h("pn-icon", { icon: isCloseButton ? chevron_left : option.icon, color: "blue700" }), h("div", { class: "pn-action-menu-item-text" }, h("span", { class: "pn-action-menu-item-label" }, isCloseButton ? this.translate('BACK') : option.label), option.helpertext && !isLink && h("span", { class: "pn-action-menu-item-helpertext" }, option.helpertext)), trailingObject)));
|
|
386
416
|
}
|
|
387
417
|
renderSub(option) {
|
|
388
418
|
return (h("menu", { id: this.getListId(option), "aria-labelledby": this.getButtonId(option), class: "pn-action-menu-sub", "data-open": this.isSubmenuActive(option.value)?.toString(), "data-current": this.isCurrentSubMenu(option.value) }, this.smallMenu && (h("li", { class: "pn-action-menu-item" }, this.renderButton({
|
|
@@ -404,7 +434,7 @@ const PnActionMenu$1 = /*@__PURE__*/ proxyCustomElement(class PnActionMenu exten
|
|
|
404
434
|
return (h("div", { id: this.menuListId, class: "pn-action-menu-container", role: "region", "aria-labelledby": this.menuButtonId, "data-open": this.open, "data-moving": this.isClosing || this.isExpanding, "data-upwards": this.upwards, "data-small": this.smallMenu, style: { height: '0px' }, ref: el => (this.menuContainer = el) }, h("menu", { class: "pn-action-menu-list", ref: el => (this.menuList = el), "data-current": this.isMenuActive() }, this.options?.map(option => this.renderMenuItem(option)))));
|
|
405
435
|
}
|
|
406
436
|
render() {
|
|
407
|
-
return (h(Host, { key: '
|
|
437
|
+
return (h(Host, { key: '474e0e58bfa5f3105b98e3bee9d2d0b39f450dac' }, h("div", { key: '262f0895ad57b5edeffa360530cda0a7144cfe33', id: this.menuId !== this.id ? this.menuId : null, class: "pn-action-menu" }, h("pn-button", { key: 'b77ec7bd057e59c795eea8a16db6cba68c5c527c', icon: this.getTriggerIcon(), ...this.button, buttonId: this.menuButtonId, tooltipUp: !this.upwards, ariahaspopup: "true", ariacontrols: this.open ? this.menuListId : null, ariaexpanded: this.open.toString(), "data-default-icon": !this.button?.icon, onPnClick: () => this.toggleActionMenu(), ref: el => (this.menuTrigger = el) }), this.renderMenu())));
|
|
408
438
|
}
|
|
409
439
|
static get watchers() { return {
|
|
410
440
|
"options": ["handleOptions"],
|