classcard-ui 0.2.1069 → 0.2.1070
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/README.md +24 -24
- package/dist/classcard-ui.common.js +56 -53
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.umd.js +56 -53
- 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 +82 -82
- package/src/App.vue +16 -16
- package/src/components/CAlerts/CAlerts.vue +70 -70
- package/src/components/CAlerts/index.js +2 -2
- package/src/components/CAnchorTabs/CAnchorTabs.vue +96 -96
- package/src/components/CAnchorTabs/index.js +2 -2
- package/src/components/CAnchorTag/CAnchorTag.vue +62 -62
- package/src/components/CAnchorTag/index.js +2 -2
- package/src/components/CAvatar/CAvatar.vue +212 -212
- package/src/components/CAvatar/index.js +2 -2
- package/src/components/CAvatarGroup/CAvatarGroup.vue +145 -145
- package/src/components/CAvatarGroup/index.js +2 -2
- package/src/components/CBasicTable/CBasicTable.vue +184 -184
- package/src/components/CBasicTable/index.js +2 -2
- package/src/components/CBreadcrumbs/CBreadcrumbs.vue +38 -38
- package/src/components/CBreadcrumbs/index.js +2 -2
- package/src/components/CButton/CButton.vue +152 -152
- package/src/components/CButton/index.js +2 -2
- package/src/components/CButtonGroup/CButtonGroup.vue +118 -118
- package/src/components/CButtonGroup/index.js +2 -2
- package/src/components/CButtonIcon/CButtonIcon.vue +117 -117
- package/src/components/CButtonIcon/index.js +2 -2
- package/src/components/CButtonLink/CButtonLink.vue +39 -39
- package/src/components/CButtonLink/index.js +2 -2
- package/src/components/CButtonSelect/CButtonSelect.vue +134 -134
- package/src/components/CButtonSelect/index.js +2 -2
- package/src/components/CButtonSelectBorder/CButtonSelectBorder.vue +135 -135
- package/src/components/CButtonSelectBorder/index.js +3 -3
- package/src/components/CButtonWithDropdown/CButtonWithDropdown.vue +135 -135
- package/src/components/CButtonWithDropdown/index.js +2 -2
- package/src/components/CCalendar/CCalendar.vue +410 -410
- package/src/components/CCalendar/index.js +3 -3
- package/src/components/CCard/CCard.vue +49 -49
- package/src/components/CCard/index.js +2 -2
- package/src/components/CCheckbox/CCheckbox.vue +123 -123
- package/src/components/CCheckbox/index.js +2 -2
- package/src/components/CCircularButton/CCircularButton.vue +53 -53
- package/src/components/CCircularButton/index.js +2 -2
- package/src/components/CCollapsibleSection/CCollapsibleSection.vue +101 -101
- package/src/components/CCollapsibleSection/index.js +2 -2
- package/src/components/CColorDots/CColorDots.vue +51 -51
- package/src/components/CColorDots/index.js +3 -3
- package/src/components/CConfirmActionModal/CConfirmActionModal.vue +180 -180
- package/src/components/CConfirmActionModal/index.js +3 -3
- package/src/components/CDatepicker/CDatepicker.vue +201 -201
- package/src/components/CDatepicker/index.js +2 -2
- package/src/components/CDualSelect/CDualSelect.vue +193 -193
- package/src/components/CDualSelect/index.js +2 -2
- package/src/components/CEditor/CEditor.vue +98 -98
- package/src/components/CEditor/index.js +2 -2
- package/src/components/CFormSectionHeading/CFormSectionHeading.vue +53 -53
- package/src/components/CFormSectionHeading/index.js +2 -2
- package/src/components/CGroupedSelect/CGroupedSelect.vue +245 -245
- package/src/components/CGroupedSelect/index.js +3 -3
- package/src/components/CIcon/CIcon.vue +91 -91
- package/src/components/CIcon/index.js +2 -2
- package/src/components/CIconDropdown/CIconDropdown.vue +146 -146
- package/src/components/CIconDropdown/index.js +2 -2
- package/src/components/CInput/CInput.vue +134 -134
- package/src/components/CInput/index.js +2 -2
- package/src/components/CInputAddon/CInputAddon.vue +228 -228
- package/src/components/CInputAddon/index.js +2 -2
- package/src/components/CInputEmail/CInputEmail.vue +93 -93
- package/src/components/CInputEmail/index.js +2 -2
- package/src/components/CInsetTabs/CInsetTabs.vue +88 -88
- package/src/components/CInsetTabs/index.js +3 -3
- package/src/components/CModalHeading/CModalHeading.vue +22 -22
- package/src/components/CModalHeading/index.js +2 -2
- package/src/components/CModuleHelpLinks/CModuleHelpLinks.vue +70 -70
- package/src/components/CModuleHelpLinks/index.js +3 -3
- package/src/components/CMultiselect/CMultiselect.vue +615 -615
- package/src/components/CMultiselect/index.js +2 -2
- package/src/components/CMultiselectr/CMultiselectr.vue +44 -44
- package/src/components/CMultiselectr/index.js +2 -2
- package/src/components/CPageHeading/CPageHeading.vue +56 -56
- package/src/components/CPageHeading/index.js +2 -2
- package/src/components/CPagination/CPagination.vue +233 -233
- package/src/components/CPagination/index.js +2 -2
- package/src/components/CPhoneNumber/CPhoneNumber.vue +114 -114
- package/src/components/CPhoneNumber/index.js +2 -2
- package/src/components/CProgress/CProgress.vue +57 -57
- package/src/components/CProgress/index.js +2 -2
- package/src/components/CRadio/CRadio.vue +126 -126
- package/src/components/CRadio/index.js +2 -2
- package/src/components/CRangeSlider/CRangeSlider.vue +55 -55
- package/src/components/CRangeSlider/index.js +2 -2
- package/src/components/CReorderableStackedList/CReorderableStackedList.vue +94 -94
- package/src/components/CReorderableStackedList/index.js +2 -2
- package/src/components/CSelect/CSelect.vue +539 -539
- package/src/components/CSelect/index.js +2 -2
- package/src/components/CSmallTimeline/CSmallTimeline.vue +40 -40
- package/src/components/CSmallTimeline/index.js +2 -2
- package/src/components/CStackedList/CStackedList.vue +150 -150
- package/src/components/CStackedList/index.js +2 -2
- package/src/components/CStats/CStats.vue +116 -116
- package/src/components/CStats/index.js +2 -2
- package/src/components/CSwitch/CSwitch.vue +176 -176
- package/src/components/CSwitch/index.js +2 -2
- package/src/components/CTabLazy/CTabLazy.vue +63 -63
- package/src/components/CTabLazy/index.js +2 -2
- package/src/components/CTable/CTable.vue +671 -671
- package/src/components/CTable/index.js +2 -2
- package/src/components/CTabs/CTabs.vue +169 -169
- package/src/components/CTabs/index.js +2 -2
- package/src/components/CTag/CTag.vue +59 -59
- package/src/components/CTag/index.js +2 -2
- package/src/components/CTextarea/CTextarea.vue +107 -107
- package/src/components/CTextarea/index.js +2 -2
- package/src/components/CTimeline/CTimeline.vue +237 -237
- package/src/components/CTimeline/index.js +2 -2
- package/src/components/CUpload/CUpload.vue +267 -267
- package/src/components/CUpload/index.js +2 -2
- package/src/components/index.js +53 -53
- package/src/icons.js +459 -453
- package/src/main.js +22 -22
- package/src/stories/CAlerts.stories.js +37 -37
- package/src/stories/CAnchorTabs.stories.js +29 -29
- package/src/stories/CAnchorTag.stories.js +36 -36
- package/src/stories/CAvatar.stories.js +38 -38
- package/src/stories/CAvatarGroup.stories.js +100 -100
- package/src/stories/CBasicTable.stories.js +316 -316
- package/src/stories/CBreadcrumbs.stories.js +24 -24
- package/src/stories/CButton.stories.js +47 -47
- package/src/stories/CButtonGroup.stories.js +33 -33
- package/src/stories/CButtonIcon.stories.js +27 -27
- package/src/stories/CButtonLink.stories.js +24 -24
- package/src/stories/CButtonSelect.stories.js +41 -41
- package/src/stories/CButtonSelectBorder.stories.js +48 -48
- package/src/stories/CButtonWithDropdown.stories.js +41 -41
- package/src/stories/CCalendar.stories.js +16 -16
- package/src/stories/CCard.stories.js +30 -30
- package/src/stories/CCheckbox.stories.js +29 -29
- package/src/stories/CCircularButton.stories.js +29 -29
- package/src/stories/CCollapsibleSection.stories.js +28 -28
- package/src/stories/CColorDots.stories.js +28 -28
- package/src/stories/CConfirmActionModal.stories.js +59 -59
- package/src/stories/CDatepicker.stories.js +30 -30
- package/src/stories/CDualSelect.stories.js +29 -29
- package/src/stories/CEditor.stories.js +30 -30
- package/src/stories/CFormSectionHeading.stories.js +34 -34
- package/src/stories/CGroupedSelect.stories.js +71 -71
- package/src/stories/CIcon.stories.js +28 -28
- package/src/stories/CIconDropdown.stories.js +45 -45
- package/src/stories/CInput.stories.js +36 -36
- package/src/stories/CInputAddon.stories.js +37 -37
- package/src/stories/CInputEmail.stories.js +27 -27
- package/src/stories/CInsetTabs.stories.js +38 -38
- package/src/stories/CModalHeading.stories.js +25 -25
- package/src/stories/CModuleHelpLinks.stories.js +25 -25
- package/src/stories/CMultiselect.stories.js +167 -167
- package/src/stories/CMultiselectr.stories.js +23 -23
- package/src/stories/CPageHeading.stories.js +32 -32
- package/src/stories/CPagination.stories.js +30 -30
- package/src/stories/CPhoneNumber.stories.js +29 -29
- package/src/stories/CProgress.stories.js +23 -23
- package/src/stories/CRadio.stories.js +36 -36
- package/src/stories/CRangeSlider.stories.js +23 -23
- package/src/stories/CReorderableStackedList.stories.js +23 -23
- package/src/stories/CSelect.stories.js +109 -109
- package/src/stories/CSmallTimeline.stories.js +26 -26
- package/src/stories/CStackedList.stories.js +37 -37
- package/src/stories/CStats.stories.js +33 -33
- package/src/stories/CSwitch.stories.js +28 -28
- package/src/stories/CTabLazy.stories.js +26 -26
- package/src/stories/CTable.stories.js +169 -169
- package/src/stories/CTabs.stories.js +36 -36
- package/src/stories/CTag.stories.js +34 -34
- package/src/stories/CTextarea.stories.js +32 -32
- package/src/stories/CTimeline.stories.js +26 -26
- package/src/stories/CUpload.stories.js +36 -36
- package/src/stories/Introduction.stories.mdx +207 -207
- package/src/stories/Page.vue +88 -88
- package/src/stories/assets/code-brackets.svg +0 -0
- package/src/stories/assets/colors.svg +0 -0
- package/src/stories/assets/comments.svg +0 -0
- package/src/stories/assets/direction.svg +0 -0
- package/src/stories/assets/flow.svg +0 -0
- package/src/stories/assets/plugin.svg +0 -0
- package/src/stories/assets/repo.svg +0 -0
- package/src/stories/assets/stackalt.svg +0 -0
- package/src/stories/header.css +26 -26
- package/src/stories/page.css +69 -69
- package/src/stories/utils.css +17 -17
|
@@ -1,201 +1,201 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
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>
|
|
11
|
-
</div>
|
|
12
|
-
<v-date-picker
|
|
13
|
-
:class="{
|
|
14
|
-
'inline-block h-full': true,
|
|
15
|
-
'w-full': isExpanded,
|
|
16
|
-
}"
|
|
17
|
-
:masks="masks"
|
|
18
|
-
@input="onDayClick"
|
|
19
|
-
:value="value"
|
|
20
|
-
:popover="popoverPlacement"
|
|
21
|
-
:min-date="minDate"
|
|
22
|
-
:max-date="maxDate"
|
|
23
|
-
:attributes="attrs"
|
|
24
|
-
:first-day-of-week="firstDayOfWeek"
|
|
25
|
-
:is-required="isDatePickerRequired"
|
|
26
|
-
>
|
|
27
|
-
<template v-slot="{ inputValue, togglePopover }">
|
|
28
|
-
<div v-if="showOnlyDatePickerIcon">
|
|
29
|
-
<button
|
|
30
|
-
type="button"
|
|
31
|
-
class="relative flex h-9 w-9 cursor-pointer items-center justify-center rounded focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
|
|
32
|
-
@click="togglePopover()"
|
|
33
|
-
>
|
|
34
|
-
<c-icon
|
|
35
|
-
name="calendar-solid"
|
|
36
|
-
:class="[
|
|
37
|
-
disabled ? 'text-gray-200' : 'text-gray-400',
|
|
38
|
-
'flex h-5 w-5 justify-center ',
|
|
39
|
-
]"
|
|
40
|
-
type="solid"
|
|
41
|
-
></c-icon>
|
|
42
|
-
</button>
|
|
43
|
-
</div>
|
|
44
|
-
<div :class="`${isCustom ? '' : 'mt-1'} flex items-center`" v-else>
|
|
45
|
-
<button
|
|
46
|
-
type="button"
|
|
47
|
-
:class="[
|
|
48
|
-
disabled
|
|
49
|
-
? 'pointer-events-none border-gray-100'
|
|
50
|
-
: 'border-gray-300',
|
|
51
|
-
`text-blue-600 focus:outline-none ${
|
|
52
|
-
isCustom
|
|
53
|
-
? 'border-t border-b py-2 pl-2'
|
|
54
|
-
: 'rounded-l-md border p-2'
|
|
55
|
-
} bg-white shadow-sm focus:text-white`,
|
|
56
|
-
]"
|
|
57
|
-
@click="togglePopover()"
|
|
58
|
-
>
|
|
59
|
-
<c-icon
|
|
60
|
-
name="calendar-solid"
|
|
61
|
-
:class="[
|
|
62
|
-
disabled ? 'text-gray-200' : 'text-gray-400',
|
|
63
|
-
'h-5 w-5 ',
|
|
64
|
-
]"
|
|
65
|
-
type="solid"
|
|
66
|
-
></c-icon>
|
|
67
|
-
</button>
|
|
68
|
-
<input
|
|
69
|
-
:value="inputValue"
|
|
70
|
-
:class="[
|
|
71
|
-
disabled
|
|
72
|
-
? 'pointer-events-none border-l-0 border-gray-100 text-gray-400'
|
|
73
|
-
: 'border-l-0 border-gray-300 text-gray-900',
|
|
74
|
-
'w-full appearance-none rounded-r-md border bg-white p-2 text-sm shadow-sm focus:border-blue-500 focus:outline-none',
|
|
75
|
-
]"
|
|
76
|
-
:readonly="disabled"
|
|
77
|
-
@input="handleInputBoxInput"
|
|
78
|
-
@click="togglePopover()"
|
|
79
|
-
/>
|
|
80
|
-
</div>
|
|
81
|
-
</template>
|
|
82
|
-
</v-date-picker>
|
|
83
|
-
<!-- validation error message -->
|
|
84
|
-
<p v-if="!isValidate" class="mt-2 text-sm text-red-600">
|
|
85
|
-
{{ errorMessage }}
|
|
86
|
-
</p>
|
|
87
|
-
<p v-if="helpText && isValidate == true" class="mt-1 text-sm text-gray-500">
|
|
88
|
-
{{ helpText }}
|
|
89
|
-
</p>
|
|
90
|
-
</div>
|
|
91
|
-
</template>
|
|
92
|
-
<script>
|
|
93
|
-
import CIcon from "../CIcon/CIcon.vue";
|
|
94
|
-
// import Calendar from "v-calendar/lib/components/calendar.umd";
|
|
95
|
-
import VDatePicker from "v-calendar/lib/components/date-picker.umd";
|
|
96
|
-
export default {
|
|
97
|
-
name: "CDatepicker",
|
|
98
|
-
components: {
|
|
99
|
-
// Calendar,
|
|
100
|
-
VDatePicker,
|
|
101
|
-
CIcon,
|
|
102
|
-
},
|
|
103
|
-
props: {
|
|
104
|
-
classes: {
|
|
105
|
-
type: String,
|
|
106
|
-
},
|
|
107
|
-
isRequired: {
|
|
108
|
-
type: Boolean,
|
|
109
|
-
},
|
|
110
|
-
isCustom: {
|
|
111
|
-
type: Boolean,
|
|
112
|
-
},
|
|
113
|
-
label: {
|
|
114
|
-
type: String,
|
|
115
|
-
},
|
|
116
|
-
helpText: {
|
|
117
|
-
type: String,
|
|
118
|
-
},
|
|
119
|
-
value: {
|
|
120
|
-
type: [String, Date, Array],
|
|
121
|
-
},
|
|
122
|
-
disabled: {
|
|
123
|
-
type: Boolean,
|
|
124
|
-
default: false,
|
|
125
|
-
},
|
|
126
|
-
minDate: {
|
|
127
|
-
type: [String, Date],
|
|
128
|
-
default: null,
|
|
129
|
-
},
|
|
130
|
-
maxDate: {
|
|
131
|
-
type: [String, Date],
|
|
132
|
-
default: null,
|
|
133
|
-
},
|
|
134
|
-
isExpanded: {
|
|
135
|
-
type: Boolean,
|
|
136
|
-
default: false,
|
|
137
|
-
},
|
|
138
|
-
isValidate: {
|
|
139
|
-
type: Boolean,
|
|
140
|
-
default: true,
|
|
141
|
-
},
|
|
142
|
-
errorMessage: {
|
|
143
|
-
type: String,
|
|
144
|
-
},
|
|
145
|
-
isDatePickerRequired: {
|
|
146
|
-
type: Boolean,
|
|
147
|
-
default: true,
|
|
148
|
-
},
|
|
149
|
-
showOnlyDatePickerIcon: {
|
|
150
|
-
type: Boolean,
|
|
151
|
-
default: false,
|
|
152
|
-
},
|
|
153
|
-
popoverPlacement: {
|
|
154
|
-
type: Object,
|
|
155
|
-
default() {
|
|
156
|
-
return {
|
|
157
|
-
placement: "bottom-start",
|
|
158
|
-
};
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
firstDayOfWeek: {
|
|
162
|
-
type: String,
|
|
163
|
-
default: "2",
|
|
164
|
-
},
|
|
165
|
-
},
|
|
166
|
-
data() {
|
|
167
|
-
const masks = {
|
|
168
|
-
input: [
|
|
169
|
-
"MMM DD, YYYY",
|
|
170
|
-
"YYYY/MM/DD",
|
|
171
|
-
"DD-MM-YYYY",
|
|
172
|
-
"DD/MM/YYYY",
|
|
173
|
-
"YYYY-MM-DD",
|
|
174
|
-
"L",
|
|
175
|
-
],
|
|
176
|
-
};
|
|
177
|
-
return {
|
|
178
|
-
masks,
|
|
179
|
-
attrs: [
|
|
180
|
-
{
|
|
181
|
-
highlight: {
|
|
182
|
-
color: "blue",
|
|
183
|
-
fillMode: "outline",
|
|
184
|
-
},
|
|
185
|
-
dates: new Date(),
|
|
186
|
-
},
|
|
187
|
-
],
|
|
188
|
-
};
|
|
189
|
-
},
|
|
190
|
-
methods: {
|
|
191
|
-
onDayClick(date) {
|
|
192
|
-
this.$emit("input", date);
|
|
193
|
-
},
|
|
194
|
-
handleInputBoxInput(input) {
|
|
195
|
-
if (input.target.value.length == 0) {
|
|
196
|
-
this.$emit("input", null);
|
|
197
|
-
}
|
|
198
|
-
},
|
|
199
|
-
},
|
|
200
|
-
};
|
|
201
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
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>
|
|
11
|
+
</div>
|
|
12
|
+
<v-date-picker
|
|
13
|
+
:class="{
|
|
14
|
+
'inline-block h-full': true,
|
|
15
|
+
'w-full': isExpanded,
|
|
16
|
+
}"
|
|
17
|
+
:masks="masks"
|
|
18
|
+
@input="onDayClick"
|
|
19
|
+
:value="value"
|
|
20
|
+
:popover="popoverPlacement"
|
|
21
|
+
:min-date="minDate"
|
|
22
|
+
:max-date="maxDate"
|
|
23
|
+
:attributes="attrs"
|
|
24
|
+
:first-day-of-week="firstDayOfWeek"
|
|
25
|
+
:is-required="isDatePickerRequired"
|
|
26
|
+
>
|
|
27
|
+
<template v-slot="{ inputValue, togglePopover }">
|
|
28
|
+
<div v-if="showOnlyDatePickerIcon">
|
|
29
|
+
<button
|
|
30
|
+
type="button"
|
|
31
|
+
class="relative flex h-9 w-9 cursor-pointer items-center justify-center rounded focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
|
|
32
|
+
@click="togglePopover()"
|
|
33
|
+
>
|
|
34
|
+
<c-icon
|
|
35
|
+
name="calendar-solid"
|
|
36
|
+
:class="[
|
|
37
|
+
disabled ? 'text-gray-200' : 'text-gray-400',
|
|
38
|
+
'flex h-5 w-5 justify-center ',
|
|
39
|
+
]"
|
|
40
|
+
type="solid"
|
|
41
|
+
></c-icon>
|
|
42
|
+
</button>
|
|
43
|
+
</div>
|
|
44
|
+
<div :class="`${isCustom ? '' : 'mt-1'} flex items-center`" v-else>
|
|
45
|
+
<button
|
|
46
|
+
type="button"
|
|
47
|
+
:class="[
|
|
48
|
+
disabled
|
|
49
|
+
? 'pointer-events-none border-gray-100'
|
|
50
|
+
: 'border-gray-300',
|
|
51
|
+
`text-blue-600 focus:outline-none ${
|
|
52
|
+
isCustom
|
|
53
|
+
? 'border-t border-b py-2 pl-2'
|
|
54
|
+
: 'rounded-l-md border p-2'
|
|
55
|
+
} bg-white shadow-sm focus:text-white`,
|
|
56
|
+
]"
|
|
57
|
+
@click="togglePopover()"
|
|
58
|
+
>
|
|
59
|
+
<c-icon
|
|
60
|
+
name="calendar-solid"
|
|
61
|
+
:class="[
|
|
62
|
+
disabled ? 'text-gray-200' : 'text-gray-400',
|
|
63
|
+
'h-5 w-5 ',
|
|
64
|
+
]"
|
|
65
|
+
type="solid"
|
|
66
|
+
></c-icon>
|
|
67
|
+
</button>
|
|
68
|
+
<input
|
|
69
|
+
:value="inputValue"
|
|
70
|
+
:class="[
|
|
71
|
+
disabled
|
|
72
|
+
? 'pointer-events-none border-l-0 border-gray-100 text-gray-400'
|
|
73
|
+
: 'border-l-0 border-gray-300 text-gray-900',
|
|
74
|
+
'w-full appearance-none rounded-r-md border bg-white p-2 text-sm shadow-sm focus:border-blue-500 focus:outline-none',
|
|
75
|
+
]"
|
|
76
|
+
:readonly="disabled"
|
|
77
|
+
@input="handleInputBoxInput"
|
|
78
|
+
@click="togglePopover()"
|
|
79
|
+
/>
|
|
80
|
+
</div>
|
|
81
|
+
</template>
|
|
82
|
+
</v-date-picker>
|
|
83
|
+
<!-- validation error message -->
|
|
84
|
+
<p v-if="!isValidate" class="mt-2 text-sm text-red-600">
|
|
85
|
+
{{ errorMessage }}
|
|
86
|
+
</p>
|
|
87
|
+
<p v-if="helpText && isValidate == true" class="mt-1 text-sm text-gray-500">
|
|
88
|
+
{{ helpText }}
|
|
89
|
+
</p>
|
|
90
|
+
</div>
|
|
91
|
+
</template>
|
|
92
|
+
<script>
|
|
93
|
+
import CIcon from "../CIcon/CIcon.vue";
|
|
94
|
+
// import Calendar from "v-calendar/lib/components/calendar.umd";
|
|
95
|
+
import VDatePicker from "v-calendar/lib/components/date-picker.umd";
|
|
96
|
+
export default {
|
|
97
|
+
name: "CDatepicker",
|
|
98
|
+
components: {
|
|
99
|
+
// Calendar,
|
|
100
|
+
VDatePicker,
|
|
101
|
+
CIcon,
|
|
102
|
+
},
|
|
103
|
+
props: {
|
|
104
|
+
classes: {
|
|
105
|
+
type: String,
|
|
106
|
+
},
|
|
107
|
+
isRequired: {
|
|
108
|
+
type: Boolean,
|
|
109
|
+
},
|
|
110
|
+
isCustom: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
},
|
|
113
|
+
label: {
|
|
114
|
+
type: String,
|
|
115
|
+
},
|
|
116
|
+
helpText: {
|
|
117
|
+
type: String,
|
|
118
|
+
},
|
|
119
|
+
value: {
|
|
120
|
+
type: [String, Date, Array],
|
|
121
|
+
},
|
|
122
|
+
disabled: {
|
|
123
|
+
type: Boolean,
|
|
124
|
+
default: false,
|
|
125
|
+
},
|
|
126
|
+
minDate: {
|
|
127
|
+
type: [String, Date],
|
|
128
|
+
default: null,
|
|
129
|
+
},
|
|
130
|
+
maxDate: {
|
|
131
|
+
type: [String, Date],
|
|
132
|
+
default: null,
|
|
133
|
+
},
|
|
134
|
+
isExpanded: {
|
|
135
|
+
type: Boolean,
|
|
136
|
+
default: false,
|
|
137
|
+
},
|
|
138
|
+
isValidate: {
|
|
139
|
+
type: Boolean,
|
|
140
|
+
default: true,
|
|
141
|
+
},
|
|
142
|
+
errorMessage: {
|
|
143
|
+
type: String,
|
|
144
|
+
},
|
|
145
|
+
isDatePickerRequired: {
|
|
146
|
+
type: Boolean,
|
|
147
|
+
default: true,
|
|
148
|
+
},
|
|
149
|
+
showOnlyDatePickerIcon: {
|
|
150
|
+
type: Boolean,
|
|
151
|
+
default: false,
|
|
152
|
+
},
|
|
153
|
+
popoverPlacement: {
|
|
154
|
+
type: Object,
|
|
155
|
+
default() {
|
|
156
|
+
return {
|
|
157
|
+
placement: "bottom-start",
|
|
158
|
+
};
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
firstDayOfWeek: {
|
|
162
|
+
type: String,
|
|
163
|
+
default: "2",
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
data() {
|
|
167
|
+
const masks = {
|
|
168
|
+
input: [
|
|
169
|
+
"MMM DD, YYYY",
|
|
170
|
+
"YYYY/MM/DD",
|
|
171
|
+
"DD-MM-YYYY",
|
|
172
|
+
"DD/MM/YYYY",
|
|
173
|
+
"YYYY-MM-DD",
|
|
174
|
+
"L",
|
|
175
|
+
],
|
|
176
|
+
};
|
|
177
|
+
return {
|
|
178
|
+
masks,
|
|
179
|
+
attrs: [
|
|
180
|
+
{
|
|
181
|
+
highlight: {
|
|
182
|
+
color: "blue",
|
|
183
|
+
fillMode: "outline",
|
|
184
|
+
},
|
|
185
|
+
dates: new Date(),
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
};
|
|
189
|
+
},
|
|
190
|
+
methods: {
|
|
191
|
+
onDayClick(date) {
|
|
192
|
+
this.$emit("input", date);
|
|
193
|
+
},
|
|
194
|
+
handleInputBoxInput(input) {
|
|
195
|
+
if (input.target.value.length == 0) {
|
|
196
|
+
this.$emit("input", null);
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
</script>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import CDatepicker from './CDatepicker.vue'
|
|
2
|
-
|
|
1
|
+
import CDatepicker from './CDatepicker.vue'
|
|
2
|
+
|
|
3
3
|
export default CDatepicker
|