@pisell/materials 1.0.1034 → 1.0.1035
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/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +17 -17
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +18 -23
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +27 -32
- package/es/components/Pagination/index.js +1 -1
- 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.Email/index.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Input.Password/index.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +3 -3
- package/es/components/dataSourceComponents/fields/Input.TextArea/index.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/es/components/date-picker/index.d.ts +2 -2
- package/es/components/filter/components/Dropdown/index.js +6 -2
- package/es/components/filter/components/FilterButton/index.js +3 -2
- package/es/components/filter/components/FilterButton/types.d.ts +5 -2
- package/es/components/filter/components/FilterItem/AsyncOptionsSelectWrapper.js +67 -0
- package/es/components/filter/components/FilterItem/index.js +105 -6
- package/es/components/filter/components/FilterItem/index.less +90 -0
- package/es/components/filter/types.d.ts +4 -2
- package/es/components/input/index.d.ts +2 -2
- package/es/components/pisell-config-provider/context.d.ts +2 -2
- package/es/components/pisellCurrency/PisellCurrency.less +163 -25
- package/es/components/pisellDatePicker/index.d.ts +2 -2
- package/es/components/pisellDateTimeDisplay/PisellDateTimeDisplay.js +11 -10
- package/es/components/pisellDateTimeDisplay/types.d.ts +5 -0
- package/es/components/pisellEmail/PisellEmail.d.ts +2 -33
- package/es/components/pisellEmail/PisellEmail.js +1 -1
- package/es/components/pisellEmail/PisellEmail.less +119 -10
- package/es/components/pisellEmail/index.d.ts +1 -1
- package/es/components/pisellFilter/docs/PisellFilter.md +289 -232
- package/es/components/pisellFilter/index.js +66 -11
- package/es/components/pisellLongText/PisellLongText.less +72 -4
- package/es/components/pisellLookup/PisellLookup.js +3 -3
- package/es/components/pisellLookup/PisellLookup.less +14 -9
- package/es/components/pisellLookup/components/LookupTrigger.js +6 -2
- package/es/components/pisellMetricCard/PisellMetricCard.d.ts +38 -0
- package/es/components/pisellMetricCard/PisellMetricCard.js +136 -0
- package/es/components/pisellMetricCard/components/MetricComparison.js +54 -0
- package/es/components/pisellMetricCard/components/MetricTitle.js +41 -0
- package/es/components/pisellMetricCard/components/MetricValue.js +26 -0
- package/es/components/pisellMetricCard/components/TrendIcon.js +26 -0
- package/es/components/pisellMetricCard/docs/pisellMetricCard.$tab-design.md +2 -6
- package/es/components/pisellMetricCard/index.d.ts +2 -0
- package/es/components/pisellMetricCard/types.d.ts +143 -0
- package/es/components/pisellMetricCard/utils/calculateTrend.js +22 -0
- package/es/components/pisellMetricCard/utils/formatMetricValue.js +52 -0
- package/es/components/pisellMultipleSelect/PisellMultipleSelect.less +151 -124
- package/es/components/pisellMultipleSelect/components/EditView.js +8 -1
- package/es/components/pisellMultipleSelect/components/ReadOnlyView.js +18 -6
- package/es/components/pisellNumber/PisellNumber.less +135 -17
- package/es/components/pisellPercent/PisellPercent.less +142 -24
- package/es/components/pisellPhone/PisellPhone.less +122 -27
- package/es/components/pisellPhone/components/EditView.js +1 -1
- package/es/components/pisellPhone/components/ReadOnlyView.js +15 -5
- package/es/components/pisellPhone/utils/countryCodeHelper.js +1 -10
- package/es/components/pisellRating/PisellRating.less +20 -12
- package/es/components/pisellRecordBoard/PisellRecordBoard.js +148 -0
- package/es/components/pisellRecordBoard/README.md +183 -0
- package/es/components/pisellRecordBoard/context/RecordBoardContext.js +7 -0
- package/es/components/pisellRecordBoard/context/RecordBoardProvider.js +14 -0
- package/es/components/pisellRecordBoard/docs/PisellRecordBoard.$tab-design.md +128 -0
- package/es/components/pisellRecordBoard/docs/PisellRecordBoard.$tab-dev.md +82 -0
- package/es/components/pisellRecordBoard/docs/PisellRecordBoard.$tab-test.md +70 -0
- package/es/components/pisellRecordBoard/docs/PisellRecordBoard.md +552 -0
- package/es/components/pisellRecordBoard/hooks/useRecordBoardContext.d.ts +20 -0
- package/es/components/pisellRecordBoard/hooks/useRecordBoardContext.js +16 -0
- package/es/components/pisellRecordBoard/index.d.ts +40 -0
- package/es/components/pisellRecordBoard/index.js +28 -0
- package/es/components/pisellRecordBoard/layouts/CardLayout/CardList.d.ts +15 -0
- package/es/components/pisellRecordBoard/layouts/CardLayout/CardList.js +24 -0
- package/es/components/pisellRecordBoard/layouts/CardLayout/index.d.ts +15 -0
- package/es/components/pisellRecordBoard/layouts/CardLayout/index.js +21 -0
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.d.ts +17 -0
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.js +105 -0
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.less +13 -0
- package/es/components/pisellRecordBoard/layouts/GridLayout/index.d.ts +15 -0
- package/es/components/pisellRecordBoard/layouts/GridLayout/index.js +21 -0
- package/es/components/pisellRecordBoard/shellFrame/BatchActionBar/index.d.ts +12 -0
- package/es/components/pisellRecordBoard/shellFrame/BatchActionBar/index.js +69 -0
- package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/ColumnSettingPopover.js +40 -0
- package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/index.js +60 -0
- package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/index.less +2 -0
- package/es/components/pisellRecordBoard/shellFrame/Pagination/index.d.ts +17 -0
- package/es/components/pisellRecordBoard/shellFrame/Pagination/index.js +52 -0
- package/es/components/pisellRecordBoard/shellFrame/Pagination/index.less +61 -0
- package/es/components/pisellRecordBoard/shellFrame/Search/index.d.ts +13 -0
- package/es/components/pisellRecordBoard/shellFrame/Search/index.js +34 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/ToolBarFilter.less +77 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.d.ts +14 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.js +136 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBarQuickFilter/index.d.ts +2 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBarQuickFilter/index.js +62 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBarReset/index.d.ts +2 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBarReset/index.js +45 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBarReset/index.less +41 -0
- package/es/components/pisellRecordBoard/shellFrame/index.d.ts +27 -0
- package/es/components/pisellRecordBoard/shellFrame/index.js +38 -0
- package/es/components/pisellRecordBoard/types.d.ts +259 -0
- package/es/components/pisellRecordBoard/utils/recordBoardColumns.js +287 -0
- package/es/components/pisellShellFrame/PisellShellFrame.d.ts +16 -0
- package/es/components/pisellShellFrame/PisellShellFrame.js +60 -0
- package/es/components/pisellShellFrame/PisellShellFrame.less +73 -0
- package/es/components/pisellShellFrame/README.md +58 -0
- package/es/components/pisellShellFrame/index.d.ts +2 -0
- package/es/components/pisellShellFrame/types.d.ts +60 -0
- package/es/components/pisellSingleSelect/PisellSingleSelect.less +88 -46
- package/es/components/pisellSingleSelect/components/EditView.js +8 -1
- package/es/components/pisellSingleSelect/components/ReadOnlyView.js +8 -2
- package/es/components/pisellUrl/PisellUrl.d.ts +2 -33
- package/es/components/pisellUrl/PisellUrl.js +1 -1
- package/es/components/pisellUrl/PisellUrl.less +120 -11
- package/es/components/pisellUrl/index.d.ts +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/sort/index.js +12 -1
- package/es/components/sort/types.d.ts +8 -2
- package/es/components/time-picker/index.d.ts +2 -2
- package/es/index.d.ts +19 -11
- package/es/index.js +19 -15
- package/es/locales/en-US.js +16 -2
- package/es/locales/zh-CN.js +18 -4
- package/es/locales/zh-TW.js +18 -4
- package/es/utils/tagColor.js +31 -0
- package/lib/components/Pagination/index.js +1 -1
- package/lib/components/checkbox/index.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Checkbox/WithMode.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Input.Password/index.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Input.TextArea/index.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/lib/components/filter/components/Dropdown/index.js +6 -2
- package/lib/components/filter/components/FilterButton/index.js +3 -2
- package/lib/components/filter/components/FilterButton/types.d.ts +5 -2
- package/lib/components/filter/components/FilterItem/AsyncOptionsSelectWrapper.js +69 -0
- package/lib/components/filter/components/FilterItem/index.js +106 -6
- package/lib/components/filter/components/FilterItem/index.less +90 -0
- package/lib/components/filter/types.d.ts +4 -2
- package/lib/components/input/index.d.ts +2 -2
- package/lib/components/pisell-config-provider/context.d.ts +2 -2
- package/lib/components/pisellCurrency/PisellCurrency.less +163 -25
- package/lib/components/pisellDatePicker/index.d.ts +2 -2
- package/lib/components/pisellDateTimeDisplay/PisellDateTimeDisplay.js +11 -10
- package/lib/components/pisellDateTimeDisplay/types.d.ts +5 -0
- package/lib/components/pisellEmail/PisellEmail.d.ts +2 -33
- package/lib/components/pisellEmail/PisellEmail.js +1 -1
- package/lib/components/pisellEmail/PisellEmail.less +119 -10
- package/lib/components/pisellEmail/index.d.ts +1 -1
- package/lib/components/pisellFilter/docs/PisellFilter.md +289 -232
- package/lib/components/pisellFilter/index.js +65 -10
- package/lib/components/pisellLongText/PisellLongText.less +72 -4
- package/lib/components/pisellLookup/PisellLookup.js +3 -3
- package/lib/components/pisellLookup/PisellLookup.less +14 -9
- package/lib/components/pisellLookup/components/LookupTrigger.js +6 -2
- package/lib/components/pisellMetricCard/PisellMetricCard.d.ts +38 -0
- package/lib/components/pisellMetricCard/PisellMetricCard.js +138 -0
- package/lib/components/pisellMetricCard/components/MetricComparison.js +56 -0
- package/lib/components/pisellMetricCard/components/MetricTitle.js +43 -0
- package/lib/components/pisellMetricCard/components/MetricValue.js +28 -0
- package/lib/components/pisellMetricCard/components/TrendIcon.js +28 -0
- package/lib/components/pisellMetricCard/docs/pisellMetricCard.$tab-design.md +2 -6
- package/lib/components/pisellMetricCard/index.d.ts +2 -0
- package/lib/components/pisellMetricCard/types.d.ts +143 -0
- package/lib/components/pisellMetricCard/utils/calculateTrend.js +23 -0
- package/lib/components/pisellMetricCard/utils/formatMetricValue.js +53 -0
- package/lib/components/pisellMultipleSelect/PisellMultipleSelect.less +151 -124
- package/lib/components/pisellMultipleSelect/components/EditView.js +7 -0
- package/lib/components/pisellMultipleSelect/components/ReadOnlyView.js +17 -5
- package/lib/components/pisellNumber/PisellNumber.less +135 -17
- package/lib/components/pisellPercent/PisellPercent.less +142 -24
- package/lib/components/pisellPhone/PisellPhone.less +122 -27
- package/lib/components/pisellPhone/components/EditView.js +1 -1
- package/lib/components/pisellPhone/components/ReadOnlyView.js +15 -5
- package/lib/components/pisellPhone/utils/countryCodeHelper.js +0 -10
- package/lib/components/pisellRating/PisellRating.less +20 -12
- package/lib/components/pisellRecordBoard/PisellRecordBoard.js +150 -0
- package/lib/components/pisellRecordBoard/README.md +183 -0
- package/lib/components/pisellRecordBoard/context/RecordBoardContext.js +8 -0
- package/lib/components/pisellRecordBoard/context/RecordBoardProvider.js +16 -0
- package/lib/components/pisellRecordBoard/docs/PisellRecordBoard.$tab-design.md +128 -0
- package/lib/components/pisellRecordBoard/docs/PisellRecordBoard.$tab-dev.md +82 -0
- package/lib/components/pisellRecordBoard/docs/PisellRecordBoard.$tab-test.md +70 -0
- package/lib/components/pisellRecordBoard/docs/PisellRecordBoard.md +552 -0
- package/lib/components/pisellRecordBoard/hooks/useRecordBoardContext.d.ts +20 -0
- package/lib/components/pisellRecordBoard/hooks/useRecordBoardContext.js +17 -0
- package/lib/components/pisellRecordBoard/index.d.ts +40 -0
- package/lib/components/pisellRecordBoard/index.js +28 -0
- package/lib/components/pisellRecordBoard/layouts/CardLayout/CardList.d.ts +15 -0
- package/lib/components/pisellRecordBoard/layouts/CardLayout/CardList.js +26 -0
- package/lib/components/pisellRecordBoard/layouts/CardLayout/index.d.ts +15 -0
- package/lib/components/pisellRecordBoard/layouts/CardLayout/index.js +23 -0
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.d.ts +17 -0
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.js +107 -0
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.less +13 -0
- package/lib/components/pisellRecordBoard/layouts/GridLayout/index.d.ts +15 -0
- package/lib/components/pisellRecordBoard/layouts/GridLayout/index.js +23 -0
- package/lib/components/pisellRecordBoard/shellFrame/BatchActionBar/index.d.ts +12 -0
- package/lib/components/pisellRecordBoard/shellFrame/BatchActionBar/index.js +71 -0
- package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/ColumnSettingPopover.js +43 -0
- package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/index.js +62 -0
- package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/index.less +2 -0
- package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.d.ts +17 -0
- package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.js +54 -0
- package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.less +61 -0
- package/lib/components/pisellRecordBoard/shellFrame/Search/index.d.ts +13 -0
- package/lib/components/pisellRecordBoard/shellFrame/Search/index.js +36 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/ToolBarFilter.less +77 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.d.ts +14 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.js +139 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBarQuickFilter/index.js +64 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBarReset/index.d.ts +2 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBarReset/index.js +47 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBarReset/index.less +41 -0
- package/lib/components/pisellRecordBoard/shellFrame/index.d.ts +26 -0
- package/lib/components/pisellRecordBoard/shellFrame/index.js +40 -0
- package/lib/components/pisellRecordBoard/types.d.ts +259 -0
- package/lib/components/pisellRecordBoard/utils/recordBoardColumns.js +292 -0
- package/lib/components/pisellShellFrame/PisellShellFrame.d.ts +16 -0
- package/lib/components/pisellShellFrame/PisellShellFrame.js +62 -0
- package/lib/components/pisellShellFrame/PisellShellFrame.less +73 -0
- package/lib/components/pisellShellFrame/README.md +58 -0
- package/lib/components/pisellShellFrame/index.d.ts +2 -0
- package/lib/components/pisellShellFrame/types.d.ts +60 -0
- package/lib/components/pisellSingleSelect/PisellSingleSelect.less +88 -46
- package/lib/components/pisellSingleSelect/components/EditView.js +7 -0
- package/lib/components/pisellSingleSelect/components/ReadOnlyView.js +8 -2
- package/lib/components/pisellUrl/PisellUrl.d.ts +2 -33
- package/lib/components/pisellUrl/PisellUrl.js +1 -1
- package/lib/components/pisellUrl/PisellUrl.less +120 -11
- package/lib/components/pisellUrl/index.d.ts +1 -1
- package/lib/components/radio/index.d.ts +2 -2
- package/lib/components/section-footers/index.d.ts +2 -2
- package/lib/components/skeleton/index.d.ts +2 -2
- package/lib/components/sort/index.js +12 -1
- package/lib/components/sort/types.d.ts +8 -2
- package/lib/components/time-picker/index.d.ts +2 -2
- package/lib/components/upload/index.d.ts +2 -2
- package/lib/index.d.ts +19 -11
- package/lib/index.js +33 -25
- package/lib/locales/en-US.js +16 -2
- package/lib/locales/zh-CN.js +18 -4
- package/lib/locales/zh-TW.js +18 -4
- package/lib/utils/tagColor.js +32 -0
- package/package.json +3 -3
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.108.0/helpers/objectSpread2.js";
|
|
2
|
+
import { _objectWithoutProperties } from "../../../../_virtual/_@oxc-project_runtime@0.108.0/helpers/objectWithoutProperties.js";
|
|
3
|
+
import { useRecordBoardContext } from "../../hooks/useRecordBoardContext.js";
|
|
4
|
+
import React from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/pisellRecordBoard/layouts/CardLayout/CardList.tsx
|
|
7
|
+
const _excluded = ["render"];
|
|
8
|
+
/**
|
|
9
|
+
* Card 布局下的数据视图:从 context 取 data / loading。
|
|
10
|
+
*/
|
|
11
|
+
const RecordBoardCardList = (props) => {
|
|
12
|
+
var _ctx$data$length, _ctx$data;
|
|
13
|
+
const ctx = useRecordBoardContext({ displayName: "cardList" });
|
|
14
|
+
const { render } = props, rest = _objectWithoutProperties(props, _excluded);
|
|
15
|
+
if (typeof render === "function") return /* @__PURE__ */ React.createElement(React.Fragment, null, render(_objectSpread2(_objectSpread2({}, ctx), rest)));
|
|
16
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
17
|
+
"data-layout-slot": "cardList",
|
|
18
|
+
style: { minHeight: 120 }
|
|
19
|
+
}, /* @__PURE__ */ React.createElement("span", { style: { color: "var(--color-text-tertiary, #999)" } }, "卡片视图(", (_ctx$data$length = (_ctx$data = ctx.data) === null || _ctx$data === void 0 ? void 0 : _ctx$data.length) !== null && _ctx$data$length !== void 0 ? _ctx$data$length : 0, " 条,loading:", " ", String(ctx.loading), ")"));
|
|
20
|
+
};
|
|
21
|
+
var CardList_default = RecordBoardCardList;
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { CardList_default as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RecordBoardCardList } from "./CardList.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/pisellRecordBoard/layouts/CardLayout/index.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Card 布局:仅内容区 = 卡片列表(不含分页)。
|
|
7
|
+
* 工具栏、多选操作栏、分页由 Shell Frame 提供,使用时用 ShellFrame 包裹:
|
|
8
|
+
* <PisellRecordBoard.ShellFrame><PisellRecordBoard.CardLayout /></PisellRecordBoard.ShellFrame>
|
|
9
|
+
*/
|
|
10
|
+
declare const CardLayout: React.FC<{
|
|
11
|
+
className?: string;
|
|
12
|
+
style?: React.CSSProperties;
|
|
13
|
+
}>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { CardLayout };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import CardList_default from "./CardList.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/pisellRecordBoard/layouts/CardLayout/index.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Card 布局:仅内容区 = 卡片列表(不含分页)。
|
|
7
|
+
* 工具栏、多选操作栏、分页由 Shell Frame 提供,使用时用 ShellFrame 包裹:
|
|
8
|
+
* <PisellRecordBoard.ShellFrame><PisellRecordBoard.CardLayout /></PisellRecordBoard.ShellFrame>
|
|
9
|
+
*/
|
|
10
|
+
const CardLayout = ({ className, style }) => {
|
|
11
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
12
|
+
className,
|
|
13
|
+
style,
|
|
14
|
+
"data-layout": "card"
|
|
15
|
+
}, /* @__PURE__ */ React.createElement(CardList_default, null));
|
|
16
|
+
};
|
|
17
|
+
CardLayout.displayName = "RecordBoard.CardLayout";
|
|
18
|
+
var CardLayout_default = CardLayout;
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { CardLayout_default as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RecordBoardContextValue } from "../../types.js";
|
|
2
|
+
import { TableProps } from "antd";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import "./Grid.less";
|
|
5
|
+
|
|
6
|
+
//#region src/components/pisellRecordBoard/layouts/GridLayout/Grid.d.ts
|
|
7
|
+
interface RecordBoardGridViewProps extends Omit<TableProps<any>, 'dataSource' | 'loading' | 'pagination'>, Partial<Pick<RecordBoardContextValue, 'data' | 'loading'>> {
|
|
8
|
+
/** 列配置,同 antd Table columns */
|
|
9
|
+
columns?: TableProps<any>['columns'];
|
|
10
|
+
className?: string;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
/** 自定义渲染,传入后不再使用内置 Table */
|
|
13
|
+
render?: (ctx: RecordBoardContextValue) => React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
declare const RecordBoardGridView: React.FC<RecordBoardGridViewProps>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { RecordBoardGridView };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.108.0/helpers/objectSpread2.js";
|
|
2
|
+
import { _objectWithoutProperties } from "../../../../_virtual/_@oxc-project_runtime@0.108.0/helpers/objectWithoutProperties.js";
|
|
3
|
+
import { useRecordBoardContext } from "../../hooks/useRecordBoardContext.js";
|
|
4
|
+
import { getRecordBoardColumnKey, processColumnsForGrid } from "../../utils/recordBoardColumns.js";
|
|
5
|
+
import { Table } from "antd";
|
|
6
|
+
import React, { useMemo } from "react";
|
|
7
|
+
import "./Grid.less";
|
|
8
|
+
|
|
9
|
+
//#region src/components/pisellRecordBoard/layouts/GridLayout/Grid.tsx
|
|
10
|
+
const _excluded = [
|
|
11
|
+
"render",
|
|
12
|
+
"columns",
|
|
13
|
+
"rowKey",
|
|
14
|
+
"rowSelection"
|
|
15
|
+
];
|
|
16
|
+
function getRowKey(record, rowKey) {
|
|
17
|
+
var _ref, _record$id;
|
|
18
|
+
if (typeof rowKey === "function") return rowKey(record);
|
|
19
|
+
if (typeof rowKey === "string" && record != null && rowKey in record) return record[rowKey];
|
|
20
|
+
return (_ref = (_record$id = record === null || record === void 0 ? void 0 : record.id) !== null && _record$id !== void 0 ? _record$id : record === null || record === void 0 ? void 0 : record.key) !== null && _ref !== void 0 ? _ref : record;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Grid 布局下的数据视图:使用 antd Table,从 context 取 data / loading / 多选态。
|
|
24
|
+
*/
|
|
25
|
+
/** Context 中与 Table 无关的 key,透传 Table 时排除,避免覆盖或无效传递 */
|
|
26
|
+
const CONTEXT_ONLY_KEYS = [
|
|
27
|
+
"data",
|
|
28
|
+
"loading",
|
|
29
|
+
"total",
|
|
30
|
+
"pagination",
|
|
31
|
+
"onPageChange",
|
|
32
|
+
"searchParams",
|
|
33
|
+
"onSearch",
|
|
34
|
+
"onReset",
|
|
35
|
+
"layoutType",
|
|
36
|
+
"selectedKeys",
|
|
37
|
+
"selectedRows",
|
|
38
|
+
"onSelectionChange",
|
|
39
|
+
"rowKey",
|
|
40
|
+
"childComponentProps",
|
|
41
|
+
"columnVisibility",
|
|
42
|
+
"onColumnVisibilityChange",
|
|
43
|
+
"columns",
|
|
44
|
+
"scroll",
|
|
45
|
+
"size",
|
|
46
|
+
"defaultHiddenColumnKeys"
|
|
47
|
+
];
|
|
48
|
+
const RecordBoardGridView = (props) => {
|
|
49
|
+
var _ref2, _rest$scroll, _ctx$data;
|
|
50
|
+
const ctx = useRecordBoardContext({ displayName: "grid" });
|
|
51
|
+
const { render, columns: columnsProp, rowKey: rowKeyProp, rowSelection: rowSelectionProp } = props, rest = _objectWithoutProperties(props, _excluded);
|
|
52
|
+
const rawColumns = (_ref2 = columnsProp !== null && columnsProp !== void 0 ? columnsProp : ctx.columns) !== null && _ref2 !== void 0 ? _ref2 : [];
|
|
53
|
+
const columnVisibility = ctx.columnVisibility;
|
|
54
|
+
const columns = useMemo(() => {
|
|
55
|
+
const list = rawColumns;
|
|
56
|
+
return processColumnsForGrid(columnVisibility == null ? list : list.filter((col) => columnVisibility[getRecordBoardColumnKey(col)] !== false));
|
|
57
|
+
}, [rawColumns, columnVisibility]);
|
|
58
|
+
const tableRowKey = useMemo(() => {
|
|
59
|
+
var _ref3, _ctx$rowKey;
|
|
60
|
+
const key = (_ref3 = (_ctx$rowKey = ctx.rowKey) !== null && _ctx$rowKey !== void 0 ? _ctx$rowKey : rowKeyProp) !== null && _ref3 !== void 0 ? _ref3 : "id";
|
|
61
|
+
return typeof key === "function" ? key : (record) => getRowKey(record, typeof key === "string" ? key : String(key));
|
|
62
|
+
}, [ctx.rowKey, rowKeyProp]);
|
|
63
|
+
const rowSelection = useMemo(() => {
|
|
64
|
+
if (rowSelectionProp === false) return void 0;
|
|
65
|
+
const base = typeof rowSelectionProp === "object" ? rowSelectionProp : {};
|
|
66
|
+
return _objectSpread2(_objectSpread2({}, base), {}, {
|
|
67
|
+
selectedRowKeys: ctx.selectedKeys,
|
|
68
|
+
onChange: (selectedRowKeys, selectedRows) => {
|
|
69
|
+
var _onChange;
|
|
70
|
+
ctx.onSelectionChange(selectedRowKeys, selectedRows);
|
|
71
|
+
(_onChange = base.onChange) === null || _onChange === void 0 || _onChange.call(base, selectedRowKeys, selectedRows);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}, [
|
|
75
|
+
ctx.selectedKeys,
|
|
76
|
+
ctx.onSelectionChange,
|
|
77
|
+
rowSelectionProp
|
|
78
|
+
]);
|
|
79
|
+
const gridTableProps = useMemo(() => {
|
|
80
|
+
const picked = {};
|
|
81
|
+
Object.keys(ctx).forEach((k) => {
|
|
82
|
+
if (CONTEXT_ONLY_KEYS.includes(k)) return;
|
|
83
|
+
picked[k] = ctx[k];
|
|
84
|
+
});
|
|
85
|
+
return picked;
|
|
86
|
+
}, [ctx]);
|
|
87
|
+
if (typeof render === "function") return /* @__PURE__ */ React.createElement(React.Fragment, null, render(_objectSpread2(_objectSpread2({}, ctx), rest)));
|
|
88
|
+
const tableScroll = (_rest$scroll = rest.scroll) !== null && _rest$scroll !== void 0 ? _rest$scroll : ctx.scroll;
|
|
89
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
90
|
+
"data-layout-slot": "grid",
|
|
91
|
+
className: "pisell-lowcode-record-board-grid"
|
|
92
|
+
}, /* @__PURE__ */ React.createElement(Table, _objectSpread2(_objectSpread2(_objectSpread2({}, rest), gridTableProps), {}, {
|
|
93
|
+
scroll: tableScroll,
|
|
94
|
+
rowKey: tableRowKey,
|
|
95
|
+
dataSource: (_ctx$data = ctx.data) !== null && _ctx$data !== void 0 ? _ctx$data : [],
|
|
96
|
+
loading: ctx.loading,
|
|
97
|
+
columns,
|
|
98
|
+
rowSelection,
|
|
99
|
+
pagination: false
|
|
100
|
+
})));
|
|
101
|
+
};
|
|
102
|
+
var Grid_default = RecordBoardGridView;
|
|
103
|
+
|
|
104
|
+
//#endregion
|
|
105
|
+
export { Grid_default as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// RecordBoard Grid 表格样式:默认单元格(表头+表体)padding 8px 16px
|
|
2
|
+
// 项目内 ant 组件 prefixCls 为 pisell-lowcode,故表格类名为 .pisell-lowcode-table-*
|
|
3
|
+
.pisell-lowcode-record-board-grid {
|
|
4
|
+
.pisell-lowcode-table-thead .pisell-lowcode-table-cell,
|
|
5
|
+
.pisell-lowcode-table-tbody .pisell-lowcode-table-cell {
|
|
6
|
+
padding: 8px 16px;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// 行状态样式示例(如 grid.rowClassName 返回 'pisell-record-board-row-cancelled')
|
|
11
|
+
.pisell-record-board-row-cancelled {
|
|
12
|
+
background: #fff1f0;
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RecordBoardGridView } from "./Grid.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/pisellRecordBoard/layouts/GridLayout/index.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Grid 布局:仅内容区 = 表格(不含分页)。
|
|
7
|
+
* 工具栏、多选操作栏、分页由 Shell Frame 提供,使用时用 ShellFrame 包裹:
|
|
8
|
+
* <PisellRecordBoard.ShellFrame><PisellRecordBoard.GridLayout /></PisellRecordBoard.ShellFrame>
|
|
9
|
+
*/
|
|
10
|
+
declare const GridLayout: React.FC<{
|
|
11
|
+
className?: string;
|
|
12
|
+
style?: React.CSSProperties;
|
|
13
|
+
}>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { GridLayout };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import Grid_default from "./Grid.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/pisellRecordBoard/layouts/GridLayout/index.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Grid 布局:仅内容区 = 表格(不含分页)。
|
|
7
|
+
* 工具栏、多选操作栏、分页由 Shell Frame 提供,使用时用 ShellFrame 包裹:
|
|
8
|
+
* <PisellRecordBoard.ShellFrame><PisellRecordBoard.GridLayout /></PisellRecordBoard.ShellFrame>
|
|
9
|
+
*/
|
|
10
|
+
const GridLayout = ({ className, style }) => {
|
|
11
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
12
|
+
className,
|
|
13
|
+
style,
|
|
14
|
+
"data-layout": "grid"
|
|
15
|
+
}, /* @__PURE__ */ React.createElement(Grid_default, null));
|
|
16
|
+
};
|
|
17
|
+
GridLayout.displayName = "RecordBoard.GridLayout";
|
|
18
|
+
var GridLayout_default = GridLayout;
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { GridLayout_default as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PisellBatchActionBarProps } from "../../../pisellBatchActionBar/types.js";
|
|
2
|
+
import "../../../pisellBatchActionBar/index.js";
|
|
3
|
+
import React from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/pisellRecordBoard/shellFrame/BatchActionBar/index.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* RecordBoard 下的多选操作栏:从 context 取选中态与数据,渲染 PisellBatchActionBar。
|
|
8
|
+
* 仅在有选中项时展示;全选/反选/清空基于当前页 data。
|
|
9
|
+
*/
|
|
10
|
+
declare const RecordBoardBatchActionBar: React.FC<Partial<PisellBatchActionBarProps>>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { RecordBoardBatchActionBar };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.108.0/helpers/objectSpread2.js";
|
|
2
|
+
import PisellBatchActionBar_default from "../../../pisellBatchActionBar/PisellBatchActionBar.js";
|
|
3
|
+
import { useRecordBoardContext } from "../../hooks/useRecordBoardContext.js";
|
|
4
|
+
import React, { useCallback, useMemo } from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/pisellRecordBoard/shellFrame/BatchActionBar/index.tsx
|
|
7
|
+
function getRowKey(record, rowKey) {
|
|
8
|
+
var _ref, _record$id;
|
|
9
|
+
if (typeof rowKey === "function") return rowKey(record);
|
|
10
|
+
if (typeof rowKey === "string" && record != null && rowKey in record) return record[rowKey];
|
|
11
|
+
return (_ref = (_record$id = record === null || record === void 0 ? void 0 : record.id) !== null && _record$id !== void 0 ? _record$id : record === null || record === void 0 ? void 0 : record.key) !== null && _ref !== void 0 ? _ref : record;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* RecordBoard 下的多选操作栏:从 context 取选中态与数据,渲染 PisellBatchActionBar。
|
|
15
|
+
* 仅在有选中项时展示;全选/反选/清空基于当前页 data。
|
|
16
|
+
*/
|
|
17
|
+
const RecordBoardBatchActionBar = (props) => {
|
|
18
|
+
var _ctx$childComponentPr, _ctx$childComponentPr2;
|
|
19
|
+
const ctx = useRecordBoardContext({ displayName: "batchActionBar" });
|
|
20
|
+
const { data, total, selectedKeys, selectedRows, onSelectionChange, rowKey: rowKeyFromContext } = ctx;
|
|
21
|
+
const rowKey = rowKeyFromContext !== null && rowKeyFromContext !== void 0 ? rowKeyFromContext : "id";
|
|
22
|
+
const currentPageKeys = useMemo(() => data.map((record) => getRowKey(record, rowKey)), [data, rowKey]);
|
|
23
|
+
const currentPageTotal = data.length;
|
|
24
|
+
const barProps = _objectSpread2(_objectSpread2({
|
|
25
|
+
selectedKeys,
|
|
26
|
+
selectedRows,
|
|
27
|
+
total,
|
|
28
|
+
currentPageTotal,
|
|
29
|
+
currentPageKeys,
|
|
30
|
+
onSelectAll: useCallback(() => {
|
|
31
|
+
onSelectionChange(currentPageKeys, data);
|
|
32
|
+
}, [
|
|
33
|
+
currentPageKeys,
|
|
34
|
+
data,
|
|
35
|
+
onSelectionChange
|
|
36
|
+
]),
|
|
37
|
+
onClear: useCallback(() => {
|
|
38
|
+
onSelectionChange([], []);
|
|
39
|
+
}, [onSelectionChange]),
|
|
40
|
+
onInvert: useCallback(() => {
|
|
41
|
+
const currentSet = new Set(currentPageKeys);
|
|
42
|
+
const selectedSet = new Set(selectedKeys);
|
|
43
|
+
const nextKeys = [];
|
|
44
|
+
const nextRows = [];
|
|
45
|
+
currentPageKeys.forEach((k, i) => {
|
|
46
|
+
if (!selectedSet.has(k)) {
|
|
47
|
+
nextKeys.push(k);
|
|
48
|
+
nextRows.push(data[i]);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
const restSelectedKeys = selectedKeys.filter((k) => !currentSet.has(k));
|
|
52
|
+
const restSelectedRows = selectedRows.filter((_, i) => !currentSet.has(selectedKeys[i]));
|
|
53
|
+
onSelectionChange([...restSelectedKeys, ...nextKeys], [...restSelectedRows, ...nextRows]);
|
|
54
|
+
}, [
|
|
55
|
+
currentPageKeys,
|
|
56
|
+
data,
|
|
57
|
+
selectedKeys,
|
|
58
|
+
selectedRows,
|
|
59
|
+
onSelectionChange
|
|
60
|
+
])
|
|
61
|
+
}, (_ctx$childComponentPr = (_ctx$childComponentPr2 = ctx.childComponentProps) === null || _ctx$childComponentPr2 === void 0 ? void 0 : _ctx$childComponentPr2.batchActionBar) !== null && _ctx$childComponentPr !== void 0 ? _ctx$childComponentPr : {}), props);
|
|
62
|
+
if (selectedKeys.length === 0) return null;
|
|
63
|
+
return /* @__PURE__ */ React.createElement(PisellBatchActionBar_default, barProps);
|
|
64
|
+
};
|
|
65
|
+
RecordBoardBatchActionBar.displayName = "RecordBoard.BatchActionBar";
|
|
66
|
+
var BatchActionBar_default = RecordBoardBatchActionBar;
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
export { BatchActionBar_default as default };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { getText } from "../../../../locales/index.js";
|
|
2
|
+
import { getRecordBoardColumnKey } from "../../utils/recordBoardColumns.js";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { EyeInvisibleOutlined, EyeOutlined } from "@ant-design/icons";
|
|
6
|
+
|
|
7
|
+
//#region src/components/pisellRecordBoard/shellFrame/ColumnSetting/ColumnSettingPopover.tsx
|
|
8
|
+
/**
|
|
9
|
+
* 列显示隐藏弹层内容(仅控制列展示显隐,不控制 filter/sort)。
|
|
10
|
+
* 参考 table Actions ColumnsSetting PopoverContent,去掉拖拽排序。
|
|
11
|
+
*/
|
|
12
|
+
const prefix = "pisell-lowcode-";
|
|
13
|
+
function getColumnTitle(column) {
|
|
14
|
+
const title = column.title;
|
|
15
|
+
if (typeof title === "string") return title;
|
|
16
|
+
return getRecordBoardColumnKey(column) || "";
|
|
17
|
+
}
|
|
18
|
+
const ColumnSettingPopover = ({ columns, columnVisibility, onColumnVisibilityChange }) => {
|
|
19
|
+
const handleToggle = (colKey, isShow) => {
|
|
20
|
+
onColumnVisibilityChange({ [colKey]: isShow });
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ React.createElement("div", { className: `${prefix}table-action-column-popover-content-wrap` }, /* @__PURE__ */ React.createElement("div", { className: `${prefix}table-action-column-header` }, /* @__PURE__ */ React.createElement("span", { className: `${prefix}table-action-column-header-title` }, getText("table-action-column-title"))), /* @__PURE__ */ React.createElement("div", { className: `${prefix}table-action-column-content` }, columns.map((col) => {
|
|
23
|
+
const colKey = getRecordBoardColumnKey(col);
|
|
24
|
+
const isShow = columnVisibility[colKey] !== false;
|
|
25
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
26
|
+
key: colKey,
|
|
27
|
+
className: `${prefix}table-action-column-drag-item`,
|
|
28
|
+
style: { cursor: "default" }
|
|
29
|
+
}, /* @__PURE__ */ React.createElement("div", { className: `${prefix}table-action-column-drag-item-right` }, /* @__PURE__ */ React.createElement("span", { className: classNames(`${prefix}table-action-column-drag-item-right-text`, { [`${prefix}table-action-column-drag-item-right-text-hidden`]: !isShow }) }, getColumnTitle(col)), /* @__PURE__ */ React.createElement("span", {
|
|
30
|
+
className: `${prefix}table-action-column-drag-item-right-icon-wrap`,
|
|
31
|
+
onClick: () => handleToggle(colKey, !isShow),
|
|
32
|
+
role: "button",
|
|
33
|
+
"aria-label": isShow ? "hide" : "show"
|
|
34
|
+
}, isShow ? /* @__PURE__ */ React.createElement(EyeOutlined, null) : /* @__PURE__ */ React.createElement(EyeInvisibleOutlined, null))));
|
|
35
|
+
})));
|
|
36
|
+
};
|
|
37
|
+
var ColumnSettingPopover_default = ColumnSettingPopover;
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
export { ColumnSettingPopover_default as default };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { useRecordBoardContext } from "../../hooks/useRecordBoardContext.js";
|
|
2
|
+
import { getRecordBoardColumnKey } from "../../utils/recordBoardColumns.js";
|
|
3
|
+
import ColumnSettingPopover_default from "./ColumnSettingPopover.js";
|
|
4
|
+
import { Popover } from "antd";
|
|
5
|
+
import React, { useMemo } from "react";
|
|
6
|
+
import { EyeOutlined } from "@ant-design/icons";
|
|
7
|
+
import "./index.less";
|
|
8
|
+
|
|
9
|
+
//#region src/components/pisellRecordBoard/shellFrame/ColumnSetting/index.tsx
|
|
10
|
+
/**
|
|
11
|
+
* RecordBoard 列显示隐藏设置(仅控制表格列展示,不控制 filter/sort)。
|
|
12
|
+
* 参考 table Actions ColumnsSetting,仅保留显隐切换,无拖拽排序。
|
|
13
|
+
*/
|
|
14
|
+
const RecordBoardColumnSetting = () => {
|
|
15
|
+
var _ctx$childComponentPr, _ctx$columnVisibility;
|
|
16
|
+
const ctx = useRecordBoardContext({ displayName: "columnSetting" });
|
|
17
|
+
const gridColumns = (_ctx$childComponentPr = ctx.childComponentProps) === null || _ctx$childComponentPr === void 0 || (_ctx$childComponentPr = _ctx$childComponentPr.grid) === null || _ctx$childComponentPr === void 0 ? void 0 : _ctx$childComponentPr.columns;
|
|
18
|
+
const columnVisibility = (_ctx$columnVisibility = ctx.columnVisibility) !== null && _ctx$columnVisibility !== void 0 ? _ctx$columnVisibility : {};
|
|
19
|
+
const onColumnVisibilityChange = ctx.onColumnVisibilityChange;
|
|
20
|
+
const content = useMemo(() => {
|
|
21
|
+
if (!Array.isArray(gridColumns) || gridColumns.length === 0 || typeof onColumnVisibilityChange !== "function") return null;
|
|
22
|
+
return /* @__PURE__ */ React.createElement(ColumnSettingPopover_default, {
|
|
23
|
+
columns: gridColumns,
|
|
24
|
+
columnVisibility,
|
|
25
|
+
onColumnVisibilityChange
|
|
26
|
+
});
|
|
27
|
+
}, [
|
|
28
|
+
gridColumns,
|
|
29
|
+
columnVisibility,
|
|
30
|
+
onColumnVisibilityChange
|
|
31
|
+
]);
|
|
32
|
+
const hasHiddenColumns = useMemo(() => {
|
|
33
|
+
if (!Array.isArray(gridColumns)) return false;
|
|
34
|
+
return gridColumns.some((col) => columnVisibility[getRecordBoardColumnKey(col)] === false);
|
|
35
|
+
}, [gridColumns, columnVisibility]);
|
|
36
|
+
if (!content) return null;
|
|
37
|
+
return /* @__PURE__ */ React.createElement(Popover, {
|
|
38
|
+
content,
|
|
39
|
+
arrow: false,
|
|
40
|
+
placement: "bottomRight",
|
|
41
|
+
trigger: "click"
|
|
42
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
43
|
+
className: "record-board-toolbar-column-setting-btn",
|
|
44
|
+
style: {
|
|
45
|
+
display: "inline-flex",
|
|
46
|
+
alignItems: "center",
|
|
47
|
+
justifyContent: "center",
|
|
48
|
+
width: 32,
|
|
49
|
+
height: 32,
|
|
50
|
+
cursor: "pointer",
|
|
51
|
+
borderRadius: 6,
|
|
52
|
+
color: hasHiddenColumns ? "var(--color-primary, #1890ff)" : void 0
|
|
53
|
+
}
|
|
54
|
+
}, /* @__PURE__ */ React.createElement(EyeOutlined, { style: { fontSize: 18 } })));
|
|
55
|
+
};
|
|
56
|
+
RecordBoardColumnSetting.displayName = "RecordBoard.ColumnSetting";
|
|
57
|
+
var ColumnSetting_default = RecordBoardColumnSetting;
|
|
58
|
+
|
|
59
|
+
//#endregion
|
|
60
|
+
export { ColumnSetting_default as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RecordBoardContextValue } from "../../types.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import "./index.less";
|
|
4
|
+
|
|
5
|
+
//#region src/components/pisellRecordBoard/shellFrame/Pagination/index.d.ts
|
|
6
|
+
interface RecordBoardPaginationProps extends Partial<Pick<RecordBoardContextValue, 'pagination' | 'total' | 'onPageChange' | 'loading'>> {
|
|
7
|
+
className?: string;
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
render?: (ctx: RecordBoardContextValue) => React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* RecordBoard 下的分页:接入 packages/materials 的 Pagination,从 context 取 pagination / total / onPageChange;可透传 childComponentProps.pagination。
|
|
13
|
+
* 当 context 中 pagination 缺失时使用默认分页,避免在 Storybook 或未完整注入 context 时报错。
|
|
14
|
+
*/
|
|
15
|
+
declare const RecordBoardPagination: React.FC<RecordBoardPaginationProps>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { RecordBoardPagination };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.108.0/helpers/objectSpread2.js";
|
|
2
|
+
import { _objectWithoutProperties } from "../../../../_virtual/_@oxc-project_runtime@0.108.0/helpers/objectWithoutProperties.js";
|
|
3
|
+
import Pagination_default$1 from "../../../Pagination/index.js";
|
|
4
|
+
import { useRecordBoardContext } from "../../hooks/useRecordBoardContext.js";
|
|
5
|
+
import React, { useMemo } from "react";
|
|
6
|
+
import "./index.less";
|
|
7
|
+
|
|
8
|
+
//#region src/components/pisellRecordBoard/shellFrame/Pagination/index.tsx
|
|
9
|
+
const _excluded = ["render"];
|
|
10
|
+
const defaultPagination = {
|
|
11
|
+
pageNumber: 1,
|
|
12
|
+
pageSize: 10
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* RecordBoard 下的分页:接入 packages/materials 的 Pagination,从 context 取 pagination / total / onPageChange;可透传 childComponentProps.pagination。
|
|
16
|
+
* 当 context 中 pagination 缺失时使用默认分页,避免在 Storybook 或未完整注入 context 时报错。
|
|
17
|
+
*/
|
|
18
|
+
const RecordBoardPagination = (props) => {
|
|
19
|
+
var _ctx$pagination, _ctx$childComponentPr3;
|
|
20
|
+
const ctx = useRecordBoardContext({ displayName: "pagination" });
|
|
21
|
+
const { render } = props, rest = _objectWithoutProperties(props, _excluded);
|
|
22
|
+
const pagination = (_ctx$pagination = ctx.pagination) !== null && _ctx$pagination !== void 0 ? _ctx$pagination : defaultPagination;
|
|
23
|
+
const paginationProps = useMemo(() => {
|
|
24
|
+
var _ctx$childComponentPr, _ctx$childComponentPr2;
|
|
25
|
+
return _objectSpread2({
|
|
26
|
+
current: pagination.pageNumber,
|
|
27
|
+
pageSize: pagination.pageSize,
|
|
28
|
+
total: ctx.total,
|
|
29
|
+
onChange: ctx.onPageChange
|
|
30
|
+
}, (_ctx$childComponentPr = (_ctx$childComponentPr2 = ctx.childComponentProps) === null || _ctx$childComponentPr2 === void 0 ? void 0 : _ctx$childComponentPr2.pagination) !== null && _ctx$childComponentPr !== void 0 ? _ctx$childComponentPr : {});
|
|
31
|
+
}, [
|
|
32
|
+
pagination.pageNumber,
|
|
33
|
+
pagination.pageSize,
|
|
34
|
+
ctx.total,
|
|
35
|
+
ctx.onPageChange,
|
|
36
|
+
(_ctx$childComponentPr3 = ctx.childComponentProps) === null || _ctx$childComponentPr3 === void 0 ? void 0 : _ctx$childComponentPr3.pagination
|
|
37
|
+
]);
|
|
38
|
+
if (typeof render === "function") return /* @__PURE__ */ React.createElement(React.Fragment, null, render(_objectSpread2(_objectSpread2({}, ctx), rest)));
|
|
39
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
40
|
+
"data-layout-slot": "pagination",
|
|
41
|
+
className: "record-board-shell-frame-pagination",
|
|
42
|
+
style: {
|
|
43
|
+
marginTop: 16,
|
|
44
|
+
display: "flex",
|
|
45
|
+
justifyContent: "center"
|
|
46
|
+
}
|
|
47
|
+
}, /* @__PURE__ */ React.createElement(Pagination_default$1, paginationProps));
|
|
48
|
+
};
|
|
49
|
+
var Pagination_default = RecordBoardPagination;
|
|
50
|
+
|
|
51
|
+
//#endregion
|
|
52
|
+
export { Pagination_default as default };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RecordBoard ShellFrame 内分页样式,参考 orderList index.less:64
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
.record-board-shell-frame-pagination {
|
|
6
|
+
margin-top: 0;
|
|
7
|
+
|
|
8
|
+
.pisell-lowcode-pagination {
|
|
9
|
+
//border: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.pisell-lowcode-pagination-prev {
|
|
13
|
+
padding: 8px 14px;
|
|
14
|
+
height: 40px !important;
|
|
15
|
+
white-space: nowrap;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.pisell-lowcode-pagination-next {
|
|
19
|
+
padding: 8px 14px;
|
|
20
|
+
height: 40px !important;
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.pisell-lowcode-pagination-item {
|
|
25
|
+
padding: 10px 14px;
|
|
26
|
+
min-width: 40px;
|
|
27
|
+
height: 40px !important;
|
|
28
|
+
line-height: 20px !important;
|
|
29
|
+
|
|
30
|
+
& > a {
|
|
31
|
+
white-space: nowrap;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.pisell-lowcode-pagination-jump-prev,
|
|
36
|
+
.pisell-lowcode-pagination-jump-next {
|
|
37
|
+
display: flex;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
align-items: center;
|
|
40
|
+
min-width: 40px;
|
|
41
|
+
height: 40px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.pisell-lowcode-pagination-options {
|
|
45
|
+
margin-left: 30px;
|
|
46
|
+
|
|
47
|
+
.pisell-lowcode-select {
|
|
48
|
+
min-width: 80px;
|
|
49
|
+
height: 40px;
|
|
50
|
+
|
|
51
|
+
.pisell-lowcode-select-selector {
|
|
52
|
+
padding: 10px 14px;
|
|
53
|
+
height: 40px;
|
|
54
|
+
|
|
55
|
+
.pisell-lowcode-select-selection-search-input {
|
|
56
|
+
height: 100%;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/pisellRecordBoard/shellFrame/Search/index.d.ts
|
|
4
|
+
interface RecordBoardSearchProps {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* RecordBoard 下的独立搜索槽:使用 PisellFind,绑定 context.searchParams.keyword 与 onSearch。
|
|
9
|
+
* 可通过 childComponentProps.search 透传 PisellFind 的 props。
|
|
10
|
+
*/
|
|
11
|
+
declare const RecordBoardSearch: React.FC<RecordBoardSearchProps>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { RecordBoardSearch };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.108.0/helpers/objectSpread2.js";
|
|
2
|
+
import { PisellFind } from "../../../pisellFind/index.js";
|
|
3
|
+
import { useRecordBoardContext } from "../../hooks/useRecordBoardContext.js";
|
|
4
|
+
import React, { useCallback } from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/pisellRecordBoard/shellFrame/Search/index.tsx
|
|
7
|
+
/** 与 context.searchParams 对应的默认搜索参数字段名 */
|
|
8
|
+
const DEFAULT_SEARCH_FIELD = "keyword";
|
|
9
|
+
/**
|
|
10
|
+
* RecordBoard 下的独立搜索槽:使用 PisellFind,绑定 context.searchParams.keyword 与 onSearch。
|
|
11
|
+
* 可通过 childComponentProps.search 透传 PisellFind 的 props。
|
|
12
|
+
*/
|
|
13
|
+
const RecordBoardSearch = (props) => {
|
|
14
|
+
var _searchParams$DEFAULT;
|
|
15
|
+
const ctx = useRecordBoardContext({ displayName: "search" });
|
|
16
|
+
const { searchParams, onSearch } = ctx;
|
|
17
|
+
const searchProps = ctx;
|
|
18
|
+
const keyword = (_searchParams$DEFAULT = searchParams === null || searchParams === void 0 ? void 0 : searchParams[DEFAULT_SEARCH_FIELD]) !== null && _searchParams$DEFAULT !== void 0 ? _searchParams$DEFAULT : "";
|
|
19
|
+
const handleSearch = useCallback((value) => {
|
|
20
|
+
onSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, { [DEFAULT_SEARCH_FIELD]: value || void 0 }));
|
|
21
|
+
}, [onSearch, searchParams]);
|
|
22
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
23
|
+
"data-layout-slot": "search",
|
|
24
|
+
style: { marginBottom: 8 }
|
|
25
|
+
}, /* @__PURE__ */ React.createElement(PisellFind, _objectSpread2({
|
|
26
|
+
value: keyword,
|
|
27
|
+
onSearch: handleSearch
|
|
28
|
+
}, searchProps)));
|
|
29
|
+
};
|
|
30
|
+
RecordBoardSearch.displayName = "RecordBoard.Search";
|
|
31
|
+
var Search_default = RecordBoardSearch;
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
export { Search_default as default };
|