@pisell/materials 1.0.283 → 1.0.285
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 +8 -8
- package/build/lowcode/render/default/view.js +11 -11
- package/build/lowcode/view.js +10 -10
- package/es/components/Pagination/index.d.ts +1 -1
- package/es/components/Pagination/index.js +4 -4
- package/es/components/filter/index.js +2 -3
- package/es/components/filter/types.d.ts +1 -0
- package/es/components/table/Actions/index.js +4 -3
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/table/hooks/useIsMobileTable.d.ts +2 -0
- package/es/components/table/hooks/useIsMobileTable.js +9 -0
- package/es/components/table/index.js +11 -0
- package/es/components/table/model.d.ts +1 -0
- package/es/components/table/model.js +7 -1
- package/lib/components/Pagination/index.d.ts +1 -1
- package/lib/components/Pagination/index.js +4 -4
- package/lib/components/filter/index.js +1 -3
- package/lib/components/filter/types.d.ts +1 -0
- package/lib/components/table/Actions/index.js +4 -3
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/table/hooks/useIsMobileTable.d.ts +2 -0
- package/lib/components/table/hooks/useIsMobileTable.js +32 -0
- package/lib/components/table/index.js +10 -0
- package/lib/components/table/model.d.ts +1 -0
- package/lib/components/table/model.js +5 -1
- package/lowcode/drawer/meta.ts +1 -1
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ export declare const paginationConfig: {
|
|
|
5
5
|
className: string;
|
|
6
6
|
defaultCurrent: number;
|
|
7
7
|
showTotal: (total: number, range: [number, number]) => string;
|
|
8
|
-
itemRender: (page: number, type: "
|
|
8
|
+
itemRender: (page: number, type: "next" | "page" | "prev" | "jump-prev" | "jump-next", element: React.ReactNode) => React.ReactNode;
|
|
9
9
|
responsive: boolean;
|
|
10
10
|
size: string;
|
|
11
11
|
};
|
|
@@ -14,9 +14,9 @@ import ArrowRight from "@pisell/icon/es/ArrowRight";
|
|
|
14
14
|
import ArrowLeft from "@pisell/icon/es/ArrowLeft";
|
|
15
15
|
import { Pagination as OriginPagination } from "antd";
|
|
16
16
|
import classNames from "classnames";
|
|
17
|
-
import { useResponsive } from "../../hooks";
|
|
18
17
|
import "./index.less";
|
|
19
18
|
import { getText } from "../../locales";
|
|
19
|
+
import useIsMobileTable from "../table/hooks/useIsMobileTable";
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* @title: 自定义渲染
|
|
@@ -59,21 +59,21 @@ export var paginationConfig = {
|
|
|
59
59
|
size: "small"
|
|
60
60
|
};
|
|
61
61
|
var Pagination = function Pagination(props) {
|
|
62
|
-
var responsive = useResponsive();
|
|
63
62
|
var show = useMemo(function () {
|
|
64
63
|
return Object.keys(props).length;
|
|
65
64
|
}, [props]);
|
|
65
|
+
var isMiniPagination = useIsMobileTable();
|
|
66
66
|
var content = useMemo(function () {
|
|
67
67
|
if (!show) {
|
|
68
68
|
return null;
|
|
69
69
|
}
|
|
70
70
|
var Com = OriginPagination;
|
|
71
71
|
// 移动端使用简单分页
|
|
72
|
-
if (
|
|
72
|
+
if (isMiniPagination) {
|
|
73
73
|
Com = MiniPagination;
|
|
74
74
|
}
|
|
75
75
|
return /*#__PURE__*/React.createElement(Com, _extends({}, paginationConfig, props));
|
|
76
|
-
}, [show, paginationConfig, props,
|
|
76
|
+
}, [show, paginationConfig, props, isMiniPagination]);
|
|
77
77
|
return content;
|
|
78
78
|
};
|
|
79
79
|
export default Pagination;
|
|
@@ -8,13 +8,13 @@ import React, { useEffect, useMemo } from "react";
|
|
|
8
8
|
import { Form } from "antd";
|
|
9
9
|
import FilterButton from "./components/FilterButton";
|
|
10
10
|
import QuickFilter from "./components/QuickFilter";
|
|
11
|
-
import { isMobile } from "../../utils/platform";
|
|
12
11
|
var formFiltersPrefix = "filters";
|
|
13
12
|
var Filter = function Filter(props) {
|
|
14
13
|
var filter = props.filter,
|
|
15
14
|
_props$isRenderFormCo = props.isRenderFormContent,
|
|
16
15
|
isRenderFormContent = _props$isRenderFormCo === void 0 ? true : _props$isRenderFormCo,
|
|
17
|
-
onValuesChange = props.onValuesChange
|
|
16
|
+
onValuesChange = props.onValuesChange,
|
|
17
|
+
isMobileBool = props.isMobile;
|
|
18
18
|
var _ref = filter || {},
|
|
19
19
|
show = _ref.show,
|
|
20
20
|
quickFilterMaxLength = _ref.quickFilterMaxLength,
|
|
@@ -23,7 +23,6 @@ var Filter = function Filter(props) {
|
|
|
23
23
|
var _Form$useForm = Form.useForm(),
|
|
24
24
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
25
25
|
form = _Form$useForm2[0];
|
|
26
|
-
var isMobileBool = isMobile();
|
|
27
26
|
var isShowQuickFilter = useMemo(function () {
|
|
28
27
|
// 移动端 并且 开启filter按钮 并且 开启filter排序时 不显示快速筛选
|
|
29
28
|
if (isMobileBool && show && sortButtonShow) {
|
|
@@ -8,7 +8,7 @@ import Buttons from "../Header/Buttons";
|
|
|
8
8
|
import ViewMode from "./component/ViewMode";
|
|
9
9
|
import GallerySetting from "./component/GallerySetting";
|
|
10
10
|
import "./index.less";
|
|
11
|
-
import
|
|
11
|
+
import useIsMobileTable from "../hooks/useIsMobileTable";
|
|
12
12
|
var Actions = function Actions(_ref) {
|
|
13
13
|
var filter = _ref.filter,
|
|
14
14
|
sort = _ref.sort,
|
|
@@ -20,6 +20,7 @@ var Actions = function Actions(_ref) {
|
|
|
20
20
|
view = _ref.view,
|
|
21
21
|
gallery = _ref.gallery;
|
|
22
22
|
var form = Form.useFormInstance();
|
|
23
|
+
var isMobileBool = useIsMobileTable();
|
|
23
24
|
var viewMode = Form.useWatch("view_mode", {
|
|
24
25
|
form: form,
|
|
25
26
|
preserve: true
|
|
@@ -27,7 +28,6 @@ var Actions = function Actions(_ref) {
|
|
|
27
28
|
var showActions = useMemo(function () {
|
|
28
29
|
return (filter === null || filter === void 0 ? void 0 : filter.show) || (sort === null || sort === void 0 ? void 0 : sort.show) || (columnSetting === null || columnSetting === void 0 ? void 0 : columnSetting.show) || (dataSourceGroup === null || dataSourceGroup === void 0 ? void 0 : dataSourceGroup.show) || view.multiple;
|
|
29
30
|
}, [filter === null || filter === void 0 ? void 0 : filter.show, sort === null || sort === void 0 ? void 0 : sort.show, columnSetting === null || columnSetting === void 0 ? void 0 : columnSetting.show, dataSourceGroup === null || dataSourceGroup === void 0 ? void 0 : dataSourceGroup.show, view.multiple]);
|
|
30
|
-
var isMobileBool = isMobile();
|
|
31
31
|
return showActions ? /*#__PURE__*/React.createElement("div", {
|
|
32
32
|
className: "materials-grid-actions"
|
|
33
33
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -36,7 +36,8 @@ var Actions = function Actions(_ref) {
|
|
|
36
36
|
filter: filter,
|
|
37
37
|
isRenderFormContent: false,
|
|
38
38
|
tableId: tableId,
|
|
39
|
-
viewMode: viewMode
|
|
39
|
+
viewMode: viewMode,
|
|
40
|
+
isMobile: isMobileBool
|
|
40
41
|
})), /*#__PURE__*/React.createElement("div", {
|
|
41
42
|
className: "right-wrap",
|
|
42
43
|
style: {
|
|
@@ -158,7 +158,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
|
|
|
158
158
|
sort?: SortType | undefined;
|
|
159
159
|
mode: "" | "localStorage" | "remote";
|
|
160
160
|
currentViewMode: ModeType;
|
|
161
|
-
}) => ("
|
|
161
|
+
}) => ("filter_setting" | "column_setting" | "gallery_setting" | "view_mode" | "group_by" | "order_by")[];
|
|
162
162
|
export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
|
|
163
163
|
export declare const stringify: (obj: Record<string, any>) => string;
|
|
164
164
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useSharedState } from "../../../hooks";
|
|
2
|
+
import { Context } from "../model";
|
|
3
|
+
var useIsMobileTable = function useIsMobileTable() {
|
|
4
|
+
var modal = useSharedState(Context);
|
|
5
|
+
var _ref = (modal === null || modal === void 0 ? void 0 : modal.state) || {},
|
|
6
|
+
tableWidth = _ref.tableWidth;
|
|
7
|
+
return !!(tableWidth && (tableWidth || 0) < 600);
|
|
8
|
+
};
|
|
9
|
+
export default useIsMobileTable;
|
|
@@ -16,6 +16,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
16
16
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
17
17
|
import React, { useEffect, useImperativeHandle, useMemo, forwardRef, useRef } from "react";
|
|
18
18
|
import { Form } from "antd";
|
|
19
|
+
import { useSize } from "ahooks";
|
|
19
20
|
import View from "./View";
|
|
20
21
|
import Header from "./Header";
|
|
21
22
|
import Actions from "./Actions";
|
|
@@ -70,6 +71,8 @@ var GridView = Provider( /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
70
71
|
var tableSettingRef = useRef({});
|
|
71
72
|
var filterDefaultRef = useRef({});
|
|
72
73
|
var initialValuesRef = useRef({});
|
|
74
|
+
var _ref = useSize(wrapRef) || {},
|
|
75
|
+
width = _ref.width;
|
|
73
76
|
var utils = context === null || context === void 0 ? void 0 : (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils;
|
|
74
77
|
var tableId = useMemo(function () {
|
|
75
78
|
if (props.__designMode === "design") {
|
|
@@ -128,6 +131,14 @@ var GridView = Provider( /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
128
131
|
*/
|
|
129
132
|
}
|
|
130
133
|
}, [currentSettingHash, tableId]);
|
|
134
|
+
useEffect(function () {
|
|
135
|
+
if (width) {
|
|
136
|
+
modal.dispatch({
|
|
137
|
+
type: "setTableWidth",
|
|
138
|
+
payload: width || {}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}, [width]);
|
|
131
142
|
var _useTableSetting = useTableSetting({
|
|
132
143
|
tableId: tableId,
|
|
133
144
|
filter: filter,
|
|
@@ -13,6 +13,7 @@ interface FormState {
|
|
|
13
13
|
otherFilter: FilterItemProps[];
|
|
14
14
|
utils: any;
|
|
15
15
|
localPagination: boolean;
|
|
16
|
+
tableWidth: number;
|
|
16
17
|
}
|
|
17
18
|
export declare const Provider: (ComponentUi: any) => (props: any, ref: any) => import("react").JSX.Element, Context: import("react").Context<{
|
|
18
19
|
state: FormState;
|
|
@@ -28,7 +28,8 @@ var defaultState = {
|
|
|
28
28
|
data: {
|
|
29
29
|
edit: 0
|
|
30
30
|
}
|
|
31
|
-
}
|
|
31
|
+
},
|
|
32
|
+
tableWidth: 500
|
|
32
33
|
};
|
|
33
34
|
var _getContext = getContext({
|
|
34
35
|
namespace: "state",
|
|
@@ -99,6 +100,11 @@ var _getContext = getContext({
|
|
|
99
100
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
100
101
|
localPagination: payload
|
|
101
102
|
});
|
|
103
|
+
},
|
|
104
|
+
setTableWidth: function setTableWidth(state, payload) {
|
|
105
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
106
|
+
tableWidth: payload
|
|
107
|
+
});
|
|
102
108
|
}
|
|
103
109
|
}
|
|
104
110
|
}),
|
|
@@ -5,7 +5,7 @@ export declare const paginationConfig: {
|
|
|
5
5
|
className: string;
|
|
6
6
|
defaultCurrent: number;
|
|
7
7
|
showTotal: (total: number, range: [number, number]) => string;
|
|
8
|
-
itemRender: (page: number, type: "
|
|
8
|
+
itemRender: (page: number, type: "next" | "page" | "prev" | "jump-prev" | "jump-next", element: React.ReactNode) => React.ReactNode;
|
|
9
9
|
responsive: boolean;
|
|
10
10
|
size: string;
|
|
11
11
|
};
|
|
@@ -39,9 +39,9 @@ var import_ArrowRight = __toESM(require("@pisell/icon/es/ArrowRight"));
|
|
|
39
39
|
var import_ArrowLeft = __toESM(require("@pisell/icon/es/ArrowLeft"));
|
|
40
40
|
var import_antd = require("antd");
|
|
41
41
|
var import_classnames = __toESM(require("classnames"));
|
|
42
|
-
var import_hooks = require("../../hooks");
|
|
43
42
|
var import_index = require("./index.less");
|
|
44
43
|
var import_locales = require("../../locales");
|
|
44
|
+
var import_useIsMobileTable = __toESM(require("../table/hooks/useIsMobileTable"));
|
|
45
45
|
var itemRender = (_, type, originalElement) => {
|
|
46
46
|
if (type === "prev") {
|
|
47
47
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("paginator-page-btn", "left") }, /* @__PURE__ */ import_react.default.createElement(import_ArrowLeft.default, { className: "paginator-page-btn-left-icon" }), /* @__PURE__ */ import_react.default.createElement("span", { className: "paginator-page-btn-text" }, (0, import_locales.getText)("table-pagination-previous")));
|
|
@@ -60,20 +60,20 @@ var paginationConfig = {
|
|
|
60
60
|
size: "small"
|
|
61
61
|
};
|
|
62
62
|
var Pagination = (props) => {
|
|
63
|
-
const responsive = (0, import_hooks.useResponsive)();
|
|
64
63
|
const show = (0, import_react.useMemo)(() => {
|
|
65
64
|
return Object.keys(props).length;
|
|
66
65
|
}, [props]);
|
|
66
|
+
const isMiniPagination = (0, import_useIsMobileTable.default)();
|
|
67
67
|
const content = (0, import_react.useMemo)(() => {
|
|
68
68
|
if (!show) {
|
|
69
69
|
return null;
|
|
70
70
|
}
|
|
71
71
|
let Com = import_antd.Pagination;
|
|
72
|
-
if (
|
|
72
|
+
if (isMiniPagination) {
|
|
73
73
|
Com = MiniPagination;
|
|
74
74
|
}
|
|
75
75
|
return /* @__PURE__ */ import_react.default.createElement(Com, { ...paginationConfig, ...props });
|
|
76
|
-
}, [show, paginationConfig, props,
|
|
76
|
+
}, [show, paginationConfig, props, isMiniPagination]);
|
|
77
77
|
return content;
|
|
78
78
|
};
|
|
79
79
|
var Pagination_default = Pagination;
|
|
@@ -36,13 +36,11 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_antd = require("antd");
|
|
37
37
|
var import_FilterButton = __toESM(require("./components/FilterButton"));
|
|
38
38
|
var import_QuickFilter = __toESM(require("./components/QuickFilter"));
|
|
39
|
-
var import_platform = require("../../utils/platform");
|
|
40
39
|
var formFiltersPrefix = "filters";
|
|
41
40
|
var Filter = (props) => {
|
|
42
|
-
const { filter, isRenderFormContent = true, onValuesChange } = props;
|
|
41
|
+
const { filter, isRenderFormContent = true, onValuesChange, isMobile: isMobileBool } = props;
|
|
43
42
|
const { show, quickFilterMaxLength, sortButtonShow, list } = filter || {};
|
|
44
43
|
const [form] = import_antd.Form.useForm();
|
|
45
|
-
const isMobileBool = (0, import_platform.isMobile)();
|
|
46
44
|
const isShowQuickFilter = (0, import_react.useMemo)(() => {
|
|
47
45
|
if (isMobileBool && show && sortButtonShow) {
|
|
48
46
|
return false;
|
|
@@ -42,7 +42,7 @@ var import_Buttons = __toESM(require("../Header/Buttons"));
|
|
|
42
42
|
var import_ViewMode = __toESM(require("./component/ViewMode"));
|
|
43
43
|
var import_GallerySetting = __toESM(require("./component/GallerySetting"));
|
|
44
44
|
var import_index = require("./index.less");
|
|
45
|
-
var
|
|
45
|
+
var import_useIsMobileTable = __toESM(require("../hooks/useIsMobileTable"));
|
|
46
46
|
var Actions = ({
|
|
47
47
|
filter,
|
|
48
48
|
sort,
|
|
@@ -55,6 +55,7 @@ var Actions = ({
|
|
|
55
55
|
gallery
|
|
56
56
|
}) => {
|
|
57
57
|
const form = import_antd.Form.useFormInstance();
|
|
58
|
+
const isMobileBool = (0, import_useIsMobileTable.default)();
|
|
58
59
|
const viewMode = import_antd.Form.useWatch("view_mode", {
|
|
59
60
|
form,
|
|
60
61
|
preserve: true
|
|
@@ -68,14 +69,14 @@ var Actions = ({
|
|
|
68
69
|
dataSourceGroup == null ? void 0 : dataSourceGroup.show,
|
|
69
70
|
view.multiple
|
|
70
71
|
]);
|
|
71
|
-
const isMobileBool = (0, import_platform.isMobile)();
|
|
72
72
|
return showActions ? /* @__PURE__ */ import_react.default.createElement("div", { className: "materials-grid-actions" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "left-wrap" }, /* @__PURE__ */ import_react.default.createElement(
|
|
73
73
|
import_filter.default,
|
|
74
74
|
{
|
|
75
75
|
filter,
|
|
76
76
|
isRenderFormContent: false,
|
|
77
77
|
tableId,
|
|
78
|
-
viewMode
|
|
78
|
+
viewMode,
|
|
79
|
+
isMobile: isMobileBool
|
|
79
80
|
}
|
|
80
81
|
)), /* @__PURE__ */ import_react.default.createElement(
|
|
81
82
|
"div",
|
|
@@ -158,7 +158,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
|
|
|
158
158
|
sort?: SortType | undefined;
|
|
159
159
|
mode: "" | "localStorage" | "remote";
|
|
160
160
|
currentViewMode: ModeType;
|
|
161
|
-
}) => ("
|
|
161
|
+
}) => ("filter_setting" | "column_setting" | "gallery_setting" | "view_mode" | "group_by" | "order_by")[];
|
|
162
162
|
export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
|
|
163
163
|
export declare const stringify: (obj: Record<string, any>) => string;
|
|
164
164
|
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/table/hooks/useIsMobileTable.ts
|
|
20
|
+
var useIsMobileTable_exports = {};
|
|
21
|
+
__export(useIsMobileTable_exports, {
|
|
22
|
+
default: () => useIsMobileTable_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(useIsMobileTable_exports);
|
|
25
|
+
var import_hooks = require("../../../hooks");
|
|
26
|
+
var import_model = require("../model");
|
|
27
|
+
var useIsMobileTable = () => {
|
|
28
|
+
const modal = (0, import_hooks.useSharedState)(import_model.Context);
|
|
29
|
+
const { tableWidth } = (modal == null ? void 0 : modal.state) || {};
|
|
30
|
+
return !!(tableWidth && (tableWidth || 0) < 600);
|
|
31
|
+
};
|
|
32
|
+
var useIsMobileTable_default = useIsMobileTable;
|
|
@@ -34,6 +34,7 @@ __export(table_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(table_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_antd = require("antd");
|
|
37
|
+
var import_ahooks = require("ahooks");
|
|
37
38
|
var import_View = __toESM(require("./View"));
|
|
38
39
|
var import_Header = __toESM(require("./Header"));
|
|
39
40
|
var import_Actions = __toESM(require("./Actions"));
|
|
@@ -85,6 +86,7 @@ var GridView = (0, import_model.Provider)(
|
|
|
85
86
|
const tableSettingRef = (0, import_react.useRef)({});
|
|
86
87
|
const filterDefaultRef = (0, import_react.useRef)({});
|
|
87
88
|
const initialValuesRef = (0, import_react.useRef)({});
|
|
89
|
+
const { width } = (0, import_ahooks.useSize)(wrapRef) || {};
|
|
88
90
|
const utils = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils;
|
|
89
91
|
const tableId = (0, import_react.useMemo)(() => {
|
|
90
92
|
if (props.__designMode === "design") {
|
|
@@ -129,6 +131,14 @@ var GridView = (0, import_model.Provider)(
|
|
|
129
131
|
(0, import_utils.clearTableSettingToLocalStorage)(tableId);
|
|
130
132
|
}
|
|
131
133
|
}, [currentSettingHash, tableId]);
|
|
134
|
+
(0, import_react.useEffect)(() => {
|
|
135
|
+
if (width) {
|
|
136
|
+
modal.dispatch({
|
|
137
|
+
type: "setTableWidth",
|
|
138
|
+
payload: width || {}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}, [width]);
|
|
132
142
|
const { setTableSetting, tableSetting } = (0, import_useTableSetting.default)({
|
|
133
143
|
tableId,
|
|
134
144
|
filter,
|
|
@@ -13,6 +13,7 @@ interface FormState {
|
|
|
13
13
|
otherFilter: FilterItemProps[];
|
|
14
14
|
utils: any;
|
|
15
15
|
localPagination: boolean;
|
|
16
|
+
tableWidth: number;
|
|
16
17
|
}
|
|
17
18
|
export declare const Provider: (ComponentUi: any) => (props: any, ref: any) => import("react").JSX.Element, Context: import("react").Context<{
|
|
18
19
|
state: FormState;
|
|
@@ -58,7 +58,8 @@ var defaultState = {
|
|
|
58
58
|
data: {
|
|
59
59
|
edit: 0
|
|
60
60
|
}
|
|
61
|
-
}
|
|
61
|
+
},
|
|
62
|
+
tableWidth: 500
|
|
62
63
|
};
|
|
63
64
|
var { Provider, Context } = (0, import_miniRedux.default)({
|
|
64
65
|
namespace: "state",
|
|
@@ -110,6 +111,9 @@ var { Provider, Context } = (0, import_miniRedux.default)({
|
|
|
110
111
|
},
|
|
111
112
|
setLocalPagination(state, payload) {
|
|
112
113
|
return { ...state, localPagination: payload };
|
|
114
|
+
},
|
|
115
|
+
setTableWidth(state, payload) {
|
|
116
|
+
return { ...state, tableWidth: payload };
|
|
113
117
|
}
|
|
114
118
|
}
|
|
115
119
|
});
|
package/lowcode/drawer/meta.ts
CHANGED