classcard-ui 0.2.417 → 0.2.420

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.417",
3
+ "version": "0.2.420",
4
4
  "main": "dist/classcard-ui.common.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -5,7 +5,7 @@
5
5
  v-if="type == 'tertiary'"
6
6
  :class="customClasses"
7
7
  class="flex cursor-pointer flex-row rounded-md px-4 py-2 text-sm text-indigo-600 hover:bg-indigo-100 hover:text-indigo-800 focus:outline-none focus:ring-2 focus:ring-indigo-200 focus:ring-offset-2"
8
- @click="$emit('action')"
8
+ @click.prevent="$emit('action')"
9
9
  >
10
10
  <c-icon
11
11
  v-if="icon"
@@ -23,7 +23,7 @@
23
23
  :class="classes"
24
24
  :disabled="disabled"
25
25
  class="inline-flex items-center rounded-md px-4 py-2 text-sm font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50"
26
- @click="$emit('action')"
26
+ @click.prevent="$emit('action')"
27
27
  >
28
28
  <c-icon v-if="isLoading" class="mr-2 h-5 w-5" name="loader"></c-icon>
29
29
  <c-icon
@@ -42,7 +42,7 @@
42
42
  :class="classes"
43
43
  :disabled="disabled"
44
44
  class="inline-flex items-center rounded-md px-3 py-2 text-sm font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50"
45
- @click="$emit('action')"
45
+ @click.prevent="$emit('action')"
46
46
  >
47
47
  <c-icon v-if="isLoading" class="mr-2 h-5 w-5" name="loader"></c-icon>
48
48
  <c-icon
@@ -7,7 +7,7 @@
7
7
  {{ label }}
8
8
  </label>
9
9
  <!-- asterisk sign to render if field is required -->
10
- <p v-if="isRequired" class="text-red-600 ml-1">*</p>
10
+ <p v-if="isRequired" class="ml-1 text-red-600">*</p>
11
11
  </div>
12
12
  <!-- hint on the right side of input field -->
13
13
  <span v-if="hint" class="text-sm text-gray-500">{{ hint }}</span>
@@ -20,17 +20,18 @@
20
20
  @blur="$emit('blur', $event.target.value)"
21
21
  @focus="$emit('focus', $event.target.value)"
22
22
  :class="errorClasses"
23
- class="shadow-sm focus:ring-indigo-500 focus:border-indigo-500 flex-1 block w-full px-3 py-2 rounded-md sm:text-sm disabled:opacity-50 text-gray-900"
23
+ 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"
24
24
  :placeholder="placeholder"
25
25
  :disabled="disabled"
26
26
  />
27
27
  <!-- to render to show validation is failed -->
28
28
  <div
29
- v-if="!isValidate"
30
- class="absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none text-red-600"
29
+ v-if="!isValidate && !customIcon"
30
+ class="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-red-600"
31
31
  >
32
32
  <c-icon name="exclamation-circle" type="solid" class="h-5 w-5"></c-icon>
33
33
  </div>
34
+ <slot name="customIcon" v-if="customIcon"></slot>
34
35
  </div>
35
36
  <!-- validation error message -->
36
37
  <p v-if="!isValidate" class="mt-2 text-sm text-red-600">
@@ -86,6 +87,10 @@ export default {
86
87
  type: String,
87
88
  default: "text",
88
89
  },
90
+ customIcon: {
91
+ type: Boolean,
92
+ default: false,
93
+ },
89
94
  },
90
95
  computed: {
91
96
  errorClasses() {
@@ -2,7 +2,7 @@
2
2
  <div class="flex h-full flex-col">
3
3
  <div class="flex items-center justify-between">
4
4
  <label class="block text-sm font-medium text-gray-900">{{ label }}</label>
5
- <label v-if="isUploaded" class="block text-sm font-medium text-gray-400">
5
+ <label v-if="!isUploaded" class="block text-sm font-medium text-gray-400">
6
6
  {{ hint }}
7
7
  </label>
8
8
  </div>