@coreui/vue-pro 4.6.0 → 4.7.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/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 +879 -682
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +878 -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 +56 -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
|
|
@@ -12883,11 +13010,13 @@ const CDateRangePicker = vue.defineComponent({
|
|
|
12883
13010
|
vue.watch(() => props.startDate, () => {
|
|
12884
13011
|
if (props.startDate) {
|
|
12885
13012
|
calendarDate.value = new Date(props.startDate);
|
|
13013
|
+
startDate.value = new Date(props.startDate);
|
|
12886
13014
|
}
|
|
12887
13015
|
});
|
|
12888
13016
|
vue.watch(() => props.endDate, () => {
|
|
12889
13017
|
if (props.endDate) {
|
|
12890
13018
|
calendarDate.value = new Date(props.endDate);
|
|
13019
|
+
endDate.value = new Date(props.endDate);
|
|
12891
13020
|
}
|
|
12892
13021
|
});
|
|
12893
13022
|
vue.watch(() => props.maxDate, () => {
|
|
@@ -12934,6 +13063,13 @@ const CDateRangePicker = vue.defineComponent({
|
|
|
12934
13063
|
selectEndDate.value = true;
|
|
12935
13064
|
}
|
|
12936
13065
|
emit('start-date-change', date, date ? formatDate(date) : undefined);
|
|
13066
|
+
emit('update:start-date', date);
|
|
13067
|
+
if (props.timepicker || props.footer) {
|
|
13068
|
+
return;
|
|
13069
|
+
}
|
|
13070
|
+
if (props.closeOnSelect && !props.range) {
|
|
13071
|
+
visible.value = false;
|
|
13072
|
+
}
|
|
12937
13073
|
};
|
|
12938
13074
|
const handleEndDateChange = (date) => {
|
|
12939
13075
|
endDate.value = date;
|
|
@@ -12942,6 +13078,13 @@ const CDateRangePicker = vue.defineComponent({
|
|
|
12942
13078
|
selectEndDate.value = false;
|
|
12943
13079
|
}
|
|
12944
13080
|
emit('end-date-change', date, date ? formatDate(date) : undefined);
|
|
13081
|
+
emit('update:end-date', date);
|
|
13082
|
+
if (props.timepicker || props.footer) {
|
|
13083
|
+
return;
|
|
13084
|
+
}
|
|
13085
|
+
if (props.closeOnSelect && startDate.value !== null) {
|
|
13086
|
+
visible.value = false;
|
|
13087
|
+
}
|
|
12945
13088
|
};
|
|
12946
13089
|
const handleClear = (event) => {
|
|
12947
13090
|
event.stopPropagation();
|
|
@@ -12949,6 +13092,10 @@ const CDateRangePicker = vue.defineComponent({
|
|
|
12949
13092
|
endDate.value = null;
|
|
12950
13093
|
inputStartHoverValue.value = null;
|
|
12951
13094
|
inputEndHoverValue.value = null;
|
|
13095
|
+
emit('start-date-change', null);
|
|
13096
|
+
emit('end-date-change', null);
|
|
13097
|
+
emit('update:start-date', null);
|
|
13098
|
+
emit('update:end-date', null);
|
|
12952
13099
|
};
|
|
12953
13100
|
const InputGroup = () => vue.h(CInputGroup, {
|
|
12954
13101
|
class: 'picker-input-group',
|
|
@@ -13054,8 +13201,10 @@ const CDateRangePicker = vue.defineComponent({
|
|
|
13054
13201
|
onCancel: () => {
|
|
13055
13202
|
startDate.value = initialStartDate.value;
|
|
13056
13203
|
endDate.value = initialEndDate.value;
|
|
13204
|
+
visible.value = false;
|
|
13057
13205
|
},
|
|
13058
13206
|
onHide: () => {
|
|
13207
|
+
visible.value = false;
|
|
13059
13208
|
emit('hide');
|
|
13060
13209
|
},
|
|
13061
13210
|
onShow: () => {
|
|
@@ -13065,8 +13214,10 @@ const CDateRangePicker = vue.defineComponent({
|
|
|
13065
13214
|
if (endDate.value) {
|
|
13066
13215
|
initialEndDate.value = new Date(endDate.value);
|
|
13067
13216
|
}
|
|
13217
|
+
visible.value = true;
|
|
13068
13218
|
emit('show');
|
|
13069
13219
|
},
|
|
13220
|
+
visible: visible.value,
|
|
13070
13221
|
}, {
|
|
13071
13222
|
...(slots.cancelButton && {
|
|
13072
13223
|
cancelButton: () => slots.cancelButton && slots.cancelButton(),
|
|
@@ -13455,11 +13606,21 @@ const CDatePicker = vue.defineComponent({
|
|
|
13455
13606
|
* @property {string} formatedDate - formated date
|
|
13456
13607
|
*/
|
|
13457
13608
|
'date-change',
|
|
13609
|
+
/**
|
|
13610
|
+
* Callback fired when the date changed.
|
|
13611
|
+
*
|
|
13612
|
+
* @property {Date | null} date - date object
|
|
13613
|
+
* @since 4.7.0
|
|
13614
|
+
*/
|
|
13615
|
+
'update:date',
|
|
13458
13616
|
],
|
|
13459
13617
|
setup(props, { emit }) {
|
|
13460
13618
|
return () => vue.h(CDateRangePicker, {
|
|
13461
13619
|
calendars: 1,
|
|
13462
|
-
onStartDateChange: (date, formatedDate) =>
|
|
13620
|
+
onStartDateChange: (date, formatedDate) => {
|
|
13621
|
+
emit('date-change', date, formatedDate);
|
|
13622
|
+
emit('update:date', date);
|
|
13623
|
+
},
|
|
13463
13624
|
range: false,
|
|
13464
13625
|
startDate: props.date,
|
|
13465
13626
|
...props,
|
|
@@ -14290,11 +14451,10 @@ const CLoadingButton = vue.defineComponent({
|
|
|
14290
14451
|
}
|
|
14291
14452
|
};
|
|
14292
14453
|
return () => vue.h(CButton, {
|
|
14454
|
+
...props,
|
|
14293
14455
|
class: ['btn-loading', { ['is-loading']: loading.value }],
|
|
14294
14456
|
...(props.disabledOnLoading && loading.value && { disabled: true }),
|
|
14295
14457
|
onClick: () => handleOnClick(),
|
|
14296
|
-
// TODO: remove non button props
|
|
14297
|
-
...props,
|
|
14298
14458
|
}, {
|
|
14299
14459
|
default: () => [
|
|
14300
14460
|
vue.h(CSpinner, { class: 'btn-loading-spinner', size: 'sm', variant: props.spinnerType }),
|
|
@@ -14696,34 +14856,61 @@ const CMultiSelectOptions = vue.defineComponent({
|
|
|
14696
14856
|
default: 'no items',
|
|
14697
14857
|
required: false,
|
|
14698
14858
|
},
|
|
14859
|
+
selected: {
|
|
14860
|
+
type: Array,
|
|
14861
|
+
default: () => [],
|
|
14862
|
+
required: false,
|
|
14863
|
+
},
|
|
14699
14864
|
},
|
|
14700
14865
|
emits: ['optionClick'],
|
|
14701
14866
|
setup(props, { emit }) {
|
|
14867
|
+
const handleKeyDown = (event, option) => {
|
|
14868
|
+
if (event.code === 'Space' || event.key === 'Enter') {
|
|
14869
|
+
event.preventDefault();
|
|
14870
|
+
handleOptionClick && handleOptionClick(option);
|
|
14871
|
+
return;
|
|
14872
|
+
}
|
|
14873
|
+
if (event.key === 'Down' || event.key === 'ArrowDown') {
|
|
14874
|
+
event.preventDefault();
|
|
14875
|
+
const target = event.target;
|
|
14876
|
+
const next = getNextSibling(target, '.form-multi-select-option');
|
|
14877
|
+
if (next) {
|
|
14878
|
+
next.focus(); // eslint-disable-line prettier/prettier
|
|
14879
|
+
}
|
|
14880
|
+
}
|
|
14881
|
+
if (event.key === 'Up' || event.key === 'ArrowUp') {
|
|
14882
|
+
event.preventDefault();
|
|
14883
|
+
const target = event.target;
|
|
14884
|
+
const prev = getPreviousSibling(target, '.form-multi-select-option');
|
|
14885
|
+
if (prev) {
|
|
14886
|
+
prev.focus(); // eslint-disable-line prettier/prettier
|
|
14887
|
+
}
|
|
14888
|
+
}
|
|
14889
|
+
};
|
|
14702
14890
|
const handleOptionClick = (option) => {
|
|
14703
14891
|
emit('optionClick', option);
|
|
14704
14892
|
};
|
|
14705
|
-
|
|
14706
|
-
|
|
14707
|
-
|
|
14708
|
-
|
|
14709
|
-
|
|
14710
|
-
|
|
14711
|
-
|
|
14712
|
-
|
|
14713
|
-
|
|
14714
|
-
|
|
14715
|
-
|
|
14716
|
-
|
|
14717
|
-
|
|
14718
|
-
|
|
14719
|
-
|
|
14720
|
-
|
|
14721
|
-
|
|
14722
|
-
|
|
14723
|
-
|
|
14724
|
-
})
|
|
14725
|
-
|
|
14726
|
-
};
|
|
14893
|
+
// TODO: find solution how to remove any
|
|
14894
|
+
const createOptions = (options) => options.length > 0
|
|
14895
|
+
? options.map((option) => option.options
|
|
14896
|
+
? [
|
|
14897
|
+
vue.h('div', { class: 'form-multi-select-optgroup-label' }, option.label),
|
|
14898
|
+
createOptions(option.options),
|
|
14899
|
+
]
|
|
14900
|
+
: vue.h('div', {
|
|
14901
|
+
class: [
|
|
14902
|
+
'form-multi-select-option',
|
|
14903
|
+
{
|
|
14904
|
+
'form-multi-select-option-with-checkbox': props.optionsStyle === 'checkbox',
|
|
14905
|
+
'form-multi-selected': props.selected.some((_option) => _option.value === option.value),
|
|
14906
|
+
disabled: option.disabled,
|
|
14907
|
+
},
|
|
14908
|
+
],
|
|
14909
|
+
onClick: () => handleOptionClick(option),
|
|
14910
|
+
onKeydown: (event) => handleKeyDown(event, option),
|
|
14911
|
+
tabindex: 0,
|
|
14912
|
+
}, option.text))
|
|
14913
|
+
: vue.h('div', { class: 'form-multi-select-options-empty' }, props.searchNoResultsLabel);
|
|
14727
14914
|
return () => vue.h('div', {
|
|
14728
14915
|
class: 'form-multi-select-options',
|
|
14729
14916
|
...(props.optionsMaxHeight !== 'auto' && {
|
|
@@ -14750,7 +14937,7 @@ const CMultiSelectSelection = vue.defineComponent({
|
|
|
14750
14937
|
* Enables search input element.
|
|
14751
14938
|
*/
|
|
14752
14939
|
search: {
|
|
14753
|
-
type: Boolean,
|
|
14940
|
+
type: [Boolean, String],
|
|
14754
14941
|
required: false,
|
|
14755
14942
|
default: false,
|
|
14756
14943
|
},
|
|
@@ -14820,6 +15007,11 @@ const CMultiSelectSelection = vue.defineComponent({
|
|
|
14820
15007
|
},
|
|
14821
15008
|
});
|
|
14822
15009
|
|
|
15010
|
+
const flattenArray = (options) => {
|
|
15011
|
+
return options.reduce((acc, val) => {
|
|
15012
|
+
return acc.concat(Array.isArray(val.options) ? flattenArray(val.options) : val);
|
|
15013
|
+
}, []);
|
|
15014
|
+
};
|
|
14823
15015
|
const CMultiSelect = vue.defineComponent({
|
|
14824
15016
|
name: 'CMultiSelect',
|
|
14825
15017
|
props: {
|
|
@@ -14941,9 +15133,18 @@ const CMultiSelect = vue.defineComponent({
|
|
|
14941
15133
|
* Enables search input element.
|
|
14942
15134
|
*/
|
|
14943
15135
|
search: {
|
|
14944
|
-
type: Boolean,
|
|
15136
|
+
type: [Boolean, String],
|
|
14945
15137
|
default: true,
|
|
14946
15138
|
required: false,
|
|
15139
|
+
validator: (value) => {
|
|
15140
|
+
if (typeof value == 'string') {
|
|
15141
|
+
return ['external'].includes(value);
|
|
15142
|
+
}
|
|
15143
|
+
if (typeof value == 'boolean') {
|
|
15144
|
+
return true;
|
|
15145
|
+
}
|
|
15146
|
+
return false;
|
|
15147
|
+
},
|
|
14947
15148
|
},
|
|
14948
15149
|
/**
|
|
14949
15150
|
* Sets the label for no results when filtering.
|
|
@@ -15045,59 +15246,63 @@ const CMultiSelect = vue.defineComponent({
|
|
|
15045
15246
|
* Execute a function when a user changes the selected option. [docs]
|
|
15046
15247
|
*/
|
|
15047
15248
|
'change',
|
|
15249
|
+
/**
|
|
15250
|
+
* Execute a function when the filter value changed.
|
|
15251
|
+
*
|
|
15252
|
+
* @since 4.7.0
|
|
15253
|
+
*/
|
|
15254
|
+
'filterChange',
|
|
15048
15255
|
],
|
|
15049
15256
|
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 };
|
|
15257
|
+
const nativeSelectRef = vue.ref();
|
|
15258
|
+
vue.provide('nativeSelectRef', nativeSelectRef);
|
|
15259
|
+
const searchRef = vue.ref();
|
|
15260
|
+
const options = vue.ref(props.options);
|
|
15261
|
+
const search = vue.ref('');
|
|
15262
|
+
const selected = vue.ref([]);
|
|
15263
|
+
const visible = vue.ref(props.visible);
|
|
15264
|
+
const selectOptions = (options, deselected) => {
|
|
15265
|
+
let _selected = [...selected.value, ...options];
|
|
15266
|
+
if (deselected) {
|
|
15267
|
+
_selected = _selected.filter((selectedOption) => !deselected.some((deselectedOption) => deselectedOption.value === selectedOption.value));
|
|
15268
|
+
}
|
|
15269
|
+
const deduplicated = _selected.reduce((unique, option) => {
|
|
15270
|
+
if (!unique.some((obj) => obj.value === option.value)) {
|
|
15271
|
+
unique.push({
|
|
15272
|
+
value: option.value,
|
|
15273
|
+
text: option.text,
|
|
15274
|
+
...(option.disabled && { disabled: option.disabled }),
|
|
15081
15275
|
});
|
|
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
15276
|
}
|
|
15093
|
-
return
|
|
15094
|
-
|
|
15095
|
-
|
|
15096
|
-
? { ...option, selected: selected, order: counter }
|
|
15097
|
-
: { ...option, selected: selected };
|
|
15098
|
-
});
|
|
15277
|
+
return unique;
|
|
15278
|
+
}, []);
|
|
15279
|
+
selected.value = deduplicated;
|
|
15099
15280
|
};
|
|
15100
|
-
|
|
15281
|
+
vue.watch(() => props.options, (newValue, oldValue) => {
|
|
15282
|
+
if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) {
|
|
15283
|
+
options.value = newValue;
|
|
15284
|
+
const _selected = newValue &&
|
|
15285
|
+
flattenArray(newValue).filter((option) => {
|
|
15286
|
+
if (option.selected) {
|
|
15287
|
+
return option;
|
|
15288
|
+
}
|
|
15289
|
+
return;
|
|
15290
|
+
});
|
|
15291
|
+
const deselected = newValue &&
|
|
15292
|
+
flattenArray(newValue).filter((option) => {
|
|
15293
|
+
if (option.selected === false) {
|
|
15294
|
+
return option;
|
|
15295
|
+
}
|
|
15296
|
+
return;
|
|
15297
|
+
});
|
|
15298
|
+
_selected && selectOptions(_selected, deselected);
|
|
15299
|
+
}
|
|
15300
|
+
});
|
|
15301
|
+
vue.watch(selected, () => {
|
|
15302
|
+
nativeSelectRef.value &&
|
|
15303
|
+
nativeSelectRef.value.dispatchEvent(new Event('change', { bubbles: true }));
|
|
15304
|
+
});
|
|
15305
|
+
const filterOptionsList = (search, _options) => {
|
|
15101
15306
|
return search.length
|
|
15102
15307
|
? _options &&
|
|
15103
15308
|
_options.reduce((acc, val) => {
|
|
@@ -15111,70 +15316,54 @@ const CMultiSelect = vue.defineComponent({
|
|
|
15111
15316
|
}, [])
|
|
15112
15317
|
: options.value;
|
|
15113
15318
|
};
|
|
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
|
-
});
|
|
15319
|
+
// watch(
|
|
15320
|
+
// () => props.options,
|
|
15321
|
+
// (newValue, oldValue) => {
|
|
15322
|
+
// console.log(props.options)
|
|
15323
|
+
// if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) options.value = newValue
|
|
15324
|
+
// },
|
|
15325
|
+
// )
|
|
15148
15326
|
const handleSearchChange = (event) => {
|
|
15149
15327
|
const target = event.target;
|
|
15150
15328
|
search.value = target.value.toLowerCase();
|
|
15329
|
+
emit('filterChange', target.value);
|
|
15151
15330
|
};
|
|
15152
15331
|
const handleSearchKeyDown = (event) => {
|
|
15153
|
-
if (search.value.length)
|
|
15332
|
+
if (search.value.length) {
|
|
15154
15333
|
return;
|
|
15334
|
+
}
|
|
15155
15335
|
if (event.key === 'Backspace' || event.key === 'Delete') {
|
|
15156
15336
|
const last = selected.value.filter((option) => !option.disabled).pop();
|
|
15157
15337
|
if (last) {
|
|
15158
15338
|
selected.value = selected.value.filter((option) => option.value !== last.value);
|
|
15159
|
-
options.value = updateOptions(last.value);
|
|
15160
15339
|
}
|
|
15161
15340
|
}
|
|
15162
15341
|
};
|
|
15163
15342
|
const handleOptionClick = (option) => {
|
|
15164
|
-
options.value = updateOptions(option.value);
|
|
15165
15343
|
if (!props.multiple) {
|
|
15344
|
+
selected.value = [{ value: option.value, text: option.text }];
|
|
15166
15345
|
visible.value = false;
|
|
15167
15346
|
search.value = '';
|
|
15168
15347
|
if (searchRef.value) {
|
|
15169
15348
|
searchRef.value.value = '';
|
|
15170
15349
|
}
|
|
15350
|
+
return;
|
|
15351
|
+
}
|
|
15352
|
+
if (selected.value.some((_option) => _option.value === option.value)) {
|
|
15353
|
+
selected.value = selected.value.filter((_option) => _option.value !== option.value);
|
|
15354
|
+
}
|
|
15355
|
+
else {
|
|
15356
|
+
selected.value = [
|
|
15357
|
+
...selected.value,
|
|
15358
|
+
{ value: option.value, text: option.text },
|
|
15359
|
+
];
|
|
15171
15360
|
}
|
|
15172
15361
|
};
|
|
15173
15362
|
const handleSelectAll = () => {
|
|
15174
|
-
options.value
|
|
15363
|
+
selectOptions(flattenArray(options.value).filter((option) => !option.disabled));
|
|
15175
15364
|
};
|
|
15176
15365
|
const handleDeselectAll = () => {
|
|
15177
|
-
|
|
15366
|
+
selected.value = selected.value.filter((option) => option.disabled);
|
|
15178
15367
|
};
|
|
15179
15368
|
return () => [
|
|
15180
15369
|
vue.h(CMultiSelectNativeSelect, {
|
|
@@ -15265,13 +15454,20 @@ const CMultiSelect = vue.defineComponent({
|
|
|
15265
15454
|
default: () => vue.h('div', {}, [
|
|
15266
15455
|
props.multiple &&
|
|
15267
15456
|
props.selectAll &&
|
|
15268
|
-
vue.h('button', {
|
|
15457
|
+
vue.h('button', {
|
|
15458
|
+
class: 'form-multi-select-all',
|
|
15459
|
+
onClick: () => handleSelectAll(),
|
|
15460
|
+
type: 'button',
|
|
15461
|
+
}, props.selectAllLabel),
|
|
15269
15462
|
vue.h(CMultiSelectOptions, {
|
|
15270
15463
|
onOptionClick: (option) => handleOptionClick(option),
|
|
15271
|
-
options:
|
|
15464
|
+
options: props.search === 'external'
|
|
15465
|
+
? options.value
|
|
15466
|
+
: filterOptionsList(search.value, options.value),
|
|
15272
15467
|
optionsMaxHeight: props.optionsMaxHeight,
|
|
15273
15468
|
optionsStyle: props.optionsStyle,
|
|
15274
15469
|
searchNoResultsLabel: props.searchNoResultsLabel,
|
|
15470
|
+
selected: selected.value
|
|
15275
15471
|
}),
|
|
15276
15472
|
]),
|
|
15277
15473
|
}),
|
|
@@ -15991,354 +16187,63 @@ const CPaginationItem = vue.defineComponent({
|
|
|
15991
16187
|
},
|
|
15992
16188
|
});
|
|
15993
16189
|
|
|
15994
|
-
const
|
|
15995
|
-
|
|
16190
|
+
const CPaginationPlugin = {
|
|
16191
|
+
install: (app) => {
|
|
16192
|
+
app.component(CPagination.name, CPagination);
|
|
16193
|
+
app.component(CPaginationItem.name, CPaginationItem);
|
|
16194
|
+
},
|
|
16195
|
+
};
|
|
16196
|
+
|
|
16197
|
+
const BREAKPOINTS$1 = [
|
|
16198
|
+
'xxl',
|
|
16199
|
+
'xl',
|
|
16200
|
+
'lg',
|
|
16201
|
+
'md',
|
|
16202
|
+
'sm',
|
|
16203
|
+
'xs',
|
|
16204
|
+
];
|
|
16205
|
+
const CPlaceholder = vue.defineComponent({
|
|
16206
|
+
name: 'CPlaceholder',
|
|
15996
16207
|
props: {
|
|
15997
16208
|
/**
|
|
15998
|
-
*
|
|
16209
|
+
* Set animation type to better convey the perception of something being actively loaded.
|
|
15999
16210
|
*
|
|
16000
|
-
* @
|
|
16211
|
+
* @values 'glow', 'wave'
|
|
16001
16212
|
*/
|
|
16002
|
-
|
|
16213
|
+
animation: {
|
|
16003
16214
|
type: String,
|
|
16004
|
-
default:
|
|
16215
|
+
default: undefined,
|
|
16005
16216
|
require: false,
|
|
16006
16217
|
validator: (value) => {
|
|
16007
|
-
return ['
|
|
16218
|
+
return ['glow', 'wave'].includes(value);
|
|
16008
16219
|
},
|
|
16009
16220
|
},
|
|
16010
16221
|
/**
|
|
16011
|
-
*
|
|
16222
|
+
* Sets the color context of the component to one of CoreUI’s themed colors.
|
|
16012
16223
|
*
|
|
16013
|
-
* @
|
|
16224
|
+
* @values 'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark', 'light'
|
|
16014
16225
|
*/
|
|
16015
|
-
|
|
16016
|
-
type: Number,
|
|
16017
|
-
default: 1,
|
|
16018
|
-
require: false,
|
|
16019
|
-
},
|
|
16226
|
+
color: Color,
|
|
16020
16227
|
/**
|
|
16021
|
-
*
|
|
16022
|
-
*
|
|
16023
|
-
* @default true
|
|
16228
|
+
* Component used for the root node. Either a string to use a HTML element or a component.
|
|
16024
16229
|
*/
|
|
16025
|
-
|
|
16026
|
-
type:
|
|
16027
|
-
default:
|
|
16028
|
-
|
|
16230
|
+
component: {
|
|
16231
|
+
type: String,
|
|
16232
|
+
default: 'span',
|
|
16233
|
+
required: false,
|
|
16029
16234
|
},
|
|
16030
16235
|
/**
|
|
16031
|
-
*
|
|
16236
|
+
* Size the component extra small, small, or large.
|
|
16032
16237
|
*
|
|
16033
|
-
* @
|
|
16238
|
+
* @values 'xs', 'sm', 'lg'
|
|
16034
16239
|
*/
|
|
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
|
-
},
|
|
16240
|
+
size: {
|
|
16241
|
+
type: String,
|
|
16242
|
+
default: undefined,
|
|
16243
|
+
required: false,
|
|
16244
|
+
validator: (value) => {
|
|
16245
|
+
return ['xs', 'sm', 'lg'].includes(value);
|
|
16246
|
+
},
|
|
16342
16247
|
},
|
|
16343
16248
|
/**
|
|
16344
16249
|
* The number of columns on extra small devices (<576px).
|
|
@@ -16678,259 +16583,548 @@ const CPopover = vue.defineComponent({
|
|
|
16678
16583
|
},
|
|
16679
16584
|
});
|
|
16680
16585
|
|
|
16681
|
-
const CPopoverPlugin = {
|
|
16586
|
+
const CPopoverPlugin = {
|
|
16587
|
+
install: (app) => {
|
|
16588
|
+
app.component(CPopover.name, CPopover);
|
|
16589
|
+
},
|
|
16590
|
+
};
|
|
16591
|
+
|
|
16592
|
+
const isOnMobile = (element) => Boolean(getComputedStyle(element).getPropertyValue('--cui-is-mobile'));
|
|
16593
|
+
const CSidebar = vue.defineComponent({
|
|
16594
|
+
name: 'CSidebar',
|
|
16595
|
+
props: {
|
|
16596
|
+
/**
|
|
16597
|
+
* Sets if the color of text should be colored for a light or dark dark background.
|
|
16598
|
+
*
|
|
16599
|
+
* @values 'dark', light'
|
|
16600
|
+
*/
|
|
16601
|
+
colorScheme: {
|
|
16602
|
+
type: String,
|
|
16603
|
+
default: undefined,
|
|
16604
|
+
validator: (value) => {
|
|
16605
|
+
return ['dark', 'light'].includes(value);
|
|
16606
|
+
},
|
|
16607
|
+
},
|
|
16608
|
+
/**
|
|
16609
|
+
* Make sidebar narrow.
|
|
16610
|
+
*/
|
|
16611
|
+
narrow: {
|
|
16612
|
+
type: Boolean,
|
|
16613
|
+
required: false,
|
|
16614
|
+
},
|
|
16615
|
+
/**
|
|
16616
|
+
* Set sidebar to overlaid variant.
|
|
16617
|
+
*/
|
|
16618
|
+
overlaid: {
|
|
16619
|
+
type: Boolean,
|
|
16620
|
+
required: false,
|
|
16621
|
+
},
|
|
16622
|
+
/**
|
|
16623
|
+
* Components placement, there’s no default placement.
|
|
16624
|
+
* @values 'start', 'end'
|
|
16625
|
+
*/
|
|
16626
|
+
placement: {
|
|
16627
|
+
type: String,
|
|
16628
|
+
default: undefined,
|
|
16629
|
+
validator: (value) => {
|
|
16630
|
+
return ['start', 'end'].includes(value);
|
|
16631
|
+
},
|
|
16632
|
+
},
|
|
16633
|
+
/**
|
|
16634
|
+
* Place sidebar in non-static positions.
|
|
16635
|
+
*/
|
|
16636
|
+
position: {
|
|
16637
|
+
type: String,
|
|
16638
|
+
default: undefined,
|
|
16639
|
+
validator: (value) => {
|
|
16640
|
+
return ['fixed'].includes(value);
|
|
16641
|
+
},
|
|
16642
|
+
},
|
|
16643
|
+
/**
|
|
16644
|
+
* Size the component small, large, or extra large.
|
|
16645
|
+
*/
|
|
16646
|
+
size: {
|
|
16647
|
+
type: String,
|
|
16648
|
+
default: undefined,
|
|
16649
|
+
validator: (value) => {
|
|
16650
|
+
return ['sm', 'lg', 'xl'].includes(value);
|
|
16651
|
+
},
|
|
16652
|
+
},
|
|
16653
|
+
/**
|
|
16654
|
+
* Expand narrowed sidebar on hover.
|
|
16655
|
+
*/
|
|
16656
|
+
unfoldable: Boolean,
|
|
16657
|
+
/**
|
|
16658
|
+
* Toggle the visibility of sidebar component.
|
|
16659
|
+
*/
|
|
16660
|
+
visible: Boolean,
|
|
16661
|
+
},
|
|
16662
|
+
emits: [
|
|
16663
|
+
/**
|
|
16664
|
+
* Callback fired when the component requests to be hidden.
|
|
16665
|
+
*/
|
|
16666
|
+
'hide',
|
|
16667
|
+
/**
|
|
16668
|
+
* Callback fired when the component requests to be shown.
|
|
16669
|
+
*/
|
|
16670
|
+
'show',
|
|
16671
|
+
/**
|
|
16672
|
+
* Event emitted after visibility of component changed.
|
|
16673
|
+
*/
|
|
16674
|
+
'visible-change',
|
|
16675
|
+
],
|
|
16676
|
+
setup(props, { attrs, slots, emit }) {
|
|
16677
|
+
const mobile = vue.ref();
|
|
16678
|
+
const inViewport = vue.ref();
|
|
16679
|
+
const sidebarRef = vue.ref();
|
|
16680
|
+
const visible = vue.ref(props.visible);
|
|
16681
|
+
vue.watch(inViewport, () => {
|
|
16682
|
+
emit('visible-change', inViewport.value);
|
|
16683
|
+
inViewport.value ? emit('show') : emit('hide');
|
|
16684
|
+
});
|
|
16685
|
+
vue.watch(() => props.visible, () => (visible.value = props.visible));
|
|
16686
|
+
vue.watch(mobile, () => {
|
|
16687
|
+
if (mobile.value && visible.value)
|
|
16688
|
+
visible.value = false;
|
|
16689
|
+
});
|
|
16690
|
+
vue.onMounted(() => {
|
|
16691
|
+
mobile.value = isOnMobile(sidebarRef.value);
|
|
16692
|
+
inViewport.value = isVisible(sidebarRef.value);
|
|
16693
|
+
window.addEventListener('resize', () => handleResize());
|
|
16694
|
+
window.addEventListener('mouseup', handleClickOutside);
|
|
16695
|
+
window.addEventListener('keyup', handleKeyup);
|
|
16696
|
+
sidebarRef.value.addEventListener('mouseup', handleOnClick);
|
|
16697
|
+
sidebarRef.value.addEventListener('transitionend', () => {
|
|
16698
|
+
inViewport.value = isVisible(sidebarRef.value);
|
|
16699
|
+
});
|
|
16700
|
+
});
|
|
16701
|
+
vue.onBeforeUnmount(() => {
|
|
16702
|
+
window.removeEventListener('resize', () => handleResize());
|
|
16703
|
+
window.removeEventListener('mouseup', handleClickOutside);
|
|
16704
|
+
window.removeEventListener('keyup', handleKeyup);
|
|
16705
|
+
sidebarRef.value.removeEventListener('mouseup', handleOnClick);
|
|
16706
|
+
sidebarRef.value.removeEventListener('transitionend', () => {
|
|
16707
|
+
inViewport.value = isVisible(sidebarRef.value);
|
|
16708
|
+
});
|
|
16709
|
+
});
|
|
16710
|
+
const handleHide = () => {
|
|
16711
|
+
visible.value = false;
|
|
16712
|
+
emit('visible-change', false);
|
|
16713
|
+
};
|
|
16714
|
+
const handleResize = () => {
|
|
16715
|
+
mobile.value = isOnMobile(sidebarRef.value);
|
|
16716
|
+
inViewport.value = isVisible(sidebarRef.value);
|
|
16717
|
+
};
|
|
16718
|
+
const handleKeyup = (event) => {
|
|
16719
|
+
if (mobile.value && !sidebarRef.value.contains(event.target)) {
|
|
16720
|
+
handleHide();
|
|
16721
|
+
}
|
|
16722
|
+
};
|
|
16723
|
+
const handleClickOutside = (event) => {
|
|
16724
|
+
if (mobile.value && !sidebarRef.value.contains(event.target)) {
|
|
16725
|
+
handleHide();
|
|
16726
|
+
}
|
|
16727
|
+
};
|
|
16728
|
+
const handleOnClick = (event) => {
|
|
16729
|
+
const target = event.target;
|
|
16730
|
+
target &&
|
|
16731
|
+
target.classList.contains('nav-link') &&
|
|
16732
|
+
!target.classList.contains('nav-group-toggle') &&
|
|
16733
|
+
mobile.value &&
|
|
16734
|
+
handleHide();
|
|
16735
|
+
};
|
|
16736
|
+
return () => [
|
|
16737
|
+
vue.h('div', {
|
|
16738
|
+
class: [
|
|
16739
|
+
'sidebar',
|
|
16740
|
+
{
|
|
16741
|
+
[`sidebar-${props.colorScheme}`]: props.colorScheme,
|
|
16742
|
+
'sidebar-narrow': props.narrow,
|
|
16743
|
+
'sidebar-overlaid': props.overlaid,
|
|
16744
|
+
[`sidebar-${props.placement}`]: props.placement,
|
|
16745
|
+
[`sidebar-${props.position}`]: props.position,
|
|
16746
|
+
[`sidebar-${props.size}`]: props.size,
|
|
16747
|
+
'sidebar-narrow-unfoldable': props.unfoldable,
|
|
16748
|
+
show: visible.value === true && mobile.value,
|
|
16749
|
+
hide: visible.value === false && !mobile.value,
|
|
16750
|
+
},
|
|
16751
|
+
attrs.class,
|
|
16752
|
+
],
|
|
16753
|
+
ref: sidebarRef,
|
|
16754
|
+
}, slots.default && slots.default()),
|
|
16755
|
+
mobile.value &&
|
|
16756
|
+
vue.h(CBackdrop, {
|
|
16757
|
+
class: 'sidebar-backdrop d-none',
|
|
16758
|
+
visible: props.visible,
|
|
16759
|
+
onClick: () => handleHide(),
|
|
16760
|
+
}),
|
|
16761
|
+
];
|
|
16762
|
+
},
|
|
16763
|
+
});
|
|
16764
|
+
|
|
16765
|
+
const CSidebarBrand = vue.defineComponent({
|
|
16766
|
+
name: 'CSidebarBrand',
|
|
16767
|
+
setup(_, { slots }) {
|
|
16768
|
+
return () => vue.h('div', { class: 'sidebar-brand' }, slots.default && slots.default());
|
|
16769
|
+
},
|
|
16770
|
+
});
|
|
16771
|
+
|
|
16772
|
+
const CSidebarFooter = vue.defineComponent({
|
|
16773
|
+
name: 'CSidebarFooter',
|
|
16774
|
+
setup(_, { slots }) {
|
|
16775
|
+
return () => vue.h('div', { class: 'sidebar-footer' }, slots.default && slots.default());
|
|
16776
|
+
},
|
|
16777
|
+
});
|
|
16778
|
+
|
|
16779
|
+
const CSidebarHeader = vue.defineComponent({
|
|
16780
|
+
name: 'CSidebarHeader',
|
|
16781
|
+
setup(_, { slots }) {
|
|
16782
|
+
return () => vue.h('div', { class: 'sidebar-header' }, slots.default && slots.default());
|
|
16783
|
+
},
|
|
16784
|
+
});
|
|
16785
|
+
|
|
16786
|
+
const CSidebarNav = vue.defineComponent({
|
|
16787
|
+
name: 'CSidebarNav',
|
|
16788
|
+
setup(_, { slots }) {
|
|
16789
|
+
const visibleGroup = vue.ref();
|
|
16790
|
+
const handleVisibleChange = (visible, index) => {
|
|
16791
|
+
if (visible) {
|
|
16792
|
+
visibleGroup.value = index;
|
|
16793
|
+
}
|
|
16794
|
+
else {
|
|
16795
|
+
if (visibleGroup.value === index) {
|
|
16796
|
+
visibleGroup.value = 0;
|
|
16797
|
+
}
|
|
16798
|
+
}
|
|
16799
|
+
};
|
|
16800
|
+
const isVisible = (index) => Boolean(visibleGroup.value === index);
|
|
16801
|
+
return () => vue.h('ul', {
|
|
16802
|
+
class: 'sidebar-nav',
|
|
16803
|
+
}, slots.default &&
|
|
16804
|
+
slots.default().map((vnode, index) => {
|
|
16805
|
+
// @ts-expect-error name is defined in component
|
|
16806
|
+
if (vnode.type.name === 'CNavGroup') {
|
|
16807
|
+
return vue.h(vnode, {
|
|
16808
|
+
onVisibleChange: (visible) => handleVisibleChange(visible, index + 1),
|
|
16809
|
+
...(visibleGroup.value && { visible: isVisible(index + 1) }),
|
|
16810
|
+
});
|
|
16811
|
+
}
|
|
16812
|
+
return vnode;
|
|
16813
|
+
}));
|
|
16814
|
+
},
|
|
16815
|
+
});
|
|
16816
|
+
|
|
16817
|
+
const CSidebarToggler = vue.defineComponent({
|
|
16818
|
+
name: 'CSidebarToggler',
|
|
16819
|
+
setup(_, { slots }) {
|
|
16820
|
+
return () => vue.h('button', { class: 'sidebar-toggler' }, slots.default && slots.default());
|
|
16821
|
+
},
|
|
16822
|
+
});
|
|
16823
|
+
|
|
16824
|
+
const CSidebarPlugin = {
|
|
16682
16825
|
install: (app) => {
|
|
16683
|
-
app.component(
|
|
16826
|
+
app.component(CSidebar.name, CSidebar);
|
|
16827
|
+
app.component(CSidebarBrand.name, CSidebarBrand);
|
|
16828
|
+
app.component(CSidebarFooter.name, CSidebarFooter);
|
|
16829
|
+
app.component(CSidebarHeader.name, CSidebarHeader);
|
|
16830
|
+
app.component(CSidebarNav.name, CSidebarNav);
|
|
16831
|
+
app.component(CSidebarToggler.name, CSidebarToggler);
|
|
16684
16832
|
},
|
|
16685
16833
|
};
|
|
16686
16834
|
|
|
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',
|
|
16835
|
+
const CSmartPagination = vue.defineComponent({
|
|
16836
|
+
name: 'CSmartPagination',
|
|
16697
16837
|
props: {
|
|
16698
16838
|
/**
|
|
16699
|
-
*
|
|
16839
|
+
* Horizontall align
|
|
16700
16840
|
*
|
|
16701
|
-
* @
|
|
16841
|
+
* @default 'start'
|
|
16702
16842
|
*/
|
|
16703
|
-
|
|
16843
|
+
align: {
|
|
16704
16844
|
type: String,
|
|
16705
|
-
default:
|
|
16845
|
+
default: 'start',
|
|
16846
|
+
require: false,
|
|
16706
16847
|
validator: (value) => {
|
|
16707
|
-
return ['
|
|
16848
|
+
return ['start', 'center', 'end'].includes(value);
|
|
16708
16849
|
},
|
|
16709
16850
|
},
|
|
16710
16851
|
/**
|
|
16711
|
-
*
|
|
16852
|
+
* Current page number
|
|
16853
|
+
*
|
|
16854
|
+
* @default 1
|
|
16712
16855
|
*/
|
|
16713
|
-
|
|
16856
|
+
activePage: {
|
|
16857
|
+
type: Number,
|
|
16858
|
+
default: 1,
|
|
16859
|
+
require: false,
|
|
16860
|
+
},
|
|
16861
|
+
/**
|
|
16862
|
+
* Show/hide arrows
|
|
16863
|
+
*
|
|
16864
|
+
* @default true
|
|
16865
|
+
*/
|
|
16866
|
+
arrows: {
|
|
16714
16867
|
type: Boolean,
|
|
16715
|
-
|
|
16868
|
+
default: true,
|
|
16869
|
+
require: false,
|
|
16716
16870
|
},
|
|
16717
16871
|
/**
|
|
16718
|
-
*
|
|
16872
|
+
* Show/hide dots
|
|
16873
|
+
*
|
|
16874
|
+
* @default true
|
|
16719
16875
|
*/
|
|
16720
|
-
|
|
16876
|
+
dots: {
|
|
16721
16877
|
type: Boolean,
|
|
16722
|
-
|
|
16878
|
+
default: true,
|
|
16879
|
+
require: false,
|
|
16723
16880
|
},
|
|
16724
16881
|
/**
|
|
16725
|
-
*
|
|
16726
|
-
*
|
|
16882
|
+
* Show double arrows buttons
|
|
16883
|
+
*
|
|
16884
|
+
* @default true
|
|
16727
16885
|
*/
|
|
16728
|
-
|
|
16729
|
-
type:
|
|
16730
|
-
default:
|
|
16731
|
-
|
|
16732
|
-
return ['start', 'end'].includes(value);
|
|
16733
|
-
},
|
|
16886
|
+
doubleArrows: {
|
|
16887
|
+
type: Boolean,
|
|
16888
|
+
default: true,
|
|
16889
|
+
require: false,
|
|
16734
16890
|
},
|
|
16735
16891
|
/**
|
|
16736
|
-
*
|
|
16892
|
+
* The content of 'firstButton' button
|
|
16893
|
+
*
|
|
16894
|
+
* @default '«'
|
|
16737
16895
|
*/
|
|
16738
|
-
|
|
16896
|
+
firstButton: {
|
|
16739
16897
|
type: String,
|
|
16740
|
-
default:
|
|
16741
|
-
|
|
16742
|
-
return ['fixed'].includes(value);
|
|
16743
|
-
},
|
|
16898
|
+
default: '«',
|
|
16899
|
+
require: false,
|
|
16744
16900
|
},
|
|
16745
16901
|
/**
|
|
16746
|
-
*
|
|
16902
|
+
* The content of 'lastButton' button
|
|
16903
|
+
*
|
|
16904
|
+
* @default '»'
|
|
16747
16905
|
*/
|
|
16748
|
-
|
|
16906
|
+
lastButton: {
|
|
16749
16907
|
type: String,
|
|
16750
|
-
default:
|
|
16751
|
-
|
|
16752
|
-
return ['sm', 'lg', 'xl'].includes(value);
|
|
16753
|
-
},
|
|
16908
|
+
default: '»',
|
|
16909
|
+
require: false,
|
|
16754
16910
|
},
|
|
16755
16911
|
/**
|
|
16756
|
-
*
|
|
16912
|
+
* Maximum items number
|
|
16913
|
+
*
|
|
16914
|
+
* @default 5
|
|
16757
16915
|
*/
|
|
16758
|
-
|
|
16916
|
+
limit: {
|
|
16917
|
+
type: Number,
|
|
16918
|
+
default: 5,
|
|
16919
|
+
require: false,
|
|
16920
|
+
},
|
|
16759
16921
|
/**
|
|
16760
|
-
*
|
|
16922
|
+
* The content of 'nextButton' button
|
|
16923
|
+
*
|
|
16924
|
+
* @default '›'
|
|
16761
16925
|
*/
|
|
16762
|
-
|
|
16763
|
-
|
|
16764
|
-
|
|
16926
|
+
nextButton: {
|
|
16927
|
+
type: String,
|
|
16928
|
+
default: '›',
|
|
16929
|
+
require: false,
|
|
16930
|
+
},
|
|
16765
16931
|
/**
|
|
16766
|
-
*
|
|
16932
|
+
* Number of pages
|
|
16767
16933
|
*/
|
|
16768
|
-
|
|
16934
|
+
pages: {
|
|
16935
|
+
type: Number,
|
|
16936
|
+
default: 1000,
|
|
16937
|
+
require: true,
|
|
16938
|
+
},
|
|
16769
16939
|
/**
|
|
16770
|
-
*
|
|
16940
|
+
* The content of 'previousButton' button
|
|
16941
|
+
*
|
|
16942
|
+
* @default '‹'
|
|
16771
16943
|
*/
|
|
16772
|
-
|
|
16944
|
+
previousButton: {
|
|
16945
|
+
type: String,
|
|
16946
|
+
default: '‹',
|
|
16947
|
+
require: false,
|
|
16948
|
+
},
|
|
16773
16949
|
/**
|
|
16774
|
-
*
|
|
16950
|
+
* Size of pagination, valid values: 'sm', 'lg'
|
|
16775
16951
|
*/
|
|
16776
|
-
|
|
16952
|
+
size: {
|
|
16953
|
+
type: String,
|
|
16954
|
+
default: undefined,
|
|
16955
|
+
required: false,
|
|
16956
|
+
validator: (value) => {
|
|
16957
|
+
return ['sm', 'lg'].includes(value);
|
|
16958
|
+
},
|
|
16959
|
+
},
|
|
16960
|
+
},
|
|
16961
|
+
emits: [
|
|
16962
|
+
/**
|
|
16963
|
+
* On active page change callback.
|
|
16964
|
+
*/
|
|
16965
|
+
'activePageChange',
|
|
16777
16966
|
],
|
|
16778
|
-
setup(props, {
|
|
16779
|
-
const
|
|
16780
|
-
const
|
|
16781
|
-
const
|
|
16782
|
-
|
|
16783
|
-
|
|
16784
|
-
|
|
16785
|
-
|
|
16967
|
+
setup(props, { emit }) {
|
|
16968
|
+
const activePage = vue.ref(props.activePage);
|
|
16969
|
+
const limit = vue.ref(props.limit);
|
|
16970
|
+
const pages = vue.ref(props.pages);
|
|
16971
|
+
vue.watch(props, () => {
|
|
16972
|
+
activePage.value = props.activePage;
|
|
16973
|
+
limit.value = props.limit;
|
|
16974
|
+
pages.value = props.pages;
|
|
16786
16975
|
});
|
|
16787
|
-
vue.
|
|
16788
|
-
|
|
16789
|
-
|
|
16790
|
-
|
|
16976
|
+
const showDots = vue.computed(() => {
|
|
16977
|
+
return props.dots && limit.value > 4 && limit.value < pages.value;
|
|
16978
|
+
});
|
|
16979
|
+
const maxPrevItems = vue.computed(() => {
|
|
16980
|
+
return Math.floor((limit.value - 1) / 2);
|
|
16981
|
+
});
|
|
16982
|
+
const maxNextItems = vue.computed(() => {
|
|
16983
|
+
return Math.ceil((limit.value - 1) / 2);
|
|
16984
|
+
});
|
|
16985
|
+
const beforeDots = vue.computed(() => {
|
|
16986
|
+
return showDots.value && activePage.value > maxPrevItems.value + 1;
|
|
16987
|
+
});
|
|
16988
|
+
const afterDots = vue.computed(() => {
|
|
16989
|
+
return showDots.value && activePage.value < pages.value - maxNextItems.value;
|
|
16990
|
+
});
|
|
16991
|
+
const computedLimit = vue.computed(() => {
|
|
16992
|
+
return limit.value - (afterDots.value ? 1 : 0) - (beforeDots.value ? 1 : 0);
|
|
16993
|
+
});
|
|
16994
|
+
const range = vue.computed(() => {
|
|
16995
|
+
return activePage.value + maxNextItems.value;
|
|
16791
16996
|
});
|
|
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
|
-
});
|
|
16997
|
+
const lastItem = vue.computed(() => {
|
|
16998
|
+
return range.value >= pages.value ? pages.value : range.value - (afterDots.value ? 1 : 0);
|
|
16802
16999
|
});
|
|
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
|
-
});
|
|
17000
|
+
const itemsAmount = vue.computed(() => {
|
|
17001
|
+
return pages.value < computedLimit.value ? pages.value : computedLimit.value;
|
|
16811
17002
|
});
|
|
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;
|
|
17003
|
+
const items = vue.computed(() => {
|
|
17004
|
+
if (activePage.value - maxPrevItems.value <= 1) {
|
|
17005
|
+
return Array.from({
|
|
17006
|
+
length: itemsAmount.value,
|
|
17007
|
+
}, (_v, i) => i + 1);
|
|
16895
17008
|
}
|
|
16896
17009
|
else {
|
|
16897
|
-
|
|
16898
|
-
|
|
16899
|
-
}
|
|
17010
|
+
return Array.from({
|
|
17011
|
+
length: itemsAmount.value,
|
|
17012
|
+
}, (_v, i) => {
|
|
17013
|
+
return lastItem.value - i;
|
|
17014
|
+
}).reverse();
|
|
17015
|
+
}
|
|
17016
|
+
});
|
|
17017
|
+
const setPage = (number) => {
|
|
17018
|
+
if (number !== activePage.value) {
|
|
17019
|
+
activePage.value = number;
|
|
17020
|
+
emit('activePageChange', number);
|
|
16900
17021
|
}
|
|
16901
17022
|
};
|
|
16902
|
-
|
|
16903
|
-
|
|
16904
|
-
|
|
16905
|
-
|
|
16906
|
-
|
|
16907
|
-
|
|
16908
|
-
|
|
16909
|
-
|
|
16910
|
-
|
|
16911
|
-
|
|
17023
|
+
return () => vue.h(CPagination, {
|
|
17024
|
+
align: props.align,
|
|
17025
|
+
'aria-label': 'pagination',
|
|
17026
|
+
size: props.size,
|
|
17027
|
+
}, {
|
|
17028
|
+
default: () => [
|
|
17029
|
+
props.doubleArrows &&
|
|
17030
|
+
vue.h(CPaginationItem, {
|
|
17031
|
+
onClick: () => {
|
|
17032
|
+
activePage.value !== 1 && setPage(1);
|
|
17033
|
+
},
|
|
17034
|
+
'aria-label': 'Go to first page',
|
|
17035
|
+
...(activePage.value === 1 && {
|
|
17036
|
+
'aria-disabled': true,
|
|
17037
|
+
disabled: true,
|
|
17038
|
+
}),
|
|
17039
|
+
}, {
|
|
17040
|
+
default: () => typeof props.firstButton === 'string'
|
|
17041
|
+
? vue.h('span', {
|
|
17042
|
+
innerHTML: props.firstButton,
|
|
17043
|
+
})
|
|
17044
|
+
: props.firstButton,
|
|
17045
|
+
}),
|
|
17046
|
+
props.arrows &&
|
|
17047
|
+
vue.h(CPaginationItem, {
|
|
17048
|
+
onClick: () => {
|
|
17049
|
+
activePage.value !== 1 && setPage(activePage.value - 1);
|
|
17050
|
+
},
|
|
17051
|
+
'aria-label': 'Go to previous page',
|
|
17052
|
+
...(activePage.value === 1 && {
|
|
17053
|
+
'aria-disabled': true,
|
|
17054
|
+
disabled: true,
|
|
17055
|
+
}),
|
|
17056
|
+
}, {
|
|
17057
|
+
default: () => typeof props.previousButton === 'string'
|
|
17058
|
+
? vue.h('span', {
|
|
17059
|
+
innerHTML: props.previousButton,
|
|
17060
|
+
})
|
|
17061
|
+
: props.previousButton,
|
|
17062
|
+
}),
|
|
17063
|
+
beforeDots.value &&
|
|
17064
|
+
vue.h(CPaginationItem, {
|
|
17065
|
+
role: 'separator',
|
|
17066
|
+
disabled: true,
|
|
17067
|
+
}, {
|
|
17068
|
+
default: () => '...',
|
|
17069
|
+
}),
|
|
17070
|
+
items.value.map((i) => {
|
|
17071
|
+
return vue.h(CPaginationItem, {
|
|
17072
|
+
onClick: () => setPage(i),
|
|
17073
|
+
'aria-label': activePage.value === i ? `Current page ${i}` : `Go to page ${i}`,
|
|
17074
|
+
active: activePage.value === i,
|
|
17075
|
+
}, {
|
|
17076
|
+
default: () => i,
|
|
16912
17077
|
});
|
|
16913
|
-
}
|
|
16914
|
-
|
|
16915
|
-
|
|
16916
|
-
|
|
16917
|
-
|
|
16918
|
-
|
|
16919
|
-
|
|
16920
|
-
|
|
16921
|
-
|
|
16922
|
-
|
|
17078
|
+
}),
|
|
17079
|
+
afterDots.value &&
|
|
17080
|
+
vue.h(CPaginationItem, {
|
|
17081
|
+
role: 'separator',
|
|
17082
|
+
disabled: true,
|
|
17083
|
+
}, {
|
|
17084
|
+
default: () => '...',
|
|
17085
|
+
}),
|
|
17086
|
+
props.arrows &&
|
|
17087
|
+
vue.h(CPaginationItem, {
|
|
17088
|
+
onClick: () => {
|
|
17089
|
+
activePage.value !== pages.value && setPage(activePage.value + 1);
|
|
17090
|
+
},
|
|
17091
|
+
'aria-label': 'Go to next page',
|
|
17092
|
+
...(activePage.value === pages.value && {
|
|
17093
|
+
'aria-disabled': true,
|
|
17094
|
+
disabled: true,
|
|
17095
|
+
}),
|
|
17096
|
+
}, {
|
|
17097
|
+
default: () => typeof props.nextButton === 'string'
|
|
17098
|
+
? vue.h('span', {
|
|
17099
|
+
innerHTML: props.nextButton,
|
|
17100
|
+
})
|
|
17101
|
+
: props.nextButton,
|
|
17102
|
+
}),
|
|
17103
|
+
props.doubleArrows &&
|
|
17104
|
+
vue.h(CPaginationItem, {
|
|
17105
|
+
onClick: () => {
|
|
17106
|
+
activePage.value !== pages.value && setPage(pages.value);
|
|
17107
|
+
},
|
|
17108
|
+
'aria-label': 'Go to last page',
|
|
17109
|
+
...(activePage.value === pages.value && {
|
|
17110
|
+
'aria-disabled': true,
|
|
17111
|
+
disabled: true,
|
|
17112
|
+
}),
|
|
17113
|
+
}, {
|
|
17114
|
+
default: () => typeof props.lastButton === 'string'
|
|
17115
|
+
? vue.h('span', {
|
|
17116
|
+
innerHTML: props.lastButton,
|
|
17117
|
+
})
|
|
17118
|
+
: props.lastButton,
|
|
17119
|
+
}),
|
|
17120
|
+
],
|
|
17121
|
+
});
|
|
16923
17122
|
},
|
|
16924
17123
|
});
|
|
16925
17124
|
|
|
16926
|
-
const
|
|
17125
|
+
const CSmartPaginationPlugin = {
|
|
16927
17126
|
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);
|
|
17127
|
+
app.component(CSmartPagination.name, CSmartPagination);
|
|
16934
17128
|
},
|
|
16935
17129
|
};
|
|
16936
17130
|
|
|
@@ -16957,7 +17151,6 @@ const CTableBody = vue.defineComponent({
|
|
|
16957
17151
|
|
|
16958
17152
|
const CTableCaption = vue.defineComponent({
|
|
16959
17153
|
name: 'CTableCaption',
|
|
16960
|
-
props: {},
|
|
16961
17154
|
setup(_, { slots }) {
|
|
16962
17155
|
return () => vue.h('caption', {}, slots.default && slots.default());
|
|
16963
17156
|
},
|
|
@@ -17973,13 +18166,13 @@ const CIcon = vue.defineComponent({
|
|
|
17973
18166
|
},
|
|
17974
18167
|
});
|
|
17975
18168
|
|
|
17976
|
-
|
|
18169
|
+
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
18170
|
|
|
17978
|
-
|
|
18171
|
+
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
18172
|
|
|
17980
|
-
|
|
18173
|
+
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
18174
|
|
|
17982
|
-
|
|
18175
|
+
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
18176
|
|
|
17984
18177
|
const CSmartTable = vue.defineComponent({
|
|
17985
18178
|
name: 'CSmartTable',
|
|
@@ -18088,6 +18281,7 @@ const CSmartTable = vue.defineComponent({
|
|
|
18088
18281
|
*/
|
|
18089
18282
|
itemsPerPage: {
|
|
18090
18283
|
type: Number,
|
|
18284
|
+
default: 10,
|
|
18091
18285
|
required: false,
|
|
18092
18286
|
},
|
|
18093
18287
|
/**
|
|
@@ -18136,7 +18330,7 @@ const CSmartTable = vue.defineComponent({
|
|
|
18136
18330
|
* 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
18331
|
*/
|
|
18138
18332
|
pagination: {
|
|
18139
|
-
type: Boolean,
|
|
18333
|
+
type: [Boolean, Object],
|
|
18140
18334
|
required: false,
|
|
18141
18335
|
},
|
|
18142
18336
|
/**
|
|
@@ -18623,12 +18817,14 @@ const CSmartTable = vue.defineComponent({
|
|
|
18623
18817
|
}, [
|
|
18624
18818
|
vue.h('div', {
|
|
18625
18819
|
class: 'col',
|
|
18626
|
-
}, props.pagination && numberOfPages.value > 1
|
|
18820
|
+
}, (props.pagination && numberOfPages.value > 1) || props.paginationProps
|
|
18627
18821
|
? vue.h(CSmartPagination, {
|
|
18628
|
-
...props.paginationProps,
|
|
18629
18822
|
pages: numberOfPages.value,
|
|
18630
18823
|
activePage: activePage.value,
|
|
18631
|
-
|
|
18824
|
+
...props.paginationProps,
|
|
18825
|
+
onActivePageChange: (page) => typeof props.pagination === 'object' && props.pagination.external
|
|
18826
|
+
? emit('activePageChange', page)
|
|
18827
|
+
: handleActivePageChange(page),
|
|
18632
18828
|
})
|
|
18633
18829
|
: ''),
|
|
18634
18830
|
vue.h('div', {
|
|
@@ -19757,7 +19953,6 @@ var Components = /*#__PURE__*/Object.freeze({
|
|
|
19757
19953
|
CPaginationPlugin: CPaginationPlugin,
|
|
19758
19954
|
CPagination: CPagination,
|
|
19759
19955
|
CPaginationItem: CPaginationItem,
|
|
19760
|
-
CSmartPagination: CSmartPagination,
|
|
19761
19956
|
CPicker: CPicker,
|
|
19762
19957
|
CPickerPlugin: CPickerPlugin,
|
|
19763
19958
|
CPlaceholderPlugin: CPlaceholderPlugin,
|
|
@@ -19774,6 +19969,8 @@ var Components = /*#__PURE__*/Object.freeze({
|
|
|
19774
19969
|
CSidebarHeader: CSidebarHeader,
|
|
19775
19970
|
CSidebarNav: CSidebarNav,
|
|
19776
19971
|
CSidebarToggler: CSidebarToggler,
|
|
19972
|
+
CSmartPaginationPlugin: CSmartPaginationPlugin,
|
|
19973
|
+
CSmartPagination: CSmartPagination,
|
|
19777
19974
|
CSmartTablePlugin: CSmartTablePlugin,
|
|
19778
19975
|
CSmartTable: CSmartTable,
|
|
19779
19976
|
CSpinnerPlugin: CSpinnerPlugin,
|
|
@@ -20181,6 +20378,7 @@ exports.CSidebarNav = CSidebarNav;
|
|
|
20181
20378
|
exports.CSidebarPlugin = CSidebarPlugin;
|
|
20182
20379
|
exports.CSidebarToggler = CSidebarToggler;
|
|
20183
20380
|
exports.CSmartPagination = CSmartPagination;
|
|
20381
|
+
exports.CSmartPaginationPlugin = CSmartPaginationPlugin;
|
|
20184
20382
|
exports.CSmartTable = CSmartTable;
|
|
20185
20383
|
exports.CSmartTablePlugin = CSmartTablePlugin;
|
|
20186
20384
|
exports.CSpinner = CSpinner;
|