amotify 0.1.57 → 0.1.59
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/@utils/config.js +1 -1
- package/dist/@utils/fin.js +1 -1
- package/dist/@utils/pageTransit.js +1 -1
- package/dist/fn/Input/Slider.js +1 -1
- package/dist/fn/Layout/PageRouter.js +1 -1
- package/dist/fn/Layout/RootViewController.js +1 -1
- package/dist/fn/Layout/SwipeView.js +1 -1
- package/package.json +1 -1
package/dist/@utils/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as i,c as t}from"../chunk-VY3566IV.js";import
|
|
1
|
+
import{b as i,c as t}from"../chunk-VY3566IV.js";import s from"@mingoo/jsmin";import{useRecycle as c}from"./useRecycle";import{ColorObjects as h,SetThemeColorTag as u}from"./color";const f=s.uuid.gen(),n=window.navigator.userAgent.toLowerCase(),a=n.indexOf("windows nt")!==-1?"windows":n.indexOf("android")!==-1?"android":n.indexOf("iphone")!==-1?"iPhone":n.indexOf("ipad")>-1||n.indexOf("macintosh")>-1&&"ontouchend"in document?"iPad":n.indexOf("mac os x")!==-1?"macOSX":"undefined",p=n.indexOf("msie")!==-1||n.indexOf("trident")!==-1?"ie":n.indexOf("edge")!==-1?"edge":n.indexOf("chrome")!==-1?"chrome":n.indexOf("safari")!==-1?"safari":n.indexOf("firefox")!==-1?"firefox":n.indexOf("opera")!==-1||n.indexOf("opr")!==-1?"opera":"undefined";let m={sessionUID:f,appRoot:document.body,darkMode:"light",themeColor:"comun",roundness:2,isSystemDarkmode:()=>window.matchMedia("(prefers-color-scheme: dark)").matches==!0,deviceIs:a,browserIs:p,isPhone:["Android","iPhone"].includes(a),isTouchDevice:window.ontouchstart!==void 0&&0<navigator.maxTouchPoints,isIOS:["iPhone","iPad"].includes(a),screen:{breakpoint:834,phonepoint:690,viewHeight:window.innerHeight,viewWidth:window.innerWidth,isBreakpoint:(e=834)=>window.innerWidth<=e,isPhonepoint:(e=690)=>window.innerWidth<=e}};const o={get:()=>m,set:e=>{m=i(i({},m),e)},update:{appRoot:e=>{o.set(t(i({},o.get()),{appRoot:e}))},themeColor:e=>{if(h.find(d=>d.key==e)||(e="comun"),e==o.get().themeColor)return;o.set(t(i({},o.get()),{themeColor:e}));let r=s(document.body);r.removeClass(r.findClass(/^bdsTC/)).addClass("bdsTC_"+e).callback(()=>{u()}),o.restart()},darkMode:e=>{if(["light","dark","dim","auto"].includes(e)||(e="light"),e==o.get().darkMode)return;let r=e=="auto"?o.get().isSystemDarkmode()?"dark":"light":e;o.set(t(i({},o.get()),{darkMode:r}));let d=s(document.body);d.removeClass(d.findClass(/^bdsDM/)).addClass("bdsDM_"+r),o.restart()},roundness:e=>{e>=0&&e<=5||(e=2),e!=o.get().roundness&&(o.set(t(i({},o.get()),{roundness:e})),o.restart())},screen:e=>{o.get().screen=i(i({},o.get().screen),e)}},restart:()=>{c.do("RootViewController_"+o.get().sessionUID)}};export{o as Config,o as default};
|
package/dist/@utils/fin.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"@mingoo/jsmin";import{Config as
|
|
1
|
+
import o from"@mingoo/jsmin";import{Config as i,SetThemeColorTag as l}from".";o(document.body).addClass(["usrDevice_"+i.get().deviceIs,"bdsDM_"+i.get().darkMode,"bdsTC_"+i.get().themeColor]),o(window).addEvent({eventType:"load",callback:()=>{let e=document.body.style,t=o(document.body),r=Number(t.getStyleProperty("--topNavHeight").removeLetters()||0),n=Number(t.getStyleProperty("--footerNavHeight").removeLetters()||0),d=window.innerHeight-r-n;e.setProperty("--viewHeight",window.innerHeight+"px"),e.setProperty("--contentHeight",d+"px")}}).addEvent({eventType:"resize",eventID:"getDeviceInfo",callback:()=>{i.update.screen({viewHeight:window.innerHeight,viewWidth:window.innerWidth});let e=o(document.body),t=window.innerHeight,r=Number(e.getStyleProperty("--topNavHeight").removeLetters()),n=Number(e.getStyleProperty("--footerNavHeight").removeLetters()),g=t-r-n;e.setStyleProperty("--viewHeight",t+"px").setStyleProperty("--sideNavHeight",g+"px").setStyleProperty("--contentHeight",g+"px")}}),l();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-VY3566IV.js";import{useStore as
|
|
1
|
+
import"../chunk-VY3566IV.js";import{useStore as s}from"./useStore";const n={open:e=>{window.open(e)},pushSync:e=>{window.location.href=e},pushAsync:e=>{if(e.match(/https?:\/\//)){n.pushSync(e);return}let t=s.get("navigate");t&&t(e)},push:(e,t)=>{if(t){n.open(e);return}n.pushAsync(e)},back:()=>{let e=s.get("navigate");e&&e(-1)}};export{n as default,n as pageTransit};
|
package/dist/fn/Input/Slider.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as I,c as T,d as B}from"../../chunk-VY3566IV.js";import{jsx as d,jsxs as
|
|
1
|
+
import{b as I,c as T,d as B}from"../../chunk-VY3566IV.js";import{jsx as d,jsxs as M}from"react/jsx-runtime";import{useState as A,useEffect as P}from"react";import c from"@mingoo/jsmin";import{$$fromRoot as L,useStore as E,GenerateClassName as q}from"../../@utils";import x from"../../atoms/Box";import F from"../../atoms/Flex";import O from"../../mols/Column";import G from"../Button";import{Wrapper as X,BoxWrapper as j,SubmitForm as J,CommonEffects as Q}from"./core";import Y from"./Hidden";import{InputSliderClasses as v}from"../../@styles/componentClasses";function Z(a){let{value:e,para:o}=a,{required:n}=o,s=[];return n&&!e&&s.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!s.filter(({type:i})=>i=="invalid").length,notice:s}}const N=a=>{let{value:e,val_status:o}=a,{min:n,max:s,step:i}=o;e=Math.max(e,n),e=Math.min(e,s);let t=e/s*s;return t=Math.round(t/i),{stepValue:t*i,stepIndex:t,positionLeft:t*i/s*100+"%"}},z={IndicatorLabels:a=>{let{componentID:e,min:o,max:n,step:s,customLegends:i}=a,r=[],t=Math.round(o/s),p=Math.round(n/s),f=p-t+1;for(var u=t;u<=p;u++){let l=u*s;l=Math.max(l,o),l=Math.min(l,n);let g=l/n*100+"%";r.push(d(x,{className:v("Label"),id:"Legend-"+e+"-"+u,display:u==t||u==p?"flex":"none",position:"absolute",top:0,unitHeight:1,unitWidth:1.5,transition:"middle",fontColor:"1.clear",freeCSS:{left:g,whiteSpace:"nowrap",textAlign:"center"},verticalAlign:"center",horizontalAlign:"center",children:i?i(l):l.rank()},l))}return P(()=>{const l=()=>{let g=L("#Labels-"+e),{width:S}=g.position(),C=Math.round(S/50)-1,y=Math.round(f/C);for(let m=t+1;m<p;m++)L("#Legend-"+e+"-"+m).css({display:m%y==0?"flex":"none"})};return c(window).addEvent({eventID:"SliderResizeCallback-"+e,eventType:"resize",callback:()=>{l()}}),l(),()=>{c(window).removeEvent("SliderResizeCallback-"+e)}},[]),d(F,{className:v("Labels"),verticalAlign:"center",horizontalAlign:"between",fontSize:"0.xs",position:"relative",unitHeight:1,id:"Labels-"+e,children:d(x,{position:"absolute",top:0,left:0,bottom:0,freeCSS:{right:12*1.5},children:r})})},Rail:a=>{let{val_status:e,set_status:o,DotData:n,form:s,enableFormSubmit:i}=a,{componentID:r}=e;return M(F,{className:v("Rail"),position:"relative",paddingLeft:"1/2",unitHeight:1.5,verticalAlign:"center",freeCSS:{minWidth:"10rem",zIndex:1,cursor:"pointer"},onMouseDown:t=>{t.stopPropagation(),b.Effects.Start(t,{val_status:e,set_status:o,DotData:n})},onTouchStart:t=>{t.stopPropagation(),b.Effects.Start(t,{val_status:e,set_status:o,DotData:n})},children:[d(x,{className:v("Bar"),backgroundColor:"layer.4",position:"relative",borderRadius:"sphere",transition:"middle",flexSizing:"none",unitHeight:"2/3",width:1,id:r+"_Bar",children:d(x,{className:v("BarColor"),position:"relative",height:1,width:0,left:0,transition:"long",borderRadius:"inherit",backgroundColor:a.color,opacity:"middle",overflow:"hidden",freeCSS:{width:n.positionLeft},id:r+"_BarColor"})}),d(x,{className:v("BallWrap"),position:"absolute",top:0,left:0,bottom:0,freeCSS:{right:12*1.5},children:d(G.Button.Plain,{className:v("Ball"),position:"absolute",backgroundColor:a.color,top:0,left:0,ssSphere:1.5,freeCSS:{zIndex:2,left:n.positionLeft},"data-form-name":s,id:r+"_Ball",onKeyDown:t=>{b.KeyDownEvent({event:t,val_status:e,set_status:o,DotData:n}),i&&J(t)}})})]})}},b={Effects:{Start:(a,e)=>{c(document).addEvent({eventID:"SliderMouseMove",eventType:"mousemove",callback:o=>{b.Effects.Move(o,e)},options:{passive:!1}}).addEvent({eventID:"SliderTouchMove",eventType:"touchmove",callback:o=>{b.Effects.Move(o,e)},options:{passive:!1}}).addEvent({eventID:"SliderMouseUp",eventType:"mouseup",callback:()=>{b.Effects.End()}}).addEvent({eventID:"SliderTouchEnd",eventType:"touchend",callback:()=>{b.Effects.End()}})},Move:(a,e)=>{let o=c.getCursor(a).x,{val_status:n,set_status:s}=e,{componentID:i,min:r,max:t}=n,p=L("#"+i+"_Ball"),f=L("#"+i+"_Bar"),u=L("#"+i+"_BarColor"),{width:l,left:g}=f.position(),S=(o-g)/l;S=Math.max(S,0),S=Math.min(S,1);let C=S*t,y=N({value:C,val_status:n}),m=y.positionLeft,D=y.stepValue;p.css({left:m}),u.css({width:m});let{prevValue:_}=E.get(i);return D!=_&&(E.update({key:i,value:{prevValue:D}}),s(T(I({},n),{dataValue:D,eventType:"update",eventID:c.uuid.gen()}))),a.preventDefault(),a.stopPropagation(),!1},End:()=>{c(document).removeEvent(["SliderMouseMove","SliderTouchMove","SliderMouseUp","SliderTouchEnd"])}},KeyDownEvent:a=>{let{event:e,val_status:o,set_status:n}=a,{min:s,max:i,step:r}=o,{key:t,metaKey:p,ctrlKey:f}=e,u=f||p,l=o.dataValue;t.match(/Arrow/)&&(e.preventDefault(),t.match(/Left|Up/)?u?l=s:l-=r:t.match(/Right|Down/)&&(u?l=i:l+=r),l=Math.max(Math.min(l,i),s),E.update({key:o.componentID,value:{prevValue:l}}),n(T(I({},o),{dataValue:l,eventType:"update",eventID:c.uuid.gen()})))}},ee=a=>{let k=a,{color:e="theme",required:o,form:n="",legends:{enable:s=!0,custom:i,showAlways:r=!1}={},min:t,max:p,step:f,enableFormSubmit:u,checkValidationAtFirst:l,onChange:g,onKeyDown:S,onValidate:C,onUpdateValue:y,onUpdateValidValue:m,value:D="",className:_}=k,K=B(k,["color","required","form","legends","min","max","step","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","className"]),W={componentID:a.componentID||"",dataValue:D,min:t,max:p,step:f,eventType:"init",eventID:c.uuid.gen()},[h,V]=A(W),[w,U]=A({ok:!1,notice:[]});Q({para:a,val_status:h,set_status:V,val_validate:w,set_validate:U,onUpdateValue:y,onUpdateValidValue:m,DefaultValidation:Z,ExtraOverrideParams:{dataValue:D},ExtraStoreParams:{prevValue:h.dataValue,setValueByForeign:$=>{V(T(I({},h),{dataValue:$,eventType:"update",eventID:c.uuid.gen()}))}}});let R=N({value:h.dataValue,val_status:h});return M(j,{val_status:h,set_status:V,val_validate:w,para:a,children:[d(Y,I({value:R.stepValue,form:n,"data-value":R.stepValue,"data-validation":w.ok,"data-input-type":"slider"},K)),M(O,{gap:"1/2",flexSizing:"auto",className:[v("Wrap"),_,v("ShowLegendsAlways_"+r)].join(" "),children:[d(z.Rail,{color:e,val_status:h,set_status:V,DotData:R,form:n,enableFormSubmit:u}),!!s&&d(z.IndicatorLabels,{componentID:h.componentID,min:t,max:p,step:f,customLegends:i})]})]})},H=a=>(a=I({},a),d(X,{componentID:a.componentID,children:ee,para:q(a)}));export{H as Slider,H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-VY3566IV.js";import{jsx as
|
|
1
|
+
import"../../chunk-VY3566IV.js";import{jsx as n,jsxs as P}from"react/jsx-runtime";import{useEffect as c,useRef as m}from"react";import{useStore as R}from"../../@utils";import*as s from"react-router-dom";import C from"../Sheet";import{PageNotFound as g}from"./PageNotFound";import{RootViewController as k}from"./RootViewController";const h=(t,o,a)=>{const r=m(!1);let e=s.useLocation(),u=s.useNavigate();R.set({key:"navigate",value:u}),c(()=>{r.current?(C.closeAll(!0),k.fn.updateCSSProperty.reset()):r.current=!0},[e.pathname]),t&&t(e),c(()=>{a&&a(e)},[]),c(()=>{setTimeout(()=>{window.dispatchEvent(new Event("resize"))},200),o&&o(e)},[e])},B=t=>{let{routes:o,beforeCallBack:a,afterCallBack:r,afterFirstCallBack:e}=t;h(a,r,e);let u=o.map(i=>{let{path:l,content:f}=i;return l="/"+l.replace(/^\//,""),n(s.Route,{path:l,element:f},l)});return P(s.Routes,{children:[u,n(s.Route,{path:"*",element:n(g,{})})]})},p=t=>{let{pages:o,beforeCallBack:a,afterCallBack:r,afterFirstCallBack:e}=t;return n(B,{routes:o,beforeCallBack:a,afterCallBack:r,afterFirstCallBack:e})};export{p as PageRouter,p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as p,c as y,d as f}from"../../chunk-VY3566IV.js";import{jsx as s,jsxs as x}from"react/jsx-runtime";import{useState as S,useEffect as N}from"react";import
|
|
1
|
+
import{b as p,c as y,d as f}from"../../chunk-VY3566IV.js";import{jsx as s,jsxs as x}from"react/jsx-runtime";import{useState as S,useEffect as N}from"react";import r from"@mingoo/jsmin";import{$$fromRoot as v,Config as R,pageTransit as P}from"../../@utils";import h from"../../atoms/Box";import C from"../../atoms/Flex";import F from"../../mols/Column";import _ from"../Button";import{LayoutClasses as m}from"../../@styles/componentClasses";const c={Base:o=>{let l=o,{topNavigation:e,sideNavigation:t,footerNavigation:i,children:a,className:n}=l,g=f(l,["topNavigation","sideNavigation","footerNavigation","children","className"]);N(()=>{c.fn.updateCSSProperty.reset(),setTimeout(()=>{c.fn.updateCSSProperty.reset()},100);let u="ResizeCB",B="RemovePageEventCB";return r(window).addEvent({eventType:"resize",eventID:u,callback:()=>{R.get().screen.isPhonepoint()||(r.interval.clear("__RVC_calcHeights"),r.interval.standBy("__RVC_calcHeights",300,()=>{c.fn.updateCSSProperty.reset()}))}}),()=>{r(window).removeEvent(B),r(window).removeEvent(u)}},[]);let d=a;return x(F,y(p({className:[n,m("RootViewController")].join(" "),backgroundColor:"layer.1",gap:0,minHeight:"viewHeight"},g),{children:[e,x(C,{className:m("Body"),flexWrap:!1,position:"relative",flexSizing:0,children:[t,s(h,{className:m("Content"),position:"relative",flexSizing:0,width:0,UnderBreakPointStyles:{width:"auto"},children:d})]}),i]}))},TopNavigation:o=>{let n=o,{className:e,children:t}=n,i=f(n,["className","children"]),[a]=S(r.uuid.gen());return N(()=>{c.fn.updateCSSProperty.topNav()},[]),s(C,y(p({"data-id":a,flexSizing:"none",flexType:"col",position:"sticky",top:0,backgroundColor:"layer.1"},i),{id:"__RVC_TopNavigation",className:[e,m("TopNav")].join(" "),children:t}),a)},SideNavigation:o=>{let a=o,{className:e="",baseStyles:t}=a,i=f(a,["className","baseStyles"]);return s(h,p({flexSizing:"none",className:[e,m("SideNav")].join(" "),minHeight:"sideNavigationHeight"},i))},FooterNavigation:o=>{let n=o,{className:e="",baseStyles:t}=n,i=f(n,["className","baseStyles"]),[a]=S(r.uuid.gen());return N(()=>{c.fn.updateCSSProperty.footer()},[]),s(C,y(p({"data-id":a,borderTop:!0,position:"sticky",bottom:0,overflow:"auto",backgroundColor:"layer.1",paddingBottom:"safeAreaBottom"},t),{id:"__RVC_FooterNavigation",className:[m("FooterNav"),e].join(" "),children:s(C,p({gap:1,flexWrap:!1,padding:"2/3",margin:"auto"},i))}))},Comps:{Button:o=>{let d=o,{isActive:e,uri:t,uriGroup:i}=d,a=f(d,["isActive","uri","uriGroup"]),n=r.flatArray(i),g=location.pathname;{let l=!1;if(r.is.exist(t)&&r.is.string(t)){let u=[location.origin,t.replace(/\//,"")].join("/");l=g==new URL(u).pathname}if(!l&&n.length)for(let u of n)r.is.nullish(u)||g.match(new RegExp(u))&&(l=!0);e=e!=null?e:l}return s(_.Button.Clear.R,p({padding:["3/4",1],display:"flex",gap:"1/2",fontColor:"inherit",width:1,flexSizing:"none",flexWrap:!1,ssEffectsOnActive:"ripple.cloud",verticalAlign:"center",textAlign:"left",isSemiBoldFont:!0,isActive:e,isActiveStyles:{fontColor:"theme",backgroundColor:"cloud"},onClick:l=>{r.is.exist(t)&&r.is.string(t)&&P.push(t,l.ctrlKey||l.metaKey)},color:"cloud"},a))},Bar:o=>s(h,p({flexSizing:"none",backgroundColor:"layer.4.opa.middle",unitHeight:"1/3",margin:["2/3",1],borderRadius:"sphere"},o)),Title:o=>s(h,p({fontSize:"3.paragraph",isSemiBoldFont:!0,padding:[0,1]},o))},fn:{updateCSSProperty:{topNav:()=>{let o=r(document.body),e=v("#__RVC_TopNavigation"),t=e.position().height||0,i=t;e.getStyleProperty("position")!="sticky"&&(i=0),o.setStyleProperty("--topNavHeight",t+"px").setStyleProperty("--topBase",i+"px")},footer:()=>{let o=r(document.body),t=v("#__RVC_FooterNavigation").position().height||0;o.setStyleProperty("--footerNavHeight",t+"px")},reset:()=>{let o=r(document.body),e=v("#__RVC_TopNavigation"),t=v("#__RVC_FooterNavigation"),i=e.position().height||0,a=i,n=t.position().height||0;e.getStyleProperty("position")!="sticky"&&(a=0);let g=window.innerHeight,d=g-i-n;o.setStyleProperty("--topNavHeight",i+"px").setStyleProperty("--topBase",a+"px").setStyleProperty("--footerNavHeight",n+"px").setStyleProperty("--viewHeight",g+"px").setStyleProperty("--sideNavHeight",d+"px").setStyleProperty("--contentHeight",d+"px")}}}};export{c as RootViewController,c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{b as f,c as T,d as k}from"../../chunk-VY3566IV.js";import{jsx as I}from"react/jsx-runtime";import{useState as L,useEffect as M,useRef as N}from"react";import c from"@mingoo/jsmin";import{$$fromRoot as h,useStore as X}from"../../@utils";import R from"../../atoms/Box";import j from"../../atoms/Flex";import{LayoutClasses as a}from"../../@styles/componentClasses";const B=t=>{let D=t,{options:{onSlideCallback:e,visibilitySurroundSlide:u=!0,autoSwipems:d=0,loop:i=!1,disableMousedrag:r=!1,disableTouch:o=!1}={},wrapper:s=n=>n,slides:v=[]}=D,E=k(D,["options","wrapper","slides"]),[w]=L(c.uuid.gen()),[p,y]=L({eventType:"init",index:t.slideIndex});M(()=>{X.set({key:"SwipeTimer-"+w,value:null})},[]);const g=N(!1);M(()=>{y({eventType:"usr",index:t.slideIndex}),g.current||(g.current=!0)},[t.slideIndex]),M(()=>{let n=p.index+(i?1:0),m=[-1,v.length].includes(p.index);m||e&&setTimeout(()=>{e(p.index)},300);let b=h("#Swiper-"+w);if(p.eventType=="adjustLoop")b.await(250).css({transition:"0s",transform:l.TrasformString(n)}).children().removeClass(a("Display")).parent().children(n).addClass([a("Display"),a("LoopAdjusting")]).await(100).removeClass(a("LoopAdjusting"));else if(p.eventType=="sys")b.await(250).css({transform:l.TrasformString(n)}).children().removeClass(a("Display")).parent().children(n).addClass(a("Display"));else if(b.children().removeClass(a("Display")).parent().children(n).addClass(a("Display")).parent().css({transition:"0.3s",transform:l.TrasformString(n)}).await(250).css({transition:"0s"}),m){let x=p.index==-1?v.length-1:0;y({eventType:"adjustLoop",index:x})}d&&!m&&(c.interval.clear("SwipeTimer-"+w),c.interval.standBy("SwipeTimer-"+w,d-(p.eventType=="sys"?310:0),()=>{let x=p.index+1;!i&&x>v.length-1&&(x=0),y({eventType:"usr",index:x})}))},[p]);let S=v.map((n,m)=>I(R,{flexSizing:"none",width:1,height:0,className:a("Child"),children:s(n)},m));i&&(S.push(S[0]),S.unshift(S[S.length-2]));let C={x:0,y:0,process:!1,effectStartAt:0,id:w,loop:i,index:p.index,minIndex:i?-1:0,maxIndex:v.length+(i?1:-1),width:0,set_event:y},A=p.index+(i?1:0);return I(R,T(f({overflow:"hidden",position:"relative"},E),{className:[E.className,a("SwipeView")].join(" "),freeCSS:f({zIndex:1},E.freeCSS),"data-swipe-id":w,onMouseDown:n=>{r||n.buttons==1&&l.EffectStart(n,C)},onTouchStart:n=>{var m;o||((m=n.touches)==null?void 0:m.length)==1&&l.EffectStart(n,C)},children:I(j,{flexWrap:!1,gap:1,transition:"long",className:[a("Rail"),a("ShowOther_"+u)].join(" "),id:"Swiper-"+w,freeCSS:f({},g.current?{}:{transform:l.TrasformString(A)}),children:S})}))},l={TrasformString:t=>`translateX( calc( ${-100*t}% - ${12*t}px ) )`,EffectStart:(t,e)=>{let{x:u,y:d}=c.getCursor(t),i=t.currentTarget,r=t.target;if(["SELECT","BUTTON","LABEL","INPUT"].includes(r.tagName))return;e=T(f({},e),{x:u-e.x+window.scrollX,y:d-e.y+window.scrollY,effectStartAt:new Date().getTime(),width:h("#Swiper-"+e.id).position().width});let{swipeId:o}=i.dataset;o==e.id&&c(document).addEvent({eventID:"SwipeMouseMove",eventType:"mousemove",callback:s=>{l.EffectCheck(s,e)},options:{passive:!1}}).addEvent({eventID:"SwipeTouchMove",eventType:"touchmove",callback:s=>{l.EffectCheck(s,e)},options:{passive:!1}}).addEvent({eventID:"SwipeMouseUp",eventType:"mouseup",callback:s=>{l.EffectEnd(s,e)},options:{passive:!1}}).addEvent({eventID:"SwipeTouchEnd",eventType:"touchend",callback:s=>{l.EffectEnd(s,e)},options:{passive:!1}})},EffectCheck:(t,e)=>{if(e.process)return;let{x:u,y:d}=c.getCursor(t),i=Math.abs(u-e.x+window.scrollX),r=Math.abs(d-e.y+window.scrollY);if(!(t.touches&&t.touches.length>1)&&!(r+i<15))if(r>i/2)c(document).removeEvent(["SwipeMouseMove","SwipeTouchMove"]);else{e.process=!0;let o=e.index+(e.loop?1:0);h("#Swiper-"+e.id).children(o-1).addClass(a("Display")),c(document).addEvent({eventID:"SwipeCheckMouseMove",eventType:"mousemove",callback:s=>{l.EffectMove(s,e)},options:{passive:!1}}).addEvent({eventID:"SwipeCheckTouchMove",eventType:"touchmove",callback:s=>{l.EffectMove(s,e)},options:{passive:!1}}),t.preventDefault();return}},EffectMove:(t,e)=>{if(t.touches&&t.touches.length>1)return;let{x:u}=c.getCursor(t),d=u-e.x+window.scrollX,r=e.index+(e.loop?1:0)-d/e.width;if(r<0)r/=2;else if(r>e.maxIndex){let o=r-e.maxIndex;r=e.maxIndex+o/2}h("#Swiper-"+e.id).css({transition:"0s",transform:l.TrasformString(r)}),t.preventDefault()},EffectEnd:(t,e)=>{if(e.process){let d=c.getCursor(t).x-e.x+window.scrollX,i=new Date().getTime(),r=i-e.effectStartAt,o=e.index+(e.loop?1:0),s=0;r<400?s=o-(+(d>0)*2-1):s=Math.round(o-d/e.width),s=Math.max(Math.min(s,e.maxIndex),e.minIndex),e.process=!1,o===s?(e.effectStartAt=i,h("#Swiper-"+e.id).css({transition:".2s",transform:l.TrasformString(s)}).await(310).css({transition:"0s"}).children().removeClass(a("Display")).parent().children(o).addClass(a("Display"))):e.set_event({eventType:"usr",index:s+e.minIndex})}c(document).removeEvent(["SwipeMouseMove","SwipeTouchMove","SwipeCheckMouseMove","SwipeCheckTouchMove","SwipeMouseUp","SwipeTouchEnd"])}},V=t=>I(B,T(f({},t),{slideIndex:Math.max(Math.min(t.slideIndex,t.slides.length-1),0)}));export{V as SwipeView,V as default};
|