classcard-ui 0.2.257 → 0.2.261

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.257",
3
+ "version": "0.2.261",
4
4
  "main": "dist/classcard-ui.common.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -6,7 +6,7 @@
6
6
  </div>
7
7
  <quill-editor
8
8
  class="mt-1 text-sm"
9
- v-model="editorText"
9
+ :value="content"
10
10
  :options="editorOption"
11
11
  @change="onChange($event)"
12
12
  ></quill-editor>
@@ -42,27 +42,25 @@ export default {
42
42
  onEditorChange: {
43
43
  type: Function,
44
44
  },
45
- },
46
- data() {
47
- return {
48
- editorOption: {
49
- modules: {
50
- toolbar: {
51
- container: this.toolbarOptions,
52
- },
53
- },
54
- },
55
- editorText: this.content,
56
- };
45
+ placeholder: {
46
+ type: String,
47
+ },
57
48
  },
58
49
  methods: {
59
50
  onChange(params) {
60
51
  this.$emit("onEditorChange", params);
61
52
  },
62
53
  },
63
- watch: {
64
- content() {
65
- this.editorText = this.content;
54
+ computed: {
55
+ editorOption() {
56
+ return {
57
+ modules: {
58
+ toolbar: {
59
+ container: this.toolbarOptions,
60
+ },
61
+ },
62
+ placeholder: this.placeholder,
63
+ };
66
64
  },
67
65
  },
68
66
  };
@@ -82,4 +80,7 @@ export default {
82
80
  .ql-editor {
83
81
  @apply text-sm text-gray-900;
84
82
  }
83
+ .ql-editor.ql-blank::before {
84
+ @apply text-gray-500 not-italic;
85
+ }
85
86
  </style>
@@ -145,6 +145,9 @@
145
145
  <!-- More items... -->
146
146
  </ul>
147
147
  </div>
148
+ <p v-if="isError" class="mt-2 text-sm text-red-600">
149
+ {{ errorMessage }}
150
+ </p>
148
151
  </div>
149
152
  </template>
150
153
 
@@ -159,6 +162,11 @@ export default {
159
162
  value: Object,
160
163
  placeholder: String,
161
164
  isSearching: Boolean,
165
+ isError: { type: Boolean, default: false },
166
+ errorMessage: {
167
+ type: String,
168
+ default: "This field cannot be empty",
169
+ },
162
170
  },
163
171
  data() {
164
172
  return {
@@ -208,7 +208,7 @@ export default {
208
208
  @apply rounded-b-md;
209
209
  }
210
210
  .vs__selected {
211
- @apply border-none m-0 py-0 px-1.5 mr-1;
211
+ @apply border-none m-0 py-0 pl-0 pr-1.5 mr-1;
212
212
  }
213
213
  .vs__search,
214
214
  .vs__search:focus {
@@ -26,4 +26,5 @@ Default.args = {
26
26
  hint: "String",
27
27
  helpText: "String",
28
28
  toolbarOptions: ["bold", "italic"],
29
+ placeholder: "Please enter your text here...",
29
30
  };