@limetech/lime-elements 34.0.0-next.4 → 34.0.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/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-form.cjs.entry.js +1 -1
- package/dist/cjs/limel-picker.cjs.entry.js +0 -8
- package/dist/cjs/limel-portal.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/form/templates/field.js +1 -1
- package/dist/collection/components/picker/picker.js +0 -29
- package/dist/collection/components/portal/portal.css +1 -5
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-form.entry.js +1 -1
- package/dist/esm/limel-picker.entry.js +0 -8
- package/dist/esm/limel-portal.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p-33f3e1db.entry.js +16 -0
- package/dist/lime-elements/{p-f079f1fd.entry.js → p-6be31658.entry.js} +1 -1
- package/dist/lime-elements/{p-f2df64ec.entry.js → p-77afe6dd.entry.js} +1 -1
- package/dist/types/components/dialog/dialog.types.d.ts +0 -4
- package/dist/types/components/form/form.types.d.ts +0 -4
- package/dist/types/components/picker/picker.d.ts +0 -8
- package/dist/types/components.d.ts +0 -10
- package/package.json +1 -1
- package/dist/lime-elements/p-692f31f1.entry.js +0 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as n,g as e}from"./p-92146da6.js";var r="top",i="bottom",o="right",a="left",u=[r,i,o,a],f=u.reduce((function(t,n){return t.concat([n+"-start",n+"-end"])}),[]),s=[].concat(u,["auto"]).reduce((function(t,n){return t.concat([n,n+"-start",n+"-end"])}),[]),c=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function l(t){return t?(t.nodeName||"").toLowerCase():null}function p(t){if(null==t)return window;if("[object Window]"!==t.toString()){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function d(t){return t instanceof p(t).Element||t instanceof Element}function h(t){return t instanceof p(t).HTMLElement||t instanceof HTMLElement}function v(t){return"undefined"!=typeof ShadowRoot&&(t instanceof p(t).ShadowRoot||t instanceof ShadowRoot)}function b(t){return t.split("-")[0]}var m=Math.round;function y(t,n){void 0===n&&(n=!1);var e=t.getBoundingClientRect(),r=1,i=1;return h(t)&&n&&(r=e.width/t.offsetWidth||1,i=e.height/t.offsetHeight||1),{width:m(e.width/r),height:m(e.height/i),top:m(e.top/i),right:m(e.right/r),bottom:m(e.bottom/i),left:m(e.left/r),x:m(e.left/r),y:m(e.top/i)}}function w(t){var n=y(t),e=t.offsetWidth,r=t.offsetHeight;return Math.abs(n.width-e)<=1&&(e=n.width),Math.abs(n.height-r)<=1&&(r=n.height),{x:t.offsetLeft,y:t.offsetTop,width:e,height:r}}function g(t,n){var e=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(e&&v(e)){var r=n;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function O(t){return p(t).getComputedStyle(t)}function x(t){return["table","td","th"].indexOf(l(t))>=0}function j(t){return((d(t)?t.ownerDocument:t.document)||window.document).documentElement}function M(t){return"html"===l(t)?t:t.assignedSlot||t.parentNode||(v(t)?t.host:null)||j(t)}function k(t){return h(t)&&"fixed"!==O(t).position?t.offsetParent:null}function C(t){for(var n=p(t),e=k(t);e&&x(e)&&"static"===O(e).position;)e=k(e);return e&&("html"===l(e)||"body"===l(e)&&"static"===O(e).position)?n:e||function(t){var n=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&h(t)&&"fixed"===O(t).position)return null;for(var e=M(t);h(e)&&["html","body"].indexOf(l(e))<0;){var r=O(e);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||n&&"filter"===r.willChange||n&&r.filter&&"none"!==r.filter)return e;e=e.parentNode}return null}(t)||n}function P(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}var q=Math.max,E=Math.min,R=Math.round;function W(t,n,e){return q(t,E(n,e))}function B(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function S(t,n){return n.reduce((function(n,e){return n[e]=t,n}),{})}var L={top:"auto",right:"auto",bottom:"auto",left:"auto"};function A(t){var n,e=t.popper,u=t.popperRect,f=t.placement,s=t.offsets,c=t.position,l=t.gpuAcceleration,d=t.adaptive,h=t.roundOffsets,v=!0===h?function(t){var n=t.y,e=window.devicePixelRatio||1;return{x:R(R(t.x*e)/e)||0,y:R(R(n*e)/e)||0}}(s):"function"==typeof h?h(s):s,b=v.x,m=void 0===b?0:b,y=v.y,w=void 0===y?0:y,g=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),M=a,k=r,P=window;if(d){var q=C(e),E="clientHeight",W="clientWidth";q===p(e)&&"static"!==O(q=j(e)).position&&(E="scrollHeight",W="scrollWidth"),q=q,f===r&&(k=i,w-=q[E]-u.height,w*=l?1:-1),f===a&&(M=o,m-=q[W]-u.width,m*=l?1:-1)}var B,S=Object.assign({position:c},d&&L);return Object.assign({},S,l?((B={})[k]=x?"0":"",B[M]=g?"0":"",B.transform=(P.devicePixelRatio||1)<2?"translate("+m+"px, "+w+"px)":"translate3d("+m+"px, "+w+"px, 0)",B):((n={})[k]=x?w+"px":"",n[M]=g?m+"px":"",n.transform="",n))}var I={passive:!0},T={left:"right",right:"left",bottom:"top",top:"bottom"};function z(t){return t.replace(/left|right|bottom|top/g,(function(t){return T[t]}))}var H={start:"end",end:"start"};function V(t){return t.replace(/start|end/g,(function(t){return H[t]}))}function D(t){var n=p(t);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function F(t){return y(j(t)).left+D(t).scrollLeft}function $(t){var n=O(t);return/auto|scroll|overlay|hidden/.test(n.overflow+n.overflowY+n.overflowX)}function _(t){return["html","body","#document"].indexOf(l(t))>=0?t.ownerDocument.body:h(t)&&$(t)?t:_(M(t))}function U(t,n){var e;void 0===n&&(n=[]);var r=_(t),i=r===(null==(e=t.ownerDocument)?void 0:e.body),o=p(r),a=i?[o].concat(o.visualViewport||[],$(r)?r:[]):r,u=n.concat(a);return i?u:u.concat(U(M(a)))}function G(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function J(t,n){return"viewport"===n?G(function(t){var n=p(t),e=j(t),r=n.visualViewport,i=e.clientWidth,o=e.clientHeight,a=0,u=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,u=r.offsetTop)),{width:i,height:o,x:a+F(t),y:u}}(t)):h(n)?function(t){var n=y(t);return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}(n):G(function(t){var n,e=j(t),r=D(t),i=null==(n=t.ownerDocument)?void 0:n.body,o=q(e.scrollWidth,e.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=q(e.scrollHeight,e.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-r.scrollLeft+F(t),f=-r.scrollTop;return"rtl"===O(i||e).direction&&(u+=q(e.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:u,y:f}}(j(t)))}function K(t){return t.split("-")[1]}function N(t){var n,e=t.reference,u=t.element,f=t.placement,s=f?b(f):null,c=f?K(f):null,l=e.x+e.width/2-u.width/2,p=e.y+e.height/2-u.height/2;switch(s){case r:n={x:l,y:e.y-u.height};break;case i:n={x:l,y:e.y+e.height};break;case o:n={x:e.x+e.width,y:p};break;case a:n={x:e.x-u.width,y:p};break;default:n={x:e.x,y:e.y}}var d=s?P(s):null;if(null!=d){var h="y"===d?"height":"width";switch(c){case"start":n[d]=n[d]-(e[h]/2-u[h]/2);break;case"end":n[d]=n[d]+(e[h]/2-u[h]/2)}}return n}function Q(t,n){void 0===n&&(n={});var e=n.placement,a=void 0===e?t.placement:e,f=n.boundary,s=void 0===f?"clippingParents":f,c=n.rootBoundary,p=void 0===c?"viewport":c,v=n.elementContext,b=void 0===v?"popper":v,m=n.altBoundary,w=void 0!==m&&m,x=n.padding,k=void 0===x?0:x,P=B("number"!=typeof k?k:S(k,u)),R=t.elements.reference,W=t.rects.popper,L=t.elements[w?"popper"===b?"reference":"popper":b],A=function(t,n,e){var r="clippingParents"===n?function(t){var n=U(M(t)),e=["absolute","fixed"].indexOf(O(t).position)>=0&&h(t)?C(t):t;return d(e)?n.filter((function(t){return d(t)&&g(t,e)&&"body"!==l(t)})):[]}(t):[].concat(n),i=[].concat(r,[e]),o=i.reduce((function(n,e){var r=J(t,e);return n.top=q(r.top,n.top),n.right=E(r.right,n.right),n.bottom=E(r.bottom,n.bottom),n.left=q(r.left,n.left),n}),J(t,i[0]));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}(d(L)?L:L.contextElement||j(t.elements.popper),s,p),I=y(R),T=N({reference:I,element:W,strategy:"absolute",placement:a}),z=G(Object.assign({},W,T)),H="popper"===b?z:I,V={top:A.top-H.top+P.top,bottom:H.bottom-A.bottom+P.bottom,left:A.left-H.left+P.left,right:H.right-A.right+P.right},D=t.modifiersData.offset;if("popper"===b&&D){var F=D[a];Object.keys(V).forEach((function(t){var n=[o,i].indexOf(t)>=0?1:-1,e=[r,i].indexOf(t)>=0?"y":"x";V[t]+=F[e]*n}))}return V}function X(t,n){void 0===n&&(n={});var e=n.boundary,r=n.rootBoundary,i=n.padding,o=n.flipVariations,a=n.allowedAutoPlacements,c=void 0===a?s:a,l=K(n.placement),p=l?o?f:f.filter((function(t){return K(t)===l})):u,d=p.filter((function(t){return c.indexOf(t)>=0}));0===d.length&&(d=p);var h=d.reduce((function(n,o){return n[o]=Q(t,{placement:o,boundary:e,rootBoundary:r,padding:i})[b(o)],n}),{});return Object.keys(h).sort((function(t,n){return h[t]-h[n]}))}function Y(t,n,e){return void 0===e&&(e={x:0,y:0}),{top:t.top-n.height-e.y,right:t.right-n.width+e.x,bottom:t.bottom-n.height+e.y,left:t.left-n.width-e.x}}function Z(t){return[r,o,i,a].some((function(n){return t[n]>=0}))}function tt(t,n,e){void 0===e&&(e=!1);var r,i,o=h(n),a=h(n)&&function(t){var n=t.getBoundingClientRect();return 1!==(n.width/t.offsetWidth||1)||1!==(n.height/t.offsetHeight||1)}(n),u=j(n),f=y(t,a),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!e)&&(("body"!==l(n)||$(u))&&(s=(r=n)!==p(r)&&h(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:D(r)),h(n)?((c=y(n,!0)).x+=n.clientLeft,c.y+=n.clientTop):u&&(c.x=F(u))),{x:f.left+s.scrollLeft-c.x,y:f.top+s.scrollTop-c.y,width:f.width,height:f.height}}function nt(t){var n=new Map,e=new Set,r=[];function i(t){e.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!e.has(t)){var r=n.get(t);r&&i(r)}})),r.push(t)}return t.forEach((function(t){n.set(t.name,t)})),t.forEach((function(t){e.has(t.name)||i(t)})),r}var et={placement:"bottom",modifiers:[],strategy:"absolute"};function rt(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return!n.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function it(t){void 0===t&&(t={});var n=t.defaultModifiers,e=void 0===n?[]:n,r=t.defaultOptions,i=void 0===r?et:r;return function(t,n,r){void 0===r&&(r=i);var o,a,u={placement:"bottom",orderedModifiers:[],options:Object.assign({},et,i),modifiersData:{},elements:{reference:t,popper:n},attributes:{},styles:{}},f=[],s=!1,l={state:u,setOptions:function(r){p(),u.options=Object.assign({},i,u.options,r),u.scrollParents={reference:d(t)?U(t):t.contextElement?U(t.contextElement):[],popper:U(n)};var o,a,s=function(t){var n=nt(t);return c.reduce((function(t,e){return t.concat(n.filter((function(t){return t.phase===e})))}),[])}((o=[].concat(e,u.options.modifiers),a=o.reduce((function(t,n){var e=t[n.name];return t[n.name]=e?Object.assign({},e,n,{options:Object.assign({},e.options,n.options),data:Object.assign({},e.data,n.data)}):n,t}),{}),Object.keys(a).map((function(t){return a[t]}))));return u.orderedModifiers=s.filter((function(t){return t.enabled})),u.orderedModifiers.forEach((function(t){var n=t.options,e=t.effect;if("function"==typeof e){var r=e({state:u,name:t.name,instance:l,options:void 0===n?{}:n});f.push(r||function(){})}})),l.update()},forceUpdate:function(){if(!s){var t=u.elements,n=t.reference,e=t.popper;if(rt(n,e)){u.rects={reference:tt(n,C(e),"fixed"===u.options.strategy),popper:w(e)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach((function(t){return u.modifiersData[t.name]=Object.assign({},t.data)}));for(var r=0;r<u.orderedModifiers.length;r++)if(!0!==u.reset){var i=u.orderedModifiers[r],o=i.fn,a=i.options;"function"==typeof o&&(u=o({state:u,options:void 0===a?{}:a,name:i.name,instance:l})||u)}else u.reset=!1,r=-1}}},update:(o=function(){return new Promise((function(t){l.forceUpdate(),t(u)}))},function(){return a||(a=new Promise((function(t){Promise.resolve().then((function(){a=void 0,t(o())}))}))),a}),destroy:function(){p(),s=!0}};if(!rt(t,n))return l;function p(){f.forEach((function(t){return t()})),f=[]}return l.setOptions(r).then((function(t){!s&&r.onFirstUpdate&&r.onFirstUpdate(t)})),l}}var ot=it({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var n=t.state,e=t.instance,r=t.options,i=r.scroll,o=void 0===i||i,a=r.resize,u=void 0===a||a,f=p(n.elements.popper),s=[].concat(n.scrollParents.reference,n.scrollParents.popper);return o&&s.forEach((function(t){t.addEventListener("scroll",e.update,I)})),u&&f.addEventListener("resize",e.update,I),function(){o&&s.forEach((function(t){t.removeEventListener("scroll",e.update,I)})),u&&f.removeEventListener("resize",e.update,I)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var n=t.state;n.modifiersData[t.name]=N({reference:n.rects.reference,element:n.rects.popper,strategy:"absolute",placement:n.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var n=t.state,e=t.options,r=e.gpuAcceleration,i=void 0===r||r,o=e.adaptive,a=void 0===o||o,u=e.roundOffsets,f=void 0===u||u,s={placement:b(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:i};null!=n.modifiersData.popperOffsets&&(n.styles.popper=Object.assign({},n.styles.popper,A(Object.assign({},s,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:a,roundOffsets:f})))),null!=n.modifiersData.arrow&&(n.styles.arrow=Object.assign({},n.styles.arrow,A(Object.assign({},s,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var n=t.state;Object.keys(n.elements).forEach((function(t){var e=n.styles[t]||{},r=n.attributes[t]||{},i=n.elements[t];h(i)&&l(i)&&(Object.assign(i.style,e),Object.keys(r).forEach((function(t){var n=r[t];!1===n?i.removeAttribute(t):i.setAttribute(t,!0===n?"":n)})))}))},effect:function(t){var n=t.state,e={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,e.popper),n.styles=e,n.elements.arrow&&Object.assign(n.elements.arrow.style,e.arrow),function(){Object.keys(n.elements).forEach((function(t){var r=n.elements[t],i=n.attributes[t]||{},o=Object.keys(n.styles.hasOwnProperty(t)?n.styles[t]:e[t]).reduce((function(t,n){return t[n]="",t}),{});h(r)&&l(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(t){r.removeAttribute(t)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var n=t.state,e=t.name,i=t.options.offset,u=void 0===i?[0,0]:i,f=s.reduce((function(t,e){return t[e]=function(t,n,e){var i=b(t),u=[a,r].indexOf(i)>=0?-1:1,f="function"==typeof e?e(Object.assign({},n,{placement:t})):e,s=f[0],c=f[1];return s=s||0,c=(c||0)*u,[a,o].indexOf(i)>=0?{x:c,y:s}:{x:s,y:c}}(e,n.rects,u),t}),{}),c=f[n.placement],l=c.y;null!=n.modifiersData.popperOffsets&&(n.modifiersData.popperOffsets.x+=c.x,n.modifiersData.popperOffsets.y+=l),n.modifiersData[e]=f}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var n=t.state,e=t.options,u=t.name;if(!n.modifiersData[u]._skip){for(var f=e.mainAxis,s=void 0===f||f,c=e.altAxis,l=void 0===c||c,p=e.fallbackPlacements,d=e.padding,h=e.boundary,v=e.rootBoundary,m=e.altBoundary,y=e.flipVariations,w=void 0===y||y,g=e.allowedAutoPlacements,O=n.options.placement,x=b(O),j=p||(x!==O&&w?function(t){if("auto"===b(t))return[];var n=z(t);return[V(t),n,V(n)]}(O):[z(O)]),M=[O].concat(j).reduce((function(t,e){return t.concat("auto"===b(e)?X(n,{placement:e,boundary:h,rootBoundary:v,padding:d,flipVariations:w,allowedAutoPlacements:g}):e)}),[]),k=n.rects.reference,C=n.rects.popper,P=new Map,q=!0,E=M[0],R=0;R<M.length;R++){var W=M[R],B=b(W),S="start"===K(W),L=[r,i].indexOf(B)>=0,A=L?"width":"height",I=Q(n,{placement:W,boundary:h,rootBoundary:v,altBoundary:m,padding:d}),T=L?S?o:a:S?i:r;k[A]>C[A]&&(T=z(T));var H=z(T),D=[];if(s&&D.push(I[B]<=0),l&&D.push(I[T]<=0,I[H]<=0),D.every((function(t){return t}))){E=W,q=!1;break}P.set(W,D)}if(q)for(var F=function(t){var n=M.find((function(n){var e=P.get(n);if(e)return e.slice(0,t).every((function(t){return t}))}));if(n)return E=n,"break"},$=w?3:1;$>0&&"break"!==F($);$--);n.placement!==E&&(n.modifiersData[u]._skip=!0,n.placement=E,n.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var n=t.state,e=t.options,u=t.name,f=e.mainAxis,s=void 0===f||f,c=e.altAxis,l=void 0!==c&&c,p=e.tether,d=void 0===p||p,h=e.tetherOffset,v=void 0===h?0:h,m=Q(n,{boundary:e.boundary,rootBoundary:e.rootBoundary,padding:e.padding,altBoundary:e.altBoundary}),y=b(n.placement),g=K(n.placement),O=!g,x=P(y),j="x"===x?"y":"x",M=n.modifiersData.popperOffsets,k=n.rects.reference,R=n.rects.popper,B="function"==typeof v?v(Object.assign({},n.rects,{placement:n.placement})):v,S={x:0,y:0};if(M){if(s||l){var L="y"===x?r:a,A="y"===x?i:o,I="y"===x?"height":"width",T=M[x],z=M[x]+m[L],H=M[x]-m[A],V=d?-R[I]/2:0,D="start"===g?k[I]:R[I],F="start"===g?-R[I]:-k[I],$=n.elements.arrow,_=d&&$?w($):{width:0,height:0},U=n.modifiersData["arrow#persistent"]?n.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},G=U[L],J=U[A],N=W(0,k[I],_[I]),X=O?k[I]/2-V-N-G-B:D-N-G-B,Y=O?-k[I]/2+V+N+J+B:F+N+J+B,Z=n.elements.arrow&&C(n.elements.arrow),tt=n.modifiersData.offset?n.modifiersData.offset[n.placement][x]:0,nt=M[x]+X-tt-(Z?"y"===x?Z.clientTop||0:Z.clientLeft||0:0),et=M[x]+Y-tt;if(s){var rt=W(d?E(z,nt):z,T,d?q(H,et):H);M[x]=rt,S[x]=rt-T}if(l){var it=M[j],ot=it+m["x"===x?r:a],at=it-m["x"===x?i:o],ut=W(d?E(ot,nt):ot,it,d?q(at,et):at);M[j]=ut,S[j]=ut-it}}n.modifiersData[u]=S}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var n,e=t.state,f=t.name,s=t.options,c=e.elements.arrow,l=e.modifiersData.popperOffsets,p=b(e.placement),d=P(p),h=[a,o].indexOf(p)>=0?"height":"width";if(c&&l){var v=function(t,n){return B("number"!=typeof(t="function"==typeof t?t(Object.assign({},n.rects,{placement:n.placement})):t)?t:S(t,u))}(s.padding,e),m=w(c),y="y"===d?r:a,g="y"===d?i:o,O=e.rects.reference[h]+e.rects.reference[d]-l[d]-e.rects.popper[h],x=l[d]-e.rects.reference[d],j=C(c),M=j?"y"===d?j.clientHeight||0:j.clientWidth||0:0,k=M/2-m[h]/2+(O/2-x/2),q=W(v[y],k,M-m[h]-v[g]);e.modifiersData[f]=((n={})[d]=q,n.centerOffset=q-k,n)}},effect:function(t){var n=t.state,e=t.options.element,r=void 0===e?"[data-popper-arrow]":e;null!=r&&("string"!=typeof r||(r=n.elements.popper.querySelector(r)))&&g(n.elements.popper,r)&&(n.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var n=t.state,e=t.name,r=n.rects.reference,i=n.rects.popper,o=n.modifiersData.preventOverflow,a=Q(n,{elementContext:"reference"}),u=Q(n,{altBoundary:!0}),f=Y(a,r),s=Y(u,i,o),c=Z(f),l=Z(s);n.modifiersData[e]={referenceClippingOffsets:f,popperEscapeOffsets:s,isReferenceHidden:c,hasPopperEscaped:l},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":l})}}]});let at=class{constructor(n){t(this,n),this.openDirection="right",this.position="absolute",this.containerStyle={},this.parent=document.body,this.inheritParentWidth=!1,this.visible=!1,this.loaded=!1,this.parents=new WeakMap}onVisible(){if(!this.visible)return this.hideContainer(),this.styleContainer(),void this.destroyPopper();this.styleContainer(),this.createPopper(),requestAnimationFrame((()=>{this.showContainer()}))}disconnectedCallback(){this.removeContainer(),this.destroyPopper(),this.observer&&this.observer.unobserve(this.container)}connectedCallback(){this.loaded&&(this.createContainer(),this.hideContainer(),this.attachContainer(),this.styleContainer(),this.visible&&(this.createPopper(),this.showContainer()),"ResizeObserver"in window)&&new ResizeObserver((()=>{this.popperInstance&&(this.styleContainer(),this.popperInstance.update())})).observe(this.container)}componentDidLoad(){this.loaded=!0,this.connectedCallback()}render(){return n("slot",null)}createContainer(){const t=this.host.shadowRoot.querySelector("slot"),n=t.assignedElements&&t.assignedElements()||[];this.container=document.createElement("div"),this.container.setAttribute("id",this.containerId),this.container.setAttribute("class","limel-portal--container"),Object.assign(this.container,{portalSource:this.host}),n.forEach((t=>{this.parents.set(t,t.parentElement),this.container.appendChild(t)}))}attachContainer(){this.parent.appendChild(this.container)}removeContainer(){this.container&&(Array.from(this.container.children).forEach((t=>{const n=this.parents.get(t);n&&n.appendChild(t)})),this.hideContainer(),this.container.parentElement.removeChild(this.container))}hideContainer(){this.container.style.opacity="0"}showContainer(){this.container.style.opacity="1"}styleContainer(){const t=this.host.getBoundingClientRect().width;if(this.container.style.display=this.visible?"block":"none",this.inheritParentWidth){let n=this.getContentWidth(this.container);t>0&&(n=t),this.container.style.width=`${n}px`}this.ensureContainerFitsInViewPort(),Object.keys(this.containerStyle).forEach((t=>{this.container.style[t]=this.containerStyle[t]}))}getContentWidth(t){if(!t)return null;const n=t.getBoundingClientRect().width;if(0!==n)return n;const e=t.querySelector("*");return this.getContentWidth(e)}createPopper(){const t=this.createPopperConfig();this.popperInstance=ot(this.host,this.container,t)}destroyPopper(){var t;null===(t=this.popperInstance)||void 0===t||t.destroy(),this.popperInstance=null}createPopperConfig(){let t="bottom-start",n="top-start";return"left"===this.openDirection&&(t="bottom-end",n="top-end"),{strategy:this.position,placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:[n]}}]}}ensureContainerFitsInViewPort(){const t=Math.max(document.documentElement.clientHeight||0,window.innerHeight||0),{top:n,bottom:e}=this.host.getBoundingClientRect(),r=Math.max(n,0),i=Math.max(t-e,0),o=Math.max(r,i)-16;this.container.style.maxHeight=`${o}px`}get host(){return e(this)}static get watchers(){return{visible:["onVisible"]}}};at.style=":host(limel-portal:not(.limel-portal--fixed)){display:block;position:absolute;top:0;bottom:0;width:100%;pointer-events:none}:host(limel-portal.limel-portal--fixed){position:fixed}:host([hidden]){display:none}";export{at as limel_portal}
|
|
1
|
+
import{r as t,h as n,g as e}from"./p-92146da6.js";var r="top",i="bottom",o="right",a="left",u=[r,i,o,a],f=u.reduce((function(t,n){return t.concat([n+"-start",n+"-end"])}),[]),s=[].concat(u,["auto"]).reduce((function(t,n){return t.concat([n,n+"-start",n+"-end"])}),[]),c=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function p(t){return t?(t.nodeName||"").toLowerCase():null}function l(t){if(null==t)return window;if("[object Window]"!==t.toString()){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function d(t){return t instanceof l(t).Element||t instanceof Element}function h(t){return t instanceof l(t).HTMLElement||t instanceof HTMLElement}function v(t){return"undefined"!=typeof ShadowRoot&&(t instanceof l(t).ShadowRoot||t instanceof ShadowRoot)}function b(t){return t.split("-")[0]}var m=Math.round;function y(t,n){void 0===n&&(n=!1);var e=t.getBoundingClientRect(),r=1,i=1;return h(t)&&n&&(r=e.width/t.offsetWidth||1,i=e.height/t.offsetHeight||1),{width:m(e.width/r),height:m(e.height/i),top:m(e.top/i),right:m(e.right/r),bottom:m(e.bottom/i),left:m(e.left/r),x:m(e.left/r),y:m(e.top/i)}}function w(t){var n=y(t),e=t.offsetWidth,r=t.offsetHeight;return Math.abs(n.width-e)<=1&&(e=n.width),Math.abs(n.height-r)<=1&&(r=n.height),{x:t.offsetLeft,y:t.offsetTop,width:e,height:r}}function g(t,n){var e=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(e&&v(e)){var r=n;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function O(t){return l(t).getComputedStyle(t)}function x(t){return["table","td","th"].indexOf(p(t))>=0}function j(t){return((d(t)?t.ownerDocument:t.document)||window.document).documentElement}function M(t){return"html"===p(t)?t:t.assignedSlot||t.parentNode||(v(t)?t.host:null)||j(t)}function k(t){return h(t)&&"fixed"!==O(t).position?t.offsetParent:null}function C(t){for(var n=l(t),e=k(t);e&&x(e)&&"static"===O(e).position;)e=k(e);return e&&("html"===p(e)||"body"===p(e)&&"static"===O(e).position)?n:e||function(t){var n=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&h(t)&&"fixed"===O(t).position)return null;for(var e=M(t);h(e)&&["html","body"].indexOf(p(e))<0;){var r=O(e);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||n&&"filter"===r.willChange||n&&r.filter&&"none"!==r.filter)return e;e=e.parentNode}return null}(t)||n}function P(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}var q=Math.max,E=Math.min,R=Math.round;function W(t,n,e){return q(t,E(n,e))}function B(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function S(t,n){return n.reduce((function(n,e){return n[e]=t,n}),{})}var L={top:"auto",right:"auto",bottom:"auto",left:"auto"};function A(t){var n,e=t.popper,u=t.popperRect,f=t.placement,s=t.offsets,c=t.position,p=t.gpuAcceleration,d=t.adaptive,h=t.roundOffsets,v=!0===h?function(t){var n=t.y,e=window.devicePixelRatio||1;return{x:R(R(t.x*e)/e)||0,y:R(R(n*e)/e)||0}}(s):"function"==typeof h?h(s):s,b=v.x,m=void 0===b?0:b,y=v.y,w=void 0===y?0:y,g=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),M=a,k=r,P=window;if(d){var q=C(e),E="clientHeight",W="clientWidth";q===l(e)&&"static"!==O(q=j(e)).position&&(E="scrollHeight",W="scrollWidth"),q=q,f===r&&(k=i,w-=q[E]-u.height,w*=p?1:-1),f===a&&(M=o,m-=q[W]-u.width,m*=p?1:-1)}var B,S=Object.assign({position:c},d&&L);return Object.assign({},S,p?((B={})[k]=x?"0":"",B[M]=g?"0":"",B.transform=(P.devicePixelRatio||1)<2?"translate("+m+"px, "+w+"px)":"translate3d("+m+"px, "+w+"px, 0)",B):((n={})[k]=x?w+"px":"",n[M]=g?m+"px":"",n.transform="",n))}var I={passive:!0},T={left:"right",right:"left",bottom:"top",top:"bottom"};function z(t){return t.replace(/left|right|bottom|top/g,(function(t){return T[t]}))}var H={start:"end",end:"start"};function V(t){return t.replace(/start|end/g,(function(t){return H[t]}))}function D(t){var n=l(t);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function F(t){return y(j(t)).left+D(t).scrollLeft}function $(t){var n=O(t);return/auto|scroll|overlay|hidden/.test(n.overflow+n.overflowY+n.overflowX)}function _(t){return["html","body","#document"].indexOf(p(t))>=0?t.ownerDocument.body:h(t)&&$(t)?t:_(M(t))}function U(t,n){var e;void 0===n&&(n=[]);var r=_(t),i=r===(null==(e=t.ownerDocument)?void 0:e.body),o=l(r),a=i?[o].concat(o.visualViewport||[],$(r)?r:[]):r,u=n.concat(a);return i?u:u.concat(U(M(a)))}function G(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function J(t,n){return"viewport"===n?G(function(t){var n=l(t),e=j(t),r=n.visualViewport,i=e.clientWidth,o=e.clientHeight,a=0,u=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,u=r.offsetTop)),{width:i,height:o,x:a+F(t),y:u}}(t)):h(n)?function(t){var n=y(t);return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}(n):G(function(t){var n,e=j(t),r=D(t),i=null==(n=t.ownerDocument)?void 0:n.body,o=q(e.scrollWidth,e.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=q(e.scrollHeight,e.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-r.scrollLeft+F(t),f=-r.scrollTop;return"rtl"===O(i||e).direction&&(u+=q(e.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:u,y:f}}(j(t)))}function K(t){return t.split("-")[1]}function N(t){var n,e=t.reference,u=t.element,f=t.placement,s=f?b(f):null,c=f?K(f):null,p=e.x+e.width/2-u.width/2,l=e.y+e.height/2-u.height/2;switch(s){case r:n={x:p,y:e.y-u.height};break;case i:n={x:p,y:e.y+e.height};break;case o:n={x:e.x+e.width,y:l};break;case a:n={x:e.x-u.width,y:l};break;default:n={x:e.x,y:e.y}}var d=s?P(s):null;if(null!=d){var h="y"===d?"height":"width";switch(c){case"start":n[d]=n[d]-(e[h]/2-u[h]/2);break;case"end":n[d]=n[d]+(e[h]/2-u[h]/2)}}return n}function Q(t,n){void 0===n&&(n={});var e=n.placement,a=void 0===e?t.placement:e,f=n.boundary,s=void 0===f?"clippingParents":f,c=n.rootBoundary,l=void 0===c?"viewport":c,v=n.elementContext,b=void 0===v?"popper":v,m=n.altBoundary,w=void 0!==m&&m,x=n.padding,k=void 0===x?0:x,P=B("number"!=typeof k?k:S(k,u)),R=t.elements.reference,W=t.rects.popper,L=t.elements[w?"popper"===b?"reference":"popper":b],A=function(t,n,e){var r="clippingParents"===n?function(t){var n=U(M(t)),e=["absolute","fixed"].indexOf(O(t).position)>=0&&h(t)?C(t):t;return d(e)?n.filter((function(t){return d(t)&&g(t,e)&&"body"!==p(t)})):[]}(t):[].concat(n),i=[].concat(r,[e]),o=i.reduce((function(n,e){var r=J(t,e);return n.top=q(r.top,n.top),n.right=E(r.right,n.right),n.bottom=E(r.bottom,n.bottom),n.left=q(r.left,n.left),n}),J(t,i[0]));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}(d(L)?L:L.contextElement||j(t.elements.popper),s,l),I=y(R),T=N({reference:I,element:W,strategy:"absolute",placement:a}),z=G(Object.assign({},W,T)),H="popper"===b?z:I,V={top:A.top-H.top+P.top,bottom:H.bottom-A.bottom+P.bottom,left:A.left-H.left+P.left,right:H.right-A.right+P.right},D=t.modifiersData.offset;if("popper"===b&&D){var F=D[a];Object.keys(V).forEach((function(t){var n=[o,i].indexOf(t)>=0?1:-1,e=[r,i].indexOf(t)>=0?"y":"x";V[t]+=F[e]*n}))}return V}function X(t,n){void 0===n&&(n={});var e=n.boundary,r=n.rootBoundary,i=n.padding,o=n.flipVariations,a=n.allowedAutoPlacements,c=void 0===a?s:a,p=K(n.placement),l=p?o?f:f.filter((function(t){return K(t)===p})):u,d=l.filter((function(t){return c.indexOf(t)>=0}));0===d.length&&(d=l);var h=d.reduce((function(n,o){return n[o]=Q(t,{placement:o,boundary:e,rootBoundary:r,padding:i})[b(o)],n}),{});return Object.keys(h).sort((function(t,n){return h[t]-h[n]}))}function Y(t,n,e){return void 0===e&&(e={x:0,y:0}),{top:t.top-n.height-e.y,right:t.right-n.width+e.x,bottom:t.bottom-n.height+e.y,left:t.left-n.width-e.x}}function Z(t){return[r,o,i,a].some((function(n){return t[n]>=0}))}function tt(t,n,e){void 0===e&&(e=!1);var r,i,o=h(n),a=h(n)&&function(t){var n=t.getBoundingClientRect();return 1!==(n.width/t.offsetWidth||1)||1!==(n.height/t.offsetHeight||1)}(n),u=j(n),f=y(t,a),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!e)&&(("body"!==p(n)||$(u))&&(s=(r=n)!==l(r)&&h(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:D(r)),h(n)?((c=y(n,!0)).x+=n.clientLeft,c.y+=n.clientTop):u&&(c.x=F(u))),{x:f.left+s.scrollLeft-c.x,y:f.top+s.scrollTop-c.y,width:f.width,height:f.height}}function nt(t){var n=new Map,e=new Set,r=[];function i(t){e.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!e.has(t)){var r=n.get(t);r&&i(r)}})),r.push(t)}return t.forEach((function(t){n.set(t.name,t)})),t.forEach((function(t){e.has(t.name)||i(t)})),r}var et={placement:"bottom",modifiers:[],strategy:"absolute"};function rt(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return!n.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function it(t){void 0===t&&(t={});var n=t.defaultModifiers,e=void 0===n?[]:n,r=t.defaultOptions,i=void 0===r?et:r;return function(t,n,r){void 0===r&&(r=i);var o,a,u={placement:"bottom",orderedModifiers:[],options:Object.assign({},et,i),modifiersData:{},elements:{reference:t,popper:n},attributes:{},styles:{}},f=[],s=!1,p={state:u,setOptions:function(r){l(),u.options=Object.assign({},i,u.options,r),u.scrollParents={reference:d(t)?U(t):t.contextElement?U(t.contextElement):[],popper:U(n)};var o,a,s=function(t){var n=nt(t);return c.reduce((function(t,e){return t.concat(n.filter((function(t){return t.phase===e})))}),[])}((o=[].concat(e,u.options.modifiers),a=o.reduce((function(t,n){var e=t[n.name];return t[n.name]=e?Object.assign({},e,n,{options:Object.assign({},e.options,n.options),data:Object.assign({},e.data,n.data)}):n,t}),{}),Object.keys(a).map((function(t){return a[t]}))));return u.orderedModifiers=s.filter((function(t){return t.enabled})),u.orderedModifiers.forEach((function(t){var n=t.options,e=t.effect;if("function"==typeof e){var r=e({state:u,name:t.name,instance:p,options:void 0===n?{}:n});f.push(r||function(){})}})),p.update()},forceUpdate:function(){if(!s){var t=u.elements,n=t.reference,e=t.popper;if(rt(n,e)){u.rects={reference:tt(n,C(e),"fixed"===u.options.strategy),popper:w(e)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach((function(t){return u.modifiersData[t.name]=Object.assign({},t.data)}));for(var r=0;r<u.orderedModifiers.length;r++)if(!0!==u.reset){var i=u.orderedModifiers[r],o=i.fn,a=i.options;"function"==typeof o&&(u=o({state:u,options:void 0===a?{}:a,name:i.name,instance:p})||u)}else u.reset=!1,r=-1}}},update:(o=function(){return new Promise((function(t){p.forceUpdate(),t(u)}))},function(){return a||(a=new Promise((function(t){Promise.resolve().then((function(){a=void 0,t(o())}))}))),a}),destroy:function(){l(),s=!0}};if(!rt(t,n))return p;function l(){f.forEach((function(t){return t()})),f=[]}return p.setOptions(r).then((function(t){!s&&r.onFirstUpdate&&r.onFirstUpdate(t)})),p}}var ot=it({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var n=t.state,e=t.instance,r=t.options,i=r.scroll,o=void 0===i||i,a=r.resize,u=void 0===a||a,f=l(n.elements.popper),s=[].concat(n.scrollParents.reference,n.scrollParents.popper);return o&&s.forEach((function(t){t.addEventListener("scroll",e.update,I)})),u&&f.addEventListener("resize",e.update,I),function(){o&&s.forEach((function(t){t.removeEventListener("scroll",e.update,I)})),u&&f.removeEventListener("resize",e.update,I)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var n=t.state;n.modifiersData[t.name]=N({reference:n.rects.reference,element:n.rects.popper,strategy:"absolute",placement:n.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var n=t.state,e=t.options,r=e.gpuAcceleration,i=void 0===r||r,o=e.adaptive,a=void 0===o||o,u=e.roundOffsets,f=void 0===u||u,s={placement:b(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:i};null!=n.modifiersData.popperOffsets&&(n.styles.popper=Object.assign({},n.styles.popper,A(Object.assign({},s,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:a,roundOffsets:f})))),null!=n.modifiersData.arrow&&(n.styles.arrow=Object.assign({},n.styles.arrow,A(Object.assign({},s,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var n=t.state;Object.keys(n.elements).forEach((function(t){var e=n.styles[t]||{},r=n.attributes[t]||{},i=n.elements[t];h(i)&&p(i)&&(Object.assign(i.style,e),Object.keys(r).forEach((function(t){var n=r[t];!1===n?i.removeAttribute(t):i.setAttribute(t,!0===n?"":n)})))}))},effect:function(t){var n=t.state,e={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,e.popper),n.styles=e,n.elements.arrow&&Object.assign(n.elements.arrow.style,e.arrow),function(){Object.keys(n.elements).forEach((function(t){var r=n.elements[t],i=n.attributes[t]||{},o=Object.keys(n.styles.hasOwnProperty(t)?n.styles[t]:e[t]).reduce((function(t,n){return t[n]="",t}),{});h(r)&&p(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(t){r.removeAttribute(t)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var n=t.state,e=t.name,i=t.options.offset,u=void 0===i?[0,0]:i,f=s.reduce((function(t,e){return t[e]=function(t,n,e){var i=b(t),u=[a,r].indexOf(i)>=0?-1:1,f="function"==typeof e?e(Object.assign({},n,{placement:t})):e,s=f[0],c=f[1];return s=s||0,c=(c||0)*u,[a,o].indexOf(i)>=0?{x:c,y:s}:{x:s,y:c}}(e,n.rects,u),t}),{}),c=f[n.placement],p=c.y;null!=n.modifiersData.popperOffsets&&(n.modifiersData.popperOffsets.x+=c.x,n.modifiersData.popperOffsets.y+=p),n.modifiersData[e]=f}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var n=t.state,e=t.options,u=t.name;if(!n.modifiersData[u]._skip){for(var f=e.mainAxis,s=void 0===f||f,c=e.altAxis,p=void 0===c||c,l=e.fallbackPlacements,d=e.padding,h=e.boundary,v=e.rootBoundary,m=e.altBoundary,y=e.flipVariations,w=void 0===y||y,g=e.allowedAutoPlacements,O=n.options.placement,x=b(O),j=l||(x!==O&&w?function(t){if("auto"===b(t))return[];var n=z(t);return[V(t),n,V(n)]}(O):[z(O)]),M=[O].concat(j).reduce((function(t,e){return t.concat("auto"===b(e)?X(n,{placement:e,boundary:h,rootBoundary:v,padding:d,flipVariations:w,allowedAutoPlacements:g}):e)}),[]),k=n.rects.reference,C=n.rects.popper,P=new Map,q=!0,E=M[0],R=0;R<M.length;R++){var W=M[R],B=b(W),S="start"===K(W),L=[r,i].indexOf(B)>=0,A=L?"width":"height",I=Q(n,{placement:W,boundary:h,rootBoundary:v,altBoundary:m,padding:d}),T=L?S?o:a:S?i:r;k[A]>C[A]&&(T=z(T));var H=z(T),D=[];if(s&&D.push(I[B]<=0),p&&D.push(I[T]<=0,I[H]<=0),D.every((function(t){return t}))){E=W,q=!1;break}P.set(W,D)}if(q)for(var F=function(t){var n=M.find((function(n){var e=P.get(n);if(e)return e.slice(0,t).every((function(t){return t}))}));if(n)return E=n,"break"},$=w?3:1;$>0&&"break"!==F($);$--);n.placement!==E&&(n.modifiersData[u]._skip=!0,n.placement=E,n.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var n=t.state,e=t.options,u=t.name,f=e.mainAxis,s=void 0===f||f,c=e.altAxis,p=void 0!==c&&c,l=e.tether,d=void 0===l||l,h=e.tetherOffset,v=void 0===h?0:h,m=Q(n,{boundary:e.boundary,rootBoundary:e.rootBoundary,padding:e.padding,altBoundary:e.altBoundary}),y=b(n.placement),g=K(n.placement),O=!g,x=P(y),j="x"===x?"y":"x",M=n.modifiersData.popperOffsets,k=n.rects.reference,R=n.rects.popper,B="function"==typeof v?v(Object.assign({},n.rects,{placement:n.placement})):v,S={x:0,y:0};if(M){if(s||p){var L="y"===x?r:a,A="y"===x?i:o,I="y"===x?"height":"width",T=M[x],z=M[x]+m[L],H=M[x]-m[A],V=d?-R[I]/2:0,D="start"===g?k[I]:R[I],F="start"===g?-R[I]:-k[I],$=n.elements.arrow,_=d&&$?w($):{width:0,height:0},U=n.modifiersData["arrow#persistent"]?n.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},G=U[L],J=U[A],N=W(0,k[I],_[I]),X=O?k[I]/2-V-N-G-B:D-N-G-B,Y=O?-k[I]/2+V+N+J+B:F+N+J+B,Z=n.elements.arrow&&C(n.elements.arrow),tt=n.modifiersData.offset?n.modifiersData.offset[n.placement][x]:0,nt=M[x]+X-tt-(Z?"y"===x?Z.clientTop||0:Z.clientLeft||0:0),et=M[x]+Y-tt;if(s){var rt=W(d?E(z,nt):z,T,d?q(H,et):H);M[x]=rt,S[x]=rt-T}if(p){var it=M[j],ot=it+m["x"===x?r:a],at=it-m["x"===x?i:o],ut=W(d?E(ot,nt):ot,it,d?q(at,et):at);M[j]=ut,S[j]=ut-it}}n.modifiersData[u]=S}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var n,e=t.state,f=t.name,s=t.options,c=e.elements.arrow,p=e.modifiersData.popperOffsets,l=b(e.placement),d=P(l),h=[a,o].indexOf(l)>=0?"height":"width";if(c&&p){var v=function(t,n){return B("number"!=typeof(t="function"==typeof t?t(Object.assign({},n.rects,{placement:n.placement})):t)?t:S(t,u))}(s.padding,e),m=w(c),y="y"===d?r:a,g="y"===d?i:o,O=e.rects.reference[h]+e.rects.reference[d]-p[d]-e.rects.popper[h],x=p[d]-e.rects.reference[d],j=C(c),M=j?"y"===d?j.clientHeight||0:j.clientWidth||0:0,k=M/2-m[h]/2+(O/2-x/2),q=W(v[y],k,M-m[h]-v[g]);e.modifiersData[f]=((n={})[d]=q,n.centerOffset=q-k,n)}},effect:function(t){var n=t.state,e=t.options.element,r=void 0===e?"[data-popper-arrow]":e;null!=r&&("string"!=typeof r||(r=n.elements.popper.querySelector(r)))&&g(n.elements.popper,r)&&(n.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var n=t.state,e=t.name,r=n.rects.reference,i=n.rects.popper,o=n.modifiersData.preventOverflow,a=Q(n,{elementContext:"reference"}),u=Q(n,{altBoundary:!0}),f=Y(a,r),s=Y(u,i,o),c=Z(f),p=Z(s);n.modifiersData[e]={referenceClippingOffsets:f,popperEscapeOffsets:s,isReferenceHidden:c,hasPopperEscaped:p},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":p})}}]});let at=class{constructor(n){t(this,n),this.openDirection="right",this.position="absolute",this.containerStyle={},this.parent=document.body,this.inheritParentWidth=!1,this.visible=!1,this.loaded=!1,this.parents=new WeakMap}onVisible(){if(!this.visible)return this.hideContainer(),this.styleContainer(),void this.destroyPopper();this.styleContainer(),this.createPopper(),requestAnimationFrame((()=>{this.showContainer()}))}disconnectedCallback(){this.removeContainer(),this.destroyPopper(),this.observer&&this.observer.unobserve(this.container)}connectedCallback(){this.loaded&&(this.createContainer(),this.hideContainer(),this.attachContainer(),this.styleContainer(),this.visible&&(this.createPopper(),this.showContainer()),"ResizeObserver"in window)&&new ResizeObserver((()=>{this.popperInstance&&(this.styleContainer(),this.popperInstance.update())})).observe(this.container)}componentDidLoad(){this.loaded=!0,this.connectedCallback()}render(){return n("slot",null)}createContainer(){const t=this.host.shadowRoot.querySelector("slot"),n=t.assignedElements&&t.assignedElements()||[];this.container=document.createElement("div"),this.container.setAttribute("id",this.containerId),this.container.setAttribute("class","limel-portal--container"),Object.assign(this.container,{portalSource:this.host}),n.forEach((t=>{this.parents.set(t,t.parentElement),this.container.appendChild(t)}))}attachContainer(){this.parent.appendChild(this.container)}removeContainer(){this.container&&(Array.from(this.container.children).forEach((t=>{const n=this.parents.get(t);n&&n.appendChild(t)})),this.hideContainer(),this.container.parentElement.removeChild(this.container))}hideContainer(){this.container.style.opacity="0"}showContainer(){this.container.style.opacity="1"}styleContainer(){const t=this.host.getBoundingClientRect().width;if(this.container.style.display=this.visible?"block":"none",this.inheritParentWidth){let n=this.getContentWidth(this.container);t>0&&(n=t),this.container.style.width=`${n}px`}this.ensureContainerFitsInViewPort(),Object.keys(this.containerStyle).forEach((t=>{this.container.style[t]=this.containerStyle[t]}))}getContentWidth(t){if(!t)return null;const n=t.getBoundingClientRect().width;if(0!==n)return n;const e=t.querySelector("*");return this.getContentWidth(e)}createPopper(){const t=this.createPopperConfig();this.popperInstance=ot(this.host,this.container,t)}destroyPopper(){var t;null===(t=this.popperInstance)||void 0===t||t.destroy(),this.popperInstance=null}createPopperConfig(){let t="bottom-start",n="top-start";return"left"===this.openDirection&&(t="bottom-end",n="top-end"),{strategy:this.position,placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:[n]}}]}}ensureContainerFitsInViewPort(){const t=Math.max(document.documentElement.clientHeight||0,window.innerHeight||0),{top:n,bottom:e}=this.host.getBoundingClientRect(),r=Math.max(n,0),i=Math.max(t-e,0),o=Math.max(r,i)-16;this.container.style.maxHeight=`${o}px`}get host(){return e(this)}static get watchers(){return{visible:["onVisible"]}}};at.style=":host(limel-portal){display:block;position:absolute;top:0;bottom:0;width:100%;pointer-events:none}:host([hidden]){display:none}";export{at as limel_portal}
|
|
@@ -144,10 +144,6 @@ export interface FormLayoutOptions<T = FormLayoutType.Default> {
|
|
|
144
144
|
* The type of layout to use
|
|
145
145
|
*/
|
|
146
146
|
type: T;
|
|
147
|
-
/**
|
|
148
|
-
* @deprecated use `GridLayoutOptions.colSpan` instead
|
|
149
|
-
*/
|
|
150
|
-
span?: 'all';
|
|
151
147
|
}
|
|
152
148
|
export interface GridLayoutOptions extends FormLayoutOptions<FormLayoutType.Grid> {
|
|
153
149
|
/**
|
|
@@ -56,14 +56,6 @@ export declare class Picker {
|
|
|
56
56
|
* Sets delimiters between chips. Works only when `multiple` is `true`.
|
|
57
57
|
*/
|
|
58
58
|
delimiter: string;
|
|
59
|
-
/**
|
|
60
|
-
* True if the dropdown list should be displayed without cutting the content
|
|
61
|
-
*
|
|
62
|
-
* @deprecated This was used for a workaround, and isn't needed any
|
|
63
|
-
* longer. Setting it has no effect, and the property will be removed
|
|
64
|
-
* in the next major version.
|
|
65
|
-
*/
|
|
66
|
-
displayFullList: boolean;
|
|
67
59
|
/**
|
|
68
60
|
* Static actions that can be clicked by the user.
|
|
69
61
|
*/
|
|
@@ -631,11 +631,6 @@ export namespace Components {
|
|
|
631
631
|
* True if the picker should be disabled
|
|
632
632
|
*/
|
|
633
633
|
"disabled": boolean;
|
|
634
|
-
/**
|
|
635
|
-
* True if the dropdown list should be displayed without cutting the content
|
|
636
|
-
* @deprecated This was used for a workaround, and isn't needed any longer. Setting it has no effect, and the property will be removed in the next major version.
|
|
637
|
-
*/
|
|
638
|
-
"displayFullList": boolean;
|
|
639
634
|
/**
|
|
640
635
|
* A message to display when the search returned an empty result
|
|
641
636
|
*/
|
|
@@ -1959,11 +1954,6 @@ declare namespace LocalJSX {
|
|
|
1959
1954
|
* True if the picker should be disabled
|
|
1960
1955
|
*/
|
|
1961
1956
|
"disabled"?: boolean;
|
|
1962
|
-
/**
|
|
1963
|
-
* True if the dropdown list should be displayed without cutting the content
|
|
1964
|
-
* @deprecated This was used for a workaround, and isn't needed any longer. Setting it has no effect, and the property will be removed in the next major version.
|
|
1965
|
-
*/
|
|
1966
|
-
"displayFullList"?: boolean;
|
|
1967
1957
|
/**
|
|
1968
1958
|
* A message to display when the search returned an empty result
|
|
1969
1959
|
*/
|
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,g as e}from"./p-92146da6.js";import{i as n}from"./p-0534b23b.js";import{T as h,b as r,E as o,c as l,d as a,a as c,A as u,e as d,f,g as p}from"./p-216ffe20.js";import{c as m}from"./p-6c094f3f.js";function v(t){return"function"==typeof t?t():t}function y(){var t={};return t.promise=new Promise((function(i,s){t.resolve=i,t.reject=s})),t}function g(t){var i=null,s=null,e=new Promise((function(t,e){i=t,s=e}));return t&&t.then((function(t){i&&i(t)}),(function(t){s&&s(t)})),{promise:e,resolve:function(t){i&&i(t)},reject:function(t){s&&s(t)},cancel:function(){i=null,s=null}}}
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
5
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
6
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
|
|
8
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
9
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
10
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
11
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
12
|
-
|
|
13
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
14
|
-
and limitations under the License.
|
|
15
|
-
***************************************************************************** */
|
|
16
|
-
var b=function(){return(b=Object.assign||function(t){for(var i,s=1,e=arguments.length;s<e;s++)for(var n in i=arguments[s])Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n]);return t}).apply(this,arguments)},w={key:function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return null},onlyResolvesLast:!0},C=function(){function t(t){this.config=t,this.debounceSingleton=null,this.debounceCache={}}return t.prototype._createDebouncedFunction=function(){var t,i,s=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},e=void 0,n=void 0,h=void 0,r=[];return function(){var l=v(i),a=(new Date).getTime(),c=!e||a-e>l;e=a;for(var u=arguments.length,d=Array(u),f=0;f<u;f++)d[f]=arguments[f];if(c&&s.leading)return s.accumulate?Promise.resolve(t.call(this,[d])).then((function(t){return t[0]})):Promise.resolve(t.call.apply(t,[this].concat(d)));if(n?clearTimeout(h):n=y(),r.push(d),h=setTimeout(o.bind(this),l),s.accumulate){var p=r.length-1;return n.promise.then((function(t){return t[p]}))}return n.promise};function o(){var i=n;clearTimeout(h),Promise.resolve(s.accumulate?t.call(this,r):t.apply(this,r[r.length-1])).then(i.resolve,i.reject),r=[],n=null}}(this.config.func,this.config.wait,this.config.options);return this.config.options.onlyResolvesLast&&(t=s,i=null,s=function(){for(var s=[],e=0;e<arguments.length;e++)s[e]=arguments[e];i&&i();var n=g(t.apply(void 0,s));return i=n.cancel,n.promise}),{func:s}},t.prototype.getDebouncedFunction=function(t){var i,s=(i=this.config.options).key.apply(i,t);return null==s?(this.debounceSingleton||(this.debounceSingleton=this._createDebouncedFunction()),this.debounceSingleton):(this.debounceCache[s]||(this.debounceCache[s]=this._createDebouncedFunction()),this.debounceCache[s])},t}();let D=class{constructor(s){t(this,s),this.change=i(this,"change",7),this.interact=i(this,"interact",7),this.action=i(this,"action",7),this.disabled=!1,this.readonly=!1,this.required=!1,this.multiple=!1,this.delimiter=null,this.displayFullList=!1,this.actions=[],this.actionPosition="bottom",this.actionScrollBehavior="sticky",this.textValue="",this.loading=!1,this.chips=[],this.chipSetEditMode=!1,this.handleTextInput=this.handleTextInput.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleDropdownKeyDown=this.handleDropdownKeyDown.bind(this),this.handleInputFieldFocus=this.handleInputFieldFocus.bind(this),this.handleChange=this.handleChange.bind(this),this.handleInteract=this.handleInteract.bind(this),this.handleListChange=this.handleListChange.bind(this),this.handleActionListChange=this.handleActionListChange.bind(this),this.handleStopEditAndBlur=this.handleStopEditAndBlur.bind(this),this.createDebouncedSearcher=this.createDebouncedSearcher.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.onListKeyDown=this.onListKeyDown.bind(this),this.portalId=m()}componentWillLoad(){this.chips=this.createChips(this.value)}componentDidLoad(){this.createDebouncedSearcher(this.searcher),this.chipSet=this.host.shadowRoot.querySelector("limel-chip-set")}async componentWillUpdate(){this.chipSetEditMode=!1,this.chipSet&&(this.chipSetEditMode=await this.chipSet.getEditMode())}render(){this.chips.forEach((t=>{"iconBackgroundColor"in t&&t.iconBackgroundColor&&(t.iconFillColor="rgb(var(--color-white))")}));const t={};return this.multiple||(t.maxItems=1),[s("limel-chip-set",Object.assign({type:"input",label:this.label,leadingIcon:this.leadingIcon,value:this.chips,disabled:this.disabled,delimiter:this.renderDelimiter(),readonly:this.readonly,required:this.required,searchLabel:this.searchLabel,onInput:this.handleTextInput,onKeyDown:this.handleInputKeyDown,onChange:this.handleChange,onInteract:this.handleInteract,onStartEdit:this.handleInputFieldFocus,onStopEdit:this.handleStopEditAndBlur,emptyInputOnBlur:!1,clearAllButton:this.multiple},t)),this.renderDropdown()]}onChangeValue(){this.chips=this.createChips(this.value)}createDebouncedSearcher(t){var i,s,e;"function"==typeof t&&(this.debouncedSearch=(i=t,500,s=b({},w,undefined),e=new C({func:i,wait:500,options:s}),function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return e.getDebouncedFunction(t).func.apply(void 0,t)}))}renderDelimiter(){return this.multiple?this.delimiter:null}createChips(t){return t?this.multiple?t.map(this.createChip):[this.createChip(t)]:[]}createChip(t){return{id:`${t.value}`,text:t.text,removable:!0,icon:t.icon,iconBackgroundColor:t.iconColor,value:t}}renderDropdown(){const t=this.getDropdownContent(),i=[];if(this.shouldShowDropDownContent()){const s=this.getActionContent();"top"===this.actionPosition&&i.push(s),t&&i.push(t),"bottom"===this.actionPosition&&i.push(s)}return this.renderPortal(i)}getActionContent(){var t,i;return 0===(null!==(i=null===(t=this.actions)||void 0===t?void 0:t.length)&&void 0!==i?i:0)?null:[s("limel-list",{class:{"static-actions-list":!0,"is-on-top":"top"===this.actionPosition,"is-at-bottom":"bottom"===this.actionPosition,"has-position-sticky":"sticky"===this.actionScrollBehavior},badgeIcons:!0,type:"selectable",onChange:this.handleActionListChange,items:this.actions.map(this.removeUnusedPropertiesOnAction)})]}removeUnusedPropertiesOnAction(t){return Object.assign(Object.assign({},t),{actions:[]})}shouldShowDropDownContent(){return!this.isFull()&&!!this.chipSetEditMode}getDropdownContent(){if(this.shouldShowDropDownContent())return this.loading?this.renderSpinner():this.items&&this.items.length?this.renderListResult():this.renderEmptyMessage()}isFull(){return!this.multiple&&!!this.value}renderSpinner(){return s("div",{style:{width:"100%",display:"flex","align-items":"center","justify-content":"center",padding:"1rem 0"}},s("limel-spinner",{limeBranded:!1}))}renderEmptyMessage(){if(this.emptyResultMessage)return s("p",{style:{color:"var(--lime-light-grey, #{$lime-light-grey})","text-align":"center"}},this.emptyResultMessage)}renderListResult(){const t=this.items.some((t=>"icon"in t&&!!t.icon));return s("limel-list",{badgeIcons:t,onChange:this.handleListChange,onKeyDown:this.onListKeyDown,type:"selectable",items:this.items})}onListKeyDown(t){const i=[h,r,o].includes(t.key),s=[l,a,c].includes(t.keyCode);(i||s)&&this.chipSet.setFocus()}renderPortal(t=[]){const i=getComputedStyle(this.host).getPropertyValue("--dropdown-z-index");return s("limel-portal",{visible:t.length>0,containerId:this.portalId,inheritParentWidth:!0,containerStyle:{"z-index":i}},s("limel-menu-surface",{open:t.length>0,allowClicksElement:this.host,style:{"--menu-surface-width":"100%","max-height":"inherit",display:"flex"},onDismiss:this.handleCloseMenu},t))}handleStopEditAndBlur(){const t=this.host.shadowRoot.activeElement||document.activeElement,i=document.querySelector(`#${this.portalId}`);n(t,this.host)||n(t,i)||this.clearInputField()}async handleTextInput(t){t.stopPropagation();const i=t.detail;this.textValue=i,this.loading=!0;const s=""===i?this.searcher:this.debouncedSearch,e=await s(i);this.handleSearchResult(i,e)}handleListChange(t){var i;if(t.stopPropagation(),!this.value||this.value!==t.detail){let i=t.detail;this.multiple&&(i=[...this.value,t.detail]),this.change.emit(i),this.items=[]}this.multiple&&(null===(i=this.chipSet)||void 0===i||i.setFocus(!0))}handleActionListChange(t){t.stopPropagation(),t.detail&&(this.action.emit(t.detail.value),this.items=[])}async handleInputFieldFocus(){this.loading=!0;const t=this.textValue,i=await this.searcher(t);this.handleSearchResult(t,i)}handleChange(t){t.stopPropagation();let i=null;this.multiple&&(i=t.detail.map((t=>this.value.find((i=>`${i.value}`===t.id))))),this.change.emit(i)}handleInteract(t){t.stopPropagation(),this.interact.emit(t.detail?t.detail.value:t.detail)}handleInputKeyDown(t){const i=!(t.key!==h&&t.keyCode!==l||t.altKey||t.metaKey||t.shiftKey),s=t.key===u||t.keyCode===d,e=t.key===f||t.keyCode===p;if(!i&&!s&&!e)return;const n=document.querySelector(` #${this.portalId} limel-list`);n&&(t.preventDefault(),i||e?n.shadowRoot.querySelector(".mdc-deprecated-list-item:first-child").focus():s&&n.shadowRoot.querySelector(".mdc-deprecated-list-item:last-child").focus())}handleDropdownKeyDown(t){(t.key===r||t.keyCode===a)&&(t.preventDefault(),this.textValue="",this.chipSet.setFocus(!0))}handleSearchResult(t,i){if(t===this.textValue){if(this.items=i,this.multiple){const t=this.value;this.items=i.filter((i=>!t.includes(i)))}this.loading=!1}}handleCloseMenu(){this.clearInputField()}clearInputField(){this.chipSet.emptyInput(),this.textValue="",this.handleSearchResult("",[])}get host(){return e(this)}static get watchers(){return{value:["onChangeValue"],searcher:["createDebouncedSearcher"]}}};D.style=":host{position:relative;display:block}:host([hidden]){display:none}";export{D as limel_picker}
|