@gravity-ui/dynamic-forms 3.3.0 → 3.4.1

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 (65) hide show
  1. package/build/cjs/lib/core/components/Form/Controller/Controller.js +4 -4
  2. package/build/cjs/lib/core/components/Form/Controller/utils.js +39 -29
  3. package/build/cjs/lib/core/components/Form/DynamicField.js +3 -3
  4. package/build/cjs/lib/core/components/Form/hooks/useMutators.js +21 -7
  5. package/build/cjs/lib/kit/components/AccordeonCard/AccordeonCard.css +6 -6
  6. package/build/cjs/lib/kit/components/Card/Card.css +3 -3
  7. package/build/cjs/lib/kit/components/ErrorWrapper/ErrorWrapper.css +4 -4
  8. package/build/cjs/lib/kit/components/GroupIndent/GroupIndent.css +1 -1
  9. package/build/cjs/lib/kit/components/Inputs/FileInput/FileInput.css +1 -1
  10. package/build/cjs/lib/kit/components/Inputs/MonacoInput/MonacoHeader.css +1 -1
  11. package/build/cjs/lib/kit/components/Inputs/MonacoInput/MonacoInputBase.css +1 -1
  12. package/build/cjs/lib/kit/components/Inputs/MonacoInput/MonacoInputDialog.css +1 -1
  13. package/build/cjs/lib/kit/components/Inputs/OneOf/OneOf.css +1 -1
  14. package/build/cjs/lib/kit/components/Inputs/TableArrayInput/TableArrayInput.css +1 -1
  15. package/build/cjs/lib/kit/components/Inputs/TextArea/TextArea.js +1 -1
  16. package/build/cjs/lib/kit/components/Layouts/Row/Row.css +4 -3
  17. package/build/cjs/lib/kit/components/LongValue/LongValue.css +1 -1
  18. package/build/cjs/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.css +4 -4
  19. package/build/cjs/lib/kit/components/ViewLayouts/ViewRow/ViewRow.css +2 -2
  20. package/build/cjs/lib/kit/components/Views/CardOneOfView.js +1 -1
  21. package/build/cjs/lib/kit/components/Views/MonacoInputView/MonacoBaseView.css +1 -1
  22. package/build/cjs/lib/kit/components/Views/MonacoInputView/MonacoViewDialog.css +1 -1
  23. package/build/cjs/lib/kit/components/Views/MultiOneOfView/MultiOneOfView.js +1 -1
  24. package/build/cjs/lib/kit/components/Views/ObjectValueInputView/ObjectValueInputView.js +1 -1
  25. package/build/cjs/lib/kit/components/Views/OneOfView/OneOfView.js +1 -1
  26. package/build/cjs/lib/kit/components/Views/TextLinkView/TextLinkView.js +1 -1
  27. package/build/cjs/lib/kit/validators/types.js +2 -0
  28. package/build/cjs/lib/kit/validators/validators.js +32 -25
  29. package/build/esm/lib/core/components/Form/Controller/Controller.js +4 -4
  30. package/build/esm/lib/core/components/Form/Controller/types.d.ts +6 -6
  31. package/build/esm/lib/core/components/Form/Controller/utils.d.ts +6 -6
  32. package/build/esm/lib/core/components/Form/Controller/utils.js +39 -29
  33. package/build/esm/lib/core/components/Form/DynamicField.js +3 -3
  34. package/build/esm/lib/core/components/Form/hooks/useMutators.d.ts +2 -2
  35. package/build/esm/lib/core/components/Form/hooks/useMutators.js +21 -7
  36. package/build/esm/lib/core/components/Form/types/context.d.ts +2 -2
  37. package/build/esm/lib/core/components/Form/types/mutators.d.ts +11 -0
  38. package/build/esm/lib/kit/components/AccordeonCard/AccordeonCard.css +6 -6
  39. package/build/esm/lib/kit/components/Card/Card.css +3 -3
  40. package/build/esm/lib/kit/components/ErrorWrapper/ErrorWrapper.css +4 -4
  41. package/build/esm/lib/kit/components/GroupIndent/GroupIndent.css +1 -1
  42. package/build/esm/lib/kit/components/Inputs/FileInput/FileInput.css +1 -1
  43. package/build/esm/lib/kit/components/Inputs/MonacoInput/MonacoHeader.css +1 -1
  44. package/build/esm/lib/kit/components/Inputs/MonacoInput/MonacoInputBase.css +1 -1
  45. package/build/esm/lib/kit/components/Inputs/MonacoInput/MonacoInputDialog.css +1 -1
  46. package/build/esm/lib/kit/components/Inputs/OneOf/OneOf.css +1 -1
  47. package/build/esm/lib/kit/components/Inputs/TableArrayInput/TableArrayInput.css +1 -1
  48. package/build/esm/lib/kit/components/Inputs/TextArea/TextArea.js +1 -1
  49. package/build/esm/lib/kit/components/Layouts/Row/Row.css +4 -3
  50. package/build/esm/lib/kit/components/LongValue/LongValue.css +1 -1
  51. package/build/esm/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.css +4 -4
  52. package/build/esm/lib/kit/components/ViewLayouts/ViewRow/ViewRow.css +2 -2
  53. package/build/esm/lib/kit/components/Views/CardOneOfView.js +1 -1
  54. package/build/esm/lib/kit/components/Views/MonacoInputView/MonacoBaseView.css +1 -1
  55. package/build/esm/lib/kit/components/Views/MonacoInputView/MonacoViewDialog.css +1 -1
  56. package/build/esm/lib/kit/components/Views/MultiOneOfView/MultiOneOfView.js +1 -1
  57. package/build/esm/lib/kit/components/Views/ObjectValueInputView/ObjectValueInputView.js +1 -1
  58. package/build/esm/lib/kit/components/Views/OneOfView/OneOfView.js +1 -1
  59. package/build/esm/lib/kit/components/Views/TextLinkView/TextLinkView.js +1 -1
  60. package/build/esm/lib/kit/validators/messages.d.ts +2 -16
  61. package/build/esm/lib/kit/validators/types.d.ts +16 -0
  62. package/build/esm/lib/kit/validators/types.js +1 -0
  63. package/build/esm/lib/kit/validators/validators.d.ts +10 -9
  64. package/build/esm/lib/kit/validators/validators.js +32 -25
  65. package/package.json +11 -2
@@ -7,12 +7,12 @@ const lodash_1 = tslib_1.__importDefault(require("lodash"));
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, }) => {
10
- const { config, tools, mutators, __mirror } = (0, hooks_1.useDynamicFormsCtx)();
10
+ const { config, tools, mutatorsStore, __mirror } = (0, hooks_1.useDynamicFormsCtx)();
11
11
  const firstRenderRef = react_1.default.useRef(true);
12
12
  const [store, setStore] = react_1.default.useState((0, utils_1.initializeStore)({
13
13
  name,
14
14
  spec: _spec,
15
- mutators,
15
+ mutatorsStore,
16
16
  config,
17
17
  valueFromParent,
18
18
  tools,
@@ -92,7 +92,7 @@ const Controller = ({ spec: _spec, name, value: valueFromParent, parentOnChange,
92
92
  name,
93
93
  parentOnChange,
94
94
  parentOnUnmount,
95
- mutators,
95
+ mutatorsStore,
96
96
  config,
97
97
  tools,
98
98
  methodOnChange: fieldMethods.onChange,
@@ -104,7 +104,7 @@ const Controller = ({ spec: _spec, name, value: valueFromParent, parentOnChange,
104
104
  name,
105
105
  parentOnChange,
106
106
  parentOnUnmount,
107
- mutators,
107
+ mutatorsStore,
108
108
  config,
109
109
  tools.onChange,
110
110
  tools.onUnmount,
@@ -9,10 +9,14 @@ const constants_1 = require("../../../constants");
9
9
  const helpers_1 = require("../../../helpers");
10
10
  const constants_2 = require("../constants");
11
11
  const utils_1 = require("../utils");
12
- const isErrorMutatorCorrect = (errorMutator) => errorMutator !== constants_2.EMPTY_MUTATOR && (lodash_1.default.isString(errorMutator) || lodash_1.default.isBoolean(errorMutator));
12
+ 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));
13
16
  const isValueMutatorCorrect = (valueMutator, spec) => valueMutator !== constants_2.EMPTY_MUTATOR &&
14
- (typeof valueMutator === spec.type ||
15
- (lodash_1.default.isArray(valueMutator) && spec.type === constants_1.SpecTypes.Array));
17
+ (typeof valueMutator.value === spec.type ||
18
+ (lodash_1.default.isArray(valueMutator.value) && spec.type === constants_1.SpecTypes.Array) ||
19
+ valueMutator.value === undefined);
16
20
  const updateParentStore = (store) => {
17
21
  (store.parentOnChange ? store.parentOnChange : store.tools.onChange)(store.name, store.state.value, Object.assign(Object.assign({}, store.state.childErrors), { [store.name]: store.state.error }));
18
22
  };
@@ -21,10 +25,10 @@ const callUnmout = (store) => {
21
25
  (store.parentOnUnmount ? store.parentOnUnmount : store.tools.onUnmount)(store.name);
22
26
  };
23
27
  exports.callUnmout = callUnmout;
24
- const getSpec = ({ name, spec, mutators, }) => {
25
- const mutator = lodash_1.default.get(mutators.spec, name, constants_2.EMPTY_MUTATOR);
28
+ const getSpec = ({ name, spec, mutatorsStore, }) => {
29
+ const mutator = lodash_1.default.get(mutatorsStore.spec, name, constants_2.EMPTY_MUTATOR);
26
30
  if (mutator !== constants_2.EMPTY_MUTATOR) {
27
- const mutatedSpec = lodash_1.default.merge(lodash_1.default.cloneDeep(spec), mutator);
31
+ const mutatedSpec = lodash_1.default.merge(lodash_1.default.cloneDeep(spec), mutator.value);
28
32
  if ((0, helpers_1.isCorrectSpec)(mutatedSpec)) {
29
33
  return mutatedSpec;
30
34
  }
@@ -90,11 +94,11 @@ const getValidate = ({ spec, config, }) => {
90
94
  return validate;
91
95
  };
92
96
  exports.getValidate = getValidate;
93
- const getFieldInitials = ({ name, spec, valueFromParent, initialValue, validate, mutators, }) => {
94
- const valueMutator = (0, utils_1.transformArrIn)(lodash_1.default.get(mutators.values, name, constants_2.EMPTY_MUTATOR));
97
+ const getFieldInitials = ({ name, spec, valueFromParent, initialValue, validate, mutatorsStore, }) => {
98
+ const valueMutator = (0, utils_1.transformArrIn)(lodash_1.default.get(mutatorsStore.values, name, constants_2.EMPTY_MUTATOR));
95
99
  let value = lodash_1.default.cloneDeep(valueFromParent);
96
100
  if (isValueMutatorCorrect(valueMutator, spec)) {
97
- value = valueMutator;
101
+ value = valueMutator.value;
98
102
  }
99
103
  if (lodash_1.default.isNil(value)) {
100
104
  if (spec.defaultValue) {
@@ -111,11 +115,11 @@ const getFieldInitials = ({ name, spec, valueFromParent, initialValue, validate,
111
115
  }
112
116
  }
113
117
  }
114
- let errorMutator = lodash_1.default.get(mutators.errors, name, constants_2.EMPTY_MUTATOR);
118
+ let errorMutator = lodash_1.default.get(mutatorsStore.errors, name, constants_2.EMPTY_MUTATOR);
115
119
  if (!isErrorMutatorCorrect(errorMutator)) {
116
- errorMutator = undefined;
120
+ errorMutator = { value: undefined };
117
121
  }
118
- const error = (validate === null || validate === void 0 ? void 0 : validate((0, utils_1.transformArrOut)(value))) || errorMutator;
122
+ const error = (validate === null || validate === void 0 ? void 0 : validate((0, utils_1.transformArrOut)(value))) || (errorMutator === null || errorMutator === void 0 ? void 0 : errorMutator.value);
119
123
  const dirty = !lodash_1.default.isEqual(value, initialValue);
120
124
  return {
121
125
  initialValue,
@@ -209,8 +213,8 @@ const getFieldMethods = () => {
209
213
  };
210
214
  };
211
215
  exports.getFieldMethods = getFieldMethods;
212
- const initializeStore = ({ name, spec: _spec, mutators, config, valueFromParent, tools, parentOnChange, parentOnUnmount, }) => {
213
- const spec = (0, exports.getSpec)({ name, spec: _spec, mutators });
216
+ const initializeStore = ({ name, spec: _spec, mutatorsStore, config, valueFromParent, tools, parentOnChange, parentOnUnmount, }) => {
217
+ const spec = (0, exports.getSpec)({ name, spec: _spec, mutatorsStore });
214
218
  const components = (0, exports.getComponents)({ spec, config });
215
219
  const render = (0, exports.getRender)(Object.assign({ name, spec }, components));
216
220
  const validate = (0, exports.getValidate)({ spec, config });
@@ -219,7 +223,7 @@ const initializeStore = ({ name, spec: _spec, mutators, config, valueFromParent,
219
223
  spec,
220
224
  valueFromParent,
221
225
  validate,
222
- mutators,
226
+ mutatorsStore,
223
227
  initialValue: lodash_1.default.get(tools.initialValue, name),
224
228
  });
225
229
  const initialsStore = {
@@ -228,7 +232,7 @@ const initializeStore = ({ name, spec: _spec, mutators, config, valueFromParent,
228
232
  initialSpec: _spec,
229
233
  config,
230
234
  tools,
231
- mutators,
235
+ mutatorsStore,
232
236
  render,
233
237
  validate,
234
238
  parentOnChange,
@@ -241,14 +245,14 @@ const initializeStore = ({ name, spec: _spec, mutators, config, valueFromParent,
241
245
  return initialsStore;
242
246
  };
243
247
  exports.initializeStore = initializeStore;
244
- const updateStore = ({ store, setStore, spec: _spec, name, parentOnChange, parentOnUnmount, mutators, valueFromParent, config, tools, methodOnChange, }) => {
245
- const storeSpecMutator = lodash_1.default.get(store.mutators.spec, store.name, constants_2.EMPTY_MUTATOR);
246
- const storeValueMutator = lodash_1.default.get(store.mutators.values, store.name, constants_2.EMPTY_MUTATOR);
247
- const storeErrorMutator = lodash_1.default.get(store.mutators.errors, store.name, constants_2.EMPTY_MUTATOR);
248
- const specMutator = lodash_1.default.get(mutators.errors, name, constants_2.EMPTY_MUTATOR);
249
- const valueMutator = lodash_1.default.get(mutators.values, name, constants_2.EMPTY_MUTATOR);
250
- const errorMutator = lodash_1.default.get(mutators.errors, name, constants_2.EMPTY_MUTATOR);
251
- const valueMutatorUpdated = isValueMutatorCorrect(valueMutator, (0, exports.getSpec)({ name, spec: _spec, mutators })) &&
248
+ const updateStore = ({ store, setStore, spec: _spec, name, parentOnChange, parentOnUnmount, mutatorsStore, valueFromParent, config, tools, methodOnChange, }) => {
249
+ const storeSpecMutator = lodash_1.default.get(store.mutatorsStore.spec, store.name, constants_2.EMPTY_MUTATOR);
250
+ const storeValueMutator = lodash_1.default.get(store.mutatorsStore.values, store.name, constants_2.EMPTY_MUTATOR);
251
+ const storeErrorMutator = lodash_1.default.get(store.mutatorsStore.errors, store.name, constants_2.EMPTY_MUTATOR);
252
+ const specMutator = lodash_1.default.get(mutatorsStore.spec, name, constants_2.EMPTY_MUTATOR);
253
+ const valueMutator = lodash_1.default.get(mutatorsStore.values, name, constants_2.EMPTY_MUTATOR);
254
+ const errorMutator = lodash_1.default.get(mutatorsStore.errors, name, constants_2.EMPTY_MUTATOR);
255
+ const valueMutatorUpdated = isValueMutatorCorrect(valueMutator, (0, exports.getSpec)({ name, spec: _spec, mutatorsStore })) &&
252
256
  valueMutator !== storeValueMutator;
253
257
  const errorMutatorUpdated = isErrorMutatorCorrect(errorMutator) && errorMutator !== storeErrorMutator;
254
258
  const updateState = valueMutatorUpdated || errorMutatorUpdated;
@@ -265,7 +269,7 @@ const updateStore = ({ store, setStore, spec: _spec, name, parentOnChange, paren
265
269
  setStore((0, exports.initializeStore)({
266
270
  name,
267
271
  spec: _spec,
268
- mutators,
272
+ mutatorsStore,
269
273
  config,
270
274
  valueFromParent,
271
275
  tools,
@@ -277,7 +281,7 @@ const updateStore = ({ store, setStore, spec: _spec, name, parentOnChange, paren
277
281
  let nextStore = Object.assign(Object.assign({}, (0, exports.initializeStore)({
278
282
  name,
279
283
  spec: _spec,
280
- mutators,
284
+ mutatorsStore,
281
285
  config,
282
286
  valueFromParent,
283
287
  tools,
@@ -285,7 +289,9 @@ const updateStore = ({ store, setStore, spec: _spec, name, parentOnChange, paren
285
289
  parentOnUnmount,
286
290
  })), { state: store.state });
287
291
  if (updateState) {
288
- nextStore = methodOnChange(nextStore, Object.assign({ valOrSetter: (value) => valueMutatorUpdated ? valueMutator : value }, (errorMutatorUpdated ? { errorMutator } : {})));
292
+ nextStore = methodOnChange(nextStore, Object.assign({ valOrSetter: (value) => valueMutatorUpdated ? valueMutator.value : value }, (errorMutatorUpdated
293
+ ? { errorMutator: errorMutator.value }
294
+ : {})));
289
295
  }
290
296
  setStore(nextStore);
291
297
  }
@@ -294,12 +300,16 @@ const updateStore = ({ store, setStore, spec: _spec, name, parentOnChange, paren
294
300
  parentOnUnmount,
295
301
  tools });
296
302
  if (updateState) {
297
- nextStore = methodOnChange(nextStore, Object.assign({ valOrSetter: (value) => valueMutatorUpdated ? valueMutator : value }, (errorMutatorUpdated ? { errorMutator } : {})));
303
+ nextStore = methodOnChange(nextStore, Object.assign({ valOrSetter: (value) => valueMutatorUpdated ? valueMutator.value : value }, (errorMutatorUpdated
304
+ ? { errorMutator: errorMutator.value }
305
+ : {})));
298
306
  }
299
307
  setStore(nextStore);
300
308
  }
301
309
  else if (updateState) {
302
- setStore(methodOnChange(store, Object.assign({ valOrSetter: (value) => valueMutatorUpdated ? valueMutator : value }, (errorMutatorUpdated ? { errorMutator } : {}))));
310
+ setStore(methodOnChange(Object.assign(Object.assign({}, store), { mutatorsStore }), Object.assign({ valOrSetter: (value) => valueMutatorUpdated ? valueMutator.value : value }, (errorMutatorUpdated
311
+ ? { errorMutator: errorMutator.value }
312
+ : {}))));
303
313
  }
304
314
  };
305
315
  exports.updateStore = updateStore;
@@ -14,7 +14,7 @@ const DynamicField = ({ name, spec, config, Monaco, generateRandomValue, search,
14
14
  const SearchContext = (0, hooks_1.useCreateSearchContext)();
15
15
  const { tools, store } = (0, hooks_1.useStore)(name);
16
16
  const watcher = (0, hooks_1.useIntegrationFF)(store, withoutInsertFFDebounce);
17
- const { mutators, mutateDFState } = (0, hooks_1.useMutators)(externalMutators);
17
+ const { mutatorsStore, mutateDFState } = (0, hooks_1.useMutators)(externalMutators);
18
18
  const { store: searchStore, setField, removeField, isHiddenField } = (0, hooks_1.useSearchStore)();
19
19
  const context = react_1.default.useMemo(() => ({
20
20
  config,
@@ -22,9 +22,9 @@ const DynamicField = ({ name, spec, config, Monaco, generateRandomValue, search,
22
22
  generateRandomValue,
23
23
  tools: Object.assign(Object.assign({}, tools), { mutateDFState }),
24
24
  store,
25
- mutators,
25
+ mutatorsStore,
26
26
  __mirror,
27
- }), [tools, config, Monaco, __mirror, generateRandomValue, mutators, mutateDFState, store]);
27
+ }), [tools, config, Monaco, __mirror, generateRandomValue, mutatorsStore, mutateDFState, store]);
28
28
  const searchContext = react_1.default.useMemo(() => ({
29
29
  setField,
30
30
  removeField,
@@ -5,10 +5,8 @@ const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const lodash_1 = tslib_1.__importDefault(require("lodash"));
7
7
  const useMutators = (externalMutators) => {
8
- const firstRenderRef = react_1.default.useRef(true);
9
- const [store, setStore] = react_1.default.useState(externalMutators || {});
10
- const mutateDFState = react_1.default.useCallback((mutators) => {
11
- const mergeSpec = (a, b) => {
8
+ const merge = react_1.default.useCallback((mutators, store) => {
9
+ const mergeSpec = (a = {}, b) => {
12
10
  const result = lodash_1.default.cloneDeep(a);
13
11
  const getKeys = (parent) => {
14
12
  if (lodash_1.default.isObjectLike(parent)) {
@@ -24,11 +22,27 @@ const useMutators = (externalMutators) => {
24
22
  return [];
25
23
  };
26
24
  getKeys(b).forEach((key) => {
27
- lodash_1.default.set(result, key, lodash_1.default.get(b, key));
25
+ lodash_1.default.set(result, [key[0], 'value', ...key.slice(1)], lodash_1.default.get(b, key));
26
+ });
27
+ return result;
28
+ };
29
+ const mergeValuesOrErrors = (a = {}, b) => {
30
+ const result = lodash_1.default.cloneDeep(a);
31
+ Object.keys(b).forEach((key) => {
32
+ lodash_1.default.set(result, [key, 'value'], b[key]);
28
33
  });
29
34
  return result;
30
35
  };
31
- setStore((store) => (Object.assign(Object.assign(Object.assign(Object.assign({}, store), (mutators.errors ? { errors: lodash_1.default.merge(store.errors, mutators.errors) } : {})), (mutators.values ? { values: lodash_1.default.merge(store.values, mutators.values) } : {})), (mutators.spec ? { spec: mergeSpec(store.spec || {}, mutators.spec) } : {}))));
36
+ return Object.assign(Object.assign(Object.assign(Object.assign({}, store), (mutators.errors
37
+ ? { errors: mergeValuesOrErrors(store.errors, mutators.errors) }
38
+ : {})), (mutators.values
39
+ ? { values: mergeValuesOrErrors(store.values, mutators.values) }
40
+ : {})), (mutators.spec ? { spec: mergeSpec(store.spec, mutators.spec) } : {}));
41
+ }, []);
42
+ const firstRenderRef = react_1.default.useRef(true);
43
+ const [store, setStore] = react_1.default.useState(merge(externalMutators || {}, {}));
44
+ const mutateDFState = react_1.default.useCallback((mutators) => {
45
+ setStore((store) => merge(mutators, store));
32
46
  }, [setStore]);
33
47
  react_1.default.useEffect(() => {
34
48
  if (firstRenderRef.current) {
@@ -38,6 +52,6 @@ const useMutators = (externalMutators) => {
38
52
  mutateDFState(externalMutators);
39
53
  }
40
54
  }, [externalMutators]);
41
- return { mutators: store, mutateDFState };
55
+ return { mutatorsStore: store, mutateDFState };
42
56
  };
43
57
  exports.useMutators = useMutators;
@@ -4,13 +4,13 @@
4
4
  justify-content: space-between;
5
5
  box-sizing: border-box;
6
6
  max-width: 750px;
7
- box-shadow: 0 1px 5px var(--yc-color-sfx-shadow);
7
+ box-shadow: 0 1px 5px var(--g-color-sfx-shadow);
8
8
  border-radius: 5px;
9
- color: var(--yc-color-text-primary);
10
- background-color: var(--yc-color-base-float);
9
+ color: var(--g-color-text-primary);
10
+ background-color: var(--g-color-base-float);
11
11
  }
12
12
  .df-accordeon-card:hover {
13
- box-shadow: 0 3px 10px var(--yc-color-sfx-shadow);
13
+ box-shadow: 0 3px 10px var(--g-color-sfx-shadow);
14
14
  }
15
15
  .df-accordeon-card:last-child {
16
16
  margin-bottom: 0;
@@ -33,7 +33,7 @@
33
33
  cursor: pointer;
34
34
  }
35
35
  .df-accordeon-card__header_open {
36
- border-bottom: 1px solid var(--yc-color-line-generic);
36
+ border-bottom: 1px solid var(--g-color-line-generic);
37
37
  }
38
38
  .df-accordeon-card__header_without-action:hover {
39
39
  cursor: default;
@@ -58,7 +58,7 @@
58
58
  }
59
59
  .df-accordeon-card__header-content-description {
60
60
  margin-top: 12px;
61
- color: var(--yc-color-text-complementary);
61
+ color: var(--g-color-text-complementary);
62
62
  }
63
63
  .df-accordeon-card__header-toggle-btn {
64
64
  flex-grow: 0;
@@ -48,9 +48,9 @@
48
48
  margin-left: 10px;
49
49
  }
50
50
  .df-card__title {
51
- font-size: var(--yc-text-subheader-2-font-size);
52
- font-weight: var(--yc-text-subheader-font-weight);
53
- line-height: var(--yc-text-subheader-2-line-height);
51
+ font-size: var(--g-text-subheader-2-font-size);
52
+ font-weight: var(--g-text-subheader-font-weight);
53
+ line-height: var(--g-text-subheader-2-line-height);
54
54
  white-space: nowrap;
55
55
  overflow: hidden;
56
56
  text-overflow: ellipsis;
@@ -17,11 +17,11 @@
17
17
  .df-error-wrapper_error .yc-text-input_view_normal:not(.df-error-wrapper-ignore) .yc-text-input__control,
18
18
  .df-error-wrapper_error .yc-text-input_view_normal:not(.df-error-wrapper-ignore) .yc-text-input__content,
19
19
  .df-error-wrapper_error .yc-checkbox__indicator:not(.df-error-wrapper-ignore)::before {
20
- border-color: var(--yc-color-text-danger);
20
+ border-color: var(--g-color-text-danger);
21
21
  }
22
22
  .df-error-wrapper__error-text {
23
- color: var(--yc-color-text-danger);
23
+ color: var(--g-color-text-danger);
24
24
  margin-top: 2px;
25
- font-size: var(--yc-text-body-1-font-size);
26
- line-height: var(--yc-text-body-1-line-height);
25
+ font-size: var(--g-text-body-1-font-size);
26
+ line-height: var(--g-text-body-1-line-height);
27
27
  }
@@ -4,7 +4,7 @@
4
4
  margin-top: -11px;
5
5
  margin-bottom: 20px;
6
6
  margin-left: 5px;
7
- border-left: 1px solid var(--yc-color-line-generic-accent);
7
+ border-left: 1px solid var(--g-color-line-generic-accent);
8
8
  }
9
9
  .df-group-indent:last-child {
10
10
  margin-bottom: 0;
@@ -11,5 +11,5 @@
11
11
  text-overflow: ellipsis;
12
12
  overflow: hidden;
13
13
  white-space: nowrap;
14
- color: var(--yc-color-text-secondary);
14
+ color: var(--g-color-text-secondary);
15
15
  }
@@ -4,7 +4,7 @@
4
4
  justify-content: space-between;
5
5
  padding: 15px;
6
6
  align-items: center;
7
- background-color: var(--yc-color-base-float-hover);
7
+ background-color: var(--g-color-base-float-hover);
8
8
  }
9
9
  .df-monaco-header__language {
10
10
  margin-top: 2px;
@@ -2,5 +2,5 @@
2
2
  width: 550px;
3
3
  }
4
4
  .df-monaco-input__container {
5
- border: 1px solid var(--yc-color-line-generic);
5
+ border: 1px solid var(--g-color-line-generic);
6
6
  }
@@ -2,7 +2,7 @@
2
2
  padding: 10px 32px 32px;
3
3
  }
4
4
  .df-monaco-input-dialog__container {
5
- border: 1px solid var(--yc-color-line-generic);
5
+ border: 1px solid var(--g-color-line-generic);
6
6
  }
7
7
  .df-monaco-input-dialog__dialog-header .yc-dialog-header__caption {
8
8
  min-height: 24px;
@@ -14,7 +14,7 @@
14
14
  margin-top: 4px;
15
15
  margin-bottom: 20px;
16
16
  margin-left: 5px;
17
- border-left: 1px solid var(--yc-color-line-generic-accent);
17
+ border-left: 1px solid var(--g-color-line-generic-accent);
18
18
  }
19
19
  .df-oneof_base > .df-group-indent > .df-use-search:empty {
20
20
  display: none;
@@ -6,7 +6,7 @@
6
6
  }
7
7
  .df-table-array__row .yc-table__cell {
8
8
  border-bottom: 0px transparent;
9
- border-top: 1px solid var(--yc-color-line-generic);
9
+ border-top: 1px solid var(--g-color-line-generic);
10
10
  }
11
11
  .df-table-array__row_hidden {
12
12
  display: none;
@@ -6,6 +6,6 @@ const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const uikit_1 = require("@gravity-ui/uikit");
7
7
  const TextArea = ({ name, input, spec }) => {
8
8
  const { value, onBlur, onChange, onFocus } = input;
9
- return (react_1.default.createElement(uikit_1.TextArea, { value: value, onBlur: onBlur, onFocus: onFocus, onUpdate: onChange, maxRows: 20, minRows: 8, hasClear: true, disabled: spec.viewSpec.disabled, placeholder: spec.viewSpec.placeholder, qa: name }));
9
+ return (react_1.default.createElement(uikit_1.TextArea, { value: value || '', onBlur: onBlur, onFocus: onFocus, onUpdate: onChange, maxRows: 20, minRows: 8, hasClear: true, disabled: spec.viewSpec.disabled, placeholder: spec.viewSpec.placeholder, qa: name }));
10
10
  };
11
11
  exports.TextArea = TextArea;
@@ -31,7 +31,7 @@
31
31
  }
32
32
  .df-row__title_required::after {
33
33
  content: "*";
34
- color: var(--yc-color-text-danger);
34
+ color: var(--g-color-text-danger);
35
35
  }
36
36
  .df-row__note {
37
37
  padding-right: 16px;
@@ -55,17 +55,18 @@
55
55
  }
56
56
  .df-row__right-inner {
57
57
  display: flex;
58
+ justify-content: space-around;
58
59
  }
59
60
  .df-row__description {
60
61
  margin-top: 10px;
61
- color: var(--yc-color-text-secondary);
62
+ color: var(--g-color-text-secondary);
62
63
  word-break: break-word;
63
64
  }
64
65
  .df-row__remove-button {
65
66
  margin-left: 5px;
66
67
  }
67
68
  .df-row__required-mark {
68
- color: var(--yc-color-text-danger);
69
+ color: var(--g-color-text-danger);
69
70
  }
70
71
  .df-row__error-wrapper {
71
72
  min-width: 100%;
@@ -11,5 +11,5 @@
11
11
  cursor: pointer;
12
12
  }
13
13
  .df-long-value_long:hover {
14
- color: var(--yc-color-text-secondary);
14
+ color: var(--g-color-text-secondary);
15
15
  }
@@ -7,7 +7,7 @@
7
7
  .df-simple-vertical-accordeon_branch .df-simple-vertical-accordeon__body {
8
8
  padding-left: 20px;
9
9
  margin-left: 5px;
10
- border-left: 1px solid var(--yc-color-line-generic-accent);
10
+ border-left: 1px solid var(--g-color-line-generic-accent);
11
11
  }
12
12
  .df-simple-vertical-accordeon__header {
13
13
  display: flex;
@@ -22,15 +22,15 @@
22
22
  }
23
23
  .df-simple-vertical-accordeon__title_size_s {
24
24
  margin-bottom: 0;
25
- font-size: var(--yc-text-body-1-font-size);
25
+ font-size: var(--g-text-body-1-font-size);
26
26
  }
27
27
  .df-simple-vertical-accordeon__title_size_m {
28
28
  margin-bottom: 1px;
29
- font-size: var(--yc-text-body2-font-size);
29
+ font-size: var(--g-text-body2-font-size);
30
30
  }
31
31
  .df-simple-vertical-accordeon__title_size_l {
32
32
  margin-bottom: 2px;
33
- font-size: var(--yc-text-body3-font-size);
33
+ font-size: var(--g-text-body3-font-size);
34
34
  }
35
35
  .df-simple-vertical-accordeon__tooltip {
36
36
  margin: 0px 5px;
@@ -18,13 +18,13 @@
18
18
  white-space: nowrap;
19
19
  overflow: hidden;
20
20
  text-overflow: ellipsis;
21
- color: var(--yc-color-text-secondary);
21
+ color: var(--g-color-text-secondary);
22
22
  }
23
23
  .df-view-row__dots {
24
24
  min-width: 40px;
25
25
  flex-grow: 1;
26
26
  margin: 0 2px;
27
- border-bottom: 1px dotted var(--yc-color-text-secondary);
27
+ border-bottom: 1px dotted var(--g-color-text-secondary);
28
28
  }
29
29
  .df-view-row__right {
30
30
  max-width: 480px;
@@ -23,6 +23,6 @@ const CardOneOfView = (props) => {
23
23
  if (!value || !Object.keys(value).length) {
24
24
  return null;
25
25
  }
26
- return (react_1.default.createElement(__1.Card, { name: name, title: title, open: open, onToggle: onToggle, disableHeaderToggle: true, checkEmptyBody: true }, specProperties[valueKey] ? (react_1.default.createElement(core_1.ViewController, { spec: specProperties[valueKey], name: `${name}.${valueKey}`, key: `${name}.${valueKey}` })) : null));
26
+ return (react_1.default.createElement(__1.Card, { name: name, title: title, open: open, onToggle: onToggle, disableHeaderToggle: true, checkEmptyBody: true }, specProperties[valueKey] ? (react_1.default.createElement(core_1.ViewController, { spec: specProperties[valueKey], name: `${name ? name + '.' : ''}${valueKey}`, key: `${name ? name + '.' : ''}${valueKey}` })) : null));
27
27
  };
28
28
  exports.CardOneOfView = CardOneOfView;
@@ -1,4 +1,4 @@
1
1
  .df-monaco-base-view {
2
- border: 1px solid var(--yc-color-line-generic);
2
+ border: 1px solid var(--g-color-line-generic);
3
3
  width: 550px;
4
4
  }
@@ -2,7 +2,7 @@
2
2
  padding: 10px 32px 32px;
3
3
  }
4
4
  .df-monaco-view-dialog__container {
5
- border: 1px solid var(--yc-color-line-generic);
5
+ border: 1px solid var(--g-color-line-generic);
6
6
  }
7
7
  .df-monaco-view-dialog__dialog-header {
8
8
  height: 48px;
@@ -36,7 +36,7 @@ const MultiOneOfView = (props) => {
36
36
  return (react_1.default.createElement(react_1.default.Fragment, null,
37
37
  selectView,
38
38
  react_1.default.createElement("div", { className: b('content', { flat: withoutIndent, 'multiple-values': items.length > 1 }) },
39
- react_1.default.createElement(GroupIndent_1.GroupIndent, null, values.map((value) => (react_1.default.createElement(react_1.default.Fragment, { key: value }, specProperties && specProperties[value] ? (react_1.default.createElement(core_1.ViewController, { name: `${name}.${value}`, spec: specProperties[value] })) : null)))))));
39
+ react_1.default.createElement(GroupIndent_1.GroupIndent, null, values.map((value) => (react_1.default.createElement(react_1.default.Fragment, { key: value }, specProperties && specProperties[value] ? (react_1.default.createElement(core_1.ViewController, { name: `${name ? name + '.' : ''}${value}`, spec: specProperties[value] })) : null)))))));
40
40
  };
41
41
  exports.MultiOneOfView = MultiOneOfView;
42
42
  const MultiOneOfFlatView = (props) => (react_1.default.createElement(exports.MultiOneOfView, Object.assign({}, props, { withoutIndent: true })));
@@ -20,7 +20,7 @@ const ObjectValueInputView = (_a) => {
20
20
  if (!childSpec) {
21
21
  return null;
22
22
  }
23
- const content = (react_1.default.createElement(core_1.ViewController, { spec: childSpec, name: `${name}.${OBJECT_VALUE_PROPERTY_NAME}` }));
23
+ const content = (react_1.default.createElement(core_1.ViewController, { spec: childSpec, name: `${name ? name + '.' : ''}${OBJECT_VALUE_PROPERTY_NAME}` }));
24
24
  if (Layout) {
25
25
  return (react_1.default.createElement(Layout, Object.assign({ spec: spec, name: name }, restProps), content));
26
26
  }
@@ -31,7 +31,7 @@ const OneOfViewComponent = (props) => {
31
31
  return (react_1.default.createElement("div", { className: b({ flat: props.withoutIndent }) },
32
32
  wrappedValue,
33
33
  specProperties[valueKey] ? (react_1.default.createElement(__1.GroupIndent, null,
34
- react_1.default.createElement(core_1.ViewController, { spec: specProperties[valueKey], name: `${name}.${valueKey}`, key: `${name}.${valueKey}` }))) : null));
34
+ react_1.default.createElement(core_1.ViewController, { spec: specProperties[valueKey], name: `${name ? name + '.' : ''}${valueKey}`, key: `${name ? name + '.' : ''}${valueKey}` }))) : null));
35
35
  };
36
36
  exports.OneOfView = OneOfViewComponent;
37
37
  const OneOfFlatView = (props) => (react_1.default.createElement(OneOfViewComponent, Object.assign({}, props, { withoutIndent: true })));
@@ -22,7 +22,7 @@ const TextLinkView = (_a) => {
22
22
  if (!childSpec || !(value === null || value === void 0 ? void 0 : value.text)) {
23
23
  return null;
24
24
  }
25
- const content = react_1.default.createElement(core_1.ViewController, { spec: childSpec, name: `${name}.${TEXT_LINK_PROPERTY_NAME}` });
25
+ const content = (react_1.default.createElement(core_1.ViewController, { spec: childSpec, name: `${name ? name + '.' : ''}${TEXT_LINK_PROPERTY_NAME}` }));
26
26
  if (Layout) {
27
27
  return (react_1.default.createElement(Layout, Object.assign({ spec: spec, name: name, value: value }, restProps), content));
28
28
  }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });