classcard-ui 0.2.317 → 0.2.320

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.317",
3
+ "version": "0.2.320",
4
4
  "main": "dist/classcard-ui.common.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -12,7 +12,7 @@
12
12
  :class="errorClasses"
13
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
14
  :placeholder="placeholder"
15
- v-model="email"
15
+ :value="email"
16
16
  @blur="checkValidation"
17
17
  @input="$emit('input', $event.target.value)"
18
18
  />
@@ -47,10 +47,14 @@ export default {
47
47
  helpText: {
48
48
  type: String,
49
49
  },
50
+ // v-model of the field
51
+ value: {
52
+ type: String,
53
+ },
50
54
  },
51
55
  data() {
52
56
  return {
53
- email: "",
57
+ email: this.value,
54
58
  isValidate: false,
55
59
  };
56
60
  },
@@ -71,5 +75,10 @@ export default {
71
75
  : true;
72
76
  },
73
77
  },
78
+ watch: {
79
+ value() {
80
+ this.email = this.value;
81
+ },
82
+ },
74
83
  };
75
84
  </script>
@@ -1,6 +1,14 @@
1
1
  <template>
2
2
  <div>
3
- <div v-if="type === 'filestack'" :class="filestackClasses" id="filestack-uploader"></div>
3
+ <button
4
+ type="button"
5
+ class="inline-flex items-center px-3 py-2 border border-gray-300 shadow-sm text-sm leading-4 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
6
+ @click="initFilestack()"
7
+ v-if="displayMode == 'overlay'"
8
+ >
9
+ Upload
10
+ </button>
11
+ <div :class="filestackClasses" id="filestack-uploader"></div>
4
12
  <p v-if="!isValidate" class="mt-2 text-sm text-red-600">
5
13
  {{ errorMessage }}
6
14
  </p>
@@ -27,10 +35,6 @@ export default {
27
35
  errorMessage: {
28
36
  type: String,
29
37
  },
30
- type: {
31
- type: String,
32
- default: "default",
33
- },
34
38
  filestackApiKey: {
35
39
  type: String,
36
40
  default: "",
@@ -53,17 +57,20 @@ export default {
53
57
  type: Number,
54
58
  default: null,
55
59
  },
60
+ displayMode: {
61
+ type: String,
62
+ default: "inline",
63
+ },
56
64
  },
57
65
  data() {
58
66
  return {
59
- uploader: null,
60
67
  };
61
68
  },
62
69
  methods: {
63
70
  initFilestack() {
64
71
  const client = filestack.init(this.filestackApiKey);
65
72
  const options = {
66
- displayMode: "inline",
73
+ displayMode: this.displayMode,
67
74
  container: "#filestack-uploader",
68
75
  uploadInBackground: false,
69
76
  maxFiles: this.maxFiles,
@@ -93,7 +100,7 @@ export default {
93
100
  },
94
101
  },
95
102
  mounted() {
96
- if (this.type === "filestack") {
103
+ if (this.displayMode == "inline") {
97
104
  this.initFilestack();
98
105
  }
99
106
  },