@coreui/vue-pro 4.6.0 → 4.7.0-alpha.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/Types.d.ts +5 -5
- package/dist/components/date-picker/CDatePicker.d.ts +2 -1
- package/dist/components/date-range-picker/CDateRangePicker.d.ts +31 -1
- package/dist/components/form/CFormInput.d.ts +166 -1
- package/dist/components/form/CFormSelect.d.ts +1 -1
- package/dist/components/grid/CCol.d.ts +3 -3
- package/dist/components/grid/CRow.d.ts +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/multi-select/CMultiSelect.d.ts +12 -4
- package/dist/components/multi-select/CMultiSelectOptions.d.ts +11 -0
- package/dist/components/multi-select/CMultiSelectSelection.d.ts +3 -3
- package/dist/components/pagination/index.d.ts +1 -2
- package/dist/components/picker/CPicker.d.ts +1 -1
- package/dist/components/popover/CPopover.d.ts +1 -1
- package/dist/components/smart-pagination/CSmartPagination.d.ts +257 -0
- package/dist/components/smart-pagination/index.d.ts +6 -0
- package/dist/components/smart-table/CSmartTable.d.ts +6 -4
- package/dist/components/smart-table/CSmartTableFilter.d.ts +2 -2
- package/dist/components/smart-table/CSmartTableHead.d.ts +2 -2
- package/dist/components/smart-table/CSmartTableInterface.d.ts +4 -1
- package/dist/components/table/CTable.d.ts +1 -1
- package/dist/components/table/CTableCaption.d.ts +2 -8
- package/dist/components/time-picker/CTimePicker.d.ts +2 -1
- package/dist/components/tooltip/CTooltip.d.ts +1 -1
- package/dist/components/widgets/CWidgetStatsD.d.ts +1 -1
- package/dist/index.es.js +877 -682
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +876 -680
- package/dist/index.js.map +1 -1
- package/dist/utils/getNextSibling.d.ts +2 -0
- package/dist/utils/getPreviousSibling.d.ts +2 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/isVisible.d.ts +2 -0
- package/dist/utils/time.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/carousel/CCarousel.ts +1 -9
- package/src/components/date-picker/CDatePicker.ts +11 -2
- package/src/components/date-range-picker/CDateRangePicker.ts +54 -0
- package/src/components/form/CFormInput.ts +2 -0
- package/src/components/index.ts +1 -0
- package/src/components/loading-button/CLoadingButton.ts +1 -2
- package/src/components/multi-select/CMultiSelect.ts +125 -103
- package/src/components/multi-select/CMultiSelectOptions.ts +48 -10
- package/src/components/multi-select/CMultiSelectSelection.ts +1 -1
- package/src/components/pagination/index.ts +1 -3
- package/src/components/sidebar/CSidebar.ts +2 -10
- package/src/components/{pagination → smart-pagination}/CSmartPagination.ts +1 -2
- package/src/components/smart-pagination/index.ts +10 -0
- package/src/components/smart-table/CSmartTable.ts +10 -5
- package/src/components/smart-table/CSmartTableInterface.ts +4 -0
- package/src/components/table/CTableCaption.ts +0 -1
- package/src/components/time-picker/CTimePicker.ts +73 -20
- package/src/components/time-picker/CTimePickerRollCol.ts +9 -0
- package/src/utils/getNextSibling.ts +18 -0
- package/src/utils/getPreviousSibling.ts +18 -0
- package/src/utils/index.ts +5 -0
- package/src/utils/isVisible.ts +11 -0
- package/src/utils/time.ts +14 -6
package/dist/index.js
CHANGED
|
@@ -1909,13 +1909,46 @@ const CCardPlugin = {
|
|
|
1909
1909
|
},
|
|
1910
1910
|
};
|
|
1911
1911
|
|
|
1912
|
-
const
|
|
1912
|
+
const getNextSibling = (elem, selector) => {
|
|
1913
|
+
// Get the next sibling element
|
|
1914
|
+
let sibling = elem.nextElementSibling;
|
|
1915
|
+
// If there's no selector, return the first sibling
|
|
1916
|
+
if (!selector)
|
|
1917
|
+
return sibling;
|
|
1918
|
+
// If the sibling matches our selector, use it
|
|
1919
|
+
// If not, jump to the next sibling and continue the loop
|
|
1920
|
+
while (sibling) {
|
|
1921
|
+
if (sibling.matches(selector))
|
|
1922
|
+
return sibling;
|
|
1923
|
+
sibling = sibling.nextElementSibling;
|
|
1924
|
+
}
|
|
1925
|
+
return;
|
|
1926
|
+
};
|
|
1927
|
+
|
|
1928
|
+
const getPreviousSibling = (elem, selector) => {
|
|
1929
|
+
// Get the next sibling element
|
|
1930
|
+
let sibling = elem.previousElementSibling;
|
|
1931
|
+
// If there's no selector, return the first sibling
|
|
1932
|
+
if (!selector)
|
|
1933
|
+
return sibling;
|
|
1934
|
+
// If the sibling matches our selector, use it
|
|
1935
|
+
// If not, jump to the next sibling and continue the loop
|
|
1936
|
+
while (sibling) {
|
|
1937
|
+
if (sibling.matches(selector))
|
|
1938
|
+
return sibling;
|
|
1939
|
+
sibling = sibling.previousElementSibling;
|
|
1940
|
+
}
|
|
1941
|
+
return;
|
|
1942
|
+
};
|
|
1943
|
+
|
|
1944
|
+
const isVisible = (element) => {
|
|
1913
1945
|
const rect = element.getBoundingClientRect();
|
|
1914
1946
|
return (rect.top >= 0 &&
|
|
1915
1947
|
rect.left >= 0 &&
|
|
1916
1948
|
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
|
|
1917
1949
|
rect.right <= (window.innerWidth || document.documentElement.clientWidth));
|
|
1918
1950
|
};
|
|
1951
|
+
|
|
1919
1952
|
const CCarousel = vue.defineComponent({
|
|
1920
1953
|
name: 'CCarousel',
|
|
1921
1954
|
props: {
|
|
@@ -2027,7 +2060,7 @@ const CCarousel = vue.defineComponent({
|
|
|
2027
2060
|
const nextItemWhenVisible = () => {
|
|
2028
2061
|
// Don't call next when the page isn't visible
|
|
2029
2062
|
// or the carousel or its parent isn't visible
|
|
2030
|
-
if (!document.hidden && isVisible
|
|
2063
|
+
if (!document.hidden && isVisible(carouselRef.value)) {
|
|
2031
2064
|
handleControlClick('next');
|
|
2032
2065
|
}
|
|
2033
2066
|
};
|
|
@@ -2046,7 +2079,7 @@ const CCarousel = vue.defineComponent({
|
|
|
2046
2079
|
}
|
|
2047
2080
|
};
|
|
2048
2081
|
const handleScroll = () => {
|
|
2049
|
-
if (!document.hidden && isVisible
|
|
2082
|
+
if (!document.hidden && isVisible(carouselRef.value)) {
|
|
2050
2083
|
visible.value = true;
|
|
2051
2084
|
}
|
|
2052
2085
|
else {
|
|
@@ -8336,6 +8369,8 @@ const CFormControlWrapper = vue.defineComponent({
|
|
|
8336
8369
|
},
|
|
8337
8370
|
});
|
|
8338
8371
|
|
|
8372
|
+
const File = typeof window !== 'undefined' ? window.File : class File extends Object {
|
|
8373
|
+
};
|
|
8339
8374
|
const CFormInput = vue.defineComponent({
|
|
8340
8375
|
name: 'CFormInput',
|
|
8341
8376
|
props: {
|
|
@@ -11938,6 +11973,12 @@ const CTimePickerRollCol = vue.defineComponent({
|
|
|
11938
11973
|
}
|
|
11939
11974
|
init.value = false;
|
|
11940
11975
|
});
|
|
11976
|
+
const handleKeyDown = (event, value) => {
|
|
11977
|
+
if (event.code === 'Space' || event.key === 'Enter') {
|
|
11978
|
+
event.preventDefault();
|
|
11979
|
+
emit('click', value);
|
|
11980
|
+
}
|
|
11981
|
+
};
|
|
11941
11982
|
return () => vue.h('div', { class: 'time-picker-roll-col', ref: colRef }, props.elements.map((element) => {
|
|
11942
11983
|
return vue.h('div', {
|
|
11943
11984
|
class: [
|
|
@@ -11947,7 +11988,9 @@ const CTimePickerRollCol = vue.defineComponent({
|
|
|
11947
11988
|
},
|
|
11948
11989
|
],
|
|
11949
11990
|
onClick: () => emit('click', element.value),
|
|
11991
|
+
onKeydown: (event) => handleKeyDown(event, element.value),
|
|
11950
11992
|
role: 'button',
|
|
11993
|
+
tabindex: 0,
|
|
11951
11994
|
}, element.label);
|
|
11952
11995
|
}));
|
|
11953
11996
|
},
|
|
@@ -11976,10 +12019,10 @@ const getAmPm = (date, locale) => {
|
|
|
11976
12019
|
}
|
|
11977
12020
|
return date.getHours() >= 12 ? 'pm' : 'am';
|
|
11978
12021
|
};
|
|
11979
|
-
const getListOfHours = (locale) => Array.from({ length: isAmPm(locale) ? 12 : 24 }, (_, i) => {
|
|
12022
|
+
const getListOfHours = (locale, ampm = 'auto') => Array.from({ length: (ampm === 'auto' && isAmPm(locale)) || ampm ? 12 : 24 }, (_, i) => {
|
|
11980
12023
|
return {
|
|
11981
|
-
value: isAmPm(locale) ? i + 1 : i,
|
|
11982
|
-
label: (isAmPm(locale) ? i + 1 : i).toLocaleString(locale),
|
|
12024
|
+
value: (ampm === 'auto' && isAmPm(locale)) || ampm ? i + 1 : i,
|
|
12025
|
+
label: ((ampm === 'auto' && isAmPm(locale)) || ampm ? i + 1 : i).toLocaleString(locale),
|
|
11983
12026
|
};
|
|
11984
12027
|
});
|
|
11985
12028
|
const getListOfMinutes = (locale, valueAsString = false) => Array.from({ length: 60 }, (_, i) => {
|
|
@@ -12012,7 +12055,11 @@ const getListOfSeconds = (locale, valueAsString = false) => Array.from({ length:
|
|
|
12012
12055
|
.split(':')[2],
|
|
12013
12056
|
};
|
|
12014
12057
|
});
|
|
12015
|
-
const getSelectedHour = (date, locale
|
|
12058
|
+
const getSelectedHour = (date, locale, ampm = 'auto') => date
|
|
12059
|
+
? (ampm === 'auto' && isAmPm(locale)) || ampm
|
|
12060
|
+
? convert24hTo12h(date.getHours())
|
|
12061
|
+
: date.getHours()
|
|
12062
|
+
: '';
|
|
12016
12063
|
const getSelectedMinutes = (date) => (date ? date.getMinutes() : '');
|
|
12017
12064
|
const getSelectedSeconds = (date) => (date ? date.getSeconds() : '');
|
|
12018
12065
|
const isAmPm = (locale) => ['am', 'AM', 'pm', 'PM'].some((el) => new Date().toLocaleString(locale).includes(el));
|
|
@@ -12025,6 +12072,24 @@ const CTimePicker = vue.defineComponent({
|
|
|
12025
12072
|
name: 'CTimePicker',
|
|
12026
12073
|
props: {
|
|
12027
12074
|
...CPicker.props,
|
|
12075
|
+
/**
|
|
12076
|
+
* Set if the component should use the 12/24 hour format. If `true` forces the interface to a 12-hour format. If `false` forces the interface into a 24-hour format. If `auto` the current locale will determine the 12 or 24-hour interface by default locales.
|
|
12077
|
+
*
|
|
12078
|
+
* @since 4.7.0
|
|
12079
|
+
*/
|
|
12080
|
+
ampm: {
|
|
12081
|
+
type: [Boolean, String],
|
|
12082
|
+
default: 'auto',
|
|
12083
|
+
validator: (value) => {
|
|
12084
|
+
if (typeof value == 'string') {
|
|
12085
|
+
return ['auto'].includes(value);
|
|
12086
|
+
}
|
|
12087
|
+
if (typeof value == 'boolean') {
|
|
12088
|
+
return true;
|
|
12089
|
+
}
|
|
12090
|
+
return false;
|
|
12091
|
+
},
|
|
12092
|
+
},
|
|
12028
12093
|
/**
|
|
12029
12094
|
* Toggle visibility or set the content of cancel button.
|
|
12030
12095
|
*/
|
|
@@ -12178,6 +12243,15 @@ const CTimePicker = vue.defineComponent({
|
|
|
12178
12243
|
type: String,
|
|
12179
12244
|
default: 'Select time',
|
|
12180
12245
|
},
|
|
12246
|
+
/**
|
|
12247
|
+
* Show seconds.
|
|
12248
|
+
*
|
|
12249
|
+
* @since 4.7.0
|
|
12250
|
+
*/
|
|
12251
|
+
seconds: {
|
|
12252
|
+
type: Boolean,
|
|
12253
|
+
default: true,
|
|
12254
|
+
},
|
|
12181
12255
|
/**
|
|
12182
12256
|
* Size the component small or large.
|
|
12183
12257
|
*
|
|
@@ -12228,6 +12302,10 @@ const CTimePicker = vue.defineComponent({
|
|
|
12228
12302
|
return ['roll', 'select'].includes(value);
|
|
12229
12303
|
},
|
|
12230
12304
|
},
|
|
12305
|
+
/**
|
|
12306
|
+
* Toggle the visibility of the component.
|
|
12307
|
+
*/
|
|
12308
|
+
visible: Boolean,
|
|
12231
12309
|
},
|
|
12232
12310
|
emits: [
|
|
12233
12311
|
/**
|
|
@@ -12242,8 +12320,15 @@ const CTimePicker = vue.defineComponent({
|
|
|
12242
12320
|
* Callback fired when the component requests to be shown.
|
|
12243
12321
|
*/
|
|
12244
12322
|
'show',
|
|
12323
|
+
/**
|
|
12324
|
+
* Callback fired when the time changed.
|
|
12325
|
+
*
|
|
12326
|
+
* @since 4.7.0
|
|
12327
|
+
*/
|
|
12328
|
+
'update:time',
|
|
12245
12329
|
],
|
|
12246
12330
|
setup(props, { emit, attrs, slots }) {
|
|
12331
|
+
const visible = vue.ref(props.visible);
|
|
12247
12332
|
const date = vue.ref(convertTimeToDate(props.time));
|
|
12248
12333
|
const initialDate = vue.ref(null);
|
|
12249
12334
|
const ampm = vue.ref(date.value ? getAmPm(new Date(date.value), props.locale) : 'am');
|
|
@@ -12258,6 +12343,8 @@ const CTimePicker = vue.defineComponent({
|
|
|
12258
12343
|
const handleClear = (event) => {
|
|
12259
12344
|
event.stopPropagation();
|
|
12260
12345
|
date.value = null;
|
|
12346
|
+
emit('change', null);
|
|
12347
|
+
emit('update:time', null);
|
|
12261
12348
|
};
|
|
12262
12349
|
const handleTimeChange = (set, value) => {
|
|
12263
12350
|
const _date = date.value || new Date('1970-01-01');
|
|
@@ -12270,7 +12357,7 @@ const CTimePicker = vue.defineComponent({
|
|
|
12270
12357
|
}
|
|
12271
12358
|
}
|
|
12272
12359
|
if (set === 'hours') {
|
|
12273
|
-
if (isAmPm(props.locale)) {
|
|
12360
|
+
if ((props.ampm === 'auto' && isAmPm(props.locale)) || props.ampm) {
|
|
12274
12361
|
_date.setHours(convert12hTo24h(ampm.value, parseInt(value)));
|
|
12275
12362
|
}
|
|
12276
12363
|
else {
|
|
@@ -12284,7 +12371,8 @@ const CTimePicker = vue.defineComponent({
|
|
|
12284
12371
|
_date.setSeconds(parseInt(value));
|
|
12285
12372
|
}
|
|
12286
12373
|
date.value = new Date(_date);
|
|
12287
|
-
emit('change', _date.toTimeString(), _date.toLocaleTimeString(), _date);
|
|
12374
|
+
emit('change', _date.toTimeString(), _date.toLocaleTimeString(props.locale), _date);
|
|
12375
|
+
emit('update:time', _date.toLocaleTimeString(props.locale));
|
|
12288
12376
|
};
|
|
12289
12377
|
const InputGroup = () => vue.h(CInputGroup, { class: 'picker-input-group', size: props.size }, () => [
|
|
12290
12378
|
vue.h(CFormInput, {
|
|
@@ -12297,7 +12385,12 @@ const CTimePicker = vue.defineComponent({
|
|
|
12297
12385
|
},
|
|
12298
12386
|
placeholder: props.placeholder,
|
|
12299
12387
|
readonly: props.inputReadOnly,
|
|
12300
|
-
value: date.value
|
|
12388
|
+
value: date.value
|
|
12389
|
+
? date.value.toLocaleTimeString(props.locale, {
|
|
12390
|
+
hour12: (props.ampm === 'auto' && isAmPm(props.locale)) || props.ampm ? true : false,
|
|
12391
|
+
...(!props.seconds && { timeStyle: 'short' }),
|
|
12392
|
+
})
|
|
12393
|
+
: '',
|
|
12301
12394
|
}),
|
|
12302
12395
|
(props.indicator || props.cleaner) &&
|
|
12303
12396
|
vue.h(CInputGroupText, {}, () => [
|
|
@@ -12338,14 +12431,15 @@ const CTimePicker = vue.defineComponent({
|
|
|
12338
12431
|
onChange: (event) => handleTimeChange('minutes', event.target.value),
|
|
12339
12432
|
...(date.value && { value: getSelectedMinutes(date.value) }),
|
|
12340
12433
|
}),
|
|
12341
|
-
':',
|
|
12342
|
-
|
|
12343
|
-
|
|
12344
|
-
|
|
12345
|
-
|
|
12346
|
-
|
|
12347
|
-
|
|
12348
|
-
|
|
12434
|
+
props.seconds && ':',
|
|
12435
|
+
props.seconds &&
|
|
12436
|
+
// @ts-expect-error the getListOfMinutes function returns corect type
|
|
12437
|
+
vue.h(CFormSelect, {
|
|
12438
|
+
disabled: props.disabled,
|
|
12439
|
+
options: getListOfSeconds(props.locale, true),
|
|
12440
|
+
onChange: (event) => handleTimeChange('seconds', event.target.value),
|
|
12441
|
+
...(date.value && { value: getSelectedSeconds(date.value) }),
|
|
12442
|
+
}),
|
|
12349
12443
|
isAmPm(props.locale) &&
|
|
12350
12444
|
vue.h(CFormSelect, {
|
|
12351
12445
|
disabled: props.disabled,
|
|
@@ -12359,21 +12453,22 @@ const CTimePicker = vue.defineComponent({
|
|
|
12359
12453
|
];
|
|
12360
12454
|
const TimePickerRoll = () => [
|
|
12361
12455
|
vue.h(CTimePickerRollCol, {
|
|
12362
|
-
elements: getListOfHours(props.locale),
|
|
12456
|
+
elements: getListOfHours(props.locale, props.ampm),
|
|
12363
12457
|
onClick: (index) => handleTimeChange('hours', index.toString()),
|
|
12364
|
-
selected: getSelectedHour(date.value, props.locale),
|
|
12458
|
+
selected: getSelectedHour(date.value, props.locale, props.ampm),
|
|
12365
12459
|
}),
|
|
12366
12460
|
vue.h(CTimePickerRollCol, {
|
|
12367
12461
|
elements: getListOfMinutes(props.locale),
|
|
12368
12462
|
onClick: (index) => handleTimeChange('minutes', index.toString()),
|
|
12369
12463
|
selected: getSelectedMinutes(date.value),
|
|
12370
12464
|
}),
|
|
12371
|
-
|
|
12372
|
-
|
|
12373
|
-
|
|
12374
|
-
|
|
12375
|
-
|
|
12376
|
-
|
|
12465
|
+
props.seconds &&
|
|
12466
|
+
vue.h(CTimePickerRollCol, {
|
|
12467
|
+
elements: getListOfSeconds(props.locale),
|
|
12468
|
+
onClick: (index) => handleTimeChange('seconds', index.toString()),
|
|
12469
|
+
selected: getSelectedSeconds(date.value),
|
|
12470
|
+
}),
|
|
12471
|
+
((props.ampm === 'auto' && isAmPm(props.locale)) || props.ampm) &&
|
|
12377
12472
|
vue.h(CTimePickerRollCol, {
|
|
12378
12473
|
elements: [
|
|
12379
12474
|
{ value: 'am', label: 'AM' },
|
|
@@ -12412,16 +12507,20 @@ const CTimePicker = vue.defineComponent({
|
|
|
12412
12507
|
if (initialDate.value) {
|
|
12413
12508
|
date.value = new Date(initialDate.value);
|
|
12414
12509
|
}
|
|
12510
|
+
visible.value = false;
|
|
12415
12511
|
},
|
|
12416
12512
|
onHide: () => {
|
|
12513
|
+
visible.value = false;
|
|
12417
12514
|
emit('hide');
|
|
12418
12515
|
},
|
|
12419
12516
|
onShow: () => {
|
|
12420
12517
|
if (date.value) {
|
|
12421
12518
|
initialDate.value = new Date(date.value);
|
|
12422
12519
|
}
|
|
12520
|
+
visible.value = true;
|
|
12423
12521
|
emit('show');
|
|
12424
12522
|
},
|
|
12523
|
+
visible: visible.value,
|
|
12425
12524
|
}, {
|
|
12426
12525
|
...(slots.cancelButton && {
|
|
12427
12526
|
cancelButton: () => slots.cancelButton && slots.cancelButton(),
|
|
@@ -12512,6 +12611,15 @@ const CDateRangePicker = vue.defineComponent({
|
|
|
12512
12611
|
type: Boolean,
|
|
12513
12612
|
default: true,
|
|
12514
12613
|
},
|
|
12614
|
+
/**
|
|
12615
|
+
* If true the dropdown will be immediately closed after submitting the full date.
|
|
12616
|
+
*
|
|
12617
|
+
* @since 4.7.0
|
|
12618
|
+
*/
|
|
12619
|
+
closeOnSelect: {
|
|
12620
|
+
type: Boolean,
|
|
12621
|
+
default: true,
|
|
12622
|
+
},
|
|
12515
12623
|
/**
|
|
12516
12624
|
* Toggle visibility or set the content of confirm button.
|
|
12517
12625
|
*/
|
|
@@ -12813,6 +12921,10 @@ const CDateRangePicker = vue.defineComponent({
|
|
|
12813
12921
|
* @since 4.6.0
|
|
12814
12922
|
*/
|
|
12815
12923
|
valid: Boolean,
|
|
12924
|
+
/**
|
|
12925
|
+
* Toggle the visibility of the component.
|
|
12926
|
+
*/
|
|
12927
|
+
visible: Boolean,
|
|
12816
12928
|
/**
|
|
12817
12929
|
* Set length or format of day name.
|
|
12818
12930
|
*
|
|
@@ -12858,8 +12970,23 @@ const CDateRangePicker = vue.defineComponent({
|
|
|
12858
12970
|
* @property {string} formatedDate - formated date
|
|
12859
12971
|
*/
|
|
12860
12972
|
'start-date-change',
|
|
12973
|
+
/**
|
|
12974
|
+
* Callback fired when the start date changed.
|
|
12975
|
+
*
|
|
12976
|
+
* @property {Date | null} date - date object
|
|
12977
|
+
* @since 4.7.0
|
|
12978
|
+
*/
|
|
12979
|
+
'update:start-date',
|
|
12980
|
+
/**
|
|
12981
|
+
* Callback fired when the end date changed.
|
|
12982
|
+
*
|
|
12983
|
+
* @property {Date | null} date - date object
|
|
12984
|
+
* @since 4.7.0
|
|
12985
|
+
*/
|
|
12986
|
+
'update:end-date',
|
|
12861
12987
|
],
|
|
12862
12988
|
setup(props, { slots, attrs, emit }) {
|
|
12989
|
+
const visible = vue.ref(props.visible);
|
|
12863
12990
|
const calendarDate = vue.ref(props.calendarDate
|
|
12864
12991
|
? new Date(props.calendarDate)
|
|
12865
12992
|
: props.startDate
|
|
@@ -12934,6 +13061,13 @@ const CDateRangePicker = vue.defineComponent({
|
|
|
12934
13061
|
selectEndDate.value = true;
|
|
12935
13062
|
}
|
|
12936
13063
|
emit('start-date-change', date, date ? formatDate(date) : undefined);
|
|
13064
|
+
emit('update:start-date', date);
|
|
13065
|
+
if (props.timepicker || props.footer) {
|
|
13066
|
+
return;
|
|
13067
|
+
}
|
|
13068
|
+
if (props.closeOnSelect && !props.range) {
|
|
13069
|
+
visible.value = false;
|
|
13070
|
+
}
|
|
12937
13071
|
};
|
|
12938
13072
|
const handleEndDateChange = (date) => {
|
|
12939
13073
|
endDate.value = date;
|
|
@@ -12942,6 +13076,13 @@ const CDateRangePicker = vue.defineComponent({
|
|
|
12942
13076
|
selectEndDate.value = false;
|
|
12943
13077
|
}
|
|
12944
13078
|
emit('end-date-change', date, date ? formatDate(date) : undefined);
|
|
13079
|
+
emit('update:end-date', date);
|
|
13080
|
+
if (props.timepicker || props.footer) {
|
|
13081
|
+
return;
|
|
13082
|
+
}
|
|
13083
|
+
if (props.closeOnSelect && startDate.value !== null) {
|
|
13084
|
+
visible.value = false;
|
|
13085
|
+
}
|
|
12945
13086
|
};
|
|
12946
13087
|
const handleClear = (event) => {
|
|
12947
13088
|
event.stopPropagation();
|
|
@@ -12949,6 +13090,10 @@ const CDateRangePicker = vue.defineComponent({
|
|
|
12949
13090
|
endDate.value = null;
|
|
12950
13091
|
inputStartHoverValue.value = null;
|
|
12951
13092
|
inputEndHoverValue.value = null;
|
|
13093
|
+
emit('start-date-change', null);
|
|
13094
|
+
emit('end-date-change', null);
|
|
13095
|
+
emit('update:start-date', null);
|
|
13096
|
+
emit('update:end-date', null);
|
|
12952
13097
|
};
|
|
12953
13098
|
const InputGroup = () => vue.h(CInputGroup, {
|
|
12954
13099
|
class: 'picker-input-group',
|
|
@@ -13054,8 +13199,10 @@ const CDateRangePicker = vue.defineComponent({
|
|
|
13054
13199
|
onCancel: () => {
|
|
13055
13200
|
startDate.value = initialStartDate.value;
|
|
13056
13201
|
endDate.value = initialEndDate.value;
|
|
13202
|
+
visible.value = false;
|
|
13057
13203
|
},
|
|
13058
13204
|
onHide: () => {
|
|
13205
|
+
visible.value = false;
|
|
13059
13206
|
emit('hide');
|
|
13060
13207
|
},
|
|
13061
13208
|
onShow: () => {
|
|
@@ -13065,8 +13212,10 @@ const CDateRangePicker = vue.defineComponent({
|
|
|
13065
13212
|
if (endDate.value) {
|
|
13066
13213
|
initialEndDate.value = new Date(endDate.value);
|
|
13067
13214
|
}
|
|
13215
|
+
visible.value = true;
|
|
13068
13216
|
emit('show');
|
|
13069
13217
|
},
|
|
13218
|
+
visible: visible.value,
|
|
13070
13219
|
}, {
|
|
13071
13220
|
...(slots.cancelButton && {
|
|
13072
13221
|
cancelButton: () => slots.cancelButton && slots.cancelButton(),
|
|
@@ -13455,11 +13604,21 @@ const CDatePicker = vue.defineComponent({
|
|
|
13455
13604
|
* @property {string} formatedDate - formated date
|
|
13456
13605
|
*/
|
|
13457
13606
|
'date-change',
|
|
13607
|
+
/**
|
|
13608
|
+
* Callback fired when the date changed.
|
|
13609
|
+
*
|
|
13610
|
+
* @property {Date | null} date - date object
|
|
13611
|
+
* @since 4.7.0
|
|
13612
|
+
*/
|
|
13613
|
+
'update:date',
|
|
13458
13614
|
],
|
|
13459
13615
|
setup(props, { emit }) {
|
|
13460
13616
|
return () => vue.h(CDateRangePicker, {
|
|
13461
13617
|
calendars: 1,
|
|
13462
|
-
onStartDateChange: (date, formatedDate) =>
|
|
13618
|
+
onStartDateChange: (date, formatedDate) => {
|
|
13619
|
+
emit('date-change', date, formatedDate);
|
|
13620
|
+
emit('update:date', date);
|
|
13621
|
+
},
|
|
13463
13622
|
range: false,
|
|
13464
13623
|
startDate: props.date,
|
|
13465
13624
|
...props,
|
|
@@ -14290,11 +14449,10 @@ const CLoadingButton = vue.defineComponent({
|
|
|
14290
14449
|
}
|
|
14291
14450
|
};
|
|
14292
14451
|
return () => vue.h(CButton, {
|
|
14452
|
+
...props,
|
|
14293
14453
|
class: ['btn-loading', { ['is-loading']: loading.value }],
|
|
14294
14454
|
...(props.disabledOnLoading && loading.value && { disabled: true }),
|
|
14295
14455
|
onClick: () => handleOnClick(),
|
|
14296
|
-
// TODO: remove non button props
|
|
14297
|
-
...props,
|
|
14298
14456
|
}, {
|
|
14299
14457
|
default: () => [
|
|
14300
14458
|
vue.h(CSpinner, { class: 'btn-loading-spinner', size: 'sm', variant: props.spinnerType }),
|
|
@@ -14696,34 +14854,61 @@ const CMultiSelectOptions = vue.defineComponent({
|
|
|
14696
14854
|
default: 'no items',
|
|
14697
14855
|
required: false,
|
|
14698
14856
|
},
|
|
14857
|
+
selected: {
|
|
14858
|
+
type: Array,
|
|
14859
|
+
default: () => [],
|
|
14860
|
+
required: false,
|
|
14861
|
+
},
|
|
14699
14862
|
},
|
|
14700
14863
|
emits: ['optionClick'],
|
|
14701
14864
|
setup(props, { emit }) {
|
|
14865
|
+
const handleKeyDown = (event, option) => {
|
|
14866
|
+
if (event.code === 'Space' || event.key === 'Enter') {
|
|
14867
|
+
event.preventDefault();
|
|
14868
|
+
handleOptionClick && handleOptionClick(option);
|
|
14869
|
+
return;
|
|
14870
|
+
}
|
|
14871
|
+
if (event.key === 'Down' || event.key === 'ArrowDown') {
|
|
14872
|
+
event.preventDefault();
|
|
14873
|
+
const target = event.target;
|
|
14874
|
+
const next = getNextSibling(target, '.form-multi-select-option');
|
|
14875
|
+
if (next) {
|
|
14876
|
+
next.focus(); // eslint-disable-line prettier/prettier
|
|
14877
|
+
}
|
|
14878
|
+
}
|
|
14879
|
+
if (event.key === 'Up' || event.key === 'ArrowUp') {
|
|
14880
|
+
event.preventDefault();
|
|
14881
|
+
const target = event.target;
|
|
14882
|
+
const prev = getPreviousSibling(target, '.form-multi-select-option');
|
|
14883
|
+
if (prev) {
|
|
14884
|
+
prev.focus(); // eslint-disable-line prettier/prettier
|
|
14885
|
+
}
|
|
14886
|
+
}
|
|
14887
|
+
};
|
|
14702
14888
|
const handleOptionClick = (option) => {
|
|
14703
14889
|
emit('optionClick', option);
|
|
14704
14890
|
};
|
|
14705
|
-
|
|
14706
|
-
|
|
14707
|
-
|
|
14708
|
-
|
|
14709
|
-
|
|
14710
|
-
|
|
14711
|
-
|
|
14712
|
-
|
|
14713
|
-
|
|
14714
|
-
|
|
14715
|
-
|
|
14716
|
-
|
|
14717
|
-
|
|
14718
|
-
|
|
14719
|
-
|
|
14720
|
-
|
|
14721
|
-
|
|
14722
|
-
|
|
14723
|
-
|
|
14724
|
-
})
|
|
14725
|
-
|
|
14726
|
-
};
|
|
14891
|
+
// TODO: find solution how to remove any
|
|
14892
|
+
const createOptions = (options) => options.length > 0
|
|
14893
|
+
? options.map((option) => option.options
|
|
14894
|
+
? [
|
|
14895
|
+
vue.h('div', { class: 'form-multi-select-optgroup-label' }, option.label),
|
|
14896
|
+
createOptions(option.options),
|
|
14897
|
+
]
|
|
14898
|
+
: vue.h('div', {
|
|
14899
|
+
class: [
|
|
14900
|
+
'form-multi-select-option',
|
|
14901
|
+
{
|
|
14902
|
+
'form-multi-select-option-with-checkbox': props.optionsStyle === 'checkbox',
|
|
14903
|
+
'form-multi-selected': props.selected.some((_option) => _option.value === option.value),
|
|
14904
|
+
disabled: option.disabled,
|
|
14905
|
+
},
|
|
14906
|
+
],
|
|
14907
|
+
onClick: () => handleOptionClick(option),
|
|
14908
|
+
onKeydown: (event) => handleKeyDown(event, option),
|
|
14909
|
+
tabindex: 0,
|
|
14910
|
+
}, option.text))
|
|
14911
|
+
: vue.h('div', { class: 'form-multi-select-options-empty' }, props.searchNoResultsLabel);
|
|
14727
14912
|
return () => vue.h('div', {
|
|
14728
14913
|
class: 'form-multi-select-options',
|
|
14729
14914
|
...(props.optionsMaxHeight !== 'auto' && {
|
|
@@ -14750,7 +14935,7 @@ const CMultiSelectSelection = vue.defineComponent({
|
|
|
14750
14935
|
* Enables search input element.
|
|
14751
14936
|
*/
|
|
14752
14937
|
search: {
|
|
14753
|
-
type: Boolean,
|
|
14938
|
+
type: [Boolean, String],
|
|
14754
14939
|
required: false,
|
|
14755
14940
|
default: false,
|
|
14756
14941
|
},
|
|
@@ -14820,6 +15005,11 @@ const CMultiSelectSelection = vue.defineComponent({
|
|
|
14820
15005
|
},
|
|
14821
15006
|
});
|
|
14822
15007
|
|
|
15008
|
+
const flattenArray = (options) => {
|
|
15009
|
+
return options.reduce((acc, val) => {
|
|
15010
|
+
return acc.concat(Array.isArray(val.options) ? flattenArray(val.options) : val);
|
|
15011
|
+
}, []);
|
|
15012
|
+
};
|
|
14823
15013
|
const CMultiSelect = vue.defineComponent({
|
|
14824
15014
|
name: 'CMultiSelect',
|
|
14825
15015
|
props: {
|
|
@@ -14941,9 +15131,18 @@ const CMultiSelect = vue.defineComponent({
|
|
|
14941
15131
|
* Enables search input element.
|
|
14942
15132
|
*/
|
|
14943
15133
|
search: {
|
|
14944
|
-
type: Boolean,
|
|
15134
|
+
type: [Boolean, String],
|
|
14945
15135
|
default: true,
|
|
14946
15136
|
required: false,
|
|
15137
|
+
validator: (value) => {
|
|
15138
|
+
if (typeof value == 'string') {
|
|
15139
|
+
return ['external'].includes(value);
|
|
15140
|
+
}
|
|
15141
|
+
if (typeof value == 'boolean') {
|
|
15142
|
+
return true;
|
|
15143
|
+
}
|
|
15144
|
+
return false;
|
|
15145
|
+
},
|
|
14947
15146
|
},
|
|
14948
15147
|
/**
|
|
14949
15148
|
* Sets the label for no results when filtering.
|
|
@@ -15045,59 +15244,63 @@ const CMultiSelect = vue.defineComponent({
|
|
|
15045
15244
|
* Execute a function when a user changes the selected option. [docs]
|
|
15046
15245
|
*/
|
|
15047
15246
|
'change',
|
|
15247
|
+
/**
|
|
15248
|
+
* Execute a function when the filter value changed.
|
|
15249
|
+
*
|
|
15250
|
+
* @since 4.7.0
|
|
15251
|
+
*/
|
|
15252
|
+
'filterChange',
|
|
15048
15253
|
],
|
|
15049
15254
|
setup(props, { attrs, emit }) {
|
|
15050
|
-
const
|
|
15051
|
-
|
|
15052
|
-
|
|
15053
|
-
|
|
15054
|
-
|
|
15055
|
-
const
|
|
15056
|
-
|
|
15057
|
-
|
|
15058
|
-
|
|
15059
|
-
|
|
15060
|
-
|
|
15061
|
-
}
|
|
15062
|
-
|
|
15063
|
-
|
|
15064
|
-
|
|
15065
|
-
|
|
15066
|
-
|
|
15067
|
-
|
|
15068
|
-
return option.options
|
|
15069
|
-
? { ...option, options: updateOptions(value, option.options) }
|
|
15070
|
-
: option.value == value // TODO: find solution
|
|
15071
|
-
? { ...option, selected: !option.selected, order: count.value }
|
|
15072
|
-
: { ...option };
|
|
15073
|
-
})
|
|
15074
|
-
: _options &&
|
|
15075
|
-
_options.map((option) => {
|
|
15076
|
-
return option.options
|
|
15077
|
-
? { ...option, options: updateOptions(value, option.options) }
|
|
15078
|
-
: option.value == value // TODO: find solution
|
|
15079
|
-
? { ...option, selected: true }
|
|
15080
|
-
: { ...option, selected: false };
|
|
15255
|
+
const nativeSelectRef = vue.ref();
|
|
15256
|
+
vue.provide('nativeSelectRef', nativeSelectRef);
|
|
15257
|
+
const searchRef = vue.ref();
|
|
15258
|
+
const options = vue.ref(props.options);
|
|
15259
|
+
const search = vue.ref('');
|
|
15260
|
+
const selected = vue.ref([]);
|
|
15261
|
+
const visible = vue.ref(props.visible);
|
|
15262
|
+
const selectOptions = (options, deselected) => {
|
|
15263
|
+
let _selected = [...selected.value, ...options];
|
|
15264
|
+
if (deselected) {
|
|
15265
|
+
_selected = _selected.filter((selectedOption) => !deselected.some((deselectedOption) => deselectedOption.value === selectedOption.value));
|
|
15266
|
+
}
|
|
15267
|
+
const deduplicated = _selected.reduce((unique, option) => {
|
|
15268
|
+
if (!unique.some((obj) => obj.value === option.value)) {
|
|
15269
|
+
unique.push({
|
|
15270
|
+
value: option.value,
|
|
15271
|
+
text: option.text,
|
|
15272
|
+
...(option.disabled && { disabled: option.disabled }),
|
|
15081
15273
|
});
|
|
15082
|
-
};
|
|
15083
|
-
const toggleAllOptions = (options, selected, counter = count.value) => {
|
|
15084
|
-
return options.map((option) => {
|
|
15085
|
-
!option.selected && counter++;
|
|
15086
|
-
count.value = counter;
|
|
15087
|
-
if (option.options) {
|
|
15088
|
-
return {
|
|
15089
|
-
...option,
|
|
15090
|
-
options: toggleAllOptions(option.options, selected, counter),
|
|
15091
|
-
};
|
|
15092
15274
|
}
|
|
15093
|
-
return
|
|
15094
|
-
|
|
15095
|
-
|
|
15096
|
-
? { ...option, selected: selected, order: counter }
|
|
15097
|
-
: { ...option, selected: selected };
|
|
15098
|
-
});
|
|
15275
|
+
return unique;
|
|
15276
|
+
}, []);
|
|
15277
|
+
selected.value = deduplicated;
|
|
15099
15278
|
};
|
|
15100
|
-
|
|
15279
|
+
vue.watch(() => props.options, (newValue, oldValue) => {
|
|
15280
|
+
if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) {
|
|
15281
|
+
options.value = newValue;
|
|
15282
|
+
const _selected = newValue &&
|
|
15283
|
+
flattenArray(newValue).filter((option) => {
|
|
15284
|
+
if (option.selected) {
|
|
15285
|
+
return option;
|
|
15286
|
+
}
|
|
15287
|
+
return;
|
|
15288
|
+
});
|
|
15289
|
+
const deselected = newValue &&
|
|
15290
|
+
flattenArray(newValue).filter((option) => {
|
|
15291
|
+
if (option.selected === false) {
|
|
15292
|
+
return option;
|
|
15293
|
+
}
|
|
15294
|
+
return;
|
|
15295
|
+
});
|
|
15296
|
+
_selected && selectOptions(_selected, deselected);
|
|
15297
|
+
}
|
|
15298
|
+
});
|
|
15299
|
+
vue.watch(selected, () => {
|
|
15300
|
+
nativeSelectRef.value &&
|
|
15301
|
+
nativeSelectRef.value.dispatchEvent(new Event('change', { bubbles: true }));
|
|
15302
|
+
});
|
|
15303
|
+
const filterOptionsList = (search, _options) => {
|
|
15101
15304
|
return search.length
|
|
15102
15305
|
? _options &&
|
|
15103
15306
|
_options.reduce((acc, val) => {
|
|
@@ -15111,70 +15314,54 @@ const CMultiSelect = vue.defineComponent({
|
|
|
15111
15314
|
}, [])
|
|
15112
15315
|
: options.value;
|
|
15113
15316
|
};
|
|
15114
|
-
|
|
15115
|
-
|
|
15116
|
-
|
|
15117
|
-
|
|
15118
|
-
|
|
15119
|
-
|
|
15120
|
-
|
|
15121
|
-
const selected = vue.ref(getSelectedOptions(props.options));
|
|
15122
|
-
const count = vue.ref(0);
|
|
15123
|
-
vue.watch(() => props.options, (newValue, oldValue) => {
|
|
15124
|
-
if (JSON.stringify(newValue) !== JSON.stringify(oldValue))
|
|
15125
|
-
options.value = newValue;
|
|
15126
|
-
});
|
|
15127
|
-
vue.watch(options, () => {
|
|
15128
|
-
const _selected = options.value && getSelectedOptions(options.value);
|
|
15129
|
-
_selected.sort((a, b) => {
|
|
15130
|
-
if (typeof a.order === 'undefined') {
|
|
15131
|
-
return -1;
|
|
15132
|
-
}
|
|
15133
|
-
if (b.order && a.order > b.order)
|
|
15134
|
-
return 1;
|
|
15135
|
-
if (b.order && a.order < b.order)
|
|
15136
|
-
return -1;
|
|
15137
|
-
return 0;
|
|
15138
|
-
});
|
|
15139
|
-
selected.value = _selected;
|
|
15140
|
-
});
|
|
15141
|
-
vue.watch([options, search], () => {
|
|
15142
|
-
vOptions.value = filterOptionsList(search.value, options.value);
|
|
15143
|
-
});
|
|
15144
|
-
vue.watch(selected, () => {
|
|
15145
|
-
nativeSelectRef.value &&
|
|
15146
|
-
nativeSelectRef.value.dispatchEvent(new Event('change', { bubbles: true }));
|
|
15147
|
-
});
|
|
15317
|
+
// watch(
|
|
15318
|
+
// () => props.options,
|
|
15319
|
+
// (newValue, oldValue) => {
|
|
15320
|
+
// console.log(props.options)
|
|
15321
|
+
// if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) options.value = newValue
|
|
15322
|
+
// },
|
|
15323
|
+
// )
|
|
15148
15324
|
const handleSearchChange = (event) => {
|
|
15149
15325
|
const target = event.target;
|
|
15150
15326
|
search.value = target.value.toLowerCase();
|
|
15327
|
+
emit('filterChange', target.value);
|
|
15151
15328
|
};
|
|
15152
15329
|
const handleSearchKeyDown = (event) => {
|
|
15153
|
-
if (search.value.length)
|
|
15330
|
+
if (search.value.length) {
|
|
15154
15331
|
return;
|
|
15332
|
+
}
|
|
15155
15333
|
if (event.key === 'Backspace' || event.key === 'Delete') {
|
|
15156
15334
|
const last = selected.value.filter((option) => !option.disabled).pop();
|
|
15157
15335
|
if (last) {
|
|
15158
15336
|
selected.value = selected.value.filter((option) => option.value !== last.value);
|
|
15159
|
-
options.value = updateOptions(last.value);
|
|
15160
15337
|
}
|
|
15161
15338
|
}
|
|
15162
15339
|
};
|
|
15163
15340
|
const handleOptionClick = (option) => {
|
|
15164
|
-
options.value = updateOptions(option.value);
|
|
15165
15341
|
if (!props.multiple) {
|
|
15342
|
+
selected.value = [{ value: option.value, text: option.text }];
|
|
15166
15343
|
visible.value = false;
|
|
15167
15344
|
search.value = '';
|
|
15168
15345
|
if (searchRef.value) {
|
|
15169
15346
|
searchRef.value.value = '';
|
|
15170
15347
|
}
|
|
15348
|
+
return;
|
|
15349
|
+
}
|
|
15350
|
+
if (selected.value.some((_option) => _option.value === option.value)) {
|
|
15351
|
+
selected.value = selected.value.filter((_option) => _option.value !== option.value);
|
|
15352
|
+
}
|
|
15353
|
+
else {
|
|
15354
|
+
selected.value = [
|
|
15355
|
+
...selected.value,
|
|
15356
|
+
{ value: option.value, text: option.text },
|
|
15357
|
+
];
|
|
15171
15358
|
}
|
|
15172
15359
|
};
|
|
15173
15360
|
const handleSelectAll = () => {
|
|
15174
|
-
options.value
|
|
15361
|
+
selectOptions(flattenArray(options.value).filter((option) => !option.disabled));
|
|
15175
15362
|
};
|
|
15176
15363
|
const handleDeselectAll = () => {
|
|
15177
|
-
|
|
15364
|
+
selected.value = selected.value.filter((option) => option.disabled);
|
|
15178
15365
|
};
|
|
15179
15366
|
return () => [
|
|
15180
15367
|
vue.h(CMultiSelectNativeSelect, {
|
|
@@ -15265,13 +15452,20 @@ const CMultiSelect = vue.defineComponent({
|
|
|
15265
15452
|
default: () => vue.h('div', {}, [
|
|
15266
15453
|
props.multiple &&
|
|
15267
15454
|
props.selectAll &&
|
|
15268
|
-
vue.h('button', {
|
|
15455
|
+
vue.h('button', {
|
|
15456
|
+
class: 'form-multi-select-all',
|
|
15457
|
+
onClick: () => handleSelectAll(),
|
|
15458
|
+
type: 'button',
|
|
15459
|
+
}, props.selectAllLabel),
|
|
15269
15460
|
vue.h(CMultiSelectOptions, {
|
|
15270
15461
|
onOptionClick: (option) => handleOptionClick(option),
|
|
15271
|
-
options:
|
|
15462
|
+
options: props.search === 'external'
|
|
15463
|
+
? options.value
|
|
15464
|
+
: filterOptionsList(search.value, options.value),
|
|
15272
15465
|
optionsMaxHeight: props.optionsMaxHeight,
|
|
15273
15466
|
optionsStyle: props.optionsStyle,
|
|
15274
15467
|
searchNoResultsLabel: props.searchNoResultsLabel,
|
|
15468
|
+
selected: selected.value
|
|
15275
15469
|
}),
|
|
15276
15470
|
]),
|
|
15277
15471
|
}),
|
|
@@ -15991,354 +16185,63 @@ const CPaginationItem = vue.defineComponent({
|
|
|
15991
16185
|
},
|
|
15992
16186
|
});
|
|
15993
16187
|
|
|
15994
|
-
const
|
|
15995
|
-
|
|
16188
|
+
const CPaginationPlugin = {
|
|
16189
|
+
install: (app) => {
|
|
16190
|
+
app.component(CPagination.name, CPagination);
|
|
16191
|
+
app.component(CPaginationItem.name, CPaginationItem);
|
|
16192
|
+
},
|
|
16193
|
+
};
|
|
16194
|
+
|
|
16195
|
+
const BREAKPOINTS$1 = [
|
|
16196
|
+
'xxl',
|
|
16197
|
+
'xl',
|
|
16198
|
+
'lg',
|
|
16199
|
+
'md',
|
|
16200
|
+
'sm',
|
|
16201
|
+
'xs',
|
|
16202
|
+
];
|
|
16203
|
+
const CPlaceholder = vue.defineComponent({
|
|
16204
|
+
name: 'CPlaceholder',
|
|
15996
16205
|
props: {
|
|
15997
16206
|
/**
|
|
15998
|
-
*
|
|
16207
|
+
* Set animation type to better convey the perception of something being actively loaded.
|
|
15999
16208
|
*
|
|
16000
|
-
* @
|
|
16209
|
+
* @values 'glow', 'wave'
|
|
16001
16210
|
*/
|
|
16002
|
-
|
|
16211
|
+
animation: {
|
|
16003
16212
|
type: String,
|
|
16004
|
-
default:
|
|
16213
|
+
default: undefined,
|
|
16005
16214
|
require: false,
|
|
16006
16215
|
validator: (value) => {
|
|
16007
|
-
return ['
|
|
16216
|
+
return ['glow', 'wave'].includes(value);
|
|
16008
16217
|
},
|
|
16009
16218
|
},
|
|
16010
16219
|
/**
|
|
16011
|
-
*
|
|
16220
|
+
* Sets the color context of the component to one of CoreUI’s themed colors.
|
|
16012
16221
|
*
|
|
16013
|
-
* @
|
|
16222
|
+
* @values 'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark', 'light'
|
|
16014
16223
|
*/
|
|
16015
|
-
|
|
16016
|
-
type: Number,
|
|
16017
|
-
default: 1,
|
|
16018
|
-
require: false,
|
|
16019
|
-
},
|
|
16224
|
+
color: Color,
|
|
16020
16225
|
/**
|
|
16021
|
-
*
|
|
16022
|
-
*
|
|
16023
|
-
* @default true
|
|
16226
|
+
* Component used for the root node. Either a string to use a HTML element or a component.
|
|
16024
16227
|
*/
|
|
16025
|
-
|
|
16026
|
-
type:
|
|
16027
|
-
default:
|
|
16028
|
-
|
|
16228
|
+
component: {
|
|
16229
|
+
type: String,
|
|
16230
|
+
default: 'span',
|
|
16231
|
+
required: false,
|
|
16029
16232
|
},
|
|
16030
16233
|
/**
|
|
16031
|
-
*
|
|
16234
|
+
* Size the component extra small, small, or large.
|
|
16032
16235
|
*
|
|
16033
|
-
* @
|
|
16236
|
+
* @values 'xs', 'sm', 'lg'
|
|
16034
16237
|
*/
|
|
16035
|
-
|
|
16036
|
-
type:
|
|
16037
|
-
default:
|
|
16038
|
-
|
|
16039
|
-
|
|
16040
|
-
|
|
16041
|
-
|
|
16042
|
-
*
|
|
16043
|
-
* @default true
|
|
16044
|
-
*/
|
|
16045
|
-
doubleArrows: {
|
|
16046
|
-
type: Boolean,
|
|
16047
|
-
default: true,
|
|
16048
|
-
require: false,
|
|
16049
|
-
},
|
|
16050
|
-
/**
|
|
16051
|
-
* The content of 'firstButton' button
|
|
16052
|
-
*
|
|
16053
|
-
* @default '«'
|
|
16054
|
-
*/
|
|
16055
|
-
firstButton: {
|
|
16056
|
-
type: String,
|
|
16057
|
-
default: '«',
|
|
16058
|
-
require: false,
|
|
16059
|
-
},
|
|
16060
|
-
/**
|
|
16061
|
-
* The content of 'lastButton' button
|
|
16062
|
-
*
|
|
16063
|
-
* @default '»'
|
|
16064
|
-
*/
|
|
16065
|
-
lastButton: {
|
|
16066
|
-
type: String,
|
|
16067
|
-
default: '»',
|
|
16068
|
-
require: false,
|
|
16069
|
-
},
|
|
16070
|
-
/**
|
|
16071
|
-
* Maximum items number
|
|
16072
|
-
*
|
|
16073
|
-
* @default 5
|
|
16074
|
-
*/
|
|
16075
|
-
limit: {
|
|
16076
|
-
type: Number,
|
|
16077
|
-
default: 5,
|
|
16078
|
-
require: false,
|
|
16079
|
-
},
|
|
16080
|
-
/**
|
|
16081
|
-
* The content of 'nextButton' button
|
|
16082
|
-
*
|
|
16083
|
-
* @default '›'
|
|
16084
|
-
*/
|
|
16085
|
-
nextButton: {
|
|
16086
|
-
type: String,
|
|
16087
|
-
default: '›',
|
|
16088
|
-
require: false,
|
|
16089
|
-
},
|
|
16090
|
-
/**
|
|
16091
|
-
* Number of pages
|
|
16092
|
-
*/
|
|
16093
|
-
pages: {
|
|
16094
|
-
type: Number,
|
|
16095
|
-
default: 1000,
|
|
16096
|
-
require: true,
|
|
16097
|
-
},
|
|
16098
|
-
/**
|
|
16099
|
-
* The content of 'previousButton' button
|
|
16100
|
-
*
|
|
16101
|
-
* @default '‹'
|
|
16102
|
-
*/
|
|
16103
|
-
previousButton: {
|
|
16104
|
-
type: String,
|
|
16105
|
-
default: '‹',
|
|
16106
|
-
require: false,
|
|
16107
|
-
},
|
|
16108
|
-
/**
|
|
16109
|
-
* Size of pagination, valid values: 'sm', 'lg'
|
|
16110
|
-
*/
|
|
16111
|
-
size: {
|
|
16112
|
-
type: String,
|
|
16113
|
-
default: undefined,
|
|
16114
|
-
required: false,
|
|
16115
|
-
validator: (value) => {
|
|
16116
|
-
return ['sm', 'lg'].includes(value);
|
|
16117
|
-
},
|
|
16118
|
-
},
|
|
16119
|
-
},
|
|
16120
|
-
emits: [
|
|
16121
|
-
/**
|
|
16122
|
-
* On active page change callback.
|
|
16123
|
-
*/
|
|
16124
|
-
'activePageChange',
|
|
16125
|
-
],
|
|
16126
|
-
setup(props, { emit }) {
|
|
16127
|
-
const activePage = vue.ref(props.activePage);
|
|
16128
|
-
const limit = vue.ref(props.limit);
|
|
16129
|
-
const pages = vue.ref(props.pages);
|
|
16130
|
-
vue.watch(props, () => {
|
|
16131
|
-
activePage.value = props.activePage;
|
|
16132
|
-
limit.value = props.limit;
|
|
16133
|
-
pages.value = props.pages;
|
|
16134
|
-
});
|
|
16135
|
-
const showDots = vue.computed(() => {
|
|
16136
|
-
return props.dots && limit.value > 4 && limit.value < pages.value;
|
|
16137
|
-
});
|
|
16138
|
-
const maxPrevItems = vue.computed(() => {
|
|
16139
|
-
return Math.floor((limit.value - 1) / 2);
|
|
16140
|
-
});
|
|
16141
|
-
const maxNextItems = vue.computed(() => {
|
|
16142
|
-
return Math.ceil((limit.value - 1) / 2);
|
|
16143
|
-
});
|
|
16144
|
-
const beforeDots = vue.computed(() => {
|
|
16145
|
-
return showDots.value && activePage.value > maxPrevItems.value + 1;
|
|
16146
|
-
});
|
|
16147
|
-
const afterDots = vue.computed(() => {
|
|
16148
|
-
return showDots.value && activePage.value < pages.value - maxNextItems.value;
|
|
16149
|
-
});
|
|
16150
|
-
const computedLimit = vue.computed(() => {
|
|
16151
|
-
return limit.value - (afterDots.value ? 1 : 0) - (beforeDots.value ? 1 : 0);
|
|
16152
|
-
});
|
|
16153
|
-
const range = vue.computed(() => {
|
|
16154
|
-
return activePage.value + maxNextItems.value;
|
|
16155
|
-
});
|
|
16156
|
-
const lastItem = vue.computed(() => {
|
|
16157
|
-
return range.value >= pages.value ? pages.value : range.value - (afterDots.value ? 1 : 0);
|
|
16158
|
-
});
|
|
16159
|
-
const itemsAmount = vue.computed(() => {
|
|
16160
|
-
return pages.value < computedLimit.value ? pages.value : computedLimit.value;
|
|
16161
|
-
});
|
|
16162
|
-
const items = vue.computed(() => {
|
|
16163
|
-
if (activePage.value - maxPrevItems.value <= 1) {
|
|
16164
|
-
return Array.from({
|
|
16165
|
-
length: itemsAmount.value,
|
|
16166
|
-
}, (_v, i) => i + 1);
|
|
16167
|
-
}
|
|
16168
|
-
else {
|
|
16169
|
-
return Array.from({
|
|
16170
|
-
length: itemsAmount.value,
|
|
16171
|
-
}, (_v, i) => {
|
|
16172
|
-
return lastItem.value - i;
|
|
16173
|
-
}).reverse();
|
|
16174
|
-
}
|
|
16175
|
-
});
|
|
16176
|
-
const setPage = (number) => {
|
|
16177
|
-
if (number !== activePage.value) {
|
|
16178
|
-
activePage.value = number;
|
|
16179
|
-
emit('activePageChange', number);
|
|
16180
|
-
}
|
|
16181
|
-
};
|
|
16182
|
-
return () => vue.h(CPagination, {
|
|
16183
|
-
align: props.align,
|
|
16184
|
-
'aria-label': 'pagination',
|
|
16185
|
-
size: props.size,
|
|
16186
|
-
}, {
|
|
16187
|
-
default: () => [
|
|
16188
|
-
props.doubleArrows &&
|
|
16189
|
-
vue.h(CPaginationItem, {
|
|
16190
|
-
onClick: () => {
|
|
16191
|
-
activePage.value !== 1 && setPage(1);
|
|
16192
|
-
},
|
|
16193
|
-
'aria-label': 'Go to first page',
|
|
16194
|
-
...(activePage.value === 1 && {
|
|
16195
|
-
'aria-disabled': true,
|
|
16196
|
-
disabled: true,
|
|
16197
|
-
}),
|
|
16198
|
-
}, {
|
|
16199
|
-
default: () => typeof props.firstButton === 'string'
|
|
16200
|
-
? vue.h('span', {
|
|
16201
|
-
innerHTML: props.firstButton,
|
|
16202
|
-
})
|
|
16203
|
-
: props.firstButton,
|
|
16204
|
-
}),
|
|
16205
|
-
props.arrows &&
|
|
16206
|
-
vue.h(CPaginationItem, {
|
|
16207
|
-
onClick: () => {
|
|
16208
|
-
activePage.value !== 1 && setPage(activePage.value - 1);
|
|
16209
|
-
},
|
|
16210
|
-
'aria-label': 'Go to previous page',
|
|
16211
|
-
...(activePage.value === 1 && {
|
|
16212
|
-
'aria-disabled': true,
|
|
16213
|
-
disabled: true,
|
|
16214
|
-
}),
|
|
16215
|
-
}, {
|
|
16216
|
-
default: () => typeof props.previousButton === 'string'
|
|
16217
|
-
? vue.h('span', {
|
|
16218
|
-
innerHTML: props.previousButton,
|
|
16219
|
-
})
|
|
16220
|
-
: props.previousButton,
|
|
16221
|
-
}),
|
|
16222
|
-
beforeDots.value &&
|
|
16223
|
-
vue.h(CPaginationItem, {
|
|
16224
|
-
role: 'separator',
|
|
16225
|
-
disabled: true,
|
|
16226
|
-
}, {
|
|
16227
|
-
default: () => '...',
|
|
16228
|
-
}),
|
|
16229
|
-
items.value.map((i) => {
|
|
16230
|
-
return vue.h(CPaginationItem, {
|
|
16231
|
-
onClick: () => setPage(i),
|
|
16232
|
-
'aria-label': activePage.value === i ? `Current page ${i}` : `Go to page ${i}`,
|
|
16233
|
-
active: activePage.value === i,
|
|
16234
|
-
}, {
|
|
16235
|
-
default: () => i,
|
|
16236
|
-
});
|
|
16237
|
-
}),
|
|
16238
|
-
afterDots.value &&
|
|
16239
|
-
vue.h(CPaginationItem, {
|
|
16240
|
-
role: 'separator',
|
|
16241
|
-
disabled: true,
|
|
16242
|
-
}, {
|
|
16243
|
-
default: () => '...',
|
|
16244
|
-
}),
|
|
16245
|
-
props.arrows &&
|
|
16246
|
-
vue.h(CPaginationItem, {
|
|
16247
|
-
onClick: () => {
|
|
16248
|
-
activePage.value !== pages.value && setPage(activePage.value + 1);
|
|
16249
|
-
},
|
|
16250
|
-
'aria-label': 'Go to next page',
|
|
16251
|
-
...(activePage.value === pages.value && {
|
|
16252
|
-
'aria-disabled': true,
|
|
16253
|
-
disabled: true,
|
|
16254
|
-
}),
|
|
16255
|
-
}, {
|
|
16256
|
-
default: () => typeof props.nextButton === 'string'
|
|
16257
|
-
? vue.h('span', {
|
|
16258
|
-
innerHTML: props.nextButton,
|
|
16259
|
-
})
|
|
16260
|
-
: props.nextButton,
|
|
16261
|
-
}),
|
|
16262
|
-
props.doubleArrows &&
|
|
16263
|
-
vue.h(CPaginationItem, {
|
|
16264
|
-
onClick: () => {
|
|
16265
|
-
activePage.value !== pages.value && setPage(pages.value);
|
|
16266
|
-
},
|
|
16267
|
-
'aria-label': 'Go to last page',
|
|
16268
|
-
...(activePage.value === pages.value && {
|
|
16269
|
-
'aria-disabled': true,
|
|
16270
|
-
disabled: true,
|
|
16271
|
-
}),
|
|
16272
|
-
}, {
|
|
16273
|
-
default: () => typeof props.lastButton === 'string'
|
|
16274
|
-
? vue.h('span', {
|
|
16275
|
-
innerHTML: props.lastButton,
|
|
16276
|
-
})
|
|
16277
|
-
: props.lastButton,
|
|
16278
|
-
}),
|
|
16279
|
-
],
|
|
16280
|
-
});
|
|
16281
|
-
},
|
|
16282
|
-
});
|
|
16283
|
-
|
|
16284
|
-
const CPaginationPlugin = {
|
|
16285
|
-
install: (app) => {
|
|
16286
|
-
app.component(CPagination.name, CPagination);
|
|
16287
|
-
app.component(CPaginationItem.name, CPaginationItem);
|
|
16288
|
-
app.component(CSmartPagination.name, CSmartPagination);
|
|
16289
|
-
},
|
|
16290
|
-
};
|
|
16291
|
-
|
|
16292
|
-
const BREAKPOINTS$1 = [
|
|
16293
|
-
'xxl',
|
|
16294
|
-
'xl',
|
|
16295
|
-
'lg',
|
|
16296
|
-
'md',
|
|
16297
|
-
'sm',
|
|
16298
|
-
'xs',
|
|
16299
|
-
];
|
|
16300
|
-
const CPlaceholder = vue.defineComponent({
|
|
16301
|
-
name: 'CPlaceholder',
|
|
16302
|
-
props: {
|
|
16303
|
-
/**
|
|
16304
|
-
* Set animation type to better convey the perception of something being actively loaded.
|
|
16305
|
-
*
|
|
16306
|
-
* @values 'glow', 'wave'
|
|
16307
|
-
*/
|
|
16308
|
-
animation: {
|
|
16309
|
-
type: String,
|
|
16310
|
-
default: undefined,
|
|
16311
|
-
require: false,
|
|
16312
|
-
validator: (value) => {
|
|
16313
|
-
return ['glow', 'wave'].includes(value);
|
|
16314
|
-
},
|
|
16315
|
-
},
|
|
16316
|
-
/**
|
|
16317
|
-
* Sets the color context of the component to one of CoreUI’s themed colors.
|
|
16318
|
-
*
|
|
16319
|
-
* @values 'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark', 'light'
|
|
16320
|
-
*/
|
|
16321
|
-
color: Color,
|
|
16322
|
-
/**
|
|
16323
|
-
* Component used for the root node. Either a string to use a HTML element or a component.
|
|
16324
|
-
*/
|
|
16325
|
-
component: {
|
|
16326
|
-
type: String,
|
|
16327
|
-
default: 'span',
|
|
16328
|
-
required: false,
|
|
16329
|
-
},
|
|
16330
|
-
/**
|
|
16331
|
-
* Size the component extra small, small, or large.
|
|
16332
|
-
*
|
|
16333
|
-
* @values 'xs', 'sm', 'lg'
|
|
16334
|
-
*/
|
|
16335
|
-
size: {
|
|
16336
|
-
type: String,
|
|
16337
|
-
default: undefined,
|
|
16338
|
-
required: false,
|
|
16339
|
-
validator: (value) => {
|
|
16340
|
-
return ['xs', 'sm', 'lg'].includes(value);
|
|
16341
|
-
},
|
|
16238
|
+
size: {
|
|
16239
|
+
type: String,
|
|
16240
|
+
default: undefined,
|
|
16241
|
+
required: false,
|
|
16242
|
+
validator: (value) => {
|
|
16243
|
+
return ['xs', 'sm', 'lg'].includes(value);
|
|
16244
|
+
},
|
|
16342
16245
|
},
|
|
16343
16246
|
/**
|
|
16344
16247
|
* The number of columns on extra small devices (<576px).
|
|
@@ -16678,259 +16581,548 @@ const CPopover = vue.defineComponent({
|
|
|
16678
16581
|
},
|
|
16679
16582
|
});
|
|
16680
16583
|
|
|
16681
|
-
const CPopoverPlugin = {
|
|
16584
|
+
const CPopoverPlugin = {
|
|
16585
|
+
install: (app) => {
|
|
16586
|
+
app.component(CPopover.name, CPopover);
|
|
16587
|
+
},
|
|
16588
|
+
};
|
|
16589
|
+
|
|
16590
|
+
const isOnMobile = (element) => Boolean(getComputedStyle(element).getPropertyValue('--cui-is-mobile'));
|
|
16591
|
+
const CSidebar = vue.defineComponent({
|
|
16592
|
+
name: 'CSidebar',
|
|
16593
|
+
props: {
|
|
16594
|
+
/**
|
|
16595
|
+
* Sets if the color of text should be colored for a light or dark dark background.
|
|
16596
|
+
*
|
|
16597
|
+
* @values 'dark', light'
|
|
16598
|
+
*/
|
|
16599
|
+
colorScheme: {
|
|
16600
|
+
type: String,
|
|
16601
|
+
default: undefined,
|
|
16602
|
+
validator: (value) => {
|
|
16603
|
+
return ['dark', 'light'].includes(value);
|
|
16604
|
+
},
|
|
16605
|
+
},
|
|
16606
|
+
/**
|
|
16607
|
+
* Make sidebar narrow.
|
|
16608
|
+
*/
|
|
16609
|
+
narrow: {
|
|
16610
|
+
type: Boolean,
|
|
16611
|
+
required: false,
|
|
16612
|
+
},
|
|
16613
|
+
/**
|
|
16614
|
+
* Set sidebar to overlaid variant.
|
|
16615
|
+
*/
|
|
16616
|
+
overlaid: {
|
|
16617
|
+
type: Boolean,
|
|
16618
|
+
required: false,
|
|
16619
|
+
},
|
|
16620
|
+
/**
|
|
16621
|
+
* Components placement, there’s no default placement.
|
|
16622
|
+
* @values 'start', 'end'
|
|
16623
|
+
*/
|
|
16624
|
+
placement: {
|
|
16625
|
+
type: String,
|
|
16626
|
+
default: undefined,
|
|
16627
|
+
validator: (value) => {
|
|
16628
|
+
return ['start', 'end'].includes(value);
|
|
16629
|
+
},
|
|
16630
|
+
},
|
|
16631
|
+
/**
|
|
16632
|
+
* Place sidebar in non-static positions.
|
|
16633
|
+
*/
|
|
16634
|
+
position: {
|
|
16635
|
+
type: String,
|
|
16636
|
+
default: undefined,
|
|
16637
|
+
validator: (value) => {
|
|
16638
|
+
return ['fixed'].includes(value);
|
|
16639
|
+
},
|
|
16640
|
+
},
|
|
16641
|
+
/**
|
|
16642
|
+
* Size the component small, large, or extra large.
|
|
16643
|
+
*/
|
|
16644
|
+
size: {
|
|
16645
|
+
type: String,
|
|
16646
|
+
default: undefined,
|
|
16647
|
+
validator: (value) => {
|
|
16648
|
+
return ['sm', 'lg', 'xl'].includes(value);
|
|
16649
|
+
},
|
|
16650
|
+
},
|
|
16651
|
+
/**
|
|
16652
|
+
* Expand narrowed sidebar on hover.
|
|
16653
|
+
*/
|
|
16654
|
+
unfoldable: Boolean,
|
|
16655
|
+
/**
|
|
16656
|
+
* Toggle the visibility of sidebar component.
|
|
16657
|
+
*/
|
|
16658
|
+
visible: Boolean,
|
|
16659
|
+
},
|
|
16660
|
+
emits: [
|
|
16661
|
+
/**
|
|
16662
|
+
* Callback fired when the component requests to be hidden.
|
|
16663
|
+
*/
|
|
16664
|
+
'hide',
|
|
16665
|
+
/**
|
|
16666
|
+
* Callback fired when the component requests to be shown.
|
|
16667
|
+
*/
|
|
16668
|
+
'show',
|
|
16669
|
+
/**
|
|
16670
|
+
* Event emitted after visibility of component changed.
|
|
16671
|
+
*/
|
|
16672
|
+
'visible-change',
|
|
16673
|
+
],
|
|
16674
|
+
setup(props, { attrs, slots, emit }) {
|
|
16675
|
+
const mobile = vue.ref();
|
|
16676
|
+
const inViewport = vue.ref();
|
|
16677
|
+
const sidebarRef = vue.ref();
|
|
16678
|
+
const visible = vue.ref(props.visible);
|
|
16679
|
+
vue.watch(inViewport, () => {
|
|
16680
|
+
emit('visible-change', inViewport.value);
|
|
16681
|
+
inViewport.value ? emit('show') : emit('hide');
|
|
16682
|
+
});
|
|
16683
|
+
vue.watch(() => props.visible, () => (visible.value = props.visible));
|
|
16684
|
+
vue.watch(mobile, () => {
|
|
16685
|
+
if (mobile.value && visible.value)
|
|
16686
|
+
visible.value = false;
|
|
16687
|
+
});
|
|
16688
|
+
vue.onMounted(() => {
|
|
16689
|
+
mobile.value = isOnMobile(sidebarRef.value);
|
|
16690
|
+
inViewport.value = isVisible(sidebarRef.value);
|
|
16691
|
+
window.addEventListener('resize', () => handleResize());
|
|
16692
|
+
window.addEventListener('mouseup', handleClickOutside);
|
|
16693
|
+
window.addEventListener('keyup', handleKeyup);
|
|
16694
|
+
sidebarRef.value.addEventListener('mouseup', handleOnClick);
|
|
16695
|
+
sidebarRef.value.addEventListener('transitionend', () => {
|
|
16696
|
+
inViewport.value = isVisible(sidebarRef.value);
|
|
16697
|
+
});
|
|
16698
|
+
});
|
|
16699
|
+
vue.onBeforeUnmount(() => {
|
|
16700
|
+
window.removeEventListener('resize', () => handleResize());
|
|
16701
|
+
window.removeEventListener('mouseup', handleClickOutside);
|
|
16702
|
+
window.removeEventListener('keyup', handleKeyup);
|
|
16703
|
+
sidebarRef.value.removeEventListener('mouseup', handleOnClick);
|
|
16704
|
+
sidebarRef.value.removeEventListener('transitionend', () => {
|
|
16705
|
+
inViewport.value = isVisible(sidebarRef.value);
|
|
16706
|
+
});
|
|
16707
|
+
});
|
|
16708
|
+
const handleHide = () => {
|
|
16709
|
+
visible.value = false;
|
|
16710
|
+
emit('visible-change', false);
|
|
16711
|
+
};
|
|
16712
|
+
const handleResize = () => {
|
|
16713
|
+
mobile.value = isOnMobile(sidebarRef.value);
|
|
16714
|
+
inViewport.value = isVisible(sidebarRef.value);
|
|
16715
|
+
};
|
|
16716
|
+
const handleKeyup = (event) => {
|
|
16717
|
+
if (mobile.value && !sidebarRef.value.contains(event.target)) {
|
|
16718
|
+
handleHide();
|
|
16719
|
+
}
|
|
16720
|
+
};
|
|
16721
|
+
const handleClickOutside = (event) => {
|
|
16722
|
+
if (mobile.value && !sidebarRef.value.contains(event.target)) {
|
|
16723
|
+
handleHide();
|
|
16724
|
+
}
|
|
16725
|
+
};
|
|
16726
|
+
const handleOnClick = (event) => {
|
|
16727
|
+
const target = event.target;
|
|
16728
|
+
target &&
|
|
16729
|
+
target.classList.contains('nav-link') &&
|
|
16730
|
+
!target.classList.contains('nav-group-toggle') &&
|
|
16731
|
+
mobile.value &&
|
|
16732
|
+
handleHide();
|
|
16733
|
+
};
|
|
16734
|
+
return () => [
|
|
16735
|
+
vue.h('div', {
|
|
16736
|
+
class: [
|
|
16737
|
+
'sidebar',
|
|
16738
|
+
{
|
|
16739
|
+
[`sidebar-${props.colorScheme}`]: props.colorScheme,
|
|
16740
|
+
'sidebar-narrow': props.narrow,
|
|
16741
|
+
'sidebar-overlaid': props.overlaid,
|
|
16742
|
+
[`sidebar-${props.placement}`]: props.placement,
|
|
16743
|
+
[`sidebar-${props.position}`]: props.position,
|
|
16744
|
+
[`sidebar-${props.size}`]: props.size,
|
|
16745
|
+
'sidebar-narrow-unfoldable': props.unfoldable,
|
|
16746
|
+
show: visible.value === true && mobile.value,
|
|
16747
|
+
hide: visible.value === false && !mobile.value,
|
|
16748
|
+
},
|
|
16749
|
+
attrs.class,
|
|
16750
|
+
],
|
|
16751
|
+
ref: sidebarRef,
|
|
16752
|
+
}, slots.default && slots.default()),
|
|
16753
|
+
mobile.value &&
|
|
16754
|
+
vue.h(CBackdrop, {
|
|
16755
|
+
class: 'sidebar-backdrop d-none',
|
|
16756
|
+
visible: props.visible,
|
|
16757
|
+
onClick: () => handleHide(),
|
|
16758
|
+
}),
|
|
16759
|
+
];
|
|
16760
|
+
},
|
|
16761
|
+
});
|
|
16762
|
+
|
|
16763
|
+
const CSidebarBrand = vue.defineComponent({
|
|
16764
|
+
name: 'CSidebarBrand',
|
|
16765
|
+
setup(_, { slots }) {
|
|
16766
|
+
return () => vue.h('div', { class: 'sidebar-brand' }, slots.default && slots.default());
|
|
16767
|
+
},
|
|
16768
|
+
});
|
|
16769
|
+
|
|
16770
|
+
const CSidebarFooter = vue.defineComponent({
|
|
16771
|
+
name: 'CSidebarFooter',
|
|
16772
|
+
setup(_, { slots }) {
|
|
16773
|
+
return () => vue.h('div', { class: 'sidebar-footer' }, slots.default && slots.default());
|
|
16774
|
+
},
|
|
16775
|
+
});
|
|
16776
|
+
|
|
16777
|
+
const CSidebarHeader = vue.defineComponent({
|
|
16778
|
+
name: 'CSidebarHeader',
|
|
16779
|
+
setup(_, { slots }) {
|
|
16780
|
+
return () => vue.h('div', { class: 'sidebar-header' }, slots.default && slots.default());
|
|
16781
|
+
},
|
|
16782
|
+
});
|
|
16783
|
+
|
|
16784
|
+
const CSidebarNav = vue.defineComponent({
|
|
16785
|
+
name: 'CSidebarNav',
|
|
16786
|
+
setup(_, { slots }) {
|
|
16787
|
+
const visibleGroup = vue.ref();
|
|
16788
|
+
const handleVisibleChange = (visible, index) => {
|
|
16789
|
+
if (visible) {
|
|
16790
|
+
visibleGroup.value = index;
|
|
16791
|
+
}
|
|
16792
|
+
else {
|
|
16793
|
+
if (visibleGroup.value === index) {
|
|
16794
|
+
visibleGroup.value = 0;
|
|
16795
|
+
}
|
|
16796
|
+
}
|
|
16797
|
+
};
|
|
16798
|
+
const isVisible = (index) => Boolean(visibleGroup.value === index);
|
|
16799
|
+
return () => vue.h('ul', {
|
|
16800
|
+
class: 'sidebar-nav',
|
|
16801
|
+
}, slots.default &&
|
|
16802
|
+
slots.default().map((vnode, index) => {
|
|
16803
|
+
// @ts-expect-error name is defined in component
|
|
16804
|
+
if (vnode.type.name === 'CNavGroup') {
|
|
16805
|
+
return vue.h(vnode, {
|
|
16806
|
+
onVisibleChange: (visible) => handleVisibleChange(visible, index + 1),
|
|
16807
|
+
...(visibleGroup.value && { visible: isVisible(index + 1) }),
|
|
16808
|
+
});
|
|
16809
|
+
}
|
|
16810
|
+
return vnode;
|
|
16811
|
+
}));
|
|
16812
|
+
},
|
|
16813
|
+
});
|
|
16814
|
+
|
|
16815
|
+
const CSidebarToggler = vue.defineComponent({
|
|
16816
|
+
name: 'CSidebarToggler',
|
|
16817
|
+
setup(_, { slots }) {
|
|
16818
|
+
return () => vue.h('button', { class: 'sidebar-toggler' }, slots.default && slots.default());
|
|
16819
|
+
},
|
|
16820
|
+
});
|
|
16821
|
+
|
|
16822
|
+
const CSidebarPlugin = {
|
|
16682
16823
|
install: (app) => {
|
|
16683
|
-
app.component(
|
|
16824
|
+
app.component(CSidebar.name, CSidebar);
|
|
16825
|
+
app.component(CSidebarBrand.name, CSidebarBrand);
|
|
16826
|
+
app.component(CSidebarFooter.name, CSidebarFooter);
|
|
16827
|
+
app.component(CSidebarHeader.name, CSidebarHeader);
|
|
16828
|
+
app.component(CSidebarNav.name, CSidebarNav);
|
|
16829
|
+
app.component(CSidebarToggler.name, CSidebarToggler);
|
|
16684
16830
|
},
|
|
16685
16831
|
};
|
|
16686
16832
|
|
|
16687
|
-
const
|
|
16688
|
-
|
|
16689
|
-
const rect = element.getBoundingClientRect();
|
|
16690
|
-
return (rect.top >= 0 &&
|
|
16691
|
-
rect.left >= 0 &&
|
|
16692
|
-
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
|
|
16693
|
-
rect.right <= (window.innerWidth || document.documentElement.clientWidth));
|
|
16694
|
-
};
|
|
16695
|
-
const CSidebar = vue.defineComponent({
|
|
16696
|
-
name: 'CSidebar',
|
|
16833
|
+
const CSmartPagination = vue.defineComponent({
|
|
16834
|
+
name: 'CSmartPagination',
|
|
16697
16835
|
props: {
|
|
16698
16836
|
/**
|
|
16699
|
-
*
|
|
16837
|
+
* Horizontall align
|
|
16700
16838
|
*
|
|
16701
|
-
* @
|
|
16839
|
+
* @default 'start'
|
|
16702
16840
|
*/
|
|
16703
|
-
|
|
16841
|
+
align: {
|
|
16704
16842
|
type: String,
|
|
16705
|
-
default:
|
|
16843
|
+
default: 'start',
|
|
16844
|
+
require: false,
|
|
16706
16845
|
validator: (value) => {
|
|
16707
|
-
return ['
|
|
16846
|
+
return ['start', 'center', 'end'].includes(value);
|
|
16708
16847
|
},
|
|
16709
16848
|
},
|
|
16710
16849
|
/**
|
|
16711
|
-
*
|
|
16850
|
+
* Current page number
|
|
16851
|
+
*
|
|
16852
|
+
* @default 1
|
|
16712
16853
|
*/
|
|
16713
|
-
|
|
16854
|
+
activePage: {
|
|
16855
|
+
type: Number,
|
|
16856
|
+
default: 1,
|
|
16857
|
+
require: false,
|
|
16858
|
+
},
|
|
16859
|
+
/**
|
|
16860
|
+
* Show/hide arrows
|
|
16861
|
+
*
|
|
16862
|
+
* @default true
|
|
16863
|
+
*/
|
|
16864
|
+
arrows: {
|
|
16714
16865
|
type: Boolean,
|
|
16715
|
-
|
|
16866
|
+
default: true,
|
|
16867
|
+
require: false,
|
|
16716
16868
|
},
|
|
16717
16869
|
/**
|
|
16718
|
-
*
|
|
16870
|
+
* Show/hide dots
|
|
16871
|
+
*
|
|
16872
|
+
* @default true
|
|
16719
16873
|
*/
|
|
16720
|
-
|
|
16874
|
+
dots: {
|
|
16721
16875
|
type: Boolean,
|
|
16722
|
-
|
|
16876
|
+
default: true,
|
|
16877
|
+
require: false,
|
|
16723
16878
|
},
|
|
16724
16879
|
/**
|
|
16725
|
-
*
|
|
16726
|
-
*
|
|
16880
|
+
* Show double arrows buttons
|
|
16881
|
+
*
|
|
16882
|
+
* @default true
|
|
16727
16883
|
*/
|
|
16728
|
-
|
|
16729
|
-
type:
|
|
16730
|
-
default:
|
|
16731
|
-
|
|
16732
|
-
return ['start', 'end'].includes(value);
|
|
16733
|
-
},
|
|
16884
|
+
doubleArrows: {
|
|
16885
|
+
type: Boolean,
|
|
16886
|
+
default: true,
|
|
16887
|
+
require: false,
|
|
16734
16888
|
},
|
|
16735
16889
|
/**
|
|
16736
|
-
*
|
|
16890
|
+
* The content of 'firstButton' button
|
|
16891
|
+
*
|
|
16892
|
+
* @default '«'
|
|
16737
16893
|
*/
|
|
16738
|
-
|
|
16894
|
+
firstButton: {
|
|
16739
16895
|
type: String,
|
|
16740
|
-
default:
|
|
16741
|
-
|
|
16742
|
-
return ['fixed'].includes(value);
|
|
16743
|
-
},
|
|
16896
|
+
default: '«',
|
|
16897
|
+
require: false,
|
|
16744
16898
|
},
|
|
16745
16899
|
/**
|
|
16746
|
-
*
|
|
16900
|
+
* The content of 'lastButton' button
|
|
16901
|
+
*
|
|
16902
|
+
* @default '»'
|
|
16747
16903
|
*/
|
|
16748
|
-
|
|
16904
|
+
lastButton: {
|
|
16749
16905
|
type: String,
|
|
16750
|
-
default:
|
|
16751
|
-
|
|
16752
|
-
return ['sm', 'lg', 'xl'].includes(value);
|
|
16753
|
-
},
|
|
16906
|
+
default: '»',
|
|
16907
|
+
require: false,
|
|
16754
16908
|
},
|
|
16755
16909
|
/**
|
|
16756
|
-
*
|
|
16910
|
+
* Maximum items number
|
|
16911
|
+
*
|
|
16912
|
+
* @default 5
|
|
16757
16913
|
*/
|
|
16758
|
-
|
|
16914
|
+
limit: {
|
|
16915
|
+
type: Number,
|
|
16916
|
+
default: 5,
|
|
16917
|
+
require: false,
|
|
16918
|
+
},
|
|
16759
16919
|
/**
|
|
16760
|
-
*
|
|
16920
|
+
* The content of 'nextButton' button
|
|
16921
|
+
*
|
|
16922
|
+
* @default '›'
|
|
16761
16923
|
*/
|
|
16762
|
-
|
|
16763
|
-
|
|
16764
|
-
|
|
16924
|
+
nextButton: {
|
|
16925
|
+
type: String,
|
|
16926
|
+
default: '›',
|
|
16927
|
+
require: false,
|
|
16928
|
+
},
|
|
16765
16929
|
/**
|
|
16766
|
-
*
|
|
16930
|
+
* Number of pages
|
|
16767
16931
|
*/
|
|
16768
|
-
|
|
16932
|
+
pages: {
|
|
16933
|
+
type: Number,
|
|
16934
|
+
default: 1000,
|
|
16935
|
+
require: true,
|
|
16936
|
+
},
|
|
16769
16937
|
/**
|
|
16770
|
-
*
|
|
16938
|
+
* The content of 'previousButton' button
|
|
16939
|
+
*
|
|
16940
|
+
* @default '‹'
|
|
16771
16941
|
*/
|
|
16772
|
-
|
|
16942
|
+
previousButton: {
|
|
16943
|
+
type: String,
|
|
16944
|
+
default: '‹',
|
|
16945
|
+
require: false,
|
|
16946
|
+
},
|
|
16773
16947
|
/**
|
|
16774
|
-
*
|
|
16948
|
+
* Size of pagination, valid values: 'sm', 'lg'
|
|
16775
16949
|
*/
|
|
16776
|
-
|
|
16950
|
+
size: {
|
|
16951
|
+
type: String,
|
|
16952
|
+
default: undefined,
|
|
16953
|
+
required: false,
|
|
16954
|
+
validator: (value) => {
|
|
16955
|
+
return ['sm', 'lg'].includes(value);
|
|
16956
|
+
},
|
|
16957
|
+
},
|
|
16958
|
+
},
|
|
16959
|
+
emits: [
|
|
16960
|
+
/**
|
|
16961
|
+
* On active page change callback.
|
|
16962
|
+
*/
|
|
16963
|
+
'activePageChange',
|
|
16777
16964
|
],
|
|
16778
|
-
setup(props, {
|
|
16779
|
-
const
|
|
16780
|
-
const
|
|
16781
|
-
const
|
|
16782
|
-
|
|
16783
|
-
|
|
16784
|
-
|
|
16785
|
-
|
|
16965
|
+
setup(props, { emit }) {
|
|
16966
|
+
const activePage = vue.ref(props.activePage);
|
|
16967
|
+
const limit = vue.ref(props.limit);
|
|
16968
|
+
const pages = vue.ref(props.pages);
|
|
16969
|
+
vue.watch(props, () => {
|
|
16970
|
+
activePage.value = props.activePage;
|
|
16971
|
+
limit.value = props.limit;
|
|
16972
|
+
pages.value = props.pages;
|
|
16786
16973
|
});
|
|
16787
|
-
vue.
|
|
16788
|
-
|
|
16789
|
-
|
|
16790
|
-
|
|
16974
|
+
const showDots = vue.computed(() => {
|
|
16975
|
+
return props.dots && limit.value > 4 && limit.value < pages.value;
|
|
16976
|
+
});
|
|
16977
|
+
const maxPrevItems = vue.computed(() => {
|
|
16978
|
+
return Math.floor((limit.value - 1) / 2);
|
|
16979
|
+
});
|
|
16980
|
+
const maxNextItems = vue.computed(() => {
|
|
16981
|
+
return Math.ceil((limit.value - 1) / 2);
|
|
16982
|
+
});
|
|
16983
|
+
const beforeDots = vue.computed(() => {
|
|
16984
|
+
return showDots.value && activePage.value > maxPrevItems.value + 1;
|
|
16985
|
+
});
|
|
16986
|
+
const afterDots = vue.computed(() => {
|
|
16987
|
+
return showDots.value && activePage.value < pages.value - maxNextItems.value;
|
|
16988
|
+
});
|
|
16989
|
+
const computedLimit = vue.computed(() => {
|
|
16990
|
+
return limit.value - (afterDots.value ? 1 : 0) - (beforeDots.value ? 1 : 0);
|
|
16991
|
+
});
|
|
16992
|
+
const range = vue.computed(() => {
|
|
16993
|
+
return activePage.value + maxNextItems.value;
|
|
16791
16994
|
});
|
|
16792
|
-
vue.
|
|
16793
|
-
|
|
16794
|
-
inViewport.value = isVisible(sidebarRef.value);
|
|
16795
|
-
window.addEventListener('resize', () => handleResize());
|
|
16796
|
-
window.addEventListener('mouseup', handleClickOutside);
|
|
16797
|
-
window.addEventListener('keyup', handleKeyup);
|
|
16798
|
-
sidebarRef.value.addEventListener('mouseup', handleOnClick);
|
|
16799
|
-
sidebarRef.value.addEventListener('transitionend', () => {
|
|
16800
|
-
inViewport.value = isVisible(sidebarRef.value);
|
|
16801
|
-
});
|
|
16995
|
+
const lastItem = vue.computed(() => {
|
|
16996
|
+
return range.value >= pages.value ? pages.value : range.value - (afterDots.value ? 1 : 0);
|
|
16802
16997
|
});
|
|
16803
|
-
vue.
|
|
16804
|
-
|
|
16805
|
-
window.removeEventListener('mouseup', handleClickOutside);
|
|
16806
|
-
window.removeEventListener('keyup', handleKeyup);
|
|
16807
|
-
sidebarRef.value.removeEventListener('mouseup', handleOnClick);
|
|
16808
|
-
sidebarRef.value.removeEventListener('transitionend', () => {
|
|
16809
|
-
inViewport.value = isVisible(sidebarRef.value);
|
|
16810
|
-
});
|
|
16998
|
+
const itemsAmount = vue.computed(() => {
|
|
16999
|
+
return pages.value < computedLimit.value ? pages.value : computedLimit.value;
|
|
16811
17000
|
});
|
|
16812
|
-
const
|
|
16813
|
-
|
|
16814
|
-
|
|
16815
|
-
|
|
16816
|
-
|
|
16817
|
-
mobile.value = isOnMobile(sidebarRef.value);
|
|
16818
|
-
inViewport.value = isVisible(sidebarRef.value);
|
|
16819
|
-
};
|
|
16820
|
-
const handleKeyup = (event) => {
|
|
16821
|
-
if (mobile.value && !sidebarRef.value.contains(event.target)) {
|
|
16822
|
-
handleHide();
|
|
16823
|
-
}
|
|
16824
|
-
};
|
|
16825
|
-
const handleClickOutside = (event) => {
|
|
16826
|
-
if (mobile.value && !sidebarRef.value.contains(event.target)) {
|
|
16827
|
-
handleHide();
|
|
16828
|
-
}
|
|
16829
|
-
};
|
|
16830
|
-
const handleOnClick = (event) => {
|
|
16831
|
-
const target = event.target;
|
|
16832
|
-
target &&
|
|
16833
|
-
target.classList.contains('nav-link') &&
|
|
16834
|
-
!target.classList.contains('nav-group-toggle') &&
|
|
16835
|
-
mobile.value &&
|
|
16836
|
-
handleHide();
|
|
16837
|
-
};
|
|
16838
|
-
return () => [
|
|
16839
|
-
vue.h('div', {
|
|
16840
|
-
class: [
|
|
16841
|
-
'sidebar',
|
|
16842
|
-
{
|
|
16843
|
-
[`sidebar-${props.colorScheme}`]: props.colorScheme,
|
|
16844
|
-
'sidebar-narrow': props.narrow,
|
|
16845
|
-
'sidebar-overlaid': props.overlaid,
|
|
16846
|
-
[`sidebar-${props.placement}`]: props.placement,
|
|
16847
|
-
[`sidebar-${props.position}`]: props.position,
|
|
16848
|
-
[`sidebar-${props.size}`]: props.size,
|
|
16849
|
-
'sidebar-narrow-unfoldable': props.unfoldable,
|
|
16850
|
-
show: visible.value === true && mobile.value,
|
|
16851
|
-
hide: visible.value === false && !mobile.value,
|
|
16852
|
-
},
|
|
16853
|
-
attrs.class,
|
|
16854
|
-
],
|
|
16855
|
-
ref: sidebarRef,
|
|
16856
|
-
}, slots.default && slots.default()),
|
|
16857
|
-
mobile.value &&
|
|
16858
|
-
vue.h(CBackdrop, {
|
|
16859
|
-
class: 'sidebar-backdrop d-none',
|
|
16860
|
-
visible: props.visible,
|
|
16861
|
-
onClick: () => handleHide(),
|
|
16862
|
-
}),
|
|
16863
|
-
];
|
|
16864
|
-
},
|
|
16865
|
-
});
|
|
16866
|
-
|
|
16867
|
-
const CSidebarBrand = vue.defineComponent({
|
|
16868
|
-
name: 'CSidebarBrand',
|
|
16869
|
-
setup(_, { slots }) {
|
|
16870
|
-
return () => vue.h('div', { class: 'sidebar-brand' }, slots.default && slots.default());
|
|
16871
|
-
},
|
|
16872
|
-
});
|
|
16873
|
-
|
|
16874
|
-
const CSidebarFooter = vue.defineComponent({
|
|
16875
|
-
name: 'CSidebarFooter',
|
|
16876
|
-
setup(_, { slots }) {
|
|
16877
|
-
return () => vue.h('div', { class: 'sidebar-footer' }, slots.default && slots.default());
|
|
16878
|
-
},
|
|
16879
|
-
});
|
|
16880
|
-
|
|
16881
|
-
const CSidebarHeader = vue.defineComponent({
|
|
16882
|
-
name: 'CSidebarHeader',
|
|
16883
|
-
setup(_, { slots }) {
|
|
16884
|
-
return () => vue.h('div', { class: 'sidebar-header' }, slots.default && slots.default());
|
|
16885
|
-
},
|
|
16886
|
-
});
|
|
16887
|
-
|
|
16888
|
-
const CSidebarNav = vue.defineComponent({
|
|
16889
|
-
name: 'CSidebarNav',
|
|
16890
|
-
setup(_, { slots }) {
|
|
16891
|
-
const visibleGroup = vue.ref();
|
|
16892
|
-
const handleVisibleChange = (visible, index) => {
|
|
16893
|
-
if (visible) {
|
|
16894
|
-
visibleGroup.value = index;
|
|
17001
|
+
const items = vue.computed(() => {
|
|
17002
|
+
if (activePage.value - maxPrevItems.value <= 1) {
|
|
17003
|
+
return Array.from({
|
|
17004
|
+
length: itemsAmount.value,
|
|
17005
|
+
}, (_v, i) => i + 1);
|
|
16895
17006
|
}
|
|
16896
17007
|
else {
|
|
16897
|
-
|
|
16898
|
-
|
|
16899
|
-
}
|
|
17008
|
+
return Array.from({
|
|
17009
|
+
length: itemsAmount.value,
|
|
17010
|
+
}, (_v, i) => {
|
|
17011
|
+
return lastItem.value - i;
|
|
17012
|
+
}).reverse();
|
|
17013
|
+
}
|
|
17014
|
+
});
|
|
17015
|
+
const setPage = (number) => {
|
|
17016
|
+
if (number !== activePage.value) {
|
|
17017
|
+
activePage.value = number;
|
|
17018
|
+
emit('activePageChange', number);
|
|
16900
17019
|
}
|
|
16901
17020
|
};
|
|
16902
|
-
|
|
16903
|
-
|
|
16904
|
-
|
|
16905
|
-
|
|
16906
|
-
|
|
16907
|
-
|
|
16908
|
-
|
|
16909
|
-
|
|
16910
|
-
|
|
16911
|
-
|
|
17021
|
+
return () => vue.h(CPagination, {
|
|
17022
|
+
align: props.align,
|
|
17023
|
+
'aria-label': 'pagination',
|
|
17024
|
+
size: props.size,
|
|
17025
|
+
}, {
|
|
17026
|
+
default: () => [
|
|
17027
|
+
props.doubleArrows &&
|
|
17028
|
+
vue.h(CPaginationItem, {
|
|
17029
|
+
onClick: () => {
|
|
17030
|
+
activePage.value !== 1 && setPage(1);
|
|
17031
|
+
},
|
|
17032
|
+
'aria-label': 'Go to first page',
|
|
17033
|
+
...(activePage.value === 1 && {
|
|
17034
|
+
'aria-disabled': true,
|
|
17035
|
+
disabled: true,
|
|
17036
|
+
}),
|
|
17037
|
+
}, {
|
|
17038
|
+
default: () => typeof props.firstButton === 'string'
|
|
17039
|
+
? vue.h('span', {
|
|
17040
|
+
innerHTML: props.firstButton,
|
|
17041
|
+
})
|
|
17042
|
+
: props.firstButton,
|
|
17043
|
+
}),
|
|
17044
|
+
props.arrows &&
|
|
17045
|
+
vue.h(CPaginationItem, {
|
|
17046
|
+
onClick: () => {
|
|
17047
|
+
activePage.value !== 1 && setPage(activePage.value - 1);
|
|
17048
|
+
},
|
|
17049
|
+
'aria-label': 'Go to previous page',
|
|
17050
|
+
...(activePage.value === 1 && {
|
|
17051
|
+
'aria-disabled': true,
|
|
17052
|
+
disabled: true,
|
|
17053
|
+
}),
|
|
17054
|
+
}, {
|
|
17055
|
+
default: () => typeof props.previousButton === 'string'
|
|
17056
|
+
? vue.h('span', {
|
|
17057
|
+
innerHTML: props.previousButton,
|
|
17058
|
+
})
|
|
17059
|
+
: props.previousButton,
|
|
17060
|
+
}),
|
|
17061
|
+
beforeDots.value &&
|
|
17062
|
+
vue.h(CPaginationItem, {
|
|
17063
|
+
role: 'separator',
|
|
17064
|
+
disabled: true,
|
|
17065
|
+
}, {
|
|
17066
|
+
default: () => '...',
|
|
17067
|
+
}),
|
|
17068
|
+
items.value.map((i) => {
|
|
17069
|
+
return vue.h(CPaginationItem, {
|
|
17070
|
+
onClick: () => setPage(i),
|
|
17071
|
+
'aria-label': activePage.value === i ? `Current page ${i}` : `Go to page ${i}`,
|
|
17072
|
+
active: activePage.value === i,
|
|
17073
|
+
}, {
|
|
17074
|
+
default: () => i,
|
|
16912
17075
|
});
|
|
16913
|
-
}
|
|
16914
|
-
|
|
16915
|
-
|
|
16916
|
-
|
|
16917
|
-
|
|
16918
|
-
|
|
16919
|
-
|
|
16920
|
-
|
|
16921
|
-
|
|
16922
|
-
|
|
17076
|
+
}),
|
|
17077
|
+
afterDots.value &&
|
|
17078
|
+
vue.h(CPaginationItem, {
|
|
17079
|
+
role: 'separator',
|
|
17080
|
+
disabled: true,
|
|
17081
|
+
}, {
|
|
17082
|
+
default: () => '...',
|
|
17083
|
+
}),
|
|
17084
|
+
props.arrows &&
|
|
17085
|
+
vue.h(CPaginationItem, {
|
|
17086
|
+
onClick: () => {
|
|
17087
|
+
activePage.value !== pages.value && setPage(activePage.value + 1);
|
|
17088
|
+
},
|
|
17089
|
+
'aria-label': 'Go to next page',
|
|
17090
|
+
...(activePage.value === pages.value && {
|
|
17091
|
+
'aria-disabled': true,
|
|
17092
|
+
disabled: true,
|
|
17093
|
+
}),
|
|
17094
|
+
}, {
|
|
17095
|
+
default: () => typeof props.nextButton === 'string'
|
|
17096
|
+
? vue.h('span', {
|
|
17097
|
+
innerHTML: props.nextButton,
|
|
17098
|
+
})
|
|
17099
|
+
: props.nextButton,
|
|
17100
|
+
}),
|
|
17101
|
+
props.doubleArrows &&
|
|
17102
|
+
vue.h(CPaginationItem, {
|
|
17103
|
+
onClick: () => {
|
|
17104
|
+
activePage.value !== pages.value && setPage(pages.value);
|
|
17105
|
+
},
|
|
17106
|
+
'aria-label': 'Go to last page',
|
|
17107
|
+
...(activePage.value === pages.value && {
|
|
17108
|
+
'aria-disabled': true,
|
|
17109
|
+
disabled: true,
|
|
17110
|
+
}),
|
|
17111
|
+
}, {
|
|
17112
|
+
default: () => typeof props.lastButton === 'string'
|
|
17113
|
+
? vue.h('span', {
|
|
17114
|
+
innerHTML: props.lastButton,
|
|
17115
|
+
})
|
|
17116
|
+
: props.lastButton,
|
|
17117
|
+
}),
|
|
17118
|
+
],
|
|
17119
|
+
});
|
|
16923
17120
|
},
|
|
16924
17121
|
});
|
|
16925
17122
|
|
|
16926
|
-
const
|
|
17123
|
+
const CSmartPaginationPlugin = {
|
|
16927
17124
|
install: (app) => {
|
|
16928
|
-
app.component(
|
|
16929
|
-
app.component(CSidebarBrand.name, CSidebarBrand);
|
|
16930
|
-
app.component(CSidebarFooter.name, CSidebarFooter);
|
|
16931
|
-
app.component(CSidebarHeader.name, CSidebarHeader);
|
|
16932
|
-
app.component(CSidebarNav.name, CSidebarNav);
|
|
16933
|
-
app.component(CSidebarToggler.name, CSidebarToggler);
|
|
17125
|
+
app.component(CSmartPagination.name, CSmartPagination);
|
|
16934
17126
|
},
|
|
16935
17127
|
};
|
|
16936
17128
|
|
|
@@ -16957,7 +17149,6 @@ const CTableBody = vue.defineComponent({
|
|
|
16957
17149
|
|
|
16958
17150
|
const CTableCaption = vue.defineComponent({
|
|
16959
17151
|
name: 'CTableCaption',
|
|
16960
|
-
props: {},
|
|
16961
17152
|
setup(_, { slots }) {
|
|
16962
17153
|
return () => vue.h('caption', {}, slots.default && slots.default());
|
|
16963
17154
|
},
|
|
@@ -17973,13 +18164,13 @@ const CIcon = vue.defineComponent({
|
|
|
17973
18164
|
},
|
|
17974
18165
|
});
|
|
17975
18166
|
|
|
17976
|
-
|
|
18167
|
+
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'/>"];
|
|
17977
18168
|
|
|
17978
|
-
|
|
18169
|
+
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'/>"];
|
|
17979
18170
|
|
|
17980
|
-
|
|
18171
|
+
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'/>"];
|
|
17981
18172
|
|
|
17982
|
-
|
|
18173
|
+
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'/>"];
|
|
17983
18174
|
|
|
17984
18175
|
const CSmartTable = vue.defineComponent({
|
|
17985
18176
|
name: 'CSmartTable',
|
|
@@ -18088,6 +18279,7 @@ const CSmartTable = vue.defineComponent({
|
|
|
18088
18279
|
*/
|
|
18089
18280
|
itemsPerPage: {
|
|
18090
18281
|
type: Number,
|
|
18282
|
+
default: 10,
|
|
18091
18283
|
required: false,
|
|
18092
18284
|
},
|
|
18093
18285
|
/**
|
|
@@ -18136,7 +18328,7 @@ const CSmartTable = vue.defineComponent({
|
|
|
18136
18328
|
* 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.
|
|
18137
18329
|
*/
|
|
18138
18330
|
pagination: {
|
|
18139
|
-
type: Boolean,
|
|
18331
|
+
type: [Boolean, Object],
|
|
18140
18332
|
required: false,
|
|
18141
18333
|
},
|
|
18142
18334
|
/**
|
|
@@ -18623,12 +18815,14 @@ const CSmartTable = vue.defineComponent({
|
|
|
18623
18815
|
}, [
|
|
18624
18816
|
vue.h('div', {
|
|
18625
18817
|
class: 'col',
|
|
18626
|
-
}, props.pagination && numberOfPages.value > 1
|
|
18818
|
+
}, (props.pagination && numberOfPages.value > 1) || props.paginationProps
|
|
18627
18819
|
? vue.h(CSmartPagination, {
|
|
18628
|
-
...props.paginationProps,
|
|
18629
18820
|
pages: numberOfPages.value,
|
|
18630
18821
|
activePage: activePage.value,
|
|
18631
|
-
|
|
18822
|
+
...props.paginationProps,
|
|
18823
|
+
onActivePageChange: (page) => typeof props.pagination === 'object' && props.pagination.external
|
|
18824
|
+
? emit('activePageChange', page)
|
|
18825
|
+
: handleActivePageChange(page),
|
|
18632
18826
|
})
|
|
18633
18827
|
: ''),
|
|
18634
18828
|
vue.h('div', {
|
|
@@ -19757,7 +19951,6 @@ var Components = /*#__PURE__*/Object.freeze({
|
|
|
19757
19951
|
CPaginationPlugin: CPaginationPlugin,
|
|
19758
19952
|
CPagination: CPagination,
|
|
19759
19953
|
CPaginationItem: CPaginationItem,
|
|
19760
|
-
CSmartPagination: CSmartPagination,
|
|
19761
19954
|
CPicker: CPicker,
|
|
19762
19955
|
CPickerPlugin: CPickerPlugin,
|
|
19763
19956
|
CPlaceholderPlugin: CPlaceholderPlugin,
|
|
@@ -19774,6 +19967,8 @@ var Components = /*#__PURE__*/Object.freeze({
|
|
|
19774
19967
|
CSidebarHeader: CSidebarHeader,
|
|
19775
19968
|
CSidebarNav: CSidebarNav,
|
|
19776
19969
|
CSidebarToggler: CSidebarToggler,
|
|
19970
|
+
CSmartPaginationPlugin: CSmartPaginationPlugin,
|
|
19971
|
+
CSmartPagination: CSmartPagination,
|
|
19777
19972
|
CSmartTablePlugin: CSmartTablePlugin,
|
|
19778
19973
|
CSmartTable: CSmartTable,
|
|
19779
19974
|
CSpinnerPlugin: CSpinnerPlugin,
|
|
@@ -20181,6 +20376,7 @@ exports.CSidebarNav = CSidebarNav;
|
|
|
20181
20376
|
exports.CSidebarPlugin = CSidebarPlugin;
|
|
20182
20377
|
exports.CSidebarToggler = CSidebarToggler;
|
|
20183
20378
|
exports.CSmartPagination = CSmartPagination;
|
|
20379
|
+
exports.CSmartPaginationPlugin = CSmartPaginationPlugin;
|
|
20184
20380
|
exports.CSmartTable = CSmartTable;
|
|
20185
20381
|
exports.CSmartTablePlugin = CSmartTablePlugin;
|
|
20186
20382
|
exports.CSpinner = CSpinner;
|