classcard-ui 0.2.985 → 0.2.986

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 (188) hide show
  1. package/README.md +24 -24
  2. package/dist/classcard-ui.common.js +70 -58
  3. package/dist/classcard-ui.common.js.map +1 -1
  4. package/dist/classcard-ui.umd.js +70 -58
  5. package/dist/classcard-ui.umd.js.map +1 -1
  6. package/dist/classcard-ui.umd.min.js +1 -1
  7. package/dist/classcard-ui.umd.min.js.map +1 -1
  8. package/package.json +82 -82
  9. package/src/.DS_Store +0 -0
  10. package/src/App.vue +16 -16
  11. package/src/components/CAlerts/CAlerts.vue +70 -70
  12. package/src/components/CAlerts/index.js +2 -2
  13. package/src/components/CAnchorTabs/CAnchorTabs.vue +96 -96
  14. package/src/components/CAnchorTabs/index.js +2 -2
  15. package/src/components/CAnchorTag/CAnchorTag.vue +62 -62
  16. package/src/components/CAnchorTag/index.js +2 -2
  17. package/src/components/CAvatar/CAvatar.vue +136 -136
  18. package/src/components/CAvatar/index.js +2 -2
  19. package/src/components/CAvatarGroup/CAvatarGroup.vue +145 -145
  20. package/src/components/CAvatarGroup/index.js +2 -2
  21. package/src/components/CBasicTable/CBasicTable.vue +184 -184
  22. package/src/components/CBasicTable/index.js +2 -2
  23. package/src/components/CBreadcrumbs/CBreadcrumbs.vue +38 -38
  24. package/src/components/CBreadcrumbs/index.js +2 -2
  25. package/src/components/CButton/CButton.vue +152 -152
  26. package/src/components/CButton/index.js +2 -2
  27. package/src/components/CButtonGroup/CButtonGroup.vue +118 -118
  28. package/src/components/CButtonGroup/index.js +2 -2
  29. package/src/components/CButtonIcon/CButtonIcon.vue +117 -117
  30. package/src/components/CButtonIcon/index.js +2 -2
  31. package/src/components/CButtonLink/CButtonLink.vue +39 -39
  32. package/src/components/CButtonLink/index.js +2 -2
  33. package/src/components/CButtonSelect/CButtonSelect.vue +124 -124
  34. package/src/components/CButtonSelect/index.js +2 -2
  35. package/src/components/CButtonSelectBorder/CButtonSelectBorder.vue +135 -135
  36. package/src/components/CButtonSelectBorder/index.js +3 -3
  37. package/src/components/CButtonWithDropdown/CButtonWithDropdown.vue +135 -135
  38. package/src/components/CButtonWithDropdown/index.js +2 -2
  39. package/src/components/CCalendar/CCalendar.vue +410 -410
  40. package/src/components/CCalendar/index.js +3 -3
  41. package/src/components/CCard/CCard.vue +49 -49
  42. package/src/components/CCard/index.js +2 -2
  43. package/src/components/CCheckbox/CCheckbox.vue +85 -85
  44. package/src/components/CCheckbox/index.js +2 -2
  45. package/src/components/CCircularButton/CCircularButton.vue +52 -52
  46. package/src/components/CCircularButton/index.js +2 -2
  47. package/src/components/CCollapsibleSection/CCollapsibleSection.vue +101 -101
  48. package/src/components/CCollapsibleSection/index.js +2 -2
  49. package/src/components/CColorDots/CColorDots.vue +46 -46
  50. package/src/components/CColorDots/index.js +3 -3
  51. package/src/components/CConfirmActionModal/CConfirmActionModal.vue +171 -171
  52. package/src/components/CConfirmActionModal/index.js +3 -3
  53. package/src/components/CDatepicker/CDatepicker.vue +158 -158
  54. package/src/components/CDatepicker/index.js +2 -2
  55. package/src/components/CDualSelect/CDualSelect.vue +193 -193
  56. package/src/components/CDualSelect/index.js +2 -2
  57. package/src/components/CEditor/CEditor.vue +98 -98
  58. package/src/components/CEditor/index.js +2 -2
  59. package/src/components/CFormSectionHeading/CFormSectionHeading.vue +53 -53
  60. package/src/components/CFormSectionHeading/index.js +2 -2
  61. package/src/components/CGroupedSelect/CGroupedSelect.vue +245 -245
  62. package/src/components/CGroupedSelect/index.js +3 -3
  63. package/src/components/CIcon/CIcon.vue +77 -77
  64. package/src/components/CIcon/index.js +2 -2
  65. package/src/components/CIconDropdown/CIconDropdown.vue +131 -120
  66. package/src/components/CIconDropdown/index.js +2 -2
  67. package/src/components/CInput/CInput.vue +134 -134
  68. package/src/components/CInput/index.js +2 -2
  69. package/src/components/CInputAddon/CInputAddon.vue +228 -228
  70. package/src/components/CInputAddon/index.js +2 -2
  71. package/src/components/CInputEmail/CInputEmail.vue +93 -93
  72. package/src/components/CInputEmail/index.js +2 -2
  73. package/src/components/CInsetTabs/CInsetTabs.vue +88 -88
  74. package/src/components/CInsetTabs/index.js +3 -3
  75. package/src/components/CModalHeading/CModalHeading.vue +22 -22
  76. package/src/components/CModalHeading/index.js +2 -2
  77. package/src/components/CModuleHelpLinks/CModuleHelpLinks.vue +70 -70
  78. package/src/components/CModuleHelpLinks/index.js +3 -3
  79. package/src/components/CMultiselect/CMultiselect.vue +479 -479
  80. package/src/components/CMultiselect/index.js +2 -2
  81. package/src/components/CMultiselectr/CMultiselectr.vue +44 -44
  82. package/src/components/CMultiselectr/index.js +2 -2
  83. package/src/components/CPageHeading/CPageHeading.vue +56 -56
  84. package/src/components/CPageHeading/index.js +2 -2
  85. package/src/components/CPagination/CPagination.vue +233 -233
  86. package/src/components/CPagination/index.js +2 -2
  87. package/src/components/CPhoneNumber/CPhoneNumber.vue +114 -114
  88. package/src/components/CPhoneNumber/index.js +2 -2
  89. package/src/components/CRadio/CRadio.vue +124 -124
  90. package/src/components/CRadio/index.js +2 -2
  91. package/src/components/CRangeSlider/CRangeSlider.vue +55 -55
  92. package/src/components/CRangeSlider/index.js +2 -2
  93. package/src/components/CReorderableStackedList/CReorderableStackedList.vue +94 -94
  94. package/src/components/CReorderableStackedList/index.js +2 -2
  95. package/src/components/CSelect/CSelect.vue +417 -417
  96. package/src/components/CSelect/index.js +2 -2
  97. package/src/components/CSmallTimeline/CSmallTimeline.vue +40 -40
  98. package/src/components/CSmallTimeline/index.js +2 -2
  99. package/src/components/CStackedList/CStackedList.vue +150 -150
  100. package/src/components/CStackedList/index.js +2 -2
  101. package/src/components/CStats/CStats.vue +116 -116
  102. package/src/components/CStats/index.js +2 -2
  103. package/src/components/CSwitch/CSwitch.vue +171 -171
  104. package/src/components/CSwitch/index.js +2 -2
  105. package/src/components/CTabLazy/CTabLazy.vue +58 -58
  106. package/src/components/CTabLazy/index.js +2 -2
  107. package/src/components/CTable/CTable.vue +671 -671
  108. package/src/components/CTable/index.js +2 -2
  109. package/src/components/CTabs/CTabs.vue +125 -125
  110. package/src/components/CTabs/index.js +2 -2
  111. package/src/components/CTag/CTag.vue +59 -59
  112. package/src/components/CTag/index.js +2 -2
  113. package/src/components/CTextarea/CTextarea.vue +107 -107
  114. package/src/components/CTextarea/index.js +2 -2
  115. package/src/components/CTimeline/CTimeline.vue +237 -237
  116. package/src/components/CTimeline/index.js +2 -2
  117. package/src/components/CUpload/CUpload.vue +267 -267
  118. package/src/components/CUpload/index.js +2 -2
  119. package/src/components/index.js +52 -52
  120. package/src/icons.js +364 -364
  121. package/src/main.js +22 -22
  122. package/src/stories/CAlerts.stories.js +37 -37
  123. package/src/stories/CAnchorTabs.stories.js +29 -29
  124. package/src/stories/CAnchorTag.stories.js +36 -36
  125. package/src/stories/CAvatar.stories.js +38 -38
  126. package/src/stories/CAvatarGroup.stories.js +100 -100
  127. package/src/stories/CBasicTable.stories.js +316 -316
  128. package/src/stories/CBreadcrumbs.stories.js +24 -24
  129. package/src/stories/CButton.stories.js +47 -47
  130. package/src/stories/CButtonGroup.stories.js +33 -33
  131. package/src/stories/CButtonIcon.stories.js +27 -27
  132. package/src/stories/CButtonLink.stories.js +24 -24
  133. package/src/stories/CButtonSelect.stories.js +41 -41
  134. package/src/stories/CButtonSelectBorder.stories.js +48 -48
  135. package/src/stories/CButtonWithDropdown.stories.js +41 -41
  136. package/src/stories/CCalendar.stories.js +16 -16
  137. package/src/stories/CCard.stories.js +30 -30
  138. package/src/stories/CCheckbox.stories.js +29 -29
  139. package/src/stories/CCircularButton.stories.js +29 -29
  140. package/src/stories/CCollapsibleSection.stories.js +28 -28
  141. package/src/stories/CColorDots.stories.js +28 -28
  142. package/src/stories/CConfirmActionModal.stories.js +59 -59
  143. package/src/stories/CDatepicker.stories.js +30 -30
  144. package/src/stories/CDualSelect.stories.js +29 -29
  145. package/src/stories/CEditor.stories.js +30 -30
  146. package/src/stories/CFormSectionHeading.stories.js +34 -34
  147. package/src/stories/CGroupedSelect.stories.js +71 -71
  148. package/src/stories/CIcon.stories.js +26 -26
  149. package/src/stories/CIconDropdown.stories.js +45 -45
  150. package/src/stories/CInput.stories.js +36 -36
  151. package/src/stories/CInputAddon.stories.js +37 -37
  152. package/src/stories/CInputEmail.stories.js +27 -27
  153. package/src/stories/CInsetTabs.stories.js +38 -38
  154. package/src/stories/CModalHeading.stories.js +25 -25
  155. package/src/stories/CModuleHelpLinks.stories.js +25 -25
  156. package/src/stories/CMultiselect.stories.js +157 -157
  157. package/src/stories/CMultiselectr.stories.js +23 -23
  158. package/src/stories/CPageHeading.stories.js +32 -32
  159. package/src/stories/CPagination.stories.js +30 -30
  160. package/src/stories/CPhoneNumber.stories.js +29 -29
  161. package/src/stories/CRadio.stories.js +36 -36
  162. package/src/stories/CRangeSlider.stories.js +23 -23
  163. package/src/stories/CReorderableStackedList.stories.js +23 -23
  164. package/src/stories/CSelect.stories.js +96 -96
  165. package/src/stories/CSmallTimeline.stories.js +26 -26
  166. package/src/stories/CStackedList.stories.js +37 -37
  167. package/src/stories/CStats.stories.js +33 -33
  168. package/src/stories/CSwitch.stories.js +28 -28
  169. package/src/stories/CTabLazy.stories.js +24 -24
  170. package/src/stories/CTable.stories.js +169 -169
  171. package/src/stories/CTabs.stories.js +33 -33
  172. package/src/stories/CTag.stories.js +34 -34
  173. package/src/stories/CTextarea.stories.js +32 -32
  174. package/src/stories/CTimeline.stories.js +26 -26
  175. package/src/stories/CUpload.stories.js +36 -36
  176. package/src/stories/Introduction.stories.mdx +207 -207
  177. package/src/stories/Page.vue +88 -88
  178. package/src/stories/assets/code-brackets.svg +0 -0
  179. package/src/stories/assets/colors.svg +0 -0
  180. package/src/stories/assets/comments.svg +0 -0
  181. package/src/stories/assets/direction.svg +0 -0
  182. package/src/stories/assets/flow.svg +0 -0
  183. package/src/stories/assets/plugin.svg +0 -0
  184. package/src/stories/assets/repo.svg +0 -0
  185. package/src/stories/assets/stackalt.svg +0 -0
  186. package/src/stories/header.css +26 -26
  187. package/src/stories/page.css +69 -69
  188. package/src/stories/utils.css +17 -17
@@ -1,267 +1,267 @@
1
- <template>
2
- <div :class="`flex h-full ${isCol ? '' : '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">{{
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
- <label v-if="!isUploaded" class="block text-sm font-medium text-gray-400">
13
- {{ hint }}
14
- </label>
15
- </div>
16
- <button
17
- type="button"
18
- class="focus:outline-none 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:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
19
- @click="initFilestack()"
20
- v-if="displayMode == 'overlay' && icon"
21
- >
22
- <c-icon
23
- :type="icon.type"
24
- :class="icon.class"
25
- :name="icon.name"
26
- :viewBox="icon.viewBox"
27
- ></c-icon>
28
- {{ buttonText }}
29
- </button>
30
- <button
31
- type="button"
32
- class="focus:outline-none 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"
33
- @click="initFilestack()"
34
- v-if="displayMode == 'overlay' && !icon && !isAvatar && !isIconBtn"
35
- >
36
- <c-icon
37
- name="arrow-up"
38
- type="solid"
39
- class="mr-1 h-5 w-5 flex-none text-indigo-600"
40
- viewBox="0 0 20 20"
41
- ></c-icon>
42
- <span class="text-sm font-medium text-indigo-900"> Upload </span>
43
- </button>
44
- <button
45
- type="button"
46
- class="group rounded-full p-2 text-gray-400 hover:bg-gray-200 hover:text-gray-500"
47
- @click="initFilestack()"
48
- v-if="displayMode == 'overlay' && !icon && !isAvatar && isIconBtn"
49
- >
50
- <c-icon
51
- :name="isIconBtnName"
52
- type="solid"
53
- class="h-5 w-5 flex-none text-gray-400 group-hover:text-gray-500"
54
- viewBox="0 0 20 20"
55
- cursorType="cursor-pointer"
56
- ></c-icon>
57
- </button>
58
- <div
59
- class="relative hidden h-full w-full overflow-hidden rounded-full lg:block"
60
- @click="initFilestack()"
61
- v-if="displayMode == 'overlay' && !icon && isAvatar"
62
- >
63
- <img
64
- v-if="imageUrl"
65
- class="relative h-full w-full rounded-full object-cover"
66
- :src="imageUrl"
67
- />
68
- <c-avatar
69
- v-else
70
- size="very large"
71
- :nameInitials="shortName"
72
- :isDynamicallyColored="coloredAvatars"
73
- :rounded="true"
74
- ></c-avatar>
75
- <label
76
- 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"
77
- >
78
- <c-icon
79
- v-if="openIcon"
80
- :name="openIcon.name"
81
- :type="openIcon.type"
82
- :class="openIcon.class"
83
- ></c-icon>
84
- <span>{{ uploadText }}</span>
85
- <span class="sr-only"> user photo</span>
86
- </label>
87
- </div>
88
- <div :class="filestackClasses" :id="filestackId"></div>
89
- <p v-if="!isValidate" class="mt-2 text-sm text-red-600">
90
- {{ errorMessage }}
91
- </p>
92
- <!-- description about the input field -->
93
- <p v-if="helpText && isValidate == true" class="mt-2 text-sm text-gray-500">
94
- {{ helpText }}
95
- </p>
96
- </div>
97
- </template>
98
-
99
- <script>
100
- import * as filestack from "filestack-js";
101
- import CIcon from "../CIcon/CIcon.vue";
102
- import CAvatar from "../CAvatar/CAvatar.vue";
103
-
104
- export default {
105
- name: "CUpload",
106
- components: {
107
- CIcon,
108
- CAvatar,
109
- },
110
- props: {
111
- buttonText: {
112
- type: String,
113
- default: "Upload",
114
- },
115
- isAvatar: {
116
- type: Boolean,
117
- default: false,
118
- },
119
- isIconBtn: {
120
- type: Boolean,
121
- default: false,
122
- },
123
- isIconBtnName: {
124
- type: String,
125
- default: "attachment-solid",
126
- },
127
- shortName: {
128
- type: String,
129
- },
130
- imageUrl: {
131
- type: String,
132
- default: "",
133
- },
134
- icon: {
135
- type: Object,
136
- },
137
- fileSize: {
138
- type: String,
139
- },
140
- filestackId: {
141
- type: String,
142
- default: "filestack-uploader",
143
- },
144
- openIcon: {
145
- type: Object,
146
- },
147
- uploadText: {
148
- type: String,
149
- default: "Change",
150
- },
151
- hint: {
152
- type: String,
153
- default: "",
154
- },
155
- helpText: {
156
- type: String,
157
- },
158
- label: {
159
- type: String,
160
- default: "",
161
- },
162
- isValidate: { type: Boolean },
163
- errorMessage: {
164
- type: String,
165
- },
166
- filestackApiKey: {
167
- type: String,
168
- default: "",
169
- },
170
- filestackClasses: {
171
- type: String,
172
- default: "w-96 h-96",
173
- },
174
- url: {
175
- type: String,
176
- },
177
- maxFiles: {
178
- type: Number,
179
- default: 1,
180
- },
181
- onUploadSuccess: {
182
- type: Function,
183
- },
184
- aspectRatio: {
185
- type: Number,
186
- default: null,
187
- },
188
- onUploadOpen: {
189
- type: Function,
190
- },
191
- displayMode: {
192
- type: String,
193
- default: "inline",
194
- },
195
- isUploaded: {
196
- type: Boolean,
197
- default: false,
198
- },
199
- isCircle: {
200
- type: Boolean,
201
- default: false,
202
- },
203
- coloredAvatars: {
204
- type: Boolean,
205
- default: false,
206
- },
207
- uploadSources: {
208
- type: Array,
209
- default: () => ["local_file_system", "unsplash"],
210
- },
211
- isRequired: {
212
- type: Boolean,
213
- },
214
- isCol: {
215
- type: Boolean,
216
- },
217
- disableTransformer: {
218
- type: Boolean,
219
- default: false,
220
- },
221
- },
222
- data() {
223
- return {};
224
- },
225
- methods: {
226
- initFilestack() {
227
- const client = filestack.init(this.filestackApiKey);
228
- const options = {
229
- displayMode: this.displayMode,
230
- container: `#${this.filestackId}`,
231
- uploadInBackground: false,
232
- maxFiles: this.maxFiles,
233
- onOpen: (param) => this.$emit("onUploadOpen", param, "open"),
234
- onClose: (param) => this.$emit("onUploadOpen", param, "close"),
235
- onUploadDone: (res) => this.$emit("filestack-uploaded", res),
236
- fromSources: this.uploadSources,
237
- disableTransformer: this.disableTransformer,
238
- transformations: {
239
- crop: {
240
- aspectRatio: this.aspectRatio ? this.aspectRatio : 0,
241
- force: this.aspectRatio ? true : false,
242
- },
243
- circle: this.isCircle,
244
- },
245
- };
246
- const picker = client.picker(options);
247
- picker.open();
248
- },
249
- },
250
- computed: {
251
- errorClasses() {
252
- return {
253
- "border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500":
254
- this.isValidate == false,
255
- "border-gray-300 border-dashed": this.isValidate == true,
256
- };
257
- },
258
- },
259
- mounted() {
260
- if (this.displayMode == "inline") {
261
- this.initFilestack();
262
- }
263
- },
264
- };
265
- </script>
266
-
267
- <style></style>
1
+ <template>
2
+ <div :class="`flex h-full ${isCol ? '' : '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">{{
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
+ <label v-if="!isUploaded" class="block text-sm font-medium text-gray-400">
13
+ {{ hint }}
14
+ </label>
15
+ </div>
16
+ <button
17
+ type="button"
18
+ class="focus:outline-none 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:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
19
+ @click="initFilestack()"
20
+ v-if="displayMode == 'overlay' && icon"
21
+ >
22
+ <c-icon
23
+ :type="icon.type"
24
+ :class="icon.class"
25
+ :name="icon.name"
26
+ :viewBox="icon.viewBox"
27
+ ></c-icon>
28
+ {{ buttonText }}
29
+ </button>
30
+ <button
31
+ type="button"
32
+ class="focus:outline-none 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"
33
+ @click="initFilestack()"
34
+ v-if="displayMode == 'overlay' && !icon && !isAvatar && !isIconBtn"
35
+ >
36
+ <c-icon
37
+ name="arrow-up"
38
+ type="solid"
39
+ class="mr-1 h-5 w-5 flex-none text-indigo-600"
40
+ viewBox="0 0 20 20"
41
+ ></c-icon>
42
+ <span class="text-sm font-medium text-indigo-900"> Upload </span>
43
+ </button>
44
+ <button
45
+ type="button"
46
+ class="group rounded-full p-2 text-gray-400 hover:bg-gray-200 hover:text-gray-500"
47
+ @click="initFilestack()"
48
+ v-if="displayMode == 'overlay' && !icon && !isAvatar && isIconBtn"
49
+ >
50
+ <c-icon
51
+ :name="isIconBtnName"
52
+ type="solid"
53
+ class="h-5 w-5 flex-none text-gray-400 group-hover:text-gray-500"
54
+ viewBox="0 0 20 20"
55
+ cursorType="cursor-pointer"
56
+ ></c-icon>
57
+ </button>
58
+ <div
59
+ class="relative hidden h-full w-full overflow-hidden rounded-full lg:block"
60
+ @click="initFilestack()"
61
+ v-if="displayMode == 'overlay' && !icon && isAvatar"
62
+ >
63
+ <img
64
+ v-if="imageUrl"
65
+ class="relative h-full w-full rounded-full object-cover"
66
+ :src="imageUrl"
67
+ />
68
+ <c-avatar
69
+ v-else
70
+ size="very large"
71
+ :nameInitials="shortName"
72
+ :isDynamicallyColored="coloredAvatars"
73
+ :rounded="true"
74
+ ></c-avatar>
75
+ <label
76
+ 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"
77
+ >
78
+ <c-icon
79
+ v-if="openIcon"
80
+ :name="openIcon.name"
81
+ :type="openIcon.type"
82
+ :class="openIcon.class"
83
+ ></c-icon>
84
+ <span>{{ uploadText }}</span>
85
+ <span class="sr-only"> user photo</span>
86
+ </label>
87
+ </div>
88
+ <div :class="filestackClasses" :id="filestackId"></div>
89
+ <p v-if="!isValidate" class="mt-2 text-sm text-red-600">
90
+ {{ errorMessage }}
91
+ </p>
92
+ <!-- description about the input field -->
93
+ <p v-if="helpText && isValidate == true" class="mt-2 text-sm text-gray-500">
94
+ {{ helpText }}
95
+ </p>
96
+ </div>
97
+ </template>
98
+
99
+ <script>
100
+ import * as filestack from "filestack-js";
101
+ import CIcon from "../CIcon/CIcon.vue";
102
+ import CAvatar from "../CAvatar/CAvatar.vue";
103
+
104
+ export default {
105
+ name: "CUpload",
106
+ components: {
107
+ CIcon,
108
+ CAvatar,
109
+ },
110
+ props: {
111
+ buttonText: {
112
+ type: String,
113
+ default: "Upload",
114
+ },
115
+ isAvatar: {
116
+ type: Boolean,
117
+ default: false,
118
+ },
119
+ isIconBtn: {
120
+ type: Boolean,
121
+ default: false,
122
+ },
123
+ isIconBtnName: {
124
+ type: String,
125
+ default: "attachment-solid",
126
+ },
127
+ shortName: {
128
+ type: String,
129
+ },
130
+ imageUrl: {
131
+ type: String,
132
+ default: "",
133
+ },
134
+ icon: {
135
+ type: Object,
136
+ },
137
+ fileSize: {
138
+ type: String,
139
+ },
140
+ filestackId: {
141
+ type: String,
142
+ default: "filestack-uploader",
143
+ },
144
+ openIcon: {
145
+ type: Object,
146
+ },
147
+ uploadText: {
148
+ type: String,
149
+ default: "Change",
150
+ },
151
+ hint: {
152
+ type: String,
153
+ default: "",
154
+ },
155
+ helpText: {
156
+ type: String,
157
+ },
158
+ label: {
159
+ type: String,
160
+ default: "",
161
+ },
162
+ isValidate: { type: Boolean },
163
+ errorMessage: {
164
+ type: String,
165
+ },
166
+ filestackApiKey: {
167
+ type: String,
168
+ default: "",
169
+ },
170
+ filestackClasses: {
171
+ type: String,
172
+ default: "w-96 h-96",
173
+ },
174
+ url: {
175
+ type: String,
176
+ },
177
+ maxFiles: {
178
+ type: Number,
179
+ default: 1,
180
+ },
181
+ onUploadSuccess: {
182
+ type: Function,
183
+ },
184
+ aspectRatio: {
185
+ type: Number,
186
+ default: null,
187
+ },
188
+ onUploadOpen: {
189
+ type: Function,
190
+ },
191
+ displayMode: {
192
+ type: String,
193
+ default: "inline",
194
+ },
195
+ isUploaded: {
196
+ type: Boolean,
197
+ default: false,
198
+ },
199
+ isCircle: {
200
+ type: Boolean,
201
+ default: false,
202
+ },
203
+ coloredAvatars: {
204
+ type: Boolean,
205
+ default: false,
206
+ },
207
+ uploadSources: {
208
+ type: Array,
209
+ default: () => ["local_file_system", "unsplash"],
210
+ },
211
+ isRequired: {
212
+ type: Boolean,
213
+ },
214
+ isCol: {
215
+ type: Boolean,
216
+ },
217
+ disableTransformer: {
218
+ type: Boolean,
219
+ default: false,
220
+ },
221
+ },
222
+ data() {
223
+ return {};
224
+ },
225
+ methods: {
226
+ initFilestack() {
227
+ const client = filestack.init(this.filestackApiKey);
228
+ const options = {
229
+ displayMode: this.displayMode,
230
+ container: `#${this.filestackId}`,
231
+ uploadInBackground: false,
232
+ maxFiles: this.maxFiles,
233
+ onOpen: (param) => this.$emit("onUploadOpen", param, "open"),
234
+ onClose: (param) => this.$emit("onUploadOpen", param, "close"),
235
+ onUploadDone: (res) => this.$emit("filestack-uploaded", res),
236
+ fromSources: this.uploadSources,
237
+ disableTransformer: this.disableTransformer,
238
+ transformations: {
239
+ crop: {
240
+ aspectRatio: this.aspectRatio ? this.aspectRatio : 0,
241
+ force: this.aspectRatio ? true : false,
242
+ },
243
+ circle: this.isCircle,
244
+ },
245
+ };
246
+ const picker = client.picker(options);
247
+ picker.open();
248
+ },
249
+ },
250
+ computed: {
251
+ errorClasses() {
252
+ return {
253
+ "border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500":
254
+ this.isValidate == false,
255
+ "border-gray-300 border-dashed": this.isValidate == true,
256
+ };
257
+ },
258
+ },
259
+ mounted() {
260
+ if (this.displayMode == "inline") {
261
+ this.initFilestack();
262
+ }
263
+ },
264
+ };
265
+ </script>
266
+
267
+ <style></style>
@@ -1,3 +1,3 @@
1
- import CUpload from './CUpload.vue'
2
-
1
+ import CUpload from './CUpload.vue'
2
+
3
3
  export default CUpload
@@ -1,52 +1,52 @@
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";
49
- export { default as CButtonSelectBorder } from "./CButtonSelectBorder";
50
- export { default as CInsetTabs } from "./CInsetTabs";
51
- export { default as CTabLazy } from "./CTabLazy";
52
- export { default as CCircularButton } from "./CCircularButton";
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";
49
+ export { default as CButtonSelectBorder } from "./CButtonSelectBorder";
50
+ export { default as CInsetTabs } from "./CInsetTabs";
51
+ export { default as CTabLazy } from "./CTabLazy";
52
+ export { default as CCircularButton } from "./CCircularButton";