@coreui/vue-pro 4.0.1 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +1 -1
  2. package/dist/components/carousel/CCarousel.d.ts +2 -2
  3. package/dist/components/collapse/CCollapse.d.ts +10 -0
  4. package/dist/components/element-cover/index.d.ts +6 -0
  5. package/dist/components/form/CFormCheck.d.ts +22 -2
  6. package/dist/components/form/CFormInput.d.ts +17 -2
  7. package/dist/components/form/CFormRange.d.ts +15 -2
  8. package/dist/components/form/CFormSelect.d.ts +36 -2
  9. package/dist/components/form/CFormSwitch.d.ts +15 -2
  10. package/dist/components/form/CFormTextarea.d.ts +18 -2
  11. package/dist/components/index.d.ts +2 -0
  12. package/dist/components/modal/CModal.d.ts +2 -2
  13. package/dist/components/multi-select/CMultiSelect.d.ts +2 -2
  14. package/dist/components/multi-select/CMultiSelectNativeSelect.d.ts +2 -2
  15. package/dist/components/placeholder/CPlaceholder.d.ts +124 -0
  16. package/dist/components/placeholder/index.d.ts +6 -0
  17. package/dist/components/popover/CPopover.d.ts +2 -2
  18. package/dist/components/smart-table/CSmartTable.d.ts +0 -3
  19. package/dist/components/table/CTable.d.ts +2 -2
  20. package/dist/components/widgets/CWidgetStatsB.d.ts +2 -2
  21. package/dist/components/widgets/CWidgetStatsF.d.ts +2 -2
  22. package/dist/directives/index.d.ts +3 -2
  23. package/dist/directives/v-c-placeholder.d.ts +6 -0
  24. package/dist/directives/v-c-visible.d.ts +6 -0
  25. package/dist/index.es.js +902 -445
  26. package/dist/index.es.js.map +1 -1
  27. package/dist/index.js +905 -443
  28. package/dist/index.js.map +1 -1
  29. package/package.json +10 -9
  30. package/src/components/accordion/__tests__/__snapshots__/CAccordionBody.spec.ts.snap +1 -1
  31. package/src/components/button/CButton.ts +2 -2
  32. package/src/components/card/CCardImage.ts +2 -3
  33. package/src/components/collapse/CCollapse.ts +49 -21
  34. package/src/components/collapse/__test__/__snapshots__/CCollapse.spec.ts.snap +1 -1
  35. package/src/components/element-cover/index.ts +10 -0
  36. package/src/components/form/CFormCheck.ts +34 -2
  37. package/src/components/form/CFormInput.ts +40 -5
  38. package/src/components/form/CFormLabel.ts +1 -2
  39. package/src/components/form/CFormRange.ts +32 -3
  40. package/src/components/form/CFormSelect.ts +63 -4
  41. package/src/components/form/CFormSwitch.ts +46 -4
  42. package/src/components/form/CFormTextarea.ts +31 -2
  43. package/src/components/form/__tests__/__snapshots__/CFormCheck.spec.ts.snap +2 -2
  44. package/src/components/form/__tests__/__snapshots__/CFormInput.spec.ts.snap +3 -3
  45. package/src/components/form/__tests__/__snapshots__/CFormRange.spec.ts.snap +1 -1
  46. package/src/components/form/__tests__/__snapshots__/CFormSwitch.spec.ts.snap +2 -2
  47. package/src/components/form/__tests__/__snapshots__/CFormTextarea.spec.ts.snap +1 -1
  48. package/src/components/grid/CCol.ts +8 -8
  49. package/src/components/grid/CContainer.ts +3 -3
  50. package/src/components/grid/CRow.ts +6 -6
  51. package/src/components/index.ts +2 -0
  52. package/src/components/offcanvas/COffcanvas.ts +19 -16
  53. package/src/components/offcanvas/__tests__/COffcanvas.spec.ts +1 -1
  54. package/src/components/offcanvas/__tests__/__snapshots__/COffcanvas.spec.ts.snap +2 -2
  55. package/src/components/pagination/CSmartPagination.ts +1 -1
  56. package/src/components/placeholder/CPlaceholder.ts +139 -0
  57. package/src/components/placeholder/__tests__/CPlaceholder.spec.ts +44 -0
  58. package/src/components/placeholder/__tests__/__snapshots__/CPlaceholder.spec.ts.snap +15 -0
  59. package/src/components/placeholder/index.ts +10 -0
  60. package/src/components/smart-table/CSmartTable.ts +56 -41
  61. package/src/components/smart-table/CSmartTableHead.ts +43 -42
  62. package/src/components/toast/CToastClose.ts +2 -2
  63. package/src/components/toast/__tests__/CToastClose.spec.ts +2 -2
  64. package/src/components/toast/__tests__/__snapshots__/CToastClose.spec.ts.snap +1 -1
  65. package/src/directives/index.ts +3 -2
  66. package/src/directives/v-c-placeholder.ts +32 -0
  67. package/src/directives/v-c-visible.ts +33 -0
  68. package/src/index.ts +2 -1
package/dist/index.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
 
@@ -786,9 +836,8 @@ const CButton = vue.defineComponent({
786
836
  },
787
837
  },
788
838
  },
789
- setup(props, { slots, attrs }) {
839
+ setup(props, { slots }) {
790
840
  return () => vue.h(props.component, {
791
- ...attrs,
792
841
  class: [
793
842
  'btn',
794
843
  props.variant ? `btn-${props.variant}-${props.color}` : `btn-${props.color}`,
@@ -801,6 +850,7 @@ const CButton = vue.defineComponent({
801
850
  ],
802
851
  disabled: props.disabled && props.component !== 'a',
803
852
  ...(props.component === 'a' && props.disabled && { 'aria-disabled': true, tabIndex: -1 }),
853
+ ...(props.component === 'a' && props.href && { href: props.href }),
804
854
  }, slots.default && slots.default());
805
855
  },
806
856
  });
@@ -979,10 +1029,9 @@ const CCardImage = vue.defineComponent({
979
1029
  },
980
1030
  },
981
1031
  },
982
- setup(props, { slots, attrs }) {
1032
+ setup(props, { slots }) {
983
1033
  return () => vue.h(props.component, {
984
- ...attrs,
985
- class: [props.orientation ? `card-img-${props.orientation}` : 'card-img'],
1034
+ class: `card-img${props.orientation ? `-${props.orientation}` : ''}`,
986
1035
  }, slots.default && slots.default());
987
1036
  },
988
1037
  });
@@ -1616,29 +1665,32 @@ function getBasePlacement(placement) {
1616
1665
  return placement.split('-')[0];
1617
1666
  }
1618
1667
 
1619
- // import { isHTMLElement } from './instanceOf';
1620
- function getBoundingClientRect(element, // eslint-disable-next-line unused-imports/no-unused-vars
1621
- 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
+ }
1622
1676
 
1623
1677
  var rect = element.getBoundingClientRect();
1624
1678
  var scaleX = 1;
1625
- var scaleY = 1; // FIXME:
1626
- // `offsetWidth` returns an integer while `getBoundingClientRect`
1627
- // returns a float. This results in `scaleX` or `scaleY` being
1628
- // non-1 when it should be for elements that aren't a full pixel in
1629
- // width or height.
1630
- // if (isHTMLElement(element) && includeScale) {
1631
- // const offsetHeight = element.offsetHeight;
1632
- // const offsetWidth = element.offsetWidth;
1633
- // // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
1634
- // // Fallback to 1 in case both values are `0`
1635
- // if (offsetWidth > 0) {
1636
- // scaleX = rect.width / offsetWidth || 1;
1637
- // }
1638
- // if (offsetHeight > 0) {
1639
- // scaleY = rect.height / offsetHeight || 1;
1640
- // }
1641
- // }
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
+ }
1642
1694
 
1643
1695
  return {
1644
1696
  width: rect.width / scaleX,
@@ -1793,13 +1845,13 @@ function getMainAxisFromPlacement(placement) {
1793
1845
  return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
1794
1846
  }
1795
1847
 
1796
- var max = Math.max;
1797
- var min = Math.min;
1798
- var round = Math.round;
1799
-
1800
1848
  function within(min$1, value, max$1) {
1801
1849
  return max(min$1, min(value, max$1));
1802
1850
  }
1851
+ function withinMaxClamp(min, value, max) {
1852
+ var v = within(min, value, max);
1853
+ return v > max ? max : v;
1854
+ }
1803
1855
 
1804
1856
  function getFreshSideObject() {
1805
1857
  return {
@@ -1931,8 +1983,8 @@ function roundOffsetsByDPR(_ref) {
1931
1983
  var win = window;
1932
1984
  var dpr = win.devicePixelRatio || 1;
1933
1985
  return {
1934
- x: round(round(x * dpr) / dpr) || 0,
1935
- y: round(round(y * dpr) / dpr) || 0
1986
+ x: round(x * dpr) / dpr || 0,
1987
+ y: round(y * dpr) / dpr || 0
1936
1988
  };
1937
1989
  }
1938
1990
 
@@ -1947,7 +1999,8 @@ function mapToStyles(_ref2) {
1947
1999
  position = _ref2.position,
1948
2000
  gpuAcceleration = _ref2.gpuAcceleration,
1949
2001
  adaptive = _ref2.adaptive,
1950
- roundOffsets = _ref2.roundOffsets;
2002
+ roundOffsets = _ref2.roundOffsets,
2003
+ isFixed = _ref2.isFixed;
1951
2004
 
1952
2005
  var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
1953
2006
  _ref3$x = _ref3.x,
@@ -1979,16 +2032,18 @@ function mapToStyles(_ref2) {
1979
2032
  offsetParent = offsetParent;
1980
2033
 
1981
2034
  if (placement === top || (placement === left || placement === right) && variation === end) {
1982
- sideY = bottom; // $FlowFixMe[prop-missing]
1983
-
1984
- 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;
1985
2039
  y *= gpuAcceleration ? 1 : -1;
1986
2040
  }
1987
2041
 
1988
2042
  if (placement === left || (placement === top || placement === bottom) && variation === end) {
1989
- sideX = right; // $FlowFixMe[prop-missing]
1990
-
1991
- 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;
1992
2047
  x *= gpuAcceleration ? 1 : -1;
1993
2048
  }
1994
2049
  }
@@ -2031,7 +2086,8 @@ function computeStyles(_ref4) {
2031
2086
  variation: getVariation(state.placement),
2032
2087
  popper: state.elements.popper,
2033
2088
  popperRect: state.rects.popper,
2034
- gpuAcceleration: gpuAcceleration
2089
+ gpuAcceleration: gpuAcceleration,
2090
+ isFixed: state.options.strategy === 'fixed'
2035
2091
  };
2036
2092
 
2037
2093
  if (state.modifiersData.popperOffsets != null) {
@@ -2289,7 +2345,7 @@ function getInnerBoundingClientRect(element) {
2289
2345
  }
2290
2346
 
2291
2347
  function getClientRectFromMixedType(element, clippingParent) {
2292
- 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)));
2293
2349
  } // A "clipping parent" is an overflowable container with the characteristic of
2294
2350
  // clipping (or hiding) overflowing elements with a position different from
2295
2351
  // `initial`
@@ -2306,7 +2362,7 @@ function getClippingParents(element) {
2306
2362
 
2307
2363
 
2308
2364
  return clippingParents.filter(function (clippingParent) {
2309
- 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);
2310
2366
  });
2311
2367
  } // Gets the maximum area that the element is visible in due to any number of
2312
2368
  // clipping parents
@@ -2806,6 +2862,14 @@ function preventOverflow(_ref) {
2806
2862
  var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
2807
2863
  placement: state.placement
2808
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;
2809
2873
  var data = {
2810
2874
  x: 0,
2811
2875
  y: 0
@@ -2815,13 +2879,15 @@ function preventOverflow(_ref) {
2815
2879
  return;
2816
2880
  }
2817
2881
 
2818
- if (checkMainAxis || checkAltAxis) {
2882
+ if (checkMainAxis) {
2883
+ var _offsetModifierState$;
2884
+
2819
2885
  var mainSide = mainAxis === 'y' ? top : left;
2820
2886
  var altSide = mainAxis === 'y' ? bottom : right;
2821
2887
  var len = mainAxis === 'y' ? 'height' : 'width';
2822
2888
  var offset = popperOffsets[mainAxis];
2823
- var min$1 = popperOffsets[mainAxis] + overflow[mainSide];
2824
- var max$1 = popperOffsets[mainAxis] - overflow[altSide];
2889
+ var min$1 = offset + overflow[mainSide];
2890
+ var max$1 = offset - overflow[altSide];
2825
2891
  var additive = tether ? -popperRect[len] / 2 : 0;
2826
2892
  var minLen = variation === start ? referenceRect[len] : popperRect[len];
2827
2893
  var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
@@ -2841,36 +2907,45 @@ function preventOverflow(_ref) {
2841
2907
  // width or height)
2842
2908
 
2843
2909
  var arrowLen = within(0, referenceRect[len], arrowRect[len]);
2844
- var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;
2845
- 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;
2846
2912
  var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
2847
2913
  var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
2848
- var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;
2849
- var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;
2850
- 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
+ }
2851
2921
 
2852
- if (checkMainAxis) {
2853
- var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
2854
- popperOffsets[mainAxis] = preventedOffset;
2855
- data[mainAxis] = preventedOffset - offset;
2856
- }
2922
+ if (checkAltAxis) {
2923
+ var _offsetModifierState$2;
2857
2924
 
2858
- if (checkAltAxis) {
2859
- var _mainSide = mainAxis === 'x' ? top : left;
2925
+ var _mainSide = mainAxis === 'x' ? top : left;
2860
2926
 
2861
- var _altSide = mainAxis === 'x' ? bottom : right;
2927
+ var _altSide = mainAxis === 'x' ? bottom : right;
2862
2928
 
2863
- var _offset = popperOffsets[altAxis];
2929
+ var _offset = popperOffsets[altAxis];
2864
2930
 
2865
- var _min = _offset + overflow[_mainSide];
2931
+ var _len = altAxis === 'y' ? 'height' : 'width';
2866
2932
 
2867
- var _max = _offset - overflow[_altSide];
2933
+ var _min = _offset + overflow[_mainSide];
2868
2934
 
2869
- var _preventedOffset = within(tether ? min(_min, tetherMin) : _min, _offset, tether ? max(_max, tetherMax) : _max);
2935
+ var _max = _offset - overflow[_altSide];
2870
2936
 
2871
- popperOffsets[altAxis] = _preventedOffset;
2872
- data[altAxis] = _preventedOffset - _offset;
2873
- }
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;
2874
2949
  }
2875
2950
 
2876
2951
  state.modifiersData[name] = data;
@@ -2902,8 +2977,8 @@ function getNodeScroll(node) {
2902
2977
 
2903
2978
  function isElementScaled(element) {
2904
2979
  var rect = element.getBoundingClientRect();
2905
- var scaleX = rect.width / element.offsetWidth || 1;
2906
- 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;
2907
2982
  return scaleX !== 1 || scaleY !== 1;
2908
2983
  } // Returns the composite rect of an element relative to its offsetParent.
2909
2984
  // Composite means it takes into account transforms as well as layout.
@@ -2915,9 +2990,9 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
2915
2990
  }
2916
2991
 
2917
2992
  var isOffsetParentAnElement = isHTMLElement(offsetParent);
2918
- isHTMLElement(offsetParent) && isElementScaled(offsetParent);
2993
+ var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
2919
2994
  var documentElement = getDocumentElement(offsetParent);
2920
- var rect = getBoundingClientRect(elementOrVirtualElement);
2995
+ var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
2921
2996
  var scroll = {
2922
2997
  scrollLeft: 0,
2923
2998
  scrollTop: 0
@@ -2934,7 +3009,7 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
2934
3009
  }
2935
3010
 
2936
3011
  if (isHTMLElement(offsetParent)) {
2937
- offsets = getBoundingClientRect(offsetParent);
3012
+ offsets = getBoundingClientRect(offsetParent, true);
2938
3013
  offsets.x += offsetParent.clientLeft;
2939
3014
  offsets.y += offsetParent.clientTop;
2940
3015
  } else if (documentElement) {
@@ -3854,6 +3929,176 @@ const CDropdownPlugin = {
3854
3929
  },
3855
3930
  };
3856
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
+
3857
4102
  const CFooter = vue.defineComponent({
3858
4103
  name: 'CFooter',
3859
4104
  props: {
@@ -3945,9 +4190,8 @@ const CFormLabel = vue.defineComponent({
3945
4190
  required: false,
3946
4191
  },
3947
4192
  },
3948
- setup(props, { attrs, slots }) {
4193
+ setup(props, { slots }) {
3949
4194
  return () => vue.h('label', {
3950
- ...attrs,
3951
4195
  class: props.customClassName ? props.customClassName : 'form-label',
3952
4196
  }, slots.default && slots.default());
3953
4197
  },
@@ -3955,6 +4199,7 @@ const CFormLabel = vue.defineComponent({
3955
4199
 
3956
4200
  const CFormCheck = vue.defineComponent({
3957
4201
  name: 'CFormCheck',
4202
+ inheritAttrs: false,
3958
4203
  props: {
3959
4204
  /**
3960
4205
  * Create button-like checkboxes and radio buttons.
@@ -4005,6 +4250,10 @@ const CFormCheck = vue.defineComponent({
4005
4250
  default: undefined,
4006
4251
  required: false,
4007
4252
  },
4253
+ /**
4254
+ * Input Checkbox indeterminate Property
4255
+ */
4256
+ indeterminate: Boolean,
4008
4257
  /**
4009
4258
  * Group checkboxes or radios on the same horizontal row by adding.
4010
4259
  */
@@ -4027,6 +4276,14 @@ const CFormCheck = vue.defineComponent({
4027
4276
  default: undefined,
4028
4277
  required: false,
4029
4278
  },
4279
+ /**
4280
+ * The default name for a value passed using v-model.
4281
+ */
4282
+ modelValue: {
4283
+ type: [Boolean, String],
4284
+ value: undefined,
4285
+ required: false,
4286
+ },
4030
4287
  /**
4031
4288
  * Specifies the type of component.
4032
4289
  *
@@ -4045,19 +4302,37 @@ const CFormCheck = vue.defineComponent({
4045
4302
  required: false,
4046
4303
  },
4047
4304
  },
4048
- setup(props, { slots, attrs }) {
4049
- const formControl = () => {
4050
- return vue.h('input', {
4051
- ...attrs,
4052
- class: [
4053
- props.button ? 'btn-check' : 'form-check-input',
4054
- {
4055
- 'is-invalid': props.invalid,
4056
- 'is-valid': props.valid,
4305
+ emits: [
4306
+ /**
4307
+ * Event occurs when the checked value has been changed.
4308
+ */
4309
+ 'change',
4310
+ /**
4311
+ * Emit the new value whenever there’s a change event.
4312
+ */
4313
+ 'update:modelValue',
4314
+ ],
4315
+ setup(props, { attrs, emit, slots }) {
4316
+ const handleChange = (event) => {
4317
+ const target = event.target;
4318
+ emit('change', event);
4319
+ emit('update:modelValue', target.checked);
4320
+ };
4321
+ const formControl = () => {
4322
+ return vue.h('input', {
4323
+ checked: props.modelValue,
4324
+ class: [
4325
+ props.button ? 'btn-check' : 'form-check-input',
4326
+ {
4327
+ 'is-invalid': props.invalid,
4328
+ 'is-valid': props.valid,
4057
4329
  },
4058
4330
  ],
4059
4331
  id: props.id,
4332
+ indeterminate: props.indeterminate,
4333
+ onChange: (event) => handleChange(event),
4060
4334
  type: props.type,
4335
+ ...attrs,
4061
4336
  });
4062
4337
  };
4063
4338
  const formLabel = () => {
@@ -4158,6 +4433,14 @@ const CFormInput = vue.defineComponent({
4158
4433
  type: Boolean,
4159
4434
  required: false,
4160
4435
  },
4436
+ /**
4437
+ * The default name for a value passed using v-model.
4438
+ */
4439
+ modelValue: {
4440
+ type: String,
4441
+ default: undefined,
4442
+ require: false,
4443
+ },
4161
4444
  /**
4162
4445
  * Render the component styled as plain text. Removes the default form field styling and preserve the correct margin and padding. Recommend to use only along side `readonly`.
4163
4446
  */
@@ -4203,12 +4486,32 @@ const CFormInput = vue.defineComponent({
4203
4486
  required: false,
4204
4487
  },
4205
4488
  },
4206
- setup(props, { attrs, slots }) {
4489
+ emits: [
4490
+ /**
4491
+ * Event occurs when the element loses focus, after the content has been changed.
4492
+ */
4493
+ 'change',
4494
+ /**
4495
+ * Event occurs immediately after the value of a component has changed.
4496
+ */
4497
+ 'input',
4498
+ /**
4499
+ * Emit the new value whenever there’s an input or change event.
4500
+ */
4501
+ 'update:modelValue',
4502
+ ],
4503
+ setup(props, { emit, slots }) {
4504
+ const handleChange = (event) => {
4505
+ const target = event.target;
4506
+ emit('change', event);
4507
+ emit('update:modelValue', target.value);
4508
+ };
4509
+ const handleInput = (event) => {
4510
+ const target = event.target;
4511
+ emit('input', event);
4512
+ emit('update:modelValue', target.value);
4513
+ };
4207
4514
  return () => vue.h('input', {
4208
- type: props.type,
4209
- disabled: props.disabled,
4210
- readonly: props.readonly,
4211
- ...attrs,
4212
4515
  class: [
4213
4516
  props.plainText ? 'form-control-plaintext' : 'form-control',
4214
4517
  {
@@ -4218,6 +4521,12 @@ const CFormInput = vue.defineComponent({
4218
4521
  'is-valid': props.valid,
4219
4522
  },
4220
4523
  ],
4524
+ disabled: props.disabled,
4525
+ onChange: (event) => handleChange(event),
4526
+ onInput: (event) => handleInput(event),
4527
+ readonly: props.readonly,
4528
+ type: props.type,
4529
+ value: props.modelValue,
4221
4530
  }, slots.default && slots.default());
4222
4531
  },
4223
4532
  });
@@ -4249,6 +4558,14 @@ const CFormRange = vue.defineComponent({
4249
4558
  default: undefined,
4250
4559
  required: false,
4251
4560
  },
4561
+ /**
4562
+ * The default name for a value passed using v-model.
4563
+ */
4564
+ modelValue: {
4565
+ type: String,
4566
+ value: undefined,
4567
+ required: false,
4568
+ },
4252
4569
  /**
4253
4570
  * Toggle the readonly state for the component.
4254
4571
  */
@@ -4275,12 +4592,32 @@ const CFormRange = vue.defineComponent({
4275
4592
  required: false,
4276
4593
  },
4277
4594
  },
4278
- setup(props, { attrs, slots }) {
4595
+ emits: [
4596
+ /**
4597
+ * Event occurs when the value has been changed.
4598
+ */
4599
+ 'change',
4600
+ /**
4601
+ * Emit the new value whenever there’s a change event.
4602
+ */
4603
+ 'update:modelValue',
4604
+ ],
4605
+ setup(props, { emit, slots }) {
4606
+ const handleChange = (event) => {
4607
+ const target = event.target;
4608
+ emit('change', event);
4609
+ emit('update:modelValue', target.value);
4610
+ };
4279
4611
  return () => vue.h('input', {
4280
4612
  class: 'form-range',
4613
+ disabled: props.disabled,
4614
+ max: props.max,
4615
+ min: props.min,
4616
+ onChange: (event) => handleChange(event),
4617
+ steps: props.steps,
4618
+ readonly: props.readonly,
4281
4619
  type: 'range',
4282
- ...attrs,
4283
- ...props,
4620
+ value: props.modelValue,
4284
4621
  }, slots.default && slots.default());
4285
4622
  },
4286
4623
  });
@@ -4303,6 +4640,25 @@ const CFormSelect = vue.defineComponent({
4303
4640
  type: Boolean,
4304
4641
  required: false,
4305
4642
  },
4643
+ /**
4644
+ * The default name for a value passed using v-model.
4645
+ */
4646
+ modelValue: {
4647
+ type: String,
4648
+ default: undefined,
4649
+ require: false,
4650
+ },
4651
+ /**
4652
+ * Options list of the select component. Available keys: `label`, `value`, `disabled`.
4653
+ * Examples:
4654
+ * - `:options="[{ value: 'js', label: 'JavaScript' }, { value: 'html', label: 'HTML', disabled: true }]"`
4655
+ * - `:options="['js', 'html']"`
4656
+ */
4657
+ options: {
4658
+ type: Array,
4659
+ default: undefined,
4660
+ required: false,
4661
+ },
4306
4662
  /**
4307
4663
  * Size the component small or large.
4308
4664
  *
@@ -4324,22 +4680,52 @@ const CFormSelect = vue.defineComponent({
4324
4680
  required: false,
4325
4681
  },
4326
4682
  },
4327
- setup(props, { attrs, slots }) {
4683
+ emits: [
4684
+ /**
4685
+ * Event occurs when when a user changes the selected option of a `<select>` element.
4686
+ */
4687
+ 'change',
4688
+ /**
4689
+ * Emit the new value whenever there’s a change event.
4690
+ */
4691
+ 'update:modelValue',
4692
+ ],
4693
+ setup(props, { emit, slots }) {
4694
+ const handleChange = (event) => {
4695
+ const target = event.target;
4696
+ const selected = Array.from(target.options)
4697
+ .filter((option) => option.selected)
4698
+ .map((option) => option.value);
4699
+ const value = target.multiple ? selected : selected[0];
4700
+ emit('change', event);
4701
+ emit('update:modelValue', value);
4702
+ };
4328
4703
  return () => vue.h('select', {
4329
- ...attrs,
4330
4704
  class: [
4331
4705
  'form-select',
4332
4706
  {
4333
4707
  [`form-select-${props.size}`]: props.size,
4708
+ 'is-invalid': props.invalid,
4709
+ 'is-valid': props.valid,
4334
4710
  },
4335
4711
  ],
4712
+ onChange: (event) => handleChange(event),
4336
4713
  size: props.htmlSize,
4337
- }, slots.default && slots.default());
4714
+ }, props.options
4715
+ ? props.options.map((option) => {
4716
+ return vue.h('option', {
4717
+ ...(typeof option === 'object' &&
4718
+ option.disabled && { disabled: option.disabled }),
4719
+ ...(typeof option === 'object' && option.value && { value: option.value }),
4720
+ }, typeof option === 'string' ? option : option.label);
4721
+ })
4722
+ : slots.default && slots.default());
4338
4723
  },
4339
4724
  });
4340
4725
 
4341
4726
  const CFormSwitch = vue.defineComponent({
4342
4727
  name: 'CFormSwitch',
4728
+ inheritAttrs: false,
4343
4729
  props: {
4344
4730
  /**
4345
4731
  * The id global attribute defines an identifier (ID) that must be unique in the whole document
@@ -4364,6 +4750,14 @@ const CFormSwitch = vue.defineComponent({
4364
4750
  default: undefined,
4365
4751
  required: false,
4366
4752
  },
4753
+ /**
4754
+ * The default name for a value passed using v-model.
4755
+ */
4756
+ modelValue: {
4757
+ type: [Boolean, String],
4758
+ value: undefined,
4759
+ required: false,
4760
+ },
4367
4761
  /**
4368
4762
  * Size the component large or extra large. Works only with `switch`.
4369
4763
  *
@@ -4395,7 +4789,32 @@ const CFormSwitch = vue.defineComponent({
4395
4789
  required: false,
4396
4790
  },
4397
4791
  },
4398
- setup(props, { attrs }) {
4792
+ emits: [
4793
+ /**
4794
+ * Event occurs when the checked value has been changed.
4795
+ */
4796
+ 'change',
4797
+ /**
4798
+ * Emit the new value whenever there’s a change event.
4799
+ */
4800
+ 'update:modelValue',
4801
+ ],
4802
+ setup(props, { attrs, emit }) {
4803
+ const checked = vue.ref(attrs.checked);
4804
+ vue.onMounted(() => {
4805
+ if (props.modelValue && typeof props.modelValue === 'boolean') {
4806
+ console.log(props.modelValue);
4807
+ }
4808
+ });
4809
+ vue.watch(() => props.modelValue, () => {
4810
+ if (typeof props.modelValue === 'boolean')
4811
+ checked.value = props.modelValue;
4812
+ });
4813
+ const handleChange = (event) => {
4814
+ const target = event.target;
4815
+ emit('change', event);
4816
+ emit('update:modelValue', target.checked);
4817
+ };
4399
4818
  return () => vue.h('div', {
4400
4819
  class: [
4401
4820
  'form-check form-switch',
@@ -4408,8 +4827,7 @@ const CFormSwitch = vue.defineComponent({
4408
4827
  }, [
4409
4828
  vue.h('input', {
4410
4829
  ...attrs,
4411
- id: props.id,
4412
- type: props.type,
4830
+ checked: checked.value,
4413
4831
  class: [
4414
4832
  'form-check-input',
4415
4833
  {
@@ -4417,6 +4835,9 @@ const CFormSwitch = vue.defineComponent({
4417
4835
  'is-valid': props.valid,
4418
4836
  },
4419
4837
  ],
4838
+ id: props.id,
4839
+ onChange: (event) => handleChange(event),
4840
+ type: props.type,
4420
4841
  }),
4421
4842
  props.label &&
4422
4843
  vue.h(CFormLabel, {
@@ -4463,6 +4884,14 @@ const CFormTextarea = vue.defineComponent({
4463
4884
  type: Boolean,
4464
4885
  required: false,
4465
4886
  },
4887
+ /**
4888
+ * The default name for a value passed using v-model.
4889
+ */
4890
+ modelValue: {
4891
+ type: String,
4892
+ default: undefined,
4893
+ require: false,
4894
+ },
4466
4895
  /**
4467
4896
  * Render the component styled as plain text. Removes the default form field styling and preserve the correct margin and padding. Recommend to use only along side `readonly`.
4468
4897
  */
@@ -4485,9 +4914,27 @@ const CFormTextarea = vue.defineComponent({
4485
4914
  required: false,
4486
4915
  },
4487
4916
  },
4488
- setup(props, { attrs, slots }) {
4917
+ emits: [
4918
+ /**
4919
+ * Event occurs when the element loses focus, after the content has been changed.
4920
+ */
4921
+ 'change',
4922
+ /**
4923
+ * Event occurs immediately after the value of a component has changed.
4924
+ */
4925
+ 'input',
4926
+ /**
4927
+ * Emit the new value whenever there’s an input or change event.
4928
+ */
4929
+ 'update:modelValue',
4930
+ ],
4931
+ setup(props, { emit, slots }) {
4932
+ const handleInput = (event) => {
4933
+ const target = event.target;
4934
+ emit('input', event);
4935
+ emit('update:modelValue', target.value);
4936
+ };
4489
4937
  return () => vue.h('textarea', {
4490
- ...attrs,
4491
4938
  disabled: props.disabled,
4492
4939
  readonly: props.readonly,
4493
4940
  class: [
@@ -4497,6 +4944,8 @@ const CFormTextarea = vue.defineComponent({
4497
4944
  'is-valid': props.valid,
4498
4945
  },
4499
4946
  ],
4947
+ onInput: (event) => handleInput(event),
4948
+ value: props.modelValue,
4500
4949
  }, slots.default && slots.default());
4501
4950
  },
4502
4951
  });
@@ -4566,7 +5015,7 @@ const CFormPlugin = {
4566
5015
  },
4567
5016
  };
4568
5017
 
4569
- const BREAKPOINTS$2 = [
5018
+ const BREAKPOINTS$4 = [
4570
5019
  'xxl',
4571
5020
  'xl',
4572
5021
  'lg',
@@ -4639,40 +5088,40 @@ const CCol = vue.defineComponent({
4639
5088
  },
4640
5089
  },
4641
5090
  setup(props, { slots }) {
4642
- const repsonsiveCLassNames = [];
4643
- BREAKPOINTS$2.forEach((bp) => {
5091
+ const repsonsiveClassNames = [];
5092
+ BREAKPOINTS$4.forEach((bp) => {
4644
5093
  const breakpoint = props[bp];
4645
5094
  const infix = bp === 'xs' ? '' : `-${bp}`;
4646
5095
  if (breakpoint) {
4647
5096
  if (typeof breakpoint === 'number' || typeof breakpoint === 'string') {
4648
- repsonsiveCLassNames.push(`col${infix}-${breakpoint}`);
5097
+ repsonsiveClassNames.push(`col${infix}-${breakpoint}`);
4649
5098
  }
4650
5099
  if (typeof breakpoint === 'boolean') {
4651
- repsonsiveCLassNames.push(`col${infix}`);
5100
+ repsonsiveClassNames.push(`col${infix}`);
4652
5101
  }
4653
5102
  }
4654
5103
  if (breakpoint && typeof breakpoint === 'object') {
4655
5104
  if (typeof breakpoint.span === 'number' || typeof breakpoint.span === 'string') {
4656
- repsonsiveCLassNames.push(`col${infix}-${breakpoint.span}`);
5105
+ repsonsiveClassNames.push(`col${infix}-${breakpoint.span}`);
4657
5106
  }
4658
5107
  if (typeof breakpoint.span === 'boolean') {
4659
- repsonsiveCLassNames.push(`col${infix}`);
5108
+ repsonsiveClassNames.push(`col${infix}`);
4660
5109
  }
4661
5110
  if (typeof breakpoint.order === 'number' || typeof breakpoint.order === 'string') {
4662
- repsonsiveCLassNames.push(`order${infix}-${breakpoint.order}`);
5111
+ repsonsiveClassNames.push(`order${infix}-${breakpoint.order}`);
4663
5112
  }
4664
5113
  if (typeof breakpoint.offset === 'number') {
4665
- repsonsiveCLassNames.push(`offset${infix}-${breakpoint.offset}`);
5114
+ repsonsiveClassNames.push(`offset${infix}-${breakpoint.offset}`);
4666
5115
  }
4667
5116
  }
4668
5117
  });
4669
5118
  return () => vue.h('div', {
4670
- class: [repsonsiveCLassNames.length ? repsonsiveCLassNames : 'col'],
5119
+ class: [repsonsiveClassNames.length ? repsonsiveClassNames : 'col'],
4671
5120
  }, slots.default && slots.default());
4672
5121
  },
4673
5122
  });
4674
5123
 
4675
- const BREAKPOINTS$1 = [
5124
+ const BREAKPOINTS$3 = [
4676
5125
  'xxl',
4677
5126
  'xl',
4678
5127
  'lg',
@@ -4727,18 +5176,18 @@ const CContainer = vue.defineComponent({
4727
5176
  },
4728
5177
  },
4729
5178
  setup(props, { slots }) {
4730
- const repsonsiveCLassNames = [];
4731
- BREAKPOINTS$1.forEach((bp) => {
5179
+ const repsonsiveClassNames = [];
5180
+ BREAKPOINTS$3.forEach((bp) => {
4732
5181
  const breakpoint = props[bp];
4733
- breakpoint && repsonsiveCLassNames.push(`container-${bp}`);
5182
+ breakpoint && repsonsiveClassNames.push(`container-${bp}`);
4734
5183
  });
4735
5184
  return () => vue.h('div', {
4736
- class: [repsonsiveCLassNames.length ? repsonsiveCLassNames : 'container'],
5185
+ class: [repsonsiveClassNames.length ? repsonsiveClassNames : 'container'],
4737
5186
  }, slots.default && slots.default());
4738
5187
  },
4739
5188
  });
4740
5189
 
4741
- const BREAKPOINTS = [
5190
+ const BREAKPOINTS$2 = [
4742
5191
  'xxl',
4743
5192
  'xl',
4744
5193
  'lg',
@@ -4811,27 +5260,27 @@ const CRow = vue.defineComponent({
4811
5260
  },
4812
5261
  },
4813
5262
  setup(props, { slots }) {
4814
- const repsonsiveCLassNames = [];
4815
- BREAKPOINTS.forEach((bp) => {
5263
+ const repsonsiveClassNames = [];
5264
+ BREAKPOINTS$2.forEach((bp) => {
4816
5265
  const breakpoint = props[bp];
4817
5266
  const infix = bp === 'xs' ? '' : `-${bp}`;
4818
5267
  if (typeof breakpoint === 'object') {
4819
5268
  if (breakpoint.cols) {
4820
- repsonsiveCLassNames.push(`row-cols${infix}-${breakpoint.cols}`);
5269
+ repsonsiveClassNames.push(`row-cols${infix}-${breakpoint.cols}`);
4821
5270
  }
4822
5271
  if (typeof breakpoint.gutter === 'number') {
4823
- repsonsiveCLassNames.push(`g${infix}-${breakpoint.gutter}`);
5272
+ repsonsiveClassNames.push(`g${infix}-${breakpoint.gutter}`);
4824
5273
  }
4825
5274
  if (typeof breakpoint.gutterX === 'number') {
4826
- repsonsiveCLassNames.push(`gx${infix}-${breakpoint.gutterX}`);
5275
+ repsonsiveClassNames.push(`gx${infix}-${breakpoint.gutterX}`);
4827
5276
  }
4828
5277
  if (typeof breakpoint.gutterY === 'number') {
4829
- repsonsiveCLassNames.push(`gy${infix}-${breakpoint.gutterY}`);
5278
+ repsonsiveClassNames.push(`gy${infix}-${breakpoint.gutterY}`);
4830
5279
  }
4831
5280
  }
4832
5281
  });
4833
5282
  return () => vue.h('div', {
4834
- class: ['row', repsonsiveCLassNames],
5283
+ class: ['row', repsonsiveClassNames],
4835
5284
  }, slots.default && slots.default());
4836
5285
  },
4837
5286
  });
@@ -5125,86 +5574,6 @@ const CListGroupPlugin = {
5125
5574
  },
5126
5575
  };
5127
5576
 
5128
- const CSpinner = vue.defineComponent({
5129
- name: 'CSpinner',
5130
- props: {
5131
- /**
5132
- * Sets the color context of the component to one of CoreUI’s themed colors.
5133
- *
5134
- * @values 'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark', 'light'
5135
- */
5136
- color: {
5137
- type: String,
5138
- default: undefined,
5139
- required: false,
5140
- validator: (value) => {
5141
- return [
5142
- 'primary',
5143
- 'secondary',
5144
- 'success',
5145
- 'danger',
5146
- 'warning',
5147
- 'info',
5148
- 'dark',
5149
- 'light',
5150
- ].includes(value);
5151
- },
5152
- },
5153
- /**
5154
- * Component used for the root node. Either a string to use a HTML element or a component.
5155
- */
5156
- component: {
5157
- type: String,
5158
- default: 'div',
5159
- required: false,
5160
- },
5161
- /**
5162
- * Size the component small.
5163
- *
5164
- * @values 'sm'
5165
- */
5166
- size: {
5167
- type: String,
5168
- default: undefined,
5169
- required: false,
5170
- validator: (value) => {
5171
- return value === 'sm';
5172
- },
5173
- },
5174
- /**
5175
- * Set the button variant to an outlined button or a ghost button.
5176
- *
5177
- * @values 'border', 'grow'
5178
- */
5179
- variant: {
5180
- type: String,
5181
- default: 'border',
5182
- required: false,
5183
- validator: (value) => {
5184
- return ['border', 'grow'].includes(value);
5185
- },
5186
- },
5187
- /**
5188
- * Set visually hidden label for accessibility purposes.
5189
- */
5190
- visuallyHiddenLabel: {
5191
- type: String,
5192
- default: 'Loading...',
5193
- required: false,
5194
- },
5195
- },
5196
- setup(props) {
5197
- return () => vue.h(props.component, {
5198
- class: [
5199
- `spinner-${props.variant}`,
5200
- `text-${props.color}`,
5201
- props.size && `spinner-${props.variant}-${props.size}`,
5202
- ],
5203
- role: 'status',
5204
- }, vue.h('span', { class: ['visually-hidden'] }, props.visuallyHiddenLabel));
5205
- },
5206
- });
5207
-
5208
5577
  const CLoadingButton = vue.defineComponent({
5209
5578
  name: 'CLoadingButton',
5210
5579
  props: {
@@ -6689,20 +7058,19 @@ const COffcanvas = vue.defineComponent({
6689
7058
  onAfterEnter: () => handleAfterEnter(),
6690
7059
  onLeave: (el, done) => handleLeave(el, done),
6691
7060
  onAfterLeave: (el) => handleAfterLeave(el),
6692
- }, () => visible.value &&
6693
- vue.h('div', {
6694
- class: [
6695
- 'offcanvas',
6696
- {
6697
- [`offcanvas-${props.placement}`]: props.placement,
6698
- },
6699
- ],
6700
- ref: offcanvasRef,
6701
- role: 'dialog',
6702
- }, 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]])),
6703
7071
  props.backdrop &&
6704
7072
  vue.h(CBackdrop, {
6705
- class: 'modal-backdrop',
7073
+ class: 'offcanvas-backdrop',
6706
7074
  visible: visible.value,
6707
7075
  }),
6708
7076
  ];
@@ -7040,7 +7408,7 @@ const CSmartPagination = vue.defineComponent({
7040
7408
  }
7041
7409
  };
7042
7410
  return () => vue.h(CPagination, {
7043
- class: [`justify-content-${props.align}`],
7411
+ align: props.align,
7044
7412
  'aria-label': 'pagination',
7045
7413
  size: props.size,
7046
7414
  }, {
@@ -7149,15 +7517,29 @@ const CPaginationPlugin = {
7149
7517
  },
7150
7518
  };
7151
7519
 
7152
- const CProgressBar = vue.defineComponent({
7153
- name: 'CProgressBar',
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',
7154
7530
  props: {
7155
7531
  /**
7156
- * Use to animate the stripes right to left via CSS3 animations.
7532
+ * Set animation type to better convey the perception of something being actively loaded.
7533
+ *
7534
+ * @values 'glow', 'wave'
7157
7535
  */
7158
- animated: {
7159
- type: Boolean,
7160
- required: false,
7536
+ animation: {
7537
+ type: String,
7538
+ default: undefined,
7539
+ require: false,
7540
+ validator: (value) => {
7541
+ return ['glow', 'wave'].includes(value);
7542
+ },
7161
7543
  },
7162
7544
  /**
7163
7545
  * Sets the color context of the component to one of CoreUI’s themed colors.
@@ -7166,7 +7548,124 @@ const CProgressBar = vue.defineComponent({
7166
7548
  */
7167
7549
  color: Color,
7168
7550
  /**
7169
- * The percent to progress the ProgressBar.
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
+
7651
+ const CProgressBar = vue.defineComponent({
7652
+ name: 'CProgressBar',
7653
+ props: {
7654
+ /**
7655
+ * Use to animate the stripes right to left via CSS3 animations.
7656
+ */
7657
+ animated: {
7658
+ type: Boolean,
7659
+ required: false,
7660
+ },
7661
+ /**
7662
+ * Sets the color context of the component to one of CoreUI’s themed colors.
7663
+ *
7664
+ * @values 'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark', 'light'
7665
+ */
7666
+ color: Color,
7667
+ /**
7668
+ * The percent to progress the ProgressBar.
7170
7669
  */
7171
7670
  value: {
7172
7671
  type: Number,
@@ -7666,90 +8165,6 @@ const CSidebarPlugin = {
7666
8165
  },
7667
8166
  };
7668
8167
 
7669
- const CSpinnerPlugin = {
7670
- install: (app) => {
7671
- app.component(CSpinner.name, CSpinner);
7672
- },
7673
- };
7674
-
7675
- const CElementCover = vue.defineComponent({
7676
- name: 'CElementCover',
7677
- props: {
7678
- /**
7679
- * 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:
7680
- * - sides (array) - select boundaries of element to define boundaries. Sides names: 'top', 'bottom', 'right', 'left'.
7681
- * - query (string) - query used to get element which define boundaries. Search will be done only inside parent element, by parent.querySelector(query) function. [docs]
7682
- *
7683
- * @type {sides: string[], query: string}[]
7684
- */
7685
- boundaries: {
7686
- // TODO: check if this is correct, TJ
7687
- type: Array,
7688
- require: true,
7689
- },
7690
- /**
7691
- * Opacity of the cover. [docs]
7692
- *
7693
- * @type number
7694
- */
7695
- opacity: {
7696
- type: Number,
7697
- require: false,
7698
- },
7699
- },
7700
- setup(props) {
7701
- let containerCoords = {};
7702
- const elementRef = vue.ref();
7703
- const getCustomBoundaries = () => {
7704
- if (!props.boundaries || elementRef === null) {
7705
- return {};
7706
- }
7707
- const parent = elementRef.value.parentElement;
7708
- if (!parent) {
7709
- return {};
7710
- }
7711
- const parentCoords = parent.getBoundingClientRect();
7712
- const customBoundaries = {};
7713
- props.boundaries.forEach((value) => {
7714
- const element = parent.querySelector(value.query);
7715
- if (!element || !value.sides) {
7716
- return;
7717
- }
7718
- const coords = element.getBoundingClientRect();
7719
- value.sides.forEach((side) => {
7720
- const sideMargin = Math.abs(coords[side] - parentCoords[side]);
7721
- customBoundaries[side] = `${sideMargin}px`;
7722
- });
7723
- });
7724
- return customBoundaries;
7725
- };
7726
- vue.onMounted(function () {
7727
- vue.nextTick(function () {
7728
- containerCoords = getCustomBoundaries();
7729
- });
7730
- });
7731
- return () => vue.h('div', {
7732
- style: {
7733
- ...containerCoords,
7734
- position: 'absolute',
7735
- 'background-color': `rgb(255,255,255,${props.opacity})`,
7736
- },
7737
- ref: elementRef,
7738
- }, vue.h('div', // TODO: use slot to override this
7739
- {
7740
- style: {
7741
- position: 'absolute',
7742
- top: '50%',
7743
- left: '50%',
7744
- transform: 'translateX(-50%) translateY(-50%)',
7745
- },
7746
- }, vue.h(CSpinner, {
7747
- variant: 'grow',
7748
- color: 'primary',
7749
- })));
7750
- },
7751
- });
7752
-
7753
8168
  const CTable = vue.defineComponent({
7754
8169
  name: 'CTable',
7755
8170
  props: {
@@ -8324,30 +8739,31 @@ const CSmartTableHead = vue.defineComponent({
8324
8739
  })),
8325
8740
  ],
8326
8741
  }),
8327
- vue.h(CTableRow, {}, {
8328
- default: () => [
8329
- props.selectable && vue.h(CTableHeaderCell),
8330
- props.columns.map((column) => vue.h(CTableHeaderCell, {
8331
- ...tableHeaderCellProps(column),
8332
- }, {
8333
- default: () => (typeof column !== 'object'
8334
- ? true
8335
- : typeof column.filter === 'undefined'
8742
+ props.columnFilter &&
8743
+ vue.h(CTableRow, {}, {
8744
+ default: () => [
8745
+ props.selectable && vue.h(CTableHeaderCell),
8746
+ props.columns.map((column) => vue.h(CTableHeaderCell, {
8747
+ ...tableHeaderCellProps(column),
8748
+ }, {
8749
+ default: () => (typeof column !== 'object'
8336
8750
  ? true
8337
- : column.filter) &&
8338
- vue.h(CFormInput, {
8339
- size: 'sm',
8340
- onInput: (event) => handleFilterInput(key(column), event.target.value),
8341
- onChange: (event) => handleFilterChange(key(column), event.target.value),
8342
- 'aria-label': `column name: '${label(column)}' filter input`,
8343
- ...(props.columnFilter &&
8344
- props.columnFilter[key(column)] && {
8345
- value: props.columnFilter[key(column)],
8751
+ : typeof column.filter === 'undefined'
8752
+ ? true
8753
+ : column.filter) &&
8754
+ vue.h(CFormInput, {
8755
+ size: 'sm',
8756
+ onInput: (event) => handleFilterInput(key(column), event.target.value),
8757
+ onChange: (event) => handleFilterChange(key(column), event.target.value),
8758
+ 'aria-label': `column name: '${label(column)}' filter input`,
8759
+ ...(props.columnFilter &&
8760
+ props.columnFilter[key(column)] && {
8761
+ value: props.columnFilter[key(column)],
8762
+ }),
8346
8763
  }),
8347
- }),
8348
- })),
8349
- ],
8350
- }),
8764
+ })),
8765
+ ],
8766
+ }),
8351
8767
  ],
8352
8768
  });
8353
8769
  },
@@ -8635,7 +9051,6 @@ const CSmartTable = vue.defineComponent({
8635
9051
  */
8636
9052
  cleaner: {
8637
9053
  type: Boolean,
8638
- default: true,
8639
9054
  required: false,
8640
9055
  },
8641
9056
  /**
@@ -8846,7 +9261,6 @@ const CSmartTable = vue.defineComponent({
8846
9261
  */
8847
9262
  tableFilter: {
8848
9263
  type: [Boolean, Object],
8849
- default: undefined,
8850
9264
  required: false,
8851
9265
  },
8852
9266
  /**
@@ -8956,16 +9370,19 @@ const CSmartTable = vue.defineComponent({
8956
9370
  const items = vue.ref(props.items.map((item, index) => {
8957
9371
  return { ...item, _id: index };
8958
9372
  }));
8959
- vue.watch(props.items, () => {
9373
+ vue.watch(() => props.items, () => {
8960
9374
  items.value = props.items.map((item, index) => {
8961
9375
  return { ...item, _id: index };
8962
9376
  });
8963
- console.log(props.items);
9377
+ if (items.value &&
9378
+ items.value.length < itemsPerPage.value * activePage.value - itemsPerPage.value) {
9379
+ activePage.value = 1;
9380
+ }
8964
9381
  });
8965
9382
  const selectedAll = vue.ref();
8966
9383
  vue.watch(items, () => {
8967
- console.log(items.value);
8968
9384
  const selected = items.value.filter((item) => item._selected === true);
9385
+ emit('selectedItemsChange', selected);
8969
9386
  if (selected.length === items.value.length) {
8970
9387
  selectedAll.value = true;
8971
9388
  return;
@@ -8977,13 +9394,18 @@ const CSmartTable = vue.defineComponent({
8977
9394
  if (selected.length !== 0 && selected.length !== items.value.length) {
8978
9395
  selectedAll.value = 'indeterminate';
8979
9396
  }
8980
- emit('selectedItemsChange', selected);
8981
9397
  });
8982
9398
  const itemsPerPage = vue.ref(props.itemsPerPage);
8983
9399
  const activePage = vue.ref(props.activePage);
8984
9400
  const sorterState = vue.reactive(props.sorterValue || {});
8985
9401
  const columnFilterState = vue.ref(props.columnFilterValue ? props.columnFilterValue : {});
8986
9402
  const tableFilterState = vue.ref(props.tableFilterValue ? props.tableFilterValue : '');
9403
+ vue.onMounted(() => {
9404
+ if (items.value &&
9405
+ items.value.length < itemsPerPage.value * activePage.value - itemsPerPage.value) {
9406
+ activePage.value = 1;
9407
+ }
9408
+ });
8987
9409
  // functions
8988
9410
  const isSortable = (i) => {
8989
9411
  const isDataColumn = itemsDataColumns.value.includes(rawColumnNames[i]);
@@ -9011,7 +9433,12 @@ const CSmartTable = vue.defineComponent({
9011
9433
  state.state = 'desc';
9012
9434
  }
9013
9435
  else {
9014
- state.state = 0;
9436
+ if (typeof props.columnSorter === 'object' && !props.columnSorter.resetable) {
9437
+ state.state = 'asc';
9438
+ }
9439
+ else {
9440
+ state.state = 0;
9441
+ }
9015
9442
  }
9016
9443
  }
9017
9444
  else {
@@ -9024,7 +9451,6 @@ const CSmartTable = vue.defineComponent({
9024
9451
  };
9025
9452
  const handleActivePageChange = (page) => {
9026
9453
  activePage.value = page;
9027
- // currentItems.value = updatePage(sortedItems)
9028
9454
  emit('activePageChange', page);
9029
9455
  };
9030
9456
  const handleItemsPerPageChange = (itemsPerPageNumber) => {
@@ -9153,22 +9579,23 @@ const CSmartTable = vue.defineComponent({
9153
9579
  Object.values(columnFilterState.value).join(''));
9154
9580
  });
9155
9581
  return () => vue.h('div', {}, [
9156
- vue.h('div', {
9157
- class: 'row my-2 mx-0',
9158
- }, {
9159
- default: () => (props.tableFilter || props.cleaner) && [
9160
- vue.h('div', {
9161
- class: 'col-auto p-0',
9162
- }, props.tableFilter &&
9163
- vue.h(CSmartTableFilter, {
9164
- onFilterInput: (value) => tableFilterChange(value, 'input'),
9165
- onFilterChange: (value) => tableFilterChange(value, 'change'),
9166
- value: tableFilterState.value,
9167
- })),
9168
- vue.h('div', {
9169
- class: 'col-auto p-0',
9170
- }, props.cleaner &&
9171
- vue.h(CSmartTableCleaner, {
9582
+ (props.tableFilter || props.cleaner) &&
9583
+ vue.h('div', {
9584
+ class: 'row my-2 mx-0',
9585
+ }, [
9586
+ props.tableFilter &&
9587
+ vue.h('div', {
9588
+ class: 'col-auto p-0',
9589
+ }, props.tableFilter &&
9590
+ vue.h(CSmartTableFilter, {
9591
+ onFilterInput: (value) => tableFilterChange(value, 'input'),
9592
+ onFilterChange: (value) => tableFilterChange(value, 'change'),
9593
+ value: tableFilterState.value,
9594
+ })),
9595
+ props.cleaner &&
9596
+ vue.h('div', {
9597
+ class: 'col-auto p-0',
9598
+ }, vue.h(CSmartTableCleaner, {
9172
9599
  onClick: () => clean(),
9173
9600
  isFiltered: isFiltered.value,
9174
9601
  }, {
@@ -9177,8 +9604,7 @@ const CSmartTable = vue.defineComponent({
9177
9604
  ? slots.cleanerIcon()
9178
9605
  : vue.h(CIcon, { width: '18', content: cilFilterX }),
9179
9606
  })),
9180
- ],
9181
- }),
9607
+ ]),
9182
9608
  vue.h('div', {
9183
9609
  class: 'position-relative',
9184
9610
  }, {
@@ -9277,7 +9703,7 @@ const CSmartTable = vue.defineComponent({
9277
9703
  class: 'row',
9278
9704
  }, [
9279
9705
  vue.h('div', {
9280
- class: 'col-auto',
9706
+ class: 'col',
9281
9707
  }, props.pagination && numberOfPages.value > 1
9282
9708
  ? vue.h(CSmartPagination, {
9283
9709
  ...props.paginationProps,
@@ -9552,7 +9978,7 @@ const CToastClose = vue.defineComponent({
9552
9978
  updateVisible(false);
9553
9979
  };
9554
9980
  return () => props.component
9555
- ? vue.h(vue.resolveComponent(props.component), {
9981
+ ? vue.h(props.component, {
9556
9982
  onClick: () => {
9557
9983
  handleClose();
9558
9984
  },
@@ -10313,6 +10739,8 @@ var Components = /*#__PURE__*/Object.freeze({
10313
10739
  CDropdownDivider: CDropdownDivider,
10314
10740
  CDropdownMenu: CDropdownMenu,
10315
10741
  CDropdownToggle: CDropdownToggle,
10742
+ CElementCoverPlugin: CElementCoverPlugin,
10743
+ CElementCover: CElementCover,
10316
10744
  CFooterPlugin: CFooterPlugin,
10317
10745
  CFooter: CFooter,
10318
10746
  CFormPlugin: CFormPlugin,
@@ -10379,6 +10807,8 @@ var Components = /*#__PURE__*/Object.freeze({
10379
10807
  CPagination: CPagination,
10380
10808
  CPaginationItem: CPaginationItem,
10381
10809
  CSmartPagination: CSmartPagination,
10810
+ CPlaceholderPlugin: CPlaceholderPlugin,
10811
+ CPlaceholder: CPlaceholder,
10382
10812
  CProgressPlugin: CProgressPlugin,
10383
10813
  CProgress: CProgress,
10384
10814
  CProgressBar: CProgressBar,
@@ -10424,49 +10854,79 @@ var Components = /*#__PURE__*/Object.freeze({
10424
10854
  CWidgetStatsF: CWidgetStatsF
10425
10855
  });
10426
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
+
10427
10883
  const getUID$1 = (prefix) => {
10428
10884
  do {
10429
10885
  prefix += Math.floor(Math.random() * 1000000);
10430
10886
  } while (document.getElementById(prefix));
10431
10887
  return prefix;
10432
10888
  };
10433
- const createTooltipElement = (id, content) => {
10434
- const tooltip = document.createElement('div');
10435
- tooltip.id = id;
10436
- tooltip.classList.add('tooltip', 'bs-tooltip-auto', 'fade');
10437
- tooltip.setAttribute('role', 'tooltip');
10438
- tooltip.innerHTML = `<div class="tooltip-arrow" data-popper-arrow></div>
10439
- <div class="tooltip-inner" id="">${content}</div>`;
10440
- 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;
10441
10898
  };
10442
- const addTooltipElement = (tooltip, el, popperOptions) => {
10443
- document.body.appendChild(tooltip);
10444
- createPopper(el, tooltip, popperOptions);
10899
+ const addPopoverElement = (popover, el, popperOptions) => {
10900
+ document.body.appendChild(popover);
10901
+ createPopper(el, popover, popperOptions);
10445
10902
  setTimeout(() => {
10446
- tooltip.classList.add('show');
10903
+ popover.classList.add('show');
10447
10904
  }, 1);
10448
10905
  };
10449
- const removeTooltipElement = (tooltip) => {
10450
- tooltip.classList.remove('show');
10906
+ const removePopoverElement = (popover) => {
10907
+ popover.classList.remove('show');
10451
10908
  setTimeout(() => {
10452
- document.body.removeChild(tooltip);
10909
+ document.body.removeChild(popover);
10453
10910
  }, 300);
10454
10911
  };
10455
- const toggleTooltipElement = (tooltip, el, popperOptions) => {
10456
- const popperElement = document.getElementById(tooltip.id);
10912
+ const togglePopoverElement = (popover, el, popperOptions) => {
10913
+ const popperElement = document.getElementById(popover.id);
10457
10914
  if (popperElement && popperElement.classList.contains('show')) {
10458
- removeTooltipElement(tooltip);
10915
+ removePopoverElement(popover);
10459
10916
  return;
10460
10917
  }
10461
- addTooltipElement(tooltip, el, popperOptions);
10918
+ addPopoverElement(popover, el, popperOptions);
10462
10919
  };
10463
- var vctooltip = {
10920
+ var vcpopover = {
10921
+ name: 'c-popover',
10922
+ uid: '',
10464
10923
  mounted(el, binding) {
10465
10924
  const value = binding.value;
10466
10925
  const content = typeof value === 'string' ? value : value.content ? value.content : '';
10467
- const trigger = value.trigger ? value.trigger : 'hover';
10926
+ const header = value.header ? value.header : '';
10927
+ const trigger = value.trigger ? value.trigger : 'click';
10468
10928
  // Popper Config
10469
- const offset = value.offset ? value.offset : [0, 0];
10929
+ const offset = value.offset ? value.offset : [0, 8];
10470
10930
  const placement = value.placement ? value.placement : 'top';
10471
10931
  const popperOptions = {
10472
10932
  placement: placement,
@@ -10479,33 +10939,33 @@ var vctooltip = {
10479
10939
  },
10480
10940
  ],
10481
10941
  };
10482
- const tooltipUID = getUID$1('tooltip');
10483
- binding.arg = tooltipUID;
10484
- const tooltip = createTooltipElement(tooltipUID, content);
10942
+ const popoverUID = getUID$1('popover');
10943
+ binding.arg = popoverUID;
10944
+ const popover = createPopoverElement(popoverUID, header, content);
10485
10945
  trigger.includes('click') &&
10486
10946
  el.addEventListener('click', () => {
10487
- toggleTooltipElement(tooltip, el, popperOptions);
10947
+ togglePopoverElement(popover, el, popperOptions);
10488
10948
  });
10489
10949
  if (trigger.includes('focus')) {
10490
10950
  el.addEventListener('focus', () => {
10491
- addTooltipElement(tooltip, el, popperOptions);
10951
+ addPopoverElement(popover, el, popperOptions);
10492
10952
  });
10493
10953
  el.addEventListener('blur', () => {
10494
- removeTooltipElement(tooltip);
10954
+ removePopoverElement(popover);
10495
10955
  });
10496
10956
  }
10497
10957
  if (trigger.includes('hover')) {
10498
10958
  el.addEventListener('mouseenter', () => {
10499
- addTooltipElement(tooltip, el, popperOptions);
10959
+ addPopoverElement(popover, el, popperOptions);
10500
10960
  });
10501
10961
  el.addEventListener('mouseleave', () => {
10502
- removeTooltipElement(tooltip);
10962
+ removePopoverElement(popover);
10503
10963
  });
10504
10964
  }
10505
10965
  },
10506
- beforeUnmount(binding) {
10507
- const tooltip = binding.arg && document.getElementById(binding.arg);
10508
- tooltip && tooltip.remove();
10966
+ unmounted(binding) {
10967
+ const popover = binding.arg && document.getElementById(binding.arg);
10968
+ popover && popover.remove();
10509
10969
  },
10510
10970
  };
10511
10971
 
@@ -10515,47 +10975,43 @@ const getUID = (prefix) => {
10515
10975
  } while (document.getElementById(prefix));
10516
10976
  return prefix;
10517
10977
  };
10518
- const createPopoverElement = (id, header, content) => {
10519
- const popover = document.createElement('div');
10520
- popover.id = id;
10521
- popover.classList.add('popover', 'bs-popover-auto', 'fade');
10522
- popover.setAttribute('role', 'popover');
10523
- popover.innerHTML = `<div class="popover-arrow" data-popper-arrow></div>
10524
- <div class="popover-header">${header}</div>
10525
- <div class="popover-body" id="">${content}</div>`;
10526
- 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;
10527
10986
  };
10528
- const addPopoverElement = (popover, el, popperOptions) => {
10529
- document.body.appendChild(popover);
10530
- createPopper(el, popover, popperOptions);
10987
+ const addTooltipElement = (tooltip, el, popperOptions) => {
10988
+ document.body.appendChild(tooltip);
10989
+ createPopper(el, tooltip, popperOptions);
10531
10990
  setTimeout(() => {
10532
- popover.classList.add('show');
10991
+ tooltip.classList.add('show');
10533
10992
  }, 1);
10534
10993
  };
10535
- const removePopoverElement = (popover) => {
10536
- popover.classList.remove('show');
10994
+ const removeTooltipElement = (tooltip) => {
10995
+ tooltip.classList.remove('show');
10537
10996
  setTimeout(() => {
10538
- document.body.removeChild(popover);
10997
+ document.body.removeChild(tooltip);
10539
10998
  }, 300);
10540
10999
  };
10541
- const togglePopoverElement = (popover, el, popperOptions) => {
10542
- const popperElement = document.getElementById(popover.id);
11000
+ const toggleTooltipElement = (tooltip, el, popperOptions) => {
11001
+ const popperElement = document.getElementById(tooltip.id);
10543
11002
  if (popperElement && popperElement.classList.contains('show')) {
10544
- removePopoverElement(popover);
11003
+ removeTooltipElement(tooltip);
10545
11004
  return;
10546
11005
  }
10547
- addPopoverElement(popover, el, popperOptions);
11006
+ addTooltipElement(tooltip, el, popperOptions);
10548
11007
  };
10549
- var vcpopover = {
10550
- name: 'c-popover',
10551
- uid: '',
11008
+ var vctooltip = {
10552
11009
  mounted(el, binding) {
10553
11010
  const value = binding.value;
10554
11011
  const content = typeof value === 'string' ? value : value.content ? value.content : '';
10555
- const header = value.header ? value.header : '';
10556
- const trigger = value.trigger ? value.trigger : 'click';
11012
+ const trigger = value.trigger ? value.trigger : 'hover';
10557
11013
  // Popper Config
10558
- const offset = value.offset ? value.offset : [0, 8];
11014
+ const offset = value.offset ? value.offset : [0, 0];
10559
11015
  const placement = value.placement ? value.placement : 'top';
10560
11016
  const popperOptions = {
10561
11017
  placement: placement,
@@ -10568,33 +11024,33 @@ var vcpopover = {
10568
11024
  },
10569
11025
  ],
10570
11026
  };
10571
- const popoverUID = getUID('popover');
10572
- binding.arg = popoverUID;
10573
- const popover = createPopoverElement(popoverUID, header, content);
11027
+ const tooltipUID = getUID('tooltip');
11028
+ binding.arg = tooltipUID;
11029
+ const tooltip = createTooltipElement(tooltipUID, content);
10574
11030
  trigger.includes('click') &&
10575
11031
  el.addEventListener('click', () => {
10576
- togglePopoverElement(popover, el, popperOptions);
11032
+ toggleTooltipElement(tooltip, el, popperOptions);
10577
11033
  });
10578
11034
  if (trigger.includes('focus')) {
10579
11035
  el.addEventListener('focus', () => {
10580
- addPopoverElement(popover, el, popperOptions);
11036
+ addTooltipElement(tooltip, el, popperOptions);
10581
11037
  });
10582
11038
  el.addEventListener('blur', () => {
10583
- removePopoverElement(popover);
11039
+ removeTooltipElement(tooltip);
10584
11040
  });
10585
11041
  }
10586
11042
  if (trigger.includes('hover')) {
10587
11043
  el.addEventListener('mouseenter', () => {
10588
- addPopoverElement(popover, el, popperOptions);
11044
+ addTooltipElement(tooltip, el, popperOptions);
10589
11045
  });
10590
11046
  el.addEventListener('mouseleave', () => {
10591
- removePopoverElement(popover);
11047
+ removeTooltipElement(tooltip);
10592
11048
  });
10593
11049
  }
10594
11050
  },
10595
- unmounted(binding) {
10596
- const popover = binding.arg && document.getElementById(binding.arg);
10597
- popover && popover.remove();
11051
+ beforeUnmount(binding) {
11052
+ const tooltip = binding.arg && document.getElementById(binding.arg);
11053
+ tooltip && tooltip.remove();
10598
11054
  },
10599
11055
  };
10600
11056
 
@@ -10621,6 +11077,7 @@ const CoreuiVue = {
10621
11077
  // for (const directive in pluginDirectives) {
10622
11078
  // app.directive(directive, Directives[directive])
10623
11079
  // }
11080
+ app.directive('c-placeholder', vcplaceholder);
10624
11081
  app.directive('c-popover', vcpopover);
10625
11082
  app.directive('c-tooltip', vctooltip);
10626
11083
  },
@@ -10683,6 +11140,8 @@ exports.CDropdownItem = CDropdownItem;
10683
11140
  exports.CDropdownMenu = CDropdownMenu;
10684
11141
  exports.CDropdownPlugin = CDropdownPlugin;
10685
11142
  exports.CDropdownToggle = CDropdownToggle;
11143
+ exports.CElementCover = CElementCover;
11144
+ exports.CElementCoverPlugin = CElementCoverPlugin;
10686
11145
  exports.CFooter = CFooter;
10687
11146
  exports.CFooterPlugin = CFooterPlugin;
10688
11147
  exports.CForm = CForm;
@@ -10744,6 +11203,8 @@ exports.COffcanvasTitle = COffcanvasTitle;
10744
11203
  exports.CPagination = CPagination;
10745
11204
  exports.CPaginationItem = CPaginationItem;
10746
11205
  exports.CPaginationPlugin = CPaginationPlugin;
11206
+ exports.CPlaceholder = CPlaceholder;
11207
+ exports.CPlaceholderPlugin = CPlaceholderPlugin;
10747
11208
  exports.CPopover = CPopover;
10748
11209
  exports.CPopoverPlugin = CPopoverPlugin;
10749
11210
  exports.CProgress = CProgress;
@@ -10790,6 +11251,7 @@ exports.CWidgetStatsE = CWidgetStatsE;
10790
11251
  exports.CWidgetStatsF = CWidgetStatsF;
10791
11252
  exports.CWidgetsStatsPlugin = CWidgetsStatsPlugin;
10792
11253
  exports["default"] = CoreuiVue;
11254
+ exports.vcplaceholder = vcplaceholder;
10793
11255
  exports.vcpopover = vcpopover;
10794
11256
  exports.vctooltip = vctooltip;
10795
11257
  //# sourceMappingURL=index.js.map