@everymatrix/lottery-pagination 1.51.0 → 1.52.0
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/dist/cjs/{index-249d3d4d.js → index-cd7980b0.js} +161 -66
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{lottery-pagination-e934e1e8.js → lottery-pagination-6f549cf6.js} +51 -21
- package/dist/cjs/lottery-pagination.cjs.entry.js +2 -2
- package/dist/cjs/lottery-pagination.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/lottery-pagination/lottery-pagination.js +74 -20
- package/dist/esm/{index-49de5c89.js → index-40e954bc.js} +161 -66
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{lottery-pagination-50564510.js → lottery-pagination-a8de0ce1.js} +51 -21
- package/dist/esm/lottery-pagination.entry.js +2 -2
- package/dist/esm/lottery-pagination.js +3 -3
- package/dist/lottery-pagination/index.esm.js +1 -1
- package/dist/lottery-pagination/lottery-pagination.esm.js +1 -1
- package/dist/lottery-pagination/p-03ea8fbf.entry.js +1 -0
- package/dist/lottery-pagination/p-8c424013.js +1 -0
- package/dist/lottery-pagination/p-e3ba0aef.js +2 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-pagination/.stencil/packages/stencil/lottery-pagination/stencil.config.d.ts +2 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-pagination/.stencil/packages/stencil/lottery-pagination/stencil.config.dev.d.ts +2 -0
- package/package.json +1 -1
- package/dist/lottery-pagination/p-9e29d391.js +0 -1
- package/dist/lottery-pagination/p-ce0101e8.js +0 -2
- package/dist/lottery-pagination/p-e0782a32.entry.js +0 -1
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/lottery-pagination/.stencil/packages/stencil/lottery-pagination/stencil.config.d.ts +0 -2
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/lottery-pagination/.stencil/packages/stencil/lottery-pagination/stencil.config.dev.d.ts +0 -2
- /package/dist/types/{Users/maria.bumbar/Desktop → builds/emfe-widgets}/widgets-monorepo/packages/stencil/lottery-pagination/.stencil/packages/stencil/lottery-pagination/storybook/main.d.ts +0 -0
- /package/dist/types/{Users/maria.bumbar/Desktop → builds/emfe-widgets}/widgets-monorepo/packages/stencil/lottery-pagination/.stencil/packages/stencil/lottery-pagination/storybook/preview.d.ts +0 -0
|
@@ -3,8 +3,58 @@ import { isMobile } from "../../utils/utils";
|
|
|
3
3
|
import { translate } from "../../utils/locale.utils";
|
|
4
4
|
export class LotteryPagination {
|
|
5
5
|
constructor() {
|
|
6
|
+
/**
|
|
7
|
+
* Next page string value - determines if the next page is disabled or active
|
|
8
|
+
*/
|
|
9
|
+
this.nextPage = false;
|
|
10
|
+
/**
|
|
11
|
+
* Previous page string value - determines if the previous page is disabled or active
|
|
12
|
+
*/
|
|
13
|
+
this.prevPage = false;
|
|
14
|
+
/**
|
|
15
|
+
* The received offset
|
|
16
|
+
*/
|
|
17
|
+
this.offset = 0;
|
|
18
|
+
/**
|
|
19
|
+
* The received limit for the number of pages
|
|
20
|
+
*/
|
|
21
|
+
this.limit = 10;
|
|
22
|
+
/**
|
|
23
|
+
* The received total number of pages
|
|
24
|
+
*/
|
|
25
|
+
this.total = 1;
|
|
26
|
+
/**
|
|
27
|
+
* Language
|
|
28
|
+
*/
|
|
29
|
+
this.language = 'en';
|
|
30
|
+
/**
|
|
31
|
+
* Client custom styling via string
|
|
32
|
+
*/
|
|
33
|
+
this.clientStyling = '';
|
|
34
|
+
/**
|
|
35
|
+
* Client custom styling via url content
|
|
36
|
+
*/
|
|
37
|
+
this.clientStylingUrlContent = '';
|
|
38
|
+
this.isReset = false;
|
|
39
|
+
/**
|
|
40
|
+
* Component working variable for last page
|
|
41
|
+
*/
|
|
42
|
+
this.lastPage = false;
|
|
43
|
+
/**
|
|
44
|
+
* Component working variable for prvious page
|
|
45
|
+
*/
|
|
46
|
+
this.previousPage = false;
|
|
47
|
+
/**
|
|
48
|
+
* In component working variable for the array of pages
|
|
49
|
+
*/
|
|
50
|
+
this.pagesArray = [];
|
|
51
|
+
/**
|
|
52
|
+
* In component working variable for last page
|
|
53
|
+
*/
|
|
54
|
+
this.endInt = 0;
|
|
6
55
|
this.userAgent = window.navigator.userAgent;
|
|
7
56
|
this.currentPage = 1;
|
|
57
|
+
this.limitStylingAppends = false;
|
|
8
58
|
/**
|
|
9
59
|
* Navigation logic
|
|
10
60
|
*/
|
|
@@ -82,26 +132,6 @@ export class LotteryPagination {
|
|
|
82
132
|
this.stylingContainer.prepend(cssFile);
|
|
83
133
|
}, 1);
|
|
84
134
|
};
|
|
85
|
-
this.nextPage = false;
|
|
86
|
-
this.prevPage = false;
|
|
87
|
-
this.offset = 0;
|
|
88
|
-
this.limit = 10;
|
|
89
|
-
this.total = 1;
|
|
90
|
-
this.language = 'en';
|
|
91
|
-
this.clientStyling = '';
|
|
92
|
-
this.clientStylingUrlContent = '';
|
|
93
|
-
this.arrowsActive = undefined;
|
|
94
|
-
this.secondaryArrowsActive = undefined;
|
|
95
|
-
this.numberedNavActive = undefined;
|
|
96
|
-
this.isReset = false;
|
|
97
|
-
this.offsetInt = undefined;
|
|
98
|
-
this.lastPage = false;
|
|
99
|
-
this.previousPage = false;
|
|
100
|
-
this.limitInt = undefined;
|
|
101
|
-
this.totalInt = undefined;
|
|
102
|
-
this.pagesArray = [];
|
|
103
|
-
this.endInt = 0;
|
|
104
|
-
this.limitStylingAppends = false;
|
|
105
135
|
}
|
|
106
136
|
componentWillRender() {
|
|
107
137
|
this.offsetInt = this.offset;
|
|
@@ -206,6 +236,8 @@ export class LotteryPagination {
|
|
|
206
236
|
"tags": [],
|
|
207
237
|
"text": "Next page string value - determines if the next page is disabled or active"
|
|
208
238
|
},
|
|
239
|
+
"getter": false,
|
|
240
|
+
"setter": false,
|
|
209
241
|
"attribute": "next-page",
|
|
210
242
|
"reflect": true,
|
|
211
243
|
"defaultValue": "false"
|
|
@@ -224,6 +256,8 @@ export class LotteryPagination {
|
|
|
224
256
|
"tags": [],
|
|
225
257
|
"text": "Previous page string value - determines if the previous page is disabled or active"
|
|
226
258
|
},
|
|
259
|
+
"getter": false,
|
|
260
|
+
"setter": false,
|
|
227
261
|
"attribute": "prev-page",
|
|
228
262
|
"reflect": true,
|
|
229
263
|
"defaultValue": "false"
|
|
@@ -242,6 +276,8 @@ export class LotteryPagination {
|
|
|
242
276
|
"tags": [],
|
|
243
277
|
"text": "The received offset"
|
|
244
278
|
},
|
|
279
|
+
"getter": false,
|
|
280
|
+
"setter": false,
|
|
245
281
|
"attribute": "offset",
|
|
246
282
|
"reflect": true,
|
|
247
283
|
"defaultValue": "0"
|
|
@@ -260,6 +296,8 @@ export class LotteryPagination {
|
|
|
260
296
|
"tags": [],
|
|
261
297
|
"text": "The received limit for the number of pages"
|
|
262
298
|
},
|
|
299
|
+
"getter": false,
|
|
300
|
+
"setter": false,
|
|
263
301
|
"attribute": "limit",
|
|
264
302
|
"reflect": true,
|
|
265
303
|
"defaultValue": "10"
|
|
@@ -278,6 +316,8 @@ export class LotteryPagination {
|
|
|
278
316
|
"tags": [],
|
|
279
317
|
"text": "The received total number of pages"
|
|
280
318
|
},
|
|
319
|
+
"getter": false,
|
|
320
|
+
"setter": false,
|
|
281
321
|
"attribute": "total",
|
|
282
322
|
"reflect": true,
|
|
283
323
|
"defaultValue": "1"
|
|
@@ -296,6 +336,8 @@ export class LotteryPagination {
|
|
|
296
336
|
"tags": [],
|
|
297
337
|
"text": "Language"
|
|
298
338
|
},
|
|
339
|
+
"getter": false,
|
|
340
|
+
"setter": false,
|
|
299
341
|
"attribute": "language",
|
|
300
342
|
"reflect": true,
|
|
301
343
|
"defaultValue": "'en'"
|
|
@@ -314,6 +356,8 @@ export class LotteryPagination {
|
|
|
314
356
|
"tags": [],
|
|
315
357
|
"text": "Client custom styling via string"
|
|
316
358
|
},
|
|
359
|
+
"getter": false,
|
|
360
|
+
"setter": false,
|
|
317
361
|
"attribute": "client-styling",
|
|
318
362
|
"reflect": true,
|
|
319
363
|
"defaultValue": "''"
|
|
@@ -332,6 +376,8 @@ export class LotteryPagination {
|
|
|
332
376
|
"tags": [],
|
|
333
377
|
"text": "Client custom styling via url content"
|
|
334
378
|
},
|
|
379
|
+
"getter": false,
|
|
380
|
+
"setter": false,
|
|
335
381
|
"attribute": "client-styling-url-content",
|
|
336
382
|
"reflect": true,
|
|
337
383
|
"defaultValue": "''"
|
|
@@ -350,6 +396,8 @@ export class LotteryPagination {
|
|
|
350
396
|
"tags": [],
|
|
351
397
|
"text": "Customize pagination: Activate pagination arrows"
|
|
352
398
|
},
|
|
399
|
+
"getter": false,
|
|
400
|
+
"setter": false,
|
|
353
401
|
"attribute": "arrows-active",
|
|
354
402
|
"reflect": true
|
|
355
403
|
},
|
|
@@ -367,6 +415,8 @@ export class LotteryPagination {
|
|
|
367
415
|
"tags": [],
|
|
368
416
|
"text": "Customize pagination: Activate pagination secondary arrows"
|
|
369
417
|
},
|
|
418
|
+
"getter": false,
|
|
419
|
+
"setter": false,
|
|
370
420
|
"attribute": "secondary-arrows-active",
|
|
371
421
|
"reflect": true
|
|
372
422
|
},
|
|
@@ -384,6 +434,8 @@ export class LotteryPagination {
|
|
|
384
434
|
"tags": [],
|
|
385
435
|
"text": "Customize pagination: Activate pagination numbered navigation"
|
|
386
436
|
},
|
|
437
|
+
"getter": false,
|
|
438
|
+
"setter": false,
|
|
387
439
|
"attribute": "numbered-nav-active",
|
|
388
440
|
"reflect": true
|
|
389
441
|
},
|
|
@@ -401,6 +453,8 @@ export class LotteryPagination {
|
|
|
401
453
|
"tags": [],
|
|
402
454
|
"text": ""
|
|
403
455
|
},
|
|
456
|
+
"getter": false,
|
|
457
|
+
"setter": false,
|
|
404
458
|
"attribute": "is-reset",
|
|
405
459
|
"reflect": true,
|
|
406
460
|
"defaultValue": "false"
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
const NAMESPACE = 'lottery-pagination';
|
|
2
|
-
const BUILD = /* lottery-pagination */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: false, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: false, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: false };
|
|
2
|
+
const BUILD = /* lottery-pagination */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: false, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: false, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: false };
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
Stencil Client Platform v4.
|
|
5
|
+
Stencil Client Platform v4.25.1 | MIT Licensed | https://stenciljs.com
|
|
6
6
|
*/
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __export = (target, all) => {
|
|
9
9
|
for (var name in all)
|
|
10
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
11
|
};
|
|
12
|
+
|
|
13
|
+
// src/client/client-host-ref.ts
|
|
12
14
|
var hostRefs = /* @__PURE__ */ new WeakMap();
|
|
13
15
|
var getHostRef = (ref) => hostRefs.get(ref);
|
|
14
|
-
var registerInstance = (lazyInstance, hostRef) =>
|
|
16
|
+
var registerInstance = (lazyInstance, hostRef) => {
|
|
17
|
+
hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
|
18
|
+
};
|
|
15
19
|
var registerHost = (hostElement, cmpMeta) => {
|
|
16
20
|
const hostRef = {
|
|
17
21
|
$flags$: 0,
|
|
@@ -24,7 +28,8 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
|
24
28
|
hostElement["s-p"] = [];
|
|
25
29
|
hostElement["s-rc"] = [];
|
|
26
30
|
}
|
|
27
|
-
|
|
31
|
+
const ref = hostRefs.set(hostElement, hostRef);
|
|
32
|
+
return ref;
|
|
28
33
|
};
|
|
29
34
|
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
30
35
|
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
@@ -61,16 +66,22 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
61
66
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
62
67
|
/* webpackMode: "lazy" */
|
|
63
68
|
`./${bundleId}.entry.js${""}`
|
|
64
|
-
).then(
|
|
65
|
-
{
|
|
66
|
-
|
|
69
|
+
).then(
|
|
70
|
+
(importedModule) => {
|
|
71
|
+
{
|
|
72
|
+
cmpModules.set(bundleId, importedModule);
|
|
73
|
+
}
|
|
74
|
+
return importedModule[exportName];
|
|
75
|
+
},
|
|
76
|
+
(e) => {
|
|
77
|
+
consoleError(e, hostRef.$hostElement$);
|
|
67
78
|
}
|
|
68
|
-
|
|
69
|
-
}, consoleError);
|
|
79
|
+
);
|
|
70
80
|
};
|
|
71
81
|
|
|
72
82
|
// src/client/client-style.ts
|
|
73
83
|
var styles = /* @__PURE__ */ new Map();
|
|
84
|
+
var HYDRATED_STYLE_ID = "sty-id";
|
|
74
85
|
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
75
86
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
76
87
|
var win = typeof window !== "undefined" ? window : {};
|
|
@@ -128,12 +139,6 @@ var flush = () => {
|
|
|
128
139
|
};
|
|
129
140
|
var nextTick = (cb) => promiseResolve().then(cb);
|
|
130
141
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
131
|
-
|
|
132
|
-
// src/utils/constants.ts
|
|
133
|
-
var EMPTY_OBJ = {};
|
|
134
|
-
|
|
135
|
-
// src/utils/helpers.ts
|
|
136
|
-
var isDef = (v) => v != null;
|
|
137
142
|
var isComplexType = (o) => {
|
|
138
143
|
o = typeof o;
|
|
139
144
|
return o === "object" || o === "function";
|
|
@@ -327,7 +332,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
327
332
|
}
|
|
328
333
|
if (!appliedStyles.has(scopeId2)) {
|
|
329
334
|
{
|
|
330
|
-
styleElm = doc.createElement("style");
|
|
335
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
|
331
336
|
styleElm.innerHTML = style;
|
|
332
337
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
333
338
|
if (nonce != null) {
|
|
@@ -337,7 +342,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
337
342
|
if (styleContainerNode.nodeName === "HEAD") {
|
|
338
343
|
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
339
344
|
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
340
|
-
styleContainerNode.insertBefore(
|
|
345
|
+
styleContainerNode.insertBefore(
|
|
346
|
+
styleElm,
|
|
347
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
348
|
+
);
|
|
341
349
|
} else if ("host" in styleContainerNode) {
|
|
342
350
|
if (supportsConstructableStylesheets) {
|
|
343
351
|
const stylesheet = new CSSStyleSheet();
|
|
@@ -387,16 +395,18 @@ var attachStyles = (hostRef) => {
|
|
|
387
395
|
endAttachStyles();
|
|
388
396
|
};
|
|
389
397
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
390
|
-
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
398
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
391
399
|
if (oldValue !== newValue) {
|
|
392
400
|
let isProp = isMemberInElement(elm, memberName);
|
|
393
401
|
let ln = memberName.toLowerCase();
|
|
394
402
|
if (memberName === "class") {
|
|
395
403
|
const classList = elm.classList;
|
|
396
404
|
const oldClasses = parseClassList(oldValue);
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
405
|
+
let newClasses = parseClassList(newValue);
|
|
406
|
+
{
|
|
407
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
408
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
409
|
+
}
|
|
400
410
|
} else if (memberName === "ref") {
|
|
401
411
|
if (newValue) {
|
|
402
412
|
newValue(elm);
|
|
@@ -434,7 +444,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
434
444
|
elm.setAttribute(memberName, n);
|
|
435
445
|
}
|
|
436
446
|
}
|
|
437
|
-
} else {
|
|
447
|
+
} else if (elm[memberName] !== newValue) {
|
|
438
448
|
elm[memberName] = newValue;
|
|
439
449
|
}
|
|
440
450
|
} catch (e) {
|
|
@@ -456,24 +466,44 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
456
466
|
}
|
|
457
467
|
};
|
|
458
468
|
var parseClassListRegex = /\s/;
|
|
459
|
-
var parseClassList = (value) =>
|
|
469
|
+
var parseClassList = (value) => {
|
|
470
|
+
if (typeof value === "object" && value && "baseVal" in value) {
|
|
471
|
+
value = value.baseVal;
|
|
472
|
+
}
|
|
473
|
+
if (!value || typeof value !== "string") {
|
|
474
|
+
return [];
|
|
475
|
+
}
|
|
476
|
+
return value.split(parseClassListRegex);
|
|
477
|
+
};
|
|
460
478
|
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
461
479
|
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
462
480
|
|
|
463
481
|
// src/runtime/vdom/update-element.ts
|
|
464
|
-
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
482
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
465
483
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
466
|
-
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ ||
|
|
467
|
-
const newVnodeAttrs = newVnode.$attrs$ ||
|
|
484
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
485
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
468
486
|
{
|
|
469
487
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
470
488
|
if (!(memberName in newVnodeAttrs)) {
|
|
471
|
-
setAccessor(
|
|
489
|
+
setAccessor(
|
|
490
|
+
elm,
|
|
491
|
+
memberName,
|
|
492
|
+
oldVnodeAttrs[memberName],
|
|
493
|
+
void 0,
|
|
494
|
+
isSvgMode2,
|
|
495
|
+
newVnode.$flags$);
|
|
472
496
|
}
|
|
473
497
|
}
|
|
474
498
|
}
|
|
475
499
|
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
476
|
-
setAccessor(
|
|
500
|
+
setAccessor(
|
|
501
|
+
elm,
|
|
502
|
+
memberName,
|
|
503
|
+
oldVnodeAttrs[memberName],
|
|
504
|
+
newVnodeAttrs[memberName],
|
|
505
|
+
isSvgMode2,
|
|
506
|
+
newVnode.$flags$);
|
|
477
507
|
}
|
|
478
508
|
};
|
|
479
509
|
function sortedAttrNames(attrNames) {
|
|
@@ -485,13 +515,10 @@ function sortedAttrNames(attrNames) {
|
|
|
485
515
|
attrNames
|
|
486
516
|
);
|
|
487
517
|
}
|
|
488
|
-
|
|
489
|
-
// src/runtime/vdom/vdom-render.ts
|
|
490
|
-
var scopeId;
|
|
491
518
|
var hostTagName;
|
|
492
519
|
var useNativeShadowDom = false;
|
|
493
520
|
var isSvgMode = false;
|
|
494
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
|
521
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
495
522
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
496
523
|
let i2 = 0;
|
|
497
524
|
let elm;
|
|
@@ -505,11 +532,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
505
532
|
{
|
|
506
533
|
updateElement(null, newVNode2, isSvgMode);
|
|
507
534
|
}
|
|
508
|
-
const rootNode = elm.getRootNode();
|
|
509
|
-
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
510
|
-
if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
511
|
-
elm.classList.add(elm["s-si"] = scopeId);
|
|
512
|
-
}
|
|
513
535
|
if (newVNode2.$children$) {
|
|
514
536
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
515
537
|
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
@@ -614,6 +636,9 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
614
636
|
};
|
|
615
637
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
616
638
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
639
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
640
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
641
|
+
}
|
|
617
642
|
return true;
|
|
618
643
|
}
|
|
619
644
|
return false;
|
|
@@ -653,8 +678,9 @@ var nullifyVNodeRefs = (vNode) => {
|
|
|
653
678
|
}
|
|
654
679
|
};
|
|
655
680
|
var insertBefore = (parent, newNode, reference) => {
|
|
656
|
-
|
|
657
|
-
|
|
681
|
+
{
|
|
682
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
683
|
+
}
|
|
658
684
|
};
|
|
659
685
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
660
686
|
const hostElm = hostRef.$hostElement$;
|
|
@@ -679,9 +705,6 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
679
705
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
680
706
|
hostRef.$vnode$ = rootVnode;
|
|
681
707
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
682
|
-
{
|
|
683
|
-
scopeId = hostElm["s-sc"];
|
|
684
|
-
}
|
|
685
708
|
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
686
709
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
687
710
|
};
|
|
@@ -689,7 +712,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
689
712
|
// src/runtime/update-component.ts
|
|
690
713
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
691
714
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
692
|
-
ancestorComponent["s-p"].push(
|
|
715
|
+
const index = ancestorComponent["s-p"].push(
|
|
716
|
+
new Promise(
|
|
717
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
|
718
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
719
|
+
r();
|
|
720
|
+
}
|
|
721
|
+
)
|
|
722
|
+
);
|
|
693
723
|
}
|
|
694
724
|
};
|
|
695
725
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
@@ -715,7 +745,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
715
745
|
}
|
|
716
746
|
let maybePromise;
|
|
717
747
|
{
|
|
718
|
-
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
|
|
748
|
+
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
|
|
719
749
|
}
|
|
720
750
|
endSchedule();
|
|
721
751
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
@@ -783,7 +813,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
783
813
|
const instance = hostRef.$lazyInstance$ ;
|
|
784
814
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
785
815
|
{
|
|
786
|
-
safeCall(instance, "componentDidRender");
|
|
816
|
+
safeCall(instance, "componentDidRender", void 0, elm);
|
|
787
817
|
}
|
|
788
818
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
789
819
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
@@ -817,12 +847,12 @@ var appDidLoad = (who) => {
|
|
|
817
847
|
}
|
|
818
848
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
819
849
|
};
|
|
820
|
-
var safeCall = (instance, method, arg) => {
|
|
850
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
821
851
|
if (instance && instance[method]) {
|
|
822
852
|
try {
|
|
823
853
|
return instance[method](arg);
|
|
824
854
|
} catch (e) {
|
|
825
|
-
consoleError(e);
|
|
855
|
+
consoleError(e, elm);
|
|
826
856
|
}
|
|
827
857
|
}
|
|
828
858
|
return void 0;
|
|
@@ -865,15 +895,68 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
865
895
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
866
896
|
members.map(([memberName, [memberFlags]]) => {
|
|
867
897
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
898
|
+
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
|
899
|
+
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
900
|
+
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
901
|
+
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
902
|
+
Object.defineProperty(prototype, memberName, {
|
|
903
|
+
get() {
|
|
904
|
+
{
|
|
905
|
+
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
|
|
906
|
+
return getValue(this, memberName);
|
|
907
|
+
}
|
|
908
|
+
const ref = getHostRef(this);
|
|
909
|
+
const instance = ref ? ref.$lazyInstance$ : prototype;
|
|
910
|
+
if (!instance) return;
|
|
911
|
+
return instance[memberName];
|
|
912
|
+
}
|
|
913
|
+
},
|
|
914
|
+
configurable: true,
|
|
915
|
+
enumerable: true
|
|
916
|
+
});
|
|
917
|
+
}
|
|
868
918
|
Object.defineProperty(prototype, memberName, {
|
|
869
|
-
get() {
|
|
870
|
-
return getValue(this, memberName);
|
|
871
|
-
},
|
|
872
919
|
set(newValue) {
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
920
|
+
const ref = getHostRef(this);
|
|
921
|
+
if (origSetter) {
|
|
922
|
+
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
923
|
+
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
924
|
+
newValue = ref.$instanceValues$.get(memberName);
|
|
925
|
+
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
926
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
927
|
+
}
|
|
928
|
+
origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
|
|
929
|
+
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
930
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
931
|
+
return;
|
|
932
|
+
}
|
|
933
|
+
{
|
|
934
|
+
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
|
935
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
936
|
+
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
|
937
|
+
ref.$onReadyPromise$.then(() => {
|
|
938
|
+
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
|
|
939
|
+
ref.$lazyInstance$[memberName] = newValue;
|
|
940
|
+
}
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
return;
|
|
944
|
+
}
|
|
945
|
+
const setterSetVal = () => {
|
|
946
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
947
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
948
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
949
|
+
}
|
|
950
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
|
|
951
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
952
|
+
};
|
|
953
|
+
if (ref.$lazyInstance$) {
|
|
954
|
+
setterSetVal();
|
|
955
|
+
} else {
|
|
956
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
}
|
|
877
960
|
});
|
|
878
961
|
}
|
|
879
962
|
});
|
|
@@ -883,7 +966,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
883
966
|
plt.jmp(() => {
|
|
884
967
|
var _a2;
|
|
885
968
|
const propName = attrNameToPropName.get(attrName);
|
|
886
|
-
if (this.hasOwnProperty(propName)) {
|
|
969
|
+
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
|
|
887
970
|
newValue = this[propName];
|
|
888
971
|
delete this[propName];
|
|
889
972
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -903,7 +986,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
903
986
|
}
|
|
904
987
|
return;
|
|
905
988
|
}
|
|
906
|
-
|
|
989
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
990
|
+
newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
991
|
+
if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
992
|
+
this[propName] = newValue;
|
|
993
|
+
}
|
|
907
994
|
});
|
|
908
995
|
};
|
|
909
996
|
Cstr.observedAttributes = Array.from(
|
|
@@ -930,9 +1017,8 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
930
1017
|
let Cstr;
|
|
931
1018
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
932
1019
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
const CstrImport = loadModule(cmpMeta);
|
|
1020
|
+
{
|
|
1021
|
+
const CstrImport = loadModule(cmpMeta, hostRef);
|
|
936
1022
|
if (CstrImport && "then" in CstrImport) {
|
|
937
1023
|
const endLoad = uniqueTime();
|
|
938
1024
|
Cstr = await CstrImport;
|
|
@@ -954,16 +1040,12 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
954
1040
|
try {
|
|
955
1041
|
new Cstr(hostRef);
|
|
956
1042
|
} catch (e) {
|
|
957
|
-
consoleError(e);
|
|
1043
|
+
consoleError(e, elm);
|
|
958
1044
|
}
|
|
959
1045
|
{
|
|
960
1046
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
961
1047
|
}
|
|
962
1048
|
endNewInstance();
|
|
963
|
-
} else {
|
|
964
|
-
Cstr = elm.constructor;
|
|
965
|
-
const cmpTag = elm.localName;
|
|
966
|
-
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
967
1049
|
}
|
|
968
1050
|
if (Cstr && Cstr.style) {
|
|
969
1051
|
let style;
|
|
@@ -986,7 +1068,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
986
1068
|
schedule();
|
|
987
1069
|
}
|
|
988
1070
|
};
|
|
989
|
-
var fireConnectedCallback = (instance) => {
|
|
1071
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
990
1072
|
};
|
|
991
1073
|
|
|
992
1074
|
// src/runtime/connected-callback.ts
|
|
@@ -1026,7 +1108,7 @@ var connectedCallback = (elm) => {
|
|
|
1026
1108
|
endConnected();
|
|
1027
1109
|
}
|
|
1028
1110
|
};
|
|
1029
|
-
var disconnectInstance = (instance) => {
|
|
1111
|
+
var disconnectInstance = (instance, elm) => {
|
|
1030
1112
|
};
|
|
1031
1113
|
var disconnectedCallback = async (elm) => {
|
|
1032
1114
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
@@ -1035,6 +1117,12 @@ var disconnectedCallback = async (elm) => {
|
|
|
1035
1117
|
hostRef.$onReadyPromise$.then(() => disconnectInstance());
|
|
1036
1118
|
}
|
|
1037
1119
|
}
|
|
1120
|
+
if (rootAppliedStyles.has(elm)) {
|
|
1121
|
+
rootAppliedStyles.delete(elm);
|
|
1122
|
+
}
|
|
1123
|
+
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
|
1124
|
+
rootAppliedStyles.delete(elm.shadowRoot);
|
|
1125
|
+
}
|
|
1038
1126
|
};
|
|
1039
1127
|
|
|
1040
1128
|
// src/runtime/bootstrap-lazy.ts
|
|
@@ -1111,6 +1199,13 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1111
1199
|
}
|
|
1112
1200
|
disconnectedCallback() {
|
|
1113
1201
|
plt.jmp(() => disconnectedCallback(this));
|
|
1202
|
+
plt.raf(() => {
|
|
1203
|
+
var _a3;
|
|
1204
|
+
const hostRef = getHostRef(this);
|
|
1205
|
+
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
|
1206
|
+
delete hostRef.$vnode$.$elm$;
|
|
1207
|
+
}
|
|
1208
|
+
});
|
|
1114
1209
|
}
|
|
1115
1210
|
componentOnReady() {
|
|
1116
1211
|
return getHostRef(this).$onReadyPromise$;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { L as LotteryPagination } from './lottery-pagination-
|
|
2
|
-
import './index-
|
|
1
|
+
export { L as LotteryPagination } from './lottery-pagination-a8de0ce1.js';
|
|
2
|
+
import './index-40e954bc.js';
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { b as bootstrapLazy } from './index-40e954bc.js';
|
|
2
|
+
export { s as setNonce } from './index-40e954bc.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
4
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|