@coreui/react 4.9.0-alpha.1 → 4.9.0-beta.1

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.
package/README.md CHANGED
@@ -46,7 +46,7 @@
46
46
 
47
47
  Several quick start options are available:
48
48
 
49
- - [Download the latest release](https://github.com/coreui/coreui-react/archive/v4.9.0-alpha.1.zip)
49
+ - [Download the latest release](https://github.com/coreui/coreui-react/archive/v4.9.0-beta.1.zip)
50
50
  - Clone the repo: `git clone https://github.com/coreui/coreui-react.git`
51
51
  - Install with [npm](https://www.npmjs.com/): `npm install @coreui/react`
52
52
  - Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/react`
@@ -3,4 +3,4 @@ import { CAccordionBody } from './CAccordionBody';
3
3
  import { CAccordionButton } from './CAccordionButton';
4
4
  import { CAccordionHeader } from './CAccordionHeader';
5
5
  import { CAccordionItem } from './CAccordionItem';
6
- export { CAccordion, CAccordionBody, CAccordionButton, CAccordionHeader, CAccordionItem, };
6
+ export { CAccordion, CAccordionBody, CAccordionButton, CAccordionHeader, CAccordionItem };
@@ -1,2 +1,3 @@
1
+ import { useColorModes } from './useColorModes';
1
2
  import { useForkedRef } from './useForkedRef';
2
- export { useForkedRef };
3
+ export { useColorModes, useForkedRef };
@@ -0,0 +1,7 @@
1
+ interface UseColorModesOutput {
2
+ getColorMode: () => string;
3
+ isColorModeSet: () => boolean;
4
+ setColorMode: (mode: string) => void;
5
+ }
6
+ export declare const useColorModes: (localStorageItemName?: string) => UseColorModesOutput;
7
+ export {};
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from './components/';
2
+ export * from './hooks/';
package/dist/index.es.js CHANGED
@@ -2472,6 +2472,47 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, T
2472
2472
  }) : {};
2473
2473
  var CSSTransition$1 = CSSTransition;
2474
2474
 
2475
+ var getStoredTheme = function (localStorageItemName) { return localStorage.getItem(localStorageItemName); };
2476
+ var setStoredTheme = function (localStorageItemName, colorMode) {
2477
+ return localStorage.setItem(localStorageItemName, colorMode);
2478
+ };
2479
+ var getPreferredColorScheme = function (localStorageItemName) {
2480
+ var storedTheme = getStoredTheme(localStorageItemName);
2481
+ if (storedTheme) {
2482
+ return storedTheme;
2483
+ }
2484
+ return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
2485
+ };
2486
+ var setTheme = function (colorMode) {
2487
+ document.documentElement.dataset.coreuiTheme =
2488
+ colorMode === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches
2489
+ ? 'dark'
2490
+ : colorMode;
2491
+ var event = new Event('ColorSchemeChange');
2492
+ document.documentElement.dispatchEvent(event);
2493
+ };
2494
+ var useColorModes = function (localStorageItemName) {
2495
+ if (localStorageItemName === void 0) { localStorageItemName = 'coreui-react-color-scheme'; }
2496
+ var _a = useState(getPreferredColorScheme(localStorageItemName)), colorMode = _a[0], setColorMode = _a[1];
2497
+ useEffect(function () {
2498
+ setStoredTheme(localStorageItemName, colorMode);
2499
+ setTheme(colorMode);
2500
+ }, [colorMode]);
2501
+ useEffect(function () {
2502
+ window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', function () {
2503
+ var storedTheme = getStoredTheme(localStorageItemName);
2504
+ if (storedTheme !== 'light' && storedTheme !== 'dark') {
2505
+ setTheme(colorMode);
2506
+ }
2507
+ });
2508
+ }, []);
2509
+ return {
2510
+ getColorMode: function () { return colorMode; },
2511
+ isColorModeSet: function () { return Boolean(getStoredTheme(localStorageItemName)); },
2512
+ setColorMode: function (mode) { return setColorMode(mode); },
2513
+ };
2514
+ };
2515
+
2475
2516
  // code borrowed from https://github.com/reach/reach-ui
2476
2517
  // problem described https://github.com/facebook/react/issues/13029
2477
2518
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -2505,7 +2546,7 @@ value) {
2505
2546
  try {
2506
2547
  ref.current = value;
2507
2548
  }
2508
- catch (error) {
2549
+ catch (_a) {
2509
2550
  throw new Error("Cannot assign value \"".concat(value, "\" to ref \"").concat(ref, "\""));
2510
2551
  }
2511
2552
  }
@@ -2677,7 +2718,10 @@ var textColorsPropType = PropTypes.oneOfType([
2677
2718
  PropTypes.oneOf(['white', 'muted']),
2678
2719
  PropTypes.string,
2679
2720
  ]);
2680
- var triggerPropType = PropTypes.oneOf(['hover', 'focus', 'click']);
2721
+ var triggerPropType = PropTypes.oneOfType([
2722
+ PropTypes.arrayOf(PropTypes.oneOf(['hover', 'focus', 'click']).isRequired),
2723
+ PropTypes.oneOf(['hover', 'focus', 'click']),
2724
+ ]);
2681
2725
 
2682
2726
  var CAlert = forwardRef(function (_a, ref) {
2683
2727
  var children = _a.children, className = _a.className, _b = _a.color, color = _b === void 0 ? 'primary' : _b, dismissible = _a.dismissible, variant = _a.variant, _c = _a.visible, visible = _c === void 0 ? true : _c, onClose = _a.onClose, rest = __rest(_a, ["children", "className", "color", "dismissible", "variant", "visible", "onClose"]);
@@ -3022,7 +3066,7 @@ var isInViewport = function (element) {
3022
3066
  };
3023
3067
 
3024
3068
  var isRTL = function (element) {
3025
- if (document.documentElement.dir === 'rtl') {
3069
+ if (typeof document !== 'undefined' && document.documentElement.dir === 'rtl') {
3026
3070
  return true;
3027
3071
  }
3028
3072
  if (element) {
@@ -3807,17 +3851,7 @@ function effect$1(_ref2) {
3807
3851
  }
3808
3852
  }
3809
3853
 
3810
- if (process.env.NODE_ENV !== "production") {
3811
- if (!isHTMLElement(arrowElement)) {
3812
- console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));
3813
- }
3814
- }
3815
-
3816
3854
  if (!contains(state.elements.popper, arrowElement)) {
3817
- if (process.env.NODE_ENV !== "production") {
3818
- console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', 'element.'].join(' '));
3819
- }
3820
-
3821
3855
  return;
3822
3856
  }
3823
3857
 
@@ -3959,17 +3993,6 @@ function computeStyles(_ref5) {
3959
3993
  adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
3960
3994
  _options$roundOffsets = options.roundOffsets,
3961
3995
  roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
3962
-
3963
- if (process.env.NODE_ENV !== "production") {
3964
- var transitionProperty = getComputedStyle$1(state.elements.popper).transitionProperty || '';
3965
-
3966
- if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {
3967
- return transitionProperty.indexOf(property) >= 0;
3968
- })) {
3969
- console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: "transform", "top", "right", "bottom", "left".', '\n\n', 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\n\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));
3970
- }
3971
- }
3972
-
3973
3996
  var commonStyles = {
3974
3997
  placement: getBasePlacement(state.placement),
3975
3998
  variation: getVariation(state.placement),
@@ -4410,10 +4433,6 @@ function computeAutoPlacement(state, options) {
4410
4433
 
4411
4434
  if (allowedPlacements.length === 0) {
4412
4435
  allowedPlacements = placements$1;
4413
-
4414
- if (process.env.NODE_ENV !== "production") {
4415
- console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(' '));
4416
- }
4417
4436
  } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
4418
4437
 
4419
4438
 
@@ -4965,108 +4984,6 @@ function debounce(fn) {
4965
4984
  };
4966
4985
  }
4967
4986
 
4968
- function format(str) {
4969
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
4970
- args[_key - 1] = arguments[_key];
4971
- }
4972
-
4973
- return [].concat(args).reduce(function (p, c) {
4974
- return p.replace(/%s/, c);
4975
- }, str);
4976
- }
4977
-
4978
- var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';
4979
- var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available';
4980
- var VALID_PROPERTIES = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options'];
4981
- function validateModifiers(modifiers) {
4982
- modifiers.forEach(function (modifier) {
4983
- [].concat(Object.keys(modifier), VALID_PROPERTIES) // IE11-compatible replacement for `new Set(iterable)`
4984
- .filter(function (value, index, self) {
4985
- return self.indexOf(value) === index;
4986
- }).forEach(function (key) {
4987
- switch (key) {
4988
- case 'name':
4989
- if (typeof modifier.name !== 'string') {
4990
- console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', "\"" + String(modifier.name) + "\""));
4991
- }
4992
-
4993
- break;
4994
-
4995
- case 'enabled':
4996
- if (typeof modifier.enabled !== 'boolean') {
4997
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', "\"" + String(modifier.enabled) + "\""));
4998
- }
4999
-
5000
- break;
5001
-
5002
- case 'phase':
5003
- if (modifierPhases.indexOf(modifier.phase) < 0) {
5004
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(', '), "\"" + String(modifier.phase) + "\""));
5005
- }
5006
-
5007
- break;
5008
-
5009
- case 'fn':
5010
- if (typeof modifier.fn !== 'function') {
5011
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', "\"" + String(modifier.fn) + "\""));
5012
- }
5013
-
5014
- break;
5015
-
5016
- case 'effect':
5017
- if (modifier.effect != null && typeof modifier.effect !== 'function') {
5018
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', "\"" + String(modifier.fn) + "\""));
5019
- }
5020
-
5021
- break;
5022
-
5023
- case 'requires':
5024
- if (modifier.requires != null && !Array.isArray(modifier.requires)) {
5025
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', "\"" + String(modifier.requires) + "\""));
5026
- }
5027
-
5028
- break;
5029
-
5030
- case 'requiresIfExists':
5031
- if (!Array.isArray(modifier.requiresIfExists)) {
5032
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', "\"" + String(modifier.requiresIfExists) + "\""));
5033
- }
5034
-
5035
- break;
5036
-
5037
- case 'options':
5038
- case 'data':
5039
- break;
5040
-
5041
- default:
5042
- console.error("PopperJS: an invalid property has been provided to the \"" + modifier.name + "\" modifier, valid properties are " + VALID_PROPERTIES.map(function (s) {
5043
- return "\"" + s + "\"";
5044
- }).join(', ') + "; but \"" + key + "\" was provided.");
5045
- }
5046
-
5047
- modifier.requires && modifier.requires.forEach(function (requirement) {
5048
- if (modifiers.find(function (mod) {
5049
- return mod.name === requirement;
5050
- }) == null) {
5051
- console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement));
5052
- }
5053
- });
5054
- });
5055
- });
5056
- }
5057
-
5058
- function uniqueBy(arr, fn) {
5059
- var identifiers = new Set();
5060
- return arr.filter(function (item) {
5061
- var identifier = fn(item);
5062
-
5063
- if (!identifiers.has(identifier)) {
5064
- identifiers.add(identifier);
5065
- return true;
5066
- }
5067
- });
5068
- }
5069
-
5070
4987
  function mergeByName(modifiers) {
5071
4988
  var merged = modifiers.reduce(function (merged, current) {
5072
4989
  var existing = merged[current.name];
@@ -5082,8 +4999,6 @@ function mergeByName(modifiers) {
5082
4999
  });
5083
5000
  }
5084
5001
 
5085
- var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';
5086
- var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';
5087
5002
  var DEFAULT_OPTIONS = {
5088
5003
  placement: 'bottom',
5089
5004
  modifiers: [],
@@ -5145,42 +5060,7 @@ function popperGenerator(generatorOptions) {
5145
5060
 
5146
5061
  state.orderedModifiers = orderedModifiers.filter(function (m) {
5147
5062
  return m.enabled;
5148
- }); // Validate the provided modifiers so that the consumer will get warned
5149
- // if one of the modifiers is invalid for any reason
5150
-
5151
- if (process.env.NODE_ENV !== "production") {
5152
- var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {
5153
- var name = _ref.name;
5154
- return name;
5155
- });
5156
- validateModifiers(modifiers);
5157
-
5158
- if (getBasePlacement(state.options.placement) === auto) {
5159
- var flipModifier = state.orderedModifiers.find(function (_ref2) {
5160
- var name = _ref2.name;
5161
- return name === 'flip';
5162
- });
5163
-
5164
- if (!flipModifier) {
5165
- console.error(['Popper: "auto" placements require the "flip" modifier be', 'present and enabled to work.'].join(' '));
5166
- }
5167
- }
5168
-
5169
- var _getComputedStyle = getComputedStyle$1(popper),
5170
- marginTop = _getComputedStyle.marginTop,
5171
- marginRight = _getComputedStyle.marginRight,
5172
- marginBottom = _getComputedStyle.marginBottom,
5173
- marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can
5174
- // cause bugs with positioning, so we'll warn the consumer
5175
-
5176
-
5177
- if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {
5178
- return parseFloat(margin);
5179
- })) {
5180
- console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));
5181
- }
5182
- }
5183
-
5063
+ });
5184
5064
  runModifierEffects();
5185
5065
  return instance.update();
5186
5066
  },
@@ -5200,10 +5080,6 @@ function popperGenerator(generatorOptions) {
5200
5080
  // anymore
5201
5081
 
5202
5082
  if (!areValidElements(reference, popper)) {
5203
- if (process.env.NODE_ENV !== "production") {
5204
- console.error(INVALID_ELEMENT_ERROR);
5205
- }
5206
-
5207
5083
  return;
5208
5084
  } // Store the reference and popper rects to be read by modifiers
5209
5085
 
@@ -5226,18 +5102,8 @@ function popperGenerator(generatorOptions) {
5226
5102
  state.orderedModifiers.forEach(function (modifier) {
5227
5103
  return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
5228
5104
  });
5229
- var __debug_loops__ = 0;
5230
5105
 
5231
5106
  for (var index = 0; index < state.orderedModifiers.length; index++) {
5232
- if (process.env.NODE_ENV !== "production") {
5233
- __debug_loops__ += 1;
5234
-
5235
- if (__debug_loops__ > 100) {
5236
- console.error(INFINITE_LOOP_ERROR);
5237
- break;
5238
- }
5239
- }
5240
-
5241
5107
  if (state.reset === true) {
5242
5108
  state.reset = false;
5243
5109
  index = -1;
@@ -5275,10 +5141,6 @@ function popperGenerator(generatorOptions) {
5275
5141
  };
5276
5142
 
5277
5143
  if (!areValidElements(reference, popper)) {
5278
- if (process.env.NODE_ENV !== "production") {
5279
- console.error(INVALID_ELEMENT_ERROR);
5280
- }
5281
-
5282
5144
  return instance;
5283
5145
  }
5284
5146
 
@@ -5293,11 +5155,11 @@ function popperGenerator(generatorOptions) {
5293
5155
  // one.
5294
5156
 
5295
5157
  function runModifierEffects() {
5296
- state.orderedModifiers.forEach(function (_ref3) {
5297
- var name = _ref3.name,
5298
- _ref3$options = _ref3.options,
5299
- options = _ref3$options === void 0 ? {} : _ref3$options,
5300
- effect = _ref3.effect;
5158
+ state.orderedModifiers.forEach(function (_ref) {
5159
+ var name = _ref.name,
5160
+ _ref$options = _ref.options,
5161
+ options = _ref$options === void 0 ? {} : _ref$options,
5162
+ effect = _ref.effect;
5301
5163
 
5302
5164
  if (typeof effect === 'function') {
5303
5165
  var cleanupFn = effect({
@@ -6179,7 +6041,8 @@ var CFormSelect = forwardRef(function (_a, ref) {
6179
6041
  _b), className), size: htmlSize }, rest, { ref: ref }), options
6180
6042
  ? options.map(function (option, index) {
6181
6043
  return (React__default.createElement("option", __assign({}, (typeof option === 'object' &&
6182
- option.disabled && { disabled: option.disabled }), (typeof option === 'object' && option.value && { value: option.value }), { key: index }), typeof option === 'string' ? option : option.label));
6044
+ option.disabled && { disabled: option.disabled }), (typeof option === 'object' &&
6045
+ option.value !== undefined && { value: option.value }), { key: index }), typeof option === 'string' ? option : option.label));
6183
6046
  })
6184
6047
  : children)));
6185
6048
  });
@@ -6607,6 +6470,7 @@ var CModal = forwardRef(function (_a, ref) {
6607
6470
  if (backdrop === 'static') {
6608
6471
  return setStaticBackdrop(true);
6609
6472
  }
6473
+ setVisible(false);
6610
6474
  return onClose && onClose();
6611
6475
  };
6612
6476
  useLayoutEffect(function () {
@@ -7153,6 +7017,7 @@ CProgressBar.propTypes = {
7153
7017
  };
7154
7018
  CProgressBar.displayName = 'CProgressBar';
7155
7019
 
7020
+ // TODO: update markup and add '.progress-stacked' in v5
7156
7021
  var CProgress = forwardRef(function (_a, ref) {
7157
7022
  var children = _a.children, className = _a.className, height = _a.height, thin = _a.thin, _b = _a.value, value = _b === void 0 ? 0 : _b, white = _a.white, rest = __rest(_a, ["children", "className", "height", "thin", "value", "white"]);
7158
7023
  return (React__default.createElement("div", { className: classNames('progress', {
@@ -7171,7 +7036,6 @@ CProgress.propTypes = {
7171
7036
  CProgress.displayName = 'CProgress';
7172
7037
 
7173
7038
  var getPlacement$1 = function (placement, element) {
7174
- console.log(element);
7175
7039
  switch (placement) {
7176
7040
  case 'right': {
7177
7041
  return isRTL(element) ? 'left' : 'right';
@@ -7286,7 +7150,7 @@ var CSidebar = forwardRef(function (_a, ref) {
7286
7150
  var _a, _b;
7287
7151
  sidebarRef.current && setMobile(isOnMobile(sidebarRef.current));
7288
7152
  sidebarRef.current && setInViewport(isInViewport(sidebarRef.current));
7289
- window.addEventListener('resize', function () { return handleResize(); });
7153
+ window.addEventListener('resize', handleResize);
7290
7154
  window.addEventListener('mouseup', handleClickOutside);
7291
7155
  window.addEventListener('keyup', handleKeyup);
7292
7156
  (_a = sidebarRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('mouseup', handleOnClick);
@@ -7295,7 +7159,7 @@ var CSidebar = forwardRef(function (_a, ref) {
7295
7159
  });
7296
7160
  return function () {
7297
7161
  var _a, _b;
7298
- window.removeEventListener('resize', function () { return handleResize(); });
7162
+ window.removeEventListener('resize', handleResize);
7299
7163
  window.removeEventListener('mouseup', handleClickOutside);
7300
7164
  window.removeEventListener('keyup', handleKeyup);
7301
7165
  (_a = sidebarRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('mouseup', handleOnClick);
@@ -7404,8 +7268,12 @@ CSidebarHeader.propTypes = {
7404
7268
  CSidebarHeader.displayName = 'CSidebarHeader';
7405
7269
 
7406
7270
  var CSpinner = forwardRef(function (_a, ref) {
7407
- var className = _a.className, color = _a.color, _b = _a.component, Component = _b === void 0 ? 'div' : _b, size = _a.size, _c = _a.variant, variant = _c === void 0 ? 'border' : _c, _d = _a.visuallyHiddenLabel, visuallyHiddenLabel = _d === void 0 ? 'Loading...' : _d, rest = __rest(_a, ["className", "color", "component", "size", "variant", "visuallyHiddenLabel"]);
7408
- return (React__default.createElement(Component, __assign({ className: classNames("spinner-".concat(variant), "text-".concat(color), size && "spinner-".concat(variant, "-").concat(size), className), role: "status" }, rest, { ref: ref }),
7271
+ var _b;
7272
+ var className = _a.className, color = _a.color, _c = _a.component, Component = _c === void 0 ? 'div' : _c, size = _a.size, _d = _a.variant, variant = _d === void 0 ? 'border' : _d, _e = _a.visuallyHiddenLabel, visuallyHiddenLabel = _e === void 0 ? 'Loading...' : _e, rest = __rest(_a, ["className", "color", "component", "size", "variant", "visuallyHiddenLabel"]);
7273
+ return (React__default.createElement(Component, __assign({ className: classNames("spinner-".concat(variant), (_b = {},
7274
+ _b["spinner-".concat(variant, "-").concat(size)] = size,
7275
+ _b["text-".concat(color)] = color,
7276
+ _b), className), role: "status" }, rest, { ref: ref }),
7409
7277
  React__default.createElement("span", { className: "visually-hidden" }, visuallyHiddenLabel)));
7410
7278
  });
7411
7279
  CSpinner.propTypes = {
@@ -7576,7 +7444,8 @@ var CTable = forwardRef(function (_a, ref) {
7576
7444
  React__default.createElement(CTableRow, null, columns.map(function (column, index) { return (React__default.createElement(CTableHeaderCell, __assign({}, (column._props && __assign({}, column._props)), (column._style && { style: __assign({}, column._style) }), { key: index }), getColumnLabel(column))); })))),
7577
7445
  items && (React__default.createElement(CTableBody, null, items.map(function (item, index) { return (React__default.createElement(CTableRow, __assign({}, (item._props && __assign({}, item._props)), { key: index }), columnNames &&
7578
7446
  columnNames.map(function (colName, index) {
7579
- return item[colName] ? (React__default.createElement(CTableDataCell, __assign({}, (item._cellProps && __assign(__assign({}, (item._cellProps['all'] && __assign({}, item._cellProps['all']))), (item._cellProps[colName] && __assign({}, item._cellProps[colName])))), { key: index }), item[colName])) : null;
7447
+ // eslint-disable-next-line unicorn/no-negated-condition
7448
+ return item[colName] !== undefined ? (React__default.createElement(CTableDataCell, __assign({}, (item._cellProps && __assign(__assign({}, (item._cellProps['all'] && __assign({}, item._cellProps['all']))), (item._cellProps[colName] && __assign({}, item._cellProps[colName])))), { key: index }), item[colName])) : null;
7580
7449
  }))); }))),
7581
7450
  children,
7582
7451
  footer && (React__default.createElement(CTableFoot, __assign({}, tableFootProps),
@@ -7775,7 +7644,6 @@ CToaster.propTypes = {
7775
7644
  CToaster.displayName = 'CToaster';
7776
7645
 
7777
7646
  var getPlacement = function (placement, element) {
7778
- console.log(element);
7779
7647
  switch (placement) {
7780
7648
  case 'right': {
7781
7649
  return isRTL(element) ? 'left' : 'right';
@@ -7986,5 +7854,5 @@ CWidgetStatsF.propTypes = {
7986
7854
  };
7987
7855
  CWidgetStatsF.displayName = 'CWidgetStatsF';
7988
7856
 
7989
- export { CAccordion, CAccordionBody, CAccordionButton, CAccordionHeader, CAccordionItem, CAlert, CAlertHeading, CAlertLink, CAvatar, CBackdrop, CBadge, CBreadcrumb, CBreadcrumbItem, CButton, CButtonGroup, CButtonToolbar, CCallout, CCard, CCardBody, CCardFooter, CCardGroup, CCardHeader, CCardImage, CCardImageOverlay, CCardLink, CCardSubtitle, CCardText, CCardTitle, CCarousel, CCarouselCaption, CCarouselItem, CCloseButton, CCol, CCollapse, CConditionalPortal, CContainer, CDropdown, CDropdownDivider, CDropdownHeader, CDropdownItem, CDropdownItemPlain, CDropdownMenu, CDropdownToggle, CFooter, CForm, CFormCheck, CFormControlValidation, CFormControlWrapper, CFormFeedback, CFormFloating, CFormInput, CFormLabel, CFormRange, CFormSelect, CFormSwitch, CFormText, CFormTextarea, CHeader, CHeaderBrand, CHeaderDivider, CHeaderNav, CHeaderText, CHeaderToggler, CImage, CInputGroup, CInputGroupText, CLink, CListGroup, CListGroupItem, CModal, CModalBody, CModalContent, CModalDialog, CModalFooter, CModalHeader, CModalTitle, CNav, CNavGroup, CNavGroupItems, CNavItem, CNavLink, CNavTitle, CNavbar, CNavbarBrand, CNavbarNav, CNavbarText, CNavbarToggler, COffcanvas, COffcanvasBody, COffcanvasHeader, COffcanvasTitle, CPagination, CPaginationItem, CPlaceholder, CPopover, CProgress, CProgressBar, CRow, CSidebar, CSidebarBrand, CSidebarFooter, CSidebarHeader, CSidebarNav, CSidebarToggler, CSpinner, CTabContent, CTabPane, CTable, CTableBody, CTableCaption, CTableDataCell, CTableFoot, CTableHead, CTableHeaderCell, CTableRow, CToast, CToastBody, CToastClose, CToastHeader, CToaster, CTooltip, CWidgetStatsA, CWidgetStatsB, CWidgetStatsC, CWidgetStatsD, CWidgetStatsE, CWidgetStatsF };
7857
+ export { CAccordion, CAccordionBody, CAccordionButton, CAccordionHeader, CAccordionItem, CAlert, CAlertHeading, CAlertLink, CAvatar, CBackdrop, CBadge, CBreadcrumb, CBreadcrumbItem, CButton, CButtonGroup, CButtonToolbar, CCallout, CCard, CCardBody, CCardFooter, CCardGroup, CCardHeader, CCardImage, CCardImageOverlay, CCardLink, CCardSubtitle, CCardText, CCardTitle, CCarousel, CCarouselCaption, CCarouselItem, CCloseButton, CCol, CCollapse, CConditionalPortal, CContainer, CDropdown, CDropdownDivider, CDropdownHeader, CDropdownItem, CDropdownItemPlain, CDropdownMenu, CDropdownToggle, CFooter, CForm, CFormCheck, CFormControlValidation, CFormControlWrapper, CFormFeedback, CFormFloating, CFormInput, CFormLabel, CFormRange, CFormSelect, CFormSwitch, CFormText, CFormTextarea, CHeader, CHeaderBrand, CHeaderDivider, CHeaderNav, CHeaderText, CHeaderToggler, CImage, CInputGroup, CInputGroupText, CLink, CListGroup, CListGroupItem, CModal, CModalBody, CModalContent, CModalDialog, CModalFooter, CModalHeader, CModalTitle, CNav, CNavGroup, CNavGroupItems, CNavItem, CNavLink, CNavTitle, CNavbar, CNavbarBrand, CNavbarNav, CNavbarText, CNavbarToggler, COffcanvas, COffcanvasBody, COffcanvasHeader, COffcanvasTitle, CPagination, CPaginationItem, CPlaceholder, CPopover, CProgress, CProgressBar, CRow, CSidebar, CSidebarBrand, CSidebarFooter, CSidebarHeader, CSidebarNav, CSidebarToggler, CSpinner, CTabContent, CTabPane, CTable, CTableBody, CTableCaption, CTableDataCell, CTableFoot, CTableHead, CTableHeaderCell, CTableRow, CToast, CToastBody, CToastClose, CToastHeader, CToaster, CTooltip, CWidgetStatsA, CWidgetStatsB, CWidgetStatsC, CWidgetStatsD, CWidgetStatsE, CWidgetStatsF, useColorModes, useForkedRef };
7990
7858
  //# sourceMappingURL=index.es.js.map