@sankhyalabs/sankhyablocks 1.3.31-beta.1 → 1.3.31-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/cjs/{index-1133bc2a.js → index-c6671817.js} +416 -9
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/sankhyablocks.cjs.js +2 -2
  4. package/dist/cjs/snk-application.cjs.entry.js +280 -107
  5. package/dist/cjs/snk-crud.cjs.entry.js +64 -0
  6. package/dist/cjs/snk-data-unit.cjs.entry.js +218 -0
  7. package/dist/cjs/snk-form_2.cjs.entry.js +170 -0
  8. package/dist/cjs/snk-pesquisa.cjs.entry.js +6 -3
  9. package/dist/cjs/snk-taskbar.cjs.entry.js +140 -0
  10. package/dist/cjs/taskbar-elements-7f99f0c9.js +70 -0
  11. package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
  12. package/dist/collection/collection-manifest.json +5 -0
  13. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +2 -2
  14. package/dist/collection/components/snk-application/snk-application.js +237 -62
  15. package/dist/collection/components/snk-crud/snk-crud.css +5 -0
  16. package/dist/collection/components/snk-crud/snk-crud.js +149 -0
  17. package/dist/collection/components/snk-data-unit/snk-data-unit.css +6 -0
  18. package/dist/collection/components/snk-data-unit/snk-data-unit.js +492 -0
  19. package/dist/collection/components/snk-form/snk-form.css +34 -0
  20. package/dist/collection/components/snk-form/snk-form.js +230 -0
  21. package/dist/collection/components/snk-grid/snk-grid.css +5 -0
  22. package/dist/collection/components/snk-grid/snk-grid.js +148 -0
  23. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +56 -13
  24. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +5 -1
  25. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +65 -0
  26. package/dist/collection/components/snk-taskbar/snk-taskbar.css +3 -0
  27. package/dist/collection/components/snk-taskbar/snk-taskbar.js +252 -0
  28. package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +52 -21
  29. package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +4 -3
  30. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +2 -0
  31. package/dist/components/snk-application2.js +280 -106
  32. package/dist/components/snk-crud.d.ts +11 -0
  33. package/dist/components/snk-crud.js +102 -0
  34. package/dist/components/snk-data-unit.d.ts +11 -0
  35. package/dist/components/snk-data-unit.js +242 -0
  36. package/dist/components/snk-form.d.ts +11 -0
  37. package/dist/components/snk-form.js +6 -0
  38. package/dist/components/snk-form2.js +134 -0
  39. package/dist/components/snk-grid.d.ts +11 -0
  40. package/dist/components/snk-grid.js +6 -0
  41. package/dist/components/snk-grid2.js +91 -0
  42. package/dist/components/snk-pesquisa2.js +5 -2
  43. package/dist/components/snk-taskbar.d.ts +11 -0
  44. package/dist/components/snk-taskbar.js +6 -0
  45. package/dist/components/snk-taskbar2.js +221 -0
  46. package/dist/esm/{index-ffda6382.js → index-6a83ac96.js} +416 -10
  47. package/dist/esm/loader.js +2 -2
  48. package/dist/esm/sankhyablocks.js +2 -2
  49. package/dist/esm/snk-application.entry.js +280 -107
  50. package/dist/esm/snk-crud.entry.js +60 -0
  51. package/dist/esm/snk-data-unit.entry.js +214 -0
  52. package/dist/esm/snk-form_2.entry.js +165 -0
  53. package/dist/esm/snk-pesquisa.entry.js +6 -3
  54. package/dist/esm/snk-taskbar.entry.js +136 -0
  55. package/dist/esm/taskbar-elements-e0b8a285.js +68 -0
  56. package/dist/esm/teste-pesquisa.entry.js +1 -1
  57. package/dist/sankhyablocks/p-18fe0469.entry.js +69 -0
  58. package/dist/sankhyablocks/p-4c7b32d6.entry.js +1 -0
  59. package/dist/sankhyablocks/p-5b5afdbe.entry.js +1 -0
  60. package/dist/sankhyablocks/p-7fe9e5c2.entry.js +1 -0
  61. package/dist/sankhyablocks/p-8650ae26.entry.js +1 -0
  62. package/dist/sankhyablocks/p-a5439706.js +1 -0
  63. package/dist/sankhyablocks/p-c3d20542.entry.js +1 -0
  64. package/dist/sankhyablocks/p-cd1dc099.js +2 -0
  65. package/dist/sankhyablocks/{p-2a7b4cb3.entry.js → p-d25637c9.entry.js} +1 -1
  66. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  67. package/dist/types/components/snk-application/snk-application.d.ts +103 -15
  68. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +25 -0
  69. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +45 -0
  70. package/dist/types/components.d.ts +381 -6
  71. package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +2 -0
  72. package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +3 -3
  73. package/package.json +5 -5
  74. package/react/components.d.ts +5 -0
  75. package/react/components.js +5 -0
  76. package/react/components.js.map +1 -1
  77. package/dist/sankhyablocks/p-d62412bb.entry.js +0 -1
  78. package/dist/sankhyablocks/p-e6e91d5f.entry.js +0 -69
  79. package/dist/sankhyablocks/p-edcb9d8e.js +0 -2
@@ -1,7 +1,11 @@
1
1
  const NAMESPACE = 'sankhyablocks';
2
2
 
3
3
  let scopeId;
4
+ let contentRef;
4
5
  let hostTagName;
6
+ let useNativeShadowDom = false;
7
+ let checkSlotFallbackVisibility = false;
8
+ let checkSlotRelocate = false;
5
9
  let isSvgMode = false;
6
10
  let queuePending = false;
7
11
  const win = typeof window !== 'undefined' ? window : {};
@@ -135,6 +139,8 @@ const isComplexType = (o) => {
135
139
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
136
140
  const h = (nodeName, vnodeData, ...children) => {
137
141
  let child = null;
142
+ let key = null;
143
+ let slotName = null;
138
144
  let simple = false;
139
145
  let lastSimple = false;
140
146
  const vNodeChildren = [];
@@ -162,6 +168,13 @@ const h = (nodeName, vnodeData, ...children) => {
162
168
  };
163
169
  walk(children);
164
170
  if (vnodeData) {
171
+ // normalize class / classname attributes
172
+ if (vnodeData.key) {
173
+ key = vnodeData.key;
174
+ }
175
+ if (vnodeData.name) {
176
+ slotName = vnodeData.name;
177
+ }
165
178
  {
166
179
  const classData = vnodeData.className || vnodeData.class;
167
180
  if (classData) {
@@ -179,6 +192,12 @@ const h = (nodeName, vnodeData, ...children) => {
179
192
  if (vNodeChildren.length > 0) {
180
193
  vnode.$children$ = vNodeChildren;
181
194
  }
195
+ {
196
+ vnode.$key$ = key;
197
+ }
198
+ {
199
+ vnode.$name$ = slotName;
200
+ }
182
201
  return vnode;
183
202
  };
184
203
  const newVNode = (tag, text) => {
@@ -192,6 +211,12 @@ const newVNode = (tag, text) => {
192
211
  {
193
212
  vnode.$attrs$ = null;
194
213
  }
214
+ {
215
+ vnode.$key$ = null;
216
+ }
217
+ {
218
+ vnode.$name$ = null;
219
+ }
195
220
  return vnode;
196
221
  };
197
222
  const Host = {};
@@ -215,6 +240,8 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
215
240
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
216
241
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
217
242
  }
243
+ else if (memberName === 'key')
244
+ ;
218
245
  else if (memberName === 'ref') {
219
246
  // minifier will clean this up
220
247
  if (newValue) {
@@ -327,13 +354,36 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
327
354
  let i = 0;
328
355
  let elm;
329
356
  let childNode;
357
+ let oldVNode;
358
+ if (!useNativeShadowDom) {
359
+ // remember for later we need to check to relocate nodes
360
+ checkSlotRelocate = true;
361
+ if (newVNode.$tag$ === 'slot') {
362
+ if (scopeId) {
363
+ // scoped css needs to add its scoped id to the parent element
364
+ parentElm.classList.add(scopeId + '-s');
365
+ }
366
+ newVNode.$flags$ |= newVNode.$children$
367
+ ? // slot element has fallback content
368
+ 2 /* isSlotFallback */
369
+ : // slot element does not have fallback content
370
+ 1 /* isSlotReference */;
371
+ }
372
+ }
330
373
  if (newVNode.$text$ !== null) {
331
374
  // create text node
332
375
  elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
333
376
  }
377
+ else if (newVNode.$flags$ & 1 /* isSlotReference */) {
378
+ // create a slot reference node
379
+ elm = newVNode.$elm$ =
380
+ doc.createTextNode('');
381
+ }
334
382
  else {
335
383
  // create element
336
- elm = newVNode.$elm$ = (doc.createElement(newVNode.$tag$));
384
+ elm = newVNode.$elm$ = (doc.createElement(newVNode.$flags$ & 2 /* isSlotFallback */
385
+ ? 'slot-fb'
386
+ : newVNode.$tag$));
337
387
  // add css classes, attrs, props, listeners, etc.
338
388
  {
339
389
  updateElement(null, newVNode, isSvgMode);
@@ -346,7 +396,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
346
396
  if (newVNode.$children$) {
347
397
  for (i = 0; i < newVNode.$children$.length; ++i) {
348
398
  // create the node
349
- childNode = createElm(oldParentVNode, newVNode, i);
399
+ childNode = createElm(oldParentVNode, newVNode, i, elm);
350
400
  // return node could have been null
351
401
  if (childNode) {
352
402
  // append our new node
@@ -355,20 +405,62 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
355
405
  }
356
406
  }
357
407
  }
408
+ {
409
+ elm['s-hn'] = hostTagName;
410
+ if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
411
+ // remember the content reference comment
412
+ elm['s-sr'] = true;
413
+ // remember the content reference comment
414
+ elm['s-cr'] = contentRef;
415
+ // remember the slot name, or empty string for default slot
416
+ elm['s-sn'] = newVNode.$name$ || '';
417
+ // check if we've got an old vnode for this slot
418
+ oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
419
+ if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
420
+ // we've got an old slot vnode and the wrapper is being replaced
421
+ // so let's move the old slot content back to it's original location
422
+ putBackInOriginalLocation(oldParentVNode.$elm$, false);
423
+ }
424
+ }
425
+ }
358
426
  return elm;
359
427
  };
428
+ const putBackInOriginalLocation = (parentElm, recursive) => {
429
+ plt.$flags$ |= 1 /* isTmpDisconnected */;
430
+ const oldSlotChildNodes = parentElm.childNodes;
431
+ for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
432
+ const childNode = oldSlotChildNodes[i];
433
+ if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
434
+ // // this child node in the old element is from another component
435
+ // // remove this node from the old slot's parent
436
+ // childNode.remove();
437
+ // and relocate it back to it's original location
438
+ parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
439
+ // remove the old original location comment entirely
440
+ // later on the patch function will know what to do
441
+ // and move this to the correct spot in need be
442
+ childNode['s-ol'].remove();
443
+ childNode['s-ol'] = undefined;
444
+ checkSlotRelocate = true;
445
+ }
446
+ if (recursive) {
447
+ putBackInOriginalLocation(childNode, recursive);
448
+ }
449
+ }
450
+ plt.$flags$ &= ~1 /* isTmpDisconnected */;
451
+ };
360
452
  const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
361
- let containerElm = (parentElm);
453
+ let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
362
454
  let childNode;
363
455
  if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
364
456
  containerElm = containerElm.shadowRoot;
365
457
  }
366
458
  for (; startIdx <= endIdx; ++startIdx) {
367
459
  if (vnodes[startIdx]) {
368
- childNode = createElm(null, parentVNode, startIdx);
460
+ childNode = createElm(null, parentVNode, startIdx, parentElm);
369
461
  if (childNode) {
370
462
  vnodes[startIdx].$elm$ = childNode;
371
- containerElm.insertBefore(childNode, before);
463
+ containerElm.insertBefore(childNode, referenceNode(before) );
372
464
  }
373
465
  }
374
466
  }
@@ -378,6 +470,20 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
378
470
  if ((vnode = vnodes[startIdx])) {
379
471
  elm = vnode.$elm$;
380
472
  callNodeRefs(vnode);
473
+ {
474
+ // we're removing this element
475
+ // so it's possible we need to show slot fallback content now
476
+ checkSlotFallbackVisibility = true;
477
+ if (elm['s-ol']) {
478
+ // remove the original location comment
479
+ elm['s-ol'].remove();
480
+ }
481
+ else {
482
+ // it's possible that child nodes of the node
483
+ // that's being removed are slot nodes
484
+ putBackInOriginalLocation(elm, true);
485
+ }
486
+ }
381
487
  // remove the vnode's element from the dom
382
488
  elm.remove();
383
489
  }
@@ -386,6 +492,8 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
386
492
  const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
387
493
  let oldStartIdx = 0;
388
494
  let newStartIdx = 0;
495
+ let idxInOld = 0;
496
+ let i = 0;
389
497
  let oldEndIdx = oldCh.length - 1;
390
498
  let oldStartVnode = oldCh[0];
391
499
  let oldEndVnode = oldCh[oldEndIdx];
@@ -393,6 +501,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
393
501
  let newStartVnode = newCh[0];
394
502
  let newEndVnode = newCh[newEndIdx];
395
503
  let node;
504
+ let elmToMove;
396
505
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
397
506
  if (oldStartVnode == null) {
398
507
  // Vnode might have been moved left
@@ -418,26 +527,56 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
418
527
  newEndVnode = newCh[--newEndIdx];
419
528
  }
420
529
  else if (isSameVnode(oldStartVnode, newEndVnode)) {
530
+ // Vnode moved right
531
+ if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
532
+ putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
533
+ }
421
534
  patch(oldStartVnode, newEndVnode);
422
535
  parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
423
536
  oldStartVnode = oldCh[++oldStartIdx];
424
537
  newEndVnode = newCh[--newEndIdx];
425
538
  }
426
539
  else if (isSameVnode(oldEndVnode, newStartVnode)) {
540
+ // Vnode moved left
541
+ if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
542
+ putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
543
+ }
427
544
  patch(oldEndVnode, newStartVnode);
428
545
  parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
429
546
  oldEndVnode = oldCh[--oldEndIdx];
430
547
  newStartVnode = newCh[++newStartIdx];
431
548
  }
432
549
  else {
550
+ // createKeyToOldIdx
551
+ idxInOld = -1;
433
552
  {
553
+ for (i = oldStartIdx; i <= oldEndIdx; ++i) {
554
+ if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
555
+ idxInOld = i;
556
+ break;
557
+ }
558
+ }
559
+ }
560
+ if (idxInOld >= 0) {
561
+ elmToMove = oldCh[idxInOld];
562
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
563
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
564
+ }
565
+ else {
566
+ patch(elmToMove, newStartVnode);
567
+ oldCh[idxInOld] = undefined;
568
+ node = elmToMove.$elm$;
569
+ }
570
+ newStartVnode = newCh[++newStartIdx];
571
+ }
572
+ else {
434
573
  // new element
435
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
574
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
436
575
  newStartVnode = newCh[++newStartIdx];
437
576
  }
438
577
  if (node) {
439
578
  {
440
- oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
579
+ parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
441
580
  }
442
581
  }
443
582
  }
@@ -453,19 +592,36 @@ const isSameVnode = (vnode1, vnode2) => {
453
592
  // compare if two vnode to see if they're "technically" the same
454
593
  // need to have the same element tag, and same key to be the same
455
594
  if (vnode1.$tag$ === vnode2.$tag$) {
456
- return true;
595
+ if (vnode1.$tag$ === 'slot') {
596
+ return vnode1.$name$ === vnode2.$name$;
597
+ }
598
+ {
599
+ return vnode1.$key$ === vnode2.$key$;
600
+ }
457
601
  }
458
602
  return false;
459
603
  };
604
+ const referenceNode = (node) => {
605
+ // this node was relocated to a new location in the dom
606
+ // because of some other component's slot
607
+ // but we still have an html comment in place of where
608
+ // it's original location was according to it's original vdom
609
+ return (node && node['s-ol']) || node;
610
+ };
611
+ const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
460
612
  const patch = (oldVNode, newVNode) => {
461
613
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
462
614
  const oldChildren = oldVNode.$children$;
463
615
  const newChildren = newVNode.$children$;
616
+ const tag = newVNode.$tag$;
464
617
  const text = newVNode.$text$;
618
+ let defaultHolder;
465
619
  if (text === null) {
466
620
  // element node
467
621
  {
468
- {
622
+ if (tag === 'slot')
623
+ ;
624
+ else {
469
625
  // either this is the first render of an element OR it's an update
470
626
  // AND we already know it's possible it could have changed
471
627
  // this updates the element's css classes, attrs, props, listeners, etc.
@@ -490,12 +646,147 @@ const patch = (oldVNode, newVNode) => {
490
646
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
491
647
  }
492
648
  }
649
+ else if ((defaultHolder = elm['s-cr'])) {
650
+ // this element has slotted content
651
+ defaultHolder.parentNode.textContent = text;
652
+ }
493
653
  else if (oldVNode.$text$ !== text) {
494
654
  // update the text content for the text only vnode
495
655
  // and also only if the text is different than before
496
656
  elm.data = text;
497
657
  }
498
658
  };
659
+ const updateFallbackSlotVisibility = (elm) => {
660
+ // tslint:disable-next-line: prefer-const
661
+ const childNodes = elm.childNodes;
662
+ let childNode;
663
+ let i;
664
+ let ilen;
665
+ let j;
666
+ let slotNameAttr;
667
+ let nodeType;
668
+ for (i = 0, ilen = childNodes.length; i < ilen; i++) {
669
+ childNode = childNodes[i];
670
+ if (childNode.nodeType === 1 /* ElementNode */) {
671
+ if (childNode['s-sr']) {
672
+ // this is a slot fallback node
673
+ // get the slot name for this slot reference node
674
+ slotNameAttr = childNode['s-sn'];
675
+ // by default always show a fallback slot node
676
+ // then hide it if there are other slots in the light dom
677
+ childNode.hidden = false;
678
+ for (j = 0; j < ilen; j++) {
679
+ nodeType = childNodes[j].nodeType;
680
+ if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
681
+ // this sibling node is from a different component OR is a named fallback slot node
682
+ if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
683
+ childNode.hidden = true;
684
+ break;
685
+ }
686
+ }
687
+ else {
688
+ // this is a default fallback slot node
689
+ // any element or text node (with content)
690
+ // should hide the default fallback slot node
691
+ if (nodeType === 1 /* ElementNode */ ||
692
+ (nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
693
+ childNode.hidden = true;
694
+ break;
695
+ }
696
+ }
697
+ }
698
+ }
699
+ // keep drilling down
700
+ updateFallbackSlotVisibility(childNode);
701
+ }
702
+ }
703
+ };
704
+ const relocateNodes = [];
705
+ const relocateSlotContent = (elm) => {
706
+ // tslint:disable-next-line: prefer-const
707
+ let childNode;
708
+ let node;
709
+ let hostContentNodes;
710
+ let slotNameAttr;
711
+ let relocateNodeData;
712
+ let j;
713
+ let i = 0;
714
+ const childNodes = elm.childNodes;
715
+ const ilen = childNodes.length;
716
+ for (; i < ilen; i++) {
717
+ childNode = childNodes[i];
718
+ if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
719
+ // first got the content reference comment node
720
+ // then we got it's parent, which is where all the host content is in now
721
+ hostContentNodes = node.parentNode.childNodes;
722
+ slotNameAttr = childNode['s-sn'];
723
+ for (j = hostContentNodes.length - 1; j >= 0; j--) {
724
+ node = hostContentNodes[j];
725
+ if (!node['s-cn'] && !node['s-nr'] && node['s-hn'] !== childNode['s-hn']) {
726
+ // let's do some relocating to its new home
727
+ // but never relocate a content reference node
728
+ // that is suppose to always represent the original content location
729
+ if (isNodeLocatedInSlot(node, slotNameAttr)) {
730
+ // it's possible we've already decided to relocate this node
731
+ relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
732
+ // made some changes to slots
733
+ // let's make sure we also double check
734
+ // fallbacks are correctly hidden or shown
735
+ checkSlotFallbackVisibility = true;
736
+ node['s-sn'] = node['s-sn'] || slotNameAttr;
737
+ if (relocateNodeData) {
738
+ // previously we never found a slot home for this node
739
+ // but turns out we did, so let's remember it now
740
+ relocateNodeData.$slotRefNode$ = childNode;
741
+ }
742
+ else {
743
+ // add to our list of nodes to relocate
744
+ relocateNodes.push({
745
+ $slotRefNode$: childNode,
746
+ $nodeToRelocate$: node,
747
+ });
748
+ }
749
+ if (node['s-sr']) {
750
+ relocateNodes.map((relocateNode) => {
751
+ if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
752
+ relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
753
+ if (relocateNodeData && !relocateNode.$slotRefNode$) {
754
+ relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
755
+ }
756
+ }
757
+ });
758
+ }
759
+ }
760
+ else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
761
+ // so far this element does not have a slot home, not setting slotRefNode on purpose
762
+ // if we never find a home for this element then we'll need to hide it
763
+ relocateNodes.push({
764
+ $nodeToRelocate$: node,
765
+ });
766
+ }
767
+ }
768
+ }
769
+ }
770
+ if (childNode.nodeType === 1 /* ElementNode */) {
771
+ relocateSlotContent(childNode);
772
+ }
773
+ }
774
+ };
775
+ const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
776
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
777
+ if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
778
+ return true;
779
+ }
780
+ if (nodeToRelocate.getAttribute('slot') === slotNameAttr) {
781
+ return true;
782
+ }
783
+ return false;
784
+ }
785
+ if (nodeToRelocate['s-sn'] === slotNameAttr) {
786
+ return true;
787
+ }
788
+ return slotNameAttr === '';
789
+ };
499
790
  const callNodeRefs = (vNode) => {
500
791
  {
501
792
  vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
@@ -504,6 +795,7 @@ const callNodeRefs = (vNode) => {
504
795
  };
505
796
  const renderVdom = (hostRef, renderFnResults) => {
506
797
  const hostElm = hostRef.$hostElement$;
798
+ const cmpMeta = hostRef.$cmpMeta$;
507
799
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
508
800
  const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
509
801
  hostTagName = hostElm.tagName;
@@ -514,8 +806,90 @@ const renderVdom = (hostRef, renderFnResults) => {
514
806
  {
515
807
  scopeId = hostElm['s-sc'];
516
808
  }
809
+ {
810
+ contentRef = hostElm['s-cr'];
811
+ useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
812
+ // always reset
813
+ checkSlotFallbackVisibility = false;
814
+ }
517
815
  // synchronous patch
518
816
  patch(oldVNode, rootVnode);
817
+ {
818
+ // while we're moving nodes around existing nodes, temporarily disable
819
+ // the disconnectCallback from working
820
+ plt.$flags$ |= 1 /* isTmpDisconnected */;
821
+ if (checkSlotRelocate) {
822
+ relocateSlotContent(rootVnode.$elm$);
823
+ let relocateData;
824
+ let nodeToRelocate;
825
+ let orgLocationNode;
826
+ let parentNodeRef;
827
+ let insertBeforeNode;
828
+ let refNode;
829
+ let i = 0;
830
+ for (; i < relocateNodes.length; i++) {
831
+ relocateData = relocateNodes[i];
832
+ nodeToRelocate = relocateData.$nodeToRelocate$;
833
+ if (!nodeToRelocate['s-ol']) {
834
+ // add a reference node marking this node's original location
835
+ // keep a reference to this node for later lookups
836
+ orgLocationNode =
837
+ doc.createTextNode('');
838
+ orgLocationNode['s-nr'] = nodeToRelocate;
839
+ nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
840
+ }
841
+ }
842
+ for (i = 0; i < relocateNodes.length; i++) {
843
+ relocateData = relocateNodes[i];
844
+ nodeToRelocate = relocateData.$nodeToRelocate$;
845
+ if (relocateData.$slotRefNode$) {
846
+ // by default we're just going to insert it directly
847
+ // after the slot reference node
848
+ parentNodeRef = relocateData.$slotRefNode$.parentNode;
849
+ insertBeforeNode = relocateData.$slotRefNode$.nextSibling;
850
+ orgLocationNode = nodeToRelocate['s-ol'];
851
+ while ((orgLocationNode = orgLocationNode.previousSibling)) {
852
+ refNode = orgLocationNode['s-nr'];
853
+ if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
854
+ refNode = refNode.nextSibling;
855
+ if (!refNode || !refNode['s-nr']) {
856
+ insertBeforeNode = refNode;
857
+ break;
858
+ }
859
+ }
860
+ }
861
+ if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
862
+ nodeToRelocate.nextSibling !== insertBeforeNode) {
863
+ // we've checked that it's worth while to relocate
864
+ // since that the node to relocate
865
+ // has a different next sibling or parent relocated
866
+ if (nodeToRelocate !== insertBeforeNode) {
867
+ if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
868
+ // probably a component in the index.html that doesn't have it's hostname set
869
+ nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
870
+ }
871
+ // add it back to the dom but in its new home
872
+ parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
873
+ }
874
+ }
875
+ }
876
+ else {
877
+ // this node doesn't have a slot home to go to, so let's hide it
878
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
879
+ nodeToRelocate.hidden = true;
880
+ }
881
+ }
882
+ }
883
+ }
884
+ if (checkSlotFallbackVisibility) {
885
+ updateFallbackSlotVisibility(rootVnode.$elm$);
886
+ }
887
+ // done moving nodes around
888
+ // allow the disconnect callback to work again
889
+ plt.$flags$ &= ~1 /* isTmpDisconnected */;
890
+ // always reset
891
+ relocateNodes.length = 0;
892
+ }
519
893
  };
520
894
  const getElement = (ref) => (getHostRef(ref).$hostElement$ );
521
895
  const createEvent = (ref, name, flags) => {
@@ -572,6 +946,9 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
572
946
  promise = safeCall(instance, 'componentWillLoad');
573
947
  }
574
948
  }
949
+ {
950
+ promise = then(promise, () => safeCall(instance, 'componentWillRender'));
951
+ }
575
952
  endSchedule();
576
953
  return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
577
954
  };
@@ -730,6 +1107,15 @@ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
730
1107
  const parsePropertyValue = (propValue, propType) => {
731
1108
  // ensure this value is of the correct prop type
732
1109
  if (propValue != null && !isComplexType(propValue)) {
1110
+ if (propType & 4 /* Boolean */) {
1111
+ // per the HTML spec, any string value means it is a boolean true value
1112
+ // but we'll cheat here and say that the string "false" is the boolean false
1113
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
1114
+ }
1115
+ if (propType & 2 /* Number */) {
1116
+ // force it to be a number
1117
+ return parseFloat(propValue);
1118
+ }
733
1119
  if (propType & 1 /* String */) {
734
1120
  // could have been passed as a number or boolean
735
1121
  // but we still want it as a string
@@ -979,6 +1365,15 @@ const connectedCallback = (elm) => {
979
1365
  if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
980
1366
  // first time this component has connected
981
1367
  hostRef.$flags$ |= 1 /* hasConnected */;
1368
+ {
1369
+ // initUpdate
1370
+ // if the slot polyfill is required we'll need to put some nodes
1371
+ // in here to act as original content anchors as we move nodes around
1372
+ // host element has been connected to the DOM
1373
+ if ((cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */))) {
1374
+ setContentReference(elm);
1375
+ }
1376
+ }
982
1377
  {
983
1378
  // find the first ancestor component (if there is one) and register
984
1379
  // this component as one of the actively loading child components for its ancestor
@@ -1016,6 +1411,17 @@ const connectedCallback = (elm) => {
1016
1411
  endConnected();
1017
1412
  }
1018
1413
  };
1414
+ const setContentReference = (elm) => {
1415
+ // only required when we're NOT using native shadow dom (slot)
1416
+ // or this browser doesn't support native shadow dom
1417
+ // and this host element was NOT created with SSR
1418
+ // let's pick out the inner content for slot projection
1419
+ // create a node to represent where the original
1420
+ // content was first placed, which is useful later on
1421
+ const contentRefElm = (elm['s-cr'] = doc.createComment(''));
1422
+ contentRefElm['s-cn'] = true;
1423
+ elm.insertBefore(contentRefElm, elm.firstChild);
1424
+ };
1019
1425
  const disconnectedCallback = (elm) => {
1020
1426
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1021
1427
  const hostRef = getHostRef(elm);
@@ -1205,4 +1611,4 @@ const flush = () => {
1205
1611
  const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1206
1612
  const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1207
1613
 
1208
- export { Host as H, bootstrapLazy as b, createEvent as c, h, promiseResolve as p, registerInstance as r };
1614
+ export { Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r };
@@ -1,4 +1,4 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-ffda6382.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-6a83ac96.js';
2
2
 
3
3
  /*
4
4
  Stencil Client Patch Esm v2.16.1 | MIT Licensed | https://stenciljs.com
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-application",[[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",[[1,"teste-pesquisa"]]]], options);
13
+ return bootstrapLazy([["snk-crud",[[6,"snk-crud",{"configName":[1,"config-name"],"formTitle":[1,"form-title"],"actionsList":[16],"recordsValidator":[8,"records-validator"],"_dataUnit":[32],"_dataState":[32]}]]],["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"messageBuilder":[16],"beforeSave":[16],"afterSave":[16],"autoLoad":[4,"auto-load"],"getDataUnit":[64]}]]],["snk-application",[[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],"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",[[2,"snk-form",{"formTitle":[1,"form-title"],"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",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-taskbar",[[6,"snk-taskbar",{"buttons":[1],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_permissions":[32]}]]]], options);
14
14
  });
15
15
  };
16
16
 
@@ -1,4 +1,4 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-ffda6382.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-6a83ac96.js';
2
2
 
3
3
  /*
4
4
  Stencil Client Patch Browser v2.16.1 | MIT Licensed | https://stenciljs.com
@@ -13,5 +13,5 @@ const patchBrowser = () => {
13
13
  };
14
14
 
15
15
  patchBrowser().then(options => {
16
- return bootstrapLazy([["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-application",[[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",[[1,"teste-pesquisa"]]]], options);
16
+ return bootstrapLazy([["snk-crud",[[6,"snk-crud",{"configName":[1,"config-name"],"formTitle":[1,"form-title"],"actionsList":[16],"recordsValidator":[8,"records-validator"],"_dataUnit":[32],"_dataState":[32]}]]],["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"messageBuilder":[16],"beforeSave":[16],"afterSave":[16],"autoLoad":[4,"auto-load"],"getDataUnit":[64]}]]],["snk-application",[[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],"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",[[2,"snk-form",{"formTitle":[1,"form-title"],"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",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-taskbar",[[6,"snk-taskbar",{"buttons":[1],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_permissions":[32]}]]]], options);
17
17
  });