@coreui/vue-pro 4.9.0-beta.2 → 4.9.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.
Files changed (34) hide show
  1. package/README.md +1 -1
  2. package/dist/components/dropdown/CDropdown.d.ts +62 -4
  3. package/dist/components/dropdown/CDropdownToggle.d.ts +1 -1
  4. package/dist/components/multi-select/CMultiSelect.d.ts +6 -6
  5. package/dist/components/popover/CPopover.d.ts +75 -6
  6. package/dist/components/toast/CToast.d.ts +1 -1
  7. package/dist/components/tooltip/CTooltip.d.ts +77 -8
  8. package/dist/composables/index.d.ts +2 -2
  9. package/dist/composables/useColorModes.d.ts +1 -1
  10. package/dist/composables/usePopper.d.ts +6 -0
  11. package/dist/index.es.js +424 -325
  12. package/dist/index.es.js.map +1 -1
  13. package/dist/index.js +423 -324
  14. package/dist/index.js.map +1 -1
  15. package/dist/types.d.ts +1 -1
  16. package/dist/utils/getRTLPlacement.d.ts +3 -0
  17. package/dist/utils/index.d.ts +2 -1
  18. package/package.json +10 -10
  19. package/src/components/date-range-picker/CDateRangePicker.ts +50 -17
  20. package/src/components/dropdown/CDropdown.ts +116 -61
  21. package/src/components/dropdown/CDropdownMenu.ts +2 -47
  22. package/src/components/dropdown/CDropdownToggle.ts +5 -5
  23. package/src/components/multi-select/CMultiSelect.ts +58 -67
  24. package/src/components/multi-select/CMultiSelectSelection.ts +10 -11
  25. package/src/components/picker/CPicker.ts +22 -7
  26. package/src/components/popover/CPopover.ts +96 -50
  27. package/src/components/time-picker/CTimePicker.ts +63 -34
  28. package/src/components/tooltip/CTooltip.ts +97 -51
  29. package/src/composables/index.ts +2 -2
  30. package/src/composables/usePopper.ts +25 -0
  31. package/src/types.ts +1 -1
  32. package/src/utils/getRTLPlacement.ts +18 -0
  33. package/src/utils/index.ts +2 -1
  34. package/src/composables/useColorModes.ts +0 -62
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, provide, h as h$1, Transition, withDirectives, inject, watch, onBeforeMount, onMounted, onUpdated, toRefs, cloneVNode, onUnmounted, nextTick, computed, vShow, onBeforeUnmount, Teleport } from 'vue';
1
+ import { defineComponent, ref, provide, h as h$1, Transition, withDirectives, inject, watch, onBeforeMount, onMounted, onUpdated, toRefs, cloneVNode, nextTick, computed, vShow, onBeforeUnmount, Teleport } from 'vue';
2
2
 
3
3
  const CAccordion = defineComponent({
4
4
  name: 'CAccordion',
@@ -1827,6 +1827,30 @@ const CCardPlugin = {
1827
1827
  },
1828
1828
  };
1829
1829
 
1830
+ const isRTL = (element) => {
1831
+ if (typeof document !== 'undefined' && document.documentElement.dir === 'rtl') {
1832
+ return true;
1833
+ }
1834
+ if (element) {
1835
+ return element.closest('[dir="rtl"]') !== null;
1836
+ }
1837
+ return false;
1838
+ };
1839
+
1840
+ const getRTLPlacement = (placement, element) => {
1841
+ switch (placement) {
1842
+ case 'right': {
1843
+ return isRTL(element) ? 'left' : 'right';
1844
+ }
1845
+ case 'left': {
1846
+ return isRTL(element) ? 'right' : 'left';
1847
+ }
1848
+ default: {
1849
+ return placement;
1850
+ }
1851
+ }
1852
+ };
1853
+
1830
1854
  const getUID = (prefix) => {
1831
1855
  do {
1832
1856
  prefix += Math.floor(Math.random() * 1_000_000);
@@ -1853,16 +1877,6 @@ const isObjectInArray = (array, item, ignore = []) => array.some((_item) => {
1853
1877
  return result;
1854
1878
  });
1855
1879
 
1856
- const isRTL = (element) => {
1857
- if (typeof document !== 'undefined' && document.documentElement.dir === 'rtl') {
1858
- return true;
1859
- }
1860
- if (element) {
1861
- return element.closest('[dir="rtl"]') !== null;
1862
- }
1863
- return false;
1864
- };
1865
-
1866
1880
  const CCarousel = defineComponent({
1867
1881
  name: 'CCarousel',
1868
1882
  props: {
@@ -6485,6 +6499,8 @@ const CPicker = defineComponent({
6485
6499
  default: {
6486
6500
  return () => h$1('div', {
6487
6501
  class: [
6502
+ 'dropdown',
6503
+ 'picker',
6488
6504
  attrs.class,
6489
6505
  {
6490
6506
  show: visible.value,
@@ -6506,7 +6522,16 @@ const CPicker = defineComponent({
6506
6522
  togglerRef.value = el;
6507
6523
  },
6508
6524
  })),
6509
- h$1('div', { class: props.dropdownClassNames, ref: dropdownRef }, [
6525
+ h$1('div', {
6526
+ class: [
6527
+ 'dropdown-menu',
6528
+ {
6529
+ show: visible.value,
6530
+ },
6531
+ props.dropdownClassNames,
6532
+ ],
6533
+ ref: dropdownRef,
6534
+ }, [
6510
6535
  slots.default && slots.default(),
6511
6536
  /**
6512
6537
  * @slot Location for the footer element.
@@ -7006,10 +7031,18 @@ const CTimePicker = defineComponent({
7006
7031
  emit('change', _date.toTimeString(), _date.toLocaleTimeString(props.locale), _date);
7007
7032
  emit('update:time', _date.toLocaleTimeString(props.locale));
7008
7033
  };
7009
- const InputGroup = () => h$1('div', { class: 'time-picker-input-group' }, [
7034
+ const InputGroup = () => h$1('div', {
7035
+ class: [
7036
+ 'input-group',
7037
+ 'picker-input-group',
7038
+ {
7039
+ [`input-group-${props.size}`]: props.size,
7040
+ },
7041
+ ],
7042
+ }, [
7010
7043
  h$1('input', {
7011
7044
  autocomplete: 'off',
7012
- class: 'time-picker-input',
7045
+ class: 'form-control',
7013
7046
  disabled: props.disabled,
7014
7047
  onInput: (event) => {
7015
7048
  if (isValidTime(event.target.value)) {
@@ -7027,18 +7060,28 @@ const CTimePicker = defineComponent({
7027
7060
  })
7028
7061
  : '',
7029
7062
  }),
7030
- props.indicator && h$1('div', { class: 'time-picker-indicator' }),
7031
- props.cleaner &&
7032
- date.value &&
7033
- h$1('div', {
7034
- class: 'time-picker-cleaner',
7035
- onClick: (event) => handleClear(event),
7036
- }),
7063
+ (props.indicator || props.cleaner) &&
7064
+ h$1('div', { class: 'input-group-text' }, [
7065
+ props.indicator &&
7066
+ h$1('span', {
7067
+ class: 'picker-input-group-indicator',
7068
+ }, slots.indicator
7069
+ ? slots.indicator()
7070
+ : h$1('span', { class: 'picker-input-group-icon time-picker-input-icon' })),
7071
+ props.cleaner &&
7072
+ h$1('span', {
7073
+ class: 'picker-input-group-cleaner',
7074
+ onClick: (event) => handleClear(event),
7075
+ role: 'button',
7076
+ }, slots.cleaner
7077
+ ? slots.cleaner()
7078
+ : h$1('span', { class: 'picker-input-group-icon time-picker-cleaner-icon' })),
7079
+ ]),
7037
7080
  ]);
7038
7081
  const TimePickerSelect = () => [
7039
7082
  h$1('span', { class: 'time-picker-inline-icon' }),
7040
7083
  h$1('select', {
7041
- class: 'time-picker-inline-select',
7084
+ class: 'form-select',
7042
7085
  disabled: props.disabled,
7043
7086
  onChange: (event) => handleTimeChange('hours', event.target.value),
7044
7087
  ...(date.value && { value: getSelectedHour(date.value, props.locale) }),
@@ -7048,7 +7091,7 @@ const CTimePicker = defineComponent({
7048
7091
  }, option.label))),
7049
7092
  ':',
7050
7093
  h$1('select', {
7051
- class: 'time-picker-inline-select',
7094
+ class: 'form-select',
7052
7095
  disabled: props.disabled,
7053
7096
  onChange: (event) => handleTimeChange('minutes', event.target.value),
7054
7097
  ...(date.value && { value: getSelectedMinutes(date.value) }),
@@ -7059,7 +7102,7 @@ const CTimePicker = defineComponent({
7059
7102
  props.seconds && ':',
7060
7103
  props.seconds &&
7061
7104
  h$1('select', {
7062
- class: 'time-picker-inline-select',
7105
+ class: 'form-select',
7063
7106
  disabled: props.disabled,
7064
7107
  onChange: (event) => handleTimeChange('seconds', event.target.value),
7065
7108
  ...(date.value && { value: getSelectedSeconds(date.value) }),
@@ -7070,7 +7113,7 @@ const CTimePicker = defineComponent({
7070
7113
  localizedTimePartials.value &&
7071
7114
  localizedTimePartials.value.hour12 &&
7072
7115
  h$1('select', {
7073
- class: 'time-picker-inline-select',
7116
+ class: 'form-select',
7074
7117
  disabled: props.disabled,
7075
7118
  onChange: (event) => handleTimeChange('toggle', event.target.value),
7076
7119
  value: ampm.value,
@@ -7127,7 +7170,6 @@ const CTimePicker = defineComponent({
7127
7170
  class: [
7128
7171
  'time-picker',
7129
7172
  {
7130
- [`time-picker-${props.size}`]: props.size,
7131
7173
  disabled: props.disabled,
7132
7174
  'is-invalid': isValid.value === false ? true : false,
7133
7175
  'is-valid': isValid.value,
@@ -7165,7 +7207,7 @@ const CTimePicker = defineComponent({
7165
7207
  },
7166
7208
  ],
7167
7209
  }, props.variant === 'select' ? TimePickerSelect() : TimePickerRoll()),
7168
- footer: () => h$1('div', { class: 'time-picker-footer' }, [
7210
+ footer: () => h$1('div', { class: 'picker-footer' }, [
7169
7211
  props.cancelButton &&
7170
7212
  h$1(CButton, {
7171
7213
  color: props.cancelButtonColor,
@@ -7704,14 +7746,16 @@ const CDateRangePicker = defineComponent({
7704
7746
  });
7705
7747
  watch(() => props.startDate, () => {
7706
7748
  if (props.startDate) {
7707
- calendarDate.value = new Date(props.startDate);
7708
- startDate.value = new Date(props.startDate);
7749
+ const date = new Date(props.startDate);
7750
+ calendarDate.value = date;
7751
+ startDate.value = date;
7709
7752
  }
7710
7753
  });
7711
7754
  watch(() => props.endDate, () => {
7712
7755
  if (props.endDate) {
7713
- calendarDate.value = new Date(props.endDate);
7714
- endDate.value = new Date(props.endDate);
7756
+ const date = new Date(props.endDate);
7757
+ calendarDate.value = date;
7758
+ endDate.value = date;
7715
7759
  }
7716
7760
  });
7717
7761
  watch(() => props.maxDate, () => {
@@ -7816,12 +7860,18 @@ const CDateRangePicker = defineComponent({
7816
7860
  emit('update:end-date', null);
7817
7861
  };
7818
7862
  const InputGroup = () => h$1('div', {
7819
- class: 'date-picker-input-group',
7863
+ class: [
7864
+ 'input-group',
7865
+ 'picker-input-group',
7866
+ {
7867
+ [`input-group-${props.size}`]: props.size,
7868
+ },
7869
+ ],
7820
7870
  }, [
7821
7871
  h$1('input', {
7822
7872
  autocomplete: 'off',
7823
7873
  class: [
7824
- 'date-picker-input',
7874
+ 'form-control date-picker-input',
7825
7875
  {
7826
7876
  hover: inputStartHoverValue.value,
7827
7877
  },
@@ -7848,12 +7898,16 @@ const CDateRangePicker = defineComponent({
7848
7898
  ? setInputValue(inputStartHoverValue.value)
7849
7899
  : setInputValue(startDate.value),
7850
7900
  }),
7851
- props.range && props.separator !== false && h$1('div', { class: 'date-picker-separator' }),
7901
+ props.range &&
7902
+ props.separator !== false &&
7903
+ h$1('span', { class: 'input-group-text' }, slots.separator
7904
+ ? slots.separator()
7905
+ : h$1('span', { class: 'picker-input-group-icon date-picker-arrow-icon' })),
7852
7906
  props.range &&
7853
7907
  h$1('input', {
7854
7908
  autocomplete: 'off',
7855
7909
  class: [
7856
- 'date-picker-input',
7910
+ 'form-control date-picker-input',
7857
7911
  {
7858
7912
  hover: inputEndHoverValue.value,
7859
7913
  },
@@ -7878,13 +7932,23 @@ const CDateRangePicker = defineComponent({
7878
7932
  ? setInputValue(inputEndHoverValue.value)
7879
7933
  : setInputValue(endDate.value),
7880
7934
  }),
7881
- props.indicator && h$1('div', { class: 'date-picker-indicator' }),
7882
- props.cleaner &&
7883
- (startDate.value || endDate.value) &&
7884
- h$1('div', {
7885
- class: 'date-picker-cleaner',
7886
- onClick: (event) => handleClear(event),
7887
- }),
7935
+ (props.indicator || props.cleaner) &&
7936
+ h$1('span', { class: 'input-group-text' }, [
7937
+ props.indicator &&
7938
+ h$1('span', {
7939
+ class: 'picker-input-group-indicator',
7940
+ }, slots.indicator
7941
+ ? slots.indicator()
7942
+ : h$1('span', { class: 'picker-input-group-icon date-picker-input-icon' })),
7943
+ props.cleaner &&
7944
+ h$1('span', {
7945
+ class: 'picker-input-group-cleaner',
7946
+ onClick: (event) => handleClear(event),
7947
+ role: 'button',
7948
+ }, slots.cleaner
7949
+ ? slots.cleaner()
7950
+ : h$1('span', { class: 'picker-input-group-icon date-picker-cleaner-icon' })),
7951
+ ]),
7888
7952
  ]);
7889
7953
  return () => h$1(CFormControlWrapper, {
7890
7954
  describedby: attrs['aria-describedby'],
@@ -7902,7 +7966,6 @@ const CDateRangePicker = defineComponent({
7902
7966
  class: [
7903
7967
  'date-picker',
7904
7968
  {
7905
- [`date-picker-${props.size}`]: props.size,
7906
7969
  disabled: props.disabled,
7907
7970
  'is-invalid': isValid.value === false ? true : false,
7908
7971
  'is-valid': isValid.value,
@@ -7929,7 +7992,7 @@ const CDateRangePicker = defineComponent({
7929
7992
  visible: visible.value,
7930
7993
  }, {
7931
7994
  toggler: () => InputGroup(),
7932
- footer: () => h$1('div', { class: 'date-picker-footer' }, [
7995
+ footer: () => h$1('div', { class: 'picker-footer' }, [
7933
7996
  props.todayButton &&
7934
7997
  h$1(CButton, {
7935
7998
  class: 'me-auto',
@@ -8377,6 +8440,43 @@ const CDatePickerPlugin = {
8377
8440
  },
8378
8441
  };
8379
8442
 
8443
+ const usePopper = () => {
8444
+ const _popper = ref();
8445
+ const initPopper = (reference, popper, options) => {
8446
+ _popper.value = createPopper(reference, popper, options);
8447
+ };
8448
+ const destroyPopper = () => {
8449
+ if (_popper.value) {
8450
+ _popper.value.destroy();
8451
+ }
8452
+ _popper.value = undefined;
8453
+ };
8454
+ return {
8455
+ popper: _popper.value,
8456
+ initPopper,
8457
+ destroyPopper,
8458
+ };
8459
+ };
8460
+
8461
+ const getPlacement = (placement, direction, alignment, isRTL) => {
8462
+ let _placement = placement;
8463
+ if (direction === 'dropup') {
8464
+ _placement = isRTL ? 'top-end' : 'top-start';
8465
+ }
8466
+ if (direction === 'dropup-center') {
8467
+ _placement = 'top';
8468
+ }
8469
+ if (direction === 'dropend') {
8470
+ _placement = isRTL ? 'left-start' : 'right-start';
8471
+ }
8472
+ if (direction === 'dropstart') {
8473
+ _placement = isRTL ? 'right-start' : 'left-start';
8474
+ }
8475
+ if (alignment === 'end') {
8476
+ _placement = isRTL ? 'bottom-start' : 'bottom-end';
8477
+ }
8478
+ return _placement;
8479
+ };
8380
8480
  const CDropdown = defineComponent({
8381
8481
  name: 'CDropdown',
8382
8482
  props: {
@@ -8448,6 +8548,15 @@ const CDropdown = defineComponent({
8448
8548
  * Toggle the disabled state for the component.
8449
8549
  */
8450
8550
  disabled: Boolean,
8551
+ /**
8552
+ * Offset of the dropdown menu relative to its target.
8553
+ *
8554
+ * @since 4.9.0
8555
+ */
8556
+ offset: {
8557
+ type: Array,
8558
+ default: () => [0, 2],
8559
+ },
8451
8560
  /**
8452
8561
  * 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.
8453
8562
  *
@@ -8501,14 +8610,37 @@ const CDropdown = defineComponent({
8501
8610
  setup(props, { slots, emit }) {
8502
8611
  const dropdownToggleRef = ref();
8503
8612
  const dropdownMenuRef = ref();
8504
- const placement = ref(props.placement);
8505
- const popper = ref();
8613
+ const popper = ref(typeof props.alignment === 'object' ? false : props.popper);
8506
8614
  const visible = ref(props.visible);
8615
+ const { initPopper, destroyPopper } = usePopper();
8616
+ const popperConfig = {
8617
+ modifiers: [
8618
+ {
8619
+ name: 'offset',
8620
+ options: {
8621
+ offset: props.offset,
8622
+ },
8623
+ },
8624
+ ],
8625
+ placement: getPlacement(props.placement, props.direction, props.alignment, isRTL(dropdownMenuRef.value)),
8626
+ };
8507
8627
  watch(() => props.visible, () => {
8508
8628
  visible.value = props.visible;
8509
8629
  });
8630
+ watch(visible, () => {
8631
+ if (visible.value && dropdownToggleRef.value && dropdownMenuRef.value) {
8632
+ popper.value && initPopper(dropdownToggleRef.value, dropdownMenuRef.value, popperConfig);
8633
+ window.addEventListener('mouseup', handleMouseUp);
8634
+ window.addEventListener('keyup', handleKeyup);
8635
+ emit('show');
8636
+ return;
8637
+ }
8638
+ popper.value && destroyPopper();
8639
+ window.removeEventListener('mouseup', handleMouseUp);
8640
+ window.removeEventListener('keyup', handleKeyup);
8641
+ emit('hide');
8642
+ });
8510
8643
  provide('config', {
8511
- autoClose: props.autoClose,
8512
8644
  alignment: props.alignment,
8513
8645
  dark: props.dark,
8514
8646
  popper: props.popper,
@@ -8517,24 +8649,31 @@ const CDropdown = defineComponent({
8517
8649
  provide('visible', visible);
8518
8650
  provide('dropdownToggleRef', dropdownToggleRef);
8519
8651
  provide('dropdownMenuRef', dropdownMenuRef);
8520
- const initPopper = () => {
8521
- // Disable popper if responsive aligment is set.
8522
- if (typeof props.alignment === 'object') {
8652
+ const handleKeyup = (event) => {
8653
+ if (props.autoClose === false) {
8523
8654
  return;
8524
8655
  }
8525
- if (dropdownToggleRef.value) {
8526
- popper.value = createPopper(dropdownToggleRef.value, dropdownMenuRef.value, {
8527
- placement: placement.value,
8528
- });
8656
+ if (event.key === 'Escape') {
8657
+ setVisible(false);
8529
8658
  }
8530
8659
  };
8531
- const destroyPopper = () => {
8532
- if (popper.value) {
8533
- popper.value.destroy();
8660
+ const handleMouseUp = (event) => {
8661
+ if (!dropdownToggleRef.value || !dropdownMenuRef.value) {
8662
+ return;
8663
+ }
8664
+ if (dropdownToggleRef.value.contains(event.target)) {
8665
+ return;
8666
+ }
8667
+ if (props.autoClose === true ||
8668
+ (props.autoClose === 'inside' &&
8669
+ dropdownMenuRef.value.contains(event.target)) ||
8670
+ (props.autoClose === 'outside' &&
8671
+ !dropdownMenuRef.value.contains(event.target))) {
8672
+ setVisible(false);
8673
+ return;
8534
8674
  }
8535
- popper.value = undefined;
8536
8675
  };
8537
- const toggleMenu = (_visible) => {
8676
+ const setVisible = (_visible) => {
8538
8677
  if (props.disabled) {
8539
8678
  return;
8540
8679
  }
@@ -8548,38 +8687,7 @@ const CDropdown = defineComponent({
8548
8687
  }
8549
8688
  visible.value = true;
8550
8689
  };
8551
- provide('toggleMenu', toggleMenu);
8552
- const hideMenu = () => {
8553
- if (props.disabled) {
8554
- return;
8555
- }
8556
- visible.value = false;
8557
- };
8558
- provide('hideMenu', hideMenu);
8559
- watch(visible, () => {
8560
- props.popper && (visible.value ? initPopper() : destroyPopper());
8561
- visible.value ? emit('show') : emit('hide');
8562
- });
8563
- onMounted(() => {
8564
- if (props.direction === 'center') {
8565
- placement.value = 'bottom';
8566
- }
8567
- if (props.direction === 'dropup') {
8568
- placement.value = isRTL(dropdownMenuRef.value) ? 'top-end' : 'top-start';
8569
- }
8570
- if (props.direction === 'dropup-center') {
8571
- placement.value = 'top';
8572
- }
8573
- if (props.direction === 'dropend') {
8574
- placement.value = isRTL(dropdownMenuRef.value) ? 'left-start' : 'right-start';
8575
- }
8576
- if (props.direction === 'dropstart') {
8577
- placement.value = isRTL(dropdownMenuRef.value) ? 'right-start' : 'left-start';
8578
- }
8579
- if (props.alignment === 'end') {
8580
- placement.value = isRTL(dropdownMenuRef.value) ? 'bottom-start' : 'bottom-end';
8581
- }
8582
- });
8690
+ provide('setVisible', setVisible);
8583
8691
  return () => props.variant === 'input-group'
8584
8692
  ? [slots.default && slots.default()]
8585
8693
  : h$1('div', {
@@ -8672,12 +8780,10 @@ const CDropdownMenu = defineComponent({
8672
8780
  },
8673
8781
  },
8674
8782
  setup(props, { slots }) {
8675
- const dropdownToggleRef = inject('dropdownToggleRef');
8676
8783
  const dropdownMenuRef = inject('dropdownMenuRef');
8677
8784
  const config = inject('config'); // eslint-disable-line @typescript-eslint/no-explicit-any
8678
- const hideMenu = inject('hideMenu');
8679
8785
  const visible = inject('visible');
8680
- const { autoClose, alignment, dark, popper } = config;
8786
+ const { alignment, dark, popper } = config;
8681
8787
  // eslint-disable-next-line @typescript-eslint/ban-types, unicorn/consistent-function-scoping
8682
8788
  const alignmentClassNames = (alignment) => {
8683
8789
  const classNames = [];
@@ -8691,39 +8797,6 @@ const CDropdownMenu = defineComponent({
8691
8797
  }
8692
8798
  return classNames;
8693
8799
  };
8694
- const handleKeyup = (event) => {
8695
- if (autoClose === false) {
8696
- return;
8697
- }
8698
- if (event.key === 'Escape') {
8699
- hideMenu();
8700
- }
8701
- };
8702
- const handleMouseUp = (event) => {
8703
- if (dropdownToggleRef.value?.contains(event.target)) {
8704
- return;
8705
- }
8706
- if (autoClose === true) {
8707
- hideMenu();
8708
- return;
8709
- }
8710
- if (autoClose === 'inside' && dropdownMenuRef.value?.contains(event.target)) {
8711
- hideMenu();
8712
- return;
8713
- }
8714
- if (autoClose === 'outside' &&
8715
- !dropdownMenuRef.value?.contains(event.target)) {
8716
- hideMenu();
8717
- }
8718
- };
8719
- onUpdated(() => {
8720
- visible.value && window.addEventListener('mouseup', handleMouseUp);
8721
- visible.value && window.addEventListener('keyup', handleKeyup);
8722
- });
8723
- onUnmounted(() => {
8724
- window.removeEventListener('mouseup', handleMouseUp);
8725
- window.removeEventListener('keyup', handleKeyup);
8726
- });
8727
8800
  return () => h$1(props.component, {
8728
8801
  class: [
8729
8802
  'dropdown-menu',
@@ -8820,7 +8893,7 @@ const CDropdownToggle = defineComponent({
8820
8893
  const dropdownToggleRef = inject('dropdownToggleRef');
8821
8894
  const dropdownVariant = inject('variant');
8822
8895
  const visible = inject('visible');
8823
- const toggleMenu = inject('toggleMenu');
8896
+ const setVisible = inject('setVisible');
8824
8897
  const className = [
8825
8898
  {
8826
8899
  'dropdown-toggle': props.caret,
@@ -8835,7 +8908,7 @@ const CDropdownToggle = defineComponent({
8835
8908
  if (props.disabled) {
8836
8909
  return;
8837
8910
  }
8838
- toggleMenu();
8911
+ setVisible();
8839
8912
  },
8840
8913
  }),
8841
8914
  ...((props.trigger === 'focus' || props.trigger.includes('focus')) && {
@@ -8843,13 +8916,13 @@ const CDropdownToggle = defineComponent({
8843
8916
  if (props.disabled) {
8844
8917
  return;
8845
8918
  }
8846
- toggleMenu(true);
8919
+ setVisible(true);
8847
8920
  },
8848
8921
  onblur: () => {
8849
8922
  if (props.disabled) {
8850
8923
  return;
8851
8924
  }
8852
- toggleMenu(false);
8925
+ setVisible(false);
8853
8926
  },
8854
8927
  }),
8855
8928
  };
@@ -11219,12 +11292,7 @@ const CMultiSelectSelection = defineComponent({
11219
11292
  emit('remove', option);
11220
11293
  };
11221
11294
  return () => h$1('div', {
11222
- class: [
11223
- 'form-multi-select-selection',
11224
- {
11225
- 'form-multi-select-selection-tags': props.multiple && props.selectionType === 'tags',
11226
- },
11227
- ],
11295
+ class: 'form-multi-select-selection',
11228
11296
  }, [
11229
11297
  props.multiple &&
11230
11298
  props.selectionType === 'counter' &&
@@ -11244,10 +11312,10 @@ const CMultiSelectSelection = defineComponent({
11244
11312
  option.text,
11245
11313
  !option.disabled &&
11246
11314
  h$1('button', {
11247
- class: 'form-multi-select-tag-delete',
11315
+ class: 'form-multi-select-tag-delete close',
11248
11316
  ariaLabel: 'Close',
11249
11317
  onClick: () => handleRemove(option),
11250
- }),
11318
+ }, h$1('span', { ariaHidden: 'true' }, 'x')),
11251
11319
  ]);
11252
11320
  }
11253
11321
  return;
@@ -11267,7 +11335,7 @@ const CMultiSelect = defineComponent({
11267
11335
  /**
11268
11336
  * Allow users to create options if they are not in the list of options.
11269
11337
  *
11270
- * @since 4.9.0-next.0
11338
+ * @since 4.9.0
11271
11339
  */
11272
11340
  allowCreateOptions: Boolean,
11273
11341
  /**
@@ -11282,7 +11350,7 @@ const CMultiSelect = defineComponent({
11282
11350
  /**
11283
11351
  * Clear current search on selecting an item.
11284
11352
  *
11285
- * @since 4.9.0-next.0
11353
+ * @since 4.9.0
11286
11354
  */
11287
11355
  clearSearchOnSelect: Boolean,
11288
11356
  /**
@@ -11326,7 +11394,7 @@ const CMultiSelect = defineComponent({
11326
11394
  /**
11327
11395
  * When set, the options list will have a loading style: loading spinner and reduced opacity.
11328
11396
  *
11329
- * @since 4.9.0-next.0
11397
+ * @since 4.9.0
11330
11398
  */
11331
11399
  loading: Boolean,
11332
11400
  /**
@@ -11712,13 +11780,17 @@ const CMultiSelect = defineComponent({
11712
11780
  }, {
11713
11781
  default: () => h$1('div', {
11714
11782
  class: [
11783
+ 'dropdown',
11784
+ 'picker',
11715
11785
  'form-multi-select',
11716
11786
  {
11787
+ 'form-multi-select-with-cleaner': props.cleaner,
11717
11788
  disabled: props.disabled,
11718
11789
  [`form-multi-select-${props.size}`]: props.size,
11790
+ 'form-multi-select-selection-tags': props.multiple && props.selectionType === 'tags',
11791
+ show: visible.value,
11719
11792
  'is-invalid': props.invalid,
11720
11793
  'is-valid': props.valid,
11721
- show: visible.value,
11722
11794
  },
11723
11795
  ],
11724
11796
  'aria-expanded': visible.value,
@@ -11742,56 +11814,51 @@ const CMultiSelect = defineComponent({
11742
11814
  selected: selected.value,
11743
11815
  selectionType: props.selectionType,
11744
11816
  selectionTypeCounterText: props.selectionTypeCounterText,
11745
- }, {
11746
- default: () => props.search &&
11747
- h$1('input', {
11748
- type: 'text',
11749
- class: 'form-multi-select-search',
11750
- disabled: props.disabled,
11751
- autocomplete: 'off',
11752
- onInput: (event) => handleSearchChange(event),
11753
- onKeydown: (event) => handleSearchKeyDown(event),
11754
- ...(selected.value.length === 0 && {
11755
- placeholder: props.placeholder,
11756
- }),
11757
- ...(selected.value.length > 0 &&
11758
- props.selectionType === 'counter' && {
11759
- placeholder: `${selected.value.length} ${props.selectionTypeCounterText}`,
11760
- }),
11761
- ...(selected.value.length > 0 &&
11762
- !props.multiple && {
11763
- placeholder: selected.value.map((option) => option.text)[0],
11764
- }),
11765
- ...(props.multiple &&
11766
- selected.value.length > 0 &&
11767
- props.selectionType !== 'counter' && {
11768
- size: searchValue.value.length + 2,
11769
- }),
11770
- ref: searchRef,
11771
- }),
11772
11817
  }),
11773
- h$1('div', { class: 'form-multi-select-buttons' }, {
11774
- default: () => [
11775
- h$1('button', {
11776
- class: 'form-multi-select-cleaner',
11777
- onClick: () => handleDeselectAll(),
11778
- type: 'button',
11818
+ props.multiple &&
11819
+ props.cleaner &&
11820
+ selected.value.length > 0 &&
11821
+ !props.disabled &&
11822
+ h$1('button', {
11823
+ type: 'button',
11824
+ class: 'form-multi-select-selection-cleaner',
11825
+ onClick: () => handleDeselectAll(),
11826
+ }),
11827
+ props.search &&
11828
+ h$1('input', {
11829
+ type: 'text',
11830
+ class: 'form-multi-select-search',
11831
+ disabled: props.disabled,
11832
+ autocomplete: 'off',
11833
+ onInput: (event) => handleSearchChange(event),
11834
+ onKeydown: (event) => handleSearchKeyDown(event),
11835
+ ...(selected.value.length === 0 && {
11836
+ placeholder: props.placeholder,
11779
11837
  }),
11780
- h$1('button', {
11781
- class: 'form-multi-select-indicator',
11782
- onClick: (event) => {
11783
- event.preventDefault();
11784
- event.stopPropagation();
11785
- visible.value = !visible.value;
11786
- },
11787
- type: 'button',
11838
+ ...(selected.value.length > 0 &&
11839
+ props.selectionType === 'counter' && {
11840
+ placeholder: `${selected.value.length} ${props.selectionTypeCounterText}`,
11788
11841
  }),
11789
- ],
11790
- }),
11842
+ ...(selected.value.length > 0 &&
11843
+ !props.multiple && {
11844
+ placeholder: selected.value.map((option) => option.text)[0],
11845
+ }),
11846
+ ...(props.multiple &&
11847
+ selected.value.length > 0 &&
11848
+ props.selectionType !== 'counter' && {
11849
+ size: searchValue.value.length + 2,
11850
+ }),
11851
+ ref: searchRef,
11852
+ }),
11791
11853
  ],
11792
11854
  }),
11793
11855
  h$1('div', {
11794
- class: 'form-multi-select-dropdown',
11856
+ class: [
11857
+ 'dropdown-menu',
11858
+ {
11859
+ show: visible.value,
11860
+ },
11861
+ ],
11795
11862
  role: 'menu',
11796
11863
  ref: dropdownRef,
11797
11864
  }, {
@@ -12716,26 +12783,49 @@ const CProgressPlugin = {
12716
12783
  },
12717
12784
  };
12718
12785
 
12719
- const getPlacement$1 = (placement, element) => {
12720
- switch (placement) {
12721
- case 'right': {
12722
- return isRTL(element) ? 'left' : 'right';
12723
- }
12724
- case 'left': {
12725
- return isRTL(element) ? 'right' : 'left';
12726
- }
12727
- default: {
12728
- return placement;
12729
- }
12730
- }
12731
- };
12732
12786
  const CPopover = defineComponent({
12733
12787
  name: 'CPopover',
12734
12788
  props: {
12789
+ /**
12790
+ * Apply a CSS fade transition to the popover.
12791
+ *
12792
+ * @since 4.9.0
12793
+ */
12794
+ animation: {
12795
+ type: Boolean,
12796
+ default: true,
12797
+ },
12735
12798
  /**
12736
12799
  * Content for your component. If you want to pass non-string value please use dedicated slot `<template #content>...</template>`
12737
12800
  */
12738
12801
  content: String,
12802
+ /**
12803
+ * 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 }`.
12804
+ *
12805
+ * @since 4.9.0
12806
+ */
12807
+ delay: {
12808
+ type: [Number, Object],
12809
+ default: 0,
12810
+ },
12811
+ /**
12812
+ * Specify the desired order of fallback placements by providing a list of placements as an array. The placements should be prioritized based on preference.
12813
+ *
12814
+ * @since 4.9.0
12815
+ */
12816
+ fallbackPlacements: {
12817
+ type: [String, Array],
12818
+ default: () => ['top', 'right', 'bottom', 'left'],
12819
+ validator: (value) => {
12820
+ if (typeof value === 'string') {
12821
+ return ['top', 'right', 'bottom', 'left'].includes(value);
12822
+ }
12823
+ if (Array.isArray(value)) {
12824
+ return value.every((e) => ['top', 'right', 'bottom', 'left'].includes(e));
12825
+ }
12826
+ return false;
12827
+ },
12828
+ },
12739
12829
  /**
12740
12830
  * Offset of the popover relative to its target.
12741
12831
  */
@@ -12793,11 +12883,35 @@ const CPopover = defineComponent({
12793
12883
  setup(props, { attrs, slots, emit }) {
12794
12884
  const togglerRef = ref();
12795
12885
  const popoverRef = ref();
12796
- const popper = ref();
12797
12886
  const visible = ref(props.visible);
12887
+ const { initPopper, destroyPopper } = usePopper();
12888
+ const delay = typeof props.delay === 'number' ? { show: props.delay, hide: props.delay } : props.delay;
12889
+ const popperConfig = {
12890
+ modifiers: [
12891
+ {
12892
+ name: 'arrow',
12893
+ options: {
12894
+ element: '.popover-arrow',
12895
+ },
12896
+ },
12897
+ {
12898
+ name: 'flip',
12899
+ options: {
12900
+ fallbackPlacements: props.fallbackPlacements,
12901
+ },
12902
+ },
12903
+ {
12904
+ name: 'offset',
12905
+ options: {
12906
+ offset: props.offset,
12907
+ },
12908
+ },
12909
+ ],
12910
+ placement: getRTLPlacement(props.placement, togglerRef.value),
12911
+ };
12798
12912
  const handleEnter = (el, done) => {
12799
12913
  emit('show');
12800
- initPopper();
12914
+ initPopper(togglerRef.value, popoverRef.value, popperConfig);
12801
12915
  el.classList.add('show');
12802
12916
  executeAfterTransition(() => done(), el);
12803
12917
  };
@@ -12809,30 +12923,17 @@ const CPopover = defineComponent({
12809
12923
  destroyPopper();
12810
12924
  }, el);
12811
12925
  };
12812
- const handleToggle = (event) => {
12926
+ const toggleVisible = (event, _visible) => {
12813
12927
  togglerRef.value = event.target;
12814
- visible.value = !visible.value;
12815
- };
12816
- const initPopper = () => {
12817
- if (togglerRef.value) {
12818
- popper.value = createPopper(togglerRef.value, popoverRef.value, {
12819
- placement: getPlacement$1(props.placement, togglerRef.value),
12820
- modifiers: [
12821
- {
12822
- name: 'offset',
12823
- options: {
12824
- offset: props.offset,
12825
- },
12826
- },
12827
- ],
12828
- });
12829
- }
12830
- };
12831
- const destroyPopper = () => {
12832
- if (popper.value) {
12833
- popper.value.destroy();
12928
+ if (_visible) {
12929
+ setTimeout(() => {
12930
+ visible.value = true;
12931
+ }, delay.show);
12932
+ return;
12834
12933
  }
12835
- popper.value = undefined;
12934
+ setTimeout(() => {
12935
+ visible.value = false;
12936
+ }, delay.hide);
12836
12937
  };
12837
12938
  return () => [
12838
12939
  h$1(Teleport, {
@@ -12842,12 +12943,18 @@ const CPopover = defineComponent({
12842
12943
  onLeave: (el, done) => handleLeave(el, done),
12843
12944
  }, () => visible.value &&
12844
12945
  h$1('div', {
12845
- class: 'popover fade bs-popover-auto',
12946
+ class: [
12947
+ 'popover',
12948
+ 'bs-popover-auto',
12949
+ {
12950
+ fade: props.animation,
12951
+ },
12952
+ ],
12846
12953
  ref: popoverRef,
12847
12954
  role: 'tooltip',
12848
12955
  ...attrs,
12849
12956
  }, [
12850
- h$1('div', { class: 'popover-arrow', 'data-popper-arrow': '' }),
12957
+ h$1('div', { class: 'popover-arrow' }),
12851
12958
  (props.title || slots.title) &&
12852
12959
  h$1('div', { class: 'popover-header' }, {
12853
12960
  default: () => (slots.title && slots.title()) || props.title,
@@ -12860,11 +12967,11 @@ const CPopover = defineComponent({
12860
12967
  slots.toggler &&
12861
12968
  slots.toggler({
12862
12969
  on: {
12863
- click: (event) => props.trigger.includes('click') && handleToggle(event),
12864
- blur: (event) => props.trigger.includes('focus') && handleToggle(event),
12865
- focus: (event) => props.trigger.includes('focus') && handleToggle(event),
12866
- mouseenter: (event) => props.trigger.includes('hover') && handleToggle(event),
12867
- mouseleave: (event) => props.trigger.includes('hover') && handleToggle(event),
12970
+ click: (event) => props.trigger.includes('click') && toggleVisible(event, !visible.value),
12971
+ blur: (event) => props.trigger.includes('focus') && toggleVisible(event, false),
12972
+ focus: (event) => props.trigger.includes('focus') && toggleVisible(event, true),
12973
+ mouseenter: (event) => props.trigger.includes('hover') && toggleVisible(event, true),
12974
+ mouseleave: (event) => props.trigger.includes('hover') && toggleVisible(event, false),
12868
12975
  },
12869
12976
  }),
12870
12977
  ];
@@ -15424,26 +15531,49 @@ const CToastPlugin = {
15424
15531
  },
15425
15532
  };
15426
15533
 
15427
- const getPlacement = (placement, element) => {
15428
- switch (placement) {
15429
- case 'right': {
15430
- return isRTL(element) ? 'left' : 'right';
15431
- }
15432
- case 'left': {
15433
- return isRTL(element) ? 'right' : 'left';
15434
- }
15435
- default: {
15436
- return placement;
15437
- }
15438
- }
15439
- };
15440
15534
  const CTooltip = defineComponent({
15441
15535
  name: 'CTooltip',
15442
15536
  props: {
15537
+ /**
15538
+ * Apply a CSS fade transition to the tooltip.
15539
+ *
15540
+ * @since 4.9.0
15541
+ */
15542
+ animation: {
15543
+ type: Boolean,
15544
+ default: true,
15545
+ },
15443
15546
  /**
15444
15547
  * Content for your component. If you want to pass non-string value please use dedicated slot `<template #content>...</template>`
15445
15548
  */
15446
15549
  content: String,
15550
+ /**
15551
+ * 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 }`.
15552
+ *
15553
+ * @since 4.9.0
15554
+ */
15555
+ delay: {
15556
+ type: [Number, Object],
15557
+ default: 0,
15558
+ },
15559
+ /**
15560
+ * Specify the desired order of fallback placements by providing a list of placements as an array. The placements should be prioritized based on preference.
15561
+ *
15562
+ * @since 4.9.0
15563
+ */
15564
+ fallbackPlacements: {
15565
+ type: [String, Array],
15566
+ default: () => ['top', 'right', 'bottom', 'left'],
15567
+ validator: (value) => {
15568
+ if (typeof value === 'string') {
15569
+ return ['top', 'right', 'bottom', 'left'].includes(value);
15570
+ }
15571
+ if (Array.isArray(value)) {
15572
+ return value.every((e) => ['top', 'right', 'bottom', 'left'].includes(e));
15573
+ }
15574
+ return false;
15575
+ },
15576
+ },
15447
15577
  /**
15448
15578
  * Offset of the tooltip relative to its target.
15449
15579
  */
@@ -15468,7 +15598,7 @@ const CTooltip = defineComponent({
15468
15598
  */
15469
15599
  trigger: {
15470
15600
  type: [String, Array],
15471
- default: 'hover',
15601
+ default: () => ['hover', 'focus'],
15472
15602
  validator: (value) => {
15473
15603
  if (typeof value === 'string') {
15474
15604
  return ['click', 'focus', 'hover'].includes(value);
@@ -15497,11 +15627,35 @@ const CTooltip = defineComponent({
15497
15627
  setup(props, { attrs, slots, emit }) {
15498
15628
  const togglerRef = ref();
15499
15629
  const tooltipRef = ref();
15500
- const popper = ref();
15501
15630
  const visible = ref(props.visible);
15631
+ const { initPopper, destroyPopper } = usePopper();
15632
+ const delay = typeof props.delay === 'number' ? { show: props.delay, hide: props.delay } : props.delay;
15633
+ const popperConfig = {
15634
+ modifiers: [
15635
+ {
15636
+ name: 'arrow',
15637
+ options: {
15638
+ element: '.tooltip-arrow',
15639
+ },
15640
+ },
15641
+ {
15642
+ name: 'flip',
15643
+ options: {
15644
+ fallbackPlacements: props.fallbackPlacements,
15645
+ },
15646
+ },
15647
+ {
15648
+ name: 'offset',
15649
+ options: {
15650
+ offset: props.offset,
15651
+ },
15652
+ },
15653
+ ],
15654
+ placement: getRTLPlacement(props.placement, togglerRef.value),
15655
+ };
15502
15656
  const handleEnter = (el, done) => {
15503
15657
  emit('show');
15504
- initPopper();
15658
+ initPopper(togglerRef.value, tooltipRef.value, popperConfig);
15505
15659
  el.classList.add('show');
15506
15660
  executeAfterTransition(() => done(), el);
15507
15661
  };
@@ -15513,30 +15667,17 @@ const CTooltip = defineComponent({
15513
15667
  destroyPopper();
15514
15668
  }, el);
15515
15669
  };
15516
- const handleToggle = (event) => {
15670
+ const toggleVisible = (event, _visible) => {
15517
15671
  togglerRef.value = event.target;
15518
- visible.value = !visible.value;
15519
- };
15520
- const initPopper = () => {
15521
- if (togglerRef.value) {
15522
- popper.value = createPopper(togglerRef.value, tooltipRef.value, {
15523
- placement: getPlacement(props.placement, togglerRef.value),
15524
- modifiers: [
15525
- {
15526
- name: 'offset',
15527
- options: {
15528
- offset: props.offset,
15529
- },
15530
- },
15531
- ],
15532
- });
15533
- }
15534
- };
15535
- const destroyPopper = () => {
15536
- if (popper.value) {
15537
- popper.value.destroy();
15672
+ if (_visible) {
15673
+ setTimeout(() => {
15674
+ visible.value = true;
15675
+ }, delay.show);
15676
+ return;
15538
15677
  }
15539
- popper.value = undefined;
15678
+ setTimeout(() => {
15679
+ visible.value = false;
15680
+ }, delay.hide);
15540
15681
  };
15541
15682
  return () => [
15542
15683
  h$1(Teleport, {
@@ -15546,12 +15687,18 @@ const CTooltip = defineComponent({
15546
15687
  onLeave: (el, done) => handleLeave(el, done),
15547
15688
  }, () => visible.value &&
15548
15689
  h$1('div', {
15549
- class: 'tooltip fade bs-tooltip-auto',
15690
+ class: [
15691
+ 'tooltip',
15692
+ 'bs-tooltip-auto',
15693
+ {
15694
+ fade: props.animation,
15695
+ },
15696
+ ],
15550
15697
  ref: tooltipRef,
15551
15698
  role: 'tooltip',
15552
15699
  ...attrs,
15553
15700
  }, [
15554
- h$1('div', { class: 'tooltip-arrow', 'data-popper-arrow': '' }),
15701
+ h$1('div', { class: 'tooltip-arrow' }),
15555
15702
  (props.content || slots.content) &&
15556
15703
  h$1('div', { class: 'tooltip-inner' }, {
15557
15704
  default: () => (slots.content && slots.content()) || props.content,
@@ -15560,11 +15707,11 @@ const CTooltip = defineComponent({
15560
15707
  slots.toggler &&
15561
15708
  slots.toggler({
15562
15709
  on: {
15563
- click: (event) => props.trigger.includes('click') && handleToggle(event),
15564
- blur: (event) => props.trigger.includes('focus') && handleToggle(event),
15565
- focus: (event) => props.trigger.includes('focus') && handleToggle(event),
15566
- mouseenter: (event) => props.trigger.includes('hover') && handleToggle(event),
15567
- mouseleave: (event) => props.trigger.includes('hover') && handleToggle(event),
15710
+ click: (event) => props.trigger.includes('click') && toggleVisible(event, !visible.value),
15711
+ blur: (event) => props.trigger.includes('focus') && toggleVisible(event, false),
15712
+ focus: (event) => props.trigger.includes('focus') && toggleVisible(event, true),
15713
+ mouseenter: (event) => props.trigger.includes('hover') && toggleVisible(event, true),
15714
+ mouseleave: (event) => props.trigger.includes('hover') && toggleVisible(event, false),
15568
15715
  },
15569
15716
  }),
15570
15717
  ];
@@ -16409,54 +16556,6 @@ var Directives = /*#__PURE__*/Object.freeze({
16409
16556
  vctooltip: vCTooltip
16410
16557
  });
16411
16558
 
16412
- const getStoredTheme = (localStorageItemName) => typeof window !== 'undefined' && localStorage.getItem(localStorageItemName);
16413
- const setStoredTheme = (localStorageItemName, colorMode) => localStorage.setItem(localStorageItemName, colorMode);
16414
- const getPreferredColorScheme = (localStorageItemName) => {
16415
- if (typeof window === 'undefined') {
16416
- return;
16417
- }
16418
- const storedTheme = getStoredTheme(localStorageItemName);
16419
- if (storedTheme) {
16420
- return storedTheme;
16421
- }
16422
- return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
16423
- };
16424
- const setTheme = (colorMode) => {
16425
- document.documentElement.dataset.coreuiTheme =
16426
- colorMode === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches
16427
- ? 'dark'
16428
- : colorMode;
16429
- const event = new Event('ColorSchemeChange');
16430
- document.documentElement.dispatchEvent(event);
16431
- };
16432
- const useColorModes = (localStorageItemName = 'coreui-vue-color-scheme') => {
16433
- const colorMode = ref(getPreferredColorScheme(localStorageItemName));
16434
- watch(colorMode, () => {
16435
- if (colorMode.value) {
16436
- setStoredTheme(localStorageItemName, colorMode.value);
16437
- setTheme(colorMode.value);
16438
- }
16439
- });
16440
- onBeforeMount(() => {
16441
- if (typeof getStoredTheme(localStorageItemName) === 'string' && colorMode.value) {
16442
- setTheme(colorMode.value);
16443
- }
16444
- window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
16445
- const storedTheme = getStoredTheme(localStorageItemName);
16446
- if (storedTheme !== 'light' && storedTheme !== 'dark' && colorMode.value) {
16447
- setTheme(colorMode.value);
16448
- }
16449
- });
16450
- });
16451
- return {
16452
- getColorMode: () => colorMode.value,
16453
- isColorModeSet: () => Boolean(getStoredTheme(localStorageItemName)),
16454
- setColorMode: (mode) => {
16455
- colorMode.value = mode;
16456
- },
16457
- };
16458
- };
16459
-
16460
16559
  const CoreuiVue = {
16461
16560
  install: (app) => {
16462
16561
  for (const key in Components) {
@@ -16468,5 +16567,5 @@ const CoreuiVue = {
16468
16567
  },
16469
16568
  };
16470
16569
 
16471
- 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, CVirtualScroller, CVirtualScrollerPlugin, CWidgetStatsA, CWidgetStatsB, CWidgetStatsC, CWidgetStatsD, CWidgetStatsE, CWidgetStatsF, CWidgetsStatsPlugin, CoreuiVue as default, useColorModes, vCPlaceholder as vcplaceholder, vCPopover as vcpopover, vCTooltip as vctooltip };
16570
+ 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, CVirtualScroller, CVirtualScrollerPlugin, CWidgetStatsA, CWidgetStatsB, CWidgetStatsC, CWidgetStatsD, CWidgetStatsE, CWidgetStatsF, CWidgetsStatsPlugin, CoreuiVue as default, usePopper, vCPlaceholder as vcplaceholder, vCPopover as vcpopover, vCTooltip as vctooltip };
16472
16571
  //# sourceMappingURL=index.es.js.map