classcard-ui 0.2.149 → 0.2.153

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.149",
3
+ "version": "0.2.153",
4
4
  "main": "dist/classcard-ui.common.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -5,19 +5,28 @@
5
5
  {{ label }}
6
6
  </label>
7
7
  </div>
8
- <v-date-picker class="inline-block h-full" @input="onDayClick(date)" :value="value">
8
+ <v-date-picker class="inline-block h-full" :masks="masks" @input="onDayClick" :value="value">
9
9
  <template v-slot="{ inputValue, togglePopover }">
10
- <div class="flex items-center">
10
+ <div class="flex items-center mt-1">
11
11
  <button
12
- class="p-2 bg-blue-100 border border-blue-200 hover:bg-blue-200 text-blue-600 rounded-l-md focus:bg-blue-500 focus:text-white focus:border-blue-500 focus:outline-none"
12
+ :class="[
13
+ disabled ? 'border-gray-100 pointer-events-none' : 'border-gray-300',
14
+ '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',
15
+ ]"
13
16
  @click="togglePopover()"
14
17
  >
15
- <c-icon name="calendar-solid" class="h-5 w-5 text-gray-400" type="solid"></c-icon>
18
+ <c-icon
19
+ name="calendar-solid"
20
+ :class="[disabled ? 'text-gray-200' : 'text-gray-400', 'h-5 w-5 ']"
21
+ type="solid"
22
+ ></c-icon>
16
23
  </button>
17
24
  <input
18
25
  :value="inputValue"
19
- class="bg-white text-gray-700 w-full p-2 appearance-none border rounded-r-md focus:outline-none focus:border-blue-500 text-sm"
20
- readonly
26
+ :class="[
27
+ disabled ? 'border-gray-100' : 'border-gray-300',
28
+ 'bg-white text-gray-700 w-full p-2 appearance-none border rounded-r-md focus:outline-none focus:border-blue-500 text-sm',
29
+ ]"
21
30
  />
22
31
  </div>
23
32
  </template>
@@ -49,12 +58,24 @@ export default {
49
58
  type: String,
50
59
  },
51
60
  value: {
52
- type: String,
61
+ type: [String, Date, Array],
62
+ },
63
+ disabled: {
64
+ type: Boolean,
65
+ default: false,
53
66
  },
54
67
  },
68
+ data() {
69
+ const masks = {
70
+ input: ["YYYY/MM/DD", "MMM DD, YYYY", "DD-MM-YYYY", "DD/MM/YYYY", "YYYY-MM-DD", "L"],
71
+ };
72
+ return {
73
+ masks,
74
+ };
75
+ },
55
76
  methods: {
56
- onDayClick(value) {
57
- this.$emit("input", value);
77
+ onDayClick(date) {
78
+ this.$emit("input", date);
58
79
  },
59
80
  },
60
81
  };
@@ -4,12 +4,17 @@
4
4
  <p class="text-sm text-gray-900">{{ label }}</p>
5
5
  <p class="text-sm text-gray-500" v-if="hint">{{ hint }}</p>
6
6
  </div>
7
- <quill-editor class="mt-1" :content="content" :options="editorOption"></quill-editor>
7
+ <quill-editor
8
+ class="mt-1"
9
+ v-model="editorText"
10
+ :options="editorOption"
11
+ @change="onChange($event)"
12
+ ></quill-editor>
8
13
  <p v-if="helpText" class="mt-2 text-sm text-gray-500">
9
14
  {{ helpText }}
10
15
  </p>
11
- </div></template
12
- >
16
+ </div>
17
+ </template>
13
18
  <script>
14
19
  import "quill/dist/quill.core.css";
15
20
  import "quill/dist/quill.snow.css";
@@ -22,7 +27,7 @@ export default {
22
27
  content: {
23
28
  type: String,
24
29
  },
25
- label: {
30
+ label: {
26
31
  type: String,
27
32
  },
28
33
  hint: {
@@ -34,6 +39,9 @@ export default {
34
39
  toolbarOptions: {
35
40
  type: Array,
36
41
  },
42
+ onEditorChange: {
43
+ type: Function,
44
+ },
37
45
  },
38
46
  data() {
39
47
  return {
@@ -44,8 +52,19 @@ export default {
44
52
  },
45
53
  },
46
54
  },
55
+ editorText: this.content,
47
56
  };
48
57
  },
58
+ methods: {
59
+ onChange(params) {
60
+ this.$emit("onEditorChange", params);
61
+ },
62
+ },
63
+ watch: {
64
+ content() {
65
+ this.editorText = this.content;
66
+ },
67
+ },
49
68
  };
50
69
  </script>
51
70
  <style>
@@ -25,4 +25,5 @@ Default.args = {
25
25
  label: "Date",
26
26
  helpText: "Description",
27
27
  value: new Date(),
28
+ disabled: false,
28
29
  };