ednl-liftstatus-web-components 1.4.1 → 1.6.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.
- package/dist/cjs/dayjs.min-42b4712a.js +9 -0
- package/dist/cjs/ednl-liftstatus-web-components.cjs.js +2 -2
- package/dist/cjs/global-9027a413.js +7 -0
- package/dist/cjs/{index-23750fdc.js → index-b5d10454.js} +358 -7
- package/dist/cjs/isEmpty-437e2887.js +72 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{ls-3d-scene_8.cjs.entry.js → ls-3d-scene.cjs.entry.js} +61 -10845
- package/dist/cjs/ls-counters.cjs.entry.js +19 -0
- package/dist/cjs/ls-data.cjs.entry.js +9957 -0
- package/dist/cjs/ls-history.cjs.entry.js +19 -0
- package/dist/cjs/ls-indicator.cjs.entry.js +38 -0
- package/dist/cjs/ls-recent-stops.cjs.entry.js +16762 -0
- package/dist/cjs/ls-status-history.cjs.entry.js +19 -0
- package/dist/cjs/ls-status-item.cjs.entry.js +43 -0
- package/dist/cjs/ls-status.cjs.entry.js +24 -0
- package/dist/cjs/ls-swimlane.cjs.entry.js +1040 -0
- package/dist/cjs/process-es6-39ef8921.js +227 -0
- package/dist/cjs/pubsub-5a5af33e.js +385 -0
- package/dist/cjs/store-1909bcd3.js +199 -0
- package/dist/cjs/transform-57fbd12b.js +6963 -0
- package/dist/cjs/values-e1bf1cf4.js +939 -0
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/ls-3d-scene/ls-3d-scene.css +0 -40
- package/dist/collection/components/ls-3d-scene/ls-3d-scene.js +51 -59
- package/dist/collection/components/ls-data/ls-data.js +138 -88
- package/dist/collection/components/ls-indicator/ls-indicator.css +32 -0
- package/dist/collection/components/ls-indicator/ls-indicator.js +64 -0
- package/dist/collection/components/ls-recent-stops/ls-recent-stops.css +102 -0
- package/dist/collection/components/ls-recent-stops/ls-recent-stops.js +361 -0
- package/dist/collection/components/ls-swimlane/assets/elevator-closing.png +0 -0
- package/dist/collection/components/ls-swimlane/assets/elevator-opening.png +0 -0
- package/dist/collection/components/ls-swimlane/assets/elevator.png +0 -0
- package/dist/collection/components/ls-swimlane/ls-swimlane.css +40 -0
- package/dist/collection/components/ls-swimlane/ls-swimlane.js +578 -4
- package/dist/collection/utils/translate.js +25 -0
- package/dist/custom-elements/index.d.ts +12 -0
- package/dist/custom-elements/index.js +26437 -791
- package/dist/ednl-liftstatus-web-components/assets/elevator-closing.png +0 -0
- package/dist/ednl-liftstatus-web-components/assets/elevator-opening.png +0 -0
- package/dist/ednl-liftstatus-web-components/assets/elevator.png +0 -0
- package/dist/ednl-liftstatus-web-components/ednl-liftstatus-web-components.css +2 -2
- package/dist/ednl-liftstatus-web-components/ednl-liftstatus-web-components.esm.js +1 -1
- package/dist/ednl-liftstatus-web-components/p-08fe7342.entry.js +1 -0
- package/dist/ednl-liftstatus-web-components/p-1adfa076.js +1 -0
- package/dist/ednl-liftstatus-web-components/p-229b62fa.entry.js +3 -0
- package/dist/ednl-liftstatus-web-components/p-251fca23.entry.js +1 -0
- package/dist/ednl-liftstatus-web-components/p-2d180048.js +1 -0
- package/dist/ednl-liftstatus-web-components/p-3eb7d9ca.js +1 -0
- package/dist/ednl-liftstatus-web-components/p-66ca7523.entry.js +1 -0
- package/dist/ednl-liftstatus-web-components/p-89992d8e.js +1 -0
- package/dist/ednl-liftstatus-web-components/p-89ad1f6c.entry.js +1 -0
- package/dist/ednl-liftstatus-web-components/p-8d558661.js +1 -0
- package/dist/ednl-liftstatus-web-components/p-8f852ed5.entry.js +1 -0
- package/dist/ednl-liftstatus-web-components/p-a0ef071b.entry.js +1 -0
- package/dist/ednl-liftstatus-web-components/p-a7b39b3c.js +1 -0
- package/dist/ednl-liftstatus-web-components/p-ac4b9712.js +1 -0
- package/dist/ednl-liftstatus-web-components/p-b8177bd9.entry.js +1 -0
- package/dist/ednl-liftstatus-web-components/p-d090c3c5.js +1 -0
- package/dist/ednl-liftstatus-web-components/p-d56bddc2.entry.js +1 -0
- package/dist/ednl-liftstatus-web-components/p-d691795e.entry.js +1 -0
- package/dist/ednl-liftstatus-web-components/p-e369b114.js +1 -0
- package/dist/esm/dayjs.min-3ec7a1f5.js +7 -0
- package/dist/esm/ednl-liftstatus-web-components.js +2 -2
- package/dist/esm/global-e1c7e609.js +5 -0
- package/dist/esm/{index-558a910b.js → index-6306be70.js} +358 -7
- package/dist/esm/isEmpty-078ceec3.js +70 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{ls-3d-scene_8.entry.js → ls-3d-scene.entry.js} +59 -10836
- package/dist/esm/ls-counters.entry.js +15 -0
- package/dist/esm/ls-data.entry.js +9953 -0
- package/dist/esm/ls-history.entry.js +15 -0
- package/dist/esm/ls-indicator.entry.js +34 -0
- package/dist/esm/ls-recent-stops.entry.js +16758 -0
- package/dist/esm/ls-status-history.entry.js +15 -0
- package/dist/esm/ls-status-item.entry.js +39 -0
- package/dist/esm/ls-status.entry.js +20 -0
- package/dist/esm/ls-swimlane.entry.js +1036 -0
- package/dist/esm/process-es6-6fcfb3fc.js +225 -0
- package/dist/esm/pubsub-be011690.js +380 -0
- package/dist/esm/store-555131e7.js +197 -0
- package/dist/esm/transform-787c3a23.js +6806 -0
- package/dist/esm/values-5e76f985.js +914 -0
- package/dist/types/components/ls-3d-scene/ls-3d-scene.d.ts +20 -21
- package/dist/types/components/ls-data/ls-data.d.ts +22 -11
- package/dist/types/components/ls-indicator/ls-indicator.d.ts +10 -0
- package/dist/types/components/ls-recent-stops/ls-recent-stops.d.ts +40 -0
- package/dist/types/components/ls-swimlane/ls-swimlane.d.ts +63 -0
- package/dist/types/components.d.ts +30 -10
- package/dist/types/utils/translate.d.ts +10 -0
- package/package.json +5 -1
- package/dist/collection/utils/utils.js +0 -3
- package/dist/ednl-liftstatus-web-components/p-154beb99.js +0 -1
- package/dist/ednl-liftstatus-web-components/p-c2688258.entry.js +0 -3
- package/dist/types/components/ls-3d-scene/types.d.ts +0 -9
- package/dist/types/utils/utils.d.ts +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const pubsub = require('./pubsub-5a5af33e.js');
|
|
4
|
+
|
|
5
|
+
var dayjs_min = pubsub.createCommonjsModule(function (module, exports) {
|
|
6
|
+
!function(t,e){module.exports=e();}(pubsub.commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},D="en",v={};v[D]=M;var p=function(t){return t instanceof _},S=function(t,e,n){var r;if(!t)return D;if("string"==typeof t)v[t]&&(r=t),e&&(v[t]=e,r=t);else {var i=t.name;v[i]=t,r=i;}return !n&&r&&(D=r),r||!n&&D},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t);}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return O},m.isValid=function(){return !(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var D=this.$locale().weekStart||0,v=(y<D?y+7:y)-D;return $(r?m-v:m+(6-v),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].substr(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,D=O.m(this,M);return D=(l={},l[c]=D/12,l[f]=D,l[h]=D/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?D:O.a(D)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return v[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),b=_.prototype;return w.prototype=b,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){b[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=v[D],w.Ls=v,w.p={},w}));
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
exports.dayjs_min = dayjs_min;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-b5d10454.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-
|
|
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"]}]]],["ls-history.cjs",[[1,"ls-history"]]],["ls-recent-stops.cjs",[[4,"ls-recent-stops",{"chartLoading":[32]}]]],["ls-status-history.cjs",[[1,"ls-status-history"]]],["ls-swimlane.cjs",[[4,"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);
|
|
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.$
|
|
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
|
|
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
|
|
@@ -890,6 +1221,15 @@ const connectedCallback = (elm) => {
|
|
|
890
1221
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
891
1222
|
// first time this component has connected
|
|
892
1223
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1224
|
+
{
|
|
1225
|
+
// initUpdate
|
|
1226
|
+
// if the slot polyfill is required we'll need to put some nodes
|
|
1227
|
+
// in here to act as original content anchors as we move nodes around
|
|
1228
|
+
// host element has been connected to the DOM
|
|
1229
|
+
if ((cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */))) {
|
|
1230
|
+
setContentReference(elm);
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
893
1233
|
{
|
|
894
1234
|
// find the first ancestor component (if there is one) and register
|
|
895
1235
|
// this component as one of the actively loading child components for its ancestor
|
|
@@ -923,6 +1263,17 @@ const connectedCallback = (elm) => {
|
|
|
923
1263
|
endConnected();
|
|
924
1264
|
}
|
|
925
1265
|
};
|
|
1266
|
+
const setContentReference = (elm) => {
|
|
1267
|
+
// only required when we're NOT using native shadow dom (slot)
|
|
1268
|
+
// or this browser doesn't support native shadow dom
|
|
1269
|
+
// and this host element was NOT created with SSR
|
|
1270
|
+
// let's pick out the inner content for slot projection
|
|
1271
|
+
// create a node to represent where the original
|
|
1272
|
+
// content was first placed, which is useful later on
|
|
1273
|
+
const contentRefElm = (elm['s-cr'] = doc.createComment(''));
|
|
1274
|
+
contentRefElm['s-cn'] = true;
|
|
1275
|
+
elm.insertBefore(contentRefElm, elm.firstChild);
|
|
1276
|
+
};
|
|
926
1277
|
const disconnectedCallback = (elm) => {
|
|
927
1278
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
928
1279
|
const hostRef = getHostRef(elm);
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const values = require('./values-e1bf1cf4.js');
|
|
4
|
+
|
|
5
|
+
/** `Object#toString` result references. */
|
|
6
|
+
var mapTag = '[object Map]',
|
|
7
|
+
setTag = '[object Set]';
|
|
8
|
+
|
|
9
|
+
/** Used for built-in method references. */
|
|
10
|
+
var objectProto = Object.prototype;
|
|
11
|
+
|
|
12
|
+
/** Used to check objects for own properties. */
|
|
13
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Checks if `value` is an empty object, collection, map, or set.
|
|
17
|
+
*
|
|
18
|
+
* Objects are considered empty if they have no own enumerable string keyed
|
|
19
|
+
* properties.
|
|
20
|
+
*
|
|
21
|
+
* Array-like values such as `arguments` objects, arrays, buffers, strings, or
|
|
22
|
+
* jQuery-like collections are considered empty if they have a `length` of `0`.
|
|
23
|
+
* Similarly, maps and sets are considered empty if they have a `size` of `0`.
|
|
24
|
+
*
|
|
25
|
+
* @static
|
|
26
|
+
* @memberOf _
|
|
27
|
+
* @since 0.1.0
|
|
28
|
+
* @category Lang
|
|
29
|
+
* @param {*} value The value to check.
|
|
30
|
+
* @returns {boolean} Returns `true` if `value` is empty, else `false`.
|
|
31
|
+
* @example
|
|
32
|
+
*
|
|
33
|
+
* _.isEmpty(null);
|
|
34
|
+
* // => true
|
|
35
|
+
*
|
|
36
|
+
* _.isEmpty(true);
|
|
37
|
+
* // => true
|
|
38
|
+
*
|
|
39
|
+
* _.isEmpty(1);
|
|
40
|
+
* // => true
|
|
41
|
+
*
|
|
42
|
+
* _.isEmpty([1, 2, 3]);
|
|
43
|
+
* // => false
|
|
44
|
+
*
|
|
45
|
+
* _.isEmpty({ 'a': 1 });
|
|
46
|
+
* // => false
|
|
47
|
+
*/
|
|
48
|
+
function isEmpty(value) {
|
|
49
|
+
if (value == null) {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
if (values.isArrayLike(value) &&
|
|
53
|
+
(values.isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
|
|
54
|
+
values.isBuffer(value) || values.isTypedArray(value) || values.isArguments(value))) {
|
|
55
|
+
return !value.length;
|
|
56
|
+
}
|
|
57
|
+
var tag = values.getTag(value);
|
|
58
|
+
if (tag == mapTag || tag == setTag) {
|
|
59
|
+
return !value.size;
|
|
60
|
+
}
|
|
61
|
+
if (values.isPrototype(value)) {
|
|
62
|
+
return !values.baseKeys(value).length;
|
|
63
|
+
}
|
|
64
|
+
for (var key in value) {
|
|
65
|
+
if (hasOwnProperty.call(value, key)) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
exports.isEmpty = isEmpty;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-b5d10454.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-
|
|
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"]}]]],["ls-history.cjs",[[1,"ls-history"]]],["ls-recent-stops.cjs",[[4,"ls-recent-stops",{"chartLoading":[32]}]]],["ls-status-history.cjs",[[1,"ls-status-history"]]],["ls-swimlane.cjs",[[4,"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
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|