@everymatrix/helper-pagination 1.52.6 → 1.53.10
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/helper-pagination.cjs.entry.js +50 -20
- package/dist/cjs/helper-pagination.cjs.js +2 -2
- package/dist/cjs/{index-502d881b.js → index-86ed1cf8.js} +161 -66
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/helper-pagination/helper-pagination.js +71 -19
- package/dist/esm/helper-pagination.entry.js +50 -20
- package/dist/esm/helper-pagination.js +3 -3
- package/dist/esm/{index-79ce7f1f.js → index-f8e68e4c.js} +161 -66
- package/dist/esm/loader.js +2 -2
- package/dist/helper-pagination/helper-pagination.esm.js +1 -1
- package/dist/helper-pagination/p-01304a1b.js +2 -0
- package/dist/helper-pagination/p-8bc25545.entry.js +1 -0
- package/package.json +1 -1
- package/dist/helper-pagination/p-a3272d7a.entry.js +0 -1
- package/dist/helper-pagination/p-ddd49f2d.js +0 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-86ed1cf8.js');
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @name isMobile
|
|
@@ -68,8 +68,57 @@ const HelperPagination = class {
|
|
|
68
68
|
constructor(hostRef) {
|
|
69
69
|
index.registerInstance(this, hostRef);
|
|
70
70
|
this.hpPageChange = index.createEvent(this, "hpPageChange", 7);
|
|
71
|
+
/**
|
|
72
|
+
* Next page string value - determines if the next page is disabled or active
|
|
73
|
+
*/
|
|
74
|
+
this.nextPage = '';
|
|
75
|
+
/**
|
|
76
|
+
* Previous page string value - determines if the previous page is disabled or active
|
|
77
|
+
*/
|
|
78
|
+
this.prevPage = '';
|
|
79
|
+
/**
|
|
80
|
+
* The received offset
|
|
81
|
+
*/
|
|
82
|
+
this.offset = 0;
|
|
83
|
+
/**
|
|
84
|
+
* The received limit for the number of pages
|
|
85
|
+
*/
|
|
86
|
+
this.limit = 1;
|
|
87
|
+
/**
|
|
88
|
+
* The received total number of pages
|
|
89
|
+
*/
|
|
90
|
+
this.total = 1;
|
|
91
|
+
/**
|
|
92
|
+
* Language
|
|
93
|
+
*/
|
|
94
|
+
this.language = 'en';
|
|
95
|
+
/**
|
|
96
|
+
* Client custom styling via string
|
|
97
|
+
*/
|
|
98
|
+
this.clientStyling = '';
|
|
99
|
+
/**
|
|
100
|
+
* Client custom styling via url content
|
|
101
|
+
*/
|
|
102
|
+
this.clientStylingUrlContent = '';
|
|
103
|
+
/**
|
|
104
|
+
* Component working variable for last page
|
|
105
|
+
*/
|
|
106
|
+
this.lastPage = false;
|
|
107
|
+
/**
|
|
108
|
+
* Component working variable for prvious page
|
|
109
|
+
*/
|
|
110
|
+
this.previousPage = false;
|
|
111
|
+
/**
|
|
112
|
+
* In component working variable for the array of pages
|
|
113
|
+
*/
|
|
114
|
+
this.pagesArray = [];
|
|
115
|
+
/**
|
|
116
|
+
* In component working variable for last page
|
|
117
|
+
*/
|
|
118
|
+
this.endInt = 0;
|
|
71
119
|
this.userAgent = window.navigator.userAgent;
|
|
72
120
|
this.currentPage = 1;
|
|
121
|
+
this.limitStylingAppends = false;
|
|
73
122
|
/**
|
|
74
123
|
* Navigation logic
|
|
75
124
|
*/
|
|
@@ -138,25 +187,6 @@ const HelperPagination = class {
|
|
|
138
187
|
this.stylingContainer.prepend(cssFile);
|
|
139
188
|
}, 1);
|
|
140
189
|
};
|
|
141
|
-
this.nextPage = '';
|
|
142
|
-
this.prevPage = '';
|
|
143
|
-
this.offset = 0;
|
|
144
|
-
this.limit = 1;
|
|
145
|
-
this.total = 1;
|
|
146
|
-
this.language = 'en';
|
|
147
|
-
this.clientStyling = '';
|
|
148
|
-
this.clientStylingUrlContent = '';
|
|
149
|
-
this.arrowsActive = undefined;
|
|
150
|
-
this.secondaryArrowsActive = undefined;
|
|
151
|
-
this.numberedNavActive = undefined;
|
|
152
|
-
this.offsetInt = undefined;
|
|
153
|
-
this.lastPage = false;
|
|
154
|
-
this.previousPage = false;
|
|
155
|
-
this.limitInt = undefined;
|
|
156
|
-
this.totalInt = undefined;
|
|
157
|
-
this.pagesArray = [];
|
|
158
|
-
this.endInt = 0;
|
|
159
|
-
this.limitStylingAppends = false;
|
|
160
190
|
}
|
|
161
191
|
componentWillRender() {
|
|
162
192
|
this.offsetInt = this.offset;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-86ed1cf8.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
/*
|
|
9
|
-
Stencil Client Patch Browser v4.
|
|
9
|
+
Stencil Client Patch Browser v4.25.1 | MIT Licensed | https://stenciljs.com
|
|
10
10
|
*/
|
|
11
11
|
var patchBrowser = () => {
|
|
12
12
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('helper-pagination.cjs.js', document.baseURI).href));
|
|
@@ -21,19 +21,23 @@ function _interopNamespace(e) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'helper-pagination';
|
|
24
|
-
const BUILD = /* helper-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 };
|
|
24
|
+
const BUILD = /* helper-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 };
|
|
25
25
|
|
|
26
26
|
/*
|
|
27
|
-
Stencil Client Platform v4.
|
|
27
|
+
Stencil Client Platform v4.25.1 | MIT Licensed | https://stenciljs.com
|
|
28
28
|
*/
|
|
29
29
|
var __defProp = Object.defineProperty;
|
|
30
30
|
var __export = (target, all) => {
|
|
31
31
|
for (var name in all)
|
|
32
32
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
33
33
|
};
|
|
34
|
+
|
|
35
|
+
// src/client/client-host-ref.ts
|
|
34
36
|
var hostRefs = /* @__PURE__ */ new WeakMap();
|
|
35
37
|
var getHostRef = (ref) => hostRefs.get(ref);
|
|
36
|
-
var registerInstance = (lazyInstance, hostRef) =>
|
|
38
|
+
var registerInstance = (lazyInstance, hostRef) => {
|
|
39
|
+
hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
|
40
|
+
};
|
|
37
41
|
var registerHost = (hostElement, cmpMeta) => {
|
|
38
42
|
const hostRef = {
|
|
39
43
|
$flags$: 0,
|
|
@@ -46,7 +50,8 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
|
46
50
|
hostElement["s-p"] = [];
|
|
47
51
|
hostElement["s-rc"] = [];
|
|
48
52
|
}
|
|
49
|
-
|
|
53
|
+
const ref = hostRefs.set(hostElement, hostRef);
|
|
54
|
+
return ref;
|
|
50
55
|
};
|
|
51
56
|
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
52
57
|
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
@@ -83,16 +88,22 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
83
88
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
84
89
|
/* webpackMode: "lazy" */
|
|
85
90
|
`./${bundleId}.entry.js${""}`
|
|
86
|
-
)); }).then(
|
|
87
|
-
{
|
|
88
|
-
|
|
91
|
+
)); }).then(
|
|
92
|
+
(importedModule) => {
|
|
93
|
+
{
|
|
94
|
+
cmpModules.set(bundleId, importedModule);
|
|
95
|
+
}
|
|
96
|
+
return importedModule[exportName];
|
|
97
|
+
},
|
|
98
|
+
(e) => {
|
|
99
|
+
consoleError(e, hostRef.$hostElement$);
|
|
89
100
|
}
|
|
90
|
-
|
|
91
|
-
}, consoleError);
|
|
101
|
+
);
|
|
92
102
|
};
|
|
93
103
|
|
|
94
104
|
// src/client/client-style.ts
|
|
95
105
|
var styles = /* @__PURE__ */ new Map();
|
|
106
|
+
var HYDRATED_STYLE_ID = "sty-id";
|
|
96
107
|
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
97
108
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
98
109
|
var win = typeof window !== "undefined" ? window : {};
|
|
@@ -150,12 +161,6 @@ var flush = () => {
|
|
|
150
161
|
};
|
|
151
162
|
var nextTick = (cb) => promiseResolve().then(cb);
|
|
152
163
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
153
|
-
|
|
154
|
-
// src/utils/constants.ts
|
|
155
|
-
var EMPTY_OBJ = {};
|
|
156
|
-
|
|
157
|
-
// src/utils/helpers.ts
|
|
158
|
-
var isDef = (v) => v != null;
|
|
159
164
|
var isComplexType = (o) => {
|
|
160
165
|
o = typeof o;
|
|
161
166
|
return o === "object" || o === "function";
|
|
@@ -349,7 +354,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
349
354
|
}
|
|
350
355
|
if (!appliedStyles.has(scopeId2)) {
|
|
351
356
|
{
|
|
352
|
-
styleElm = doc.createElement("style");
|
|
357
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
|
353
358
|
styleElm.innerHTML = style;
|
|
354
359
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
355
360
|
if (nonce != null) {
|
|
@@ -359,7 +364,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
359
364
|
if (styleContainerNode.nodeName === "HEAD") {
|
|
360
365
|
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
361
366
|
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
362
|
-
styleContainerNode.insertBefore(
|
|
367
|
+
styleContainerNode.insertBefore(
|
|
368
|
+
styleElm,
|
|
369
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
370
|
+
);
|
|
363
371
|
} else if ("host" in styleContainerNode) {
|
|
364
372
|
if (supportsConstructableStylesheets) {
|
|
365
373
|
const stylesheet = new CSSStyleSheet();
|
|
@@ -409,16 +417,18 @@ var attachStyles = (hostRef) => {
|
|
|
409
417
|
endAttachStyles();
|
|
410
418
|
};
|
|
411
419
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
412
|
-
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
420
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
413
421
|
if (oldValue !== newValue) {
|
|
414
422
|
let isProp = isMemberInElement(elm, memberName);
|
|
415
423
|
let ln = memberName.toLowerCase();
|
|
416
424
|
if (memberName === "class") {
|
|
417
425
|
const classList = elm.classList;
|
|
418
426
|
const oldClasses = parseClassList(oldValue);
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
427
|
+
let newClasses = parseClassList(newValue);
|
|
428
|
+
{
|
|
429
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
430
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
431
|
+
}
|
|
422
432
|
} else if (memberName === "ref") {
|
|
423
433
|
if (newValue) {
|
|
424
434
|
newValue(elm);
|
|
@@ -456,7 +466,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
456
466
|
elm.setAttribute(memberName, n);
|
|
457
467
|
}
|
|
458
468
|
}
|
|
459
|
-
} else {
|
|
469
|
+
} else if (elm[memberName] !== newValue) {
|
|
460
470
|
elm[memberName] = newValue;
|
|
461
471
|
}
|
|
462
472
|
} catch (e) {
|
|
@@ -478,24 +488,44 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
478
488
|
}
|
|
479
489
|
};
|
|
480
490
|
var parseClassListRegex = /\s/;
|
|
481
|
-
var parseClassList = (value) =>
|
|
491
|
+
var parseClassList = (value) => {
|
|
492
|
+
if (typeof value === "object" && value && "baseVal" in value) {
|
|
493
|
+
value = value.baseVal;
|
|
494
|
+
}
|
|
495
|
+
if (!value || typeof value !== "string") {
|
|
496
|
+
return [];
|
|
497
|
+
}
|
|
498
|
+
return value.split(parseClassListRegex);
|
|
499
|
+
};
|
|
482
500
|
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
483
501
|
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
484
502
|
|
|
485
503
|
// src/runtime/vdom/update-element.ts
|
|
486
|
-
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
504
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
487
505
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
488
|
-
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ ||
|
|
489
|
-
const newVnodeAttrs = newVnode.$attrs$ ||
|
|
506
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
507
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
490
508
|
{
|
|
491
509
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
492
510
|
if (!(memberName in newVnodeAttrs)) {
|
|
493
|
-
setAccessor(
|
|
511
|
+
setAccessor(
|
|
512
|
+
elm,
|
|
513
|
+
memberName,
|
|
514
|
+
oldVnodeAttrs[memberName],
|
|
515
|
+
void 0,
|
|
516
|
+
isSvgMode2,
|
|
517
|
+
newVnode.$flags$);
|
|
494
518
|
}
|
|
495
519
|
}
|
|
496
520
|
}
|
|
497
521
|
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
498
|
-
setAccessor(
|
|
522
|
+
setAccessor(
|
|
523
|
+
elm,
|
|
524
|
+
memberName,
|
|
525
|
+
oldVnodeAttrs[memberName],
|
|
526
|
+
newVnodeAttrs[memberName],
|
|
527
|
+
isSvgMode2,
|
|
528
|
+
newVnode.$flags$);
|
|
499
529
|
}
|
|
500
530
|
};
|
|
501
531
|
function sortedAttrNames(attrNames) {
|
|
@@ -507,13 +537,10 @@ function sortedAttrNames(attrNames) {
|
|
|
507
537
|
attrNames
|
|
508
538
|
);
|
|
509
539
|
}
|
|
510
|
-
|
|
511
|
-
// src/runtime/vdom/vdom-render.ts
|
|
512
|
-
var scopeId;
|
|
513
540
|
var hostTagName;
|
|
514
541
|
var useNativeShadowDom = false;
|
|
515
542
|
var isSvgMode = false;
|
|
516
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
|
543
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
517
544
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
518
545
|
let i2 = 0;
|
|
519
546
|
let elm;
|
|
@@ -527,11 +554,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
527
554
|
{
|
|
528
555
|
updateElement(null, newVNode2, isSvgMode);
|
|
529
556
|
}
|
|
530
|
-
const rootNode = elm.getRootNode();
|
|
531
|
-
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
532
|
-
if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
533
|
-
elm.classList.add(elm["s-si"] = scopeId);
|
|
534
|
-
}
|
|
535
557
|
if (newVNode2.$children$) {
|
|
536
558
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
537
559
|
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
@@ -636,6 +658,9 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
636
658
|
};
|
|
637
659
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
638
660
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
661
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
662
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
663
|
+
}
|
|
639
664
|
return true;
|
|
640
665
|
}
|
|
641
666
|
return false;
|
|
@@ -675,8 +700,9 @@ var nullifyVNodeRefs = (vNode) => {
|
|
|
675
700
|
}
|
|
676
701
|
};
|
|
677
702
|
var insertBefore = (parent, newNode, reference) => {
|
|
678
|
-
|
|
679
|
-
|
|
703
|
+
{
|
|
704
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
705
|
+
}
|
|
680
706
|
};
|
|
681
707
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
682
708
|
const hostElm = hostRef.$hostElement$;
|
|
@@ -701,9 +727,6 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
701
727
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
702
728
|
hostRef.$vnode$ = rootVnode;
|
|
703
729
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
704
|
-
{
|
|
705
|
-
scopeId = hostElm["s-sc"];
|
|
706
|
-
}
|
|
707
730
|
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
708
731
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
709
732
|
};
|
|
@@ -711,7 +734,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
711
734
|
// src/runtime/update-component.ts
|
|
712
735
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
713
736
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
714
|
-
ancestorComponent["s-p"].push(
|
|
737
|
+
const index = ancestorComponent["s-p"].push(
|
|
738
|
+
new Promise(
|
|
739
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
|
740
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
741
|
+
r();
|
|
742
|
+
}
|
|
743
|
+
)
|
|
744
|
+
);
|
|
715
745
|
}
|
|
716
746
|
};
|
|
717
747
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
@@ -737,7 +767,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
737
767
|
}
|
|
738
768
|
let maybePromise;
|
|
739
769
|
{
|
|
740
|
-
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
|
|
770
|
+
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
|
|
741
771
|
}
|
|
742
772
|
endSchedule();
|
|
743
773
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
@@ -805,7 +835,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
805
835
|
const instance = hostRef.$lazyInstance$ ;
|
|
806
836
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
807
837
|
{
|
|
808
|
-
safeCall(instance, "componentDidRender");
|
|
838
|
+
safeCall(instance, "componentDidRender", void 0, elm);
|
|
809
839
|
}
|
|
810
840
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
811
841
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
@@ -839,12 +869,12 @@ var appDidLoad = (who) => {
|
|
|
839
869
|
}
|
|
840
870
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
841
871
|
};
|
|
842
|
-
var safeCall = (instance, method, arg) => {
|
|
872
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
843
873
|
if (instance && instance[method]) {
|
|
844
874
|
try {
|
|
845
875
|
return instance[method](arg);
|
|
846
876
|
} catch (e) {
|
|
847
|
-
consoleError(e);
|
|
877
|
+
consoleError(e, elm);
|
|
848
878
|
}
|
|
849
879
|
}
|
|
850
880
|
return void 0;
|
|
@@ -887,15 +917,68 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
887
917
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
888
918
|
members.map(([memberName, [memberFlags]]) => {
|
|
889
919
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
920
|
+
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
|
921
|
+
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
922
|
+
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
923
|
+
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
924
|
+
Object.defineProperty(prototype, memberName, {
|
|
925
|
+
get() {
|
|
926
|
+
{
|
|
927
|
+
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
|
|
928
|
+
return getValue(this, memberName);
|
|
929
|
+
}
|
|
930
|
+
const ref = getHostRef(this);
|
|
931
|
+
const instance = ref ? ref.$lazyInstance$ : prototype;
|
|
932
|
+
if (!instance) return;
|
|
933
|
+
return instance[memberName];
|
|
934
|
+
}
|
|
935
|
+
},
|
|
936
|
+
configurable: true,
|
|
937
|
+
enumerable: true
|
|
938
|
+
});
|
|
939
|
+
}
|
|
890
940
|
Object.defineProperty(prototype, memberName, {
|
|
891
|
-
get() {
|
|
892
|
-
return getValue(this, memberName);
|
|
893
|
-
},
|
|
894
941
|
set(newValue) {
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
942
|
+
const ref = getHostRef(this);
|
|
943
|
+
if (origSetter) {
|
|
944
|
+
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
945
|
+
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
946
|
+
newValue = ref.$instanceValues$.get(memberName);
|
|
947
|
+
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
948
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
949
|
+
}
|
|
950
|
+
origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
|
|
951
|
+
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
952
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
953
|
+
return;
|
|
954
|
+
}
|
|
955
|
+
{
|
|
956
|
+
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
|
957
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
958
|
+
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
|
959
|
+
ref.$onReadyPromise$.then(() => {
|
|
960
|
+
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
|
|
961
|
+
ref.$lazyInstance$[memberName] = newValue;
|
|
962
|
+
}
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
return;
|
|
966
|
+
}
|
|
967
|
+
const setterSetVal = () => {
|
|
968
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
969
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
970
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
971
|
+
}
|
|
972
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
|
|
973
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
974
|
+
};
|
|
975
|
+
if (ref.$lazyInstance$) {
|
|
976
|
+
setterSetVal();
|
|
977
|
+
} else {
|
|
978
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
}
|
|
899
982
|
});
|
|
900
983
|
}
|
|
901
984
|
});
|
|
@@ -905,7 +988,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
905
988
|
plt.jmp(() => {
|
|
906
989
|
var _a2;
|
|
907
990
|
const propName = attrNameToPropName.get(attrName);
|
|
908
|
-
if (this.hasOwnProperty(propName)) {
|
|
991
|
+
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
|
|
909
992
|
newValue = this[propName];
|
|
910
993
|
delete this[propName];
|
|
911
994
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -925,7 +1008,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
925
1008
|
}
|
|
926
1009
|
return;
|
|
927
1010
|
}
|
|
928
|
-
|
|
1011
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
1012
|
+
newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
1013
|
+
if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
1014
|
+
this[propName] = newValue;
|
|
1015
|
+
}
|
|
929
1016
|
});
|
|
930
1017
|
};
|
|
931
1018
|
Cstr.observedAttributes = Array.from(
|
|
@@ -952,9 +1039,8 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
952
1039
|
let Cstr;
|
|
953
1040
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
954
1041
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
const CstrImport = loadModule(cmpMeta);
|
|
1042
|
+
{
|
|
1043
|
+
const CstrImport = loadModule(cmpMeta, hostRef);
|
|
958
1044
|
if (CstrImport && "then" in CstrImport) {
|
|
959
1045
|
const endLoad = uniqueTime();
|
|
960
1046
|
Cstr = await CstrImport;
|
|
@@ -976,16 +1062,12 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
976
1062
|
try {
|
|
977
1063
|
new Cstr(hostRef);
|
|
978
1064
|
} catch (e) {
|
|
979
|
-
consoleError(e);
|
|
1065
|
+
consoleError(e, elm);
|
|
980
1066
|
}
|
|
981
1067
|
{
|
|
982
1068
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
983
1069
|
}
|
|
984
1070
|
endNewInstance();
|
|
985
|
-
} else {
|
|
986
|
-
Cstr = elm.constructor;
|
|
987
|
-
const cmpTag = elm.localName;
|
|
988
|
-
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
989
1071
|
}
|
|
990
1072
|
if (Cstr && Cstr.style) {
|
|
991
1073
|
let style;
|
|
@@ -1008,7 +1090,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1008
1090
|
schedule();
|
|
1009
1091
|
}
|
|
1010
1092
|
};
|
|
1011
|
-
var fireConnectedCallback = (instance) => {
|
|
1093
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
1012
1094
|
};
|
|
1013
1095
|
|
|
1014
1096
|
// src/runtime/connected-callback.ts
|
|
@@ -1048,7 +1130,7 @@ var connectedCallback = (elm) => {
|
|
|
1048
1130
|
endConnected();
|
|
1049
1131
|
}
|
|
1050
1132
|
};
|
|
1051
|
-
var disconnectInstance = (instance) => {
|
|
1133
|
+
var disconnectInstance = (instance, elm) => {
|
|
1052
1134
|
};
|
|
1053
1135
|
var disconnectedCallback = async (elm) => {
|
|
1054
1136
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
@@ -1057,6 +1139,12 @@ var disconnectedCallback = async (elm) => {
|
|
|
1057
1139
|
hostRef.$onReadyPromise$.then(() => disconnectInstance());
|
|
1058
1140
|
}
|
|
1059
1141
|
}
|
|
1142
|
+
if (rootAppliedStyles.has(elm)) {
|
|
1143
|
+
rootAppliedStyles.delete(elm);
|
|
1144
|
+
}
|
|
1145
|
+
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
|
1146
|
+
rootAppliedStyles.delete(elm.shadowRoot);
|
|
1147
|
+
}
|
|
1060
1148
|
};
|
|
1061
1149
|
|
|
1062
1150
|
// src/runtime/bootstrap-lazy.ts
|
|
@@ -1133,6 +1221,13 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1133
1221
|
}
|
|
1134
1222
|
disconnectedCallback() {
|
|
1135
1223
|
plt.jmp(() => disconnectedCallback(this));
|
|
1224
|
+
plt.raf(() => {
|
|
1225
|
+
var _a3;
|
|
1226
|
+
const hostRef = getHostRef(this);
|
|
1227
|
+
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
|
1228
|
+
delete hostRef.$vnode$.$elm$;
|
|
1229
|
+
}
|
|
1230
|
+
});
|
|
1136
1231
|
}
|
|
1137
1232
|
componentOnReady() {
|
|
1138
1233
|
return getHostRef(this).$onReadyPromise$;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-86ed1cf8.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|