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/dist/classcard-ui.common.js +105 -61
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.umd.js +105 -61
- package/dist/classcard-ui.umd.js.map +1 -1
- package/dist/classcard-ui.umd.min.js +1 -1
- package/dist/classcard-ui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CDatepicker/CDatepicker.vue +30 -9
- package/src/components/CEditor/CEditor.vue +23 -4
- package/src/stories/CDatepicker.stories.js +1 -0
package/package.json
CHANGED
|
@@ -5,19 +5,28 @@
|
|
|
5
5
|
{{ label }}
|
|
6
6
|
</label>
|
|
7
7
|
</div>
|
|
8
|
-
<v-date-picker class="inline-block h-full" @input="onDayClick
|
|
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="
|
|
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
|
|
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="
|
|
20
|
-
|
|
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(
|
|
57
|
-
this.$emit("input",
|
|
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
|
|
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
|
|
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>
|