Skip to content

Commit 4772752

Browse files
Merge pull request #25 from iron-tech-space/v0.91-Select-and-Form
v0.91 Select and Form components minor fixes
2 parents 21b5fe7 + a9a43b8 commit 4772752

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.0.91
2+
3+
- Value of `password` field no longer logs into the console when submitting form
4+
- Add `revertSearchField` prop for `Select` component
5+
16
## 0.0.90
27

38
- Fix select all bug while undefined value in Select comp (multiple mode)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rt-design",
3-
"version": "0.0.90",
3+
"version": "0.0.91",
44
"description": "React technical design library",
55
"author": "Iron tech space",
66
"license": "MIT",

src/components/Form/Form.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,11 @@ const Form = (props) => {
104104
...initFormData,
105105
...values,
106106
};
107-
console.log(`Success form [${props.name ? props.name : 'no name form'}]: `, saveObject);
107+
// exclude password from info object
108+
console.info(
109+
`Success form [${props.name ? props.name : 'no name form'}]: %o`,
110+
Object.keys(saveObject).reduce((acc, key) => key === 'password' ? acc : { ...acc, [key]: saveObject[key] }, {})
111+
);
108112
if (requestSaveForm && methodSaveForm) {
109113
requestSaveForm({
110114
method: methodSaveForm,

src/components/Select/Select.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const Select = props => {
4848
widthControl,
4949
pageSize,
5050
debounceDelay,
51+
revertSearchValue,
5152

5253
// Ant Props
5354
mode,
@@ -91,6 +92,10 @@ const Select = props => {
9192
});
9293
}, []);
9394

95+
useEffect(() => {
96+
_setSearchValue(revertSearchValue);
97+
}, [revertSearchValue]);
98+
9499
useEffect(() => {
95100
if (isMounted) {
96101
_setRowsHandler(options);
@@ -382,20 +387,23 @@ Select.propTypes = {
382387
/** Значение строки поиска */
383388
searchValue: PropTypes.string,
384389

390+
/** Сброс строки поиска вложенного инпута */
391+
revertSearchValue: PropTypes.string,
392+
385393
/** Имя параметра для поиска */
386394
searchParamName: PropTypes.string,
387395

388396
lostParamName: PropTypes.string,
389397

390-
/** Режим загружки по скроллу */
398+
/** Режим загрузки по скроллу */
391399
infinityMode: PropTypes.bool,
392400

393401
/** Функция запроса для загрузки строк (данных) */
394402
requestLoadRows: PropTypes.func,
395403

396404
/** Функция преобразования загруженных объектов в объекты для селекта.
397405
* Сигнатура `(option) => ({})`
398-
* Требоваеть вернуть объект с параметрам
406+
* Требовать вернуть объект с параметрам
399407
* `{ label: ReactNode, value: any, className: string, disabled: bool }`
400408
* ##### Example:
401409
* ``` JS

0 commit comments

Comments
 (0)