@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
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
7
|
var __export = (target, all) => {
|
|
6
8
|
for (var name in all)
|
|
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
16
|
}
|
|
15
17
|
return to;
|
|
16
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
|
+
));
|
|
17
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
28
|
|
|
19
29
|
// src/components/table/hooks/useTableSetting.ts
|
|
@@ -25,6 +35,7 @@ module.exports = __toCommonJS(useTableSetting_exports);
|
|
|
25
35
|
var import_react = require("react");
|
|
26
36
|
var import_utils = require("../Table/utils");
|
|
27
37
|
var import_ahooks = require("ahooks");
|
|
38
|
+
var import_react2 = __toESM(require("react"));
|
|
28
39
|
var useTableSetting = (params) => {
|
|
29
40
|
const {
|
|
30
41
|
tableId,
|
|
@@ -37,7 +48,8 @@ var useTableSetting = (params) => {
|
|
|
37
48
|
columns: propsColumns,
|
|
38
49
|
gallery,
|
|
39
50
|
currentSettingHash,
|
|
40
|
-
exportImport
|
|
51
|
+
exportImport,
|
|
52
|
+
localSettings
|
|
41
53
|
} = params;
|
|
42
54
|
const columnsMap = (0, import_react.useMemo)(() => {
|
|
43
55
|
return new Map(propsColumns.map((item) => [item.key, item]));
|
|
@@ -67,7 +79,8 @@ var useTableSetting = (params) => {
|
|
|
67
79
|
};
|
|
68
80
|
}, [gallery, columns]);
|
|
69
81
|
const localStorageSettingKeyArr = (0, import_react.useMemo)(() => {
|
|
70
|
-
|
|
82
|
+
var _a;
|
|
83
|
+
const keys = (0, import_utils.getSettingKeyArrByMode)({
|
|
71
84
|
filter,
|
|
72
85
|
columnSetting,
|
|
73
86
|
dataSourceGroup,
|
|
@@ -75,6 +88,12 @@ var useTableSetting = (params) => {
|
|
|
75
88
|
mode: "localStorage",
|
|
76
89
|
currentViewMode
|
|
77
90
|
});
|
|
91
|
+
if ((localSettings == null ? void 0 : localSettings.enable) && ((_a = localSettings.scope) == null ? void 0 : _a.includes("filters"))) {
|
|
92
|
+
if (!keys.includes("filters")) {
|
|
93
|
+
keys.push("filters");
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return keys;
|
|
78
97
|
}, [tableId, filter, columnSetting, dataSourceGroup, sort, currentViewMode]);
|
|
79
98
|
const defaultKeyArr = (0, import_react.useMemo)(() => {
|
|
80
99
|
return (0, import_utils.getSettingKeyArrByMode)({
|
|
@@ -129,6 +148,8 @@ var useTableSetting = (params) => {
|
|
|
129
148
|
compactMode: ((_c = mergedSetting == null ? void 0 : mergedSetting[item]) == null ? void 0 : _c.compactMode) || defaultGalleryCoverSetting.compactMode,
|
|
130
149
|
isShowLabel: ((_d = mergedSetting == null ? void 0 : mergedSetting[item]) == null ? void 0 : _d.isShowLabel) ?? defaultGalleryCoverSetting.isShowLabel
|
|
131
150
|
};
|
|
151
|
+
} else if (item === "filters") {
|
|
152
|
+
setting[item] = (mergedSetting == null ? void 0 : mergedSetting[item]) || {};
|
|
132
153
|
} else {
|
|
133
154
|
setting[item] = mergedSetting == null ? void 0 : mergedSetting[item];
|
|
134
155
|
}
|
|
@@ -187,20 +208,109 @@ var useTableSetting = (params) => {
|
|
|
187
208
|
sortButtonShow
|
|
188
209
|
]);
|
|
189
210
|
const setTableSetting = (0, import_ahooks.useMemoizedFn)((values) => {
|
|
211
|
+
var _a;
|
|
212
|
+
let valuesForSave = values;
|
|
213
|
+
if ((localSettings == null ? void 0 : localSettings.enable) && ((_a = localSettings.scope) == null ? void 0 : _a.includes("filters"))) {
|
|
214
|
+
const excluded = new Set((localSettings == null ? void 0 : localSettings.excludedFilterFields) || []);
|
|
215
|
+
const filterValue = {};
|
|
216
|
+
((filter == null ? void 0 : filter.list) || []).forEach((item) => {
|
|
217
|
+
const rawName = item == null ? void 0 : item.name;
|
|
218
|
+
if (!rawName) return;
|
|
219
|
+
const key = Array.isArray(rawName) ? rawName.join(",") : String(rawName);
|
|
220
|
+
if (excluded.has(key)) return;
|
|
221
|
+
if (values.hasOwnProperty(key)) {
|
|
222
|
+
filterValue[key] = values[key];
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
valuesForSave = {
|
|
226
|
+
...values,
|
|
227
|
+
filters: filterValue
|
|
228
|
+
};
|
|
229
|
+
}
|
|
190
230
|
(0, import_utils.setFormValuesToLocalStorage)({
|
|
191
231
|
tableId,
|
|
192
|
-
allValues:
|
|
232
|
+
allValues: valuesForSave,
|
|
193
233
|
keys: localStorageSettingKeyArr,
|
|
194
234
|
currentViewMode,
|
|
195
235
|
currentSettingHash
|
|
196
236
|
});
|
|
197
237
|
});
|
|
198
238
|
const tableSetting = (0, import_react.useMemo)(() => {
|
|
199
|
-
|
|
239
|
+
var _a;
|
|
240
|
+
const merged = {
|
|
200
241
|
...tableLocalSetting,
|
|
201
242
|
...defaultTableSetting
|
|
202
243
|
};
|
|
244
|
+
if ((localSettings == null ? void 0 : localSettings.enable) && ((_a = localSettings.scope) == null ? void 0 : _a.includes("filters"))) {
|
|
245
|
+
const persistedFilter = tableLocalSetting == null ? void 0 : tableLocalSetting.filters;
|
|
246
|
+
if (persistedFilter && typeof persistedFilter === "object") {
|
|
247
|
+
return {
|
|
248
|
+
...merged,
|
|
249
|
+
...persistedFilter
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return merged;
|
|
203
254
|
}, [tableLocalSetting, defaultTableSetting]);
|
|
255
|
+
(0, import_react.useMemo)(() => {
|
|
256
|
+
var _a;
|
|
257
|
+
try {
|
|
258
|
+
if (!tableId) return;
|
|
259
|
+
const current = (0, import_utils.getTableSettingByCurrentViewMode)(tableId, currentViewMode) || {};
|
|
260
|
+
const persistedFilters = (current == null ? void 0 : current.filters) || {};
|
|
261
|
+
let nextFilters = { ...persistedFilters };
|
|
262
|
+
let shouldUpdate = false;
|
|
263
|
+
const enableFiltersMemory = !!((localSettings == null ? void 0 : localSettings.enable) && ((_a = localSettings.scope) == null ? void 0 : _a.includes("filters")));
|
|
264
|
+
if (!enableFiltersMemory) {
|
|
265
|
+
if (Object.keys(persistedFilters || {}).length > 0) {
|
|
266
|
+
nextFilters = {};
|
|
267
|
+
shouldUpdate = true;
|
|
268
|
+
}
|
|
269
|
+
} else {
|
|
270
|
+
let names = /* @__PURE__ */ new Set();
|
|
271
|
+
if (import_react2.default.isValidElement(filter)) {
|
|
272
|
+
names = new Set(
|
|
273
|
+
((filter == null ? void 0 : filter.__items) || []).filter((item) => !item.isHidden).map((item) => {
|
|
274
|
+
const rawName = item == null ? void 0 : item.value;
|
|
275
|
+
if (!rawName) return void 0;
|
|
276
|
+
return Array.isArray(rawName) ? rawName.join(",") : String(rawName);
|
|
277
|
+
})
|
|
278
|
+
);
|
|
279
|
+
} else {
|
|
280
|
+
names = new Set(
|
|
281
|
+
((filter == null ? void 0 : filter.list) || []).map((item) => {
|
|
282
|
+
const rawName = item == null ? void 0 : item.name;
|
|
283
|
+
if (!rawName) return void 0;
|
|
284
|
+
return Array.isArray(rawName) ? rawName.join(",") : String(rawName);
|
|
285
|
+
}).filter(Boolean)
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
const excluded = new Set((localSettings == null ? void 0 : localSettings.excludedFilterFields) || []);
|
|
289
|
+
const allowed = new Set(Array.from(names).filter((k) => !excluded.has(k)));
|
|
290
|
+
const filtered = {};
|
|
291
|
+
Object.keys(persistedFilters || {}).forEach((k) => {
|
|
292
|
+
if (allowed.has(k)) {
|
|
293
|
+
filtered[k] = persistedFilters[k];
|
|
294
|
+
} else {
|
|
295
|
+
shouldUpdate = true;
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
if (Object.keys(filtered).length !== Object.keys(persistedFilters || {}).length) {
|
|
299
|
+
shouldUpdate = true;
|
|
300
|
+
}
|
|
301
|
+
nextFilters = filtered;
|
|
302
|
+
}
|
|
303
|
+
if (shouldUpdate) {
|
|
304
|
+
(0, import_utils.setTableSettingToLocalStorage)({
|
|
305
|
+
tableId,
|
|
306
|
+
tableSettingObj: { filters: nextFilters },
|
|
307
|
+
currentViewMode,
|
|
308
|
+
currentSettingHash
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
} catch (e) {
|
|
312
|
+
}
|
|
313
|
+
}, []);
|
|
204
314
|
return {
|
|
205
315
|
setTableSetting,
|
|
206
316
|
tableSetting
|
|
@@ -76,6 +76,7 @@ var GridView = (0, import_model.Provider)(
|
|
|
76
76
|
onValuesChange,
|
|
77
77
|
columnSetting,
|
|
78
78
|
dataSourceGroup: propsDataSourceGroup,
|
|
79
|
+
localSettings: _localSettings,
|
|
79
80
|
view = defaultView,
|
|
80
81
|
gallery,
|
|
81
82
|
currentSettingKey,
|
|
@@ -171,7 +172,8 @@ var GridView = (0, import_model.Provider)(
|
|
|
171
172
|
view,
|
|
172
173
|
currentViewMode,
|
|
173
174
|
gallery,
|
|
174
|
-
currentSettingHash
|
|
175
|
+
currentSettingHash,
|
|
176
|
+
localSettings: _localSettings
|
|
175
177
|
});
|
|
176
178
|
const getIsTriggerValuesChange = (0, import_useTriggerValuesChange.default)({
|
|
177
179
|
filter,
|
|
@@ -260,6 +262,15 @@ var GridView = (0, import_model.Provider)(
|
|
|
260
262
|
(0, import_react.useImperativeHandle)(ref, () => {
|
|
261
263
|
if (wrapRef.current) {
|
|
262
264
|
wrapRef.current.formInstance = form;
|
|
265
|
+
wrapRef.current.getCachedFilters = () => {
|
|
266
|
+
try {
|
|
267
|
+
if (!tableId) return {};
|
|
268
|
+
const setting = (0, import_utils.getTableSettingByCurrentViewMode)(tableId, currentViewMode);
|
|
269
|
+
return (setting == null ? void 0 : setting.filters) || {};
|
|
270
|
+
} catch (e) {
|
|
271
|
+
return {};
|
|
272
|
+
}
|
|
273
|
+
};
|
|
263
274
|
}
|
|
264
275
|
return wrapRef.current;
|
|
265
276
|
});
|
|
@@ -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 {};
|
|
@@ -51,9 +51,19 @@ var Guide = (props) => {
|
|
|
51
51
|
return (setting == null ? void 0 : setting.walletGuideConfig) || {};
|
|
52
52
|
}, [setting == null ? void 0 : setting.walletGuideConfig]);
|
|
53
53
|
const handleClick = (e) => {
|
|
54
|
-
var _a2;
|
|
54
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
55
55
|
e.stopPropagation();
|
|
56
56
|
if (!((_a2 = _setting == null ? void 0 : _setting.skipLink) == null ? void 0 : _a2.page)) return;
|
|
57
|
+
if ((_d2 = (_c2 = (_b2 = utils == null ? void 0 : utils.interaction) == null ? void 0 : _b2.utils) == null ? void 0 : _c2.isAppEnv) == null ? void 0 : _d2.call(_c2)) {
|
|
58
|
+
(_g2 = (_f2 = (_e2 = utils == null ? void 0 : utils.interaction) == null ? void 0 : _e2.utils) == null ? void 0 : _f2.postMessageToApp) == null ? void 0 : _g2.call(_f2, {
|
|
59
|
+
module: "global",
|
|
60
|
+
key: "openNative",
|
|
61
|
+
data: {
|
|
62
|
+
link: _setting == null ? void 0 : _setting.skipLink
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
57
67
|
utils == null ? void 0 : utils.jumpPageByLink(_setting == null ? void 0 : _setting.skipLink);
|
|
58
68
|
};
|
|
59
69
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -36,6 +36,7 @@ var import_antd = require("antd");
|
|
|
36
36
|
var import_classnames = __toESM(require("classnames"));
|
|
37
37
|
var import_react = __toESM(require("react"));
|
|
38
38
|
var import_react_barcode = __toESM(require("react-barcode"));
|
|
39
|
+
var import_EyeOff = __toESM(require("@pisell/icon/es/EyeOff"));
|
|
39
40
|
var import_locales = require("../../locales/index");
|
|
40
41
|
var import_iconfont = __toESM(require("./../iconfont"));
|
|
41
42
|
var import_pisellModal = __toESM(require("./../pisellModal"));
|
|
@@ -143,13 +144,16 @@ var CardHeader = ({
|
|
|
143
144
|
cardStyle = "normal",
|
|
144
145
|
codeType = "barCode",
|
|
145
146
|
onCodeClick,
|
|
146
|
-
isLogin = false
|
|
147
|
+
isLogin = false,
|
|
148
|
+
showViewPin = false,
|
|
149
|
+
onViewPinClick
|
|
147
150
|
}) => {
|
|
148
151
|
const processedShowIcon = toBooleanValue(showIcon);
|
|
149
152
|
const processedShowWalletName = toBooleanValue(showWalletName);
|
|
150
153
|
const processedShowShopName = toBooleanValue(showShopName);
|
|
151
154
|
const processedShowCardNo = toBooleanValue(showCardNo);
|
|
152
155
|
const processedShowCode = toBooleanValue(showCode);
|
|
156
|
+
const processedShowViewPin = toBooleanValue(showViewPin);
|
|
153
157
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-card-header" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-card-header-left" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-card-header-level" }, processedShowIcon && iconImg ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-card-header-icon" }, /* @__PURE__ */ import_react.default.createElement(
|
|
154
158
|
"img",
|
|
155
159
|
{
|
|
@@ -157,7 +161,15 @@ var CardHeader = ({
|
|
|
157
161
|
alt: "wallet icon",
|
|
158
162
|
style: { width: "20px", height: "20px" }
|
|
159
163
|
}
|
|
160
|
-
)) : null, processedShowWalletName && walletName && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-card-header-level-text" }, walletName)), processedShowShopName && shopName && /* @__PURE__ */ import_react.default.createElement("div", null, shopName), processedShowCardNo && cardNo && /* @__PURE__ */ import_react.default.createElement("div", null, cardNo)
|
|
164
|
+
)) : null, processedShowWalletName && walletName && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-card-header-level-text" }, walletName)), processedShowShopName && shopName && /* @__PURE__ */ import_react.default.createElement("div", null, shopName), processedShowCardNo && cardNo && /* @__PURE__ */ import_react.default.createElement("div", null, cardNo), processedShowViewPin && /* @__PURE__ */ import_react.default.createElement(
|
|
165
|
+
"div",
|
|
166
|
+
{
|
|
167
|
+
className: "pisell-wallet-card-header-view-pin",
|
|
168
|
+
onClick: onViewPinClick
|
|
169
|
+
},
|
|
170
|
+
(0, import_locales.getText)("walletCard-viewPin"),
|
|
171
|
+
/* @__PURE__ */ import_react.default.createElement(import_EyeOff.default, { className: "pisell-wallet-card-header-view-pin-icon" })
|
|
172
|
+
)), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-card-header-right" }, processedShowCode && cardStyle === "normal" && /* @__PURE__ */ import_react.default.createElement(
|
|
161
173
|
"div",
|
|
162
174
|
{
|
|
163
175
|
className: "pisell-wallet-card-icon-wrapper",
|
|
@@ -287,6 +299,7 @@ var WalletCard = (props) => {
|
|
|
287
299
|
const showCardNo = toBooleanValue(mergedProps.showCardNo);
|
|
288
300
|
const showCode = toBooleanValue(mergedProps.showCode);
|
|
289
301
|
const isLogin = toBooleanValue(mergedProps.isLogin);
|
|
302
|
+
const showViewPin = toBooleanValue(mergedProps == null ? void 0 : mergedProps.showViewPin);
|
|
290
303
|
const context = (0, import_useEngineContext.default)();
|
|
291
304
|
const { utils } = context.appHelper || {};
|
|
292
305
|
const { isModalOpen, handleCodeClick, closeModal } = useCodeModal(
|
|
@@ -294,6 +307,7 @@ var WalletCard = (props) => {
|
|
|
294
307
|
onCodeClick,
|
|
295
308
|
codeType
|
|
296
309
|
);
|
|
310
|
+
console.log("showViewPin", props);
|
|
297
311
|
const backgroundStyle = (0, import_react.useMemo)(() => {
|
|
298
312
|
var _a2;
|
|
299
313
|
if (props.customBackgroundImage) {
|
|
@@ -327,6 +341,14 @@ var WalletCard = (props) => {
|
|
|
327
341
|
}
|
|
328
342
|
});
|
|
329
343
|
};
|
|
344
|
+
const onViewPinClick = (e) => {
|
|
345
|
+
e.stopPropagation();
|
|
346
|
+
if (props == null ? void 0 : props.onViewPinClick) {
|
|
347
|
+
props.onViewPinClick();
|
|
348
|
+
} else {
|
|
349
|
+
console.error("onViewPinClick方法需要传入");
|
|
350
|
+
}
|
|
351
|
+
};
|
|
330
352
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
331
353
|
"div",
|
|
332
354
|
{
|
|
@@ -375,7 +397,9 @@ var WalletCard = (props) => {
|
|
|
375
397
|
cardStyle,
|
|
376
398
|
codeType,
|
|
377
399
|
onCodeClick: handleCodeClick,
|
|
378
|
-
isLogin
|
|
400
|
+
isLogin,
|
|
401
|
+
showViewPin,
|
|
402
|
+
onViewPinClick
|
|
379
403
|
}
|
|
380
404
|
),
|
|
381
405
|
/* @__PURE__ */ import_react.default.createElement(
|
|
@@ -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
|
// 头部右侧
|
package/lib/locales/en-US.js
CHANGED
|
@@ -169,6 +169,7 @@ var en_US_default = {
|
|
|
169
169
|
"pisell-adjust-price-discount-can-be-maximum": "Discount can be maximum",
|
|
170
170
|
"pisell-discount-card-title": "Discount",
|
|
171
171
|
"pisell-discount-card-unit": "off",
|
|
172
|
+
"pisell-discount-card-fixed-amount-prefix": "Save",
|
|
172
173
|
// 数据源表格
|
|
173
174
|
"pisell-data-source-table-add": "Add",
|
|
174
175
|
"pisell-data-source-table-edit": "Edit",
|
|
@@ -196,6 +197,7 @@ var en_US_default = {
|
|
|
196
197
|
"walletCard-done": "Done",
|
|
197
198
|
"walletCard-qrcode": "QR code",
|
|
198
199
|
"walletCard-barcode": "Bar code",
|
|
200
|
+
"walletCard-viewPin": "View PIN",
|
|
199
201
|
// 上传组件
|
|
200
202
|
"pisell-upload-button": "Upload",
|
|
201
203
|
"pisell-upload-setting-size-error": (maxSize) => `Each file should not exceed ${maxSize}MB in size.`,
|
|
@@ -326,5 +328,17 @@ var en_US_default = {
|
|
|
326
328
|
"pisell2.text.goodpass.product-vouchers": "Promotions & Vouchers",
|
|
327
329
|
"pisell2.text.goodpass.last-settlement": "(Last payment)",
|
|
328
330
|
"pisell2.text.goodpass.view-more": "View More",
|
|
329
|
-
"pisell2.text.goodpass.save": "Save"
|
|
331
|
+
"pisell2.text.goodpass.save": "Save",
|
|
332
|
+
// 相机组件
|
|
333
|
+
"pisell-camera-no-camera-accessible": "No camera accessible",
|
|
334
|
+
"pisell-camera-permission-denied": "Permission denied",
|
|
335
|
+
"pisell-camera-switch-camera": "Switch camera",
|
|
336
|
+
"pisell-camera-canvas": "Canvas not supported",
|
|
337
|
+
"pisell-camera-checking": "Detecting camera...",
|
|
338
|
+
"pisell-camera-no-camera-desc": "Please check if your device has a camera or grant browser permission to access camera",
|
|
339
|
+
// 拍照组件
|
|
340
|
+
"pisell-upload-camera-local-files": "Local Files",
|
|
341
|
+
"pisell-upload-camera-capture": "Capture",
|
|
342
|
+
"pisell-upload-camera-retake": "Retake",
|
|
343
|
+
"pisell-upload-camera-use": "Use photo"
|
|
330
344
|
};
|
package/lib/locales/zh-CN.js
CHANGED
|
@@ -169,6 +169,7 @@ var zh_CN_default = {
|
|
|
169
169
|
"pisell-adjust-price-discount-can-be-maximum": "折扣最高可达",
|
|
170
170
|
"pisell-discount-card-title": "折扣",
|
|
171
171
|
"pisell-discount-card-unit": "折扣",
|
|
172
|
+
"pisell-discount-card-fixed-amount-prefix": "立减",
|
|
172
173
|
"pisell-data-source-table-add": "添加",
|
|
173
174
|
"pisell-data-source-table-edit": "编辑",
|
|
174
175
|
"pisell-data-source-table-detail": "详情",
|
|
@@ -195,6 +196,7 @@ var zh_CN_default = {
|
|
|
195
196
|
"walletCard-done": "完成",
|
|
196
197
|
"walletCard-qrcode": "二维码",
|
|
197
198
|
"walletCard-barcode": "条形码",
|
|
199
|
+
"walletCard-viewPin": "查看PIN",
|
|
198
200
|
// 上传组件
|
|
199
201
|
"pisell-upload-button": "上传",
|
|
200
202
|
"pisell-upload-setting-size-error": (maxSize) => `每个文件的大小不超过${maxSize}MB`,
|
|
@@ -317,5 +319,17 @@ var zh_CN_default = {
|
|
|
317
319
|
"pisell2.text.goodpass.product-vouchers": "优惠促销",
|
|
318
320
|
"pisell2.text.goodpass.last-settlement": "(上次结算)",
|
|
319
321
|
"pisell2.text.goodpass.view-more": "查看更多",
|
|
320
|
-
"pisell2.text.goodpass.save": "节省"
|
|
322
|
+
"pisell2.text.goodpass.save": "节省",
|
|
323
|
+
// 相机组件
|
|
324
|
+
"pisell-camera-no-camera-accessible": "没有找到摄像头",
|
|
325
|
+
"pisell-camera-permission-denied": "没有权限使用摄像头",
|
|
326
|
+
"pisell-camera-switch-camera": "切换摄像头",
|
|
327
|
+
"pisell-camera-canvas": "canvas不支持",
|
|
328
|
+
"pisell-camera-checking": "正在检测摄像头...",
|
|
329
|
+
"pisell-camera-no-camera-desc": "请检查设备是否连接摄像头或授权浏览器访问摄像头",
|
|
330
|
+
// 拍照组件
|
|
331
|
+
"pisell-upload-camera-local-files": "本地文件",
|
|
332
|
+
"pisell-upload-camera-capture": "拍摄/拍照",
|
|
333
|
+
"pisell-upload-camera-retake": "重拍",
|
|
334
|
+
"pisell-upload-camera-use": "使用照片"
|
|
321
335
|
};
|
package/lib/locales/zh-TW.js
CHANGED
|
@@ -169,6 +169,7 @@ var zh_TW_default = {
|
|
|
169
169
|
"pisell-adjust-price-discount-can-be-maximum": "折扣最高可達",
|
|
170
170
|
"pisell-discount-card-title": "折扣",
|
|
171
171
|
"pisell-discount-card-unit": "折扣",
|
|
172
|
+
"pisell-discount-card-fixed-amount-prefix": "立減",
|
|
172
173
|
// 数据源表格
|
|
173
174
|
"pisell-data-source-table-add": "添加",
|
|
174
175
|
"pisell-data-source-table-edit": "編輯",
|
|
@@ -195,6 +196,7 @@ var zh_TW_default = {
|
|
|
195
196
|
"walletCard-done": "完成",
|
|
196
197
|
"walletCard-qrcode": "二維碼",
|
|
197
198
|
"walletCard-barcode": "條形碼",
|
|
199
|
+
"walletCard-viewPin": "查看PIN",
|
|
198
200
|
// 上传组件
|
|
199
201
|
"pisell-upload-button": "上傳",
|
|
200
202
|
"pisell-upload-setting-size-error": (maxSize) => `每個文件的大小不超過${maxSize}MB`,
|
|
@@ -318,5 +320,17 @@ var zh_TW_default = {
|
|
|
318
320
|
"pisell2.text.goodpass.product-vouchers": "優惠促銷",
|
|
319
321
|
"pisell2.text.goodpass.last-settlement": "(上次結算)",
|
|
320
322
|
"pisell2.text.goodpass.view-more": "查看更多",
|
|
321
|
-
"pisell2.text.goodpass.save": "節省"
|
|
323
|
+
"pisell2.text.goodpass.save": "節省",
|
|
324
|
+
// 相机组件
|
|
325
|
+
"pisell-camera-no-camera-accessible": "沒有找到攝像頭",
|
|
326
|
+
"pisell-camera-permission-denied": "沒有權限使用攝像頭",
|
|
327
|
+
"pisell-camera-switch-camera": "切換攝像頭",
|
|
328
|
+
"pisell-camera-canvas": "canvas不支持",
|
|
329
|
+
"pisell-camera-checking": "正在檢測攝像頭...",
|
|
330
|
+
"pisell-camera-no-camera-desc": "請檢查設備是否連接攝像頭或授權瀏覽器訪問攝像頭",
|
|
331
|
+
// 拍照组件
|
|
332
|
+
"pisell-upload-camera-local-files": "本地文件",
|
|
333
|
+
"pisell-upload-camera-capture": "拍攝/拍照",
|
|
334
|
+
"pisell-upload-camera-retake": "重拍",
|
|
335
|
+
"pisell-upload-camera-use": "使用照片"
|
|
322
336
|
};
|
package/lib/utils/index.d.ts
CHANGED