@coreui/vue-pro 4.8.0-next.1 → 4.8.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/form/CFormCheck.d.ts +13 -0
- package/dist/components/form/CFormSwitch.d.ts +13 -0
- package/dist/components/smart-table/CSmartTable.d.ts +1 -1
- package/dist/components/smart-table/CSmartTableHead.d.ts +1 -1
- package/dist/index.es.js +47 -32
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +46 -31
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/carousel/CCarousel.ts +36 -34
- package/src/components/form/CFormCheck.ts +7 -0
- package/src/components/form/CFormSwitch.ts +7 -0
- package/dist/components/accordion/CAccordionCollapse.d.ts +0 -22
- package/dist/components/multi-select/CMultiSelect copy.d.ts +0 -305
- package/dist/components/pagination/CSmartPagination.d.ts +0 -257
- package/dist/utils/calendar.d.ts +0 -23
- package/dist/utils/getNextSibling.d.ts +0 -2
- package/dist/utils/getPreviousSibling.d.ts +0 -2
- package/dist/utils/isObjectInArray.d.ts +0 -2
- package/dist/utils/isVisible.d.ts +0 -2
- package/dist/utils/time.d.ts +0 -21
package/dist/index.js
CHANGED
|
@@ -1983,10 +1983,13 @@ const CCarousel = vue.defineComponent({
|
|
|
1983
1983
|
},
|
|
1984
1984
|
setup(props, { slots }) {
|
|
1985
1985
|
const carouselRef = vue.ref();
|
|
1986
|
-
const
|
|
1986
|
+
const active = vue.ref(props.index);
|
|
1987
1987
|
const animating = vue.ref(false);
|
|
1988
|
-
const visible = vue.ref();
|
|
1989
1988
|
const customInterval = vue.ref(props.interval);
|
|
1989
|
+
const direction = vue.ref('next');
|
|
1990
|
+
const items = vue.ref([]);
|
|
1991
|
+
const timeout = vue.ref();
|
|
1992
|
+
const visible = vue.ref();
|
|
1990
1993
|
const setAnimating = (value) => {
|
|
1991
1994
|
animating.value = value;
|
|
1992
1995
|
};
|
|
@@ -2002,27 +2005,16 @@ const CCarousel = vue.defineComponent({
|
|
|
2002
2005
|
timeout.value = setTimeout(() => nextItemWhenVisible(), typeof customInterval.value === 'number' ? customInterval.value : props.interval);
|
|
2003
2006
|
}
|
|
2004
2007
|
};
|
|
2005
|
-
const
|
|
2006
|
-
items: [],
|
|
2007
|
-
active: props.index,
|
|
2008
|
-
direction: 'next',
|
|
2009
|
-
});
|
|
2010
|
-
vue.onBeforeMount(() => {
|
|
2011
|
-
if (slots.default) {
|
|
2012
|
-
// @ts-expect-error TODO: fix types
|
|
2013
|
-
state.items = slots.default().filter((child) => child.type.name === 'CCarouselItem');
|
|
2014
|
-
}
|
|
2015
|
-
});
|
|
2016
|
-
const handleControlClick = (direction) => {
|
|
2008
|
+
const handleControlClick = (_direction) => {
|
|
2017
2009
|
if (animating.value) {
|
|
2018
2010
|
return;
|
|
2019
2011
|
}
|
|
2020
|
-
|
|
2021
|
-
if (
|
|
2022
|
-
|
|
2012
|
+
direction.value = _direction;
|
|
2013
|
+
if (_direction === 'next') {
|
|
2014
|
+
active.value === items.value.length - 1 ? (active.value = 0) : active.value++;
|
|
2023
2015
|
}
|
|
2024
2016
|
else {
|
|
2025
|
-
|
|
2017
|
+
active.value === 0 ? (active.value = items.value.length - 1) : active.value--;
|
|
2026
2018
|
}
|
|
2027
2019
|
};
|
|
2028
2020
|
const nextItemWhenVisible = () => {
|
|
@@ -2033,17 +2025,17 @@ const CCarousel = vue.defineComponent({
|
|
|
2033
2025
|
}
|
|
2034
2026
|
};
|
|
2035
2027
|
const handleIndicatorClick = (index) => {
|
|
2036
|
-
if (
|
|
2028
|
+
if (active.value === index) {
|
|
2037
2029
|
return;
|
|
2038
2030
|
}
|
|
2039
|
-
if (
|
|
2040
|
-
|
|
2041
|
-
|
|
2031
|
+
if (active.value < index) {
|
|
2032
|
+
direction.value = 'next';
|
|
2033
|
+
active.value = index;
|
|
2042
2034
|
return;
|
|
2043
2035
|
}
|
|
2044
|
-
if (
|
|
2045
|
-
|
|
2046
|
-
|
|
2036
|
+
if (active.value > index) {
|
|
2037
|
+
direction.value = 'prev';
|
|
2038
|
+
active.value = index;
|
|
2047
2039
|
}
|
|
2048
2040
|
};
|
|
2049
2041
|
const handleScroll = () => {
|
|
@@ -2054,6 +2046,15 @@ const CCarousel = vue.defineComponent({
|
|
|
2054
2046
|
visible.value = false;
|
|
2055
2047
|
}
|
|
2056
2048
|
};
|
|
2049
|
+
vue.onBeforeMount(() => {
|
|
2050
|
+
if (slots.default) {
|
|
2051
|
+
const children = typeof slots.default()[0].type === 'symbol' ? slots.default()[0].children : slots.default();
|
|
2052
|
+
if (children && Array.isArray(children)) {
|
|
2053
|
+
// @ts-expect-error TODO: fix types
|
|
2054
|
+
items.value = children.filter((child) => child.type.name === 'CCarouselItem');
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
});
|
|
2057
2058
|
vue.onMounted(() => {
|
|
2058
2059
|
window.addEventListener('scroll', handleScroll);
|
|
2059
2060
|
});
|
|
@@ -2063,7 +2064,7 @@ const CCarousel = vue.defineComponent({
|
|
|
2063
2064
|
!animating.value && cycle();
|
|
2064
2065
|
return;
|
|
2065
2066
|
}
|
|
2066
|
-
if (!props.wrap &&
|
|
2067
|
+
if (!props.wrap && active.value < items.value.length - 1) {
|
|
2067
2068
|
!animating.value && cycle();
|
|
2068
2069
|
}
|
|
2069
2070
|
});
|
|
@@ -2084,19 +2085,19 @@ const CCarousel = vue.defineComponent({
|
|
|
2084
2085
|
props.indicators &&
|
|
2085
2086
|
vue.h('div', {
|
|
2086
2087
|
class: 'carousel-indicators',
|
|
2087
|
-
},
|
|
2088
|
+
}, items.value.map((_, index) => {
|
|
2088
2089
|
return vue.h('button', {
|
|
2089
2090
|
type: 'button',
|
|
2090
2091
|
id: index,
|
|
2091
2092
|
'data-coreui-target': '',
|
|
2092
|
-
...(
|
|
2093
|
+
...(active.value === index && { class: 'active' }),
|
|
2093
2094
|
onClick: () => handleIndicatorClick(index),
|
|
2094
2095
|
});
|
|
2095
2096
|
})),
|
|
2096
|
-
vue.h('div', { class: 'carousel-inner' },
|
|
2097
|
+
vue.h('div', { class: 'carousel-inner' }, items.value.map((item, index) => {
|
|
2097
2098
|
return vue.h(item, {
|
|
2098
|
-
active:
|
|
2099
|
-
direction:
|
|
2099
|
+
active: active.value === index ? true : false,
|
|
2100
|
+
direction: direction.value,
|
|
2100
2101
|
});
|
|
2101
2102
|
})),
|
|
2102
2103
|
props.controls && [
|
|
@@ -4815,6 +4816,12 @@ const CFormCheck = vue.defineComponent({
|
|
|
4815
4816
|
type: [Boolean, String],
|
|
4816
4817
|
value: undefined,
|
|
4817
4818
|
},
|
|
4819
|
+
/**
|
|
4820
|
+
* Put checkboxes or radios on the opposite side.
|
|
4821
|
+
*
|
|
4822
|
+
* @sinve 4.8.0
|
|
4823
|
+
*/
|
|
4824
|
+
reverse: Boolean,
|
|
4818
4825
|
/**
|
|
4819
4826
|
* Display validation feedback in a styled tooltip.
|
|
4820
4827
|
*
|
|
@@ -4857,6 +4864,7 @@ const CFormCheck = vue.defineComponent({
|
|
|
4857
4864
|
'form-check',
|
|
4858
4865
|
{
|
|
4859
4866
|
'form-check-inline': props.inline,
|
|
4867
|
+
'form-check-reverse': props.reverse,
|
|
4860
4868
|
'is-invalid': props.invalid,
|
|
4861
4869
|
'is-valid': props.valid,
|
|
4862
4870
|
},
|
|
@@ -5554,6 +5562,12 @@ const CFormSwitch = vue.defineComponent({
|
|
|
5554
5562
|
type: [Boolean, String],
|
|
5555
5563
|
value: undefined,
|
|
5556
5564
|
},
|
|
5565
|
+
/**
|
|
5566
|
+
* Put checkboxes or radios on the opposite side.
|
|
5567
|
+
*
|
|
5568
|
+
* @sinve 4.8.0
|
|
5569
|
+
*/
|
|
5570
|
+
reverse: Boolean,
|
|
5557
5571
|
/**
|
|
5558
5572
|
* Size the component large or extra large. Works only with `switch`.
|
|
5559
5573
|
*
|
|
@@ -5601,6 +5615,7 @@ const CFormSwitch = vue.defineComponent({
|
|
|
5601
5615
|
class: [
|
|
5602
5616
|
'form-check form-switch',
|
|
5603
5617
|
{
|
|
5618
|
+
'form-check-reverse': props.reverse,
|
|
5604
5619
|
[`form-switch-${props.size}`]: props.size,
|
|
5605
5620
|
'is-invalid': props.invalid,
|
|
5606
5621
|
'is-valid': props.valid,
|