@pisell/materials 6.2.39 → 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 +4 -4
- 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/hooks/useTableProps.js +23 -12
- 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/filter/types.d.ts +1 -0
- package/es/components/pisellCamera/index.js +228 -0
- package/es/components/pisellCamera/index.less +131 -0
- package/es/components/pisellWalletPassCard/index.d.ts +1 -0
- package/es/components/pisellWalletPassCard/index.js +6 -1
- package/es/components/table/hooks/useTableSetting.js +1 -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/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +10 -4
- 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/filter/types.d.ts +1 -0
- package/lib/components/pisellCamera/index.js +222 -0
- package/lib/components/pisellCamera/index.less +131 -0
- package/lib/components/pisellWalletPassCard/index.d.ts +1 -0
- package/lib/components/pisellWalletPassCard/index.js +9 -1
- package/lib/components/table/hooks/useTableSetting.js +1 -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/lowcode/data-source-table/meta.ts +119 -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/wallet-card/meta.ts +81 -63
- package/package.json +4 -3
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +0 -97
- 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 -37
- 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 -97
- 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 -37
- 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
|
@@ -0,0 +1,222 @@
|
|
|
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/pisellCamera/index.tsx
|
|
30
|
+
var pisellCamera_exports = {};
|
|
31
|
+
__export(pisellCamera_exports, {
|
|
32
|
+
default: () => pisellCamera_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(pisellCamera_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_react_camera_pro = require("react-camera-pro");
|
|
37
|
+
var import_iconfont = __toESM(require("../iconfont"));
|
|
38
|
+
var import_locales = require("../../locales");
|
|
39
|
+
var import_pisellModal = __toESM(require("../../components/pisellModal"));
|
|
40
|
+
var import_index = require("./index.less");
|
|
41
|
+
var PisellCamera = (0, import_react.forwardRef)((props, ref) => {
|
|
42
|
+
const cameraRef = (0, import_react.useRef)(null);
|
|
43
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
44
|
+
const [photo, setPhoto] = (0, import_react.useState)("");
|
|
45
|
+
const [cameraAvailable, setCameraAvailable] = (0, import_react.useState)(null);
|
|
46
|
+
const uploadFileRef = (0, import_react.useRef)(null);
|
|
47
|
+
const base64ToFile = (base64String, filename) => {
|
|
48
|
+
var _a;
|
|
49
|
+
const arr = base64String.split(",");
|
|
50
|
+
const mime = ((_a = arr[0].match(/:(.*?);/)) == null ? void 0 : _a[1]) || "";
|
|
51
|
+
const bstr = atob(arr[1]);
|
|
52
|
+
let n = bstr.length;
|
|
53
|
+
const u8arr = new Uint8Array(n);
|
|
54
|
+
while (n--) {
|
|
55
|
+
u8arr[n] = bstr.charCodeAt(n);
|
|
56
|
+
}
|
|
57
|
+
return new File([u8arr], filename, { type: mime });
|
|
58
|
+
};
|
|
59
|
+
const takePhoto = () => {
|
|
60
|
+
var _a, _b;
|
|
61
|
+
if (!cameraRef.current || !cameraRef.current.takePhoto) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
const photo2 = (_b = (_a = cameraRef.current) == null ? void 0 : _a.takePhoto) == null ? void 0 : _b.call(_a);
|
|
66
|
+
const timestamp = Date.now();
|
|
67
|
+
const filename = `photo-${timestamp}.jpg`;
|
|
68
|
+
setPhoto(photo2);
|
|
69
|
+
const file = base64ToFile(photo2, filename);
|
|
70
|
+
const uploadFile = {
|
|
71
|
+
uid: timestamp.toString(),
|
|
72
|
+
name: filename,
|
|
73
|
+
status: "uploading",
|
|
74
|
+
url: photo2,
|
|
75
|
+
// 用于预览
|
|
76
|
+
originFileObj: file,
|
|
77
|
+
// 原始文件对象,用于上传
|
|
78
|
+
thumbUrl: photo2,
|
|
79
|
+
lastModified: Date.now(),
|
|
80
|
+
lastModifiedDate: /* @__PURE__ */ new Date(),
|
|
81
|
+
type: "image/jpeg",
|
|
82
|
+
size: file.size
|
|
83
|
+
};
|
|
84
|
+
console.log("takePhoto_uploadFile", uploadFile);
|
|
85
|
+
uploadFileRef.current = uploadFile;
|
|
86
|
+
return uploadFile;
|
|
87
|
+
} catch (error) {
|
|
88
|
+
console.error("takePhoto_error", error);
|
|
89
|
+
uploadFileRef.current = null;
|
|
90
|
+
setPhoto("");
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const onOpen = () => {
|
|
95
|
+
setCameraAvailable(null);
|
|
96
|
+
setPhoto("");
|
|
97
|
+
uploadFileRef.current = null;
|
|
98
|
+
setOpen(true);
|
|
99
|
+
};
|
|
100
|
+
const onClose = () => {
|
|
101
|
+
cameraRef.current = null;
|
|
102
|
+
uploadFileRef.current = null;
|
|
103
|
+
setOpen(false);
|
|
104
|
+
setPhoto("");
|
|
105
|
+
setCameraAvailable(null);
|
|
106
|
+
};
|
|
107
|
+
const onRetakePhoto = () => {
|
|
108
|
+
setPhoto("");
|
|
109
|
+
};
|
|
110
|
+
const onUsePhoto = () => {
|
|
111
|
+
var _a;
|
|
112
|
+
(_a = props == null ? void 0 : props.onChange) == null ? void 0 : _a.call(props, uploadFileRef.current);
|
|
113
|
+
onClose();
|
|
114
|
+
};
|
|
115
|
+
(0, import_react.useImperativeHandle)(ref, () => {
|
|
116
|
+
return {
|
|
117
|
+
open: onOpen,
|
|
118
|
+
takePhoto,
|
|
119
|
+
isCameraAvailable: () => cameraAvailable
|
|
120
|
+
};
|
|
121
|
+
});
|
|
122
|
+
console.log("cameraAvailable", cameraAvailable);
|
|
123
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
124
|
+
import_pisellModal.default,
|
|
125
|
+
{
|
|
126
|
+
open,
|
|
127
|
+
onCancel: (e) => {
|
|
128
|
+
e.stopPropagation();
|
|
129
|
+
e.preventDefault();
|
|
130
|
+
onClose();
|
|
131
|
+
},
|
|
132
|
+
header: false,
|
|
133
|
+
footer: null,
|
|
134
|
+
destroyOnClose: true,
|
|
135
|
+
bodyStyle: { padding: 0 },
|
|
136
|
+
width: "90vw",
|
|
137
|
+
className: "pisell-camera-modal"
|
|
138
|
+
},
|
|
139
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
140
|
+
"div",
|
|
141
|
+
{
|
|
142
|
+
className: "pisell-camera-container",
|
|
143
|
+
onClick: (e) => {
|
|
144
|
+
e.stopPropagation();
|
|
145
|
+
e.preventDefault();
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
cameraAvailable === null ? (
|
|
149
|
+
// 检测中
|
|
150
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-camera-loading" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-camera-loading-text" }, (0, import_locales.getText)("pisell-camera-checking")))
|
|
151
|
+
) : cameraAvailable === false ? (
|
|
152
|
+
// 无摄像头
|
|
153
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-camera-no-camera" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-camera-no-camera-icon" }, "📷"), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-camera-no-camera-text" }, (0, import_locales.getText)("pisell-camera-no-camera-accessible")), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-camera-no-camera-desc" }, (0, import_locales.getText)("pisell-camera-no-camera-desc")))
|
|
154
|
+
) : null,
|
|
155
|
+
/* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
156
|
+
import_react_camera_pro.Camera,
|
|
157
|
+
{
|
|
158
|
+
ref: cameraRef,
|
|
159
|
+
facingMode: "environment",
|
|
160
|
+
errorMessages: {
|
|
161
|
+
// noCameraAccessible: getText('pisell-camera-no-camera-accessible'),
|
|
162
|
+
// permissionDenied: getText('pisell-camera-permission-denied'),
|
|
163
|
+
// switchCamera: getText('pisell-camera-switch-camera'),
|
|
164
|
+
// canvas: getText('pisell-camera-canvas'),
|
|
165
|
+
},
|
|
166
|
+
numberOfCamerasCallback: (numberOfCameras) => {
|
|
167
|
+
console.log("numberOfCameras", numberOfCameras);
|
|
168
|
+
if (!cameraRef.current) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
if (numberOfCameras <= 0) {
|
|
172
|
+
setTimeout(() => {
|
|
173
|
+
setCameraAvailable((pre) => {
|
|
174
|
+
if (pre === true) {
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
return false;
|
|
178
|
+
});
|
|
179
|
+
}, 5e3);
|
|
180
|
+
} else {
|
|
181
|
+
setCameraAvailable(true);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
), cameraAvailable === true && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-camera-action" }, /* @__PURE__ */ import_react.default.createElement(
|
|
186
|
+
"div",
|
|
187
|
+
{
|
|
188
|
+
className: "pisell-camera-action-item-wrap",
|
|
189
|
+
onClick: (e) => {
|
|
190
|
+
e.stopPropagation();
|
|
191
|
+
e.preventDefault();
|
|
192
|
+
takePhoto();
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-camera-action-item" }, /* @__PURE__ */ import_react.default.createElement(import_iconfont.default, { type: "pisell2-camera-01", style: { fontSize: 32 } }))
|
|
196
|
+
)), photo && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-camera-photo-container" }, /* @__PURE__ */ import_react.default.createElement("img", { src: photo, alt: "photo", className: "pisell-camera-photo" })), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-camera-photo-img-action" }, /* @__PURE__ */ import_react.default.createElement(
|
|
197
|
+
"div",
|
|
198
|
+
{
|
|
199
|
+
className: "pisell-camera-photo-img-action-item",
|
|
200
|
+
onClick: (e) => {
|
|
201
|
+
e.stopPropagation();
|
|
202
|
+
e.preventDefault();
|
|
203
|
+
onRetakePhoto();
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
(0, import_locales.getText)("pisell-upload-camera-retake")
|
|
207
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
208
|
+
"div",
|
|
209
|
+
{
|
|
210
|
+
className: "pisell-camera-photo-img-action-item",
|
|
211
|
+
onClick: (e) => {
|
|
212
|
+
e.stopPropagation();
|
|
213
|
+
e.preventDefault();
|
|
214
|
+
onUsePhoto();
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
(0, import_locales.getText)("pisell-upload-camera-use")
|
|
218
|
+
))))
|
|
219
|
+
)
|
|
220
|
+
);
|
|
221
|
+
});
|
|
222
|
+
var pisellCamera_default = PisellCamera;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
.pisell-camera-modal {
|
|
2
|
+
.pisell-camera-container {
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 90vh;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
|
|
10
|
+
.pisell-camera-action {
|
|
11
|
+
position: absolute;
|
|
12
|
+
bottom: 0;
|
|
13
|
+
left: 0;
|
|
14
|
+
right: 0;
|
|
15
|
+
height: 100px;
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
|
|
20
|
+
.pisell-camera-action-item-wrap {
|
|
21
|
+
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
padding: 6px;
|
|
24
|
+
border-radius: 50%;
|
|
25
|
+
border: 2px solid #fff;
|
|
26
|
+
|
|
27
|
+
.pisell-camera-action-item {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
width: 60px;
|
|
32
|
+
height: 60px;
|
|
33
|
+
background-color: #fff;
|
|
34
|
+
border-radius: 50%;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.pisell-camera-photo-container {
|
|
41
|
+
position: absolute;
|
|
42
|
+
top: 0;
|
|
43
|
+
left: 0;
|
|
44
|
+
right: 0;
|
|
45
|
+
bottom: 0;
|
|
46
|
+
width: 100%;
|
|
47
|
+
height: 100%;
|
|
48
|
+
|
|
49
|
+
.pisell-camera-photo {
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: 100%;
|
|
52
|
+
object-fit: cover;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.pisell-camera-photo-img-action {
|
|
57
|
+
position: absolute;
|
|
58
|
+
bottom: 0;
|
|
59
|
+
left: 0;
|
|
60
|
+
right: 0;
|
|
61
|
+
height: 100px;
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: row;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: space-between;
|
|
66
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
67
|
+
|
|
68
|
+
.pisell-camera-photo-img-action-item {
|
|
69
|
+
padding: 20px 60px;
|
|
70
|
+
font-size: 20px;
|
|
71
|
+
color: #fff;
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.pisell-camera-loading {
|
|
77
|
+
position: absolute;
|
|
78
|
+
top: 0;
|
|
79
|
+
left: 0;
|
|
80
|
+
right: 0;
|
|
81
|
+
bottom: 0;
|
|
82
|
+
background-color: transparent;
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
|
|
87
|
+
.pisell-camera-loading-text {
|
|
88
|
+
font-size: 18px;
|
|
89
|
+
color: #666;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.pisell-camera-no-camera {
|
|
94
|
+
position: absolute;
|
|
95
|
+
top: 0;
|
|
96
|
+
left: 0;
|
|
97
|
+
right: 0;
|
|
98
|
+
bottom: 0;
|
|
99
|
+
background-color: #ffffff;
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-direction: column;
|
|
102
|
+
align-items: center;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
width: 100%;
|
|
105
|
+
height: 100%;
|
|
106
|
+
background-color: #f5f5f5;
|
|
107
|
+
padding: 40px;
|
|
108
|
+
text-align: center;
|
|
109
|
+
|
|
110
|
+
.pisell-camera-no-camera-icon {
|
|
111
|
+
font-size: 64px;
|
|
112
|
+
margin-bottom: 20px;
|
|
113
|
+
opacity: 0.6;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.pisell-camera-no-camera-text {
|
|
117
|
+
font-size: 20px;
|
|
118
|
+
color: #333;
|
|
119
|
+
margin-bottom: 12px;
|
|
120
|
+
font-weight: 500;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.pisell-camera-no-camera-desc {
|
|
124
|
+
font-size: 14px;
|
|
125
|
+
color: #666;
|
|
126
|
+
line-height: 1.5;
|
|
127
|
+
max-width: 300px;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -293,6 +293,7 @@ var PisellWalletPassCard = (props) => {
|
|
|
293
293
|
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-name-wrap" }, showName && name), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-store-name" }, showStoreName && storeName));
|
|
294
294
|
};
|
|
295
295
|
const renderBalanceInfo = () => {
|
|
296
|
+
var _a;
|
|
296
297
|
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-amount-wrap" }, showRedeem && !disabled && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-amount-item pisell-wallet-pass-card-redeem" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-amount-item-label" }, redeemTitle || (0, import_locales.getText)("pisell-wallet-pass-card-redeem"), isMini ? ": " : ""), /* @__PURE__ */ import_react.default.createElement(
|
|
297
298
|
import_Amount.default,
|
|
298
299
|
{
|
|
@@ -308,7 +309,14 @@ var PisellWalletPassCard = (props) => {
|
|
|
308
309
|
value: balance,
|
|
309
310
|
showCurrencySymbol: showBalanceSymbol
|
|
310
311
|
}
|
|
311
|
-
)), showDiscount && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-amount-item" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-amount-item-label" }, (0, import_locales.getText)("pisell-discount-card-title")), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-amount-item-value" },
|
|
312
|
+
)), showDiscount && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-amount-item" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-amount-item-label" }, (0, import_locales.getText)("pisell-discount-card-title")), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-amount-item-value" }, ((_a = props.metadata) == null ? void 0 : _a.discount_card_type) === "fixed_amount" ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, (0, import_locales.getText)("pisell-discount-card-fixed-amount-prefix"), " ", /* @__PURE__ */ import_react.default.createElement(
|
|
313
|
+
import_Amount.default,
|
|
314
|
+
{
|
|
315
|
+
className: "pisell-card-amount-item-value",
|
|
316
|
+
useThousandsSeparator: true,
|
|
317
|
+
value: discount
|
|
318
|
+
}
|
|
319
|
+
)) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, discount, "% ", (0, import_locales.getText)("pisell-discount-card-unit"))))), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-code-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-code" }, showCode && !isMini && /* @__PURE__ */ import_react.default.createElement("div", null, code), showValidDate && /* @__PURE__ */ import_react.default.createElement("div", null, (0, import_locales.getText)("pisell-wallet-pass-card-valid-to"), " ", !!validDate ? validDate : (0, import_locales.getText)("pisell-wallet-pass-card-expireDate")))));
|
|
312
320
|
};
|
|
313
321
|
const getInputItem = (name2) => {
|
|
314
322
|
if ("validDate" === name2) {
|
|
@@ -270,7 +270,7 @@ var useTableSetting = (params) => {
|
|
|
270
270
|
let names = /* @__PURE__ */ new Set();
|
|
271
271
|
if (import_react2.default.isValidElement(filter)) {
|
|
272
272
|
names = new Set(
|
|
273
|
-
((filter == null ? void 0 : filter.
|
|
273
|
+
((filter == null ? void 0 : filter.__items) || []).filter((item) => !item.isHidden).map((item) => {
|
|
274
274
|
const rawName = item == null ? void 0 : item.value;
|
|
275
275
|
if (!rawName) return void 0;
|
|
276
276
|
return Array.isArray(rawName) ? rawName.join(",") : String(rawName);
|
|
@@ -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
|
};
|