@nordhealth/components 3.19.0 → 3.21.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/custom-elements.json +4529 -4472
- package/lib/DatePicker.js +1 -1
- package/lib/Dropdown.js +1 -1
- package/lib/{DropdownItem-DpwKwVOT.js → DropdownItem-CPeMIqN8.js} +2 -2
- package/lib/DropdownItem-CPeMIqN8.js.map +1 -0
- package/lib/DropdownItem.js +1 -1
- package/lib/DropdownItem.js.map +1 -1
- package/lib/IconManager.js +1 -1
- package/lib/Message.js +1 -1
- package/lib/Modal.js +1 -1
- package/lib/Modal.js.map +1 -1
- package/lib/Popout-C5zTBGWo.js +2 -0
- package/lib/Popout-C5zTBGWo.js.map +1 -0
- package/lib/Popout.js +1 -1
- package/lib/Radio.js +1 -1
- package/lib/Radio.js.map +1 -1
- package/lib/Select.js +1 -1
- package/lib/Select.js.map +1 -1
- package/lib/Stack.js +1 -1
- package/lib/Stack.js.map +1 -1
- package/lib/Tooltip.js +1 -1
- package/lib/bundle.js +9 -9
- package/lib/bundle.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/positioning-D0xRzCXq.js +2 -0
- package/lib/{positioning-BIzQxDMX.js.map → positioning-D0xRzCXq.js.map} +1 -1
- package/lib/src/common/mixins/FloatingComponentMixin.d.ts +1 -1
- package/lib/src/dropdown-item/DropdownItem.d.ts +15 -0
- package/lib/src/modal/Modal.d.ts +3 -1
- package/lib/src/stack/Stack.d.ts +2 -2
- package/package.json +4 -4
- package/lib/DropdownItem-DpwKwVOT.js.map +0 -1
- package/lib/Popout-8ZXIGZFg.js +0 -2
- package/lib/Popout-8ZXIGZFg.js.map +0 -1
- package/lib/positioning-BIzQxDMX.js +0 -2
package/lib/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{isTranslationRegistered,registerTranslation}from"./translation.js";export{default as Badge}from"./Badge.js";export{default as Button}from"./Button.js";export{default as Card}from"./Card.js";export{default as Input}from"./Input.js";export{default as Icon}from"./Icon.js";export{default as CommandMenu}from"./CommandMenu.js";export{default as CommandMenuAction}from"./CommandMenuAction.js";export{default as Select}from"./Select.js";export{default as Stack}from"./Stack.js";export{default as Spinner}from"./Spinner.js";export{default as Table}from"./Table.js";export{default as VisuallyHidden}from"./VisuallyHidden.js";export{default as Textarea}from"./Textarea.js";export{C as Calendar}from"./Calendar-loNMUV5l.js";export{default as DatePicker}from"./DatePicker.js";export{default as Checkbox}from"./Checkbox.js";export{default as Tooltip}from"./Tooltip.js";export{default as Fieldset}from"./Fieldset.js";export{default as Radio}from"./Radio.js";export{default as Header}from"./Header.js";export{default as Message}from"./Message.js";export{default as NavGroup}from"./NavGroup.js";export{default as NavItem}from"./NavItem.js";export{default as Navigation}from"./Navigation.js";export{default as Layout}from"./Layout.js";export{default as EmptyState}from"./EmptyState.js";export{default as Banner}from"./Banner.js";export{default as Avatar}from"./Avatar.js";export{default as ProgressBar}from"./ProgressBar.js";export{P as Popout}from"./Popout-
|
|
1
|
+
export{isTranslationRegistered,registerTranslation}from"./translation.js";export{default as Badge}from"./Badge.js";export{default as Button}from"./Button.js";export{default as Card}from"./Card.js";export{default as Input}from"./Input.js";export{default as Icon}from"./Icon.js";export{default as CommandMenu}from"./CommandMenu.js";export{default as CommandMenuAction}from"./CommandMenuAction.js";export{default as Select}from"./Select.js";export{default as Stack}from"./Stack.js";export{default as Spinner}from"./Spinner.js";export{default as Table}from"./Table.js";export{default as VisuallyHidden}from"./VisuallyHidden.js";export{default as Textarea}from"./Textarea.js";export{C as Calendar}from"./Calendar-loNMUV5l.js";export{default as DatePicker}from"./DatePicker.js";export{default as Checkbox}from"./Checkbox.js";export{default as Tooltip}from"./Tooltip.js";export{default as Fieldset}from"./Fieldset.js";export{default as Radio}from"./Radio.js";export{default as Header}from"./Header.js";export{default as Message}from"./Message.js";export{default as NavGroup}from"./NavGroup.js";export{default as NavItem}from"./NavItem.js";export{default as Navigation}from"./Navigation.js";export{default as Layout}from"./Layout.js";export{default as EmptyState}from"./EmptyState.js";export{default as Banner}from"./Banner.js";export{default as Avatar}from"./Avatar.js";export{default as ProgressBar}from"./ProgressBar.js";export{P as Popout}from"./Popout-C5zTBGWo.js";export{default as Dropdown}from"./Dropdown.js";export{default as DropdownItem}from"./DropdownItem.js";export{default as DropdownGroup}from"./DropdownGroup.js";export{default as TabGroup}from"./TabGroup.js";export{default as Tab}from"./Tab.js";export{default as TabPanel}from"./TabPanel.js";export{default as Toggle}from"./Toggle.js";export{default as Modal}from"./Modal.js";export{default as Skeleton}from"./Skeleton.js";export{default as Toast}from"./Toast.js";export{default as ToastGroup}from"./ToastGroup.js";export{default as Divider}from"./Divider.js";export{default as Qrcode}from"./Qrcode.js";export{default as Drawer}from"./Drawer.js";export{N as NavToggle}from"./NavToggle-BW4ie2pA.js";export{default as Range}from"./Range.js";export{default as ButtonGroup}from"./ButtonGroup.js";export{default as Notification}from"./Notification.js";export{default as NotificationGroup}from"./NotificationGroup.js";export{default as TopBar}from"./TopBar.js";export{default as Footer}from"./Footer.js";export{default as Tag}from"./Tag.js";export{default as TagGroup}from"./TagGroup.js";export{default as SegmentedControl}from"./SegmentedControl.js";export{default as SegmentedControlItem}from"./SegmentedControlItem.js";import"./en-us.js";import"./localization.js";import"./localization2.js";import"./localization3.js";import"./localization4.js";import"./localization5.js";import"./localization6.js";import"./localization7.js";import"./localization8.js";import"./localization9.js";import"./custom-element-CDWT-yC_.js";import"./property-DeTTNf1t.js";import"./Component-BuB0QgQM.js";import"./ref-BYkj-TPb.js";import"./directive-DQ0jBES2.js";import"./EventController-BG-WpaBb.js";import"./LightDomController-BtyFuJKD.js";import"./cond-Cuc_PMkN.js";import"./FocusableMixin-DriuCNli.js";import"./InputMixin-B-nPfhjc.js";import"./SlotController-BL-tOh6b.js";import"./query-hiZs21fO.js";import"./if-defined-C2kZHWU2.js";import"./class-map-BQZJmA_8.js";import"./style-map-VR90KNpY.js";import"./FormAssociatedMixin-DXVeQVgN.js";import"./FormDataController-OUt5L5uC.js";import"./events-Bv6wNHwJ.js";import"./TextField-CmHW8rL5.js";import"./AutocompleteMixin-Dk_gVU09.js";import"./TextSelectableMixin-B_mtmFv0.js";import"./SizeMixin-DW6qUBEN.js";import"./FormField-Cl7HHI9A.js";import"./DirectionController-DiJ1Su1I.js";import"./state-BFYKuryf.js";import"./IconManager.js";import"./observe-D0n0zOfU.js";import"./collection-CJHuUy_1.js";import"./number-Dg2vCfGd.js";import"./LightDismissController-BBolVMtn.js";import"./ShortcutController-nMRUu6ns.js";import"./tinykeys.module-_6MZt7MP.js";import"./KeyboardController.js";import"./SelectEvent.js";import"./LocalizeController.js";import"./dates-lbaNvUdr.js";import"./DateSelectEvent.js";import"./interface-close-small-CnpAFMO3.js";import"./date-adapter.js";import"./interface-checked-small-BtICPEsp.js";import"./positioning-D0xRzCXq.js";import"./fsm-Bq5jMQrK.js";import"./LightSlotController-BDkcldj-.js";import"./DropdownItem-CPeMIqN8.js";import"./Sticky--4fNQ3K3.js";import"./ScrollbarController-C5CMxfb3.js";import"./ModalController.js";import"./NotificationMixin-BMymOlRC.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const t=["top","right","bottom","left"],e=["start","end"],n=t.reduce(((t,n)=>t.concat(n,n+"-"+e[0],n+"-"+e[1])),[]),o=Math.min,i=Math.max,r=Math.round,l=Math.floor,c=t=>({x:t,y:t}),s={left:"right",right:"left",bottom:"top",top:"bottom"},a={start:"end",end:"start"};function f(t,e,n){return i(t,o(e,n))}function u(t,e){return"function"==typeof t?t(e):t}function d(t){return t.split("-")[0]}function m(t){return t.split("-")[1]}function h(t){return"x"===t?"y":"x"}function p(t){return"y"===t?"height":"width"}function g(t){return["top","bottom"].includes(d(t))?"y":"x"}function y(t){return h(g(t))}function w(t,e,n){void 0===n&&(n=!1);const o=m(t),i=y(t),r=p(i);let l="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(l=v(l)),[l,v(l)]}function x(t){return t.replace(/start|end/g,(t=>a[t]))}function v(t){return t.replace(/left|right|bottom|top/g,(t=>s[t]))}function b(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function R(t,e,n){let{reference:o,floating:i}=t;const r=g(e),l=y(e),c=p(l),s=d(e),a="y"===r,f=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,h=o[c]/2-i[c]/2;let w;switch(s){case"top":w={x:f,y:o.y-i.height};break;case"bottom":w={x:f,y:o.y+o.height};break;case"right":w={x:o.x+o.width,y:u};break;case"left":w={x:o.x-i.width,y:u};break;default:w={x:o.x,y:o.y}}switch(m(e)){case"start":w[l]-=h*(n&&a?-1:1);break;case"end":w[l]+=h*(n&&a?-1:1)}return w}async function T(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:l,elements:c,strategy:s}=t,{boundary:a="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:m=!1,padding:h=0}=u(e,t),p=function(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}}(h),g=c[m?"floating"===d?"reference":"floating":d],y=b(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(g)))||n?g:g.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(c.floating)),boundary:a,rootBoundary:f,strategy:s})),w="floating"===d?{x:o,y:i,width:l.floating.width,height:l.floating.height}:l.reference,x=await(null==r.getOffsetParent?void 0:r.getOffsetParent(c.floating)),v=await(null==r.isElement?void 0:r.isElement(x))&&await(null==r.getScale?void 0:r.getScale(x))||{x:1,y:1},R=b(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:x,strategy:s}):w);return{top:(y.top-R.top+p.top)/v.y,bottom:(R.bottom-y.bottom+p.bottom)/v.y,left:(y.left-R.left+p.left)/v.x,right:(R.right-y.right+p.right)/v.x}}function L(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function A(e){return t.some((t=>e[t]>=0))}function E(){return"undefined"!=typeof window}function k(t){return O(t)?(t.nodeName||"").toLowerCase():"#document"}function D(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function P(t){var e;return null==(e=(O(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function O(t){return!!E()&&(t instanceof Node||t instanceof D(t).Node)}function S(t){return!!E()&&(t instanceof Element||t instanceof D(t).Element)}function C(t){return!!E()&&(t instanceof HTMLElement||t instanceof D(t).HTMLElement)}function F(t){return!(!E()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof D(t).ShadowRoot)}function H(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=N(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function B(t){return["table","td","th"].includes(k(t))}function W(t){return[":popover-open",":modal"].some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function V(t){const e=M(),n=S(t)?N(t):t;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function M(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function z(t){return["html","body","#document"].includes(k(t))}function N(t){return D(t).getComputedStyle(t)}function $(t){return S(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function I(t){if("html"===k(t))return t;const e=t.assignedSlot||t.parentNode||F(t)&&t.host||P(t);return F(e)?e.host:e}function j(t){const e=I(t);return z(e)?t.ownerDocument?t.ownerDocument.body:t.body:C(e)&&H(e)?e:j(e)}function q(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=j(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),l=D(i);if(r){const t=X(l);return e.concat(l,l.visualViewport||[],H(i)?i:[],t&&n?q(t):[])}return e.concat(i,q(i,[],n))}function X(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Y(t){const e=N(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=C(t),l=i?t.offsetWidth:n,c=i?t.offsetHeight:o,s=r(n)!==l||r(o)!==c;return s&&(n=l,o=c),{width:n,height:o,$:s}}function _(t){return S(t)?t:t.contextElement}function G(t){const e=_(t);if(!C(e))return c(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:l}=Y(e);let s=(l?r(n.width):n.width)/o,a=(l?r(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const J=c(0);function K(t){const e=D(t);return M()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:J}function Q(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=_(t);let l=c(1);e&&(o?S(o)&&(l=G(o)):l=G(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==D(t))&&e}(r,n,o)?K(r):c(0);let a=(i.left+s.x)/l.x,f=(i.top+s.y)/l.y,u=i.width/l.x,d=i.height/l.y;if(r){const t=D(r),e=o&&S(o)?D(o):o;let n=t,i=X(n);for(;i&&o&&e!==n;){const t=G(i),e=i.getBoundingClientRect(),o=N(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,l=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;a*=t.x,f*=t.y,u*=t.x,d*=t.y,a+=r,f+=l,n=D(i),i=X(n)}}return b({width:u,height:d,x:a,y:f})}function U(t,e){const n=$(t).scrollLeft;return e?e.left+n:Q(P(t)).left+n}function Z(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=D(t),o=P(t),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,c=0,s=0;if(i){r=i.width,l=i.height;const t=M();(!t||t&&"fixed"===e)&&(c=i.offsetLeft,s=i.offsetTop)}return{width:r,height:l,x:c,y:s}}(t,n);else if("document"===e)o=function(t){const e=P(t),n=$(t),o=t.ownerDocument.body,r=i(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),l=i(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let c=-n.scrollLeft+U(t);const s=-n.scrollTop;return"rtl"===N(o).direction&&(c+=i(e.clientWidth,o.clientWidth)-r),{width:r,height:l,x:c,y:s}}(P(t));else if(S(e))o=function(t,e){const n=Q(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=C(t)?G(t):c(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else{const n=K(t);o={...e,x:e.x-n.x,y:e.y-n.y}}return b(o)}function tt(t,e){const n=I(t);return!(n===e||!S(n)||z(n))&&("fixed"===N(n).position||tt(n,e))}function et(t,e,n){const o=C(e),i=P(e),r="fixed"===n,l=Q(t,!0,r,e);let s={scrollLeft:0,scrollTop:0};const a=c(0);if(o||!o&&!r)if(("body"!==k(e)||H(i))&&(s=$(e)),o){const t=Q(e,!0,r,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&(a.x=U(i));let f=0,u=0;if(i&&!o&&!r){const t=i.getBoundingClientRect();u=t.top+s.scrollTop,f=t.left+s.scrollLeft-U(i,t)}return{x:l.left+s.scrollLeft-a.x-f,y:l.top+s.scrollTop-a.y-u,width:l.width,height:l.height}}function nt(t){return"static"===N(t).position}function ot(t,e){if(!C(t)||"fixed"===N(t).position)return null;if(e)return e(t);let n=t.offsetParent;return P(t)===n&&(n=n.ownerDocument.body),n}function it(t,e){const n=D(t);if(W(t))return n;if(!C(t)){let e=I(t);for(;e&&!z(e);){if(S(e)&&!nt(e))return e;e=I(e)}return n}let o=ot(t,e);for(;o&&B(o)&&nt(o);)o=ot(o,e);return o&&z(o)&&nt(o)&&!V(o)?n:o||function(t){let e=I(t);for(;C(e)&&!z(e);){if(V(e))return e;if(W(e))return null;e=I(e)}return null}(t)||n}const rt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,l=P(o),s=!!e&&W(e.floating);if(o===l||s&&r)return n;let a={scrollLeft:0,scrollTop:0},f=c(1);const u=c(0),d=C(o);if((d||!d&&!r)&&(("body"!==k(o)||H(l))&&(a=$(o)),C(o))){const t=Q(o);f=G(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-a.scrollLeft*f.x+u.x,y:n.y*f.y-a.scrollTop*f.y+u.y}},getDocumentElement:P,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:r,strategy:l}=t;const c=[..."clippingAncestors"===n?W(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=q(t,[],!1).filter((t=>S(t)&&"body"!==k(t))),i=null;const r="fixed"===N(t).position;let l=r?I(t):t;for(;S(l)&&!z(l);){const e=N(l),n=V(l);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&["absolute","fixed"].includes(i.position)||H(l)&&!n&&tt(t,l))?o=o.filter((t=>t!==l)):i=e,l=I(l)}return e.set(t,o),o}(e,this._c):[].concat(n),r],s=c[0],a=c.reduce(((t,n)=>{const r=Z(e,n,l);return t.top=i(r.top,t.top),t.right=o(r.right,t.right),t.bottom=o(r.bottom,t.bottom),t.left=i(r.left,t.left),t}),Z(e,s,l));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:it,getElementRects:async function(t){const e=this.getOffsetParent||it,n=this.getDimensions,o=await n(t.floating);return{reference:et(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=Y(t);return{width:e,height:n}},getScale:G,isElement:S,isRTL:function(t){return"rtl"===N(t).direction}};function lt(t,e,n,r){void 0===r&&(r={});const{ancestorScroll:c=!0,ancestorResize:s=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:f="function"==typeof IntersectionObserver,animationFrame:u=!1}=r,d=_(t),m=c||s?[...d?q(d):[],...q(e)]:[];m.forEach((t=>{c&&t.addEventListener("scroll",n,{passive:!0}),s&&t.addEventListener("resize",n)}));const h=d&&f?function(t,e){let n,r=null;const c=P(t);function s(){var t;clearTimeout(n),null==(t=r)||t.disconnect(),r=null}return function a(f,u){void 0===f&&(f=!1),void 0===u&&(u=1),s();const{left:d,top:m,width:h,height:p}=t.getBoundingClientRect();if(f||e(),!h||!p)return;const g={rootMargin:-l(m)+"px "+-l(c.clientWidth-(d+h))+"px "+-l(c.clientHeight-(m+p))+"px "+-l(d)+"px",threshold:i(0,o(1,u))||1};let y=!0;function w(t){const e=t[0].intersectionRatio;if(e!==u){if(!y)return a();e?a(!1,e):n=setTimeout((()=>{a(!1,1e-7)}),1e3)}y=!1}try{r=new IntersectionObserver(w,{...g,root:c.ownerDocument})}catch(t){r=new IntersectionObserver(w,g)}r.observe(t)}(!0),s}(d,n):null;let p,g=-1,y=null;a&&(y=new ResizeObserver((t=>{let[o]=t;o&&o.target===d&&y&&(y.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame((()=>{var t;null==(t=y)||t.observe(e)}))),n()})),d&&!u&&y.observe(d),y.observe(e));let w=u?Q(t):null;return u&&function e(){const o=Q(t);!w||o.x===w.x&&o.y===w.y&&o.width===w.width&&o.height===w.height||n();w=o,p=requestAnimationFrame(e)}(),n(),()=>{var t;m.forEach((t=>{c&&t.removeEventListener("scroll",n),s&&t.removeEventListener("resize",n)})),null==h||h(),null==(t=y)||t.disconnect(),y=null,u&&cancelAnimationFrame(p)}}const ct=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:l,middlewareData:c}=e,s=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),l=d(n),c=m(n),s="y"===g(n),a=["left","top"].includes(l)?-1:1,f=r&&s?-1:1,h=u(e,t);let{mainAxis:p,crossAxis:y,alignmentAxis:w}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&"number"==typeof w&&(y="end"===c?-1*w:w),s?{x:y*f,y:p*a}:{x:p*a,y:y*f}}(e,t);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(o=c.arrow)&&o.alignmentOffset?{}:{x:i+s.x,y:r+s.y,data:{...s,placement:l}}}}},st=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var o,i,r;const{rects:l,middlewareData:c,placement:s,platform:a,elements:f}=e,{crossAxis:h=!1,alignment:p,allowedPlacements:g=n,autoAlignment:y=!0,...v}=u(t,e),b=void 0!==p||g===n?function(t,e,n){return(t?[...n.filter((e=>m(e)===t)),...n.filter((e=>m(e)!==t))]:n.filter((t=>d(t)===t))).filter((n=>!t||m(n)===t||!!e&&x(n)!==n))}(p||null,y,g):g,R=await T(e,v),L=(null==(o=c.autoPlacement)?void 0:o.index)||0,A=b[L];if(null==A)return{};const E=w(A,l,await(null==a.isRTL?void 0:a.isRTL(f.floating)));if(s!==A)return{reset:{placement:b[0]}};const k=[R[d(A)],R[E[0]],R[E[1]]],D=[...(null==(i=c.autoPlacement)?void 0:i.overflows)||[],{placement:A,overflows:k}],P=b[L+1];if(P)return{data:{index:L+1,overflows:D},reset:{placement:P}};const O=D.map((t=>{const e=m(t.placement);return[t.placement,e&&h?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1])),S=(null==(r=O.filter((t=>t[2].slice(0,m(t[0])?2:3).every((t=>t<=0))))[0])?void 0:r[0])||O[0][0];return S!==s?{data:{index:L+1,overflows:D},reset:{placement:S}}:{}}}},at=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:l=!1,limiter:c={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...s}=u(t,e),a={x:n,y:o},m=await T(e,s),p=g(d(i)),y=h(p);let w=a[y],x=a[p];if(r){const t="y"===y?"bottom":"right";w=f(w+m["y"===y?"top":"left"],w,w-m[t])}if(l){const t="y"===p?"bottom":"right";x=f(x+m["y"===p?"top":"left"],x,x-m[t])}const v=c.fn({...e,[y]:w,[p]:x});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[y]:r,[p]:l}}}}}},ft=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:l,initialPlacement:c,platform:s,elements:a}=e,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:R=!0,...L}=u(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const A=d(i),E=g(c),k=d(c)===c,D=await(null==s.isRTL?void 0:s.isRTL(a.floating)),P=p||(k||!R?[v(c)]:function(t){const e=v(t);return[x(t),e,x(e)]}(c)),O="none"!==b;!p&&O&&P.push(...function(t,e,n,o){const i=m(t);let r=function(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],l=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:l;default:return[]}}(d(t),"start"===n,o);return i&&(r=r.map((t=>t+"-"+i)),e&&(r=r.concat(r.map(x)))),r}(c,R,b,D));const S=[c,...P],C=await T(e,L),F=[];let H=(null==(o=r.flip)?void 0:o.overflows)||[];if(f&&F.push(C[A]),h){const t=w(i,l,D);F.push(C[t[0]],C[t[1]])}if(H=[...H,{placement:i,overflows:F}],!F.every((t=>t<=0))){var B,W;const t=((null==(B=r.flip)?void 0:B.index)||0)+1,e=S[t];if(e)return{data:{index:t,overflows:H},reset:{placement:e}};let n=null==(W=H.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:W.placement;if(!n)switch(y){case"bestFit":{var V;const t=null==(V=H.filter((t=>{if(O){const e=g(t.placement);return e===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:V[0];t&&(n=t);break}case"initialPlacement":n=c}if(i!==n)return{reset:{placement:n}}}return{}}}},ut=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=u(t,e);switch(o){case"referenceHidden":{const t=L(await T(e,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:A(t)}}}case"escaped":{const t=L(await T(e,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:A(t)}}}default:return{}}}}},dt=(t,e,n)=>{const o=new Map,i={platform:rt,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,c=r.filter(Boolean),s=await(null==l.isRTL?void 0:l.isRTL(e));let a=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=R(a,o,s),d=o,m={},h=0;for(let n=0;n<c.length;n++){const{name:r,fn:p}=c[n],{x:g,y,data:w,reset:x}=await p({x:f,y:u,initialPlacement:o,placement:d,strategy:i,middlewareData:m,rects:a,platform:l,elements:{reference:t,floating:e}});f=null!=g?g:f,u=null!=y?y:u,m={...m,[r]:{...m[r],...w}},x&&h<=50&&(h++,"object"==typeof x&&(x.placement&&(d=x.placement),x.rects&&(a=!0===x.rects?await l.getElementRects({reference:t,floating:e,strategy:i}):x.rects),({x:f,y:u}=R(a,d,s))),n=-1)}return{x:f,y:u,placement:d,strategy:i,middlewareData:m}})(t,e,{...i,platform:r})},mt={"inline-start-start":"left-start","inline-start-end":"left-end","inline-end-start":"right-start","inline-end-end":"right-end","block-start-start":"top-start","block-start-end":"top-end","block-end-start":"bottom-start","block-end-end":"bottom-end"},ht={"inline-start-start":"right-start","inline-start-end":"right-end","inline-end-start":"left-start","inline-end-end":"left-end","block-start-start":"top-start","block-start-end":"top-end","block-end-start":"bottom-start","block-end-end":"bottom-end"},pt={"block-end":"bottom","block-start":"top","inline-start":"left","inline-end":"right"};function gt(t,e,n){if(null!=e&&null!=n){const o=`${t}-${e}`;return"ltr"===n?mt[o]:ht[o]}return pt[t]}export{st as a,lt as b,dt as c,ft as f,ut as h,gt as l,ct as o,at as s};
|
|
2
|
+
//# sourceMappingURL=positioning-D0xRzCXq.js.map
|