@moment-design/material-library 0.0.21 → 0.0.23
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/README.md +8 -9
- package/dist/css/index.css +8 -8
- package/dist/index.cjs.js +33 -30
- package/dist/index.esm.js +33 -30
- package/dist/index.min.js +131 -126
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,15 +24,14 @@ import MaterialLibrary from "@moment-design/material-library"
|
|
|
24
24
|
|
|
25
25
|
Props
|
|
26
26
|
|
|
27
|
-
| 参数名
|
|
28
|
-
|
|
|
29
|
-
| fileType
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
| apis | 素材库相关接口 | ApisConfig | {} |
|
|
27
|
+
| 参数名 | 描述 | 类型 | 默认值 |
|
|
28
|
+
| -------------- | ---------------------------- | ----------------------------- | ------------------------------- |
|
|
29
|
+
| fileType | 素材类型限制 | number | 1[图片],2[文档],3[视频],4[音乐] |
|
|
30
|
+
| max | 素材最大数量 | number | 10 |
|
|
31
|
+
| dialog | 列表、弹窗样式 | DialogConfig | {} |
|
|
32
|
+
| scroll | 左侧分组、右侧内容滚动条高度 | ScrollConfig | {} |
|
|
33
|
+
| apis | 素材库相关接口 | ApisConfig | {} |
|
|
34
|
+
| customValidate | 自定义校验函数 | (datas) => (true 或 报错信息) | - |
|
|
36
35
|
|
|
37
36
|
DialogConfig
|
|
38
37
|
|
package/dist/css/index.css
CHANGED
|
@@ -258,32 +258,32 @@
|
|
|
258
258
|
overflow: hidden;
|
|
259
259
|
text-overflow: ellipsis;
|
|
260
260
|
}
|
|
261
|
-
.l-material-library-upload .form-item[data-v-
|
|
261
|
+
.l-material-library-upload .form-item[data-v-46181845] {
|
|
262
262
|
display: flex;
|
|
263
263
|
align-items: center;
|
|
264
264
|
margin-bottom: 16px;
|
|
265
265
|
}
|
|
266
|
-
.l-material-library-upload .form-item[data-v-
|
|
266
|
+
.l-material-library-upload .form-item[data-v-46181845]:not(:last-child) {
|
|
267
267
|
margin-bottom: 16px;
|
|
268
268
|
}
|
|
269
|
-
.l-material-library-upload .form-item .label[data-v-
|
|
269
|
+
.l-material-library-upload .form-item .label[data-v-46181845] {
|
|
270
270
|
width: 70px;
|
|
271
271
|
margin-right: 16px;
|
|
272
272
|
}
|
|
273
|
-
.l-material-library-upload .form-item .label span[data-v-
|
|
273
|
+
.l-material-library-upload .form-item .label span[data-v-46181845] {
|
|
274
274
|
color: red;
|
|
275
275
|
margin-right: 4px;
|
|
276
276
|
position: relative;
|
|
277
277
|
top: 2px;
|
|
278
278
|
}
|
|
279
|
-
.l-material-library-upload .upload[data-v-
|
|
279
|
+
.l-material-library-upload .upload[data-v-46181845] {
|
|
280
280
|
margin-top: 16px;
|
|
281
281
|
}
|
|
282
|
-
.l-material-library-upload .upload .tips[data-v-
|
|
282
|
+
.l-material-library-upload .upload .tips[data-v-46181845] {
|
|
283
283
|
margin-bottom: 16px;
|
|
284
284
|
color: #86909c;
|
|
285
285
|
}
|
|
286
|
-
.l-material-library-upload .upload[data-v-
|
|
286
|
+
.l-material-library-upload .upload[data-v-46181845] .mo-upload-progress {
|
|
287
287
|
display: none;
|
|
288
288
|
}
|
|
289
289
|
.l-material-library-right-content[data-v-1b7acef9] {
|
|
@@ -323,6 +323,6 @@
|
|
|
323
323
|
color: #1966ff;
|
|
324
324
|
cursor: pointer;
|
|
325
325
|
}
|
|
326
|
-
.l-material-library[data-v-
|
|
326
|
+
.l-material-library[data-v-14c0788c] {
|
|
327
327
|
display: flex;
|
|
328
328
|
}
|
package/dist/index.cjs.js
CHANGED
|
@@ -6868,11 +6868,7 @@ const _sfc_main$2 = vue.defineComponent({
|
|
|
6868
6868
|
};
|
|
6869
6869
|
const beforeUpload = (file) => {
|
|
6870
6870
|
return new Promise((resolve, reject) => {
|
|
6871
|
-
|
|
6872
|
-
if (file.size / 1024 / 1024 > ((_a2 = deepConfig.value) == null ? void 0 : _a2.size)) {
|
|
6873
|
-
webVue.Message.error(`\u60A8\u5F53\u524D\u9009\u62E9\u7684\u7D20\u6750\u5927\u5C0F\u8D85\u51FA\u9650\u5236\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9`);
|
|
6874
|
-
reject();
|
|
6875
|
-
} else if (fileType.value === 1 && file.size / 1024 / 1024 > 10 || fileType.value === 2 && file.size / 1024 / 1024 > 20 || fileType.value === 3 && file.size / 1024 / 1024 > 300 || fileType.value === 4 && file.size / 1024 / 1024 > 5) {
|
|
6871
|
+
if (fileType.value === 1 && file.size / 1024 / 1024 > 10 || fileType.value === 2 && file.size / 1024 / 1024 > 20 || fileType.value === 3 && file.size / 1024 / 1024 > 300 || fileType.value === 4 && file.size / 1024 / 1024 > 5) {
|
|
6876
6872
|
webVue.Message.error(`\u60A8\u5F53\u524D\u9009\u62E9\u7684\u7D20\u6750\u5927\u5C0F\u8D85\u51FA\u9650\u5236\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9`);
|
|
6877
6873
|
reject();
|
|
6878
6874
|
} else {
|
|
@@ -6935,28 +6931,23 @@ const _sfc_main$2 = vue.defineComponent({
|
|
|
6935
6931
|
vue.watch(
|
|
6936
6932
|
() => fileType.value,
|
|
6937
6933
|
(v) => {
|
|
6938
|
-
var _a2, _b;
|
|
6939
6934
|
fileList.value = [];
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
|
|
6946
|
-
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
|
|
6951
|
-
|
|
6952
|
-
|
|
6953
|
-
|
|
6954
|
-
|
|
6955
|
-
|
|
6956
|
-
case 4:
|
|
6957
|
-
accept.value = ".mp3";
|
|
6958
|
-
break;
|
|
6959
|
-
}
|
|
6935
|
+
switch (v) {
|
|
6936
|
+
case 0:
|
|
6937
|
+
accept.value = "";
|
|
6938
|
+
break;
|
|
6939
|
+
case 1:
|
|
6940
|
+
accept.value = ".jpg,.jpeg,.png,.bmp,.webp,.gif";
|
|
6941
|
+
break;
|
|
6942
|
+
case 2:
|
|
6943
|
+
accept.value = ".rar,.zip,.ttf,.doc,.docx,.xls,.xlsx,.xlsm,.pdf,.ppt,.pptx,.txt'";
|
|
6944
|
+
break;
|
|
6945
|
+
case 3:
|
|
6946
|
+
accept.value = ".swf,.mp4";
|
|
6947
|
+
break;
|
|
6948
|
+
case 4:
|
|
6949
|
+
accept.value = ".mp3";
|
|
6950
|
+
break;
|
|
6960
6951
|
}
|
|
6961
6952
|
},
|
|
6962
6953
|
{ immediate: true }
|
|
@@ -7087,7 +7078,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7087
7078
|
_: 1
|
|
7088
7079
|
}, 8, ["visible", "others", "onHandle:ok"]);
|
|
7089
7080
|
}
|
|
7090
|
-
var CUpload = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-
|
|
7081
|
+
var CUpload = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-46181845"]]);
|
|
7091
7082
|
var cRight_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
7092
7083
|
const _sfc_main$1 = vue.defineComponent({
|
|
7093
7084
|
name: "",
|
|
@@ -7452,12 +7443,20 @@ const _sfc_main = vue.defineComponent({
|
|
|
7452
7443
|
const refCRight = vue.ref();
|
|
7453
7444
|
const visible = vue.ref(false);
|
|
7454
7445
|
const handleOk = () => {
|
|
7455
|
-
var _a, _b, _c, _d;
|
|
7446
|
+
var _a, _b, _c, _d, _e, _f;
|
|
7456
7447
|
const result = refCRight.value.getItems();
|
|
7457
7448
|
if (!(result == null ? void 0 : result.length)) {
|
|
7458
7449
|
webVue.Message.error("\u8BF7\u9009\u62E9\u7D20\u6750");
|
|
7459
7450
|
} else if (result.length > ((_b = (_a = deepConfig.value) == null ? void 0 : _a.max) != null ? _b : 10)) {
|
|
7460
7451
|
webVue.Message.error(`\u6700\u591A\u9009\u62E9${(_d = (_c = deepConfig.value) == null ? void 0 : _c.max) != null ? _d : 10}\u4E2A\u7D20\u6750`);
|
|
7452
|
+
} else if ((_e = deepConfig.value) == null ? void 0 : _e.customValidate) {
|
|
7453
|
+
const res = (_f = deepConfig.value) == null ? void 0 : _f.customValidate(result);
|
|
7454
|
+
if (res === true) {
|
|
7455
|
+
visible.value = false;
|
|
7456
|
+
emit("choose", result);
|
|
7457
|
+
} else {
|
|
7458
|
+
webVue.Message.error(res);
|
|
7459
|
+
}
|
|
7461
7460
|
} else {
|
|
7462
7461
|
visible.value = false;
|
|
7463
7462
|
emit("choose", result);
|
|
@@ -7473,6 +7472,9 @@ const _sfc_main = vue.defineComponent({
|
|
|
7473
7472
|
(v) => deepConfig.value = v,
|
|
7474
7473
|
{ immediate: true, deep: true }
|
|
7475
7474
|
);
|
|
7475
|
+
const getVersion = () => {
|
|
7476
|
+
return "0.0.23";
|
|
7477
|
+
};
|
|
7476
7478
|
vue.onMounted(() => {
|
|
7477
7479
|
var _a, _b;
|
|
7478
7480
|
if (!((_b = (_a = deepConfig.value) == null ? void 0 : _a.dialog) == null ? void 0 : _b.visible)) {
|
|
@@ -7486,7 +7488,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
7486
7488
|
refCRight,
|
|
7487
7489
|
visible,
|
|
7488
7490
|
handleOk,
|
|
7489
|
-
open
|
|
7491
|
+
open,
|
|
7492
|
+
getVersion
|
|
7490
7493
|
};
|
|
7491
7494
|
}
|
|
7492
7495
|
});
|
|
@@ -7539,5 +7542,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7539
7542
|
], 2112))
|
|
7540
7543
|
], 2112);
|
|
7541
7544
|
}
|
|
7542
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
7545
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-14c0788c"]]);
|
|
7543
7546
|
module.exports = index;
|
package/dist/index.esm.js
CHANGED
|
@@ -6867,11 +6867,7 @@ const _sfc_main$2 = defineComponent({
|
|
|
6867
6867
|
};
|
|
6868
6868
|
const beforeUpload = (file) => {
|
|
6869
6869
|
return new Promise((resolve, reject) => {
|
|
6870
|
-
|
|
6871
|
-
if (file.size / 1024 / 1024 > ((_a2 = deepConfig.value) == null ? void 0 : _a2.size)) {
|
|
6872
|
-
Message.error(`\u60A8\u5F53\u524D\u9009\u62E9\u7684\u7D20\u6750\u5927\u5C0F\u8D85\u51FA\u9650\u5236\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9`);
|
|
6873
|
-
reject();
|
|
6874
|
-
} else if (fileType.value === 1 && file.size / 1024 / 1024 > 10 || fileType.value === 2 && file.size / 1024 / 1024 > 20 || fileType.value === 3 && file.size / 1024 / 1024 > 300 || fileType.value === 4 && file.size / 1024 / 1024 > 5) {
|
|
6870
|
+
if (fileType.value === 1 && file.size / 1024 / 1024 > 10 || fileType.value === 2 && file.size / 1024 / 1024 > 20 || fileType.value === 3 && file.size / 1024 / 1024 > 300 || fileType.value === 4 && file.size / 1024 / 1024 > 5) {
|
|
6875
6871
|
Message.error(`\u60A8\u5F53\u524D\u9009\u62E9\u7684\u7D20\u6750\u5927\u5C0F\u8D85\u51FA\u9650\u5236\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9`);
|
|
6876
6872
|
reject();
|
|
6877
6873
|
} else {
|
|
@@ -6934,28 +6930,23 @@ const _sfc_main$2 = defineComponent({
|
|
|
6934
6930
|
watch(
|
|
6935
6931
|
() => fileType.value,
|
|
6936
6932
|
(v) => {
|
|
6937
|
-
var _a2, _b;
|
|
6938
6933
|
fileList.value = [];
|
|
6939
|
-
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
|
|
6946
|
-
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
|
|
6951
|
-
|
|
6952
|
-
|
|
6953
|
-
|
|
6954
|
-
|
|
6955
|
-
case 4:
|
|
6956
|
-
accept.value = ".mp3";
|
|
6957
|
-
break;
|
|
6958
|
-
}
|
|
6934
|
+
switch (v) {
|
|
6935
|
+
case 0:
|
|
6936
|
+
accept.value = "";
|
|
6937
|
+
break;
|
|
6938
|
+
case 1:
|
|
6939
|
+
accept.value = ".jpg,.jpeg,.png,.bmp,.webp,.gif";
|
|
6940
|
+
break;
|
|
6941
|
+
case 2:
|
|
6942
|
+
accept.value = ".rar,.zip,.ttf,.doc,.docx,.xls,.xlsx,.xlsm,.pdf,.ppt,.pptx,.txt'";
|
|
6943
|
+
break;
|
|
6944
|
+
case 3:
|
|
6945
|
+
accept.value = ".swf,.mp4";
|
|
6946
|
+
break;
|
|
6947
|
+
case 4:
|
|
6948
|
+
accept.value = ".mp3";
|
|
6949
|
+
break;
|
|
6959
6950
|
}
|
|
6960
6951
|
},
|
|
6961
6952
|
{ immediate: true }
|
|
@@ -7086,7 +7077,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7086
7077
|
_: 1
|
|
7087
7078
|
}, 8, ["visible", "others", "onHandle:ok"]);
|
|
7088
7079
|
}
|
|
7089
|
-
var CUpload = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-
|
|
7080
|
+
var CUpload = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-46181845"]]);
|
|
7090
7081
|
var cRight_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
7091
7082
|
const _sfc_main$1 = defineComponent({
|
|
7092
7083
|
name: "",
|
|
@@ -7451,12 +7442,20 @@ const _sfc_main = defineComponent({
|
|
|
7451
7442
|
const refCRight = ref();
|
|
7452
7443
|
const visible = ref(false);
|
|
7453
7444
|
const handleOk = () => {
|
|
7454
|
-
var _a, _b, _c, _d;
|
|
7445
|
+
var _a, _b, _c, _d, _e, _f;
|
|
7455
7446
|
const result = refCRight.value.getItems();
|
|
7456
7447
|
if (!(result == null ? void 0 : result.length)) {
|
|
7457
7448
|
Message.error("\u8BF7\u9009\u62E9\u7D20\u6750");
|
|
7458
7449
|
} else if (result.length > ((_b = (_a = deepConfig.value) == null ? void 0 : _a.max) != null ? _b : 10)) {
|
|
7459
7450
|
Message.error(`\u6700\u591A\u9009\u62E9${(_d = (_c = deepConfig.value) == null ? void 0 : _c.max) != null ? _d : 10}\u4E2A\u7D20\u6750`);
|
|
7451
|
+
} else if ((_e = deepConfig.value) == null ? void 0 : _e.customValidate) {
|
|
7452
|
+
const res = (_f = deepConfig.value) == null ? void 0 : _f.customValidate(result);
|
|
7453
|
+
if (res === true) {
|
|
7454
|
+
visible.value = false;
|
|
7455
|
+
emit("choose", result);
|
|
7456
|
+
} else {
|
|
7457
|
+
Message.error(res);
|
|
7458
|
+
}
|
|
7460
7459
|
} else {
|
|
7461
7460
|
visible.value = false;
|
|
7462
7461
|
emit("choose", result);
|
|
@@ -7472,6 +7471,9 @@ const _sfc_main = defineComponent({
|
|
|
7472
7471
|
(v) => deepConfig.value = v,
|
|
7473
7472
|
{ immediate: true, deep: true }
|
|
7474
7473
|
);
|
|
7474
|
+
const getVersion = () => {
|
|
7475
|
+
return "0.0.23";
|
|
7476
|
+
};
|
|
7475
7477
|
onMounted(() => {
|
|
7476
7478
|
var _a, _b;
|
|
7477
7479
|
if (!((_b = (_a = deepConfig.value) == null ? void 0 : _a.dialog) == null ? void 0 : _b.visible)) {
|
|
@@ -7485,7 +7487,8 @@ const _sfc_main = defineComponent({
|
|
|
7485
7487
|
refCRight,
|
|
7486
7488
|
visible,
|
|
7487
7489
|
handleOk,
|
|
7488
|
-
open
|
|
7490
|
+
open,
|
|
7491
|
+
getVersion
|
|
7489
7492
|
};
|
|
7490
7493
|
}
|
|
7491
7494
|
});
|
|
@@ -7538,5 +7541,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7538
7541
|
], 2112))
|
|
7539
7542
|
], 2112);
|
|
7540
7543
|
}
|
|
7541
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
7544
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-14c0788c"]]);
|
|
7542
7545
|
export { index as default };
|