@steroidsjs/core 2.2.13 → 2.2.14

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.
@@ -84,6 +84,11 @@ export interface IListConfig {
84
84
  * @example true
85
85
  */
86
86
  autoDestroy?: boolean;
87
+ /**
88
+ * Отправлять запрос на обновление данных при изменении данных формы. По-умолчанию - включено.
89
+ * @example false
90
+ */
91
+ autoFetchOnFormChanges?: boolean;
87
92
  /**
88
93
  * Обработчик, который вызывается при изменении значений формы, и нужен для подгрузки новых элементов коллекции
89
94
  * @param {IList} list
package/hooks/useList.js CHANGED
@@ -226,10 +226,12 @@ function useList(config) {
226
226
  // Sync with address bar
227
227
  updateQuery(formValues);
228
228
  // Send request
229
- dispatch(list_2.listLazyFetch(config.listId));
229
+ if (config.autoFetchOnFormChanges !== false) {
230
+ dispatch(list_2.listLazyFetch(config.listId));
231
+ }
230
232
  }
231
- }, [config.listId, dispatch, formId, formValues, paginationProps.attribute,
232
- paginationProps.defaultValue, prevFormValues, updateQuery]);
233
+ }, [config.autoFetchOnFormChanges, config.listId, dispatch, formId, formValues,
234
+ paginationProps.attribute, paginationProps.defaultValue, prevFormValues, updateQuery]);
233
235
  // Check change query
234
236
  var prevQuery = react_use_1.usePrevious(config.query);
235
237
  react_use_1.useUpdateEffect(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steroidsjs/core",
3
- "version": "2.2.13",
3
+ "version": "2.2.14",
4
4
  "description": "",
5
5
  "author": "Vladimir Kozhin <hello@kozhindev.com>",
6
6
  "repository": {
@@ -64,7 +64,8 @@ function Grid(props) {
64
64
  searchModel: props.searchModel,
65
65
  items: props.items,
66
66
  initialItems: props.initialItems,
67
- initialTotal: props.initialTotal
67
+ initialTotal: props.initialTotal,
68
+ autoFetchOnFormChanges: props.autoFetchOnFormChanges
68
69
  }), list = _a.list, model = _a.model, searchModel = _a.searchModel, paginationPosition = _a.paginationPosition, paginationSizePosition = _a.paginationSizePosition, layoutNamesPosition = _a.layoutNamesPosition, renderList = _a.renderList, renderEmpty = _a.renderEmpty, renderPagination = _a.renderPagination, renderPaginationSize = _a.renderPaginationSize, renderLayoutNames = _a.renderLayoutNames, renderSearchForm = _a.renderSearchForm, onFetch = _a.onFetch, onSort = _a.onSort;
69
70
  var renderLabel = react_1.useCallback(function (column) {
70
71
  if (column.headerView) {
@@ -59,7 +59,8 @@ function List(props) {
59
59
  searchModel: props.searchModel,
60
60
  items: props.items,
61
61
  initialItems: props.initialItems,
62
- initialTotal: props.initialTotal
62
+ initialTotal: props.initialTotal,
63
+ autoFetchOnFormChanges: props.autoFetchOnFormChanges
63
64
  }), list = _a.list, paginationPosition = _a.paginationPosition, paginationSizePosition = _a.paginationSizePosition, layoutNamesPosition = _a.layoutNamesPosition, renderList = _a.renderList, renderEmpty = _a.renderEmpty, renderPagination = _a.renderPagination, renderPaginationSize = _a.renderPaginationSize, renderLayoutNames = _a.renderLayoutNames, renderSearchForm = _a.renderSearchForm;
64
65
  var ItemView = props.itemView || components.ui.getView('list.ListItemView');
65
66
  var content = ((list === null || list === void 0 ? void 0 : list.items) || []).map(function (item, index) { return (React.createElement(ItemView, __assign({}, props.itemProps, { key: item[props.primaryKey] || index, primaryKey: props.primaryKey, item: item, index: index, layoutSelected: list.layoutName }))); });