@coreui/vue-pro 4.1.0 → 4.1.4
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/accordion/CAccordion.d.ts +18 -10
- package/dist/components/accordion/CAccordionBody.d.ts +1 -1
- package/dist/components/accordion/CAccordionButton.d.ts +1 -1
- package/dist/components/accordion/CAccordionCollapse.d.ts +9 -5
- package/dist/components/accordion/CAccordionHeader.d.ts +1 -1
- package/dist/components/accordion/CAccordionItem.d.ts +10 -5
- package/dist/components/alert/CAlert.d.ts +38 -12
- package/dist/components/alert/CAlertHeading.d.ts +10 -5
- package/dist/components/alert/CAlertLink.d.ts +1 -1
- package/dist/components/avatar/CAvatar.d.ts +59 -15
- package/dist/components/backdrop/CBackdrop.d.ts +10 -5
- package/dist/components/badge/CBadge.d.ts +59 -16
- package/dist/components/breadcrumb/CBreadcrumb.d.ts +1 -1
- package/dist/components/breadcrumb/CBreadcrumbItem.d.ts +17 -8
- package/dist/components/button/CButton.d.ts +73 -20
- package/dist/components/button-group/CButtonGroup.d.ts +20 -8
- package/dist/components/button-group/CButtonToolbar.d.ts +1 -1
- package/dist/components/callout/CCallout.d.ts +11 -5
- package/dist/components/card/CCard.d.ts +20 -7
- package/dist/components/card/CCardBody.d.ts +1 -1
- package/dist/components/card/CCardFooter.d.ts +1 -1
- package/dist/components/card/CCardGroup.d.ts +1 -1
- package/dist/components/card/CCardHeader.d.ts +10 -5
- package/dist/components/card/CCardImage.d.ts +21 -8
- package/dist/components/card/CCardImageOverlay.d.ts +1 -1
- package/dist/components/card/CCardLink.d.ts +10 -5
- package/dist/components/card/CCardSubtitle.d.ts +10 -5
- package/dist/components/card/CCardText.d.ts +10 -5
- package/dist/components/card/CCardTitle.d.ts +10 -5
- package/dist/components/carousel/CCarousel.d.ts +58 -19
- package/dist/components/carousel/CCarouselCaption.d.ts +1 -1
- package/dist/components/carousel/CCarouselItem.d.ts +25 -9
- package/dist/components/close-button/CCloseButton.d.ts +16 -7
- package/dist/components/collapse/CCollapse.d.ts +16 -7
- package/dist/components/dropdown/CDropdown.d.ts +82 -22
- package/dist/components/dropdown/CDropdownDivider.d.ts +1 -1
- package/dist/components/dropdown/CDropdownHeader.d.ts +10 -5
- package/dist/components/dropdown/CDropdownItem.d.ts +32 -12
- package/dist/components/dropdown/CDropdownMenu.d.ts +12 -5
- package/dist/components/dropdown/CDropdownToggle.d.ts +78 -22
- package/dist/components/element-cover/CElementCover.d.ts +22 -7
- package/dist/components/footer/CFooter.d.ts +13 -5
- package/dist/components/form/CForm.d.ts +9 -5
- package/dist/components/form/CFormCheck.d.ts +66 -23
- package/dist/components/form/CFormControl.d.ts +61 -20
- package/dist/components/form/CFormFeedback.d.ts +22 -11
- package/dist/components/form/CFormFloating.d.ts +1 -1
- package/dist/components/form/CFormInput.d.ts +66 -20
- package/dist/components/form/CFormLabel.d.ts +10 -5
- package/dist/components/form/CFormRange.d.ts +59 -18
- package/dist/components/form/CFormSelect.d.ts +66 -18
- package/dist/components/form/CFormSwitch.d.ts +61 -18
- package/dist/components/form/CFormText.d.ts +10 -5
- package/dist/components/form/CFormTextarea.d.ts +45 -16
- package/dist/components/form/CInputGroup.d.ts +13 -5
- package/dist/components/form/CInputGroupText.d.ts +10 -5
- package/dist/components/grid/CCol.d.ts +62 -15
- package/dist/components/grid/CContainer.d.ts +44 -15
- package/dist/components/grid/CRow.d.ts +57 -15
- package/dist/components/header/CHeader.d.ts +24 -7
- package/dist/components/header/CHeaderBrand.d.ts +10 -5
- package/dist/components/header/CHeaderDivider.d.ts +1 -1
- package/dist/components/header/CHeaderNav.d.ts +10 -5
- package/dist/components/header/CHeaderText.d.ts +1 -1
- package/dist/components/header/CHeaderToggler.d.ts +1 -1
- package/dist/components/image/CImage.d.ts +34 -12
- package/dist/components/link/CLink.d.ts +32 -12
- package/dist/components/list-group/CListGroup.d.ts +28 -10
- package/dist/components/list-group/CListGroupItem.d.ts +33 -12
- package/dist/components/modal/CModal.d.ts +96 -22
- package/dist/components/modal/CModalBody.d.ts +1 -1
- package/dist/components/modal/CModalFooter.d.ts +1 -1
- package/dist/components/modal/CModalHeader.d.ts +10 -5
- package/dist/components/modal/CModalTitle.d.ts +10 -5
- package/dist/components/multi-select/CMultiSelect.d.ts +131 -30
- package/dist/components/multi-select/CMultiSelectNativeSelect.d.ts +26 -11
- package/dist/components/multi-select/CMultiSelectOptions.d.ts +40 -11
- package/dist/components/multi-select/CMultiSelectSelection.d.ts +47 -13
- package/dist/components/nav/CNav.d.ts +32 -10
- package/dist/components/nav/CNavGroup.d.ts +10 -7
- package/dist/components/nav/CNavGroupItems.d.ts +1 -1
- package/dist/components/nav/CNavLink.d.ts +32 -12
- package/dist/components/nav/CNavTitle.d.ts +1 -1
- package/dist/components/navbar/CNavbar.d.ts +63 -16
- package/dist/components/navbar/CNavbarBrand.d.ts +19 -8
- package/dist/components/navbar/CNavbarNav.d.ts +10 -5
- package/dist/components/navbar/CNavbarText.d.ts +1 -1
- package/dist/components/navbar/CNavbarToggler.d.ts +1 -1
- package/dist/components/offcanvas/COffcanvas.d.ts +44 -14
- package/dist/components/offcanvas/COffcanvasBody.d.ts +1 -1
- package/dist/components/offcanvas/COffcanvasHeader.d.ts +1 -1
- package/dist/components/offcanvas/COffcanvasTitle.d.ts +10 -5
- package/dist/components/pagination/CPagination.d.ts +24 -7
- package/dist/components/pagination/CPaginationItem.d.ts +32 -12
- package/dist/components/pagination/CSmartPagination.d.ts +120 -28
- package/dist/components/placeholder/CPlaceholder.d.ts +89 -24
- package/dist/components/popover/CPopover.d.ts +50 -16
- package/dist/components/progress/CProgressBar.d.ts +37 -12
- package/dist/components/sidebar/CSidebar.d.ts +59 -20
- package/dist/components/sidebar/CSidebarBrand.d.ts +1 -1
- package/dist/components/sidebar/CSidebarFooter.d.ts +1 -1
- package/dist/components/sidebar/CSidebarHeader.d.ts +1 -1
- package/dist/components/sidebar/CSidebarNav.d.ts +1 -1
- package/dist/components/sidebar/CSidebarToggler.d.ts +1 -1
- package/dist/components/smart-table/CSmartTable.d.ts +280 -68
- package/dist/components/smart-table/CSmartTableBody.d.ts +31 -25
- package/dist/components/smart-table/CSmartTableCleaner.d.ts +7 -5
- package/dist/components/smart-table/CSmartTableFilter.d.ts +17 -9
- package/dist/components/smart-table/CSmartTableHead.d.ts +43 -24
- package/dist/components/smart-table/CSmartTableItemsPerPageSelector.d.ts +17 -10
- package/dist/components/spinner/CSpinner.d.ts +51 -14
- package/dist/components/table/CTable.d.ts +88 -24
- package/dist/components/table/CTableBody.d.ts +11 -5
- package/dist/components/table/CTableCaption.d.ts +2 -4
- package/dist/components/table/CTableDataCell.d.ts +29 -10
- package/dist/components/table/CTableFoot.d.ts +11 -5
- package/dist/components/table/CTableHead.d.ts +11 -5
- package/dist/components/table/CTableHeaderCell.d.ts +11 -5
- package/dist/components/table/CTableRow.d.ts +29 -10
- package/dist/components/tabs/CTabContent.d.ts +1 -1
- package/dist/components/tabs/CTabPane.d.ts +10 -5
- package/dist/components/toast/CToast.d.ts +59 -18
- package/dist/components/toast/CToastBody.d.ts +1 -1
- package/dist/components/toast/CToastHeader.d.ts +9 -5
- package/dist/components/toast/CToaster.d.ts +13 -5
- package/dist/components/tooltip/CTooltip.d.ts +42 -14
- package/dist/components/widgets/CWidgetStatsA.d.ts +23 -10
- package/dist/components/widgets/CWidgetStatsB.d.ts +45 -17
- package/dist/components/widgets/CWidgetStatsC.d.ts +37 -15
- package/dist/components/widgets/CWidgetStatsD.d.ts +19 -8
- package/dist/components/widgets/CWidgetStatsE.d.ts +18 -8
- package/dist/components/widgets/CWidgetStatsF.d.ts +42 -14
- package/dist/index.es.js +118 -71
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +117 -70
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/components/form/CFormSelect.ts +19 -6
- package/src/components/form/__tests__/__snapshots__/CFormCheck.spec.ts.snap +8 -2
- package/src/components/form/__tests__/__snapshots__/CFormSelect.spec.ts.snap +1 -1
- package/src/components/modal/CModal.ts +68 -40
- package/src/components/modal/__tests__/__snapshots__/CModal.spec.ts.snap +1 -2
- package/src/components/offcanvas/COffcanvas.ts +11 -4
- package/src/components/sidebar/__tests__/__snapshots__/CSidebar.spec.ts.snap +2 -8
- package/src/components/smart-table/CSmartTable.ts +25 -20
- package/src/components/smart-table/CSmartTableBody.ts +0 -5
- package/src/components/smart-table/CSmartTableHead.ts +14 -5
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, provide, h as h$1, Transition, withDirectives, inject, watch, reactive, onBeforeMount, onMounted, onUpdated, toRefs, onUnmounted, nextTick, computed, Teleport, onBeforeUnmount
|
|
1
|
+
import { defineComponent, ref, provide, h as h$1, Transition, withDirectives, inject, watch, reactive, onBeforeMount, onMounted, onUpdated, toRefs, onUnmounted, nextTick, vShow, computed, Teleport, onBeforeUnmount } from 'vue';
|
|
2
2
|
|
|
3
3
|
const CAccordion = defineComponent({
|
|
4
4
|
name: 'CAccordion',
|
|
@@ -1997,13 +1997,21 @@ function mapToStyles(_ref2) {
|
|
|
1997
1997
|
adaptive = _ref2.adaptive,
|
|
1998
1998
|
roundOffsets = _ref2.roundOffsets,
|
|
1999
1999
|
isFixed = _ref2.isFixed;
|
|
2000
|
+
var _offsets$x = offsets.x,
|
|
2001
|
+
x = _offsets$x === void 0 ? 0 : _offsets$x,
|
|
2002
|
+
_offsets$y = offsets.y,
|
|
2003
|
+
y = _offsets$y === void 0 ? 0 : _offsets$y;
|
|
2000
2004
|
|
|
2001
|
-
var _ref3 =
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2005
|
+
var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
|
|
2006
|
+
x: x,
|
|
2007
|
+
y: y
|
|
2008
|
+
}) : {
|
|
2009
|
+
x: x,
|
|
2010
|
+
y: y
|
|
2011
|
+
};
|
|
2006
2012
|
|
|
2013
|
+
x = _ref3.x;
|
|
2014
|
+
y = _ref3.y;
|
|
2007
2015
|
var hasX = offsets.hasOwnProperty('x');
|
|
2008
2016
|
var hasY = offsets.hasOwnProperty('y');
|
|
2009
2017
|
var sideX = left;
|
|
@@ -2048,6 +2056,17 @@ function mapToStyles(_ref2) {
|
|
|
2048
2056
|
position: position
|
|
2049
2057
|
}, adaptive && unsetSides);
|
|
2050
2058
|
|
|
2059
|
+
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
2060
|
+
x: x,
|
|
2061
|
+
y: y
|
|
2062
|
+
}) : {
|
|
2063
|
+
x: x,
|
|
2064
|
+
y: y
|
|
2065
|
+
};
|
|
2066
|
+
|
|
2067
|
+
x = _ref4.x;
|
|
2068
|
+
y = _ref4.y;
|
|
2069
|
+
|
|
2051
2070
|
if (gpuAcceleration) {
|
|
2052
2071
|
var _Object$assign;
|
|
2053
2072
|
|
|
@@ -2057,9 +2076,9 @@ function mapToStyles(_ref2) {
|
|
|
2057
2076
|
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
|
2058
2077
|
}
|
|
2059
2078
|
|
|
2060
|
-
function computeStyles(
|
|
2061
|
-
var state =
|
|
2062
|
-
options =
|
|
2079
|
+
function computeStyles(_ref5) {
|
|
2080
|
+
var state = _ref5.state,
|
|
2081
|
+
options = _ref5.options;
|
|
2063
2082
|
var _options$gpuAccelerat = options.gpuAcceleration,
|
|
2064
2083
|
gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
|
|
2065
2084
|
_options$adaptive = options.adaptive,
|
|
@@ -2358,7 +2377,7 @@ function getClippingParents(element) {
|
|
|
2358
2377
|
|
|
2359
2378
|
|
|
2360
2379
|
return clippingParents.filter(function (clippingParent) {
|
|
2361
|
-
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'
|
|
2380
|
+
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
|
|
2362
2381
|
});
|
|
2363
2382
|
} // Gets the maximum area that the element is visible in due to any number of
|
|
2364
2383
|
// clipping parents
|
|
@@ -4640,10 +4659,14 @@ const CFormSelect = defineComponent({
|
|
|
4640
4659
|
* The default name for a value passed using v-model.
|
|
4641
4660
|
*/
|
|
4642
4661
|
modelValue: {
|
|
4643
|
-
type: String,
|
|
4662
|
+
type: [String, Array],
|
|
4644
4663
|
default: undefined,
|
|
4645
4664
|
require: false,
|
|
4646
4665
|
},
|
|
4666
|
+
multiple: {
|
|
4667
|
+
type: Boolean,
|
|
4668
|
+
required: false,
|
|
4669
|
+
},
|
|
4647
4670
|
/**
|
|
4648
4671
|
* Options list of the select component. Available keys: `label`, `value`, `disabled`.
|
|
4649
4672
|
* Examples:
|
|
@@ -4692,9 +4715,8 @@ const CFormSelect = defineComponent({
|
|
|
4692
4715
|
const selected = Array.from(target.options)
|
|
4693
4716
|
.filter((option) => option.selected)
|
|
4694
4717
|
.map((option) => option.value);
|
|
4695
|
-
const value = target.multiple ? selected : selected[0];
|
|
4696
4718
|
emit('change', event);
|
|
4697
|
-
emit('update:modelValue',
|
|
4719
|
+
emit('update:modelValue', target.multiple ? selected : selected[0]);
|
|
4698
4720
|
};
|
|
4699
4721
|
return () => h$1('select', {
|
|
4700
4722
|
class: [
|
|
@@ -4705,14 +4727,23 @@ const CFormSelect = defineComponent({
|
|
|
4705
4727
|
'is-valid': props.valid,
|
|
4706
4728
|
},
|
|
4707
4729
|
],
|
|
4730
|
+
multiple: props.multiple,
|
|
4708
4731
|
onChange: (event) => handleChange(event),
|
|
4709
4732
|
size: props.htmlSize,
|
|
4733
|
+
...(props.modelValue && !props.multiple && { value: props.modelValue }),
|
|
4710
4734
|
}, props.options
|
|
4711
4735
|
? props.options.map((option) => {
|
|
4712
4736
|
return h$1('option', {
|
|
4713
|
-
...(typeof option === 'object' &&
|
|
4714
|
-
option.disabled && { disabled: option.disabled }),
|
|
4715
|
-
|
|
4737
|
+
...(typeof option === 'object' && {
|
|
4738
|
+
...(option.disabled && { disabled: option.disabled }),
|
|
4739
|
+
...(option.selected && { selected: option.selected }),
|
|
4740
|
+
...(option.value && {
|
|
4741
|
+
value: option.value,
|
|
4742
|
+
...(props.modelValue &&
|
|
4743
|
+
props.multiple &&
|
|
4744
|
+
props.modelValue.includes(option.value) && { selected: true }),
|
|
4745
|
+
}),
|
|
4746
|
+
}),
|
|
4716
4747
|
}, typeof option === 'string' ? option : option.label);
|
|
4717
4748
|
})
|
|
4718
4749
|
: slots.default && slots.default());
|
|
@@ -5738,6 +5769,14 @@ const CModal = defineComponent({
|
|
|
5738
5769
|
default: true,
|
|
5739
5770
|
required: false,
|
|
5740
5771
|
},
|
|
5772
|
+
/**
|
|
5773
|
+
* By default the component is unmounted after close animation, if you want to keep the component mounted set this property to false.
|
|
5774
|
+
*/
|
|
5775
|
+
unmountOnClose: {
|
|
5776
|
+
type: Boolean,
|
|
5777
|
+
default: true,
|
|
5778
|
+
required: false,
|
|
5779
|
+
},
|
|
5741
5780
|
/**
|
|
5742
5781
|
* Toggle the visibility of alert component.
|
|
5743
5782
|
*/
|
|
@@ -5776,7 +5815,7 @@ const CModal = defineComponent({
|
|
|
5776
5815
|
emit('show');
|
|
5777
5816
|
};
|
|
5778
5817
|
const handleAfterEnter = () => {
|
|
5779
|
-
window.addEventListener('
|
|
5818
|
+
window.addEventListener('mousedown', handleMouseDown);
|
|
5780
5819
|
window.addEventListener('keyup', handleKeyUp);
|
|
5781
5820
|
};
|
|
5782
5821
|
const handleLeave = (el, done) => {
|
|
@@ -5787,7 +5826,7 @@ const CModal = defineComponent({
|
|
|
5787
5826
|
el.classList.remove('show');
|
|
5788
5827
|
};
|
|
5789
5828
|
const handleAfterLeave = (el) => {
|
|
5790
|
-
window.removeEventListener('
|
|
5829
|
+
window.removeEventListener('mousedown', handleMouseDown);
|
|
5791
5830
|
window.removeEventListener('keyup', handleKeyUp);
|
|
5792
5831
|
el.style.display = 'none';
|
|
5793
5832
|
};
|
|
@@ -5809,7 +5848,10 @@ const CModal = defineComponent({
|
|
|
5809
5848
|
}
|
|
5810
5849
|
}
|
|
5811
5850
|
};
|
|
5812
|
-
const
|
|
5851
|
+
const handleMouseDown = (event) => {
|
|
5852
|
+
window.addEventListener('mouseup', () => handleMouseUp(event), { once: true });
|
|
5853
|
+
};
|
|
5854
|
+
const handleMouseUp = (event) => {
|
|
5813
5855
|
if (modalContentRef.value && !modalContentRef.value.contains(event.target)) {
|
|
5814
5856
|
if (props.backdrop !== 'static') {
|
|
5815
5857
|
handleDismiss();
|
|
@@ -5823,35 +5865,38 @@ const CModal = defineComponent({
|
|
|
5823
5865
|
}
|
|
5824
5866
|
};
|
|
5825
5867
|
provide('handleDismiss', handleDismiss);
|
|
5868
|
+
const modal = () => h$1('div', {
|
|
5869
|
+
class: [
|
|
5870
|
+
'modal',
|
|
5871
|
+
{
|
|
5872
|
+
['fade']: props.transition,
|
|
5873
|
+
},
|
|
5874
|
+
attrs.class,
|
|
5875
|
+
],
|
|
5876
|
+
ref: modalRef,
|
|
5877
|
+
}, h$1('div', {
|
|
5878
|
+
class: [
|
|
5879
|
+
'modal-dialog',
|
|
5880
|
+
{
|
|
5881
|
+
'modal-dialog-centered': props.alignment === 'center',
|
|
5882
|
+
[`modal-fullscreen-${props.fullscreen}-down`]: props.fullscreen && typeof props.fullscreen === 'string',
|
|
5883
|
+
'modal-fullscreen': props.fullscreen && typeof props.fullscreen === 'boolean',
|
|
5884
|
+
['modal-dialog-scrollable']: props.scrollable,
|
|
5885
|
+
[`modal-${props.size}`]: props.size,
|
|
5886
|
+
},
|
|
5887
|
+
],
|
|
5888
|
+
role: 'dialog',
|
|
5889
|
+
}, h$1('div', { class: ['modal-content', props.contentClassName], ref: modalContentRef }, slots.default && slots.default())));
|
|
5826
5890
|
return () => [
|
|
5827
5891
|
h$1(Transition, {
|
|
5892
|
+
css: false,
|
|
5828
5893
|
onEnter: (el, done) => handleEnter(el, done),
|
|
5829
5894
|
onAfterEnter: () => handleAfterEnter(),
|
|
5830
5895
|
onLeave: (el, done) => handleLeave(el, done),
|
|
5831
5896
|
onAfterLeave: (el) => handleAfterLeave(el),
|
|
5832
|
-
}, () =>
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
'modal',
|
|
5836
|
-
{
|
|
5837
|
-
['fade']: props.transition,
|
|
5838
|
-
},
|
|
5839
|
-
attrs.class,
|
|
5840
|
-
],
|
|
5841
|
-
ref: modalRef,
|
|
5842
|
-
}, h$1('div', {
|
|
5843
|
-
class: [
|
|
5844
|
-
'modal-dialog',
|
|
5845
|
-
{
|
|
5846
|
-
'modal-dialog-centered': props.alignment === 'center',
|
|
5847
|
-
[`modal-fullscreen-${props.fullscreen}-down`]: props.fullscreen && typeof props.fullscreen === 'string',
|
|
5848
|
-
'modal-fullscreen': props.fullscreen && typeof props.fullscreen === 'boolean',
|
|
5849
|
-
['modal-dialog-scrollable']: props.scrollable,
|
|
5850
|
-
[`modal-${props.size}`]: props.size,
|
|
5851
|
-
},
|
|
5852
|
-
],
|
|
5853
|
-
role: 'dialog',
|
|
5854
|
-
}, h$1('div', { class: ['modal-content', props.contentClassName], ref: modalContentRef }, slots.default && slots.default())))),
|
|
5897
|
+
}, () => props.unmountOnClose
|
|
5898
|
+
? visible.value && modal()
|
|
5899
|
+
: withDirectives(modal(), [[vShow, visible.value]])),
|
|
5855
5900
|
props.backdrop &&
|
|
5856
5901
|
h$1(CBackdrop, {
|
|
5857
5902
|
class: 'modal-backdrop',
|
|
@@ -7018,19 +7063,20 @@ const COffcanvas = defineComponent({
|
|
|
7018
7063
|
}, 1);
|
|
7019
7064
|
};
|
|
7020
7065
|
const handleAfterEnter = () => {
|
|
7021
|
-
window.addEventListener('
|
|
7066
|
+
window.addEventListener('mousedown', handleMouseDown);
|
|
7067
|
+
// window.addEventListener('click', handleClickOutside)
|
|
7022
7068
|
window.addEventListener('keyup', handleKeyUp);
|
|
7023
7069
|
};
|
|
7024
7070
|
const handleLeave = (el, done) => {
|
|
7025
7071
|
el.addEventListener('transitionend', () => {
|
|
7026
7072
|
done();
|
|
7027
7073
|
});
|
|
7074
|
+
window.removeEventListener('mousedown', handleMouseDown);
|
|
7075
|
+
window.removeEventListener('keyup', handleKeyUp);
|
|
7028
7076
|
el.classList.remove('show');
|
|
7029
7077
|
};
|
|
7030
7078
|
const handleAfterLeave = (el) => {
|
|
7031
7079
|
el.style.visibility = 'hidden';
|
|
7032
|
-
window.removeEventListener('click', handleClickOutside);
|
|
7033
|
-
window.removeEventListener('keyup', handleKeyUp);
|
|
7034
7080
|
};
|
|
7035
7081
|
const handleDismiss = () => {
|
|
7036
7082
|
visible.value = false;
|
|
@@ -7043,13 +7089,17 @@ const COffcanvas = defineComponent({
|
|
|
7043
7089
|
}
|
|
7044
7090
|
}
|
|
7045
7091
|
};
|
|
7046
|
-
const
|
|
7092
|
+
const handleMouseDown = (event) => {
|
|
7093
|
+
window.addEventListener('mouseup', () => handleMouseUp(event), { once: true });
|
|
7094
|
+
};
|
|
7095
|
+
const handleMouseUp = (event) => {
|
|
7047
7096
|
if (offcanvasRef.value && !offcanvasRef.value.contains(event.target)) {
|
|
7048
7097
|
props.backdrop && handleDismiss();
|
|
7049
7098
|
}
|
|
7050
7099
|
};
|
|
7051
7100
|
return () => [
|
|
7052
7101
|
h$1(Transition, {
|
|
7102
|
+
css: false,
|
|
7053
7103
|
onEnter: (el, done) => handleEnter(el, done),
|
|
7054
7104
|
onAfterEnter: () => handleAfterEnter(),
|
|
7055
7105
|
onLeave: (el, done) => handleLeave(el, done),
|
|
@@ -8500,11 +8550,6 @@ const CSmartTableBody = defineComponent({
|
|
|
8500
8550
|
default: undefined,
|
|
8501
8551
|
require: false,
|
|
8502
8552
|
},
|
|
8503
|
-
columns: {
|
|
8504
|
-
type: Array,
|
|
8505
|
-
default: () => [],
|
|
8506
|
-
require: true,
|
|
8507
|
-
},
|
|
8508
8553
|
rawColumnNames: {
|
|
8509
8554
|
type: Array,
|
|
8510
8555
|
default: () => [],
|
|
@@ -8611,9 +8656,12 @@ const CSmartTableHead = defineComponent({
|
|
|
8611
8656
|
},
|
|
8612
8657
|
columnFilter: {
|
|
8613
8658
|
type: [Boolean, Object],
|
|
8614
|
-
default: undefined,
|
|
8615
8659
|
require: false,
|
|
8616
8660
|
},
|
|
8661
|
+
columnFilterValue: {
|
|
8662
|
+
type: Object,
|
|
8663
|
+
required: false,
|
|
8664
|
+
},
|
|
8617
8665
|
columnSorter: {
|
|
8618
8666
|
type: [Boolean, Object],
|
|
8619
8667
|
default: undefined,
|
|
@@ -8752,9 +8800,9 @@ const CSmartTableHead = defineComponent({
|
|
|
8752
8800
|
onInput: (event) => handleFilterInput(key(column), event.target.value),
|
|
8753
8801
|
onChange: (event) => handleFilterChange(key(column), event.target.value),
|
|
8754
8802
|
'aria-label': `column name: '${label(column)}' filter input`,
|
|
8755
|
-
...(props.
|
|
8756
|
-
props.
|
|
8757
|
-
value: props.
|
|
8803
|
+
...(props.columnFilterValue &&
|
|
8804
|
+
props.columnFilterValue[key(column)] && {
|
|
8805
|
+
value: props.columnFilterValue[key(column)],
|
|
8758
8806
|
}),
|
|
8759
8807
|
}),
|
|
8760
8808
|
})),
|
|
@@ -9068,7 +9116,6 @@ const CSmartTable = defineComponent({
|
|
|
9068
9116
|
*/
|
|
9069
9117
|
columnFilter: {
|
|
9070
9118
|
type: [Boolean, Object],
|
|
9071
|
-
default: undefined,
|
|
9072
9119
|
required: false,
|
|
9073
9120
|
},
|
|
9074
9121
|
/**
|
|
@@ -9096,7 +9143,6 @@ const CSmartTable = defineComponent({
|
|
|
9096
9143
|
*/
|
|
9097
9144
|
columns: {
|
|
9098
9145
|
type: Array,
|
|
9099
|
-
default: () => [],
|
|
9100
9146
|
required: false,
|
|
9101
9147
|
},
|
|
9102
9148
|
/**
|
|
@@ -9145,7 +9191,6 @@ const CSmartTable = defineComponent({
|
|
|
9145
9191
|
*/
|
|
9146
9192
|
itemsPerPage: {
|
|
9147
9193
|
type: Number,
|
|
9148
|
-
default: 10,
|
|
9149
9194
|
required: false,
|
|
9150
9195
|
},
|
|
9151
9196
|
/**
|
|
@@ -9217,7 +9262,8 @@ const CSmartTable = defineComponent({
|
|
|
9217
9262
|
*/
|
|
9218
9263
|
selectable: Boolean,
|
|
9219
9264
|
/**
|
|
9220
|
-
* State of the sorter. Name key is column name, direction can be 'asc' or 'desc'. Set .sync modifier to track changes.
|
|
9265
|
+
* State of the sorter. Name key is column name, direction can be 'asc' or 'desc'. Set .sync modifier to track changes. eg.:
|
|
9266
|
+
* { column: 'status', state: 'asc' }
|
|
9221
9267
|
*
|
|
9222
9268
|
* @type SorterValue
|
|
9223
9269
|
*/
|
|
@@ -9391,7 +9437,7 @@ const CSmartTable = defineComponent({
|
|
|
9391
9437
|
selectedAll.value = 'indeterminate';
|
|
9392
9438
|
}
|
|
9393
9439
|
});
|
|
9394
|
-
const itemsPerPage = ref(props.itemsPerPage);
|
|
9440
|
+
const itemsPerPage = ref(props.itemsPerPage || items.value.length);
|
|
9395
9441
|
const activePage = ref(props.activePage);
|
|
9396
9442
|
const sorterState = reactive(props.sorterValue || {});
|
|
9397
9443
|
const columnFilterState = ref(props.columnFilterValue ? props.columnFilterValue : {});
|
|
@@ -9404,7 +9450,7 @@ const CSmartTable = defineComponent({
|
|
|
9404
9450
|
});
|
|
9405
9451
|
// functions
|
|
9406
9452
|
const isSortable = (i) => {
|
|
9407
|
-
const isDataColumn = itemsDataColumns.value.includes(rawColumnNames[i]);
|
|
9453
|
+
const isDataColumn = itemsDataColumns.value.includes(rawColumnNames.value[i]);
|
|
9408
9454
|
let column;
|
|
9409
9455
|
if (props.columns)
|
|
9410
9456
|
column = props.columns[i];
|
|
@@ -9502,16 +9548,16 @@ const CSmartTable = defineComponent({
|
|
|
9502
9548
|
sorterState.state = '';
|
|
9503
9549
|
};
|
|
9504
9550
|
// computed
|
|
9505
|
-
const genCols = Object.keys(items.value[0] || {}).filter((el) => el.charAt(0) !== '_');
|
|
9506
|
-
const rawColumnNames = props.columns
|
|
9551
|
+
const genCols = computed(() => Object.keys(items.value[0] || {}).filter((el) => el.charAt(0) !== '_'));
|
|
9552
|
+
const rawColumnNames = computed(() => props.columns
|
|
9507
9553
|
? props.columns.map((column) => {
|
|
9508
9554
|
if (typeof column === 'object')
|
|
9509
9555
|
return column.key;
|
|
9510
9556
|
else
|
|
9511
9557
|
return column;
|
|
9512
9558
|
})
|
|
9513
|
-
: genCols; //! || el
|
|
9514
|
-
const itemsDataColumns = computed(() => rawColumnNames.filter((name) => genCols.includes(name)));
|
|
9559
|
+
: genCols.value); //! || el
|
|
9560
|
+
const itemsDataColumns = computed(() => rawColumnNames.value.filter((name) => genCols.value.includes(name)));
|
|
9515
9561
|
// variables
|
|
9516
9562
|
const columnFiltered = () => {
|
|
9517
9563
|
let _items = items.value;
|
|
@@ -9584,6 +9630,8 @@ const CSmartTable = defineComponent({
|
|
|
9584
9630
|
class: 'col-auto p-0',
|
|
9585
9631
|
}, props.tableFilter &&
|
|
9586
9632
|
h$1(CSmartTableFilter, {
|
|
9633
|
+
filterLabel: props.tableFilterLabel,
|
|
9634
|
+
filterPlaceholder: props.tableFilterPlaceholder,
|
|
9587
9635
|
onFilterInput: (value) => tableFilterChange(value, 'input'),
|
|
9588
9636
|
onFilterChange: (value) => tableFilterChange(value, 'change'),
|
|
9589
9637
|
value: tableFilterState.value,
|
|
@@ -9613,8 +9661,9 @@ const CSmartTable = defineComponent({
|
|
|
9613
9661
|
h$1(CSmartTableHead, {
|
|
9614
9662
|
component: 'head',
|
|
9615
9663
|
...props.tableHeadProps,
|
|
9616
|
-
columnFilter:
|
|
9617
|
-
|
|
9664
|
+
columnFilter: props.columnFilter,
|
|
9665
|
+
columnFilterValue: columnFilterState.value,
|
|
9666
|
+
columns: props.columns ? props.columns : rawColumnNames.value,
|
|
9618
9667
|
columnSorter: props.columnSorter,
|
|
9619
9668
|
selectable: props.selectable,
|
|
9620
9669
|
selectAll: selectedAll.value,
|
|
@@ -9661,12 +9710,11 @@ const CSmartTable = defineComponent({
|
|
|
9661
9710
|
currentItems: currentItems.value,
|
|
9662
9711
|
firstItemOnActivePageIndex: firstItemOnActivePageIndex.value,
|
|
9663
9712
|
noItemsLabel: props.noItemsLabel,
|
|
9664
|
-
columns: props.columns,
|
|
9665
9713
|
scopedSlots: slots,
|
|
9666
9714
|
selectable: props.selectable,
|
|
9667
9715
|
onRowChecked: (id, value) => handleRowChecked(id, value),
|
|
9668
9716
|
onRowClick: (item, index, columnName, event) => handleRowClick(item, index, columnName, event),
|
|
9669
|
-
rawColumnNames: rawColumnNames,
|
|
9717
|
+
rawColumnNames: rawColumnNames.value,
|
|
9670
9718
|
clickableRows: props.clickableRows,
|
|
9671
9719
|
...props.tableBodyProps,
|
|
9672
9720
|
}),
|
|
@@ -9676,7 +9724,7 @@ const CSmartTable = defineComponent({
|
|
|
9676
9724
|
...props.tableFootProps,
|
|
9677
9725
|
columnFilter: false,
|
|
9678
9726
|
columnSorter: false,
|
|
9679
|
-
columns: props.columns,
|
|
9727
|
+
columns: props.columns ? props.columns : rawColumnNames.value,
|
|
9680
9728
|
selectable: props.selectable,
|
|
9681
9729
|
selectAll: selectedAll.value,
|
|
9682
9730
|
onFilterInput: (key, value) => columnFilterChange(key, value, 'input'),
|
|
@@ -9706,7 +9754,6 @@ const CSmartTable = defineComponent({
|
|
|
9706
9754
|
pages: numberOfPages.value,
|
|
9707
9755
|
activePage: activePage.value,
|
|
9708
9756
|
onActivePageChange: handleActivePageChange,
|
|
9709
|
-
limit: itemsPerPage.value,
|
|
9710
9757
|
})
|
|
9711
9758
|
: ''),
|
|
9712
9759
|
h$1('div', {
|