@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
package/dist/utils/date.d.ts
CHANGED
|
@@ -3,7 +3,10 @@ import { Dayjs } from 'dayjs';
|
|
|
3
3
|
export declare function toDateRange(range: [string, string] | null): [string, string] | null;
|
|
4
4
|
/** 将日期范围转为带时分秒的起止时间(YYYY-MM-DD HH:mm:ss) */
|
|
5
5
|
export declare function toDateTimeRange(range: [string, string] | null): [string, string] | null;
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* UI 日期 → API start/end(`YYYY-MM-DD HH:mm:ss` 日界)。
|
|
8
|
+
* `YYYY-MM` 展开为该月 1 日 00:00:00 / 月末 23:59:59(预警月、timeDuration 常用)。
|
|
9
|
+
*/
|
|
7
10
|
export declare function toApiStartEnd(start: string, end: string): {
|
|
8
11
|
start: string;
|
|
9
12
|
end: string;
|
package/dist/utils/date.js
CHANGED
|
@@ -1,44 +1,52 @@
|
|
|
1
|
-
import
|
|
2
|
-
function
|
|
1
|
+
import e from "dayjs";
|
|
2
|
+
function D(t) {
|
|
3
3
|
return t ? [t[0], t[1]] : null;
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function f(t) {
|
|
6
6
|
return t ? [`${t[0]} 00:00:00`, `${t[1]} 23:59:59`] : null;
|
|
7
7
|
}
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
const r = t
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
const s = /^\d{4}-\d{2}-\d{2}$/, i = /^\d{4}-\d{2}$/;
|
|
9
|
+
function c(t, n) {
|
|
10
|
+
const r = String(t || "").trim();
|
|
11
|
+
if (i.test(r)) {
|
|
12
|
+
const a = e(`${r}-01`);
|
|
13
|
+
return n === "start" ? a.startOf("month").format("YYYY-MM-DD") : a.endOf("month").format("YYYY-MM-DD");
|
|
14
|
+
}
|
|
15
|
+
return r.slice(0, 10);
|
|
16
|
+
}
|
|
17
|
+
function m(t, n) {
|
|
18
|
+
const r = c(t, "start"), a = c(n, "end"), o = f([r, a]);
|
|
19
|
+
return o ? {
|
|
20
|
+
start: s.test(r) ? o[0] : t,
|
|
21
|
+
end: s.test(a) ? o[1] : n
|
|
14
22
|
} : { start: t, end: n };
|
|
15
23
|
}
|
|
16
|
-
function
|
|
17
|
-
const n =
|
|
18
|
-
return [
|
|
24
|
+
function u(t) {
|
|
25
|
+
const n = e().endOf("day");
|
|
26
|
+
return [e().subtract(t, "month").add(1, "day").startOf("day"), n];
|
|
19
27
|
}
|
|
20
|
-
function
|
|
21
|
-
const t =
|
|
22
|
-
return [
|
|
28
|
+
function d() {
|
|
29
|
+
const t = e().endOf("day");
|
|
30
|
+
return [e().subtract(1, "year").add(1, "day").startOf("day"), t];
|
|
23
31
|
}
|
|
24
|
-
function
|
|
25
|
-
const [n, r] = t === "1y" ?
|
|
32
|
+
function y(t) {
|
|
33
|
+
const [n, r] = t === "1y" ? d() : u(t);
|
|
26
34
|
return [n.format("YYYY-MM-DD"), r.format("YYYY-MM-DD")];
|
|
27
35
|
}
|
|
28
|
-
function
|
|
36
|
+
function M(t, n = "—") {
|
|
29
37
|
if (t == null) return n;
|
|
30
38
|
const r = String(t).trim();
|
|
31
39
|
if (!r) return n;
|
|
32
|
-
const
|
|
33
|
-
return
|
|
40
|
+
const a = e(r);
|
|
41
|
+
return a.isValid() ? a.format("YYYY-MM-DD HH:mm:ss") : r;
|
|
34
42
|
}
|
|
35
43
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
M as formatDateTimeDisplay,
|
|
45
|
+
u as recentDayRange,
|
|
46
|
+
y as recentDayRangeStrings,
|
|
47
|
+
d as recentYearRange,
|
|
48
|
+
m as toApiStartEnd,
|
|
49
|
+
D as toDateRange,
|
|
50
|
+
f as toDateTimeRange
|
|
43
51
|
};
|
|
44
52
|
//# sourceMappingURL=date.js.map
|
package/dist/utils/date.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.js","sources":["../../src/utils/date.ts"],"sourcesContent":["import dayjs, { type Dayjs } from 'dayjs';\n\n/** 将日期范围转为不带时分秒的起止时间(YYYY-MM-DD) */\nexport function toDateRange(range: [string, string] | null): [string, string] | null {\n if (!range) return null;\n return [range[0], range[1]];\n}\n\n/** 将日期范围转为带时分秒的起止时间(YYYY-MM-DD HH:mm:ss) */\nexport function toDateTimeRange(range: [string, string] | null): [string, string] | null {\n if (!range) return null;\n return [`${range[0]} 00:00:00`, `${range[1]} 23:59:59`];\n}\n\nconst DATE_ONLY = /^\\d{4}-\\d{2}-\\d{2}$/;\n\n/** UI 日期 → API start/end
|
|
1
|
+
{"version":3,"file":"date.js","sources":["../../src/utils/date.ts"],"sourcesContent":["import dayjs, { type Dayjs } from 'dayjs';\n\n/** 将日期范围转为不带时分秒的起止时间(YYYY-MM-DD) */\nexport function toDateRange(range: [string, string] | null): [string, string] | null {\n if (!range) return null;\n return [range[0], range[1]];\n}\n\n/** 将日期范围转为带时分秒的起止时间(YYYY-MM-DD HH:mm:ss) */\nexport function toDateTimeRange(range: [string, string] | null): [string, string] | null {\n if (!range) return null;\n return [`${range[0]} 00:00:00`, `${range[1]} 23:59:59`];\n}\n\nconst DATE_ONLY = /^\\d{4}-\\d{2}-\\d{2}$/;\nconst MONTH_ONLY = /^\\d{4}-\\d{2}$/;\n\n/** YYYY-MM → 月初/月末日;其余取前 10 位(YYYY-MM-DD 或已带时分秒) */\nfunction toDayBound(value: string, bound: 'start' | 'end'): string {\n const raw = String(value || '').trim();\n if (MONTH_ONLY.test(raw)) {\n const month = dayjs(`${raw}-01`);\n return bound === 'start'\n ? month.startOf('month').format('YYYY-MM-DD')\n : month.endOf('month').format('YYYY-MM-DD');\n }\n return raw.slice(0, 10);\n}\n\n/**\n * UI 日期 → API start/end(`YYYY-MM-DD HH:mm:ss` 日界)。\n * `YYYY-MM` 展开为该月 1 日 00:00:00 / 月末 23:59:59(预警月、timeDuration 常用)。\n */\nexport function toApiStartEnd(start: string, end: string): { start: string; end: string } {\n const startDay = toDayBound(start, 'start');\n const endDay = toDayBound(end, 'end');\n const range = toDateTimeRange([startDay, endDay]);\n if (!range) return { start, end };\n return {\n start: DATE_ONLY.test(startDay) ? range[0] : start,\n end: DATE_ONLY.test(endDay) ? range[1] : end,\n };\n}\n\n/** 从今天往前推 months 个月(含今天;起始日为 N 月前同日 +1 天) */\nexport function recentDayRange(months: number): [Dayjs, Dayjs] {\n const end = dayjs().endOf('day');\n const start = dayjs().subtract(months, 'month').add(1, 'day').startOf('day');\n return [start, end];\n}\n\n/** 从今天往前推 1 年(含今天;起始日为 1 年前同日 +1 天) */\nexport function recentYearRange(): [Dayjs, Dayjs] {\n const end = dayjs().endOf('day');\n const start = dayjs().subtract(1, 'year').add(1, 'day').startOf('day');\n return [start, end];\n}\n\n/** 近 N 月 / 近1年 → YYYY-MM-DD(供 FilterDateRange UI) */\nexport function recentDayRangeStrings(span: number | '1y'): [string, string] {\n const [start, end] = span === '1y' ? recentYearRange() : recentDayRange(span);\n return [start.format('YYYY-MM-DD'), end.format('YYYY-MM-DD')];\n}\n\n/**\n * 展示用日期时间:统一为 `YYYY-MM-DD HH:mm:ss`。\n * 非法 / 空串回退原文或 `—`。\n */\nexport function formatDateTimeDisplay(value?: string | null, empty = '—'): string {\n if (value == null) return empty;\n const raw = String(value).trim();\n if (!raw) return empty;\n const parsed = dayjs(raw);\n if (!parsed.isValid()) return raw;\n return parsed.format('YYYY-MM-DD HH:mm:ss');\n}\n"],"names":["toDateRange","range","toDateTimeRange","DATE_ONLY","MONTH_ONLY","toDayBound","value","bound","raw","month","dayjs","toApiStartEnd","start","end","startDay","endDay","recentDayRange","months","recentYearRange","recentDayRangeStrings","span","formatDateTimeDisplay","empty","parsed"],"mappings":";AAGO,SAASA,EAAYC,GAAyD;AACnF,SAAKA,IACE,CAACA,EAAM,CAAC,GAAGA,EAAM,CAAC,CAAC,IADP;AAErB;AAGO,SAASC,EAAgBD,GAAyD;AACvF,SAAKA,IACE,CAAC,GAAGA,EAAM,CAAC,CAAC,aAAa,GAAGA,EAAM,CAAC,CAAC,WAAW,IADnC;AAErB;AAEA,MAAME,IAAY,uBACZC,IAAa;AAGnB,SAASC,EAAWC,GAAeC,GAAgC;AACjE,QAAMC,IAAM,OAAOF,KAAS,EAAE,EAAE,KAAA;AAChC,MAAIF,EAAW,KAAKI,CAAG,GAAG;AACxB,UAAMC,IAAQC,EAAM,GAAGF,CAAG,KAAK;AAC/B,WAAOD,MAAU,UACbE,EAAM,QAAQ,OAAO,EAAE,OAAO,YAAY,IAC1CA,EAAM,MAAM,OAAO,EAAE,OAAO,YAAY;AAAA,EAC9C;AACA,SAAOD,EAAI,MAAM,GAAG,EAAE;AACxB;AAMO,SAASG,EAAcC,GAAeC,GAA6C;AACxF,QAAMC,IAAWT,EAAWO,GAAO,OAAO,GACpCG,IAASV,EAAWQ,GAAK,KAAK,GAC9BZ,IAAQC,EAAgB,CAACY,GAAUC,CAAM,CAAC;AAChD,SAAKd,IACE;AAAA,IACL,OAAOE,EAAU,KAAKW,CAAQ,IAAIb,EAAM,CAAC,IAAIW;AAAA,IAC7C,KAAKT,EAAU,KAAKY,CAAM,IAAId,EAAM,CAAC,IAAIY;AAAA,EAAA,IAHxB,EAAE,OAAAD,GAAO,KAAAC,EAAA;AAK9B;AAGO,SAASG,EAAeC,GAAgC;AAC7D,QAAMJ,IAAMH,IAAQ,MAAM,KAAK;AAE/B,SAAO,CADOA,IAAQ,SAASO,GAAQ,OAAO,EAAE,IAAI,GAAG,KAAK,EAAE,QAAQ,KAAK,GAC5DJ,CAAG;AACpB;AAGO,SAASK,IAAkC;AAChD,QAAML,IAAMH,IAAQ,MAAM,KAAK;AAE/B,SAAO,CADOA,IAAQ,SAAS,GAAG,MAAM,EAAE,IAAI,GAAG,KAAK,EAAE,QAAQ,KAAK,GACtDG,CAAG;AACpB;AAGO,SAASM,EAAsBC,GAAuC;AAC3E,QAAM,CAACR,GAAOC,CAAG,IAAIO,MAAS,OAAOF,EAAA,IAAoBF,EAAeI,CAAI;AAC5E,SAAO,CAACR,EAAM,OAAO,YAAY,GAAGC,EAAI,OAAO,YAAY,CAAC;AAC9D;AAMO,SAASQ,EAAsBf,GAAuBgB,IAAQ,KAAa;AAChF,MAAIhB,KAAS,KAAM,QAAOgB;AAC1B,QAAMd,IAAM,OAAOF,CAAK,EAAE,KAAA;AAC1B,MAAI,CAACE,EAAK,QAAOc;AACjB,QAAMC,IAASb,EAAMF,CAAG;AACxB,SAAKe,EAAO,QAAA,IACLA,EAAO,OAAO,qBAAqB,IADZf;AAEhC;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hkyhy/marsun-components-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.72",
|
|
4
4
|
"description": "Marsun pure UI component library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -40,6 +40,14 @@
|
|
|
40
40
|
"./llm": {
|
|
41
41
|
"import": "./dist/llm.js",
|
|
42
42
|
"types": "./dist/llm.d.ts"
|
|
43
|
+
},
|
|
44
|
+
"./form-info": {
|
|
45
|
+
"import": "./dist/form-info.js",
|
|
46
|
+
"types": "./dist/form-info.d.ts"
|
|
47
|
+
},
|
|
48
|
+
"./iam": {
|
|
49
|
+
"import": "./dist/iam.js",
|
|
50
|
+
"types": "./dist/iam.d.ts"
|
|
43
51
|
}
|
|
44
52
|
},
|
|
45
53
|
"sideEffects": [
|
|
@@ -88,25 +96,35 @@
|
|
|
88
96
|
"react-router-dom": "^6.28.0 || ^7.0.0"
|
|
89
97
|
},
|
|
90
98
|
"dependencies": {
|
|
99
|
+
"@ant-design/icons": "^5.6.1",
|
|
91
100
|
"@js-preview/excel": "^1.7.14",
|
|
92
101
|
"@kne/button-group": "^0.1.24",
|
|
93
102
|
"@kne/form-info": "^0.1.10",
|
|
103
|
+
"@kne/is-empty": "^1.1.0",
|
|
94
104
|
"@kne/overflow-items": "^0.1.0",
|
|
105
|
+
"@kne/react-fetch": "^1.5.7",
|
|
95
106
|
"@kne/react-form": "^3.1.9",
|
|
96
107
|
"@kne/react-form-antd": "^4.1.2",
|
|
108
|
+
"@kne/react-form-plus": "^0.1.7",
|
|
109
|
+
"@kne/responsive-utils": "^0.1.13",
|
|
97
110
|
"@kne/super-select": "^0.1.46",
|
|
98
111
|
"@kne/super-select-plus": "^0.1.3",
|
|
112
|
+
"@kne/table-view": "^0.1.17",
|
|
113
|
+
"@kne/use-resize": "^0.1.1",
|
|
99
114
|
"ahooks": "^3.8.1",
|
|
100
115
|
"classnames": "^2.5.1",
|
|
101
116
|
"dayjs": "^1.11.0",
|
|
102
117
|
"docx-preview": "^0.3.7",
|
|
103
118
|
"jszip": "^3.10.1",
|
|
119
|
+
"lodash": "^4.17.21",
|
|
104
120
|
"lucide-react": "^1.18.0",
|
|
105
121
|
"mermaid": "^11.15.0",
|
|
106
122
|
"pptx-preview": "^1.0.7",
|
|
107
123
|
"prism-react-renderer": "^2.4.1",
|
|
108
124
|
"react-markdown": "^10.1.0",
|
|
109
|
-
"remark-gfm": "^4.0.1"
|
|
125
|
+
"remark-gfm": "^4.0.1",
|
|
126
|
+
"simplebar": "^6.3.3",
|
|
127
|
+
"simplebar-react": "^3.3.2"
|
|
110
128
|
},
|
|
111
129
|
"devDependencies": {
|
|
112
130
|
"@eslint/js": "^9.14.0",
|