@coreui/vue-pro 4.7.0 → 4.8.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/calendar/utils.d.ts +23 -0
- package/dist/components/modal/CModal.d.ts +4 -20
- 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/index.es.js +752 -793
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +752 -793
- package/dist/index.js.map +1 -1
- 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/modal/CModal.ts +10 -10
- package/src/components/multi-select/CMultiSelect.ts +0 -10
- 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/dist/index.js
CHANGED
|
@@ -8719,38 +8719,34 @@ const getAmPm = (date, locale) => {
|
|
|
8719
8719
|
}
|
|
8720
8720
|
return date.getHours() >= 12 ? 'pm' : 'am';
|
|
8721
8721
|
};
|
|
8722
|
-
const
|
|
8723
|
-
|
|
8724
|
-
|
|
8725
|
-
|
|
8726
|
-
|
|
8727
|
-
|
|
8728
|
-
|
|
8729
|
-
|
|
8730
|
-
|
|
8731
|
-
|
|
8732
|
-
|
|
8733
|
-
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
|
|
8738
|
-
|
|
8739
|
-
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
d.setSeconds(i);
|
|
8722
|
+
const getLocalizedTimePartials = (locale, ampm = 'auto') => {
|
|
8723
|
+
const date = new Date();
|
|
8724
|
+
const hour12 = ['am', 'AM', 'pm', 'PM'].some((el) => date.toLocaleString(locale).includes(el));
|
|
8725
|
+
const listOfHours = Array.from({ length: (ampm === 'auto' && hour12) || ampm === true ? 12 : 24 }, (_, i) => {
|
|
8726
|
+
return {
|
|
8727
|
+
value: (ampm === 'auto' && hour12) || ampm === true ? i + 1 : i,
|
|
8728
|
+
label: ((ampm === 'auto' && hour12) || ampm === true ? i + 1 : i).toLocaleString(locale),
|
|
8729
|
+
};
|
|
8730
|
+
});
|
|
8731
|
+
const listOfMinutesSeconds = Array.from({ length: 60 }, (_, i) => {
|
|
8732
|
+
date.setMinutes(i);
|
|
8733
|
+
return {
|
|
8734
|
+
value: i,
|
|
8735
|
+
label: date
|
|
8736
|
+
.toLocaleTimeString(locale, {
|
|
8737
|
+
minute: '2-digit',
|
|
8738
|
+
second: '2-digit',
|
|
8739
|
+
})
|
|
8740
|
+
.split(/[^A-Za-z0-9\u06F0-\u06F90-9]/)[0],
|
|
8741
|
+
};
|
|
8742
|
+
});
|
|
8744
8743
|
return {
|
|
8745
|
-
|
|
8746
|
-
|
|
8747
|
-
|
|
8748
|
-
|
|
8749
|
-
second: '2-digit',
|
|
8750
|
-
})
|
|
8751
|
-
.split(/[^A-Za-z0-9]/)[1],
|
|
8744
|
+
listOfHours,
|
|
8745
|
+
listOfMinutes: listOfMinutesSeconds,
|
|
8746
|
+
listOfSeconds: listOfMinutesSeconds,
|
|
8747
|
+
hour12,
|
|
8752
8748
|
};
|
|
8753
|
-
}
|
|
8749
|
+
};
|
|
8754
8750
|
const getSelectedHour = (date, locale, ampm = 'auto') => date
|
|
8755
8751
|
? (ampm === 'auto' && isAmPm(locale)) || ampm === true
|
|
8756
8752
|
? convert24hTo12h(date.getHours())
|
|
@@ -9024,14 +9020,21 @@ const CTimePicker = vue.defineComponent({
|
|
|
9024
9020
|
'update:time',
|
|
9025
9021
|
],
|
|
9026
9022
|
setup(props, { emit, attrs, slots }) {
|
|
9027
|
-
const visible = vue.ref(props.visible);
|
|
9028
9023
|
const date = vue.ref(convertTimeToDate(props.time));
|
|
9029
|
-
const initialDate = vue.ref(null);
|
|
9030
9024
|
const ampm = vue.ref(date.value ? getAmPm(new Date(date.value), props.locale) : 'am');
|
|
9025
|
+
const initialDate = vue.ref(null);
|
|
9026
|
+
const visible = vue.ref(props.visible);
|
|
9027
|
+
const localizedTimePartials = vue.ref({
|
|
9028
|
+
listOfHours: [],
|
|
9029
|
+
listOfMinutes: [],
|
|
9030
|
+
listOfSeconds: [],
|
|
9031
|
+
hour12: false,
|
|
9032
|
+
});
|
|
9031
9033
|
vue.watch(() => props.time, () => {
|
|
9032
9034
|
date.value = convertTimeToDate(props.time);
|
|
9033
9035
|
});
|
|
9034
9036
|
vue.watch(date, () => {
|
|
9037
|
+
localizedTimePartials.value = getLocalizedTimePartials(props.locale, props.ampm);
|
|
9035
9038
|
if (date.value) {
|
|
9036
9039
|
ampm.value = getAmPm(new Date(date.value), props.locale);
|
|
9037
9040
|
}
|
|
@@ -9053,7 +9056,7 @@ const CTimePicker = vue.defineComponent({
|
|
|
9053
9056
|
}
|
|
9054
9057
|
}
|
|
9055
9058
|
if (set === 'hours') {
|
|
9056
|
-
if (
|
|
9059
|
+
if (localizedTimePartials.value && localizedTimePartials.value.hour12) {
|
|
9057
9060
|
_date.setHours(convert12hTo24h(ampm.value, parseInt(value)));
|
|
9058
9061
|
}
|
|
9059
9062
|
else {
|
|
@@ -9083,8 +9086,7 @@ const CTimePicker = vue.defineComponent({
|
|
|
9083
9086
|
readonly: props.inputReadOnly,
|
|
9084
9087
|
value: date.value
|
|
9085
9088
|
? date.value.toLocaleTimeString(props.locale, {
|
|
9086
|
-
hour12:
|
|
9087
|
-
(props.ampm === 'boolean' && props.ampm),
|
|
9089
|
+
hour12: localizedTimePartials.value && localizedTimePartials.value.hour12,
|
|
9088
9090
|
...(!props.seconds && { timeStyle: 'short' }),
|
|
9089
9091
|
})
|
|
9090
9092
|
: '',
|
|
@@ -9111,33 +9113,45 @@ const CTimePicker = vue.defineComponent({
|
|
|
9111
9113
|
vue.h('span', { class: 'time-picker-inline-icon' }),
|
|
9112
9114
|
vue.h(CFormSelect, {
|
|
9113
9115
|
disabled: props.disabled,
|
|
9114
|
-
options:
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
|
|
9116
|
+
options: localizedTimePartials.value &&
|
|
9117
|
+
localizedTimePartials.value.listOfHours?.map((option) => {
|
|
9118
|
+
return {
|
|
9119
|
+
value: option.value.toString(),
|
|
9120
|
+
label: option.label,
|
|
9121
|
+
};
|
|
9122
|
+
}),
|
|
9120
9123
|
onChange: (event) => handleTimeChange('hours', event.target.value),
|
|
9121
9124
|
...(date.value && { value: getSelectedHour(date.value, props.locale) }),
|
|
9122
9125
|
}),
|
|
9123
9126
|
':',
|
|
9124
|
-
// @ts-expect-error the getListOfMinutes function returns corect type
|
|
9125
9127
|
vue.h(CFormSelect, {
|
|
9126
9128
|
disabled: props.disabled,
|
|
9127
|
-
options:
|
|
9129
|
+
options: localizedTimePartials.value &&
|
|
9130
|
+
localizedTimePartials.value.listOfMinutes.map((option) => {
|
|
9131
|
+
return {
|
|
9132
|
+
value: option.value.toString(),
|
|
9133
|
+
label: option.label,
|
|
9134
|
+
};
|
|
9135
|
+
}),
|
|
9128
9136
|
onChange: (event) => handleTimeChange('minutes', event.target.value),
|
|
9129
9137
|
...(date.value && { value: getSelectedMinutes(date.value) }),
|
|
9130
9138
|
}),
|
|
9131
9139
|
props.seconds && ':',
|
|
9132
9140
|
props.seconds &&
|
|
9133
|
-
// @ts-expect-error the getListOfMinutes function returns corect type
|
|
9134
9141
|
vue.h(CFormSelect, {
|
|
9135
9142
|
disabled: props.disabled,
|
|
9136
|
-
options:
|
|
9143
|
+
options: localizedTimePartials.value &&
|
|
9144
|
+
localizedTimePartials.value.listOfSeconds.map((option) => {
|
|
9145
|
+
return {
|
|
9146
|
+
value: option.value.toString(),
|
|
9147
|
+
label: option.label,
|
|
9148
|
+
};
|
|
9149
|
+
}),
|
|
9137
9150
|
onChange: (event) => handleTimeChange('seconds', event.target.value),
|
|
9138
9151
|
...(date.value && { value: getSelectedSeconds(date.value) }),
|
|
9139
9152
|
}),
|
|
9140
|
-
|
|
9153
|
+
localizedTimePartials.value &&
|
|
9154
|
+
localizedTimePartials.value.hour12 &&
|
|
9141
9155
|
vue.h(CFormSelect, {
|
|
9142
9156
|
disabled: props.disabled,
|
|
9143
9157
|
options: [
|
|
@@ -9150,22 +9164,23 @@ const CTimePicker = vue.defineComponent({
|
|
|
9150
9164
|
];
|
|
9151
9165
|
const TimePickerRoll = () => [
|
|
9152
9166
|
vue.h(CTimePickerRollCol, {
|
|
9153
|
-
elements:
|
|
9167
|
+
elements: localizedTimePartials.value && localizedTimePartials.value.listOfHours,
|
|
9154
9168
|
onClick: (index) => handleTimeChange('hours', index.toString()),
|
|
9155
9169
|
selected: getSelectedHour(date.value, props.locale, props.ampm),
|
|
9156
9170
|
}),
|
|
9157
9171
|
vue.h(CTimePickerRollCol, {
|
|
9158
|
-
elements:
|
|
9172
|
+
elements: localizedTimePartials.value && localizedTimePartials.value.listOfMinutes,
|
|
9159
9173
|
onClick: (index) => handleTimeChange('minutes', index.toString()),
|
|
9160
9174
|
selected: getSelectedMinutes(date.value),
|
|
9161
9175
|
}),
|
|
9162
9176
|
props.seconds &&
|
|
9163
9177
|
vue.h(CTimePickerRollCol, {
|
|
9164
|
-
elements:
|
|
9178
|
+
elements: localizedTimePartials.value && localizedTimePartials.value.listOfSeconds,
|
|
9165
9179
|
onClick: (index) => handleTimeChange('seconds', index.toString()),
|
|
9166
9180
|
selected: getSelectedSeconds(date.value),
|
|
9167
9181
|
}),
|
|
9168
|
-
|
|
9182
|
+
localizedTimePartials.value &&
|
|
9183
|
+
localizedTimePartials.value.hour12 &&
|
|
9169
9184
|
vue.h(CTimePickerRollCol, {
|
|
9170
9185
|
elements: [
|
|
9171
9186
|
{ value: 'am', label: 'AM' },
|
|
@@ -10488,16 +10503,16 @@ const CElementCover = vue.defineComponent({
|
|
|
10488
10503
|
return () => vue.h('div', {
|
|
10489
10504
|
style: { ...coverStyles, ...customBoundaries.value },
|
|
10490
10505
|
ref: elementCoverRef,
|
|
10506
|
+
}, vue.h('div', {
|
|
10507
|
+
style: {
|
|
10508
|
+
position: 'absolute',
|
|
10509
|
+
top: '50%',
|
|
10510
|
+
left: '50%',
|
|
10511
|
+
transform: 'translateX(-50%) translateY(-50%)',
|
|
10512
|
+
},
|
|
10491
10513
|
}, slots.default
|
|
10492
10514
|
? slots.default()
|
|
10493
|
-
: vue.h(
|
|
10494
|
-
style: {
|
|
10495
|
-
position: 'absolute',
|
|
10496
|
-
top: '50%',
|
|
10497
|
-
left: '50%',
|
|
10498
|
-
transform: 'translateX(-50%) translateY(-50%)',
|
|
10499
|
-
},
|
|
10500
|
-
}, vue.h(CSpinner, {
|
|
10515
|
+
: vue.h(CSpinner, {
|
|
10501
10516
|
variant: 'grow',
|
|
10502
10517
|
color: 'primary',
|
|
10503
10518
|
})));
|
|
@@ -11187,7 +11202,6 @@ const CModal = vue.defineComponent({
|
|
|
11187
11202
|
*/
|
|
11188
11203
|
alignment: {
|
|
11189
11204
|
default: 'top',
|
|
11190
|
-
required: false,
|
|
11191
11205
|
validator: (value) => {
|
|
11192
11206
|
return ['top', 'center'].includes(value);
|
|
11193
11207
|
},
|
|
@@ -11195,12 +11209,20 @@ const CModal = vue.defineComponent({
|
|
|
11195
11209
|
/**
|
|
11196
11210
|
* Apply a backdrop on body while offcanvas is open.
|
|
11197
11211
|
*
|
|
11198
|
-
* @values 'static'
|
|
11212
|
+
* @values boolean | 'static'
|
|
11199
11213
|
*/
|
|
11200
11214
|
backdrop: {
|
|
11201
11215
|
type: [Boolean, String],
|
|
11202
11216
|
default: true,
|
|
11203
|
-
|
|
11217
|
+
validator: (value) => {
|
|
11218
|
+
if (typeof value == 'string') {
|
|
11219
|
+
return ['static'].includes(value);
|
|
11220
|
+
}
|
|
11221
|
+
if (typeof value == 'boolean') {
|
|
11222
|
+
return true;
|
|
11223
|
+
}
|
|
11224
|
+
return false;
|
|
11225
|
+
},
|
|
11204
11226
|
},
|
|
11205
11227
|
/**
|
|
11206
11228
|
* A string of all className you want applied to the modal content component.
|
|
@@ -11208,7 +11230,6 @@ const CModal = vue.defineComponent({
|
|
|
11208
11230
|
contentClassName: {
|
|
11209
11231
|
type: String,
|
|
11210
11232
|
default: undefined,
|
|
11211
|
-
required: false,
|
|
11212
11233
|
},
|
|
11213
11234
|
/**
|
|
11214
11235
|
* Set modal to covers the entire user viewport
|
|
@@ -11218,7 +11239,6 @@ const CModal = vue.defineComponent({
|
|
|
11218
11239
|
fullscreen: {
|
|
11219
11240
|
type: [Boolean, String],
|
|
11220
11241
|
default: undefined,
|
|
11221
|
-
required: false,
|
|
11222
11242
|
validator: (value) => {
|
|
11223
11243
|
if (typeof value == 'string') {
|
|
11224
11244
|
return ['sm', 'md', 'lg', 'xl', 'xxl'].includes(value);
|
|
@@ -11235,14 +11255,12 @@ const CModal = vue.defineComponent({
|
|
|
11235
11255
|
keyboard: {
|
|
11236
11256
|
type: Boolean,
|
|
11237
11257
|
default: true,
|
|
11238
|
-
required: false,
|
|
11239
11258
|
},
|
|
11240
11259
|
/**
|
|
11241
11260
|
* Create a scrollable modal that allows scrolling the modal body.
|
|
11242
11261
|
*/
|
|
11243
11262
|
scrollable: {
|
|
11244
11263
|
type: Boolean,
|
|
11245
|
-
required: false,
|
|
11246
11264
|
},
|
|
11247
11265
|
/**
|
|
11248
11266
|
* Size the component small, large, or extra large.
|
|
@@ -11252,7 +11270,6 @@ const CModal = vue.defineComponent({
|
|
|
11252
11270
|
size: {
|
|
11253
11271
|
type: String,
|
|
11254
11272
|
default: undefined,
|
|
11255
|
-
required: false,
|
|
11256
11273
|
validator: (value) => {
|
|
11257
11274
|
return ['sm', 'lg', 'xl'].includes(value);
|
|
11258
11275
|
},
|
|
@@ -11263,7 +11280,6 @@ const CModal = vue.defineComponent({
|
|
|
11263
11280
|
transition: {
|
|
11264
11281
|
type: Boolean,
|
|
11265
11282
|
default: true,
|
|
11266
|
-
required: false,
|
|
11267
11283
|
},
|
|
11268
11284
|
/**
|
|
11269
11285
|
* By default the component is unmounted after close animation, if you want to keep the component mounted set this property to false.
|
|
@@ -11271,7 +11287,6 @@ const CModal = vue.defineComponent({
|
|
|
11271
11287
|
unmountOnClose: {
|
|
11272
11288
|
type: Boolean,
|
|
11273
11289
|
default: true,
|
|
11274
|
-
required: false,
|
|
11275
11290
|
},
|
|
11276
11291
|
/**
|
|
11277
11292
|
* Toggle the visibility of alert component.
|
|
@@ -12022,13 +12037,6 @@ const CMultiSelect = vue.defineComponent({
|
|
|
12022
12037
|
}, [])
|
|
12023
12038
|
: options.value;
|
|
12024
12039
|
};
|
|
12025
|
-
// watch(
|
|
12026
|
-
// () => props.options,
|
|
12027
|
-
// (newValue, oldValue) => {
|
|
12028
|
-
// console.log(props.options)
|
|
12029
|
-
// if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) options.value = newValue
|
|
12030
|
-
// },
|
|
12031
|
-
// )
|
|
12032
12040
|
const handleSearchChange = (event) => {
|
|
12033
12041
|
const target = event.target;
|
|
12034
12042
|
search.value = target.value.toLowerCase();
|
|
@@ -12613,11 +12621,21 @@ const COffcanvas = vue.defineComponent({
|
|
|
12613
12621
|
props: {
|
|
12614
12622
|
/**
|
|
12615
12623
|
* Apply a backdrop on body while offcanvas is open.
|
|
12624
|
+
*
|
|
12625
|
+
* @values boolean | 'static'
|
|
12616
12626
|
*/
|
|
12617
12627
|
backdrop: {
|
|
12618
|
-
type: Boolean,
|
|
12628
|
+
type: [Boolean, String],
|
|
12619
12629
|
default: true,
|
|
12620
|
-
|
|
12630
|
+
validator: (value) => {
|
|
12631
|
+
if (typeof value === 'string') {
|
|
12632
|
+
return ['static'].includes(value);
|
|
12633
|
+
}
|
|
12634
|
+
if (typeof value === 'boolean') {
|
|
12635
|
+
return true;
|
|
12636
|
+
}
|
|
12637
|
+
return false;
|
|
12638
|
+
},
|
|
12621
12639
|
},
|
|
12622
12640
|
/**
|
|
12623
12641
|
* Closes the offcanvas when escape key is pressed.
|
|
@@ -12625,7 +12643,6 @@ const COffcanvas = vue.defineComponent({
|
|
|
12625
12643
|
keyboard: {
|
|
12626
12644
|
type: Boolean,
|
|
12627
12645
|
default: true,
|
|
12628
|
-
require: false,
|
|
12629
12646
|
},
|
|
12630
12647
|
/**
|
|
12631
12648
|
* Components placement, there’s no default placement.
|
|
@@ -12640,21 +12657,36 @@ const COffcanvas = vue.defineComponent({
|
|
|
12640
12657
|
return ['start', 'end', 'top', 'bottom'].includes(value);
|
|
12641
12658
|
},
|
|
12642
12659
|
},
|
|
12660
|
+
/**
|
|
12661
|
+
* Responsive offcanvas property hide content outside the viewport from a specified breakpoint and down.
|
|
12662
|
+
*
|
|
12663
|
+
* @values boolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'
|
|
12664
|
+
* @since 4.7.0
|
|
12665
|
+
*/
|
|
12666
|
+
responsive: {
|
|
12667
|
+
type: [Boolean, String],
|
|
12668
|
+
default: true,
|
|
12669
|
+
validator: (value) => {
|
|
12670
|
+
if (typeof value === 'string') {
|
|
12671
|
+
return ['sm', 'md', 'lg', 'xl', 'xxl'].includes(value);
|
|
12672
|
+
}
|
|
12673
|
+
if (typeof value === 'boolean') {
|
|
12674
|
+
return true;
|
|
12675
|
+
}
|
|
12676
|
+
return false;
|
|
12677
|
+
},
|
|
12678
|
+
},
|
|
12643
12679
|
/**
|
|
12644
12680
|
* Allow body scrolling while offcanvas is open
|
|
12645
12681
|
*/
|
|
12646
12682
|
scroll: {
|
|
12647
12683
|
type: Boolean,
|
|
12648
12684
|
default: false,
|
|
12649
|
-
required: false,
|
|
12650
12685
|
},
|
|
12651
12686
|
/**
|
|
12652
12687
|
* Toggle the visibility of offcanvas component.
|
|
12653
12688
|
*/
|
|
12654
|
-
visible:
|
|
12655
|
-
type: Boolean,
|
|
12656
|
-
require: false,
|
|
12657
|
-
},
|
|
12689
|
+
visible: Boolean,
|
|
12658
12690
|
},
|
|
12659
12691
|
emits: [
|
|
12660
12692
|
/**
|
|
@@ -12689,40 +12721,31 @@ const COffcanvas = vue.defineComponent({
|
|
|
12689
12721
|
emit('show');
|
|
12690
12722
|
executeAfterTransition(() => done(), el);
|
|
12691
12723
|
setTimeout(() => {
|
|
12692
|
-
el.style.visibility = 'visible';
|
|
12693
12724
|
el.classList.add('show');
|
|
12694
12725
|
}, 1);
|
|
12695
12726
|
};
|
|
12696
12727
|
const handleAfterEnter = () => {
|
|
12697
|
-
|
|
12698
|
-
window.addEventListener('keyup', handleKeyUp);
|
|
12728
|
+
offcanvasRef.value.focus();
|
|
12699
12729
|
};
|
|
12700
12730
|
const handleLeave = (el, done) => {
|
|
12701
12731
|
executeAfterTransition(() => done(), el);
|
|
12702
|
-
|
|
12703
|
-
window.removeEventListener('keyup', handleKeyUp);
|
|
12704
|
-
el.classList.remove('show');
|
|
12732
|
+
el.classList.add('hiding');
|
|
12705
12733
|
};
|
|
12706
12734
|
const handleAfterLeave = (el) => {
|
|
12707
|
-
el.
|
|
12735
|
+
el.classList.remove('show', 'hiding');
|
|
12708
12736
|
};
|
|
12709
12737
|
const handleDismiss = () => {
|
|
12710
12738
|
visible.value = false;
|
|
12711
12739
|
emit('hide');
|
|
12712
12740
|
};
|
|
12713
|
-
const
|
|
12714
|
-
if (
|
|
12715
|
-
|
|
12716
|
-
return handleDismiss();
|
|
12717
|
-
}
|
|
12741
|
+
const handleBackdropDismiss = () => {
|
|
12742
|
+
if (props.backdrop !== 'static') {
|
|
12743
|
+
handleDismiss();
|
|
12718
12744
|
}
|
|
12719
12745
|
};
|
|
12720
|
-
const
|
|
12721
|
-
|
|
12722
|
-
|
|
12723
|
-
const handleMouseUp = (event) => {
|
|
12724
|
-
if (offcanvasRef.value && !offcanvasRef.value.contains(event.target)) {
|
|
12725
|
-
props.backdrop && handleDismiss();
|
|
12746
|
+
const handleKeyDown = (event) => {
|
|
12747
|
+
if (event.key === 'Escape' && props.keyboard) {
|
|
12748
|
+
handleDismiss();
|
|
12726
12749
|
}
|
|
12727
12750
|
};
|
|
12728
12751
|
return () => [
|
|
@@ -12734,17 +12757,20 @@ const COffcanvas = vue.defineComponent({
|
|
|
12734
12757
|
onAfterLeave: (el) => handleAfterLeave(el),
|
|
12735
12758
|
}, () => vue.withDirectives(vue.h('div', {
|
|
12736
12759
|
class: [
|
|
12737
|
-
'offcanvas',
|
|
12738
12760
|
{
|
|
12761
|
+
[`offcanvas${typeof props.responsive !== 'boolean' ? '-' + props.responsive : ''}`]: props.responsive,
|
|
12739
12762
|
[`offcanvas-${props.placement}`]: props.placement,
|
|
12740
12763
|
},
|
|
12741
12764
|
],
|
|
12765
|
+
onKeydown: (event) => handleKeyDown(event),
|
|
12742
12766
|
ref: offcanvasRef,
|
|
12743
12767
|
role: 'dialog',
|
|
12768
|
+
tabindex: -1,
|
|
12744
12769
|
}, slots.default && slots.default()), [[vVisible, props.visible]])),
|
|
12745
12770
|
props.backdrop &&
|
|
12746
12771
|
vue.h(CBackdrop, {
|
|
12747
12772
|
class: 'offcanvas-backdrop',
|
|
12773
|
+
onClick: handleBackdropDismiss,
|
|
12748
12774
|
visible: visible.value,
|
|
12749
12775
|
}),
|
|
12750
12776
|
];
|
|
@@ -13834,6 +13860,140 @@ const CSmartPaginationPlugin = {
|
|
|
13834
13860
|
},
|
|
13835
13861
|
};
|
|
13836
13862
|
|
|
13863
|
+
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'/>"];
|
|
13864
|
+
|
|
13865
|
+
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'/>"];
|
|
13866
|
+
|
|
13867
|
+
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'/>"];
|
|
13868
|
+
|
|
13869
|
+
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'/>"];
|
|
13870
|
+
|
|
13871
|
+
const CIcon = vue.defineComponent({
|
|
13872
|
+
name: 'CIcon',
|
|
13873
|
+
props: {
|
|
13874
|
+
/**
|
|
13875
|
+
* Use `:icon="..."` instead of
|
|
13876
|
+
*
|
|
13877
|
+
* @deprecated since version 3.0
|
|
13878
|
+
*/
|
|
13879
|
+
content: {
|
|
13880
|
+
type: [String, Array],
|
|
13881
|
+
default: undefined,
|
|
13882
|
+
required: false,
|
|
13883
|
+
},
|
|
13884
|
+
/**
|
|
13885
|
+
* Use for replacing default CIcon component classes. Prop is overriding the 'size' prop.
|
|
13886
|
+
*/
|
|
13887
|
+
customClassName: {
|
|
13888
|
+
type: [String, Array, Object],
|
|
13889
|
+
default: undefined,
|
|
13890
|
+
required: false,
|
|
13891
|
+
},
|
|
13892
|
+
/**
|
|
13893
|
+
* Name of the icon placed in React object or SVG content.
|
|
13894
|
+
*/
|
|
13895
|
+
icon: {
|
|
13896
|
+
type: [String, Array],
|
|
13897
|
+
default: undefined,
|
|
13898
|
+
required: false,
|
|
13899
|
+
},
|
|
13900
|
+
/**
|
|
13901
|
+
* Use `icon="..."` instead of
|
|
13902
|
+
*
|
|
13903
|
+
* @deprecated since version 3.0
|
|
13904
|
+
*/
|
|
13905
|
+
name: {
|
|
13906
|
+
type: String,
|
|
13907
|
+
default: undefined,
|
|
13908
|
+
required: false,
|
|
13909
|
+
},
|
|
13910
|
+
/**
|
|
13911
|
+
* Size of the icon. Available sizes: 'sm', 'lg', 'xl', 'xxl', '3xl...9xl', 'custom', 'custom-size'.
|
|
13912
|
+
*/
|
|
13913
|
+
size: {
|
|
13914
|
+
type: String,
|
|
13915
|
+
default: undefined,
|
|
13916
|
+
required: false,
|
|
13917
|
+
validator: (value) => {
|
|
13918
|
+
return [
|
|
13919
|
+
'custom',
|
|
13920
|
+
'custom-size',
|
|
13921
|
+
'sm',
|
|
13922
|
+
'lg',
|
|
13923
|
+
'xl',
|
|
13924
|
+
'xxl',
|
|
13925
|
+
'3xl',
|
|
13926
|
+
'4xl',
|
|
13927
|
+
'5xl',
|
|
13928
|
+
'6xl',
|
|
13929
|
+
'7xl',
|
|
13930
|
+
'8xl',
|
|
13931
|
+
'9xl',
|
|
13932
|
+
].includes(value);
|
|
13933
|
+
},
|
|
13934
|
+
},
|
|
13935
|
+
/**
|
|
13936
|
+
* Title tag content.
|
|
13937
|
+
*/
|
|
13938
|
+
title: {
|
|
13939
|
+
type: String,
|
|
13940
|
+
default: undefined,
|
|
13941
|
+
required: false,
|
|
13942
|
+
},
|
|
13943
|
+
/**
|
|
13944
|
+
* If defined component will be rendered using 'use' tag.
|
|
13945
|
+
*/
|
|
13946
|
+
use: {
|
|
13947
|
+
type: String,
|
|
13948
|
+
default: undefined,
|
|
13949
|
+
required: false,
|
|
13950
|
+
},
|
|
13951
|
+
},
|
|
13952
|
+
setup(props, { attrs }) {
|
|
13953
|
+
const icons = vue.inject('icons');
|
|
13954
|
+
const _icon = props.icon || props.content || props.name;
|
|
13955
|
+
const toCamelCase = (str) => {
|
|
13956
|
+
return str
|
|
13957
|
+
.replace(/([-_][a-z0-9])/gi, ($1) => {
|
|
13958
|
+
return $1.toUpperCase();
|
|
13959
|
+
})
|
|
13960
|
+
.replace(/-/gi, '');
|
|
13961
|
+
};
|
|
13962
|
+
const iconName = vue.computed(() => _icon && typeof _icon === 'string' ? (_icon.includes('-') ? toCamelCase(_icon) : _icon) : '');
|
|
13963
|
+
const titleCode = props.title ? `<title>${props.title}</title>` : 'undefined';
|
|
13964
|
+
const code = vue.computed(() => Array.isArray(_icon)
|
|
13965
|
+
? _icon
|
|
13966
|
+
: typeof _icon === 'string' && iconName.value && icons[iconName.value]
|
|
13967
|
+
? icons[iconName.value]
|
|
13968
|
+
: 'undefined');
|
|
13969
|
+
const iconCode = Array.isArray(code.value) ? code.value[1] || code.value[0] : code.value;
|
|
13970
|
+
const scale = Array.isArray(code.value) && code.value.length > 1 ? code.value[0] : '64 64';
|
|
13971
|
+
const viewBox = attrs.viewBox || `0 0 ${scale}`;
|
|
13972
|
+
const size = () => {
|
|
13973
|
+
const addCustom = !props.size && (attrs.width || attrs.height);
|
|
13974
|
+
return props.size === 'custom' || addCustom ? 'custom-size' : props.size;
|
|
13975
|
+
};
|
|
13976
|
+
const classNames = (() => {
|
|
13977
|
+
return [props.customClassName || ['icon', { [`icon-${size()}`]: size() }], attrs.class];
|
|
13978
|
+
})();
|
|
13979
|
+
return () => props.use
|
|
13980
|
+
? vue.h('svg', {
|
|
13981
|
+
...attrs,
|
|
13982
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
13983
|
+
class: classNames,
|
|
13984
|
+
role: 'img',
|
|
13985
|
+
}, vue.h('use', { href: props.use }))
|
|
13986
|
+
: vue.h('svg', {
|
|
13987
|
+
...attrs,
|
|
13988
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
13989
|
+
class: classNames,
|
|
13990
|
+
viewBox: viewBox,
|
|
13991
|
+
innerHTML: `${titleCode}${iconCode}`,
|
|
13992
|
+
role: 'img',
|
|
13993
|
+
});
|
|
13994
|
+
},
|
|
13995
|
+
});
|
|
13996
|
+
|
|
13837
13997
|
const CTableBody = vue.defineComponent({
|
|
13838
13998
|
name: 'CTableBody',
|
|
13839
13999
|
props: {
|
|
@@ -14019,7 +14179,7 @@ const CTableRow = vue.defineComponent({
|
|
|
14019
14179
|
},
|
|
14020
14180
|
});
|
|
14021
14181
|
|
|
14022
|
-
const pretifyName = (name) => {
|
|
14182
|
+
const pretifyName$1 = (name) => {
|
|
14023
14183
|
return name
|
|
14024
14184
|
.replace(/[-_.]/g, ' ')
|
|
14025
14185
|
.replace(/ +/g, ' ')
|
|
@@ -14031,8 +14191,8 @@ const pretifyName = (name) => {
|
|
|
14031
14191
|
const label = (column) => typeof column === 'object'
|
|
14032
14192
|
? column.label !== undefined
|
|
14033
14193
|
? column.label
|
|
14034
|
-
: pretifyName(column.key)
|
|
14035
|
-
: pretifyName(column);
|
|
14194
|
+
: pretifyName$1(column.key)
|
|
14195
|
+
: pretifyName$1(column);
|
|
14036
14196
|
const CTable = vue.defineComponent({
|
|
14037
14197
|
name: 'CTable',
|
|
14038
14198
|
props: {
|
|
@@ -14322,120 +14482,244 @@ const CTablePlugin = {
|
|
|
14322
14482
|
},
|
|
14323
14483
|
};
|
|
14324
14484
|
|
|
14325
|
-
const
|
|
14326
|
-
|
|
14327
|
-
|
|
14328
|
-
|
|
14329
|
-
|
|
14330
|
-
|
|
14331
|
-
|
|
14332
|
-
|
|
14333
|
-
|
|
14334
|
-
|
|
14335
|
-
|
|
14336
|
-
|
|
14337
|
-
|
|
14338
|
-
|
|
14339
|
-
|
|
14340
|
-
|
|
14341
|
-
|
|
14342
|
-
|
|
14343
|
-
|
|
14344
|
-
|
|
14345
|
-
|
|
14346
|
-
|
|
14347
|
-
|
|
14348
|
-
|
|
14349
|
-
|
|
14350
|
-
|
|
14351
|
-
|
|
14352
|
-
|
|
14353
|
-
|
|
14354
|
-
|
|
14355
|
-
|
|
14485
|
+
const filterColumns = (items, columnFilter, columnFilterState, itemsDataColumns) => {
|
|
14486
|
+
if (columnFilter && typeof columnFilter === 'object' && columnFilter.external) {
|
|
14487
|
+
return items;
|
|
14488
|
+
}
|
|
14489
|
+
Object.entries(columnFilterState).forEach(([key, value]) => {
|
|
14490
|
+
if (value instanceof Function) {
|
|
14491
|
+
items = items.filter((item) => value(item[key]));
|
|
14492
|
+
return;
|
|
14493
|
+
}
|
|
14494
|
+
const columnFilter = String(value).toLowerCase();
|
|
14495
|
+
if (columnFilter && itemsDataColumns.includes(key)) {
|
|
14496
|
+
items = items.filter((item) => {
|
|
14497
|
+
return String(item[key]).toLowerCase().includes(columnFilter);
|
|
14498
|
+
});
|
|
14499
|
+
}
|
|
14500
|
+
});
|
|
14501
|
+
return items;
|
|
14502
|
+
};
|
|
14503
|
+
const filterTable = (items, tableFilter, tableFilterState, itemsDataColumns) => {
|
|
14504
|
+
if (!tableFilterState ||
|
|
14505
|
+
(tableFilter && typeof tableFilter === 'object' && tableFilter.external)) {
|
|
14506
|
+
return items;
|
|
14507
|
+
}
|
|
14508
|
+
const filter = tableFilterState.toLowerCase();
|
|
14509
|
+
const valueContainFilter = (val) => String(val).toLowerCase().includes(filter);
|
|
14510
|
+
items = items.filter((item) => {
|
|
14511
|
+
return !!itemsDataColumns.find((key) => valueContainFilter(item[key]));
|
|
14512
|
+
});
|
|
14513
|
+
return items;
|
|
14514
|
+
};
|
|
14515
|
+
const getClickedColumnName = (target, columnNames) => {
|
|
14516
|
+
const closest = target.closest('tr');
|
|
14517
|
+
const children = closest ? Array.from(closest.children) : [];
|
|
14518
|
+
const clickedCell = children.filter((child) => child.contains(target))[0];
|
|
14519
|
+
return columnNames[children.indexOf(clickedCell)];
|
|
14520
|
+
};
|
|
14521
|
+
const getColumnKey = (column) => typeof column === 'object' ? column.key : column;
|
|
14522
|
+
const getColumnLabel = (column) => typeof column === 'object'
|
|
14523
|
+
? column.label !== undefined
|
|
14524
|
+
? column.label
|
|
14525
|
+
: pretifyName(column.key)
|
|
14526
|
+
: pretifyName(column);
|
|
14527
|
+
const getColumnNames = (columns, items) => columns
|
|
14528
|
+
? columns.map((column) => {
|
|
14529
|
+
if (typeof column === 'object')
|
|
14530
|
+
return column.key;
|
|
14531
|
+
else
|
|
14532
|
+
return column;
|
|
14533
|
+
})
|
|
14534
|
+
: getColumnNamesFromItems(items);
|
|
14535
|
+
const getColumnNamesFromItems = (items) => Object.keys(items[0] || {}).filter((el) => el.charAt(0) !== '_');
|
|
14536
|
+
const getColumnSorterState = (key, sorterState) => {
|
|
14537
|
+
if (sorterState && sorterState.column === key) {
|
|
14538
|
+
if (sorterState.state) {
|
|
14539
|
+
return sorterState.state;
|
|
14540
|
+
}
|
|
14541
|
+
return 0;
|
|
14542
|
+
}
|
|
14543
|
+
return 0;
|
|
14544
|
+
};
|
|
14545
|
+
const getColumnValues = (items, key) => {
|
|
14546
|
+
return items.map((item) => item[key]);
|
|
14547
|
+
};
|
|
14548
|
+
const getTableDataCellProps = (item, colName) => {
|
|
14549
|
+
const props = item._cellProps && {
|
|
14550
|
+
...(item._cellProps['all'] && { ...item._cellProps['all'] }),
|
|
14551
|
+
...(item._cellProps[colName] && { ...item._cellProps[colName] }),
|
|
14552
|
+
};
|
|
14553
|
+
return props;
|
|
14554
|
+
};
|
|
14555
|
+
const getTableHeaderCellProps = (column) => {
|
|
14556
|
+
if (typeof column === 'object' && column._props) {
|
|
14557
|
+
return column._props;
|
|
14558
|
+
}
|
|
14559
|
+
return {};
|
|
14560
|
+
};
|
|
14561
|
+
const getTableHeaderCellStyles = (column, columnSorter) => {
|
|
14562
|
+
const style = {};
|
|
14563
|
+
if (columnSorter &&
|
|
14564
|
+
(typeof column !== 'object' ||
|
|
14565
|
+
(typeof column === 'object' && (typeof column.sorter === 'undefined' || column.sorter)))) {
|
|
14566
|
+
style['cursor'] = 'pointer';
|
|
14567
|
+
}
|
|
14568
|
+
if (typeof column === 'object' && column._style) {
|
|
14569
|
+
return { ...style, ...column._style };
|
|
14570
|
+
}
|
|
14571
|
+
return style;
|
|
14572
|
+
};
|
|
14573
|
+
const isObjectInArray = (array, item, ignore = []) => array.some((_item) => {
|
|
14574
|
+
let result = true;
|
|
14575
|
+
for (const key in item) {
|
|
14576
|
+
if (!ignore.includes(key) && item[key] !== _item[key]) {
|
|
14577
|
+
result = false;
|
|
14578
|
+
break;
|
|
14579
|
+
}
|
|
14580
|
+
}
|
|
14581
|
+
return result;
|
|
14582
|
+
});
|
|
14583
|
+
const isSortable = (i, columns, columnSorter, itemsDataColumns, columnNames) => {
|
|
14584
|
+
const isDataColumn = itemsDataColumns.includes(columnNames[i]);
|
|
14585
|
+
let column;
|
|
14586
|
+
if (columns)
|
|
14587
|
+
column = columns[i];
|
|
14588
|
+
return (columnSorter &&
|
|
14589
|
+
(!columns ||
|
|
14590
|
+
typeof column !== 'object' ||
|
|
14591
|
+
(typeof column === 'object' && (typeof column.sorter === 'undefined' || column.sorter))) &&
|
|
14592
|
+
isDataColumn);
|
|
14593
|
+
};
|
|
14594
|
+
const pretifyName = (name) => {
|
|
14595
|
+
return name
|
|
14596
|
+
.replace(/[-_.]/g, ' ')
|
|
14597
|
+
.replace(/ +/g, ' ')
|
|
14598
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1 $2')
|
|
14599
|
+
.split(' ')
|
|
14600
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
14601
|
+
.join(' ');
|
|
14602
|
+
};
|
|
14603
|
+
const sortItems = (columnSorter, items, itemsDataColumns, sorterState) => {
|
|
14604
|
+
const column = sorterState.column;
|
|
14605
|
+
if (!column ||
|
|
14606
|
+
!itemsDataColumns.includes(column) ||
|
|
14607
|
+
(columnSorter && typeof columnSorter === 'object' && columnSorter.external)) {
|
|
14608
|
+
return items;
|
|
14609
|
+
}
|
|
14610
|
+
const flip = sorterState.state === 'asc' ? 1 : sorterState.state === 'desc' ? -1 : 0;
|
|
14611
|
+
const sorted = items.slice().sort((item, item2) => {
|
|
14612
|
+
const value = item[column];
|
|
14613
|
+
const value2 = item2[column];
|
|
14614
|
+
const a = typeof value === 'number' ? value : String(value).toLowerCase();
|
|
14615
|
+
const b = typeof value2 === 'number' ? value2 : String(value2).toLowerCase();
|
|
14616
|
+
return a > b ? 1 * flip : b > a ? -1 * flip : 0;
|
|
14617
|
+
});
|
|
14618
|
+
return sorted;
|
|
14619
|
+
};
|
|
14620
|
+
|
|
14621
|
+
const CSmartTableBody = vue.defineComponent({
|
|
14622
|
+
name: 'CSmartTableBody',
|
|
14623
|
+
props: {
|
|
14624
|
+
clickableRows: Boolean,
|
|
14625
|
+
columnNames: {
|
|
14626
|
+
type: Array,
|
|
14627
|
+
default: () => [],
|
|
14628
|
+
require: true,
|
|
14629
|
+
},
|
|
14630
|
+
currentItems: {
|
|
14631
|
+
type: Array,
|
|
14632
|
+
default: () => [],
|
|
14356
14633
|
},
|
|
14634
|
+
firstItemOnActivePageIndex: {
|
|
14635
|
+
type: Number,
|
|
14636
|
+
require: true,
|
|
14637
|
+
default: 0,
|
|
14638
|
+
},
|
|
14639
|
+
noItemsLabel: String,
|
|
14640
|
+
scopedSlots: Object,
|
|
14357
14641
|
selectable: Boolean,
|
|
14642
|
+
selected: Array,
|
|
14358
14643
|
},
|
|
14359
14644
|
emits: ['rowChecked', 'rowClick'],
|
|
14360
14645
|
setup(props, { emit }) {
|
|
14361
|
-
const
|
|
14362
|
-
|
|
14363
|
-
|
|
14364
|
-
const handleRowChecked = (id, value) => {
|
|
14365
|
-
emit('rowChecked', id, value);
|
|
14366
|
-
};
|
|
14367
|
-
const tableDataCellProps = (item, colName) => {
|
|
14368
|
-
const props = item._cellProps && {
|
|
14369
|
-
...(item._cellProps['all'] && { ...item._cellProps['all'] }),
|
|
14370
|
-
...(item._cellProps[colName] && { ...item._cellProps[colName] }),
|
|
14371
|
-
};
|
|
14372
|
-
return props;
|
|
14373
|
-
};
|
|
14374
|
-
const getColumnName = (event) => {
|
|
14375
|
-
const target = event.target;
|
|
14376
|
-
const closest = target.closest('tr');
|
|
14377
|
-
const children = closest ? Array.from(closest.children) : [];
|
|
14378
|
-
const clickedCell = children.filter((child) => child.contains(target))[0];
|
|
14379
|
-
return props.rawColumnNames[children.indexOf(clickedCell)];
|
|
14380
|
-
};
|
|
14646
|
+
const colspan = props.selectable
|
|
14647
|
+
? props.columnNames.length + 1
|
|
14648
|
+
: props.columnNames.length;
|
|
14381
14649
|
return () => vue.h(CTableBody, {
|
|
14382
14650
|
...(props.clickableRows && { style: 'cursor:pointer;' }),
|
|
14383
14651
|
}, {
|
|
14384
|
-
default: () => props.currentItems.
|
|
14385
|
-
|
|
14386
|
-
...(item._props && { ...item._props }),
|
|
14387
|
-
...(props.clickableRows && { tabindex: 0 }),
|
|
14388
|
-
onClick: (event) => handleRowClick(item, trIndex + props.firstItemOnActivePageIndex, getColumnName(event), event),
|
|
14389
|
-
}, {
|
|
14390
|
-
default: () => [
|
|
14391
|
-
props.selectable &&
|
|
14392
|
-
vue.h(CTableDataCell, {}, () => vue.h(CFormCheck, {
|
|
14393
|
-
checked: item._selected ? item._selected : false,
|
|
14394
|
-
onChange: (event) => handleRowChecked(item._id, event.target.checked),
|
|
14395
|
-
})),
|
|
14396
|
-
props.rawColumnNames.map((colName) => props.scopedSlots &&
|
|
14397
|
-
props.scopedSlots[colName] &&
|
|
14398
|
-
typeof props.scopedSlots[colName] === 'function'
|
|
14399
|
-
? vue.h(props.scopedSlots[colName], { item: item })
|
|
14400
|
-
: vue.h(CTableDataCell, {
|
|
14401
|
-
...tableDataCellProps(item, colName),
|
|
14402
|
-
}, {
|
|
14403
|
-
default: () => String(item[colName]),
|
|
14404
|
-
})),
|
|
14405
|
-
],
|
|
14406
|
-
}),
|
|
14407
|
-
props.scopedSlots &&
|
|
14408
|
-
props.scopedSlots['details'] && [
|
|
14409
|
-
vue.h(CTableRow, {
|
|
14410
|
-
colspan: props.selectable
|
|
14411
|
-
? props.rawColumnNames.length + 1
|
|
14412
|
-
: props.rawColumnNames.length,
|
|
14413
|
-
class: 'p-0',
|
|
14414
|
-
style: { 'border-bottom-width': '0' },
|
|
14415
|
-
tabindex: '-1',
|
|
14416
|
-
}),
|
|
14652
|
+
default: () => props.currentItems.length
|
|
14653
|
+
? props.currentItems.map((item, trIndex) => [
|
|
14417
14654
|
vue.h(CTableRow, {
|
|
14418
|
-
|
|
14419
|
-
|
|
14420
|
-
onClick: (event) =>
|
|
14655
|
+
...(item._props && { ...item._props }),
|
|
14656
|
+
...(props.clickableRows && { tabindex: 0 }),
|
|
14657
|
+
onClick: (event) => {
|
|
14658
|
+
emit('rowClick', item, trIndex + props.firstItemOnActivePageIndex, getClickedColumnName(event.target, props.columnNames), event);
|
|
14659
|
+
},
|
|
14421
14660
|
}, {
|
|
14422
|
-
default: () =>
|
|
14661
|
+
default: () => [
|
|
14662
|
+
props.selectable &&
|
|
14663
|
+
vue.h(CTableDataCell, {}, () => vue.h(CFormCheck, {
|
|
14664
|
+
checked: props.selected &&
|
|
14665
|
+
isObjectInArray(props.selected, item, [
|
|
14666
|
+
'_cellProps',
|
|
14667
|
+
'_props',
|
|
14668
|
+
'_selected',
|
|
14669
|
+
]),
|
|
14670
|
+
onChange: (event) => {
|
|
14671
|
+
emit('rowChecked', item, event.target.checked);
|
|
14672
|
+
},
|
|
14673
|
+
})),
|
|
14674
|
+
props.columnNames.map((colName) => props.scopedSlots &&
|
|
14675
|
+
props.scopedSlots[colName] &&
|
|
14676
|
+
typeof props.scopedSlots[colName] === 'function'
|
|
14677
|
+
? vue.h(props.scopedSlots[colName], { item: item })
|
|
14678
|
+
: vue.h(CTableDataCell, {
|
|
14679
|
+
...getTableDataCellProps(item, colName),
|
|
14680
|
+
}, {
|
|
14681
|
+
default: () => String(item[colName]),
|
|
14682
|
+
})),
|
|
14683
|
+
],
|
|
14684
|
+
}),
|
|
14685
|
+
props.scopedSlots &&
|
|
14686
|
+
props.scopedSlots['details'] && [
|
|
14687
|
+
vue.h(CTableRow, {
|
|
14423
14688
|
colspan: props.selectable
|
|
14424
|
-
? props.
|
|
14425
|
-
: props.
|
|
14689
|
+
? props.columnNames.length + 1
|
|
14690
|
+
: props.columnNames.length,
|
|
14426
14691
|
class: 'p-0',
|
|
14427
|
-
style: { border: 0 },
|
|
14692
|
+
style: { 'border-bottom-width': '0' },
|
|
14693
|
+
tabindex: '-1',
|
|
14694
|
+
}),
|
|
14695
|
+
vue.h(CTableRow, {
|
|
14696
|
+
class: 'p-0',
|
|
14697
|
+
key: `details${trIndex}`,
|
|
14698
|
+
onClick: (event) => {
|
|
14699
|
+
emit('rowClick', item, trIndex + props.firstItemOnActivePageIndex, getClickedColumnName(event.target, props.columnNames), true);
|
|
14700
|
+
},
|
|
14428
14701
|
}, {
|
|
14429
|
-
default: () =>
|
|
14430
|
-
props.
|
|
14431
|
-
|
|
14432
|
-
|
|
14433
|
-
|
|
14434
|
-
}
|
|
14702
|
+
default: () => vue.h(CTableDataCell, {
|
|
14703
|
+
colspan: props.selectable
|
|
14704
|
+
? props.columnNames.length + 1
|
|
14705
|
+
: props.columnNames.length,
|
|
14706
|
+
class: 'p-0',
|
|
14707
|
+
style: { border: 0 },
|
|
14708
|
+
}, {
|
|
14709
|
+
default: () => props.scopedSlots &&
|
|
14710
|
+
props.scopedSlots['details'] &&
|
|
14711
|
+
vue.h(props.scopedSlots['details'], {
|
|
14712
|
+
item: item,
|
|
14713
|
+
}),
|
|
14714
|
+
}),
|
|
14435
14715
|
}),
|
|
14716
|
+
],
|
|
14717
|
+
])
|
|
14718
|
+
: vue.h(CTableRow, {}, {
|
|
14719
|
+
default: () => vue.h(CTableDataCell, { colspan: colspan }, {
|
|
14720
|
+
default: () => props.noItemsLabel,
|
|
14436
14721
|
}),
|
|
14437
|
-
|
|
14438
|
-
]),
|
|
14722
|
+
}),
|
|
14439
14723
|
});
|
|
14440
14724
|
},
|
|
14441
14725
|
});
|
|
@@ -14443,140 +14727,63 @@ const CSmartTableBody = vue.defineComponent({
|
|
|
14443
14727
|
const CSmartTableHead = vue.defineComponent({
|
|
14444
14728
|
name: 'CSmartTableHead',
|
|
14445
14729
|
props: {
|
|
14446
|
-
|
|
14447
|
-
|
|
14448
|
-
|
|
14449
|
-
default: '',
|
|
14450
|
-
},
|
|
14451
|
-
columnFilter: {
|
|
14452
|
-
type: [Boolean, Object],
|
|
14453
|
-
require: false,
|
|
14454
|
-
},
|
|
14455
|
-
columnFilterValue: {
|
|
14456
|
-
type: Object,
|
|
14457
|
-
required: false,
|
|
14458
|
-
},
|
|
14459
|
-
columnSorter: {
|
|
14460
|
-
type: [Boolean, Object],
|
|
14461
|
-
default: undefined,
|
|
14462
|
-
require: false,
|
|
14463
|
-
},
|
|
14730
|
+
columnFilter: [Boolean, Object],
|
|
14731
|
+
columnFilterValue: Object,
|
|
14732
|
+
columnSorter: [Boolean, Object],
|
|
14464
14733
|
component: {
|
|
14465
14734
|
type: String,
|
|
14466
14735
|
default: 'head',
|
|
14467
|
-
require: false,
|
|
14468
14736
|
},
|
|
14469
14737
|
columns: {
|
|
14470
14738
|
type: Array,
|
|
14471
14739
|
default: () => [],
|
|
14472
|
-
required: false,
|
|
14473
14740
|
},
|
|
14474
14741
|
items: {
|
|
14475
14742
|
type: Array,
|
|
14476
14743
|
default: () => [],
|
|
14477
|
-
required: false,
|
|
14478
14744
|
},
|
|
14479
14745
|
selectable: Boolean,
|
|
14480
|
-
selectAll: [Boolean,
|
|
14481
|
-
|
|
14482
|
-
|
|
14483
|
-
default: undefined,
|
|
14484
|
-
require: false,
|
|
14485
|
-
},
|
|
14746
|
+
selectAll: [Boolean, Object],
|
|
14747
|
+
selectedAll: [Boolean, String],
|
|
14748
|
+
sorterState: Object,
|
|
14486
14749
|
},
|
|
14487
14750
|
emits: ['customFilterChange', 'filterInput', 'filterChange', 'selectAllChecked', 'sortClick'],
|
|
14488
14751
|
setup(props, { slots, emit }) {
|
|
14489
|
-
const handleSortClick = (key, index) => {
|
|
14490
|
-
emit('sortClick', key, index);
|
|
14491
|
-
};
|
|
14492
|
-
const tableHeaderCellProps = (column) => {
|
|
14493
|
-
if (typeof column === 'object' && column._props) {
|
|
14494
|
-
return column._props;
|
|
14495
|
-
}
|
|
14496
|
-
return {};
|
|
14497
|
-
};
|
|
14498
|
-
const tableHeaderCellStyles = (column) => {
|
|
14499
|
-
const style = { verticalAlign: 'middle', overflow: 'hidden', cursor: '' };
|
|
14500
|
-
if (props.columnSorter &&
|
|
14501
|
-
(typeof column !== 'object' ||
|
|
14502
|
-
(typeof column === 'object' && (typeof column.sorter === 'undefined' || column.sorter)))) {
|
|
14503
|
-
style.cursor = 'pointer';
|
|
14504
|
-
}
|
|
14505
|
-
if (typeof column === 'object' && column._style) {
|
|
14506
|
-
return { ...style, ...column._style };
|
|
14507
|
-
}
|
|
14508
|
-
return style;
|
|
14509
|
-
};
|
|
14510
|
-
const pretifyName = (name) => {
|
|
14511
|
-
return name
|
|
14512
|
-
.replace(/[-_.]/g, ' ')
|
|
14513
|
-
.replace(/ +/g, ' ')
|
|
14514
|
-
.replace(/([a-z0-9])([A-Z])/g, '$1 $2')
|
|
14515
|
-
.split(' ')
|
|
14516
|
-
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
14517
|
-
.join(' ');
|
|
14518
|
-
};
|
|
14519
|
-
const label = (column) => typeof column === 'object'
|
|
14520
|
-
? column.label !== undefined
|
|
14521
|
-
? column.label
|
|
14522
|
-
: pretifyName(column.key)
|
|
14523
|
-
: pretifyName(column);
|
|
14524
|
-
const key = (column) => (typeof column === 'object' ? column.key : column);
|
|
14525
|
-
const getColumnSorterState = (key) => {
|
|
14526
|
-
if (props.sorterState && props.sorterState.column === key) {
|
|
14527
|
-
if (props.sorterState.state) {
|
|
14528
|
-
return props.sorterState.state;
|
|
14529
|
-
}
|
|
14530
|
-
return 0;
|
|
14531
|
-
}
|
|
14532
|
-
return 0;
|
|
14533
|
-
};
|
|
14534
|
-
const getValues = (items, key) => {
|
|
14535
|
-
return items.map((a) => a[key]);
|
|
14536
|
-
};
|
|
14537
14752
|
const columnSorterIcon = (column) => {
|
|
14538
|
-
if (getColumnSorterState(
|
|
14753
|
+
if (getColumnSorterState(getColumnKey(column), props.sorterState) === 0) {
|
|
14539
14754
|
return vue.h('span', { class: 'opacity-25 float-end me-1' }, slots.sortingIcon && slots.sortingIcon());
|
|
14540
14755
|
}
|
|
14541
|
-
if (getColumnSorterState(
|
|
14756
|
+
if (getColumnSorterState(getColumnKey(column), props.sorterState) === 'asc') {
|
|
14542
14757
|
return vue.h('span', { class: 'float-end me-1' }, slots.sortingIconAscending && slots.sortingIconAscending());
|
|
14543
14758
|
}
|
|
14544
|
-
if (getColumnSorterState(
|
|
14759
|
+
if (getColumnSorterState(getColumnKey(column), props.sorterState) === 'desc') {
|
|
14545
14760
|
return vue.h('span', { class: 'float-end me-1' }, slots.sortingIconDescending && slots.sortingIconDescending());
|
|
14546
14761
|
}
|
|
14547
14762
|
return;
|
|
14548
14763
|
};
|
|
14549
|
-
const handleOnCustomFilterChange = (key, value) => {
|
|
14550
|
-
emit('customFilterChange', key, value);
|
|
14551
|
-
};
|
|
14552
|
-
const handleFilterInput = (key, value) => {
|
|
14553
|
-
emit('filterInput', key, value);
|
|
14554
|
-
};
|
|
14555
|
-
const handleFilterChange = (key, value) => {
|
|
14556
|
-
emit('filterChange', key, value);
|
|
14557
|
-
};
|
|
14558
|
-
const handleSelectAllChecked = () => {
|
|
14559
|
-
emit('selectAllChecked');
|
|
14560
|
-
};
|
|
14561
14764
|
return () => vue.h(props.component === 'head' ? CTableHead : CTableFoot, {}, {
|
|
14562
14765
|
default: () => [
|
|
14563
14766
|
vue.h(CTableRow, {}, {
|
|
14564
14767
|
default: () => [
|
|
14565
14768
|
props.selectable &&
|
|
14566
14769
|
vue.h(CTableHeaderCell, {}, () => vue.h(CFormCheck, {
|
|
14567
|
-
checked: typeof props.
|
|
14568
|
-
indeterminate: props.
|
|
14569
|
-
onChange: () =>
|
|
14770
|
+
checked: typeof props.selectedAll === 'boolean' ? props.selectAll : false,
|
|
14771
|
+
indeterminate: props.selectedAll === 'indeterminate' ? true : false,
|
|
14772
|
+
onChange: () => {
|
|
14773
|
+
emit('selectAllChecked');
|
|
14774
|
+
},
|
|
14570
14775
|
})),
|
|
14571
14776
|
props.columns.map((column, index) => vue.h(CTableHeaderCell, {
|
|
14572
|
-
...
|
|
14573
|
-
onClick: () =>
|
|
14574
|
-
|
|
14777
|
+
...getTableHeaderCellProps(column),
|
|
14778
|
+
onClick: () => {
|
|
14779
|
+
emit('sortClick', getColumnKey(column), index);
|
|
14780
|
+
},
|
|
14781
|
+
style: getTableHeaderCellStyles(column, props.columnSorter),
|
|
14575
14782
|
}, {
|
|
14576
14783
|
default: () => [
|
|
14577
14784
|
vue.h('div', {
|
|
14578
14785
|
class: 'd-inline',
|
|
14579
|
-
},
|
|
14786
|
+
}, getColumnLabel(column)),
|
|
14580
14787
|
props.columnSorter &&
|
|
14581
14788
|
(typeof column !== 'object'
|
|
14582
14789
|
? true
|
|
@@ -14593,7 +14800,7 @@ const CSmartTableHead = vue.defineComponent({
|
|
|
14593
14800
|
default: () => [
|
|
14594
14801
|
props.selectable && vue.h(CTableHeaderCell),
|
|
14595
14802
|
props.columns.map((column) => vue.h(CTableHeaderCell, {
|
|
14596
|
-
...
|
|
14803
|
+
...getTableHeaderCellProps(column),
|
|
14597
14804
|
}, {
|
|
14598
14805
|
default: () => (typeof column !== 'object'
|
|
14599
14806
|
? true
|
|
@@ -14601,15 +14808,21 @@ const CSmartTableHead = vue.defineComponent({
|
|
|
14601
14808
|
? true
|
|
14602
14809
|
: column.filter)
|
|
14603
14810
|
? typeof column !== 'string' && typeof column.filter === 'function'
|
|
14604
|
-
? column.filter(
|
|
14811
|
+
? column.filter(getColumnValues(props.items, getColumnKey(column)), (value) => {
|
|
14812
|
+
emit('customFilterChange', getColumnKey(column), value);
|
|
14813
|
+
})
|
|
14605
14814
|
: vue.h(CFormInput, {
|
|
14606
14815
|
size: 'sm',
|
|
14607
|
-
onInput: (event) =>
|
|
14608
|
-
|
|
14609
|
-
|
|
14816
|
+
onInput: (event) => {
|
|
14817
|
+
emit('filterInput', getColumnKey(column), event.target.value);
|
|
14818
|
+
},
|
|
14819
|
+
onChange: (event) => {
|
|
14820
|
+
emit('filterChange', event.target.value);
|
|
14821
|
+
},
|
|
14822
|
+
'aria-label': `column name: '${getColumnLabel(column)}' filter input`,
|
|
14610
14823
|
...(props.columnFilterValue &&
|
|
14611
|
-
props.columnFilterValue[
|
|
14612
|
-
value: props.columnFilterValue[
|
|
14824
|
+
props.columnFilterValue[getColumnKey(column)] && {
|
|
14825
|
+
value: props.columnFilterValue[getColumnKey(column)],
|
|
14613
14826
|
}),
|
|
14614
14827
|
})
|
|
14615
14828
|
: '',
|
|
@@ -14621,268 +14834,6 @@ const CSmartTableHead = vue.defineComponent({
|
|
|
14621
14834
|
},
|
|
14622
14835
|
});
|
|
14623
14836
|
|
|
14624
|
-
const CSmartTableFilterProps = {
|
|
14625
|
-
filterLabel: {
|
|
14626
|
-
type: String,
|
|
14627
|
-
require: false,
|
|
14628
|
-
default: 'Filter:',
|
|
14629
|
-
},
|
|
14630
|
-
filterPlaceholder: {
|
|
14631
|
-
type: String,
|
|
14632
|
-
require: false,
|
|
14633
|
-
default: 'type string...',
|
|
14634
|
-
},
|
|
14635
|
-
value: {
|
|
14636
|
-
type: [String, Number],
|
|
14637
|
-
require: false,
|
|
14638
|
-
default: '',
|
|
14639
|
-
},
|
|
14640
|
-
};
|
|
14641
|
-
const CSmartTableFilter = vue.defineComponent({
|
|
14642
|
-
name: 'CSmartTableFilter',
|
|
14643
|
-
props: CSmartTableFilterProps,
|
|
14644
|
-
emits: ['filterInput', 'filterChange'],
|
|
14645
|
-
setup(props, { emit }) {
|
|
14646
|
-
const handleFilterInput = (event) => {
|
|
14647
|
-
const target = event.target;
|
|
14648
|
-
emit('filterInput', target.value);
|
|
14649
|
-
};
|
|
14650
|
-
const handleFilterChange = (event) => {
|
|
14651
|
-
const target = event.target;
|
|
14652
|
-
emit('filterChange', target.value);
|
|
14653
|
-
};
|
|
14654
|
-
return () => vue.h('div', {
|
|
14655
|
-
class: 'row mb-2',
|
|
14656
|
-
}, {
|
|
14657
|
-
default: () => [
|
|
14658
|
-
vue.h(CFormLabel, {
|
|
14659
|
-
class: 'col-sm-auto col-form-label',
|
|
14660
|
-
}, {
|
|
14661
|
-
default: () => props.filterLabel,
|
|
14662
|
-
}),
|
|
14663
|
-
vue.h('div', {
|
|
14664
|
-
class: 'col-sm-auto',
|
|
14665
|
-
}, vue.h(CFormInput, {
|
|
14666
|
-
placeholder: props.filterPlaceholder,
|
|
14667
|
-
value: props.value,
|
|
14668
|
-
onInput: handleFilterInput,
|
|
14669
|
-
onChange: handleFilterChange,
|
|
14670
|
-
})),
|
|
14671
|
-
],
|
|
14672
|
-
});
|
|
14673
|
-
},
|
|
14674
|
-
});
|
|
14675
|
-
|
|
14676
|
-
const CSmartTableCleaner = vue.defineComponent({
|
|
14677
|
-
name: 'CSmartTableCleaner',
|
|
14678
|
-
props: {
|
|
14679
|
-
isFiltered: {
|
|
14680
|
-
type: String,
|
|
14681
|
-
default: undefined,
|
|
14682
|
-
required: false,
|
|
14683
|
-
},
|
|
14684
|
-
},
|
|
14685
|
-
emits: ['tableCleanerClick'],
|
|
14686
|
-
setup(props, { emit, slots }) {
|
|
14687
|
-
const handleClick = () => {
|
|
14688
|
-
emit('tableCleanerClick');
|
|
14689
|
-
};
|
|
14690
|
-
return () => vue.h('button', {
|
|
14691
|
-
type: 'button',
|
|
14692
|
-
class: 'btn btn-transparent',
|
|
14693
|
-
...(!props.isFiltered && { disabled: true, tabIndex: -1 }),
|
|
14694
|
-
onClick: handleClick,
|
|
14695
|
-
}, slots.cleanerIcon && slots.cleanerIcon());
|
|
14696
|
-
},
|
|
14697
|
-
});
|
|
14698
|
-
|
|
14699
|
-
const CSmartTableItemsPerPageSelector = vue.defineComponent({
|
|
14700
|
-
name: 'CSmartTableItemsPerPageSelector',
|
|
14701
|
-
props: {
|
|
14702
|
-
itemsPerPage: {
|
|
14703
|
-
type: Number,
|
|
14704
|
-
default: undefined,
|
|
14705
|
-
require: false,
|
|
14706
|
-
},
|
|
14707
|
-
itemsPerPageLabel: {
|
|
14708
|
-
type: String,
|
|
14709
|
-
default: undefined,
|
|
14710
|
-
require: false,
|
|
14711
|
-
},
|
|
14712
|
-
itemsPerPageOptions: {
|
|
14713
|
-
type: Array,
|
|
14714
|
-
default: () => [],
|
|
14715
|
-
require: false,
|
|
14716
|
-
},
|
|
14717
|
-
},
|
|
14718
|
-
emits: ['changeItemsPerPage'],
|
|
14719
|
-
setup(props, { emit }) {
|
|
14720
|
-
const handleChange = (event) => {
|
|
14721
|
-
const target = event.target;
|
|
14722
|
-
emit('changeItemsPerPage', Number(target.value));
|
|
14723
|
-
};
|
|
14724
|
-
return () => vue.h('div', {
|
|
14725
|
-
class: 'row',
|
|
14726
|
-
}, {
|
|
14727
|
-
default: () => [
|
|
14728
|
-
vue.h(CFormLabel, {
|
|
14729
|
-
class: 'col-auto col-form-label',
|
|
14730
|
-
}, {
|
|
14731
|
-
default: () => props.itemsPerPageLabel,
|
|
14732
|
-
}),
|
|
14733
|
-
vue.h('div', {
|
|
14734
|
-
class: 'col-auto',
|
|
14735
|
-
}, vue.h(CFormSelect, {
|
|
14736
|
-
value: props.itemsPerPage,
|
|
14737
|
-
onChange: handleChange,
|
|
14738
|
-
}, {
|
|
14739
|
-
default: () => props.itemsPerPageOptions &&
|
|
14740
|
-
props.itemsPerPageOptions.map((number, index) => {
|
|
14741
|
-
return vue.h('option', {
|
|
14742
|
-
value: number,
|
|
14743
|
-
key: index,
|
|
14744
|
-
}, number);
|
|
14745
|
-
}),
|
|
14746
|
-
})),
|
|
14747
|
-
],
|
|
14748
|
-
});
|
|
14749
|
-
},
|
|
14750
|
-
});
|
|
14751
|
-
|
|
14752
|
-
const CIcon = vue.defineComponent({
|
|
14753
|
-
name: 'CIcon',
|
|
14754
|
-
props: {
|
|
14755
|
-
/**
|
|
14756
|
-
* Use `:icon="..."` instead of
|
|
14757
|
-
*
|
|
14758
|
-
* @deprecated since version 3.0
|
|
14759
|
-
*/
|
|
14760
|
-
content: {
|
|
14761
|
-
type: [String, Array],
|
|
14762
|
-
default: undefined,
|
|
14763
|
-
required: false,
|
|
14764
|
-
},
|
|
14765
|
-
/**
|
|
14766
|
-
* Use for replacing default CIcon component classes. Prop is overriding the 'size' prop.
|
|
14767
|
-
*/
|
|
14768
|
-
customClassName: {
|
|
14769
|
-
type: [String, Array, Object],
|
|
14770
|
-
default: undefined,
|
|
14771
|
-
required: false,
|
|
14772
|
-
},
|
|
14773
|
-
/**
|
|
14774
|
-
* Name of the icon placed in React object or SVG content.
|
|
14775
|
-
*/
|
|
14776
|
-
icon: {
|
|
14777
|
-
type: [String, Array],
|
|
14778
|
-
default: undefined,
|
|
14779
|
-
required: false,
|
|
14780
|
-
},
|
|
14781
|
-
/**
|
|
14782
|
-
* Use `icon="..."` instead of
|
|
14783
|
-
*
|
|
14784
|
-
* @deprecated since version 3.0
|
|
14785
|
-
*/
|
|
14786
|
-
name: {
|
|
14787
|
-
type: String,
|
|
14788
|
-
default: undefined,
|
|
14789
|
-
required: false,
|
|
14790
|
-
},
|
|
14791
|
-
/**
|
|
14792
|
-
* Size of the icon. Available sizes: 'sm', 'lg', 'xl', 'xxl', '3xl...9xl', 'custom', 'custom-size'.
|
|
14793
|
-
*/
|
|
14794
|
-
size: {
|
|
14795
|
-
type: String,
|
|
14796
|
-
default: undefined,
|
|
14797
|
-
required: false,
|
|
14798
|
-
validator: (value) => {
|
|
14799
|
-
return [
|
|
14800
|
-
'custom',
|
|
14801
|
-
'custom-size',
|
|
14802
|
-
'sm',
|
|
14803
|
-
'lg',
|
|
14804
|
-
'xl',
|
|
14805
|
-
'xxl',
|
|
14806
|
-
'3xl',
|
|
14807
|
-
'4xl',
|
|
14808
|
-
'5xl',
|
|
14809
|
-
'6xl',
|
|
14810
|
-
'7xl',
|
|
14811
|
-
'8xl',
|
|
14812
|
-
'9xl',
|
|
14813
|
-
].includes(value);
|
|
14814
|
-
},
|
|
14815
|
-
},
|
|
14816
|
-
/**
|
|
14817
|
-
* Title tag content.
|
|
14818
|
-
*/
|
|
14819
|
-
title: {
|
|
14820
|
-
type: String,
|
|
14821
|
-
default: undefined,
|
|
14822
|
-
required: false,
|
|
14823
|
-
},
|
|
14824
|
-
/**
|
|
14825
|
-
* If defined component will be rendered using 'use' tag.
|
|
14826
|
-
*/
|
|
14827
|
-
use: {
|
|
14828
|
-
type: String,
|
|
14829
|
-
default: undefined,
|
|
14830
|
-
required: false,
|
|
14831
|
-
},
|
|
14832
|
-
},
|
|
14833
|
-
setup(props, { attrs }) {
|
|
14834
|
-
const icons = vue.inject('icons');
|
|
14835
|
-
const _icon = props.icon || props.content || props.name;
|
|
14836
|
-
const toCamelCase = (str) => {
|
|
14837
|
-
return str
|
|
14838
|
-
.replace(/([-_][a-z0-9])/gi, ($1) => {
|
|
14839
|
-
return $1.toUpperCase();
|
|
14840
|
-
})
|
|
14841
|
-
.replace(/-/gi, '');
|
|
14842
|
-
};
|
|
14843
|
-
const iconName = vue.computed(() => _icon && typeof _icon === 'string' ? (_icon.includes('-') ? toCamelCase(_icon) : _icon) : '');
|
|
14844
|
-
const titleCode = props.title ? `<title>${props.title}</title>` : 'undefined';
|
|
14845
|
-
const code = vue.computed(() => Array.isArray(_icon)
|
|
14846
|
-
? _icon
|
|
14847
|
-
: typeof _icon === 'string' && iconName.value && icons[iconName.value]
|
|
14848
|
-
? icons[iconName.value]
|
|
14849
|
-
: 'undefined');
|
|
14850
|
-
const iconCode = Array.isArray(code.value) ? code.value[1] || code.value[0] : code.value;
|
|
14851
|
-
const scale = Array.isArray(code.value) && code.value.length > 1 ? code.value[0] : '64 64';
|
|
14852
|
-
const viewBox = attrs.viewBox || `0 0 ${scale}`;
|
|
14853
|
-
const size = () => {
|
|
14854
|
-
const addCustom = !props.size && (attrs.width || attrs.height);
|
|
14855
|
-
return props.size === 'custom' || addCustom ? 'custom-size' : props.size;
|
|
14856
|
-
};
|
|
14857
|
-
const classNames = (() => {
|
|
14858
|
-
return [props.customClassName || ['icon', { [`icon-${size()}`]: size() }], attrs.class];
|
|
14859
|
-
})();
|
|
14860
|
-
return () => props.use
|
|
14861
|
-
? vue.h('svg', {
|
|
14862
|
-
...attrs,
|
|
14863
|
-
xmlns: 'http://www.w3.org/2000/svg',
|
|
14864
|
-
class: classNames,
|
|
14865
|
-
role: 'img',
|
|
14866
|
-
}, vue.h('use', { href: props.use }))
|
|
14867
|
-
: vue.h('svg', {
|
|
14868
|
-
...attrs,
|
|
14869
|
-
xmlns: 'http://www.w3.org/2000/svg',
|
|
14870
|
-
class: classNames,
|
|
14871
|
-
viewBox: viewBox,
|
|
14872
|
-
innerHTML: `${titleCode}${iconCode}`,
|
|
14873
|
-
role: 'img',
|
|
14874
|
-
});
|
|
14875
|
-
},
|
|
14876
|
-
});
|
|
14877
|
-
|
|
14878
|
-
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'/>"];
|
|
14879
|
-
|
|
14880
|
-
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'/>"];
|
|
14881
|
-
|
|
14882
|
-
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'/>"];
|
|
14883
|
-
|
|
14884
|
-
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'/>"];
|
|
14885
|
-
|
|
14886
14837
|
const CSmartTable = vue.defineComponent({
|
|
14887
14838
|
name: 'CSmartTable',
|
|
14888
14839
|
props: {
|
|
@@ -14892,7 +14843,6 @@ const CSmartTable = vue.defineComponent({
|
|
|
14892
14843
|
activePage: {
|
|
14893
14844
|
type: Number,
|
|
14894
14845
|
default: 1,
|
|
14895
|
-
required: false,
|
|
14896
14846
|
},
|
|
14897
14847
|
/**
|
|
14898
14848
|
* When set, displays table cleaner above table, next to the table filter (or in place of table filter if `tableFilter` prop is not set)
|
|
@@ -14901,14 +14851,12 @@ const CSmartTable = vue.defineComponent({
|
|
|
14901
14851
|
*/
|
|
14902
14852
|
cleaner: {
|
|
14903
14853
|
type: Boolean,
|
|
14904
|
-
required: false,
|
|
14905
14854
|
},
|
|
14906
14855
|
/**
|
|
14907
14856
|
* Style table items as clickable.
|
|
14908
14857
|
*/
|
|
14909
14858
|
clickableRows: {
|
|
14910
14859
|
type: Boolean,
|
|
14911
|
-
required: false,
|
|
14912
14860
|
},
|
|
14913
14861
|
/**
|
|
14914
14862
|
* When set, displays additional filter row between table header and items, allowing filtering by specific column.
|
|
@@ -14918,7 +14866,6 @@ const CSmartTable = vue.defineComponent({
|
|
|
14918
14866
|
*/
|
|
14919
14867
|
columnFilter: {
|
|
14920
14868
|
type: [Boolean, Object],
|
|
14921
|
-
required: false,
|
|
14922
14869
|
},
|
|
14923
14870
|
/**
|
|
14924
14871
|
* Value of table filter. To set pass object where keys are column names and values are filter strings e.g.:
|
|
@@ -14926,8 +14873,6 @@ const CSmartTable = vue.defineComponent({
|
|
|
14926
14873
|
*/
|
|
14927
14874
|
columnFilterValue: {
|
|
14928
14875
|
type: Object,
|
|
14929
|
-
default: undefined,
|
|
14930
|
-
required: false,
|
|
14931
14876
|
},
|
|
14932
14877
|
/**
|
|
14933
14878
|
* 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')
|
|
@@ -14944,7 +14889,6 @@ const CSmartTable = vue.defineComponent({
|
|
|
14944
14889
|
*/
|
|
14945
14890
|
columns: {
|
|
14946
14891
|
type: Array,
|
|
14947
|
-
required: false,
|
|
14948
14892
|
},
|
|
14949
14893
|
/**
|
|
14950
14894
|
* 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.
|
|
@@ -14955,8 +14899,6 @@ const CSmartTable = vue.defineComponent({
|
|
|
14955
14899
|
*/
|
|
14956
14900
|
columnSorter: {
|
|
14957
14901
|
type: [Boolean, Object],
|
|
14958
|
-
default: undefined,
|
|
14959
|
-
required: false,
|
|
14960
14902
|
},
|
|
14961
14903
|
/**
|
|
14962
14904
|
* If `true` Displays table footer, which mirrors table header. (without column filter).
|
|
@@ -14969,14 +14911,12 @@ const CSmartTable = vue.defineComponent({
|
|
|
14969
14911
|
*/
|
|
14970
14912
|
footer: {
|
|
14971
14913
|
type: [Boolean, Array],
|
|
14972
|
-
required: false,
|
|
14973
14914
|
},
|
|
14974
14915
|
/**
|
|
14975
14916
|
* Set to false to remove table header.
|
|
14976
14917
|
*/
|
|
14977
14918
|
header: {
|
|
14978
14919
|
type: Boolean,
|
|
14979
|
-
required: false,
|
|
14980
14920
|
default: true,
|
|
14981
14921
|
},
|
|
14982
14922
|
/**
|
|
@@ -14989,22 +14929,25 @@ const CSmartTable = vue.defineComponent({
|
|
|
14989
14929
|
items: {
|
|
14990
14930
|
type: Array,
|
|
14991
14931
|
default: () => [],
|
|
14992
|
-
required: false,
|
|
14993
14932
|
},
|
|
14933
|
+
/**
|
|
14934
|
+
* 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.
|
|
14935
|
+
*
|
|
14936
|
+
* @since 4.8.0
|
|
14937
|
+
*/
|
|
14938
|
+
itemsNumber: Number,
|
|
14994
14939
|
/**
|
|
14995
14940
|
* Number of items per site, when pagination is enabled.
|
|
14996
14941
|
*/
|
|
14997
14942
|
itemsPerPage: {
|
|
14998
14943
|
type: Number,
|
|
14999
14944
|
default: 10,
|
|
15000
|
-
required: false,
|
|
15001
14945
|
},
|
|
15002
14946
|
/**
|
|
15003
14947
|
* Label for items per page selector.
|
|
15004
14948
|
*/
|
|
15005
14949
|
itemsPerPageLabel: {
|
|
15006
14950
|
type: String,
|
|
15007
|
-
required: false,
|
|
15008
14951
|
default: 'Items per page:',
|
|
15009
14952
|
},
|
|
15010
14953
|
/**
|
|
@@ -15013,7 +14956,6 @@ const CSmartTable = vue.defineComponent({
|
|
|
15013
14956
|
itemsPerPageOptions: {
|
|
15014
14957
|
type: Array,
|
|
15015
14958
|
default: () => [5, 10, 20, 50],
|
|
15016
|
-
required: false,
|
|
15017
14959
|
},
|
|
15018
14960
|
/**
|
|
15019
14961
|
* 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:
|
|
@@ -15023,15 +14965,12 @@ const CSmartTable = vue.defineComponent({
|
|
|
15023
14965
|
*/
|
|
15024
14966
|
itemsPerPageSelect: {
|
|
15025
14967
|
type: [Boolean, Object],
|
|
15026
|
-
default: undefined,
|
|
15027
|
-
required: false,
|
|
15028
14968
|
},
|
|
15029
14969
|
/**
|
|
15030
14970
|
* When set, table will have loading style: loading spinner and reduced opacity. When 'small' prop is enabled spinner will be also smaller.
|
|
15031
14971
|
*/
|
|
15032
14972
|
loading: {
|
|
15033
14973
|
type: Boolean,
|
|
15034
|
-
required: false,
|
|
15035
14974
|
},
|
|
15036
14975
|
/**
|
|
15037
14976
|
* ReactNode or string for passing custom noItemsLabel texts.
|
|
@@ -15039,51 +14978,63 @@ const CSmartTable = vue.defineComponent({
|
|
|
15039
14978
|
noItemsLabel: {
|
|
15040
14979
|
type: String,
|
|
15041
14980
|
default: 'No items found',
|
|
15042
|
-
required: false,
|
|
15043
14981
|
},
|
|
15044
14982
|
/**
|
|
15045
14983
|
* 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.
|
|
15046
14984
|
*/
|
|
15047
14985
|
pagination: {
|
|
15048
14986
|
type: [Boolean, Object],
|
|
15049
|
-
required: false,
|
|
15050
14987
|
},
|
|
15051
14988
|
/**
|
|
15052
14989
|
* Properties to [CSmartPagination](https://coreui.io/vue/docs/components/smart-pagination#csmartpagination) component.
|
|
15053
14990
|
*/
|
|
15054
14991
|
paginationProps: {
|
|
15055
14992
|
type: Object,
|
|
15056
|
-
default: undefined,
|
|
15057
|
-
required: false,
|
|
15058
14993
|
},
|
|
15059
14994
|
/**
|
|
15060
14995
|
* Add checkboxes to make table rows selectable.
|
|
15061
14996
|
*/
|
|
15062
14997
|
selectable: Boolean,
|
|
14998
|
+
/**
|
|
14999
|
+
* Enables select all checkbox displayed in the header of the table.
|
|
15000
|
+
*
|
|
15001
|
+
* Can be customized, by passing prop as object with additional options as keys. Available options:
|
|
15002
|
+
* - external (Boolean) - Disables automatic selection inside the component.
|
|
15003
|
+
*
|
|
15004
|
+
* @since 4.8.0
|
|
15005
|
+
*/
|
|
15006
|
+
selectAll: {
|
|
15007
|
+
type: [Boolean, Object],
|
|
15008
|
+
},
|
|
15009
|
+
/**
|
|
15010
|
+
* Array of selected objects, where each object represents one item - row in table.
|
|
15011
|
+
*
|
|
15012
|
+
* Example item: `{ name: 'John' , age: 12 }`
|
|
15013
|
+
*
|
|
15014
|
+
* @since 4.8.0
|
|
15015
|
+
*/
|
|
15016
|
+
selected: {
|
|
15017
|
+
type: Array,
|
|
15018
|
+
default: () => [],
|
|
15019
|
+
},
|
|
15063
15020
|
/**
|
|
15064
15021
|
* State of the sorter. Name key is column name, direction can be 'asc' or 'desc'. eg.:
|
|
15065
15022
|
* { column: 'status', state: 'asc' }
|
|
15066
15023
|
*/
|
|
15067
15024
|
sorterValue: {
|
|
15068
15025
|
type: Object,
|
|
15069
|
-
default: undefined,
|
|
15070
|
-
required: false,
|
|
15071
15026
|
},
|
|
15072
15027
|
/**
|
|
15073
15028
|
* Properties to [CTableBody](https://coreui.io/vue/docs/components/table/#ctablebody) component.
|
|
15074
15029
|
*/
|
|
15075
15030
|
tableBodyProps: {
|
|
15076
15031
|
type: Object,
|
|
15077
|
-
default: undefined,
|
|
15078
|
-
required: false,
|
|
15079
15032
|
},
|
|
15080
15033
|
/**
|
|
15081
15034
|
* Properties to [CTableFoot](https://coreui.io/vue/docs/components/table/#ctablefoot) component.
|
|
15082
15035
|
*/
|
|
15083
15036
|
tableFootProps: {
|
|
15084
15037
|
type: Object,
|
|
15085
|
-
default: undefined,
|
|
15086
|
-
required: false,
|
|
15087
15038
|
},
|
|
15088
15039
|
/**
|
|
15089
15040
|
* When set, displays table filter above table, allowing filtering by specific column.
|
|
@@ -15094,7 +15045,6 @@ const CSmartTable = vue.defineComponent({
|
|
|
15094
15045
|
*/
|
|
15095
15046
|
tableFilter: {
|
|
15096
15047
|
type: [Boolean, Object],
|
|
15097
|
-
required: false,
|
|
15098
15048
|
},
|
|
15099
15049
|
/**
|
|
15100
15050
|
* The element represents a caption for a component.
|
|
@@ -15102,7 +15052,6 @@ const CSmartTable = vue.defineComponent({
|
|
|
15102
15052
|
tableFilterLabel: {
|
|
15103
15053
|
type: String,
|
|
15104
15054
|
default: 'Filter:',
|
|
15105
|
-
required: false,
|
|
15106
15055
|
},
|
|
15107
15056
|
/**
|
|
15108
15057
|
* Specifies a short hint that is visible in the search input.
|
|
@@ -15110,31 +15059,24 @@ const CSmartTable = vue.defineComponent({
|
|
|
15110
15059
|
tableFilterPlaceholder: {
|
|
15111
15060
|
type: String,
|
|
15112
15061
|
default: 'type string...',
|
|
15113
|
-
required: false,
|
|
15114
15062
|
},
|
|
15115
15063
|
/**
|
|
15116
15064
|
* Value of table filter.
|
|
15117
15065
|
*/
|
|
15118
15066
|
tableFilterValue: {
|
|
15119
15067
|
type: String,
|
|
15120
|
-
default: undefined,
|
|
15121
|
-
required: false,
|
|
15122
15068
|
},
|
|
15123
15069
|
/**
|
|
15124
15070
|
* Properties to [CTableHead](https://coreui.io/vue/docs/components/table/#ctablehead) component.
|
|
15125
15071
|
*/
|
|
15126
15072
|
tableHeadProps: {
|
|
15127
15073
|
type: Object,
|
|
15128
|
-
default: undefined,
|
|
15129
|
-
required: false,
|
|
15130
15074
|
},
|
|
15131
15075
|
/**
|
|
15132
15076
|
* Properties to [CTable](https://coreui.io/vue/docs/components/table/#ctable) component.
|
|
15133
15077
|
*/
|
|
15134
15078
|
tableProps: {
|
|
15135
15079
|
type: Object,
|
|
15136
|
-
default: undefined,
|
|
15137
|
-
required: false,
|
|
15138
15080
|
},
|
|
15139
15081
|
},
|
|
15140
15082
|
emits: [
|
|
@@ -15171,6 +15113,12 @@ const CSmartTable = vue.defineComponent({
|
|
|
15171
15113
|
* @property {event} event
|
|
15172
15114
|
*/
|
|
15173
15115
|
'rowClick',
|
|
15116
|
+
/**
|
|
15117
|
+
* Select all callback.
|
|
15118
|
+
*
|
|
15119
|
+
* @since 4.8.0
|
|
15120
|
+
*/
|
|
15121
|
+
'selectAll',
|
|
15174
15122
|
/**
|
|
15175
15123
|
* Selected items change callback.
|
|
15176
15124
|
*
|
|
@@ -15191,66 +15139,90 @@ const CSmartTable = vue.defineComponent({
|
|
|
15191
15139
|
'tableFilterChange',
|
|
15192
15140
|
],
|
|
15193
15141
|
setup(props, { emit, slots }) {
|
|
15194
|
-
|
|
15142
|
+
const activePage = vue.ref(props.activePage);
|
|
15143
|
+
const columnFilterState = vue.ref(props.columnFilterValue ? props.columnFilterValue : {});
|
|
15195
15144
|
const items = vue.ref(props.items.map((item, index) => {
|
|
15196
15145
|
return { ...item, _id: index };
|
|
15197
15146
|
}));
|
|
15147
|
+
const itemsNumber = vue.ref(props.itemsNumber);
|
|
15148
|
+
const itemsPerPage = vue.ref(props.itemsPerPage || items.value.length);
|
|
15149
|
+
const selected = vue.ref([]);
|
|
15150
|
+
const selectedAll = vue.ref();
|
|
15151
|
+
const sorterState = vue.ref(props.sorterValue || {});
|
|
15152
|
+
const tableFilterState = vue.ref(props.tableFilterValue ? props.tableFilterValue : '');
|
|
15153
|
+
vue.watch(() => props.activePage, () => {
|
|
15154
|
+
activePage.value = props.activePage;
|
|
15155
|
+
});
|
|
15156
|
+
vue.watch(() => props.columnFilterValue, () => {
|
|
15157
|
+
if (props.columnFilterValue) {
|
|
15158
|
+
columnFilterState.value = props.columnFilterValue;
|
|
15159
|
+
}
|
|
15160
|
+
});
|
|
15198
15161
|
vue.watch(() => props.items, () => {
|
|
15199
|
-
|
|
15200
|
-
|
|
15201
|
-
});
|
|
15202
|
-
if (items.value &&
|
|
15203
|
-
items.value.length < itemsPerPage.value * activePage.value - itemsPerPage.value) {
|
|
15162
|
+
if (props.items &&
|
|
15163
|
+
props.items.length < itemsPerPage.value * activePage.value - itemsPerPage.value) {
|
|
15204
15164
|
activePage.value = 1;
|
|
15205
15165
|
}
|
|
15166
|
+
props.items.forEach((item) => {
|
|
15167
|
+
if (item._selected) {
|
|
15168
|
+
const _item = { ...item };
|
|
15169
|
+
delete _item['_cellProps'];
|
|
15170
|
+
delete _item['_props'];
|
|
15171
|
+
delete _item['_selected'];
|
|
15172
|
+
selected.value = [...selected.value, _item];
|
|
15173
|
+
}
|
|
15174
|
+
});
|
|
15175
|
+
if (Array.isArray(props.items)) {
|
|
15176
|
+
items.value = props.items;
|
|
15177
|
+
itemsNumber.value = props.itemsNumber || props.items.length;
|
|
15178
|
+
}
|
|
15206
15179
|
});
|
|
15207
|
-
|
|
15208
|
-
|
|
15209
|
-
|
|
15180
|
+
vue.watch(() => props.itemsNumber, () => {
|
|
15181
|
+
itemsNumber.value = props.itemsNumber;
|
|
15182
|
+
});
|
|
15183
|
+
vue.watch(() => props.itemsPerPage, () => {
|
|
15184
|
+
itemsPerPage.value = props.itemsPerPage;
|
|
15185
|
+
});
|
|
15186
|
+
vue.watch(() => props.selected, () => {
|
|
15187
|
+
selected.value = props.selected;
|
|
15188
|
+
});
|
|
15189
|
+
vue.watch(() => props.sorterValue, () => {
|
|
15190
|
+
if (props.sorterValue) {
|
|
15191
|
+
sorterState.value = props.sorterValue;
|
|
15192
|
+
}
|
|
15193
|
+
});
|
|
15194
|
+
vue.watch(itemsPerPage, () => {
|
|
15195
|
+
if (props.itemsPerPage !== itemsPerPage.value) {
|
|
15196
|
+
activePage.value = 1; // TODO: set proper page after _itemsPerPage update
|
|
15197
|
+
}
|
|
15198
|
+
emit('itemsPerPageChange', itemsPerPage.value);
|
|
15199
|
+
});
|
|
15200
|
+
vue.watch([selected, itemsNumber], () => {
|
|
15210
15201
|
emit('selectedItemsChange', selected);
|
|
15211
|
-
if (selected.length ===
|
|
15202
|
+
if (selected.value.length === itemsNumber.value) {
|
|
15212
15203
|
selectedAll.value = true;
|
|
15213
15204
|
return;
|
|
15214
15205
|
}
|
|
15215
|
-
if (selected.length === 0) {
|
|
15206
|
+
if (selected.value.length === 0) {
|
|
15216
15207
|
selectedAll.value = false;
|
|
15217
15208
|
return;
|
|
15218
15209
|
}
|
|
15219
|
-
if (selected.length !== 0 && selected.length !==
|
|
15210
|
+
if (selected.value.length !== 0 && selected.value.length !== itemsNumber.value) {
|
|
15220
15211
|
selectedAll.value = 'indeterminate';
|
|
15221
15212
|
}
|
|
15222
15213
|
});
|
|
15223
|
-
const itemsPerPage = vue.ref(props.itemsPerPage || items.value.length);
|
|
15224
|
-
const activePage = vue.ref(props.activePage);
|
|
15225
|
-
const sorterState = vue.reactive(props.sorterValue || {});
|
|
15226
|
-
const columnFilterState = vue.ref(props.columnFilterValue ? props.columnFilterValue : {});
|
|
15227
|
-
const tableFilterState = vue.ref(props.tableFilterValue ? props.tableFilterValue : '');
|
|
15228
15214
|
vue.onMounted(() => {
|
|
15229
15215
|
if (items.value &&
|
|
15230
15216
|
items.value.length < itemsPerPage.value * activePage.value - itemsPerPage.value) {
|
|
15231
15217
|
activePage.value = 1;
|
|
15232
15218
|
}
|
|
15233
15219
|
});
|
|
15234
|
-
|
|
15235
|
-
|
|
15236
|
-
const isSortable = (i) => {
|
|
15237
|
-
const isDataColumn = itemsDataColumns.value.includes(rawColumnNames.value[i]);
|
|
15238
|
-
let column;
|
|
15239
|
-
if (props.columns)
|
|
15240
|
-
column = props.columns[i];
|
|
15241
|
-
return (props.columnSorter &&
|
|
15242
|
-
(!props.columns ||
|
|
15243
|
-
typeof column !== 'object' ||
|
|
15244
|
-
(typeof column === 'object' &&
|
|
15245
|
-
(typeof column.sorter === 'undefined' || column.sorter))) &&
|
|
15246
|
-
isDataColumn);
|
|
15247
|
-
};
|
|
15248
|
-
const sorterChange = (column, index) => {
|
|
15249
|
-
if (!isSortable(index)) {
|
|
15220
|
+
const handleSorterChange = (column, index) => {
|
|
15221
|
+
if (!isSortable(index, props.columns, props.columnSorter, itemsDataColumns.value, columnNames.value)) {
|
|
15250
15222
|
return;
|
|
15251
15223
|
}
|
|
15252
15224
|
//if column changed or sort was descending change asc to true
|
|
15253
|
-
const state = sorterState;
|
|
15225
|
+
const state = sorterState.value;
|
|
15254
15226
|
if (state.column === column) {
|
|
15255
15227
|
if (state.state === 0) {
|
|
15256
15228
|
state.state = 'asc';
|
|
@@ -15271,40 +15243,47 @@ const CSmartTable = vue.defineComponent({
|
|
|
15271
15243
|
state.column = column;
|
|
15272
15244
|
state.state = 'asc';
|
|
15273
15245
|
}
|
|
15274
|
-
sorterState.column = state.column;
|
|
15275
|
-
sorterState.state = state.state;
|
|
15276
|
-
emit('sorterChange', sorterState);
|
|
15246
|
+
sorterState.value.column = state.column;
|
|
15247
|
+
sorterState.value.state = state.state;
|
|
15248
|
+
emit('sorterChange', sorterState.value);
|
|
15277
15249
|
};
|
|
15278
15250
|
const handleActivePageChange = (page) => {
|
|
15279
15251
|
activePage.value = page;
|
|
15280
15252
|
emit('activePageChange', page);
|
|
15281
15253
|
};
|
|
15282
|
-
const handleItemsPerPageChange = (
|
|
15283
|
-
|
|
15284
|
-
|
|
15285
|
-
|
|
15286
|
-
|
|
15287
|
-
const handleRowChecked = (id, value) => {
|
|
15288
|
-
const newArr = [...items.value];
|
|
15289
|
-
newArr[id]._selected = value;
|
|
15290
|
-
items.value = newArr;
|
|
15254
|
+
const handleItemsPerPageChange = (event) => {
|
|
15255
|
+
if (typeof props.itemsPerPageSelect !== 'object' ||
|
|
15256
|
+
(typeof props.itemsPerPageSelect === 'object' && !props.itemsPerPageSelect.external)) {
|
|
15257
|
+
itemsPerPage.value = Number(event.target.value);
|
|
15258
|
+
}
|
|
15291
15259
|
};
|
|
15292
|
-
const
|
|
15293
|
-
|
|
15260
|
+
const handleRowChecked = (item, value) => {
|
|
15261
|
+
if (value && !isObjectInArray(selected.value, item, ['_cellProps', '_props', '_selected'])) {
|
|
15262
|
+
selected.value = [...selected.value, item];
|
|
15263
|
+
return;
|
|
15264
|
+
}
|
|
15265
|
+
selected.value = selected.value.filter((_item) => !isObjectInArray([_item], item, ['_cellProps', '_props', '_selected']));
|
|
15294
15266
|
};
|
|
15295
15267
|
const handleSelectAllChecked = () => {
|
|
15296
15268
|
if (selectedAll.value === true) {
|
|
15297
|
-
|
|
15298
|
-
|
|
15299
|
-
|
|
15269
|
+
selected.value = [];
|
|
15270
|
+
return;
|
|
15271
|
+
}
|
|
15272
|
+
emit('selectAll');
|
|
15273
|
+
if (props.selectAll && typeof props.selectAll === 'object' && props.selectAll.external) {
|
|
15300
15274
|
return;
|
|
15301
15275
|
}
|
|
15302
|
-
|
|
15303
|
-
|
|
15276
|
+
selected.value = items.value.map((item) => {
|
|
15277
|
+
delete item['_cellProps'];
|
|
15278
|
+
delete item['_props'];
|
|
15279
|
+
delete item['_selected'];
|
|
15280
|
+
return item;
|
|
15304
15281
|
});
|
|
15305
15282
|
};
|
|
15306
|
-
const
|
|
15307
|
-
const _isLazy =
|
|
15283
|
+
const handleColumnFilterChange = (colName, value, type) => {
|
|
15284
|
+
const _isLazy = props.columnFilter &&
|
|
15285
|
+
typeof props.columnFilter === 'object' &&
|
|
15286
|
+
props.columnFilter.lazy === true;
|
|
15308
15287
|
if ((_isLazy && type === 'input') || (!_isLazy && type === 'change')) {
|
|
15309
15288
|
return;
|
|
15310
15289
|
}
|
|
@@ -15312,98 +15291,32 @@ const CSmartTable = vue.defineComponent({
|
|
|
15312
15291
|
columnFilterState.value = { ...columnFilterState.value, [`${colName}`]: value };
|
|
15313
15292
|
emit('columnFilterChange', columnFilterState.value);
|
|
15314
15293
|
};
|
|
15315
|
-
const
|
|
15316
|
-
const _isLazy =
|
|
15294
|
+
const handleTableFilterChange = (value, type) => {
|
|
15295
|
+
const _isLazy = props.columnFilter &&
|
|
15296
|
+
typeof props.columnFilter === 'object' &&
|
|
15297
|
+
props.columnFilter.lazy === true;
|
|
15317
15298
|
if ((_isLazy && type === 'input') || (!_isLazy && type === 'change')) {
|
|
15318
15299
|
return;
|
|
15319
15300
|
}
|
|
15320
15301
|
activePage.value = 1;
|
|
15321
15302
|
tableFilterState.value = value;
|
|
15322
|
-
emit('tableFilterChange', tableFilterState);
|
|
15303
|
+
emit('tableFilterChange', tableFilterState.value);
|
|
15323
15304
|
};
|
|
15324
|
-
const
|
|
15305
|
+
const handleClean = () => {
|
|
15325
15306
|
tableFilterState.value = '';
|
|
15326
15307
|
columnFilterState.value = {};
|
|
15327
|
-
sorterState.
|
|
15328
|
-
sorterState.state = '';
|
|
15308
|
+
sorterState.value = {};
|
|
15329
15309
|
};
|
|
15330
|
-
|
|
15331
|
-
const
|
|
15332
|
-
const
|
|
15333
|
-
|
|
15334
|
-
|
|
15335
|
-
return column.key;
|
|
15336
|
-
else
|
|
15337
|
-
return column;
|
|
15338
|
-
})
|
|
15339
|
-
: genCols.value); //! || el
|
|
15340
|
-
const itemsDataColumns = vue.computed(() => rawColumnNames.value.filter((name) => genCols.value.includes(name)));
|
|
15341
|
-
// variables
|
|
15342
|
-
const filteredColumns = vue.computed(() => {
|
|
15343
|
-
let _items = items.value;
|
|
15344
|
-
if (props.columnFilter &&
|
|
15345
|
-
typeof props.columnFilter === 'object' &&
|
|
15346
|
-
props.columnFilter.external) {
|
|
15347
|
-
return _items;
|
|
15348
|
-
}
|
|
15349
|
-
Object.entries(columnFilterState.value).forEach(([key, value]) => {
|
|
15350
|
-
if (value instanceof Function) {
|
|
15351
|
-
_items = _items.filter((item) => value(item[key]));
|
|
15352
|
-
return;
|
|
15353
|
-
}
|
|
15354
|
-
const columnFilter = String(value).toLowerCase();
|
|
15355
|
-
if (columnFilter && itemsDataColumns.value.includes(key)) {
|
|
15356
|
-
_items = _items.filter((item) => {
|
|
15357
|
-
return String(item[key]).toLowerCase().includes(columnFilter);
|
|
15358
|
-
});
|
|
15359
|
-
}
|
|
15360
|
-
});
|
|
15361
|
-
return _items;
|
|
15362
|
-
});
|
|
15363
|
-
const filteredTable = vue.computed(() => {
|
|
15364
|
-
let items = filteredColumns.value;
|
|
15365
|
-
if (!tableFilterState.value ||
|
|
15366
|
-
(props.tableFilter && typeof props.tableFilter === 'object' && props.tableFilter.external)) {
|
|
15367
|
-
return items;
|
|
15368
|
-
}
|
|
15369
|
-
const filter = tableFilterState.value.toLowerCase();
|
|
15370
|
-
const valueContainFilter = (val) => String(val).toLowerCase().includes(filter);
|
|
15371
|
-
items = items.filter((item) => {
|
|
15372
|
-
return !!itemsDataColumns.value.find((key) => valueContainFilter(item[key]));
|
|
15373
|
-
});
|
|
15374
|
-
emit('filteredItemsChange', items);
|
|
15375
|
-
return items;
|
|
15376
|
-
});
|
|
15377
|
-
const sortedItems = vue.computed(() => {
|
|
15378
|
-
const col = sorterState.column;
|
|
15379
|
-
if (!col ||
|
|
15380
|
-
!itemsDataColumns.value.includes(col) ||
|
|
15381
|
-
(props.columnSorter &&
|
|
15382
|
-
typeof props.columnSorter === 'object' &&
|
|
15383
|
-
props.columnSorter.external)) {
|
|
15384
|
-
return filteredTable.value;
|
|
15385
|
-
}
|
|
15386
|
-
//if values in column are to be sorted by numeric value they all have to be type number
|
|
15387
|
-
// const flip = sorterState.asc ? 1 : -1
|
|
15388
|
-
const flip = sorterState.state === 'asc' ? 1 : sorterState.state === 'desc' ? -1 : 0;
|
|
15389
|
-
const sorted = filteredTable.value.slice().sort((item, item2) => {
|
|
15390
|
-
const value = item[col];
|
|
15391
|
-
const value2 = item2[col];
|
|
15392
|
-
const a = typeof value === 'number' ? value : String(value).toLowerCase();
|
|
15393
|
-
const b = typeof value2 === 'number' ? value2 : String(value2).toLowerCase();
|
|
15394
|
-
return a > b ? 1 * flip : b > a ? -1 * flip : 0;
|
|
15395
|
-
});
|
|
15396
|
-
return sorted;
|
|
15397
|
-
});
|
|
15310
|
+
const columnNames = vue.computed(() => getColumnNames(props.columns, items.value));
|
|
15311
|
+
const itemsDataColumns = vue.computed(() => columnNames.value.filter((name) => getColumnNamesFromItems(items.value).includes(name)));
|
|
15312
|
+
const filteredColumns = vue.computed(() => filterColumns(items.value, props.columnFilter, columnFilterState.value, itemsDataColumns.value));
|
|
15313
|
+
const filteredTable = vue.computed(() => filterTable(filteredColumns.value, props.tableFilter, tableFilterState.value, itemsDataColumns.value));
|
|
15314
|
+
const sortedItems = vue.computed(() => sortItems(props.columnSorter, filteredTable.value, itemsDataColumns.value, sorterState.value));
|
|
15398
15315
|
const numberOfPages = vue.computed(() => itemsPerPage.value ? Math.ceil(sortedItems.value.length / itemsPerPage.value) : 1);
|
|
15399
15316
|
const firstItemOnActivePageIndex = vue.computed(() => activePage.value ? (activePage.value - 1) * itemsPerPage.value : 0);
|
|
15400
|
-
const
|
|
15401
|
-
|
|
15402
|
-
|
|
15403
|
-
return (tableFilterState.value ||
|
|
15404
|
-
sorterState.column ||
|
|
15405
|
-
Object.values(columnFilterState.value).join(''));
|
|
15406
|
-
});
|
|
15317
|
+
const currentItems = vue.computed(() => activePage.value
|
|
15318
|
+
? sortedItems.value.slice(firstItemOnActivePageIndex.value, firstItemOnActivePageIndex.value + itemsPerPage.value)
|
|
15319
|
+
: sortedItems.value);
|
|
15407
15320
|
return () => vue.h('div', {}, [
|
|
15408
15321
|
(props.tableFilter || props.cleaner) &&
|
|
15409
15322
|
vue.h('div', {
|
|
@@ -15413,25 +15326,46 @@ const CSmartTable = vue.defineComponent({
|
|
|
15413
15326
|
vue.h('div', {
|
|
15414
15327
|
class: 'col-auto p-0',
|
|
15415
15328
|
}, props.tableFilter &&
|
|
15416
|
-
vue.h(
|
|
15417
|
-
|
|
15418
|
-
|
|
15419
|
-
|
|
15420
|
-
|
|
15421
|
-
|
|
15329
|
+
vue.h('div', {
|
|
15330
|
+
class: 'row mb-2',
|
|
15331
|
+
}, {
|
|
15332
|
+
default: () => [
|
|
15333
|
+
vue.h(CFormLabel, {
|
|
15334
|
+
class: 'col-sm-auto col-form-label',
|
|
15335
|
+
}, {
|
|
15336
|
+
default: () => props.tableFilterLabel,
|
|
15337
|
+
}),
|
|
15338
|
+
vue.h('div', {
|
|
15339
|
+
class: 'col-sm-auto',
|
|
15340
|
+
}, vue.h(CFormInput, {
|
|
15341
|
+
onInput: (e) => {
|
|
15342
|
+
handleTableFilterChange(e.target.value, 'input');
|
|
15343
|
+
},
|
|
15344
|
+
onChange: (e) => {
|
|
15345
|
+
handleTableFilterChange(e.target.value, 'change');
|
|
15346
|
+
},
|
|
15347
|
+
placeholder: props.tableFilterPlaceholder,
|
|
15348
|
+
value: tableFilterState.value,
|
|
15349
|
+
})),
|
|
15350
|
+
],
|
|
15422
15351
|
})),
|
|
15423
15352
|
props.cleaner &&
|
|
15424
15353
|
vue.h('div', {
|
|
15425
15354
|
class: 'col-auto p-0',
|
|
15426
|
-
}, vue.h(
|
|
15427
|
-
|
|
15428
|
-
|
|
15429
|
-
|
|
15430
|
-
|
|
15431
|
-
|
|
15432
|
-
|
|
15433
|
-
|
|
15434
|
-
|
|
15355
|
+
}, vue.h('button', {
|
|
15356
|
+
type: 'button',
|
|
15357
|
+
class: 'btn btn-transparent',
|
|
15358
|
+
...(!(tableFilterState.value ||
|
|
15359
|
+
sorterState.value.column ||
|
|
15360
|
+
Object.values(columnFilterState.value).join('')) && { disabled: true, tabIndex: -1 }),
|
|
15361
|
+
onClick: () => handleClean(),
|
|
15362
|
+
onKeydown: (event) => {
|
|
15363
|
+
if (event.key === 'Enter')
|
|
15364
|
+
handleClean();
|
|
15365
|
+
},
|
|
15366
|
+
}, slots.cleanerIcon
|
|
15367
|
+
? slots.cleanerIcon()
|
|
15368
|
+
: vue.h(CIcon, { width: '18', content: cilFilterX }))),
|
|
15435
15369
|
]),
|
|
15436
15370
|
vue.h('div', {
|
|
15437
15371
|
class: 'position-relative',
|
|
@@ -15447,17 +15381,18 @@ const CSmartTable = vue.defineComponent({
|
|
|
15447
15381
|
...props.tableHeadProps,
|
|
15448
15382
|
columnFilter: props.columnFilter,
|
|
15449
15383
|
columnFilterValue: columnFilterState.value,
|
|
15450
|
-
columns: props.columns ? props.columns :
|
|
15384
|
+
columns: props.columns ? props.columns : columnNames.value,
|
|
15451
15385
|
columnSorter: props.columnSorter,
|
|
15452
15386
|
items: items.value,
|
|
15453
15387
|
selectable: props.selectable,
|
|
15454
|
-
selectAll:
|
|
15455
|
-
|
|
15456
|
-
|
|
15457
|
-
|
|
15458
|
-
|
|
15388
|
+
selectAll: props.selectAll,
|
|
15389
|
+
selectedAll: selectedAll.value,
|
|
15390
|
+
sorterState: sorterState.value,
|
|
15391
|
+
onCustomFilterChange: (key, value) => handleColumnFilterChange(key, value),
|
|
15392
|
+
onFilterInput: (key, value) => handleColumnFilterChange(key, value, 'input'),
|
|
15393
|
+
onFilterChange: (key, value) => handleColumnFilterChange(key, value, 'change'),
|
|
15459
15394
|
onSelectAllChecked: () => handleSelectAllChecked(),
|
|
15460
|
-
onSortClick: (key, index) =>
|
|
15395
|
+
onSortClick: (key, index) => handleSorterChange(key, index),
|
|
15461
15396
|
}, {
|
|
15462
15397
|
// @slot Sorter icon when items are unsorted.
|
|
15463
15398
|
sortingIcon: () => slots.sortingIcon
|
|
@@ -15472,36 +15407,35 @@ const CSmartTable = vue.defineComponent({
|
|
|
15472
15407
|
// @slot Sorter icon when items are sorted ascending.
|
|
15473
15408
|
sortingIconAscending: () => slots.sortingIconAscending
|
|
15474
15409
|
? slots.sortingIconAscending()
|
|
15475
|
-
:
|
|
15476
|
-
|
|
15477
|
-
|
|
15478
|
-
|
|
15479
|
-
|
|
15480
|
-
|
|
15481
|
-
|
|
15482
|
-
}),
|
|
15410
|
+
: vue.h('svg', {
|
|
15411
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
15412
|
+
class: 'icon',
|
|
15413
|
+
viewBox: '0 0 512 512',
|
|
15414
|
+
role: 'img',
|
|
15415
|
+
innerHTML: cilArrowBottom[1],
|
|
15416
|
+
}),
|
|
15483
15417
|
// @slot Sorter icon when items are sorted descending.
|
|
15484
15418
|
sortingIconDescending: () => slots.sortingIconDescending
|
|
15485
15419
|
? slots.sortingIconDescending()
|
|
15486
|
-
:
|
|
15487
|
-
|
|
15488
|
-
|
|
15489
|
-
|
|
15490
|
-
|
|
15491
|
-
|
|
15492
|
-
|
|
15493
|
-
}),
|
|
15420
|
+
: vue.h('svg', {
|
|
15421
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
15422
|
+
class: 'icon',
|
|
15423
|
+
viewBox: '0 0 512 512',
|
|
15424
|
+
role: 'img',
|
|
15425
|
+
innerHTML: cilArrowTop[1],
|
|
15426
|
+
}),
|
|
15494
15427
|
}),
|
|
15495
15428
|
vue.h(CSmartTableBody, {
|
|
15429
|
+
clickableRows: props.clickableRows,
|
|
15430
|
+
columnNames: columnNames.value,
|
|
15496
15431
|
currentItems: currentItems.value,
|
|
15497
15432
|
firstItemOnActivePageIndex: firstItemOnActivePageIndex.value,
|
|
15498
15433
|
noItemsLabel: props.noItemsLabel,
|
|
15434
|
+
onRowChecked: (item, value) => handleRowChecked(item, value),
|
|
15435
|
+
onRowClick: (item, index, columnName, event) => props.clickableRows && emit('rowClick', item, index, columnName, event),
|
|
15499
15436
|
scopedSlots: slots,
|
|
15500
15437
|
selectable: props.selectable,
|
|
15501
|
-
|
|
15502
|
-
onRowClick: (item, index, columnName, event) => handleRowClick(item, index, columnName, event),
|
|
15503
|
-
rawColumnNames: rawColumnNames.value,
|
|
15504
|
-
clickableRows: props.clickableRows,
|
|
15438
|
+
selected: selected.value,
|
|
15505
15439
|
...props.tableBodyProps,
|
|
15506
15440
|
}),
|
|
15507
15441
|
typeof props.footer === 'boolean' &&
|
|
@@ -15511,9 +15445,10 @@ const CSmartTable = vue.defineComponent({
|
|
|
15511
15445
|
...props.tableFootProps,
|
|
15512
15446
|
columnFilter: false,
|
|
15513
15447
|
columnSorter: false,
|
|
15514
|
-
columns: props.columns ? props.columns :
|
|
15448
|
+
columns: props.columns ? props.columns : columnNames.value,
|
|
15515
15449
|
selectable: props.selectable,
|
|
15516
|
-
selectAll:
|
|
15450
|
+
selectAll: props.selectAll,
|
|
15451
|
+
selectedAll: selectedAll.value,
|
|
15517
15452
|
onSelectAllChecked: () => handleSelectAllChecked(),
|
|
15518
15453
|
}),
|
|
15519
15454
|
Array.isArray(props.footer) &&
|
|
@@ -15540,6 +15475,11 @@ const CSmartTable = vue.defineComponent({
|
|
|
15540
15475
|
{ sides: ['top'], query: 'tbody' },
|
|
15541
15476
|
{ sides: ['bottom'], query: 'tbody' },
|
|
15542
15477
|
],
|
|
15478
|
+
}, {
|
|
15479
|
+
// @slot elementCover.
|
|
15480
|
+
...(slots.elementCover && {
|
|
15481
|
+
default: () => slots.elementCover && slots.elementCover(),
|
|
15482
|
+
}),
|
|
15543
15483
|
}),
|
|
15544
15484
|
],
|
|
15545
15485
|
}),
|
|
@@ -15562,14 +15502,33 @@ const CSmartTable = vue.defineComponent({
|
|
|
15562
15502
|
vue.h('div', {
|
|
15563
15503
|
class: 'col-auto ms-auto',
|
|
15564
15504
|
}, props.itemsPerPageSelect &&
|
|
15565
|
-
vue.h(
|
|
15566
|
-
|
|
15567
|
-
|
|
15568
|
-
|
|
15569
|
-
|
|
15505
|
+
vue.h('div', {
|
|
15506
|
+
class: 'row',
|
|
15507
|
+
}, {
|
|
15508
|
+
default: () => [
|
|
15509
|
+
vue.h(CFormLabel, {
|
|
15510
|
+
class: 'col-auto col-form-label',
|
|
15511
|
+
}, {
|
|
15512
|
+
default: () => props.itemsPerPageLabel,
|
|
15513
|
+
}),
|
|
15514
|
+
vue.h('div', {
|
|
15515
|
+
class: 'col-auto',
|
|
15516
|
+
}, vue.h(CFormSelect, {
|
|
15517
|
+
value: itemsPerPage.value,
|
|
15518
|
+
onChange: handleItemsPerPageChange,
|
|
15519
|
+
}, {
|
|
15520
|
+
default: () => props.itemsPerPageOptions &&
|
|
15521
|
+
props.itemsPerPageOptions.map((number, index) => {
|
|
15522
|
+
return vue.h('option', {
|
|
15523
|
+
value: number,
|
|
15524
|
+
key: index,
|
|
15525
|
+
}, number);
|
|
15526
|
+
}),
|
|
15527
|
+
})),
|
|
15528
|
+
],
|
|
15570
15529
|
})),
|
|
15571
15530
|
]),
|
|
15572
|
-
]);
|
|
15531
|
+
]);
|
|
15573
15532
|
},
|
|
15574
15533
|
});
|
|
15575
15534
|
|