@steroidsjs/core 3.0.29 → 3.0.31

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.
@@ -19045,6 +19045,24 @@
19045
19045
  "example": null
19046
19046
  }
19047
19047
  ]
19048
+ },
19049
+ {
19050
+ "name": "onItemSelect",
19051
+ "decorators": [],
19052
+ "description": "Callback-функция, которая вызывается при выборе элемента DropDown",
19053
+ "required": false,
19054
+ "type": "void",
19055
+ "example": null,
19056
+ "parameters": [
19057
+ {
19058
+ "name": "selectedId",
19059
+ "decorators": [],
19060
+ "description": "",
19061
+ "required": true,
19062
+ "type": "string | number",
19063
+ "example": null
19064
+ }
19065
+ ]
19048
19066
  }
19049
19067
  ]
19050
19068
  },
@@ -19499,6 +19517,24 @@
19499
19517
  }
19500
19518
  ]
19501
19519
  },
19520
+ {
19521
+ "name": "onItemSelect",
19522
+ "decorators": [],
19523
+ "description": "Callback-функция, которая вызывается при выборе элемента DropDown",
19524
+ "required": false,
19525
+ "type": "void",
19526
+ "example": null,
19527
+ "parameters": [
19528
+ {
19529
+ "name": "selectedId",
19530
+ "decorators": [],
19531
+ "description": "",
19532
+ "required": true,
19533
+ "type": "string | number",
19534
+ "example": null
19535
+ }
19536
+ ]
19537
+ },
19502
19538
  {
19503
19539
  "name": "onOpen",
19504
19540
  "decorators": [],
package/hooks/useList.js CHANGED
@@ -266,7 +266,9 @@ function useList(config) {
266
266
  }, [dispatch, config.items, config.listId]);
267
267
  // Destroy
268
268
  (0, react_use_1.useUnmount)(function () {
269
- var autoDestroy = typeof config.autoDestroy === 'boolean' ? config.autoDestroy : exports.defaultConfig.autoDestroy;
269
+ var autoDestroy = typeof config.autoDestroy === 'boolean'
270
+ ? config.autoDestroy
271
+ : exports.defaultConfig.autoDestroy;
270
272
  if (autoDestroy) {
271
273
  dispatch([
272
274
  (0, list_2.listDestroy)(config.listId),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steroidsjs/core",
3
- "version": "3.0.29",
3
+ "version": "3.0.31",
4
4
  "description": "",
5
5
  "author": "Vladimir Kozhin <hello@kozhindev.com>",
6
6
  "repository": {
package/reducers/list.js CHANGED
@@ -95,7 +95,8 @@ var reducerMap = (_a = {},
95
95
  },
96
96
  _a[list_1.LIST_DESTROY] = function (state, action) {
97
97
  delete state.lists[action.listId];
98
- return __assign(__assign({}, state), { lists: __assign({}, state.lists) });
98
+ delete state.selectedIds[action.listId];
99
+ return __assign(__assign({}, state), { lists: __assign({}, state.lists), selectedIds: __assign({}, state.selectedIds) });
99
100
  },
100
101
  _a[list_1.LIST_TOGGLE_ITEM] = function (state, action) {
101
102
  var _a;
@@ -130,6 +130,10 @@ export interface IDropDownFieldProps extends IFieldWrapperInputProps, Omit<IData
130
130
  * Кастомная вьюшка для элемента
131
131
  */
132
132
  itemView?: CustomView;
133
+ /**
134
+ * Callback-функция, которая вызывается при выборе элемента DropDown
135
+ */
136
+ onItemSelect?: (selectedId: string | number) => void;
133
137
  /**
134
138
  * Callback-функция, которая вызывается при закрытии DropDown
135
139
  */
@@ -127,7 +127,10 @@ function DropDownField(props) {
127
127
  return;
128
128
  }
129
129
  setSelectedIds(id);
130
- }, [normalizedItemToSelectAll, setSelectedAll, setSelectedIds]);
130
+ if (props.onItemSelect) {
131
+ props.onItemSelect(id);
132
+ }
133
+ }, [normalizedItemToSelectAll === null || normalizedItemToSelectAll === void 0 ? void 0 : normalizedItemToSelectAll.id, props, setSelectedAll, setSelectedIds]);
131
134
  var onItemRemove = (0, react_1.useCallback)(function (id) {
132
135
  setSelectedIds(selectedIds.filter(function (i) { return i !== id; }));
133
136
  }, [selectedIds, setSelectedIds]);
@@ -126,6 +126,7 @@ export interface IGridColumn {
126
126
  percentageAttribute: string;
127
127
  }[];
128
128
  };
129
+ [key: string]: any;
129
130
  }
130
131
  /**
131
132
  * Grid