@pisell/materials 1.0.227 → 1.0.229
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 +2 -2
- package/build/lowcode/preview.js +142 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +29 -20
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +31 -22
- package/es/components/auto-complete/index.d.ts +1 -2
- package/es/components/auto-complete/index.js +1 -2
- package/es/components/input/index.js +4 -5
- package/es/components/page/index.js +10 -0
- package/es/components/picker-view/index.d.ts +2 -0
- package/es/components/picker-view/index.js +2 -0
- package/es/components/select/index.d.ts +1 -1
- package/es/components/select/index.js +5 -5
- package/es/components/table/Table/utils.d.ts +8 -3
- package/es/components/table/Table/utils.js +21 -4
- package/es/components/table/hooks/useMergeColumnSetting.d.ts +1 -0
- package/es/components/table/hooks/useMergeColumnSetting.js +3 -1
- package/es/components/table/hooks/useTableSetting.d.ts +1 -0
- package/es/components/table/hooks/useTableSetting.js +4 -2
- package/es/components/table/index.js +12 -2
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/lib/components/auto-complete/index.d.ts +1 -2
- package/lib/components/auto-complete/index.js +1 -2
- package/lib/components/input/index.js +4 -5
- package/lib/components/page/index.js +8 -0
- package/lib/components/picker-view/index.d.ts +2 -0
- package/lib/components/picker-view/index.js +36 -0
- package/lib/components/select/index.d.ts +1 -1
- package/lib/components/select/index.js +4 -4
- package/lib/components/table/Table/utils.d.ts +8 -3
- package/lib/components/table/Table/utils.js +23 -3
- package/lib/components/table/hooks/useMergeColumnSetting.d.ts +1 -0
- package/lib/components/table/hooks/useMergeColumnSetting.js +2 -1
- package/lib/components/table/hooks/useTableSetting.d.ts +1 -0
- package/lib/components/table/hooks/useTableSetting.js +4 -2
- package/lib/components/table/index.js +11 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lowcode/menu/utils.ts +1 -1
- package/lowcode/picker-view/__screenshots__/select-1.png +0 -0
- package/lowcode/picker-view/meta.ts +206 -0
- package/lowcode/picker-view/snippets.ts +24 -0
- package/package.json +5 -3
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Input as OriginalInput } from "antd";
|
|
2
|
-
import { withWrap } from "../../utils/hoc";
|
|
3
2
|
var OriginalGroup = OriginalInput.Group,
|
|
4
3
|
OriginalTextArea = OriginalInput.TextArea,
|
|
5
4
|
OriginalPassword = OriginalInput.Password,
|
|
6
5
|
OriginalSearch = OriginalInput.Search;
|
|
7
|
-
var Input =
|
|
6
|
+
var Input = OriginalInput;
|
|
8
7
|
Input.Group = OriginalGroup;
|
|
9
|
-
Input.TextArea =
|
|
10
|
-
Input.Password =
|
|
11
|
-
Input.Search =
|
|
8
|
+
Input.TextArea = OriginalTextArea;
|
|
9
|
+
Input.Password = OriginalPassword;
|
|
10
|
+
Input.Search = OriginalSearch;
|
|
12
11
|
export default Input;
|
|
@@ -88,8 +88,18 @@ var theme = {
|
|
|
88
88
|
colorTextQuaternary: "#D0D5DD",
|
|
89
89
|
colorBgContainerDisabled: "#F9FAFB",
|
|
90
90
|
colorTextDisabled: "#98A2B3"
|
|
91
|
+
},
|
|
92
|
+
"Input": {
|
|
93
|
+
"fontSizeIcon": 16
|
|
94
|
+
// "lineHeight": 1
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
"Select": {
|
|
98
|
+
"fontSizeIcon": 16
|
|
99
|
+
// "lineHeight": 1
|
|
91
100
|
}
|
|
92
101
|
},
|
|
102
|
+
|
|
93
103
|
token: {
|
|
94
104
|
colorPrimary: "#7F56D9",
|
|
95
105
|
colorPrimaryBg: "#F9F5FF",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import "./index.less";
|
|
3
|
-
declare const Select: (
|
|
3
|
+
declare const Select: import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<unknown>>;
|
|
4
4
|
export default Select;
|
|
@@ -6,13 +6,12 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6
6
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
7
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
8
|
import { Checkbox, Divider, Select as OriginalSelect } from "antd";
|
|
9
|
-
import { useCallback, useMemo } from "react";
|
|
9
|
+
import { useCallback, useMemo, forwardRef } from "react";
|
|
10
10
|
import { getText } from "../../locales";
|
|
11
|
-
import { withWrap } from "../../utils/hoc";
|
|
12
11
|
import { useControllableValue, useMemoizedFn } from "ahooks";
|
|
13
12
|
import "./index.less";
|
|
14
13
|
var prefix = "pisell-lowcode-";
|
|
15
|
-
var SelectBase = function
|
|
14
|
+
var SelectBase = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
16
15
|
var isShowDropdown = props.isShowDropdown,
|
|
17
16
|
selectAll = props.selectAll,
|
|
18
17
|
mode = props.mode,
|
|
@@ -51,12 +50,13 @@ var SelectBase = function SelectBase(props) {
|
|
|
51
50
|
}, getText("select-dropdown-render-select-all")))));
|
|
52
51
|
}, [isShowDropdown, isShowSelectAll, checkboxChecked, propsDropdownRender]);
|
|
53
52
|
return /*#__PURE__*/React.createElement(OriginalSelect, _extends({}, props, {
|
|
53
|
+
ref: ref,
|
|
54
54
|
value: state,
|
|
55
55
|
onChange: function onChange(value, option) {
|
|
56
56
|
return setState(value, option);
|
|
57
57
|
},
|
|
58
58
|
dropdownRender: dropdownRender
|
|
59
59
|
}));
|
|
60
|
-
};
|
|
61
|
-
var Select =
|
|
60
|
+
});
|
|
61
|
+
var Select = SelectBase;
|
|
62
62
|
export default Select;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { GroupValue } from "../Actions/component/Group/PopoverContent";
|
|
2
2
|
import { FilterItemProps, FilterType } from "../../filter/types";
|
|
3
3
|
import { ColumnSettingType, DataSourceGroupType, GallerySettingValueType, ModeType, SortType } from "../types";
|
|
4
|
+
export declare const getHash: (obj: any) => any;
|
|
4
5
|
export declare const calcFilterSort: ({ dataSource, filter, sort, columns }: any) => any;
|
|
5
6
|
/**
|
|
6
7
|
* 合并列设置
|
|
@@ -55,6 +56,7 @@ declare type ViewSetting = {
|
|
|
55
56
|
*/
|
|
56
57
|
declare type TableSettingObjType = {
|
|
57
58
|
view_mode: ModeType;
|
|
59
|
+
currentSettingHash: string;
|
|
58
60
|
} & {
|
|
59
61
|
[K in ModeType]: ViewSetting;
|
|
60
62
|
};
|
|
@@ -63,13 +65,15 @@ declare type TableSettingObjType = {
|
|
|
63
65
|
* @param tableId 表格id
|
|
64
66
|
* @param tableSettingObj 表格设置对象
|
|
65
67
|
*/
|
|
66
|
-
export declare const setTableSettingToLocalStorage: ({ tableId, tableSettingObj, currentViewMode, }: {
|
|
68
|
+
export declare const setTableSettingToLocalStorage: ({ tableId, tableSettingObj, currentViewMode, currentSettingHash, }: {
|
|
67
69
|
tableId: string;
|
|
68
70
|
tableSettingObj: Partial<ViewSetting & {
|
|
69
71
|
view_mode: ModeType;
|
|
70
72
|
}>;
|
|
71
73
|
currentViewMode: ModeType;
|
|
74
|
+
currentSettingHash: string;
|
|
72
75
|
}) => void;
|
|
76
|
+
export declare const clearTableSettingToLocalStorage: (tableId?: string) => void;
|
|
73
77
|
/**
|
|
74
78
|
* 从本地存储中获取表格设置, 全部配置
|
|
75
79
|
* @param tableId 表格ID
|
|
@@ -93,11 +97,12 @@ export declare const getTableSettingByCurrentViewMode: (tableId: string, current
|
|
|
93
97
|
* @param allValues 表单所有值
|
|
94
98
|
* @param keys 存储的键名
|
|
95
99
|
*/
|
|
96
|
-
export declare const setFormValuesToLocalStorage: ({ tableId, allValues, keys, currentViewMode, }: {
|
|
100
|
+
export declare const setFormValuesToLocalStorage: ({ tableId, allValues, keys, currentViewMode, currentSettingHash, }: {
|
|
97
101
|
tableId?: string | undefined;
|
|
98
102
|
allValues?: Record<string, any> | undefined;
|
|
99
103
|
keys?: string[] | undefined;
|
|
100
104
|
currentViewMode: ModeType;
|
|
105
|
+
currentSettingHash: string;
|
|
101
106
|
}) => void;
|
|
102
107
|
/**
|
|
103
108
|
* 合并筛选设置
|
|
@@ -141,6 +146,6 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
|
|
|
141
146
|
sort?: SortType | undefined;
|
|
142
147
|
mode: "" | "localStorage" | "remote";
|
|
143
148
|
currentViewMode: ModeType;
|
|
144
|
-
}) => ("
|
|
149
|
+
}) => ("view_mode" | "column_setting" | "order_by" | "group_by" | "gallery_setting" | "filter_setting")[];
|
|
145
150
|
export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
|
|
146
151
|
export {};
|
|
@@ -15,9 +15,18 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
15
15
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
16
|
import dayjs from "dayjs";
|
|
17
17
|
import { isBoolean, isFunction, isJson, isNumber, isString } from "@pisell/utils";
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
import md5 from "crypto-js/md5";
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
import enc from "crypto-js/enc-hex";
|
|
18
22
|
import { fieldMaps } from "./fields";
|
|
19
23
|
import { getValueByKeys } from "./fields/utils";
|
|
20
24
|
var tableKeyPrefix = "table-setting";
|
|
25
|
+
export var getHash = function getHash(obj) {
|
|
26
|
+
var jsonString = JSON.stringify(obj);
|
|
27
|
+
var hash = md5(jsonString);
|
|
28
|
+
return hash.toString(enc.Hex);
|
|
29
|
+
};
|
|
21
30
|
var transColumnsMap = function transColumnsMap(columns) {
|
|
22
31
|
return columns.reduce(function (p, c) {
|
|
23
32
|
return _objectSpread(_objectSpread({}, p), {}, _defineProperty({}, c.dataIndex, c));
|
|
@@ -242,7 +251,8 @@ export var groupDataSource = function groupDataSource(dataSource, group, rowKey)
|
|
|
242
251
|
export var setTableSettingToLocalStorage = function setTableSettingToLocalStorage(_ref4) {
|
|
243
252
|
var tableId = _ref4.tableId,
|
|
244
253
|
tableSettingObj = _ref4.tableSettingObj,
|
|
245
|
-
currentViewMode = _ref4.currentViewMode
|
|
254
|
+
currentViewMode = _ref4.currentViewMode,
|
|
255
|
+
currentSettingHash = _ref4.currentSettingHash;
|
|
246
256
|
if (!tableId) return;
|
|
247
257
|
var originData = localStorage.getItem(getTableKey(tableId));
|
|
248
258
|
var newData = {};
|
|
@@ -253,10 +263,15 @@ export var setTableSettingToLocalStorage = function setTableSettingToLocalStorag
|
|
|
253
263
|
var view_mode = tableSettingObj.view_mode,
|
|
254
264
|
itemSetting = _objectWithoutProperties(tableSettingObj, _excluded);
|
|
255
265
|
newData = _objectSpread(_objectSpread({}, newData), {}, _defineProperty({
|
|
256
|
-
view_mode: view_mode || newData.view_mode
|
|
266
|
+
view_mode: view_mode || newData.view_mode,
|
|
267
|
+
currentSettingHash: currentSettingHash
|
|
257
268
|
}, currentViewMode, _objectSpread(_objectSpread({}, newData[currentViewMode] || {}), itemSetting)));
|
|
258
269
|
localStorage.setItem(getTableKey(tableId), JSON.stringify(newData));
|
|
259
270
|
};
|
|
271
|
+
export var clearTableSettingToLocalStorage = function clearTableSettingToLocalStorage(tableId) {
|
|
272
|
+
if (!tableId) return;
|
|
273
|
+
localStorage.removeItem(getTableKey(tableId));
|
|
274
|
+
};
|
|
260
275
|
|
|
261
276
|
/**
|
|
262
277
|
* 从本地存储中获取表格设置, 全部配置
|
|
@@ -301,7 +316,8 @@ export var setFormValuesToLocalStorage = function setFormValuesToLocalStorage(_r
|
|
|
301
316
|
var tableId = _ref5.tableId,
|
|
302
317
|
allValues = _ref5.allValues,
|
|
303
318
|
keys = _ref5.keys,
|
|
304
|
-
currentViewMode = _ref5.currentViewMode
|
|
319
|
+
currentViewMode = _ref5.currentViewMode,
|
|
320
|
+
currentSettingHash = _ref5.currentSettingHash;
|
|
305
321
|
if (!tableId) return;
|
|
306
322
|
var obj = {};
|
|
307
323
|
keys === null || keys === void 0 ? void 0 : keys.forEach(function (key) {
|
|
@@ -310,7 +326,8 @@ export var setFormValuesToLocalStorage = function setFormValuesToLocalStorage(_r
|
|
|
310
326
|
setTableSettingToLocalStorage({
|
|
311
327
|
tableId: tableId,
|
|
312
328
|
tableSettingObj: obj,
|
|
313
|
-
currentViewMode: currentViewMode
|
|
329
|
+
currentViewMode: currentViewMode,
|
|
330
|
+
currentSettingHash: currentSettingHash
|
|
314
331
|
});
|
|
315
332
|
};
|
|
316
333
|
|
|
@@ -7,6 +7,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
7
7
|
import { useEffect, useMemo, useState } from "react";
|
|
8
8
|
import { useMemoizedFn } from "ahooks";
|
|
9
9
|
import { setTableSettingToLocalStorage } from "../Table/utils";
|
|
10
|
+
/** 已废弃 */
|
|
10
11
|
var useMergeColumnSetting = function useMergeColumnSetting(params) {
|
|
11
12
|
var tableId = params.tableId,
|
|
12
13
|
defaultColumns = params.defaultColumns,
|
|
@@ -24,7 +25,8 @@ var useMergeColumnSetting = function useMergeColumnSetting(params) {
|
|
|
24
25
|
tableSettingObj: {
|
|
25
26
|
column_setting: newColumns
|
|
26
27
|
},
|
|
27
|
-
currentViewMode: currentViewMode
|
|
28
|
+
currentViewMode: currentViewMode,
|
|
29
|
+
currentSettingHash: ""
|
|
28
30
|
});
|
|
29
31
|
}
|
|
30
32
|
dispatch({
|
|
@@ -10,6 +10,7 @@ declare type UseTableSettingProps = {
|
|
|
10
10
|
view: GridViewType;
|
|
11
11
|
currentViewMode: ModeType;
|
|
12
12
|
gallery?: GallerySettingType;
|
|
13
|
+
currentSettingHash: string;
|
|
13
14
|
};
|
|
14
15
|
declare const useTableSetting: (params: UseTableSettingProps) => {
|
|
15
16
|
setTableSetting: (values: Record<string, any>) => void;
|
|
@@ -15,7 +15,8 @@ var useTableSetting = function useTableSetting(params) {
|
|
|
15
15
|
view = params.view,
|
|
16
16
|
currentViewMode = params.currentViewMode,
|
|
17
17
|
propsColumns = params.columns,
|
|
18
|
-
gallery = params.gallery
|
|
18
|
+
gallery = params.gallery,
|
|
19
|
+
currentSettingHash = params.currentSettingHash;
|
|
19
20
|
var columnsMap = useMemo(function () {
|
|
20
21
|
return new Map(propsColumns.map(function (item) {
|
|
21
22
|
return [item.key, item];
|
|
@@ -159,7 +160,8 @@ var useTableSetting = function useTableSetting(params) {
|
|
|
159
160
|
tableId: tableId,
|
|
160
161
|
allValues: values,
|
|
161
162
|
keys: localStorageSettingKeyArr,
|
|
162
|
-
currentViewMode: currentViewMode
|
|
163
|
+
currentViewMode: currentViewMode,
|
|
164
|
+
currentSettingHash: currentSettingHash
|
|
163
165
|
});
|
|
164
166
|
};
|
|
165
167
|
var tableSetting = useMemo(function () {
|
|
@@ -25,7 +25,7 @@ import { Provider, Context, formatColumn } from "./model";
|
|
|
25
25
|
import useEngineContext from "../../hooks/useEngineContext";
|
|
26
26
|
import useTableSetting from "./hooks/useTableSetting";
|
|
27
27
|
import useTriggerValuesChange from "./hooks/useTriggerValuesChange";
|
|
28
|
-
import { getCurrentViewModeFromLocalStorage, mergeColumnSetting, omit } from "./Table/utils";
|
|
28
|
+
import { clearTableSettingToLocalStorage, getCurrentViewModeFromLocalStorage, getHash, getTableSettingFromLocalStorage, mergeColumnSetting, omit } from "./Table/utils";
|
|
29
29
|
import useTransSortSetting from "./hooks/useTransSortSetting";
|
|
30
30
|
import useTransFilterSetting from "./hooks/useTransFilterSetting";
|
|
31
31
|
import useTransDataSourceGroupSetting from "./hooks/useTransDataSourceGroupSetting";
|
|
@@ -101,6 +101,15 @@ var GridView = Provider( /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
101
101
|
}
|
|
102
102
|
return viewMode || defaultViewMode;
|
|
103
103
|
}, [viewMode, defaultViewMode, multiple]);
|
|
104
|
+
var currentSettingHash = useMemo(function () {
|
|
105
|
+
return getHash(columns) || "";
|
|
106
|
+
}, [JSON.stringify(columns)]);
|
|
107
|
+
useEffect(function () {
|
|
108
|
+
var setting = getTableSettingFromLocalStorage(tableId);
|
|
109
|
+
if (setting.currentSettingHash !== currentSettingHash) {
|
|
110
|
+
clearTableSettingToLocalStorage(tableId);
|
|
111
|
+
}
|
|
112
|
+
}, [currentSettingHash, tableId]);
|
|
104
113
|
var _useTableSetting = useTableSetting({
|
|
105
114
|
tableId: tableId,
|
|
106
115
|
filter: filter,
|
|
@@ -110,7 +119,8 @@ var GridView = Provider( /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
110
119
|
sort: sort,
|
|
111
120
|
view: view,
|
|
112
121
|
currentViewMode: currentViewMode,
|
|
113
|
-
gallery: gallery
|
|
122
|
+
gallery: gallery,
|
|
123
|
+
currentSettingHash: currentSettingHash
|
|
114
124
|
}),
|
|
115
125
|
setTableSetting = _useTableSetting.setTableSetting,
|
|
116
126
|
tableSetting = _useTableSetting.tableSetting;
|
package/es/index.d.ts
CHANGED
|
@@ -72,3 +72,4 @@ export { default as List } from "./components/list";
|
|
|
72
72
|
export { default as Sort } from "./components/sort";
|
|
73
73
|
export { default as InputNumberRange } from "./components/input-number-range";
|
|
74
74
|
export { default as LowCodePage } from "./components/lowCodePage";
|
|
75
|
+
export { default as PickerView } from "./components/picker-view";
|
package/es/index.js
CHANGED
|
@@ -91,4 +91,5 @@ export { default as ClassicLayout } from "./components/classicLayout";
|
|
|
91
91
|
export { default as List } from "./components/list";
|
|
92
92
|
export { default as Sort } from "./components/sort";
|
|
93
93
|
export { default as InputNumberRange } from "./components/input-number-range";
|
|
94
|
-
export { default as LowCodePage } from "./components/lowCodePage";
|
|
94
|
+
export { default as LowCodePage } from "./components/lowCodePage";
|
|
95
|
+
export { default as PickerView } from "./components/picker-view";
|
|
@@ -23,6 +23,5 @@ __export(auto_complete_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(auto_complete_exports);
|
|
25
25
|
var import_antd = require("antd");
|
|
26
|
-
var
|
|
27
|
-
var AutoComplete = (0, import_hoc.withWrap)(import_antd.AutoComplete);
|
|
26
|
+
var AutoComplete = import_antd.AutoComplete;
|
|
28
27
|
var auto_complete_default = AutoComplete;
|
|
@@ -23,16 +23,15 @@ __export(input_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(input_exports);
|
|
25
25
|
var import_antd = require("antd");
|
|
26
|
-
var import_hoc = require("../../utils/hoc");
|
|
27
26
|
var {
|
|
28
27
|
Group: OriginalGroup,
|
|
29
28
|
TextArea: OriginalTextArea,
|
|
30
29
|
Password: OriginalPassword,
|
|
31
30
|
Search: OriginalSearch
|
|
32
31
|
} = import_antd.Input;
|
|
33
|
-
var Input =
|
|
32
|
+
var Input = import_antd.Input;
|
|
34
33
|
Input.Group = OriginalGroup;
|
|
35
|
-
Input.TextArea =
|
|
36
|
-
Input.Password =
|
|
37
|
-
Input.Search =
|
|
34
|
+
Input.TextArea = OriginalTextArea;
|
|
35
|
+
Input.Password = OriginalPassword;
|
|
36
|
+
Input.Search = OriginalSearch;
|
|
38
37
|
var input_default = Input;
|
|
@@ -117,6 +117,14 @@ var theme = {
|
|
|
117
117
|
colorTextQuaternary: "#D0D5DD",
|
|
118
118
|
colorBgContainerDisabled: "#F9FAFB",
|
|
119
119
|
colorTextDisabled: "#98A2B3"
|
|
120
|
+
},
|
|
121
|
+
"Input": {
|
|
122
|
+
"fontSizeIcon": 16
|
|
123
|
+
// "lineHeight": 1
|
|
124
|
+
},
|
|
125
|
+
"Select": {
|
|
126
|
+
"fontSizeIcon": 16
|
|
127
|
+
// "lineHeight": 1
|
|
120
128
|
}
|
|
121
129
|
},
|
|
122
130
|
token: {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/picker-view/index.tsx
|
|
30
|
+
var picker_view_exports = {};
|
|
31
|
+
__export(picker_view_exports, {
|
|
32
|
+
default: () => picker_view_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(picker_view_exports);
|
|
35
|
+
var import_picker_view = __toESM(require("antd-mobile/es/components/picker-view"));
|
|
36
|
+
var picker_view_default = import_picker_view.default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import "./index.less";
|
|
3
|
-
declare const Select: (
|
|
3
|
+
declare const Select: import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<unknown>>;
|
|
4
4
|
export default Select;
|
|
@@ -25,11 +25,10 @@ module.exports = __toCommonJS(select_exports);
|
|
|
25
25
|
var import_antd = require("antd");
|
|
26
26
|
var import_react = require("react");
|
|
27
27
|
var import_locales = require("../../locales");
|
|
28
|
-
var import_hoc = require("../../utils/hoc");
|
|
29
28
|
var import_ahooks = require("ahooks");
|
|
30
29
|
var import_index = require("./index.less");
|
|
31
30
|
var prefix = "pisell-lowcode-";
|
|
32
|
-
var SelectBase = (props) => {
|
|
31
|
+
var SelectBase = (0, import_react.forwardRef)((props, ref) => {
|
|
33
32
|
const {
|
|
34
33
|
isShowDropdown,
|
|
35
34
|
selectAll,
|
|
@@ -84,11 +83,12 @@ var SelectBase = (props) => {
|
|
|
84
83
|
import_antd.Select,
|
|
85
84
|
{
|
|
86
85
|
...props,
|
|
86
|
+
ref,
|
|
87
87
|
value: state,
|
|
88
88
|
onChange: (value, option) => setState(value, option),
|
|
89
89
|
dropdownRender
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
|
-
};
|
|
93
|
-
var Select =
|
|
92
|
+
});
|
|
93
|
+
var Select = SelectBase;
|
|
94
94
|
var select_default = Select;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { GroupValue } from "../Actions/component/Group/PopoverContent";
|
|
2
2
|
import { FilterItemProps, FilterType } from "../../filter/types";
|
|
3
3
|
import { ColumnSettingType, DataSourceGroupType, GallerySettingValueType, ModeType, SortType } from "../types";
|
|
4
|
+
export declare const getHash: (obj: any) => any;
|
|
4
5
|
export declare const calcFilterSort: ({ dataSource, filter, sort, columns }: any) => any;
|
|
5
6
|
/**
|
|
6
7
|
* 合并列设置
|
|
@@ -55,6 +56,7 @@ declare type ViewSetting = {
|
|
|
55
56
|
*/
|
|
56
57
|
declare type TableSettingObjType = {
|
|
57
58
|
view_mode: ModeType;
|
|
59
|
+
currentSettingHash: string;
|
|
58
60
|
} & {
|
|
59
61
|
[K in ModeType]: ViewSetting;
|
|
60
62
|
};
|
|
@@ -63,13 +65,15 @@ declare type TableSettingObjType = {
|
|
|
63
65
|
* @param tableId 表格id
|
|
64
66
|
* @param tableSettingObj 表格设置对象
|
|
65
67
|
*/
|
|
66
|
-
export declare const setTableSettingToLocalStorage: ({ tableId, tableSettingObj, currentViewMode, }: {
|
|
68
|
+
export declare const setTableSettingToLocalStorage: ({ tableId, tableSettingObj, currentViewMode, currentSettingHash, }: {
|
|
67
69
|
tableId: string;
|
|
68
70
|
tableSettingObj: Partial<ViewSetting & {
|
|
69
71
|
view_mode: ModeType;
|
|
70
72
|
}>;
|
|
71
73
|
currentViewMode: ModeType;
|
|
74
|
+
currentSettingHash: string;
|
|
72
75
|
}) => void;
|
|
76
|
+
export declare const clearTableSettingToLocalStorage: (tableId?: string) => void;
|
|
73
77
|
/**
|
|
74
78
|
* 从本地存储中获取表格设置, 全部配置
|
|
75
79
|
* @param tableId 表格ID
|
|
@@ -93,11 +97,12 @@ export declare const getTableSettingByCurrentViewMode: (tableId: string, current
|
|
|
93
97
|
* @param allValues 表单所有值
|
|
94
98
|
* @param keys 存储的键名
|
|
95
99
|
*/
|
|
96
|
-
export declare const setFormValuesToLocalStorage: ({ tableId, allValues, keys, currentViewMode, }: {
|
|
100
|
+
export declare const setFormValuesToLocalStorage: ({ tableId, allValues, keys, currentViewMode, currentSettingHash, }: {
|
|
97
101
|
tableId?: string | undefined;
|
|
98
102
|
allValues?: Record<string, any> | undefined;
|
|
99
103
|
keys?: string[] | undefined;
|
|
100
104
|
currentViewMode: ModeType;
|
|
105
|
+
currentSettingHash: string;
|
|
101
106
|
}) => void;
|
|
102
107
|
/**
|
|
103
108
|
* 合并筛选设置
|
|
@@ -141,6 +146,6 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
|
|
|
141
146
|
sort?: SortType | undefined;
|
|
142
147
|
mode: "" | "localStorage" | "remote";
|
|
143
148
|
currentViewMode: ModeType;
|
|
144
|
-
}) => ("
|
|
149
|
+
}) => ("view_mode" | "column_setting" | "order_by" | "group_by" | "gallery_setting" | "filter_setting")[];
|
|
145
150
|
export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
|
|
146
151
|
export {};
|
|
@@ -30,8 +30,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
var utils_exports = {};
|
|
31
31
|
__export(utils_exports, {
|
|
32
32
|
calcFilterSort: () => calcFilterSort,
|
|
33
|
+
clearTableSettingToLocalStorage: () => clearTableSettingToLocalStorage,
|
|
33
34
|
filterDataSource: () => filterDataSource,
|
|
34
35
|
getCurrentViewModeFromLocalStorage: () => getCurrentViewModeFromLocalStorage,
|
|
36
|
+
getHash: () => getHash,
|
|
35
37
|
getIdByRowKey: () => getIdByRowKey,
|
|
36
38
|
getSettingKeyArrByMode: () => getSettingKeyArrByMode,
|
|
37
39
|
getTableSettingByCurrentViewMode: () => getTableSettingByCurrentViewMode,
|
|
@@ -47,9 +49,16 @@ __export(utils_exports, {
|
|
|
47
49
|
module.exports = __toCommonJS(utils_exports);
|
|
48
50
|
var import_dayjs = __toESM(require("dayjs"));
|
|
49
51
|
var import_utils = require("@pisell/utils");
|
|
52
|
+
var import_md5 = __toESM(require("crypto-js/md5"));
|
|
53
|
+
var import_enc_hex = __toESM(require("crypto-js/enc-hex"));
|
|
50
54
|
var import_fields = require("./fields");
|
|
51
55
|
var import_utils2 = require("./fields/utils");
|
|
52
56
|
var tableKeyPrefix = "table-setting";
|
|
57
|
+
var getHash = (obj) => {
|
|
58
|
+
const jsonString = JSON.stringify(obj);
|
|
59
|
+
const hash = (0, import_md5.default)(jsonString);
|
|
60
|
+
return hash.toString(import_enc_hex.default.Hex);
|
|
61
|
+
};
|
|
53
62
|
var transColumnsMap = (columns) => {
|
|
54
63
|
return columns.reduce((p, c) => {
|
|
55
64
|
return {
|
|
@@ -233,7 +242,8 @@ var groupDataSource = (dataSource, group, rowKey) => {
|
|
|
233
242
|
var setTableSettingToLocalStorage = ({
|
|
234
243
|
tableId,
|
|
235
244
|
tableSettingObj,
|
|
236
|
-
currentViewMode
|
|
245
|
+
currentViewMode,
|
|
246
|
+
currentSettingHash
|
|
237
247
|
}) => {
|
|
238
248
|
if (!tableId)
|
|
239
249
|
return;
|
|
@@ -249,6 +259,7 @@ var setTableSettingToLocalStorage = ({
|
|
|
249
259
|
newData = {
|
|
250
260
|
...newData,
|
|
251
261
|
view_mode: view_mode || newData.view_mode,
|
|
262
|
+
currentSettingHash,
|
|
252
263
|
[currentViewMode]: {
|
|
253
264
|
...newData[currentViewMode] || {},
|
|
254
265
|
...itemSetting
|
|
@@ -256,6 +267,11 @@ var setTableSettingToLocalStorage = ({
|
|
|
256
267
|
};
|
|
257
268
|
localStorage.setItem(getTableKey(tableId), JSON.stringify(newData));
|
|
258
269
|
};
|
|
270
|
+
var clearTableSettingToLocalStorage = (tableId) => {
|
|
271
|
+
if (!tableId)
|
|
272
|
+
return;
|
|
273
|
+
localStorage.removeItem(getTableKey(tableId));
|
|
274
|
+
};
|
|
259
275
|
var getTableSettingFromLocalStorage = (tableId) => {
|
|
260
276
|
if (!tableId)
|
|
261
277
|
return {};
|
|
@@ -277,7 +293,8 @@ var setFormValuesToLocalStorage = ({
|
|
|
277
293
|
tableId,
|
|
278
294
|
allValues,
|
|
279
295
|
keys,
|
|
280
|
-
currentViewMode
|
|
296
|
+
currentViewMode,
|
|
297
|
+
currentSettingHash
|
|
281
298
|
}) => {
|
|
282
299
|
if (!tableId)
|
|
283
300
|
return;
|
|
@@ -288,7 +305,8 @@ var setFormValuesToLocalStorage = ({
|
|
|
288
305
|
setTableSettingToLocalStorage({
|
|
289
306
|
tableId,
|
|
290
307
|
tableSettingObj: obj,
|
|
291
|
-
currentViewMode
|
|
308
|
+
currentViewMode,
|
|
309
|
+
currentSettingHash
|
|
292
310
|
});
|
|
293
311
|
};
|
|
294
312
|
var getTableKey = (tableId) => `${tableKeyPrefix}-${tableId}`;
|
|
@@ -424,8 +442,10 @@ var omit = (obj, keys) => {
|
|
|
424
442
|
// Annotate the CommonJS export names for ESM import in node:
|
|
425
443
|
0 && (module.exports = {
|
|
426
444
|
calcFilterSort,
|
|
445
|
+
clearTableSettingToLocalStorage,
|
|
427
446
|
filterDataSource,
|
|
428
447
|
getCurrentViewModeFromLocalStorage,
|
|
448
|
+
getHash,
|
|
429
449
|
getIdByRowKey,
|
|
430
450
|
getSettingKeyArrByMode,
|
|
431
451
|
getTableSettingByCurrentViewMode,
|
|
@@ -10,6 +10,7 @@ declare type UseTableSettingProps = {
|
|
|
10
10
|
view: GridViewType;
|
|
11
11
|
currentViewMode: ModeType;
|
|
12
12
|
gallery?: GallerySettingType;
|
|
13
|
+
currentSettingHash: string;
|
|
13
14
|
};
|
|
14
15
|
declare const useTableSetting: (params: UseTableSettingProps) => {
|
|
15
16
|
setTableSetting: (values: Record<string, any>) => void;
|
|
@@ -34,7 +34,8 @@ var useTableSetting = (params) => {
|
|
|
34
34
|
view,
|
|
35
35
|
currentViewMode,
|
|
36
36
|
columns: propsColumns,
|
|
37
|
-
gallery
|
|
37
|
+
gallery,
|
|
38
|
+
currentSettingHash
|
|
38
39
|
} = params;
|
|
39
40
|
const columnsMap = (0, import_react.useMemo)(() => {
|
|
40
41
|
return new Map(propsColumns.map((item) => [item.key, item]));
|
|
@@ -188,7 +189,8 @@ var useTableSetting = (params) => {
|
|
|
188
189
|
tableId,
|
|
189
190
|
allValues: values,
|
|
190
191
|
keys: localStorageSettingKeyArr,
|
|
191
|
-
currentViewMode
|
|
192
|
+
currentViewMode,
|
|
193
|
+
currentSettingHash
|
|
192
194
|
});
|
|
193
195
|
};
|
|
194
196
|
const tableSetting = (0, import_react.useMemo)(() => {
|