melonykit 0.15.0 → 0.15.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.js +21 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1772,34 +1772,42 @@ var X = {
|
|
|
1772
1772
|
};
|
|
1773
1773
|
//#endregion
|
|
1774
1774
|
//#region src/components/_slider.jsx
|
|
1775
|
-
function Mt({ label: e, items: t = [], value:
|
|
1776
|
-
let
|
|
1775
|
+
function Mt({ label: e, items: t = [], value: l, isDisabled: u = !1, onSlide: d, onChange: f }) {
|
|
1776
|
+
let p = i(), m = n(l ?? t[0]?.value), h = Math.max(t.findIndex((e) => e.value === m.value), 0), g = t[h], _ = a(g?.value), v = u || t.length < 2;
|
|
1777
1777
|
r(() => {
|
|
1778
|
-
|
|
1779
|
-
}, [
|
|
1780
|
-
function
|
|
1781
|
-
|
|
1782
|
-
|
|
1778
|
+
l !== void 0 && (m.value = l, _.current = l);
|
|
1779
|
+
}, [l]);
|
|
1780
|
+
function y(e) {
|
|
1781
|
+
return t[Number(e.currentTarget.value)];
|
|
1782
|
+
}
|
|
1783
|
+
function b(e) {
|
|
1784
|
+
let t = y(e);
|
|
1785
|
+
t && (m.value = t.value, d?.(t.value, t));
|
|
1786
|
+
}
|
|
1787
|
+
function x(e) {
|
|
1788
|
+
let t = y(e);
|
|
1789
|
+
t && _.current !== t.value && (_.current = t.value, f?.(t.value, t));
|
|
1783
1790
|
}
|
|
1784
1791
|
return /* @__PURE__ */ s(o, { children: /* @__PURE__ */ c("div", {
|
|
1785
1792
|
className: Nt.base,
|
|
1786
1793
|
children: [
|
|
1787
1794
|
e && /* @__PURE__ */ s("label", {
|
|
1788
1795
|
className: Nt.label,
|
|
1789
|
-
htmlFor:
|
|
1796
|
+
htmlFor: p,
|
|
1790
1797
|
children: e
|
|
1791
1798
|
}),
|
|
1792
1799
|
/* @__PURE__ */ s("input", {
|
|
1793
|
-
id:
|
|
1800
|
+
id: p,
|
|
1794
1801
|
type: "range",
|
|
1795
1802
|
className: Nt.input,
|
|
1796
1803
|
min: "0",
|
|
1797
1804
|
max: Math.max(t.length - 1, 0),
|
|
1798
1805
|
step: "1",
|
|
1799
|
-
value:
|
|
1800
|
-
disabled:
|
|
1801
|
-
"aria-valuetext":
|
|
1802
|
-
onInput:
|
|
1806
|
+
value: h,
|
|
1807
|
+
disabled: v,
|
|
1808
|
+
"aria-valuetext": g?.label,
|
|
1809
|
+
onInput: b,
|
|
1810
|
+
onChange: x
|
|
1803
1811
|
}),
|
|
1804
1812
|
/* @__PURE__ */ s("div", {
|
|
1805
1813
|
className: Nt.items,
|