@gravity-ui/dynamic-forms 4.0.0 → 4.1.0

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.
Files changed (105) hide show
  1. package/build/cjs/lib/core/components/Form/Controller/Controller.js +2 -2
  2. package/build/cjs/lib/core/components/Form/Controller/utils.js +45 -34
  3. package/build/cjs/lib/core/components/Form/DynamicField.js +6 -4
  4. package/build/cjs/lib/core/components/Form/hooks/useCreateContext.js +2 -2
  5. package/build/cjs/lib/core/components/Form/hooks/useCreateSearchContext.js +2 -2
  6. package/build/cjs/lib/core/components/Form/hooks/useIntegrationFF.js +6 -4
  7. package/build/cjs/lib/core/components/Form/hooks/useMutators.js +11 -7
  8. package/build/cjs/lib/core/components/Form/hooks/useSearchStore.js +4 -3
  9. package/build/cjs/lib/core/components/Form/hooks/useStore.js +15 -11
  10. package/build/cjs/lib/core/components/Form/utils/common.js +14 -11
  11. package/build/cjs/lib/core/components/View/helpers.js +5 -5
  12. package/build/cjs/lib/core/components/View/hooks/useComponents.js +2 -2
  13. package/build/cjs/lib/core/components/View/hooks/useCreateContext.js +2 -2
  14. package/build/cjs/lib/core/components/View/hooks/useRender.js +4 -3
  15. package/build/cjs/lib/core/helpers.js +5 -4
  16. package/build/cjs/lib/kit/components/AccordeonCard/AccordeonCard.js +2 -2
  17. package/build/cjs/lib/kit/components/Card/Card.js +2 -2
  18. package/build/cjs/lib/kit/components/GenerateRandomValueButton/GenerateRandomValueButton.js +2 -2
  19. package/build/cjs/lib/kit/components/Inputs/ArrayBase/ArrayBase.js +2 -2
  20. package/build/cjs/lib/kit/components/Inputs/CardOneOf/CardOneOf.js +2 -2
  21. package/build/cjs/lib/kit/components/Inputs/MultiOneOf/MultiOneOf.js +4 -3
  22. package/build/cjs/lib/kit/components/Inputs/ObjectBase/ObjectBase.css +6 -0
  23. package/build/cjs/lib/kit/components/Inputs/ObjectBase/ObjectBase.js +11 -5
  24. package/build/cjs/lib/kit/components/Inputs/ObjectValueInput/ObjectValueInput.js +7 -6
  25. package/build/cjs/lib/kit/components/Inputs/OneOf/OneOf.js +2 -2
  26. package/build/cjs/lib/kit/components/Inputs/Secret/Secret.js +4 -3
  27. package/build/cjs/lib/kit/components/Inputs/TableArrayInput/TableArrayInput.js +4 -3
  28. package/build/cjs/lib/kit/components/Inputs/Text/Text.js +2 -2
  29. package/build/cjs/lib/kit/components/Inputs/TextContent/TextContent.js +2 -2
  30. package/build/cjs/lib/kit/components/Inputs/TextLink/TextLink.js +4 -3
  31. package/build/cjs/lib/kit/components/LazyLoader/LazyLoader.js +2 -2
  32. package/build/cjs/lib/kit/components/ViewLayouts/ViewAccordeon/ViewAccordeon.js +2 -2
  33. package/build/cjs/lib/kit/components/ViewLayouts/ViewAccordeonCard/ViewAccordeonCard.js +2 -2
  34. package/build/cjs/lib/kit/components/ViewLayouts/ViewCardAccordeon.js +2 -2
  35. package/build/cjs/lib/kit/components/Views/ArrayBaseView/ArrayBaseView.js +2 -2
  36. package/build/cjs/lib/kit/components/Views/BaseView/BaseView.js +2 -2
  37. package/build/cjs/lib/kit/components/Views/CardOneOfView.js +2 -2
  38. package/build/cjs/lib/kit/components/Views/MultiOneOfView/MultiOneOfView.js +2 -2
  39. package/build/cjs/lib/kit/components/Views/ObjectBaseView/ObjectBaseView.css +6 -0
  40. package/build/cjs/lib/kit/components/Views/ObjectBaseView/ObjectBaseView.js +16 -9
  41. package/build/cjs/lib/kit/components/Views/ObjectValueInputView/ObjectValueInputView.js +5 -5
  42. package/build/cjs/lib/kit/components/Views/OneOfView/OneOfView.js +17 -6
  43. package/build/cjs/lib/kit/components/Views/TextLinkView/TextLinkView.js +2 -2
  44. package/build/cjs/lib/kit/constants/common.js +2 -1
  45. package/build/cjs/lib/kit/hooks/useOneOf/useOneOf.css +5 -0
  46. package/build/cjs/lib/kit/hooks/useOneOf/useOneOf.js +35 -7
  47. package/build/cjs/lib/kit/utils/common.js +30 -25
  48. package/build/cjs/lib/kit/utils/index.js +1 -0
  49. package/build/cjs/lib/kit/utils/objectKeys.js +7 -0
  50. package/build/cjs/lib/kit/validators/validators.js +9 -7
  51. package/build/esm/lib/core/components/Form/Controller/Controller.js +2 -2
  52. package/build/esm/lib/core/components/Form/Controller/utils.js +45 -34
  53. package/build/esm/lib/core/components/Form/DynamicField.js +6 -4
  54. package/build/esm/lib/core/components/Form/hooks/useCreateContext.js +2 -2
  55. package/build/esm/lib/core/components/Form/hooks/useCreateSearchContext.js +2 -2
  56. package/build/esm/lib/core/components/Form/hooks/useIntegrationFF.js +6 -4
  57. package/build/esm/lib/core/components/Form/hooks/useMutators.js +11 -7
  58. package/build/esm/lib/core/components/Form/hooks/useSearchStore.js +4 -3
  59. package/build/esm/lib/core/components/Form/hooks/useStore.js +15 -11
  60. package/build/esm/lib/core/components/Form/utils/common.js +14 -11
  61. package/build/esm/lib/core/components/View/helpers.js +5 -5
  62. package/build/esm/lib/core/components/View/hooks/useComponents.js +2 -2
  63. package/build/esm/lib/core/components/View/hooks/useCreateContext.js +2 -2
  64. package/build/esm/lib/core/components/View/hooks/useRender.js +4 -3
  65. package/build/esm/lib/core/helpers.js +5 -4
  66. package/build/esm/lib/core/types/specs.d.ts +3 -1
  67. package/build/esm/lib/kit/components/AccordeonCard/AccordeonCard.js +2 -2
  68. package/build/esm/lib/kit/components/Card/Card.js +2 -2
  69. package/build/esm/lib/kit/components/GenerateRandomValueButton/GenerateRandomValueButton.js +2 -2
  70. package/build/esm/lib/kit/components/Inputs/ArrayBase/ArrayBase.js +2 -2
  71. package/build/esm/lib/kit/components/Inputs/CardOneOf/CardOneOf.js +2 -2
  72. package/build/esm/lib/kit/components/Inputs/MultiOneOf/MultiOneOf.js +4 -3
  73. package/build/esm/lib/kit/components/Inputs/ObjectBase/ObjectBase.css +6 -0
  74. package/build/esm/lib/kit/components/Inputs/ObjectBase/ObjectBase.js +12 -6
  75. package/build/esm/lib/kit/components/Inputs/ObjectValueInput/ObjectValueInput.js +5 -4
  76. package/build/esm/lib/kit/components/Inputs/OneOf/OneOf.js +2 -2
  77. package/build/esm/lib/kit/components/Inputs/Secret/Secret.js +4 -3
  78. package/build/esm/lib/kit/components/Inputs/TableArrayInput/TableArrayInput.js +4 -3
  79. package/build/esm/lib/kit/components/Inputs/Text/Text.js +2 -2
  80. package/build/esm/lib/kit/components/Inputs/TextContent/TextContent.js +2 -2
  81. package/build/esm/lib/kit/components/Inputs/TextLink/TextLink.js +4 -3
  82. package/build/esm/lib/kit/components/LazyLoader/LazyLoader.js +2 -2
  83. package/build/esm/lib/kit/components/ViewLayouts/ViewAccordeon/ViewAccordeon.js +2 -2
  84. package/build/esm/lib/kit/components/ViewLayouts/ViewAccordeonCard/ViewAccordeonCard.js +2 -2
  85. package/build/esm/lib/kit/components/ViewLayouts/ViewCardAccordeon.js +2 -2
  86. package/build/esm/lib/kit/components/Views/ArrayBaseView/ArrayBaseView.js +2 -2
  87. package/build/esm/lib/kit/components/Views/BaseView/BaseView.js +2 -2
  88. package/build/esm/lib/kit/components/Views/CardOneOfView.js +2 -2
  89. package/build/esm/lib/kit/components/Views/MultiOneOfView/MultiOneOfView.js +2 -2
  90. package/build/esm/lib/kit/components/Views/ObjectBaseView/ObjectBaseView.css +6 -0
  91. package/build/esm/lib/kit/components/Views/ObjectBaseView/ObjectBaseView.js +16 -9
  92. package/build/esm/lib/kit/components/Views/ObjectValueInputView/ObjectValueInputView.js +3 -3
  93. package/build/esm/lib/kit/components/Views/OneOfView/OneOfView.js +18 -7
  94. package/build/esm/lib/kit/components/Views/TextLinkView/TextLinkView.js +2 -2
  95. package/build/esm/lib/kit/constants/common.d.ts +1 -0
  96. package/build/esm/lib/kit/constants/common.js +1 -0
  97. package/build/esm/lib/kit/hooks/useOneOf/useOneOf.css +5 -0
  98. package/build/esm/lib/kit/hooks/useOneOf/useOneOf.js +37 -9
  99. package/build/esm/lib/kit/utils/common.js +30 -25
  100. package/build/esm/lib/kit/utils/index.d.ts +1 -0
  101. package/build/esm/lib/kit/utils/index.js +1 -0
  102. package/build/esm/lib/kit/utils/objectKeys.d.ts +4 -0
  103. package/build/esm/lib/kit/utils/objectKeys.js +3 -0
  104. package/build/esm/lib/kit/validators/validators.js +9 -7
  105. package/package.json +1 -1
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Controller = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
- const lodash_1 = tslib_1.__importDefault(require("lodash"));
6
+ const omit_1 = tslib_1.__importDefault(require("lodash/omit"));
7
7
  const hooks_1 = require("../hooks");
8
8
  const utils_1 = require("./utils");
9
9
  const Controller = ({ spec: _spec, name, value: valueFromParent, parentOnChange, parentOnUnmount, }) => {
@@ -72,7 +72,7 @@ const Controller = ({ spec: _spec, name, value: valueFromParent, parentOnChange,
72
72
  onItemRemove: methods.onItemRemove,
73
73
  onDrop: methods.onDrop,
74
74
  },
75
- meta: Object.assign(Object.assign({}, lodash_1.default.omit(store.state, 'value')), { submitFailed: store.tools.submitFailed }),
75
+ meta: Object.assign(Object.assign({}, (0, omit_1.default)(store.state, 'value')), { submitFailed: store.tools.submitFailed }),
76
76
  }), [methods, store.name, store.state, store.tools.submitFailed]);
77
77
  const withSearch = (0, hooks_1.useSearch)(store.spec, store.state.value, store.name);
78
78
  (0, hooks_1.useControllerMirror)(store.name, {
@@ -3,19 +3,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateStore = exports.initializeStore = exports.getFieldMethods = exports.getFieldInitials = exports.getValidate = exports.getRender = exports.getComponents = exports.getSpec = exports.callUnmout = exports.updateParentStore = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
- const lodash_1 = tslib_1.__importDefault(require("lodash"));
6
+ const cloneDeep_1 = tslib_1.__importDefault(require("lodash/cloneDeep"));
7
+ const get_1 = tslib_1.__importDefault(require("lodash/get"));
8
+ const isArray_1 = tslib_1.__importDefault(require("lodash/isArray"));
9
+ const isBoolean_1 = tslib_1.__importDefault(require("lodash/isBoolean"));
10
+ const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
11
+ const isFunction_1 = tslib_1.__importDefault(require("lodash/isFunction"));
12
+ const isNil_1 = tslib_1.__importDefault(require("lodash/isNil"));
13
+ const isString_1 = tslib_1.__importDefault(require("lodash/isString"));
14
+ const isUndefined_1 = tslib_1.__importDefault(require("lodash/isUndefined"));
15
+ const keys_1 = tslib_1.__importDefault(require("lodash/keys"));
16
+ const merge_1 = tslib_1.__importDefault(require("lodash/merge"));
17
+ const omit_1 = tslib_1.__importDefault(require("lodash/omit"));
7
18
  const react_is_1 = require("react-is");
8
19
  const constants_1 = require("../../../constants");
9
20
  const helpers_1 = require("../../../helpers");
10
21
  const constants_2 = require("../constants");
11
22
  const utils_1 = require("../utils");
12
23
  const isErrorMutatorCorrect = (errorMutator) => errorMutator !== constants_2.EMPTY_MUTATOR &&
13
- (lodash_1.default.isString(errorMutator.value) ||
14
- lodash_1.default.isBoolean(errorMutator.value) ||
15
- lodash_1.default.isUndefined(errorMutator.value));
24
+ ((0, isString_1.default)(errorMutator.value) ||
25
+ (0, isBoolean_1.default)(errorMutator.value) ||
26
+ (0, isUndefined_1.default)(errorMutator.value));
16
27
  const isValueMutatorCorrect = (valueMutator, spec) => valueMutator !== constants_2.EMPTY_MUTATOR &&
17
28
  (typeof valueMutator.value === spec.type ||
18
- (lodash_1.default.isArray(valueMutator.value) && spec.type === constants_1.SpecTypes.Array) ||
29
+ ((0, isArray_1.default)(valueMutator.value) && spec.type === constants_1.SpecTypes.Array) ||
19
30
  valueMutator.value === undefined);
20
31
  const updateParentStore = (store) => {
21
32
  (store.parentOnChange ? store.parentOnChange : store.tools.onChange)(store.name, store.state.value, Object.assign(Object.assign({}, store.state.childErrors), { [store.name]: store.state.error }));
@@ -26,9 +37,9 @@ const callUnmout = (store) => {
26
37
  };
27
38
  exports.callUnmout = callUnmout;
28
39
  const getSpec = ({ name, spec, mutatorsStore, }) => {
29
- const mutator = lodash_1.default.get(mutatorsStore.spec, name, constants_2.EMPTY_MUTATOR);
40
+ const mutator = (0, get_1.default)(mutatorsStore.spec, name, constants_2.EMPTY_MUTATOR);
30
41
  if (mutator !== constants_2.EMPTY_MUTATOR) {
31
- const mutatedSpec = lodash_1.default.merge(lodash_1.default.cloneDeep(spec), mutator.value);
42
+ const mutatedSpec = (0, merge_1.default)((0, cloneDeep_1.default)(spec), mutator.value);
32
43
  if ((0, helpers_1.isCorrectSpec)(mutatedSpec)) {
33
44
  return mutatedSpec;
34
45
  }
@@ -46,7 +57,7 @@ const getComponents = ({ spec, config, }) => {
46
57
  result.inputEntity = entity;
47
58
  }
48
59
  }
49
- if (layouts && lodash_1.default.isString(spec.viewSpec.layout)) {
60
+ if (layouts && (0, isString_1.default)(spec.viewSpec.layout)) {
50
61
  const Component = layouts[spec.viewSpec.layout];
51
62
  if ((0, react_is_1.isValidElementType)(Component)) {
52
63
  result.Layout = Component;
@@ -58,7 +69,7 @@ const getComponents = ({ spec, config, }) => {
58
69
  exports.getComponents = getComponents;
59
70
  const getRender = ({ name, spec, inputEntity, Layout, }) => {
60
71
  const render = (props) => {
61
- if (inputEntity && (0, helpers_1.isCorrectSpec)(spec) && lodash_1.default.isString(name)) {
72
+ if (inputEntity && (0, helpers_1.isCorrectSpec)(spec) && (0, isString_1.default)(name)) {
62
73
  if (!spec.viewSpec.hidden) {
63
74
  const { layoutProps, inputProps } = spec.viewSpec;
64
75
  if (inputEntity.independent) {
@@ -80,14 +91,14 @@ const getRender = ({ name, spec, inputEntity, Layout, }) => {
80
91
  exports.getRender = getRender;
81
92
  const getValidate = ({ spec, config, }) => {
82
93
  let validate = () => undefined;
83
- if ((0, utils_1.isCorrectConfig)(config) && (0, helpers_1.isCorrectSpec)(spec)) {
94
+ if ((0, utils_1.isCorrectConfig)(config) && (0, helpers_1.isCorrectSpec)(spec) && !spec.viewSpec.hidden) {
84
95
  const { validators } = config[spec.type];
85
96
  if (validators) {
86
- if ((!lodash_1.default.isString(spec.validator) || !spec.validator.length) &&
87
- lodash_1.default.isFunction(validators.base)) {
97
+ if ((!(0, isString_1.default)(spec.validator) || !spec.validator.length) &&
98
+ (0, isFunction_1.default)(validators.base)) {
88
99
  validate = (value) => validators.base(spec, value);
89
100
  }
90
- if (lodash_1.default.isString(spec.validator) && lodash_1.default.isFunction(validators[spec.validator])) {
101
+ if ((0, isString_1.default)(spec.validator) && (0, isFunction_1.default)(validators[spec.validator])) {
91
102
  validate = (value) => validators[spec.validator](spec, value);
92
103
  }
93
104
  }
@@ -96,12 +107,12 @@ const getValidate = ({ spec, config, }) => {
96
107
  };
97
108
  exports.getValidate = getValidate;
98
109
  const getFieldInitials = ({ name, spec, valueFromParent, initialValue, validate, mutatorsStore, }) => {
99
- const valueMutator = (0, utils_1.transformArrIn)(lodash_1.default.get(mutatorsStore.values, name, constants_2.EMPTY_MUTATOR));
100
- let value = lodash_1.default.cloneDeep(valueFromParent);
110
+ const valueMutator = (0, utils_1.transformArrIn)((0, get_1.default)(mutatorsStore.values, name, constants_2.EMPTY_MUTATOR));
111
+ let value = (0, cloneDeep_1.default)(valueFromParent);
101
112
  if (isValueMutatorCorrect(valueMutator, spec)) {
102
113
  value = valueMutator.value;
103
114
  }
104
- if (lodash_1.default.isNil(value)) {
115
+ if ((0, isNil_1.default)(value)) {
105
116
  if (spec.defaultValue) {
106
117
  value = (0, utils_1.transformArrIn)(spec.defaultValue);
107
118
  }
@@ -116,12 +127,12 @@ const getFieldInitials = ({ name, spec, valueFromParent, initialValue, validate,
116
127
  }
117
128
  }
118
129
  }
119
- let errorMutator = lodash_1.default.get(mutatorsStore.errors, name, constants_2.EMPTY_MUTATOR);
130
+ let errorMutator = (0, get_1.default)(mutatorsStore.errors, name, constants_2.EMPTY_MUTATOR);
120
131
  if (!isErrorMutatorCorrect(errorMutator)) {
121
132
  errorMutator = { value: undefined };
122
133
  }
123
134
  const error = (validate === null || validate === void 0 ? void 0 : validate((0, utils_1.transformArrOut)(value))) || (errorMutator === null || errorMutator === void 0 ? void 0 : errorMutator.value);
124
- const dirty = !lodash_1.default.isEqual(value, initialValue);
135
+ const dirty = !(0, isEqual_1.default)(value, initialValue);
125
136
  return {
126
137
  initialValue,
127
138
  active: false,
@@ -141,7 +152,7 @@ exports.getFieldInitials = getFieldInitials;
141
152
  const getFieldMethods = () => {
142
153
  const onChange = (store, { valOrSetter, childErrors, errorMutator }) => {
143
154
  const { state, validate, spec } = store;
144
- const _value = lodash_1.default.isFunction(valOrSetter) ? valOrSetter(state.value) : valOrSetter;
155
+ const _value = (0, isFunction_1.default)(valOrSetter) ? valOrSetter(state.value) : valOrSetter;
145
156
  const error = (validate === null || validate === void 0 ? void 0 : validate((0, utils_1.transformArrOut)(_value))) || errorMutator;
146
157
  let value = (0, utils_1.transformArrIn)(_value);
147
158
  if ((0, helpers_1.isNumberSpec)(spec) && !error) {
@@ -149,13 +160,13 @@ const getFieldMethods = () => {
149
160
  }
150
161
  let newChildErrors = Object.assign({}, state.childErrors);
151
162
  if (childErrors) {
152
- const nearestChildName = lodash_1.default.keys(childErrors).sort((a, b) => a.length - b.length)[0];
163
+ const nearestChildName = (0, keys_1.default)(childErrors).sort((a, b) => a.length - b.length)[0];
153
164
  if (nearestChildName) {
154
- const existingСhildNames = lodash_1.default.keys(newChildErrors).filter((childName) => childName.startsWith(nearestChildName));
155
- newChildErrors = Object.assign(Object.assign({}, lodash_1.default.omit(newChildErrors, existingСhildNames)), childErrors);
165
+ const existingСhildNames = (0, keys_1.default)(newChildErrors).filter((childName) => childName.startsWith(nearestChildName));
166
+ newChildErrors = Object.assign(Object.assign({}, (0, omit_1.default)(newChildErrors, existingСhildNames)), childErrors);
156
167
  }
157
168
  }
158
- const nextStore = Object.assign(Object.assign({}, store), { state: Object.assign(Object.assign({}, store.state), { dirty: !lodash_1.default.isEqual(value, state.initialValue), error, invalid: Boolean(error), modified: true, pristine: value === state.initialValue, touched: true, valid: !error, value, visited: true, childErrors: newChildErrors }) });
169
+ const nextStore = Object.assign(Object.assign({}, store), { state: Object.assign(Object.assign({}, store.state), { dirty: !(0, isEqual_1.default)(value, state.initialValue), error, invalid: Boolean(error), modified: true, pristine: value === state.initialValue, touched: true, valid: !error, value, visited: true, childErrors: newChildErrors }) });
159
170
  nextStore.afterStoreUpdateCB = () => (0, exports.updateParentStore)(nextStore);
160
171
  return nextStore;
161
172
  };
@@ -181,7 +192,7 @@ const getFieldMethods = () => {
181
192
  if ((0, helpers_1.isArraySpec)(spec) || (0, helpers_1.isObjectSpec)(spec)) {
182
193
  return onChange(store, {
183
194
  valOrSetter: (currentValue) => currentValue
184
- ? lodash_1.default.omit(currentValue, childName.split(`${name}.`)[1])
195
+ ? (0, omit_1.default)(currentValue, childName.split(`${name}.`)[1])
185
196
  : currentValue,
186
197
  childErrors: { [childName]: false },
187
198
  });
@@ -196,7 +207,7 @@ const getFieldMethods = () => {
196
207
  });
197
208
  const value = Object.assign(Object.assign({}, stateValue), { [`<${stateValue[constants_2.OBJECT_ARRAY_CNT]}>`]: (0, utils_1.transformArrIn)(_value), [constants_2.OBJECT_ARRAY_CNT]: stateValue[constants_2.OBJECT_ARRAY_CNT] + 1 });
198
209
  const error = validate === null || validate === void 0 ? void 0 : validate((0, utils_1.transformArrOut)(value));
199
- const nextStore = Object.assign(Object.assign({}, store), { state: Object.assign(Object.assign({}, store.state), { dirty: !lodash_1.default.isEqual(value, store.state.initialValue), error, invalid: Boolean(error), modified: true, pristine: value === store.state.initialValue, touched: true, valid: !error, value, visited: true }) });
210
+ const nextStore = Object.assign(Object.assign({}, store), { state: Object.assign(Object.assign({}, store.state), { dirty: !(0, isEqual_1.default)(value, store.state.initialValue), error, invalid: Boolean(error), modified: true, pristine: value === store.state.initialValue, touched: true, valid: !error, value, visited: true }) });
200
211
  nextStore.afterStoreUpdateCB = () => (0, exports.updateParentStore)(nextStore);
201
212
  return nextStore;
202
213
  };
@@ -225,7 +236,7 @@ const initializeStore = ({ name, spec: _spec, mutatorsStore, config, valueFromPa
225
236
  valueFromParent,
226
237
  validate,
227
238
  mutatorsStore,
228
- initialValue: lodash_1.default.get(tools.initialValue, name),
239
+ initialValue: (0, get_1.default)(tools.initialValue, name),
229
240
  });
230
241
  const initialsStore = {
231
242
  name,
@@ -240,19 +251,19 @@ const initializeStore = ({ name, spec: _spec, mutatorsStore, config, valueFromPa
240
251
  parentOnUnmount,
241
252
  state,
242
253
  };
243
- if (!lodash_1.default.isEqual(valueFromParent, state.value) || state.error) {
254
+ if (!(0, isEqual_1.default)(valueFromParent, state.value) || state.error) {
244
255
  initialsStore.afterStoreUpdateCB = () => (0, exports.updateParentStore)(initialsStore);
245
256
  }
246
257
  return initialsStore;
247
258
  };
248
259
  exports.initializeStore = initializeStore;
249
260
  const updateStore = ({ store, setStore, spec: _spec, name, parentOnChange, parentOnUnmount, mutatorsStore, valueFromParent, config, tools, methodOnChange, }) => {
250
- const storeSpecMutator = lodash_1.default.get(store.mutatorsStore.spec, store.name, constants_2.EMPTY_MUTATOR);
251
- const storeValueMutator = lodash_1.default.get(store.mutatorsStore.values, store.name, constants_2.EMPTY_MUTATOR);
252
- const storeErrorMutator = lodash_1.default.get(store.mutatorsStore.errors, store.name, constants_2.EMPTY_MUTATOR);
253
- const specMutator = lodash_1.default.get(mutatorsStore.spec, name, constants_2.EMPTY_MUTATOR);
254
- const valueMutator = lodash_1.default.get(mutatorsStore.values, name, constants_2.EMPTY_MUTATOR);
255
- const errorMutator = lodash_1.default.get(mutatorsStore.errors, name, constants_2.EMPTY_MUTATOR);
261
+ const storeSpecMutator = (0, get_1.default)(store.mutatorsStore.spec, store.name, constants_2.EMPTY_MUTATOR);
262
+ const storeValueMutator = (0, get_1.default)(store.mutatorsStore.values, store.name, constants_2.EMPTY_MUTATOR);
263
+ const storeErrorMutator = (0, get_1.default)(store.mutatorsStore.errors, store.name, constants_2.EMPTY_MUTATOR);
264
+ const specMutator = (0, get_1.default)(mutatorsStore.spec, name, constants_2.EMPTY_MUTATOR);
265
+ const valueMutator = (0, get_1.default)(mutatorsStore.values, name, constants_2.EMPTY_MUTATOR);
266
+ const errorMutator = (0, get_1.default)(mutatorsStore.errors, name, constants_2.EMPTY_MUTATOR);
256
267
  const valueMutatorUpdated = isValueMutatorCorrect(valueMutator, (0, exports.getSpec)({ name, spec: _spec, mutatorsStore })) &&
257
268
  valueMutator !== storeValueMutator;
258
269
  const errorMutatorUpdated = isErrorMutatorCorrect(errorMutator) && errorMutator !== storeErrorMutator;
@@ -261,7 +272,7 @@ const updateStore = ({ store, setStore, spec: _spec, name, parentOnChange, paren
261
272
  parentOnUnmount !== store.parentOnUnmount ||
262
273
  tools.onChange !== store.tools.onChange ||
263
274
  tools.onUnmount !== store.tools.onUnmount;
264
- const updateAllStore = !lodash_1.default.isEqual(_spec, store.initialSpec) ||
275
+ const updateAllStore = !(0, isEqual_1.default)(_spec, store.initialSpec) ||
265
276
  config !== store.config ||
266
277
  (specMutator !== constants_2.EMPTY_MUTATOR && specMutator !== storeSpecMutator);
267
278
  const updateAllStoreAndClearParentValues = name !== store.name;
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DynamicField = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
- const lodash_1 = tslib_1.__importDefault(require("lodash"));
6
+ const isFunction_1 = tslib_1.__importDefault(require("lodash/isFunction"));
7
+ const isString_1 = tslib_1.__importDefault(require("lodash/isString"));
8
+ const get_1 = tslib_1.__importDefault(require("lodash/get"));
7
9
  const react_is_1 = require("react-is");
8
10
  const helpers_1 = require("../../helpers");
9
11
  const Controller_1 = require("./Controller");
@@ -29,9 +31,9 @@ const DynamicField = ({ name, spec, config, Monaco, generateRandomValue, search,
29
31
  setField,
30
32
  removeField,
31
33
  isHiddenField,
32
- searchFunction: lodash_1.default.isFunction(search) ? search : (0, utils_1.getDefaultSearchFunction)(search),
34
+ searchFunction: (0, isFunction_1.default)(search) ? search : (0, utils_1.getDefaultSearchFunction)(search),
33
35
  }), [isHiddenField, removeField, search, setField]);
34
- const correctParams = react_1.default.useMemo(() => lodash_1.default.isString(name) && (0, helpers_1.isCorrectSpec)(spec) && (0, utils_1.isCorrectConfig)(config), [name, spec, config]);
36
+ const correctParams = react_1.default.useMemo(() => (0, isString_1.default)(name) && (0, helpers_1.isCorrectSpec)(spec) && (0, utils_1.isCorrectConfig)(config), [name, spec, config]);
35
37
  (0, hooks_1.useDynamicFieldMirror)({
36
38
  useStore: { tools, store },
37
39
  useIntegrationFF: watcher,
@@ -40,7 +42,7 @@ const DynamicField = ({ name, spec, config, Monaco, generateRandomValue, search,
40
42
  if (correctParams) {
41
43
  return (react_1.default.createElement(DynamicFormsCtx.Provider, { value: context },
42
44
  react_1.default.createElement(SearchContext.Provider, { value: searchContext },
43
- react_1.default.createElement(Controller_1.Controller, { spec: spec, name: name, parentOnChange: null, parentOnUnmount: null, value: lodash_1.default.get(store.values, name) }),
45
+ react_1.default.createElement(Controller_1.Controller, { spec: spec, name: name, parentOnChange: null, parentOnUnmount: null, value: (0, get_1.default)(store.values, name) }),
44
46
  watcher)));
45
47
  }
46
48
  return null;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useCreateContext = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
- const lodash_1 = tslib_1.__importDefault(require("lodash"));
7
- const createContext = lodash_1.default.once(() => react_1.default.createContext({}));
6
+ const once_1 = tslib_1.__importDefault(require("lodash/once"));
7
+ const createContext = (0, once_1.default)(() => react_1.default.createContext({}));
8
8
  const useCreateContext = () => createContext();
9
9
  exports.useCreateContext = useCreateContext;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useCreateSearchContext = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
- const lodash_1 = tslib_1.__importDefault(require("lodash"));
7
- const createContext = lodash_1.default.once(() => react_1.default.createContext({}));
6
+ const once_1 = tslib_1.__importDefault(require("lodash/once"));
7
+ const createContext = (0, once_1.default)(() => react_1.default.createContext({}));
8
8
  const useCreateSearchContext = () => createContext();
9
9
  exports.useCreateSearchContext = useCreateSearchContext;
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useIntegrationFF = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
- const lodash_1 = tslib_1.__importDefault(require("lodash"));
7
6
  const debounce_1 = tslib_1.__importDefault(require("lodash/debounce"));
7
+ const get_1 = tslib_1.__importDefault(require("lodash/get"));
8
+ const isFunction_1 = tslib_1.__importDefault(require("lodash/isFunction"));
9
+ const values_1 = tslib_1.__importDefault(require("lodash/values"));
8
10
  const react_final_form_1 = require("react-final-form");
9
11
  const utils_1 = require("../utils");
10
12
  const useIntegrationFF = (store, withoutDebounce) => {
@@ -17,9 +19,9 @@ const useIntegrationFF = (store, withoutDebounce) => {
17
19
  validate: () => {
18
20
  const asyncErrors = [];
19
21
  let error;
20
- lodash_1.default.values(store.errors).forEach((err) => {
22
+ (0, values_1.default)(store.errors).forEach((err) => {
21
23
  if (err) {
22
- if (lodash_1.default.isFunction(err === null || err === void 0 ? void 0 : err.then)) {
24
+ if ((0, isFunction_1.default)(err === null || err === void 0 ? void 0 : err.then)) {
23
25
  asyncErrors.push(err);
24
26
  }
25
27
  else {
@@ -38,7 +40,7 @@ const useIntegrationFF = (store, withoutDebounce) => {
38
40
  const change = react_1.default.useMemo(() => {
39
41
  const cb = (value) => {
40
42
  if (store.name) {
41
- form.change(store.name, lodash_1.default.get((0, utils_1.transformArrOut)(value), store.name));
43
+ form.change(store.name, (0, get_1.default)((0, utils_1.transformArrOut)(value), store.name));
42
44
  }
43
45
  };
44
46
  if (withoutDebounce) {
@@ -3,14 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useMutators = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
- const lodash_1 = tslib_1.__importDefault(require("lodash"));
6
+ const cloneDeep_1 = tslib_1.__importDefault(require("lodash/cloneDeep"));
7
+ const get_1 = tslib_1.__importDefault(require("lodash/get"));
8
+ const isObjectLike_1 = tslib_1.__importDefault(require("lodash/isObjectLike"));
9
+ const keys_1 = tslib_1.__importDefault(require("lodash/keys"));
10
+ const set_1 = tslib_1.__importDefault(require("lodash/set"));
7
11
  const useMutators = (externalMutators) => {
8
12
  const merge = react_1.default.useCallback((mutators, store) => {
9
13
  const mergeSpec = (a = {}, b) => {
10
- const result = lodash_1.default.cloneDeep(a);
14
+ const result = (0, cloneDeep_1.default)(a);
11
15
  const getKeys = (parent) => {
12
- if (lodash_1.default.isObjectLike(parent)) {
13
- return lodash_1.default.keys(parent).reduce((acc, parentKey) => {
16
+ if ((0, isObjectLike_1.default)(parent)) {
17
+ return (0, keys_1.default)(parent).reduce((acc, parentKey) => {
14
18
  const childKeys = getKeys(parent[parentKey]);
15
19
  return [
16
20
  ...acc,
@@ -22,14 +26,14 @@ const useMutators = (externalMutators) => {
22
26
  return [];
23
27
  };
24
28
  getKeys(b).forEach((key) => {
25
- lodash_1.default.set(result, [key[0], 'value', ...key.slice(1)], lodash_1.default.get(b, key));
29
+ (0, set_1.default)(result, [key[0], 'value', ...key.slice(1)], (0, get_1.default)(b, key));
26
30
  });
27
31
  return result;
28
32
  };
29
33
  const mergeValuesOrErrors = (a = {}, b) => {
30
- const result = lodash_1.default.cloneDeep(a);
34
+ const result = (0, cloneDeep_1.default)(a);
31
35
  Object.keys(b).forEach((key) => {
32
- lodash_1.default.set(result, [key, 'value'], b[key]);
36
+ (0, set_1.default)(result, [key, 'value'], b[key]);
33
37
  });
34
38
  return result;
35
39
  };
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useSearchStore = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
- const lodash_1 = tslib_1.__importDefault(require("lodash"));
6
+ const isUndefined_1 = tslib_1.__importDefault(require("lodash/isUndefined"));
7
+ const omit_1 = tslib_1.__importDefault(require("lodash/omit"));
7
8
  const __1 = require("../");
8
9
  const useSearchStore = () => {
9
10
  const [store, setStore] = react_1.default.useState({});
@@ -24,7 +25,7 @@ const useSearchStore = () => {
24
25
  return false;
25
26
  }
26
27
  }
27
- if (lodash_1.default.isUndefined(selfFlag)) {
28
+ if ((0, isUndefined_1.default)(selfFlag)) {
28
29
  return false;
29
30
  }
30
31
  return true;
@@ -33,7 +34,7 @@ const useSearchStore = () => {
33
34
  store,
34
35
  setField: (name, search) => setStore((store) => (Object.assign(Object.assign({}, store), { [name]: search }))),
35
36
  removeField: (name) => {
36
- setStore((store) => lodash_1.default.omit(store, name));
37
+ setStore((store) => (0, omit_1.default)(store, name));
37
38
  },
38
39
  isHiddenField,
39
40
  };
@@ -3,7 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useStore = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
- const lodash_1 = tslib_1.__importDefault(require("lodash"));
6
+ const clone_1 = tslib_1.__importDefault(require("lodash/clone"));
7
+ const cloneDeep_1 = tslib_1.__importDefault(require("lodash/cloneDeep"));
8
+ const get_1 = tslib_1.__importDefault(require("lodash/get"));
9
+ const omit_1 = tslib_1.__importDefault(require("lodash/omit"));
10
+ const set_1 = tslib_1.__importDefault(require("lodash/set"));
7
11
  const react_final_form_1 = require("react-final-form");
8
12
  const utils_1 = require("../utils");
9
13
  const useStore = (name) => {
@@ -11,37 +15,37 @@ const useStore = (name) => {
11
15
  const firstRenderRef = react_1.default.useRef(true);
12
16
  const [store, setStore] = react_1.default.useState(() => {
13
17
  const values = (0, utils_1.transformArrIn)({
14
- [name]: lodash_1.default.get(formState.values, name),
18
+ [name]: (0, get_1.default)(formState.values, name),
15
19
  });
16
20
  const initialValue = (0, utils_1.transformArrIn)({
17
- [name]: lodash_1.default.get(formState.initialValues, name),
21
+ [name]: (0, get_1.default)(formState.initialValues, name),
18
22
  });
19
23
  return {
20
24
  name,
21
- initialValue: lodash_1.default.cloneDeep(initialValue),
22
- values: lodash_1.default.cloneDeep(values),
25
+ initialValue: (0, cloneDeep_1.default)(initialValue),
26
+ values: (0, cloneDeep_1.default)(values),
23
27
  errors: {},
24
28
  };
25
29
  });
26
30
  const submitFailed = formState.submitFailed;
27
31
  const tools = react_1.default.useMemo(() => ({
28
32
  initialValue: store.initialValue,
29
- onChange: (name, value, errors) => setStore((store) => (Object.assign(Object.assign({}, store), { values: lodash_1.default.set(Object.assign({}, store.values), name, lodash_1.default.clone(value)), errors: errors || {} }))),
30
- onUnmount: (name) => setStore((store) => (Object.assign(Object.assign({}, store), { values: lodash_1.default.omit(store.values, name), errors: lodash_1.default.omit(store.errors, Object.keys(store.errors).filter((key) => key.startsWith(name))) }))),
33
+ onChange: (name, value, errors) => setStore((store) => (Object.assign(Object.assign({}, store), { values: (0, set_1.default)(Object.assign({}, store.values), name, (0, clone_1.default)(value)), errors: errors || {} }))),
34
+ onUnmount: (name) => setStore((store) => (Object.assign(Object.assign({}, store), { values: (0, omit_1.default)(store.values, name), errors: (0, omit_1.default)(store.errors, Object.keys(store.errors).filter((key) => key.startsWith(name))) }))),
31
35
  submitFailed,
32
36
  }), [store.initialValue, setStore, submitFailed]);
33
37
  react_1.default.useEffect(() => {
34
38
  if (!firstRenderRef.current) {
35
39
  const values = (0, utils_1.transformArrIn)({
36
- [name]: lodash_1.default.get(formState.values, name),
40
+ [name]: (0, get_1.default)(formState.values, name),
37
41
  });
38
42
  const initialValue = (0, utils_1.transformArrIn)({
39
- [name]: lodash_1.default.get(formState.initialValues, name),
43
+ [name]: (0, get_1.default)(formState.initialValues, name),
40
44
  });
41
45
  setStore({
42
46
  name: name,
43
- initialValue: lodash_1.default.cloneDeep(initialValue),
44
- values: lodash_1.default.cloneDeep(values),
47
+ initialValue: (0, cloneDeep_1.default)(initialValue),
48
+ values: (0, cloneDeep_1.default)(values),
45
49
  errors: {},
46
50
  });
47
51
  }
@@ -2,26 +2,29 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.withGenerateButton = exports.isArrayItem = exports.transformArrOut = exports.transformArrIn = exports.isCorrectConfig = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const lodash_1 = tslib_1.__importDefault(require("lodash"));
5
+ const forEach_1 = tslib_1.__importDefault(require("lodash/forEach"));
6
+ const isArray_1 = tslib_1.__importDefault(require("lodash/isArray"));
7
+ const isObject_1 = tslib_1.__importDefault(require("lodash/isObject"));
8
+ const isObjectLike_1 = tslib_1.__importDefault(require("lodash/isObjectLike"));
6
9
  const constants_1 = require("../../../constants");
7
10
  const helpers_1 = require("../../../helpers");
8
11
  const constants_2 = require("../constants");
9
- const isCorrectConfig = (candidate) => Object.values(constants_1.SpecTypes).every((type) => lodash_1.default.isObjectLike(candidate) &&
10
- lodash_1.default.isObjectLike(candidate[type]) &&
11
- lodash_1.default.isObjectLike(candidate[type].inputs) &&
12
- lodash_1.default.isObjectLike(candidate[type].layouts) &&
13
- lodash_1.default.isObjectLike(candidate[type].validators));
12
+ const isCorrectConfig = (candidate) => Object.values(constants_1.SpecTypes).every((type) => (0, isObjectLike_1.default)(candidate) &&
13
+ (0, isObjectLike_1.default)(candidate[type]) &&
14
+ (0, isObjectLike_1.default)(candidate[type].inputs) &&
15
+ (0, isObjectLike_1.default)(candidate[type].layouts) &&
16
+ (0, isObjectLike_1.default)(candidate[type].validators));
14
17
  exports.isCorrectConfig = isCorrectConfig;
15
18
  const transformArrIn = (value) => {
16
- if (lodash_1.default.isArray(value)) {
19
+ if ((0, isArray_1.default)(value)) {
17
20
  return value.reduce((arrObj, item, idx) => {
18
21
  arrObj[`<${idx}>`] = (0, exports.transformArrIn)(item);
19
22
  return arrObj;
20
23
  }, { [constants_2.OBJECT_ARRAY_FLAG]: true, [constants_2.OBJECT_ARRAY_CNT]: value.length });
21
24
  }
22
- if (lodash_1.default.isObject(value)) {
25
+ if ((0, isObject_1.default)(value)) {
23
26
  const _value = Object.assign({}, value);
24
- lodash_1.default.forEach(_value, (item, key) => {
27
+ (0, forEach_1.default)(_value, (item, key) => {
25
28
  _value[key] = (0, exports.transformArrIn)(item);
26
29
  });
27
30
  return _value;
@@ -30,7 +33,7 @@ const transformArrIn = (value) => {
30
33
  };
31
34
  exports.transformArrIn = transformArrIn;
32
35
  const transformArrOut = (value) => {
33
- if (lodash_1.default.isObject(value) && !lodash_1.default.isArray(value)) {
36
+ if ((0, isObject_1.default)(value) && !(0, isArray_1.default)(value)) {
34
37
  if (value[constants_2.OBJECT_ARRAY_FLAG]) {
35
38
  const _value = Object.keys(value)
36
39
  .filter((key) => key !== constants_2.OBJECT_ARRAY_FLAG && key !== constants_2.OBJECT_ARRAY_CNT)
@@ -40,7 +43,7 @@ const transformArrOut = (value) => {
40
43
  return _value;
41
44
  }
42
45
  const _value = Object.assign({}, value);
43
- lodash_1.default.forEach(_value, (item, key) => {
46
+ (0, forEach_1.default)(_value, (item, key) => {
44
47
  _value[key] = (0, exports.transformArrOut)(item);
45
48
  });
46
49
  return _value;
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isCorrectViewConfig = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const lodash_1 = tslib_1.__importDefault(require("lodash"));
5
+ const isObjectLike_1 = tslib_1.__importDefault(require("lodash/isObjectLike"));
6
6
  const constants_1 = require("../../constants");
7
- const isCorrectViewConfig = (candidate) => Object.values(constants_1.SpecTypes).every((type) => lodash_1.default.isObjectLike(candidate) &&
8
- lodash_1.default.isObjectLike(candidate[type]) &&
9
- lodash_1.default.isObjectLike(candidate[type].views) &&
10
- lodash_1.default.isObjectLike(candidate[type].layouts));
7
+ const isCorrectViewConfig = (candidate) => Object.values(constants_1.SpecTypes).every((type) => (0, isObjectLike_1.default)(candidate) &&
8
+ (0, isObjectLike_1.default)(candidate[type]) &&
9
+ (0, isObjectLike_1.default)(candidate[type].views) &&
10
+ (0, isObjectLike_1.default)(candidate[type].layouts));
11
11
  exports.isCorrectViewConfig = isCorrectViewConfig;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useComponents = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
- const lodash_1 = tslib_1.__importDefault(require("lodash"));
6
+ const isString_1 = tslib_1.__importDefault(require("lodash/isString"));
7
7
  const react_is_1 = require("react-is");
8
8
  const helpers_1 = require("../../../helpers");
9
9
  const helpers_2 = require("../helpers");
@@ -25,7 +25,7 @@ const useComponents = (spec, config) => {
25
25
  return;
26
26
  }, [views, (_a = spec === null || spec === void 0 ? void 0 : spec.viewSpec) === null || _a === void 0 ? void 0 : _a.type]);
27
27
  const Layout = react_1.default.useMemo(() => {
28
- if (layouts && lodash_1.default.isString(spec.viewSpec.layout)) {
28
+ if (layouts && (0, isString_1.default)(spec.viewSpec.layout)) {
29
29
  const Component = layouts[spec.viewSpec.layout];
30
30
  if ((0, react_is_1.isValidElementType)(Component)) {
31
31
  return Component;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useCreateContext = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
- const lodash_1 = tslib_1.__importDefault(require("lodash"));
7
- const createContext = lodash_1.default.once(() => react_1.default.createContext({}));
6
+ const once_1 = tslib_1.__importDefault(require("lodash/once"));
7
+ const createContext = (0, once_1.default)(() => react_1.default.createContext({}));
8
8
  const useCreateContext = () => createContext();
9
9
  exports.useCreateContext = useCreateContext;
@@ -3,15 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useRender = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
- const lodash_1 = tslib_1.__importDefault(require("lodash"));
6
+ const get_1 = tslib_1.__importDefault(require("lodash/get"));
7
+ const isString_1 = tslib_1.__importDefault(require("lodash/isString"));
7
8
  const react_is_1 = require("react-is");
8
9
  const helpers_1 = require("../../../helpers");
9
10
  const useRender = ({ value, name, spec, viewEntity, Layout, Link, }) => {
10
11
  const render = react_1.default.useMemo(() => {
11
12
  var _a;
12
- if (viewEntity && (0, helpers_1.isCorrectSpec)(spec) && lodash_1.default.isString(name)) {
13
+ if (viewEntity && (0, helpers_1.isCorrectSpec)(spec) && (0, isString_1.default)(name)) {
13
14
  if (!spec.viewSpec.hidden) {
14
- const currentValue = name ? lodash_1.default.get(value, name) : value;
15
+ const currentValue = name ? (0, get_1.default)(value, name) : value;
15
16
  const linkValue = (0, react_is_1.isValidElementType)(Link) && ((_a = spec === null || spec === void 0 ? void 0 : spec.viewSpec) === null || _a === void 0 ? void 0 : _a.link) ? (react_1.default.createElement(Link, { value: currentValue, link: spec.viewSpec.link })) : undefined;
16
17
  if (viewEntity.independent) {
17
18
  const InputComponent = viewEntity.Component;
@@ -2,16 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isStringSpec = exports.isObjectSpec = exports.isNumberSpec = exports.isBooleanSpec = exports.isArraySpec = exports.isCorrectSpec = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const lodash_1 = tslib_1.__importDefault(require("lodash"));
5
+ const isObjectLike_1 = tslib_1.__importDefault(require("lodash/isObjectLike"));
6
+ const isString_1 = tslib_1.__importDefault(require("lodash/isString"));
6
7
  const constants_1 = require("./constants");
7
- const isCorrectSpec = (candidate) => lodash_1.default.isObjectLike(candidate) &&
8
+ const isCorrectSpec = (candidate) => (0, isObjectLike_1.default)(candidate) &&
8
9
  (candidate.type === constants_1.SpecTypes.Array ||
9
10
  candidate.type === constants_1.SpecTypes.Boolean ||
10
11
  candidate.type === constants_1.SpecTypes.Number ||
11
12
  candidate.type === constants_1.SpecTypes.Object ||
12
13
  candidate.type === constants_1.SpecTypes.String) &&
13
- lodash_1.default.isObjectLike(candidate.viewSpec) &&
14
- lodash_1.default.isString(candidate.viewSpec.type);
14
+ (0, isObjectLike_1.default)(candidate.viewSpec) &&
15
+ (0, isString_1.default)(candidate.viewSpec.type);
15
16
  exports.isCorrectSpec = isCorrectSpec;
16
17
  const isArraySpec = (candidate) => (candidate === null || candidate === void 0 ? void 0 : candidate.type) === constants_1.SpecTypes.Array;
17
18
  exports.isArraySpec = isArraySpec;
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const icons_1 = require("@gravity-ui/icons");
7
7
  const uikit_1 = require("@gravity-ui/uikit");
8
- const lodash_1 = tslib_1.__importDefault(require("lodash"));
8
+ const isString_1 = tslib_1.__importDefault(require("lodash/isString"));
9
9
  const utils_1 = require("../../utils");
10
10
  const b = (0, utils_1.block)('accordeon-card');
11
11
  const AccordeonCard = ({ className, name, header, description, open: propsOpen, onToggle, headerActionsTemplate, ignoreHeaderToggle, titleSize = 'm', alwaysOpen, children, classNameBody, }) => {
@@ -32,7 +32,7 @@ const AccordeonCard = ({ className, name, header, description, open: propsOpen,
32
32
  }
33
33
  });
34
34
  const currentHeaderVariant = react_1.default.useMemo(() => {
35
- if (!lodash_1.default.isString(header)) {
35
+ if (!(0, isString_1.default)(header)) {
36
36
  return 'body-1';
37
37
  }
38
38
  if (titleSize === 'm') {