@coreui/vue-pro 4.5.0 → 4.7.0-alpha.0
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/components/Types.d.ts +5 -5
- package/dist/components/calendar/CCalendar.d.ts +41 -3
- package/dist/components/date-picker/CDatePicker.d.ts +43 -4
- package/dist/components/date-range-picker/CDateRangePicker.d.ts +191 -4
- package/dist/components/form/CFormInput.d.ts +166 -1
- package/dist/components/form/CFormSelect.d.ts +1 -1
- package/dist/components/grid/CCol.d.ts +3 -3
- package/dist/components/grid/CRow.d.ts +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/multi-select/CMultiSelect.d.ts +143 -4
- package/dist/components/multi-select/CMultiSelectOptions.d.ts +11 -0
- package/dist/components/multi-select/CMultiSelectSelection.d.ts +3 -3
- package/dist/components/pagination/index.d.ts +1 -2
- package/dist/components/picker/CPicker.d.ts +1 -1
- package/dist/components/popover/CPopover.d.ts +1 -1
- package/dist/components/smart-pagination/CSmartPagination.d.ts +257 -0
- package/dist/components/smart-pagination/index.d.ts +6 -0
- package/dist/components/smart-table/CSmartTable.d.ts +6 -4
- package/dist/components/smart-table/CSmartTableFilter.d.ts +2 -2
- package/dist/components/smart-table/CSmartTableHead.d.ts +2 -2
- package/dist/components/smart-table/CSmartTableInterface.d.ts +4 -1
- package/dist/components/table/CTable.d.ts +1 -1
- package/dist/components/table/CTableCaption.d.ts +2 -8
- package/dist/components/time-picker/CTimePicker.d.ts +2 -1
- package/dist/components/tooltip/CTooltip.d.ts +1 -1
- package/dist/components/widgets/CWidgetStatsD.d.ts +1 -1
- package/dist/index.es.js +1560 -1017
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1559 -1015
- package/dist/index.js.map +1 -1
- package/dist/utils/getNextSibling.d.ts +2 -0
- package/dist/utils/getPreviousSibling.d.ts +2 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/isVisible.d.ts +2 -0
- package/dist/utils/time.d.ts +2 -2
- package/package.json +2 -2
- package/src/components/calendar/CCalendar.ts +46 -4
- package/src/components/carousel/CCarousel.ts +1 -9
- package/src/components/date-picker/CDatePicker.ts +44 -3
- package/src/components/date-range-picker/CDateRangePicker.ts +340 -170
- package/src/components/form/CFormInput.ts +2 -0
- package/src/components/index.ts +1 -0
- package/src/components/loading-button/CLoadingButton.ts +1 -2
- package/src/components/multi-select/CMultiSelect.ts +295 -173
- package/src/components/multi-select/CMultiSelectOptions.ts +48 -10
- package/src/components/multi-select/CMultiSelectSelection.ts +1 -1
- package/src/components/pagination/index.ts +1 -3
- package/src/components/sidebar/CSidebar.ts +2 -10
- package/src/components/{pagination → smart-pagination}/CSmartPagination.ts +1 -2
- package/src/components/smart-pagination/index.ts +10 -0
- package/src/components/smart-table/CSmartTable.ts +10 -5
- package/src/components/smart-table/CSmartTableInterface.ts +4 -0
- package/src/components/table/CTableCaption.ts +0 -1
- package/src/components/time-picker/CTimePicker.ts +198 -64
- package/src/components/time-picker/CTimePickerRollCol.ts +9 -0
- package/src/utils/getNextSibling.ts +18 -0
- package/src/utils/getPreviousSibling.ts +18 -0
- package/src/utils/index.ts +5 -0
- package/src/utils/isVisible.ts +11 -0
- package/src/utils/time.ts +14 -6
|
@@ -5,6 +5,7 @@ import { format as dateFormat } from 'date-fns'
|
|
|
5
5
|
import { CButton } from '../button'
|
|
6
6
|
import { CCalendar } from '../calendar'
|
|
7
7
|
import { CFormInput, CInputGroup, CInputGroupText } from '../form'
|
|
8
|
+
import { CFormControlWrapper } from './../form/CFormControlWrapper'
|
|
8
9
|
import { CPicker } from '../picker'
|
|
9
10
|
import { CTimePicker } from '../time-picker'
|
|
10
11
|
|
|
@@ -75,6 +76,15 @@ const CDateRangePicker = defineComponent({
|
|
|
75
76
|
type: Boolean,
|
|
76
77
|
default: true,
|
|
77
78
|
},
|
|
79
|
+
/**
|
|
80
|
+
* If true the dropdown will be immediately closed after submitting the full date.
|
|
81
|
+
*
|
|
82
|
+
* @since 4.7.0
|
|
83
|
+
*/
|
|
84
|
+
closeOnSelect: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
default: true,
|
|
87
|
+
},
|
|
78
88
|
/**
|
|
79
89
|
* Toggle visibility or set the content of confirm button.
|
|
80
90
|
*/
|
|
@@ -114,6 +124,29 @@ const CDateRangePicker = defineComponent({
|
|
|
114
124
|
return ['ghost', 'outline'].includes(value)
|
|
115
125
|
},
|
|
116
126
|
},
|
|
127
|
+
/**
|
|
128
|
+
* Set the format of day name.
|
|
129
|
+
*
|
|
130
|
+
* @default 'numeric'
|
|
131
|
+
* @since 4.6.0
|
|
132
|
+
*/
|
|
133
|
+
dayFormat: {
|
|
134
|
+
type: [Function, String],
|
|
135
|
+
default: 'numeric',
|
|
136
|
+
required: false,
|
|
137
|
+
validator: (value: string) => {
|
|
138
|
+
if (typeof value === 'string') {
|
|
139
|
+
return ['numeric', '2-digit'].includes(value)
|
|
140
|
+
}
|
|
141
|
+
if (typeof value === 'function') {
|
|
142
|
+
return true
|
|
143
|
+
}
|
|
144
|
+
if (typeof value === 'function') {
|
|
145
|
+
return true
|
|
146
|
+
}
|
|
147
|
+
return false
|
|
148
|
+
},
|
|
149
|
+
},
|
|
117
150
|
/**
|
|
118
151
|
* Toggle the disabled state for the component.
|
|
119
152
|
*/
|
|
@@ -131,6 +164,30 @@ const CDateRangePicker = defineComponent({
|
|
|
131
164
|
type: [Date, String],
|
|
132
165
|
required: false,
|
|
133
166
|
},
|
|
167
|
+
/**
|
|
168
|
+
* Provide valuable, actionable feedback.
|
|
169
|
+
*
|
|
170
|
+
* @since 4.6.0
|
|
171
|
+
*/
|
|
172
|
+
feedback: {
|
|
173
|
+
type: String,
|
|
174
|
+
},
|
|
175
|
+
/**
|
|
176
|
+
* Provide valuable, actionable feedback.
|
|
177
|
+
*
|
|
178
|
+
* @since 4.6.0
|
|
179
|
+
*/
|
|
180
|
+
feedbackInvalid: {
|
|
181
|
+
type: String,
|
|
182
|
+
},
|
|
183
|
+
/**
|
|
184
|
+
* Provide valuable, actionable invalid feedback when using standard HTML form validation which applied two CSS pseudo-classes, `:invalid` and `:valid`.
|
|
185
|
+
*
|
|
186
|
+
* @since 4.6.0
|
|
187
|
+
*/
|
|
188
|
+
feedbackValid: {
|
|
189
|
+
type: String,
|
|
190
|
+
},
|
|
134
191
|
/**
|
|
135
192
|
* Sets the day of start week.
|
|
136
193
|
* - 0 - Sunday,
|
|
@@ -173,6 +230,20 @@ const CDateRangePicker = defineComponent({
|
|
|
173
230
|
* Toggle the readonly state for the component.
|
|
174
231
|
*/
|
|
175
232
|
inputReadOnly: Boolean,
|
|
233
|
+
/**
|
|
234
|
+
* Set component validation state to invalid.
|
|
235
|
+
*
|
|
236
|
+
* @since 4.6.0
|
|
237
|
+
*/
|
|
238
|
+
invalid: Boolean,
|
|
239
|
+
/**
|
|
240
|
+
* Add a caption for a component.
|
|
241
|
+
*
|
|
242
|
+
* @since 4.6.0
|
|
243
|
+
*/
|
|
244
|
+
label: {
|
|
245
|
+
type: String,
|
|
246
|
+
},
|
|
176
247
|
/**
|
|
177
248
|
* Sets the default locale for components. If not set, it is inherited from the navigator.language.
|
|
178
249
|
*/
|
|
@@ -199,6 +270,12 @@ const CDateRangePicker = defineComponent({
|
|
|
199
270
|
type: Boolean,
|
|
200
271
|
default: true,
|
|
201
272
|
},
|
|
273
|
+
/**
|
|
274
|
+
* Reorder year-month navigation, and render year first.
|
|
275
|
+
*
|
|
276
|
+
* @since 4.6.0
|
|
277
|
+
*/
|
|
278
|
+
navYearFirst: Boolean,
|
|
202
279
|
/**
|
|
203
280
|
* Specifies a short hint that is visible in the input.
|
|
204
281
|
*/
|
|
@@ -246,6 +323,14 @@ const CDateRangePicker = defineComponent({
|
|
|
246
323
|
startDate: {
|
|
247
324
|
type: [Date, String],
|
|
248
325
|
},
|
|
326
|
+
/**
|
|
327
|
+
* Add helper text to the component.
|
|
328
|
+
*
|
|
329
|
+
* @since 4.6.0
|
|
330
|
+
*/
|
|
331
|
+
text: {
|
|
332
|
+
type: String,
|
|
333
|
+
},
|
|
249
334
|
/**
|
|
250
335
|
* Provide an additional time selection by adding select boxes to choose times.
|
|
251
336
|
*/
|
|
@@ -289,13 +374,29 @@ const CDateRangePicker = defineComponent({
|
|
|
289
374
|
return ['ghost', 'outline'].includes(value)
|
|
290
375
|
},
|
|
291
376
|
},
|
|
377
|
+
/**
|
|
378
|
+
* Display validation feedback in a styled tooltip.
|
|
379
|
+
*
|
|
380
|
+
* @since 4.6.0
|
|
381
|
+
*/
|
|
382
|
+
tooltipFeedback: Boolean,
|
|
383
|
+
/**
|
|
384
|
+
* Set component validation state to valid.
|
|
385
|
+
*
|
|
386
|
+
* @since 4.6.0
|
|
387
|
+
*/
|
|
388
|
+
valid: Boolean,
|
|
389
|
+
/**
|
|
390
|
+
* Toggle the visibility of the component.
|
|
391
|
+
*/
|
|
392
|
+
visible: Boolean,
|
|
292
393
|
/**
|
|
293
394
|
* Set length or format of day name.
|
|
294
395
|
*
|
|
295
396
|
* @type number | 'long' | 'narrow' | 'short'
|
|
296
397
|
*/
|
|
297
398
|
weekdayFormat: {
|
|
298
|
-
type: [Number, String],
|
|
399
|
+
type: [Function, Number, String],
|
|
299
400
|
default: 2,
|
|
300
401
|
validator: (value: string | number) => {
|
|
301
402
|
if (typeof value === 'string') {
|
|
@@ -304,6 +405,9 @@ const CDateRangePicker = defineComponent({
|
|
|
304
405
|
if (typeof value === 'number') {
|
|
305
406
|
return true
|
|
306
407
|
}
|
|
408
|
+
if (typeof value === 'function') {
|
|
409
|
+
return true
|
|
410
|
+
}
|
|
307
411
|
return false
|
|
308
412
|
},
|
|
309
413
|
},
|
|
@@ -331,8 +435,23 @@ const CDateRangePicker = defineComponent({
|
|
|
331
435
|
* @property {string} formatedDate - formated date
|
|
332
436
|
*/
|
|
333
437
|
'start-date-change',
|
|
438
|
+
/**
|
|
439
|
+
* Callback fired when the start date changed.
|
|
440
|
+
*
|
|
441
|
+
* @property {Date | null} date - date object
|
|
442
|
+
* @since 4.7.0
|
|
443
|
+
*/
|
|
444
|
+
'update:start-date',
|
|
445
|
+
/**
|
|
446
|
+
* Callback fired when the end date changed.
|
|
447
|
+
*
|
|
448
|
+
* @property {Date | null} date - date object
|
|
449
|
+
* @since 4.7.0
|
|
450
|
+
*/
|
|
451
|
+
'update:end-date',
|
|
334
452
|
],
|
|
335
|
-
setup(props, { slots, emit }) {
|
|
453
|
+
setup(props, { slots, attrs, emit }) {
|
|
454
|
+
const visible = ref(props.visible)
|
|
336
455
|
const calendarDate = ref<Date>(
|
|
337
456
|
props.calendarDate
|
|
338
457
|
? new Date(props.calendarDate)
|
|
@@ -435,6 +554,15 @@ const CDateRangePicker = defineComponent({
|
|
|
435
554
|
}
|
|
436
555
|
|
|
437
556
|
emit('start-date-change', date, date ? formatDate(date) : undefined)
|
|
557
|
+
emit('update:start-date', date)
|
|
558
|
+
|
|
559
|
+
if (props.timepicker || props.footer) {
|
|
560
|
+
return
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
if (props.closeOnSelect && !props.range) {
|
|
564
|
+
visible.value = false
|
|
565
|
+
}
|
|
438
566
|
}
|
|
439
567
|
|
|
440
568
|
const handleEndDateChange = (date: Date) => {
|
|
@@ -445,6 +573,15 @@ const CDateRangePicker = defineComponent({
|
|
|
445
573
|
}
|
|
446
574
|
|
|
447
575
|
emit('end-date-change', date, date ? formatDate(date) : undefined)
|
|
576
|
+
emit('update:end-date', date)
|
|
577
|
+
|
|
578
|
+
if (props.timepicker || props.footer) {
|
|
579
|
+
return
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
if (props.closeOnSelect && startDate.value !== null) {
|
|
583
|
+
visible.value = false
|
|
584
|
+
}
|
|
448
585
|
}
|
|
449
586
|
|
|
450
587
|
const handleClear = (event: Event) => {
|
|
@@ -453,6 +590,10 @@ const CDateRangePicker = defineComponent({
|
|
|
453
590
|
endDate.value = null
|
|
454
591
|
inputStartHoverValue.value = null
|
|
455
592
|
inputEndHoverValue.value = null
|
|
593
|
+
emit('start-date-change', null)
|
|
594
|
+
emit('end-date-change', null)
|
|
595
|
+
emit('update:start-date', null)
|
|
596
|
+
emit('update:end-date', null)
|
|
456
597
|
}
|
|
457
598
|
|
|
458
599
|
const InputGroup = () =>
|
|
@@ -557,192 +698,221 @@ const CDateRangePicker = defineComponent({
|
|
|
557
698
|
|
|
558
699
|
return () =>
|
|
559
700
|
h(
|
|
560
|
-
|
|
701
|
+
CFormControlWrapper,
|
|
561
702
|
{
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
class: 'date-picker',
|
|
567
|
-
confirmButton: props.confirmButton,
|
|
568
|
-
confirmButtonColor: props.confirmButtonColor,
|
|
569
|
-
confirmButtonSize: props.confirmButtonSize,
|
|
570
|
-
confirmButtonVariant: props.confirmButtonVariant,
|
|
571
|
-
disabled: props.disabled,
|
|
572
|
-
footer: props.footer || props.timepicker,
|
|
703
|
+
describedby: attrs['aria-describedby'],
|
|
704
|
+
feedback: props.feedback,
|
|
705
|
+
feedbackInvalid: props.feedbackInvalid,
|
|
706
|
+
feedbackValid: props.feedbackValid,
|
|
573
707
|
id: props.id,
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
emit('hide')
|
|
580
|
-
},
|
|
581
|
-
onShow: () => {
|
|
582
|
-
if (startDate.value) {
|
|
583
|
-
initialStartDate.value = new Date(startDate.value)
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
if (endDate.value) {
|
|
587
|
-
initialEndDate.value = new Date(endDate.value)
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
emit('show')
|
|
591
|
-
},
|
|
708
|
+
invalid: props.invalid,
|
|
709
|
+
label: props.label,
|
|
710
|
+
text: props.text,
|
|
711
|
+
tooltipFeedback: props.tooltipFeedback,
|
|
712
|
+
valid: props.valid,
|
|
592
713
|
},
|
|
593
714
|
{
|
|
594
|
-
|
|
595
|
-
cancelButton: () => slots.cancelButton && slots.cancelButton(),
|
|
596
|
-
}),
|
|
597
|
-
...(slots.confirmButton && {
|
|
598
|
-
confirmButton: () => slots.confirmButton && slots.confirmButton(),
|
|
599
|
-
}),
|
|
600
|
-
toggler: () => InputGroup(),
|
|
601
|
-
footer: () =>
|
|
715
|
+
default: () =>
|
|
602
716
|
h(
|
|
603
|
-
|
|
717
|
+
CPicker,
|
|
604
718
|
{
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
719
|
+
cancelButton: props.cancelButton,
|
|
720
|
+
cancelButtonColor: props.cancelButtonColor,
|
|
721
|
+
cancelButtonSize: props.cancelButtonSize,
|
|
722
|
+
cancelButtonVariant: props.cancelButtonVariant,
|
|
723
|
+
class: ['date-picker', { 'is-invalid': props.invalid, 'is-valid': props.valid }],
|
|
724
|
+
confirmButton: props.confirmButton,
|
|
725
|
+
confirmButtonColor: props.confirmButtonColor,
|
|
726
|
+
confirmButtonSize: props.confirmButtonSize,
|
|
727
|
+
confirmButtonVariant: props.confirmButtonVariant,
|
|
728
|
+
disabled: props.disabled,
|
|
729
|
+
footer: props.footer || props.timepicker,
|
|
730
|
+
id: props.id,
|
|
731
|
+
onCancel: () => {
|
|
732
|
+
startDate.value = initialStartDate.value
|
|
733
|
+
endDate.value = initialEndDate.value
|
|
734
|
+
visible.value = false
|
|
735
|
+
},
|
|
736
|
+
onHide: () => {
|
|
737
|
+
visible.value = false
|
|
738
|
+
emit('hide')
|
|
614
739
|
},
|
|
740
|
+
onShow: () => {
|
|
741
|
+
if (startDate.value) {
|
|
742
|
+
initialStartDate.value = new Date(startDate.value)
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
if (endDate.value) {
|
|
746
|
+
initialEndDate.value = new Date(endDate.value)
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
visible.value = true
|
|
750
|
+
emit('show')
|
|
751
|
+
},
|
|
752
|
+
visible: visible.value,
|
|
615
753
|
},
|
|
616
|
-
() => props.todayButton,
|
|
617
|
-
),
|
|
618
|
-
default: () =>
|
|
619
|
-
h(
|
|
620
|
-
'div',
|
|
621
754
|
{
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
755
|
+
...(slots.cancelButton && {
|
|
756
|
+
cancelButton: () => slots.cancelButton && slots.cancelButton(),
|
|
757
|
+
}),
|
|
758
|
+
...(slots.confirmButton && {
|
|
759
|
+
confirmButton: () => slots.confirmButton && slots.confirmButton(),
|
|
760
|
+
}),
|
|
761
|
+
toggler: () => InputGroup(),
|
|
762
|
+
footer: () =>
|
|
626
763
|
h(
|
|
627
|
-
|
|
628
|
-
{ class: 'date-picker-ranges' },
|
|
629
|
-
Object.keys(props.ranges).map((key: string) =>
|
|
630
|
-
h(
|
|
631
|
-
CButton,
|
|
632
|
-
{
|
|
633
|
-
color: 'secondary',
|
|
634
|
-
onClick: () => {
|
|
635
|
-
if (props.ranges) {
|
|
636
|
-
startDate.value = props.ranges[key][0]
|
|
637
|
-
endDate.value = props.ranges[key][1]
|
|
638
|
-
}
|
|
639
|
-
},
|
|
640
|
-
variant: 'ghost',
|
|
641
|
-
},
|
|
642
|
-
() => key,
|
|
643
|
-
),
|
|
644
|
-
),
|
|
645
|
-
),
|
|
646
|
-
h(
|
|
647
|
-
'div',
|
|
648
|
-
{ class: 'date-picker-calendars' },
|
|
649
|
-
h(
|
|
650
|
-
CCalendar,
|
|
764
|
+
CButton,
|
|
651
765
|
{
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
)
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
maxDate: maxDate.value,
|
|
663
|
-
minDate: minDate.value,
|
|
664
|
-
navigation: props.navigation,
|
|
665
|
-
range: props.range,
|
|
666
|
-
selectEndDate: selectEndDate.value,
|
|
667
|
-
...(startDate.value && { startDate: startDate.value }),
|
|
668
|
-
onCalendarCellHover: (date: Date | null) => handleCalendarCellHover(date),
|
|
669
|
-
onCalendarDateChange: (date: Date) => handleCalendarDateChange(date),
|
|
670
|
-
onStartDateChange: (date: Date) => handleStartDateChange(date),
|
|
671
|
-
onEndDateChange: (date: Date) => handleEndDateChange(date),
|
|
672
|
-
},
|
|
673
|
-
{
|
|
674
|
-
/**
|
|
675
|
-
* @slot Location for next icon.
|
|
676
|
-
*/
|
|
677
|
-
...(slots.navNextIcon && {
|
|
678
|
-
navNextIcon: () => slots.navNextIcon && slots.navNextIcon(),
|
|
679
|
-
}),
|
|
680
|
-
/**
|
|
681
|
-
* @slot Location for next double icon.
|
|
682
|
-
*/
|
|
683
|
-
...(slots.navNextDoubleIcon && {
|
|
684
|
-
navNextDoubleIcon: () =>
|
|
685
|
-
slots.navNextDoubleIcon && slots.navNextDoubleIcon(),
|
|
686
|
-
}),
|
|
687
|
-
/**
|
|
688
|
-
* @slot Location for previous icon.
|
|
689
|
-
*/
|
|
690
|
-
...(slots.navPrevIcon && {
|
|
691
|
-
navPrevIcon: () => slots.navPrevIcon && slots.navPrevIcon(),
|
|
692
|
-
}),
|
|
693
|
-
/**
|
|
694
|
-
* @slot Location for double previous icon.
|
|
695
|
-
*/
|
|
696
|
-
...(slots.navPrevDoubleIcon && {
|
|
697
|
-
navPrevDoubleIcon: () =>
|
|
698
|
-
slots.navPrevDoubleIcon && slots.navPrevDoubleIcon(),
|
|
699
|
-
}),
|
|
766
|
+
class: 'me-auto',
|
|
767
|
+
color: props.todayButtonColor,
|
|
768
|
+
size: props.todayButtonSize,
|
|
769
|
+
variant: props.todayButtonVariant,
|
|
770
|
+
onClick: () => {
|
|
771
|
+
const date = new Date()
|
|
772
|
+
startDate.value = date
|
|
773
|
+
endDate.value = date
|
|
774
|
+
calendarDate.value = date
|
|
775
|
+
},
|
|
700
776
|
},
|
|
777
|
+
() => props.todayButton,
|
|
701
778
|
),
|
|
702
|
-
)
|
|
703
|
-
props.timepicker &&
|
|
779
|
+
default: () =>
|
|
704
780
|
h(
|
|
705
781
|
'div',
|
|
706
|
-
{
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
782
|
+
{
|
|
783
|
+
class: 'date-picker-body',
|
|
784
|
+
},
|
|
785
|
+
[
|
|
786
|
+
props.ranges &&
|
|
787
|
+
h(
|
|
788
|
+
'div',
|
|
789
|
+
{ class: 'date-picker-ranges' },
|
|
790
|
+
Object.keys(props.ranges).map((key: string) =>
|
|
791
|
+
h(
|
|
792
|
+
CButton,
|
|
793
|
+
{
|
|
794
|
+
color: 'secondary',
|
|
795
|
+
onClick: () => {
|
|
796
|
+
if (props.ranges) {
|
|
797
|
+
startDate.value = props.ranges[key][0]
|
|
798
|
+
endDate.value = props.ranges[key][1]
|
|
799
|
+
}
|
|
800
|
+
},
|
|
801
|
+
variant: 'ghost',
|
|
802
|
+
},
|
|
803
|
+
() => key,
|
|
804
|
+
),
|
|
805
|
+
),
|
|
806
|
+
),
|
|
807
|
+
h(
|
|
808
|
+
'div',
|
|
809
|
+
{ class: 'date-picker-calendars' },
|
|
810
|
+
h(
|
|
811
|
+
CCalendar,
|
|
812
|
+
{
|
|
813
|
+
calendarDate: new Date(
|
|
814
|
+
calendarDate.value.getFullYear(),
|
|
815
|
+
calendarDate.value.getMonth(),
|
|
816
|
+
1,
|
|
817
|
+
),
|
|
818
|
+
calendars: props.calendars,
|
|
819
|
+
dayFormat: props.dayFormat,
|
|
820
|
+
disabledDates: props.disabledDates,
|
|
821
|
+
...(endDate.value && { endDate: endDate.value }),
|
|
822
|
+
firstDayOfWeek: props.firstDayOfWeek,
|
|
737
823
|
locale: props.locale,
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
824
|
+
maxDate: maxDate.value,
|
|
825
|
+
minDate: minDate.value,
|
|
826
|
+
navYearFirst: props.navYearFirst,
|
|
827
|
+
navigation: props.navigation,
|
|
828
|
+
range: props.range,
|
|
829
|
+
selectEndDate: selectEndDate.value,
|
|
830
|
+
...(startDate.value && { startDate: startDate.value }),
|
|
831
|
+
onCalendarCellHover: (date: Date | null) =>
|
|
832
|
+
handleCalendarCellHover(date),
|
|
833
|
+
onCalendarDateChange: (date: Date) => handleCalendarDateChange(date),
|
|
834
|
+
onStartDateChange: (date: Date) => handleStartDateChange(date),
|
|
835
|
+
onEndDateChange: (date: Date) => handleEndDateChange(date),
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
/**
|
|
839
|
+
* @slot Location for next icon.
|
|
840
|
+
*/
|
|
841
|
+
...(slots.navNextIcon && {
|
|
842
|
+
navNextIcon: () => slots.navNextIcon && slots.navNextIcon(),
|
|
843
|
+
}),
|
|
844
|
+
/**
|
|
845
|
+
* @slot Location for next double icon.
|
|
846
|
+
*/
|
|
847
|
+
...(slots.navNextDoubleIcon && {
|
|
848
|
+
navNextDoubleIcon: () =>
|
|
849
|
+
slots.navNextDoubleIcon && slots.navNextDoubleIcon(),
|
|
850
|
+
}),
|
|
851
|
+
/**
|
|
852
|
+
* @slot Location for previous icon.
|
|
853
|
+
*/
|
|
854
|
+
...(slots.navPrevIcon && {
|
|
855
|
+
navPrevIcon: () => slots.navPrevIcon && slots.navPrevIcon(),
|
|
856
|
+
}),
|
|
857
|
+
/**
|
|
858
|
+
* @slot Location for double previous icon.
|
|
859
|
+
*/
|
|
860
|
+
...(slots.navPrevDoubleIcon && {
|
|
861
|
+
navPrevDoubleIcon: () =>
|
|
862
|
+
slots.navPrevDoubleIcon && slots.navPrevDoubleIcon(),
|
|
863
|
+
}),
|
|
864
|
+
},
|
|
743
865
|
),
|
|
866
|
+
),
|
|
867
|
+
props.timepicker &&
|
|
868
|
+
h(
|
|
869
|
+
'div',
|
|
870
|
+
{ class: 'date-picker-timepickers' },
|
|
871
|
+
isMobile.value || (props.range && props.calendars === 1)
|
|
872
|
+
? [
|
|
873
|
+
h(CTimePicker, {
|
|
874
|
+
container: 'inline',
|
|
875
|
+
disabled: startDate.value === null ? true : false,
|
|
876
|
+
locale: props.locale,
|
|
877
|
+
onChange: (_: any, __: any, date: Date) =>
|
|
878
|
+
handleStartDateChange(date),
|
|
879
|
+
time: startDate.value,
|
|
880
|
+
variant: 'select',
|
|
881
|
+
}),
|
|
882
|
+
h(CTimePicker, {
|
|
883
|
+
container: 'inline',
|
|
884
|
+
disabled: endDate.value === null ? true : false,
|
|
885
|
+
locale: props.locale,
|
|
886
|
+
onChange: (_: any, __: any, date: Date) =>
|
|
887
|
+
handleEndDateChange(date),
|
|
888
|
+
time: endDate.value,
|
|
889
|
+
variant: 'select',
|
|
890
|
+
}),
|
|
891
|
+
]
|
|
892
|
+
: [...Array(props.calendars)].map((_, index) =>
|
|
893
|
+
h(CTimePicker, {
|
|
894
|
+
container: 'inline',
|
|
895
|
+
disabled:
|
|
896
|
+
index === 0
|
|
897
|
+
? startDate.value === null
|
|
898
|
+
? true
|
|
899
|
+
: false
|
|
900
|
+
: endDate.value === null
|
|
901
|
+
? true
|
|
902
|
+
: false,
|
|
903
|
+
locale: props.locale,
|
|
904
|
+
onChange: (_: any, __: any, date: Date) =>
|
|
905
|
+
index === 0
|
|
906
|
+
? handleStartDateChange(date)
|
|
907
|
+
: handleEndDateChange(date),
|
|
908
|
+
time: index === 0 ? startDate.value : endDate.value,
|
|
909
|
+
variant: 'select',
|
|
910
|
+
}),
|
|
911
|
+
),
|
|
912
|
+
),
|
|
913
|
+
],
|
|
744
914
|
),
|
|
745
|
-
|
|
915
|
+
},
|
|
746
916
|
),
|
|
747
917
|
},
|
|
748
918
|
)
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { defineComponent, h } from 'vue'
|
|
2
2
|
import { CFormControlWrapper } from './CFormControlWrapper'
|
|
3
3
|
|
|
4
|
+
export const File = typeof window !== 'undefined' ? window.File : class File extends Object {}
|
|
5
|
+
|
|
4
6
|
const CFormInput = defineComponent({
|
|
5
7
|
name: 'CFormInput',
|
|
6
8
|
props: {
|
package/src/components/index.ts
CHANGED
|
@@ -71,11 +71,10 @@ const CLoadingButton = defineComponent({
|
|
|
71
71
|
h(
|
|
72
72
|
CButton,
|
|
73
73
|
{
|
|
74
|
+
...props,
|
|
74
75
|
class: ['btn-loading', { ['is-loading']: loading.value }],
|
|
75
76
|
...(props.disabledOnLoading && loading.value && { disabled: true }),
|
|
76
77
|
onClick: () => handleOnClick(),
|
|
77
|
-
// TODO: remove non button props
|
|
78
|
-
...props,
|
|
79
78
|
},
|
|
80
79
|
{
|
|
81
80
|
default: () => [
|