classcard-ui 0.2.666 → 0.2.671

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.
Files changed (174) hide show
  1. package/dist/classcard-ui.common.js +69 -81
  2. package/dist/classcard-ui.common.js.map +1 -1
  3. package/dist/classcard-ui.umd.js +69 -81
  4. package/dist/classcard-ui.umd.js.map +1 -1
  5. package/dist/classcard-ui.umd.min.js +1 -1
  6. package/dist/classcard-ui.umd.min.js.map +1 -1
  7. package/package.json +6 -7
  8. package/src/App.vue +0 -16
  9. package/src/components/CAlerts/CAlerts.vue +0 -70
  10. package/src/components/CAlerts/index.js +0 -3
  11. package/src/components/CAnchorTabs/CAnchorTabs.vue +0 -96
  12. package/src/components/CAnchorTabs/index.js +0 -3
  13. package/src/components/CAnchorTag/CAnchorTag.vue +0 -62
  14. package/src/components/CAnchorTag/index.js +0 -3
  15. package/src/components/CAvatar/CAvatar.vue +0 -112
  16. package/src/components/CAvatar/index.js +0 -3
  17. package/src/components/CAvatarGroup/CAvatarGroup.vue +0 -145
  18. package/src/components/CAvatarGroup/index.js +0 -3
  19. package/src/components/CBasicTable/CBasicTable.vue +0 -184
  20. package/src/components/CBasicTable/index.js +0 -3
  21. package/src/components/CBreadcrumbs/CBreadcrumbs.vue +0 -38
  22. package/src/components/CBreadcrumbs/index.js +0 -3
  23. package/src/components/CButton/CButton.vue +0 -147
  24. package/src/components/CButton/index.js +0 -3
  25. package/src/components/CButtonGroup/CButtonGroup.vue +0 -116
  26. package/src/components/CButtonGroup/index.js +0 -3
  27. package/src/components/CButtonIcon/CButtonIcon.vue +0 -91
  28. package/src/components/CButtonIcon/index.js +0 -3
  29. package/src/components/CButtonLink/CButtonLink.vue +0 -39
  30. package/src/components/CButtonLink/index.js +0 -3
  31. package/src/components/CButtonSelect/CButtonSelect.vue +0 -103
  32. package/src/components/CButtonSelect/index.js +0 -3
  33. package/src/components/CButtonWithDropdown/CButtonWithDropdown.vue +0 -168
  34. package/src/components/CButtonWithDropdown/index.js +0 -3
  35. package/src/components/CCalendar/CCalendar.vue +0 -401
  36. package/src/components/CCalendar/index.js +0 -3
  37. package/src/components/CCard/CCard.vue +0 -49
  38. package/src/components/CCard/index.js +0 -3
  39. package/src/components/CCheckbox/CCheckbox.vue +0 -70
  40. package/src/components/CCheckbox/index.js +0 -3
  41. package/src/components/CCollapsibleSection/CCollapsibleSection.vue +0 -99
  42. package/src/components/CCollapsibleSection/index.js +0 -3
  43. package/src/components/CColorDots/CColorDots.vue +0 -35
  44. package/src/components/CColorDots/index.js +0 -3
  45. package/src/components/CConfirmActionModal/CConfirmActionModal.vue +0 -120
  46. package/src/components/CConfirmActionModal/index.js +0 -3
  47. package/src/components/CDatepicker/CDatepicker.vue +0 -139
  48. package/src/components/CDatepicker/index.js +0 -3
  49. package/src/components/CDualSelect/CDualSelect.vue +0 -193
  50. package/src/components/CDualSelect/index.js +0 -3
  51. package/src/components/CEditor/CEditor.vue +0 -96
  52. package/src/components/CEditor/index.js +0 -3
  53. package/src/components/CFormSectionHeading/CFormSectionHeading.vue +0 -53
  54. package/src/components/CFormSectionHeading/index.js +0 -3
  55. package/src/components/CGroupedSelect/CGroupedSelect.vue +0 -217
  56. package/src/components/CGroupedSelect/index.js +0 -3
  57. package/src/components/CIcon/CIcon.vue +0 -77
  58. package/src/components/CIcon/index.js +0 -3
  59. package/src/components/CIconDropdown/CIconDropdown.vue +0 -111
  60. package/src/components/CIconDropdown/index.js +0 -3
  61. package/src/components/CInput/CInput.vue +0 -120
  62. package/src/components/CInput/index.js +0 -3
  63. package/src/components/CInputAddon/CInputAddon.vue +0 -202
  64. package/src/components/CInputAddon/index.js +0 -3
  65. package/src/components/CInputEmail/CInputEmail.vue +0 -93
  66. package/src/components/CInputEmail/index.js +0 -3
  67. package/src/components/CModalHeading/CModalHeading.vue +0 -22
  68. package/src/components/CModalHeading/index.js +0 -3
  69. package/src/components/CModuleHelpLinks/CModuleHelpLinks.vue +0 -39
  70. package/src/components/CModuleHelpLinks/index.js +0 -3
  71. package/src/components/CMultiselect/CMultiselect.vue +0 -333
  72. package/src/components/CMultiselect/index.js +0 -3
  73. package/src/components/CMultiselectr/CMultiselectr.vue +0 -44
  74. package/src/components/CMultiselectr/index.js +0 -3
  75. package/src/components/CPageHeading/CPageHeading.vue +0 -56
  76. package/src/components/CPageHeading/index.js +0 -3
  77. package/src/components/CPagination/CPagination.vue +0 -202
  78. package/src/components/CPagination/index.js +0 -3
  79. package/src/components/CPhoneNumber/CPhoneNumber.vue +0 -81
  80. package/src/components/CPhoneNumber/index.js +0 -3
  81. package/src/components/CRadio/CRadio.vue +0 -106
  82. package/src/components/CRadio/index.js +0 -3
  83. package/src/components/CRangeSlider/CRangeSlider.vue +0 -55
  84. package/src/components/CRangeSlider/index.js +0 -3
  85. package/src/components/CReorderableStackedList/CReorderableStackedList.vue +0 -94
  86. package/src/components/CReorderableStackedList/index.js +0 -3
  87. package/src/components/CSelect/CSelect.vue +0 -343
  88. package/src/components/CSelect/index.js +0 -3
  89. package/src/components/CSmallTimeline/CSmallTimeline.vue +0 -40
  90. package/src/components/CSmallTimeline/index.js +0 -3
  91. package/src/components/CStackedList/CStackedList.vue +0 -132
  92. package/src/components/CStackedList/index.js +0 -3
  93. package/src/components/CStats/CStats.vue +0 -111
  94. package/src/components/CStats/index.js +0 -3
  95. package/src/components/CSwitch/CSwitch.vue +0 -140
  96. package/src/components/CSwitch/index.js +0 -3
  97. package/src/components/CTable/CTable.vue +0 -536
  98. package/src/components/CTable/index.js +0 -3
  99. package/src/components/CTabs/CTabs.vue +0 -111
  100. package/src/components/CTabs/index.js +0 -3
  101. package/src/components/CTag/CTag.vue +0 -36
  102. package/src/components/CTag/index.js +0 -3
  103. package/src/components/CTextarea/CTextarea.vue +0 -95
  104. package/src/components/CTextarea/index.js +0 -3
  105. package/src/components/CTimeline/CTimeline.vue +0 -237
  106. package/src/components/CTimeline/index.js +0 -3
  107. package/src/components/CUpload/CUpload.vue +0 -231
  108. package/src/components/CUpload/index.js +0 -3
  109. package/src/components/index.js +0 -48
  110. package/src/icons.js +0 -275
  111. package/src/main.js +0 -22
  112. package/src/stories/CAlerts.stories.js +0 -37
  113. package/src/stories/CAnchorTabs.stories.js +0 -29
  114. package/src/stories/CAnchorTag.stories.js +0 -36
  115. package/src/stories/CAvatar.stories.js +0 -38
  116. package/src/stories/CAvatarGroup.stories.js +0 -100
  117. package/src/stories/CBasicTable.stories.js +0 -316
  118. package/src/stories/CBreadcrumbs.stories.js +0 -24
  119. package/src/stories/CButton.stories.js +0 -46
  120. package/src/stories/CButtonGroup.stories.js +0 -33
  121. package/src/stories/CButtonIcon.stories.js +0 -27
  122. package/src/stories/CButtonLink.stories.js +0 -24
  123. package/src/stories/CButtonSelect.stories.js +0 -32
  124. package/src/stories/CButtonWithDropdown.stories.js +0 -41
  125. package/src/stories/CCalendar.stories.js +0 -16
  126. package/src/stories/CCard.stories.js +0 -30
  127. package/src/stories/CCheckbox.stories.js +0 -29
  128. package/src/stories/CCollapsibleSection.stories.js +0 -28
  129. package/src/stories/CColorDots.stories.js +0 -28
  130. package/src/stories/CConfirmActionModal.stories.js +0 -59
  131. package/src/stories/CDatepicker.stories.js +0 -30
  132. package/src/stories/CDualSelect.stories.js +0 -29
  133. package/src/stories/CEditor.stories.js +0 -30
  134. package/src/stories/CFormSectionHeading.stories.js +0 -34
  135. package/src/stories/CGroupedSelect.stories.js +0 -69
  136. package/src/stories/CIcon.stories.js +0 -26
  137. package/src/stories/CIconDropdown.stories.js +0 -40
  138. package/src/stories/CInput.stories.js +0 -36
  139. package/src/stories/CInputAddon.stories.js +0 -37
  140. package/src/stories/CInputEmail.stories.js +0 -27
  141. package/src/stories/CModalHeading.stories.js +0 -25
  142. package/src/stories/CModuleHelpLinks.stories.js +0 -25
  143. package/src/stories/CMultiselect.stories.js +0 -97
  144. package/src/stories/CMultiselectr.stories.js +0 -23
  145. package/src/stories/CPageHeading.stories.js +0 -32
  146. package/src/stories/CPagination.stories.js +0 -30
  147. package/src/stories/CPhoneNumber.stories.js +0 -29
  148. package/src/stories/CRadio.stories.js +0 -36
  149. package/src/stories/CRangeSlider.stories.js +0 -23
  150. package/src/stories/CReorderableStackedList.stories.js +0 -23
  151. package/src/stories/CSelect.stories.js +0 -50
  152. package/src/stories/CSmallTimeline.stories.js +0 -26
  153. package/src/stories/CStackedList.stories.js +0 -37
  154. package/src/stories/CStats.stories.js +0 -33
  155. package/src/stories/CSwitch.stories.js +0 -28
  156. package/src/stories/CTable.stories.js +0 -77
  157. package/src/stories/CTabs.stories.js +0 -33
  158. package/src/stories/CTag.stories.js +0 -23
  159. package/src/stories/CTextarea.stories.js +0 -32
  160. package/src/stories/CTimeline.stories.js +0 -26
  161. package/src/stories/CUpload.stories.js +0 -36
  162. package/src/stories/Introduction.stories.mdx +0 -207
  163. package/src/stories/Page.vue +0 -88
  164. package/src/stories/assets/code-brackets.svg +0 -1
  165. package/src/stories/assets/colors.svg +0 -1
  166. package/src/stories/assets/comments.svg +0 -1
  167. package/src/stories/assets/direction.svg +0 -1
  168. package/src/stories/assets/flow.svg +0 -1
  169. package/src/stories/assets/plugin.svg +0 -1
  170. package/src/stories/assets/repo.svg +0 -1
  171. package/src/stories/assets/stackalt.svg +0 -1
  172. package/src/stories/header.css +0 -26
  173. package/src/stories/page.css +0 -69
  174. package/src/stories/utils.css +0 -18
@@ -1,333 +0,0 @@
1
- <template>
2
- <div>
3
- <div class="flex w-full items-center justify-between" v-if="label">
4
- <div class="flex items-center">
5
- <!-- label of multiselect field -->
6
- <label v-if="label" class="text-sm font-medium text-gray-900">{{ label }}</label>
7
- <!-- asterisk sign to render if field is required -->
8
- <p v-if="isRequired" class="ml-1 text-red-600">*</p>
9
- </div>
10
- <span v-if="hint" class="text-sm text-gray-500">{{ hint }}</span>
11
- </div>
12
- <v-select
13
- class="disabled-opacity-50 disabled-pointer-events-none disabled-cursor-default mt-1 text-sm"
14
- :placeholder="placeholder"
15
- :multiple="isMultiple"
16
- :taggable="isTaggable"
17
- :push-tags="pushTags"
18
- :filterable="filterable"
19
- v-model="value"
20
- :options="options"
21
- @input="setSelectedOptions"
22
- @search="fetchOptions"
23
- @search:focus="$emit('search:focus')"
24
- :label="optionLabel"
25
- :clearable="clearable"
26
- :loading="loading"
27
- @open="onOpen"
28
- @close="onClose"
29
- :disabled="isDisabled"
30
- >
31
- <template #open-indicator="{ attributes }">
32
- <span v-bind="attributes">
33
- <svg
34
- xmlns="http://www.w3.org/2000/svg"
35
- class="h-5 w-5 cursor-pointer text-gray-400"
36
- viewBox="0 0 20 20"
37
- fill="currentColor"
38
- >
39
- <path
40
- fill-rule="evenodd"
41
- d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
42
- clip-rule="evenodd"
43
- />
44
- </svg>
45
- </span>
46
- </template>
47
- <!-- eslint-disable-next-line vue/no-unused-vars -->
48
- <template #no-options="{ search, searching, loading }">
49
- <span v-if="search.length < 1">Start typing to search for options...</span>
50
- <span v-else>No options found, try searching something else.</span>
51
- </template>
52
- <template #spinner="{ loading }">
53
- <svg
54
- class="h-5 w-5 animate-spin text-gray-400"
55
- xmlns="http://www.w3.org/2000/svg"
56
- fill="none"
57
- viewBox="0 0 24 24"
58
- v-if="loading"
59
- >
60
- <circle
61
- class="opacity-25"
62
- cx="12"
63
- cy="12"
64
- r="10"
65
- stroke="currentColor"
66
- stroke-width="4"
67
- ></circle>
68
- <path
69
- class="opacity-75"
70
- fill="currentColor"
71
- d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
72
- ></path>
73
- </svg>
74
- </template>
75
- <template slot="option" slot-scope="option">
76
- <slot name="custom-option" v-bind:option="option"></slot>
77
- </template>
78
- <template v-if="showOptionImage" v-slot:option="option">
79
- <div :class="`flex w-full ${option.description ? 'items-start' : 'items-center'}`">
80
- <c-avatar
81
- v-if="option.image"
82
- size="extraextrasmall"
83
- :image="option.image"
84
- :rounded="true"
85
- :description="option.description"
86
- class="mr-2"
87
- ></c-avatar>
88
- <c-avatar
89
- v-else
90
- size="extraextrasmall"
91
- :nameInitials="option.initials"
92
- :description="option.description"
93
- :rounded="true"
94
- class="mr-2"
95
- ></c-avatar>
96
- <div class="w-full">
97
- <p>{{ option[optionLabel] }}</p>
98
- <p class="text-xs" v-if="option.description">
99
- {{ option.description }}
100
- </p>
101
- </div>
102
- </div>
103
- </template>
104
- <template #list-footer>
105
- <li ref="load" class="loader" v-show="hasNextPage">Loading more options...</li>
106
- <li
107
- v-if="showFooterButton"
108
- class="group sticky bottom-0 mt-1 cursor-pointer select-none bg-gray-50 py-2 pl-3 pr-9 text-gray-700 hover:bg-gray-100 hover:text-gray-900"
109
- id="listbox-option-0"
110
- role="option"
111
- @click="$emit('footerButtonClick')"
112
- >
113
- <div class="flex items-center">
114
- <svg
115
- xmlns="http://www.w3.org/2000/svg"
116
- class="h-6 w-6 flex-shrink-0 text-gray-400"
117
- viewBox="0 0 20 20"
118
- fill="currentColor"
119
- >
120
- <path
121
- fill-rule="evenodd"
122
- d="M10 18a8 8 0 100-16 8 8 0 000 16zm1-11a1 1 0 10-2 0v2H7a1 1 0 100 2h2v2a1 1 0 102 0v-2h2a1 1 0 100-2h-2V7z"
123
- clip-rule="evenodd"
124
- />
125
- </svg>
126
- <span class="ml-3 block truncate font-semibold">
127
- {{ footerButtonText }}
128
- </span>
129
- </div>
130
- </li>
131
- </template>
132
- </v-select>
133
-
134
- <p v-if="subLabel" class="mt-1 text-sm text-gray-500">{{ subLabel }}</p>
135
- <p v-if="!isValidate" class="mt-1 text-sm text-red-600">
136
- {{ errorMessage }}
137
- </p>
138
- </div>
139
- </template>
140
- <script>
141
- import vSelect from "vue-select";
142
- import CAvatar from "../CAvatar/CAvatar.vue";
143
- import { debounce } from "lodash-es";
144
- // import Fuse from "fuse.js";
145
- import "vue-select/dist/vue-select.css";
146
- export default {
147
- name: "CMultiselect",
148
- components: { vSelect, CAvatar },
149
- props: {
150
- options: {
151
- type: Array,
152
- required: true,
153
- },
154
- showFooterButton: {
155
- type: Boolean,
156
- default: false,
157
- },
158
- footerButtonText: {
159
- type: String,
160
- default: "",
161
- },
162
- label: String,
163
- isRequired: {
164
- type: Boolean,
165
- },
166
- subLabel: String,
167
- placeholder: {
168
- type: String,
169
- default: "Start typing... (min 2 characters) to search options",
170
- },
171
- // whether multiple fields are allowed or not
172
- isMultiple: {
173
- type: Boolean,
174
- },
175
- // append newly created tags in options
176
- pushTags: {
177
- type: Boolean,
178
- },
179
- // whether to allow user to create new options
180
- isTaggable: {
181
- type: Boolean,
182
- },
183
- getOptions: {
184
- // function to emit on search{
185
- type: Function,
186
- },
187
- customiseOption: {
188
- type: Boolean,
189
- },
190
- // whether to show profile picture in option
191
- showOptionImage: {
192
- type: Boolean,
193
- },
194
- // the name of the option to render in the selectpicker
195
- optionLabel: {
196
- type: String,
197
- },
198
- // action to trigger after selecting option from dropdown
199
- onSelectOptions: {
200
- type: Function,
201
- },
202
- optionsSelected: {
203
- type: [Array, Object],
204
- },
205
- filterable: {
206
- type: Boolean,
207
- default: false,
208
- },
209
- clearable: {
210
- type: Boolean,
211
- default: true,
212
- },
213
- isValidate: {
214
- type: Boolean,
215
- default: true,
216
- },
217
- errorMessage: {
218
- type: String,
219
- },
220
- loading: {
221
- type: Boolean,
222
- default: false,
223
- },
224
- hasNextPage: {
225
- type: Boolean,
226
- default: false,
227
- },
228
- isDisabled: {
229
- type: Boolean,
230
- default: false,
231
- },
232
- // text adjacent to label of dropdown to provide hint about field
233
- hint: { type: String },
234
- },
235
- computed: {},
236
- data() {
237
- return {
238
- loaderSearching: true,
239
- value: this.optionsSelected && this.optionsSelected.length ? this.optionsSelected : [],
240
- observer: null,
241
- };
242
- },
243
- methods: {
244
- fetchOptions(search, loaderSearching) {
245
- this.emitGetOptions(search, loaderSearching);
246
- },
247
- emitGetOptions: debounce(function (search, loaderSearching) {
248
- this.$emit("getOptions", search, loaderSearching);
249
- }, 300),
250
- setSelectedOptions(params) {
251
- this.value = params;
252
- this.$emit("onSelectOptions", params);
253
- },
254
- async onOpen() {
255
- if (this.hasNextPage) {
256
- await this.$nextTick();
257
- if (this.$refs?.load && this.observer) {
258
- this.observer.observe(this.$refs.load);
259
- } else {
260
- setTimeout(() => {
261
- this.onOpen();
262
- }, 500);
263
- }
264
- }
265
- this.emitGetOptions("", true);
266
- },
267
- onClose() {
268
- this.observer.disconnect();
269
- },
270
- async infiniteScroll([{ isIntersecting }]) {
271
- if (isIntersecting) {
272
- this.emitLoadNextPage();
273
- }
274
- },
275
- emitLoadNextPage: debounce(function () {
276
- this.$emit("loadNextPage");
277
- }, 300),
278
- },
279
- watch: {
280
- optionsSelected() {
281
- this.value = this.optionsSelected;
282
- },
283
- },
284
- mounted() {
285
- this.observer = new IntersectionObserver(this.infiniteScroll);
286
- },
287
- };
288
- </script>
289
- <style>
290
- .v-select {
291
- @apply cursor-pointer;
292
- }
293
- .vs__dropdown-toggle {
294
- @apply focus:outline-none w-full rounded-md border border-gray-300 bg-white pl-3 text-left shadow-sm focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 sm:text-sm;
295
- padding-top: 0.4rem;
296
- padding-bottom: 0.4rem;
297
- }
298
- .vs__selected-options {
299
- @apply flex-wrap overflow-hidden;
300
- }
301
- .vs--open .vs__dropdown-toggle {
302
- border-bottom-color: rgba(212, 212, 216, var(--tw-border-opacity));
303
- @apply rounded-b-md;
304
- }
305
- .vs__selected {
306
- @apply m-0 mr-1 border-none py-0 pl-1.5 pr-1.5;
307
- margin-bottom: 2px;
308
- }
309
- .vs__selected-options {
310
- @apply pl-0;
311
- padding-top: 0.5px;
312
- padding-bottom: 1px;
313
- }
314
- .vs__search,
315
- .vs__search:focus {
316
- @apply m-0 p-0;
317
- }
318
- .vs__actions {
319
- @apply pt-0 pr-3;
320
- }
321
- .vs__dropdown-menu {
322
- @apply focus:outline-none mt-2 max-h-60 overflow-auto rounded-md bg-white py-0 text-base shadow-lg ring-1 ring-opacity-5 sm:text-sm;
323
- }
324
- .vs__dropdown-option {
325
- @apply py-2;
326
- }
327
- .vs__dropdown-toggle.vs__dropdown-option--highlight {
328
- @apply bg-indigo-700 text-white;
329
- }
330
- .vs__dropdown-option--highlight {
331
- @apply bg-indigo-700 text-white;
332
- }
333
- </style>
@@ -1,3 +0,0 @@
1
- import CMultiselect from './CMultiselect.vue'
2
-
3
- export default CMultiselect
@@ -1,44 +0,0 @@
1
- <template>
2
- <div>
3
- <!-- <label class="text-sm text-gray-900">{{label}}</label>
4
- <multiselect class="mt-1" v-model="value" :options="options" :multiple="true">
5
- </multiselect> -->
6
- </div>
7
- </template>
8
- <script>
9
-
10
- export default {
11
- // name: "CMultiselect",
12
- // components: { Multiselect },
13
- // props: {
14
- // options: {
15
- // type: Array,
16
- // required: true,
17
- // },
18
- // label:String
19
- // },
20
- // computed: {},
21
- // data() {
22
- // return {
23
- // value: [],
24
- // };
25
- // },
26
- };
27
- </script>
28
- <style src="vue-multiselect/dist/vue-multiselect.min.css"></style>
29
- <style>
30
- .multiselect__tags {
31
- border: 1px solid #d1d5db;
32
- }
33
- .multiselect__placeholder {
34
- color: #111827;
35
- }
36
- .multiselect__tag,
37
- .multiselect__tag-icon:after,
38
- .multiselect__tag-icon:hover,
39
- .multiselect__option--highlight,
40
- .multiselect__option--highlight::after {
41
- background: #0369A1;
42
- color: #fff;
43
- }
44
- </style>
@@ -1,3 +0,0 @@
1
- import CMultiselect from './CMultiselect.vue'
2
-
3
- export default CMultiselect
@@ -1,56 +0,0 @@
1
- <template>
2
- <div class="sticky top-0 z-10 -mx-16 bg-transparent px-16 backdrop-blur-xl">
3
- <div
4
- class="flex flex-col items-start justify-between pt-4 pb-2 sm:max-w-full sm:flex-row sm:items-center sm:pb-1"
5
- >
6
- <div>
7
- <h2
8
- class="mt-1 text-xl font-bold leading-7 text-gray-900 sm:mt-0 sm:truncate sm:text-xl"
9
- >
10
- {{ title }}
11
- </h2>
12
- </div>
13
- <div class="justify-self-end">
14
- <slot></slot>
15
- <div v-if="buttonType" class="mt-5 flex sm:mt-0 lg:mt-0 lg:ml-4">
16
- <span class="sm:ml-3">
17
- <c-button
18
- :label="buttonType.label"
19
- :icon="buttonType.icon"
20
- :type="buttonType.type"
21
- @action="emitAction"
22
- ></c-button>
23
- </span>
24
- </div>
25
- </div>
26
- </div>
27
- </div>
28
- </template>
29
-
30
- <script>
31
- import CButton from "../CButton/CButton.vue";
32
- export default {
33
- name: "CPageHeading",
34
- components: { CButton },
35
- props: {
36
- title: {
37
- type: String,
38
- required: true,
39
- },
40
- description: { type: String },
41
- helpVideo: {
42
- type: String,
43
- },
44
- helpArticle: { type: String },
45
- buttonType: { type: Object },
46
- callAction: {
47
- type: Function,
48
- },
49
- },
50
- methods: {
51
- emitAction() {
52
- this.$emit("callAction");
53
- },
54
- },
55
- };
56
- </script>
@@ -1,3 +0,0 @@
1
- import CPageHeading from './CPageHeading.vue'
2
-
3
- export default CPageHeading
@@ -1,202 +0,0 @@
1
- <template>
2
- <div
3
- class="flex items-center justify-between border-gray-200 bg-white px-4 py-3 sm:px-6"
4
- >
5
- <div class="flex flex-1 justify-between sm:hidden">
6
- <a
7
- href="#"
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
- >
10
- Previous
11
- </a>
12
- <a
13
- href="#"
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
- >
16
- Next
17
- </a>
18
- </div>
19
- <div class="hidden sm:flex sm:flex-1 sm:items-center sm:justify-between">
20
- <div>
21
- <p class="text-sm text-gray-700">
22
- Showing
23
- <span class="font-medium">{{ setPaginationRecords.from }}</span>
24
- to
25
- <span class="font-medium">{{ setPaginationRecords.to }}</span>
26
- of
27
- <span class="font-medium">{{
28
- setPaginationRecords.totalRecords
29
- }}</span>
30
- results
31
- </p>
32
- </div>
33
- <div>
34
- <nav
35
- class="relative z-0 inline-flex -space-x-px rounded-md shadow-sm"
36
- aria-label="Pagination"
37
- >
38
- <div class="hidden md:-mt-px md:flex">
39
- <div
40
- href="#"
41
- @click="currentPageNumber == '1' ? '' : goToPreviousPage()"
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"
43
- :class="
44
- currentPageNumber == '1'
45
- ? 'pointer-events-none text-gray-400'
46
- : 'group cursor-pointer text-gray-500 hover:text-gray-700'
47
- "
48
- >
49
- <span class="sr-only">Previous</span>
50
- <!-- Heroicon name: solid/chevron-left -->
51
- <svg
52
- class="h-5 w-5"
53
- xmlns="http://www.w3.org/2000/svg"
54
- viewBox="0 0 20 20"
55
- fill="currentColor"
56
- aria-hidden="true"
57
- >
58
- <path
59
- fill-rule="evenodd"
60
- d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z"
61
- clip-rule="evenodd"
62
- />
63
- </svg>
64
- </div>
65
- <div
66
- v-for="page in pageRange"
67
- :key="page"
68
- class="cursor-pointer"
69
- :class="[
70
- page == currentPageNumber
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'
72
- : '',
73
- page === '...'
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'
75
- : '',
76
- page !== currentPageNumber && page !== '...'
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'
78
- : '',
79
- page == currentPageNumber + 1 ? 'border-l-0' : '',
80
- ]"
81
- @click="changePage(page)"
82
- >
83
- <div v-if="page === '...'">...</div>
84
- <div v-else>
85
- {{ page }}
86
- </div>
87
- </div>
88
- <div
89
- href="#"
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
- @click="currentPageNumber == lastPageNumber ? '' : goToNextPage()"
92
- :class="
93
- currentPageNumber == lastPageNumber
94
- ? 'pointer-events-none text-gray-400'
95
- : 'group cursor-pointer text-gray-500 hover:text-gray-700'
96
- "
97
- >
98
- <span class="sr-only">Next</span>
99
- <!-- Heroicon name: solid/chevron-right -->
100
- <svg
101
- class="h-5 w-5"
102
- xmlns="http://www.w3.org/2000/svg"
103
- viewBox="0 0 20 20"
104
- fill="currentColor"
105
- aria-hidden="true"
106
- >
107
- <path
108
- fill-rule="evenodd"
109
- d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
110
- clip-rule="evenodd"
111
- />
112
- </svg>
113
- </div>
114
- </div>
115
- </nav>
116
- </div>
117
- </div>
118
- </div>
119
- </template>
120
- <script>
121
- import { isEqual } from "lodash-es";
122
-
123
- export default {
124
- name: "CPagination",
125
- props: {
126
- setPaginationRecords: {
127
- type: Object,
128
- },
129
- setCurrentPage: {
130
- type: Function,
131
- },
132
- setPreviousPage: {
133
- type: Function,
134
- },
135
- setNextPage: {
136
- type: Function,
137
- },
138
- },
139
- components: {},
140
- data() {
141
- return {
142
- currentPageNumber: this.setPaginationRecords.currentPage,
143
- lastPageNumber: this.setPaginationRecords.lastPage,
144
- };
145
- },
146
- computed: {
147
- pageRange() {
148
- var current = this.setPaginationRecords.currentPage,
149
- last = this.setPaginationRecords.lastPage,
150
- delta = 2,
151
- left = current - delta,
152
- right = current + delta + 1,
153
- range = [],
154
- rangeWithDots = [],
155
- l;
156
- for (let i = 1; i <= last; i++) {
157
- if (i == 1 || i == last || (i >= left && i < right)) {
158
- range.push(i);
159
- }
160
- }
161
- for (let i of range) {
162
- if (l) {
163
- if (i - l === 2) {
164
- rangeWithDots.push(l + 1);
165
- } else if (i - l !== 1) {
166
- rangeWithDots.push("...");
167
- }
168
- }
169
- rangeWithDots.push(i);
170
- l = i;
171
- }
172
- return rangeWithDots;
173
- },
174
- },
175
- methods: {
176
- changePage(page) {
177
- if (page !== "...") {
178
- this.$emit("setCurrentPage", page);
179
- this.currentPageNumber = page;
180
- }
181
- },
182
- goToPreviousPage() {
183
- var previousPage = this.currentPageNumber - 1;
184
- this.currentPageNumber = previousPage;
185
- this.$emit("setPreviousPage", previousPage);
186
- },
187
- goToNextPage() {
188
- var nextPage = this.currentPageNumber + 1;
189
- this.currentPageNumber = nextPage;
190
- this.$emit("setNextPage", nextPage);
191
- },
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
- },
201
- };
202
- </script>
@@ -1,3 +0,0 @@
1
- import CPagination from './CPagination.vue'
2
-
3
- export default CPagination