@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,68 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const pnAppBannerCss = "pn-app-banner .pn-app-banner__wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-align:center;align-items:center;gap:1rem;background-color:#F3F2F2;padding:1rem;margin:0 auto}pn-app-banner .pn-app-banner__sticky{position:relative;top:0;width:100%;z-index:999}pn-app-banner .icon-close:hover{cursor:pointer}pn-app-banner .pn-app-banner__icon{height:3.2rem}pn-app-banner .pn-app-banner__text{font-size:1.2rem;line-height:1}pn-app-banner .pn-app-banner__text span{font-weight:600}pn-app-banner .pn-app-banner__cta{margin-left:auto}pn-app-banner[data-is-closed=true]{display:none}";
|
|
4
|
+
|
|
5
|
+
const PnAppBanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.handleOnClose = () => {
|
|
10
|
+
this.isClosed = true;
|
|
11
|
+
};
|
|
12
|
+
this.appName = undefined;
|
|
13
|
+
this.appDescription = undefined;
|
|
14
|
+
this.ctaText = undefined;
|
|
15
|
+
this.appleStoreLink = undefined;
|
|
16
|
+
this.googleStoreLink = undefined;
|
|
17
|
+
this.isClosed = false;
|
|
18
|
+
this.storeLink = undefined;
|
|
19
|
+
}
|
|
20
|
+
detectDeviceAndSetStoreLink() {
|
|
21
|
+
const userAgent = navigator.userAgent;
|
|
22
|
+
if (userAgent.match(/Android/i)) {
|
|
23
|
+
this.storeLink = this.googleStoreLink;
|
|
24
|
+
}
|
|
25
|
+
else if (userAgent.match(/iPhone|iPad|iPod/i)) {
|
|
26
|
+
this.storeLink = this.appleStoreLink;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
this.storeLink = null;
|
|
30
|
+
this.isClosed = true; // -> data-is-closed = true
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
componentWillLoad() {
|
|
34
|
+
this.detectDeviceAndSetStoreLink();
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
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)))));
|
|
38
|
+
}
|
|
39
|
+
get hostElement() { return this; }
|
|
40
|
+
static get style() { return pnAppBannerCss; }
|
|
41
|
+
}, [0, "pn-app-banner", {
|
|
42
|
+
"appName": [1, "app-name"],
|
|
43
|
+
"appDescription": [1, "app-description"],
|
|
44
|
+
"ctaText": [1, "cta-text"],
|
|
45
|
+
"appleStoreLink": [1, "apple-store-link"],
|
|
46
|
+
"googleStoreLink": [1, "google-store-link"],
|
|
47
|
+
"isClosed": [32],
|
|
48
|
+
"storeLink": [32]
|
|
49
|
+
}]);
|
|
50
|
+
function defineCustomElement$1() {
|
|
51
|
+
if (typeof customElements === "undefined") {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const components = ["pn-app-banner"];
|
|
55
|
+
components.forEach(tagName => { switch (tagName) {
|
|
56
|
+
case "pn-app-banner":
|
|
57
|
+
if (!customElements.get(tagName)) {
|
|
58
|
+
customElements.define(tagName, PnAppBanner$1);
|
|
59
|
+
}
|
|
60
|
+
break;
|
|
61
|
+
} });
|
|
62
|
+
}
|
|
63
|
+
defineCustomElement$1();
|
|
64
|
+
|
|
65
|
+
const PnAppBanner = PnAppBanner$1;
|
|
66
|
+
const defineCustomElement = defineCustomElement$1;
|
|
67
|
+
|
|
68
|
+
export { PnAppBanner, defineCustomElement };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
|
-
const pnDateAndTimeCss = "pn-date-and-time label{color:#5E554A;font-size:1.4rem}pn-date-and-time .time-separator{margin:auto}pn-date-and-time .date-and-time-group{margin-bottom:1rem}pn-date-and-time .date-and-time-row{display:-ms-flexbox;display:flex;gap:1rem}pn-date-and-time .helper-text{margin-top:0.2rem;color:#5E554A;display:block}pn-date-and-time .error-message{color:#a70707}";
|
|
3
|
+
const pnDateAndTimeCss = "pn-date-and-time label{color:#5E554A;font-size:1.4rem}pn-date-and-time .time-separator{margin-top:auto;margin-bottom:auto}pn-date-and-time .date-and-time-group{margin-bottom:1rem}pn-date-and-time .date-and-time-row{display:-ms-flexbox;display:flex;gap:1rem}pn-date-and-time .helper-text{margin-top:0.2rem;color:#5E554A;display:block}pn-date-and-time .error-message{color:#a70707}";
|
|
4
4
|
|
|
5
5
|
const PnDateAndTime$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
6
|
constructor() {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface PnDropdownChoiceAddsRow extends Components.PnDropdownChoiceAddsRow, HTMLElement {}
|
|
4
|
+
export const PnDropdownChoiceAddsRow: {
|
|
5
|
+
prototype: PnDropdownChoiceAddsRow;
|
|
6
|
+
new (): PnDropdownChoiceAddsRow;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as debounce_1 } from './index3.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './pn-marketweb-input2.js';
|
|
4
|
+
|
|
5
|
+
const pnDropdownChoiceAddsRowCss = "pn-dropdown-choice-adds-row{gap:1rem}pn-dropdown-choice-adds-row .dropdown-choice-form-row{display:-ms-flexbox;display:flex;gap:1rem}pn-dropdown-choice-adds-row .pn-row-select-dropdown{width:50%;margin-bottom:1rem}@media only screen and (max-width: 640px){pn-dropdown-choice-adds-row .pn-row-select-dropdown{width:100%}}pn-dropdown-choice-adds-row .pn-dropdown-choice-table{width:100%;border-spacing:0rem}pn-dropdown-choice-adds-row .pn-dropdown-choice-table thead th{text-align:left;padding:1rem 0.5rem}pn-dropdown-choice-adds-row .pn-dropdown-choice-table thead th label{color:#5E554A;font-size:1.4rem;font-weight:400}pn-dropdown-choice-adds-row .pn-dropdown-choice-table thead .table-header--name{width:40%}pn-dropdown-choice-adds-row .pn-dropdown-choice-table thead .table-header--dropdown{width:40%}pn-dropdown-choice-adds-row .pn-dropdown-choice-table thead .table-header--input{width:10%}pn-dropdown-choice-adds-row .pn-dropdown-choice-table thead .table-header--delete{width:10%}pn-dropdown-choice-adds-row .pn-dropdown-choice-table tbody td{padding:0.5rem}pn-dropdown-choice-adds-row .pn-dropdown-choice-table tbody tr:nth-child(even){background-color:#effbff}pn-dropdown-choice-adds-row .pn-dropdown-choice-table tbody .tr-delete{text-align:center}pn-dropdown-choice-adds-row .pn-dropdown-choice-table tfoot td small{color:#A70707;vertical-align:middle}pn-dropdown-choice-adds-row .pn-dropdown-choice-table tfoot td pn-icon{margin-right:0.25em;vertical-align:middle}";
|
|
6
|
+
|
|
7
|
+
const pnDropdownChoiceAddsRow = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.rowvalues = createEvent(this, "rowvalues", 7);
|
|
12
|
+
this.pnRowSelectDropdown = null;
|
|
13
|
+
this.tableHead = null;
|
|
14
|
+
this.tableBody = null;
|
|
15
|
+
this.formRowEvent = e => {
|
|
16
|
+
var _a;
|
|
17
|
+
const debouncedAddValue = debounce_1.debounce(this.updateHiddenFieldValue.bind(this), 500);
|
|
18
|
+
if (e.target.matches('input')) {
|
|
19
|
+
['change', 'keyup'].forEach(eventName => {
|
|
20
|
+
e.target.addEventListener(eventName, debouncedAddValue);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const rowDropdown = (_a = e.target.closest('.generated-table-row')) === null || _a === void 0 ? void 0 : _a.querySelector('pn-select');
|
|
25
|
+
if (rowDropdown) {
|
|
26
|
+
rowDropdown.addEventListener('selectchange', debouncedAddValue);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
this.dropdownData = null;
|
|
31
|
+
this.addRowDropdownName = '';
|
|
32
|
+
this.addRowDropdownPlaceholder = '';
|
|
33
|
+
this.addRowDropdownLabel = '';
|
|
34
|
+
this.rowNameLabel = '';
|
|
35
|
+
this.rowHasDropdown = true;
|
|
36
|
+
this.rowDropdownLabel = '';
|
|
37
|
+
this.rowDropdownPlaceholder = '';
|
|
38
|
+
this.rowInputLabel = '';
|
|
39
|
+
this.rowDeleteButtonText = '';
|
|
40
|
+
this.totalInputLimit = 0;
|
|
41
|
+
this.inputLimitWarning = null;
|
|
42
|
+
this.nextRowIndex = null;
|
|
43
|
+
this.rowSelectDropdownArr = null;
|
|
44
|
+
this.columnCount = null;
|
|
45
|
+
this.showWarning = false;
|
|
46
|
+
this.formValue = null;
|
|
47
|
+
}
|
|
48
|
+
dropdownDataWatcher() {
|
|
49
|
+
if (typeof this.dropdownData === 'string') {
|
|
50
|
+
this._dropdownData = JSON.parse(this.dropdownData);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
this._dropdownData = this.dropdownData;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
componentWillLoad() {
|
|
57
|
+
this.dropdownDataWatcher();
|
|
58
|
+
}
|
|
59
|
+
componentDidLoad() {
|
|
60
|
+
this.setInitialValues();
|
|
61
|
+
this.addEventHandlers();
|
|
62
|
+
}
|
|
63
|
+
addEventHandlers() {
|
|
64
|
+
this.pnRowSelectDropdown.addEventListener('selectchange', this.addRowElement.bind(this));
|
|
65
|
+
}
|
|
66
|
+
setInitialValues() {
|
|
67
|
+
this.nextRowIndex = 0;
|
|
68
|
+
this.columnCount = this.rowHasDropdown ? 4 : 3;
|
|
69
|
+
this.setRowSelectDropdownArr();
|
|
70
|
+
}
|
|
71
|
+
setRowSelectDropdownArr() {
|
|
72
|
+
this.rowSelectDropdownArr = [];
|
|
73
|
+
this._dropdownData.forEach(element => {
|
|
74
|
+
this.rowSelectDropdownArr.push(element.caption);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
updateHiddenFieldValue() {
|
|
78
|
+
const allRows = [...this.tableBody.querySelectorAll('tr')];
|
|
79
|
+
const columnValueCount = this.rowHasDropdown ? 3 : 2;
|
|
80
|
+
const formValues = [];
|
|
81
|
+
if (allRows.length) {
|
|
82
|
+
allRows.forEach(elm => {
|
|
83
|
+
var _a, _b, _c;
|
|
84
|
+
const row = { row: [] };
|
|
85
|
+
const nameElm = elm.querySelector('.tr-name');
|
|
86
|
+
const dropdownElm = elm.querySelector('.tr-dropdown');
|
|
87
|
+
const inputElm = elm.querySelector('.tr-input');
|
|
88
|
+
const nameValue = { name: this.rowNameLabel, value: nameElm === null || nameElm === void 0 ? void 0 : nameElm.innerHTML };
|
|
89
|
+
row.row.push(nameValue);
|
|
90
|
+
const dropdown = dropdownElm.querySelector('.current-selection');
|
|
91
|
+
if (dropdown) {
|
|
92
|
+
const dropdownSelection = (_a = dropdown.textContent) !== null && _a !== void 0 ? _a : '';
|
|
93
|
+
if (dropdownSelection.length) {
|
|
94
|
+
const dropdownValue = {
|
|
95
|
+
name: this.rowDropdownLabel,
|
|
96
|
+
value: dropdownSelection,
|
|
97
|
+
};
|
|
98
|
+
row.row.push(dropdownValue);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (!dropdown && columnValueCount === 3) {
|
|
102
|
+
const dropdownValue = {
|
|
103
|
+
name: this.rowDropdownLabel,
|
|
104
|
+
value: '',
|
|
105
|
+
};
|
|
106
|
+
row.row.push(dropdownValue);
|
|
107
|
+
}
|
|
108
|
+
const inputValue = parseInt((_c = (_b = inputElm.querySelector('input')) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : '0');
|
|
109
|
+
if (inputValue > 0) {
|
|
110
|
+
const inputColumnValue = { name: this.rowInputLabel, value: inputValue.toString() };
|
|
111
|
+
row.row.push(inputColumnValue);
|
|
112
|
+
}
|
|
113
|
+
if (row.row.length === columnValueCount) {
|
|
114
|
+
formValues.push(row);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
if (formValues.length && formValues.length === allRows.length) {
|
|
119
|
+
const valueJsonString = JSON.stringify(formValues);
|
|
120
|
+
this.formValue = `PN-JSON|${valueJsonString}`;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
this.formValue = '';
|
|
124
|
+
}
|
|
125
|
+
this.rowvalues.emit(this.formValue);
|
|
126
|
+
this.checkInputTotal();
|
|
127
|
+
}
|
|
128
|
+
addRowElement() {
|
|
129
|
+
const selected = this.pnRowSelectDropdown.querySelector('.current-selection .pn-option-content');
|
|
130
|
+
const selectedValue = selected === null || selected === void 0 ? void 0 : selected.textContent;
|
|
131
|
+
const slotElm = this.tableBody;
|
|
132
|
+
const newRow = document.createElement('tr');
|
|
133
|
+
newRow.setAttribute('index', `${this.nextRowIndex}`);
|
|
134
|
+
newRow.setAttribute('class', 'generated-table-row');
|
|
135
|
+
newRow.onclick = e => this.formRowEvent(e);
|
|
136
|
+
const rowNameColumn = document.createElement('td');
|
|
137
|
+
rowNameColumn.setAttribute('class', 'tr-name');
|
|
138
|
+
rowNameColumn.innerHTML = selectedValue;
|
|
139
|
+
newRow.appendChild(rowNameColumn);
|
|
140
|
+
if (this.rowHasDropdown) {
|
|
141
|
+
const rowDropdownColumn = this.createDropdownColumn(selectedValue);
|
|
142
|
+
newRow.appendChild(rowDropdownColumn);
|
|
143
|
+
}
|
|
144
|
+
const rowInputColumn = this.createInputColumn(selectedValue);
|
|
145
|
+
newRow.appendChild(rowInputColumn);
|
|
146
|
+
const deleteButton = this.createDeleteButtonColumn();
|
|
147
|
+
newRow.appendChild(deleteButton);
|
|
148
|
+
slotElm.appendChild(newRow);
|
|
149
|
+
this.updateRowSelectDropdown();
|
|
150
|
+
this.nextRowIndex++;
|
|
151
|
+
}
|
|
152
|
+
createDropdownColumn(selectedValue) {
|
|
153
|
+
const dropdownColumn = document.createElement('td');
|
|
154
|
+
dropdownColumn.setAttribute('class', 'tr-dropdown');
|
|
155
|
+
const selectedItem = this._dropdownData.find(arr => arr.caption === selectedValue);
|
|
156
|
+
if (Array.isArray(selectedItem.values) && selectedItem.values.length) {
|
|
157
|
+
const dropdown = document.createElement('pn-select');
|
|
158
|
+
dropdown.setAttribute('name', `${selectedValue}-dropdown`);
|
|
159
|
+
dropdown.setAttribute('placeholder', this.rowDropdownPlaceholder);
|
|
160
|
+
selectedItem.values.forEach(childItem => {
|
|
161
|
+
const childOption = document.createElement('pn-option');
|
|
162
|
+
childOption.innerHTML = childItem.caption;
|
|
163
|
+
dropdown.appendChild(childOption);
|
|
164
|
+
});
|
|
165
|
+
dropdownColumn.appendChild(dropdown);
|
|
166
|
+
}
|
|
167
|
+
return dropdownColumn;
|
|
168
|
+
}
|
|
169
|
+
createInputColumn(selectedValue) {
|
|
170
|
+
const inputColumn = document.createElement('td');
|
|
171
|
+
inputColumn.setAttribute('class', 'tr-input');
|
|
172
|
+
const inputElm = document.createElement('pn-marketweb-input');
|
|
173
|
+
inputElm.setAttribute('type', 'number');
|
|
174
|
+
inputElm.setAttribute('name', `${selectedValue}-input`);
|
|
175
|
+
inputElm.setAttribute('placeholder', '0');
|
|
176
|
+
inputColumn.appendChild(inputElm);
|
|
177
|
+
return inputColumn;
|
|
178
|
+
}
|
|
179
|
+
createDeleteButtonColumn() {
|
|
180
|
+
const buttonColumn = document.createElement('td');
|
|
181
|
+
buttonColumn.setAttribute('class', 'tr-delete');
|
|
182
|
+
const buttonElm = document.createElement('pn-button');
|
|
183
|
+
buttonElm.onclick = e => this.deleteRow(e);
|
|
184
|
+
buttonElm.setAttribute('appearance', 'warning');
|
|
185
|
+
buttonElm.setAttribute('small', 'true');
|
|
186
|
+
buttonElm.appendChild(document.createTextNode(this.rowDeleteButtonText));
|
|
187
|
+
buttonColumn.appendChild(buttonElm);
|
|
188
|
+
return buttonColumn;
|
|
189
|
+
}
|
|
190
|
+
updateRowSelectDropdown() {
|
|
191
|
+
const rowNames = [].map.call(this.tableBody.querySelectorAll('.tr-name'), el => {
|
|
192
|
+
return el.innerHTML;
|
|
193
|
+
});
|
|
194
|
+
if (rowNames.length) {
|
|
195
|
+
this.rowSelectDropdownArr = [];
|
|
196
|
+
this._dropdownData.forEach(element => {
|
|
197
|
+
if (!rowNames.includes(element.caption)) {
|
|
198
|
+
this.rowSelectDropdownArr.push(element.caption);
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
this.setRowSelectDropdownArr();
|
|
204
|
+
}
|
|
205
|
+
const selectOptions = this.pnRowSelectDropdown.querySelectorAll('pn-option');
|
|
206
|
+
selectOptions.forEach(elm => {
|
|
207
|
+
elm.removeAttribute('selected');
|
|
208
|
+
});
|
|
209
|
+
const placeholder = this.pnRowSelectDropdown.querySelector('.pn-option-content');
|
|
210
|
+
placeholder.innerHTML = this.addRowDropdownPlaceholder;
|
|
211
|
+
this.updateHiddenFieldValue();
|
|
212
|
+
}
|
|
213
|
+
deleteRow(e) {
|
|
214
|
+
e.preventDefault();
|
|
215
|
+
this.nextRowIndex--;
|
|
216
|
+
const targetElm = e.currentTarget;
|
|
217
|
+
const targetRow = targetElm.closest('tr');
|
|
218
|
+
targetRow.remove();
|
|
219
|
+
const allRows = [...this.tableBody.querySelectorAll('tr')];
|
|
220
|
+
allRows.map((elm, index) => {
|
|
221
|
+
elm.setAttribute('index', `${index}`);
|
|
222
|
+
});
|
|
223
|
+
this.updateRowSelectDropdown();
|
|
224
|
+
}
|
|
225
|
+
checkInputTotal() {
|
|
226
|
+
const allRows = this.tableBody.querySelectorAll('tr');
|
|
227
|
+
if (this.totalInputLimit === 0 || allRows.length < 1) {
|
|
228
|
+
this.showWarning = false;
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
let totalInput = 0;
|
|
232
|
+
allRows.forEach(element => {
|
|
233
|
+
var _a;
|
|
234
|
+
const inputField = element.querySelector('pn-marketweb-input');
|
|
235
|
+
if (inputField.value) {
|
|
236
|
+
totalInput += (_a = parseInt(inputField.value)) !== null && _a !== void 0 ? _a : 0;
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
this.showWarning = totalInput > this.totalInputLimit ? true : false;
|
|
240
|
+
}
|
|
241
|
+
render() {
|
|
242
|
+
var _a;
|
|
243
|
+
return (h(Host, null, h("div", { class: "dropdown-choice-form-row" }, h("pn-select", { ref: el => (this.pnRowSelectDropdown = el), name: this.addRowDropdownName, placeholder: this.addRowDropdownPlaceholder, label: this.addRowDropdownLabel, class: "pn-row-select-dropdown" }, (_a = this.rowSelectDropdownArr) === null || _a === void 0 ? void 0 : _a.map((value) => (h("pn-option", null, value))))), h("div", { class: "dropdown-choice-form-row" }, h("table", { class: "pn-dropdown-choice-table" }, h("thead", { ref: el => (this.tableHead = el) }, this.nextRowIndex === 0 ? null : (h("tr", null, h("th", { class: "table-header--name" }, h("label", null, this.rowNameLabel)), this.rowHasDropdown ? (h("th", { class: "table-header--dropdown" }, h("label", null, this.rowDropdownLabel))) : null, h("th", { class: "table-header--input" }, h("label", null, this.rowInputLabel)), h("th", { class: "table-header--delete" })))), h("tbody", { ref: el => (this.tableBody = el), class: "pn-dropdown-choice-table-slot" }, h("slot", null)), h("tfoot", null, this.showWarning ? (h("tr", null, h("td", { colSpan: this.columnCount }, h("pn-icon", { symbol: "alert-exclamation-circle", small: true, color: "warning" }), h("small", { class: "dropdown-choice-error-message" }, this.inputLimitWarning)))) : null)))));
|
|
244
|
+
}
|
|
245
|
+
get hostElement() { return this; }
|
|
246
|
+
static get watchers() { return {
|
|
247
|
+
"dropdownData": ["dropdownDataWatcher"]
|
|
248
|
+
}; }
|
|
249
|
+
static get style() { return pnDropdownChoiceAddsRowCss; }
|
|
250
|
+
}, [4, "pn-dropdown-choice-adds-row", {
|
|
251
|
+
"dropdownData": [1, "dropdown-data"],
|
|
252
|
+
"addRowDropdownName": [1, "add-row-dropdown-name"],
|
|
253
|
+
"addRowDropdownPlaceholder": [1, "add-row-dropdown-placeholder"],
|
|
254
|
+
"addRowDropdownLabel": [1, "add-row-dropdown-label"],
|
|
255
|
+
"rowNameLabel": [1, "row-name-label"],
|
|
256
|
+
"rowHasDropdown": [4, "row-has-dropdown"],
|
|
257
|
+
"rowDropdownLabel": [1, "row-dropdown-label"],
|
|
258
|
+
"rowDropdownPlaceholder": [1, "row-dropdown-placeholder"],
|
|
259
|
+
"rowInputLabel": [1, "row-input-label"],
|
|
260
|
+
"rowDeleteButtonText": [1, "row-delete-button-text"],
|
|
261
|
+
"totalInputLimit": [2, "total-input-limit"],
|
|
262
|
+
"inputLimitWarning": [1, "input-limit-warning"],
|
|
263
|
+
"nextRowIndex": [32],
|
|
264
|
+
"rowSelectDropdownArr": [32],
|
|
265
|
+
"columnCount": [32],
|
|
266
|
+
"showWarning": [32],
|
|
267
|
+
"formValue": [32]
|
|
268
|
+
}]);
|
|
269
|
+
function defineCustomElement$1() {
|
|
270
|
+
if (typeof customElements === "undefined") {
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
const components = ["pn-dropdown-choice-adds-row", "pn-marketweb-input"];
|
|
274
|
+
components.forEach(tagName => { switch (tagName) {
|
|
275
|
+
case "pn-dropdown-choice-adds-row":
|
|
276
|
+
if (!customElements.get(tagName)) {
|
|
277
|
+
customElements.define(tagName, pnDropdownChoiceAddsRow);
|
|
278
|
+
}
|
|
279
|
+
break;
|
|
280
|
+
case "pn-marketweb-input":
|
|
281
|
+
if (!customElements.get(tagName)) {
|
|
282
|
+
defineCustomElement$2();
|
|
283
|
+
}
|
|
284
|
+
break;
|
|
285
|
+
} });
|
|
286
|
+
}
|
|
287
|
+
defineCustomElement$1();
|
|
288
|
+
|
|
289
|
+
const PnDropdownChoiceAddsRow = pnDropdownChoiceAddsRow;
|
|
290
|
+
const defineCustomElement = defineCustomElement$1;
|
|
291
|
+
|
|
292
|
+
export { PnDropdownChoiceAddsRow, defineCustomElement };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { c as createStore } from './
|
|
2
|
+
import { c as createStore } from './index4.js';
|
|
3
3
|
import { d as defineCustomElement$4 } from './pn-product-card2.js';
|
|
4
4
|
import { d as defineCustomElement$3 } from './pn-product-card-info2.js';
|
|
5
5
|
import { d as defineCustomElement$2 } from './pn-product-card-price2.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { c as createStore } from './
|
|
2
|
+
import { c as createStore } from './index4.js';
|
|
3
3
|
import { d as defineCustomElement$3 } from './pn-product-card2.js';
|
|
4
4
|
import { d as defineCustomElement$2 } from './pn-product-tile-info2.js';
|
|
5
5
|
import { d as defineCustomElement$1 } from './pn-product-tile-price2.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { c as createStore } from './
|
|
2
|
+
import { c as createStore } from './index4.js';
|
|
3
3
|
|
|
4
4
|
// Read more about how stencil stores work here: https://stenciljs.com/docs/stencil-store
|
|
5
5
|
const { state, onChange } = createStore({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { c as createStore } from './
|
|
2
|
+
import { c as createStore } from './index4.js';
|
|
3
3
|
|
|
4
4
|
// Read more about how stencil stores work here: https://stenciljs.com/docs/stencil-store
|
|
5
5
|
const { state, onChange } = createStore({
|
|
@@ -1,75 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as debounce_1 } from './index3.js';
|
|
2
3
|
import { v as v4 } from './v4.js';
|
|
3
4
|
|
|
4
|
-
/**
|
|
5
|
-
* Returns a function, that, as long as it continues to be invoked, will not
|
|
6
|
-
* be triggered. The function will be called after it stops being called for
|
|
7
|
-
* N milliseconds. If `immediate` is passed, trigger the function on the
|
|
8
|
-
* leading edge, instead of the trailing. The function also has a property 'clear'
|
|
9
|
-
* that is a function which will clear the timer to prevent previously scheduled executions.
|
|
10
|
-
*
|
|
11
|
-
* @source underscore.js
|
|
12
|
-
* @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/
|
|
13
|
-
* @param {Function} function to wrap
|
|
14
|
-
* @param {Number} timeout in ms (`100`)
|
|
15
|
-
* @param {Boolean} whether to execute at the beginning (`false`)
|
|
16
|
-
* @api public
|
|
17
|
-
*/
|
|
18
|
-
function debounce(func, wait, immediate){
|
|
19
|
-
var timeout, args, context, timestamp, result;
|
|
20
|
-
if (null == wait) wait = 100;
|
|
21
|
-
|
|
22
|
-
function later() {
|
|
23
|
-
var last = Date.now() - timestamp;
|
|
24
|
-
|
|
25
|
-
if (last < wait && last >= 0) {
|
|
26
|
-
timeout = setTimeout(later, wait - last);
|
|
27
|
-
} else {
|
|
28
|
-
timeout = null;
|
|
29
|
-
if (!immediate) {
|
|
30
|
-
result = func.apply(context, args);
|
|
31
|
-
context = args = null;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
var debounced = function(){
|
|
36
|
-
context = this;
|
|
37
|
-
args = arguments;
|
|
38
|
-
timestamp = Date.now();
|
|
39
|
-
var callNow = immediate && !timeout;
|
|
40
|
-
if (!timeout) timeout = setTimeout(later, wait);
|
|
41
|
-
if (callNow) {
|
|
42
|
-
result = func.apply(context, args);
|
|
43
|
-
context = args = null;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return result;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
debounced.clear = function() {
|
|
50
|
-
if (timeout) {
|
|
51
|
-
clearTimeout(timeout);
|
|
52
|
-
timeout = null;
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
debounced.flush = function() {
|
|
57
|
-
if (timeout) {
|
|
58
|
-
result = func.apply(context, args);
|
|
59
|
-
context = args = null;
|
|
60
|
-
|
|
61
|
-
clearTimeout(timeout);
|
|
62
|
-
timeout = null;
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
return debounced;
|
|
67
|
-
}
|
|
68
|
-
// Adds compatibility for ES modules
|
|
69
|
-
debounce.debounce = debounce;
|
|
70
|
-
|
|
71
|
-
var debounce_1 = debounce;
|
|
72
|
-
|
|
73
5
|
const pnMultiFormfieldCss = ".pn-multi-formfield{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}";
|
|
74
6
|
|
|
75
7
|
const PnMultiFormField = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { c as createStore } from './
|
|
2
|
+
import { c as createStore } from './index4.js';
|
|
3
3
|
import { s as sendDirectUrl, a as stampShopUrl } from './data.js';
|
|
4
4
|
import { d as defineCustomElement$5 } from './pn-product-card2.js';
|
|
5
5
|
import { d as defineCustomElement$4 } from './pn-product-card-info2.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { F as FetchHelper, M as MarketWebContextService } from './MarketWebContextService.js';
|
|
3
|
-
import { c as createStore } from './
|
|
3
|
+
import { c as createStore } from './index4.js';
|
|
4
4
|
import { d as defineCustomElement$8 } from './pn-choice-button2.js';
|
|
5
5
|
import { d as defineCustomElement$7 } from './pn-proxio-findprice-result2.js';
|
|
6
6
|
import { d as defineCustomElement$6 } from './pn-proxio-productcard2.js';
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
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.
|
|
7
|
+
*
|
|
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
|
|
14
|
+
*/
|
|
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
|
+
}
|
|
30
|
+
}
|
|
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;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
debounced.clear = function() {
|
|
47
|
+
if (timeout) {
|
|
48
|
+
clearTimeout(timeout);
|
|
49
|
+
timeout = null;
|
|
50
|
+
}
|
|
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;
|
|
67
|
+
|
|
68
|
+
var debounce_1 = debounce;
|
|
69
|
+
|
|
70
|
+
export { debounce_1 as d };
|
package/esm/index-ee44c065.js
CHANGED
|
@@ -2105,6 +2105,10 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
2105
2105
|
return import(
|
|
2106
2106
|
/* webpackMode: "lazy" */
|
|
2107
2107
|
'./pn-animated-tile.entry.js').then(processMod, consoleError);
|
|
2108
|
+
case 'pn-app-banner':
|
|
2109
|
+
return import(
|
|
2110
|
+
/* webpackMode: "lazy" */
|
|
2111
|
+
'./pn-app-banner.entry.js').then(processMod, consoleError);
|
|
2108
2112
|
case 'pn-bonus-progressbar':
|
|
2109
2113
|
return import(
|
|
2110
2114
|
/* webpackMode: "lazy" */
|
|
@@ -2137,6 +2141,10 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
2137
2141
|
return import(
|
|
2138
2142
|
/* webpackMode: "lazy" */
|
|
2139
2143
|
'./pn-date-and-time.entry.js').then(processMod, consoleError);
|
|
2144
|
+
case 'pn-dropdown-choice-adds-row':
|
|
2145
|
+
return import(
|
|
2146
|
+
/* webpackMode: "lazy" */
|
|
2147
|
+
'./pn-dropdown-choice-adds-row.entry.js').then(processMod, consoleError);
|
|
2140
2148
|
case 'pn-filter-checkbox':
|
|
2141
2149
|
return import(
|
|
2142
2150
|
/* webpackMode: "lazy" */
|
|
@@ -2301,10 +2309,6 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
2301
2309
|
return import(
|
|
2302
2310
|
/* webpackMode: "lazy" */
|
|
2303
2311
|
'./pn-mainnav-link.entry.js').then(processMod, consoleError);
|
|
2304
|
-
case 'pn-marketweb-input':
|
|
2305
|
-
return import(
|
|
2306
|
-
/* webpackMode: "lazy" */
|
|
2307
|
-
'./pn-marketweb-input.entry.js').then(processMod, consoleError);
|
|
2308
2312
|
case 'pn-marketweb-siteheader-login-button_5':
|
|
2309
2313
|
return import(
|
|
2310
2314
|
/* webpackMode: "lazy" */
|
|
@@ -2317,6 +2321,10 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
2317
2321
|
return import(
|
|
2318
2322
|
/* webpackMode: "lazy" */
|
|
2319
2323
|
'./pn-choice-button.entry.js').then(processMod, consoleError);
|
|
2324
|
+
case 'pn-marketweb-input':
|
|
2325
|
+
return import(
|
|
2326
|
+
/* webpackMode: "lazy" */
|
|
2327
|
+
'./pn-marketweb-input.entry.js').then(processMod, consoleError);
|
|
2320
2328
|
case 'pn-proxio-productcard_4':
|
|
2321
2329
|
return import(
|
|
2322
2330
|
/* webpackMode: "lazy" */
|