@pisell/materials 6.4.7 → 6.4.8
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 +7 -7
- package/build/lowcode/preview.js +6 -6
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +8 -8
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/components/batch-editor/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +11 -4
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.js +7 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +9 -10
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +11 -4
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +2 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +92 -6
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +12 -11
- package/es/components/date-picker/index.d.ts +1 -0
- package/es/components/filter/types.d.ts +1 -0
- package/es/components/page/index.d.ts +1 -0
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +1 -0
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.js +73 -5
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.less +39 -0
- package/es/components/productCard/cartSkuCard/index.js +2 -11
- package/es/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
- package/es/components/table/Table/SelectField/index.d.ts +1 -0
- package/es/components/table/Table/fields/index.d.ts +1 -0
- package/es/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
- package/es/components/table/Table/fields/text/Show/index.d.ts +1 -0
- package/es/components/table/Table/fields/text/index.d.ts +1 -0
- package/es/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/table/Table/utils.js +22 -1
- package/es/components/table/hooks/useTableSetting.d.ts +3 -4
- package/es/components/table/hooks/useTableSetting.js +113 -5
- package/es/components/table/index.js +14 -3
- package/es/components/table/types.d.ts +17 -0
- package/es/utils/index.d.ts +1 -1
- package/lib/components/batch-editor/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +8 -2
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.js +7 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +9 -10
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +11 -4
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +2 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +78 -7
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +12 -11
- package/lib/components/date-picker/index.d.ts +1 -0
- package/lib/components/filter/types.d.ts +1 -0
- package/lib/components/page/index.d.ts +1 -0
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +1 -0
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.js +45 -11
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.less +39 -0
- package/lib/components/productCard/cartSkuCard/index.js +2 -13
- package/lib/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
- package/lib/components/table/Table/SelectField/index.d.ts +1 -0
- package/lib/components/table/Table/fields/index.d.ts +1 -0
- package/lib/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
- package/lib/components/table/Table/fields/text/Show/index.d.ts +1 -0
- package/lib/components/table/Table/fields/text/index.d.ts +1 -0
- package/lib/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/table/Table/utils.js +18 -1
- package/lib/components/table/hooks/useTableSetting.d.ts +3 -4
- package/lib/components/table/hooks/useTableSetting.js +114 -4
- package/lib/components/table/index.js +12 -1
- package/lib/components/table/types.d.ts +17 -0
- package/lib/utils/index.d.ts +1 -1
- package/lowcode/data-source-table/meta.ts +239 -0
- package/lowcode/table/meta.ts +104 -0
- package/package.json +3 -3
- package/es/components/dataSourceComponents/dataSourceForm/BaseForm.d.ts +0 -3
- package/es/components/dataSourceComponents/fields/Upload/type.d.ts +0 -37
- package/es/components/drag-sort-tree/TreeItem/index.d.ts +0 -18
- package/es/components/iconfont/index.d.ts +0 -8
- package/es/components/pisell-config-provider/context.d.ts +0 -22
- package/es/components/pisell-config-provider/index.d.ts +0 -13
- package/es/components/pisellAdjustPrice/status.d.ts +0 -32
- package/es/components/pisellAdjustPrice/type.d.ts +0 -22
- package/es/components/pisellToast/squareToast/index.d.ts +0 -15
- package/es/components/pisellToast/squareToast/methods.d.ts +0 -13
- package/es/components/pisellToast/squareToast/renderImperatively.d.ts +0 -29
- package/es/components/pisellToast/squareToast/toast.d.ts +0 -25
- package/es/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +0 -3
- package/es/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +0 -14
- package/es/components/productCard/cartSkuCard/components/holders/index.d.ts +0 -3
- package/es/components/productCard/cartSkuCard/components/resources/index.d.ts +0 -3
- package/es/components/productCard/cartSkuCard/components/timeRange/index.d.ts +0 -6
- package/es/components/productCard/cartSkuCard/locales.d.ts +0 -96
- package/es/components/productCard/components/Action/index.d.ts +0 -3
- package/es/components/productCard/locales.d.ts +0 -84
- package/es/components/productCard/status.d.ts +0 -32
- package/es/components/productCard/types.d.ts +0 -84
- package/es/components/virtual-keyboard/Amount/themeConfig.d.ts +0 -32
- package/es/components/virtual-keyboard/Amount/types.d.ts +0 -44
- package/es/components/virtual-keyboard/Keyboard/index.d.ts +0 -21
- package/es/components/virtual-keyboard/Number/themeConfig.d.ts +0 -32
- package/es/components/virtual-keyboard/Number/types.d.ts +0 -26
- package/es/components/virtual-keyboard/VirtualKeyInput/index.d.ts +0 -13
- package/es/components/walletCard/Guide/index.d.ts +0 -3
- package/es/components/walletCard/index.d.ts +0 -67
- package/es/locales/en-US.d.ts +0 -285
- package/es/locales/zh-CN.d.ts +0 -280
- package/es/locales/zh-TW.d.ts +0 -280
- package/lib/components/dataSourceComponents/dataSourceForm/BaseForm.d.ts +0 -3
- package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +0 -37
- package/lib/components/drag-sort-tree/TreeItem/index.d.ts +0 -18
- package/lib/components/iconfont/index.d.ts +0 -8
- package/lib/components/pisell-config-provider/context.d.ts +0 -22
- package/lib/components/pisell-config-provider/index.d.ts +0 -13
- package/lib/components/pisellAdjustPrice/status.d.ts +0 -32
- package/lib/components/pisellAdjustPrice/type.d.ts +0 -22
- package/lib/components/pisellToast/squareToast/index.d.ts +0 -15
- package/lib/components/pisellToast/squareToast/methods.d.ts +0 -13
- package/lib/components/pisellToast/squareToast/renderImperatively.d.ts +0 -29
- package/lib/components/pisellToast/squareToast/toast.d.ts +0 -25
- package/lib/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +0 -3
- package/lib/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +0 -14
- package/lib/components/productCard/cartSkuCard/components/holders/index.d.ts +0 -3
- package/lib/components/productCard/cartSkuCard/components/resources/index.d.ts +0 -3
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.d.ts +0 -6
- package/lib/components/productCard/cartSkuCard/locales.d.ts +0 -96
- package/lib/components/productCard/components/Action/index.d.ts +0 -3
- package/lib/components/productCard/locales.d.ts +0 -84
- package/lib/components/productCard/status.d.ts +0 -32
- package/lib/components/productCard/types.d.ts +0 -84
- package/lib/components/virtual-keyboard/Amount/themeConfig.d.ts +0 -32
- package/lib/components/virtual-keyboard/Amount/types.d.ts +0 -44
- package/lib/components/virtual-keyboard/Keyboard/index.d.ts +0 -21
- package/lib/components/virtual-keyboard/Number/themeConfig.d.ts +0 -32
- package/lib/components/virtual-keyboard/Number/types.d.ts +0 -26
- package/lib/components/virtual-keyboard/VirtualKeyInput/index.d.ts +0 -13
- package/lib/components/walletCard/Guide/index.d.ts +0 -3
- package/lib/components/walletCard/index.d.ts +0 -67
- package/lib/locales/en-US.d.ts +0 -285
- package/lib/locales/zh-CN.d.ts +0 -280
- package/lib/locales/zh-TW.d.ts +0 -280
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const useDataSourceKey: () => {
|
|
2
|
-
dataSourceKey: string | undefined;
|
|
3
|
-
dataSourceKeyRef: import("react").MutableRefObject<string | undefined>;
|
|
2
|
+
dataSourceKey: string | import("../../provider/dataSource/DataSourceContext").DataSourceType | undefined;
|
|
3
|
+
dataSourceKeyRef: import("react").MutableRefObject<string | import("../../provider/dataSource/DataSourceContext").DataSourceType | undefined>;
|
|
4
4
|
};
|
|
5
5
|
export default useDataSourceKey;
|
|
@@ -8,7 +8,7 @@ declare const useDrawerState: (operationContent?: {
|
|
|
8
8
|
openDrawer: (item: OperationItem) => void;
|
|
9
9
|
closeDrawer: () => void;
|
|
10
10
|
drawerContent: import("react").ReactNode;
|
|
11
|
-
Container: {
|
|
11
|
+
Container: typeof Drawer | {
|
|
12
12
|
(props: import("../../../pisellModal").PisellModalProps): JSX.Element;
|
|
13
13
|
confirm: (props: import("../../../pisellModal/components/functions").PisellModalFuncProps) => {
|
|
14
14
|
destroy: () => void;
|
|
@@ -32,7 +32,7 @@ declare const useDrawerState: (operationContent?: {
|
|
|
32
32
|
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
33
33
|
};
|
|
34
34
|
Information: (props: import("../../../pisellModal/components/Information").InformationProps) => JSX.Element;
|
|
35
|
-
}
|
|
35
|
+
};
|
|
36
36
|
containerProps: {};
|
|
37
37
|
};
|
|
38
38
|
export default useDrawerState;
|
|
@@ -9,6 +9,7 @@ interface UseTablePropsProps {
|
|
|
9
9
|
refreshData: () => void;
|
|
10
10
|
handleFilterChange: (changedFields: any, allFields: any) => void;
|
|
11
11
|
tableRef: any;
|
|
12
|
+
getInitialValues: () => Record<string, any>;
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* 处理table的props
|
|
@@ -17,7 +18,8 @@ interface UseTablePropsProps {
|
|
|
17
18
|
* @returns
|
|
18
19
|
*/
|
|
19
20
|
declare const useTableProps: (props: UseTablePropsProps) => {
|
|
20
|
-
|
|
21
|
+
currentComponentId: any;
|
|
22
|
+
title: string | number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
|
|
21
23
|
pagination: {
|
|
22
24
|
total: number;
|
|
23
25
|
current: number;
|
|
@@ -26,11 +28,13 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
26
28
|
showSizeChanger: boolean;
|
|
27
29
|
};
|
|
28
30
|
columns: import("./useColumns").Column[];
|
|
29
|
-
subTitle: number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
|
|
31
|
+
subTitle: string | number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
|
|
30
32
|
buttons: any[] | null;
|
|
31
|
-
filter:
|
|
33
|
+
filter: any;
|
|
32
34
|
onRow: (record: any) => any;
|
|
33
35
|
actionButtons: any[] | null;
|
|
36
|
+
__id?: string | undefined;
|
|
37
|
+
currentSettingKey?: string | undefined;
|
|
34
38
|
titleButtons?: {
|
|
35
39
|
show: boolean;
|
|
36
40
|
maxCount: number;
|
|
@@ -42,12 +46,6 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
42
46
|
items: OperationItem[];
|
|
43
47
|
} | undefined;
|
|
44
48
|
operation?: {
|
|
45
|
-
/**
|
|
46
|
-
* 处理table的props
|
|
47
|
-
* 转换title
|
|
48
|
-
* @param props
|
|
49
|
-
* @returns
|
|
50
|
-
*/
|
|
51
49
|
show: boolean;
|
|
52
50
|
title: string;
|
|
53
51
|
width: number;
|
|
@@ -71,7 +69,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
71
69
|
useCustomAction: boolean;
|
|
72
70
|
actionType: string;
|
|
73
71
|
openMode: "modal" | "drawer";
|
|
74
|
-
openContentSize: "
|
|
72
|
+
openContentSize: "large" | "middle" | "small";
|
|
75
73
|
openTitle: string;
|
|
76
74
|
key: string;
|
|
77
75
|
} | undefined;
|
|
@@ -94,5 +92,6 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
94
92
|
create?: Record<string, any> | undefined;
|
|
95
93
|
destroy?: Record<string, any> | undefined;
|
|
96
94
|
} | undefined;
|
|
95
|
+
localSettings?: import("../../../table/types").LocalSettingsType | undefined;
|
|
97
96
|
};
|
|
98
97
|
export default useTableProps;
|
|
@@ -54,7 +54,8 @@ var useTableProps = (props) => {
|
|
|
54
54
|
closeDrawer,
|
|
55
55
|
refreshData,
|
|
56
56
|
handleFilterChange,
|
|
57
|
-
tableRef
|
|
57
|
+
tableRef,
|
|
58
|
+
getInitialValues
|
|
58
59
|
} = props;
|
|
59
60
|
const {
|
|
60
61
|
title: propsTitle,
|
|
@@ -66,7 +67,9 @@ var useTableProps = (props) => {
|
|
|
66
67
|
search,
|
|
67
68
|
clickToDetail,
|
|
68
69
|
onRow: propsOnRow,
|
|
69
|
-
filterBy
|
|
70
|
+
filterBy,
|
|
71
|
+
currentSettingKey,
|
|
72
|
+
__id
|
|
70
73
|
} = originProps;
|
|
71
74
|
const {
|
|
72
75
|
items,
|
|
@@ -260,16 +263,19 @@ var useTableProps = (props) => {
|
|
|
260
263
|
if (!(propsFilter == null ? void 0 : propsFilter.show) && !(search == null ? void 0 : search.show)) {
|
|
261
264
|
return null;
|
|
262
265
|
}
|
|
263
|
-
|
|
266
|
+
const dom = /* @__PURE__ */ import_react.default.createElement(
|
|
264
267
|
import_filter.default,
|
|
265
268
|
{
|
|
266
269
|
...propsFilter,
|
|
267
270
|
componentId,
|
|
268
271
|
search,
|
|
269
272
|
handleValuesChange: handleFilterChange,
|
|
270
|
-
filterBy
|
|
273
|
+
filterBy,
|
|
274
|
+
getInitialValues
|
|
271
275
|
}
|
|
272
276
|
);
|
|
277
|
+
dom.__proto__.items = propsFilter == null ? void 0 : propsFilter.items;
|
|
278
|
+
return dom;
|
|
273
279
|
}, [propsFilter, search]);
|
|
274
280
|
const onRow = (0, import_ahooks.useMemoizedFn)((record) => {
|
|
275
281
|
if (!(clickToDetail == null ? void 0 : clickToDetail.show)) {
|
|
@@ -300,6 +306,7 @@ var useTableProps = (props) => {
|
|
|
300
306
|
});
|
|
301
307
|
return {
|
|
302
308
|
...originProps,
|
|
309
|
+
currentComponentId: componentId,
|
|
303
310
|
title,
|
|
304
311
|
pagination,
|
|
305
312
|
columns,
|
|
@@ -11,7 +11,7 @@ declare type Params = {
|
|
|
11
11
|
sortBy: string;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
|
-
declare const useTableQuery: (props: DataSourceTableProps) => {
|
|
14
|
+
declare const useTableQuery: (props: DataSourceTableProps, currentSettingHash: string) => {
|
|
15
15
|
queryPageConfig: {
|
|
16
16
|
page: number;
|
|
17
17
|
pageSize: number;
|
|
@@ -28,5 +28,6 @@ declare const useTableQuery: (props: DataSourceTableProps) => {
|
|
|
28
28
|
refreshData: () => void;
|
|
29
29
|
handleFilterChange: (changedFields: any, allFields: any) => void;
|
|
30
30
|
refreshCurrentPage: () => void;
|
|
31
|
+
getInitialValues: () => Record<string, any>;
|
|
31
32
|
};
|
|
32
33
|
export default useTableQuery;
|
|
@@ -24,25 +24,61 @@ __export(useTableQuery_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(useTableQuery_exports);
|
|
25
25
|
var import_react = require("react");
|
|
26
26
|
var import_ahooks = require("ahooks");
|
|
27
|
-
var
|
|
27
|
+
var import_utils = require("../../../table/Table/utils");
|
|
28
|
+
var useTableQuery = (props, currentSettingHash) => {
|
|
28
29
|
var _a, _b, _c, _d;
|
|
29
|
-
const { filterBy, sortBy, tabs } = props;
|
|
30
|
+
const { filterBy, sortBy, tabs, localSettings } = props;
|
|
31
|
+
const tableId = (0, import_react.useMemo)(() => {
|
|
32
|
+
if (props.__designMode === "design") {
|
|
33
|
+
return "designMode-mock-table-id";
|
|
34
|
+
}
|
|
35
|
+
return (props == null ? void 0 : props.currentComponentId) || props.__id;
|
|
36
|
+
}, [props.__id, props.__designMode, props == null ? void 0 : props.currentComponentId]);
|
|
37
|
+
const currentViewMode = (0, import_react.useMemo)(() => (0, import_utils.getCurrentViewModeFromLocalStorage)(tableId) || "grid", [tableId]);
|
|
30
38
|
const [queryPageConfig, setQueryPageConfig] = (0, import_react.useState)({
|
|
31
39
|
page: 1,
|
|
32
40
|
pageSize: 20,
|
|
33
41
|
filter: ((_b = (_a = tabs == null ? void 0 : tabs.items) == null ? void 0 : _a[0]) == null ? void 0 : _b.filterBy) || filterBy || {},
|
|
34
42
|
sort: ((_d = (_c = tabs == null ? void 0 : tabs.items) == null ? void 0 : _c[0]) == null ? void 0 : _d.sortBy) || sortBy
|
|
35
43
|
});
|
|
44
|
+
const getInitialValues = (0, import_ahooks.useMemoizedFn)(() => {
|
|
45
|
+
try {
|
|
46
|
+
if (!tableId) return {};
|
|
47
|
+
const setting = (0, import_utils.getTableSettingByCurrentViewMode)(tableId, currentViewMode);
|
|
48
|
+
console.log("setting22", setting);
|
|
49
|
+
return (setting == null ? void 0 : setting.filters) || {};
|
|
50
|
+
} catch (e) {
|
|
51
|
+
return {};
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
(0, import_react.useEffect)(() => {
|
|
55
|
+
var _a2;
|
|
56
|
+
if (!tableId) return;
|
|
57
|
+
const enable = !!((localSettings == null ? void 0 : localSettings.enable) && ((_a2 = localSettings.scope) == null ? void 0 : _a2.includes("filters")));
|
|
58
|
+
if (!enable) return;
|
|
59
|
+
const setting = (0, import_utils.getTableSettingByCurrentViewMode)(tableId, currentViewMode);
|
|
60
|
+
const persisted = (setting == null ? void 0 : setting.filters) || {};
|
|
61
|
+
if (persisted && Object.keys(persisted).length > 0) {
|
|
62
|
+
setQueryPageConfig((prev) => ({
|
|
63
|
+
...prev,
|
|
64
|
+
filter: { ...prev.filter, ...persisted }
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
}, [tableId, currentViewMode, JSON.stringify(localSettings)]);
|
|
36
68
|
const handleValuesChange = (0, import_ahooks.useMemoizedFn)(
|
|
37
69
|
(params, allParams) => {
|
|
70
|
+
var _a2;
|
|
38
71
|
const { page, size } = params.pagination || {};
|
|
72
|
+
let nextFilterForSave = null;
|
|
39
73
|
setQueryPageConfig((prev) => {
|
|
40
|
-
var
|
|
74
|
+
var _a3, _b2, _c2;
|
|
41
75
|
let sort = prev.sort || sortBy;
|
|
42
76
|
let filter = prev.filter;
|
|
43
77
|
if ("tabs" in params) {
|
|
44
|
-
sort = ((
|
|
45
|
-
|
|
78
|
+
sort = ((_a3 = params.tabs) == null ? void 0 : _a3.sortBy) || sortBy || "";
|
|
79
|
+
const tabsFilter = ((_b2 = params.tabs) == null ? void 0 : _b2.filterBy) || {};
|
|
80
|
+
filter = { ...prev.filter, ...tabsFilter };
|
|
81
|
+
nextFilterForSave = filter;
|
|
46
82
|
}
|
|
47
83
|
if ("order_by" in params) {
|
|
48
84
|
sort = params.order_by || ((_c2 = allParams.tabs) == null ? void 0 : _c2.sortBy) || sortBy;
|
|
@@ -55,15 +91,49 @@ var useTableQuery = (props) => {
|
|
|
55
91
|
filter
|
|
56
92
|
};
|
|
57
93
|
});
|
|
94
|
+
const enable = !!((localSettings == null ? void 0 : localSettings.enable) && ((_a2 = localSettings.scope) == null ? void 0 : _a2.includes("filters")));
|
|
95
|
+
if (enable && tableId && nextFilterForSave) {
|
|
96
|
+
const excluded = new Set((localSettings == null ? void 0 : localSettings.excludedFilterFields) || []);
|
|
97
|
+
const filtered = {};
|
|
98
|
+
Object.keys(nextFilterForSave).forEach((k) => {
|
|
99
|
+
if (!excluded.has(k)) {
|
|
100
|
+
filtered[k] = nextFilterForSave[k];
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
(0, import_utils.setTableSettingToLocalStorage)({
|
|
104
|
+
tableId,
|
|
105
|
+
tableSettingObj: { filters: filtered },
|
|
106
|
+
currentViewMode,
|
|
107
|
+
currentSettingHash
|
|
108
|
+
});
|
|
109
|
+
}
|
|
58
110
|
}
|
|
59
111
|
);
|
|
60
112
|
const handleFilterChange = (0, import_ahooks.useMemoizedFn)(
|
|
61
113
|
(changedFields, allFields) => {
|
|
114
|
+
var _a2;
|
|
115
|
+
const nextFilter = { ...allFields };
|
|
62
116
|
setQueryPageConfig((prev) => ({
|
|
63
117
|
...prev,
|
|
64
118
|
page: 1,
|
|
65
|
-
filter: { ...prev.filter, ...
|
|
119
|
+
filter: { ...prev.filter, ...nextFilter, ...filterBy || {} }
|
|
66
120
|
}));
|
|
121
|
+
const enable = !!((localSettings == null ? void 0 : localSettings.enable) && ((_a2 = localSettings.scope) == null ? void 0 : _a2.includes("filters")));
|
|
122
|
+
if (enable && tableId) {
|
|
123
|
+
const excluded = new Set((localSettings == null ? void 0 : localSettings.excludedFilterFields) || []);
|
|
124
|
+
const filtered = {};
|
|
125
|
+
Object.keys(nextFilter || {}).forEach((k) => {
|
|
126
|
+
if (!excluded.has(k)) {
|
|
127
|
+
filtered[k] = nextFilter[k];
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
(0, import_utils.setTableSettingToLocalStorage)({
|
|
131
|
+
tableId,
|
|
132
|
+
tableSettingObj: { filters: filtered },
|
|
133
|
+
currentViewMode,
|
|
134
|
+
currentSettingHash
|
|
135
|
+
});
|
|
136
|
+
}
|
|
67
137
|
}
|
|
68
138
|
);
|
|
69
139
|
const refreshData = (0, import_ahooks.useMemoizedFn)(() => {
|
|
@@ -83,7 +153,8 @@ var useTableQuery = (props) => {
|
|
|
83
153
|
handleValuesChange,
|
|
84
154
|
refreshData,
|
|
85
155
|
handleFilterChange,
|
|
86
|
-
refreshCurrentPage
|
|
156
|
+
refreshCurrentPage,
|
|
157
|
+
getInitialValues
|
|
87
158
|
};
|
|
88
159
|
};
|
|
89
160
|
var useTableQuery_default = useTableQuery;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ColumnType } from 'antd/es/table';
|
|
3
|
+
import { LocalSettingsType } from '../../table/types';
|
|
3
4
|
import { DataSourceType } from '../provider/dataSource/DataSourceContext';
|
|
4
5
|
export declare type OperationItem = {
|
|
5
6
|
label?: string;
|
|
@@ -13,6 +14,9 @@ export declare type OperationItem = {
|
|
|
13
14
|
afterClose?: () => void;
|
|
14
15
|
};
|
|
15
16
|
export interface DataSourceTableProps {
|
|
17
|
+
__id?: string;
|
|
18
|
+
currentComponentId?: string;
|
|
19
|
+
currentSettingKey?: string;
|
|
16
20
|
title?: string | React.ReactNode | (() => React.ReactNode);
|
|
17
21
|
subTitle?: string | React.ReactNode | (() => React.ReactNode);
|
|
18
22
|
titleButtons?: {
|
|
@@ -76,4 +80,5 @@ export interface DataSourceTableProps {
|
|
|
76
80
|
create?: Record<string, any>;
|
|
77
81
|
destroy?: Record<string, any>;
|
|
78
82
|
};
|
|
83
|
+
localSettings?: LocalSettingsType;
|
|
79
84
|
}
|
|
@@ -15,4 +15,4 @@ export declare const getFileMetadataParams: (file: RcFile & {
|
|
|
15
15
|
metadata?: MediaMetadata;
|
|
16
16
|
}) => Record<string, any>;
|
|
17
17
|
export declare const isValueEqual: (value: any, fileListValue: any) => boolean;
|
|
18
|
-
export declare const getBaseTime: (size: number) =>
|
|
18
|
+
export declare const getBaseTime: (size: number) => 1000 | 2000 | 4000 | 8000;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
declare const formFieldMap: {
|
|
2
3
|
FormItemCheckbox: import("react").FC<{}> & {
|
|
3
4
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
@@ -19,7 +20,7 @@ declare const formFieldMap: {
|
|
|
19
20
|
Subdomain: import("react").FC<import("antd").InputProps & {
|
|
20
21
|
onChange: (value: string) => void;
|
|
21
22
|
onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
22
|
-
rootDomain: "custom" | "
|
|
23
|
+
rootDomain: "custom" | "xzero" | "saas";
|
|
23
24
|
customDomain?: string | undefined;
|
|
24
25
|
value?: string | undefined;
|
|
25
26
|
tenantId: string;
|
|
@@ -59,13 +60,7 @@ declare const formFieldMap: {
|
|
|
59
60
|
FormItemTranslation: import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
60
61
|
FormItemIconSelect: import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
61
62
|
};
|
|
62
|
-
declare const getFieldComponent: (fieldComponent: string) => import("react").FC<any> | import("react").FC<import("./
|
|
63
|
-
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
64
|
-
} & {
|
|
65
|
-
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
66
|
-
}) | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<(import("antd").DatePickerProps & import("../dataSourceForm/utils").WithModeProps) & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & {
|
|
67
|
-
onChange: (value: string) => void;
|
|
68
|
-
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Phone/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Mobile/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<import("./Input/type").InputProps> & {
|
|
63
|
+
declare const getFieldComponent: (fieldComponent: string) => import("react").FC<any> | (import("react").FC<import("./Input/type").InputProps> & {
|
|
69
64
|
JSON: import("react").FC<any>;
|
|
70
65
|
Password: import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
71
66
|
TextArea: import("react").FC<import("antd/es/input").TextAreaProps & import("react").RefAttributes<import("antd/es/input/TextArea").TextAreaRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
@@ -78,14 +73,18 @@ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<
|
|
|
78
73
|
Subdomain: import("react").FC<import("antd").InputProps & {
|
|
79
74
|
onChange: (value: string) => void;
|
|
80
75
|
onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
81
|
-
rootDomain: "custom" | "
|
|
76
|
+
rootDomain: "custom" | "xzero" | "saas";
|
|
82
77
|
customDomain?: string | undefined;
|
|
83
78
|
value?: string | undefined;
|
|
84
79
|
tenantId: string;
|
|
85
80
|
name?: string | undefined;
|
|
86
81
|
fieldKey?: string | undefined;
|
|
87
82
|
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
88
|
-
}) |
|
|
83
|
+
}) | (import("react").FC<{}> & {
|
|
84
|
+
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
85
|
+
} & {
|
|
86
|
+
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
87
|
+
}) | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<(import("antd").DatePickerProps & import("../dataSourceForm/utils").WithModeProps) & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<{}> & {
|
|
89
88
|
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
90
89
|
} & {
|
|
91
90
|
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
@@ -97,5 +96,7 @@ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<
|
|
|
97
96
|
extraParams?: Record<string, any> | undefined;
|
|
98
97
|
} & {
|
|
99
98
|
dataSource?: any;
|
|
100
|
-
}) => JSX.Element) | import("react").FC<import("./TimePicker/type").TimePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./
|
|
99
|
+
}) => JSX.Element) | import("react").FC<import("./TimePicker/type").TimePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Phone/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Mobile/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & {
|
|
100
|
+
onChange: (value: string) => void;
|
|
101
|
+
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./DateRangePicker/type").DateRangePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Upload/type").UploadProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
101
102
|
export { getFieldComponent, formFieldMap };
|
|
@@ -110,17 +110,26 @@ var SwipeAction = (0, import_react.forwardRef)(
|
|
|
110
110
|
const rootRef = (0, import_react.useRef)(null);
|
|
111
111
|
const leftRef = (0, import_react.useRef)(null);
|
|
112
112
|
const rightRef = (0, import_react.useRef)(null);
|
|
113
|
+
const [containerHeight, setContainerHeight] = (0, import_react.useState)(0);
|
|
113
114
|
function getWidth(ref2) {
|
|
114
115
|
const element = ref2.current;
|
|
115
116
|
if (!element) return 0;
|
|
116
117
|
return element.offsetWidth;
|
|
117
118
|
}
|
|
119
|
+
function getHeight(ref2) {
|
|
120
|
+
const element = ref2.current;
|
|
121
|
+
if (!element) return 0;
|
|
122
|
+
return element.offsetHeight;
|
|
123
|
+
}
|
|
118
124
|
function getLeftWidth() {
|
|
119
125
|
return getWidth(leftRef);
|
|
120
126
|
}
|
|
121
127
|
function getRightWidth() {
|
|
122
128
|
return getWidth(rightRef);
|
|
123
129
|
}
|
|
130
|
+
function getRootHeight() {
|
|
131
|
+
return getHeight(rootRef);
|
|
132
|
+
}
|
|
124
133
|
const [{ x }, api] = (0, import_web.useSpring)(
|
|
125
134
|
() => ({
|
|
126
135
|
x: 0,
|
|
@@ -213,6 +222,20 @@ var SwipeAction = (0, import_react.forwardRef)(
|
|
|
213
222
|
},
|
|
214
223
|
close
|
|
215
224
|
}));
|
|
225
|
+
(0, import_react.useEffect)(() => {
|
|
226
|
+
const updateHeight = () => {
|
|
227
|
+
const height = getRootHeight();
|
|
228
|
+
setContainerHeight(height);
|
|
229
|
+
};
|
|
230
|
+
updateHeight();
|
|
231
|
+
const resizeObserver = new ResizeObserver(updateHeight);
|
|
232
|
+
if (rootRef.current) {
|
|
233
|
+
resizeObserver.observe(rootRef.current);
|
|
234
|
+
}
|
|
235
|
+
return () => {
|
|
236
|
+
resizeObserver.disconnect();
|
|
237
|
+
};
|
|
238
|
+
}, []);
|
|
216
239
|
(0, import_react.useEffect)(() => {
|
|
217
240
|
if (!props.closeOnTouchOutside) return;
|
|
218
241
|
function handle(e) {
|
|
@@ -238,14 +261,32 @@ var SwipeAction = (0, import_react.forwardRef)(
|
|
|
238
261
|
document.removeEventListener("mousedown", handle);
|
|
239
262
|
};
|
|
240
263
|
}, [props.closeOnTouchOutside, props.escapeDom]);
|
|
241
|
-
|
|
264
|
+
const getRightContainerClass = () => {
|
|
265
|
+
const baseClass = `${classPrefix}-actions ${classPrefix}-actions-right`;
|
|
266
|
+
if (containerHeight > 180) {
|
|
267
|
+
return `${baseClass} ${classPrefix}-height-large`;
|
|
268
|
+
} else if (containerHeight > 120) {
|
|
269
|
+
return `${baseClass} ${classPrefix}-height-medium`;
|
|
270
|
+
}
|
|
271
|
+
return `${baseClass} ${classPrefix}-height-small`;
|
|
272
|
+
};
|
|
273
|
+
const getRightActionButtonClass = () => {
|
|
274
|
+
if (containerHeight > 180) {
|
|
275
|
+
return `${classPrefix}-action-height-large`;
|
|
276
|
+
} else if (containerHeight > 120) {
|
|
277
|
+
return `${classPrefix}-action-height-medium`;
|
|
278
|
+
}
|
|
279
|
+
return `${classPrefix}-action-height-small`;
|
|
280
|
+
};
|
|
281
|
+
function renderAction(action, isRightAction = false) {
|
|
242
282
|
const color = action.color ?? "light";
|
|
243
283
|
const _style = action.style || {};
|
|
284
|
+
const buttonClass = isRightAction ? `${classPrefix}-action-button ${getRightActionButtonClass()}` : `${classPrefix}-action-button`;
|
|
244
285
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
245
286
|
Button,
|
|
246
287
|
{
|
|
247
288
|
key: action.key,
|
|
248
|
-
className:
|
|
289
|
+
className: buttonClass,
|
|
249
290
|
style: {
|
|
250
291
|
"--background-color": colorRecord[color] ?? color,
|
|
251
292
|
..._style
|
|
@@ -285,7 +326,7 @@ var SwipeAction = (0, import_react.forwardRef)(
|
|
|
285
326
|
className: `${classPrefix}-actions ${classPrefix}-actions-left`,
|
|
286
327
|
ref: leftRef
|
|
287
328
|
},
|
|
288
|
-
props.leftActions.map(renderAction)
|
|
329
|
+
props.leftActions.map((action) => renderAction(action, false))
|
|
289
330
|
)
|
|
290
331
|
), /* @__PURE__ */ import_react.default.createElement(
|
|
291
332
|
"div",
|
|
@@ -312,14 +353,7 @@ var SwipeAction = (0, import_react.forwardRef)(
|
|
|
312
353
|
)
|
|
313
354
|
), withStopPropagation(
|
|
314
355
|
props.stopPropagation,
|
|
315
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
316
|
-
"div",
|
|
317
|
-
{
|
|
318
|
-
className: `${classPrefix}-actions ${classPrefix}-actions-right`,
|
|
319
|
-
ref: rightRef
|
|
320
|
-
},
|
|
321
|
-
props.rightActions.map(renderAction)
|
|
322
|
-
)
|
|
356
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: getRightContainerClass(), ref: rightRef }, props.rightActions.map((action) => renderAction(action, true)))
|
|
323
357
|
))
|
|
324
358
|
)
|
|
325
359
|
);
|
|
@@ -33,3 +33,42 @@
|
|
|
33
33
|
padding-right: 4px;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
+
|
|
37
|
+
.pisell-custom-swipe-action-action-button {
|
|
38
|
+
min-width: 80px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* 容器样式 */
|
|
42
|
+
.pisell-custom-swipe-action-height-large {
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
background-color: rgba(67, 93, 147, 0.3);
|
|
46
|
+
justify-content: flex-start;
|
|
47
|
+
|
|
48
|
+
.pisell-number-selector-btn {
|
|
49
|
+
width: 40px !important;
|
|
50
|
+
height: 40px !important;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.pisell-custom-swipe-action-height-medium {
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
background-color: rgba(67, 93, 147, 0.3);
|
|
58
|
+
|
|
59
|
+
.pisell-number-selector-btn {
|
|
60
|
+
width: 40px !important;
|
|
61
|
+
height: 40px !important;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* 按钮样式 */
|
|
66
|
+
.pisell-custom-swipe-action-action-height-large {
|
|
67
|
+
height: 60px;
|
|
68
|
+
width: 200px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.pisell-custom-swipe-action-action-height-medium {
|
|
72
|
+
flex: 1;
|
|
73
|
+
width: 200px;
|
|
74
|
+
}
|
|
@@ -199,7 +199,7 @@ var CartSkuCard = (props) => {
|
|
|
199
199
|
}
|
|
200
200
|
return renderA2();
|
|
201
201
|
};
|
|
202
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
202
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
203
203
|
import_swipeAction.SwipeAction,
|
|
204
204
|
{
|
|
205
205
|
closeOnAction: false,
|
|
@@ -219,18 +219,7 @@ var CartSkuCard = (props) => {
|
|
|
219
219
|
},
|
|
220
220
|
renderContent()
|
|
221
221
|
)
|
|
222
|
-
)
|
|
223
|
-
"div",
|
|
224
|
-
{
|
|
225
|
-
className: (0, import_classnames.default)(PREFIX, `${PREFIX}-${type}`),
|
|
226
|
-
onClick: (e) => {
|
|
227
|
-
e.preventDefault();
|
|
228
|
-
e.stopPropagation();
|
|
229
|
-
onCard == null ? void 0 : onCard(dataSource);
|
|
230
|
-
}
|
|
231
|
-
},
|
|
232
|
-
renderContent()
|
|
233
|
-
)));
|
|
222
|
+
);
|
|
234
223
|
};
|
|
235
224
|
var cartSkuCard_default = CartSkuCard;
|
|
236
225
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -155,7 +155,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
|
|
|
155
155
|
sort?: SortType | undefined;
|
|
156
156
|
mode: "" | "localStorage" | "remote";
|
|
157
157
|
currentViewMode: ModeType;
|
|
158
|
-
}) => ("
|
|
158
|
+
}) => ("filters" | "order_by" | "group_by" | "column_setting" | "gallery_setting" | "filter_setting" | "view_mode")[];
|
|
159
159
|
export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
|
|
160
160
|
export declare const stringify: (obj: Record<string, any>) => string;
|
|
161
161
|
export {};
|