1 | "use strict";
|
2 |
|
3 | var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
4 |
|
5 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
6 |
|
7 | Object.defineProperty(exports, "__esModule", {
|
8 | value: true
|
9 | });
|
10 | exports.default = exports.styles = void 0;
|
11 |
|
12 | var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
13 |
|
14 | var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
15 |
|
16 | var React = _interopRequireWildcard(require("react"));
|
17 |
|
18 | var _propTypes = _interopRequireDefault(require("prop-types"));
|
19 |
|
20 | var _clsx = _interopRequireDefault(require("clsx"));
|
21 |
|
22 | var _withStyles = _interopRequireDefault(require("../styles/withStyles"));
|
23 |
|
24 | var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
25 |
|
26 | var styles = function styles(theme) {
|
27 | return {
|
28 |
|
29 | root: {
|
30 | boxSizing: 'border-box',
|
31 | lineHeight: '48px',
|
32 | listStyle: 'none',
|
33 | color: theme.palette.text.secondary,
|
34 | fontFamily: theme.typography.fontFamily,
|
35 | fontWeight: theme.typography.fontWeightMedium,
|
36 | fontSize: theme.typography.pxToRem(14)
|
37 | },
|
38 |
|
39 |
|
40 | colorPrimary: {
|
41 | color: theme.palette.primary.main
|
42 | },
|
43 |
|
44 |
|
45 | colorInherit: {
|
46 | color: 'inherit'
|
47 | },
|
48 |
|
49 |
|
50 | gutters: {
|
51 | paddingLeft: 16,
|
52 | paddingRight: 16
|
53 | },
|
54 |
|
55 |
|
56 | inset: {
|
57 | paddingLeft: 72
|
58 | },
|
59 |
|
60 |
|
61 | sticky: {
|
62 | position: 'sticky',
|
63 | top: 0,
|
64 | zIndex: 1,
|
65 | backgroundColor: 'inherit'
|
66 | }
|
67 | };
|
68 | };
|
69 |
|
70 | exports.styles = styles;
|
71 | var ListSubheader = React.forwardRef(function ListSubheader(props, ref) {
|
72 | var classes = props.classes,
|
73 | className = props.className,
|
74 | _props$color = props.color,
|
75 | color = _props$color === void 0 ? 'default' : _props$color,
|
76 | _props$component = props.component,
|
77 | Component = _props$component === void 0 ? 'li' : _props$component,
|
78 | _props$disableGutters = props.disableGutters,
|
79 | disableGutters = _props$disableGutters === void 0 ? false : _props$disableGutters,
|
80 | _props$disableSticky = props.disableSticky,
|
81 | disableSticky = _props$disableSticky === void 0 ? false : _props$disableSticky,
|
82 | _props$inset = props.inset,
|
83 | inset = _props$inset === void 0 ? false : _props$inset,
|
84 | other = (0, _objectWithoutProperties2.default)(props, ["classes", "className", "color", "component", "disableGutters", "disableSticky", "inset"]);
|
85 | return React.createElement(Component, (0, _extends2.default)({
|
86 | className: (0, _clsx.default)(classes.root, className, color !== 'default' && classes["color".concat((0, _capitalize.default)(color))], inset && classes.inset, !disableSticky && classes.sticky, !disableGutters && classes.gutters),
|
87 | ref: ref
|
88 | }, other));
|
89 | });
|
90 | process.env.NODE_ENV !== "production" ? ListSubheader.propTypes = {
|
91 | |
92 |
|
93 |
|
94 | children: _propTypes.default.node,
|
95 |
|
96 | |
97 |
|
98 |
|
99 |
|
100 | classes: _propTypes.default.object.isRequired,
|
101 |
|
102 | |
103 |
|
104 |
|
105 | className: _propTypes.default.string,
|
106 |
|
107 | |
108 |
|
109 |
|
110 | color: _propTypes.default.oneOf(['default', 'primary', 'inherit']),
|
111 |
|
112 | |
113 |
|
114 |
|
115 |
|
116 | component: _propTypes.default
|
117 |
|
118 | .elementType,
|
119 |
|
120 | |
121 |
|
122 |
|
123 | disableGutters: _propTypes.default.bool,
|
124 |
|
125 | |
126 |
|
127 |
|
128 | disableSticky: _propTypes.default.bool,
|
129 |
|
130 | |
131 |
|
132 |
|
133 | inset: _propTypes.default.bool
|
134 | } : void 0;
|
135 |
|
136 | var _default = (0, _withStyles.default)(styles, {
|
137 | name: 'MuiListSubheader'
|
138 | })(ListSubheader);
|
139 |
|
140 | exports.default = _default; |
\ | No newline at end of file |