@comet/admin-react-select 2.0.1-canary.99.0 → 2.1.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 +101 -150
- package/lib/FinalFormReactSelect.js.map +1 -0
- package/lib/FinalFormReactSelectStaticOptions.js +89 -118
- package/lib/FinalFormReactSelectStaticOptions.js.map +1 -0
- package/lib/ReactSelect.d.ts +17 -13
- package/lib/ReactSelect.js +186 -241
- package/lib/ReactSelect.js.map +1 -0
- package/lib/ReactSelect.styles.d.ts +2 -2
- package/lib/ReactSelect.styles.js +67 -75
- package/lib/ReactSelect.styles.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +16 -84
- package/lib/index.js.map +1 -0
- package/package.json +14 -27
|
@@ -1,160 +1,111 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
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
|
+
exports.FinalFormReactSelectAsyncCreatable = exports.FinalFormReactSelectCreatable = exports.FinalFormReactSelectAsync = exports.FinalFormReactSelect = void 0;
|
|
60
|
+
var React = __importStar(require("react"));
|
|
61
|
+
var ReactSelect_1 = require("./ReactSelect");
|
|
49
62
|
// tslint:disable:max-classes-per-file
|
|
50
|
-
var FinalFormReactSelect =
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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));
|
|
63
|
+
var FinalFormReactSelect = /** @class */ (function (_super) {
|
|
64
|
+
__extends(FinalFormReactSelect, _super);
|
|
65
|
+
function FinalFormReactSelect() {
|
|
66
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
70
67
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
68
|
+
FinalFormReactSelect.prototype.render = function () {
|
|
69
|
+
var _a = this.props, input = _a.input, meta = _a.meta, rest = __rest(_a, ["input", "meta"]);
|
|
70
|
+
return React.createElement(ReactSelect_1.ReactSelect, __assign({}, input, rest));
|
|
71
|
+
};
|
|
72
|
+
return FinalFormReactSelect;
|
|
73
|
+
}(React.Component));
|
|
76
74
|
exports.FinalFormReactSelect = FinalFormReactSelect;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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));
|
|
75
|
+
var FinalFormReactSelectAsync = /** @class */ (function (_super) {
|
|
76
|
+
__extends(FinalFormReactSelectAsync, _super);
|
|
77
|
+
function FinalFormReactSelectAsync() {
|
|
78
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
98
79
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
80
|
+
FinalFormReactSelectAsync.prototype.render = function () {
|
|
81
|
+
var _a = this.props, input = _a.input, meta = _a.meta, rest = __rest(_a, ["input", "meta"]);
|
|
82
|
+
return React.createElement(ReactSelect_1.ReactSelectAsync, __assign({}, input, rest));
|
|
83
|
+
};
|
|
84
|
+
return FinalFormReactSelectAsync;
|
|
85
|
+
}(React.Component));
|
|
104
86
|
exports.FinalFormReactSelectAsync = FinalFormReactSelectAsync;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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));
|
|
87
|
+
var FinalFormReactSelectCreatable = /** @class */ (function (_super) {
|
|
88
|
+
__extends(FinalFormReactSelectCreatable, _super);
|
|
89
|
+
function FinalFormReactSelectCreatable() {
|
|
90
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
126
91
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
|
|
92
|
+
FinalFormReactSelectCreatable.prototype.render = function () {
|
|
93
|
+
var _a = this.props, input = _a.input, meta = _a.meta, rest = __rest(_a, ["input", "meta"]);
|
|
94
|
+
return React.createElement(ReactSelect_1.ReactSelectCreatable, __assign({}, input, rest));
|
|
95
|
+
};
|
|
96
|
+
return FinalFormReactSelectCreatable;
|
|
97
|
+
}(React.Component));
|
|
132
98
|
exports.FinalFormReactSelectCreatable = FinalFormReactSelectCreatable;
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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));
|
|
99
|
+
var FinalFormReactSelectAsyncCreatable = /** @class */ (function (_super) {
|
|
100
|
+
__extends(FinalFormReactSelectAsyncCreatable, _super);
|
|
101
|
+
function FinalFormReactSelectAsyncCreatable() {
|
|
102
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
154
103
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
104
|
+
FinalFormReactSelectAsyncCreatable.prototype.render = function () {
|
|
105
|
+
var _a = this.props, input = _a.input, meta = _a.meta, rest = __rest(_a, ["input", "meta"]);
|
|
106
|
+
return React.createElement(ReactSelect_1.ReactSelectAsyncCreatable, __assign({}, input, rest));
|
|
107
|
+
};
|
|
108
|
+
return FinalFormReactSelectAsyncCreatable;
|
|
109
|
+
}(React.Component));
|
|
110
|
+
exports.FinalFormReactSelectAsyncCreatable = FinalFormReactSelectAsyncCreatable;
|
|
111
|
+
//# sourceMappingURL=FinalFormReactSelect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FinalFormReactSelect.js","sourceRoot":"","sources":["../src/FinalFormReactSelect.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA+B;AAM/B,6CAKuB;AAEvB,sCAAsC;AACtC;IAAsD,wCAErD;IAFD;;IAOA,CAAC;IAJU,qCAAM,GAAb;QACI,IAAM,KAA2B,IAAI,CAAC,KAAK,EAAnC,KAAK,WAAA,EAAE,IAAI,UAAA,EAAK,IAAI,cAAtB,iBAAwB,CAAa,CAAC;QAC5C,OAAO,oBAAC,yBAAM,eAAiB,KAAK,EAAM,IAAI,EAAI,CAAC;IACvD,CAAC;IACL,2BAAC;AAAD,CAAC,AAPD,CAAsD,KAAK,CAAC,SAAS,GAOpE;AAPY,oDAAoB;AAQjC;IAAoF,6CAEnF;IAFD;;IAQA,CAAC;IALU,0CAAM,GAAb;QACI,IAAM,KAA2B,IAAI,CAAC,KAAK,EAAnC,KAAK,WAAA,EAAE,IAAI,UAAA,EAAK,IAAI,cAAtB,iBAAwB,CAAa,CAAC;QAE5C,OAAO,oBAAC,8BAAK,eAAsB,KAAK,EAAM,IAAI,EAAI,CAAC;IAC3D,CAAC;IACL,gCAAC;AAAD,CAAC,AARD,CAAoF,KAAK,CAAC,SAAS,GAQlG;AARY,8DAAyB;AAStC;IAAwF,iDAEvF;IAFD;;IAQA,CAAC;IALU,8CAAM,GAAb;QACI,IAAM,KAA2B,IAAI,CAAC,KAAK,EAAnC,KAAK,WAAA,EAAE,IAAI,UAAA,EAAK,IAAI,cAAtB,iBAAwB,CAAa,CAAC;QAE5C,OAAO,oBAAC,kCAAS,eAAsB,KAAK,EAAM,IAAI,EAAI,CAAC;IAC/D,CAAC;IACL,oCAAC;AAAD,CAAC,AARD,CAAwF,KAAK,CAAC,SAAS,GAQtG;AARY,sEAA6B;AAS1C;IAA6F,sDAE5F;IAFD;;IAOA,CAAC;IAJU,mDAAM,GAAb;QACI,IAAM,KAA2B,IAAI,CAAC,KAAK,EAAnC,KAAK,WAAA,EAAE,IAAI,UAAA,EAAK,IAAI,cAAtB,iBAAwB,CAAa,CAAC;QAC5C,OAAO,oBAAC,uCAAc,eAAsB,KAAK,EAAM,IAAI,EAAI,CAAC;IACpE,CAAC;IACL,yCAAC;AAAD,CAAC,AAPD,CAA6F,KAAK,CAAC,SAAS,GAO3G;AAPY,gFAAkC"}
|
|
@@ -1,122 +1,93 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
});
|
|
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 });
|
|
8
59
|
exports.FinalFormReactSelectStaticOptions = void 0;
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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];
|
|
60
|
+
var React = __importStar(require("react"));
|
|
61
|
+
var FinalFormReactSelect_1 = require("./FinalFormReactSelect");
|
|
62
|
+
var FinalFormReactSelectStaticOptions = /** @class */ (function (_super) {
|
|
63
|
+
__extends(FinalFormReactSelectStaticOptions, _super);
|
|
64
|
+
function FinalFormReactSelectStaticOptions() {
|
|
65
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
66
|
+
_this.getOptionLabel = function (_a) {
|
|
67
|
+
var label = _a.label;
|
|
68
|
+
return label;
|
|
69
|
+
};
|
|
70
|
+
_this.getOptionValue = function (_a) {
|
|
71
|
+
var value = _a.value;
|
|
72
|
+
return value;
|
|
73
|
+
};
|
|
74
|
+
_this.onChange = function (v) { return _this.props.input.onChange(v ? v.value : null); };
|
|
75
|
+
return _this;
|
|
64
76
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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;
|
|
77
|
+
FinalFormReactSelectStaticOptions.prototype.render = function () {
|
|
78
|
+
var _this = this;
|
|
79
|
+
var _a = this.props, input = _a.input, meta = _a.meta, rest = __rest(_a, ["input", "meta"]);
|
|
80
|
+
var optionValue = this.props.options.find(function (_a) {
|
|
81
|
+
var value = _a.value;
|
|
82
|
+
return value === _this.props.input.value;
|
|
83
|
+
}) || null;
|
|
84
|
+
var selectInput = __assign(__assign({}, input), { value: optionValue });
|
|
85
|
+
return (React.createElement(FinalFormReactSelect_1.FinalFormReactSelect, __assign({}, rest, { input: selectInput, meta: __assign(__assign({}, meta), { initial: this.props.options.find(function (_a) {
|
|
86
|
+
var value = _a.value;
|
|
87
|
+
return value === meta.initial;
|
|
88
|
+
}) }), getOptionLabel: this.getOptionLabel, getOptionValue: this.getOptionValue, onChange: this.onChange })));
|
|
89
|
+
};
|
|
90
|
+
return FinalFormReactSelectStaticOptions;
|
|
91
|
+
}(React.Component));
|
|
92
|
+
exports.FinalFormReactSelectStaticOptions = FinalFormReactSelectStaticOptions;
|
|
93
|
+
//# sourceMappingURL=FinalFormReactSelectStaticOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FinalFormReactSelectStaticOptions.js","sourceRoot":"","sources":["../src/FinalFormReactSelectStaticOptions.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA+B;AAK/B,+DAA8D;AAU9D;IAAuD,qDAAuB;IAA9E;QAAA,qEA0BC;QAHW,oBAAc,GAAG,UAAC,EAAsB;gBAApB,KAAK,WAAA;YAAoB,OAAA,KAAK;QAAL,CAAK,CAAC;QACnD,oBAAc,GAAG,UAAC,EAAsB;gBAApB,KAAK,WAAA;YAAoB,OAAA,KAAK;QAAL,CAAK,CAAC;QACnD,cAAQ,GAAG,UAAC,CAAc,IAAK,OAAA,KAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,EAA7C,CAA6C,CAAC;;IACzF,CAAC;IAzBU,kDAAM,GAAb;QAAA,iBAqBC;QApBG,IAAM,KAA2B,IAAI,CAAC,KAAK,EAAnC,KAAK,WAAA,EAAE,IAAI,UAAA,EAAK,IAAI,cAAtB,iBAAwB,CAAa,CAAC;QAE5C,IAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,UAAC,EAAS;gBAAP,KAAK,WAAA;YAAO,OAAA,KAAK,KAAK,KAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK;QAAhC,CAAgC,CAAC,IAAI,IAAI,CAAC;QACrG,IAAM,WAAW,yBACV,KAAK,KACR,KAAK,EAAE,WAAW,GACrB,CAAC;QACF,OAAO,CACH,oBAAC,2CAAoB,eACb,IAAI,IACR,KAAK,EAAE,WAAW,EAClB,IAAI,wBACG,IAAI,KACP,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,UAAC,EAAS;wBAAP,KAAK,WAAA;oBAAO,OAAA,KAAK,KAAK,IAAI,CAAC,OAAO;gBAAtB,CAAsB,CAAC,KAE3E,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,QAAQ,EAAE,IAAI,CAAC,QAAQ,IACzB,CACL,CAAC;IACN,CAAC;IAIL,wCAAC;AAAD,CAAC,AA1BD,CAAuD,KAAK,CAAC,SAAS,GA0BrE;AA1BY,8EAAiC"}
|
package/lib/ReactSelect.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { InputBaseProps, Theme } from "@material-ui/core";
|
|
2
|
+
import { SvgIconComponent } from "@material-ui/icons";
|
|
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";
|
|
@@ -13,21 +13,25 @@ export interface SelectProps<OptionType> {
|
|
|
13
13
|
dropdownIcon?: SvgIconComponent;
|
|
14
14
|
dropdownIconOpen?: SvgIconComponent;
|
|
15
15
|
}
|
|
16
|
-
export declare
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export declare
|
|
20
|
-
|
|
16
|
+
export declare class ReactSelect<OptionType> extends React.Component<ReactSelectProps<OptionType>> {
|
|
17
|
+
render(): JSX.Element;
|
|
18
|
+
}
|
|
19
|
+
export declare class ReactSelectAsync<OptionType, IsMulti extends boolean> extends React.Component<ReactSelectAsyncProps<OptionType, IsMulti>> {
|
|
20
|
+
render(): JSX.Element;
|
|
21
|
+
}
|
|
22
|
+
export declare class ReactSelectCreatable<OptionType, IsMulti extends boolean> extends React.Component<ReactSelectCreatableProps<OptionType, IsMulti>> {
|
|
23
|
+
render(): JSX.Element;
|
|
24
|
+
}
|
|
25
|
+
export declare class ReactSelectAsyncCreatable<OptionType, IsMulti extends boolean> extends React.Component<ReactSelectCreatableProps<OptionType, IsMulti> & ReactSelectAsyncProps<OptionType, IsMulti>> {
|
|
26
|
+
render(): JSX.Element;
|
|
27
|
+
}
|
|
28
|
+
declare module "@material-ui/core/styles/overrides" {
|
|
21
29
|
interface ComponentNameToClassKey {
|
|
22
30
|
CometAdminSelect: SelectClassKey;
|
|
23
31
|
}
|
|
32
|
+
}
|
|
33
|
+
declare module "@material-ui/core/styles/props" {
|
|
24
34
|
interface ComponentsPropsList {
|
|
25
35
|
CometAdminSelect: SelectProps<any>;
|
|
26
36
|
}
|
|
27
|
-
interface Components {
|
|
28
|
-
CometAdminSelect?: {
|
|
29
|
-
defaultProps?: ComponentsPropsList["CometAdminSelect"];
|
|
30
|
-
styleOverrides?: ComponentsOverrides<Theme>["CometAdminSelect"];
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
37
|
}
|