classcard-ui 0.2.651 → 0.2.652

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "classcard-ui",
3
- "version": "0.2.651",
3
+ "version": "0.2.652",
4
4
  "main": "dist/classcard-ui.umd.min.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -1,9 +1,14 @@
1
1
  <template>
2
2
  <div>
3
3
  <div class="flex justify-between">
4
- <label class="block text-sm font-medium text-gray-900">
5
- {{ label }}
6
- </label>
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>
7
12
  <span v-if="hint" class="text-sm text-gray-500">{{ hint }}</span>
8
13
  </div>
9
14
  <div class="relative mt-1 rounded-md">
@@ -51,6 +56,10 @@ export default {
51
56
  value: {
52
57
  type: String,
53
58
  },
59
+ // whether the email field is mandatory or not
60
+ isRequired: {
61
+ type: Boolean,
62
+ },
54
63
  },
55
64
  data() {
56
65
  return {
@@ -1,9 +1,15 @@
1
1
  <template>
2
2
  <div>
3
3
  <div class="flex justify-between">
4
- <label v-if="label" class="block text-sm font-medium text-gray-900">
5
- {{ label }}
6
- </label>
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
+
7
13
  <span v-if="hint" class="text-sm text-gray-500">{{ hint }}</span>
8
14
  </div>
9
15
 
@@ -16,11 +22,11 @@
16
22
  :rows="rows"
17
23
  :class="errorClasses"
18
24
  :disabled="disabled"
19
- class="shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm rounded-md disabled:opacity-50 text-gray-900"
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"
20
26
  ></textarea>
21
27
  <div
22
28
  v-if="!isValidate"
23
- class="absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none text-red-600"
29
+ class="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-red-600"
24
30
  >
25
31
  <c-icon name="exclamation-circle" type="solid" class="h-5 w-5"></c-icon>
26
32
  </div>
@@ -57,6 +63,10 @@ export default {
57
63
  errorMessage: {
58
64
  type: String,
59
65
  },
66
+ // whether the textarea field is mandatory or not
67
+ isRequired: {
68
+ type: Boolean,
69
+ },
60
70
  disabled: {
61
71
  type: Boolean,
62
72
  default: false,
@@ -1,7 +1,12 @@
1
1
  <template>
2
2
  <div class="flex h-full flex-col">
3
3
  <div class="flex items-center justify-between">
4
- <label class="block text-sm font-medium text-gray-900">{{ label }}</label>
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>
5
10
  <label v-if="!isUploaded" class="block text-sm font-medium text-gray-400">
6
11
  {{ hint }}
7
12
  </label>
@@ -175,6 +180,9 @@ export default {
175
180
  type: Array,
176
181
  default: () => ["local_file_system", "unsplash"],
177
182
  },
183
+ isRequired:{
184
+ type:Boolean
185
+ }
178
186
  },
179
187
  data() {
180
188
  return {};