classcard-ui 0.2.792 → 0.2.794
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 +135 -54
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.umd.js +135 -54
- 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 +1 -1
- package/src/components/CTable/CTable.vue +82 -1
package/package.json
CHANGED
|
@@ -75,7 +75,11 @@
|
|
|
75
75
|
</div>
|
|
76
76
|
<slot name="customDatePicker"></slot>
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
<!-- simple download button -->
|
|
79
|
+
<div
|
|
80
|
+
v-if="enableDownload && !downloadDropdown"
|
|
81
|
+
@click="startDownload"
|
|
82
|
+
>
|
|
79
83
|
<c-button-icon
|
|
80
84
|
type="white"
|
|
81
85
|
:icon="
|
|
@@ -92,6 +96,64 @@
|
|
|
92
96
|
:isLoading="downloadLoader"
|
|
93
97
|
></c-button-icon>
|
|
94
98
|
</div>
|
|
99
|
+
<!-- download button with download options -->
|
|
100
|
+
<div v-else class="relative ml-3">
|
|
101
|
+
<div>
|
|
102
|
+
<button
|
|
103
|
+
@click="handleDownloadToggle"
|
|
104
|
+
class="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:outline-none focus:ring-2 focus:ring-indigo-600 focus:ring-offset-2"
|
|
105
|
+
aria-haspopup="true"
|
|
106
|
+
aria-expanded="true"
|
|
107
|
+
>
|
|
108
|
+
<c-icon
|
|
109
|
+
v-if="downloadOptionLoader"
|
|
110
|
+
cursorType="cursor-pointer"
|
|
111
|
+
class="mr-2 h-5 w-5 text-gray-400"
|
|
112
|
+
name="loader"
|
|
113
|
+
></c-icon>
|
|
114
|
+
<c-icon
|
|
115
|
+
v-else
|
|
116
|
+
name="download-solid"
|
|
117
|
+
type="solid"
|
|
118
|
+
class="h-5 w-5 text-gray-400"
|
|
119
|
+
></c-icon>
|
|
120
|
+
<c-icon
|
|
121
|
+
name="chevron-down"
|
|
122
|
+
type="solid"
|
|
123
|
+
class="ml-1 h-5 w-5 text-gray-400"
|
|
124
|
+
></c-icon>
|
|
125
|
+
</button>
|
|
126
|
+
</div>
|
|
127
|
+
<!-- download options dropdown -->
|
|
128
|
+
<div
|
|
129
|
+
v-if="toggleDownloadDropdown"
|
|
130
|
+
@click="handleDownloadToggle"
|
|
131
|
+
class="fixed inset-0 z-20"
|
|
132
|
+
></div>
|
|
133
|
+
<div
|
|
134
|
+
v-if="toggleDownloadDropdown"
|
|
135
|
+
class="absolute right-0 z-30 mt-2 -mr-1 max-h-96 w-64 origin-top-right overflow-y-auto rounded-md bg-white shadow-lg ring-1 ring-gray-900 ring-opacity-5"
|
|
136
|
+
tabindex="0"
|
|
137
|
+
>
|
|
138
|
+
<div
|
|
139
|
+
class="py-1"
|
|
140
|
+
role="menu"
|
|
141
|
+
aria-orientation="vertical"
|
|
142
|
+
aria-labelledby="option-menu"
|
|
143
|
+
>
|
|
144
|
+
<div
|
|
145
|
+
v-for="(item, index) in showDownloadDropdownList"
|
|
146
|
+
:key="index"
|
|
147
|
+
class="cursor-pointer px-4 py-2 text-sm text-gray-900 hover:bg-gray-100 hover:text-gray-900"
|
|
148
|
+
role="menuitem"
|
|
149
|
+
@click="downloadFromOption(item.value)"
|
|
150
|
+
>
|
|
151
|
+
<p>{{ item.title }}</p>
|
|
152
|
+
<p class="text-sm text-gray-400">{{ item.description }}</p>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
95
157
|
</div>
|
|
96
158
|
</div>
|
|
97
159
|
</div>
|
|
@@ -316,6 +378,10 @@ export default {
|
|
|
316
378
|
showHideColumnList: {
|
|
317
379
|
type: Array,
|
|
318
380
|
},
|
|
381
|
+
// List of items to show download options
|
|
382
|
+
showDownloadDropdownList: {
|
|
383
|
+
type: Array,
|
|
384
|
+
},
|
|
319
385
|
// Function on changing page number
|
|
320
386
|
onPageChange: {
|
|
321
387
|
type: Function,
|
|
@@ -336,6 +402,13 @@ export default {
|
|
|
336
402
|
downloadLoader: {
|
|
337
403
|
type: Boolean,
|
|
338
404
|
},
|
|
405
|
+
// Start the loader
|
|
406
|
+
downloadOptionLoader: {
|
|
407
|
+
type: Boolean,
|
|
408
|
+
},
|
|
409
|
+
downloadDropdown: {
|
|
410
|
+
type: Boolean,
|
|
411
|
+
},
|
|
339
412
|
rowStyleClassFn: {
|
|
340
413
|
type: Function,
|
|
341
414
|
default: () => "",
|
|
@@ -373,6 +446,7 @@ export default {
|
|
|
373
446
|
data() {
|
|
374
447
|
return {
|
|
375
448
|
toggleDropdown: false,
|
|
449
|
+
toggleDownloadDropdown: false,
|
|
376
450
|
showLoader: this.isLoading,
|
|
377
451
|
searchTerm: this.searchQuery ? this.searchQuery : "",
|
|
378
452
|
paginationRecords: this.paginationData,
|
|
@@ -396,6 +470,9 @@ export default {
|
|
|
396
470
|
handleToggle() {
|
|
397
471
|
this.toggleDropdown = !this.toggleDropdown;
|
|
398
472
|
},
|
|
473
|
+
handleDownloadToggle() {
|
|
474
|
+
this.toggleDownloadDropdown = !this.toggleDownloadDropdown;
|
|
475
|
+
},
|
|
399
476
|
showHideColumn(value, name) {
|
|
400
477
|
this.$emit("hideCols", value, name);
|
|
401
478
|
},
|
|
@@ -459,6 +536,10 @@ export default {
|
|
|
459
536
|
startDownload() {
|
|
460
537
|
this.$emit("handleDownloadButton");
|
|
461
538
|
},
|
|
539
|
+
downloadFromOption(value) {
|
|
540
|
+
this.toggleDownloadDropdown = false;
|
|
541
|
+
this.$emit("handleDownloadOptionButton", value);
|
|
542
|
+
},
|
|
462
543
|
},
|
|
463
544
|
watch: {
|
|
464
545
|
isLoading() {
|