@postnord/pn-marketweb-components 1.0.49-beta4 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/{index-9027dc96.js → index-28bbc937.js} +1 -1
- package/cjs/{index-0a6b1eef.js → index-e3e27c79.js} +6 -0
- package/cjs/loader.cjs.js +2 -2
- package/cjs/pn-bonus-progressbar-level.cjs.entry.js +1 -1
- package/cjs/pn-bonus-progressbar.cjs.entry.js +1 -1
- package/cjs/pn-choice-button.cjs.entry.js +1 -1
- package/cjs/pn-filter-checkbox.cjs.entry.js +1 -1
- package/cjs/pn-find-price-result.cjs.entry.js +5 -5
- package/cjs/{pn-find-price-store-f9766c41.js → pn-find-price-store-6aab7fd0.js} +1 -2
- package/cjs/pn-find-price.cjs.entry.js +9 -12
- package/cjs/pn-find-service-and-price-result.cjs.entry.js +3 -3
- package/cjs/{pn-find-service-and-price-store-914d170b.js → pn-find-service-and-price-store-16a7936c.js} +1 -1
- package/cjs/pn-find-service-and-price.cjs.entry.js +3 -3
- package/cjs/pn-language-selector_9.cjs.entry.js +65 -5
- package/cjs/pn-mainnav-link.cjs.entry.js +3 -3
- package/cjs/{pn-mainnav-store-f8bacb50.js → pn-mainnav-store-61a75ea0.js} +1 -1
- package/cjs/pn-market-web-components.cjs.js +2 -2
- package/cjs/pn-marketweb-input.cjs.entry.js +76 -0
- package/cjs/pn-marketweb-search.cjs.entry.js +103 -0
- package/cjs/pn-marketweb-sitefooter.cjs.entry.js +1 -1
- package/cjs/pn-marketweb-siteheader.cjs.entry.js +6 -4
- package/cjs/pn-pex-pricefinder.cjs.entry.js +11 -3
- package/cjs/pn-product-card_3.cjs.entry.js +9 -9
- package/cjs/pn-product-pricelist-result.cjs.entry.js +3 -3
- package/cjs/{pn-product-pricelist-store-d101b50e.js → pn-product-pricelist-store-86310b5a.js} +1 -1
- package/cjs/pn-product-pricelist.cjs.entry.js +4 -4
- package/cjs/pn-product-tile_3.cjs.entry.js +1 -1
- package/cjs/pn-profile-selector-option.cjs.entry.js +1 -1
- package/cjs/pn-profile-selector.cjs.entry.js +1 -1
- package/cjs/pn-sidenav-level.cjs.entry.js +3 -3
- package/cjs/pn-sidenav-link.cjs.entry.js +3 -3
- package/cjs/{pn-sidenav-store-eed02285.js → pn-sidenav-store-d9bd9e00.js} +1 -1
- package/cjs/pn-sidenav.cjs.entry.js +3 -3
- package/cjs/pn-site-footer_2.cjs.entry.js +1 -1
- package/collection/collection-manifest.json +2 -1
- package/collection/components/input/pn-marketweb-input/marketweb-input.stories.js +51 -0
- package/collection/components/input/pn-marketweb-input/pn-marketweb-input.css +156 -0
- package/collection/components/input/pn-marketweb-input/pn-marketweb-input.js +412 -0
- package/collection/components/input/{pn-filter-search/search-field.stories.js → pn-marketweb-search/marketweb-search-field.stories.js} +15 -3
- package/collection/components/input/{pn-filter-search/pn-filter-search.css → pn-marketweb-search/pn-marketweb-search.css} +22 -17
- package/collection/components/input/{pn-filter-search/pn-filter-search.js → pn-marketweb-search/pn-marketweb-search.js} +67 -9
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-search-store.js +9 -0
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-search.js +79 -3
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.js +23 -3
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.stories.js +3 -3
- package/collection/components/widgets/pn-find-price/img/clouds.svg +5 -0
- package/collection/components/widgets/pn-find-price/pn-find-price-result.js +2 -2
- package/collection/components/widgets/pn-find-price/pn-find-price-store.js +0 -1
- package/collection/components/widgets/pn-find-price/pn-find-price-translations.js +1 -6
- package/collection/components/widgets/pn-find-price/pn-find-price.css +14 -4
- package/collection/components/widgets/pn-find-price/pn-find-price.js +4 -3
- package/collection/components/widgets/pn-pex-pricefinder/pn-pex-pricefinder.js +10 -2
- package/collection/components/widgets/pn-product-card/pn-product-card-info.css +6 -7
- package/collection/components/widgets/pn-product-card/pn-product-card-info.js +2 -3
- package/collection/components/widgets/pn-product-card/pn-product-card-price.css +22 -5
- package/collection/components/widgets/pn-product-card/pn-product-card-price.js +1 -1
- package/collection/components/widgets/pn-product-card/pn-product-card.css +88 -30
- package/collection/components/widgets/pn-product-card/pn-product-card.js +1 -1
- package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist.css +1 -0
- package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist.stories.js +1 -1
- package/custom-elements/index.d.ts +12 -6
- package/custom-elements/index.js +298 -126
- package/esm/{index-70b099b5.js → index-5397620b.js} +7 -1
- package/esm/{index-d3007e8f.js → index-7b21ecff.js} +1 -1
- package/esm/loader.js +2 -2
- package/esm/pn-bonus-progressbar-level.entry.js +1 -1
- package/esm/pn-bonus-progressbar.entry.js +1 -1
- package/esm/pn-choice-button.entry.js +1 -1
- package/esm/pn-filter-checkbox.entry.js +1 -1
- package/esm/pn-find-price-result.entry.js +5 -5
- package/esm/{pn-find-price-store-ddd3f427.js → pn-find-price-store-3301df0a.js} +1 -2
- package/esm/pn-find-price.entry.js +9 -12
- package/esm/pn-find-service-and-price-result.entry.js +3 -3
- package/esm/{pn-find-service-and-price-store-012f2e49.js → pn-find-service-and-price-store-65df46a0.js} +1 -1
- package/esm/pn-find-service-and-price.entry.js +3 -3
- package/esm/pn-language-selector_9.entry.js +79 -19
- package/esm/pn-mainnav-link.entry.js +3 -3
- package/esm/{pn-mainnav-store-395ee066.js → pn-mainnav-store-28571e54.js} +1 -1
- package/esm/pn-market-web-components.js +2 -2
- package/esm/pn-marketweb-input.entry.js +72 -0
- package/esm/pn-marketweb-search.entry.js +99 -0
- package/esm/pn-marketweb-sitefooter.entry.js +1 -1
- package/esm/pn-marketweb-siteheader.entry.js +6 -4
- package/esm/pn-pex-pricefinder.entry.js +11 -3
- package/esm/pn-product-card_3.entry.js +9 -9
- package/esm/pn-product-pricelist-result.entry.js +3 -3
- package/esm/{pn-product-pricelist-store-909c5238.js → pn-product-pricelist-store-2c336043.js} +1 -1
- package/esm/pn-product-pricelist.entry.js +4 -4
- package/esm/pn-product-tile_3.entry.js +1 -1
- package/esm/pn-profile-selector-option.entry.js +1 -1
- package/esm/pn-profile-selector.entry.js +1 -1
- package/esm/pn-sidenav-level.entry.js +3 -3
- package/esm/pn-sidenav-link.entry.js +3 -3
- package/esm/{pn-sidenav-store-f0db4a1f.js → pn-sidenav-store-50b186d6.js} +1 -1
- package/esm/pn-sidenav.entry.js +3 -3
- package/esm/pn-site-footer_2.entry.js +1 -1
- package/esm-es5/{index-70b099b5.js → index-5397620b.js} +1 -1
- package/esm-es5/{index-d3007e8f.js → index-7b21ecff.js} +1 -1
- package/esm-es5/loader.js +1 -1
- package/esm-es5/pn-bonus-progressbar-level.entry.js +1 -1
- package/esm-es5/pn-bonus-progressbar.entry.js +1 -1
- package/esm-es5/pn-choice-button.entry.js +1 -1
- package/esm-es5/pn-filter-checkbox.entry.js +1 -1
- package/esm-es5/pn-find-price-result.entry.js +1 -1
- package/esm-es5/pn-find-price-store-3301df0a.js +1 -0
- package/esm-es5/pn-find-price.entry.js +1 -1
- package/esm-es5/pn-find-service-and-price-result.entry.js +1 -1
- package/esm-es5/{pn-find-service-and-price-store-012f2e49.js → pn-find-service-and-price-store-65df46a0.js} +1 -1
- package/esm-es5/pn-find-service-and-price.entry.js +1 -1
- package/esm-es5/pn-language-selector_9.entry.js +1 -1
- package/esm-es5/pn-mainnav-link.entry.js +1 -1
- package/esm-es5/{pn-mainnav-store-395ee066.js → pn-mainnav-store-28571e54.js} +1 -1
- package/esm-es5/pn-market-web-components.js +1 -1
- package/esm-es5/pn-marketweb-input.entry.js +1 -0
- package/esm-es5/pn-marketweb-search.entry.js +1 -0
- package/esm-es5/pn-marketweb-sitefooter.entry.js +1 -1
- package/esm-es5/pn-marketweb-siteheader.entry.js +1 -1
- package/esm-es5/pn-pex-pricefinder.entry.js +1 -1
- package/esm-es5/pn-product-card_3.entry.js +1 -1
- package/esm-es5/pn-product-pricelist-result.entry.js +1 -1
- package/esm-es5/{pn-product-pricelist-store-909c5238.js → pn-product-pricelist-store-2c336043.js} +1 -1
- package/esm-es5/pn-product-pricelist.entry.js +1 -1
- package/esm-es5/pn-product-tile_3.entry.js +1 -1
- package/esm-es5/pn-profile-selector-option.entry.js +1 -1
- package/esm-es5/pn-profile-selector.entry.js +1 -1
- package/esm-es5/pn-sidenav-level.entry.js +1 -1
- package/esm-es5/pn-sidenav-link.entry.js +1 -1
- package/esm-es5/{pn-sidenav-store-f0db4a1f.js → pn-sidenav-store-50b186d6.js} +1 -1
- package/esm-es5/pn-sidenav.entry.js +1 -1
- package/esm-es5/pn-site-footer_2.entry.js +1 -1
- package/package.json +1 -1
- package/pn-market-web-components/{p-b49c9d34.system.entry.js → p-01fbbbbc.system.entry.js} +1 -1
- package/pn-market-web-components/{p-7ce21cb3.system.js → p-02ea55ad.system.js} +1 -1
- package/pn-market-web-components/{p-71a31b15.entry.js → p-045a349a.entry.js} +1 -1
- package/pn-market-web-components/p-07cc9f6b.system.entry.js +1 -0
- package/pn-market-web-components/{p-24df62a2.js → p-0cacf9fb.js} +1 -1
- package/pn-market-web-components/{p-d26967cb.entry.js → p-10b95894.entry.js} +1 -1
- package/pn-market-web-components/p-13eb4c66.system.entry.js +1 -0
- package/pn-market-web-components/{p-9aac6bd5.entry.js → p-15112837.entry.js} +1 -1
- package/pn-market-web-components/{p-69b751a8.system.entry.js → p-1ce871c5.system.entry.js} +1 -1
- package/pn-market-web-components/{p-d546d0c3.entry.js → p-227e1d46.entry.js} +1 -1
- package/pn-market-web-components/{p-39760c45.system.entry.js → p-2718b89a.system.entry.js} +1 -1
- package/pn-market-web-components/{p-702f06b7.system.entry.js → p-2870b0c5.system.entry.js} +1 -1
- package/pn-market-web-components/p-36654f2a.system.js +1 -0
- package/pn-market-web-components/p-3971ddb9.system.js +1 -0
- package/pn-market-web-components/{p-5d34bb8f.system.entry.js → p-401b57b1.system.entry.js} +1 -1
- package/pn-market-web-components/{p-7598c3ac.entry.js → p-40264b65.entry.js} +1 -1
- package/pn-market-web-components/{p-aea09ac6.entry.js → p-51df9292.entry.js} +1 -1
- package/pn-market-web-components/{p-a439468a.system.entry.js → p-57cc0679.system.entry.js} +1 -1
- package/pn-market-web-components/p-58e8d7d5.js +1 -0
- package/pn-market-web-components/{p-3ba257c5.entry.js → p-5c41acb2.entry.js} +1 -1
- package/pn-market-web-components/p-5d587499.js +1 -0
- package/pn-market-web-components/p-5e78891a.entry.js +1 -0
- package/pn-market-web-components/{p-42da096a.system.entry.js → p-625fb7fb.system.entry.js} +1 -1
- package/pn-market-web-components/p-67887512.system.js +1 -0
- package/pn-market-web-components/{p-544f8fb9.entry.js → p-715d1ef7.entry.js} +1 -1
- package/pn-market-web-components/p-72195bd8.entry.js +1 -0
- package/pn-market-web-components/{p-4d5aa13e.entry.js → p-774b7a9f.entry.js} +1 -1
- package/pn-market-web-components/{p-802afa1f.system.entry.js → p-7b93d570.system.entry.js} +1 -1
- package/pn-market-web-components/{p-56ba3951.entry.js → p-7d75ea68.entry.js} +1 -1
- package/pn-market-web-components/p-7e494e9d.system.entry.js +1 -0
- package/pn-market-web-components/p-80dce81e.system.entry.js +1 -0
- package/pn-market-web-components/{p-acd9d186.system.entry.js → p-8144bcbc.system.entry.js} +1 -1
- package/pn-market-web-components/{p-ac5a749b.entry.js → p-81d764a0.entry.js} +1 -1
- package/pn-market-web-components/p-825b8fb8.system.js +1 -0
- package/pn-market-web-components/{p-99e471b8.js → p-84699999.js} +1 -1
- package/pn-market-web-components/{p-ab699e09.entry.js → p-86b271f4.entry.js} +1 -1
- package/pn-market-web-components/p-86f06e26.js +1 -0
- package/pn-market-web-components/{p-38e0dc75.system.entry.js → p-885bc8d7.system.entry.js} +1 -1
- package/pn-market-web-components/p-8fc7732d.system.entry.js +1 -0
- package/pn-market-web-components/p-996d8a6a.entry.js +1 -0
- package/pn-market-web-components/p-9e8c5793.system.entry.js +1 -0
- package/pn-market-web-components/p-9edaf6b6.system.entry.js +1 -0
- package/pn-market-web-components/p-a5bc1695.system.js +1 -0
- package/pn-market-web-components/{p-b4f843da.system.js → p-a5f75560.system.js} +1 -1
- package/pn-market-web-components/{p-8897e421.entry.js → p-adc639c8.entry.js} +1 -1
- package/pn-market-web-components/{p-6fea1ae6.system.js → p-add7d76c.system.js} +1 -1
- package/pn-market-web-components/{p-9ae8e043.js → p-ae2bd55f.js} +1 -1
- package/pn-market-web-components/{p-2c361d9e.system.entry.js → p-aeb26d10.system.entry.js} +1 -1
- package/pn-market-web-components/{p-3552ae09.entry.js → p-b4f0228c.entry.js} +1 -1
- package/pn-market-web-components/p-bb626ab4.js +1 -0
- package/pn-market-web-components/p-c0c52dc6.entry.js +1 -0
- package/pn-market-web-components/{p-8325d608.entry.js → p-c240b614.entry.js} +1 -1
- package/pn-market-web-components/p-c34db063.entry.js +1 -0
- package/pn-market-web-components/{p-da2fa398.system.entry.js → p-c418bb48.system.entry.js} +1 -1
- package/pn-market-web-components/{p-3f8b459a.system.entry.js → p-d46d9b6e.system.entry.js} +1 -1
- package/pn-market-web-components/{p-0b796318.system.entry.js → p-d7776336.system.entry.js} +1 -1
- package/pn-market-web-components/{p-7fca7510.entry.js → p-e056d2c6.entry.js} +1 -1
- package/pn-market-web-components/p-e474b831.entry.js +1 -0
- package/pn-market-web-components/p-e5fffc92.entry.js +1 -0
- package/pn-market-web-components/p-e9fe5c54.entry.js +1 -0
- package/pn-market-web-components/p-f4cb2104.system.entry.js +1 -0
- package/pn-market-web-components/{p-00d6033e.entry.js → p-f774e2cc.entry.js} +1 -1
- package/pn-market-web-components/{p-4f0f8e9f.system.entry.js → p-f7b013a7.system.entry.js} +1 -1
- package/pn-market-web-components/{p-2b120338.system.entry.js → p-fc1083d2.system.entry.js} +1 -1
- package/pn-market-web-components/p-fc6a09e0.system.entry.js +1 -0
- package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
- package/pn-market-web-components/pn-market-web-components.js +1 -1
- package/types/components/input/pn-marketweb-input/pn-marketweb-input.d.ts +32 -0
- package/types/components/input/{pn-filter-search/pn-filter-search.d.ts → pn-marketweb-search/pn-marketweb-search.d.ts} +9 -1
- package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-search-store.d.ts +11 -0
- package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-search.d.ts +6 -0
- package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-types.d.ts +1 -0
- package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.d.ts +2 -0
- package/types/components/widgets/pn-find-price/pn-find-price-store.d.ts +0 -2
- package/types/components/widgets/pn-find-price/pn-find-price-translations.d.ts +0 -5
- package/types/components/widgets/pn-find-price/pn-find-price-types.d.ts +0 -1
- package/types/components/widgets/pn-pex-pricefinder/pn-pex-pricefinder.d.ts +1 -0
- package/types/components.d.ts +156 -65
- package/cjs/pn-filter-search.cjs.entry.js +0 -69
- package/esm/pn-filter-search.entry.js +0 -65
- package/esm-es5/pn-filter-search.entry.js +0 -1
- package/esm-es5/pn-find-price-store-ddd3f427.js +0 -1
- package/pn-market-web-components/p-15836764.js +0 -1
- package/pn-market-web-components/p-1ccd3831.entry.js +0 -1
- package/pn-market-web-components/p-208a0a7b.entry.js +0 -1
- package/pn-market-web-components/p-28316927.js +0 -1
- package/pn-market-web-components/p-39ecfda9.system.entry.js +0 -1
- package/pn-market-web-components/p-39ff2013.system.entry.js +0 -1
- package/pn-market-web-components/p-4c9b1ae9.system.js +0 -1
- package/pn-market-web-components/p-4f8537fb.system.js +0 -1
- package/pn-market-web-components/p-58623439.entry.js +0 -1
- package/pn-market-web-components/p-66fb0f57.entry.js +0 -1
- package/pn-market-web-components/p-6df0b06e.entry.js +0 -1
- package/pn-market-web-components/p-731efb7b.system.entry.js +0 -1
- package/pn-market-web-components/p-7a7f380b.system.js +0 -1
- package/pn-market-web-components/p-87a4810e.system.entry.js +0 -1
- package/pn-market-web-components/p-ad5b20ce.js +0 -1
- package/pn-market-web-components/p-b4a0e5fd.system.entry.js +0 -1
- package/pn-market-web-components/p-b4b6ab95.system.js +0 -1
- package/pn-market-web-components/p-cf516409.js +0 -1
- package/pn-market-web-components/p-cfa3be4a.entry.js +0 -1
- package/pn-market-web-components/p-dc48d8f8.system.entry.js +0 -1
- package/pn-market-web-components/p-e732c60a.system.entry.js +0 -1
- package/pn-market-web-components/p-fbdc9ea5.system.entry.js +0 -1
- package/pn-market-web-components/p-fdad9fb6.entry.js +0 -1
- package/pn-market-web-components/p-ff678bef.system.js +0 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { Component, Prop, h, Host, Event, Element, Listen } from "@stencil/core";
|
|
2
|
-
export class
|
|
1
|
+
import { Component, Prop, h, Host, Event, Element, Listen, State } from "@stencil/core";
|
|
2
|
+
export class PnMarketwebSearch {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.disabled = false;
|
|
5
5
|
this.placeholder = null;
|
|
6
6
|
this.inputid = null;
|
|
7
7
|
this.name = null;
|
|
8
8
|
this.autocomplete = null;
|
|
9
|
+
this.list = null;
|
|
9
10
|
this.value = null;
|
|
10
11
|
/** Label for the button */
|
|
11
12
|
this.label = null;
|
|
@@ -15,6 +16,9 @@ export class PnFilterSearch {
|
|
|
15
16
|
this.button = '';
|
|
16
17
|
/** Light instead of dark search button */
|
|
17
18
|
this.light = false;
|
|
19
|
+
this.suggestionObserver = null;
|
|
20
|
+
this.hasClonedInput = false;
|
|
21
|
+
this.listSuggestion = [];
|
|
18
22
|
}
|
|
19
23
|
inputHandler() {
|
|
20
24
|
this.update.emit(this.value);
|
|
@@ -46,10 +50,37 @@ export class PnFilterSearch {
|
|
|
46
50
|
classNames += `button-${this.button} `;
|
|
47
51
|
return classNames;
|
|
48
52
|
}
|
|
53
|
+
componentWillRender() {
|
|
54
|
+
this.cloneListContent();
|
|
55
|
+
this.autocompleteEventBinding();
|
|
56
|
+
}
|
|
57
|
+
onSuggestionUpdate() {
|
|
58
|
+
this.cloneListContent();
|
|
59
|
+
}
|
|
60
|
+
autocompleteEventBinding() {
|
|
61
|
+
if (this.suggestionObserver !== null || !this.list || (!this.hostElement) || !document.getElementById(this.list)) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const targetNode = document.getElementById(this.list);
|
|
65
|
+
this.suggestionObserver = new MutationObserver(this.onSuggestionUpdate.bind(this));
|
|
66
|
+
this.suggestionObserver.observe(targetNode, { attributes: true, childList: true, subtree: true });
|
|
67
|
+
}
|
|
68
|
+
cloneListContent() {
|
|
69
|
+
if (!this.list || (!this.hostElement) || !document.getElementById(this.list)) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const options = [...document.getElementById(this.list).querySelectorAll('option')];
|
|
73
|
+
this.listSuggestion = options.map((item) => {
|
|
74
|
+
if (item.hasAttribute('value')) {
|
|
75
|
+
return item.getAttribute('value');
|
|
76
|
+
}
|
|
77
|
+
return item.innerText;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
49
80
|
render() {
|
|
50
|
-
return (h(Host,
|
|
51
|
-
h("div", { class:
|
|
52
|
-
h("input", { type: "search", value: this.value, id: this.inputid, name: this.name, placeholder: this.placeholder, disabled: this.disabled, autocomplete: this.autocomplete, onKeyDown: (e) => this.emitSearch(e), onInput: (e) => this.setVal(e) }),
|
|
81
|
+
return (h(Host, null,
|
|
82
|
+
h("div", { class: `input-container ${this.getClassNames()}`, "data-haslist": (this.list !== null) + '' },
|
|
83
|
+
h("input", { type: "search", value: this.value, id: this.inputid, name: this.name, placeholder: this.placeholder, disabled: this.disabled, autocomplete: this.autocomplete, list: this.list, onKeyDown: (e) => this.emitSearch(e), onInput: (e) => this.setVal(e) }),
|
|
53
84
|
h("div", { class: "button-container" },
|
|
54
85
|
(this.button === 'none' || this.button === 'icon-inline') &&
|
|
55
86
|
h("button", { class: "search", tabindex: this.button === 'icon-inline' ? '0' : '-1', onClick: (e) => this.emitSearch(e), "aria-label": "search", title: "search" },
|
|
@@ -59,15 +90,19 @@ export class PnFilterSearch {
|
|
|
59
90
|
h("pn-icon", { symbol: "close-small", color: "blue700" })),
|
|
60
91
|
this.button === 'none' || this.button === 'icon-inline' && h("pn-spinner", null))),
|
|
61
92
|
(this.button !== 'none' && this.button !== 'icon-inline') &&
|
|
62
|
-
h("pn-button", { onClick: (e) => this.emitSearch(e), loading: this.loading, icon: "search", appearance: this.light ? 'light' : 'dark', "icon-only": this.button === 'icon' }, this.label)
|
|
93
|
+
h("pn-button", { onClick: (e) => this.emitSearch(e), loading: this.loading, icon: "search", appearance: this.light ? 'light' : 'dark', "icon-only": this.button === 'icon' }, this.label),
|
|
94
|
+
(this.list) &&
|
|
95
|
+
h("datalist", { id: this.list }, this.listSuggestion.map((item) => {
|
|
96
|
+
return (h("option", null, item));
|
|
97
|
+
}))));
|
|
63
98
|
}
|
|
64
|
-
static get is() { return "pn-
|
|
99
|
+
static get is() { return "pn-marketweb-search"; }
|
|
65
100
|
static get encapsulation() { return "shadow"; }
|
|
66
101
|
static get originalStyleUrls() { return {
|
|
67
|
-
"$": ["pn-
|
|
102
|
+
"$": ["pn-marketweb-search.scss"]
|
|
68
103
|
}; }
|
|
69
104
|
static get styleUrls() { return {
|
|
70
|
-
"$": ["pn-
|
|
105
|
+
"$": ["pn-marketweb-search.css"]
|
|
71
106
|
}; }
|
|
72
107
|
static get properties() { return {
|
|
73
108
|
"disabled": {
|
|
@@ -160,6 +195,24 @@ export class PnFilterSearch {
|
|
|
160
195
|
"reflect": false,
|
|
161
196
|
"defaultValue": "null"
|
|
162
197
|
},
|
|
198
|
+
"list": {
|
|
199
|
+
"type": "string",
|
|
200
|
+
"mutable": false,
|
|
201
|
+
"complexType": {
|
|
202
|
+
"original": "string",
|
|
203
|
+
"resolved": "string",
|
|
204
|
+
"references": {}
|
|
205
|
+
},
|
|
206
|
+
"required": false,
|
|
207
|
+
"optional": false,
|
|
208
|
+
"docs": {
|
|
209
|
+
"tags": [],
|
|
210
|
+
"text": ""
|
|
211
|
+
},
|
|
212
|
+
"attribute": "list",
|
|
213
|
+
"reflect": false,
|
|
214
|
+
"defaultValue": "null"
|
|
215
|
+
},
|
|
163
216
|
"value": {
|
|
164
217
|
"type": "string",
|
|
165
218
|
"mutable": false,
|
|
@@ -251,6 +304,11 @@ export class PnFilterSearch {
|
|
|
251
304
|
"defaultValue": "false"
|
|
252
305
|
}
|
|
253
306
|
}; }
|
|
307
|
+
static get states() { return {
|
|
308
|
+
"suggestionObserver": {},
|
|
309
|
+
"hasClonedInput": {},
|
|
310
|
+
"listSuggestion": {}
|
|
311
|
+
}; }
|
|
254
312
|
static get events() { return [{
|
|
255
313
|
"method": "search",
|
|
256
314
|
"name": "search",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createStore } from "@stencil/store";
|
|
2
|
+
// Read more about how stencil stores work here: https://stenciljs.com/docs/stencil-store
|
|
3
|
+
const { state, onChange } = createStore({
|
|
4
|
+
searchValue: '',
|
|
5
|
+
autocompleteSuggestions: {},
|
|
6
|
+
requestAbortController: new AbortController()
|
|
7
|
+
});
|
|
8
|
+
export { state, onChange };
|
|
9
|
+
export default state;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Component, Prop, h, Element } from "@stencil/core";
|
|
1
|
+
import { Component, Prop, h, Element, State } from "@stencil/core";
|
|
2
|
+
import { state, onChange } from "./pn-marketweb-siteheader-search-store";
|
|
2
3
|
export class PnMarketwebSiteheaderSearch {
|
|
3
4
|
constructor() {
|
|
4
5
|
// Display option, show only link
|
|
@@ -7,22 +8,76 @@ export class PnMarketwebSiteheaderSearch {
|
|
|
7
8
|
this.hideSearch = false;
|
|
8
9
|
// Search data
|
|
9
10
|
this.search = {};
|
|
11
|
+
// Is this the primary instance?
|
|
12
|
+
this.primary = false;
|
|
13
|
+
// Autocomplete options
|
|
14
|
+
this.autoCompleteOptions = [];
|
|
15
|
+
}
|
|
16
|
+
onSearchValueUpdate() {
|
|
17
|
+
this.getAutocomplete(state.searchValue);
|
|
18
|
+
}
|
|
19
|
+
async getAutocomplete(prefix) {
|
|
20
|
+
if (!this.search.AutocompleteEndpoint || (prefix.length < 2)) {
|
|
21
|
+
this.autoCompleteOptions = [];
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (state.autocompleteSuggestions[prefix]) {
|
|
25
|
+
this.setAutocompleteSuggestions(state.autocompleteSuggestions[prefix]);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const req = await fetch(`${this.search.AutocompleteEndpoint}?prefix=${prefix}&size=10`, { signal: state.requestAbortController.signal }).catch((e) => {
|
|
29
|
+
console.log('Unable to fetch autocomplete suggestions', e);
|
|
30
|
+
});
|
|
31
|
+
if (!req) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const data = await req.json();
|
|
35
|
+
if (!data || !data.hits || !data.hits.length) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const suggestions = data.hits.map((item) => {
|
|
39
|
+
return item.query;
|
|
40
|
+
});
|
|
41
|
+
// Store query in store
|
|
42
|
+
state.autocompleteSuggestions[prefix] = suggestions;
|
|
43
|
+
this.setAutocompleteSuggestions(suggestions);
|
|
44
|
+
}
|
|
45
|
+
setAutocompleteSuggestions(suggestions) {
|
|
46
|
+
if (typeof suggestions !== "object" || typeof suggestions.length !== "number" || suggestions.length === 0) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
this.autoCompleteOptions = suggestions;
|
|
10
50
|
}
|
|
11
51
|
componentWillLoad() {
|
|
52
|
+
onChange("searchValue", () => {
|
|
53
|
+
this.onSearchValueUpdate();
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
componentDidRender() {
|
|
57
|
+
const inputSearchElm = this.hostElement.querySelector('pn-search-field input:not([list])');
|
|
58
|
+
if (inputSearchElm && this.search.AutocompleteEndpoint) {
|
|
59
|
+
inputSearchElm.setAttribute("list", "siteheader-search-autocomplete");
|
|
60
|
+
}
|
|
12
61
|
}
|
|
13
62
|
render() {
|
|
14
63
|
if (!this.search.formActionUrl || this.hideSearch) {
|
|
15
64
|
return;
|
|
16
65
|
}
|
|
66
|
+
const autocompleteAttribute = (this.search.AutocompleteEndpoint) ? { "list": "siteheader-search-autocomplete" } : {};
|
|
17
67
|
return (h("div", { class: "siteheader-search" }, (this.showOnlyLink) ? (h("a", { href: this.search.formActionUrl, title: this.i18n.searchlabel },
|
|
18
68
|
h("pn-button", { appearance: "light", icon: "search" }))) :
|
|
19
69
|
(h("form", { method: "get", action: this.search.formActionUrl, role: "search" },
|
|
20
|
-
h("pn-search-field", { label: this.i18n.searchlabel, name: "q", button: "icon",
|
|
70
|
+
h("pn-search-field", Object.assign({ label: this.i18n.searchlabel, name: "q", button: "icon" }, autocompleteAttribute, { onUpdate: (e) => {
|
|
71
|
+
state.searchValue = e.detail;
|
|
72
|
+
}, onSearch: () => {
|
|
21
73
|
const form = this.hostElement.querySelector('form');
|
|
22
74
|
if (form) {
|
|
23
75
|
form.submit();
|
|
24
76
|
}
|
|
25
|
-
}, placeholder: this.i18n.searchplaceholder }))
|
|
77
|
+
}, placeholder: this.i18n.searchplaceholder })),
|
|
78
|
+
this.primary && this.search.AutocompleteEndpoint ? (h("datalist", { id: "siteheader-search-autocomplete" }, this.autoCompleteOptions.map((item) => {
|
|
79
|
+
return (h("option", null, item));
|
|
80
|
+
}))) : null))));
|
|
26
81
|
}
|
|
27
82
|
static get is() { return "pn-marketweb-siteheader-search"; }
|
|
28
83
|
static get originalStyleUrls() { return {
|
|
@@ -105,7 +160,28 @@ export class PnMarketwebSiteheaderSearch {
|
|
|
105
160
|
"text": ""
|
|
106
161
|
},
|
|
107
162
|
"defaultValue": "{}"
|
|
163
|
+
},
|
|
164
|
+
"primary": {
|
|
165
|
+
"type": "boolean",
|
|
166
|
+
"mutable": false,
|
|
167
|
+
"complexType": {
|
|
168
|
+
"original": "boolean",
|
|
169
|
+
"resolved": "boolean",
|
|
170
|
+
"references": {}
|
|
171
|
+
},
|
|
172
|
+
"required": false,
|
|
173
|
+
"optional": false,
|
|
174
|
+
"docs": {
|
|
175
|
+
"tags": [],
|
|
176
|
+
"text": ""
|
|
177
|
+
},
|
|
178
|
+
"attribute": "primary",
|
|
179
|
+
"reflect": false,
|
|
180
|
+
"defaultValue": "false"
|
|
108
181
|
}
|
|
109
182
|
}; }
|
|
183
|
+
static get states() { return {
|
|
184
|
+
"autoCompleteOptions": {}
|
|
185
|
+
}; }
|
|
110
186
|
static get elementRef() { return "hostElement"; }
|
|
111
187
|
}
|
package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.js
CHANGED
|
@@ -26,6 +26,8 @@ export class PnMarketwebSiteheader {
|
|
|
26
26
|
this.hideSearch = false;
|
|
27
27
|
/** Hides the login if set to true*/
|
|
28
28
|
this.hideLogin = false;
|
|
29
|
+
/** Autocomplete endpoint */
|
|
30
|
+
this.AutocompleteEndpoint = "";
|
|
29
31
|
/** Forward session to backend */
|
|
30
32
|
this.sessionForward = false;
|
|
31
33
|
/** If the component should use cached requests */
|
|
@@ -38,7 +40,7 @@ export class PnMarketwebSiteheader {
|
|
|
38
40
|
// Menu state
|
|
39
41
|
this.menuItems = [];
|
|
40
42
|
// Search
|
|
41
|
-
this.search = {};
|
|
43
|
+
this.search = { AutocompleteEndpoint: this.AutocompleteEndpoint };
|
|
42
44
|
// Site selector
|
|
43
45
|
this.siteSelector = null;
|
|
44
46
|
// Language Selector
|
|
@@ -152,7 +154,7 @@ export class PnMarketwebSiteheader {
|
|
|
152
154
|
});
|
|
153
155
|
}
|
|
154
156
|
// Set search
|
|
155
|
-
this.search = data.search;
|
|
157
|
+
this.search = Object.assign(Object.assign({}, data.search), { AutocompleteEndpoint: this.AutocompleteEndpoint });
|
|
156
158
|
// Set site selector
|
|
157
159
|
this.siteSelector = data.siteSelectorViewModel;
|
|
158
160
|
// Set language selector
|
|
@@ -293,7 +295,7 @@ export class PnMarketwebSiteheader {
|
|
|
293
295
|
(this.gotData && ((_f = this.siteSelector) === null || _f === void 0 ? void 0 : _f.siteSelections)) && this.siteSelector.siteSelections.map((site) => h("pn-site-selector-item", { heading: site.linkText, description: site.linkDescription, url: site.pageLink, newwindow: site.openInNewWindow })))),
|
|
294
296
|
h("div", { slot: "top", class: "siteheader-menu-top" },
|
|
295
297
|
h("pn-marketweb-siteheader-search", { search: this.search, "hide-search": this.hideSearch, i18n: this.i18n })))))),
|
|
296
|
-
h("pn-marketweb-siteheader-search", { search: this.search, "hide-search": this.hideSearch, "show-only-link": this.minimizeSearch, i18n: this.i18n })))));
|
|
298
|
+
h("pn-marketweb-siteheader-search", { primary: true, search: this.search, "hide-search": this.hideSearch, "show-only-link": this.minimizeSearch, i18n: this.i18n })))));
|
|
297
299
|
}
|
|
298
300
|
static get is() { return "pn-marketweb-siteheader"; }
|
|
299
301
|
static get originalStyleUrls() { return {
|
|
@@ -465,6 +467,24 @@ export class PnMarketwebSiteheader {
|
|
|
465
467
|
"reflect": true,
|
|
466
468
|
"defaultValue": "false"
|
|
467
469
|
},
|
|
470
|
+
"AutocompleteEndpoint": {
|
|
471
|
+
"type": "string",
|
|
472
|
+
"mutable": false,
|
|
473
|
+
"complexType": {
|
|
474
|
+
"original": "string",
|
|
475
|
+
"resolved": "string",
|
|
476
|
+
"references": {}
|
|
477
|
+
},
|
|
478
|
+
"required": false,
|
|
479
|
+
"optional": false,
|
|
480
|
+
"docs": {
|
|
481
|
+
"tags": [],
|
|
482
|
+
"text": "Autocomplete endpoint"
|
|
483
|
+
},
|
|
484
|
+
"attribute": "autocomplete-endpoint",
|
|
485
|
+
"reflect": false,
|
|
486
|
+
"defaultValue": "\"\""
|
|
487
|
+
},
|
|
468
488
|
"sessionForward": {
|
|
469
489
|
"type": "boolean",
|
|
470
490
|
"mutable": false,
|
|
@@ -68,12 +68,12 @@ Content that is higher than 100% viewport height
|
|
|
68
68
|
-->
|
|
69
69
|
`;
|
|
70
70
|
};
|
|
71
|
-
|
|
71
|
+
// autocomplete-endpoint="http://localhost:51444/find_v2/_autocomplete"
|
|
72
72
|
export const Primary = PrimaryTemplate.bind({});
|
|
73
73
|
Primary.args = {
|
|
74
|
-
market : "
|
|
74
|
+
market : "se",
|
|
75
75
|
language: 'sv',
|
|
76
|
-
endpoint: '
|
|
76
|
+
endpoint: 'http://localhost:51444'
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="278" height="55" viewBox="0 0 278 55" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M247.355 49.6815C247.694 52.479 249.722 54.6261 252.181 54.6261H272.926C275.62 54.6261 277.798 52.0522 277.798 48.8686V48.8008C277.798 45.6173 275.62 43.0433 272.926 43.0433H270.537C269.608 39.2439 266.846 36.473 263.585 36.473H259.717C259.373 31.841 256.101 28.2092 252.124 28.2092C248.146 28.2092 244.88 31.841 244.53 36.473H242.095C238.083 36.473 234.816 40.6726 234.816 45.8205V49.6815H247.355Z" fill="#E0F8FF"/>
|
|
3
|
+
<path d="M12.0391 46.1022C12.3176 48.5569 14.0867 50.4373 16.2421 50.4373H34.5807C36.9304 50.4373 38.8216 48.202 38.8216 45.4248V45.3571C38.8216 42.5799 36.9304 40.3446 34.5807 40.3446H32.4684C31.6678 37.0209 29.227 34.5872 26.3283 34.5872H22.9179C22.6004 30.5597 19.7327 27.4071 16.2421 27.4071C12.7514 27.4071 9.88371 30.5597 9.56622 34.5872H7.41658C3.86346 34.5872 0.998047 38.2448 0.998047 42.7154V46.1022H12.0391Z" fill="#E0F8FF"/>
|
|
4
|
+
<path d="M131.056 26.5864C131.449 30.0423 133.948 32.6895 136.991 32.6895H162.891C166.209 32.6895 168.88 29.5426 168.88 25.6328V25.5375C168.88 21.6277 166.209 18.4808 162.891 18.4808H159.907C158.777 13.8015 155.33 10.3753 151.236 10.3753H146.42C145.971 4.70533 141.921 0.26709 136.991 0.26709C132.062 0.26709 128.012 4.70533 127.563 10.3753H124.528C119.51 10.3753 115.463 15.5247 115.463 21.8184V26.5864H131.056Z" fill="#E0F8FF"/>
|
|
5
|
+
</svg>
|
|
@@ -30,7 +30,7 @@ export class PnfindPriceResult {
|
|
|
30
30
|
" "),
|
|
31
31
|
(this.item.highestrankusp) ?
|
|
32
32
|
(this.item.highestrankusp === "Billigast") ?
|
|
33
|
-
(h("span", { slot: "
|
|
33
|
+
(h("span", { slot: "Billigast" },
|
|
34
34
|
this.item.highestrankusp,
|
|
35
35
|
h("pn-icon", { symbol: "box-label", small: "false", color: "green700" })))
|
|
36
36
|
: (h("span", { slot: "Snabbast" },
|
|
@@ -50,7 +50,7 @@ export class PnfindPriceResult {
|
|
|
50
50
|
h("div", { slot: "cardprice" },
|
|
51
51
|
this.item.priceagent ? (h("pn-product-card-price", { slot: "price", label: "", amount: this.item.priceagent + '', currency: state.market.currency, url: "https://shop.postnord.se/ebutik/default.aspx", service: this.item.name + "-eshop" })) : null,
|
|
52
52
|
this.item.pricesenddirect ? (h("pn-product-card-price", { slot: "sendDirectPrice", label: state.i18n.senddirectcta, amount: this.item.pricesenddirect + '', currency: state.market.currency, url: "https://portal.postnord.com/skickadirekt/", service: this.item.name + "-portal" })) : null,
|
|
53
|
-
this.item.pricestamps ? (h("pn-product-card-price", { slot: "stampPrice", label: state.i18n.stampshopcta, amount: this.item.pricestamps + '', currency: state.market.currency, url: "https://shop.postnord.se/ebutik/default.aspx", service: this.item.name + "-eshop"
|
|
53
|
+
this.item.pricestamps ? (h("pn-product-card-price", { slot: "stampPrice", label: state.i18n.stampshopcta, amount: this.item.pricestamps + '', currency: state.market.currency, url: "https://shop.postnord.se/ebutik/default.aspx", service: this.item.name + "-eshop" })) : null))));
|
|
54
54
|
}
|
|
55
55
|
static get is() { return "pn-find-price-result"; }
|
|
56
56
|
static get originalStyleUrls() { return {
|
|
@@ -2,7 +2,6 @@ export const translations = {
|
|
|
2
2
|
'sv': {
|
|
3
3
|
'componentheading': 'Våra priser och villkor för inrikesförsändelser för dig som direktbetalande kund?',
|
|
4
4
|
'deliveryscopeheading': 'Endast leveranser inom Sverige',
|
|
5
|
-
'sizeheading': 'Uppskatta storlek och vikt på din försändelse',
|
|
6
5
|
'resultlistheading': 'Några bra alternativ för dig',
|
|
7
6
|
'weightlabel': 'Vikt',
|
|
8
7
|
'maxweightlabel': 'Maxvikt',
|
|
@@ -11,12 +10,11 @@ export const translations = {
|
|
|
11
10
|
'stampshopcta': 'Beställ fysiska frimärken',
|
|
12
11
|
'message': '*Vid köp hos valfritt ombud',
|
|
13
12
|
'servicePointHeader': 'Eller hitta närmaste serviceställe',
|
|
14
|
-
'servicePointLink': 'Sök
|
|
13
|
+
'servicePointLink': 'Sök serviceställe eller brevlåda'
|
|
15
14
|
},
|
|
16
15
|
'en': {
|
|
17
16
|
'componentheading': 'Our prices and terms and conditions for domestic shipments for you as a direct paying customer',
|
|
18
17
|
'deliveryscopeheading': 'Deliveries within Sweden only',
|
|
19
|
-
'sizeheading': 'Estimate the size and weight of your shipment',
|
|
20
18
|
'resultlistheading': 'Some suitable options for you',
|
|
21
19
|
'weightlabel': 'Weight',
|
|
22
20
|
'maxweightlabel': 'Max weight',
|
|
@@ -30,7 +28,6 @@ export const translations = {
|
|
|
30
28
|
'da': {
|
|
31
29
|
'componentheading': 'Vad vill du skicka?',
|
|
32
30
|
'deliveryscopeheading': 'Kun leveringer indenfor Sverige',
|
|
33
|
-
'sizeheading': 'How much does it weigh?',
|
|
34
31
|
'resultlistheading': 'Some suitable options for you',
|
|
35
32
|
'weightlabel': 'Vægt',
|
|
36
33
|
'maxweightlabel': 'Max vægt',
|
|
@@ -41,7 +38,6 @@ export const translations = {
|
|
|
41
38
|
'no': {
|
|
42
39
|
'componentheading': 'Vad vill du skicka?',
|
|
43
40
|
'deliveryscopeheading': 'Kun leveranser innen Sverige',
|
|
44
|
-
'sizeheading': 'How much does it weigh?',
|
|
45
41
|
'resultlistheading': 'Some suitable options for you',
|
|
46
42
|
'weightlabel': 'Vekt',
|
|
47
43
|
'maxweightlabel': 'Maks vekt',
|
|
@@ -52,7 +48,6 @@ export const translations = {
|
|
|
52
48
|
'fi': {
|
|
53
49
|
'componentheading': 'Vad vill du skicka?',
|
|
54
50
|
'deliveryscopeheading': 'Toimitukset vain Ruotsin sisällä',
|
|
55
|
-
'sizeheading': 'How much does it weigh?',
|
|
56
51
|
'resultlistheading': 'Some suitable options for you',
|
|
57
52
|
'weightlabel': 'Paino',
|
|
58
53
|
'maxweightlabel': 'Max paino',
|
|
@@ -18,19 +18,19 @@ pn-find-price .findprice-form {
|
|
|
18
18
|
margin: 0 auto 3em auto;
|
|
19
19
|
}
|
|
20
20
|
pn-find-price h2,
|
|
21
|
-
pn-find-price .heading
|
|
21
|
+
pn-find-price .heading {
|
|
22
22
|
text-align: center;
|
|
23
23
|
font-size: 1.5em;
|
|
24
24
|
line-height: 1.1;
|
|
25
25
|
font-weight: bold;
|
|
26
26
|
margin-bottom: 1rem;
|
|
27
27
|
}
|
|
28
|
-
pn-find-price .
|
|
28
|
+
pn-find-price .resultHeading {
|
|
29
29
|
text-align: center;
|
|
30
|
-
font-size: 1.
|
|
30
|
+
font-size: 1.5em;
|
|
31
31
|
line-height: 1.1;
|
|
32
32
|
font-weight: bold;
|
|
33
|
-
margin-bottom:
|
|
33
|
+
margin-bottom: 2em;
|
|
34
34
|
}
|
|
35
35
|
pn-find-price .sizecategory {
|
|
36
36
|
margin-top: 5em;
|
|
@@ -40,6 +40,11 @@ pn-find-price .sizecategory {
|
|
|
40
40
|
align-items: center;
|
|
41
41
|
justify-content: center;
|
|
42
42
|
}
|
|
43
|
+
pn-find-price .sizecategory #clouds {
|
|
44
|
+
position: absolute;
|
|
45
|
+
top: 4.87em;
|
|
46
|
+
left: 26.3em;
|
|
47
|
+
}
|
|
43
48
|
pn-find-price .weightoption {
|
|
44
49
|
font-size: 0.9em;
|
|
45
50
|
max-width: 41rem;
|
|
@@ -80,4 +85,9 @@ pn-find-price .servicePoint h3 {
|
|
|
80
85
|
}
|
|
81
86
|
pn-find-price .servicePoint a {
|
|
82
87
|
color: #005D92;
|
|
88
|
+
text-decoration: none;
|
|
89
|
+
}
|
|
90
|
+
pn-find-price .servicePoint a:hover {
|
|
91
|
+
color: #0D234B;
|
|
92
|
+
text-decoration: underline;
|
|
83
93
|
}
|
|
@@ -7,6 +7,7 @@ import small from "./img/small-package.svg";
|
|
|
7
7
|
import medium from "./img/medium-package.svg";
|
|
8
8
|
import large from "./img/large-package.svg";
|
|
9
9
|
import person from "./img/postnord-person1.svg";
|
|
10
|
+
import clouds from "./img/clouds.svg";
|
|
10
11
|
export class PnfindPrice {
|
|
11
12
|
constructor() {
|
|
12
13
|
this.source = fileLocation;
|
|
@@ -84,8 +85,8 @@ export class PnfindPrice {
|
|
|
84
85
|
render() {
|
|
85
86
|
return (h("div", { class: "findprice-form" },
|
|
86
87
|
h("div", null,
|
|
87
|
-
(h("div", { class: "sizeheading" }, state.i18n.sizeheading)),
|
|
88
88
|
h("div", { class: "sizecategory" },
|
|
89
|
+
h("img", { id: "clouds", src: clouds }),
|
|
89
90
|
h("table", { class: "sizeTable" },
|
|
90
91
|
h("tr", null,
|
|
91
92
|
h("td", null,
|
|
@@ -116,8 +117,8 @@ export class PnfindPrice {
|
|
|
116
117
|
h("pn-illustration", { illustration: "character-box-letters-house" }),
|
|
117
118
|
h("h3", null, state.i18n.servicePointHeader),
|
|
118
119
|
h("a", { href: ServicePointUrl, target: "_blank" },
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
h("pn-icon", { symbol: "map-marker", color: "blue700" }),
|
|
121
|
+
state.i18n.servicePointLink)))) : null));
|
|
121
122
|
}
|
|
122
123
|
static get is() { return "pn-find-price"; }
|
|
123
124
|
static get originalStyleUrls() { return {
|
|
@@ -12,16 +12,24 @@ export class PnPexPricefinder {
|
|
|
12
12
|
this.fromzip = null;
|
|
13
13
|
this.tozip = null;
|
|
14
14
|
this.weight = 100;
|
|
15
|
-
this.when =
|
|
15
|
+
this.when = '';
|
|
16
16
|
this.response = null;
|
|
17
17
|
}
|
|
18
18
|
componentWillLoad() {
|
|
19
19
|
this.init();
|
|
20
20
|
}
|
|
21
21
|
async init() {
|
|
22
|
+
this.setInitialTime();
|
|
22
23
|
this.checkParameters();
|
|
23
24
|
this.setLanguage();
|
|
24
25
|
}
|
|
26
|
+
setInitialTime() {
|
|
27
|
+
const initialTime = (new Date());
|
|
28
|
+
initialTime.setHours(initialTime.getHours() + 1);
|
|
29
|
+
initialTime.setMinutes(0);
|
|
30
|
+
const splitTime = initialTime.toLocaleString('sv', { timeZoneName: 'short' }).split(' ');
|
|
31
|
+
this.when = `${splitTime[0]}T${splitTime[1].substring(0, 5)}`;
|
|
32
|
+
}
|
|
25
33
|
checkParameters() {
|
|
26
34
|
const params = new URLSearchParams(window.location.href);
|
|
27
35
|
if (!params) {
|
|
@@ -96,7 +104,7 @@ export class PnPexPricefinder {
|
|
|
96
104
|
h("pn-input", { type: "number", label: this.i18n.labelWeight, inputid: "weight", name: "weight", placeholder: this.i18n.weightPlaceholder, required: true, value: this.weight }),
|
|
97
105
|
h("div", { class: "datepicker" },
|
|
98
106
|
h("label", { htmlFor: "when" }, this.i18n.labelWhen),
|
|
99
|
-
h("pn-
|
|
107
|
+
h("pn-marketweb-input", { inputid: "when", name: "when", type: "datetime-local", min: (new Date()).toISOString().split('T')[0], value: this.when })))),
|
|
100
108
|
h("fieldset", null,
|
|
101
109
|
h("div", null,
|
|
102
110
|
h("pn-button", { type: "submit" }, this.i18n.submitButtonText)))),
|
|
@@ -4,18 +4,17 @@ pn-product-card-info {
|
|
|
4
4
|
|
|
5
5
|
.cardinfocontent {
|
|
6
6
|
display: flex;
|
|
7
|
-
flex-direction:
|
|
7
|
+
flex-direction: column;
|
|
8
8
|
justify-content: space-between;
|
|
9
9
|
flex-grow: 1;
|
|
10
10
|
font-size: 0.875em;
|
|
11
|
+
gap: 1.6rem;
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
width: 5em;
|
|
13
|
+
@media screen and (min-width: 36em) {
|
|
14
|
+
.cardinfocontent {
|
|
15
|
+
flex-direction: row;
|
|
16
|
+
}
|
|
17
17
|
}
|
|
18
|
-
|
|
19
18
|
[slot=formatPre] {
|
|
20
19
|
font-family: "PostNordSans", "Verdana";
|
|
21
20
|
margin: 0.5em 3em 0 0;
|
|
@@ -4,7 +4,7 @@ export class PnProductCardInfo {
|
|
|
4
4
|
return (this.label) ? (h(Host, null,
|
|
5
5
|
h("div", { class: "cardinfocontent" }, (this.text) ? (h("pre", { slot: "formatPre" }, this.text)) : null))) : (h(Host, null,
|
|
6
6
|
h("div", { class: "cardinfocontent" },
|
|
7
|
-
h("div",
|
|
7
|
+
h("div", { class: "cardinfocontent-item" },
|
|
8
8
|
h("strong", null, "Paket:"),
|
|
9
9
|
this.paket.split("/").map((item) => ((item.split(":").length > 0) ?
|
|
10
10
|
h("p", null,
|
|
@@ -12,9 +12,8 @@ export class PnProductCardInfo {
|
|
|
12
12
|
" ",
|
|
13
13
|
item.split(":")[1]) :
|
|
14
14
|
h("p", null, item)))),
|
|
15
|
-
h("div", { id: "sp" }),
|
|
16
15
|
(this.rulle) ?
|
|
17
|
-
(h("div",
|
|
16
|
+
(h("div", { class: "cardinfocontent-item" },
|
|
18
17
|
h("strong", null, "Rulle:"),
|
|
19
18
|
this.rulle.split("/").map((item) => ((item.split(":").length > 0) ?
|
|
20
19
|
h("p", null,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
pn-product-card-price {
|
|
2
|
-
margin-top:
|
|
2
|
+
margin-top: 1.6rem;
|
|
3
3
|
white-space: nowrap;
|
|
4
4
|
text-align: center;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
5
7
|
}
|
|
6
8
|
pn-product-card-price span:last-child {
|
|
7
9
|
display: inline-block;
|
|
@@ -15,16 +17,31 @@ pn-product-card-price pn-icon {
|
|
|
15
17
|
align-self: center;
|
|
16
18
|
}
|
|
17
19
|
pn-product-card-price pn-button {
|
|
18
|
-
width: 12.8em;
|
|
19
|
-
margin-
|
|
20
|
-
margin-top: 0.5em;
|
|
20
|
+
min-width: 12.8em;
|
|
21
|
+
margin-top: 0.8rem;
|
|
21
22
|
font-size: 1.25;
|
|
23
|
+
order: 2;
|
|
24
|
+
}
|
|
25
|
+
@media screen and (min-width: 48em) {
|
|
26
|
+
pn-product-card-price pn-button {
|
|
27
|
+
order: 3;
|
|
28
|
+
margin-bottom: 1.6rem;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
pn-product-card-price h3 {
|
|
32
|
+
order: 1;
|
|
22
33
|
}
|
|
23
34
|
pn-product-card-price p {
|
|
24
35
|
font-weight: lighter;
|
|
25
36
|
font-size: 0.875em;
|
|
26
37
|
align-self: center;
|
|
27
|
-
margin-top: 0.
|
|
38
|
+
margin-top: 0.8rem;
|
|
39
|
+
order: 3;
|
|
40
|
+
}
|
|
41
|
+
@media screen and (min-width: 48em) {
|
|
42
|
+
pn-product-card-price p {
|
|
43
|
+
order: 2;
|
|
44
|
+
}
|
|
28
45
|
}
|
|
29
46
|
pn-product-card-price a {
|
|
30
47
|
text-decoration: none;
|
|
@@ -9,7 +9,7 @@ export class PnProductCardPrice {
|
|
|
9
9
|
(this.amount) ? (h("span", null, this.amount)) : null,
|
|
10
10
|
(this.currency) ? (h("span", null, " " + this.currency)) : null),
|
|
11
11
|
(this.note) ? (h("p", null, this.note)) : null,
|
|
12
|
-
(this.label) ? (h("pn-button", { small: "true", icon: "
|
|
12
|
+
(this.label) ? (h("pn-button", { small: "true", icon: "open-in-new", appearance: "light", href: this.url, target: "_blank", id: this.service.split(" ").join("-").toLocaleLowerCase() }, this.label)) : null)) : (h(Host, null,
|
|
13
13
|
h("h3", null,
|
|
14
14
|
(this.amount) ? (h("span", null, this.amount)) : null,
|
|
15
15
|
(this.currency) ? (h("span", null, this.currency)) : null)));
|