@comet/admin-react-select 2.0.0-alpha.9 → 2.0.1-canary.100.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/FinalFormReactSelect.js +150 -101
- package/lib/FinalFormReactSelectStaticOptions.js +118 -89
- package/lib/ReactSelect.d.ts +21 -14
- package/lib/ReactSelect.js +241 -186
- package/lib/ReactSelect.styles.d.ts +3 -3
- package/lib/ReactSelect.styles.js +75 -67
- package/lib/index.d.ts +2 -2
- package/lib/index.js +84 -16
- package/package.json +31 -15
- package/lib/FinalFormReactSelect.js.map +0 -1
- package/lib/FinalFormReactSelectStaticOptions.js.map +0 -1
- package/lib/ReactSelect.js.map +0 -1
- package/lib/ReactSelect.styles.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/themeAugmentation.d.ts +0 -12
- package/lib/themeAugmentation.js +0 -3
- package/lib/themeAugmentation.js.map +0 -1
|
@@ -1,111 +1,160 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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;
|
|
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
|
|
39
7
|
});
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
8
|
+
exports.FinalFormReactSelectCreatable = exports.FinalFormReactSelectAsyncCreatable = exports.FinalFormReactSelectAsync = exports.FinalFormReactSelect = void 0;
|
|
9
|
+
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _ReactSelect = require("./ReactSelect");
|
|
13
|
+
|
|
14
|
+
var _excluded = ["input", "meta"],
|
|
15
|
+
_excluded2 = ["input", "meta"],
|
|
16
|
+
_excluded3 = ["input", "meta"],
|
|
17
|
+
_excluded4 = ["input", "meta"];
|
|
18
|
+
|
|
19
|
+
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); }
|
|
20
|
+
|
|
21
|
+
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; }
|
|
22
|
+
|
|
23
|
+
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); }
|
|
24
|
+
|
|
25
|
+
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; }
|
|
26
|
+
|
|
27
|
+
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; }
|
|
28
|
+
|
|
29
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
30
|
+
|
|
31
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
32
|
+
|
|
33
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
34
|
+
|
|
35
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
36
|
+
|
|
37
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
38
|
+
|
|
39
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
40
|
+
|
|
41
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
42
|
+
|
|
43
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
44
|
+
|
|
45
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
46
|
+
|
|
47
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
48
|
+
|
|
62
49
|
// tslint:disable:max-classes-per-file
|
|
63
|
-
var FinalFormReactSelect =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
50
|
+
var FinalFormReactSelect = /*#__PURE__*/function (_React$Component) {
|
|
51
|
+
_inherits(FinalFormReactSelect, _React$Component);
|
|
52
|
+
|
|
53
|
+
var _super = _createSuper(FinalFormReactSelect);
|
|
54
|
+
|
|
55
|
+
function FinalFormReactSelect() {
|
|
56
|
+
_classCallCheck(this, FinalFormReactSelect);
|
|
57
|
+
|
|
58
|
+
return _super.apply(this, arguments);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
_createClass(FinalFormReactSelect, [{
|
|
62
|
+
key: "render",
|
|
63
|
+
value: function render() {
|
|
64
|
+
var _this$props = this.props,
|
|
65
|
+
input = _this$props.input,
|
|
66
|
+
meta = _this$props.meta,
|
|
67
|
+
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
68
|
+
|
|
69
|
+
return /*#__PURE__*/React.createElement(_ReactSelect.ReactSelect, _extends({}, input, rest));
|
|
67
70
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}(React.Component));
|
|
71
|
+
}]);
|
|
72
|
+
|
|
73
|
+
return FinalFormReactSelect;
|
|
74
|
+
}(React.Component);
|
|
75
|
+
|
|
74
76
|
exports.FinalFormReactSelect = FinalFormReactSelect;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
|
|
78
|
+
var FinalFormReactSelectAsync = /*#__PURE__*/function (_React$Component2) {
|
|
79
|
+
_inherits(FinalFormReactSelectAsync, _React$Component2);
|
|
80
|
+
|
|
81
|
+
var _super2 = _createSuper(FinalFormReactSelectAsync);
|
|
82
|
+
|
|
83
|
+
function FinalFormReactSelectAsync() {
|
|
84
|
+
_classCallCheck(this, FinalFormReactSelectAsync);
|
|
85
|
+
|
|
86
|
+
return _super2.apply(this, arguments);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
_createClass(FinalFormReactSelectAsync, [{
|
|
90
|
+
key: "render",
|
|
91
|
+
value: function render() {
|
|
92
|
+
var _this$props2 = this.props,
|
|
93
|
+
input = _this$props2.input,
|
|
94
|
+
meta = _this$props2.meta,
|
|
95
|
+
rest = _objectWithoutProperties(_this$props2, _excluded2);
|
|
96
|
+
|
|
97
|
+
return /*#__PURE__*/React.createElement(_ReactSelect.ReactSelectAsync, _extends({}, input, rest));
|
|
79
98
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}(React.Component));
|
|
99
|
+
}]);
|
|
100
|
+
|
|
101
|
+
return FinalFormReactSelectAsync;
|
|
102
|
+
}(React.Component);
|
|
103
|
+
|
|
86
104
|
exports.FinalFormReactSelectAsync = FinalFormReactSelectAsync;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
105
|
+
|
|
106
|
+
var FinalFormReactSelectCreatable = /*#__PURE__*/function (_React$Component3) {
|
|
107
|
+
_inherits(FinalFormReactSelectCreatable, _React$Component3);
|
|
108
|
+
|
|
109
|
+
var _super3 = _createSuper(FinalFormReactSelectCreatable);
|
|
110
|
+
|
|
111
|
+
function FinalFormReactSelectCreatable() {
|
|
112
|
+
_classCallCheck(this, FinalFormReactSelectCreatable);
|
|
113
|
+
|
|
114
|
+
return _super3.apply(this, arguments);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
_createClass(FinalFormReactSelectCreatable, [{
|
|
118
|
+
key: "render",
|
|
119
|
+
value: function render() {
|
|
120
|
+
var _this$props3 = this.props,
|
|
121
|
+
input = _this$props3.input,
|
|
122
|
+
meta = _this$props3.meta,
|
|
123
|
+
rest = _objectWithoutProperties(_this$props3, _excluded3);
|
|
124
|
+
|
|
125
|
+
return /*#__PURE__*/React.createElement(_ReactSelect.ReactSelectCreatable, _extends({}, input, rest));
|
|
91
126
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}(React.Component));
|
|
127
|
+
}]);
|
|
128
|
+
|
|
129
|
+
return FinalFormReactSelectCreatable;
|
|
130
|
+
}(React.Component);
|
|
131
|
+
|
|
98
132
|
exports.FinalFormReactSelectCreatable = FinalFormReactSelectCreatable;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
133
|
+
|
|
134
|
+
var FinalFormReactSelectAsyncCreatable = /*#__PURE__*/function (_React$Component4) {
|
|
135
|
+
_inherits(FinalFormReactSelectAsyncCreatable, _React$Component4);
|
|
136
|
+
|
|
137
|
+
var _super4 = _createSuper(FinalFormReactSelectAsyncCreatable);
|
|
138
|
+
|
|
139
|
+
function FinalFormReactSelectAsyncCreatable() {
|
|
140
|
+
_classCallCheck(this, FinalFormReactSelectAsyncCreatable);
|
|
141
|
+
|
|
142
|
+
return _super4.apply(this, arguments);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
_createClass(FinalFormReactSelectAsyncCreatable, [{
|
|
146
|
+
key: "render",
|
|
147
|
+
value: function render() {
|
|
148
|
+
var _this$props4 = this.props,
|
|
149
|
+
input = _this$props4.input,
|
|
150
|
+
meta = _this$props4.meta,
|
|
151
|
+
rest = _objectWithoutProperties(_this$props4, _excluded4);
|
|
152
|
+
|
|
153
|
+
return /*#__PURE__*/React.createElement(_ReactSelect.ReactSelectAsyncCreatable, _extends({}, input, rest));
|
|
103
154
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
exports.FinalFormReactSelectAsyncCreatable = FinalFormReactSelectAsyncCreatable;
|
|
111
|
-
//# sourceMappingURL=FinalFormReactSelect.js.map
|
|
155
|
+
}]);
|
|
156
|
+
|
|
157
|
+
return FinalFormReactSelectAsyncCreatable;
|
|
158
|
+
}(React.Component);
|
|
159
|
+
|
|
160
|
+
exports.FinalFormReactSelectAsyncCreatable = FinalFormReactSelectAsyncCreatable;
|
|
@@ -1,93 +1,122 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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;
|
|
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
|
|
39
7
|
});
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
8
|
exports.FinalFormReactSelectStaticOptions = void 0;
|
|
60
|
-
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
9
|
+
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _FinalFormReactSelect = require("./FinalFormReactSelect");
|
|
13
|
+
|
|
14
|
+
var _excluded = ["input", "meta"];
|
|
15
|
+
|
|
16
|
+
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); }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
31
|
+
|
|
32
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
33
|
+
|
|
34
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
35
|
+
|
|
36
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
37
|
+
|
|
38
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
39
|
+
|
|
40
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
41
|
+
|
|
42
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
43
|
+
|
|
44
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
45
|
+
|
|
46
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
47
|
+
|
|
48
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
49
|
+
|
|
50
|
+
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; }
|
|
51
|
+
|
|
52
|
+
var FinalFormReactSelectStaticOptions = /*#__PURE__*/function (_React$Component) {
|
|
53
|
+
_inherits(FinalFormReactSelectStaticOptions, _React$Component);
|
|
54
|
+
|
|
55
|
+
var _super = _createSuper(FinalFormReactSelectStaticOptions);
|
|
56
|
+
|
|
57
|
+
function FinalFormReactSelectStaticOptions() {
|
|
58
|
+
var _this;
|
|
59
|
+
|
|
60
|
+
_classCallCheck(this, FinalFormReactSelectStaticOptions);
|
|
61
|
+
|
|
62
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
63
|
+
args[_key] = arguments[_key];
|
|
76
64
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
65
|
+
|
|
66
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
67
|
+
|
|
68
|
+
_defineProperty(_assertThisInitialized(_this), "getOptionLabel", function (_ref) {
|
|
69
|
+
var label = _ref.label;
|
|
70
|
+
return label;
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
_defineProperty(_assertThisInitialized(_this), "getOptionValue", function (_ref2) {
|
|
74
|
+
var value = _ref2.value;
|
|
75
|
+
return value;
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
_defineProperty(_assertThisInitialized(_this), "onChange", function (v) {
|
|
79
|
+
return _this.props.input.onChange(v ? v.value : null);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
return _this;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
_createClass(FinalFormReactSelectStaticOptions, [{
|
|
86
|
+
key: "render",
|
|
87
|
+
value: function render() {
|
|
88
|
+
var _this2 = this;
|
|
89
|
+
|
|
90
|
+
var _this$props = this.props,
|
|
91
|
+
input = _this$props.input,
|
|
92
|
+
meta = _this$props.meta,
|
|
93
|
+
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
94
|
+
|
|
95
|
+
var optionValue = this.props.options.find(function (_ref3) {
|
|
96
|
+
var value = _ref3.value;
|
|
97
|
+
return value === _this2.props.input.value;
|
|
98
|
+
}) || null;
|
|
99
|
+
|
|
100
|
+
var selectInput = _objectSpread(_objectSpread({}, input), {}, {
|
|
101
|
+
value: optionValue
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
return /*#__PURE__*/React.createElement(_FinalFormReactSelect.FinalFormReactSelect, _extends({}, rest, {
|
|
105
|
+
input: selectInput,
|
|
106
|
+
meta: _objectSpread(_objectSpread({}, meta), {}, {
|
|
107
|
+
initial: this.props.options.find(function (_ref4) {
|
|
108
|
+
var value = _ref4.value;
|
|
109
|
+
return value === meta.initial;
|
|
110
|
+
})
|
|
111
|
+
}),
|
|
112
|
+
getOptionLabel: this.getOptionLabel,
|
|
113
|
+
getOptionValue: this.getOptionValue,
|
|
114
|
+
onChange: this.onChange
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
117
|
+
}]);
|
|
118
|
+
|
|
119
|
+
return FinalFormReactSelectStaticOptions;
|
|
120
|
+
}(React.Component);
|
|
121
|
+
|
|
122
|
+
exports.FinalFormReactSelectStaticOptions = FinalFormReactSelectStaticOptions;
|
package/lib/ReactSelect.d.ts
CHANGED
|
@@ -1,26 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { SvgIconComponent } from "@mui/icons-material";
|
|
2
|
+
import { ComponentsOverrides, InputBaseProps, Theme } from "@mui/material";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Props as ReactSelectAsyncProps } from "react-select/async";
|
|
5
5
|
import { Props as ReactSelectProps } from "react-select/base";
|
|
6
6
|
import { Props as ReactSelectCreatableProps } from "react-select/creatable";
|
|
7
|
+
import { SelectClassKey } from "./ReactSelect.styles";
|
|
7
8
|
export declare const ControlInput: ({ ...props }: InputBaseProps) => JSX.Element;
|
|
8
|
-
export interface
|
|
9
|
+
export interface SelectProps<OptionType> {
|
|
9
10
|
theme: Theme;
|
|
10
11
|
selectComponent: React.ComponentType<ReactSelectProps<OptionType>>;
|
|
11
12
|
clearIcon?: SvgIconComponent;
|
|
12
13
|
dropdownIcon?: SvgIconComponent;
|
|
13
14
|
dropdownIconOpen?: SvgIconComponent;
|
|
14
15
|
}
|
|
15
|
-
export declare
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export declare
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
export declare function ReactSelect<OptionType>(props: ReactSelectProps<OptionType>): JSX.Element;
|
|
17
|
+
export declare function ReactSelectAsync<OptionType, IsMulti extends boolean>(props: ReactSelectAsyncProps<OptionType, IsMulti>): JSX.Element;
|
|
18
|
+
export declare function ReactSelectCreatable<OptionType, IsMulti extends boolean>(props: ReactSelectCreatableProps<OptionType, IsMulti>): JSX.Element;
|
|
19
|
+
export declare function ReactSelectAsyncCreatable<OptionType, IsMulti extends boolean>(props: ReactSelectCreatableProps<OptionType, IsMulti> & ReactSelectAsyncProps<OptionType, IsMulti>): JSX.Element;
|
|
20
|
+
declare module "@mui/material/styles" {
|
|
21
|
+
interface ComponentNameToClassKey {
|
|
22
|
+
CometAdminSelect: SelectClassKey;
|
|
23
|
+
}
|
|
24
|
+
interface ComponentsPropsList {
|
|
25
|
+
CometAdminSelect: SelectProps<any>;
|
|
26
|
+
}
|
|
27
|
+
interface Components {
|
|
28
|
+
CometAdminSelect?: {
|
|
29
|
+
defaultProps?: ComponentsPropsList["CometAdminSelect"];
|
|
30
|
+
styleOverrides?: ComponentsOverrides<Theme>["CometAdminSelect"];
|
|
31
|
+
};
|
|
32
|
+
}
|
|
26
33
|
}
|