@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.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, provide, h as h$1, Transition, withDirectives, inject, watch, reactive, onBeforeMount, onMounted, onUpdated, toRefs, onUnmounted, cloneVNode, nextTick, vShow,
|
|
1
|
+
import { defineComponent, ref, provide, h as h$1, Transition, withDirectives, inject, watch, reactive, onBeforeMount, onMounted, onUpdated, toRefs, onUnmounted, cloneVNode, nextTick, vShow, Teleport, onBeforeUnmount, computed } from 'vue';
|
|
2
2
|
|
|
3
3
|
const CAccordion = defineComponent({
|
|
4
4
|
name: 'CAccordion',
|
|
@@ -1905,13 +1905,46 @@ const CCardPlugin = {
|
|
|
1905
1905
|
},
|
|
1906
1906
|
};
|
|
1907
1907
|
|
|
1908
|
-
const
|
|
1908
|
+
const getNextSibling = (elem, selector) => {
|
|
1909
|
+
// Get the next sibling element
|
|
1910
|
+
let sibling = elem.nextElementSibling;
|
|
1911
|
+
// If there's no selector, return the first sibling
|
|
1912
|
+
if (!selector)
|
|
1913
|
+
return sibling;
|
|
1914
|
+
// If the sibling matches our selector, use it
|
|
1915
|
+
// If not, jump to the next sibling and continue the loop
|
|
1916
|
+
while (sibling) {
|
|
1917
|
+
if (sibling.matches(selector))
|
|
1918
|
+
return sibling;
|
|
1919
|
+
sibling = sibling.nextElementSibling;
|
|
1920
|
+
}
|
|
1921
|
+
return;
|
|
1922
|
+
};
|
|
1923
|
+
|
|
1924
|
+
const getPreviousSibling = (elem, selector) => {
|
|
1925
|
+
// Get the next sibling element
|
|
1926
|
+
let sibling = elem.previousElementSibling;
|
|
1927
|
+
// If there's no selector, return the first sibling
|
|
1928
|
+
if (!selector)
|
|
1929
|
+
return sibling;
|
|
1930
|
+
// If the sibling matches our selector, use it
|
|
1931
|
+
// If not, jump to the next sibling and continue the loop
|
|
1932
|
+
while (sibling) {
|
|
1933
|
+
if (sibling.matches(selector))
|
|
1934
|
+
return sibling;
|
|
1935
|
+
sibling = sibling.previousElementSibling;
|
|
1936
|
+
}
|
|
1937
|
+
return;
|
|
1938
|
+
};
|
|
1939
|
+
|
|
1940
|
+
const isVisible = (element) => {
|
|
1909
1941
|
const rect = element.getBoundingClientRect();
|
|
1910
1942
|
return (rect.top >= 0 &&
|
|
1911
1943
|
rect.left >= 0 &&
|
|
1912
1944
|
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
|
|
1913
1945
|
rect.right <= (window.innerWidth || document.documentElement.clientWidth));
|
|
1914
1946
|
};
|
|
1947
|
+
|
|
1915
1948
|
const CCarousel = defineComponent({
|
|
1916
1949
|
name: 'CCarousel',
|
|
1917
1950
|
props: {
|
|
@@ -2023,7 +2056,7 @@ const CCarousel = defineComponent({
|
|
|
2023
2056
|
const nextItemWhenVisible = () => {
|
|
2024
2057
|
// Don't call next when the page isn't visible
|
|
2025
2058
|
// or the carousel or its parent isn't visible
|
|
2026
|
-
if (!document.hidden && isVisible
|
|
2059
|
+
if (!document.hidden && isVisible(carouselRef.value)) {
|
|
2027
2060
|
handleControlClick('next');
|
|
2028
2061
|
}
|
|
2029
2062
|
};
|
|
@@ -2042,7 +2075,7 @@ const CCarousel = defineComponent({
|
|
|
2042
2075
|
}
|
|
2043
2076
|
};
|
|
2044
2077
|
const handleScroll = () => {
|
|
2045
|
-
if (!document.hidden && isVisible
|
|
2078
|
+
if (!document.hidden && isVisible(carouselRef.value)) {
|
|
2046
2079
|
visible.value = true;
|
|
2047
2080
|
}
|
|
2048
2081
|
else {
|
|
@@ -8332,6 +8365,8 @@ const CFormControlWrapper = defineComponent({
|
|
|
8332
8365
|
},
|
|
8333
8366
|
});
|
|
8334
8367
|
|
|
8368
|
+
const File = typeof window !== 'undefined' ? window.File : class File extends Object {
|
|
8369
|
+
};
|
|
8335
8370
|
const CFormInput = defineComponent({
|
|
8336
8371
|
name: 'CFormInput',
|
|
8337
8372
|
props: {
|
|
@@ -11934,6 +11969,12 @@ const CTimePickerRollCol = defineComponent({
|
|
|
11934
11969
|
}
|
|
11935
11970
|
init.value = false;
|
|
11936
11971
|
});
|
|
11972
|
+
const handleKeyDown = (event, value) => {
|
|
11973
|
+
if (event.code === 'Space' || event.key === 'Enter') {
|
|
11974
|
+
event.preventDefault();
|
|
11975
|
+
emit('click', value);
|
|
11976
|
+
}
|
|
11977
|
+
};
|
|
11937
11978
|
return () => h$1('div', { class: 'time-picker-roll-col', ref: colRef }, props.elements.map((element) => {
|
|
11938
11979
|
return h$1('div', {
|
|
11939
11980
|
class: [
|
|
@@ -11943,7 +11984,9 @@ const CTimePickerRollCol = defineComponent({
|
|
|
11943
11984
|
},
|
|
11944
11985
|
],
|
|
11945
11986
|
onClick: () => emit('click', element.value),
|
|
11987
|
+
onKeydown: (event) => handleKeyDown(event, element.value),
|
|
11946
11988
|
role: 'button',
|
|
11989
|
+
tabindex: 0,
|
|
11947
11990
|
}, element.label);
|
|
11948
11991
|
}));
|
|
11949
11992
|
},
|
|
@@ -11972,10 +12015,10 @@ const getAmPm = (date, locale) => {
|
|
|
11972
12015
|
}
|
|
11973
12016
|
return date.getHours() >= 12 ? 'pm' : 'am';
|
|
11974
12017
|
};
|
|
11975
|
-
const getListOfHours = (locale) => Array.from({ length: isAmPm(locale) ? 12 : 24 }, (_, i) => {
|
|
12018
|
+
const getListOfHours = (locale, ampm = 'auto') => Array.from({ length: (ampm === 'auto' && isAmPm(locale)) || ampm ? 12 : 24 }, (_, i) => {
|
|
11976
12019
|
return {
|
|
11977
|
-
value: isAmPm(locale) ? i + 1 : i,
|
|
11978
|
-
label: (isAmPm(locale) ? i + 1 : i).toLocaleString(locale),
|
|
12020
|
+
value: (ampm === 'auto' && isAmPm(locale)) || ampm ? i + 1 : i,
|
|
12021
|
+
label: ((ampm === 'auto' && isAmPm(locale)) || ampm ? i + 1 : i).toLocaleString(locale),
|
|
11979
12022
|
};
|
|
11980
12023
|
});
|
|
11981
12024
|
const getListOfMinutes = (locale, valueAsString = false) => Array.from({ length: 60 }, (_, i) => {
|
|
@@ -12008,7 +12051,11 @@ const getListOfSeconds = (locale, valueAsString = false) => Array.from({ length:
|
|
|
12008
12051
|
.split(':')[2],
|
|
12009
12052
|
};
|
|
12010
12053
|
});
|
|
12011
|
-
const getSelectedHour = (date, locale
|
|
12054
|
+
const getSelectedHour = (date, locale, ampm = 'auto') => date
|
|
12055
|
+
? (ampm === 'auto' && isAmPm(locale)) || ampm
|
|
12056
|
+
? convert24hTo12h(date.getHours())
|
|
12057
|
+
: date.getHours()
|
|
12058
|
+
: '';
|
|
12012
12059
|
const getSelectedMinutes = (date) => (date ? date.getMinutes() : '');
|
|
12013
12060
|
const getSelectedSeconds = (date) => (date ? date.getSeconds() : '');
|
|
12014
12061
|
const isAmPm = (locale) => ['am', 'AM', 'pm', 'PM'].some((el) => new Date().toLocaleString(locale).includes(el));
|
|
@@ -12021,6 +12068,24 @@ const CTimePicker = defineComponent({
|
|
|
12021
12068
|
name: 'CTimePicker',
|
|
12022
12069
|
props: {
|
|
12023
12070
|
...CPicker.props,
|
|
12071
|
+
/**
|
|
12072
|
+
* 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.
|
|
12073
|
+
*
|
|
12074
|
+
* @since 4.7.0
|
|
12075
|
+
*/
|
|
12076
|
+
ampm: {
|
|
12077
|
+
type: [Boolean, String],
|
|
12078
|
+
default: 'auto',
|
|
12079
|
+
validator: (value) => {
|
|
12080
|
+
if (typeof value == 'string') {
|
|
12081
|
+
return ['auto'].includes(value);
|
|
12082
|
+
}
|
|
12083
|
+
if (typeof value == 'boolean') {
|
|
12084
|
+
return true;
|
|
12085
|
+
}
|
|
12086
|
+
return false;
|
|
12087
|
+
},
|
|
12088
|
+
},
|
|
12024
12089
|
/**
|
|
12025
12090
|
* Toggle visibility or set the content of cancel button.
|
|
12026
12091
|
*/
|
|
@@ -12174,6 +12239,15 @@ const CTimePicker = defineComponent({
|
|
|
12174
12239
|
type: String,
|
|
12175
12240
|
default: 'Select time',
|
|
12176
12241
|
},
|
|
12242
|
+
/**
|
|
12243
|
+
* Show seconds.
|
|
12244
|
+
*
|
|
12245
|
+
* @since 4.7.0
|
|
12246
|
+
*/
|
|
12247
|
+
seconds: {
|
|
12248
|
+
type: Boolean,
|
|
12249
|
+
default: true,
|
|
12250
|
+
},
|
|
12177
12251
|
/**
|
|
12178
12252
|
* Size the component small or large.
|
|
12179
12253
|
*
|
|
@@ -12224,6 +12298,10 @@ const CTimePicker = defineComponent({
|
|
|
12224
12298
|
return ['roll', 'select'].includes(value);
|
|
12225
12299
|
},
|
|
12226
12300
|
},
|
|
12301
|
+
/**
|
|
12302
|
+
* Toggle the visibility of the component.
|
|
12303
|
+
*/
|
|
12304
|
+
visible: Boolean,
|
|
12227
12305
|
},
|
|
12228
12306
|
emits: [
|
|
12229
12307
|
/**
|
|
@@ -12238,8 +12316,15 @@ const CTimePicker = defineComponent({
|
|
|
12238
12316
|
* Callback fired when the component requests to be shown.
|
|
12239
12317
|
*/
|
|
12240
12318
|
'show',
|
|
12319
|
+
/**
|
|
12320
|
+
* Callback fired when the time changed.
|
|
12321
|
+
*
|
|
12322
|
+
* @since 4.7.0
|
|
12323
|
+
*/
|
|
12324
|
+
'update:time',
|
|
12241
12325
|
],
|
|
12242
12326
|
setup(props, { emit, attrs, slots }) {
|
|
12327
|
+
const visible = ref(props.visible);
|
|
12243
12328
|
const date = ref(convertTimeToDate(props.time));
|
|
12244
12329
|
const initialDate = ref(null);
|
|
12245
12330
|
const ampm = ref(date.value ? getAmPm(new Date(date.value), props.locale) : 'am');
|
|
@@ -12254,6 +12339,8 @@ const CTimePicker = defineComponent({
|
|
|
12254
12339
|
const handleClear = (event) => {
|
|
12255
12340
|
event.stopPropagation();
|
|
12256
12341
|
date.value = null;
|
|
12342
|
+
emit('change', null);
|
|
12343
|
+
emit('update:time', null);
|
|
12257
12344
|
};
|
|
12258
12345
|
const handleTimeChange = (set, value) => {
|
|
12259
12346
|
const _date = date.value || new Date('1970-01-01');
|
|
@@ -12266,7 +12353,7 @@ const CTimePicker = defineComponent({
|
|
|
12266
12353
|
}
|
|
12267
12354
|
}
|
|
12268
12355
|
if (set === 'hours') {
|
|
12269
|
-
if (isAmPm(props.locale)) {
|
|
12356
|
+
if ((props.ampm === 'auto' && isAmPm(props.locale)) || props.ampm) {
|
|
12270
12357
|
_date.setHours(convert12hTo24h(ampm.value, parseInt(value)));
|
|
12271
12358
|
}
|
|
12272
12359
|
else {
|
|
@@ -12280,7 +12367,8 @@ const CTimePicker = defineComponent({
|
|
|
12280
12367
|
_date.setSeconds(parseInt(value));
|
|
12281
12368
|
}
|
|
12282
12369
|
date.value = new Date(_date);
|
|
12283
|
-
emit('change', _date.toTimeString(), _date.toLocaleTimeString(), _date);
|
|
12370
|
+
emit('change', _date.toTimeString(), _date.toLocaleTimeString(props.locale), _date);
|
|
12371
|
+
emit('update:time', _date.toLocaleTimeString(props.locale));
|
|
12284
12372
|
};
|
|
12285
12373
|
const InputGroup = () => h$1(CInputGroup, { class: 'picker-input-group', size: props.size }, () => [
|
|
12286
12374
|
h$1(CFormInput, {
|
|
@@ -12293,7 +12381,12 @@ const CTimePicker = defineComponent({
|
|
|
12293
12381
|
},
|
|
12294
12382
|
placeholder: props.placeholder,
|
|
12295
12383
|
readonly: props.inputReadOnly,
|
|
12296
|
-
value: date.value
|
|
12384
|
+
value: date.value
|
|
12385
|
+
? date.value.toLocaleTimeString(props.locale, {
|
|
12386
|
+
hour12: (props.ampm === 'auto' && isAmPm(props.locale)) || props.ampm ? true : false,
|
|
12387
|
+
...(!props.seconds && { timeStyle: 'short' }),
|
|
12388
|
+
})
|
|
12389
|
+
: '',
|
|
12297
12390
|
}),
|
|
12298
12391
|
(props.indicator || props.cleaner) &&
|
|
12299
12392
|
h$1(CInputGroupText, {}, () => [
|
|
@@ -12334,14 +12427,15 @@ const CTimePicker = defineComponent({
|
|
|
12334
12427
|
onChange: (event) => handleTimeChange('minutes', event.target.value),
|
|
12335
12428
|
...(date.value && { value: getSelectedMinutes(date.value) }),
|
|
12336
12429
|
}),
|
|
12337
|
-
':',
|
|
12338
|
-
|
|
12339
|
-
|
|
12340
|
-
|
|
12341
|
-
|
|
12342
|
-
|
|
12343
|
-
|
|
12344
|
-
|
|
12430
|
+
props.seconds && ':',
|
|
12431
|
+
props.seconds &&
|
|
12432
|
+
// @ts-expect-error the getListOfMinutes function returns corect type
|
|
12433
|
+
h$1(CFormSelect, {
|
|
12434
|
+
disabled: props.disabled,
|
|
12435
|
+
options: getListOfSeconds(props.locale, true),
|
|
12436
|
+
onChange: (event) => handleTimeChange('seconds', event.target.value),
|
|
12437
|
+
...(date.value && { value: getSelectedSeconds(date.value) }),
|
|
12438
|
+
}),
|
|
12345
12439
|
isAmPm(props.locale) &&
|
|
12346
12440
|
h$1(CFormSelect, {
|
|
12347
12441
|
disabled: props.disabled,
|
|
@@ -12355,21 +12449,22 @@ const CTimePicker = defineComponent({
|
|
|
12355
12449
|
];
|
|
12356
12450
|
const TimePickerRoll = () => [
|
|
12357
12451
|
h$1(CTimePickerRollCol, {
|
|
12358
|
-
elements: getListOfHours(props.locale),
|
|
12452
|
+
elements: getListOfHours(props.locale, props.ampm),
|
|
12359
12453
|
onClick: (index) => handleTimeChange('hours', index.toString()),
|
|
12360
|
-
selected: getSelectedHour(date.value, props.locale),
|
|
12454
|
+
selected: getSelectedHour(date.value, props.locale, props.ampm),
|
|
12361
12455
|
}),
|
|
12362
12456
|
h$1(CTimePickerRollCol, {
|
|
12363
12457
|
elements: getListOfMinutes(props.locale),
|
|
12364
12458
|
onClick: (index) => handleTimeChange('minutes', index.toString()),
|
|
12365
12459
|
selected: getSelectedMinutes(date.value),
|
|
12366
12460
|
}),
|
|
12367
|
-
|
|
12368
|
-
|
|
12369
|
-
|
|
12370
|
-
|
|
12371
|
-
|
|
12372
|
-
|
|
12461
|
+
props.seconds &&
|
|
12462
|
+
h$1(CTimePickerRollCol, {
|
|
12463
|
+
elements: getListOfSeconds(props.locale),
|
|
12464
|
+
onClick: (index) => handleTimeChange('seconds', index.toString()),
|
|
12465
|
+
selected: getSelectedSeconds(date.value),
|
|
12466
|
+
}),
|
|
12467
|
+
((props.ampm === 'auto' && isAmPm(props.locale)) || props.ampm) &&
|
|
12373
12468
|
h$1(CTimePickerRollCol, {
|
|
12374
12469
|
elements: [
|
|
12375
12470
|
{ value: 'am', label: 'AM' },
|
|
@@ -12408,16 +12503,20 @@ const CTimePicker = defineComponent({
|
|
|
12408
12503
|
if (initialDate.value) {
|
|
12409
12504
|
date.value = new Date(initialDate.value);
|
|
12410
12505
|
}
|
|
12506
|
+
visible.value = false;
|
|
12411
12507
|
},
|
|
12412
12508
|
onHide: () => {
|
|
12509
|
+
visible.value = false;
|
|
12413
12510
|
emit('hide');
|
|
12414
12511
|
},
|
|
12415
12512
|
onShow: () => {
|
|
12416
12513
|
if (date.value) {
|
|
12417
12514
|
initialDate.value = new Date(date.value);
|
|
12418
12515
|
}
|
|
12516
|
+
visible.value = true;
|
|
12419
12517
|
emit('show');
|
|
12420
12518
|
},
|
|
12519
|
+
visible: visible.value,
|
|
12421
12520
|
}, {
|
|
12422
12521
|
...(slots.cancelButton && {
|
|
12423
12522
|
cancelButton: () => slots.cancelButton && slots.cancelButton(),
|
|
@@ -12508,6 +12607,15 @@ const CDateRangePicker = defineComponent({
|
|
|
12508
12607
|
type: Boolean,
|
|
12509
12608
|
default: true,
|
|
12510
12609
|
},
|
|
12610
|
+
/**
|
|
12611
|
+
* If true the dropdown will be immediately closed after submitting the full date.
|
|
12612
|
+
*
|
|
12613
|
+
* @since 4.7.0
|
|
12614
|
+
*/
|
|
12615
|
+
closeOnSelect: {
|
|
12616
|
+
type: Boolean,
|
|
12617
|
+
default: true,
|
|
12618
|
+
},
|
|
12511
12619
|
/**
|
|
12512
12620
|
* Toggle visibility or set the content of confirm button.
|
|
12513
12621
|
*/
|
|
@@ -12809,6 +12917,10 @@ const CDateRangePicker = defineComponent({
|
|
|
12809
12917
|
* @since 4.6.0
|
|
12810
12918
|
*/
|
|
12811
12919
|
valid: Boolean,
|
|
12920
|
+
/**
|
|
12921
|
+
* Toggle the visibility of the component.
|
|
12922
|
+
*/
|
|
12923
|
+
visible: Boolean,
|
|
12812
12924
|
/**
|
|
12813
12925
|
* Set length or format of day name.
|
|
12814
12926
|
*
|
|
@@ -12854,8 +12966,23 @@ const CDateRangePicker = defineComponent({
|
|
|
12854
12966
|
* @property {string} formatedDate - formated date
|
|
12855
12967
|
*/
|
|
12856
12968
|
'start-date-change',
|
|
12969
|
+
/**
|
|
12970
|
+
* Callback fired when the start date changed.
|
|
12971
|
+
*
|
|
12972
|
+
* @property {Date | null} date - date object
|
|
12973
|
+
* @since 4.7.0
|
|
12974
|
+
*/
|
|
12975
|
+
'update:start-date',
|
|
12976
|
+
/**
|
|
12977
|
+
* Callback fired when the end date changed.
|
|
12978
|
+
*
|
|
12979
|
+
* @property {Date | null} date - date object
|
|
12980
|
+
* @since 4.7.0
|
|
12981
|
+
*/
|
|
12982
|
+
'update:end-date',
|
|
12857
12983
|
],
|
|
12858
12984
|
setup(props, { slots, attrs, emit }) {
|
|
12985
|
+
const visible = ref(props.visible);
|
|
12859
12986
|
const calendarDate = ref(props.calendarDate
|
|
12860
12987
|
? new Date(props.calendarDate)
|
|
12861
12988
|
: props.startDate
|
|
@@ -12879,11 +13006,13 @@ const CDateRangePicker = defineComponent({
|
|
|
12879
13006
|
watch(() => props.startDate, () => {
|
|
12880
13007
|
if (props.startDate) {
|
|
12881
13008
|
calendarDate.value = new Date(props.startDate);
|
|
13009
|
+
startDate.value = new Date(props.startDate);
|
|
12882
13010
|
}
|
|
12883
13011
|
});
|
|
12884
13012
|
watch(() => props.endDate, () => {
|
|
12885
13013
|
if (props.endDate) {
|
|
12886
13014
|
calendarDate.value = new Date(props.endDate);
|
|
13015
|
+
endDate.value = new Date(props.endDate);
|
|
12887
13016
|
}
|
|
12888
13017
|
});
|
|
12889
13018
|
watch(() => props.maxDate, () => {
|
|
@@ -12930,6 +13059,13 @@ const CDateRangePicker = defineComponent({
|
|
|
12930
13059
|
selectEndDate.value = true;
|
|
12931
13060
|
}
|
|
12932
13061
|
emit('start-date-change', date, date ? formatDate(date) : undefined);
|
|
13062
|
+
emit('update:start-date', date);
|
|
13063
|
+
if (props.timepicker || props.footer) {
|
|
13064
|
+
return;
|
|
13065
|
+
}
|
|
13066
|
+
if (props.closeOnSelect && !props.range) {
|
|
13067
|
+
visible.value = false;
|
|
13068
|
+
}
|
|
12933
13069
|
};
|
|
12934
13070
|
const handleEndDateChange = (date) => {
|
|
12935
13071
|
endDate.value = date;
|
|
@@ -12938,6 +13074,13 @@ const CDateRangePicker = defineComponent({
|
|
|
12938
13074
|
selectEndDate.value = false;
|
|
12939
13075
|
}
|
|
12940
13076
|
emit('end-date-change', date, date ? formatDate(date) : undefined);
|
|
13077
|
+
emit('update:end-date', date);
|
|
13078
|
+
if (props.timepicker || props.footer) {
|
|
13079
|
+
return;
|
|
13080
|
+
}
|
|
13081
|
+
if (props.closeOnSelect && startDate.value !== null) {
|
|
13082
|
+
visible.value = false;
|
|
13083
|
+
}
|
|
12941
13084
|
};
|
|
12942
13085
|
const handleClear = (event) => {
|
|
12943
13086
|
event.stopPropagation();
|
|
@@ -12945,6 +13088,10 @@ const CDateRangePicker = defineComponent({
|
|
|
12945
13088
|
endDate.value = null;
|
|
12946
13089
|
inputStartHoverValue.value = null;
|
|
12947
13090
|
inputEndHoverValue.value = null;
|
|
13091
|
+
emit('start-date-change', null);
|
|
13092
|
+
emit('end-date-change', null);
|
|
13093
|
+
emit('update:start-date', null);
|
|
13094
|
+
emit('update:end-date', null);
|
|
12948
13095
|
};
|
|
12949
13096
|
const InputGroup = () => h$1(CInputGroup, {
|
|
12950
13097
|
class: 'picker-input-group',
|
|
@@ -13050,8 +13197,10 @@ const CDateRangePicker = defineComponent({
|
|
|
13050
13197
|
onCancel: () => {
|
|
13051
13198
|
startDate.value = initialStartDate.value;
|
|
13052
13199
|
endDate.value = initialEndDate.value;
|
|
13200
|
+
visible.value = false;
|
|
13053
13201
|
},
|
|
13054
13202
|
onHide: () => {
|
|
13203
|
+
visible.value = false;
|
|
13055
13204
|
emit('hide');
|
|
13056
13205
|
},
|
|
13057
13206
|
onShow: () => {
|
|
@@ -13061,8 +13210,10 @@ const CDateRangePicker = defineComponent({
|
|
|
13061
13210
|
if (endDate.value) {
|
|
13062
13211
|
initialEndDate.value = new Date(endDate.value);
|
|
13063
13212
|
}
|
|
13213
|
+
visible.value = true;
|
|
13064
13214
|
emit('show');
|
|
13065
13215
|
},
|
|
13216
|
+
visible: visible.value,
|
|
13066
13217
|
}, {
|
|
13067
13218
|
...(slots.cancelButton && {
|
|
13068
13219
|
cancelButton: () => slots.cancelButton && slots.cancelButton(),
|
|
@@ -13451,11 +13602,21 @@ const CDatePicker = defineComponent({
|
|
|
13451
13602
|
* @property {string} formatedDate - formated date
|
|
13452
13603
|
*/
|
|
13453
13604
|
'date-change',
|
|
13605
|
+
/**
|
|
13606
|
+
* Callback fired when the date changed.
|
|
13607
|
+
*
|
|
13608
|
+
* @property {Date | null} date - date object
|
|
13609
|
+
* @since 4.7.0
|
|
13610
|
+
*/
|
|
13611
|
+
'update:date',
|
|
13454
13612
|
],
|
|
13455
13613
|
setup(props, { emit }) {
|
|
13456
13614
|
return () => h$1(CDateRangePicker, {
|
|
13457
13615
|
calendars: 1,
|
|
13458
|
-
onStartDateChange: (date, formatedDate) =>
|
|
13616
|
+
onStartDateChange: (date, formatedDate) => {
|
|
13617
|
+
emit('date-change', date, formatedDate);
|
|
13618
|
+
emit('update:date', date);
|
|
13619
|
+
},
|
|
13459
13620
|
range: false,
|
|
13460
13621
|
startDate: props.date,
|
|
13461
13622
|
...props,
|
|
@@ -14286,11 +14447,10 @@ const CLoadingButton = defineComponent({
|
|
|
14286
14447
|
}
|
|
14287
14448
|
};
|
|
14288
14449
|
return () => h$1(CButton, {
|
|
14450
|
+
...props,
|
|
14289
14451
|
class: ['btn-loading', { ['is-loading']: loading.value }],
|
|
14290
14452
|
...(props.disabledOnLoading && loading.value && { disabled: true }),
|
|
14291
14453
|
onClick: () => handleOnClick(),
|
|
14292
|
-
// TODO: remove non button props
|
|
14293
|
-
...props,
|
|
14294
14454
|
}, {
|
|
14295
14455
|
default: () => [
|
|
14296
14456
|
h$1(CSpinner, { class: 'btn-loading-spinner', size: 'sm', variant: props.spinnerType }),
|
|
@@ -14692,34 +14852,61 @@ const CMultiSelectOptions = defineComponent({
|
|
|
14692
14852
|
default: 'no items',
|
|
14693
14853
|
required: false,
|
|
14694
14854
|
},
|
|
14855
|
+
selected: {
|
|
14856
|
+
type: Array,
|
|
14857
|
+
default: () => [],
|
|
14858
|
+
required: false,
|
|
14859
|
+
},
|
|
14695
14860
|
},
|
|
14696
14861
|
emits: ['optionClick'],
|
|
14697
14862
|
setup(props, { emit }) {
|
|
14863
|
+
const handleKeyDown = (event, option) => {
|
|
14864
|
+
if (event.code === 'Space' || event.key === 'Enter') {
|
|
14865
|
+
event.preventDefault();
|
|
14866
|
+
handleOptionClick && handleOptionClick(option);
|
|
14867
|
+
return;
|
|
14868
|
+
}
|
|
14869
|
+
if (event.key === 'Down' || event.key === 'ArrowDown') {
|
|
14870
|
+
event.preventDefault();
|
|
14871
|
+
const target = event.target;
|
|
14872
|
+
const next = getNextSibling(target, '.form-multi-select-option');
|
|
14873
|
+
if (next) {
|
|
14874
|
+
next.focus(); // eslint-disable-line prettier/prettier
|
|
14875
|
+
}
|
|
14876
|
+
}
|
|
14877
|
+
if (event.key === 'Up' || event.key === 'ArrowUp') {
|
|
14878
|
+
event.preventDefault();
|
|
14879
|
+
const target = event.target;
|
|
14880
|
+
const prev = getPreviousSibling(target, '.form-multi-select-option');
|
|
14881
|
+
if (prev) {
|
|
14882
|
+
prev.focus(); // eslint-disable-line prettier/prettier
|
|
14883
|
+
}
|
|
14884
|
+
}
|
|
14885
|
+
};
|
|
14698
14886
|
const handleOptionClick = (option) => {
|
|
14699
14887
|
emit('optionClick', option);
|
|
14700
14888
|
};
|
|
14701
|
-
|
|
14702
|
-
|
|
14703
|
-
|
|
14704
|
-
|
|
14705
|
-
|
|
14706
|
-
|
|
14707
|
-
|
|
14708
|
-
|
|
14709
|
-
|
|
14710
|
-
|
|
14711
|
-
|
|
14712
|
-
|
|
14713
|
-
|
|
14714
|
-
|
|
14715
|
-
|
|
14716
|
-
|
|
14717
|
-
|
|
14718
|
-
|
|
14719
|
-
|
|
14720
|
-
})
|
|
14721
|
-
|
|
14722
|
-
};
|
|
14889
|
+
// TODO: find solution how to remove any
|
|
14890
|
+
const createOptions = (options) => options.length > 0
|
|
14891
|
+
? options.map((option) => option.options
|
|
14892
|
+
? [
|
|
14893
|
+
h$1('div', { class: 'form-multi-select-optgroup-label' }, option.label),
|
|
14894
|
+
createOptions(option.options),
|
|
14895
|
+
]
|
|
14896
|
+
: h$1('div', {
|
|
14897
|
+
class: [
|
|
14898
|
+
'form-multi-select-option',
|
|
14899
|
+
{
|
|
14900
|
+
'form-multi-select-option-with-checkbox': props.optionsStyle === 'checkbox',
|
|
14901
|
+
'form-multi-selected': props.selected.some((_option) => _option.value === option.value),
|
|
14902
|
+
disabled: option.disabled,
|
|
14903
|
+
},
|
|
14904
|
+
],
|
|
14905
|
+
onClick: () => handleOptionClick(option),
|
|
14906
|
+
onKeydown: (event) => handleKeyDown(event, option),
|
|
14907
|
+
tabindex: 0,
|
|
14908
|
+
}, option.text))
|
|
14909
|
+
: h$1('div', { class: 'form-multi-select-options-empty' }, props.searchNoResultsLabel);
|
|
14723
14910
|
return () => h$1('div', {
|
|
14724
14911
|
class: 'form-multi-select-options',
|
|
14725
14912
|
...(props.optionsMaxHeight !== 'auto' && {
|
|
@@ -14746,7 +14933,7 @@ const CMultiSelectSelection = defineComponent({
|
|
|
14746
14933
|
* Enables search input element.
|
|
14747
14934
|
*/
|
|
14748
14935
|
search: {
|
|
14749
|
-
type: Boolean,
|
|
14936
|
+
type: [Boolean, String],
|
|
14750
14937
|
required: false,
|
|
14751
14938
|
default: false,
|
|
14752
14939
|
},
|
|
@@ -14816,6 +15003,11 @@ const CMultiSelectSelection = defineComponent({
|
|
|
14816
15003
|
},
|
|
14817
15004
|
});
|
|
14818
15005
|
|
|
15006
|
+
const flattenArray = (options) => {
|
|
15007
|
+
return options.reduce((acc, val) => {
|
|
15008
|
+
return acc.concat(Array.isArray(val.options) ? flattenArray(val.options) : val);
|
|
15009
|
+
}, []);
|
|
15010
|
+
};
|
|
14819
15011
|
const CMultiSelect = defineComponent({
|
|
14820
15012
|
name: 'CMultiSelect',
|
|
14821
15013
|
props: {
|
|
@@ -14937,9 +15129,18 @@ const CMultiSelect = defineComponent({
|
|
|
14937
15129
|
* Enables search input element.
|
|
14938
15130
|
*/
|
|
14939
15131
|
search: {
|
|
14940
|
-
type: Boolean,
|
|
15132
|
+
type: [Boolean, String],
|
|
14941
15133
|
default: true,
|
|
14942
15134
|
required: false,
|
|
15135
|
+
validator: (value) => {
|
|
15136
|
+
if (typeof value == 'string') {
|
|
15137
|
+
return ['external'].includes(value);
|
|
15138
|
+
}
|
|
15139
|
+
if (typeof value == 'boolean') {
|
|
15140
|
+
return true;
|
|
15141
|
+
}
|
|
15142
|
+
return false;
|
|
15143
|
+
},
|
|
14943
15144
|
},
|
|
14944
15145
|
/**
|
|
14945
15146
|
* Sets the label for no results when filtering.
|
|
@@ -15041,59 +15242,63 @@ const CMultiSelect = defineComponent({
|
|
|
15041
15242
|
* Execute a function when a user changes the selected option. [docs]
|
|
15042
15243
|
*/
|
|
15043
15244
|
'change',
|
|
15245
|
+
/**
|
|
15246
|
+
* Execute a function when the filter value changed.
|
|
15247
|
+
*
|
|
15248
|
+
* @since 4.7.0
|
|
15249
|
+
*/
|
|
15250
|
+
'filterChange',
|
|
15044
15251
|
],
|
|
15045
15252
|
setup(props, { attrs, emit }) {
|
|
15046
|
-
const
|
|
15047
|
-
|
|
15048
|
-
|
|
15049
|
-
|
|
15050
|
-
|
|
15051
|
-
const
|
|
15052
|
-
|
|
15053
|
-
|
|
15054
|
-
|
|
15055
|
-
|
|
15056
|
-
|
|
15057
|
-
}
|
|
15058
|
-
|
|
15059
|
-
|
|
15060
|
-
|
|
15061
|
-
|
|
15062
|
-
|
|
15063
|
-
|
|
15064
|
-
return option.options
|
|
15065
|
-
? { ...option, options: updateOptions(value, option.options) }
|
|
15066
|
-
: option.value == value // TODO: find solution
|
|
15067
|
-
? { ...option, selected: !option.selected, order: count.value }
|
|
15068
|
-
: { ...option };
|
|
15069
|
-
})
|
|
15070
|
-
: _options &&
|
|
15071
|
-
_options.map((option) => {
|
|
15072
|
-
return option.options
|
|
15073
|
-
? { ...option, options: updateOptions(value, option.options) }
|
|
15074
|
-
: option.value == value // TODO: find solution
|
|
15075
|
-
? { ...option, selected: true }
|
|
15076
|
-
: { ...option, selected: false };
|
|
15253
|
+
const nativeSelectRef = ref();
|
|
15254
|
+
provide('nativeSelectRef', nativeSelectRef);
|
|
15255
|
+
const searchRef = ref();
|
|
15256
|
+
const options = ref(props.options);
|
|
15257
|
+
const search = ref('');
|
|
15258
|
+
const selected = ref([]);
|
|
15259
|
+
const visible = ref(props.visible);
|
|
15260
|
+
const selectOptions = (options, deselected) => {
|
|
15261
|
+
let _selected = [...selected.value, ...options];
|
|
15262
|
+
if (deselected) {
|
|
15263
|
+
_selected = _selected.filter((selectedOption) => !deselected.some((deselectedOption) => deselectedOption.value === selectedOption.value));
|
|
15264
|
+
}
|
|
15265
|
+
const deduplicated = _selected.reduce((unique, option) => {
|
|
15266
|
+
if (!unique.some((obj) => obj.value === option.value)) {
|
|
15267
|
+
unique.push({
|
|
15268
|
+
value: option.value,
|
|
15269
|
+
text: option.text,
|
|
15270
|
+
...(option.disabled && { disabled: option.disabled }),
|
|
15077
15271
|
});
|
|
15078
|
-
};
|
|
15079
|
-
const toggleAllOptions = (options, selected, counter = count.value) => {
|
|
15080
|
-
return options.map((option) => {
|
|
15081
|
-
!option.selected && counter++;
|
|
15082
|
-
count.value = counter;
|
|
15083
|
-
if (option.options) {
|
|
15084
|
-
return {
|
|
15085
|
-
...option,
|
|
15086
|
-
options: toggleAllOptions(option.options, selected, counter),
|
|
15087
|
-
};
|
|
15088
15272
|
}
|
|
15089
|
-
return
|
|
15090
|
-
|
|
15091
|
-
|
|
15092
|
-
? { ...option, selected: selected, order: counter }
|
|
15093
|
-
: { ...option, selected: selected };
|
|
15094
|
-
});
|
|
15273
|
+
return unique;
|
|
15274
|
+
}, []);
|
|
15275
|
+
selected.value = deduplicated;
|
|
15095
15276
|
};
|
|
15096
|
-
|
|
15277
|
+
watch(() => props.options, (newValue, oldValue) => {
|
|
15278
|
+
if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) {
|
|
15279
|
+
options.value = newValue;
|
|
15280
|
+
const _selected = newValue &&
|
|
15281
|
+
flattenArray(newValue).filter((option) => {
|
|
15282
|
+
if (option.selected) {
|
|
15283
|
+
return option;
|
|
15284
|
+
}
|
|
15285
|
+
return;
|
|
15286
|
+
});
|
|
15287
|
+
const deselected = newValue &&
|
|
15288
|
+
flattenArray(newValue).filter((option) => {
|
|
15289
|
+
if (option.selected === false) {
|
|
15290
|
+
return option;
|
|
15291
|
+
}
|
|
15292
|
+
return;
|
|
15293
|
+
});
|
|
15294
|
+
_selected && selectOptions(_selected, deselected);
|
|
15295
|
+
}
|
|
15296
|
+
});
|
|
15297
|
+
watch(selected, () => {
|
|
15298
|
+
nativeSelectRef.value &&
|
|
15299
|
+
nativeSelectRef.value.dispatchEvent(new Event('change', { bubbles: true }));
|
|
15300
|
+
});
|
|
15301
|
+
const filterOptionsList = (search, _options) => {
|
|
15097
15302
|
return search.length
|
|
15098
15303
|
? _options &&
|
|
15099
15304
|
_options.reduce((acc, val) => {
|
|
@@ -15107,70 +15312,54 @@ const CMultiSelect = defineComponent({
|
|
|
15107
15312
|
}, [])
|
|
15108
15313
|
: options.value;
|
|
15109
15314
|
};
|
|
15110
|
-
|
|
15111
|
-
|
|
15112
|
-
|
|
15113
|
-
|
|
15114
|
-
|
|
15115
|
-
|
|
15116
|
-
|
|
15117
|
-
const selected = ref(getSelectedOptions(props.options));
|
|
15118
|
-
const count = ref(0);
|
|
15119
|
-
watch(() => props.options, (newValue, oldValue) => {
|
|
15120
|
-
if (JSON.stringify(newValue) !== JSON.stringify(oldValue))
|
|
15121
|
-
options.value = newValue;
|
|
15122
|
-
});
|
|
15123
|
-
watch(options, () => {
|
|
15124
|
-
const _selected = options.value && getSelectedOptions(options.value);
|
|
15125
|
-
_selected.sort((a, b) => {
|
|
15126
|
-
if (typeof a.order === 'undefined') {
|
|
15127
|
-
return -1;
|
|
15128
|
-
}
|
|
15129
|
-
if (b.order && a.order > b.order)
|
|
15130
|
-
return 1;
|
|
15131
|
-
if (b.order && a.order < b.order)
|
|
15132
|
-
return -1;
|
|
15133
|
-
return 0;
|
|
15134
|
-
});
|
|
15135
|
-
selected.value = _selected;
|
|
15136
|
-
});
|
|
15137
|
-
watch([options, search], () => {
|
|
15138
|
-
vOptions.value = filterOptionsList(search.value, options.value);
|
|
15139
|
-
});
|
|
15140
|
-
watch(selected, () => {
|
|
15141
|
-
nativeSelectRef.value &&
|
|
15142
|
-
nativeSelectRef.value.dispatchEvent(new Event('change', { bubbles: true }));
|
|
15143
|
-
});
|
|
15315
|
+
// watch(
|
|
15316
|
+
// () => props.options,
|
|
15317
|
+
// (newValue, oldValue) => {
|
|
15318
|
+
// console.log(props.options)
|
|
15319
|
+
// if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) options.value = newValue
|
|
15320
|
+
// },
|
|
15321
|
+
// )
|
|
15144
15322
|
const handleSearchChange = (event) => {
|
|
15145
15323
|
const target = event.target;
|
|
15146
15324
|
search.value = target.value.toLowerCase();
|
|
15325
|
+
emit('filterChange', target.value);
|
|
15147
15326
|
};
|
|
15148
15327
|
const handleSearchKeyDown = (event) => {
|
|
15149
|
-
if (search.value.length)
|
|
15328
|
+
if (search.value.length) {
|
|
15150
15329
|
return;
|
|
15330
|
+
}
|
|
15151
15331
|
if (event.key === 'Backspace' || event.key === 'Delete') {
|
|
15152
15332
|
const last = selected.value.filter((option) => !option.disabled).pop();
|
|
15153
15333
|
if (last) {
|
|
15154
15334
|
selected.value = selected.value.filter((option) => option.value !== last.value);
|
|
15155
|
-
options.value = updateOptions(last.value);
|
|
15156
15335
|
}
|
|
15157
15336
|
}
|
|
15158
15337
|
};
|
|
15159
15338
|
const handleOptionClick = (option) => {
|
|
15160
|
-
options.value = updateOptions(option.value);
|
|
15161
15339
|
if (!props.multiple) {
|
|
15340
|
+
selected.value = [{ value: option.value, text: option.text }];
|
|
15162
15341
|
visible.value = false;
|
|
15163
15342
|
search.value = '';
|
|
15164
15343
|
if (searchRef.value) {
|
|
15165
15344
|
searchRef.value.value = '';
|
|
15166
15345
|
}
|
|
15346
|
+
return;
|
|
15347
|
+
}
|
|
15348
|
+
if (selected.value.some((_option) => _option.value === option.value)) {
|
|
15349
|
+
selected.value = selected.value.filter((_option) => _option.value !== option.value);
|
|
15350
|
+
}
|
|
15351
|
+
else {
|
|
15352
|
+
selected.value = [
|
|
15353
|
+
...selected.value,
|
|
15354
|
+
{ value: option.value, text: option.text },
|
|
15355
|
+
];
|
|
15167
15356
|
}
|
|
15168
15357
|
};
|
|
15169
15358
|
const handleSelectAll = () => {
|
|
15170
|
-
options.value
|
|
15359
|
+
selectOptions(flattenArray(options.value).filter((option) => !option.disabled));
|
|
15171
15360
|
};
|
|
15172
15361
|
const handleDeselectAll = () => {
|
|
15173
|
-
|
|
15362
|
+
selected.value = selected.value.filter((option) => option.disabled);
|
|
15174
15363
|
};
|
|
15175
15364
|
return () => [
|
|
15176
15365
|
h$1(CMultiSelectNativeSelect, {
|
|
@@ -15261,13 +15450,20 @@ const CMultiSelect = defineComponent({
|
|
|
15261
15450
|
default: () => h$1('div', {}, [
|
|
15262
15451
|
props.multiple &&
|
|
15263
15452
|
props.selectAll &&
|
|
15264
|
-
h$1('button', {
|
|
15453
|
+
h$1('button', {
|
|
15454
|
+
class: 'form-multi-select-all',
|
|
15455
|
+
onClick: () => handleSelectAll(),
|
|
15456
|
+
type: 'button',
|
|
15457
|
+
}, props.selectAllLabel),
|
|
15265
15458
|
h$1(CMultiSelectOptions, {
|
|
15266
15459
|
onOptionClick: (option) => handleOptionClick(option),
|
|
15267
|
-
options:
|
|
15460
|
+
options: props.search === 'external'
|
|
15461
|
+
? options.value
|
|
15462
|
+
: filterOptionsList(search.value, options.value),
|
|
15268
15463
|
optionsMaxHeight: props.optionsMaxHeight,
|
|
15269
15464
|
optionsStyle: props.optionsStyle,
|
|
15270
15465
|
searchNoResultsLabel: props.searchNoResultsLabel,
|
|
15466
|
+
selected: selected.value
|
|
15271
15467
|
}),
|
|
15272
15468
|
]),
|
|
15273
15469
|
}),
|
|
@@ -15987,354 +16183,63 @@ const CPaginationItem = defineComponent({
|
|
|
15987
16183
|
},
|
|
15988
16184
|
});
|
|
15989
16185
|
|
|
15990
|
-
const
|
|
15991
|
-
|
|
16186
|
+
const CPaginationPlugin = {
|
|
16187
|
+
install: (app) => {
|
|
16188
|
+
app.component(CPagination.name, CPagination);
|
|
16189
|
+
app.component(CPaginationItem.name, CPaginationItem);
|
|
16190
|
+
},
|
|
16191
|
+
};
|
|
16192
|
+
|
|
16193
|
+
const BREAKPOINTS$1 = [
|
|
16194
|
+
'xxl',
|
|
16195
|
+
'xl',
|
|
16196
|
+
'lg',
|
|
16197
|
+
'md',
|
|
16198
|
+
'sm',
|
|
16199
|
+
'xs',
|
|
16200
|
+
];
|
|
16201
|
+
const CPlaceholder = defineComponent({
|
|
16202
|
+
name: 'CPlaceholder',
|
|
15992
16203
|
props: {
|
|
15993
16204
|
/**
|
|
15994
|
-
*
|
|
16205
|
+
* Set animation type to better convey the perception of something being actively loaded.
|
|
15995
16206
|
*
|
|
15996
|
-
* @
|
|
16207
|
+
* @values 'glow', 'wave'
|
|
15997
16208
|
*/
|
|
15998
|
-
|
|
16209
|
+
animation: {
|
|
15999
16210
|
type: String,
|
|
16000
|
-
default:
|
|
16211
|
+
default: undefined,
|
|
16001
16212
|
require: false,
|
|
16002
16213
|
validator: (value) => {
|
|
16003
|
-
return ['
|
|
16214
|
+
return ['glow', 'wave'].includes(value);
|
|
16004
16215
|
},
|
|
16005
16216
|
},
|
|
16006
16217
|
/**
|
|
16007
|
-
*
|
|
16218
|
+
* Sets the color context of the component to one of CoreUI’s themed colors.
|
|
16008
16219
|
*
|
|
16009
|
-
* @
|
|
16220
|
+
* @values 'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark', 'light'
|
|
16010
16221
|
*/
|
|
16011
|
-
|
|
16012
|
-
type: Number,
|
|
16013
|
-
default: 1,
|
|
16014
|
-
require: false,
|
|
16015
|
-
},
|
|
16222
|
+
color: Color,
|
|
16016
16223
|
/**
|
|
16017
|
-
*
|
|
16018
|
-
*
|
|
16019
|
-
* @default true
|
|
16224
|
+
* Component used for the root node. Either a string to use a HTML element or a component.
|
|
16020
16225
|
*/
|
|
16021
|
-
|
|
16022
|
-
type:
|
|
16023
|
-
default:
|
|
16024
|
-
|
|
16226
|
+
component: {
|
|
16227
|
+
type: String,
|
|
16228
|
+
default: 'span',
|
|
16229
|
+
required: false,
|
|
16025
16230
|
},
|
|
16026
16231
|
/**
|
|
16027
|
-
*
|
|
16232
|
+
* Size the component extra small, small, or large.
|
|
16028
16233
|
*
|
|
16029
|
-
* @
|
|
16234
|
+
* @values 'xs', 'sm', 'lg'
|
|
16030
16235
|
*/
|
|
16031
|
-
|
|
16032
|
-
type:
|
|
16033
|
-
default:
|
|
16034
|
-
|
|
16035
|
-
|
|
16036
|
-
|
|
16037
|
-
|
|
16038
|
-
*
|
|
16039
|
-
* @default true
|
|
16040
|
-
*/
|
|
16041
|
-
doubleArrows: {
|
|
16042
|
-
type: Boolean,
|
|
16043
|
-
default: true,
|
|
16044
|
-
require: false,
|
|
16045
|
-
},
|
|
16046
|
-
/**
|
|
16047
|
-
* The content of 'firstButton' button
|
|
16048
|
-
*
|
|
16049
|
-
* @default '«'
|
|
16050
|
-
*/
|
|
16051
|
-
firstButton: {
|
|
16052
|
-
type: String,
|
|
16053
|
-
default: '«',
|
|
16054
|
-
require: false,
|
|
16055
|
-
},
|
|
16056
|
-
/**
|
|
16057
|
-
* The content of 'lastButton' button
|
|
16058
|
-
*
|
|
16059
|
-
* @default '»'
|
|
16060
|
-
*/
|
|
16061
|
-
lastButton: {
|
|
16062
|
-
type: String,
|
|
16063
|
-
default: '»',
|
|
16064
|
-
require: false,
|
|
16065
|
-
},
|
|
16066
|
-
/**
|
|
16067
|
-
* Maximum items number
|
|
16068
|
-
*
|
|
16069
|
-
* @default 5
|
|
16070
|
-
*/
|
|
16071
|
-
limit: {
|
|
16072
|
-
type: Number,
|
|
16073
|
-
default: 5,
|
|
16074
|
-
require: false,
|
|
16075
|
-
},
|
|
16076
|
-
/**
|
|
16077
|
-
* The content of 'nextButton' button
|
|
16078
|
-
*
|
|
16079
|
-
* @default '›'
|
|
16080
|
-
*/
|
|
16081
|
-
nextButton: {
|
|
16082
|
-
type: String,
|
|
16083
|
-
default: '›',
|
|
16084
|
-
require: false,
|
|
16085
|
-
},
|
|
16086
|
-
/**
|
|
16087
|
-
* Number of pages
|
|
16088
|
-
*/
|
|
16089
|
-
pages: {
|
|
16090
|
-
type: Number,
|
|
16091
|
-
default: 1000,
|
|
16092
|
-
require: true,
|
|
16093
|
-
},
|
|
16094
|
-
/**
|
|
16095
|
-
* The content of 'previousButton' button
|
|
16096
|
-
*
|
|
16097
|
-
* @default '‹'
|
|
16098
|
-
*/
|
|
16099
|
-
previousButton: {
|
|
16100
|
-
type: String,
|
|
16101
|
-
default: '‹',
|
|
16102
|
-
require: false,
|
|
16103
|
-
},
|
|
16104
|
-
/**
|
|
16105
|
-
* Size of pagination, valid values: 'sm', 'lg'
|
|
16106
|
-
*/
|
|
16107
|
-
size: {
|
|
16108
|
-
type: String,
|
|
16109
|
-
default: undefined,
|
|
16110
|
-
required: false,
|
|
16111
|
-
validator: (value) => {
|
|
16112
|
-
return ['sm', 'lg'].includes(value);
|
|
16113
|
-
},
|
|
16114
|
-
},
|
|
16115
|
-
},
|
|
16116
|
-
emits: [
|
|
16117
|
-
/**
|
|
16118
|
-
* On active page change callback.
|
|
16119
|
-
*/
|
|
16120
|
-
'activePageChange',
|
|
16121
|
-
],
|
|
16122
|
-
setup(props, { emit }) {
|
|
16123
|
-
const activePage = ref(props.activePage);
|
|
16124
|
-
const limit = ref(props.limit);
|
|
16125
|
-
const pages = ref(props.pages);
|
|
16126
|
-
watch(props, () => {
|
|
16127
|
-
activePage.value = props.activePage;
|
|
16128
|
-
limit.value = props.limit;
|
|
16129
|
-
pages.value = props.pages;
|
|
16130
|
-
});
|
|
16131
|
-
const showDots = computed(() => {
|
|
16132
|
-
return props.dots && limit.value > 4 && limit.value < pages.value;
|
|
16133
|
-
});
|
|
16134
|
-
const maxPrevItems = computed(() => {
|
|
16135
|
-
return Math.floor((limit.value - 1) / 2);
|
|
16136
|
-
});
|
|
16137
|
-
const maxNextItems = computed(() => {
|
|
16138
|
-
return Math.ceil((limit.value - 1) / 2);
|
|
16139
|
-
});
|
|
16140
|
-
const beforeDots = computed(() => {
|
|
16141
|
-
return showDots.value && activePage.value > maxPrevItems.value + 1;
|
|
16142
|
-
});
|
|
16143
|
-
const afterDots = computed(() => {
|
|
16144
|
-
return showDots.value && activePage.value < pages.value - maxNextItems.value;
|
|
16145
|
-
});
|
|
16146
|
-
const computedLimit = computed(() => {
|
|
16147
|
-
return limit.value - (afterDots.value ? 1 : 0) - (beforeDots.value ? 1 : 0);
|
|
16148
|
-
});
|
|
16149
|
-
const range = computed(() => {
|
|
16150
|
-
return activePage.value + maxNextItems.value;
|
|
16151
|
-
});
|
|
16152
|
-
const lastItem = computed(() => {
|
|
16153
|
-
return range.value >= pages.value ? pages.value : range.value - (afterDots.value ? 1 : 0);
|
|
16154
|
-
});
|
|
16155
|
-
const itemsAmount = computed(() => {
|
|
16156
|
-
return pages.value < computedLimit.value ? pages.value : computedLimit.value;
|
|
16157
|
-
});
|
|
16158
|
-
const items = computed(() => {
|
|
16159
|
-
if (activePage.value - maxPrevItems.value <= 1) {
|
|
16160
|
-
return Array.from({
|
|
16161
|
-
length: itemsAmount.value,
|
|
16162
|
-
}, (_v, i) => i + 1);
|
|
16163
|
-
}
|
|
16164
|
-
else {
|
|
16165
|
-
return Array.from({
|
|
16166
|
-
length: itemsAmount.value,
|
|
16167
|
-
}, (_v, i) => {
|
|
16168
|
-
return lastItem.value - i;
|
|
16169
|
-
}).reverse();
|
|
16170
|
-
}
|
|
16171
|
-
});
|
|
16172
|
-
const setPage = (number) => {
|
|
16173
|
-
if (number !== activePage.value) {
|
|
16174
|
-
activePage.value = number;
|
|
16175
|
-
emit('activePageChange', number);
|
|
16176
|
-
}
|
|
16177
|
-
};
|
|
16178
|
-
return () => h$1(CPagination, {
|
|
16179
|
-
align: props.align,
|
|
16180
|
-
'aria-label': 'pagination',
|
|
16181
|
-
size: props.size,
|
|
16182
|
-
}, {
|
|
16183
|
-
default: () => [
|
|
16184
|
-
props.doubleArrows &&
|
|
16185
|
-
h$1(CPaginationItem, {
|
|
16186
|
-
onClick: () => {
|
|
16187
|
-
activePage.value !== 1 && setPage(1);
|
|
16188
|
-
},
|
|
16189
|
-
'aria-label': 'Go to first page',
|
|
16190
|
-
...(activePage.value === 1 && {
|
|
16191
|
-
'aria-disabled': true,
|
|
16192
|
-
disabled: true,
|
|
16193
|
-
}),
|
|
16194
|
-
}, {
|
|
16195
|
-
default: () => typeof props.firstButton === 'string'
|
|
16196
|
-
? h$1('span', {
|
|
16197
|
-
innerHTML: props.firstButton,
|
|
16198
|
-
})
|
|
16199
|
-
: props.firstButton,
|
|
16200
|
-
}),
|
|
16201
|
-
props.arrows &&
|
|
16202
|
-
h$1(CPaginationItem, {
|
|
16203
|
-
onClick: () => {
|
|
16204
|
-
activePage.value !== 1 && setPage(activePage.value - 1);
|
|
16205
|
-
},
|
|
16206
|
-
'aria-label': 'Go to previous page',
|
|
16207
|
-
...(activePage.value === 1 && {
|
|
16208
|
-
'aria-disabled': true,
|
|
16209
|
-
disabled: true,
|
|
16210
|
-
}),
|
|
16211
|
-
}, {
|
|
16212
|
-
default: () => typeof props.previousButton === 'string'
|
|
16213
|
-
? h$1('span', {
|
|
16214
|
-
innerHTML: props.previousButton,
|
|
16215
|
-
})
|
|
16216
|
-
: props.previousButton,
|
|
16217
|
-
}),
|
|
16218
|
-
beforeDots.value &&
|
|
16219
|
-
h$1(CPaginationItem, {
|
|
16220
|
-
role: 'separator',
|
|
16221
|
-
disabled: true,
|
|
16222
|
-
}, {
|
|
16223
|
-
default: () => '...',
|
|
16224
|
-
}),
|
|
16225
|
-
items.value.map((i) => {
|
|
16226
|
-
return h$1(CPaginationItem, {
|
|
16227
|
-
onClick: () => setPage(i),
|
|
16228
|
-
'aria-label': activePage.value === i ? `Current page ${i}` : `Go to page ${i}`,
|
|
16229
|
-
active: activePage.value === i,
|
|
16230
|
-
}, {
|
|
16231
|
-
default: () => i,
|
|
16232
|
-
});
|
|
16233
|
-
}),
|
|
16234
|
-
afterDots.value &&
|
|
16235
|
-
h$1(CPaginationItem, {
|
|
16236
|
-
role: 'separator',
|
|
16237
|
-
disabled: true,
|
|
16238
|
-
}, {
|
|
16239
|
-
default: () => '...',
|
|
16240
|
-
}),
|
|
16241
|
-
props.arrows &&
|
|
16242
|
-
h$1(CPaginationItem, {
|
|
16243
|
-
onClick: () => {
|
|
16244
|
-
activePage.value !== pages.value && setPage(activePage.value + 1);
|
|
16245
|
-
},
|
|
16246
|
-
'aria-label': 'Go to next page',
|
|
16247
|
-
...(activePage.value === pages.value && {
|
|
16248
|
-
'aria-disabled': true,
|
|
16249
|
-
disabled: true,
|
|
16250
|
-
}),
|
|
16251
|
-
}, {
|
|
16252
|
-
default: () => typeof props.nextButton === 'string'
|
|
16253
|
-
? h$1('span', {
|
|
16254
|
-
innerHTML: props.nextButton,
|
|
16255
|
-
})
|
|
16256
|
-
: props.nextButton,
|
|
16257
|
-
}),
|
|
16258
|
-
props.doubleArrows &&
|
|
16259
|
-
h$1(CPaginationItem, {
|
|
16260
|
-
onClick: () => {
|
|
16261
|
-
activePage.value !== pages.value && setPage(pages.value);
|
|
16262
|
-
},
|
|
16263
|
-
'aria-label': 'Go to last page',
|
|
16264
|
-
...(activePage.value === pages.value && {
|
|
16265
|
-
'aria-disabled': true,
|
|
16266
|
-
disabled: true,
|
|
16267
|
-
}),
|
|
16268
|
-
}, {
|
|
16269
|
-
default: () => typeof props.lastButton === 'string'
|
|
16270
|
-
? h$1('span', {
|
|
16271
|
-
innerHTML: props.lastButton,
|
|
16272
|
-
})
|
|
16273
|
-
: props.lastButton,
|
|
16274
|
-
}),
|
|
16275
|
-
],
|
|
16276
|
-
});
|
|
16277
|
-
},
|
|
16278
|
-
});
|
|
16279
|
-
|
|
16280
|
-
const CPaginationPlugin = {
|
|
16281
|
-
install: (app) => {
|
|
16282
|
-
app.component(CPagination.name, CPagination);
|
|
16283
|
-
app.component(CPaginationItem.name, CPaginationItem);
|
|
16284
|
-
app.component(CSmartPagination.name, CSmartPagination);
|
|
16285
|
-
},
|
|
16286
|
-
};
|
|
16287
|
-
|
|
16288
|
-
const BREAKPOINTS$1 = [
|
|
16289
|
-
'xxl',
|
|
16290
|
-
'xl',
|
|
16291
|
-
'lg',
|
|
16292
|
-
'md',
|
|
16293
|
-
'sm',
|
|
16294
|
-
'xs',
|
|
16295
|
-
];
|
|
16296
|
-
const CPlaceholder = defineComponent({
|
|
16297
|
-
name: 'CPlaceholder',
|
|
16298
|
-
props: {
|
|
16299
|
-
/**
|
|
16300
|
-
* Set animation type to better convey the perception of something being actively loaded.
|
|
16301
|
-
*
|
|
16302
|
-
* @values 'glow', 'wave'
|
|
16303
|
-
*/
|
|
16304
|
-
animation: {
|
|
16305
|
-
type: String,
|
|
16306
|
-
default: undefined,
|
|
16307
|
-
require: false,
|
|
16308
|
-
validator: (value) => {
|
|
16309
|
-
return ['glow', 'wave'].includes(value);
|
|
16310
|
-
},
|
|
16311
|
-
},
|
|
16312
|
-
/**
|
|
16313
|
-
* Sets the color context of the component to one of CoreUI’s themed colors.
|
|
16314
|
-
*
|
|
16315
|
-
* @values 'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark', 'light'
|
|
16316
|
-
*/
|
|
16317
|
-
color: Color,
|
|
16318
|
-
/**
|
|
16319
|
-
* Component used for the root node. Either a string to use a HTML element or a component.
|
|
16320
|
-
*/
|
|
16321
|
-
component: {
|
|
16322
|
-
type: String,
|
|
16323
|
-
default: 'span',
|
|
16324
|
-
required: false,
|
|
16325
|
-
},
|
|
16326
|
-
/**
|
|
16327
|
-
* Size the component extra small, small, or large.
|
|
16328
|
-
*
|
|
16329
|
-
* @values 'xs', 'sm', 'lg'
|
|
16330
|
-
*/
|
|
16331
|
-
size: {
|
|
16332
|
-
type: String,
|
|
16333
|
-
default: undefined,
|
|
16334
|
-
required: false,
|
|
16335
|
-
validator: (value) => {
|
|
16336
|
-
return ['xs', 'sm', 'lg'].includes(value);
|
|
16337
|
-
},
|
|
16236
|
+
size: {
|
|
16237
|
+
type: String,
|
|
16238
|
+
default: undefined,
|
|
16239
|
+
required: false,
|
|
16240
|
+
validator: (value) => {
|
|
16241
|
+
return ['xs', 'sm', 'lg'].includes(value);
|
|
16242
|
+
},
|
|
16338
16243
|
},
|
|
16339
16244
|
/**
|
|
16340
16245
|
* The number of columns on extra small devices (<576px).
|
|
@@ -16674,259 +16579,548 @@ const CPopover = defineComponent({
|
|
|
16674
16579
|
},
|
|
16675
16580
|
});
|
|
16676
16581
|
|
|
16677
|
-
const CPopoverPlugin = {
|
|
16582
|
+
const CPopoverPlugin = {
|
|
16583
|
+
install: (app) => {
|
|
16584
|
+
app.component(CPopover.name, CPopover);
|
|
16585
|
+
},
|
|
16586
|
+
};
|
|
16587
|
+
|
|
16588
|
+
const isOnMobile = (element) => Boolean(getComputedStyle(element).getPropertyValue('--cui-is-mobile'));
|
|
16589
|
+
const CSidebar = defineComponent({
|
|
16590
|
+
name: 'CSidebar',
|
|
16591
|
+
props: {
|
|
16592
|
+
/**
|
|
16593
|
+
* Sets if the color of text should be colored for a light or dark dark background.
|
|
16594
|
+
*
|
|
16595
|
+
* @values 'dark', light'
|
|
16596
|
+
*/
|
|
16597
|
+
colorScheme: {
|
|
16598
|
+
type: String,
|
|
16599
|
+
default: undefined,
|
|
16600
|
+
validator: (value) => {
|
|
16601
|
+
return ['dark', 'light'].includes(value);
|
|
16602
|
+
},
|
|
16603
|
+
},
|
|
16604
|
+
/**
|
|
16605
|
+
* Make sidebar narrow.
|
|
16606
|
+
*/
|
|
16607
|
+
narrow: {
|
|
16608
|
+
type: Boolean,
|
|
16609
|
+
required: false,
|
|
16610
|
+
},
|
|
16611
|
+
/**
|
|
16612
|
+
* Set sidebar to overlaid variant.
|
|
16613
|
+
*/
|
|
16614
|
+
overlaid: {
|
|
16615
|
+
type: Boolean,
|
|
16616
|
+
required: false,
|
|
16617
|
+
},
|
|
16618
|
+
/**
|
|
16619
|
+
* Components placement, there’s no default placement.
|
|
16620
|
+
* @values 'start', 'end'
|
|
16621
|
+
*/
|
|
16622
|
+
placement: {
|
|
16623
|
+
type: String,
|
|
16624
|
+
default: undefined,
|
|
16625
|
+
validator: (value) => {
|
|
16626
|
+
return ['start', 'end'].includes(value);
|
|
16627
|
+
},
|
|
16628
|
+
},
|
|
16629
|
+
/**
|
|
16630
|
+
* Place sidebar in non-static positions.
|
|
16631
|
+
*/
|
|
16632
|
+
position: {
|
|
16633
|
+
type: String,
|
|
16634
|
+
default: undefined,
|
|
16635
|
+
validator: (value) => {
|
|
16636
|
+
return ['fixed'].includes(value);
|
|
16637
|
+
},
|
|
16638
|
+
},
|
|
16639
|
+
/**
|
|
16640
|
+
* Size the component small, large, or extra large.
|
|
16641
|
+
*/
|
|
16642
|
+
size: {
|
|
16643
|
+
type: String,
|
|
16644
|
+
default: undefined,
|
|
16645
|
+
validator: (value) => {
|
|
16646
|
+
return ['sm', 'lg', 'xl'].includes(value);
|
|
16647
|
+
},
|
|
16648
|
+
},
|
|
16649
|
+
/**
|
|
16650
|
+
* Expand narrowed sidebar on hover.
|
|
16651
|
+
*/
|
|
16652
|
+
unfoldable: Boolean,
|
|
16653
|
+
/**
|
|
16654
|
+
* Toggle the visibility of sidebar component.
|
|
16655
|
+
*/
|
|
16656
|
+
visible: Boolean,
|
|
16657
|
+
},
|
|
16658
|
+
emits: [
|
|
16659
|
+
/**
|
|
16660
|
+
* Callback fired when the component requests to be hidden.
|
|
16661
|
+
*/
|
|
16662
|
+
'hide',
|
|
16663
|
+
/**
|
|
16664
|
+
* Callback fired when the component requests to be shown.
|
|
16665
|
+
*/
|
|
16666
|
+
'show',
|
|
16667
|
+
/**
|
|
16668
|
+
* Event emitted after visibility of component changed.
|
|
16669
|
+
*/
|
|
16670
|
+
'visible-change',
|
|
16671
|
+
],
|
|
16672
|
+
setup(props, { attrs, slots, emit }) {
|
|
16673
|
+
const mobile = ref();
|
|
16674
|
+
const inViewport = ref();
|
|
16675
|
+
const sidebarRef = ref();
|
|
16676
|
+
const visible = ref(props.visible);
|
|
16677
|
+
watch(inViewport, () => {
|
|
16678
|
+
emit('visible-change', inViewport.value);
|
|
16679
|
+
inViewport.value ? emit('show') : emit('hide');
|
|
16680
|
+
});
|
|
16681
|
+
watch(() => props.visible, () => (visible.value = props.visible));
|
|
16682
|
+
watch(mobile, () => {
|
|
16683
|
+
if (mobile.value && visible.value)
|
|
16684
|
+
visible.value = false;
|
|
16685
|
+
});
|
|
16686
|
+
onMounted(() => {
|
|
16687
|
+
mobile.value = isOnMobile(sidebarRef.value);
|
|
16688
|
+
inViewport.value = isVisible(sidebarRef.value);
|
|
16689
|
+
window.addEventListener('resize', () => handleResize());
|
|
16690
|
+
window.addEventListener('mouseup', handleClickOutside);
|
|
16691
|
+
window.addEventListener('keyup', handleKeyup);
|
|
16692
|
+
sidebarRef.value.addEventListener('mouseup', handleOnClick);
|
|
16693
|
+
sidebarRef.value.addEventListener('transitionend', () => {
|
|
16694
|
+
inViewport.value = isVisible(sidebarRef.value);
|
|
16695
|
+
});
|
|
16696
|
+
});
|
|
16697
|
+
onBeforeUnmount(() => {
|
|
16698
|
+
window.removeEventListener('resize', () => handleResize());
|
|
16699
|
+
window.removeEventListener('mouseup', handleClickOutside);
|
|
16700
|
+
window.removeEventListener('keyup', handleKeyup);
|
|
16701
|
+
sidebarRef.value.removeEventListener('mouseup', handleOnClick);
|
|
16702
|
+
sidebarRef.value.removeEventListener('transitionend', () => {
|
|
16703
|
+
inViewport.value = isVisible(sidebarRef.value);
|
|
16704
|
+
});
|
|
16705
|
+
});
|
|
16706
|
+
const handleHide = () => {
|
|
16707
|
+
visible.value = false;
|
|
16708
|
+
emit('visible-change', false);
|
|
16709
|
+
};
|
|
16710
|
+
const handleResize = () => {
|
|
16711
|
+
mobile.value = isOnMobile(sidebarRef.value);
|
|
16712
|
+
inViewport.value = isVisible(sidebarRef.value);
|
|
16713
|
+
};
|
|
16714
|
+
const handleKeyup = (event) => {
|
|
16715
|
+
if (mobile.value && !sidebarRef.value.contains(event.target)) {
|
|
16716
|
+
handleHide();
|
|
16717
|
+
}
|
|
16718
|
+
};
|
|
16719
|
+
const handleClickOutside = (event) => {
|
|
16720
|
+
if (mobile.value && !sidebarRef.value.contains(event.target)) {
|
|
16721
|
+
handleHide();
|
|
16722
|
+
}
|
|
16723
|
+
};
|
|
16724
|
+
const handleOnClick = (event) => {
|
|
16725
|
+
const target = event.target;
|
|
16726
|
+
target &&
|
|
16727
|
+
target.classList.contains('nav-link') &&
|
|
16728
|
+
!target.classList.contains('nav-group-toggle') &&
|
|
16729
|
+
mobile.value &&
|
|
16730
|
+
handleHide();
|
|
16731
|
+
};
|
|
16732
|
+
return () => [
|
|
16733
|
+
h$1('div', {
|
|
16734
|
+
class: [
|
|
16735
|
+
'sidebar',
|
|
16736
|
+
{
|
|
16737
|
+
[`sidebar-${props.colorScheme}`]: props.colorScheme,
|
|
16738
|
+
'sidebar-narrow': props.narrow,
|
|
16739
|
+
'sidebar-overlaid': props.overlaid,
|
|
16740
|
+
[`sidebar-${props.placement}`]: props.placement,
|
|
16741
|
+
[`sidebar-${props.position}`]: props.position,
|
|
16742
|
+
[`sidebar-${props.size}`]: props.size,
|
|
16743
|
+
'sidebar-narrow-unfoldable': props.unfoldable,
|
|
16744
|
+
show: visible.value === true && mobile.value,
|
|
16745
|
+
hide: visible.value === false && !mobile.value,
|
|
16746
|
+
},
|
|
16747
|
+
attrs.class,
|
|
16748
|
+
],
|
|
16749
|
+
ref: sidebarRef,
|
|
16750
|
+
}, slots.default && slots.default()),
|
|
16751
|
+
mobile.value &&
|
|
16752
|
+
h$1(CBackdrop, {
|
|
16753
|
+
class: 'sidebar-backdrop d-none',
|
|
16754
|
+
visible: props.visible,
|
|
16755
|
+
onClick: () => handleHide(),
|
|
16756
|
+
}),
|
|
16757
|
+
];
|
|
16758
|
+
},
|
|
16759
|
+
});
|
|
16760
|
+
|
|
16761
|
+
const CSidebarBrand = defineComponent({
|
|
16762
|
+
name: 'CSidebarBrand',
|
|
16763
|
+
setup(_, { slots }) {
|
|
16764
|
+
return () => h$1('div', { class: 'sidebar-brand' }, slots.default && slots.default());
|
|
16765
|
+
},
|
|
16766
|
+
});
|
|
16767
|
+
|
|
16768
|
+
const CSidebarFooter = defineComponent({
|
|
16769
|
+
name: 'CSidebarFooter',
|
|
16770
|
+
setup(_, { slots }) {
|
|
16771
|
+
return () => h$1('div', { class: 'sidebar-footer' }, slots.default && slots.default());
|
|
16772
|
+
},
|
|
16773
|
+
});
|
|
16774
|
+
|
|
16775
|
+
const CSidebarHeader = defineComponent({
|
|
16776
|
+
name: 'CSidebarHeader',
|
|
16777
|
+
setup(_, { slots }) {
|
|
16778
|
+
return () => h$1('div', { class: 'sidebar-header' }, slots.default && slots.default());
|
|
16779
|
+
},
|
|
16780
|
+
});
|
|
16781
|
+
|
|
16782
|
+
const CSidebarNav = defineComponent({
|
|
16783
|
+
name: 'CSidebarNav',
|
|
16784
|
+
setup(_, { slots }) {
|
|
16785
|
+
const visibleGroup = ref();
|
|
16786
|
+
const handleVisibleChange = (visible, index) => {
|
|
16787
|
+
if (visible) {
|
|
16788
|
+
visibleGroup.value = index;
|
|
16789
|
+
}
|
|
16790
|
+
else {
|
|
16791
|
+
if (visibleGroup.value === index) {
|
|
16792
|
+
visibleGroup.value = 0;
|
|
16793
|
+
}
|
|
16794
|
+
}
|
|
16795
|
+
};
|
|
16796
|
+
const isVisible = (index) => Boolean(visibleGroup.value === index);
|
|
16797
|
+
return () => h$1('ul', {
|
|
16798
|
+
class: 'sidebar-nav',
|
|
16799
|
+
}, slots.default &&
|
|
16800
|
+
slots.default().map((vnode, index) => {
|
|
16801
|
+
// @ts-expect-error name is defined in component
|
|
16802
|
+
if (vnode.type.name === 'CNavGroup') {
|
|
16803
|
+
return h$1(vnode, {
|
|
16804
|
+
onVisibleChange: (visible) => handleVisibleChange(visible, index + 1),
|
|
16805
|
+
...(visibleGroup.value && { visible: isVisible(index + 1) }),
|
|
16806
|
+
});
|
|
16807
|
+
}
|
|
16808
|
+
return vnode;
|
|
16809
|
+
}));
|
|
16810
|
+
},
|
|
16811
|
+
});
|
|
16812
|
+
|
|
16813
|
+
const CSidebarToggler = defineComponent({
|
|
16814
|
+
name: 'CSidebarToggler',
|
|
16815
|
+
setup(_, { slots }) {
|
|
16816
|
+
return () => h$1('button', { class: 'sidebar-toggler' }, slots.default && slots.default());
|
|
16817
|
+
},
|
|
16818
|
+
});
|
|
16819
|
+
|
|
16820
|
+
const CSidebarPlugin = {
|
|
16678
16821
|
install: (app) => {
|
|
16679
|
-
app.component(
|
|
16822
|
+
app.component(CSidebar.name, CSidebar);
|
|
16823
|
+
app.component(CSidebarBrand.name, CSidebarBrand);
|
|
16824
|
+
app.component(CSidebarFooter.name, CSidebarFooter);
|
|
16825
|
+
app.component(CSidebarHeader.name, CSidebarHeader);
|
|
16826
|
+
app.component(CSidebarNav.name, CSidebarNav);
|
|
16827
|
+
app.component(CSidebarToggler.name, CSidebarToggler);
|
|
16680
16828
|
},
|
|
16681
16829
|
};
|
|
16682
16830
|
|
|
16683
|
-
const
|
|
16684
|
-
|
|
16685
|
-
const rect = element.getBoundingClientRect();
|
|
16686
|
-
return (rect.top >= 0 &&
|
|
16687
|
-
rect.left >= 0 &&
|
|
16688
|
-
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
|
|
16689
|
-
rect.right <= (window.innerWidth || document.documentElement.clientWidth));
|
|
16690
|
-
};
|
|
16691
|
-
const CSidebar = defineComponent({
|
|
16692
|
-
name: 'CSidebar',
|
|
16831
|
+
const CSmartPagination = defineComponent({
|
|
16832
|
+
name: 'CSmartPagination',
|
|
16693
16833
|
props: {
|
|
16694
16834
|
/**
|
|
16695
|
-
*
|
|
16835
|
+
* Horizontall align
|
|
16696
16836
|
*
|
|
16697
|
-
* @
|
|
16837
|
+
* @default 'start'
|
|
16698
16838
|
*/
|
|
16699
|
-
|
|
16839
|
+
align: {
|
|
16700
16840
|
type: String,
|
|
16701
|
-
default:
|
|
16841
|
+
default: 'start',
|
|
16842
|
+
require: false,
|
|
16702
16843
|
validator: (value) => {
|
|
16703
|
-
return ['
|
|
16844
|
+
return ['start', 'center', 'end'].includes(value);
|
|
16704
16845
|
},
|
|
16705
16846
|
},
|
|
16706
16847
|
/**
|
|
16707
|
-
*
|
|
16848
|
+
* Current page number
|
|
16849
|
+
*
|
|
16850
|
+
* @default 1
|
|
16708
16851
|
*/
|
|
16709
|
-
|
|
16852
|
+
activePage: {
|
|
16853
|
+
type: Number,
|
|
16854
|
+
default: 1,
|
|
16855
|
+
require: false,
|
|
16856
|
+
},
|
|
16857
|
+
/**
|
|
16858
|
+
* Show/hide arrows
|
|
16859
|
+
*
|
|
16860
|
+
* @default true
|
|
16861
|
+
*/
|
|
16862
|
+
arrows: {
|
|
16710
16863
|
type: Boolean,
|
|
16711
|
-
|
|
16864
|
+
default: true,
|
|
16865
|
+
require: false,
|
|
16712
16866
|
},
|
|
16713
16867
|
/**
|
|
16714
|
-
*
|
|
16868
|
+
* Show/hide dots
|
|
16869
|
+
*
|
|
16870
|
+
* @default true
|
|
16715
16871
|
*/
|
|
16716
|
-
|
|
16872
|
+
dots: {
|
|
16717
16873
|
type: Boolean,
|
|
16718
|
-
|
|
16874
|
+
default: true,
|
|
16875
|
+
require: false,
|
|
16719
16876
|
},
|
|
16720
16877
|
/**
|
|
16721
|
-
*
|
|
16722
|
-
*
|
|
16878
|
+
* Show double arrows buttons
|
|
16879
|
+
*
|
|
16880
|
+
* @default true
|
|
16723
16881
|
*/
|
|
16724
|
-
|
|
16725
|
-
type:
|
|
16726
|
-
default:
|
|
16727
|
-
|
|
16728
|
-
return ['start', 'end'].includes(value);
|
|
16729
|
-
},
|
|
16882
|
+
doubleArrows: {
|
|
16883
|
+
type: Boolean,
|
|
16884
|
+
default: true,
|
|
16885
|
+
require: false,
|
|
16730
16886
|
},
|
|
16731
16887
|
/**
|
|
16732
|
-
*
|
|
16888
|
+
* The content of 'firstButton' button
|
|
16889
|
+
*
|
|
16890
|
+
* @default '«'
|
|
16733
16891
|
*/
|
|
16734
|
-
|
|
16892
|
+
firstButton: {
|
|
16735
16893
|
type: String,
|
|
16736
|
-
default:
|
|
16737
|
-
|
|
16738
|
-
return ['fixed'].includes(value);
|
|
16739
|
-
},
|
|
16894
|
+
default: '«',
|
|
16895
|
+
require: false,
|
|
16740
16896
|
},
|
|
16741
16897
|
/**
|
|
16742
|
-
*
|
|
16898
|
+
* The content of 'lastButton' button
|
|
16899
|
+
*
|
|
16900
|
+
* @default '»'
|
|
16743
16901
|
*/
|
|
16744
|
-
|
|
16902
|
+
lastButton: {
|
|
16745
16903
|
type: String,
|
|
16746
|
-
default:
|
|
16747
|
-
|
|
16748
|
-
return ['sm', 'lg', 'xl'].includes(value);
|
|
16749
|
-
},
|
|
16904
|
+
default: '»',
|
|
16905
|
+
require: false,
|
|
16750
16906
|
},
|
|
16751
16907
|
/**
|
|
16752
|
-
*
|
|
16908
|
+
* Maximum items number
|
|
16909
|
+
*
|
|
16910
|
+
* @default 5
|
|
16753
16911
|
*/
|
|
16754
|
-
|
|
16912
|
+
limit: {
|
|
16913
|
+
type: Number,
|
|
16914
|
+
default: 5,
|
|
16915
|
+
require: false,
|
|
16916
|
+
},
|
|
16755
16917
|
/**
|
|
16756
|
-
*
|
|
16918
|
+
* The content of 'nextButton' button
|
|
16919
|
+
*
|
|
16920
|
+
* @default '›'
|
|
16757
16921
|
*/
|
|
16758
|
-
|
|
16759
|
-
|
|
16760
|
-
|
|
16922
|
+
nextButton: {
|
|
16923
|
+
type: String,
|
|
16924
|
+
default: '›',
|
|
16925
|
+
require: false,
|
|
16926
|
+
},
|
|
16761
16927
|
/**
|
|
16762
|
-
*
|
|
16928
|
+
* Number of pages
|
|
16763
16929
|
*/
|
|
16764
|
-
|
|
16930
|
+
pages: {
|
|
16931
|
+
type: Number,
|
|
16932
|
+
default: 1000,
|
|
16933
|
+
require: true,
|
|
16934
|
+
},
|
|
16765
16935
|
/**
|
|
16766
|
-
*
|
|
16936
|
+
* The content of 'previousButton' button
|
|
16937
|
+
*
|
|
16938
|
+
* @default '‹'
|
|
16767
16939
|
*/
|
|
16768
|
-
|
|
16940
|
+
previousButton: {
|
|
16941
|
+
type: String,
|
|
16942
|
+
default: '‹',
|
|
16943
|
+
require: false,
|
|
16944
|
+
},
|
|
16769
16945
|
/**
|
|
16770
|
-
*
|
|
16946
|
+
* Size of pagination, valid values: 'sm', 'lg'
|
|
16771
16947
|
*/
|
|
16772
|
-
|
|
16948
|
+
size: {
|
|
16949
|
+
type: String,
|
|
16950
|
+
default: undefined,
|
|
16951
|
+
required: false,
|
|
16952
|
+
validator: (value) => {
|
|
16953
|
+
return ['sm', 'lg'].includes(value);
|
|
16954
|
+
},
|
|
16955
|
+
},
|
|
16956
|
+
},
|
|
16957
|
+
emits: [
|
|
16958
|
+
/**
|
|
16959
|
+
* On active page change callback.
|
|
16960
|
+
*/
|
|
16961
|
+
'activePageChange',
|
|
16773
16962
|
],
|
|
16774
|
-
setup(props, {
|
|
16775
|
-
const
|
|
16776
|
-
const
|
|
16777
|
-
const
|
|
16778
|
-
|
|
16779
|
-
|
|
16780
|
-
|
|
16781
|
-
|
|
16963
|
+
setup(props, { emit }) {
|
|
16964
|
+
const activePage = ref(props.activePage);
|
|
16965
|
+
const limit = ref(props.limit);
|
|
16966
|
+
const pages = ref(props.pages);
|
|
16967
|
+
watch(props, () => {
|
|
16968
|
+
activePage.value = props.activePage;
|
|
16969
|
+
limit.value = props.limit;
|
|
16970
|
+
pages.value = props.pages;
|
|
16782
16971
|
});
|
|
16783
|
-
|
|
16784
|
-
|
|
16785
|
-
|
|
16786
|
-
|
|
16972
|
+
const showDots = computed(() => {
|
|
16973
|
+
return props.dots && limit.value > 4 && limit.value < pages.value;
|
|
16974
|
+
});
|
|
16975
|
+
const maxPrevItems = computed(() => {
|
|
16976
|
+
return Math.floor((limit.value - 1) / 2);
|
|
16977
|
+
});
|
|
16978
|
+
const maxNextItems = computed(() => {
|
|
16979
|
+
return Math.ceil((limit.value - 1) / 2);
|
|
16980
|
+
});
|
|
16981
|
+
const beforeDots = computed(() => {
|
|
16982
|
+
return showDots.value && activePage.value > maxPrevItems.value + 1;
|
|
16983
|
+
});
|
|
16984
|
+
const afterDots = computed(() => {
|
|
16985
|
+
return showDots.value && activePage.value < pages.value - maxNextItems.value;
|
|
16986
|
+
});
|
|
16987
|
+
const computedLimit = computed(() => {
|
|
16988
|
+
return limit.value - (afterDots.value ? 1 : 0) - (beforeDots.value ? 1 : 0);
|
|
16989
|
+
});
|
|
16990
|
+
const range = computed(() => {
|
|
16991
|
+
return activePage.value + maxNextItems.value;
|
|
16787
16992
|
});
|
|
16788
|
-
|
|
16789
|
-
|
|
16790
|
-
inViewport.value = isVisible(sidebarRef.value);
|
|
16791
|
-
window.addEventListener('resize', () => handleResize());
|
|
16792
|
-
window.addEventListener('mouseup', handleClickOutside);
|
|
16793
|
-
window.addEventListener('keyup', handleKeyup);
|
|
16794
|
-
sidebarRef.value.addEventListener('mouseup', handleOnClick);
|
|
16795
|
-
sidebarRef.value.addEventListener('transitionend', () => {
|
|
16796
|
-
inViewport.value = isVisible(sidebarRef.value);
|
|
16797
|
-
});
|
|
16993
|
+
const lastItem = computed(() => {
|
|
16994
|
+
return range.value >= pages.value ? pages.value : range.value - (afterDots.value ? 1 : 0);
|
|
16798
16995
|
});
|
|
16799
|
-
|
|
16800
|
-
|
|
16801
|
-
window.removeEventListener('mouseup', handleClickOutside);
|
|
16802
|
-
window.removeEventListener('keyup', handleKeyup);
|
|
16803
|
-
sidebarRef.value.removeEventListener('mouseup', handleOnClick);
|
|
16804
|
-
sidebarRef.value.removeEventListener('transitionend', () => {
|
|
16805
|
-
inViewport.value = isVisible(sidebarRef.value);
|
|
16806
|
-
});
|
|
16996
|
+
const itemsAmount = computed(() => {
|
|
16997
|
+
return pages.value < computedLimit.value ? pages.value : computedLimit.value;
|
|
16807
16998
|
});
|
|
16808
|
-
const
|
|
16809
|
-
|
|
16810
|
-
|
|
16811
|
-
|
|
16812
|
-
|
|
16813
|
-
mobile.value = isOnMobile(sidebarRef.value);
|
|
16814
|
-
inViewport.value = isVisible(sidebarRef.value);
|
|
16815
|
-
};
|
|
16816
|
-
const handleKeyup = (event) => {
|
|
16817
|
-
if (mobile.value && !sidebarRef.value.contains(event.target)) {
|
|
16818
|
-
handleHide();
|
|
16819
|
-
}
|
|
16820
|
-
};
|
|
16821
|
-
const handleClickOutside = (event) => {
|
|
16822
|
-
if (mobile.value && !sidebarRef.value.contains(event.target)) {
|
|
16823
|
-
handleHide();
|
|
16824
|
-
}
|
|
16825
|
-
};
|
|
16826
|
-
const handleOnClick = (event) => {
|
|
16827
|
-
const target = event.target;
|
|
16828
|
-
target &&
|
|
16829
|
-
target.classList.contains('nav-link') &&
|
|
16830
|
-
!target.classList.contains('nav-group-toggle') &&
|
|
16831
|
-
mobile.value &&
|
|
16832
|
-
handleHide();
|
|
16833
|
-
};
|
|
16834
|
-
return () => [
|
|
16835
|
-
h$1('div', {
|
|
16836
|
-
class: [
|
|
16837
|
-
'sidebar',
|
|
16838
|
-
{
|
|
16839
|
-
[`sidebar-${props.colorScheme}`]: props.colorScheme,
|
|
16840
|
-
'sidebar-narrow': props.narrow,
|
|
16841
|
-
'sidebar-overlaid': props.overlaid,
|
|
16842
|
-
[`sidebar-${props.placement}`]: props.placement,
|
|
16843
|
-
[`sidebar-${props.position}`]: props.position,
|
|
16844
|
-
[`sidebar-${props.size}`]: props.size,
|
|
16845
|
-
'sidebar-narrow-unfoldable': props.unfoldable,
|
|
16846
|
-
show: visible.value === true && mobile.value,
|
|
16847
|
-
hide: visible.value === false && !mobile.value,
|
|
16848
|
-
},
|
|
16849
|
-
attrs.class,
|
|
16850
|
-
],
|
|
16851
|
-
ref: sidebarRef,
|
|
16852
|
-
}, slots.default && slots.default()),
|
|
16853
|
-
mobile.value &&
|
|
16854
|
-
h$1(CBackdrop, {
|
|
16855
|
-
class: 'sidebar-backdrop d-none',
|
|
16856
|
-
visible: props.visible,
|
|
16857
|
-
onClick: () => handleHide(),
|
|
16858
|
-
}),
|
|
16859
|
-
];
|
|
16860
|
-
},
|
|
16861
|
-
});
|
|
16862
|
-
|
|
16863
|
-
const CSidebarBrand = defineComponent({
|
|
16864
|
-
name: 'CSidebarBrand',
|
|
16865
|
-
setup(_, { slots }) {
|
|
16866
|
-
return () => h$1('div', { class: 'sidebar-brand' }, slots.default && slots.default());
|
|
16867
|
-
},
|
|
16868
|
-
});
|
|
16869
|
-
|
|
16870
|
-
const CSidebarFooter = defineComponent({
|
|
16871
|
-
name: 'CSidebarFooter',
|
|
16872
|
-
setup(_, { slots }) {
|
|
16873
|
-
return () => h$1('div', { class: 'sidebar-footer' }, slots.default && slots.default());
|
|
16874
|
-
},
|
|
16875
|
-
});
|
|
16876
|
-
|
|
16877
|
-
const CSidebarHeader = defineComponent({
|
|
16878
|
-
name: 'CSidebarHeader',
|
|
16879
|
-
setup(_, { slots }) {
|
|
16880
|
-
return () => h$1('div', { class: 'sidebar-header' }, slots.default && slots.default());
|
|
16881
|
-
},
|
|
16882
|
-
});
|
|
16883
|
-
|
|
16884
|
-
const CSidebarNav = defineComponent({
|
|
16885
|
-
name: 'CSidebarNav',
|
|
16886
|
-
setup(_, { slots }) {
|
|
16887
|
-
const visibleGroup = ref();
|
|
16888
|
-
const handleVisibleChange = (visible, index) => {
|
|
16889
|
-
if (visible) {
|
|
16890
|
-
visibleGroup.value = index;
|
|
16999
|
+
const items = computed(() => {
|
|
17000
|
+
if (activePage.value - maxPrevItems.value <= 1) {
|
|
17001
|
+
return Array.from({
|
|
17002
|
+
length: itemsAmount.value,
|
|
17003
|
+
}, (_v, i) => i + 1);
|
|
16891
17004
|
}
|
|
16892
17005
|
else {
|
|
16893
|
-
|
|
16894
|
-
|
|
16895
|
-
}
|
|
17006
|
+
return Array.from({
|
|
17007
|
+
length: itemsAmount.value,
|
|
17008
|
+
}, (_v, i) => {
|
|
17009
|
+
return lastItem.value - i;
|
|
17010
|
+
}).reverse();
|
|
17011
|
+
}
|
|
17012
|
+
});
|
|
17013
|
+
const setPage = (number) => {
|
|
17014
|
+
if (number !== activePage.value) {
|
|
17015
|
+
activePage.value = number;
|
|
17016
|
+
emit('activePageChange', number);
|
|
16896
17017
|
}
|
|
16897
17018
|
};
|
|
16898
|
-
|
|
16899
|
-
|
|
16900
|
-
|
|
16901
|
-
|
|
16902
|
-
|
|
16903
|
-
|
|
16904
|
-
|
|
16905
|
-
|
|
16906
|
-
|
|
16907
|
-
|
|
17019
|
+
return () => h$1(CPagination, {
|
|
17020
|
+
align: props.align,
|
|
17021
|
+
'aria-label': 'pagination',
|
|
17022
|
+
size: props.size,
|
|
17023
|
+
}, {
|
|
17024
|
+
default: () => [
|
|
17025
|
+
props.doubleArrows &&
|
|
17026
|
+
h$1(CPaginationItem, {
|
|
17027
|
+
onClick: () => {
|
|
17028
|
+
activePage.value !== 1 && setPage(1);
|
|
17029
|
+
},
|
|
17030
|
+
'aria-label': 'Go to first page',
|
|
17031
|
+
...(activePage.value === 1 && {
|
|
17032
|
+
'aria-disabled': true,
|
|
17033
|
+
disabled: true,
|
|
17034
|
+
}),
|
|
17035
|
+
}, {
|
|
17036
|
+
default: () => typeof props.firstButton === 'string'
|
|
17037
|
+
? h$1('span', {
|
|
17038
|
+
innerHTML: props.firstButton,
|
|
17039
|
+
})
|
|
17040
|
+
: props.firstButton,
|
|
17041
|
+
}),
|
|
17042
|
+
props.arrows &&
|
|
17043
|
+
h$1(CPaginationItem, {
|
|
17044
|
+
onClick: () => {
|
|
17045
|
+
activePage.value !== 1 && setPage(activePage.value - 1);
|
|
17046
|
+
},
|
|
17047
|
+
'aria-label': 'Go to previous page',
|
|
17048
|
+
...(activePage.value === 1 && {
|
|
17049
|
+
'aria-disabled': true,
|
|
17050
|
+
disabled: true,
|
|
17051
|
+
}),
|
|
17052
|
+
}, {
|
|
17053
|
+
default: () => typeof props.previousButton === 'string'
|
|
17054
|
+
? h$1('span', {
|
|
17055
|
+
innerHTML: props.previousButton,
|
|
17056
|
+
})
|
|
17057
|
+
: props.previousButton,
|
|
17058
|
+
}),
|
|
17059
|
+
beforeDots.value &&
|
|
17060
|
+
h$1(CPaginationItem, {
|
|
17061
|
+
role: 'separator',
|
|
17062
|
+
disabled: true,
|
|
17063
|
+
}, {
|
|
17064
|
+
default: () => '...',
|
|
17065
|
+
}),
|
|
17066
|
+
items.value.map((i) => {
|
|
17067
|
+
return h$1(CPaginationItem, {
|
|
17068
|
+
onClick: () => setPage(i),
|
|
17069
|
+
'aria-label': activePage.value === i ? `Current page ${i}` : `Go to page ${i}`,
|
|
17070
|
+
active: activePage.value === i,
|
|
17071
|
+
}, {
|
|
17072
|
+
default: () => i,
|
|
16908
17073
|
});
|
|
16909
|
-
}
|
|
16910
|
-
|
|
16911
|
-
|
|
16912
|
-
|
|
16913
|
-
|
|
16914
|
-
|
|
16915
|
-
|
|
16916
|
-
|
|
16917
|
-
|
|
16918
|
-
|
|
17074
|
+
}),
|
|
17075
|
+
afterDots.value &&
|
|
17076
|
+
h$1(CPaginationItem, {
|
|
17077
|
+
role: 'separator',
|
|
17078
|
+
disabled: true,
|
|
17079
|
+
}, {
|
|
17080
|
+
default: () => '...',
|
|
17081
|
+
}),
|
|
17082
|
+
props.arrows &&
|
|
17083
|
+
h$1(CPaginationItem, {
|
|
17084
|
+
onClick: () => {
|
|
17085
|
+
activePage.value !== pages.value && setPage(activePage.value + 1);
|
|
17086
|
+
},
|
|
17087
|
+
'aria-label': 'Go to next page',
|
|
17088
|
+
...(activePage.value === pages.value && {
|
|
17089
|
+
'aria-disabled': true,
|
|
17090
|
+
disabled: true,
|
|
17091
|
+
}),
|
|
17092
|
+
}, {
|
|
17093
|
+
default: () => typeof props.nextButton === 'string'
|
|
17094
|
+
? h$1('span', {
|
|
17095
|
+
innerHTML: props.nextButton,
|
|
17096
|
+
})
|
|
17097
|
+
: props.nextButton,
|
|
17098
|
+
}),
|
|
17099
|
+
props.doubleArrows &&
|
|
17100
|
+
h$1(CPaginationItem, {
|
|
17101
|
+
onClick: () => {
|
|
17102
|
+
activePage.value !== pages.value && setPage(pages.value);
|
|
17103
|
+
},
|
|
17104
|
+
'aria-label': 'Go to last page',
|
|
17105
|
+
...(activePage.value === pages.value && {
|
|
17106
|
+
'aria-disabled': true,
|
|
17107
|
+
disabled: true,
|
|
17108
|
+
}),
|
|
17109
|
+
}, {
|
|
17110
|
+
default: () => typeof props.lastButton === 'string'
|
|
17111
|
+
? h$1('span', {
|
|
17112
|
+
innerHTML: props.lastButton,
|
|
17113
|
+
})
|
|
17114
|
+
: props.lastButton,
|
|
17115
|
+
}),
|
|
17116
|
+
],
|
|
17117
|
+
});
|
|
16919
17118
|
},
|
|
16920
17119
|
});
|
|
16921
17120
|
|
|
16922
|
-
const
|
|
17121
|
+
const CSmartPaginationPlugin = {
|
|
16923
17122
|
install: (app) => {
|
|
16924
|
-
app.component(
|
|
16925
|
-
app.component(CSidebarBrand.name, CSidebarBrand);
|
|
16926
|
-
app.component(CSidebarFooter.name, CSidebarFooter);
|
|
16927
|
-
app.component(CSidebarHeader.name, CSidebarHeader);
|
|
16928
|
-
app.component(CSidebarNav.name, CSidebarNav);
|
|
16929
|
-
app.component(CSidebarToggler.name, CSidebarToggler);
|
|
17123
|
+
app.component(CSmartPagination.name, CSmartPagination);
|
|
16930
17124
|
},
|
|
16931
17125
|
};
|
|
16932
17126
|
|
|
@@ -16953,7 +17147,6 @@ const CTableBody = defineComponent({
|
|
|
16953
17147
|
|
|
16954
17148
|
const CTableCaption = defineComponent({
|
|
16955
17149
|
name: 'CTableCaption',
|
|
16956
|
-
props: {},
|
|
16957
17150
|
setup(_, { slots }) {
|
|
16958
17151
|
return () => h$1('caption', {}, slots.default && slots.default());
|
|
16959
17152
|
},
|
|
@@ -17969,13 +18162,13 @@ const CIcon = defineComponent({
|
|
|
17969
18162
|
},
|
|
17970
18163
|
});
|
|
17971
18164
|
|
|
17972
|
-
|
|
18165
|
+
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'/>"];
|
|
17973
18166
|
|
|
17974
|
-
|
|
18167
|
+
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'/>"];
|
|
17975
18168
|
|
|
17976
|
-
|
|
18169
|
+
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'/>"];
|
|
17977
18170
|
|
|
17978
|
-
|
|
18171
|
+
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'/>"];
|
|
17979
18172
|
|
|
17980
18173
|
const CSmartTable = defineComponent({
|
|
17981
18174
|
name: 'CSmartTable',
|
|
@@ -18084,6 +18277,7 @@ const CSmartTable = defineComponent({
|
|
|
18084
18277
|
*/
|
|
18085
18278
|
itemsPerPage: {
|
|
18086
18279
|
type: Number,
|
|
18280
|
+
default: 10,
|
|
18087
18281
|
required: false,
|
|
18088
18282
|
},
|
|
18089
18283
|
/**
|
|
@@ -18132,7 +18326,7 @@ const CSmartTable = defineComponent({
|
|
|
18132
18326
|
* 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.
|
|
18133
18327
|
*/
|
|
18134
18328
|
pagination: {
|
|
18135
|
-
type: Boolean,
|
|
18329
|
+
type: [Boolean, Object],
|
|
18136
18330
|
required: false,
|
|
18137
18331
|
},
|
|
18138
18332
|
/**
|
|
@@ -18619,12 +18813,14 @@ const CSmartTable = defineComponent({
|
|
|
18619
18813
|
}, [
|
|
18620
18814
|
h$1('div', {
|
|
18621
18815
|
class: 'col',
|
|
18622
|
-
}, props.pagination && numberOfPages.value > 1
|
|
18816
|
+
}, (props.pagination && numberOfPages.value > 1) || props.paginationProps
|
|
18623
18817
|
? h$1(CSmartPagination, {
|
|
18624
|
-
...props.paginationProps,
|
|
18625
18818
|
pages: numberOfPages.value,
|
|
18626
18819
|
activePage: activePage.value,
|
|
18627
|
-
|
|
18820
|
+
...props.paginationProps,
|
|
18821
|
+
onActivePageChange: (page) => typeof props.pagination === 'object' && props.pagination.external
|
|
18822
|
+
? emit('activePageChange', page)
|
|
18823
|
+
: handleActivePageChange(page),
|
|
18628
18824
|
})
|
|
18629
18825
|
: ''),
|
|
18630
18826
|
h$1('div', {
|
|
@@ -19753,7 +19949,6 @@ var Components = /*#__PURE__*/Object.freeze({
|
|
|
19753
19949
|
CPaginationPlugin: CPaginationPlugin,
|
|
19754
19950
|
CPagination: CPagination,
|
|
19755
19951
|
CPaginationItem: CPaginationItem,
|
|
19756
|
-
CSmartPagination: CSmartPagination,
|
|
19757
19952
|
CPicker: CPicker,
|
|
19758
19953
|
CPickerPlugin: CPickerPlugin,
|
|
19759
19954
|
CPlaceholderPlugin: CPlaceholderPlugin,
|
|
@@ -19770,6 +19965,8 @@ var Components = /*#__PURE__*/Object.freeze({
|
|
|
19770
19965
|
CSidebarHeader: CSidebarHeader,
|
|
19771
19966
|
CSidebarNav: CSidebarNav,
|
|
19772
19967
|
CSidebarToggler: CSidebarToggler,
|
|
19968
|
+
CSmartPaginationPlugin: CSmartPaginationPlugin,
|
|
19969
|
+
CSmartPagination: CSmartPagination,
|
|
19773
19970
|
CSmartTablePlugin: CSmartTablePlugin,
|
|
19774
19971
|
CSmartTable: CSmartTable,
|
|
19775
19972
|
CSpinnerPlugin: CSpinnerPlugin,
|
|
@@ -20034,5 +20231,5 @@ const CoreuiVue = {
|
|
|
20034
20231
|
},
|
|
20035
20232
|
};
|
|
20036
20233
|
|
|
20037
|
-
export { CAccordion, CAccordionBody, CAccordionButton, CAccordionHeader, CAccordionItem, CAccordionPlugin, CAlert, CAlertHeading, CAlertLink, CAlertPlugin, CAvatar, CAvatarPlugin, CBackdrop, CBackdropPlugin, CBadge, CBadgePlugin, CBreadcrumb, CBreadcrumbItem, CBreadcrumbPlugin, CButton, CButtonGroup, CButtonGroupPlugin, CButtonPlugin, CButtonToolbar, CCLinkPlugin, CCalendar, CCalendarPlugin, CCallout, CCalloutPlugin, CCard, CCardBody, CCardFooter, CCardGroup, CCardHeader, CCardImage, CCardImageOverlay, CCardLink, CCardPlugin, CCardSubtitle, CCardText, CCardTitle, CCarousel, CCarouselCaption, CCarouselItem, CCarouselPlugin, CCloseButton, CCloseButtonPlugin, CCol, CCollapse, CCollapsePlugin, CContainer, CDatePicker, CDatePickerPlugin, CDateRangePicker, CDateRangePickerPlugin, CDropdown, CDropdownDivider, CDropdownHeader, CDropdownItem, CDropdownMenu, CDropdownPlugin, CDropdownToggle, CElementCover, CElementCoverPlugin, CFooter, CFooterPlugin, CForm, CFormCheck, CFormFeedback, CFormFloating, CFormInput, CFormLabel, CFormPlugin, CFormRange, CFormSelect, CFormSwitch, CFormText, CFormTextarea, CGridPlugin, CHeader, CHeaderBrand, CHeaderDivider, CHeaderNav, CHeaderPlugin, CHeaderText, CHeaderToggler, CImage, CImagePlugin, CInputGroup, CInputGroupText, CLink, CListGroup, CListGroupItem, CListGroupPlugin, CLoadingButton, CLoadingButtonPlugin, CModal, CModalBody, CModalFooter, CModalHeader, CModalPlugin, CModalTitle, CMultiSelect, CMultiSelectPlugin, CNav, CNavGroup, CNavGroupItems, CNavItem, CNavLink, CNavPlugin, CNavTitle, CNavbar, CNavbarBrand, CNavbarNav, CNavbarPlugin, CNavbarText, CNavbarToggler, COffcanvas, COffcanvasBody, COffcanvasHeader, COffcanvasPlugin, COffcanvasTitle, CPagination, CPaginationItem, CPaginationPlugin, CPicker, CPickerPlugin, CPlaceholder, CPlaceholderPlugin, CPopover, CPopoverPlugin, CProgress, CProgressBar, CProgressPlugin, CRow, CSidebar, CSidebarBrand, CSidebarFooter, CSidebarHeader, CSidebarNav, CSidebarPlugin, CSidebarToggler, CSmartPagination, CSmartTable, CSmartTablePlugin, CSpinner, CSpinnerPlugin, CTabContent, CTabPane, CTable, CTableBody, CTableCaption, CTableDataCell, CTableFoot, CTableHead, CTableHeaderCell, CTablePlugin, CTableRow, CTabsPlugin, CTimePicker, CTimePickerPlugin, CToast, CToastBody, CToastClose, CToastHeader, CToastPlugin, CToaster, CTooltip, CTooltipPlugin, CWidgetStatsA, CWidgetStatsB, CWidgetStatsC, CWidgetStatsD, CWidgetStatsE, CWidgetStatsF, CWidgetsStatsPlugin, CoreuiVue as default, vcplaceholder, vcpopover, vctooltip };
|
|
20234
|
+
export { CAccordion, CAccordionBody, CAccordionButton, CAccordionHeader, CAccordionItem, CAccordionPlugin, CAlert, CAlertHeading, CAlertLink, CAlertPlugin, CAvatar, CAvatarPlugin, CBackdrop, CBackdropPlugin, CBadge, CBadgePlugin, CBreadcrumb, CBreadcrumbItem, CBreadcrumbPlugin, CButton, CButtonGroup, CButtonGroupPlugin, CButtonPlugin, CButtonToolbar, CCLinkPlugin, CCalendar, CCalendarPlugin, CCallout, CCalloutPlugin, CCard, CCardBody, CCardFooter, CCardGroup, CCardHeader, CCardImage, CCardImageOverlay, CCardLink, CCardPlugin, CCardSubtitle, CCardText, CCardTitle, CCarousel, CCarouselCaption, CCarouselItem, CCarouselPlugin, CCloseButton, CCloseButtonPlugin, CCol, CCollapse, CCollapsePlugin, CContainer, CDatePicker, CDatePickerPlugin, CDateRangePicker, CDateRangePickerPlugin, CDropdown, CDropdownDivider, CDropdownHeader, CDropdownItem, CDropdownMenu, CDropdownPlugin, CDropdownToggle, CElementCover, CElementCoverPlugin, CFooter, CFooterPlugin, CForm, CFormCheck, CFormFeedback, CFormFloating, CFormInput, CFormLabel, CFormPlugin, CFormRange, CFormSelect, CFormSwitch, CFormText, CFormTextarea, CGridPlugin, CHeader, CHeaderBrand, CHeaderDivider, CHeaderNav, CHeaderPlugin, CHeaderText, CHeaderToggler, CImage, CImagePlugin, CInputGroup, CInputGroupText, CLink, CListGroup, CListGroupItem, CListGroupPlugin, CLoadingButton, CLoadingButtonPlugin, CModal, CModalBody, CModalFooter, CModalHeader, CModalPlugin, CModalTitle, CMultiSelect, CMultiSelectPlugin, CNav, CNavGroup, CNavGroupItems, CNavItem, CNavLink, CNavPlugin, CNavTitle, CNavbar, CNavbarBrand, CNavbarNav, CNavbarPlugin, CNavbarText, CNavbarToggler, COffcanvas, COffcanvasBody, COffcanvasHeader, COffcanvasPlugin, COffcanvasTitle, CPagination, CPaginationItem, CPaginationPlugin, CPicker, CPickerPlugin, CPlaceholder, CPlaceholderPlugin, CPopover, CPopoverPlugin, CProgress, CProgressBar, CProgressPlugin, CRow, CSidebar, CSidebarBrand, CSidebarFooter, CSidebarHeader, CSidebarNav, CSidebarPlugin, CSidebarToggler, CSmartPagination, CSmartPaginationPlugin, CSmartTable, CSmartTablePlugin, CSpinner, CSpinnerPlugin, CTabContent, CTabPane, CTable, CTableBody, CTableCaption, CTableDataCell, CTableFoot, CTableHead, CTableHeaderCell, CTablePlugin, CTableRow, CTabsPlugin, CTimePicker, CTimePickerPlugin, CToast, CToastBody, CToastClose, CToastHeader, CToastPlugin, CToaster, CTooltip, CTooltipPlugin, CWidgetStatsA, CWidgetStatsB, CWidgetStatsC, CWidgetStatsD, CWidgetStatsE, CWidgetStatsF, CWidgetsStatsPlugin, CoreuiVue as default, vcplaceholder, vcpopover, vctooltip };
|
|
20038
20235
|
//# sourceMappingURL=index.es.js.map
|