@moni-labs/moni-ui 0.4.16 → 0.4.18
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/browser/moni-ui.iife.min.js +6 -1
- package/dist/browser/moni-ui.iife.min.js.br +0 -0
- package/dist/browser/moni-ui.iife.min.js.gz +0 -0
- package/dist/browser/moni-ui.iife.min.js.map +1 -1
- package/dist/browser/moni-ui.min.js +32 -2
- package/dist/browser/moni-ui.min.js.br +0 -0
- package/dist/browser/moni-ui.min.js.gz +0 -0
- package/dist/browser/moni-ui.min.js.map +1 -1
- package/dist/cdn/components/moni-bottom-sheet.js +6 -1
- package/dist/cdn/importmap.json +98 -98
- package/dist/components/moni-bottom-sheet.d.ts +8 -0
- package/dist/components/moni-bottom-sheet.d.ts.map +1 -1
- package/dist/components/moni-bottom-sheet.js +81 -0
- package/docs/api.json +1 -1
- package/package.json +1 -1
- package/src/components/moni-bottom-sheet.test.ts +102 -0
- package/src/components/moni-bottom-sheet.ts +81 -0
|
@@ -1854,7 +1854,9 @@ var Je = class extends W {
|
|
|
1854
1854
|
return this._animateAndClose();
|
|
1855
1855
|
}
|
|
1856
1856
|
willUpdate(e) {
|
|
1857
|
-
e.has("open") && this.open !== e.get("open") && (this.open ? qe(this, "moni-request-open", { cancelable: !0 }) || (this.open = !1) : this._skipRequestClose || qe(this, "moni-request-close", { cancelable: !0 }) || (this.open = !0))
|
|
1857
|
+
if (e.has("open") && this.open !== e.get("open") && (this.open ? qe(this, "moni-request-open", { cancelable: !0 }) || (this.open = !1) : this._skipRequestClose || qe(this, "moni-request-close", { cancelable: !0 }) || (this.open = !0)), e.has("open") && !this.open && this._dialog && typeof this._dialog.close == "function") try {
|
|
1858
|
+
this._dialog.close();
|
|
1859
|
+
} catch {}
|
|
1858
1860
|
}
|
|
1859
1861
|
async _animateAndClose() {
|
|
1860
1862
|
if (this._isClosing || !this.open) return !1;
|
|
@@ -1929,6 +1931,9 @@ var Je = class extends W {
|
|
|
1929
1931
|
}
|
|
1930
1932
|
this._lastDeltaY = 0;
|
|
1931
1933
|
}
|
|
1934
|
+
_onCancel(e) {
|
|
1935
|
+
e.preventDefault(), this.close();
|
|
1936
|
+
}
|
|
1932
1937
|
_onPointerCancel(e) {
|
|
1933
1938
|
this._isDragging && this._onPointerUp(e);
|
|
1934
1939
|
}
|
|
@@ -1943,7 +1948,27 @@ var Je = class extends W {
|
|
|
1943
1948
|
this.modal && e.target === this._dialog && this._animateAndClose();
|
|
1944
1949
|
}
|
|
1945
1950
|
updated(e) {
|
|
1946
|
-
super.updated(e), e.has("expandedHeight") && this.style.setProperty("--moni-bottom-sheet-expanded-height", this.expandedHeight), e.has("maxWidth") && this.style.setProperty("--moni-bottom-sheet-max-width", this.maxWidth || "100%"), e.has("open") && (this.open ? (this._isClosing = !1, this._isDragging = !1, this._lastDeltaY = 0, this._dialog && (this._dialog.classList.remove("dragging", "expanded"), this._dialog.style.transform = "", this._dialog.style.height = ""), e.get("open") !== void 0 && qe(this, "moni-open"), this.positioning === "body" && this.parentNode !== document.body && (this._originalParent = this.parentNode, this._originalSibling = this.nextSibling, document.body.appendChild(this)), e.get("open") !== void 0 && setTimeout(() => qe(this, "moni-opened"), 300)) : (this._isClosing = !1, this._isDragging = !1, this._lastDeltaY = 0, this._dialog && (this._dialog.classList.remove("expanded", "dragging"), this._dialog.style.transform = "", this._dialog.style.height = ""), this.positioning === "body" && this._originalParent && this.parentNode === document.body && (this._originalParent.insertBefore(this, this._originalSibling), this._originalParent = null, this._originalSibling = null)))
|
|
1951
|
+
if (super.updated(e), e.has("expandedHeight") && this.style.setProperty("--moni-bottom-sheet-expanded-height", this.expandedHeight), e.has("maxWidth") && this.style.setProperty("--moni-bottom-sheet-max-width", this.maxWidth || "100%"), e.has("open") && (this.open ? (this._isClosing = !1, this._isDragging = !1, this._lastDeltaY = 0, this._dialog && (this._dialog.classList.remove("dragging", "expanded"), this._dialog.style.transform = "", this._dialog.style.height = ""), e.get("open") !== void 0 && qe(this, "moni-open"), this.positioning === "body" && this.parentNode !== document.body && (this._originalParent = this.parentNode, this._originalSibling = this.nextSibling, document.body.appendChild(this)), e.get("open") !== void 0 && setTimeout(() => qe(this, "moni-opened"), 300)) : (this._isClosing = !1, this._isDragging = !1, this._lastDeltaY = 0, this._dialog && (this._dialog.classList.remove("expanded", "dragging"), this._dialog.style.transform = "", this._dialog.style.height = ""), this.positioning === "body" && this._originalParent && this.parentNode === document.body && (this._originalParent.insertBefore(this, this._originalSibling), this._originalParent = null, this._originalSibling = null)), this._dialog)) {
|
|
1952
|
+
let e = this._dialog;
|
|
1953
|
+
if (this.open) {
|
|
1954
|
+
if (this.modal && typeof e.showModal == "function") {
|
|
1955
|
+
let t = !1;
|
|
1956
|
+
try {
|
|
1957
|
+
t = this._dialog.matches(":modal");
|
|
1958
|
+
} catch {
|
|
1959
|
+
t = !1;
|
|
1960
|
+
}
|
|
1961
|
+
if (!t) try {
|
|
1962
|
+
e.showModal();
|
|
1963
|
+
} catch {}
|
|
1964
|
+
} else if (!this.modal && typeof e.show == "function") try {
|
|
1965
|
+
e.show();
|
|
1966
|
+
} catch {}
|
|
1967
|
+
else (this.modal && typeof e.showModal != "function" || !this.modal && typeof e.show != "function") && (this._dialog.open = !0);
|
|
1968
|
+
} else if (typeof e.close == "function") try {
|
|
1969
|
+
e.close();
|
|
1970
|
+
} catch {}
|
|
1971
|
+
}
|
|
1947
1972
|
}
|
|
1948
1973
|
disconnectedCallback() {
|
|
1949
1974
|
super.disconnectedCallback(), this.parentNode === document.body && this.positioning === "body" && this._originalParent && this._originalParent.insertBefore(this, this._originalSibling);
|
|
@@ -1987,6 +2012,10 @@ var Je = class extends W {
|
|
|
1987
2012
|
transform: translateY(0);
|
|
1988
2013
|
}
|
|
1989
2014
|
|
|
2015
|
+
dialog::backdrop {
|
|
2016
|
+
background-color: rgb(0 0 0 / 0.5);
|
|
2017
|
+
}
|
|
2018
|
+
|
|
1990
2019
|
dialog.fixed {
|
|
1991
2020
|
position: fixed;
|
|
1992
2021
|
inset: auto 0 0 0;
|
|
@@ -2084,6 +2113,7 @@ var Je = class extends W {
|
|
|
2084
2113
|
?open=${this.open}
|
|
2085
2114
|
class=${t}
|
|
2086
2115
|
@click=${this._onDialogClick}
|
|
2116
|
+
@cancel=${this._onCancel}
|
|
2087
2117
|
@pointerdown=${this._onPointerDown}
|
|
2088
2118
|
@pointermove=${this._onPointerMove}
|
|
2089
2119
|
@pointerup=${this._onPointerUp}
|
|
Binary file
|
|
Binary file
|