classcard-ui 0.2.392 → 0.2.395

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "classcard-ui",
3
- "version": "0.2.392",
3
+ "version": "0.2.395",
4
4
  "main": "dist/classcard-ui.common.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -291,7 +291,7 @@ export default {
291
291
  @apply rounded-b-md;
292
292
  }
293
293
  .vs__selected {
294
- @apply m-0 mr-1 border-none py-0 pl-0 pr-1.5;
294
+ @apply m-0 mr-1 border-none py-0 pl-1.5 pr-1.5;
295
295
  }
296
296
  .vs__selected-options {
297
297
  @apply pl-0;
@@ -1,22 +1,22 @@
1
1
  <template>
2
2
  <div
3
- class="bg-white px-4 py-3 flex items-center justify-between border-gray-200 sm:px-6"
3
+ class="flex items-center justify-between border-gray-200 bg-white px-4 py-3 sm:px-6"
4
4
  >
5
- <div class="flex-1 flex justify-between sm:hidden">
5
+ <div class="flex flex-1 justify-between sm:hidden">
6
6
  <a
7
7
  href="#"
8
- class="relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50"
8
+ class="relative inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50"
9
9
  >
10
10
  Previous
11
11
  </a>
12
12
  <a
13
13
  href="#"
14
- class="ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50"
14
+ class="relative ml-3 inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50"
15
15
  >
16
16
  Next
17
17
  </a>
18
18
  </div>
19
- <div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between">
19
+ <div class="hidden sm:flex sm:flex-1 sm:items-center sm:justify-between">
20
20
  <div>
21
21
  <p class="text-sm text-gray-700">
22
22
  Showing
@@ -24,24 +24,26 @@
24
24
  to
25
25
  <span class="font-medium">{{ setPaginationRecords.to }}</span>
26
26
  of
27
- <span class="font-medium">{{ setPaginationRecords.totalRecords }}</span>
27
+ <span class="font-medium">{{
28
+ setPaginationRecords.totalRecords
29
+ }}</span>
28
30
  results
29
31
  </p>
30
32
  </div>
31
33
  <div>
32
34
  <nav
33
- class="relative z-0 inline-flex rounded-md shadow-sm -space-x-px"
35
+ class="relative z-0 inline-flex -space-x-px rounded-md shadow-sm"
34
36
  aria-label="Pagination"
35
37
  >
36
38
  <div class="hidden md:-mt-px md:flex">
37
39
  <div
38
40
  href="#"
39
41
  @click="currentPageNumber == '1' ? '' : goToPreviousPage()"
40
- class="relative inline-flex items-center px-2 py-2 rounded-l-md border border-r-0 border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50"
42
+ class="relative inline-flex items-center rounded-l-md border border-r-0 border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-500 hover:bg-gray-50"
41
43
  :class="
42
44
  currentPageNumber == '1'
43
- ? 'text-gray-400 pointer-events-none'
44
- : 'text-gray-500 hover:text-gray-700 group cursor-pointer'
45
+ ? 'pointer-events-none text-gray-400'
46
+ : 'group cursor-pointer text-gray-500 hover:text-gray-700'
45
47
  "
46
48
  >
47
49
  <span class="sr-only">Previous</span>
@@ -66,17 +68,15 @@
66
68
  class="cursor-pointer"
67
69
  :class="[
68
70
  page == currentPageNumber
69
- ? 'z-10 bg-indigo-50 border-indigo-500 text-indigo-600 relative inline-flex items-center px-4 py-2 border text-sm font-medium'
71
+ ? 'relative z-10 inline-flex items-center border border-indigo-500 bg-indigo-50 px-4 py-2 text-sm font-medium text-indigo-600'
70
72
  : '',
71
73
  page === '...'
72
- ? 'bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border border-r-0 text-sm font-medium'
74
+ ? 'relative inline-flex items-center border border-r-0 border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-500 hover:bg-gray-50'
73
75
  : '',
74
76
  page !== currentPageNumber && page !== '...'
75
- ? 'bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border border-r-0 text-sm font-medium'
76
- : '',
77
- page == currentPageNumber + 1
78
- ? 'border-l-0'
77
+ ? 'relative inline-flex items-center border border-r-0 border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-500 hover:bg-gray-50'
79
78
  : '',
79
+ page == currentPageNumber + 1 ? 'border-l-0' : '',
80
80
  ]"
81
81
  @click="changePage(page)"
82
82
  >
@@ -87,12 +87,12 @@
87
87
  </div>
88
88
  <div
89
89
  href="#"
90
- class="relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50"
90
+ class="relative inline-flex items-center rounded-r-md border border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-500 hover:bg-gray-50"
91
91
  @click="currentPageNumber == lastPageNumber ? '' : goToNextPage()"
92
92
  :class="
93
93
  currentPageNumber == lastPageNumber
94
- ? 'text-gray-400 pointer-events-none'
95
- : 'text-gray-500 hover:text-gray-700 group cursor-pointer'
94
+ ? 'pointer-events-none text-gray-400'
95
+ : 'group cursor-pointer text-gray-500 hover:text-gray-700'
96
96
  "
97
97
  >
98
98
  <span class="sr-only">Next</span>
@@ -118,6 +118,8 @@
118
118
  </div>
119
119
  </template>
120
120
  <script>
121
+ import { isEqual } from "lodash-es";
122
+
121
123
  export default {
122
124
  name: "CPagination",
123
125
  props: {
@@ -188,5 +190,13 @@ export default {
188
190
  this.$emit("setNextPage", nextPage);
189
191
  },
190
192
  },
193
+ watch: {
194
+ setPaginationRecords(newVal, oldVal) {
195
+ if (!isEqual(newVal, oldVal)) {
196
+ this.currentPageNumber = newVal.currentPage;
197
+ this.lastPageNumber = newVal.lastPage;
198
+ }
199
+ },
200
+ },
191
201
  };
192
202
  </script>
@@ -4,7 +4,7 @@
4
4
  <li
5
5
  v-for="items in listItems"
6
6
  v-bind:key="items.size"
7
- class="py-4 flex justify-between items-center"
7
+ class="flex items-center justify-between py-4"
8
8
  :class="{ 'cursor-pointer': items.collapse, 'border-b border-gray-200': divider === true }"
9
9
  v-on="items.collapse ? { click: () => collapseList() } : null"
10
10
  >
@@ -13,15 +13,20 @@
13
13
  v-if="items.collapse"
14
14
  :name="showSection ? 'chevron-down' : 'chevron-right'"
15
15
  type="solid"
16
- class="mt-3 mr-3 text-gray-900 h-5 w-5"
16
+ class="mt-3 mr-3 h-5 w-5 shrink-0 text-gray-900"
17
17
  ></c-icon>
18
- <c-avatar :size="items.size" :rounded="items.rounded" :image="items.image"></c-avatar>
18
+ <c-avatar
19
+ :size="items.size"
20
+ :rounded="items.rounded"
21
+ :image="items.image"
22
+ class="shrink-0"
23
+ ></c-avatar>
19
24
  <div class="ml-3">
20
25
  <div class="flex pb-1">
21
26
  <p class="text-sm font-medium text-gray-900">
22
27
  {{ items.heading }}
23
28
  </p>
24
- <c-tag v-if="items.tag" label="Active" class="ml-2.5 relative bottom-0.5"></c-tag>
29
+ <c-tag v-if="items.tag" :label="tagLabel" class="relative bottom-0.5 ml-2.5"></c-tag>
25
30
  </div>
26
31
  <p class="text-sm text-gray-500">{{ items.description }}</p>
27
32
  <div v-if="showSection" class="mt-3">
@@ -38,7 +43,7 @@
38
43
  <button
39
44
  v-if="items.listIcon"
40
45
  type="button"
41
- class="rounded-full h-8 w-8 flex items-center justify-center text-gray-500 hover:bg-red-100 hover:text-red-800 focus:outline-none focus:ring-2 focus:ring-red-500"
46
+ class="focus:outline-none flex h-8 w-8 items-center justify-center rounded-full text-gray-500 hover:bg-red-100 hover:text-red-800 focus:ring-2 focus:ring-red-500"
42
47
  >
43
48
  <c-icon name="trash" type="solid" class="h-5 w-5 hover:text-red-800"></c-icon>
44
49
  </button>
@@ -397,9 +397,9 @@ export default {
397
397
  isLoading() {
398
398
  this.showLoader = this.isLoading;
399
399
  },
400
- paginationData() {
401
- if (!isEqual(this.paginationRecords, this.paginationData)) {
402
- this.paginationRecords = this.paginationData;
400
+ paginationData(newValue, oldValue) {
401
+ if (!isEqual(newValue, oldValue)) {
402
+ this.paginationRecords = newValue;
403
403
  }
404
404
  },
405
405
  },
@@ -1,12 +1,12 @@
1
- import CStackedList from '../components/CStackedList/CStackedList.vue';
2
- import './utils.css'
1
+ import CStackedList from "../components/CStackedList/CStackedList.vue";
2
+ import "./utils.css";
3
3
 
4
4
  export default {
5
- title: 'CStackedList',
5
+ title: "CStackedList",
6
6
  component: CStackedList,
7
7
  argTypes: {
8
8
  listItems: { control: { type: "object" } },
9
- divider: Boolean
9
+ divider: Boolean,
10
10
  },
11
11
  };
12
12
 
@@ -18,8 +18,19 @@ const Template = (args, { argTypes }) => ({
18
18
 
19
19
  export const Default = Template.bind({});
20
20
  Default.args = {
21
- listItems: [
22
- { image: "https://images.unsplash.com/photo-1491528323818-fdd1faba62cc?ixlib=rb-1.2.1&amp;ixid=eyJhcHBfaWQiOjEyMDd9&amp;auto=format&amp;fit=facearea&amp;facepad=2&amp;w=256&amp;h=256&amp;q=80", heading: "Maths-Level1", description: "calvin.hawkins@example.com", size:"medium", rounded:false, tag:false, collapse:false, listIcon: true },
23
- ],
24
- divider: true
21
+ listItems: [
22
+ {
23
+ image:
24
+ "https://images.unsplash.com/photo-1491528323818-fdd1faba62cc?ixlib=rb-1.2.1&amp;ixid=eyJhcHBfaWQiOjEyMDd9&amp;auto=format&amp;fit=facearea&amp;facepad=2&amp;w=256&amp;h=256&amp;q=80",
25
+ heading: "Maths-Level1",
26
+ tagLabel: "test",
27
+ description: "calvin.hawkins@example.com",
28
+ size: "medium",
29
+ rounded: false,
30
+ tag: false,
31
+ collapse: false,
32
+ listIcon: true,
33
+ },
34
+ ],
35
+ divider: true,
25
36
  };