melonykit 0.15.3 → 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.
Files changed (2) hide show
  1. package/dist/index.js +40 -18
  2. 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: l, isDisabled: u = !1, onSlide: d, onChange: f }) {
1674
- 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;
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
- l !== void 0 && (m.value = l, _.current = l);
1677
- }, [l]);
1678
- function y(e) {
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 b(e) {
1682
- let t = y(e);
1683
- t && (m.value = t.value, d?.(t.value, t));
1683
+ function _(e) {
1684
+ let t = g(e);
1685
+ t && (p.value = t.value, u?.(t.value, t));
1684
1686
  }
1685
- function x(e) {
1686
- let t = y(e);
1687
- t && _.current !== t.value && (_.current = t.value, f?.(t.value, 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: p,
1696
+ htmlFor: f,
1695
1697
  children: e
1696
1698
  }),
1697
1699
  /* @__PURE__ */ s("input", {
1698
- id: p,
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: h,
1705
- disabled: v,
1706
- onInput: b,
1707
- onChange: x
1706
+ value: m,
1707
+ disabled: h,
1708
+ onInput: _,
1709
+ onChange: v
1708
1710
  }),
1709
1711
  /* @__PURE__ */ s("div", {
1710
1712
  className: Nt.items,
@@ -2237,7 +2239,14 @@ function Yt({ columns: e = [], rows: t = [], width: n, height: r, showLineNumber
2237
2239
  style: Zt(e),
2238
2240
  children: e.label
2239
2241
  }, e.key))] }) }),
2240
- /* @__PURE__ */ s("tbody", { children: f.map((t, n) => /* @__PURE__ */ c("tr", { children: [i && /* @__PURE__ */ s("td", {
2242
+ /* @__PURE__ */ s("tbody", { children: f.length === 0 ? /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s("td", {
2243
+ className: $.empty,
2244
+ colSpan: Math.max(e.length + Number(i), 1),
2245
+ children: /* @__PURE__ */ s("span", {
2246
+ className: $.emptyContent,
2247
+ children: "Keine Einträge vorhanden."
2248
+ })
2249
+ }) }) : f.map((t, n) => /* @__PURE__ */ c("tr", { children: [i && /* @__PURE__ */ s("td", {
2241
2250
  className: $.number,
2242
2251
  children: n + 1
2243
2252
  }), e.map((e) => /* @__PURE__ */ s("td", {
@@ -2339,6 +2348,19 @@ var $ = {
2339
2348
  width: 3rem;
2340
2349
  color: ${W.colors.fore.secondary};
2341
2350
  text-align: right !important;
2351
+ `,
2352
+ empty: U`
2353
+ position: relative;
2354
+ height: 8.25rem;
2355
+ padding: 0 !important;
2356
+ color: ${W.colors.fore.secondary};
2357
+ text-align: center !important;
2358
+ `,
2359
+ emptyContent: U`
2360
+ display: grid;
2361
+ position: absolute;
2362
+ inset: 0;
2363
+ place-items: center;
2342
2364
  `
2343
2365
  };
2344
2366
  //#endregion
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Vadim Hermann",
3
3
  "name": "melonykit",
4
- "version": "0.15.3",
4
+ "version": "0.15.5",
5
5
  "type": "module",
6
6
  "description": "Preact based ui and utility functions toolkit",
7
7
  "main": "./dist/index.js",