@coreui/vue-pro 4.9.0-beta.2 → 4.9.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/README.md +1 -1
- package/dist/components/dropdown/CDropdown.d.ts +62 -4
- package/dist/components/dropdown/CDropdownToggle.d.ts +1 -1
- package/dist/components/multi-select/CMultiSelect.d.ts +6 -6
- package/dist/components/popover/CPopover.d.ts +75 -6
- package/dist/components/toast/CToast.d.ts +1 -1
- package/dist/components/tooltip/CTooltip.d.ts +77 -8
- package/dist/composables/index.d.ts +2 -2
- package/dist/composables/useColorModes.d.ts +1 -1
- package/dist/composables/usePopper.d.ts +6 -0
- package/dist/index.es.js +424 -325
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +423 -324
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils/getRTLPlacement.d.ts +3 -0
- package/dist/utils/index.d.ts +2 -1
- package/package.json +10 -10
- package/src/components/date-range-picker/CDateRangePicker.ts +50 -17
- package/src/components/dropdown/CDropdown.ts +116 -61
- package/src/components/dropdown/CDropdownMenu.ts +2 -47
- package/src/components/dropdown/CDropdownToggle.ts +5 -5
- package/src/components/multi-select/CMultiSelect.ts +58 -67
- package/src/components/multi-select/CMultiSelectSelection.ts +10 -11
- package/src/components/picker/CPicker.ts +22 -7
- package/src/components/popover/CPopover.ts +96 -50
- package/src/components/time-picker/CTimePicker.ts +63 -34
- package/src/components/tooltip/CTooltip.ts +97 -51
- package/src/composables/index.ts +2 -2
- package/src/composables/usePopper.ts +25 -0
- package/src/types.ts +1 -1
- package/src/utils/getRTLPlacement.ts +18 -0
- package/src/utils/index.ts +2 -1
- package/src/composables/useColorModes.ts +0 -62
|
@@ -19,7 +19,7 @@ const CMultiSelect = defineComponent({
|
|
|
19
19
|
/**
|
|
20
20
|
* Allow users to create options if they are not in the list of options.
|
|
21
21
|
*
|
|
22
|
-
* @since 4.9.0
|
|
22
|
+
* @since 4.9.0
|
|
23
23
|
*/
|
|
24
24
|
allowCreateOptions: Boolean,
|
|
25
25
|
/**
|
|
@@ -34,7 +34,7 @@ const CMultiSelect = defineComponent({
|
|
|
34
34
|
/**
|
|
35
35
|
* Clear current search on selecting an item.
|
|
36
36
|
*
|
|
37
|
-
* @since 4.9.0
|
|
37
|
+
* @since 4.9.0
|
|
38
38
|
*/
|
|
39
39
|
clearSearchOnSelect: Boolean,
|
|
40
40
|
/**
|
|
@@ -78,7 +78,7 @@ const CMultiSelect = defineComponent({
|
|
|
78
78
|
/**
|
|
79
79
|
* When set, the options list will have a loading style: loading spinner and reduced opacity.
|
|
80
80
|
*
|
|
81
|
-
* @since 4.9.0
|
|
81
|
+
* @since 4.9.0
|
|
82
82
|
*/
|
|
83
83
|
loading: Boolean,
|
|
84
84
|
/**
|
|
@@ -535,13 +535,18 @@ const CMultiSelect = defineComponent({
|
|
|
535
535
|
'div',
|
|
536
536
|
{
|
|
537
537
|
class: [
|
|
538
|
+
'dropdown',
|
|
539
|
+
'picker',
|
|
538
540
|
'form-multi-select',
|
|
539
541
|
{
|
|
542
|
+
'form-multi-select-with-cleaner': props.cleaner,
|
|
540
543
|
disabled: props.disabled,
|
|
541
544
|
[`form-multi-select-${props.size}`]: props.size,
|
|
545
|
+
'form-multi-select-selection-tags':
|
|
546
|
+
props.multiple && props.selectionType === 'tags',
|
|
547
|
+
show: visible.value,
|
|
542
548
|
'is-invalid': props.invalid,
|
|
543
549
|
'is-valid': props.valid,
|
|
544
|
-
show: visible.value,
|
|
545
550
|
},
|
|
546
551
|
],
|
|
547
552
|
'aria-expanded': visible.value,
|
|
@@ -561,78 +566,64 @@ const CMultiSelect = defineComponent({
|
|
|
561
566
|
},
|
|
562
567
|
{
|
|
563
568
|
default: () => [
|
|
564
|
-
h(
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
...(props.multiple &&
|
|
599
|
-
selected.value.length > 0 &&
|
|
600
|
-
props.selectionType !== 'counter' && {
|
|
601
|
-
size: searchValue.value.length + 2,
|
|
602
|
-
}),
|
|
603
|
-
ref: searchRef,
|
|
569
|
+
h(CMultiSelectSelection, {
|
|
570
|
+
multiple: props.multiple,
|
|
571
|
+
placeholder: props.placeholder,
|
|
572
|
+
onRemove: (option: Option) =>
|
|
573
|
+
!props.disabled && handleOptionClick(option),
|
|
574
|
+
search: props.search,
|
|
575
|
+
selected: selected.value,
|
|
576
|
+
selectionType: props.selectionType,
|
|
577
|
+
selectionTypeCounterText: props.selectionTypeCounterText,
|
|
578
|
+
}),
|
|
579
|
+
props.multiple &&
|
|
580
|
+
props.cleaner &&
|
|
581
|
+
selected.value.length > 0 &&
|
|
582
|
+
!props.disabled &&
|
|
583
|
+
h('button', {
|
|
584
|
+
type: 'button',
|
|
585
|
+
class: 'form-multi-select-selection-cleaner',
|
|
586
|
+
onClick: () => handleDeselectAll(),
|
|
587
|
+
}),
|
|
588
|
+
props.search &&
|
|
589
|
+
h('input', {
|
|
590
|
+
type: 'text',
|
|
591
|
+
class: 'form-multi-select-search',
|
|
592
|
+
disabled: props.disabled,
|
|
593
|
+
autocomplete: 'off',
|
|
594
|
+
onInput: (event: InputEvent) => handleSearchChange(event),
|
|
595
|
+
onKeydown: (event: KeyboardEvent) => handleSearchKeyDown(event),
|
|
596
|
+
...(selected.value.length === 0 && {
|
|
597
|
+
placeholder: props.placeholder,
|
|
598
|
+
}),
|
|
599
|
+
...(selected.value.length > 0 &&
|
|
600
|
+
props.selectionType === 'counter' && {
|
|
601
|
+
placeholder: `${selected.value.length} ${props.selectionTypeCounterText}`,
|
|
604
602
|
}),
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
'div',
|
|
609
|
-
{ class: 'form-multi-select-buttons' },
|
|
610
|
-
{
|
|
611
|
-
default: () => [
|
|
612
|
-
h('button', {
|
|
613
|
-
class: 'form-multi-select-cleaner',
|
|
614
|
-
onClick: () => handleDeselectAll(),
|
|
615
|
-
type: 'button',
|
|
603
|
+
...(selected.value.length > 0 &&
|
|
604
|
+
!props.multiple && {
|
|
605
|
+
placeholder: selected.value.map((option) => option.text)[0],
|
|
616
606
|
}),
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
visible.value = !visible.value
|
|
623
|
-
},
|
|
624
|
-
type: 'button',
|
|
607
|
+
|
|
608
|
+
...(props.multiple &&
|
|
609
|
+
selected.value.length > 0 &&
|
|
610
|
+
props.selectionType !== 'counter' && {
|
|
611
|
+
size: searchValue.value.length + 2,
|
|
625
612
|
}),
|
|
626
|
-
|
|
627
|
-
},
|
|
628
|
-
),
|
|
613
|
+
ref: searchRef,
|
|
614
|
+
}),
|
|
629
615
|
],
|
|
630
616
|
},
|
|
631
617
|
),
|
|
632
618
|
h(
|
|
633
619
|
'div',
|
|
634
620
|
{
|
|
635
|
-
class:
|
|
621
|
+
class: [
|
|
622
|
+
'dropdown-menu',
|
|
623
|
+
{
|
|
624
|
+
show: visible.value,
|
|
625
|
+
},
|
|
626
|
+
],
|
|
636
627
|
role: 'menu',
|
|
637
628
|
ref: dropdownRef,
|
|
638
629
|
},
|
|
@@ -36,12 +36,7 @@ const CMultiSelectSelection = defineComponent({
|
|
|
36
36
|
h(
|
|
37
37
|
'div',
|
|
38
38
|
{
|
|
39
|
-
class:
|
|
40
|
-
'form-multi-select-selection',
|
|
41
|
-
{
|
|
42
|
-
'form-multi-select-selection-tags': props.multiple && props.selectionType === 'tags',
|
|
43
|
-
},
|
|
44
|
-
],
|
|
39
|
+
class: 'form-multi-select-selection',
|
|
45
40
|
},
|
|
46
41
|
[
|
|
47
42
|
props.multiple &&
|
|
@@ -61,11 +56,15 @@ const CMultiSelectSelection = defineComponent({
|
|
|
61
56
|
return h('span', { class: 'form-multi-select-tag' }, [
|
|
62
57
|
option.text,
|
|
63
58
|
!option.disabled &&
|
|
64
|
-
h(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
59
|
+
h(
|
|
60
|
+
'button',
|
|
61
|
+
{
|
|
62
|
+
class: 'form-multi-select-tag-delete close',
|
|
63
|
+
ariaLabel: 'Close',
|
|
64
|
+
onClick: () => handleRemove(option),
|
|
65
|
+
},
|
|
66
|
+
h('span', { ariaHidden: 'true' }, 'x'),
|
|
67
|
+
),
|
|
69
68
|
])
|
|
70
69
|
}
|
|
71
70
|
return
|
|
@@ -130,6 +130,8 @@ const CPicker = defineComponent({
|
|
|
130
130
|
'div',
|
|
131
131
|
{
|
|
132
132
|
class: [
|
|
133
|
+
'dropdown',
|
|
134
|
+
'picker',
|
|
133
135
|
attrs.class,
|
|
134
136
|
{
|
|
135
137
|
show: visible.value,
|
|
@@ -154,13 +156,26 @@ const CPicker = defineComponent({
|
|
|
154
156
|
},
|
|
155
157
|
}),
|
|
156
158
|
),
|
|
157
|
-
h(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
159
|
+
h(
|
|
160
|
+
'div',
|
|
161
|
+
{
|
|
162
|
+
class: [
|
|
163
|
+
'dropdown-menu',
|
|
164
|
+
{
|
|
165
|
+
show: visible.value,
|
|
166
|
+
},
|
|
167
|
+
props.dropdownClassNames,
|
|
168
|
+
],
|
|
169
|
+
ref: dropdownRef,
|
|
170
|
+
},
|
|
171
|
+
[
|
|
172
|
+
slots.default && slots.default(),
|
|
173
|
+
/**
|
|
174
|
+
* @slot Location for the footer element.
|
|
175
|
+
*/
|
|
176
|
+
slots.footer && slots.footer(),
|
|
177
|
+
],
|
|
178
|
+
),
|
|
164
179
|
],
|
|
165
180
|
)
|
|
166
181
|
}
|
|
@@ -1,30 +1,54 @@
|
|
|
1
1
|
import { defineComponent, h, PropType, ref, RendererElement, Teleport, Transition } from 'vue'
|
|
2
|
-
import {
|
|
2
|
+
import type { Placement } from '@popperjs/core'
|
|
3
3
|
|
|
4
|
+
import { usePopper } from '../../composables'
|
|
5
|
+
import type { Placements, Triggers } from '../../types'
|
|
4
6
|
import { executeAfterTransition } from '../../utils/transition'
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const getPlacement = (placement: string, element: HTMLDivElement | null): Placement => {
|
|
8
|
-
switch (placement) {
|
|
9
|
-
case 'right': {
|
|
10
|
-
return isRTL(element) ? 'left' : 'right'
|
|
11
|
-
}
|
|
12
|
-
case 'left': {
|
|
13
|
-
return isRTL(element) ? 'right' : 'left'
|
|
14
|
-
}
|
|
15
|
-
default: {
|
|
16
|
-
return placement as Placement
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
7
|
+
import { getRTLPlacement } from '../../utils'
|
|
20
8
|
|
|
21
9
|
const CPopover = defineComponent({
|
|
22
10
|
name: 'CPopover',
|
|
23
11
|
props: {
|
|
12
|
+
/**
|
|
13
|
+
* Apply a CSS fade transition to the popover.
|
|
14
|
+
*
|
|
15
|
+
* @since 4.9.0
|
|
16
|
+
*/
|
|
17
|
+
animation: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: true,
|
|
20
|
+
},
|
|
24
21
|
/**
|
|
25
22
|
* Content for your component. If you want to pass non-string value please use dedicated slot `<template #content>...</template>`
|
|
26
23
|
*/
|
|
27
24
|
content: String,
|
|
25
|
+
/**
|
|
26
|
+
* The delay for displaying and hiding the popover (in milliseconds). When a numerical value is provided, the delay applies to both the hide and show actions. The object structure for specifying the delay is as follows: delay: `{ 'show': 500, 'hide': 100 }`.
|
|
27
|
+
*
|
|
28
|
+
* @since 4.9.0
|
|
29
|
+
*/
|
|
30
|
+
delay: {
|
|
31
|
+
type: [Number, Object] as PropType<number | { show: number; hide: number }>,
|
|
32
|
+
default: 0,
|
|
33
|
+
},
|
|
34
|
+
/**
|
|
35
|
+
* Specify the desired order of fallback placements by providing a list of placements as an array. The placements should be prioritized based on preference.
|
|
36
|
+
*
|
|
37
|
+
* @since 4.9.0
|
|
38
|
+
*/
|
|
39
|
+
fallbackPlacements: {
|
|
40
|
+
type: [String, Array] as PropType<Placements | Placements[]>,
|
|
41
|
+
default: () => ['top', 'right', 'bottom', 'left'],
|
|
42
|
+
validator: (value: Placements | Placements[]) => {
|
|
43
|
+
if (typeof value === 'string') {
|
|
44
|
+
return ['top', 'right', 'bottom', 'left'].includes(value)
|
|
45
|
+
}
|
|
46
|
+
if (Array.isArray(value)) {
|
|
47
|
+
return value.every((e) => ['top', 'right', 'bottom', 'left'].includes(e))
|
|
48
|
+
}
|
|
49
|
+
return false
|
|
50
|
+
},
|
|
51
|
+
},
|
|
28
52
|
/**
|
|
29
53
|
* Offset of the popover relative to its target.
|
|
30
54
|
*/
|
|
@@ -52,9 +76,9 @@ const CPopover = defineComponent({
|
|
|
52
76
|
* @values 'click', 'focus', 'hover'
|
|
53
77
|
*/
|
|
54
78
|
trigger: {
|
|
55
|
-
type: [String, Array] as PropType<
|
|
79
|
+
type: [String, Array] as PropType<Triggers | Triggers[]>,
|
|
56
80
|
default: 'click',
|
|
57
|
-
validator: (value:
|
|
81
|
+
validator: (value: Triggers | Triggers[]) => {
|
|
58
82
|
if (typeof value === 'string') {
|
|
59
83
|
return ['click', 'focus', 'hover'].includes(value)
|
|
60
84
|
}
|
|
@@ -82,12 +106,39 @@ const CPopover = defineComponent({
|
|
|
82
106
|
setup(props, { attrs, slots, emit }) {
|
|
83
107
|
const togglerRef = ref()
|
|
84
108
|
const popoverRef = ref()
|
|
85
|
-
const popper = ref()
|
|
86
109
|
const visible = ref(props.visible)
|
|
110
|
+
const { initPopper, destroyPopper } = usePopper()
|
|
111
|
+
|
|
112
|
+
const delay =
|
|
113
|
+
typeof props.delay === 'number' ? { show: props.delay, hide: props.delay } : props.delay
|
|
114
|
+
|
|
115
|
+
const popperConfig = {
|
|
116
|
+
modifiers: [
|
|
117
|
+
{
|
|
118
|
+
name: 'arrow',
|
|
119
|
+
options: {
|
|
120
|
+
element: '.popover-arrow',
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: 'flip',
|
|
125
|
+
options: {
|
|
126
|
+
fallbackPlacements: props.fallbackPlacements,
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: 'offset',
|
|
131
|
+
options: {
|
|
132
|
+
offset: props.offset,
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
placement: getRTLPlacement(props.placement, togglerRef.value),
|
|
137
|
+
}
|
|
87
138
|
|
|
88
139
|
const handleEnter = (el: RendererElement, done: () => void) => {
|
|
89
140
|
emit('show')
|
|
90
|
-
initPopper()
|
|
141
|
+
initPopper(togglerRef.value, popoverRef.value, popperConfig)
|
|
91
142
|
el.classList.add('show')
|
|
92
143
|
executeAfterTransition(() => done(), el as HTMLElement)
|
|
93
144
|
}
|
|
@@ -101,32 +152,18 @@ const CPopover = defineComponent({
|
|
|
101
152
|
}, el as HTMLElement)
|
|
102
153
|
}
|
|
103
154
|
|
|
104
|
-
const
|
|
155
|
+
const toggleVisible = (event: Event, _visible: boolean) => {
|
|
105
156
|
togglerRef.value = event.target
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
popper.value = createPopper(togglerRef.value, popoverRef.value, {
|
|
112
|
-
placement: getPlacement(props.placement, togglerRef.value),
|
|
113
|
-
modifiers: [
|
|
114
|
-
{
|
|
115
|
-
name: 'offset',
|
|
116
|
-
options: {
|
|
117
|
-
offset: props.offset,
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
],
|
|
121
|
-
})
|
|
157
|
+
if (_visible) {
|
|
158
|
+
setTimeout(() => {
|
|
159
|
+
visible.value = true
|
|
160
|
+
}, delay.show)
|
|
161
|
+
return
|
|
122
162
|
}
|
|
123
|
-
}
|
|
124
163
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
popper.value = undefined
|
|
164
|
+
setTimeout(() => {
|
|
165
|
+
visible.value = false
|
|
166
|
+
}, delay.hide)
|
|
130
167
|
}
|
|
131
168
|
|
|
132
169
|
return () => [
|
|
@@ -146,13 +183,19 @@ const CPopover = defineComponent({
|
|
|
146
183
|
h(
|
|
147
184
|
'div',
|
|
148
185
|
{
|
|
149
|
-
class:
|
|
186
|
+
class: [
|
|
187
|
+
'popover',
|
|
188
|
+
'bs-popover-auto',
|
|
189
|
+
{
|
|
190
|
+
fade: props.animation,
|
|
191
|
+
},
|
|
192
|
+
],
|
|
150
193
|
ref: popoverRef,
|
|
151
194
|
role: 'tooltip',
|
|
152
195
|
...attrs,
|
|
153
196
|
},
|
|
154
197
|
[
|
|
155
|
-
h('div', { class: 'popover-arrow'
|
|
198
|
+
h('div', { class: 'popover-arrow' }),
|
|
156
199
|
(props.title || slots.title) &&
|
|
157
200
|
h(
|
|
158
201
|
'div',
|
|
@@ -176,11 +219,14 @@ const CPopover = defineComponent({
|
|
|
176
219
|
slots.toggler &&
|
|
177
220
|
slots.toggler({
|
|
178
221
|
on: {
|
|
179
|
-
click: (event: Event) =>
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
222
|
+
click: (event: Event) =>
|
|
223
|
+
props.trigger.includes('click') && toggleVisible(event, !visible.value),
|
|
224
|
+
blur: (event: Event) => props.trigger.includes('focus') && toggleVisible(event, false),
|
|
225
|
+
focus: (event: Event) => props.trigger.includes('focus') && toggleVisible(event, true),
|
|
226
|
+
mouseenter: (event: Event) =>
|
|
227
|
+
props.trigger.includes('hover') && toggleVisible(event, true),
|
|
228
|
+
mouseleave: (event: Event) =>
|
|
229
|
+
props.trigger.includes('hover') && toggleVisible(event, false),
|
|
184
230
|
},
|
|
185
231
|
}),
|
|
186
232
|
]
|
|
@@ -391,42 +391,72 @@ const CTimePicker = defineComponent({
|
|
|
391
391
|
}
|
|
392
392
|
|
|
393
393
|
const InputGroup = () =>
|
|
394
|
-
h(
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
class:
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
394
|
+
h(
|
|
395
|
+
'div',
|
|
396
|
+
{
|
|
397
|
+
class: [
|
|
398
|
+
'input-group',
|
|
399
|
+
'picker-input-group',
|
|
400
|
+
{
|
|
401
|
+
[`input-group-${props.size}`]: props.size,
|
|
402
|
+
},
|
|
403
|
+
],
|
|
404
|
+
},
|
|
405
|
+
[
|
|
406
|
+
h('input', {
|
|
407
|
+
autocomplete: 'off',
|
|
408
|
+
class: 'form-control',
|
|
409
|
+
disabled: props.disabled,
|
|
410
|
+
onInput: (event: Event) => {
|
|
411
|
+
if (isValidTime((event.target as HTMLInputElement).value)) {
|
|
412
|
+
date.value = convertTimeToDate((event.target as HTMLInputElement).value)
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
placeholder: props.placeholder,
|
|
416
|
+
readonly: props.inputReadOnly,
|
|
417
|
+
ref: inputRef,
|
|
418
|
+
required: props.required,
|
|
419
|
+
value: date.value
|
|
420
|
+
? date.value.toLocaleTimeString(props.locale, {
|
|
421
|
+
hour12: localizedTimePartials.value && localizedTimePartials.value.hour12,
|
|
422
|
+
...(!props.seconds && { timeStyle: 'short' }),
|
|
423
|
+
})
|
|
424
|
+
: '',
|
|
421
425
|
}),
|
|
422
|
-
|
|
426
|
+
(props.indicator || props.cleaner) &&
|
|
427
|
+
h('div', { class: 'input-group-text' }, [
|
|
428
|
+
props.indicator &&
|
|
429
|
+
h(
|
|
430
|
+
'span',
|
|
431
|
+
{
|
|
432
|
+
class: 'picker-input-group-indicator',
|
|
433
|
+
},
|
|
434
|
+
slots.indicator
|
|
435
|
+
? slots.indicator()
|
|
436
|
+
: h('span', { class: 'picker-input-group-icon time-picker-input-icon' }),
|
|
437
|
+
),
|
|
438
|
+
props.cleaner &&
|
|
439
|
+
h(
|
|
440
|
+
'span',
|
|
441
|
+
{
|
|
442
|
+
class: 'picker-input-group-cleaner',
|
|
443
|
+
onClick: (event: Event) => handleClear(event),
|
|
444
|
+
role: 'button',
|
|
445
|
+
},
|
|
446
|
+
slots.cleaner
|
|
447
|
+
? slots.cleaner()
|
|
448
|
+
: h('span', { class: 'picker-input-group-icon time-picker-cleaner-icon' }),
|
|
449
|
+
),
|
|
450
|
+
]),
|
|
451
|
+
],
|
|
452
|
+
)
|
|
423
453
|
|
|
424
454
|
const TimePickerSelect = () => [
|
|
425
455
|
h('span', { class: 'time-picker-inline-icon' }),
|
|
426
456
|
h(
|
|
427
457
|
'select',
|
|
428
458
|
{
|
|
429
|
-
class: '
|
|
459
|
+
class: 'form-select',
|
|
430
460
|
disabled: props.disabled,
|
|
431
461
|
onChange: (event: Event) =>
|
|
432
462
|
handleTimeChange('hours', (event.target as HTMLSelectElement).value),
|
|
@@ -447,7 +477,7 @@ const CTimePicker = defineComponent({
|
|
|
447
477
|
h(
|
|
448
478
|
'select',
|
|
449
479
|
{
|
|
450
|
-
class: '
|
|
480
|
+
class: 'form-select',
|
|
451
481
|
disabled: props.disabled,
|
|
452
482
|
onChange: (event: Event) =>
|
|
453
483
|
handleTimeChange('minutes', (event.target as HTMLSelectElement).value),
|
|
@@ -469,7 +499,7 @@ const CTimePicker = defineComponent({
|
|
|
469
499
|
h(
|
|
470
500
|
'select',
|
|
471
501
|
{
|
|
472
|
-
class: '
|
|
502
|
+
class: 'form-select',
|
|
473
503
|
disabled: props.disabled,
|
|
474
504
|
onChange: (event: Event) =>
|
|
475
505
|
handleTimeChange('seconds', (event.target as HTMLSelectElement).value),
|
|
@@ -491,7 +521,7 @@ const CTimePicker = defineComponent({
|
|
|
491
521
|
h(
|
|
492
522
|
'select',
|
|
493
523
|
{
|
|
494
|
-
class: '
|
|
524
|
+
class: 'form-select',
|
|
495
525
|
disabled: props.disabled,
|
|
496
526
|
onChange: (event: Event) =>
|
|
497
527
|
handleTimeChange('toggle', (event.target as HTMLSelectElement).value),
|
|
@@ -568,7 +598,6 @@ const CTimePicker = defineComponent({
|
|
|
568
598
|
class: [
|
|
569
599
|
'time-picker',
|
|
570
600
|
{
|
|
571
|
-
[`time-picker-${props.size}`]: props.size,
|
|
572
601
|
disabled: props.disabled,
|
|
573
602
|
'is-invalid': isValid.value === false ? true : false,
|
|
574
603
|
'is-valid': isValid.value,
|
|
@@ -614,7 +643,7 @@ const CTimePicker = defineComponent({
|
|
|
614
643
|
props.variant === 'select' ? TimePickerSelect() : TimePickerRoll(),
|
|
615
644
|
),
|
|
616
645
|
footer: () =>
|
|
617
|
-
h('div', { class: '
|
|
646
|
+
h('div', { class: 'picker-footer' }, [
|
|
618
647
|
props.cancelButton &&
|
|
619
648
|
h(
|
|
620
649
|
CButton,
|