melonykit 0.15.11 → 0.15.12
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 +70 -32
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1464,27 +1464,30 @@ function kt({ size: e = 1 }) {
|
|
|
1464
1464
|
}
|
|
1465
1465
|
//#endregion
|
|
1466
1466
|
//#region src/components/_text-field.jsx
|
|
1467
|
-
function At({ placeholder: e, value: t, width:
|
|
1468
|
-
let
|
|
1469
|
-
|
|
1470
|
-
|
|
1467
|
+
function At({ placeholder: e, value: t, width: a, isDisabled: l, onChange: u }) {
|
|
1468
|
+
let d = i(), f = n(t);
|
|
1469
|
+
r(() => {
|
|
1470
|
+
f.value = t ?? "";
|
|
1471
|
+
}, [t]);
|
|
1472
|
+
function p({ target: e }) {
|
|
1473
|
+
f.value = e.value, u?.(f.value);
|
|
1471
1474
|
}
|
|
1472
1475
|
return /* @__PURE__ */ s(o, { children: /* @__PURE__ */ c("div", {
|
|
1473
1476
|
className: jt.base,
|
|
1474
|
-
style: { width:
|
|
1475
|
-
"is-disabled":
|
|
1476
|
-
children: [!
|
|
1477
|
+
style: { width: a },
|
|
1478
|
+
"is-disabled": l,
|
|
1479
|
+
children: [!f.value && e && /* @__PURE__ */ s("label", {
|
|
1477
1480
|
className: jt.label,
|
|
1478
|
-
htmlFor:
|
|
1481
|
+
htmlFor: d,
|
|
1479
1482
|
children: e
|
|
1480
1483
|
}), /* @__PURE__ */ s("input", {
|
|
1481
|
-
id:
|
|
1482
|
-
name:
|
|
1484
|
+
id: d,
|
|
1485
|
+
name: d,
|
|
1483
1486
|
className: jt.input,
|
|
1484
|
-
value:
|
|
1485
|
-
disabled:
|
|
1487
|
+
value: f.value,
|
|
1488
|
+
disabled: l,
|
|
1486
1489
|
autocomplete: "off",
|
|
1487
|
-
onInput:
|
|
1490
|
+
onInput: p
|
|
1488
1491
|
})]
|
|
1489
1492
|
}) });
|
|
1490
1493
|
}
|
|
@@ -1753,6 +1756,11 @@ var Pt = {
|
|
|
1753
1756
|
background-color: ${U.colors.primary};
|
|
1754
1757
|
}
|
|
1755
1758
|
|
|
1759
|
+
&:disabled::-webkit-slider-thumb {
|
|
1760
|
+
border-color: ${U.colors.border};
|
|
1761
|
+
background-color: ${U.colors.border};
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1756
1764
|
&::-moz-range-track {
|
|
1757
1765
|
height: .25rem;
|
|
1758
1766
|
border-radius: 1rem;
|
|
@@ -1767,6 +1775,11 @@ var Pt = {
|
|
|
1767
1775
|
background-color: ${U.colors.primary};
|
|
1768
1776
|
}
|
|
1769
1777
|
|
|
1778
|
+
&:disabled::-moz-range-thumb {
|
|
1779
|
+
border-color: ${U.colors.border};
|
|
1780
|
+
background-color: ${U.colors.border};
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1770
1783
|
&:focus-visible {
|
|
1771
1784
|
outline: solid 2px ${U.colors.primary};
|
|
1772
1785
|
outline-offset: .25rem;
|
|
@@ -2227,10 +2240,16 @@ var Q = {
|
|
|
2227
2240
|
};
|
|
2228
2241
|
//#endregion
|
|
2229
2242
|
//#region src/components/_table.jsx
|
|
2230
|
-
function Yt({ columns: e = [], rows: t = [], width: n, height: r, showLineNumbers: i = !0, sortBy: a, sortDirection: l = "asc",
|
|
2231
|
-
let
|
|
2243
|
+
function Yt({ columns: e = [], rows: t = [], width: n, height: r, showLineNumbers: i = !0, sortBy: a, sortDirection: l = "asc", onRowClick: u, className: d }) {
|
|
2244
|
+
let f = tn(t, e, a, l);
|
|
2245
|
+
function p(e, t, n) {
|
|
2246
|
+
rn(e) || u?.(e, t, n);
|
|
2247
|
+
}
|
|
2248
|
+
function m(e, t, n) {
|
|
2249
|
+
["Enter", " "].includes(e.key) && (rn(e) || (e.preventDefault(), p(e, t, n)));
|
|
2250
|
+
}
|
|
2232
2251
|
return /* @__PURE__ */ s(o, { children: /* @__PURE__ */ s("div", {
|
|
2233
|
-
className: V($.base,
|
|
2252
|
+
className: V($.base, d),
|
|
2234
2253
|
style: {
|
|
2235
2254
|
width: n,
|
|
2236
2255
|
height: r
|
|
@@ -2248,20 +2267,27 @@ function Yt({ columns: e = [], rows: t = [], width: n, height: r, showLineNumber
|
|
|
2248
2267
|
onClick: (t) => e.onClick?.(t, e),
|
|
2249
2268
|
children: e.label
|
|
2250
2269
|
}, e.key))] }) }),
|
|
2251
|
-
/* @__PURE__ */ s("tbody", { children:
|
|
2270
|
+
/* @__PURE__ */ s("tbody", { children: f.length === 0 ? /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s("td", {
|
|
2252
2271
|
className: $.empty,
|
|
2272
|
+
"is-empty": !0,
|
|
2253
2273
|
colSpan: Math.max(e.length + Number(i), 1),
|
|
2254
2274
|
children: /* @__PURE__ */ s("span", {
|
|
2255
2275
|
className: $.emptyContent,
|
|
2256
2276
|
children: "Keine Einträge ..."
|
|
2257
2277
|
})
|
|
2258
|
-
}) }) :
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
children:
|
|
2264
|
-
|
|
2278
|
+
}) }) : f.map((t, n) => /* @__PURE__ */ c("tr", {
|
|
2279
|
+
"is-clickable": u ? !0 : void 0,
|
|
2280
|
+
tabIndex: u ? 0 : void 0,
|
|
2281
|
+
onClick: u ? (e) => p(e, t, n) : void 0,
|
|
2282
|
+
onKeyDown: u ? (e) => m(e, t, n) : void 0,
|
|
2283
|
+
children: [i && /* @__PURE__ */ s("td", {
|
|
2284
|
+
className: $.number,
|
|
2285
|
+
children: n + 1
|
|
2286
|
+
}), e.map((e) => /* @__PURE__ */ s("td", {
|
|
2287
|
+
style: Qt(e, t, n),
|
|
2288
|
+
children: en(e, t, n)
|
|
2289
|
+
}, e.key))]
|
|
2290
|
+
}, t.key ?? n)) })
|
|
2265
2291
|
]
|
|
2266
2292
|
})
|
|
2267
2293
|
}) });
|
|
@@ -2308,18 +2334,19 @@ function nn(e, t) {
|
|
|
2308
2334
|
let n = t[e.key];
|
|
2309
2335
|
return e.sortValue?.(n, t) ?? n ?? "";
|
|
2310
2336
|
}
|
|
2337
|
+
function rn(e) {
|
|
2338
|
+
return e.target instanceof Element && e.target.closest("a, button, input, select, textarea, label, summary, [contenteditable=\"true\"], [role=\"button\"], [role=\"link\"], [role=\"checkbox\"], [role=\"switch\"]");
|
|
2339
|
+
}
|
|
2311
2340
|
var $ = {
|
|
2312
2341
|
base: H`
|
|
2313
|
-
display:
|
|
2342
|
+
display: block;
|
|
2314
2343
|
position: relative;
|
|
2315
2344
|
max-width: 100%;
|
|
2316
2345
|
overflow: auto;
|
|
2317
|
-
border: solid 1px ${U.colors.border};
|
|
2318
|
-
border-radius: 10px;
|
|
2319
|
-
background-color: ${U.colors.back.primary};
|
|
2320
2346
|
`,
|
|
2321
2347
|
table: H`
|
|
2322
2348
|
width: max-content;
|
|
2349
|
+
min-width: 100%;
|
|
2323
2350
|
border-spacing: 0;
|
|
2324
2351
|
color: ${U.colors.fore.primary};
|
|
2325
2352
|
font-family: ${U.fontFamily}, sans-serif;
|
|
@@ -2328,9 +2355,9 @@ var $ = {
|
|
|
2328
2355
|
letter-spacing: .4px;
|
|
2329
2356
|
|
|
2330
2357
|
th,
|
|
2331
|
-
td {
|
|
2332
|
-
height:
|
|
2333
|
-
padding: .
|
|
2358
|
+
td:not([is-empty]) {
|
|
2359
|
+
height: 3.25rem;
|
|
2360
|
+
padding: 1rem 1.25rem;
|
|
2334
2361
|
border-bottom: solid 1px #e9ebed;
|
|
2335
2362
|
text-align: left;
|
|
2336
2363
|
vertical-align: middle;
|
|
@@ -2342,7 +2369,7 @@ var $ = {
|
|
|
2342
2369
|
z-index: ${U.zIndex.front};
|
|
2343
2370
|
top: 0;
|
|
2344
2371
|
color: ${U.colors.fore.secondary};
|
|
2345
|
-
background-color: ${U.colors.back.
|
|
2372
|
+
background-color: ${U.colors.back.primary};
|
|
2346
2373
|
font-size: .65rem;
|
|
2347
2374
|
font-weight: 700;
|
|
2348
2375
|
letter-spacing: .8px;
|
|
@@ -2350,6 +2377,17 @@ var $ = {
|
|
|
2350
2377
|
|
|
2351
2378
|
th[is-clickable] { cursor: pointer; }
|
|
2352
2379
|
|
|
2380
|
+
tbody tr { transition: background-color .15s ease; }
|
|
2381
|
+
|
|
2382
|
+
tbody tr:hover { background-color: ${U.colors.back.secondary}; }
|
|
2383
|
+
|
|
2384
|
+
tbody tr[is-clickable] { cursor: pointer; }
|
|
2385
|
+
|
|
2386
|
+
tbody tr[is-clickable]:focus-visible {
|
|
2387
|
+
outline: solid 2px ${U.colors.primary};
|
|
2388
|
+
outline-offset: -2px;
|
|
2389
|
+
}
|
|
2390
|
+
|
|
2353
2391
|
tbody tr:last-child td { border-bottom: 0; }
|
|
2354
2392
|
`,
|
|
2355
2393
|
line: H`
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "Vadim Hermann",
|
|
3
3
|
"name": "melonykit",
|
|
4
|
-
"version": "0.15.
|
|
4
|
+
"version": "0.15.12",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Preact based ui and utility functions toolkit",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@playwright/test": "1.63.0",
|
|
37
37
|
"@preact/preset-vite": "2.10.6",
|
|
38
38
|
"@preact/signals": "2.11.2",
|
|
39
|
-
"@types/node": "26.
|
|
39
|
+
"@types/node": "26.6.2",
|
|
40
40
|
"preact": "10.29.8",
|
|
41
41
|
"vite": "8.3.0",
|
|
42
42
|
"vite-plugin-mkcert": "2.1.0"
|