klun-ui 0.1.13 → 0.1.14
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/CHANGELOG.md +10 -0
- package/dist/{chunk-Y2R5PBYN.cjs → chunk-752UKCVU.cjs} +160 -60
- package/dist/chunk-752UKCVU.cjs.map +1 -0
- package/dist/{chunk-O2CR4NDQ.js → chunk-7L7FJQZ7.js} +159 -61
- package/dist/chunk-7L7FJQZ7.js.map +1 -0
- package/dist/index.cjs +157 -149
- package/dist/index.d.cts +16 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +58 -0
- package/dist/templates/index.cjs +89 -89
- package/dist/templates/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-O2CR4NDQ.js.map +0 -1
- package/dist/chunk-Y2R5PBYN.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,16 @@ All notable changes to **klun-ui** are documented here. The format follows
|
|
|
5
5
|
[Semantic Versioning](https://semver.org/) (pre-1.0: minor/patch bumps may carry
|
|
6
6
|
small breaking changes).
|
|
7
7
|
|
|
8
|
+
## [0.1.14] — 2026-06-23
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **`Markdown` — a dependency-free Markdown → React renderer.** Renders headings,
|
|
12
|
+
`**bold**` / `*italic*` / `~~strike~~` / `` `code` ``, `[links](url)`,
|
|
13
|
+
`> blockquotes`, ordered/unordered lists and ``` fenced code blocks ``` as React
|
|
14
|
+
nodes (never raw HTML, so user text is XSS-safe). Use `<Markdown>{src}</Markdown>`
|
|
15
|
+
(or `source={src}`); the underlying `renderMarkdown(src): ReactNode` function is
|
|
16
|
+
exported too for inline use. Styles are namespaced under `.klun-md`.
|
|
17
|
+
|
|
8
18
|
## [0.1.13] — 2026-06-23
|
|
9
19
|
|
|
10
20
|
### Added
|
|
@@ -166,7 +166,7 @@ var Format = {
|
|
|
166
166
|
|
|
167
167
|
// src/components/config/locales.tsx
|
|
168
168
|
function fmt(template, vars) {
|
|
169
|
-
return template.replace(/\{(\w+)\}/g, (m,
|
|
169
|
+
return template.replace(/\{(\w+)\}/g, (m, k2) => k2 in vars ? String(vars[k2]) : m);
|
|
170
170
|
}
|
|
171
171
|
var enUS = {
|
|
172
172
|
locale: "en-US",
|
|
@@ -2934,6 +2934,104 @@ var ListItem = react.forwardRef(
|
|
|
2934
2934
|
}
|
|
2935
2935
|
);
|
|
2936
2936
|
ListItem.displayName = "ListItem";
|
|
2937
|
+
var k = 0;
|
|
2938
|
+
function inline(text) {
|
|
2939
|
+
const patterns = [
|
|
2940
|
+
{ re: /`([^`]+)`/, node: (m) => /* @__PURE__ */ jsxRuntime.jsx("code", { className: "klun-md-code", children: m[1] }, k++) },
|
|
2941
|
+
{ re: /\*\*([^*]+)\*\*/, node: (m) => /* @__PURE__ */ jsxRuntime.jsx("strong", { children: inline(m[1]) }, k++) },
|
|
2942
|
+
{ re: /~~([^~]+)~~/, node: (m) => /* @__PURE__ */ jsxRuntime.jsx("del", { children: inline(m[1]) }, k++) },
|
|
2943
|
+
{ re: /\*([^*]+)\*/, node: (m) => /* @__PURE__ */ jsxRuntime.jsx("em", { children: inline(m[1]) }, k++) },
|
|
2944
|
+
{ re: /<u>([\s\S]*?)<\/u>/, node: (m) => /* @__PURE__ */ jsxRuntime.jsx("u", { children: inline(m[1]) }, k++) },
|
|
2945
|
+
{
|
|
2946
|
+
re: /\[([^\]]+)\]\(([^)]+)\)/,
|
|
2947
|
+
node: (m) => /* @__PURE__ */ jsxRuntime.jsx("a", { href: m[2], target: "_blank", rel: "noreferrer", children: m[1] }, k++)
|
|
2948
|
+
}
|
|
2949
|
+
];
|
|
2950
|
+
const out = [];
|
|
2951
|
+
let rest = text;
|
|
2952
|
+
while (rest.length) {
|
|
2953
|
+
let best = null;
|
|
2954
|
+
for (const p of patterns) {
|
|
2955
|
+
const m = p.re.exec(rest);
|
|
2956
|
+
if (m && (best === null || m.index < best.idx)) best = { idx: m.index, len: m[0].length, p, m };
|
|
2957
|
+
}
|
|
2958
|
+
if (!best) {
|
|
2959
|
+
out.push(rest);
|
|
2960
|
+
break;
|
|
2961
|
+
}
|
|
2962
|
+
if (best.idx > 0) out.push(rest.slice(0, best.idx));
|
|
2963
|
+
out.push(best.p.node(best.m));
|
|
2964
|
+
rest = rest.slice(best.idx + best.len);
|
|
2965
|
+
}
|
|
2966
|
+
return out;
|
|
2967
|
+
}
|
|
2968
|
+
var SPECIAL = /^(#{1,6}\s|>\s?|[-*]\s+|\d+\.\s+|```)/;
|
|
2969
|
+
function renderMarkdown(src) {
|
|
2970
|
+
k = 0;
|
|
2971
|
+
const lines = src.replace(/\r\n/g, "\n").split("\n");
|
|
2972
|
+
const blocks = [];
|
|
2973
|
+
let i = 0;
|
|
2974
|
+
while (i < lines.length) {
|
|
2975
|
+
const line = lines[i];
|
|
2976
|
+
if (/^```/.test(line)) {
|
|
2977
|
+
const buf2 = [];
|
|
2978
|
+
i++;
|
|
2979
|
+
while (i < lines.length && !/^```/.test(lines[i])) buf2.push(lines[i++]);
|
|
2980
|
+
i++;
|
|
2981
|
+
blocks.push(
|
|
2982
|
+
/* @__PURE__ */ jsxRuntime.jsx("pre", { className: "klun-md-pre", children: /* @__PURE__ */ jsxRuntime.jsx("code", { children: buf2.join("\n") }) }, k++)
|
|
2983
|
+
);
|
|
2984
|
+
continue;
|
|
2985
|
+
}
|
|
2986
|
+
const h = /^(#{1,6})\s+(.*)$/.exec(line);
|
|
2987
|
+
if (h) {
|
|
2988
|
+
const tag = `h${Math.min(h[1].length + 2, 6)}`;
|
|
2989
|
+
blocks.push(react.createElement(tag, { key: k++, className: "klun-md-h" }, inline(h[2])));
|
|
2990
|
+
i++;
|
|
2991
|
+
continue;
|
|
2992
|
+
}
|
|
2993
|
+
if (/^>\s?/.test(line)) {
|
|
2994
|
+
const buf2 = [];
|
|
2995
|
+
while (i < lines.length && /^>\s?/.test(lines[i])) buf2.push(lines[i++].replace(/^>\s?/, ""));
|
|
2996
|
+
blocks.push(
|
|
2997
|
+
/* @__PURE__ */ jsxRuntime.jsx("blockquote", { className: "klun-md-quote", children: inline(buf2.join("\n")) }, k++)
|
|
2998
|
+
);
|
|
2999
|
+
continue;
|
|
3000
|
+
}
|
|
3001
|
+
if (/^[-*]\s+/.test(line)) {
|
|
3002
|
+
const items2 = [];
|
|
3003
|
+
while (i < lines.length && /^[-*]\s+/.test(lines[i])) items2.push(lines[i++].replace(/^[-*]\s+/, ""));
|
|
3004
|
+
blocks.push(
|
|
3005
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "klun-md-ul", children: items2.map((it, j) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: inline(it) }, j)) }, k++)
|
|
3006
|
+
);
|
|
3007
|
+
continue;
|
|
3008
|
+
}
|
|
3009
|
+
if (/^\d+\.\s+/.test(line)) {
|
|
3010
|
+
const items2 = [];
|
|
3011
|
+
while (i < lines.length && /^\d+\.\s+/.test(lines[i])) items2.push(lines[i++].replace(/^\d+\.\s+/, ""));
|
|
3012
|
+
blocks.push(
|
|
3013
|
+
/* @__PURE__ */ jsxRuntime.jsx("ol", { className: "klun-md-ol", children: items2.map((it, j) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: inline(it) }, j)) }, k++)
|
|
3014
|
+
);
|
|
3015
|
+
continue;
|
|
3016
|
+
}
|
|
3017
|
+
if (line.trim() === "") {
|
|
3018
|
+
i++;
|
|
3019
|
+
continue;
|
|
3020
|
+
}
|
|
3021
|
+
const buf = [line];
|
|
3022
|
+
i++;
|
|
3023
|
+
while (i < lines.length && lines[i].trim() !== "" && !SPECIAL.test(lines[i])) buf.push(lines[i++]);
|
|
3024
|
+
blocks.push(
|
|
3025
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "klun-md-p", children: buf.flatMap((l, j) => j ? [/* @__PURE__ */ jsxRuntime.jsx("br", {}, `br${j}`), ...inline(l)] : inline(l)) }, k++)
|
|
3026
|
+
);
|
|
3027
|
+
}
|
|
3028
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: blocks });
|
|
3029
|
+
}
|
|
3030
|
+
var Markdown = react.forwardRef(function Markdown2({ children, source, className, ...props }, ref) {
|
|
3031
|
+
const src = source ?? (typeof children === "string" ? children : "") ?? "";
|
|
3032
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: chunkTPGAXYFU_cjs.cx("klun-md", className), ...props, children: renderMarkdown(src) });
|
|
3033
|
+
});
|
|
3034
|
+
Markdown.displayName = "Markdown";
|
|
2937
3035
|
var Money = react.forwardRef(function Money2({
|
|
2938
3036
|
value,
|
|
2939
3037
|
cents = false,
|
|
@@ -3177,8 +3275,8 @@ function StatusBadge({
|
|
|
3177
3275
|
className,
|
|
3178
3276
|
...props
|
|
3179
3277
|
}) {
|
|
3180
|
-
const
|
|
3181
|
-
const resolvedTone = tone || map && map[
|
|
3278
|
+
const k2 = keyOf(status);
|
|
3279
|
+
const resolvedTone = tone || map && map[k2] || STATUS_TONE[k2] || "neutral";
|
|
3182
3280
|
const color = TONE_COLOR[resolvedTone] || "gray";
|
|
3183
3281
|
const text = label != null ? label : String(status == null ? "" : status).replace(/[-_]/g, " ");
|
|
3184
3282
|
const display = typeof text === "string" ? text.charAt(0).toUpperCase() + text.slice(1) : text;
|
|
@@ -3303,14 +3401,14 @@ function Pager({
|
|
|
3303
3401
|
const h = (e) => {
|
|
3304
3402
|
if (sizeRef.current && !sizeRef.current.contains(e.target)) setSizeOpen(false);
|
|
3305
3403
|
};
|
|
3306
|
-
const
|
|
3404
|
+
const k2 = (e) => {
|
|
3307
3405
|
if (e.key === "Escape") setSizeOpen(false);
|
|
3308
3406
|
};
|
|
3309
3407
|
document.addEventListener("mousedown", h);
|
|
3310
|
-
document.addEventListener("keydown",
|
|
3408
|
+
document.addEventListener("keydown", k2);
|
|
3311
3409
|
return () => {
|
|
3312
3410
|
document.removeEventListener("mousedown", h);
|
|
3313
|
-
document.removeEventListener("keydown",
|
|
3411
|
+
document.removeEventListener("keydown", k2);
|
|
3314
3412
|
};
|
|
3315
3413
|
}, [sizeOpen]);
|
|
3316
3414
|
const nums = [];
|
|
@@ -3428,16 +3526,16 @@ function ContextMenu({
|
|
|
3428
3526
|
}, [x, y]);
|
|
3429
3527
|
react.useEffect(() => {
|
|
3430
3528
|
const close = () => onClose();
|
|
3431
|
-
const
|
|
3529
|
+
const k2 = (e) => {
|
|
3432
3530
|
if (e.key === "Escape") onClose();
|
|
3433
3531
|
};
|
|
3434
3532
|
document.addEventListener("mousedown", close);
|
|
3435
|
-
document.addEventListener("keydown",
|
|
3533
|
+
document.addEventListener("keydown", k2);
|
|
3436
3534
|
window.addEventListener("scroll", close, true);
|
|
3437
3535
|
window.addEventListener("resize", close);
|
|
3438
3536
|
return () => {
|
|
3439
3537
|
document.removeEventListener("mousedown", close);
|
|
3440
|
-
document.removeEventListener("keydown",
|
|
3538
|
+
document.removeEventListener("keydown", k2);
|
|
3441
3539
|
window.removeEventListener("scroll", close, true);
|
|
3442
3540
|
window.removeEventListener("resize", close);
|
|
3443
3541
|
};
|
|
@@ -3489,14 +3587,14 @@ function ColumnSettings({
|
|
|
3489
3587
|
const h = (e) => {
|
|
3490
3588
|
if (ref.current && !ref.current.contains(e.target)) setOpen(false);
|
|
3491
3589
|
};
|
|
3492
|
-
const
|
|
3590
|
+
const k2 = (e) => {
|
|
3493
3591
|
if (e.key === "Escape") setOpen(false);
|
|
3494
3592
|
};
|
|
3495
3593
|
document.addEventListener("mousedown", h);
|
|
3496
|
-
document.addEventListener("keydown",
|
|
3594
|
+
document.addEventListener("keydown", k2);
|
|
3497
3595
|
return () => {
|
|
3498
3596
|
document.removeEventListener("mousedown", h);
|
|
3499
|
-
document.removeEventListener("keydown",
|
|
3597
|
+
document.removeEventListener("keydown", k2);
|
|
3500
3598
|
};
|
|
3501
3599
|
}, [open]);
|
|
3502
3600
|
const toggleable = columns.filter((c) => c.header != null && c.header !== "");
|
|
@@ -3636,14 +3734,14 @@ function FilterMenu({
|
|
|
3636
3734
|
const h = (e) => {
|
|
3637
3735
|
if (ref.current && !ref.current.contains(e.target)) setOpen(false);
|
|
3638
3736
|
};
|
|
3639
|
-
const
|
|
3737
|
+
const k2 = (e) => {
|
|
3640
3738
|
if (e.key === "Escape") setOpen(false);
|
|
3641
3739
|
};
|
|
3642
3740
|
document.addEventListener("mousedown", h);
|
|
3643
|
-
document.addEventListener("keydown",
|
|
3741
|
+
document.addEventListener("keydown", k2);
|
|
3644
3742
|
return () => {
|
|
3645
3743
|
document.removeEventListener("mousedown", h);
|
|
3646
|
-
document.removeEventListener("keydown",
|
|
3744
|
+
document.removeEventListener("keydown", k2);
|
|
3647
3745
|
};
|
|
3648
3746
|
}, [open]);
|
|
3649
3747
|
const toggle = (v) => {
|
|
@@ -4283,12 +4381,12 @@ function useTableFilters({
|
|
|
4283
4381
|
const keys = Object.keys(activeFilters);
|
|
4284
4382
|
if (keys.length === 0) return rows;
|
|
4285
4383
|
return rows.filter(
|
|
4286
|
-
(row) => keys.every((
|
|
4287
|
-
const col = columns.find((c) => c.key ===
|
|
4288
|
-
const vals = activeFilters[
|
|
4384
|
+
(row) => keys.every((k2) => {
|
|
4385
|
+
const col = columns.find((c) => c.key === k2);
|
|
4386
|
+
const vals = activeFilters[k2];
|
|
4289
4387
|
if (!vals || vals.length === 0) return true;
|
|
4290
4388
|
if (col && col.onFilter) return vals.some((v) => col.onFilter(v, row));
|
|
4291
|
-
return vals.includes(row[
|
|
4389
|
+
return vals.includes(row[k2]);
|
|
4292
4390
|
})
|
|
4293
4391
|
);
|
|
4294
4392
|
}, [rows, activeFilters, columns, filters]);
|
|
@@ -4887,10 +4985,10 @@ var Tree = react.forwardRef(function Tree2({
|
|
|
4887
4985
|
};
|
|
4888
4986
|
const rows = [];
|
|
4889
4987
|
flatten(treeData, 0, true, exp, rows);
|
|
4890
|
-
const toggle = (key) => setExp(exp.includes(key) ? exp.filter((
|
|
4988
|
+
const toggle = (key) => setExp(exp.includes(key) ? exp.filter((k2) => k2 !== key) : [...exp, key]);
|
|
4891
4989
|
const checkState = (node) => {
|
|
4892
4990
|
const all = descendantKeys(node, []);
|
|
4893
|
-
const checkedCount = all.filter((
|
|
4991
|
+
const checkedCount = all.filter((k2) => checkedKeys.includes(k2)).length;
|
|
4894
4992
|
if (checkedCount === 0) return "none";
|
|
4895
4993
|
if (checkedCount === all.length) return "all";
|
|
4896
4994
|
return "some";
|
|
@@ -4900,7 +4998,7 @@ var Tree = react.forwardRef(function Tree2({
|
|
|
4900
4998
|
const all = descendantKeys(node, []);
|
|
4901
4999
|
const state = checkState(node);
|
|
4902
5000
|
let next;
|
|
4903
|
-
if (state === "all") next = checkedKeys.filter((
|
|
5001
|
+
if (state === "all") next = checkedKeys.filter((k2) => !all.includes(k2));
|
|
4904
5002
|
else next = Array.from(/* @__PURE__ */ new Set([...checkedKeys, ...all]));
|
|
4905
5003
|
onCheck(next);
|
|
4906
5004
|
};
|
|
@@ -5870,14 +5968,14 @@ var Cascader = react.forwardRef(function Cascader2({
|
|
|
5870
5968
|
const h = (e) => {
|
|
5871
5969
|
if (rootRef.current && !rootRef.current.contains(e.target)) setOpen(false);
|
|
5872
5970
|
};
|
|
5873
|
-
const
|
|
5971
|
+
const k2 = (e) => {
|
|
5874
5972
|
if (e.key === "Escape") setOpen(false);
|
|
5875
5973
|
};
|
|
5876
5974
|
document.addEventListener("mousedown", h);
|
|
5877
|
-
document.addEventListener("keydown",
|
|
5975
|
+
document.addEventListener("keydown", k2);
|
|
5878
5976
|
return () => {
|
|
5879
5977
|
document.removeEventListener("mousedown", h);
|
|
5880
|
-
document.removeEventListener("keydown",
|
|
5978
|
+
document.removeEventListener("keydown", k2);
|
|
5881
5979
|
};
|
|
5882
5980
|
}, [open]);
|
|
5883
5981
|
const columns = [];
|
|
@@ -6943,8 +7041,8 @@ var Calendar = react.forwardRef(function Calendar2({ value, onPick, className, s
|
|
|
6943
7041
|
] });
|
|
6944
7042
|
});
|
|
6945
7043
|
var DatePicker = react.forwardRef(
|
|
6946
|
-
function DatePicker2({ value, onChange, inline, placeholder, format = DEFAULT_FORMAT, align = "left", disabled, className, style, ...props }, ref) {
|
|
6947
|
-
if (
|
|
7044
|
+
function DatePicker2({ value, onChange, inline: inline2, placeholder, format = DEFAULT_FORMAT, align = "left", disabled, className, style, ...props }, ref) {
|
|
7045
|
+
if (inline2) {
|
|
6948
7046
|
return /* @__PURE__ */ jsxRuntime.jsx(Calendar, { ref, value, onPick: (d) => onChange?.(d), className, style });
|
|
6949
7047
|
}
|
|
6950
7048
|
const sel = value ? new Date(value) : null;
|
|
@@ -7209,9 +7307,9 @@ function DateTimePanel({ value, onChange }) {
|
|
|
7209
7307
|
] });
|
|
7210
7308
|
}
|
|
7211
7309
|
var DateTimePicker = react.forwardRef(
|
|
7212
|
-
function DateTimePicker2({ value, onChange, inline, placeholder, format = DEFAULT_FORMAT2, align = "left", disabled, className, style, ...props }, ref) {
|
|
7310
|
+
function DateTimePicker2({ value, onChange, inline: inline2, placeholder, format = DEFAULT_FORMAT2, align = "left", disabled, className, style, ...props }, ref) {
|
|
7213
7311
|
const date = value ? new Date(value) : null;
|
|
7214
|
-
if (
|
|
7312
|
+
if (inline2) {
|
|
7215
7313
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: chunkTPGAXYFU_cjs.cx("klun-date-time-picker", className), style, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(DateTimePanel, { value: date, onChange: (d) => onChange?.(d) }) });
|
|
7216
7314
|
}
|
|
7217
7315
|
const label = date ? date.toLocaleString(void 0, format) : "";
|
|
@@ -7298,8 +7396,8 @@ var RangeCalendar = react.forwardRef(function RangeCalendar2({ start, end, onPic
|
|
|
7298
7396
|
] });
|
|
7299
7397
|
});
|
|
7300
7398
|
var DateRangePicker = react.forwardRef(
|
|
7301
|
-
function DateRangePicker2({ start, end, onChange, inline, placeholder, format = DEFAULT_FORMAT3, align = "left", disabled, className, style, ...props }, ref) {
|
|
7302
|
-
if (
|
|
7399
|
+
function DateRangePicker2({ start, end, onChange, inline: inline2, placeholder, format = DEFAULT_FORMAT3, align = "left", disabled, className, style, ...props }, ref) {
|
|
7400
|
+
if (inline2) {
|
|
7303
7401
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7304
7402
|
RangeCalendar,
|
|
7305
7403
|
{
|
|
@@ -7456,9 +7554,9 @@ var toPath = (name) => Array.isArray(name) ? name : String(name).split(".").map(
|
|
|
7456
7554
|
var pathKey = (name) => toPath(name).join(".");
|
|
7457
7555
|
function getIn(obj, name) {
|
|
7458
7556
|
let cur = obj;
|
|
7459
|
-
for (const
|
|
7557
|
+
for (const k2 of toPath(name)) {
|
|
7460
7558
|
if (cur == null) return void 0;
|
|
7461
|
-
cur = cur[
|
|
7559
|
+
cur = cur[k2];
|
|
7462
7560
|
}
|
|
7463
7561
|
return cur;
|
|
7464
7562
|
}
|
|
@@ -7467,11 +7565,11 @@ function setIn(obj, name, value) {
|
|
|
7467
7565
|
const root = Array.isArray(obj) ? obj.slice() : { ...obj };
|
|
7468
7566
|
let cur = root;
|
|
7469
7567
|
for (let i = 0; i < path.length - 1; i++) {
|
|
7470
|
-
const
|
|
7568
|
+
const k2 = path[i];
|
|
7471
7569
|
const nextKeyIsIndex = typeof path[i + 1] === "number";
|
|
7472
|
-
const existing = cur[
|
|
7473
|
-
cur[
|
|
7474
|
-
cur = cur[
|
|
7570
|
+
const existing = cur[k2];
|
|
7571
|
+
cur[k2] = existing == null ? nextKeyIsIndex ? [] : {} : Array.isArray(existing) ? existing.slice() : { ...existing };
|
|
7572
|
+
cur = cur[k2];
|
|
7475
7573
|
}
|
|
7476
7574
|
cur[path[path.length - 1]] = value;
|
|
7477
7575
|
return root;
|
|
@@ -7578,15 +7676,15 @@ function useForm(opts = {}) {
|
|
|
7578
7676
|
const setFields = react.useCallback((map) => {
|
|
7579
7677
|
setErrors((e) => {
|
|
7580
7678
|
const n = { ...e };
|
|
7581
|
-
Object.entries(map).forEach(([
|
|
7582
|
-
n[pathKey(
|
|
7679
|
+
Object.entries(map).forEach(([k2, v]) => {
|
|
7680
|
+
n[pathKey(k2)] = v;
|
|
7583
7681
|
});
|
|
7584
7682
|
return n;
|
|
7585
7683
|
});
|
|
7586
7684
|
setTouched((t) => {
|
|
7587
7685
|
const n = { ...t };
|
|
7588
|
-
Object.keys(map).forEach((
|
|
7589
|
-
n[pathKey(
|
|
7686
|
+
Object.keys(map).forEach((k2) => {
|
|
7687
|
+
n[pathKey(k2)] = true;
|
|
7590
7688
|
});
|
|
7591
7689
|
return n;
|
|
7592
7690
|
});
|
|
@@ -7617,7 +7715,7 @@ function useForm(opts = {}) {
|
|
|
7617
7715
|
}
|
|
7618
7716
|
});
|
|
7619
7717
|
setErrors(errs);
|
|
7620
|
-
setTouched(entries.reduce((a, [
|
|
7718
|
+
setTouched(entries.reduce((a, [k2]) => (a[k2] = true, a), {}));
|
|
7621
7719
|
if (firstBad) scrollToField(firstBad);
|
|
7622
7720
|
return Object.keys(errs).length === 0;
|
|
7623
7721
|
}, [scrollToField]);
|
|
@@ -7774,11 +7872,11 @@ function FormList({ name, children }) {
|
|
|
7774
7872
|
},
|
|
7775
7873
|
move: (from, to) => {
|
|
7776
7874
|
const a = arr.slice();
|
|
7777
|
-
const
|
|
7875
|
+
const k2 = keysRef.current;
|
|
7778
7876
|
const [m] = a.splice(from, 1);
|
|
7779
7877
|
a.splice(to, 0, m);
|
|
7780
|
-
const [mk] =
|
|
7781
|
-
|
|
7878
|
+
const [mk] = k2.splice(from, 1);
|
|
7879
|
+
k2.splice(to, 0, mk);
|
|
7782
7880
|
setArr(a);
|
|
7783
7881
|
}
|
|
7784
7882
|
};
|
|
@@ -8384,14 +8482,14 @@ var SelectMenu = react.forwardRef(
|
|
|
8384
8482
|
if (rootRef.current && !rootRef.current.contains(e.target))
|
|
8385
8483
|
setOpen(false);
|
|
8386
8484
|
};
|
|
8387
|
-
const
|
|
8485
|
+
const k2 = (e) => {
|
|
8388
8486
|
if (e.key === "Escape") setOpen(false);
|
|
8389
8487
|
};
|
|
8390
8488
|
document.addEventListener("mousedown", h);
|
|
8391
|
-
document.addEventListener("keydown",
|
|
8489
|
+
document.addEventListener("keydown", k2);
|
|
8392
8490
|
return () => {
|
|
8393
8491
|
document.removeEventListener("mousedown", h);
|
|
8394
|
-
document.removeEventListener("keydown",
|
|
8492
|
+
document.removeEventListener("keydown", k2);
|
|
8395
8493
|
};
|
|
8396
8494
|
}, [open]);
|
|
8397
8495
|
const lead = leadingIcon || selected?.icon;
|
|
@@ -8954,7 +9052,7 @@ function Masonry({
|
|
|
8954
9052
|
colHeights[c] += (h > 0 ? h : 1) + gutterV;
|
|
8955
9053
|
}
|
|
8956
9054
|
setPlacement(
|
|
8957
|
-
(prev) => prev.length === next.length && prev.every((v,
|
|
9055
|
+
(prev) => prev.length === next.length && prev.every((v, k2) => v === next[k2]) ? prev : next
|
|
8958
9056
|
);
|
|
8959
9057
|
}, [cols, gutterV]);
|
|
8960
9058
|
useIsomorphicLayoutEffect(() => {
|
|
@@ -9425,10 +9523,10 @@ function containsKey(children, key) {
|
|
|
9425
9523
|
}
|
|
9426
9524
|
var Menu = react.forwardRef(function Menu2({ items: items2 = [], selectedKey, onSelect, defaultOpenKeys = [], collapsed = false, className, ...props }, ref) {
|
|
9427
9525
|
const [openKeys, setOpenKeys] = react.useState(() => new Set(defaultOpenKeys));
|
|
9428
|
-
const toggleOpen = (
|
|
9526
|
+
const toggleOpen = (k2) => setOpenKeys((s) => {
|
|
9429
9527
|
const n = new Set(s);
|
|
9430
|
-
if (n.has(
|
|
9431
|
-
else n.add(
|
|
9528
|
+
if (n.has(k2)) n.delete(k2);
|
|
9529
|
+
else n.add(k2);
|
|
9432
9530
|
return n;
|
|
9433
9531
|
});
|
|
9434
9532
|
const Row3 = ({ item, depth }) => {
|
|
@@ -10213,14 +10311,14 @@ var Dropdown = react.forwardRef(function Dropdown2({ trigger, items: items2 = []
|
|
|
10213
10311
|
const h = (e) => {
|
|
10214
10312
|
if (innerRef.current && !innerRef.current.contains(e.target)) setOpen(false);
|
|
10215
10313
|
};
|
|
10216
|
-
const
|
|
10314
|
+
const k2 = (e) => {
|
|
10217
10315
|
if (e.key === "Escape") setOpen(false);
|
|
10218
10316
|
};
|
|
10219
10317
|
document.addEventListener("mousedown", h);
|
|
10220
|
-
document.addEventListener("keydown",
|
|
10318
|
+
document.addEventListener("keydown", k2);
|
|
10221
10319
|
return () => {
|
|
10222
10320
|
document.removeEventListener("mousedown", h);
|
|
10223
|
-
document.removeEventListener("keydown",
|
|
10321
|
+
document.removeEventListener("keydown", k2);
|
|
10224
10322
|
};
|
|
10225
10323
|
}, [open]);
|
|
10226
10324
|
const setRefs = (node) => {
|
|
@@ -10581,14 +10679,14 @@ var Popconfirm = react.forwardRef(function Popconfirm2({
|
|
|
10581
10679
|
if (innerRef.current?.contains(t) || bubbleRef.current?.contains(t)) return;
|
|
10582
10680
|
setOpen(false);
|
|
10583
10681
|
};
|
|
10584
|
-
const
|
|
10682
|
+
const k2 = (e) => {
|
|
10585
10683
|
if (e.key === "Escape") setOpen(false);
|
|
10586
10684
|
};
|
|
10587
10685
|
document.addEventListener("mousedown", h);
|
|
10588
|
-
document.addEventListener("keydown",
|
|
10686
|
+
document.addEventListener("keydown", k2);
|
|
10589
10687
|
return () => {
|
|
10590
10688
|
document.removeEventListener("mousedown", h);
|
|
10591
|
-
document.removeEventListener("keydown",
|
|
10689
|
+
document.removeEventListener("keydown", k2);
|
|
10592
10690
|
};
|
|
10593
10691
|
}, [open]);
|
|
10594
10692
|
react.useLayoutEffect(() => {
|
|
@@ -10795,6 +10893,7 @@ exports.List = List;
|
|
|
10795
10893
|
exports.ListItem = ListItem;
|
|
10796
10894
|
exports.LiveDot = LiveDot;
|
|
10797
10895
|
exports.LogViewer = LogViewer;
|
|
10896
|
+
exports.Markdown = Markdown;
|
|
10798
10897
|
exports.Masonry = Masonry;
|
|
10799
10898
|
exports.Menu = Menu;
|
|
10800
10899
|
exports.Message = Message;
|
|
@@ -10854,6 +10953,7 @@ exports.nlNL = nlNL;
|
|
|
10854
10953
|
exports.plPL = plPL;
|
|
10855
10954
|
exports.primaryColorVars = primaryColorVars;
|
|
10856
10955
|
exports.ptBR = ptBR;
|
|
10956
|
+
exports.renderMarkdown = renderMarkdown;
|
|
10857
10957
|
exports.ruRU = ruRU;
|
|
10858
10958
|
exports.toast = toast;
|
|
10859
10959
|
exports.trTR = trTR;
|
|
@@ -10869,5 +10969,5 @@ exports.useSize = useSize;
|
|
|
10869
10969
|
exports.viVN = viVN;
|
|
10870
10970
|
exports.zhCN = zhCN;
|
|
10871
10971
|
exports.zhTW = zhTW;
|
|
10872
|
-
//# sourceMappingURL=chunk-
|
|
10873
|
-
//# sourceMappingURL=chunk-
|
|
10972
|
+
//# sourceMappingURL=chunk-752UKCVU.cjs.map
|
|
10973
|
+
//# sourceMappingURL=chunk-752UKCVU.cjs.map
|