classcard-ui 0.2.303 → 0.2.307
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/dist/classcard-ui.common.js +437 -10011
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.umd.js +437 -10011
- package/dist/classcard-ui.umd.js.map +1 -1
- package/dist/classcard-ui.umd.min.js +9 -19
- package/dist/classcard-ui.umd.min.js.map +1 -1
- package/package.json +1 -2
- package/src/components/CUpload/CUpload.vue +1 -52
- package/src/icons.js +11 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "classcard-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.307",
|
|
4
4
|
"main": "dist/classcard-ui.common.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "vue-cli-service serve",
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
"gridjs-selection": "^3.4.0",
|
|
26
26
|
"gridjs-vue": "^3.4.0",
|
|
27
27
|
"lodash-es": "^4.17.21",
|
|
28
|
-
"uppload": "^3.2.1",
|
|
29
28
|
"v-calendar": "^2.3.2",
|
|
30
29
|
"vue": "^2.6.14",
|
|
31
30
|
"vue-good-table": "^2.21.8",
|
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<div v-if="type === 'default'">
|
|
4
|
-
<slot></slot>
|
|
5
|
-
<div :class="errorClasses" class="" id="c-file-area" @click.prevent="uploader.open()">
|
|
6
|
-
<button
|
|
7
|
-
type="white"
|
|
8
|
-
class="pic-btn inline-flex items-center px-4 py-2 shadow-sm text-sm font-medium rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 text-gray-700 border bg-white border-gray-300 hover:bg-gray-50 focus:ring-indigo-600"
|
|
9
|
-
>
|
|
10
|
-
{{ buttonText }}
|
|
11
|
-
</button>
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
14
3
|
<div v-if="type === 'filestack'" :class="filestackClasses" id="filestack-uploader"></div>
|
|
15
4
|
<p v-if="!isValidate" class="mt-2 text-sm text-red-600">
|
|
16
5
|
{{ errorMessage }}
|
|
@@ -20,7 +9,6 @@
|
|
|
20
9
|
|
|
21
10
|
<script>
|
|
22
11
|
import * as filestack from "filestack-js";
|
|
23
|
-
import { Uppload, Local, xhrUploader, en, Crop, Unsplash } from "uppload";
|
|
24
12
|
|
|
25
13
|
export default {
|
|
26
14
|
name: "CUpload",
|
|
@@ -60,17 +48,7 @@ export default {
|
|
|
60
48
|
},
|
|
61
49
|
onUploadSuccess: {
|
|
62
50
|
type: Function,
|
|
63
|
-
}
|
|
64
|
-
includeUnsplash: {
|
|
65
|
-
type: Boolean,
|
|
66
|
-
},
|
|
67
|
-
cropImage: {
|
|
68
|
-
type: Boolean,
|
|
69
|
-
},
|
|
70
|
-
aspectRatioDimensions: {
|
|
71
|
-
type: Number,
|
|
72
|
-
default: 23 / 45,
|
|
73
|
-
},
|
|
51
|
+
}
|
|
74
52
|
},
|
|
75
53
|
data() {
|
|
76
54
|
return {
|
|
@@ -90,33 +68,6 @@ export default {
|
|
|
90
68
|
const picker = client.picker(options);
|
|
91
69
|
picker.open();
|
|
92
70
|
},
|
|
93
|
-
initUppload() {
|
|
94
|
-
// Uppload library
|
|
95
|
-
this.uploader = new Uppload({
|
|
96
|
-
lang: en,
|
|
97
|
-
compression: 0.4,
|
|
98
|
-
compressionToMime: "image/jpeg",
|
|
99
|
-
maxSize: [500, 1000],
|
|
100
|
-
uploader: xhrUploader({
|
|
101
|
-
endpoint: `${this.url}`,
|
|
102
|
-
fileKeyName: "image",
|
|
103
|
-
responseFunction: (response) => {
|
|
104
|
-
this.$emit("onUploadSuccess", response);
|
|
105
|
-
},
|
|
106
|
-
}),
|
|
107
|
-
});
|
|
108
|
-
this.uploader.use([
|
|
109
|
-
new Local(),
|
|
110
|
-
...(this.includeUnsplash
|
|
111
|
-
? [new Unsplash("hXfo-C0svXV4IDCncBo7s-ySQpVJVeZrGuWxwwgC7qw")]
|
|
112
|
-
: []),
|
|
113
|
-
...(this.cropImage ? [new Crop({ aspectRatio: this.aspectRatioDimensions })] : []),
|
|
114
|
-
]);
|
|
115
|
-
// Uppload Error Handle
|
|
116
|
-
this.uploader.on("error", (error) => {
|
|
117
|
-
console.log("The error message is", error);
|
|
118
|
-
});
|
|
119
|
-
},
|
|
120
71
|
},
|
|
121
72
|
computed: {
|
|
122
73
|
errorClasses() {
|
|
@@ -130,8 +81,6 @@ export default {
|
|
|
130
81
|
mounted() {
|
|
131
82
|
if (this.type === "filestack") {
|
|
132
83
|
this.initFilestack();
|
|
133
|
-
} else if (this.type == "default") {
|
|
134
|
-
this.initUppload();
|
|
135
84
|
}
|
|
136
85
|
},
|
|
137
86
|
};
|
package/src/icons.js
CHANGED
|
@@ -202,5 +202,15 @@ export default {
|
|
|
202
202
|
"clipboard-check-outline":
|
|
203
203
|
"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4",
|
|
204
204
|
"home":
|
|
205
|
-
"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"
|
|
205
|
+
"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z",
|
|
206
|
+
"archive":
|
|
207
|
+
"M4 3a2 2 0 100 4h12a2 2 0 100-4H4z M3 8h14v7a2 2 0 01-2 2H5a2 2 0 01-2-2V8zm5 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z",
|
|
208
|
+
"printer":
|
|
209
|
+
"M5 4v3H4a2 2 0 00-2 2v3a2 2 0 002 2h1v2a2 2 0 002 2h6a2 2 0 002-2v-2h1a2 2 0 002-2V9a2 2 0 00-2-2h-1V4a2 2 0 00-2-2H7a2 2 0 00-2 2zm8 0H7v3h6V4zm0 8H7v4h6v-4z",
|
|
210
|
+
"user-circle":
|
|
211
|
+
"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-6-3a2 2 0 11-4 0 2 2 0 014 0zm-2 4a5 5 0 00-4.546 2.916A5.986 5.986 0 0010 16a5.986 5.986 0 004.546-2.084A5 5 0 0010 11z",
|
|
212
|
+
"key":
|
|
213
|
+
"M18 8a6 6 0 01-7.743 5.743L10 14l-1 1-1 1H6v2H2v-4l4.257-4.257A6 6 0 1118 8zm-6-4a1 1 0 100 2 2 2 0 012 2 1 1 0 102 0 4 4 0 00-4-4z",
|
|
214
|
+
"template":
|
|
215
|
+
"M3 4a1 1 0 011-1h12a1 1 0 011 1v2a1 1 0 01-1 1H4a1 1 0 01-1-1V4zM3 10a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H4a1 1 0 01-1-1v-6zM14 9a1 1 0 00-1 1v6a1 1 0 001 1h2a1 1 0 001-1v-6a1 1 0 00-1-1h-2z",
|
|
206
216
|
};
|