@portnet/ui 0.0.56 → 0.0.58
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.
|
@@ -271,7 +271,7 @@ PuiCheckbox.propTypes = {
|
|
|
271
271
|
id: _propTypes.default.string,
|
|
272
272
|
className: _propTypes.default.string,
|
|
273
273
|
sx: _propTypes.default.object,
|
|
274
|
-
label: _propTypes.default.
|
|
274
|
+
label: _propTypes.default.any,
|
|
275
275
|
name: _propTypes.default.string,
|
|
276
276
|
helperText: _propTypes.default.string,
|
|
277
277
|
asArray: _propTypes.default.bool,
|
|
@@ -13,7 +13,7 @@ var _useAxios = _interopRequireDefault(require("../../../hooks/useAxios"));
|
|
|
13
13
|
var _PuiAutocomplete = _interopRequireDefault(require("../../inputs/PuiAutocomplete"));
|
|
14
14
|
var _PuiSelect = _interopRequireDefault(require("../../inputs/PuiSelect"));
|
|
15
15
|
var _ReferetielContext = _interopRequireDefault(require("../common/ReferetielContext"));
|
|
16
|
-
const _excluded = ["id", "className", "sx", "label", "searchKey", "name", "value", "error", "disabled", "specifications", "autocomplete", "required", "focused", "formik", "fullWidth", "helperText", "readOnly", "onError", "onChange", "isOptionEqualToValue", "getOptionKey", "getOptionValue", "getOptionLabel"];
|
|
16
|
+
const _excluded = ["id", "className", "sx", "label", "searchKey", "name", "value", "error", "disabled", "specifications", "autocomplete", "required", "focused", "formik", "fullWidth", "helperText", "readOnly", "onError", "onChange", "isOptionEqualToValue", "getOptionKey", "getOptionValue", "getOptionLabel", "filterFunc"];
|
|
17
17
|
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); }
|
|
18
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
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -75,7 +75,8 @@ const PuiSimpleReferentielField = _ref2 => {
|
|
|
75
75
|
isOptionEqualToValue,
|
|
76
76
|
getOptionKey,
|
|
77
77
|
getOptionValue,
|
|
78
|
-
getOptionLabel
|
|
78
|
+
getOptionLabel,
|
|
79
|
+
filterFunc
|
|
79
80
|
} = _ref2,
|
|
80
81
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
81
82
|
const {
|
|
@@ -142,7 +143,7 @@ const PuiSimpleReferentielField = _ref2 => {
|
|
|
142
143
|
helperText: helperText || dataFetchingState.error,
|
|
143
144
|
readOnly: readOnly || dataFetchingState.isFailed,
|
|
144
145
|
loading: dataFetchingState.isLoading,
|
|
145
|
-
options: simpleReferentielData[searchKey],
|
|
146
|
+
options: simpleReferentielData[searchKey].filter(filterFunc),
|
|
146
147
|
onChange,
|
|
147
148
|
isOptionEqualToValue,
|
|
148
149
|
getOptionKey,
|
|
@@ -168,6 +169,7 @@ PuiSimpleReferentielField.propTypes = {
|
|
|
168
169
|
readOnly: _propTypes.default.bool,
|
|
169
170
|
fullWidth: _propTypes.default.bool,
|
|
170
171
|
options: _propTypes.default.array,
|
|
172
|
+
filterFunc: _propTypes.default.func,
|
|
171
173
|
onChange: _propTypes.default.func,
|
|
172
174
|
onError: _propTypes.default.func,
|
|
173
175
|
isOptionEqualToValue: _propTypes.default.func,
|
|
@@ -184,6 +186,7 @@ PuiSimpleReferentielField.defaultProps = {
|
|
|
184
186
|
readOnly: false,
|
|
185
187
|
autocomplete: false,
|
|
186
188
|
specifications: {},
|
|
189
|
+
filterFunc: value => true,
|
|
187
190
|
onChange: () => {},
|
|
188
191
|
onError: () => {},
|
|
189
192
|
getOptionLabel: option => option.description,
|