@postnord/pn-marketweb-components 2.4.21 → 2.4.22
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 +8 -4
- package/cjs/loader.cjs.js +1 -1
- package/cjs/pn-address-autofill.cjs.entry.js +322 -0
- package/cjs/pn-market-web-components.cjs.js +1 -1
- package/cjs/pn-marketweb-input.cjs.entry.js +36 -25
- package/cjs/pn-marketweb-sitefooter.cjs.entry.js +3 -3
- package/cjs/pn-marketweb-siteheader.cjs.entry.js +3 -3
- package/cjs/pn-proxio-findprice.cjs.entry.js +3 -3
- package/cjs/pn-proxio-pricegroup.cjs.entry.js +3 -3
- package/collection/collection-manifest.json +2 -1
- package/collection/components/input/pn-address-autofill/pn-address-autofill.css +45 -0
- package/collection/components/input/pn-address-autofill/pn-address-autofill.js +537 -0
- package/collection/components/input/pn-address-autofill/pn-address-autofill.stories.js +40 -0
- package/collection/components/input/pn-marketweb-input/pn-marketweb-input.js +50 -39
- package/collection/components/input/pn-multi-formfield/types.js +1 -0
- package/components/index.d.ts +2 -1
- package/components/index.js +1 -0
- package/components/index2.js +63 -52
- package/components/index3.js +52 -63
- package/components/pn-address-autofill.d.ts +11 -0
- package/components/pn-address-autofill.js +359 -0
- package/components/pn-animated-tile.js +1 -1
- package/components/pn-dropdown-choice-adds-row.js +1 -1
- package/components/pn-marketweb-input2.js +36 -25
- package/components/pn-marketweb-sitefooter.js +1 -1
- package/components/pn-marketweb-siteheader.js +1 -1
- package/components/pn-multi-formfield.js +1 -1
- package/components/pn-proxio-findprice.js +1 -1
- package/components/pn-proxio-pricegroup.js +1 -1
- package/components/pn-spotlight.js +1 -1
- package/esm/index-ee44c065.js +8 -4
- package/esm/loader.js +1 -1
- package/esm/pn-address-autofill.entry.js +318 -0
- package/esm/pn-market-web-components.js +1 -1
- package/esm/pn-marketweb-input.entry.js +36 -25
- package/esm/pn-marketweb-sitefooter.entry.js +1 -1
- package/esm/pn-marketweb-siteheader.entry.js +1 -1
- package/esm/pn-proxio-findprice.entry.js +1 -1
- package/esm/pn-proxio-pricegroup.entry.js +1 -1
- package/esm-es5/FetchHelper-62dc55bf.js +1 -0
- package/esm-es5/index-ee44c065.js +1 -1
- package/esm-es5/loader.js +1 -1
- package/esm-es5/pn-address-autofill.entry.js +1 -0
- package/esm-es5/pn-market-web-components.js +1 -1
- package/esm-es5/pn-marketweb-input.entry.js +1 -1
- package/esm-es5/pn-marketweb-sitefooter.entry.js +1 -1
- package/esm-es5/pn-marketweb-siteheader.entry.js +1 -1
- package/esm-es5/pn-proxio-findprice.entry.js +1 -1
- package/esm-es5/pn-proxio-pricegroup.entry.js +1 -1
- package/package.json +1 -1
- package/pn-market-web-components/{p-7e99f631.system.entry.js → p-18aca162.system.entry.js} +1 -1
- package/pn-market-web-components/{p-6e11edfe.entry.js → p-1b282c2b.entry.js} +1 -1
- package/pn-market-web-components/{p-3c38a67e.system.entry.js → p-256ba011.system.entry.js} +1 -1
- package/pn-market-web-components/{p-21bf0e64.system.entry.js → p-356a937e.system.entry.js} +1 -1
- package/pn-market-web-components/{p-1a8d7eb8.entry.js → p-372b4cad.entry.js} +1 -1
- package/{esm-es5/MarketWebContextService-f6a33f17.js → pn-market-web-components/p-439d5d73.system.js} +1 -1
- package/pn-market-web-components/p-4afba818.entry.js +1 -0
- package/pn-market-web-components/p-592b66fc.system.entry.js +1 -0
- package/pn-market-web-components/{p-1e5756b9.system.entry.js → p-89fcb948.system.entry.js} +1 -1
- package/pn-market-web-components/{p-5427a6ba.entry.js → p-90d2fb46.entry.js} +1 -1
- package/pn-market-web-components/p-9ad0ceb0.js +1 -0
- package/pn-market-web-components/p-b1527c0c.entry.js +1 -0
- package/pn-market-web-components/{p-0ae0b140.system.entry.js → p-c06e3588.system.entry.js} +1 -1
- package/pn-market-web-components/{p-9ae49b8a.entry.js → p-da9e05c0.entry.js} +1 -1
- 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-address-autofill/pn-address-autofill.d.ts +56 -0
- package/types/components/input/pn-address-autofill/types.d.ts +40 -0
- package/types/components.d.ts +50 -1
- package/pn-market-web-components/p-33322417.system.js +0 -1
- package/pn-market-web-components/p-5d21372b.js +0 -1
- package/pn-market-web-components/p-f0078106.entry.js +0 -1
- package/cjs/{MarketWebContextService-17053565.js → FetchHelper-2130dacf.js} +84 -84
- package/collection/components/{layout-components/pn-multi-formfield → input/pn-address-autofill}/types.js +0 -0
- package/collection/components/{layout-components → input}/pn-multi-formfield/multi-formfield.stories.js +0 -0
- package/collection/components/{layout-components → input}/pn-multi-formfield/pn-multi-formfield.css +0 -0
- package/collection/components/{layout-components → input}/pn-multi-formfield/pn-multi-formfield.js +0 -0
- package/components/{MarketWebContextService.js → FetchHelper.js} +84 -84
- package/esm/{MarketWebContextService-f6a33f17.js → FetchHelper-62dc55bf.js} +84 -84
- /package/types/components/{layout-components → input}/pn-multi-formfield/pn-multi-formfield.d.ts +0 -0
- /package/types/components/{layout-components → input}/pn-multi-formfield/types.d.ts +0 -0
|
@@ -2,23 +2,23 @@ import { h, Host } from "@stencil/core";
|
|
|
2
2
|
export class PnMarketwebInput {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.disabled = false;
|
|
5
|
-
this.error =
|
|
5
|
+
this.error = "";
|
|
6
6
|
this.invalid = false;
|
|
7
|
-
this.helpertext =
|
|
8
|
-
this.label =
|
|
9
|
-
this.placeholder =
|
|
7
|
+
this.helpertext = "";
|
|
8
|
+
this.label = "";
|
|
9
|
+
this.placeholder = "";
|
|
10
10
|
this.inputid = `${Math.random()}`;
|
|
11
|
-
this.name =
|
|
12
|
-
this.required =
|
|
13
|
-
this.type =
|
|
14
|
-
this.autocomplete =
|
|
11
|
+
this.name = "";
|
|
12
|
+
this.required = false;
|
|
13
|
+
this.type = "text";
|
|
14
|
+
this.autocomplete = "";
|
|
15
15
|
this.valid = null;
|
|
16
|
-
this.value =
|
|
17
|
-
this.maxlength =
|
|
18
|
-
this.min =
|
|
19
|
-
this.max =
|
|
20
|
-
this.step =
|
|
21
|
-
this.pattern =
|
|
16
|
+
this.value = "";
|
|
17
|
+
this.maxlength = "";
|
|
18
|
+
this.min = "";
|
|
19
|
+
this.max = "";
|
|
20
|
+
this.step = "";
|
|
21
|
+
this.pattern = "";
|
|
22
22
|
this.showText = false;
|
|
23
23
|
}
|
|
24
24
|
getTextMessage() {
|
|
@@ -32,8 +32,21 @@ export class PnMarketwebInput {
|
|
|
32
32
|
this.showText = !this.showText;
|
|
33
33
|
}
|
|
34
34
|
getInputType() {
|
|
35
|
-
let types = [
|
|
36
|
-
|
|
35
|
+
let types = [
|
|
36
|
+
"text",
|
|
37
|
+
"password",
|
|
38
|
+
"url",
|
|
39
|
+
"tel",
|
|
40
|
+
"search",
|
|
41
|
+
"number",
|
|
42
|
+
"email",
|
|
43
|
+
"date",
|
|
44
|
+
"datetime-local",
|
|
45
|
+
"month",
|
|
46
|
+
"week",
|
|
47
|
+
"time",
|
|
48
|
+
];
|
|
49
|
+
return types.includes(this.type) && !this.showText ? this.type : "text";
|
|
37
50
|
}
|
|
38
51
|
setVal(e) {
|
|
39
52
|
var _a;
|
|
@@ -41,21 +54,19 @@ export class PnMarketwebInput {
|
|
|
41
54
|
this.value = target.value;
|
|
42
55
|
}
|
|
43
56
|
getClassNames() {
|
|
44
|
-
let classNames =
|
|
57
|
+
let classNames = "pn-input ";
|
|
45
58
|
if (this.error.length > 0 || this.invalid)
|
|
46
|
-
classNames +=
|
|
59
|
+
classNames += "error ";
|
|
47
60
|
if (this.valid)
|
|
48
|
-
classNames +=
|
|
49
|
-
if (this.type ===
|
|
50
|
-
classNames +=
|
|
61
|
+
classNames += "valid ";
|
|
62
|
+
if (this.type === "password")
|
|
63
|
+
classNames += "password ";
|
|
51
64
|
if (this.error || this.invalid || this.valid)
|
|
52
|
-
classNames +=
|
|
65
|
+
classNames += "icon ";
|
|
53
66
|
return classNames;
|
|
54
67
|
}
|
|
55
68
|
render() {
|
|
56
|
-
return (h(Host, { class: this.getClassNames() }, (this.label || this.maxlength) &&
|
|
57
|
-
h("div", { class: "label-container" }, this.label && h("label", { htmlFor: this.inputid }, this.label), parseInt(this.maxlength) > 0 && h("label", { class: "char-count", htmlFor: this.inputid }, `${this.value.length}/${this.maxlength}`)), h("div", { class: "input-container" }, h("input", { type: this.getInputType(), value: this.value, id: this.inputid, name: this.name, placeholder: this.placeholder, disabled: this.disabled, autocomplete: this.autocomplete, onInput: (e) => this.setVal(e), maxlength: this.maxlength ? this.maxlength : null, min: (this.min ? this.min : null), max: (this.max ? this.max : null), step: (this.step ? this.step : null), pattern: (this.pattern ? this.pattern : null) }), h("svg", { class: "pn-input-checkmark", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none" }, h("polyline", { class: "checkmark-path", points: "4,12 9,17 20,6", "stroke-width": "3" })), this.type === 'password' && !this.disabled && h("button", { onClick: () => this.toggleTextVisibility() }, "Show")), this.getTextMessage() &&
|
|
58
|
-
h("small", null, this.error && h("pn-icon", { symbol: "alert-exclamation-circle", small: true, color: "warning" }), this.getTextMessage())));
|
|
69
|
+
return (h(Host, { class: this.getClassNames() }, (this.label || this.maxlength) && (h("div", { class: "label-container" }, this.label && h("label", { htmlFor: this.inputid }, this.label), parseInt(this.maxlength) > 0 && (h("label", { class: "char-count", htmlFor: this.inputid }, `${this.value.length}/${this.maxlength}`)))), h("div", { class: "input-container" }, h("input", { type: this.getInputType(), value: this.value, id: this.inputid, name: this.name, placeholder: this.placeholder, disabled: this.disabled, required: this.required, autocomplete: this.autocomplete, onInput: (e) => this.setVal(e), maxlength: this.maxlength ? this.maxlength : null, min: this.min ? this.min : null, max: this.max ? this.max : null, step: this.step ? this.step : null, pattern: this.pattern ? this.pattern : null }), h("svg", { class: "pn-input-checkmark", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none" }, h("polyline", { class: "checkmark-path", points: "4,12 9,17 20,6", "stroke-width": "3" })), this.type === "password" && !this.disabled && (h("button", { onClick: () => this.toggleTextVisibility() }, "Show"))), this.getTextMessage() && (h("small", null, this.error && h("pn-icon", { symbol: "alert-exclamation-circle", small: true, color: "warning" }), this.getTextMessage()))));
|
|
59
70
|
}
|
|
60
71
|
static get is() { return "pn-marketweb-input"; }
|
|
61
72
|
static get originalStyleUrls() {
|
|
@@ -104,7 +115,7 @@ export class PnMarketwebInput {
|
|
|
104
115
|
},
|
|
105
116
|
"attribute": "error",
|
|
106
117
|
"reflect": false,
|
|
107
|
-
"defaultValue": "
|
|
118
|
+
"defaultValue": "\"\""
|
|
108
119
|
},
|
|
109
120
|
"invalid": {
|
|
110
121
|
"type": "boolean",
|
|
@@ -140,7 +151,7 @@ export class PnMarketwebInput {
|
|
|
140
151
|
},
|
|
141
152
|
"attribute": "helpertext",
|
|
142
153
|
"reflect": false,
|
|
143
|
-
"defaultValue": "
|
|
154
|
+
"defaultValue": "\"\""
|
|
144
155
|
},
|
|
145
156
|
"label": {
|
|
146
157
|
"type": "string",
|
|
@@ -158,7 +169,7 @@ export class PnMarketwebInput {
|
|
|
158
169
|
},
|
|
159
170
|
"attribute": "label",
|
|
160
171
|
"reflect": false,
|
|
161
|
-
"defaultValue": "
|
|
172
|
+
"defaultValue": "\"\""
|
|
162
173
|
},
|
|
163
174
|
"placeholder": {
|
|
164
175
|
"type": "string",
|
|
@@ -176,7 +187,7 @@ export class PnMarketwebInput {
|
|
|
176
187
|
},
|
|
177
188
|
"attribute": "placeholder",
|
|
178
189
|
"reflect": false,
|
|
179
|
-
"defaultValue": "
|
|
190
|
+
"defaultValue": "\"\""
|
|
180
191
|
},
|
|
181
192
|
"inputid": {
|
|
182
193
|
"type": "string",
|
|
@@ -212,7 +223,7 @@ export class PnMarketwebInput {
|
|
|
212
223
|
},
|
|
213
224
|
"attribute": "name",
|
|
214
225
|
"reflect": false,
|
|
215
|
-
"defaultValue": "
|
|
226
|
+
"defaultValue": "\"\""
|
|
216
227
|
},
|
|
217
228
|
"required": {
|
|
218
229
|
"type": "boolean",
|
|
@@ -230,7 +241,7 @@ export class PnMarketwebInput {
|
|
|
230
241
|
},
|
|
231
242
|
"attribute": "required",
|
|
232
243
|
"reflect": false,
|
|
233
|
-
"defaultValue": "
|
|
244
|
+
"defaultValue": "false"
|
|
234
245
|
},
|
|
235
246
|
"type": {
|
|
236
247
|
"type": "string",
|
|
@@ -248,7 +259,7 @@ export class PnMarketwebInput {
|
|
|
248
259
|
},
|
|
249
260
|
"attribute": "type",
|
|
250
261
|
"reflect": false,
|
|
251
|
-
"defaultValue": "
|
|
262
|
+
"defaultValue": "\"text\""
|
|
252
263
|
},
|
|
253
264
|
"autocomplete": {
|
|
254
265
|
"type": "string",
|
|
@@ -266,7 +277,7 @@ export class PnMarketwebInput {
|
|
|
266
277
|
},
|
|
267
278
|
"attribute": "autocomplete",
|
|
268
279
|
"reflect": false,
|
|
269
|
-
"defaultValue": "
|
|
280
|
+
"defaultValue": "\"\""
|
|
270
281
|
},
|
|
271
282
|
"valid": {
|
|
272
283
|
"type": "boolean",
|
|
@@ -302,7 +313,7 @@ export class PnMarketwebInput {
|
|
|
302
313
|
},
|
|
303
314
|
"attribute": "value",
|
|
304
315
|
"reflect": false,
|
|
305
|
-
"defaultValue": "
|
|
316
|
+
"defaultValue": "\"\""
|
|
306
317
|
},
|
|
307
318
|
"maxlength": {
|
|
308
319
|
"type": "string",
|
|
@@ -320,7 +331,7 @@ export class PnMarketwebInput {
|
|
|
320
331
|
},
|
|
321
332
|
"attribute": "maxlength",
|
|
322
333
|
"reflect": false,
|
|
323
|
-
"defaultValue": "
|
|
334
|
+
"defaultValue": "\"\""
|
|
324
335
|
},
|
|
325
336
|
"min": {
|
|
326
337
|
"type": "string",
|
|
@@ -338,7 +349,7 @@ export class PnMarketwebInput {
|
|
|
338
349
|
},
|
|
339
350
|
"attribute": "min",
|
|
340
351
|
"reflect": false,
|
|
341
|
-
"defaultValue": "
|
|
352
|
+
"defaultValue": "\"\""
|
|
342
353
|
},
|
|
343
354
|
"max": {
|
|
344
355
|
"type": "string",
|
|
@@ -356,7 +367,7 @@ export class PnMarketwebInput {
|
|
|
356
367
|
},
|
|
357
368
|
"attribute": "max",
|
|
358
369
|
"reflect": false,
|
|
359
|
-
"defaultValue": "
|
|
370
|
+
"defaultValue": "\"\""
|
|
360
371
|
},
|
|
361
372
|
"step": {
|
|
362
373
|
"type": "string",
|
|
@@ -374,7 +385,7 @@ export class PnMarketwebInput {
|
|
|
374
385
|
},
|
|
375
386
|
"attribute": "step",
|
|
376
387
|
"reflect": false,
|
|
377
|
-
"defaultValue": "
|
|
388
|
+
"defaultValue": "\"\""
|
|
378
389
|
},
|
|
379
390
|
"pattern": {
|
|
380
391
|
"type": "string",
|
|
@@ -392,7 +403,7 @@ export class PnMarketwebInput {
|
|
|
392
403
|
},
|
|
393
404
|
"attribute": "pattern",
|
|
394
405
|
"reflect": false,
|
|
395
|
-
"defaultValue": "
|
|
406
|
+
"defaultValue": "\"\""
|
|
396
407
|
}
|
|
397
408
|
};
|
|
398
409
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/components/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* PnMarketWebComponents custom elements */
|
|
2
|
+
export { PnAddressAutofill as PnAddressAutofill } from '../types/components/input/pn-address-autofill/pn-address-autofill';
|
|
2
3
|
export { PnAnimatedTile as PnAnimatedTile } from '../types/components/animation/pn-animated-tile/pn-animated-tile';
|
|
3
4
|
export { PnAppBanner as PnAppBanner } from '../types/components/minor/pn-app-banner/pn-app-banner';
|
|
4
5
|
export { PnBonusProgressbar as PnBonusProgressbar } from '../types/components/input/pn-bonus-progressbar/pn-bonus-progressbar';
|
|
@@ -35,7 +36,7 @@ export { PnMarketwebSiteheaderLoginMypageButton as PnMarketwebSiteheaderLoginMyp
|
|
|
35
36
|
export { PnMarketwebSiteheaderLoginProfileselection as PnMarketwebSiteheaderLoginProfileselection } from '../types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection';
|
|
36
37
|
export { PnMarketwebSiteheaderSearch as PnMarketwebSiteheaderSearch } from '../types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-search';
|
|
37
38
|
export { PnMarketwebSiteheaderUnifiedLogin as PnMarketwebSiteheaderUnifiedLogin } from '../types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-unified-login';
|
|
38
|
-
export { PnMultiFormField as PnMultiFormfield } from '../types/components/
|
|
39
|
+
export { PnMultiFormField as PnMultiFormfield } from '../types/components/input/pn-multi-formfield/pn-multi-formfield';
|
|
39
40
|
export { PnSpotlight as PnParcelTracker } from '../types/components/cta/pn-parcel-tracker/pn-parcel-tracker';
|
|
40
41
|
export { PnPexPricefinder as PnPexPricefinder } from '../types/components/widgets/pn-pex-pricefinder/pn-pex-pricefinder';
|
|
41
42
|
export { PnPlayOnScroll as PnPlayOnScroll } from '../types/components/animation/pn-play-on-scroll/pn-play-on-scroll';
|
package/components/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
|
|
2
|
+
export { PnAddressAutofill, defineCustomElement as defineCustomElementPnAddressAutofill } from './pn-address-autofill.js';
|
|
2
3
|
export { PnAnimatedTile, defineCustomElement as defineCustomElementPnAnimatedTile } from './pn-animated-tile.js';
|
|
3
4
|
export { PnAppBanner, defineCustomElement as defineCustomElementPnAppBanner } from './pn-app-banner.js';
|
|
4
5
|
export { PnBonusProgressbar, defineCustomElement as defineCustomElementPnBonusProgressbar } from './pn-bonus-progressbar.js';
|
package/components/index2.js
CHANGED
|
@@ -1,59 +1,70 @@
|
|
|
1
|
-
|
|
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;
|
|
2
18
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2018 Jed Watson.
|
|
6
|
-
Licensed under the MIT License (MIT), see
|
|
7
|
-
http://jedwatson.github.io/classnames
|
|
8
|
-
*/
|
|
9
|
-
/* global define */
|
|
19
|
+
function later() {
|
|
20
|
+
var last = Date.now() - timestamp;
|
|
10
21
|
|
|
11
|
-
(
|
|
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
|
+
}
|
|
12
42
|
|
|
13
|
-
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
14
45
|
|
|
15
|
-
|
|
16
|
-
|
|
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
|
+
};
|
|
17
62
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
63
|
+
return debounced;
|
|
64
|
+
}
|
|
65
|
+
// Adds compatibility for ES modules
|
|
66
|
+
debounce.debounce = debounce;
|
|
21
67
|
|
|
22
|
-
|
|
68
|
+
var debounce_1 = debounce;
|
|
23
69
|
|
|
24
|
-
|
|
25
|
-
classes.push(arg);
|
|
26
|
-
} else if (Array.isArray(arg)) {
|
|
27
|
-
if (arg.length) {
|
|
28
|
-
var inner = classNames.apply(null, arg);
|
|
29
|
-
if (inner) {
|
|
30
|
-
classes.push(inner);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
} else if (argType === 'object') {
|
|
34
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
35
|
-
classes.push(arg.toString());
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
for (var key in arg) {
|
|
40
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
41
|
-
classes.push(key);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return classes.join(' ');
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (module.exports) {
|
|
51
|
-
classNames.default = classNames;
|
|
52
|
-
module.exports = classNames;
|
|
53
|
-
} else {
|
|
54
|
-
window.classNames = classNames;
|
|
55
|
-
}
|
|
56
|
-
}());
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
export { classnames as c };
|
|
70
|
+
export { debounce_1 as d };
|
package/components/index3.js
CHANGED
|
@@ -1,70 +1,59 @@
|
|
|
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;
|
|
1
|
+
import { c as createCommonjsModule } from './_commonjsHelpers.js';
|
|
18
2
|
|
|
19
|
-
|
|
20
|
-
|
|
3
|
+
var classnames = createCommonjsModule(function (module) {
|
|
4
|
+
/*!
|
|
5
|
+
Copyright (c) 2018 Jed Watson.
|
|
6
|
+
Licensed under the MIT License (MIT), see
|
|
7
|
+
http://jedwatson.github.io/classnames
|
|
8
|
+
*/
|
|
9
|
+
/* global define */
|
|
21
10
|
|
|
22
|
-
|
|
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
|
-
}
|
|
11
|
+
(function () {
|
|
42
12
|
|
|
43
|
-
|
|
44
|
-
};
|
|
13
|
+
var hasOwn = {}.hasOwnProperty;
|
|
45
14
|
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
};
|
|
15
|
+
function classNames() {
|
|
16
|
+
var classes = [];
|
|
62
17
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
debounce.debounce = debounce;
|
|
18
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
19
|
+
var arg = arguments[i];
|
|
20
|
+
if (!arg) continue;
|
|
67
21
|
|
|
68
|
-
var
|
|
22
|
+
var argType = typeof arg;
|
|
69
23
|
|
|
70
|
-
|
|
24
|
+
if (argType === 'string' || argType === 'number') {
|
|
25
|
+
classes.push(arg);
|
|
26
|
+
} else if (Array.isArray(arg)) {
|
|
27
|
+
if (arg.length) {
|
|
28
|
+
var inner = classNames.apply(null, arg);
|
|
29
|
+
if (inner) {
|
|
30
|
+
classes.push(inner);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
} else if (argType === 'object') {
|
|
34
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
35
|
+
classes.push(arg.toString());
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
for (var key in arg) {
|
|
40
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
41
|
+
classes.push(key);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return classes.join(' ');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (module.exports) {
|
|
51
|
+
classNames.default = classNames;
|
|
52
|
+
module.exports = classNames;
|
|
53
|
+
} else {
|
|
54
|
+
window.classNames = classNames;
|
|
55
|
+
}
|
|
56
|
+
}());
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export { classnames as c };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface PnAddressAutofill extends Components.PnAddressAutofill, HTMLElement {}
|
|
4
|
+
export const PnAddressAutofill: {
|
|
5
|
+
prototype: PnAddressAutofill;
|
|
6
|
+
new (): PnAddressAutofill;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|