@hkyhy/marsun-components-core 0.1.76 → 0.1.78
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/FormInfo/Form.js +11 -10
- package/dist/components/FormInfo/Form.js.map +1 -1
- package/dist/components/FormInfo/style.module.scss.js +51 -51
- package/dist/components/Table/Table.d.ts +27 -11
- package/dist/components/Table/Table.js +271 -225
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Table/useTableFetch.d.ts +49 -0
- package/dist/components/Table/useTableFetch.js +124 -0
- package/dist/components/Table/useTableFetch.js.map +1 -0
- package/dist/marsun-components-core.css +1 -1
- package/dist/styles/global.css +1 -1
- package/package.json +1 -1
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
2
3
|
import { FormAntd as a } from "@kne/react-form-antd";
|
|
3
4
|
import f from "classnames";
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
8
|
-
const { className: e, children:
|
|
5
|
+
import { forwardRef as i } from "react";
|
|
6
|
+
import n from "./style.module.scss.js";
|
|
7
|
+
import p from "../InfoPage/InfoPage/index.js";
|
|
8
|
+
const l = i((o, m) => {
|
|
9
|
+
const { className: e, children: t, ...s } = Object.assign({ type: "inner" }, o);
|
|
9
10
|
return /* @__PURE__ */ r(
|
|
10
11
|
a,
|
|
11
12
|
{
|
|
12
|
-
...
|
|
13
|
+
...s,
|
|
13
14
|
ref: m,
|
|
14
|
-
className: f("marsun-form-info-outer",
|
|
15
|
-
children: /* @__PURE__ */ r(
|
|
15
|
+
className: f("marsun-form-info-outer", n["marsun-form-info-outer"], e),
|
|
16
|
+
children: /* @__PURE__ */ r(p.Part, { bordered: !1, children: t })
|
|
16
17
|
}
|
|
17
18
|
);
|
|
18
19
|
});
|
|
19
|
-
|
|
20
|
+
l.displayName = "Form";
|
|
20
21
|
export {
|
|
21
|
-
|
|
22
|
+
l as default
|
|
22
23
|
};
|
|
23
24
|
//# sourceMappingURL=Form.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sources":["../../../src/components/FormInfo/Form.tsx"],"sourcesContent":["// @ts-nocheck\nimport { FormAntd as ReactForm } from '@kne/react-form-antd';\nimport classnames from 'classnames';\nimport { forwardRef } from 'react';\nimport InfoPage from '@/components/InfoPage';\nimport type { FormProps } from './types';\nimport style from './style.module.scss';\n\n/**\n * 新栈 Form:FormAntd + type=inner;外层 InfoPage.Part(扁平少 border)。\n * Ported/adapted from kne-union/form-info Form.js(计划要求 Part 而非整页 InfoPage)。\n */\nconst Form = forwardRef<unknown, FormProps>((props, ref) => {\n const { className, children, ...others } = Object.assign({ type: 'inner' }, props);\n return (\n <ReactForm\n {...others}\n ref={ref}\n className={classnames('marsun-form-info-outer', style['marsun-form-info-outer'], className)}\n >\n <InfoPage.Part bordered={false}>{children}</InfoPage.Part>\n </ReactForm>\n );\n});\n\nForm.displayName = 'Form';\n\nexport default Form;\n"],"names":["Form","forwardRef","props","ref","className","children","others","jsx","ReactForm","classnames","style","InfoPage"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Form.js","sources":["../../../src/components/FormInfo/Form.tsx"],"sourcesContent":["// @ts-nocheck\n/** 必填星号 / inner 字段间距;勿依赖 kneFormInfo 侧链(生产易被 tree-shake) */\nimport '@kne/react-form-antd/dist/index.css';\nimport { FormAntd as ReactForm } from '@kne/react-form-antd';\nimport classnames from 'classnames';\nimport { forwardRef } from 'react';\nimport InfoPage from '@/components/InfoPage';\nimport type { FormProps } from './types';\nimport style from './style.module.scss';\n\n/**\n * 新栈 Form:FormAntd + type=inner;外层 InfoPage.Part(扁平少 border)。\n * Ported/adapted from kne-union/form-info Form.js(计划要求 Part 而非整页 InfoPage)。\n */\nconst Form = forwardRef<unknown, FormProps>((props, ref) => {\n const { className, children, ...others } = Object.assign({ type: 'inner' }, props);\n return (\n <ReactForm\n {...others}\n ref={ref}\n className={classnames('marsun-form-info-outer', style['marsun-form-info-outer'], className)}\n >\n <InfoPage.Part bordered={false}>{children}</InfoPage.Part>\n </ReactForm>\n );\n});\n\nForm.displayName = 'Form';\n\nexport default Form;\n"],"names":["Form","forwardRef","props","ref","className","children","others","jsx","ReactForm","classnames","style","InfoPage"],"mappings":";;;;;;;AAcA,MAAMA,IAAOC,EAA+B,CAACC,GAAOC,MAAQ;AAC1D,QAAM,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,EAAA,IAAW,OAAO,OAAO,EAAE,MAAM,QAAA,GAAWJ,CAAK;AACjF,SACE,gBAAAK;AAAA,IAACC;AAAAA,IAAA;AAAA,MACE,GAAGF;AAAA,MACJ,KAAAH;AAAA,MACA,WAAWM,EAAW,0BAA0BC,EAAM,wBAAwB,GAAGN,CAAS;AAAA,MAE1F,4BAACO,EAAS,MAAT,EAAc,UAAU,IAAQ,UAAAN,EAAA,CAAS;AAAA,IAAA;AAAA,EAAA;AAGhD,CAAC;AAEDL,EAAK,cAAc;"}
|
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
const o = {
|
|
2
|
-
"marsun-form-info-outer": "_marsun-form-info-
|
|
3
|
-
"marsun-form-info": "_marsun-form-
|
|
4
|
-
"marsun-form-info-nest-block-col": "_marsun-form-info-nest-block-
|
|
5
|
-
"marsun-form-info-extra-btn": "_marsun-form-info-extra-
|
|
6
|
-
"marsun-form-info-list-part": "_marsun-form-info-list-
|
|
7
|
-
"marsun-form-info-list-item": "_marsun-form-info-list-
|
|
8
|
-
"marsun-form-info-list-item-part": "_marsun-form-info-list-item-
|
|
9
|
-
"marsun-form-info-list-item-part-in-bordered": "_marsun-form-info-list-item-part-in-
|
|
10
|
-
"marsun-form-info-list-item-part-plain": "_marsun-form-info-list-item-part-
|
|
11
|
-
"marsun-form-info-list-item-part-wraps-nest-beyond": "_marsun-form-info-list-item-part-wraps-nest-
|
|
12
|
-
"marsun-form-info-is-important": "_marsun-form-info-is-
|
|
13
|
-
"marsun-form-info-nest-beyond": "_marsun-form-info-nest-
|
|
14
|
-
"marsun-form-info-table-list-inner": "_marsun-form-info-table-list-
|
|
15
|
-
"marsun-form-info-list-item-part-beyond": "_marsun-form-info-list-item-part-
|
|
16
|
-
"marsun-form-info-extra-container": "_marsun-form-info-extra-
|
|
17
|
-
"marsun-form-info-list-item-part-no-title": "_marsun-form-info-list-item-part-no-
|
|
18
|
-
"marsun-form-info-list-item-title-placeholder": "_marsun-form-info-list-item-title-
|
|
19
|
-
"marsun-form-info-nest-beyond-rail": "_marsun-form-info-nest-beyond-
|
|
20
|
-
"marsun-form-info-nest-beyond-collapsed": "_marsun-form-info-nest-beyond-
|
|
21
|
-
"marsun-form-info-nest-beyond-title": "_marsun-form-info-nest-beyond-
|
|
22
|
-
"marsun-form-info-nest-level-toggle": "_marsun-form-info-nest-level-
|
|
23
|
-
"marsun-form-info-nest-beyond-title-text": "_marsun-form-info-nest-beyond-title-
|
|
24
|
-
"marsun-form-info-nest-parent-tag": "_marsun-form-info-nest-parent-
|
|
25
|
-
"marsun-form-info-nest-block-col-beyond": "_marsun-form-info-nest-block-col-
|
|
26
|
-
"marsun-form-info-multi-field-item": "_marsun-form-info-multi-field-
|
|
27
|
-
"react-form__field-label": "_react-form__field-
|
|
28
|
-
"marsun-form-info-multi-field-add-btn": "_marsun-form-info-multi-field-add-
|
|
29
|
-
"marsun-form-info-table-list-view": "_marsun-form-info-table-list-
|
|
30
|
-
"marsun-form-info-table-list": "_marsun-form-info-table-
|
|
31
|
-
"marsun-form-info-is-mobile": "_marsun-form-info-is-
|
|
32
|
-
"marsun-form-info-table-list-mobile-list": "_marsun-form-info-table-list-mobile-
|
|
33
|
-
"marsun-form-info-table-list-mobile-card": "_marsun-form-info-table-list-mobile-
|
|
34
|
-
"marsun-form-info-table-list-mobile-card-body": "_marsun-form-info-table-list-mobile-card-
|
|
35
|
-
"marsun-form-info-table-list-mobile-field": "_marsun-form-info-table-list-mobile-
|
|
36
|
-
"marsun-form-info-table-list-mobile-actions": "_marsun-form-info-table-list-mobile-
|
|
37
|
-
"marsun-form-info-table-list-field": "_marsun-form-info-table-list-
|
|
38
|
-
"marsun-form-info-table-list-header": "_marsun-form-info-table-list-
|
|
39
|
-
"marsun-form-info-is-req": "_marsun-form-info-is-
|
|
40
|
-
"marsun-form-info-table-options": "_marsun-form-info-table-
|
|
41
|
-
"marsun-form-info-table-options-header": "_marsun-form-info-table-options-
|
|
42
|
-
"marsun-form-info-is-overflow": "_marsun-form-info-is-
|
|
43
|
-
"marsun-form-info-steps": "_marsun-form-info-
|
|
44
|
-
"marsun-form-info-steps-vertical": "_marsun-form-info-steps-
|
|
45
|
-
"marsun-form-info-steps-form-inner": "_marsun-form-info-steps-form-
|
|
46
|
-
"marsun-form-info-steps-embed": "_marsun-form-info-steps-
|
|
47
|
-
"marsun-form-info-steps-embed-panel": "_marsun-form-info-steps-embed-
|
|
48
|
-
"marsun-form-info-steps-actions": "_marsun-form-info-steps-
|
|
49
|
-
"marsun-form-info-steps-actions-side": "_marsun-form-info-steps-actions-
|
|
50
|
-
"marsun-form-info-steps-modal": "_marsun-form-info-steps-
|
|
51
|
-
"marsun-form-info-table-list-empty": "_marsun-form-info-table-list-
|
|
52
|
-
"marsun-form-info-column-not-layout": "_marsun-form-info-column-not-
|
|
2
|
+
"marsun-form-info-outer": "_marsun-form-info-outer_1x40w_25",
|
|
3
|
+
"marsun-form-info": "_marsun-form-info_1x40w_25",
|
|
4
|
+
"marsun-form-info-nest-block-col": "_marsun-form-info-nest-block-col_1x40w_109",
|
|
5
|
+
"marsun-form-info-extra-btn": "_marsun-form-info-extra-btn_1x40w_127",
|
|
6
|
+
"marsun-form-info-list-part": "_marsun-form-info-list-part_1x40w_137",
|
|
7
|
+
"marsun-form-info-list-item": "_marsun-form-info-list-item_1x40w_159",
|
|
8
|
+
"marsun-form-info-list-item-part": "_marsun-form-info-list-item-part_1x40w_167",
|
|
9
|
+
"marsun-form-info-list-item-part-in-bordered": "_marsun-form-info-list-item-part-in-bordered_1x40w_184",
|
|
10
|
+
"marsun-form-info-list-item-part-plain": "_marsun-form-info-list-item-part-plain_1x40w_195",
|
|
11
|
+
"marsun-form-info-list-item-part-wraps-nest-beyond": "_marsun-form-info-list-item-part-wraps-nest-beyond_1x40w_207",
|
|
12
|
+
"marsun-form-info-is-important": "_marsun-form-info-is-important_1x40w_210",
|
|
13
|
+
"marsun-form-info-nest-beyond": "_marsun-form-info-nest-beyond_1x40w_224",
|
|
14
|
+
"marsun-form-info-table-list-inner": "_marsun-form-info-table-list-inner_1x40w_284",
|
|
15
|
+
"marsun-form-info-list-item-part-beyond": "_marsun-form-info-list-item-part-beyond_1x40w_349",
|
|
16
|
+
"marsun-form-info-extra-container": "_marsun-form-info-extra-container_1x40w_442",
|
|
17
|
+
"marsun-form-info-list-item-part-no-title": "_marsun-form-info-list-item-part-no-title_1x40w_554",
|
|
18
|
+
"marsun-form-info-list-item-title-placeholder": "_marsun-form-info-list-item-title-placeholder_1x40w_565",
|
|
19
|
+
"marsun-form-info-nest-beyond-rail": "_marsun-form-info-nest-beyond-rail_1x40w_626",
|
|
20
|
+
"marsun-form-info-nest-beyond-collapsed": "_marsun-form-info-nest-beyond-collapsed_1x40w_634",
|
|
21
|
+
"marsun-form-info-nest-beyond-title": "_marsun-form-info-nest-beyond-title_1x40w_683",
|
|
22
|
+
"marsun-form-info-nest-level-toggle": "_marsun-form-info-nest-level-toggle_1x40w_691",
|
|
23
|
+
"marsun-form-info-nest-beyond-title-text": "_marsun-form-info-nest-beyond-title-text_1x40w_708",
|
|
24
|
+
"marsun-form-info-nest-parent-tag": "_marsun-form-info-nest-parent-tag_1x40w_713",
|
|
25
|
+
"marsun-form-info-nest-block-col-beyond": "_marsun-form-info-nest-block-col-beyond_1x40w_810",
|
|
26
|
+
"marsun-form-info-multi-field-item": "_marsun-form-info-multi-field-item_1x40w_822",
|
|
27
|
+
"react-form__field-label": "_react-form__field-label_1x40w_28",
|
|
28
|
+
"marsun-form-info-multi-field-add-btn": "_marsun-form-info-multi-field-add-btn_1x40w_841",
|
|
29
|
+
"marsun-form-info-table-list-view": "_marsun-form-info-table-list-view_1x40w_845",
|
|
30
|
+
"marsun-form-info-table-list": "_marsun-form-info-table-list_1x40w_284",
|
|
31
|
+
"marsun-form-info-is-mobile": "_marsun-form-info-is-mobile_1x40w_879",
|
|
32
|
+
"marsun-form-info-table-list-mobile-list": "_marsun-form-info-table-list-mobile-list_1x40w_905",
|
|
33
|
+
"marsun-form-info-table-list-mobile-card": "_marsun-form-info-table-list-mobile-card_1x40w_911",
|
|
34
|
+
"marsun-form-info-table-list-mobile-card-body": "_marsun-form-info-table-list-mobile-card-body_1x40w_923",
|
|
35
|
+
"marsun-form-info-table-list-mobile-field": "_marsun-form-info-table-list-mobile-field_1x40w_931",
|
|
36
|
+
"marsun-form-info-table-list-mobile-actions": "_marsun-form-info-table-list-mobile-actions_1x40w_936",
|
|
37
|
+
"marsun-form-info-table-list-field": "_marsun-form-info-table-list-field_1x40w_955",
|
|
38
|
+
"marsun-form-info-table-list-header": "_marsun-form-info-table-list-header_1x40w_964",
|
|
39
|
+
"marsun-form-info-is-req": "_marsun-form-info-is-req_1x40w_28",
|
|
40
|
+
"marsun-form-info-table-options": "_marsun-form-info-table-options_1x40w_984",
|
|
41
|
+
"marsun-form-info-table-options-header": "_marsun-form-info-table-options-header_1x40w_997",
|
|
42
|
+
"marsun-form-info-is-overflow": "_marsun-form-info-is-overflow_1x40w_1001",
|
|
43
|
+
"marsun-form-info-steps": "_marsun-form-info-steps_1x40w_1024",
|
|
44
|
+
"marsun-form-info-steps-vertical": "_marsun-form-info-steps-vertical_1x40w_1112",
|
|
45
|
+
"marsun-form-info-steps-form-inner": "_marsun-form-info-steps-form-inner_1x40w_1137",
|
|
46
|
+
"marsun-form-info-steps-embed": "_marsun-form-info-steps-embed_1x40w_1141",
|
|
47
|
+
"marsun-form-info-steps-embed-panel": "_marsun-form-info-steps-embed-panel_1x40w_1145",
|
|
48
|
+
"marsun-form-info-steps-actions": "_marsun-form-info-steps-actions_1x40w_1149",
|
|
49
|
+
"marsun-form-info-steps-actions-side": "_marsun-form-info-steps-actions-side_1x40w_1155",
|
|
50
|
+
"marsun-form-info-steps-modal": "_marsun-form-info-steps-modal_1x40w_1165",
|
|
51
|
+
"marsun-form-info-table-list-empty": "_marsun-form-info-table-list-empty_1x40w_1177",
|
|
52
|
+
"marsun-form-info-column-not-layout": "_marsun-form-info-column-not-layout_1x40w_1185"
|
|
53
53
|
};
|
|
54
54
|
export {
|
|
55
55
|
o as default
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Key, ReactNode } from 'react';
|
|
2
1
|
import { TableProps as AntTableProps } from 'antd';
|
|
2
|
+
import { Key, ReactElement, ReactNode, Ref } from 'react';
|
|
3
3
|
import { TableColumnConfigFetcher, TableColumnConfigItem, TableColumnConfigSaver } from './columnConfigTypes';
|
|
4
|
-
import { applyColumnConfig,
|
|
4
|
+
import { applyColumnConfig, COLUMN_CONFIG_COL_KEY, columnsToConfig, FLEX_SPACER_COL_KEY, hideColumnAtPath, isInternalColumnKey } from './columnConfigUtils';
|
|
5
5
|
import { TablePrefs, TablePrefsFetcher, TablePrefsSaver } from './tablePrefsTypes';
|
|
6
|
-
|
|
7
|
-
export type { TablePrefs, TablePrefsFetcher, TablePrefsSaver };
|
|
6
|
+
import { TableFetchHandle, TableFetchMapped, TableFetchQuery } from './useTableFetch';
|
|
7
|
+
export type { TableColumnConfigFetcher, TableColumnConfigItem, TableColumnConfigSaver, TableFetchHandle, TableFetchMapped, TableFetchQuery, TablePrefs, TablePrefsFetcher, TablePrefsSaver, };
|
|
8
8
|
export type TableProps<RecordType extends object = Record<string, unknown>> = AntTableProps<RecordType> & {
|
|
9
9
|
/** 稳定偏好 key;业务列表必填 */
|
|
10
10
|
tableName?: string;
|
|
@@ -30,13 +30,29 @@ export type TableProps<RecordType extends object = Record<string, unknown>> = An
|
|
|
30
30
|
rowHideSelectedKeys?: Key[];
|
|
31
31
|
/** 自定义行隐藏工具条;默认内置按钮 */
|
|
32
32
|
rowConfigToolbar?: ReactNode | false;
|
|
33
|
+
/**
|
|
34
|
+
* Fetch 模式:`dataSource === undefined` 且提供本回调(或 fetchUrl)时由 Table 拉数。
|
|
35
|
+
* 优先于 fetchUrl。Marsun typed list 主路径。
|
|
36
|
+
*/
|
|
37
|
+
fetchData?: (q: TableFetchQuery) => Promise<unknown>;
|
|
38
|
+
/** Form FetchSelect 同构:GET/自定义 Request;需配合 transformData 或默认 pageData 解析 */
|
|
39
|
+
fetchUrl?: string;
|
|
40
|
+
fetchOptions?: RequestInit | ((q: TableFetchQuery) => RequestInit);
|
|
41
|
+
transformData?: (raw: unknown) => TableFetchMapped<RecordType>;
|
|
42
|
+
/** 筛选项;稳定序列化变则回第 1 页再请求 */
|
|
43
|
+
fetchParams?: unknown;
|
|
44
|
+
/** Tab 懒请求;默认 true */
|
|
45
|
+
enabled?: boolean;
|
|
46
|
+
/** fetch 模式默认 pageSize;默认 20 */
|
|
47
|
+
defaultPageSize?: number;
|
|
48
|
+
onFetched?: (r: TableFetchMapped<RecordType> & {
|
|
49
|
+
error: Error | null;
|
|
50
|
+
}) => void;
|
|
33
51
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
*/
|
|
38
|
-
declare function Table<RecordType extends object = Record<string, unknown>>({ className, style, scroll, pagination, locale, columns, dataSource, rowKey, tableName, columnConfigEnabled, fetchColumnConfig, saveColumnConfig, onColumnConfigChange, fetchTablePrefs, saveTablePrefs, onTablePrefsChange, rowConfigEnabled, lockedRowKeys, hiddenRowKeys: hiddenRowKeysProp, onHiddenRowKeysChange, rowHideSelectedKeys, rowConfigToolbar, rowSelection, ...rest }: TableProps<RecordType>): import("react").JSX.Element;
|
|
52
|
+
declare const Table: <RecordType extends object = Record<string, unknown>>(props: TableProps<RecordType> & {
|
|
53
|
+
ref?: Ref<TableFetchHandle>;
|
|
54
|
+
}) => ReactElement | null;
|
|
39
55
|
export default Table;
|
|
40
|
-
export { columnsToConfig, applyColumnConfig, COLUMN_CONFIG_COL_KEY, FLEX_SPACER_COL_KEY, isInternalColumnKey, hideColumnAtPath, };
|
|
41
|
-
export { parseTablePrefs, serializeTablePrefs, mergeTablePrefs, applyHiddenRows, normalizeHiddenRowKeys, } from './tablePrefsUtils';
|
|
42
56
|
export { emptyTablePrefs } from './tablePrefsTypes';
|
|
57
|
+
export { applyHiddenRows, mergeTablePrefs, normalizeHiddenRowKeys, parseTablePrefs, serializeTablePrefs, } from './tablePrefsUtils';
|
|
58
|
+
export { applyColumnConfig, COLUMN_CONFIG_COL_KEY, columnsToConfig, FLEX_SPACER_COL_KEY, hideColumnAtPath, isInternalColumnKey, };
|