@cal.macconnachie/web-components 2.6.0 → 2.6.1
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/index.d.ts +0 -1
- package/dist/index.js +18 -33
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -5736,16 +5736,20 @@ const Pi = () => R({
|
|
|
5736
5736
|
class ue extends M {
|
|
5737
5737
|
constructor() {
|
|
5738
5738
|
super(...arguments), this.size = "md", this.variant = "default", this.interactive = !1, this.role = "list", this.isPulling = !1, this.pullDistance = 0, this.startY = 0, this.pullThreshold = 80, this.handleTouchStart = (e) => {
|
|
5739
|
-
this.
|
|
5739
|
+
this.scrollTop === 0 && (this.startY = e.touches[0].clientY);
|
|
5740
5740
|
}, this.handleTouchMove = (e) => {
|
|
5741
|
-
if (
|
|
5741
|
+
if (this.startY === 0) return;
|
|
5742
5742
|
const i = e.touches[0].clientY - this.startY;
|
|
5743
|
-
i >
|
|
5743
|
+
i > 5 && this.scrollTop === 0 ? (e.preventDefault(), this.isPulling = !0, this.pullDistance = Math.min(i * 0.5, this.pullThreshold * 1.5)) : i <= 0 && (this.startY = 0, this.isPulling = !1, this.pullDistance = 0);
|
|
5744
5744
|
}, this.handleTouchEnd = () => {
|
|
5745
|
-
|
|
5745
|
+
if (!this.isPulling) {
|
|
5746
|
+
this.startY = 0;
|
|
5747
|
+
return;
|
|
5748
|
+
}
|
|
5749
|
+
this.pullDistance >= this.pullThreshold && this.dispatchEvent(new CustomEvent("list-pulled", {
|
|
5746
5750
|
bubbles: !0,
|
|
5747
5751
|
composed: !0
|
|
5748
|
-
})), this.isPulling = !1, this.pullDistance = 0, this.startY = 0
|
|
5752
|
+
})), this.isPulling = !1, this.pullDistance = 0, this.startY = 0;
|
|
5749
5753
|
};
|
|
5750
5754
|
}
|
|
5751
5755
|
static {
|
|
@@ -5754,6 +5758,7 @@ class ue extends M {
|
|
|
5754
5758
|
display: block;
|
|
5755
5759
|
width: 100%;
|
|
5756
5760
|
position: relative;
|
|
5761
|
+
overflow-y: auto;
|
|
5757
5762
|
-ms-overflow-style: none;
|
|
5758
5763
|
scrollbar-width: none;
|
|
5759
5764
|
}
|
|
@@ -5764,13 +5769,7 @@ class ue extends M {
|
|
|
5764
5769
|
|
|
5765
5770
|
.base-list-wrapper {
|
|
5766
5771
|
position: relative;
|
|
5767
|
-
|
|
5768
|
-
-ms-overflow-style: none;
|
|
5769
|
-
scrollbar-width: none;
|
|
5770
|
-
}
|
|
5771
|
-
|
|
5772
|
-
.base-list-wrapper::-webkit-scrollbar {
|
|
5773
|
-
display: none;
|
|
5772
|
+
width: 100%;
|
|
5774
5773
|
}
|
|
5775
5774
|
|
|
5776
5775
|
.pull-indicator {
|
|
@@ -5795,11 +5794,6 @@ class ue extends M {
|
|
|
5795
5794
|
.pull-indicator__icon {
|
|
5796
5795
|
font-size: 24px;
|
|
5797
5796
|
color: var(--color-text-muted);
|
|
5798
|
-
transition: transform var(--transition-normal);
|
|
5799
|
-
}
|
|
5800
|
-
|
|
5801
|
-
.pull-indicator--threshold .pull-indicator__icon {
|
|
5802
|
-
transform: rotate(180deg);
|
|
5803
5797
|
}
|
|
5804
5798
|
|
|
5805
5799
|
.base-list {
|
|
@@ -5808,12 +5802,6 @@ class ue extends M {
|
|
|
5808
5802
|
width: 100%;
|
|
5809
5803
|
background-color: inherit;
|
|
5810
5804
|
transition: transform var(--transition-normal);
|
|
5811
|
-
-ms-overflow-style: none;
|
|
5812
|
-
scrollbar-width: none;
|
|
5813
|
-
}
|
|
5814
|
-
|
|
5815
|
-
.base-list::-webkit-scrollbar {
|
|
5816
|
-
display: none;
|
|
5817
5805
|
}
|
|
5818
5806
|
|
|
5819
5807
|
.base-list--pulling {
|
|
@@ -5870,18 +5858,16 @@ class ue extends M {
|
|
|
5870
5858
|
`;
|
|
5871
5859
|
}
|
|
5872
5860
|
connectedCallback() {
|
|
5873
|
-
super.connectedCallback(), this.pullActionIcon && this.
|
|
5874
|
-
this.listElement = this.shadowRoot?.querySelector(".base-list"), this.setupPullListeners();
|
|
5875
|
-
});
|
|
5861
|
+
super.connectedCallback(), this.pullActionIcon && this.setupPullListeners();
|
|
5876
5862
|
}
|
|
5877
5863
|
disconnectedCallback() {
|
|
5878
5864
|
super.disconnectedCallback(), this.removePullListeners();
|
|
5879
5865
|
}
|
|
5880
5866
|
setupPullListeners() {
|
|
5881
|
-
this.
|
|
5867
|
+
this.addEventListener("touchstart", this.handleTouchStart, { passive: !0 }), this.addEventListener("touchmove", this.handleTouchMove, { passive: !1 }), this.addEventListener("touchend", this.handleTouchEnd, { passive: !0 });
|
|
5882
5868
|
}
|
|
5883
5869
|
removePullListeners() {
|
|
5884
|
-
this.
|
|
5870
|
+
this.removeEventListener("touchstart", this.handleTouchStart), this.removeEventListener("touchmove", this.handleTouchMove), this.removeEventListener("touchend", this.handleTouchEnd);
|
|
5885
5871
|
}
|
|
5886
5872
|
render() {
|
|
5887
5873
|
const e = {
|
|
@@ -5892,14 +5878,13 @@ class ue extends M {
|
|
|
5892
5878
|
"base-list--pulling": this.isPulling
|
|
5893
5879
|
}, t = {
|
|
5894
5880
|
"pull-indicator": !0,
|
|
5895
|
-
"pull-indicator--active": this.isPulling
|
|
5896
|
-
|
|
5897
|
-
}, i = this.isPulling ? `transform: translateY(${this.pullDistance}px)` : "", s = this.isPulling ? `transform: translateY(${Math.max(-100 + this.pullDistance / this.pullThreshold * 100, -100)}%)` : "";
|
|
5881
|
+
"pull-indicator--active": this.isPulling
|
|
5882
|
+
}, i = this.isPulling ? `transform: translateY(${this.pullDistance}px)` : "", s = Math.min(this.pullDistance / this.pullThreshold * 180, 180), o = this.isPulling ? `transform: translateY(${Math.max(-100 + this.pullDistance / this.pullThreshold * 100, -100)}%)` : "", a = `transform: rotate(${s}deg)`;
|
|
5898
5883
|
return f`
|
|
5899
5884
|
<div class="base-list-wrapper">
|
|
5900
5885
|
${this.pullActionIcon ? f`
|
|
5901
|
-
<div class=${S(t)} style=${
|
|
5902
|
-
<span class="pull-indicator__icon">${this.pullActionIcon}</span>
|
|
5886
|
+
<div class=${S(t)} style=${o}>
|
|
5887
|
+
<span class="pull-indicator__icon" style=${a}>${this.pullActionIcon}</span>
|
|
5903
5888
|
</div>
|
|
5904
5889
|
` : ""}
|
|
5905
5890
|
<div class=${S(e)} role=${this.role} style=${i}>
|