classcard-ui 0.2.294 → 0.2.298
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 +72 -122
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.umd.js +72 -122
- package/dist/classcard-ui.umd.js.map +1 -1
- package/dist/classcard-ui.umd.min.js +1 -1
- package/dist/classcard-ui.umd.min.js.map +1 -1
- package/package.json +3 -1
- package/src/components/CButtonGroup/CButtonGroup.vue +2 -2
- package/src/components/CRadio/CRadio.vue +10 -10
- package/src/components/CReorderableStackedList/CReorderableStackedList.vue +1 -0
- package/src/components/CTable/CTable.vue +15 -70
- package/src/icons.js +1 -1
- package/src/stories/CButtonGroup.stories.js +6 -2
- package/src/stories/CReorderableStackedList.stories.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "classcard-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.298",
|
|
4
4
|
"main": "dist/classcard-ui.common.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "vue-cli-service serve",
|
|
@@ -53,6 +53,8 @@
|
|
|
53
53
|
"eslint": "^6.7.2",
|
|
54
54
|
"eslint-plugin-vue": "^6.2.2",
|
|
55
55
|
"postcss": "^7.0.36",
|
|
56
|
+
"prettier": "^2.5.1",
|
|
57
|
+
"prettier-plugin-tailwindcss": "^0.1.6",
|
|
56
58
|
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.14",
|
|
57
59
|
"vue-template-compiler": "^2.6.14"
|
|
58
60
|
},
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
'rounded-l-md border-r-0': index == 0,
|
|
52
52
|
'px-4': button.label,
|
|
53
53
|
}"
|
|
54
|
-
@click="handleEvent(button.
|
|
55
|
-
@blur="handleEvent(button.
|
|
54
|
+
@click="handleEvent(button.onClickAction)"
|
|
55
|
+
@blur="handleEvent(button.blurAction)"
|
|
56
56
|
>
|
|
57
57
|
<div v-if="button.icon == ''" class="h-5"></div>
|
|
58
58
|
<c-icon
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div>
|
|
3
3
|
<div class="bg-white rounded-md -space-y-px">
|
|
4
4
|
<div
|
|
5
|
-
class="relative rounded-tl-md rounded-tr-md pb-5
|
|
5
|
+
class="relative rounded-tl-md rounded-tr-md pb-5"
|
|
6
6
|
v-for="item in items"
|
|
7
7
|
v-bind:key="item.label"
|
|
8
8
|
>
|
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 cursor-pointer border-gray-300 disabled:opacity-50"
|
|
17
17
|
:disabled="isDisabled"
|
|
18
18
|
/>
|
|
19
|
+
<label class="ml-3 flex flex-col cursor-pointer" @click="onChange(item.value)">
|
|
20
|
+
<span class="block text-sm font-medium">
|
|
21
|
+
{{ item.label }}
|
|
22
|
+
</span>
|
|
23
|
+
<span class="block text-sm text-gray-500">
|
|
24
|
+
{{ item.description }}
|
|
25
|
+
</span>
|
|
26
|
+
</label>
|
|
19
27
|
</div>
|
|
20
|
-
<
|
|
21
|
-
<span class="block text-sm font-medium">
|
|
22
|
-
{{ item.label }}
|
|
23
|
-
</span>
|
|
24
|
-
<span class="block text-sm text-gray-500">
|
|
25
|
-
{{ item.description }}
|
|
26
|
-
</span>
|
|
27
|
-
<slot v-if="item.value === selectedItem" :name="item.value" />
|
|
28
|
-
</label>
|
|
28
|
+
<slot v-if="item.value === selectedItem" :name="item.value" />
|
|
29
29
|
</div>
|
|
30
30
|
</div>
|
|
31
31
|
</div>
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<div
|
|
4
|
-
slot="table-actions"
|
|
5
|
-
v-if="tableActions"
|
|
6
|
-
class="bg-gray-50 rounded-lg p-3 mb-4"
|
|
7
|
-
>
|
|
3
|
+
<div slot="table-actions" v-if="tableActions" class="mb-4 rounded-lg bg-gray-50 p-3">
|
|
8
4
|
<div class="flex justify-between">
|
|
9
5
|
<div v-if="searching">
|
|
10
6
|
<c-input
|
|
@@ -22,55 +18,22 @@
|
|
|
22
18
|
<div>
|
|
23
19
|
<button
|
|
24
20
|
@click="handleToggle"
|
|
25
|
-
class="
|
|
26
|
-
inline-flex
|
|
27
|
-
justify-center
|
|
28
|
-
w-full
|
|
29
|
-
rounded-md
|
|
30
|
-
border border-gray-200
|
|
31
|
-
shadow-sm
|
|
32
|
-
px-2
|
|
33
|
-
py-2
|
|
34
|
-
bg-white
|
|
35
|
-
text-sm
|
|
36
|
-
font-medium
|
|
37
|
-
hover:bg-gray-50
|
|
38
|
-
focus:outline-none focus:outline-none
|
|
39
|
-
focus:ring-2 focus:ring-offset-2 focus:ring-indigo-600
|
|
40
|
-
"
|
|
21
|
+
class="focus:outline-none inline-flex w-full justify-center rounded-md border border-gray-200 bg-white px-2 py-2 text-sm font-medium shadow-sm hover:bg-gray-50 focus:ring-2 focus:ring-indigo-600 focus:ring-offset-2"
|
|
41
22
|
aria-haspopup="true"
|
|
42
23
|
aria-expanded="true"
|
|
43
24
|
>
|
|
44
|
-
<c-icon
|
|
45
|
-
name="view-board"
|
|
46
|
-
type="solid"
|
|
47
|
-
class="text-gray-400 h-5 w-5"
|
|
48
|
-
></c-icon>
|
|
25
|
+
<c-icon name="view-board" type="solid" class="h-5 w-5 text-gray-400"></c-icon>
|
|
49
26
|
<c-icon
|
|
50
27
|
name="chevron-down"
|
|
51
28
|
type="solid"
|
|
52
|
-
class="ml-1
|
|
29
|
+
class="ml-1 h-5 w-5 text-gray-400"
|
|
53
30
|
></c-icon>
|
|
54
31
|
</button>
|
|
55
32
|
</div>
|
|
56
33
|
<!-- dropdown having list of all columns to show hide -->
|
|
57
34
|
<div
|
|
58
35
|
v-if="toggleDropdown"
|
|
59
|
-
class="
|
|
60
|
-
origin-top-right
|
|
61
|
-
absolute
|
|
62
|
-
right-0
|
|
63
|
-
mt-2
|
|
64
|
-
-mr-1
|
|
65
|
-
w-56
|
|
66
|
-
rounded-md
|
|
67
|
-
shadow-lg
|
|
68
|
-
bg-white
|
|
69
|
-
ring-1 ring-gray-900 ring-opacity-5
|
|
70
|
-
z-100
|
|
71
|
-
overflow-y-auto
|
|
72
|
-
max-h-96
|
|
73
|
-
"
|
|
36
|
+
class="absolute right-0 z-10 mt-2 -mr-1 max-h-96 w-56 origin-top-right overflow-y-auto rounded-md bg-white shadow-lg ring-1 ring-gray-900 ring-opacity-5"
|
|
74
37
|
tabindex="0"
|
|
75
38
|
@blur="handleToggle"
|
|
76
39
|
>
|
|
@@ -84,15 +47,7 @@
|
|
|
84
47
|
href="#"
|
|
85
48
|
v-for="column in showHideColumnList"
|
|
86
49
|
v-bind:key="column.field"
|
|
87
|
-
class="
|
|
88
|
-
flex
|
|
89
|
-
block
|
|
90
|
-
px-4
|
|
91
|
-
py-2
|
|
92
|
-
text-sm text-gray-700
|
|
93
|
-
hover:bg-gray-100
|
|
94
|
-
hover:text-gray-900
|
|
95
|
-
"
|
|
50
|
+
class="block flex px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900"
|
|
96
51
|
role="menuitem"
|
|
97
52
|
>
|
|
98
53
|
<c-checkbox
|
|
@@ -121,12 +76,10 @@
|
|
|
121
76
|
</div>
|
|
122
77
|
|
|
123
78
|
<vue-good-table
|
|
124
|
-
class="
|
|
79
|
+
class="overflow-hidden rounded-lg border-2 border-solid border-gray-100"
|
|
125
80
|
mode="remote"
|
|
126
81
|
ref="my-table"
|
|
127
|
-
:styleClass="
|
|
128
|
-
showLoader ? 'vgt-table opacity-50 pointer-events-none' : 'vgt-table'
|
|
129
|
-
"
|
|
82
|
+
:styleClass="showLoader ? 'vgt-table opacity-50 pointer-events-none' : 'vgt-table'"
|
|
130
83
|
row-style-class="focus:outline-none"
|
|
131
84
|
min-height="400px"
|
|
132
85
|
:globalSearch="true"
|
|
@@ -170,21 +123,21 @@
|
|
|
170
123
|
<c-icon
|
|
171
124
|
v-if="props.column.direction == null"
|
|
172
125
|
name="sort-ascending-solid"
|
|
173
|
-
class="h-5 w-5
|
|
126
|
+
class="sortingIcon invisible ml-3 h-5 w-5"
|
|
174
127
|
type="solid"
|
|
175
128
|
></c-icon>
|
|
176
129
|
<!-- renders when direction is asc -->
|
|
177
130
|
<c-icon
|
|
178
131
|
v-else-if="props.column.direction == 'asc'"
|
|
179
132
|
name="sort-ascending-solid"
|
|
180
|
-
class="h-5 w-5
|
|
133
|
+
class="ml-3 h-5 w-5"
|
|
181
134
|
type="solid"
|
|
182
135
|
></c-icon>
|
|
183
136
|
<!-- renders when direction is desc -->
|
|
184
137
|
<c-icon
|
|
185
138
|
v-else-if="props.column.direction == 'desc'"
|
|
186
139
|
name="sort-descending-solid"
|
|
187
|
-
class="h-5 w-5
|
|
140
|
+
class="ml-3 h-5 w-5"
|
|
188
141
|
type="solid"
|
|
189
142
|
></c-icon>
|
|
190
143
|
</span>
|
|
@@ -195,11 +148,7 @@
|
|
|
195
148
|
<template slot="table-row" slot-scope="props">
|
|
196
149
|
<!-- renders if drag and drop is present in table -->
|
|
197
150
|
<span v-if="props.column.field == 'drag'">
|
|
198
|
-
<c-icon
|
|
199
|
-
name="menu-solid"
|
|
200
|
-
type="solid"
|
|
201
|
-
class="h-5 w-5 text-gray-500 handle"
|
|
202
|
-
></c-icon>
|
|
151
|
+
<c-icon name="menu-solid" type="solid" class="handle h-5 w-5 text-gray-500"></c-icon>
|
|
203
152
|
</span>
|
|
204
153
|
<!-- if customization or adding another form element is required -->
|
|
205
154
|
<span v-else-if="props.column.customizeColumn">
|
|
@@ -223,7 +172,7 @@
|
|
|
223
172
|
<!-- Custom loader for table -->
|
|
224
173
|
<template slot="loadingContent">
|
|
225
174
|
<svg
|
|
226
|
-
class="
|
|
175
|
+
class="ml-auto mr-auto h-7 w-7 animate-spin text-white"
|
|
227
176
|
xmlns="http://www.w3.org/2000/svg"
|
|
228
177
|
fill="none"
|
|
229
178
|
viewBox="0 0 24 24"
|
|
@@ -376,12 +325,8 @@ export default {
|
|
|
376
325
|
},
|
|
377
326
|
// array of rows after drag and drop
|
|
378
327
|
rearrange(oldIndex, newIndex) {
|
|
379
|
-
const movedItem = this.reorderedArray.find(
|
|
380
|
-
|
|
381
|
-
);
|
|
382
|
-
const remainingItems = this.reorderedArray.filter(
|
|
383
|
-
(item, index) => index !== oldIndex
|
|
384
|
-
);
|
|
328
|
+
const movedItem = this.reorderedArray.find((item, index) => index === oldIndex);
|
|
329
|
+
const remainingItems = this.reorderedArray.filter((item, index) => index !== oldIndex);
|
|
385
330
|
const reorderedItems = [
|
|
386
331
|
...remainingItems.slice(0, newIndex),
|
|
387
332
|
movedItem,
|
package/src/icons.js
CHANGED
|
@@ -40,7 +40,7 @@ export default {
|
|
|
40
40
|
integration:
|
|
41
41
|
"M10,13H4a1,1,0,0,0-1,1v6a1,1,0,0,0,1,1h6a1,1,0,0,0,1-1V14A1,1,0,0,0,10,13ZM9,19H5V15H9ZM20,3H14a1,1,0,0,0-1,1v6a1,1,0,0,0,1,1h6a1,1,0,0,0,1-1V4A1,1,0,0,0,20,3ZM19,9H15V5h4Zm1,7H18V14a1,1,0,0,0-2,0v2H14a1,1,0,0,0,0,2h2v2a1,1,0,0,0,2,0V18h2a1,1,0,0,0,0-2ZM10,3H4A1,1,0,0,0,3,4v6a1,1,0,0,0,1,1h6a1,1,0,0,0,1-1V4A1,1,0,0,0,10,3ZM9,9H5V5H9Z",
|
|
42
42
|
clipboard:
|
|
43
|
-
"
|
|
43
|
+
"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z",
|
|
44
44
|
package:
|
|
45
45
|
"M12 8v13m0-13V6a2 2 0 112 2h-2zm0 0V5.5A2.5 2.5 0 109.5 8H12zm-7 4h14M5 12a2 2 0 110-4h14a2 2 0 110 4M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7",
|
|
46
46
|
document:
|
|
@@ -16,13 +16,17 @@ const Template = (args, { argTypes }) => ({
|
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
const consoleIt = () => {
|
|
19
|
-
console.log("
|
|
19
|
+
console.log("onclick fired")
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const consoleOut = () => {
|
|
23
|
+
console.log("focus lost")
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
export const Default = Template.bind({});
|
|
23
27
|
Default.args = {
|
|
24
28
|
buttonObject: [
|
|
25
|
-
{ icon: "bookmark", label: "Students", value:'students',
|
|
29
|
+
{ icon: "bookmark", label: "Students", value:'students', onClickAction: consoleIt, blurAction: consoleOut },
|
|
26
30
|
{ icon: "chat", label: "Alkama", value:'alkama'},
|
|
27
31
|
{ icon: "bookmark", label: "Attendance", value:'attendance' },
|
|
28
32
|
],
|
|
@@ -18,6 +18,6 @@ const Template = (args, { argTypes }) => ({
|
|
|
18
18
|
export const Default = Template.bind({});
|
|
19
19
|
Default.args = {
|
|
20
20
|
listItems: [
|
|
21
|
-
{ image: "https://images.unsplash.com/photo-1491528323818-fdd1faba62cc?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80", heading: "Maths-Level1", description: "calvin.hawkins@example.com", size:"medium", rounded:false, tag:true, collapse:false, listIcon: true, reorder:true },
|
|
21
|
+
{ image: "https://images.unsplash.com/photo-1491528323818-fdd1faba62cc?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80", heading: "Maths-Level1", description: "calvin.hawkins@example.com", size:"medium", rounded:false, tag:true, collapse:false, listIcon: true, reorder:true, imageClasses: "bg-gray-200 border-gray-200 border" },
|
|
22
22
|
],
|
|
23
23
|
};
|