oa-componentbook 1.0.1-stage.415 → 1.0.1-stage.416
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.
|
@@ -22,7 +22,7 @@ var _Typography = _interopRequireDefault(require("../oa-component-typography/Typ
|
|
|
22
22
|
var _ColorVariablesMap = _interopRequireDefault(require("../../global-css/ColorVariablesMap"));
|
|
23
23
|
require("antd/dist/reset.css");
|
|
24
24
|
var _Elevation = require("../../global-css/Elevation");
|
|
25
|
-
const _excluded = ["allText", "children", "defaultValue", "data-test", "mode", "onSelectionChange", "options", "placeholder", "maxSelectForMultiSelect", "onCustomSelect"],
|
|
25
|
+
const _excluded = ["allText", "children", "defaultValue", "data-test", "mode", "onSelectionChange", "options", "placeholder", "maxSelectForMultiSelect", "onCustomSelect", "fixedValue"],
|
|
26
26
|
_excluded2 = ["label", "disabled", "value"];
|
|
27
27
|
var _templateObject;
|
|
28
28
|
/* eslint-disable */
|
|
@@ -82,7 +82,8 @@ function CustomSelect(_ref) {
|
|
|
82
82
|
options,
|
|
83
83
|
placeholder,
|
|
84
84
|
maxSelectForMultiSelect,
|
|
85
|
-
onCustomSelect
|
|
85
|
+
onCustomSelect,
|
|
86
|
+
fixedValue
|
|
86
87
|
} = _ref,
|
|
87
88
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
88
89
|
// If allText is present in default values, we select all the options manually.
|
|
@@ -281,6 +282,10 @@ function CustomSelect(_ref) {
|
|
|
281
282
|
}
|
|
282
283
|
} else if (value === allText) {
|
|
283
284
|
newlySelectedOptions.length = 0; // Emptying the array.
|
|
285
|
+
// If fixedValue has values, push them to newlySelectedOptions
|
|
286
|
+
if ((fixedValue === null || fixedValue === void 0 ? void 0 : fixedValue.length) > 0) {
|
|
287
|
+
fixedValue.forEach(val => safePush(newlySelectedOptions, val));
|
|
288
|
+
}
|
|
284
289
|
} else {
|
|
285
290
|
var _newlySelectedOptions2;
|
|
286
291
|
newlySelectedOptions.splice((_newlySelectedOptions2 = newlySelectedOptions.indexOf) === null || _newlySelectedOptions2 === void 0 ? void 0 : _newlySelectedOptions2.call(newlySelectedOptions, value), 1);
|
|
@@ -416,7 +421,8 @@ CustomSelect.propTypes = {
|
|
|
416
421
|
})),
|
|
417
422
|
size: _propTypes.default.oneOf(["small", "middle"]),
|
|
418
423
|
placeholder: _propTypes.default.string,
|
|
419
|
-
maxSelectForMultiSelect: _propTypes.default.number
|
|
424
|
+
maxSelectForMultiSelect: _propTypes.default.number,
|
|
425
|
+
fixedValue: _propTypes.default.arrayOf(_propTypes.default.string)
|
|
420
426
|
};
|
|
421
427
|
CustomSelect.defaultProps = {
|
|
422
428
|
allText: null,
|
|
@@ -428,5 +434,6 @@ CustomSelect.defaultProps = {
|
|
|
428
434
|
options: [],
|
|
429
435
|
size: "middle",
|
|
430
436
|
placeholder: "",
|
|
431
|
-
maxSelectForMultiSelect: null
|
|
437
|
+
maxSelectForMultiSelect: null,
|
|
438
|
+
fixedValue: []
|
|
432
439
|
};
|