@coreui/vue-pro 4.9.0-beta.2 → 5.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/dropdown/CDropdown.d.ts +62 -4
- package/dist/components/dropdown/CDropdownToggle.d.ts +1 -1
- package/dist/components/form/CFormCheck.d.ts +26 -2
- package/dist/components/form/CFormInput.d.ts +6 -18
- package/dist/components/multi-select/CMultiSelect.d.ts +6 -6
- package/dist/components/popover/CPopover.d.ts +75 -6
- package/dist/components/toast/CToast.d.ts +1 -1
- package/dist/components/tooltip/CTooltip.d.ts +77 -8
- package/dist/composables/index.d.ts +2 -1
- package/dist/composables/useColorModes.d.ts +1 -1
- package/dist/composables/usePopper.d.ts +6 -0
- package/dist/index.es.js +384 -238
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +383 -236
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils/getRTLPlacement.d.ts +3 -0
- package/dist/utils/index.d.ts +2 -1
- package/package.json +11 -11
- package/src/components/date-range-picker/CDateRangePicker.ts +6 -4
- package/src/components/dropdown/CDropdown.ts +116 -61
- package/src/components/dropdown/CDropdownMenu.ts +2 -47
- package/src/components/dropdown/CDropdownToggle.ts +5 -5
- package/src/components/form/CFormCheck.ts +53 -4
- package/src/components/multi-select/CMultiSelect.ts +3 -3
- package/src/components/popover/CPopover.ts +96 -50
- package/src/components/tooltip/CTooltip.ts +97 -51
- package/src/composables/index.ts +2 -1
- package/src/composables/useColorModes.ts +2 -1
- package/src/composables/usePopper.ts +25 -0
- package/src/types.ts +1 -1
- package/src/utils/getRTLPlacement.ts +18 -0
- package/src/utils/index.ts +2 -1
package/dist/index.js
CHANGED
|
@@ -1831,6 +1831,20 @@ const CCardPlugin = {
|
|
|
1831
1831
|
},
|
|
1832
1832
|
};
|
|
1833
1833
|
|
|
1834
|
+
const getRTLPlacement = (placement, element) => {
|
|
1835
|
+
switch (placement) {
|
|
1836
|
+
case 'right': {
|
|
1837
|
+
return isRTL(element) ? 'left' : 'right';
|
|
1838
|
+
}
|
|
1839
|
+
case 'left': {
|
|
1840
|
+
return isRTL(element) ? 'right' : 'left';
|
|
1841
|
+
}
|
|
1842
|
+
default: {
|
|
1843
|
+
return placement;
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
};
|
|
1847
|
+
|
|
1834
1848
|
const getUID = (prefix) => {
|
|
1835
1849
|
do {
|
|
1836
1850
|
prefix += Math.floor(Math.random() * 1_000_000);
|
|
@@ -7708,14 +7722,16 @@ const CDateRangePicker = vue.defineComponent({
|
|
|
7708
7722
|
});
|
|
7709
7723
|
vue.watch(() => props.startDate, () => {
|
|
7710
7724
|
if (props.startDate) {
|
|
7711
|
-
|
|
7712
|
-
|
|
7725
|
+
const date = new Date(props.startDate);
|
|
7726
|
+
calendarDate.value = date;
|
|
7727
|
+
startDate.value = date;
|
|
7713
7728
|
}
|
|
7714
7729
|
});
|
|
7715
7730
|
vue.watch(() => props.endDate, () => {
|
|
7716
7731
|
if (props.endDate) {
|
|
7717
|
-
|
|
7718
|
-
|
|
7732
|
+
const date = new Date(props.endDate);
|
|
7733
|
+
calendarDate.value = date;
|
|
7734
|
+
endDate.value = date;
|
|
7719
7735
|
}
|
|
7720
7736
|
});
|
|
7721
7737
|
vue.watch(() => props.maxDate, () => {
|
|
@@ -8381,6 +8397,91 @@ const CDatePickerPlugin = {
|
|
|
8381
8397
|
},
|
|
8382
8398
|
};
|
|
8383
8399
|
|
|
8400
|
+
const getStoredTheme = (localStorageItemName) => typeof window !== 'undefined' && localStorage.getItem(localStorageItemName);
|
|
8401
|
+
const setStoredTheme = (localStorageItemName, colorMode) => localStorage.setItem(localStorageItemName, colorMode);
|
|
8402
|
+
const getPreferredColorScheme = (localStorageItemName) => {
|
|
8403
|
+
if (typeof window === 'undefined') {
|
|
8404
|
+
return;
|
|
8405
|
+
}
|
|
8406
|
+
const storedTheme = getStoredTheme(localStorageItemName);
|
|
8407
|
+
if (storedTheme) {
|
|
8408
|
+
return storedTheme;
|
|
8409
|
+
}
|
|
8410
|
+
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
8411
|
+
};
|
|
8412
|
+
const setTheme = (colorMode) => {
|
|
8413
|
+
document.documentElement.dataset.coreuiTheme =
|
|
8414
|
+
colorMode === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
8415
|
+
? 'dark'
|
|
8416
|
+
: colorMode;
|
|
8417
|
+
const event = new Event('ColorSchemeChange');
|
|
8418
|
+
document.documentElement.dispatchEvent(event);
|
|
8419
|
+
};
|
|
8420
|
+
const useColorModes = (localStorageItemName = 'coreui-vue-color-scheme') => {
|
|
8421
|
+
const colorMode = vue.ref(getPreferredColorScheme(localStorageItemName));
|
|
8422
|
+
vue.watch(colorMode, () => {
|
|
8423
|
+
if (colorMode.value) {
|
|
8424
|
+
setStoredTheme(localStorageItemName, colorMode.value);
|
|
8425
|
+
setTheme(colorMode.value);
|
|
8426
|
+
}
|
|
8427
|
+
});
|
|
8428
|
+
vue.onBeforeMount(() => {
|
|
8429
|
+
if (typeof getStoredTheme(localStorageItemName) === 'string' && colorMode.value) {
|
|
8430
|
+
setTheme(colorMode.value);
|
|
8431
|
+
}
|
|
8432
|
+
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
|
|
8433
|
+
const storedTheme = getStoredTheme(localStorageItemName);
|
|
8434
|
+
if (storedTheme !== 'light' && storedTheme !== 'dark' && colorMode.value) {
|
|
8435
|
+
setTheme(colorMode.value);
|
|
8436
|
+
}
|
|
8437
|
+
});
|
|
8438
|
+
});
|
|
8439
|
+
return {
|
|
8440
|
+
colorMode,
|
|
8441
|
+
isColorModeSet: () => Boolean(getStoredTheme(localStorageItemName)),
|
|
8442
|
+
setColorMode: (mode) => {
|
|
8443
|
+
colorMode.value = mode;
|
|
8444
|
+
},
|
|
8445
|
+
};
|
|
8446
|
+
};
|
|
8447
|
+
|
|
8448
|
+
const usePopper = () => {
|
|
8449
|
+
const _popper = vue.ref();
|
|
8450
|
+
const initPopper = (reference, popper, options) => {
|
|
8451
|
+
_popper.value = createPopper(reference, popper, options);
|
|
8452
|
+
};
|
|
8453
|
+
const destroyPopper = () => {
|
|
8454
|
+
if (_popper.value) {
|
|
8455
|
+
_popper.value.destroy();
|
|
8456
|
+
}
|
|
8457
|
+
_popper.value = undefined;
|
|
8458
|
+
};
|
|
8459
|
+
return {
|
|
8460
|
+
popper: _popper.value,
|
|
8461
|
+
initPopper,
|
|
8462
|
+
destroyPopper,
|
|
8463
|
+
};
|
|
8464
|
+
};
|
|
8465
|
+
|
|
8466
|
+
const getPlacement = (placement, direction, alignment, isRTL) => {
|
|
8467
|
+
let _placement = placement;
|
|
8468
|
+
if (direction === 'dropup') {
|
|
8469
|
+
_placement = isRTL ? 'top-end' : 'top-start';
|
|
8470
|
+
}
|
|
8471
|
+
if (direction === 'dropup-center') {
|
|
8472
|
+
_placement = 'top';
|
|
8473
|
+
}
|
|
8474
|
+
if (direction === 'dropend') {
|
|
8475
|
+
_placement = isRTL ? 'left-start' : 'right-start';
|
|
8476
|
+
}
|
|
8477
|
+
if (direction === 'dropstart') {
|
|
8478
|
+
_placement = isRTL ? 'right-start' : 'left-start';
|
|
8479
|
+
}
|
|
8480
|
+
if (alignment === 'end') {
|
|
8481
|
+
_placement = isRTL ? 'bottom-start' : 'bottom-end';
|
|
8482
|
+
}
|
|
8483
|
+
return _placement;
|
|
8484
|
+
};
|
|
8384
8485
|
const CDropdown = vue.defineComponent({
|
|
8385
8486
|
name: 'CDropdown',
|
|
8386
8487
|
props: {
|
|
@@ -8452,6 +8553,15 @@ const CDropdown = vue.defineComponent({
|
|
|
8452
8553
|
* Toggle the disabled state for the component.
|
|
8453
8554
|
*/
|
|
8454
8555
|
disabled: Boolean,
|
|
8556
|
+
/**
|
|
8557
|
+
* Offset of the dropdown menu relative to its target.
|
|
8558
|
+
*
|
|
8559
|
+
* @since 4.9.0
|
|
8560
|
+
*/
|
|
8561
|
+
offset: {
|
|
8562
|
+
type: Array,
|
|
8563
|
+
default: () => [0, 2],
|
|
8564
|
+
},
|
|
8455
8565
|
/**
|
|
8456
8566
|
* Describes the placement of your component after Popper.js has applied all the modifiers that may have flipped or altered the originally provided placement property.
|
|
8457
8567
|
*
|
|
@@ -8505,14 +8615,37 @@ const CDropdown = vue.defineComponent({
|
|
|
8505
8615
|
setup(props, { slots, emit }) {
|
|
8506
8616
|
const dropdownToggleRef = vue.ref();
|
|
8507
8617
|
const dropdownMenuRef = vue.ref();
|
|
8508
|
-
const
|
|
8509
|
-
const popper = vue.ref();
|
|
8618
|
+
const popper = vue.ref(typeof props.alignment === 'object' ? false : props.popper);
|
|
8510
8619
|
const visible = vue.ref(props.visible);
|
|
8620
|
+
const { initPopper, destroyPopper } = usePopper();
|
|
8621
|
+
const popperConfig = {
|
|
8622
|
+
modifiers: [
|
|
8623
|
+
{
|
|
8624
|
+
name: 'offset',
|
|
8625
|
+
options: {
|
|
8626
|
+
offset: props.offset,
|
|
8627
|
+
},
|
|
8628
|
+
},
|
|
8629
|
+
],
|
|
8630
|
+
placement: getPlacement(props.placement, props.direction, props.alignment, isRTL(dropdownMenuRef.value)),
|
|
8631
|
+
};
|
|
8511
8632
|
vue.watch(() => props.visible, () => {
|
|
8512
8633
|
visible.value = props.visible;
|
|
8513
8634
|
});
|
|
8635
|
+
vue.watch(visible, () => {
|
|
8636
|
+
if (visible.value && dropdownToggleRef.value && dropdownMenuRef.value) {
|
|
8637
|
+
popper.value && initPopper(dropdownToggleRef.value, dropdownMenuRef.value, popperConfig);
|
|
8638
|
+
window.addEventListener('mouseup', handleMouseUp);
|
|
8639
|
+
window.addEventListener('keyup', handleKeyup);
|
|
8640
|
+
emit('show');
|
|
8641
|
+
return;
|
|
8642
|
+
}
|
|
8643
|
+
popper.value && destroyPopper();
|
|
8644
|
+
window.removeEventListener('mouseup', handleMouseUp);
|
|
8645
|
+
window.removeEventListener('keyup', handleKeyup);
|
|
8646
|
+
emit('hide');
|
|
8647
|
+
});
|
|
8514
8648
|
vue.provide('config', {
|
|
8515
|
-
autoClose: props.autoClose,
|
|
8516
8649
|
alignment: props.alignment,
|
|
8517
8650
|
dark: props.dark,
|
|
8518
8651
|
popper: props.popper,
|
|
@@ -8521,24 +8654,31 @@ const CDropdown = vue.defineComponent({
|
|
|
8521
8654
|
vue.provide('visible', visible);
|
|
8522
8655
|
vue.provide('dropdownToggleRef', dropdownToggleRef);
|
|
8523
8656
|
vue.provide('dropdownMenuRef', dropdownMenuRef);
|
|
8524
|
-
const
|
|
8525
|
-
|
|
8526
|
-
if (typeof props.alignment === 'object') {
|
|
8657
|
+
const handleKeyup = (event) => {
|
|
8658
|
+
if (props.autoClose === false) {
|
|
8527
8659
|
return;
|
|
8528
8660
|
}
|
|
8529
|
-
if (
|
|
8530
|
-
|
|
8531
|
-
placement: placement.value,
|
|
8532
|
-
});
|
|
8661
|
+
if (event.key === 'Escape') {
|
|
8662
|
+
setVisible(false);
|
|
8533
8663
|
}
|
|
8534
8664
|
};
|
|
8535
|
-
const
|
|
8536
|
-
if (
|
|
8537
|
-
|
|
8665
|
+
const handleMouseUp = (event) => {
|
|
8666
|
+
if (!dropdownToggleRef.value || !dropdownMenuRef.value) {
|
|
8667
|
+
return;
|
|
8668
|
+
}
|
|
8669
|
+
if (dropdownToggleRef.value.contains(event.target)) {
|
|
8670
|
+
return;
|
|
8671
|
+
}
|
|
8672
|
+
if (props.autoClose === true ||
|
|
8673
|
+
(props.autoClose === 'inside' &&
|
|
8674
|
+
dropdownMenuRef.value.contains(event.target)) ||
|
|
8675
|
+
(props.autoClose === 'outside' &&
|
|
8676
|
+
!dropdownMenuRef.value.contains(event.target))) {
|
|
8677
|
+
setVisible(false);
|
|
8678
|
+
return;
|
|
8538
8679
|
}
|
|
8539
|
-
popper.value = undefined;
|
|
8540
8680
|
};
|
|
8541
|
-
const
|
|
8681
|
+
const setVisible = (_visible) => {
|
|
8542
8682
|
if (props.disabled) {
|
|
8543
8683
|
return;
|
|
8544
8684
|
}
|
|
@@ -8552,38 +8692,7 @@ const CDropdown = vue.defineComponent({
|
|
|
8552
8692
|
}
|
|
8553
8693
|
visible.value = true;
|
|
8554
8694
|
};
|
|
8555
|
-
vue.provide('
|
|
8556
|
-
const hideMenu = () => {
|
|
8557
|
-
if (props.disabled) {
|
|
8558
|
-
return;
|
|
8559
|
-
}
|
|
8560
|
-
visible.value = false;
|
|
8561
|
-
};
|
|
8562
|
-
vue.provide('hideMenu', hideMenu);
|
|
8563
|
-
vue.watch(visible, () => {
|
|
8564
|
-
props.popper && (visible.value ? initPopper() : destroyPopper());
|
|
8565
|
-
visible.value ? emit('show') : emit('hide');
|
|
8566
|
-
});
|
|
8567
|
-
vue.onMounted(() => {
|
|
8568
|
-
if (props.direction === 'center') {
|
|
8569
|
-
placement.value = 'bottom';
|
|
8570
|
-
}
|
|
8571
|
-
if (props.direction === 'dropup') {
|
|
8572
|
-
placement.value = isRTL(dropdownMenuRef.value) ? 'top-end' : 'top-start';
|
|
8573
|
-
}
|
|
8574
|
-
if (props.direction === 'dropup-center') {
|
|
8575
|
-
placement.value = 'top';
|
|
8576
|
-
}
|
|
8577
|
-
if (props.direction === 'dropend') {
|
|
8578
|
-
placement.value = isRTL(dropdownMenuRef.value) ? 'left-start' : 'right-start';
|
|
8579
|
-
}
|
|
8580
|
-
if (props.direction === 'dropstart') {
|
|
8581
|
-
placement.value = isRTL(dropdownMenuRef.value) ? 'right-start' : 'left-start';
|
|
8582
|
-
}
|
|
8583
|
-
if (props.alignment === 'end') {
|
|
8584
|
-
placement.value = isRTL(dropdownMenuRef.value) ? 'bottom-start' : 'bottom-end';
|
|
8585
|
-
}
|
|
8586
|
-
});
|
|
8695
|
+
vue.provide('setVisible', setVisible);
|
|
8587
8696
|
return () => props.variant === 'input-group'
|
|
8588
8697
|
? [slots.default && slots.default()]
|
|
8589
8698
|
: vue.h('div', {
|
|
@@ -8676,12 +8785,10 @@ const CDropdownMenu = vue.defineComponent({
|
|
|
8676
8785
|
},
|
|
8677
8786
|
},
|
|
8678
8787
|
setup(props, { slots }) {
|
|
8679
|
-
const dropdownToggleRef = vue.inject('dropdownToggleRef');
|
|
8680
8788
|
const dropdownMenuRef = vue.inject('dropdownMenuRef');
|
|
8681
8789
|
const config = vue.inject('config'); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
8682
|
-
const hideMenu = vue.inject('hideMenu');
|
|
8683
8790
|
const visible = vue.inject('visible');
|
|
8684
|
-
const {
|
|
8791
|
+
const { alignment, dark, popper } = config;
|
|
8685
8792
|
// eslint-disable-next-line @typescript-eslint/ban-types, unicorn/consistent-function-scoping
|
|
8686
8793
|
const alignmentClassNames = (alignment) => {
|
|
8687
8794
|
const classNames = [];
|
|
@@ -8695,39 +8802,6 @@ const CDropdownMenu = vue.defineComponent({
|
|
|
8695
8802
|
}
|
|
8696
8803
|
return classNames;
|
|
8697
8804
|
};
|
|
8698
|
-
const handleKeyup = (event) => {
|
|
8699
|
-
if (autoClose === false) {
|
|
8700
|
-
return;
|
|
8701
|
-
}
|
|
8702
|
-
if (event.key === 'Escape') {
|
|
8703
|
-
hideMenu();
|
|
8704
|
-
}
|
|
8705
|
-
};
|
|
8706
|
-
const handleMouseUp = (event) => {
|
|
8707
|
-
if (dropdownToggleRef.value?.contains(event.target)) {
|
|
8708
|
-
return;
|
|
8709
|
-
}
|
|
8710
|
-
if (autoClose === true) {
|
|
8711
|
-
hideMenu();
|
|
8712
|
-
return;
|
|
8713
|
-
}
|
|
8714
|
-
if (autoClose === 'inside' && dropdownMenuRef.value?.contains(event.target)) {
|
|
8715
|
-
hideMenu();
|
|
8716
|
-
return;
|
|
8717
|
-
}
|
|
8718
|
-
if (autoClose === 'outside' &&
|
|
8719
|
-
!dropdownMenuRef.value?.contains(event.target)) {
|
|
8720
|
-
hideMenu();
|
|
8721
|
-
}
|
|
8722
|
-
};
|
|
8723
|
-
vue.onUpdated(() => {
|
|
8724
|
-
visible.value && window.addEventListener('mouseup', handleMouseUp);
|
|
8725
|
-
visible.value && window.addEventListener('keyup', handleKeyup);
|
|
8726
|
-
});
|
|
8727
|
-
vue.onUnmounted(() => {
|
|
8728
|
-
window.removeEventListener('mouseup', handleMouseUp);
|
|
8729
|
-
window.removeEventListener('keyup', handleKeyup);
|
|
8730
|
-
});
|
|
8731
8805
|
return () => vue.h(props.component, {
|
|
8732
8806
|
class: [
|
|
8733
8807
|
'dropdown-menu',
|
|
@@ -8824,7 +8898,7 @@ const CDropdownToggle = vue.defineComponent({
|
|
|
8824
8898
|
const dropdownToggleRef = vue.inject('dropdownToggleRef');
|
|
8825
8899
|
const dropdownVariant = vue.inject('variant');
|
|
8826
8900
|
const visible = vue.inject('visible');
|
|
8827
|
-
const
|
|
8901
|
+
const setVisible = vue.inject('setVisible');
|
|
8828
8902
|
const className = [
|
|
8829
8903
|
{
|
|
8830
8904
|
'dropdown-toggle': props.caret,
|
|
@@ -8839,7 +8913,7 @@ const CDropdownToggle = vue.defineComponent({
|
|
|
8839
8913
|
if (props.disabled) {
|
|
8840
8914
|
return;
|
|
8841
8915
|
}
|
|
8842
|
-
|
|
8916
|
+
setVisible();
|
|
8843
8917
|
},
|
|
8844
8918
|
}),
|
|
8845
8919
|
...((props.trigger === 'focus' || props.trigger.includes('focus')) && {
|
|
@@ -8847,13 +8921,13 @@ const CDropdownToggle = vue.defineComponent({
|
|
|
8847
8921
|
if (props.disabled) {
|
|
8848
8922
|
return;
|
|
8849
8923
|
}
|
|
8850
|
-
|
|
8924
|
+
setVisible(true);
|
|
8851
8925
|
},
|
|
8852
8926
|
onblur: () => {
|
|
8853
8927
|
if (props.disabled) {
|
|
8854
8928
|
return;
|
|
8855
8929
|
}
|
|
8856
|
-
|
|
8930
|
+
setVisible(false);
|
|
8857
8931
|
},
|
|
8858
8932
|
}),
|
|
8859
8933
|
};
|
|
@@ -9144,6 +9218,12 @@ const CFormCheck = vue.defineComponent({
|
|
|
9144
9218
|
* @see http://coreui.io/vue/docs/components/button.html
|
|
9145
9219
|
*/
|
|
9146
9220
|
button: Object,
|
|
9221
|
+
/**
|
|
9222
|
+
* Use in conjunction with the v-model directive to specify the value that should be assigned to the bound variable when the checkbox is in the `false` state.
|
|
9223
|
+
*
|
|
9224
|
+
* @since 4.9.0
|
|
9225
|
+
*/
|
|
9226
|
+
falseValue: String,
|
|
9147
9227
|
/**
|
|
9148
9228
|
* Provide valuable, actionable feedback.
|
|
9149
9229
|
*
|
|
@@ -9196,7 +9276,7 @@ const CFormCheck = vue.defineComponent({
|
|
|
9196
9276
|
* The default name for a value passed using v-model.
|
|
9197
9277
|
*/
|
|
9198
9278
|
modelValue: {
|
|
9199
|
-
type: [Boolean, String],
|
|
9279
|
+
type: [Array, Boolean, String],
|
|
9200
9280
|
value: undefined,
|
|
9201
9281
|
},
|
|
9202
9282
|
/**
|
|
@@ -9211,6 +9291,12 @@ const CFormCheck = vue.defineComponent({
|
|
|
9211
9291
|
* @since 4.3.0
|
|
9212
9292
|
*/
|
|
9213
9293
|
tooltipFeedback: Boolean,
|
|
9294
|
+
/**
|
|
9295
|
+
* Use in conjunction with the v-model directive to specify the value that should be assigned to the bound variable when the checkbox is in the `true` state.
|
|
9296
|
+
*
|
|
9297
|
+
* @since 4.9.0
|
|
9298
|
+
*/
|
|
9299
|
+
trueValue: String,
|
|
9214
9300
|
/**
|
|
9215
9301
|
* Specifies the type of component.
|
|
9216
9302
|
*
|
|
@@ -9241,8 +9327,28 @@ const CFormCheck = vue.defineComponent({
|
|
|
9241
9327
|
],
|
|
9242
9328
|
setup(props, { attrs, emit, slots }) {
|
|
9243
9329
|
const handleChange = (event) => {
|
|
9330
|
+
const target = event.target;
|
|
9244
9331
|
emit('change', event);
|
|
9245
|
-
|
|
9332
|
+
if (props.falseValue && props.trueValue) {
|
|
9333
|
+
emit('update:modelValue', target.checked ? props.trueValue : props.falseValue);
|
|
9334
|
+
return;
|
|
9335
|
+
}
|
|
9336
|
+
if (props.value && Array.isArray(props.modelValue)) {
|
|
9337
|
+
if (props.modelValue.includes(props.value)) {
|
|
9338
|
+
emit('update:modelValue', props.modelValue.filter((value) => value !== props.value));
|
|
9339
|
+
}
|
|
9340
|
+
else {
|
|
9341
|
+
emit('update:modelValue', [...props.modelValue, props.value]);
|
|
9342
|
+
}
|
|
9343
|
+
return;
|
|
9344
|
+
}
|
|
9345
|
+
if (props.value === undefined) {
|
|
9346
|
+
emit('update:modelValue', target.checked);
|
|
9347
|
+
return;
|
|
9348
|
+
}
|
|
9349
|
+
if (props.value && (props.modelValue === undefined || typeof props.modelValue === 'string')) {
|
|
9350
|
+
emit('update:modelValue', target.checked ? props.value : undefined);
|
|
9351
|
+
}
|
|
9246
9352
|
};
|
|
9247
9353
|
const className = [
|
|
9248
9354
|
'form-check',
|
|
@@ -9262,11 +9368,19 @@ const CFormCheck = vue.defineComponent({
|
|
|
9262
9368
|
'me-2': props.hitArea,
|
|
9263
9369
|
},
|
|
9264
9370
|
];
|
|
9265
|
-
const isChecked = vue.computed(() =>
|
|
9371
|
+
const isChecked = vue.computed(() => {
|
|
9372
|
+
if (Array.isArray(props.modelValue)) {
|
|
9373
|
+
return props.modelValue.includes(props.value);
|
|
9374
|
+
}
|
|
9375
|
+
if (typeof props.modelValue === 'string') {
|
|
9376
|
+
return props.modelValue === props.value;
|
|
9377
|
+
}
|
|
9378
|
+
return props.modelValue;
|
|
9379
|
+
});
|
|
9266
9380
|
const formControl = () => {
|
|
9267
9381
|
return vue.h('input', {
|
|
9268
9382
|
...attrs,
|
|
9269
|
-
...(props.modelValue && { checked: isChecked.value }),
|
|
9383
|
+
...(props.modelValue && props.value && { checked: isChecked.value }),
|
|
9270
9384
|
class: inputClassName,
|
|
9271
9385
|
id: props.id,
|
|
9272
9386
|
indeterminate: props.indeterminate,
|
|
@@ -11271,7 +11385,7 @@ const CMultiSelect = vue.defineComponent({
|
|
|
11271
11385
|
/**
|
|
11272
11386
|
* Allow users to create options if they are not in the list of options.
|
|
11273
11387
|
*
|
|
11274
|
-
* @since 4.9.0
|
|
11388
|
+
* @since 4.9.0
|
|
11275
11389
|
*/
|
|
11276
11390
|
allowCreateOptions: Boolean,
|
|
11277
11391
|
/**
|
|
@@ -11286,7 +11400,7 @@ const CMultiSelect = vue.defineComponent({
|
|
|
11286
11400
|
/**
|
|
11287
11401
|
* Clear current search on selecting an item.
|
|
11288
11402
|
*
|
|
11289
|
-
* @since 4.9.0
|
|
11403
|
+
* @since 4.9.0
|
|
11290
11404
|
*/
|
|
11291
11405
|
clearSearchOnSelect: Boolean,
|
|
11292
11406
|
/**
|
|
@@ -11330,7 +11444,7 @@ const CMultiSelect = vue.defineComponent({
|
|
|
11330
11444
|
/**
|
|
11331
11445
|
* When set, the options list will have a loading style: loading spinner and reduced opacity.
|
|
11332
11446
|
*
|
|
11333
|
-
* @since 4.9.0
|
|
11447
|
+
* @since 4.9.0
|
|
11334
11448
|
*/
|
|
11335
11449
|
loading: Boolean,
|
|
11336
11450
|
/**
|
|
@@ -12720,26 +12834,49 @@ const CProgressPlugin = {
|
|
|
12720
12834
|
},
|
|
12721
12835
|
};
|
|
12722
12836
|
|
|
12723
|
-
const getPlacement$1 = (placement, element) => {
|
|
12724
|
-
switch (placement) {
|
|
12725
|
-
case 'right': {
|
|
12726
|
-
return isRTL(element) ? 'left' : 'right';
|
|
12727
|
-
}
|
|
12728
|
-
case 'left': {
|
|
12729
|
-
return isRTL(element) ? 'right' : 'left';
|
|
12730
|
-
}
|
|
12731
|
-
default: {
|
|
12732
|
-
return placement;
|
|
12733
|
-
}
|
|
12734
|
-
}
|
|
12735
|
-
};
|
|
12736
12837
|
const CPopover = vue.defineComponent({
|
|
12737
12838
|
name: 'CPopover',
|
|
12738
12839
|
props: {
|
|
12840
|
+
/**
|
|
12841
|
+
* Apply a CSS fade transition to the popover.
|
|
12842
|
+
*
|
|
12843
|
+
* @since 4.9.0
|
|
12844
|
+
*/
|
|
12845
|
+
animation: {
|
|
12846
|
+
type: Boolean,
|
|
12847
|
+
default: true,
|
|
12848
|
+
},
|
|
12739
12849
|
/**
|
|
12740
12850
|
* Content for your component. If you want to pass non-string value please use dedicated slot `<template #content>...</template>`
|
|
12741
12851
|
*/
|
|
12742
12852
|
content: String,
|
|
12853
|
+
/**
|
|
12854
|
+
* The delay for displaying and hiding the popover (in milliseconds). When a numerical value is provided, the delay applies to both the hide and show actions. The object structure for specifying the delay is as follows: delay: `{ 'show': 500, 'hide': 100 }`.
|
|
12855
|
+
*
|
|
12856
|
+
* @since 4.9.0
|
|
12857
|
+
*/
|
|
12858
|
+
delay: {
|
|
12859
|
+
type: [Number, Object],
|
|
12860
|
+
default: 0,
|
|
12861
|
+
},
|
|
12862
|
+
/**
|
|
12863
|
+
* Specify the desired order of fallback placements by providing a list of placements as an array. The placements should be prioritized based on preference.
|
|
12864
|
+
*
|
|
12865
|
+
* @since 4.9.0
|
|
12866
|
+
*/
|
|
12867
|
+
fallbackPlacements: {
|
|
12868
|
+
type: [String, Array],
|
|
12869
|
+
default: () => ['top', 'right', 'bottom', 'left'],
|
|
12870
|
+
validator: (value) => {
|
|
12871
|
+
if (typeof value === 'string') {
|
|
12872
|
+
return ['top', 'right', 'bottom', 'left'].includes(value);
|
|
12873
|
+
}
|
|
12874
|
+
if (Array.isArray(value)) {
|
|
12875
|
+
return value.every((e) => ['top', 'right', 'bottom', 'left'].includes(e));
|
|
12876
|
+
}
|
|
12877
|
+
return false;
|
|
12878
|
+
},
|
|
12879
|
+
},
|
|
12743
12880
|
/**
|
|
12744
12881
|
* Offset of the popover relative to its target.
|
|
12745
12882
|
*/
|
|
@@ -12797,11 +12934,35 @@ const CPopover = vue.defineComponent({
|
|
|
12797
12934
|
setup(props, { attrs, slots, emit }) {
|
|
12798
12935
|
const togglerRef = vue.ref();
|
|
12799
12936
|
const popoverRef = vue.ref();
|
|
12800
|
-
const popper = vue.ref();
|
|
12801
12937
|
const visible = vue.ref(props.visible);
|
|
12938
|
+
const { initPopper, destroyPopper } = usePopper();
|
|
12939
|
+
const delay = typeof props.delay === 'number' ? { show: props.delay, hide: props.delay } : props.delay;
|
|
12940
|
+
const popperConfig = {
|
|
12941
|
+
modifiers: [
|
|
12942
|
+
{
|
|
12943
|
+
name: 'arrow',
|
|
12944
|
+
options: {
|
|
12945
|
+
element: '.popover-arrow',
|
|
12946
|
+
},
|
|
12947
|
+
},
|
|
12948
|
+
{
|
|
12949
|
+
name: 'flip',
|
|
12950
|
+
options: {
|
|
12951
|
+
fallbackPlacements: props.fallbackPlacements,
|
|
12952
|
+
},
|
|
12953
|
+
},
|
|
12954
|
+
{
|
|
12955
|
+
name: 'offset',
|
|
12956
|
+
options: {
|
|
12957
|
+
offset: props.offset,
|
|
12958
|
+
},
|
|
12959
|
+
},
|
|
12960
|
+
],
|
|
12961
|
+
placement: getRTLPlacement(props.placement, togglerRef.value),
|
|
12962
|
+
};
|
|
12802
12963
|
const handleEnter = (el, done) => {
|
|
12803
12964
|
emit('show');
|
|
12804
|
-
initPopper();
|
|
12965
|
+
initPopper(togglerRef.value, popoverRef.value, popperConfig);
|
|
12805
12966
|
el.classList.add('show');
|
|
12806
12967
|
executeAfterTransition(() => done(), el);
|
|
12807
12968
|
};
|
|
@@ -12813,30 +12974,17 @@ const CPopover = vue.defineComponent({
|
|
|
12813
12974
|
destroyPopper();
|
|
12814
12975
|
}, el);
|
|
12815
12976
|
};
|
|
12816
|
-
const
|
|
12977
|
+
const toggleVisible = (event, _visible) => {
|
|
12817
12978
|
togglerRef.value = event.target;
|
|
12818
|
-
|
|
12819
|
-
|
|
12820
|
-
|
|
12821
|
-
|
|
12822
|
-
|
|
12823
|
-
placement: getPlacement$1(props.placement, togglerRef.value),
|
|
12824
|
-
modifiers: [
|
|
12825
|
-
{
|
|
12826
|
-
name: 'offset',
|
|
12827
|
-
options: {
|
|
12828
|
-
offset: props.offset,
|
|
12829
|
-
},
|
|
12830
|
-
},
|
|
12831
|
-
],
|
|
12832
|
-
});
|
|
12833
|
-
}
|
|
12834
|
-
};
|
|
12835
|
-
const destroyPopper = () => {
|
|
12836
|
-
if (popper.value) {
|
|
12837
|
-
popper.value.destroy();
|
|
12979
|
+
if (_visible) {
|
|
12980
|
+
setTimeout(() => {
|
|
12981
|
+
visible.value = true;
|
|
12982
|
+
}, delay.show);
|
|
12983
|
+
return;
|
|
12838
12984
|
}
|
|
12839
|
-
|
|
12985
|
+
setTimeout(() => {
|
|
12986
|
+
visible.value = false;
|
|
12987
|
+
}, delay.hide);
|
|
12840
12988
|
};
|
|
12841
12989
|
return () => [
|
|
12842
12990
|
vue.h(vue.Teleport, {
|
|
@@ -12846,12 +12994,18 @@ const CPopover = vue.defineComponent({
|
|
|
12846
12994
|
onLeave: (el, done) => handleLeave(el, done),
|
|
12847
12995
|
}, () => visible.value &&
|
|
12848
12996
|
vue.h('div', {
|
|
12849
|
-
class:
|
|
12997
|
+
class: [
|
|
12998
|
+
'popover',
|
|
12999
|
+
'bs-popover-auto',
|
|
13000
|
+
{
|
|
13001
|
+
fade: props.animation,
|
|
13002
|
+
},
|
|
13003
|
+
],
|
|
12850
13004
|
ref: popoverRef,
|
|
12851
13005
|
role: 'tooltip',
|
|
12852
13006
|
...attrs,
|
|
12853
13007
|
}, [
|
|
12854
|
-
vue.h('div', { class: 'popover-arrow'
|
|
13008
|
+
vue.h('div', { class: 'popover-arrow' }),
|
|
12855
13009
|
(props.title || slots.title) &&
|
|
12856
13010
|
vue.h('div', { class: 'popover-header' }, {
|
|
12857
13011
|
default: () => (slots.title && slots.title()) || props.title,
|
|
@@ -12864,11 +13018,11 @@ const CPopover = vue.defineComponent({
|
|
|
12864
13018
|
slots.toggler &&
|
|
12865
13019
|
slots.toggler({
|
|
12866
13020
|
on: {
|
|
12867
|
-
click: (event) => props.trigger.includes('click') &&
|
|
12868
|
-
blur: (event) => props.trigger.includes('focus') &&
|
|
12869
|
-
focus: (event) => props.trigger.includes('focus') &&
|
|
12870
|
-
mouseenter: (event) => props.trigger.includes('hover') &&
|
|
12871
|
-
mouseleave: (event) => props.trigger.includes('hover') &&
|
|
13021
|
+
click: (event) => props.trigger.includes('click') && toggleVisible(event, !visible.value),
|
|
13022
|
+
blur: (event) => props.trigger.includes('focus') && toggleVisible(event, false),
|
|
13023
|
+
focus: (event) => props.trigger.includes('focus') && toggleVisible(event, true),
|
|
13024
|
+
mouseenter: (event) => props.trigger.includes('hover') && toggleVisible(event, true),
|
|
13025
|
+
mouseleave: (event) => props.trigger.includes('hover') && toggleVisible(event, false),
|
|
12872
13026
|
},
|
|
12873
13027
|
}),
|
|
12874
13028
|
];
|
|
@@ -15428,26 +15582,49 @@ const CToastPlugin = {
|
|
|
15428
15582
|
},
|
|
15429
15583
|
};
|
|
15430
15584
|
|
|
15431
|
-
const getPlacement = (placement, element) => {
|
|
15432
|
-
switch (placement) {
|
|
15433
|
-
case 'right': {
|
|
15434
|
-
return isRTL(element) ? 'left' : 'right';
|
|
15435
|
-
}
|
|
15436
|
-
case 'left': {
|
|
15437
|
-
return isRTL(element) ? 'right' : 'left';
|
|
15438
|
-
}
|
|
15439
|
-
default: {
|
|
15440
|
-
return placement;
|
|
15441
|
-
}
|
|
15442
|
-
}
|
|
15443
|
-
};
|
|
15444
15585
|
const CTooltip = vue.defineComponent({
|
|
15445
15586
|
name: 'CTooltip',
|
|
15446
15587
|
props: {
|
|
15588
|
+
/**
|
|
15589
|
+
* Apply a CSS fade transition to the tooltip.
|
|
15590
|
+
*
|
|
15591
|
+
* @since 4.9.0
|
|
15592
|
+
*/
|
|
15593
|
+
animation: {
|
|
15594
|
+
type: Boolean,
|
|
15595
|
+
default: true,
|
|
15596
|
+
},
|
|
15447
15597
|
/**
|
|
15448
15598
|
* Content for your component. If you want to pass non-string value please use dedicated slot `<template #content>...</template>`
|
|
15449
15599
|
*/
|
|
15450
15600
|
content: String,
|
|
15601
|
+
/**
|
|
15602
|
+
* The delay for displaying and hiding the popover (in milliseconds). When a numerical value is provided, the delay applies to both the hide and show actions. The object structure for specifying the delay is as follows: delay: `{ 'show': 500, 'hide': 100 }`.
|
|
15603
|
+
*
|
|
15604
|
+
* @since 4.9.0
|
|
15605
|
+
*/
|
|
15606
|
+
delay: {
|
|
15607
|
+
type: [Number, Object],
|
|
15608
|
+
default: 0,
|
|
15609
|
+
},
|
|
15610
|
+
/**
|
|
15611
|
+
* Specify the desired order of fallback placements by providing a list of placements as an array. The placements should be prioritized based on preference.
|
|
15612
|
+
*
|
|
15613
|
+
* @since 4.9.0
|
|
15614
|
+
*/
|
|
15615
|
+
fallbackPlacements: {
|
|
15616
|
+
type: [String, Array],
|
|
15617
|
+
default: () => ['top', 'right', 'bottom', 'left'],
|
|
15618
|
+
validator: (value) => {
|
|
15619
|
+
if (typeof value === 'string') {
|
|
15620
|
+
return ['top', 'right', 'bottom', 'left'].includes(value);
|
|
15621
|
+
}
|
|
15622
|
+
if (Array.isArray(value)) {
|
|
15623
|
+
return value.every((e) => ['top', 'right', 'bottom', 'left'].includes(e));
|
|
15624
|
+
}
|
|
15625
|
+
return false;
|
|
15626
|
+
},
|
|
15627
|
+
},
|
|
15451
15628
|
/**
|
|
15452
15629
|
* Offset of the tooltip relative to its target.
|
|
15453
15630
|
*/
|
|
@@ -15472,7 +15649,7 @@ const CTooltip = vue.defineComponent({
|
|
|
15472
15649
|
*/
|
|
15473
15650
|
trigger: {
|
|
15474
15651
|
type: [String, Array],
|
|
15475
|
-
default: 'hover',
|
|
15652
|
+
default: () => ['hover', 'focus'],
|
|
15476
15653
|
validator: (value) => {
|
|
15477
15654
|
if (typeof value === 'string') {
|
|
15478
15655
|
return ['click', 'focus', 'hover'].includes(value);
|
|
@@ -15501,11 +15678,35 @@ const CTooltip = vue.defineComponent({
|
|
|
15501
15678
|
setup(props, { attrs, slots, emit }) {
|
|
15502
15679
|
const togglerRef = vue.ref();
|
|
15503
15680
|
const tooltipRef = vue.ref();
|
|
15504
|
-
const popper = vue.ref();
|
|
15505
15681
|
const visible = vue.ref(props.visible);
|
|
15682
|
+
const { initPopper, destroyPopper } = usePopper();
|
|
15683
|
+
const delay = typeof props.delay === 'number' ? { show: props.delay, hide: props.delay } : props.delay;
|
|
15684
|
+
const popperConfig = {
|
|
15685
|
+
modifiers: [
|
|
15686
|
+
{
|
|
15687
|
+
name: 'arrow',
|
|
15688
|
+
options: {
|
|
15689
|
+
element: '.tooltip-arrow',
|
|
15690
|
+
},
|
|
15691
|
+
},
|
|
15692
|
+
{
|
|
15693
|
+
name: 'flip',
|
|
15694
|
+
options: {
|
|
15695
|
+
fallbackPlacements: props.fallbackPlacements,
|
|
15696
|
+
},
|
|
15697
|
+
},
|
|
15698
|
+
{
|
|
15699
|
+
name: 'offset',
|
|
15700
|
+
options: {
|
|
15701
|
+
offset: props.offset,
|
|
15702
|
+
},
|
|
15703
|
+
},
|
|
15704
|
+
],
|
|
15705
|
+
placement: getRTLPlacement(props.placement, togglerRef.value),
|
|
15706
|
+
};
|
|
15506
15707
|
const handleEnter = (el, done) => {
|
|
15507
15708
|
emit('show');
|
|
15508
|
-
initPopper();
|
|
15709
|
+
initPopper(togglerRef.value, tooltipRef.value, popperConfig);
|
|
15509
15710
|
el.classList.add('show');
|
|
15510
15711
|
executeAfterTransition(() => done(), el);
|
|
15511
15712
|
};
|
|
@@ -15517,30 +15718,17 @@ const CTooltip = vue.defineComponent({
|
|
|
15517
15718
|
destroyPopper();
|
|
15518
15719
|
}, el);
|
|
15519
15720
|
};
|
|
15520
|
-
const
|
|
15721
|
+
const toggleVisible = (event, _visible) => {
|
|
15521
15722
|
togglerRef.value = event.target;
|
|
15522
|
-
|
|
15523
|
-
|
|
15524
|
-
|
|
15525
|
-
|
|
15526
|
-
|
|
15527
|
-
placement: getPlacement(props.placement, togglerRef.value),
|
|
15528
|
-
modifiers: [
|
|
15529
|
-
{
|
|
15530
|
-
name: 'offset',
|
|
15531
|
-
options: {
|
|
15532
|
-
offset: props.offset,
|
|
15533
|
-
},
|
|
15534
|
-
},
|
|
15535
|
-
],
|
|
15536
|
-
});
|
|
15537
|
-
}
|
|
15538
|
-
};
|
|
15539
|
-
const destroyPopper = () => {
|
|
15540
|
-
if (popper.value) {
|
|
15541
|
-
popper.value.destroy();
|
|
15723
|
+
if (_visible) {
|
|
15724
|
+
setTimeout(() => {
|
|
15725
|
+
visible.value = true;
|
|
15726
|
+
}, delay.show);
|
|
15727
|
+
return;
|
|
15542
15728
|
}
|
|
15543
|
-
|
|
15729
|
+
setTimeout(() => {
|
|
15730
|
+
visible.value = false;
|
|
15731
|
+
}, delay.hide);
|
|
15544
15732
|
};
|
|
15545
15733
|
return () => [
|
|
15546
15734
|
vue.h(vue.Teleport, {
|
|
@@ -15550,12 +15738,18 @@ const CTooltip = vue.defineComponent({
|
|
|
15550
15738
|
onLeave: (el, done) => handleLeave(el, done),
|
|
15551
15739
|
}, () => visible.value &&
|
|
15552
15740
|
vue.h('div', {
|
|
15553
|
-
class:
|
|
15741
|
+
class: [
|
|
15742
|
+
'tooltip',
|
|
15743
|
+
'bs-tooltip-auto',
|
|
15744
|
+
{
|
|
15745
|
+
fade: props.animation,
|
|
15746
|
+
},
|
|
15747
|
+
],
|
|
15554
15748
|
ref: tooltipRef,
|
|
15555
15749
|
role: 'tooltip',
|
|
15556
15750
|
...attrs,
|
|
15557
15751
|
}, [
|
|
15558
|
-
vue.h('div', { class: 'tooltip-arrow'
|
|
15752
|
+
vue.h('div', { class: 'tooltip-arrow' }),
|
|
15559
15753
|
(props.content || slots.content) &&
|
|
15560
15754
|
vue.h('div', { class: 'tooltip-inner' }, {
|
|
15561
15755
|
default: () => (slots.content && slots.content()) || props.content,
|
|
@@ -15564,11 +15758,11 @@ const CTooltip = vue.defineComponent({
|
|
|
15564
15758
|
slots.toggler &&
|
|
15565
15759
|
slots.toggler({
|
|
15566
15760
|
on: {
|
|
15567
|
-
click: (event) => props.trigger.includes('click') &&
|
|
15568
|
-
blur: (event) => props.trigger.includes('focus') &&
|
|
15569
|
-
focus: (event) => props.trigger.includes('focus') &&
|
|
15570
|
-
mouseenter: (event) => props.trigger.includes('hover') &&
|
|
15571
|
-
mouseleave: (event) => props.trigger.includes('hover') &&
|
|
15761
|
+
click: (event) => props.trigger.includes('click') && toggleVisible(event, !visible.value),
|
|
15762
|
+
blur: (event) => props.trigger.includes('focus') && toggleVisible(event, false),
|
|
15763
|
+
focus: (event) => props.trigger.includes('focus') && toggleVisible(event, true),
|
|
15764
|
+
mouseenter: (event) => props.trigger.includes('hover') && toggleVisible(event, true),
|
|
15765
|
+
mouseleave: (event) => props.trigger.includes('hover') && toggleVisible(event, false),
|
|
15572
15766
|
},
|
|
15573
15767
|
}),
|
|
15574
15768
|
];
|
|
@@ -15673,7 +15867,7 @@ function isPlainObject(o) {
|
|
|
15673
15867
|
return true;
|
|
15674
15868
|
}
|
|
15675
15869
|
|
|
15676
|
-
function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);}return e},t.apply(this,arguments)}function n(e,t){if(null==e)return {};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(i[n]=e[n]);return i}const r={silent:!1,logLevel:"warn"},i=["validator"],o=Object.prototype,a=o.toString,s=o.hasOwnProperty,u=/^\s*function (\w+)/;function l(e){var t;const n=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:e;if(n){const e=n.toString().match(u);return e?e[1]:""}return ""}const c=isPlainObject,f=e=>e;let d=f;if("production"!==process.env.NODE_ENV){const e="undefined"!=typeof console;d=e?function(e,t=r.logLevel){!1===r.silent&&console[t](`[VueTypes warn]: ${e}`);}:f;}const p=(e,t)=>s.call(e,t),y=Number.isInteger||function(e){return "number"==typeof e&&isFinite(e)&&Math.floor(e)===e},v=Array.isArray||function(e){return "[object Array]"===a.call(e)},h=e=>"[object Function]"===a.call(e),b=(e,t)=>c(e)&&p(e,"_vueTypes_name")&&(!t||e._vueTypes_name===t),g=e=>c(e)&&(p(e,"type")||["_vueTypes_name","validator","default","required"].some(t=>p(e,t)));function O(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function m(e,t,n=!1){let r,i=!0,o="";r=c(e)?e:{type:e};const a=b(r)?r._vueTypes_name+" - ":"";if(g(r)&&null!==r.type){if(void 0===r.type||!0===r.type)return i;if(!r.required&&null==t)return i;v(r.type)?(i=r.type.some(e=>!0===m(e,t,!0)),o=r.type.map(e=>l(e)).join(" or ")):(o=l(r),i="Array"===o?v(t):"Object"===o?c(t):"String"===o||"Number"===o||"Boolean"===o||"Function"===o?function(e){if(null==e)return "";const t=e.constructor.toString().match(u);return t?t[1]:""}(t)===o:t instanceof r.type);}if(!i){const e=`${a}value "${t}" should be of type "${o}"`;return !1===n?(d(e),!1):e}if(p(r,"validator")&&h(r.validator)){const e=d,o=[];if(d=e=>{o.push(e);},i=r.validator(t),d=e,!i){const e=(o.length>1?"* ":"")+o.join("\n* ");return o.length=0,!1===n?(d(e),i):e}}return i}function j(e,t){const n=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get(){return this.required=!0,this}},def:{value(e){return void 0===e?this.type===Boolean||Array.isArray(this.type)&&this.type.includes(Boolean)?void(this.default=void 0):(p(this,"default")&&delete this.default,this):h(e)||!0===m(this,e,!0)?(this.default=v(e)?()=>[...e]:c(e)?()=>Object.assign({},e):e,this):(d(`${this._vueTypes_name} - invalid default value: "${e}"`),this)}}}),{validator:r}=n;return h(r)&&(n.validator=O(r,n)),n}function _(e,t){const n=j(e,t);return Object.defineProperty(n,"validate",{value(e){return h(this.validator)&&d(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:\n${JSON.stringify(this)}`),this.validator=O(e,this),this}})}function T(e,t,r){const o=function(e){const t={};return Object.getOwnPropertyNames(e).forEach(n=>{t[n]=Object.getOwnPropertyDescriptor(e,n);}),Object.defineProperties({},t)}(t);if(o._vueTypes_name=e,!c(r))return o;const{validator:a}=r,s=n(r,i);if(h(a)){let{validator:e}=o;e&&(e=null!==(l=(u=e).__original)&&void 0!==l?l:u),o.validator=O(e?function(t){return e.call(this,t)&&a.call(this,t)}:a,o);}var u,l;return Object.assign(o,s)}function $(e){return e.replace(/^(?!\s*$)/gm," ")}const w=()=>_("any",{}),x=()=>_("function",{type:Function}),P=()=>_("boolean",{type:Boolean}),A=()=>_("string",{type:String}),E=()=>_("number",{type:Number}),S=()=>_("array",{type:Array}),N=()=>_("object",{type:Object}),V=()=>j("integer",{type:Number,validator(e){const t=y(e);return !1===t&&d(`integer - "${e}" is not an integer`),t}}),q=()=>j("symbol",{validator(e){const t="symbol"==typeof e;return !1===t&&d(`symbol - invalid value "${e}"`),t}}),k=()=>Object.defineProperty({type:null,validator(e){const t=null===e;return !1===t&&d("nullable - value should be null"),t}},"_vueTypes_name",{value:"nullable"});function D(e,t="custom validation failed"){if("function"!=typeof e)throw new TypeError("[VueTypes error]: You must provide a function as argument");return j(e.name||"<<anonymous function>>",{type:null,validator(n){const r=e(n);return r||d(`${this._vueTypes_name} - ${t}`),r}})}function L(e){if(!v(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");const t=`oneOf - value should be one of "${e.map(e=>"symbol"==typeof e?e.toString():e).join('", "')}".`,n={validator(n){const r=-1!==e.indexOf(n);return r||d(t),r}};if(-1===e.indexOf(null)){const t=e.reduce((e,t)=>{if(null!=t){const n=t.constructor;-1===e.indexOf(n)&&e.push(n);}return e},[]);t.length>0&&(n.type=t);}return j("oneOf",n)}function B(e){if(!v(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");let t=!1,n=!1,r=[];for(let i=0;i<e.length;i+=1){const o=e[i];if(g(o)){if(h(o.validator)&&(t=!0),b(o,"oneOf")&&o.type){r=r.concat(o.type);continue}if(b(o,"nullable")){n=!0;continue}if(!0===o.type||!o.type){d('oneOfType - invalid usage of "true" and "null" as types.');continue}r=r.concat(o.type);}else r.push(o);}r=r.filter((e,t)=>r.indexOf(e)===t);const i=!1===n&&r.length>0?r:null;return j("oneOfType",t?{type:i,validator(t){const n=[],r=e.some(e=>{const r=m(e,t,!0);return "string"==typeof r&&n.push(r),!0===r});return r||d(`oneOfType - provided value does not match any of the ${n.length} passed-in validators:\n${$(n.join("\n"))}`),r}}:{type:i})}function F(e){return j("arrayOf",{type:Array,validator(t){let n="";const r=t.every(t=>(n=m(e,t,!0),!0===n));return r||d(`arrayOf - value validation error:\n${$(n)}`),r}})}function Y(e){return j("instanceOf",{type:e})}function I(e){return j("objectOf",{type:Object,validator(t){let n="";const r=Object.keys(t).every(r=>(n=m(e,t[r],!0),!0===n));return r||d(`objectOf - value validation error:\n${$(n)}`),r}})}function J(e){const t=Object.keys(e),n=t.filter(t=>{var n;return !(null===(n=e[t])||void 0===n||!n.required)}),r=j("shape",{type:Object,validator(r){if(!c(r))return !1;const i=Object.keys(r);if(n.length>0&&n.some(e=>-1===i.indexOf(e))){const e=n.filter(e=>-1===i.indexOf(e));return d(1===e.length?`shape - required property "${e[0]}" is not defined.`:`shape - required properties "${e.join('", "')}" are not defined.`),!1}return i.every(n=>{if(-1===t.indexOf(n))return !0===this._vueTypes_isLoose||(d(`shape - shape definition does not include a "${n}" property. Allowed keys: "${t.join('", "')}".`),!1);const i=m(e[n],r[n],!0);return "string"==typeof i&&d(`shape - "${n}" property validation error:\n ${$(i)}`),!0===i})}});return Object.defineProperty(r,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(r,"loose",{get(){return this._vueTypes_isLoose=!0,this}}),r}const M=["name","validate","getter"],R=/*#__PURE__*/(()=>{var e;return (e=class{static get any(){return w()}static get func(){return x().def(this.defaults.func)}static get bool(){return void 0===this.defaults.bool?P():P().def(this.defaults.bool)}static get string(){return A().def(this.defaults.string)}static get number(){return E().def(this.defaults.number)}static get array(){return S().def(this.defaults.array)}static get object(){return N().def(this.defaults.object)}static get integer(){return V().def(this.defaults.integer)}static get symbol(){return q()}static get nullable(){return k()}static extend(e){if(d("VueTypes.extend is deprecated. Use the ES6+ method instead. See https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#extending-namespaced-validators-in-es6 for details."),v(e))return e.forEach(e=>this.extend(e)),this;const{name:t,validate:r=!1,getter:i=!1}=e,o=n(e,M);if(p(this,t))throw new TypeError(`[VueTypes error]: Type "${t}" already defined`);const{type:a}=o;if(b(a))return delete o.type,Object.defineProperty(this,t,i?{get:()=>T(t,a,o)}:{value(...e){const n=T(t,a,o);return n.validator&&(n.validator=n.validator.bind(n,...e)),n}});let s;return s=i?{get(){const e=Object.assign({},o);return r?_(t,e):j(t,e)},enumerable:!0}:{value(...e){const n=Object.assign({},o);let i;return i=r?_(t,n):j(t,n),n.validator&&(i.validator=n.validator.bind(i,...e)),i},enumerable:!0},Object.defineProperty(this,t,s)}}).defaults={},e.sensibleDefaults=void 0,e.config=r,e.custom=D,e.oneOf=L,e.instanceOf=Y,e.oneOfType=B,e.arrayOf=F,e.objectOf=I,e.shape=J,e.utils={validate:(e,t)=>!0===m(t,e,!0),toType:(e,t,n=!1)=>n?_(e,t):j(e,t)},e})();function U(e={func:()=>{},bool:!0,string:"",number:0,array:()=>[],object:()=>({}),integer:0}){var n;return (n=class extends R{static get sensibleDefaults(){return t({},this.defaults)}static set sensibleDefaults(n){this.defaults=!1!==n?t({},!0!==n?n:e):{};}}).defaults=t({},e),n}class z extends(U()){}
|
|
15870
|
+
function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);}return e},t.apply(this,arguments)}function n(e,t){if(null==e)return {};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(i[n]=e[n]);return i}const r={silent:!1,logLevel:"warn"},i=["validator"],o=Object.prototype,a=o.toString,s=o.hasOwnProperty,u=/^\s*function (\w+)/;function l(e){var t;const n=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:e;if(n){const e=n.toString().match(u);return e?e[1]:""}return ""}const c=isPlainObject,f=e=>e;let d=f;if("production"!==process.env.NODE_ENV){const e="undefined"!=typeof console;d=e?function(e,t=r.logLevel){!1===r.silent&&console[t](`[VueTypes warn]: ${e}`);}:f;}const p=(e,t)=>s.call(e,t),y=Number.isInteger||function(e){return "number"==typeof e&&isFinite(e)&&Math.floor(e)===e},v=Array.isArray||function(e){return "[object Array]"===a.call(e)},h=e=>"[object Function]"===a.call(e),b=(e,t)=>c(e)&&p(e,"_vueTypes_name")&&(!t||e._vueTypes_name===t),g=e=>c(e)&&(p(e,"type")||["_vueTypes_name","validator","default","required"].some(t=>p(e,t)));function O(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function m(e,t,n=!1){let r,i=!0,o="";r=c(e)?e:{type:e};const a=b(r)?r._vueTypes_name+" - ":"";if(g(r)&&null!==r.type){if(void 0===r.type||!0===r.type)return i;if(!r.required&&null==t)return i;v(r.type)?(i=r.type.some(e=>!0===m(e,t,!0)),o=r.type.map(e=>l(e)).join(" or ")):(o=l(r),i="Array"===o?v(t):"Object"===o?c(t):"String"===o||"Number"===o||"Boolean"===o||"Function"===o?function(e){if(null==e)return "";const t=e.constructor.toString().match(u);return t?t[1].replace(/^Async/,""):""}(t)===o:t instanceof r.type);}if(!i){const e=`${a}value "${t}" should be of type "${o}"`;return !1===n?(d(e),!1):e}if(p(r,"validator")&&h(r.validator)){const e=d,o=[];if(d=e=>{o.push(e);},i=r.validator(t),d=e,!i){const e=(o.length>1?"* ":"")+o.join("\n* ");return o.length=0,!1===n?(d(e),i):e}}return i}function j(e,t){const n=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get(){return this.required=!0,this}},def:{value(e){return void 0===e?this.type===Boolean||Array.isArray(this.type)&&this.type.includes(Boolean)?void(this.default=void 0):(p(this,"default")&&delete this.default,this):h(e)||!0===m(this,e,!0)?(this.default=v(e)?()=>[...e]:c(e)?()=>Object.assign({},e):e,this):(d(`${this._vueTypes_name} - invalid default value: "${e}"`),this)}}}),{validator:r}=n;return h(r)&&(n.validator=O(r,n)),n}function _(e,t){const n=j(e,t);return Object.defineProperty(n,"validate",{value(e){return h(this.validator)&&d(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:\n${JSON.stringify(this)}`),this.validator=O(e,this),this}})}function T(e,t,r){const o=function(e){const t={};return Object.getOwnPropertyNames(e).forEach(n=>{t[n]=Object.getOwnPropertyDescriptor(e,n);}),Object.defineProperties({},t)}(t);if(o._vueTypes_name=e,!c(r))return o;const{validator:a}=r,s=n(r,i);if(h(a)){let{validator:e}=o;e&&(e=null!==(l=(u=e).__original)&&void 0!==l?l:u),o.validator=O(e?function(t){return e.call(this,t)&&a.call(this,t)}:a,o);}var u,l;return Object.assign(o,s)}function $(e){return e.replace(/^(?!\s*$)/gm," ")}const w=()=>_("any",{}),x=()=>_("function",{type:Function}),P=()=>_("boolean",{type:Boolean}),A=()=>_("string",{type:String}),E=()=>_("number",{type:Number}),S=()=>_("array",{type:Array}),N=()=>_("object",{type:Object}),V=()=>j("integer",{type:Number,validator(e){const t=y(e);return !1===t&&d(`integer - "${e}" is not an integer`),t}}),q=()=>j("symbol",{validator(e){const t="symbol"==typeof e;return !1===t&&d(`symbol - invalid value "${e}"`),t}}),k=()=>Object.defineProperty({type:null,validator(e){const t=null===e;return !1===t&&d("nullable - value should be null"),t}},"_vueTypes_name",{value:"nullable"});function D(e,t="custom validation failed"){if("function"!=typeof e)throw new TypeError("[VueTypes error]: You must provide a function as argument");return j(e.name||"<<anonymous function>>",{type:null,validator(n){const r=e(n);return r||d(`${this._vueTypes_name} - ${t}`),r}})}function L(e){if(!v(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");const t=`oneOf - value should be one of "${e.map(e=>"symbol"==typeof e?e.toString():e).join('", "')}".`,n={validator(n){const r=-1!==e.indexOf(n);return r||d(t),r}};if(-1===e.indexOf(null)){const t=e.reduce((e,t)=>{if(null!=t){const n=t.constructor;-1===e.indexOf(n)&&e.push(n);}return e},[]);t.length>0&&(n.type=t);}return j("oneOf",n)}function B(e){if(!v(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");let t=!1,n=!1,r=[];for(let i=0;i<e.length;i+=1){const o=e[i];if(g(o)){if(h(o.validator)&&(t=!0),b(o,"oneOf")&&o.type){r=r.concat(o.type);continue}if(b(o,"nullable")){n=!0;continue}if(!0===o.type||!o.type){d('oneOfType - invalid usage of "true" and "null" as types.');continue}r=r.concat(o.type);}else r.push(o);}r=r.filter((e,t)=>r.indexOf(e)===t);const i=!1===n&&r.length>0?r:null;return j("oneOfType",t?{type:i,validator(t){const n=[],r=e.some(e=>{const r=m(e,t,!0);return "string"==typeof r&&n.push(r),!0===r});return r||d(`oneOfType - provided value does not match any of the ${n.length} passed-in validators:\n${$(n.join("\n"))}`),r}}:{type:i})}function F(e){return j("arrayOf",{type:Array,validator(t){let n="";const r=t.every(t=>(n=m(e,t,!0),!0===n));return r||d(`arrayOf - value validation error:\n${$(n)}`),r}})}function Y(e){return j("instanceOf",{type:e})}function I(e){return j("objectOf",{type:Object,validator(t){let n="";const r=Object.keys(t).every(r=>(n=m(e,t[r],!0),!0===n));return r||d(`objectOf - value validation error:\n${$(n)}`),r}})}function J(e){const t=Object.keys(e),n=t.filter(t=>{var n;return !(null===(n=e[t])||void 0===n||!n.required)}),r=j("shape",{type:Object,validator(r){if(!c(r))return !1;const i=Object.keys(r);if(n.length>0&&n.some(e=>-1===i.indexOf(e))){const e=n.filter(e=>-1===i.indexOf(e));return d(1===e.length?`shape - required property "${e[0]}" is not defined.`:`shape - required properties "${e.join('", "')}" are not defined.`),!1}return i.every(n=>{if(-1===t.indexOf(n))return !0===this._vueTypes_isLoose||(d(`shape - shape definition does not include a "${n}" property. Allowed keys: "${t.join('", "')}".`),!1);const i=m(e[n],r[n],!0);return "string"==typeof i&&d(`shape - "${n}" property validation error:\n ${$(i)}`),!0===i})}});return Object.defineProperty(r,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(r,"loose",{get(){return this._vueTypes_isLoose=!0,this}}),r}const M=["name","validate","getter"],R=/*#__PURE__*/(()=>{var e;return (e=class{static get any(){return w()}static get func(){return x().def(this.defaults.func)}static get bool(){return void 0===this.defaults.bool?P():P().def(this.defaults.bool)}static get string(){return A().def(this.defaults.string)}static get number(){return E().def(this.defaults.number)}static get array(){return S().def(this.defaults.array)}static get object(){return N().def(this.defaults.object)}static get integer(){return V().def(this.defaults.integer)}static get symbol(){return q()}static get nullable(){return k()}static extend(e){if(d("VueTypes.extend is deprecated. Use the ES6+ method instead. See https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#extending-namespaced-validators-in-es6 for details."),v(e))return e.forEach(e=>this.extend(e)),this;const{name:t,validate:r=!1,getter:i=!1}=e,o=n(e,M);if(p(this,t))throw new TypeError(`[VueTypes error]: Type "${t}" already defined`);const{type:a}=o;if(b(a))return delete o.type,Object.defineProperty(this,t,i?{get:()=>T(t,a,o)}:{value(...e){const n=T(t,a,o);return n.validator&&(n.validator=n.validator.bind(n,...e)),n}});let s;return s=i?{get(){const e=Object.assign({},o);return r?_(t,e):j(t,e)},enumerable:!0}:{value(...e){const n=Object.assign({},o);let i;return i=r?_(t,n):j(t,n),n.validator&&(i.validator=n.validator.bind(i,...e)),i},enumerable:!0},Object.defineProperty(this,t,s)}}).defaults={},e.sensibleDefaults=void 0,e.config=r,e.custom=D,e.oneOf=L,e.instanceOf=Y,e.oneOfType=B,e.arrayOf=F,e.objectOf=I,e.shape=J,e.utils={validate:(e,t)=>!0===m(t,e,!0),toType:(e,t,n=!1)=>n?_(e,t):j(e,t)},e})();function U(e={func:()=>{},bool:!0,string:"",number:0,array:()=>[],object:()=>({}),integer:0}){var n;return (n=class extends R{static get sensibleDefaults(){return t({},this.defaults)}static set sensibleDefaults(n){this.defaults=!1!==n?t({},!0!==n?n:e):{};}}).defaults=t({},e),n}class z extends(U()){}
|
|
15677
15871
|
|
|
15678
15872
|
const CWidgetStatsB = vue.defineComponent({
|
|
15679
15873
|
name: 'CWidgetStatsB',
|
|
@@ -16413,54 +16607,6 @@ var Directives = /*#__PURE__*/Object.freeze({
|
|
|
16413
16607
|
vctooltip: vCTooltip
|
|
16414
16608
|
});
|
|
16415
16609
|
|
|
16416
|
-
const getStoredTheme = (localStorageItemName) => typeof window !== 'undefined' && localStorage.getItem(localStorageItemName);
|
|
16417
|
-
const setStoredTheme = (localStorageItemName, colorMode) => localStorage.setItem(localStorageItemName, colorMode);
|
|
16418
|
-
const getPreferredColorScheme = (localStorageItemName) => {
|
|
16419
|
-
if (typeof window === 'undefined') {
|
|
16420
|
-
return;
|
|
16421
|
-
}
|
|
16422
|
-
const storedTheme = getStoredTheme(localStorageItemName);
|
|
16423
|
-
if (storedTheme) {
|
|
16424
|
-
return storedTheme;
|
|
16425
|
-
}
|
|
16426
|
-
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
16427
|
-
};
|
|
16428
|
-
const setTheme = (colorMode) => {
|
|
16429
|
-
document.documentElement.dataset.coreuiTheme =
|
|
16430
|
-
colorMode === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
16431
|
-
? 'dark'
|
|
16432
|
-
: colorMode;
|
|
16433
|
-
const event = new Event('ColorSchemeChange');
|
|
16434
|
-
document.documentElement.dispatchEvent(event);
|
|
16435
|
-
};
|
|
16436
|
-
const useColorModes = (localStorageItemName = 'coreui-vue-color-scheme') => {
|
|
16437
|
-
const colorMode = vue.ref(getPreferredColorScheme(localStorageItemName));
|
|
16438
|
-
vue.watch(colorMode, () => {
|
|
16439
|
-
if (colorMode.value) {
|
|
16440
|
-
setStoredTheme(localStorageItemName, colorMode.value);
|
|
16441
|
-
setTheme(colorMode.value);
|
|
16442
|
-
}
|
|
16443
|
-
});
|
|
16444
|
-
vue.onBeforeMount(() => {
|
|
16445
|
-
if (typeof getStoredTheme(localStorageItemName) === 'string' && colorMode.value) {
|
|
16446
|
-
setTheme(colorMode.value);
|
|
16447
|
-
}
|
|
16448
|
-
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
|
|
16449
|
-
const storedTheme = getStoredTheme(localStorageItemName);
|
|
16450
|
-
if (storedTheme !== 'light' && storedTheme !== 'dark' && colorMode.value) {
|
|
16451
|
-
setTheme(colorMode.value);
|
|
16452
|
-
}
|
|
16453
|
-
});
|
|
16454
|
-
});
|
|
16455
|
-
return {
|
|
16456
|
-
getColorMode: () => colorMode.value,
|
|
16457
|
-
isColorModeSet: () => Boolean(getStoredTheme(localStorageItemName)),
|
|
16458
|
-
setColorMode: (mode) => {
|
|
16459
|
-
colorMode.value = mode;
|
|
16460
|
-
},
|
|
16461
|
-
};
|
|
16462
|
-
};
|
|
16463
|
-
|
|
16464
16610
|
const CoreuiVue = {
|
|
16465
16611
|
install: (app) => {
|
|
16466
16612
|
for (const key in Components) {
|
|
@@ -16653,6 +16799,7 @@ exports.CWidgetStatsF = CWidgetStatsF;
|
|
|
16653
16799
|
exports.CWidgetsStatsPlugin = CWidgetsStatsPlugin;
|
|
16654
16800
|
exports.default = CoreuiVue;
|
|
16655
16801
|
exports.useColorModes = useColorModes;
|
|
16802
|
+
exports.usePopper = usePopper;
|
|
16656
16803
|
exports.vcplaceholder = vCPlaceholder;
|
|
16657
16804
|
exports.vcpopover = vCPopover;
|
|
16658
16805
|
exports.vctooltip = vCTooltip;
|