@hkyhy/marsun-components-core 0.1.67 → 0.1.69
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/components/FlexBox/FlexBox.d.ts +7 -0
- package/dist/components/FlexBox/FlexBox.js +43 -0
- package/dist/components/FlexBox/FlexBox.js.map +1 -0
- package/dist/components/FlexBox/FlexBoxFetch.d.ts +3 -0
- package/dist/components/FlexBox/FlexBoxFetch.js +92 -0
- package/dist/components/FlexBox/FlexBoxFetch.js.map +1 -0
- package/dist/components/FlexBox/FlexBoxView.d.ts +18 -0
- package/dist/components/FlexBox/FlexBoxView.js +42 -0
- package/dist/components/FlexBox/FlexBoxView.js.map +1 -0
- package/dist/components/FlexBox/defaultColumns.d.ts +7 -0
- package/dist/components/FlexBox/defaultColumns.js +26 -0
- package/dist/components/FlexBox/defaultColumns.js.map +1 -0
- package/dist/components/FlexBox/index.d.ts +79 -0
- package/dist/components/FlexBox/useFlexBox.d.ts +5 -0
- package/dist/components/FlexBox/useFlexBox.js +19 -0
- package/dist/components/FlexBox/useFlexBox.js.map +1 -0
- package/dist/components/Form/FormDataSync.d.ts +3 -0
- package/dist/components/Form/FormDataSync.js +29 -15
- package/dist/components/Form/FormDataSync.js.map +1 -1
- package/dist/components/Form/InputRange.d.ts +19 -0
- package/dist/components/Form/InputRange.js +84 -0
- package/dist/components/Form/InputRange.js.map +1 -0
- package/dist/components/Form/InputRange.module.scss.js +9 -0
- package/dist/components/Form/InputRange.module.scss.js.map +1 -0
- package/dist/components/Form/index.d.ts +4 -0
- package/dist/components/Form/inputRangeRules.d.ts +15 -0
- package/dist/components/Form/inputRangeRules.js +23 -0
- package/dist/components/Form/inputRangeRules.js.map +1 -0
- package/dist/components/Form/kneFormInfo.js +7 -7
- package/dist/components/FormInfo/ErrorTip.d.ts +7 -0
- package/dist/components/FormInfo/ErrorTip.js +89 -0
- package/dist/components/FormInfo/ErrorTip.js.map +1 -0
- package/dist/components/FormInfo/Form.d.ts +7 -0
- package/dist/components/FormInfo/Form.js +23 -0
- package/dist/components/FormInfo/Form.js.map +1 -0
- package/dist/components/FormInfo/FormApiButton.d.ts +7 -0
- package/dist/components/FormInfo/FormApiButton.js +28 -0
- package/dist/components/FormInfo/FormApiButton.js.map +1 -0
- package/dist/components/FormInfo/FormDrawer.d.ts +9 -0
- package/dist/components/FormInfo/FormDrawer.js +42 -0
- package/dist/components/FormInfo/FormDrawer.js.map +1 -0
- package/dist/components/FormInfo/FormInfo.d.ts +4 -0
- package/dist/components/FormInfo/FormInfo.js +61 -0
- package/dist/components/FormInfo/FormInfo.js.map +1 -0
- package/dist/components/FormInfo/FormItem.d.ts +4 -0
- package/dist/components/FormInfo/FormItem.js +10 -0
- package/dist/components/FormInfo/FormItem.js.map +1 -0
- package/dist/components/FormInfo/FormModal.d.ts +11 -0
- package/dist/components/FormInfo/FormModal.js +43 -0
- package/dist/components/FormInfo/FormModal.js.map +1 -0
- package/dist/components/FormInfo/FormSteps.d.ts +9 -0
- package/dist/components/FormInfo/FormSteps.js +96 -0
- package/dist/components/FormInfo/FormSteps.js.map +1 -0
- package/dist/components/FormInfo/FormStepsModal.d.ts +14 -0
- package/dist/components/FormInfo/FormStepsModal.js +96 -0
- package/dist/components/FormInfo/FormStepsModal.js.map +1 -0
- package/dist/components/FormInfo/List.d.ts +6 -0
- package/dist/components/FormInfo/List.js +180 -0
- package/dist/components/FormInfo/List.js.map +1 -0
- package/dist/components/FormInfo/MultiField.d.ts +6 -0
- package/dist/components/FormInfo/MultiField.js +76 -0
- package/dist/components/FormInfo/MultiField.js.map +1 -0
- package/dist/components/FormInfo/Steps.d.ts +26 -0
- package/dist/components/FormInfo/Steps.js +178 -0
- package/dist/components/FormInfo/Steps.js.map +1 -0
- package/dist/components/FormInfo/TableList.d.ts +6 -0
- package/dist/components/FormInfo/TableList.js +216 -0
- package/dist/components/FormInfo/TableList.js.map +1 -0
- package/dist/components/FormInfo/buildFormOverlayProps.d.ts +27 -0
- package/dist/components/FormInfo/buildFormOverlayProps.js +55 -0
- package/dist/components/FormInfo/buildFormOverlayProps.js.map +1 -0
- package/dist/components/FormInfo/fields.d.ts +33 -0
- package/dist/components/FormInfo/fields.js +30 -0
- package/dist/components/FormInfo/fields.js.map +1 -0
- package/dist/components/FormInfo/index.d.ts +21 -0
- package/dist/components/FormInfo/locale/zh-CN.d.ts +16 -0
- package/dist/components/FormInfo/locale/zh-CN.js +17 -0
- package/dist/components/FormInfo/locale/zh-CN.js.map +1 -0
- package/dist/components/FormInfo/nestBlock.d.ts +15 -0
- package/dist/components/FormInfo/nestBlock.js +19 -0
- package/dist/components/FormInfo/nestBlock.js.map +1 -0
- package/dist/components/FormInfo/style.module.scss.js +57 -0
- package/dist/components/FormInfo/style.module.scss.js.map +1 -0
- package/dist/components/FormInfo/types.d.ts +213 -0
- package/dist/components/FormInfo/withLocale.d.ts +14 -0
- package/dist/components/FormInfo/withLocale.js +25 -0
- package/dist/components/FormInfo/withLocale.js.map +1 -0
- package/dist/components/InfoPage/CentralContent/boxComputed.d.ts +2 -0
- package/dist/components/InfoPage/CentralContent/boxComputed.js +15 -0
- package/dist/components/InfoPage/CentralContent/boxComputed.js.map +1 -0
- package/dist/components/InfoPage/CentralContent/index.d.ts +3 -0
- package/dist/components/InfoPage/CentralContent/index.js +102 -0
- package/dist/components/InfoPage/CentralContent/index.js.map +1 -0
- package/dist/components/InfoPage/CentralContent/style.module.scss.js +15 -0
- package/dist/components/InfoPage/CentralContent/style.module.scss.js.map +1 -0
- package/dist/components/InfoPage/Content/index.d.ts +16 -0
- package/dist/components/InfoPage/Content/index.js +72 -0
- package/dist/components/InfoPage/Content/index.js.map +1 -0
- package/dist/components/InfoPage/Content/style.module.scss.js +14 -0
- package/dist/components/InfoPage/Content/style.module.scss.js.map +1 -0
- package/dist/components/InfoPage/Descriptions/index.d.ts +9 -0
- package/dist/components/InfoPage/Descriptions/index.js +48 -0
- package/dist/components/InfoPage/Descriptions/index.js.map +1 -0
- package/dist/components/InfoPage/Descriptions/style.module.scss.js +11 -0
- package/dist/components/InfoPage/Descriptions/style.module.scss.js.map +1 -0
- package/dist/components/InfoPage/Flow/index.d.ts +9 -0
- package/dist/components/InfoPage/Flow/index.js +165 -0
- package/dist/components/InfoPage/Flow/index.js.map +1 -0
- package/dist/components/InfoPage/Flow/style.module.scss.js +19 -0
- package/dist/components/InfoPage/Flow/style.module.scss.js.map +1 -0
- package/dist/components/InfoPage/InfoPage/Collapse.d.ts +10 -0
- package/dist/components/InfoPage/InfoPage/Collapse.js +11 -0
- package/dist/components/InfoPage/InfoPage/Collapse.js.map +1 -0
- package/dist/components/InfoPage/InfoPage/index.d.ts +21 -0
- package/dist/components/InfoPage/InfoPage/index.js +35 -0
- package/dist/components/InfoPage/InfoPage/index.js.map +1 -0
- package/dist/components/InfoPage/InfoPage/style.module.scss.js +15 -0
- package/dist/components/InfoPage/InfoPage/style.module.scss.js.map +1 -0
- package/dist/components/InfoPage/Report/List.d.ts +6 -0
- package/dist/components/InfoPage/Report/List.js +26 -0
- package/dist/components/InfoPage/Report/List.js.map +1 -0
- package/dist/components/InfoPage/Report/Part.d.ts +6 -0
- package/dist/components/InfoPage/Report/Part.js +42 -0
- package/dist/components/InfoPage/Report/Part.js.map +1 -0
- package/dist/components/InfoPage/Report/PrintPageBreak.d.ts +3 -0
- package/dist/components/InfoPage/Report/PrintPageBreak.js +8 -0
- package/dist/components/InfoPage/Report/PrintPageBreak.js.map +1 -0
- package/dist/components/InfoPage/Report/Result.d.ts +6 -0
- package/dist/components/InfoPage/Report/Result.js +26 -0
- package/dist/components/InfoPage/Report/Result.js.map +1 -0
- package/dist/components/InfoPage/Report/Table.d.ts +6 -0
- package/dist/components/InfoPage/Report/Table.js +125 -0
- package/dist/components/InfoPage/Report/Table.js.map +1 -0
- package/dist/components/InfoPage/Report/index.d.ts +26 -0
- package/dist/components/InfoPage/Report/index.js +61 -0
- package/dist/components/InfoPage/Report/index.js.map +1 -0
- package/dist/components/InfoPage/Report/style.module.scss.js +47 -0
- package/dist/components/InfoPage/Report/style.module.scss.js.map +1 -0
- package/dist/components/InfoPage/Score/index.d.ts +8 -0
- package/dist/components/InfoPage/Score/index.js +50 -0
- package/dist/components/InfoPage/Score/index.js.map +1 -0
- package/dist/components/InfoPage/Score/style.module.scss.js +10 -0
- package/dist/components/InfoPage/Score/style.module.scss.js.map +1 -0
- package/dist/components/InfoPage/SplitLine/index.d.ts +17 -0
- package/dist/components/InfoPage/SplitLine/index.js +67 -0
- package/dist/components/InfoPage/SplitLine/index.js.map +1 -0
- package/dist/components/InfoPage/SplitLine/style.module.scss.js +8 -0
- package/dist/components/InfoPage/SplitLine/style.module.scss.js.map +1 -0
- package/dist/components/InfoPage/computeColumnsValue.d.ts +28 -0
- package/dist/components/InfoPage/computeColumnsValue.js +60 -0
- package/dist/components/InfoPage/computeColumnsValue.js.map +1 -0
- package/dist/components/InfoPage/formatView.d.ts +23 -0
- package/dist/components/InfoPage/formatView.js +119 -0
- package/dist/components/InfoPage/formatView.js.map +1 -0
- package/dist/components/InfoPage/index.d.ts +262 -0
- package/dist/components/OrgTree/OrgTree.js +103 -89
- package/dist/components/OrgTree/OrgTree.js.map +1 -1
- package/dist/components/ReactModal/ColumnsLayout.d.ts +7 -0
- package/dist/components/ReactModal/ColumnsLayout.js +20 -0
- package/dist/components/ReactModal/ColumnsLayout.js.map +1 -0
- package/dist/components/ReactModal/Drawer.d.ts +73 -0
- package/dist/components/ReactModal/Drawer.js +292 -0
- package/dist/components/ReactModal/Drawer.js.map +1 -0
- package/dist/components/ReactModal/Footer.d.ts +12 -0
- package/dist/components/ReactModal/Footer.js +53 -0
- package/dist/components/ReactModal/Footer.js.map +1 -0
- package/dist/components/ReactModal/Modal.d.ts +14 -0
- package/dist/components/ReactModal/Modal.js +366 -0
- package/dist/components/ReactModal/Modal.js.map +1 -0
- package/dist/components/ReactModal/ScrollRegion.d.ts +7 -0
- package/dist/components/ReactModal/ScrollRegion.js +22 -0
- package/dist/components/ReactModal/ScrollRegion.js.map +1 -0
- package/dist/components/ReactModal/SimpleBar.d.ts +2 -0
- package/dist/components/ReactModal/SimpleBar.js +7 -0
- package/dist/components/ReactModal/SimpleBar.js.map +1 -0
- package/dist/components/ReactModal/TabsLayout.d.ts +6 -0
- package/dist/components/ReactModal/TabsLayout.js +16 -0
- package/dist/components/ReactModal/TabsLayout.js.map +1 -0
- package/dist/components/ReactModal/confirmModal.module.scss.js +30 -0
- package/dist/components/ReactModal/confirmModal.module.scss.js.map +1 -0
- package/dist/components/ReactModal/createDrawerRender.d.ts +2 -0
- package/dist/components/ReactModal/createDrawerRender.js +7 -0
- package/dist/components/ReactModal/createDrawerRender.js.map +1 -0
- package/dist/components/ReactModal/createModalRender.d.ts +2 -0
- package/dist/components/ReactModal/createModalRender.js +7 -0
- package/dist/components/ReactModal/createModalRender.js.map +1 -0
- package/dist/components/ReactModal/drawer.module.scss.js +36 -0
- package/dist/components/ReactModal/drawer.module.scss.js.map +1 -0
- package/dist/components/ReactModal/index.d.ts +57 -0
- package/dist/components/ReactModal/intlStub.d.ts +15 -0
- package/dist/components/ReactModal/intlStub.js +21 -0
- package/dist/components/ReactModal/intlStub.js.map +1 -0
- package/dist/components/ReactModal/layouts.module.scss.js +12 -0
- package/dist/components/ReactModal/layouts.module.scss.js.map +1 -0
- package/dist/components/ReactModal/locale/en-US.d.ts +5 -0
- package/dist/components/ReactModal/locale/zh-CN.d.ts +5 -0
- package/dist/components/ReactModal/locale/zh-CN.js +8 -0
- package/dist/components/ReactModal/locale/zh-CN.js.map +1 -0
- package/dist/components/ReactModal/lockParentScroll.d.ts +3 -0
- package/dist/components/ReactModal/modalClassNames.d.ts +5 -0
- package/dist/components/ReactModal/modalClassNames.js +8 -0
- package/dist/components/ReactModal/modalClassNames.js.map +1 -0
- package/dist/components/ReactModal/style.module.scss.js +38 -0
- package/dist/components/ReactModal/style.module.scss.js.map +1 -0
- package/dist/components/ReactModal/useConfirmModal.d.ts +4 -0
- package/dist/components/ReactModal/useConfirmModal.js +161 -0
- package/dist/components/ReactModal/useConfirmModal.js.map +1 -0
- package/dist/components/ReactModal/useDrawer.d.ts +5 -0
- package/dist/components/ReactModal/useDrawer.js +123 -0
- package/dist/components/ReactModal/useDrawer.js.map +1 -0
- package/dist/components/ReactModal/usePatchElement.d.ts +2 -0
- package/dist/components/ReactModal/usePatchElement.js +11 -0
- package/dist/components/ReactModal/usePatchElement.js.map +1 -0
- package/dist/components/ReactModal/withLocale.d.ts +5 -0
- package/dist/components/ReactModal/withLocale.js +6 -0
- package/dist/components/ReactModal/withLocale.js.map +1 -0
- package/dist/components/VirtualScrollbar/VirtualScrollbar/index.d.ts +5 -0
- package/dist/components/VirtualScrollbar/VirtualScrollbar/index.js +75 -51
- package/dist/components/VirtualScrollbar/VirtualScrollbar/index.js.map +1 -1
- package/dist/components/index.d.ts +5 -0
- package/dist/form-info.d.ts +17 -0
- package/dist/form-info.js +68 -0
- package/dist/form-info.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +700 -632
- package/dist/index.js.map +1 -1
- package/dist/marsun-components-core.css +1 -1
- package/dist/styles/global.css +1 -1
- package/dist/utils/date.d.ts +4 -1
- package/dist/utils/date.js +35 -27
- package/dist/utils/date.js.map +1 -1
- package/package.json +16 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FormInfo 新栈公开入口(无 Kne* 前缀)。
|
|
3
|
+
* 业务优先:`import { … } from '@hkyhy/marsun-components-core/form-info'`
|
|
4
|
+
*/
|
|
5
|
+
export { default as Form } from './Form';
|
|
6
|
+
export { default as FormInfo } from './FormInfo';
|
|
7
|
+
export { default as FormModal, useFormModal } from './FormModal';
|
|
8
|
+
export { default as FormDrawer, useFormDrawer } from './FormDrawer';
|
|
9
|
+
export { default as FormItem } from './FormItem';
|
|
10
|
+
export { default as ErrorTip } from './ErrorTip';
|
|
11
|
+
export { default as FormApiButton } from './FormApiButton';
|
|
12
|
+
export { default as List } from './List';
|
|
13
|
+
export { default as SubList } from './List';
|
|
14
|
+
export { default as TableList } from './TableList';
|
|
15
|
+
export { default as MultiField } from './MultiField';
|
|
16
|
+
export { default as Steps, validateFieldsByName } from './Steps';
|
|
17
|
+
export { default as FormSteps } from './FormSteps';
|
|
18
|
+
export { default as FormStepsModal, useFormStepModal } from './FormStepsModal';
|
|
19
|
+
export { buildFormOverlayProps } from './buildFormOverlayProps';
|
|
20
|
+
export { Input, TextArea, Select, TreeSelect, InputNumber, Switch, RadioGroup, SubmitButton, ResetButton, CancelButton, } from './fields';
|
|
21
|
+
export type { FormInfoProps, FormProps, FormModalProps, FormDrawerProps, FormItemProps, ErrorTipProps, FormApiButtonProps, ListProps, TableListProps, MultiFieldProps, StepsProps, StepsItem, FormStepsProps, FormStepsItem, FormStepsModalProps, FormOverlaySharedProps, } from './types';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** 中文 stub;不引入 @kne/react-intl */
|
|
2
|
+
declare const locale: {
|
|
3
|
+
readonly submit: "提交";
|
|
4
|
+
readonly cancel: "取消";
|
|
5
|
+
readonly complete: "完成";
|
|
6
|
+
readonly prev: "上一步";
|
|
7
|
+
readonly next: "下一步";
|
|
8
|
+
readonly addText: "添加";
|
|
9
|
+
readonly deleteText: "删除";
|
|
10
|
+
readonly untitledStep: "第{index}步";
|
|
11
|
+
readonly nestLevel: "第{level}级";
|
|
12
|
+
readonly nestExpand: "展开第{level}级";
|
|
13
|
+
readonly nestCollapse: "收起第{level}级";
|
|
14
|
+
};
|
|
15
|
+
export type FormInfoLocaleKey = keyof typeof locale;
|
|
16
|
+
export default locale;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
submit: "提交",
|
|
3
|
+
cancel: "取消",
|
|
4
|
+
complete: "完成",
|
|
5
|
+
prev: "上一步",
|
|
6
|
+
next: "下一步",
|
|
7
|
+
addText: "添加",
|
|
8
|
+
deleteText: "删除",
|
|
9
|
+
untitledStep: "第{index}步",
|
|
10
|
+
nestLevel: "第{level}级",
|
|
11
|
+
nestExpand: "展开第{level}级",
|
|
12
|
+
nestCollapse: "收起第{level}级"
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
e as default
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=zh-CN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zh-CN.js","sources":["../../../../src/components/FormInfo/locale/zh-CN.ts"],"sourcesContent":["/** 中文 stub;不引入 @kne/react-intl */\nconst locale = {\n submit: '提交',\n cancel: '取消',\n complete: '完成',\n prev: '上一步',\n next: '下一步',\n addText: '添加',\n deleteText: '删除',\n untitledStep: '第{index}步',\n nestLevel: '第{level}级',\n nestExpand: '展开第{level}级',\n nestCollapse: '收起第{level}级',\n} as const;\n\nexport type FormInfoLocaleKey = keyof typeof locale;\nexport default locale;\n"],"names":["locale"],"mappings":"AACA,MAAMA,IAAS;AAAA,EACb,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,cAAc;AAChB;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** 标记为「占满整行」的嵌套模块(List / TableList / FormInfo / Steps) */
|
|
3
|
+
export declare const FORM_INFO_NEST_BLOCK = "__marsunFormInfoNestBlock";
|
|
4
|
+
/**
|
|
5
|
+
* 嵌套深度:根 List = 第 1 级 = depth 0。
|
|
6
|
+
* 第 5 级起(depth >= 4)走 nest-beyond;仅第 5 级画左侧色条。
|
|
7
|
+
*/
|
|
8
|
+
export declare const NEST_DEPTH_BEYOND = 4;
|
|
9
|
+
export declare const markNestBlock: <T>(Component: T) => T;
|
|
10
|
+
export declare const isNestBlockType: (type: unknown) => boolean;
|
|
11
|
+
export declare const isNestBlockElement: (element: unknown) => boolean;
|
|
12
|
+
/**
|
|
13
|
+
* 给 list 内嵌套模块打上 block + nestDepth(只靠 props)
|
|
14
|
+
*/
|
|
15
|
+
export declare const decorateNestBlocks: (list: React.ReactNode[], nestDepth: number) => React.ReactNode[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import f from "react";
|
|
2
|
+
const c = "__marsunFormInfoNestBlock", n = 4, a = (r) => ((r && typeof r == "object" || typeof r == "function") && (r[c] = !0), r), s = (r) => {
|
|
3
|
+
var e, o;
|
|
4
|
+
if (!r || typeof r != "object" && typeof r != "function")
|
|
5
|
+
return !1;
|
|
6
|
+
const t = r;
|
|
7
|
+
return !!(t[c] || (e = t.type) != null && e[c] || (o = t.render) != null && o[c]);
|
|
8
|
+
}, l = (r, t) => (Array.isArray(r) ? r : []).map((e) => !e || typeof e != "object" || !("type" in e) || !s(e.type) ? e : f.cloneElement(e, {
|
|
9
|
+
block: !0,
|
|
10
|
+
nestDepth: t
|
|
11
|
+
}));
|
|
12
|
+
export {
|
|
13
|
+
c as FORM_INFO_NEST_BLOCK,
|
|
14
|
+
n as NEST_DEPTH_BEYOND,
|
|
15
|
+
l as decorateNestBlocks,
|
|
16
|
+
s as isNestBlockType,
|
|
17
|
+
a as markNestBlock
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=nestBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nestBlock.js","sources":["../../../src/components/FormInfo/nestBlock.ts"],"sourcesContent":["// @ts-nocheck\nimport React from 'react';\n\n/** 标记为「占满整行」的嵌套模块(List / TableList / FormInfo / Steps) */\nexport const FORM_INFO_NEST_BLOCK = '__marsunFormInfoNestBlock';\n\n/**\n * 嵌套深度:根 List = 第 1 级 = depth 0。\n * 第 5 级起(depth >= 4)走 nest-beyond;仅第 5 级画左侧色条。\n */\nexport const NEST_DEPTH_BEYOND = 4;\n\nexport const markNestBlock = <T>(Component: T): T => {\n if (Component && typeof Component === 'object') {\n (Component as Record<string, unknown>)[FORM_INFO_NEST_BLOCK] = true;\n } else if (typeof Component === 'function') {\n (Component as unknown as Record<string, unknown>)[FORM_INFO_NEST_BLOCK] = true;\n }\n return Component;\n};\n\nexport const isNestBlockType = (type: unknown): boolean => {\n if (!type || (typeof type !== 'object' && typeof type !== 'function')) {\n return false;\n }\n const t = type as Record<string, unknown> & {\n type?: Record<string, unknown>;\n render?: Record<string, unknown>;\n };\n if (t[FORM_INFO_NEST_BLOCK]) {\n return true;\n }\n if (t.type?.[FORM_INFO_NEST_BLOCK] || t.render?.[FORM_INFO_NEST_BLOCK]) {\n return true;\n }\n return false;\n};\n\nexport const isNestBlockElement = (element: unknown): boolean => {\n if (!element || typeof element !== 'object' || !('type' in element)) {\n return false;\n }\n return isNestBlockType((element as { type: unknown }).type);\n};\n\n/**\n * 给 list 内嵌套模块打上 block + nestDepth(只靠 props)\n */\nexport const decorateNestBlocks = (list: React.ReactNode[], nestDepth: number) =>\n (Array.isArray(list) ? list : []).map((item) => {\n if (!item || typeof item !== 'object' || !('type' in item) || !isNestBlockType(item.type)) {\n return item;\n }\n return React.cloneElement(item as React.ReactElement, {\n block: true,\n nestDepth,\n });\n });\n"],"names":["FORM_INFO_NEST_BLOCK","NEST_DEPTH_BEYOND","markNestBlock","Component","isNestBlockType","type","_a","_b","decorateNestBlocks","list","nestDepth","item","React"],"mappings":";AAIO,MAAMA,IAAuB,6BAMvBC,IAAoB,GAEpBC,IAAgB,CAAIC,QAC3BA,KAAa,OAAOA,KAAc,YAE3B,OAAOA,KAAc,gBAC7BA,EAAiDH,CAAoB,IAAI,KAErEG,IAGIC,IAAkB,CAACC,MAA2B;;AACzD,MAAI,CAACA,KAAS,OAAOA,KAAS,YAAY,OAAOA,KAAS;AACxD,WAAO;AAET,QAAM,IAAIA;AAOV,SAHI,KAAEL,CAAoB,MAGtBM,IAAA,EAAE,SAAF,QAAAA,EAASN,OAAyBO,IAAA,EAAE,WAAF,QAAAA,EAAWP;AAInD,GAYaQ,IAAqB,CAACC,GAAyBC,OACzD,MAAM,QAAQD,CAAI,IAAIA,IAAO,CAAA,GAAI,IAAI,CAACE,MACjC,CAACA,KAAQ,OAAOA,KAAS,YAAY,EAAE,UAAUA,MAAS,CAACP,EAAgBO,EAAK,IAAI,IAC/EA,IAEFC,EAAM,aAAaD,GAA4B;AAAA,EACpD,OAAO;AAAA,EACP,WAAAD;AAAA,CACD,CACF;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
const o = {
|
|
2
|
+
"marsun-form-info-outer": "_marsun-form-info-outer_patuq_25",
|
|
3
|
+
"marsun-form-info": "_marsun-form-info_patuq_25",
|
|
4
|
+
"marsun-form-info-nest-block-col": "_marsun-form-info-nest-block-col_patuq_102",
|
|
5
|
+
"marsun-form-info-extra-btn": "_marsun-form-info-extra-btn_patuq_120",
|
|
6
|
+
"marsun-form-info-list-part": "_marsun-form-info-list-part_patuq_130",
|
|
7
|
+
"marsun-form-info-list-item": "_marsun-form-info-list-item_patuq_152",
|
|
8
|
+
"marsun-form-info-list-item-part": "_marsun-form-info-list-item-part_patuq_160",
|
|
9
|
+
"marsun-form-info-list-item-part-in-bordered": "_marsun-form-info-list-item-part-in-bordered_patuq_177",
|
|
10
|
+
"marsun-form-info-list-item-part-plain": "_marsun-form-info-list-item-part-plain_patuq_188",
|
|
11
|
+
"marsun-form-info-list-item-part-wraps-nest-beyond": "_marsun-form-info-list-item-part-wraps-nest-beyond_patuq_200",
|
|
12
|
+
"marsun-form-info-is-important": "_marsun-form-info-is-important_patuq_203",
|
|
13
|
+
"marsun-form-info-nest-beyond": "_marsun-form-info-nest-beyond_patuq_217",
|
|
14
|
+
"marsun-form-info-table-list-inner": "_marsun-form-info-table-list-inner_patuq_277",
|
|
15
|
+
"marsun-form-info-list-item-part-beyond": "_marsun-form-info-list-item-part-beyond_patuq_342",
|
|
16
|
+
"marsun-form-info-extra-container": "_marsun-form-info-extra-container_patuq_435",
|
|
17
|
+
"marsun-form-info-list-item-part-no-title": "_marsun-form-info-list-item-part-no-title_patuq_547",
|
|
18
|
+
"marsun-form-info-list-item-title-placeholder": "_marsun-form-info-list-item-title-placeholder_patuq_558",
|
|
19
|
+
"marsun-form-info-nest-beyond-rail": "_marsun-form-info-nest-beyond-rail_patuq_619",
|
|
20
|
+
"marsun-form-info-nest-beyond-collapsed": "_marsun-form-info-nest-beyond-collapsed_patuq_627",
|
|
21
|
+
"marsun-form-info-nest-beyond-title": "_marsun-form-info-nest-beyond-title_patuq_676",
|
|
22
|
+
"marsun-form-info-nest-level-toggle": "_marsun-form-info-nest-level-toggle_patuq_684",
|
|
23
|
+
"marsun-form-info-nest-beyond-title-text": "_marsun-form-info-nest-beyond-title-text_patuq_701",
|
|
24
|
+
"marsun-form-info-nest-parent-tag": "_marsun-form-info-nest-parent-tag_patuq_706",
|
|
25
|
+
"marsun-form-info-nest-block-col-beyond": "_marsun-form-info-nest-block-col-beyond_patuq_803",
|
|
26
|
+
"marsun-form-info-multi-field-item": "_marsun-form-info-multi-field-item_patuq_815",
|
|
27
|
+
"react-form__field-label": "_react-form__field-label_patuq_28",
|
|
28
|
+
"marsun-form-info-multi-field-add-btn": "_marsun-form-info-multi-field-add-btn_patuq_834",
|
|
29
|
+
"marsun-form-info-table-list-view": "_marsun-form-info-table-list-view_patuq_838",
|
|
30
|
+
"marsun-form-info-table-list": "_marsun-form-info-table-list_patuq_277",
|
|
31
|
+
"marsun-form-info-is-mobile": "_marsun-form-info-is-mobile_patuq_872",
|
|
32
|
+
"marsun-form-info-table-list-mobile-list": "_marsun-form-info-table-list-mobile-list_patuq_898",
|
|
33
|
+
"marsun-form-info-table-list-mobile-card": "_marsun-form-info-table-list-mobile-card_patuq_904",
|
|
34
|
+
"marsun-form-info-table-list-mobile-card-body": "_marsun-form-info-table-list-mobile-card-body_patuq_916",
|
|
35
|
+
"marsun-form-info-table-list-mobile-field": "_marsun-form-info-table-list-mobile-field_patuq_924",
|
|
36
|
+
"marsun-form-info-table-list-mobile-actions": "_marsun-form-info-table-list-mobile-actions_patuq_929",
|
|
37
|
+
"marsun-form-info-table-list-field": "_marsun-form-info-table-list-field_patuq_948",
|
|
38
|
+
"marsun-form-info-table-list-header": "_marsun-form-info-table-list-header_patuq_957",
|
|
39
|
+
"marsun-form-info-is-req": "_marsun-form-info-is-req_patuq_28",
|
|
40
|
+
"marsun-form-info-table-options": "_marsun-form-info-table-options_patuq_977",
|
|
41
|
+
"marsun-form-info-table-options-header": "_marsun-form-info-table-options-header_patuq_990",
|
|
42
|
+
"marsun-form-info-is-overflow": "_marsun-form-info-is-overflow_patuq_994",
|
|
43
|
+
"marsun-form-info-steps": "_marsun-form-info-steps_patuq_1017",
|
|
44
|
+
"marsun-form-info-steps-vertical": "_marsun-form-info-steps-vertical_patuq_1105",
|
|
45
|
+
"marsun-form-info-steps-form-inner": "_marsun-form-info-steps-form-inner_patuq_1130",
|
|
46
|
+
"marsun-form-info-steps-embed": "_marsun-form-info-steps-embed_patuq_1134",
|
|
47
|
+
"marsun-form-info-steps-embed-panel": "_marsun-form-info-steps-embed-panel_patuq_1138",
|
|
48
|
+
"marsun-form-info-steps-actions": "_marsun-form-info-steps-actions_patuq_1142",
|
|
49
|
+
"marsun-form-info-steps-actions-side": "_marsun-form-info-steps-actions-side_patuq_1148",
|
|
50
|
+
"marsun-form-info-steps-modal": "_marsun-form-info-steps-modal_patuq_1158",
|
|
51
|
+
"marsun-form-info-table-list-empty": "_marsun-form-info-table-list-empty_patuq_1170",
|
|
52
|
+
"marsun-form-info-column-not-layout": "_marsun-form-info-column-not-layout_patuq_1178"
|
|
53
|
+
};
|
|
54
|
+
export {
|
|
55
|
+
o as default
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=style.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps } from 'antd';
|
|
3
|
+
export type FormInfoList = ReactNode[];
|
|
4
|
+
export interface FormInfoProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
/** 固定列数;或传入 FlexBox 断点配置(非整数时走 useFlexBox) */
|
|
7
|
+
column?: number | Array<{
|
|
8
|
+
width: number;
|
|
9
|
+
col: number;
|
|
10
|
+
size?: number;
|
|
11
|
+
}> | Record<string, unknown>;
|
|
12
|
+
list?: FormInfoList;
|
|
13
|
+
gap?: number;
|
|
14
|
+
title?: ReactNode;
|
|
15
|
+
subtitle?: ReactNode;
|
|
16
|
+
extra?: ReactNode;
|
|
17
|
+
bordered?: boolean;
|
|
18
|
+
nestDepth?: number;
|
|
19
|
+
block?: boolean;
|
|
20
|
+
styles?: Record<string, CSSProperties>;
|
|
21
|
+
style?: CSSProperties;
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
}
|
|
24
|
+
export interface FormProps {
|
|
25
|
+
className?: string;
|
|
26
|
+
type?: string;
|
|
27
|
+
data?: Record<string, unknown>;
|
|
28
|
+
onSubmit?: (data: Record<string, unknown>, ...args: unknown[]) => unknown | Promise<unknown>;
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
}
|
|
32
|
+
export interface FormOverlaySharedProps {
|
|
33
|
+
formProps?: Record<string, unknown> | ((ctx: {
|
|
34
|
+
close?: () => void;
|
|
35
|
+
}) => Record<string, unknown>);
|
|
36
|
+
autoClose?: boolean;
|
|
37
|
+
okType?: string;
|
|
38
|
+
okButtonProps?: Record<string, unknown>;
|
|
39
|
+
okText?: ReactNode;
|
|
40
|
+
saveText?: ReactNode;
|
|
41
|
+
onOk?: (...args: unknown[]) => unknown;
|
|
42
|
+
cancelButtonProps?: Record<string, unknown>;
|
|
43
|
+
cancelText?: ReactNode;
|
|
44
|
+
footer?: ReactNode | ((ctx: {
|
|
45
|
+
defaultFooter: ReactNode;
|
|
46
|
+
props: Record<string, unknown>;
|
|
47
|
+
}) => ReactNode);
|
|
48
|
+
footerButtons?: unknown[];
|
|
49
|
+
children?: ReactNode | ((ctx: {
|
|
50
|
+
close?: () => void;
|
|
51
|
+
}) => ReactNode);
|
|
52
|
+
onClose?: () => void;
|
|
53
|
+
onCancel?: () => void;
|
|
54
|
+
className?: string;
|
|
55
|
+
title?: ReactNode;
|
|
56
|
+
[key: string]: unknown;
|
|
57
|
+
}
|
|
58
|
+
export interface FormModalProps extends FormOverlaySharedProps {
|
|
59
|
+
open?: boolean;
|
|
60
|
+
width?: string | number;
|
|
61
|
+
size?: string;
|
|
62
|
+
destroyOnHidden?: boolean;
|
|
63
|
+
/** 宿主渲染:createModalRender / createDrawerRender 或自定义 */
|
|
64
|
+
renderModal?: (hostProps: Record<string, unknown>) => ReactNode;
|
|
65
|
+
}
|
|
66
|
+
export interface FormDrawerProps extends FormOverlaySharedProps {
|
|
67
|
+
open?: boolean;
|
|
68
|
+
placement?: 'left' | 'right' | 'top' | 'bottom';
|
|
69
|
+
width?: string | number;
|
|
70
|
+
size?: string;
|
|
71
|
+
destroyOnHidden?: boolean;
|
|
72
|
+
}
|
|
73
|
+
export interface FormItemProps {
|
|
74
|
+
children: (api: Record<string, unknown> & {
|
|
75
|
+
formData?: Record<string, unknown>;
|
|
76
|
+
}) => ReactNode;
|
|
77
|
+
}
|
|
78
|
+
export interface ErrorTipProps {
|
|
79
|
+
name: string;
|
|
80
|
+
groupName?: string;
|
|
81
|
+
groupIndex?: number;
|
|
82
|
+
overlayClassName?: string;
|
|
83
|
+
errorRender?: (error: Record<string, unknown> & {
|
|
84
|
+
closeHover?: () => void;
|
|
85
|
+
}) => ReactNode;
|
|
86
|
+
children?: ReactNode;
|
|
87
|
+
}
|
|
88
|
+
export interface FormApiButtonProps extends Omit<ButtonProps, 'onClick'> {
|
|
89
|
+
onClick?: (formContext: Record<string, unknown>, e: React.MouseEvent) => unknown | Promise<unknown>;
|
|
90
|
+
}
|
|
91
|
+
export interface ListProps {
|
|
92
|
+
className?: string;
|
|
93
|
+
itemClassName?: string;
|
|
94
|
+
removeIcon?: ReactNode;
|
|
95
|
+
removeText?: ReactNode;
|
|
96
|
+
addText?: ReactNode;
|
|
97
|
+
addIcon?: ReactNode;
|
|
98
|
+
important?: boolean;
|
|
99
|
+
title?: ReactNode;
|
|
100
|
+
name: string;
|
|
101
|
+
list?: FormInfoList | ((...groupArgs: unknown[]) => FormInfoList);
|
|
102
|
+
empty?: ReactNode;
|
|
103
|
+
itemTitle?: ReactNode | ((ctx: {
|
|
104
|
+
index: number;
|
|
105
|
+
id?: string;
|
|
106
|
+
}) => ReactNode);
|
|
107
|
+
bordered?: boolean;
|
|
108
|
+
nestDepth?: number;
|
|
109
|
+
block?: boolean;
|
|
110
|
+
maxLength?: number;
|
|
111
|
+
minLength?: number;
|
|
112
|
+
defaultLength?: number;
|
|
113
|
+
[key: string]: unknown;
|
|
114
|
+
}
|
|
115
|
+
export interface TableListProps {
|
|
116
|
+
className?: string;
|
|
117
|
+
addIcon?: ReactNode;
|
|
118
|
+
addText?: ReactNode;
|
|
119
|
+
removeIcon?: ReactNode;
|
|
120
|
+
removeText?: ReactNode;
|
|
121
|
+
title?: ReactNode;
|
|
122
|
+
bordered?: boolean;
|
|
123
|
+
name: string;
|
|
124
|
+
list?: FormInfoList | ((...groupArgs: unknown[]) => FormInfoList);
|
|
125
|
+
empty?: ReactNode;
|
|
126
|
+
renderMobile?: boolean | ((...args: unknown[]) => ReactNode);
|
|
127
|
+
block?: boolean;
|
|
128
|
+
[key: string]: unknown;
|
|
129
|
+
}
|
|
130
|
+
export interface MultiFieldProps {
|
|
131
|
+
name: string;
|
|
132
|
+
label?: ReactNode;
|
|
133
|
+
rule?: string;
|
|
134
|
+
field: React.ComponentType<Record<string, unknown>>;
|
|
135
|
+
addText?: ReactNode | ((label?: ReactNode) => ReactNode);
|
|
136
|
+
addIcon?: ReactNode;
|
|
137
|
+
removeIcon?: ReactNode;
|
|
138
|
+
removeText?: ReactNode | ((label?: ReactNode) => ReactNode);
|
|
139
|
+
empty?: ReactNode;
|
|
140
|
+
className?: string;
|
|
141
|
+
[key: string]: unknown;
|
|
142
|
+
}
|
|
143
|
+
export interface StepsItem {
|
|
144
|
+
key?: string | number;
|
|
145
|
+
id?: string | number;
|
|
146
|
+
title?: ReactNode;
|
|
147
|
+
column?: number;
|
|
148
|
+
gap?: number;
|
|
149
|
+
list?: FormInfoList;
|
|
150
|
+
fieldNames?: string[];
|
|
151
|
+
children?: ReactNode;
|
|
152
|
+
}
|
|
153
|
+
export interface StepsProps {
|
|
154
|
+
className?: string;
|
|
155
|
+
stepsClassName?: string;
|
|
156
|
+
title?: ReactNode;
|
|
157
|
+
subtitle?: ReactNode;
|
|
158
|
+
bordered?: boolean;
|
|
159
|
+
items?: StepsItem[];
|
|
160
|
+
showActions?: boolean;
|
|
161
|
+
prevText?: ReactNode;
|
|
162
|
+
nextText?: ReactNode;
|
|
163
|
+
prevIcon?: ReactNode;
|
|
164
|
+
nextIcon?: ReactNode;
|
|
165
|
+
current?: number;
|
|
166
|
+
defaultCurrent?: number;
|
|
167
|
+
onChange?: (current: number) => void;
|
|
168
|
+
direction?: string;
|
|
169
|
+
orientation?: string;
|
|
170
|
+
[key: string]: unknown;
|
|
171
|
+
}
|
|
172
|
+
export interface FormStepsItem {
|
|
173
|
+
title?: ReactNode;
|
|
174
|
+
formProps?: Record<string, unknown>;
|
|
175
|
+
children?: ReactNode | ((ctx: {
|
|
176
|
+
isLastStep: boolean;
|
|
177
|
+
currentStep: number;
|
|
178
|
+
onStepChange: (n: number) => void;
|
|
179
|
+
getStepCache: () => unknown[];
|
|
180
|
+
}) => ReactNode);
|
|
181
|
+
}
|
|
182
|
+
export interface FormStepsProps {
|
|
183
|
+
className?: string;
|
|
184
|
+
stepsClassName?: string;
|
|
185
|
+
autoStep?: boolean;
|
|
186
|
+
onComplete?: (cache: unknown[]) => unknown | Promise<unknown>;
|
|
187
|
+
children?: ReactNode | ((ctx: {
|
|
188
|
+
children: ReactNode;
|
|
189
|
+
isLastStep: boolean;
|
|
190
|
+
currentStep: number;
|
|
191
|
+
onStepChange: (n: number) => void;
|
|
192
|
+
getStepCache: () => unknown[];
|
|
193
|
+
}) => ReactNode);
|
|
194
|
+
items?: FormStepsItem[];
|
|
195
|
+
current?: number;
|
|
196
|
+
defaultCurrent?: number;
|
|
197
|
+
onChange?: (current: number) => void;
|
|
198
|
+
direction?: string;
|
|
199
|
+
orientation?: string;
|
|
200
|
+
[key: string]: unknown;
|
|
201
|
+
}
|
|
202
|
+
export interface FormStepsModalProps {
|
|
203
|
+
items?: FormStepsItem[];
|
|
204
|
+
modalProps?: FormModalProps & {
|
|
205
|
+
autoClose?: boolean;
|
|
206
|
+
};
|
|
207
|
+
completeText?: ReactNode;
|
|
208
|
+
nextText?: ReactNode;
|
|
209
|
+
autoStep?: boolean;
|
|
210
|
+
onComplete?: (data: unknown[]) => unknown | Promise<unknown>;
|
|
211
|
+
className?: string;
|
|
212
|
+
[key: string]: unknown;
|
|
213
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { FormInfoLocaleKey } from './locale/zh-CN';
|
|
3
|
+
type FormatValues = Record<string, string | number>;
|
|
4
|
+
export declare function formatLocaleMessage(id: FormInfoLocaleKey, values?: FormatValues): string;
|
|
5
|
+
export declare function useFormInfoLocale(): {
|
|
6
|
+
formatMessage: ({ id }: {
|
|
7
|
+
id: FormInfoLocaleKey;
|
|
8
|
+
}, values?: FormatValues) => string;
|
|
9
|
+
};
|
|
10
|
+
export default function withLocale<P extends object>(Component: ComponentType<P>): {
|
|
11
|
+
(props: P): import("react").JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import c from "./locale/zh-CN.js";
|
|
3
|
+
function i(e, t) {
|
|
4
|
+
let r = c[e] ?? e;
|
|
5
|
+
return t && Object.entries(t).forEach(([a, o]) => {
|
|
6
|
+
r = r.replace(new RegExp(`\\{${a}\\}`, "g"), String(o));
|
|
7
|
+
}), r;
|
|
8
|
+
}
|
|
9
|
+
function m() {
|
|
10
|
+
return {
|
|
11
|
+
formatMessage: ({ id: e }, t) => i(e, t)
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function s(e) {
|
|
15
|
+
function t(r) {
|
|
16
|
+
return /* @__PURE__ */ n(e, { ...r });
|
|
17
|
+
}
|
|
18
|
+
return t.displayName = `WithLocale(${e.displayName || e.name || "Component"})`, t;
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
s as default,
|
|
22
|
+
i as formatLocaleMessage,
|
|
23
|
+
m as useFormInfoLocale
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=withLocale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withLocale.js","sources":["../../../src/components/FormInfo/withLocale.tsx"],"sourcesContent":["// @ts-nocheck\n/**\n * 轻量中文字典 HOC;不引入 @kne/react-intl。\n */\nimport type { ComponentType } from 'react';\nimport zhCN, { type FormInfoLocaleKey } from './locale/zh-CN';\n\ntype FormatValues = Record<string, string | number>;\n\nexport function formatLocaleMessage(id: FormInfoLocaleKey, values?: FormatValues): string {\n let text: string = zhCN[id] ?? id;\n if (values) {\n Object.entries(values).forEach(([k, v]) => {\n text = text.replace(new RegExp(`\\\\{${k}\\\\}`, 'g'), String(v));\n });\n }\n return text;\n}\n\nexport function useFormInfoLocale() {\n return {\n formatMessage: ({ id }: { id: FormInfoLocaleKey }, values?: FormatValues) =>\n formatLocaleMessage(id, values),\n };\n}\n\nexport default function withLocale<P extends object>(Component: ComponentType<P>) {\n function WithLocale(props: P) {\n return <Component {...props} />;\n }\n WithLocale.displayName = `WithLocale(${Component.displayName || Component.name || 'Component'})`;\n return WithLocale;\n}\n"],"names":["formatLocaleMessage","id","values","text","zhCN","k","v","useFormInfoLocale","withLocale","Component","WithLocale","props","jsx"],"mappings":";;AASO,SAASA,EAAoBC,GAAuBC,GAA+B;AACxF,MAAIC,IAAeC,EAAKH,CAAE,KAAKA;AAC/B,SAAIC,KACF,OAAO,QAAQA,CAAM,EAAE,QAAQ,CAAC,CAACG,GAAGC,CAAC,MAAM;AACzC,IAAAH,IAAOA,EAAK,QAAQ,IAAI,OAAO,MAAME,CAAC,OAAO,GAAG,GAAG,OAAOC,CAAC,CAAC;AAAA,EAC9D,CAAC,GAEIH;AACT;AAEO,SAASI,IAAoB;AAClC,SAAO;AAAA,IACL,eAAe,CAAC,EAAE,IAAAN,EAAA,GAAiCC,MACjDF,EAAoBC,GAAIC,CAAM;AAAA,EAAA;AAEpC;AAEA,SAAwBM,EAA6BC,GAA6B;AAChF,WAASC,EAAWC,GAAU;AAC5B,WAAO,gBAAAC,EAACH,GAAA,EAAW,GAAGE,EAAA,CAAO;AAAA,EAC/B;AACA,SAAAD,EAAW,cAAc,cAAcD,EAAU,eAAeA,EAAU,QAAQ,WAAW,KACtFC;AACT;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const h = (c, a) => {
|
|
2
|
+
const n = [];
|
|
3
|
+
return c.forEach((e, s) => {
|
|
4
|
+
const u = e.block ? 24 : e.span ? e.span : 24 / (e.col || a);
|
|
5
|
+
n.length === 0 && n.push([]);
|
|
6
|
+
let t = n[n.length - 1], r = 24 - t.reduce((p, l) => p + l.span, 0);
|
|
7
|
+
r < u && (t[t.length - 1].span += r, n.push([]), r = 24, t = n[n.length - 1]);
|
|
8
|
+
const o = s === c.length - 1;
|
|
9
|
+
t.push(Object.assign({}, e, { span: o ? r : u }));
|
|
10
|
+
}), n.reduce((e, s) => e.concat(s), []);
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
h as default
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=boxComputed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boxComputed.js","sources":["../../../../src/components/InfoPage/CentralContent/boxComputed.js"],"sourcesContent":["// @ts-nocheck\n// Ported from https://github.com/kne-union/info-page/blob/master/src/CentralContent/boxComputed.js\nconst boxComputed = (columns, col) => {\n const box = [];\n columns.forEach((item, index) => {\n const currentSpan = (() => {\n if (item.block) {\n return 24;\n }\n if (item.span) {\n return item.span;\n }\n return 24 / (item.col || col);\n })();\n if (box.length === 0) {\n box.push([]);\n }\n let currentLine = box[box.length - 1];\n let legacy =\n 24 -\n currentLine.reduce((a, b) => {\n return a + b.span;\n }, 0);\n if (legacy < currentSpan) {\n currentLine[currentLine.length - 1].span += legacy;\n box.push([]);\n legacy = 24;\n currentLine = box[box.length - 1];\n }\n const isLast = index === columns.length - 1;\n currentLine.push(Object.assign({}, item, { span: isLast ? legacy : currentSpan }));\n });\n\n return box.reduce((a, b) => {\n return a.concat(b);\n }, []);\n};\n\nexport default boxComputed;\n"],"names":["boxComputed","columns","col","box","item","index","currentSpan","currentLine","legacy","a","b","isLast"],"mappings":"AAEK,MAACA,IAAc,CAACC,GAASC,MAAQ;AACpC,QAAMC,IAAM,CAAA;AACZ,SAAAF,EAAQ,QAAQ,CAACG,GAAMC,MAAU;AAC/B,UAAMC,IACAF,EAAK,QACA,KAELA,EAAK,OACAA,EAAK,OAEP,MAAMA,EAAK,OAAOF;AAE3B,IAAIC,EAAI,WAAW,KACjBA,EAAI,KAAK,EAAE;AAEb,QAAII,IAAcJ,EAAIA,EAAI,SAAS,CAAC,GAChCK,IACF,KACAD,EAAY,OAAO,CAACE,GAAGC,MACdD,IAAIC,EAAE,MACZ,CAAC;AACN,IAAIF,IAASF,MACXC,EAAYA,EAAY,SAAS,CAAC,EAAE,QAAQC,GAC5CL,EAAI,KAAK,EAAE,GACXK,IAAS,IACTD,IAAcJ,EAAIA,EAAI,SAAS,CAAC;AAElC,UAAMQ,IAASN,MAAUJ,EAAQ,SAAS;AAC1C,IAAAM,EAAY,KAAK,OAAO,OAAO,CAAA,GAAIH,GAAM,EAAE,MAAMO,IAASH,IAASF,EAAW,CAAE,CAAC;AAAA,EACnF,CAAC,GAEMH,EAAI,OAAO,CAACM,GAAGC,MACbD,EAAE,OAAOC,CAAC,GAChB,CAAA,CAAE;AACP;"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsx as o, jsxs as $ } from "react/jsx-runtime";
|
|
2
|
+
import { isEmpty as I } from "@kne/is-empty";
|
|
3
|
+
import { Row as h, Col as i } from "antd";
|
|
4
|
+
import l from "classnames";
|
|
5
|
+
import { useMemo as j } from "react";
|
|
6
|
+
import v from "../computeColumnsValue.js";
|
|
7
|
+
import E from "./boxComputed.js";
|
|
8
|
+
import e from "./style.module.scss.js";
|
|
9
|
+
const m = (t) => typeof t == "number" ? `${t}px` : t, R = (t) => {
|
|
10
|
+
const {
|
|
11
|
+
dataSource: r,
|
|
12
|
+
columns: p,
|
|
13
|
+
type: d,
|
|
14
|
+
col: c,
|
|
15
|
+
valueIsEmpty: b,
|
|
16
|
+
emptyIsPlaceholder: w,
|
|
17
|
+
placeholder: y,
|
|
18
|
+
className: f,
|
|
19
|
+
context: s,
|
|
20
|
+
labelMaxWidth: u,
|
|
21
|
+
labelMinWidth: x,
|
|
22
|
+
contentMinWidth: N
|
|
23
|
+
} = Object.assign(
|
|
24
|
+
{
|
|
25
|
+
dataSource: {},
|
|
26
|
+
//数据
|
|
27
|
+
columns: [],
|
|
28
|
+
//列定义
|
|
29
|
+
col: 2,
|
|
30
|
+
//展示列数
|
|
31
|
+
valueIsEmpty: I,
|
|
32
|
+
placeholder: "-",
|
|
33
|
+
emptyIsPlaceholder: !0,
|
|
34
|
+
labelMinWidth: 100,
|
|
35
|
+
contentMinWidth: 100
|
|
36
|
+
},
|
|
37
|
+
t
|
|
38
|
+
), C = j(() => E(
|
|
39
|
+
v({
|
|
40
|
+
dataSource: r,
|
|
41
|
+
columns: p,
|
|
42
|
+
valueIsEmpty: b,
|
|
43
|
+
emptyIsPlaceholder: w,
|
|
44
|
+
context: s
|
|
45
|
+
}),
|
|
46
|
+
c
|
|
47
|
+
), [p, c, r, b, w, s]), n = u != null, M = m(u);
|
|
48
|
+
return /* @__PURE__ */ o("div", { className: l(e["table-view-scroll"], "table-view-scroll"), children: /* @__PURE__ */ o(
|
|
49
|
+
h,
|
|
50
|
+
{
|
|
51
|
+
className: l(
|
|
52
|
+
e["table-view"],
|
|
53
|
+
"table-view",
|
|
54
|
+
{
|
|
55
|
+
compact: d === "compact",
|
|
56
|
+
[e.compact]: d === "compact"
|
|
57
|
+
},
|
|
58
|
+
f
|
|
59
|
+
),
|
|
60
|
+
style: {
|
|
61
|
+
"--layout-col": c,
|
|
62
|
+
"--label-min-width": m(x),
|
|
63
|
+
"--content-min-width": m(N)
|
|
64
|
+
},
|
|
65
|
+
children: C.map((a, W) => /* @__PURE__ */ o(
|
|
66
|
+
i,
|
|
67
|
+
{
|
|
68
|
+
className: l(e["table-view-col"], "table-view-col"),
|
|
69
|
+
style: {
|
|
70
|
+
"--col-width": `${100 * a.span / 24}%`
|
|
71
|
+
},
|
|
72
|
+
children: /* @__PURE__ */ $(h, { className: l(e["table-view-item"], "table-view-item"), wrap: !1, children: [
|
|
73
|
+
/* @__PURE__ */ o(
|
|
74
|
+
i,
|
|
75
|
+
{
|
|
76
|
+
className: l(e["table-view-label"], "table-view-label", {
|
|
77
|
+
[e["allow-wrap"]]: n,
|
|
78
|
+
"allow-wrap": n
|
|
79
|
+
}),
|
|
80
|
+
style: {
|
|
81
|
+
"--col-label-width": `${800 / (c * a.span)}%`,
|
|
82
|
+
...n ? { "--label-max-width": M } : null
|
|
83
|
+
},
|
|
84
|
+
children: a.title
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
/* @__PURE__ */ o(i, { className: l(e["table-view-content"], "table-view-content"), children: v.computeDisplay({
|
|
88
|
+
column: a,
|
|
89
|
+
placeholder: y,
|
|
90
|
+
context: s
|
|
91
|
+
}) })
|
|
92
|
+
] })
|
|
93
|
+
},
|
|
94
|
+
`${a.name}-${W}`
|
|
95
|
+
))
|
|
96
|
+
}
|
|
97
|
+
) });
|
|
98
|
+
};
|
|
99
|
+
export {
|
|
100
|
+
R as default
|
|
101
|
+
};
|
|
102
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/InfoPage/CentralContent/index.jsx"],"sourcesContent":["// @ts-nocheck\n// Ported from https://github.com/kne-union/info-page/blob/master/src/CentralContent/index.js\nimport { isEmpty } from '@kne/is-empty';\nimport { Col, Row } from 'antd';\nimport classnames from 'classnames';\nimport React, { useMemo } from 'react';\nimport computeColumnsValue from '../computeColumnsValue';\nimport boxComputed from './boxComputed';\nimport style from './style.module.scss';\n\nconst toCssSize = (value) => (typeof value === 'number' ? `${value}px` : value);\n\nconst CentralContent = (props) => {\n const {\n dataSource,\n columns,\n type,\n col,\n valueIsEmpty,\n emptyIsPlaceholder,\n placeholder,\n className,\n context,\n labelMaxWidth,\n labelMinWidth,\n contentMinWidth,\n } = Object.assign(\n {\n dataSource: {}, //数据\n columns: [], //列定义\n col: 2, //展示列数\n valueIsEmpty: isEmpty,\n placeholder: '-',\n emptyIsPlaceholder: true,\n labelMinWidth: 100,\n contentMinWidth: 100,\n },\n props,\n );\n\n const renderColumns = useMemo(() => {\n return boxComputed(\n computeColumnsValue({\n dataSource,\n columns,\n valueIsEmpty,\n emptyIsPlaceholder,\n context,\n }),\n col,\n );\n }, [columns, col, dataSource, valueIsEmpty, emptyIsPlaceholder, context]);\n\n const allowLabelWrap = labelMaxWidth != null;\n const labelMaxWidthValue = toCssSize(labelMaxWidth);\n\n return (\n <div className={classnames(style['table-view-scroll'], 'table-view-scroll')}>\n <Row\n className={classnames(\n style['table-view'],\n 'table-view',\n {\n compact: type === 'compact',\n [style['compact']]: type === 'compact',\n },\n className,\n )}\n style={{\n '--layout-col': col,\n '--label-min-width': toCssSize(labelMinWidth),\n '--content-min-width': toCssSize(contentMinWidth),\n }}\n >\n {renderColumns.map((item, index) => {\n return (\n <Col\n className={classnames(style['table-view-col'], 'table-view-col')}\n key={`${item.name}-${index}`}\n style={{\n '--col-width': `${(100 * item.span) / 24}%`,\n }}\n >\n <Row className={classnames(style['table-view-item'], 'table-view-item')} wrap={false}>\n <Col\n className={classnames(style['table-view-label'], 'table-view-label', {\n [style['allow-wrap']]: allowLabelWrap,\n 'allow-wrap': allowLabelWrap,\n })}\n style={{\n '--col-label-width': `${(100 * 8) / (col * item.span)}%`,\n ...(allowLabelWrap ? { '--label-max-width': labelMaxWidthValue } : null),\n }}\n >\n {item.title}\n </Col>\n <Col className={classnames(style['table-view-content'], 'table-view-content')}>\n {computeColumnsValue.computeDisplay({\n column: item,\n placeholder,\n context,\n })}\n </Col>\n </Row>\n </Col>\n );\n })}\n </Row>\n </div>\n );\n};\n\nexport default CentralContent;\n"],"names":["toCssSize","value","CentralContent","props","dataSource","columns","type","col","valueIsEmpty","emptyIsPlaceholder","placeholder","className","context","labelMaxWidth","labelMinWidth","contentMinWidth","isEmpty","renderColumns","useMemo","boxComputed","computeColumnsValue","allowLabelWrap","labelMaxWidthValue","jsx","classnames","style","Row","item","index","Col","jsxs"],"mappings":";;;;;;;;AAUA,MAAMA,IAAY,CAACC,MAAW,OAAOA,KAAU,WAAW,GAAGA,CAAK,OAAOA,GAEnEC,IAAiB,CAACC,MAAU;AAChC,QAAM;AAAA,IACJ,YAAAC;AAAA,IACA,SAAAC;AAAA,IACA,MAAAC;AAAA,IACA,KAAAC;AAAA,IACA,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,EAAA,IACE,OAAO;AAAA,IACT;AAAA,MACE,YAAY,CAAA;AAAA;AAAA,MACZ,SAAS,CAAA;AAAA;AAAA,MACT,KAAK;AAAA;AAAA,MACL,cAAcC;AAAA,MACd,aAAa;AAAA,MACb,oBAAoB;AAAA,MACpB,eAAe;AAAA,MACf,iBAAiB;AAAA,IAAA;AAAA,IAEnBb;AAAA,EAAA,GAGIc,IAAgBC,EAAQ,MACrBC;AAAA,IACLC,EAAoB;AAAA,MAClB,YAAAhB;AAAA,MACA,SAAAC;AAAA,MACA,cAAAG;AAAA,MACA,oBAAAC;AAAA,MACA,SAAAG;AAAA,IAAA,CACD;AAAA,IACDL;AAAA,EAAA,GAED,CAACF,GAASE,GAAKH,GAAYI,GAAcC,GAAoBG,CAAO,CAAC,GAElES,IAAiBR,KAAiB,MAClCS,IAAqBtB,EAAUa,CAAa;AAElD,SACE,gBAAAU,EAAC,SAAI,WAAWC,EAAWC,EAAM,mBAAmB,GAAG,mBAAmB,GACxE,UAAA,gBAAAF;AAAA,IAACG;AAAA,IAAA;AAAA,MACC,WAAWF;AAAAA,QACTC,EAAM,YAAY;AAAA,QAClB;AAAA,QACA;AAAA,UACE,SAASnB,MAAS;AAAA,UAClB,CAACmB,EAAM,OAAU,GAAGnB,MAAS;AAAA,QAAA;AAAA,QAE/BK;AAAA,MAAA;AAAA,MAEF,OAAO;AAAA,QACL,gBAAgBJ;AAAA,QAChB,qBAAqBP,EAAUc,CAAa;AAAA,QAC5C,uBAAuBd,EAAUe,CAAe;AAAA,MAAA;AAAA,MAGjD,UAAAE,EAAc,IAAI,CAACU,GAAMC,MAEtB,gBAAAL;AAAA,QAACM;AAAA,QAAA;AAAA,UACC,WAAWL,EAAWC,EAAM,gBAAgB,GAAG,gBAAgB;AAAA,UAE/D,OAAO;AAAA,YACL,eAAe,GAAI,MAAME,EAAK,OAAQ,EAAE;AAAA,UAAA;AAAA,UAG1C,UAAA,gBAAAG,EAACJ,GAAA,EAAI,WAAWF,EAAWC,EAAM,iBAAiB,GAAG,iBAAiB,GAAG,MAAM,IAC7E,UAAA;AAAA,YAAA,gBAAAF;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,WAAWL,EAAWC,EAAM,kBAAkB,GAAG,oBAAoB;AAAA,kBACnE,CAACA,EAAM,YAAY,CAAC,GAAGJ;AAAA,kBACvB,cAAcA;AAAA,gBAAA,CACf;AAAA,gBACD,OAAO;AAAA,kBACL,qBAAqB,GAAI,OAAYd,IAAMoB,EAAK,KAAK;AAAA,kBACrD,GAAIN,IAAiB,EAAE,qBAAqBC,MAAuB;AAAA,gBAAA;AAAA,gBAGpE,UAAAK,EAAK;AAAA,cAAA;AAAA,YAAA;AAAA,YAER,gBAAAJ,EAACM,GAAA,EAAI,WAAWL,EAAWC,EAAM,oBAAoB,GAAG,oBAAoB,GACzE,UAAAL,EAAoB,eAAe;AAAA,cAClC,QAAQO;AAAA,cACR,aAAAjB;AAAA,cACA,SAAAE;AAAA,YAAA,CACD,EAAA,CACH;AAAA,UAAA,EAAA,CACF;AAAA,QAAA;AAAA,QAzBK,GAAGe,EAAK,IAAI,IAAIC,CAAK;AAAA,MAAA,CA4B/B;AAAA,IAAA;AAAA,EAAA,GAEL;AAEJ;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const l = "_compact_lmt68_18", t = {
|
|
2
|
+
"table-view-scroll": "_table-view-scroll_lmt68_2",
|
|
3
|
+
"table-view": "_table-view_lmt68_2",
|
|
4
|
+
compact: l,
|
|
5
|
+
"table-view-label": "_table-view-label_lmt68_22",
|
|
6
|
+
"table-view-item": "_table-view-item_lmt68_29",
|
|
7
|
+
"table-view-content": "_table-view-content_lmt68_33",
|
|
8
|
+
"table-view-col": "_table-view-col_lmt68_39",
|
|
9
|
+
"allow-wrap": "_allow-wrap_lmt68_70"
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
l as compact,
|
|
13
|
+
t as default
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=style.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export function Label({ className, children, setWidth }: {
|
|
3
|
+
className: any;
|
|
4
|
+
children: any;
|
|
5
|
+
setWidth: any;
|
|
6
|
+
}): React.JSX.Element;
|
|
7
|
+
export default Content;
|
|
8
|
+
declare function Content({ list, labelAlign, col, gutter, className, size, itemRender, }: {
|
|
9
|
+
list?: never[] | undefined;
|
|
10
|
+
labelAlign?: string | undefined;
|
|
11
|
+
col?: number | undefined;
|
|
12
|
+
gutter?: number | undefined;
|
|
13
|
+
className: any;
|
|
14
|
+
size: any;
|
|
15
|
+
itemRender: any;
|
|
16
|
+
}): React.JSX.Element;
|