@hkyhy/marsun-components-core 0.1.32 → 0.1.34

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 (53) hide show
  1. package/dist/components/AgentHub/Report/Detail/ReportMetaStrip/index.d.ts +19 -0
  2. package/dist/components/AgentHub/Report/Detail/ReportMetaStrip/index.js +46 -0
  3. package/dist/components/AgentHub/Report/Detail/ReportMetaStrip/index.js.map +1 -0
  4. package/dist/components/AgentHub/Report/Detail/ReportMetaStrip/style.module.scss.js +12 -0
  5. package/dist/components/AgentHub/Report/Detail/ReportMetaStrip/style.module.scss.js.map +1 -0
  6. package/dist/components/AgentHub/Report/Detail/ReportTemplate/index.d.ts +18 -0
  7. package/dist/components/AgentHub/Report/Detail/ReportTemplate/index.js +98 -0
  8. package/dist/components/AgentHub/Report/Detail/ReportTemplate/index.js.map +1 -0
  9. package/dist/components/AgentHub/Report/Detail/ReportTemplate/style.module.scss.js +14 -0
  10. package/dist/components/AgentHub/Report/Detail/ReportTemplate/style.module.scss.js.map +1 -0
  11. package/dist/components/AgentHub/Report/Detail/index.d.ts +4 -0
  12. package/dist/components/AgentHub/Report/index.d.ts +1 -0
  13. package/dist/components/Form/FormDataSync.d.ts +11 -0
  14. package/dist/components/Form/FormDataSync.js +20 -0
  15. package/dist/components/Form/FormDataSync.js.map +1 -0
  16. package/dist/components/Form/index.d.ts +3 -1
  17. package/dist/components/Form/kneFormInfo.d.ts +1 -0
  18. package/dist/components/Form/kneFormInfo.js +12 -11
  19. package/dist/components/Form/kneFormInfo.js.map +1 -1
  20. package/dist/components/Icons/index.d.ts +3 -1
  21. package/dist/components/Icons/index.js +165 -159
  22. package/dist/components/Icons/index.js.map +1 -1
  23. package/dist/components/InteractiveBlock/InteractiveBlock.d.ts +34 -0
  24. package/dist/components/InteractiveBlock/InteractiveBlock.js +174 -0
  25. package/dist/components/InteractiveBlock/InteractiveBlock.js.map +1 -0
  26. package/dist/components/InteractiveBlock/index.d.ts +3 -0
  27. package/dist/components/InteractiveBlock/style.module.scss.js +20 -0
  28. package/dist/components/InteractiveBlock/style.module.scss.js.map +1 -0
  29. package/dist/components/Layout/ContentCard/index.d.ts +14 -0
  30. package/dist/components/Layout/ContentCard/index.js +20 -0
  31. package/dist/components/Layout/ContentCard/index.js.map +1 -0
  32. package/dist/components/Layout/ContentCard/style.module.scss.js +9 -0
  33. package/dist/components/Layout/ContentCard/style.module.scss.js.map +1 -0
  34. package/dist/components/Layout/index.d.ts +2 -0
  35. package/dist/components/Modal/Modal/index.d.ts +6 -0
  36. package/dist/components/Modal/Modal/index.js +120 -0
  37. package/dist/components/Modal/Modal/index.js.map +1 -0
  38. package/dist/components/Modal/Modal/style.module.scss.js +17 -0
  39. package/dist/components/Modal/Modal/style.module.scss.js.map +1 -0
  40. package/dist/components/Modal/ModalTypes.d.ts +26 -0
  41. package/dist/components/Modal/StepModal/index.js +43 -41
  42. package/dist/components/Modal/StepModal/index.js.map +1 -1
  43. package/dist/components/Modal/index.d.ts +3 -0
  44. package/dist/components/Modal/utils/resolveModalSize.d.ts +22 -0
  45. package/dist/components/Modal/utils/resolveModalSize.js +28 -0
  46. package/dist/components/Modal/utils/resolveModalSize.js.map +1 -0
  47. package/dist/components/index.d.ts +1 -0
  48. package/dist/index.d.ts +2 -0
  49. package/dist/index.js +403 -383
  50. package/dist/index.js.map +1 -1
  51. package/dist/marsun-components-core.css +1 -1
  52. package/dist/styles/global.css +1 -1
  53. package/package.json +1 -1
@@ -0,0 +1,19 @@
1
+ import { ReactNode } from 'react';
2
+ export type ReportMetaTone = 'default' | 'danger' | 'warning';
3
+ export type ReportMetaItem = {
4
+ key: string;
5
+ label: ReactNode;
6
+ value: ReactNode;
7
+ tone?: ReportMetaTone;
8
+ };
9
+ export type ReportMetaStripProps = {
10
+ items: ReportMetaItem[];
11
+ /** 默认 4 列均分 */
12
+ columns?: number;
13
+ className?: string;
14
+ };
15
+ /**
16
+ * 报告指标条 — 默认四列均分
17
+ */
18
+ declare const ReportMetaStrip: React.FC<ReportMetaStripProps>;
19
+ export default ReportMetaStrip;
@@ -0,0 +1,46 @@
1
+ import { jsx as t, jsxs as l } from "react/jsx-runtime";
2
+ import e from "classnames";
3
+ import r from "./style.module.scss.js";
4
+ const i = ({ items: m, columns: s = 4, className: n }) => /* @__PURE__ */ t(
5
+ "div",
6
+ {
7
+ className: e(
8
+ "marsun-report-meta-strip",
9
+ r["marsun-report-meta-strip"],
10
+ n
11
+ ),
12
+ style: { gridTemplateColumns: `repeat(${s}, minmax(0, 1fr))` },
13
+ children: m.map((a) => /* @__PURE__ */ l(
14
+ "div",
15
+ {
16
+ className: e("marsun-report-meta-item", r["marsun-report-meta-item"]),
17
+ children: [
18
+ /* @__PURE__ */ t(
19
+ "span",
20
+ {
21
+ className: e("marsun-report-meta-label", r["marsun-report-meta-label"]),
22
+ children: a.label
23
+ }
24
+ ),
25
+ /* @__PURE__ */ t(
26
+ "strong",
27
+ {
28
+ className: e(
29
+ "marsun-report-meta-value",
30
+ r["marsun-report-meta-value"],
31
+ a.tone === "danger" && r["marsun-report-meta-value--danger"],
32
+ a.tone === "warning" && r["marsun-report-meta-value--warning"]
33
+ ),
34
+ children: a.value
35
+ }
36
+ )
37
+ ]
38
+ },
39
+ a.key
40
+ ))
41
+ }
42
+ );
43
+ export {
44
+ i as default
45
+ };
46
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/components/AgentHub/Report/Detail/ReportMetaStrip/index.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport type { ReactNode } from 'react';\nimport styles from './style.module.scss';\n\nexport type ReportMetaTone = 'default' | 'danger' | 'warning';\n\nexport type ReportMetaItem = {\n key: string;\n label: ReactNode;\n value: ReactNode;\n tone?: ReportMetaTone;\n};\n\nexport type ReportMetaStripProps = {\n items: ReportMetaItem[];\n /** 默认 4 列均分 */\n columns?: number;\n className?: string;\n};\n\n/**\n * 报告指标条 — 默认四列均分\n */\nconst ReportMetaStrip: React.FC<ReportMetaStripProps> = ({ items, columns = 4, className }) => (\n <div\n className={classNames(\n 'marsun-report-meta-strip',\n styles['marsun-report-meta-strip'],\n className,\n )}\n style={{ gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }}\n >\n {items.map((item) => (\n <div\n key={item.key}\n className={classNames('marsun-report-meta-item', styles['marsun-report-meta-item'])}\n >\n <span\n className={classNames('marsun-report-meta-label', styles['marsun-report-meta-label'])}\n >\n {item.label}\n </span>\n <strong\n className={classNames(\n 'marsun-report-meta-value',\n styles['marsun-report-meta-value'],\n item.tone === 'danger' && styles['marsun-report-meta-value--danger'],\n item.tone === 'warning' && styles['marsun-report-meta-value--warning'],\n )}\n >\n {item.value}\n </strong>\n </div>\n ))}\n </div>\n);\n\nexport default ReportMetaStrip;\n"],"names":["ReportMetaStrip","items","columns","className","jsx","classNames","styles","item","jsxs"],"mappings":";;;AAuBA,MAAMA,IAAkD,CAAC,EAAE,OAAAC,GAAO,SAAAC,IAAU,GAAG,WAAAC,QAC7E,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC;AAAA,MACT;AAAA,MACAC,EAAO,0BAA0B;AAAA,MACjCH;AAAA,IAAA;AAAA,IAEF,OAAO,EAAE,qBAAqB,UAAUD,CAAO,oBAAA;AAAA,IAE9C,UAAAD,EAAM,IAAI,CAACM,MACV,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,WAAWH,EAAW,2BAA2BC,EAAO,yBAAyB,CAAC;AAAA,QAElF,UAAA;AAAA,UAAA,gBAAAF;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWC,EAAW,4BAA4BC,EAAO,0BAA0B,CAAC;AAAA,cAEnF,UAAAC,EAAK;AAAA,YAAA;AAAA,UAAA;AAAA,UAER,gBAAAH;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWC;AAAA,gBACT;AAAA,gBACAC,EAAO,0BAA0B;AAAA,gBACjCC,EAAK,SAAS,YAAYD,EAAO,kCAAkC;AAAA,gBACnEC,EAAK,SAAS,aAAaD,EAAO,mCAAmC;AAAA,cAAA;AAAA,cAGtE,UAAAC,EAAK;AAAA,YAAA;AAAA,UAAA;AAAA,QACR;AAAA,MAAA;AAAA,MAjBKA,EAAK;AAAA,IAAA,CAmBb;AAAA,EAAA;AACH;"}
@@ -0,0 +1,12 @@
1
+ const r = {
2
+ "marsun-report-meta-strip": "_marsun-report-meta-strip_c5zos_1",
3
+ "marsun-report-meta-item": "_marsun-report-meta-item_c5zos_14",
4
+ "marsun-report-meta-label": "_marsun-report-meta-label_c5zos_21",
5
+ "marsun-report-meta-value": "_marsun-report-meta-value_c5zos_26",
6
+ "marsun-report-meta-value--danger": "_marsun-report-meta-value--danger_c5zos_37",
7
+ "marsun-report-meta-value--warning": "_marsun-report-meta-value--warning_c5zos_41"
8
+ };
9
+ export {
10
+ r as default
11
+ };
12
+ //# sourceMappingURL=style.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -0,0 +1,18 @@
1
+ import { ReactNode } from 'react';
2
+ import { ReportMetaItem } from '../ReportMetaStrip';
3
+ export type ReportTemplateProps = {
4
+ badge?: ReactNode;
5
+ title?: ReactNode;
6
+ subtitle?: ReactNode;
7
+ metaItems?: ReportMetaItem[];
8
+ metaColumns?: number;
9
+ toolbar?: ReactNode;
10
+ children?: ReactNode;
11
+ footer?: ReactNode;
12
+ className?: string;
13
+ };
14
+ /**
15
+ * Agent 报告布局模板 — Meta 四列 + 叙事区槽位(无业务 API)
16
+ */
17
+ declare const ReportTemplate: React.FC<ReportTemplateProps>;
18
+ export default ReportTemplate;
@@ -0,0 +1,98 @@
1
+ import { jsxs as n, jsx as t } from "react/jsx-runtime";
2
+ import e from "classnames";
3
+ import h from "../ReportMetaStrip/index.js";
4
+ import r from "./style.module.scss.js";
5
+ const x = ({
6
+ badge: a,
7
+ title: l,
8
+ subtitle: m,
9
+ metaItems: s,
10
+ metaColumns: u = 4,
11
+ toolbar: p,
12
+ children: c,
13
+ footer: o,
14
+ className: d
15
+ }) => {
16
+ const i = !!(a || l || m);
17
+ return /* @__PURE__ */ n(
18
+ "div",
19
+ {
20
+ className: e("marsun-report-template", r["marsun-report-template"], d),
21
+ children: [
22
+ i ? /* @__PURE__ */ n(
23
+ "header",
24
+ {
25
+ className: e(
26
+ "marsun-report-template-header",
27
+ r["marsun-report-template-header"]
28
+ ),
29
+ children: [
30
+ a ? /* @__PURE__ */ t(
31
+ "div",
32
+ {
33
+ className: e(
34
+ "marsun-report-template-badge",
35
+ r["marsun-report-template-badge"]
36
+ ),
37
+ children: a
38
+ }
39
+ ) : null,
40
+ l ? /* @__PURE__ */ t(
41
+ "div",
42
+ {
43
+ className: e(
44
+ "marsun-report-template-title",
45
+ r["marsun-report-template-title"]
46
+ ),
47
+ children: l
48
+ }
49
+ ) : null,
50
+ m ? /* @__PURE__ */ t(
51
+ "p",
52
+ {
53
+ className: e(
54
+ "marsun-report-template-subtitle",
55
+ r["marsun-report-template-subtitle"]
56
+ ),
57
+ children: m
58
+ }
59
+ ) : null
60
+ ]
61
+ }
62
+ ) : null,
63
+ p ? /* @__PURE__ */ t(
64
+ "div",
65
+ {
66
+ className: e(
67
+ "marsun-report-template-toolbar",
68
+ r["marsun-report-template-toolbar"]
69
+ ),
70
+ children: p
71
+ }
72
+ ) : null,
73
+ s && s.length > 0 ? /* @__PURE__ */ t(h, { items: s, columns: u }) : null,
74
+ /* @__PURE__ */ t(
75
+ "div",
76
+ {
77
+ className: e("marsun-report-template-body", r["marsun-report-template-body"]),
78
+ children: c
79
+ }
80
+ ),
81
+ o ? /* @__PURE__ */ t(
82
+ "footer",
83
+ {
84
+ className: e(
85
+ "marsun-report-template-footer",
86
+ r["marsun-report-template-footer"]
87
+ ),
88
+ children: o
89
+ }
90
+ ) : null
91
+ ]
92
+ }
93
+ );
94
+ };
95
+ export {
96
+ x as default
97
+ };
98
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/components/AgentHub/Report/Detail/ReportTemplate/index.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport type { ReactNode } from 'react';\nimport ReportMetaStrip, { type ReportMetaItem } from '../ReportMetaStrip';\nimport styles from './style.module.scss';\n\nexport type ReportTemplateProps = {\n badge?: ReactNode;\n title?: ReactNode;\n subtitle?: ReactNode;\n metaItems?: ReportMetaItem[];\n metaColumns?: number;\n toolbar?: ReactNode;\n children?: ReactNode;\n footer?: ReactNode;\n className?: string;\n};\n\n/**\n * Agent 报告布局模板 — Meta 四列 + 叙事区槽位(无业务 API)\n */\nconst ReportTemplate: React.FC<ReportTemplateProps> = ({\n badge,\n title,\n subtitle,\n metaItems,\n metaColumns = 4,\n toolbar,\n children,\n footer,\n className,\n}) => {\n const showHeader = Boolean(badge || title || subtitle);\n\n return (\n <div\n className={classNames('marsun-report-template', styles['marsun-report-template'], className)}\n >\n {showHeader ? (\n <header\n className={classNames(\n 'marsun-report-template-header',\n styles['marsun-report-template-header'],\n )}\n >\n {badge ? (\n <div\n className={classNames(\n 'marsun-report-template-badge',\n styles['marsun-report-template-badge'],\n )}\n >\n {badge}\n </div>\n ) : null}\n {title ? (\n <div\n className={classNames(\n 'marsun-report-template-title',\n styles['marsun-report-template-title'],\n )}\n >\n {title}\n </div>\n ) : null}\n {subtitle ? (\n <p\n className={classNames(\n 'marsun-report-template-subtitle',\n styles['marsun-report-template-subtitle'],\n )}\n >\n {subtitle}\n </p>\n ) : null}\n </header>\n ) : null}\n\n {toolbar ? (\n <div\n className={classNames(\n 'marsun-report-template-toolbar',\n styles['marsun-report-template-toolbar'],\n )}\n >\n {toolbar}\n </div>\n ) : null}\n\n {metaItems && metaItems.length > 0 ? (\n <ReportMetaStrip items={metaItems} columns={metaColumns} />\n ) : null}\n\n <div\n className={classNames('marsun-report-template-body', styles['marsun-report-template-body'])}\n >\n {children}\n </div>\n\n {footer ? (\n <footer\n className={classNames(\n 'marsun-report-template-footer',\n styles['marsun-report-template-footer'],\n )}\n >\n {footer}\n </footer>\n ) : null}\n </div>\n );\n};\n\nexport default ReportTemplate;\n"],"names":["ReportTemplate","badge","title","subtitle","metaItems","metaColumns","toolbar","children","footer","className","showHeader","jsxs","classNames","styles","jsx","ReportMetaStrip"],"mappings":";;;;AAoBA,MAAMA,IAAgD,CAAC;AAAA,EACrD,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AACF,MAAM;AACJ,QAAMC,IAAa,GAAQT,KAASC,KAASC;AAE7C,SACE,gBAAAQ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAW,0BAA0BC,EAAO,wBAAwB,GAAGJ,CAAS;AAAA,MAE1F,UAAA;AAAA,QAAAC,IACC,gBAAAC;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWC;AAAA,cACT;AAAA,cACAC,EAAO,+BAA+B;AAAA,YAAA;AAAA,YAGvC,UAAA;AAAA,cAAAZ,IACC,gBAAAa;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAWF;AAAA,oBACT;AAAA,oBACAC,EAAO,8BAA8B;AAAA,kBAAA;AAAA,kBAGtC,UAAAZ;AAAA,gBAAA;AAAA,cAAA,IAED;AAAA,cACHC,IACC,gBAAAY;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAWF;AAAA,oBACT;AAAA,oBACAC,EAAO,8BAA8B;AAAA,kBAAA;AAAA,kBAGtC,UAAAX;AAAA,gBAAA;AAAA,cAAA,IAED;AAAA,cACHC,IACC,gBAAAW;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAWF;AAAA,oBACT;AAAA,oBACAC,EAAO,iCAAiC;AAAA,kBAAA;AAAA,kBAGzC,UAAAV;AAAA,gBAAA;AAAA,cAAA,IAED;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA,IAEJ;AAAA,QAEHG,IACC,gBAAAQ;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWF;AAAA,cACT;AAAA,cACAC,EAAO,gCAAgC;AAAA,YAAA;AAAA,YAGxC,UAAAP;AAAA,UAAA;AAAA,QAAA,IAED;AAAA,QAEHF,KAAaA,EAAU,SAAS,IAC/B,gBAAAU,EAACC,KAAgB,OAAOX,GAAW,SAASC,EAAA,CAAa,IACvD;AAAA,QAEJ,gBAAAS;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWF,EAAW,+BAA+BC,EAAO,6BAA6B,CAAC;AAAA,YAEzF,UAAAN;AAAA,UAAA;AAAA,QAAA;AAAA,QAGFC,IACC,gBAAAM;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWF;AAAA,cACT;AAAA,cACAC,EAAO,+BAA+B;AAAA,YAAA;AAAA,YAGvC,UAAAL;AAAA,UAAA;AAAA,QAAA,IAED;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGV;"}
@@ -0,0 +1,14 @@
1
+ const t = {
2
+ "marsun-report-template": "_marsun-report-template_8xub7_1",
3
+ "marsun-report-template-header": "_marsun-report-template-header_8xub7_8",
4
+ "marsun-report-template-badge": "_marsun-report-template-badge_8xub7_17",
5
+ "marsun-report-template-title": "_marsun-report-template-title_8xub7_23",
6
+ "marsun-report-template-subtitle": "_marsun-report-template-subtitle_8xub7_34",
7
+ "marsun-report-template-toolbar": "_marsun-report-template-toolbar_8xub7_40",
8
+ "marsun-report-template-body": "_marsun-report-template-body_8xub7_44",
9
+ "marsun-report-template-footer": "_marsun-report-template-footer_8xub7_52"
10
+ };
11
+ export {
12
+ t as default
13
+ };
14
+ //# sourceMappingURL=style.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -0,0 +1,4 @@
1
+ export { default as ReportMetaStrip } from './ReportMetaStrip';
2
+ export type { ReportMetaItem, ReportMetaStripProps, ReportMetaTone } from './ReportMetaStrip';
3
+ export { default as ReportTemplate } from './ReportTemplate';
4
+ export type { ReportTemplateProps } from './ReportTemplate';
@@ -0,0 +1 @@
1
+ export * from './Detail';
@@ -0,0 +1,11 @@
1
+ export type FormDataSyncProps = {
2
+ onChange: (data: Record<string, unknown>) => void;
3
+ };
4
+ /**
5
+ * 将 FormInfo / react-form 字段值变更回写父级(即时 onPatch)。
6
+ * 须作为 Form 子节点渲染。
7
+ *
8
+ * 注意:`form:field:change` 仅表示字段元信息挂载,不代表值变更;
9
+ * 值变更请听 `form:field:set-value`;列表增删听 `form-group:change`。
10
+ */
11
+ export default function FormDataSync({ onChange }: FormDataSyncProps): null;
@@ -0,0 +1,20 @@
1
+ import { useEffect as s } from "react";
2
+ import { useFormApi as a } from "@kne/react-form";
3
+ function m({ onChange: f }) {
4
+ const n = a();
5
+ return s(() => {
6
+ const { openApi: e, emitter: r } = n;
7
+ if (!r || !(e != null && e.getFormData)) return;
8
+ const t = () => {
9
+ f(e.getFormData());
10
+ }, o = r.on ?? r.addListener, c = r.off ?? r.removeListener;
11
+ if (!(!o || !c))
12
+ return o.call(r, "form:field:set-value", t), o.call(r, "form-group:change", t), () => {
13
+ c.call(r, "form:field:set-value", t), c.call(r, "form-group:change", t);
14
+ };
15
+ }, [n, f]), null;
16
+ }
17
+ export {
18
+ m as default
19
+ };
20
+ //# sourceMappingURL=FormDataSync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormDataSync.js","sources":["../../../src/components/Form/FormDataSync.tsx"],"sourcesContent":["import { useFormApi } from './kneReactForm';\nimport { useEffect } from 'react';\n\ntype EmitterLike = {\n on?: (event: string, handler: (...args: unknown[]) => void) => void;\n off?: (event: string, handler: (...args: unknown[]) => void) => void;\n addListener?: (event: string, handler: (...args: unknown[]) => void) => void;\n removeListener?: (event: string, handler: (...args: unknown[]) => void) => void;\n};\n\ntype OpenApiLike = {\n getFormData: () => Record<string, unknown>;\n};\n\nexport type FormDataSyncProps = {\n onChange: (data: Record<string, unknown>) => void;\n};\n\n/**\n * 将 FormInfo / react-form 字段值变更回写父级(即时 onPatch)。\n * 须作为 Form 子节点渲染。\n *\n * 注意:`form:field:change` 仅表示字段元信息挂载,不代表值变更;\n * 值变更请听 `form:field:set-value`;列表增删听 `form-group:change`。\n */\nexport default function FormDataSync({ onChange }: FormDataSyncProps) {\n const formApi = useFormApi() as {\n openApi: OpenApiLike;\n emitter: EmitterLike;\n };\n\n useEffect(() => {\n const { openApi, emitter } = formApi;\n if (!emitter || !openApi?.getFormData) return;\n\n const sync = () => {\n onChange(openApi.getFormData());\n };\n\n const subscribe = emitter.on ?? emitter.addListener;\n const unsubscribe = emitter.off ?? emitter.removeListener;\n if (!subscribe || !unsubscribe) return;\n\n subscribe.call(emitter, 'form:field:set-value', sync);\n subscribe.call(emitter, 'form-group:change', sync);\n return () => {\n unsubscribe.call(emitter, 'form:field:set-value', sync);\n unsubscribe.call(emitter, 'form-group:change', sync);\n };\n }, [formApi, onChange]);\n\n return null;\n}\n"],"names":["FormDataSync","onChange","formApi","useFormApi","useEffect","openApi","emitter","sync","subscribe","unsubscribe"],"mappings":";;AAyBA,SAAwBA,EAAa,EAAE,UAAAC,KAA+B;AACpE,QAAMC,IAAUC,EAAA;AAKhB,SAAAC,EAAU,MAAM;AACd,UAAM,EAAE,SAAAC,GAAS,SAAAC,EAAA,IAAYJ;AAC7B,QAAI,CAACI,KAAW,EAACD,KAAA,QAAAA,EAAS,aAAa;AAEvC,UAAME,IAAO,MAAM;AACjB,MAAAN,EAASI,EAAQ,aAAa;AAAA,IAChC,GAEMG,IAAYF,EAAQ,MAAMA,EAAQ,aAClCG,IAAcH,EAAQ,OAAOA,EAAQ;AAC3C,QAAI,GAACE,KAAa,CAACC;AAEnB,aAAAD,EAAU,KAAKF,GAAS,wBAAwBC,CAAI,GACpDC,EAAU,KAAKF,GAAS,qBAAqBC,CAAI,GAC1C,MAAM;AACX,QAAAE,EAAY,KAAKH,GAAS,wBAAwBC,CAAI,GACtDE,EAAY,KAAKH,GAAS,qBAAqBC,CAAI;AAAA,MACrD;AAAA,EACF,GAAG,CAACL,GAASD,CAAQ,CAAC,GAEf;AACT;"}
@@ -6,8 +6,10 @@ export { default as FetchSelect } from './FetchSelect';
6
6
  export type { FetchSelectProps, SelectOptionItem } from './FetchSelect';
7
7
  export { default as PersonOptionRow } from './PersonOptionRow';
8
8
  export type { PersonOptionRowProps } from './PersonOptionRow';
9
+ export { default as FormDataSync } from './FormDataSync';
10
+ export type { FormDataSyncProps } from './FormDataSync';
9
11
  /** @kne/form-info — 业务从包根导入,勿直连 @kne/form-info */
10
- export { FormInfo, Form, FormModal, FormSteps, FormStepsModal, List, TableList, MultiField, Input, TextArea, Select, InputNumber, Switch, SubmitButton, ResetButton, CancelButton, } from './kneFormInfo';
12
+ export { FormInfo, Form, FormModal, FormSteps, FormStepsModal, List, TableList, MultiField, Input, TextArea, Select, InputNumber, Switch, RadioGroup, SubmitButton, ResetButton, CancelButton, } from './kneFormInfo';
11
13
  export type { FormInfoProps, FormProps, FormModalProps, FormStepsProps, FormStepsModalProps, ListProps, TableListProps, MultiFieldProps, } from './kneFormInfo';
12
14
  /** @kne/react-form — 引擎 API;默认组件为 ReactForm(勿与 FormInfo 的 Form 混淆) */
13
15
  export { ReactForm, GroupList, useField, useFormApi, useFormContext, useGroup, useSubmit, useReset, RULES, preset, interceptors, compileErrMsg, computedFieldValueFromFormData, computedFormDataFormState, filterEmpty, findField, formUtils, isEmpty, isNotEmpty, matchFields, stateToError, stateToIsPass, } from './kneReactForm';
@@ -42,6 +42,7 @@ export declare const TextArea: ComponentType<FieldProps>;
42
42
  export declare const Select: ComponentType<FieldProps>;
43
43
  export declare const InputNumber: ComponentType<FieldProps>;
44
44
  export declare const Switch: ComponentType<FieldProps>;
45
+ export declare const RadioGroup: ComponentType<FieldProps>;
45
46
  export declare const SubmitButton: ComponentType<ButtonProps>;
46
47
  export declare const ResetButton: ComponentType<ButtonProps>;
47
48
  export declare const CancelButton: ComponentType<ButtonProps>;
@@ -1,21 +1,22 @@
1
1
  /* empty css */
2
- import t, { Form as o, FormModal as s, FormSteps as e, FormStepsModal as n, List as a, MultiField as r, TableList as c } from "@kne/form-info";
3
- import { CancelButton as m, Input as u, InputNumber as i, ResetButton as l, Select as F, SubmitButton as p, Switch as S, TextArea as $ } from "@kne/react-form-antd";
4
- const M = t, I = o, L = s, T = e, f = n, x = a, h = c, w = r, A = u, C = $, N = F, R = i, g = S, j = p, k = l, q = m;
2
+ import t, { Form as o, FormModal as s, FormSteps as e, FormStepsModal as n, List as a, MultiField as r, TableList as u } from "@kne/form-info";
3
+ import { CancelButton as c, Input as m, InputNumber as i, RadioGroup as l, ResetButton as p, Select as F, SubmitButton as $, Switch as S, TextArea as d } from "@kne/react-form-antd";
4
+ const I = t, L = o, R = s, T = e, f = n, x = a, h = u, w = r, A = m, C = d, G = F, N = i, g = S, j = l, k = $, q = p, v = c;
5
5
  export {
6
- q as CancelButton,
7
- I as Form,
8
- M as FormInfo,
9
- L as FormModal,
6
+ v as CancelButton,
7
+ L as Form,
8
+ I as FormInfo,
9
+ R as FormModal,
10
10
  T as FormSteps,
11
11
  f as FormStepsModal,
12
12
  A as Input,
13
- R as InputNumber,
13
+ N as InputNumber,
14
14
  x as List,
15
15
  w as MultiField,
16
- k as ResetButton,
17
- N as Select,
18
- j as SubmitButton,
16
+ j as RadioGroup,
17
+ q as ResetButton,
18
+ G as Select,
19
+ k as SubmitButton,
19
20
  g as Switch,
20
21
  h as TableList,
21
22
  C as TextArea
@@ -1 +1 @@
1
- {"version":3,"file":"kneFormInfo.js","sources":["../../../src/components/Form/kneFormInfo.ts"],"sourcesContent":["/**\n * 经 core 再导出 @kne/form-info(业务唯一入口)。\n * 布局组件来自 @kne/form-info;字段组件须从 @kne/react-form-antd 具名导入\n * (form-info 的 `export *` 在 Vite 下经 namespace 读取时常为 undefined)。\n */\nimport '@kne/form-info/dist/index.css';\nimport FormInfoBase, {\n Form as KneForm,\n FormModal as KneFormModal,\n FormSteps as KneFormSteps,\n FormStepsModal as KneFormStepsModal,\n List as KneList,\n MultiField as KneMultiField,\n TableList as KneTableList,\n type FormModalProps,\n type FormProps,\n type FormStepsModalProps,\n type FormStepsProps,\n type ListProps,\n type MultiFieldProps,\n type TableListProps,\n type FormInfoProps,\n} from '@kne/form-info';\nimport {\n CancelButton as KneCancelButton,\n Input as KneInput,\n InputNumber as KneInputNumber,\n ResetButton as KneResetButton,\n Select as KneSelect,\n SubmitButton as KneSubmitButton,\n Switch as KneSwitch,\n TextArea as KneTextArea,\n} from '@kne/react-form-antd';\nimport type { ComponentType, FC, ReactNode } from 'react';\n\ntype FieldProps = {\n name: string;\n label?: ReactNode;\n rule?: string;\n placeholder?: string;\n disabled?: boolean;\n block?: boolean;\n rows?: number;\n options?: unknown[];\n [key: string]: unknown;\n};\n\ntype ButtonProps = {\n children?: ReactNode;\n type?: string;\n loading?: boolean;\n [key: string]: unknown;\n};\n\ntype ItemTitleCtx = { index: number; data?: Record<string, unknown> };\n\nexport type {\n FormInfoProps,\n FormProps,\n FormModalProps,\n FormStepsProps,\n FormStepsModalProps,\n ListProps,\n TableListProps,\n MultiFieldProps,\n};\n\nexport const FormInfo = FormInfoBase;\nexport const Form = KneForm;\nexport const FormModal = KneFormModal as FC<FormModalProps & { children?: ReactNode }>;\nexport const FormSteps = KneFormSteps as FC<FormStepsProps>;\nexport const FormStepsModal = KneFormStepsModal as FC<FormStepsModalProps>;\n\nexport const List = KneList as FC<\n Omit<ListProps, 'itemTitle'> & {\n maxLength?: number;\n itemTitle?: (ctx: ItemTitleCtx) => string;\n }\n>;\nexport const TableList = KneTableList as FC<\n Omit<TableListProps, 'itemTitle'> & {\n itemTitle?: (ctx: ItemTitleCtx) => string;\n }\n>;\nexport const MultiField = KneMultiField as FC<MultiFieldProps>;\n\nexport const Input = KneInput as ComponentType<FieldProps>;\nexport const TextArea = KneTextArea as ComponentType<FieldProps>;\nexport const Select = KneSelect as ComponentType<FieldProps>;\nexport const InputNumber = KneInputNumber as ComponentType<FieldProps>;\nexport const Switch = KneSwitch as ComponentType<FieldProps>;\nexport const SubmitButton = KneSubmitButton as ComponentType<ButtonProps>;\nexport const ResetButton = KneResetButton as ComponentType<ButtonProps>;\nexport const CancelButton = KneCancelButton as ComponentType<ButtonProps>;\n"],"names":["FormInfo","FormInfoBase","Form","KneForm","FormModal","KneFormModal","FormSteps","KneFormSteps","FormStepsModal","KneFormStepsModal","List","KneList","TableList","KneTableList","MultiField","KneMultiField","Input","KneInput","TextArea","KneTextArea","Select","KneSelect","InputNumber","KneInputNumber","Switch","KneSwitch","SubmitButton","KneSubmitButton","ResetButton","KneResetButton","CancelButton","KneCancelButton"],"mappings":";;;AAmEO,MAAMA,IAAWC,GACXC,IAAOC,GACPC,IAAYC,GACZC,IAAYC,GACZC,IAAiBC,GAEjBC,IAAOC,GAMPC,IAAYC,GAKZC,IAAaC,GAEbC,IAAQC,GACRC,IAAWC,GACXC,IAASC,GACTC,IAAcC,GACdC,IAASC,GACTC,IAAeC,GACfC,IAAcC,GACdC,IAAeC;"}
1
+ {"version":3,"file":"kneFormInfo.js","sources":["../../../src/components/Form/kneFormInfo.ts"],"sourcesContent":["/**\n * 经 core 再导出 @kne/form-info(业务唯一入口)。\n * 布局组件来自 @kne/form-info;字段组件须从 @kne/react-form-antd 具名导入\n * (form-info 的 `export *` 在 Vite 下经 namespace 读取时常为 undefined)。\n */\nimport '@kne/form-info/dist/index.css';\nimport FormInfoBase, {\n Form as KneForm,\n FormModal as KneFormModal,\n FormSteps as KneFormSteps,\n FormStepsModal as KneFormStepsModal,\n List as KneList,\n MultiField as KneMultiField,\n TableList as KneTableList,\n type FormModalProps,\n type FormProps,\n type FormStepsModalProps,\n type FormStepsProps,\n type ListProps,\n type MultiFieldProps,\n type TableListProps,\n type FormInfoProps,\n} from '@kne/form-info';\nimport {\n CancelButton as KneCancelButton,\n Input as KneInput,\n InputNumber as KneInputNumber,\n RadioGroup as KneRadioGroup,\n ResetButton as KneResetButton,\n Select as KneSelect,\n SubmitButton as KneSubmitButton,\n Switch as KneSwitch,\n TextArea as KneTextArea,\n} from '@kne/react-form-antd';\nimport type { ComponentType, FC, ReactNode } from 'react';\n\ntype FieldProps = {\n name: string;\n label?: ReactNode;\n rule?: string;\n placeholder?: string;\n disabled?: boolean;\n block?: boolean;\n rows?: number;\n options?: unknown[];\n [key: string]: unknown;\n};\n\ntype ButtonProps = {\n children?: ReactNode;\n type?: string;\n loading?: boolean;\n [key: string]: unknown;\n};\n\ntype ItemTitleCtx = { index: number; data?: Record<string, unknown> };\n\nexport type {\n FormInfoProps,\n FormProps,\n FormModalProps,\n FormStepsProps,\n FormStepsModalProps,\n ListProps,\n TableListProps,\n MultiFieldProps,\n};\n\nexport const FormInfo = FormInfoBase;\nexport const Form = KneForm;\nexport const FormModal = KneFormModal as FC<FormModalProps & { children?: ReactNode }>;\nexport const FormSteps = KneFormSteps as FC<FormStepsProps>;\nexport const FormStepsModal = KneFormStepsModal as FC<FormStepsModalProps>;\n\nexport const List = KneList as FC<\n Omit<ListProps, 'itemTitle'> & {\n maxLength?: number;\n itemTitle?: (ctx: ItemTitleCtx) => string;\n }\n>;\nexport const TableList = KneTableList as FC<\n Omit<TableListProps, 'itemTitle'> & {\n itemTitle?: (ctx: ItemTitleCtx) => string;\n }\n>;\nexport const MultiField = KneMultiField as FC<MultiFieldProps>;\n\nexport const Input = KneInput as ComponentType<FieldProps>;\nexport const TextArea = KneTextArea as ComponentType<FieldProps>;\nexport const Select = KneSelect as ComponentType<FieldProps>;\nexport const InputNumber = KneInputNumber as ComponentType<FieldProps>;\nexport const Switch = KneSwitch as ComponentType<FieldProps>;\nexport const RadioGroup = KneRadioGroup as ComponentType<FieldProps>;\nexport const SubmitButton = KneSubmitButton as ComponentType<ButtonProps>;\nexport const ResetButton = KneResetButton as ComponentType<ButtonProps>;\nexport const CancelButton = KneCancelButton as ComponentType<ButtonProps>;\n"],"names":["FormInfo","FormInfoBase","Form","KneForm","FormModal","KneFormModal","FormSteps","KneFormSteps","FormStepsModal","KneFormStepsModal","List","KneList","TableList","KneTableList","MultiField","KneMultiField","Input","KneInput","TextArea","KneTextArea","Select","KneSelect","InputNumber","KneInputNumber","Switch","KneSwitch","RadioGroup","KneRadioGroup","SubmitButton","KneSubmitButton","ResetButton","KneResetButton","CancelButton","KneCancelButton"],"mappings":";;;AAoEO,MAAMA,IAAWC,GACXC,IAAOC,GACPC,IAAYC,GACZC,IAAYC,GACZC,IAAiBC,GAEjBC,IAAOC,GAMPC,IAAYC,GAKZC,IAAaC,GAEbC,IAAQC,GACRC,IAAWC,GACXC,IAASC,GACTC,IAAcC,GACdC,IAASC,GACTC,IAAaC,GACbC,IAAeC,GACfC,IAAcC,GACdC,IAAeC;"}
@@ -10,6 +10,7 @@ declare const createIcon: (Icon: LucideIcon, options?: {
10
10
  export declare const ArrowLeft: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
11
11
  export declare const ArrowLeftRight: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
12
12
  export declare const BarChart3: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
13
+ export declare const Bell: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
13
14
  export declare const BookOpen: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
14
15
  export declare const Bot: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
15
16
  export declare const Check: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
@@ -48,6 +49,7 @@ export declare const Inbox: React.ForwardRefExoticComponent<Omit<IconProps, "ref
48
49
  export declare const Info: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
49
50
  export declare const LayoutDashboard: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
50
51
  export declare const LayoutGrid: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
52
+ export declare const ListTodo: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
51
53
  export declare const Loader2: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
52
54
  export declare const Lock: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
53
55
  export declare const LogOut: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
@@ -82,6 +84,6 @@ export declare const UserRoundCog: React.ForwardRefExoticComponent<Omit<IconProp
82
84
  export declare const Users: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
83
85
  export declare const X: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
84
86
  export { createIcon };
85
- export declare const ICON_NAMES: readonly ["ArrowLeft", "ArrowLeftRight", "BarChart3", "BookOpen", "Bot", "Check", "ChevronDown", "ChevronLeft", "ChevronRight", "ChevronUp", "CircleAlert", "CircleCheck", "CircleHelp", "CirclePlay", "CircleX", "ClipboardCheck", "Clock", "CloudDownload", "CloudUpload", "Code", "Copy", "Crown", "Database", "Download", "Eye", "File", "FileArchive", "FileImage", "FileSpreadsheet", "FileText", "Flag", "Flame", "Folder", "FolderOpen", "Hash", "House", "Import", "Inbox", "Info", "LayoutDashboard", "LayoutGrid", "Loader2", "Lock", "LogOut", "Maximize2", "MessageCircle", "MessageSquare", "Minimize2", "PanelLeftClose", "PanelLeftOpen", "Pause", "Pencil", "Plus", "Presentation", "RefreshCw", "RotateCw", "Send", "Settings", "Shield", "ShieldCheck", "SlidersHorizontal", "Square", "Star", "ThumbsDown", "ThumbsUp", "Trash2", "Trophy", "Undo2", "Upload", "User", "UserPlus", "UserRoundCog", "Users", "X"];
87
+ export declare const ICON_NAMES: readonly ["ArrowLeft", "ArrowLeftRight", "BarChart3", "Bell", "BookOpen", "Bot", "Check", "ChevronDown", "ChevronLeft", "ChevronRight", "ChevronUp", "CircleAlert", "CircleCheck", "CircleHelp", "CirclePlay", "CircleX", "ClipboardCheck", "Clock", "CloudDownload", "CloudUpload", "Code", "Copy", "Crown", "Database", "Download", "Eye", "File", "FileArchive", "FileImage", "FileSpreadsheet", "FileText", "Flag", "Flame", "Folder", "FolderOpen", "Hash", "House", "Import", "Inbox", "Info", "LayoutDashboard", "LayoutGrid", "ListTodo", "Loader2", "Lock", "LogOut", "Maximize2", "MessageCircle", "MessageSquare", "Minimize2", "PanelLeftClose", "PanelLeftOpen", "Pause", "Pencil", "Plus", "Presentation", "RefreshCw", "RotateCw", "Send", "Settings", "Shield", "ShieldCheck", "SlidersHorizontal", "Square", "Star", "ThumbsDown", "ThumbsUp", "Trash2", "Trophy", "Undo2", "Upload", "User", "UserPlus", "UserRoundCog", "Users", "X"];
86
88
  export type IconName = (typeof ICON_NAMES)[number];
87
89
  export declare const ICON_REGISTRY: Record<IconName, React.FC<IconProps>>;