@coreui/react-pro 5.0.0-alpha.1 → 5.0.0-alpha.3
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/avatar/CAvatar.d.ts +1 -1
- package/dist/components/badge/CBadge.d.ts +1 -1
- package/dist/components/card/CCard.d.ts +1 -1
- package/dist/components/dropdown/CDropdown.d.ts +1 -0
- package/dist/components/dropdown/CDropdownToggle.d.ts +6 -0
- package/dist/components/smart-table/CSmartTableHead.d.ts +1 -1
- package/dist/index.es.js +84 -33
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +84 -33
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/avatar/CAvatar.tsx +1 -1
- package/src/components/badge/CBadge.tsx +1 -1
- package/src/components/button/CButton.tsx +1 -1
- package/src/components/button/__tests__/__snapshots__/CButton.spec.tsx.snap +0 -1
- package/src/components/card/CCard.tsx +1 -1
- package/src/components/carousel/__tests__/__snapshots__/CCarousel.spec.tsx.snap +9 -5
- package/src/components/dropdown/CDropdown.tsx +43 -1
- package/src/components/dropdown/CDropdownToggle.tsx +12 -5
- package/src/components/nav/__tests__/__snapshots__/CNav.spec.tsx.snap +5 -4
- package/src/components/navbar/__tests__/CNavbar.spec.tsx +1 -1
- package/src/components/navbar/__tests__/__snapshots__/CNavbar.spec.tsx.snap +2 -1
- package/src/components/progress/__tests__/__snapshots__/CProgress.spec.tsx.snap +10 -5
- package/src/components/progress/__tests__/__snapshots__/CProgressBar.spec.tsx.snap +0 -8
- package/src/components/smart-table/CSmartTable.tsx +11 -5
- package/src/components/smart-table/CSmartTableHead.tsx +31 -11
- package/src/components/widgets/CWidgetStatsA.tsx +1 -1
- package/src/components/widgets/CWidgetStatsB.tsx +2 -2
- package/src/components/widgets/CWidgetStatsC.tsx +4 -12
- package/src/components/widgets/CWidgetStatsD.tsx +1 -1
- package/src/components/widgets/CWidgetStatsE.tsx +1 -1
- package/src/components/widgets/CWidgetStatsF.tsx +1 -1
- package/src/components/widgets/__tests__/CWidgetStatsA.spec.tsx +1 -1
- package/src/components/widgets/__tests__/CWidgetStatsB.spec.tsx +1 -1
- package/src/components/widgets/__tests__/CWidgetStatsC.spec.tsx +1 -1
- package/src/components/widgets/__tests__/CWidgetStatsD.spec.tsx +1 -1
- package/src/components/widgets/__tests__/CWidgetStatsE.spec.tsx +1 -1
- package/src/components/widgets/__tests__/CWidgetStatsF.spec.tsx +1 -1
- package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsA.spec.tsx.snap +1 -1
- package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsB.spec.tsx.snap +12 -7
- package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsC.spec.tsx.snap +14 -9
- package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsD.spec.tsx.snap +2 -2
- package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsE.spec.tsx.snap +1 -1
- package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsF.spec.tsx.snap +2 -2
- package/src/types.ts +14 -7
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
Several quick start options are available:
|
|
44
44
|
|
|
45
|
-
- [Download the latest release](https://github.com/coreui/coreui-react-pro/archive/v5.0.0-alpha.
|
|
45
|
+
- [Download the latest release](https://github.com/coreui/coreui-react-pro/archive/v5.0.0-alpha.3.zip)
|
|
46
46
|
- Clone the repo: `git clone https://github.com/coreui/coreui-react.git`
|
|
47
47
|
- Install with [npm](https://www.npmjs.com/): `npm install @coreui/react`
|
|
48
48
|
- Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/react`
|
|
@@ -34,7 +34,7 @@ export interface CAvatarProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
34
34
|
/**
|
|
35
35
|
* Sets the text color of the component to one of CoreUI’s themed colors.
|
|
36
36
|
*
|
|
37
|
-
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | '
|
|
37
|
+
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'primary-emphasis' | 'secondary-emphasis' | 'success-emphasis' | 'danger-emphasis' | 'warning-emphasis' | 'info-emphasis' | 'light-emphasis' | 'body' | 'body-emphasis' | 'body-secondary' | 'body-tertiary' | 'black' | 'black-50' | 'white' | 'white-50' | string
|
|
38
38
|
*/
|
|
39
39
|
textColor?: TextColors;
|
|
40
40
|
}
|
|
@@ -32,7 +32,7 @@ export interface CBadgeProps extends HTMLAttributes<HTMLDivElement | HTMLSpanEle
|
|
|
32
32
|
/**
|
|
33
33
|
* Sets the text color of the component to one of CoreUI’s themed colors.
|
|
34
34
|
*
|
|
35
|
-
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | '
|
|
35
|
+
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'primary-emphasis' | 'secondary-emphasis' | 'success-emphasis' | 'danger-emphasis' | 'warning-emphasis' | 'info-emphasis' | 'light-emphasis' | 'body' | 'body-emphasis' | 'body-secondary' | 'body-tertiary' | 'black' | 'black-50' | 'white' | 'white-50' | string
|
|
36
36
|
*/
|
|
37
37
|
textColor?: TextColors;
|
|
38
38
|
}
|
|
@@ -14,7 +14,7 @@ export interface CCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
14
14
|
/**
|
|
15
15
|
* Sets the text color context of the component to one of CoreUI’s themed colors.
|
|
16
16
|
*
|
|
17
|
-
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | '
|
|
17
|
+
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'primary-emphasis' | 'secondary-emphasis' | 'success-emphasis' | 'danger-emphasis' | 'warning-emphasis' | 'info-emphasis' | 'light-emphasis' | 'body' | 'body-emphasis' | 'body-secondary' | 'body-tertiary' | 'black' | 'black-50' | 'white' | 'white-50' | string
|
|
18
18
|
*/
|
|
19
19
|
textColor?: string;
|
|
20
20
|
}
|
|
@@ -91,6 +91,7 @@ interface ContextProps extends CDropdownProps {
|
|
|
91
91
|
setVisible: React.Dispatch<React.SetStateAction<boolean | undefined>>;
|
|
92
92
|
portal: boolean;
|
|
93
93
|
}
|
|
94
|
+
export declare const getNextActiveElement: (list: HTMLElement[], activeElement: HTMLElement, shouldGetNext: boolean, isCycleAllowed: boolean) => HTMLElement;
|
|
94
95
|
export declare const CDropdownContext: React.Context<ContextProps>;
|
|
95
96
|
export declare const CDropdown: React.ForwardRefExoticComponent<CDropdownProps & React.RefAttributes<HTMLDivElement | HTMLLIElement>>;
|
|
96
97
|
export {};
|
|
@@ -10,6 +10,12 @@ export interface CDropdownToggleProps extends Omit<CButtonProps, 'type'> {
|
|
|
10
10
|
* Create a custom toggler which accepts any content.
|
|
11
11
|
*/
|
|
12
12
|
custom?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* If a dropdown `variant` is set to `nav-item` then render the toggler as a link instead of a button.
|
|
15
|
+
*
|
|
16
|
+
* @since v5.0.0-alpha.3
|
|
17
|
+
*/
|
|
18
|
+
navLink?: boolean;
|
|
13
19
|
/**
|
|
14
20
|
* Similarly, create split button dropdowns with virtually the same markup as single button dropdowns, but with the addition of `.dropdown-toggle-split` className for proper spacing around the dropdown caret.
|
|
15
21
|
*/
|
|
@@ -11,7 +11,7 @@ export interface CSmartTableHeadProps extends CTableHeadProps {
|
|
|
11
11
|
handleFilterOnChange?: (key: string, value: string) => void;
|
|
12
12
|
handleFilterOnInput?: (key: string, value: string) => void;
|
|
13
13
|
handleSelectAllChecked?: () => void;
|
|
14
|
-
handleSort?: (key: string, index: number) => void;
|
|
14
|
+
handleSort?: (key: string, index: number, order?: 'asc' | 'desc') => void;
|
|
15
15
|
items: Item[];
|
|
16
16
|
selectable?: boolean;
|
|
17
17
|
selectAll?: boolean | {
|
package/dist/index.es.js
CHANGED
|
@@ -4832,7 +4832,7 @@ CBreadcrumbItem.displayName = 'CBreadcrumbItem';
|
|
|
4832
4832
|
var CButton = forwardRef(function (_a, ref) {
|
|
4833
4833
|
var _b;
|
|
4834
4834
|
var children = _a.children, className = _a.className, _c = _a.color, color = _c === void 0 ? 'primary' : _c, _d = _a.component, component = _d === void 0 ? 'button' : _d, shape = _a.shape, size = _a.size, _e = _a.type, type = _e === void 0 ? 'button' : _e, variant = _a.variant, rest = __rest$1(_a, ["children", "className", "color", "component", "shape", "size", "type", "variant"]);
|
|
4835
|
-
return (React$1.createElement(CLink, __assign$1({ component: rest.href ? 'a' : component, type: type, className: classNames$1('btn', variant ? "btn-".concat(variant, "-").concat(color) : "btn-".concat(color), (_b = {}, _b["btn-".concat(size)] = size, _b), shape, className) }, rest, { ref: ref }), children));
|
|
4835
|
+
return (React$1.createElement(CLink, __assign$1({ component: rest.href ? 'a' : component }, (!rest.href && { type: type }), { className: classNames$1('btn', variant ? "btn-".concat(variant, "-").concat(color) : "btn-".concat(color), (_b = {}, _b["btn-".concat(size)] = size, _b), shape, className) }, rest, { ref: ref }), children));
|
|
4836
4836
|
});
|
|
4837
4837
|
CButton.propTypes = {
|
|
4838
4838
|
children: PropTypes$1.node,
|
|
@@ -9883,6 +9883,18 @@ var CDatePicker = forwardRef(function (_a, ref) {
|
|
|
9883
9883
|
CDatePicker.displayName = 'CDatePicker';
|
|
9884
9884
|
CDatePicker.propTypes = __assign$1(__assign$1({}, CDateRangePicker.propTypes), { date: PropTypes$1.oneOfType([PropTypes$1.instanceOf(Date), PropTypes$1.string]), onDateChange: PropTypes$1.func });
|
|
9885
9885
|
|
|
9886
|
+
var getNextActiveElement = function (list, activeElement, shouldGetNext, isCycleAllowed) {
|
|
9887
|
+
var listLength = list.length;
|
|
9888
|
+
var index = list.indexOf(activeElement);
|
|
9889
|
+
if (index === -1) {
|
|
9890
|
+
return !shouldGetNext && isCycleAllowed ? list[listLength - 1] : list[0];
|
|
9891
|
+
}
|
|
9892
|
+
index += shouldGetNext ? 1 : -1;
|
|
9893
|
+
if (isCycleAllowed) {
|
|
9894
|
+
index = (index + listLength) % listLength;
|
|
9895
|
+
}
|
|
9896
|
+
return list[Math.max(0, Math.min(index, listLength - 1))];
|
|
9897
|
+
};
|
|
9886
9898
|
var getPlacement = function (placement, direction, alignment, isRTL) {
|
|
9887
9899
|
var _placement = placement;
|
|
9888
9900
|
if (direction === 'dropup') {
|
|
@@ -9945,18 +9957,33 @@ var CDropdown = forwardRef(function (_a, ref) {
|
|
|
9945
9957
|
}, [visible]);
|
|
9946
9958
|
useEffect(function () {
|
|
9947
9959
|
if (_visible && dropdownToggleRef.current && dropdownMenuRef.current) {
|
|
9960
|
+
dropdownToggleRef.current.focus();
|
|
9948
9961
|
popper && initPopper(dropdownToggleRef.current, dropdownMenuRef.current, popperConfig);
|
|
9949
9962
|
window.addEventListener('mouseup', handleMouseUp);
|
|
9950
9963
|
window.addEventListener('keyup', handleKeyup);
|
|
9964
|
+
dropdownToggleRef.current.addEventListener('keydown', handleKeydown);
|
|
9965
|
+
dropdownMenuRef.current.addEventListener('keydown', handleKeydown);
|
|
9951
9966
|
onShow && onShow();
|
|
9952
9967
|
}
|
|
9953
9968
|
return function () {
|
|
9954
9969
|
popper && destroyPopper();
|
|
9955
9970
|
window.removeEventListener('mouseup', handleMouseUp);
|
|
9956
9971
|
window.removeEventListener('keyup', handleKeyup);
|
|
9972
|
+
dropdownToggleRef.current &&
|
|
9973
|
+
dropdownToggleRef.current.removeEventListener('keydown', handleKeydown);
|
|
9974
|
+
dropdownMenuRef.current &&
|
|
9975
|
+
dropdownMenuRef.current.removeEventListener('keydown', handleKeydown);
|
|
9957
9976
|
onHide && onHide();
|
|
9958
9977
|
};
|
|
9959
9978
|
}, [_visible]);
|
|
9979
|
+
var handleKeydown = function (event) {
|
|
9980
|
+
if (_visible && (event.key === 'ArrowDown' || event.key === 'ArrowUp')) {
|
|
9981
|
+
var target = event.target;
|
|
9982
|
+
event.preventDefault();
|
|
9983
|
+
var items = [].concat.apply([], Element.prototype.querySelectorAll.call(dropdownMenuRef.current, '.dropdown-item:not(.disabled):not(:disabled)'));
|
|
9984
|
+
getNextActiveElement(items, target, event.key === 'ArrowDown', true).focus();
|
|
9985
|
+
}
|
|
9986
|
+
};
|
|
9960
9987
|
var handleKeyup = function (event) {
|
|
9961
9988
|
if (autoClose === false) {
|
|
9962
9989
|
return;
|
|
@@ -9984,7 +10011,6 @@ var CDropdown = forwardRef(function (_a, ref) {
|
|
|
9984
10011
|
'dropup dropup-center': direction === 'dropup-center'
|
|
9985
10012
|
},
|
|
9986
10013
|
_b["".concat(direction)] = direction && direction !== 'center' && direction !== 'dropup-center',
|
|
9987
|
-
_b.show = _visible,
|
|
9988
10014
|
_b), className) }, rest, { ref: forkedRef }), children))));
|
|
9989
10015
|
});
|
|
9990
10016
|
var alignmentDirection = PropTypes$1.oneOf(['start', 'end']);
|
|
@@ -10096,8 +10122,8 @@ CDropdownMenu.propTypes = {
|
|
|
10096
10122
|
CDropdownMenu.displayName = 'CDropdownMenu';
|
|
10097
10123
|
|
|
10098
10124
|
var CDropdownToggle = function (_a) {
|
|
10099
|
-
var children = _a.children, _b = _a.caret, caret = _b === void 0 ? true : _b, custom = _a.custom, className = _a.className, split = _a.split,
|
|
10100
|
-
var
|
|
10125
|
+
var children = _a.children, _b = _a.caret, caret = _b === void 0 ? true : _b, custom = _a.custom, className = _a.className, _c = _a.navLink, navLink = _c === void 0 ? true : _c, split = _a.split, _d = _a.trigger, trigger = _d === void 0 ? 'click' : _d, rest = __rest$1(_a, ["children", "caret", "custom", "className", "navLink", "split", "trigger"]);
|
|
10126
|
+
var _e = useContext(CDropdownContext), dropdownToggleRef = _e.dropdownToggleRef, variant = _e.variant, visible = _e.visible, setVisible = _e.setVisible;
|
|
10101
10127
|
var triggers = __assign$1(__assign$1({}, ((trigger === 'click' || trigger.includes('click')) && {
|
|
10102
10128
|
onClick: function (event) {
|
|
10103
10129
|
event.preventDefault();
|
|
@@ -10108,19 +10134,19 @@ var CDropdownToggle = function (_a) {
|
|
|
10108
10134
|
onBlur: function () { return setVisible(false); },
|
|
10109
10135
|
}));
|
|
10110
10136
|
var togglerProps = __assign$1({ className: classNames$1({
|
|
10137
|
+
'nav-link': variant === 'nav-item' && navLink,
|
|
10111
10138
|
'dropdown-toggle': caret,
|
|
10112
10139
|
'dropdown-toggle-split': split,
|
|
10113
|
-
|
|
10140
|
+
show: visible,
|
|
10114
10141
|
}, className), 'aria-expanded': visible }, (!rest.disabled && __assign$1({}, triggers)));
|
|
10115
|
-
// We use any because Toggler can be `a` as well as `button`.
|
|
10116
10142
|
var Toggler = function () {
|
|
10117
10143
|
if (custom && React$1.isValidElement(children)) {
|
|
10118
10144
|
return (React$1.createElement(React$1.Fragment, null, React$1.cloneElement(children, __assign$1(__assign$1({ 'aria-expanded': visible }, (!rest.disabled && __assign$1({}, triggers))), { ref: dropdownToggleRef }))));
|
|
10119
10145
|
}
|
|
10120
|
-
if (variant === 'nav-item') {
|
|
10121
|
-
return (React$1.createElement("a", __assign$1({ href: "#" }, togglerProps, { ref: dropdownToggleRef }), children));
|
|
10146
|
+
if (variant === 'nav-item' && navLink) {
|
|
10147
|
+
return (React$1.createElement("a", __assign$1({ href: "#" }, togglerProps, { role: "button", ref: dropdownToggleRef }), children));
|
|
10122
10148
|
}
|
|
10123
|
-
return (React$1.createElement(CButton, __assign$1({
|
|
10149
|
+
return (React$1.createElement(CButton, __assign$1({}, togglerProps, { tabIndex: 0 }, rest, { ref: dropdownToggleRef }),
|
|
10124
10150
|
children,
|
|
10125
10151
|
split && React$1.createElement("span", { className: "visually-hidden" }, "Toggle Dropdown")));
|
|
10126
10152
|
};
|
|
@@ -13947,23 +13973,41 @@ var CSmartTableHead = forwardRef(function (_a, ref) {
|
|
|
13947
13973
|
React$1.createElement(CTableRow, null,
|
|
13948
13974
|
selectable && (React$1.createElement(CTableHeaderCell, null, selectAll && (React$1.createElement(CFormCheck, { checked: typeof selectedAll === 'boolean' ? selectedAll : false, indeterminate: selectedAll === 'indeterminate' ? true : false, onChange: function () { return handleSelectAllChecked && handleSelectAllChecked(); }, ref: selectAllcheckboxRef })))),
|
|
13949
13975
|
_columns.map(function (column, index) {
|
|
13950
|
-
|
|
13976
|
+
var isSortable = columnSorter &&
|
|
13977
|
+
(typeof column === 'object'
|
|
13978
|
+
? column.sorter === undefined
|
|
13979
|
+
? true
|
|
13980
|
+
: column.sorter
|
|
13981
|
+
: true);
|
|
13982
|
+
return (React$1.createElement(CTableHeaderCell, __assign$1({}, getTableHeaderCellProps(column), {
|
|
13983
|
+
// onClick={() => handleSort && handleSort(getColumnKey(column), index)}
|
|
13984
|
+
style: getTableHeaderCellStyles(column, columnSorter), key: index }, (isSortable && {
|
|
13985
|
+
onClick: function () { return handleSort && handleSort(getColumnKey(column), index); },
|
|
13986
|
+
onKeyDown: function (event) {
|
|
13987
|
+
if (event.key === 'Enter') {
|
|
13988
|
+
handleSort && handleSort(getColumnKey(column), index);
|
|
13989
|
+
}
|
|
13990
|
+
if (event.key === 'ArrowUp') {
|
|
13991
|
+
event.preventDefault();
|
|
13992
|
+
handleSort && handleSort(getColumnKey(column), index, 'asc');
|
|
13993
|
+
}
|
|
13994
|
+
if (event.key === 'ArrowDown') {
|
|
13995
|
+
event.preventDefault();
|
|
13996
|
+
handleSort && handleSort(getColumnKey(column), index, 'desc');
|
|
13997
|
+
}
|
|
13998
|
+
},
|
|
13999
|
+
tabIndex: 0,
|
|
14000
|
+
})),
|
|
13951
14001
|
React$1.createElement("div", { className: "d-inline" }, getColumnLabel(column)),
|
|
13952
|
-
|
|
13953
|
-
(typeof column === 'object'
|
|
13954
|
-
? (column.sorter === undefined
|
|
13955
|
-
? true
|
|
13956
|
-
: column.sorter)
|
|
13957
|
-
: true) &&
|
|
13958
|
-
columnSorterIcon(column)));
|
|
14002
|
+
isSortable && columnSorterIcon(column)));
|
|
13959
14003
|
})),
|
|
13960
14004
|
columnFilter && (React$1.createElement(CTableRow, null,
|
|
13961
14005
|
selectable && React$1.createElement(CTableHeaderCell, null),
|
|
13962
14006
|
_columns.map(function (column, index) {
|
|
13963
14007
|
return (React$1.createElement(CTableHeaderCell, __assign$1({}, getTableHeaderCellProps(column), { key: index }), (typeof column === 'object'
|
|
13964
|
-
?
|
|
14008
|
+
? column.filter === undefined
|
|
13965
14009
|
? true
|
|
13966
|
-
: column.filter
|
|
14010
|
+
: column.filter
|
|
13967
14011
|
: true) ? (typeof column !== 'string' && typeof column.filter === 'function' ? (!refresh &&
|
|
13968
14012
|
column.filter(getColumnValues(items, getColumnKey(column)), function (value) {
|
|
13969
14013
|
return handleOnCustomFilterChange &&
|
|
@@ -14152,14 +14196,20 @@ var CSmartTable = forwardRef(function (_a, ref) {
|
|
|
14152
14196
|
return item;
|
|
14153
14197
|
}));
|
|
14154
14198
|
};
|
|
14155
|
-
var handleSorterChange = function (column, index) {
|
|
14199
|
+
var handleSorterChange = function (column, index, order) {
|
|
14156
14200
|
if (!isSortable(index, columns, columnSorter, itemsDataColumns, columnNames)) {
|
|
14157
14201
|
return;
|
|
14158
14202
|
}
|
|
14159
14203
|
//if column changed or sort was descending change asc to true
|
|
14160
14204
|
var state = sorterState !== null && sorterState !== void 0 ? sorterState : { column: '', state: '' };
|
|
14205
|
+
if (order) {
|
|
14206
|
+
state.state = order;
|
|
14207
|
+
}
|
|
14161
14208
|
if (state.column === column) {
|
|
14162
|
-
if (
|
|
14209
|
+
if (order) {
|
|
14210
|
+
state.state = order;
|
|
14211
|
+
}
|
|
14212
|
+
else if (state.state === 0) {
|
|
14163
14213
|
state.state = 'asc';
|
|
14164
14214
|
}
|
|
14165
14215
|
else if (state.state === 'asc') {
|
|
@@ -14171,11 +14221,12 @@ var CSmartTable = forwardRef(function (_a, ref) {
|
|
|
14171
14221
|
}
|
|
14172
14222
|
else {
|
|
14173
14223
|
state.column = column;
|
|
14174
|
-
state.state = 'asc';
|
|
14224
|
+
state.state = order || 'asc';
|
|
14175
14225
|
}
|
|
14176
14226
|
setSorterState(__assign$1({}, state));
|
|
14177
14227
|
};
|
|
14178
14228
|
var handleTableFilterChange = function (value, type) {
|
|
14229
|
+
to;
|
|
14179
14230
|
var isLazy = tableFilter && typeof tableFilter === 'object' && tableFilter.lazy === true;
|
|
14180
14231
|
if ((isLazy && type === 'input') || (!isLazy && type === 'change')) {
|
|
14181
14232
|
return;
|
|
@@ -14210,7 +14261,7 @@ var CSmartTable = forwardRef(function (_a, ref) {
|
|
|
14210
14261
|
React$1.createElement(CTable, __assign$1({}, tableProps),
|
|
14211
14262
|
header && (React$1.createElement(CSmartTableHead, __assign$1({}, tableHeadProps, { columnFilter: columnFilter, columnFilterState: columnFilterState, columns: columns !== null && columns !== void 0 ? columns : columnNames, columnSorter: columnSorter, items: _items, selectable: selectable, selectAll: selectAll, selectedAll: selectedAll, sorterState: sorterState, sortingIcon: sortingIcon, sortingIconAscending: sortingIconAscending, sortingIconDescending: sortingIconDescending, handleFilterOnChange: function (key, event) {
|
|
14212
14263
|
return handleColumnFilterChange(key, event, 'change');
|
|
14213
|
-
}, handleFilterOnInput: function (key, event) { return handleColumnFilterChange(key, event, 'input'); }, handleOnCustomFilterChange: function (key, event) { return handleColumnFilterChange(key, event); }, handleSelectAllChecked: function () { return handleSelectAllChecked(); }, handleSort: function (key, index) { return handleSorterChange(key, index); } }))),
|
|
14264
|
+
}, handleFilterOnInput: function (key, event) { return handleColumnFilterChange(key, event, 'input'); }, handleOnCustomFilterChange: function (key, event) { return handleColumnFilterChange(key, event); }, handleSelectAllChecked: function () { return handleSelectAllChecked(); }, handleSort: function (key, index, order) { return handleSorterChange(key, index, order); } }))),
|
|
14214
14265
|
React$1.createElement(CSmartTableBody, __assign$1({ clickableRows: clickableRows, columnNames: columnNames, columns: columns !== null && columns !== void 0 ? columns : columnNames, currentItems: currentItems, firstItemOnActivePageIndex: firstItemOnActivePageIndex, noItemsLabel: noItemsLabel, onRowClick: function (item, index, columnName, event) {
|
|
14215
14266
|
return clickableRows && onRowClick && onRowClick(item, index, columnName, event);
|
|
14216
14267
|
}, onRowChecked: function (item, value) { return handleRowChecked(item, value); }, scopedColumns: scopedColumns, selectable: selectable, selected: _selected }, tableBodyProps)),
|
|
@@ -14692,7 +14743,7 @@ CTooltip.displayName = 'CTooltip';
|
|
|
14692
14743
|
var CWidgetStatsA = forwardRef(function (_a, ref) {
|
|
14693
14744
|
var _b;
|
|
14694
14745
|
var action = _a.action, chart = _a.chart, className = _a.className, color = _a.color, title = _a.title, value = _a.value, rest = __rest$1(_a, ["action", "chart", "className", "color", "title", "value"]);
|
|
14695
|
-
return (React$1.createElement(CCard, __assign$1({ className: classNames$1((_b = {}, _b["bg-".concat(color)] = color, _b['text-
|
|
14746
|
+
return (React$1.createElement(CCard, __assign$1({ className: classNames$1((_b = {}, _b["bg-".concat(color)] = color, _b['text-white'] = color, _b), className) }, rest, { ref: ref }),
|
|
14696
14747
|
React$1.createElement(CCardBody, { className: "pb-0 d-flex justify-content-between align-items-start" },
|
|
14697
14748
|
React$1.createElement("div", null,
|
|
14698
14749
|
value && React$1.createElement("div", { className: "fs-4 fw-semibold" }, value),
|
|
@@ -14712,12 +14763,12 @@ CWidgetStatsA.displayName = 'CWidgetStatsA';
|
|
|
14712
14763
|
|
|
14713
14764
|
var CWidgetStatsB = forwardRef(function (_a, ref) {
|
|
14714
14765
|
var className = _a.className, color = _a.color, inverse = _a.inverse, progress = _a.progress, text = _a.text, title = _a.title, value = _a.value, rest = __rest$1(_a, ["className", "color", "inverse", "progress", "text", "title", "value"]);
|
|
14715
|
-
return (React$1.createElement(CCard, __assign$1({ className: className, color: color }, (inverse && { textColor: '
|
|
14766
|
+
return (React$1.createElement(CCard, __assign$1({ className: className, color: color }, (inverse && { textColor: 'white' }), rest, { ref: ref }),
|
|
14716
14767
|
React$1.createElement(CCardBody, null,
|
|
14717
14768
|
value && React$1.createElement("div", { className: "fs-4 fw-semibold" }, value),
|
|
14718
14769
|
title && React$1.createElement("div", null, title),
|
|
14719
14770
|
React$1.createElement(CProgress, __assign$1({ className: "my-2", height: 4 }, (inverse && { white: true }), progress)),
|
|
14720
|
-
text && (React$1.createElement("small", { className: inverse ? 'text-
|
|
14771
|
+
text && (React$1.createElement("small", { className: inverse ? 'text-white text-opacity-75' : 'text-body-secondary' }, text)))));
|
|
14721
14772
|
});
|
|
14722
14773
|
CWidgetStatsB.propTypes = {
|
|
14723
14774
|
className: PropTypes$1.string,
|
|
@@ -14732,11 +14783,11 @@ CWidgetStatsB.displayName = 'CWidgetCWidgetStatsB';
|
|
|
14732
14783
|
|
|
14733
14784
|
var CWidgetStatsC = forwardRef(function (_a, ref) {
|
|
14734
14785
|
var className = _a.className, color = _a.color, icon = _a.icon, inverse = _a.inverse, progress = _a.progress, title = _a.title, value = _a.value, rest = __rest$1(_a, ["className", "color", "icon", "inverse", "progress", "title", "value"]);
|
|
14735
|
-
return (React$1.createElement(CCard, __assign$1({ className: className, color: color }, (inverse && { textColor: '
|
|
14786
|
+
return (React$1.createElement(CCard, __assign$1({ className: className, color: color }, (inverse && { textColor: 'white' }), rest, { ref: ref }),
|
|
14736
14787
|
React$1.createElement(CCardBody, null,
|
|
14737
|
-
icon &&
|
|
14738
|
-
value &&
|
|
14739
|
-
title && (React$1.createElement("div", { className: inverse ? 'text-
|
|
14788
|
+
icon && React$1.createElement("div", { className: "text-end mb-4" }, icon),
|
|
14789
|
+
value && React$1.createElement("div", { className: "fs-4 fw-semibold" }, value),
|
|
14790
|
+
title && (React$1.createElement("div", { className: inverse ? 'text-white text-opacity-75' : 'text-body-secondary' }, title)),
|
|
14740
14791
|
React$1.createElement(CProgress, __assign$1({ className: "mt-3 mb-0", height: 4 }, (inverse && { white: true }), progress)))));
|
|
14741
14792
|
});
|
|
14742
14793
|
CWidgetStatsC.propTypes = {
|
|
@@ -14765,7 +14816,7 @@ var CWidgetStatsD = forwardRef(function (_a, ref) {
|
|
|
14765
14816
|
index % 2 !== 0 && React$1.createElement("div", { className: "vr" }),
|
|
14766
14817
|
React$1.createElement(CCol, null,
|
|
14767
14818
|
React$1.createElement("div", { className: "fs-5 fw-semibold" }, value.value),
|
|
14768
|
-
React$1.createElement("div", { className: "text-uppercase text-
|
|
14819
|
+
React$1.createElement("div", { className: "text-uppercase text-body-secondary small" }, value.title))));
|
|
14769
14820
|
}))));
|
|
14770
14821
|
});
|
|
14771
14822
|
CWidgetStatsD.propTypes = {
|
|
@@ -14781,7 +14832,7 @@ var CWidgetStatsE = forwardRef(function (_a, ref) {
|
|
|
14781
14832
|
var chart = _a.chart, className = _a.className, title = _a.title, value = _a.value, rest = __rest$1(_a, ["chart", "className", "title", "value"]);
|
|
14782
14833
|
return (React$1.createElement(CCard, __assign$1({ className: classNames$1(className) }, rest, { ref: ref }),
|
|
14783
14834
|
React$1.createElement(CCardBody, { className: "text-center" },
|
|
14784
|
-
title && (React$1.createElement("div", { className: "text-
|
|
14835
|
+
title && (React$1.createElement("div", { className: "text-body-secondary small text-uppercase fw-semibold" }, title)),
|
|
14785
14836
|
value && React$1.createElement("div", { className: "fs-6 fw-semibold py-3" }, value),
|
|
14786
14837
|
chart)));
|
|
14787
14838
|
});
|
|
@@ -14801,7 +14852,7 @@ var CWidgetStatsF = forwardRef(function (_a, ref) {
|
|
|
14801
14852
|
React$1.createElement("div", { className: "me-3 text-white bg-".concat(color, " ").concat(padding ? 'p-3' : 'p-4') }, icon),
|
|
14802
14853
|
React$1.createElement("div", null,
|
|
14803
14854
|
React$1.createElement("div", { className: "fs-6 fw-semibold text-".concat(color) }, value),
|
|
14804
|
-
React$1.createElement("div", { className: "text-
|
|
14855
|
+
React$1.createElement("div", { className: "text-body-secondary text-uppercase fw-semibold small" }, title))),
|
|
14805
14856
|
footer && React$1.createElement(CCardFooter, null, footer)));
|
|
14806
14857
|
});
|
|
14807
14858
|
CWidgetStatsF.propTypes = {
|