classcard-ui 0.2.301 → 0.2.305

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.301",
3
+ "version": "0.2.305",
4
4
  "main": "dist/classcard-ui.common.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -25,7 +25,6 @@
25
25
  "gridjs-selection": "^3.4.0",
26
26
  "gridjs-vue": "^3.4.0",
27
27
  "lodash-es": "^4.17.21",
28
- "uppload": "^3.2.1",
29
28
  "v-calendar": "^2.3.2",
30
29
  "vue": "^2.6.14",
31
30
  "vue-good-table": "^2.21.8",
@@ -1,9 +1,13 @@
1
1
  <template>
2
2
  <div>
3
- <div v-if="label">
4
- <label class="block text-sm font-medium text-gray-900">
5
- {{ label }}
6
- </label>
3
+ <div class="flex items-center">
4
+ <div v-if="label">
5
+ <label class="block text-sm font-medium text-gray-900">
6
+ {{ label }}
7
+ </label>
8
+ </div>
9
+ <!-- asterisk sign to render if field is required -->
10
+ <p v-if="isRequired" class="ml-1 text-red-600">*</p>
7
11
  </div>
8
12
  <v-date-picker
9
13
  :class="{ 'inline-block h-full': true, 'w-full': isExpanded }"
@@ -14,12 +18,12 @@
14
18
  firstDayOfWeek="2"
15
19
  >
16
20
  <template v-slot="{ inputValue, togglePopover }">
17
- <div class="flex items-center mt-1">
21
+ <div class="mt-1 flex items-center">
18
22
  <button
19
23
  type="button"
20
24
  :class="[
21
- disabled ? 'border-gray-100 pointer-events-none' : 'border-gray-300',
22
- 'shadow-sm p-2 bg-blue-100 border hover:bg-blue-200 text-blue-600 rounded-l-md focus:bg-blue-500 focus:text-white focus:border-blue-500 focus:outline-none',
25
+ disabled ? 'pointer-events-none border-gray-100' : 'border-gray-300',
26
+ 'bg-blue-100 hover:bg-blue-200 text-blue-600 focus:bg-blue-500 focus:border-blue-500 focus:outline-none rounded-l-md border p-2 shadow-sm focus:text-white',
23
27
  ]"
24
28
  @click="togglePopover()"
25
29
  >
@@ -33,9 +37,9 @@
33
37
  :value="inputValue"
34
38
  :class="[
35
39
  disabled
36
- ? 'border-gray-100 border-l-0 text-gray-400'
37
- : 'border-gray-300 border-l-0 text-gray-900',
38
- 'shadow-sm bg-white w-full p-2 appearance-none border rounded-r-md focus:outline-none focus:border-blue-500 text-sm',
40
+ ? 'border-l-0 border-gray-100 text-gray-400'
41
+ : 'border-l-0 border-gray-300 text-gray-900',
42
+ 'focus:outline-none focus:border-blue-500 w-full appearance-none rounded-r-md border bg-white p-2 text-sm shadow-sm',
39
43
  ]"
40
44
  :readonly="disabled"
41
45
  @click="togglePopover()"
@@ -43,7 +47,11 @@
43
47
  </div>
44
48
  </template>
45
49
  </v-date-picker>
46
- <p v-if="helpText" class="mt-1 text-sm text-gray-500">
50
+ <!-- validation error message -->
51
+ <p v-if="!isValidate" class="mt-2 text-sm text-red-600">
52
+ {{ errorMessage }}
53
+ </p>
54
+ <p v-if="helpText && isValidate == true" class="mt-1 text-sm text-gray-500">
47
55
  {{ helpText }}
48
56
  </p>
49
57
  </div>
@@ -63,6 +71,9 @@ export default {
63
71
  classes: {
64
72
  type: String,
65
73
  },
74
+ isRequired: {
75
+ type: Boolean,
76
+ },
66
77
  label: {
67
78
  type: String,
68
79
  },
@@ -84,6 +95,13 @@ export default {
84
95
  type: Boolean,
85
96
  default: false,
86
97
  },
98
+ isValidate: {
99
+ type: Boolean,
100
+ default: true,
101
+ },
102
+ errorMessage: {
103
+ type: String,
104
+ },
87
105
  },
88
106
  data() {
89
107
  const masks = {
@@ -1,11 +1,13 @@
1
1
  <template>
2
2
  <div>
3
- <label v-if="label" class="text-sm font-medium text-gray-900">{{
4
- label
5
- }}</label>
3
+ <div class="flex items-center">
4
+ <label v-if="label" class="text-sm font-medium text-gray-900">{{ label }}</label>
5
+ <!-- asterisk sign to render if field is required -->
6
+ <p v-if="isRequired" class="ml-1 text-red-600">*</p>
7
+ </div>
6
8
  <p v-if="subLabel" class="text-sm text-gray-500">{{ subLabel }}</p>
7
9
  <v-select
8
- class="text-sm mt-1"
10
+ class="mt-1 text-sm"
9
11
  :placeholder="placeholder"
10
12
  :multiple="isMultiple"
11
13
  :taggable="isTaggable"
@@ -24,7 +26,7 @@
24
26
  <span v-bind="attributes">
25
27
  <svg
26
28
  xmlns="http://www.w3.org/2000/svg"
27
- class="h-5 w-5 text-gray-400 cursor-pointer"
29
+ class="h-5 w-5 cursor-pointer text-gray-400"
28
30
  viewBox="0 0 20 20"
29
31
  fill="currentColor"
30
32
  >
@@ -38,14 +40,12 @@
38
40
  </template>
39
41
  <!-- eslint-disable-next-line vue/no-unused-vars -->
40
42
  <template #no-options="{ search, searching, loading }">
41
- <span v-if="search.length < 1"
42
- >Start typing to search for options...</span
43
- >
43
+ <span v-if="search.length < 1">Start typing to search for options...</span>
44
44
  <span v-else>No options found, try searching something else.</span>
45
45
  </template>
46
46
  <template #spinner="{ loading }">
47
47
  <svg
48
- class="animate-spin h-5 w-5 text-gray-400"
48
+ class="h-5 w-5 animate-spin text-gray-400"
49
49
  xmlns="http://www.w3.org/2000/svg"
50
50
  fill="none"
51
51
  viewBox="0 0 24 24"
@@ -108,6 +108,9 @@ export default {
108
108
  required: true,
109
109
  },
110
110
  label: String,
111
+ isRequired: {
112
+ type: Boolean,
113
+ },
111
114
  subLabel: String,
112
115
  placeholder: {
113
116
  type: String,
@@ -145,7 +148,7 @@ export default {
145
148
  type: Function,
146
149
  },
147
150
  optionsSelected: {
148
- type: Array,
151
+ type: [Array, Object],
149
152
  },
150
153
  filterable: {
151
154
  type: Boolean,
@@ -171,10 +174,7 @@ export default {
171
174
  data() {
172
175
  return {
173
176
  loaderSearching: true,
174
- value:
175
- this.optionsSelected && this.optionsSelected.length
176
- ? this.optionsSelected
177
- : [],
177
+ value: this.optionsSelected && this.optionsSelected.length ? this.optionsSelected : [],
178
178
  };
179
179
  },
180
180
  methods: {
@@ -198,17 +198,17 @@ export default {
198
198
  @apply cursor-pointer;
199
199
  }
200
200
  .vs__dropdown-toggle {
201
- @apply bg-white w-full border border-gray-300 rounded-md shadow-sm pl-3 py-2 text-left focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm;
201
+ @apply focus:outline-none w-full rounded-md border border-gray-300 bg-white py-2 pl-3 text-left shadow-sm focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 sm:text-sm;
202
202
  }
203
203
  .vs__selected-options {
204
- @apply overflow-hidden flex-nowrap;
204
+ @apply flex-nowrap overflow-hidden;
205
205
  }
206
206
  .vs--open .vs__dropdown-toggle {
207
207
  border-bottom-color: rgba(212, 212, 216, var(--tw-border-opacity));
208
208
  @apply rounded-b-md;
209
209
  }
210
210
  .vs__selected {
211
- @apply border-none m-0 py-0 pl-0 pr-1.5 mr-1;
211
+ @apply m-0 mr-1 border-none py-0 pl-0 pr-1.5;
212
212
  }
213
213
  .vs__selected-options {
214
214
  @apply pl-0;
@@ -221,7 +221,7 @@ export default {
221
221
  @apply pt-0 pr-3;
222
222
  }
223
223
  .vs__dropdown-menu {
224
- @apply mt-2 bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-opacity-5 overflow-auto focus:outline-none sm:text-sm;
224
+ @apply focus:outline-none mt-2 max-h-60 overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-opacity-5 sm:text-sm;
225
225
  }
226
226
  .vs__dropdown-option {
227
227
  @apply py-2;
@@ -1,16 +1,5 @@
1
1
  <template>
2
2
  <div>
3
- <div v-if="type === 'default'">
4
- <slot></slot>
5
- <div :class="errorClasses" class="" id="c-file-area" @click.prevent="uploader.open()">
6
- <button
7
- type="white"
8
- class="pic-btn inline-flex items-center px-4 py-2 shadow-sm text-sm font-medium rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 text-gray-700 border bg-white border-gray-300 hover:bg-gray-50 focus:ring-indigo-600"
9
- >
10
- {{ buttonText }}
11
- </button>
12
- </div>
13
- </div>
14
3
  <div v-if="type === 'filestack'" :class="filestackClasses" id="filestack-uploader"></div>
15
4
  <p v-if="!isValidate" class="mt-2 text-sm text-red-600">
16
5
  {{ errorMessage }}
@@ -20,7 +9,6 @@
20
9
 
21
10
  <script>
22
11
  import * as filestack from "filestack-js";
23
- import { Uppload, Local, xhrUploader, en, Crop, Unsplash } from "uppload";
24
12
 
25
13
  export default {
26
14
  name: "CUpload",
@@ -90,33 +78,6 @@ export default {
90
78
  const picker = client.picker(options);
91
79
  picker.open();
92
80
  },
93
- initUppload() {
94
- // Uppload library
95
- this.uploader = new Uppload({
96
- lang: en,
97
- compression: 0.4,
98
- compressionToMime: "image/jpeg",
99
- maxSize: [500, 1000],
100
- uploader: xhrUploader({
101
- endpoint: `${this.url}`,
102
- fileKeyName: "image",
103
- responseFunction: (response) => {
104
- this.$emit("onUploadSuccess", response);
105
- },
106
- }),
107
- });
108
- this.uploader.use([
109
- new Local(),
110
- ...(this.includeUnsplash
111
- ? [new Unsplash("hXfo-C0svXV4IDCncBo7s-ySQpVJVeZrGuWxwwgC7qw")]
112
- : []),
113
- ...(this.cropImage ? [new Crop({ aspectRatio: this.aspectRatioDimensions })] : []),
114
- ]);
115
- // Uppload Error Handle
116
- this.uploader.on("error", (error) => {
117
- console.log("The error message is", error);
118
- });
119
- },
120
81
  },
121
82
  computed: {
122
83
  errorClasses() {
package/src/icons.js CHANGED
@@ -202,5 +202,13 @@ export default {
202
202
  "clipboard-check-outline":
203
203
  "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4",
204
204
  "home":
205
- "M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"
205
+ "M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z",
206
+ "archive":
207
+ "M4 3a2 2 0 100 4h12a2 2 0 100-4H4z M3 8h14v7a2 2 0 01-2 2H5a2 2 0 01-2-2V8zm5 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z",
208
+ "printer":
209
+ "M5 4v3H4a2 2 0 00-2 2v3a2 2 0 002 2h1v2a2 2 0 002 2h6a2 2 0 002-2v-2h1a2 2 0 002-2V9a2 2 0 00-2-2h-1V4a2 2 0 00-2-2H7a2 2 0 00-2 2zm8 0H7v3h6V4zm0 8H7v4h6v-4z",
210
+ "user-circle":
211
+ "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-6-3a2 2 0 11-4 0 2 2 0 014 0zm-2 4a5 5 0 00-4.546 2.916A5.986 5.986 0 0010 16a5.986 5.986 0 004.546-2.084A5 5 0 0010 11z",
212
+ "key":
213
+ "M18 8a6 6 0 01-7.743 5.743L10 14l-1 1-1 1H6v2H2v-4l4.257-4.257A6 6 0 1118 8zm-6-4a1 1 0 100 2 2 2 0 012 2 1 1 0 102 0 4 4 0 00-4-4z"
206
214
  };