@postnord/pn-marketweb-components 4.3.6 → 4.3.8
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/{convert-9361e443.js → convert-aa209554.js} +27 -17
- package/cjs/convert-aa209554.js.map +1 -0
- package/cjs/pn-find-price.cjs.entry.js +1 -1
- package/cjs/pn-find-service-and-price.cjs.entry.js +1 -1
- package/cjs/pn-product-pricelist.cjs.entry.js +1 -1
- package/cjs/pn-teaser-card.cjs.entry.js +1 -1
- package/cjs/pn-teaser-card.cjs.entry.js.map +1 -1
- package/collection/components/cards/pn-teaser-card/pn-teaser-card.css +2 -2
- package/components/convert.js +26 -16
- package/components/convert.js.map +1 -1
- package/components/pn-teaser-card.js +1 -1
- package/components/pn-teaser-card.js.map +1 -1
- package/esm/{convert-ecca01b6.js → convert-a9a18794.js} +27 -17
- package/esm/convert-a9a18794.js.map +1 -0
- package/esm/pn-find-price.entry.js +1 -1
- package/esm/pn-find-service-and-price.entry.js +1 -1
- package/esm/pn-product-pricelist.entry.js +1 -1
- package/esm/pn-teaser-card.entry.js +1 -1
- package/esm/pn-teaser-card.entry.js.map +1 -1
- package/package.json +1 -1
- package/pn-market-web-components/p-00e6bb4b.js +2 -0
- package/pn-market-web-components/p-00e6bb4b.js.map +1 -0
- package/pn-market-web-components/{p-c4059cc1.entry.js → p-181e40ee.entry.js} +2 -2
- package/pn-market-web-components/{p-6d263c6e.entry.js → p-96d81eb2.entry.js} +2 -2
- package/pn-market-web-components/p-96d81eb2.entry.js.map +1 -0
- package/pn-market-web-components/{p-f8ccc718.entry.js → p-a0d7154f.entry.js} +2 -2
- package/pn-market-web-components/{p-413afe7c.entry.js → p-c18154a4.entry.js} +2 -2
- package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
- package/umd/modules/@postnord/web-components/cem.json +12220 -0
- package/umd/modules/@postnord/web-components/cjs/{index-CfUQZtlH.js → index-DWu-2oJc.js} +144 -85
- package/umd/modules/@postnord/web-components/cjs/{index-CNdVg5VI.js → index-vOySuOUW.js} +1 -1
- package/umd/modules/@postnord/web-components/cjs/index.cjs.js +18 -16
- package/umd/modules/@postnord/web-components/cjs/loader.cjs.js +2 -2
- package/umd/modules/@postnord/web-components/cjs/pn-accordion-row.cjs.entry.js +2 -2
- package/umd/modules/@postnord/web-components/cjs/pn-accordion.cjs.entry.js +5 -4
- package/umd/modules/@postnord/web-components/cjs/pn-action-menu.cjs.entry.js +6 -6
- package/umd/modules/@postnord/web-components/cjs/pn-button-dropdown.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-button_2.cjs.entry.js +3 -3
- package/umd/modules/@postnord/web-components/cjs/pn-card.cjs.entry.js +4 -4
- package/umd/modules/@postnord/web-components/cjs/pn-checkbox.cjs.entry.js +63 -21
- package/umd/modules/@postnord/web-components/cjs/pn-choice-chip.cjs.entry.js +38 -18
- package/umd/modules/@postnord/web-components/cjs/pn-counter.cjs.entry.js +71 -37
- package/umd/modules/@postnord/web-components/cjs/pn-date-picker.cjs.entry.js +185 -103
- package/umd/modules/@postnord/web-components/cjs/pn-fieldset.cjs.entry.js +33 -27
- package/umd/modules/@postnord/web-components/cjs/pn-file-upload.cjs.entry.js +73 -42
- package/umd/modules/@postnord/web-components/cjs/pn-footer.cjs.entry.js +2 -2
- package/umd/modules/@postnord/web-components/cjs/pn-header.cjs.entry.js +2 -2
- package/umd/modules/@postnord/web-components/cjs/pn-icon_2.cjs.entry.js +8 -10
- package/umd/modules/@postnord/web-components/cjs/pn-illustration.cjs.entry.js +3 -3
- package/umd/modules/@postnord/web-components/cjs/pn-input.cjs.entry.js +122 -89
- package/umd/modules/@postnord/web-components/cjs/pn-modal.cjs.entry.js +24 -12
- package/umd/modules/@postnord/web-components/cjs/pn-multiselect.cjs.entry.js +136 -52
- package/umd/modules/@postnord/web-components/cjs/pn-ocr-search.cjs.entry.js +2 -2
- package/umd/modules/@postnord/web-components/cjs/pn-page-nav-dropdown-item.cjs.entry.js +3 -3
- package/umd/modules/@postnord/web-components/cjs/pn-page-nav-item.cjs.entry.js +3 -3
- package/umd/modules/@postnord/web-components/cjs/pn-page-nav.cjs.entry.js +3 -3
- package/umd/modules/@postnord/web-components/cjs/pn-pagination.cjs.entry.js +4 -4
- package/umd/modules/@postnord/web-components/cjs/pn-progress-bar.cjs.entry.js +2 -2
- package/umd/modules/@postnord/web-components/cjs/pn-progress-indicator-step.cjs.entry.js +3 -3
- package/umd/modules/@postnord/web-components/cjs/pn-progress-indicator.cjs.entry.js +3 -3
- package/umd/modules/@postnord/web-components/cjs/pn-progress-stepper.cjs.entry.js +2 -2
- package/umd/modules/@postnord/web-components/cjs/pn-radio-button.cjs.entry.js +61 -20
- package/umd/modules/@postnord/web-components/cjs/pn-range.cjs.entry.js +88 -43
- package/umd/modules/@postnord/web-components/cjs/pn-read-only-button.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-search-field.cjs.entry.js +42 -25
- package/umd/modules/@postnord/web-components/cjs/pn-segment.cjs.entry.js +16 -11
- package/umd/modules/@postnord/web-components/cjs/pn-segmented-control.cjs.entry.js +21 -21
- package/umd/modules/@postnord/web-components/cjs/pn-select.cjs.entry.js +90 -35
- package/umd/modules/@postnord/web-components/cjs/pn-tab.cjs.entry.js +15 -10
- package/umd/modules/@postnord/web-components/cjs/pn-table.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-tablist.cjs.entry.js +5 -4
- package/umd/modules/@postnord/web-components/cjs/pn-text-link.cjs.entry.js +2 -2
- package/umd/modules/@postnord/web-components/cjs/pn-textarea.cjs.entry.js +88 -34
- package/umd/modules/@postnord/web-components/cjs/pn-tile.cjs.entry.js +3 -3
- package/umd/modules/@postnord/web-components/cjs/pn-toast.cjs.entry.js +5 -5
- package/umd/modules/@postnord/web-components/cjs/pn-toggle-switch.cjs.entry.js +56 -20
- package/umd/modules/@postnord/web-components/cjs/pn-tooltip.cjs.entry.js +2 -2
- package/umd/modules/@postnord/web-components/cjs/pn-wizard.cjs.entry.js +71 -49
- package/umd/modules/@postnord/web-components/cjs/pn-zipcode-search.cjs.entry.js +3 -3
- package/umd/modules/@postnord/web-components/cjs/postnord-web-components.cjs.js +3 -3
- package/umd/modules/@postnord/web-components/collection/collection-manifest.json +4 -1
- package/umd/modules/@postnord/web-components/collection/components/buttons/pn-action-menu/pn-action-menu.css +1 -10
- package/umd/modules/@postnord/web-components/collection/components/content/pn-accordion/pn-accordion.js +5 -4
- package/umd/modules/@postnord/web-components/collection/components/design-tokens/pn-icon/pn-icon.css +13 -9
- package/umd/modules/@postnord/web-components/collection/components/design-tokens/pn-icon/pn-icon.js +12 -14
- package/umd/modules/@postnord/web-components/collection/components/design-tokens/pn-illustration/pn-illustration.css +6 -2
- package/umd/modules/@postnord/web-components/collection/components/design-tokens/pn-illustration/pn-illustration.js +7 -1
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-modal/pn-modal.css +4 -1
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-modal/pn-modal.js +71 -13
- 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 +1 -1
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-progress-indicator/pn-progress-indicator.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-progress-stepper/pn-progress-stepper.js +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.js +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/feedback/pn-wizard/pn-wizard.css +5 -5
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-wizard/pn-wizard.js +70 -45
- package/umd/modules/@postnord/web-components/collection/components/input/pn-checkbox/pn-checkbox.css +3 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-checkbox/pn-checkbox.js +213 -52
- package/umd/modules/@postnord/web-components/collection/components/input/pn-choice-chip/pn-choice-chip.css +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-choice-chip/pn-choice-chip.js +128 -68
- package/umd/modules/@postnord/web-components/collection/components/input/pn-counter/pn-counter.js +305 -154
- package/umd/modules/@postnord/web-components/collection/components/input/pn-date-picker/pn-date-picker.js +562 -275
- package/umd/modules/@postnord/web-components/collection/components/input/pn-fieldset/pn-fieldset.css +21 -16
- package/umd/modules/@postnord/web-components/collection/components/input/pn-fieldset/pn-fieldset.js +114 -54
- package/umd/modules/@postnord/web-components/collection/components/input/pn-file-upload/pn-file-upload.css +37 -50
- package/umd/modules/@postnord/web-components/collection/components/input/pn-file-upload/pn-file-upload.js +159 -97
- package/umd/modules/@postnord/web-components/collection/components/input/pn-file-upload/translation.js +7 -0
- package/umd/modules/@postnord/web-components/collection/components/input/pn-input/pn-input.css +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-input/pn-input.js +415 -264
- package/umd/modules/@postnord/web-components/collection/components/input/pn-multiselect/pn-multiselect.css +13 -24
- package/umd/modules/@postnord/web-components/collection/components/input/pn-multiselect/pn-multiselect.js +316 -131
- package/umd/modules/@postnord/web-components/collection/components/input/pn-radio-button/pn-radio-button.css +3 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-radio-button/pn-radio-button.js +223 -63
- package/umd/modules/@postnord/web-components/collection/components/input/pn-range/pn-range.css +3 -0
- package/umd/modules/@postnord/web-components/collection/components/input/pn-range/pn-range.js +357 -191
- package/umd/modules/@postnord/web-components/collection/components/input/pn-search-field/pn-search-field.css +6 -9
- package/umd/modules/@postnord/web-components/collection/components/input/pn-search-field/pn-search-field.js +177 -90
- package/umd/modules/@postnord/web-components/collection/components/input/pn-segmented-control/pn-segmented-control.css +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-segmented-control/pn-segmented-control.js +24 -24
- package/umd/modules/@postnord/web-components/collection/components/input/pn-segmented-control/segment/pn-segment.js +84 -37
- package/umd/modules/@postnord/web-components/collection/components/input/pn-select/pn-select.css +18 -14
- package/umd/modules/@postnord/web-components/collection/components/input/pn-select/pn-select.js +237 -90
- package/umd/modules/@postnord/web-components/collection/components/input/pn-textarea/pn-textarea.css +6 -5
- package/umd/modules/@postnord/web-components/collection/components/input/pn-textarea/pn-textarea.js +255 -115
- package/umd/modules/@postnord/web-components/collection/components/input/pn-toggle-switch/pn-toggle-switch.css +5 -3
- package/umd/modules/@postnord/web-components/collection/components/input/pn-toggle-switch/pn-toggle-switch.js +216 -68
- 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.css +2 -2
- 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 +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 +4 -3
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-tablist/tab/pn-tab.css +3 -3
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-tablist/tab/pn-tab.js +11 -6
- 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/helpers.js +16 -14
- package/umd/modules/@postnord/web-components/components/helpers.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-accordion.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-action-menu.js +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 +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-icon2.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-illustration2.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-input2.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-modal.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-multiselect.js +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 +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.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-progress-stepper2.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-radio-button.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-range.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 +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 +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 +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-wizard.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-zipcode-search.js +1 -1
- package/umd/modules/@postnord/web-components/esm/{index-CosyroON.js → index-DyhO6xPY.js} +1 -1
- package/umd/modules/@postnord/web-components/esm/{index-CAEP792y.js → index-XKg-ydzH.js} +144 -85
- package/umd/modules/@postnord/web-components/esm/index.js +19 -17
- package/umd/modules/@postnord/web-components/esm/loader.js +3 -3
- package/umd/modules/@postnord/web-components/esm/pn-accordion-row.entry.js +2 -2
- package/umd/modules/@postnord/web-components/esm/pn-accordion.entry.js +5 -4
- package/umd/modules/@postnord/web-components/esm/pn-action-menu.entry.js +6 -6
- package/umd/modules/@postnord/web-components/esm/pn-button-dropdown.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-button_2.entry.js +3 -3
- package/umd/modules/@postnord/web-components/esm/pn-card.entry.js +4 -4
- package/umd/modules/@postnord/web-components/esm/pn-checkbox.entry.js +63 -21
- package/umd/modules/@postnord/web-components/esm/pn-choice-chip.entry.js +38 -18
- package/umd/modules/@postnord/web-components/esm/pn-counter.entry.js +71 -37
- package/umd/modules/@postnord/web-components/esm/pn-date-picker.entry.js +185 -103
- package/umd/modules/@postnord/web-components/esm/pn-fieldset.entry.js +33 -27
- package/umd/modules/@postnord/web-components/esm/pn-file-upload.entry.js +73 -42
- package/umd/modules/@postnord/web-components/esm/pn-footer.entry.js +2 -2
- package/umd/modules/@postnord/web-components/esm/pn-header.entry.js +2 -2
- package/umd/modules/@postnord/web-components/esm/pn-icon_2.entry.js +8 -10
- package/umd/modules/@postnord/web-components/esm/pn-illustration.entry.js +3 -3
- package/umd/modules/@postnord/web-components/esm/pn-input.entry.js +122 -89
- package/umd/modules/@postnord/web-components/esm/pn-modal.entry.js +24 -12
- package/umd/modules/@postnord/web-components/esm/pn-multiselect.entry.js +137 -53
- package/umd/modules/@postnord/web-components/esm/pn-ocr-search.entry.js +2 -2
- package/umd/modules/@postnord/web-components/esm/pn-page-nav-dropdown-item.entry.js +3 -3
- package/umd/modules/@postnord/web-components/esm/pn-page-nav-item.entry.js +3 -3
- package/umd/modules/@postnord/web-components/esm/pn-page-nav.entry.js +3 -3
- package/umd/modules/@postnord/web-components/esm/pn-pagination.entry.js +4 -4
- package/umd/modules/@postnord/web-components/esm/pn-progress-bar.entry.js +2 -2
- package/umd/modules/@postnord/web-components/esm/pn-progress-indicator-step.entry.js +3 -3
- package/umd/modules/@postnord/web-components/esm/pn-progress-indicator.entry.js +3 -3
- package/umd/modules/@postnord/web-components/esm/pn-progress-stepper.entry.js +2 -2
- package/umd/modules/@postnord/web-components/esm/pn-radio-button.entry.js +61 -20
- package/umd/modules/@postnord/web-components/esm/pn-range.entry.js +88 -43
- package/umd/modules/@postnord/web-components/esm/pn-read-only-button.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-search-field.entry.js +42 -25
- package/umd/modules/@postnord/web-components/esm/pn-segment.entry.js +16 -11
- package/umd/modules/@postnord/web-components/esm/pn-segmented-control.entry.js +21 -21
- package/umd/modules/@postnord/web-components/esm/pn-select.entry.js +90 -35
- package/umd/modules/@postnord/web-components/esm/pn-tab.entry.js +15 -10
- package/umd/modules/@postnord/web-components/esm/pn-table.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-tablist.entry.js +5 -4
- package/umd/modules/@postnord/web-components/esm/pn-text-link.entry.js +2 -2
- package/umd/modules/@postnord/web-components/esm/pn-textarea.entry.js +88 -34
- package/umd/modules/@postnord/web-components/esm/pn-tile.entry.js +3 -3
- package/umd/modules/@postnord/web-components/esm/pn-toast.entry.js +5 -5
- package/umd/modules/@postnord/web-components/esm/pn-toggle-switch.entry.js +56 -20
- package/umd/modules/@postnord/web-components/esm/pn-tooltip.entry.js +2 -2
- package/umd/modules/@postnord/web-components/esm/pn-wizard.entry.js +71 -49
- package/umd/modules/@postnord/web-components/esm/pn-zipcode-search.entry.js +3 -3
- package/umd/modules/@postnord/web-components/esm/postnord-web-components.js +4 -4
- package/umd/modules/@postnord/web-components/hydrate/index.js +1715 -940
- package/umd/modules/@postnord/web-components/hydrate/index.mjs +1715 -940
- package/umd/modules/@postnord/web-components/node_modules/@rollup/rollup-linux-x64-gnu/package.json +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@rollup/rollup-linux-x64-gnu/rollup.linux-x64-gnu.node +0 -0
- package/umd/modules/@postnord/web-components/node_modules/@rollup/rollup-linux-x64-musl/package.json +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@rollup/rollup-linux-x64-musl/rollup.linux-x64-musl.node +0 -0
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/cli/index.cjs +3 -2
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/cli/index.js +3 -2
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/cli/package.json +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/package.json +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/stencil.js +3312 -561
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/client/index.js +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/client/package.json +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/connector.html +2 -2
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/index.js +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/package.json +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/server-process.js +2 -2
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/app-data/package.json +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/app-globals/package.json +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/client/index.js +246 -179
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/client/package.json +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/client/patch-browser.js +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/client/shadow-css.js +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/hydrate/index.js +245 -180
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/hydrate/package.json +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/hydrate/runner.js +59 -22
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/package.json +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/stencil-core/index.d.ts +1 -0
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/stencil-ext-modules.d.ts +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/stencil-private.d.ts +49 -0
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/stencil-public-compiler.d.ts +51 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/stencil-public-docs.d.ts +26 -0
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/stencil-public-runtime.d.ts +23 -2
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/testing/index.js +238 -169
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/testing/package.json +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/mock-doc/index.cjs +59 -22
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/mock-doc/index.d.ts +12 -3
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/mock-doc/index.js +59 -22
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/mock-doc/package.json +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/package.json +10 -10
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/index.js +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/package.json +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/pixel-match.js +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/sys/node/460.node-fetch.js +3 -3
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/sys/node/autoprefixer.js +2 -2
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/sys/node/glob.js +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/sys/node/graceful-fs.js +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/sys/node/index.js +32 -32
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/sys/node/node-fetch.js +4 -4
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/sys/node/package.json +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/sys/node/prompts.js +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/sys/node/worker.js +1 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/index.js +33 -1
- package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/package.json +1 -1
- package/umd/modules/@postnord/web-components/package.json +16 -16
- package/umd/modules/@postnord/web-components/postnord-web-components/index.esm.js +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-ea50ecd2.entry.js → p-020ee3f4.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-060b6ad2.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-0bf70d44.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-1ec52623.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-27c71f60.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-292a7591.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-3d2cac86.entry.js → p-3709c995.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-3db02038.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-2f4ad4a4.entry.js → p-4b9fb0fc.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-506a801d.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-518651ad.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-54917d9f.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-56ade97b.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-64207923.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-665af57e.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-6d85c967.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-6e407015.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-01ac1c67.entry.js → p-720b8b90.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-7aea3de5.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-7b6ae520.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-83d02093.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-88344f8d.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-3c96cb61.entry.js → p-895acf7f.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-8cedf2e0.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-91c6a8cf.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-98a37be9.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-9a6c90e4.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-9d2ee77a.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-9d56fb64.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-BlM_xfdt.js → p-BWAVaTWQ.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-XKg-ydzH.js +6 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-a1f92f19.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-a31d93db.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-aa15469e.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-db2b7e5d.entry.js → p-b45e58df.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-b72f9866.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-b0710b87.entry.js → p-b7a2e5b0.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-c09179d6.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-38e44ed0.entry.js → p-ce2c2395.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-d228b929.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-d71054df.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-d81b4ede.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-e11b4af5.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-c4c4c75b.entry.js → p-e5574624.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-e6ad75f9.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-e6cd4c7f.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-ede550f0.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/p-ef00ef4d.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/postnord-web-components.esm.js +1 -1
- package/umd/modules/@postnord/web-components/types/components/buttons/pn-action-menu/pn-action-menu.d.ts +111 -0
- package/umd/modules/@postnord/web-components/types/components/content/pn-accordion/pn-accordion.d.ts +2 -2
- package/umd/modules/@postnord/web-components/types/components/design-tokens/pn-icon/pn-icon.d.ts +5 -7
- package/umd/modules/@postnord/web-components/types/components/design-tokens/pn-illustration/pn-illustration.d.ts +8 -2
- package/umd/modules/@postnord/web-components/types/components/feedback/pn-modal/pn-modal.d.ts +17 -6
- package/umd/modules/@postnord/web-components/types/components/feedback/pn-toast/pn-toast.d.ts +100 -0
- package/umd/modules/@postnord/web-components/types/components/feedback/pn-wizard/pn-wizard.d.ts +6 -1
- package/umd/modules/@postnord/web-components/types/components/input/pn-checkbox/pn-checkbox.d.ts +124 -0
- package/umd/modules/@postnord/web-components/types/components/input/pn-choice-chip/pn-choice-chip.d.ts +31 -15
- package/umd/modules/@postnord/web-components/types/components/input/pn-counter/pn-counter.d.ts +51 -27
- package/umd/modules/@postnord/web-components/types/components/input/pn-date-picker/pn-date-picker.d.ts +338 -0
- package/umd/modules/@postnord/web-components/types/components/input/pn-fieldset/pn-fieldset.d.ts +24 -15
- package/umd/modules/@postnord/web-components/types/components/input/pn-file-upload/pn-file-upload.d.ts +36 -27
- package/umd/modules/@postnord/web-components/types/components/input/pn-file-upload/translation.d.ts +7 -0
- package/umd/modules/@postnord/web-components/types/components/input/pn-input/pn-input.d.ts +89 -66
- package/umd/modules/@postnord/web-components/types/components/input/pn-multiselect/pn-multiselect.d.ts +265 -0
- package/umd/modules/@postnord/web-components/types/components/input/pn-radio-button/pn-radio-button.d.ts +124 -0
- package/umd/modules/@postnord/web-components/types/components/input/pn-range/pn-range.d.ts +73 -42
- package/umd/modules/@postnord/web-components/types/components/input/pn-search-field/pn-search-field.d.ts +32 -21
- package/umd/modules/@postnord/web-components/types/components/input/pn-segmented-control/pn-segmented-control.d.ts +19 -18
- package/umd/modules/@postnord/web-components/types/components/input/pn-segmented-control/segment/pn-segment.d.ts +12 -9
- package/umd/modules/@postnord/web-components/types/components/input/pn-select/pn-select.d.ts +51 -31
- package/umd/modules/@postnord/web-components/types/components/input/pn-textarea/pn-textarea.d.ts +58 -27
- package/umd/modules/@postnord/web-components/types/components/input/pn-toggle-switch/pn-toggle-switch.d.ts +36 -14
- package/umd/modules/@postnord/web-components/types/components.d.ts +1851 -511
- package/umd/modules/@postnord/web-components/types/globals/mixins/index.d.ts +21 -0
- package/umd/modules/@postnord/web-components/types/stencil-public-runtime.d.ts +23 -2
- package/umd/modules/@postnord/web-components/vscode-data.json +218 -38
- package/umd/pn-marketweb-salesforce-header.js +1 -1
- package/cjs/convert-9361e443.js.map +0 -1
- package/esm/convert-ecca01b6.js.map +0 -1
- package/pn-market-web-components/p-63ff7fa2.js +0 -2
- package/pn-market-web-components/p-63ff7fa2.js.map +0 -1
- package/pn-market-web-components/p-6d263c6e.entry.js.map +0 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-0dd15cc3.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-0e94a4dd.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-0ed2ee53.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-109ba1fc.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-153311c8.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-1a3c49ba.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-2610f8ab.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-267c323e.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-2a364778.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-2a682ff9.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-2cce8a9f.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-306ec758.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-3d459401.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-3deb5a9e.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-41c09d4d.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-484dfaa4.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-50116c0d.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-502b8430.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-5b7c1333.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-67f55491.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-838c17b9.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-849d48c6.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-89aaa3c8.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-8b2b6f5d.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-93db2b9e.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-97ffc4b3.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-CAEP792y.js +0 -6
- package/umd/modules/@postnord/web-components/postnord-web-components/p-b3c4e3e8.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-b8c4423b.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-ba59528f.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-c0ae367c.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-c843ae5e.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-d1e27524.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-d214e930.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-d7091312.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-e3fb693e.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-e83de0b1.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-edc28eee.entry.js +0 -5
- /package/pn-market-web-components/{p-c4059cc1.entry.js.map → p-181e40ee.entry.js.map} +0 -0
- /package/pn-market-web-components/{p-f8ccc718.entry.js.map → p-a0d7154f.entry.js.map} +0 -0
- /package/pn-market-web-components/{p-413afe7c.entry.js.map → p-c18154a4.entry.js.map} +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* By PostNord.
|
|
4
4
|
*/
|
|
5
|
-
import { h, Host, forceUpdate } from "@stencil/core";
|
|
5
|
+
import { h, Host, forceUpdate, transformTag } from "@stencil/core";
|
|
6
6
|
import { ripple } from "../../../../globals/helpers";
|
|
7
7
|
/**
|
|
8
8
|
* This tab should control a tab panel.
|
|
@@ -71,10 +71,14 @@ export class PnTab {
|
|
|
71
71
|
arrowKeyNav(event) {
|
|
72
72
|
if (!/^(ArrowRight|ArrowLeft|Home|End)$/.test(event.key))
|
|
73
73
|
return;
|
|
74
|
+
const tabName = transformTag('pn-tab');
|
|
75
|
+
const tablistName = transformTag('pn-tablist');
|
|
74
76
|
event.preventDefault();
|
|
75
77
|
// Get tablist parent
|
|
76
|
-
const parent = event.target.closest(
|
|
77
|
-
|
|
78
|
+
const parent = event.target.closest(tablistName);
|
|
79
|
+
if (!parent)
|
|
80
|
+
return;
|
|
81
|
+
const list = Array.from(parent.querySelectorAll(tabName));
|
|
78
82
|
const first = list[0];
|
|
79
83
|
const last = list[list.length - 1];
|
|
80
84
|
const nextElement = this.hostElement.nextElementSibling;
|
|
@@ -96,8 +100,9 @@ export class PnTab {
|
|
|
96
100
|
return this.activeTab === this.value;
|
|
97
101
|
}
|
|
98
102
|
tabTag() {
|
|
99
|
-
const
|
|
100
|
-
|
|
103
|
+
const tablistName = transformTag('pn-tablist');
|
|
104
|
+
const isMenu = this.hostElement.closest(tablistName);
|
|
105
|
+
this.tag = isMenu?.slot === 'menu' ? 'a' : 'button';
|
|
101
106
|
}
|
|
102
107
|
renderProperties() {
|
|
103
108
|
return this.tag === 'a'
|
|
@@ -122,7 +127,7 @@ export class PnTab {
|
|
|
122
127
|
}
|
|
123
128
|
render() {
|
|
124
129
|
const Tag = this.tag;
|
|
125
|
-
return (h(Host, { key: '
|
|
130
|
+
return (h(Host, { key: '37a1d2234aa0d4fe1f5f1af6f8334f9e4109eff6' }, h(Tag, { key: '17e8e25c54b556f65b7c98ac4eaef07f1bc131ac', 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: '42c7473fd8b573ec47e8e2074a4ded3ff3e40249', icon: this.icon, color: this.iconColor() }), h("slot", { key: 'c39be583c461850d49f7e5a96c071c80b7b132da' }), h("span", { key: 'ce995d860775c71e8fda7dc4e94c2a7896759f62', class: "pn-tab-label" }, this.label))));
|
|
126
131
|
}
|
|
127
132
|
static get is() { return "pn-tab"; }
|
|
128
133
|
static get originalStyleUrls() {
|
|
@@ -31,7 +31,7 @@ export class PnTextLink {
|
|
|
31
31
|
/** Set a unique html ID of the a element. @category Link attributes */
|
|
32
32
|
linkid;
|
|
33
33
|
render() {
|
|
34
|
-
return (h("a", { key: '
|
|
34
|
+
return (h("a", { key: '0641c9d91a5652eba8498546f1c2e64b3bf5c7f4', 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: 'dd448ea86844b810197fb2735025b9213984918f' }), this.icon && h("pn-icon", { key: '4350858f2f87b0c35e472078ea30eb252a894651', icon: this.icon })));
|
|
35
35
|
}
|
|
36
36
|
static get is() { return "pn-text-link"; }
|
|
37
37
|
static get originalStyleUrls() {
|
package/umd/modules/@postnord/web-components/collection/components/navigation/pn-tile/pn-tile.js
CHANGED
|
@@ -72,7 +72,7 @@ export class PnTile {
|
|
|
72
72
|
this.pnTile.emit({ click: event });
|
|
73
73
|
}
|
|
74
74
|
render() {
|
|
75
|
-
return (h(Host, { key: '
|
|
75
|
+
return (h(Host, { key: 'a29b0f244288bdff245e275a9ab3d11bec87a476' }, h("div", { key: 'beed67096e5bd7448416b5c0422596f2e4d61be9', class: "pn-tile", "data-horizontal": this.horizontal, "data-href": !!this.url, "data-focus": this.visibleOutline, ref: el => (this.tile = el) }, h("div", { key: '458a7df237ec2fc27c33c3f3306d880f5ba6ab11', 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: 'bd70e9eb9e29cd48d29170e05f279019005d564a', class: "pn-tile-illustration-slot", hidden: !this.showSlotIllustration(), ref: el => (this.illustrationSlot = el) }, h("slot", { key: 'c22dee0ca1663e47fbbc2625af6060ebc1fec4d5', name: "illustration" }))), h("div", { key: '0dbb257acaf45f22a16f4bd4616d1a862c281ee9', class: "pn-tile-text" }, h("h3", { key: 'c2459327b7ac973e8f7f4c372c6457d70db4bfde', 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: '661061f5e03c7b658967e1c9e306857b730203b0', icon: open_in_new, small: true, color: "blue700" })), h("div", { key: '8c51850bc85b2223dcd67c81d8f15a78ec9ef3cc', class: "pn-tile-slot" }, !!this.text && h("p", { key: '9759d3fd1a5a5219dc22a31ab874eab2475e14d8', class: "pn-tile-paragraph" }, this.text), h("slot", { key: 'b3e0e1442bfb5cc003e696be617c879919facbbc' }))))));
|
|
76
76
|
}
|
|
77
77
|
static get is() { return "pn-tile"; }
|
|
78
78
|
static get originalStyleUrls() {
|
|
@@ -72,7 +72,7 @@ export class PnOcrSearch {
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
render() {
|
|
75
|
-
return (h(Host, { key: '
|
|
75
|
+
return (h(Host, { key: '7cf50eabd6310124086f1674537bbb5f73ac6714' }, h("pn-search-field", { key: 'b8a24cdd8fdbb4ad6ac051bddd064f731bac8880', 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()));
|
|
76
76
|
}
|
|
77
77
|
static get is() { return "pn-ocr-search"; }
|
|
78
78
|
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: '2631586788c0b4fc5e5b4914dd44e9b20c87598e' }, h("pn-search-field", { key: '0d9743b99db487cb1acb27825fca4e872e25c72d', 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() {
|
|
@@ -23,22 +23,24 @@ export const marketMap = {
|
|
|
23
23
|
const humanReadableFileSize = {
|
|
24
24
|
KB: 1024,
|
|
25
25
|
MB: 1024 * 1024,
|
|
26
|
-
GB: 1024 * 1024,
|
|
27
|
-
TB: 1024 * 1024 * 1024,
|
|
26
|
+
GB: 1024 * 1024 * 1024,
|
|
27
|
+
TB: 1024 * 1024 * 1024 * 1024,
|
|
28
28
|
};
|
|
29
29
|
export const getBytesFromHumanReadableFileSize = function (sizeString) {
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
const normalized = sizeString.trim();
|
|
31
|
+
if (!normalized)
|
|
32
|
+
return 0;
|
|
33
|
+
const firstUnitCharIndex = normalized.search(/[a-zA-Z]/);
|
|
34
|
+
const sizePart = firstUnitCharIndex === -1 ? normalized : normalized.slice(0, firstUnitCharIndex).trim();
|
|
35
|
+
const unitPart = firstUnitCharIndex === -1 ? '' : normalized.slice(firstUnitCharIndex).trim();
|
|
36
|
+
if (!sizePart || (unitPart && !/^[a-zA-Z]{2}$/.test(unitPart)))
|
|
37
|
+
return 0;
|
|
38
|
+
const size = Number(sizePart);
|
|
39
|
+
if (!Number.isFinite(size))
|
|
40
|
+
return 0;
|
|
41
|
+
const unit = unitPart.toUpperCase();
|
|
42
|
+
const baseSize = humanReadableFileSize[unit];
|
|
43
|
+
return baseSize ? size * baseSize : size;
|
|
42
44
|
};
|
|
43
45
|
export function isSmallScreen() {
|
|
44
46
|
return window.innerWidth / 16 < 55;
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* By PostNord.
|
|
4
4
|
*/
|
|
5
|
-
import{transformTag as n}from"@stencil/core/internal/client";const t=[];for(let n=0;n<256;++n)t.push((n+256).toString(16).slice(1));let o;const
|
|
5
|
+
import{transformTag as n}from"@stencil/core/internal/client";const t=[];for(let n=0;n<256;++n)t.push((n+256).toString(16).slice(1));let o;const r=new Uint8Array(16);var e={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};const s="SE",u="DK",c="FI",i="NO",a="sv",d="en",p="da",f="fi",m="no",w=[s,"DK","FI","NO"],l=[a,d,p,f,m],y={SE:[a,d],DK:[p,d],FI:[f,a,d],NO:[m,d]},h={KB:1024,MB:1048576,GB:1073741824,TB:1099511627776},b=function(n){const t=n.trim();if(!t)return 0;const o=t.search(/[a-zA-Z]/),r=-1===o?t:t.slice(0,o).trim(),e=-1===o?"":t.slice(o).trim();if(!r||e&&!/^[a-zA-Z]{2}$/.test(e))return 0;const s=Number(r);if(!Number.isFinite(s))return 0;const u=e.toUpperCase(),c=h[u];return c?s*c:s};function g(){return window.innerWidth/16<55}function v(){const{matches:n}=window.matchMedia("(prefers-reduced-motion: reduce)");return n}const N=()=>{return e.randomUUID?e.randomUUID():function(n){const e=(n=n||{}).random??n.rng?.()??function(){if(!o){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");o=crypto.getRandomValues.bind(crypto)}return o(r)}();if(e.length<16)throw new Error("Random bytes length must be >= 16");return e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(n,o=0){return(t[n[o+0]]+t[n[o+1]]+t[n[o+2]]+t[n[o+3]]+"-"+t[n[o+4]]+t[n[o+5]]+"-"+t[n[o+6]]+t[n[o+7]]+"-"+t[n[o+8]]+t[n[o+9]]+"-"+t[n[o+10]]+t[n[o+11]]+t[n[o+12]]+t[n[o+13]]+t[n[o+14]]+t[n[o+15]]).toLowerCase()}(e)}(n);var n};function x(){return document?.querySelector("pn-topbar")?.offsetHeight||0}function D(){return g()&&document?.querySelector("pn-side-menu")?.offsetHeight||0}function B(){return g()?0:document?.querySelector("pn-side-menu")?.offsetWidth||0}function E(){const n=x()+D();return n>window.scrollY?n-window.scrollY:0}async function F(n){const t=()=>window.pnTopbar;function o(o){const r=o||t();return n.market=r.market,n.language=r.language,r.hasLoaded&&(t().onChangeMarket=t=>n.market=t,t().onChangeLanguage=t=>n.language=t),r}return await new Promise((r=>document.querySelector("pn-topbar")?t()?.hasLoaded?r(o()):void window.addEventListener("topbarLoaded",(()=>r(o()))):r(o({hasLoaded:!1,market:n.market||s,language:n.language||d}))))}const I=(t,o,r)=>{if(v())return;const{left:e,top:s,width:u,height:c}=o.getBoundingClientRect(),{clientX:i=0,clientY:a=0}=t||{},d=u>c?u:c,p=document.createElement(n("div"));p.classList.add("pn-ripple"),p.style.height=2*d+"px",p.style.width=2*d+"px",p.style.left=i>0?i-e+"px":"50%",p.style.top=a>0?a-s+"px":"50%",r?o.querySelector(r).appendChild(p):o.appendChild(p),setTimeout((()=>p.remove()),400)};export{u as D,c as F,i as N,s as S,y as a,x as b,D as c,p as d,d as e,f,b as g,B as h,g as i,E as j,F as k,l,w as m,m as n,I as o,v as r,a as s,N as u}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* By PostNord.
|
|
4
4
|
*/
|
|
5
|
-
import{transformTag as e,proxyCustomElement as t,HTMLElement as n,forceUpdate as o,h as
|
|
5
|
+
import{transformTag as e,proxyCustomElement as t,HTMLElement as n,forceUpdate as o,h as r,Host as c}from"@stencil/core/internal/client";const a=t(class extends n{constructor(e){super(),!1!==e&&this.__registerHost()}mo;closeEvent=new CustomEvent("rowstate",{detail:!1});get hostElement(){return this}single=!1;transparent=!1;connectedCallback(){this.mo=new MutationObserver((()=>o(this.hostElement))),this.mo.observe(this.hostElement,{childList:!0,subtree:!0})}disconnectedCallback(){this.mo.disconnect()}handleSingleRow({detail:t}){if(!this.single)return;const n=e("pn-accordion-row"),o=t.element.closest(n);Array.from(this.hostElement.querySelectorAll(n)).forEach((e=>!e.isSameNode(o)&&e.dispatchEvent(this.closeEvent)))}render(){return r(c,{key:"e6a1b3b18e0b6f366191f7b25154349e8fb3f81d",class:"pn-accordion","data-transparent":this.transparent},r("slot",{key:"4bdd61aafbb42520ed3af9e50045376104bee491"}))}static get style(){return`${e("pn-accordion")}{position:relative;background-color:#ffffff;display:flex;align-items:stretch;flex-direction:column;gap:0.25em}${e("pn-accordion")}[data-transparent]{background-color:transparent}${e("pn-accordion")}>${e("pn-accordion-row")}+${e("pn-accordion-row")}:after{content:"";position:absolute;top:-0.125em;left:0.25em;width:calc(100% - 0.5em);height:0;border-top:0.0625em solid #d3cecb}`}},[772,"pn-accordion",{single:[4],transparent:[4]},[[0,"togglerow","handleSingleRow"]]]),i=a,s=function(){"undefined"!=typeof customElements&&["pn-accordion"].forEach((t=>{"pn-accordion"===t&&(customElements.get(e(e(t)))||customElements.define(e(e(t)),a))}))};export{i as PnAccordion,s as defineCustomElement}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* By PostNord.
|
|
4
4
|
*/
|
|
5
|
-
import{transformTag as n,proxyCustomElement as t,Mixin as e,createEvent as i,h as o,Host as a}from"@stencil/core/internal/client";import{a as r}from"./index2.js";import{u as c,k as s,e as u,i as p,j as m,h as l,o as d}from"./helpers.js";import{c as b}from"./chevron_down.js";import{c as h,a as f}from"./chevron_right.js";import{o as g}from"./open_in_new.js";import{d as k}from"./pn-button2.js";import{d as $}from"./pn-icon2.js";import{d as v}from"./pn-spinner2.js";const y={BACK:{sv:"Tillbaka",en:"Back",da:"Tilbage",fi:"Takaisin",no:"Tilbake"}},x=t(class extends(e(r)){constructor(n){super(!1),!1!==n&&this.__registerHost(),this.menuToggle=i(this,"menuToggle",7),this.menuVisible=i(this,"menuVisible",7),this.menuOption=i(this,"menuOption",7)}id="pn-action-menu-"+c();menuButtonId=this.id+"-button";menuListId=this.id+"-list";menuTrigger;menuContainer;menuList;timeout;menuWidth=256;get hostElement(){return this}smallMenu=null;upwards=!1;activeSubmenu=[];options=[];button;menuId=this.id;language=null;open=!1;menuUp=!1;menuLeft=!1;menuToggle;menuVisible;menuOption;handleOptions(){this.setMenuLayout()}openHandler(){this.setAnimationDuration(),requestAnimationFrame((()=>{this.open&&!this.isMoving()&&(this.setOffset(),this.setMenuLayout()),this.dropdownHandler(),this.menuToggle.emit({open:this.open}),clearTimeout(this.timeout),this.timeout=setTimeout((()=>{if(!this.open){this.activeSubmenu=[];const n=this.hostElement.querySelectorAll("[data-x]");Array.from(n).forEach((n=>{n.removeAttribute("data-x"),n.removeAttribute("data-y")}))}this.menuVisible.emit({visible:this.open})}),this.animationDuration)}))}handleMenuId(){this.menuButtonId=this.menuId+"-button",this.menuListId=this.menuId+"-list"}handleResize(){this.open&&this.toggleActionMenu(!1)}async componentWillLoad(){this.options.length||console.warn(this.hostElement.localName+": No options set."),this.handleMenuId(),this.setAnimationDuration(),null!==this.language&&await s(this.hostElement)}componentDidLoad(){this.setOffset(),requestAnimationFrame((()=>this.open&&this.dropdownHandler()))}translate(n){return y[n][this.language||u]}globalEvents=n=>{const t=n.target,e=t?.closest(this.hostElement.localName);e||this.closeEachSubMenu(!0)};addGlobalEventListeners(){this.hostElement.getRootNode().addEventListener("click",this.globalEvents)}removeGlobalEventListeners(){this.hostElement.getRootNode().removeEventListener("click",this.globalEvents)}toggleActionMenu(n){this.open=n??!this.open}setMenuLayout(){if(!this.menuContainer)return;this.isMoving()||this.resetMaxHeight();const n=this.getMenuMeasurements();this.setDirection(n),this.setMenuSize(n),this.setMaxHeight(n)}setDirection({hUp:n,hDown:t,sUp:e,sDown:i}){this.upwards=this.menuUp&&e>n||!(i>t)&&!(i>e)}setMenuSize({hUp:n,hDown:t,sUp:e,sDown:i}){const o=p()||!(this.upwards?e>n:i>t);o!==this.smallMenu&&(this.smallMenu=o)}setMaxHeight({hUp:n,hDown:t,sUp:e,sDown:i}){this.smallMenu?this.hostElement.style.setProperty("--pn-menu-height",(this.upwards?n>e?n-16:n:t>i?t-8:t)+"px"):this.resetMaxHeight()}resetMaxHeight(){this.hostElement.style.setProperty("--pn-menu-height","unset")}getRect(n){return n.getBoundingClientRect()}getMenuMeasurements(){const n=Array.from(this.menuContainer.querySelectorAll("menu")),t=Math.max(...n.map((n=>n.scrollHeight))),e=this.getRect(this.menuTrigger),i=this.getRect(this.menuContainer),o=e.top-m(),a=innerHeight-i.top;return{hUp:o>t?t:o,hDown:a>t?t:a,sUp:o,sDown:a}}setOffset(){const n=this.getRect(this.hostElement),t=l(),e=n.left,i=n.left+this.menuWidth,o=t+16,a=innerWidth-16;let r=0;e<o?r=o-e:i>a&&(r=a-i),this.menuContainer&&this.menuContainer.style.setProperty("--pn-action-menu-offset",r+"px")}getListId(n){return`pn-menu-${n.value}-list`}getButtonId(n){return`pn-menu-${n.value}-button`}getTriggerIcon(){if(!this.button?.icon)return b}getSubMenuPath(n,t,e=[]){for(const i of n){const n=[...e,i.value];if(i.value===t)return n;if(i.options||i.group){const e=this.getSubMenuPath(i.options||i.group,t,n);if(e)return e}}return null}closeEachSubMenu(n=!1){n||this.menuTrigger?.querySelector("button")?.focus({preventScroll:!0});const t=setInterval((()=>{this.smallMenu||0===this.activeSubmenu.length?(clearInterval(t),this.toggleActionMenu(!1)):(this.activeSubmenu.pop(),this.activeSubmenu=[...this.activeSubmenu])}),150)}escButton(n,t){const{key:e}=n;"Escape"===e&&(n.preventDefault(),n.stopImmediatePropagation(),this.isSubmenuActive(t.value)?this.toggleSub(t):this.toggleActionMenu())}dropdownHandler(){this.open?(this.addGlobalEventListeners(),this.openDropdown(this.menuContainer,this.menuList.clientHeight)):(this.removeGlobalEventListeners(),this.closeDropdown(this.menuContainer,this.menuList.clientHeight))}async optionSelect(n,t){const e=n?.options?.length?"submenu":n.input?"input":n.href?"link":"button",i="submenu"===e;i?this.toggleSub(n):"button"===e?this.closeEachSubMenu():"input"===e&&(n.checked=t.target.checked),this.menuOption.emit({option:n,type:e,click:t,open:i?this.isSubmenuActive(n.value):null});const o=t.target,a="input"===o.localName?o.nextElementSibling:"pn-action-menu-button"===o.className?o:o.closest(".pn-action-menu-button"),{x:r,width:c,y:s,top:u}=this.getRect(a);d("click"===t.type?t:{clientX:r+c-24,clientY:s-u},a),this.menuContainer.scrollTo({top:0})}toggleSub(n){const{value:t}=n,e=this.getSubMenuPath(this.options,t),i=this.activeSubmenu.includes(t);i&&e.splice(this.activeSubmenu.indexOf(t),1);const o=this.hostElement.querySelector("#"+this.getListId(n)),a=this.getRect(o),r=innerWidth-a.right-8,c=a.left>a.width,s=this.menuUp&&a.top-a.height>0?"top":"bottom";i||o.dataset.x||o.setAttribute("data-x",this.menuLeft&&c?"left":r>a.width?"right":c?"left":"center"),i||o.dataset.y||o.setAttribute("data-y",s),this.activeSubmenu=JSON.stringify(e)===JSON.stringify(this.activeSubmenu)?this.activeSubmenu.filter((n=>n!==t)):[...e]}isSubmenuActive(n){return this.activeSubmenu.includes(n)}isMenuActive(){const n=this.options.find((({value:n})=>this.activeSubmenu.every((t=>t===n))));return this.smallMenu&&(0===this.activeSubmenu?.length||n)}isCurrentSubMenu(n){return!(this.activeSubmenu[this.activeSubmenu.length-1]!==n)}getOptionTrailing(n){const t=n.options?.length&&h||n.trailingIcon||"_blank"===n.target&&g;return t?o("pn-icon",{icon:t,color:"blue700","data-suffix":!0,"data-active":this.isSubmenuActive(n.value)}):n.suffix?o("span",{class:"pn-action-menu-item-suffix"},n.suffix):void 0}renderCheckbox(n){const t=`pn-menu-${n.value}-label`,e=`pn-menu-${n.value}-helpertext`;return o("div",{class:"pn-action-menu-item-content"},o("input",{type:n.input,id:t,class:"pn-action-menu-input",name:n.name,value:n.value,checked:n.checked,disabled:n.disabled,"aria-describedby":n.helpertext?e:null,onInput:t=>this.optionSelect(n,t),tabIndex:this.open?null:-1}),o("div",{class:"pn-action-menu-button"},!!n.icon&&o("pn-icon",{icon:n.icon,color:"blue700"}),o("div",{class:"pn-action-menu-item-text"},o("label",{htmlFor:t,class:"pn-action-menu-item-label"},n.label),n.helpertext&&o("p",{id:e,class:"pn-action-menu-item-helpertext"},o("span",null,n.helpertext))),"checkbox"===n.input?o("div",{class:"pn-action-menu-checkbox"},o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},o("polyline",{class:"pn-action-menu-checkbox-checkmark-path",points:"4,12 9,17 20,6","stroke-width":"3"}))):o("div",{class:"pn-action-menu-radio"},o("div",{class:"pn-action-menu-radio-outer"},o("div",{class:"pn-action-menu-radio-inner"})))))}renderButton(n){const t="BACK"===n.label,e=!!n?.options?.length,i=!!n?.group?.length,a=!!n.href&&!e&&!i,r=t?"-close":"",c=t||!!n.icon,s=t?null:this.getOptionTrailing(n),u=this.isSubmenuActive(n.value),p=e?{"aria-haspopup":"true","aria-controls":u?this.getListId(n):null,"aria-expanded":u?.toString()}:{},m=a?{href:n.href,target:n.target}:{disabled:n.disabled},l=a?"a":"button";return i?o("div",{class:"pn-action-menu-group-label"},o("p",{class:"pn-action-menu-p"},n.label),n.helpertext&&o("p",{class:"pn-action-menu-group-helpertext"},n.helpertext)):o("div",{class:"pn-action-menu-item-content","data-close":t},o(l,{id:this.getButtonId(n)+r,class:"pn-action-menu-button",...p,...m,tabIndex:this.open?null:-1,onClick:t=>this.optionSelect(n,t),onKeyDown:t=>this.escButton(t,n)},c&&o("pn-icon",{icon:t?f:n.icon,color:"blue700"}),o("div",{class:"pn-action-menu-item-text"},o("span",{class:"pn-action-menu-item-label"},t?this.translate("BACK"):n.label),n.helpertext&&!a&&o("span",{class:"pn-action-menu-item-helpertext"},n.helpertext)),s))}renderSub(n){return o("menu",{id:this.getListId(n),"aria-labelledby":this.getButtonId(n),class:"pn-action-menu-sub","data-open":this.isSubmenuActive(n.value)?.toString(),"data-current":this.isCurrentSubMenu(n.value)},this.smallMenu&&o("li",{class:"pn-action-menu-item"},this.renderButton({label:"BACK",value:n.value,options:n.options})),n.options.map((n=>this.renderMenuItem(n))))}renderGroup(n){return o("menu",{class:"pn-action-menu-group"},n.group.map((n=>this.renderMenuItem(n))))}renderMenuItem(n){const t=!!n?.options?.length,e=!t&&!!n?.group?.length;return o("li",{class:"pn-action-menu-item","data-group":e,"data-sub":t},!n.input||t||e?this.renderButton(n):this.renderCheckbox(n),t?this.renderSub(n):e&&this.renderGroup(n))}renderMenu(){return o("div",{id:this.menuListId,class:"pn-action-menu-container",role:"region","aria-labelledby":this.menuButtonId,"data-open":this.open,"data-upwards":this.upwards,"data-small":this.smallMenu,style:{height:"0px"},ref:n=>this.menuContainer=n},o("menu",{class:"pn-action-menu-list","data-current":this.isMenuActive(),ref:n=>this.menuList=n},this.options?.map((n=>this.renderMenuItem(n)))))}render(){return o(a,{key:"d77e6c7f658e2552260f5a8a30034a8d68d9bfa2"},o("div",{key:"3d2584a7c12abf5948cec24c967ab573d33dafa0",id:this.menuId!==this.id?this.menuId:null,class:"pn-action-menu"},o("pn-button",{key:"f8460fca3784d2cb04ac55bfa0070935006c864d",icon:this.getTriggerIcon(),...this.button,buttonId:this.menuButtonId,tooltipUp:!this.upwards,ariahaspopup:"true",ariacontrols:this.open?this.menuListId:null,ariaexpanded:""+this.open,"data-default-icon":!this.button?.icon,onPnClick:()=>this.toggleActionMenu(),ref:n=>this.menuTrigger=n}),this.renderMenu()))}static get watchers(){return{options:[{handleOptions:0}],open:[{openHandler:0}],menuId:[{handleMenuId:0}]}}static get style(){return`${n("pn-action-menu")}{--pn-menu-height:unset;display:inline-block;position:relative}${n("pn-action-menu")} .pn-action-menu{position:relative}${n("pn-action-menu")} .pn-action-menu-container{--pn-action-menu-offset:0;scroll-behavior:smooth;list-style:none;text-align:left;position:absolute;z-index:100;top:calc(100% + 0.5em);left:var(--pn-action-menu-offset);right:0;background-color:#ffffff;box-shadow:0em 0.075em 0.225em 0em rgba(0, 0, 0, 0.1), 0em 0.4em 0.9em 0em rgba(0, 0, 0, 0.13);border-radius:0.5em;margin:0;padding:0;width:16em;visibility:hidden;overflow:hidden}${n("pn-action-menu")} .pn-action-menu-container[data-open]{visibility:visible;overflow:unset}${n("pn-action-menu")} .pn-action-menu-container[data-left]{right:0;left:unset}${n("pn-action-menu")} .pn-action-menu-container[data-upwards]{top:unset;bottom:calc(100% + 0.5em);transform-origin:bottom left}${n("pn-action-menu")} .pn-action-menu-container[data-moving]{overflow:hidden;visibility:visible;pointer-events:none}${n("pn-action-menu")} .pn-action-menu-container{}${n("pn-action-menu")} .pn-action-menu-container[data-small] .pn-action-menu-list{border-radius:0.5em;visibility:hidden;transition-property:visibility;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${n("pn-action-menu")} .pn-action-menu-container[data-small] .pn-action-menu-list{transition-duration:0s;transition-delay:0s}}${n("pn-action-menu")} .pn-action-menu-container[data-small] .pn-action-menu-list{transition-delay:0.2s}${n("pn-action-menu")} .pn-action-menu-container[data-small] .pn-action-menu-list[data-current]{overflow-x:auto;visibility:visible;transition-delay:0s}${n("pn-action-menu")} .pn-action-menu-container[data-small][data-moving]>.pn-action-menu-list{visibility:visible}${n("pn-action-menu")} .pn-action-menu-container[data-small] .pn-action-menu-item{position:unset}${n("pn-action-menu")} .pn-action-menu-container[data-small] .pn-action-menu-sub{left:0;height:100%;box-shadow:unset;transform:translateX(0);visibility:hidden}${n("pn-action-menu")} .pn-action-menu-container[data-small] .pn-action-menu-sub[data-current]{visibility:visible;overflow-x:auto}${n("pn-action-menu")} .pn-action-menu-container::-webkit-scrollbar{background-color:#ffffff;width:0.875em;border-radius:0.5em}${n("pn-action-menu")} .pn-action-menu-container::-webkit-scrollbar-track{background-color:#ffffff;border-radius:0.5em}${n("pn-action-menu")} .pn-action-menu-container::-webkit-scrollbar-thumb{cursor:pointer;background-color:#969087;border-radius:1em;border:0.25em solid #ffffff}${n("pn-action-menu")} .pn-action-menu-container::-webkit-scrollbar-thumb:hover{background-color:#5e554a}${n("pn-action-menu")} .pn-action-menu-container::-webkit-scrollbar-corner,${n("pn-action-menu")} .pn-action-menu-container::-webkit-scrollbar-button{display:none}${n("pn-action-menu")} .pn-action-menu-list{margin:0;padding:0;list-style:none;height:var(--pn-menu-height)}${n("pn-action-menu")} .pn-action-menu-list::-webkit-scrollbar{background-color:#ffffff;width:0.875em;border-radius:0.5em}${n("pn-action-menu")} .pn-action-menu-list::-webkit-scrollbar-track{background-color:#ffffff;border-radius:0.5em}${n("pn-action-menu")} .pn-action-menu-list::-webkit-scrollbar-thumb{cursor:pointer;background-color:#969087;border-radius:1em;border:0.25em solid #ffffff}${n("pn-action-menu")} .pn-action-menu-list::-webkit-scrollbar-thumb:hover{background-color:#5e554a}${n("pn-action-menu")} .pn-action-menu-list::-webkit-scrollbar-corner,${n("pn-action-menu")} .pn-action-menu-list::-webkit-scrollbar-button{display:none}${n("pn-action-menu")} .pn-action-menu-group{margin:0;padding:0;list-style:none}${n("pn-action-menu")} .pn-action-menu-group-label{display:block;color:#2d2013;font-weight:700;font-size:0.875em;padding:1em 1em 0.5em}${n("pn-action-menu")} .pn-action-menu-group-helpertext{display:block;color:#5e554a;font-weight:400;margin:0.25em 0 0}${n("pn-action-menu")} .pn-action-menu-sub{z-index:110;position:absolute;top:0;width:100%;min-width:12em;margin:0;padding:0;list-style:none;background:#ffffff;border-radius:0.5em;box-shadow:0em 0.075em 0.225em 0em rgba(0, 0, 0, 0.1), 0em 0.4em 0.9em 0em rgba(0, 0, 0, 0.13);transform:translateX(-0.5em);opacity:0;visibility:hidden}${n("pn-action-menu")} .pn-action-menu-sub::-webkit-scrollbar{background-color:#ffffff;width:0.875em;border-radius:0.5em}${n("pn-action-menu")} .pn-action-menu-sub::-webkit-scrollbar-track{background-color:#ffffff;border-radius:0.5em}${n("pn-action-menu")} .pn-action-menu-sub::-webkit-scrollbar-thumb{cursor:pointer;background-color:#969087;border-radius:1em;border:0.25em solid #ffffff}${n("pn-action-menu")} .pn-action-menu-sub::-webkit-scrollbar-thumb:hover{background-color:#5e554a}${n("pn-action-menu")} .pn-action-menu-sub::-webkit-scrollbar-corner,${n("pn-action-menu")} .pn-action-menu-sub::-webkit-scrollbar-button{display:none}${n("pn-action-menu")} .pn-action-menu-sub{transition-property:transform, opacity, visibility;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${n("pn-action-menu")} .pn-action-menu-sub{transition-duration:0s;transition-delay:0s}}${n("pn-action-menu")} .pn-action-menu-sub{transition-delay:0s, 0s, 0.2s}${n("pn-action-menu")} .pn-action-menu-sub[data-open=true]{transform:translateX(0);opacity:1;visibility:visible;transition-delay:0s, 0s, 0s}${n("pn-action-menu")} .pn-action-menu-sub[data-open=false]{pointer-events:none}${n("pn-action-menu")} .pn-action-menu-sub[data-x=left]{left:-100%}${n("pn-action-menu")} .pn-action-menu-sub[data-x=center]{left:0}${n("pn-action-menu")} .pn-action-menu-sub[data-x=right]{left:100%}${n("pn-action-menu")} .pn-action-menu-sub[data-y=top]{top:unset;bottom:0}${n("pn-action-menu")} .pn-action-menu-sub[data-y=bottom]{top:0}${n("pn-action-menu")} .pn-action-menu-item{position:relative}${n("pn-action-menu")} .pn-action-menu-item:first-child>.pn-action-menu-item-content>.pn-action-menu-button{border-top-left-radius:0.5em;border-top-right-radius:0.5em}${n("pn-action-menu")} .pn-action-menu-item:last-child>.pn-action-menu-item-content>.pn-action-menu-button{border-bottom-right-radius:0.5em;border-bottom-left-radius:0.5em}${n("pn-action-menu")} .pn-action-menu-item-text{display:flex;flex-direction:column;margin-right:auto}${n("pn-action-menu")} .pn-action-menu-item-label{color:#005d92;font-weight:500;text-decoration:none}${n("pn-action-menu")} .pn-action-menu-item-suffix{margin-left:auto;font-weight:400;color:#5e554a}${n("pn-action-menu")} .pn-action-menu-item-helpertext{color:#5e554a;font-weight:400}${n("pn-action-menu")} .pn-action-menu-item-content{display:flex;align-items:center;flex-direction:row;flex:1 1 100%;gap:0.5em;position:relative}${n("pn-action-menu")} .pn-action-menu-item-content[data-close]{border-bottom:0.0625em solid #d3cecb}${n("pn-action-menu")} .pn-action-menu-item-content>${n("pn-icon")}{padding:0 0.25em}${n("pn-action-menu")} .pn-action-menu-item[data-group],${n("pn-action-menu")} .pn-action-menu-item[data-sub]{flex-direction:column}${n("pn-action-menu")} .pn-action-menu-button{cursor:pointer;position:relative;-webkit-tap-highlight-color:transparent;line-height:1.5;padding:0.75em 1em;border:0;width:100%;text-align:left;text-decoration-color:transparent;overflow:hidden;display:flex;align-items:center;flex:1 1 100%;gap:0.5em;font-size:1em;min-height:1.5em;background-color:#ffffff;transition-property:background-color, color, outline-color, text-decoration-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${n("pn-action-menu")} .pn-action-menu-button{transition-duration:0s;transition-delay:0s}}${n("pn-action-menu")} .pn-action-menu-button .pn-ripple{animation:ripple 0.4s cubic-bezier(0.7, 0, 0.3, 1);position:absolute;border-radius:50%;background-color:#0d234b;transform:translate(-50%, -50%) scale(0);opacity:0.1;pointer-events:none;z-index:3}@keyframes ripple{to{transform:translate(-50%, -50%) scale(1);opacity:0}}${n("pn-action-menu")} .pn-action-menu-button{outline:0.2rem solid transparent;outline-offset:0.2rem}${n("pn-action-menu")} .pn-action-menu-button:focus-visible{outline-color:#005d92}${n("pn-action-menu")} .pn-action-menu-button{outline-offset:-0.2rem}${n("pn-action-menu")} .pn-action-menu-button>${n("pn-icon")} .pn-icon-svg>path{transform-origin:center;transform:rotate(0deg);transition-property:transform;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${n("pn-action-menu")} .pn-action-menu-button>${n("pn-icon")} .pn-icon-svg>path{transition-duration:0s;transition-delay:0s}}${n("pn-action-menu")} .pn-action-menu-button>${n("pn-icon")}[data-suffix][data-active]>.pn-icon-svg>path{transform:rotate(180deg)}${n("pn-action-menu")} .pn-action-menu-button>${n("pn-icon")}:last-child{margin-left:auto}${n("pn-action-menu")} .pn-action-menu-button:disabled{pointer-events:none;color:#5e554a;background-color:#f3f2f2}${n("pn-action-menu")} .pn-action-menu-button:hover{background-color:#effbff}${n("pn-action-menu")} .pn-action-menu-button:focus{background-color:#e0f8ff}${n("pn-action-menu")} .pn-action-menu-button[href]:hover,${n("pn-action-menu")} .pn-action-menu-button[href]:focus{text-decoration-color:#005d92}${n("pn-action-menu")} .pn-action-menu-button{}${n("pn-action-menu")} .pn-action-menu-checkbox{background-color:#ffffff;flex:0 0 1.5em;width:1.5em;height:1.5em;border:0.0625em solid #969087;border-radius:0.25em;margin-left:auto;outline:0.2rem solid transparent;outline-offset:0.2rem;transition-property:background-color, border-color, outline-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${n("pn-action-menu")} .pn-action-menu-checkbox{transition-duration:0s;transition-delay:0s}}${n("pn-action-menu")} .pn-action-menu-checkbox svg polyline{stroke:#ffffff;stroke-linecap:round;stroke-dasharray:23;transition-property:stroke-dashoffset;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${n("pn-action-menu")} .pn-action-menu-checkbox svg polyline{transition-duration:0s;transition-delay:0s}}${n("pn-action-menu")} .pn-action-menu-checkbox svg polyline{transition-delay:0s}${n("pn-action-menu")} .pn-action-menu-checkbox svg polyline.pn-action-menu-checkbox-checkmark-path{stroke-dashoffset:23}${n("pn-action-menu")} .pn-action-menu-radio{display:flex;gap:0.75em;padding:0;margin-left:auto}${n("pn-action-menu")} .pn-action-menu-radio-outer{background-color:#ffffff;border:0.0625em solid #969087;border-radius:50%;height:1.5em;width:1.5em;display:flex;justify-content:center;align-items:center;outline:0.2rem solid transparent;outline-offset:0.2rem;transition-property:border-color, background-color, outline-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${n("pn-action-menu")} .pn-action-menu-radio-outer{transition-duration:0s;transition-delay:0s}}${n("pn-action-menu")} .pn-action-menu-radio-inner{transform:scale(0);height:0.75em;width:0.75em;background-color:#005d92;border-radius:50%;transform-origin:center center;transition-property:background-color, transform;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${n("pn-action-menu")} .pn-action-menu-radio-inner{transition-duration:0s;transition-delay:0s}}${n("pn-action-menu")} .pn-action-menu-input{position:absolute;z-index:10;cursor:pointer;height:100%;width:100%;top:0;left:0;margin:0;opacity:0;-webkit-tap-highlight-color:transparent}${n("pn-action-menu")} .pn-action-menu-input:checked+.pn-action-menu-button{background-color:#effbff}${n("pn-action-menu")} .pn-action-menu-input:checked+.pn-action-menu-button .pn-action-menu-checkbox{border-color:#005d92;background-color:#005d92}${n("pn-action-menu")} .pn-action-menu-input:checked+.pn-action-menu-button .pn-action-menu-checkbox polyline.pn-action-menu-checkbox-checkmark-path{transition-delay:0.2s;stroke-dashoffset:0}${n("pn-action-menu")} .pn-action-menu-input:checked+.pn-action-menu-button .pn-action-menu-radio-outer{border-color:#005d92}${n("pn-action-menu")} .pn-action-menu-input:checked+.pn-action-menu-button .pn-action-menu-radio-inner{transform:scale(1);background-color:#005d92}${n("pn-action-menu")} .pn-action-menu-input:checked:hover{background-color:#e0f8ff}${n("pn-action-menu")} .pn-action-menu-input:focus-visible+.pn-action-menu-button{background-color:#e0f8ff}${n("pn-action-menu")} .pn-action-menu-input:disabled{pointer-events:none}${n("pn-action-menu")} .pn-action-menu-input:disabled+.pn-action-menu-button{pointer-events:none;color:#5e554a;background-color:#f3f2f2}${n("pn-action-menu")} .pn-action-menu-input:disabled+.pn-action-menu-button .pn-action-menu-item-label{color:#5e554a}${n("pn-action-menu")} .pn-action-menu-input:disabled+.pn-action-menu-button .pn-action-menu-checkbox{background-color:#f3f2f2}${n("pn-action-menu")} .pn-action-menu-input:disabled+.pn-action-menu-button .pn-action-menu-radio-outer{border-color:#969087;background-color:#f3f2f2}${n("pn-action-menu")} .pn-action-menu-input:disabled+.pn-action-menu-button .pn-icon-svg path{fill:#5e554a}${n("pn-action-menu")} .pn-action-menu-input:disabled:checked+.pn-action-menu-button .pn-action-menu-radio-inner{background-color:#969087}${n("pn-action-menu")} .pn-action-menu-input:disabled:checked+.pn-action-menu-button .pn-action-menu-checkbox{border-color:#969087;background-color:#969087}${n("pn-action-menu")} .pn-action-menu-input:hover+.pn-action-menu-button{background-color:#e0f8ff}${n("pn-action-menu")} .pn-action-menu-input:hover+.pn-action-menu-button .pn-action-menu-radio-outer{border-color:#005d92;background-color:#e0f8ff}${n("pn-action-menu")} .pn-action-menu-input:focus-visible+.pn-action-menu-button{background-color:#e0f8ff}${n("pn-action-menu")} .pn-action-menu-input:focus-visible+.pn-action-menu-button .pn-action-menu-checkbox,${n("pn-action-menu")} .pn-action-menu-input:focus-visible+.pn-action-menu-button .pn-action-menu-radio .pn-action-menu-radio-outer{outline-color:#005d92}${n("pn-action-menu")} .pn-action-menu-p{margin:0}${n("pn-action-menu")} .pn-action-menu>${n("pn-button")}[data-default-icon] .pn-button[aria-expanded=true] .pn-icon-svg{transform:rotate(180deg);transition-delay:0s}${n("pn-action-menu")} .pn-action-menu>${n("pn-button")}[data-default-icon] .pn-button .pn-icon-svg{transform:rotate(0deg);transition-delay:0.2s;transition-property:transform;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${n("pn-action-menu")} .pn-action-menu>${n("pn-button")}[data-default-icon] .pn-button .pn-icon-svg{transition-duration:0s;transition-delay:0s}}`}},[512,"pn-action-menu",{options:[16],button:[16],menuId:[1,"menu-id"],language:[1025],open:[1540],menuUp:[4,"menu-up"],menuLeft:[4,"menu-left"],isClosing:[32],isExpanding:[32],smallMenu:[32],upwards:[32],activeSubmenu:[32]},[[9,"resize","handleResize"]],{options:[{handleOptions:0}],open:[{openHandler:0}],menuId:[{handleMenuId:0}]}]),w=x,z=function(){"undefined"!=typeof customElements&&["pn-action-menu","pn-button","pn-icon","pn-spinner"].forEach((t=>{switch(t){case"pn-action-menu":customElements.get(n(n(t)))||customElements.define(n(n(t)),x);break;case"pn-button":customElements.get(n(n(t)))||k();break;case"pn-icon":customElements.get(n(n(t)))||$();break;case"pn-spinner":customElements.get(n(n(t)))||v()}}))};export{w as PnActionMenu,z as defineCustomElement}
|
|
5
|
+
import{transformTag as n,proxyCustomElement as t,Mixin as e,createEvent as i,h as o,Host as a}from"@stencil/core/internal/client";import{a as c}from"./index2.js";import{u as r,k as s,e as u,i as p,j as m,h as l,o as d}from"./helpers.js";import{c as b}from"./chevron_down.js";import{c as h,a as f}from"./chevron_right.js";import{o as g}from"./open_in_new.js";import{d as k}from"./pn-button2.js";import{d as $}from"./pn-icon2.js";import{d as v}from"./pn-spinner2.js";const y={BACK:{sv:"Tillbaka",en:"Back",da:"Tilbage",fi:"Takaisin",no:"Tilbake"}},x=t(class extends(e(c)){constructor(n){super(!1),!1!==n&&this.__registerHost(),this.menuToggle=i(this,"menuToggle",7),this.menuVisible=i(this,"menuVisible",7),this.menuOption=i(this,"menuOption",7)}id="pn-action-menu-"+r();menuButtonId=this.id+"-button";menuListId=this.id+"-list";menuTrigger;menuContainer;menuList;timeout;menuWidth=256;get hostElement(){return this}smallMenu=null;upwards=!1;activeSubmenu=[];options=[];button;menuId=this.id;language=null;open=!1;menuUp=!1;menuLeft=!1;menuToggle;menuVisible;menuOption;handleOptions(){this.setMenuLayout()}openHandler(){this.setAnimationDuration(),requestAnimationFrame((()=>{this.open&&!this.isMoving()&&(this.setOffset(),this.setMenuLayout()),this.dropdownHandler(),this.menuToggle.emit({open:this.open}),clearTimeout(this.timeout),this.timeout=setTimeout((()=>{if(!this.open){this.activeSubmenu=[];const n=this.hostElement.querySelectorAll("[data-x]");Array.from(n).forEach((n=>{n.removeAttribute("data-x"),n.removeAttribute("data-y")}))}this.menuVisible.emit({visible:this.open})}),this.animationDuration)}))}handleMenuId(){this.menuButtonId=this.menuId+"-button",this.menuListId=this.menuId+"-list"}handleResize(){this.open&&this.toggleActionMenu(!1)}async componentWillLoad(){this.options.length||console.warn(this.hostElement.localName+": No options set."),this.handleMenuId(),this.setAnimationDuration(),null!==this.language&&await s(this.hostElement)}componentDidLoad(){this.setOffset(),requestAnimationFrame((()=>this.open&&this.dropdownHandler()))}translate(n){return y[n][this.language||u]}globalEvents=n=>{const t=n.target,e=t?.closest(this.hostElement.localName);e||this.closeEachSubMenu(!0)};addGlobalEventListeners(){this.hostElement.getRootNode().addEventListener("click",this.globalEvents)}removeGlobalEventListeners(){this.hostElement.getRootNode().removeEventListener("click",this.globalEvents)}toggleActionMenu(n){this.open=n??!this.open}setMenuLayout(){if(!this.menuContainer)return;this.isMoving()||this.resetMaxHeight();const n=this.getMenuMeasurements();this.setDirection(n),this.setMenuSize(n),this.setMaxHeight(n)}setDirection({hUp:n,hDown:t,sUp:e,sDown:i}){this.upwards=this.menuUp&&e>n||!(i>t)&&!(i>e)}setMenuSize({hUp:n,hDown:t,sUp:e,sDown:i}){const o=p()||!(this.upwards?e>n:i>t);o!==this.smallMenu&&(this.smallMenu=o)}setMaxHeight({hUp:n,hDown:t,sUp:e,sDown:i}){this.smallMenu?this.hostElement.style.setProperty("--pn-menu-height",(this.upwards?n>e?n-16:n:t>i?t-8:t)+"px"):this.resetMaxHeight()}resetMaxHeight(){this.hostElement.style.setProperty("--pn-menu-height","unset")}getRect(n){return n.getBoundingClientRect()}getMenuMeasurements(){const n=Array.from(this.menuContainer.querySelectorAll("menu")),t=Math.max(...n.map((n=>n.scrollHeight))),e=this.getRect(this.menuTrigger),i=this.getRect(this.menuContainer),o=e.top-m(),a=innerHeight-i.top;return{hUp:o>t?t:o,hDown:a>t?t:a,sUp:o,sDown:a}}setOffset(){const n=this.getRect(this.hostElement),t=l(),e=n.left,i=n.left+this.menuWidth,o=t+16,a=innerWidth-16;let c=0;e<o?c=o-e:i>a&&(c=a-i),this.menuContainer&&this.menuContainer.style.setProperty("--pn-action-menu-offset",c+"px")}getListId(n){return`pn-menu-${n.value}-list`}getButtonId(n){return`pn-menu-${n.value}-button`}getTriggerIcon(){if(!this.button?.icon)return b}getSubMenuPath(n,t,e=[]){for(const i of n){const n=[...e,i.value];if(i.value===t)return n;if(i.options||i.group){const e=this.getSubMenuPath(i.options||i.group,t,n);if(e)return e}}return null}closeEachSubMenu(n=!1){n||this.menuTrigger?.querySelector("button")?.focus({preventScroll:!0});const t=setInterval((()=>{this.smallMenu||0===this.activeSubmenu.length?(clearInterval(t),this.toggleActionMenu(!1)):(this.activeSubmenu.pop(),this.activeSubmenu=[...this.activeSubmenu])}),150)}escButton(n,t){const{key:e}=n;"Escape"===e&&(n.preventDefault(),n.stopImmediatePropagation(),this.isSubmenuActive(t.value)?this.toggleSub(t):this.toggleActionMenu())}dropdownHandler(){this.open?(this.addGlobalEventListeners(),this.openDropdown(this.menuContainer,this.menuList.clientHeight)):(this.removeGlobalEventListeners(),this.closeDropdown(this.menuContainer,this.menuList.clientHeight))}async optionSelect(n,t){const e=n?.options?.length?"submenu":n.input?"input":n.href?"link":"button",i="submenu"===e;i?this.toggleSub(n):"button"===e?this.closeEachSubMenu():"input"===e&&(n.checked=t.target.checked),this.menuOption.emit({option:n,type:e,click:t,open:i?this.isSubmenuActive(n.value):null});const o=t.target,a="input"===o.localName?o.nextElementSibling:"pn-action-menu-button"===o.className?o:o.closest(".pn-action-menu-button"),{x:c,width:r,y:s,top:u}=this.getRect(a);d("click"===t.type?t:{clientX:c+r-24,clientY:s-u},a),this.menuContainer.scrollTo({top:0})}toggleSub(n){const{value:t}=n,e=this.getSubMenuPath(this.options,t),i=this.activeSubmenu.includes(t);i&&e.splice(this.activeSubmenu.indexOf(t),1);const o=this.hostElement.querySelector("#"+this.getListId(n)),a=this.getRect(o),c=innerWidth-a.right-8,r=a.left>a.width,s=this.menuUp&&a.top-a.height>0?"top":"bottom";i||o.dataset.x||o.setAttribute("data-x",this.menuLeft&&r?"left":c>a.width?"right":r?"left":"center"),i||o.dataset.y||o.setAttribute("data-y",s),this.activeSubmenu=JSON.stringify(e)===JSON.stringify(this.activeSubmenu)?this.activeSubmenu.filter((n=>n!==t)):[...e]}isSubmenuActive(n){return this.activeSubmenu.includes(n)}isMenuActive(){const n=this.options.find((({value:n})=>this.activeSubmenu.every((t=>t===n))));return this.smallMenu&&(0===this.activeSubmenu?.length||n)}isCurrentSubMenu(n){return!(this.activeSubmenu[this.activeSubmenu.length-1]!==n)}getOptionTrailing(n){const t=n.options?.length&&h||n.trailingIcon||"_blank"===n.target&&g;return t?o("pn-icon",{icon:t,color:"blue700","data-suffix":!0,"data-active":this.isSubmenuActive(n.value)}):n.suffix?o("span",{class:"pn-action-menu-item-suffix"},n.suffix):void 0}renderCheckbox(n){const t=`pn-menu-${n.value}-label`,e=`pn-menu-${n.value}-helpertext`;return o("div",{class:"pn-action-menu-item-content"},o("input",{type:n.input,id:t,class:"pn-action-menu-input",name:n.name,value:n.value,checked:n.checked,disabled:n.disabled,"aria-describedby":n.helpertext?e:null,onInput:t=>this.optionSelect(n,t),tabIndex:this.open?null:-1}),o("div",{class:"pn-action-menu-button"},!!n.icon&&o("pn-icon",{icon:n.icon,color:"blue700"}),o("div",{class:"pn-action-menu-item-text"},o("label",{htmlFor:t,class:"pn-action-menu-item-label"},n.label),n.helpertext&&o("p",{id:e,class:"pn-action-menu-item-helpertext"},o("span",null,n.helpertext))),"checkbox"===n.input?o("div",{class:"pn-action-menu-checkbox"},o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},o("polyline",{class:"pn-action-menu-checkbox-checkmark-path",points:"4,12 9,17 20,6","stroke-width":"3"}))):o("div",{class:"pn-action-menu-radio"},o("div",{class:"pn-action-menu-radio-outer"},o("div",{class:"pn-action-menu-radio-inner"})))))}renderButton(n){const t="BACK"===n.label,e=!!n?.options?.length,i=!!n?.group?.length,a=!!n.href&&!e&&!i,c=t?"-close":"",r=t||!!n.icon,s=t?null:this.getOptionTrailing(n),u=this.isSubmenuActive(n.value),p=e?{"aria-haspopup":"true","aria-controls":u?this.getListId(n):null,"aria-expanded":u?.toString()}:{},m=a?{href:n.href,target:n.target}:{disabled:n.disabled},l=a?"a":"button";return i?o("div",{class:"pn-action-menu-group-label"},o("p",{class:"pn-action-menu-p"},n.label),n.helpertext&&o("p",{class:"pn-action-menu-group-helpertext"},n.helpertext)):o("div",{class:"pn-action-menu-item-content","data-close":t},o(l,{id:this.getButtonId(n)+c,class:"pn-action-menu-button",...p,...m,tabIndex:this.open?null:-1,onClick:t=>this.optionSelect(n,t),onKeyDown:t=>this.escButton(t,n)},r&&o("pn-icon",{icon:t?f:n.icon,color:"blue700"}),o("div",{class:"pn-action-menu-item-text"},o("span",{class:"pn-action-menu-item-label"},t?this.translate("BACK"):n.label),n.helpertext&&!a&&o("span",{class:"pn-action-menu-item-helpertext"},n.helpertext)),s))}renderSub(n){return o("menu",{id:this.getListId(n),"aria-labelledby":this.getButtonId(n),class:"pn-action-menu-sub","data-open":this.isSubmenuActive(n.value)?.toString(),"data-current":this.isCurrentSubMenu(n.value)},this.smallMenu&&o("li",{class:"pn-action-menu-item"},this.renderButton({label:"BACK",value:n.value,options:n.options})),n.options.map((n=>this.renderMenuItem(n))))}renderGroup(n){return o("menu",{class:"pn-action-menu-group"},n.group.map((n=>this.renderMenuItem(n))))}renderMenuItem(n){const t=!!n?.options?.length,e=!t&&!!n?.group?.length;return o("li",{class:"pn-action-menu-item","data-group":e,"data-sub":t},!n.input||t||e?this.renderButton(n):this.renderCheckbox(n),t?this.renderSub(n):e&&this.renderGroup(n))}renderMenu(){return o("div",{id:this.menuListId,class:"pn-action-menu-container",role:"region","aria-labelledby":this.menuButtonId,"data-open":this.open,"data-upwards":this.upwards,"data-small":this.smallMenu,style:{height:"0px"},ref:n=>this.menuContainer=n},o("menu",{class:"pn-action-menu-list","data-current":this.isMenuActive(),ref:n=>this.menuList=n},this.options?.map((n=>this.renderMenuItem(n)))))}render(){return o(a,{key:"d77e6c7f658e2552260f5a8a30034a8d68d9bfa2"},o("div",{key:"3d2584a7c12abf5948cec24c967ab573d33dafa0",id:this.menuId!==this.id?this.menuId:null,class:"pn-action-menu"},o("pn-button",{key:"f8460fca3784d2cb04ac55bfa0070935006c864d",icon:this.getTriggerIcon(),...this.button,buttonId:this.menuButtonId,tooltipUp:!this.upwards,ariahaspopup:"true",ariacontrols:this.open?this.menuListId:null,ariaexpanded:""+this.open,"data-default-icon":!this.button?.icon,onPnClick:()=>this.toggleActionMenu(),ref:n=>this.menuTrigger=n}),this.renderMenu()))}static get watchers(){return{options:[{handleOptions:0}],open:[{openHandler:0}],menuId:[{handleMenuId:0}]}}static get style(){return`${n("pn-action-menu")}{--pn-menu-height:unset;display:inline-block;position:relative}${n("pn-action-menu")} .pn-action-menu{position:relative}${n("pn-action-menu")} .pn-action-menu-container{--pn-action-menu-offset:0;scroll-behavior:smooth;list-style:none;text-align:left;position:absolute;z-index:100;top:calc(100% + 0.5em);left:var(--pn-action-menu-offset);right:0;background-color:#ffffff;box-shadow:0em 0.075em 0.225em 0em rgba(0, 0, 0, 0.1), 0em 0.4em 0.9em 0em rgba(0, 0, 0, 0.13);border-radius:0.5em;margin:0;padding:0;width:16em;visibility:hidden;overflow:hidden}${n("pn-action-menu")} .pn-action-menu-container[data-open]{visibility:visible;overflow:unset}${n("pn-action-menu")} .pn-action-menu-container[data-left]{right:0;left:unset}${n("pn-action-menu")} .pn-action-menu-container[data-upwards]{top:unset;bottom:calc(100% + 0.5em);transform-origin:bottom left}${n("pn-action-menu")} .pn-action-menu-container[data-moving]{overflow:hidden;visibility:visible;pointer-events:none}${n("pn-action-menu")} .pn-action-menu-container{}${n("pn-action-menu")} .pn-action-menu-container[data-small] .pn-action-menu-list{border-radius:0.5em;visibility:hidden;transition-property:visibility;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${n("pn-action-menu")} .pn-action-menu-container[data-small] .pn-action-menu-list{transition-duration:0s;transition-delay:0s}}${n("pn-action-menu")} .pn-action-menu-container[data-small] .pn-action-menu-list{transition-delay:0.2s}${n("pn-action-menu")} .pn-action-menu-container[data-small] .pn-action-menu-list[data-current]{overflow-x:auto;visibility:visible;transition-delay:0s}${n("pn-action-menu")} .pn-action-menu-container[data-small][data-moving]>.pn-action-menu-list{visibility:visible}${n("pn-action-menu")} .pn-action-menu-container[data-small] .pn-action-menu-item{position:unset}${n("pn-action-menu")} .pn-action-menu-container[data-small] .pn-action-menu-sub{left:0;height:100%;box-shadow:unset;transform:translateX(0);visibility:hidden}${n("pn-action-menu")} .pn-action-menu-container[data-small] .pn-action-menu-sub[data-current]{visibility:visible;overflow-x:auto}${n("pn-action-menu")} .pn-action-menu-container::-webkit-scrollbar{background-color:#ffffff;width:0.875em;border-radius:0.5em}${n("pn-action-menu")} .pn-action-menu-container::-webkit-scrollbar-track{background-color:#ffffff;border-radius:0.5em}${n("pn-action-menu")} .pn-action-menu-container::-webkit-scrollbar-thumb{cursor:pointer;background-color:#969087;border-radius:1em;border:0.25em solid #ffffff}${n("pn-action-menu")} .pn-action-menu-container::-webkit-scrollbar-thumb:hover{background-color:#5e554a}${n("pn-action-menu")} .pn-action-menu-container::-webkit-scrollbar-corner,${n("pn-action-menu")} .pn-action-menu-container::-webkit-scrollbar-button{display:none}${n("pn-action-menu")} .pn-action-menu-list{margin:0;padding:0;list-style:none;height:var(--pn-menu-height)}${n("pn-action-menu")} .pn-action-menu-list::-webkit-scrollbar{background-color:#ffffff;width:0.875em;border-radius:0.5em}${n("pn-action-menu")} .pn-action-menu-list::-webkit-scrollbar-track{background-color:#ffffff;border-radius:0.5em}${n("pn-action-menu")} .pn-action-menu-list::-webkit-scrollbar-thumb{cursor:pointer;background-color:#969087;border-radius:1em;border:0.25em solid #ffffff}${n("pn-action-menu")} .pn-action-menu-list::-webkit-scrollbar-thumb:hover{background-color:#5e554a}${n("pn-action-menu")} .pn-action-menu-list::-webkit-scrollbar-corner,${n("pn-action-menu")} .pn-action-menu-list::-webkit-scrollbar-button{display:none}${n("pn-action-menu")} .pn-action-menu-group{margin:0;padding:0;list-style:none}${n("pn-action-menu")} .pn-action-menu-group-label{display:block;color:#2d2013;font-weight:700;font-size:0.875em;padding:1em 1em 0.5em}${n("pn-action-menu")} .pn-action-menu-group-helpertext{display:block;color:#5e554a;font-weight:400;margin:0.25em 0 0}${n("pn-action-menu")} .pn-action-menu-sub{z-index:110;position:absolute;top:0;width:100%;min-width:12em;margin:0;padding:0;list-style:none;background:#ffffff;border-radius:0.5em;box-shadow:0em 0.075em 0.225em 0em rgba(0, 0, 0, 0.1), 0em 0.4em 0.9em 0em rgba(0, 0, 0, 0.13);transform:translateX(-0.5em);opacity:0;visibility:hidden}${n("pn-action-menu")} .pn-action-menu-sub::-webkit-scrollbar{background-color:#ffffff;width:0.875em;border-radius:0.5em}${n("pn-action-menu")} .pn-action-menu-sub::-webkit-scrollbar-track{background-color:#ffffff;border-radius:0.5em}${n("pn-action-menu")} .pn-action-menu-sub::-webkit-scrollbar-thumb{cursor:pointer;background-color:#969087;border-radius:1em;border:0.25em solid #ffffff}${n("pn-action-menu")} .pn-action-menu-sub::-webkit-scrollbar-thumb:hover{background-color:#5e554a}${n("pn-action-menu")} .pn-action-menu-sub::-webkit-scrollbar-corner,${n("pn-action-menu")} .pn-action-menu-sub::-webkit-scrollbar-button{display:none}${n("pn-action-menu")} .pn-action-menu-sub{transition-property:transform, opacity, visibility;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${n("pn-action-menu")} .pn-action-menu-sub{transition-duration:0s;transition-delay:0s}}${n("pn-action-menu")} .pn-action-menu-sub{transition-delay:0s, 0s, 0.2s}${n("pn-action-menu")} .pn-action-menu-sub[data-open=true]{transform:translateX(0);opacity:1;visibility:visible;transition-delay:0s, 0s, 0s}${n("pn-action-menu")} .pn-action-menu-sub[data-open=false]{pointer-events:none}${n("pn-action-menu")} .pn-action-menu-sub[data-x=left]{left:-100%}${n("pn-action-menu")} .pn-action-menu-sub[data-x=center]{left:0}${n("pn-action-menu")} .pn-action-menu-sub[data-x=right]{left:100%}${n("pn-action-menu")} .pn-action-menu-sub[data-y=top]{top:unset;bottom:0}${n("pn-action-menu")} .pn-action-menu-sub[data-y=bottom]{top:0}${n("pn-action-menu")} .pn-action-menu-item{position:relative}${n("pn-action-menu")} .pn-action-menu-item:first-child>.pn-action-menu-item-content>.pn-action-menu-button{border-top-left-radius:0.5em;border-top-right-radius:0.5em}${n("pn-action-menu")} .pn-action-menu-item:last-child>.pn-action-menu-item-content>.pn-action-menu-button{border-bottom-right-radius:0.5em;border-bottom-left-radius:0.5em}${n("pn-action-menu")} .pn-action-menu-item-text{display:flex;flex-direction:column;margin-right:auto}${n("pn-action-menu")} .pn-action-menu-item-label{color:#005d92;font-weight:500;text-decoration:none}${n("pn-action-menu")} .pn-action-menu-item-suffix{margin-left:auto;font-weight:400;color:#5e554a}${n("pn-action-menu")} .pn-action-menu-item-helpertext{color:#5e554a;font-weight:400}${n("pn-action-menu")} .pn-action-menu-item-content{display:flex;align-items:center;flex-direction:row;flex:1 1 100%;gap:0.5em;position:relative}${n("pn-action-menu")} .pn-action-menu-item-content[data-close]{border-bottom:0.0625em solid #d3cecb}${n("pn-action-menu")} .pn-action-menu-item-content>${n("pn-icon")}{padding:0 0.25em}${n("pn-action-menu")} .pn-action-menu-item[data-group],${n("pn-action-menu")} .pn-action-menu-item[data-sub]{flex-direction:column}${n("pn-action-menu")} .pn-action-menu-button{cursor:pointer;position:relative;-webkit-tap-highlight-color:transparent;line-height:1.5;padding:0.75em 1em;border:0;width:100%;text-align:left;text-decoration-color:transparent;overflow:hidden;display:flex;align-items:center;flex:1 1 100%;gap:0.5em;font-size:1em;min-height:1.5em;background-color:#ffffff;transition-property:background-color, color, outline-color, text-decoration-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${n("pn-action-menu")} .pn-action-menu-button{transition-duration:0s;transition-delay:0s}}${n("pn-action-menu")} .pn-action-menu-button .pn-ripple{animation:ripple 0.4s cubic-bezier(0.7, 0, 0.3, 1);position:absolute;border-radius:50%;background-color:#0d234b;transform:translate(-50%, -50%) scale(0);opacity:0.1;pointer-events:none;z-index:3}@keyframes ripple{to{transform:translate(-50%, -50%) scale(1);opacity:0}}${n("pn-action-menu")} .pn-action-menu-button{outline:0.2rem solid transparent;outline-offset:0.2rem}${n("pn-action-menu")} .pn-action-menu-button:focus-visible{outline-color:#005d92}${n("pn-action-menu")} .pn-action-menu-button{outline-offset:-0.2rem}${n("pn-action-menu")} .pn-action-menu-button>${n("pn-icon")} .pn-icon-svg>path{transform-origin:center;transform:rotate(0deg)}${n("pn-action-menu")} .pn-action-menu-button>${n("pn-icon")}[data-suffix][data-active] .pn-icon-svg>path{transform:rotate(180deg)}${n("pn-action-menu")} .pn-action-menu-button>${n("pn-icon")}:last-child{margin-left:auto}${n("pn-action-menu")} .pn-action-menu-button:disabled{pointer-events:none;color:#5e554a;background-color:#f3f2f2}${n("pn-action-menu")} .pn-action-menu-button:hover{background-color:#effbff}${n("pn-action-menu")} .pn-action-menu-button:focus{background-color:#e0f8ff}${n("pn-action-menu")} .pn-action-menu-button[href]:hover,${n("pn-action-menu")} .pn-action-menu-button[href]:focus{text-decoration-color:#005d92}${n("pn-action-menu")} .pn-action-menu-button{}${n("pn-action-menu")} .pn-action-menu-checkbox{background-color:#ffffff;flex:0 0 1.5em;width:1.5em;height:1.5em;border:0.0625em solid #969087;border-radius:0.25em;margin-left:auto;outline:0.2rem solid transparent;outline-offset:0.2rem;transition-property:background-color, border-color, outline-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${n("pn-action-menu")} .pn-action-menu-checkbox{transition-duration:0s;transition-delay:0s}}${n("pn-action-menu")} .pn-action-menu-checkbox svg polyline{stroke:#ffffff;stroke-linecap:round;stroke-dasharray:23;transition-property:stroke-dashoffset;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${n("pn-action-menu")} .pn-action-menu-checkbox svg polyline{transition-duration:0s;transition-delay:0s}}${n("pn-action-menu")} .pn-action-menu-checkbox svg polyline{transition-delay:0s}${n("pn-action-menu")} .pn-action-menu-checkbox svg polyline.pn-action-menu-checkbox-checkmark-path{stroke-dashoffset:23}${n("pn-action-menu")} .pn-action-menu-radio{display:flex;gap:0.75em;padding:0;margin-left:auto}${n("pn-action-menu")} .pn-action-menu-radio-outer{background-color:#ffffff;border:0.0625em solid #969087;border-radius:50%;height:1.5em;width:1.5em;display:flex;justify-content:center;align-items:center;outline:0.2rem solid transparent;outline-offset:0.2rem;transition-property:border-color, background-color, outline-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${n("pn-action-menu")} .pn-action-menu-radio-outer{transition-duration:0s;transition-delay:0s}}${n("pn-action-menu")} .pn-action-menu-radio-inner{transform:scale(0);height:0.75em;width:0.75em;background-color:#005d92;border-radius:50%;transform-origin:center center;transition-property:background-color, transform;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${n("pn-action-menu")} .pn-action-menu-radio-inner{transition-duration:0s;transition-delay:0s}}${n("pn-action-menu")} .pn-action-menu-input{position:absolute;z-index:10;cursor:pointer;height:100%;width:100%;top:0;left:0;margin:0;opacity:0;-webkit-tap-highlight-color:transparent}${n("pn-action-menu")} .pn-action-menu-input:checked+.pn-action-menu-button{background-color:#effbff}${n("pn-action-menu")} .pn-action-menu-input:checked+.pn-action-menu-button .pn-action-menu-checkbox{border-color:#005d92;background-color:#005d92}${n("pn-action-menu")} .pn-action-menu-input:checked+.pn-action-menu-button .pn-action-menu-checkbox polyline.pn-action-menu-checkbox-checkmark-path{transition-delay:0.2s;stroke-dashoffset:0}${n("pn-action-menu")} .pn-action-menu-input:checked+.pn-action-menu-button .pn-action-menu-radio-outer{border-color:#005d92}${n("pn-action-menu")} .pn-action-menu-input:checked+.pn-action-menu-button .pn-action-menu-radio-inner{transform:scale(1);background-color:#005d92}${n("pn-action-menu")} .pn-action-menu-input:checked:hover{background-color:#e0f8ff}${n("pn-action-menu")} .pn-action-menu-input:focus-visible+.pn-action-menu-button{background-color:#e0f8ff}${n("pn-action-menu")} .pn-action-menu-input:disabled{pointer-events:none}${n("pn-action-menu")} .pn-action-menu-input:disabled+.pn-action-menu-button{pointer-events:none;color:#5e554a;background-color:#f3f2f2}${n("pn-action-menu")} .pn-action-menu-input:disabled+.pn-action-menu-button .pn-action-menu-item-label{color:#5e554a}${n("pn-action-menu")} .pn-action-menu-input:disabled+.pn-action-menu-button .pn-action-menu-checkbox{background-color:#f3f2f2}${n("pn-action-menu")} .pn-action-menu-input:disabled+.pn-action-menu-button .pn-action-menu-radio-outer{border-color:#969087;background-color:#f3f2f2}${n("pn-action-menu")} .pn-action-menu-input:disabled+.pn-action-menu-button .pn-icon-svg path{fill:#5e554a}${n("pn-action-menu")} .pn-action-menu-input:disabled:checked+.pn-action-menu-button .pn-action-menu-radio-inner{background-color:#969087}${n("pn-action-menu")} .pn-action-menu-input:disabled:checked+.pn-action-menu-button .pn-action-menu-checkbox{border-color:#969087;background-color:#969087}${n("pn-action-menu")} .pn-action-menu-input:hover+.pn-action-menu-button{background-color:#e0f8ff}${n("pn-action-menu")} .pn-action-menu-input:hover+.pn-action-menu-button .pn-action-menu-radio-outer{border-color:#005d92;background-color:#e0f8ff}${n("pn-action-menu")} .pn-action-menu-input:focus-visible+.pn-action-menu-button{background-color:#e0f8ff}${n("pn-action-menu")} .pn-action-menu-input:focus-visible+.pn-action-menu-button .pn-action-menu-checkbox,${n("pn-action-menu")} .pn-action-menu-input:focus-visible+.pn-action-menu-button .pn-action-menu-radio .pn-action-menu-radio-outer{outline-color:#005d92}${n("pn-action-menu")} .pn-action-menu-p{margin:0}${n("pn-action-menu")} .pn-action-menu>${n("pn-button")}[data-default-icon] .pn-button[aria-expanded=true] .pn-icon-svg{transform:rotate(180deg);transition-delay:0s}${n("pn-action-menu")} .pn-action-menu>${n("pn-button")}[data-default-icon] .pn-button .pn-icon-svg{transform:rotate(0deg);transition-delay:0.2s;transition-property:transform;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${n("pn-action-menu")} .pn-action-menu>${n("pn-button")}[data-default-icon] .pn-button .pn-icon-svg{transition-duration:0s;transition-delay:0s}}`}},[512,"pn-action-menu",{options:[16],button:[16],menuId:[1,"menu-id"],language:[1025],open:[1540],menuUp:[4,"menu-up"],menuLeft:[4,"menu-left"],isClosing:[32],isExpanding:[32],smallMenu:[32],upwards:[32],activeSubmenu:[32]},[[9,"resize","handleResize"]],{options:[{handleOptions:0}],open:[{openHandler:0}],menuId:[{handleMenuId:0}]}]),w=x,z=function(){"undefined"!=typeof customElements&&["pn-action-menu","pn-button","pn-icon","pn-spinner"].forEach((t=>{switch(t){case"pn-action-menu":customElements.get(n(n(t)))||customElements.define(n(n(t)),x);break;case"pn-button":customElements.get(n(n(t)))||k();break;case"pn-icon":customElements.get(n(n(t)))||$();break;case"pn-spinner":customElements.get(n(n(t)))||v()}}))};export{w as PnActionMenu,z as defineCustomElement}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* By PostNord.
|
|
4
4
|
*/
|
|
5
|
-
import{transformTag as e,proxyCustomElement as a,HTMLElement as r,createEvent as n,h as t,Host as i}from"@stencil/core/internal/client";import{a as c}from"./arrow_right.js";import{o as d}from"./open_in_new.js";import{u as o,o as l}from"./helpers.js";import{d as p}from"./pn-icon2.js";const s=a(class extends r{constructor(e){super(),!1!==e&&this.__registerHost(),this.pnCard=n(this,"pnCard",7)}id="pn-card-"+o();idTitle=this.id+"-title";visibleOutline=!1;get hostElement(){return this}label;labelTag="h3";overline;text;cardId=null;horizontal=!1;reverse=!1;aspectRatio="";href;hrefLabel;target;rel="noopener noreferrer";icon=null;watchCardId(){this.idTitle=(this.cardId||this.id)+"-title"}pnCard;componentWillLoad(){this.watchCardId()}isExternal(){return"_blank"===this.target}showTitle(){return!!this.label}showHref(){return!!this.href&&(this.hrefLabel||this.showTitle())}getTitleId(){return this.hrefLabel?null:this.idTitle}getLabelledby(){return this.hrefLabel?null:this.showTitle()?this.idTitle:null}getIcon(){return this.icon?this.icon:this.isExternal()?d:c}getHeadingTag(){return["h2","h3","h4","h5","h6","p"].includes(this.labelTag)?this.labelTag:"h3"}handleFocus({type:e,target:a}){this.visibleOutline="focus"===e&&a.matches(":focus-visible")}handleClick(e){l(e,this.hostElement,".pn-card"),this.pnCard.emit({click:e})}render(){const e=this.getHeadingTag();return t(i,{key:"
|
|
5
|
+
import{transformTag as e,proxyCustomElement as a,HTMLElement as r,createEvent as n,h as t,Host as i}from"@stencil/core/internal/client";import{a as c}from"./arrow_right.js";import{o as d}from"./open_in_new.js";import{u as o,o as l}from"./helpers.js";import{d as p}from"./pn-icon2.js";const s=a(class extends r{constructor(e){super(),!1!==e&&this.__registerHost(),this.pnCard=n(this,"pnCard",7)}id="pn-card-"+o();idTitle=this.id+"-title";visibleOutline=!1;get hostElement(){return this}label;labelTag="h3";overline;text;cardId=null;horizontal=!1;reverse=!1;aspectRatio="";href;hrefLabel;target;rel="noopener noreferrer";icon=null;watchCardId(){this.idTitle=(this.cardId||this.id)+"-title"}pnCard;componentWillLoad(){this.watchCardId()}isExternal(){return"_blank"===this.target}showTitle(){return!!this.label}showHref(){return!!this.href&&(this.hrefLabel||this.showTitle())}getTitleId(){return this.hrefLabel?null:this.idTitle}getLabelledby(){return this.hrefLabel?null:this.showTitle()?this.idTitle:null}getIcon(){return this.icon?this.icon:this.isExternal()?d:c}getHeadingTag(){return["h2","h3","h4","h5","h6","p"].includes(this.labelTag)?this.labelTag:"h3"}handleFocus({type:e,target:a}){this.visibleOutline="focus"===e&&a.matches(":focus-visible")}handleClick(e){l(e,this.hostElement,".pn-card"),this.pnCard.emit({click:e})}render(){const e=this.getHeadingTag();return t(i,{key:"8126385831d763637aed6ebe4fa61fd0bdb42764"},t("article",{key:"93c75dc2d9e71844e36a9cdd6914f42eae34f7b0",id:this.cardId,class:"pn-card","data-link":!!this.href,"data-horizontal":this.horizontal,"data-reverse":this.reverse,"data-focus":this.visibleOutline},t("div",{key:"140936bb72867a5ef4351363dfda52698b9d9df0",class:"pn-card-image"},t("picture",{key:"60de2f3f53b4d7f1e1cbe37b1ff47686c9e48b72",class:"pn-card-picture",style:{"--pn-card-aspect-ratio":this.aspectRatio||"unset"}},t("slot",{key:"47cffafc0d642f6cf0c682cd96f9fd11609f924e",name:"image"}))),t("div",{key:"6768342177fe3884d9bd20b0ca516cf026b69751",class:"pn-card-content"},t("header",{key:"91e023c92c33bf74c39200387edc7a3d3c2f2d42",class:"pn-card-header"},t("div",{key:"9d7771c4275569012021a07f9165ba4a8ce8c297",class:"pn-card-tags"},t("slot",{key:"c45641bd02093f8001dee361b6b8577a383f72ba",name:"tags"})),!!this.overline&&t("p",{key:"b152b16d2488e82556e9f56f90daf0edfe8ae33f",class:"pn-card-label-overline"},this.overline),!!this.label&&t(e,{key:"3bc086490090afc05ad44c0e1736009b82fbe814",id:this.getTitleId(),class:"pn-card-label"},this.label),t("slot",{key:"1188ca2c3260dd509811cfb5aa5356488f211e1a",name:"header"})),t("section",{key:"ba0b7362ddd721041466ac979ba198170b016fb1",class:"pn-card-section"},!!this.text&&t("p",{key:"76aa9e90ac18ff66ec15a436ec8eec9e22c67748",class:"pn-card-section-paragraph"},this.text),t("slot",{key:"bd0f035ce418425c1ac1871ec1cb98f850cd97e1"})),t("nav",{key:"1a538e55ed6c9c07f3f8c5dd823f80ed3a149ed6",class:"pn-card-navigation"},this.showHref()&&t("a",{key:"a18605058f0dc733ceeeab9fa6a44fb524c93630",class:"pn-card-link",href:this.href,target:this.target,rel:this.rel,"aria-labelledby":this.getLabelledby(),onClick:e=>this.handleClick(e),onFocus:e=>this.handleFocus(e),onBlur:e=>this.handleFocus(e)},this.hrefLabel,t("pn-icon",{key:"066242008cd49a69d64db93da7a87bbdcdd1beda",color:"blue700",icon:this.getIcon()})),t("slot",{key:"bbe0271663622b8adf542232daa573a467b34f16",name:"navigation"})))))}static get watchers(){return{cardId:[{watchCardId:0}]}}static get style(){return`${e("pn-card")}{position:relative;display:block}${e("pn-card")} .pn-card{position:relative;background-color:#ffffff;color:#2d2013;border-radius:0.5em;display:flex;flex-direction:column;height:100%;overflow:hidden;box-shadow:0em 0.0625em 0.125em 0em rgba(20, 20, 20, 0.11), 0em 0.1875em 0.4375em 0em rgba(0, 0, 0, 0.13);outline:0.2rem solid transparent;outline-offset:0.2rem;transition-property:background-color, outline-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-card")} .pn-card{transition-duration:0s;transition-delay:0s}}${e("pn-card")} .pn-card[data-link]:hover{background-color:#e0f8ff}${e("pn-card")} .pn-card[data-link][data-focus]{outline-color:#005d92}${e("pn-card")} .pn-card{}${e("pn-card")} .pn-card[data-link] .pn-card-navigation>[slot=navigation]{display:none}${e("pn-card")} .pn-card[data-horizontal]{flex-direction:row}${e("pn-card")} .pn-card[data-horizontal][data-reverse]{flex-direction:row-reverse}${e("pn-card")} .pn-card[data-horizontal][data-reverse] .pn-card-picture{clip-path:ellipse(100% 175% at right center)}${e("pn-card")} .pn-card[data-horizontal] .pn-card-content{flex:1 1 50%}${e("pn-card")} .pn-card[data-horizontal] .pn-card-image{flex:1 1 50%;flex-direction:row}${e("pn-card")} .pn-card[data-horizontal] .pn-card-picture{width:100%;clip-path:ellipse(100% 175% at left center)}${e("pn-card")} .pn-card[data-reverse]{flex-direction:column-reverse}${e("pn-card")} .pn-card[data-reverse] .pn-card-picture{clip-path:ellipse(175% 100% at bottom center)}${e("pn-card")} .pn-card-header{display:flex;flex-direction:column;gap:clamp(0.5em, 5vw, 0.75em)}${e("pn-card")} .pn-card-label{font-size:clamp(1.125em, 5vw, 1.5em);font-weight:700;margin:0}${e("pn-card")} .pn-card-label-overline{color:#5e554a;font-size:0.875em;font-weight:400;margin:0}${e("pn-card")} .pn-card-link{display:inline-flex;align-items:center;gap:0.25em;color:#005d92;text-decoration-color:transparent;-webkit-tap-highlight-color:transparent;transition-property:color, text-decoration-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-card")} .pn-card-link{transition-duration:0s;transition-delay:0s}}${e("pn-card")} .pn-card-link:hover{color:#0d234b;text-decoration-color:#0d234b}${e("pn-card")} .pn-card-link:hover>${e("pn-icon")} .pn-icon-svg>path{fill:#0d234b}${e("pn-card")} .pn-card-link:focus{outline:0;color:#0d234b;text-decoration-color:#0d234b}${e("pn-card")} .pn-card-link:focus>${e("pn-icon")} .pn-icon-svg>path{fill:#0d234b}${e("pn-card")} .pn-card-link:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%}${e("pn-card")} .pn-card-content{display:flex;flex-direction:column;flex-wrap:nowrap;flex:1;gap:clamp(0.5em, 5vw, 0.75em);padding:clamp(0.75em, 5vw, 1.5em) clamp(0.75em, 5vw, 1.5em)}${e("pn-card")} .pn-card-section{display:flex;flex-direction:column;gap:0.5em;color:#5e554a}${e("pn-card")} .pn-card-section-paragraph,${e("pn-card")} .pn-card-section p{margin:0 0 0.25em}${e("pn-card")} .pn-card-section-paragraph:last-child,${e("pn-card")} .pn-card-section p:last-child{margin:0em}${e("pn-card")} .pn-card-navigation{margin-top:auto;padding-top:clamp(0.5em, 5vw, 0.75em);display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:0.5em}${e("pn-card")} .pn-card-navigation>${e("pn-button")}{flex:1 1 12em}${e("pn-card")} .pn-card-navigation:empty{display:none}${e("pn-card")} .pn-card-image{position:relative;display:flex;flex-direction:column}${e("pn-card")} .pn-card-picture{margin:0;padding:0;display:block;overflow:hidden;clip-path:ellipse(175% 100% at top center);aspect-ratio:var(--pn-card-aspect-ratio)}${e("pn-card")} .pn-card-picture:empty{display:none}${e("pn-card")} .pn-card-picture>*[slot=image]{display:block;height:100%;width:100%;object-fit:cover}${e("pn-card")} .pn-card-tags{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:0.5em}${e("pn-card")} .pn-card-tags:empty{display:none}${e("pn-card")} .pn-card>.pn-ripple{animation:ripple 0.4s cubic-bezier(0.7, 0, 0.3, 1);position:absolute;border-radius:50%;background-color:#005d92;transform:translate(-50%, -50%) scale(0);opacity:0.1;pointer-events:none;z-index:3}@keyframes ripple{to{transform:translate(-50%, -50%) scale(1);opacity:0}}`}},[772,"pn-card",{label:[1],labelTag:[1,"label-tag"],overline:[1],text:[1],cardId:[1,"card-id"],horizontal:[4],reverse:[4],aspectRatio:[1,"aspect-ratio"],href:[1],hrefLabel:[1,"href-label"],target:[1],rel:[1],icon:[1],visibleOutline:[32]},void 0,{cardId:[{watchCardId:0}]}]),f=s,h=function(){"undefined"!=typeof customElements&&["pn-card","pn-icon"].forEach((a=>{switch(a){case"pn-card":customElements.get(e(e(a)))||customElements.define(e(e(a)),s);break;case"pn-icon":customElements.get(e(e(a)))||p()}}))};export{f as PnCard,h as defineCustomElement}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* By PostNord.
|
|
4
4
|
*/
|
|
5
|
-
import{transformTag as e,proxyCustomElement as c,Mixin as o,h as n,Host as t}from"@stencil/core/internal/client";import{u as i}from"./helpers.js";import{a}from"./index2.js";import{d as r}from"./pn-icon2.js";const d=c(class extends(o(a)){constructor(e){super(!1),!1!==e&&this.__registerHost()}id="pn-checkbox-"+i();idHelpertext=this.id+"-helpertext";contentArea;get hostElement(){return this}label;helpertext;value;name;checked=!1;checkboxid=this.id;required=!1;disabled=!1;invalid=!1;indeterminate=!1;tile=!1;expand=!1;icon=null;handleId(){this.idHelpertext=this.checkboxid+"-helpertext"}handleChecked(){this.displayContent()&&(this.checked?this.openDropdown(this.contentArea):this.closeDropdown(this.contentArea))}componentWillLoad(){this.handleId()}componentDidLoad(){this.displayContent()&&this.checked&&requestAnimationFrame((()=>this.openDropdown(this.contentArea)))}handleChange(e){const{checked:c}=e.target;this.indeterminate=!1,this.checked=c}isInvalid(){return this.invalid&&!this.disabled}displayText(){return this.displayLabel()||this.displayHelpertext()}displayLabel(){return!!this.label}displayHelpertext(){return!(!this.helpertext&&!this.hostElement.querySelector('[slot="helpertext"]')?.textContent)}displayIcon(){return this.tile&&!!this.icon}displayContent(){return this.tile&&this.expand}render(){return n(t,{key:"52273e4f6d71183fa2360c147c5d2ed6fbb3d31a"},n("input",{key:"fba94a81a38009f36d938751c6362ed7340d68d7",type:"checkbox",id:this.checkboxid,class:"pn-checkbox-input",value:this.value,name:this.name,disabled:this.disabled,checked:this.checked,required:this.required,indeterminate:this.indeterminate,"aria-invalid":this.isInvalid()?.toString(),"aria-describedby":this.helpertext&&this.idHelpertext,"data-tile":this.tile,"data-expand":this.expand,onChange:e=>this.handleChange(e)}),n("div",{key:"850ecfd3abddccfe8b0ada1d0272dfa3155a669f",class:"pn-checkbox","data-tile":this.tile,"data-expand":this.expand,"data-invalid":this.isInvalid()},n("div",{key:"728efcdb0cd59f1af39839dd9fd1accc66f2da00",class:"pn-checkbox-outer"},n("svg",{key:"55d82cc64b735706a57d301e9c8f64edc4aeebe9",class:"pn-checkbox-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},n("polyline",{key:"02a30f7a2cbf5d502be29ff14945f22e89ca19c5",class:"pn-checkbox-svg-line pn-checkbox-svg-checkmark",points:"4,12 9,17 20,6","stroke-width":"3"}),n("polyline",{key:"9c01a39dec7dc5d3961bffd07badf694ebdbadc1",class:"pn-checkbox-svg-line pn-checkbox-svg-indeterminate",points:"4,12 20,12","stroke-width":"3"}))),n("p",{key:"0b63e31f00d2dea465e9e36b3cceb56bf0a4ad48",class:"pn-checkbox-content",hidden:!this.displayText()},n("label",{key:"9aeebad0076718474224594b5c17cd5e3c3590dc",htmlFor:this.checkboxid,class:"pn-checkbox-label",hidden:!this.displayLabel()},this.label),n("span",{key:"1d99d825512267e4560b817f8853319b10b05d08",id:this.idHelpertext,class:"pn-checkbox-helpertext",hidden:!this.displayHelpertext()},this.helpertext,n("slot",{key:"981da5a8b25f6e780a5c0a1f9e32ee7aa11fef11",name:"helpertext"})),n("slot",{key:"192f09f50bd3592c41e8836c70dc264edfc3e332"})),this.displayIcon()&&n("pn-icon",{key:"4ab2aaf2819ca83f08233cac99922e5234837408",icon:this.icon,color:"gray900"}),n("div",{key:"6247821b031e2d57a216612b166db6622aaa2225",class:"pn-checkbox-container","data-open":this.checked,hidden:!this.displayContent(),style:{height:"0px"},ref:e=>this.contentArea=e},n("div",{key:"d35445d61a6e9a7faca6ca349f56b36097a077d2",class:"pn-checkbox-area"},n("slot",{key:"7cbcc9648ae405d6aa8729f2071c3b03a914a027",name:"content"})))))}static get watchers(){return{checkboxid:[{handleId:0}],checked:[{handleChecked:0}]}}static get style(){return`${e("pn-checkbox")}{position:relative;display:inline-block}${e("pn-checkbox")} .pn-checkbox{position:relative;display:flex;flex-wrap:wrap;flex-direction:row}${e("pn-checkbox")} .pn-checkbox-label{cursor:pointer;color:#2d2013;-webkit-tap-highlight-color:transparent}${e("pn-checkbox")} .pn-checkbox-helpertext{color:#5e554a;margin:0 0 0.5em 0}${e("pn-checkbox")} .pn-checkbox-helpertext:last-child{margin:0}${e("pn-checkbox")} .pn-checkbox-content{display:flex;flex-direction:column;align-items:flex-start;font-weight:400;line-height:1.5;flex:1;margin:0 0 0 0.75em}${e("pn-checkbox")} .pn-checkbox-outer{width:1.5em;height:1.5em;background-color:#ffffff;display:flex;align-items:center;justify-content:center;position:relative;border:0.0625em solid #969087;border-radius:0.25em;outline:0.2rem solid transparent;outline-offset:0.2rem;transition-property:outline-color, border-color, background-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-checkbox")} .pn-checkbox-outer{transition-duration:0s;transition-delay:0s}}${e("pn-checkbox")} .pn-checkbox-svg{width:1.25em;fill:none}${e("pn-checkbox")} .pn-checkbox-svg-line{stroke:#ffffff;transform-origin:0 0;stroke-linecap:round;stroke-dasharray:23;stroke-dashoffset:23;transition-property:stroke-dashoffset;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-checkbox")} .pn-checkbox-svg-line{transition-duration:0s;transition-delay:0s}}${e("pn-checkbox")} .pn-checkbox-svg-line{transition-delay:0s}${e("pn-checkbox")} .pn-checkbox[data-tile]{position:relative;background-color:#ffffff;border:0.0625em solid #969087;border-radius:0.5em;padding:1em;outline:0.2rem solid transparent;outline-offset:0.2rem;transition-property:outline-color, background-color, border-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-checkbox")} .pn-checkbox[data-tile]{transition-duration:0s;transition-delay:0s}}${e("pn-checkbox")} .pn-checkbox[data-tile][data-invalid]{border-color:#a70707}${e("pn-checkbox")} .pn-checkbox[data-invalid] .pn-checkbox-outer{border-color:#a70707}${e("pn-checkbox")} .pn-checkbox-container{flex:1 1 100%;overflow:hidden;visibility:hidden}${e("pn-checkbox")} .pn-checkbox-container[data-open]{visibility:visible;overflow:unset}${e("pn-checkbox")} .pn-checkbox-container[data-moving]{visibility:visible;overflow:hidden}${e("pn-checkbox")} .pn-checkbox-area{padding:0.75em 0 0 2.25em;display:flex;flex-direction:column;flex-wrap:nowrap;gap:1em}${e("pn-checkbox")} .pn-checkbox>${e("pn-icon")}{margin-left:0.75em}${e("pn-checkbox")}>input{cursor:pointer;opacity:0;position:absolute;margin:0;z-index:1;top:0;left:0;font-size:1em;width:1.5em;height:1.5em;-webkit-tap-highlight-color:transparent}${e("pn-checkbox")}>input[data-tile]:not([data-expand]){width:100%;height:100%}${e("pn-checkbox")}>input[data-expand]{top:1em;left:1em}${e("pn-checkbox")}>input[aria-describedby]+.pn-checkbox[data-tile] .pn-checkbox-label{font-weight:500}${e("pn-checkbox")}>input:hover+.pn-checkbox>.pn-checkbox-outer{background-color:#e0f8ff;border-color:#005d92}${e("pn-checkbox")}>input:hover+.pn-checkbox[data-tile]{background-color:#e0f8ff;border-color:#005d92}${e("pn-checkbox")}>input:hover+.pn-checkbox[data-tile][data-invalid]{background-color:#fdefee;border-color:#a70707}${e("pn-checkbox")}>input:hover+.pn-checkbox[data-invalid]>.pn-checkbox-outer{background-color:#fdefee;border-color:#a70707}${e("pn-checkbox")}>input:focus-visible+.pn-checkbox>.pn-checkbox-outer{outline-color:#005d92}${e("pn-checkbox")}>input:focus-visible+.pn-checkbox[data-tile]{outline-color:#005d92;border-color:#005d92}${e("pn-checkbox")}>input:focus-visible+.pn-checkbox[data-tile][data-invalid]{outline-color:#a70707;border-color:#a70707}${e("pn-checkbox")}>input:focus-visible+.pn-checkbox[data-tile][data-invalid]>.pn-checkbox-outer{outline-color:transparent}${e("pn-checkbox")}>input:focus-visible+.pn-checkbox[data-tile]>.pn-checkbox-outer{outline-color:transparent}${e("pn-checkbox")}>input:focus-visible+.pn-checkbox[data-invalid]>.pn-checkbox-outer{outline-color:#a70707}${e("pn-checkbox")}>input:checked+.pn-checkbox>.pn-checkbox-outer{background-color:#005d92;border-color:#005d92}${e("pn-checkbox")}>input:checked+.pn-checkbox>.pn-checkbox-outer .pn-checkbox-svg>.pn-checkbox-svg-indeterminate{stroke-dashoffset:23}${e("pn-checkbox")}>input:checked+.pn-checkbox>.pn-checkbox-outer .pn-checkbox-svg>.pn-checkbox-svg-checkmark{transition-delay:0.2s;stroke-dashoffset:0}${e("pn-checkbox")}>input:checked+.pn-checkbox[data-tile]{background-color:#e0f8ff;border-color:#005d92}${e("pn-checkbox")}>input:checked+.pn-checkbox[data-tile][data-invalid]{background-color:#fdefee;border-color:#a70707}${e("pn-checkbox")}>input:checked+.pn-checkbox[data-invalid]>.pn-checkbox-outer{background-color:#a70707;border-color:#a70707}${e("pn-checkbox")}>input:checked:hover+.pn-checkbox[data-tile]{border-color:#0d234b}${e("pn-checkbox")}>input:checked:hover+.pn-checkbox>.pn-checkbox-outer{background-color:#0d234b;border-color:#0d234b}${e("pn-checkbox")}>input:checked:hover+.pn-checkbox[data-invalid]{border-color:#500715}${e("pn-checkbox")}>input:checked:hover+.pn-checkbox[data-invalid]>.pn-checkbox-outer{background-color:#500715;border-color:#500715}${e("pn-checkbox")}>input:indeterminate+.pn-checkbox>.pn-checkbox-outer{background-color:#005d92;border-color:#005d92}${e("pn-checkbox")}>input:indeterminate+.pn-checkbox>.pn-checkbox-outer .pn-checkbox-svg>.pn-checkbox-svg-checkmark{stroke-dashoffset:23}${e("pn-checkbox")}>input:indeterminate+.pn-checkbox>.pn-checkbox-outer .pn-checkbox-svg>.pn-checkbox-svg-indeterminate{stroke-dashoffset:0}${e("pn-checkbox")}>input:indeterminate+.pn-checkbox[data-invalid]>.pn-checkbox-outer{background-color:#a70707;border-color:#a70707}${e("pn-checkbox")}>input:indeterminate:hover+.pn-checkbox>.pn-checkbox-outer{background-color:#0d234b;border-color:#0d234b}${e("pn-checkbox")}>input:indeterminate:hover+.pn-checkbox[data-invalid]>.pn-checkbox-outer{background-color:#500715;border-color:#500715}${e("pn-checkbox")}>input:disabled{pointer-events:none}${e("pn-checkbox")}>input:disabled+.pn-checkbox .pn-checkbox-label{pointer-events:none}${e("pn-checkbox")}>input:disabled+.pn-checkbox>.pn-checkbox-outer{background-color:#f3f2f2;border-color:#969087}${e("pn-checkbox")}>input:disabled+.pn-checkbox[data-tile]{background-color:#f3f2f2;border-color:#f3f2f2}${e("pn-checkbox")}>input:disabled+.pn-checkbox[data-tile]>${e("pn-icon")}>.pn-icon-svg path{fill:#5e554a}${e("pn-checkbox")}>input:disabled+.pn-checkbox[data-tile]>.pn-checkbox-content>.pn-checkbox-label{color:#5e554a}${e("pn-checkbox")}>input:disabled:checked+.pn-checkbox>.pn-checkbox-outer{background-color:#969087;border-color:#969087}${e("pn-checkbox")}>input:disabled:indeterminate+.pn-checkbox>.pn-checkbox-outer{background-color:#969087;border-color:#969087}`}},[772,"pn-checkbox",{label:[1],helpertext:[1],value:[513],name:[1],checked:[1028],checkboxid:[1],required:[4],disabled:[4],invalid:[4],indeterminate:[1028],tile:[4],expand:[4],icon:[1],isClosing:[32],isExpanding:[32]},void 0,{checkboxid:[{handleId:0}],checked:[{handleChecked:0}]}]),h=d,b=function(){"undefined"!=typeof customElements&&["pn-checkbox","pn-icon"].forEach((c=>{switch(c){case"pn-checkbox":customElements.get(e(e(c)))||customElements.define(e(e(c)),d);break;case"pn-icon":customElements.get(e(e(c)))||r()}}))};export{h as PnCheckbox,b as defineCustomElement}
|
|
5
|
+
import{transformTag as e,proxyCustomElement as c,Mixin as o,createEvent as n,h as t,Host as i}from"@stencil/core/internal/client";import{u as a}from"./helpers.js";import{a as r}from"./index2.js";import{d}from"./pn-icon2.js";const h=c(class extends(o(r)){constructor(e){super(!1),!1!==e&&this.__registerHost(),this.pnCheckboxChange=n(this,"pnCheckboxChange",3)}id="pn-checkbox-"+a();idHelpertext=this.id+"-helpertext";contentArea;get hostElement(){return this}label;helpertext;value;name;checked=!1;required=!1;disabled=!1;invalid=!1;indeterminate=!1;tile=!1;expand=!1;icon=null;pnId;pnAriaLabel;pnAriaLabelledby;checkboxid;handleId(){this.idHelpertext=this.getId()+"-helpertext"}handleChecked(){this.displayContent()&&(this.checked?this.openDropdown(this.contentArea):this.closeDropdown(this.contentArea))}pnCheckboxChange;componentDidLoad(){this.displayContent()&&this.checked&&requestAnimationFrame((()=>this.openDropdown(this.contentArea)))}getId(){return this.pnId||this.checkboxid||this.id}handleChange(e){const{checked:c}=e.target;this.indeterminate=!1,this.checked=c,this.pnCheckboxChange.emit(e)}isInvalid(){return this.invalid&&!this.disabled}displayText(){return this.displayLabel()||this.displayHelpertext()}displayLabel(){return!!this.label}displayHelpertext(){return!(!this.helpertext&&!this.hostElement.querySelector('[slot="helpertext"]')?.textContent)}displayIcon(){return this.tile&&!!this.icon}displayContent(){return this.tile&&this.expand}getAriaLabel(){return this.displayLabel()||this.pnAriaLabelledby?null:this.pnAriaLabel}getAriaLabelledby(){return this.displayLabel()||this.pnAriaLabel?null:this.pnAriaLabelledby}render(){return t(i,{key:"4952d473c243232a6ee267cfac9414c8feb3e9c7"},t("input",{key:"e478ca15bde8fdf54833fe5b5a834513813db65e",type:"checkbox",id:this.getId(),class:"pn-checkbox-input",value:this.value,name:this.name,disabled:this.disabled,checked:this.checked,required:this.required,indeterminate:this.indeterminate,"aria-label":this.getAriaLabel(),"aria-labelledby":this.getAriaLabelledby(),"aria-describedby":this.displayHelpertext()&&this.idHelpertext,"aria-invalid":this.isInvalid()?.toString(),"data-tile":this.tile,"data-expand":this.expand,onChange:e=>this.handleChange(e)}),t("div",{key:"e918f05ea8a0f5e26a7963dcdbd9cef7a1ae8a57",class:"pn-checkbox","data-tile":this.tile,"data-expand":this.expand,"data-invalid":this.isInvalid()},t("div",{key:"e876cc7ae77d0496c745da65de5883404d0a01c7",class:"pn-checkbox-outer"},t("svg",{key:"2349e0a978e6824658b572462eb5baf9ccda2ec9",class:"pn-checkbox-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},t("polyline",{key:"c01925a07dfb5bbed352ecb741a3e9c830a32b3b",class:"pn-checkbox-svg-line pn-checkbox-svg-checkmark",points:"4,12 9,17 20,6","stroke-width":"3"}),t("polyline",{key:"0d4dfa8da28e602bf0c579c6ca48fda9f1748a38",class:"pn-checkbox-svg-line pn-checkbox-svg-indeterminate",points:"4,12 20,12","stroke-width":"3"}))),t("div",{key:"d3c1f4a8d7aa27d7d9ca192438b84619574fcf39",class:"pn-checkbox-content",hidden:!this.displayText()},t("label",{key:"467ca071291cbd977670300bb45affc7153ae7f4",htmlFor:this.getId(),class:"pn-checkbox-label",hidden:!this.displayLabel()},this.label),t("p",{key:"5c790a6b8583415168a3e92c7b6d3a38125b39cd",id:this.idHelpertext,class:"pn-checkbox-helpertext",hidden:!this.displayHelpertext()},this.helpertext&&t("span",{key:"e35b4ac4a6abd759d7fb5e1d41fd2f198515e106"},this.helpertext),t("slot",{key:"ac060762533af07379cc80225a83de6e01ca26e4",name:"helpertext"})),t("slot",{key:"4f0309028f9266d016f19d8983343ff010d89195"})),this.displayIcon()&&t("pn-icon",{key:"742b544ed4ed61ff311de992eea37b768cc6efef",icon:this.icon,color:"gray900"}),t("div",{key:"45cdad0df43248b340feed887659d6c63e90b85f",class:"pn-checkbox-container","data-open":this.checked,hidden:!this.displayContent(),style:{height:"0px"},ref:e=>this.contentArea=e},t("div",{key:"060550d9876021ba85a1821c51c60b1bb34b8a3c",class:"pn-checkbox-area"},t("slot",{key:"bbe34f9d29a922ab20b8696595a9ed469005f59e",name:"content"})))))}static get watchers(){return{checkboxid:[{handleId:0}],pnId:[{handleId:1}],checked:[{handleChecked:0}]}}static get style(){return`${e("pn-checkbox")}{position:relative;display:inline-block}${e("pn-checkbox")} .pn-checkbox{position:relative;display:flex;flex-wrap:wrap;flex-direction:row}${e("pn-checkbox")} .pn-checkbox-label{cursor:pointer;color:#2d2013;-webkit-tap-highlight-color:transparent}${e("pn-checkbox")} .pn-checkbox-helpertext{color:#5e554a;margin:0 0 0.5em 0;display:flex;flex-direction:column}${e("pn-checkbox")} .pn-checkbox-helpertext:last-child{margin:0}${e("pn-checkbox")} .pn-checkbox-content{display:flex;flex-direction:column;align-items:flex-start;font-weight:400;line-height:1.5;flex:1;margin:0 0 0 0.75em}${e("pn-checkbox")} .pn-checkbox-outer{width:1.5em;height:1.5em;background-color:#ffffff;display:flex;align-items:center;justify-content:center;position:relative;border:0.0625em solid #969087;border-radius:0.25em;outline:0.2rem solid transparent;outline-offset:0.2rem;transition-property:outline-color, border-color, background-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-checkbox")} .pn-checkbox-outer{transition-duration:0s;transition-delay:0s}}${e("pn-checkbox")} .pn-checkbox-svg{width:1.25em;fill:none}${e("pn-checkbox")} .pn-checkbox-svg-line{stroke:#ffffff;transform-origin:0 0;stroke-linecap:round;stroke-dasharray:23;stroke-dashoffset:23;transition-property:stroke-dashoffset;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-checkbox")} .pn-checkbox-svg-line{transition-duration:0s;transition-delay:0s}}${e("pn-checkbox")} .pn-checkbox-svg-line{transition-delay:0s}${e("pn-checkbox")} .pn-checkbox[data-tile]{position:relative;background-color:#ffffff;border:0.0625em solid #969087;border-radius:0.5em;padding:1em;outline:0.2rem solid transparent;outline-offset:0.2rem;transition-property:outline-color, background-color, border-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-checkbox")} .pn-checkbox[data-tile]{transition-duration:0s;transition-delay:0s}}${e("pn-checkbox")} .pn-checkbox[data-tile][data-invalid]{border-color:#a70707}${e("pn-checkbox")} .pn-checkbox[data-invalid] .pn-checkbox-outer{border-color:#a70707}${e("pn-checkbox")} .pn-checkbox-container{flex:1 1 100%;overflow:hidden;visibility:hidden}${e("pn-checkbox")} .pn-checkbox-container[data-open]{visibility:visible;overflow:unset}${e("pn-checkbox")} .pn-checkbox-container[data-moving]{visibility:visible;overflow:hidden}${e("pn-checkbox")} .pn-checkbox-area{padding:0.75em 0 0 2.25em;display:flex;flex-direction:column;flex-wrap:nowrap;gap:1em}${e("pn-checkbox")} .pn-checkbox>${e("pn-icon")}{margin-left:0.75em}${e("pn-checkbox")}>input{cursor:pointer;opacity:0;position:absolute;margin:0;z-index:1;top:0;left:0;font-size:1em;width:1.5em;height:1.5em;-webkit-tap-highlight-color:transparent}${e("pn-checkbox")}>input[data-tile]:not([data-expand]){width:100%;height:100%}${e("pn-checkbox")}>input[data-expand]{top:1em;left:1em}${e("pn-checkbox")}>input[aria-describedby]+.pn-checkbox[data-tile] .pn-checkbox-label{font-weight:500}${e("pn-checkbox")}>input:hover+.pn-checkbox>.pn-checkbox-outer{background-color:#e0f8ff;border-color:#005d92}${e("pn-checkbox")}>input:hover+.pn-checkbox[data-tile]{background-color:#e0f8ff;border-color:#005d92}${e("pn-checkbox")}>input:hover+.pn-checkbox[data-tile][data-invalid]{background-color:#fdefee;border-color:#a70707}${e("pn-checkbox")}>input:hover+.pn-checkbox[data-invalid]>.pn-checkbox-outer{background-color:#fdefee;border-color:#a70707}${e("pn-checkbox")}>input:focus-visible+.pn-checkbox>.pn-checkbox-outer{outline-color:#005d92}${e("pn-checkbox")}>input:focus-visible+.pn-checkbox[data-tile]{outline-color:#005d92;border-color:#005d92}${e("pn-checkbox")}>input:focus-visible+.pn-checkbox[data-tile][data-invalid]{outline-color:#a70707;border-color:#a70707}${e("pn-checkbox")}>input:focus-visible+.pn-checkbox[data-tile][data-invalid]>.pn-checkbox-outer{outline-color:transparent}${e("pn-checkbox")}>input:focus-visible+.pn-checkbox[data-tile]>.pn-checkbox-outer{outline-color:transparent}${e("pn-checkbox")}>input:focus-visible+.pn-checkbox[data-invalid]>.pn-checkbox-outer{outline-color:#a70707}${e("pn-checkbox")}>input:checked+.pn-checkbox>.pn-checkbox-outer{background-color:#005d92;border-color:#005d92}${e("pn-checkbox")}>input:checked+.pn-checkbox>.pn-checkbox-outer .pn-checkbox-svg>.pn-checkbox-svg-indeterminate{stroke-dashoffset:23}${e("pn-checkbox")}>input:checked+.pn-checkbox>.pn-checkbox-outer .pn-checkbox-svg>.pn-checkbox-svg-checkmark{transition-delay:0.2s;stroke-dashoffset:0}${e("pn-checkbox")}>input:checked+.pn-checkbox[data-tile]{background-color:#e0f8ff;border-color:#005d92}${e("pn-checkbox")}>input:checked+.pn-checkbox[data-tile][data-invalid]{background-color:#fdefee;border-color:#a70707}${e("pn-checkbox")}>input:checked+.pn-checkbox[data-invalid]>.pn-checkbox-outer{background-color:#a70707;border-color:#a70707}${e("pn-checkbox")}>input:checked:hover+.pn-checkbox[data-tile]{border-color:#0d234b}${e("pn-checkbox")}>input:checked:hover+.pn-checkbox>.pn-checkbox-outer{background-color:#0d234b;border-color:#0d234b}${e("pn-checkbox")}>input:checked:hover+.pn-checkbox[data-invalid]{border-color:#500715}${e("pn-checkbox")}>input:checked:hover+.pn-checkbox[data-invalid]>.pn-checkbox-outer{background-color:#500715;border-color:#500715}${e("pn-checkbox")}>input:indeterminate+.pn-checkbox>.pn-checkbox-outer{background-color:#005d92;border-color:#005d92}${e("pn-checkbox")}>input:indeterminate+.pn-checkbox>.pn-checkbox-outer .pn-checkbox-svg>.pn-checkbox-svg-checkmark{stroke-dashoffset:23}${e("pn-checkbox")}>input:indeterminate+.pn-checkbox>.pn-checkbox-outer .pn-checkbox-svg>.pn-checkbox-svg-indeterminate{stroke-dashoffset:0}${e("pn-checkbox")}>input:indeterminate+.pn-checkbox[data-invalid]>.pn-checkbox-outer{background-color:#a70707;border-color:#a70707}${e("pn-checkbox")}>input:indeterminate:hover+.pn-checkbox>.pn-checkbox-outer{background-color:#0d234b;border-color:#0d234b}${e("pn-checkbox")}>input:indeterminate:hover+.pn-checkbox[data-invalid]>.pn-checkbox-outer{background-color:#500715;border-color:#500715}${e("pn-checkbox")}>input:disabled{pointer-events:none}${e("pn-checkbox")}>input:disabled+.pn-checkbox .pn-checkbox-label{pointer-events:none}${e("pn-checkbox")}>input:disabled+.pn-checkbox>.pn-checkbox-outer{background-color:#f3f2f2;border-color:#969087}${e("pn-checkbox")}>input:disabled+.pn-checkbox[data-tile]{background-color:#f3f2f2;border-color:#f3f2f2}${e("pn-checkbox")}>input:disabled+.pn-checkbox[data-tile]>${e("pn-icon")} .pn-icon-svg path{fill:#5e554a}${e("pn-checkbox")}>input:disabled+.pn-checkbox[data-tile]>.pn-checkbox-content>.pn-checkbox-label{color:#5e554a}${e("pn-checkbox")}>input:disabled:checked+.pn-checkbox>.pn-checkbox-outer{background-color:#969087;border-color:#969087}${e("pn-checkbox")}>input:disabled:indeterminate+.pn-checkbox>.pn-checkbox-outer{background-color:#969087;border-color:#969087}`}},[772,"pn-checkbox",{label:[1],helpertext:[1],value:[513],name:[1],checked:[1540],required:[4],disabled:[4],invalid:[4],indeterminate:[1028],tile:[4],expand:[4],icon:[1],pnId:[1,"pn-id"],pnAriaLabel:[1,"pn-aria-label"],pnAriaLabelledby:[1,"pn-aria-labelledby"],checkboxid:[1],isClosing:[32],isExpanding:[32]},void 0,{checkboxid:[{handleId:0}],pnId:[{handleId:1}],checked:[{handleChecked:0}]}]),b=h,p=function(){"undefined"!=typeof customElements&&["pn-checkbox","pn-icon"].forEach((c=>{switch(c){case"pn-checkbox":customElements.get(e(e(c)))||customElements.define(e(e(c)),h);break;case"pn-icon":customElements.get(e(e(c)))||d()}}))};export{b as PnCheckbox,p as defineCustomElement}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* By PostNord.
|
|
4
4
|
*/
|
|
5
|
-
import{transformTag as c,proxyCustomElement as i,HTMLElement as e,h as n,Host as o}from"@stencil/core/internal/client";import{u as p}from"./helpers.js";import{c as h}from"./check.js";import{d as t}from"./pn-icon2.js";const a=i(class extends e{constructor(c){super(),!1!==c&&this.__registerHost()}get hostElement(){return this}
|
|
5
|
+
import{transformTag as c,proxyCustomElement as i,HTMLElement as e,h as n,Host as o}from"@stencil/core/internal/client";import{u as p}from"./helpers.js";import{c as h}from"./check.js";import{d as t}from"./pn-icon2.js";const a=i(class extends e{constructor(c){super(),!1!==c&&this.__registerHost()}id="pn-choice-chip-"+p();get hostElement(){return this}label;value;name;checked=!1;required=!1;disabled=!1;radio=!1;icon;small=!1;large=!1;pnId;choiceid;inputType(){return this.radio?"radio":"checkbox"}getId(){return this.pnId||this.choiceid||this.id}render(){return n(o,{key:"34b4a84a6fa6ebd0c592a4d585d333084e72c89f"},n("div",{key:"66c7aa91b09795d9d452b1d6c0b65f0b64ba25f9",class:"pn-choice-chip"},n("input",{key:"8723fd54d3ff2fed1a64c955ab3ea2e4812ff04f",type:this.inputType(),id:this.getId(),value:this.value,name:this.name,checked:this.checked,required:this.required,disabled:this.disabled}),n("div",{key:"9fd84d08b519181f954c3b62b1644afab67569ad",class:"pn-choice-chip-container","data-icon":!!this.icon,"data-small":this.small,"data-large":this.large},n("div",{key:"29b394a6806acbd2d9f905971555242f8bf81d32",class:"pn-choice-chip-icon"},n("pn-icon",{key:"22031f1693f50efa6b9e049c643e9ecbc931bea6",color:"blue700",class:"pn-choice-chip-icon-check",icon:h}),!!this.icon&&n("pn-icon",{key:"573e411940efa3054290a5cb574978dddddfb766",color:"blue700",class:"pn-choice-chip-icon-user",icon:this.icon})),n("label",{key:"c0deb7c6cd33da32bc4b89af84d04a7383664024",class:"pn-choice-chip-label",htmlFor:this.getId()},n("span",{key:"ea43103d3f3d2332a52e9191ff37262bce642dbb"},this.label),n("slot",{key:"904ac98a84bd191e74323154b7ea6de39dca964a"})))))}static get style(){return`${c("pn-choice-chip")}{display:inline-block}${c("pn-choice-chip")} .pn-choice-chip{position:relative;font-size:1em;font-weight:500;text-align:center}${c("pn-choice-chip")} .pn-choice-chip-container{cursor:pointer;position:relative;display:flex;align-items:center;gap:0;padding:0.5em 1em;border:0.0625em solid #969087;border-radius:0.5em;background-color:#ffffff;transition-property:border-color, outline-color, background-color, padding, gap;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${c("pn-choice-chip")} .pn-choice-chip-container{transition-duration:0s;transition-delay:0s}}${c("pn-choice-chip")} .pn-choice-chip-container{outline:0.2rem solid transparent;outline-offset:0.2rem}${c("pn-choice-chip")} .pn-choice-chip-container[data-icon]{gap:0.25em;padding-left:0.75em}${c("pn-choice-chip")} .pn-choice-chip-container[data-icon][data-small]{padding-left:0.5em}${c("pn-choice-chip")} .pn-choice-chip-container[data-icon][data-large]{padding-left:1em}${c("pn-choice-chip")} .pn-choice-chip-container[data-icon]>.pn-choice-chip-icon{width:1.5em}${c("pn-choice-chip")} .pn-choice-chip-container[data-small]{padding:0.25em 0.75em}${c("pn-choice-chip")} .pn-choice-chip-container[data-small] .pn-choice-chip-label{line-height:1.25em}${c("pn-choice-chip")} .pn-choice-chip-container[data-small] .pn-choice-chip-label>span{font-size:0.875em}${c("pn-choice-chip")} .pn-choice-chip-container[data-large]{padding:0.6875em 1.25em}${c("pn-choice-chip")} .pn-choice-chip-icon{position:relative;width:0;height:1.5em;transition-property:width;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${c("pn-choice-chip")} .pn-choice-chip-icon{transition-duration:0s;transition-delay:0s}}${c("pn-choice-chip")} .pn-choice-chip-icon ${c("pn-icon")}{opacity:0;transform:scale(0);position:absolute;top:0;left:0;transition-property:transform, opacity;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${c("pn-choice-chip")} .pn-choice-chip-icon ${c("pn-icon")}{transition-duration:0s;transition-delay:0s}}${c("pn-choice-chip")} .pn-choice-chip-icon ${c("pn-icon")}.pn-choice-chip-icon-user{opacity:1;transform:scale(1)}${c("pn-choice-chip")} .pn-choice-chip-label{color:#005d92;line-height:1.5em;transition-property:color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${c("pn-choice-chip")} .pn-choice-chip-label{transition-duration:0s;transition-delay:0s}}${c("pn-choice-chip")} .pn-choice-chip-label{cursor:pointer;display:flex;align-items:center;flex-grow:1;height:100%}${c("pn-choice-chip")} .pn-choice-chip>input{position:absolute;z-index:1;opacity:0;top:0;left:0;width:100%;height:100%;margin:0;cursor:pointer}${c("pn-choice-chip")} .pn-choice-chip>input:not(:checked)~.pn-choice-chip-container>.pn-choice-chip-icon>.pn-choice-chip-icon-user{transform:scale(1);opacity:1}${c("pn-choice-chip")} .pn-choice-chip>input:hover~.pn-choice-chip-container{background-color:#effbff;border-color:#005d92}${c("pn-choice-chip")} .pn-choice-chip>input:hover~.pn-choice-chip-container .pn-choice-chip-icon-user .pn-icon-svg path,${c("pn-choice-chip")} .pn-choice-chip>input:hover~.pn-choice-chip-container .pn-choice-chip-icon-check .pn-icon-svg path{fill:#005d92}${c("pn-choice-chip")} .pn-choice-chip>input:hover~.pn-choice-chip-container .pn-choice-chip-label{color:#005d92}${c("pn-choice-chip")} .pn-choice-chip>input:checked~.pn-choice-chip-container{gap:0.25em;background-color:#e0f8ff;border-color:#005d92}${c("pn-choice-chip")} .pn-choice-chip>input:checked~.pn-choice-chip-container>.pn-choice-chip-icon{width:1.5em;stroke-dashoffset:23}${c("pn-choice-chip")} .pn-choice-chip>input:checked~.pn-choice-chip-container>.pn-choice-chip-icon>.pn-choice-chip-icon-check{transform:scale(1);opacity:1}${c("pn-choice-chip")} .pn-choice-chip>input:checked~.pn-choice-chip-container>.pn-choice-chip-icon>.pn-choice-chip-icon-user{transform:scale(0);opacity:0}${c("pn-choice-chip")} .pn-choice-chip>input:checked~.pn-choice-chip-container>.pn-choice-chip-label{color:#0d234b}${c("pn-choice-chip")} .pn-choice-chip>input:checked:hover~.pn-choice-chip-container{background-color:#effbff;border-color:#0d234b}${c("pn-choice-chip")} .pn-choice-chip>input:checked:hover~.pn-choice-chip-container>.pn-choice-chip-icon>.pn-choice-chip-icon-check path{fill:#0d234b}${c("pn-choice-chip")} .pn-choice-chip>input:checked:hover~.pn-choice-chip-container>.pn-choice-chip-label{color:#0d234b}${c("pn-choice-chip")} .pn-choice-chip>input:focus-visible~.pn-choice-chip-container{outline-color:#005d92;border-color:#005d92}${c("pn-choice-chip")} .pn-choice-chip>input:disabled{cursor:not-allowed}${c("pn-choice-chip")} .pn-choice-chip>input:disabled:active~.pn-choice-chip-container{outline:none}${c("pn-choice-chip")} .pn-choice-chip>input:disabled~.pn-choice-chip-container{background-color:#f3f2f2;border-color:#f3f2f2;cursor:not-allowed}${c("pn-choice-chip")} .pn-choice-chip>input:disabled~.pn-choice-chip-container .pn-choice-chip-label{color:#5e554a;cursor:not-allowed}${c("pn-choice-chip")} .pn-choice-chip>input:disabled~.pn-choice-chip-container ${c("pn-icon")} .pn-icon-svg path{fill:#5e554a}`}},[772,"pn-choice-chip",{label:[1],value:[513],name:[1],checked:[1028],required:[4],disabled:[4],radio:[4],icon:[1],small:[4],large:[4],pnId:[1,"pn-id"],choiceid:[1]}]),r=a,d=function(){"undefined"!=typeof customElements&&["pn-choice-chip","pn-icon"].forEach((i=>{switch(i){case"pn-choice-chip":customElements.get(c(c(i)))||customElements.define(c(c(i)),a);break;case"pn-icon":customElements.get(c(c(i)))||t()}}))};export{r as PnChoiceChip,d as defineCustomElement}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* By PostNord.
|
|
4
4
|
*/
|
|
5
|
-
import{transformTag as e,proxyCustomElement as t,HTMLElement as n,createEvent as i,h as o,Host as r}from"@stencil/core/internal/client";import{u as s,k as a,e as c}from"./helpers.js";import{d as l}from"./pn-button2.js";import{d as u}from"./pn-icon2.js";import{d as p}from"./pn-spinner2.js";const d={DECREASE:{en:"Decrease",sv:"Minska",da:"Reducere",fi:"Vähentää",no:"Redusere"},INCREASE:{en:"Increase",sv:"Öka",da:"Øge",fi:"Lisääntyä",no:"Øke"},MAX_VALUE_MESSAGE:{en:"Maximum value is ",sv:"Högsta värde är ",da:"Højeste værdi er",fi:"Korkein arvo on",no:"Høyeste verdi er"},MIN_VALUE_MESSAGE:{en:"Minimum value is ",sv:"Lägsta värde är ",da:"Laveste værdi er ",fi:"Pienin arvo on ",no:"Laveste verdi er "}},h=t(class extends n{constructor(e){super(),!1!==e&&this.__registerHost(),this.counterInput=i(this,"counterInput",7)}id="pn-counter-"+s();idLabel=this.id+"-label";idText=this.id+"-text";idAmount=this.id+"-count";get hostElement(){return this}clearAriaTimer;displaySrValue=!1;showMinMaxMessage=!1;lastDispatchedValue;interactType;label;helpertext;value=0;counterid=this.id;compact=!1;language=null;labelDecrease;labelIncrease;minMessage;maxMessage;name;min;max;step=1;list;required=!1;readonly=!1;disabled=!1;counterInput;watchValue(){this.showSrContent(),this.showMinMaxMessage=!1,this.hasMin()&&this.value<this.min&&(this.setMin(),this.showMinMaxMessage=!0),this.hasMax()&&this.value>this.max&&(this.setMax(),this.showMinMaxMessage=!0),this.lastDispatchedValue!==this.value&&this.counterInput.emit({value:this.value,input:"input"===this.interactType,decrease:"decrease"===this.interactType,increase:"increase"===this.interactType}),this.lastDispatchedValue=this.value}handleId(){this.idLabel=this.counterid+"-label",this.idText=this.counterid+"-text",this.idAmount=this.counterid+"-count"}async componentWillLoad(){this.handleId(),this.language||await a(this.hostElement)}setVal(e){const{valueAsNumber:t}=e.target;isNaN(t)||(this.interactType="input",this.value=t)}setMin(){this.hasMin()&&(this.value=this.min)}setMax(){this.hasMax()&&(this.value=this.max)}hasMin(){return"number"==typeof this.min}hasMax(){return"number"==typeof this.max}decreaseAmount(){this.hasMin()&&this.value<=this.min&&(this.showMinMaxMessage=!0),this.interactType="decrease",this.value=this.value-this.step}increaseAmount(){this.hasMax()&&this.value>=this.max&&(this.showMinMaxMessage=!0),this.interactType="increase",this.value=this.value+this.step}keyBoardInput(e){e.stopImmediatePropagation(),/^(Home|End)$/.test(e.key)&&(e.preventDefault(),this.interactType="input","Home"===e.key&&this.setMin(),"End"===e.key&&this.setMax())}showSrContent(){this.clearAriaTimer&&clearTimeout(this.clearAriaTimer),this.displaySrValue=!0,this.clearAriaTimer=setTimeout((()=>{this.displaySrValue=!1}),4e3)}toggleMinMaxMessage(){const e=this.value===this.max,t=this.translate((e?"MAX":"MIN")+"_VALUE_MESSAGE")+""+(e?this.max:this.min);return e?this.maxMessage||t:this.minMessage||t}getTextMessage(e=!1){return this.showMinMaxMessage?this.toggleMinMaxMessage():e?""+this.value:this.helpertext}describedbyIds(){const e=[];return this.helpertext&&e.push(this.idText),this.displaySrValue&&e.push(this.idAmount),0===e.length?null:e.join(" ")}translate(e){return d?.[e]?.[this.language||c]}noButtons(){return this.disabled||this.readonly}renderLabel(){return o("label",{htmlFor:this.counterid,class:"pn-counter-label",id:this.idLabel,"data-compact":this.compact},o("span",null,this.label))}renderButton(e=!1){const t=e?this.labelIncrease||this.translate("INCREASE"):this.labelDecrease||this.translate("DECREASE");return o("pn-button",{"data-increase":!!e||null,"data-decrease":!e||null,appearance:"light",variant:"outlined","no-tab":this.noButtons(),icon:e?'<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 2a1 1 0 0 1 1 1v8h8a1 1 0 1 1 0 2h-8v8a1 1 0 1 1-2 0v-8H3a1 1 0 1 1 0-2h8V3a1 1 0 0 1 1-1" clip-rule="evenodd"/></svg>':'<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="M2 12a1 1 0 0 1 1-1h18a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1" clip-rule="evenodd"/></svg>',iconOnly:!0,tooltip:t,onPnClick:()=>e?this.increaseAmount():this.decreaseAmount()})}render(){return o(r,{key:"8f8a1d6f9cf41e43a17146796bdbadfabb5421da"},o("div",{key:"1de06de8544eeb0efcdd940da16fd7cb39620897",class:"pn-counter",role:"group","aria-labelledby":this.idLabel,"aria-describedby":this.describedbyIds()},!this.compact&&this.renderLabel(),o("div",{key:"83280bb5e207a2a226e7174f5819ef0f375f06c6",class:"pn-counter-items","data-hidebuttons":this.noButtons()},this.renderButton(),o("div",{key:"6f3cc4e8987d526be974bd561f2e3413e83cc35f",class:"pn-counter-input"},o("input",{key:"f2cb0054546017a768e68503aaf7fd93b55c5885",id:this.counterid,class:"pn-counter-element",type:"number",min:this.min,max:this.max,step:this.step,value:this.value,name:this.name,placeholder:this.compact?" ":null,required:this.required,readonly:this.readonly,disabled:this.disabled,"aria-describedby":this.describedbyIds(),"data-compact":this.compact,onInput:e=>this.setVal(e),onKeyDown:e=>this.keyBoardInput(e)}),this.compact&&this.renderLabel()),this.renderButton(!0)),!!this.getTextMessage()&&o("p",{key:"cb64255f574b4d9fc7ba0098d9f7353c5c639956",id:this.idText,class:"pn-counter-helpertext"},o("span",{key:"76a5d077b53f2a60c1d39f42b34e8312ae250d86"},this.getTextMessage())),o("p",{key:"37d61e40910bb4cd0cc072772c3dd5414fe31574",id:this.idAmount,class:"pn-counter-sr-only","aria-live":"assertive"},this.displaySrValue?this.getTextMessage(!0):"")))}static get watchers(){return{value:[{watchValue:0}],counterid:[{handleId:0}]}}static get style(){return`${e("pn-counter")}{display:inline-block}${e("pn-counter")} .pn-counter{display:flex;flex-direction:column}${e("pn-counter")} .pn-counter-label{cursor:pointer;display:flex;justify-content:space-between;align-items:flex-end;font-weight:400;color:#2d2013;margin:0 0 0.25em 0;gap:0.5em;-webkit-tap-highlight-color:transparent;transition-property:color, transform;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-counter")} .pn-counter-label{transition-duration:0s;transition-delay:0s}}${e("pn-counter")} .pn-counter-label[data-compact]{position:absolute;top:1.5625em;left:calc(var(--pn-input-offset-left, 0px) + 0.75em + 0.0625em);margin:0;pointer-events:none;align-items:center;height:1.5em;max-width:calc(100% - (var(--pn-input-offset-left, 0px) + 0.75em) - (var(--pn-input-offset-right, 0px) + 0.75em));transform:translateY(-50%) scale(1) translateZ(0);transform-origin:0 0;transition-delay:0.2s}${e("pn-counter")} .pn-counter-label[data-compact]>span{font-size:1em;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;line-height:1.5em}${e("pn-counter")} .pn-counter-label>span{font-size:0.875em}${e("pn-counter")} .pn-counter-input{position:relative;flex:1 1 auto}${e("pn-counter")} .pn-counter-element{text-align:center;width:100%;appearance:textfield;color:#2d2013;background-color:#ffffff;border:0.0625em solid #969087;border-radius:0.5em;padding:0.75em;font-family:inherit;font-size:1em;font-weight:500;line-height:1.5em;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}${e("pn-counter")} .pn-counter-element:-webkit-autofill,${e("pn-counter")} .pn-counter-element:-webkit-autofill:hover,${e("pn-counter")} .pn-counter-element:-webkit-autofill:focus,${e("pn-counter")} .pn-counter-element:-webkit-autofill:active{-webkit-box-shadow:0 0 0 10em #e0f8ff inset;-webkit-text-fill-color:#2d2013}${e("pn-counter")} .pn-counter-element{outline:0.2rem solid transparent;outline-offset:0.2rem}${e("pn-counter")} .pn-counter-element:focus-visible{outline-color:#005d92;background-color:#ffffff;border-color:#005d92}${e("pn-counter")} .pn-counter-element{transition-property:outline-color, background-color, border-color, color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-counter")} .pn-counter-element{transition-duration:0s;transition-delay:0s}}${e("pn-counter")} .pn-counter-element[data-compact]{text-align:left;padding-top:1.125em;padding-bottom:0.375em;max-width:unset}${e("pn-counter")} .pn-counter-element[data-compact]::placeholder{color:transparent}${e("pn-counter")} .pn-counter-element[data-compact]:focus+.pn-counter-label,${e("pn-counter")} .pn-counter-element[data-compact]:not(:placeholder-shown)+.pn-counter-label{transform:translateY(-85%) scale(0.75);transition-delay:0s}${e("pn-counter")} .pn-counter-element::placeholder{color:#5e554a;font-weight:normal}${e("pn-counter")} .pn-counter-element:hover{border-color:#005d92}${e("pn-counter")} .pn-counter-element:disabled{color:#5e554a;background-color:#f3f2f2;border-color:#f3f2f2}${e("pn-counter")} .pn-counter-element:read-only{border-color:#ffffff}${e("pn-counter")} .pn-counter-element:disabled{color:#5e554a;background-color:#f3f2f2;border-color:#f3f2f2}${e("pn-counter")} .pn-counter-element:out-of-range{border-color:#a70707}${e("pn-counter")} .pn-counter-element:out-of-range:hover{border-color:#500715}${e("pn-counter")} .pn-counter-element:out-of-range:focus-visible{background-color:#ffffff;border-color:#a70707;outline-color:#a70707}${e("pn-counter")} .pn-counter-element:out-of-range:-webkit-autofill,${e("pn-counter")} .pn-counter-element:out-of-range:-webkit-autofill:hover,${e("pn-counter")} .pn-counter-element:out-of-range:-webkit-autofill:focus,${e("pn-counter")} .pn-counter-element:out-of-range:-webkit-autofill:active{-webkit-box-shadow:0 0 0 10em #fef7f6 inset;-webkit-text-fill-color:#2d2013}${e("pn-counter")} .pn-counter-element::-webkit-inner-spin-button,${e("pn-counter")} .pn-counter-element::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}${e("pn-counter")} .pn-counter-items{display:inline-flex;flex-direction:row;gap:0.5em;transition-property:gap;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-counter")} .pn-counter-items{transition-duration:0s;transition-delay:0s}}${e("pn-counter")} .pn-counter-items[data-hidebuttons]{gap:0}${e("pn-counter")} .pn-counter-items[data-hidebuttons]>${e("pn-button")}{transform:scale(0) translateZ(0);width:0}${e("pn-counter")} .pn-counter-items>${e("pn-button")}{transform:scale(1) translateZ(0);transform-origin:center center;width:3em;will-change:width, transform;transition-property:transform, width;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-counter")} .pn-counter-items>${e("pn-button")}{transition-duration:0s;transition-delay:0s}}${e("pn-counter")} .pn-counter-helpertext{color:#5e554a;font-size:0.875em;font-weight:400;margin:0.25em 0 0 0;display:flex;flex-direction:column;gap:0.25em}${e("pn-counter")} .pn-counter-sr-only{position:absolute;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);margin:-1px;white-space:nowrap}`}},[512,"pn-counter",{label:[1],helpertext:[1],value:[1538],counterid:[1],compact:[4],language:[1],labelDecrease:[1,"label-decrease"],labelIncrease:[1,"label-increase"],minMessage:[1,"min-message"],maxMessage:[1,"max-message"],name:[1],min:[2],max:[2],step:[2],list:[1],required:[4],readonly:[4],disabled:[4],clearAriaTimer:[32],displaySrValue:[32],showMinMaxMessage:[32],lastDispatchedValue:[32],interactType:[32]},void 0,{value:[{watchValue:0}],counterid:[{handleId:0}]}]),m=h,f=function(){"undefined"!=typeof customElements&&["pn-counter","pn-button","pn-icon","pn-spinner"].forEach((t=>{switch(t){case"pn-counter":customElements.get(e(e(t)))||customElements.define(e(e(t)),h);break;case"pn-button":customElements.get(e(e(t)))||l();break;case"pn-icon":customElements.get(e(e(t)))||u();break;case"pn-spinner":customElements.get(e(e(t)))||p()}}))};export{m as PnCounter,f as defineCustomElement}
|
|
5
|
+
import{transformTag as e,proxyCustomElement as t,HTMLElement as n,createEvent as i,h as r,Host as o}from"@stencil/core/internal/client";import{u as a,k as s,e as l}from"./helpers.js";import{d as c}from"./pn-button2.js";import{d as u}from"./pn-icon2.js";import{d as p}from"./pn-spinner2.js";const d={DECREASE:{en:"Decrease",sv:"Minska",da:"Reducere",fi:"Vähentää",no:"Redusere"},INCREASE:{en:"Increase",sv:"Öka",da:"Øge",fi:"Lisääntyä",no:"Øke"},MAX_VALUE_MESSAGE:{en:"Maximum value is ",sv:"Högsta värde är ",da:"Højeste værdi er",fi:"Korkein arvo on",no:"Høyeste verdi er"},MIN_VALUE_MESSAGE:{en:"Minimum value is ",sv:"Lägsta värde är ",da:"Laveste værdi er ",fi:"Pienin arvo on ",no:"Laveste verdi er "}},h=t(class extends n{constructor(e){super(),!1!==e&&this.__registerHost(),this.counterInput=i(this,"counterInput",7)}id="pn-counter-"+a();idLabel=this.id+"-label";idText=this.id+"-text";idAmount=this.id+"-count";get hostElement(){return this}clearAriaTimer;displaySrValue=!1;showMinMaxMessage=!1;lastDispatchedValue;interactType;label;helpertext;language=void 0;value=0;name;min;max;step=1;list;required=!1;readonly=!1;disabled=!1;compact=!1;labelDecrease;labelIncrease;hideTooltips=!1;minMessage;maxMessage;pnId;pnAriaLabel;pnAriaLabelledby;counterid;counterInput;watchValue(){this.showSrContent(),this.showMinMaxMessage=!1,this.hasMin()&&this.value<this.min&&(this.setMin(),this.showMinMaxMessage=!0),this.hasMax()&&this.value>this.max&&(this.setMax(),this.showMinMaxMessage=!0),this.lastDispatchedValue!==this.value&&this.counterInput.emit({value:this.value,input:"input"===this.interactType,decrease:"decrease"===this.interactType,increase:"increase"===this.interactType}),this.lastDispatchedValue=this.value}handleId(){this.idLabel=this.getId()+"-label",this.idText=this.getId()+"-text",this.idAmount=this.getId()+"-count"}async componentWillLoad(){void 0===this.language&&await s(this.hostElement)}getId(){return this.pnId||this.counterid||this.id}setVal(e){const{valueAsNumber:t}=e.target;isNaN(t)||(this.interactType="input",this.value=t)}setMin(){this.hasMin()&&(this.value=this.min)}setMax(){this.hasMax()&&(this.value=this.max)}hasMin(){return"number"==typeof this.min}hasMax(){return"number"==typeof this.max}getAriaLabel(){return this.label||this.pnAriaLabelledby?null:this.pnAriaLabel}getAriaLabelledby(){return this.label||this.pnAriaLabel?null:this.pnAriaLabelledby}decreaseAmount(){this.hasMin()&&this.value<=this.min&&(this.showMinMaxMessage=!0),this.interactType="decrease",this.value=this.value-this.step}increaseAmount(){this.hasMax()&&this.value>=this.max&&(this.showMinMaxMessage=!0),this.interactType="increase",this.value=this.value+this.step}keyBoardInput(e){e.stopImmediatePropagation(),/^(Home|End)$/.test(e.key)&&(e.preventDefault(),this.interactType="input","Home"===e.key&&this.setMin(),"End"===e.key&&this.setMax())}showSrContent(){this.clearAriaTimer&&clearTimeout(this.clearAriaTimer),this.displaySrValue=!0,this.clearAriaTimer=setTimeout((()=>{this.displaySrValue=!1}),4e3)}toggleMinMaxMessage(){const e=this.value===this.max,t=this.translate((e?"MAX":"MIN")+"_VALUE_MESSAGE")+""+(e?this.max:this.min);return e?this.maxMessage||t:this.minMessage||t}getTextMessage(e=!1){return this.showMinMaxMessage?this.toggleMinMaxMessage():e?""+this.value:this.helpertext}hideHelpertext(){const e=this.hostElement.querySelector('[slot="helpertext"]');return!(this.getTextMessage()||e?.textContent)}describedbyIds(){const e=[];return this.hideHelpertext()||e.push(this.idText),this.displaySrValue&&e.push(this.idAmount),0===e.length?null:e.join(" ")}translate(e){return d?.[e]?.[this.language||l]}noButtons(){return this.disabled||this.readonly}renderLabel(){return this.label?r("label",{htmlFor:this.getId(),class:"pn-counter-label",id:this.idLabel,"data-compact":this.compact},r("span",null,this.label)):null}renderButton(e=!1){const t=e?this.labelIncrease||this.translate("INCREASE"):this.labelDecrease||this.translate("DECREASE");return r("pn-button",{"data-increase":!!e||null,"data-decrease":!e||null,appearance:"light",variant:"outlined","no-tab":this.noButtons(),icon:e?'<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 2a1 1 0 0 1 1 1v8h8a1 1 0 1 1 0 2h-8v8a1 1 0 1 1-2 0v-8H3a1 1 0 1 1 0-2h8V3a1 1 0 0 1 1-1" clip-rule="evenodd"/></svg>':'<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="M2 12a1 1 0 0 1 1-1h18a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1" clip-rule="evenodd"/></svg>',iconOnly:!0,tooltip:this.hideTooltips?null:t,arialabel:this.hideTooltips?t:null,onPnClick:()=>e?this.increaseAmount():this.decreaseAmount()})}render(){return r(o,{key:"f1ff6cf51a77b28c5375f80c686106f82026eda8"},r("div",{key:"a6080106e0bf5ca0246e5a47a114c5ba967be4ef",class:"pn-counter",role:"group","aria-labelledby":this.idLabel,"aria-describedby":this.describedbyIds()},!this.compact&&this.renderLabel(),r("div",{key:"ef3c419277ca2f2a2f8fe8cefad5633c893b4736",class:"pn-counter-items","data-hidebuttons":this.noButtons()},this.renderButton(),r("div",{key:"c130e8c0d812eaad1cf794e9417ab62d3c12e1a7",class:"pn-counter-input"},r("input",{key:"908746fc89d2d70fb6f26f0f13bbe99961d66222",id:this.getId(),class:"pn-counter-element",type:"number",min:this.min,max:this.max,step:this.step,value:this.value,name:this.name,placeholder:this.compact?" ":null,required:this.required,readonly:this.readonly,disabled:this.disabled,"aria-label":this.getAriaLabel(),"aria-labelledby":this.getAriaLabelledby(),"aria-describedby":this.describedbyIds(),"data-compact":this.compact,onInput:e=>this.setVal(e),onKeyDown:e=>this.keyBoardInput(e)}),this.compact&&this.renderLabel()),this.renderButton(!0)),r("p",{key:"a25cd6e9abdb9fe8077e345cef828e187a11d260",id:this.idText,class:"pn-counter-helpertext",hidden:this.hideHelpertext()},r("span",{key:"533d9836452f3b21a176eb594c225ad44c21956e"},this.getTextMessage()),r("slot",{key:"35f10d13c8a1c65e6fc7b1a75b864e1cfd268837",name:"helpertext"})),r("p",{key:"1009ba0ea75131d6c19e3fb8960c39fc9d565d16",id:this.idAmount,class:"pn-counter-sr-only","aria-live":"assertive"},this.displaySrValue?this.getTextMessage(!0):"")))}static get watchers(){return{value:[{watchValue:0}],counterid:[{handleId:0}],pnId:[{handleId:1}]}}static get style(){return`${e("pn-counter")}{display:inline-block}${e("pn-counter")} .pn-counter{display:flex;flex-direction:column}${e("pn-counter")} .pn-counter-label{cursor:pointer;display:flex;justify-content:space-between;align-items:flex-end;font-weight:400;color:#2d2013;margin:0 0 0.25em 0;gap:0.5em;-webkit-tap-highlight-color:transparent;transition-property:color, transform;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-counter")} .pn-counter-label{transition-duration:0s;transition-delay:0s}}${e("pn-counter")} .pn-counter-label[data-compact]{position:absolute;top:1.5625em;left:calc(var(--pn-input-offset-left, 0px) + 0.75em + 0.0625em);margin:0;pointer-events:none;align-items:center;height:1.5em;max-width:calc(100% - (var(--pn-input-offset-left, 0px) + 0.75em) - (var(--pn-input-offset-right, 0px) + 0.75em));transform:translateY(-50%) scale(1) translateZ(0);transform-origin:0 0;transition-delay:0.2s}${e("pn-counter")} .pn-counter-label[data-compact]>span{font-size:1em;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;line-height:1.5em}${e("pn-counter")} .pn-counter-label>span{font-size:0.875em}${e("pn-counter")} .pn-counter-input{position:relative;flex:1 1 auto}${e("pn-counter")} .pn-counter-element{text-align:center;width:100%;appearance:textfield;color:#2d2013;background-color:#ffffff;border:0.0625em solid #969087;border-radius:0.5em;padding:0.75em;font-family:inherit;font-size:1em;font-weight:500;line-height:1.5em;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}${e("pn-counter")} .pn-counter-element:-webkit-autofill,${e("pn-counter")} .pn-counter-element:-webkit-autofill:hover,${e("pn-counter")} .pn-counter-element:-webkit-autofill:focus,${e("pn-counter")} .pn-counter-element:-webkit-autofill:active{-webkit-box-shadow:0 0 0 10em #e0f8ff inset;-webkit-text-fill-color:#2d2013}${e("pn-counter")} .pn-counter-element{outline:0.2rem solid transparent;outline-offset:0.2rem}${e("pn-counter")} .pn-counter-element:focus-visible{outline-color:#005d92;background-color:#ffffff;border-color:#005d92}${e("pn-counter")} .pn-counter-element{transition-property:outline-color, background-color, border-color, color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-counter")} .pn-counter-element{transition-duration:0s;transition-delay:0s}}${e("pn-counter")} .pn-counter-element[data-compact]{text-align:left;padding-top:1.125em;padding-bottom:0.375em;max-width:unset}${e("pn-counter")} .pn-counter-element[data-compact]::placeholder{color:transparent}${e("pn-counter")} .pn-counter-element[data-compact]:focus+.pn-counter-label,${e("pn-counter")} .pn-counter-element[data-compact]:not(:placeholder-shown)+.pn-counter-label{transform:translateY(-85%) scale(0.75);transition-delay:0s}${e("pn-counter")} .pn-counter-element::placeholder{color:#5e554a;font-weight:normal}${e("pn-counter")} .pn-counter-element:hover{border-color:#005d92}${e("pn-counter")} .pn-counter-element:disabled{color:#5e554a;background-color:#f3f2f2;border-color:#f3f2f2}${e("pn-counter")} .pn-counter-element:read-only{border-color:#ffffff}${e("pn-counter")} .pn-counter-element:disabled{color:#5e554a;background-color:#f3f2f2;border-color:#f3f2f2}${e("pn-counter")} .pn-counter-element:out-of-range{border-color:#a70707}${e("pn-counter")} .pn-counter-element:out-of-range:hover{border-color:#500715}${e("pn-counter")} .pn-counter-element:out-of-range:focus-visible{background-color:#ffffff;border-color:#a70707;outline-color:#a70707}${e("pn-counter")} .pn-counter-element:out-of-range:-webkit-autofill,${e("pn-counter")} .pn-counter-element:out-of-range:-webkit-autofill:hover,${e("pn-counter")} .pn-counter-element:out-of-range:-webkit-autofill:focus,${e("pn-counter")} .pn-counter-element:out-of-range:-webkit-autofill:active{-webkit-box-shadow:0 0 0 10em #fef7f6 inset;-webkit-text-fill-color:#2d2013}${e("pn-counter")} .pn-counter-element::-webkit-inner-spin-button,${e("pn-counter")} .pn-counter-element::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}${e("pn-counter")} .pn-counter-items{display:inline-flex;flex-direction:row;gap:0.5em;transition-property:gap;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-counter")} .pn-counter-items{transition-duration:0s;transition-delay:0s}}${e("pn-counter")} .pn-counter-items[data-hidebuttons]{gap:0}${e("pn-counter")} .pn-counter-items[data-hidebuttons]>${e("pn-button")}{transform:scale(0) translateZ(0);width:0}${e("pn-counter")} .pn-counter-items>${e("pn-button")}{transform:scale(1) translateZ(0);transform-origin:center center;width:3em;will-change:width, transform;transition-property:transform, width;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-counter")} .pn-counter-items>${e("pn-button")}{transition-duration:0s;transition-delay:0s}}${e("pn-counter")} .pn-counter-helpertext{color:#5e554a;font-size:0.875em;font-weight:400;margin:0.25em 0 0 0;display:flex;flex-direction:column;gap:0.25em}${e("pn-counter")} .pn-counter-sr-only{position:absolute;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);margin:-1px;white-space:nowrap}`}},[772,"pn-counter",{label:[1],helpertext:[1],language:[1],value:[1538],name:[1],min:[2],max:[2],step:[2],list:[1],required:[4],readonly:[4],disabled:[4],compact:[4],labelDecrease:[1,"label-decrease"],labelIncrease:[1,"label-increase"],hideTooltips:[4,"hide-tooltips"],minMessage:[1,"min-message"],maxMessage:[1,"max-message"],pnId:[1,"pn-id"],pnAriaLabel:[1,"pn-aria-label"],pnAriaLabelledby:[1,"pn-aria-labelledby"],counterid:[1],clearAriaTimer:[32],displaySrValue:[32],showMinMaxMessage:[32],lastDispatchedValue:[32],interactType:[32]},void 0,{value:[{watchValue:0}],counterid:[{handleId:0}],pnId:[{handleId:1}]}]),m=h,f=function(){"undefined"!=typeof customElements&&["pn-counter","pn-button","pn-icon","pn-spinner"].forEach((t=>{switch(t){case"pn-counter":customElements.get(e(e(t)))||customElements.define(e(e(t)),h);break;case"pn-button":customElements.get(e(e(t)))||c();break;case"pn-icon":customElements.get(e(e(t)))||u();break;case"pn-spinner":customElements.get(e(e(t)))||p()}}))};export{m as PnCounter,f as defineCustomElement}
|