classcard-ui 0.2.607 → 0.2.608

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 (175) hide show
  1. package/README.md +24 -24
  2. package/dist/classcard-ui.common.js +53 -55
  3. package/dist/classcard-ui.common.js.map +1 -1
  4. package/dist/classcard-ui.umd.js +53 -55
  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 +81 -81
  9. package/src/App.vue +16 -16
  10. package/src/components/CAlerts/CAlerts.vue +70 -70
  11. package/src/components/CAlerts/index.js +2 -2
  12. package/src/components/CAnchorTabs/CAnchorTabs.vue +96 -96
  13. package/src/components/CAnchorTabs/index.js +2 -2
  14. package/src/components/CAnchorTag/CAnchorTag.vue +62 -62
  15. package/src/components/CAnchorTag/index.js +2 -2
  16. package/src/components/CAvatar/CAvatar.vue +89 -89
  17. package/src/components/CAvatar/index.js +2 -2
  18. package/src/components/CAvatarGroup/CAvatarGroup.vue +145 -145
  19. package/src/components/CAvatarGroup/index.js +2 -2
  20. package/src/components/CBasicTable/CBasicTable.vue +184 -184
  21. package/src/components/CBasicTable/index.js +2 -2
  22. package/src/components/CBreadcrumbs/CBreadcrumbs.vue +38 -38
  23. package/src/components/CBreadcrumbs/index.js +2 -2
  24. package/src/components/CButton/CButton.vue +147 -147
  25. package/src/components/CButton/index.js +2 -2
  26. package/src/components/CButtonGroup/CButtonGroup.vue +116 -116
  27. package/src/components/CButtonGroup/index.js +2 -2
  28. package/src/components/CButtonIcon/CButtonIcon.vue +91 -91
  29. package/src/components/CButtonIcon/index.js +2 -2
  30. package/src/components/CButtonLink/CButtonLink.vue +39 -39
  31. package/src/components/CButtonLink/index.js +2 -2
  32. package/src/components/CButtonSelect/CButtonSelect.vue +103 -103
  33. package/src/components/CButtonSelect/index.js +2 -2
  34. package/src/components/CButtonWithDropdown/CButtonWithDropdown.vue +168 -168
  35. package/src/components/CButtonWithDropdown/index.js +2 -2
  36. package/src/components/CCalendar/CCalendar.vue +400 -400
  37. package/src/components/CCalendar/index.js +3 -3
  38. package/src/components/CCard/CCard.vue +49 -49
  39. package/src/components/CCard/index.js +2 -2
  40. package/src/components/CCheckbox/CCheckbox.vue +70 -70
  41. package/src/components/CCheckbox/index.js +2 -2
  42. package/src/components/CCollapsibleSection/CCollapsibleSection.vue +99 -99
  43. package/src/components/CCollapsibleSection/index.js +2 -2
  44. package/src/components/CColorDots/CColorDots.vue +35 -35
  45. package/src/components/CColorDots/index.js +3 -3
  46. package/src/components/CConfirmActionModal/CConfirmActionModal.vue +120 -120
  47. package/src/components/CConfirmActionModal/index.js +3 -3
  48. package/src/components/CDatepicker/CDatepicker.vue +134 -134
  49. package/src/components/CDatepicker/index.js +2 -2
  50. package/src/components/CDualSelect/CDualSelect.vue +193 -193
  51. package/src/components/CDualSelect/index.js +2 -2
  52. package/src/components/CEditor/CEditor.vue +91 -91
  53. package/src/components/CEditor/index.js +2 -2
  54. package/src/components/CFormSectionHeading/CFormSectionHeading.vue +52 -52
  55. package/src/components/CFormSectionHeading/index.js +2 -2
  56. package/src/components/CGroupedSelect/CGroupedSelect.vue +217 -217
  57. package/src/components/CGroupedSelect/index.js +3 -3
  58. package/src/components/CIcon/CIcon.vue +77 -77
  59. package/src/components/CIcon/index.js +2 -2
  60. package/src/components/CIconDropdown/CIconDropdown.vue +105 -105
  61. package/src/components/CIconDropdown/index.js +2 -2
  62. package/src/components/CInput/CInput.vue +120 -120
  63. package/src/components/CInput/index.js +2 -2
  64. package/src/components/CInputAddon/CInputAddon.vue +202 -202
  65. package/src/components/CInputAddon/index.js +2 -2
  66. package/src/components/CInputEmail/CInputEmail.vue +84 -84
  67. package/src/components/CInputEmail/index.js +2 -2
  68. package/src/components/CModalHeading/CModalHeading.vue +22 -22
  69. package/src/components/CModalHeading/index.js +2 -2
  70. package/src/components/CModuleHelpLinks/CModuleHelpLinks.vue +39 -39
  71. package/src/components/CModuleHelpLinks/index.js +3 -3
  72. package/src/components/CMultiselect/CMultiselect.vue +323 -323
  73. package/src/components/CMultiselect/index.js +2 -2
  74. package/src/components/CMultiselectr/CMultiselectr.vue +44 -44
  75. package/src/components/CMultiselectr/index.js +2 -2
  76. package/src/components/CPageHeading/CPageHeading.vue +56 -56
  77. package/src/components/CPageHeading/index.js +2 -2
  78. package/src/components/CPagination/CPagination.vue +202 -202
  79. package/src/components/CPagination/index.js +2 -2
  80. package/src/components/CPhoneNumber/CPhoneNumber.vue +71 -71
  81. package/src/components/CPhoneNumber/index.js +2 -2
  82. package/src/components/CRadio/CRadio.vue +114 -114
  83. package/src/components/CRadio/index.js +2 -2
  84. package/src/components/CRangeSlider/CRangeSlider.vue +55 -55
  85. package/src/components/CRangeSlider/index.js +2 -2
  86. package/src/components/CReorderableStackedList/CReorderableStackedList.vue +94 -94
  87. package/src/components/CReorderableStackedList/index.js +2 -2
  88. package/src/components/CSelect/CSelect.vue +314 -314
  89. package/src/components/CSelect/index.js +2 -2
  90. package/src/components/CSmallTimeline/CSmallTimeline.vue +40 -40
  91. package/src/components/CSmallTimeline/index.js +2 -2
  92. package/src/components/CStackedList/CStackedList.vue +132 -132
  93. package/src/components/CStackedList/index.js +2 -2
  94. package/src/components/CStats/CStats.vue +100 -102
  95. package/src/components/CStats/index.js +2 -2
  96. package/src/components/CSwitch/CSwitch.vue +140 -140
  97. package/src/components/CSwitch/index.js +2 -2
  98. package/src/components/CTable/CTable.vue +488 -488
  99. package/src/components/CTable/index.js +2 -2
  100. package/src/components/CTabs/CTabs.vue +111 -111
  101. package/src/components/CTabs/index.js +2 -2
  102. package/src/components/CTag/CTag.vue +36 -36
  103. package/src/components/CTag/index.js +2 -2
  104. package/src/components/CTextarea/CTextarea.vue +85 -85
  105. package/src/components/CTextarea/index.js +2 -2
  106. package/src/components/CTimeline/CTimeline.vue +237 -237
  107. package/src/components/CTimeline/index.js +2 -2
  108. package/src/components/CUpload/CUpload.vue +201 -201
  109. package/src/components/CUpload/index.js +2 -2
  110. package/src/components/index.js +48 -48
  111. package/src/icons.js +259 -259
  112. package/src/main.js +22 -22
  113. package/src/stories/CAlerts.stories.js +37 -37
  114. package/src/stories/CAnchorTabs.stories.js +29 -29
  115. package/src/stories/CAnchorTag.stories.js +36 -36
  116. package/src/stories/CAvatar.stories.js +38 -38
  117. package/src/stories/CAvatarGroup.stories.js +100 -100
  118. package/src/stories/CBasicTable.stories.js +316 -316
  119. package/src/stories/CBreadcrumbs.stories.js +24 -24
  120. package/src/stories/CButton.stories.js +46 -46
  121. package/src/stories/CButtonGroup.stories.js +33 -33
  122. package/src/stories/CButtonIcon.stories.js +27 -27
  123. package/src/stories/CButtonLink.stories.js +24 -24
  124. package/src/stories/CButtonSelect.stories.js +32 -32
  125. package/src/stories/CButtonWithDropdown.stories.js +41 -41
  126. package/src/stories/CCalendar.stories.js +16 -16
  127. package/src/stories/CCard.stories.js +30 -30
  128. package/src/stories/CCheckbox.stories.js +29 -29
  129. package/src/stories/CCollapsibleSection.stories.js +28 -28
  130. package/src/stories/CColorDots.stories.js +28 -28
  131. package/src/stories/CConfirmActionModal.stories.js +59 -59
  132. package/src/stories/CDatepicker.stories.js +30 -30
  133. package/src/stories/CDualSelect.stories.js +29 -29
  134. package/src/stories/CEditor.stories.js +30 -30
  135. package/src/stories/CFormSectionHeading.stories.js +34 -34
  136. package/src/stories/CGroupedSelect.stories.js +69 -69
  137. package/src/stories/CIcon.stories.js +26 -26
  138. package/src/stories/CIconDropdown.stories.js +39 -39
  139. package/src/stories/CInput.stories.js +36 -36
  140. package/src/stories/CInputAddon.stories.js +37 -37
  141. package/src/stories/CInputEmail.stories.js +27 -27
  142. package/src/stories/CModalHeading.stories.js +25 -25
  143. package/src/stories/CModuleHelpLinks.stories.js +25 -25
  144. package/src/stories/CMultiselect.stories.js +97 -97
  145. package/src/stories/CMultiselectr.stories.js +23 -23
  146. package/src/stories/CPageHeading.stories.js +32 -32
  147. package/src/stories/CPagination.stories.js +30 -30
  148. package/src/stories/CPhoneNumber.stories.js +29 -29
  149. package/src/stories/CRadio.stories.js +36 -36
  150. package/src/stories/CRangeSlider.stories.js +23 -23
  151. package/src/stories/CReorderableStackedList.stories.js +23 -23
  152. package/src/stories/CSelect.stories.js +50 -50
  153. package/src/stories/CSmallTimeline.stories.js +26 -26
  154. package/src/stories/CStackedList.stories.js +37 -37
  155. package/src/stories/CStats.stories.js +33 -33
  156. package/src/stories/CSwitch.stories.js +28 -28
  157. package/src/stories/CTable.stories.js +77 -77
  158. package/src/stories/CTabs.stories.js +33 -33
  159. package/src/stories/CTag.stories.js +23 -23
  160. package/src/stories/CTextarea.stories.js +32 -32
  161. package/src/stories/CTimeline.stories.js +26 -26
  162. package/src/stories/CUpload.stories.js +36 -36
  163. package/src/stories/Introduction.stories.mdx +207 -207
  164. package/src/stories/Page.vue +88 -88
  165. package/src/stories/assets/code-brackets.svg +0 -0
  166. package/src/stories/assets/colors.svg +0 -0
  167. package/src/stories/assets/comments.svg +0 -0
  168. package/src/stories/assets/direction.svg +0 -0
  169. package/src/stories/assets/flow.svg +0 -0
  170. package/src/stories/assets/plugin.svg +0 -0
  171. package/src/stories/assets/repo.svg +0 -0
  172. package/src/stories/assets/stackalt.svg +0 -0
  173. package/src/stories/header.css +26 -26
  174. package/src/stories/page.css +69 -69
  175. package/src/stories/utils.css +17 -17
@@ -1,202 +1,202 @@
1
- <template>
2
- <div>
3
- <div class="flex 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
- <span v-if="hint" class="text-sm text-gray-500">{{ hint }}</span>
13
- </div>
14
- <div v-if="!inlineAddon && addonType == 'leading'" class="relative mt-1 flex rounded-md">
15
- <span
16
- :class="disabled ? 'opacity-50' : ''"
17
- v-if="addon"
18
- class="inline-flex items-center rounded-l-md border border-r-0 border-gray-300 bg-gray-50 px-3 text-gray-500 sm:text-sm"
19
- >
20
- {{ addon }}
21
- </span>
22
- <input
23
- :type="inputType"
24
- :value="inputValue"
25
- @input="$emit('input', $event.target.value)"
26
- @blur="$emit('blur', $event.target.value)"
27
- :class="{ ...errorClasses, 'rounded-l-md': !addon }"
28
- class="block w-full flex-1 rounded-r-md px-3 py-2 text-gray-900 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 disabled:opacity-50 sm:text-sm"
29
- :placeholder="placeholder"
30
- :disabled="disabled"
31
- />
32
- <div
33
- v-if="!isValidate"
34
- class="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-red-600"
35
- >
36
- <c-icon name="exclamation-circle" type="solid" class="h-5 w-5"></c-icon>
37
- </div>
38
- </div>
39
- <div v-if="!inlineAddon && addonType == 'trailing'" class="relative mt-1 flex rounded-md">
40
- <input
41
- :type="inputType"
42
- :value="inputValue"
43
- @input="$emit('input', $event.target.value)"
44
- @blur="$emit('blur', $event.target.value)"
45
- :class="errorClasses"
46
- class="block w-full flex-1 rounded-l-md px-3 py-2 text-gray-900 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 disabled:opacity-50 sm:text-sm"
47
- :placeholder="placeholder"
48
- :disabled="disabled"
49
- />
50
- <div
51
- v-if="!isValidate"
52
- class="pointer-events-none absolute inset-y-0 right-14 flex items-center pr-3 text-red-600"
53
- >
54
- <c-icon name="exclamation-circle" type="solid" class="h-5 w-5"></c-icon>
55
- </div>
56
- <span
57
- :class="disabled ? 'opacity-50' : ''"
58
- class="inline-flex items-center rounded-r-md border border-l-0 border-gray-300 bg-gray-50 px-4 py-2 text-gray-500 sm:text-sm"
59
- >
60
- {{ addon }}
61
- </span>
62
- </div>
63
- <div v-if="inlineAddon && addonType == 'trailing'" class="relative mt-1 flex rounded-md">
64
- <input
65
- :type="inputType"
66
- :value="inputValue"
67
- @input="$emit('input', $event.target.value)"
68
- @blur="$emit('blur', $event.target.value)"
69
- :class="errorClasses"
70
- class="block w-full flex-1 rounded-md px-3 py-2 text-gray-900 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 disabled:opacity-50 sm:text-sm"
71
- :placeholder="placeholder"
72
- :disabled="disabled"
73
- />
74
- <div class="pointer-events-none absolute inset-y-0 right-3 flex items-center">
75
- <div
76
- v-if="!isValidate"
77
- class="pointer-events-none right-0 flex items-center pr-2 text-red-600"
78
- >
79
- <c-icon name="exclamation-circle" type="solid" class="h-5 w-5"></c-icon>
80
- </div>
81
- <span
82
- class="text-gray-500 sm:text-sm"
83
- :class="[disabled ? 'opacity-50' : '', inputType === 'number' ? 'mr-5' : '']"
84
- >
85
- {{ addon }}
86
- </span>
87
- </div>
88
- </div>
89
- <div v-if="inlineAddon && addonType == 'leading'" class="relative mt-1 flex rounded-md">
90
- <div class="pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3">
91
- <span class="text-gray-500 sm:text-sm">{{ addon }}</span>
92
- </div>
93
- <input
94
- :type="inputType"
95
- :value="inputValue"
96
- @input="$emit('input', $event.target.value)"
97
- @blur="$emit('blur', $event.target.value)"
98
- :class="errorClasses"
99
- :style="`padding-left:${leftPaddingStyle}`"
100
- 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"
101
- :placeholder="placeholder"
102
- :disabled="disabled"
103
- />
104
- <div
105
- v-if="!isValidate"
106
- class="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-red-600"
107
- >
108
- <c-icon name="exclamation-circle" type="solid" class="h-5 w-5"></c-icon>
109
- </div>
110
- </div>
111
- <p v-if="!isValidate" class="mt-2 text-left text-sm text-red-600">
112
- {{ errorMessage }}
113
- </p>
114
- <p v-if="helpText && isValidate == true" :class="`mt-2 text-sm ${helpTextColorStyles}`">
115
- {{ helpText }}
116
- </p>
117
- </div>
118
- </template>
119
-
120
- <script>
121
- import CIcon from "../CIcon/CIcon.vue";
122
- export default {
123
- name: "CInputAddon",
124
- components: { CIcon },
125
- props: {
126
- label: {
127
- type: String,
128
- },
129
- placeholder: {
130
- type: String,
131
- },
132
- value: [String, Number],
133
- hint: { type: String },
134
- helpText: {
135
- type: String,
136
- },
137
- addon: { type: String },
138
- helpTextColor: {
139
- type: String,
140
- default: "gray",
141
- },
142
- inlineAddon: { type: Boolean },
143
- addonType: {
144
- type: String,
145
- },
146
- isValidate: { type: Boolean },
147
- errorMessage: {
148
- type: String,
149
- },
150
- disabled: {
151
- type: Boolean,
152
- },
153
- // whether the input field is mandatory or not
154
- isRequired: {
155
- type: Boolean,
156
- },
157
- inputType: {
158
- type: String,
159
- default: "text",
160
- },
161
- },
162
- computed: {
163
- errorClasses() {
164
- return {
165
- "border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500":
166
- this.isValidate == false,
167
- "border-gray-300": this.isValidate == true,
168
- };
169
- },
170
- leftPaddingStyle() {
171
- var leftPadding;
172
- if (this.addon.length <= 2) {
173
- leftPadding = "2rem";
174
- } else if (this.addon.length >= 3) {
175
- leftPadding = "3.5rem";
176
- }
177
- return leftPadding;
178
- },
179
- helpTextColorStyles() {
180
- switch (this.helpTextColor) {
181
- case "green":
182
- return "text-green-500";
183
- case "red":
184
- return "text-red-500";
185
- default:
186
- return "text-gray-500";
187
- }
188
- },
189
- },
190
- data() {
191
- return {
192
- inputValue: this.value,
193
- };
194
- },
195
- methods: {},
196
- watch: {
197
- value() {
198
- this.inputValue = this.value;
199
- },
200
- },
201
- };
202
- </script>
1
+ <template>
2
+ <div>
3
+ <div class="flex 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
+ <span v-if="hint" class="text-sm text-gray-500">{{ hint }}</span>
13
+ </div>
14
+ <div v-if="!inlineAddon && addonType == 'leading'" class="relative mt-1 flex rounded-md">
15
+ <span
16
+ :class="disabled ? 'opacity-50' : ''"
17
+ v-if="addon"
18
+ class="inline-flex items-center rounded-l-md border border-r-0 border-gray-300 bg-gray-50 px-3 text-gray-500 sm:text-sm"
19
+ >
20
+ {{ addon }}
21
+ </span>
22
+ <input
23
+ :type="inputType"
24
+ :value="inputValue"
25
+ @input="$emit('input', $event.target.value)"
26
+ @blur="$emit('blur', $event.target.value)"
27
+ :class="{ ...errorClasses, 'rounded-l-md': !addon }"
28
+ class="block w-full flex-1 rounded-r-md px-3 py-2 text-gray-900 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 disabled:opacity-50 sm:text-sm"
29
+ :placeholder="placeholder"
30
+ :disabled="disabled"
31
+ />
32
+ <div
33
+ v-if="!isValidate"
34
+ class="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-red-600"
35
+ >
36
+ <c-icon name="exclamation-circle" type="solid" class="h-5 w-5"></c-icon>
37
+ </div>
38
+ </div>
39
+ <div v-if="!inlineAddon && addonType == 'trailing'" class="relative mt-1 flex rounded-md">
40
+ <input
41
+ :type="inputType"
42
+ :value="inputValue"
43
+ @input="$emit('input', $event.target.value)"
44
+ @blur="$emit('blur', $event.target.value)"
45
+ :class="errorClasses"
46
+ class="block w-full flex-1 rounded-l-md px-3 py-2 text-gray-900 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 disabled:opacity-50 sm:text-sm"
47
+ :placeholder="placeholder"
48
+ :disabled="disabled"
49
+ />
50
+ <div
51
+ v-if="!isValidate"
52
+ class="pointer-events-none absolute inset-y-0 right-14 flex items-center pr-3 text-red-600"
53
+ >
54
+ <c-icon name="exclamation-circle" type="solid" class="h-5 w-5"></c-icon>
55
+ </div>
56
+ <span
57
+ :class="disabled ? 'opacity-50' : ''"
58
+ class="inline-flex items-center rounded-r-md border border-l-0 border-gray-300 bg-gray-50 px-4 py-2 text-gray-500 sm:text-sm"
59
+ >
60
+ {{ addon }}
61
+ </span>
62
+ </div>
63
+ <div v-if="inlineAddon && addonType == 'trailing'" class="relative mt-1 flex rounded-md">
64
+ <input
65
+ :type="inputType"
66
+ :value="inputValue"
67
+ @input="$emit('input', $event.target.value)"
68
+ @blur="$emit('blur', $event.target.value)"
69
+ :class="errorClasses"
70
+ class="block w-full flex-1 rounded-md px-3 py-2 text-gray-900 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 disabled:opacity-50 sm:text-sm"
71
+ :placeholder="placeholder"
72
+ :disabled="disabled"
73
+ />
74
+ <div class="pointer-events-none absolute inset-y-0 right-3 flex items-center">
75
+ <div
76
+ v-if="!isValidate"
77
+ class="pointer-events-none right-0 flex items-center pr-2 text-red-600"
78
+ >
79
+ <c-icon name="exclamation-circle" type="solid" class="h-5 w-5"></c-icon>
80
+ </div>
81
+ <span
82
+ class="text-gray-500 sm:text-sm"
83
+ :class="[disabled ? 'opacity-50' : '', inputType === 'number' ? 'mr-5' : '']"
84
+ >
85
+ {{ addon }}
86
+ </span>
87
+ </div>
88
+ </div>
89
+ <div v-if="inlineAddon && addonType == 'leading'" class="relative mt-1 flex rounded-md">
90
+ <div class="pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3">
91
+ <span class="text-gray-500 sm:text-sm">{{ addon }}</span>
92
+ </div>
93
+ <input
94
+ :type="inputType"
95
+ :value="inputValue"
96
+ @input="$emit('input', $event.target.value)"
97
+ @blur="$emit('blur', $event.target.value)"
98
+ :class="errorClasses"
99
+ :style="`padding-left:${leftPaddingStyle}`"
100
+ 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"
101
+ :placeholder="placeholder"
102
+ :disabled="disabled"
103
+ />
104
+ <div
105
+ v-if="!isValidate"
106
+ class="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-red-600"
107
+ >
108
+ <c-icon name="exclamation-circle" type="solid" class="h-5 w-5"></c-icon>
109
+ </div>
110
+ </div>
111
+ <p v-if="!isValidate" class="mt-2 text-left text-sm text-red-600">
112
+ {{ errorMessage }}
113
+ </p>
114
+ <p v-if="helpText && isValidate == true" :class="`mt-2 text-sm ${helpTextColorStyles}`">
115
+ {{ helpText }}
116
+ </p>
117
+ </div>
118
+ </template>
119
+
120
+ <script>
121
+ import CIcon from "../CIcon/CIcon.vue";
122
+ export default {
123
+ name: "CInputAddon",
124
+ components: { CIcon },
125
+ props: {
126
+ label: {
127
+ type: String,
128
+ },
129
+ placeholder: {
130
+ type: String,
131
+ },
132
+ value: [String, Number],
133
+ hint: { type: String },
134
+ helpText: {
135
+ type: String,
136
+ },
137
+ addon: { type: String },
138
+ helpTextColor: {
139
+ type: String,
140
+ default: "gray",
141
+ },
142
+ inlineAddon: { type: Boolean },
143
+ addonType: {
144
+ type: String,
145
+ },
146
+ isValidate: { type: Boolean },
147
+ errorMessage: {
148
+ type: String,
149
+ },
150
+ disabled: {
151
+ type: Boolean,
152
+ },
153
+ // whether the input field is mandatory or not
154
+ isRequired: {
155
+ type: Boolean,
156
+ },
157
+ inputType: {
158
+ type: String,
159
+ default: "text",
160
+ },
161
+ },
162
+ computed: {
163
+ errorClasses() {
164
+ return {
165
+ "border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500":
166
+ this.isValidate == false,
167
+ "border-gray-300": this.isValidate == true,
168
+ };
169
+ },
170
+ leftPaddingStyle() {
171
+ var leftPadding;
172
+ if (this.addon.length <= 2) {
173
+ leftPadding = "2rem";
174
+ } else if (this.addon.length >= 3) {
175
+ leftPadding = "3.5rem";
176
+ }
177
+ return leftPadding;
178
+ },
179
+ helpTextColorStyles() {
180
+ switch (this.helpTextColor) {
181
+ case "green":
182
+ return "text-green-500";
183
+ case "red":
184
+ return "text-red-500";
185
+ default:
186
+ return "text-gray-500";
187
+ }
188
+ },
189
+ },
190
+ data() {
191
+ return {
192
+ inputValue: this.value,
193
+ };
194
+ },
195
+ methods: {},
196
+ watch: {
197
+ value() {
198
+ this.inputValue = this.value;
199
+ },
200
+ },
201
+ };
202
+ </script>
@@ -1,3 +1,3 @@
1
- import CInputAddon from './CInputAddon.vue'
2
-
1
+ import CInputAddon from './CInputAddon.vue'
2
+
3
3
  export default CInputAddon
@@ -1,84 +1,84 @@
1
- <template>
2
- <div>
3
- <div class="flex justify-between">
4
- <label class="block text-sm font-medium text-gray-900">
5
- {{ label }}
6
- </label>
7
- <span v-if="hint" class="text-sm text-gray-500">{{ hint }}</span>
8
- </div>
9
- <div class="relative mt-1 rounded-md">
10
- <input
11
- type="text"
12
- :class="errorClasses"
13
- class="block w-full flex-1 rounded-md px-3 py-2 text-gray-900 focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
14
- :placeholder="placeholder"
15
- :value="email"
16
- @blur="checkValidation"
17
- @input="$emit('input', $event.target.value)"
18
- />
19
- <div
20
- v-if="isValidate"
21
- class="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-red-600"
22
- >
23
- <c-icon name="exclamation-circle" type="solid" class="h-5 w-5"></c-icon>
24
- </div>
25
- </div>
26
- <p v-if="isValidate" class="mt-2 text-sm text-red-600">Please enter valid email address</p>
27
- <p v-if="helpText && isValidate == false" class="mt-2 text-sm text-gray-500">
28
- {{ helpText }}
29
- </p>
30
- </div>
31
- </template>
32
-
33
- <script>
34
- import CIcon from "../CIcon/CIcon.vue";
35
- export default {
36
- name: "CInputEmail",
37
- components: { CIcon },
38
- props: {
39
- label: {
40
- type: String,
41
- required: true,
42
- },
43
- placeholder: {
44
- type: String,
45
- },
46
- hint: { type: String },
47
- helpText: {
48
- type: String,
49
- },
50
- // v-model of the field
51
- value: {
52
- type: String,
53
- },
54
- },
55
- data() {
56
- return {
57
- email: this.value,
58
- isValidate: false,
59
- };
60
- },
61
- computed: {
62
- errorClasses() {
63
- return {
64
- "border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500":
65
- this.isValidate == true,
66
- "border-gray-300": this.isValidate == false,
67
- };
68
- },
69
- },
70
- methods: {
71
- checkValidation() {
72
- this.isValidate =
73
- /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/.test(this.email) || this.email == ""
74
- ? false
75
- : true;
76
- },
77
- },
78
- watch: {
79
- value() {
80
- this.email = this.value;
81
- },
82
- },
83
- };
84
- </script>
1
+ <template>
2
+ <div>
3
+ <div class="flex justify-between">
4
+ <label class="block text-sm font-medium text-gray-900">
5
+ {{ label }}
6
+ </label>
7
+ <span v-if="hint" class="text-sm text-gray-500">{{ hint }}</span>
8
+ </div>
9
+ <div class="relative mt-1 rounded-md">
10
+ <input
11
+ type="text"
12
+ :class="errorClasses"
13
+ class="block w-full flex-1 rounded-md px-3 py-2 text-gray-900 focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
14
+ :placeholder="placeholder"
15
+ :value="email"
16
+ @blur="checkValidation"
17
+ @input="$emit('input', $event.target.value)"
18
+ />
19
+ <div
20
+ v-if="isValidate"
21
+ class="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-red-600"
22
+ >
23
+ <c-icon name="exclamation-circle" type="solid" class="h-5 w-5"></c-icon>
24
+ </div>
25
+ </div>
26
+ <p v-if="isValidate" class="mt-2 text-sm text-red-600">Please enter valid email address</p>
27
+ <p v-if="helpText && isValidate == false" class="mt-2 text-sm text-gray-500">
28
+ {{ helpText }}
29
+ </p>
30
+ </div>
31
+ </template>
32
+
33
+ <script>
34
+ import CIcon from "../CIcon/CIcon.vue";
35
+ export default {
36
+ name: "CInputEmail",
37
+ components: { CIcon },
38
+ props: {
39
+ label: {
40
+ type: String,
41
+ required: true,
42
+ },
43
+ placeholder: {
44
+ type: String,
45
+ },
46
+ hint: { type: String },
47
+ helpText: {
48
+ type: String,
49
+ },
50
+ // v-model of the field
51
+ value: {
52
+ type: String,
53
+ },
54
+ },
55
+ data() {
56
+ return {
57
+ email: this.value,
58
+ isValidate: false,
59
+ };
60
+ },
61
+ computed: {
62
+ errorClasses() {
63
+ return {
64
+ "border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500":
65
+ this.isValidate == true,
66
+ "border-gray-300": this.isValidate == false,
67
+ };
68
+ },
69
+ },
70
+ methods: {
71
+ checkValidation() {
72
+ this.isValidate =
73
+ /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/.test(this.email) || this.email == ""
74
+ ? false
75
+ : true;
76
+ },
77
+ },
78
+ watch: {
79
+ value() {
80
+ this.email = this.value;
81
+ },
82
+ },
83
+ };
84
+ </script>
@@ -1,3 +1,3 @@
1
- import CInputEmail from './CInputEmail.vue'
2
-
1
+ import CInputEmail from './CInputEmail.vue'
2
+
3
3
  export default CInputEmail
@@ -1,22 +1,22 @@
1
- <template>
2
- <div>
3
- <div :class="{ 'border-b-2': divider }" class="pb-2 border-gray-200">
4
- <h3 class="text-lg leading-6 font-medium text-gray-700">
5
- {{ title }}
6
- </h3>
7
- <p v-if="description" class="max-w-4xl text-sm text-gray-500">
8
- {{ description }}
9
- </p>
10
- </div>
11
- </div>
12
- </template>
13
- <script>
14
- export default {
15
- name: "CModalHeading",
16
- props: {
17
- title: { type: String, required: true },
18
- description: { type: String },
19
- divider: { type: Boolean },
20
- },
21
- };
22
- </script>
1
+ <template>
2
+ <div>
3
+ <div :class="{ 'border-b-2': divider }" class="pb-2 border-gray-200">
4
+ <h3 class="text-lg leading-6 font-medium text-gray-700">
5
+ {{ title }}
6
+ </h3>
7
+ <p v-if="description" class="max-w-4xl text-sm text-gray-500">
8
+ {{ description }}
9
+ </p>
10
+ </div>
11
+ </div>
12
+ </template>
13
+ <script>
14
+ export default {
15
+ name: "CModalHeading",
16
+ props: {
17
+ title: { type: String, required: true },
18
+ description: { type: String },
19
+ divider: { type: Boolean },
20
+ },
21
+ };
22
+ </script>
@@ -1,3 +1,3 @@
1
- import CModalHeading from './CModalHeading.vue'
2
-
1
+ import CModalHeading from './CModalHeading.vue'
2
+
3
3
  export default CModalHeading