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,95 +0,0 @@
1
- <template>
2
- <div>
3
- <div class="flex justify-between">
4
- <div class="flex items-center">
5
- <!-- label of input field -->
6
- <label v-if="label" class="block text-sm font-medium text-gray-900">
7
- {{ label }}
8
- </label>
9
- <!-- asterisk sign to render if field is required -->
10
- <p v-if="isRequired" class="ml-1 text-red-600">*</p>
11
- </div>
12
-
13
- <span v-if="hint" class="text-sm text-gray-500">{{ hint }}</span>
14
- </div>
15
-
16
- <div class="mt-1">
17
- <textarea
18
- :value="textareaValue"
19
- @input="$emit('input', $event.target.value)"
20
- @blur="$emit('blur', $event.target.value)"
21
- :placeholder="placeholder"
22
- :rows="rows"
23
- :class="errorClasses"
24
- :disabled="disabled"
25
- class="block w-full rounded-md text-gray-900 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 disabled:opacity-50 sm:text-sm"
26
- ></textarea>
27
- <!-- <div
28
- v-if="!isValidate"
29
- class="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-red-600"
30
- >
31
- <c-icon name="exclamation-circle" type="solid" class="h-5 w-5"></c-icon>
32
- </div> -->
33
- </div>
34
- <p v-if="!isValidate" class="mt-2 text-sm text-red-600">
35
- {{ errorMessage }}
36
- </p>
37
- <p v-if="helpText && isValidate == true" class="mt-2 text-sm text-gray-500">
38
- {{ helpText }}
39
- </p>
40
- </div>
41
- </template>
42
- <script>
43
- // import CIcon from "../CIcon/CIcon.vue";
44
- export default {
45
- name: "CTextarea",
46
- // components: { CIcon },
47
- props: {
48
- label: {
49
- type: String,
50
- },
51
- placeholder: {
52
- type: String,
53
- },
54
- value: {
55
- type: String,
56
- },
57
- rows: { type: String, default: "3" },
58
- helpText: {
59
- type: String,
60
- },
61
- hint: { type: String },
62
- isValidate: { type: Boolean },
63
- errorMessage: {
64
- type: String,
65
- },
66
- // whether the textarea field is mandatory or not
67
- isRequired: {
68
- type: Boolean,
69
- },
70
- disabled: {
71
- type: Boolean,
72
- default: false,
73
- },
74
- },
75
- computed: {
76
- errorClasses() {
77
- return {
78
- "border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500":
79
- this.isValidate == false,
80
- "border-gray-300": this.isValidate == true,
81
- };
82
- },
83
- },
84
- data() {
85
- return {
86
- textareaValue: this.value,
87
- };
88
- },
89
- watch: {
90
- value() {
91
- this.textareaValue = this.value;
92
- },
93
- },
94
- };
95
- </script>
@@ -1,3 +0,0 @@
1
- import CTextarea from './CTextarea.vue'
2
-
3
- export default CTextarea
@@ -1,237 +0,0 @@
1
- <template>
2
- <div>
3
- <div class="flow-root">
4
- <ul class="-mb-8">
5
- <li>
6
- <div class="relative pb-8">
7
- <span
8
- class="absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200"
9
- aria-hidden="true"
10
- ></span>
11
- <div class="relative flex space-x-3">
12
- <div>
13
- <span :class="colorClasses"
14
- class="h-8 w-8 rounded-full flex items-center justify-center ring-8 ring-white"
15
- >
16
- <c-icon :name="icon" type="solid" class="h-5 w-5"></c-icon>
17
- </span>
18
- </div>
19
- <div class="min-w-0 flex-1 pt-1.5 flex justify-between space-x-4">
20
- <div>
21
- <p class="text-sm text-gray-500">
22
- Applied to
23
- <a href="#" class="font-medium text-gray-900"
24
- >Front End Developer</a
25
- >
26
- </p>
27
- </div>
28
- <div class="text-right text-sm whitespace-nowrap text-gray-500">
29
- <time datetime="2020-09-20">Sep 20</time>
30
- </div>
31
- </div>
32
- </div>
33
- </div>
34
- </li>
35
-
36
- <li>
37
- <div class="relative pb-8">
38
- <span
39
- class="absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200"
40
- aria-hidden="true"
41
- ></span>
42
- <div class="relative flex space-x-3">
43
- <div>
44
- <span
45
- class="h-8 w-8 rounded-full bg-blue-500 flex items-center justify-center ring-8 ring-white"
46
- >
47
- <!-- Heroicon name: thumb-up -->
48
- <svg
49
- class="h-5 w-5 text-white"
50
- xmlns="http://www.w3.org/2000/svg"
51
- viewBox="0 0 20 20"
52
- fill="currentColor"
53
- aria-hidden="true"
54
- >
55
- <path
56
- d="M2 10.5a1.5 1.5 0 113 0v6a1.5 1.5 0 01-3 0v-6zM6 10.333v5.43a2 2 0 001.106 1.79l.05.025A4 4 0 008.943 18h5.416a2 2 0 001.962-1.608l1.2-6A2 2 0 0015.56 8H12V4a2 2 0 00-2-2 1 1 0 00-1 1v.667a4 4 0 01-.8 2.4L6.8 7.933a4 4 0 00-.8 2.4z"
57
- />
58
- </svg>
59
- </span>
60
- </div>
61
- <div class="min-w-0 flex-1 pt-1.5 flex justify-between space-x-4">
62
- <div>
63
- <p class="text-sm text-gray-500">
64
- Advanced to phone screening by
65
- <a href="#" class="font-medium text-gray-900"
66
- >Bethany Blake</a
67
- >
68
- </p>
69
- </div>
70
- <div class="text-right text-sm whitespace-nowrap text-gray-500">
71
- <time datetime="2020-09-22">Sep 22</time>
72
- </div>
73
- </div>
74
- </div>
75
- </div>
76
- </li>
77
-
78
- <li>
79
- <div class="relative pb-8">
80
- <span
81
- class="absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200"
82
- aria-hidden="true"
83
- ></span>
84
- <div class="relative flex space-x-3">
85
- <div>
86
- <span
87
- class="h-8 w-8 rounded-full bg-green-500 flex items-center justify-center ring-8 ring-white"
88
- >
89
- <!-- Heroicon name: check -->
90
- <svg
91
- class="h-5 w-5 text-white"
92
- xmlns="http://www.w3.org/2000/svg"
93
- viewBox="0 0 20 20"
94
- fill="currentColor"
95
- aria-hidden="true"
96
- >
97
- <path
98
- fill-rule="evenodd"
99
- d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"
100
- clip-rule="evenodd"
101
- />
102
- </svg>
103
- </span>
104
- </div>
105
- <div class="min-w-0 flex-1 pt-1.5 flex justify-between space-x-4">
106
- <div>
107
- <p class="text-sm text-gray-500">
108
- Completed phone screening with
109
- <a href="#" class="font-medium text-gray-900"
110
- >Martha Gardner</a
111
- >
112
- </p>
113
- </div>
114
- <div class="text-right text-sm whitespace-nowrap text-gray-500">
115
- <time datetime="2020-09-28">Sep 28</time>
116
- </div>
117
- </div>
118
- </div>
119
- </div>
120
- </li>
121
-
122
- <li>
123
- <div class="relative pb-8">
124
- <span
125
- class="absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200"
126
- aria-hidden="true"
127
- ></span>
128
- <div class="relative flex space-x-3">
129
- <div>
130
- <span
131
- class="h-8 w-8 rounded-full bg-blue-500 flex items-center justify-center ring-8 ring-white"
132
- >
133
- <!-- Heroicon name: thumb-up -->
134
- <svg
135
- class="h-5 w-5 text-white"
136
- xmlns="http://www.w3.org/2000/svg"
137
- viewBox="0 0 20 20"
138
- fill="currentColor"
139
- aria-hidden="true"
140
- >
141
- <path
142
- d="M2 10.5a1.5 1.5 0 113 0v6a1.5 1.5 0 01-3 0v-6zM6 10.333v5.43a2 2 0 001.106 1.79l.05.025A4 4 0 008.943 18h5.416a2 2 0 001.962-1.608l1.2-6A2 2 0 0015.56 8H12V4a2 2 0 00-2-2 1 1 0 00-1 1v.667a4 4 0 01-.8 2.4L6.8 7.933a4 4 0 00-.8 2.4z"
143
- />
144
- </svg>
145
- </span>
146
- </div>
147
- <div class="min-w-0 flex-1 pt-1.5 flex justify-between space-x-4">
148
- <div>
149
- <p class="text-sm text-gray-500">
150
- Advanced to interview by
151
- <a href="#" class="font-medium text-gray-900"
152
- >Bethany Blake</a
153
- >
154
- </p>
155
- </div>
156
- <div class="text-right text-sm whitespace-nowrap text-gray-500">
157
- <time datetime="2020-09-30">Sep 30</time>
158
- </div>
159
- </div>
160
- </div>
161
- </div>
162
- </li>
163
-
164
- <li>
165
- <div class="relative pb-8">
166
- <div class="relative flex space-x-3">
167
- <div>
168
- <span
169
- class="h-8 w-8 rounded-full bg-green-500 flex items-center justify-center ring-8 ring-white"
170
- >
171
- <!-- Heroicon name: check -->
172
- <svg
173
- class="h-5 w-5 text-white"
174
- xmlns="http://www.w3.org/2000/svg"
175
- viewBox="0 0 20 20"
176
- fill="currentColor"
177
- aria-hidden="true"
178
- >
179
- <path
180
- fill-rule="evenodd"
181
- d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"
182
- clip-rule="evenodd"
183
- />
184
- </svg>
185
- </span>
186
- </div>
187
- <div class="min-w-0 flex-1 pt-1.5 flex justify-between space-x-4">
188
- <div>
189
- <p class="text-sm text-gray-500">
190
- Completed interview with
191
- <a href="#" class="font-medium text-gray-900"
192
- >Katherine Snyder</a
193
- >
194
- </p>
195
- </div>
196
- <div class="text-right text-sm whitespace-nowrap text-gray-500">
197
- <time datetime="2020-10-04">Oct 4</time>
198
- </div>
199
- </div>
200
- </div>
201
- </div>
202
- </li>
203
- </ul>
204
- </div>
205
- </div>
206
- </template>
207
-
208
- <script>
209
- import CIcon from "../CIcon/CIcon.vue";
210
- export default {
211
- name: "CTimeline",
212
- components: { CIcon },
213
- props: {
214
- statsCount: {
215
- type: Array,
216
- },
217
- color: {
218
- type: String,
219
- },
220
- icon:{
221
- type: String
222
- }
223
- },
224
- computed: {
225
- colorClasses() {
226
- return {
227
- "bg-red-200 text-red-800": this.color == "red",
228
- "bg-yellow-100 text-yellow-800": this.color == "yellow",
229
- "bg-green-100 text-green-800": this.color == "green",
230
- "bg-indigo-100 text-indigo-800": this.color == "indigo"
231
- };
232
- },
233
- },
234
- };
235
- </script>
236
-
237
- <style></style>
@@ -1,3 +0,0 @@
1
- import CTimeline from './CTimeline.vue'
2
-
3
- export default CTimeline
@@ -1,231 +0,0 @@
1
- <template>
2
- <div class="flex h-full flex-col">
3
- <div class="flex items-center justify-between">
4
- <div class="flex items-center">
5
- <!-- label of input field -->
6
- <label class="block 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
- <label v-if="!isUploaded" class="block text-sm font-medium text-gray-400">
11
- {{ hint }}
12
- </label>
13
- </div>
14
- <button
15
- type="button"
16
- class="inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
17
- @click="initFilestack()"
18
- v-if="displayMode == 'overlay' && icon"
19
- >
20
- <c-icon
21
- :type="icon.type"
22
- :class="icon.class"
23
- :name="icon.name"
24
- :viewBox="icon.viewBox"
25
- ></c-icon>
26
- {{ buttonText }}
27
- </button>
28
- <button
29
- type="button"
30
- class="mt-1.5 flex h-full w-auto items-center justify-center rounded-lg border-2 border-dashed border-gray-300 px-9 py-14 text-center hover:border-gray-400 focus:outline-none"
31
- @click="initFilestack()"
32
- v-if="displayMode == 'overlay' && !icon && !isAvatar"
33
- >
34
- <c-icon
35
- name="arrow-up"
36
- type="solid"
37
- class="mr-1 h-5 w-5 flex-none text-indigo-600"
38
- viewBox="0 0 20 20"
39
- ></c-icon>
40
- <span class="text-sm font-medium text-indigo-900"> Upload </span>
41
- </button>
42
- <div
43
- class="relative hidden h-full w-full overflow-hidden rounded-full lg:block"
44
- @click="initFilestack()"
45
- v-if="displayMode == 'overlay' && !icon && isAvatar"
46
- >
47
- <img
48
- v-if="imageUrl"
49
- class="relative h-full w-full rounded-full object-cover"
50
- :src="imageUrl"
51
- />
52
- <c-avatar
53
- v-else
54
- size="very large"
55
- :nameInitials="shortName"
56
- :isDynamicallyColored="coloredAvatars"
57
- :rounded="true"
58
- ></c-avatar>
59
- <label
60
- class="absolute inset-0 flex h-full w-full cursor-pointer items-center justify-center bg-gray-900 bg-opacity-75 text-sm font-medium text-white opacity-0 focus-within:opacity-100 hover:opacity-100"
61
- >
62
- <c-icon
63
- v-if="openIcon"
64
- :name="openIcon.name"
65
- :type="openIcon.type"
66
- :class="openIcon.class"
67
- ></c-icon>
68
- <span>{{ uploadText }}</span>
69
- <span class="sr-only"> user photo</span>
70
- </label>
71
- </div>
72
- <div :class="filestackClasses" id="filestack-uploader"></div>
73
- <p v-if="!isValidate" class="mt-2 text-sm text-red-600">
74
- {{ errorMessage }}
75
- </p>
76
- <!-- description about the input field -->
77
- <p v-if="helpText && isValidate == true" class="mt-2 text-sm text-gray-500">
78
- {{ helpText }}
79
- </p>
80
- </div>
81
- </template>
82
-
83
- <script>
84
- import * as filestack from "filestack-js";
85
- import CIcon from "../CIcon/CIcon.vue";
86
- import CAvatar from "../CAvatar/CAvatar.vue";
87
-
88
- export default {
89
- name: "CUpload",
90
- components: {
91
- CIcon,
92
- CAvatar,
93
- },
94
- props: {
95
- buttonText: {
96
- type: String,
97
- default: "Upload",
98
- },
99
- isAvatar: {
100
- type: Boolean,
101
- default: false,
102
- },
103
- shortName: {
104
- type: String,
105
- },
106
- imageUrl: {
107
- type: String,
108
- default: "",
109
- },
110
- icon: {
111
- type: Object,
112
- },
113
- fileSize: {
114
- type: String,
115
- },
116
- openIcon: {
117
- type: Object,
118
- },
119
- uploadText: {
120
- type: String,
121
- default: "Change",
122
- },
123
- hint: {
124
- type: String,
125
- default: "",
126
- },
127
- helpText: {
128
- type: String,
129
- },
130
- label: {
131
- type: String,
132
- default: "",
133
- },
134
- isValidate: { type: Boolean },
135
- errorMessage: {
136
- type: String,
137
- },
138
- filestackApiKey: {
139
- type: String,
140
- default: "",
141
- },
142
- filestackClasses: {
143
- type: String,
144
- default: "w-96 h-96",
145
- },
146
- url: {
147
- type: String,
148
- },
149
- maxFiles: {
150
- type: Number,
151
- default: 1,
152
- },
153
- onUploadSuccess: {
154
- type: Function,
155
- },
156
- aspectRatio: {
157
- type: Number,
158
- default: null,
159
- },
160
- onUploadOpen: {
161
- type: Function,
162
- },
163
- displayMode: {
164
- type: String,
165
- default: "inline",
166
- },
167
- isUploaded: {
168
- type: Boolean,
169
- default: false,
170
- },
171
- isCircle: {
172
- type: Boolean,
173
- default: false,
174
- },
175
- coloredAvatars: {
176
- type: Boolean,
177
- default: false,
178
- },
179
- uploadSources: {
180
- type: Array,
181
- default: () => ["local_file_system", "unsplash"],
182
- },
183
- isRequired:{
184
- type:Boolean
185
- }
186
- },
187
- data() {
188
- return {};
189
- },
190
- methods: {
191
- initFilestack() {
192
- const client = filestack.init(this.filestackApiKey);
193
- const options = {
194
- displayMode: this.displayMode,
195
- container: "#filestack-uploader",
196
- uploadInBackground: false,
197
- maxFiles: this.maxFiles,
198
- onOpen: (param) => this.$emit("onUploadOpen", param),
199
- onClose: (param) => this.$emit("onUploadOpen", param),
200
- onUploadDone: (res) => this.$emit("filestack-uploaded", res),
201
- fromSources: this.uploadSources,
202
- transformations: {
203
- crop: {
204
- aspectRatio: this.aspectRatio ? this.aspectRatio : 0,
205
- force: this.aspectRatio ? true : false,
206
- },
207
- circle: this.isCircle,
208
- },
209
- };
210
- const picker = client.picker(options);
211
- picker.open();
212
- },
213
- },
214
- computed: {
215
- errorClasses() {
216
- return {
217
- "border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500":
218
- this.isValidate == false,
219
- "border-gray-300 border-dashed": this.isValidate == true,
220
- };
221
- },
222
- },
223
- mounted() {
224
- if (this.displayMode == "inline") {
225
- this.initFilestack();
226
- }
227
- },
228
- };
229
- </script>
230
-
231
- <style></style>
@@ -1,3 +0,0 @@
1
- import CUpload from './CUpload.vue'
2
-
3
- export default CUpload
@@ -1,48 +0,0 @@
1
- export { default as CAlerts } from "./CAlerts";
2
- export { default as CAnchorTabs } from "./CAnchorTabs";
3
- export { default as CAnchorTag } from "./CAnchorTag";
4
- export { default as CAvatar } from "./CAvatar";
5
- export { default as CAvatarGroup } from "./CAvatarGroup";
6
- export { default as CBasicTable } from "./CBasicTable";
7
- export { default as CBreadcrumbs } from "./CBreadcrumbs";
8
- export { default as CButton } from "./CButton";
9
- export { default as CButtonGroup } from "./CButtonGroup";
10
- export { default as CButtonIcon } from "./CButtonIcon";
11
- export { default as CButtonLink } from "./CButtonLink";
12
- export { default as CButtonSelect } from "./CButtonSelect";
13
- export { default as CButtonWithDropdown } from "./CButtonWithDropdown";
14
- export { default as CCard } from "./CCard";
15
- export { default as CCheckbox } from "./CCheckbox";
16
- export { default as CCollapsibleSection } from "./CCollapsibleSection";
17
- export { default as CColorDots } from "./CColorDots";
18
- export { default as CDatepicker } from "./CDatepicker";
19
- export { default as CDualSelect } from "./CEditor";
20
- export { default as CEditor } from "./CDualSelect";
21
- export { default as CFormSectionHeading } from "./CFormSectionHeading";
22
- export { default as CIcon } from "./CIcon";
23
- export { default as CGroupedSelect } from "./CGroupedSelect";
24
- export { default as CIconDropdown } from "./CIconDropdown";
25
- export { default as CInput } from "./CInput";
26
- export { default as CInputAddon } from "./CInputAddon";
27
- export { default as CInputEmail } from "./CInputEmail";
28
- export { default as CModalHeading } from "./CModalHeading";
29
- export { default as CModuleHelpLinks } from "./CModuleHelpLinks";
30
- export { default as CMultiselect } from "./CMultiselect";
31
- export { default as CPageHeading } from "./CPageHeading";
32
- export { default as CPagination } from "./CPagination";
33
- export { default as CPhoneNumber } from "./CPhoneNumber";
34
- export { default as CRadio } from "./CRadio";
35
- export { default as CReorderableStackedList } from "./CReorderableStackedList";
36
- export { default as CSelect } from "./CSelect";
37
- export { default as CSmallTimeline } from "./CSmallTimeline";
38
- export { default as CStackedList } from "./CStackedList";
39
- export { default as CStats } from "./CStats";
40
- export { default as CSwitch } from "./CSwitch";
41
- export { default as CTable } from "./CTable";
42
- export { default as CTabs } from "./CTabs";
43
- export { default as CTag } from "./CTag";
44
- export { default as CTextarea } from "./CTextarea";
45
- export { default as CTimeline } from "./CTimeline";
46
- export { default as CUpload } from "./CUpload";
47
- export { default as CConfirmActionModal } from "./CConfirmActionModal";
48
- export { default as CCalendar } from "./CCalendar";