@coreui/vue-pro 4.7.0 → 4.8.0-next.1
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/calendar/utils.d.ts +23 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/modal/CModal.d.ts +4 -20
- package/dist/components/multi-select/CMultiSelect.d.ts +35 -44
- package/dist/components/multi-select/CMultiSelectNativeSelect.d.ts +1 -1
- package/dist/components/multi-select/CMultiSelectOptions.d.ts +13 -11
- package/dist/components/multi-select/CMultiSelectSelection.d.ts +1 -1
- package/dist/components/multi-select/types.d.ts +14 -0
- package/dist/components/multi-select/utils.d.ts +6 -0
- package/dist/components/offcanvas/COffcanvas.d.ts +35 -18
- package/dist/components/smart-table/CSmartTable.d.ts +65 -87
- package/dist/components/smart-table/CSmartTableBody.d.ts +16 -40
- package/dist/components/smart-table/CSmartTableHead.d.ts +17 -58
- package/dist/components/smart-table/CSmartTableInterface.d.ts +1 -1
- package/dist/components/smart-table/types.d.ts +50 -0
- package/dist/components/smart-table/utils.d.ts +17 -0
- package/dist/components/table/CTable.d.ts +1 -1
- package/dist/components/time-picker/types.d.ts +15 -0
- package/dist/components/time-picker/utils.d.ts +23 -0
- package/dist/components/virtual-scroller/CVirtualScroller.d.ts +23 -0
- package/dist/components/virtual-scroller/index.d.ts +6 -0
- package/dist/index.es.js +943 -885
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +943 -883
- package/dist/index.js.map +1 -1
- package/dist/utils/index.d.ts +1 -3
- package/dist/utils/isObjectInArray.d.ts +2 -0
- package/package.json +6 -6
- package/src/components/calendar/CCalendar.ts +1 -1
- package/src/{utils/calendar.ts → components/calendar/utils.ts} +1 -1
- package/src/components/date-range-picker/CDateRangePicker.ts +1 -1
- package/src/components/element-cover/CElementCover.ts +14 -14
- package/src/components/index.ts +1 -0
- package/src/components/modal/CModal.ts +10 -10
- package/src/components/multi-select/CMultiSelect.ts +33 -99
- package/src/components/multi-select/CMultiSelectNativeSelect.ts +2 -1
- package/src/components/multi-select/CMultiSelectOptions.ts +31 -17
- package/src/components/multi-select/CMultiSelectSelection.ts +2 -1
- package/src/components/multi-select/types.ts +15 -0
- package/src/components/multi-select/utils.ts +92 -0
- package/src/components/offcanvas/COffcanvas.ts +50 -28
- package/src/components/smart-table/CSmartTable.ts +365 -268
- package/src/components/smart-table/CSmartTableBody.ts +126 -137
- package/src/components/smart-table/CSmartTableHead.ts +53 -138
- package/src/components/smart-table/CSmartTableInterface.ts +1 -1
- package/src/components/smart-table/types.ts +61 -0
- package/src/components/smart-table/utils.ts +212 -0
- package/src/components/time-picker/CTimePicker.ts +49 -27
- package/src/components/time-picker/types.ts +15 -0
- package/src/{utils/time.ts → components/time-picker/utils.ts} +43 -2
- package/src/components/virtual-scroller/CVirtualScroller.ts +109 -0
- package/src/components/virtual-scroller/index.ts +10 -0
- package/src/utils/index.ts +1 -3
- package/src/utils/getNextSibling.ts +0 -18
- package/src/utils/getPreviousSibling.ts +0 -18
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, cloneVNode, nextTick, vShow, Teleport, onBeforeUnmount
|
|
1
|
+
import { defineComponent, ref, provide, h as h$1, Transition, withDirectives, inject, watch, reactive, onBeforeMount, onMounted, onUpdated, toRefs, onUnmounted, cloneVNode, nextTick, vShow, computed, Teleport, onBeforeUnmount } from 'vue';
|
|
2
2
|
|
|
3
3
|
const CAccordion = defineComponent({
|
|
4
4
|
name: 'CAccordion',
|
|
@@ -1905,38 +1905,6 @@ const CCardPlugin = {
|
|
|
1905
1905
|
},
|
|
1906
1906
|
};
|
|
1907
1907
|
|
|
1908
|
-
const getNextSibling = (elem, selector) => {
|
|
1909
|
-
// Get the next sibling element
|
|
1910
|
-
let sibling = elem.nextElementSibling;
|
|
1911
|
-
// If there's no selector, return the first sibling
|
|
1912
|
-
if (!selector)
|
|
1913
|
-
return sibling;
|
|
1914
|
-
// If the sibling matches our selector, use it
|
|
1915
|
-
// If not, jump to the next sibling and continue the loop
|
|
1916
|
-
while (sibling) {
|
|
1917
|
-
if (sibling.matches(selector))
|
|
1918
|
-
return sibling;
|
|
1919
|
-
sibling = sibling.nextElementSibling;
|
|
1920
|
-
}
|
|
1921
|
-
return;
|
|
1922
|
-
};
|
|
1923
|
-
|
|
1924
|
-
const getPreviousSibling = (elem, selector) => {
|
|
1925
|
-
// Get the next sibling element
|
|
1926
|
-
let sibling = elem.previousElementSibling;
|
|
1927
|
-
// If there's no selector, return the first sibling
|
|
1928
|
-
if (!selector)
|
|
1929
|
-
return sibling;
|
|
1930
|
-
// If the sibling matches our selector, use it
|
|
1931
|
-
// If not, jump to the next sibling and continue the loop
|
|
1932
|
-
while (sibling) {
|
|
1933
|
-
if (sibling.matches(selector))
|
|
1934
|
-
return sibling;
|
|
1935
|
-
sibling = sibling.previousElementSibling;
|
|
1936
|
-
}
|
|
1937
|
-
return;
|
|
1938
|
-
};
|
|
1939
|
-
|
|
1940
1908
|
const isInViewport = (element) => {
|
|
1941
1909
|
const rect = element.getBoundingClientRect();
|
|
1942
1910
|
return (Math.floor(rect.top) >= 0 &&
|
|
@@ -8715,38 +8683,34 @@ const getAmPm = (date, locale) => {
|
|
|
8715
8683
|
}
|
|
8716
8684
|
return date.getHours() >= 12 ? 'pm' : 'am';
|
|
8717
8685
|
};
|
|
8718
|
-
const
|
|
8719
|
-
|
|
8720
|
-
|
|
8721
|
-
|
|
8722
|
-
|
|
8723
|
-
|
|
8724
|
-
|
|
8725
|
-
|
|
8726
|
-
|
|
8727
|
-
|
|
8728
|
-
|
|
8729
|
-
|
|
8730
|
-
|
|
8731
|
-
|
|
8732
|
-
|
|
8733
|
-
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
|
|
8738
|
-
|
|
8739
|
-
d.setSeconds(i);
|
|
8686
|
+
const getLocalizedTimePartials = (locale, ampm = 'auto') => {
|
|
8687
|
+
const date = new Date();
|
|
8688
|
+
const hour12 = ['am', 'AM', 'pm', 'PM'].some((el) => date.toLocaleString(locale).includes(el));
|
|
8689
|
+
const listOfHours = Array.from({ length: (ampm === 'auto' && hour12) || ampm === true ? 12 : 24 }, (_, i) => {
|
|
8690
|
+
return {
|
|
8691
|
+
value: (ampm === 'auto' && hour12) || ampm === true ? i + 1 : i,
|
|
8692
|
+
label: ((ampm === 'auto' && hour12) || ampm === true ? i + 1 : i).toLocaleString(locale),
|
|
8693
|
+
};
|
|
8694
|
+
});
|
|
8695
|
+
const listOfMinutesSeconds = Array.from({ length: 60 }, (_, i) => {
|
|
8696
|
+
date.setMinutes(i);
|
|
8697
|
+
return {
|
|
8698
|
+
value: i,
|
|
8699
|
+
label: date
|
|
8700
|
+
.toLocaleTimeString(locale, {
|
|
8701
|
+
minute: '2-digit',
|
|
8702
|
+
second: '2-digit',
|
|
8703
|
+
})
|
|
8704
|
+
.split(/[^A-Za-z0-9\u06F0-\u06F90-9]/)[0],
|
|
8705
|
+
};
|
|
8706
|
+
});
|
|
8740
8707
|
return {
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
second: '2-digit',
|
|
8746
|
-
})
|
|
8747
|
-
.split(/[^A-Za-z0-9]/)[1],
|
|
8708
|
+
listOfHours,
|
|
8709
|
+
listOfMinutes: listOfMinutesSeconds,
|
|
8710
|
+
listOfSeconds: listOfMinutesSeconds,
|
|
8711
|
+
hour12,
|
|
8748
8712
|
};
|
|
8749
|
-
}
|
|
8713
|
+
};
|
|
8750
8714
|
const getSelectedHour = (date, locale, ampm = 'auto') => date
|
|
8751
8715
|
? (ampm === 'auto' && isAmPm(locale)) || ampm === true
|
|
8752
8716
|
? convert24hTo12h(date.getHours())
|
|
@@ -9020,14 +8984,21 @@ const CTimePicker = defineComponent({
|
|
|
9020
8984
|
'update:time',
|
|
9021
8985
|
],
|
|
9022
8986
|
setup(props, { emit, attrs, slots }) {
|
|
9023
|
-
const visible = ref(props.visible);
|
|
9024
8987
|
const date = ref(convertTimeToDate(props.time));
|
|
9025
|
-
const initialDate = ref(null);
|
|
9026
8988
|
const ampm = ref(date.value ? getAmPm(new Date(date.value), props.locale) : 'am');
|
|
8989
|
+
const initialDate = ref(null);
|
|
8990
|
+
const visible = ref(props.visible);
|
|
8991
|
+
const localizedTimePartials = ref({
|
|
8992
|
+
listOfHours: [],
|
|
8993
|
+
listOfMinutes: [],
|
|
8994
|
+
listOfSeconds: [],
|
|
8995
|
+
hour12: false,
|
|
8996
|
+
});
|
|
9027
8997
|
watch(() => props.time, () => {
|
|
9028
8998
|
date.value = convertTimeToDate(props.time);
|
|
9029
8999
|
});
|
|
9030
9000
|
watch(date, () => {
|
|
9001
|
+
localizedTimePartials.value = getLocalizedTimePartials(props.locale, props.ampm);
|
|
9031
9002
|
if (date.value) {
|
|
9032
9003
|
ampm.value = getAmPm(new Date(date.value), props.locale);
|
|
9033
9004
|
}
|
|
@@ -9049,7 +9020,7 @@ const CTimePicker = defineComponent({
|
|
|
9049
9020
|
}
|
|
9050
9021
|
}
|
|
9051
9022
|
if (set === 'hours') {
|
|
9052
|
-
if (
|
|
9023
|
+
if (localizedTimePartials.value && localizedTimePartials.value.hour12) {
|
|
9053
9024
|
_date.setHours(convert12hTo24h(ampm.value, parseInt(value)));
|
|
9054
9025
|
}
|
|
9055
9026
|
else {
|
|
@@ -9079,8 +9050,7 @@ const CTimePicker = defineComponent({
|
|
|
9079
9050
|
readonly: props.inputReadOnly,
|
|
9080
9051
|
value: date.value
|
|
9081
9052
|
? date.value.toLocaleTimeString(props.locale, {
|
|
9082
|
-
hour12:
|
|
9083
|
-
(props.ampm === 'boolean' && props.ampm),
|
|
9053
|
+
hour12: localizedTimePartials.value && localizedTimePartials.value.hour12,
|
|
9084
9054
|
...(!props.seconds && { timeStyle: 'short' }),
|
|
9085
9055
|
})
|
|
9086
9056
|
: '',
|
|
@@ -9107,33 +9077,45 @@ const CTimePicker = defineComponent({
|
|
|
9107
9077
|
h$1('span', { class: 'time-picker-inline-icon' }),
|
|
9108
9078
|
h$1(CFormSelect, {
|
|
9109
9079
|
disabled: props.disabled,
|
|
9110
|
-
options:
|
|
9111
|
-
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
9080
|
+
options: localizedTimePartials.value &&
|
|
9081
|
+
localizedTimePartials.value.listOfHours?.map((option) => {
|
|
9082
|
+
return {
|
|
9083
|
+
value: option.value.toString(),
|
|
9084
|
+
label: option.label,
|
|
9085
|
+
};
|
|
9086
|
+
}),
|
|
9116
9087
|
onChange: (event) => handleTimeChange('hours', event.target.value),
|
|
9117
9088
|
...(date.value && { value: getSelectedHour(date.value, props.locale) }),
|
|
9118
9089
|
}),
|
|
9119
9090
|
':',
|
|
9120
|
-
// @ts-expect-error the getListOfMinutes function returns corect type
|
|
9121
9091
|
h$1(CFormSelect, {
|
|
9122
9092
|
disabled: props.disabled,
|
|
9123
|
-
options:
|
|
9093
|
+
options: localizedTimePartials.value &&
|
|
9094
|
+
localizedTimePartials.value.listOfMinutes.map((option) => {
|
|
9095
|
+
return {
|
|
9096
|
+
value: option.value.toString(),
|
|
9097
|
+
label: option.label,
|
|
9098
|
+
};
|
|
9099
|
+
}),
|
|
9124
9100
|
onChange: (event) => handleTimeChange('minutes', event.target.value),
|
|
9125
9101
|
...(date.value && { value: getSelectedMinutes(date.value) }),
|
|
9126
9102
|
}),
|
|
9127
9103
|
props.seconds && ':',
|
|
9128
9104
|
props.seconds &&
|
|
9129
|
-
// @ts-expect-error the getListOfMinutes function returns corect type
|
|
9130
9105
|
h$1(CFormSelect, {
|
|
9131
9106
|
disabled: props.disabled,
|
|
9132
|
-
options:
|
|
9107
|
+
options: localizedTimePartials.value &&
|
|
9108
|
+
localizedTimePartials.value.listOfSeconds.map((option) => {
|
|
9109
|
+
return {
|
|
9110
|
+
value: option.value.toString(),
|
|
9111
|
+
label: option.label,
|
|
9112
|
+
};
|
|
9113
|
+
}),
|
|
9133
9114
|
onChange: (event) => handleTimeChange('seconds', event.target.value),
|
|
9134
9115
|
...(date.value && { value: getSelectedSeconds(date.value) }),
|
|
9135
9116
|
}),
|
|
9136
|
-
|
|
9117
|
+
localizedTimePartials.value &&
|
|
9118
|
+
localizedTimePartials.value.hour12 &&
|
|
9137
9119
|
h$1(CFormSelect, {
|
|
9138
9120
|
disabled: props.disabled,
|
|
9139
9121
|
options: [
|
|
@@ -9146,22 +9128,23 @@ const CTimePicker = defineComponent({
|
|
|
9146
9128
|
];
|
|
9147
9129
|
const TimePickerRoll = () => [
|
|
9148
9130
|
h$1(CTimePickerRollCol, {
|
|
9149
|
-
elements:
|
|
9131
|
+
elements: localizedTimePartials.value && localizedTimePartials.value.listOfHours,
|
|
9150
9132
|
onClick: (index) => handleTimeChange('hours', index.toString()),
|
|
9151
9133
|
selected: getSelectedHour(date.value, props.locale, props.ampm),
|
|
9152
9134
|
}),
|
|
9153
9135
|
h$1(CTimePickerRollCol, {
|
|
9154
|
-
elements:
|
|
9136
|
+
elements: localizedTimePartials.value && localizedTimePartials.value.listOfMinutes,
|
|
9155
9137
|
onClick: (index) => handleTimeChange('minutes', index.toString()),
|
|
9156
9138
|
selected: getSelectedMinutes(date.value),
|
|
9157
9139
|
}),
|
|
9158
9140
|
props.seconds &&
|
|
9159
9141
|
h$1(CTimePickerRollCol, {
|
|
9160
|
-
elements:
|
|
9142
|
+
elements: localizedTimePartials.value && localizedTimePartials.value.listOfSeconds,
|
|
9161
9143
|
onClick: (index) => handleTimeChange('seconds', index.toString()),
|
|
9162
9144
|
selected: getSelectedSeconds(date.value),
|
|
9163
9145
|
}),
|
|
9164
|
-
|
|
9146
|
+
localizedTimePartials.value &&
|
|
9147
|
+
localizedTimePartials.value.hour12 &&
|
|
9165
9148
|
h$1(CTimePickerRollCol, {
|
|
9166
9149
|
elements: [
|
|
9167
9150
|
{ value: 'am', label: 'AM' },
|
|
@@ -10484,16 +10467,16 @@ const CElementCover = defineComponent({
|
|
|
10484
10467
|
return () => h$1('div', {
|
|
10485
10468
|
style: { ...coverStyles, ...customBoundaries.value },
|
|
10486
10469
|
ref: elementCoverRef,
|
|
10470
|
+
}, h$1('div', {
|
|
10471
|
+
style: {
|
|
10472
|
+
position: 'absolute',
|
|
10473
|
+
top: '50%',
|
|
10474
|
+
left: '50%',
|
|
10475
|
+
transform: 'translateX(-50%) translateY(-50%)',
|
|
10476
|
+
},
|
|
10487
10477
|
}, slots.default
|
|
10488
10478
|
? slots.default()
|
|
10489
|
-
: h$1(
|
|
10490
|
-
style: {
|
|
10491
|
-
position: 'absolute',
|
|
10492
|
-
top: '50%',
|
|
10493
|
-
left: '50%',
|
|
10494
|
-
transform: 'translateX(-50%) translateY(-50%)',
|
|
10495
|
-
},
|
|
10496
|
-
}, h$1(CSpinner, {
|
|
10479
|
+
: h$1(CSpinner, {
|
|
10497
10480
|
variant: 'grow',
|
|
10498
10481
|
color: 'primary',
|
|
10499
10482
|
})));
|
|
@@ -11183,7 +11166,6 @@ const CModal = defineComponent({
|
|
|
11183
11166
|
*/
|
|
11184
11167
|
alignment: {
|
|
11185
11168
|
default: 'top',
|
|
11186
|
-
required: false,
|
|
11187
11169
|
validator: (value) => {
|
|
11188
11170
|
return ['top', 'center'].includes(value);
|
|
11189
11171
|
},
|
|
@@ -11191,12 +11173,20 @@ const CModal = defineComponent({
|
|
|
11191
11173
|
/**
|
|
11192
11174
|
* Apply a backdrop on body while offcanvas is open.
|
|
11193
11175
|
*
|
|
11194
|
-
* @values 'static'
|
|
11176
|
+
* @values boolean | 'static'
|
|
11195
11177
|
*/
|
|
11196
11178
|
backdrop: {
|
|
11197
11179
|
type: [Boolean, String],
|
|
11198
11180
|
default: true,
|
|
11199
|
-
|
|
11181
|
+
validator: (value) => {
|
|
11182
|
+
if (typeof value == 'string') {
|
|
11183
|
+
return ['static'].includes(value);
|
|
11184
|
+
}
|
|
11185
|
+
if (typeof value == 'boolean') {
|
|
11186
|
+
return true;
|
|
11187
|
+
}
|
|
11188
|
+
return false;
|
|
11189
|
+
},
|
|
11200
11190
|
},
|
|
11201
11191
|
/**
|
|
11202
11192
|
* A string of all className you want applied to the modal content component.
|
|
@@ -11204,7 +11194,6 @@ const CModal = defineComponent({
|
|
|
11204
11194
|
contentClassName: {
|
|
11205
11195
|
type: String,
|
|
11206
11196
|
default: undefined,
|
|
11207
|
-
required: false,
|
|
11208
11197
|
},
|
|
11209
11198
|
/**
|
|
11210
11199
|
* Set modal to covers the entire user viewport
|
|
@@ -11214,7 +11203,6 @@ const CModal = defineComponent({
|
|
|
11214
11203
|
fullscreen: {
|
|
11215
11204
|
type: [Boolean, String],
|
|
11216
11205
|
default: undefined,
|
|
11217
|
-
required: false,
|
|
11218
11206
|
validator: (value) => {
|
|
11219
11207
|
if (typeof value == 'string') {
|
|
11220
11208
|
return ['sm', 'md', 'lg', 'xl', 'xxl'].includes(value);
|
|
@@ -11231,14 +11219,12 @@ const CModal = defineComponent({
|
|
|
11231
11219
|
keyboard: {
|
|
11232
11220
|
type: Boolean,
|
|
11233
11221
|
default: true,
|
|
11234
|
-
required: false,
|
|
11235
11222
|
},
|
|
11236
11223
|
/**
|
|
11237
11224
|
* Create a scrollable modal that allows scrolling the modal body.
|
|
11238
11225
|
*/
|
|
11239
11226
|
scrollable: {
|
|
11240
11227
|
type: Boolean,
|
|
11241
|
-
required: false,
|
|
11242
11228
|
},
|
|
11243
11229
|
/**
|
|
11244
11230
|
* Size the component small, large, or extra large.
|
|
@@ -11248,7 +11234,6 @@ const CModal = defineComponent({
|
|
|
11248
11234
|
size: {
|
|
11249
11235
|
type: String,
|
|
11250
11236
|
default: undefined,
|
|
11251
|
-
required: false,
|
|
11252
11237
|
validator: (value) => {
|
|
11253
11238
|
return ['sm', 'lg', 'xl'].includes(value);
|
|
11254
11239
|
},
|
|
@@ -11259,7 +11244,6 @@ const CModal = defineComponent({
|
|
|
11259
11244
|
transition: {
|
|
11260
11245
|
type: Boolean,
|
|
11261
11246
|
default: true,
|
|
11262
|
-
required: false,
|
|
11263
11247
|
},
|
|
11264
11248
|
/**
|
|
11265
11249
|
* By default the component is unmounted after close animation, if you want to keep the component mounted set this property to false.
|
|
@@ -11267,7 +11251,6 @@ const CModal = defineComponent({
|
|
|
11267
11251
|
unmountOnClose: {
|
|
11268
11252
|
type: Boolean,
|
|
11269
11253
|
default: true,
|
|
11270
|
-
required: false,
|
|
11271
11254
|
},
|
|
11272
11255
|
/**
|
|
11273
11256
|
* Toggle the visibility of alert component.
|
|
@@ -11515,6 +11498,159 @@ const CMultiSelectNativeSelect = defineComponent({
|
|
|
11515
11498
|
},
|
|
11516
11499
|
});
|
|
11517
11500
|
|
|
11501
|
+
const CVirtualScroller = defineComponent({
|
|
11502
|
+
name: 'CVirtualScroller',
|
|
11503
|
+
props: {
|
|
11504
|
+
/**
|
|
11505
|
+
* Amount of visible items
|
|
11506
|
+
*/
|
|
11507
|
+
visibleItems: {
|
|
11508
|
+
type: Number,
|
|
11509
|
+
default: 10,
|
|
11510
|
+
},
|
|
11511
|
+
},
|
|
11512
|
+
setup(props, { slots }) {
|
|
11513
|
+
const virtualScrollRef = ref();
|
|
11514
|
+
const virtualScrollContentRef = ref();
|
|
11515
|
+
const currentItemIndex = ref(1);
|
|
11516
|
+
const itemHeight = ref(0);
|
|
11517
|
+
const itemsNumber = ref(0);
|
|
11518
|
+
const viewportPadding = ref(0);
|
|
11519
|
+
const buffer = computed(() => Math.floor(props.visibleItems / 2));
|
|
11520
|
+
const maxHeight = computed(() => itemsNumber.value * itemHeight.value + 2 * viewportPadding.value);
|
|
11521
|
+
const viewportHeight = computed(() => props.visibleItems * itemHeight.value + 2 * viewportPadding.value);
|
|
11522
|
+
onMounted(() => {
|
|
11523
|
+
if (virtualScrollRef.value) {
|
|
11524
|
+
viewportPadding.value = parseFloat(getComputedStyle(virtualScrollRef.value).paddingTop);
|
|
11525
|
+
// It's necessary to calculate heights of items
|
|
11526
|
+
virtualScrollRef.value.dispatchEvent(new CustomEvent('scroll'));
|
|
11527
|
+
}
|
|
11528
|
+
});
|
|
11529
|
+
const handleScroll = (scrollTop) => {
|
|
11530
|
+
currentItemIndex.value =
|
|
11531
|
+
itemHeight.value && Math.max(Math.ceil(scrollTop / itemHeight.value), 1);
|
|
11532
|
+
};
|
|
11533
|
+
return () => {
|
|
11534
|
+
const children = slots.default
|
|
11535
|
+
? Array.isArray(slots.default()[0].children)
|
|
11536
|
+
? slots.default()[0].children
|
|
11537
|
+
: slots.default()
|
|
11538
|
+
: [];
|
|
11539
|
+
itemsNumber.value = children && children.length ? children.length : 0;
|
|
11540
|
+
return h$1('div', {
|
|
11541
|
+
class: ['virtual-scroller'],
|
|
11542
|
+
onScroll: (event) => handleScroll(event.target.scrollTop),
|
|
11543
|
+
style: {
|
|
11544
|
+
height: `${maxHeight.value > viewportHeight.value ? viewportHeight.value : maxHeight.value}px`,
|
|
11545
|
+
overflowY: 'auto',
|
|
11546
|
+
},
|
|
11547
|
+
ref: virtualScrollRef,
|
|
11548
|
+
}, h$1('div', {
|
|
11549
|
+
class: 'virtual-scroller-content',
|
|
11550
|
+
style: {
|
|
11551
|
+
height: `${maxHeight.value}px`,
|
|
11552
|
+
},
|
|
11553
|
+
ref: virtualScrollContentRef,
|
|
11554
|
+
}, children.map((slot, index) => index + 1 > Math.max(currentItemIndex.value - buffer.value, 0) &&
|
|
11555
|
+
index + 1 <= currentItemIndex.value + props.visibleItems + buffer.value &&
|
|
11556
|
+
cloneVNode(slot, {
|
|
11557
|
+
class: [
|
|
11558
|
+
{
|
|
11559
|
+
'virtual-scroller-item-preload': index + 1 > currentItemIndex.value + props.visibleItems ||
|
|
11560
|
+
index + 1 < currentItemIndex.value,
|
|
11561
|
+
},
|
|
11562
|
+
],
|
|
11563
|
+
style: {
|
|
11564
|
+
...(currentItemIndex.value > buffer.value && {
|
|
11565
|
+
transform: `translateY(${(currentItemIndex.value - buffer.value) * itemHeight.value}px)`,
|
|
11566
|
+
}),
|
|
11567
|
+
},
|
|
11568
|
+
ref: (node) => {
|
|
11569
|
+
if (node && node.offsetHeight) {
|
|
11570
|
+
itemHeight.value =
|
|
11571
|
+
node.offsetHeight +
|
|
11572
|
+
parseFloat(getComputedStyle(node).marginTop) +
|
|
11573
|
+
parseFloat(getComputedStyle(node).marginBottom);
|
|
11574
|
+
}
|
|
11575
|
+
},
|
|
11576
|
+
}))));
|
|
11577
|
+
};
|
|
11578
|
+
},
|
|
11579
|
+
});
|
|
11580
|
+
|
|
11581
|
+
const CVirtualScrollerPlugin = {
|
|
11582
|
+
install: (app) => {
|
|
11583
|
+
app.component(CVirtualScroller.name, CVirtualScroller);
|
|
11584
|
+
},
|
|
11585
|
+
};
|
|
11586
|
+
|
|
11587
|
+
const filterOptionsList = (search, _options) => {
|
|
11588
|
+
return search.length
|
|
11589
|
+
? _options &&
|
|
11590
|
+
_options.reduce((acc, val) => {
|
|
11591
|
+
const options = val.options &&
|
|
11592
|
+
val.options.filter((element) => element.text && element.text.toLowerCase().includes(search.toLowerCase()));
|
|
11593
|
+
if ((val.text && val.text.toLowerCase().includes(search.toLowerCase())) ||
|
|
11594
|
+
(options && options.length)) {
|
|
11595
|
+
acc.push(Object.assign({}, val, options && options.length && { options }));
|
|
11596
|
+
}
|
|
11597
|
+
return acc;
|
|
11598
|
+
}, [])
|
|
11599
|
+
: _options;
|
|
11600
|
+
};
|
|
11601
|
+
const flattenArray = (options) => {
|
|
11602
|
+
return options.reduce((acc, val) => {
|
|
11603
|
+
return acc.concat(Array.isArray(val.options) ? flattenArray(val.options) : val);
|
|
11604
|
+
}, []);
|
|
11605
|
+
};
|
|
11606
|
+
const getNextSibling = (elem, selector) => {
|
|
11607
|
+
// Get the next sibling element
|
|
11608
|
+
let sibling = elem.nextElementSibling;
|
|
11609
|
+
// If there's no selector, return the first sibling
|
|
11610
|
+
if (!selector)
|
|
11611
|
+
return sibling;
|
|
11612
|
+
// If the sibling matches our selector, use it
|
|
11613
|
+
// If not, jump to the next sibling and continue the loop
|
|
11614
|
+
while (sibling) {
|
|
11615
|
+
if (sibling.matches(selector))
|
|
11616
|
+
return sibling;
|
|
11617
|
+
sibling = sibling.nextElementSibling;
|
|
11618
|
+
}
|
|
11619
|
+
return;
|
|
11620
|
+
};
|
|
11621
|
+
const getPreviousSibling = (elem, selector) => {
|
|
11622
|
+
// Get the next sibling element
|
|
11623
|
+
let sibling = elem.previousElementSibling;
|
|
11624
|
+
// If there's no selector, return the first sibling
|
|
11625
|
+
if (!selector)
|
|
11626
|
+
return sibling;
|
|
11627
|
+
// If the sibling matches our selector, use it
|
|
11628
|
+
// If not, jump to the next sibling and continue the loop
|
|
11629
|
+
while (sibling) {
|
|
11630
|
+
if (sibling.matches(selector))
|
|
11631
|
+
return sibling;
|
|
11632
|
+
sibling = sibling.previousElementSibling;
|
|
11633
|
+
}
|
|
11634
|
+
return;
|
|
11635
|
+
};
|
|
11636
|
+
const selectOptions = (options, selected, deselected) => {
|
|
11637
|
+
let _selected = [...selected, ...options];
|
|
11638
|
+
if (deselected) {
|
|
11639
|
+
_selected = _selected.filter((selectedOption) => !deselected.some((deselectedOption) => deselectedOption.value === selectedOption.value));
|
|
11640
|
+
}
|
|
11641
|
+
const deduplicated = _selected.reduce((unique, option) => {
|
|
11642
|
+
if (!unique.some((obj) => obj.value === option.value)) {
|
|
11643
|
+
unique.push({
|
|
11644
|
+
value: option.value,
|
|
11645
|
+
text: option.text,
|
|
11646
|
+
...(option.disabled && { disabled: option.disabled }),
|
|
11647
|
+
});
|
|
11648
|
+
}
|
|
11649
|
+
return unique;
|
|
11650
|
+
}, []);
|
|
11651
|
+
return deduplicated;
|
|
11652
|
+
};
|
|
11653
|
+
|
|
11518
11654
|
const CMultiSelectOptions = defineComponent({
|
|
11519
11655
|
name: 'CMultiSelectOptions',
|
|
11520
11656
|
props: {
|
|
@@ -11524,7 +11660,6 @@ const CMultiSelectOptions = defineComponent({
|
|
|
11524
11660
|
options: {
|
|
11525
11661
|
type: Array,
|
|
11526
11662
|
default: () => [],
|
|
11527
|
-
required: false,
|
|
11528
11663
|
},
|
|
11529
11664
|
/**
|
|
11530
11665
|
* Sets maxHeight of options list.
|
|
@@ -11534,7 +11669,6 @@ const CMultiSelectOptions = defineComponent({
|
|
|
11534
11669
|
optionsMaxHeight: {
|
|
11535
11670
|
type: [Number, String],
|
|
11536
11671
|
default: 'auto',
|
|
11537
|
-
required: false,
|
|
11538
11672
|
},
|
|
11539
11673
|
/**
|
|
11540
11674
|
* Sets option style.
|
|
@@ -11545,7 +11679,6 @@ const CMultiSelectOptions = defineComponent({
|
|
|
11545
11679
|
optionsStyle: {
|
|
11546
11680
|
type: String,
|
|
11547
11681
|
default: 'checkbox',
|
|
11548
|
-
required: false,
|
|
11549
11682
|
validator: (value) => {
|
|
11550
11683
|
return ['checkbox', 'text'].includes(value);
|
|
11551
11684
|
},
|
|
@@ -11556,12 +11689,15 @@ const CMultiSelectOptions = defineComponent({
|
|
|
11556
11689
|
searchNoResultsLabel: {
|
|
11557
11690
|
type: String,
|
|
11558
11691
|
default: 'no items',
|
|
11559
|
-
required: false,
|
|
11560
11692
|
},
|
|
11561
11693
|
selected: {
|
|
11562
11694
|
type: Array,
|
|
11563
11695
|
default: () => [],
|
|
11564
|
-
|
|
11696
|
+
},
|
|
11697
|
+
virtualScroller: Boolean,
|
|
11698
|
+
visibleItems: {
|
|
11699
|
+
type: Number,
|
|
11700
|
+
default: 10,
|
|
11565
11701
|
},
|
|
11566
11702
|
},
|
|
11567
11703
|
emits: ['optionClick'],
|
|
@@ -11613,12 +11749,19 @@ const CMultiSelectOptions = defineComponent({
|
|
|
11613
11749
|
tabindex: 0,
|
|
11614
11750
|
}, option.text))
|
|
11615
11751
|
: h$1('div', { class: 'form-multi-select-options-empty' }, props.searchNoResultsLabel);
|
|
11616
|
-
return () =>
|
|
11617
|
-
|
|
11618
|
-
|
|
11619
|
-
|
|
11620
|
-
}
|
|
11621
|
-
|
|
11752
|
+
return () => props.virtualScroller
|
|
11753
|
+
? h$1(CVirtualScroller, {
|
|
11754
|
+
class: 'form-multi-select-options',
|
|
11755
|
+
visibleItems: props.visibleItems,
|
|
11756
|
+
}, {
|
|
11757
|
+
default: () => createOptions(props.options),
|
|
11758
|
+
})
|
|
11759
|
+
: h$1('div', {
|
|
11760
|
+
class: 'form-multi-select-options',
|
|
11761
|
+
...(props.optionsMaxHeight !== 'auto' && {
|
|
11762
|
+
style: { maxHeight: props.optionsMaxHeight, overflow: 'scroll' },
|
|
11763
|
+
}),
|
|
11764
|
+
}, createOptions(props.options));
|
|
11622
11765
|
},
|
|
11623
11766
|
});
|
|
11624
11767
|
|
|
@@ -11709,11 +11852,6 @@ const CMultiSelectSelection = defineComponent({
|
|
|
11709
11852
|
},
|
|
11710
11853
|
});
|
|
11711
11854
|
|
|
11712
|
-
const flattenArray = (options) => {
|
|
11713
|
-
return options.reduce((acc, val) => {
|
|
11714
|
-
return acc.concat(Array.isArray(val.options) ? flattenArray(val.options) : val);
|
|
11715
|
-
}, []);
|
|
11716
|
-
};
|
|
11717
11855
|
const CMultiSelect = defineComponent({
|
|
11718
11856
|
name: 'CMultiSelect',
|
|
11719
11857
|
props: {
|
|
@@ -11724,7 +11862,6 @@ const CMultiSelect = defineComponent({
|
|
|
11724
11862
|
*/
|
|
11725
11863
|
cleaner: {
|
|
11726
11864
|
type: Boolean,
|
|
11727
|
-
required: false,
|
|
11728
11865
|
default: true,
|
|
11729
11866
|
},
|
|
11730
11867
|
/**
|
|
@@ -11732,7 +11869,6 @@ const CMultiSelect = defineComponent({
|
|
|
11732
11869
|
*/
|
|
11733
11870
|
disabled: {
|
|
11734
11871
|
type: Boolean,
|
|
11735
|
-
required: false,
|
|
11736
11872
|
default: false,
|
|
11737
11873
|
},
|
|
11738
11874
|
/**
|
|
@@ -11787,7 +11923,6 @@ const CMultiSelect = defineComponent({
|
|
|
11787
11923
|
multiple: {
|
|
11788
11924
|
type: Boolean,
|
|
11789
11925
|
default: true,
|
|
11790
|
-
required: false,
|
|
11791
11926
|
},
|
|
11792
11927
|
/**
|
|
11793
11928
|
* List of option elements.
|
|
@@ -11795,7 +11930,6 @@ const CMultiSelect = defineComponent({
|
|
|
11795
11930
|
options: {
|
|
11796
11931
|
type: Array,
|
|
11797
11932
|
default: () => [],
|
|
11798
|
-
required: false,
|
|
11799
11933
|
},
|
|
11800
11934
|
/**
|
|
11801
11935
|
* Sets maxHeight of options list.
|
|
@@ -11805,7 +11939,6 @@ const CMultiSelect = defineComponent({
|
|
|
11805
11939
|
optionsMaxHeight: {
|
|
11806
11940
|
type: [Number, String],
|
|
11807
11941
|
default: 'auto',
|
|
11808
|
-
required: false,
|
|
11809
11942
|
},
|
|
11810
11943
|
/**
|
|
11811
11944
|
* Sets option style.
|
|
@@ -11816,7 +11949,6 @@ const CMultiSelect = defineComponent({
|
|
|
11816
11949
|
optionsStyle: {
|
|
11817
11950
|
type: String,
|
|
11818
11951
|
default: 'checkbox',
|
|
11819
|
-
required: false,
|
|
11820
11952
|
validator: (value) => {
|
|
11821
11953
|
return ['checkbox', 'text'].includes(value);
|
|
11822
11954
|
},
|
|
@@ -11829,7 +11961,6 @@ const CMultiSelect = defineComponent({
|
|
|
11829
11961
|
placeholder: {
|
|
11830
11962
|
type: String,
|
|
11831
11963
|
default: 'Select...',
|
|
11832
|
-
required: false,
|
|
11833
11964
|
},
|
|
11834
11965
|
/**
|
|
11835
11966
|
* Enables search input element.
|
|
@@ -11837,7 +11968,6 @@ const CMultiSelect = defineComponent({
|
|
|
11837
11968
|
search: {
|
|
11838
11969
|
type: [Boolean, String],
|
|
11839
11970
|
default: true,
|
|
11840
|
-
required: false,
|
|
11841
11971
|
validator: (value) => {
|
|
11842
11972
|
if (typeof value == 'string') {
|
|
11843
11973
|
return ['external'].includes(value);
|
|
@@ -11854,7 +11984,6 @@ const CMultiSelect = defineComponent({
|
|
|
11854
11984
|
searchNoResultsLabel: {
|
|
11855
11985
|
type: String,
|
|
11856
11986
|
default: 'no items',
|
|
11857
|
-
required: false,
|
|
11858
11987
|
},
|
|
11859
11988
|
/**
|
|
11860
11989
|
* Enables select all button.
|
|
@@ -11863,7 +11992,6 @@ const CMultiSelect = defineComponent({
|
|
|
11863
11992
|
*/
|
|
11864
11993
|
selectAll: {
|
|
11865
11994
|
type: Boolean,
|
|
11866
|
-
required: false,
|
|
11867
11995
|
default: true,
|
|
11868
11996
|
},
|
|
11869
11997
|
/**
|
|
@@ -11873,7 +12001,6 @@ const CMultiSelect = defineComponent({
|
|
|
11873
12001
|
*/
|
|
11874
12002
|
selectAllLabel: {
|
|
11875
12003
|
type: String,
|
|
11876
|
-
required: false,
|
|
11877
12004
|
default: 'Select all options',
|
|
11878
12005
|
},
|
|
11879
12006
|
/**
|
|
@@ -11885,7 +12012,6 @@ const CMultiSelect = defineComponent({
|
|
|
11885
12012
|
selectionType: {
|
|
11886
12013
|
type: String,
|
|
11887
12014
|
default: 'tags',
|
|
11888
|
-
required: false,
|
|
11889
12015
|
validator: (value) => {
|
|
11890
12016
|
return ['counter', 'tags', 'text'].includes(value);
|
|
11891
12017
|
},
|
|
@@ -11898,7 +12024,6 @@ const CMultiSelect = defineComponent({
|
|
|
11898
12024
|
selectionTypeCounterText: {
|
|
11899
12025
|
type: String,
|
|
11900
12026
|
default: 'item(s) selected',
|
|
11901
|
-
required: false,
|
|
11902
12027
|
},
|
|
11903
12028
|
/**
|
|
11904
12029
|
* Size the component small or large.
|
|
@@ -11907,7 +12032,6 @@ const CMultiSelect = defineComponent({
|
|
|
11907
12032
|
*/
|
|
11908
12033
|
size: {
|
|
11909
12034
|
type: String,
|
|
11910
|
-
required: false,
|
|
11911
12035
|
validator: (value) => {
|
|
11912
12036
|
return ['sm', 'lg'].includes(value);
|
|
11913
12037
|
},
|
|
@@ -11932,6 +12056,12 @@ const CMultiSelect = defineComponent({
|
|
|
11932
12056
|
* @since 4.6.0
|
|
11933
12057
|
*/
|
|
11934
12058
|
valid: Boolean,
|
|
12059
|
+
/**
|
|
12060
|
+
* Enable virtual scroller for the options list.
|
|
12061
|
+
*
|
|
12062
|
+
* @since 4.8.0
|
|
12063
|
+
*/
|
|
12064
|
+
virtualScroller: Boolean,
|
|
11935
12065
|
/**
|
|
11936
12066
|
* Toggle the visibility of multi select dropdown.
|
|
11937
12067
|
*
|
|
@@ -11940,7 +12070,16 @@ const CMultiSelect = defineComponent({
|
|
|
11940
12070
|
visible: {
|
|
11941
12071
|
type: Boolean,
|
|
11942
12072
|
default: false,
|
|
11943
|
-
|
|
12073
|
+
},
|
|
12074
|
+
/**
|
|
12075
|
+
*
|
|
12076
|
+
* Amount of visible items when virtualScroller is set to `true`.
|
|
12077
|
+
*
|
|
12078
|
+
* @since 4.8.0
|
|
12079
|
+
*/
|
|
12080
|
+
visibleItems: {
|
|
12081
|
+
type: Number,
|
|
12082
|
+
default: 10,
|
|
11944
12083
|
},
|
|
11945
12084
|
},
|
|
11946
12085
|
emits: [
|
|
@@ -11957,29 +12096,12 @@ const CMultiSelect = defineComponent({
|
|
|
11957
12096
|
],
|
|
11958
12097
|
setup(props, { attrs, emit }) {
|
|
11959
12098
|
const nativeSelectRef = ref();
|
|
11960
|
-
provide('nativeSelectRef', nativeSelectRef);
|
|
11961
|
-
const searchRef = ref();
|
|
11962
12099
|
const options = ref(props.options);
|
|
11963
12100
|
const search = ref('');
|
|
12101
|
+
const searchRef = ref();
|
|
11964
12102
|
const selected = ref([]);
|
|
11965
12103
|
const visible = ref(props.visible);
|
|
11966
|
-
|
|
11967
|
-
let _selected = [...selected.value, ...options];
|
|
11968
|
-
if (deselected) {
|
|
11969
|
-
_selected = _selected.filter((selectedOption) => !deselected.some((deselectedOption) => deselectedOption.value === selectedOption.value));
|
|
11970
|
-
}
|
|
11971
|
-
const deduplicated = _selected.reduce((unique, option) => {
|
|
11972
|
-
if (!unique.some((obj) => obj.value === option.value)) {
|
|
11973
|
-
unique.push({
|
|
11974
|
-
value: option.value,
|
|
11975
|
-
text: option.text,
|
|
11976
|
-
...(option.disabled && { disabled: option.disabled }),
|
|
11977
|
-
});
|
|
11978
|
-
}
|
|
11979
|
-
return unique;
|
|
11980
|
-
}, []);
|
|
11981
|
-
selected.value = deduplicated;
|
|
11982
|
-
};
|
|
12104
|
+
provide('nativeSelectRef', nativeSelectRef);
|
|
11983
12105
|
watch(() => props.options, (newValue, oldValue) => {
|
|
11984
12106
|
if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) {
|
|
11985
12107
|
options.value = newValue;
|
|
@@ -11997,34 +12119,15 @@ const CMultiSelect = defineComponent({
|
|
|
11997
12119
|
}
|
|
11998
12120
|
return;
|
|
11999
12121
|
});
|
|
12000
|
-
|
|
12122
|
+
if (_selected) {
|
|
12123
|
+
selected.value = selectOptions(_selected, selected.value, deselected);
|
|
12124
|
+
}
|
|
12001
12125
|
}
|
|
12002
|
-
});
|
|
12126
|
+
}, { immediate: true });
|
|
12003
12127
|
watch(selected, () => {
|
|
12004
12128
|
nativeSelectRef.value &&
|
|
12005
12129
|
nativeSelectRef.value.dispatchEvent(new Event('change', { bubbles: true }));
|
|
12006
12130
|
});
|
|
12007
|
-
const filterOptionsList = (search, _options) => {
|
|
12008
|
-
return search.length
|
|
12009
|
-
? _options &&
|
|
12010
|
-
_options.reduce((acc, val) => {
|
|
12011
|
-
const options = val.options &&
|
|
12012
|
-
val.options.filter((element) => element.text && element.text.toLowerCase().includes(search.toLowerCase()));
|
|
12013
|
-
if ((val.text && val.text.toLowerCase().includes(search.toLowerCase())) ||
|
|
12014
|
-
(options && options.length)) {
|
|
12015
|
-
acc.push(Object.assign({}, val, options && options.length && { options }));
|
|
12016
|
-
}
|
|
12017
|
-
return acc;
|
|
12018
|
-
}, [])
|
|
12019
|
-
: options.value;
|
|
12020
|
-
};
|
|
12021
|
-
// watch(
|
|
12022
|
-
// () => props.options,
|
|
12023
|
-
// (newValue, oldValue) => {
|
|
12024
|
-
// console.log(props.options)
|
|
12025
|
-
// if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) options.value = newValue
|
|
12026
|
-
// },
|
|
12027
|
-
// )
|
|
12028
12131
|
const handleSearchChange = (event) => {
|
|
12029
12132
|
const target = event.target;
|
|
12030
12133
|
search.value = target.value.toLowerCase();
|
|
@@ -12062,7 +12165,7 @@ const CMultiSelect = defineComponent({
|
|
|
12062
12165
|
}
|
|
12063
12166
|
};
|
|
12064
12167
|
const handleSelectAll = () => {
|
|
12065
|
-
selectOptions(flattenArray(options.value).filter((option) => !option.disabled));
|
|
12168
|
+
selected.value = selectOptions(flattenArray(options.value).filter((option) => !option.disabled), selected.value);
|
|
12066
12169
|
};
|
|
12067
12170
|
const handleDeselectAll = () => {
|
|
12068
12171
|
selected.value = selected.value.filter((option) => option.disabled);
|
|
@@ -12153,7 +12256,7 @@ const CMultiSelect = defineComponent({
|
|
|
12153
12256
|
ref: searchRef,
|
|
12154
12257
|
}),
|
|
12155
12258
|
]),
|
|
12156
|
-
default: () =>
|
|
12259
|
+
default: () => visible.value && [
|
|
12157
12260
|
props.multiple &&
|
|
12158
12261
|
props.selectAll &&
|
|
12159
12262
|
h$1('button', {
|
|
@@ -12169,9 +12272,11 @@ const CMultiSelect = defineComponent({
|
|
|
12169
12272
|
optionsMaxHeight: props.optionsMaxHeight,
|
|
12170
12273
|
optionsStyle: props.optionsStyle,
|
|
12171
12274
|
searchNoResultsLabel: props.searchNoResultsLabel,
|
|
12172
|
-
selected: selected.value
|
|
12275
|
+
selected: selected.value,
|
|
12276
|
+
virtualScroller: props.virtualScroller,
|
|
12277
|
+
visibleItems: props.visibleItems,
|
|
12173
12278
|
}),
|
|
12174
|
-
]
|
|
12279
|
+
],
|
|
12175
12280
|
}),
|
|
12176
12281
|
}),
|
|
12177
12282
|
];
|
|
@@ -12609,11 +12714,21 @@ const COffcanvas = defineComponent({
|
|
|
12609
12714
|
props: {
|
|
12610
12715
|
/**
|
|
12611
12716
|
* Apply a backdrop on body while offcanvas is open.
|
|
12717
|
+
*
|
|
12718
|
+
* @values boolean | 'static'
|
|
12612
12719
|
*/
|
|
12613
12720
|
backdrop: {
|
|
12614
|
-
type: Boolean,
|
|
12721
|
+
type: [Boolean, String],
|
|
12615
12722
|
default: true,
|
|
12616
|
-
|
|
12723
|
+
validator: (value) => {
|
|
12724
|
+
if (typeof value === 'string') {
|
|
12725
|
+
return ['static'].includes(value);
|
|
12726
|
+
}
|
|
12727
|
+
if (typeof value === 'boolean') {
|
|
12728
|
+
return true;
|
|
12729
|
+
}
|
|
12730
|
+
return false;
|
|
12731
|
+
},
|
|
12617
12732
|
},
|
|
12618
12733
|
/**
|
|
12619
12734
|
* Closes the offcanvas when escape key is pressed.
|
|
@@ -12621,7 +12736,6 @@ const COffcanvas = defineComponent({
|
|
|
12621
12736
|
keyboard: {
|
|
12622
12737
|
type: Boolean,
|
|
12623
12738
|
default: true,
|
|
12624
|
-
require: false,
|
|
12625
12739
|
},
|
|
12626
12740
|
/**
|
|
12627
12741
|
* Components placement, there’s no default placement.
|
|
@@ -12636,21 +12750,36 @@ const COffcanvas = defineComponent({
|
|
|
12636
12750
|
return ['start', 'end', 'top', 'bottom'].includes(value);
|
|
12637
12751
|
},
|
|
12638
12752
|
},
|
|
12753
|
+
/**
|
|
12754
|
+
* Responsive offcanvas property hide content outside the viewport from a specified breakpoint and down.
|
|
12755
|
+
*
|
|
12756
|
+
* @values boolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'
|
|
12757
|
+
* @since 4.7.0
|
|
12758
|
+
*/
|
|
12759
|
+
responsive: {
|
|
12760
|
+
type: [Boolean, String],
|
|
12761
|
+
default: true,
|
|
12762
|
+
validator: (value) => {
|
|
12763
|
+
if (typeof value === 'string') {
|
|
12764
|
+
return ['sm', 'md', 'lg', 'xl', 'xxl'].includes(value);
|
|
12765
|
+
}
|
|
12766
|
+
if (typeof value === 'boolean') {
|
|
12767
|
+
return true;
|
|
12768
|
+
}
|
|
12769
|
+
return false;
|
|
12770
|
+
},
|
|
12771
|
+
},
|
|
12639
12772
|
/**
|
|
12640
12773
|
* Allow body scrolling while offcanvas is open
|
|
12641
12774
|
*/
|
|
12642
12775
|
scroll: {
|
|
12643
12776
|
type: Boolean,
|
|
12644
12777
|
default: false,
|
|
12645
|
-
required: false,
|
|
12646
12778
|
},
|
|
12647
12779
|
/**
|
|
12648
12780
|
* Toggle the visibility of offcanvas component.
|
|
12649
12781
|
*/
|
|
12650
|
-
visible:
|
|
12651
|
-
type: Boolean,
|
|
12652
|
-
require: false,
|
|
12653
|
-
},
|
|
12782
|
+
visible: Boolean,
|
|
12654
12783
|
},
|
|
12655
12784
|
emits: [
|
|
12656
12785
|
/**
|
|
@@ -12685,40 +12814,31 @@ const COffcanvas = defineComponent({
|
|
|
12685
12814
|
emit('show');
|
|
12686
12815
|
executeAfterTransition(() => done(), el);
|
|
12687
12816
|
setTimeout(() => {
|
|
12688
|
-
el.style.visibility = 'visible';
|
|
12689
12817
|
el.classList.add('show');
|
|
12690
12818
|
}, 1);
|
|
12691
12819
|
};
|
|
12692
12820
|
const handleAfterEnter = () => {
|
|
12693
|
-
|
|
12694
|
-
window.addEventListener('keyup', handleKeyUp);
|
|
12821
|
+
offcanvasRef.value.focus();
|
|
12695
12822
|
};
|
|
12696
12823
|
const handleLeave = (el, done) => {
|
|
12697
12824
|
executeAfterTransition(() => done(), el);
|
|
12698
|
-
|
|
12699
|
-
window.removeEventListener('keyup', handleKeyUp);
|
|
12700
|
-
el.classList.remove('show');
|
|
12825
|
+
el.classList.add('hiding');
|
|
12701
12826
|
};
|
|
12702
12827
|
const handleAfterLeave = (el) => {
|
|
12703
|
-
el.
|
|
12828
|
+
el.classList.remove('show', 'hiding');
|
|
12704
12829
|
};
|
|
12705
12830
|
const handleDismiss = () => {
|
|
12706
12831
|
visible.value = false;
|
|
12707
12832
|
emit('hide');
|
|
12708
12833
|
};
|
|
12709
|
-
const
|
|
12710
|
-
if (
|
|
12711
|
-
|
|
12712
|
-
return handleDismiss();
|
|
12713
|
-
}
|
|
12834
|
+
const handleBackdropDismiss = () => {
|
|
12835
|
+
if (props.backdrop !== 'static') {
|
|
12836
|
+
handleDismiss();
|
|
12714
12837
|
}
|
|
12715
12838
|
};
|
|
12716
|
-
const
|
|
12717
|
-
|
|
12718
|
-
|
|
12719
|
-
const handleMouseUp = (event) => {
|
|
12720
|
-
if (offcanvasRef.value && !offcanvasRef.value.contains(event.target)) {
|
|
12721
|
-
props.backdrop && handleDismiss();
|
|
12839
|
+
const handleKeyDown = (event) => {
|
|
12840
|
+
if (event.key === 'Escape' && props.keyboard) {
|
|
12841
|
+
handleDismiss();
|
|
12722
12842
|
}
|
|
12723
12843
|
};
|
|
12724
12844
|
return () => [
|
|
@@ -12730,17 +12850,20 @@ const COffcanvas = defineComponent({
|
|
|
12730
12850
|
onAfterLeave: (el) => handleAfterLeave(el),
|
|
12731
12851
|
}, () => withDirectives(h$1('div', {
|
|
12732
12852
|
class: [
|
|
12733
|
-
'offcanvas',
|
|
12734
12853
|
{
|
|
12854
|
+
[`offcanvas${typeof props.responsive !== 'boolean' ? '-' + props.responsive : ''}`]: props.responsive,
|
|
12735
12855
|
[`offcanvas-${props.placement}`]: props.placement,
|
|
12736
12856
|
},
|
|
12737
12857
|
],
|
|
12858
|
+
onKeydown: (event) => handleKeyDown(event),
|
|
12738
12859
|
ref: offcanvasRef,
|
|
12739
12860
|
role: 'dialog',
|
|
12861
|
+
tabindex: -1,
|
|
12740
12862
|
}, slots.default && slots.default()), [[vVisible, props.visible]])),
|
|
12741
12863
|
props.backdrop &&
|
|
12742
12864
|
h$1(CBackdrop, {
|
|
12743
12865
|
class: 'offcanvas-backdrop',
|
|
12866
|
+
onClick: handleBackdropDismiss,
|
|
12744
12867
|
visible: visible.value,
|
|
12745
12868
|
}),
|
|
12746
12869
|
];
|
|
@@ -13830,6 +13953,140 @@ const CSmartPaginationPlugin = {
|
|
|
13830
13953
|
},
|
|
13831
13954
|
};
|
|
13832
13955
|
|
|
13956
|
+
var cilArrowBottom = ["512 512", "<polygon fill='var(--ci-primary-color, currentColor)' points='367.997 338.75 271.999 434.747 271.999 17.503 239.999 17.503 239.999 434.745 144.003 338.75 121.376 361.377 256 496 390.624 361.377 367.997 338.75' class='ci-primary'/>"];
|
|
13957
|
+
|
|
13958
|
+
var cilArrowTop = ["512 512", "<polygon fill='var(--ci-primary-color, currentColor)' points='390.624 150.625 256 16 121.376 150.625 144.004 173.252 240.001 77.254 240.001 495.236 272.001 495.236 272.001 77.257 367.996 173.252 390.624 150.625' class='ci-primary'/>"];
|
|
13959
|
+
|
|
13960
|
+
var cilFilterX = ["512 512", "<polygon fill='var(--ci-primary-color, currentColor)' points='40 16 40 53.828 109.024 136 150.815 136 76.896 48 459.51 48 304 242.388 304 401.373 241.373 464 240 464 240 368 208 368 208 496 254.627 496 336 414.627 336 253.612 496 53.612 496 16 40 16' class='ci-primary'/><polygon fill='var(--ci-primary-color, currentColor)' points='166.403 248.225 226.864 187.763 204.237 165.135 143.775 225.597 83.313 165.135 60.687 187.763 121.148 248.225 60.687 308.687 83.313 331.314 143.775 270.852 204.237 331.314 226.864 308.687 166.403 248.225' class='ci-primary'/>"];
|
|
13961
|
+
|
|
13962
|
+
var cilSwapVertical = ["512 512", "<polygon fill='var(--ci-primary-color, currentColor)' points='384 433.373 384 160 352 160 352 434.51 282.177 364.687 259.55 387.313 367.432 495.196 475.313 387.313 452.687 364.687 384 433.373' class='ci-primary'/><polygon fill='var(--ci-primary-color, currentColor)' points='159.432 17.372 51.55 125.255 74.177 147.882 144 78.059 144 352 176 352 176 79.195 244.687 147.882 267.313 125.255 159.432 17.372' class='ci-primary'/>"];
|
|
13963
|
+
|
|
13964
|
+
const CIcon = defineComponent({
|
|
13965
|
+
name: 'CIcon',
|
|
13966
|
+
props: {
|
|
13967
|
+
/**
|
|
13968
|
+
* Use `:icon="..."` instead of
|
|
13969
|
+
*
|
|
13970
|
+
* @deprecated since version 3.0
|
|
13971
|
+
*/
|
|
13972
|
+
content: {
|
|
13973
|
+
type: [String, Array],
|
|
13974
|
+
default: undefined,
|
|
13975
|
+
required: false,
|
|
13976
|
+
},
|
|
13977
|
+
/**
|
|
13978
|
+
* Use for replacing default CIcon component classes. Prop is overriding the 'size' prop.
|
|
13979
|
+
*/
|
|
13980
|
+
customClassName: {
|
|
13981
|
+
type: [String, Array, Object],
|
|
13982
|
+
default: undefined,
|
|
13983
|
+
required: false,
|
|
13984
|
+
},
|
|
13985
|
+
/**
|
|
13986
|
+
* Name of the icon placed in React object or SVG content.
|
|
13987
|
+
*/
|
|
13988
|
+
icon: {
|
|
13989
|
+
type: [String, Array],
|
|
13990
|
+
default: undefined,
|
|
13991
|
+
required: false,
|
|
13992
|
+
},
|
|
13993
|
+
/**
|
|
13994
|
+
* Use `icon="..."` instead of
|
|
13995
|
+
*
|
|
13996
|
+
* @deprecated since version 3.0
|
|
13997
|
+
*/
|
|
13998
|
+
name: {
|
|
13999
|
+
type: String,
|
|
14000
|
+
default: undefined,
|
|
14001
|
+
required: false,
|
|
14002
|
+
},
|
|
14003
|
+
/**
|
|
14004
|
+
* Size of the icon. Available sizes: 'sm', 'lg', 'xl', 'xxl', '3xl...9xl', 'custom', 'custom-size'.
|
|
14005
|
+
*/
|
|
14006
|
+
size: {
|
|
14007
|
+
type: String,
|
|
14008
|
+
default: undefined,
|
|
14009
|
+
required: false,
|
|
14010
|
+
validator: (value) => {
|
|
14011
|
+
return [
|
|
14012
|
+
'custom',
|
|
14013
|
+
'custom-size',
|
|
14014
|
+
'sm',
|
|
14015
|
+
'lg',
|
|
14016
|
+
'xl',
|
|
14017
|
+
'xxl',
|
|
14018
|
+
'3xl',
|
|
14019
|
+
'4xl',
|
|
14020
|
+
'5xl',
|
|
14021
|
+
'6xl',
|
|
14022
|
+
'7xl',
|
|
14023
|
+
'8xl',
|
|
14024
|
+
'9xl',
|
|
14025
|
+
].includes(value);
|
|
14026
|
+
},
|
|
14027
|
+
},
|
|
14028
|
+
/**
|
|
14029
|
+
* Title tag content.
|
|
14030
|
+
*/
|
|
14031
|
+
title: {
|
|
14032
|
+
type: String,
|
|
14033
|
+
default: undefined,
|
|
14034
|
+
required: false,
|
|
14035
|
+
},
|
|
14036
|
+
/**
|
|
14037
|
+
* If defined component will be rendered using 'use' tag.
|
|
14038
|
+
*/
|
|
14039
|
+
use: {
|
|
14040
|
+
type: String,
|
|
14041
|
+
default: undefined,
|
|
14042
|
+
required: false,
|
|
14043
|
+
},
|
|
14044
|
+
},
|
|
14045
|
+
setup(props, { attrs }) {
|
|
14046
|
+
const icons = inject('icons');
|
|
14047
|
+
const _icon = props.icon || props.content || props.name;
|
|
14048
|
+
const toCamelCase = (str) => {
|
|
14049
|
+
return str
|
|
14050
|
+
.replace(/([-_][a-z0-9])/gi, ($1) => {
|
|
14051
|
+
return $1.toUpperCase();
|
|
14052
|
+
})
|
|
14053
|
+
.replace(/-/gi, '');
|
|
14054
|
+
};
|
|
14055
|
+
const iconName = computed(() => _icon && typeof _icon === 'string' ? (_icon.includes('-') ? toCamelCase(_icon) : _icon) : '');
|
|
14056
|
+
const titleCode = props.title ? `<title>${props.title}</title>` : 'undefined';
|
|
14057
|
+
const code = computed(() => Array.isArray(_icon)
|
|
14058
|
+
? _icon
|
|
14059
|
+
: typeof _icon === 'string' && iconName.value && icons[iconName.value]
|
|
14060
|
+
? icons[iconName.value]
|
|
14061
|
+
: 'undefined');
|
|
14062
|
+
const iconCode = Array.isArray(code.value) ? code.value[1] || code.value[0] : code.value;
|
|
14063
|
+
const scale = Array.isArray(code.value) && code.value.length > 1 ? code.value[0] : '64 64';
|
|
14064
|
+
const viewBox = attrs.viewBox || `0 0 ${scale}`;
|
|
14065
|
+
const size = () => {
|
|
14066
|
+
const addCustom = !props.size && (attrs.width || attrs.height);
|
|
14067
|
+
return props.size === 'custom' || addCustom ? 'custom-size' : props.size;
|
|
14068
|
+
};
|
|
14069
|
+
const classNames = (() => {
|
|
14070
|
+
return [props.customClassName || ['icon', { [`icon-${size()}`]: size() }], attrs.class];
|
|
14071
|
+
})();
|
|
14072
|
+
return () => props.use
|
|
14073
|
+
? h$1('svg', {
|
|
14074
|
+
...attrs,
|
|
14075
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
14076
|
+
class: classNames,
|
|
14077
|
+
role: 'img',
|
|
14078
|
+
}, h$1('use', { href: props.use }))
|
|
14079
|
+
: h$1('svg', {
|
|
14080
|
+
...attrs,
|
|
14081
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
14082
|
+
class: classNames,
|
|
14083
|
+
viewBox: viewBox,
|
|
14084
|
+
innerHTML: `${titleCode}${iconCode}`,
|
|
14085
|
+
role: 'img',
|
|
14086
|
+
});
|
|
14087
|
+
},
|
|
14088
|
+
});
|
|
14089
|
+
|
|
13833
14090
|
const CTableBody = defineComponent({
|
|
13834
14091
|
name: 'CTableBody',
|
|
13835
14092
|
props: {
|
|
@@ -14015,7 +14272,7 @@ const CTableRow = defineComponent({
|
|
|
14015
14272
|
},
|
|
14016
14273
|
});
|
|
14017
14274
|
|
|
14018
|
-
const pretifyName = (name) => {
|
|
14275
|
+
const pretifyName$1 = (name) => {
|
|
14019
14276
|
return name
|
|
14020
14277
|
.replace(/[-_.]/g, ' ')
|
|
14021
14278
|
.replace(/ +/g, ' ')
|
|
@@ -14027,8 +14284,8 @@ const pretifyName = (name) => {
|
|
|
14027
14284
|
const label = (column) => typeof column === 'object'
|
|
14028
14285
|
? column.label !== undefined
|
|
14029
14286
|
? column.label
|
|
14030
|
-
: pretifyName(column.key)
|
|
14031
|
-
: pretifyName(column);
|
|
14287
|
+
: pretifyName$1(column.key)
|
|
14288
|
+
: pretifyName$1(column);
|
|
14032
14289
|
const CTable = defineComponent({
|
|
14033
14290
|
name: 'CTable',
|
|
14034
14291
|
props: {
|
|
@@ -14318,120 +14575,244 @@ const CTablePlugin = {
|
|
|
14318
14575
|
},
|
|
14319
14576
|
};
|
|
14320
14577
|
|
|
14578
|
+
const filterColumns = (items, columnFilter, columnFilterState, itemsDataColumns) => {
|
|
14579
|
+
if (columnFilter && typeof columnFilter === 'object' && columnFilter.external) {
|
|
14580
|
+
return items;
|
|
14581
|
+
}
|
|
14582
|
+
Object.entries(columnFilterState).forEach(([key, value]) => {
|
|
14583
|
+
if (value instanceof Function) {
|
|
14584
|
+
items = items.filter((item) => value(item[key]));
|
|
14585
|
+
return;
|
|
14586
|
+
}
|
|
14587
|
+
const columnFilter = String(value).toLowerCase();
|
|
14588
|
+
if (columnFilter && itemsDataColumns.includes(key)) {
|
|
14589
|
+
items = items.filter((item) => {
|
|
14590
|
+
return String(item[key]).toLowerCase().includes(columnFilter);
|
|
14591
|
+
});
|
|
14592
|
+
}
|
|
14593
|
+
});
|
|
14594
|
+
return items;
|
|
14595
|
+
};
|
|
14596
|
+
const filterTable = (items, tableFilter, tableFilterState, itemsDataColumns) => {
|
|
14597
|
+
if (!tableFilterState ||
|
|
14598
|
+
(tableFilter && typeof tableFilter === 'object' && tableFilter.external)) {
|
|
14599
|
+
return items;
|
|
14600
|
+
}
|
|
14601
|
+
const filter = tableFilterState.toLowerCase();
|
|
14602
|
+
const valueContainFilter = (val) => String(val).toLowerCase().includes(filter);
|
|
14603
|
+
items = items.filter((item) => {
|
|
14604
|
+
return !!itemsDataColumns.find((key) => valueContainFilter(item[key]));
|
|
14605
|
+
});
|
|
14606
|
+
return items;
|
|
14607
|
+
};
|
|
14608
|
+
const getClickedColumnName = (target, columnNames) => {
|
|
14609
|
+
const closest = target.closest('tr');
|
|
14610
|
+
const children = closest ? Array.from(closest.children) : [];
|
|
14611
|
+
const clickedCell = children.filter((child) => child.contains(target))[0];
|
|
14612
|
+
return columnNames[children.indexOf(clickedCell)];
|
|
14613
|
+
};
|
|
14614
|
+
const getColumnKey = (column) => typeof column === 'object' ? column.key : column;
|
|
14615
|
+
const getColumnLabel = (column) => typeof column === 'object'
|
|
14616
|
+
? column.label !== undefined
|
|
14617
|
+
? column.label
|
|
14618
|
+
: pretifyName(column.key)
|
|
14619
|
+
: pretifyName(column);
|
|
14620
|
+
const getColumnNames = (columns, items) => columns
|
|
14621
|
+
? columns.map((column) => {
|
|
14622
|
+
if (typeof column === 'object')
|
|
14623
|
+
return column.key;
|
|
14624
|
+
else
|
|
14625
|
+
return column;
|
|
14626
|
+
})
|
|
14627
|
+
: getColumnNamesFromItems(items);
|
|
14628
|
+
const getColumnNamesFromItems = (items) => Object.keys(items[0] || {}).filter((el) => el.charAt(0) !== '_');
|
|
14629
|
+
const getColumnSorterState = (key, sorterState) => {
|
|
14630
|
+
if (sorterState && sorterState.column === key) {
|
|
14631
|
+
if (sorterState.state) {
|
|
14632
|
+
return sorterState.state;
|
|
14633
|
+
}
|
|
14634
|
+
return 0;
|
|
14635
|
+
}
|
|
14636
|
+
return 0;
|
|
14637
|
+
};
|
|
14638
|
+
const getColumnValues = (items, key) => {
|
|
14639
|
+
return items.map((item) => item[key]);
|
|
14640
|
+
};
|
|
14641
|
+
const getTableDataCellProps = (item, colName) => {
|
|
14642
|
+
const props = item._cellProps && {
|
|
14643
|
+
...(item._cellProps['all'] && { ...item._cellProps['all'] }),
|
|
14644
|
+
...(item._cellProps[colName] && { ...item._cellProps[colName] }),
|
|
14645
|
+
};
|
|
14646
|
+
return props;
|
|
14647
|
+
};
|
|
14648
|
+
const getTableHeaderCellProps = (column) => {
|
|
14649
|
+
if (typeof column === 'object' && column._props) {
|
|
14650
|
+
return column._props;
|
|
14651
|
+
}
|
|
14652
|
+
return {};
|
|
14653
|
+
};
|
|
14654
|
+
const getTableHeaderCellStyles = (column, columnSorter) => {
|
|
14655
|
+
const style = {};
|
|
14656
|
+
if (columnSorter &&
|
|
14657
|
+
(typeof column !== 'object' ||
|
|
14658
|
+
(typeof column === 'object' && (typeof column.sorter === 'undefined' || column.sorter)))) {
|
|
14659
|
+
style['cursor'] = 'pointer';
|
|
14660
|
+
}
|
|
14661
|
+
if (typeof column === 'object' && column._style) {
|
|
14662
|
+
return { ...style, ...column._style };
|
|
14663
|
+
}
|
|
14664
|
+
return style;
|
|
14665
|
+
};
|
|
14666
|
+
const isObjectInArray = (array, item, ignore = []) => array.some((_item) => {
|
|
14667
|
+
let result = true;
|
|
14668
|
+
for (const key in item) {
|
|
14669
|
+
if (!ignore.includes(key) && item[key] !== _item[key]) {
|
|
14670
|
+
result = false;
|
|
14671
|
+
break;
|
|
14672
|
+
}
|
|
14673
|
+
}
|
|
14674
|
+
return result;
|
|
14675
|
+
});
|
|
14676
|
+
const isSortable = (i, columns, columnSorter, itemsDataColumns, columnNames) => {
|
|
14677
|
+
const isDataColumn = itemsDataColumns.includes(columnNames[i]);
|
|
14678
|
+
let column;
|
|
14679
|
+
if (columns)
|
|
14680
|
+
column = columns[i];
|
|
14681
|
+
return (columnSorter &&
|
|
14682
|
+
(!columns ||
|
|
14683
|
+
typeof column !== 'object' ||
|
|
14684
|
+
(typeof column === 'object' && (typeof column.sorter === 'undefined' || column.sorter))) &&
|
|
14685
|
+
isDataColumn);
|
|
14686
|
+
};
|
|
14687
|
+
const pretifyName = (name) => {
|
|
14688
|
+
return name
|
|
14689
|
+
.replace(/[-_.]/g, ' ')
|
|
14690
|
+
.replace(/ +/g, ' ')
|
|
14691
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1 $2')
|
|
14692
|
+
.split(' ')
|
|
14693
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
14694
|
+
.join(' ');
|
|
14695
|
+
};
|
|
14696
|
+
const sortItems = (columnSorter, items, itemsDataColumns, sorterState) => {
|
|
14697
|
+
const column = sorterState.column;
|
|
14698
|
+
if (!column ||
|
|
14699
|
+
!itemsDataColumns.includes(column) ||
|
|
14700
|
+
(columnSorter && typeof columnSorter === 'object' && columnSorter.external)) {
|
|
14701
|
+
return items;
|
|
14702
|
+
}
|
|
14703
|
+
const flip = sorterState.state === 'asc' ? 1 : sorterState.state === 'desc' ? -1 : 0;
|
|
14704
|
+
const sorted = items.slice().sort((item, item2) => {
|
|
14705
|
+
const value = item[column];
|
|
14706
|
+
const value2 = item2[column];
|
|
14707
|
+
const a = typeof value === 'number' ? value : String(value).toLowerCase();
|
|
14708
|
+
const b = typeof value2 === 'number' ? value2 : String(value2).toLowerCase();
|
|
14709
|
+
return a > b ? 1 * flip : b > a ? -1 * flip : 0;
|
|
14710
|
+
});
|
|
14711
|
+
return sorted;
|
|
14712
|
+
};
|
|
14713
|
+
|
|
14321
14714
|
const CSmartTableBody = defineComponent({
|
|
14322
14715
|
name: 'CSmartTableBody',
|
|
14323
14716
|
props: {
|
|
14324
|
-
clickableRows:
|
|
14325
|
-
|
|
14326
|
-
|
|
14717
|
+
clickableRows: Boolean,
|
|
14718
|
+
columnNames: {
|
|
14719
|
+
type: Array,
|
|
14720
|
+
default: () => [],
|
|
14721
|
+
require: true,
|
|
14327
14722
|
},
|
|
14328
14723
|
currentItems: {
|
|
14329
14724
|
type: Array,
|
|
14330
14725
|
default: () => [],
|
|
14331
|
-
required: false,
|
|
14332
14726
|
},
|
|
14333
14727
|
firstItemOnActivePageIndex: {
|
|
14334
14728
|
type: Number,
|
|
14335
14729
|
require: true,
|
|
14336
14730
|
default: 0,
|
|
14337
14731
|
},
|
|
14338
|
-
|
|
14339
|
-
|
|
14340
|
-
default: undefined,
|
|
14341
|
-
require: false,
|
|
14342
|
-
},
|
|
14343
|
-
rawColumnNames: {
|
|
14344
|
-
type: Array,
|
|
14345
|
-
default: () => [],
|
|
14346
|
-
require: true,
|
|
14347
|
-
},
|
|
14348
|
-
scopedSlots: {
|
|
14349
|
-
type: Object,
|
|
14350
|
-
default: undefined,
|
|
14351
|
-
require: false,
|
|
14352
|
-
},
|
|
14732
|
+
noItemsLabel: String,
|
|
14733
|
+
scopedSlots: Object,
|
|
14353
14734
|
selectable: Boolean,
|
|
14735
|
+
selected: Array,
|
|
14354
14736
|
},
|
|
14355
14737
|
emits: ['rowChecked', 'rowClick'],
|
|
14356
14738
|
setup(props, { emit }) {
|
|
14357
|
-
const
|
|
14358
|
-
|
|
14359
|
-
|
|
14360
|
-
const handleRowChecked = (id, value) => {
|
|
14361
|
-
emit('rowChecked', id, value);
|
|
14362
|
-
};
|
|
14363
|
-
const tableDataCellProps = (item, colName) => {
|
|
14364
|
-
const props = item._cellProps && {
|
|
14365
|
-
...(item._cellProps['all'] && { ...item._cellProps['all'] }),
|
|
14366
|
-
...(item._cellProps[colName] && { ...item._cellProps[colName] }),
|
|
14367
|
-
};
|
|
14368
|
-
return props;
|
|
14369
|
-
};
|
|
14370
|
-
const getColumnName = (event) => {
|
|
14371
|
-
const target = event.target;
|
|
14372
|
-
const closest = target.closest('tr');
|
|
14373
|
-
const children = closest ? Array.from(closest.children) : [];
|
|
14374
|
-
const clickedCell = children.filter((child) => child.contains(target))[0];
|
|
14375
|
-
return props.rawColumnNames[children.indexOf(clickedCell)];
|
|
14376
|
-
};
|
|
14739
|
+
const colspan = props.selectable
|
|
14740
|
+
? props.columnNames.length + 1
|
|
14741
|
+
: props.columnNames.length;
|
|
14377
14742
|
return () => h$1(CTableBody, {
|
|
14378
14743
|
...(props.clickableRows && { style: 'cursor:pointer;' }),
|
|
14379
14744
|
}, {
|
|
14380
|
-
default: () => props.currentItems.
|
|
14381
|
-
|
|
14382
|
-
...(item._props && { ...item._props }),
|
|
14383
|
-
...(props.clickableRows && { tabindex: 0 }),
|
|
14384
|
-
onClick: (event) => handleRowClick(item, trIndex + props.firstItemOnActivePageIndex, getColumnName(event), event),
|
|
14385
|
-
}, {
|
|
14386
|
-
default: () => [
|
|
14387
|
-
props.selectable &&
|
|
14388
|
-
h$1(CTableDataCell, {}, () => h$1(CFormCheck, {
|
|
14389
|
-
checked: item._selected ? item._selected : false,
|
|
14390
|
-
onChange: (event) => handleRowChecked(item._id, event.target.checked),
|
|
14391
|
-
})),
|
|
14392
|
-
props.rawColumnNames.map((colName) => props.scopedSlots &&
|
|
14393
|
-
props.scopedSlots[colName] &&
|
|
14394
|
-
typeof props.scopedSlots[colName] === 'function'
|
|
14395
|
-
? h$1(props.scopedSlots[colName], { item: item })
|
|
14396
|
-
: h$1(CTableDataCell, {
|
|
14397
|
-
...tableDataCellProps(item, colName),
|
|
14398
|
-
}, {
|
|
14399
|
-
default: () => String(item[colName]),
|
|
14400
|
-
})),
|
|
14401
|
-
],
|
|
14402
|
-
}),
|
|
14403
|
-
props.scopedSlots &&
|
|
14404
|
-
props.scopedSlots['details'] && [
|
|
14405
|
-
h$1(CTableRow, {
|
|
14406
|
-
colspan: props.selectable
|
|
14407
|
-
? props.rawColumnNames.length + 1
|
|
14408
|
-
: props.rawColumnNames.length,
|
|
14409
|
-
class: 'p-0',
|
|
14410
|
-
style: { 'border-bottom-width': '0' },
|
|
14411
|
-
tabindex: '-1',
|
|
14412
|
-
}),
|
|
14745
|
+
default: () => props.currentItems.length
|
|
14746
|
+
? props.currentItems.map((item, trIndex) => [
|
|
14413
14747
|
h$1(CTableRow, {
|
|
14414
|
-
|
|
14415
|
-
|
|
14416
|
-
onClick: (event) =>
|
|
14748
|
+
...(item._props && { ...item._props }),
|
|
14749
|
+
...(props.clickableRows && { tabindex: 0 }),
|
|
14750
|
+
onClick: (event) => {
|
|
14751
|
+
emit('rowClick', item, trIndex + props.firstItemOnActivePageIndex, getClickedColumnName(event.target, props.columnNames), event);
|
|
14752
|
+
},
|
|
14417
14753
|
}, {
|
|
14418
|
-
default: () =>
|
|
14754
|
+
default: () => [
|
|
14755
|
+
props.selectable &&
|
|
14756
|
+
h$1(CTableDataCell, {}, () => h$1(CFormCheck, {
|
|
14757
|
+
checked: props.selected &&
|
|
14758
|
+
isObjectInArray(props.selected, item, [
|
|
14759
|
+
'_cellProps',
|
|
14760
|
+
'_props',
|
|
14761
|
+
'_selected',
|
|
14762
|
+
]),
|
|
14763
|
+
onChange: (event) => {
|
|
14764
|
+
emit('rowChecked', item, event.target.checked);
|
|
14765
|
+
},
|
|
14766
|
+
})),
|
|
14767
|
+
props.columnNames.map((colName) => props.scopedSlots &&
|
|
14768
|
+
props.scopedSlots[colName] &&
|
|
14769
|
+
typeof props.scopedSlots[colName] === 'function'
|
|
14770
|
+
? h$1(props.scopedSlots[colName], { item: item })
|
|
14771
|
+
: h$1(CTableDataCell, {
|
|
14772
|
+
...getTableDataCellProps(item, colName),
|
|
14773
|
+
}, {
|
|
14774
|
+
default: () => String(item[colName]),
|
|
14775
|
+
})),
|
|
14776
|
+
],
|
|
14777
|
+
}),
|
|
14778
|
+
props.scopedSlots &&
|
|
14779
|
+
props.scopedSlots['details'] && [
|
|
14780
|
+
h$1(CTableRow, {
|
|
14419
14781
|
colspan: props.selectable
|
|
14420
|
-
? props.
|
|
14421
|
-
: props.
|
|
14782
|
+
? props.columnNames.length + 1
|
|
14783
|
+
: props.columnNames.length,
|
|
14422
14784
|
class: 'p-0',
|
|
14423
|
-
style: { border: 0 },
|
|
14785
|
+
style: { 'border-bottom-width': '0' },
|
|
14786
|
+
tabindex: '-1',
|
|
14787
|
+
}),
|
|
14788
|
+
h$1(CTableRow, {
|
|
14789
|
+
class: 'p-0',
|
|
14790
|
+
key: `details${trIndex}`,
|
|
14791
|
+
onClick: (event) => {
|
|
14792
|
+
emit('rowClick', item, trIndex + props.firstItemOnActivePageIndex, getClickedColumnName(event.target, props.columnNames), true);
|
|
14793
|
+
},
|
|
14424
14794
|
}, {
|
|
14425
|
-
default: () =>
|
|
14426
|
-
props.
|
|
14427
|
-
|
|
14428
|
-
|
|
14429
|
-
|
|
14430
|
-
}
|
|
14795
|
+
default: () => h$1(CTableDataCell, {
|
|
14796
|
+
colspan: props.selectable
|
|
14797
|
+
? props.columnNames.length + 1
|
|
14798
|
+
: props.columnNames.length,
|
|
14799
|
+
class: 'p-0',
|
|
14800
|
+
style: { border: 0 },
|
|
14801
|
+
}, {
|
|
14802
|
+
default: () => props.scopedSlots &&
|
|
14803
|
+
props.scopedSlots['details'] &&
|
|
14804
|
+
h$1(props.scopedSlots['details'], {
|
|
14805
|
+
item: item,
|
|
14806
|
+
}),
|
|
14807
|
+
}),
|
|
14431
14808
|
}),
|
|
14809
|
+
],
|
|
14810
|
+
])
|
|
14811
|
+
: h$1(CTableRow, {}, {
|
|
14812
|
+
default: () => h$1(CTableDataCell, { colspan: colspan }, {
|
|
14813
|
+
default: () => props.noItemsLabel,
|
|
14432
14814
|
}),
|
|
14433
|
-
|
|
14434
|
-
]),
|
|
14815
|
+
}),
|
|
14435
14816
|
});
|
|
14436
14817
|
},
|
|
14437
14818
|
});
|
|
@@ -14439,140 +14820,63 @@ const CSmartTableBody = defineComponent({
|
|
|
14439
14820
|
const CSmartTableHead = defineComponent({
|
|
14440
14821
|
name: 'CSmartTableHead',
|
|
14441
14822
|
props: {
|
|
14442
|
-
|
|
14443
|
-
|
|
14444
|
-
|
|
14445
|
-
default: '',
|
|
14446
|
-
},
|
|
14447
|
-
columnFilter: {
|
|
14448
|
-
type: [Boolean, Object],
|
|
14449
|
-
require: false,
|
|
14450
|
-
},
|
|
14451
|
-
columnFilterValue: {
|
|
14452
|
-
type: Object,
|
|
14453
|
-
required: false,
|
|
14454
|
-
},
|
|
14455
|
-
columnSorter: {
|
|
14456
|
-
type: [Boolean, Object],
|
|
14457
|
-
default: undefined,
|
|
14458
|
-
require: false,
|
|
14459
|
-
},
|
|
14823
|
+
columnFilter: [Boolean, Object],
|
|
14824
|
+
columnFilterValue: Object,
|
|
14825
|
+
columnSorter: [Boolean, Object],
|
|
14460
14826
|
component: {
|
|
14461
14827
|
type: String,
|
|
14462
14828
|
default: 'head',
|
|
14463
|
-
require: false,
|
|
14464
14829
|
},
|
|
14465
14830
|
columns: {
|
|
14466
14831
|
type: Array,
|
|
14467
14832
|
default: () => [],
|
|
14468
|
-
required: false,
|
|
14469
14833
|
},
|
|
14470
14834
|
items: {
|
|
14471
14835
|
type: Array,
|
|
14472
14836
|
default: () => [],
|
|
14473
|
-
required: false,
|
|
14474
14837
|
},
|
|
14475
14838
|
selectable: Boolean,
|
|
14476
|
-
selectAll: [Boolean,
|
|
14477
|
-
|
|
14478
|
-
|
|
14479
|
-
default: undefined,
|
|
14480
|
-
require: false,
|
|
14481
|
-
},
|
|
14839
|
+
selectAll: [Boolean, Object],
|
|
14840
|
+
selectedAll: [Boolean, String],
|
|
14841
|
+
sorterState: Object,
|
|
14482
14842
|
},
|
|
14483
14843
|
emits: ['customFilterChange', 'filterInput', 'filterChange', 'selectAllChecked', 'sortClick'],
|
|
14484
14844
|
setup(props, { slots, emit }) {
|
|
14485
|
-
const handleSortClick = (key, index) => {
|
|
14486
|
-
emit('sortClick', key, index);
|
|
14487
|
-
};
|
|
14488
|
-
const tableHeaderCellProps = (column) => {
|
|
14489
|
-
if (typeof column === 'object' && column._props) {
|
|
14490
|
-
return column._props;
|
|
14491
|
-
}
|
|
14492
|
-
return {};
|
|
14493
|
-
};
|
|
14494
|
-
const tableHeaderCellStyles = (column) => {
|
|
14495
|
-
const style = { verticalAlign: 'middle', overflow: 'hidden', cursor: '' };
|
|
14496
|
-
if (props.columnSorter &&
|
|
14497
|
-
(typeof column !== 'object' ||
|
|
14498
|
-
(typeof column === 'object' && (typeof column.sorter === 'undefined' || column.sorter)))) {
|
|
14499
|
-
style.cursor = 'pointer';
|
|
14500
|
-
}
|
|
14501
|
-
if (typeof column === 'object' && column._style) {
|
|
14502
|
-
return { ...style, ...column._style };
|
|
14503
|
-
}
|
|
14504
|
-
return style;
|
|
14505
|
-
};
|
|
14506
|
-
const pretifyName = (name) => {
|
|
14507
|
-
return name
|
|
14508
|
-
.replace(/[-_.]/g, ' ')
|
|
14509
|
-
.replace(/ +/g, ' ')
|
|
14510
|
-
.replace(/([a-z0-9])([A-Z])/g, '$1 $2')
|
|
14511
|
-
.split(' ')
|
|
14512
|
-
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
14513
|
-
.join(' ');
|
|
14514
|
-
};
|
|
14515
|
-
const label = (column) => typeof column === 'object'
|
|
14516
|
-
? column.label !== undefined
|
|
14517
|
-
? column.label
|
|
14518
|
-
: pretifyName(column.key)
|
|
14519
|
-
: pretifyName(column);
|
|
14520
|
-
const key = (column) => (typeof column === 'object' ? column.key : column);
|
|
14521
|
-
const getColumnSorterState = (key) => {
|
|
14522
|
-
if (props.sorterState && props.sorterState.column === key) {
|
|
14523
|
-
if (props.sorterState.state) {
|
|
14524
|
-
return props.sorterState.state;
|
|
14525
|
-
}
|
|
14526
|
-
return 0;
|
|
14527
|
-
}
|
|
14528
|
-
return 0;
|
|
14529
|
-
};
|
|
14530
|
-
const getValues = (items, key) => {
|
|
14531
|
-
return items.map((a) => a[key]);
|
|
14532
|
-
};
|
|
14533
14845
|
const columnSorterIcon = (column) => {
|
|
14534
|
-
if (getColumnSorterState(
|
|
14846
|
+
if (getColumnSorterState(getColumnKey(column), props.sorterState) === 0) {
|
|
14535
14847
|
return h$1('span', { class: 'opacity-25 float-end me-1' }, slots.sortingIcon && slots.sortingIcon());
|
|
14536
14848
|
}
|
|
14537
|
-
if (getColumnSorterState(
|
|
14849
|
+
if (getColumnSorterState(getColumnKey(column), props.sorterState) === 'asc') {
|
|
14538
14850
|
return h$1('span', { class: 'float-end me-1' }, slots.sortingIconAscending && slots.sortingIconAscending());
|
|
14539
14851
|
}
|
|
14540
|
-
if (getColumnSorterState(
|
|
14852
|
+
if (getColumnSorterState(getColumnKey(column), props.sorterState) === 'desc') {
|
|
14541
14853
|
return h$1('span', { class: 'float-end me-1' }, slots.sortingIconDescending && slots.sortingIconDescending());
|
|
14542
14854
|
}
|
|
14543
14855
|
return;
|
|
14544
14856
|
};
|
|
14545
|
-
const handleOnCustomFilterChange = (key, value) => {
|
|
14546
|
-
emit('customFilterChange', key, value);
|
|
14547
|
-
};
|
|
14548
|
-
const handleFilterInput = (key, value) => {
|
|
14549
|
-
emit('filterInput', key, value);
|
|
14550
|
-
};
|
|
14551
|
-
const handleFilterChange = (key, value) => {
|
|
14552
|
-
emit('filterChange', key, value);
|
|
14553
|
-
};
|
|
14554
|
-
const handleSelectAllChecked = () => {
|
|
14555
|
-
emit('selectAllChecked');
|
|
14556
|
-
};
|
|
14557
14857
|
return () => h$1(props.component === 'head' ? CTableHead : CTableFoot, {}, {
|
|
14558
14858
|
default: () => [
|
|
14559
14859
|
h$1(CTableRow, {}, {
|
|
14560
14860
|
default: () => [
|
|
14561
14861
|
props.selectable &&
|
|
14562
14862
|
h$1(CTableHeaderCell, {}, () => h$1(CFormCheck, {
|
|
14563
|
-
checked: typeof props.
|
|
14564
|
-
indeterminate: props.
|
|
14565
|
-
onChange: () =>
|
|
14863
|
+
checked: typeof props.selectedAll === 'boolean' ? props.selectAll : false,
|
|
14864
|
+
indeterminate: props.selectedAll === 'indeterminate' ? true : false,
|
|
14865
|
+
onChange: () => {
|
|
14866
|
+
emit('selectAllChecked');
|
|
14867
|
+
},
|
|
14566
14868
|
})),
|
|
14567
14869
|
props.columns.map((column, index) => h$1(CTableHeaderCell, {
|
|
14568
|
-
...
|
|
14569
|
-
onClick: () =>
|
|
14570
|
-
|
|
14870
|
+
...getTableHeaderCellProps(column),
|
|
14871
|
+
onClick: () => {
|
|
14872
|
+
emit('sortClick', getColumnKey(column), index);
|
|
14873
|
+
},
|
|
14874
|
+
style: getTableHeaderCellStyles(column, props.columnSorter),
|
|
14571
14875
|
}, {
|
|
14572
14876
|
default: () => [
|
|
14573
14877
|
h$1('div', {
|
|
14574
14878
|
class: 'd-inline',
|
|
14575
|
-
},
|
|
14879
|
+
}, getColumnLabel(column)),
|
|
14576
14880
|
props.columnSorter &&
|
|
14577
14881
|
(typeof column !== 'object'
|
|
14578
14882
|
? true
|
|
@@ -14589,7 +14893,7 @@ const CSmartTableHead = defineComponent({
|
|
|
14589
14893
|
default: () => [
|
|
14590
14894
|
props.selectable && h$1(CTableHeaderCell),
|
|
14591
14895
|
props.columns.map((column) => h$1(CTableHeaderCell, {
|
|
14592
|
-
...
|
|
14896
|
+
...getTableHeaderCellProps(column),
|
|
14593
14897
|
}, {
|
|
14594
14898
|
default: () => (typeof column !== 'object'
|
|
14595
14899
|
? true
|
|
@@ -14597,15 +14901,21 @@ const CSmartTableHead = defineComponent({
|
|
|
14597
14901
|
? true
|
|
14598
14902
|
: column.filter)
|
|
14599
14903
|
? typeof column !== 'string' && typeof column.filter === 'function'
|
|
14600
|
-
? column.filter(
|
|
14904
|
+
? column.filter(getColumnValues(props.items, getColumnKey(column)), (value) => {
|
|
14905
|
+
emit('customFilterChange', getColumnKey(column), value);
|
|
14906
|
+
})
|
|
14601
14907
|
: h$1(CFormInput, {
|
|
14602
14908
|
size: 'sm',
|
|
14603
|
-
onInput: (event) =>
|
|
14604
|
-
|
|
14605
|
-
|
|
14909
|
+
onInput: (event) => {
|
|
14910
|
+
emit('filterInput', getColumnKey(column), event.target.value);
|
|
14911
|
+
},
|
|
14912
|
+
onChange: (event) => {
|
|
14913
|
+
emit('filterChange', event.target.value);
|
|
14914
|
+
},
|
|
14915
|
+
'aria-label': `column name: '${getColumnLabel(column)}' filter input`,
|
|
14606
14916
|
...(props.columnFilterValue &&
|
|
14607
|
-
props.columnFilterValue[
|
|
14608
|
-
value: props.columnFilterValue[
|
|
14917
|
+
props.columnFilterValue[getColumnKey(column)] && {
|
|
14918
|
+
value: props.columnFilterValue[getColumnKey(column)],
|
|
14609
14919
|
}),
|
|
14610
14920
|
})
|
|
14611
14921
|
: '',
|
|
@@ -14617,268 +14927,6 @@ const CSmartTableHead = defineComponent({
|
|
|
14617
14927
|
},
|
|
14618
14928
|
});
|
|
14619
14929
|
|
|
14620
|
-
const CSmartTableFilterProps = {
|
|
14621
|
-
filterLabel: {
|
|
14622
|
-
type: String,
|
|
14623
|
-
require: false,
|
|
14624
|
-
default: 'Filter:',
|
|
14625
|
-
},
|
|
14626
|
-
filterPlaceholder: {
|
|
14627
|
-
type: String,
|
|
14628
|
-
require: false,
|
|
14629
|
-
default: 'type string...',
|
|
14630
|
-
},
|
|
14631
|
-
value: {
|
|
14632
|
-
type: [String, Number],
|
|
14633
|
-
require: false,
|
|
14634
|
-
default: '',
|
|
14635
|
-
},
|
|
14636
|
-
};
|
|
14637
|
-
const CSmartTableFilter = defineComponent({
|
|
14638
|
-
name: 'CSmartTableFilter',
|
|
14639
|
-
props: CSmartTableFilterProps,
|
|
14640
|
-
emits: ['filterInput', 'filterChange'],
|
|
14641
|
-
setup(props, { emit }) {
|
|
14642
|
-
const handleFilterInput = (event) => {
|
|
14643
|
-
const target = event.target;
|
|
14644
|
-
emit('filterInput', target.value);
|
|
14645
|
-
};
|
|
14646
|
-
const handleFilterChange = (event) => {
|
|
14647
|
-
const target = event.target;
|
|
14648
|
-
emit('filterChange', target.value);
|
|
14649
|
-
};
|
|
14650
|
-
return () => h$1('div', {
|
|
14651
|
-
class: 'row mb-2',
|
|
14652
|
-
}, {
|
|
14653
|
-
default: () => [
|
|
14654
|
-
h$1(CFormLabel, {
|
|
14655
|
-
class: 'col-sm-auto col-form-label',
|
|
14656
|
-
}, {
|
|
14657
|
-
default: () => props.filterLabel,
|
|
14658
|
-
}),
|
|
14659
|
-
h$1('div', {
|
|
14660
|
-
class: 'col-sm-auto',
|
|
14661
|
-
}, h$1(CFormInput, {
|
|
14662
|
-
placeholder: props.filterPlaceholder,
|
|
14663
|
-
value: props.value,
|
|
14664
|
-
onInput: handleFilterInput,
|
|
14665
|
-
onChange: handleFilterChange,
|
|
14666
|
-
})),
|
|
14667
|
-
],
|
|
14668
|
-
});
|
|
14669
|
-
},
|
|
14670
|
-
});
|
|
14671
|
-
|
|
14672
|
-
const CSmartTableCleaner = defineComponent({
|
|
14673
|
-
name: 'CSmartTableCleaner',
|
|
14674
|
-
props: {
|
|
14675
|
-
isFiltered: {
|
|
14676
|
-
type: String,
|
|
14677
|
-
default: undefined,
|
|
14678
|
-
required: false,
|
|
14679
|
-
},
|
|
14680
|
-
},
|
|
14681
|
-
emits: ['tableCleanerClick'],
|
|
14682
|
-
setup(props, { emit, slots }) {
|
|
14683
|
-
const handleClick = () => {
|
|
14684
|
-
emit('tableCleanerClick');
|
|
14685
|
-
};
|
|
14686
|
-
return () => h$1('button', {
|
|
14687
|
-
type: 'button',
|
|
14688
|
-
class: 'btn btn-transparent',
|
|
14689
|
-
...(!props.isFiltered && { disabled: true, tabIndex: -1 }),
|
|
14690
|
-
onClick: handleClick,
|
|
14691
|
-
}, slots.cleanerIcon && slots.cleanerIcon());
|
|
14692
|
-
},
|
|
14693
|
-
});
|
|
14694
|
-
|
|
14695
|
-
const CSmartTableItemsPerPageSelector = defineComponent({
|
|
14696
|
-
name: 'CSmartTableItemsPerPageSelector',
|
|
14697
|
-
props: {
|
|
14698
|
-
itemsPerPage: {
|
|
14699
|
-
type: Number,
|
|
14700
|
-
default: undefined,
|
|
14701
|
-
require: false,
|
|
14702
|
-
},
|
|
14703
|
-
itemsPerPageLabel: {
|
|
14704
|
-
type: String,
|
|
14705
|
-
default: undefined,
|
|
14706
|
-
require: false,
|
|
14707
|
-
},
|
|
14708
|
-
itemsPerPageOptions: {
|
|
14709
|
-
type: Array,
|
|
14710
|
-
default: () => [],
|
|
14711
|
-
require: false,
|
|
14712
|
-
},
|
|
14713
|
-
},
|
|
14714
|
-
emits: ['changeItemsPerPage'],
|
|
14715
|
-
setup(props, { emit }) {
|
|
14716
|
-
const handleChange = (event) => {
|
|
14717
|
-
const target = event.target;
|
|
14718
|
-
emit('changeItemsPerPage', Number(target.value));
|
|
14719
|
-
};
|
|
14720
|
-
return () => h$1('div', {
|
|
14721
|
-
class: 'row',
|
|
14722
|
-
}, {
|
|
14723
|
-
default: () => [
|
|
14724
|
-
h$1(CFormLabel, {
|
|
14725
|
-
class: 'col-auto col-form-label',
|
|
14726
|
-
}, {
|
|
14727
|
-
default: () => props.itemsPerPageLabel,
|
|
14728
|
-
}),
|
|
14729
|
-
h$1('div', {
|
|
14730
|
-
class: 'col-auto',
|
|
14731
|
-
}, h$1(CFormSelect, {
|
|
14732
|
-
value: props.itemsPerPage,
|
|
14733
|
-
onChange: handleChange,
|
|
14734
|
-
}, {
|
|
14735
|
-
default: () => props.itemsPerPageOptions &&
|
|
14736
|
-
props.itemsPerPageOptions.map((number, index) => {
|
|
14737
|
-
return h$1('option', {
|
|
14738
|
-
value: number,
|
|
14739
|
-
key: index,
|
|
14740
|
-
}, number);
|
|
14741
|
-
}),
|
|
14742
|
-
})),
|
|
14743
|
-
],
|
|
14744
|
-
});
|
|
14745
|
-
},
|
|
14746
|
-
});
|
|
14747
|
-
|
|
14748
|
-
const CIcon = defineComponent({
|
|
14749
|
-
name: 'CIcon',
|
|
14750
|
-
props: {
|
|
14751
|
-
/**
|
|
14752
|
-
* Use `:icon="..."` instead of
|
|
14753
|
-
*
|
|
14754
|
-
* @deprecated since version 3.0
|
|
14755
|
-
*/
|
|
14756
|
-
content: {
|
|
14757
|
-
type: [String, Array],
|
|
14758
|
-
default: undefined,
|
|
14759
|
-
required: false,
|
|
14760
|
-
},
|
|
14761
|
-
/**
|
|
14762
|
-
* Use for replacing default CIcon component classes. Prop is overriding the 'size' prop.
|
|
14763
|
-
*/
|
|
14764
|
-
customClassName: {
|
|
14765
|
-
type: [String, Array, Object],
|
|
14766
|
-
default: undefined,
|
|
14767
|
-
required: false,
|
|
14768
|
-
},
|
|
14769
|
-
/**
|
|
14770
|
-
* Name of the icon placed in React object or SVG content.
|
|
14771
|
-
*/
|
|
14772
|
-
icon: {
|
|
14773
|
-
type: [String, Array],
|
|
14774
|
-
default: undefined,
|
|
14775
|
-
required: false,
|
|
14776
|
-
},
|
|
14777
|
-
/**
|
|
14778
|
-
* Use `icon="..."` instead of
|
|
14779
|
-
*
|
|
14780
|
-
* @deprecated since version 3.0
|
|
14781
|
-
*/
|
|
14782
|
-
name: {
|
|
14783
|
-
type: String,
|
|
14784
|
-
default: undefined,
|
|
14785
|
-
required: false,
|
|
14786
|
-
},
|
|
14787
|
-
/**
|
|
14788
|
-
* Size of the icon. Available sizes: 'sm', 'lg', 'xl', 'xxl', '3xl...9xl', 'custom', 'custom-size'.
|
|
14789
|
-
*/
|
|
14790
|
-
size: {
|
|
14791
|
-
type: String,
|
|
14792
|
-
default: undefined,
|
|
14793
|
-
required: false,
|
|
14794
|
-
validator: (value) => {
|
|
14795
|
-
return [
|
|
14796
|
-
'custom',
|
|
14797
|
-
'custom-size',
|
|
14798
|
-
'sm',
|
|
14799
|
-
'lg',
|
|
14800
|
-
'xl',
|
|
14801
|
-
'xxl',
|
|
14802
|
-
'3xl',
|
|
14803
|
-
'4xl',
|
|
14804
|
-
'5xl',
|
|
14805
|
-
'6xl',
|
|
14806
|
-
'7xl',
|
|
14807
|
-
'8xl',
|
|
14808
|
-
'9xl',
|
|
14809
|
-
].includes(value);
|
|
14810
|
-
},
|
|
14811
|
-
},
|
|
14812
|
-
/**
|
|
14813
|
-
* Title tag content.
|
|
14814
|
-
*/
|
|
14815
|
-
title: {
|
|
14816
|
-
type: String,
|
|
14817
|
-
default: undefined,
|
|
14818
|
-
required: false,
|
|
14819
|
-
},
|
|
14820
|
-
/**
|
|
14821
|
-
* If defined component will be rendered using 'use' tag.
|
|
14822
|
-
*/
|
|
14823
|
-
use: {
|
|
14824
|
-
type: String,
|
|
14825
|
-
default: undefined,
|
|
14826
|
-
required: false,
|
|
14827
|
-
},
|
|
14828
|
-
},
|
|
14829
|
-
setup(props, { attrs }) {
|
|
14830
|
-
const icons = inject('icons');
|
|
14831
|
-
const _icon = props.icon || props.content || props.name;
|
|
14832
|
-
const toCamelCase = (str) => {
|
|
14833
|
-
return str
|
|
14834
|
-
.replace(/([-_][a-z0-9])/gi, ($1) => {
|
|
14835
|
-
return $1.toUpperCase();
|
|
14836
|
-
})
|
|
14837
|
-
.replace(/-/gi, '');
|
|
14838
|
-
};
|
|
14839
|
-
const iconName = computed(() => _icon && typeof _icon === 'string' ? (_icon.includes('-') ? toCamelCase(_icon) : _icon) : '');
|
|
14840
|
-
const titleCode = props.title ? `<title>${props.title}</title>` : 'undefined';
|
|
14841
|
-
const code = computed(() => Array.isArray(_icon)
|
|
14842
|
-
? _icon
|
|
14843
|
-
: typeof _icon === 'string' && iconName.value && icons[iconName.value]
|
|
14844
|
-
? icons[iconName.value]
|
|
14845
|
-
: 'undefined');
|
|
14846
|
-
const iconCode = Array.isArray(code.value) ? code.value[1] || code.value[0] : code.value;
|
|
14847
|
-
const scale = Array.isArray(code.value) && code.value.length > 1 ? code.value[0] : '64 64';
|
|
14848
|
-
const viewBox = attrs.viewBox || `0 0 ${scale}`;
|
|
14849
|
-
const size = () => {
|
|
14850
|
-
const addCustom = !props.size && (attrs.width || attrs.height);
|
|
14851
|
-
return props.size === 'custom' || addCustom ? 'custom-size' : props.size;
|
|
14852
|
-
};
|
|
14853
|
-
const classNames = (() => {
|
|
14854
|
-
return [props.customClassName || ['icon', { [`icon-${size()}`]: size() }], attrs.class];
|
|
14855
|
-
})();
|
|
14856
|
-
return () => props.use
|
|
14857
|
-
? h$1('svg', {
|
|
14858
|
-
...attrs,
|
|
14859
|
-
xmlns: 'http://www.w3.org/2000/svg',
|
|
14860
|
-
class: classNames,
|
|
14861
|
-
role: 'img',
|
|
14862
|
-
}, h$1('use', { href: props.use }))
|
|
14863
|
-
: h$1('svg', {
|
|
14864
|
-
...attrs,
|
|
14865
|
-
xmlns: 'http://www.w3.org/2000/svg',
|
|
14866
|
-
class: classNames,
|
|
14867
|
-
viewBox: viewBox,
|
|
14868
|
-
innerHTML: `${titleCode}${iconCode}`,
|
|
14869
|
-
role: 'img',
|
|
14870
|
-
});
|
|
14871
|
-
},
|
|
14872
|
-
});
|
|
14873
|
-
|
|
14874
|
-
var cilArrowBottom = ["512 512", "<polygon fill='var(--ci-primary-color, currentColor)' points='367.997 338.75 271.999 434.747 271.999 17.503 239.999 17.503 239.999 434.745 144.003 338.75 121.376 361.377 256 496 390.624 361.377 367.997 338.75' class='ci-primary'/>"];
|
|
14875
|
-
|
|
14876
|
-
var cilArrowTop = ["512 512", "<polygon fill='var(--ci-primary-color, currentColor)' points='390.624 150.625 256 16 121.376 150.625 144.004 173.252 240.001 77.254 240.001 495.236 272.001 495.236 272.001 77.257 367.996 173.252 390.624 150.625' class='ci-primary'/>"];
|
|
14877
|
-
|
|
14878
|
-
var cilFilterX = ["512 512", "<polygon fill='var(--ci-primary-color, currentColor)' points='40 16 40 53.828 109.024 136 150.815 136 76.896 48 459.51 48 304 242.388 304 401.373 241.373 464 240 464 240 368 208 368 208 496 254.627 496 336 414.627 336 253.612 496 53.612 496 16 40 16' class='ci-primary'/><polygon fill='var(--ci-primary-color, currentColor)' points='166.403 248.225 226.864 187.763 204.237 165.135 143.775 225.597 83.313 165.135 60.687 187.763 121.148 248.225 60.687 308.687 83.313 331.314 143.775 270.852 204.237 331.314 226.864 308.687 166.403 248.225' class='ci-primary'/>"];
|
|
14879
|
-
|
|
14880
|
-
var cilSwapVertical = ["512 512", "<polygon fill='var(--ci-primary-color, currentColor)' points='384 433.373 384 160 352 160 352 434.51 282.177 364.687 259.55 387.313 367.432 495.196 475.313 387.313 452.687 364.687 384 433.373' class='ci-primary'/><polygon fill='var(--ci-primary-color, currentColor)' points='159.432 17.372 51.55 125.255 74.177 147.882 144 78.059 144 352 176 352 176 79.195 244.687 147.882 267.313 125.255 159.432 17.372' class='ci-primary'/>"];
|
|
14881
|
-
|
|
14882
14930
|
const CSmartTable = defineComponent({
|
|
14883
14931
|
name: 'CSmartTable',
|
|
14884
14932
|
props: {
|
|
@@ -14888,7 +14936,6 @@ const CSmartTable = defineComponent({
|
|
|
14888
14936
|
activePage: {
|
|
14889
14937
|
type: Number,
|
|
14890
14938
|
default: 1,
|
|
14891
|
-
required: false,
|
|
14892
14939
|
},
|
|
14893
14940
|
/**
|
|
14894
14941
|
* When set, displays table cleaner above table, next to the table filter (or in place of table filter if `tableFilter` prop is not set)
|
|
@@ -14897,14 +14944,12 @@ const CSmartTable = defineComponent({
|
|
|
14897
14944
|
*/
|
|
14898
14945
|
cleaner: {
|
|
14899
14946
|
type: Boolean,
|
|
14900
|
-
required: false,
|
|
14901
14947
|
},
|
|
14902
14948
|
/**
|
|
14903
14949
|
* Style table items as clickable.
|
|
14904
14950
|
*/
|
|
14905
14951
|
clickableRows: {
|
|
14906
14952
|
type: Boolean,
|
|
14907
|
-
required: false,
|
|
14908
14953
|
},
|
|
14909
14954
|
/**
|
|
14910
14955
|
* When set, displays additional filter row between table header and items, allowing filtering by specific column.
|
|
@@ -14914,7 +14959,6 @@ const CSmartTable = defineComponent({
|
|
|
14914
14959
|
*/
|
|
14915
14960
|
columnFilter: {
|
|
14916
14961
|
type: [Boolean, Object],
|
|
14917
|
-
required: false,
|
|
14918
14962
|
},
|
|
14919
14963
|
/**
|
|
14920
14964
|
* Value of table filter. To set pass object where keys are column names and values are filter strings e.g.:
|
|
@@ -14922,8 +14966,6 @@ const CSmartTable = defineComponent({
|
|
|
14922
14966
|
*/
|
|
14923
14967
|
columnFilterValue: {
|
|
14924
14968
|
type: Object,
|
|
14925
|
-
default: undefined,
|
|
14926
|
-
required: false,
|
|
14927
14969
|
},
|
|
14928
14970
|
/**
|
|
14929
14971
|
* Prop for table columns configuration. If prop is not defined, table will display columns based on the first item keys, omitting keys that begins with underscore (e.g. '_props')
|
|
@@ -14940,7 +14982,6 @@ const CSmartTable = defineComponent({
|
|
|
14940
14982
|
*/
|
|
14941
14983
|
columns: {
|
|
14942
14984
|
type: Array,
|
|
14943
|
-
required: false,
|
|
14944
14985
|
},
|
|
14945
14986
|
/**
|
|
14946
14987
|
* Enables table sorting by column value. Sorting will be performed corectly only if values in column are of one type: string (case insensitive) or number.
|
|
@@ -14951,8 +14992,6 @@ const CSmartTable = defineComponent({
|
|
|
14951
14992
|
*/
|
|
14952
14993
|
columnSorter: {
|
|
14953
14994
|
type: [Boolean, Object],
|
|
14954
|
-
default: undefined,
|
|
14955
|
-
required: false,
|
|
14956
14995
|
},
|
|
14957
14996
|
/**
|
|
14958
14997
|
* If `true` Displays table footer, which mirrors table header. (without column filter).
|
|
@@ -14965,14 +15004,12 @@ const CSmartTable = defineComponent({
|
|
|
14965
15004
|
*/
|
|
14966
15005
|
footer: {
|
|
14967
15006
|
type: [Boolean, Array],
|
|
14968
|
-
required: false,
|
|
14969
15007
|
},
|
|
14970
15008
|
/**
|
|
14971
15009
|
* Set to false to remove table header.
|
|
14972
15010
|
*/
|
|
14973
15011
|
header: {
|
|
14974
15012
|
type: Boolean,
|
|
14975
|
-
required: false,
|
|
14976
15013
|
default: true,
|
|
14977
15014
|
},
|
|
14978
15015
|
/**
|
|
@@ -14985,22 +15022,25 @@ const CSmartTable = defineComponent({
|
|
|
14985
15022
|
items: {
|
|
14986
15023
|
type: Array,
|
|
14987
15024
|
default: () => [],
|
|
14988
|
-
required: false,
|
|
14989
15025
|
},
|
|
15026
|
+
/**
|
|
15027
|
+
* The total number of items. Use if you pass a portion of data from an external source to let know component what is the total number of items.
|
|
15028
|
+
*
|
|
15029
|
+
* @since 4.8.0
|
|
15030
|
+
*/
|
|
15031
|
+
itemsNumber: Number,
|
|
14990
15032
|
/**
|
|
14991
15033
|
* Number of items per site, when pagination is enabled.
|
|
14992
15034
|
*/
|
|
14993
15035
|
itemsPerPage: {
|
|
14994
15036
|
type: Number,
|
|
14995
15037
|
default: 10,
|
|
14996
|
-
required: false,
|
|
14997
15038
|
},
|
|
14998
15039
|
/**
|
|
14999
15040
|
* Label for items per page selector.
|
|
15000
15041
|
*/
|
|
15001
15042
|
itemsPerPageLabel: {
|
|
15002
15043
|
type: String,
|
|
15003
|
-
required: false,
|
|
15004
15044
|
default: 'Items per page:',
|
|
15005
15045
|
},
|
|
15006
15046
|
/**
|
|
@@ -15009,7 +15049,6 @@ const CSmartTable = defineComponent({
|
|
|
15009
15049
|
itemsPerPageOptions: {
|
|
15010
15050
|
type: Array,
|
|
15011
15051
|
default: () => [5, 10, 20, 50],
|
|
15012
|
-
required: false,
|
|
15013
15052
|
},
|
|
15014
15053
|
/**
|
|
15015
15054
|
* Adds select element over table, which is used for control items per page in pagination. If you want to customize this element, pass object with optional values:
|
|
@@ -15019,15 +15058,12 @@ const CSmartTable = defineComponent({
|
|
|
15019
15058
|
*/
|
|
15020
15059
|
itemsPerPageSelect: {
|
|
15021
15060
|
type: [Boolean, Object],
|
|
15022
|
-
default: undefined,
|
|
15023
|
-
required: false,
|
|
15024
15061
|
},
|
|
15025
15062
|
/**
|
|
15026
15063
|
* When set, table will have loading style: loading spinner and reduced opacity. When 'small' prop is enabled spinner will be also smaller.
|
|
15027
15064
|
*/
|
|
15028
15065
|
loading: {
|
|
15029
15066
|
type: Boolean,
|
|
15030
|
-
required: false,
|
|
15031
15067
|
},
|
|
15032
15068
|
/**
|
|
15033
15069
|
* ReactNode or string for passing custom noItemsLabel texts.
|
|
@@ -15035,51 +15071,63 @@ const CSmartTable = defineComponent({
|
|
|
15035
15071
|
noItemsLabel: {
|
|
15036
15072
|
type: String,
|
|
15037
15073
|
default: 'No items found',
|
|
15038
|
-
required: false,
|
|
15039
15074
|
},
|
|
15040
15075
|
/**
|
|
15041
15076
|
* Enables default pagination. Set to true for default setup or pass an object with additional CPagination props. Default pagination will always have the computed number of pages that cannot be changed. The number of pages is generated based on the number of passed items and 'itemsPerPage' prop. If this restriction is an obstacle, you can make external CPagination instead.
|
|
15042
15077
|
*/
|
|
15043
15078
|
pagination: {
|
|
15044
15079
|
type: [Boolean, Object],
|
|
15045
|
-
required: false,
|
|
15046
15080
|
},
|
|
15047
15081
|
/**
|
|
15048
15082
|
* Properties to [CSmartPagination](https://coreui.io/vue/docs/components/smart-pagination#csmartpagination) component.
|
|
15049
15083
|
*/
|
|
15050
15084
|
paginationProps: {
|
|
15051
15085
|
type: Object,
|
|
15052
|
-
default: undefined,
|
|
15053
|
-
required: false,
|
|
15054
15086
|
},
|
|
15055
15087
|
/**
|
|
15056
15088
|
* Add checkboxes to make table rows selectable.
|
|
15057
15089
|
*/
|
|
15058
15090
|
selectable: Boolean,
|
|
15091
|
+
/**
|
|
15092
|
+
* Enables select all checkbox displayed in the header of the table.
|
|
15093
|
+
*
|
|
15094
|
+
* Can be customized, by passing prop as object with additional options as keys. Available options:
|
|
15095
|
+
* - external (Boolean) - Disables automatic selection inside the component.
|
|
15096
|
+
*
|
|
15097
|
+
* @since 4.8.0
|
|
15098
|
+
*/
|
|
15099
|
+
selectAll: {
|
|
15100
|
+
type: [Boolean, Object],
|
|
15101
|
+
},
|
|
15102
|
+
/**
|
|
15103
|
+
* Array of selected objects, where each object represents one item - row in table.
|
|
15104
|
+
*
|
|
15105
|
+
* Example item: `{ name: 'John' , age: 12 }`
|
|
15106
|
+
*
|
|
15107
|
+
* @since 4.8.0
|
|
15108
|
+
*/
|
|
15109
|
+
selected: {
|
|
15110
|
+
type: Array,
|
|
15111
|
+
default: () => [],
|
|
15112
|
+
},
|
|
15059
15113
|
/**
|
|
15060
15114
|
* State of the sorter. Name key is column name, direction can be 'asc' or 'desc'. eg.:
|
|
15061
15115
|
* { column: 'status', state: 'asc' }
|
|
15062
15116
|
*/
|
|
15063
15117
|
sorterValue: {
|
|
15064
15118
|
type: Object,
|
|
15065
|
-
default: undefined,
|
|
15066
|
-
required: false,
|
|
15067
15119
|
},
|
|
15068
15120
|
/**
|
|
15069
15121
|
* Properties to [CTableBody](https://coreui.io/vue/docs/components/table/#ctablebody) component.
|
|
15070
15122
|
*/
|
|
15071
15123
|
tableBodyProps: {
|
|
15072
15124
|
type: Object,
|
|
15073
|
-
default: undefined,
|
|
15074
|
-
required: false,
|
|
15075
15125
|
},
|
|
15076
15126
|
/**
|
|
15077
15127
|
* Properties to [CTableFoot](https://coreui.io/vue/docs/components/table/#ctablefoot) component.
|
|
15078
15128
|
*/
|
|
15079
15129
|
tableFootProps: {
|
|
15080
15130
|
type: Object,
|
|
15081
|
-
default: undefined,
|
|
15082
|
-
required: false,
|
|
15083
15131
|
},
|
|
15084
15132
|
/**
|
|
15085
15133
|
* When set, displays table filter above table, allowing filtering by specific column.
|
|
@@ -15090,7 +15138,6 @@ const CSmartTable = defineComponent({
|
|
|
15090
15138
|
*/
|
|
15091
15139
|
tableFilter: {
|
|
15092
15140
|
type: [Boolean, Object],
|
|
15093
|
-
required: false,
|
|
15094
15141
|
},
|
|
15095
15142
|
/**
|
|
15096
15143
|
* The element represents a caption for a component.
|
|
@@ -15098,7 +15145,6 @@ const CSmartTable = defineComponent({
|
|
|
15098
15145
|
tableFilterLabel: {
|
|
15099
15146
|
type: String,
|
|
15100
15147
|
default: 'Filter:',
|
|
15101
|
-
required: false,
|
|
15102
15148
|
},
|
|
15103
15149
|
/**
|
|
15104
15150
|
* Specifies a short hint that is visible in the search input.
|
|
@@ -15106,31 +15152,24 @@ const CSmartTable = defineComponent({
|
|
|
15106
15152
|
tableFilterPlaceholder: {
|
|
15107
15153
|
type: String,
|
|
15108
15154
|
default: 'type string...',
|
|
15109
|
-
required: false,
|
|
15110
15155
|
},
|
|
15111
15156
|
/**
|
|
15112
15157
|
* Value of table filter.
|
|
15113
15158
|
*/
|
|
15114
15159
|
tableFilterValue: {
|
|
15115
15160
|
type: String,
|
|
15116
|
-
default: undefined,
|
|
15117
|
-
required: false,
|
|
15118
15161
|
},
|
|
15119
15162
|
/**
|
|
15120
15163
|
* Properties to [CTableHead](https://coreui.io/vue/docs/components/table/#ctablehead) component.
|
|
15121
15164
|
*/
|
|
15122
15165
|
tableHeadProps: {
|
|
15123
15166
|
type: Object,
|
|
15124
|
-
default: undefined,
|
|
15125
|
-
required: false,
|
|
15126
15167
|
},
|
|
15127
15168
|
/**
|
|
15128
15169
|
* Properties to [CTable](https://coreui.io/vue/docs/components/table/#ctable) component.
|
|
15129
15170
|
*/
|
|
15130
15171
|
tableProps: {
|
|
15131
15172
|
type: Object,
|
|
15132
|
-
default: undefined,
|
|
15133
|
-
required: false,
|
|
15134
15173
|
},
|
|
15135
15174
|
},
|
|
15136
15175
|
emits: [
|
|
@@ -15167,6 +15206,12 @@ const CSmartTable = defineComponent({
|
|
|
15167
15206
|
* @property {event} event
|
|
15168
15207
|
*/
|
|
15169
15208
|
'rowClick',
|
|
15209
|
+
/**
|
|
15210
|
+
* Select all callback.
|
|
15211
|
+
*
|
|
15212
|
+
* @since 4.8.0
|
|
15213
|
+
*/
|
|
15214
|
+
'selectAll',
|
|
15170
15215
|
/**
|
|
15171
15216
|
* Selected items change callback.
|
|
15172
15217
|
*
|
|
@@ -15187,66 +15232,90 @@ const CSmartTable = defineComponent({
|
|
|
15187
15232
|
'tableFilterChange',
|
|
15188
15233
|
],
|
|
15189
15234
|
setup(props, { emit, slots }) {
|
|
15190
|
-
|
|
15235
|
+
const activePage = ref(props.activePage);
|
|
15236
|
+
const columnFilterState = ref(props.columnFilterValue ? props.columnFilterValue : {});
|
|
15191
15237
|
const items = ref(props.items.map((item, index) => {
|
|
15192
15238
|
return { ...item, _id: index };
|
|
15193
15239
|
}));
|
|
15240
|
+
const itemsNumber = ref(props.itemsNumber);
|
|
15241
|
+
const itemsPerPage = ref(props.itemsPerPage || items.value.length);
|
|
15242
|
+
const selected = ref([]);
|
|
15243
|
+
const selectedAll = ref();
|
|
15244
|
+
const sorterState = ref(props.sorterValue || {});
|
|
15245
|
+
const tableFilterState = ref(props.tableFilterValue ? props.tableFilterValue : '');
|
|
15246
|
+
watch(() => props.activePage, () => {
|
|
15247
|
+
activePage.value = props.activePage;
|
|
15248
|
+
});
|
|
15249
|
+
watch(() => props.columnFilterValue, () => {
|
|
15250
|
+
if (props.columnFilterValue) {
|
|
15251
|
+
columnFilterState.value = props.columnFilterValue;
|
|
15252
|
+
}
|
|
15253
|
+
});
|
|
15194
15254
|
watch(() => props.items, () => {
|
|
15195
|
-
|
|
15196
|
-
|
|
15197
|
-
});
|
|
15198
|
-
if (items.value &&
|
|
15199
|
-
items.value.length < itemsPerPage.value * activePage.value - itemsPerPage.value) {
|
|
15255
|
+
if (props.items &&
|
|
15256
|
+
props.items.length < itemsPerPage.value * activePage.value - itemsPerPage.value) {
|
|
15200
15257
|
activePage.value = 1;
|
|
15201
15258
|
}
|
|
15259
|
+
props.items.forEach((item) => {
|
|
15260
|
+
if (item._selected) {
|
|
15261
|
+
const _item = { ...item };
|
|
15262
|
+
delete _item['_cellProps'];
|
|
15263
|
+
delete _item['_props'];
|
|
15264
|
+
delete _item['_selected'];
|
|
15265
|
+
selected.value = [...selected.value, _item];
|
|
15266
|
+
}
|
|
15267
|
+
});
|
|
15268
|
+
if (Array.isArray(props.items)) {
|
|
15269
|
+
items.value = props.items;
|
|
15270
|
+
itemsNumber.value = props.itemsNumber || props.items.length;
|
|
15271
|
+
}
|
|
15202
15272
|
});
|
|
15203
|
-
|
|
15204
|
-
|
|
15205
|
-
|
|
15273
|
+
watch(() => props.itemsNumber, () => {
|
|
15274
|
+
itemsNumber.value = props.itemsNumber;
|
|
15275
|
+
});
|
|
15276
|
+
watch(() => props.itemsPerPage, () => {
|
|
15277
|
+
itemsPerPage.value = props.itemsPerPage;
|
|
15278
|
+
});
|
|
15279
|
+
watch(() => props.selected, () => {
|
|
15280
|
+
selected.value = props.selected;
|
|
15281
|
+
});
|
|
15282
|
+
watch(() => props.sorterValue, () => {
|
|
15283
|
+
if (props.sorterValue) {
|
|
15284
|
+
sorterState.value = props.sorterValue;
|
|
15285
|
+
}
|
|
15286
|
+
});
|
|
15287
|
+
watch(itemsPerPage, () => {
|
|
15288
|
+
if (props.itemsPerPage !== itemsPerPage.value) {
|
|
15289
|
+
activePage.value = 1; // TODO: set proper page after _itemsPerPage update
|
|
15290
|
+
}
|
|
15291
|
+
emit('itemsPerPageChange', itemsPerPage.value);
|
|
15292
|
+
});
|
|
15293
|
+
watch([selected, itemsNumber], () => {
|
|
15206
15294
|
emit('selectedItemsChange', selected);
|
|
15207
|
-
if (selected.length ===
|
|
15295
|
+
if (selected.value.length === itemsNumber.value) {
|
|
15208
15296
|
selectedAll.value = true;
|
|
15209
15297
|
return;
|
|
15210
15298
|
}
|
|
15211
|
-
if (selected.length === 0) {
|
|
15299
|
+
if (selected.value.length === 0) {
|
|
15212
15300
|
selectedAll.value = false;
|
|
15213
15301
|
return;
|
|
15214
15302
|
}
|
|
15215
|
-
if (selected.length !== 0 && selected.length !==
|
|
15303
|
+
if (selected.value.length !== 0 && selected.value.length !== itemsNumber.value) {
|
|
15216
15304
|
selectedAll.value = 'indeterminate';
|
|
15217
15305
|
}
|
|
15218
15306
|
});
|
|
15219
|
-
const itemsPerPage = ref(props.itemsPerPage || items.value.length);
|
|
15220
|
-
const activePage = ref(props.activePage);
|
|
15221
|
-
const sorterState = reactive(props.sorterValue || {});
|
|
15222
|
-
const columnFilterState = ref(props.columnFilterValue ? props.columnFilterValue : {});
|
|
15223
|
-
const tableFilterState = ref(props.tableFilterValue ? props.tableFilterValue : '');
|
|
15224
15307
|
onMounted(() => {
|
|
15225
15308
|
if (items.value &&
|
|
15226
15309
|
items.value.length < itemsPerPage.value * activePage.value - itemsPerPage.value) {
|
|
15227
15310
|
activePage.value = 1;
|
|
15228
15311
|
}
|
|
15229
15312
|
});
|
|
15230
|
-
|
|
15231
|
-
|
|
15232
|
-
const isSortable = (i) => {
|
|
15233
|
-
const isDataColumn = itemsDataColumns.value.includes(rawColumnNames.value[i]);
|
|
15234
|
-
let column;
|
|
15235
|
-
if (props.columns)
|
|
15236
|
-
column = props.columns[i];
|
|
15237
|
-
return (props.columnSorter &&
|
|
15238
|
-
(!props.columns ||
|
|
15239
|
-
typeof column !== 'object' ||
|
|
15240
|
-
(typeof column === 'object' &&
|
|
15241
|
-
(typeof column.sorter === 'undefined' || column.sorter))) &&
|
|
15242
|
-
isDataColumn);
|
|
15243
|
-
};
|
|
15244
|
-
const sorterChange = (column, index) => {
|
|
15245
|
-
if (!isSortable(index)) {
|
|
15313
|
+
const handleSorterChange = (column, index) => {
|
|
15314
|
+
if (!isSortable(index, props.columns, props.columnSorter, itemsDataColumns.value, columnNames.value)) {
|
|
15246
15315
|
return;
|
|
15247
15316
|
}
|
|
15248
15317
|
//if column changed or sort was descending change asc to true
|
|
15249
|
-
const state = sorterState;
|
|
15318
|
+
const state = sorterState.value;
|
|
15250
15319
|
if (state.column === column) {
|
|
15251
15320
|
if (state.state === 0) {
|
|
15252
15321
|
state.state = 'asc';
|
|
@@ -15267,40 +15336,47 @@ const CSmartTable = defineComponent({
|
|
|
15267
15336
|
state.column = column;
|
|
15268
15337
|
state.state = 'asc';
|
|
15269
15338
|
}
|
|
15270
|
-
sorterState.column = state.column;
|
|
15271
|
-
sorterState.state = state.state;
|
|
15272
|
-
emit('sorterChange', sorterState);
|
|
15339
|
+
sorterState.value.column = state.column;
|
|
15340
|
+
sorterState.value.state = state.state;
|
|
15341
|
+
emit('sorterChange', sorterState.value);
|
|
15273
15342
|
};
|
|
15274
15343
|
const handleActivePageChange = (page) => {
|
|
15275
15344
|
activePage.value = page;
|
|
15276
15345
|
emit('activePageChange', page);
|
|
15277
15346
|
};
|
|
15278
|
-
const handleItemsPerPageChange = (
|
|
15279
|
-
|
|
15280
|
-
|
|
15281
|
-
|
|
15282
|
-
|
|
15283
|
-
const handleRowChecked = (id, value) => {
|
|
15284
|
-
const newArr = [...items.value];
|
|
15285
|
-
newArr[id]._selected = value;
|
|
15286
|
-
items.value = newArr;
|
|
15347
|
+
const handleItemsPerPageChange = (event) => {
|
|
15348
|
+
if (typeof props.itemsPerPageSelect !== 'object' ||
|
|
15349
|
+
(typeof props.itemsPerPageSelect === 'object' && !props.itemsPerPageSelect.external)) {
|
|
15350
|
+
itemsPerPage.value = Number(event.target.value);
|
|
15351
|
+
}
|
|
15287
15352
|
};
|
|
15288
|
-
const
|
|
15289
|
-
|
|
15353
|
+
const handleRowChecked = (item, value) => {
|
|
15354
|
+
if (value && !isObjectInArray(selected.value, item, ['_cellProps', '_props', '_selected'])) {
|
|
15355
|
+
selected.value = [...selected.value, item];
|
|
15356
|
+
return;
|
|
15357
|
+
}
|
|
15358
|
+
selected.value = selected.value.filter((_item) => !isObjectInArray([_item], item, ['_cellProps', '_props', '_selected']));
|
|
15290
15359
|
};
|
|
15291
15360
|
const handleSelectAllChecked = () => {
|
|
15292
15361
|
if (selectedAll.value === true) {
|
|
15293
|
-
|
|
15294
|
-
|
|
15295
|
-
|
|
15362
|
+
selected.value = [];
|
|
15363
|
+
return;
|
|
15364
|
+
}
|
|
15365
|
+
emit('selectAll');
|
|
15366
|
+
if (props.selectAll && typeof props.selectAll === 'object' && props.selectAll.external) {
|
|
15296
15367
|
return;
|
|
15297
15368
|
}
|
|
15298
|
-
|
|
15299
|
-
|
|
15369
|
+
selected.value = items.value.map((item) => {
|
|
15370
|
+
delete item['_cellProps'];
|
|
15371
|
+
delete item['_props'];
|
|
15372
|
+
delete item['_selected'];
|
|
15373
|
+
return item;
|
|
15300
15374
|
});
|
|
15301
15375
|
};
|
|
15302
|
-
const
|
|
15303
|
-
const _isLazy =
|
|
15376
|
+
const handleColumnFilterChange = (colName, value, type) => {
|
|
15377
|
+
const _isLazy = props.columnFilter &&
|
|
15378
|
+
typeof props.columnFilter === 'object' &&
|
|
15379
|
+
props.columnFilter.lazy === true;
|
|
15304
15380
|
if ((_isLazy && type === 'input') || (!_isLazy && type === 'change')) {
|
|
15305
15381
|
return;
|
|
15306
15382
|
}
|
|
@@ -15308,98 +15384,32 @@ const CSmartTable = defineComponent({
|
|
|
15308
15384
|
columnFilterState.value = { ...columnFilterState.value, [`${colName}`]: value };
|
|
15309
15385
|
emit('columnFilterChange', columnFilterState.value);
|
|
15310
15386
|
};
|
|
15311
|
-
const
|
|
15312
|
-
const _isLazy =
|
|
15387
|
+
const handleTableFilterChange = (value, type) => {
|
|
15388
|
+
const _isLazy = props.columnFilter &&
|
|
15389
|
+
typeof props.columnFilter === 'object' &&
|
|
15390
|
+
props.columnFilter.lazy === true;
|
|
15313
15391
|
if ((_isLazy && type === 'input') || (!_isLazy && type === 'change')) {
|
|
15314
15392
|
return;
|
|
15315
15393
|
}
|
|
15316
15394
|
activePage.value = 1;
|
|
15317
15395
|
tableFilterState.value = value;
|
|
15318
|
-
emit('tableFilterChange', tableFilterState);
|
|
15396
|
+
emit('tableFilterChange', tableFilterState.value);
|
|
15319
15397
|
};
|
|
15320
|
-
const
|
|
15398
|
+
const handleClean = () => {
|
|
15321
15399
|
tableFilterState.value = '';
|
|
15322
15400
|
columnFilterState.value = {};
|
|
15323
|
-
sorterState.
|
|
15324
|
-
sorterState.state = '';
|
|
15401
|
+
sorterState.value = {};
|
|
15325
15402
|
};
|
|
15326
|
-
|
|
15327
|
-
const
|
|
15328
|
-
const
|
|
15329
|
-
|
|
15330
|
-
|
|
15331
|
-
return column.key;
|
|
15332
|
-
else
|
|
15333
|
-
return column;
|
|
15334
|
-
})
|
|
15335
|
-
: genCols.value); //! || el
|
|
15336
|
-
const itemsDataColumns = computed(() => rawColumnNames.value.filter((name) => genCols.value.includes(name)));
|
|
15337
|
-
// variables
|
|
15338
|
-
const filteredColumns = computed(() => {
|
|
15339
|
-
let _items = items.value;
|
|
15340
|
-
if (props.columnFilter &&
|
|
15341
|
-
typeof props.columnFilter === 'object' &&
|
|
15342
|
-
props.columnFilter.external) {
|
|
15343
|
-
return _items;
|
|
15344
|
-
}
|
|
15345
|
-
Object.entries(columnFilterState.value).forEach(([key, value]) => {
|
|
15346
|
-
if (value instanceof Function) {
|
|
15347
|
-
_items = _items.filter((item) => value(item[key]));
|
|
15348
|
-
return;
|
|
15349
|
-
}
|
|
15350
|
-
const columnFilter = String(value).toLowerCase();
|
|
15351
|
-
if (columnFilter && itemsDataColumns.value.includes(key)) {
|
|
15352
|
-
_items = _items.filter((item) => {
|
|
15353
|
-
return String(item[key]).toLowerCase().includes(columnFilter);
|
|
15354
|
-
});
|
|
15355
|
-
}
|
|
15356
|
-
});
|
|
15357
|
-
return _items;
|
|
15358
|
-
});
|
|
15359
|
-
const filteredTable = computed(() => {
|
|
15360
|
-
let items = filteredColumns.value;
|
|
15361
|
-
if (!tableFilterState.value ||
|
|
15362
|
-
(props.tableFilter && typeof props.tableFilter === 'object' && props.tableFilter.external)) {
|
|
15363
|
-
return items;
|
|
15364
|
-
}
|
|
15365
|
-
const filter = tableFilterState.value.toLowerCase();
|
|
15366
|
-
const valueContainFilter = (val) => String(val).toLowerCase().includes(filter);
|
|
15367
|
-
items = items.filter((item) => {
|
|
15368
|
-
return !!itemsDataColumns.value.find((key) => valueContainFilter(item[key]));
|
|
15369
|
-
});
|
|
15370
|
-
emit('filteredItemsChange', items);
|
|
15371
|
-
return items;
|
|
15372
|
-
});
|
|
15373
|
-
const sortedItems = computed(() => {
|
|
15374
|
-
const col = sorterState.column;
|
|
15375
|
-
if (!col ||
|
|
15376
|
-
!itemsDataColumns.value.includes(col) ||
|
|
15377
|
-
(props.columnSorter &&
|
|
15378
|
-
typeof props.columnSorter === 'object' &&
|
|
15379
|
-
props.columnSorter.external)) {
|
|
15380
|
-
return filteredTable.value;
|
|
15381
|
-
}
|
|
15382
|
-
//if values in column are to be sorted by numeric value they all have to be type number
|
|
15383
|
-
// const flip = sorterState.asc ? 1 : -1
|
|
15384
|
-
const flip = sorterState.state === 'asc' ? 1 : sorterState.state === 'desc' ? -1 : 0;
|
|
15385
|
-
const sorted = filteredTable.value.slice().sort((item, item2) => {
|
|
15386
|
-
const value = item[col];
|
|
15387
|
-
const value2 = item2[col];
|
|
15388
|
-
const a = typeof value === 'number' ? value : String(value).toLowerCase();
|
|
15389
|
-
const b = typeof value2 === 'number' ? value2 : String(value2).toLowerCase();
|
|
15390
|
-
return a > b ? 1 * flip : b > a ? -1 * flip : 0;
|
|
15391
|
-
});
|
|
15392
|
-
return sorted;
|
|
15393
|
-
});
|
|
15403
|
+
const columnNames = computed(() => getColumnNames(props.columns, items.value));
|
|
15404
|
+
const itemsDataColumns = computed(() => columnNames.value.filter((name) => getColumnNamesFromItems(items.value).includes(name)));
|
|
15405
|
+
const filteredColumns = computed(() => filterColumns(items.value, props.columnFilter, columnFilterState.value, itemsDataColumns.value));
|
|
15406
|
+
const filteredTable = computed(() => filterTable(filteredColumns.value, props.tableFilter, tableFilterState.value, itemsDataColumns.value));
|
|
15407
|
+
const sortedItems = computed(() => sortItems(props.columnSorter, filteredTable.value, itemsDataColumns.value, sorterState.value));
|
|
15394
15408
|
const numberOfPages = computed(() => itemsPerPage.value ? Math.ceil(sortedItems.value.length / itemsPerPage.value) : 1);
|
|
15395
15409
|
const firstItemOnActivePageIndex = computed(() => activePage.value ? (activePage.value - 1) * itemsPerPage.value : 0);
|
|
15396
|
-
const
|
|
15397
|
-
|
|
15398
|
-
|
|
15399
|
-
return (tableFilterState.value ||
|
|
15400
|
-
sorterState.column ||
|
|
15401
|
-
Object.values(columnFilterState.value).join(''));
|
|
15402
|
-
});
|
|
15410
|
+
const currentItems = computed(() => activePage.value
|
|
15411
|
+
? sortedItems.value.slice(firstItemOnActivePageIndex.value, firstItemOnActivePageIndex.value + itemsPerPage.value)
|
|
15412
|
+
: sortedItems.value);
|
|
15403
15413
|
return () => h$1('div', {}, [
|
|
15404
15414
|
(props.tableFilter || props.cleaner) &&
|
|
15405
15415
|
h$1('div', {
|
|
@@ -15409,25 +15419,46 @@ const CSmartTable = defineComponent({
|
|
|
15409
15419
|
h$1('div', {
|
|
15410
15420
|
class: 'col-auto p-0',
|
|
15411
15421
|
}, props.tableFilter &&
|
|
15412
|
-
h$1(
|
|
15413
|
-
|
|
15414
|
-
|
|
15415
|
-
|
|
15416
|
-
|
|
15417
|
-
|
|
15422
|
+
h$1('div', {
|
|
15423
|
+
class: 'row mb-2',
|
|
15424
|
+
}, {
|
|
15425
|
+
default: () => [
|
|
15426
|
+
h$1(CFormLabel, {
|
|
15427
|
+
class: 'col-sm-auto col-form-label',
|
|
15428
|
+
}, {
|
|
15429
|
+
default: () => props.tableFilterLabel,
|
|
15430
|
+
}),
|
|
15431
|
+
h$1('div', {
|
|
15432
|
+
class: 'col-sm-auto',
|
|
15433
|
+
}, h$1(CFormInput, {
|
|
15434
|
+
onInput: (e) => {
|
|
15435
|
+
handleTableFilterChange(e.target.value, 'input');
|
|
15436
|
+
},
|
|
15437
|
+
onChange: (e) => {
|
|
15438
|
+
handleTableFilterChange(e.target.value, 'change');
|
|
15439
|
+
},
|
|
15440
|
+
placeholder: props.tableFilterPlaceholder,
|
|
15441
|
+
value: tableFilterState.value,
|
|
15442
|
+
})),
|
|
15443
|
+
],
|
|
15418
15444
|
})),
|
|
15419
15445
|
props.cleaner &&
|
|
15420
15446
|
h$1('div', {
|
|
15421
15447
|
class: 'col-auto p-0',
|
|
15422
|
-
}, h$1(
|
|
15423
|
-
|
|
15424
|
-
|
|
15425
|
-
|
|
15426
|
-
|
|
15427
|
-
|
|
15428
|
-
|
|
15429
|
-
|
|
15430
|
-
|
|
15448
|
+
}, h$1('button', {
|
|
15449
|
+
type: 'button',
|
|
15450
|
+
class: 'btn btn-transparent',
|
|
15451
|
+
...(!(tableFilterState.value ||
|
|
15452
|
+
sorterState.value.column ||
|
|
15453
|
+
Object.values(columnFilterState.value).join('')) && { disabled: true, tabIndex: -1 }),
|
|
15454
|
+
onClick: () => handleClean(),
|
|
15455
|
+
onKeydown: (event) => {
|
|
15456
|
+
if (event.key === 'Enter')
|
|
15457
|
+
handleClean();
|
|
15458
|
+
},
|
|
15459
|
+
}, slots.cleanerIcon
|
|
15460
|
+
? slots.cleanerIcon()
|
|
15461
|
+
: h$1(CIcon, { width: '18', content: cilFilterX }))),
|
|
15431
15462
|
]),
|
|
15432
15463
|
h$1('div', {
|
|
15433
15464
|
class: 'position-relative',
|
|
@@ -15443,17 +15474,18 @@ const CSmartTable = defineComponent({
|
|
|
15443
15474
|
...props.tableHeadProps,
|
|
15444
15475
|
columnFilter: props.columnFilter,
|
|
15445
15476
|
columnFilterValue: columnFilterState.value,
|
|
15446
|
-
columns: props.columns ? props.columns :
|
|
15477
|
+
columns: props.columns ? props.columns : columnNames.value,
|
|
15447
15478
|
columnSorter: props.columnSorter,
|
|
15448
15479
|
items: items.value,
|
|
15449
15480
|
selectable: props.selectable,
|
|
15450
|
-
selectAll:
|
|
15451
|
-
|
|
15452
|
-
|
|
15453
|
-
|
|
15454
|
-
|
|
15481
|
+
selectAll: props.selectAll,
|
|
15482
|
+
selectedAll: selectedAll.value,
|
|
15483
|
+
sorterState: sorterState.value,
|
|
15484
|
+
onCustomFilterChange: (key, value) => handleColumnFilterChange(key, value),
|
|
15485
|
+
onFilterInput: (key, value) => handleColumnFilterChange(key, value, 'input'),
|
|
15486
|
+
onFilterChange: (key, value) => handleColumnFilterChange(key, value, 'change'),
|
|
15455
15487
|
onSelectAllChecked: () => handleSelectAllChecked(),
|
|
15456
|
-
onSortClick: (key, index) =>
|
|
15488
|
+
onSortClick: (key, index) => handleSorterChange(key, index),
|
|
15457
15489
|
}, {
|
|
15458
15490
|
// @slot Sorter icon when items are unsorted.
|
|
15459
15491
|
sortingIcon: () => slots.sortingIcon
|
|
@@ -15468,36 +15500,35 @@ const CSmartTable = defineComponent({
|
|
|
15468
15500
|
// @slot Sorter icon when items are sorted ascending.
|
|
15469
15501
|
sortingIconAscending: () => slots.sortingIconAscending
|
|
15470
15502
|
? slots.sortingIconAscending()
|
|
15471
|
-
:
|
|
15472
|
-
|
|
15473
|
-
|
|
15474
|
-
|
|
15475
|
-
|
|
15476
|
-
|
|
15477
|
-
|
|
15478
|
-
}),
|
|
15503
|
+
: h$1('svg', {
|
|
15504
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
15505
|
+
class: 'icon',
|
|
15506
|
+
viewBox: '0 0 512 512',
|
|
15507
|
+
role: 'img',
|
|
15508
|
+
innerHTML: cilArrowBottom[1],
|
|
15509
|
+
}),
|
|
15479
15510
|
// @slot Sorter icon when items are sorted descending.
|
|
15480
15511
|
sortingIconDescending: () => slots.sortingIconDescending
|
|
15481
15512
|
? slots.sortingIconDescending()
|
|
15482
|
-
:
|
|
15483
|
-
|
|
15484
|
-
|
|
15485
|
-
|
|
15486
|
-
|
|
15487
|
-
|
|
15488
|
-
|
|
15489
|
-
}),
|
|
15513
|
+
: h$1('svg', {
|
|
15514
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
15515
|
+
class: 'icon',
|
|
15516
|
+
viewBox: '0 0 512 512',
|
|
15517
|
+
role: 'img',
|
|
15518
|
+
innerHTML: cilArrowTop[1],
|
|
15519
|
+
}),
|
|
15490
15520
|
}),
|
|
15491
15521
|
h$1(CSmartTableBody, {
|
|
15522
|
+
clickableRows: props.clickableRows,
|
|
15523
|
+
columnNames: columnNames.value,
|
|
15492
15524
|
currentItems: currentItems.value,
|
|
15493
15525
|
firstItemOnActivePageIndex: firstItemOnActivePageIndex.value,
|
|
15494
15526
|
noItemsLabel: props.noItemsLabel,
|
|
15527
|
+
onRowChecked: (item, value) => handleRowChecked(item, value),
|
|
15528
|
+
onRowClick: (item, index, columnName, event) => props.clickableRows && emit('rowClick', item, index, columnName, event),
|
|
15495
15529
|
scopedSlots: slots,
|
|
15496
15530
|
selectable: props.selectable,
|
|
15497
|
-
|
|
15498
|
-
onRowClick: (item, index, columnName, event) => handleRowClick(item, index, columnName, event),
|
|
15499
|
-
rawColumnNames: rawColumnNames.value,
|
|
15500
|
-
clickableRows: props.clickableRows,
|
|
15531
|
+
selected: selected.value,
|
|
15501
15532
|
...props.tableBodyProps,
|
|
15502
15533
|
}),
|
|
15503
15534
|
typeof props.footer === 'boolean' &&
|
|
@@ -15507,9 +15538,10 @@ const CSmartTable = defineComponent({
|
|
|
15507
15538
|
...props.tableFootProps,
|
|
15508
15539
|
columnFilter: false,
|
|
15509
15540
|
columnSorter: false,
|
|
15510
|
-
columns: props.columns ? props.columns :
|
|
15541
|
+
columns: props.columns ? props.columns : columnNames.value,
|
|
15511
15542
|
selectable: props.selectable,
|
|
15512
|
-
selectAll:
|
|
15543
|
+
selectAll: props.selectAll,
|
|
15544
|
+
selectedAll: selectedAll.value,
|
|
15513
15545
|
onSelectAllChecked: () => handleSelectAllChecked(),
|
|
15514
15546
|
}),
|
|
15515
15547
|
Array.isArray(props.footer) &&
|
|
@@ -15536,6 +15568,11 @@ const CSmartTable = defineComponent({
|
|
|
15536
15568
|
{ sides: ['top'], query: 'tbody' },
|
|
15537
15569
|
{ sides: ['bottom'], query: 'tbody' },
|
|
15538
15570
|
],
|
|
15571
|
+
}, {
|
|
15572
|
+
// @slot elementCover.
|
|
15573
|
+
...(slots.elementCover && {
|
|
15574
|
+
default: () => slots.elementCover && slots.elementCover(),
|
|
15575
|
+
}),
|
|
15539
15576
|
}),
|
|
15540
15577
|
],
|
|
15541
15578
|
}),
|
|
@@ -15558,14 +15595,33 @@ const CSmartTable = defineComponent({
|
|
|
15558
15595
|
h$1('div', {
|
|
15559
15596
|
class: 'col-auto ms-auto',
|
|
15560
15597
|
}, props.itemsPerPageSelect &&
|
|
15561
|
-
h$1(
|
|
15562
|
-
|
|
15563
|
-
|
|
15564
|
-
|
|
15565
|
-
|
|
15598
|
+
h$1('div', {
|
|
15599
|
+
class: 'row',
|
|
15600
|
+
}, {
|
|
15601
|
+
default: () => [
|
|
15602
|
+
h$1(CFormLabel, {
|
|
15603
|
+
class: 'col-auto col-form-label',
|
|
15604
|
+
}, {
|
|
15605
|
+
default: () => props.itemsPerPageLabel,
|
|
15606
|
+
}),
|
|
15607
|
+
h$1('div', {
|
|
15608
|
+
class: 'col-auto',
|
|
15609
|
+
}, h$1(CFormSelect, {
|
|
15610
|
+
value: itemsPerPage.value,
|
|
15611
|
+
onChange: handleItemsPerPageChange,
|
|
15612
|
+
}, {
|
|
15613
|
+
default: () => props.itemsPerPageOptions &&
|
|
15614
|
+
props.itemsPerPageOptions.map((number, index) => {
|
|
15615
|
+
return h$1('option', {
|
|
15616
|
+
value: number,
|
|
15617
|
+
key: index,
|
|
15618
|
+
}, number);
|
|
15619
|
+
}),
|
|
15620
|
+
})),
|
|
15621
|
+
],
|
|
15566
15622
|
})),
|
|
15567
15623
|
]),
|
|
15568
|
-
]);
|
|
15624
|
+
]);
|
|
15569
15625
|
},
|
|
15570
15626
|
});
|
|
15571
15627
|
|
|
@@ -16725,6 +16781,8 @@ var Components = /*#__PURE__*/Object.freeze({
|
|
|
16725
16781
|
CToaster: CToaster,
|
|
16726
16782
|
CTooltip: CTooltip,
|
|
16727
16783
|
CTooltipPlugin: CTooltipPlugin,
|
|
16784
|
+
CVirtualScroller: CVirtualScroller,
|
|
16785
|
+
CVirtualScrollerPlugin: CVirtualScrollerPlugin,
|
|
16728
16786
|
CWidgetStatsA: CWidgetStatsA,
|
|
16729
16787
|
CWidgetStatsB: CWidgetStatsB,
|
|
16730
16788
|
CWidgetStatsC: CWidgetStatsC,
|
|
@@ -16963,5 +17021,5 @@ const CoreuiVue = {
|
|
|
16963
17021
|
},
|
|
16964
17022
|
};
|
|
16965
17023
|
|
|
16966
|
-
export { CAccordion, CAccordionBody, CAccordionButton, CAccordionHeader, CAccordionItem, CAccordionPlugin, CAlert, CAlertHeading, CAlertLink, CAlertPlugin, CAvatar, CAvatarPlugin, CBackdrop, CBackdropPlugin, CBadge, CBadgePlugin, CBreadcrumb, CBreadcrumbItem, CBreadcrumbPlugin, CButton, CButtonGroup, CButtonGroupPlugin, CButtonPlugin, CButtonToolbar, CCLinkPlugin, CCalendar, CCalendarPlugin, CCallout, CCalloutPlugin, CCard, CCardBody, CCardFooter, CCardGroup, CCardHeader, CCardImage, CCardImageOverlay, CCardLink, CCardPlugin, CCardSubtitle, CCardText, CCardTitle, CCarousel, CCarouselCaption, CCarouselItem, CCarouselPlugin, CCloseButton, CCloseButtonPlugin, CCol, CCollapse, CCollapsePlugin, CContainer, CDatePicker, CDatePickerPlugin, CDateRangePicker, CDateRangePickerPlugin, CDropdown, CDropdownDivider, CDropdownHeader, CDropdownItem, CDropdownMenu, CDropdownPlugin, CDropdownToggle, CElementCover, CElementCoverPlugin, CFooter, CFooterPlugin, CForm, CFormCheck, CFormFeedback, CFormFloating, CFormInput, CFormLabel, CFormPlugin, CFormRange, CFormSelect, CFormSwitch, CFormText, CFormTextarea, CGridPlugin, CHeader, CHeaderBrand, CHeaderDivider, CHeaderNav, CHeaderPlugin, CHeaderText, CHeaderToggler, CImage, CImagePlugin, CInputGroup, CInputGroupText, CLink, CListGroup, CListGroupItem, CListGroupPlugin, CLoadingButton, CLoadingButtonPlugin, CModal, CModalBody, CModalFooter, CModalHeader, CModalPlugin, CModalTitle, CMultiSelect, CMultiSelectPlugin, CNav, CNavGroup, CNavGroupItems, CNavItem, CNavLink, CNavPlugin, CNavTitle, CNavbar, CNavbarBrand, CNavbarNav, CNavbarPlugin, CNavbarText, CNavbarToggler, COffcanvas, COffcanvasBody, COffcanvasHeader, COffcanvasPlugin, COffcanvasTitle, CPagination, CPaginationItem, CPaginationPlugin, CPicker, CPickerPlugin, CPlaceholder, CPlaceholderPlugin, CPopover, CPopoverPlugin, CProgress, CProgressBar, CProgressPlugin, CRow, CSidebar, CSidebarBrand, CSidebarFooter, CSidebarHeader, CSidebarNav, CSidebarPlugin, CSidebarToggler, CSmartPagination, CSmartPaginationPlugin, CSmartTable, CSmartTablePlugin, CSpinner, CSpinnerPlugin, CTabContent, CTabPane, CTable, CTableBody, CTableCaption, CTableDataCell, CTableFoot, CTableHead, CTableHeaderCell, CTablePlugin, CTableRow, CTabsPlugin, CTimePicker, CTimePickerPlugin, CToast, CToastBody, CToastClose, CToastHeader, CToastPlugin, CToaster, CTooltip, CTooltipPlugin, CWidgetStatsA, CWidgetStatsB, CWidgetStatsC, CWidgetStatsD, CWidgetStatsE, CWidgetStatsF, CWidgetsStatsPlugin, CoreuiVue as default, vcplaceholder, vcpopover, vctooltip };
|
|
17024
|
+
export { CAccordion, CAccordionBody, CAccordionButton, CAccordionHeader, CAccordionItem, CAccordionPlugin, CAlert, CAlertHeading, CAlertLink, CAlertPlugin, CAvatar, CAvatarPlugin, CBackdrop, CBackdropPlugin, CBadge, CBadgePlugin, CBreadcrumb, CBreadcrumbItem, CBreadcrumbPlugin, CButton, CButtonGroup, CButtonGroupPlugin, CButtonPlugin, CButtonToolbar, CCLinkPlugin, CCalendar, CCalendarPlugin, CCallout, CCalloutPlugin, CCard, CCardBody, CCardFooter, CCardGroup, CCardHeader, CCardImage, CCardImageOverlay, CCardLink, CCardPlugin, CCardSubtitle, CCardText, CCardTitle, CCarousel, CCarouselCaption, CCarouselItem, CCarouselPlugin, CCloseButton, CCloseButtonPlugin, CCol, CCollapse, CCollapsePlugin, CContainer, CDatePicker, CDatePickerPlugin, CDateRangePicker, CDateRangePickerPlugin, CDropdown, CDropdownDivider, CDropdownHeader, CDropdownItem, CDropdownMenu, CDropdownPlugin, CDropdownToggle, CElementCover, CElementCoverPlugin, CFooter, CFooterPlugin, CForm, CFormCheck, CFormFeedback, CFormFloating, CFormInput, CFormLabel, CFormPlugin, CFormRange, CFormSelect, CFormSwitch, CFormText, CFormTextarea, CGridPlugin, CHeader, CHeaderBrand, CHeaderDivider, CHeaderNav, CHeaderPlugin, CHeaderText, CHeaderToggler, CImage, CImagePlugin, CInputGroup, CInputGroupText, CLink, CListGroup, CListGroupItem, CListGroupPlugin, CLoadingButton, CLoadingButtonPlugin, CModal, CModalBody, CModalFooter, CModalHeader, CModalPlugin, CModalTitle, CMultiSelect, CMultiSelectPlugin, CNav, CNavGroup, CNavGroupItems, CNavItem, CNavLink, CNavPlugin, CNavTitle, CNavbar, CNavbarBrand, CNavbarNav, CNavbarPlugin, CNavbarText, CNavbarToggler, COffcanvas, COffcanvasBody, COffcanvasHeader, COffcanvasPlugin, COffcanvasTitle, CPagination, CPaginationItem, CPaginationPlugin, CPicker, CPickerPlugin, CPlaceholder, CPlaceholderPlugin, CPopover, CPopoverPlugin, CProgress, CProgressBar, CProgressPlugin, CRow, CSidebar, CSidebarBrand, CSidebarFooter, CSidebarHeader, CSidebarNav, CSidebarPlugin, CSidebarToggler, CSmartPagination, CSmartPaginationPlugin, CSmartTable, CSmartTablePlugin, CSpinner, CSpinnerPlugin, CTabContent, CTabPane, CTable, CTableBody, CTableCaption, CTableDataCell, CTableFoot, CTableHead, CTableHeaderCell, CTablePlugin, CTableRow, CTabsPlugin, CTimePicker, CTimePickerPlugin, CToast, CToastBody, CToastClose, CToastHeader, CToastPlugin, CToaster, CTooltip, CTooltipPlugin, CVirtualScroller, CVirtualScrollerPlugin, CWidgetStatsA, CWidgetStatsB, CWidgetStatsC, CWidgetStatsD, CWidgetStatsE, CWidgetStatsF, CWidgetsStatsPlugin, CoreuiVue as default, vcplaceholder, vcpopover, vctooltip };
|
|
16967
17025
|
//# sourceMappingURL=index.es.js.map
|