@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.
@@ -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 n } from "react";
5
- import i from "./style.module.scss.js";
6
- import l from "../InfoPage/InfoPage/index.js";
7
- const p = n((o, m) => {
8
- const { className: e, children: s, ...t } = Object.assign({ type: "inner" }, o);
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
- ...t,
13
+ ...s,
13
14
  ref: m,
14
- className: f("marsun-form-info-outer", i["marsun-form-info-outer"], e),
15
- children: /* @__PURE__ */ r(l.Part, { bordered: !1, children: s })
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
- p.displayName = "Form";
20
+ l.displayName = "Form";
20
21
  export {
21
- p as default
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":";;;;;;AAYA,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
+ {"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-outer_1pbsi_25",
3
- "marsun-form-info": "_marsun-form-info_1pbsi_25",
4
- "marsun-form-info-nest-block-col": "_marsun-form-info-nest-block-col_1pbsi_105",
5
- "marsun-form-info-extra-btn": "_marsun-form-info-extra-btn_1pbsi_123",
6
- "marsun-form-info-list-part": "_marsun-form-info-list-part_1pbsi_133",
7
- "marsun-form-info-list-item": "_marsun-form-info-list-item_1pbsi_155",
8
- "marsun-form-info-list-item-part": "_marsun-form-info-list-item-part_1pbsi_163",
9
- "marsun-form-info-list-item-part-in-bordered": "_marsun-form-info-list-item-part-in-bordered_1pbsi_180",
10
- "marsun-form-info-list-item-part-plain": "_marsun-form-info-list-item-part-plain_1pbsi_191",
11
- "marsun-form-info-list-item-part-wraps-nest-beyond": "_marsun-form-info-list-item-part-wraps-nest-beyond_1pbsi_203",
12
- "marsun-form-info-is-important": "_marsun-form-info-is-important_1pbsi_206",
13
- "marsun-form-info-nest-beyond": "_marsun-form-info-nest-beyond_1pbsi_220",
14
- "marsun-form-info-table-list-inner": "_marsun-form-info-table-list-inner_1pbsi_280",
15
- "marsun-form-info-list-item-part-beyond": "_marsun-form-info-list-item-part-beyond_1pbsi_345",
16
- "marsun-form-info-extra-container": "_marsun-form-info-extra-container_1pbsi_438",
17
- "marsun-form-info-list-item-part-no-title": "_marsun-form-info-list-item-part-no-title_1pbsi_550",
18
- "marsun-form-info-list-item-title-placeholder": "_marsun-form-info-list-item-title-placeholder_1pbsi_561",
19
- "marsun-form-info-nest-beyond-rail": "_marsun-form-info-nest-beyond-rail_1pbsi_622",
20
- "marsun-form-info-nest-beyond-collapsed": "_marsun-form-info-nest-beyond-collapsed_1pbsi_630",
21
- "marsun-form-info-nest-beyond-title": "_marsun-form-info-nest-beyond-title_1pbsi_679",
22
- "marsun-form-info-nest-level-toggle": "_marsun-form-info-nest-level-toggle_1pbsi_687",
23
- "marsun-form-info-nest-beyond-title-text": "_marsun-form-info-nest-beyond-title-text_1pbsi_704",
24
- "marsun-form-info-nest-parent-tag": "_marsun-form-info-nest-parent-tag_1pbsi_709",
25
- "marsun-form-info-nest-block-col-beyond": "_marsun-form-info-nest-block-col-beyond_1pbsi_806",
26
- "marsun-form-info-multi-field-item": "_marsun-form-info-multi-field-item_1pbsi_818",
27
- "react-form__field-label": "_react-form__field-label_1pbsi_28",
28
- "marsun-form-info-multi-field-add-btn": "_marsun-form-info-multi-field-add-btn_1pbsi_837",
29
- "marsun-form-info-table-list-view": "_marsun-form-info-table-list-view_1pbsi_841",
30
- "marsun-form-info-table-list": "_marsun-form-info-table-list_1pbsi_280",
31
- "marsun-form-info-is-mobile": "_marsun-form-info-is-mobile_1pbsi_875",
32
- "marsun-form-info-table-list-mobile-list": "_marsun-form-info-table-list-mobile-list_1pbsi_901",
33
- "marsun-form-info-table-list-mobile-card": "_marsun-form-info-table-list-mobile-card_1pbsi_907",
34
- "marsun-form-info-table-list-mobile-card-body": "_marsun-form-info-table-list-mobile-card-body_1pbsi_919",
35
- "marsun-form-info-table-list-mobile-field": "_marsun-form-info-table-list-mobile-field_1pbsi_927",
36
- "marsun-form-info-table-list-mobile-actions": "_marsun-form-info-table-list-mobile-actions_1pbsi_932",
37
- "marsun-form-info-table-list-field": "_marsun-form-info-table-list-field_1pbsi_951",
38
- "marsun-form-info-table-list-header": "_marsun-form-info-table-list-header_1pbsi_960",
39
- "marsun-form-info-is-req": "_marsun-form-info-is-req_1pbsi_28",
40
- "marsun-form-info-table-options": "_marsun-form-info-table-options_1pbsi_980",
41
- "marsun-form-info-table-options-header": "_marsun-form-info-table-options-header_1pbsi_993",
42
- "marsun-form-info-is-overflow": "_marsun-form-info-is-overflow_1pbsi_997",
43
- "marsun-form-info-steps": "_marsun-form-info-steps_1pbsi_1020",
44
- "marsun-form-info-steps-vertical": "_marsun-form-info-steps-vertical_1pbsi_1108",
45
- "marsun-form-info-steps-form-inner": "_marsun-form-info-steps-form-inner_1pbsi_1133",
46
- "marsun-form-info-steps-embed": "_marsun-form-info-steps-embed_1pbsi_1137",
47
- "marsun-form-info-steps-embed-panel": "_marsun-form-info-steps-embed-panel_1pbsi_1141",
48
- "marsun-form-info-steps-actions": "_marsun-form-info-steps-actions_1pbsi_1145",
49
- "marsun-form-info-steps-actions-side": "_marsun-form-info-steps-actions-side_1pbsi_1151",
50
- "marsun-form-info-steps-modal": "_marsun-form-info-steps-modal_1pbsi_1161",
51
- "marsun-form-info-table-list-empty": "_marsun-form-info-table-list-empty_1pbsi_1173",
52
- "marsun-form-info-column-not-layout": "_marsun-form-info-column-not-layout_1pbsi_1181"
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, columnsToConfig, COLUMN_CONFIG_COL_KEY, FLEX_SPACER_COL_KEY, hideColumnAtPath, isInternalColumnKey } from './columnConfigUtils';
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
- export type { TableColumnConfigItem, TableColumnConfigFetcher, TableColumnConfigSaver };
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
- * 基于 antd Table 的列表表格包装。
36
- * 列偏好经 user_key;行隐藏仅会话 state,不进 user_key。
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, };