@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.js
CHANGED
|
@@ -2001,13 +2001,21 @@ function mapToStyles(_ref2) {
|
|
|
2001
2001
|
adaptive = _ref2.adaptive,
|
|
2002
2002
|
roundOffsets = _ref2.roundOffsets,
|
|
2003
2003
|
isFixed = _ref2.isFixed;
|
|
2004
|
+
var _offsets$x = offsets.x,
|
|
2005
|
+
x = _offsets$x === void 0 ? 0 : _offsets$x,
|
|
2006
|
+
_offsets$y = offsets.y,
|
|
2007
|
+
y = _offsets$y === void 0 ? 0 : _offsets$y;
|
|
2004
2008
|
|
|
2005
|
-
var _ref3 =
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2009
|
+
var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
|
|
2010
|
+
x: x,
|
|
2011
|
+
y: y
|
|
2012
|
+
}) : {
|
|
2013
|
+
x: x,
|
|
2014
|
+
y: y
|
|
2015
|
+
};
|
|
2010
2016
|
|
|
2017
|
+
x = _ref3.x;
|
|
2018
|
+
y = _ref3.y;
|
|
2011
2019
|
var hasX = offsets.hasOwnProperty('x');
|
|
2012
2020
|
var hasY = offsets.hasOwnProperty('y');
|
|
2013
2021
|
var sideX = left;
|
|
@@ -2052,6 +2060,17 @@ function mapToStyles(_ref2) {
|
|
|
2052
2060
|
position: position
|
|
2053
2061
|
}, adaptive && unsetSides);
|
|
2054
2062
|
|
|
2063
|
+
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
2064
|
+
x: x,
|
|
2065
|
+
y: y
|
|
2066
|
+
}) : {
|
|
2067
|
+
x: x,
|
|
2068
|
+
y: y
|
|
2069
|
+
};
|
|
2070
|
+
|
|
2071
|
+
x = _ref4.x;
|
|
2072
|
+
y = _ref4.y;
|
|
2073
|
+
|
|
2055
2074
|
if (gpuAcceleration) {
|
|
2056
2075
|
var _Object$assign;
|
|
2057
2076
|
|
|
@@ -2061,9 +2080,9 @@ function mapToStyles(_ref2) {
|
|
|
2061
2080
|
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
|
2062
2081
|
}
|
|
2063
2082
|
|
|
2064
|
-
function computeStyles(
|
|
2065
|
-
var state =
|
|
2066
|
-
options =
|
|
2083
|
+
function computeStyles(_ref5) {
|
|
2084
|
+
var state = _ref5.state,
|
|
2085
|
+
options = _ref5.options;
|
|
2067
2086
|
var _options$gpuAccelerat = options.gpuAcceleration,
|
|
2068
2087
|
gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
|
|
2069
2088
|
_options$adaptive = options.adaptive,
|
|
@@ -2362,7 +2381,7 @@ function getClippingParents(element) {
|
|
|
2362
2381
|
|
|
2363
2382
|
|
|
2364
2383
|
return clippingParents.filter(function (clippingParent) {
|
|
2365
|
-
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'
|
|
2384
|
+
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
|
|
2366
2385
|
});
|
|
2367
2386
|
} // Gets the maximum area that the element is visible in due to any number of
|
|
2368
2387
|
// clipping parents
|
|
@@ -4644,10 +4663,14 @@ const CFormSelect = vue.defineComponent({
|
|
|
4644
4663
|
* The default name for a value passed using v-model.
|
|
4645
4664
|
*/
|
|
4646
4665
|
modelValue: {
|
|
4647
|
-
type: String,
|
|
4666
|
+
type: [String, Array],
|
|
4648
4667
|
default: undefined,
|
|
4649
4668
|
require: false,
|
|
4650
4669
|
},
|
|
4670
|
+
multiple: {
|
|
4671
|
+
type: Boolean,
|
|
4672
|
+
required: false,
|
|
4673
|
+
},
|
|
4651
4674
|
/**
|
|
4652
4675
|
* Options list of the select component. Available keys: `label`, `value`, `disabled`.
|
|
4653
4676
|
* Examples:
|
|
@@ -4696,9 +4719,8 @@ const CFormSelect = vue.defineComponent({
|
|
|
4696
4719
|
const selected = Array.from(target.options)
|
|
4697
4720
|
.filter((option) => option.selected)
|
|
4698
4721
|
.map((option) => option.value);
|
|
4699
|
-
const value = target.multiple ? selected : selected[0];
|
|
4700
4722
|
emit('change', event);
|
|
4701
|
-
emit('update:modelValue',
|
|
4723
|
+
emit('update:modelValue', target.multiple ? selected : selected[0]);
|
|
4702
4724
|
};
|
|
4703
4725
|
return () => vue.h('select', {
|
|
4704
4726
|
class: [
|
|
@@ -4709,14 +4731,23 @@ const CFormSelect = vue.defineComponent({
|
|
|
4709
4731
|
'is-valid': props.valid,
|
|
4710
4732
|
},
|
|
4711
4733
|
],
|
|
4734
|
+
multiple: props.multiple,
|
|
4712
4735
|
onChange: (event) => handleChange(event),
|
|
4713
4736
|
size: props.htmlSize,
|
|
4737
|
+
...(props.modelValue && !props.multiple && { value: props.modelValue }),
|
|
4714
4738
|
}, props.options
|
|
4715
4739
|
? props.options.map((option) => {
|
|
4716
4740
|
return vue.h('option', {
|
|
4717
|
-
...(typeof option === 'object' &&
|
|
4718
|
-
option.disabled && { disabled: option.disabled }),
|
|
4719
|
-
|
|
4741
|
+
...(typeof option === 'object' && {
|
|
4742
|
+
...(option.disabled && { disabled: option.disabled }),
|
|
4743
|
+
...(option.selected && { selected: option.selected }),
|
|
4744
|
+
...(option.value && {
|
|
4745
|
+
value: option.value,
|
|
4746
|
+
...(props.modelValue &&
|
|
4747
|
+
props.multiple &&
|
|
4748
|
+
props.modelValue.includes(option.value) && { selected: true }),
|
|
4749
|
+
}),
|
|
4750
|
+
}),
|
|
4720
4751
|
}, typeof option === 'string' ? option : option.label);
|
|
4721
4752
|
})
|
|
4722
4753
|
: slots.default && slots.default());
|
|
@@ -5742,6 +5773,14 @@ const CModal = vue.defineComponent({
|
|
|
5742
5773
|
default: true,
|
|
5743
5774
|
required: false,
|
|
5744
5775
|
},
|
|
5776
|
+
/**
|
|
5777
|
+
* By default the component is unmounted after close animation, if you want to keep the component mounted set this property to false.
|
|
5778
|
+
*/
|
|
5779
|
+
unmountOnClose: {
|
|
5780
|
+
type: Boolean,
|
|
5781
|
+
default: true,
|
|
5782
|
+
required: false,
|
|
5783
|
+
},
|
|
5745
5784
|
/**
|
|
5746
5785
|
* Toggle the visibility of alert component.
|
|
5747
5786
|
*/
|
|
@@ -5780,7 +5819,7 @@ const CModal = vue.defineComponent({
|
|
|
5780
5819
|
emit('show');
|
|
5781
5820
|
};
|
|
5782
5821
|
const handleAfterEnter = () => {
|
|
5783
|
-
window.addEventListener('
|
|
5822
|
+
window.addEventListener('mousedown', handleMouseDown);
|
|
5784
5823
|
window.addEventListener('keyup', handleKeyUp);
|
|
5785
5824
|
};
|
|
5786
5825
|
const handleLeave = (el, done) => {
|
|
@@ -5791,7 +5830,7 @@ const CModal = vue.defineComponent({
|
|
|
5791
5830
|
el.classList.remove('show');
|
|
5792
5831
|
};
|
|
5793
5832
|
const handleAfterLeave = (el) => {
|
|
5794
|
-
window.removeEventListener('
|
|
5833
|
+
window.removeEventListener('mousedown', handleMouseDown);
|
|
5795
5834
|
window.removeEventListener('keyup', handleKeyUp);
|
|
5796
5835
|
el.style.display = 'none';
|
|
5797
5836
|
};
|
|
@@ -5813,7 +5852,10 @@ const CModal = vue.defineComponent({
|
|
|
5813
5852
|
}
|
|
5814
5853
|
}
|
|
5815
5854
|
};
|
|
5816
|
-
const
|
|
5855
|
+
const handleMouseDown = (event) => {
|
|
5856
|
+
window.addEventListener('mouseup', () => handleMouseUp(event), { once: true });
|
|
5857
|
+
};
|
|
5858
|
+
const handleMouseUp = (event) => {
|
|
5817
5859
|
if (modalContentRef.value && !modalContentRef.value.contains(event.target)) {
|
|
5818
5860
|
if (props.backdrop !== 'static') {
|
|
5819
5861
|
handleDismiss();
|
|
@@ -5827,35 +5869,38 @@ const CModal = vue.defineComponent({
|
|
|
5827
5869
|
}
|
|
5828
5870
|
};
|
|
5829
5871
|
vue.provide('handleDismiss', handleDismiss);
|
|
5872
|
+
const modal = () => vue.h('div', {
|
|
5873
|
+
class: [
|
|
5874
|
+
'modal',
|
|
5875
|
+
{
|
|
5876
|
+
['fade']: props.transition,
|
|
5877
|
+
},
|
|
5878
|
+
attrs.class,
|
|
5879
|
+
],
|
|
5880
|
+
ref: modalRef,
|
|
5881
|
+
}, vue.h('div', {
|
|
5882
|
+
class: [
|
|
5883
|
+
'modal-dialog',
|
|
5884
|
+
{
|
|
5885
|
+
'modal-dialog-centered': props.alignment === 'center',
|
|
5886
|
+
[`modal-fullscreen-${props.fullscreen}-down`]: props.fullscreen && typeof props.fullscreen === 'string',
|
|
5887
|
+
'modal-fullscreen': props.fullscreen && typeof props.fullscreen === 'boolean',
|
|
5888
|
+
['modal-dialog-scrollable']: props.scrollable,
|
|
5889
|
+
[`modal-${props.size}`]: props.size,
|
|
5890
|
+
},
|
|
5891
|
+
],
|
|
5892
|
+
role: 'dialog',
|
|
5893
|
+
}, vue.h('div', { class: ['modal-content', props.contentClassName], ref: modalContentRef }, slots.default && slots.default())));
|
|
5830
5894
|
return () => [
|
|
5831
5895
|
vue.h(vue.Transition, {
|
|
5896
|
+
css: false,
|
|
5832
5897
|
onEnter: (el, done) => handleEnter(el, done),
|
|
5833
5898
|
onAfterEnter: () => handleAfterEnter(),
|
|
5834
5899
|
onLeave: (el, done) => handleLeave(el, done),
|
|
5835
5900
|
onAfterLeave: (el) => handleAfterLeave(el),
|
|
5836
|
-
}, () =>
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
'modal',
|
|
5840
|
-
{
|
|
5841
|
-
['fade']: props.transition,
|
|
5842
|
-
},
|
|
5843
|
-
attrs.class,
|
|
5844
|
-
],
|
|
5845
|
-
ref: modalRef,
|
|
5846
|
-
}, vue.h('div', {
|
|
5847
|
-
class: [
|
|
5848
|
-
'modal-dialog',
|
|
5849
|
-
{
|
|
5850
|
-
'modal-dialog-centered': props.alignment === 'center',
|
|
5851
|
-
[`modal-fullscreen-${props.fullscreen}-down`]: props.fullscreen && typeof props.fullscreen === 'string',
|
|
5852
|
-
'modal-fullscreen': props.fullscreen && typeof props.fullscreen === 'boolean',
|
|
5853
|
-
['modal-dialog-scrollable']: props.scrollable,
|
|
5854
|
-
[`modal-${props.size}`]: props.size,
|
|
5855
|
-
},
|
|
5856
|
-
],
|
|
5857
|
-
role: 'dialog',
|
|
5858
|
-
}, vue.h('div', { class: ['modal-content', props.contentClassName], ref: modalContentRef }, slots.default && slots.default())))),
|
|
5901
|
+
}, () => props.unmountOnClose
|
|
5902
|
+
? visible.value && modal()
|
|
5903
|
+
: vue.withDirectives(modal(), [[vue.vShow, visible.value]])),
|
|
5859
5904
|
props.backdrop &&
|
|
5860
5905
|
vue.h(CBackdrop, {
|
|
5861
5906
|
class: 'modal-backdrop',
|
|
@@ -7022,19 +7067,20 @@ const COffcanvas = vue.defineComponent({
|
|
|
7022
7067
|
}, 1);
|
|
7023
7068
|
};
|
|
7024
7069
|
const handleAfterEnter = () => {
|
|
7025
|
-
window.addEventListener('
|
|
7070
|
+
window.addEventListener('mousedown', handleMouseDown);
|
|
7071
|
+
// window.addEventListener('click', handleClickOutside)
|
|
7026
7072
|
window.addEventListener('keyup', handleKeyUp);
|
|
7027
7073
|
};
|
|
7028
7074
|
const handleLeave = (el, done) => {
|
|
7029
7075
|
el.addEventListener('transitionend', () => {
|
|
7030
7076
|
done();
|
|
7031
7077
|
});
|
|
7078
|
+
window.removeEventListener('mousedown', handleMouseDown);
|
|
7079
|
+
window.removeEventListener('keyup', handleKeyUp);
|
|
7032
7080
|
el.classList.remove('show');
|
|
7033
7081
|
};
|
|
7034
7082
|
const handleAfterLeave = (el) => {
|
|
7035
7083
|
el.style.visibility = 'hidden';
|
|
7036
|
-
window.removeEventListener('click', handleClickOutside);
|
|
7037
|
-
window.removeEventListener('keyup', handleKeyUp);
|
|
7038
7084
|
};
|
|
7039
7085
|
const handleDismiss = () => {
|
|
7040
7086
|
visible.value = false;
|
|
@@ -7047,13 +7093,17 @@ const COffcanvas = vue.defineComponent({
|
|
|
7047
7093
|
}
|
|
7048
7094
|
}
|
|
7049
7095
|
};
|
|
7050
|
-
const
|
|
7096
|
+
const handleMouseDown = (event) => {
|
|
7097
|
+
window.addEventListener('mouseup', () => handleMouseUp(event), { once: true });
|
|
7098
|
+
};
|
|
7099
|
+
const handleMouseUp = (event) => {
|
|
7051
7100
|
if (offcanvasRef.value && !offcanvasRef.value.contains(event.target)) {
|
|
7052
7101
|
props.backdrop && handleDismiss();
|
|
7053
7102
|
}
|
|
7054
7103
|
};
|
|
7055
7104
|
return () => [
|
|
7056
7105
|
vue.h(vue.Transition, {
|
|
7106
|
+
css: false,
|
|
7057
7107
|
onEnter: (el, done) => handleEnter(el, done),
|
|
7058
7108
|
onAfterEnter: () => handleAfterEnter(),
|
|
7059
7109
|
onLeave: (el, done) => handleLeave(el, done),
|
|
@@ -8504,11 +8554,6 @@ const CSmartTableBody = vue.defineComponent({
|
|
|
8504
8554
|
default: undefined,
|
|
8505
8555
|
require: false,
|
|
8506
8556
|
},
|
|
8507
|
-
columns: {
|
|
8508
|
-
type: Array,
|
|
8509
|
-
default: () => [],
|
|
8510
|
-
require: true,
|
|
8511
|
-
},
|
|
8512
8557
|
rawColumnNames: {
|
|
8513
8558
|
type: Array,
|
|
8514
8559
|
default: () => [],
|
|
@@ -8615,9 +8660,12 @@ const CSmartTableHead = vue.defineComponent({
|
|
|
8615
8660
|
},
|
|
8616
8661
|
columnFilter: {
|
|
8617
8662
|
type: [Boolean, Object],
|
|
8618
|
-
default: undefined,
|
|
8619
8663
|
require: false,
|
|
8620
8664
|
},
|
|
8665
|
+
columnFilterValue: {
|
|
8666
|
+
type: Object,
|
|
8667
|
+
required: false,
|
|
8668
|
+
},
|
|
8621
8669
|
columnSorter: {
|
|
8622
8670
|
type: [Boolean, Object],
|
|
8623
8671
|
default: undefined,
|
|
@@ -8756,9 +8804,9 @@ const CSmartTableHead = vue.defineComponent({
|
|
|
8756
8804
|
onInput: (event) => handleFilterInput(key(column), event.target.value),
|
|
8757
8805
|
onChange: (event) => handleFilterChange(key(column), event.target.value),
|
|
8758
8806
|
'aria-label': `column name: '${label(column)}' filter input`,
|
|
8759
|
-
...(props.
|
|
8760
|
-
props.
|
|
8761
|
-
value: props.
|
|
8807
|
+
...(props.columnFilterValue &&
|
|
8808
|
+
props.columnFilterValue[key(column)] && {
|
|
8809
|
+
value: props.columnFilterValue[key(column)],
|
|
8762
8810
|
}),
|
|
8763
8811
|
}),
|
|
8764
8812
|
})),
|
|
@@ -9072,7 +9120,6 @@ const CSmartTable = vue.defineComponent({
|
|
|
9072
9120
|
*/
|
|
9073
9121
|
columnFilter: {
|
|
9074
9122
|
type: [Boolean, Object],
|
|
9075
|
-
default: undefined,
|
|
9076
9123
|
required: false,
|
|
9077
9124
|
},
|
|
9078
9125
|
/**
|
|
@@ -9100,7 +9147,6 @@ const CSmartTable = vue.defineComponent({
|
|
|
9100
9147
|
*/
|
|
9101
9148
|
columns: {
|
|
9102
9149
|
type: Array,
|
|
9103
|
-
default: () => [],
|
|
9104
9150
|
required: false,
|
|
9105
9151
|
},
|
|
9106
9152
|
/**
|
|
@@ -9149,7 +9195,6 @@ const CSmartTable = vue.defineComponent({
|
|
|
9149
9195
|
*/
|
|
9150
9196
|
itemsPerPage: {
|
|
9151
9197
|
type: Number,
|
|
9152
|
-
default: 10,
|
|
9153
9198
|
required: false,
|
|
9154
9199
|
},
|
|
9155
9200
|
/**
|
|
@@ -9221,7 +9266,8 @@ const CSmartTable = vue.defineComponent({
|
|
|
9221
9266
|
*/
|
|
9222
9267
|
selectable: Boolean,
|
|
9223
9268
|
/**
|
|
9224
|
-
* State of the sorter. Name key is column name, direction can be 'asc' or 'desc'. Set .sync modifier to track changes.
|
|
9269
|
+
* State of the sorter. Name key is column name, direction can be 'asc' or 'desc'. Set .sync modifier to track changes. eg.:
|
|
9270
|
+
* { column: 'status', state: 'asc' }
|
|
9225
9271
|
*
|
|
9226
9272
|
* @type SorterValue
|
|
9227
9273
|
*/
|
|
@@ -9395,7 +9441,7 @@ const CSmartTable = vue.defineComponent({
|
|
|
9395
9441
|
selectedAll.value = 'indeterminate';
|
|
9396
9442
|
}
|
|
9397
9443
|
});
|
|
9398
|
-
const itemsPerPage = vue.ref(props.itemsPerPage);
|
|
9444
|
+
const itemsPerPage = vue.ref(props.itemsPerPage || items.value.length);
|
|
9399
9445
|
const activePage = vue.ref(props.activePage);
|
|
9400
9446
|
const sorterState = vue.reactive(props.sorterValue || {});
|
|
9401
9447
|
const columnFilterState = vue.ref(props.columnFilterValue ? props.columnFilterValue : {});
|
|
@@ -9408,7 +9454,7 @@ const CSmartTable = vue.defineComponent({
|
|
|
9408
9454
|
});
|
|
9409
9455
|
// functions
|
|
9410
9456
|
const isSortable = (i) => {
|
|
9411
|
-
const isDataColumn = itemsDataColumns.value.includes(rawColumnNames[i]);
|
|
9457
|
+
const isDataColumn = itemsDataColumns.value.includes(rawColumnNames.value[i]);
|
|
9412
9458
|
let column;
|
|
9413
9459
|
if (props.columns)
|
|
9414
9460
|
column = props.columns[i];
|
|
@@ -9506,16 +9552,16 @@ const CSmartTable = vue.defineComponent({
|
|
|
9506
9552
|
sorterState.state = '';
|
|
9507
9553
|
};
|
|
9508
9554
|
// computed
|
|
9509
|
-
const genCols = Object.keys(items.value[0] || {}).filter((el) => el.charAt(0) !== '_');
|
|
9510
|
-
const rawColumnNames = props.columns
|
|
9555
|
+
const genCols = vue.computed(() => Object.keys(items.value[0] || {}).filter((el) => el.charAt(0) !== '_'));
|
|
9556
|
+
const rawColumnNames = vue.computed(() => props.columns
|
|
9511
9557
|
? props.columns.map((column) => {
|
|
9512
9558
|
if (typeof column === 'object')
|
|
9513
9559
|
return column.key;
|
|
9514
9560
|
else
|
|
9515
9561
|
return column;
|
|
9516
9562
|
})
|
|
9517
|
-
: genCols; //! || el
|
|
9518
|
-
const itemsDataColumns = vue.computed(() => rawColumnNames.filter((name) => genCols.includes(name)));
|
|
9563
|
+
: genCols.value); //! || el
|
|
9564
|
+
const itemsDataColumns = vue.computed(() => rawColumnNames.value.filter((name) => genCols.value.includes(name)));
|
|
9519
9565
|
// variables
|
|
9520
9566
|
const columnFiltered = () => {
|
|
9521
9567
|
let _items = items.value;
|
|
@@ -9588,6 +9634,8 @@ const CSmartTable = vue.defineComponent({
|
|
|
9588
9634
|
class: 'col-auto p-0',
|
|
9589
9635
|
}, props.tableFilter &&
|
|
9590
9636
|
vue.h(CSmartTableFilter, {
|
|
9637
|
+
filterLabel: props.tableFilterLabel,
|
|
9638
|
+
filterPlaceholder: props.tableFilterPlaceholder,
|
|
9591
9639
|
onFilterInput: (value) => tableFilterChange(value, 'input'),
|
|
9592
9640
|
onFilterChange: (value) => tableFilterChange(value, 'change'),
|
|
9593
9641
|
value: tableFilterState.value,
|
|
@@ -9617,8 +9665,9 @@ const CSmartTable = vue.defineComponent({
|
|
|
9617
9665
|
vue.h(CSmartTableHead, {
|
|
9618
9666
|
component: 'head',
|
|
9619
9667
|
...props.tableHeadProps,
|
|
9620
|
-
columnFilter:
|
|
9621
|
-
|
|
9668
|
+
columnFilter: props.columnFilter,
|
|
9669
|
+
columnFilterValue: columnFilterState.value,
|
|
9670
|
+
columns: props.columns ? props.columns : rawColumnNames.value,
|
|
9622
9671
|
columnSorter: props.columnSorter,
|
|
9623
9672
|
selectable: props.selectable,
|
|
9624
9673
|
selectAll: selectedAll.value,
|
|
@@ -9665,12 +9714,11 @@ const CSmartTable = vue.defineComponent({
|
|
|
9665
9714
|
currentItems: currentItems.value,
|
|
9666
9715
|
firstItemOnActivePageIndex: firstItemOnActivePageIndex.value,
|
|
9667
9716
|
noItemsLabel: props.noItemsLabel,
|
|
9668
|
-
columns: props.columns,
|
|
9669
9717
|
scopedSlots: slots,
|
|
9670
9718
|
selectable: props.selectable,
|
|
9671
9719
|
onRowChecked: (id, value) => handleRowChecked(id, value),
|
|
9672
9720
|
onRowClick: (item, index, columnName, event) => handleRowClick(item, index, columnName, event),
|
|
9673
|
-
rawColumnNames: rawColumnNames,
|
|
9721
|
+
rawColumnNames: rawColumnNames.value,
|
|
9674
9722
|
clickableRows: props.clickableRows,
|
|
9675
9723
|
...props.tableBodyProps,
|
|
9676
9724
|
}),
|
|
@@ -9680,7 +9728,7 @@ const CSmartTable = vue.defineComponent({
|
|
|
9680
9728
|
...props.tableFootProps,
|
|
9681
9729
|
columnFilter: false,
|
|
9682
9730
|
columnSorter: false,
|
|
9683
|
-
columns: props.columns,
|
|
9731
|
+
columns: props.columns ? props.columns : rawColumnNames.value,
|
|
9684
9732
|
selectable: props.selectable,
|
|
9685
9733
|
selectAll: selectedAll.value,
|
|
9686
9734
|
onFilterInput: (key, value) => columnFilterChange(key, value, 'input'),
|
|
@@ -9710,7 +9758,6 @@ const CSmartTable = vue.defineComponent({
|
|
|
9710
9758
|
pages: numberOfPages.value,
|
|
9711
9759
|
activePage: activePage.value,
|
|
9712
9760
|
onActivePageChange: handleActivePageChange,
|
|
9713
|
-
limit: itemsPerPage.value,
|
|
9714
9761
|
})
|
|
9715
9762
|
: ''),
|
|
9716
9763
|
vue.h('div', {
|