@pisell/materials 1.0.923 → 1.0.924
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +164 -148
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +45 -16
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +56 -27
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Upload/BaseUpload.js +199 -19
- package/es/components/dataSourceComponents/fields/Upload/CameraPopover.d.ts +5 -0
- 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/type.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +10 -10
- package/es/components/filter/index.d.ts +0 -1
- package/es/components/list/index.d.ts +0 -1
- package/es/components/pisellCamera/index.d.ts +4 -0
- package/es/components/pisellCamera/index.js +219 -0
- package/es/components/pisellCamera/index.less +120 -0
- package/es/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
- package/es/components/table/Table/SelectField/index.d.ts +0 -1
- package/es/components/table/Table/fields/index.d.ts +0 -1
- package/es/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
- package/es/components/table/Table/fields/text/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/text/index.d.ts +0 -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/locales/en-US.d.ts +10 -0
- package/es/locales/en-US.js +13 -1
- package/es/locales/zh-CN.d.ts +10 -0
- package/es/locales/zh-CN.js +13 -1
- package/es/locales/zh-TW.d.ts +10 -0
- package/es/locales/zh-TW.js +13 -1
- package/es/utils/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.js +168 -5
- package/lib/components/dataSourceComponents/fields/Upload/CameraPopover.d.ts +5 -0
- 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/type.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +10 -10
- package/lib/components/filter/index.d.ts +0 -1
- package/lib/components/list/index.d.ts +0 -1
- package/lib/components/pisellCamera/index.d.ts +4 -0
- package/lib/components/pisellCamera/index.js +219 -0
- package/lib/components/pisellCamera/index.less +120 -0
- package/lib/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
- package/lib/components/table/Table/SelectField/index.d.ts +0 -1
- package/lib/components/table/Table/fields/index.d.ts +0 -1
- package/lib/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
- package/lib/components/table/Table/fields/text/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/text/index.d.ts +0 -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/locales/en-US.d.ts +10 -0
- package/lib/locales/en-US.js +13 -1
- package/lib/locales/zh-CN.d.ts +10 -0
- package/lib/locales/zh-CN.js +13 -1
- package/lib/locales/zh-TW.d.ts +10 -0
- package/lib/locales/zh-TW.js +13 -1
- package/lib/utils/index.d.ts +1 -1
- package/lowcode/form-item-upload/meta.ts +20 -5
- package/package.json +4 -3
|
@@ -0,0 +1,219 @@
|
|
|
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_locales = require("../../locales");
|
|
38
|
+
var import_pisellModal = __toESM(require("../../components/pisellModal"));
|
|
39
|
+
var import_index = require("./index.less");
|
|
40
|
+
var PisellCamera = (0, import_react.forwardRef)((props, ref) => {
|
|
41
|
+
const cameraRef = (0, import_react.useRef)(null);
|
|
42
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
43
|
+
const [photo, setPhoto] = (0, import_react.useState)("");
|
|
44
|
+
const [cameraAvailable, setCameraAvailable] = (0, import_react.useState)(null);
|
|
45
|
+
const uploadFileRef = (0, import_react.useRef)(null);
|
|
46
|
+
const base64ToFile = (base64String, filename) => {
|
|
47
|
+
var _a;
|
|
48
|
+
const arr = base64String.split(",");
|
|
49
|
+
const mime = ((_a = arr[0].match(/:(.*?);/)) == null ? void 0 : _a[1]) || "";
|
|
50
|
+
const bstr = atob(arr[1]);
|
|
51
|
+
let n = bstr.length;
|
|
52
|
+
const u8arr = new Uint8Array(n);
|
|
53
|
+
while (n--) {
|
|
54
|
+
u8arr[n] = bstr.charCodeAt(n);
|
|
55
|
+
}
|
|
56
|
+
return new File([u8arr], filename, { type: mime });
|
|
57
|
+
};
|
|
58
|
+
const takePhoto = () => {
|
|
59
|
+
var _a, _b;
|
|
60
|
+
if (!cameraRef.current || !cameraRef.current.takePhoto) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
const photo2 = (_b = (_a = cameraRef.current) == null ? void 0 : _a.takePhoto) == null ? void 0 : _b.call(_a);
|
|
65
|
+
const timestamp = Date.now();
|
|
66
|
+
const filename = `photo-${timestamp}.jpg`;
|
|
67
|
+
setPhoto(photo2);
|
|
68
|
+
const file = base64ToFile(photo2, filename);
|
|
69
|
+
const uploadFile = {
|
|
70
|
+
uid: timestamp.toString(),
|
|
71
|
+
name: filename,
|
|
72
|
+
status: "uploading",
|
|
73
|
+
url: photo2,
|
|
74
|
+
// 用于预览
|
|
75
|
+
originFileObj: file,
|
|
76
|
+
// 原始文件对象,用于上传
|
|
77
|
+
thumbUrl: photo2,
|
|
78
|
+
lastModified: Date.now(),
|
|
79
|
+
lastModifiedDate: /* @__PURE__ */ new Date(),
|
|
80
|
+
type: "image/jpeg",
|
|
81
|
+
size: file.size
|
|
82
|
+
};
|
|
83
|
+
console.log("takePhoto_uploadFile", uploadFile);
|
|
84
|
+
uploadFileRef.current = uploadFile;
|
|
85
|
+
return uploadFile;
|
|
86
|
+
} catch (error) {
|
|
87
|
+
console.error("takePhoto_error", error);
|
|
88
|
+
uploadFileRef.current = null;
|
|
89
|
+
setPhoto("");
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const onOpen = () => {
|
|
94
|
+
setCameraAvailable(null);
|
|
95
|
+
setPhoto("");
|
|
96
|
+
uploadFileRef.current = null;
|
|
97
|
+
setOpen(true);
|
|
98
|
+
};
|
|
99
|
+
const onClose = () => {
|
|
100
|
+
cameraRef.current = null;
|
|
101
|
+
uploadFileRef.current = null;
|
|
102
|
+
setOpen(false);
|
|
103
|
+
setPhoto("");
|
|
104
|
+
setCameraAvailable(null);
|
|
105
|
+
};
|
|
106
|
+
const onRetakePhoto = () => {
|
|
107
|
+
setPhoto("");
|
|
108
|
+
};
|
|
109
|
+
const onUsePhoto = () => {
|
|
110
|
+
var _a;
|
|
111
|
+
(_a = props == null ? void 0 : props.onChange) == null ? void 0 : _a.call(props, uploadFileRef.current);
|
|
112
|
+
onClose();
|
|
113
|
+
};
|
|
114
|
+
(0, import_react.useImperativeHandle)(ref, () => {
|
|
115
|
+
return {
|
|
116
|
+
open: onOpen,
|
|
117
|
+
takePhoto,
|
|
118
|
+
isCameraAvailable: () => cameraAvailable
|
|
119
|
+
};
|
|
120
|
+
});
|
|
121
|
+
console.log("cameraAvailable", cameraAvailable);
|
|
122
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
123
|
+
import_pisellModal.default,
|
|
124
|
+
{
|
|
125
|
+
open,
|
|
126
|
+
onCancel: (e) => {
|
|
127
|
+
e.stopPropagation();
|
|
128
|
+
e.preventDefault();
|
|
129
|
+
onClose();
|
|
130
|
+
},
|
|
131
|
+
header: false,
|
|
132
|
+
footer: null,
|
|
133
|
+
destroyOnClose: true,
|
|
134
|
+
bodyStyle: { padding: 0 },
|
|
135
|
+
width: "90vw",
|
|
136
|
+
className: "pisell-camera-modal"
|
|
137
|
+
},
|
|
138
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
139
|
+
"div",
|
|
140
|
+
{
|
|
141
|
+
className: "pisell-camera-container",
|
|
142
|
+
onClick: (e) => {
|
|
143
|
+
e.stopPropagation();
|
|
144
|
+
e.preventDefault();
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
cameraAvailable === null ? (
|
|
148
|
+
// 检测中
|
|
149
|
+
/* @__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")))
|
|
150
|
+
) : cameraAvailable === false ? (
|
|
151
|
+
// 无摄像头
|
|
152
|
+
/* @__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")))
|
|
153
|
+
) : null,
|
|
154
|
+
/* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
155
|
+
import_react_camera_pro.Camera,
|
|
156
|
+
{
|
|
157
|
+
ref: cameraRef,
|
|
158
|
+
errorMessages: {
|
|
159
|
+
// noCameraAccessible: getText('pisell-camera-no-camera-accessible'),
|
|
160
|
+
// permissionDenied: getText('pisell-camera-permission-denied'),
|
|
161
|
+
// switchCamera: getText('pisell-camera-switch-camera'),
|
|
162
|
+
// canvas: getText('pisell-camera-canvas'),
|
|
163
|
+
},
|
|
164
|
+
numberOfCamerasCallback: (numberOfCameras) => {
|
|
165
|
+
console.log("numberOfCameras", numberOfCameras);
|
|
166
|
+
if (!cameraRef.current) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
if (numberOfCameras <= 0) {
|
|
170
|
+
setTimeout(() => {
|
|
171
|
+
setCameraAvailable((pre) => {
|
|
172
|
+
if (pre === true) {
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
return false;
|
|
176
|
+
});
|
|
177
|
+
}, 5e3);
|
|
178
|
+
} else {
|
|
179
|
+
setCameraAvailable(true);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
), cameraAvailable === true && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-camera-action" }, /* @__PURE__ */ import_react.default.createElement(
|
|
184
|
+
"div",
|
|
185
|
+
{
|
|
186
|
+
className: "pisell-camera-action-item",
|
|
187
|
+
onClick: (e) => {
|
|
188
|
+
e.stopPropagation();
|
|
189
|
+
e.preventDefault();
|
|
190
|
+
takePhoto();
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
)), 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(
|
|
194
|
+
"div",
|
|
195
|
+
{
|
|
196
|
+
className: "pisell-camera-photo-img-action-item",
|
|
197
|
+
onClick: (e) => {
|
|
198
|
+
e.stopPropagation();
|
|
199
|
+
e.preventDefault();
|
|
200
|
+
onRetakePhoto();
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
(0, import_locales.getText)("pisell-upload-camera-retake")
|
|
204
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
205
|
+
"div",
|
|
206
|
+
{
|
|
207
|
+
className: "pisell-camera-photo-img-action-item",
|
|
208
|
+
onClick: (e) => {
|
|
209
|
+
e.stopPropagation();
|
|
210
|
+
e.preventDefault();
|
|
211
|
+
onUsePhoto();
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
(0, import_locales.getText)("pisell-upload-camera-use")
|
|
215
|
+
))))
|
|
216
|
+
)
|
|
217
|
+
);
|
|
218
|
+
});
|
|
219
|
+
var pisellCamera_default = PisellCamera;
|
|
@@ -0,0 +1,120 @@
|
|
|
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 {
|
|
21
|
+
width: 60px;
|
|
22
|
+
height: 60px;
|
|
23
|
+
background-color: #fff;
|
|
24
|
+
border-radius: 60px;
|
|
25
|
+
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.pisell-camera-photo-container {
|
|
31
|
+
position: absolute;
|
|
32
|
+
top: 0;
|
|
33
|
+
left: 0;
|
|
34
|
+
right: 0;
|
|
35
|
+
bottom: 0;
|
|
36
|
+
width: 100%;
|
|
37
|
+
height: 100%;
|
|
38
|
+
|
|
39
|
+
.pisell-camera-photo {
|
|
40
|
+
width: 100%;
|
|
41
|
+
height: 100%;
|
|
42
|
+
object-fit: cover;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
.pisell-camera-photo-img-action {
|
|
46
|
+
position: absolute;
|
|
47
|
+
bottom: 0;
|
|
48
|
+
left: 0;
|
|
49
|
+
right: 0;
|
|
50
|
+
height: 100px;
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: row;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: space-between;
|
|
55
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
56
|
+
|
|
57
|
+
.pisell-camera-photo-img-action-item {
|
|
58
|
+
padding: 20px 60px;
|
|
59
|
+
font-size: 20px;
|
|
60
|
+
color: #fff;
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.pisell-camera-loading {
|
|
66
|
+
position: absolute;
|
|
67
|
+
top: 0;
|
|
68
|
+
left: 0;
|
|
69
|
+
right: 0;
|
|
70
|
+
bottom: 0;
|
|
71
|
+
background-color: transparent;
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
|
|
76
|
+
.pisell-camera-loading-text {
|
|
77
|
+
font-size: 18px;
|
|
78
|
+
color: #666;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.pisell-camera-no-camera {
|
|
83
|
+
position: absolute;
|
|
84
|
+
top: 0;
|
|
85
|
+
left: 0;
|
|
86
|
+
right: 0;
|
|
87
|
+
bottom: 0;
|
|
88
|
+
background-color: #ffffff;
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
width: 100%;
|
|
94
|
+
height: 100%;
|
|
95
|
+
background-color: #f5f5f5;
|
|
96
|
+
padding: 40px;
|
|
97
|
+
text-align: center;
|
|
98
|
+
|
|
99
|
+
.pisell-camera-no-camera-icon {
|
|
100
|
+
font-size: 64px;
|
|
101
|
+
margin-bottom: 20px;
|
|
102
|
+
opacity: 0.6;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.pisell-camera-no-camera-text {
|
|
106
|
+
font-size: 20px;
|
|
107
|
+
color: #333;
|
|
108
|
+
margin-bottom: 12px;
|
|
109
|
+
font-weight: 500;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.pisell-camera-no-camera-desc {
|
|
113
|
+
font-size: 14px;
|
|
114
|
+
color: #666;
|
|
115
|
+
line-height: 1.5;
|
|
116
|
+
max-width: 300px;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -167,7 +167,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
|
|
|
167
167
|
sort?: SortType | undefined;
|
|
168
168
|
mode: "" | "localStorage" | "remote";
|
|
169
169
|
currentViewMode: ModeType;
|
|
170
|
-
}) => ("
|
|
170
|
+
}) => ("view_mode" | "filter_setting" | "group_by" | "order_by" | "column_setting" | "gallery_setting")[];
|
|
171
171
|
export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
|
|
172
172
|
export declare const stringify: (obj: Record<string, any>) => string;
|
|
173
173
|
export {};
|
package/lib/locales/en-US.d.ts
CHANGED
|
@@ -326,5 +326,15 @@ declare const _default: {
|
|
|
326
326
|
'pisell-list-pagination-page-of': (current: number, total: number) => string;
|
|
327
327
|
'pisell-list-pagination-previous': string;
|
|
328
328
|
'pisell-list-pagination-next': string;
|
|
329
|
+
'pisell-camera-no-camera-accessible': string;
|
|
330
|
+
'pisell-camera-permission-denied': string;
|
|
331
|
+
'pisell-camera-switch-camera': string;
|
|
332
|
+
'pisell-camera-canvas': string;
|
|
333
|
+
'pisell-camera-checking': string;
|
|
334
|
+
'pisell-camera-no-camera-desc': string;
|
|
335
|
+
'pisell-upload-camera-local-files': string;
|
|
336
|
+
'pisell-upload-camera-capture': string;
|
|
337
|
+
'pisell-upload-camera-retake': string;
|
|
338
|
+
'pisell-upload-camera-use': string;
|
|
329
339
|
};
|
|
330
340
|
export default _default;
|
package/lib/locales/en-US.js
CHANGED
|
@@ -384,5 +384,17 @@ var en_US_default = {
|
|
|
384
384
|
"pisell-list-scroll-right": "Scroll Right",
|
|
385
385
|
"pisell-list-pagination-page-of": (current, total) => `Page ${current} of ${total}`,
|
|
386
386
|
"pisell-list-pagination-previous": "Previous",
|
|
387
|
-
"pisell-list-pagination-next": "Next"
|
|
387
|
+
"pisell-list-pagination-next": "Next",
|
|
388
|
+
// 相机组件
|
|
389
|
+
"pisell-camera-no-camera-accessible": "No camera accessible",
|
|
390
|
+
"pisell-camera-permission-denied": "Permission denied",
|
|
391
|
+
"pisell-camera-switch-camera": "Switch camera",
|
|
392
|
+
"pisell-camera-canvas": "Canvas not supported",
|
|
393
|
+
"pisell-camera-checking": "Detecting camera...",
|
|
394
|
+
"pisell-camera-no-camera-desc": "Please check if your device has a camera or grant browser permission to access camera",
|
|
395
|
+
// 拍照组件
|
|
396
|
+
"pisell-upload-camera-local-files": "Local Files",
|
|
397
|
+
"pisell-upload-camera-capture": "Capture",
|
|
398
|
+
"pisell-upload-camera-retake": "Retake",
|
|
399
|
+
"pisell-upload-camera-use": "Use photo"
|
|
388
400
|
};
|
package/lib/locales/zh-CN.d.ts
CHANGED
|
@@ -321,5 +321,15 @@ declare const _default: {
|
|
|
321
321
|
'pisell-list-pagination-page-of': (current: number, total: number) => string;
|
|
322
322
|
'pisell-list-pagination-previous': string;
|
|
323
323
|
'pisell-list-pagination-next': string;
|
|
324
|
+
'pisell-camera-no-camera-accessible': string;
|
|
325
|
+
'pisell-camera-permission-denied': string;
|
|
326
|
+
'pisell-camera-switch-camera': string;
|
|
327
|
+
'pisell-camera-canvas': string;
|
|
328
|
+
'pisell-camera-checking': string;
|
|
329
|
+
'pisell-camera-no-camera-desc': string;
|
|
330
|
+
'pisell-upload-camera-local-files': string;
|
|
331
|
+
'pisell-upload-camera-capture': string;
|
|
332
|
+
'pisell-upload-camera-retake': string;
|
|
333
|
+
'pisell-upload-camera-use': string;
|
|
324
334
|
};
|
|
325
335
|
export default _default;
|
package/lib/locales/zh-CN.js
CHANGED
|
@@ -375,5 +375,17 @@ var zh_CN_default = {
|
|
|
375
375
|
"pisell-list-scroll-right": "向右滚动",
|
|
376
376
|
"pisell-list-pagination-page-of": (current, total) => `第 ${current} 页 共 ${total} 页`,
|
|
377
377
|
"pisell-list-pagination-previous": "上一页",
|
|
378
|
-
"pisell-list-pagination-next": "下一页"
|
|
378
|
+
"pisell-list-pagination-next": "下一页",
|
|
379
|
+
// 相机组件
|
|
380
|
+
"pisell-camera-no-camera-accessible": "没有找到摄像头",
|
|
381
|
+
"pisell-camera-permission-denied": "没有权限使用摄像头",
|
|
382
|
+
"pisell-camera-switch-camera": "切换摄像头",
|
|
383
|
+
"pisell-camera-canvas": "canvas不支持",
|
|
384
|
+
"pisell-camera-checking": "正在检测摄像头...",
|
|
385
|
+
"pisell-camera-no-camera-desc": "请检查设备是否连接摄像头或授权浏览器访问摄像头",
|
|
386
|
+
// 拍照组件
|
|
387
|
+
"pisell-upload-camera-local-files": "本地文件",
|
|
388
|
+
"pisell-upload-camera-capture": "拍摄/拍照",
|
|
389
|
+
"pisell-upload-camera-retake": "重拍",
|
|
390
|
+
"pisell-upload-camera-use": "使用照片"
|
|
379
391
|
};
|
package/lib/locales/zh-TW.d.ts
CHANGED
|
@@ -321,5 +321,15 @@ declare const _default: {
|
|
|
321
321
|
'pisell-list-pagination-page-of': (current: number, total: number) => string;
|
|
322
322
|
'pisell-list-pagination-previous': string;
|
|
323
323
|
'pisell-list-pagination-next': string;
|
|
324
|
+
'pisell-camera-no-camera-accessible': string;
|
|
325
|
+
'pisell-camera-permission-denied': string;
|
|
326
|
+
'pisell-camera-switch-camera': string;
|
|
327
|
+
'pisell-camera-canvas': string;
|
|
328
|
+
'pisell-camera-checking': string;
|
|
329
|
+
'pisell-camera-no-camera-desc': string;
|
|
330
|
+
'pisell-upload-camera-local-files': string;
|
|
331
|
+
'pisell-upload-camera-capture': string;
|
|
332
|
+
'pisell-upload-camera-retake': string;
|
|
333
|
+
'pisell-upload-camera-use': string;
|
|
324
334
|
};
|
|
325
335
|
export default _default;
|
package/lib/locales/zh-TW.js
CHANGED
|
@@ -376,5 +376,17 @@ var zh_TW_default = {
|
|
|
376
376
|
"pisell-list-scroll-right": "向右滾動",
|
|
377
377
|
"pisell-list-pagination-page-of": (current, total) => `第 ${current} 頁 共 ${total} 頁`,
|
|
378
378
|
"pisell-list-pagination-previous": "上一頁",
|
|
379
|
-
"pisell-list-pagination-next": "下一頁"
|
|
379
|
+
"pisell-list-pagination-next": "下一頁",
|
|
380
|
+
// 相机组件
|
|
381
|
+
"pisell-camera-no-camera-accessible": "沒有找到攝像頭",
|
|
382
|
+
"pisell-camera-permission-denied": "沒有權限使用攝像頭",
|
|
383
|
+
"pisell-camera-switch-camera": "切換攝像頭",
|
|
384
|
+
"pisell-camera-canvas": "canvas不支持",
|
|
385
|
+
"pisell-camera-checking": "正在檢測攝像頭...",
|
|
386
|
+
"pisell-camera-no-camera-desc": "請檢查設備是否連接攝像頭或授權瀏覽器訪問攝像頭",
|
|
387
|
+
// 拍照组件
|
|
388
|
+
"pisell-upload-camera-local-files": "本地文件",
|
|
389
|
+
"pisell-upload-camera-capture": "拍攝/拍照",
|
|
390
|
+
"pisell-upload-camera-retake": "重拍",
|
|
391
|
+
"pisell-upload-camera-use": "使用照片"
|
|
380
392
|
};
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -86,6 +86,17 @@ export default {
|
|
|
86
86
|
defaultValue: false,
|
|
87
87
|
setter: 'BoolSetter',
|
|
88
88
|
},
|
|
89
|
+
{
|
|
90
|
+
name: 'allowCamera',
|
|
91
|
+
title: {
|
|
92
|
+
type: 'i18n',
|
|
93
|
+
'en-US': 'Allow Camera',
|
|
94
|
+
'zh-CN': '允许拍照',
|
|
95
|
+
},
|
|
96
|
+
propType: 'bool',
|
|
97
|
+
defaultValue: false,
|
|
98
|
+
setter: 'BoolSetter',
|
|
99
|
+
},
|
|
89
100
|
],
|
|
90
101
|
},
|
|
91
102
|
{
|
|
@@ -187,9 +198,13 @@ export default {
|
|
|
187
198
|
const { value, options } = values;
|
|
188
199
|
const presetTypeString: any[] = [];
|
|
189
200
|
options.forEach((item: any) => {
|
|
190
|
-
presetTypeString.push(
|
|
201
|
+
presetTypeString.push(
|
|
202
|
+
...(item.extensions || []).map((item: any) => `.${item}`)
|
|
203
|
+
);
|
|
191
204
|
});
|
|
192
|
-
target
|
|
205
|
+
target
|
|
206
|
+
.getProps()
|
|
207
|
+
.setPropValue('presetTypeString', presetTypeString);
|
|
193
208
|
target.getProps().setPropValue('presetType', value);
|
|
194
209
|
},
|
|
195
210
|
},
|
|
@@ -200,7 +215,7 @@ export default {
|
|
|
200
215
|
type: 'i18n',
|
|
201
216
|
'en-US': 'Enable Custom Types',
|
|
202
217
|
'zh-CN': '启用自定义类型',
|
|
203
|
-
},
|
|
218
|
+
},
|
|
204
219
|
propType: 'bool',
|
|
205
220
|
defaultValue: false,
|
|
206
221
|
setter: 'BoolSetter',
|
|
@@ -210,8 +225,8 @@ export default {
|
|
|
210
225
|
title: {
|
|
211
226
|
label: {
|
|
212
227
|
type: 'i18n',
|
|
213
|
-
|
|
214
|
-
|
|
228
|
+
'en-US': 'Custom Types',
|
|
229
|
+
'zh-CN': '自定义类型',
|
|
215
230
|
},
|
|
216
231
|
tip: {
|
|
217
232
|
type: 'i18n',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.924",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -74,9 +74,10 @@
|
|
|
74
74
|
"swiper": "^8.4.7",
|
|
75
75
|
"vod-js-sdk-v6": "^1.4.11",
|
|
76
76
|
"antd-mobile": "^5.38.1",
|
|
77
|
-
"
|
|
77
|
+
"react-camera-pro": "1.4.0",
|
|
78
78
|
"@pisell/date-picker": "1.0.126",
|
|
79
|
-
"@pisell/icon": "0.0.10"
|
|
79
|
+
"@pisell/icon": "0.0.10",
|
|
80
|
+
"@pisell/utils": "1.0.54"
|
|
80
81
|
},
|
|
81
82
|
"peerDependencies": {
|
|
82
83
|
"react": "^18.0.0",
|