@ionic/core 8.7.17-dev.11770319814.172b4f50 → 8.7.17-dev.11770405784.157a3c10
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/components/ion-refresher.js +3 -32
- package/components/ion-segment-view.js +11 -5
- package/dist/cjs/ion-refresher_2.cjs.entry.js +3 -32
- package/dist/cjs/ion-segment-view.cjs.entry.js +10 -5
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/refresher/refresher.js +4 -70
- package/dist/collection/components/segment-view/segment-view.ios.css +2 -1
- package/dist/collection/components/segment-view/segment-view.js +28 -3
- package/dist/collection/components/segment-view/segment-view.md.css +2 -1
- package/dist/docs.json +33 -49
- package/dist/esm/ion-refresher_2.entry.js +3 -32
- package/dist/esm/ion-segment-view.entry.js +10 -5
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/html.html-data.json +5 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-639dd543.entry.js +4 -0
- package/dist/ionic/p-9a2d390d.entry.js +4 -0
- package/dist/types/components/refresher/refresher-interface.d.ts +0 -7
- package/dist/types/components/refresher/refresher.d.ts +3 -16
- package/dist/types/components/segment-view/segment-view.d.ts +4 -0
- package/dist/types/components.d.ts +15 -16
- package/dist/types/interface.d.ts +1 -1
- package/hydrate/index.js +14 -37
- package/hydrate/index.mjs +14 -37
- package/package.json +1 -1
- package/dist/ionic/p-020af078.entry.js +0 -4
- package/dist/ionic/p-90f2d3ff.entry.js +0 -4
package/hydrate/index.mjs
CHANGED
|
@@ -29698,8 +29698,6 @@ class Refresher {
|
|
|
29698
29698
|
this.ionRefresh = createEvent(this, "ionRefresh", 7);
|
|
29699
29699
|
this.ionPull = createEvent(this, "ionPull", 7);
|
|
29700
29700
|
this.ionStart = createEvent(this, "ionStart", 7);
|
|
29701
|
-
this.ionPullStart = createEvent(this, "ionPullStart", 7);
|
|
29702
|
-
this.ionPullEnd = createEvent(this, "ionPullEnd", 7);
|
|
29703
29701
|
this.appliedStyles = false;
|
|
29704
29702
|
this.didStart = false;
|
|
29705
29703
|
this.progress = 0;
|
|
@@ -29754,8 +29752,8 @@ class Refresher {
|
|
|
29754
29752
|
* than `1`. The default value is `1` which is equal to the speed of the cursor.
|
|
29755
29753
|
* If a negative value is passed in, the factor will be `1` instead.
|
|
29756
29754
|
*
|
|
29757
|
-
* For example
|
|
29758
|
-
* `10` pixels, instead of `10` pixels
|
|
29755
|
+
* For example: If the value passed is `1.2` and the content is dragged by
|
|
29756
|
+
* `10` pixels, instead of `10` pixels the content will be pulled by `12` pixels
|
|
29759
29757
|
* (an increase of 20 percent). If the value passed is `0.8`, the dragged amount
|
|
29760
29758
|
* will be `8` pixels, less than the amount the cursor has moved.
|
|
29761
29759
|
*
|
|
@@ -29805,9 +29803,6 @@ class Refresher {
|
|
|
29805
29803
|
this.animations = [];
|
|
29806
29804
|
this.progress = 0;
|
|
29807
29805
|
this.state = 1 /* RefresherState.Inactive */;
|
|
29808
|
-
this.ionPullEnd.emit({
|
|
29809
|
-
reason: state === 32 /* RefresherState.Completing */ ? 'complete' : 'cancel',
|
|
29810
|
-
});
|
|
29811
29806
|
}
|
|
29812
29807
|
async setupiOSNativeRefresher(pullingSpinner, refreshingSpinner) {
|
|
29813
29808
|
this.elementToTransform = this.scrollEl;
|
|
@@ -29840,7 +29835,6 @@ class Refresher {
|
|
|
29840
29835
|
if (!this.didStart) {
|
|
29841
29836
|
this.didStart = true;
|
|
29842
29837
|
this.ionStart.emit();
|
|
29843
|
-
this.ionPullStart.emit();
|
|
29844
29838
|
}
|
|
29845
29839
|
// emit "pulling" on every move
|
|
29846
29840
|
if (this.pointerDown) {
|
|
@@ -29916,7 +29910,6 @@ class Refresher {
|
|
|
29916
29910
|
this.lastVelocityY = ev.velocityY;
|
|
29917
29911
|
},
|
|
29918
29912
|
onEnd: () => {
|
|
29919
|
-
const hadStarted = this.didStart;
|
|
29920
29913
|
this.pointerDown = false;
|
|
29921
29914
|
this.didStart = false;
|
|
29922
29915
|
if (this.needsCompletion) {
|
|
@@ -29926,13 +29919,6 @@ class Refresher {
|
|
|
29926
29919
|
else if (this.didRefresh) {
|
|
29927
29920
|
readTask(() => translateElement(this.elementToTransform, `${this.el.clientHeight}px`));
|
|
29928
29921
|
}
|
|
29929
|
-
else if (hadStarted) {
|
|
29930
|
-
/**
|
|
29931
|
-
* User started pulling but released before reaching the refresh threshold.
|
|
29932
|
-
* Emit ionPullEnd to complete the event pair.
|
|
29933
|
-
*/
|
|
29934
|
-
this.ionPullEnd.emit({ reason: 'cancel' });
|
|
29935
|
-
}
|
|
29936
29922
|
},
|
|
29937
29923
|
});
|
|
29938
29924
|
this.disabledChanged();
|
|
@@ -29979,7 +29965,6 @@ class Refresher {
|
|
|
29979
29965
|
ev.data.animation = animation;
|
|
29980
29966
|
animation.progressStart(false, 0);
|
|
29981
29967
|
this.ionStart.emit();
|
|
29982
|
-
this.ionPullStart.emit();
|
|
29983
29968
|
this.animations.push(animation);
|
|
29984
29969
|
return;
|
|
29985
29970
|
}
|
|
@@ -30002,7 +29987,6 @@ class Refresher {
|
|
|
30002
29987
|
this.animations = [];
|
|
30003
29988
|
this.gesture.enable(true);
|
|
30004
29989
|
this.state = 1 /* RefresherState.Inactive */;
|
|
30005
|
-
this.ionPullEnd.emit({ reason: 'cancel' });
|
|
30006
29990
|
});
|
|
30007
29991
|
return;
|
|
30008
29992
|
}
|
|
@@ -30247,7 +30231,6 @@ class Refresher {
|
|
|
30247
30231
|
if (!this.didStart) {
|
|
30248
30232
|
this.didStart = true;
|
|
30249
30233
|
this.ionStart.emit();
|
|
30250
|
-
this.ionPullStart.emit();
|
|
30251
30234
|
}
|
|
30252
30235
|
// emit "pulling" on every move
|
|
30253
30236
|
this.ionPull.emit();
|
|
@@ -30291,15 +30274,6 @@ class Refresher {
|
|
|
30291
30274
|
* available right away.
|
|
30292
30275
|
*/
|
|
30293
30276
|
this.restoreOverflowStyle();
|
|
30294
|
-
/**
|
|
30295
|
-
* If ionPullStart was emitted, we need to emit ionPullEnd
|
|
30296
|
-
* even though the gesture was aborted before reaching the
|
|
30297
|
-
* pulling threshold.
|
|
30298
|
-
*/
|
|
30299
|
-
if (this.didStart) {
|
|
30300
|
-
this.didStart = false;
|
|
30301
|
-
this.ionPullEnd.emit({ reason: 'cancel' });
|
|
30302
|
-
}
|
|
30303
30277
|
}
|
|
30304
30278
|
}
|
|
30305
30279
|
beginRefresh() {
|
|
@@ -30346,9 +30320,6 @@ class Refresher {
|
|
|
30346
30320
|
if (this.contentFullscreen && this.backgroundContentEl) {
|
|
30347
30321
|
(_a = this.backgroundContentEl) === null || _a === void 0 ? void 0 : _a.style.removeProperty('--offset-top');
|
|
30348
30322
|
}
|
|
30349
|
-
this.ionPullEnd.emit({
|
|
30350
|
-
reason: state === 32 /* RefresherState.Completing */ ? 'complete' : 'cancel',
|
|
30351
|
-
});
|
|
30352
30323
|
}, 600);
|
|
30353
30324
|
// reset the styles on the scroll element
|
|
30354
30325
|
// set that the refresh is actively cancelling/completing
|
|
@@ -30402,7 +30373,7 @@ class Refresher {
|
|
|
30402
30373
|
}
|
|
30403
30374
|
render() {
|
|
30404
30375
|
const mode = getIonMode$1(this);
|
|
30405
|
-
return (hAsync(Host, { key: '
|
|
30376
|
+
return (hAsync(Host, { key: '2d1bd880877b698604542ab2d602d38b9504d975', slot: "fixed", class: {
|
|
30406
30377
|
[mode]: true,
|
|
30407
30378
|
// Used internally for styling
|
|
30408
30379
|
[`refresher-${mode}`]: true,
|
|
@@ -33511,9 +33482,9 @@ class SegmentContent {
|
|
|
33511
33482
|
}; }
|
|
33512
33483
|
}
|
|
33513
33484
|
|
|
33514
|
-
const segmentViewIosCss = ":host{display:-ms-flexbox;display:flex;height:100%;overflow-x:scroll;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;scrollbar-width:none;-ms-overflow-style:none}:host::-webkit-scrollbar{display:none}:host(.segment-view-disabled){-ms-touch-action:none;touch-action:none;overflow-x:hidden}:host(.segment-view-scroll-disabled){pointer-events:none}:host(.segment-view-disabled){opacity:0.3}";
|
|
33485
|
+
const segmentViewIosCss = ":host{display:-ms-flexbox;display:flex;height:100%;overflow-x:scroll;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;scrollbar-width:none;-ms-overflow-style:none}:host::-webkit-scrollbar{display:none}:host(.segment-view-disabled),:host(.segment-view-swipe-disabled){-ms-touch-action:none;touch-action:none;overflow-x:hidden}:host(.segment-view-scroll-disabled){pointer-events:none}:host(.segment-view-disabled){opacity:0.3}";
|
|
33515
33486
|
|
|
33516
|
-
const segmentViewMdCss = ":host{display:-ms-flexbox;display:flex;height:100%;overflow-x:scroll;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;scrollbar-width:none;-ms-overflow-style:none}:host::-webkit-scrollbar{display:none}:host(.segment-view-disabled){-ms-touch-action:none;touch-action:none;overflow-x:hidden}:host(.segment-view-scroll-disabled){pointer-events:none}:host(.segment-view-disabled){opacity:0.3}";
|
|
33487
|
+
const segmentViewMdCss = ":host{display:-ms-flexbox;display:flex;height:100%;overflow-x:scroll;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;scrollbar-width:none;-ms-overflow-style:none}:host::-webkit-scrollbar{display:none}:host(.segment-view-disabled),:host(.segment-view-swipe-disabled){-ms-touch-action:none;touch-action:none;overflow-x:hidden}:host(.segment-view-scroll-disabled){pointer-events:none}:host(.segment-view-disabled){opacity:0.3}";
|
|
33517
33488
|
|
|
33518
33489
|
class SegmentView {
|
|
33519
33490
|
constructor(hostRef) {
|
|
@@ -33525,6 +33496,10 @@ class SegmentView {
|
|
|
33525
33496
|
* If `true`, the segment view cannot be interacted with.
|
|
33526
33497
|
*/
|
|
33527
33498
|
this.disabled = false;
|
|
33499
|
+
/**
|
|
33500
|
+
* If `true`, users will be able to swipe the segment view to navigate between segment contents.
|
|
33501
|
+
*/
|
|
33502
|
+
this.swipeGesture = true;
|
|
33528
33503
|
}
|
|
33529
33504
|
handleScroll(ev) {
|
|
33530
33505
|
var _a;
|
|
@@ -33612,11 +33587,12 @@ class SegmentView {
|
|
|
33612
33587
|
return Array.from(this.el.querySelectorAll('ion-segment-content'));
|
|
33613
33588
|
}
|
|
33614
33589
|
render() {
|
|
33615
|
-
const { disabled, isManualScroll } = this;
|
|
33616
|
-
return (hAsync(Host, { key: '
|
|
33590
|
+
const { disabled, isManualScroll, swipeGesture } = this;
|
|
33591
|
+
return (hAsync(Host, { key: '565cccce7f0cfc4c71508777cc60292d6f24334f', class: {
|
|
33617
33592
|
'segment-view-disabled': disabled,
|
|
33618
33593
|
'segment-view-scroll-disabled': isManualScroll === false,
|
|
33619
|
-
|
|
33594
|
+
'segment-view-swipe-disabled': swipeGesture === false,
|
|
33595
|
+
} }, hAsync("slot", { key: '4118c240364467302b8f593e33c37837ea5d06f0' })));
|
|
33620
33596
|
}
|
|
33621
33597
|
get el() { return getElement(this); }
|
|
33622
33598
|
static get style() { return {
|
|
@@ -33628,6 +33604,7 @@ class SegmentView {
|
|
|
33628
33604
|
"$tagName$": "ion-segment-view",
|
|
33629
33605
|
"$members$": {
|
|
33630
33606
|
"disabled": [4],
|
|
33607
|
+
"swipeGesture": [4, "swipe-gesture"],
|
|
33631
33608
|
"isManualScroll": [32],
|
|
33632
33609
|
"setContent": [64]
|
|
33633
33610
|
},
|
package/package.json
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
-
*/
|
|
4
|
-
import{r as s,c as t,h as e,d as o,g as l}from"./p-C8IsBmNU.js";import{i}from"./p-C53feagD.js";const n=class{constructor(e){s(this,e),this.ionSegmentViewScroll=t(this,"ionSegmentViewScroll",7),this.scrollEndTimeout=null,this.isTouching=!1,this.disabled=!1}handleScroll(s){var t;const{scrollLeft:e,scrollWidth:o,clientWidth:l}=s.target,n=o-l,a=(i(this.el)?-1:1)*(e/n);this.ionSegmentViewScroll.emit({scrollRatio:a,isManualScroll:null===(t=this.isManualScroll)||void 0===t||t}),this.resetScrollEndTimeout()}handleScrollStart(){this.scrollEndTimeout&&(clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=null),this.isTouching=!0}handleTouchEnd(){this.isTouching=!1}resetScrollEndTimeout(){this.scrollEndTimeout&&(clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=null),this.scrollEndTimeout=setTimeout((()=>{this.checkForScrollEnd()}),100)}checkForScrollEnd(){this.isTouching||(this.isManualScroll=void 0)}async setContent(s,t=!0){const e=this.getSegmentContents().findIndex((t=>t.id===s));if(-1===e)return;this.isManualScroll=!1,this.resetScrollEndTimeout();const o=e*this.el.offsetWidth;this.el.scrollTo({top:0,left:(i(this.el)?-1:1)*o,behavior:t?"smooth":"instant"})}getSegmentContents(){return Array.from(this.el.querySelectorAll("ion-segment-content"))}render(){const{disabled:s,isManualScroll:t}=this;return e(o,{key:"e180b67bb3143a5f4611fb358c037be6fc782a8f",class:{"segment-view-disabled":s,"segment-view-scroll-disabled":!1===t}},e("slot",{key:"41c11d6a7406a10f5c64a2e73abfc072afd8fc73"}))}get el(){return l(this)}};n.style={ios:":host{display:-ms-flexbox;display:flex;height:100%;overflow-x:scroll;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;scrollbar-width:none;-ms-overflow-style:none}:host::-webkit-scrollbar{display:none}:host(.segment-view-disabled){-ms-touch-action:none;touch-action:none;overflow-x:hidden}:host(.segment-view-scroll-disabled){pointer-events:none}:host(.segment-view-disabled){opacity:0.3}",md:":host{display:-ms-flexbox;display:flex;height:100%;overflow-x:scroll;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;scrollbar-width:none;-ms-overflow-style:none}:host::-webkit-scrollbar{display:none}:host(.segment-view-disabled){-ms-touch-action:none;touch-action:none;overflow-x:hidden}:host(.segment-view-scroll-disabled){pointer-events:none}:host(.segment-view-disabled){opacity:0.3}"};export{n as ion_segment_view}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
-
*/
|
|
4
|
-
import{w as e,r,c as s,a as i,j as t,h as n,d as o,g as h,e as a}from"./p-C8IsBmNU.js";import{g as f}from"./p-hHmYLOfE.js";import{I as l,b as c,p,g as d}from"./p-CwgG81ZD.js";import{c as g,t as m,e as u,g as b,r as v}from"./p-CTfR9YZG.js";import{d as x,I as y}from"./p-CKvCXMs9.js";import{b as k}from"./p-BFvmZNyx.js";import{c as w}from"./p-DDb5r57F.js";import{E as j,a as S}from"./p-DbQ5QkTP.js";import{h as C,i as E}from"./p-DV3sJJW8.js";import{S as R}from"./p-D4RIp70E.js";import"./p-CIGNaXM1.js";import"./p-ZjP4CjeZ.js";const M=e=>{const r=e.querySelector("ion-spinner"),s=r.shadowRoot.querySelector("circle"),i=e.querySelector(".spinner-arrow-container"),t=e.querySelector(".arrow-container"),n=t?t.querySelector("ion-icon"):null,o=w().duration(1e3).easing("ease-out"),h=w().addElement(i).keyframes([{offset:0,opacity:"0.3"},{offset:.45,opacity:"0.3"},{offset:.55,opacity:"1"},{offset:1,opacity:"1"}]),a=w().addElement(s).keyframes([{offset:0,strokeDasharray:"1px, 200px"},{offset:.2,strokeDasharray:"1px, 200px"},{offset:.55,strokeDasharray:"100px, 200px"},{offset:1,strokeDasharray:"100px, 200px"}]),f=w().addElement(r).keyframes([{offset:0,transform:"rotate(-90deg)"},{offset:1,transform:"rotate(210deg)"}]);if(t&&n){const e=w().addElement(t).keyframes([{offset:0,transform:"rotate(0deg)"},{offset:.3,transform:"rotate(0deg)"},{offset:.55,transform:"rotate(280deg)"},{offset:1,transform:"rotate(400deg)"}]),r=w().addElement(n).keyframes([{offset:0,transform:"translateX(2px) scale(0)"},{offset:.3,transform:"translateX(2px) scale(0)"},{offset:.55,transform:"translateX(-1.5px) scale(1)"},{offset:1,transform:"translateX(-1.5px) scale(1)"}]);o.addAnimation([e,r])}return o.addAnimation([h,a,f])},N=(r,s,i=200)=>{if(!r)return Promise.resolve();const t=m(r,i);return e((()=>{r.style.setProperty("transition",`${i}ms all ease-out`),void 0===s?r.style.removeProperty("transform"):r.style.setProperty("transform",`translate3d(0px, ${s}, 0px)`)})),t},P=()=>navigator.maxTouchPoints>0&&CSS.supports("background: -webkit-named-image(apple-pay-logo-black)"),Y=async(e,r)=>{const s=e.querySelector("ion-refresher-content");if(!s)return Promise.resolve(!1);await new Promise((e=>g(s,e)));const i=e.querySelector("ion-refresher-content .refresher-pulling ion-spinner"),t=e.querySelector("ion-refresher-content .refresher-refreshing ion-spinner");return null!==i&&null!==t&&("ios"===r&&P()||"md"===r)},D=class{constructor(e){r(this,e),this.ionRefresh=s(this,"ionRefresh",7),this.ionPull=s(this,"ionPull",7),this.ionStart=s(this,"ionStart",7),this.ionPullStart=s(this,"ionPullStart",7),this.ionPullEnd=s(this,"ionPullEnd",7),this.appliedStyles=!1,this.didStart=!1,this.progress=0,this.pointerDown=!1,this.needsCompletion=!1,this.didRefresh=!1,this.contentFullscreen=!1,this.lastVelocityY=0,this.animations=[],this.nativeRefresher=!1,this.state=1,this.pullMin=60,this.pullMax=this.pullMin+60,this.closeDuration="280ms",this.snapbackDuration="280ms",this.pullFactor=1,this.disabled=!1}disabledChanged(){this.gesture&&this.gesture.enable(!this.disabled)}async checkNativeRefresher(){const e=await Y(this.el,k(this));if(e&&!this.nativeRefresher){const e=this.el.closest("ion-content");this.setupNativeRefresher(e)}else e||this.destroyNativeRefresher()}destroyNativeRefresher(){this.scrollEl&&this.scrollListenerCallback&&(this.scrollEl.removeEventListener("scroll",this.scrollListenerCallback),this.scrollListenerCallback=void 0),this.nativeRefresher=!1}async resetNativeRefresher(e,r){this.state=r,"ios"===k(this)?await N(e,void 0,300):await m(this.el.querySelector(".refresher-refreshing-icon"),200),this.didRefresh=!1,this.needsCompletion=!1,this.pointerDown=!1,this.animations.forEach((e=>e.destroy())),this.animations=[],this.progress=0,this.state=1,this.ionPullEnd.emit({reason:32===r?"complete":"cancel"})}async setupiOSNativeRefresher(r,s){this.elementToTransform=this.scrollEl;const t=r.shadowRoot.querySelectorAll("svg");let n=.16*this.scrollEl.clientHeight;const o=t.length;e((()=>t.forEach((e=>e.style.setProperty("animation","none"))))),this.scrollListenerCallback=()=>{(this.pointerDown||1!==this.state)&&i((()=>{const r=this.scrollEl.scrollTop,i=this.el.clientHeight;if(r>0){if(8===this.state){const t=u(0,r/(.5*i),1);return void e((()=>{s.style.setProperty("opacity",(1-t).toString())}))}return}this.pointerDown&&(this.didStart||(this.didStart=!0,this.ionStart.emit(),this.ionPullStart.emit()),this.pointerDown&&this.ionPull.emit());const h=this.didStart?30:0,a=this.progress=u(0,(Math.abs(r)-h)/n,1);if(8===this.state||1===a){if(this.pointerDown&&(f=s,l=this.lastVelocityY,e((()=>{f.style.setProperty("--refreshing-rotation-duration",l>=1?"0.5s":"2s"),f.style.setProperty("opacity","1")}))),!this.didRefresh){this.beginRefresh(),this.didRefresh=!0,x({style:y.Light});const e=document.activeElement;void 0!==(null==e?void 0:e.blur)&&e.blur(),this.pointerDown||N(this.elementToTransform,`${i}px`)}}else this.state=2,((r,s,i)=>{e((()=>{r.forEach(((e,r)=>{const t=r*(1/s),n=u(0,(i-t)/(1-t),1);e.style.setProperty("opacity",n.toString())}))}))})(t,o,a);var f,l}))},this.scrollEl.addEventListener("scroll",this.scrollListenerCallback),this.gesture=(await import("./p-Cl0B-RWe.js")).createGesture({el:this.scrollEl,gestureName:"refresher",gesturePriority:31,direction:"y",threshold:5,onStart:()=>{this.pointerDown=!0,this.didRefresh||N(this.elementToTransform,"0px"),0===n&&(n=.16*this.scrollEl.clientHeight)},onMove:e=>{this.lastVelocityY=e.velocityY},onEnd:()=>{const e=this.didStart;this.pointerDown=!1,this.didStart=!1,this.needsCompletion?(this.resetNativeRefresher(this.elementToTransform,32),this.needsCompletion=!1):this.didRefresh?i((()=>N(this.elementToTransform,`${this.el.clientHeight}px`))):e&&this.ionPullEnd.emit({reason:"cancel"})}}),this.disabledChanged()}async setupMDNativeRefresher(r,s,i){const t=b(s).querySelector("circle"),n=this.el.querySelector("ion-refresher-content .refresher-pulling-icon"),o=b(i).querySelector("circle");null!==t&&null!==o&&e((()=>{t.style.setProperty("animation","none"),i.style.setProperty("animation-delay","-655ms"),o.style.setProperty("animation-delay","-655ms")})),this.gesture=(await import("./p-Cl0B-RWe.js")).createGesture({el:this.scrollEl,gestureName:"refresher",gesturePriority:31,direction:"y",threshold:5,canStart:()=>8!==this.state&&32!==this.state&&0===this.scrollEl.scrollTop,onStart:e=>{this.progress=0,e.data={animation:void 0,didStart:!1,cancelled:!1}},onMove:s=>{if(s.velocityY<0&&0===this.progress&&!s.data.didStart||s.data.cancelled)s.data.cancelled=!0;else{if(!s.data.didStart){s.data.didStart=!0,this.state=2;const{scrollEl:i}=this,t=i.matches(l)?"overflow":"--overflow";e((()=>i.style.setProperty(t,"hidden")));const o=(e=>{const r=e.previousElementSibling;return null!==r&&"ION-HEADER"===r.tagName?"translate":"scale"})(r),h=((e,r,s)=>"scale"===e?((e,r)=>{const s=r.clientHeight,i=w().addElement(e).keyframes([{offset:0,transform:`scale(0) translateY(-${s}px)`},{offset:1,transform:"scale(1) translateY(100px)"}]);return M(e).addAnimation([i])})(r,s):((e,r)=>{const s=r.clientHeight,i=w().addElement(e).keyframes([{offset:0,transform:`translateY(-${s}px)`},{offset:1,transform:"translateY(100px)"}]);return M(e).addAnimation([i])})(r,s))(o,n,this.el);return s.data.animation=h,h.progressStart(!1,0),this.ionStart.emit(),this.ionPullStart.emit(),void this.animations.push(h)}this.progress=u(0,s.deltaY/180*.5,1),s.data.animation.progressStep(this.progress),this.ionPull.emit()}},onEnd:r=>{if(!r.data.didStart)return;this.gesture.enable(!1);const{scrollEl:s}=this,i=s.matches(l)?"overflow":"--overflow";if(e((()=>s.style.removeProperty(i))),this.progress<=.4)return void r.data.animation.progressEnd(0,this.progress,500).onFinish((()=>{this.animations.forEach((e=>e.destroy())),this.animations=[],this.gesture.enable(!0),this.state=1,this.ionPullEnd.emit({reason:"cancel"})}));const t=f([0,0],[0,0],[1,1],[1,1],this.progress)[0],o=(e=>w().duration(125).addElement(e).fromTo("transform","translateY(var(--ion-pulling-refresher-translate, 100px))","translateY(0px)"))(n);this.animations.push(o),e((async()=>{n.style.setProperty("--ion-pulling-refresher-translate",100*t+"px"),r.data.animation.progressEnd(),await o.play(),this.beginRefresh(),r.data.animation.destroy(),this.gesture.enable(!0)}))}}),this.disabledChanged()}async setupNativeRefresher(e){if(this.scrollListenerCallback||!e||this.nativeRefresher||!this.scrollEl)return;this.setCss(0,"",!1,""),this.nativeRefresher=!0;const r=this.el.querySelector("ion-refresher-content .refresher-pulling ion-spinner"),s=this.el.querySelector("ion-refresher-content .refresher-refreshing ion-spinner");"ios"===k(this)?this.setupiOSNativeRefresher(r,s):this.setupMDNativeRefresher(e,r,s)}componentDidUpdate(){this.checkNativeRefresher()}async connectedCallback(){if("fixed"!==this.el.getAttribute("slot"))return void t('[ion-refresher] - Make sure you use: <ion-refresher slot="fixed">');const e=this.el.closest(c);e?g(e,(async()=>{const r=e.querySelector(l);this.scrollEl=await d(null!=r?r:e),this.backgroundContentEl=await e.getBackgroundElement(),this.contentFullscreen=e.fullscreen,await Y(this.el,k(this))?this.setupNativeRefresher(e):(this.gesture=(await import("./p-Cl0B-RWe.js")).createGesture({el:e,gestureName:"refresher",gesturePriority:31,direction:"y",threshold:20,passive:!1,canStart:()=>this.canStart(),onStart:()=>this.onStart(),onMove:e=>this.onMove(e),onEnd:()=>this.onEnd()}),this.disabledChanged())})):p(this.el)}disconnectedCallback(){this.destroyNativeRefresher(),this.scrollEl=void 0,this.gesture&&(this.gesture.destroy(),this.gesture=void 0)}async complete(){this.nativeRefresher?(this.needsCompletion=!0,this.pointerDown||v((()=>v((()=>this.resetNativeRefresher(this.elementToTransform,32)))))):this.close(32,"120ms")}async cancel(){this.nativeRefresher?this.pointerDown||v((()=>v((()=>this.resetNativeRefresher(this.elementToTransform,16))))):this.close(16,"")}getProgress(){return Promise.resolve(this.progress)}canStart(){return!(!this.scrollEl||1!==this.state||this.scrollEl.scrollTop>0)}onStart(){this.progress=0,this.state=1,this.memoizeOverflowStyle(),this.contentFullscreen&&this.backgroundContentEl&&this.backgroundContentEl.style.setProperty("--offset-top","0px")}onMove(e){if(!this.scrollEl)return;const r=e.event;if(void 0!==r.touches&&r.touches.length>1)return;if(56&this.state)return;const s=Number.isNaN(this.pullFactor)||this.pullFactor<0?1:this.pullFactor,i=e.deltaY*s;if(i<=0)return this.progress=0,this.state=1,this.appliedStyles?void this.setCss(0,"",!1,""):void 0;if(1===this.state){if(this.scrollEl.scrollTop>0)return void(this.progress=0);this.state=2}if(r.cancelable&&r.preventDefault(),this.setCss(i,"0ms",!0,""),0===i)return void(this.progress=0);const t=this.pullMin;this.progress=i/t,this.didStart||(this.didStart=!0,this.ionStart.emit(),this.ionPullStart.emit()),this.ionPull.emit(),i<t?this.state=2:i>this.pullMax?this.beginRefresh():this.state=4}onEnd(){4===this.state?this.beginRefresh():2===this.state?this.cancel():1===this.state&&(this.restoreOverflowStyle(),this.didStart&&(this.didStart=!1,this.ionPullEnd.emit({reason:"cancel"})))}beginRefresh(){this.state=8,this.setCss(this.pullMin,this.snapbackDuration,!0,"");const e=document.activeElement;void 0!==(null==e?void 0:e.blur)&&e.blur(),this.ionRefresh.emit({complete:this.complete.bind(this)})}close(e,r){setTimeout((()=>{var r;this.state=1,this.progress=0,this.didStart=!1,this.setCss(0,"0ms",!1,"",!0),this.contentFullscreen&&this.backgroundContentEl&&(null===(r=this.backgroundContentEl)||void 0===r||r.style.removeProperty("--offset-top")),this.ionPullEnd.emit({reason:32===e?"complete":"cancel"})}),600),this.state=e,this.setCss(0,this.closeDuration,!0,r)}setCss(r,s,i,t,n=!1){this.nativeRefresher||(this.appliedStyles=r>0,e((()=>{if(this.scrollEl&&this.backgroundContentEl){const e=this.scrollEl.style,n=this.backgroundContentEl.style;e.transform=n.transform=r>0?`translateY(${r}px) translateZ(0px)`:"",e.transitionDuration=n.transitionDuration=s,e.transitionDelay=n.transitionDelay=t,e.overflow=i?"hidden":""}n&&this.restoreOverflowStyle()})))}memoizeOverflowStyle(){if(this.scrollEl){const{overflow:e,overflowX:r,overflowY:s}=this.scrollEl.style;this.overflowStyles={overflow:null!=e?e:"",overflowX:null!=r?r:"",overflowY:null!=s?s:""}}}restoreOverflowStyle(){if(void 0!==this.overflowStyles&&void 0!==this.scrollEl){const{overflow:e,overflowX:r,overflowY:s}=this.overflowStyles;this.scrollEl.style.overflow=e,this.scrollEl.style.overflowX=r,this.scrollEl.style.overflowY=s,this.overflowStyles=void 0}}render(){const e=k(this);return n(o,{key:"bed0c2f44c32ecac24b7d8326ac7c7ef1d12c44f",slot:"fixed",class:{[e]:!0,[`refresher-${e}`]:!0,"refresher-native":this.nativeRefresher,"refresher-active":1!==this.state,"refresher-pulling":2===this.state,"refresher-ready":4===this.state,"refresher-refreshing":8===this.state,"refresher-cancelling":16===this.state,"refresher-completing":32===this.state}})}get el(){return h(this)}static get watchers(){return{disabled:["disabledChanged"]}}};D.style={ios:"ion-refresher{top:0;display:none;position:absolute;width:100%;height:60px;pointer-events:none;z-index:-1}ion-refresher{inset-inline-start:0}ion-refresher.refresher-active{display:block}ion-refresher-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;height:100%}.refresher-pulling,.refresher-refreshing{display:none;width:100%}.refresher-pulling-icon,.refresher-refreshing-icon{-webkit-transform-origin:center;transform-origin:center;-webkit-transition:200ms;transition:200ms;font-size:30px;text-align:center}:host-context([dir=rtl]) .refresher-pulling-icon,:host-context([dir=rtl]) .refresher-refreshing-icon{-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}[dir=rtl] .refresher-pulling-icon,[dir=rtl] .refresher-refreshing-icon{-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}@supports selector(:dir(rtl)){.refresher-pulling-icon:dir(rtl),.refresher-refreshing-icon:dir(rtl){-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}}.refresher-pulling-text,.refresher-refreshing-text{font-size:16px;text-align:center}ion-refresher-content .arrow-container{display:none}.refresher-pulling ion-refresher-content .refresher-pulling{display:block}.refresher-ready ion-refresher-content .refresher-pulling{display:block}.refresher-ready ion-refresher-content .refresher-pulling-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.refresher-refreshing ion-refresher-content .refresher-refreshing{display:block}.refresher-cancelling ion-refresher-content .refresher-pulling{display:block}.refresher-cancelling ion-refresher-content .refresher-pulling-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-completing ion-refresher-content .refresher-refreshing{display:block}.refresher-completing ion-refresher-content .refresher-refreshing-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-native .refresher-pulling-text,.refresher-native .refresher-refreshing-text{display:none}.refresher-ios .refresher-pulling-icon,.refresher-ios .refresher-refreshing-icon{color:var(--ion-text-color, #000)}.refresher-ios .refresher-pulling-text,.refresher-ios .refresher-refreshing-text{color:var(--ion-text-color, #000)}.refresher-ios .refresher-refreshing .spinner-lines-ios line,.refresher-ios .refresher-refreshing .spinner-lines-small-ios line,.refresher-ios .refresher-refreshing .spinner-crescent circle{stroke:var(--ion-text-color, #000)}.refresher-ios .refresher-refreshing .spinner-bubbles circle,.refresher-ios .refresher-refreshing .spinner-circles circle,.refresher-ios .refresher-refreshing .spinner-dots circle{fill:var(--ion-text-color, #000)}ion-refresher.refresher-native{display:block;z-index:1}ion-refresher.refresher-native ion-spinner{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}.refresher-native .refresher-refreshing ion-spinner{--refreshing-rotation-duration:2s;display:none;-webkit-animation:var(--refreshing-rotation-duration) ease-out refresher-rotate forwards;animation:var(--refreshing-rotation-duration) ease-out refresher-rotate forwards}.refresher-native .refresher-refreshing{display:none;-webkit-animation:250ms linear refresher-pop forwards;animation:250ms linear refresher-pop forwards}.refresher-native ion-spinner{width:32px;height:32px;color:var(--ion-color-step-450, var(--ion-background-color-step-450, #747577))}.refresher-native.refresher-refreshing .refresher-pulling ion-spinner,.refresher-native.refresher-completing .refresher-pulling ion-spinner{display:none}.refresher-native.refresher-refreshing .refresher-refreshing ion-spinner,.refresher-native.refresher-completing .refresher-refreshing ion-spinner{display:block}.refresher-native.refresher-pulling .refresher-pulling ion-spinner{display:block}.refresher-native.refresher-pulling .refresher-refreshing ion-spinner{display:none}.refresher-native.refresher-completing ion-refresher-content .refresher-refreshing-icon{-webkit-transform:scale(0) rotate(180deg);transform:scale(0) rotate(180deg);-webkit-transition:300ms;transition:300ms}@-webkit-keyframes refresher-pop{0%{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}50%{-webkit-transform:scale(1.2);transform:scale(1.2);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes refresher-pop{0%{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}50%{-webkit-transform:scale(1.2);transform:scale(1.2);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes refresher-rotate{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(180deg);transform:rotate(180deg)}}@keyframes refresher-rotate{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(180deg);transform:rotate(180deg)}}",md:"ion-refresher{top:0;display:none;position:absolute;width:100%;height:60px;pointer-events:none;z-index:-1}ion-refresher{inset-inline-start:0}ion-refresher.refresher-active{display:block}ion-refresher-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;height:100%}.refresher-pulling,.refresher-refreshing{display:none;width:100%}.refresher-pulling-icon,.refresher-refreshing-icon{-webkit-transform-origin:center;transform-origin:center;-webkit-transition:200ms;transition:200ms;font-size:30px;text-align:center}:host-context([dir=rtl]) .refresher-pulling-icon,:host-context([dir=rtl]) .refresher-refreshing-icon{-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}[dir=rtl] .refresher-pulling-icon,[dir=rtl] .refresher-refreshing-icon{-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}@supports selector(:dir(rtl)){.refresher-pulling-icon:dir(rtl),.refresher-refreshing-icon:dir(rtl){-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}}.refresher-pulling-text,.refresher-refreshing-text{font-size:16px;text-align:center}ion-refresher-content .arrow-container{display:none}.refresher-pulling ion-refresher-content .refresher-pulling{display:block}.refresher-ready ion-refresher-content .refresher-pulling{display:block}.refresher-ready ion-refresher-content .refresher-pulling-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.refresher-refreshing ion-refresher-content .refresher-refreshing{display:block}.refresher-cancelling ion-refresher-content .refresher-pulling{display:block}.refresher-cancelling ion-refresher-content .refresher-pulling-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-completing ion-refresher-content .refresher-refreshing{display:block}.refresher-completing ion-refresher-content .refresher-refreshing-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-native .refresher-pulling-text,.refresher-native .refresher-refreshing-text{display:none}.refresher-md .refresher-pulling-icon,.refresher-md .refresher-refreshing-icon{color:var(--ion-text-color, #000)}.refresher-md .refresher-pulling-text,.refresher-md .refresher-refreshing-text{color:var(--ion-text-color, #000)}.refresher-md .refresher-refreshing .spinner-lines-md line,.refresher-md .refresher-refreshing .spinner-lines-small-md line,.refresher-md .refresher-refreshing .spinner-crescent circle{stroke:var(--ion-text-color, #000)}.refresher-md .refresher-refreshing .spinner-bubbles circle,.refresher-md .refresher-refreshing .spinner-circles circle,.refresher-md .refresher-refreshing .spinner-dots circle{fill:var(--ion-text-color, #000)}ion-refresher.refresher-native{display:block;z-index:1}ion-refresher.refresher-native ion-spinner{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;width:24px;height:24px;color:var(--ion-color-primary, #0054e9)}ion-refresher.refresher-native .spinner-arrow-container{display:inherit}ion-refresher.refresher-native .arrow-container{display:block;position:absolute;width:24px;height:24px}ion-refresher.refresher-native .arrow-container ion-icon{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;left:0;right:0;bottom:-4px;position:absolute;color:var(--ion-color-primary, #0054e9);font-size:12px}ion-refresher.refresher-native.refresher-pulling ion-refresher-content .refresher-pulling,ion-refresher.refresher-native.refresher-ready ion-refresher-content .refresher-pulling{display:-ms-flexbox;display:flex}ion-refresher.refresher-native.refresher-refreshing ion-refresher-content .refresher-refreshing,ion-refresher.refresher-native.refresher-completing ion-refresher-content .refresher-refreshing,ion-refresher.refresher-native.refresher-cancelling ion-refresher-content .refresher-refreshing{display:-ms-flexbox;display:flex}ion-refresher.refresher-native .refresher-pulling-icon{-webkit-transform:translateY(calc(-100% - 10px));transform:translateY(calc(-100% - 10px))}ion-refresher.refresher-native .refresher-pulling-icon,ion-refresher.refresher-native .refresher-refreshing-icon{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;border-radius:100%;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;display:-ms-flexbox;display:flex;border:1px solid var(--ion-color-step-200, var(--ion-background-color-step-200, #ececec));background:var(--ion-color-step-250, var(--ion-background-color-step-250, #ffffff));-webkit-box-shadow:0px 1px 6px rgba(0, 0, 0, 0.1);box-shadow:0px 1px 6px rgba(0, 0, 0, 0.1)}"};const T=class{constructor(e){r(this,e),this.customHTMLEnabled=a.get("innerHTMLTemplatesEnabled",j)}componentWillLoad(){if(void 0===this.pullingIcon){const e=P(),r=k(this);this.pullingIcon=a.get("refreshingIcon","ios"===r&&e?a.get("spinner",e?"lines":C):"circular")}if(void 0===this.refreshingSpinner){const e=k(this);this.refreshingSpinner=a.get("refreshingSpinner",a.get("spinner","ios"===e?"lines":"circular"))}}renderPullingText(){const{customHTMLEnabled:e,pullingText:r}=this;return e?n("div",{class:"refresher-pulling-text",innerHTML:S(r)}):n("div",{class:"refresher-pulling-text"},r)}renderRefreshingText(){const{customHTMLEnabled:e,refreshingText:r}=this;return e?n("div",{class:"refresher-refreshing-text",innerHTML:S(r)}):n("div",{class:"refresher-refreshing-text"},r)}render(){const e=this.pullingIcon,r=null!=e&&void 0!==R[e],s=k(this);return n(o,{key:"e235f8a9a84070ece2e2066ced234a64663bfa1d",class:s},n("div",{key:"9121691818ddaa35801a5f442e144ac27686cf19",class:"refresher-pulling"},this.pullingIcon&&r&&n("div",{key:"c8d65d740f1575041bd3b752c789077927397fe4",class:"refresher-pulling-icon"},n("div",{key:"309dd904977eaa788b09ea95b7fa4996a73bec5b",class:"spinner-arrow-container"},n("ion-spinner",{key:"a2a1480f67775d56ca7822e76be1e9f983bca2f9",name:this.pullingIcon,paused:!0}),"md"===s&&"circular"===this.pullingIcon&&n("div",{key:"811d7e06d324bf4b6a18a31427a43e5177f3ae3a",class:"arrow-container"},n("ion-icon",{key:"86cc48e2e8dc054ff6ff1299094da35b524be63d",icon:E,"aria-hidden":"true"})))),this.pullingIcon&&!r&&n("div",{key:"464ae097dbc95c18a2dd7dfd03f8489153dab719",class:"refresher-pulling-icon"},n("ion-icon",{key:"ed6875978b9035add562caa743a68353743d978f",icon:this.pullingIcon,lazy:!1,"aria-hidden":"true"})),void 0!==this.pullingText&&this.renderPullingText()),n("div",{key:"aff891924e44354543fec484e5cde1ca92e69904",class:"refresher-refreshing"},this.refreshingSpinner&&n("div",{key:"842d7ac4ff10a1058775493d62f31cbdcd34f7a0",class:"refresher-refreshing-icon"},n("ion-spinner",{key:"8c3e6195501e7e78d5cde1e3ad1fef90fd4a953f",name:this.refreshingSpinner})),void 0!==this.refreshingText&&this.renderRefreshingText()))}get el(){return h(this)}};export{D as ion_refresher,T as ion_refresher_content}
|