@coreui/vue-pro 4.0.1 → 4.1.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 (68) hide show
  1. package/README.md +1 -1
  2. package/dist/components/carousel/CCarousel.d.ts +2 -2
  3. package/dist/components/collapse/CCollapse.d.ts +10 -0
  4. package/dist/components/element-cover/index.d.ts +6 -0
  5. package/dist/components/form/CFormCheck.d.ts +22 -2
  6. package/dist/components/form/CFormInput.d.ts +17 -2
  7. package/dist/components/form/CFormRange.d.ts +15 -2
  8. package/dist/components/form/CFormSelect.d.ts +36 -2
  9. package/dist/components/form/CFormSwitch.d.ts +15 -2
  10. package/dist/components/form/CFormTextarea.d.ts +18 -2
  11. package/dist/components/index.d.ts +2 -0
  12. package/dist/components/modal/CModal.d.ts +2 -2
  13. package/dist/components/multi-select/CMultiSelect.d.ts +2 -2
  14. package/dist/components/multi-select/CMultiSelectNativeSelect.d.ts +2 -2
  15. package/dist/components/placeholder/CPlaceholder.d.ts +124 -0
  16. package/dist/components/placeholder/index.d.ts +6 -0
  17. package/dist/components/popover/CPopover.d.ts +2 -2
  18. package/dist/components/smart-table/CSmartTable.d.ts +0 -3
  19. package/dist/components/table/CTable.d.ts +2 -2
  20. package/dist/components/widgets/CWidgetStatsB.d.ts +2 -2
  21. package/dist/components/widgets/CWidgetStatsF.d.ts +2 -2
  22. package/dist/directives/index.d.ts +3 -2
  23. package/dist/directives/v-c-placeholder.d.ts +6 -0
  24. package/dist/directives/v-c-visible.d.ts +6 -0
  25. package/dist/index.es.js +902 -445
  26. package/dist/index.es.js.map +1 -1
  27. package/dist/index.js +905 -443
  28. package/dist/index.js.map +1 -1
  29. package/package.json +10 -9
  30. package/src/components/accordion/__tests__/__snapshots__/CAccordionBody.spec.ts.snap +1 -1
  31. package/src/components/button/CButton.ts +2 -2
  32. package/src/components/card/CCardImage.ts +2 -3
  33. package/src/components/collapse/CCollapse.ts +49 -21
  34. package/src/components/collapse/__test__/__snapshots__/CCollapse.spec.ts.snap +1 -1
  35. package/src/components/element-cover/index.ts +10 -0
  36. package/src/components/form/CFormCheck.ts +34 -2
  37. package/src/components/form/CFormInput.ts +40 -5
  38. package/src/components/form/CFormLabel.ts +1 -2
  39. package/src/components/form/CFormRange.ts +32 -3
  40. package/src/components/form/CFormSelect.ts +63 -4
  41. package/src/components/form/CFormSwitch.ts +46 -4
  42. package/src/components/form/CFormTextarea.ts +31 -2
  43. package/src/components/form/__tests__/__snapshots__/CFormCheck.spec.ts.snap +2 -2
  44. package/src/components/form/__tests__/__snapshots__/CFormInput.spec.ts.snap +3 -3
  45. package/src/components/form/__tests__/__snapshots__/CFormRange.spec.ts.snap +1 -1
  46. package/src/components/form/__tests__/__snapshots__/CFormSwitch.spec.ts.snap +2 -2
  47. package/src/components/form/__tests__/__snapshots__/CFormTextarea.spec.ts.snap +1 -1
  48. package/src/components/grid/CCol.ts +8 -8
  49. package/src/components/grid/CContainer.ts +3 -3
  50. package/src/components/grid/CRow.ts +6 -6
  51. package/src/components/index.ts +2 -0
  52. package/src/components/offcanvas/COffcanvas.ts +19 -16
  53. package/src/components/offcanvas/__tests__/COffcanvas.spec.ts +1 -1
  54. package/src/components/offcanvas/__tests__/__snapshots__/COffcanvas.spec.ts.snap +2 -2
  55. package/src/components/pagination/CSmartPagination.ts +1 -1
  56. package/src/components/placeholder/CPlaceholder.ts +139 -0
  57. package/src/components/placeholder/__tests__/CPlaceholder.spec.ts +44 -0
  58. package/src/components/placeholder/__tests__/__snapshots__/CPlaceholder.spec.ts.snap +15 -0
  59. package/src/components/placeholder/index.ts +10 -0
  60. package/src/components/smart-table/CSmartTable.ts +56 -41
  61. package/src/components/smart-table/CSmartTableHead.ts +43 -42
  62. package/src/components/toast/CToastClose.ts +2 -2
  63. package/src/components/toast/__tests__/CToastClose.spec.ts +2 -2
  64. package/src/components/toast/__tests__/__snapshots__/CToastClose.spec.ts.snap +1 -1
  65. package/src/directives/index.ts +3 -2
  66. package/src/directives/v-c-placeholder.ts +32 -0
  67. package/src/directives/v-c-visible.ts +33 -0
  68. package/src/index.ts +2 -1
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, provide, h as h$1, Transition, withDirectives, vShow, inject, watch, reactive, onBeforeMount, onMounted, onUpdated, toRefs, onUnmounted, computed, Teleport, onBeforeUnmount, nextTick, resolveComponent } from 'vue';
1
+ import { defineComponent, ref, provide, h as h$1, Transition, withDirectives, inject, watch, reactive, onBeforeMount, onMounted, onUpdated, toRefs, onUnmounted, nextTick, computed, Teleport, onBeforeUnmount, vShow } from 'vue';
2
2
 
3
3
  const CAccordion = defineComponent({
4
4
  name: 'CAccordion',
@@ -32,9 +32,45 @@ const CAccordion = defineComponent({
32
32
  },
33
33
  });
34
34
 
35
+ const vVisible = {
36
+ beforeMount(el, { value }, { transition }) {
37
+ el._vod = el.style.display === 'none' ? '' : el.style.display;
38
+ if (transition && value) {
39
+ transition.beforeEnter(el);
40
+ }
41
+ },
42
+ mounted(el, { value }, { transition }) {
43
+ if (transition && value) {
44
+ transition.enter(el);
45
+ }
46
+ },
47
+ updated(el, { value, oldValue }, { transition }) {
48
+ if (!value === !oldValue)
49
+ return;
50
+ if (transition) {
51
+ if (value) {
52
+ transition.beforeEnter(el);
53
+ transition.enter(el);
54
+ }
55
+ else {
56
+ transition.leave(el, () => {
57
+ // setDisplay(el, false)
58
+ });
59
+ }
60
+ }
61
+ },
62
+ };
63
+
35
64
  const CCollapse = defineComponent({
36
65
  name: 'CCollapse',
37
66
  props: {
67
+ /**
68
+ * Set horizontal collapsing to transition the width instead of height.
69
+ */
70
+ horizontal: {
71
+ type: Boolean,
72
+ required: false,
73
+ },
38
74
  /**
39
75
  * Toggle the visibility of component.
40
76
  */
@@ -54,42 +90,58 @@ const CCollapse = defineComponent({
54
90
  'show',
55
91
  ],
56
92
  setup(props, { slots, emit }) {
57
- const handleBeforeEnter = (el) => {
58
- el.classList.remove('collapse');
59
- el.classList.add('collapsing');
93
+ const collapsing = ref(false);
94
+ const show = ref(props.visible);
95
+ const handleBeforeEnter = () => {
96
+ collapsing.value = true;
60
97
  };
61
98
  const handleEnter = (el, done) => {
62
99
  emit('show');
63
100
  el.addEventListener('transitionend', () => {
64
- el.classList.add('collapse', 'show');
65
101
  done();
66
102
  });
67
- el.style.height = `${el.scrollHeight}px`;
103
+ setTimeout(() => {
104
+ if (props.horizontal) {
105
+ el.style.width = `${el.scrollWidth}px`;
106
+ return;
107
+ }
108
+ el.style.height = `${el.scrollHeight}px`;
109
+ }, 1);
68
110
  };
69
111
  const handleAfterEnter = (el) => {
70
- el.classList.remove('collapsing');
71
- el.style.removeProperty('height');
112
+ show.value = true;
113
+ collapsing.value = false;
114
+ props.horizontal ? el.style.removeProperty('width') : el.style.removeProperty('height');
72
115
  };
73
116
  const handleBeforeLeave = (el) => {
74
- el.classList.add('show');
117
+ collapsing.value = true;
118
+ show.value = false;
119
+ if (props.horizontal) {
120
+ el.style.width = `${el.scrollWidth}px`;
121
+ return;
122
+ }
75
123
  el.style.height = `${el.scrollHeight}px`;
76
124
  };
77
125
  const handleLeave = (el, done) => {
78
126
  emit('hide');
79
- el.classList.remove('collapse', 'show');
80
- el.classList.add('collapsing');
81
127
  el.addEventListener('transitionend', () => {
82
128
  done();
83
129
  });
84
- el.style.height = '0px';
130
+ setTimeout(() => {
131
+ if (props.horizontal) {
132
+ el.style.width = '0px';
133
+ return;
134
+ }
135
+ el.style.height = '0px';
136
+ }, 1);
85
137
  };
86
138
  const handleAfterLeave = (el) => {
87
- el.classList.remove('collapsing');
88
- el.classList.add('collapse');
139
+ collapsing.value = false;
140
+ props.horizontal ? el.style.removeProperty('width') : el.style.removeProperty('height');
89
141
  };
90
142
  return () => h$1(Transition, {
91
- name: 'fade',
92
- onBeforeEnter: (el) => handleBeforeEnter(el),
143
+ css: false,
144
+ onBeforeEnter: () => handleBeforeEnter(),
93
145
  onEnter: (el, done) => handleEnter(el, done),
94
146
  onAfterEnter: (el) => handleAfterEnter(el),
95
147
  onBeforeLeave: (el) => handleBeforeLeave(el),
@@ -97,12 +149,10 @@ const CCollapse = defineComponent({
97
149
  onAfterLeave: (el) => handleAfterLeave(el),
98
150
  }, () => withDirectives(h$1('div', {
99
151
  class: [
100
- 'collapse',
101
- {
102
- show: props.visible,
103
- },
152
+ collapsing.value ? 'collapsing' : 'collapse',
153
+ { 'collapse-horizontal': props.horizontal, show: show.value },
104
154
  ],
105
- }, slots.default && slots.default()), [[vShow, props.visible]]));
155
+ }, slots.default && slots.default()), [[vVisible, props.visible]]));
106
156
  },
107
157
  });
108
158
 
@@ -782,9 +832,8 @@ const CButton = defineComponent({
782
832
  },
783
833
  },
784
834
  },
785
- setup(props, { slots, attrs }) {
835
+ setup(props, { slots }) {
786
836
  return () => h$1(props.component, {
787
- ...attrs,
788
837
  class: [
789
838
  'btn',
790
839
  props.variant ? `btn-${props.variant}-${props.color}` : `btn-${props.color}`,
@@ -797,6 +846,7 @@ const CButton = defineComponent({
797
846
  ],
798
847
  disabled: props.disabled && props.component !== 'a',
799
848
  ...(props.component === 'a' && props.disabled && { 'aria-disabled': true, tabIndex: -1 }),
849
+ ...(props.component === 'a' && props.href && { href: props.href }),
800
850
  }, slots.default && slots.default());
801
851
  },
802
852
  });
@@ -975,10 +1025,9 @@ const CCardImage = defineComponent({
975
1025
  },
976
1026
  },
977
1027
  },
978
- setup(props, { slots, attrs }) {
1028
+ setup(props, { slots }) {
979
1029
  return () => h$1(props.component, {
980
- ...attrs,
981
- class: [props.orientation ? `card-img-${props.orientation}` : 'card-img'],
1030
+ class: `card-img${props.orientation ? `-${props.orientation}` : ''}`,
982
1031
  }, slots.default && slots.default());
983
1032
  },
984
1033
  });
@@ -1612,29 +1661,32 @@ function getBasePlacement(placement) {
1612
1661
  return placement.split('-')[0];
1613
1662
  }
1614
1663
 
1615
- // import { isHTMLElement } from './instanceOf';
1616
- function getBoundingClientRect(element, // eslint-disable-next-line unused-imports/no-unused-vars
1617
- includeScale) {
1664
+ var max = Math.max;
1665
+ var min = Math.min;
1666
+ var round = Math.round;
1667
+
1668
+ function getBoundingClientRect(element, includeScale) {
1669
+ if (includeScale === void 0) {
1670
+ includeScale = false;
1671
+ }
1618
1672
 
1619
1673
  var rect = element.getBoundingClientRect();
1620
1674
  var scaleX = 1;
1621
- var scaleY = 1; // FIXME:
1622
- // `offsetWidth` returns an integer while `getBoundingClientRect`
1623
- // returns a float. This results in `scaleX` or `scaleY` being
1624
- // non-1 when it should be for elements that aren't a full pixel in
1625
- // width or height.
1626
- // if (isHTMLElement(element) && includeScale) {
1627
- // const offsetHeight = element.offsetHeight;
1628
- // const offsetWidth = element.offsetWidth;
1629
- // // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
1630
- // // Fallback to 1 in case both values are `0`
1631
- // if (offsetWidth > 0) {
1632
- // scaleX = rect.width / offsetWidth || 1;
1633
- // }
1634
- // if (offsetHeight > 0) {
1635
- // scaleY = rect.height / offsetHeight || 1;
1636
- // }
1637
- // }
1675
+ var scaleY = 1;
1676
+
1677
+ if (isHTMLElement(element) && includeScale) {
1678
+ var offsetHeight = element.offsetHeight;
1679
+ var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
1680
+ // Fallback to 1 in case both values are `0`
1681
+
1682
+ if (offsetWidth > 0) {
1683
+ scaleX = round(rect.width) / offsetWidth || 1;
1684
+ }
1685
+
1686
+ if (offsetHeight > 0) {
1687
+ scaleY = round(rect.height) / offsetHeight || 1;
1688
+ }
1689
+ }
1638
1690
 
1639
1691
  return {
1640
1692
  width: rect.width / scaleX,
@@ -1789,13 +1841,13 @@ function getMainAxisFromPlacement(placement) {
1789
1841
  return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
1790
1842
  }
1791
1843
 
1792
- var max = Math.max;
1793
- var min = Math.min;
1794
- var round = Math.round;
1795
-
1796
1844
  function within(min$1, value, max$1) {
1797
1845
  return max(min$1, min(value, max$1));
1798
1846
  }
1847
+ function withinMaxClamp(min, value, max) {
1848
+ var v = within(min, value, max);
1849
+ return v > max ? max : v;
1850
+ }
1799
1851
 
1800
1852
  function getFreshSideObject() {
1801
1853
  return {
@@ -1927,8 +1979,8 @@ function roundOffsetsByDPR(_ref) {
1927
1979
  var win = window;
1928
1980
  var dpr = win.devicePixelRatio || 1;
1929
1981
  return {
1930
- x: round(round(x * dpr) / dpr) || 0,
1931
- y: round(round(y * dpr) / dpr) || 0
1982
+ x: round(x * dpr) / dpr || 0,
1983
+ y: round(y * dpr) / dpr || 0
1932
1984
  };
1933
1985
  }
1934
1986
 
@@ -1943,7 +1995,8 @@ function mapToStyles(_ref2) {
1943
1995
  position = _ref2.position,
1944
1996
  gpuAcceleration = _ref2.gpuAcceleration,
1945
1997
  adaptive = _ref2.adaptive,
1946
- roundOffsets = _ref2.roundOffsets;
1998
+ roundOffsets = _ref2.roundOffsets,
1999
+ isFixed = _ref2.isFixed;
1947
2000
 
1948
2001
  var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
1949
2002
  _ref3$x = _ref3.x,
@@ -1975,16 +2028,18 @@ function mapToStyles(_ref2) {
1975
2028
  offsetParent = offsetParent;
1976
2029
 
1977
2030
  if (placement === top || (placement === left || placement === right) && variation === end) {
1978
- sideY = bottom; // $FlowFixMe[prop-missing]
1979
-
1980
- y -= offsetParent[heightProp] - popperRect.height;
2031
+ sideY = bottom;
2032
+ var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
2033
+ offsetParent[heightProp];
2034
+ y -= offsetY - popperRect.height;
1981
2035
  y *= gpuAcceleration ? 1 : -1;
1982
2036
  }
1983
2037
 
1984
2038
  if (placement === left || (placement === top || placement === bottom) && variation === end) {
1985
- sideX = right; // $FlowFixMe[prop-missing]
1986
-
1987
- x -= offsetParent[widthProp] - popperRect.width;
2039
+ sideX = right;
2040
+ var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
2041
+ offsetParent[widthProp];
2042
+ x -= offsetX - popperRect.width;
1988
2043
  x *= gpuAcceleration ? 1 : -1;
1989
2044
  }
1990
2045
  }
@@ -2027,7 +2082,8 @@ function computeStyles(_ref4) {
2027
2082
  variation: getVariation(state.placement),
2028
2083
  popper: state.elements.popper,
2029
2084
  popperRect: state.rects.popper,
2030
- gpuAcceleration: gpuAcceleration
2085
+ gpuAcceleration: gpuAcceleration,
2086
+ isFixed: state.options.strategy === 'fixed'
2031
2087
  };
2032
2088
 
2033
2089
  if (state.modifiersData.popperOffsets != null) {
@@ -2285,7 +2341,7 @@ function getInnerBoundingClientRect(element) {
2285
2341
  }
2286
2342
 
2287
2343
  function getClientRectFromMixedType(element, clippingParent) {
2288
- return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
2344
+ return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
2289
2345
  } // A "clipping parent" is an overflowable container with the characteristic of
2290
2346
  // clipping (or hiding) overflowing elements with a position different from
2291
2347
  // `initial`
@@ -2302,7 +2358,7 @@ function getClippingParents(element) {
2302
2358
 
2303
2359
 
2304
2360
  return clippingParents.filter(function (clippingParent) {
2305
- return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
2361
+ return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body' && (canEscapeClipping ? getComputedStyle$1(clippingParent).position !== 'static' : true);
2306
2362
  });
2307
2363
  } // Gets the maximum area that the element is visible in due to any number of
2308
2364
  // clipping parents
@@ -2802,6 +2858,14 @@ function preventOverflow(_ref) {
2802
2858
  var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
2803
2859
  placement: state.placement
2804
2860
  })) : tetherOffset;
2861
+ var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
2862
+ mainAxis: tetherOffsetValue,
2863
+ altAxis: tetherOffsetValue
2864
+ } : Object.assign({
2865
+ mainAxis: 0,
2866
+ altAxis: 0
2867
+ }, tetherOffsetValue);
2868
+ var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
2805
2869
  var data = {
2806
2870
  x: 0,
2807
2871
  y: 0
@@ -2811,13 +2875,15 @@ function preventOverflow(_ref) {
2811
2875
  return;
2812
2876
  }
2813
2877
 
2814
- if (checkMainAxis || checkAltAxis) {
2878
+ if (checkMainAxis) {
2879
+ var _offsetModifierState$;
2880
+
2815
2881
  var mainSide = mainAxis === 'y' ? top : left;
2816
2882
  var altSide = mainAxis === 'y' ? bottom : right;
2817
2883
  var len = mainAxis === 'y' ? 'height' : 'width';
2818
2884
  var offset = popperOffsets[mainAxis];
2819
- var min$1 = popperOffsets[mainAxis] + overflow[mainSide];
2820
- var max$1 = popperOffsets[mainAxis] - overflow[altSide];
2885
+ var min$1 = offset + overflow[mainSide];
2886
+ var max$1 = offset - overflow[altSide];
2821
2887
  var additive = tether ? -popperRect[len] / 2 : 0;
2822
2888
  var minLen = variation === start ? referenceRect[len] : popperRect[len];
2823
2889
  var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
@@ -2837,36 +2903,45 @@ function preventOverflow(_ref) {
2837
2903
  // width or height)
2838
2904
 
2839
2905
  var arrowLen = within(0, referenceRect[len], arrowRect[len]);
2840
- var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;
2841
- var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;
2906
+ var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
2907
+ var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
2842
2908
  var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
2843
2909
  var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
2844
- var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;
2845
- var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;
2846
- var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;
2910
+ var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
2911
+ var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
2912
+ var tetherMax = offset + maxOffset - offsetModifierValue;
2913
+ var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
2914
+ popperOffsets[mainAxis] = preventedOffset;
2915
+ data[mainAxis] = preventedOffset - offset;
2916
+ }
2847
2917
 
2848
- if (checkMainAxis) {
2849
- var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
2850
- popperOffsets[mainAxis] = preventedOffset;
2851
- data[mainAxis] = preventedOffset - offset;
2852
- }
2918
+ if (checkAltAxis) {
2919
+ var _offsetModifierState$2;
2853
2920
 
2854
- if (checkAltAxis) {
2855
- var _mainSide = mainAxis === 'x' ? top : left;
2921
+ var _mainSide = mainAxis === 'x' ? top : left;
2856
2922
 
2857
- var _altSide = mainAxis === 'x' ? bottom : right;
2923
+ var _altSide = mainAxis === 'x' ? bottom : right;
2858
2924
 
2859
- var _offset = popperOffsets[altAxis];
2925
+ var _offset = popperOffsets[altAxis];
2860
2926
 
2861
- var _min = _offset + overflow[_mainSide];
2927
+ var _len = altAxis === 'y' ? 'height' : 'width';
2862
2928
 
2863
- var _max = _offset - overflow[_altSide];
2929
+ var _min = _offset + overflow[_mainSide];
2864
2930
 
2865
- var _preventedOffset = within(tether ? min(_min, tetherMin) : _min, _offset, tether ? max(_max, tetherMax) : _max);
2931
+ var _max = _offset - overflow[_altSide];
2866
2932
 
2867
- popperOffsets[altAxis] = _preventedOffset;
2868
- data[altAxis] = _preventedOffset - _offset;
2869
- }
2933
+ var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
2934
+
2935
+ var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
2936
+
2937
+ var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
2938
+
2939
+ var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
2940
+
2941
+ var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
2942
+
2943
+ popperOffsets[altAxis] = _preventedOffset;
2944
+ data[altAxis] = _preventedOffset - _offset;
2870
2945
  }
2871
2946
 
2872
2947
  state.modifiersData[name] = data;
@@ -2898,8 +2973,8 @@ function getNodeScroll(node) {
2898
2973
 
2899
2974
  function isElementScaled(element) {
2900
2975
  var rect = element.getBoundingClientRect();
2901
- var scaleX = rect.width / element.offsetWidth || 1;
2902
- var scaleY = rect.height / element.offsetHeight || 1;
2976
+ var scaleX = round(rect.width) / element.offsetWidth || 1;
2977
+ var scaleY = round(rect.height) / element.offsetHeight || 1;
2903
2978
  return scaleX !== 1 || scaleY !== 1;
2904
2979
  } // Returns the composite rect of an element relative to its offsetParent.
2905
2980
  // Composite means it takes into account transforms as well as layout.
@@ -2911,9 +2986,9 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
2911
2986
  }
2912
2987
 
2913
2988
  var isOffsetParentAnElement = isHTMLElement(offsetParent);
2914
- isHTMLElement(offsetParent) && isElementScaled(offsetParent);
2989
+ var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
2915
2990
  var documentElement = getDocumentElement(offsetParent);
2916
- var rect = getBoundingClientRect(elementOrVirtualElement);
2991
+ var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
2917
2992
  var scroll = {
2918
2993
  scrollLeft: 0,
2919
2994
  scrollTop: 0
@@ -2930,7 +3005,7 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
2930
3005
  }
2931
3006
 
2932
3007
  if (isHTMLElement(offsetParent)) {
2933
- offsets = getBoundingClientRect(offsetParent);
3008
+ offsets = getBoundingClientRect(offsetParent, true);
2934
3009
  offsets.x += offsetParent.clientLeft;
2935
3010
  offsets.y += offsetParent.clientTop;
2936
3011
  } else if (documentElement) {
@@ -3850,6 +3925,176 @@ const CDropdownPlugin = {
3850
3925
  },
3851
3926
  };
3852
3927
 
3928
+ const CSpinner = defineComponent({
3929
+ name: 'CSpinner',
3930
+ props: {
3931
+ /**
3932
+ * Sets the color context of the component to one of CoreUI’s themed colors.
3933
+ *
3934
+ * @values 'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark', 'light'
3935
+ */
3936
+ color: {
3937
+ type: String,
3938
+ default: undefined,
3939
+ required: false,
3940
+ validator: (value) => {
3941
+ return [
3942
+ 'primary',
3943
+ 'secondary',
3944
+ 'success',
3945
+ 'danger',
3946
+ 'warning',
3947
+ 'info',
3948
+ 'dark',
3949
+ 'light',
3950
+ ].includes(value);
3951
+ },
3952
+ },
3953
+ /**
3954
+ * Component used for the root node. Either a string to use a HTML element or a component.
3955
+ */
3956
+ component: {
3957
+ type: String,
3958
+ default: 'div',
3959
+ required: false,
3960
+ },
3961
+ /**
3962
+ * Size the component small.
3963
+ *
3964
+ * @values 'sm'
3965
+ */
3966
+ size: {
3967
+ type: String,
3968
+ default: undefined,
3969
+ required: false,
3970
+ validator: (value) => {
3971
+ return value === 'sm';
3972
+ },
3973
+ },
3974
+ /**
3975
+ * Set the button variant to an outlined button or a ghost button.
3976
+ *
3977
+ * @values 'border', 'grow'
3978
+ */
3979
+ variant: {
3980
+ type: String,
3981
+ default: 'border',
3982
+ required: false,
3983
+ validator: (value) => {
3984
+ return ['border', 'grow'].includes(value);
3985
+ },
3986
+ },
3987
+ /**
3988
+ * Set visually hidden label for accessibility purposes.
3989
+ */
3990
+ visuallyHiddenLabel: {
3991
+ type: String,
3992
+ default: 'Loading...',
3993
+ required: false,
3994
+ },
3995
+ },
3996
+ setup(props) {
3997
+ return () => h$1(props.component, {
3998
+ class: [
3999
+ `spinner-${props.variant}`,
4000
+ `text-${props.color}`,
4001
+ props.size && `spinner-${props.variant}-${props.size}`,
4002
+ ],
4003
+ role: 'status',
4004
+ }, h$1('span', { class: ['visually-hidden'] }, props.visuallyHiddenLabel));
4005
+ },
4006
+ });
4007
+
4008
+ const CSpinnerPlugin = {
4009
+ install: (app) => {
4010
+ app.component(CSpinner.name, CSpinner);
4011
+ },
4012
+ };
4013
+
4014
+ const CElementCover = defineComponent({
4015
+ name: 'CElementCover',
4016
+ props: {
4017
+ /**
4018
+ * Array of custom boundaries. Use to create custom cover area (instead of parent element area). Area is defined by four sides: 'top', 'bottom', 'right', 'left'. If side is not defined by any custom boundary it is equal to parent element boundary. Each custom boundary is object with keys:
4019
+ * - sides (array) - select boundaries of element to define boundaries. Sides names: 'top', 'bottom', 'right', 'left'.
4020
+ * - query (string) - query used to get element which define boundaries. Search will be done only inside parent element, by parent.querySelector(query) function. [docs]
4021
+ *
4022
+ * @type {sides: string[], query: string}[]
4023
+ */
4024
+ boundaries: {
4025
+ // TODO: check if this is correct, TJ
4026
+ type: Array,
4027
+ require: true,
4028
+ },
4029
+ /**
4030
+ * Opacity of the cover. [docs]
4031
+ *
4032
+ * @type number
4033
+ */
4034
+ opacity: {
4035
+ type: Number,
4036
+ require: false,
4037
+ },
4038
+ },
4039
+ setup(props) {
4040
+ let containerCoords = {};
4041
+ const elementRef = ref();
4042
+ const getCustomBoundaries = () => {
4043
+ if (!props.boundaries || elementRef === null) {
4044
+ return {};
4045
+ }
4046
+ const parent = elementRef.value.parentElement;
4047
+ if (!parent) {
4048
+ return {};
4049
+ }
4050
+ const parentCoords = parent.getBoundingClientRect();
4051
+ const customBoundaries = {};
4052
+ props.boundaries.forEach((value) => {
4053
+ const element = parent.querySelector(value.query);
4054
+ if (!element || !value.sides) {
4055
+ return;
4056
+ }
4057
+ const coords = element.getBoundingClientRect();
4058
+ value.sides.forEach((side) => {
4059
+ const sideMargin = Math.abs(coords[side] - parentCoords[side]);
4060
+ customBoundaries[side] = `${sideMargin}px`;
4061
+ });
4062
+ });
4063
+ return customBoundaries;
4064
+ };
4065
+ onMounted(function () {
4066
+ nextTick(function () {
4067
+ containerCoords = getCustomBoundaries();
4068
+ });
4069
+ });
4070
+ return () => h$1('div', {
4071
+ style: {
4072
+ ...containerCoords,
4073
+ position: 'absolute',
4074
+ 'background-color': `rgb(255,255,255,${props.opacity})`,
4075
+ },
4076
+ ref: elementRef,
4077
+ }, h$1('div', // TODO: use slot to override this
4078
+ {
4079
+ style: {
4080
+ position: 'absolute',
4081
+ top: '50%',
4082
+ left: '50%',
4083
+ transform: 'translateX(-50%) translateY(-50%)',
4084
+ },
4085
+ }, h$1(CSpinner, {
4086
+ variant: 'grow',
4087
+ color: 'primary',
4088
+ })));
4089
+ },
4090
+ });
4091
+
4092
+ const CElementCoverPlugin = {
4093
+ install: (app) => {
4094
+ app.component(CElementCover.name, CElementCover);
4095
+ },
4096
+ };
4097
+
3853
4098
  const CFooter = defineComponent({
3854
4099
  name: 'CFooter',
3855
4100
  props: {
@@ -3941,9 +4186,8 @@ const CFormLabel = defineComponent({
3941
4186
  required: false,
3942
4187
  },
3943
4188
  },
3944
- setup(props, { attrs, slots }) {
4189
+ setup(props, { slots }) {
3945
4190
  return () => h$1('label', {
3946
- ...attrs,
3947
4191
  class: props.customClassName ? props.customClassName : 'form-label',
3948
4192
  }, slots.default && slots.default());
3949
4193
  },
@@ -3951,6 +4195,7 @@ const CFormLabel = defineComponent({
3951
4195
 
3952
4196
  const CFormCheck = defineComponent({
3953
4197
  name: 'CFormCheck',
4198
+ inheritAttrs: false,
3954
4199
  props: {
3955
4200
  /**
3956
4201
  * Create button-like checkboxes and radio buttons.
@@ -4001,6 +4246,10 @@ const CFormCheck = defineComponent({
4001
4246
  default: undefined,
4002
4247
  required: false,
4003
4248
  },
4249
+ /**
4250
+ * Input Checkbox indeterminate Property
4251
+ */
4252
+ indeterminate: Boolean,
4004
4253
  /**
4005
4254
  * Group checkboxes or radios on the same horizontal row by adding.
4006
4255
  */
@@ -4023,6 +4272,14 @@ const CFormCheck = defineComponent({
4023
4272
  default: undefined,
4024
4273
  required: false,
4025
4274
  },
4275
+ /**
4276
+ * The default name for a value passed using v-model.
4277
+ */
4278
+ modelValue: {
4279
+ type: [Boolean, String],
4280
+ value: undefined,
4281
+ required: false,
4282
+ },
4026
4283
  /**
4027
4284
  * Specifies the type of component.
4028
4285
  *
@@ -4041,19 +4298,37 @@ const CFormCheck = defineComponent({
4041
4298
  required: false,
4042
4299
  },
4043
4300
  },
4044
- setup(props, { slots, attrs }) {
4045
- const formControl = () => {
4046
- return h$1('input', {
4047
- ...attrs,
4048
- class: [
4049
- props.button ? 'btn-check' : 'form-check-input',
4050
- {
4051
- 'is-invalid': props.invalid,
4052
- 'is-valid': props.valid,
4301
+ emits: [
4302
+ /**
4303
+ * Event occurs when the checked value has been changed.
4304
+ */
4305
+ 'change',
4306
+ /**
4307
+ * Emit the new value whenever there’s a change event.
4308
+ */
4309
+ 'update:modelValue',
4310
+ ],
4311
+ setup(props, { attrs, emit, slots }) {
4312
+ const handleChange = (event) => {
4313
+ const target = event.target;
4314
+ emit('change', event);
4315
+ emit('update:modelValue', target.checked);
4316
+ };
4317
+ const formControl = () => {
4318
+ return h$1('input', {
4319
+ checked: props.modelValue,
4320
+ class: [
4321
+ props.button ? 'btn-check' : 'form-check-input',
4322
+ {
4323
+ 'is-invalid': props.invalid,
4324
+ 'is-valid': props.valid,
4053
4325
  },
4054
4326
  ],
4055
4327
  id: props.id,
4328
+ indeterminate: props.indeterminate,
4329
+ onChange: (event) => handleChange(event),
4056
4330
  type: props.type,
4331
+ ...attrs,
4057
4332
  });
4058
4333
  };
4059
4334
  const formLabel = () => {
@@ -4154,6 +4429,14 @@ const CFormInput = defineComponent({
4154
4429
  type: Boolean,
4155
4430
  required: false,
4156
4431
  },
4432
+ /**
4433
+ * The default name for a value passed using v-model.
4434
+ */
4435
+ modelValue: {
4436
+ type: String,
4437
+ default: undefined,
4438
+ require: false,
4439
+ },
4157
4440
  /**
4158
4441
  * Render the component styled as plain text. Removes the default form field styling and preserve the correct margin and padding. Recommend to use only along side `readonly`.
4159
4442
  */
@@ -4199,12 +4482,32 @@ const CFormInput = defineComponent({
4199
4482
  required: false,
4200
4483
  },
4201
4484
  },
4202
- setup(props, { attrs, slots }) {
4485
+ emits: [
4486
+ /**
4487
+ * Event occurs when the element loses focus, after the content has been changed.
4488
+ */
4489
+ 'change',
4490
+ /**
4491
+ * Event occurs immediately after the value of a component has changed.
4492
+ */
4493
+ 'input',
4494
+ /**
4495
+ * Emit the new value whenever there’s an input or change event.
4496
+ */
4497
+ 'update:modelValue',
4498
+ ],
4499
+ setup(props, { emit, slots }) {
4500
+ const handleChange = (event) => {
4501
+ const target = event.target;
4502
+ emit('change', event);
4503
+ emit('update:modelValue', target.value);
4504
+ };
4505
+ const handleInput = (event) => {
4506
+ const target = event.target;
4507
+ emit('input', event);
4508
+ emit('update:modelValue', target.value);
4509
+ };
4203
4510
  return () => h$1('input', {
4204
- type: props.type,
4205
- disabled: props.disabled,
4206
- readonly: props.readonly,
4207
- ...attrs,
4208
4511
  class: [
4209
4512
  props.plainText ? 'form-control-plaintext' : 'form-control',
4210
4513
  {
@@ -4214,6 +4517,12 @@ const CFormInput = defineComponent({
4214
4517
  'is-valid': props.valid,
4215
4518
  },
4216
4519
  ],
4520
+ disabled: props.disabled,
4521
+ onChange: (event) => handleChange(event),
4522
+ onInput: (event) => handleInput(event),
4523
+ readonly: props.readonly,
4524
+ type: props.type,
4525
+ value: props.modelValue,
4217
4526
  }, slots.default && slots.default());
4218
4527
  },
4219
4528
  });
@@ -4245,6 +4554,14 @@ const CFormRange = defineComponent({
4245
4554
  default: undefined,
4246
4555
  required: false,
4247
4556
  },
4557
+ /**
4558
+ * The default name for a value passed using v-model.
4559
+ */
4560
+ modelValue: {
4561
+ type: String,
4562
+ value: undefined,
4563
+ required: false,
4564
+ },
4248
4565
  /**
4249
4566
  * Toggle the readonly state for the component.
4250
4567
  */
@@ -4271,12 +4588,32 @@ const CFormRange = defineComponent({
4271
4588
  required: false,
4272
4589
  },
4273
4590
  },
4274
- setup(props, { attrs, slots }) {
4591
+ emits: [
4592
+ /**
4593
+ * Event occurs when the value has been changed.
4594
+ */
4595
+ 'change',
4596
+ /**
4597
+ * Emit the new value whenever there’s a change event.
4598
+ */
4599
+ 'update:modelValue',
4600
+ ],
4601
+ setup(props, { emit, slots }) {
4602
+ const handleChange = (event) => {
4603
+ const target = event.target;
4604
+ emit('change', event);
4605
+ emit('update:modelValue', target.value);
4606
+ };
4275
4607
  return () => h$1('input', {
4276
4608
  class: 'form-range',
4609
+ disabled: props.disabled,
4610
+ max: props.max,
4611
+ min: props.min,
4612
+ onChange: (event) => handleChange(event),
4613
+ steps: props.steps,
4614
+ readonly: props.readonly,
4277
4615
  type: 'range',
4278
- ...attrs,
4279
- ...props,
4616
+ value: props.modelValue,
4280
4617
  }, slots.default && slots.default());
4281
4618
  },
4282
4619
  });
@@ -4299,6 +4636,25 @@ const CFormSelect = defineComponent({
4299
4636
  type: Boolean,
4300
4637
  required: false,
4301
4638
  },
4639
+ /**
4640
+ * The default name for a value passed using v-model.
4641
+ */
4642
+ modelValue: {
4643
+ type: String,
4644
+ default: undefined,
4645
+ require: false,
4646
+ },
4647
+ /**
4648
+ * Options list of the select component. Available keys: `label`, `value`, `disabled`.
4649
+ * Examples:
4650
+ * - `:options="[{ value: 'js', label: 'JavaScript' }, { value: 'html', label: 'HTML', disabled: true }]"`
4651
+ * - `:options="['js', 'html']"`
4652
+ */
4653
+ options: {
4654
+ type: Array,
4655
+ default: undefined,
4656
+ required: false,
4657
+ },
4302
4658
  /**
4303
4659
  * Size the component small or large.
4304
4660
  *
@@ -4320,22 +4676,52 @@ const CFormSelect = defineComponent({
4320
4676
  required: false,
4321
4677
  },
4322
4678
  },
4323
- setup(props, { attrs, slots }) {
4679
+ emits: [
4680
+ /**
4681
+ * Event occurs when when a user changes the selected option of a `<select>` element.
4682
+ */
4683
+ 'change',
4684
+ /**
4685
+ * Emit the new value whenever there’s a change event.
4686
+ */
4687
+ 'update:modelValue',
4688
+ ],
4689
+ setup(props, { emit, slots }) {
4690
+ const handleChange = (event) => {
4691
+ const target = event.target;
4692
+ const selected = Array.from(target.options)
4693
+ .filter((option) => option.selected)
4694
+ .map((option) => option.value);
4695
+ const value = target.multiple ? selected : selected[0];
4696
+ emit('change', event);
4697
+ emit('update:modelValue', value);
4698
+ };
4324
4699
  return () => h$1('select', {
4325
- ...attrs,
4326
4700
  class: [
4327
4701
  'form-select',
4328
4702
  {
4329
4703
  [`form-select-${props.size}`]: props.size,
4704
+ 'is-invalid': props.invalid,
4705
+ 'is-valid': props.valid,
4330
4706
  },
4331
4707
  ],
4708
+ onChange: (event) => handleChange(event),
4332
4709
  size: props.htmlSize,
4333
- }, slots.default && slots.default());
4710
+ }, props.options
4711
+ ? props.options.map((option) => {
4712
+ return h$1('option', {
4713
+ ...(typeof option === 'object' &&
4714
+ option.disabled && { disabled: option.disabled }),
4715
+ ...(typeof option === 'object' && option.value && { value: option.value }),
4716
+ }, typeof option === 'string' ? option : option.label);
4717
+ })
4718
+ : slots.default && slots.default());
4334
4719
  },
4335
4720
  });
4336
4721
 
4337
4722
  const CFormSwitch = defineComponent({
4338
4723
  name: 'CFormSwitch',
4724
+ inheritAttrs: false,
4339
4725
  props: {
4340
4726
  /**
4341
4727
  * The id global attribute defines an identifier (ID) that must be unique in the whole document
@@ -4360,6 +4746,14 @@ const CFormSwitch = defineComponent({
4360
4746
  default: undefined,
4361
4747
  required: false,
4362
4748
  },
4749
+ /**
4750
+ * The default name for a value passed using v-model.
4751
+ */
4752
+ modelValue: {
4753
+ type: [Boolean, String],
4754
+ value: undefined,
4755
+ required: false,
4756
+ },
4363
4757
  /**
4364
4758
  * Size the component large or extra large. Works only with `switch`.
4365
4759
  *
@@ -4391,7 +4785,32 @@ const CFormSwitch = defineComponent({
4391
4785
  required: false,
4392
4786
  },
4393
4787
  },
4394
- setup(props, { attrs }) {
4788
+ emits: [
4789
+ /**
4790
+ * Event occurs when the checked value has been changed.
4791
+ */
4792
+ 'change',
4793
+ /**
4794
+ * Emit the new value whenever there’s a change event.
4795
+ */
4796
+ 'update:modelValue',
4797
+ ],
4798
+ setup(props, { attrs, emit }) {
4799
+ const checked = ref(attrs.checked);
4800
+ onMounted(() => {
4801
+ if (props.modelValue && typeof props.modelValue === 'boolean') {
4802
+ console.log(props.modelValue);
4803
+ }
4804
+ });
4805
+ watch(() => props.modelValue, () => {
4806
+ if (typeof props.modelValue === 'boolean')
4807
+ checked.value = props.modelValue;
4808
+ });
4809
+ const handleChange = (event) => {
4810
+ const target = event.target;
4811
+ emit('change', event);
4812
+ emit('update:modelValue', target.checked);
4813
+ };
4395
4814
  return () => h$1('div', {
4396
4815
  class: [
4397
4816
  'form-check form-switch',
@@ -4404,8 +4823,7 @@ const CFormSwitch = defineComponent({
4404
4823
  }, [
4405
4824
  h$1('input', {
4406
4825
  ...attrs,
4407
- id: props.id,
4408
- type: props.type,
4826
+ checked: checked.value,
4409
4827
  class: [
4410
4828
  'form-check-input',
4411
4829
  {
@@ -4413,6 +4831,9 @@ const CFormSwitch = defineComponent({
4413
4831
  'is-valid': props.valid,
4414
4832
  },
4415
4833
  ],
4834
+ id: props.id,
4835
+ onChange: (event) => handleChange(event),
4836
+ type: props.type,
4416
4837
  }),
4417
4838
  props.label &&
4418
4839
  h$1(CFormLabel, {
@@ -4459,6 +4880,14 @@ const CFormTextarea = defineComponent({
4459
4880
  type: Boolean,
4460
4881
  required: false,
4461
4882
  },
4883
+ /**
4884
+ * The default name for a value passed using v-model.
4885
+ */
4886
+ modelValue: {
4887
+ type: String,
4888
+ default: undefined,
4889
+ require: false,
4890
+ },
4462
4891
  /**
4463
4892
  * Render the component styled as plain text. Removes the default form field styling and preserve the correct margin and padding. Recommend to use only along side `readonly`.
4464
4893
  */
@@ -4481,9 +4910,27 @@ const CFormTextarea = defineComponent({
4481
4910
  required: false,
4482
4911
  },
4483
4912
  },
4484
- setup(props, { attrs, slots }) {
4913
+ emits: [
4914
+ /**
4915
+ * Event occurs when the element loses focus, after the content has been changed.
4916
+ */
4917
+ 'change',
4918
+ /**
4919
+ * Event occurs immediately after the value of a component has changed.
4920
+ */
4921
+ 'input',
4922
+ /**
4923
+ * Emit the new value whenever there’s an input or change event.
4924
+ */
4925
+ 'update:modelValue',
4926
+ ],
4927
+ setup(props, { emit, slots }) {
4928
+ const handleInput = (event) => {
4929
+ const target = event.target;
4930
+ emit('input', event);
4931
+ emit('update:modelValue', target.value);
4932
+ };
4485
4933
  return () => h$1('textarea', {
4486
- ...attrs,
4487
4934
  disabled: props.disabled,
4488
4935
  readonly: props.readonly,
4489
4936
  class: [
@@ -4493,6 +4940,8 @@ const CFormTextarea = defineComponent({
4493
4940
  'is-valid': props.valid,
4494
4941
  },
4495
4942
  ],
4943
+ onInput: (event) => handleInput(event),
4944
+ value: props.modelValue,
4496
4945
  }, slots.default && slots.default());
4497
4946
  },
4498
4947
  });
@@ -4562,7 +5011,7 @@ const CFormPlugin = {
4562
5011
  },
4563
5012
  };
4564
5013
 
4565
- const BREAKPOINTS$2 = [
5014
+ const BREAKPOINTS$4 = [
4566
5015
  'xxl',
4567
5016
  'xl',
4568
5017
  'lg',
@@ -4635,40 +5084,40 @@ const CCol = defineComponent({
4635
5084
  },
4636
5085
  },
4637
5086
  setup(props, { slots }) {
4638
- const repsonsiveCLassNames = [];
4639
- BREAKPOINTS$2.forEach((bp) => {
5087
+ const repsonsiveClassNames = [];
5088
+ BREAKPOINTS$4.forEach((bp) => {
4640
5089
  const breakpoint = props[bp];
4641
5090
  const infix = bp === 'xs' ? '' : `-${bp}`;
4642
5091
  if (breakpoint) {
4643
5092
  if (typeof breakpoint === 'number' || typeof breakpoint === 'string') {
4644
- repsonsiveCLassNames.push(`col${infix}-${breakpoint}`);
5093
+ repsonsiveClassNames.push(`col${infix}-${breakpoint}`);
4645
5094
  }
4646
5095
  if (typeof breakpoint === 'boolean') {
4647
- repsonsiveCLassNames.push(`col${infix}`);
5096
+ repsonsiveClassNames.push(`col${infix}`);
4648
5097
  }
4649
5098
  }
4650
5099
  if (breakpoint && typeof breakpoint === 'object') {
4651
5100
  if (typeof breakpoint.span === 'number' || typeof breakpoint.span === 'string') {
4652
- repsonsiveCLassNames.push(`col${infix}-${breakpoint.span}`);
5101
+ repsonsiveClassNames.push(`col${infix}-${breakpoint.span}`);
4653
5102
  }
4654
5103
  if (typeof breakpoint.span === 'boolean') {
4655
- repsonsiveCLassNames.push(`col${infix}`);
5104
+ repsonsiveClassNames.push(`col${infix}`);
4656
5105
  }
4657
5106
  if (typeof breakpoint.order === 'number' || typeof breakpoint.order === 'string') {
4658
- repsonsiveCLassNames.push(`order${infix}-${breakpoint.order}`);
5107
+ repsonsiveClassNames.push(`order${infix}-${breakpoint.order}`);
4659
5108
  }
4660
5109
  if (typeof breakpoint.offset === 'number') {
4661
- repsonsiveCLassNames.push(`offset${infix}-${breakpoint.offset}`);
5110
+ repsonsiveClassNames.push(`offset${infix}-${breakpoint.offset}`);
4662
5111
  }
4663
5112
  }
4664
5113
  });
4665
5114
  return () => h$1('div', {
4666
- class: [repsonsiveCLassNames.length ? repsonsiveCLassNames : 'col'],
5115
+ class: [repsonsiveClassNames.length ? repsonsiveClassNames : 'col'],
4667
5116
  }, slots.default && slots.default());
4668
5117
  },
4669
5118
  });
4670
5119
 
4671
- const BREAKPOINTS$1 = [
5120
+ const BREAKPOINTS$3 = [
4672
5121
  'xxl',
4673
5122
  'xl',
4674
5123
  'lg',
@@ -4723,18 +5172,18 @@ const CContainer = defineComponent({
4723
5172
  },
4724
5173
  },
4725
5174
  setup(props, { slots }) {
4726
- const repsonsiveCLassNames = [];
4727
- BREAKPOINTS$1.forEach((bp) => {
5175
+ const repsonsiveClassNames = [];
5176
+ BREAKPOINTS$3.forEach((bp) => {
4728
5177
  const breakpoint = props[bp];
4729
- breakpoint && repsonsiveCLassNames.push(`container-${bp}`);
5178
+ breakpoint && repsonsiveClassNames.push(`container-${bp}`);
4730
5179
  });
4731
5180
  return () => h$1('div', {
4732
- class: [repsonsiveCLassNames.length ? repsonsiveCLassNames : 'container'],
5181
+ class: [repsonsiveClassNames.length ? repsonsiveClassNames : 'container'],
4733
5182
  }, slots.default && slots.default());
4734
5183
  },
4735
5184
  });
4736
5185
 
4737
- const BREAKPOINTS = [
5186
+ const BREAKPOINTS$2 = [
4738
5187
  'xxl',
4739
5188
  'xl',
4740
5189
  'lg',
@@ -4807,27 +5256,27 @@ const CRow = defineComponent({
4807
5256
  },
4808
5257
  },
4809
5258
  setup(props, { slots }) {
4810
- const repsonsiveCLassNames = [];
4811
- BREAKPOINTS.forEach((bp) => {
5259
+ const repsonsiveClassNames = [];
5260
+ BREAKPOINTS$2.forEach((bp) => {
4812
5261
  const breakpoint = props[bp];
4813
5262
  const infix = bp === 'xs' ? '' : `-${bp}`;
4814
5263
  if (typeof breakpoint === 'object') {
4815
5264
  if (breakpoint.cols) {
4816
- repsonsiveCLassNames.push(`row-cols${infix}-${breakpoint.cols}`);
5265
+ repsonsiveClassNames.push(`row-cols${infix}-${breakpoint.cols}`);
4817
5266
  }
4818
5267
  if (typeof breakpoint.gutter === 'number') {
4819
- repsonsiveCLassNames.push(`g${infix}-${breakpoint.gutter}`);
5268
+ repsonsiveClassNames.push(`g${infix}-${breakpoint.gutter}`);
4820
5269
  }
4821
5270
  if (typeof breakpoint.gutterX === 'number') {
4822
- repsonsiveCLassNames.push(`gx${infix}-${breakpoint.gutterX}`);
5271
+ repsonsiveClassNames.push(`gx${infix}-${breakpoint.gutterX}`);
4823
5272
  }
4824
5273
  if (typeof breakpoint.gutterY === 'number') {
4825
- repsonsiveCLassNames.push(`gy${infix}-${breakpoint.gutterY}`);
5274
+ repsonsiveClassNames.push(`gy${infix}-${breakpoint.gutterY}`);
4826
5275
  }
4827
5276
  }
4828
5277
  });
4829
5278
  return () => h$1('div', {
4830
- class: ['row', repsonsiveCLassNames],
5279
+ class: ['row', repsonsiveClassNames],
4831
5280
  }, slots.default && slots.default());
4832
5281
  },
4833
5282
  });
@@ -5121,86 +5570,6 @@ const CListGroupPlugin = {
5121
5570
  },
5122
5571
  };
5123
5572
 
5124
- const CSpinner = defineComponent({
5125
- name: 'CSpinner',
5126
- props: {
5127
- /**
5128
- * Sets the color context of the component to one of CoreUI’s themed colors.
5129
- *
5130
- * @values 'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark', 'light'
5131
- */
5132
- color: {
5133
- type: String,
5134
- default: undefined,
5135
- required: false,
5136
- validator: (value) => {
5137
- return [
5138
- 'primary',
5139
- 'secondary',
5140
- 'success',
5141
- 'danger',
5142
- 'warning',
5143
- 'info',
5144
- 'dark',
5145
- 'light',
5146
- ].includes(value);
5147
- },
5148
- },
5149
- /**
5150
- * Component used for the root node. Either a string to use a HTML element or a component.
5151
- */
5152
- component: {
5153
- type: String,
5154
- default: 'div',
5155
- required: false,
5156
- },
5157
- /**
5158
- * Size the component small.
5159
- *
5160
- * @values 'sm'
5161
- */
5162
- size: {
5163
- type: String,
5164
- default: undefined,
5165
- required: false,
5166
- validator: (value) => {
5167
- return value === 'sm';
5168
- },
5169
- },
5170
- /**
5171
- * Set the button variant to an outlined button or a ghost button.
5172
- *
5173
- * @values 'border', 'grow'
5174
- */
5175
- variant: {
5176
- type: String,
5177
- default: 'border',
5178
- required: false,
5179
- validator: (value) => {
5180
- return ['border', 'grow'].includes(value);
5181
- },
5182
- },
5183
- /**
5184
- * Set visually hidden label for accessibility purposes.
5185
- */
5186
- visuallyHiddenLabel: {
5187
- type: String,
5188
- default: 'Loading...',
5189
- required: false,
5190
- },
5191
- },
5192
- setup(props) {
5193
- return () => h$1(props.component, {
5194
- class: [
5195
- `spinner-${props.variant}`,
5196
- `text-${props.color}`,
5197
- props.size && `spinner-${props.variant}-${props.size}`,
5198
- ],
5199
- role: 'status',
5200
- }, h$1('span', { class: ['visually-hidden'] }, props.visuallyHiddenLabel));
5201
- },
5202
- });
5203
-
5204
5573
  const CLoadingButton = defineComponent({
5205
5574
  name: 'CLoadingButton',
5206
5575
  props: {
@@ -6685,20 +7054,19 @@ const COffcanvas = defineComponent({
6685
7054
  onAfterEnter: () => handleAfterEnter(),
6686
7055
  onLeave: (el, done) => handleLeave(el, done),
6687
7056
  onAfterLeave: (el) => handleAfterLeave(el),
6688
- }, () => visible.value &&
6689
- h$1('div', {
6690
- class: [
6691
- 'offcanvas',
6692
- {
6693
- [`offcanvas-${props.placement}`]: props.placement,
6694
- },
6695
- ],
6696
- ref: offcanvasRef,
6697
- role: 'dialog',
6698
- }, slots.default && slots.default())),
7057
+ }, () => withDirectives(h$1('div', {
7058
+ class: [
7059
+ 'offcanvas',
7060
+ {
7061
+ [`offcanvas-${props.placement}`]: props.placement,
7062
+ },
7063
+ ],
7064
+ ref: offcanvasRef,
7065
+ role: 'dialog',
7066
+ }, slots.default && slots.default()), [[vVisible, props.visible]])),
6699
7067
  props.backdrop &&
6700
7068
  h$1(CBackdrop, {
6701
- class: 'modal-backdrop',
7069
+ class: 'offcanvas-backdrop',
6702
7070
  visible: visible.value,
6703
7071
  }),
6704
7072
  ];
@@ -7036,7 +7404,7 @@ const CSmartPagination = defineComponent({
7036
7404
  }
7037
7405
  };
7038
7406
  return () => h$1(CPagination, {
7039
- class: [`justify-content-${props.align}`],
7407
+ align: props.align,
7040
7408
  'aria-label': 'pagination',
7041
7409
  size: props.size,
7042
7410
  }, {
@@ -7145,15 +7513,29 @@ const CPaginationPlugin = {
7145
7513
  },
7146
7514
  };
7147
7515
 
7148
- const CProgressBar = defineComponent({
7149
- name: 'CProgressBar',
7516
+ const BREAKPOINTS$1 = [
7517
+ 'xxl',
7518
+ 'xl',
7519
+ 'lg',
7520
+ 'md',
7521
+ 'sm',
7522
+ 'xs',
7523
+ ];
7524
+ const CPlaceholder = defineComponent({
7525
+ name: 'CPlaceholder',
7150
7526
  props: {
7151
7527
  /**
7152
- * Use to animate the stripes right to left via CSS3 animations.
7528
+ * Set animation type to better convey the perception of something being actively loaded.
7529
+ *
7530
+ * @values 'glow', 'wave'
7153
7531
  */
7154
- animated: {
7155
- type: Boolean,
7156
- required: false,
7532
+ animation: {
7533
+ type: String,
7534
+ default: undefined,
7535
+ require: false,
7536
+ validator: (value) => {
7537
+ return ['glow', 'wave'].includes(value);
7538
+ },
7157
7539
  },
7158
7540
  /**
7159
7541
  * Sets the color context of the component to one of CoreUI’s themed colors.
@@ -7162,7 +7544,124 @@ const CProgressBar = defineComponent({
7162
7544
  */
7163
7545
  color: Color,
7164
7546
  /**
7165
- * The percent to progress the ProgressBar.
7547
+ * Component used for the root node. Either a string to use a HTML element or a component.
7548
+ */
7549
+ component: {
7550
+ type: String,
7551
+ default: 'span',
7552
+ required: false,
7553
+ },
7554
+ /**
7555
+ * Size the component extra small, small, or large.
7556
+ *
7557
+ * @values 'xs', 'sm', 'lg'
7558
+ */
7559
+ size: {
7560
+ type: String,
7561
+ default: undefined,
7562
+ required: false,
7563
+ validator: (value) => {
7564
+ return ['xs', 'sm', 'lg'].includes(value);
7565
+ },
7566
+ },
7567
+ /**
7568
+ * The number of columns on extra small devices (<576px).
7569
+ */
7570
+ xs: {
7571
+ type: Number,
7572
+ default: undefined,
7573
+ require: false,
7574
+ },
7575
+ /**
7576
+ * The number of columns on small devices (<768px).
7577
+ */
7578
+ sm: {
7579
+ type: Number,
7580
+ default: undefined,
7581
+ require: false,
7582
+ },
7583
+ /**
7584
+ * The number of columns on medium devices (<992px).
7585
+ */
7586
+ md: {
7587
+ type: Number,
7588
+ default: undefined,
7589
+ require: false,
7590
+ },
7591
+ /**
7592
+ * The number of columns on large devices (<1200px).
7593
+ */
7594
+ lg: {
7595
+ type: Number,
7596
+ default: undefined,
7597
+ require: false,
7598
+ },
7599
+ /**
7600
+ * The number of columns on X-Large devices (<1400px).
7601
+ */
7602
+ xl: {
7603
+ type: Number,
7604
+ default: undefined,
7605
+ require: false,
7606
+ },
7607
+ /**
7608
+ * The number of columns on XX-Large devices (≥1400px).
7609
+ */
7610
+ xxl: {
7611
+ type: Number,
7612
+ default: undefined,
7613
+ require: false,
7614
+ },
7615
+ },
7616
+ setup(props, { slots }) {
7617
+ const repsonsiveClassNames = [];
7618
+ BREAKPOINTS$1.forEach((bp) => {
7619
+ const breakpoint = props[bp];
7620
+ const infix = bp === 'xs' ? '' : `-${bp}`;
7621
+ if (typeof breakpoint === 'number') {
7622
+ repsonsiveClassNames.push(`col${infix}-${breakpoint}`);
7623
+ }
7624
+ if (typeof breakpoint === 'boolean') {
7625
+ repsonsiveClassNames.push(`col${infix}`);
7626
+ }
7627
+ });
7628
+ return () => h$1(props.component, {
7629
+ class: [
7630
+ props.animation ? `placeholder-${props.animation}` : 'placeholder',
7631
+ {
7632
+ [`bg-${props.color}`]: props.color,
7633
+ [`placeholder-${props.size}`]: props.size,
7634
+ },
7635
+ repsonsiveClassNames,
7636
+ ],
7637
+ }, slots.default && slots.default());
7638
+ },
7639
+ });
7640
+
7641
+ const CPlaceholderPlugin = {
7642
+ install: (app) => {
7643
+ app.component(CPlaceholder.name, CPlaceholder);
7644
+ },
7645
+ };
7646
+
7647
+ const CProgressBar = defineComponent({
7648
+ name: 'CProgressBar',
7649
+ props: {
7650
+ /**
7651
+ * Use to animate the stripes right to left via CSS3 animations.
7652
+ */
7653
+ animated: {
7654
+ type: Boolean,
7655
+ required: false,
7656
+ },
7657
+ /**
7658
+ * Sets the color context of the component to one of CoreUI’s themed colors.
7659
+ *
7660
+ * @values 'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark', 'light'
7661
+ */
7662
+ color: Color,
7663
+ /**
7664
+ * The percent to progress the ProgressBar.
7166
7665
  */
7167
7666
  value: {
7168
7667
  type: Number,
@@ -7662,90 +8161,6 @@ const CSidebarPlugin = {
7662
8161
  },
7663
8162
  };
7664
8163
 
7665
- const CSpinnerPlugin = {
7666
- install: (app) => {
7667
- app.component(CSpinner.name, CSpinner);
7668
- },
7669
- };
7670
-
7671
- const CElementCover = defineComponent({
7672
- name: 'CElementCover',
7673
- props: {
7674
- /**
7675
- * Array of custom boundaries. Use to create custom cover area (instead of parent element area). Area is defined by four sides: 'top', 'bottom', 'right', 'left'. If side is not defined by any custom boundary it is equal to parent element boundary. Each custom boundary is object with keys:
7676
- * - sides (array) - select boundaries of element to define boundaries. Sides names: 'top', 'bottom', 'right', 'left'.
7677
- * - query (string) - query used to get element which define boundaries. Search will be done only inside parent element, by parent.querySelector(query) function. [docs]
7678
- *
7679
- * @type {sides: string[], query: string}[]
7680
- */
7681
- boundaries: {
7682
- // TODO: check if this is correct, TJ
7683
- type: Array,
7684
- require: true,
7685
- },
7686
- /**
7687
- * Opacity of the cover. [docs]
7688
- *
7689
- * @type number
7690
- */
7691
- opacity: {
7692
- type: Number,
7693
- require: false,
7694
- },
7695
- },
7696
- setup(props) {
7697
- let containerCoords = {};
7698
- const elementRef = ref();
7699
- const getCustomBoundaries = () => {
7700
- if (!props.boundaries || elementRef === null) {
7701
- return {};
7702
- }
7703
- const parent = elementRef.value.parentElement;
7704
- if (!parent) {
7705
- return {};
7706
- }
7707
- const parentCoords = parent.getBoundingClientRect();
7708
- const customBoundaries = {};
7709
- props.boundaries.forEach((value) => {
7710
- const element = parent.querySelector(value.query);
7711
- if (!element || !value.sides) {
7712
- return;
7713
- }
7714
- const coords = element.getBoundingClientRect();
7715
- value.sides.forEach((side) => {
7716
- const sideMargin = Math.abs(coords[side] - parentCoords[side]);
7717
- customBoundaries[side] = `${sideMargin}px`;
7718
- });
7719
- });
7720
- return customBoundaries;
7721
- };
7722
- onMounted(function () {
7723
- nextTick(function () {
7724
- containerCoords = getCustomBoundaries();
7725
- });
7726
- });
7727
- return () => h$1('div', {
7728
- style: {
7729
- ...containerCoords,
7730
- position: 'absolute',
7731
- 'background-color': `rgb(255,255,255,${props.opacity})`,
7732
- },
7733
- ref: elementRef,
7734
- }, h$1('div', // TODO: use slot to override this
7735
- {
7736
- style: {
7737
- position: 'absolute',
7738
- top: '50%',
7739
- left: '50%',
7740
- transform: 'translateX(-50%) translateY(-50%)',
7741
- },
7742
- }, h$1(CSpinner, {
7743
- variant: 'grow',
7744
- color: 'primary',
7745
- })));
7746
- },
7747
- });
7748
-
7749
8164
  const CTable = defineComponent({
7750
8165
  name: 'CTable',
7751
8166
  props: {
@@ -8320,30 +8735,31 @@ const CSmartTableHead = defineComponent({
8320
8735
  })),
8321
8736
  ],
8322
8737
  }),
8323
- h$1(CTableRow, {}, {
8324
- default: () => [
8325
- props.selectable && h$1(CTableHeaderCell),
8326
- props.columns.map((column) => h$1(CTableHeaderCell, {
8327
- ...tableHeaderCellProps(column),
8328
- }, {
8329
- default: () => (typeof column !== 'object'
8330
- ? true
8331
- : typeof column.filter === 'undefined'
8738
+ props.columnFilter &&
8739
+ h$1(CTableRow, {}, {
8740
+ default: () => [
8741
+ props.selectable && h$1(CTableHeaderCell),
8742
+ props.columns.map((column) => h$1(CTableHeaderCell, {
8743
+ ...tableHeaderCellProps(column),
8744
+ }, {
8745
+ default: () => (typeof column !== 'object'
8332
8746
  ? true
8333
- : column.filter) &&
8334
- h$1(CFormInput, {
8335
- size: 'sm',
8336
- onInput: (event) => handleFilterInput(key(column), event.target.value),
8337
- onChange: (event) => handleFilterChange(key(column), event.target.value),
8338
- 'aria-label': `column name: '${label(column)}' filter input`,
8339
- ...(props.columnFilter &&
8340
- props.columnFilter[key(column)] && {
8341
- value: props.columnFilter[key(column)],
8747
+ : typeof column.filter === 'undefined'
8748
+ ? true
8749
+ : column.filter) &&
8750
+ h$1(CFormInput, {
8751
+ size: 'sm',
8752
+ onInput: (event) => handleFilterInput(key(column), event.target.value),
8753
+ onChange: (event) => handleFilterChange(key(column), event.target.value),
8754
+ 'aria-label': `column name: '${label(column)}' filter input`,
8755
+ ...(props.columnFilter &&
8756
+ props.columnFilter[key(column)] && {
8757
+ value: props.columnFilter[key(column)],
8758
+ }),
8342
8759
  }),
8343
- }),
8344
- })),
8345
- ],
8346
- }),
8760
+ })),
8761
+ ],
8762
+ }),
8347
8763
  ],
8348
8764
  });
8349
8765
  },
@@ -8631,7 +9047,6 @@ const CSmartTable = defineComponent({
8631
9047
  */
8632
9048
  cleaner: {
8633
9049
  type: Boolean,
8634
- default: true,
8635
9050
  required: false,
8636
9051
  },
8637
9052
  /**
@@ -8842,7 +9257,6 @@ const CSmartTable = defineComponent({
8842
9257
  */
8843
9258
  tableFilter: {
8844
9259
  type: [Boolean, Object],
8845
- default: undefined,
8846
9260
  required: false,
8847
9261
  },
8848
9262
  /**
@@ -8952,16 +9366,19 @@ const CSmartTable = defineComponent({
8952
9366
  const items = ref(props.items.map((item, index) => {
8953
9367
  return { ...item, _id: index };
8954
9368
  }));
8955
- watch(props.items, () => {
9369
+ watch(() => props.items, () => {
8956
9370
  items.value = props.items.map((item, index) => {
8957
9371
  return { ...item, _id: index };
8958
9372
  });
8959
- console.log(props.items);
9373
+ if (items.value &&
9374
+ items.value.length < itemsPerPage.value * activePage.value - itemsPerPage.value) {
9375
+ activePage.value = 1;
9376
+ }
8960
9377
  });
8961
9378
  const selectedAll = ref();
8962
9379
  watch(items, () => {
8963
- console.log(items.value);
8964
9380
  const selected = items.value.filter((item) => item._selected === true);
9381
+ emit('selectedItemsChange', selected);
8965
9382
  if (selected.length === items.value.length) {
8966
9383
  selectedAll.value = true;
8967
9384
  return;
@@ -8973,13 +9390,18 @@ const CSmartTable = defineComponent({
8973
9390
  if (selected.length !== 0 && selected.length !== items.value.length) {
8974
9391
  selectedAll.value = 'indeterminate';
8975
9392
  }
8976
- emit('selectedItemsChange', selected);
8977
9393
  });
8978
9394
  const itemsPerPage = ref(props.itemsPerPage);
8979
9395
  const activePage = ref(props.activePage);
8980
9396
  const sorterState = reactive(props.sorterValue || {});
8981
9397
  const columnFilterState = ref(props.columnFilterValue ? props.columnFilterValue : {});
8982
9398
  const tableFilterState = ref(props.tableFilterValue ? props.tableFilterValue : '');
9399
+ onMounted(() => {
9400
+ if (items.value &&
9401
+ items.value.length < itemsPerPage.value * activePage.value - itemsPerPage.value) {
9402
+ activePage.value = 1;
9403
+ }
9404
+ });
8983
9405
  // functions
8984
9406
  const isSortable = (i) => {
8985
9407
  const isDataColumn = itemsDataColumns.value.includes(rawColumnNames[i]);
@@ -9007,7 +9429,12 @@ const CSmartTable = defineComponent({
9007
9429
  state.state = 'desc';
9008
9430
  }
9009
9431
  else {
9010
- state.state = 0;
9432
+ if (typeof props.columnSorter === 'object' && !props.columnSorter.resetable) {
9433
+ state.state = 'asc';
9434
+ }
9435
+ else {
9436
+ state.state = 0;
9437
+ }
9011
9438
  }
9012
9439
  }
9013
9440
  else {
@@ -9020,7 +9447,6 @@ const CSmartTable = defineComponent({
9020
9447
  };
9021
9448
  const handleActivePageChange = (page) => {
9022
9449
  activePage.value = page;
9023
- // currentItems.value = updatePage(sortedItems)
9024
9450
  emit('activePageChange', page);
9025
9451
  };
9026
9452
  const handleItemsPerPageChange = (itemsPerPageNumber) => {
@@ -9149,22 +9575,23 @@ const CSmartTable = defineComponent({
9149
9575
  Object.values(columnFilterState.value).join(''));
9150
9576
  });
9151
9577
  return () => h$1('div', {}, [
9152
- h$1('div', {
9153
- class: 'row my-2 mx-0',
9154
- }, {
9155
- default: () => (props.tableFilter || props.cleaner) && [
9156
- h$1('div', {
9157
- class: 'col-auto p-0',
9158
- }, props.tableFilter &&
9159
- h$1(CSmartTableFilter, {
9160
- onFilterInput: (value) => tableFilterChange(value, 'input'),
9161
- onFilterChange: (value) => tableFilterChange(value, 'change'),
9162
- value: tableFilterState.value,
9163
- })),
9164
- h$1('div', {
9165
- class: 'col-auto p-0',
9166
- }, props.cleaner &&
9167
- h$1(CSmartTableCleaner, {
9578
+ (props.tableFilter || props.cleaner) &&
9579
+ h$1('div', {
9580
+ class: 'row my-2 mx-0',
9581
+ }, [
9582
+ props.tableFilter &&
9583
+ h$1('div', {
9584
+ class: 'col-auto p-0',
9585
+ }, props.tableFilter &&
9586
+ h$1(CSmartTableFilter, {
9587
+ onFilterInput: (value) => tableFilterChange(value, 'input'),
9588
+ onFilterChange: (value) => tableFilterChange(value, 'change'),
9589
+ value: tableFilterState.value,
9590
+ })),
9591
+ props.cleaner &&
9592
+ h$1('div', {
9593
+ class: 'col-auto p-0',
9594
+ }, h$1(CSmartTableCleaner, {
9168
9595
  onClick: () => clean(),
9169
9596
  isFiltered: isFiltered.value,
9170
9597
  }, {
@@ -9173,8 +9600,7 @@ const CSmartTable = defineComponent({
9173
9600
  ? slots.cleanerIcon()
9174
9601
  : h$1(CIcon, { width: '18', content: cilFilterX }),
9175
9602
  })),
9176
- ],
9177
- }),
9603
+ ]),
9178
9604
  h$1('div', {
9179
9605
  class: 'position-relative',
9180
9606
  }, {
@@ -9273,7 +9699,7 @@ const CSmartTable = defineComponent({
9273
9699
  class: 'row',
9274
9700
  }, [
9275
9701
  h$1('div', {
9276
- class: 'col-auto',
9702
+ class: 'col',
9277
9703
  }, props.pagination && numberOfPages.value > 1
9278
9704
  ? h$1(CSmartPagination, {
9279
9705
  ...props.paginationProps,
@@ -9548,7 +9974,7 @@ const CToastClose = defineComponent({
9548
9974
  updateVisible(false);
9549
9975
  };
9550
9976
  return () => props.component
9551
- ? h$1(resolveComponent(props.component), {
9977
+ ? h$1(props.component, {
9552
9978
  onClick: () => {
9553
9979
  handleClose();
9554
9980
  },
@@ -10309,6 +10735,8 @@ var Components = /*#__PURE__*/Object.freeze({
10309
10735
  CDropdownDivider: CDropdownDivider,
10310
10736
  CDropdownMenu: CDropdownMenu,
10311
10737
  CDropdownToggle: CDropdownToggle,
10738
+ CElementCoverPlugin: CElementCoverPlugin,
10739
+ CElementCover: CElementCover,
10312
10740
  CFooterPlugin: CFooterPlugin,
10313
10741
  CFooter: CFooter,
10314
10742
  CFormPlugin: CFormPlugin,
@@ -10375,6 +10803,8 @@ var Components = /*#__PURE__*/Object.freeze({
10375
10803
  CPagination: CPagination,
10376
10804
  CPaginationItem: CPaginationItem,
10377
10805
  CSmartPagination: CSmartPagination,
10806
+ CPlaceholderPlugin: CPlaceholderPlugin,
10807
+ CPlaceholder: CPlaceholder,
10378
10808
  CProgressPlugin: CProgressPlugin,
10379
10809
  CProgress: CProgress,
10380
10810
  CProgressBar: CProgressBar,
@@ -10420,49 +10850,79 @@ var Components = /*#__PURE__*/Object.freeze({
10420
10850
  CWidgetStatsF: CWidgetStatsF
10421
10851
  });
10422
10852
 
10853
+ const BREAKPOINTS = [
10854
+ 'xxl',
10855
+ 'xl',
10856
+ 'lg',
10857
+ 'md',
10858
+ 'sm',
10859
+ 'xs',
10860
+ ];
10861
+ var vcplaceholder = {
10862
+ name: 'c-placeholder',
10863
+ mounted(el, binding) {
10864
+ const value = binding.value;
10865
+ el.classList.add(value.animation ? `placeholder-${value.animation}` : 'placeholder');
10866
+ BREAKPOINTS.forEach((bp) => {
10867
+ const breakpoint = value[bp];
10868
+ const infix = bp === 'xs' ? '' : `-${bp}`;
10869
+ if (typeof breakpoint === 'number') {
10870
+ el.classList.add(`col${infix}-${breakpoint}`);
10871
+ }
10872
+ if (typeof breakpoint === 'boolean') {
10873
+ el.classList.add(`col${infix}`);
10874
+ }
10875
+ });
10876
+ },
10877
+ };
10878
+
10423
10879
  const getUID$1 = (prefix) => {
10424
10880
  do {
10425
10881
  prefix += Math.floor(Math.random() * 1000000);
10426
10882
  } while (document.getElementById(prefix));
10427
10883
  return prefix;
10428
10884
  };
10429
- const createTooltipElement = (id, content) => {
10430
- const tooltip = document.createElement('div');
10431
- tooltip.id = id;
10432
- tooltip.classList.add('tooltip', 'bs-tooltip-auto', 'fade');
10433
- tooltip.setAttribute('role', 'tooltip');
10434
- tooltip.innerHTML = `<div class="tooltip-arrow" data-popper-arrow></div>
10435
- <div class="tooltip-inner" id="">${content}</div>`;
10436
- return tooltip;
10885
+ const createPopoverElement = (id, header, content) => {
10886
+ const popover = document.createElement('div');
10887
+ popover.id = id;
10888
+ popover.classList.add('popover', 'bs-popover-auto', 'fade');
10889
+ popover.setAttribute('role', 'popover');
10890
+ popover.innerHTML = `<div class="popover-arrow" data-popper-arrow></div>
10891
+ <div class="popover-header">${header}</div>
10892
+ <div class="popover-body" id="">${content}</div>`;
10893
+ return popover;
10437
10894
  };
10438
- const addTooltipElement = (tooltip, el, popperOptions) => {
10439
- document.body.appendChild(tooltip);
10440
- createPopper(el, tooltip, popperOptions);
10895
+ const addPopoverElement = (popover, el, popperOptions) => {
10896
+ document.body.appendChild(popover);
10897
+ createPopper(el, popover, popperOptions);
10441
10898
  setTimeout(() => {
10442
- tooltip.classList.add('show');
10899
+ popover.classList.add('show');
10443
10900
  }, 1);
10444
10901
  };
10445
- const removeTooltipElement = (tooltip) => {
10446
- tooltip.classList.remove('show');
10902
+ const removePopoverElement = (popover) => {
10903
+ popover.classList.remove('show');
10447
10904
  setTimeout(() => {
10448
- document.body.removeChild(tooltip);
10905
+ document.body.removeChild(popover);
10449
10906
  }, 300);
10450
10907
  };
10451
- const toggleTooltipElement = (tooltip, el, popperOptions) => {
10452
- const popperElement = document.getElementById(tooltip.id);
10908
+ const togglePopoverElement = (popover, el, popperOptions) => {
10909
+ const popperElement = document.getElementById(popover.id);
10453
10910
  if (popperElement && popperElement.classList.contains('show')) {
10454
- removeTooltipElement(tooltip);
10911
+ removePopoverElement(popover);
10455
10912
  return;
10456
10913
  }
10457
- addTooltipElement(tooltip, el, popperOptions);
10914
+ addPopoverElement(popover, el, popperOptions);
10458
10915
  };
10459
- var vctooltip = {
10916
+ var vcpopover = {
10917
+ name: 'c-popover',
10918
+ uid: '',
10460
10919
  mounted(el, binding) {
10461
10920
  const value = binding.value;
10462
10921
  const content = typeof value === 'string' ? value : value.content ? value.content : '';
10463
- const trigger = value.trigger ? value.trigger : 'hover';
10922
+ const header = value.header ? value.header : '';
10923
+ const trigger = value.trigger ? value.trigger : 'click';
10464
10924
  // Popper Config
10465
- const offset = value.offset ? value.offset : [0, 0];
10925
+ const offset = value.offset ? value.offset : [0, 8];
10466
10926
  const placement = value.placement ? value.placement : 'top';
10467
10927
  const popperOptions = {
10468
10928
  placement: placement,
@@ -10475,33 +10935,33 @@ var vctooltip = {
10475
10935
  },
10476
10936
  ],
10477
10937
  };
10478
- const tooltipUID = getUID$1('tooltip');
10479
- binding.arg = tooltipUID;
10480
- const tooltip = createTooltipElement(tooltipUID, content);
10938
+ const popoverUID = getUID$1('popover');
10939
+ binding.arg = popoverUID;
10940
+ const popover = createPopoverElement(popoverUID, header, content);
10481
10941
  trigger.includes('click') &&
10482
10942
  el.addEventListener('click', () => {
10483
- toggleTooltipElement(tooltip, el, popperOptions);
10943
+ togglePopoverElement(popover, el, popperOptions);
10484
10944
  });
10485
10945
  if (trigger.includes('focus')) {
10486
10946
  el.addEventListener('focus', () => {
10487
- addTooltipElement(tooltip, el, popperOptions);
10947
+ addPopoverElement(popover, el, popperOptions);
10488
10948
  });
10489
10949
  el.addEventListener('blur', () => {
10490
- removeTooltipElement(tooltip);
10950
+ removePopoverElement(popover);
10491
10951
  });
10492
10952
  }
10493
10953
  if (trigger.includes('hover')) {
10494
10954
  el.addEventListener('mouseenter', () => {
10495
- addTooltipElement(tooltip, el, popperOptions);
10955
+ addPopoverElement(popover, el, popperOptions);
10496
10956
  });
10497
10957
  el.addEventListener('mouseleave', () => {
10498
- removeTooltipElement(tooltip);
10958
+ removePopoverElement(popover);
10499
10959
  });
10500
10960
  }
10501
10961
  },
10502
- beforeUnmount(binding) {
10503
- const tooltip = binding.arg && document.getElementById(binding.arg);
10504
- tooltip && tooltip.remove();
10962
+ unmounted(binding) {
10963
+ const popover = binding.arg && document.getElementById(binding.arg);
10964
+ popover && popover.remove();
10505
10965
  },
10506
10966
  };
10507
10967
 
@@ -10511,47 +10971,43 @@ const getUID = (prefix) => {
10511
10971
  } while (document.getElementById(prefix));
10512
10972
  return prefix;
10513
10973
  };
10514
- const createPopoverElement = (id, header, content) => {
10515
- const popover = document.createElement('div');
10516
- popover.id = id;
10517
- popover.classList.add('popover', 'bs-popover-auto', 'fade');
10518
- popover.setAttribute('role', 'popover');
10519
- popover.innerHTML = `<div class="popover-arrow" data-popper-arrow></div>
10520
- <div class="popover-header">${header}</div>
10521
- <div class="popover-body" id="">${content}</div>`;
10522
- return popover;
10974
+ const createTooltipElement = (id, content) => {
10975
+ const tooltip = document.createElement('div');
10976
+ tooltip.id = id;
10977
+ tooltip.classList.add('tooltip', 'bs-tooltip-auto', 'fade');
10978
+ tooltip.setAttribute('role', 'tooltip');
10979
+ tooltip.innerHTML = `<div class="tooltip-arrow" data-popper-arrow></div>
10980
+ <div class="tooltip-inner" id="">${content}</div>`;
10981
+ return tooltip;
10523
10982
  };
10524
- const addPopoverElement = (popover, el, popperOptions) => {
10525
- document.body.appendChild(popover);
10526
- createPopper(el, popover, popperOptions);
10983
+ const addTooltipElement = (tooltip, el, popperOptions) => {
10984
+ document.body.appendChild(tooltip);
10985
+ createPopper(el, tooltip, popperOptions);
10527
10986
  setTimeout(() => {
10528
- popover.classList.add('show');
10987
+ tooltip.classList.add('show');
10529
10988
  }, 1);
10530
10989
  };
10531
- const removePopoverElement = (popover) => {
10532
- popover.classList.remove('show');
10990
+ const removeTooltipElement = (tooltip) => {
10991
+ tooltip.classList.remove('show');
10533
10992
  setTimeout(() => {
10534
- document.body.removeChild(popover);
10993
+ document.body.removeChild(tooltip);
10535
10994
  }, 300);
10536
10995
  };
10537
- const togglePopoverElement = (popover, el, popperOptions) => {
10538
- const popperElement = document.getElementById(popover.id);
10996
+ const toggleTooltipElement = (tooltip, el, popperOptions) => {
10997
+ const popperElement = document.getElementById(tooltip.id);
10539
10998
  if (popperElement && popperElement.classList.contains('show')) {
10540
- removePopoverElement(popover);
10999
+ removeTooltipElement(tooltip);
10541
11000
  return;
10542
11001
  }
10543
- addPopoverElement(popover, el, popperOptions);
11002
+ addTooltipElement(tooltip, el, popperOptions);
10544
11003
  };
10545
- var vcpopover = {
10546
- name: 'c-popover',
10547
- uid: '',
11004
+ var vctooltip = {
10548
11005
  mounted(el, binding) {
10549
11006
  const value = binding.value;
10550
11007
  const content = typeof value === 'string' ? value : value.content ? value.content : '';
10551
- const header = value.header ? value.header : '';
10552
- const trigger = value.trigger ? value.trigger : 'click';
11008
+ const trigger = value.trigger ? value.trigger : 'hover';
10553
11009
  // Popper Config
10554
- const offset = value.offset ? value.offset : [0, 8];
11010
+ const offset = value.offset ? value.offset : [0, 0];
10555
11011
  const placement = value.placement ? value.placement : 'top';
10556
11012
  const popperOptions = {
10557
11013
  placement: placement,
@@ -10564,33 +11020,33 @@ var vcpopover = {
10564
11020
  },
10565
11021
  ],
10566
11022
  };
10567
- const popoverUID = getUID('popover');
10568
- binding.arg = popoverUID;
10569
- const popover = createPopoverElement(popoverUID, header, content);
11023
+ const tooltipUID = getUID('tooltip');
11024
+ binding.arg = tooltipUID;
11025
+ const tooltip = createTooltipElement(tooltipUID, content);
10570
11026
  trigger.includes('click') &&
10571
11027
  el.addEventListener('click', () => {
10572
- togglePopoverElement(popover, el, popperOptions);
11028
+ toggleTooltipElement(tooltip, el, popperOptions);
10573
11029
  });
10574
11030
  if (trigger.includes('focus')) {
10575
11031
  el.addEventListener('focus', () => {
10576
- addPopoverElement(popover, el, popperOptions);
11032
+ addTooltipElement(tooltip, el, popperOptions);
10577
11033
  });
10578
11034
  el.addEventListener('blur', () => {
10579
- removePopoverElement(popover);
11035
+ removeTooltipElement(tooltip);
10580
11036
  });
10581
11037
  }
10582
11038
  if (trigger.includes('hover')) {
10583
11039
  el.addEventListener('mouseenter', () => {
10584
- addPopoverElement(popover, el, popperOptions);
11040
+ addTooltipElement(tooltip, el, popperOptions);
10585
11041
  });
10586
11042
  el.addEventListener('mouseleave', () => {
10587
- removePopoverElement(popover);
11043
+ removeTooltipElement(tooltip);
10588
11044
  });
10589
11045
  }
10590
11046
  },
10591
- unmounted(binding) {
10592
- const popover = binding.arg && document.getElementById(binding.arg);
10593
- popover && popover.remove();
11047
+ beforeUnmount(binding) {
11048
+ const tooltip = binding.arg && document.getElementById(binding.arg);
11049
+ tooltip && tooltip.remove();
10594
11050
  },
10595
11051
  };
10596
11052
 
@@ -10617,10 +11073,11 @@ const CoreuiVue = {
10617
11073
  // for (const directive in pluginDirectives) {
10618
11074
  // app.directive(directive, Directives[directive])
10619
11075
  // }
11076
+ app.directive('c-placeholder', vcplaceholder);
10620
11077
  app.directive('c-popover', vcpopover);
10621
11078
  app.directive('c-tooltip', vctooltip);
10622
11079
  },
10623
11080
  };
10624
11081
 
10625
- export { CAccordion, CAccordionBody, CAccordionButton, CAccordionCollapse, CAccordionHeader, CAccordionItem, CAccordionPlugin, CAlert, CAlertHeading, CAlertLink, CAlertPlugin, CAvatar, CAvatarPlugin, CBackdrop, CBackdropPlugin, CBadge, CBadgePlugin, CBreadcrumb, CBreadcrumbItem, CBreadcrumbPlugin, CButton, CButtonGroup, CButtonGroupPlugin, CButtonPlugin, CButtonToolbar, CCLinkPlugin, CCallout, CCalloutPlugin, CCard, CCardBody, CCardFooter, CCardGroup, CCardHeader, CCardImage, CCardImageOverlay, CCardLink, CCardPlugin, CCardSubtitle, CCardText, CCardTitle, CCarousel, CCarouselCaption, CCarouselItem, CCarouselPlugin, CCloseButton, CCloseButtonPlugin, CCol, CCollapse, CCollapsePlugin, CContainer, CDropdown, CDropdownDivider, CDropdownHeader, CDropdownItem, CDropdownMenu, CDropdownPlugin, CDropdownToggle, 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, CPopover, CPopoverPlugin, CProgress, CProgressBar, CProgressPlugin, CRow, CSidebar, CSidebarBrand, CSidebarFooter, CSidebarHeader, CSidebarNav, CSidebarPlugin, CSidebarToggler, CSmartPagination, CSmartTable, CSmartTablePlugin, CSpinner, CSpinnerPlugin, CTabContent, CTabPane, CTable, CTableBody, CTableCaption, CTableDataCell, CTableFoot, CTableHead, CTableHeaderCell, CTablePlugin, CTableRow, CTabsPlugin, CToast, CToastBody, CToastClose, CToastHeader, CToastPlugin, CToaster, CTooltip, CTooltipPlugin, CWidgetStatsA, CWidgetStatsB, CWidgetStatsC, CWidgetStatsD, CWidgetStatsE, CWidgetStatsF, CWidgetsStatsPlugin, CoreuiVue as default, vcpopover, vctooltip };
11082
+ export { CAccordion, CAccordionBody, CAccordionButton, CAccordionCollapse, CAccordionHeader, CAccordionItem, CAccordionPlugin, CAlert, CAlertHeading, CAlertLink, CAlertPlugin, CAvatar, CAvatarPlugin, CBackdrop, CBackdropPlugin, CBadge, CBadgePlugin, CBreadcrumb, CBreadcrumbItem, CBreadcrumbPlugin, CButton, CButtonGroup, CButtonGroupPlugin, CButtonPlugin, CButtonToolbar, CCLinkPlugin, CCallout, CCalloutPlugin, CCard, CCardBody, CCardFooter, CCardGroup, CCardHeader, CCardImage, CCardImageOverlay, CCardLink, CCardPlugin, CCardSubtitle, CCardText, CCardTitle, CCarousel, CCarouselCaption, CCarouselItem, CCarouselPlugin, CCloseButton, CCloseButtonPlugin, CCol, CCollapse, CCollapsePlugin, CContainer, 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, CPlaceholder, CPlaceholderPlugin, CPopover, CPopoverPlugin, CProgress, CProgressBar, CProgressPlugin, CRow, CSidebar, CSidebarBrand, CSidebarFooter, CSidebarHeader, CSidebarNav, CSidebarPlugin, CSidebarToggler, CSmartPagination, CSmartTable, CSmartTablePlugin, CSpinner, CSpinnerPlugin, CTabContent, CTabPane, CTable, CTableBody, CTableCaption, CTableDataCell, CTableFoot, CTableHead, CTableHeaderCell, CTablePlugin, CTableRow, CTabsPlugin, CToast, CToastBody, CToastClose, CToastHeader, CToastPlugin, CToaster, CTooltip, CTooltipPlugin, CWidgetStatsA, CWidgetStatsB, CWidgetStatsC, CWidgetStatsD, CWidgetStatsE, CWidgetStatsF, CWidgetsStatsPlugin, CoreuiVue as default, vcplaceholder, vcpopover, vctooltip };
10626
11083
  //# sourceMappingURL=index.es.js.map