@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.js CHANGED
@@ -36,9 +36,45 @@ const CAccordion = vue.defineComponent({
36
36
  },
37
37
  });
38
38
 
39
+ const vVisible = {
40
+ beforeMount(el, { value }, { transition }) {
41
+ el._vod = el.style.display === 'none' ? '' : el.style.display;
42
+ if (transition && value) {
43
+ transition.beforeEnter(el);
44
+ }
45
+ },
46
+ mounted(el, { value }, { transition }) {
47
+ if (transition && value) {
48
+ transition.enter(el);
49
+ }
50
+ },
51
+ updated(el, { value, oldValue }, { transition }) {
52
+ if (!value === !oldValue)
53
+ return;
54
+ if (transition) {
55
+ if (value) {
56
+ transition.beforeEnter(el);
57
+ transition.enter(el);
58
+ }
59
+ else {
60
+ transition.leave(el, () => {
61
+ // setDisplay(el, false)
62
+ });
63
+ }
64
+ }
65
+ },
66
+ };
67
+
39
68
  const CCollapse = vue.defineComponent({
40
69
  name: 'CCollapse',
41
70
  props: {
71
+ /**
72
+ * Set horizontal collapsing to transition the width instead of height.
73
+ */
74
+ horizontal: {
75
+ type: Boolean,
76
+ required: false,
77
+ },
42
78
  /**
43
79
  * Toggle the visibility of component.
44
80
  */
@@ -58,42 +94,58 @@ const CCollapse = vue.defineComponent({
58
94
  'show',
59
95
  ],
60
96
  setup(props, { slots, emit }) {
61
- const handleBeforeEnter = (el) => {
62
- el.classList.remove('collapse');
63
- el.classList.add('collapsing');
97
+ const collapsing = vue.ref(false);
98
+ const show = vue.ref(props.visible);
99
+ const handleBeforeEnter = () => {
100
+ collapsing.value = true;
64
101
  };
65
102
  const handleEnter = (el, done) => {
66
103
  emit('show');
67
104
  el.addEventListener('transitionend', () => {
68
- el.classList.add('collapse', 'show');
69
105
  done();
70
106
  });
71
- el.style.height = `${el.scrollHeight}px`;
107
+ setTimeout(() => {
108
+ if (props.horizontal) {
109
+ el.style.width = `${el.scrollWidth}px`;
110
+ return;
111
+ }
112
+ el.style.height = `${el.scrollHeight}px`;
113
+ }, 1);
72
114
  };
73
115
  const handleAfterEnter = (el) => {
74
- el.classList.remove('collapsing');
75
- el.style.removeProperty('height');
116
+ show.value = true;
117
+ collapsing.value = false;
118
+ props.horizontal ? el.style.removeProperty('width') : el.style.removeProperty('height');
76
119
  };
77
120
  const handleBeforeLeave = (el) => {
78
- el.classList.add('show');
121
+ collapsing.value = true;
122
+ show.value = false;
123
+ if (props.horizontal) {
124
+ el.style.width = `${el.scrollWidth}px`;
125
+ return;
126
+ }
79
127
  el.style.height = `${el.scrollHeight}px`;
80
128
  };
81
129
  const handleLeave = (el, done) => {
82
130
  emit('hide');
83
- el.classList.remove('collapse', 'show');
84
- el.classList.add('collapsing');
85
131
  el.addEventListener('transitionend', () => {
86
132
  done();
87
133
  });
88
- el.style.height = '0px';
134
+ setTimeout(() => {
135
+ if (props.horizontal) {
136
+ el.style.width = '0px';
137
+ return;
138
+ }
139
+ el.style.height = '0px';
140
+ }, 1);
89
141
  };
90
142
  const handleAfterLeave = (el) => {
91
- el.classList.remove('collapsing');
92
- el.classList.add('collapse');
143
+ collapsing.value = false;
144
+ props.horizontal ? el.style.removeProperty('width') : el.style.removeProperty('height');
93
145
  };
94
146
  return () => vue.h(vue.Transition, {
95
- name: 'fade',
96
- onBeforeEnter: (el) => handleBeforeEnter(el),
147
+ css: false,
148
+ onBeforeEnter: () => handleBeforeEnter(),
97
149
  onEnter: (el, done) => handleEnter(el, done),
98
150
  onAfterEnter: (el) => handleAfterEnter(el),
99
151
  onBeforeLeave: (el) => handleBeforeLeave(el),
@@ -101,12 +153,10 @@ const CCollapse = vue.defineComponent({
101
153
  onAfterLeave: (el) => handleAfterLeave(el),
102
154
  }, () => vue.withDirectives(vue.h('div', {
103
155
  class: [
104
- 'collapse',
105
- {
106
- show: props.visible,
107
- },
156
+ collapsing.value ? 'collapsing' : 'collapse',
157
+ { 'collapse-horizontal': props.horizontal, show: show.value },
108
158
  ],
109
- }, slots.default && slots.default()), [[vue.vShow, props.visible]]));
159
+ }, slots.default && slots.default()), [[vVisible, props.visible]]));
110
160
  },
111
161
  });
112
162
 
@@ -800,6 +850,7 @@ const CButton = vue.defineComponent({
800
850
  ],
801
851
  disabled: props.disabled && props.component !== 'a',
802
852
  ...(props.component === 'a' && props.disabled && { 'aria-disabled': true, tabIndex: -1 }),
853
+ ...(props.component === 'a' && props.href && { href: props.href }),
803
854
  }, slots.default && slots.default());
804
855
  },
805
856
  });
@@ -1614,29 +1665,32 @@ function getBasePlacement(placement) {
1614
1665
  return placement.split('-')[0];
1615
1666
  }
1616
1667
 
1617
- // import { isHTMLElement } from './instanceOf';
1618
- function getBoundingClientRect(element, // eslint-disable-next-line unused-imports/no-unused-vars
1619
- includeScale) {
1668
+ var max = Math.max;
1669
+ var min = Math.min;
1670
+ var round = Math.round;
1671
+
1672
+ function getBoundingClientRect(element, includeScale) {
1673
+ if (includeScale === void 0) {
1674
+ includeScale = false;
1675
+ }
1620
1676
 
1621
1677
  var rect = element.getBoundingClientRect();
1622
1678
  var scaleX = 1;
1623
- var scaleY = 1; // FIXME:
1624
- // `offsetWidth` returns an integer while `getBoundingClientRect`
1625
- // returns a float. This results in `scaleX` or `scaleY` being
1626
- // non-1 when it should be for elements that aren't a full pixel in
1627
- // width or height.
1628
- // if (isHTMLElement(element) && includeScale) {
1629
- // const offsetHeight = element.offsetHeight;
1630
- // const offsetWidth = element.offsetWidth;
1631
- // // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
1632
- // // Fallback to 1 in case both values are `0`
1633
- // if (offsetWidth > 0) {
1634
- // scaleX = rect.width / offsetWidth || 1;
1635
- // }
1636
- // if (offsetHeight > 0) {
1637
- // scaleY = rect.height / offsetHeight || 1;
1638
- // }
1639
- // }
1679
+ var scaleY = 1;
1680
+
1681
+ if (isHTMLElement(element) && includeScale) {
1682
+ var offsetHeight = element.offsetHeight;
1683
+ var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
1684
+ // Fallback to 1 in case both values are `0`
1685
+
1686
+ if (offsetWidth > 0) {
1687
+ scaleX = round(rect.width) / offsetWidth || 1;
1688
+ }
1689
+
1690
+ if (offsetHeight > 0) {
1691
+ scaleY = round(rect.height) / offsetHeight || 1;
1692
+ }
1693
+ }
1640
1694
 
1641
1695
  return {
1642
1696
  width: rect.width / scaleX,
@@ -1791,13 +1845,13 @@ function getMainAxisFromPlacement(placement) {
1791
1845
  return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
1792
1846
  }
1793
1847
 
1794
- var max = Math.max;
1795
- var min = Math.min;
1796
- var round = Math.round;
1797
-
1798
1848
  function within(min$1, value, max$1) {
1799
1849
  return max(min$1, min(value, max$1));
1800
1850
  }
1851
+ function withinMaxClamp(min, value, max) {
1852
+ var v = within(min, value, max);
1853
+ return v > max ? max : v;
1854
+ }
1801
1855
 
1802
1856
  function getFreshSideObject() {
1803
1857
  return {
@@ -1929,8 +1983,8 @@ function roundOffsetsByDPR(_ref) {
1929
1983
  var win = window;
1930
1984
  var dpr = win.devicePixelRatio || 1;
1931
1985
  return {
1932
- x: round(round(x * dpr) / dpr) || 0,
1933
- y: round(round(y * dpr) / dpr) || 0
1986
+ x: round(x * dpr) / dpr || 0,
1987
+ y: round(y * dpr) / dpr || 0
1934
1988
  };
1935
1989
  }
1936
1990
 
@@ -1945,7 +1999,8 @@ function mapToStyles(_ref2) {
1945
1999
  position = _ref2.position,
1946
2000
  gpuAcceleration = _ref2.gpuAcceleration,
1947
2001
  adaptive = _ref2.adaptive,
1948
- roundOffsets = _ref2.roundOffsets;
2002
+ roundOffsets = _ref2.roundOffsets,
2003
+ isFixed = _ref2.isFixed;
1949
2004
 
1950
2005
  var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
1951
2006
  _ref3$x = _ref3.x,
@@ -1977,16 +2032,18 @@ function mapToStyles(_ref2) {
1977
2032
  offsetParent = offsetParent;
1978
2033
 
1979
2034
  if (placement === top || (placement === left || placement === right) && variation === end) {
1980
- sideY = bottom; // $FlowFixMe[prop-missing]
1981
-
1982
- y -= offsetParent[heightProp] - popperRect.height;
2035
+ sideY = bottom;
2036
+ var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
2037
+ offsetParent[heightProp];
2038
+ y -= offsetY - popperRect.height;
1983
2039
  y *= gpuAcceleration ? 1 : -1;
1984
2040
  }
1985
2041
 
1986
2042
  if (placement === left || (placement === top || placement === bottom) && variation === end) {
1987
- sideX = right; // $FlowFixMe[prop-missing]
1988
-
1989
- x -= offsetParent[widthProp] - popperRect.width;
2043
+ sideX = right;
2044
+ var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
2045
+ offsetParent[widthProp];
2046
+ x -= offsetX - popperRect.width;
1990
2047
  x *= gpuAcceleration ? 1 : -1;
1991
2048
  }
1992
2049
  }
@@ -2029,7 +2086,8 @@ function computeStyles(_ref4) {
2029
2086
  variation: getVariation(state.placement),
2030
2087
  popper: state.elements.popper,
2031
2088
  popperRect: state.rects.popper,
2032
- gpuAcceleration: gpuAcceleration
2089
+ gpuAcceleration: gpuAcceleration,
2090
+ isFixed: state.options.strategy === 'fixed'
2033
2091
  };
2034
2092
 
2035
2093
  if (state.modifiersData.popperOffsets != null) {
@@ -2287,7 +2345,7 @@ function getInnerBoundingClientRect(element) {
2287
2345
  }
2288
2346
 
2289
2347
  function getClientRectFromMixedType(element, clippingParent) {
2290
- return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
2348
+ return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
2291
2349
  } // A "clipping parent" is an overflowable container with the characteristic of
2292
2350
  // clipping (or hiding) overflowing elements with a position different from
2293
2351
  // `initial`
@@ -2304,7 +2362,7 @@ function getClippingParents(element) {
2304
2362
 
2305
2363
 
2306
2364
  return clippingParents.filter(function (clippingParent) {
2307
- return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
2365
+ return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body' && (canEscapeClipping ? getComputedStyle$1(clippingParent).position !== 'static' : true);
2308
2366
  });
2309
2367
  } // Gets the maximum area that the element is visible in due to any number of
2310
2368
  // clipping parents
@@ -2804,6 +2862,14 @@ function preventOverflow(_ref) {
2804
2862
  var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
2805
2863
  placement: state.placement
2806
2864
  })) : tetherOffset;
2865
+ var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
2866
+ mainAxis: tetherOffsetValue,
2867
+ altAxis: tetherOffsetValue
2868
+ } : Object.assign({
2869
+ mainAxis: 0,
2870
+ altAxis: 0
2871
+ }, tetherOffsetValue);
2872
+ var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
2807
2873
  var data = {
2808
2874
  x: 0,
2809
2875
  y: 0
@@ -2813,13 +2879,15 @@ function preventOverflow(_ref) {
2813
2879
  return;
2814
2880
  }
2815
2881
 
2816
- if (checkMainAxis || checkAltAxis) {
2882
+ if (checkMainAxis) {
2883
+ var _offsetModifierState$;
2884
+
2817
2885
  var mainSide = mainAxis === 'y' ? top : left;
2818
2886
  var altSide = mainAxis === 'y' ? bottom : right;
2819
2887
  var len = mainAxis === 'y' ? 'height' : 'width';
2820
2888
  var offset = popperOffsets[mainAxis];
2821
- var min$1 = popperOffsets[mainAxis] + overflow[mainSide];
2822
- var max$1 = popperOffsets[mainAxis] - overflow[altSide];
2889
+ var min$1 = offset + overflow[mainSide];
2890
+ var max$1 = offset - overflow[altSide];
2823
2891
  var additive = tether ? -popperRect[len] / 2 : 0;
2824
2892
  var minLen = variation === start ? referenceRect[len] : popperRect[len];
2825
2893
  var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
@@ -2839,36 +2907,45 @@ function preventOverflow(_ref) {
2839
2907
  // width or height)
2840
2908
 
2841
2909
  var arrowLen = within(0, referenceRect[len], arrowRect[len]);
2842
- var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;
2843
- var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;
2910
+ var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
2911
+ var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
2844
2912
  var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
2845
2913
  var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
2846
- var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;
2847
- var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;
2848
- var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;
2914
+ var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
2915
+ var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
2916
+ var tetherMax = offset + maxOffset - offsetModifierValue;
2917
+ var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
2918
+ popperOffsets[mainAxis] = preventedOffset;
2919
+ data[mainAxis] = preventedOffset - offset;
2920
+ }
2849
2921
 
2850
- if (checkMainAxis) {
2851
- var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
2852
- popperOffsets[mainAxis] = preventedOffset;
2853
- data[mainAxis] = preventedOffset - offset;
2854
- }
2922
+ if (checkAltAxis) {
2923
+ var _offsetModifierState$2;
2855
2924
 
2856
- if (checkAltAxis) {
2857
- var _mainSide = mainAxis === 'x' ? top : left;
2925
+ var _mainSide = mainAxis === 'x' ? top : left;
2858
2926
 
2859
- var _altSide = mainAxis === 'x' ? bottom : right;
2927
+ var _altSide = mainAxis === 'x' ? bottom : right;
2860
2928
 
2861
- var _offset = popperOffsets[altAxis];
2929
+ var _offset = popperOffsets[altAxis];
2862
2930
 
2863
- var _min = _offset + overflow[_mainSide];
2931
+ var _len = altAxis === 'y' ? 'height' : 'width';
2864
2932
 
2865
- var _max = _offset - overflow[_altSide];
2933
+ var _min = _offset + overflow[_mainSide];
2866
2934
 
2867
- var _preventedOffset = within(tether ? min(_min, tetherMin) : _min, _offset, tether ? max(_max, tetherMax) : _max);
2935
+ var _max = _offset - overflow[_altSide];
2868
2936
 
2869
- popperOffsets[altAxis] = _preventedOffset;
2870
- data[altAxis] = _preventedOffset - _offset;
2871
- }
2937
+ var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
2938
+
2939
+ var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
2940
+
2941
+ var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
2942
+
2943
+ var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
2944
+
2945
+ var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
2946
+
2947
+ popperOffsets[altAxis] = _preventedOffset;
2948
+ data[altAxis] = _preventedOffset - _offset;
2872
2949
  }
2873
2950
 
2874
2951
  state.modifiersData[name] = data;
@@ -2900,8 +2977,8 @@ function getNodeScroll(node) {
2900
2977
 
2901
2978
  function isElementScaled(element) {
2902
2979
  var rect = element.getBoundingClientRect();
2903
- var scaleX = rect.width / element.offsetWidth || 1;
2904
- var scaleY = rect.height / element.offsetHeight || 1;
2980
+ var scaleX = round(rect.width) / element.offsetWidth || 1;
2981
+ var scaleY = round(rect.height) / element.offsetHeight || 1;
2905
2982
  return scaleX !== 1 || scaleY !== 1;
2906
2983
  } // Returns the composite rect of an element relative to its offsetParent.
2907
2984
  // Composite means it takes into account transforms as well as layout.
@@ -2913,9 +2990,9 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
2913
2990
  }
2914
2991
 
2915
2992
  var isOffsetParentAnElement = isHTMLElement(offsetParent);
2916
- isHTMLElement(offsetParent) && isElementScaled(offsetParent);
2993
+ var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
2917
2994
  var documentElement = getDocumentElement(offsetParent);
2918
- var rect = getBoundingClientRect(elementOrVirtualElement);
2995
+ var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
2919
2996
  var scroll = {
2920
2997
  scrollLeft: 0,
2921
2998
  scrollTop: 0
@@ -2932,7 +3009,7 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
2932
3009
  }
2933
3010
 
2934
3011
  if (isHTMLElement(offsetParent)) {
2935
- offsets = getBoundingClientRect(offsetParent);
3012
+ offsets = getBoundingClientRect(offsetParent, true);
2936
3013
  offsets.x += offsetParent.clientLeft;
2937
3014
  offsets.y += offsetParent.clientTop;
2938
3015
  } else if (documentElement) {
@@ -3852,6 +3929,176 @@ const CDropdownPlugin = {
3852
3929
  },
3853
3930
  };
3854
3931
 
3932
+ const CSpinner = vue.defineComponent({
3933
+ name: 'CSpinner',
3934
+ props: {
3935
+ /**
3936
+ * Sets the color context of the component to one of CoreUI’s themed colors.
3937
+ *
3938
+ * @values 'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark', 'light'
3939
+ */
3940
+ color: {
3941
+ type: String,
3942
+ default: undefined,
3943
+ required: false,
3944
+ validator: (value) => {
3945
+ return [
3946
+ 'primary',
3947
+ 'secondary',
3948
+ 'success',
3949
+ 'danger',
3950
+ 'warning',
3951
+ 'info',
3952
+ 'dark',
3953
+ 'light',
3954
+ ].includes(value);
3955
+ },
3956
+ },
3957
+ /**
3958
+ * Component used for the root node. Either a string to use a HTML element or a component.
3959
+ */
3960
+ component: {
3961
+ type: String,
3962
+ default: 'div',
3963
+ required: false,
3964
+ },
3965
+ /**
3966
+ * Size the component small.
3967
+ *
3968
+ * @values 'sm'
3969
+ */
3970
+ size: {
3971
+ type: String,
3972
+ default: undefined,
3973
+ required: false,
3974
+ validator: (value) => {
3975
+ return value === 'sm';
3976
+ },
3977
+ },
3978
+ /**
3979
+ * Set the button variant to an outlined button or a ghost button.
3980
+ *
3981
+ * @values 'border', 'grow'
3982
+ */
3983
+ variant: {
3984
+ type: String,
3985
+ default: 'border',
3986
+ required: false,
3987
+ validator: (value) => {
3988
+ return ['border', 'grow'].includes(value);
3989
+ },
3990
+ },
3991
+ /**
3992
+ * Set visually hidden label for accessibility purposes.
3993
+ */
3994
+ visuallyHiddenLabel: {
3995
+ type: String,
3996
+ default: 'Loading...',
3997
+ required: false,
3998
+ },
3999
+ },
4000
+ setup(props) {
4001
+ return () => vue.h(props.component, {
4002
+ class: [
4003
+ `spinner-${props.variant}`,
4004
+ `text-${props.color}`,
4005
+ props.size && `spinner-${props.variant}-${props.size}`,
4006
+ ],
4007
+ role: 'status',
4008
+ }, vue.h('span', { class: ['visually-hidden'] }, props.visuallyHiddenLabel));
4009
+ },
4010
+ });
4011
+
4012
+ const CSpinnerPlugin = {
4013
+ install: (app) => {
4014
+ app.component(CSpinner.name, CSpinner);
4015
+ },
4016
+ };
4017
+
4018
+ const CElementCover = vue.defineComponent({
4019
+ name: 'CElementCover',
4020
+ props: {
4021
+ /**
4022
+ * 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:
4023
+ * - sides (array) - select boundaries of element to define boundaries. Sides names: 'top', 'bottom', 'right', 'left'.
4024
+ * - query (string) - query used to get element which define boundaries. Search will be done only inside parent element, by parent.querySelector(query) function. [docs]
4025
+ *
4026
+ * @type {sides: string[], query: string}[]
4027
+ */
4028
+ boundaries: {
4029
+ // TODO: check if this is correct, TJ
4030
+ type: Array,
4031
+ require: true,
4032
+ },
4033
+ /**
4034
+ * Opacity of the cover. [docs]
4035
+ *
4036
+ * @type number
4037
+ */
4038
+ opacity: {
4039
+ type: Number,
4040
+ require: false,
4041
+ },
4042
+ },
4043
+ setup(props) {
4044
+ let containerCoords = {};
4045
+ const elementRef = vue.ref();
4046
+ const getCustomBoundaries = () => {
4047
+ if (!props.boundaries || elementRef === null) {
4048
+ return {};
4049
+ }
4050
+ const parent = elementRef.value.parentElement;
4051
+ if (!parent) {
4052
+ return {};
4053
+ }
4054
+ const parentCoords = parent.getBoundingClientRect();
4055
+ const customBoundaries = {};
4056
+ props.boundaries.forEach((value) => {
4057
+ const element = parent.querySelector(value.query);
4058
+ if (!element || !value.sides) {
4059
+ return;
4060
+ }
4061
+ const coords = element.getBoundingClientRect();
4062
+ value.sides.forEach((side) => {
4063
+ const sideMargin = Math.abs(coords[side] - parentCoords[side]);
4064
+ customBoundaries[side] = `${sideMargin}px`;
4065
+ });
4066
+ });
4067
+ return customBoundaries;
4068
+ };
4069
+ vue.onMounted(function () {
4070
+ vue.nextTick(function () {
4071
+ containerCoords = getCustomBoundaries();
4072
+ });
4073
+ });
4074
+ return () => vue.h('div', {
4075
+ style: {
4076
+ ...containerCoords,
4077
+ position: 'absolute',
4078
+ 'background-color': `rgb(255,255,255,${props.opacity})`,
4079
+ },
4080
+ ref: elementRef,
4081
+ }, vue.h('div', // TODO: use slot to override this
4082
+ {
4083
+ style: {
4084
+ position: 'absolute',
4085
+ top: '50%',
4086
+ left: '50%',
4087
+ transform: 'translateX(-50%) translateY(-50%)',
4088
+ },
4089
+ }, vue.h(CSpinner, {
4090
+ variant: 'grow',
4091
+ color: 'primary',
4092
+ })));
4093
+ },
4094
+ });
4095
+
4096
+ const CElementCoverPlugin = {
4097
+ install: (app) => {
4098
+ app.component(CElementCover.name, CElementCover);
4099
+ },
4100
+ };
4101
+
3855
4102
  const CFooter = vue.defineComponent({
3856
4103
  name: 'CFooter',
3857
4104
  props: {
@@ -4254,11 +4501,11 @@ const CFormInput = vue.defineComponent({
4254
4501
  'update:modelValue',
4255
4502
  ],
4256
4503
  setup(props, { emit, slots }) {
4257
- // const handleChange = (event: InputEvent) => {
4258
- // const target = event.target as HTMLInputElement
4259
- // emit('change', event)
4260
- // emit('update:modelValue', target.value)
4261
- // }
4504
+ const handleChange = (event) => {
4505
+ const target = event.target;
4506
+ emit('change', event);
4507
+ emit('update:modelValue', target.value);
4508
+ };
4262
4509
  const handleInput = (event) => {
4263
4510
  const target = event.target;
4264
4511
  emit('input', event);
@@ -4275,7 +4522,7 @@ const CFormInput = vue.defineComponent({
4275
4522
  },
4276
4523
  ],
4277
4524
  disabled: props.disabled,
4278
- // onChange: (event: InputEvent) => handleChange(event),
4525
+ onChange: (event) => handleChange(event),
4279
4526
  onInput: (event) => handleInput(event),
4280
4527
  readonly: props.readonly,
4281
4528
  type: props.type,
@@ -4458,6 +4705,8 @@ const CFormSelect = vue.defineComponent({
4458
4705
  'form-select',
4459
4706
  {
4460
4707
  [`form-select-${props.size}`]: props.size,
4708
+ 'is-invalid': props.invalid,
4709
+ 'is-valid': props.valid,
4461
4710
  },
4462
4711
  ],
4463
4712
  onChange: (event) => handleChange(event),
@@ -4766,7 +5015,7 @@ const CFormPlugin = {
4766
5015
  },
4767
5016
  };
4768
5017
 
4769
- const BREAKPOINTS$2 = [
5018
+ const BREAKPOINTS$4 = [
4770
5019
  'xxl',
4771
5020
  'xl',
4772
5021
  'lg',
@@ -4839,40 +5088,40 @@ const CCol = vue.defineComponent({
4839
5088
  },
4840
5089
  },
4841
5090
  setup(props, { slots }) {
4842
- const repsonsiveCLassNames = [];
4843
- BREAKPOINTS$2.forEach((bp) => {
5091
+ const repsonsiveClassNames = [];
5092
+ BREAKPOINTS$4.forEach((bp) => {
4844
5093
  const breakpoint = props[bp];
4845
5094
  const infix = bp === 'xs' ? '' : `-${bp}`;
4846
5095
  if (breakpoint) {
4847
5096
  if (typeof breakpoint === 'number' || typeof breakpoint === 'string') {
4848
- repsonsiveCLassNames.push(`col${infix}-${breakpoint}`);
5097
+ repsonsiveClassNames.push(`col${infix}-${breakpoint}`);
4849
5098
  }
4850
5099
  if (typeof breakpoint === 'boolean') {
4851
- repsonsiveCLassNames.push(`col${infix}`);
5100
+ repsonsiveClassNames.push(`col${infix}`);
4852
5101
  }
4853
5102
  }
4854
5103
  if (breakpoint && typeof breakpoint === 'object') {
4855
5104
  if (typeof breakpoint.span === 'number' || typeof breakpoint.span === 'string') {
4856
- repsonsiveCLassNames.push(`col${infix}-${breakpoint.span}`);
5105
+ repsonsiveClassNames.push(`col${infix}-${breakpoint.span}`);
4857
5106
  }
4858
5107
  if (typeof breakpoint.span === 'boolean') {
4859
- repsonsiveCLassNames.push(`col${infix}`);
5108
+ repsonsiveClassNames.push(`col${infix}`);
4860
5109
  }
4861
5110
  if (typeof breakpoint.order === 'number' || typeof breakpoint.order === 'string') {
4862
- repsonsiveCLassNames.push(`order${infix}-${breakpoint.order}`);
5111
+ repsonsiveClassNames.push(`order${infix}-${breakpoint.order}`);
4863
5112
  }
4864
5113
  if (typeof breakpoint.offset === 'number') {
4865
- repsonsiveCLassNames.push(`offset${infix}-${breakpoint.offset}`);
5114
+ repsonsiveClassNames.push(`offset${infix}-${breakpoint.offset}`);
4866
5115
  }
4867
5116
  }
4868
5117
  });
4869
5118
  return () => vue.h('div', {
4870
- class: [repsonsiveCLassNames.length ? repsonsiveCLassNames : 'col'],
5119
+ class: [repsonsiveClassNames.length ? repsonsiveClassNames : 'col'],
4871
5120
  }, slots.default && slots.default());
4872
5121
  },
4873
5122
  });
4874
5123
 
4875
- const BREAKPOINTS$1 = [
5124
+ const BREAKPOINTS$3 = [
4876
5125
  'xxl',
4877
5126
  'xl',
4878
5127
  'lg',
@@ -4927,18 +5176,18 @@ const CContainer = vue.defineComponent({
4927
5176
  },
4928
5177
  },
4929
5178
  setup(props, { slots }) {
4930
- const repsonsiveCLassNames = [];
4931
- BREAKPOINTS$1.forEach((bp) => {
5179
+ const repsonsiveClassNames = [];
5180
+ BREAKPOINTS$3.forEach((bp) => {
4932
5181
  const breakpoint = props[bp];
4933
- breakpoint && repsonsiveCLassNames.push(`container-${bp}`);
5182
+ breakpoint && repsonsiveClassNames.push(`container-${bp}`);
4934
5183
  });
4935
5184
  return () => vue.h('div', {
4936
- class: [repsonsiveCLassNames.length ? repsonsiveCLassNames : 'container'],
5185
+ class: [repsonsiveClassNames.length ? repsonsiveClassNames : 'container'],
4937
5186
  }, slots.default && slots.default());
4938
5187
  },
4939
5188
  });
4940
5189
 
4941
- const BREAKPOINTS = [
5190
+ const BREAKPOINTS$2 = [
4942
5191
  'xxl',
4943
5192
  'xl',
4944
5193
  'lg',
@@ -5011,27 +5260,27 @@ const CRow = vue.defineComponent({
5011
5260
  },
5012
5261
  },
5013
5262
  setup(props, { slots }) {
5014
- const repsonsiveCLassNames = [];
5015
- BREAKPOINTS.forEach((bp) => {
5263
+ const repsonsiveClassNames = [];
5264
+ BREAKPOINTS$2.forEach((bp) => {
5016
5265
  const breakpoint = props[bp];
5017
5266
  const infix = bp === 'xs' ? '' : `-${bp}`;
5018
5267
  if (typeof breakpoint === 'object') {
5019
5268
  if (breakpoint.cols) {
5020
- repsonsiveCLassNames.push(`row-cols${infix}-${breakpoint.cols}`);
5269
+ repsonsiveClassNames.push(`row-cols${infix}-${breakpoint.cols}`);
5021
5270
  }
5022
5271
  if (typeof breakpoint.gutter === 'number') {
5023
- repsonsiveCLassNames.push(`g${infix}-${breakpoint.gutter}`);
5272
+ repsonsiveClassNames.push(`g${infix}-${breakpoint.gutter}`);
5024
5273
  }
5025
5274
  if (typeof breakpoint.gutterX === 'number') {
5026
- repsonsiveCLassNames.push(`gx${infix}-${breakpoint.gutterX}`);
5275
+ repsonsiveClassNames.push(`gx${infix}-${breakpoint.gutterX}`);
5027
5276
  }
5028
5277
  if (typeof breakpoint.gutterY === 'number') {
5029
- repsonsiveCLassNames.push(`gy${infix}-${breakpoint.gutterY}`);
5278
+ repsonsiveClassNames.push(`gy${infix}-${breakpoint.gutterY}`);
5030
5279
  }
5031
5280
  }
5032
5281
  });
5033
5282
  return () => vue.h('div', {
5034
- class: ['row', repsonsiveCLassNames],
5283
+ class: ['row', repsonsiveClassNames],
5035
5284
  }, slots.default && slots.default());
5036
5285
  },
5037
5286
  });
@@ -5325,88 +5574,8 @@ const CListGroupPlugin = {
5325
5574
  },
5326
5575
  };
5327
5576
 
5328
- const CSpinner = vue.defineComponent({
5329
- name: 'CSpinner',
5330
- props: {
5331
- /**
5332
- * Sets the color context of the component to one of CoreUI’s themed colors.
5333
- *
5334
- * @values 'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark', 'light'
5335
- */
5336
- color: {
5337
- type: String,
5338
- default: undefined,
5339
- required: false,
5340
- validator: (value) => {
5341
- return [
5342
- 'primary',
5343
- 'secondary',
5344
- 'success',
5345
- 'danger',
5346
- 'warning',
5347
- 'info',
5348
- 'dark',
5349
- 'light',
5350
- ].includes(value);
5351
- },
5352
- },
5353
- /**
5354
- * Component used for the root node. Either a string to use a HTML element or a component.
5355
- */
5356
- component: {
5357
- type: String,
5358
- default: 'div',
5359
- required: false,
5360
- },
5361
- /**
5362
- * Size the component small.
5363
- *
5364
- * @values 'sm'
5365
- */
5366
- size: {
5367
- type: String,
5368
- default: undefined,
5369
- required: false,
5370
- validator: (value) => {
5371
- return value === 'sm';
5372
- },
5373
- },
5374
- /**
5375
- * Set the button variant to an outlined button or a ghost button.
5376
- *
5377
- * @values 'border', 'grow'
5378
- */
5379
- variant: {
5380
- type: String,
5381
- default: 'border',
5382
- required: false,
5383
- validator: (value) => {
5384
- return ['border', 'grow'].includes(value);
5385
- },
5386
- },
5387
- /**
5388
- * Set visually hidden label for accessibility purposes.
5389
- */
5390
- visuallyHiddenLabel: {
5391
- type: String,
5392
- default: 'Loading...',
5393
- required: false,
5394
- },
5395
- },
5396
- setup(props) {
5397
- return () => vue.h(props.component, {
5398
- class: [
5399
- `spinner-${props.variant}`,
5400
- `text-${props.color}`,
5401
- props.size && `spinner-${props.variant}-${props.size}`,
5402
- ],
5403
- role: 'status',
5404
- }, vue.h('span', { class: ['visually-hidden'] }, props.visuallyHiddenLabel));
5405
- },
5406
- });
5407
-
5408
- const CLoadingButton = vue.defineComponent({
5409
- name: 'CLoadingButton',
5577
+ const CLoadingButton = vue.defineComponent({
5578
+ name: 'CLoadingButton',
5410
5579
  props: {
5411
5580
  /**
5412
5581
  * Makes button disabled when loading.
@@ -6889,20 +7058,19 @@ const COffcanvas = vue.defineComponent({
6889
7058
  onAfterEnter: () => handleAfterEnter(),
6890
7059
  onLeave: (el, done) => handleLeave(el, done),
6891
7060
  onAfterLeave: (el) => handleAfterLeave(el),
6892
- }, () => visible.value &&
6893
- vue.h('div', {
6894
- class: [
6895
- 'offcanvas',
6896
- {
6897
- [`offcanvas-${props.placement}`]: props.placement,
6898
- },
6899
- ],
6900
- ref: offcanvasRef,
6901
- role: 'dialog',
6902
- }, slots.default && slots.default())),
7061
+ }, () => vue.withDirectives(vue.h('div', {
7062
+ class: [
7063
+ 'offcanvas',
7064
+ {
7065
+ [`offcanvas-${props.placement}`]: props.placement,
7066
+ },
7067
+ ],
7068
+ ref: offcanvasRef,
7069
+ role: 'dialog',
7070
+ }, slots.default && slots.default()), [[vVisible, props.visible]])),
6903
7071
  props.backdrop &&
6904
7072
  vue.h(CBackdrop, {
6905
- class: 'modal-backdrop',
7073
+ class: 'offcanvas-backdrop',
6906
7074
  visible: visible.value,
6907
7075
  }),
6908
7076
  ];
@@ -7349,6 +7517,137 @@ const CPaginationPlugin = {
7349
7517
  },
7350
7518
  };
7351
7519
 
7520
+ const BREAKPOINTS$1 = [
7521
+ 'xxl',
7522
+ 'xl',
7523
+ 'lg',
7524
+ 'md',
7525
+ 'sm',
7526
+ 'xs',
7527
+ ];
7528
+ const CPlaceholder = vue.defineComponent({
7529
+ name: 'CPlaceholder',
7530
+ props: {
7531
+ /**
7532
+ * Set animation type to better convey the perception of something being actively loaded.
7533
+ *
7534
+ * @values 'glow', 'wave'
7535
+ */
7536
+ animation: {
7537
+ type: String,
7538
+ default: undefined,
7539
+ require: false,
7540
+ validator: (value) => {
7541
+ return ['glow', 'wave'].includes(value);
7542
+ },
7543
+ },
7544
+ /**
7545
+ * Sets the color context of the component to one of CoreUI’s themed colors.
7546
+ *
7547
+ * @values 'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark', 'light'
7548
+ */
7549
+ color: Color,
7550
+ /**
7551
+ * Component used for the root node. Either a string to use a HTML element or a component.
7552
+ */
7553
+ component: {
7554
+ type: String,
7555
+ default: 'span',
7556
+ required: false,
7557
+ },
7558
+ /**
7559
+ * Size the component extra small, small, or large.
7560
+ *
7561
+ * @values 'xs', 'sm', 'lg'
7562
+ */
7563
+ size: {
7564
+ type: String,
7565
+ default: undefined,
7566
+ required: false,
7567
+ validator: (value) => {
7568
+ return ['xs', 'sm', 'lg'].includes(value);
7569
+ },
7570
+ },
7571
+ /**
7572
+ * The number of columns on extra small devices (<576px).
7573
+ */
7574
+ xs: {
7575
+ type: Number,
7576
+ default: undefined,
7577
+ require: false,
7578
+ },
7579
+ /**
7580
+ * The number of columns on small devices (<768px).
7581
+ */
7582
+ sm: {
7583
+ type: Number,
7584
+ default: undefined,
7585
+ require: false,
7586
+ },
7587
+ /**
7588
+ * The number of columns on medium devices (<992px).
7589
+ */
7590
+ md: {
7591
+ type: Number,
7592
+ default: undefined,
7593
+ require: false,
7594
+ },
7595
+ /**
7596
+ * The number of columns on large devices (<1200px).
7597
+ */
7598
+ lg: {
7599
+ type: Number,
7600
+ default: undefined,
7601
+ require: false,
7602
+ },
7603
+ /**
7604
+ * The number of columns on X-Large devices (<1400px).
7605
+ */
7606
+ xl: {
7607
+ type: Number,
7608
+ default: undefined,
7609
+ require: false,
7610
+ },
7611
+ /**
7612
+ * The number of columns on XX-Large devices (≥1400px).
7613
+ */
7614
+ xxl: {
7615
+ type: Number,
7616
+ default: undefined,
7617
+ require: false,
7618
+ },
7619
+ },
7620
+ setup(props, { slots }) {
7621
+ const repsonsiveClassNames = [];
7622
+ BREAKPOINTS$1.forEach((bp) => {
7623
+ const breakpoint = props[bp];
7624
+ const infix = bp === 'xs' ? '' : `-${bp}`;
7625
+ if (typeof breakpoint === 'number') {
7626
+ repsonsiveClassNames.push(`col${infix}-${breakpoint}`);
7627
+ }
7628
+ if (typeof breakpoint === 'boolean') {
7629
+ repsonsiveClassNames.push(`col${infix}`);
7630
+ }
7631
+ });
7632
+ return () => vue.h(props.component, {
7633
+ class: [
7634
+ props.animation ? `placeholder-${props.animation}` : 'placeholder',
7635
+ {
7636
+ [`bg-${props.color}`]: props.color,
7637
+ [`placeholder-${props.size}`]: props.size,
7638
+ },
7639
+ repsonsiveClassNames,
7640
+ ],
7641
+ }, slots.default && slots.default());
7642
+ },
7643
+ });
7644
+
7645
+ const CPlaceholderPlugin = {
7646
+ install: (app) => {
7647
+ app.component(CPlaceholder.name, CPlaceholder);
7648
+ },
7649
+ };
7650
+
7352
7651
  const CProgressBar = vue.defineComponent({
7353
7652
  name: 'CProgressBar',
7354
7653
  props: {
@@ -7866,90 +8165,6 @@ const CSidebarPlugin = {
7866
8165
  },
7867
8166
  };
7868
8167
 
7869
- const CSpinnerPlugin = {
7870
- install: (app) => {
7871
- app.component(CSpinner.name, CSpinner);
7872
- },
7873
- };
7874
-
7875
- const CElementCover = vue.defineComponent({
7876
- name: 'CElementCover',
7877
- props: {
7878
- /**
7879
- * 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:
7880
- * - sides (array) - select boundaries of element to define boundaries. Sides names: 'top', 'bottom', 'right', 'left'.
7881
- * - query (string) - query used to get element which define boundaries. Search will be done only inside parent element, by parent.querySelector(query) function. [docs]
7882
- *
7883
- * @type {sides: string[], query: string}[]
7884
- */
7885
- boundaries: {
7886
- // TODO: check if this is correct, TJ
7887
- type: Array,
7888
- require: true,
7889
- },
7890
- /**
7891
- * Opacity of the cover. [docs]
7892
- *
7893
- * @type number
7894
- */
7895
- opacity: {
7896
- type: Number,
7897
- require: false,
7898
- },
7899
- },
7900
- setup(props) {
7901
- let containerCoords = {};
7902
- const elementRef = vue.ref();
7903
- const getCustomBoundaries = () => {
7904
- if (!props.boundaries || elementRef === null) {
7905
- return {};
7906
- }
7907
- const parent = elementRef.value.parentElement;
7908
- if (!parent) {
7909
- return {};
7910
- }
7911
- const parentCoords = parent.getBoundingClientRect();
7912
- const customBoundaries = {};
7913
- props.boundaries.forEach((value) => {
7914
- const element = parent.querySelector(value.query);
7915
- if (!element || !value.sides) {
7916
- return;
7917
- }
7918
- const coords = element.getBoundingClientRect();
7919
- value.sides.forEach((side) => {
7920
- const sideMargin = Math.abs(coords[side] - parentCoords[side]);
7921
- customBoundaries[side] = `${sideMargin}px`;
7922
- });
7923
- });
7924
- return customBoundaries;
7925
- };
7926
- vue.onMounted(function () {
7927
- vue.nextTick(function () {
7928
- containerCoords = getCustomBoundaries();
7929
- });
7930
- });
7931
- return () => vue.h('div', {
7932
- style: {
7933
- ...containerCoords,
7934
- position: 'absolute',
7935
- 'background-color': `rgb(255,255,255,${props.opacity})`,
7936
- },
7937
- ref: elementRef,
7938
- }, vue.h('div', // TODO: use slot to override this
7939
- {
7940
- style: {
7941
- position: 'absolute',
7942
- top: '50%',
7943
- left: '50%',
7944
- transform: 'translateX(-50%) translateY(-50%)',
7945
- },
7946
- }, vue.h(CSpinner, {
7947
- variant: 'grow',
7948
- color: 'primary',
7949
- })));
7950
- },
7951
- });
7952
-
7953
8168
  const CTable = vue.defineComponent({
7954
8169
  name: 'CTable',
7955
8170
  props: {
@@ -10524,6 +10739,8 @@ var Components = /*#__PURE__*/Object.freeze({
10524
10739
  CDropdownDivider: CDropdownDivider,
10525
10740
  CDropdownMenu: CDropdownMenu,
10526
10741
  CDropdownToggle: CDropdownToggle,
10742
+ CElementCoverPlugin: CElementCoverPlugin,
10743
+ CElementCover: CElementCover,
10527
10744
  CFooterPlugin: CFooterPlugin,
10528
10745
  CFooter: CFooter,
10529
10746
  CFormPlugin: CFormPlugin,
@@ -10590,6 +10807,8 @@ var Components = /*#__PURE__*/Object.freeze({
10590
10807
  CPagination: CPagination,
10591
10808
  CPaginationItem: CPaginationItem,
10592
10809
  CSmartPagination: CSmartPagination,
10810
+ CPlaceholderPlugin: CPlaceholderPlugin,
10811
+ CPlaceholder: CPlaceholder,
10593
10812
  CProgressPlugin: CProgressPlugin,
10594
10813
  CProgress: CProgress,
10595
10814
  CProgressBar: CProgressBar,
@@ -10635,49 +10854,79 @@ var Components = /*#__PURE__*/Object.freeze({
10635
10854
  CWidgetStatsF: CWidgetStatsF
10636
10855
  });
10637
10856
 
10857
+ const BREAKPOINTS = [
10858
+ 'xxl',
10859
+ 'xl',
10860
+ 'lg',
10861
+ 'md',
10862
+ 'sm',
10863
+ 'xs',
10864
+ ];
10865
+ var vcplaceholder = {
10866
+ name: 'c-placeholder',
10867
+ mounted(el, binding) {
10868
+ const value = binding.value;
10869
+ el.classList.add(value.animation ? `placeholder-${value.animation}` : 'placeholder');
10870
+ BREAKPOINTS.forEach((bp) => {
10871
+ const breakpoint = value[bp];
10872
+ const infix = bp === 'xs' ? '' : `-${bp}`;
10873
+ if (typeof breakpoint === 'number') {
10874
+ el.classList.add(`col${infix}-${breakpoint}`);
10875
+ }
10876
+ if (typeof breakpoint === 'boolean') {
10877
+ el.classList.add(`col${infix}`);
10878
+ }
10879
+ });
10880
+ },
10881
+ };
10882
+
10638
10883
  const getUID$1 = (prefix) => {
10639
10884
  do {
10640
10885
  prefix += Math.floor(Math.random() * 1000000);
10641
10886
  } while (document.getElementById(prefix));
10642
10887
  return prefix;
10643
10888
  };
10644
- const createTooltipElement = (id, content) => {
10645
- const tooltip = document.createElement('div');
10646
- tooltip.id = id;
10647
- tooltip.classList.add('tooltip', 'bs-tooltip-auto', 'fade');
10648
- tooltip.setAttribute('role', 'tooltip');
10649
- tooltip.innerHTML = `<div class="tooltip-arrow" data-popper-arrow></div>
10650
- <div class="tooltip-inner" id="">${content}</div>`;
10651
- return tooltip;
10889
+ const createPopoverElement = (id, header, content) => {
10890
+ const popover = document.createElement('div');
10891
+ popover.id = id;
10892
+ popover.classList.add('popover', 'bs-popover-auto', 'fade');
10893
+ popover.setAttribute('role', 'popover');
10894
+ popover.innerHTML = `<div class="popover-arrow" data-popper-arrow></div>
10895
+ <div class="popover-header">${header}</div>
10896
+ <div class="popover-body" id="">${content}</div>`;
10897
+ return popover;
10652
10898
  };
10653
- const addTooltipElement = (tooltip, el, popperOptions) => {
10654
- document.body.appendChild(tooltip);
10655
- createPopper(el, tooltip, popperOptions);
10899
+ const addPopoverElement = (popover, el, popperOptions) => {
10900
+ document.body.appendChild(popover);
10901
+ createPopper(el, popover, popperOptions);
10656
10902
  setTimeout(() => {
10657
- tooltip.classList.add('show');
10903
+ popover.classList.add('show');
10658
10904
  }, 1);
10659
10905
  };
10660
- const removeTooltipElement = (tooltip) => {
10661
- tooltip.classList.remove('show');
10906
+ const removePopoverElement = (popover) => {
10907
+ popover.classList.remove('show');
10662
10908
  setTimeout(() => {
10663
- document.body.removeChild(tooltip);
10909
+ document.body.removeChild(popover);
10664
10910
  }, 300);
10665
10911
  };
10666
- const toggleTooltipElement = (tooltip, el, popperOptions) => {
10667
- const popperElement = document.getElementById(tooltip.id);
10912
+ const togglePopoverElement = (popover, el, popperOptions) => {
10913
+ const popperElement = document.getElementById(popover.id);
10668
10914
  if (popperElement && popperElement.classList.contains('show')) {
10669
- removeTooltipElement(tooltip);
10915
+ removePopoverElement(popover);
10670
10916
  return;
10671
10917
  }
10672
- addTooltipElement(tooltip, el, popperOptions);
10918
+ addPopoverElement(popover, el, popperOptions);
10673
10919
  };
10674
- var vctooltip = {
10920
+ var vcpopover = {
10921
+ name: 'c-popover',
10922
+ uid: '',
10675
10923
  mounted(el, binding) {
10676
10924
  const value = binding.value;
10677
10925
  const content = typeof value === 'string' ? value : value.content ? value.content : '';
10678
- const trigger = value.trigger ? value.trigger : 'hover';
10926
+ const header = value.header ? value.header : '';
10927
+ const trigger = value.trigger ? value.trigger : 'click';
10679
10928
  // Popper Config
10680
- const offset = value.offset ? value.offset : [0, 0];
10929
+ const offset = value.offset ? value.offset : [0, 8];
10681
10930
  const placement = value.placement ? value.placement : 'top';
10682
10931
  const popperOptions = {
10683
10932
  placement: placement,
@@ -10690,33 +10939,33 @@ var vctooltip = {
10690
10939
  },
10691
10940
  ],
10692
10941
  };
10693
- const tooltipUID = getUID$1('tooltip');
10694
- binding.arg = tooltipUID;
10695
- const tooltip = createTooltipElement(tooltipUID, content);
10942
+ const popoverUID = getUID$1('popover');
10943
+ binding.arg = popoverUID;
10944
+ const popover = createPopoverElement(popoverUID, header, content);
10696
10945
  trigger.includes('click') &&
10697
10946
  el.addEventListener('click', () => {
10698
- toggleTooltipElement(tooltip, el, popperOptions);
10947
+ togglePopoverElement(popover, el, popperOptions);
10699
10948
  });
10700
10949
  if (trigger.includes('focus')) {
10701
10950
  el.addEventListener('focus', () => {
10702
- addTooltipElement(tooltip, el, popperOptions);
10951
+ addPopoverElement(popover, el, popperOptions);
10703
10952
  });
10704
10953
  el.addEventListener('blur', () => {
10705
- removeTooltipElement(tooltip);
10954
+ removePopoverElement(popover);
10706
10955
  });
10707
10956
  }
10708
10957
  if (trigger.includes('hover')) {
10709
10958
  el.addEventListener('mouseenter', () => {
10710
- addTooltipElement(tooltip, el, popperOptions);
10959
+ addPopoverElement(popover, el, popperOptions);
10711
10960
  });
10712
10961
  el.addEventListener('mouseleave', () => {
10713
- removeTooltipElement(tooltip);
10962
+ removePopoverElement(popover);
10714
10963
  });
10715
10964
  }
10716
10965
  },
10717
- beforeUnmount(binding) {
10718
- const tooltip = binding.arg && document.getElementById(binding.arg);
10719
- tooltip && tooltip.remove();
10966
+ unmounted(binding) {
10967
+ const popover = binding.arg && document.getElementById(binding.arg);
10968
+ popover && popover.remove();
10720
10969
  },
10721
10970
  };
10722
10971
 
@@ -10726,47 +10975,43 @@ const getUID = (prefix) => {
10726
10975
  } while (document.getElementById(prefix));
10727
10976
  return prefix;
10728
10977
  };
10729
- const createPopoverElement = (id, header, content) => {
10730
- const popover = document.createElement('div');
10731
- popover.id = id;
10732
- popover.classList.add('popover', 'bs-popover-auto', 'fade');
10733
- popover.setAttribute('role', 'popover');
10734
- popover.innerHTML = `<div class="popover-arrow" data-popper-arrow></div>
10735
- <div class="popover-header">${header}</div>
10736
- <div class="popover-body" id="">${content}</div>`;
10737
- return popover;
10978
+ const createTooltipElement = (id, content) => {
10979
+ const tooltip = document.createElement('div');
10980
+ tooltip.id = id;
10981
+ tooltip.classList.add('tooltip', 'bs-tooltip-auto', 'fade');
10982
+ tooltip.setAttribute('role', 'tooltip');
10983
+ tooltip.innerHTML = `<div class="tooltip-arrow" data-popper-arrow></div>
10984
+ <div class="tooltip-inner" id="">${content}</div>`;
10985
+ return tooltip;
10738
10986
  };
10739
- const addPopoverElement = (popover, el, popperOptions) => {
10740
- document.body.appendChild(popover);
10741
- createPopper(el, popover, popperOptions);
10987
+ const addTooltipElement = (tooltip, el, popperOptions) => {
10988
+ document.body.appendChild(tooltip);
10989
+ createPopper(el, tooltip, popperOptions);
10742
10990
  setTimeout(() => {
10743
- popover.classList.add('show');
10991
+ tooltip.classList.add('show');
10744
10992
  }, 1);
10745
10993
  };
10746
- const removePopoverElement = (popover) => {
10747
- popover.classList.remove('show');
10994
+ const removeTooltipElement = (tooltip) => {
10995
+ tooltip.classList.remove('show');
10748
10996
  setTimeout(() => {
10749
- document.body.removeChild(popover);
10997
+ document.body.removeChild(tooltip);
10750
10998
  }, 300);
10751
10999
  };
10752
- const togglePopoverElement = (popover, el, popperOptions) => {
10753
- const popperElement = document.getElementById(popover.id);
11000
+ const toggleTooltipElement = (tooltip, el, popperOptions) => {
11001
+ const popperElement = document.getElementById(tooltip.id);
10754
11002
  if (popperElement && popperElement.classList.contains('show')) {
10755
- removePopoverElement(popover);
11003
+ removeTooltipElement(tooltip);
10756
11004
  return;
10757
11005
  }
10758
- addPopoverElement(popover, el, popperOptions);
11006
+ addTooltipElement(tooltip, el, popperOptions);
10759
11007
  };
10760
- var vcpopover = {
10761
- name: 'c-popover',
10762
- uid: '',
11008
+ var vctooltip = {
10763
11009
  mounted(el, binding) {
10764
11010
  const value = binding.value;
10765
11011
  const content = typeof value === 'string' ? value : value.content ? value.content : '';
10766
- const header = value.header ? value.header : '';
10767
- const trigger = value.trigger ? value.trigger : 'click';
11012
+ const trigger = value.trigger ? value.trigger : 'hover';
10768
11013
  // Popper Config
10769
- const offset = value.offset ? value.offset : [0, 8];
11014
+ const offset = value.offset ? value.offset : [0, 0];
10770
11015
  const placement = value.placement ? value.placement : 'top';
10771
11016
  const popperOptions = {
10772
11017
  placement: placement,
@@ -10779,33 +11024,33 @@ var vcpopover = {
10779
11024
  },
10780
11025
  ],
10781
11026
  };
10782
- const popoverUID = getUID('popover');
10783
- binding.arg = popoverUID;
10784
- const popover = createPopoverElement(popoverUID, header, content);
11027
+ const tooltipUID = getUID('tooltip');
11028
+ binding.arg = tooltipUID;
11029
+ const tooltip = createTooltipElement(tooltipUID, content);
10785
11030
  trigger.includes('click') &&
10786
11031
  el.addEventListener('click', () => {
10787
- togglePopoverElement(popover, el, popperOptions);
11032
+ toggleTooltipElement(tooltip, el, popperOptions);
10788
11033
  });
10789
11034
  if (trigger.includes('focus')) {
10790
11035
  el.addEventListener('focus', () => {
10791
- addPopoverElement(popover, el, popperOptions);
11036
+ addTooltipElement(tooltip, el, popperOptions);
10792
11037
  });
10793
11038
  el.addEventListener('blur', () => {
10794
- removePopoverElement(popover);
11039
+ removeTooltipElement(tooltip);
10795
11040
  });
10796
11041
  }
10797
11042
  if (trigger.includes('hover')) {
10798
11043
  el.addEventListener('mouseenter', () => {
10799
- addPopoverElement(popover, el, popperOptions);
11044
+ addTooltipElement(tooltip, el, popperOptions);
10800
11045
  });
10801
11046
  el.addEventListener('mouseleave', () => {
10802
- removePopoverElement(popover);
11047
+ removeTooltipElement(tooltip);
10803
11048
  });
10804
11049
  }
10805
11050
  },
10806
- unmounted(binding) {
10807
- const popover = binding.arg && document.getElementById(binding.arg);
10808
- popover && popover.remove();
11051
+ beforeUnmount(binding) {
11052
+ const tooltip = binding.arg && document.getElementById(binding.arg);
11053
+ tooltip && tooltip.remove();
10809
11054
  },
10810
11055
  };
10811
11056
 
@@ -10832,6 +11077,7 @@ const CoreuiVue = {
10832
11077
  // for (const directive in pluginDirectives) {
10833
11078
  // app.directive(directive, Directives[directive])
10834
11079
  // }
11080
+ app.directive('c-placeholder', vcplaceholder);
10835
11081
  app.directive('c-popover', vcpopover);
10836
11082
  app.directive('c-tooltip', vctooltip);
10837
11083
  },
@@ -10894,6 +11140,8 @@ exports.CDropdownItem = CDropdownItem;
10894
11140
  exports.CDropdownMenu = CDropdownMenu;
10895
11141
  exports.CDropdownPlugin = CDropdownPlugin;
10896
11142
  exports.CDropdownToggle = CDropdownToggle;
11143
+ exports.CElementCover = CElementCover;
11144
+ exports.CElementCoverPlugin = CElementCoverPlugin;
10897
11145
  exports.CFooter = CFooter;
10898
11146
  exports.CFooterPlugin = CFooterPlugin;
10899
11147
  exports.CForm = CForm;
@@ -10955,6 +11203,8 @@ exports.COffcanvasTitle = COffcanvasTitle;
10955
11203
  exports.CPagination = CPagination;
10956
11204
  exports.CPaginationItem = CPaginationItem;
10957
11205
  exports.CPaginationPlugin = CPaginationPlugin;
11206
+ exports.CPlaceholder = CPlaceholder;
11207
+ exports.CPlaceholderPlugin = CPlaceholderPlugin;
10958
11208
  exports.CPopover = CPopover;
10959
11209
  exports.CPopoverPlugin = CPopoverPlugin;
10960
11210
  exports.CProgress = CProgress;
@@ -11001,6 +11251,7 @@ exports.CWidgetStatsE = CWidgetStatsE;
11001
11251
  exports.CWidgetStatsF = CWidgetStatsF;
11002
11252
  exports.CWidgetsStatsPlugin = CWidgetsStatsPlugin;
11003
11253
  exports["default"] = CoreuiVue;
11254
+ exports.vcplaceholder = vcplaceholder;
11004
11255
  exports.vcpopover = vcpopover;
11005
11256
  exports.vctooltip = vctooltip;
11006
11257
  //# sourceMappingURL=index.js.map