@hkyhy/marsun-components-core 0.1.23 → 0.1.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/components/AgentHub/Chat/utils/index.d.ts +2 -0
  2. package/dist/components/AgentHub/Chat/utils/smoothScroll.js +51 -0
  3. package/dist/components/AgentHub/Chat/utils/smoothScroll.js.map +1 -0
  4. package/dist/components/File/FilePreview/FilePreviewContent.js +11 -12
  5. package/dist/components/File/FilePreview/FilePreviewContent.js.map +1 -1
  6. package/dist/components/Filter/FilterSelect/index.d.ts +4 -2
  7. package/dist/components/Filter/FilterSelect/index.js +253 -157
  8. package/dist/components/Filter/FilterSelect/index.js.map +1 -1
  9. package/dist/components/Filter/FilterSelect/style.module.scss.js +14 -12
  10. package/dist/components/Filter/FilterSelect/style.module.scss.js.map +1 -1
  11. package/dist/components/Form/index.d.ts +6 -0
  12. package/dist/components/Form/kneFormInfo.d.ts +47 -0
  13. package/dist/components/Form/kneFormInfo.js +23 -0
  14. package/dist/components/Form/kneFormInfo.js.map +1 -0
  15. package/dist/components/Form/kneReactForm.d.ts +8 -0
  16. package/dist/components/Layout/PageSpin/index.js +5 -5
  17. package/dist/components/Layout/PageSpin/index.js.map +1 -1
  18. package/dist/components/Table/Table.d.ts +8 -0
  19. package/dist/components/Table/Table.js +39 -0
  20. package/dist/components/Table/Table.js.map +1 -0
  21. package/dist/components/Table/index.d.ts +2 -0
  22. package/dist/components/Table/style.module.scss.js +7 -0
  23. package/dist/components/Table/style.module.scss.js.map +1 -0
  24. package/dist/components/index.d.ts +1 -0
  25. package/dist/index.d.ts +3 -1
  26. package/dist/index.js +379 -332
  27. package/dist/index.js.map +1 -1
  28. package/dist/marsun-components-core.css +1 -1
  29. package/dist/styles/global.css +1 -1
  30. package/dist/theme/theme.js +8 -6
  31. package/dist/theme/theme.js.map +1 -1
  32. package/dist/theme/tokens.css +12 -0
  33. package/dist/utils/authRedirect.d.ts +17 -4
  34. package/dist/utils/authRedirect.js +39 -20
  35. package/dist/utils/authRedirect.js.map +1 -1
  36. package/dist/utils/createMarsunRequest.d.ts +2 -0
  37. package/dist/utils/createMarsunRequest.js +20 -18
  38. package/dist/utils/createMarsunRequest.js.map +1 -1
  39. package/package.json +4 -1
@@ -0,0 +1,47 @@
1
+ import { FormModalProps, FormProps, FormStepsModalProps, FormStepsProps, ListProps, MultiFieldProps, TableListProps, FormInfoProps } from '@kne/form-info';
2
+ import { ComponentType, FC, ReactNode } from 'react';
3
+ type FieldProps = {
4
+ name: string;
5
+ label?: ReactNode;
6
+ rule?: string;
7
+ placeholder?: string;
8
+ disabled?: boolean;
9
+ block?: boolean;
10
+ rows?: number;
11
+ options?: unknown[];
12
+ [key: string]: unknown;
13
+ };
14
+ type ButtonProps = {
15
+ children?: ReactNode;
16
+ type?: string;
17
+ loading?: boolean;
18
+ [key: string]: unknown;
19
+ };
20
+ type ItemTitleCtx = {
21
+ index: number;
22
+ data?: Record<string, unknown>;
23
+ };
24
+ export type { FormInfoProps, FormProps, FormModalProps, FormStepsProps, FormStepsModalProps, ListProps, TableListProps, MultiFieldProps, };
25
+ export declare const FormInfo: FC<FormInfoProps>;
26
+ export declare const Form: FC<FormProps>;
27
+ export declare const FormModal: FC<FormModalProps & {
28
+ children?: ReactNode;
29
+ }>;
30
+ export declare const FormSteps: FC<FormStepsProps>;
31
+ export declare const FormStepsModal: FC<FormStepsModalProps>;
32
+ export declare const List: FC<Omit<ListProps, "itemTitle"> & {
33
+ maxLength?: number;
34
+ itemTitle?: (ctx: ItemTitleCtx) => string;
35
+ }>;
36
+ export declare const TableList: FC<Omit<TableListProps, "itemTitle"> & {
37
+ itemTitle?: (ctx: ItemTitleCtx) => string;
38
+ }>;
39
+ export declare const MultiField: FC<MultiFieldProps>;
40
+ export declare const Input: ComponentType<FieldProps>;
41
+ export declare const TextArea: ComponentType<FieldProps>;
42
+ export declare const Select: ComponentType<FieldProps>;
43
+ export declare const InputNumber: ComponentType<FieldProps>;
44
+ export declare const Switch: ComponentType<FieldProps>;
45
+ export declare const SubmitButton: ComponentType<ButtonProps>;
46
+ export declare const ResetButton: ComponentType<ButtonProps>;
47
+ export declare const CancelButton: ComponentType<ButtonProps>;
@@ -0,0 +1,23 @@
1
+ /* empty css */
2
+ import t, { Form as o, FormModal as s, FormSteps as e, FormStepsModal as n, List as a, MultiField as r, TableList as c } from "@kne/form-info";
3
+ import { CancelButton as m, Input as u, InputNumber as i, ResetButton as l, Select as F, SubmitButton as p, Switch as S, TextArea as $ } from "@kne/react-form-antd";
4
+ const M = t, I = o, L = s, T = e, f = n, x = a, h = c, w = r, A = u, C = $, N = F, R = i, g = S, j = p, k = l, q = m;
5
+ export {
6
+ q as CancelButton,
7
+ I as Form,
8
+ M as FormInfo,
9
+ L as FormModal,
10
+ T as FormSteps,
11
+ f as FormStepsModal,
12
+ A as Input,
13
+ R as InputNumber,
14
+ x as List,
15
+ w as MultiField,
16
+ k as ResetButton,
17
+ N as Select,
18
+ j as SubmitButton,
19
+ g as Switch,
20
+ h as TableList,
21
+ C as TextArea
22
+ };
23
+ //# sourceMappingURL=kneFormInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kneFormInfo.js","sources":["../../../src/components/Form/kneFormInfo.ts"],"sourcesContent":["/**\n * 经 core 再导出 @kne/form-info(业务唯一入口)。\n * 布局组件来自 @kne/form-info;字段组件须从 @kne/react-form-antd 具名导入\n * (form-info 的 `export *` 在 Vite 下经 namespace 读取时常为 undefined)。\n */\nimport '@kne/form-info/dist/index.css';\nimport FormInfoBase, {\n Form as KneForm,\n FormModal as KneFormModal,\n FormSteps as KneFormSteps,\n FormStepsModal as KneFormStepsModal,\n List as KneList,\n MultiField as KneMultiField,\n TableList as KneTableList,\n type FormModalProps,\n type FormProps,\n type FormStepsModalProps,\n type FormStepsProps,\n type ListProps,\n type MultiFieldProps,\n type TableListProps,\n type FormInfoProps,\n} from '@kne/form-info';\nimport {\n CancelButton as KneCancelButton,\n Input as KneInput,\n InputNumber as KneInputNumber,\n ResetButton as KneResetButton,\n Select as KneSelect,\n SubmitButton as KneSubmitButton,\n Switch as KneSwitch,\n TextArea as KneTextArea,\n} from '@kne/react-form-antd';\nimport type { ComponentType, FC, ReactNode } from 'react';\n\ntype FieldProps = {\n name: string;\n label?: ReactNode;\n rule?: string;\n placeholder?: string;\n disabled?: boolean;\n block?: boolean;\n rows?: number;\n options?: unknown[];\n [key: string]: unknown;\n};\n\ntype ButtonProps = {\n children?: ReactNode;\n type?: string;\n loading?: boolean;\n [key: string]: unknown;\n};\n\ntype ItemTitleCtx = { index: number; data?: Record<string, unknown> };\n\nexport type {\n FormInfoProps,\n FormProps,\n FormModalProps,\n FormStepsProps,\n FormStepsModalProps,\n ListProps,\n TableListProps,\n MultiFieldProps,\n};\n\nexport const FormInfo = FormInfoBase;\nexport const Form = KneForm;\nexport const FormModal = KneFormModal as FC<FormModalProps & { children?: ReactNode }>;\nexport const FormSteps = KneFormSteps as FC<FormStepsProps>;\nexport const FormStepsModal = KneFormStepsModal as FC<FormStepsModalProps>;\n\nexport const List = KneList as FC<\n Omit<ListProps, 'itemTitle'> & {\n maxLength?: number;\n itemTitle?: (ctx: ItemTitleCtx) => string;\n }\n>;\nexport const TableList = KneTableList as FC<\n Omit<TableListProps, 'itemTitle'> & {\n itemTitle?: (ctx: ItemTitleCtx) => string;\n }\n>;\nexport const MultiField = KneMultiField as FC<MultiFieldProps>;\n\nexport const Input = KneInput as ComponentType<FieldProps>;\nexport const TextArea = KneTextArea as ComponentType<FieldProps>;\nexport const Select = KneSelect as ComponentType<FieldProps>;\nexport const InputNumber = KneInputNumber as ComponentType<FieldProps>;\nexport const Switch = KneSwitch as ComponentType<FieldProps>;\nexport const SubmitButton = KneSubmitButton as ComponentType<ButtonProps>;\nexport const ResetButton = KneResetButton as ComponentType<ButtonProps>;\nexport const CancelButton = KneCancelButton as ComponentType<ButtonProps>;\n"],"names":["FormInfo","FormInfoBase","Form","KneForm","FormModal","KneFormModal","FormSteps","KneFormSteps","FormStepsModal","KneFormStepsModal","List","KneList","TableList","KneTableList","MultiField","KneMultiField","Input","KneInput","TextArea","KneTextArea","Select","KneSelect","InputNumber","KneInputNumber","Switch","KneSwitch","SubmitButton","KneSubmitButton","ResetButton","KneResetButton","CancelButton","KneCancelButton"],"mappings":";;;AAmEO,MAAMA,IAAWC,GACXC,IAAOC,GACPC,IAAYC,GACZC,IAAYC,GACZC,IAAiBC,GAEjBC,IAAOC,GAMPC,IAAYC,GAKZC,IAAaC,GAEbC,IAAQC,GACRC,IAAWC,GACXC,IAASC,GACTC,IAAcC,GACdC,IAASC,GACTC,IAAeC,GACfC,IAAcC,GACdC,IAAeC;"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 经 core 再导出 @kne/react-form 引擎 API。
3
+ * 默认组件命名为 ReactForm,避免与 form-info 的 Form 冲突。
4
+ * 业务禁止直连 @kne/react-form。
5
+ */
6
+ export { default as ReactForm } from '@kne/react-form';
7
+ export { GroupList, useField, useFormApi, useFormContext, useGroup, useSubmit, useReset, RULES, preset, interceptors, compileErrMsg, computedFieldValueFromFormData, computedFormDataFormState, filterEmpty, findField, formUtils, isEmpty, isNotEmpty, matchFields, stateToError, stateToIsPass, } from '@kne/react-form';
8
+ export type { GroupListRenderProps } from '@kne/react-form';
@@ -1,8 +1,8 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { Spin as o } from "antd";
3
- import a from "classnames";
4
- import e from "./style.module.scss.js";
5
- const n = ({ spinning: p, children: r, className: s }) => /* @__PURE__ */ m(o, { spinning: p, wrapperClassName: a(e["page-spin"], s), children: r });
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { Spin as p } from "antd";
3
+ import t from "classnames";
4
+ import a from "./style.module.scss.js";
5
+ const n = ({ spinning: o, children: s, className: m }) => /* @__PURE__ */ r(p, { spinning: o, classNames: { root: t(a["page-spin"], m) }, children: s });
6
6
  export {
7
7
  n as default
8
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/Layout/PageSpin/index.tsx"],"sourcesContent":["import { Spin } from 'antd';\nimport classNames from 'classnames';\nimport type { ReactNode } from 'react';\nimport styles from './style.module.scss';\n\nexport type PageSpinProps = {\n spinning: boolean;\n children: ReactNode;\n className?: string;\n};\n\n/** 模块页 body 区整页 Spin:参与 flex 高度链,遮罩 Filter + 主工作区 */\nconst PageSpin: React.FC<PageSpinProps> = ({ spinning, children, className }) => (\n <Spin spinning={spinning} wrapperClassName={classNames(styles['page-spin'], className)}>\n {children}\n </Spin>\n);\n\nexport default PageSpin;\n"],"names":["PageSpin","spinning","children","className","jsx","Spin","classNames","styles"],"mappings":";;;;AAYA,MAAMA,IAAoC,CAAC,EAAE,UAAAC,GAAU,UAAAC,GAAU,WAAAC,QAC/D,gBAAAC,EAACC,GAAA,EAAK,UAAAJ,GAAoB,kBAAkBK,EAAWC,EAAO,WAAW,GAAGJ,CAAS,GAClF,UAAAD,EAAA,CACH;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/Layout/PageSpin/index.tsx"],"sourcesContent":["import { Spin } from 'antd';\nimport classNames from 'classnames';\nimport type { ReactNode } from 'react';\nimport styles from './style.module.scss';\n\nexport type PageSpinProps = {\n spinning: boolean;\n children: ReactNode;\n className?: string;\n};\n\n/** 模块页 body 区整页 Spin:参与 flex 高度链,遮罩 Filter + 主工作区 */\nconst PageSpin: React.FC<PageSpinProps> = ({ spinning, children, className }) => (\n <Spin spinning={spinning} classNames={{ root: classNames(styles['page-spin'], className) }}>\n {children}\n </Spin>\n);\n\nexport default PageSpin;\n"],"names":["PageSpin","spinning","children","className","Spin","classNames","styles"],"mappings":";;;;AAYA,MAAMA,IAAoC,CAAC,EAAE,UAAAC,GAAU,UAAAC,GAAU,WAAAC,0BAC9DC,GAAA,EAAK,UAAAH,GAAoB,YAAY,EAAE,MAAMI,EAAWC,EAAO,WAAW,GAAGH,CAAS,EAAA,GACpF,UAAAD,EAAA,CACH;"}
@@ -0,0 +1,8 @@
1
+ import { TableProps as AntTableProps } from 'antd';
2
+ export type TableProps<RecordType extends object = Record<string, unknown>> = AntTableProps<RecordType>;
3
+ /**
4
+ * 基于 antd Table 的列表表格包装。
5
+ * 默认:横向滚动 max-content、受控分页 showSizeChanger + showTotal、空态 Empty。
6
+ */
7
+ declare function Table<RecordType extends object = Record<string, unknown>>({ className, scroll, pagination, locale, ...rest }: TableProps<RecordType>): import("react").JSX.Element;
8
+ export default Table;
@@ -0,0 +1,39 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { Table as n } from "antd";
3
+ import c from "classnames";
4
+ import f from "./style.module.scss.js";
5
+ import i from "../Empty/Empty.js";
6
+ const p = { x: "max-content" };
7
+ function u(o) {
8
+ return `共 ${o} 项`;
9
+ }
10
+ function h({
11
+ className: o,
12
+ scroll: t,
13
+ pagination: e,
14
+ locale: a,
15
+ ...s
16
+ }) {
17
+ const m = e === !1 ? !1 : {
18
+ showSizeChanger: !0,
19
+ showTotal: u,
20
+ ...e && typeof e == "object" ? e : {}
21
+ }, l = {
22
+ emptyText: /* @__PURE__ */ r(i, { iconType: "simple", description: "暂无数据" }),
23
+ ...a
24
+ };
25
+ return /* @__PURE__ */ r(
26
+ n,
27
+ {
28
+ className: c("marsun-table", f["marsun-table"], o),
29
+ scroll: t === void 0 ? p : t,
30
+ pagination: m,
31
+ locale: l,
32
+ ...s
33
+ }
34
+ );
35
+ }
36
+ export {
37
+ h as default
38
+ };
39
+ //# sourceMappingURL=Table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Table.js","sources":["../../../src/components/Table/Table.tsx"],"sourcesContent":["import { Table as AntTable } from 'antd';\nimport type { TableProps as AntTableProps } from 'antd';\nimport classNames from 'classnames';\nimport { Empty } from '../Empty';\nimport styles from './style.module.scss';\n\nexport type TableProps<RecordType extends object = Record<string, unknown>> =\n AntTableProps<RecordType>;\n\nconst DEFAULT_SCROLL = { x: 'max-content' as const };\n\nfunction defaultShowTotal(total: number): string {\n return `共 ${total} 项`;\n}\n\n/**\n * 基于 antd Table 的列表表格包装。\n * 默认:横向滚动 max-content、受控分页 showSizeChanger + showTotal、空态 Empty。\n */\nfunction Table<RecordType extends object = Record<string, unknown>>({\n className,\n scroll,\n pagination,\n locale,\n ...rest\n}: TableProps<RecordType>) {\n const mergedPagination =\n pagination === false\n ? false\n : {\n showSizeChanger: true,\n showTotal: defaultShowTotal,\n ...(pagination && typeof pagination === 'object' ? pagination : {}),\n };\n\n const mergedLocale = {\n emptyText: <Empty iconType=\"simple\" description=\"暂无数据\" />,\n ...locale,\n };\n\n return (\n <AntTable<RecordType>\n className={classNames('marsun-table', styles['marsun-table'], className)}\n scroll={scroll === undefined ? DEFAULT_SCROLL : scroll}\n pagination={mergedPagination}\n locale={mergedLocale}\n {...rest}\n />\n );\n}\n\nexport default Table;\n"],"names":["DEFAULT_SCROLL","defaultShowTotal","total","Table","className","scroll","pagination","locale","rest","mergedPagination","mergedLocale","jsx","Empty","AntTable","classNames","styles"],"mappings":";;;;;AASA,MAAMA,IAAiB,EAAE,GAAG,cAAA;AAE5B,SAASC,EAAiBC,GAAuB;AAC/C,SAAO,KAAKA,CAAK;AACnB;AAMA,SAASC,EAA2D;AAAA,EAClE,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,YAAAC;AAAA,EACA,QAAAC;AAAA,EACA,GAAGC;AACL,GAA2B;AACzB,QAAMC,IACJH,MAAe,KACX,KACA;AAAA,IACE,iBAAiB;AAAA,IACjB,WAAWL;AAAA,IACX,GAAIK,KAAc,OAAOA,KAAe,WAAWA,IAAa,CAAA;AAAA,EAAC,GAGnEI,IAAe;AAAA,IACnB,WAAW,gBAAAC,EAACC,GAAA,EAAM,UAAS,UAAS,aAAY,QAAO;AAAA,IACvD,GAAGL;AAAA,EAAA;AAGL,SACE,gBAAAI;AAAA,IAACE;AAAAA,IAAA;AAAA,MACC,WAAWC,EAAW,gBAAgBC,EAAO,cAAc,GAAGX,CAAS;AAAA,MACvE,QAAQC,MAAW,SAAYL,IAAiBK;AAAA,MAChD,YAAYI;AAAA,MACZ,QAAQC;AAAA,MACP,GAAGF;AAAA,IAAA;AAAA,EAAA;AAGV;"}
@@ -0,0 +1,2 @@
1
+ export { default as Table } from './Table';
2
+ export type { TableProps } from './Table';
@@ -0,0 +1,7 @@
1
+ const s = {
2
+ "marsun-table": "_marsun-table_b8nes_1"
3
+ };
4
+ export {
5
+ s as default
6
+ };
7
+ //# sourceMappingURL=style.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -7,6 +7,7 @@ export * from './Form';
7
7
  export * from './Layout';
8
8
  export * from './Modal';
9
9
  export * from './Stat';
10
+ export * from './Table';
10
11
  export * from './Tag';
11
12
  export * from './TooltipInfo';
12
13
  export * from './Tour';
package/dist/index.d.ts CHANGED
@@ -7,7 +7,8 @@ export { resolveMaybeFn, resolveVisible, type MaybeFn, type Visibility, } from '
7
7
  export { formatFileSize } from './utils/format';
8
8
  export { toDateRange, toDateTimeRange, toApiStartEnd, recentDayRange, recentYearRange, recentDayRangeStrings, } from './utils/date';
9
9
  export { formatPickerValue, parsePickerValue, isValidPickerValue, type DatePickerGranularity, } from './utils/pickerDate';
10
- export { REDIRECT_URL_PARAM, resolveRedirectUrl, buildLocationRedirectUrl, buildLoginPath, readRedirectUrlFromSearch, } from './utils/authRedirect';
10
+ export { REDIRECT_URL_PARAM, resolveRedirectUrl, buildLocationRedirectUrl, buildAbsoluteLocationRedirectUrl, buildLoginPath, readRedirectUrlFromSearch, } from './utils/authRedirect';
11
+ export type { BuildLoginPathOptions } from './utils/authRedirect';
11
12
  export { DEFAULT_LAST_ACTIVITY_STORAGE_KEY, getLastActivityTime, touchLastActivity, clearLastActivity, } from './utils/sessionActivity';
12
13
  export { USER_ROLE_PERMISSIONS_KEY, PERMISSION_DEFINITIONS_KEY, PERMISSIONS_STORAGE_KEY, loadUserRolePermissions, saveUserRolePermissions, loadPermissionDefinitions, savePermissionDefinitions, getStoredUserPermissions, getStoredPermissionMap, } from './utils/permissionStorage';
13
14
  export { createMarsunRequest } from './utils/createMarsunRequest';
@@ -29,6 +30,7 @@ export * from './components/Form';
29
30
  export * from './components/Layout';
30
31
  export * from './components/Modal';
31
32
  export * from './components/Stat';
33
+ export * from './components/Table';
32
34
  export * from './components/Tag';
33
35
  export * from './components/TooltipInfo';
34
36
  export * from './components/Tour';