@sankhyalabs/sankhyablocks 1.3.31-beta.1 → 1.3.31-beta.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.
Files changed (92) hide show
  1. package/dist/cjs/SnkMessageBuilder-13239761.js +188 -0
  2. package/dist/cjs/{index-1133bc2a.js → index-c6671817.js} +416 -9
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/sankhyablocks.cjs.js +2 -2
  5. package/dist/cjs/snk-application.cjs.entry.js +283 -108
  6. package/dist/cjs/snk-crud.cjs.entry.js +64 -0
  7. package/dist/cjs/snk-data-unit.cjs.entry.js +277 -0
  8. package/dist/cjs/snk-form_2.cjs.entry.js +177 -0
  9. package/dist/cjs/snk-pesquisa.cjs.entry.js +6 -3
  10. package/dist/cjs/snk-taskbar.cjs.entry.js +159 -0
  11. package/dist/cjs/taskbar-elements-73d524e5.js +70 -0
  12. package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
  13. package/dist/collection/collection-manifest.json +5 -0
  14. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +2 -2
  15. package/dist/collection/components/snk-application/snk-application.js +267 -63
  16. package/dist/collection/components/snk-crud/snk-crud.css +5 -0
  17. package/dist/collection/components/snk-crud/snk-crud.js +137 -0
  18. package/dist/collection/components/snk-data-unit/snk-data-unit.css +6 -0
  19. package/dist/collection/components/snk-data-unit/snk-data-unit.js +528 -0
  20. package/dist/collection/components/snk-form/snk-form.css +34 -0
  21. package/dist/collection/components/snk-form/snk-form.js +220 -0
  22. package/dist/collection/components/snk-grid/snk-grid.css +5 -0
  23. package/dist/collection/components/snk-grid/snk-grid.js +148 -0
  24. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +56 -13
  25. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +5 -1
  26. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +65 -0
  27. package/dist/collection/components/snk-taskbar/snk-taskbar.css +3 -0
  28. package/dist/collection/components/snk-taskbar/snk-taskbar.js +271 -0
  29. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +1 -1
  30. package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +52 -21
  31. package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +4 -3
  32. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +2 -0
  33. package/dist/collection/lib/message/SnkMessageBuilder.js +119 -0
  34. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +22 -0
  35. package/dist/collection/lib/message/resources/snk-form.msg.js +10 -0
  36. package/dist/collection/lib/message/resources/snk-taskbar.msg.js +16 -0
  37. package/dist/components/SnkMessageBuilder.js +166 -0
  38. package/dist/components/snk-application2.js +284 -107
  39. package/dist/components/snk-crud.d.ts +11 -0
  40. package/dist/components/snk-crud.js +101 -0
  41. package/dist/components/snk-data-unit.d.ts +11 -0
  42. package/dist/components/snk-data-unit.js +300 -0
  43. package/dist/components/snk-form.d.ts +11 -0
  44. package/dist/components/snk-form.js +6 -0
  45. package/dist/components/snk-form2.js +140 -0
  46. package/dist/components/snk-grid.d.ts +11 -0
  47. package/dist/components/snk-grid.js +6 -0
  48. package/dist/components/snk-grid2.js +91 -0
  49. package/dist/components/snk-pesquisa2.js +5 -2
  50. package/dist/components/snk-taskbar.d.ts +11 -0
  51. package/dist/components/snk-taskbar.js +6 -0
  52. package/dist/components/snk-taskbar2.js +240 -0
  53. package/dist/esm/SnkMessageBuilder-3835f9d8.js +166 -0
  54. package/dist/esm/{index-ffda6382.js → index-6a83ac96.js} +416 -10
  55. package/dist/esm/loader.js +2 -2
  56. package/dist/esm/sankhyablocks.js +2 -2
  57. package/dist/esm/snk-application.entry.js +283 -108
  58. package/dist/esm/snk-crud.entry.js +60 -0
  59. package/dist/esm/snk-data-unit.entry.js +273 -0
  60. package/dist/esm/snk-form_2.entry.js +172 -0
  61. package/dist/esm/snk-pesquisa.entry.js +6 -3
  62. package/dist/esm/snk-taskbar.entry.js +155 -0
  63. package/dist/esm/taskbar-elements-6d01a640.js +68 -0
  64. package/dist/esm/teste-pesquisa.entry.js +1 -1
  65. package/dist/sankhyablocks/p-4c7b32d6.entry.js +1 -0
  66. package/dist/sankhyablocks/p-5e1b7e51.entry.js +1 -0
  67. package/dist/sankhyablocks/p-72bccbb6.js +1 -0
  68. package/dist/sankhyablocks/p-8c74d163.entry.js +1 -0
  69. package/dist/sankhyablocks/p-bab507ad.entry.js +1 -0
  70. package/dist/sankhyablocks/p-cd1dc099.js +2 -0
  71. package/dist/sankhyablocks/{p-2a7b4cb3.entry.js → p-d25637c9.entry.js} +1 -1
  72. package/dist/sankhyablocks/p-dd10a5e3.js +1 -0
  73. package/dist/sankhyablocks/p-e942c604.entry.js +69 -0
  74. package/dist/sankhyablocks/p-f4d0394b.entry.js +1 -0
  75. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  76. package/dist/types/components/snk-application/snk-application.d.ts +109 -15
  77. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +25 -0
  78. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +53 -0
  79. package/dist/types/components.d.ts +372 -6
  80. package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +2 -0
  81. package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +3 -3
  82. package/dist/types/lib/message/SnkMessageBuilder.d.ts +42 -0
  83. package/dist/types/lib/message/resources/snk-data-unit.msg.d.ts +2 -0
  84. package/dist/types/lib/message/resources/snk-form.msg.d.ts +2 -0
  85. package/dist/types/lib/message/resources/snk-taskbar.msg.d.ts +2 -0
  86. package/package.json +5 -5
  87. package/react/components.d.ts +5 -0
  88. package/react/components.js +5 -0
  89. package/react/components.js.map +1 -1
  90. package/dist/sankhyablocks/p-d62412bb.entry.js +0 -1
  91. package/dist/sankhyablocks/p-e6e91d5f.entry.js +0 -69
  92. package/dist/sankhyablocks/p-edcb9d8e.js +0 -2
@@ -23,7 +23,11 @@ function _interopNamespace(e) {
23
23
  const NAMESPACE = 'sankhyablocks';
24
24
 
25
25
  let scopeId;
26
+ let contentRef;
26
27
  let hostTagName;
28
+ let useNativeShadowDom = false;
29
+ let checkSlotFallbackVisibility = false;
30
+ let checkSlotRelocate = false;
27
31
  let isSvgMode = false;
28
32
  let queuePending = false;
29
33
  const win = typeof window !== 'undefined' ? window : {};
@@ -157,6 +161,8 @@ const isComplexType = (o) => {
157
161
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
158
162
  const h = (nodeName, vnodeData, ...children) => {
159
163
  let child = null;
164
+ let key = null;
165
+ let slotName = null;
160
166
  let simple = false;
161
167
  let lastSimple = false;
162
168
  const vNodeChildren = [];
@@ -184,6 +190,13 @@ const h = (nodeName, vnodeData, ...children) => {
184
190
  };
185
191
  walk(children);
186
192
  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
+ }
187
200
  {
188
201
  const classData = vnodeData.className || vnodeData.class;
189
202
  if (classData) {
@@ -201,6 +214,12 @@ const h = (nodeName, vnodeData, ...children) => {
201
214
  if (vNodeChildren.length > 0) {
202
215
  vnode.$children$ = vNodeChildren;
203
216
  }
217
+ {
218
+ vnode.$key$ = key;
219
+ }
220
+ {
221
+ vnode.$name$ = slotName;
222
+ }
204
223
  return vnode;
205
224
  };
206
225
  const newVNode = (tag, text) => {
@@ -214,6 +233,12 @@ const newVNode = (tag, text) => {
214
233
  {
215
234
  vnode.$attrs$ = null;
216
235
  }
236
+ {
237
+ vnode.$key$ = null;
238
+ }
239
+ {
240
+ vnode.$name$ = null;
241
+ }
217
242
  return vnode;
218
243
  };
219
244
  const Host = {};
@@ -237,6 +262,8 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
237
262
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
238
263
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
239
264
  }
265
+ else if (memberName === 'key')
266
+ ;
240
267
  else if (memberName === 'ref') {
241
268
  // minifier will clean this up
242
269
  if (newValue) {
@@ -349,13 +376,36 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
349
376
  let i = 0;
350
377
  let elm;
351
378
  let childNode;
379
+ let oldVNode;
380
+ if (!useNativeShadowDom) {
381
+ // remember for later we need to check to relocate nodes
382
+ checkSlotRelocate = true;
383
+ if (newVNode.$tag$ === 'slot') {
384
+ if (scopeId) {
385
+ // scoped css needs to add its scoped id to the parent element
386
+ parentElm.classList.add(scopeId + '-s');
387
+ }
388
+ newVNode.$flags$ |= newVNode.$children$
389
+ ? // slot element has fallback content
390
+ 2 /* isSlotFallback */
391
+ : // slot element does not have fallback content
392
+ 1 /* isSlotReference */;
393
+ }
394
+ }
352
395
  if (newVNode.$text$ !== null) {
353
396
  // create text node
354
397
  elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
355
398
  }
399
+ else if (newVNode.$flags$ & 1 /* isSlotReference */) {
400
+ // create a slot reference node
401
+ elm = newVNode.$elm$ =
402
+ doc.createTextNode('');
403
+ }
356
404
  else {
357
405
  // create element
358
- elm = newVNode.$elm$ = (doc.createElement(newVNode.$tag$));
406
+ elm = newVNode.$elm$ = (doc.createElement(newVNode.$flags$ & 2 /* isSlotFallback */
407
+ ? 'slot-fb'
408
+ : newVNode.$tag$));
359
409
  // add css classes, attrs, props, listeners, etc.
360
410
  {
361
411
  updateElement(null, newVNode, isSvgMode);
@@ -368,7 +418,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
368
418
  if (newVNode.$children$) {
369
419
  for (i = 0; i < newVNode.$children$.length; ++i) {
370
420
  // create the node
371
- childNode = createElm(oldParentVNode, newVNode, i);
421
+ childNode = createElm(oldParentVNode, newVNode, i, elm);
372
422
  // return node could have been null
373
423
  if (childNode) {
374
424
  // append our new node
@@ -377,20 +427,62 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
377
427
  }
378
428
  }
379
429
  }
430
+ {
431
+ elm['s-hn'] = hostTagName;
432
+ if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
433
+ // remember the content reference comment
434
+ elm['s-sr'] = true;
435
+ // remember the content reference comment
436
+ elm['s-cr'] = contentRef;
437
+ // remember the slot name, or empty string for default slot
438
+ elm['s-sn'] = newVNode.$name$ || '';
439
+ // check if we've got an old vnode for this slot
440
+ oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
441
+ if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
442
+ // we've got an old slot vnode and the wrapper is being replaced
443
+ // so let's move the old slot content back to it's original location
444
+ putBackInOriginalLocation(oldParentVNode.$elm$, false);
445
+ }
446
+ }
447
+ }
380
448
  return elm;
381
449
  };
450
+ const putBackInOriginalLocation = (parentElm, recursive) => {
451
+ plt.$flags$ |= 1 /* isTmpDisconnected */;
452
+ const oldSlotChildNodes = parentElm.childNodes;
453
+ for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
454
+ const childNode = oldSlotChildNodes[i];
455
+ if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
456
+ // // this child node in the old element is from another component
457
+ // // remove this node from the old slot's parent
458
+ // childNode.remove();
459
+ // and relocate it back to it's original location
460
+ parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
461
+ // remove the old original location comment entirely
462
+ // later on the patch function will know what to do
463
+ // and move this to the correct spot in need be
464
+ childNode['s-ol'].remove();
465
+ childNode['s-ol'] = undefined;
466
+ checkSlotRelocate = true;
467
+ }
468
+ if (recursive) {
469
+ putBackInOriginalLocation(childNode, recursive);
470
+ }
471
+ }
472
+ plt.$flags$ &= ~1 /* isTmpDisconnected */;
473
+ };
382
474
  const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
383
- let containerElm = (parentElm);
475
+ let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
384
476
  let childNode;
385
477
  if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
386
478
  containerElm = containerElm.shadowRoot;
387
479
  }
388
480
  for (; startIdx <= endIdx; ++startIdx) {
389
481
  if (vnodes[startIdx]) {
390
- childNode = createElm(null, parentVNode, startIdx);
482
+ childNode = createElm(null, parentVNode, startIdx, parentElm);
391
483
  if (childNode) {
392
484
  vnodes[startIdx].$elm$ = childNode;
393
- containerElm.insertBefore(childNode, before);
485
+ containerElm.insertBefore(childNode, referenceNode(before) );
394
486
  }
395
487
  }
396
488
  }
@@ -400,6 +492,20 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
400
492
  if ((vnode = vnodes[startIdx])) {
401
493
  elm = vnode.$elm$;
402
494
  callNodeRefs(vnode);
495
+ {
496
+ // we're removing this element
497
+ // so it's possible we need to show slot fallback content now
498
+ checkSlotFallbackVisibility = true;
499
+ if (elm['s-ol']) {
500
+ // remove the original location comment
501
+ elm['s-ol'].remove();
502
+ }
503
+ else {
504
+ // it's possible that child nodes of the node
505
+ // that's being removed are slot nodes
506
+ putBackInOriginalLocation(elm, true);
507
+ }
508
+ }
403
509
  // remove the vnode's element from the dom
404
510
  elm.remove();
405
511
  }
@@ -408,6 +514,8 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
408
514
  const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
409
515
  let oldStartIdx = 0;
410
516
  let newStartIdx = 0;
517
+ let idxInOld = 0;
518
+ let i = 0;
411
519
  let oldEndIdx = oldCh.length - 1;
412
520
  let oldStartVnode = oldCh[0];
413
521
  let oldEndVnode = oldCh[oldEndIdx];
@@ -415,6 +523,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
415
523
  let newStartVnode = newCh[0];
416
524
  let newEndVnode = newCh[newEndIdx];
417
525
  let node;
526
+ let elmToMove;
418
527
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
419
528
  if (oldStartVnode == null) {
420
529
  // Vnode might have been moved left
@@ -440,26 +549,56 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
440
549
  newEndVnode = newCh[--newEndIdx];
441
550
  }
442
551
  else if (isSameVnode(oldStartVnode, newEndVnode)) {
552
+ // Vnode moved right
553
+ if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
554
+ putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
555
+ }
443
556
  patch(oldStartVnode, newEndVnode);
444
557
  parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
445
558
  oldStartVnode = oldCh[++oldStartIdx];
446
559
  newEndVnode = newCh[--newEndIdx];
447
560
  }
448
561
  else if (isSameVnode(oldEndVnode, newStartVnode)) {
562
+ // Vnode moved left
563
+ if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
564
+ putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
565
+ }
449
566
  patch(oldEndVnode, newStartVnode);
450
567
  parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
451
568
  oldEndVnode = oldCh[--oldEndIdx];
452
569
  newStartVnode = newCh[++newStartIdx];
453
570
  }
454
571
  else {
572
+ // createKeyToOldIdx
573
+ idxInOld = -1;
455
574
  {
575
+ for (i = oldStartIdx; i <= oldEndIdx; ++i) {
576
+ if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
577
+ idxInOld = i;
578
+ break;
579
+ }
580
+ }
581
+ }
582
+ if (idxInOld >= 0) {
583
+ elmToMove = oldCh[idxInOld];
584
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
585
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
586
+ }
587
+ else {
588
+ patch(elmToMove, newStartVnode);
589
+ oldCh[idxInOld] = undefined;
590
+ node = elmToMove.$elm$;
591
+ }
592
+ newStartVnode = newCh[++newStartIdx];
593
+ }
594
+ else {
456
595
  // new element
457
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
596
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
458
597
  newStartVnode = newCh[++newStartIdx];
459
598
  }
460
599
  if (node) {
461
600
  {
462
- oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
601
+ parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
463
602
  }
464
603
  }
465
604
  }
@@ -475,19 +614,36 @@ const isSameVnode = (vnode1, vnode2) => {
475
614
  // compare if two vnode to see if they're "technically" the same
476
615
  // need to have the same element tag, and same key to be the same
477
616
  if (vnode1.$tag$ === vnode2.$tag$) {
478
- return true;
617
+ if (vnode1.$tag$ === 'slot') {
618
+ return vnode1.$name$ === vnode2.$name$;
619
+ }
620
+ {
621
+ return vnode1.$key$ === vnode2.$key$;
622
+ }
479
623
  }
480
624
  return false;
481
625
  };
626
+ const referenceNode = (node) => {
627
+ // this node was relocated to a new location in the dom
628
+ // because of some other component's slot
629
+ // but we still have an html comment in place of where
630
+ // it's original location was according to it's original vdom
631
+ return (node && node['s-ol']) || node;
632
+ };
633
+ const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
482
634
  const patch = (oldVNode, newVNode) => {
483
635
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
484
636
  const oldChildren = oldVNode.$children$;
485
637
  const newChildren = newVNode.$children$;
638
+ const tag = newVNode.$tag$;
486
639
  const text = newVNode.$text$;
640
+ let defaultHolder;
487
641
  if (text === null) {
488
642
  // element node
489
643
  {
490
- {
644
+ if (tag === 'slot')
645
+ ;
646
+ else {
491
647
  // either this is the first render of an element OR it's an update
492
648
  // AND we already know it's possible it could have changed
493
649
  // this updates the element's css classes, attrs, props, listeners, etc.
@@ -512,12 +668,147 @@ const patch = (oldVNode, newVNode) => {
512
668
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
513
669
  }
514
670
  }
671
+ else if ((defaultHolder = elm['s-cr'])) {
672
+ // this element has slotted content
673
+ defaultHolder.parentNode.textContent = text;
674
+ }
515
675
  else if (oldVNode.$text$ !== text) {
516
676
  // update the text content for the text only vnode
517
677
  // and also only if the text is different than before
518
678
  elm.data = text;
519
679
  }
520
680
  };
681
+ const updateFallbackSlotVisibility = (elm) => {
682
+ // tslint:disable-next-line: prefer-const
683
+ const childNodes = elm.childNodes;
684
+ let childNode;
685
+ let i;
686
+ let ilen;
687
+ let j;
688
+ let slotNameAttr;
689
+ let nodeType;
690
+ for (i = 0, ilen = childNodes.length; i < ilen; i++) {
691
+ childNode = childNodes[i];
692
+ if (childNode.nodeType === 1 /* ElementNode */) {
693
+ if (childNode['s-sr']) {
694
+ // this is a slot fallback node
695
+ // get the slot name for this slot reference node
696
+ slotNameAttr = childNode['s-sn'];
697
+ // by default always show a fallback slot node
698
+ // then hide it if there are other slots in the light dom
699
+ childNode.hidden = false;
700
+ for (j = 0; j < ilen; j++) {
701
+ nodeType = childNodes[j].nodeType;
702
+ if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
703
+ // this sibling node is from a different component OR is a named fallback slot node
704
+ if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
705
+ childNode.hidden = true;
706
+ break;
707
+ }
708
+ }
709
+ else {
710
+ // this is a default fallback slot node
711
+ // any element or text node (with content)
712
+ // should hide the default fallback slot node
713
+ if (nodeType === 1 /* ElementNode */ ||
714
+ (nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
715
+ childNode.hidden = true;
716
+ break;
717
+ }
718
+ }
719
+ }
720
+ }
721
+ // keep drilling down
722
+ updateFallbackSlotVisibility(childNode);
723
+ }
724
+ }
725
+ };
726
+ const relocateNodes = [];
727
+ const relocateSlotContent = (elm) => {
728
+ // tslint:disable-next-line: prefer-const
729
+ let childNode;
730
+ let node;
731
+ let hostContentNodes;
732
+ let slotNameAttr;
733
+ let relocateNodeData;
734
+ let j;
735
+ let i = 0;
736
+ const childNodes = elm.childNodes;
737
+ const ilen = childNodes.length;
738
+ for (; i < ilen; i++) {
739
+ childNode = childNodes[i];
740
+ if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
741
+ // first got the content reference comment node
742
+ // then we got it's parent, which is where all the host content is in now
743
+ hostContentNodes = node.parentNode.childNodes;
744
+ slotNameAttr = childNode['s-sn'];
745
+ for (j = hostContentNodes.length - 1; j >= 0; j--) {
746
+ node = hostContentNodes[j];
747
+ if (!node['s-cn'] && !node['s-nr'] && node['s-hn'] !== childNode['s-hn']) {
748
+ // let's do some relocating to its new home
749
+ // but never relocate a content reference node
750
+ // that is suppose to always represent the original content location
751
+ if (isNodeLocatedInSlot(node, slotNameAttr)) {
752
+ // it's possible we've already decided to relocate this node
753
+ relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
754
+ // made some changes to slots
755
+ // let's make sure we also double check
756
+ // fallbacks are correctly hidden or shown
757
+ checkSlotFallbackVisibility = true;
758
+ node['s-sn'] = node['s-sn'] || slotNameAttr;
759
+ if (relocateNodeData) {
760
+ // previously we never found a slot home for this node
761
+ // but turns out we did, so let's remember it now
762
+ relocateNodeData.$slotRefNode$ = childNode;
763
+ }
764
+ else {
765
+ // add to our list of nodes to relocate
766
+ relocateNodes.push({
767
+ $slotRefNode$: childNode,
768
+ $nodeToRelocate$: node,
769
+ });
770
+ }
771
+ if (node['s-sr']) {
772
+ relocateNodes.map((relocateNode) => {
773
+ if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
774
+ relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
775
+ if (relocateNodeData && !relocateNode.$slotRefNode$) {
776
+ relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
777
+ }
778
+ }
779
+ });
780
+ }
781
+ }
782
+ else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
783
+ // so far this element does not have a slot home, not setting slotRefNode on purpose
784
+ // if we never find a home for this element then we'll need to hide it
785
+ relocateNodes.push({
786
+ $nodeToRelocate$: node,
787
+ });
788
+ }
789
+ }
790
+ }
791
+ }
792
+ if (childNode.nodeType === 1 /* ElementNode */) {
793
+ relocateSlotContent(childNode);
794
+ }
795
+ }
796
+ };
797
+ const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
798
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
799
+ if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
800
+ return true;
801
+ }
802
+ if (nodeToRelocate.getAttribute('slot') === slotNameAttr) {
803
+ return true;
804
+ }
805
+ return false;
806
+ }
807
+ if (nodeToRelocate['s-sn'] === slotNameAttr) {
808
+ return true;
809
+ }
810
+ return slotNameAttr === '';
811
+ };
521
812
  const callNodeRefs = (vNode) => {
522
813
  {
523
814
  vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
@@ -526,6 +817,7 @@ const callNodeRefs = (vNode) => {
526
817
  };
527
818
  const renderVdom = (hostRef, renderFnResults) => {
528
819
  const hostElm = hostRef.$hostElement$;
820
+ const cmpMeta = hostRef.$cmpMeta$;
529
821
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
530
822
  const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
531
823
  hostTagName = hostElm.tagName;
@@ -536,8 +828,90 @@ const renderVdom = (hostRef, renderFnResults) => {
536
828
  {
537
829
  scopeId = hostElm['s-sc'];
538
830
  }
831
+ {
832
+ contentRef = hostElm['s-cr'];
833
+ useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
834
+ // always reset
835
+ checkSlotFallbackVisibility = false;
836
+ }
539
837
  // synchronous patch
540
838
  patch(oldVNode, rootVnode);
839
+ {
840
+ // while we're moving nodes around existing nodes, temporarily disable
841
+ // the disconnectCallback from working
842
+ plt.$flags$ |= 1 /* isTmpDisconnected */;
843
+ if (checkSlotRelocate) {
844
+ relocateSlotContent(rootVnode.$elm$);
845
+ let relocateData;
846
+ let nodeToRelocate;
847
+ let orgLocationNode;
848
+ let parentNodeRef;
849
+ let insertBeforeNode;
850
+ let refNode;
851
+ let i = 0;
852
+ for (; i < relocateNodes.length; i++) {
853
+ relocateData = relocateNodes[i];
854
+ nodeToRelocate = relocateData.$nodeToRelocate$;
855
+ if (!nodeToRelocate['s-ol']) {
856
+ // add a reference node marking this node's original location
857
+ // keep a reference to this node for later lookups
858
+ orgLocationNode =
859
+ doc.createTextNode('');
860
+ orgLocationNode['s-nr'] = nodeToRelocate;
861
+ nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
862
+ }
863
+ }
864
+ for (i = 0; i < relocateNodes.length; i++) {
865
+ relocateData = relocateNodes[i];
866
+ nodeToRelocate = relocateData.$nodeToRelocate$;
867
+ if (relocateData.$slotRefNode$) {
868
+ // by default we're just going to insert it directly
869
+ // after the slot reference node
870
+ parentNodeRef = relocateData.$slotRefNode$.parentNode;
871
+ insertBeforeNode = relocateData.$slotRefNode$.nextSibling;
872
+ orgLocationNode = nodeToRelocate['s-ol'];
873
+ while ((orgLocationNode = orgLocationNode.previousSibling)) {
874
+ refNode = orgLocationNode['s-nr'];
875
+ if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
876
+ refNode = refNode.nextSibling;
877
+ if (!refNode || !refNode['s-nr']) {
878
+ insertBeforeNode = refNode;
879
+ break;
880
+ }
881
+ }
882
+ }
883
+ if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
884
+ nodeToRelocate.nextSibling !== insertBeforeNode) {
885
+ // we've checked that it's worth while to relocate
886
+ // since that the node to relocate
887
+ // has a different next sibling or parent relocated
888
+ if (nodeToRelocate !== insertBeforeNode) {
889
+ if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
890
+ // probably a component in the index.html that doesn't have it's hostname set
891
+ nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
892
+ }
893
+ // add it back to the dom but in its new home
894
+ parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
895
+ }
896
+ }
897
+ }
898
+ else {
899
+ // this node doesn't have a slot home to go to, so let's hide it
900
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
901
+ nodeToRelocate.hidden = true;
902
+ }
903
+ }
904
+ }
905
+ }
906
+ if (checkSlotFallbackVisibility) {
907
+ updateFallbackSlotVisibility(rootVnode.$elm$);
908
+ }
909
+ // done moving nodes around
910
+ // allow the disconnect callback to work again
911
+ plt.$flags$ &= ~1 /* isTmpDisconnected */;
912
+ // always reset
913
+ relocateNodes.length = 0;
914
+ }
541
915
  };
542
916
  const getElement = (ref) => (getHostRef(ref).$hostElement$ );
543
917
  const createEvent = (ref, name, flags) => {
@@ -594,6 +968,9 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
594
968
  promise = safeCall(instance, 'componentWillLoad');
595
969
  }
596
970
  }
971
+ {
972
+ promise = then(promise, () => safeCall(instance, 'componentWillRender'));
973
+ }
597
974
  endSchedule();
598
975
  return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
599
976
  };
@@ -752,6 +1129,15 @@ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
752
1129
  const parsePropertyValue = (propValue, propType) => {
753
1130
  // ensure this value is of the correct prop type
754
1131
  if (propValue != null && !isComplexType(propValue)) {
1132
+ if (propType & 4 /* Boolean */) {
1133
+ // per the HTML spec, any string value means it is a boolean true value
1134
+ // but we'll cheat here and say that the string "false" is the boolean false
1135
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
1136
+ }
1137
+ if (propType & 2 /* Number */) {
1138
+ // force it to be a number
1139
+ return parseFloat(propValue);
1140
+ }
755
1141
  if (propType & 1 /* String */) {
756
1142
  // could have been passed as a number or boolean
757
1143
  // but we still want it as a string
@@ -1001,6 +1387,15 @@ const connectedCallback = (elm) => {
1001
1387
  if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1002
1388
  // first time this component has connected
1003
1389
  hostRef.$flags$ |= 1 /* hasConnected */;
1390
+ {
1391
+ // initUpdate
1392
+ // if the slot polyfill is required we'll need to put some nodes
1393
+ // in here to act as original content anchors as we move nodes around
1394
+ // host element has been connected to the DOM
1395
+ if ((cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */))) {
1396
+ setContentReference(elm);
1397
+ }
1398
+ }
1004
1399
  {
1005
1400
  // find the first ancestor component (if there is one) and register
1006
1401
  // this component as one of the actively loading child components for its ancestor
@@ -1038,6 +1433,17 @@ const connectedCallback = (elm) => {
1038
1433
  endConnected();
1039
1434
  }
1040
1435
  };
1436
+ const setContentReference = (elm) => {
1437
+ // only required when we're NOT using native shadow dom (slot)
1438
+ // or this browser doesn't support native shadow dom
1439
+ // and this host element was NOT created with SSR
1440
+ // let's pick out the inner content for slot projection
1441
+ // create a node to represent where the original
1442
+ // content was first placed, which is useful later on
1443
+ const contentRefElm = (elm['s-cr'] = doc.createComment(''));
1444
+ contentRefElm['s-cn'] = true;
1445
+ elm.insertBefore(contentRefElm, elm.firstChild);
1446
+ };
1041
1447
  const disconnectedCallback = (elm) => {
1042
1448
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1043
1449
  const hostRef = getHostRef(elm);
@@ -1230,6 +1636,7 @@ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1230
1636
  exports.Host = Host;
1231
1637
  exports.bootstrapLazy = bootstrapLazy;
1232
1638
  exports.createEvent = createEvent;
1639
+ exports.getElement = getElement;
1233
1640
  exports.h = h;
1234
1641
  exports.promiseResolve = promiseResolve;
1235
1642
  exports.registerInstance = registerInstance;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-1133bc2a.js');
5
+ const index = require('./index-c6671817.js');
6
6
 
7
7
  /*
8
8
  Stencil Client Patch Esm v2.16.1 | MIT Licensed | https://stenciljs.com
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-application.cjs",[[2,"snk-application",{"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]]], options);
17
+ return index.bootstrapLazy([["snk-crud.cjs",[[6,"snk-crud",{"configName":[1,"config-name"],"actionsList":[16],"recordsValidator":[8,"records-validator"],"_dataUnit":[32],"_dataState":[32]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]],["snk-data-unit.cjs",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"autoLoad":[4,"auto-load"],"getDataUnit":[64]}]]],["snk-application.cjs",[[2,"snk-application",{"messagesBuilder":[1040],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["snk-form_2.cjs",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[8,"records-validator"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32]}],[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_gridConfig":[32]}]]],["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-taskbar.cjs",[[6,"snk-taskbar",{"buttons":[1],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_permissions":[32]}]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-1133bc2a.js');
3
+ const index = require('./index-c6671817.js');
4
4
 
5
5
  /*
6
6
  Stencil Client Patch Browser v2.16.1 | MIT Licensed | https://stenciljs.com
@@ -15,5 +15,5 @@ const patchBrowser = () => {
15
15
  };
16
16
 
17
17
  patchBrowser().then(options => {
18
- return index.bootstrapLazy([["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-application.cjs",[[2,"snk-application",{"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]]], options);
18
+ return index.bootstrapLazy([["snk-crud.cjs",[[6,"snk-crud",{"configName":[1,"config-name"],"actionsList":[16],"recordsValidator":[8,"records-validator"],"_dataUnit":[32],"_dataState":[32]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]],["snk-data-unit.cjs",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"autoLoad":[4,"auto-load"],"getDataUnit":[64]}]]],["snk-application.cjs",[[2,"snk-application",{"messagesBuilder":[1040],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["snk-form_2.cjs",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[8,"records-validator"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32]}],[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_gridConfig":[32]}]]],["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-taskbar.cjs",[[6,"snk-taskbar",{"buttons":[1],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_permissions":[32]}]]]], options);
19
19
  });