@pisell/materials 6.2.38 → 6.2.40
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 +7 -7
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +36 -21
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +35 -20
- 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/useTableProps.js +33 -15
- 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/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Upload/BaseUpload.js +199 -19
- package/es/components/dataSourceComponents/fields/Upload/CameraPopover.js +66 -0
- package/es/components/dataSourceComponents/fields/Upload/index.less +35 -3
- package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +8 -8
- package/es/components/filter/types.d.ts +2 -0
- package/es/components/pisellCamera/index.js +228 -0
- package/es/components/pisellCamera/index.less +131 -0
- package/es/components/pisellCardList/index.js +3 -1
- package/es/components/pisellCheckboxGroup/index.js +15 -1
- package/es/components/pisellWalletPassCard/index.d.ts +1 -0
- package/es/components/pisellWalletPassCard/index.js +6 -1
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +2 -1
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.js +74 -6
- 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/fields/index.d.ts +2 -2
- package/es/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
- 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/components/walletCard/Guide/index.js +12 -1
- package/es/components/walletCard/index.js +29 -3
- package/es/components/walletCard/index.less +27 -0
- package/es/locales/en-US.js +83 -69
- package/es/locales/zh-CN.js +84 -70
- package/es/locales/zh-TW.js +84 -70
- package/es/utils/index.d.ts +1 -1
- 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/useTableProps.js +20 -7
- 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/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.js +168 -5
- package/lib/components/dataSourceComponents/fields/Upload/CameraPopover.js +95 -0
- package/lib/components/dataSourceComponents/fields/Upload/index.less +35 -3
- package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +8 -8
- package/lib/components/filter/types.d.ts +2 -0
- package/lib/components/pisellCamera/index.js +222 -0
- package/lib/components/pisellCamera/index.less +131 -0
- package/lib/components/pisellCardList/index.js +3 -1
- package/lib/components/pisellCheckboxGroup/index.js +16 -0
- package/lib/components/pisellWalletPassCard/index.d.ts +1 -0
- package/lib/components/pisellWalletPassCard/index.js +9 -1
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +2 -1
- 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/fields/index.d.ts +2 -2
- package/lib/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
- 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/components/walletCard/Guide/index.js +11 -1
- package/lib/components/walletCard/index.js +27 -3
- package/lib/components/walletCard/index.less +27 -0
- package/lib/locales/en-US.js +15 -1
- package/lib/locales/zh-CN.js +15 -1
- package/lib/locales/zh-TW.js +15 -1
- package/lib/utils/index.d.ts +1 -1
- package/lowcode/data-source-table/meta.ts +358 -66
- package/lowcode/form-item-upload/meta.ts +20 -5
- package/lowcode/pisell-upload/meta.ts +8 -0
- package/lowcode/pisell-wallet-pass-card/meta.ts +19 -0
- package/lowcode/table/meta.ts +104 -0
- package/lowcode/wallet-card/meta.ts +81 -63
- package/package.json +2 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +0 -98
- package/es/components/dataSourceComponents/fields/Upload/type.d.ts +0 -37
- package/es/components/pisell-config-provider/context.d.ts +0 -20
- package/es/components/pisell-config-provider/index.d.ts +0 -12
- package/es/components/pisellAdjustPrice/index.d.ts +0 -4
- package/es/components/pisellAdjustPrice/type.d.ts +0 -20
- package/es/components/pisellCheckboxGroup/index.d.ts +0 -36
- package/es/components/pisellQRScanner/index.d.ts +0 -37
- package/es/components/pisellText/components/Amount/index.d.ts +0 -20
- package/es/components/table/Table/AddFieldModal/index.d.ts +0 -3
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +0 -11
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +0 -21
- package/es/components/virtual-keyboard/Number/index.d.ts +0 -5
- package/es/components/virtual-keyboard/Number/types.d.ts +0 -25
- package/es/components/walletCard/index.d.ts +0 -67
- package/es/locales/en-US.d.ts +0 -278
- package/es/locales/zh-CN.d.ts +0 -273
- package/es/locales/zh-TW.d.ts +0 -273
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +0 -98
- package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +0 -37
- package/lib/components/pisell-config-provider/context.d.ts +0 -20
- package/lib/components/pisell-config-provider/index.d.ts +0 -12
- package/lib/components/pisellAdjustPrice/index.d.ts +0 -4
- package/lib/components/pisellAdjustPrice/type.d.ts +0 -20
- package/lib/components/pisellCheckboxGroup/index.d.ts +0 -36
- package/lib/components/pisellQRScanner/index.d.ts +0 -37
- package/lib/components/pisellText/components/Amount/index.d.ts +0 -20
- package/lib/components/table/Table/AddFieldModal/index.d.ts +0 -3
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +0 -11
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +0 -21
- package/lib/components/virtual-keyboard/Number/index.d.ts +0 -5
- package/lib/components/virtual-keyboard/Number/types.d.ts +0 -25
- package/lib/components/walletCard/index.d.ts +0 -67
- package/lib/locales/en-US.d.ts +0 -278
- package/lib/locales/zh-CN.d.ts +0 -273
- package/lib/locales/zh-TW.d.ts +0 -273
|
@@ -177,7 +177,7 @@ var CartSkuCard = function CartSkuCard(props) {
|
|
|
177
177
|
}
|
|
178
178
|
return renderA2();
|
|
179
179
|
};
|
|
180
|
-
return /*#__PURE__*/React.createElement(
|
|
180
|
+
return /*#__PURE__*/React.createElement(SwipeAction, {
|
|
181
181
|
closeOnAction: false,
|
|
182
182
|
className: classNames("".concat(PREFIX, "-wrapper")),
|
|
183
183
|
rightActions: _rightActions,
|
|
@@ -189,15 +189,6 @@ var CartSkuCard = function CartSkuCard(props) {
|
|
|
189
189
|
e.stopPropagation();
|
|
190
190
|
onCard === null || onCard === void 0 || onCard(dataSource);
|
|
191
191
|
}
|
|
192
|
-
}, renderContent()))
|
|
193
|
-
className: classNames("".concat(PREFIX, "-wrapper"))
|
|
194
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
195
|
-
className: classNames(PREFIX, "".concat(PREFIX, "-").concat(type)),
|
|
196
|
-
onClick: function onClick(e) {
|
|
197
|
-
e.preventDefault();
|
|
198
|
-
e.stopPropagation();
|
|
199
|
-
onCard === null || onCard === void 0 || onCard(dataSource);
|
|
200
|
-
}
|
|
201
|
-
}, renderContent())));
|
|
192
|
+
}, renderContent()));
|
|
202
193
|
};
|
|
203
194
|
export default CartSkuCard;
|
|
@@ -197,12 +197,12 @@ export declare const fieldList: ({
|
|
|
197
197
|
field_icon: string;
|
|
198
198
|
field_name: string;
|
|
199
199
|
field_type: string;
|
|
200
|
-
default_value:
|
|
200
|
+
default_value: string;
|
|
201
201
|
} | {
|
|
202
202
|
field_icon: string;
|
|
203
203
|
field_name: string;
|
|
204
204
|
field_type: string;
|
|
205
|
-
default_value:
|
|
205
|
+
default_value: boolean;
|
|
206
206
|
} | {
|
|
207
207
|
field_icon: string;
|
|
208
208
|
field_name: string;
|
|
@@ -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" | "filter_setting" | "column_setting" | "gallery_setting" | "view_mode" | "group_by" | "order_by")[];
|
|
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 {};
|
|
@@ -347,7 +347,28 @@ export var setFormValuesToLocalStorage = function setFormValuesToLocalStorage(_r
|
|
|
347
347
|
* @returns 返回格式化后的表格键值
|
|
348
348
|
*/
|
|
349
349
|
var getTableKey = function getTableKey(tableId) {
|
|
350
|
-
|
|
350
|
+
// 兼容非浏览器环境(如SSR/测试)
|
|
351
|
+
if (typeof window === "undefined" || typeof window.location === "undefined") {
|
|
352
|
+
return "".concat(tableKeyPrefix, "-").concat(tableId);
|
|
353
|
+
}
|
|
354
|
+
var _window$location = window.location,
|
|
355
|
+
pathname = _window$location.pathname,
|
|
356
|
+
search = _window$location.search;
|
|
357
|
+
var appendPath = pathname || "/";
|
|
358
|
+
|
|
359
|
+
// 仅用于读取 memory_key,其余查询参数忽略
|
|
360
|
+
var memoryKey = "";
|
|
361
|
+
try {
|
|
362
|
+
var _params = new URLSearchParams(search || "");
|
|
363
|
+
var mk = _params.get("memory_key");
|
|
364
|
+
if (mk && mk.trim() !== "") {
|
|
365
|
+
memoryKey = mk.trim();
|
|
366
|
+
}
|
|
367
|
+
} catch (e) {
|
|
368
|
+
// 忽略解析异常,降级为仅使用 pathname
|
|
369
|
+
}
|
|
370
|
+
var urlPart = memoryKey ? "".concat(appendPath, "#").concat(memoryKey) : appendPath;
|
|
371
|
+
return "".concat(tableKeyPrefix, "-").concat(tableId, "-").concat(urlPart);
|
|
351
372
|
};
|
|
352
373
|
|
|
353
374
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FilterType } from "../../filter/types";
|
|
2
|
-
import { ColumnSettingType, DataSourceGroupType, GallerySettingType, GridViewType, ModeType, SortType, ExportImportModeType } from "../types";
|
|
2
|
+
import { ColumnSettingType, DataSourceGroupType, GallerySettingType, GridViewType, ModeType, SortType, ExportImportModeType, LocalSettingsType } from "../types";
|
|
3
3
|
declare type UseTableSettingProps = {
|
|
4
4
|
tableId?: string;
|
|
5
5
|
filter: FilterType;
|
|
@@ -12,11 +12,10 @@ declare type UseTableSettingProps = {
|
|
|
12
12
|
gallery?: GallerySettingType;
|
|
13
13
|
currentSettingHash: string;
|
|
14
14
|
exportImport?: ExportImportModeType;
|
|
15
|
+
localSettings?: LocalSettingsType;
|
|
15
16
|
};
|
|
16
17
|
declare const useTableSetting: (params: UseTableSettingProps) => {
|
|
17
18
|
setTableSetting: (values: Record<string, any>) => void;
|
|
18
|
-
tableSetting:
|
|
19
|
-
[x: string]: any;
|
|
20
|
-
};
|
|
19
|
+
tableSetting: any;
|
|
21
20
|
};
|
|
22
21
|
export default useTableSetting;
|
|
@@ -5,8 +5,9 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import { useMemo } from "react";
|
|
8
|
-
import { getSettingKeyArrByMode, getTableSettingByCurrentViewMode, getTableSettingFromLocalStorage, mergeColumnSetting, mergeFilterSetting, setFormValuesToLocalStorage } from "../Table/utils";
|
|
8
|
+
import { getSettingKeyArrByMode, getTableSettingByCurrentViewMode, getTableSettingFromLocalStorage, mergeColumnSetting, mergeFilterSetting, setTableSettingToLocalStorage, setFormValuesToLocalStorage } from "../Table/utils";
|
|
9
9
|
import { useMemoizedFn } from "ahooks";
|
|
10
|
+
import React from "react";
|
|
10
11
|
var useTableSetting = function useTableSetting(params) {
|
|
11
12
|
var tableId = params.tableId,
|
|
12
13
|
filter = params.filter,
|
|
@@ -18,7 +19,8 @@ var useTableSetting = function useTableSetting(params) {
|
|
|
18
19
|
propsColumns = params.columns,
|
|
19
20
|
gallery = params.gallery,
|
|
20
21
|
currentSettingHash = params.currentSettingHash,
|
|
21
|
-
exportImport = params.exportImport
|
|
22
|
+
exportImport = params.exportImport,
|
|
23
|
+
localSettings = params.localSettings;
|
|
22
24
|
var columnsMap = useMemo(function () {
|
|
23
25
|
return new Map(propsColumns.map(function (item) {
|
|
24
26
|
return [item.key, item];
|
|
@@ -60,7 +62,8 @@ var useTableSetting = function useTableSetting(params) {
|
|
|
60
62
|
* 获取需要本地存储的 keyArr
|
|
61
63
|
*/
|
|
62
64
|
var localStorageSettingKeyArr = useMemo(function () {
|
|
63
|
-
|
|
65
|
+
var _localSettings$scope;
|
|
66
|
+
var keys = getSettingKeyArrByMode({
|
|
64
67
|
filter: filter,
|
|
65
68
|
columnSetting: columnSetting,
|
|
66
69
|
dataSourceGroup: dataSourceGroup,
|
|
@@ -68,6 +71,13 @@ var useTableSetting = function useTableSetting(params) {
|
|
|
68
71
|
mode: "localStorage",
|
|
69
72
|
currentViewMode: currentViewMode
|
|
70
73
|
});
|
|
74
|
+
// 本地记忆:filters 范围 -> 存储到 filter 字段
|
|
75
|
+
if (localSettings !== null && localSettings !== void 0 && localSettings.enable && (_localSettings$scope = localSettings.scope) !== null && _localSettings$scope !== void 0 && _localSettings$scope.includes("filters")) {
|
|
76
|
+
if (!keys.includes("filters")) {
|
|
77
|
+
keys.push("filters");
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return keys;
|
|
71
81
|
}, [tableId, filter, columnSetting, dataSourceGroup, sort, currentViewMode]);
|
|
72
82
|
var defaultKeyArr = useMemo(function () {
|
|
73
83
|
return getSettingKeyArrByMode({
|
|
@@ -117,6 +127,8 @@ var useTableSetting = function useTableSetting(params) {
|
|
|
117
127
|
compactMode: (mergedSetting === null || mergedSetting === void 0 || (_mergedSetting$item3 = mergedSetting[item]) === null || _mergedSetting$item3 === void 0 ? void 0 : _mergedSetting$item3.compactMode) || defaultGalleryCoverSetting.compactMode,
|
|
118
128
|
isShowLabel: (_mergedSetting$item$i = mergedSetting === null || mergedSetting === void 0 || (_mergedSetting$item4 = mergedSetting[item]) === null || _mergedSetting$item4 === void 0 ? void 0 : _mergedSetting$item4.isShowLabel) !== null && _mergedSetting$item$i !== void 0 ? _mergedSetting$item$i : defaultGalleryCoverSetting.isShowLabel
|
|
119
129
|
});
|
|
130
|
+
} else if (item === "filters") {
|
|
131
|
+
setting[item] = (mergedSetting === null || mergedSetting === void 0 ? void 0 : mergedSetting[item]) || {};
|
|
120
132
|
} else {
|
|
121
133
|
setting[item] = mergedSetting === null || mergedSetting === void 0 ? void 0 : mergedSetting[item];
|
|
122
134
|
}
|
|
@@ -158,17 +170,113 @@ var useTableSetting = function useTableSetting(params) {
|
|
|
158
170
|
* @param values
|
|
159
171
|
*/
|
|
160
172
|
var setTableSetting = useMemoizedFn(function (values) {
|
|
173
|
+
var _localSettings$scope2;
|
|
174
|
+
// 计算需要存储的 filter 值(仅当开启本地记忆且包含 filters 时)
|
|
175
|
+
var valuesForSave = values;
|
|
176
|
+
if (localSettings !== null && localSettings !== void 0 && localSettings.enable && (_localSettings$scope2 = localSettings.scope) !== null && _localSettings$scope2 !== void 0 && _localSettings$scope2.includes("filters")) {
|
|
177
|
+
var excluded = new Set((localSettings === null || localSettings === void 0 ? void 0 : localSettings.excludedFilterFields) || []);
|
|
178
|
+
var filterValue = {};
|
|
179
|
+
((filter === null || filter === void 0 ? void 0 : filter.list) || []).forEach(function (item) {
|
|
180
|
+
var rawName = item === null || item === void 0 ? void 0 : item.name;
|
|
181
|
+
if (!rawName) return;
|
|
182
|
+
var key = Array.isArray(rawName) ? rawName.join(",") : String(rawName);
|
|
183
|
+
if (excluded.has(key)) return;
|
|
184
|
+
if (values.hasOwnProperty(key)) {
|
|
185
|
+
filterValue[key] = values[key];
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
valuesForSave = _objectSpread(_objectSpread({}, values), {}, {
|
|
189
|
+
filters: filterValue
|
|
190
|
+
});
|
|
191
|
+
}
|
|
161
192
|
setFormValuesToLocalStorage({
|
|
162
193
|
tableId: tableId,
|
|
163
|
-
allValues:
|
|
194
|
+
allValues: valuesForSave,
|
|
164
195
|
keys: localStorageSettingKeyArr,
|
|
165
196
|
currentViewMode: currentViewMode,
|
|
166
197
|
currentSettingHash: currentSettingHash
|
|
167
198
|
});
|
|
168
199
|
});
|
|
169
200
|
var tableSetting = useMemo(function () {
|
|
170
|
-
|
|
201
|
+
var _localSettings$scope3;
|
|
202
|
+
var merged = _objectSpread(_objectSpread({}, tableLocalSetting), defaultTableSetting);
|
|
203
|
+
// 将本地记忆的 filter 扁平化注入初始表单值(不改变存储结构)
|
|
204
|
+
if (localSettings !== null && localSettings !== void 0 && localSettings.enable && (_localSettings$scope3 = localSettings.scope) !== null && _localSettings$scope3 !== void 0 && _localSettings$scope3.includes("filters")) {
|
|
205
|
+
var persistedFilter = tableLocalSetting === null || tableLocalSetting === void 0 ? void 0 : tableLocalSetting.filters;
|
|
206
|
+
if (persistedFilter && _typeof(persistedFilter) === "object") {
|
|
207
|
+
return _objectSpread(_objectSpread({}, merged), persistedFilter);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return merged;
|
|
171
211
|
}, [tableLocalSetting, defaultTableSetting]);
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* 当刷新后获得新的 localSettings(scope 或 excludedFilterFields 变化)时,
|
|
215
|
+
* 根据最新规则调整已存储的 filters
|
|
216
|
+
*/
|
|
217
|
+
// 对本地已存储 filters 做一次对齐(仅在必要时写回)
|
|
218
|
+
useMemo(function () {
|
|
219
|
+
try {
|
|
220
|
+
var _localSettings$scope4;
|
|
221
|
+
if (!tableId) return;
|
|
222
|
+
var current = getTableSettingByCurrentViewMode(tableId, currentViewMode) || {};
|
|
223
|
+
var persistedFilters = (current === null || current === void 0 ? void 0 : current.filters) || {};
|
|
224
|
+
var nextFilters = _objectSpread({}, persistedFilters);
|
|
225
|
+
var shouldUpdate = false;
|
|
226
|
+
var enableFiltersMemory = !!(localSettings !== null && localSettings !== void 0 && localSettings.enable && (_localSettings$scope4 = localSettings.scope) !== null && _localSettings$scope4 !== void 0 && _localSettings$scope4.includes("filters"));
|
|
227
|
+
if (!enableFiltersMemory) {
|
|
228
|
+
if (Object.keys(persistedFilters || {}).length > 0) {
|
|
229
|
+
nextFilters = {};
|
|
230
|
+
shouldUpdate = true;
|
|
231
|
+
}
|
|
232
|
+
} else {
|
|
233
|
+
var names = new Set();
|
|
234
|
+
if ( /*#__PURE__*/React.isValidElement(filter)) {
|
|
235
|
+
names = new Set(((filter === null || filter === void 0 ? void 0 : filter.__items) || []).filter(function (item) {
|
|
236
|
+
return !item.isHidden;
|
|
237
|
+
}).map(function (item) {
|
|
238
|
+
var rawName = item === null || item === void 0 ? void 0 : item.value;
|
|
239
|
+
if (!rawName) return undefined;
|
|
240
|
+
return Array.isArray(rawName) ? rawName.join(",") : String(rawName);
|
|
241
|
+
}));
|
|
242
|
+
} else {
|
|
243
|
+
names = new Set(((filter === null || filter === void 0 ? void 0 : filter.list) || []).map(function (item) {
|
|
244
|
+
var rawName = item === null || item === void 0 ? void 0 : item.name;
|
|
245
|
+
if (!rawName) return undefined;
|
|
246
|
+
return Array.isArray(rawName) ? rawName.join(",") : String(rawName);
|
|
247
|
+
}).filter(Boolean));
|
|
248
|
+
}
|
|
249
|
+
var excluded = new Set((localSettings === null || localSettings === void 0 ? void 0 : localSettings.excludedFilterFields) || []);
|
|
250
|
+
var allowed = new Set(Array.from(names).filter(function (k) {
|
|
251
|
+
return !excluded.has(k);
|
|
252
|
+
}));
|
|
253
|
+
var filtered = {};
|
|
254
|
+
Object.keys(persistedFilters || {}).forEach(function (k) {
|
|
255
|
+
if (allowed.has(k)) {
|
|
256
|
+
filtered[k] = persistedFilters[k];
|
|
257
|
+
} else {
|
|
258
|
+
shouldUpdate = true;
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
if (Object.keys(filtered).length !== Object.keys(persistedFilters || {}).length) {
|
|
262
|
+
shouldUpdate = true;
|
|
263
|
+
}
|
|
264
|
+
nextFilters = filtered;
|
|
265
|
+
}
|
|
266
|
+
if (shouldUpdate) {
|
|
267
|
+
setTableSettingToLocalStorage({
|
|
268
|
+
tableId: tableId,
|
|
269
|
+
tableSettingObj: {
|
|
270
|
+
filters: nextFilters
|
|
271
|
+
},
|
|
272
|
+
currentViewMode: currentViewMode,
|
|
273
|
+
currentSettingHash: currentSettingHash
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
} catch (e) {
|
|
277
|
+
// ignore
|
|
278
|
+
}
|
|
279
|
+
}, []);
|
|
172
280
|
return {
|
|
173
281
|
setTableSetting: setTableSetting,
|
|
174
282
|
tableSetting: tableSetting
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["dataSource", "columns", "dispatch", "style", "filter", "sort", "buttons", "actionButtons", "title", "showTitle", "subTitle", "showSubTitle", "summary", "onValuesChange", "columnSetting", "dataSourceGroup", "view", "gallery", "currentSettingKey", "exportImport", "currentComponentId", "tabs"];
|
|
2
|
+
var _excluded = ["dataSource", "columns", "dispatch", "style", "filter", "sort", "buttons", "actionButtons", "title", "showTitle", "subTitle", "showSubTitle", "summary", "onValuesChange", "columnSetting", "dataSourceGroup", "localSettings", "view", "gallery", "currentSettingKey", "exportImport", "currentComponentId", "tabs"];
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -24,7 +24,7 @@ import useEngineContext from "../../hooks/useEngineContext";
|
|
|
24
24
|
import Actions from "./Actions";
|
|
25
25
|
import Header from "./Header";
|
|
26
26
|
import Summary from "./Summary";
|
|
27
|
-
import { clearTableSettingToLocalStorage, getCurrentViewModeFromLocalStorage, getHash, getTableSettingFromLocalStorage, mergeColumnSetting, omit, stringify } from "./Table/utils";
|
|
27
|
+
import { clearTableSettingToLocalStorage, getCurrentViewModeFromLocalStorage, getTableSettingByCurrentViewMode, getHash, getTableSettingFromLocalStorage, mergeColumnSetting, omit, stringify } from "./Table/utils";
|
|
28
28
|
import View from "./View";
|
|
29
29
|
import useTableSetting from "./hooks/useTableSetting";
|
|
30
30
|
import useTransDataSourceGroupSetting from "./hooks/useTransDataSourceGroupSetting";
|
|
@@ -58,6 +58,7 @@ var GridView = Provider( /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
58
58
|
_onValuesChange = props.onValuesChange,
|
|
59
59
|
columnSetting = props.columnSetting,
|
|
60
60
|
propsDataSourceGroup = props.dataSourceGroup,
|
|
61
|
+
_localSettings = props.localSettings,
|
|
61
62
|
_props$view = props.view,
|
|
62
63
|
view = _props$view === void 0 ? defaultView : _props$view,
|
|
63
64
|
gallery = props.gallery,
|
|
@@ -162,7 +163,8 @@ var GridView = Provider( /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
162
163
|
view: view,
|
|
163
164
|
currentViewMode: currentViewMode,
|
|
164
165
|
gallery: gallery,
|
|
165
|
-
currentSettingHash: currentSettingHash
|
|
166
|
+
currentSettingHash: currentSettingHash,
|
|
167
|
+
localSettings: _localSettings
|
|
166
168
|
}),
|
|
167
169
|
setTableSetting = _useTableSetting.setTableSetting,
|
|
168
170
|
tableSetting = _useTableSetting.tableSetting;
|
|
@@ -246,6 +248,15 @@ var GridView = Provider( /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
246
248
|
useImperativeHandle(ref, function () {
|
|
247
249
|
if (wrapRef.current) {
|
|
248
250
|
wrapRef.current.formInstance = form;
|
|
251
|
+
wrapRef.current.getCachedFilters = function () {
|
|
252
|
+
try {
|
|
253
|
+
if (!tableId) return {};
|
|
254
|
+
var setting = getTableSettingByCurrentViewMode(tableId, currentViewMode);
|
|
255
|
+
return (setting === null || setting === void 0 ? void 0 : setting.filters) || {};
|
|
256
|
+
} catch (e) {
|
|
257
|
+
return {};
|
|
258
|
+
}
|
|
259
|
+
};
|
|
249
260
|
}
|
|
250
261
|
// forwardRef 后需要返回元素才能选中
|
|
251
262
|
return wrapRef.current;
|
|
@@ -191,6 +191,21 @@ export declare type ExportImportType = {
|
|
|
191
191
|
apiUrl?: ApiProps;
|
|
192
192
|
otherParams?: any;
|
|
193
193
|
};
|
|
194
|
+
/**
|
|
195
|
+
* 设置记忆范围
|
|
196
|
+
*/
|
|
197
|
+
export declare type LocalSettingsScope = "filters" | "sorting" | "columns";
|
|
198
|
+
/**
|
|
199
|
+
* 本地记忆设置
|
|
200
|
+
*/
|
|
201
|
+
export declare type LocalSettingsType = {
|
|
202
|
+
/** 启用设置记忆 */
|
|
203
|
+
enable: boolean;
|
|
204
|
+
/** 记忆范围 */
|
|
205
|
+
scope: LocalSettingsScope[];
|
|
206
|
+
/** 不需要记忆的筛选字段(当 scope 包含 filters 时生效) */
|
|
207
|
+
excludedFilterFields?: string[];
|
|
208
|
+
};
|
|
194
209
|
export declare type GridViewProps = {
|
|
195
210
|
columns: any;
|
|
196
211
|
dataSource: any[];
|
|
@@ -247,5 +262,7 @@ export declare type GridViewProps = {
|
|
|
247
262
|
sortBy?: string;
|
|
248
263
|
}[];
|
|
249
264
|
};
|
|
265
|
+
/** 本地记忆设置 */
|
|
266
|
+
localSettings?: LocalSettingsType;
|
|
250
267
|
};
|
|
251
268
|
export {};
|
|
@@ -37,9 +37,20 @@ var Guide = function Guide(props) {
|
|
|
37
37
|
* @Date: 2025-06-09 14:36
|
|
38
38
|
*/
|
|
39
39
|
var handleClick = function handleClick(e) {
|
|
40
|
-
var _setting$skipLink;
|
|
40
|
+
var _setting$skipLink, _utils$interaction, _utils$interaction$is;
|
|
41
41
|
e.stopPropagation();
|
|
42
42
|
if (!(_setting !== null && _setting !== void 0 && (_setting$skipLink = _setting.skipLink) !== null && _setting$skipLink !== void 0 && _setting$skipLink.page)) return;
|
|
43
|
+
if (utils !== null && utils !== void 0 && (_utils$interaction = utils.interaction) !== null && _utils$interaction !== void 0 && (_utils$interaction = _utils$interaction.utils) !== null && _utils$interaction !== void 0 && (_utils$interaction$is = _utils$interaction.isAppEnv) !== null && _utils$interaction$is !== void 0 && _utils$interaction$is.call(_utils$interaction)) {
|
|
44
|
+
var _utils$interaction2, _utils$interaction2$p;
|
|
45
|
+
utils === null || utils === void 0 || (_utils$interaction2 = utils.interaction) === null || _utils$interaction2 === void 0 || (_utils$interaction2 = _utils$interaction2.utils) === null || _utils$interaction2 === void 0 || (_utils$interaction2$p = _utils$interaction2.postMessageToApp) === null || _utils$interaction2$p === void 0 || _utils$interaction2$p.call(_utils$interaction2, {
|
|
46
|
+
module: 'global',
|
|
47
|
+
key: 'openNative',
|
|
48
|
+
data: {
|
|
49
|
+
link: _setting === null || _setting === void 0 ? void 0 : _setting.skipLink
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
43
54
|
utils === null || utils === void 0 || utils.jumpPageByLink(_setting === null || _setting === void 0 ? void 0 : _setting.skipLink);
|
|
44
55
|
};
|
|
45
56
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -18,6 +18,7 @@ import { Card, QRCode } from 'antd';
|
|
|
18
18
|
import classNames from 'classnames';
|
|
19
19
|
import React, { useMemo, useState } from 'react';
|
|
20
20
|
import Barcode from 'react-barcode';
|
|
21
|
+
import EyeOff from '@pisell/icon/es/EyeOff';
|
|
21
22
|
import { getText } from "../../locales/index";
|
|
22
23
|
import Iconfont from "./../iconfont";
|
|
23
24
|
import PisellModal from "./../pisellModal";
|
|
@@ -148,13 +149,17 @@ var CardHeader = function CardHeader(_ref2) {
|
|
|
148
149
|
codeType = _ref2$codeType === void 0 ? 'barCode' : _ref2$codeType,
|
|
149
150
|
onCodeClick = _ref2.onCodeClick,
|
|
150
151
|
_ref2$isLogin = _ref2.isLogin,
|
|
151
|
-
isLogin = _ref2$isLogin === void 0 ? false : _ref2$isLogin
|
|
152
|
+
isLogin = _ref2$isLogin === void 0 ? false : _ref2$isLogin,
|
|
153
|
+
_ref2$showViewPin = _ref2.showViewPin,
|
|
154
|
+
showViewPin = _ref2$showViewPin === void 0 ? false : _ref2$showViewPin,
|
|
155
|
+
onViewPinClick = _ref2.onViewPinClick;
|
|
152
156
|
// 处理可能为0/1的布尔值
|
|
153
157
|
var processedShowIcon = toBooleanValue(showIcon);
|
|
154
158
|
var processedShowWalletName = toBooleanValue(showWalletName);
|
|
155
159
|
var processedShowShopName = toBooleanValue(showShopName);
|
|
156
160
|
var processedShowCardNo = toBooleanValue(showCardNo);
|
|
157
161
|
var processedShowCode = toBooleanValue(showCode);
|
|
162
|
+
var processedShowViewPin = toBooleanValue(showViewPin);
|
|
158
163
|
return /*#__PURE__*/React.createElement("div", {
|
|
159
164
|
className: "pisell-wallet-card-header"
|
|
160
165
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -172,7 +177,12 @@ var CardHeader = function CardHeader(_ref2) {
|
|
|
172
177
|
}
|
|
173
178
|
})) : null, processedShowWalletName && walletName && /*#__PURE__*/React.createElement("div", {
|
|
174
179
|
className: "pisell-wallet-card-header-level-text"
|
|
175
|
-
}, walletName)), processedShowShopName && shopName && /*#__PURE__*/React.createElement("div", null, shopName), processedShowCardNo && cardNo && /*#__PURE__*/React.createElement("div", null, cardNo)
|
|
180
|
+
}, walletName)), processedShowShopName && shopName && /*#__PURE__*/React.createElement("div", null, shopName), processedShowCardNo && cardNo && /*#__PURE__*/React.createElement("div", null, cardNo), processedShowViewPin && /*#__PURE__*/React.createElement("div", {
|
|
181
|
+
className: "pisell-wallet-card-header-view-pin",
|
|
182
|
+
onClick: onViewPinClick
|
|
183
|
+
}, getText('walletCard-viewPin'), /*#__PURE__*/React.createElement(EyeOff, {
|
|
184
|
+
className: "pisell-wallet-card-header-view-pin-icon"
|
|
185
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
176
186
|
className: "pisell-wallet-card-header-right"
|
|
177
187
|
}, processedShowCode && cardStyle === 'normal' && /*#__PURE__*/React.createElement("div", {
|
|
178
188
|
className: "pisell-wallet-card-icon-wrapper",
|
|
@@ -339,6 +349,7 @@ var WalletCard = function WalletCard(props) {
|
|
|
339
349
|
var showCardNo = toBooleanValue(mergedProps.showCardNo);
|
|
340
350
|
var showCode = toBooleanValue(mergedProps.showCode);
|
|
341
351
|
var isLogin = toBooleanValue(mergedProps.isLogin);
|
|
352
|
+
var showViewPin = toBooleanValue(mergedProps === null || mergedProps === void 0 ? void 0 : mergedProps.showViewPin);
|
|
342
353
|
var context = useEngineContext();
|
|
343
354
|
var _ref7 = context.appHelper || {},
|
|
344
355
|
utils = _ref7.utils;
|
|
@@ -347,6 +358,7 @@ var WalletCard = function WalletCard(props) {
|
|
|
347
358
|
isModalOpen = _useCodeModal.isModalOpen,
|
|
348
359
|
handleCodeClick = _useCodeModal.handleCodeClick,
|
|
349
360
|
closeModal = _useCodeModal.closeModal;
|
|
361
|
+
console.log('showViewPin', props);
|
|
350
362
|
|
|
351
363
|
// 计算背景样式
|
|
352
364
|
var backgroundStyle = useMemo(function () {
|
|
@@ -378,6 +390,18 @@ var WalletCard = function WalletCard(props) {
|
|
|
378
390
|
callback: function callback() {}
|
|
379
391
|
});
|
|
380
392
|
};
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* 查看PIN的回调
|
|
396
|
+
*/
|
|
397
|
+
var onViewPinClick = function onViewPinClick(e) {
|
|
398
|
+
e.stopPropagation();
|
|
399
|
+
if (props !== null && props !== void 0 && props.onViewPinClick) {
|
|
400
|
+
props.onViewPinClick();
|
|
401
|
+
} else {
|
|
402
|
+
console.error('onViewPinClick方法需要传入');
|
|
403
|
+
}
|
|
404
|
+
};
|
|
381
405
|
return /*#__PURE__*/React.createElement("div", {
|
|
382
406
|
className: classNames('pisell-wallet-card-wrapper', className),
|
|
383
407
|
style: style,
|
|
@@ -415,7 +439,9 @@ var WalletCard = function WalletCard(props) {
|
|
|
415
439
|
cardStyle: cardStyle,
|
|
416
440
|
codeType: codeType,
|
|
417
441
|
onCodeClick: handleCodeClick,
|
|
418
|
-
isLogin: isLogin
|
|
442
|
+
isLogin: isLogin,
|
|
443
|
+
showViewPin: showViewPin,
|
|
444
|
+
onViewPinClick: onViewPinClick
|
|
419
445
|
}), /*#__PURE__*/React.createElement(CardContent, {
|
|
420
446
|
items: items,
|
|
421
447
|
symbol: symbol
|
|
@@ -106,6 +106,33 @@
|
|
|
106
106
|
margin-bottom: 0;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
+
|
|
110
|
+
.pisell-wallet-card-header-view-pin {
|
|
111
|
+
position: relative;
|
|
112
|
+
color: #53b1fd;
|
|
113
|
+
cursor: pointer;
|
|
114
|
+
font-size: 12px;
|
|
115
|
+
font-weight: 400;
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
gap: 4px;
|
|
119
|
+
|
|
120
|
+
.pisell-wallet-card-header-view-pin-icon {
|
|
121
|
+
width: 16px;
|
|
122
|
+
height: 16px;
|
|
123
|
+
color: #53b1fd;
|
|
124
|
+
font-size: 16px;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&:after {
|
|
128
|
+
content: '';
|
|
129
|
+
position: absolute;
|
|
130
|
+
top: -5px;
|
|
131
|
+
left: -5px;
|
|
132
|
+
right: -5px;
|
|
133
|
+
bottom: -5px; /* 向外扩展5px */
|
|
134
|
+
}
|
|
135
|
+
}
|
|
109
136
|
}
|
|
110
137
|
|
|
111
138
|
// 头部右侧
|