@postnord/pn-marketweb-components 2.4.17 → 2.4.19
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-4199ff85.js +12 -4
- package/cjs/index-e4882728.js +72 -0
- package/cjs/loader.cjs.js +1 -1
- package/cjs/pn-app-banner.cjs.entry.js +46 -0
- package/cjs/pn-date-and-time.cjs.entry.js +1 -1
- package/cjs/pn-dropdown-choice-adds-row.cjs.entry.js +254 -0
- package/cjs/pn-market-web-components.cjs.js +1 -1
- package/cjs/pn-multi-formfield.cjs.entry.js +2 -70
- package/collection/collection-manifest.json +2 -0
- package/collection/components/input/pn-date-and-time/pn-date-and-time.css +2 -1
- package/collection/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.css +58 -0
- package/collection/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.js +508 -0
- package/collection/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.stories.js +43 -0
- package/collection/components/input/pn-dropdown-choice-adds-row/types.js +1 -0
- package/collection/components/minor/pn-app-banner/pn-app-banner.css +35 -0
- package/collection/components/minor/pn-app-banner/pn-app-banner.js +141 -0
- package/collection/components/minor/pn-app-banner/pn-app-banner.stories.js +31 -0
- package/components/index.d.ts +2 -0
- package/components/index.js +2 -0
- package/components/index3.js +61 -178
- package/components/index4.js +187 -0
- package/components/pn-app-banner.d.ts +11 -0
- package/components/pn-app-banner.js +68 -0
- package/components/pn-date-and-time.js +1 -1
- package/components/pn-dropdown-choice-adds-row.d.ts +11 -0
- package/components/pn-dropdown-choice-adds-row.js +292 -0
- package/components/pn-find-price-result2.js +1 -1
- package/components/pn-find-service-and-price-result2.js +1 -1
- package/components/pn-mainnav-store.js +1 -1
- package/components/pn-marketweb-siteheader-login-linklist2.js +1 -1
- package/components/pn-marketweb-siteheader-search2.js +1 -1
- package/components/pn-multi-formfield.js +1 -69
- package/components/pn-product-pricelist-result.js +1 -1
- package/components/pn-profile-modal-store.js +1 -1
- package/components/pn-proxio-findprice.js +1 -1
- package/components/pn-sidenav-store.js +1 -1
- package/esm/index-8976f360.js +70 -0
- package/esm/index-ee44c065.js +12 -4
- package/esm/loader.js +1 -1
- package/esm/pn-app-banner.entry.js +42 -0
- package/esm/pn-date-and-time.entry.js +1 -1
- package/esm/pn-dropdown-choice-adds-row.entry.js +250 -0
- package/esm/pn-market-web-components.js +1 -1
- package/esm/pn-multi-formfield.entry.js +1 -69
- package/esm-es5/index-8976f360.js +1 -0
- package/esm-es5/index-ee44c065.js +1 -1
- package/esm-es5/loader.js +1 -1
- package/esm-es5/pn-app-banner.entry.js +1 -0
- package/esm-es5/pn-date-and-time.entry.js +1 -1
- package/esm-es5/pn-dropdown-choice-adds-row.entry.js +1 -0
- package/esm-es5/pn-market-web-components.js +1 -1
- package/esm-es5/pn-multi-formfield.entry.js +1 -1
- package/package.json +1 -1
- package/pn-market-web-components/p-07e0a50f.entry.js +1 -0
- package/pn-market-web-components/p-196b2316.system.entry.js +1 -0
- package/pn-market-web-components/p-296637c0.system.js +1 -0
- package/pn-market-web-components/p-3a897643.system.entry.js +1 -0
- package/pn-market-web-components/p-4e3d7a56.js +1 -0
- package/pn-market-web-components/p-4e7d4e69.entry.js +1 -0
- package/pn-market-web-components/p-6de99b6a.system.entry.js +1 -0
- package/pn-market-web-components/{p-8ac445d6.entry.js → p-76ce7256.entry.js} +1 -1
- package/pn-market-web-components/p-c0961278.system.entry.js +1 -0
- package/pn-market-web-components/p-e5d9f268.entry.js +1 -0
- package/pn-market-web-components/p-fcdb7381.system.js +1 -1
- package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
- package/types/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.d.ts +43 -0
- package/types/components/input/pn-dropdown-choice-adds-row/types.d.ts +18 -0
- package/types/components/minor/pn-app-banner/pn-app-banner.d.ts +14 -0
- package/types/components.d.ts +66 -0
- package/pn-market-web-components/p-14d13eaa.system.entry.js +0 -1
- package/pn-market-web-components/p-f7867310.entry.js +0 -1
- package/pn-market-web-components/p-fbae553c.system.entry.js +0 -1
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { h, Host } from '@stencil/core';
|
|
2
|
+
export class PnAppBanner {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.handleOnClose = () => {
|
|
5
|
+
this.isClosed = true;
|
|
6
|
+
};
|
|
7
|
+
this.appName = undefined;
|
|
8
|
+
this.appDescription = undefined;
|
|
9
|
+
this.ctaText = undefined;
|
|
10
|
+
this.appleStoreLink = undefined;
|
|
11
|
+
this.googleStoreLink = undefined;
|
|
12
|
+
this.isClosed = false;
|
|
13
|
+
this.storeLink = undefined;
|
|
14
|
+
}
|
|
15
|
+
detectDeviceAndSetStoreLink() {
|
|
16
|
+
const userAgent = navigator.userAgent;
|
|
17
|
+
if (userAgent.match(/Android/i)) {
|
|
18
|
+
this.storeLink = this.googleStoreLink;
|
|
19
|
+
}
|
|
20
|
+
else if (userAgent.match(/iPhone|iPad|iPod/i)) {
|
|
21
|
+
this.storeLink = this.appleStoreLink;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
this.storeLink = null;
|
|
25
|
+
this.isClosed = true; // -> data-is-closed = true
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
componentWillLoad() {
|
|
29
|
+
this.detectDeviceAndSetStoreLink();
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
return (h(Host, { "data-is-closed": this.isClosed ? 'true' : 'false' }, h("div", { class: "pn-app-banner__wrapper pn-app-banner__sticky" }, h("div", { class: "icon-close", onClick: this.handleOnClose }, h("pn-icon", { symbol: "close-small", small: "false", color: "black" })), h("div", { class: "pn-app-banner__icon" }, h("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("g", { "clip-path": "url(#clip0_17800_45416)" }, h("path", { d: "M23.875 0H8.125C3.63769 0 0 3.63769 0 8.125V23.875C0 28.3623 3.63769 32 8.125 32H23.875C28.3623 32 32 28.3623 32 23.875V8.125C32 3.63769 28.3623 0 23.875 0Z", fill: "#F18D8D" }), h("mask", { id: "mask0_17800_45416", style: { 'mask-type': 'alpha' }, maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "32", height: "32" }, h("path", { d: "M23.875 0H8.125C3.63769 0 0 3.63769 0 8.125V23.875C0 28.3623 3.63769 32 8.125 32H23.875C28.3623 32 32 28.3623 32 23.875V8.125C32 3.63769 28.3623 0 23.875 0Z", fill: "#0D234B" })), h("g", { mask: "url(#mask0_17800_45416)" }, h("path", { d: "M23.875 0H8.125C3.63769 0 0 3.63769 0 8.125V23.875C0 28.3623 3.63769 32 8.125 32H23.875C28.3623 32 32 28.3623 32 23.875V8.125C32 3.63769 28.3623 0 23.875 0Z", fill: "#0D234B" }), h("path", { d: "M50.8125 14.1562H18.8125V46.1562H50.8125V14.1562Z", fill: "url(#paint0_linear_17800_45416)" }), h("path", { d: "M2.09375 31.375C2.09375 15.2379 15.1754 2.15625 31.3125 2.15625H31.9844V31.9844H2.09998C2.09583 31.7819 2.09375 31.5788 2.09375 31.375Z", fill: "#00A0D6" }), h("g", { filter: "url(#filter0_d_17800_45416)" }, h("path", { d: "M7.40625 11.8062C7.40625 10.2661 7.40625 9.49603 7.70597 8.90778C7.96963 8.39034 8.39034 7.96963 8.90778 7.70597C9.49603 7.40625 10.2661 7.40625 11.8062 7.40625H20.1938C21.7339 7.40625 22.504 7.40625 23.0922 7.70597C23.6097 7.96963 24.0304 8.39034 24.294 8.90778C24.5938 9.49603 24.5938 10.2661 24.5938 11.8062V20.1938C24.5938 21.7339 24.5938 22.504 24.294 23.0922C24.0304 23.6097 23.6097 24.0304 23.0922 24.294C22.504 24.5938 21.7339 24.5938 20.1938 24.5938H11.8062C10.2661 24.5938 9.49603 24.5938 8.90778 24.294C8.39034 24.0304 7.96963 23.6097 7.70597 23.0922C7.40625 22.504 7.40625 21.7339 7.40625 20.1938V11.8062Z", fill: "#F1F7FA" }), h("path", { opacity: "0.6", "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M10.5938 10.0625C10.3176 10.0625 10.0938 10.2863 10.0938 10.5625C10.0938 10.8387 10.3176 11.0625 10.5938 11.0625H12.875C13.1512 11.0625 13.375 10.8387 13.375 10.5625C13.375 10.2863 13.1512 10.0625 12.875 10.0625H10.5938ZM10.5938 12.3125C10.3176 12.3125 10.0938 12.5363 10.0938 12.8125C10.0938 13.0887 10.3176 13.3125 10.5938 13.3125H15.3125C15.5887 13.3125 15.8125 13.0887 15.8125 12.8125C15.8125 12.5363 15.5887 12.3125 15.3125 12.3125H10.5938ZM10.0938 14.75C10.0938 14.4738 10.3176 14.25 10.5938 14.25H13.5625C13.8387 14.25 14.0625 14.4738 14.0625 14.75C14.0625 15.0262 13.8387 15.25 13.5625 15.25H10.5938C10.3176 15.25 10.0938 15.0262 10.0938 14.75ZM15.1875 14.25C14.9113 14.25 14.6875 14.4738 14.6875 14.75C14.6875 15.0262 14.9113 15.25 15.1875 15.25C15.4637 15.25 15.6875 15.0262 15.6875 14.75C15.6875 14.4738 15.4637 14.25 15.1875 14.25Z", fill: "#A5C0CA" }), h("path", { d: "M17.9375 10.5938C17.9375 10.3176 18.1613 10.0938 18.4375 10.0938H21.75C22.0262 10.0938 22.25 10.3176 22.25 10.5938C22.25 10.8699 22.0262 11.0938 21.75 11.0938H18.4375C18.1613 11.0938 17.9375 10.8699 17.9375 10.5938Z", fill: "#00A0D6" }), h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M10.0938 19.3125C10.0938 18.8983 10.4295 18.5625 10.8438 18.5625C11.258 18.5625 11.5938 18.8983 11.5938 19.3125V21.25C11.5938 21.6642 11.258 22 10.8438 22C10.4295 22 10.0938 21.6642 10.0938 21.25V19.3125ZM19.3438 19.3125C19.3438 18.8983 19.6795 18.5625 20.0938 18.5625C20.508 18.5625 20.8438 18.8983 20.8438 19.3125V21.25C20.8438 21.6642 20.508 22 20.0938 22C19.6795 22 19.3438 21.6642 19.3438 21.25V19.3125ZM14.5938 18.5625C14.1795 18.5625 13.8438 18.8983 13.8438 19.3125V21.25C13.8438 21.6642 14.1795 22 14.5938 22C15.008 22 15.3438 21.6642 15.3438 21.25V19.3125C15.3438 18.8983 15.008 18.5625 14.5938 18.5625ZM12.5938 18.9375C12.5938 18.7304 12.7617 18.5625 12.9688 18.5625C13.1758 18.5625 13.3438 18.7304 13.3438 18.9375V21.625C13.3438 21.8321 13.1758 22 12.9688 22C12.7617 22 12.5938 21.8321 12.5938 21.625V18.9375ZM21.5938 18.5625C21.3867 18.5625 21.2188 18.7304 21.2188 18.9375V21.625C21.2188 21.8321 21.3867 22 21.5938 22C21.8008 22 21.9688 21.8321 21.9688 21.625V18.9375C21.9688 18.7304 21.8008 18.5625 21.5938 18.5625ZM17.5938 18.9375C17.5938 18.7304 17.7617 18.5625 17.9688 18.5625C18.1758 18.5625 18.3438 18.7304 18.3438 18.9375V21.625C18.3438 21.8321 18.1758 22 17.9688 22C17.7617 22 17.5938 21.8321 17.5938 21.625V18.9375ZM16.5938 18.5625C16.3176 18.5625 16.0938 18.7863 16.0938 19.0625V21.5C16.0938 21.7762 16.3176 22 16.5938 22C16.8699 22 17.0938 21.7762 17.0938 21.5V19.0625C17.0938 18.7863 16.8699 18.5625 16.5938 18.5625Z", fill: "#0D234B" })))), h("defs", null, h("filter", { id: "filter0_d_17800_45416", x: "-52.5938", y: "-48.5938", width: "137.188", height: "137.188", filterUnits: "userSpaceOnUse", "color-interpolation-filters": "s-rGB" }, h("feFlood", { "flood-opacity": "0", result: "BackgroundImageFix" }), h("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", result: "hardAlpha" }), h("feOffset", { dy: "4" }), h("feGaussianBlur", { stdDeviation: "30" }), h("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0" }), h("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow_17800_45416" }), h("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow_17800_45416", result: "shape" })), h("linearGradient", { id: "paint0_linear_17800_45416", x1: "29.2305", y1: "44.3441", x2: "51.5694", y2: "15.1782", gradientUnits: "userSpaceOnUse" }, h("stop", { offset: "0.0800778", "stop-color": "#0D244C" }), h("stop", { offset: "1", "stop-color": "#0D234B" })), h("clipPath", { id: "clip0_17800_45416" }, h("rect", { width: "32", height: "32", fill: "white" }))))), h("div", { class: "pn-app-banner__text" }, h("span", null, this.appName), h("br", null), this.appDescription), h("div", { class: "pn-app-banner__cta" }, h("pn-button", { small: true, href: this.storeLink }, this.ctaText)))));
|
|
33
|
+
}
|
|
34
|
+
static get is() { return "pn-app-banner"; }
|
|
35
|
+
static get originalStyleUrls() {
|
|
36
|
+
return {
|
|
37
|
+
"$": ["pn-app-banner.scss"]
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
static get styleUrls() {
|
|
41
|
+
return {
|
|
42
|
+
"$": ["pn-app-banner.css"]
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
static get properties() {
|
|
46
|
+
return {
|
|
47
|
+
"appName": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"mutable": false,
|
|
50
|
+
"complexType": {
|
|
51
|
+
"original": "string",
|
|
52
|
+
"resolved": "string",
|
|
53
|
+
"references": {}
|
|
54
|
+
},
|
|
55
|
+
"required": false,
|
|
56
|
+
"optional": false,
|
|
57
|
+
"docs": {
|
|
58
|
+
"tags": [],
|
|
59
|
+
"text": ""
|
|
60
|
+
},
|
|
61
|
+
"attribute": "app-name",
|
|
62
|
+
"reflect": false
|
|
63
|
+
},
|
|
64
|
+
"appDescription": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"mutable": false,
|
|
67
|
+
"complexType": {
|
|
68
|
+
"original": "string",
|
|
69
|
+
"resolved": "string",
|
|
70
|
+
"references": {}
|
|
71
|
+
},
|
|
72
|
+
"required": false,
|
|
73
|
+
"optional": false,
|
|
74
|
+
"docs": {
|
|
75
|
+
"tags": [],
|
|
76
|
+
"text": ""
|
|
77
|
+
},
|
|
78
|
+
"attribute": "app-description",
|
|
79
|
+
"reflect": false
|
|
80
|
+
},
|
|
81
|
+
"ctaText": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"mutable": false,
|
|
84
|
+
"complexType": {
|
|
85
|
+
"original": "string",
|
|
86
|
+
"resolved": "string",
|
|
87
|
+
"references": {}
|
|
88
|
+
},
|
|
89
|
+
"required": false,
|
|
90
|
+
"optional": false,
|
|
91
|
+
"docs": {
|
|
92
|
+
"tags": [],
|
|
93
|
+
"text": ""
|
|
94
|
+
},
|
|
95
|
+
"attribute": "cta-text",
|
|
96
|
+
"reflect": false
|
|
97
|
+
},
|
|
98
|
+
"appleStoreLink": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"mutable": false,
|
|
101
|
+
"complexType": {
|
|
102
|
+
"original": "string",
|
|
103
|
+
"resolved": "string",
|
|
104
|
+
"references": {}
|
|
105
|
+
},
|
|
106
|
+
"required": false,
|
|
107
|
+
"optional": false,
|
|
108
|
+
"docs": {
|
|
109
|
+
"tags": [],
|
|
110
|
+
"text": ""
|
|
111
|
+
},
|
|
112
|
+
"attribute": "apple-store-link",
|
|
113
|
+
"reflect": false
|
|
114
|
+
},
|
|
115
|
+
"googleStoreLink": {
|
|
116
|
+
"type": "string",
|
|
117
|
+
"mutable": false,
|
|
118
|
+
"complexType": {
|
|
119
|
+
"original": "string",
|
|
120
|
+
"resolved": "string",
|
|
121
|
+
"references": {}
|
|
122
|
+
},
|
|
123
|
+
"required": false,
|
|
124
|
+
"optional": false,
|
|
125
|
+
"docs": {
|
|
126
|
+
"tags": [],
|
|
127
|
+
"text": ""
|
|
128
|
+
},
|
|
129
|
+
"attribute": "google-store-link",
|
|
130
|
+
"reflect": false
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
static get states() {
|
|
135
|
+
return {
|
|
136
|
+
"isClosed": {},
|
|
137
|
+
"storeLink": {}
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
static get elementRef() { return "hostElement"; }
|
|
141
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import readme from './readme.md';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'minor/AppBanner',
|
|
5
|
+
parameters: {
|
|
6
|
+
notes: readme,
|
|
7
|
+
layout: 'fullscreen',
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const Template = ({ ...args }) => {
|
|
12
|
+
return `
|
|
13
|
+
<div>
|
|
14
|
+
<pn-app-banner
|
|
15
|
+
app-name="${args.name}"
|
|
16
|
+
app-description="${args.description}"
|
|
17
|
+
cta-text="${args.ctaText}"
|
|
18
|
+
apple-store-link="${args.appleStoreLink}"
|
|
19
|
+
google-store-link="${args.googleStoreLink}"></pn-app-banner>
|
|
20
|
+
</div>
|
|
21
|
+
`;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const Primary = Template.bind({});
|
|
25
|
+
Primary.args = {
|
|
26
|
+
name: 'Postnord',
|
|
27
|
+
description: 'Spåra dina paket',
|
|
28
|
+
ctaText: 'Hämta appen',
|
|
29
|
+
appleStoreLink: 'https://apps.apple.com/dk/app/postnord/id396871673?l=da',
|
|
30
|
+
googleStoreLink: 'https://play.google.com/store/apps/details?id=se.postnord.private&hl=da&gl=DK',
|
|
31
|
+
};
|
package/components/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* PnMarketWebComponents custom elements */
|
|
2
2
|
export { PnAnimatedTile as PnAnimatedTile } from '../types/components/animation/pn-animated-tile/pn-animated-tile';
|
|
3
|
+
export { PnAppBanner as PnAppBanner } from '../types/components/minor/pn-app-banner/pn-app-banner';
|
|
3
4
|
export { PnBonusProgressbar as PnBonusProgressbar } from '../types/components/input/pn-bonus-progressbar/pn-bonus-progressbar';
|
|
4
5
|
export { PnBonusProgressbarLevel as PnBonusProgressbarLevel } from '../types/components/input/pn-bonus-progressbar/pn-bonus-progressbar-level';
|
|
5
6
|
export { PnBreakpoints as PnBreakpoints } from '../types/components/utilities/pn-breakpoints/pn-breakpoints';
|
|
@@ -9,6 +10,7 @@ export { PnChoiceButton as PnChoiceButton } from '../types/components/input/pn-c
|
|
|
9
10
|
export { PnCustomernumberSelector as PnCustomernumberSelector } from '../types/components/profile/pn-customernumber-selector/pn-customernumber-selector';
|
|
10
11
|
export { PnProfileSelectorOption as PnCustomernumberSelectorOption } from '../types/components/profile/pn-customernumber-selector/pn-customernumber-selector-option';
|
|
11
12
|
export { PnDateAndTime as PnDateAndTime } from '../types/components/input/pn-date-and-time/pn-date-and-time';
|
|
13
|
+
export { pnDropdownChoiceAddsRow as PnDropdownChoiceAddsRow } from '../types/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row';
|
|
12
14
|
export { PnFilterCheckbox as PnFilterCheckbox } from '../types/components/input/pn-filter-checkbox/pn-filter-checkbox';
|
|
13
15
|
export { PnfindPrice as PnFindPrice } from '../types/components/widgets/pn-find-price/pn-find-price';
|
|
14
16
|
export { PnfindPriceResult as PnFindPriceResult } from '../types/components/widgets/pn-find-price/pn-find-price-result';
|
package/components/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
|
|
2
2
|
export { PnAnimatedTile, defineCustomElement as defineCustomElementPnAnimatedTile } from './pn-animated-tile.js';
|
|
3
|
+
export { PnAppBanner, defineCustomElement as defineCustomElementPnAppBanner } from './pn-app-banner.js';
|
|
3
4
|
export { PnBonusProgressbar, defineCustomElement as defineCustomElementPnBonusProgressbar } from './pn-bonus-progressbar.js';
|
|
4
5
|
export { PnBonusProgressbarLevel, defineCustomElement as defineCustomElementPnBonusProgressbarLevel } from './pn-bonus-progressbar-level.js';
|
|
5
6
|
export { PnBreakpoints, defineCustomElement as defineCustomElementPnBreakpoints } from './pn-breakpoints.js';
|
|
@@ -9,6 +10,7 @@ export { PnChoiceButton, defineCustomElement as defineCustomElementPnChoiceButto
|
|
|
9
10
|
export { PnCustomernumberSelector, defineCustomElement as defineCustomElementPnCustomernumberSelector } from './pn-customernumber-selector.js';
|
|
10
11
|
export { PnCustomernumberSelectorOption, defineCustomElement as defineCustomElementPnCustomernumberSelectorOption } from './pn-customernumber-selector-option.js';
|
|
11
12
|
export { PnDateAndTime, defineCustomElement as defineCustomElementPnDateAndTime } from './pn-date-and-time.js';
|
|
13
|
+
export { PnDropdownChoiceAddsRow, defineCustomElement as defineCustomElementPnDropdownChoiceAddsRow } from './pn-dropdown-choice-adds-row.js';
|
|
12
14
|
export { PnFilterCheckbox, defineCustomElement as defineCustomElementPnFilterCheckbox } from './pn-filter-checkbox.js';
|
|
13
15
|
export { PnFindPrice, defineCustomElement as defineCustomElementPnFindPrice } from './pn-find-price.js';
|
|
14
16
|
export { PnFindPriceResult, defineCustomElement as defineCustomElementPnFindPriceResult } from './pn-find-price-result.js';
|
package/components/index3.js
CHANGED
|
@@ -1,187 +1,70 @@
|
|
|
1
|
-
import { getRenderingRef, forceUpdate } from '@stencil/core/internal/client';
|
|
2
|
-
|
|
3
|
-
const appendToMap = (map, propName, value) => {
|
|
4
|
-
const items = map.get(propName);
|
|
5
|
-
if (!items) {
|
|
6
|
-
map.set(propName, [value]);
|
|
7
|
-
}
|
|
8
|
-
else if (!items.includes(value)) {
|
|
9
|
-
items.push(value);
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
const debounce = (fn, ms) => {
|
|
13
|
-
let timeoutId;
|
|
14
|
-
return (...args) => {
|
|
15
|
-
if (timeoutId) {
|
|
16
|
-
clearTimeout(timeoutId);
|
|
17
|
-
}
|
|
18
|
-
timeoutId = setTimeout(() => {
|
|
19
|
-
timeoutId = 0;
|
|
20
|
-
fn(...args);
|
|
21
|
-
}, ms);
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
|
|
25
1
|
/**
|
|
26
|
-
*
|
|
27
|
-
* The
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
2
|
+
* Returns a function, that, as long as it continues to be invoked, will not
|
|
3
|
+
* be triggered. The function will be called after it stops being called for
|
|
4
|
+
* N milliseconds. If `immediate` is passed, trigger the function on the
|
|
5
|
+
* leading edge, instead of the trailing. The function also has a property 'clear'
|
|
6
|
+
* that is a function which will clear the timer to prevent previously scheduled executions.
|
|
31
7
|
*
|
|
32
|
-
*
|
|
8
|
+
* @source underscore.js
|
|
9
|
+
* @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/
|
|
10
|
+
* @param {Function} function to wrap
|
|
11
|
+
* @param {Number} timeout in ms (`100`)
|
|
12
|
+
* @param {Boolean} whether to execute at the beginning (`false`)
|
|
13
|
+
* @api public
|
|
33
14
|
*/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
15
|
+
function debounce(func, wait, immediate){
|
|
16
|
+
var timeout, args, context, timestamp, result;
|
|
17
|
+
if (null == wait) wait = 100;
|
|
18
|
+
|
|
19
|
+
function later() {
|
|
20
|
+
var last = Date.now() - timestamp;
|
|
21
|
+
|
|
22
|
+
if (last < wait && last >= 0) {
|
|
23
|
+
timeout = setTimeout(later, wait - last);
|
|
24
|
+
} else {
|
|
25
|
+
timeout = null;
|
|
26
|
+
if (!immediate) {
|
|
27
|
+
result = func.apply(context, args);
|
|
28
|
+
context = args = null;
|
|
29
|
+
}
|
|
38
30
|
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
31
|
+
}
|
|
32
|
+
var debounced = function(){
|
|
33
|
+
context = this;
|
|
34
|
+
args = arguments;
|
|
35
|
+
timestamp = Date.now();
|
|
36
|
+
var callNow = immediate && !timeout;
|
|
37
|
+
if (!timeout) timeout = setTimeout(later, wait);
|
|
38
|
+
if (callNow) {
|
|
39
|
+
result = func.apply(context, args);
|
|
40
|
+
context = args = null;
|
|
45
41
|
}
|
|
46
|
-
const elmsToUpdate = new Map();
|
|
47
|
-
return {
|
|
48
|
-
dispose: () => elmsToUpdate.clear(),
|
|
49
|
-
get: (propName) => {
|
|
50
|
-
const elm = getRenderingRef();
|
|
51
|
-
if (elm) {
|
|
52
|
-
appendToMap(elmsToUpdate, propName, elm);
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
set: (propName) => {
|
|
56
|
-
const elements = elmsToUpdate.get(propName);
|
|
57
|
-
if (elements) {
|
|
58
|
-
elmsToUpdate.set(propName, elements.filter(forceUpdate));
|
|
59
|
-
}
|
|
60
|
-
cleanupElements(elmsToUpdate);
|
|
61
|
-
},
|
|
62
|
-
reset: () => {
|
|
63
|
-
elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));
|
|
64
|
-
cleanupElements(elmsToUpdate);
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
42
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
};
|
|
77
|
-
const reset = () => {
|
|
78
|
-
states = new Map(Object.entries(defaultState !== null && defaultState !== void 0 ? defaultState : {}));
|
|
79
|
-
handlers.reset.forEach((cb) => cb());
|
|
80
|
-
};
|
|
81
|
-
const dispose = () => {
|
|
82
|
-
// Call first dispose as resetting the state would
|
|
83
|
-
// cause less updates ;)
|
|
84
|
-
handlers.dispose.forEach((cb) => cb());
|
|
85
|
-
reset();
|
|
86
|
-
};
|
|
87
|
-
const get = (propName) => {
|
|
88
|
-
handlers.get.forEach((cb) => cb(propName));
|
|
89
|
-
return states.get(propName);
|
|
90
|
-
};
|
|
91
|
-
const set = (propName, value) => {
|
|
92
|
-
const oldValue = states.get(propName);
|
|
93
|
-
if (shouldUpdate(value, oldValue, propName)) {
|
|
94
|
-
states.set(propName, value);
|
|
95
|
-
handlers.set.forEach((cb) => cb(propName, value, oldValue));
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
const state = (typeof Proxy === 'undefined'
|
|
99
|
-
? {}
|
|
100
|
-
: new Proxy(defaultState, {
|
|
101
|
-
get(_, propName) {
|
|
102
|
-
return get(propName);
|
|
103
|
-
},
|
|
104
|
-
ownKeys(_) {
|
|
105
|
-
return Array.from(states.keys());
|
|
106
|
-
},
|
|
107
|
-
getOwnPropertyDescriptor() {
|
|
108
|
-
return {
|
|
109
|
-
enumerable: true,
|
|
110
|
-
configurable: true,
|
|
111
|
-
};
|
|
112
|
-
},
|
|
113
|
-
has(_, propName) {
|
|
114
|
-
return states.has(propName);
|
|
115
|
-
},
|
|
116
|
-
set(_, propName, value) {
|
|
117
|
-
set(propName, value);
|
|
118
|
-
return true;
|
|
119
|
-
},
|
|
120
|
-
}));
|
|
121
|
-
const on = (eventName, callback) => {
|
|
122
|
-
handlers[eventName].push(callback);
|
|
123
|
-
return () => {
|
|
124
|
-
removeFromArray(handlers[eventName], callback);
|
|
125
|
-
};
|
|
126
|
-
};
|
|
127
|
-
const onChange = (propName, cb) => {
|
|
128
|
-
const unSet = on('set', (key, newValue) => {
|
|
129
|
-
if (key === propName) {
|
|
130
|
-
cb(newValue);
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
const unReset = on('reset', () => cb(defaultState[propName]));
|
|
134
|
-
return () => {
|
|
135
|
-
unSet();
|
|
136
|
-
unReset();
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
const use = (...subscriptions) => {
|
|
140
|
-
const unsubs = subscriptions.reduce((unsubs, subscription) => {
|
|
141
|
-
if (subscription.set) {
|
|
142
|
-
unsubs.push(on('set', subscription.set));
|
|
143
|
-
}
|
|
144
|
-
if (subscription.get) {
|
|
145
|
-
unsubs.push(on('get', subscription.get));
|
|
146
|
-
}
|
|
147
|
-
if (subscription.reset) {
|
|
148
|
-
unsubs.push(on('reset', subscription.reset));
|
|
149
|
-
}
|
|
150
|
-
if (subscription.dispose) {
|
|
151
|
-
unsubs.push(on('dispose', subscription.dispose));
|
|
152
|
-
}
|
|
153
|
-
return unsubs;
|
|
154
|
-
}, []);
|
|
155
|
-
return () => unsubs.forEach((unsub) => unsub());
|
|
156
|
-
};
|
|
157
|
-
const forceUpdate = (key) => {
|
|
158
|
-
const oldValue = states.get(key);
|
|
159
|
-
handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
|
|
160
|
-
};
|
|
161
|
-
return {
|
|
162
|
-
state,
|
|
163
|
-
get,
|
|
164
|
-
set,
|
|
165
|
-
on,
|
|
166
|
-
onChange,
|
|
167
|
-
use,
|
|
168
|
-
dispose,
|
|
169
|
-
reset,
|
|
170
|
-
forceUpdate,
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
|
-
const removeFromArray = (array, item) => {
|
|
174
|
-
const index = array.indexOf(item);
|
|
175
|
-
if (index >= 0) {
|
|
176
|
-
array[index] = array[array.length - 1];
|
|
177
|
-
array.length--;
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
debounced.clear = function() {
|
|
47
|
+
if (timeout) {
|
|
48
|
+
clearTimeout(timeout);
|
|
49
|
+
timeout = null;
|
|
178
50
|
}
|
|
179
|
-
};
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
debounced.flush = function() {
|
|
54
|
+
if (timeout) {
|
|
55
|
+
result = func.apply(context, args);
|
|
56
|
+
context = args = null;
|
|
57
|
+
|
|
58
|
+
clearTimeout(timeout);
|
|
59
|
+
timeout = null;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return debounced;
|
|
64
|
+
}
|
|
65
|
+
// Adds compatibility for ES modules
|
|
66
|
+
debounce.debounce = debounce;
|
|
180
67
|
|
|
181
|
-
|
|
182
|
-
const map = createObservableMap(defaultState, shouldUpdate);
|
|
183
|
-
map.use(stencilSubscription());
|
|
184
|
-
return map;
|
|
185
|
-
};
|
|
68
|
+
var debounce_1 = debounce;
|
|
186
69
|
|
|
187
|
-
export {
|
|
70
|
+
export { debounce_1 as d };
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { getRenderingRef, forceUpdate } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const appendToMap = (map, propName, value) => {
|
|
4
|
+
const items = map.get(propName);
|
|
5
|
+
if (!items) {
|
|
6
|
+
map.set(propName, [value]);
|
|
7
|
+
}
|
|
8
|
+
else if (!items.includes(value)) {
|
|
9
|
+
items.push(value);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const debounce = (fn, ms) => {
|
|
13
|
+
let timeoutId;
|
|
14
|
+
return (...args) => {
|
|
15
|
+
if (timeoutId) {
|
|
16
|
+
clearTimeout(timeoutId);
|
|
17
|
+
}
|
|
18
|
+
timeoutId = setTimeout(() => {
|
|
19
|
+
timeoutId = 0;
|
|
20
|
+
fn(...args);
|
|
21
|
+
}, ms);
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Check if a possible element isConnected.
|
|
27
|
+
* The property might not be there, so we check for it.
|
|
28
|
+
*
|
|
29
|
+
* We want it to return true if isConnected is not a property,
|
|
30
|
+
* otherwise we would remove these elements and would not update.
|
|
31
|
+
*
|
|
32
|
+
* Better leak in Edge than to be useless.
|
|
33
|
+
*/
|
|
34
|
+
const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
|
|
35
|
+
const cleanupElements = debounce((map) => {
|
|
36
|
+
for (let key of map.keys()) {
|
|
37
|
+
map.set(key, map.get(key).filter(isConnected));
|
|
38
|
+
}
|
|
39
|
+
}, 2000);
|
|
40
|
+
const stencilSubscription = () => {
|
|
41
|
+
if (typeof getRenderingRef !== 'function') {
|
|
42
|
+
// If we are not in a stencil project, we do nothing.
|
|
43
|
+
// This function is not really exported by @stencil/core.
|
|
44
|
+
return {};
|
|
45
|
+
}
|
|
46
|
+
const elmsToUpdate = new Map();
|
|
47
|
+
return {
|
|
48
|
+
dispose: () => elmsToUpdate.clear(),
|
|
49
|
+
get: (propName) => {
|
|
50
|
+
const elm = getRenderingRef();
|
|
51
|
+
if (elm) {
|
|
52
|
+
appendToMap(elmsToUpdate, propName, elm);
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
set: (propName) => {
|
|
56
|
+
const elements = elmsToUpdate.get(propName);
|
|
57
|
+
if (elements) {
|
|
58
|
+
elmsToUpdate.set(propName, elements.filter(forceUpdate));
|
|
59
|
+
}
|
|
60
|
+
cleanupElements(elmsToUpdate);
|
|
61
|
+
},
|
|
62
|
+
reset: () => {
|
|
63
|
+
elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));
|
|
64
|
+
cleanupElements(elmsToUpdate);
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
|
|
70
|
+
let states = new Map(Object.entries(defaultState !== null && defaultState !== void 0 ? defaultState : {}));
|
|
71
|
+
const handlers = {
|
|
72
|
+
dispose: [],
|
|
73
|
+
get: [],
|
|
74
|
+
set: [],
|
|
75
|
+
reset: [],
|
|
76
|
+
};
|
|
77
|
+
const reset = () => {
|
|
78
|
+
states = new Map(Object.entries(defaultState !== null && defaultState !== void 0 ? defaultState : {}));
|
|
79
|
+
handlers.reset.forEach((cb) => cb());
|
|
80
|
+
};
|
|
81
|
+
const dispose = () => {
|
|
82
|
+
// Call first dispose as resetting the state would
|
|
83
|
+
// cause less updates ;)
|
|
84
|
+
handlers.dispose.forEach((cb) => cb());
|
|
85
|
+
reset();
|
|
86
|
+
};
|
|
87
|
+
const get = (propName) => {
|
|
88
|
+
handlers.get.forEach((cb) => cb(propName));
|
|
89
|
+
return states.get(propName);
|
|
90
|
+
};
|
|
91
|
+
const set = (propName, value) => {
|
|
92
|
+
const oldValue = states.get(propName);
|
|
93
|
+
if (shouldUpdate(value, oldValue, propName)) {
|
|
94
|
+
states.set(propName, value);
|
|
95
|
+
handlers.set.forEach((cb) => cb(propName, value, oldValue));
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
const state = (typeof Proxy === 'undefined'
|
|
99
|
+
? {}
|
|
100
|
+
: new Proxy(defaultState, {
|
|
101
|
+
get(_, propName) {
|
|
102
|
+
return get(propName);
|
|
103
|
+
},
|
|
104
|
+
ownKeys(_) {
|
|
105
|
+
return Array.from(states.keys());
|
|
106
|
+
},
|
|
107
|
+
getOwnPropertyDescriptor() {
|
|
108
|
+
return {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
configurable: true,
|
|
111
|
+
};
|
|
112
|
+
},
|
|
113
|
+
has(_, propName) {
|
|
114
|
+
return states.has(propName);
|
|
115
|
+
},
|
|
116
|
+
set(_, propName, value) {
|
|
117
|
+
set(propName, value);
|
|
118
|
+
return true;
|
|
119
|
+
},
|
|
120
|
+
}));
|
|
121
|
+
const on = (eventName, callback) => {
|
|
122
|
+
handlers[eventName].push(callback);
|
|
123
|
+
return () => {
|
|
124
|
+
removeFromArray(handlers[eventName], callback);
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
const onChange = (propName, cb) => {
|
|
128
|
+
const unSet = on('set', (key, newValue) => {
|
|
129
|
+
if (key === propName) {
|
|
130
|
+
cb(newValue);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
const unReset = on('reset', () => cb(defaultState[propName]));
|
|
134
|
+
return () => {
|
|
135
|
+
unSet();
|
|
136
|
+
unReset();
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
const use = (...subscriptions) => {
|
|
140
|
+
const unsubs = subscriptions.reduce((unsubs, subscription) => {
|
|
141
|
+
if (subscription.set) {
|
|
142
|
+
unsubs.push(on('set', subscription.set));
|
|
143
|
+
}
|
|
144
|
+
if (subscription.get) {
|
|
145
|
+
unsubs.push(on('get', subscription.get));
|
|
146
|
+
}
|
|
147
|
+
if (subscription.reset) {
|
|
148
|
+
unsubs.push(on('reset', subscription.reset));
|
|
149
|
+
}
|
|
150
|
+
if (subscription.dispose) {
|
|
151
|
+
unsubs.push(on('dispose', subscription.dispose));
|
|
152
|
+
}
|
|
153
|
+
return unsubs;
|
|
154
|
+
}, []);
|
|
155
|
+
return () => unsubs.forEach((unsub) => unsub());
|
|
156
|
+
};
|
|
157
|
+
const forceUpdate = (key) => {
|
|
158
|
+
const oldValue = states.get(key);
|
|
159
|
+
handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
|
|
160
|
+
};
|
|
161
|
+
return {
|
|
162
|
+
state,
|
|
163
|
+
get,
|
|
164
|
+
set,
|
|
165
|
+
on,
|
|
166
|
+
onChange,
|
|
167
|
+
use,
|
|
168
|
+
dispose,
|
|
169
|
+
reset,
|
|
170
|
+
forceUpdate,
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
const removeFromArray = (array, item) => {
|
|
174
|
+
const index = array.indexOf(item);
|
|
175
|
+
if (index >= 0) {
|
|
176
|
+
array[index] = array[array.length - 1];
|
|
177
|
+
array.length--;
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
const createStore = (defaultState, shouldUpdate) => {
|
|
182
|
+
const map = createObservableMap(defaultState, shouldUpdate);
|
|
183
|
+
map.use(stencilSubscription());
|
|
184
|
+
return map;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
export { createStore as c };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface PnAppBanner extends Components.PnAppBanner, HTMLElement {}
|
|
4
|
+
export const PnAppBanner: {
|
|
5
|
+
prototype: PnAppBanner;
|
|
6
|
+
new (): PnAppBanner;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|