@steroidsjs/core 2.2.66 → 2.2.69

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.
package/README.md CHANGED
@@ -1,3 +1,9 @@
1
1
  # Steroids for React
2
2
 
3
- Для справки по библиотеке обратитесь к [основной документации](docs/index.md)
3
+ Find documentation [here](docs/index.md)
4
+
5
+ ## Use package from source in project
6
+
7
+ 1. Copy `tsconfig-debug.json.sample` to `tsconfig-debug.json`
8
+ 2. Replace `outDir` path to node_modules nest path in project
9
+ 3. Run from this directory `yarn run watch`
@@ -138,8 +138,7 @@ function useDataSelect(config) {
138
138
  }
139
139
  });
140
140
  newSelectedIds.sort();
141
- if (!isEqual_1["default"](prevConfigSelectedIds, newSelectedIds)
142
- && !isEqual_1["default"](selectedIds, newSelectedIds) && newSelectedIds.length !== 0) {
141
+ if (!isEqual_1["default"](prevConfigSelectedIds, newSelectedIds) && !isEqual_1["default"](selectedIds, newSelectedIds)) {
143
142
  setSelectedIdsInternal(newSelectedIds);
144
143
  }
145
144
  }, [config.selectedIds, prevConfigSelectedIds, selectedIds, selectedItems]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steroidsjs/core",
3
- "version": "2.2.66",
3
+ "version": "2.2.69",
4
4
  "description": "",
5
5
  "author": "Vladimir Kozhin <hello@kozhindev.com>",
6
6
  "repository": {
@@ -20,7 +20,8 @@
20
20
  "scripts": {
21
21
  "docs": "typedoc --ignoreCompilerErrors --json typedoc.json .",
22
22
  "test": "jest",
23
- "build": "tsc && cp ./{package.json,LICENSE,README.md} dist/ && cp src/index.d.ts dist/"
23
+ "build": "tsc && cp ./{package.json,LICENSE,README.md} dist/ && cp src/index.d.ts dist/",
24
+ "watch": "tsc -p tsconfig-debug.json"
24
25
  },
25
26
  "dependencies": {
26
27
  "axios": "^0.21.1",
package/reducers/form.js CHANGED
@@ -19,6 +19,7 @@ var get_1 = __importDefault(require("lodash-es/get"));
19
19
  var isEqual_1 = __importDefault(require("lodash-es/isEqual"));
20
20
  var cloneDeep_1 = __importDefault(require("lodash-es/cloneDeep"));
21
21
  var isObject_1 = __importDefault(require("lodash-es/isObject"));
22
+ var isEmpty_1 = __importDefault(require("lodash-es/isEmpty"));
22
23
  var dot_prop_immutable_1 = require("dot-prop-immutable");
23
24
  var form_1 = require("../actions/form");
24
25
  /**
@@ -35,7 +36,7 @@ function reducerItem(state, action) {
35
36
  }
36
37
  switch (action.type) {
37
38
  case form_1.FORM_INITIALIZE:
38
- return __assign(__assign({ errors: {}, isInvalid: false, isSubmitting: false }, state), { values: cloneDeep_1["default"](action.values || {}) || (state === null || state === void 0 ? void 0 : state.values), initialValues: action.values || (state === null || state === void 0 ? void 0 : state.values) || null });
39
+ return __assign(__assign({ errors: {}, isInvalid: false, isSubmitting: false }, state), { values: cloneDeep_1["default"](action.values) || (state === null || state === void 0 ? void 0 : state.values) || {}, initialValues: action.values || (state === null || state === void 0 ? void 0 : state.values) || null });
39
40
  case form_1.FORM_CHANGE:
40
41
  if (isObject_1["default"](action.nameOrObject)) {
41
42
  var newValues = __assign(__assign({}, state.values), action.nameOrObject);
@@ -46,7 +47,7 @@ function reducerItem(state, action) {
46
47
  }
47
48
  return dot_prop_immutable_1.set(state, 'values.' + action.nameOrObject, action.value);
48
49
  case form_1.FORM_SET_ERRORS:
49
- return dot_prop_immutable_1.set(state, 'errors', action.errors);
50
+ return __assign(__assign({}, state), { errors: action.errors, isInvalid: !isEmpty_1["default"](action.errors) });
50
51
  case form_1.FORM_SUBMIT:
51
52
  return dot_prop_immutable_1.set(state, 'submitCounter', (state.submitCounter || 0) + 1);
52
53
  case form_1.FORM_SET_SUBMITTING:
@@ -151,6 +151,7 @@ export interface IFormViewProps {
151
151
  submitLabel?: string;
152
152
  fields?: (string | IFieldProps)[];
153
153
  onSubmit: any;
154
+ isInvalid?: boolean;
154
155
  className?: CssClassName;
155
156
  isBordered?: boolean;
156
157
  autoFocus?: boolean;