@comet/admin-react-select 2.0.1-canary.89.0 → 2.2.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.
@@ -1,270 +1,215 @@
1
1
  "use strict";
2
-
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
28
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
29
+ if (k2 === undefined) k2 = k;
30
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
31
+ }) : (function(o, m, k, k2) {
32
+ if (k2 === undefined) k2 = k;
33
+ o[k2] = m[k];
34
+ }));
35
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
36
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
37
+ }) : function(o, v) {
38
+ o["default"] = v;
7
39
  });
8
- exports.ControlInput = void 0;
9
- exports.ReactSelect = ReactSelect;
10
- exports.ReactSelectAsync = ReactSelectAsync;
11
- exports.ReactSelectAsyncCreatable = ReactSelectAsyncCreatable;
12
- exports.ReactSelectCreatable = ReactSelectCreatable;
13
-
14
- var _Cancel = _interopRequireDefault(require("@mui/icons-material/Cancel"));
15
-
16
- var _Clear = _interopRequireDefault(require("@mui/icons-material/Clear"));
17
-
18
- var _KeyboardArrowDown = _interopRequireDefault(require("@mui/icons-material/KeyboardArrowDown"));
19
-
20
- var _material = require("@mui/material");
21
-
22
- var _styles = require("@mui/styles");
23
-
24
- var _classnames = _interopRequireDefault(require("classnames"));
25
-
26
- var React = _interopRequireWildcard(require("react"));
27
-
28
- var _reactSelect = _interopRequireDefault(require("react-select"));
29
-
30
- var _async = _interopRequireDefault(require("react-select/async"));
31
-
32
- var _asyncCreatable = _interopRequireDefault(require("react-select/async-creatable"));
33
-
34
- var _creatable = _interopRequireDefault(require("react-select/creatable"));
35
-
36
- var _ReactSelect = _interopRequireDefault(require("./ReactSelect.styles"));
37
-
38
- var _excluded = ["inputRef"],
39
- _excluded2 = ["classes", "theme", "components", "selectComponent"];
40
-
41
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
42
-
43
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
44
-
45
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
46
-
47
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
48
-
49
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
50
-
51
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
52
-
53
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
54
-
55
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
56
-
57
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
58
-
40
+ var __importStar = (this && this.__importStar) || function (mod) {
41
+ if (mod && mod.__esModule) return mod;
42
+ var result = {};
43
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
44
+ __setModuleDefault(result, mod);
45
+ return result;
46
+ };
47
+ var __rest = (this && this.__rest) || function (s, e) {
48
+ var t = {};
49
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
50
+ t[p] = s[p];
51
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
52
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
53
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
54
+ t[p[i]] = s[p[i]];
55
+ }
56
+ return t;
57
+ };
58
+ var __importDefault = (this && this.__importDefault) || function (mod) {
59
+ return (mod && mod.__esModule) ? mod : { "default": mod };
60
+ };
61
+ Object.defineProperty(exports, "__esModule", { value: true });
62
+ exports.ReactSelectAsyncCreatable = exports.ReactSelectCreatable = exports.ReactSelectAsync = exports.ReactSelect = exports.ControlInput = void 0;
63
+ var core_1 = require("@material-ui/core");
64
+ var zIndex_1 = __importDefault(require("@material-ui/core/styles/zIndex"));
65
+ var Cancel_1 = __importDefault(require("@material-ui/icons/Cancel"));
66
+ var Clear_1 = __importDefault(require("@material-ui/icons/Clear"));
67
+ var KeyboardArrowDown_1 = __importDefault(require("@material-ui/icons/KeyboardArrowDown"));
68
+ var styles_1 = require("@material-ui/styles");
69
+ var classnames_1 = __importDefault(require("classnames"));
70
+ var React = __importStar(require("react"));
71
+ var react_select_1 = __importDefault(require("react-select"));
72
+ var async_1 = __importDefault(require("react-select/async"));
73
+ var async_creatable_1 = __importDefault(require("react-select/async-creatable"));
74
+ var creatable_1 = __importDefault(require("react-select/creatable"));
75
+ var ReactSelect_styles_1 = __importDefault(require("./ReactSelect.styles"));
59
76
  function NoOptionsMessage(props) {
60
- return /*#__PURE__*/React.createElement(_material.Typography, _extends({
61
- className: props.selectProps.classes.noOptionsMessage
62
- }, props.innerProps), props.children);
77
+ return (React.createElement(core_1.Typography, __assign({ className: props.selectProps.classes.noOptionsMessage }, props.innerProps), props.children));
63
78
  }
64
-
65
- function inputComponent(_ref) {
66
- var inputRef = _ref.inputRef,
67
- props = _objectWithoutProperties(_ref, _excluded);
68
-
69
- return /*#__PURE__*/React.createElement("div", _extends({
70
- ref: inputRef
71
- }, props));
79
+ function inputComponent(_a) {
80
+ var inputRef = _a.inputRef, props = __rest(_a, ["inputRef"]);
81
+ return React.createElement("div", __assign({ ref: inputRef }, props));
72
82
  }
73
-
74
- var ControlInput = function ControlInput(_ref2) {
75
- var props = _extends({}, _ref2);
76
-
77
- return /*#__PURE__*/React.createElement(_material.InputBase, _extends({
78
- classes: {
79
- root: "root",
80
- focused: "focused"
81
- }
82
- }, props));
83
+ var ControlInput = function (_a) {
84
+ var props = __rest(_a, []);
85
+ return React.createElement(core_1.InputBase, __assign({ classes: { root: "root", focused: "focused" } }, props));
83
86
  };
84
-
85
87
  exports.ControlInput = ControlInput;
86
-
87
88
  function Control(props) {
88
- var InputProps = {
89
- inputComponent: inputComponent,
90
- inputProps: _objectSpread({
91
- className: props.selectProps.classes.input,
92
- inputRef: props.innerRef,
93
- children: props.children
94
- }, props.innerProps)
95
- };
96
- return /*#__PURE__*/React.createElement(ControlInput, _extends({
97
- type: "text",
98
- fullWidth: true
99
- }, InputProps, props.selectProps.textFieldProps));
89
+ var InputProps = {
90
+ inputComponent: inputComponent,
91
+ inputProps: __assign({ className: props.selectProps.classes.input, inputRef: props.innerRef, children: props.children }, props.innerProps),
92
+ };
93
+ return React.createElement(exports.ControlInput, __assign({ type: "text", fullWidth: true }, InputProps, props.selectProps.textFieldProps));
100
94
  }
101
-
102
95
  function Option(props) {
103
- var rootClasses = [props.selectProps.classes.option];
104
- if (props.isFocused) rootClasses.push(props.selectProps.classes.optionFocused);
105
- if (props.isSelected) rootClasses.push(props.selectProps.classes.optionSelected);
106
- return /*#__PURE__*/React.createElement(_material.MenuItem, _extends({
107
- classes: {
108
- root: rootClasses.join(" ")
109
- },
110
- ref: props.innerRef,
111
- selected: props.isSelected,
112
- disabled: props.isDisabled,
113
- component: "div"
114
- }, props.innerProps), props.children);
96
+ var rootClasses = [props.selectProps.classes.option];
97
+ if (props.isFocused)
98
+ rootClasses.push(props.selectProps.classes.optionFocused);
99
+ if (props.isSelected)
100
+ rootClasses.push(props.selectProps.classes.optionSelected);
101
+ return (React.createElement(core_1.MenuItem, __assign({ classes: { root: rootClasses.join(" ") }, buttonRef: props.innerRef, selected: props.isSelected, disabled: props.isDisabled, component: "div" }, props.innerProps), props.children));
115
102
  }
116
-
117
103
  function Placeholder(props) {
118
- return /*#__PURE__*/React.createElement("div", _extends({
119
- className: props.selectProps.classes.placeholder
120
- }, props.innerProps), props.children);
104
+ return (React.createElement("div", __assign({ className: props.selectProps.classes.placeholder }, props.innerProps), props.children));
121
105
  }
122
-
123
106
  function SingleValue(props) {
124
- return /*#__PURE__*/React.createElement("div", _extends({
125
- className: props.selectProps.classes.singleValue
126
- }, props.innerProps), props.children);
107
+ return (React.createElement("div", __assign({ className: props.selectProps.classes.singleValue }, props.innerProps), props.children));
127
108
  }
128
-
129
109
  function ValueContainer(props) {
130
- return /*#__PURE__*/React.createElement("div", {
131
- className: props.selectProps.classes.valueContainer
132
- }, props.children);
110
+ return React.createElement("div", { className: props.selectProps.classes.valueContainer }, props.children);
133
111
  }
134
-
135
112
  function MultiValue(props) {
136
- return /*#__PURE__*/React.createElement(_material.Chip, {
137
- tabIndex: -1,
138
- label: props.children,
139
- className: (0, _classnames["default"])(props.selectProps.classes.chip, _defineProperty({}, props.selectProps.classes.chipFocused, props.isFocused)),
140
- onDelete: props.removeProps.onClick,
141
- deleteIcon: /*#__PURE__*/React.createElement(_Cancel["default"], props.removeProps)
142
- });
113
+ var _a;
114
+ return (React.createElement(core_1.Chip, { tabIndex: -1, label: props.children, className: classnames_1.default(props.selectProps.classes.chip, (_a = {},
115
+ _a[props.selectProps.classes.chipFocused] = props.isFocused,
116
+ _a)), onDelete: props.removeProps.onClick, deleteIcon: React.createElement(Cancel_1.default, __assign({}, props.removeProps)) }));
143
117
  }
144
-
145
118
  function Menu(props) {
146
- return /*#__PURE__*/React.createElement(_material.Paper, _extends({
147
- className: props.selectProps.classes.paper
148
- }, props.innerProps), props.children);
119
+ return (React.createElement(core_1.Paper, __assign({ className: props.selectProps.classes.paper }, props.innerProps), props.children));
149
120
  }
150
-
151
121
  function IndicatorsContainer(props) {
152
- return /*#__PURE__*/React.createElement("div", {
153
- className: props.selectProps.classes.indicatorsContainer
154
- }, props.children);
122
+ return React.createElement("div", { className: props.selectProps.classes.indicatorsContainer }, props.children);
155
123
  }
156
-
157
124
  function IndicatorSeparator(props) {
158
- return /*#__PURE__*/React.createElement("span", {
159
- className: props.selectProps.classes.indicatorSeparator
160
- });
125
+ return React.createElement("span", { className: props.selectProps.classes.indicatorSeparator });
126
+ }
127
+ function ClearIndicator(_a) {
128
+ var selectProps = _a.selectProps, clearValue = _a.clearValue;
129
+ var Icon = selectProps.clearIcon ? selectProps.clearIcon : Clear_1.default;
130
+ return (React.createElement("div", { className: selectProps.classes.indicator + " " + selectProps.classes.clearIndicator, onClick: clearValue },
131
+ React.createElement(Icon, { fontSize: "inherit", color: "inherit" })));
132
+ }
133
+ function DropdownIndicator(_a) {
134
+ var selectProps = _a.selectProps;
135
+ var DefaultIcon = selectProps.dropdownIcon ? selectProps.dropdownIcon : KeyboardArrowDown_1.default;
136
+ var OpenIcon = selectProps.dropdownIconOpen ? selectProps.dropdownIconOpen : KeyboardArrowDown_1.default;
137
+ var Icon = selectProps.menuIsOpen ? OpenIcon : DefaultIcon;
138
+ return (React.createElement("div", { className: selectProps.classes.indicator + " " + selectProps.classes.dropdownIndicator },
139
+ React.createElement(Icon, { fontSize: "inherit", color: "inherit" })));
161
140
  }
162
-
163
- function ClearIndicator(_ref3) {
164
- var selectProps = _ref3.selectProps,
165
- clearValue = _ref3.clearValue;
166
- var Icon = selectProps.clearIcon ? selectProps.clearIcon : _Clear["default"];
167
- return /*#__PURE__*/React.createElement("div", {
168
- className: "".concat(selectProps.classes.indicator, " ").concat(selectProps.classes.clearIndicator),
169
- onClick: clearValue
170
- }, /*#__PURE__*/React.createElement(Icon, {
171
- fontSize: "inherit",
172
- color: "inherit"
173
- }));
174
- }
175
-
176
- function DropdownIndicator(_ref4) {
177
- var selectProps = _ref4.selectProps;
178
- var DefaultIcon = selectProps.dropdownIcon ? selectProps.dropdownIcon : _KeyboardArrowDown["default"];
179
- var OpenIcon = selectProps.dropdownIconOpen ? selectProps.dropdownIconOpen : _KeyboardArrowDown["default"];
180
- var Icon = selectProps.menuIsOpen ? OpenIcon : DefaultIcon;
181
- return /*#__PURE__*/React.createElement("div", {
182
- className: "".concat(selectProps.classes.indicator, " ").concat(selectProps.classes.dropdownIndicator)
183
- }, /*#__PURE__*/React.createElement(Icon, {
184
- fontSize: "inherit",
185
- color: "inherit"
186
- }));
187
- }
188
-
189
141
  var components = {
190
- Control: Control,
191
- Menu: Menu,
192
- MultiValue: MultiValue,
193
- NoOptionsMessage: NoOptionsMessage,
194
- Option: Option,
195
- Placeholder: Placeholder,
196
- SingleValue: SingleValue,
197
- ValueContainer: ValueContainer,
198
- IndicatorsContainer: IndicatorsContainer,
199
- IndicatorSeparator: IndicatorSeparator,
200
- ClearIndicator: ClearIndicator,
201
- DropdownIndicator: DropdownIndicator
142
+ Control: Control,
143
+ Menu: Menu,
144
+ MultiValue: MultiValue,
145
+ NoOptionsMessage: NoOptionsMessage,
146
+ Option: Option,
147
+ Placeholder: Placeholder,
148
+ SingleValue: SingleValue,
149
+ ValueContainer: ValueContainer,
150
+ IndicatorsContainer: IndicatorsContainer,
151
+ IndicatorSeparator: IndicatorSeparator,
152
+ ClearIndicator: ClearIndicator,
153
+ DropdownIndicator: DropdownIndicator,
202
154
  };
203
-
204
- function SelectWrapper(_ref5) {
205
- var classes = _ref5.classes,
206
- theme = _ref5.theme,
207
- origComponents = _ref5.components,
208
- SelectComponent = _ref5.selectComponent,
209
- rest = _objectWithoutProperties(_ref5, _excluded2);
210
-
211
- return /*#__PURE__*/React.createElement(SelectComponent, _extends({
212
- classes: classes,
213
- menuPortalTarget: document.body,
214
- components: _objectSpread(_objectSpread({}, components), origComponents),
215
- placeholder: ""
216
- }, rest));
217
- }
218
-
219
- var ExtendedSelectWrapper = (0, _styles.withStyles)(_ReactSelect["default"], {
220
- name: "CometAdminSelect"
221
- })(SelectWrapper);
222
-
223
- var useReactSelectStyles = function useReactSelectStyles() {
224
- var _useTheme = (0, _material.useTheme)(),
225
- zIndex = _useTheme.zIndex;
226
-
227
- return {
228
- menuPortal: function menuPortal(styles) {
229
- return _objectSpread(_objectSpread({}, styles), {}, {
230
- zIndex: zIndex.modal
231
- });
155
+ var SelectWrapper = /** @class */ (function (_super) {
156
+ __extends(SelectWrapper, _super);
157
+ function SelectWrapper() {
158
+ return _super !== null && _super.apply(this, arguments) || this;
232
159
  }
233
- };
160
+ SelectWrapper.prototype.render = function () {
161
+ var _a = this.props, classes = _a.classes, theme = _a.theme, origComponents = _a.components, selectComponent = _a.selectComponent, rest = __rest(_a, ["classes", "theme", "components", "selectComponent"]);
162
+ var SelectComponent = this.props.selectComponent;
163
+ return (React.createElement(SelectComponent, __assign({ classes: classes, menuPortalTarget: document.body, components: __assign(__assign({}, components), origComponents), placeholder: "" }, rest)));
164
+ };
165
+ return SelectWrapper;
166
+ }(React.Component));
167
+ var ExtendedSelectWrapper = styles_1.withStyles(ReactSelect_styles_1.default, { name: "CometAdminSelect" })(SelectWrapper);
168
+ var reactSelectStyles = {
169
+ menuPortal: function (styles) { return (__assign(__assign({}, styles), { zIndex: zIndex_1.default.modal })); },
234
170
  };
235
-
236
- function ReactSelect(props) {
237
- var reactSelectStyles = useReactSelectStyles();
238
- return /*#__PURE__*/React.createElement(ExtendedSelectWrapper, _extends({
239
- selectComponent: _reactSelect["default"]
240
- }, props, {
241
- styles: _objectSpread({}, reactSelectStyles)
242
- }));
243
- }
244
-
245
- function ReactSelectAsync(props) {
246
- var reactSelectStyles = useReactSelectStyles();
247
- return /*#__PURE__*/React.createElement(ExtendedSelectWrapper, _extends({
248
- selectComponent: _async["default"]
249
- }, props, {
250
- styles: _objectSpread({}, reactSelectStyles)
251
- }));
252
- }
253
-
254
- function ReactSelectCreatable(props) {
255
- var reactSelectStyles = useReactSelectStyles();
256
- return /*#__PURE__*/React.createElement(ExtendedSelectWrapper, _extends({
257
- selectComponent: _creatable["default"]
258
- }, props, {
259
- styles: _objectSpread({}, reactSelectStyles)
260
- }));
261
- }
262
-
263
- function ReactSelectAsyncCreatable(props) {
264
- var reactSelectStyles = useReactSelectStyles();
265
- return /*#__PURE__*/React.createElement(ExtendedSelectWrapper, _extends({
266
- selectComponent: _asyncCreatable["default"]
267
- }, props, {
268
- styles: _objectSpread({}, reactSelectStyles)
269
- }));
270
- }
171
+ var ReactSelect = /** @class */ (function (_super) {
172
+ __extends(ReactSelect, _super);
173
+ function ReactSelect() {
174
+ return _super !== null && _super.apply(this, arguments) || this;
175
+ }
176
+ ReactSelect.prototype.render = function () {
177
+ return React.createElement(ExtendedSelectWrapper, __assign({ selectComponent: react_select_1.default }, this.props, { styles: __assign({}, reactSelectStyles) }));
178
+ };
179
+ return ReactSelect;
180
+ }(React.Component));
181
+ exports.ReactSelect = ReactSelect;
182
+ var ReactSelectAsync = /** @class */ (function (_super) {
183
+ __extends(ReactSelectAsync, _super);
184
+ function ReactSelectAsync() {
185
+ return _super !== null && _super.apply(this, arguments) || this;
186
+ }
187
+ ReactSelectAsync.prototype.render = function () {
188
+ return React.createElement(ExtendedSelectWrapper, __assign({ selectComponent: async_1.default }, this.props, { styles: __assign({}, reactSelectStyles) }));
189
+ };
190
+ return ReactSelectAsync;
191
+ }(React.Component));
192
+ exports.ReactSelectAsync = ReactSelectAsync;
193
+ var ReactSelectCreatable = /** @class */ (function (_super) {
194
+ __extends(ReactSelectCreatable, _super);
195
+ function ReactSelectCreatable() {
196
+ return _super !== null && _super.apply(this, arguments) || this;
197
+ }
198
+ ReactSelectCreatable.prototype.render = function () {
199
+ return React.createElement(ExtendedSelectWrapper, __assign({ selectComponent: creatable_1.default }, this.props, { styles: __assign({}, reactSelectStyles) }));
200
+ };
201
+ return ReactSelectCreatable;
202
+ }(React.Component));
203
+ exports.ReactSelectCreatable = ReactSelectCreatable;
204
+ var ReactSelectAsyncCreatable = /** @class */ (function (_super) {
205
+ __extends(ReactSelectAsyncCreatable, _super);
206
+ function ReactSelectAsyncCreatable() {
207
+ return _super !== null && _super.apply(this, arguments) || this;
208
+ }
209
+ ReactSelectAsyncCreatable.prototype.render = function () {
210
+ return React.createElement(ExtendedSelectWrapper, __assign({ selectComponent: async_creatable_1.default }, this.props, { styles: __assign({}, reactSelectStyles) }));
211
+ };
212
+ return ReactSelectAsyncCreatable;
213
+ }(React.Component));
214
+ exports.ReactSelectAsyncCreatable = ReactSelectAsyncCreatable;
215
+ //# sourceMappingURL=ReactSelect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReactSelect.js","sourceRoot":"","sources":["../src/ReactSelect.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAoH;AACpH,2EAAqD;AAErD,qEAAmD;AACnD,mEAAiD;AACjD,2FAAgE;AAChE,8CAAiD;AACjD,0DAAoC;AACpC,2CAA+B;AAC/B,8DAAkC;AAClC,6DAAiF;AACjF,iFAAgE;AAEhE,qEAA6F;AAU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IACL,gCAAC;AAAD,CAAC,AAND,CAAoF,KAAK,CAAC,SAAS,GAMlG;AANY,8DAAyB"}
@@ -1,4 +1,4 @@
1
- import { Theme } from "@mui/material";
1
+ import { Theme } from "@material-ui/core";
2
2
  export declare type SelectClassKey = "input" | "valueContainer" | "chip" | "chipFocused" | "noOptionsMessage" | "singleValue" | "placeholder" | "paper" | "indicatorsContainer" | "indicatorSeparator" | "clearIndicator" | "indicator" | "dropdownIndicator" | "option" | "optionSelected" | "optionFocused";
3
- declare const styles: (theme: Theme) => import("@mui/styles").StyleRules<Record<string, unknown>, SelectClassKey>;
3
+ declare const styles: (theme: Theme) => import("@material-ui/styles").StyleRules<any, SelectClassKey>;
4
4
  export default styles;
@@ -1,77 +1,69 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
-
8
- var _styles = require("@mui/material/styles");
9
-
10
- var _styles2 = require("@mui/styles");
11
-
12
- var styles = function styles(theme) {
13
- return (0, _styles2.createStyles)({
14
- input: {
15
- display: "flex",
16
- paddingRight: 0
17
- },
18
- valueContainer: {
19
- display: "flex",
20
- flexWrap: "nowrap",
21
- flex: 1,
22
- alignItems: "center",
23
- overflow: "hidden"
24
- },
25
- chip: {
26
- margin: "".concat(theme.spacing(0.5), " ").concat(theme.spacing(0.25))
27
- },
28
- chipFocused: {
29
- backgroundColor: (0, _styles.emphasize)(theme.palette.mode === "light" ? theme.palette.grey[300] : theme.palette.grey[700], 0.08)
30
- },
31
- noOptionsMessage: {
32
- padding: "".concat(theme.spacing(1), " ").concat(theme.spacing(2)),
33
- color: theme.palette.text.secondary
34
- },
35
- singleValue: {
36
- overflow: "hidden",
37
- textOverflow: "ellipsis",
38
- whiteSpace: "nowrap"
39
- },
40
- placeholder: {
41
- color: theme.palette.text.disabled
42
- },
43
- paper: {},
44
- indicatorsContainer: {
45
- display: "flex"
46
- },
47
- indicatorSeparator: {
48
- width: 1,
49
- flexGrow: 1,
50
- backgroundColor: theme.palette.divider
51
- },
52
- indicator: {
53
- display: "flex",
54
- alignItems: "center",
55
- justifyContent: "center",
56
- color: theme.palette.grey[500],
57
- width: 32,
58
- cursor: "pointer"
59
- },
60
- clearIndicator: {
61
- fontSize: 18
62
- },
63
- dropdownIndicator: {
64
- fontSize: 20
65
- },
66
- option: {},
67
- optionSelected: {
68
- fontWeight: theme.typography.fontWeightMedium
69
- },
70
- optionFocused: {
71
- backgroundColor: theme.palette.grey[50]
72
- }
73
- });
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var colorManipulator_1 = require("@material-ui/core/styles/colorManipulator");
4
+ var styles_1 = require("@material-ui/styles");
5
+ var styles = function (theme) {
6
+ return styles_1.createStyles({
7
+ input: {
8
+ display: "flex",
9
+ paddingRight: 0,
10
+ },
11
+ valueContainer: {
12
+ display: "flex",
13
+ flexWrap: "nowrap",
14
+ flex: 1,
15
+ alignItems: "center",
16
+ overflow: "hidden",
17
+ },
18
+ chip: {
19
+ margin: theme.spacing(0.5) + "px " + theme.spacing(0.25) + "px",
20
+ },
21
+ chipFocused: {
22
+ backgroundColor: colorManipulator_1.emphasize(theme.palette.type === "light" ? theme.palette.grey[300] : theme.palette.grey[700], 0.08),
23
+ },
24
+ noOptionsMessage: {
25
+ padding: theme.spacing(1) + "px " + theme.spacing(2) + "px",
26
+ color: theme.palette.text.secondary,
27
+ },
28
+ singleValue: {
29
+ overflow: "hidden",
30
+ textOverflow: "ellipsis",
31
+ whiteSpace: "nowrap",
32
+ },
33
+ placeholder: {
34
+ color: theme.palette.text.disabled,
35
+ },
36
+ paper: {},
37
+ indicatorsContainer: {
38
+ display: "flex",
39
+ },
40
+ indicatorSeparator: {
41
+ width: 1,
42
+ flexGrow: 1,
43
+ backgroundColor: theme.palette.divider,
44
+ },
45
+ indicator: {
46
+ display: "flex",
47
+ alignItems: "center",
48
+ justifyContent: "center",
49
+ color: theme.palette.grey[500],
50
+ width: 32,
51
+ cursor: "pointer",
52
+ },
53
+ clearIndicator: {
54
+ fontSize: 18,
55
+ },
56
+ dropdownIndicator: {
57
+ fontSize: 20,
58
+ },
59
+ option: {},
60
+ optionSelected: {
61
+ fontWeight: theme.typography.fontWeightMedium,
62
+ },
63
+ optionFocused: {
64
+ backgroundColor: theme.palette.grey[50],
65
+ },
66
+ });
74
67
  };
75
-
76
- var _default = styles;
77
- exports["default"] = _default;
68
+ exports.default = styles;
69
+ //# sourceMappingURL=ReactSelect.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReactSelect.styles.js","sourceRoot":"","sources":["../src/ReactSelect.styles.ts"],"names":[],"mappings":";;AACA,8EAAsE;AACtE,8CAAmD;AAoBnD,IAAM,MAAM,GAAG,UAAC,KAAY;IACxB,OAAA,qBAAY,CAAsB;QAC9B,KAAK,EAAE;YACH,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,CAAC;SAClB;QACD,cAAc,EAAE;YACZ,OAAO,EAAE,MAAM;YACf,QAAQ,EAAE,QAAQ;YAClB,IAAI,EAAE,CAAC;YACP,UAAU,EAAE,QAAQ;YACpB,QAAQ,EAAE,QAAQ;SACrB;QACD,IAAI,EAAE;YACF,MAAM,EAAK,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,WAAM,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAI;SAC7D;QACD,WAAW,EAAE;YACT,eAAe,EAAE,4BAAS,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC;SACvH;QACD,gBAAgB,EAAE;YACd,OAAO,EAAK,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,WAAM,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAI;YACtD,KAAK,EAAE,KAAK,CAAC,OAAO,C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