@coreui/vue-pro 4.0.4 → 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 (42) 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/index.d.ts +2 -0
  6. package/dist/components/modal/CModal.d.ts +2 -2
  7. package/dist/components/placeholder/CPlaceholder.d.ts +124 -0
  8. package/dist/components/placeholder/index.d.ts +6 -0
  9. package/dist/components/popover/CPopover.d.ts +2 -2
  10. package/dist/components/table/CTable.d.ts +2 -2
  11. package/dist/components/widgets/CWidgetStatsB.d.ts +2 -2
  12. package/dist/components/widgets/CWidgetStatsF.d.ts +2 -2
  13. package/dist/directives/index.d.ts +3 -2
  14. package/dist/directives/v-c-placeholder.d.ts +6 -0
  15. package/dist/directives/v-c-visible.d.ts +6 -0
  16. package/dist/index.es.js +609 -363
  17. package/dist/index.es.js.map +1 -1
  18. package/dist/index.js +612 -361
  19. package/dist/index.js.map +1 -1
  20. package/package.json +7 -7
  21. package/src/components/accordion/__tests__/__snapshots__/CAccordionBody.spec.ts.snap +1 -1
  22. package/src/components/button/CButton.ts +1 -0
  23. package/src/components/collapse/CCollapse.ts +49 -21
  24. package/src/components/collapse/__test__/__snapshots__/CCollapse.spec.ts.snap +1 -1
  25. package/src/components/element-cover/index.ts +10 -0
  26. package/src/components/form/CFormInput.ts +6 -6
  27. package/src/components/form/CFormSelect.ts +2 -0
  28. package/src/components/grid/CCol.ts +8 -8
  29. package/src/components/grid/CContainer.ts +3 -3
  30. package/src/components/grid/CRow.ts +6 -6
  31. package/src/components/index.ts +2 -0
  32. package/src/components/offcanvas/COffcanvas.ts +19 -16
  33. package/src/components/offcanvas/__tests__/COffcanvas.spec.ts +1 -1
  34. package/src/components/offcanvas/__tests__/__snapshots__/COffcanvas.spec.ts.snap +2 -2
  35. package/src/components/placeholder/CPlaceholder.ts +139 -0
  36. package/src/components/placeholder/__tests__/CPlaceholder.spec.ts +44 -0
  37. package/src/components/placeholder/__tests__/__snapshots__/CPlaceholder.spec.ts.snap +15 -0
  38. package/src/components/placeholder/index.ts +10 -0
  39. package/src/directives/index.ts +3 -2
  40. package/src/directives/v-c-placeholder.ts +32 -0
  41. package/src/directives/v-c-visible.ts +33 -0
  42. 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 } 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
 
@@ -796,6 +846,7 @@ const CButton = defineComponent({
796
846
  ],
797
847
  disabled: props.disabled && props.component !== 'a',
798
848
  ...(props.component === 'a' && props.disabled && { 'aria-disabled': true, tabIndex: -1 }),
849
+ ...(props.component === 'a' && props.href && { href: props.href }),
799
850
  }, slots.default && slots.default());
800
851
  },
801
852
  });
@@ -1610,29 +1661,32 @@ function getBasePlacement(placement) {
1610
1661
  return placement.split('-')[0];
1611
1662
  }
1612
1663
 
1613
- // import { isHTMLElement } from './instanceOf';
1614
- function getBoundingClientRect(element, // eslint-disable-next-line unused-imports/no-unused-vars
1615
- 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
+ }
1616
1672
 
1617
1673
  var rect = element.getBoundingClientRect();
1618
1674
  var scaleX = 1;
1619
- var scaleY = 1; // FIXME:
1620
- // `offsetWidth` returns an integer while `getBoundingClientRect`
1621
- // returns a float. This results in `scaleX` or `scaleY` being
1622
- // non-1 when it should be for elements that aren't a full pixel in
1623
- // width or height.
1624
- // if (isHTMLElement(element) && includeScale) {
1625
- // const offsetHeight = element.offsetHeight;
1626
- // const offsetWidth = element.offsetWidth;
1627
- // // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
1628
- // // Fallback to 1 in case both values are `0`
1629
- // if (offsetWidth > 0) {
1630
- // scaleX = rect.width / offsetWidth || 1;
1631
- // }
1632
- // if (offsetHeight > 0) {
1633
- // scaleY = rect.height / offsetHeight || 1;
1634
- // }
1635
- // }
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
+ }
1636
1690
 
1637
1691
  return {
1638
1692
  width: rect.width / scaleX,
@@ -1787,13 +1841,13 @@ function getMainAxisFromPlacement(placement) {
1787
1841
  return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
1788
1842
  }
1789
1843
 
1790
- var max = Math.max;
1791
- var min = Math.min;
1792
- var round = Math.round;
1793
-
1794
1844
  function within(min$1, value, max$1) {
1795
1845
  return max(min$1, min(value, max$1));
1796
1846
  }
1847
+ function withinMaxClamp(min, value, max) {
1848
+ var v = within(min, value, max);
1849
+ return v > max ? max : v;
1850
+ }
1797
1851
 
1798
1852
  function getFreshSideObject() {
1799
1853
  return {
@@ -1925,8 +1979,8 @@ function roundOffsetsByDPR(_ref) {
1925
1979
  var win = window;
1926
1980
  var dpr = win.devicePixelRatio || 1;
1927
1981
  return {
1928
- x: round(round(x * dpr) / dpr) || 0,
1929
- y: round(round(y * dpr) / dpr) || 0
1982
+ x: round(x * dpr) / dpr || 0,
1983
+ y: round(y * dpr) / dpr || 0
1930
1984
  };
1931
1985
  }
1932
1986
 
@@ -1941,7 +1995,8 @@ function mapToStyles(_ref2) {
1941
1995
  position = _ref2.position,
1942
1996
  gpuAcceleration = _ref2.gpuAcceleration,
1943
1997
  adaptive = _ref2.adaptive,
1944
- roundOffsets = _ref2.roundOffsets;
1998
+ roundOffsets = _ref2.roundOffsets,
1999
+ isFixed = _ref2.isFixed;
1945
2000
 
1946
2001
  var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
1947
2002
  _ref3$x = _ref3.x,
@@ -1973,16 +2028,18 @@ function mapToStyles(_ref2) {
1973
2028
  offsetParent = offsetParent;
1974
2029
 
1975
2030
  if (placement === top || (placement === left || placement === right) && variation === end) {
1976
- sideY = bottom; // $FlowFixMe[prop-missing]
1977
-
1978
- 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;
1979
2035
  y *= gpuAcceleration ? 1 : -1;
1980
2036
  }
1981
2037
 
1982
2038
  if (placement === left || (placement === top || placement === bottom) && variation === end) {
1983
- sideX = right; // $FlowFixMe[prop-missing]
1984
-
1985
- 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;
1986
2043
  x *= gpuAcceleration ? 1 : -1;
1987
2044
  }
1988
2045
  }
@@ -2025,7 +2082,8 @@ function computeStyles(_ref4) {
2025
2082
  variation: getVariation(state.placement),
2026
2083
  popper: state.elements.popper,
2027
2084
  popperRect: state.rects.popper,
2028
- gpuAcceleration: gpuAcceleration
2085
+ gpuAcceleration: gpuAcceleration,
2086
+ isFixed: state.options.strategy === 'fixed'
2029
2087
  };
2030
2088
 
2031
2089
  if (state.modifiersData.popperOffsets != null) {
@@ -2283,7 +2341,7 @@ function getInnerBoundingClientRect(element) {
2283
2341
  }
2284
2342
 
2285
2343
  function getClientRectFromMixedType(element, clippingParent) {
2286
- 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)));
2287
2345
  } // A "clipping parent" is an overflowable container with the characteristic of
2288
2346
  // clipping (or hiding) overflowing elements with a position different from
2289
2347
  // `initial`
@@ -2300,7 +2358,7 @@ function getClippingParents(element) {
2300
2358
 
2301
2359
 
2302
2360
  return clippingParents.filter(function (clippingParent) {
2303
- 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);
2304
2362
  });
2305
2363
  } // Gets the maximum area that the element is visible in due to any number of
2306
2364
  // clipping parents
@@ -2800,6 +2858,14 @@ function preventOverflow(_ref) {
2800
2858
  var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
2801
2859
  placement: state.placement
2802
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;
2803
2869
  var data = {
2804
2870
  x: 0,
2805
2871
  y: 0
@@ -2809,13 +2875,15 @@ function preventOverflow(_ref) {
2809
2875
  return;
2810
2876
  }
2811
2877
 
2812
- if (checkMainAxis || checkAltAxis) {
2878
+ if (checkMainAxis) {
2879
+ var _offsetModifierState$;
2880
+
2813
2881
  var mainSide = mainAxis === 'y' ? top : left;
2814
2882
  var altSide = mainAxis === 'y' ? bottom : right;
2815
2883
  var len = mainAxis === 'y' ? 'height' : 'width';
2816
2884
  var offset = popperOffsets[mainAxis];
2817
- var min$1 = popperOffsets[mainAxis] + overflow[mainSide];
2818
- var max$1 = popperOffsets[mainAxis] - overflow[altSide];
2885
+ var min$1 = offset + overflow[mainSide];
2886
+ var max$1 = offset - overflow[altSide];
2819
2887
  var additive = tether ? -popperRect[len] / 2 : 0;
2820
2888
  var minLen = variation === start ? referenceRect[len] : popperRect[len];
2821
2889
  var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
@@ -2835,36 +2903,45 @@ function preventOverflow(_ref) {
2835
2903
  // width or height)
2836
2904
 
2837
2905
  var arrowLen = within(0, referenceRect[len], arrowRect[len]);
2838
- var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;
2839
- 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;
2840
2908
  var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
2841
2909
  var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
2842
- var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;
2843
- var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;
2844
- 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
+ }
2845
2917
 
2846
- if (checkMainAxis) {
2847
- var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
2848
- popperOffsets[mainAxis] = preventedOffset;
2849
- data[mainAxis] = preventedOffset - offset;
2850
- }
2918
+ if (checkAltAxis) {
2919
+ var _offsetModifierState$2;
2851
2920
 
2852
- if (checkAltAxis) {
2853
- var _mainSide = mainAxis === 'x' ? top : left;
2921
+ var _mainSide = mainAxis === 'x' ? top : left;
2854
2922
 
2855
- var _altSide = mainAxis === 'x' ? bottom : right;
2923
+ var _altSide = mainAxis === 'x' ? bottom : right;
2856
2924
 
2857
- var _offset = popperOffsets[altAxis];
2925
+ var _offset = popperOffsets[altAxis];
2858
2926
 
2859
- var _min = _offset + overflow[_mainSide];
2927
+ var _len = altAxis === 'y' ? 'height' : 'width';
2860
2928
 
2861
- var _max = _offset - overflow[_altSide];
2929
+ var _min = _offset + overflow[_mainSide];
2862
2930
 
2863
- var _preventedOffset = within(tether ? min(_min, tetherMin) : _min, _offset, tether ? max(_max, tetherMax) : _max);
2931
+ var _max = _offset - overflow[_altSide];
2864
2932
 
2865
- popperOffsets[altAxis] = _preventedOffset;
2866
- data[altAxis] = _preventedOffset - _offset;
2867
- }
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;
2868
2945
  }
2869
2946
 
2870
2947
  state.modifiersData[name] = data;
@@ -2896,8 +2973,8 @@ function getNodeScroll(node) {
2896
2973
 
2897
2974
  function isElementScaled(element) {
2898
2975
  var rect = element.getBoundingClientRect();
2899
- var scaleX = rect.width / element.offsetWidth || 1;
2900
- 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;
2901
2978
  return scaleX !== 1 || scaleY !== 1;
2902
2979
  } // Returns the composite rect of an element relative to its offsetParent.
2903
2980
  // Composite means it takes into account transforms as well as layout.
@@ -2909,9 +2986,9 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
2909
2986
  }
2910
2987
 
2911
2988
  var isOffsetParentAnElement = isHTMLElement(offsetParent);
2912
- isHTMLElement(offsetParent) && isElementScaled(offsetParent);
2989
+ var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
2913
2990
  var documentElement = getDocumentElement(offsetParent);
2914
- var rect = getBoundingClientRect(elementOrVirtualElement);
2991
+ var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
2915
2992
  var scroll = {
2916
2993
  scrollLeft: 0,
2917
2994
  scrollTop: 0
@@ -2928,7 +3005,7 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
2928
3005
  }
2929
3006
 
2930
3007
  if (isHTMLElement(offsetParent)) {
2931
- offsets = getBoundingClientRect(offsetParent);
3008
+ offsets = getBoundingClientRect(offsetParent, true);
2932
3009
  offsets.x += offsetParent.clientLeft;
2933
3010
  offsets.y += offsetParent.clientTop;
2934
3011
  } else if (documentElement) {
@@ -3848,6 +3925,176 @@ const CDropdownPlugin = {
3848
3925
  },
3849
3926
  };
3850
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
+
3851
4098
  const CFooter = defineComponent({
3852
4099
  name: 'CFooter',
3853
4100
  props: {
@@ -4250,11 +4497,11 @@ const CFormInput = defineComponent({
4250
4497
  'update:modelValue',
4251
4498
  ],
4252
4499
  setup(props, { emit, slots }) {
4253
- // const handleChange = (event: InputEvent) => {
4254
- // const target = event.target as HTMLInputElement
4255
- // emit('change', event)
4256
- // emit('update:modelValue', target.value)
4257
- // }
4500
+ const handleChange = (event) => {
4501
+ const target = event.target;
4502
+ emit('change', event);
4503
+ emit('update:modelValue', target.value);
4504
+ };
4258
4505
  const handleInput = (event) => {
4259
4506
  const target = event.target;
4260
4507
  emit('input', event);
@@ -4271,7 +4518,7 @@ const CFormInput = defineComponent({
4271
4518
  },
4272
4519
  ],
4273
4520
  disabled: props.disabled,
4274
- // onChange: (event: InputEvent) => handleChange(event),
4521
+ onChange: (event) => handleChange(event),
4275
4522
  onInput: (event) => handleInput(event),
4276
4523
  readonly: props.readonly,
4277
4524
  type: props.type,
@@ -4454,6 +4701,8 @@ const CFormSelect = defineComponent({
4454
4701
  'form-select',
4455
4702
  {
4456
4703
  [`form-select-${props.size}`]: props.size,
4704
+ 'is-invalid': props.invalid,
4705
+ 'is-valid': props.valid,
4457
4706
  },
4458
4707
  ],
4459
4708
  onChange: (event) => handleChange(event),
@@ -4762,7 +5011,7 @@ const CFormPlugin = {
4762
5011
  },
4763
5012
  };
4764
5013
 
4765
- const BREAKPOINTS$2 = [
5014
+ const BREAKPOINTS$4 = [
4766
5015
  'xxl',
4767
5016
  'xl',
4768
5017
  'lg',
@@ -4835,40 +5084,40 @@ const CCol = defineComponent({
4835
5084
  },
4836
5085
  },
4837
5086
  setup(props, { slots }) {
4838
- const repsonsiveCLassNames = [];
4839
- BREAKPOINTS$2.forEach((bp) => {
5087
+ const repsonsiveClassNames = [];
5088
+ BREAKPOINTS$4.forEach((bp) => {
4840
5089
  const breakpoint = props[bp];
4841
5090
  const infix = bp === 'xs' ? '' : `-${bp}`;
4842
5091
  if (breakpoint) {
4843
5092
  if (typeof breakpoint === 'number' || typeof breakpoint === 'string') {
4844
- repsonsiveCLassNames.push(`col${infix}-${breakpoint}`);
5093
+ repsonsiveClassNames.push(`col${infix}-${breakpoint}`);
4845
5094
  }
4846
5095
  if (typeof breakpoint === 'boolean') {
4847
- repsonsiveCLassNames.push(`col${infix}`);
5096
+ repsonsiveClassNames.push(`col${infix}`);
4848
5097
  }
4849
5098
  }
4850
5099
  if (breakpoint && typeof breakpoint === 'object') {
4851
5100
  if (typeof breakpoint.span === 'number' || typeof breakpoint.span === 'string') {
4852
- repsonsiveCLassNames.push(`col${infix}-${breakpoint.span}`);
5101
+ repsonsiveClassNames.push(`col${infix}-${breakpoint.span}`);
4853
5102
  }
4854
5103
  if (typeof breakpoint.span === 'boolean') {
4855
- repsonsiveCLassNames.push(`col${infix}`);
5104
+ repsonsiveClassNames.push(`col${infix}`);
4856
5105
  }
4857
5106
  if (typeof breakpoint.order === 'number' || typeof breakpoint.order === 'string') {
4858
- repsonsiveCLassNames.push(`order${infix}-${breakpoint.order}`);
5107
+ repsonsiveClassNames.push(`order${infix}-${breakpoint.order}`);
4859
5108
  }
4860
5109
  if (typeof breakpoint.offset === 'number') {
4861
- repsonsiveCLassNames.push(`offset${infix}-${breakpoint.offset}`);
5110
+ repsonsiveClassNames.push(`offset${infix}-${breakpoint.offset}`);
4862
5111
  }
4863
5112
  }
4864
5113
  });
4865
5114
  return () => h$1('div', {
4866
- class: [repsonsiveCLassNames.length ? repsonsiveCLassNames : 'col'],
5115
+ class: [repsonsiveClassNames.length ? repsonsiveClassNames : 'col'],
4867
5116
  }, slots.default && slots.default());
4868
5117
  },
4869
5118
  });
4870
5119
 
4871
- const BREAKPOINTS$1 = [
5120
+ const BREAKPOINTS$3 = [
4872
5121
  'xxl',
4873
5122
  'xl',
4874
5123
  'lg',
@@ -4923,18 +5172,18 @@ const CContainer = defineComponent({
4923
5172
  },
4924
5173
  },
4925
5174
  setup(props, { slots }) {
4926
- const repsonsiveCLassNames = [];
4927
- BREAKPOINTS$1.forEach((bp) => {
5175
+ const repsonsiveClassNames = [];
5176
+ BREAKPOINTS$3.forEach((bp) => {
4928
5177
  const breakpoint = props[bp];
4929
- breakpoint && repsonsiveCLassNames.push(`container-${bp}`);
5178
+ breakpoint && repsonsiveClassNames.push(`container-${bp}`);
4930
5179
  });
4931
5180
  return () => h$1('div', {
4932
- class: [repsonsiveCLassNames.length ? repsonsiveCLassNames : 'container'],
5181
+ class: [repsonsiveClassNames.length ? repsonsiveClassNames : 'container'],
4933
5182
  }, slots.default && slots.default());
4934
5183
  },
4935
5184
  });
4936
5185
 
4937
- const BREAKPOINTS = [
5186
+ const BREAKPOINTS$2 = [
4938
5187
  'xxl',
4939
5188
  'xl',
4940
5189
  'lg',
@@ -5007,27 +5256,27 @@ const CRow = defineComponent({
5007
5256
  },
5008
5257
  },
5009
5258
  setup(props, { slots }) {
5010
- const repsonsiveCLassNames = [];
5011
- BREAKPOINTS.forEach((bp) => {
5259
+ const repsonsiveClassNames = [];
5260
+ BREAKPOINTS$2.forEach((bp) => {
5012
5261
  const breakpoint = props[bp];
5013
5262
  const infix = bp === 'xs' ? '' : `-${bp}`;
5014
5263
  if (typeof breakpoint === 'object') {
5015
5264
  if (breakpoint.cols) {
5016
- repsonsiveCLassNames.push(`row-cols${infix}-${breakpoint.cols}`);
5265
+ repsonsiveClassNames.push(`row-cols${infix}-${breakpoint.cols}`);
5017
5266
  }
5018
5267
  if (typeof breakpoint.gutter === 'number') {
5019
- repsonsiveCLassNames.push(`g${infix}-${breakpoint.gutter}`);
5268
+ repsonsiveClassNames.push(`g${infix}-${breakpoint.gutter}`);
5020
5269
  }
5021
5270
  if (typeof breakpoint.gutterX === 'number') {
5022
- repsonsiveCLassNames.push(`gx${infix}-${breakpoint.gutterX}`);
5271
+ repsonsiveClassNames.push(`gx${infix}-${breakpoint.gutterX}`);
5023
5272
  }
5024
5273
  if (typeof breakpoint.gutterY === 'number') {
5025
- repsonsiveCLassNames.push(`gy${infix}-${breakpoint.gutterY}`);
5274
+ repsonsiveClassNames.push(`gy${infix}-${breakpoint.gutterY}`);
5026
5275
  }
5027
5276
  }
5028
5277
  });
5029
5278
  return () => h$1('div', {
5030
- class: ['row', repsonsiveCLassNames],
5279
+ class: ['row', repsonsiveClassNames],
5031
5280
  }, slots.default && slots.default());
5032
5281
  },
5033
5282
  });
@@ -5321,88 +5570,8 @@ const CListGroupPlugin = {
5321
5570
  },
5322
5571
  };
5323
5572
 
5324
- const CSpinner = defineComponent({
5325
- name: 'CSpinner',
5326
- props: {
5327
- /**
5328
- * Sets the color context of the component to one of CoreUI’s themed colors.
5329
- *
5330
- * @values 'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark', 'light'
5331
- */
5332
- color: {
5333
- type: String,
5334
- default: undefined,
5335
- required: false,
5336
- validator: (value) => {
5337
- return [
5338
- 'primary',
5339
- 'secondary',
5340
- 'success',
5341
- 'danger',
5342
- 'warning',
5343
- 'info',
5344
- 'dark',
5345
- 'light',
5346
- ].includes(value);
5347
- },
5348
- },
5349
- /**
5350
- * Component used for the root node. Either a string to use a HTML element or a component.
5351
- */
5352
- component: {
5353
- type: String,
5354
- default: 'div',
5355
- required: false,
5356
- },
5357
- /**
5358
- * Size the component small.
5359
- *
5360
- * @values 'sm'
5361
- */
5362
- size: {
5363
- type: String,
5364
- default: undefined,
5365
- required: false,
5366
- validator: (value) => {
5367
- return value === 'sm';
5368
- },
5369
- },
5370
- /**
5371
- * Set the button variant to an outlined button or a ghost button.
5372
- *
5373
- * @values 'border', 'grow'
5374
- */
5375
- variant: {
5376
- type: String,
5377
- default: 'border',
5378
- required: false,
5379
- validator: (value) => {
5380
- return ['border', 'grow'].includes(value);
5381
- },
5382
- },
5383
- /**
5384
- * Set visually hidden label for accessibility purposes.
5385
- */
5386
- visuallyHiddenLabel: {
5387
- type: String,
5388
- default: 'Loading...',
5389
- required: false,
5390
- },
5391
- },
5392
- setup(props) {
5393
- return () => h$1(props.component, {
5394
- class: [
5395
- `spinner-${props.variant}`,
5396
- `text-${props.color}`,
5397
- props.size && `spinner-${props.variant}-${props.size}`,
5398
- ],
5399
- role: 'status',
5400
- }, h$1('span', { class: ['visually-hidden'] }, props.visuallyHiddenLabel));
5401
- },
5402
- });
5403
-
5404
- const CLoadingButton = defineComponent({
5405
- name: 'CLoadingButton',
5573
+ const CLoadingButton = defineComponent({
5574
+ name: 'CLoadingButton',
5406
5575
  props: {
5407
5576
  /**
5408
5577
  * Makes button disabled when loading.
@@ -6885,20 +7054,19 @@ const COffcanvas = defineComponent({
6885
7054
  onAfterEnter: () => handleAfterEnter(),
6886
7055
  onLeave: (el, done) => handleLeave(el, done),
6887
7056
  onAfterLeave: (el) => handleAfterLeave(el),
6888
- }, () => visible.value &&
6889
- h$1('div', {
6890
- class: [
6891
- 'offcanvas',
6892
- {
6893
- [`offcanvas-${props.placement}`]: props.placement,
6894
- },
6895
- ],
6896
- ref: offcanvasRef,
6897
- role: 'dialog',
6898
- }, 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]])),
6899
7067
  props.backdrop &&
6900
7068
  h$1(CBackdrop, {
6901
- class: 'modal-backdrop',
7069
+ class: 'offcanvas-backdrop',
6902
7070
  visible: visible.value,
6903
7071
  }),
6904
7072
  ];
@@ -7345,6 +7513,137 @@ const CPaginationPlugin = {
7345
7513
  },
7346
7514
  };
7347
7515
 
7516
+ const BREAKPOINTS$1 = [
7517
+ 'xxl',
7518
+ 'xl',
7519
+ 'lg',
7520
+ 'md',
7521
+ 'sm',
7522
+ 'xs',
7523
+ ];
7524
+ const CPlaceholder = defineComponent({
7525
+ name: 'CPlaceholder',
7526
+ props: {
7527
+ /**
7528
+ * Set animation type to better convey the perception of something being actively loaded.
7529
+ *
7530
+ * @values 'glow', 'wave'
7531
+ */
7532
+ animation: {
7533
+ type: String,
7534
+ default: undefined,
7535
+ require: false,
7536
+ validator: (value) => {
7537
+ return ['glow', 'wave'].includes(value);
7538
+ },
7539
+ },
7540
+ /**
7541
+ * Sets the color context of the component to one of CoreUI’s themed colors.
7542
+ *
7543
+ * @values 'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark', 'light'
7544
+ */
7545
+ color: Color,
7546
+ /**
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
+
7348
7647
  const CProgressBar = defineComponent({
7349
7648
  name: 'CProgressBar',
7350
7649
  props: {
@@ -7862,90 +8161,6 @@ const CSidebarPlugin = {
7862
8161
  },
7863
8162
  };
7864
8163
 
7865
- const CSpinnerPlugin = {
7866
- install: (app) => {
7867
- app.component(CSpinner.name, CSpinner);
7868
- },
7869
- };
7870
-
7871
- const CElementCover = defineComponent({
7872
- name: 'CElementCover',
7873
- props: {
7874
- /**
7875
- * 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:
7876
- * - sides (array) - select boundaries of element to define boundaries. Sides names: 'top', 'bottom', 'right', 'left'.
7877
- * - query (string) - query used to get element which define boundaries. Search will be done only inside parent element, by parent.querySelector(query) function. [docs]
7878
- *
7879
- * @type {sides: string[], query: string}[]
7880
- */
7881
- boundaries: {
7882
- // TODO: check if this is correct, TJ
7883
- type: Array,
7884
- require: true,
7885
- },
7886
- /**
7887
- * Opacity of the cover. [docs]
7888
- *
7889
- * @type number
7890
- */
7891
- opacity: {
7892
- type: Number,
7893
- require: false,
7894
- },
7895
- },
7896
- setup(props) {
7897
- let containerCoords = {};
7898
- const elementRef = ref();
7899
- const getCustomBoundaries = () => {
7900
- if (!props.boundaries || elementRef === null) {
7901
- return {};
7902
- }
7903
- const parent = elementRef.value.parentElement;
7904
- if (!parent) {
7905
- return {};
7906
- }
7907
- const parentCoords = parent.getBoundingClientRect();
7908
- const customBoundaries = {};
7909
- props.boundaries.forEach((value) => {
7910
- const element = parent.querySelector(value.query);
7911
- if (!element || !value.sides) {
7912
- return;
7913
- }
7914
- const coords = element.getBoundingClientRect();
7915
- value.sides.forEach((side) => {
7916
- const sideMargin = Math.abs(coords[side] - parentCoords[side]);
7917
- customBoundaries[side] = `${sideMargin}px`;
7918
- });
7919
- });
7920
- return customBoundaries;
7921
- };
7922
- onMounted(function () {
7923
- nextTick(function () {
7924
- containerCoords = getCustomBoundaries();
7925
- });
7926
- });
7927
- return () => h$1('div', {
7928
- style: {
7929
- ...containerCoords,
7930
- position: 'absolute',
7931
- 'background-color': `rgb(255,255,255,${props.opacity})`,
7932
- },
7933
- ref: elementRef,
7934
- }, h$1('div', // TODO: use slot to override this
7935
- {
7936
- style: {
7937
- position: 'absolute',
7938
- top: '50%',
7939
- left: '50%',
7940
- transform: 'translateX(-50%) translateY(-50%)',
7941
- },
7942
- }, h$1(CSpinner, {
7943
- variant: 'grow',
7944
- color: 'primary',
7945
- })));
7946
- },
7947
- });
7948
-
7949
8164
  const CTable = defineComponent({
7950
8165
  name: 'CTable',
7951
8166
  props: {
@@ -10520,6 +10735,8 @@ var Components = /*#__PURE__*/Object.freeze({
10520
10735
  CDropdownDivider: CDropdownDivider,
10521
10736
  CDropdownMenu: CDropdownMenu,
10522
10737
  CDropdownToggle: CDropdownToggle,
10738
+ CElementCoverPlugin: CElementCoverPlugin,
10739
+ CElementCover: CElementCover,
10523
10740
  CFooterPlugin: CFooterPlugin,
10524
10741
  CFooter: CFooter,
10525
10742
  CFormPlugin: CFormPlugin,
@@ -10586,6 +10803,8 @@ var Components = /*#__PURE__*/Object.freeze({
10586
10803
  CPagination: CPagination,
10587
10804
  CPaginationItem: CPaginationItem,
10588
10805
  CSmartPagination: CSmartPagination,
10806
+ CPlaceholderPlugin: CPlaceholderPlugin,
10807
+ CPlaceholder: CPlaceholder,
10589
10808
  CProgressPlugin: CProgressPlugin,
10590
10809
  CProgress: CProgress,
10591
10810
  CProgressBar: CProgressBar,
@@ -10631,49 +10850,79 @@ var Components = /*#__PURE__*/Object.freeze({
10631
10850
  CWidgetStatsF: CWidgetStatsF
10632
10851
  });
10633
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
+
10634
10879
  const getUID$1 = (prefix) => {
10635
10880
  do {
10636
10881
  prefix += Math.floor(Math.random() * 1000000);
10637
10882
  } while (document.getElementById(prefix));
10638
10883
  return prefix;
10639
10884
  };
10640
- const createTooltipElement = (id, content) => {
10641
- const tooltip = document.createElement('div');
10642
- tooltip.id = id;
10643
- tooltip.classList.add('tooltip', 'bs-tooltip-auto', 'fade');
10644
- tooltip.setAttribute('role', 'tooltip');
10645
- tooltip.innerHTML = `<div class="tooltip-arrow" data-popper-arrow></div>
10646
- <div class="tooltip-inner" id="">${content}</div>`;
10647
- 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;
10648
10894
  };
10649
- const addTooltipElement = (tooltip, el, popperOptions) => {
10650
- document.body.appendChild(tooltip);
10651
- createPopper(el, tooltip, popperOptions);
10895
+ const addPopoverElement = (popover, el, popperOptions) => {
10896
+ document.body.appendChild(popover);
10897
+ createPopper(el, popover, popperOptions);
10652
10898
  setTimeout(() => {
10653
- tooltip.classList.add('show');
10899
+ popover.classList.add('show');
10654
10900
  }, 1);
10655
10901
  };
10656
- const removeTooltipElement = (tooltip) => {
10657
- tooltip.classList.remove('show');
10902
+ const removePopoverElement = (popover) => {
10903
+ popover.classList.remove('show');
10658
10904
  setTimeout(() => {
10659
- document.body.removeChild(tooltip);
10905
+ document.body.removeChild(popover);
10660
10906
  }, 300);
10661
10907
  };
10662
- const toggleTooltipElement = (tooltip, el, popperOptions) => {
10663
- const popperElement = document.getElementById(tooltip.id);
10908
+ const togglePopoverElement = (popover, el, popperOptions) => {
10909
+ const popperElement = document.getElementById(popover.id);
10664
10910
  if (popperElement && popperElement.classList.contains('show')) {
10665
- removeTooltipElement(tooltip);
10911
+ removePopoverElement(popover);
10666
10912
  return;
10667
10913
  }
10668
- addTooltipElement(tooltip, el, popperOptions);
10914
+ addPopoverElement(popover, el, popperOptions);
10669
10915
  };
10670
- var vctooltip = {
10916
+ var vcpopover = {
10917
+ name: 'c-popover',
10918
+ uid: '',
10671
10919
  mounted(el, binding) {
10672
10920
  const value = binding.value;
10673
10921
  const content = typeof value === 'string' ? value : value.content ? value.content : '';
10674
- const trigger = value.trigger ? value.trigger : 'hover';
10922
+ const header = value.header ? value.header : '';
10923
+ const trigger = value.trigger ? value.trigger : 'click';
10675
10924
  // Popper Config
10676
- const offset = value.offset ? value.offset : [0, 0];
10925
+ const offset = value.offset ? value.offset : [0, 8];
10677
10926
  const placement = value.placement ? value.placement : 'top';
10678
10927
  const popperOptions = {
10679
10928
  placement: placement,
@@ -10686,33 +10935,33 @@ var vctooltip = {
10686
10935
  },
10687
10936
  ],
10688
10937
  };
10689
- const tooltipUID = getUID$1('tooltip');
10690
- binding.arg = tooltipUID;
10691
- const tooltip = createTooltipElement(tooltipUID, content);
10938
+ const popoverUID = getUID$1('popover');
10939
+ binding.arg = popoverUID;
10940
+ const popover = createPopoverElement(popoverUID, header, content);
10692
10941
  trigger.includes('click') &&
10693
10942
  el.addEventListener('click', () => {
10694
- toggleTooltipElement(tooltip, el, popperOptions);
10943
+ togglePopoverElement(popover, el, popperOptions);
10695
10944
  });
10696
10945
  if (trigger.includes('focus')) {
10697
10946
  el.addEventListener('focus', () => {
10698
- addTooltipElement(tooltip, el, popperOptions);
10947
+ addPopoverElement(popover, el, popperOptions);
10699
10948
  });
10700
10949
  el.addEventListener('blur', () => {
10701
- removeTooltipElement(tooltip);
10950
+ removePopoverElement(popover);
10702
10951
  });
10703
10952
  }
10704
10953
  if (trigger.includes('hover')) {
10705
10954
  el.addEventListener('mouseenter', () => {
10706
- addTooltipElement(tooltip, el, popperOptions);
10955
+ addPopoverElement(popover, el, popperOptions);
10707
10956
  });
10708
10957
  el.addEventListener('mouseleave', () => {
10709
- removeTooltipElement(tooltip);
10958
+ removePopoverElement(popover);
10710
10959
  });
10711
10960
  }
10712
10961
  },
10713
- beforeUnmount(binding) {
10714
- const tooltip = binding.arg && document.getElementById(binding.arg);
10715
- tooltip && tooltip.remove();
10962
+ unmounted(binding) {
10963
+ const popover = binding.arg && document.getElementById(binding.arg);
10964
+ popover && popover.remove();
10716
10965
  },
10717
10966
  };
10718
10967
 
@@ -10722,47 +10971,43 @@ const getUID = (prefix) => {
10722
10971
  } while (document.getElementById(prefix));
10723
10972
  return prefix;
10724
10973
  };
10725
- const createPopoverElement = (id, header, content) => {
10726
- const popover = document.createElement('div');
10727
- popover.id = id;
10728
- popover.classList.add('popover', 'bs-popover-auto', 'fade');
10729
- popover.setAttribute('role', 'popover');
10730
- popover.innerHTML = `<div class="popover-arrow" data-popper-arrow></div>
10731
- <div class="popover-header">${header}</div>
10732
- <div class="popover-body" id="">${content}</div>`;
10733
- 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;
10734
10982
  };
10735
- const addPopoverElement = (popover, el, popperOptions) => {
10736
- document.body.appendChild(popover);
10737
- createPopper(el, popover, popperOptions);
10983
+ const addTooltipElement = (tooltip, el, popperOptions) => {
10984
+ document.body.appendChild(tooltip);
10985
+ createPopper(el, tooltip, popperOptions);
10738
10986
  setTimeout(() => {
10739
- popover.classList.add('show');
10987
+ tooltip.classList.add('show');
10740
10988
  }, 1);
10741
10989
  };
10742
- const removePopoverElement = (popover) => {
10743
- popover.classList.remove('show');
10990
+ const removeTooltipElement = (tooltip) => {
10991
+ tooltip.classList.remove('show');
10744
10992
  setTimeout(() => {
10745
- document.body.removeChild(popover);
10993
+ document.body.removeChild(tooltip);
10746
10994
  }, 300);
10747
10995
  };
10748
- const togglePopoverElement = (popover, el, popperOptions) => {
10749
- const popperElement = document.getElementById(popover.id);
10996
+ const toggleTooltipElement = (tooltip, el, popperOptions) => {
10997
+ const popperElement = document.getElementById(tooltip.id);
10750
10998
  if (popperElement && popperElement.classList.contains('show')) {
10751
- removePopoverElement(popover);
10999
+ removeTooltipElement(tooltip);
10752
11000
  return;
10753
11001
  }
10754
- addPopoverElement(popover, el, popperOptions);
11002
+ addTooltipElement(tooltip, el, popperOptions);
10755
11003
  };
10756
- var vcpopover = {
10757
- name: 'c-popover',
10758
- uid: '',
11004
+ var vctooltip = {
10759
11005
  mounted(el, binding) {
10760
11006
  const value = binding.value;
10761
11007
  const content = typeof value === 'string' ? value : value.content ? value.content : '';
10762
- const header = value.header ? value.header : '';
10763
- const trigger = value.trigger ? value.trigger : 'click';
11008
+ const trigger = value.trigger ? value.trigger : 'hover';
10764
11009
  // Popper Config
10765
- const offset = value.offset ? value.offset : [0, 8];
11010
+ const offset = value.offset ? value.offset : [0, 0];
10766
11011
  const placement = value.placement ? value.placement : 'top';
10767
11012
  const popperOptions = {
10768
11013
  placement: placement,
@@ -10775,33 +11020,33 @@ var vcpopover = {
10775
11020
  },
10776
11021
  ],
10777
11022
  };
10778
- const popoverUID = getUID('popover');
10779
- binding.arg = popoverUID;
10780
- const popover = createPopoverElement(popoverUID, header, content);
11023
+ const tooltipUID = getUID('tooltip');
11024
+ binding.arg = tooltipUID;
11025
+ const tooltip = createTooltipElement(tooltipUID, content);
10781
11026
  trigger.includes('click') &&
10782
11027
  el.addEventListener('click', () => {
10783
- togglePopoverElement(popover, el, popperOptions);
11028
+ toggleTooltipElement(tooltip, el, popperOptions);
10784
11029
  });
10785
11030
  if (trigger.includes('focus')) {
10786
11031
  el.addEventListener('focus', () => {
10787
- addPopoverElement(popover, el, popperOptions);
11032
+ addTooltipElement(tooltip, el, popperOptions);
10788
11033
  });
10789
11034
  el.addEventListener('blur', () => {
10790
- removePopoverElement(popover);
11035
+ removeTooltipElement(tooltip);
10791
11036
  });
10792
11037
  }
10793
11038
  if (trigger.includes('hover')) {
10794
11039
  el.addEventListener('mouseenter', () => {
10795
- addPopoverElement(popover, el, popperOptions);
11040
+ addTooltipElement(tooltip, el, popperOptions);
10796
11041
  });
10797
11042
  el.addEventListener('mouseleave', () => {
10798
- removePopoverElement(popover);
11043
+ removeTooltipElement(tooltip);
10799
11044
  });
10800
11045
  }
10801
11046
  },
10802
- unmounted(binding) {
10803
- const popover = binding.arg && document.getElementById(binding.arg);
10804
- popover && popover.remove();
11047
+ beforeUnmount(binding) {
11048
+ const tooltip = binding.arg && document.getElementById(binding.arg);
11049
+ tooltip && tooltip.remove();
10805
11050
  },
10806
11051
  };
10807
11052
 
@@ -10828,10 +11073,11 @@ const CoreuiVue = {
10828
11073
  // for (const directive in pluginDirectives) {
10829
11074
  // app.directive(directive, Directives[directive])
10830
11075
  // }
11076
+ app.directive('c-placeholder', vcplaceholder);
10831
11077
  app.directive('c-popover', vcpopover);
10832
11078
  app.directive('c-tooltip', vctooltip);
10833
11079
  },
10834
11080
  };
10835
11081
 
10836
- 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 };
10837
11083
  //# sourceMappingURL=index.es.js.map