@hkyhy/marsun-components-core 0.1.24 → 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.
- package/dist/components/Filter/FilterSelect/index.d.ts +4 -2
- package/dist/components/Filter/FilterSelect/index.js +253 -157
- package/dist/components/Filter/FilterSelect/index.js.map +1 -1
- package/dist/components/Filter/FilterSelect/style.module.scss.js +14 -12
- package/dist/components/Filter/FilterSelect/style.module.scss.js.map +1 -1
- package/dist/components/Table/Table.d.ts +8 -0
- package/dist/components/Table/Table.js +39 -0
- package/dist/components/Table/Table.js.map +1 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/Table/style.module.scss.js +7 -0
- package/dist/components/Table/style.module.scss.js.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +408 -405
- 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/authRedirect.d.ts +17 -4
- package/dist/utils/authRedirect.js +39 -20
- package/dist/utils/authRedirect.js.map +1 -1
- package/dist/utils/createMarsunRequest.d.ts +2 -0
- package/dist/utils/createMarsunRequest.js +20 -18
- package/dist/utils/createMarsunRequest.js.map +1 -1
- package/package.json +1 -1
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
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';
|