proto-float-wc 0.1.97 → 0.1.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-B83L5Khw.js → index-DlnQH7Cs.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/proto-float-wc.cjs.js +2 -2
- package/dist/cjs/proto-floater-demo.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/esm/{index-CeIUpiSD.js → index-_quGrlXg.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/proto-float-wc.js +3 -3
- package/dist/esm/proto-floater-demo.entry.js +1 -1
- package/dist/proto-float-wc/{p-1d099620.entry.js → p-01a561ca.entry.js} +1 -1
- package/dist/proto-float-wc/proto-float-wc.esm.js +1 -1
- package/package.json +2 -2
- /package/dist/proto-float-wc/{p-CeIUpiSD.js → p-_quGrlXg.js} +0 -0
|
@@ -4,7 +4,7 @@ const NAMESPACE = 'proto-float-wc';
|
|
|
4
4
|
const BUILD = /* proto-float-wc */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: false, state: true, updatable: true};
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
|
-
Stencil Client Platform v4.43.
|
|
7
|
+
Stencil Client Platform v4.43.3 | MIT Licensed | https://stenciljs.com
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-DlnQH7Cs.js');
|
|
4
4
|
var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
5
5
|
|
|
6
6
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Browser v4.43.
|
|
8
|
+
Stencil Client Patch Browser v4.43.3 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
var patchBrowser = () => {
|
|
@@ -2,7 +2,7 @@ const NAMESPACE = 'proto-float-wc';
|
|
|
2
2
|
const BUILD = /* proto-float-wc */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: false, state: true, updatable: true};
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
Stencil Client Platform v4.43.
|
|
5
|
+
Stencil Client Platform v4.43.3 | MIT Licensed | https://stenciljs.com
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { b as bootstrapLazy } from './index-_quGrlXg.js';
|
|
2
|
+
export { s as setNonce } from './index-_quGrlXg.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-DQuL1Twl.js';
|
|
4
4
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-_quGrlXg.js';
|
|
2
|
+
export { s as setNonce } from './index-_quGrlXg.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-DQuL1Twl.js';
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
Stencil Client Patch Browser v4.43.
|
|
6
|
+
Stencil Client Patch Browser v4.43.3 | MIT Licensed | https://stenciljs.com
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
var patchBrowser = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as e}from"./p-CeIUpiSD.js";const n=Math.min,i=Math.max,o=Math.round,r=t=>({x:t,y:t}),s={left:"right",right:"left",bottom:"top",top:"bottom"};function a(t,e,o){return i(t,n(e,o))}function l(t,e){return"function"==typeof t?t(e):t}function c(t){return t.split("-")[0]}function f(t){return t.split("-")[1]}function u(t){return"x"===t?"y":"x"}function d(t){return"y"===t?"height":"width"}function h(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function p(t){return u(h(t))}function m(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const y=["left","right"],g=["right","left"],x=["top","bottom"],w=["bottom","top"];function b(t){const e=c(t);return s[e]+t.slice(e.length)}function v(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function k(t){const{x:e,y:n,width:i,height:o}=t;return{width:i,height:o,top:n,left:e,right:e+i,bottom:n+o,x:e,y:n}}function A(t,e,n){let{reference:i,floating:o}=t;const r=h(e),s=p(e),a=d(s),l=c(e),u="y"===r,m=i.x+i.width/2-o.width/2,y=i.y+i.height/2-o.height/2,g=i[a]/2-o[a]/2;let x;switch(l){case"top":x={x:m,y:i.y-o.height};break;case"bottom":x={x:m,y:i.y+i.height};break;case"right":x={x:i.x+i.width,y};break;case"left":x={x:i.x-o.width,y};break;default:x={x:i.x,y:i.y}}switch(f(e)){case"start":x[s]-=g*(n&&u?-1:1);break;case"end":x[s]+=g*(n&&u?-1:1)}return x}async function S(t,e){var n;void 0===e&&(e={});const{x:i,y:o,platform:r,rects:s,elements:a,strategy:c}=t,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=l(e,t),m=v(p),y=a[h?"floating"===d?"reference":"floating":d],g=k(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(y)))||n?y:y.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:f,rootBoundary:u,strategy:c})),x="floating"===d?{x:i,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),b=await(null==r.isElement?void 0:r.isElement(w))&&await(null==r.getScale?void 0:r.getScale(w))||{x:1,y:1},A=k(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:w,strategy:c}):x);return{top:(g.top-A.top+m.top)/b.y,bottom:(A.bottom-g.bottom+m.bottom)/b.y,left:(g.left-A.left+m.left)/b.x,right:(A.right-g.right+m.right)/b.x}}const C=new Set(["left","top"]);function D(){return"undefined"!=typeof window}function R(t){return $(t)?(t.nodeName||"").toLowerCase():"#document"}function F(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function L(t){var e;return null==(e=($(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function $(t){return!!D()&&(t instanceof Node||t instanceof F(t).Node)}function O(t){return!!D()&&(t instanceof Element||t instanceof F(t).Element)}function P(t){return!!D()&&(t instanceof HTMLElement||t instanceof F(t).HTMLElement)}function T(t){return!(!D()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof F(t).ShadowRoot)}function E(t){const{overflow:e,overflowX:n,overflowY:i,display:o}=U(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&"inline"!==o&&"contents"!==o}function M(t){return/^(table|td|th)$/.test(R(t))}function j(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const B=/transform|translate|scale|rotate|perspective|filter/,_=/paint|layout|strict|content/,z=t=>!!t&&"none"!==t;let H;function I(t){const e=O(t)?U(t):t;return z(e.transform)||z(e.translate)||z(e.scale)||z(e.rotate)||z(e.perspective)||!N()&&(z(e.backdropFilter)||z(e.filter))||B.test(e.willChange||"")||_.test(e.contain||"")}function N(){return null==H&&(H="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),H}function q(t){return/^(html|body|#document)$/.test(R(t))}function U(t){return F(t).getComputedStyle(t)}function V(t){return O(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function W(t){if("html"===R(t))return t;const e=t.assignedSlot||t.parentNode||T(t)&&t.host||L(t);return T(e)?e.host:e}function X(t){const e=W(t);return q(e)?t.ownerDocument?t.ownerDocument.body:t.body:P(e)&&E(e)?e:X(e)}function Y(t,e){var n;void 0===e&&(e=[]);const i=X(t),o=i===(null==(n=t.ownerDocument)?void 0:n.body),r=F(i);return o?e.concat(r,r.visualViewport||[],E(i)?i:[],[]):e.concat(i,Y(i,[]))}function G(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function J(t){const e=U(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=P(t),s=r?t.offsetWidth:n,a=r?t.offsetHeight:i,l=o(n)!==s||o(i)!==a;return l&&(n=s,i=a),{width:n,height:i,$:l}}function K(t){return O(t)?t:t.contextElement}function Q(t){const e=K(t);if(!P(e))return r(1);const n=e.getBoundingClientRect(),{width:i,height:s,$:a}=J(e);let l=(a?o(n.width):n.width)/i,c=(a?o(n.height):n.height)/s;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const Z=r(0);function tt(t){const e=F(t);return N()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Z}function et(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n=!1);const o=t.getBoundingClientRect(),s=K(t);let a=r(1);e&&(i?O(i)&&(a=Q(i)):a=Q(t));const l=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==F(t))&&e}(s,n,i)?tt(s):r(0);let c=(o.left+l.x)/a.x,f=(o.top+l.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(s){const t=F(s),e=i&&O(i)?F(i):i;let n=t,o=G(n);for(;o&&i&&e!==n;){const t=Q(o),e=o.getBoundingClientRect(),i=U(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,s=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;c*=t.x,f*=t.y,u*=t.x,d*=t.y,c+=r,f+=s,n=F(o),o=G(n)}}return k({width:u,height:d,x:c,y:f})}function nt(t,e){const n=V(t).scrollLeft;return e?e.left+n:et(L(t)).left+n}function it(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-nt(t,n),y:n.top+e.scrollTop}}function ot(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=F(t),i=L(t),o=n.visualViewport;let r=i.clientWidth,s=i.clientHeight,a=0,l=0;if(o){r=o.width,s=o.height;const t=N();(!t||t&&"fixed"===e)&&(a=o.offsetLeft,l=o.offsetTop)}const c=nt(i);if(c<=0){const t=i.ownerDocument,e=t.body,n=getComputedStyle(e),o="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(i.clientWidth-e.clientWidth-o);s<=25&&(r-=s)}else c<=25&&(r+=c);return{width:r,height:s,x:a,y:l}}(t,n);else if("document"===e)o=function(t){const e=L(t),n=V(t),o=t.ownerDocument.body,r=i(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),s=i(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+nt(t);const l=-n.scrollTop;return"rtl"===U(o).direction&&(a+=i(e.clientWidth,o.clientWidth)-r),{width:r,height:s,x:a,y:l}}(L(t));else if(O(e))o=function(t,e){const n=et(t,!0,"fixed"===e),i=n.top+t.clientTop,o=n.left+t.clientLeft,s=P(t)?Q(t):r(1);return{width:t.clientWidth*s.x,height:t.clientHeight*s.y,x:o*s.x,y:i*s.y}}(e,n);else{const n=tt(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return k(o)}function rt(t,e){const n=W(t);return!(n===e||!O(n)||q(n))&&("fixed"===U(n).position||rt(n,e))}function st(t,e,n){const i=P(e),o=L(e),s="fixed"===n,a=et(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const c=r(0);function f(){c.x=nt(o)}if(i||!i&&!s)if(("body"!==R(e)||E(o))&&(l=V(e)),i){const t=et(e,!0,s,e);c.x=t.x+e.clientLeft,c.y=t.y+e.clientTop}else o&&f();s&&!i&&o&&f();const u=!o||i||s?r(0):it(o,l);return{x:a.left+l.scrollLeft-c.x-u.x,y:a.top+l.scrollTop-c.y-u.y,width:a.width,height:a.height}}function at(t){return"static"===U(t).position}function lt(t,e){if(!P(t)||"fixed"===U(t).position)return null;if(e)return e(t);let n=t.offsetParent;return L(t)===n&&(n=n.ownerDocument.body),n}function ct(t,e){const n=F(t);if(j(t))return n;if(!P(t)){let e=W(t);for(;e&&!q(e);){if(O(e)&&!at(e))return e;e=W(e)}return n}let i=lt(t,e);for(;i&&M(i)&&at(i);)i=lt(i,e);return i&&q(i)&&at(i)&&!I(i)?n:i||function(t){let e=W(t);for(;P(e)&&!q(e);){if(I(e))return e;if(j(e))return null;e=W(e)}return null}(t)||n}const ft={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t;const s="fixed"===o,a=L(i),l=!!e&&j(e.floating);if(i===a||l&&s)return n;let c={scrollLeft:0,scrollTop:0},f=r(1);const u=r(0),d=P(i);if((d||!d&&!s)&&(("body"!==R(i)||E(a))&&(c=V(i)),d)){const t=et(i);f=Q(i),u.x=t.x+i.clientLeft,u.y=t.y+i.clientTop}const h=!a||d||s?r(0):it(a,c);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+u.x+h.x,y:n.y*f.y-c.scrollTop*f.y+u.y+h.y}},getDocumentElement:L,getClippingRect:function(t){let{element:e,boundary:o,rootBoundary:r,strategy:s}=t;const a=[..."clippingAncestors"===o?j(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let i=Y(t,[]).filter((t=>O(t)&&"body"!==R(t))),o=null;const r="fixed"===U(t).position;let s=r?W(t):t;for(;O(s)&&!q(s);){const e=U(s),n=I(s);n||"fixed"!==e.position||(o=null),(r?!n&&!o:!n&&"static"===e.position&&o&&("absolute"===o.position||"fixed"===o.position)||E(s)&&!n&&rt(t,s))?i=i.filter((t=>t!==s)):o=e,s=W(s)}return e.set(t,i),i}(e,this._c):[].concat(o),r],l=ot(e,a[0],s);let c=l.top,f=l.right,u=l.bottom,d=l.left;for(let t=1;t<a.length;t++){const o=ot(e,a[t],s);c=i(o.top,c),f=n(o.right,f),u=n(o.bottom,u),d=i(o.left,d)}return{width:f-d,height:u-c,x:d,y:c}},getOffsetParent:ct,getElementRects:async function(t){const e=this.getOffsetParent||ct,n=this.getDimensions,i=await n(t.floating);return{reference:st(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=J(t);return{width:e,height:n}},getScale:Q,isElement:O,isRTL:function(t){return"rtl"===U(t).direction}},ut=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:o,platform:r}=e,{mainAxis:s=!0,crossAxis:f=!1,limiter:d={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...p}=l(t,e),m={x:n,y:i},y=await r.detectOverflow(e,p),g=h(c(o)),x=u(g);let w=m[x],b=m[g];s&&(w=a(w+y["y"===x?"top":"left"],w,w-y["y"===x?"bottom":"right"])),f&&(b=a(b+y["y"===g?"top":"left"],b,b-y["y"===g?"bottom":"right"]));const v=d.fn({...e,[x]:w,[g]:b});return{...v,data:{x:v.x-n,y:v.y-i,enabled:{[x]:s,[g]:f}}}}}},dt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:o,middlewareData:r,rects:s,initialPlacement:a,platform:u,elements:v}=e,{mainAxis:k=!0,crossAxis:A=!0,fallbackPlacements:S,fallbackStrategy:C="bestFit",fallbackAxisSideDirection:D="none",flipAlignment:R=!0,...F}=l(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const L=c(o),$=h(a),O=c(a)===a,P=await(null==u.isRTL?void 0:u.isRTL(v.floating)),T=S||(O||!R?[b(a)]:function(t){const e=b(t);return[m(t),e,m(e)]}(a)),E="none"!==D;!S&&E&&T.push(...function(t,e,n,i){const o=f(t);let r=function(t,e,n){switch(t){case"top":case"bottom":return n?e?g:y:e?y:g;case"left":case"right":return e?x:w;default:return[]}}(c(t),"start"===n,i);return o&&(r=r.map((t=>t+"-"+o)),e&&(r=r.concat(r.map(m)))),r}(a,R,D,P));const M=[a,...T],j=await u.detectOverflow(e,F),B=[];let _=(null==(i=r.flip)?void 0:i.overflows)||[];if(k&&B.push(j[L]),A){const t=function(t,e,n){void 0===n&&(n=!1);const i=f(t),o=p(t),r=d(o);let s="x"===o?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=b(s)),[s,b(s)]}(o,s,P);B.push(j[t[0]],j[t[1]])}if(_=[..._,{placement:o,overflows:B}],!B.every((t=>t<=0))){var z,H;const t=((null==(z=r.flip)?void 0:z.index)||0)+1,e=M[t];if(e&&("alignment"!==A||$===h(e)||_.every((t=>h(t.placement)!==$||t.overflows[0]>0))))return{data:{index:t,overflows:_},reset:{placement:e}};let n=null==(H=_.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:H.placement;if(!n)switch(C){case"bestFit":{var I;const t=null==(I=_.filter((t=>{if(E){const e=h(t.placement);return e===$||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:I[0];t&&(n=t);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},ht=t=>({name:"arrow",options:t,async fn(e){const{x:i,y:o,placement:r,rects:s,platform:c,elements:u,middlewareData:h}=e,{element:m,padding:y=0}=l(t,e)||{};if(null==m)return{};const g=v(y),x={x:i,y:o},w=p(r),b=d(w),k=await c.getDimensions(m),A="y"===w,S=A?"top":"left",C=A?"bottom":"right",D=A?"clientHeight":"clientWidth",R=s.reference[b]+s.reference[w]-x[w]-s.floating[b],F=x[w]-s.reference[w],L=await(null==c.getOffsetParent?void 0:c.getOffsetParent(m));let $=L?L[D]:0;$&&await(null==c.isElement?void 0:c.isElement(L))||($=u.floating[D]||s.floating[b]);const O=R/2-F/2,P=$/2-k[b]/2-1,T=n(g[S],P),E=n(g[C],P),M=T,j=$-k[b]-E,B=$/2-k[b]/2+O,_=a(M,B,j),z=!h.arrow&&null!=f(r)&&B!==_&&s.reference[b]/2-(B<M?T:E)-k[b]/2<0,H=z?B<M?B-M:B-j:0;return{[w]:x[w]+H,data:{[w]:_,centerOffset:B-_-H,...z&&{alignmentOffset:H}},reset:z}}}),pt="Checking...",mt=class{constructor(e){t(this,e),this.vin=void 0,this.snapshot=void 0,this.label=pt,this.failed=!0,this.loaded=!1,this.time=void 0,this.eventBus=window.eventBus,this.message=void 0,this.nanoId=((t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[t]];return e})(),this.messageHandler=t=>{const{origin:e,data:n}=t,{targetId:i}=n;if(console.log("-- messageHandler:",n,e),"http://localhost:3000"===e&&i===this.nanoId)if(void 0===this.message){if(n.type&&"resize-iframe"===n.type){this.iframe.style.width=n.payload.width+"px",this.iframe.style.height=n.payload.height+"px",this.iframe.style.display="block",this.loaded=!0,this.label="",this.message=n;const{vin:t,snapshot:e}=this;this.iframe&&this.iframe.contentWindow.postMessage({targetId:this.nanoId,type:"data-payload",payload:{vin:t,snapshot:e}},"*"),this.update()}}else this.hideTooltip()},this.register=()=>{this.eventBus.emit("activate",this.nanoId),window.addEventListener("message",this.messageHandler,!1)},this.unregister=()=>{window.removeEventListener("message",this.messageHandler)},this.update=()=>{const{target:t,tooltip:e,arrowEl:n}=this;var i;((t,e,n)=>{const i=new Map,o={platform:ft,...n},r={...o.platform,_c:i};return(async(t,e,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:r=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:S},l=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:f,y:u}=A(c,i,l),d=i,h=0;const p={};for(let n=0;n<r.length;n++){const m=r[n];if(!m)continue;const{name:y,fn:g}=m,{x,y:w,data:b,reset:v}=await g({x:f,y:u,initialPlacement:i,placement:d,strategy:o,middlewareData:p,rects:c,platform:a,elements:{reference:t,floating:e}});f=null!=x?x:f,u=null!=w?w:u,p[y]={...p[y],...b},v&&h<50&&(h++,"object"==typeof v&&(v.placement&&(d=v.placement),v.rects&&(c=!0===v.rects?await s.getElementRects({reference:t,floating:e,strategy:o}):v.rects),({x:f,y:u}=A(c,d,l))),n=-1)}return{x:f,y:u,placement:d,strategy:o,middlewareData:p}})(t,e,{...o,platform:r})})(t,e,{placement:"right",middleware:[(i=6,void 0===i&&(i=0),{name:"offset",options:i,async fn(t){var e,n;const{x:o,y:r,placement:s,middlewareData:a}=t,u=await async function(t,e){const{placement:n,platform:i,elements:o}=t,r=await(null==i.isRTL?void 0:i.isRTL(o.floating)),s=c(n),a=f(n),u="y"===h(n),d=C.has(s)?-1:1,p=r&&u?-1:1,m=l(e,t);let{mainAxis:y,crossAxis:g,alignmentAxis:x}="number"==typeof m?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return a&&"number"==typeof x&&(g="end"===a?-1*x:x),u?{x:g*p,y:y*d}:{x:y*d,y:g*p}}(t,i);return s===(null==(e=a.offset)?void 0:e.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:o+u.x,y:r+u.y,data:{...u,placement:s}}}}),dt(),ut({padding:5}),ht({element:n})]}).then((({x:t,y:i,placement:o,middlewareData:r})=>{Object.assign(e.style,{left:`${t}px`,top:`${i}px`});const{x:s,y:a}=r.arrow,l={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]];Object.assign(n.style,{left:null!=s?`${s}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",[l]:"-4px"})}))},this.onIframeLoad=()=>{this.update(),setTimeout((()=>{this.loaded||(this.label="Content Failed to Load...")}),3e3)},this.hideTooltip=()=>{this.iframe.style.display="",this.tooltip.style.display="",this.message=void 0,this.unregister()},this.showTooltip=()=>{this.register(),this.loaded=!1,this.label=pt,this.loaded=!1,this.time=Date.now(),this.tooltip.style.display="block",this.update()},this.clickHandler=()=>{"block"===this.tooltip.style.display?this.hideTooltip():this.showTooltip()}}componentDidLoad(){this.eventBus.on("activate",(t=>{this.nanoId!==t&&(void 0!==this.message||"block"===this.tooltip.style.display)&&this.hideTooltip()})),this.update()}render(){const t=`http://localhost:3000/demo_iframe.html?q=${this.time}&nid=${this.nanoId}`;return e("div",{key:"1da684903d9253b204641b4184bc5e1f79326405",id:"root"},e("div",{key:"84665f15de5991870ad2a16f42f1984789f4631f",id:"target",ref:t=>this.target=t,onClick:()=>this.clickHandler()},"i"),e("div",{key:"178c42dc946b455c8873e06d481a93d095a2e752",id:"tooltip",role:"tooltip",ref:t=>this.tooltip=t},e("div",{key:"75921e81ce12a64df3500d1492b6d782ff2881e3"},this.label),this.time?e("iframe",{id:"content",src:t,ref:t=>this.iframe=t,onLoad:t=>this.onIframeLoad(t)}):"",e("div",{key:"99722c505d254559b6a89a3d173c0925b12e53be",id:"arrow",ref:t=>this.arrowEl=t})))}};mt.style="#root{--clrs-navy:#001f3f;--clrs-blue:#0074d9;--clrs-aqua:#7fdbff;--clrs-teal:#39cccc;--clrs-olive:#3d9970;--clrs-green:#2ecc40;--clrs-lime:#01ff70;--clrs-yellow:#ffdc00;--clrs-orange:#ff851b;--clrs-red:#ff4136;--clrs-maroon:#85144b;--clrs-fuchsia:#f012be;--clrs-purple:#b10dc9;--clrs-black:#111111;--clrs-gray:#aaaaaa;--clrs-silver:#dddddd;--clrs-bada55:#bada55;--clrs-slate:#708090;--clrs-slate4:#4e5964;--clrs-white:#ffffff}#target{width:24px;height:24px;line-height:24px;text-align:center;border-radius:12px;background:var(--clrs-blue);font-weight:bold;font-size:120%;color:var(--clrs-white);cursor:pointer}#tooltip{display:none;position:absolute;min-height:18px;background:var(--clrs-navy);color:var(--clrs-white);font-weight:bold;padding:5px;padding-right:10px;padding-left:10px;border-radius:4px;font-size:90%;pointer-events:none}#arrow{position:absolute;background:var(--clrs-navy);width:8px;height:8px;transform:rotate(45deg)}#content{display:none;border:none}";export{mt as proto_floater_demo}
|
|
1
|
+
import{r as t,h as e}from"./p-_quGrlXg.js";const n=Math.min,i=Math.max,o=Math.round,r=t=>({x:t,y:t}),s={left:"right",right:"left",bottom:"top",top:"bottom"};function a(t,e,o){return i(t,n(e,o))}function l(t,e){return"function"==typeof t?t(e):t}function c(t){return t.split("-")[0]}function f(t){return t.split("-")[1]}function u(t){return"x"===t?"y":"x"}function d(t){return"y"===t?"height":"width"}function h(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function p(t){return u(h(t))}function m(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const y=["left","right"],g=["right","left"],x=["top","bottom"],w=["bottom","top"];function b(t){const e=c(t);return s[e]+t.slice(e.length)}function v(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function k(t){const{x:e,y:n,width:i,height:o}=t;return{width:i,height:o,top:n,left:e,right:e+i,bottom:n+o,x:e,y:n}}function A(t,e,n){let{reference:i,floating:o}=t;const r=h(e),s=p(e),a=d(s),l=c(e),u="y"===r,m=i.x+i.width/2-o.width/2,y=i.y+i.height/2-o.height/2,g=i[a]/2-o[a]/2;let x;switch(l){case"top":x={x:m,y:i.y-o.height};break;case"bottom":x={x:m,y:i.y+i.height};break;case"right":x={x:i.x+i.width,y};break;case"left":x={x:i.x-o.width,y};break;default:x={x:i.x,y:i.y}}switch(f(e)){case"start":x[s]-=g*(n&&u?-1:1);break;case"end":x[s]+=g*(n&&u?-1:1)}return x}async function S(t,e){var n;void 0===e&&(e={});const{x:i,y:o,platform:r,rects:s,elements:a,strategy:c}=t,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=l(e,t),m=v(p),y=a[h?"floating"===d?"reference":"floating":d],g=k(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(y)))||n?y:y.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:f,rootBoundary:u,strategy:c})),x="floating"===d?{x:i,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),b=await(null==r.isElement?void 0:r.isElement(w))&&await(null==r.getScale?void 0:r.getScale(w))||{x:1,y:1},A=k(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:w,strategy:c}):x);return{top:(g.top-A.top+m.top)/b.y,bottom:(A.bottom-g.bottom+m.bottom)/b.y,left:(g.left-A.left+m.left)/b.x,right:(A.right-g.right+m.right)/b.x}}const C=new Set(["left","top"]);function D(){return"undefined"!=typeof window}function R(t){return $(t)?(t.nodeName||"").toLowerCase():"#document"}function F(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function L(t){var e;return null==(e=($(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function $(t){return!!D()&&(t instanceof Node||t instanceof F(t).Node)}function O(t){return!!D()&&(t instanceof Element||t instanceof F(t).Element)}function P(t){return!!D()&&(t instanceof HTMLElement||t instanceof F(t).HTMLElement)}function T(t){return!(!D()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof F(t).ShadowRoot)}function E(t){const{overflow:e,overflowX:n,overflowY:i,display:o}=X(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&"inline"!==o&&"contents"!==o}function M(t){return/^(table|td|th)$/.test(R(t))}function j(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const _=/transform|translate|scale|rotate|perspective|filter/,B=/paint|layout|strict|content/,q=t=>!!t&&"none"!==t;let z;function H(t){const e=O(t)?X(t):t;return q(e.transform)||q(e.translate)||q(e.scale)||q(e.rotate)||q(e.perspective)||!N()&&(q(e.backdropFilter)||q(e.filter))||_.test(e.willChange||"")||B.test(e.contain||"")}function N(){return null==z&&(z="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),z}function I(t){return/^(html|body|#document)$/.test(R(t))}function X(t){return F(t).getComputedStyle(t)}function G(t){return O(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function U(t){if("html"===R(t))return t;const e=t.assignedSlot||t.parentNode||T(t)&&t.host||L(t);return T(e)?e.host:e}function V(t){const e=U(t);return I(e)?t.ownerDocument?t.ownerDocument.body:t.body:P(e)&&E(e)?e:V(e)}function W(t,e){var n;void 0===e&&(e=[]);const i=V(t),o=i===(null==(n=t.ownerDocument)?void 0:n.body),r=F(i);return o?e.concat(r,r.visualViewport||[],E(i)?i:[],[]):e.concat(i,W(i,[]))}function Y(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function J(t){const e=X(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=P(t),s=r?t.offsetWidth:n,a=r?t.offsetHeight:i,l=o(n)!==s||o(i)!==a;return l&&(n=s,i=a),{width:n,height:i,$:l}}function K(t){return O(t)?t:t.contextElement}function Q(t){const e=K(t);if(!P(e))return r(1);const n=e.getBoundingClientRect(),{width:i,height:s,$:a}=J(e);let l=(a?o(n.width):n.width)/i,c=(a?o(n.height):n.height)/s;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const Z=r(0);function tt(t){const e=F(t);return N()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Z}function et(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n=!1);const o=t.getBoundingClientRect(),s=K(t);let a=r(1);e&&(i?O(i)&&(a=Q(i)):a=Q(t));const l=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==F(t))&&e}(s,n,i)?tt(s):r(0);let c=(o.left+l.x)/a.x,f=(o.top+l.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(s){const t=F(s),e=i&&O(i)?F(i):i;let n=t,o=Y(n);for(;o&&i&&e!==n;){const t=Q(o),e=o.getBoundingClientRect(),i=X(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,s=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;c*=t.x,f*=t.y,u*=t.x,d*=t.y,c+=r,f+=s,n=F(o),o=Y(n)}}return k({width:u,height:d,x:c,y:f})}function nt(t,e){const n=G(t).scrollLeft;return e?e.left+n:et(L(t)).left+n}function it(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-nt(t,n),y:n.top+e.scrollTop}}function ot(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=F(t),i=L(t),o=n.visualViewport;let r=i.clientWidth,s=i.clientHeight,a=0,l=0;if(o){r=o.width,s=o.height;const t=N();(!t||t&&"fixed"===e)&&(a=o.offsetLeft,l=o.offsetTop)}const c=nt(i);if(c<=0){const t=i.ownerDocument,e=t.body,n=getComputedStyle(e),o="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(i.clientWidth-e.clientWidth-o);s<=25&&(r-=s)}else c<=25&&(r+=c);return{width:r,height:s,x:a,y:l}}(t,n);else if("document"===e)o=function(t){const e=L(t),n=G(t),o=t.ownerDocument.body,r=i(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),s=i(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+nt(t);const l=-n.scrollTop;return"rtl"===X(o).direction&&(a+=i(e.clientWidth,o.clientWidth)-r),{width:r,height:s,x:a,y:l}}(L(t));else if(O(e))o=function(t,e){const n=et(t,!0,"fixed"===e),i=n.top+t.clientTop,o=n.left+t.clientLeft,s=P(t)?Q(t):r(1);return{width:t.clientWidth*s.x,height:t.clientHeight*s.y,x:o*s.x,y:i*s.y}}(e,n);else{const n=tt(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return k(o)}function rt(t,e){const n=U(t);return!(n===e||!O(n)||I(n))&&("fixed"===X(n).position||rt(n,e))}function st(t,e,n){const i=P(e),o=L(e),s="fixed"===n,a=et(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const c=r(0);function f(){c.x=nt(o)}if(i||!i&&!s)if(("body"!==R(e)||E(o))&&(l=G(e)),i){const t=et(e,!0,s,e);c.x=t.x+e.clientLeft,c.y=t.y+e.clientTop}else o&&f();s&&!i&&o&&f();const u=!o||i||s?r(0):it(o,l);return{x:a.left+l.scrollLeft-c.x-u.x,y:a.top+l.scrollTop-c.y-u.y,width:a.width,height:a.height}}function at(t){return"static"===X(t).position}function lt(t,e){if(!P(t)||"fixed"===X(t).position)return null;if(e)return e(t);let n=t.offsetParent;return L(t)===n&&(n=n.ownerDocument.body),n}function ct(t,e){const n=F(t);if(j(t))return n;if(!P(t)){let e=U(t);for(;e&&!I(e);){if(O(e)&&!at(e))return e;e=U(e)}return n}let i=lt(t,e);for(;i&&M(i)&&at(i);)i=lt(i,e);return i&&I(i)&&at(i)&&!H(i)?n:i||function(t){let e=U(t);for(;P(e)&&!I(e);){if(H(e))return e;if(j(e))return null;e=U(e)}return null}(t)||n}const ft={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t;const s="fixed"===o,a=L(i),l=!!e&&j(e.floating);if(i===a||l&&s)return n;let c={scrollLeft:0,scrollTop:0},f=r(1);const u=r(0),d=P(i);if((d||!d&&!s)&&(("body"!==R(i)||E(a))&&(c=G(i)),d)){const t=et(i);f=Q(i),u.x=t.x+i.clientLeft,u.y=t.y+i.clientTop}const h=!a||d||s?r(0):it(a,c);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+u.x+h.x,y:n.y*f.y-c.scrollTop*f.y+u.y+h.y}},getDocumentElement:L,getClippingRect:function(t){let{element:e,boundary:o,rootBoundary:r,strategy:s}=t;const a=[..."clippingAncestors"===o?j(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let i=W(t,[]).filter((t=>O(t)&&"body"!==R(t))),o=null;const r="fixed"===X(t).position;let s=r?U(t):t;for(;O(s)&&!I(s);){const e=X(s),n=H(s);n||"fixed"!==e.position||(o=null),(r?!n&&!o:!n&&"static"===e.position&&o&&("absolute"===o.position||"fixed"===o.position)||E(s)&&!n&&rt(t,s))?i=i.filter((t=>t!==s)):o=e,s=U(s)}return e.set(t,i),i}(e,this._c):[].concat(o),r],l=ot(e,a[0],s);let c=l.top,f=l.right,u=l.bottom,d=l.left;for(let t=1;t<a.length;t++){const o=ot(e,a[t],s);c=i(o.top,c),f=n(o.right,f),u=n(o.bottom,u),d=i(o.left,d)}return{width:f-d,height:u-c,x:d,y:c}},getOffsetParent:ct,getElementRects:async function(t){const e=this.getOffsetParent||ct,n=this.getDimensions,i=await n(t.floating);return{reference:st(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=J(t);return{width:e,height:n}},getScale:Q,isElement:O,isRTL:function(t){return"rtl"===X(t).direction}},ut=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:o,platform:r}=e,{mainAxis:s=!0,crossAxis:f=!1,limiter:d={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...p}=l(t,e),m={x:n,y:i},y=await r.detectOverflow(e,p),g=h(c(o)),x=u(g);let w=m[x],b=m[g];s&&(w=a(w+y["y"===x?"top":"left"],w,w-y["y"===x?"bottom":"right"])),f&&(b=a(b+y["y"===g?"top":"left"],b,b-y["y"===g?"bottom":"right"]));const v=d.fn({...e,[x]:w,[g]:b});return{...v,data:{x:v.x-n,y:v.y-i,enabled:{[x]:s,[g]:f}}}}}},dt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:o,middlewareData:r,rects:s,initialPlacement:a,platform:u,elements:v}=e,{mainAxis:k=!0,crossAxis:A=!0,fallbackPlacements:S,fallbackStrategy:C="bestFit",fallbackAxisSideDirection:D="none",flipAlignment:R=!0,...F}=l(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const L=c(o),$=h(a),O=c(a)===a,P=await(null==u.isRTL?void 0:u.isRTL(v.floating)),T=S||(O||!R?[b(a)]:function(t){const e=b(t);return[m(t),e,m(e)]}(a)),E="none"!==D;!S&&E&&T.push(...function(t,e,n,i){const o=f(t);let r=function(t,e,n){switch(t){case"top":case"bottom":return n?e?g:y:e?y:g;case"left":case"right":return e?x:w;default:return[]}}(c(t),"start"===n,i);return o&&(r=r.map((t=>t+"-"+o)),e&&(r=r.concat(r.map(m)))),r}(a,R,D,P));const M=[a,...T],j=await u.detectOverflow(e,F),_=[];let B=(null==(i=r.flip)?void 0:i.overflows)||[];if(k&&_.push(j[L]),A){const t=function(t,e,n){void 0===n&&(n=!1);const i=f(t),o=p(t),r=d(o);let s="x"===o?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=b(s)),[s,b(s)]}(o,s,P);_.push(j[t[0]],j[t[1]])}if(B=[...B,{placement:o,overflows:_}],!_.every((t=>t<=0))){var q,z;const t=((null==(q=r.flip)?void 0:q.index)||0)+1,e=M[t];if(e&&("alignment"!==A||$===h(e)||B.every((t=>h(t.placement)!==$||t.overflows[0]>0))))return{data:{index:t,overflows:B},reset:{placement:e}};let n=null==(z=B.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:z.placement;if(!n)switch(C){case"bestFit":{var H;const t=null==(H=B.filter((t=>{if(E){const e=h(t.placement);return e===$||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:H[0];t&&(n=t);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},ht=t=>({name:"arrow",options:t,async fn(e){const{x:i,y:o,placement:r,rects:s,platform:c,elements:u,middlewareData:h}=e,{element:m,padding:y=0}=l(t,e)||{};if(null==m)return{};const g=v(y),x={x:i,y:o},w=p(r),b=d(w),k=await c.getDimensions(m),A="y"===w,S=A?"top":"left",C=A?"bottom":"right",D=A?"clientHeight":"clientWidth",R=s.reference[b]+s.reference[w]-x[w]-s.floating[b],F=x[w]-s.reference[w],L=await(null==c.getOffsetParent?void 0:c.getOffsetParent(m));let $=L?L[D]:0;$&&await(null==c.isElement?void 0:c.isElement(L))||($=u.floating[D]||s.floating[b]);const O=R/2-F/2,P=$/2-k[b]/2-1,T=n(g[S],P),E=n(g[C],P),M=T,j=$-k[b]-E,_=$/2-k[b]/2+O,B=a(M,_,j),q=!h.arrow&&null!=f(r)&&_!==B&&s.reference[b]/2-(_<M?T:E)-k[b]/2<0,z=q?_<M?_-M:_-j:0;return{[w]:x[w]+z,data:{[w]:B,centerOffset:_-B-z,...q&&{alignmentOffset:z}},reset:q}}}),pt="Checking...",mt=class{constructor(e){t(this,e),this.vin=void 0,this.snapshot=void 0,this.label=pt,this.failed=!0,this.loaded=!1,this.time=void 0,this.eventBus=window.eventBus,this.message=void 0,this.nanoId=((t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[t]];return e})(),this.messageHandler=t=>{const{origin:e,data:n}=t,{targetId:i}=n;if(console.log("-- messageHandler:",n,e),"http://localhost:3000"===e&&i===this.nanoId)if(void 0===this.message){if(n.type&&"resize-iframe"===n.type){this.iframe.style.width=n.payload.width+"px",this.iframe.style.height=n.payload.height+"px",this.iframe.style.display="block",this.loaded=!0,this.label="",this.message=n;const{vin:t,snapshot:e}=this;this.iframe&&this.iframe.contentWindow.postMessage({targetId:this.nanoId,type:"data-payload",payload:{vin:t,snapshot:e}},"*"),this.update()}}else this.hideTooltip()},this.register=()=>{this.eventBus.emit("activate",this.nanoId),window.addEventListener("message",this.messageHandler,!1)},this.unregister=()=>{window.removeEventListener("message",this.messageHandler)},this.update=()=>{const{target:t,tooltip:e,arrowEl:n}=this;var i;((t,e,n)=>{const i=new Map,o={platform:ft,...n},r={...o.platform,_c:i};return(async(t,e,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:r=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:S},l=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:f,y:u}=A(c,i,l),d=i,h=0;const p={};for(let n=0;n<r.length;n++){const m=r[n];if(!m)continue;const{name:y,fn:g}=m,{x,y:w,data:b,reset:v}=await g({x:f,y:u,initialPlacement:i,placement:d,strategy:o,middlewareData:p,rects:c,platform:a,elements:{reference:t,floating:e}});f=null!=x?x:f,u=null!=w?w:u,p[y]={...p[y],...b},v&&h<50&&(h++,"object"==typeof v&&(v.placement&&(d=v.placement),v.rects&&(c=!0===v.rects?await s.getElementRects({reference:t,floating:e,strategy:o}):v.rects),({x:f,y:u}=A(c,d,l))),n=-1)}return{x:f,y:u,placement:d,strategy:o,middlewareData:p}})(t,e,{...o,platform:r})})(t,e,{placement:"right",middleware:[(i=6,void 0===i&&(i=0),{name:"offset",options:i,async fn(t){var e,n;const{x:o,y:r,placement:s,middlewareData:a}=t,u=await async function(t,e){const{placement:n,platform:i,elements:o}=t,r=await(null==i.isRTL?void 0:i.isRTL(o.floating)),s=c(n),a=f(n),u="y"===h(n),d=C.has(s)?-1:1,p=r&&u?-1:1,m=l(e,t);let{mainAxis:y,crossAxis:g,alignmentAxis:x}="number"==typeof m?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return a&&"number"==typeof x&&(g="end"===a?-1*x:x),u?{x:g*p,y:y*d}:{x:y*d,y:g*p}}(t,i);return s===(null==(e=a.offset)?void 0:e.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:o+u.x,y:r+u.y,data:{...u,placement:s}}}}),dt(),ut({padding:5}),ht({element:n})]}).then((({x:t,y:i,placement:o,middlewareData:r})=>{Object.assign(e.style,{left:`${t}px`,top:`${i}px`});const{x:s,y:a}=r.arrow,l={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]];Object.assign(n.style,{left:null!=s?`${s}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",[l]:"-4px"})}))},this.onIframeLoad=()=>{this.update(),setTimeout((()=>{this.loaded||(this.label="Content Failed to Load...")}),3e3)},this.hideTooltip=()=>{this.iframe.style.display="",this.tooltip.style.display="",this.message=void 0,this.unregister()},this.showTooltip=()=>{this.register(),this.loaded=!1,this.label=pt,this.loaded=!1,this.time=Date.now(),this.tooltip.style.display="block",this.update()},this.clickHandler=()=>{"block"===this.tooltip.style.display?this.hideTooltip():this.showTooltip()}}componentDidLoad(){this.eventBus.on("activate",(t=>{this.nanoId!==t&&(void 0!==this.message||"block"===this.tooltip.style.display)&&this.hideTooltip()})),this.update()}render(){const t=`http://localhost:3000/demo_iframe.html?q=${this.time}&nid=${this.nanoId}`;return e("div",{key:"1da684903d9253b204641b4184bc5e1f79326405",id:"root"},e("div",{key:"84665f15de5991870ad2a16f42f1984789f4631f",id:"target",ref:t=>this.target=t,onClick:()=>this.clickHandler()},"i"),e("div",{key:"178c42dc946b455c8873e06d481a93d095a2e752",id:"tooltip",role:"tooltip",ref:t=>this.tooltip=t},e("div",{key:"75921e81ce12a64df3500d1492b6d782ff2881e3"},this.label),this.time?e("iframe",{id:"content",src:t,ref:t=>this.iframe=t,onLoad:t=>this.onIframeLoad(t)}):"",e("div",{key:"99722c505d254559b6a89a3d173c0925b12e53be",id:"arrow",ref:t=>this.arrowEl=t})))}};mt.style="#root{--clrs-navy:#001f3f;--clrs-blue:#0074d9;--clrs-aqua:#7fdbff;--clrs-teal:#39cccc;--clrs-olive:#3d9970;--clrs-green:#2ecc40;--clrs-lime:#01ff70;--clrs-yellow:#ffdc00;--clrs-orange:#ff851b;--clrs-red:#ff4136;--clrs-maroon:#85144b;--clrs-fuchsia:#f012be;--clrs-purple:#b10dc9;--clrs-black:#111111;--clrs-gray:#aaaaaa;--clrs-silver:#dddddd;--clrs-bada55:#bada55;--clrs-slate:#708090;--clrs-slate4:#4e5964;--clrs-white:#ffffff}#target{width:24px;height:24px;line-height:24px;text-align:center;border-radius:12px;background:var(--clrs-blue);font-weight:bold;font-size:120%;color:var(--clrs-white);cursor:pointer}#tooltip{display:none;position:absolute;min-height:18px;background:var(--clrs-navy);color:var(--clrs-white);font-weight:bold;padding:5px;padding-right:10px;padding-left:10px;border-radius:4px;font-size:90%;pointer-events:none}#arrow{position:absolute;background:var(--clrs-navy);width:8px;height:8px;transform:rotate(45deg)}#content{display:none;border:none}";export{mt as proto_floater_demo}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import{p as a,b as o}from"./p-_quGrlXg.js";export{s as setNonce}from"./p-_quGrlXg.js";import{g as r}from"./p-DQuL1Twl.js";(()=>{const o=import.meta.url,r={};return""!==o&&(r.resourcesUrl=new URL(".",o).href),a(r)})().then((async a=>(await r(),o([["p-01a561ca",[[1,"proto-floater-demo",{vin:[1],snapshot:[1],label:[32],failed:[32],loaded:[32],time:[32]}]]]],a))));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "proto-float-wc",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.98",
|
|
4
4
|
"description": "Stencil Component Starter",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@floating-ui/dom": "1.7.6",
|
|
19
|
-
"@stencil/core": "4.43.
|
|
19
|
+
"@stencil/core": "4.43.3",
|
|
20
20
|
"nanoid": "5.1.7"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
File without changes
|