@pisell/materials 1.0.1042 → 1.0.1044
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +5 -5
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +5 -5
- package/es/components/Pagination/index.js +37 -23
- package/es/components/PisellCards/index.d.ts +6 -6
- package/es/components/calendar/index.d.ts +2 -2
- package/es/components/checkbox/index.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Input.Password/index.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Input.TextArea/index.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Switch/index.d.ts +2 -2
- package/es/components/date-picker/index.d.ts +2 -2
- package/es/components/filter/components/FilterButton/index.js +10 -4
- package/es/components/filter/components/FilterButton/types.d.ts +2 -1
- package/es/components/input/index.d.ts +2 -2
- package/es/components/pisell-config-provider/context.d.ts +2 -2
- package/es/components/pisellBatchActionBar/PisellBatchActionBar.js +26 -21
- package/es/components/pisellDatePicker/index.d.ts +2 -2
- package/es/components/pisellDateTimeDisplay/PisellDateTimeDisplay.less +2 -1
- package/es/components/pisellDateTimeDisplay/formats/dateTimeDisplayFormats.js +5 -5
- package/es/components/pisellDateTimeDisplay/utils/localeUtils.js +6 -2
- package/es/components/pisellFind/index.js +2 -1
- package/es/components/pisellGridPro/ToolBar/index.less +23 -0
- package/es/components/pisellModal/index.d.ts +6 -6
- package/es/components/pisellRecordBoard/docs/PisellRecordBoard.md +58 -0
- package/es/components/pisellRecordBoard/docs/ShellFrame.md +1 -1
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.js +25 -13
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.less +14 -0
- package/es/components/pisellRecordBoard/shellFrame/Pagination/index.js +1 -0
- package/es/components/pisellRecordBoard/shellFrame/Pagination/index.less +12 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/ToolBarFilter.less +35 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.js +39 -7
- package/es/components/pisellRecordBoard/shellFrame/ToolBarReset/index.js +6 -1
- package/es/components/pisellRecordBoard/types.d.ts +2 -1
- package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.js +1 -1
- package/es/components/radio/index.d.ts +2 -2
- package/es/components/section-footers/index.d.ts +2 -2
- package/es/components/skeleton/index.d.ts +2 -2
- package/es/components/time-picker/index.d.ts +2 -2
- package/es/components/typography/index.d.ts +2 -2
- package/es/components/upload/index.d.ts +2 -2
- package/es/locales/zh-CN.js +2 -2
- package/es/locales/zh-TW.js +2 -2
- package/lib/components/Pagination/index.js +37 -23
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Input.Email/index.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Input.Url/index.d.ts +2 -2
- package/lib/components/date-picker/index.d.ts +2 -2
- package/lib/components/filter/components/FilterButton/index.js +8 -2
- package/lib/components/filter/components/FilterButton/types.d.ts +2 -1
- package/lib/components/pisellBatchActionBar/PisellBatchActionBar.js +26 -21
- package/lib/components/pisellDateTimeDisplay/PisellDateTimeDisplay.less +2 -1
- package/lib/components/pisellDateTimeDisplay/formats/dateTimeDisplayFormats.js +5 -5
- package/lib/components/pisellDateTimeDisplay/utils/localeUtils.js +7 -2
- package/lib/components/pisellFind/index.js +2 -1
- package/lib/components/pisellGridPro/ToolBar/index.less +23 -0
- package/lib/components/pisellRecordBoard/docs/PisellRecordBoard.md +58 -0
- package/lib/components/pisellRecordBoard/docs/ShellFrame.md +1 -1
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.js +25 -13
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.less +14 -0
- package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.js +1 -0
- package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.less +12 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/ToolBarFilter.less +35 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.js +39 -7
- package/lib/components/pisellRecordBoard/shellFrame/ToolBarReset/index.js +6 -1
- package/lib/components/pisellRecordBoard/types.d.ts +2 -1
- package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.js +1 -1
- package/lib/components/skeleton/index.d.ts +2 -2
- package/lib/components/time-picker/index.d.ts +2 -2
- package/lib/components/upload/index.d.ts +2 -2
- package/lib/locales/zh-CN.js +2 -2
- package/lib/locales/zh-TW.js +2 -2
- package/package.json +4 -4
|
@@ -5,6 +5,7 @@ import useIsMobileTable_default from "../table/hooks/useIsMobileTable.js";
|
|
|
5
5
|
import { Pagination } from "antd";
|
|
6
6
|
import classNames from "classnames";
|
|
7
7
|
import React, { useEffect, useMemo, useState } from "react";
|
|
8
|
+
import { locales } from "@pisell/utils";
|
|
8
9
|
import ArrowRight from "@pisell/icon/es/ArrowRight";
|
|
9
10
|
import ArrowLeft from "@pisell/icon/es/ArrowLeft";
|
|
10
11
|
import "./index.less";
|
|
@@ -16,43 +17,53 @@ const _excluded = [
|
|
|
16
17
|
"page",
|
|
17
18
|
"pageSize"
|
|
18
19
|
];
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* @Date: 2023-07-20 17:01
|
|
25
|
-
*/
|
|
26
|
-
const itemRender = (_, type, originalElement) => {
|
|
27
|
-
if (type === "prev") return /* @__PURE__ */ React.createElement("div", { className: classNames("paginator-page-btn", "left") }, /* @__PURE__ */ React.createElement(ArrowLeft, { className: "paginator-page-btn-left-icon" }), /* @__PURE__ */ React.createElement("span", { className: "paginator-page-btn-text" }, getText("table-pagination-previous")));
|
|
28
|
-
if (type === "next") return /* @__PURE__ */ React.createElement("div", { className: classNames("paginator-page-btn", "right") }, /* @__PURE__ */ React.createElement("span", { className: "paginator-page-btn-text" }, getText("table-pagination-next")), /* @__PURE__ */ React.createElement(ArrowRight, { className: "paginator-page-btn-right-icon" }));
|
|
29
|
-
return originalElement;
|
|
30
|
-
};
|
|
31
|
-
const paginationConfig = {
|
|
32
|
-
className: "materials-grid-paginator",
|
|
33
|
-
defaultCurrent: 1,
|
|
34
|
-
showTotal: (total, range) => `Page ${range[0]} of ${range[1]}`,
|
|
35
|
-
itemRender,
|
|
36
|
-
responsive: true,
|
|
37
|
-
size: "small"
|
|
38
|
-
};
|
|
20
|
+
/** 优先 @pisell/utils locales(pisell2.salesManagement.pagination.*),无则回退 materials getText */
|
|
21
|
+
function getPaginationText(key) {
|
|
22
|
+
var _utilsLocales$getText;
|
|
23
|
+
return (_utilsLocales$getText = locales.getText(`pisell2.salesManagement.pagination.${key}`)) !== null && _utilsLocales$getText !== void 0 ? _utilsLocales$getText : getText(`table-pagination-${key}`);
|
|
24
|
+
}
|
|
39
25
|
const Pagination$1 = (props) => {
|
|
40
26
|
const show = useMemo(() => {
|
|
41
27
|
return Object.keys(props).length;
|
|
42
28
|
}, [props]);
|
|
43
29
|
const isMiniPagination = useIsMobileTable_default();
|
|
30
|
+
const effectiveConfig = useMemo(() => {
|
|
31
|
+
const prevText = getPaginationText("previous");
|
|
32
|
+
const nextText = getPaginationText("next");
|
|
33
|
+
const showTotalFn = getPaginationText("showTotal");
|
|
34
|
+
const itemRenderFn = (_, type, originalElement) => {
|
|
35
|
+
if (type === "prev") return /* @__PURE__ */ React.createElement("div", { className: classNames("paginator-page-btn", "left") }, /* @__PURE__ */ React.createElement(ArrowLeft, { className: "paginator-page-btn-left-icon" }), /* @__PURE__ */ React.createElement("span", { className: "paginator-page-btn-text" }, prevText));
|
|
36
|
+
if (type === "next") return /* @__PURE__ */ React.createElement("div", { className: classNames("paginator-page-btn", "right") }, /* @__PURE__ */ React.createElement("span", { className: "paginator-page-btn-text" }, nextText), /* @__PURE__ */ React.createElement(ArrowRight, { className: "paginator-page-btn-right-icon" }));
|
|
37
|
+
return originalElement;
|
|
38
|
+
};
|
|
39
|
+
return {
|
|
40
|
+
className: "materials-grid-paginator",
|
|
41
|
+
defaultCurrent: 1,
|
|
42
|
+
showTotal: typeof showTotalFn === "function" ? (total, range) => showTotalFn(range[0], range[1]) : (total, range) => `Page ${range[0]} of ${range[1]}`,
|
|
43
|
+
itemRender: itemRenderFn,
|
|
44
|
+
responsive: true,
|
|
45
|
+
size: "small"
|
|
46
|
+
};
|
|
47
|
+
}, []);
|
|
44
48
|
return useMemo(() => {
|
|
45
49
|
if (!show) return null;
|
|
46
50
|
let Com = Pagination;
|
|
47
51
|
if (isMiniPagination) Com = MiniPagination;
|
|
48
|
-
return /* @__PURE__ */ React.createElement(Com, _objectSpread2(_objectSpread2({},
|
|
52
|
+
return /* @__PURE__ */ React.createElement(Com, _objectSpread2(_objectSpread2({}, effectiveConfig), props));
|
|
49
53
|
}, [
|
|
50
54
|
show,
|
|
51
|
-
|
|
55
|
+
effectiveConfig,
|
|
52
56
|
props,
|
|
53
57
|
isMiniPagination
|
|
54
58
|
]);
|
|
55
59
|
};
|
|
60
|
+
const paginationConfig = {
|
|
61
|
+
className: "materials-grid-paginator",
|
|
62
|
+
defaultCurrent: 1,
|
|
63
|
+
showTotal: (total, range) => `Page ${range[0]} of ${range[1]}`,
|
|
64
|
+
responsive: true,
|
|
65
|
+
size: "small"
|
|
66
|
+
};
|
|
56
67
|
var Pagination_default = Pagination$1;
|
|
57
68
|
const MiniPagination = (props) => {
|
|
58
69
|
const { current = 1, pageSize = 10, total = 0 } = props;
|
|
@@ -82,7 +93,10 @@ const MiniPagination = (props) => {
|
|
|
82
93
|
if (current <= MIN) return;
|
|
83
94
|
onChange("prev");
|
|
84
95
|
}
|
|
85
|
-
}, /* @__PURE__ */ React.createElement("div", { className: classNames("paginator-page-btn", "left") }, /* @__PURE__ */ React.createElement(ArrowLeft, { className: "paginator-page-btn-left-icon" }))), /* @__PURE__ */ React.createElement("div", { className: "materials-grid-paginator-center" }, /* @__PURE__ */ React.createElement("span", { className: "materials-grid-paginator-center-text" },
|
|
96
|
+
}, /* @__PURE__ */ React.createElement("div", { className: classNames("paginator-page-btn", "left") }, /* @__PURE__ */ React.createElement(ArrowLeft, { className: "paginator-page-btn-left-icon" }))), /* @__PURE__ */ React.createElement("div", { className: "materials-grid-paginator-center" }, /* @__PURE__ */ React.createElement("span", { className: "materials-grid-paginator-center-text" }, (() => {
|
|
97
|
+
const totalFn = getPaginationText("total");
|
|
98
|
+
return typeof totalFn === "function" ? totalFn(current, MAX) : `${current} / ${MAX}`;
|
|
99
|
+
})())), /* @__PURE__ */ React.createElement("div", {
|
|
86
100
|
className: "pisell-lowcode-pagination-next",
|
|
87
101
|
onClick: () => {
|
|
88
102
|
if (current >= MAX) return;
|
|
@@ -7,15 +7,15 @@ import "./components/PisellImageCard/index.js";
|
|
|
7
7
|
import { BadgeConfig, TabCardProps } from "./components/TabCard/types.js";
|
|
8
8
|
import "./components/TextCard/types.js";
|
|
9
9
|
import { MultilevelCardProps } from "./components/MultilevelCard/types.js";
|
|
10
|
-
import * as
|
|
10
|
+
import * as react11 from "react";
|
|
11
11
|
|
|
12
12
|
//#region src/components/PisellCards/index.d.ts
|
|
13
13
|
declare const PisellCards: {
|
|
14
|
-
TabCard: (props: any) =>
|
|
15
|
-
TextCard: (props: any) =>
|
|
16
|
-
GraphicTextCard: (props: GraphicTextCardProps) =>
|
|
17
|
-
MultilevelCard: (props: any) =>
|
|
18
|
-
PisellImageCard: (props: PisellImageCardProps) =>
|
|
14
|
+
TabCard: (props: any) => react11.JSX.Element;
|
|
15
|
+
TextCard: (props: any) => react11.JSX.Element;
|
|
16
|
+
GraphicTextCard: (props: GraphicTextCardProps) => react11.JSX.Element;
|
|
17
|
+
MultilevelCard: (props: any) => react11.JSX.Element;
|
|
18
|
+
PisellImageCard: (props: PisellImageCardProps) => react11.JSX.Element;
|
|
19
19
|
};
|
|
20
20
|
//#endregion
|
|
21
21
|
export { PisellCards };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react0 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/calendar/index.d.ts
|
|
5
|
-
declare const Calendar: (props: any) =>
|
|
5
|
+
declare const Calendar: (props: any) => react0.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Calendar };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react1 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/checkbox/index.d.ts
|
|
5
|
-
declare const Checkbox: (props: any) =>
|
|
5
|
+
declare const Checkbox: (props: any) => react1.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Checkbox };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react0 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts
|
|
5
|
-
declare const DataSourceQRCode: (props: any) =>
|
|
5
|
+
declare const DataSourceQRCode: (props: any) => react0.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { DataSourceQRCode };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { WithFormItemProps, WithModeProps } from "../../dataSourceForm/utils.js";
|
|
2
2
|
import * as antd18 from "antd";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import * as
|
|
4
|
+
import * as antd_es_input4 from "antd/es/input";
|
|
5
5
|
|
|
6
6
|
//#region src/components/dataSourceComponents/fields/Input.Password/index.d.ts
|
|
7
|
-
declare const Password: React.FC<
|
|
7
|
+
declare const Password: React.FC<antd_es_input4.PasswordProps & React.RefAttributes<antd18.InputRef> & WithModeProps & WithFormItemProps>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Password };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { WithFormItemProps, WithModeProps } from "../../dataSourceForm/utils.js";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as antd_es_input3 from "antd/es/input";
|
|
4
4
|
import * as antd_es_input_TextArea0 from "antd/es/input/TextArea";
|
|
5
5
|
|
|
6
6
|
//#region src/components/dataSourceComponents/fields/Input.TextArea/index.d.ts
|
|
7
|
-
declare const TextArea: React.FC<
|
|
7
|
+
declare const TextArea: React.FC<antd_es_input3.TextAreaProps & React.RefAttributes<antd_es_input_TextArea0.TextAreaRef> & WithModeProps & WithFormItemProps>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { TextArea };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { WithFormItemProps, WithModeProps } from "../../dataSourceForm/utils.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as antd0 from "antd";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import * as antd_es_select0 from "antd/es/select";
|
|
5
5
|
|
|
6
6
|
//#region src/components/dataSourceComponents/fields/Select/index.d.ts
|
|
7
|
-
declare const SelectWithDataSource: (props:
|
|
7
|
+
declare const SelectWithDataSource: (props: antd0.SelectProps<any, antd_es_select0.DefaultOptionType> & WithModeProps & WithFormItemProps & {
|
|
8
8
|
options?: any;
|
|
9
9
|
optionSourceType?: "custom" | "default" | "api" | undefined;
|
|
10
10
|
labelField: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { WithFormItemProps, WithModeProps } from "../../dataSourceForm/utils.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as antd0 from "antd";
|
|
3
3
|
import React from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/dataSourceComponents/fields/Switch/index.d.ts
|
|
6
|
-
declare const Switch$1: React.FC<
|
|
6
|
+
declare const Switch$1: React.FC<antd0.SwitchProps & React.RefAttributes<HTMLElement> & WithModeProps & WithFormItemProps>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { Switch$1 as Switch };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react9 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/date-picker/index.d.ts
|
|
5
|
-
declare const DatePicker: (props: any) =>
|
|
5
|
+
declare const DatePicker: (props: any) => react9.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { DatePicker };
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.108.0/helpers/objectSpread2.js";
|
|
2
2
|
import { getText } from "../../../../locales/index.js";
|
|
3
3
|
import Dropdown_default from "../Dropdown/index.js";
|
|
4
|
-
import { isMobile } from "../../../../utils/platform.js";
|
|
4
|
+
import { isMobile as isMobile$1 } from "../../../../utils/platform.js";
|
|
5
5
|
import { Button, Popover } from "antd";
|
|
6
6
|
import React, { useMemo, useRef, useState } from "react";
|
|
7
|
+
import { locales } from "@pisell/utils";
|
|
7
8
|
import FilterLines from "@pisell/icon/es/FilterLines";
|
|
8
9
|
|
|
9
10
|
//#region src/components/filter/components/FilterButton/index.tsx
|
|
10
|
-
|
|
11
|
+
/** 与 Quick Filter 同源:优先 @pisell/utils locales,无 key 时回退 materials getText */
|
|
12
|
+
function getFilterButtonLabel(buttonText) {
|
|
13
|
+
if (buttonText != null && buttonText !== "") return buttonText;
|
|
14
|
+
return locales.getText("pisell2.recordBoard.toolbar.filter") || getText("table-action-filter-button");
|
|
15
|
+
}
|
|
16
|
+
const Filter = ({ value, hiddenQuickFilter, hiddenOtherFilter, onChange, quickFilterMaxLength, formFiltersPrefix, renderItem, placement, size = "large", buttonClassName, buttonText }) => {
|
|
11
17
|
const ref = useRef(null);
|
|
12
18
|
const [open, setOpen] = useState(false);
|
|
13
19
|
const [dateRangeOpen, setDateRangeOpen] = useState(false);
|
|
@@ -42,7 +48,7 @@ const Filter = ({ value, hiddenQuickFilter, hiddenOtherFilter, onChange, quickFi
|
|
|
42
48
|
formFiltersPrefix,
|
|
43
49
|
renderItem
|
|
44
50
|
]);
|
|
45
|
-
const isMobileBool = isMobile();
|
|
51
|
+
const isMobileBool = isMobile$1();
|
|
46
52
|
return /* @__PURE__ */ React.createElement("div", { ref }, /* @__PURE__ */ React.createElement(Popover, {
|
|
47
53
|
content,
|
|
48
54
|
arrow: false,
|
|
@@ -58,7 +64,7 @@ const Filter = ({ value, hiddenQuickFilter, hiddenOtherFilter, onChange, quickFi
|
|
|
58
64
|
className: buttonClassName,
|
|
59
65
|
icon: /* @__PURE__ */ React.createElement(FilterLines, null),
|
|
60
66
|
size
|
|
61
|
-
}, isMobileBool ? null :
|
|
67
|
+
}, isMobileBool ? null : getFilterButtonLabel(buttonText))));
|
|
62
68
|
};
|
|
63
69
|
var FilterButton_default = Filter;
|
|
64
70
|
|
|
@@ -17,7 +17,8 @@ type FilterListProps = {
|
|
|
17
17
|
renderItem?: (item: any, otherProps?: any) => React.ReactNode;
|
|
18
18
|
placement?: 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom'; /** 筛选按钮尺寸,与 antd Button size 一致 */
|
|
19
19
|
size?: 'small' | 'middle' | 'large'; /** 筛选触发按钮的 className,用于定制样式(如与设计系统对齐) */
|
|
20
|
-
buttonClassName?: string;
|
|
20
|
+
buttonClassName?: string; /** 筛选按钮文案,不传则使用 materials 内置多语言 */
|
|
21
|
+
buttonText?: string;
|
|
21
22
|
};
|
|
22
23
|
//#endregion
|
|
23
24
|
export { FilterListProps };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { InputProps, InputRef } from "antd";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react2 from "react";
|
|
4
4
|
import * as antd_es_input0 from "antd/es/input";
|
|
5
5
|
import * as antd_es_input_TextArea0 from "antd/es/input/TextArea";
|
|
6
6
|
|
|
7
7
|
//#region src/components/input/index.d.ts
|
|
8
|
-
declare const OriginalGroup:
|
|
8
|
+
declare const OriginalGroup: react2.FC<antd_es_input0.GroupProps>, OriginalTextArea: react2.ForwardRefExoticComponent<antd_es_input0.TextAreaProps & react2.RefAttributes<antd_es_input_TextArea0.TextAreaRef>>, OriginalPassword: react2.ForwardRefExoticComponent<antd_es_input0.PasswordProps & react2.RefAttributes<InputRef>>, OriginalSearch: react2.ForwardRefExoticComponent<antd_es_input0.SearchProps & react2.RefAttributes<InputRef>>;
|
|
9
9
|
type CompoundedComponent = React.ForwardRefExoticComponent<InputProps & React.RefAttributes<InputRef>> & {
|
|
10
10
|
Group: typeof OriginalGroup;
|
|
11
11
|
Search: typeof OriginalSearch;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react10 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/pisell-config-provider/context.d.ts
|
|
5
5
|
interface PisellContextType {
|
|
@@ -11,7 +11,7 @@ interface PisellContextType {
|
|
|
11
11
|
/** 获取货币符号 */
|
|
12
12
|
getSymbolic?: () => string;
|
|
13
13
|
}
|
|
14
|
-
declare const PisellContext:
|
|
14
|
+
declare const PisellContext: react10.Context<PisellContextType>;
|
|
15
15
|
/**
|
|
16
16
|
* provider外获取当前全局配置
|
|
17
17
|
*/
|
|
@@ -5,9 +5,15 @@ import GraphicTextCard_default from "../PisellCards/components/GraphicTextCard/G
|
|
|
5
5
|
import { Modal, Popconfirm, Popover } from "antd";
|
|
6
6
|
import classNames from "classnames";
|
|
7
7
|
import React, { useCallback, useMemo, useRef, useState } from "react";
|
|
8
|
+
import { locales } from "@pisell/utils";
|
|
8
9
|
import "./PisellBatchActionBar.less";
|
|
9
10
|
|
|
10
11
|
//#region src/components/pisellBatchActionBar/PisellBatchActionBar.tsx
|
|
12
|
+
/** 优先 @pisell/utils locales(pisell2.salesManagement.batchActionBar.*),无则回退 materials getText */
|
|
13
|
+
function getBatchBarText(key) {
|
|
14
|
+
var _utilsLocales$getText;
|
|
15
|
+
return (_utilsLocales$getText = locales.getText(`pisell2.salesManagement.batchActionBar.${key}`)) !== null && _utilsLocales$getText !== void 0 ? _utilsLocales$getText : getText(`batch-action-bar-${key}`);
|
|
16
|
+
}
|
|
11
17
|
/**
|
|
12
18
|
* PisellBatchActionBar 批量操作栏组件
|
|
13
19
|
*
|
|
@@ -35,7 +41,7 @@ import "./PisellBatchActionBar.less";
|
|
|
35
41
|
* ```
|
|
36
42
|
*/
|
|
37
43
|
const PisellBatchActionBar = (props) => {
|
|
38
|
-
const { className, style, selectedKeys, selectedRows, total, currentPageTotal, currentPageKeys, position = "float", offset = 0, showSelectedCount = true, selectedCountText, defaultActions, actions = [], actionOrder, enableOverflow = true, overflowThreshold = 5, moreText =
|
|
44
|
+
const { className, style, selectedKeys, selectedRows, total, currentPageTotal, currentPageKeys, position = "float", offset = 0, showSelectedCount = true, selectedCountText, defaultActions, actions = [], actionOrder, enableOverflow = true, overflowThreshold = 5, moreText = getBatchBarText("more"), onSelectAll, onClear, onInvert, onDelete, deleteConfirmConfig, onActionClick } = props;
|
|
39
45
|
/**
|
|
40
46
|
* 用于防止删除按钮重复点击的标记
|
|
41
47
|
*/
|
|
@@ -110,7 +116,7 @@ const PisellBatchActionBar = (props) => {
|
|
|
110
116
|
const count = selectionState.selectedCount;
|
|
111
117
|
if (typeof selectedCountText === "function") return selectedCountText(count);
|
|
112
118
|
if (selectedCountText) return selectedCountText.replace("{count}", String(count));
|
|
113
|
-
const i18nText =
|
|
119
|
+
const i18nText = getBatchBarText("selectedCount");
|
|
114
120
|
if (typeof i18nText === "function") return i18nText(count);
|
|
115
121
|
return i18nText || `已选择 ${count} 项`;
|
|
116
122
|
}, [
|
|
@@ -127,7 +133,7 @@ const PisellBatchActionBar = (props) => {
|
|
|
127
133
|
const defaultActionNodes = [];
|
|
128
134
|
if ((defaultActions === null || defaultActions === void 0 ? void 0 : defaultActions.showSelectAll) !== false) defaultActionNodes.push(/* @__PURE__ */ React.createElement(GraphicTextCard_default, {
|
|
129
135
|
key: "select-all",
|
|
130
|
-
text:
|
|
136
|
+
text: getBatchBarText("selectAll"),
|
|
131
137
|
icon: "pisell2-check-square",
|
|
132
138
|
variant: "horizontal",
|
|
133
139
|
size: "small",
|
|
@@ -158,7 +164,7 @@ const PisellBatchActionBar = (props) => {
|
|
|
158
164
|
}));
|
|
159
165
|
if ((defaultActions === null || defaultActions === void 0 ? void 0 : defaultActions.showInvert) !== false) defaultActionNodes.push(/* @__PURE__ */ React.createElement(GraphicTextCard_default, {
|
|
160
166
|
key: "invert",
|
|
161
|
-
text:
|
|
167
|
+
text: getBatchBarText("invert"),
|
|
162
168
|
icon: "pisell2-check-done-01",
|
|
163
169
|
variant: "horizontal",
|
|
164
170
|
size: "small",
|
|
@@ -189,7 +195,7 @@ const PisellBatchActionBar = (props) => {
|
|
|
189
195
|
}));
|
|
190
196
|
if ((defaultActions === null || defaultActions === void 0 ? void 0 : defaultActions.showClear) !== false) defaultActionNodes.push(/* @__PURE__ */ React.createElement(GraphicTextCard_default, {
|
|
191
197
|
key: "clear",
|
|
192
|
-
text:
|
|
198
|
+
text: getBatchBarText("clear"),
|
|
193
199
|
icon: "pisell2-square",
|
|
194
200
|
variant: "horizontal",
|
|
195
201
|
size: "small",
|
|
@@ -220,7 +226,7 @@ const PisellBatchActionBar = (props) => {
|
|
|
220
226
|
}));
|
|
221
227
|
if ((defaultActions === null || defaultActions === void 0 ? void 0 : defaultActions.showDelete) !== false) defaultActionNodes.push(/* @__PURE__ */ React.createElement(GraphicTextCard_default, {
|
|
222
228
|
key: "delete",
|
|
223
|
-
text:
|
|
229
|
+
text: getBatchBarText("delete"),
|
|
224
230
|
icon: "pisell2-delete_wght300_24px",
|
|
225
231
|
variant: "horizontal",
|
|
226
232
|
size: "small",
|
|
@@ -246,18 +252,16 @@ const PisellBatchActionBar = (props) => {
|
|
|
246
252
|
height: "48px"
|
|
247
253
|
},
|
|
248
254
|
onClick: () => {
|
|
255
|
+
var _deleteConfirmConfig$, _deleteConfirmConfig$2, _deleteConfirmConfig$3, _deleteConfirmConfig$4;
|
|
249
256
|
if (isDeleteModalOpenRef.current) return;
|
|
250
257
|
isDeleteModalOpenRef.current = true;
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
if (typeof i18nContent === "function") return i18nContent(selectionState.selectedCount);
|
|
254
|
-
return i18nContent || `确定要删除选中的 ${selectionState.selectedCount} 项吗?`;
|
|
255
|
-
})();
|
|
258
|
+
const i18nContent = getBatchBarText("deleteConfirmContent");
|
|
259
|
+
const deleteContent = typeof i18nContent === "function" ? i18nContent(selectionState.selectedCount) : i18nContent || `确定要删除选中的 ${selectionState.selectedCount} 项吗?`;
|
|
256
260
|
Modal.confirm({
|
|
257
|
-
title: (deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.title)
|
|
258
|
-
content: (deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.description)
|
|
259
|
-
okText: (deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.okText)
|
|
260
|
-
cancelText: (deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.cancelText)
|
|
261
|
+
title: (_deleteConfirmConfig$ = deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.title) !== null && _deleteConfirmConfig$ !== void 0 ? _deleteConfirmConfig$ : getBatchBarText("deleteConfirmTitle"),
|
|
262
|
+
content: (_deleteConfirmConfig$2 = deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.description) !== null && _deleteConfirmConfig$2 !== void 0 ? _deleteConfirmConfig$2 : deleteContent,
|
|
263
|
+
okText: (_deleteConfirmConfig$3 = deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.okText) !== null && _deleteConfirmConfig$3 !== void 0 ? _deleteConfirmConfig$3 : getBatchBarText("deleteConfirmOk"),
|
|
264
|
+
cancelText: (_deleteConfirmConfig$4 = deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.cancelText) !== null && _deleteConfirmConfig$4 !== void 0 ? _deleteConfirmConfig$4 : getBatchBarText("deleteConfirmCancel"),
|
|
261
265
|
okButtonProps: { danger: true },
|
|
262
266
|
onOk: () => {
|
|
263
267
|
onDelete === null || onDelete === void 0 || onDelete(selectedKeys, selectedRows);
|
|
@@ -342,17 +346,16 @@ const PisellBatchActionBar = (props) => {
|
|
|
342
346
|
minWidth: "120px",
|
|
343
347
|
height: "48px"
|
|
344
348
|
}, action.style),
|
|
345
|
-
className: action.className,
|
|
346
349
|
onClick: () => handleActionClick(action)
|
|
347
350
|
});
|
|
348
351
|
if (action.confirm) {
|
|
349
352
|
const confirmConfig = typeof action.confirm === "object" ? action.confirm : {};
|
|
350
353
|
return /* @__PURE__ */ React.createElement(Popconfirm, {
|
|
351
354
|
key: action.key,
|
|
352
|
-
title: confirmConfig.title ||
|
|
355
|
+
title: confirmConfig.title || getBatchBarText("confirmTitle"),
|
|
353
356
|
description: confirmConfig.description,
|
|
354
|
-
okText: confirmConfig.okText ||
|
|
355
|
-
cancelText: confirmConfig.cancelText ||
|
|
357
|
+
okText: confirmConfig.okText || getBatchBarText("deleteConfirmOk"),
|
|
358
|
+
cancelText: confirmConfig.cancelText || getBatchBarText("deleteConfirmCancel"),
|
|
356
359
|
onConfirm: () => handleActionClick(action)
|
|
357
360
|
}, card);
|
|
358
361
|
}
|
|
@@ -399,8 +402,10 @@ const PisellBatchActionBar = (props) => {
|
|
|
399
402
|
if (!hasOverflow || overflowActions.length === 0) return null;
|
|
400
403
|
const modifiedOverflowActions = overflowActions.map((action) => {
|
|
401
404
|
if (React.isValidElement(action)) {
|
|
402
|
-
var
|
|
403
|
-
|
|
405
|
+
var _el$props;
|
|
406
|
+
const el = action;
|
|
407
|
+
const prevStyle = (_el$props = el.props) === null || _el$props === void 0 ? void 0 : _el$props.style;
|
|
408
|
+
return React.cloneElement(el, { style: _objectSpread2(_objectSpread2({}, prevStyle || {}), {}, {
|
|
404
409
|
minWidth: "160px",
|
|
405
410
|
width: "160px"
|
|
406
411
|
}) });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react16 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/pisellDatePicker/index.d.ts
|
|
5
|
-
declare const PisellDatePicker: (props: any) =>
|
|
5
|
+
declare const PisellDatePicker: (props: any) => react16.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { PisellDatePicker };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
//#region src/components/pisellDateTimeDisplay/formats/dateTimeDisplayFormats.ts
|
|
2
2
|
/**
|
|
3
3
|
* PisellDateTimeDisplay 按语言预设的格式
|
|
4
|
-
* - zh-cn:完整日期 - 时间 星期(如 2025-12-31 - 2:00
|
|
5
|
-
* - en:时间 星期, 日期(如 2:00 Sat, 21 Mar, 2026
|
|
4
|
+
* - zh-cn:完整日期 - 时间 星期(如 2025-12-31 - 2:00 周四);默认不展示相对日,可传 dateFormat.showRelativeDay: true 开启
|
|
5
|
+
* - en:时间 星期, 日期(如 2:00 Sat, 21 Mar, 2026);默认不展示相对日,可传 dateFormat.showRelativeDay: true 开启
|
|
6
6
|
*/
|
|
7
7
|
const DATETIME_DISPLAY_FORMATS = {
|
|
8
8
|
"zh-cn": {
|
|
@@ -11,7 +11,7 @@ const DATETIME_DISPLAY_FORMATS = {
|
|
|
11
11
|
showYear: true,
|
|
12
12
|
separator: "-",
|
|
13
13
|
showChineseUnit: false,
|
|
14
|
-
showRelativeDay:
|
|
14
|
+
showRelativeDay: false
|
|
15
15
|
},
|
|
16
16
|
timeFormat: {
|
|
17
17
|
use12Hour: false,
|
|
@@ -39,7 +39,7 @@ const DATETIME_DISPLAY_FORMATS = {
|
|
|
39
39
|
showYear: true,
|
|
40
40
|
separator: "-",
|
|
41
41
|
showChineseUnit: false,
|
|
42
|
-
showRelativeDay:
|
|
42
|
+
showRelativeDay: false
|
|
43
43
|
},
|
|
44
44
|
timeFormat: {
|
|
45
45
|
use12Hour: false,
|
|
@@ -66,7 +66,7 @@ const DATETIME_DISPLAY_FORMATS = {
|
|
|
66
66
|
order: "DMY",
|
|
67
67
|
shortMonth: true,
|
|
68
68
|
showYear: true,
|
|
69
|
-
showRelativeDay:
|
|
69
|
+
showRelativeDay: false,
|
|
70
70
|
useCommaBeforeYear: true
|
|
71
71
|
},
|
|
72
72
|
timeFormat: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getCurrentLocale } from "../../../utils/locale.js";
|
|
2
|
+
import { locales } from "@pisell/utils";
|
|
2
3
|
|
|
3
4
|
//#region src/components/pisellDateTimeDisplay/utils/localeUtils.ts
|
|
4
5
|
/**
|
|
@@ -21,13 +22,16 @@ function isChinese(locale) {
|
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
24
|
* 获取 dayjs 兼容的 locale 代码
|
|
24
|
-
* 未传 locale
|
|
25
|
+
* 未传 locale 时与 locale.getText 同源:优先 @pisell/utils 当前语言(getLocale),无则 materials 全局配置 / umi_locale
|
|
25
26
|
* @param locale 原始 locale 代码(可选)
|
|
26
27
|
* @returns dayjs 兼容的 locale 代码
|
|
27
28
|
* @example 'zh-CN' -> 'zh-cn', 'en-US' -> 'en'
|
|
28
29
|
*/
|
|
29
30
|
function getDayjsLocale(locale) {
|
|
30
|
-
if (!locale)
|
|
31
|
+
if (!locale) {
|
|
32
|
+
const fromUtils = typeof locales.getLocale === "function" ? locales.getLocale() : void 0;
|
|
33
|
+
return normalizeLocale(typeof fromUtils === "string" && fromUtils ? fromUtils : getCurrentLocale());
|
|
34
|
+
}
|
|
31
35
|
return normalizeLocale(locale);
|
|
32
36
|
}
|
|
33
37
|
|
|
@@ -3,6 +3,7 @@ import { _objectWithoutProperties } from "../../_virtual/_@oxc-project_runtime@0
|
|
|
3
3
|
import { getText } from "../../locales/index.js";
|
|
4
4
|
import { PisellLookup } from "../pisellLookup/PisellLookup.js";
|
|
5
5
|
import React, { forwardRef } from "react";
|
|
6
|
+
import { locales } from "@pisell/utils";
|
|
6
7
|
|
|
7
8
|
//#region src/components/pisellFind/index.tsx
|
|
8
9
|
const _excluded = [
|
|
@@ -41,7 +42,7 @@ const _excluded = [
|
|
|
41
42
|
* ```
|
|
42
43
|
*/
|
|
43
44
|
const PisellFind = forwardRef((props, ref) => {
|
|
44
|
-
const { triggerType = "button", buttonText = getText("pisell-find-button-text"), placeholder = getText("pisell-find-placeholder"), showConfirmButton = false, showHistory = true, historyKey = "pisell_find_history" } = props, restProps = _objectWithoutProperties(props, _excluded);
|
|
45
|
+
const { triggerType = "button", buttonText = locales.getText("pisell2.recordBoard.toolbar.find") || getText("pisell-find-button-text"), placeholder = locales.getText("pisell2.recordBoard.toolbar.findPlaceholder") || getText("pisell-find-placeholder"), showConfirmButton = false, showHistory = true, historyKey = "pisell_find_history" } = props, restProps = _objectWithoutProperties(props, _excluded);
|
|
45
46
|
return /* @__PURE__ */ React.createElement(PisellLookup, _objectSpread2({
|
|
46
47
|
ref,
|
|
47
48
|
triggerType,
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
/**
|
|
15
15
|
* 工具栏行通用样式
|
|
16
16
|
*/
|
|
17
|
+
|
|
17
18
|
&-row {
|
|
18
19
|
display: flex;
|
|
19
20
|
flex-direction: row;
|
|
@@ -21,8 +22,10 @@
|
|
|
21
22
|
gap: 12px;
|
|
22
23
|
align-self: stretch;
|
|
23
24
|
}
|
|
25
|
+
|
|
24
26
|
.toolbar-row {
|
|
25
27
|
justify-content: space-between;
|
|
28
|
+
|
|
26
29
|
&-left {
|
|
27
30
|
display: flex;
|
|
28
31
|
flex-direction: row;
|
|
@@ -40,3 +43,23 @@
|
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
45
|
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* 手机版宽度:左侧区域与右侧区域换行,避免挤在一行
|
|
49
|
+
*/
|
|
50
|
+
@media (max-width: 768px) {
|
|
51
|
+
.pisell-grid-pro-toolbar .toolbar-row {
|
|
52
|
+
flex-wrap: wrap;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.pisell-grid-pro-toolbar .toolbar-row-left {
|
|
56
|
+
flex: 1 1 100%;
|
|
57
|
+
min-width: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.pisell-grid-pro-toolbar .toolbar-row-right {
|
|
61
|
+
flex: 1 1 100%;
|
|
62
|
+
min-width: 0;
|
|
63
|
+
justify-content: flex-start;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PisellContextType } from "../pisell-config-provider/context.js";
|
|
2
2
|
import { PisellModalFuncProps } from "./components/functions/index.js";
|
|
3
3
|
import { InformationProps } from "./components/Information/index.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as antd1 from "antd";
|
|
5
5
|
import { ButtonProps, ModalProps } from "antd";
|
|
6
6
|
import React from "react";
|
|
7
7
|
|
|
@@ -39,24 +39,24 @@ declare const PisellModal: {
|
|
|
39
39
|
(props: PisellModalProps): React.JSX.Element;
|
|
40
40
|
confirm: (props: PisellModalFuncProps) => {
|
|
41
41
|
destroy: () => void;
|
|
42
|
-
update: (configUpdate:
|
|
42
|
+
update: (configUpdate: antd1.ModalFuncProps | ((prevConfig: antd1.ModalFuncProps) => antd1.ModalFuncProps)) => void;
|
|
43
43
|
};
|
|
44
44
|
info: (props: PisellModalFuncProps) => {
|
|
45
45
|
destroy: () => void;
|
|
46
|
-
update: (configUpdate:
|
|
46
|
+
update: (configUpdate: antd1.ModalFuncProps | ((prevConfig: antd1.ModalFuncProps) => antd1.ModalFuncProps)) => void;
|
|
47
47
|
};
|
|
48
48
|
error: (props: PisellModalFuncProps) => {
|
|
49
49
|
destroy: () => void;
|
|
50
|
-
update: (configUpdate:
|
|
50
|
+
update: (configUpdate: antd1.ModalFuncProps | ((prevConfig: antd1.ModalFuncProps) => antd1.ModalFuncProps)) => void;
|
|
51
51
|
};
|
|
52
52
|
warn: (props: PisellModalFuncProps) => any;
|
|
53
53
|
warning: (props: PisellModalFuncProps) => {
|
|
54
54
|
destroy: () => void;
|
|
55
|
-
update: (configUpdate:
|
|
55
|
+
update: (configUpdate: antd1.ModalFuncProps | ((prevConfig: antd1.ModalFuncProps) => antd1.ModalFuncProps)) => void;
|
|
56
56
|
};
|
|
57
57
|
success: (props: PisellModalFuncProps) => {
|
|
58
58
|
destroy: () => void;
|
|
59
|
-
update: (configUpdate:
|
|
59
|
+
update: (configUpdate: antd1.ModalFuncProps | ((prevConfig: antd1.ModalFuncProps) => antd1.ModalFuncProps)) => void;
|
|
60
60
|
};
|
|
61
61
|
Information: (props: InformationProps) => React.JSX.Element;
|
|
62
62
|
};
|