@comet/admin-react-select 5.0.0-canary.1629.0 → 5.0.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/LICENSE +6 -7
- package/lib/FinalFormReactSelect.d.ts +5 -4
- package/lib/FinalFormReactSelect.d.ts.map +1 -1
- package/lib/FinalFormReactSelect.js +18 -67
- package/lib/FinalFormReactSelectStaticOptions.js +8 -45
- package/lib/ReactSelect.d.ts +6 -5
- package/lib/ReactSelect.d.ts.map +1 -1
- package/lib/ReactSelect.js +13 -60
- package/lib/ReactSelect.styles.d.ts +1 -1
- package/lib/ReactSelect.styles.d.ts.map +1 -1
- package/lib/ReactSelect.styles.js +0 -4
- package/lib/index.js +0 -4
- package/package.json +66 -56
package/LICENSE
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
BSD 2-Clause License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
4
|
-
All rights reserved.
|
|
3
|
+
Copyright (c) 2023, Vivid Planet Software GmbH
|
|
5
4
|
|
|
6
5
|
Redistribution and use in source and binary forms, with or without
|
|
7
6
|
modification, are permitted provided that the following conditions are met:
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
15
14
|
|
|
16
15
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
17
16
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { FieldRenderProps } from "react-final-form";
|
|
3
|
+
import { OptionTypeBase } from "react-select";
|
|
3
4
|
import { Props as ReactSelectAsyncProps } from "react-select/async";
|
|
4
5
|
import { Props as ReactSelectProps } from "react-select/base";
|
|
5
6
|
import { Props as ReactSelectCreatableProps } from "react-select/creatable";
|
|
6
|
-
export declare class FinalFormReactSelect<OptionType> extends React.Component<FieldRenderProps<OptionType | null, HTMLElement> & ReactSelectProps<OptionType>> {
|
|
7
|
+
export declare class FinalFormReactSelect<OptionType extends OptionTypeBase> extends React.Component<FieldRenderProps<OptionType | null, HTMLElement> & ReactSelectProps<OptionType>> {
|
|
7
8
|
render(): JSX.Element;
|
|
8
9
|
}
|
|
9
|
-
export declare class FinalFormReactSelectAsync<OptionType, IsMulti extends boolean> extends React.Component<FieldRenderProps<OptionType | null, HTMLElement> & ReactSelectAsyncProps<OptionType, IsMulti>> {
|
|
10
|
+
export declare class FinalFormReactSelectAsync<OptionType extends OptionTypeBase, IsMulti extends boolean> extends React.Component<FieldRenderProps<OptionType | null, HTMLElement> & ReactSelectAsyncProps<OptionType, IsMulti>> {
|
|
10
11
|
render(): JSX.Element;
|
|
11
12
|
}
|
|
12
|
-
export declare class FinalFormReactSelectCreatable<OptionType, IsMulti extends boolean> extends React.Component<FieldRenderProps<OptionType | null, HTMLElement> & ReactSelectCreatableProps<OptionType, IsMulti>> {
|
|
13
|
+
export declare class FinalFormReactSelectCreatable<OptionType extends OptionTypeBase, IsMulti extends boolean> extends React.Component<FieldRenderProps<OptionType | null, HTMLElement> & ReactSelectCreatableProps<OptionType, IsMulti>> {
|
|
13
14
|
render(): JSX.Element;
|
|
14
15
|
}
|
|
15
|
-
export declare class FinalFormReactSelectAsyncCreatable<OptionType, IsMulti extends boolean> extends React.Component<FieldRenderProps<OptionType | null, HTMLElement> & ReactSelectCreatableProps<OptionType, false> & ReactSelectAsyncProps<OptionType, IsMulti>> {
|
|
16
|
+
export declare class FinalFormReactSelectAsyncCreatable<OptionType extends OptionTypeBase, IsMulti extends boolean> extends React.Component<FieldRenderProps<OptionType | null, HTMLElement> & ReactSelectCreatableProps<OptionType, false> & ReactSelectAsyncProps<OptionType, IsMulti>> {
|
|
16
17
|
render(): JSX.Element;
|
|
17
18
|
}
|
|
18
19
|
//# sourceMappingURL=FinalFormReactSelect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FinalFormReactSelect.d.ts","sourceRoot":"","sources":["../src/FinalFormReactSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,KAAK,IAAI,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,KAAK,IAAI,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,KAAK,IAAI,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAU5E,qBAAa,oBAAoB,CAAC,UAAU,CAAE,SAAQ,KAAK,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"FinalFormReactSelect.d.ts","sourceRoot":"","sources":["../src/FinalFormReactSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,KAAK,IAAI,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,KAAK,IAAI,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,KAAK,IAAI,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAU5E,qBAAa,oBAAoB,CAAC,UAAU,SAAS,cAAc,CAAE,SAAQ,KAAK,CAAC,SAAS,CACxF,gBAAgB,CAAC,UAAU,GAAG,IAAI,EAAE,WAAW,CAAC,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAClF;IACU,MAAM;CAIhB;AACD,qBAAa,yBAAyB,CAAC,UAAU,SAAS,cAAc,EAAE,OAAO,SAAS,OAAO,CAAE,SAAQ,KAAK,CAAC,SAAS,CACtH,gBAAgB,CAAC,UAAU,GAAG,IAAI,EAAE,WAAW,CAAC,GAAG,qBAAqB,CAAC,UAAU,EAAE,OAAO,CAAC,CAChG;IACU,MAAM;CAKhB;AACD,qBAAa,6BAA6B,CAAC,UAAU,SAAS,cAAc,EAAE,OAAO,SAAS,OAAO,CAAE,SAAQ,KAAK,CAAC,SAAS,CAC1H,gBAAgB,CAAC,UAAU,GAAG,IAAI,EAAE,WAAW,CAAC,GAAG,yBAAyB,CAAC,UAAU,EAAE,OAAO,CAAC,CACpG;IACU,MAAM;CAKhB;AACD,qBAAa,kCAAkC,CAAC,UAAU,SAAS,cAAc,EAAE,OAAO,SAAS,OAAO,CAAE,SAAQ,KAAK,CAAC,SAAS,CAC/H,gBAAgB,CAAC,UAAU,GAAG,IAAI,EAAE,WAAW,CAAC,GAAG,yBAAyB,CAAC,UAAU,EAAE,KAAK,CAAC,GAAG,qBAAqB,CAAC,UAAU,EAAE,OAAO,CAAC,CAC/I;IACU,MAAM;CAIhB"}
|
|
@@ -1,160 +1,111 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
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
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.FinalFormReactSelectCreatable = exports.FinalFormReactSelectAsyncCreatable = exports.FinalFormReactSelectAsync = exports.FinalFormReactSelect = void 0;
|
|
9
|
-
|
|
10
8
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _ReactSelect = require("./ReactSelect");
|
|
13
|
-
|
|
14
10
|
var _excluded = ["input", "meta"],
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
_excluded2 = ["input", "meta"],
|
|
12
|
+
_excluded3 = ["input", "meta"],
|
|
13
|
+
_excluded4 = ["input", "meta"];
|
|
19
14
|
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
15
|
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
16
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
17
|
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
18
|
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
19
|
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
|
-
|
|
20
|
+
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, _toPropertyKey(descriptor.key), descriptor); } }
|
|
33
21
|
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
|
-
|
|
22
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
23
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
35
24
|
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
25
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
38
|
-
|
|
39
26
|
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
27
|
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
28
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
44
|
-
|
|
45
29
|
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
30
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
48
|
-
|
|
49
31
|
// tslint:disable:max-classes-per-file
|
|
50
32
|
var FinalFormReactSelect = /*#__PURE__*/function (_React$Component) {
|
|
51
33
|
_inherits(FinalFormReactSelect, _React$Component);
|
|
52
|
-
|
|
53
34
|
var _super = _createSuper(FinalFormReactSelect);
|
|
54
|
-
|
|
55
35
|
function FinalFormReactSelect() {
|
|
56
36
|
_classCallCheck(this, FinalFormReactSelect);
|
|
57
|
-
|
|
58
37
|
return _super.apply(this, arguments);
|
|
59
38
|
}
|
|
60
|
-
|
|
61
39
|
_createClass(FinalFormReactSelect, [{
|
|
62
40
|
key: "render",
|
|
63
41
|
value: function render() {
|
|
64
42
|
var _this$props = this.props,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
43
|
+
input = _this$props.input,
|
|
44
|
+
meta = _this$props.meta,
|
|
45
|
+
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
69
46
|
return /*#__PURE__*/React.createElement(_ReactSelect.ReactSelect, _extends({}, input, rest));
|
|
70
47
|
}
|
|
71
48
|
}]);
|
|
72
|
-
|
|
73
49
|
return FinalFormReactSelect;
|
|
74
50
|
}(React.Component);
|
|
75
|
-
|
|
76
51
|
exports.FinalFormReactSelect = FinalFormReactSelect;
|
|
77
|
-
|
|
78
52
|
var FinalFormReactSelectAsync = /*#__PURE__*/function (_React$Component2) {
|
|
79
53
|
_inherits(FinalFormReactSelectAsync, _React$Component2);
|
|
80
|
-
|
|
81
54
|
var _super2 = _createSuper(FinalFormReactSelectAsync);
|
|
82
|
-
|
|
83
55
|
function FinalFormReactSelectAsync() {
|
|
84
56
|
_classCallCheck(this, FinalFormReactSelectAsync);
|
|
85
|
-
|
|
86
57
|
return _super2.apply(this, arguments);
|
|
87
58
|
}
|
|
88
|
-
|
|
89
59
|
_createClass(FinalFormReactSelectAsync, [{
|
|
90
60
|
key: "render",
|
|
91
61
|
value: function render() {
|
|
92
62
|
var _this$props2 = this.props,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
63
|
+
input = _this$props2.input,
|
|
64
|
+
meta = _this$props2.meta,
|
|
65
|
+
rest = _objectWithoutProperties(_this$props2, _excluded2);
|
|
97
66
|
return /*#__PURE__*/React.createElement(_ReactSelect.ReactSelectAsync, _extends({}, input, rest));
|
|
98
67
|
}
|
|
99
68
|
}]);
|
|
100
|
-
|
|
101
69
|
return FinalFormReactSelectAsync;
|
|
102
70
|
}(React.Component);
|
|
103
|
-
|
|
104
71
|
exports.FinalFormReactSelectAsync = FinalFormReactSelectAsync;
|
|
105
|
-
|
|
106
72
|
var FinalFormReactSelectCreatable = /*#__PURE__*/function (_React$Component3) {
|
|
107
73
|
_inherits(FinalFormReactSelectCreatable, _React$Component3);
|
|
108
|
-
|
|
109
74
|
var _super3 = _createSuper(FinalFormReactSelectCreatable);
|
|
110
|
-
|
|
111
75
|
function FinalFormReactSelectCreatable() {
|
|
112
76
|
_classCallCheck(this, FinalFormReactSelectCreatable);
|
|
113
|
-
|
|
114
77
|
return _super3.apply(this, arguments);
|
|
115
78
|
}
|
|
116
|
-
|
|
117
79
|
_createClass(FinalFormReactSelectCreatable, [{
|
|
118
80
|
key: "render",
|
|
119
81
|
value: function render() {
|
|
120
82
|
var _this$props3 = this.props,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
83
|
+
input = _this$props3.input,
|
|
84
|
+
meta = _this$props3.meta,
|
|
85
|
+
rest = _objectWithoutProperties(_this$props3, _excluded3);
|
|
125
86
|
return /*#__PURE__*/React.createElement(_ReactSelect.ReactSelectCreatable, _extends({}, input, rest));
|
|
126
87
|
}
|
|
127
88
|
}]);
|
|
128
|
-
|
|
129
89
|
return FinalFormReactSelectCreatable;
|
|
130
90
|
}(React.Component);
|
|
131
|
-
|
|
132
91
|
exports.FinalFormReactSelectCreatable = FinalFormReactSelectCreatable;
|
|
133
|
-
|
|
134
92
|
var FinalFormReactSelectAsyncCreatable = /*#__PURE__*/function (_React$Component4) {
|
|
135
93
|
_inherits(FinalFormReactSelectAsyncCreatable, _React$Component4);
|
|
136
|
-
|
|
137
94
|
var _super4 = _createSuper(FinalFormReactSelectAsyncCreatable);
|
|
138
|
-
|
|
139
95
|
function FinalFormReactSelectAsyncCreatable() {
|
|
140
96
|
_classCallCheck(this, FinalFormReactSelectAsyncCreatable);
|
|
141
|
-
|
|
142
97
|
return _super4.apply(this, arguments);
|
|
143
98
|
}
|
|
144
|
-
|
|
145
99
|
_createClass(FinalFormReactSelectAsyncCreatable, [{
|
|
146
100
|
key: "render",
|
|
147
101
|
value: function render() {
|
|
148
102
|
var _this$props4 = this.props,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
103
|
+
input = _this$props4.input,
|
|
104
|
+
meta = _this$props4.meta,
|
|
105
|
+
rest = _objectWithoutProperties(_this$props4, _excluded4);
|
|
153
106
|
return /*#__PURE__*/React.createElement(_ReactSelect.ReactSelectAsyncCreatable, _extends({}, input, rest));
|
|
154
107
|
}
|
|
155
108
|
}]);
|
|
156
|
-
|
|
157
109
|
return FinalFormReactSelectAsyncCreatable;
|
|
158
110
|
}(React.Component);
|
|
159
|
-
|
|
160
111
|
exports.FinalFormReactSelectAsyncCreatable = FinalFormReactSelectAsyncCreatable;
|
|
@@ -1,106 +1,71 @@
|
|
|
1
1
|
"use strict";
|
|
2
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
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.FinalFormReactSelectStaticOptions = void 0;
|
|
9
|
-
|
|
10
7
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
8
|
var _FinalFormReactSelect = require("./FinalFormReactSelect");
|
|
13
|
-
|
|
14
9
|
var _excluded = ["input", "meta"];
|
|
15
|
-
|
|
16
10
|
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
11
|
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
|
-
|
|
12
|
+
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); }
|
|
20
13
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
14
|
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
15
|
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
16
|
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
17
|
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
18
|
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
|
-
|
|
19
|
+
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, _toPropertyKey(descriptor.key), descriptor); } }
|
|
34
20
|
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
21
|
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
22
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
39
|
-
|
|
40
23
|
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
24
|
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
25
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
45
|
-
|
|
46
26
|
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
27
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
49
|
-
|
|
50
|
-
function
|
|
51
|
-
|
|
28
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
29
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
30
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
52
31
|
var FinalFormReactSelectStaticOptions = /*#__PURE__*/function (_React$Component) {
|
|
53
32
|
_inherits(FinalFormReactSelectStaticOptions, _React$Component);
|
|
54
|
-
|
|
55
33
|
var _super = _createSuper(FinalFormReactSelectStaticOptions);
|
|
56
|
-
|
|
57
34
|
function FinalFormReactSelectStaticOptions() {
|
|
58
35
|
var _this;
|
|
59
|
-
|
|
60
36
|
_classCallCheck(this, FinalFormReactSelectStaticOptions);
|
|
61
|
-
|
|
62
37
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
63
38
|
args[_key] = arguments[_key];
|
|
64
39
|
}
|
|
65
|
-
|
|
66
40
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
67
|
-
|
|
68
41
|
_defineProperty(_assertThisInitialized(_this), "getOptionLabel", function (_ref) {
|
|
69
42
|
var label = _ref.label;
|
|
70
43
|
return label;
|
|
71
44
|
});
|
|
72
|
-
|
|
73
45
|
_defineProperty(_assertThisInitialized(_this), "getOptionValue", function (_ref2) {
|
|
74
46
|
var value = _ref2.value;
|
|
75
47
|
return value;
|
|
76
48
|
});
|
|
77
|
-
|
|
78
49
|
_defineProperty(_assertThisInitialized(_this), "onChange", function (v) {
|
|
79
50
|
return _this.props.input.onChange(v ? v.value : null);
|
|
80
51
|
});
|
|
81
|
-
|
|
82
52
|
return _this;
|
|
83
53
|
}
|
|
84
|
-
|
|
85
54
|
_createClass(FinalFormReactSelectStaticOptions, [{
|
|
86
55
|
key: "render",
|
|
87
56
|
value: function render() {
|
|
88
57
|
var _this2 = this;
|
|
89
|
-
|
|
90
58
|
var _this$props = this.props,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
59
|
+
input = _this$props.input,
|
|
60
|
+
meta = _this$props.meta,
|
|
61
|
+
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
95
62
|
var optionValue = this.props.options.find(function (_ref3) {
|
|
96
63
|
var value = _ref3.value;
|
|
97
64
|
return value === _this2.props.input.value;
|
|
98
65
|
}) || null;
|
|
99
|
-
|
|
100
66
|
var selectInput = _objectSpread(_objectSpread({}, input), {}, {
|
|
101
67
|
value: optionValue
|
|
102
68
|
});
|
|
103
|
-
|
|
104
69
|
return /*#__PURE__*/React.createElement(_FinalFormReactSelect.FinalFormReactSelect, _extends({}, rest, {
|
|
105
70
|
input: selectInput,
|
|
106
71
|
meta: _objectSpread(_objectSpread({}, meta), {}, {
|
|
@@ -115,8 +80,6 @@ var FinalFormReactSelectStaticOptions = /*#__PURE__*/function (_React$Component)
|
|
|
115
80
|
}));
|
|
116
81
|
}
|
|
117
82
|
}]);
|
|
118
|
-
|
|
119
83
|
return FinalFormReactSelectStaticOptions;
|
|
120
84
|
}(React.Component);
|
|
121
|
-
|
|
122
85
|
exports.FinalFormReactSelectStaticOptions = FinalFormReactSelectStaticOptions;
|
package/lib/ReactSelect.d.ts
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { SvgIconComponent } from "@mui/icons-material";
|
|
2
2
|
import { ComponentsOverrides, InputBaseProps, Theme } from "@mui/material";
|
|
3
3
|
import * as React from "react";
|
|
4
|
+
import { OptionTypeBase } from "react-select";
|
|
4
5
|
import { Props as ReactSelectAsyncProps } from "react-select/async";
|
|
5
6
|
import { Props as ReactSelectProps } from "react-select/base";
|
|
6
7
|
import { Props as ReactSelectCreatableProps } from "react-select/creatable";
|
|
7
8
|
import { SelectClassKey } from "./ReactSelect.styles";
|
|
8
9
|
export declare const ControlInput: ({ ...props }: InputBaseProps) => JSX.Element;
|
|
9
|
-
export interface SelectProps<OptionType> {
|
|
10
|
+
export interface SelectProps<OptionType extends OptionTypeBase> {
|
|
10
11
|
theme: Theme;
|
|
11
12
|
selectComponent: React.ComponentType<ReactSelectProps<OptionType>>;
|
|
12
13
|
clearIcon?: SvgIconComponent;
|
|
13
14
|
dropdownIcon?: SvgIconComponent;
|
|
14
15
|
dropdownIconOpen?: SvgIconComponent;
|
|
15
16
|
}
|
|
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;
|
|
17
|
+
export declare function ReactSelect<OptionType extends OptionTypeBase>(props: ReactSelectProps<OptionType>): JSX.Element;
|
|
18
|
+
export declare function ReactSelectAsync<OptionType extends OptionTypeBase, IsMulti extends boolean>(props: ReactSelectAsyncProps<OptionType, IsMulti>): JSX.Element;
|
|
19
|
+
export declare function ReactSelectCreatable<OptionType extends OptionTypeBase, IsMulti extends boolean>(props: ReactSelectCreatableProps<OptionType, IsMulti>): JSX.Element;
|
|
20
|
+
export declare function ReactSelectAsyncCreatable<OptionType extends OptionTypeBase, IsMulti extends boolean>(props: ReactSelectCreatableProps<OptionType, IsMulti> & ReactSelectAsyncProps<OptionType, IsMulti>): JSX.Element;
|
|
20
21
|
declare module "@mui/material/styles" {
|
|
21
22
|
interface ComponentNameToClassKey {
|
|
22
23
|
CometAdminSelect: SelectClassKey;
|
package/lib/ReactSelect.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactSelect.d.ts","sourceRoot":"","sources":["../src/ReactSelect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIvD,OAAO,EAAQ,mBAAmB,EAAa,cAAc,EAAmB,KAAK,EAAwB,MAAM,eAAe,CAAC;AAGnI,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ReactSelect.d.ts","sourceRoot":"","sources":["../src/ReactSelect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIvD,OAAO,EAAQ,mBAAmB,EAAa,cAAc,EAAmB,KAAK,EAAwB,MAAM,eAAe,CAAC;AAGnI,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACtD,OAAoB,EAAE,KAAK,IAAI,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEjF,OAAO,EAAE,KAAK,IAAI,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAwB,EAAE,KAAK,IAAI,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAU7F,OAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAc9D,eAAO,MAAM,YAAY,iBAAkB,cAAc,gBAA4E,CAAC;AA0HtI,MAAM,WAAW,WAAW,CAAC,UAAU,SAAS,cAAc;IAC1D,KAAK,EAAE,KAAK,CAAC;IACb,eAAe,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC;IACnE,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACvC;AA6BD,wBAAgB,WAAW,CAAC,UAAU,SAAS,cAAc,EAAE,KAAK,EAAE,gBAAgB,CAAC,UAAU,CAAC,eAGjG;AAED,wBAAgB,gBAAgB,CAAC,UAAU,SAAS,cAAc,EAAE,OAAO,SAAS,OAAO,EAAE,KAAK,EAAE,qBAAqB,CAAC,UAAU,EAAE,OAAO,CAAC,eAG7I;AAED,wBAAgB,oBAAoB,CAAC,UAAU,SAAS,cAAc,EAAE,OAAO,SAAS,OAAO,EAC3F,KAAK,EAAE,yBAAyB,CAAC,UAAU,EAAE,OAAO,CAAC,eAIxD;AAED,wBAAgB,yBAAyB,CAAC,UAAU,SAAS,cAAc,EAAE,OAAO,SAAS,OAAO,EAChG,KAAK,EAAE,yBAAyB,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,qBAAqB,CAAC,UAAU,EAAE,OAAO,CAAC,eAIrG;AAED,OAAO,QAAQ,sBAAsB,CAAC;IAClC,UAAU,uBAAuB;QAC7B,gBAAgB,EAAE,cAAc,CAAC;KACpC;IAED,UAAU,mBAAmB;QACzB,gBAAgB,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;KACtC;IAED,UAAU,UAAU;QAChB,gBAAgB,CAAC,EAAE;YACf,YAAY,CAAC,EAAE,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;YACvD,cAAc,CAAC,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC,kBAAkB,CAAC,CAAC;SACnE,CAAC;KACL;CACJ"}
|
package/lib/ReactSelect.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
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
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -10,70 +9,46 @@ exports.ReactSelect = ReactSelect;
|
|
|
10
9
|
exports.ReactSelectAsync = ReactSelectAsync;
|
|
11
10
|
exports.ReactSelectAsyncCreatable = ReactSelectAsyncCreatable;
|
|
12
11
|
exports.ReactSelectCreatable = ReactSelectCreatable;
|
|
13
|
-
|
|
14
12
|
var _Cancel = _interopRequireDefault(require("@mui/icons-material/Cancel"));
|
|
15
|
-
|
|
16
13
|
var _Clear = _interopRequireDefault(require("@mui/icons-material/Clear"));
|
|
17
|
-
|
|
18
14
|
var _KeyboardArrowDown = _interopRequireDefault(require("@mui/icons-material/KeyboardArrowDown"));
|
|
19
|
-
|
|
20
15
|
var _material = require("@mui/material");
|
|
21
|
-
|
|
22
16
|
var _styles = require("@mui/styles");
|
|
23
|
-
|
|
24
17
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
25
|
-
|
|
26
18
|
var React = _interopRequireWildcard(require("react"));
|
|
27
|
-
|
|
28
19
|
var _reactSelect = _interopRequireDefault(require("react-select"));
|
|
29
|
-
|
|
30
20
|
var _async = _interopRequireDefault(require("react-select/async"));
|
|
31
|
-
|
|
32
21
|
var _asyncCreatable = _interopRequireDefault(require("react-select/async-creatable"));
|
|
33
|
-
|
|
34
22
|
var _creatable = _interopRequireDefault(require("react-select/creatable"));
|
|
35
|
-
|
|
36
23
|
var _ReactSelect = _interopRequireDefault(require("./ReactSelect.styles"));
|
|
37
|
-
|
|
38
24
|
var _excluded = ["inputRef"],
|
|
39
|
-
|
|
40
|
-
|
|
25
|
+
_excluded2 = ["classes", "theme", "components", "selectComponent"];
|
|
41
26
|
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
27
|
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
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
46
|
-
|
|
47
29
|
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
30
|
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
|
|
52
|
-
|
|
31
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
32
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
33
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
34
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
53
35
|
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
36
|
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
37
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
|
-
|
|
59
38
|
function NoOptionsMessage(props) {
|
|
60
39
|
return /*#__PURE__*/React.createElement(_material.Typography, _extends({
|
|
61
40
|
className: props.selectProps.classes.noOptionsMessage
|
|
62
41
|
}, props.innerProps), props.children);
|
|
63
42
|
}
|
|
64
|
-
|
|
65
43
|
function inputComponent(_ref) {
|
|
66
44
|
var inputRef = _ref.inputRef,
|
|
67
|
-
|
|
68
|
-
|
|
45
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
69
46
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
70
47
|
ref: inputRef
|
|
71
48
|
}, props));
|
|
72
49
|
}
|
|
73
|
-
|
|
74
50
|
var ControlInput = function ControlInput(_ref2) {
|
|
75
|
-
var props = _extends({}, _ref2);
|
|
76
|
-
|
|
51
|
+
var props = _extends({}, (_objectDestructuringEmpty(_ref2), _ref2));
|
|
77
52
|
return /*#__PURE__*/React.createElement(_material.InputBase, _extends({
|
|
78
53
|
classes: {
|
|
79
54
|
root: "root",
|
|
@@ -81,9 +56,7 @@ var ControlInput = function ControlInput(_ref2) {
|
|
|
81
56
|
}
|
|
82
57
|
}, props));
|
|
83
58
|
};
|
|
84
|
-
|
|
85
59
|
exports.ControlInput = ControlInput;
|
|
86
|
-
|
|
87
60
|
function Control(props) {
|
|
88
61
|
var InputProps = {
|
|
89
62
|
inputComponent: inputComponent,
|
|
@@ -98,7 +71,6 @@ function Control(props) {
|
|
|
98
71
|
fullWidth: true
|
|
99
72
|
}, InputProps, props.selectProps.textFieldProps));
|
|
100
73
|
}
|
|
101
|
-
|
|
102
74
|
function Option(props) {
|
|
103
75
|
var rootClasses = [props.selectProps.classes.option];
|
|
104
76
|
if (props.isFocused) rootClasses.push(props.selectProps.classes.optionFocused);
|
|
@@ -113,25 +85,21 @@ function Option(props) {
|
|
|
113
85
|
component: "div"
|
|
114
86
|
}, props.innerProps), props.children);
|
|
115
87
|
}
|
|
116
|
-
|
|
117
88
|
function Placeholder(props) {
|
|
118
89
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
119
90
|
className: props.selectProps.classes.placeholder
|
|
120
91
|
}, props.innerProps), props.children);
|
|
121
92
|
}
|
|
122
|
-
|
|
123
93
|
function SingleValue(props) {
|
|
124
94
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
125
95
|
className: props.selectProps.classes.singleValue
|
|
126
96
|
}, props.innerProps), props.children);
|
|
127
97
|
}
|
|
128
|
-
|
|
129
98
|
function ValueContainer(props) {
|
|
130
99
|
return /*#__PURE__*/React.createElement("div", {
|
|
131
100
|
className: props.selectProps.classes.valueContainer
|
|
132
101
|
}, props.children);
|
|
133
102
|
}
|
|
134
|
-
|
|
135
103
|
function MultiValue(props) {
|
|
136
104
|
return /*#__PURE__*/React.createElement(_material.Chip, {
|
|
137
105
|
tabIndex: -1,
|
|
@@ -141,28 +109,24 @@ function MultiValue(props) {
|
|
|
141
109
|
deleteIcon: /*#__PURE__*/React.createElement(_Cancel["default"], props.removeProps)
|
|
142
110
|
});
|
|
143
111
|
}
|
|
144
|
-
|
|
145
112
|
function Menu(props) {
|
|
146
113
|
return /*#__PURE__*/React.createElement(_material.Paper, _extends({
|
|
147
114
|
className: props.selectProps.classes.paper
|
|
148
115
|
}, props.innerProps), props.children);
|
|
149
116
|
}
|
|
150
|
-
|
|
151
117
|
function IndicatorsContainer(props) {
|
|
152
118
|
return /*#__PURE__*/React.createElement("div", {
|
|
153
119
|
className: props.selectProps.classes.indicatorsContainer
|
|
154
120
|
}, props.children);
|
|
155
121
|
}
|
|
156
|
-
|
|
157
122
|
function IndicatorSeparator(props) {
|
|
158
123
|
return /*#__PURE__*/React.createElement("span", {
|
|
159
124
|
className: props.selectProps.classes.indicatorSeparator
|
|
160
125
|
});
|
|
161
126
|
}
|
|
162
|
-
|
|
163
127
|
function ClearIndicator(_ref3) {
|
|
164
128
|
var selectProps = _ref3.selectProps,
|
|
165
|
-
|
|
129
|
+
clearValue = _ref3.clearValue;
|
|
166
130
|
var Icon = selectProps.clearIcon ? selectProps.clearIcon : _Clear["default"];
|
|
167
131
|
return /*#__PURE__*/React.createElement("div", {
|
|
168
132
|
className: "".concat(selectProps.classes.indicator, " ").concat(selectProps.classes.clearIndicator),
|
|
@@ -172,7 +136,6 @@ function ClearIndicator(_ref3) {
|
|
|
172
136
|
color: "inherit"
|
|
173
137
|
}));
|
|
174
138
|
}
|
|
175
|
-
|
|
176
139
|
function DropdownIndicator(_ref4) {
|
|
177
140
|
var selectProps = _ref4.selectProps;
|
|
178
141
|
var DefaultIcon = selectProps.dropdownIcon ? selectProps.dropdownIcon : _KeyboardArrowDown["default"];
|
|
@@ -185,7 +148,6 @@ function DropdownIndicator(_ref4) {
|
|
|
185
148
|
color: "inherit"
|
|
186
149
|
}));
|
|
187
150
|
}
|
|
188
|
-
|
|
189
151
|
var components = {
|
|
190
152
|
Control: Control,
|
|
191
153
|
Menu: Menu,
|
|
@@ -200,14 +162,12 @@ var components = {
|
|
|
200
162
|
ClearIndicator: ClearIndicator,
|
|
201
163
|
DropdownIndicator: DropdownIndicator
|
|
202
164
|
};
|
|
203
|
-
|
|
204
165
|
function SelectWrapper(_ref5) {
|
|
205
166
|
var classes = _ref5.classes,
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
167
|
+
theme = _ref5.theme,
|
|
168
|
+
origComponents = _ref5.components,
|
|
169
|
+
SelectComponent = _ref5.selectComponent,
|
|
170
|
+
rest = _objectWithoutProperties(_ref5, _excluded2);
|
|
211
171
|
return /*#__PURE__*/React.createElement(SelectComponent, _extends({
|
|
212
172
|
classes: classes,
|
|
213
173
|
menuPortalTarget: document.body,
|
|
@@ -215,15 +175,12 @@ function SelectWrapper(_ref5) {
|
|
|
215
175
|
placeholder: ""
|
|
216
176
|
}, rest));
|
|
217
177
|
}
|
|
218
|
-
|
|
219
178
|
var ExtendedSelectWrapper = (0, _styles.withStyles)(_ReactSelect["default"], {
|
|
220
179
|
name: "CometAdminSelect"
|
|
221
180
|
})(SelectWrapper);
|
|
222
|
-
|
|
223
181
|
var useReactSelectStyles = function useReactSelectStyles() {
|
|
224
182
|
var _useTheme = (0, _material.useTheme)(),
|
|
225
|
-
|
|
226
|
-
|
|
183
|
+
zIndex = _useTheme.zIndex;
|
|
227
184
|
return {
|
|
228
185
|
menuPortal: function menuPortal(styles) {
|
|
229
186
|
return _objectSpread(_objectSpread({}, styles), {}, {
|
|
@@ -232,7 +189,6 @@ var useReactSelectStyles = function useReactSelectStyles() {
|
|
|
232
189
|
}
|
|
233
190
|
};
|
|
234
191
|
};
|
|
235
|
-
|
|
236
192
|
function ReactSelect(props) {
|
|
237
193
|
var reactSelectStyles = useReactSelectStyles();
|
|
238
194
|
return /*#__PURE__*/React.createElement(ExtendedSelectWrapper, _extends({
|
|
@@ -241,7 +197,6 @@ function ReactSelect(props) {
|
|
|
241
197
|
styles: _objectSpread({}, reactSelectStyles)
|
|
242
198
|
}));
|
|
243
199
|
}
|
|
244
|
-
|
|
245
200
|
function ReactSelectAsync(props) {
|
|
246
201
|
var reactSelectStyles = useReactSelectStyles();
|
|
247
202
|
return /*#__PURE__*/React.createElement(ExtendedSelectWrapper, _extends({
|
|
@@ -250,7 +205,6 @@ function ReactSelectAsync(props) {
|
|
|
250
205
|
styles: _objectSpread({}, reactSelectStyles)
|
|
251
206
|
}));
|
|
252
207
|
}
|
|
253
|
-
|
|
254
208
|
function ReactSelectCreatable(props) {
|
|
255
209
|
var reactSelectStyles = useReactSelectStyles();
|
|
256
210
|
return /*#__PURE__*/React.createElement(ExtendedSelectWrapper, _extends({
|
|
@@ -259,7 +213,6 @@ function ReactSelectCreatable(props) {
|
|
|
259
213
|
styles: _objectSpread({}, reactSelectStyles)
|
|
260
214
|
}));
|
|
261
215
|
}
|
|
262
|
-
|
|
263
216
|
function ReactSelectAsyncCreatable(props) {
|
|
264
217
|
var reactSelectStyles = useReactSelectStyles();
|
|
265
218
|
return /*#__PURE__*/React.createElement(ExtendedSelectWrapper, _extends({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Theme } from "@mui/material";
|
|
2
|
-
export
|
|
2
|
+
export type SelectClassKey = "input" | "valueContainer" | "chip" | "chipFocused" | "noOptionsMessage" | "singleValue" | "placeholder" | "paper" | "indicatorsContainer" | "indicatorSeparator" | "clearIndicator" | "indicator" | "dropdownIndicator" | "option" | "optionSelected" | "optionFocused";
|
|
3
3
|
declare const styles: (theme: Theme) => import("@mui/styles").StyleRules<Record<string, unknown>, SelectClassKey>;
|
|
4
4
|
export default styles;
|
|
5
5
|
//# sourceMappingURL=ReactSelect.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactSelect.styles.d.ts","sourceRoot":"","sources":["../src/ReactSelect.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAItC,
|
|
1
|
+
{"version":3,"file":"ReactSelect.styles.d.ts","sourceRoot":"","sources":["../src/ReactSelect.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAItC,MAAM,MAAM,cAAc,GACpB,OAAO,GACP,gBAAgB,GAChB,MAAM,GACN,aAAa,GACb,kBAAkB,GAClB,aAAa,GACb,aAAa,GACb,OAAO,GACP,qBAAqB,GACrB,oBAAoB,GACpB,gBAAgB,GAChB,WAAW,GACX,mBAAmB,GACnB,QAAQ,GACR,gBAAgB,GAChB,eAAe,CAAC;AAEtB,QAAA,MAAM,MAAM,UAAW,KAAK,8EA6DtB,CAAC;AAEP,eAAe,MAAM,CAAC"}
|
|
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _styles = require("@mui/material/styles");
|
|
9
|
-
|
|
10
8
|
var _styles2 = require("@mui/styles");
|
|
11
|
-
|
|
12
9
|
var styles = function styles(theme) {
|
|
13
10
|
return (0, _styles2.createStyles)({
|
|
14
11
|
input: {
|
|
@@ -72,6 +69,5 @@ var styles = function styles(theme) {
|
|
|
72
69
|
}
|
|
73
70
|
});
|
|
74
71
|
};
|
|
75
|
-
|
|
76
72
|
var _default = styles;
|
|
77
73
|
exports["default"] = _default;
|
package/lib/index.js
CHANGED
|
@@ -75,11 +75,7 @@ Object.defineProperty(exports, "SelectProps", {
|
|
|
75
75
|
return _ReactSelect.SelectProps;
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
|
-
|
|
79
78
|
var _FinalFormReactSelect = require("./FinalFormReactSelect");
|
|
80
|
-
|
|
81
79
|
var _FinalFormReactSelectStaticOptions = require("./FinalFormReactSelectStaticOptions");
|
|
82
|
-
|
|
83
80
|
var _ReactSelect = require("./ReactSelect");
|
|
84
|
-
|
|
85
81
|
var _ReactSelect2 = require("./ReactSelect.styles");
|
package/package.json
CHANGED
|
@@ -1,57 +1,67 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
|
|
2
|
+
"name": "@comet/admin-react-select",
|
|
3
|
+
"version": "5.0.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/vivid-planet/comet",
|
|
7
|
+
"directory": "packages/admin/admin-react-select"
|
|
8
|
+
},
|
|
9
|
+
"license": "BSD-2-Clause",
|
|
10
|
+
"main": "lib/index.js",
|
|
11
|
+
"types": "lib/index.d.ts",
|
|
12
|
+
"files": [
|
|
13
|
+
"lib"
|
|
14
|
+
],
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@comet/admin": "^5.0.0",
|
|
17
|
+
"classnames": "^2.2.6"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@babel/cli": "^7.17.6",
|
|
21
|
+
"@babel/core": "^7.20.12",
|
|
22
|
+
"@comet/admin-babel-preset": "^5.0.0",
|
|
23
|
+
"@comet/eslint-config": "^5.0.0",
|
|
24
|
+
"@mui/icons-material": "^5.0.0",
|
|
25
|
+
"@mui/material": "^5.0.0",
|
|
26
|
+
"@mui/styles": "^5.0.0",
|
|
27
|
+
"@types/react": "^17.0.0",
|
|
28
|
+
"@types/react-dom": "^17.0.0",
|
|
29
|
+
"@types/react-select": "^3.1.2",
|
|
30
|
+
"eslint": "^8.0.0",
|
|
31
|
+
"final-form": "^4.16.1",
|
|
32
|
+
"npm-run-all": "^4.1.5",
|
|
33
|
+
"prettier": "^2.0.0",
|
|
34
|
+
"react": "^17.0",
|
|
35
|
+
"react-dom": "^17.0",
|
|
36
|
+
"react-final-form": "^6.3.1",
|
|
37
|
+
"react-select": "^3.0.4",
|
|
38
|
+
"rimraf": "^3.0.2",
|
|
39
|
+
"typescript": "^4.0.0"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"@mui/icons-material": "^5.0.0",
|
|
43
|
+
"@mui/material": "^5.0.0",
|
|
44
|
+
"@mui/styles": "^5.0.0",
|
|
45
|
+
"final-form": "^4.16.1",
|
|
46
|
+
"react": "^17.0",
|
|
47
|
+
"react-dom": "^17.0",
|
|
48
|
+
"react-final-form": "^6.3.1",
|
|
49
|
+
"react-select": "^3.0.4"
|
|
50
|
+
},
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public",
|
|
53
|
+
"registry": "https://registry.npmjs.org"
|
|
54
|
+
},
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build": "$npm_execpath run clean && run-p build:babel build:types",
|
|
57
|
+
"build:babel": "npx babel ./src -x \".ts,.tsx\" -d lib",
|
|
58
|
+
"build:types": "tsc --project ./tsconfig.json --emitDeclarationOnly",
|
|
59
|
+
"clean": "rimraf lib",
|
|
60
|
+
"lint": "run-p lint:eslint lint:tsc",
|
|
61
|
+
"lint:eslint": "eslint --max-warnings 0 src/ package.json",
|
|
62
|
+
"lint:tsc": "tsc --noEmit",
|
|
63
|
+
"start": "run-p start:babel start:types",
|
|
64
|
+
"start:babel": "npx babel ./src -x \".ts,.tsx\" -d lib -w",
|
|
65
|
+
"start:types": "tsc --project ./tsconfig.json --emitDeclarationOnly --watch --preserveWatchOutput"
|
|
66
|
+
}
|
|
67
|
+
}
|