@sankhyalabs/sankhyablocks 1.3.31-beta.4 → 1.3.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-ebe8245e.js → index-1133bc2a.js} +9 -453
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/sankhyablocks.cjs.js +2 -2
- package/dist/cjs/snk-application.cjs.entry.js +95 -118
- package/dist/cjs/snk-pesquisa.cjs.entry.js +2 -2
- package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +0 -4
- package/dist/collection/components/snk-application/snk-application.js +20 -61
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +2 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +21 -36
- package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +3 -4
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +1 -0
- package/dist/components/snk-application2.js +94 -118
- package/dist/components/snk-pesquisa2.js +1 -1
- package/dist/esm/{index-7565ae23.js → index-ffda6382.js} +10 -453
- package/dist/esm/loader.js +2 -2
- package/dist/esm/sankhyablocks.js +2 -2
- package/dist/esm/snk-application.entry.js +95 -118
- package/dist/esm/snk-pesquisa.entry.js +2 -2
- package/dist/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/{p-bb31ea2a.entry.js → p-2a7b4cb3.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6d82d7fd.entry.js → p-49fdec1f.entry.js} +1 -1
- package/dist/sankhyablocks/p-9bc9abe0.entry.js +69 -0
- package/dist/sankhyablocks/p-edcb9d8e.js +2 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +5 -6
- package/dist/types/components.d.ts +1 -119
- package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +1 -1
- package/package.json +5 -5
- package/react/components.d.ts +0 -4
- package/react/components.js +0 -4
- package/react/components.js.map +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +0 -174
- package/dist/cjs/snk-form.cjs.entry.js +0 -95
- package/dist/cjs/snk-grid.cjs.entry.js +0 -64
- package/dist/cjs/snk-taskbar.cjs.entry.js +0 -159
- package/dist/cjs/taskbar-elements-589a3744.js +0 -68
- package/dist/collection/components/snk-data-unit/snk-data-unit.css +0 -6
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +0 -429
- package/dist/collection/components/snk-form/snk-form.css +0 -3
- package/dist/collection/components/snk-form/snk-form.js +0 -194
- package/dist/collection/components/snk-grid/snk-grid.css +0 -5
- package/dist/collection/components/snk-grid/snk-grid.js +0 -128
- package/dist/collection/components/snk-taskbar/component/snk-popup-button.js +0 -7
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +0 -63
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +0 -3
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +0 -268
- package/dist/components/snk-data-unit.d.ts +0 -11
- package/dist/components/snk-data-unit.js +0 -198
- package/dist/components/snk-form.d.ts +0 -11
- package/dist/components/snk-form.js +0 -121
- package/dist/components/snk-grid.d.ts +0 -11
- package/dist/components/snk-grid.js +0 -88
- package/dist/components/snk-taskbar.d.ts +0 -11
- package/dist/components/snk-taskbar.js +0 -6
- package/dist/components/snk-taskbar2.js +0 -239
- package/dist/esm/snk-data-unit.entry.js +0 -170
- package/dist/esm/snk-form.entry.js +0 -91
- package/dist/esm/snk-grid.entry.js +0 -60
- package/dist/esm/snk-taskbar.entry.js +0 -155
- package/dist/esm/taskbar-elements-b6822601.js +0 -66
- package/dist/sankhyablocks/p-306224bf.entry.js +0 -1
- package/dist/sankhyablocks/p-4ee1e12b.js +0 -1
- package/dist/sankhyablocks/p-88278b85.entry.js +0 -1
- package/dist/sankhyablocks/p-90b832f7.js +0 -2
- package/dist/sankhyablocks/p-a4b2fa10.entry.js +0 -69
- package/dist/sankhyablocks/p-bb8d8fe7.entry.js +0 -1
- package/dist/sankhyablocks/p-e7ade160.entry.js +0 -1
- package/dist/types/components/snk-taskbar/component/snk-popup-button.d.ts +0 -12
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +0 -24
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +0 -28
|
@@ -23,11 +23,7 @@ function _interopNamespace(e) {
|
|
|
23
23
|
const NAMESPACE = 'sankhyablocks';
|
|
24
24
|
|
|
25
25
|
let scopeId;
|
|
26
|
-
let contentRef;
|
|
27
26
|
let hostTagName;
|
|
28
|
-
let useNativeShadowDom = false;
|
|
29
|
-
let checkSlotFallbackVisibility = false;
|
|
30
|
-
let checkSlotRelocate = false;
|
|
31
27
|
let isSvgMode = false;
|
|
32
28
|
let queuePending = false;
|
|
33
29
|
const win = typeof window !== 'undefined' ? window : {};
|
|
@@ -161,8 +157,6 @@ const isComplexType = (o) => {
|
|
|
161
157
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
162
158
|
const h = (nodeName, vnodeData, ...children) => {
|
|
163
159
|
let child = null;
|
|
164
|
-
let key = null;
|
|
165
|
-
let slotName = null;
|
|
166
160
|
let simple = false;
|
|
167
161
|
let lastSimple = false;
|
|
168
162
|
const vNodeChildren = [];
|
|
@@ -190,13 +184,6 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
190
184
|
};
|
|
191
185
|
walk(children);
|
|
192
186
|
if (vnodeData) {
|
|
193
|
-
// normalize class / classname attributes
|
|
194
|
-
if (vnodeData.key) {
|
|
195
|
-
key = vnodeData.key;
|
|
196
|
-
}
|
|
197
|
-
if (vnodeData.name) {
|
|
198
|
-
slotName = vnodeData.name;
|
|
199
|
-
}
|
|
200
187
|
{
|
|
201
188
|
const classData = vnodeData.className || vnodeData.class;
|
|
202
189
|
if (classData) {
|
|
@@ -209,21 +196,11 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
209
196
|
}
|
|
210
197
|
}
|
|
211
198
|
}
|
|
212
|
-
if (typeof nodeName === 'function') {
|
|
213
|
-
// nodeName is a functional component
|
|
214
|
-
return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
|
|
215
|
-
}
|
|
216
199
|
const vnode = newVNode(nodeName, null);
|
|
217
200
|
vnode.$attrs$ = vnodeData;
|
|
218
201
|
if (vNodeChildren.length > 0) {
|
|
219
202
|
vnode.$children$ = vNodeChildren;
|
|
220
203
|
}
|
|
221
|
-
{
|
|
222
|
-
vnode.$key$ = key;
|
|
223
|
-
}
|
|
224
|
-
{
|
|
225
|
-
vnode.$name$ = slotName;
|
|
226
|
-
}
|
|
227
204
|
return vnode;
|
|
228
205
|
};
|
|
229
206
|
const newVNode = (tag, text) => {
|
|
@@ -237,46 +214,10 @@ const newVNode = (tag, text) => {
|
|
|
237
214
|
{
|
|
238
215
|
vnode.$attrs$ = null;
|
|
239
216
|
}
|
|
240
|
-
{
|
|
241
|
-
vnode.$key$ = null;
|
|
242
|
-
}
|
|
243
|
-
{
|
|
244
|
-
vnode.$name$ = null;
|
|
245
|
-
}
|
|
246
217
|
return vnode;
|
|
247
218
|
};
|
|
248
219
|
const Host = {};
|
|
249
220
|
const isHost = (node) => node && node.$tag$ === Host;
|
|
250
|
-
const vdomFnUtils = {
|
|
251
|
-
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
|
252
|
-
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
|
|
253
|
-
};
|
|
254
|
-
const convertToPublic = (node) => ({
|
|
255
|
-
vattrs: node.$attrs$,
|
|
256
|
-
vchildren: node.$children$,
|
|
257
|
-
vkey: node.$key$,
|
|
258
|
-
vname: node.$name$,
|
|
259
|
-
vtag: node.$tag$,
|
|
260
|
-
vtext: node.$text$,
|
|
261
|
-
});
|
|
262
|
-
const convertToPrivate = (node) => {
|
|
263
|
-
if (typeof node.vtag === 'function') {
|
|
264
|
-
const vnodeData = Object.assign({}, node.vattrs);
|
|
265
|
-
if (node.vkey) {
|
|
266
|
-
vnodeData.key = node.vkey;
|
|
267
|
-
}
|
|
268
|
-
if (node.vname) {
|
|
269
|
-
vnodeData.name = node.vname;
|
|
270
|
-
}
|
|
271
|
-
return h(node.vtag, vnodeData, ...(node.vchildren || []));
|
|
272
|
-
}
|
|
273
|
-
const vnode = newVNode(node.vtag, node.vtext);
|
|
274
|
-
vnode.$attrs$ = node.vattrs;
|
|
275
|
-
vnode.$children$ = node.vchildren;
|
|
276
|
-
vnode.$key$ = node.vkey;
|
|
277
|
-
vnode.$name$ = node.vname;
|
|
278
|
-
return vnode;
|
|
279
|
-
};
|
|
280
221
|
/**
|
|
281
222
|
* Production setAccessor() function based on Preact by
|
|
282
223
|
* Jason Miller (@developit)
|
|
@@ -296,8 +237,6 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
296
237
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
297
238
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
298
239
|
}
|
|
299
|
-
else if (memberName === 'key')
|
|
300
|
-
;
|
|
301
240
|
else if (memberName === 'ref') {
|
|
302
241
|
// minifier will clean this up
|
|
303
242
|
if (newValue) {
|
|
@@ -410,36 +349,13 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
410
349
|
let i = 0;
|
|
411
350
|
let elm;
|
|
412
351
|
let childNode;
|
|
413
|
-
let oldVNode;
|
|
414
|
-
if (!useNativeShadowDom) {
|
|
415
|
-
// remember for later we need to check to relocate nodes
|
|
416
|
-
checkSlotRelocate = true;
|
|
417
|
-
if (newVNode.$tag$ === 'slot') {
|
|
418
|
-
if (scopeId) {
|
|
419
|
-
// scoped css needs to add its scoped id to the parent element
|
|
420
|
-
parentElm.classList.add(scopeId + '-s');
|
|
421
|
-
}
|
|
422
|
-
newVNode.$flags$ |= newVNode.$children$
|
|
423
|
-
? // slot element has fallback content
|
|
424
|
-
2 /* isSlotFallback */
|
|
425
|
-
: // slot element does not have fallback content
|
|
426
|
-
1 /* isSlotReference */;
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
352
|
if (newVNode.$text$ !== null) {
|
|
430
353
|
// create text node
|
|
431
354
|
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
|
432
355
|
}
|
|
433
|
-
else if (newVNode.$flags$ & 1 /* isSlotReference */) {
|
|
434
|
-
// create a slot reference node
|
|
435
|
-
elm = newVNode.$elm$ =
|
|
436
|
-
doc.createTextNode('');
|
|
437
|
-
}
|
|
438
356
|
else {
|
|
439
357
|
// create element
|
|
440
|
-
elm = newVNode.$elm$ = (doc.createElement(newVNode.$
|
|
441
|
-
? 'slot-fb'
|
|
442
|
-
: newVNode.$tag$));
|
|
358
|
+
elm = newVNode.$elm$ = (doc.createElement(newVNode.$tag$));
|
|
443
359
|
// add css classes, attrs, props, listeners, etc.
|
|
444
360
|
{
|
|
445
361
|
updateElement(null, newVNode, isSvgMode);
|
|
@@ -452,7 +368,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
452
368
|
if (newVNode.$children$) {
|
|
453
369
|
for (i = 0; i < newVNode.$children$.length; ++i) {
|
|
454
370
|
// create the node
|
|
455
|
-
childNode = createElm(oldParentVNode, newVNode, i
|
|
371
|
+
childNode = createElm(oldParentVNode, newVNode, i);
|
|
456
372
|
// return node could have been null
|
|
457
373
|
if (childNode) {
|
|
458
374
|
// append our new node
|
|
@@ -461,62 +377,20 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
461
377
|
}
|
|
462
378
|
}
|
|
463
379
|
}
|
|
464
|
-
{
|
|
465
|
-
elm['s-hn'] = hostTagName;
|
|
466
|
-
if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
467
|
-
// remember the content reference comment
|
|
468
|
-
elm['s-sr'] = true;
|
|
469
|
-
// remember the content reference comment
|
|
470
|
-
elm['s-cr'] = contentRef;
|
|
471
|
-
// remember the slot name, or empty string for default slot
|
|
472
|
-
elm['s-sn'] = newVNode.$name$ || '';
|
|
473
|
-
// check if we've got an old vnode for this slot
|
|
474
|
-
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
475
|
-
if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
|
|
476
|
-
// we've got an old slot vnode and the wrapper is being replaced
|
|
477
|
-
// so let's move the old slot content back to it's original location
|
|
478
|
-
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
380
|
return elm;
|
|
483
381
|
};
|
|
484
|
-
const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
485
|
-
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
486
|
-
const oldSlotChildNodes = parentElm.childNodes;
|
|
487
|
-
for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
|
|
488
|
-
const childNode = oldSlotChildNodes[i];
|
|
489
|
-
if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
|
|
490
|
-
// // this child node in the old element is from another component
|
|
491
|
-
// // remove this node from the old slot's parent
|
|
492
|
-
// childNode.remove();
|
|
493
|
-
// and relocate it back to it's original location
|
|
494
|
-
parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
|
|
495
|
-
// remove the old original location comment entirely
|
|
496
|
-
// later on the patch function will know what to do
|
|
497
|
-
// and move this to the correct spot in need be
|
|
498
|
-
childNode['s-ol'].remove();
|
|
499
|
-
childNode['s-ol'] = undefined;
|
|
500
|
-
checkSlotRelocate = true;
|
|
501
|
-
}
|
|
502
|
-
if (recursive) {
|
|
503
|
-
putBackInOriginalLocation(childNode, recursive);
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
507
|
-
};
|
|
508
382
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
509
|
-
let containerElm = (
|
|
383
|
+
let containerElm = (parentElm);
|
|
510
384
|
let childNode;
|
|
511
385
|
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
512
386
|
containerElm = containerElm.shadowRoot;
|
|
513
387
|
}
|
|
514
388
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
515
389
|
if (vnodes[startIdx]) {
|
|
516
|
-
childNode = createElm(null, parentVNode, startIdx
|
|
390
|
+
childNode = createElm(null, parentVNode, startIdx);
|
|
517
391
|
if (childNode) {
|
|
518
392
|
vnodes[startIdx].$elm$ = childNode;
|
|
519
|
-
containerElm.insertBefore(childNode,
|
|
393
|
+
containerElm.insertBefore(childNode, before);
|
|
520
394
|
}
|
|
521
395
|
}
|
|
522
396
|
}
|
|
@@ -526,20 +400,6 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
526
400
|
if ((vnode = vnodes[startIdx])) {
|
|
527
401
|
elm = vnode.$elm$;
|
|
528
402
|
callNodeRefs(vnode);
|
|
529
|
-
{
|
|
530
|
-
// we're removing this element
|
|
531
|
-
// so it's possible we need to show slot fallback content now
|
|
532
|
-
checkSlotFallbackVisibility = true;
|
|
533
|
-
if (elm['s-ol']) {
|
|
534
|
-
// remove the original location comment
|
|
535
|
-
elm['s-ol'].remove();
|
|
536
|
-
}
|
|
537
|
-
else {
|
|
538
|
-
// it's possible that child nodes of the node
|
|
539
|
-
// that's being removed are slot nodes
|
|
540
|
-
putBackInOriginalLocation(elm, true);
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
403
|
// remove the vnode's element from the dom
|
|
544
404
|
elm.remove();
|
|
545
405
|
}
|
|
@@ -548,8 +408,6 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
548
408
|
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
549
409
|
let oldStartIdx = 0;
|
|
550
410
|
let newStartIdx = 0;
|
|
551
|
-
let idxInOld = 0;
|
|
552
|
-
let i = 0;
|
|
553
411
|
let oldEndIdx = oldCh.length - 1;
|
|
554
412
|
let oldStartVnode = oldCh[0];
|
|
555
413
|
let oldEndVnode = oldCh[oldEndIdx];
|
|
@@ -557,7 +415,6 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
557
415
|
let newStartVnode = newCh[0];
|
|
558
416
|
let newEndVnode = newCh[newEndIdx];
|
|
559
417
|
let node;
|
|
560
|
-
let elmToMove;
|
|
561
418
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
562
419
|
if (oldStartVnode == null) {
|
|
563
420
|
// Vnode might have been moved left
|
|
@@ -583,56 +440,26 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
583
440
|
newEndVnode = newCh[--newEndIdx];
|
|
584
441
|
}
|
|
585
442
|
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
586
|
-
// Vnode moved right
|
|
587
|
-
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
588
|
-
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
589
|
-
}
|
|
590
443
|
patch(oldStartVnode, newEndVnode);
|
|
591
444
|
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
592
445
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
593
446
|
newEndVnode = newCh[--newEndIdx];
|
|
594
447
|
}
|
|
595
448
|
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
596
|
-
// Vnode moved left
|
|
597
|
-
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
598
|
-
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
599
|
-
}
|
|
600
449
|
patch(oldEndVnode, newStartVnode);
|
|
601
450
|
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
602
451
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
603
452
|
newStartVnode = newCh[++newStartIdx];
|
|
604
453
|
}
|
|
605
454
|
else {
|
|
606
|
-
// createKeyToOldIdx
|
|
607
|
-
idxInOld = -1;
|
|
608
455
|
{
|
|
609
|
-
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
|
610
|
-
if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
|
|
611
|
-
idxInOld = i;
|
|
612
|
-
break;
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
if (idxInOld >= 0) {
|
|
617
|
-
elmToMove = oldCh[idxInOld];
|
|
618
|
-
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
619
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
|
|
620
|
-
}
|
|
621
|
-
else {
|
|
622
|
-
patch(elmToMove, newStartVnode);
|
|
623
|
-
oldCh[idxInOld] = undefined;
|
|
624
|
-
node = elmToMove.$elm$;
|
|
625
|
-
}
|
|
626
|
-
newStartVnode = newCh[++newStartIdx];
|
|
627
|
-
}
|
|
628
|
-
else {
|
|
629
456
|
// new element
|
|
630
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx
|
|
457
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
|
|
631
458
|
newStartVnode = newCh[++newStartIdx];
|
|
632
459
|
}
|
|
633
460
|
if (node) {
|
|
634
461
|
{
|
|
635
|
-
|
|
462
|
+
oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
|
|
636
463
|
}
|
|
637
464
|
}
|
|
638
465
|
}
|
|
@@ -648,36 +475,19 @@ const isSameVnode = (vnode1, vnode2) => {
|
|
|
648
475
|
// compare if two vnode to see if they're "technically" the same
|
|
649
476
|
// need to have the same element tag, and same key to be the same
|
|
650
477
|
if (vnode1.$tag$ === vnode2.$tag$) {
|
|
651
|
-
|
|
652
|
-
return vnode1.$name$ === vnode2.$name$;
|
|
653
|
-
}
|
|
654
|
-
{
|
|
655
|
-
return vnode1.$key$ === vnode2.$key$;
|
|
656
|
-
}
|
|
478
|
+
return true;
|
|
657
479
|
}
|
|
658
480
|
return false;
|
|
659
481
|
};
|
|
660
|
-
const referenceNode = (node) => {
|
|
661
|
-
// this node was relocated to a new location in the dom
|
|
662
|
-
// because of some other component's slot
|
|
663
|
-
// but we still have an html comment in place of where
|
|
664
|
-
// it's original location was according to it's original vdom
|
|
665
|
-
return (node && node['s-ol']) || node;
|
|
666
|
-
};
|
|
667
|
-
const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
|
|
668
482
|
const patch = (oldVNode, newVNode) => {
|
|
669
483
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
670
484
|
const oldChildren = oldVNode.$children$;
|
|
671
485
|
const newChildren = newVNode.$children$;
|
|
672
|
-
const tag = newVNode.$tag$;
|
|
673
486
|
const text = newVNode.$text$;
|
|
674
|
-
let defaultHolder;
|
|
675
487
|
if (text === null) {
|
|
676
488
|
// element node
|
|
677
489
|
{
|
|
678
|
-
|
|
679
|
-
;
|
|
680
|
-
else {
|
|
490
|
+
{
|
|
681
491
|
// either this is the first render of an element OR it's an update
|
|
682
492
|
// AND we already know it's possible it could have changed
|
|
683
493
|
// this updates the element's css classes, attrs, props, listeners, etc.
|
|
@@ -702,147 +512,12 @@ const patch = (oldVNode, newVNode) => {
|
|
|
702
512
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
703
513
|
}
|
|
704
514
|
}
|
|
705
|
-
else if ((defaultHolder = elm['s-cr'])) {
|
|
706
|
-
// this element has slotted content
|
|
707
|
-
defaultHolder.parentNode.textContent = text;
|
|
708
|
-
}
|
|
709
515
|
else if (oldVNode.$text$ !== text) {
|
|
710
516
|
// update the text content for the text only vnode
|
|
711
517
|
// and also only if the text is different than before
|
|
712
518
|
elm.data = text;
|
|
713
519
|
}
|
|
714
520
|
};
|
|
715
|
-
const updateFallbackSlotVisibility = (elm) => {
|
|
716
|
-
// tslint:disable-next-line: prefer-const
|
|
717
|
-
const childNodes = elm.childNodes;
|
|
718
|
-
let childNode;
|
|
719
|
-
let i;
|
|
720
|
-
let ilen;
|
|
721
|
-
let j;
|
|
722
|
-
let slotNameAttr;
|
|
723
|
-
let nodeType;
|
|
724
|
-
for (i = 0, ilen = childNodes.length; i < ilen; i++) {
|
|
725
|
-
childNode = childNodes[i];
|
|
726
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
727
|
-
if (childNode['s-sr']) {
|
|
728
|
-
// this is a slot fallback node
|
|
729
|
-
// get the slot name for this slot reference node
|
|
730
|
-
slotNameAttr = childNode['s-sn'];
|
|
731
|
-
// by default always show a fallback slot node
|
|
732
|
-
// then hide it if there are other slots in the light dom
|
|
733
|
-
childNode.hidden = false;
|
|
734
|
-
for (j = 0; j < ilen; j++) {
|
|
735
|
-
nodeType = childNodes[j].nodeType;
|
|
736
|
-
if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
|
|
737
|
-
// this sibling node is from a different component OR is a named fallback slot node
|
|
738
|
-
if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
|
|
739
|
-
childNode.hidden = true;
|
|
740
|
-
break;
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
else {
|
|
744
|
-
// this is a default fallback slot node
|
|
745
|
-
// any element or text node (with content)
|
|
746
|
-
// should hide the default fallback slot node
|
|
747
|
-
if (nodeType === 1 /* ElementNode */ ||
|
|
748
|
-
(nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
|
|
749
|
-
childNode.hidden = true;
|
|
750
|
-
break;
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
// keep drilling down
|
|
756
|
-
updateFallbackSlotVisibility(childNode);
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
};
|
|
760
|
-
const relocateNodes = [];
|
|
761
|
-
const relocateSlotContent = (elm) => {
|
|
762
|
-
// tslint:disable-next-line: prefer-const
|
|
763
|
-
let childNode;
|
|
764
|
-
let node;
|
|
765
|
-
let hostContentNodes;
|
|
766
|
-
let slotNameAttr;
|
|
767
|
-
let relocateNodeData;
|
|
768
|
-
let j;
|
|
769
|
-
let i = 0;
|
|
770
|
-
const childNodes = elm.childNodes;
|
|
771
|
-
const ilen = childNodes.length;
|
|
772
|
-
for (; i < ilen; i++) {
|
|
773
|
-
childNode = childNodes[i];
|
|
774
|
-
if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
|
|
775
|
-
// first got the content reference comment node
|
|
776
|
-
// then we got it's parent, which is where all the host content is in now
|
|
777
|
-
hostContentNodes = node.parentNode.childNodes;
|
|
778
|
-
slotNameAttr = childNode['s-sn'];
|
|
779
|
-
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
780
|
-
node = hostContentNodes[j];
|
|
781
|
-
if (!node['s-cn'] && !node['s-nr'] && node['s-hn'] !== childNode['s-hn']) {
|
|
782
|
-
// let's do some relocating to its new home
|
|
783
|
-
// but never relocate a content reference node
|
|
784
|
-
// that is suppose to always represent the original content location
|
|
785
|
-
if (isNodeLocatedInSlot(node, slotNameAttr)) {
|
|
786
|
-
// it's possible we've already decided to relocate this node
|
|
787
|
-
relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
788
|
-
// made some changes to slots
|
|
789
|
-
// let's make sure we also double check
|
|
790
|
-
// fallbacks are correctly hidden or shown
|
|
791
|
-
checkSlotFallbackVisibility = true;
|
|
792
|
-
node['s-sn'] = node['s-sn'] || slotNameAttr;
|
|
793
|
-
if (relocateNodeData) {
|
|
794
|
-
// previously we never found a slot home for this node
|
|
795
|
-
// but turns out we did, so let's remember it now
|
|
796
|
-
relocateNodeData.$slotRefNode$ = childNode;
|
|
797
|
-
}
|
|
798
|
-
else {
|
|
799
|
-
// add to our list of nodes to relocate
|
|
800
|
-
relocateNodes.push({
|
|
801
|
-
$slotRefNode$: childNode,
|
|
802
|
-
$nodeToRelocate$: node,
|
|
803
|
-
});
|
|
804
|
-
}
|
|
805
|
-
if (node['s-sr']) {
|
|
806
|
-
relocateNodes.map((relocateNode) => {
|
|
807
|
-
if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
|
|
808
|
-
relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
809
|
-
if (relocateNodeData && !relocateNode.$slotRefNode$) {
|
|
810
|
-
relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
});
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
|
|
817
|
-
// so far this element does not have a slot home, not setting slotRefNode on purpose
|
|
818
|
-
// if we never find a home for this element then we'll need to hide it
|
|
819
|
-
relocateNodes.push({
|
|
820
|
-
$nodeToRelocate$: node,
|
|
821
|
-
});
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
827
|
-
relocateSlotContent(childNode);
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
};
|
|
831
|
-
const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
|
|
832
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
833
|
-
if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
|
|
834
|
-
return true;
|
|
835
|
-
}
|
|
836
|
-
if (nodeToRelocate.getAttribute('slot') === slotNameAttr) {
|
|
837
|
-
return true;
|
|
838
|
-
}
|
|
839
|
-
return false;
|
|
840
|
-
}
|
|
841
|
-
if (nodeToRelocate['s-sn'] === slotNameAttr) {
|
|
842
|
-
return true;
|
|
843
|
-
}
|
|
844
|
-
return slotNameAttr === '';
|
|
845
|
-
};
|
|
846
521
|
const callNodeRefs = (vNode) => {
|
|
847
522
|
{
|
|
848
523
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
@@ -851,7 +526,6 @@ const callNodeRefs = (vNode) => {
|
|
|
851
526
|
};
|
|
852
527
|
const renderVdom = (hostRef, renderFnResults) => {
|
|
853
528
|
const hostElm = hostRef.$hostElement$;
|
|
854
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
855
529
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
856
530
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
857
531
|
hostTagName = hostElm.tagName;
|
|
@@ -862,90 +536,8 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
862
536
|
{
|
|
863
537
|
scopeId = hostElm['s-sc'];
|
|
864
538
|
}
|
|
865
|
-
{
|
|
866
|
-
contentRef = hostElm['s-cr'];
|
|
867
|
-
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
868
|
-
// always reset
|
|
869
|
-
checkSlotFallbackVisibility = false;
|
|
870
|
-
}
|
|
871
539
|
// synchronous patch
|
|
872
540
|
patch(oldVNode, rootVnode);
|
|
873
|
-
{
|
|
874
|
-
// while we're moving nodes around existing nodes, temporarily disable
|
|
875
|
-
// the disconnectCallback from working
|
|
876
|
-
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
877
|
-
if (checkSlotRelocate) {
|
|
878
|
-
relocateSlotContent(rootVnode.$elm$);
|
|
879
|
-
let relocateData;
|
|
880
|
-
let nodeToRelocate;
|
|
881
|
-
let orgLocationNode;
|
|
882
|
-
let parentNodeRef;
|
|
883
|
-
let insertBeforeNode;
|
|
884
|
-
let refNode;
|
|
885
|
-
let i = 0;
|
|
886
|
-
for (; i < relocateNodes.length; i++) {
|
|
887
|
-
relocateData = relocateNodes[i];
|
|
888
|
-
nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
889
|
-
if (!nodeToRelocate['s-ol']) {
|
|
890
|
-
// add a reference node marking this node's original location
|
|
891
|
-
// keep a reference to this node for later lookups
|
|
892
|
-
orgLocationNode =
|
|
893
|
-
doc.createTextNode('');
|
|
894
|
-
orgLocationNode['s-nr'] = nodeToRelocate;
|
|
895
|
-
nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
for (i = 0; i < relocateNodes.length; i++) {
|
|
899
|
-
relocateData = relocateNodes[i];
|
|
900
|
-
nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
901
|
-
if (relocateData.$slotRefNode$) {
|
|
902
|
-
// by default we're just going to insert it directly
|
|
903
|
-
// after the slot reference node
|
|
904
|
-
parentNodeRef = relocateData.$slotRefNode$.parentNode;
|
|
905
|
-
insertBeforeNode = relocateData.$slotRefNode$.nextSibling;
|
|
906
|
-
orgLocationNode = nodeToRelocate['s-ol'];
|
|
907
|
-
while ((orgLocationNode = orgLocationNode.previousSibling)) {
|
|
908
|
-
refNode = orgLocationNode['s-nr'];
|
|
909
|
-
if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
|
|
910
|
-
refNode = refNode.nextSibling;
|
|
911
|
-
if (!refNode || !refNode['s-nr']) {
|
|
912
|
-
insertBeforeNode = refNode;
|
|
913
|
-
break;
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
|
|
918
|
-
nodeToRelocate.nextSibling !== insertBeforeNode) {
|
|
919
|
-
// we've checked that it's worth while to relocate
|
|
920
|
-
// since that the node to relocate
|
|
921
|
-
// has a different next sibling or parent relocated
|
|
922
|
-
if (nodeToRelocate !== insertBeforeNode) {
|
|
923
|
-
if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
|
|
924
|
-
// probably a component in the index.html that doesn't have it's hostname set
|
|
925
|
-
nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
|
|
926
|
-
}
|
|
927
|
-
// add it back to the dom but in its new home
|
|
928
|
-
parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
|
|
929
|
-
}
|
|
930
|
-
}
|
|
931
|
-
}
|
|
932
|
-
else {
|
|
933
|
-
// this node doesn't have a slot home to go to, so let's hide it
|
|
934
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
935
|
-
nodeToRelocate.hidden = true;
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
if (checkSlotFallbackVisibility) {
|
|
941
|
-
updateFallbackSlotVisibility(rootVnode.$elm$);
|
|
942
|
-
}
|
|
943
|
-
// done moving nodes around
|
|
944
|
-
// allow the disconnect callback to work again
|
|
945
|
-
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
946
|
-
// always reset
|
|
947
|
-
relocateNodes.length = 0;
|
|
948
|
-
}
|
|
949
541
|
};
|
|
950
542
|
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
951
543
|
const createEvent = (ref, name, flags) => {
|
|
@@ -1002,9 +594,6 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1002
594
|
promise = safeCall(instance, 'componentWillLoad');
|
|
1003
595
|
}
|
|
1004
596
|
}
|
|
1005
|
-
{
|
|
1006
|
-
promise = then(promise, () => safeCall(instance, 'componentWillRender'));
|
|
1007
|
-
}
|
|
1008
597
|
endSchedule();
|
|
1009
598
|
return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
1010
599
|
};
|
|
@@ -1074,9 +663,6 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1074
663
|
const endPostUpdate = createTime('postUpdate', tagName);
|
|
1075
664
|
const instance = hostRef.$lazyInstance$ ;
|
|
1076
665
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1077
|
-
{
|
|
1078
|
-
safeCall(instance, 'componentDidRender');
|
|
1079
|
-
}
|
|
1080
666
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1081
667
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1082
668
|
{
|
|
@@ -1166,15 +752,6 @@ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
|
1166
752
|
const parsePropertyValue = (propValue, propType) => {
|
|
1167
753
|
// ensure this value is of the correct prop type
|
|
1168
754
|
if (propValue != null && !isComplexType(propValue)) {
|
|
1169
|
-
if (propType & 4 /* Boolean */) {
|
|
1170
|
-
// per the HTML spec, any string value means it is a boolean true value
|
|
1171
|
-
// but we'll cheat here and say that the string "false" is the boolean false
|
|
1172
|
-
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
1173
|
-
}
|
|
1174
|
-
if (propType & 2 /* Number */) {
|
|
1175
|
-
// force it to be a number
|
|
1176
|
-
return parseFloat(propValue);
|
|
1177
|
-
}
|
|
1178
755
|
if (propType & 1 /* String */) {
|
|
1179
756
|
// could have been passed as a number or boolean
|
|
1180
757
|
// but we still want it as a string
|
|
@@ -1424,15 +1001,6 @@ const connectedCallback = (elm) => {
|
|
|
1424
1001
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1425
1002
|
// first time this component has connected
|
|
1426
1003
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1427
|
-
{
|
|
1428
|
-
// initUpdate
|
|
1429
|
-
// if the slot polyfill is required we'll need to put some nodes
|
|
1430
|
-
// in here to act as original content anchors as we move nodes around
|
|
1431
|
-
// host element has been connected to the DOM
|
|
1432
|
-
if ((cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */))) {
|
|
1433
|
-
setContentReference(elm);
|
|
1434
|
-
}
|
|
1435
|
-
}
|
|
1436
1004
|
{
|
|
1437
1005
|
// find the first ancestor component (if there is one) and register
|
|
1438
1006
|
// this component as one of the actively loading child components for its ancestor
|
|
@@ -1470,17 +1038,6 @@ const connectedCallback = (elm) => {
|
|
|
1470
1038
|
endConnected();
|
|
1471
1039
|
}
|
|
1472
1040
|
};
|
|
1473
|
-
const setContentReference = (elm) => {
|
|
1474
|
-
// only required when we're NOT using native shadow dom (slot)
|
|
1475
|
-
// or this browser doesn't support native shadow dom
|
|
1476
|
-
// and this host element was NOT created with SSR
|
|
1477
|
-
// let's pick out the inner content for slot projection
|
|
1478
|
-
// create a node to represent where the original
|
|
1479
|
-
// content was first placed, which is useful later on
|
|
1480
|
-
const contentRefElm = (elm['s-cr'] = doc.createComment(''));
|
|
1481
|
-
contentRefElm['s-cn'] = true;
|
|
1482
|
-
elm.insertBefore(contentRefElm, elm.firstChild);
|
|
1483
|
-
};
|
|
1484
1041
|
const disconnectedCallback = (elm) => {
|
|
1485
1042
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1486
1043
|
const hostRef = getHostRef(elm);
|
|
@@ -1673,7 +1230,6 @@ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
|
1673
1230
|
exports.Host = Host;
|
|
1674
1231
|
exports.bootstrapLazy = bootstrapLazy;
|
|
1675
1232
|
exports.createEvent = createEvent;
|
|
1676
|
-
exports.getElement = getElement;
|
|
1677
1233
|
exports.h = h;
|
|
1678
1234
|
exports.promiseResolve = promiseResolve;
|
|
1679
1235
|
exports.registerInstance = registerInstance;
|