melonykit 0.15.4 → 0.15.5
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 +19 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1670,41 +1670,43 @@ var X = {
|
|
|
1670
1670
|
};
|
|
1671
1671
|
//#endregion
|
|
1672
1672
|
//#region src/components/_slider.jsx
|
|
1673
|
-
function Mt({ label: e, items: t = [], value:
|
|
1674
|
-
let
|
|
1673
|
+
function Mt({ label: e, items: t = [], value: a, isDisabled: l = !1, onSlide: u, onChange: d }) {
|
|
1674
|
+
let f = i(), p = n(a ?? t[0]?.value), m = Math.max(t.findIndex((e) => e.value === p.value), 0);
|
|
1675
|
+
t[m];
|
|
1676
|
+
let h = l || t.length < 2;
|
|
1675
1677
|
r(() => {
|
|
1676
|
-
|
|
1677
|
-
}, [
|
|
1678
|
-
function
|
|
1678
|
+
a !== void 0 && (p.value = a);
|
|
1679
|
+
}, [a]);
|
|
1680
|
+
function g(e) {
|
|
1679
1681
|
return t[Number(e.currentTarget.value)];
|
|
1680
1682
|
}
|
|
1681
|
-
function
|
|
1682
|
-
let t =
|
|
1683
|
-
t && (
|
|
1683
|
+
function _(e) {
|
|
1684
|
+
let t = g(e);
|
|
1685
|
+
t && (p.value = t.value, u?.(t.value, t));
|
|
1684
1686
|
}
|
|
1685
|
-
function
|
|
1686
|
-
let t =
|
|
1687
|
-
t &&
|
|
1687
|
+
function v(e) {
|
|
1688
|
+
let t = g(e);
|
|
1689
|
+
t && d?.(t.value, t);
|
|
1688
1690
|
}
|
|
1689
1691
|
return /* @__PURE__ */ s(o, { children: /* @__PURE__ */ c("div", {
|
|
1690
1692
|
className: Nt.base,
|
|
1691
1693
|
children: [
|
|
1692
1694
|
e && /* @__PURE__ */ s("label", {
|
|
1693
1695
|
className: Nt.label,
|
|
1694
|
-
htmlFor:
|
|
1696
|
+
htmlFor: f,
|
|
1695
1697
|
children: e
|
|
1696
1698
|
}),
|
|
1697
1699
|
/* @__PURE__ */ s("input", {
|
|
1698
|
-
id:
|
|
1700
|
+
id: f,
|
|
1699
1701
|
type: "range",
|
|
1700
1702
|
className: Nt.input,
|
|
1701
1703
|
min: "0",
|
|
1702
1704
|
max: Math.max(t.length - 1, 0),
|
|
1703
1705
|
step: "1",
|
|
1704
|
-
value:
|
|
1705
|
-
disabled:
|
|
1706
|
-
onInput:
|
|
1707
|
-
onChange:
|
|
1706
|
+
value: m,
|
|
1707
|
+
disabled: h,
|
|
1708
|
+
onInput: _,
|
|
1709
|
+
onChange: v
|
|
1708
1710
|
}),
|
|
1709
1711
|
/* @__PURE__ */ s("div", {
|
|
1710
1712
|
className: Nt.items,
|