classcard-ui 0.2.187 → 0.2.191
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 +235 -76
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.umd.js +235 -76
- package/dist/classcard-ui.umd.js.map +1 -1
- package/dist/classcard-ui.umd.min.js +46 -5
- package/dist/classcard-ui.umd.min.js.map +1 -1
- package/package.json +6 -5
- package/src/components/CTable/CTable.vue +5 -12
- package/src/components/CUpload/CUpload.vue +59 -20
- package/src/stories/CTable.stories.js +7 -54
- package/src/stories/CUpload.stories.js +16 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "classcard-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.191",
|
|
4
4
|
"main": "dist/classcard-ui.common.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "vue-cli-service serve",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"@tailwindcss/forms": "^0.2.1",
|
|
21
21
|
"core-js": "^3.18.0",
|
|
22
22
|
"dayjs": "^1.10.7",
|
|
23
|
+
"filestack-js": "^3.25.0",
|
|
23
24
|
"gridjs-selection": "^3.4.0",
|
|
24
25
|
"gridjs-vue": "^3.4.0",
|
|
25
26
|
"lodash-es": "^4.17.21",
|
|
@@ -35,10 +36,10 @@
|
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
38
|
"@babel/core": "^7.15.5",
|
|
38
|
-
"@storybook/addon-actions": "^6.
|
|
39
|
-
"@storybook/addon-essentials": "^6.
|
|
40
|
-
"@storybook/addon-links": "^6.
|
|
41
|
-
"@storybook/vue": "^6.
|
|
39
|
+
"@storybook/addon-actions": "^6.4.0",
|
|
40
|
+
"@storybook/addon-essentials": "^6.4.0",
|
|
41
|
+
"@storybook/addon-links": "^6.4.0",
|
|
42
|
+
"@storybook/vue": "^6.4.0",
|
|
42
43
|
"@tailwindcss/postcss7-compat": "^2.2.14",
|
|
43
44
|
"@types/lodash-es": "^4.17.5",
|
|
44
45
|
"@vue/cli-plugin-babel": "^4.5.13",
|
|
@@ -287,6 +287,7 @@ export default {
|
|
|
287
287
|
showLoader: this.isLoading,
|
|
288
288
|
searchTerm: "",
|
|
289
289
|
paginationRecords: this.paginationData,
|
|
290
|
+
reorderedArray: [...this.rows],
|
|
290
291
|
};
|
|
291
292
|
},
|
|
292
293
|
methods: {
|
|
@@ -299,23 +300,15 @@ export default {
|
|
|
299
300
|
},
|
|
300
301
|
// array of rows after drag and drop
|
|
301
302
|
rearrange(oldIndex, newIndex) {
|
|
302
|
-
|
|
303
|
-
this.
|
|
304
|
-
reorderedArray.push({ oldID: row.id });
|
|
305
|
-
});
|
|
306
|
-
const movedItem = this.rows.find((item, index) => index === oldIndex);
|
|
307
|
-
const remainingItems = this.rows.filter((item, index) => index !== oldIndex);
|
|
308
|
-
|
|
303
|
+
const movedItem = this.reorderedArray.find((item, index) => index === oldIndex);
|
|
304
|
+
const remainingItems = this.reorderedArray.filter((item, index) => index !== oldIndex);
|
|
309
305
|
const reorderedItems = [
|
|
310
306
|
...remainingItems.slice(0, newIndex),
|
|
311
307
|
movedItem,
|
|
312
308
|
...remainingItems.slice(newIndex),
|
|
313
309
|
];
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
});
|
|
317
|
-
this.$emit('reordered', reorderedArray);
|
|
318
|
-
return reorderedArray;
|
|
310
|
+
this.reorderedArray = [...reorderedItems];
|
|
311
|
+
this.$emit('reordered', this.reorderedArray);
|
|
319
312
|
},
|
|
320
313
|
// listing functions
|
|
321
314
|
sortChange(params) {
|
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<div class="
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
3
|
+
<div v-if="type === 'default'">
|
|
4
|
+
<slot></slot>
|
|
5
|
+
<div class="flex justify-between">
|
|
6
|
+
<label class="block text-sm font-medium text-gray-900">
|
|
7
|
+
{{ label }}
|
|
8
|
+
</label>
|
|
9
|
+
<span v-if="hint" class="text-sm text-gray-500">{{ hint }}</span>
|
|
10
|
+
</div>
|
|
11
|
+
<div
|
|
12
|
+
:class="errorClasses"
|
|
13
|
+
class="w-full mt-2 flex justify-center px-6 py-14 border-2 rounded-md"
|
|
14
|
+
>
|
|
15
|
+
<div class="space-y-1 text-center">
|
|
16
|
+
<div class="flex text-sm text-gray-600">
|
|
17
|
+
<c-icon
|
|
18
|
+
type="solid"
|
|
19
|
+
class="h-5 w-5 text-indigo-600"
|
|
20
|
+
name="arrow-up"
|
|
21
|
+
></c-icon>
|
|
22
|
+
<label
|
|
23
|
+
class="relative cursor-pointer bg-white rounded-md font-medium text-indigo-600 hover:text-indigo-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-indigo-500 ml-1"
|
|
24
|
+
>
|
|
25
|
+
<span>Upload</span>
|
|
26
|
+
<input type="file" class="sr-only" />
|
|
27
|
+
</label>
|
|
28
|
+
</div>
|
|
23
29
|
</div>
|
|
24
30
|
</div>
|
|
25
31
|
</div>
|
|
32
|
+
<div v-if="type === 'filestack'" class="" id="filestack-uploader"></div>
|
|
26
33
|
<p v-if="!isValidate" class="mt-2 text-sm text-red-600">
|
|
27
34
|
{{ errorMessage }}
|
|
28
35
|
</p>
|
|
@@ -31,6 +38,8 @@
|
|
|
31
38
|
|
|
32
39
|
<script>
|
|
33
40
|
import CIcon from "../CIcon/CIcon.vue";
|
|
41
|
+
import * as filestack from "filestack-js";
|
|
42
|
+
|
|
34
43
|
export default {
|
|
35
44
|
name: "CUpload",
|
|
36
45
|
components: { CIcon },
|
|
@@ -48,6 +57,31 @@ export default {
|
|
|
48
57
|
errorMessage: {
|
|
49
58
|
type: String,
|
|
50
59
|
},
|
|
60
|
+
type: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: "default",
|
|
63
|
+
},
|
|
64
|
+
filestackApiKey: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: "",
|
|
67
|
+
},
|
|
68
|
+
filestackClasses: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: "w-96 h-96",
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
methods: {
|
|
74
|
+
initFilestack() {
|
|
75
|
+
const client = filestack.init(this.filestackApiKey);
|
|
76
|
+
const options = {
|
|
77
|
+
displayMode: "inline",
|
|
78
|
+
container: "#filestack-uploader",
|
|
79
|
+
uploadInBackground: false,
|
|
80
|
+
onUploadDone: (res) => this.$emit("filestack-uploaded", res),
|
|
81
|
+
};
|
|
82
|
+
const picker = client.picker(options);
|
|
83
|
+
picker.open();
|
|
84
|
+
},
|
|
51
85
|
},
|
|
52
86
|
computed: {
|
|
53
87
|
errorClasses() {
|
|
@@ -58,6 +92,11 @@ export default {
|
|
|
58
92
|
};
|
|
59
93
|
},
|
|
60
94
|
},
|
|
95
|
+
mounted() {
|
|
96
|
+
if (this.type === "filestack") {
|
|
97
|
+
this.initFilestack();
|
|
98
|
+
}
|
|
99
|
+
},
|
|
61
100
|
};
|
|
62
101
|
</script>
|
|
63
102
|
|
|
@@ -29,18 +29,14 @@ export const Default = Template.bind({});
|
|
|
29
29
|
Default.args = {
|
|
30
30
|
cols: [
|
|
31
31
|
{ label: "", field: "drag", hidden: false },
|
|
32
|
+
{ label: "Payment mode", field: "mode", hidden: false },
|
|
32
33
|
{
|
|
33
|
-
label: "
|
|
34
|
-
field: "
|
|
34
|
+
label: "",
|
|
35
|
+
field: "menuOptions",
|
|
35
36
|
hidden: false,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
{ label: "Model", field: "modal", hidden: false, sortable: true, direction: null },
|
|
40
|
-
{ label: "Staff", field: "staff", hidden: false },
|
|
41
|
-
{ label: "CRR", field: "crr", hidden: false, sortable: true, direction: null, type: "decimal" },
|
|
42
|
-
{ label: "Switch", field: "switch", hidden: false },
|
|
43
|
-
{ label: "Icon", field: "color", hidden: false },
|
|
37
|
+
customizeColumn: true,
|
|
38
|
+
width: "60px"
|
|
39
|
+
}
|
|
44
40
|
],
|
|
45
41
|
showHideColumnList: [
|
|
46
42
|
{ label: "", field: "drag", hidden: false },
|
|
@@ -68,50 +64,7 @@ Default.args = {
|
|
|
68
64
|
{ label: "Switch", field: "switch", hidden: false },
|
|
69
65
|
{ label: "Icon", field: "color", hidden: false },
|
|
70
66
|
],
|
|
71
|
-
rows: [
|
|
72
|
-
{
|
|
73
|
-
type: "",
|
|
74
|
-
id: 1,
|
|
75
|
-
make: "Baleno",
|
|
76
|
-
modal: "Fusion",
|
|
77
|
-
switch: "",
|
|
78
|
-
staff: {
|
|
79
|
-
image:
|
|
80
|
-
"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80",
|
|
81
|
-
name: "Manager",
|
|
82
|
-
},
|
|
83
|
-
crr: "0.00",
|
|
84
|
-
color: { name: "trash", type: "solid", class: "h-5 w-5" },
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
type: "",
|
|
88
|
-
id: 2,
|
|
89
|
-
make: "Test",
|
|
90
|
-
modal: "Cruz",
|
|
91
|
-
switch: "",
|
|
92
|
-
staff: {
|
|
93
|
-
image:
|
|
94
|
-
"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80",
|
|
95
|
-
name: "Manager",
|
|
96
|
-
},
|
|
97
|
-
crr: "9.56",
|
|
98
|
-
color: { name: "trash", type: "solid", class: "h-5 w-5" },
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
type: "",
|
|
102
|
-
id: 3,
|
|
103
|
-
make: "Honda City",
|
|
104
|
-
modal: "Maruti",
|
|
105
|
-
switch: "",
|
|
106
|
-
staff: {
|
|
107
|
-
image:
|
|
108
|
-
"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80",
|
|
109
|
-
name: "Manager",
|
|
110
|
-
},
|
|
111
|
-
crr: "3.28",
|
|
112
|
-
color: { name: "trash", type: "solid", class: "h-5 w-5" },
|
|
113
|
-
},
|
|
114
|
-
],
|
|
67
|
+
rows: [{"id":5,"mode":"ATM Machine 1","sort_order":2,"status":1,"rcInstitutionID":82,"created_at":"2020-09-02T12:53:09.000000Z","updated_at":"2021-11-25T13:13:56.000000Z"},{"id":11,"mode":"QA 1","sort_order":3,"status":1,"rcInstitutionID":82,"created_at":"2020-09-04T09:57:47.000000Z","updated_at":"2021-11-25T13:13:56.000000Z"},{"id":7,"mode":"ATM Machine 2","sort_order":4,"status":1,"rcInstitutionID":82,"created_at":"2020-09-04T09:45:47.000000Z","updated_at":"2021-11-25T13:13:56.000000Z"},{"id":18,"mode":"QA 3","sort_order":8,"status":1,"rcInstitutionID":82,"created_at":"2020-09-04T10:05:15.000000Z","updated_at":"2021-11-25T13:13:56.000000Z"},{"id":12,"mode":"QA 2","sort_order":21,"status":1,"rcInstitutionID":82,"created_at":"2020-09-04T09:57:55.000000Z","updated_at":"2021-11-25T13:13:56.000000Z"},{"id":15,"mode":"QA 4","sort_order":22,"status":1,"rcInstitutionID":82,"created_at":"2020-09-04T10:00:23.000000Z","updated_at":"2021-11-25T13:13:56.000000Z"},{"id":162,"mode":"Yes bank","sort_order":62,"status":1,"rcInstitutionID":82,"created_at":"2020-11-18T09:22:43.000000Z","updated_at":"2021-11-25T13:13:56.000000Z"},{"id":163,"mode":"SBI bank","sort_order":63,"status":1,"rcInstitutionID":82,"created_at":"2020-11-18T09:33:17.000000Z","updated_at":"2021-11-25T13:13:56.000000Z"},{"id":164,"mode":"BOB bank","sort_order":64,"status":1,"rcInstitutionID":82,"created_at":"2020-11-18T09:35:12.000000Z","updated_at":"2021-11-25T13:13:56.000000Z"},{"id":165,"mode":"PNB bank","sort_order":65,"status":1,"rcInstitutionID":82,"created_at":"2020-11-18T09:55:16.000000Z","updated_at":"2021-11-25T13:13:56.000000Z"}],
|
|
115
68
|
pagination: true,
|
|
116
69
|
sorting: false,
|
|
117
70
|
searching: true,
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
import CUpload from
|
|
2
|
-
import
|
|
1
|
+
import CUpload from "../components/CUpload/CUpload.vue";
|
|
2
|
+
import "./utils.css";
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
title:
|
|
5
|
+
title: "CUpload",
|
|
6
6
|
component: CUpload,
|
|
7
7
|
argTypes: {
|
|
8
8
|
label: String,
|
|
9
9
|
hint: String,
|
|
10
10
|
fileSize: String,
|
|
11
|
-
isValidate: Boolean
|
|
11
|
+
isValidate: Boolean,
|
|
12
|
+
type: {
|
|
13
|
+
control: {
|
|
14
|
+
type: "inline-radio",
|
|
15
|
+
options: ["default", "filestack", "uppload"],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
12
18
|
},
|
|
13
19
|
};
|
|
14
20
|
|
|
@@ -20,8 +26,10 @@ const Template = (args, { argTypes }) => ({
|
|
|
20
26
|
|
|
21
27
|
export const Default = Template.bind({});
|
|
22
28
|
Default.args = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
label: "Name",
|
|
30
|
+
hint: "Optional",
|
|
31
|
+
fileSize: "10",
|
|
32
|
+
isValidate: true,
|
|
33
|
+
type: "default",
|
|
34
|
+
filestackApiKey: "",
|
|
27
35
|
};
|