@everymatrix/general-slider 1.53.0 → 1.53.11
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/general-slider.cjs.entry.js +39 -9
- package/dist/cjs/general-slider.cjs.js +2 -2
- package/dist/cjs/{index-d1f313c2.js → index-d0f0bcf6.js} +166 -71
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/general-slider/general-slider.js +58 -8
- package/dist/esm/general-slider.entry.js +39 -9
- package/dist/esm/general-slider.js +3 -3
- package/dist/esm/{index-d5dd9b7c.js → index-217672e1.js} +166 -71
- package/dist/esm/loader.js +2 -2
- package/dist/general-slider/general-slider.esm.js +1 -1
- package/dist/general-slider/{p-89af433b.entry.js → p-e8b3e5f4.entry.js} +1 -1
- package/dist/general-slider/p-f26efc36.js +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-slider/.stencil/packages/stencil/general-slider/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-slider/.stencil/packages/stencil/general-slider/stencil.config.dev.d.ts +2 -0
- package/package.json +1 -1
- package/dist/general-slider/p-825871b1.js +0 -2
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/general-slider/.stencil/packages/stencil/general-slider/stencil.config.d.ts +0 -2
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/general-slider/.stencil/packages/stencil/general-slider/stencil.config.dev.d.ts +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-d0f0bcf6.js');
|
|
6
6
|
|
|
7
7
|
const generalSliderCss = ":host{display:block}.GeneralSlider{position:relative}.Slider{position:relative;width:100%;margin:0 auto;overflow:hidden}.SliderList{display:flex;margin:0;padding:0;list-style:none;transition:transform 0.5s ease-in-out}.SliderList.Static{transition-duration:0ms}::slotted(li){flex:1 0 auto;width:100%;margin:auto}::slotted(li.hide){visibility:hidden;height:0;transition-delay:500ms}.Col-2 ::slotted(li){flex:2 0 auto;width:50%}.Col-3 ::slotted(li){flex:3 0 auto;width:33.3333333333%}.Col-4 ::slotted(li){flex:4 0 auto;width:25%}.Col-5 ::slotted(li){flex:5 0 auto;width:20%}.Col-6 ::slotted(li){flex:6 0 auto;width:16.6666666667%}.Col-7 ::slotted(li){flex:7 0 auto;width:14.2857142857%}.Col-8 ::slotted(li){flex:8 0 auto;width:12.5%}.Col-9 ::slotted(li){flex:9 0 auto;width:11.1111111111%}.Col-10 ::slotted(li){flex:10 0 auto;width:10%}.Col-11 ::slotted(li){flex:11 0 auto;width:9.0909090909%}.Col-12 ::slotted(li){flex:12 0 auto;width:8.3333333333%}.Button{position:absolute;z-index:1;top:calc(50% - 32px);padding:20px;font-size:20px;line-height:20px;opacity:0.5;border:none;background:var(--emw--color-contrast, #07072A);color:var(--emw--color-white, #FFFFFF);cursor:pointer}.Button:hover{opacity:1;transition:opacity 0.5s ease-in-out}.Button[disabled],.Button[disabled]:hover{color:var(--emw--color-gray-150, #828282);opacity:0.25}.Button.ButtonNext{right:0}.PageButtons{display:flex;gap:4px;margin-top:8px}.PageButton{width:15px;height:4px;border-radius:4px;background-color:var(--emw--tournament-color-primary, #0072ed);opacity:0.2;cursor:pointer;float:right}.PageButton.active{width:45px;opacity:1}";
|
|
8
8
|
const GeneralSliderStyle0 = generalSliderCss;
|
|
@@ -10,27 +10,57 @@ const GeneralSliderStyle0 = generalSliderCss;
|
|
|
10
10
|
const GeneralSlider = class {
|
|
11
11
|
constructor(hostRef) {
|
|
12
12
|
index.registerInstance(this, hostRef);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Prev: null,
|
|
17
|
-
Next: null
|
|
18
|
-
};
|
|
19
|
-
this.xDown = null;
|
|
20
|
-
this.yDown = null;
|
|
13
|
+
/**
|
|
14
|
+
* Slide Count
|
|
15
|
+
*/
|
|
21
16
|
this.slideNumber = 3;
|
|
17
|
+
/**
|
|
18
|
+
* Slides to show
|
|
19
|
+
*/
|
|
22
20
|
this.slideShow = 3;
|
|
21
|
+
/**
|
|
22
|
+
* Display the arrow icon
|
|
23
|
+
*/
|
|
23
24
|
this.showArrow = true;
|
|
25
|
+
/**
|
|
26
|
+
* Display the button
|
|
27
|
+
*/
|
|
24
28
|
this.showButton = false;
|
|
29
|
+
/**
|
|
30
|
+
* Auto Slide
|
|
31
|
+
*/
|
|
25
32
|
this.autoSlide = false;
|
|
33
|
+
/**
|
|
34
|
+
* Auto Slide loop time
|
|
35
|
+
*/
|
|
26
36
|
this.loopTime = 1;
|
|
37
|
+
/**
|
|
38
|
+
* Auto fill the Item height
|
|
39
|
+
*/
|
|
27
40
|
this.autoItemHeight = false;
|
|
41
|
+
/**
|
|
42
|
+
* Client custom styling via inline styles
|
|
43
|
+
*/
|
|
28
44
|
this.clientStyling = '';
|
|
45
|
+
/**
|
|
46
|
+
* Client custom styling via url
|
|
47
|
+
*/
|
|
29
48
|
this.clientStylingUrl = '';
|
|
49
|
+
/**
|
|
50
|
+
* Current page of slider
|
|
51
|
+
*/
|
|
30
52
|
this.currentPage = 0;
|
|
31
53
|
this.currentSlideNumber = 0;
|
|
32
54
|
this.slidesCount = 0;
|
|
33
55
|
this.limitStylingAppends = false;
|
|
56
|
+
this.slides = null;
|
|
57
|
+
this.slideWidth = 0;
|
|
58
|
+
this.controls = {
|
|
59
|
+
Prev: null,
|
|
60
|
+
Next: null
|
|
61
|
+
};
|
|
62
|
+
this.xDown = null;
|
|
63
|
+
this.yDown = null;
|
|
34
64
|
}
|
|
35
65
|
slide(next) {
|
|
36
66
|
this.sliderEl.classList.remove('Static');
|
|
@@ -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-d0f0bcf6.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('general-slider.cjs.js', document.baseURI).href));
|
|
@@ -21,19 +21,23 @@ function _interopNamespace(e) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'general-slider';
|
|
24
|
-
const BUILD = /* general-slider */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: true, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: false, 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: false, propNumber: true, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: false };
|
|
24
|
+
const BUILD = /* general-slider */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: true, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: false, 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: false, propNumber: true, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, 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";
|
|
@@ -344,7 +349,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
344
349
|
}
|
|
345
350
|
if (!appliedStyles.has(scopeId2)) {
|
|
346
351
|
{
|
|
347
|
-
styleElm = doc.createElement("style");
|
|
352
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
|
348
353
|
styleElm.innerHTML = style;
|
|
349
354
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
350
355
|
if (nonce != null) {
|
|
@@ -354,7 +359,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
354
359
|
if (styleContainerNode.nodeName === "HEAD") {
|
|
355
360
|
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
356
361
|
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
357
|
-
styleContainerNode.insertBefore(
|
|
362
|
+
styleContainerNode.insertBefore(
|
|
363
|
+
styleElm,
|
|
364
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
365
|
+
);
|
|
358
366
|
} else if ("host" in styleContainerNode) {
|
|
359
367
|
if (supportsConstructableStylesheets) {
|
|
360
368
|
const stylesheet = new CSSStyleSheet();
|
|
@@ -404,16 +412,18 @@ var attachStyles = (hostRef) => {
|
|
|
404
412
|
endAttachStyles();
|
|
405
413
|
};
|
|
406
414
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
407
|
-
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
415
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
408
416
|
if (oldValue !== newValue) {
|
|
409
417
|
let isProp = isMemberInElement(elm, memberName);
|
|
410
418
|
let ln = memberName.toLowerCase();
|
|
411
419
|
if (memberName === "class") {
|
|
412
420
|
const classList = elm.classList;
|
|
413
421
|
const oldClasses = parseClassList(oldValue);
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
422
|
+
let newClasses = parseClassList(newValue);
|
|
423
|
+
{
|
|
424
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
425
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
426
|
+
}
|
|
417
427
|
} else if (memberName === "key") ; else if (memberName === "ref") {
|
|
418
428
|
if (newValue) {
|
|
419
429
|
newValue(elm);
|
|
@@ -451,7 +461,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
451
461
|
elm.setAttribute(memberName, n);
|
|
452
462
|
}
|
|
453
463
|
}
|
|
454
|
-
} else {
|
|
464
|
+
} else if (elm[memberName] !== newValue) {
|
|
455
465
|
elm[memberName] = newValue;
|
|
456
466
|
}
|
|
457
467
|
} catch (e) {
|
|
@@ -473,24 +483,44 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
473
483
|
}
|
|
474
484
|
};
|
|
475
485
|
var parseClassListRegex = /\s/;
|
|
476
|
-
var parseClassList = (value) =>
|
|
486
|
+
var parseClassList = (value) => {
|
|
487
|
+
if (typeof value === "object" && value && "baseVal" in value) {
|
|
488
|
+
value = value.baseVal;
|
|
489
|
+
}
|
|
490
|
+
if (!value || typeof value !== "string") {
|
|
491
|
+
return [];
|
|
492
|
+
}
|
|
493
|
+
return value.split(parseClassListRegex);
|
|
494
|
+
};
|
|
477
495
|
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
478
496
|
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
479
497
|
|
|
480
498
|
// src/runtime/vdom/update-element.ts
|
|
481
|
-
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
499
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
482
500
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
483
|
-
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ ||
|
|
484
|
-
const newVnodeAttrs = newVnode.$attrs$ ||
|
|
501
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
502
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
485
503
|
{
|
|
486
504
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
487
505
|
if (!(memberName in newVnodeAttrs)) {
|
|
488
|
-
setAccessor(
|
|
506
|
+
setAccessor(
|
|
507
|
+
elm,
|
|
508
|
+
memberName,
|
|
509
|
+
oldVnodeAttrs[memberName],
|
|
510
|
+
void 0,
|
|
511
|
+
isSvgMode2,
|
|
512
|
+
newVnode.$flags$);
|
|
489
513
|
}
|
|
490
514
|
}
|
|
491
515
|
}
|
|
492
516
|
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
493
|
-
setAccessor(
|
|
517
|
+
setAccessor(
|
|
518
|
+
elm,
|
|
519
|
+
memberName,
|
|
520
|
+
oldVnodeAttrs[memberName],
|
|
521
|
+
newVnodeAttrs[memberName],
|
|
522
|
+
isSvgMode2,
|
|
523
|
+
newVnode.$flags$);
|
|
494
524
|
}
|
|
495
525
|
};
|
|
496
526
|
function sortedAttrNames(attrNames) {
|
|
@@ -502,13 +532,10 @@ function sortedAttrNames(attrNames) {
|
|
|
502
532
|
attrNames
|
|
503
533
|
);
|
|
504
534
|
}
|
|
505
|
-
|
|
506
|
-
// src/runtime/vdom/vdom-render.ts
|
|
507
|
-
var scopeId;
|
|
508
535
|
var hostTagName;
|
|
509
536
|
var useNativeShadowDom = false;
|
|
510
537
|
var isSvgMode = false;
|
|
511
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
|
538
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
512
539
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
513
540
|
let i2 = 0;
|
|
514
541
|
let elm;
|
|
@@ -522,11 +549,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
522
549
|
{
|
|
523
550
|
updateElement(null, newVNode2, isSvgMode);
|
|
524
551
|
}
|
|
525
|
-
const rootNode = elm.getRootNode();
|
|
526
|
-
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
527
|
-
if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
528
|
-
elm.classList.add(elm["s-si"] = scopeId);
|
|
529
|
-
}
|
|
530
552
|
if (newVNode2.$children$) {
|
|
531
553
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
532
554
|
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
@@ -656,6 +678,9 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
|
656
678
|
if (!isInitialRender) {
|
|
657
679
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
658
680
|
}
|
|
681
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
682
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
683
|
+
}
|
|
659
684
|
return true;
|
|
660
685
|
}
|
|
661
686
|
return false;
|
|
@@ -696,8 +721,9 @@ var nullifyVNodeRefs = (vNode) => {
|
|
|
696
721
|
}
|
|
697
722
|
};
|
|
698
723
|
var insertBefore = (parent, newNode, reference) => {
|
|
699
|
-
|
|
700
|
-
|
|
724
|
+
{
|
|
725
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
726
|
+
}
|
|
701
727
|
};
|
|
702
728
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
703
729
|
const hostElm = hostRef.$hostElement$;
|
|
@@ -716,9 +742,6 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
716
742
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
717
743
|
hostRef.$vnode$ = rootVnode;
|
|
718
744
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
719
|
-
{
|
|
720
|
-
scopeId = hostElm["s-sc"];
|
|
721
|
-
}
|
|
722
745
|
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
723
746
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
724
747
|
};
|
|
@@ -726,7 +749,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
726
749
|
// src/runtime/update-component.ts
|
|
727
750
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
728
751
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
729
|
-
ancestorComponent["s-p"].push(
|
|
752
|
+
const index = ancestorComponent["s-p"].push(
|
|
753
|
+
new Promise(
|
|
754
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
|
755
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
756
|
+
r();
|
|
757
|
+
}
|
|
758
|
+
)
|
|
759
|
+
);
|
|
730
760
|
}
|
|
731
761
|
};
|
|
732
762
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
@@ -753,7 +783,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
753
783
|
let maybePromise;
|
|
754
784
|
if (isInitialLoad) {
|
|
755
785
|
{
|
|
756
|
-
maybePromise = safeCall(instance, "componentWillLoad");
|
|
786
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
757
787
|
}
|
|
758
788
|
}
|
|
759
789
|
endSchedule();
|
|
@@ -822,7 +852,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
822
852
|
const instance = hostRef.$lazyInstance$ ;
|
|
823
853
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
824
854
|
{
|
|
825
|
-
safeCall(instance, "componentDidRender");
|
|
855
|
+
safeCall(instance, "componentDidRender", void 0, elm);
|
|
826
856
|
}
|
|
827
857
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
828
858
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
@@ -830,7 +860,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
830
860
|
addHydratedFlag(elm);
|
|
831
861
|
}
|
|
832
862
|
{
|
|
833
|
-
safeCall(instance, "componentDidLoad");
|
|
863
|
+
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
834
864
|
}
|
|
835
865
|
endPostUpdate();
|
|
836
866
|
{
|
|
@@ -841,7 +871,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
841
871
|
}
|
|
842
872
|
} else {
|
|
843
873
|
{
|
|
844
|
-
safeCall(instance, "componentDidUpdate");
|
|
874
|
+
safeCall(instance, "componentDidUpdate", void 0, elm);
|
|
845
875
|
}
|
|
846
876
|
endPostUpdate();
|
|
847
877
|
}
|
|
@@ -862,12 +892,12 @@ var appDidLoad = (who) => {
|
|
|
862
892
|
}
|
|
863
893
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
864
894
|
};
|
|
865
|
-
var safeCall = (instance, method, arg) => {
|
|
895
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
866
896
|
if (instance && instance[method]) {
|
|
867
897
|
try {
|
|
868
898
|
return instance[method](arg);
|
|
869
899
|
} catch (e) {
|
|
870
|
-
consoleError(e);
|
|
900
|
+
consoleError(e, elm);
|
|
871
901
|
}
|
|
872
902
|
}
|
|
873
903
|
return void 0;
|
|
@@ -910,15 +940,68 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
910
940
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
911
941
|
members.map(([memberName, [memberFlags]]) => {
|
|
912
942
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
943
|
+
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
|
944
|
+
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
945
|
+
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
946
|
+
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
947
|
+
Object.defineProperty(prototype, memberName, {
|
|
948
|
+
get() {
|
|
949
|
+
{
|
|
950
|
+
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
|
|
951
|
+
return getValue(this, memberName);
|
|
952
|
+
}
|
|
953
|
+
const ref = getHostRef(this);
|
|
954
|
+
const instance = ref ? ref.$lazyInstance$ : prototype;
|
|
955
|
+
if (!instance) return;
|
|
956
|
+
return instance[memberName];
|
|
957
|
+
}
|
|
958
|
+
},
|
|
959
|
+
configurable: true,
|
|
960
|
+
enumerable: true
|
|
961
|
+
});
|
|
962
|
+
}
|
|
913
963
|
Object.defineProperty(prototype, memberName, {
|
|
914
|
-
get() {
|
|
915
|
-
return getValue(this, memberName);
|
|
916
|
-
},
|
|
917
964
|
set(newValue) {
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
965
|
+
const ref = getHostRef(this);
|
|
966
|
+
if (origSetter) {
|
|
967
|
+
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
968
|
+
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
969
|
+
newValue = ref.$instanceValues$.get(memberName);
|
|
970
|
+
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
971
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
972
|
+
}
|
|
973
|
+
origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
|
|
974
|
+
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
975
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
976
|
+
return;
|
|
977
|
+
}
|
|
978
|
+
{
|
|
979
|
+
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
|
980
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
981
|
+
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
|
982
|
+
ref.$onReadyPromise$.then(() => {
|
|
983
|
+
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
|
|
984
|
+
ref.$lazyInstance$[memberName] = newValue;
|
|
985
|
+
}
|
|
986
|
+
});
|
|
987
|
+
}
|
|
988
|
+
return;
|
|
989
|
+
}
|
|
990
|
+
const setterSetVal = () => {
|
|
991
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
992
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
993
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
994
|
+
}
|
|
995
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
|
|
996
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
997
|
+
};
|
|
998
|
+
if (ref.$lazyInstance$) {
|
|
999
|
+
setterSetVal();
|
|
1000
|
+
} else {
|
|
1001
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
922
1005
|
});
|
|
923
1006
|
}
|
|
924
1007
|
});
|
|
@@ -928,7 +1011,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
928
1011
|
plt.jmp(() => {
|
|
929
1012
|
var _a2;
|
|
930
1013
|
const propName = attrNameToPropName.get(attrName);
|
|
931
|
-
if (this.hasOwnProperty(propName)) {
|
|
1014
|
+
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
|
|
932
1015
|
newValue = this[propName];
|
|
933
1016
|
delete this[propName];
|
|
934
1017
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -948,7 +1031,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
948
1031
|
}
|
|
949
1032
|
return;
|
|
950
1033
|
}
|
|
951
|
-
|
|
1034
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
1035
|
+
newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
1036
|
+
if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
1037
|
+
this[propName] = newValue;
|
|
1038
|
+
}
|
|
952
1039
|
});
|
|
953
1040
|
};
|
|
954
1041
|
Cstr.observedAttributes = Array.from(
|
|
@@ -971,9 +1058,8 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
971
1058
|
let Cstr;
|
|
972
1059
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
973
1060
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
const CstrImport = loadModule(cmpMeta);
|
|
1061
|
+
{
|
|
1062
|
+
const CstrImport = loadModule(cmpMeta, hostRef);
|
|
977
1063
|
if (CstrImport && "then" in CstrImport) {
|
|
978
1064
|
const endLoad = uniqueTime();
|
|
979
1065
|
Cstr = await CstrImport;
|
|
@@ -995,16 +1081,12 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
995
1081
|
try {
|
|
996
1082
|
new Cstr(hostRef);
|
|
997
1083
|
} catch (e) {
|
|
998
|
-
consoleError(e);
|
|
1084
|
+
consoleError(e, elm);
|
|
999
1085
|
}
|
|
1000
1086
|
{
|
|
1001
1087
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
1002
1088
|
}
|
|
1003
1089
|
endNewInstance();
|
|
1004
|
-
} else {
|
|
1005
|
-
Cstr = elm.constructor;
|
|
1006
|
-
const cmpTag = elm.localName;
|
|
1007
|
-
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
1008
1090
|
}
|
|
1009
1091
|
if (Cstr && Cstr.style) {
|
|
1010
1092
|
let style;
|
|
@@ -1027,7 +1109,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1027
1109
|
schedule();
|
|
1028
1110
|
}
|
|
1029
1111
|
};
|
|
1030
|
-
var fireConnectedCallback = (instance) => {
|
|
1112
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
1031
1113
|
};
|
|
1032
1114
|
|
|
1033
1115
|
// src/runtime/connected-callback.ts
|
|
@@ -1067,20 +1149,26 @@ var connectedCallback = (elm) => {
|
|
|
1067
1149
|
endConnected();
|
|
1068
1150
|
}
|
|
1069
1151
|
};
|
|
1070
|
-
var disconnectInstance = (instance) => {
|
|
1152
|
+
var disconnectInstance = (instance, elm) => {
|
|
1071
1153
|
{
|
|
1072
|
-
safeCall(instance, "disconnectedCallback");
|
|
1154
|
+
safeCall(instance, "disconnectedCallback", void 0, elm || instance);
|
|
1073
1155
|
}
|
|
1074
1156
|
};
|
|
1075
1157
|
var disconnectedCallback = async (elm) => {
|
|
1076
1158
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1077
1159
|
const hostRef = getHostRef(elm);
|
|
1078
1160
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1079
|
-
disconnectInstance(hostRef.$lazyInstance
|
|
1161
|
+
disconnectInstance(hostRef.$lazyInstance$, elm);
|
|
1080
1162
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1081
|
-
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance
|
|
1163
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
|
|
1082
1164
|
}
|
|
1083
1165
|
}
|
|
1166
|
+
if (rootAppliedStyles.has(elm)) {
|
|
1167
|
+
rootAppliedStyles.delete(elm);
|
|
1168
|
+
}
|
|
1169
|
+
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
|
1170
|
+
rootAppliedStyles.delete(elm.shadowRoot);
|
|
1171
|
+
}
|
|
1084
1172
|
};
|
|
1085
1173
|
|
|
1086
1174
|
// src/runtime/bootstrap-lazy.ts
|
|
@@ -1154,6 +1242,13 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1154
1242
|
}
|
|
1155
1243
|
disconnectedCallback() {
|
|
1156
1244
|
plt.jmp(() => disconnectedCallback(this));
|
|
1245
|
+
plt.raf(() => {
|
|
1246
|
+
var _a3;
|
|
1247
|
+
const hostRef = getHostRef(this);
|
|
1248
|
+
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
|
1249
|
+
delete hostRef.$vnode$.$elm$;
|
|
1250
|
+
}
|
|
1251
|
+
});
|
|
1157
1252
|
}
|
|
1158
1253
|
componentOnReady() {
|
|
1159
1254
|
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-d0f0bcf6.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|