@power-xa/m-ui 0.0.1

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.
Files changed (95) hide show
  1. package/README.md +21 -0
  2. package/dist/ActionSheet/index.d.ts +16 -0
  3. package/dist/ActionSheet/index.js +79 -0
  4. package/dist/ActionSheet/index.less +39 -0
  5. package/dist/Breadcrumb/index.d.ts +14 -0
  6. package/dist/Breadcrumb/index.js +31 -0
  7. package/dist/Breadcrumb/index.less +28 -0
  8. package/dist/Button/index.d.ts +16 -0
  9. package/dist/Button/index.js +53 -0
  10. package/dist/Button/index.less +42 -0
  11. package/dist/ConfigProvider/index.d.ts +23 -0
  12. package/dist/ConfigProvider/index.js +41 -0
  13. package/dist/CreatorEdit/index.d.ts +12 -0
  14. package/dist/CreatorEdit/index.js +70 -0
  15. package/dist/CreatorEdit/index.less +41 -0
  16. package/dist/Drawer/index.d.ts +12 -0
  17. package/dist/Drawer/index.js +71 -0
  18. package/dist/Drawer/index.less +24 -0
  19. package/dist/Empty/index.d.ts +12 -0
  20. package/dist/Empty/index.js +18 -0
  21. package/dist/Empty/index.less +15 -0
  22. package/dist/FloatButton/index.d.ts +10 -0
  23. package/dist/FloatButton/index.js +60 -0
  24. package/dist/FloatButton/index.less +26 -0
  25. package/dist/Grid/index.d.ts +15 -0
  26. package/dist/Grid/index.js +26 -0
  27. package/dist/Grid/index.less +4 -0
  28. package/dist/PageContainer/index.d.ts +17 -0
  29. package/dist/PageContainer/index.js +50 -0
  30. package/dist/PageContainer/index.less +41 -0
  31. package/dist/Popup/index.d.ts +13 -0
  32. package/dist/Popup/index.js +65 -0
  33. package/dist/Popup/index.less +22 -0
  34. package/dist/ProForm/Field/index.d.ts +8 -0
  35. package/dist/ProForm/Field/index.js +33 -0
  36. package/dist/ProForm/Field/index.less +96 -0
  37. package/dist/ProForm/Form/index.d.ts +7 -0
  38. package/dist/ProForm/Form/index.js +145 -0
  39. package/dist/ProForm/Form/index.less +61 -0
  40. package/dist/ProForm/Group/index.d.ts +7 -0
  41. package/dist/ProForm/Group/index.js +73 -0
  42. package/dist/ProForm/Group/index.less +32 -0
  43. package/dist/ProForm/controls/Date/index.d.ts +3 -0
  44. package/dist/ProForm/controls/Date/index.js +141 -0
  45. package/dist/ProForm/controls/List/index.d.ts +23 -0
  46. package/dist/ProForm/controls/List/index.js +77 -0
  47. package/dist/ProForm/controls/List/index.less +53 -0
  48. package/dist/ProForm/controls/Select/index.d.ts +4 -0
  49. package/dist/ProForm/controls/Select/index.js +263 -0
  50. package/dist/ProForm/controls/Select/index.less +120 -0
  51. package/dist/ProForm/controls/Text/index.d.ts +4 -0
  52. package/dist/ProForm/controls/Text/index.js +29 -0
  53. package/dist/ProForm/controls/Text/index.less +7 -0
  54. package/dist/ProForm/controls/TextArea/index.d.ts +4 -0
  55. package/dist/ProForm/controls/TextArea/index.js +63 -0
  56. package/dist/ProForm/controls/TextArea/index.less +46 -0
  57. package/dist/ProForm/controls/Upload/index.d.ts +4 -0
  58. package/dist/ProForm/controls/Upload/index.js +383 -0
  59. package/dist/ProForm/controls/Upload/index.less +174 -0
  60. package/dist/ProForm/index.d.ts +9 -0
  61. package/dist/ProForm/index.js +5 -0
  62. package/dist/ProForm/typings.d.ts +164 -0
  63. package/dist/ProList/index.d.ts +78 -0
  64. package/dist/ProList/index.js +323 -0
  65. package/dist/ProList/index.less +318 -0
  66. package/dist/RefreshList/index.d.ts +17 -0
  67. package/dist/RefreshList/index.js +43 -0
  68. package/dist/RefreshList/index.less +19 -0
  69. package/dist/Skeleton/index.d.ts +5 -0
  70. package/dist/Skeleton/index.js +37 -0
  71. package/dist/Skeleton/index.less +7 -0
  72. package/dist/Tabbar/index.d.ts +13 -0
  73. package/dist/Tabbar/index.js +77 -0
  74. package/dist/Tabbar/index.less +44 -0
  75. package/dist/Tabs/index.d.ts +26 -0
  76. package/dist/Tabs/index.js +186 -0
  77. package/dist/Tabs/index.less +249 -0
  78. package/dist/assets/fonts/PingFangSC-Light.ttf +0 -0
  79. package/dist/assets/fonts/PingFangSC-Medium.ttf +0 -0
  80. package/dist/assets/fonts/PingFangSC-Regular.ttf +0 -0
  81. package/dist/assets/less/mixins.less +37 -0
  82. package/dist/global.less +0 -0
  83. package/dist/index.d.ts +25 -0
  84. package/dist/index.js +27 -0
  85. package/dist/request/index.d.ts +8 -0
  86. package/dist/request/index.js +61 -0
  87. package/dist/services/FileController/index.d.ts +12 -0
  88. package/dist/services/FileController/index.js +39 -0
  89. package/dist/services/FileController/typings.d.ts +52 -0
  90. package/dist/services/index.d.ts +2 -0
  91. package/dist/services/index.js +2 -0
  92. package/dist/services/typings.d.ts +25 -0
  93. package/dist/utils/tools.d.ts +33 -0
  94. package/dist/utils/tools.js +231 -0
  95. package/package.json +88 -0
@@ -0,0 +1,383 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
7
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
10
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
11
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
13
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
14
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
15
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
16
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
17
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
+ import React, { Fragment, useCallback, useEffect, useRef, useState } from "react";
19
+ import { chooseImage, chooseVideo, chooseMessageFile, uploadFile, previewImage } from "@tarojs/taro";
20
+ import { Image, Text, View } from "@tarojs/components";
21
+ import { clipFileUrl, getFileType, getUUID, Grid, Popup } from "../../..";
22
+ import { useConfig } from "../../../ConfigProvider";
23
+ import ProFormField from "../../Field";
24
+ import { FileController } from "../../../services";
25
+ import "./index.less";
26
+ var ProFormUpload = function ProFormUpload(props) {
27
+ var _props$listType = props.listType,
28
+ listType = _props$listType === void 0 ? "list" : _props$listType,
29
+ disabled = props.disabled,
30
+ _props$value = props.value,
31
+ value = _props$value === void 0 ? [] : _props$value,
32
+ onChange = props.onChange;
33
+ var _useConfig = useConfig(),
34
+ src = _useConfig.src;
35
+ var _useState = useState(false),
36
+ _useState2 = _slicedToArray(_useState, 2),
37
+ open = _useState2[0],
38
+ setOpen = _useState2[1];
39
+ var _useState3 = useState("OSS"),
40
+ _useState4 = _slicedToArray(_useState3, 2),
41
+ method = _useState4[0],
42
+ setMethod = _useState4[1];
43
+ var _useState5 = useState(""),
44
+ _useState6 = _slicedToArray(_useState5, 2),
45
+ url = _useState6[0],
46
+ setUrl = _useState6[1];
47
+ var _useState7 = useState(value || []),
48
+ _useState8 = _slicedToArray(_useState7, 2),
49
+ fileList = _useState8[0],
50
+ setFileList = _useState8[1];
51
+ var fileRef = useRef([]);
52
+ useEffect(function () {
53
+ getUploadConfig();
54
+ }, []);
55
+ useEffect(function () {
56
+ if (fileList.filter(function (item) {
57
+ return item.percent === 0;
58
+ }).length) {
59
+ fileList.filter(function (item) {
60
+ return item.percent === 0;
61
+ }).forEach(function (item) {
62
+ upload(item.fullUri, item.fileName);
63
+ });
64
+ } else {
65
+ onChange === null || onChange === void 0 || onChange(fileList);
66
+ }
67
+ }, [fileList]);
68
+ useEffect(function () {
69
+ if (value && JSON.stringify(value) !== JSON.stringify(fileList)) {
70
+ setFileList(value === null || value === void 0 ? void 0 : value.map(function (item) {
71
+ return _objectSpread(_objectSpread({}, item), {}, {
72
+ percent: 100
73
+ });
74
+ }));
75
+ }
76
+ }, [value]);
77
+ var getUploadConfig = useCallback(function () {
78
+ FileController.getUploadConfig().then(function (result) {
79
+ if (result.code === 200) {
80
+ if (result.data.oss) {
81
+ setMethod("OSS");
82
+ setUrl(result.data.oss.endpoint.replace("http://", "https://".concat(result.data.oss.commonBucketName, ".")));
83
+ return false;
84
+ }
85
+ }
86
+ });
87
+ }, []);
88
+ var renderUploadButton = useCallback(function (method) {
89
+ return /*#__PURE__*/React.createElement(View, {
90
+ className: "p-upload-button",
91
+ onTap: function onTap() {
92
+ setOpen(false);
93
+ if (method.value === "CAMERA") return takePhoto();
94
+ if (method.value === "ALBUM") return chooseImageAlbum();
95
+ if (method.value === "CAMERA-VIDEO") return takeVideo();
96
+ if (method.value === "ALBUM-VIDEO") return chooseVideoAlbum();
97
+ if (method.value === "FILE") return chooseFile();
98
+ }
99
+ }, /*#__PURE__*/React.createElement(View, {
100
+ className: "icon"
101
+ }, /*#__PURE__*/React.createElement(View, {
102
+ className: "iconfont ".concat(method.icon)
103
+ })), /*#__PURE__*/React.createElement(Text, {
104
+ className: "text"
105
+ }, method.label));
106
+ }, [url, fileList]);
107
+ var takePhoto = useCallback(function () {
108
+ chooseImage({
109
+ count: 1,
110
+ sourceType: ["camera"],
111
+ success: function success(result) {
112
+ if (result.tempFiles.length) {
113
+ fileRef.current = fileList.concat(result.tempFiles.map(function (item) {
114
+ return {
115
+ percent: 0,
116
+ fullUri: item.path,
117
+ fileType: getFileType({
118
+ name: item.path
119
+ })
120
+ };
121
+ }));
122
+ setFileList(fileRef.current);
123
+ }
124
+ }
125
+ });
126
+ }, [url, fileList]);
127
+ var chooseImageAlbum = useCallback(function () {
128
+ chooseImage({
129
+ count: 9,
130
+ sourceType: ["album"],
131
+ sizeType: ['original', 'compressed'],
132
+ success: function success(result) {
133
+ if (result.tempFiles.length) {
134
+ fileRef.current = fileList.concat(result.tempFiles.map(function (item) {
135
+ return {
136
+ percent: 0,
137
+ fullUri: item.path,
138
+ fileType: getFileType({
139
+ name: item.path
140
+ })
141
+ };
142
+ }));
143
+ setFileList(fileRef.current);
144
+ }
145
+ }
146
+ });
147
+ }, [url, fileList]);
148
+ var takeVideo = useCallback(function () {
149
+ chooseVideo({
150
+ sourceType: ["camera"],
151
+ success: function success(result) {
152
+ if (result.tempFilePath) {
153
+ fileRef.current = fileList.concat([{
154
+ fullUri: result.tempFilePath,
155
+ percent: 0,
156
+ fileType: getFileType({
157
+ name: result.tempFilePath
158
+ })
159
+ }]);
160
+ setFileList(fileRef.current);
161
+ }
162
+ }
163
+ });
164
+ }, [url, fileList]);
165
+ var chooseVideoAlbum = useCallback(function () {
166
+ chooseVideo({
167
+ sourceType: ["album"],
168
+ success: function success(result) {
169
+ if (result.tempFilePath) {
170
+ fileRef.current = fileList.concat([{
171
+ fullUri: result.tempFilePath,
172
+ percent: 0,
173
+ fileType: getFileType({
174
+ name: result.tempFilePath
175
+ })
176
+ }]);
177
+ setFileList(fileRef.current);
178
+ }
179
+ }
180
+ });
181
+ }, [url, fileList]);
182
+ var chooseFile = useCallback(function () {
183
+ chooseMessageFile({
184
+ count: 9,
185
+ success: function success(result) {
186
+ if (result.tempFiles.length) {
187
+ fileRef.current = fileList.concat(result.tempFiles.map(function (item) {
188
+ return {
189
+ fileName: item.name,
190
+ fullUri: item.path,
191
+ size: item.size,
192
+ percent: 0,
193
+ fileType: getFileType({
194
+ name: item.name
195
+ })
196
+ };
197
+ }));
198
+ setFileList(fileRef.current);
199
+ }
200
+ }
201
+ });
202
+ }, [url, fileList]);
203
+ var upload = useCallback(function (fileUrl, fileName) {
204
+ var ext = fileUrl.substring(fileUrl.lastIndexOf("."));
205
+ FileController.getOSSConfig(src === null || src === void 0 ? void 0 : src.oss, ext).then(function (result) {
206
+ var code = result.code,
207
+ data = result.data;
208
+ if (code === 200) {
209
+ var uploadTask = uploadFile({
210
+ url: url,
211
+ filePath: fileUrl,
212
+ name: "file",
213
+ formData: {
214
+ key: data.key,
215
+ policy: data.policy,
216
+ OSSAccessKeyId: data.accessId,
217
+ callback: data.callback,
218
+ Signature: data.signature,
219
+ Expires: data.expire
220
+ },
221
+ success: function success(result) {
222
+ var url = JSON.parse(result.data).url;
223
+ var size = JSON.parse(result.data).size;
224
+ var fileList = _toConsumableArray(fileRef.current);
225
+ var index = fileList.findIndex(function (item) {
226
+ return item.fullUri === fileUrl;
227
+ });
228
+ fileList[index] = _objectSpread(_objectSpread({}, fileList[index]), {}, {
229
+ fullUri: url,
230
+ size: size,
231
+ fileName: fileName || getUUID() + ext,
232
+ uri: clipFileUrl(url)
233
+ });
234
+ fileRef.current = fileList;
235
+ setFileList(fileList);
236
+ }
237
+ });
238
+ uploadTask.progress(function (result) {
239
+ var fileList = _toConsumableArray(fileRef.current);
240
+ var index = fileList.findIndex(function (item) {
241
+ return item.fullUri === fileUrl;
242
+ });
243
+ if (index > -1) {
244
+ fileList[index].percent = result.progress;
245
+ fileRef.current = fileList;
246
+ setFileList(_toConsumableArray(fileList));
247
+ }
248
+ });
249
+ }
250
+ });
251
+ }, [url, fileList]);
252
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(ProFormField, _extends({}, props, {
253
+ layout: "vertical"
254
+ }), /*#__PURE__*/React.createElement(View, {
255
+ className: "p-pro-form-item-upload ".concat(listType)
256
+ }, !disabled && (listType === "card" ? /*#__PURE__*/React.createElement(View, {
257
+ className: "p-pro-form-item-upload-button",
258
+ onTap: function onTap() {
259
+ return setOpen(true);
260
+ }
261
+ }, /*#__PURE__*/React.createElement(View, {
262
+ className: "iconfont icon-icon-psp-xinjian"
263
+ })) : /*#__PURE__*/React.createElement(View, {
264
+ className: "p-pro-form-item-upload-button",
265
+ onTap: function onTap() {
266
+ return setOpen(true);
267
+ }
268
+ }, /*#__PURE__*/React.createElement(View, {
269
+ className: "iconfont icon-icon-psp-xinjian"
270
+ }), /*#__PURE__*/React.createElement(Text, {
271
+ className: "p-pro-form-item-upload-button-text"
272
+ }, "\u4E0A\u4F20\u9644\u4EF6"))), listType === "card" && fileList.map(function (item, index) {
273
+ return /*#__PURE__*/React.createElement(View, {
274
+ className: "p-pro-form-item-file",
275
+ key: "file-" + index,
276
+ onTap: function onTap() {
277
+ return previewImage({
278
+ urls: fileList.map(function (item) {
279
+ return item.fullUri;
280
+ }),
281
+ current: item.fullUri
282
+ });
283
+ }
284
+ }, /*#__PURE__*/React.createElement(Image, {
285
+ src: item.fullUri,
286
+ className: "image",
287
+ mode: "aspectFill"
288
+ }), item.percent !== 100 && /*#__PURE__*/React.createElement(View, {
289
+ className: "image-mask",
290
+ style: {
291
+ height: item.percent + "%"
292
+ }
293
+ }), item.percent === 100 && !disabled && /*#__PURE__*/React.createElement(View, {
294
+ className: "iconfont icon-icon-psp-guanbi",
295
+ onTap: function onTap(e) {
296
+ e.stopPropagation();
297
+ fileList.splice(index, 1);
298
+ fileRef.current = fileList;
299
+ setFileList(_toConsumableArray(fileList));
300
+ }
301
+ }));
302
+ }), listType === "list" && fileList.map(function (item, index) {
303
+ var _item$fileType;
304
+ return /*#__PURE__*/React.createElement(View, {
305
+ className: "p-pro-form-item-file",
306
+ key: "file-" + index,
307
+ onTap: function onTap() {}
308
+ }, item.fileType === "Pic" && item.fullUri ? /*#__PURE__*/React.createElement(Image, {
309
+ src: item.fullUri,
310
+ className: "image",
311
+ mode: "aspectFill"
312
+ }) : /*#__PURE__*/React.createElement(Image, {
313
+ src: "".concat(src === null || src === void 0 ? void 0 : src.resource, "/images/document/icon/").concat((_item$fileType = item.fileType) === null || _item$fileType === void 0 ? void 0 : _item$fileType.toLowerCase(), ".svg"),
314
+ className: "image",
315
+ mode: "widthFix"
316
+ }), item.percent !== 100 && /*#__PURE__*/React.createElement(View, {
317
+ className: "image-mask",
318
+ style: {
319
+ width: item.percent + "%"
320
+ }
321
+ }), /*#__PURE__*/React.createElement(Text, {
322
+ className: "text"
323
+ }, item.fileName), item.percent === 100 && !disabled && /*#__PURE__*/React.createElement(View, {
324
+ className: "iconfont icon-icon-psp-guanbi",
325
+ onTap: function onTap(e) {
326
+ e.stopPropagation();
327
+ fileList.splice(index, 1);
328
+ fileRef.current = fileList;
329
+ setFileList(_toConsumableArray(fileList));
330
+ }
331
+ }));
332
+ }))), /*#__PURE__*/React.createElement(Popup, {
333
+ open: open,
334
+ onOpenChange: function onOpenChange(open) {
335
+ return setOpen(open);
336
+ },
337
+ rootClassName: "p-pro-form-item-upload-popup-container",
338
+ height: 20
339
+ }, function (_ref) {
340
+ var onOpenChange = _ref.onOpenChange;
341
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(View, {
342
+ className: "p-pro-form-item-upload-popup-header"
343
+ }, /*#__PURE__*/React.createElement(Text, {
344
+ className: "title"
345
+ }, "\u4E0A\u4F20\u6587\u4EF6"), /*#__PURE__*/React.createElement(View, {
346
+ className: "extra-content right"
347
+ }, /*#__PURE__*/React.createElement(View, {
348
+ className: "iconfont icon-icon-psp-guanbi",
349
+ onTap: onOpenChange
350
+ }))), /*#__PURE__*/React.createElement(View, {
351
+ className: "p-pro-form-item-upload-popup-content"
352
+ }, /*#__PURE__*/React.createElement(Grid, {
353
+ dataSource: [{
354
+ label: "拍照",
355
+ value: "CAMERA",
356
+ icon: "icon-icon-paizhaoshangchuan"
357
+ }, {
358
+ label: "拍摄",
359
+ value: "CAMERA-VIDEO",
360
+ icon: "icon-icon-paishe"
361
+ }, {
362
+ label: "相册",
363
+ value: "ALBUM",
364
+ icon: "icon-icon-xiangcexuanze"
365
+ }, {
366
+ label: "视频库",
367
+ value: "ALBUM-VIDEO",
368
+ icon: "icon-icon-shipinku"
369
+ }, {
370
+ label: "文件",
371
+ value: "FILE",
372
+ icon: "icon-icon-wenjianjiaxuanze"
373
+ }].filter(function (item) {
374
+ return listType === "card" ? ["CAMERA", "ALBUM"].includes(item.value) : item;
375
+ }),
376
+ renderItem: function renderItem(data) {
377
+ return listType === "card" ? ["CAMERA", "ALBUM"].includes(data.value) && renderUploadButton(data) : renderUploadButton(data);
378
+ },
379
+ column: 5
380
+ })));
381
+ }));
382
+ };
383
+ export default ProFormUpload;
@@ -0,0 +1,174 @@
1
+ @import "@power-xa/m-ui/dist/assets/less/mixins.less";
2
+
3
+ .p-pro-form-item-upload {
4
+ &.card {
5
+ display: flex;
6
+ align-items: center;
7
+ flex-wrap: wrap;
8
+ gap: 20px;
9
+
10
+ .p-pro-form-item-upload-button {
11
+ width: 92px;
12
+ height: 92px;
13
+ background: #F5F6F7;
14
+ border-radius: 20px;
15
+ display: flex;
16
+ align-items: center;
17
+ justify-content: center;
18
+
19
+ .iconfont {
20
+ font-size: 28px;
21
+ color: #333437;
22
+ }
23
+ }
24
+
25
+ .p-pro-form-item-file {
26
+ width: 92px;
27
+ height: 92px;
28
+ position: relative;
29
+
30
+ .image {
31
+ width: 92px;
32
+ height: 92px;
33
+ border-radius: 20px;
34
+ }
35
+
36
+ .image-mask {
37
+ width: 100%;
38
+ position: absolute;
39
+ bottom: 0;
40
+ left: 0;
41
+ right: 0;
42
+ border-radius: 20px;
43
+ background: rgba(51, 52, 55, 0.70);
44
+ }
45
+
46
+ .iconfont {
47
+ padding: 4px;
48
+ border-radius: 50%;
49
+ background: #F6F7F9;
50
+ font-size: 18px;
51
+ color: #333437;
52
+ box-sizing: border-box;
53
+ position: absolute;
54
+ top: -14px;
55
+ right: -14px;
56
+ border: 4px solid #fff;
57
+ }
58
+ }
59
+ }
60
+
61
+ &.list {
62
+ display: flex;
63
+ flex-direction: column;
64
+ gap: 12px;
65
+
66
+ .p-pro-form-item-upload-button {
67
+ display: flex;
68
+ align-items: center;
69
+ justify-content: center;
70
+ background: #F5F6F7;
71
+ border-radius: 82px;
72
+ padding: 24px 0;
73
+ gap: 8px;
74
+
75
+ .iconfont {
76
+ font-size: 20px;
77
+ color: #333437;
78
+ }
79
+
80
+ .p-pro-form-item-upload-button-text {
81
+ .font(24, #333437)
82
+ }
83
+ }
84
+
85
+ .p-pro-form-item-file {
86
+ display: flex;
87
+ align-items: center;
88
+ gap: 16px;
89
+ padding: 20px 22px;
90
+ box-sizing: border-box;
91
+ background: #F5F6F7;
92
+ border-radius: 16px;
93
+ position: relative;
94
+
95
+ .image {
96
+ width: 40px;
97
+ height: 44px;
98
+ border-radius: 12px;
99
+ }
100
+
101
+ .image-mask {
102
+ position: absolute;
103
+ top: 0;
104
+ left: 0;
105
+ bottom: 0;
106
+ background: rgba(0, 0, 0, .3);
107
+ border-radius: 16px;
108
+ }
109
+
110
+ .text {
111
+ .font(24, #666);
112
+ flex: 1;
113
+ width: 0;
114
+ overflow: hidden;
115
+ text-overflow: ellipsis;
116
+ white-space: nowrap;
117
+ }
118
+ }
119
+ }
120
+ }
121
+
122
+ .p-pro-form-item-upload-popup-container {
123
+ z-index: 9999;
124
+
125
+ .p-pro-form-item-upload-popup-header {
126
+ display: flex;
127
+ align-items: center;
128
+ justify-content: space-between;
129
+ padding: 34px 32px;
130
+ box-sizing: border-box;
131
+
132
+ .extra-content {
133
+ .iconfont {
134
+ font-size: 24px;
135
+ color: #333437;
136
+ padding: 8px 12px;
137
+ width: max-content;
138
+ }
139
+ }
140
+
141
+ .title {
142
+ .font(28, #333437)
143
+ }
144
+ }
145
+
146
+ .p-pro-form-item-upload-popup-content {
147
+
148
+ .p-upload-button {
149
+ display: flex;
150
+ flex-direction: column;
151
+ align-items: center;
152
+ gap: 8px;
153
+
154
+ .icon {
155
+ width: 96px;
156
+ height: 96px;
157
+ background: #F5F6F7;
158
+ display: flex;
159
+ align-items: center;
160
+ justify-content: center;
161
+ border-radius: 28px;
162
+
163
+ .iconfont {
164
+ font-size: 48px;
165
+ color: #333437;
166
+ }
167
+ }
168
+
169
+ .text {
170
+ .font(24, #333437)
171
+ }
172
+ }
173
+ }
174
+ }
@@ -0,0 +1,9 @@
1
+ import OriginProForm from "./Form";
2
+ import ProFormGroup from "./Group";
3
+ import ProFormField from "./Field";
4
+ type ProFormType = typeof OriginProForm & {
5
+ Group: typeof ProFormGroup;
6
+ Field: typeof ProFormField;
7
+ };
8
+ declare const ProForm: ProFormType;
9
+ export default ProForm;
@@ -0,0 +1,5 @@
1
+ import OriginProForm from "./Form";
2
+ import ProFormGroup from "./Group";
3
+ var ProForm = OriginProForm;
4
+ ProForm.Group = ProFormGroup;
5
+ export default ProForm;