@coreui/react 4.9.0-alpha.1 → 4.9.0-beta.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.
- package/README.md +1 -1
- package/dist/components/accordion/index.d.ts +1 -1
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/useColorModes.d.ts +6 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +67 -200
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +68 -199
- package/dist/index.js.map +1 -1
- package/dist/props.d.ts +1 -1
- package/package.json +9 -9
- package/src/components/accordion/index.ts +1 -7
- package/src/components/form/CFormSelect.tsx +3 -1
- package/src/components/modal/CModal.tsx +2 -0
- package/src/components/popover/CPopover.tsx +0 -1
- package/src/components/popover/__tests__/__snapshots__/CPopover.spec.tsx.snap +2 -1
- package/src/components/progress/CProgress.tsx +1 -0
- package/src/components/sidebar/CSidebar.tsx +2 -2
- package/src/components/spinner/CSpinner.tsx +4 -2
- package/src/components/spinner/__tests__/__snapshots__/CSpinner.spec.tsx.snap +2 -2
- package/src/components/table/CTable.tsx +2 -1
- package/src/components/tooltip/CTooltip.tsx +0 -1
- package/src/components/tooltip/__tests__/CTooltip.spec.tsx +1 -1
- package/src/hooks/index.ts +2 -1
- package/src/hooks/useColorModes.ts +55 -0
- package/src/hooks/useForkedRef.ts +1 -1
- package/src/index.ts +1 -0
- package/src/props.ts +4 -1
- package/src/utils/isRTL.ts +1 -1
- package/src/components/accordion/__tests__/__snapshots__/CAccordionCollapse.spec.tsx.snap +0 -11
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-
|
|
49
|
+
- [Download the latest release](https://github.com/coreui/coreui-react/archive/v4.9.0-beta.0.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 };
|
package/dist/hooks/index.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.es.js
CHANGED
|
@@ -2472,6 +2472,46 @@ 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
|
+
setColorMode: function (mode) { return setColorMode(mode); },
|
|
2512
|
+
};
|
|
2513
|
+
};
|
|
2514
|
+
|
|
2475
2515
|
// code borrowed from https://github.com/reach/reach-ui
|
|
2476
2516
|
// problem described https://github.com/facebook/react/issues/13029
|
|
2477
2517
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -2505,7 +2545,7 @@ value) {
|
|
|
2505
2545
|
try {
|
|
2506
2546
|
ref.current = value;
|
|
2507
2547
|
}
|
|
2508
|
-
catch (
|
|
2548
|
+
catch (_a) {
|
|
2509
2549
|
throw new Error("Cannot assign value \"".concat(value, "\" to ref \"").concat(ref, "\""));
|
|
2510
2550
|
}
|
|
2511
2551
|
}
|
|
@@ -2677,7 +2717,10 @@ var textColorsPropType = PropTypes.oneOfType([
|
|
|
2677
2717
|
PropTypes.oneOf(['white', 'muted']),
|
|
2678
2718
|
PropTypes.string,
|
|
2679
2719
|
]);
|
|
2680
|
-
var triggerPropType = PropTypes.
|
|
2720
|
+
var triggerPropType = PropTypes.oneOfType([
|
|
2721
|
+
PropTypes.arrayOf(PropTypes.oneOf(['hover', 'focus', 'click']).isRequired),
|
|
2722
|
+
PropTypes.oneOf(['hover', 'focus', 'click']),
|
|
2723
|
+
]);
|
|
2681
2724
|
|
|
2682
2725
|
var CAlert = forwardRef(function (_a, ref) {
|
|
2683
2726
|
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 +3065,7 @@ var isInViewport = function (element) {
|
|
|
3022
3065
|
};
|
|
3023
3066
|
|
|
3024
3067
|
var isRTL = function (element) {
|
|
3025
|
-
if (document.documentElement.dir === 'rtl') {
|
|
3068
|
+
if (typeof document !== 'undefined' && document.documentElement.dir === 'rtl') {
|
|
3026
3069
|
return true;
|
|
3027
3070
|
}
|
|
3028
3071
|
if (element) {
|
|
@@ -3807,17 +3850,7 @@ function effect$1(_ref2) {
|
|
|
3807
3850
|
}
|
|
3808
3851
|
}
|
|
3809
3852
|
|
|
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
3853
|
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
3854
|
return;
|
|
3822
3855
|
}
|
|
3823
3856
|
|
|
@@ -3959,17 +3992,6 @@ function computeStyles(_ref5) {
|
|
|
3959
3992
|
adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
|
|
3960
3993
|
_options$roundOffsets = options.roundOffsets,
|
|
3961
3994
|
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
3995
|
var commonStyles = {
|
|
3974
3996
|
placement: getBasePlacement(state.placement),
|
|
3975
3997
|
variation: getVariation(state.placement),
|
|
@@ -4410,10 +4432,6 @@ function computeAutoPlacement(state, options) {
|
|
|
4410
4432
|
|
|
4411
4433
|
if (allowedPlacements.length === 0) {
|
|
4412
4434
|
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
4435
|
} // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
|
|
4418
4436
|
|
|
4419
4437
|
|
|
@@ -4965,108 +4983,6 @@ function debounce(fn) {
|
|
|
4965
4983
|
};
|
|
4966
4984
|
}
|
|
4967
4985
|
|
|
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
4986
|
function mergeByName(modifiers) {
|
|
5071
4987
|
var merged = modifiers.reduce(function (merged, current) {
|
|
5072
4988
|
var existing = merged[current.name];
|
|
@@ -5082,8 +4998,6 @@ function mergeByName(modifiers) {
|
|
|
5082
4998
|
});
|
|
5083
4999
|
}
|
|
5084
5000
|
|
|
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
5001
|
var DEFAULT_OPTIONS = {
|
|
5088
5002
|
placement: 'bottom',
|
|
5089
5003
|
modifiers: [],
|
|
@@ -5145,42 +5059,7 @@ function popperGenerator(generatorOptions) {
|
|
|
5145
5059
|
|
|
5146
5060
|
state.orderedModifiers = orderedModifiers.filter(function (m) {
|
|
5147
5061
|
return m.enabled;
|
|
5148
|
-
});
|
|
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
|
-
|
|
5062
|
+
});
|
|
5184
5063
|
runModifierEffects();
|
|
5185
5064
|
return instance.update();
|
|
5186
5065
|
},
|
|
@@ -5200,10 +5079,6 @@ function popperGenerator(generatorOptions) {
|
|
|
5200
5079
|
// anymore
|
|
5201
5080
|
|
|
5202
5081
|
if (!areValidElements(reference, popper)) {
|
|
5203
|
-
if (process.env.NODE_ENV !== "production") {
|
|
5204
|
-
console.error(INVALID_ELEMENT_ERROR);
|
|
5205
|
-
}
|
|
5206
|
-
|
|
5207
5082
|
return;
|
|
5208
5083
|
} // Store the reference and popper rects to be read by modifiers
|
|
5209
5084
|
|
|
@@ -5226,18 +5101,8 @@ function popperGenerator(generatorOptions) {
|
|
|
5226
5101
|
state.orderedModifiers.forEach(function (modifier) {
|
|
5227
5102
|
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
|
5228
5103
|
});
|
|
5229
|
-
var __debug_loops__ = 0;
|
|
5230
5104
|
|
|
5231
5105
|
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
5106
|
if (state.reset === true) {
|
|
5242
5107
|
state.reset = false;
|
|
5243
5108
|
index = -1;
|
|
@@ -5275,10 +5140,6 @@ function popperGenerator(generatorOptions) {
|
|
|
5275
5140
|
};
|
|
5276
5141
|
|
|
5277
5142
|
if (!areValidElements(reference, popper)) {
|
|
5278
|
-
if (process.env.NODE_ENV !== "production") {
|
|
5279
|
-
console.error(INVALID_ELEMENT_ERROR);
|
|
5280
|
-
}
|
|
5281
|
-
|
|
5282
5143
|
return instance;
|
|
5283
5144
|
}
|
|
5284
5145
|
|
|
@@ -5293,11 +5154,11 @@ function popperGenerator(generatorOptions) {
|
|
|
5293
5154
|
// one.
|
|
5294
5155
|
|
|
5295
5156
|
function runModifierEffects() {
|
|
5296
|
-
state.orderedModifiers.forEach(function (
|
|
5297
|
-
var name =
|
|
5298
|
-
|
|
5299
|
-
options =
|
|
5300
|
-
effect =
|
|
5157
|
+
state.orderedModifiers.forEach(function (_ref) {
|
|
5158
|
+
var name = _ref.name,
|
|
5159
|
+
_ref$options = _ref.options,
|
|
5160
|
+
options = _ref$options === void 0 ? {} : _ref$options,
|
|
5161
|
+
effect = _ref.effect;
|
|
5301
5162
|
|
|
5302
5163
|
if (typeof effect === 'function') {
|
|
5303
5164
|
var cleanupFn = effect({
|
|
@@ -6179,7 +6040,8 @@ var CFormSelect = forwardRef(function (_a, ref) {
|
|
|
6179
6040
|
_b), className), size: htmlSize }, rest, { ref: ref }), options
|
|
6180
6041
|
? options.map(function (option, index) {
|
|
6181
6042
|
return (React__default.createElement("option", __assign({}, (typeof option === 'object' &&
|
|
6182
|
-
option.disabled && { disabled: option.disabled }), (typeof option === 'object' &&
|
|
6043
|
+
option.disabled && { disabled: option.disabled }), (typeof option === 'object' &&
|
|
6044
|
+
option.value !== undefined && { value: option.value }), { key: index }), typeof option === 'string' ? option : option.label));
|
|
6183
6045
|
})
|
|
6184
6046
|
: children)));
|
|
6185
6047
|
});
|
|
@@ -6607,6 +6469,7 @@ var CModal = forwardRef(function (_a, ref) {
|
|
|
6607
6469
|
if (backdrop === 'static') {
|
|
6608
6470
|
return setStaticBackdrop(true);
|
|
6609
6471
|
}
|
|
6472
|
+
setVisible(false);
|
|
6610
6473
|
return onClose && onClose();
|
|
6611
6474
|
};
|
|
6612
6475
|
useLayoutEffect(function () {
|
|
@@ -7153,6 +7016,7 @@ CProgressBar.propTypes = {
|
|
|
7153
7016
|
};
|
|
7154
7017
|
CProgressBar.displayName = 'CProgressBar';
|
|
7155
7018
|
|
|
7019
|
+
// TODO: update markup and add '.progress-stacked' in v5
|
|
7156
7020
|
var CProgress = forwardRef(function (_a, ref) {
|
|
7157
7021
|
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
7022
|
return (React__default.createElement("div", { className: classNames('progress', {
|
|
@@ -7171,7 +7035,6 @@ CProgress.propTypes = {
|
|
|
7171
7035
|
CProgress.displayName = 'CProgress';
|
|
7172
7036
|
|
|
7173
7037
|
var getPlacement$1 = function (placement, element) {
|
|
7174
|
-
console.log(element);
|
|
7175
7038
|
switch (placement) {
|
|
7176
7039
|
case 'right': {
|
|
7177
7040
|
return isRTL(element) ? 'left' : 'right';
|
|
@@ -7286,7 +7149,7 @@ var CSidebar = forwardRef(function (_a, ref) {
|
|
|
7286
7149
|
var _a, _b;
|
|
7287
7150
|
sidebarRef.current && setMobile(isOnMobile(sidebarRef.current));
|
|
7288
7151
|
sidebarRef.current && setInViewport(isInViewport(sidebarRef.current));
|
|
7289
|
-
window.addEventListener('resize',
|
|
7152
|
+
window.addEventListener('resize', handleResize);
|
|
7290
7153
|
window.addEventListener('mouseup', handleClickOutside);
|
|
7291
7154
|
window.addEventListener('keyup', handleKeyup);
|
|
7292
7155
|
(_a = sidebarRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('mouseup', handleOnClick);
|
|
@@ -7295,7 +7158,7 @@ var CSidebar = forwardRef(function (_a, ref) {
|
|
|
7295
7158
|
});
|
|
7296
7159
|
return function () {
|
|
7297
7160
|
var _a, _b;
|
|
7298
|
-
window.removeEventListener('resize',
|
|
7161
|
+
window.removeEventListener('resize', handleResize);
|
|
7299
7162
|
window.removeEventListener('mouseup', handleClickOutside);
|
|
7300
7163
|
window.removeEventListener('keyup', handleKeyup);
|
|
7301
7164
|
(_a = sidebarRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('mouseup', handleOnClick);
|
|
@@ -7404,8 +7267,12 @@ CSidebarHeader.propTypes = {
|
|
|
7404
7267
|
CSidebarHeader.displayName = 'CSidebarHeader';
|
|
7405
7268
|
|
|
7406
7269
|
var CSpinner = forwardRef(function (_a, ref) {
|
|
7407
|
-
var
|
|
7408
|
-
|
|
7270
|
+
var _b;
|
|
7271
|
+
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"]);
|
|
7272
|
+
return (React__default.createElement(Component, __assign({ className: classNames("spinner-".concat(variant), (_b = {},
|
|
7273
|
+
_b["spinner-".concat(variant, "-").concat(size)] = size,
|
|
7274
|
+
_b["text-".concat(color)] = color,
|
|
7275
|
+
_b), className), role: "status" }, rest, { ref: ref }),
|
|
7409
7276
|
React__default.createElement("span", { className: "visually-hidden" }, visuallyHiddenLabel)));
|
|
7410
7277
|
});
|
|
7411
7278
|
CSpinner.propTypes = {
|
|
@@ -7576,7 +7443,8 @@ var CTable = forwardRef(function (_a, ref) {
|
|
|
7576
7443
|
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
7444
|
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
7445
|
columnNames.map(function (colName, index) {
|
|
7579
|
-
|
|
7446
|
+
// eslint-disable-next-line unicorn/no-negated-condition
|
|
7447
|
+
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
7448
|
}))); }))),
|
|
7581
7449
|
children,
|
|
7582
7450
|
footer && (React__default.createElement(CTableFoot, __assign({}, tableFootProps),
|
|
@@ -7775,7 +7643,6 @@ CToaster.propTypes = {
|
|
|
7775
7643
|
CToaster.displayName = 'CToaster';
|
|
7776
7644
|
|
|
7777
7645
|
var getPlacement = function (placement, element) {
|
|
7778
|
-
console.log(element);
|
|
7779
7646
|
switch (placement) {
|
|
7780
7647
|
case 'right': {
|
|
7781
7648
|
return isRTL(element) ? 'left' : 'right';
|
|
@@ -7986,5 +7853,5 @@ CWidgetStatsF.propTypes = {
|
|
|
7986
7853
|
};
|
|
7987
7854
|
CWidgetStatsF.displayName = 'CWidgetStatsF';
|
|
7988
7855
|
|
|
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 };
|
|
7856
|
+
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
7857
|
//# sourceMappingURL=index.es.js.map
|