@everymatrix/lottery-pagination 1.55.0 → 1.56.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.
Files changed (33) hide show
  1. package/dist/cjs/{index-6e6ef6de.js → index-ddbadb0f.js} +168 -67
  2. package/dist/cjs/index.cjs.js +2 -2
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{lottery-pagination-a3dc058a.js → lottery-pagination-038b9722.js} +51 -22
  5. package/dist/cjs/lottery-pagination.cjs.entry.js +2 -2
  6. package/dist/cjs/lottery-pagination.cjs.js +2 -2
  7. package/dist/collection/collection-manifest.json +1 -1
  8. package/dist/collection/components/lottery-pagination/lottery-pagination.js +76 -21
  9. package/dist/esm/{index-d339423e.js → index-893d5ea1.js} +168 -67
  10. package/dist/esm/index.js +2 -2
  11. package/dist/esm/loader.js +2 -2
  12. package/dist/esm/{lottery-pagination-55f8c7a0.js → lottery-pagination-d8ef15e4.js} +51 -22
  13. package/dist/esm/lottery-pagination.entry.js +2 -2
  14. package/dist/esm/lottery-pagination.js +3 -3
  15. package/dist/lottery-pagination/index.esm.js +1 -1
  16. package/dist/lottery-pagination/lottery-pagination.esm.js +1 -1
  17. package/dist/lottery-pagination/p-5eeb537f.js +2 -0
  18. package/dist/lottery-pagination/p-6bb4c606.js +1 -0
  19. package/dist/lottery-pagination/p-716cfefa.entry.js +1 -0
  20. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-pagination/.stencil/packages/stencil/lottery-pagination/stencil.config.d.ts +2 -0
  21. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-pagination/.stencil/packages/stencil/lottery-pagination/stencil.config.dev.d.ts +2 -0
  22. package/package.json +1 -1
  23. package/dist/lottery-pagination/p-70ca4bf8.js +0 -1
  24. package/dist/lottery-pagination/p-fa51c61f.js +0 -2
  25. package/dist/lottery-pagination/p-fad681ff.entry.js +0 -1
  26. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/lottery-pagination/.stencil/packages/stencil/lottery-pagination/stencil.config.d.ts +0 -2
  27. 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
  28. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/lottery-pagination/.stencil/packages/stencil/lottery-pagination/storybook/main.d.ts +0 -0
  29. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/lottery-pagination/.stencil/packages/stencil/lottery-pagination/storybook/preview.d.ts +0 -0
  30. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/lottery-pagination/.stencil/tools/plugins/index.d.ts +0 -0
  31. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/lottery-pagination/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
  32. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/lottery-pagination/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
  33. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/lottery-pagination/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
@@ -3,8 +3,58 @@ import { isMobile } from "../../utils/utils";
3
3
  import { translate, getTranslations } 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,27 +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.translationUrl = undefined;
98
- this.offsetInt = undefined;
99
- this.lastPage = false;
100
- this.previousPage = false;
101
- this.limitInt = undefined;
102
- this.totalInt = undefined;
103
- this.pagesArray = [];
104
- this.endInt = 0;
105
- this.limitStylingAppends = false;
106
135
  }
107
136
  componentWillLoad() {
108
137
  if (this.translationUrl) {
@@ -212,6 +241,8 @@ export class LotteryPagination {
212
241
  "tags": [],
213
242
  "text": "Next page string value - determines if the next page is disabled or active"
214
243
  },
244
+ "getter": false,
245
+ "setter": false,
215
246
  "attribute": "next-page",
216
247
  "reflect": true,
217
248
  "defaultValue": "false"
@@ -230,6 +261,8 @@ export class LotteryPagination {
230
261
  "tags": [],
231
262
  "text": "Previous page string value - determines if the previous page is disabled or active"
232
263
  },
264
+ "getter": false,
265
+ "setter": false,
233
266
  "attribute": "prev-page",
234
267
  "reflect": true,
235
268
  "defaultValue": "false"
@@ -248,6 +281,8 @@ export class LotteryPagination {
248
281
  "tags": [],
249
282
  "text": "The received offset"
250
283
  },
284
+ "getter": false,
285
+ "setter": false,
251
286
  "attribute": "offset",
252
287
  "reflect": true,
253
288
  "defaultValue": "0"
@@ -266,6 +301,8 @@ export class LotteryPagination {
266
301
  "tags": [],
267
302
  "text": "The received limit for the number of pages"
268
303
  },
304
+ "getter": false,
305
+ "setter": false,
269
306
  "attribute": "limit",
270
307
  "reflect": true,
271
308
  "defaultValue": "10"
@@ -284,6 +321,8 @@ export class LotteryPagination {
284
321
  "tags": [],
285
322
  "text": "The received total number of pages"
286
323
  },
324
+ "getter": false,
325
+ "setter": false,
287
326
  "attribute": "total",
288
327
  "reflect": true,
289
328
  "defaultValue": "1"
@@ -302,6 +341,8 @@ export class LotteryPagination {
302
341
  "tags": [],
303
342
  "text": "Language"
304
343
  },
344
+ "getter": false,
345
+ "setter": false,
305
346
  "attribute": "language",
306
347
  "reflect": true,
307
348
  "defaultValue": "'en'"
@@ -320,6 +361,8 @@ export class LotteryPagination {
320
361
  "tags": [],
321
362
  "text": "Client custom styling via string"
322
363
  },
364
+ "getter": false,
365
+ "setter": false,
323
366
  "attribute": "client-styling",
324
367
  "reflect": true,
325
368
  "defaultValue": "''"
@@ -338,6 +381,8 @@ export class LotteryPagination {
338
381
  "tags": [],
339
382
  "text": "Client custom styling via url content"
340
383
  },
384
+ "getter": false,
385
+ "setter": false,
341
386
  "attribute": "client-styling-url-content",
342
387
  "reflect": true,
343
388
  "defaultValue": "''"
@@ -356,6 +401,8 @@ export class LotteryPagination {
356
401
  "tags": [],
357
402
  "text": "Customize pagination: Activate pagination arrows"
358
403
  },
404
+ "getter": false,
405
+ "setter": false,
359
406
  "attribute": "arrows-active",
360
407
  "reflect": true
361
408
  },
@@ -373,6 +420,8 @@ export class LotteryPagination {
373
420
  "tags": [],
374
421
  "text": "Customize pagination: Activate pagination secondary arrows"
375
422
  },
423
+ "getter": false,
424
+ "setter": false,
376
425
  "attribute": "secondary-arrows-active",
377
426
  "reflect": true
378
427
  },
@@ -390,6 +439,8 @@ export class LotteryPagination {
390
439
  "tags": [],
391
440
  "text": "Customize pagination: Activate pagination numbered navigation"
392
441
  },
442
+ "getter": false,
443
+ "setter": false,
393
444
  "attribute": "numbered-nav-active",
394
445
  "reflect": true
395
446
  },
@@ -407,6 +458,8 @@ export class LotteryPagination {
407
458
  "tags": [],
408
459
  "text": ""
409
460
  },
461
+ "getter": false,
462
+ "setter": false,
410
463
  "attribute": "is-reset",
411
464
  "reflect": true,
412
465
  "defaultValue": "false"
@@ -425,6 +478,8 @@ export class LotteryPagination {
425
478
  "tags": [],
426
479
  "text": "Translations via parent component"
427
480
  },
481
+ "getter": false,
482
+ "setter": false,
428
483
  "attribute": "translation-url",
429
484
  "reflect": true
430
485
  }
@@ -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: true, 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: true, 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.22.3 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Platform v4.26.0 | 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) => hostRefs.set(hostRef.$lazyInstance$ = 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
- return hostRefs.set(hostElement, hostRef);
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((importedModule) => {
65
- {
66
- cmpModules.set(bundleId, importedModule);
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
- return importedModule[exportName];
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(styleElm, referenceNode2);
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();
@@ -355,7 +363,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
355
363
  styleContainerNode.append(styleElm);
356
364
  }
357
365
  }
358
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
366
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
359
367
  styleContainerNode.insertBefore(styleElm, null);
360
368
  }
361
369
  }
@@ -380,23 +388,25 @@ var attachStyles = (hostRef) => {
380
388
  const scopeId2 = addStyle(
381
389
  elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
382
390
  cmpMeta);
383
- if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
391
+ if ((flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */ || flags & 128 /* shadowNeedsScopedCss */)) {
384
392
  elm["s-sc"] = scopeId2;
385
393
  elm.classList.add(scopeId2 + "-h");
386
394
  }
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
- const newClasses = parseClassList(newValue);
398
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
399
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
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) => !value ? [] : value.split(parseClassListRegex);
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$ || EMPTY_OBJ;
467
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
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(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
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(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$);
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, parentElm) => {
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
- const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
657
- return inserted;
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,17 +705,21 @@ 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
- useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
708
+ useNativeShadowDom = !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && !(cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */);
686
709
  patch(oldVNode, rootVnode, isInitialLoad);
687
710
  };
688
711
 
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(new Promise((r) => hostRef.$onRenderResolve$ = r));
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) => {
@@ -716,11 +746,11 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
716
746
  let maybePromise;
717
747
  if (isInitialLoad) {
718
748
  {
719
- maybePromise = safeCall(instance, "componentWillLoad");
749
+ maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
720
750
  }
721
751
  }
722
752
  {
723
- maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
753
+ maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
724
754
  }
725
755
  endSchedule();
726
756
  return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
@@ -788,7 +818,7 @@ var postUpdateComponent = (hostRef) => {
788
818
  const instance = hostRef.$lazyInstance$ ;
789
819
  const ancestorComponent = hostRef.$ancestorComponent$;
790
820
  {
791
- safeCall(instance, "componentDidRender");
821
+ safeCall(instance, "componentDidRender", void 0, elm);
792
822
  }
793
823
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
794
824
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
@@ -817,17 +847,14 @@ var postUpdateComponent = (hostRef) => {
817
847
  }
818
848
  };
819
849
  var appDidLoad = (who) => {
820
- {
821
- addHydratedFlag(doc.documentElement);
822
- }
823
850
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
824
851
  };
825
- var safeCall = (instance, method, arg) => {
852
+ var safeCall = (instance, method, arg, elm) => {
826
853
  if (instance && instance[method]) {
827
854
  try {
828
855
  return instance[method](arg);
829
856
  } catch (e) {
830
- consoleError(e);
857
+ consoleError(e, elm);
831
858
  }
832
859
  }
833
860
  return void 0;
@@ -870,15 +897,68 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
870
897
  const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
871
898
  members.map(([memberName, [memberFlags]]) => {
872
899
  if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
900
+ const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
901
+ if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
902
+ if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
903
+ if (flags & 1 /* isElementConstructor */ || !origGetter) {
904
+ Object.defineProperty(prototype, memberName, {
905
+ get() {
906
+ {
907
+ if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
908
+ return getValue(this, memberName);
909
+ }
910
+ const ref = getHostRef(this);
911
+ const instance = ref ? ref.$lazyInstance$ : prototype;
912
+ if (!instance) return;
913
+ return instance[memberName];
914
+ }
915
+ },
916
+ configurable: true,
917
+ enumerable: true
918
+ });
919
+ }
873
920
  Object.defineProperty(prototype, memberName, {
874
- get() {
875
- return getValue(this, memberName);
876
- },
877
921
  set(newValue) {
878
- setValue(this, memberName, newValue, cmpMeta);
879
- },
880
- configurable: true,
881
- enumerable: true
922
+ const ref = getHostRef(this);
923
+ if (origSetter) {
924
+ const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
925
+ if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
926
+ newValue = ref.$instanceValues$.get(memberName);
927
+ } else if (!ref.$instanceValues$.get(memberName) && currentValue) {
928
+ ref.$instanceValues$.set(memberName, currentValue);
929
+ }
930
+ origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
931
+ newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
932
+ setValue(this, memberName, newValue, cmpMeta);
933
+ return;
934
+ }
935
+ {
936
+ if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
937
+ setValue(this, memberName, newValue, cmpMeta);
938
+ if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
939
+ ref.$onReadyPromise$.then(() => {
940
+ if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
941
+ ref.$lazyInstance$[memberName] = newValue;
942
+ }
943
+ });
944
+ }
945
+ return;
946
+ }
947
+ const setterSetVal = () => {
948
+ const currentValue = ref.$lazyInstance$[memberName];
949
+ if (!ref.$instanceValues$.get(memberName) && currentValue) {
950
+ ref.$instanceValues$.set(memberName, currentValue);
951
+ }
952
+ ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
953
+ setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
954
+ };
955
+ if (ref.$lazyInstance$) {
956
+ setterSetVal();
957
+ } else {
958
+ ref.$onReadyPromise$.then(() => setterSetVal());
959
+ }
960
+ }
961
+ }
882
962
  });
883
963
  }
884
964
  });
@@ -888,7 +968,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
888
968
  plt.jmp(() => {
889
969
  var _a2;
890
970
  const propName = attrNameToPropName.get(attrName);
891
- if (this.hasOwnProperty(propName)) {
971
+ if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
892
972
  newValue = this[propName];
893
973
  delete this[propName];
894
974
  } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
@@ -908,7 +988,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
908
988
  }
909
989
  return;
910
990
  }
911
- this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
991
+ const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
992
+ newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
993
+ if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
994
+ this[propName] = newValue;
995
+ }
912
996
  });
913
997
  };
914
998
  Cstr.observedAttributes = Array.from(
@@ -937,7 +1021,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
937
1021
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
938
1022
  const bundleId = cmpMeta.$lazyBundleId$;
939
1023
  if (bundleId) {
940
- const CstrImport = loadModule(cmpMeta);
1024
+ const CstrImport = loadModule(cmpMeta, hostRef);
941
1025
  if (CstrImport && "then" in CstrImport) {
942
1026
  const endLoad = uniqueTime();
943
1027
  Cstr = await CstrImport;
@@ -959,7 +1043,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
959
1043
  try {
960
1044
  new Cstr(hostRef);
961
1045
  } catch (e) {
962
- consoleError(e);
1046
+ consoleError(e, elm);
963
1047
  }
964
1048
  {
965
1049
  hostRef.$flags$ &= ~8 /* isConstructingInstance */;
@@ -991,7 +1075,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
991
1075
  schedule();
992
1076
  }
993
1077
  };
994
- var fireConnectedCallback = (instance) => {
1078
+ var fireConnectedCallback = (instance, elm) => {
995
1079
  };
996
1080
 
997
1081
  // src/runtime/connected-callback.ts
@@ -1031,7 +1115,7 @@ var connectedCallback = (elm) => {
1031
1115
  endConnected();
1032
1116
  }
1033
1117
  };
1034
- var disconnectInstance = (instance) => {
1118
+ var disconnectInstance = (instance, elm) => {
1035
1119
  };
1036
1120
  var disconnectedCallback = async (elm) => {
1037
1121
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
@@ -1040,6 +1124,12 @@ var disconnectedCallback = async (elm) => {
1040
1124
  hostRef.$onReadyPromise$.then(() => disconnectInstance());
1041
1125
  }
1042
1126
  }
1127
+ if (rootAppliedStyles.has(elm)) {
1128
+ rootAppliedStyles.delete(elm);
1129
+ }
1130
+ if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
1131
+ rootAppliedStyles.delete(elm.shadowRoot);
1132
+ }
1043
1133
  };
1044
1134
 
1045
1135
  // src/runtime/bootstrap-lazy.ts
@@ -1116,6 +1206,17 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1116
1206
  }
1117
1207
  disconnectedCallback() {
1118
1208
  plt.jmp(() => disconnectedCallback(this));
1209
+ plt.raf(() => {
1210
+ var _a3;
1211
+ const hostRef = getHostRef(this);
1212
+ const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
1213
+ if (i2 > -1) {
1214
+ deferredConnectedCallbacks.splice(i2, 1);
1215
+ }
1216
+ if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
1217
+ delete hostRef.$vnode$.$elm$;
1218
+ }
1219
+ });
1119
1220
  }
1120
1221
  componentOnReady() {
1121
1222
  return getHostRef(this).$onReadyPromise$;
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { L as LotteryPagination } from './lottery-pagination-55f8c7a0.js';
2
- import './index-d339423e.js';
1
+ export { L as LotteryPagination } from './lottery-pagination-d8ef15e4.js';
2
+ import './index-893d5ea1.js';