@hkyhy/marsun-components-core 0.1.68 → 0.1.72
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 +9 -9
- 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/Iam/client.d.ts +42 -0
- package/dist/components/Iam/index.d.ts +10 -0
- package/dist/components/Iam/pages/IamOrgPage.d.ts +8 -0
- package/dist/components/Iam/pages/IamOrgPage.js +45 -0
- package/dist/components/Iam/pages/IamOrgPage.js.map +1 -0
- package/dist/components/Iam/pages/IamRolesPage.d.ts +24 -0
- package/dist/components/Iam/pages/IamRolesPage.js +222 -0
- package/dist/components/Iam/pages/IamRolesPage.js.map +1 -0
- package/dist/components/Iam/pages/IamSharedGroupsPage.d.ts +6 -0
- package/dist/components/Iam/pages/IamSharedGroupsPage.js +207 -0
- package/dist/components/Iam/pages/IamSharedGroupsPage.js.map +1 -0
- package/dist/components/Iam/pages/IamUsersPage.d.ts +10 -0
- package/dist/components/Iam/pages/IamUsersPage.js +314 -0
- package/dist/components/Iam/pages/IamUsersPage.js.map +1 -0
- package/dist/components/Iam/types.d.ts +85 -0
- package/dist/components/Iam/utils/catalogToItems.d.ts +3 -0
- package/dist/components/Iam/utils/catalogToItems.js +17 -0
- package/dist/components/Iam/utils/catalogToItems.js.map +1 -0
- package/dist/components/Iam/utils/draftEffectivePermissions.d.ts +48 -0
- package/dist/components/Iam/utils/draftEffectivePermissions.js +42 -0
- package/dist/components/Iam/utils/draftEffectivePermissions.js.map +1 -0
- package/dist/components/Iam/utils/multiTagSelect.d.ts +15 -0
- package/dist/components/Iam/utils/multiTagSelect.js +21 -0
- package/dist/components/Iam/utils/multiTagSelect.js.map +1 -0
- package/dist/components/Iam/utils/roleDisplay.d.ts +13 -0
- package/dist/components/Iam/utils/roleDisplay.js +17 -0
- package/dist/components/Iam/utils/roleDisplay.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/Layout/AgentAppShell/style.module.scss.js +20 -20
- package/dist/components/PermissionBindPanel/PermissionBindPanel.js +110 -98
- package/dist/components/PermissionBindPanel/PermissionBindPanel.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/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/iam.d.ts +14 -0
- package/dist/iam.js +23 -0
- package/dist/iam.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 +20 -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,42 @@
|
|
|
1
|
+
import { IamOrgUnit, IamPermission, IamRole, IamSharedGroup, IamUser, IamUsersPageResult } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* App 侧 `ssoIam.ts` 实现本接口;core 页面只依赖注入对象,不内置 fetch。
|
|
4
|
+
*/
|
|
5
|
+
export type IamClient = {
|
|
6
|
+
listUsers: (params?: {
|
|
7
|
+
page?: number;
|
|
8
|
+
pageSize?: number;
|
|
9
|
+
keyword?: string;
|
|
10
|
+
}) => Promise<IamUsersPageResult>;
|
|
11
|
+
getUser: (id: string) => Promise<IamUser>;
|
|
12
|
+
listRoles: () => Promise<IamRole[]>;
|
|
13
|
+
createRole: (body: {
|
|
14
|
+
name: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
}) => Promise<IamRole>;
|
|
17
|
+
updateRole: (id: string, body: {
|
|
18
|
+
name?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
}) => Promise<IamRole>;
|
|
21
|
+
deleteRole: (id: string) => Promise<void>;
|
|
22
|
+
setRolePermissions: (roleId: string, permissionIds: string[]) => Promise<void>;
|
|
23
|
+
listPermissions: () => Promise<IamPermission[]>;
|
|
24
|
+
listOrgUnits: () => Promise<IamOrgUnit[]>;
|
|
25
|
+
listSharedGroups: () => Promise<IamSharedGroup[]>;
|
|
26
|
+
createSharedGroup: (body: {
|
|
27
|
+
code: string;
|
|
28
|
+
name: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
roleIds?: string[];
|
|
31
|
+
}) => Promise<IamSharedGroup>;
|
|
32
|
+
updateSharedGroup: (id: string, body: {
|
|
33
|
+
name?: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
}) => Promise<IamSharedGroup>;
|
|
36
|
+
deleteSharedGroup: (id: string) => Promise<void>;
|
|
37
|
+
addSharedGroupMembers: (groupId: string, userIds: string[]) => Promise<void>;
|
|
38
|
+
removeSharedGroupMembers: (groupId: string, userIds: string[]) => Promise<void>;
|
|
39
|
+
listUserSharedGroups: (userId: string) => Promise<IamSharedGroup[]>;
|
|
40
|
+
setUserAppRoleCodes: (userId: string, roleCodes: string[]) => Promise<void>;
|
|
41
|
+
setUserSharedGroups: (userId: string, groupIds: string[]) => Promise<void>;
|
|
42
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type { IamClient } from './client';
|
|
2
|
+
export type { IamOrgUnit, IamPermission, IamRole, IamSharedGroup, IamUser, IamUsersPageResult, } from './types';
|
|
3
|
+
export { buildDraftEffectivePermissions, type DraftEpPerm, } from './utils/draftEffectivePermissions';
|
|
4
|
+
export { roleDisplayName, roleSelectOption } from './utils/roleDisplay';
|
|
5
|
+
export { MULTI_TAG_SHOW_LENGTH, multiTagSelectProps } from './utils/multiTagSelect';
|
|
6
|
+
export { catalogToItems } from './utils/catalogToItems';
|
|
7
|
+
export { default as IamUsersPage, type IamUsersPageProps } from './pages/IamUsersPage';
|
|
8
|
+
export { IamRolesPage, IamRolePermissionsPage, displayRoleDescription, type IamRolesPageProps, type IamRolePermissionsPageProps, } from './pages/IamRolesPage';
|
|
9
|
+
export { default as IamOrgPage, type IamOrgPageProps } from './pages/IamOrgPage';
|
|
10
|
+
export { default as IamSharedGroupsPage, type IamSharedGroupsPageProps, } from './pages/IamSharedGroupsPage';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IamClient } from '../client';
|
|
2
|
+
export type IamOrgPageProps = {
|
|
3
|
+
client: IamClient;
|
|
4
|
+
/** SSO Admin 组织维护页 URL(由 App 用 AUTH_LOGIN_URL 推导) */
|
|
5
|
+
ssoOrgAdminUrl: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
};
|
|
8
|
+
export default function IamOrgPage({ client, ssoOrgAdminUrl, title, }: IamOrgPageProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsxs as c, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { message as g } from "antd";
|
|
3
|
+
import { useState as i, useEffect as u, useMemo as p } from "react";
|
|
4
|
+
import h from "../../Layout/ModulePageShell/index.js";
|
|
5
|
+
import S from "../../Alert/Alert.js";
|
|
6
|
+
import O from "../../OrgTree/OrgTree.js";
|
|
7
|
+
function l(r) {
|
|
8
|
+
return r.map((e) => {
|
|
9
|
+
var t;
|
|
10
|
+
return {
|
|
11
|
+
id: e.id,
|
|
12
|
+
name: e.name,
|
|
13
|
+
parentId: e.parentId ?? null,
|
|
14
|
+
children: (t = e.children) != null && t.length ? l(e.children) : void 0
|
|
15
|
+
};
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function v({
|
|
19
|
+
client: r,
|
|
20
|
+
ssoOrgAdminUrl: e,
|
|
21
|
+
title: t = "组织架构管理"
|
|
22
|
+
}) {
|
|
23
|
+
const [m, n] = i(!1), [s, d] = i([]);
|
|
24
|
+
u(() => {
|
|
25
|
+
n(!0), r.listOrgUnits().then(d).catch((a) => g.error(a instanceof Error ? a.message : "加载失败")).finally(() => n(!1));
|
|
26
|
+
}, [r]);
|
|
27
|
+
const f = p(() => l(s), [s]);
|
|
28
|
+
return /* @__PURE__ */ c(h, { title: t, children: [
|
|
29
|
+
/* @__PURE__ */ o(
|
|
30
|
+
S,
|
|
31
|
+
{
|
|
32
|
+
type: "info",
|
|
33
|
+
showIcon: !0,
|
|
34
|
+
style: { marginBottom: 16 },
|
|
35
|
+
message: "组织架构请在 SSO 维护",
|
|
36
|
+
description: /* @__PURE__ */ o("a", { href: e, target: "_blank", rel: "noreferrer", children: "打开 SSO 组织" })
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
/* @__PURE__ */ o(O, { nodes: f, loading: m, editable: !1 })
|
|
40
|
+
] });
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
v as default
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=IamOrgPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IamOrgPage.js","sources":["../../../../src/components/Iam/pages/IamOrgPage.tsx"],"sourcesContent":["import { Alert } from '@/components/Alert';\nimport { ModulePageShell } from '@/components/Layout';\nimport { OrgTree, type OrgTreeNode } from '@/components/OrgTree';\nimport { message } from 'antd';\nimport { useEffect, useMemo, useState } from 'react';\nimport type { IamClient } from '../client';\nimport type { IamOrgUnit } from '../types';\n\nfunction toNodes(nodes: IamOrgUnit[]): OrgTreeNode[] {\n return nodes.map((n) => ({\n id: n.id,\n name: n.name,\n parentId: n.parentId ?? null,\n children: n.children?.length ? toNodes(n.children) : undefined,\n }));\n}\n\nexport type IamOrgPageProps = {\n client: IamClient;\n /** SSO Admin 组织维护页 URL(由 App 用 AUTH_LOGIN_URL 推导) */\n ssoOrgAdminUrl: string;\n title?: string;\n};\n\nexport default function IamOrgPage({\n client,\n ssoOrgAdminUrl,\n title = '组织架构管理',\n}: IamOrgPageProps) {\n const [loading, setLoading] = useState(false);\n const [tree, setTree] = useState<IamOrgUnit[]>([]);\n\n useEffect(() => {\n setLoading(true);\n void client\n .listOrgUnits()\n .then(setTree)\n .catch((e) => message.error(e instanceof Error ? e.message : '加载失败'))\n .finally(() => setLoading(false));\n }, [client]);\n\n const nodes = useMemo(() => toNodes(tree), [tree]);\n\n return (\n <ModulePageShell title={title}>\n <Alert\n type=\"info\"\n showIcon\n style={{ marginBottom: 16 }}\n message=\"组织架构请在 SSO 维护\"\n description={\n <a href={ssoOrgAdminUrl} target=\"_blank\" rel=\"noreferrer\">\n 打开 SSO 组织\n </a>\n }\n />\n <OrgTree nodes={nodes} loading={loading} editable={false} />\n </ModulePageShell>\n );\n}\n"],"names":["toNodes","nodes","n","_a","IamOrgPage","client","ssoOrgAdminUrl","title","loading","setLoading","useState","tree","setTree","useEffect","e","message","useMemo","jsxs","ModulePageShell","jsx","Alert","OrgTree"],"mappings":";;;;;;AAQA,SAASA,EAAQC,GAAoC;AACnD,SAAOA,EAAM,IAAI,CAACC,MAAA;;AAAO;AAAA,MACvB,IAAIA,EAAE;AAAA,MACN,MAAMA,EAAE;AAAA,MACR,UAAUA,EAAE,YAAY;AAAA,MACxB,WAAUC,IAAAD,EAAE,aAAF,QAAAC,EAAY,SAASH,EAAQE,EAAE,QAAQ,IAAI;AAAA,IAAA;AAAA,GACrD;AACJ;AASA,SAAwBE,EAAW;AAAA,EACjC,QAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,OAAAC,IAAQ;AACV,GAAoB;AAClB,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAS,EAAK,GACtC,CAACC,GAAMC,CAAO,IAAIF,EAAuB,CAAA,CAAE;AAEjD,EAAAG,EAAU,MAAM;AACd,IAAAJ,EAAW,EAAI,GACVJ,EACF,eACA,KAAKO,CAAO,EACZ,MAAM,CAACE,MAAMC,EAAQ,MAAMD,aAAa,QAAQA,EAAE,UAAU,MAAM,CAAC,EACnE,QAAQ,MAAML,EAAW,EAAK,CAAC;AAAA,EACpC,GAAG,CAACJ,CAAM,CAAC;AAEX,QAAMJ,IAAQe,EAAQ,MAAMhB,EAAQW,CAAI,GAAG,CAACA,CAAI,CAAC;AAEjD,SACE,gBAAAM,EAACC,KAAgB,OAAAX,GACf,UAAA;AAAA,IAAA,gBAAAY;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,UAAQ;AAAA,QACR,OAAO,EAAE,cAAc,GAAA;AAAA,QACvB,SAAQ;AAAA,QACR,+BACG,KAAA,EAAE,MAAMd,GAAgB,QAAO,UAAS,KAAI,cAAa,UAAA,YAAA,CAE1D;AAAA,MAAA;AAAA,IAAA;AAAA,IAGJ,gBAAAa,EAACE,GAAA,EAAQ,OAAApB,GAAc,SAAAO,GAAkB,UAAU,GAAA,CAAO;AAAA,EAAA,GAC5D;AAEJ;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PermissionBindCatalog } from '../../PermissionBindPanel';
|
|
2
|
+
import { IamClient } from '../client';
|
|
3
|
+
/** 隐藏矩阵 sync 运维 provenance,不当作用户可读描述 */
|
|
4
|
+
export declare function displayRoleDescription(v: string | null | undefined): string;
|
|
5
|
+
export type IamRolesPageProps = {
|
|
6
|
+
client: IamClient;
|
|
7
|
+
/** 角色列表路由,默认 `/config/iam/roles` */
|
|
8
|
+
rolesListPath?: string;
|
|
9
|
+
/** 绑权页路径工厂 */
|
|
10
|
+
rolePermissionsPath?: (roleId: string) => string;
|
|
11
|
+
title?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function IamRolesPage({ client, rolesListPath, rolePermissionsPath, title, }: IamRolesPageProps): import("react").JSX.Element;
|
|
14
|
+
export type IamRolePermissionsPageProps = {
|
|
15
|
+
client: IamClient;
|
|
16
|
+
catalog: PermissionBindCatalog;
|
|
17
|
+
systemEntryCodes: readonly string[];
|
|
18
|
+
systemAppCode: string;
|
|
19
|
+
rolesListPath?: string;
|
|
20
|
+
onAfterSave?: () => void | Promise<void>;
|
|
21
|
+
emptyCatalogHint?: string;
|
|
22
|
+
title?: string;
|
|
23
|
+
};
|
|
24
|
+
export declare function IamRolePermissionsPage({ client, catalog, systemEntryCodes, systemAppCode, rolesListPath, onAfterSave, emptyCatalogHint, title, }: IamRolePermissionsPageProps): import("react").JSX.Element;
|