@ringcentral/juno 2.3.1 → 2.3.6
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/components/Dialog/DialogContent/styles/DialogContentStyle.js +1 -1
- package/components/PortalHost/Connectable/ThrottleScheduler.d.ts +0 -1
- package/components/PortalHost/Connectable/ThrottleScheduler.js +3 -5
- package/components/Table/TableCell/TableCell.js +3 -1
- package/components/Table/TableCell/styles/TableCellStyle.js +1 -2
- package/components/Table/TableCell/utils/TableCellUtils.js +9 -1
- package/components/Table/TableContainer/TableContainer.js +1 -1
- package/components/Table/TableRow/TableRow.js +2 -1
- package/components/Table/index.d.ts +1 -1
- package/components/Table/index.js +1 -1
- package/components/Table/types.d.ts +2 -0
- package/components/VirtualizedMenu/VirtualizedMenuList.js +3 -3
- package/es6/components/Dialog/DialogContent/styles/DialogContentStyle.js +1 -1
- package/es6/components/PortalHost/Connectable/ThrottleScheduler.js +3 -5
- package/es6/components/Table/TableCell/TableCell.js +3 -1
- package/es6/components/Table/TableCell/styles/TableCellStyle.js +1 -2
- package/es6/components/Table/TableCell/utils/TableCellUtils.js +9 -1
- package/es6/components/Table/TableContainer/TableContainer.js +1 -1
- package/es6/components/Table/TableRow/TableRow.js +2 -1
- package/es6/components/Table/index.js +1 -1
- package/es6/components/VirtualizedMenu/VirtualizedMenuList.js +3 -3
- package/es6/foundation/hooks/useA11yKeyEvent/useA11yKeyEvent.js +3 -3
- package/es6/foundation/utils/a11yKeyboardCode.js +1 -1
- package/foundation/hooks/useA11yKeyEvent/useA11yKeyEvent.d.ts +2 -2
- package/foundation/hooks/useA11yKeyEvent/useA11yKeyEvent.js +3 -3
- package/foundation/utils/a11yKeyboardCode.js +1 -1
- package/package.json +4 -1
|
@@ -5,6 +5,6 @@ var foundation_1 = require("../../../../foundation");
|
|
|
5
5
|
var utils_1 = require("../utils");
|
|
6
6
|
exports.DialogContentStyle = function (props) {
|
|
7
7
|
var size = props.size, dividers = props.dividers;
|
|
8
|
-
return foundation_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n padding: ", ";\n\n &.", " {\n border-color: ", ";\n }\n "], ["\n padding: ", ";\n\n &.", " {\n border-color: ", ";\n }\n "])), foundation_1.spacing.apply(void 0, tslib_1.__spread(utils_1.getRcDialogContentSpacings(dividers)[size])), utils_1.RcDialogContentClasses.dividers, foundation_1.palette2('neutral', 'l02'));
|
|
8
|
+
return foundation_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n padding: ", ";\n color: ", ";\n\n &.", " {\n border-color: ", ";\n }\n "], ["\n padding: ", ";\n color: ", ";\n\n &.", " {\n border-color: ", ";\n }\n "])), foundation_1.spacing.apply(void 0, tslib_1.__spread(utils_1.getRcDialogContentSpacings(dividers)[size])), foundation_1.palette2('neutral', 'f04'), utils_1.RcDialogContentClasses.dividers, foundation_1.palette2('neutral', 'l02'));
|
|
9
9
|
};
|
|
10
10
|
var templateObject_1;
|
|
@@ -8,17 +8,15 @@ var ThrottleScheduler = /** @class */ (function () {
|
|
|
8
8
|
var _this = this;
|
|
9
9
|
if (!this._timeoutID) {
|
|
10
10
|
this._timeoutID = window.setTimeout(function () {
|
|
11
|
-
|
|
12
|
-
_this.
|
|
11
|
+
var _a;
|
|
12
|
+
_this._timeoutID = undefined;
|
|
13
|
+
(_a = _this._lastTask) === null || _a === void 0 ? void 0 : _a.call(_this);
|
|
13
14
|
});
|
|
14
15
|
}
|
|
15
16
|
this._lastTask = task;
|
|
16
17
|
};
|
|
17
18
|
ThrottleScheduler.prototype.clear = function () {
|
|
18
19
|
window.clearTimeout(this._timeoutID);
|
|
19
|
-
this._reset();
|
|
20
|
-
};
|
|
21
|
-
ThrottleScheduler.prototype._reset = function () {
|
|
22
20
|
this._lastTask = null;
|
|
23
21
|
this._timeoutID = undefined;
|
|
24
22
|
};
|
|
@@ -14,6 +14,8 @@ var context_1 = require("../context");
|
|
|
14
14
|
var _RcTableCell = react_1.forwardRef(function (props, ref) {
|
|
15
15
|
var _a = foundation_1.useThemeProps({ props: props, name: 'RcTableCell' }), classesProp = _a.classes, childrenProp = _a.children, size = _a.size, sortDirection = _a.sortDirection, _b = _a.activeSort, activeSort = _b === void 0 ? false : _b, rest = tslib_1.__rest(_a, ["classes", "children", "size", "sortDirection", "activeSort"]);
|
|
16
16
|
var classes = foundation_1.combineClasses(utils_1.RcTableCellClasses, classesProp);
|
|
17
|
+
// prevent mui classes warning
|
|
18
|
+
var sortButton = classes.sortButton, activeSortClass = classes.activeSort, sortIcon = classes.sortIcon, tableCellClasses = tslib_1.__rest(classes, ["sortButton", "activeSort", "sortIcon"]);
|
|
17
19
|
var children = react_1.useMemo(function () {
|
|
18
20
|
var _a;
|
|
19
21
|
if (sortDirection) {
|
|
@@ -25,7 +27,7 @@ var _RcTableCell = react_1.forwardRef(function (props, ref) {
|
|
|
25
27
|
}
|
|
26
28
|
return childrenProp;
|
|
27
29
|
}, [activeSort, childrenProp, classes, sortDirection]);
|
|
28
|
-
return (react_1.default.createElement(TableCell_1.default, tslib_1.__assign({}, rest, (sortDirection ? { sortDirection: sortDirection } : {}), { ref: ref, classes:
|
|
30
|
+
return (react_1.default.createElement(TableCell_1.default, tslib_1.__assign({}, rest, (sortDirection ? { sortDirection: sortDirection } : {}), { ref: ref, classes: tableCellClasses }), children));
|
|
29
31
|
});
|
|
30
32
|
var RcTableCell = foundation_1.styled(_RcTableCell).attrs(function (_a) {
|
|
31
33
|
var _b;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
4
|
var foundation_1 = require("../../../../foundation");
|
|
5
|
-
var Icon_1 = require("../../../Icon");
|
|
6
5
|
var utils_1 = require("../utils");
|
|
7
6
|
var SizeMap = {
|
|
8
7
|
large: 56,
|
|
@@ -11,6 +10,6 @@ var SizeMap = {
|
|
|
11
10
|
};
|
|
12
11
|
exports.TableCellStyle = function (prop) {
|
|
13
12
|
var size = prop.size, sortDirection = prop.sortDirection;
|
|
14
|
-
return foundation_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n box-sizing: border-box;\n padding: ", ";\n min-width: 96px;\n\n &.", " {\n ", "\n height: 40px;\n border-bottom: 1px solid ", ";\n color: ", ";\n background-color: ", ";\n\n padding: ", ";\n\n .", " {\n opacity: 0;\n padding: ", ";\n }\n\n .", " {\n color: ", ";\n\n .", " {\n opacity: 1;\n }\n }\n\n .", " {\n display: inline-flex;\n justify-content: flex-start;\n flex-direction: inherit;\n align-items: center;\n\n height: 100%;\n width: 100%;\n padding: ", ";\n\n ", " {\n color: ", ";\n }\n\n &:hover {\n background-color: ", ";\n\n .", " {\n opacity: 1;\n }\n }\n\n ", " {\n ", "\n background-color: ", ";\n }\n }\n }\n\n &.", " {\n ", "\n color: ", ";\n\n padding: ", ";\n height: ", ";\n }\n "], ["\n box-sizing: border-box;\n padding: ", ";\n min-width: 96px;\n\n &.", " {\n ", "\n height: 40px;\n border-bottom: 1px solid ", ";\n color: ", ";\n background-color: ", ";\n\n padding: ", ";\n\n .", " {\n opacity: 0;\n padding: ", ";\n }\n\n .", " {\n color: ", ";\n\n .", " {\n opacity: 1;\n }\n }\n\n .", " {\n display: inline-flex;\n justify-content: flex-start;\n flex-direction: inherit;\n align-items: center;\n\n height: 100%;\n width: 100%;\n padding: ", ";\n\n ", " {\n color: ", ";\n }\n\n &:hover {\n background-color: ", ";\n\n .", " {\n opacity: 1;\n }\n }\n\n ", " {\n ", "\n background-color: ", ";\n }\n }\n }\n\n &.", " {\n ", "\n color: ", ";\n\n padding: ", ";\n height: ", ";\n }\n "])), foundation_1.spacing(0, 2), utils_1.RcTableCellClasses.head, foundation_1.typography('caption2'), foundation_1.palette2('neutral', 'l02'), foundation_1.palette2('neutral', 'f05'), foundation_1.palette2('neutral', 'b02'), Boolean(sortDirection) && 'unset', utils_1.RcTableCellClasses.sortIcon, foundation_1.spacing(0, 2), utils_1.RcTableCellClasses.activeSort, foundation_1.palette2('interactive', 'f01'), utils_1.RcTableCellClasses.sortIcon, utils_1.RcTableCellClasses.sortButton, foundation_1.spacing(0, 2),
|
|
13
|
+
return foundation_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n box-sizing: border-box;\n padding: ", ";\n min-width: 96px;\n\n &.", " {\n min-width: unset;\n padding: ", ";\n }\n\n &.", " {\n padding: unset;\n }\n\n &.", " {\n ", "\n height: 40px;\n border-bottom: 1px solid ", ";\n color: ", ";\n background-color: ", ";\n\n padding: ", ";\n\n .", " {\n opacity: 0;\n padding: ", ";\n }\n\n .", " {\n color: ", ";\n\n .", " {\n opacity: 1;\n color: ", ";\n }\n }\n\n .", " {\n display: inline-flex;\n justify-content: flex-start;\n flex-direction: inherit;\n align-items: center;\n\n height: 100%;\n width: 100%;\n padding: ", ";\n\n ", " {\n color: ", ";\n }\n\n &:hover {\n background-color: ", ";\n\n .", " {\n opacity: 1;\n }\n }\n\n ", " {\n ", "\n background-color: ", ";\n }\n }\n }\n\n &.", " {\n ", "\n color: ", ";\n\n padding: ", ";\n height: ", ";\n }\n "], ["\n box-sizing: border-box;\n padding: ", ";\n min-width: 96px;\n\n &.", " {\n min-width: unset;\n padding: ", ";\n }\n\n &.", " {\n padding: unset;\n }\n\n &.", " {\n ", "\n height: 40px;\n border-bottom: 1px solid ", ";\n color: ", ";\n background-color: ", ";\n\n padding: ", ";\n\n .", " {\n opacity: 0;\n padding: ", ";\n }\n\n .", " {\n color: ", ";\n\n .", " {\n opacity: 1;\n color: ", ";\n }\n }\n\n .", " {\n display: inline-flex;\n justify-content: flex-start;\n flex-direction: inherit;\n align-items: center;\n\n height: 100%;\n width: 100%;\n padding: ", ";\n\n ", " {\n color: ", ";\n }\n\n &:hover {\n background-color: ", ";\n\n .", " {\n opacity: 1;\n }\n }\n\n ", " {\n ", "\n background-color: ", ";\n }\n }\n }\n\n &.", " {\n ", "\n color: ", ";\n\n padding: ", ";\n height: ", ";\n }\n "])), foundation_1.spacing(0, 2), utils_1.RcTableCellClasses.paddingCheckbox, foundation_1.spacing(0, 0, 0, 2), utils_1.RcTableCellClasses.paddingNone, utils_1.RcTableCellClasses.head, foundation_1.typography('caption2'), foundation_1.palette2('neutral', 'l02'), foundation_1.palette2('neutral', 'f05'), foundation_1.palette2('neutral', 'b02'), Boolean(sortDirection) && 'unset', utils_1.RcTableCellClasses.sortIcon, foundation_1.spacing(0, 2), utils_1.RcTableCellClasses.activeSort, foundation_1.palette2('interactive', 'f01'), utils_1.RcTableCellClasses.sortIcon, foundation_1.palette2('neutral', 'f04'), utils_1.RcTableCellClasses.sortButton, foundation_1.spacing(0, 2), utils_1.RcTableCellClasses.sortIcon, foundation_1.palette2('neutral', 'f04'), foundation_1.palette2('neutral', 'b03'), utils_1.RcTableCellClasses.sortIcon, foundation_1.focusVisible, foundation_1.fakeBorder({ color: foundation_1.palette2('interactive', 'f01') }), foundation_1.palette2('neutral', 'b03'), utils_1.RcTableCellClasses.body, foundation_1.typography('body1'), foundation_1.palette2('neutral', 'f06'), size === 'auto' && foundation_1.spacing(3, 2), size !== 'auto' && foundation_1.px(SizeMap[size]));
|
|
15
14
|
};
|
|
16
15
|
var templateObject_1;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var foundation_1 = require("../../../../foundation");
|
|
4
|
-
exports.RcTableCellClasses = foundation_1.RcClasses([
|
|
4
|
+
exports.RcTableCellClasses = foundation_1.RcClasses([
|
|
5
|
+
'head',
|
|
6
|
+
'body',
|
|
7
|
+
'sortIcon',
|
|
8
|
+
'activeSort',
|
|
9
|
+
'sortButton',
|
|
10
|
+
'paddingCheckbox',
|
|
11
|
+
'paddingNone',
|
|
12
|
+
], 'RcTableCell');
|
|
@@ -9,7 +9,7 @@ var _RcTableContainer = react_1.forwardRef(function (props, ref) {
|
|
|
9
9
|
var _a = foundation_1.useThemeProps({
|
|
10
10
|
props: props,
|
|
11
11
|
name: 'RcTableContainer',
|
|
12
|
-
}), children = _a.children, bordered = _a.bordered, rest = tslib_1.__rest(_a, ["children", "bordered"]);
|
|
12
|
+
}), children = _a.children, bordered = _a.bordered, square = _a.square, rest = tslib_1.__rest(_a, ["children", "bordered", "square"]);
|
|
13
13
|
return (react_1.default.createElement(TableContainer_1.default, tslib_1.__assign({}, rest, { ref: ref }), children));
|
|
14
14
|
});
|
|
15
15
|
var RcTableContainer = foundation_1.styled(_RcTableContainer)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.TableContainerStyle);
|
|
@@ -11,7 +11,8 @@ var _RcTableRow = react_1.forwardRef(function (props, ref) {
|
|
|
11
11
|
var _a;
|
|
12
12
|
var _b = foundation_1.useThemeProps({ props: props, name: 'RcTableRow' }), className = _b.className, classesProp = _b.classes, children = _b.children, disabled = _b.disabled, rest = tslib_1.__rest(_b, ["className", "classes", "children", "disabled"]);
|
|
13
13
|
var classes = react_1.useMemo(function () { return foundation_1.combineClasses(utils_1.RcTableRowClasses, classesProp); }, [classesProp]);
|
|
14
|
-
|
|
14
|
+
var disabledClass = classes.disabled, tableRowClasses = tslib_1.__rest(classes, ["disabled"]);
|
|
15
|
+
return (react_1.default.createElement(TableRow_1.default, tslib_1.__assign({}, rest, { ref: ref, classes: tableRowClasses, className: clsx_1.default(className, (_a = {}, _a[disabledClass] = disabled, _a)) }), children));
|
|
15
16
|
});
|
|
16
17
|
var RcTableRow = foundation_1.styled(_RcTableRow)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.TableRowStyle);
|
|
17
18
|
exports.RcTableRow = RcTableRow;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
export * from './context';
|
|
1
2
|
export * from './Table';
|
|
2
3
|
export * from './TableBody';
|
|
3
4
|
export * from './TableCell';
|
|
4
5
|
export * from './TableContainer';
|
|
5
6
|
export * from './TableHead';
|
|
6
7
|
export * from './TableRow';
|
|
7
|
-
export * from './context';
|
|
8
8
|
export * from './types';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./context"), exports);
|
|
4
5
|
tslib_1.__exportStar(require("./Table"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./TableBody"), exports);
|
|
6
7
|
tslib_1.__exportStar(require("./TableCell"), exports);
|
|
7
8
|
tslib_1.__exportStar(require("./TableContainer"), exports);
|
|
8
9
|
tslib_1.__exportStar(require("./TableHead"), exports);
|
|
9
10
|
tslib_1.__exportStar(require("./TableRow"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./context"), exports);
|
|
@@ -13,7 +13,7 @@ var _RcVirtualizedMenuList = react_1.forwardRef(function (inProps, ref) {
|
|
|
13
13
|
props: inProps,
|
|
14
14
|
name: 'RcVirtualizedMenuList',
|
|
15
15
|
});
|
|
16
|
-
var action = props.action, _a = props.autoFocus, autoFocus = _a === void 0 ? false : _a, VirtuosoProps = props.VirtuosoProps, _b = props.autoFocusItem, autoFocusItem = _b === void 0 ? false : _b, childrenProp = props.children, className = props.className, classes = props.classes, _c = props.disabledItemsFocusable, disabledItemsFocusable = _c === void 0 ? false : _c, _d = props.disableListWrap, disableListWrap = _d === void 0 ? false : _d, _e = props.variant, variant = _e === void 0 ? 'selectedMenu' : _e, _f = props.maxHeight, maxHeight = _f === void 0 ? '100%' : _f, autoClose = props.autoClose, position = props.position, onClose = props.onClose, rest = tslib_1.__rest(props, ["action", "autoFocus", "VirtuosoProps", "autoFocusItem", "children", "className", "classes", "disabledItemsFocusable", "disableListWrap", "variant", "maxHeight", "autoClose", "position", "onClose"]);
|
|
16
|
+
var action = props.action, disablePadding = props.disablePadding, _a = props.autoFocus, autoFocus = _a === void 0 ? false : _a, VirtuosoProps = props.VirtuosoProps, _b = props.autoFocusItem, autoFocusItem = _b === void 0 ? false : _b, childrenProp = props.children, className = props.className, classes = props.classes, _c = props.disabledItemsFocusable, disabledItemsFocusable = _c === void 0 ? false : _c, _d = props.disableListWrap, disableListWrap = _d === void 0 ? false : _d, _e = props.variant, variant = _e === void 0 ? 'selectedMenu' : _e, _f = props.maxHeight, maxHeight = _f === void 0 ? '100%' : _f, autoClose = props.autoClose, position = props.position, onClose = props.onClose, rest = tslib_1.__rest(props, ["action", "disablePadding", "autoFocus", "VirtuosoProps", "autoFocusItem", "children", "className", "classes", "disabledItemsFocusable", "disableListWrap", "variant", "maxHeight", "autoClose", "position", "onClose"]);
|
|
17
17
|
var theme = foundation_1.useTheme();
|
|
18
18
|
var document = foundation_1.useRcPortalWindowContext().document;
|
|
19
19
|
var vlRef = react_1.useRef(null);
|
|
@@ -163,8 +163,8 @@ var _RcVirtualizedMenuList = react_1.forwardRef(function (inProps, ref) {
|
|
|
163
163
|
},
|
|
164
164
|
}); });
|
|
165
165
|
var components = react_1.useMemo(function () { return ({
|
|
166
|
-
Header: styles_1.StyledMenuListPadding,
|
|
167
|
-
Footer: styles_1.StyledMenuListPadding,
|
|
166
|
+
Header: disablePadding ? undefined : styles_1.StyledMenuListPadding,
|
|
167
|
+
Footer: disablePadding ? undefined : styles_1.StyledMenuListPadding,
|
|
168
168
|
List: react_1.default.forwardRef(function (_a, listRef) {
|
|
169
169
|
var children = _a.children, listRest = tslib_1.__rest(_a, ["children"]);
|
|
170
170
|
var toRef = foundation_1.useForkRef(handleRef, listRef);
|
|
@@ -3,6 +3,6 @@ import { css, palette2, spacing } from '../../../../foundation';
|
|
|
3
3
|
import { getRcDialogContentSpacings, RcDialogContentClasses } from '../utils';
|
|
4
4
|
export var DialogContentStyle = function (props) {
|
|
5
5
|
var size = props.size, dividers = props.dividers;
|
|
6
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", ";\n\n &.", " {\n border-color: ", ";\n }\n "], ["\n padding: ", ";\n\n &.", " {\n border-color: ", ";\n }\n "])), spacing.apply(void 0, __spread(getRcDialogContentSpacings(dividers)[size])), RcDialogContentClasses.dividers, palette2('neutral', 'l02'));
|
|
6
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", ";\n color: ", ";\n\n &.", " {\n border-color: ", ";\n }\n "], ["\n padding: ", ";\n color: ", ";\n\n &.", " {\n border-color: ", ";\n }\n "])), spacing.apply(void 0, __spread(getRcDialogContentSpacings(dividers)[size])), palette2('neutral', 'f04'), RcDialogContentClasses.dividers, palette2('neutral', 'l02'));
|
|
7
7
|
};
|
|
8
8
|
var templateObject_1;
|
|
@@ -6,17 +6,15 @@ var ThrottleScheduler = /** @class */ (function () {
|
|
|
6
6
|
var _this = this;
|
|
7
7
|
if (!this._timeoutID) {
|
|
8
8
|
this._timeoutID = window.setTimeout(function () {
|
|
9
|
-
|
|
10
|
-
_this.
|
|
9
|
+
var _a;
|
|
10
|
+
_this._timeoutID = undefined;
|
|
11
|
+
(_a = _this._lastTask) === null || _a === void 0 ? void 0 : _a.call(_this);
|
|
11
12
|
});
|
|
12
13
|
}
|
|
13
14
|
this._lastTask = task;
|
|
14
15
|
};
|
|
15
16
|
ThrottleScheduler.prototype.clear = function () {
|
|
16
17
|
window.clearTimeout(this._timeoutID);
|
|
17
|
-
this._reset();
|
|
18
|
-
};
|
|
19
|
-
ThrottleScheduler.prototype._reset = function () {
|
|
20
18
|
this._lastTask = null;
|
|
21
19
|
this._timeoutID = undefined;
|
|
22
20
|
};
|
|
@@ -12,6 +12,8 @@ import { RcTableContext } from '../context';
|
|
|
12
12
|
var _RcTableCell = forwardRef(function (props, ref) {
|
|
13
13
|
var _a = useThemeProps({ props: props, name: 'RcTableCell' }), classesProp = _a.classes, childrenProp = _a.children, size = _a.size, sortDirection = _a.sortDirection, _b = _a.activeSort, activeSort = _b === void 0 ? false : _b, rest = __rest(_a, ["classes", "children", "size", "sortDirection", "activeSort"]);
|
|
14
14
|
var classes = combineClasses(RcTableCellClasses, classesProp);
|
|
15
|
+
// prevent mui classes warning
|
|
16
|
+
var sortButton = classes.sortButton, activeSortClass = classes.activeSort, sortIcon = classes.sortIcon, tableCellClasses = __rest(classes, ["sortButton", "activeSort", "sortIcon"]);
|
|
15
17
|
var children = useMemo(function () {
|
|
16
18
|
var _a;
|
|
17
19
|
if (sortDirection) {
|
|
@@ -23,7 +25,7 @@ var _RcTableCell = forwardRef(function (props, ref) {
|
|
|
23
25
|
}
|
|
24
26
|
return childrenProp;
|
|
25
27
|
}, [activeSort, childrenProp, classes, sortDirection]);
|
|
26
|
-
return (React.createElement(MuiTableCell, __assign({}, rest, (sortDirection ? { sortDirection: sortDirection } : {}), { ref: ref, classes:
|
|
28
|
+
return (React.createElement(MuiTableCell, __assign({}, rest, (sortDirection ? { sortDirection: sortDirection } : {}), { ref: ref, classes: tableCellClasses }), children));
|
|
27
29
|
});
|
|
28
30
|
var RcTableCell = styled(_RcTableCell).attrs(function (_a) {
|
|
29
31
|
var _b;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { __makeTemplateObject } from "tslib";
|
|
2
2
|
import { css, fakeBorder, focusVisible, palette2, px, spacing, typography, } from '../../../../foundation';
|
|
3
|
-
import { RcIcon } from '../../../Icon';
|
|
4
3
|
import { RcTableCellClasses } from '../utils';
|
|
5
4
|
var SizeMap = {
|
|
6
5
|
large: 56,
|
|
@@ -9,6 +8,6 @@ var SizeMap = {
|
|
|
9
8
|
};
|
|
10
9
|
export var TableCellStyle = function (prop) {
|
|
11
10
|
var size = prop.size, sortDirection = prop.sortDirection;
|
|
12
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n box-sizing: border-box;\n padding: ", ";\n min-width: 96px;\n\n &.", " {\n ", "\n height: 40px;\n border-bottom: 1px solid ", ";\n color: ", ";\n background-color: ", ";\n\n padding: ", ";\n\n .", " {\n opacity: 0;\n padding: ", ";\n }\n\n .", " {\n color: ", ";\n\n .", " {\n opacity: 1;\n }\n }\n\n .", " {\n display: inline-flex;\n justify-content: flex-start;\n flex-direction: inherit;\n align-items: center;\n\n height: 100%;\n width: 100%;\n padding: ", ";\n\n ", " {\n color: ", ";\n }\n\n &:hover {\n background-color: ", ";\n\n .", " {\n opacity: 1;\n }\n }\n\n ", " {\n ", "\n background-color: ", ";\n }\n }\n }\n\n &.", " {\n ", "\n color: ", ";\n\n padding: ", ";\n height: ", ";\n }\n "], ["\n box-sizing: border-box;\n padding: ", ";\n min-width: 96px;\n\n &.", " {\n ", "\n height: 40px;\n border-bottom: 1px solid ", ";\n color: ", ";\n background-color: ", ";\n\n padding: ", ";\n\n .", " {\n opacity: 0;\n padding: ", ";\n }\n\n .", " {\n color: ", ";\n\n .", " {\n opacity: 1;\n }\n }\n\n .", " {\n display: inline-flex;\n justify-content: flex-start;\n flex-direction: inherit;\n align-items: center;\n\n height: 100%;\n width: 100%;\n padding: ", ";\n\n ", " {\n color: ", ";\n }\n\n &:hover {\n background-color: ", ";\n\n .", " {\n opacity: 1;\n }\n }\n\n ", " {\n ", "\n background-color: ", ";\n }\n }\n }\n\n &.", " {\n ", "\n color: ", ";\n\n padding: ", ";\n height: ", ";\n }\n "])), spacing(0, 2), RcTableCellClasses.head, typography('caption2'), palette2('neutral', 'l02'), palette2('neutral', 'f05'), palette2('neutral', 'b02'), Boolean(sortDirection) && 'unset', RcTableCellClasses.sortIcon, spacing(0, 2), RcTableCellClasses.activeSort, palette2('interactive', 'f01'), RcTableCellClasses.sortIcon, RcTableCellClasses.sortButton, spacing(0, 2),
|
|
11
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n box-sizing: border-box;\n padding: ", ";\n min-width: 96px;\n\n &.", " {\n min-width: unset;\n padding: ", ";\n }\n\n &.", " {\n padding: unset;\n }\n\n &.", " {\n ", "\n height: 40px;\n border-bottom: 1px solid ", ";\n color: ", ";\n background-color: ", ";\n\n padding: ", ";\n\n .", " {\n opacity: 0;\n padding: ", ";\n }\n\n .", " {\n color: ", ";\n\n .", " {\n opacity: 1;\n color: ", ";\n }\n }\n\n .", " {\n display: inline-flex;\n justify-content: flex-start;\n flex-direction: inherit;\n align-items: center;\n\n height: 100%;\n width: 100%;\n padding: ", ";\n\n ", " {\n color: ", ";\n }\n\n &:hover {\n background-color: ", ";\n\n .", " {\n opacity: 1;\n }\n }\n\n ", " {\n ", "\n background-color: ", ";\n }\n }\n }\n\n &.", " {\n ", "\n color: ", ";\n\n padding: ", ";\n height: ", ";\n }\n "], ["\n box-sizing: border-box;\n padding: ", ";\n min-width: 96px;\n\n &.", " {\n min-width: unset;\n padding: ", ";\n }\n\n &.", " {\n padding: unset;\n }\n\n &.", " {\n ", "\n height: 40px;\n border-bottom: 1px solid ", ";\n color: ", ";\n background-color: ", ";\n\n padding: ", ";\n\n .", " {\n opacity: 0;\n padding: ", ";\n }\n\n .", " {\n color: ", ";\n\n .", " {\n opacity: 1;\n color: ", ";\n }\n }\n\n .", " {\n display: inline-flex;\n justify-content: flex-start;\n flex-direction: inherit;\n align-items: center;\n\n height: 100%;\n width: 100%;\n padding: ", ";\n\n ", " {\n color: ", ";\n }\n\n &:hover {\n background-color: ", ";\n\n .", " {\n opacity: 1;\n }\n }\n\n ", " {\n ", "\n background-color: ", ";\n }\n }\n }\n\n &.", " {\n ", "\n color: ", ";\n\n padding: ", ";\n height: ", ";\n }\n "])), spacing(0, 2), RcTableCellClasses.paddingCheckbox, spacing(0, 0, 0, 2), RcTableCellClasses.paddingNone, RcTableCellClasses.head, typography('caption2'), palette2('neutral', 'l02'), palette2('neutral', 'f05'), palette2('neutral', 'b02'), Boolean(sortDirection) && 'unset', RcTableCellClasses.sortIcon, spacing(0, 2), RcTableCellClasses.activeSort, palette2('interactive', 'f01'), RcTableCellClasses.sortIcon, palette2('neutral', 'f04'), RcTableCellClasses.sortButton, spacing(0, 2), RcTableCellClasses.sortIcon, palette2('neutral', 'f04'), palette2('neutral', 'b03'), RcTableCellClasses.sortIcon, focusVisible, fakeBorder({ color: palette2('interactive', 'f01') }), palette2('neutral', 'b03'), RcTableCellClasses.body, typography('body1'), palette2('neutral', 'f06'), size === 'auto' && spacing(3, 2), size !== 'auto' && px(SizeMap[size]));
|
|
13
12
|
};
|
|
14
13
|
var templateObject_1;
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import { RcClasses } from '../../../../foundation';
|
|
2
|
-
export var RcTableCellClasses = RcClasses([
|
|
2
|
+
export var RcTableCellClasses = RcClasses([
|
|
3
|
+
'head',
|
|
4
|
+
'body',
|
|
5
|
+
'sortIcon',
|
|
6
|
+
'activeSort',
|
|
7
|
+
'sortButton',
|
|
8
|
+
'paddingCheckbox',
|
|
9
|
+
'paddingNone',
|
|
10
|
+
], 'RcTableCell');
|
|
@@ -7,7 +7,7 @@ var _RcTableContainer = forwardRef(function (props, ref) {
|
|
|
7
7
|
var _a = useThemeProps({
|
|
8
8
|
props: props,
|
|
9
9
|
name: 'RcTableContainer',
|
|
10
|
-
}), children = _a.children, bordered = _a.bordered, rest = __rest(_a, ["children", "bordered"]);
|
|
10
|
+
}), children = _a.children, bordered = _a.bordered, square = _a.square, rest = __rest(_a, ["children", "bordered", "square"]);
|
|
11
11
|
return (React.createElement(MuiTableContainer, __assign({}, rest, { ref: ref }), children));
|
|
12
12
|
});
|
|
13
13
|
var RcTableContainer = styled(_RcTableContainer)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), TableContainerStyle);
|
|
@@ -9,7 +9,8 @@ var _RcTableRow = forwardRef(function (props, ref) {
|
|
|
9
9
|
var _a;
|
|
10
10
|
var _b = useThemeProps({ props: props, name: 'RcTableRow' }), className = _b.className, classesProp = _b.classes, children = _b.children, disabled = _b.disabled, rest = __rest(_b, ["className", "classes", "children", "disabled"]);
|
|
11
11
|
var classes = useMemo(function () { return combineClasses(RcTableRowClasses, classesProp); }, [classesProp]);
|
|
12
|
-
|
|
12
|
+
var disabledClass = classes.disabled, tableRowClasses = __rest(classes, ["disabled"]);
|
|
13
|
+
return (React.createElement(MuiTableRow, __assign({}, rest, { ref: ref, classes: tableRowClasses, className: clsx(className, (_a = {}, _a[disabledClass] = disabled, _a)) }), children));
|
|
13
14
|
});
|
|
14
15
|
var RcTableRow = styled(_RcTableRow)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), TableRowStyle);
|
|
15
16
|
RcTableRow.defaultProps = {};
|
|
@@ -11,7 +11,7 @@ var _RcVirtualizedMenuList = forwardRef(function (inProps, ref) {
|
|
|
11
11
|
props: inProps,
|
|
12
12
|
name: 'RcVirtualizedMenuList',
|
|
13
13
|
});
|
|
14
|
-
var action = props.action, _a = props.autoFocus, autoFocus = _a === void 0 ? false : _a, VirtuosoProps = props.VirtuosoProps, _b = props.autoFocusItem, autoFocusItem = _b === void 0 ? false : _b, childrenProp = props.children, className = props.className, classes = props.classes, _c = props.disabledItemsFocusable, disabledItemsFocusable = _c === void 0 ? false : _c, _d = props.disableListWrap, disableListWrap = _d === void 0 ? false : _d, _e = props.variant, variant = _e === void 0 ? 'selectedMenu' : _e, _f = props.maxHeight, maxHeight = _f === void 0 ? '100%' : _f, autoClose = props.autoClose, position = props.position, onClose = props.onClose, rest = __rest(props, ["action", "autoFocus", "VirtuosoProps", "autoFocusItem", "children", "className", "classes", "disabledItemsFocusable", "disableListWrap", "variant", "maxHeight", "autoClose", "position", "onClose"]);
|
|
14
|
+
var action = props.action, disablePadding = props.disablePadding, _a = props.autoFocus, autoFocus = _a === void 0 ? false : _a, VirtuosoProps = props.VirtuosoProps, _b = props.autoFocusItem, autoFocusItem = _b === void 0 ? false : _b, childrenProp = props.children, className = props.className, classes = props.classes, _c = props.disabledItemsFocusable, disabledItemsFocusable = _c === void 0 ? false : _c, _d = props.disableListWrap, disableListWrap = _d === void 0 ? false : _d, _e = props.variant, variant = _e === void 0 ? 'selectedMenu' : _e, _f = props.maxHeight, maxHeight = _f === void 0 ? '100%' : _f, autoClose = props.autoClose, position = props.position, onClose = props.onClose, rest = __rest(props, ["action", "disablePadding", "autoFocus", "VirtuosoProps", "autoFocusItem", "children", "className", "classes", "disabledItemsFocusable", "disableListWrap", "variant", "maxHeight", "autoClose", "position", "onClose"]);
|
|
15
15
|
var theme = useTheme();
|
|
16
16
|
var document = useRcPortalWindowContext().document;
|
|
17
17
|
var vlRef = useRef(null);
|
|
@@ -161,8 +161,8 @@ var _RcVirtualizedMenuList = forwardRef(function (inProps, ref) {
|
|
|
161
161
|
},
|
|
162
162
|
}); });
|
|
163
163
|
var components = useMemo(function () { return ({
|
|
164
|
-
Header: StyledMenuListPadding,
|
|
165
|
-
Footer: StyledMenuListPadding,
|
|
164
|
+
Header: disablePadding ? undefined : StyledMenuListPadding,
|
|
165
|
+
Footer: disablePadding ? undefined : StyledMenuListPadding,
|
|
166
166
|
List: React.forwardRef(function (_a, listRef) {
|
|
167
167
|
var children = _a.children, listRest = __rest(_a, ["children"]);
|
|
168
168
|
var toRef = useForkRef(handleRef, listRef);
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useEventCallback } from '../useEventCallback';
|
|
2
|
+
var defaultCheckKeys = ['Enter', ' '];
|
|
2
3
|
/**
|
|
3
4
|
* bind event with a11y keyboard, `space`, `enter`, only trigger when key includes in `checkKeys`
|
|
4
5
|
*
|
|
5
6
|
* that will auto preventDefault by default, if you don't want that, set `false` with `preventDefault`
|
|
6
7
|
*/
|
|
7
8
|
export var useA11yKeyEvent = function (fn, _a) {
|
|
8
|
-
var _b = _a === void 0 ? {} : _a, onlyOnFocus = _b.onlyOnFocus, _c = _b.preventDefault, preventDefault = _c === void 0 ? true : _c, _d = _b.checkKeys, checkKeys = _d === void 0 ?
|
|
9
|
+
var _b = _a === void 0 ? {} : _a, onlyOnFocus = _b.onlyOnFocus, _c = _b.preventDefault, preventDefault = _c === void 0 ? true : _c, _d = _b.checkKeys, checkKeys = _d === void 0 ? defaultCheckKeys : _d;
|
|
9
10
|
return useEventCallback(function (event) {
|
|
10
11
|
if (!fn || (onlyOnFocus && event.target !== event.currentTarget))
|
|
11
12
|
return;
|
|
12
|
-
|
|
13
|
-
if (checkKeys.includes(key)) {
|
|
13
|
+
if (checkKeys.includes(event.key)) {
|
|
14
14
|
if (preventDefault)
|
|
15
15
|
event.preventDefault();
|
|
16
16
|
fn(event);
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var useEventCallback_1 = require("../useEventCallback");
|
|
4
|
+
var defaultCheckKeys = ['Enter', ' '];
|
|
4
5
|
/**
|
|
5
6
|
* bind event with a11y keyboard, `space`, `enter`, only trigger when key includes in `checkKeys`
|
|
6
7
|
*
|
|
7
8
|
* that will auto preventDefault by default, if you don't want that, set `false` with `preventDefault`
|
|
8
9
|
*/
|
|
9
10
|
exports.useA11yKeyEvent = function (fn, _a) {
|
|
10
|
-
var _b = _a === void 0 ? {} : _a, onlyOnFocus = _b.onlyOnFocus, _c = _b.preventDefault, preventDefault = _c === void 0 ? true : _c, _d = _b.checkKeys, checkKeys = _d === void 0 ?
|
|
11
|
+
var _b = _a === void 0 ? {} : _a, onlyOnFocus = _b.onlyOnFocus, _c = _b.preventDefault, preventDefault = _c === void 0 ? true : _c, _d = _b.checkKeys, checkKeys = _d === void 0 ? defaultCheckKeys : _d;
|
|
11
12
|
return useEventCallback_1.useEventCallback(function (event) {
|
|
12
13
|
if (!fn || (onlyOnFocus && event.target !== event.currentTarget))
|
|
13
14
|
return;
|
|
14
|
-
|
|
15
|
-
if (checkKeys.includes(key)) {
|
|
15
|
+
if (checkKeys.includes(event.key)) {
|
|
16
16
|
if (preventDefault)
|
|
17
17
|
event.preventDefault();
|
|
18
18
|
fn(event);
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ringcentral/juno",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.6",
|
|
4
4
|
"author": "RingCentral",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"main": "./index.js",
|
|
7
|
+
"module": "./es6/index.js",
|
|
8
|
+
"typings": "./index.d.ts",
|
|
6
9
|
"bugs": {
|
|
7
10
|
"url": "https://github.com/ringcentral/juno/issues"
|
|
8
11
|
},
|