@plainsheet/core 0.5.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/LICENSE +22 -0
- package/README.md +70 -0
- package/dist/animation/animation.d.ts +20 -0
- package/dist/animation/animation.d.ts.map +1 -0
- package/dist/animation/animation.type.d.ts +6 -0
- package/dist/animation/animation.type.d.ts.map +1 -0
- package/dist/bottom-sheet.d.ts +5 -0
- package/dist/bottom-sheet.d.ts.map +1 -0
- package/dist/calculator/index.d.ts +2 -0
- package/dist/calculator/index.d.ts.map +1 -0
- package/dist/calculator/position-calculator.d.ts +24 -0
- package/dist/calculator/position-calculator.d.ts.map +1 -0
- package/dist/calculator/position-calculator.type.d.ts +6 -0
- package/dist/calculator/position-calculator.type.d.ts.map +1 -0
- package/dist/class-names/class-names.d.ts +43 -0
- package/dist/class-names/class-names.d.ts.map +1 -0
- package/dist/class-names/index.d.ts +3 -0
- package/dist/class-names/index.d.ts.map +1 -0
- package/dist/class-names/selectors.d.ts +4 -0
- package/dist/class-names/selectors.d.ts.map +1 -0
- package/dist/event-handlers/dragging-handler.d.ts +10 -0
- package/dist/event-handlers/dragging-handler.d.ts.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/initializer/bottom-sheet-defaults.d.ts +5 -0
- package/dist/initializer/bottom-sheet-defaults.d.ts.map +1 -0
- package/dist/initializer/bottom-sheet-initializer.d.ts +37 -0
- package/dist/initializer/bottom-sheet-initializer.d.ts.map +1 -0
- package/dist/initializer/bottom-sheet-placeholder.d.ts +7 -0
- package/dist/initializer/bottom-sheet-placeholder.d.ts.map +1 -0
- package/dist/initializer/bottom-sheet-props-initializer.d.ts +9 -0
- package/dist/initializer/bottom-sheet-props-initializer.d.ts.map +1 -0
- package/dist/initializer/index.d.ts +3 -0
- package/dist/initializer/index.d.ts.map +1 -0
- package/dist/plainsheet-core.cjs.js +2 -0
- package/dist/plainsheet-core.es.js +1176 -0
- package/dist/plainsheet-core.umd.js +3 -0
- package/dist/types/bottom-sheet-props.type.d.ts +84 -0
- package/dist/types/bottom-sheet-props.type.d.ts.map +1 -0
- package/dist/types/bottom-sheet-state.type.d.ts +16 -0
- package/dist/types/bottom-sheet-state.type.d.ts.map +1 -0
- package/dist/types/bottom-sheet.type.d.ts +61 -0
- package/dist/types/bottom-sheet.type.d.ts.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/animation/animation-frame.d.ts +18 -0
- package/dist/utils/animation/animation-frame.d.ts.map +1 -0
- package/dist/utils/animation/animation.type.d.ts +23 -0
- package/dist/utils/animation/animation.type.d.ts.map +1 -0
- package/dist/utils/animation/common-animations.d.ts +9 -0
- package/dist/utils/animation/common-animations.d.ts.map +1 -0
- package/dist/utils/animation/cubic-bezier.d.ts +5 -0
- package/dist/utils/animation/cubic-bezier.d.ts.map +1 -0
- package/dist/utils/animation/index.d.ts +2 -0
- package/dist/utils/animation/index.d.ts.map +1 -0
- package/dist/utils/animation/linear.d.ts +2 -0
- package/dist/utils/animation/linear.d.ts.map +1 -0
- package/dist/utils/dom/class-names.d.ts +9 -0
- package/dist/utils/dom/class-names.d.ts.map +1 -0
- package/dist/utils/dom/element.d.ts +2 -0
- package/dist/utils/dom/element.d.ts.map +1 -0
- package/dist/utils/dom/focus.d.ts +3 -0
- package/dist/utils/dom/focus.d.ts.map +1 -0
- package/dist/utils/dom/transform.d.ts +11 -0
- package/dist/utils/dom/transform.d.ts.map +1 -0
- package/dist/utils/dom/translate.d.ts +7 -0
- package/dist/utils/dom/translate.d.ts.map +1 -0
- package/dist/utils/dom/visibility.d.ts +3 -0
- package/dist/utils/dom/visibility.d.ts.map +1 -0
- package/dist/utils/event-listeners/EventPhase.d.ts +9 -0
- package/dist/utils/event-listeners/EventPhase.d.ts.map +1 -0
- package/dist/utils/event-listeners/TabEventListener.d.ts +32 -0
- package/dist/utils/event-listeners/TabEventListener.d.ts.map +1 -0
- package/dist/utils/event-listeners/index.d.ts +2 -0
- package/dist/utils/event-listeners/index.d.ts.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/log/log.d.ts +6 -0
- package/dist/utils/log/log.d.ts.map +1 -0
- package/dist/utils/math/min-max.d.ts +5 -0
- package/dist/utils/math/min-max.d.ts.map +1 -0
- package/dist/utils/math/unit.d.ts +3 -0
- package/dist/utils/math/unit.d.ts.map +1 -0
- package/dist/utils/proxy/observe.d.ts +3 -0
- package/dist/utils/proxy/observe.d.ts.map +1 -0
- package/dist/utils/types/css-attribute.d.ts +12 -0
- package/dist/utils/types/css-attribute.d.ts.map +1 -0
- package/dist/utils/types/exists.d.ts +2 -0
- package/dist/utils/types/exists.d.ts.map +1 -0
- package/dist/utils/types/is-boolean.d.ts +2 -0
- package/dist/utils/types/is-boolean.d.ts.map +1 -0
- package/dist/utils/types/is-element.d.ts +3 -0
- package/dist/utils/types/is-element.d.ts.map +1 -0
- package/dist/utils/types/is-number.d.ts +2 -0
- package/dist/utils/types/is-number.d.ts.map +1 -0
- package/dist/utils/types/is-percent.d.ts +2 -0
- package/dist/utils/types/is-percent.d.ts.map +1 -0
- package/dist/utils/types/is-string.d.ts +2 -0
- package/dist/utils/types/is-string.d.ts.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.pbs-root{position:fixed;left:0;bottom:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;width:100%;height:fit-content;max-height:100vh;z-index:2}.pbs-dialog-reset{background-color:transparent;color:inherit;border:none;outline:none;padding:0;margin:0}.pbs-backdrop{position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;background-color:transparent;z-index:1;transition:background-color .2s ease-out}.pbs-backdrop.hidden{display:none}.pbs-backdrop.open{background-color:#454545b3}.pbs-container{--pbs-container-background-color: rgb(240, 240, 240);background-color:var(--pbs-container-background-color);position:relative;display:none;flex-direction:column;align-items:center;justify-content:flex-start;width:92%;height:fit-content;max-height:100vh;border-radius:10px 10px 0 0}.pbs-container.open{display:flex}.pbs-container .pbs-gap-filler{position:absolute;bottom:calc(-100vh + .5px);left:0;background-color:var(--pbs-container-background-color);content:"";width:100%;height:100vh}.pbs-handle{position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:30px;cursor:pointer}.pbs-handle.hidden{display:none}.pbs-button-reset{background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;border:none}button:focus.pbs-button-reset{outline:none}.pbs-handle-bar{background-color:#a8a8a8;position:relative;width:12%;height:7px;border-radius:12px}.pbs-handle-bar.hidden{display:none}.pbs-content-wrapper{position:relative;width:100%;height:fit-content;max-height:100%;overflow-y:scroll}.pbs-content-wrapper::-webkit-scrollbar{display:none}.example{-ms-overflow-style:none;scrollbar-width:none}')),document.head.appendChild(e)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}})();
|
|
2
|
+
(function(f,O){typeof exports=="object"&&typeof module<"u"?O(exports):typeof define=="function"&&define.amd?define(["exports"],O):(f=typeof globalThis<"u"?globalThis:f||self,O(f.PlainBottomSheetCore={}))})(this,function(f){"use strict";var an=Object.defineProperty;var cn=(f,O,T)=>O in f?an(f,O,{enumerable:!0,configurable:!0,writable:!0,value:T}):f[O]=T;var $=(f,O,T)=>(cn(f,typeof O!="symbol"?O+"":O,T),T);var O=document.createElement("style");O.textContent=`.pbs-root{position:fixed;left:0;bottom:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;width:100%;height:fit-content;max-height:100vh;z-index:2}.pbs-dialog-reset{background-color:transparent;color:inherit;border:none;outline:none;padding:0;margin:0}.pbs-backdrop{position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;background-color:transparent;z-index:1;transition:background-color .2s ease-out}.pbs-backdrop.hidden{display:none}.pbs-backdrop.open{background-color:#454545b3}.pbs-container{--pbs-container-background-color: rgb(240, 240, 240);background-color:var(--pbs-container-background-color);position:relative;display:none;flex-direction:column;align-items:center;justify-content:flex-start;width:92%;height:fit-content;max-height:100vh;border-radius:10px 10px 0 0}.pbs-container.open{display:flex}.pbs-container .pbs-gap-filler{position:absolute;bottom:calc(-100vh + .5px);left:0;background-color:var(--pbs-container-background-color);content:"";width:100%;height:100vh}.pbs-handle{position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:30px;cursor:pointer}.pbs-handle.hidden{display:none}.pbs-button-reset{background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;border:none}button:focus.pbs-button-reset{outline:none}.pbs-handle-bar{background-color:#a8a8a8;position:relative;width:12%;height:7px;border-radius:12px}.pbs-handle-bar.hidden{display:none}.pbs-content-wrapper{position:relative;width:100%;height:fit-content;max-height:100%;overflow-y:scroll}.pbs-content-wrapper::-webkit-scrollbar{display:none}.example{-ms-overflow-style:none;scrollbar-width:none}
|
|
3
|
+
`,document.head.appendChild(O);function T(t){return typeof t=="string"}function Dt(t,n){return t.classList.contains(z(n))}function X(t,n){t.classList.add(z(n))}function nt(t,n){t.classList.remove(z(n))}function G(t,n,e){T(e)&&(T(n)&&nt(t,n),X(t,e))}function z(t){return T(t)?t.trim().replace(/\./g,""):""}function R(t){return t.map(n=>z(n)).filter(Boolean).join(" ")}function Bt(t){return t.map(n=>n==null?void 0:n.trim()).filter(Boolean).map(n=>`.${n}`).join(" ")}const dt="open",ft="hidden";function et(t,n){const e=n;if(Array.isArray(t)){t.forEach(r=>{K(r,e),r.setAttribute("aria-modal",e?"true":"false")});return}K(t,e),t.setAttribute("aria-modal",e?"true":"false")}function K(t,n){n?(X(t,dt),nt(t,ft)):(X(t,ft),nt(t,dt))}function ht(t){return t instanceof HTMLElement}function k(t){return typeof t=="number"&&!Number.isNaN(t)}function xt(t){ht(t)&&t.focus()}function Yt(t){if(!ht(t)||t.offsetParent===null||"disabled"in t&&t.disabled)return!1;const e=t.getAttribute("tabindex"),r=k(e)?parseInt(e,10):-1,o=["INPUT","BUTTON","SELECT","TEXTAREA","A","AREA","IFRAME"].includes(t.tagName),c=t instanceof HTMLAnchorElement&&t.href!==""||t instanceof HTMLAreaElement&&t.href!=="";return o||c||r>-1}var C=(t=>(t.Backdrop="pbs-backdrop",t.Root="pbs-root",t.Container="pbs-container",t.GapFiller="pbs-gap-filler",t.Handle="pbs-handle",t.HandleBar="pbs-handle-bar",t.ContentWrapper="pbs-content-wrapper",t))(C||{}),q=(t=>(t.Button="pbs-button-reset",t.Dialog="pbs-dialog-reset",t))(q||{}),j=(t=>(t.Hidden="hidden",t))(j||{});function N(t,n,e){const r=document.createElement(t);return n.split(" ").forEach(o=>{X(r,o)}),T(e)&&r.setAttribute("data-testid",e),r}const It={CONTENTS_WRAPPER:Bt([C.Root,C.ContentWrapper])};function gt(t,n,e,r){switch(r){case"content-height":return n>=t?Tt(t,n,e):0;case"middle":return-(t/2-n);case"top":return-(t-n)+e;default:return 0}}function pt(t,n){const e=n<t,r=n>t;return{isUp:e,isDown:r,stayedSame:n===t}}function mt(t,n){return n<t?-(t-n):n-t}function J(t,n){return t>n?t-n:n-t}function Nt(t,n){const e=t<n,r=t>n;return{isUp:e,isDown:r,stayedSame:t===n}}function bt(t,n,e){const r=t==="above";return e.filter(i=>{const o=i*n.viewportHeight;return r?n.visibleHeight<o:n.visibleHeight>o})}function Tt(t,n,e){return-(t-n)+e}function Ct(t){return Number(t.replace("px",""))}function Q(t,...n){return Number(t.toFixed(...n))}function Et(t){const n=/(?<type>\w+)\((?<values>[^)]+)\)/g,e=[];let r;for(;(r=n.exec(t))!==null;){const i=r[1],o=r[2].split(",").map(c=>c.trim());e.push({type:i,values:o})}return e}function Pt(t){const n=t.style.transform,e=Et(n);return{transform:n,transformValues:e}}function wt(t,n){const e=t.find(r=>r.type.startsWith(n));return e||null}const rt="translate";function Y(t){const n=t.style.transform,e=Et(n),r=wt(e,rt);return yt(r??{type:rt,values:[]})}function Z(t,{x:n,y:e}){const{transform:r,transformValues:i}=Pt(t),o=wt(i,rt);if(o){const c=yt(o);t.style.transform=`translate(${n??c.x??0}px,${e??c.y??0}px)`;return}if(r){t.style.transform=`${r}, translate(${n??0}px,${e??0}px)`;return}t.style.transform=`translate(${n??0}px,${e??0}px)`}function yt(t){if(t.type!=="translate")throw new Error(`Could not get coordinates from ${t.type}, since is not translate.`);const n=t.values[0],e=t.values[1];return{x:Ct(n)??0,y:Ct(e)??0}}function ot(t){return t!=null}function vt(t,{min:n,max:e}){return ot(e)&&t>=e?e:ot(n)&&t<=n?n:t}const Mt=(t,n,e)=>{n instanceof HTMLElement&&!Dt(n,C.Handle)&&e.scrollTop>=1||(t.isDragging=!0)},_t=(t,n,e,r)=>i=>{r.startY=t.getCoordinates(i).y,r.containerStartTranslate=Y(n),r.originalDocumentOverflowY=document.body.style.overflowY,document.body.style.overflowY="hidden",e.onDragStart()},Ft=(t,n,e,r,i)=>o=>{Rt(o,t,e,r,i,n,e.marginTop)};function Rt(t,n,e,r,i,o,c){if(!r.isDragging||!k(r.startY))return;const h=n.getCoordinates(t).y,a=mt(r.startY,h),E=window.innerHeight,l=o.clientHeight,b=l-(r.containerStartTranslate.y+a);if(b>=E)return;const v=pt(r.startY,h);if(v.isUp&&!e.expandable&&b>=l)return;i.start(()=>{Z(o,{y:r.containerStartTranslate.y+a})},0);const s=E-c,S=l-r.containerStartTranslate.y;if(v.isUp){const H=s-S,L=s-b,A=vt(1-Q(L/H,2),{min:0,max:1});e.onDragMove(v,A)}else if(v.isDown){const H=vt(Q(1-b/S,2),{min:0,max:1});e.onDragMove(v,H)}}const Ut=(t,n,e,r,i,o,c)=>h=>{if(!r.isDragging||(r.isDragging=!1,document.body.style.overflowY=r.originalDocumentOverflowY,!k(r.startY)))return;e.onDragEnd();const a=r.startY,E=t.getCoordinates(h).y,l=Y(n).y,b=pt(a,E),v=window.innerHeight,s=n.clientHeight;if(b.isUp){const S=[...e.snapPoints].sort((A,w)=>A-w),H=s+-l;if(!e.expandable&&H>=s)return;for(const A of S){const w=A*window.innerHeight;if(H<=w){const F=J(H,w);c.translateContainer({startY:l,endY:l-F,animationFrame:i,bottomSheetContainer:n});return}}const L=Tt(v,s,e.marginTop);c.translateContainer({startY:l,endY:L,animationFrame:i,bottomSheetContainer:n})}else if(b.isDown){const S=[...e.snapPoints].sort((H,L)=>L-H);for(const H of S){const L=H*window.innerHeight,A=s+-l;if(A>=L){const w=J(A,L);c.translateContainer({startY:l,endY:l+w,animationFrame:i,bottomSheetContainer:n});return}}o()}};var P=(t=>(t[t.All=-1]="All",t[t.None=0]="None",t[t.Capture=1]="Capture",t[t.Target=2]="Target",t[t.Bubble=3]="Bubble",t))(P||{});function it(t){switch(t){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;default:return-1}}const Wt={eventPhase:P.All};class V{constructor(n){$(this,"currentTarget");this.currentTarget=n}addEventListeners({onStart:n,onStartOptions:e=Wt,onMove:r,onEnd:i}){this.addTouchEventListeners({onStart:n,onStartOptions:e,onMove:r,onEnd:i}),this.addMouseEventListeners({onStart:n,onStartOptions:e,onMove:r,onEnd:i})}addTouchEventListeners({onStart:n,onStartOptions:e,onMove:r,onEnd:i}){n&&this.currentTarget.addEventListener("touchstart",o=>{if(e.eventPhase===P.All){n(o);return}it(o.eventPhase)===e.eventPhase&&n(o)},{passive:!0}),r&&this.currentTarget.addEventListener("touchmove",r),i&&this.currentTarget.addEventListener("touchend",i)}addMouseEventListeners({onStart:n,onStartOptions:e,onMove:r,onEnd:i}){n&&this.currentTarget.addEventListener("mousedown",o=>{if(e.eventPhase===P.All){n(o);return}it(o.eventPhase)===e.eventPhase&&n(o)},{passive:!0}),r&&this.currentTarget.addEventListener("mousemove",r),i&&this.currentTarget.addEventListener("mouseup",o=>{i(o)})}removeEventListeners({onStart:n,onMove:e,onEnd:r}){n&&this.currentTarget.removeEventListener("touchstart",n),r&&this.currentTarget.removeEventListener("touchend",r),e&&this.currentTarget.removeEventListener("touchmove",e),n&&this.currentTarget.removeEventListener("mousedown",n),e&&this.currentTarget.removeEventListener("mousemove",e),r&&this.currentTarget.removeEventListener("mouseup",r)}getCoordinates(n){if(n.type==="touchstart"||n.type==="mousedown"){if("touches"in n)return{x:n.touches[0].clientX,y:n.touches[0].clientY};if(n instanceof MouseEvent)return{x:n.clientX,y:n.clientY}}if(n.type==="touchend"||n.type==="mouseup"||n.type==="mousemove"||n.type==="touchmove"){if("touches"in n)return{x:n.changedTouches[0].clientX,y:n.changedTouches[0].clientY};if(n instanceof MouseEvent)return{x:n.clientX,y:n.clientY}}return{x:0,y:0}}}function Gt(t,n){const e=jt(t);Vt(e),e.bottomSheetContainer.style.width=t.width;const r=document.createElement("div");r.innerHTML=t.content??"";const i=window.innerHeight;e.bottomSheetContainer.style.maxHeight=`${i}px`,e.bottomSheetContentWrapper.appendChild(r);const o=$t({bottomSheetElements:e,bottomSheetProps:t,options:n});return{elements:e,eventHandlers:o}}function jt(t){const n=N("dialog",R([C.Root,q.Dialog,t.rootClass]),C.Root);n.ariaLabel=t.ariaLabel;const e=N("section",R([C.Container,t.containerClass]),C.Container);t.containerBorderRadius&&(e.style.borderRadius=t.containerBorderRadius);const r=N("div",C.GapFiller,C.GapFiller),i=N("button",R([C.Handle,q.Button,t.shouldShowHandle?null:j.Hidden,t.handleClass]),C.Handle);i.setAttribute("type","button"),i.ariaLabel="bottom sheet close button";const o=N("span",R([C.HandleBar,t.shouldShowHandle?null:j.Hidden]),C.HandleBar),c=N("article",R([C.ContentWrapper,t.contentWrapperClass]),C.ContentWrapper),h=N("div",R([C.Backdrop,t.backdropClass,j.Hidden]),C.Backdrop);return t.backdropColor&&(h.style.backgroundColor=t.backdropColor),t.backDropTransition&&(h.style.transition=t.backDropTransition),{bottomSheetRoot:n,bottomSheetBackdrop:h,bottomSheetContainer:e,bottomSheetHandle:i,bottomSheetHandleBar:o,bottomSheetContentWrapper:c,bottomSheetContainerGapFiller:r}}function Vt({bottomSheetRoot:t,bottomSheetContainer:n,bottomSheetHandle:e,bottomSheetHandleBar:r,bottomSheetContentWrapper:i,bottomSheetContainerGapFiller:o}){t.appendChild(n),e.appendChild(r),n.appendChild(e),n.appendChild(i),n.appendChild(o)}function $t({bottomSheetElements:t,bottomSheetProps:n,options:e}){const{bottomSheetRoot:r,bottomSheetContainer:i,bottomSheetHandle:o,bottomSheetContainerGapFiller:c,bottomSheetContentWrapper:h}=t,{animationFrame:a}=e,E=new V(o),l=new V(h),b=new V(c),v=n.dragTriggers.reduce((m,D)=>{const x=r.querySelectorAll(D);if(!x.length)return m;const ut=Array.from(x).map(W=>W instanceof HTMLElement?new V(W):null).filter(W=>!!W);return[...m,...ut]},[]),s=new V(window),S=_t(s,i,n,e.draggingState),H=Ft(s,i,n,e.draggingState,a),L=Ut(s,i,n,e.draggingState,a,e.onClose,e.bottomSheetState);function A(m){m.target instanceof Element&&!r.contains(m.target)&&e.onClose()}function w(m){Mt(e.draggingState,m.target,t.bottomSheetContentWrapper)}function F(){n.draggable&&(E.addEventListeners({onStart:w}),v.forEach(m=>{m.addEventListeners({onStart:w,onStartOptions:{eventPhase:P.Target}})})),n.draggable&&n.backgroundDraggable&&(l.addEventListeners({onStart:w,onStartOptions:{eventPhase:P.Target}}),b.addEventListeners({onStart:w})),n.draggable&&s.addEventListeners({onStart:S,onMove:H,onEnd:L}),n.draggable&&window.document.addEventListener("keyup",m=>{m.key==="Escape"&&e.onClose()}),n.shouldCloseOnOutsideClick&&window.document.addEventListener("click",A),o.addEventListener("keyup",m=>{if(m.key==="ArrowUp"){e.moveUp();return}if(m.key==="ArrowDown"){e.moveDown();return}if(m.shiftKey&&m.key==="Tab"){const D=tt(t.bottomSheetContentWrapper);xt(D)}})}function tt(m){let D=[...Array.from(m.childNodes).reverse()];for(;D.length;){const x=D.shift();if(Yt(x))return x;x&&(D=[...D,...Array.from(x.childNodes).reverse()])}return null}function lt(){E.removeEventListeners({onStart:w}),l.removeEventListeners({onStart:w}),b.removeEventListeners({onStart:w}),v.forEach(m=>{m.removeEventListeners({onStart:w})}),s.removeEventListeners({onStart:S,onMove:H,onEnd:L}),window.removeEventListener("click",A)}return{attachEventListeners:F,clearEventListeners:lt}}class Xt{constructor(){$(this,"animationId");$(this,"isInProgress");$(this,"startedAt");this.animationId=null,this.isInProgress=!1,this.startedAt=null}start(n,e,r=!1){this.isInProgress=!0;const i=o=>{this.startedAt||(this.startedAt=o);const c=o-this.startedAt,a=e===0?1:Q(c/e,2),E=a>=1&&!r;n(a),E?this.stop():this.animationId=requestAnimationFrame(i)};this.animationId=requestAnimationFrame(i)}stop(){this.isInProgress=!1,this.startedAt=null,k(this.animationId)&&cancelAnimationFrame(this.animationId)}}function zt(t){const{startY:n,endY:e,bottomSheetContainer:r,animationFrame:i,onEnd:o,animationTimingFunction:c,animationDuration:h}=t,a=mt(n,e);i.stop();let E=!1;i.start(l=>{Z(r,{y:n+a*c(l)}),!E&&l>=1&&(o==null||o(),E=!0)},h)}const st=(t,n)=>e=>{zt({...e,animationTimingFunction:t,animationDuration:n})},M={TOP:"top",MIDDLE:"middle",CONTENT_HEIGHT:"content-height",CLOSED:"closed"};function Kt(t){return!(!k(t)||t>1||t<0)}function qt(t,n){const e={set(r,i,o,c){return n(i,o),Reflect.set(r,i,o,c)}};return new Proxy(t,e)}function Jt(...t){console.error(t)}const _={EASE:"ease",EASE_IN:"ease-in",EASE_OUT:"ease-out",EASE_IN_OUT:"ease-in-out",SPRING:"spring"};function Ht(t){for(const n of Object.values(_))if(n===t)return!0;return!1}function at(t){return!!(t instanceof Object&&"p1x"in t&&"p1y"in t&&"p2x"in t&&"p2y"in t&&k(t.p1x)&&k(t.p1y)&&k(t.p2x)&&k(t.p2y))}function U(t,n,e,r){return function(a){return h(o(a))};function o(a){let E=0,l=1,b=a,v;if(a===0||a===1)return a;for(;E<l;){if(v=c(b),Math.abs(v-a)<.001)return b;a>v?E=b:l=b,b=(l+E)/2}return b}function c(a){return 3*t*a*Math.pow(1-a,2)+3*e*Math.pow(a,2)*(1-a)+Math.pow(a,3)}function h(a){return 3*n*a*Math.pow(1-a,2)+3*r*Math.pow(a,2)*(1-a)+Math.pow(a,3)}}const Qt=U(.25,.1,.25,1),Zt=U(.42,0,1,1),Ot=U(.42,0,.58,1),At=U(.4,.1,.6,1),tn=U(.45,1.5,.55,1);function nn(t){switch(t){case _.EASE:return Qt;case _.EASE_IN:return Zt;case _.EASE_OUT:return Ot;case _.EASE_IN_OUT:return At;case _.SPRING:return tn;default:return At}}function Lt(t){return typeof t=="boolean"}const kt={ariaLabel:"Bottom sheet",content:"",defaultPosition:M.CONTENT_HEIGHT,marginTop:20,snapPoints:[],width:"92%",dragTriggers:[],beforeOpen:()=>{},afterOpen:()=>{},beforeClose:()=>{},afterClose:()=>{},onDragStart:()=>{},onDragMove:()=>{},onDragEnd:()=>{},expandable:!0,draggable:!0,backgroundDraggable:!0,shouldCloseOnOutsideClick:!0,shouldShowBackdrop:!0,shouldShowHandle:!0,backDropTransition:null,backdropColor:null,containerBorderRadius:null,rootClass:null,containerClass:null,handleClass:null,contentWrapperClass:null,backdropClass:null,draggingAnimationTimings:"ease-in-out",draggingAnimationDuration:180};function en(t){const n={...kt},e=Object.entries(t).reduce((i,o)=>{const[c,h]=o;return ot(h)&&(i[c]=h),i},{});return{...n,...e}}function ct(t){if(at(t)){const{p1x:n,p1y:e,p2x:r,p2y:i}=t;return U(n,e,r,i)}return Ht(t)?nn(t):Ot}function rn(t,n,e){function r(i,o){switch(i){case"content":T(o)&&(t.bottomSheetContentWrapper.innerHTML=o);break;case"width":T(o)&&(t.bottomSheetContainer.style.width=o);break;case"shouldShowHandle":Lt(o)||K(t.bottomSheetHandle,!1);break;case"shouldShowBackdrop":Lt(o)||K(t.bottomSheetBackdrop,!1);break;case"containerBorderRadius":T(o)&&(t.bottomSheetContainer.style.borderRadius=o);break;case"backdropColor":T(o)&&(t.bottomSheetBackdrop.style.backgroundColor=o);break;case"backDropTransition":T(o)&&(t.bottomSheetBackdrop.style.transition=o);break;case"rootClass":if(!T(o))return;G(t.bottomSheetRoot,e.rootClass,o);break;case"containerClass":if(!T(o))return;G(t.bottomSheetContainer,e.containerClass,o);break;case"handleClass":if(!T(o))return;G(t.bottomSheetHandle,e.handleClass,o);break;case"contentWrapperClass":if(!T(o))return;G(t.bottomSheetContentWrapper,e.contentWrapperClass,o);break;case"backdropClass":if(!T(o))return;G(t.bottomSheetBackdrop,e.backdropClass,o);break;case"draggingAnimationTimings":if(at(o)){const c=ct(o),h=st(c,e.draggingAnimationDuration);n.translateContainer=h}break;case"draggingAnimationDuration":if(k(o)){const c=ct(e.draggingAnimationTimings),h=st(c,o);n.translateContainer=h}break}}return r}function on(t){const n=en(t),e=ct(t.draggingAnimationTimings),i={isMounted:!1,translateContainer:st(e,n.draggingAnimationDuration)},o={startY:null,containerStartTranslate:{x:0,y:0},isDragging:!1,originalDocumentOverflowY:document.body.style.overflowY},c=new Xt,h={animationFrame:c,onClose:A,bottomSheetState:i,draggingState:o,snapTo:St,moveUp:ut,moveDown:W},{elements:a,eventHandlers:E}=Gt(n,h),l=qt(n,rn(a,i,n)),{bottomSheetBackdrop:b,bottomSheetRoot:v,bottomSheetContainer:s}=a,S=u=>{const d=u??window.document.body;d.appendChild(v),d.appendChild(b);const g=window.innerHeight;Z(s,{y:g}),E.attachEventListeners(),i.isMounted=!0},H=()=>{E.clearEventListeners(),Object.values(a).forEach(u=>{u.remove()}),i.isMounted=!1},L=()=>{var y;if(w()||Jt('Bottom Sheet is not mounted yet. call the "mount" method first.'),(y=t.beforeOpen)==null||y.call(t),F())return;l.shouldShowBackdrop&&et(b,!0),et([s],!0),Z(s,{y:s.clientHeight});const d=window.innerHeight,g=gt(d,s.clientHeight,l.marginTop,l.defaultPosition),p=Y(s).y;i.translateContainer({startY:p,endY:g,animationFrame:c,bottomSheetContainer:s,onEnd:t.afterOpen}),a.bottomSheetHandle.focus()};function A(){var g;if(tt())return;(g=t.beforeClose)==null||g.call(t);const u=Y(s).y,d=s.clientHeight;i.translateContainer({startY:u,endY:d,animationFrame:c,bottomSheetContainer:s,onEnd:()=>{var p;(p=t.afterClose)==null||p.call(t),et([b,s],!1)}})}function w(){return i.isMounted}function F(){const u=Y(s).y,d=window.innerHeight,g=s.clientHeight>=d?d:s.clientHeight;return u<g}function tt(){return!F()}function lt(){const u=Y(s).y,d=s.clientHeight,g=window.innerHeight;if(u<=5&&u>=-5)return M.CONTENT_HEIGHT;const p=d-u;if(p===g/2)return M.MIDDLE;const y=g-l.marginTop,B=10;return p<=y+B&&p>=y-B?M.TOP:M.CLOSED}function m(){return s.clientHeight}function D(u){const d=Y(s).y,p=s.clientHeight-d,y=window.innerHeight-u,B=Nt(p,y),I=J(p,y);i.translateContainer({startY:d,endY:d+(B.isUp?-I:I),animationFrame:c,bottomSheetContainer:s})}function x(u,{viewportHeight:d,visibleHeight:g}){let p=null;for(const y of u){const B=y*d,I=J(g,B);(p===null||I<p)&&(p=I)}return{minOffset:p}}function ut(){const u=[...l.snapPoints].reverse(),d=Y(s).y,g=s.clientHeight,p=g-d;if(!l.expandable&&p>=g)return;const y=window.innerHeight,B=bt("above",{visibleHeight:p,viewportHeight:y},u),{minOffset:I}=x(B,{visibleHeight:p,viewportHeight:y});if(I===null&&p<y-l.marginTop){i.translateContainer({startY:d,endY:gt(y,g,l.marginTop,"top"),animationFrame:c,bottomSheetContainer:s});return}k(I)&&i.translateContainer({startY:d,endY:d-I,animationFrame:c,bottomSheetContainer:s})}function W(){const u=Y(s).y,g=s.clientHeight-u;if(g<1)return;const p=window.innerHeight,y=bt("below",{visibleHeight:g,viewportHeight:p},l.snapPoints),{minOffset:B}=x(y,{visibleHeight:g,viewportHeight:p});k(B)&&i.translateContainer({startY:u,endY:u+B,animationFrame:c,bottomSheetContainer:s})}function St(u){const d=window.innerHeight;if(!Kt(u))return;const g=Q(d*u,2);D(g)}return{props:l,elements:a,mount:S,unmount:H,open:L,close:A,getIsMounted:w,getIsOpen:F,getIsClosed:tt,getPosition:lt,getHeight:m,moveTo:D,snapTo:St}}function sn(){return{elements:{bottomSheetRoot:void 0,bottomSheetBackdrop:void 0,bottomSheetContainer:void 0,bottomSheetHandle:void 0,bottomSheetHandleBar:void 0,bottomSheetContentWrapper:void 0,bottomSheetContainerGapFiller:void 0},mount:()=>{},unmount:()=>{},open:()=>{},close:()=>{},getIsMounted:()=>!1,getHeight:()=>0,getIsOpen:()=>!1,getIsClosed:()=>!0,getPosition:()=>M.CLOSED,moveTo:()=>{},snapTo:()=>{},props:{content:""}}}f.BOTTOM_SHEET_DEFAULT_PROPS=kt,f.BOTTOM_SHEET_POSITION=M,f.BOTTOM_SHEET_SELECTORS=It,f.COMMON_ANIMATION_KEYS=_,f.ClassNames=C,f.EventPhase=P,f.ResetClassNames=q,f.UtilClassNames=j,f.createBottomSheet=on,f.createPlaceholderBottomSheet=sn,f.eventPhaseToEnum=it,f.isAnimationTimingPoints=at,f.isCommonAnimationTimingsKey=Ht,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { CSSColor, CSSUnit } from '../utils/types/css-attribute';
|
|
2
|
+
import { AnimationTimingPoints, CommonAnimation } from '../utils/animation/animation.type';
|
|
3
|
+
import { DraggingDirection } from '../calculator/position-calculator.type';
|
|
4
|
+
|
|
5
|
+
export type RequiredBottomSheetProps = Required<BottomSheetProps>;
|
|
6
|
+
export interface BottomSheetProps {
|
|
7
|
+
ariaLabel?: string;
|
|
8
|
+
content: string;
|
|
9
|
+
width?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Space between the top of the bottom sheet and the viewport's top.
|
|
12
|
+
* defaults to 20
|
|
13
|
+
*/
|
|
14
|
+
marginTop?: number;
|
|
15
|
+
defaultPosition?: BottomSheetPosition;
|
|
16
|
+
shouldCloseOnOutsideClick?: boolean;
|
|
17
|
+
snapPoints?: SnapPoints;
|
|
18
|
+
/**
|
|
19
|
+
* If it is true, the bottom sheet can be dragged up above its content height.
|
|
20
|
+
* defaults to true
|
|
21
|
+
*/
|
|
22
|
+
expandable?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* If it is true, the bottom sheet can be dragged. Set false to use the bottom sheet as a blocking dialog.
|
|
25
|
+
* defaults to true
|
|
26
|
+
*/
|
|
27
|
+
draggable?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* If it is true, the content's background can be dragged.
|
|
30
|
+
* defaults to true
|
|
31
|
+
*/
|
|
32
|
+
backgroundDraggable?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Element selectors that will trigger dragging of the bottom sheet.
|
|
35
|
+
* By default, the background is draggable unless it is covered by the content.
|
|
36
|
+
*/
|
|
37
|
+
dragTriggers?: string[];
|
|
38
|
+
beforeOpen?: () => void;
|
|
39
|
+
afterOpen?: () => void;
|
|
40
|
+
beforeClose?: () => void;
|
|
41
|
+
afterClose?: () => void;
|
|
42
|
+
onDragStart?: () => void;
|
|
43
|
+
/**
|
|
44
|
+
* @param direction- Current direction based on where the pointer was when started dragging.
|
|
45
|
+
* @param progress- Rational number ranging from 0 to 1, inclusive.
|
|
46
|
+
* It represents how far the Bottom Sheet is dragged.
|
|
47
|
+
*/
|
|
48
|
+
onDragMove?: (direction: DraggingDirection, progress: number) => void;
|
|
49
|
+
onDragEnd?: () => void;
|
|
50
|
+
shouldShowHandle?: boolean;
|
|
51
|
+
shouldShowBackdrop?: boolean;
|
|
52
|
+
containerBorderRadius?: CSSUnit | null;
|
|
53
|
+
backdropColor?: CSSColor | string | null;
|
|
54
|
+
backDropTransition?: string | null;
|
|
55
|
+
rootClass?: string | null;
|
|
56
|
+
containerClass?: string | null;
|
|
57
|
+
handleClass?: string | null;
|
|
58
|
+
contentWrapperClass?: string | null;
|
|
59
|
+
backdropClass?: string | null;
|
|
60
|
+
/**
|
|
61
|
+
* Common animation timing functions such as "ease-in-out", or
|
|
62
|
+
* four points(p1x, p1y, p2x, p2y) that express the timing of animations as a Bezier curve.
|
|
63
|
+
*/
|
|
64
|
+
draggingAnimationTimings?: CommonAnimation | AnimationTimingPoints | null;
|
|
65
|
+
/**
|
|
66
|
+
* In milliseconds.
|
|
67
|
+
*/
|
|
68
|
+
draggingAnimationDuration?: number;
|
|
69
|
+
}
|
|
70
|
+
export declare const BOTTOM_SHEET_POSITION: {
|
|
71
|
+
readonly TOP: "top";
|
|
72
|
+
readonly MIDDLE: "middle";
|
|
73
|
+
readonly CONTENT_HEIGHT: "content-height";
|
|
74
|
+
readonly CLOSED: "closed";
|
|
75
|
+
};
|
|
76
|
+
export type BottomSheetPosition = (typeof BOTTOM_SHEET_POSITION)[keyof typeof BOTTOM_SHEET_POSITION];
|
|
77
|
+
/**
|
|
78
|
+
* Points where it snaps to when the handle is released.
|
|
79
|
+
* A snap is a rational number ranging from 0 to 1, exclusive.
|
|
80
|
+
* If snapPoints is [0.5, 0.7], it snaps to 50% and 70% of the viewport height.
|
|
81
|
+
* defaults to [0.5]
|
|
82
|
+
*/
|
|
83
|
+
export type SnapPoints = number[];
|
|
84
|
+
//# sourceMappingURL=bottom-sheet-props.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bottom-sheet-props.type.d.ts","sourceRoot":"","sources":["../../src/types/bottom-sheet-props.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,KAAK,EACV,qBAAqB,EACrB,eAAe,EAChB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAEvE,MAAM,MAAM,wBAAwB,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AAClE,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAEhB,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,mBAAmB,CAAC;IAGtC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAGxB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IAGvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,qBAAqB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACvC,aAAa,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC;IACzC,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGnC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG9B;;;OAGG;IACH,wBAAwB,CAAC,EAAE,eAAe,GAAG,qBAAqB,GAAG,IAAI,CAAC;IAC1E;;OAEG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC;AAED,eAAO,MAAM,qBAAqB;;;;;CAKxB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAC7B,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC;AAErE;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Coordinates, Position } from '../animation/animation.type';
|
|
2
|
+
import { translateContainerWithAnim } from '../animation/animation';
|
|
3
|
+
|
|
4
|
+
export interface BottomSheetState {
|
|
5
|
+
isMounted: boolean;
|
|
6
|
+
translateContainer: ReturnType<typeof translateContainerWithAnim>;
|
|
7
|
+
}
|
|
8
|
+
export interface DraggingState {
|
|
9
|
+
/** Used to know how far the cursor moved. */
|
|
10
|
+
startY: Position | null;
|
|
11
|
+
/** Used to know where was the bottom sheet before dragging. */
|
|
12
|
+
containerStartTranslate: Coordinates;
|
|
13
|
+
isDragging: boolean;
|
|
14
|
+
originalDocumentOverflowY: string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=bottom-sheet-state.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bottom-sheet-state.type.d.ts","sourceRoot":"","sources":["../../src/types/bottom-sheet-state.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAE1E,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,kBAAkB,EAAE,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC;CACnE;AAED,MAAM,WAAW,aAAa;IAC5B,6CAA6C;IAC7C,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAC;IAExB,+DAA+D;IAC/D,uBAAuB,EAAE,WAAW,CAAC;IAErC,UAAU,EAAE,OAAO,CAAC;IAEpB,yBAAyB,EAAE,MAAM,CAAC;CACnC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { BottomSheetState } from './bottom-sheet-state.type';
|
|
2
|
+
import { BottomSheetPosition, BottomSheetProps } from './bottom-sheet-props.type';
|
|
3
|
+
import { BottomSheetElements } from '../initializer/bottom-sheet-initializer';
|
|
4
|
+
|
|
5
|
+
export interface BottomSheet {
|
|
6
|
+
/**
|
|
7
|
+
* Mutable props to change the behavior of the Bottom Sheet.
|
|
8
|
+
*/
|
|
9
|
+
props: BottomSheetProps;
|
|
10
|
+
/**
|
|
11
|
+
* Elements comprise the bottom sheet.
|
|
12
|
+
*/
|
|
13
|
+
elements: Partial<BottomSheetElements>;
|
|
14
|
+
/**
|
|
15
|
+
* Mounts the bottom sheet to the dom, or a provided mounting point.
|
|
16
|
+
*/
|
|
17
|
+
mount: (mountingPoint?: Element) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Removes the bottom sheet element.
|
|
20
|
+
*/
|
|
21
|
+
unmount: () => void;
|
|
22
|
+
/**
|
|
23
|
+
* Shows the bottom sheet.
|
|
24
|
+
*/
|
|
25
|
+
open: () => void;
|
|
26
|
+
/**
|
|
27
|
+
* Hides the bottom sheet.
|
|
28
|
+
*/
|
|
29
|
+
close: () => void;
|
|
30
|
+
/**
|
|
31
|
+
* @returns If the bottom sheet is mounted
|
|
32
|
+
*/
|
|
33
|
+
getIsMounted: () => BottomSheetState["isMounted"];
|
|
34
|
+
/**
|
|
35
|
+
* @returns If the bottom sheet is open.
|
|
36
|
+
*/
|
|
37
|
+
getIsOpen: () => boolean;
|
|
38
|
+
/**
|
|
39
|
+
* @returns If the bottom sheet is closed.
|
|
40
|
+
*/
|
|
41
|
+
getIsClosed: () => boolean;
|
|
42
|
+
/**
|
|
43
|
+
* @returns Current position of the bottom sheet.
|
|
44
|
+
*/
|
|
45
|
+
getPosition: () => BottomSheetPosition;
|
|
46
|
+
/**
|
|
47
|
+
* @returns Current height of the bottom sheet.
|
|
48
|
+
*/
|
|
49
|
+
getHeight: () => number;
|
|
50
|
+
/**
|
|
51
|
+
* @param endY- Position to move the bottom sheet.
|
|
52
|
+
* The top of the viewport is 0, and it increases as it gets closer to the bottom of the viewport.
|
|
53
|
+
*/
|
|
54
|
+
moveTo: (endY: number) => void;
|
|
55
|
+
/**
|
|
56
|
+
* @param percent- A relative number represent the position to move the bottom sheet to.
|
|
57
|
+
* 0.1 is 10% below form the top of the viewport, 0.2 is 20%, and so on.
|
|
58
|
+
*/
|
|
59
|
+
snapTo: (percent: number) => void;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=bottom-sheet.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bottom-sheet.type.d.ts","sourceRoot":"","sources":["../../src/types/bottom-sheet.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,KAAK,EAAE,gBAAgB,CAAC;IACxB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACvC;;OAEG;IACH,KAAK,EAAE,CAAC,aAAa,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB;;OAEG;IACH,YAAY,EAAE,MAAM,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAClD;;OAEG;IACH,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB;;OAEG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC;IAC3B;;OAEG;IACH,WAAW,EAAE,MAAM,mBAAmB,CAAC;IACvC;;OAEG;IACH,SAAS,EAAE,MAAM,MAAM,CAAC;IACxB;;;OAGG;IACH,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B;;;OAGG;IACH,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare class AnimationFrame {
|
|
2
|
+
animationId: number | null;
|
|
3
|
+
isInProgress: boolean;
|
|
4
|
+
startedAt: number | null;
|
|
5
|
+
constructor();
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param renderFrame- Function to render screen using the animation progress percentage.
|
|
9
|
+
* @param duration- Duration of the animation, in MS.
|
|
10
|
+
*/
|
|
11
|
+
start(renderFrame: RenderFrame, duration: number, shouldRunForever?: boolean): void;
|
|
12
|
+
stop(): void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @param progressPercent- Progress of the animation in percentage, from 0 ~ 1
|
|
16
|
+
*/
|
|
17
|
+
export type RenderFrame = (progressPercent: number) => void;
|
|
18
|
+
//# sourceMappingURL=animation-frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation-frame.d.ts","sourceRoot":"","sources":["../../../src/utils/animation/animation-frame.ts"],"names":[],"mappings":"AAGA,qBAAa,cAAc;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;;IAQhC;;;;OAIG;IACI,KAAK,CACV,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,MAAM,EAChB,gBAAgB,UAAQ,GACvB,IAAI;IA6BA,IAAI,IAAI,IAAI;CAQpB;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,eAAe,EAAE,MAAM,KAAK,IAAI,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Points that express the timing of animations as a cubic Bezier curve.
|
|
3
|
+
*/
|
|
4
|
+
export interface AnimationTimingPoints {
|
|
5
|
+
p1x: number;
|
|
6
|
+
p1y: number;
|
|
7
|
+
p2x: number;
|
|
8
|
+
p2y: number;
|
|
9
|
+
}
|
|
10
|
+
export type AnimationTimingFunction = (x: number) => number;
|
|
11
|
+
export type CommonAnimationKeys = typeof COMMON_ANIMATION_KEYS;
|
|
12
|
+
export type CommonAnimationKey = keyof CommonAnimationKeys;
|
|
13
|
+
export type CommonAnimation = CommonAnimationKeys[CommonAnimationKey];
|
|
14
|
+
export declare const COMMON_ANIMATION_KEYS: {
|
|
15
|
+
readonly EASE: "ease";
|
|
16
|
+
readonly EASE_IN: "ease-in";
|
|
17
|
+
readonly EASE_OUT: "ease-out";
|
|
18
|
+
readonly EASE_IN_OUT: "ease-in-out";
|
|
19
|
+
readonly SPRING: "spring";
|
|
20
|
+
};
|
|
21
|
+
export declare function isCommonAnimationTimingsKey(value: unknown): value is CommonAnimationKey;
|
|
22
|
+
export declare function isAnimationTimingPoints(value: unknown): value is AnimationTimingPoints;
|
|
23
|
+
//# sourceMappingURL=animation.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation.type.d.ts","sourceRoot":"","sources":["../../../src/utils/animation/animation.type.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;AAE5D,MAAM,MAAM,mBAAmB,GAAG,OAAO,qBAAqB,CAAC;AAC/D,MAAM,MAAM,kBAAkB,GAAG,MAAM,mBAAmB,CAAC;AAC3D,MAAM,MAAM,eAAe,GAAG,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;AAEtE,eAAO,MAAM,qBAAqB;;;;;;CAMxB,CAAC;AAEX,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,kBAAkB,CAQ7B;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,qBAAqB,CAgBhC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AnimationTimingFunction, CommonAnimation } from './animation.type';
|
|
2
|
+
|
|
3
|
+
export declare const ease: AnimationTimingFunction;
|
|
4
|
+
export declare const easeIn: AnimationTimingFunction;
|
|
5
|
+
export declare const easeOut: AnimationTimingFunction;
|
|
6
|
+
export declare const easeInOut: AnimationTimingFunction;
|
|
7
|
+
export declare const spring: AnimationTimingFunction;
|
|
8
|
+
export declare function commonAnimationTimingsNameToFunction(key: CommonAnimation): AnimationTimingFunction;
|
|
9
|
+
//# sourceMappingURL=common-animations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-animations.d.ts","sourceRoot":"","sources":["../../../src/utils/animation/common-animations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAI1B,eAAO,MAAM,IAAI,yBAAkC,CAAC;AACpD,eAAO,MAAM,MAAM,yBAAmC,CAAC;AACvD,eAAO,MAAM,OAAO,yBAAoC,CAAC;AACzD,eAAO,MAAM,SAAS,yBAAkC,CAAC;AACzD,eAAO,MAAM,MAAM,yBAAoC,CAAC;AAExD,wBAAgB,oCAAoC,CAClD,GAAG,EAAE,eAAe,GACnB,uBAAuB,CAoBzB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AnimationTimingFunction } from './animation.type';
|
|
2
|
+
|
|
3
|
+
export type CubicBezierReturnType = ReturnType<typeof cubicBezier>;
|
|
4
|
+
export declare function cubicBezier(p1x: number, p1y: number, p2x: number, p2y: number): AnimationTimingFunction;
|
|
5
|
+
//# sourceMappingURL=cubic-bezier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cubic-bezier.d.ts","sourceRoot":"","sources":["../../../src/utils/animation/cubic-bezier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEhE,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAKnE,wBAAgB,WAAW,CACzB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,uBAAuB,CAuDzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/animation/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linear.d.ts","sourceRoot":"","sources":["../../../src/utils/animation/linear.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function hasClassName(el: Element, className: string): boolean;
|
|
2
|
+
export declare function addClassName(el: Element, className: string): void;
|
|
3
|
+
export declare function removeClassName(el: Element, className: string): void;
|
|
4
|
+
export declare function replaceClassName(el: Element, prevClassName: string | null | undefined, nextClassName: string | null | undefined): void;
|
|
5
|
+
export declare function toggleClassName(el: Element, className: string): void;
|
|
6
|
+
export declare function cleanClassName(className: string | undefined | null): string;
|
|
7
|
+
export declare function mergeClassNames(classNames: (string | undefined | null)[]): string;
|
|
8
|
+
export declare function classesToSelector(classNames: (string | undefined | null)[]): string;
|
|
9
|
+
//# sourceMappingURL=class-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"class-names.d.ts","sourceRoot":"","sources":["../../../src/utils/dom/class-names.ts"],"names":[],"mappings":"AAEA,wBAAgB,YAAY,CAAC,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAEpE;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAEjE;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAEpE;AAED,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,OAAO,EACX,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACxC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACvC,IAAI,CAUN;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAQpE;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAS3E;AAED,wBAAgB,eAAe,CAC7B,UAAU,EAAE,CAAC,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,EAAE,GACxC,MAAM,CAKR;AAED,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,CAAC,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,EAAE,GACxC,MAAM,CAMR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../../src/utils/dom/element.ts"],"names":[],"mappings":"AAGA,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,qBAAqB,EACpC,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,GACd,UAAU,CAAC,OAAO,QAAQ,CAAC,aAAa,CAAC,CAa3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../../src/utils/dom/focus.ts"],"names":[],"mappings":"AAGA,wBAAgB,OAAO,CAAC,EAAE,EAAE,OAAO,QAIlC;AAED,wBAAgB,WAAW,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAgChD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface TransformValue {
|
|
2
|
+
type: string;
|
|
3
|
+
values: string[];
|
|
4
|
+
}
|
|
5
|
+
export declare function stringToTransforms(transformString: string): TransformValue[];
|
|
6
|
+
export declare function getTransformValues(element: HTMLElement): {
|
|
7
|
+
transform: string;
|
|
8
|
+
transformValues: TransformValue[];
|
|
9
|
+
};
|
|
10
|
+
export declare function pickTransformValue(currentTransformValues: TransformValue[], valueName: string): TransformValue | null;
|
|
11
|
+
//# sourceMappingURL=transform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/utils/dom/transform.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,wBAAgB,kBAAkB,CAAC,eAAe,EAAE,MAAM,GAAG,cAAc,EAAE,CAe5E;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,WAAW,GAAG;IACxD,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,cAAc,EAAE,CAAC;CACnC,CAKA;AAED,wBAAgB,kBAAkB,CAChC,sBAAsB,EAAE,cAAc,EAAE,EACxC,SAAS,EAAE,MAAM,GAChB,cAAc,GAAG,IAAI,CAUvB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TransformValue } from './transform';
|
|
2
|
+
import { Coordinates } from '../../animation/animation.type';
|
|
3
|
+
|
|
4
|
+
export declare function getTranslate(element: HTMLElement): Coordinates;
|
|
5
|
+
export declare function setTranslate(element: HTMLElement, { x, y }: Partial<Coordinates>): void;
|
|
6
|
+
export declare function getCoordinatesFromTranslateValue(transformValue: TransformValue): Coordinates;
|
|
7
|
+
//# sourceMappingURL=translate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../../../src/utils/dom/translate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AASlD,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,WAAW,CAe9D;AAED,wBAAgB,YAAY,CAC1B,OAAO,EAAE,WAAW,EACpB,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,OAAO,CAAC,WAAW,CAAC,GAC7B,IAAI,CAgCN;AAED,wBAAgB,gCAAgC,CAC9C,cAAc,EAAE,cAAc,GAC7B,WAAW,CAcb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visibility.d.ts","sourceRoot":"","sources":["../../../src/utils/dom/visibility.ts"],"names":[],"mappings":"AAKA,wBAAgB,aAAa,CAC3B,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,EAC5B,UAAU,EAAE,OAAO,GAClB,IAAI,CAgBN;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,GAAG,IAAI,CAQ1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventPhase.d.ts","sourceRoot":"","sources":["../../../src/utils/event-listeners/EventPhase.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IACpB,GAAG,KAAK;IACR,IAAI,IAAI;IACR,OAAO,IAAI;IACX,MAAM,IAAI;IACV,MAAM,IAAI;CACX;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,CAa/D"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { EventPhase } from './EventPhase';
|
|
2
|
+
import { Coordinates } from '../../animation/animation.type';
|
|
3
|
+
|
|
4
|
+
export interface AddEventListenersParams {
|
|
5
|
+
onStart?: EventCallback;
|
|
6
|
+
onStartOptions?: EventCallbackOptions;
|
|
7
|
+
onMove?: EventCallback;
|
|
8
|
+
onEnd?: EventCallback;
|
|
9
|
+
}
|
|
10
|
+
export type AppTouchEvent = TouchEvent;
|
|
11
|
+
export type TabEvent = MouseEvent | AppTouchEvent;
|
|
12
|
+
export type EventCallback = (event: TabEvent) => void;
|
|
13
|
+
export interface EventCallbackOptions {
|
|
14
|
+
eventPhase: EventPhase;
|
|
15
|
+
}
|
|
16
|
+
export declare const defaultEventOptions: {
|
|
17
|
+
readonly eventPhase: EventPhase.All;
|
|
18
|
+
};
|
|
19
|
+
export declare class TabEventListener {
|
|
20
|
+
private currentTarget;
|
|
21
|
+
constructor(currentTarget: HTMLElement);
|
|
22
|
+
addEventListeners({ onStart, onStartOptions, onMove, onEnd, }: AddEventListenersParams): void;
|
|
23
|
+
private addTouchEventListeners;
|
|
24
|
+
private addMouseEventListeners;
|
|
25
|
+
removeEventListeners({ onStart, onMove, onEnd, }: {
|
|
26
|
+
onStart?: EventCallback;
|
|
27
|
+
onMove?: EventCallback;
|
|
28
|
+
onEnd?: EventCallback;
|
|
29
|
+
}): void;
|
|
30
|
+
getCoordinates(event: TabEvent): Coordinates;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=TabEventListener.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabEventListener.d.ts","sourceRoot":"","sources":["../../../src/utils/event-listeners/TabEventListener.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAoB,MAAM,cAAc,CAAC;AAE5D,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAOD,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC;AAEvC,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,aAAa,CAAC;AAElD,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;AAEtD,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,eAAO,MAAM,mBAAmB;;CAEtB,CAAC;AAEX,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,aAAa,CAAc;gBAEvB,aAAa,EAAE,WAAW;IAI/B,iBAAiB,CAAC,EACvB,OAAO,EACP,cAAoC,EACpC,MAAM,EACN,KAAK,GACN,EAAE,uBAAuB,GAAG,IAAI;IAMjC,OAAO,CAAC,sBAAsB;IAoC9B,OAAO,CAAC,sBAAsB;IAsCvB,oBAAoB,CAAC,EAC1B,OAAO,EACP,MAAM,EACN,KAAK,GACN,EAAE;QACD,OAAO,CAAC,EAAE,aAAa,CAAC;QACxB,MAAM,CAAC,EAAE,aAAa,CAAC;QACvB,KAAK,CAAC,EAAE,aAAa,CAAC;KACvB,GAAG,IAAI;IAUD,cAAc,CAAC,KAAK,EAAE,QAAQ,GAAG,WAAW;CAuCpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/event-listeners/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type ConsoleLog = typeof console.log;
|
|
2
|
+
type ConsoleError = typeof console.error;
|
|
3
|
+
export declare function log(...params: Parameters<ConsoleLog>): ReturnType<ConsoleLog>;
|
|
4
|
+
export declare function logError(...params: Parameters<ConsoleError>): ReturnType<ConsoleError>;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=log.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/utils/log/log.ts"],"names":[],"mappings":"AAIA,KAAK,UAAU,GAAG,OAAO,OAAO,CAAC,GAAG,CAAC;AACrC,KAAK,YAAY,GAAG,OAAO,OAAO,CAAC,KAAK,CAAC;AAEzC,wBAAgB,GAAG,CAAC,GAAG,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC,UAAU,CAAC,CAE7E;AAED,wBAAgB,QAAQ,CACtB,GAAG,MAAM,EAAE,UAAU,CAAC,YAAY,CAAC,GAClC,UAAU,CAAC,YAAY,CAAC,CAE1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"min-max.d.ts","sourceRoot":"","sources":["../../../src/utils/math/min-max.ts"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,EACb,EACE,GAAG,EACH,GAAG,GACJ,EAAE;IACD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GACA,MAAM,CASR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit.d.ts","sourceRoot":"","sources":["../../../src/utils/math/unit.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,GAAG,aAAa,EAAE,UAAU,CAAC,OAAO,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,GAC5D,MAAM,CAER"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observe.d.ts","sourceRoot":"","sources":["../../../src/utils/proxy/observe.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,CAC/B,QAAQ,EAAE,MAAM,GAAG,MAAM,EACzB,KAAK,EAAE,OAAO,KACX,IAAI,CAAC;AAEV,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,EACtC,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,kBAAkB,GACxB,CAAC,CASH"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type CSSColor = RGB | RGBA | HEX | HSL;
|
|
2
|
+
export type RGB = `rgb(${number}, ${number}, ${number})`;
|
|
3
|
+
export type RGBA = `rgba(${number}, ${number}, ${number}, ${number})`;
|
|
4
|
+
export type HEX = `#${string}`;
|
|
5
|
+
export type HSL = `hsl(${string})`;
|
|
6
|
+
export type CSSUnit = Pixel | EM | REM | VW | VH;
|
|
7
|
+
export type Pixel = `${number}px`;
|
|
8
|
+
export type EM = `${number}em`;
|
|
9
|
+
export type REM = `${number}rem`;
|
|
10
|
+
export type VW = `${number}vw`;
|
|
11
|
+
export type VH = `${number}vh`;
|
|
12
|
+
//# sourceMappingURL=css-attribute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css-attribute.d.ts","sourceRoot":"","sources":["../../../src/utils/types/css-attribute.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC;AAE9C,MAAM,MAAM,GAAG,GAAG,OAAO,MAAM,KAAK,MAAM,KAAK,MAAM,GAAG,CAAC;AACzD,MAAM,MAAM,IAAI,GAAG,QAAQ,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM,GAAG,CAAC;AACtE,MAAM,MAAM,GAAG,GAAG,IAAI,MAAM,EAAE,CAAC;AAC/B,MAAM,MAAM,GAAG,GAAG,OAAO,MAAM,GAAG,CAAC;AAEnC,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,EAAE,GAAG,GAAG,GAAG,EAAE,GAAG,EAAE,CAAC;AAEjD,MAAM,MAAM,KAAK,GAAG,GAAG,MAAM,IAAI,CAAC;AAClC,MAAM,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,CAAC;AAC/B,MAAM,MAAM,GAAG,GAAG,GAAG,MAAM,KAAK,CAAC;AACjC,MAAM,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,CAAC;AAC/B,MAAM,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exists.d.ts","sourceRoot":"","sources":["../../../src/utils/types/exists.ts"],"names":[],"mappings":"AAAA,wBAAgB,MAAM,CAAC,CAAC,GAAG,OAAO,EAChC,KAAK,EAAE,CAAC,GACP,KAAK,IAAI,OAAO,CAAC,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC,CAEvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-boolean.d.ts","sourceRoot":"","sources":["../../../src/utils/types/is-boolean.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,CAE1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-element.d.ts","sourceRoot":"","sources":["../../../src/utils/types/is-element.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,IAAI,OAAO,CAEpD;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,IAAI,WAAW,CAE5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-number.d.ts","sourceRoot":"","sources":["../../../src/utils/types/is-number.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAExD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-percent.d.ts","sourceRoot":"","sources":["../../../src/utils/types/is-percent.ts"],"names":[],"mappings":"AAEA,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAYzD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-string.d.ts","sourceRoot":"","sources":["../../../src/utils/types/is-string.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAExD"}
|