ednl-liftstatus-web-components 1.5.2 → 1.9.0

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 (97) hide show
  1. package/dist/cjs/ednl-liftstatus-web-components.cjs.js +2 -2
  2. package/dist/cjs/{index-23750fdc.js → index-5589581f.js} +373 -7
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/ls-3d-scene_8.cjs.entry.js +96531 -0
  5. package/dist/cjs/ls-counters.cjs.entry.js +1 -1
  6. package/dist/cjs/ls-history.cjs.entry.js +1 -1
  7. package/dist/cjs/ls-status-history.cjs.entry.js +1 -1
  8. package/dist/collection/collection-manifest.json +2 -0
  9. package/dist/collection/components/ls-3d-scene/ls-3d-scene.css +12 -0
  10. package/dist/collection/components/ls-3d-scene/ls-3d-scene.js +47 -38
  11. package/dist/collection/components/ls-data/ls-data.js +166 -102
  12. package/dist/collection/components/ls-indicator/ls-indicator.css +11 -11
  13. package/dist/collection/components/ls-indicator/ls-indicator.js +11 -15
  14. package/dist/collection/components/ls-recent-stops/ls-recent-stops.css +110 -0
  15. package/dist/collection/components/ls-recent-stops/ls-recent-stops.js +362 -0
  16. package/dist/collection/components/ls-status/ls-status.css +12 -0
  17. package/dist/collection/components/ls-status/ls-status.js +2 -2
  18. package/dist/collection/components/ls-status-item/ls-status-item.css +13 -4
  19. package/dist/collection/components/ls-status-item/ls-status-item.js +29 -9
  20. package/dist/collection/components/ls-status-messages/ls-status-messages.css +82 -0
  21. package/dist/collection/components/ls-status-messages/ls-status-messages.js +140 -0
  22. package/dist/collection/components/ls-swimlane/assets/elevator-closed.png +0 -0
  23. package/dist/collection/components/ls-swimlane/assets/elevator-closing.png +0 -0
  24. package/dist/collection/components/ls-swimlane/assets/elevator-locked.png +0 -0
  25. package/dist/collection/components/ls-swimlane/assets/elevator-open.png +0 -0
  26. package/dist/collection/components/ls-swimlane/assets/elevator-opening.png +0 -0
  27. package/dist/collection/components/ls-swimlane/ls-swimlane.css +39 -0
  28. package/dist/collection/components/ls-swimlane/ls-swimlane.js +617 -4
  29. package/dist/collection/store.js +9287 -1
  30. package/dist/collection/utils/translate.js +11 -0
  31. package/dist/custom-elements/index.d.ts +12 -0
  32. package/dist/custom-elements/index.js +35870 -809
  33. package/dist/ednl-liftstatus-web-components/assets/elevator-closed.png +0 -0
  34. package/dist/ednl-liftstatus-web-components/assets/elevator-closing.png +0 -0
  35. package/dist/ednl-liftstatus-web-components/assets/elevator-locked.png +0 -0
  36. package/dist/ednl-liftstatus-web-components/assets/elevator-open.png +0 -0
  37. package/dist/ednl-liftstatus-web-components/assets/elevator-opening.png +0 -0
  38. package/dist/ednl-liftstatus-web-components/ednl-liftstatus-web-components.css +2 -2
  39. package/dist/ednl-liftstatus-web-components/ednl-liftstatus-web-components.esm.js +1 -1
  40. package/dist/ednl-liftstatus-web-components/{p-07497fce.entry.js → p-02d4fbbb.entry.js} +1 -1
  41. package/dist/ednl-liftstatus-web-components/{p-be96ac1c.entry.js → p-4ff6e800.entry.js} +1 -1
  42. package/dist/ednl-liftstatus-web-components/p-9b904655.js +1 -0
  43. package/dist/ednl-liftstatus-web-components/{p-66d161e2.entry.js → p-a49bbeae.entry.js} +1 -1
  44. package/dist/ednl-liftstatus-web-components/p-c2729fc7.entry.js +3 -0
  45. package/dist/esm/ednl-liftstatus-web-components.js +2 -2
  46. package/dist/esm/{index-558a910b.js → index-a4f084a4.js} +373 -7
  47. package/dist/esm/loader.js +2 -2
  48. package/dist/esm/ls-3d-scene_8.entry.js +96520 -0
  49. package/dist/esm/ls-counters.entry.js +1 -1
  50. package/dist/esm/ls-history.entry.js +1 -1
  51. package/dist/esm/ls-status-history.entry.js +1 -1
  52. package/dist/types/components/ls-3d-scene/ls-3d-scene.d.ts +17 -5
  53. package/dist/types/components/ls-data/ls-data.d.ts +23 -12
  54. package/dist/types/components/ls-indicator/ls-indicator.d.ts +7 -3
  55. package/dist/types/components/ls-recent-stops/ls-recent-stops.d.ts +40 -0
  56. package/dist/types/components/ls-status-item/ls-status-item.d.ts +15 -8
  57. package/dist/types/components/ls-status-messages/ls-status-messages.d.ts +46 -0
  58. package/dist/types/components/ls-swimlane/ls-swimlane.d.ts +68 -0
  59. package/dist/types/components.d.ts +54 -14
  60. package/dist/types/store.d.ts +9286 -0
  61. package/dist/types/utils/translate.d.ts +8 -0
  62. package/dist/types/utils/types.d.ts +260 -0
  63. package/package.json +5 -1
  64. package/dist/cjs/dayjs.min-42b4712a.js +0 -9
  65. package/dist/cjs/ls-3d-scene.cjs.entry.js +0 -50700
  66. package/dist/cjs/ls-data.cjs.entry.js +0 -9887
  67. package/dist/cjs/ls-indicator.cjs.entry.js +0 -38
  68. package/dist/cjs/ls-status-item.cjs.entry.js +0 -43
  69. package/dist/cjs/ls-status.cjs.entry.js +0 -24
  70. package/dist/cjs/ls-swimlane.cjs.entry.js +0 -19
  71. package/dist/cjs/process-es6-36bf0e9c.js +0 -230
  72. package/dist/cjs/pubsub-5a5af33e.js +0 -385
  73. package/dist/cjs/store-7810e598.js +0 -199
  74. package/dist/collection/utils/utils.js +0 -3
  75. package/dist/ednl-liftstatus-web-components/p-06133f13.entry.js +0 -1
  76. package/dist/ednl-liftstatus-web-components/p-154beb99.js +0 -1
  77. package/dist/ednl-liftstatus-web-components/p-1adfa076.js +0 -1
  78. package/dist/ednl-liftstatus-web-components/p-2e42390c.entry.js +0 -1
  79. package/dist/ednl-liftstatus-web-components/p-327f59f7.entry.js +0 -1
  80. package/dist/ednl-liftstatus-web-components/p-6f1560a9.js +0 -1
  81. package/dist/ednl-liftstatus-web-components/p-8d1a85c5.entry.js +0 -1
  82. package/dist/ednl-liftstatus-web-components/p-8d558661.js +0 -1
  83. package/dist/ednl-liftstatus-web-components/p-9a77dcb7.entry.js +0 -3
  84. package/dist/ednl-liftstatus-web-components/p-bf71b10e.js +0 -1
  85. package/dist/ednl-liftstatus-web-components/p-c9828bc4.entry.js +0 -1
  86. package/dist/esm/dayjs.min-3ec7a1f5.js +0 -7
  87. package/dist/esm/ls-3d-scene.entry.js +0 -50696
  88. package/dist/esm/ls-data.entry.js +0 -9883
  89. package/dist/esm/ls-indicator.entry.js +0 -34
  90. package/dist/esm/ls-status-item.entry.js +0 -39
  91. package/dist/esm/ls-status.entry.js +0 -20
  92. package/dist/esm/ls-swimlane.entry.js +0 -15
  93. package/dist/esm/process-es6-cc264d03.js +0 -227
  94. package/dist/esm/pubsub-be011690.js +0 -380
  95. package/dist/esm/store-2a431718.js +0 -197
  96. package/dist/types/components/ls-3d-scene/types.d.ts +0 -9
  97. package/dist/types/utils/utils.d.ts +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-23750fdc.js');
3
+ const index = require('./index-5589581f.js');
4
4
 
5
5
  /*
6
6
  Stencil Client Patch Browser v2.9.0 | MIT Licensed | https://stenciljs.com
@@ -15,5 +15,5 @@ const patchBrowser = () => {
15
15
  };
16
16
 
17
17
  patchBrowser().then(options => {
18
- return index.bootstrapLazy([["ls-3d-scene.cjs",[[1,"ls-3d-scene",{"sensor500":[32],"sensor515":[32],"sensor514":[32]}]]],["ls-status.cjs",[[1,"ls-status",{"sensorIds":[1,"sensor-ids"]}]]],["ls-counters.cjs",[[1,"ls-counters"]]],["ls-data.cjs",[[1,"ls-data",{"accessToken":[1,"access-token"],"installationId":[1,"installation-id"]}]]],["ls-history.cjs",[[1,"ls-history"]]],["ls-status-history.cjs",[[1,"ls-status-history"]]],["ls-swimlane.cjs",[[1,"ls-swimlane"]]],["ls-indicator.cjs",[[1,"ls-indicator",{"sensorId":[8,"sensor-id"],"dataLabel":[32],"sensorData":[32]}]]],["ls-status-item.cjs",[[1,"ls-status-item",{"sensorId":[2,"sensor-id"],"dataLabel":[32],"sensorData":[32],"timestamp":[32]}]]]], options);
18
+ return index.bootstrapLazy([["ls-counters.cjs",[[1,"ls-counters"]]],["ls-history.cjs",[[1,"ls-history"]]],["ls-status-history.cjs",[[1,"ls-status-history"]]],["ls-3d-scene_8.cjs",[[1,"ls-3d-scene",{"movementState":[32],"currentStop":[32],"lastPassedStop":[32],"time":[32]}],[1,"ls-status",{"sensorIds":[1,"sensor-ids"]}],[1,"ls-data",{"accessToken":[1,"access-token"]}],[4,"ls-recent-stops",{"chartLoading":[32]}],[1,"ls-status-messages",{"showTitle":[4,"show-title"],"statusMessages":[32],"lastChange":[32],"time":[32]}],[4,"ls-swimlane",{"sensorIds":[1,"sensor-ids"]}],[1,"ls-indicator",{"sensorId":[2,"sensor-id"],"dataLabel":[32],"sensorData":[32]}],[1,"ls-status-item",{"sensorId":[2,"sensor-id"],"sensorData":[32],"timestamp":[32],"time":[32]}]]]], options);
19
19
  });
@@ -23,7 +23,11 @@ function _interopNamespace(e) {
23
23
  const NAMESPACE = 'ednl-liftstatus-web-components';
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 renderingRef = null;
29
33
  let queuePending = false;
@@ -155,6 +159,7 @@ const isComplexType = (o) => {
155
159
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
156
160
  const h = (nodeName, vnodeData, ...children) => {
157
161
  let child = null;
162
+ let slotName = null;
158
163
  let simple = false;
159
164
  let lastSimple = false;
160
165
  let vNodeChildren = [];
@@ -182,6 +187,9 @@ const h = (nodeName, vnodeData, ...children) => {
182
187
  };
183
188
  walk(children);
184
189
  if (vnodeData) {
190
+ if (vnodeData.name) {
191
+ slotName = vnodeData.name;
192
+ }
185
193
  {
186
194
  const classData = vnodeData.className || vnodeData.class;
187
195
  if (classData) {
@@ -199,6 +207,9 @@ const h = (nodeName, vnodeData, ...children) => {
199
207
  if (vNodeChildren.length > 0) {
200
208
  vnode.$children$ = vNodeChildren;
201
209
  }
210
+ {
211
+ vnode.$name$ = slotName;
212
+ }
202
213
  return vnode;
203
214
  };
204
215
  const newVNode = (tag, text) => {
@@ -212,6 +223,9 @@ const newVNode = (tag, text) => {
212
223
  {
213
224
  vnode.$attrs$ = null;
214
225
  }
226
+ {
227
+ vnode.$name$ = null;
228
+ }
215
229
  return vnode;
216
230
  };
217
231
  const Host = {};
@@ -309,13 +323,36 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
309
323
  let i = 0;
310
324
  let elm;
311
325
  let childNode;
326
+ let oldVNode;
327
+ if (!useNativeShadowDom) {
328
+ // remember for later we need to check to relocate nodes
329
+ checkSlotRelocate = true;
330
+ if (newVNode.$tag$ === 'slot') {
331
+ if (scopeId) {
332
+ // scoped css needs to add its scoped id to the parent element
333
+ parentElm.classList.add(scopeId + '-s');
334
+ }
335
+ newVNode.$flags$ |= newVNode.$children$
336
+ ? // slot element has fallback content
337
+ 2 /* isSlotFallback */
338
+ : // slot element does not have fallback content
339
+ 1 /* isSlotReference */;
340
+ }
341
+ }
312
342
  if (newVNode.$text$ !== null) {
313
343
  // create text node
314
344
  elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
315
345
  }
346
+ else if (newVNode.$flags$ & 1 /* isSlotReference */) {
347
+ // create a slot reference node
348
+ elm = newVNode.$elm$ =
349
+ doc.createTextNode('');
350
+ }
316
351
  else {
317
352
  // create element
318
- elm = newVNode.$elm$ = (doc.createElement(newVNode.$tag$));
353
+ elm = newVNode.$elm$ = (doc.createElement(newVNode.$flags$ & 2 /* isSlotFallback */
354
+ ? 'slot-fb'
355
+ : newVNode.$tag$));
319
356
  // add css classes, attrs, props, listeners, etc.
320
357
  {
321
358
  updateElement(null, newVNode, isSvgMode);
@@ -328,7 +365,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
328
365
  if (newVNode.$children$) {
329
366
  for (i = 0; i < newVNode.$children$.length; ++i) {
330
367
  // create the node
331
- childNode = createElm(oldParentVNode, newVNode, i);
368
+ childNode = createElm(oldParentVNode, newVNode, i, elm);
332
369
  // return node could have been null
333
370
  if (childNode) {
334
371
  // append our new node
@@ -337,20 +374,62 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
337
374
  }
338
375
  }
339
376
  }
377
+ {
378
+ elm['s-hn'] = hostTagName;
379
+ if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
380
+ // remember the content reference comment
381
+ elm['s-sr'] = true;
382
+ // remember the content reference comment
383
+ elm['s-cr'] = contentRef;
384
+ // remember the slot name, or empty string for default slot
385
+ elm['s-sn'] = newVNode.$name$ || '';
386
+ // check if we've got an old vnode for this slot
387
+ oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
388
+ if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
389
+ // we've got an old slot vnode and the wrapper is being replaced
390
+ // so let's move the old slot content back to it's original location
391
+ putBackInOriginalLocation(oldParentVNode.$elm$, false);
392
+ }
393
+ }
394
+ }
340
395
  return elm;
341
396
  };
397
+ const putBackInOriginalLocation = (parentElm, recursive) => {
398
+ plt.$flags$ |= 1 /* isTmpDisconnected */;
399
+ const oldSlotChildNodes = parentElm.childNodes;
400
+ for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
401
+ const childNode = oldSlotChildNodes[i];
402
+ if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
403
+ // // this child node in the old element is from another component
404
+ // // remove this node from the old slot's parent
405
+ // childNode.remove();
406
+ // and relocate it back to it's original location
407
+ parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
408
+ // remove the old original location comment entirely
409
+ // later on the patch function will know what to do
410
+ // and move this to the correct spot in need be
411
+ childNode['s-ol'].remove();
412
+ childNode['s-ol'] = undefined;
413
+ checkSlotRelocate = true;
414
+ }
415
+ if (recursive) {
416
+ putBackInOriginalLocation(childNode, recursive);
417
+ }
418
+ }
419
+ plt.$flags$ &= ~1 /* isTmpDisconnected */;
420
+ };
342
421
  const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
343
- let containerElm = (parentElm);
422
+ let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
344
423
  let childNode;
345
424
  if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
346
425
  containerElm = containerElm.shadowRoot;
347
426
  }
348
427
  for (; startIdx <= endIdx; ++startIdx) {
349
428
  if (vnodes[startIdx]) {
350
- childNode = createElm(null, parentVNode, startIdx);
429
+ childNode = createElm(null, parentVNode, startIdx, parentElm);
351
430
  if (childNode) {
352
431
  vnodes[startIdx].$elm$ = childNode;
353
- containerElm.insertBefore(childNode, before);
432
+ containerElm.insertBefore(childNode, referenceNode(before) );
354
433
  }
355
434
  }
356
435
  }
@@ -360,6 +439,20 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
360
439
  if ((vnode = vnodes[startIdx])) {
361
440
  elm = vnode.$elm$;
362
441
  callNodeRefs(vnode);
442
+ {
443
+ // we're removing this element
444
+ // so it's possible we need to show slot fallback content now
445
+ checkSlotFallbackVisibility = true;
446
+ if (elm['s-ol']) {
447
+ // remove the original location comment
448
+ elm['s-ol'].remove();
449
+ }
450
+ else {
451
+ // it's possible that child nodes of the node
452
+ // that's being removed are slot nodes
453
+ putBackInOriginalLocation(elm, true);
454
+ }
455
+ }
363
456
  // remove the vnode's element from the dom
364
457
  elm.remove();
365
458
  }
@@ -400,12 +493,20 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
400
493
  newEndVnode = newCh[--newEndIdx];
401
494
  }
402
495
  else if (isSameVnode(oldStartVnode, newEndVnode)) {
496
+ // Vnode moved right
497
+ if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
498
+ putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
499
+ }
403
500
  patch(oldStartVnode, newEndVnode);
404
501
  parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
405
502
  oldStartVnode = oldCh[++oldStartIdx];
406
503
  newEndVnode = newCh[--newEndIdx];
407
504
  }
408
505
  else if (isSameVnode(oldEndVnode, newStartVnode)) {
506
+ // Vnode moved left
507
+ if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
508
+ putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
509
+ }
409
510
  patch(oldEndVnode, newStartVnode);
410
511
  parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
411
512
  oldEndVnode = oldCh[--oldEndIdx];
@@ -414,12 +515,12 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
414
515
  else {
415
516
  {
416
517
  // new element
417
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
518
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
418
519
  newStartVnode = newCh[++newStartIdx];
419
520
  }
420
521
  if (node) {
421
522
  {
422
- oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
523
+ parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
423
524
  }
424
525
  }
425
526
  }
@@ -435,16 +536,28 @@ const isSameVnode = (vnode1, vnode2) => {
435
536
  // compare if two vnode to see if they're "technically" the same
436
537
  // need to have the same element tag, and same key to be the same
437
538
  if (vnode1.$tag$ === vnode2.$tag$) {
539
+ if (vnode1.$tag$ === 'slot') {
540
+ return vnode1.$name$ === vnode2.$name$;
541
+ }
438
542
  return true;
439
543
  }
440
544
  return false;
441
545
  };
546
+ const referenceNode = (node) => {
547
+ // this node was relocated to a new location in the dom
548
+ // because of some other component's slot
549
+ // but we still have an html comment in place of where
550
+ // it's original location was according to it's original vdom
551
+ return (node && node['s-ol']) || node;
552
+ };
553
+ const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
442
554
  const patch = (oldVNode, newVNode) => {
443
555
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
444
556
  const oldChildren = oldVNode.$children$;
445
557
  const newChildren = newVNode.$children$;
446
558
  const tag = newVNode.$tag$;
447
559
  const text = newVNode.$text$;
560
+ let defaultHolder;
448
561
  if (text === null) {
449
562
  // element node
450
563
  {
@@ -475,12 +588,147 @@ const patch = (oldVNode, newVNode) => {
475
588
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
476
589
  }
477
590
  }
591
+ else if ((defaultHolder = elm['s-cr'])) {
592
+ // this element has slotted content
593
+ defaultHolder.parentNode.textContent = text;
594
+ }
478
595
  else if (oldVNode.$text$ !== text) {
479
596
  // update the text content for the text only vnode
480
597
  // and also only if the text is different than before
481
598
  elm.data = text;
482
599
  }
483
600
  };
601
+ const updateFallbackSlotVisibility = (elm) => {
602
+ // tslint:disable-next-line: prefer-const
603
+ let childNodes = elm.childNodes;
604
+ let childNode;
605
+ let i;
606
+ let ilen;
607
+ let j;
608
+ let slotNameAttr;
609
+ let nodeType;
610
+ for (i = 0, ilen = childNodes.length; i < ilen; i++) {
611
+ childNode = childNodes[i];
612
+ if (childNode.nodeType === 1 /* ElementNode */) {
613
+ if (childNode['s-sr']) {
614
+ // this is a slot fallback node
615
+ // get the slot name for this slot reference node
616
+ slotNameAttr = childNode['s-sn'];
617
+ // by default always show a fallback slot node
618
+ // then hide it if there are other slots in the light dom
619
+ childNode.hidden = false;
620
+ for (j = 0; j < ilen; j++) {
621
+ nodeType = childNodes[j].nodeType;
622
+ if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
623
+ // this sibling node is from a different component OR is a named fallback slot node
624
+ if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
625
+ childNode.hidden = true;
626
+ break;
627
+ }
628
+ }
629
+ else {
630
+ // this is a default fallback slot node
631
+ // any element or text node (with content)
632
+ // should hide the default fallback slot node
633
+ if (nodeType === 1 /* ElementNode */ ||
634
+ (nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
635
+ childNode.hidden = true;
636
+ break;
637
+ }
638
+ }
639
+ }
640
+ }
641
+ // keep drilling down
642
+ updateFallbackSlotVisibility(childNode);
643
+ }
644
+ }
645
+ };
646
+ const relocateNodes = [];
647
+ const relocateSlotContent = (elm) => {
648
+ // tslint:disable-next-line: prefer-const
649
+ let childNode;
650
+ let node;
651
+ let hostContentNodes;
652
+ let slotNameAttr;
653
+ let relocateNodeData;
654
+ let j;
655
+ let i = 0;
656
+ let childNodes = elm.childNodes;
657
+ let ilen = childNodes.length;
658
+ for (; i < ilen; i++) {
659
+ childNode = childNodes[i];
660
+ if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
661
+ // first got the content reference comment node
662
+ // then we got it's parent, which is where all the host content is in now
663
+ hostContentNodes = node.parentNode.childNodes;
664
+ slotNameAttr = childNode['s-sn'];
665
+ for (j = hostContentNodes.length - 1; j >= 0; j--) {
666
+ node = hostContentNodes[j];
667
+ if (!node['s-cn'] && !node['s-nr'] && node['s-hn'] !== childNode['s-hn']) {
668
+ // let's do some relocating to its new home
669
+ // but never relocate a content reference node
670
+ // that is suppose to always represent the original content location
671
+ if (isNodeLocatedInSlot(node, slotNameAttr)) {
672
+ // it's possible we've already decided to relocate this node
673
+ relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
674
+ // made some changes to slots
675
+ // let's make sure we also double check
676
+ // fallbacks are correctly hidden or shown
677
+ checkSlotFallbackVisibility = true;
678
+ node['s-sn'] = node['s-sn'] || slotNameAttr;
679
+ if (relocateNodeData) {
680
+ // previously we never found a slot home for this node
681
+ // but turns out we did, so let's remember it now
682
+ relocateNodeData.$slotRefNode$ = childNode;
683
+ }
684
+ else {
685
+ // add to our list of nodes to relocate
686
+ relocateNodes.push({
687
+ $slotRefNode$: childNode,
688
+ $nodeToRelocate$: node,
689
+ });
690
+ }
691
+ if (node['s-sr']) {
692
+ relocateNodes.map((relocateNode) => {
693
+ if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
694
+ relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
695
+ if (relocateNodeData && !relocateNode.$slotRefNode$) {
696
+ relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
697
+ }
698
+ }
699
+ });
700
+ }
701
+ }
702
+ else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
703
+ // so far this element does not have a slot home, not setting slotRefNode on purpose
704
+ // if we never find a home for this element then we'll need to hide it
705
+ relocateNodes.push({
706
+ $nodeToRelocate$: node,
707
+ });
708
+ }
709
+ }
710
+ }
711
+ }
712
+ if (childNode.nodeType === 1 /* ElementNode */) {
713
+ relocateSlotContent(childNode);
714
+ }
715
+ }
716
+ };
717
+ const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
718
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
719
+ if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
720
+ return true;
721
+ }
722
+ if (nodeToRelocate.getAttribute('slot') === slotNameAttr) {
723
+ return true;
724
+ }
725
+ return false;
726
+ }
727
+ if (nodeToRelocate['s-sn'] === slotNameAttr) {
728
+ return true;
729
+ }
730
+ return slotNameAttr === '';
731
+ };
484
732
  const callNodeRefs = (vNode) => {
485
733
  {
486
734
  vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
@@ -489,6 +737,7 @@ const callNodeRefs = (vNode) => {
489
737
  };
490
738
  const renderVdom = (hostRef, renderFnResults) => {
491
739
  const hostElm = hostRef.$hostElement$;
740
+ const cmpMeta = hostRef.$cmpMeta$;
492
741
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
493
742
  const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
494
743
  hostTagName = hostElm.tagName;
@@ -499,8 +748,90 @@ const renderVdom = (hostRef, renderFnResults) => {
499
748
  {
500
749
  scopeId = hostElm['s-sc'];
501
750
  }
751
+ {
752
+ contentRef = hostElm['s-cr'];
753
+ useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
754
+ // always reset
755
+ checkSlotFallbackVisibility = false;
756
+ }
502
757
  // synchronous patch
503
758
  patch(oldVNode, rootVnode);
759
+ {
760
+ // while we're moving nodes around existing nodes, temporarily disable
761
+ // the disconnectCallback from working
762
+ plt.$flags$ |= 1 /* isTmpDisconnected */;
763
+ if (checkSlotRelocate) {
764
+ relocateSlotContent(rootVnode.$elm$);
765
+ let relocateData;
766
+ let nodeToRelocate;
767
+ let orgLocationNode;
768
+ let parentNodeRef;
769
+ let insertBeforeNode;
770
+ let refNode;
771
+ let i = 0;
772
+ for (; i < relocateNodes.length; i++) {
773
+ relocateData = relocateNodes[i];
774
+ nodeToRelocate = relocateData.$nodeToRelocate$;
775
+ if (!nodeToRelocate['s-ol']) {
776
+ // add a reference node marking this node's original location
777
+ // keep a reference to this node for later lookups
778
+ orgLocationNode =
779
+ doc.createTextNode('');
780
+ orgLocationNode['s-nr'] = nodeToRelocate;
781
+ nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
782
+ }
783
+ }
784
+ for (i = 0; i < relocateNodes.length; i++) {
785
+ relocateData = relocateNodes[i];
786
+ nodeToRelocate = relocateData.$nodeToRelocate$;
787
+ if (relocateData.$slotRefNode$) {
788
+ // by default we're just going to insert it directly
789
+ // after the slot reference node
790
+ parentNodeRef = relocateData.$slotRefNode$.parentNode;
791
+ insertBeforeNode = relocateData.$slotRefNode$.nextSibling;
792
+ orgLocationNode = nodeToRelocate['s-ol'];
793
+ while ((orgLocationNode = orgLocationNode.previousSibling)) {
794
+ refNode = orgLocationNode['s-nr'];
795
+ if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
796
+ refNode = refNode.nextSibling;
797
+ if (!refNode || !refNode['s-nr']) {
798
+ insertBeforeNode = refNode;
799
+ break;
800
+ }
801
+ }
802
+ }
803
+ if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
804
+ nodeToRelocate.nextSibling !== insertBeforeNode) {
805
+ // we've checked that it's worth while to relocate
806
+ // since that the node to relocate
807
+ // has a different next sibling or parent relocated
808
+ if (nodeToRelocate !== insertBeforeNode) {
809
+ if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
810
+ // probably a component in the index.html that doesn't have it's hostname set
811
+ nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
812
+ }
813
+ // add it back to the dom but in its new home
814
+ parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
815
+ }
816
+ }
817
+ }
818
+ else {
819
+ // this node doesn't have a slot home to go to, so let's hide it
820
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
821
+ nodeToRelocate.hidden = true;
822
+ }
823
+ }
824
+ }
825
+ }
826
+ if (checkSlotFallbackVisibility) {
827
+ updateFallbackSlotVisibility(rootVnode.$elm$);
828
+ }
829
+ // done moving nodes around
830
+ // allow the disconnect callback to work again
831
+ plt.$flags$ &= ~1 /* isTmpDisconnected */;
832
+ // always reset
833
+ relocateNodes.length = 0;
834
+ }
504
835
  };
505
836
  /**
506
837
  * Helper function to create & dispatch a custom Event on a provided target
@@ -693,6 +1024,11 @@ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
693
1024
  const parsePropertyValue = (propValue, propType) => {
694
1025
  // ensure this value is of the correct prop type
695
1026
  if (propValue != null && !isComplexType(propValue)) {
1027
+ if (propType & 4 /* Boolean */) {
1028
+ // per the HTML spec, any string value means it is a boolean true value
1029
+ // but we'll cheat here and say that the string "false" is the boolean false
1030
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
1031
+ }
696
1032
  if (propType & 2 /* Number */) {
697
1033
  // force it to be a number
698
1034
  return parseFloat(propValue);
@@ -854,6 +1190,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
854
1190
  hostRef.$flags$ &= ~8 /* isConstructingInstance */;
855
1191
  }
856
1192
  endNewInstance();
1193
+ fireConnectedCallback(hostRef.$lazyInstance$);
857
1194
  }
858
1195
  if (Cstr.style) {
859
1196
  // this component has styles but we haven't registered them yet
@@ -882,6 +1219,11 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
882
1219
  schedule();
883
1220
  }
884
1221
  };
1222
+ const fireConnectedCallback = (instance) => {
1223
+ {
1224
+ safeCall(instance, 'connectedCallback');
1225
+ }
1226
+ };
885
1227
  const connectedCallback = (elm) => {
886
1228
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
887
1229
  const hostRef = getHostRef(elm);
@@ -890,6 +1232,15 @@ const connectedCallback = (elm) => {
890
1232
  if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
891
1233
  // first time this component has connected
892
1234
  hostRef.$flags$ |= 1 /* hasConnected */;
1235
+ {
1236
+ // initUpdate
1237
+ // if the slot polyfill is required we'll need to put some nodes
1238
+ // in here to act as original content anchors as we move nodes around
1239
+ // host element has been connected to the DOM
1240
+ if ((cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */))) {
1241
+ setContentReference(elm);
1242
+ }
1243
+ }
893
1244
  {
894
1245
  // find the first ancestor component (if there is one) and register
895
1246
  // this component as one of the actively loading child components for its ancestor
@@ -920,9 +1271,24 @@ const connectedCallback = (elm) => {
920
1271
  initializeComponent(elm, hostRef, cmpMeta);
921
1272
  }
922
1273
  }
1274
+ else {
1275
+ // fire off connectedCallback() on component instance
1276
+ fireConnectedCallback(hostRef.$lazyInstance$);
1277
+ }
923
1278
  endConnected();
924
1279
  }
925
1280
  };
1281
+ const setContentReference = (elm) => {
1282
+ // only required when we're NOT using native shadow dom (slot)
1283
+ // or this browser doesn't support native shadow dom
1284
+ // and this host element was NOT created with SSR
1285
+ // let's pick out the inner content for slot projection
1286
+ // create a node to represent where the original
1287
+ // content was first placed, which is useful later on
1288
+ const contentRefElm = (elm['s-cr'] = doc.createComment(''));
1289
+ contentRefElm['s-cn'] = true;
1290
+ elm.insertBefore(contentRefElm, elm.firstChild);
1291
+ };
926
1292
  const disconnectedCallback = (elm) => {
927
1293
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
928
1294
  const hostRef = getHostRef(elm);
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-23750fdc.js');
5
+ const index = require('./index-5589581f.js');
6
6
 
7
7
  /*
8
8
  Stencil Client Patch Esm v2.9.0 | 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([["ls-3d-scene.cjs",[[1,"ls-3d-scene",{"sensor500":[32],"sensor515":[32],"sensor514":[32]}]]],["ls-status.cjs",[[1,"ls-status",{"sensorIds":[1,"sensor-ids"]}]]],["ls-counters.cjs",[[1,"ls-counters"]]],["ls-data.cjs",[[1,"ls-data",{"accessToken":[1,"access-token"],"installationId":[1,"installation-id"]}]]],["ls-history.cjs",[[1,"ls-history"]]],["ls-status-history.cjs",[[1,"ls-status-history"]]],["ls-swimlane.cjs",[[1,"ls-swimlane"]]],["ls-indicator.cjs",[[1,"ls-indicator",{"sensorId":[8,"sensor-id"],"dataLabel":[32],"sensorData":[32]}]]],["ls-status-item.cjs",[[1,"ls-status-item",{"sensorId":[2,"sensor-id"],"dataLabel":[32],"sensorData":[32],"timestamp":[32]}]]]], options);
17
+ return index.bootstrapLazy([["ls-counters.cjs",[[1,"ls-counters"]]],["ls-history.cjs",[[1,"ls-history"]]],["ls-status-history.cjs",[[1,"ls-status-history"]]],["ls-3d-scene_8.cjs",[[1,"ls-3d-scene",{"movementState":[32],"currentStop":[32],"lastPassedStop":[32],"time":[32]}],[1,"ls-status",{"sensorIds":[1,"sensor-ids"]}],[1,"ls-data",{"accessToken":[1,"access-token"]}],[4,"ls-recent-stops",{"chartLoading":[32]}],[1,"ls-status-messages",{"showTitle":[4,"show-title"],"statusMessages":[32],"lastChange":[32],"time":[32]}],[4,"ls-swimlane",{"sensorIds":[1,"sensor-ids"]}],[1,"ls-indicator",{"sensorId":[2,"sensor-id"],"dataLabel":[32],"sensorData":[32]}],[1,"ls-status-item",{"sensorId":[2,"sensor-id"],"sensorData":[32],"timestamp":[32],"time":[32]}]]]], options);
18
18
  });
19
19
  };
20
20