@gravity-ui/dynamic-forms 5.27.1 → 5.29.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.
- package/build/cjs/lib/unstable/kit/constants/config.d.ts +2 -2
- package/build/cjs/lib/unstable/kit/constants/config.js +2 -2
- package/build/cjs/lib/unstable/kit/utils/transformer.js +15 -9
- package/build/esm/lib/unstable/kit/constants/config.d.ts +2 -2
- package/build/esm/lib/unstable/kit/constants/config.js +2 -2
- package/build/esm/lib/unstable/kit/utils/transformer.js +15 -9
- package/package.json +1 -1
|
@@ -403,7 +403,7 @@ export declare const untypedConfig: {
|
|
|
403
403
|
readonly label: {
|
|
404
404
|
readonly Component: import("../../core").NodeEntity<import("../../core").JsonSchemaString, import("../entities").LabelProps>;
|
|
405
405
|
};
|
|
406
|
-
readonly
|
|
406
|
+
readonly monaco_input: {
|
|
407
407
|
readonly Component: import("../../core").NodeEntity<import("../../core").JsonSchemaString, import("../entities").MonacoProps>;
|
|
408
408
|
};
|
|
409
409
|
readonly password: {
|
|
@@ -467,7 +467,7 @@ export declare const untypedConfig: {
|
|
|
467
467
|
readonly label: {
|
|
468
468
|
readonly Component: import("../../core").NodeEntity<import("../../core").JsonSchemaString, import("../entities").LabelProps>;
|
|
469
469
|
};
|
|
470
|
-
readonly
|
|
470
|
+
readonly monaco_input: {
|
|
471
471
|
readonly Component: import("../../core").NodeEntity<import("../../core").JsonSchemaString, import("../entities").MonacoProps>;
|
|
472
472
|
};
|
|
473
473
|
readonly password: {
|
|
@@ -175,7 +175,7 @@ exports.untypedConfig = {
|
|
|
175
175
|
color_picker: { Component: form_entities_1.ColorPickerInput },
|
|
176
176
|
file: { Component: form_entities_1.FileInput },
|
|
177
177
|
label: { Component: entities_1.Label },
|
|
178
|
-
|
|
178
|
+
monaco_input: { Component: entities_1.Monaco },
|
|
179
179
|
password: { Component: form_entities_1.PasswordInput },
|
|
180
180
|
radio_group: { Component: form_entities_1.RadioGroupInput },
|
|
181
181
|
segmented_radio_group: { Component: form_entities_1.SegmentedRadioGroupInput },
|
|
@@ -199,7 +199,7 @@ exports.untypedConfig = {
|
|
|
199
199
|
color_picker: { Component: overview_entities_1.ColorPickerValue },
|
|
200
200
|
file: { Component: overview_entities_1.StringValue },
|
|
201
201
|
label: { Component: entities_1.Label },
|
|
202
|
-
|
|
202
|
+
monaco_input: { Component: entities_1.Monaco },
|
|
203
203
|
password: { Component: overview_entities_1.StringValue },
|
|
204
204
|
radio_group: { Component: overview_entities_1.StringValue },
|
|
205
205
|
segmented_radio_group: { Component: overview_entities_1.StringValue },
|
|
@@ -157,12 +157,16 @@ const viewSpecRules = {
|
|
|
157
157
|
}
|
|
158
158
|
},
|
|
159
159
|
order: (spec, mutableSchema) => {
|
|
160
|
-
if (spec.type === core_1.SpecTypes.Object &&
|
|
160
|
+
if (spec.type === core_1.SpecTypes.Object &&
|
|
161
|
+
spec.viewSpec.order &&
|
|
162
|
+
Object.keys(spec.viewSpec.order).length) {
|
|
161
163
|
(0, set_1.default)(mutableSchema, 'nodeParameters.entityProps.order', spec.viewSpec.order);
|
|
162
164
|
}
|
|
163
165
|
},
|
|
164
166
|
delimiter: (spec, mutableSchema) => {
|
|
165
|
-
if (spec.type === core_1.SpecTypes.Object &&
|
|
167
|
+
if (spec.type === core_1.SpecTypes.Object &&
|
|
168
|
+
spec.viewSpec.delimiter &&
|
|
169
|
+
Object.keys(spec.viewSpec.delimiter).length) {
|
|
166
170
|
(0, set_1.default)(mutableSchema, 'nodeParameters.entityProps.delimiter', spec.viewSpec.delimiter);
|
|
167
171
|
}
|
|
168
172
|
},
|
|
@@ -307,7 +311,7 @@ const viewSpecRules = {
|
|
|
307
311
|
if (spec.description && Object.keys(spec.description).length) {
|
|
308
312
|
(0, set_1.default)(mutableSchema, 'nodeParameters.entityProps.toggler.nodeParameters.entityProps.enumDescriptions', spec.description);
|
|
309
313
|
}
|
|
310
|
-
else if (spec.properties) {
|
|
314
|
+
else if (spec.properties && Object.keys(spec.properties).length) {
|
|
311
315
|
(0, set_1.default)(mutableSchema, 'nodeParameters.entityProps.toggler.nodeParameters.entityProps.enumDescriptions', Object.fromEntries(Object.entries(spec.properties).map(([key, childSpec]) => [
|
|
312
316
|
key,
|
|
313
317
|
childSpec.viewSpec.layoutTitle || key,
|
|
@@ -352,7 +356,7 @@ const viewSpecRules = {
|
|
|
352
356
|
if (spec.description && Object.keys(spec.description).length) {
|
|
353
357
|
(0, set_1.default)(mutableSchema, 'nodeParameters.entityProps.toggler.nodeParameters.entityProps.enumDescriptions', spec.description);
|
|
354
358
|
}
|
|
355
|
-
else if (spec.properties) {
|
|
359
|
+
else if (spec.properties && Object.keys(spec.properties).length) {
|
|
356
360
|
(0, set_1.default)(mutableSchema, 'nodeParameters.entityProps.toggler.nodeParameters.entityProps.enumDescriptions', Object.fromEntries(Object.entries(spec.properties).map(([key, childSpec]) => [
|
|
357
361
|
key,
|
|
358
362
|
childSpec.viewSpec.layoutTitle || key,
|
|
@@ -397,7 +401,7 @@ const viewSpecRules = {
|
|
|
397
401
|
if (spec.description && Object.keys(spec.description).length) {
|
|
398
402
|
(0, set_1.default)(mutableSchema, 'nodeParameters.entityProps.toggler.nodeParameters.entityProps.enumDescriptions', spec.description);
|
|
399
403
|
}
|
|
400
|
-
else if (spec.properties) {
|
|
404
|
+
else if (spec.properties && Object.keys(spec.properties).length) {
|
|
401
405
|
(0, set_1.default)(mutableSchema, 'nodeParameters.entityProps.toggler.nodeParameters.entityProps.enumDescriptions', Object.fromEntries(Object.entries(spec.properties).map(([key, childSpec]) => [
|
|
402
406
|
key,
|
|
403
407
|
childSpec.viewSpec.layoutTitle || key,
|
|
@@ -443,7 +447,7 @@ const viewSpecRules = {
|
|
|
443
447
|
if (spec.description && Object.keys(spec.description).length) {
|
|
444
448
|
(0, set_1.default)(mutableSchema, 'nodeParameters.entityProps.toggler.nodeParameters.entityProps.enumDescriptions', spec.description);
|
|
445
449
|
}
|
|
446
|
-
else if (spec.properties) {
|
|
450
|
+
else if (spec.properties && Object.keys(spec.properties).length) {
|
|
447
451
|
(0, set_1.default)(mutableSchema, 'nodeParameters.entityProps.toggler.nodeParameters.entityProps.enumDescriptions', Object.fromEntries(Object.entries(spec.properties).map(([key, childSpec]) => [
|
|
448
452
|
key,
|
|
449
453
|
childSpec.viewSpec.layoutTitle || key,
|
|
@@ -478,7 +482,7 @@ const viewSpecRules = {
|
|
|
478
482
|
if (spec.description && Object.keys(spec.description).length) {
|
|
479
483
|
(0, set_1.default)(mutableSchema, 'nodeParameters.entityProps.toggler.nodeParameters.entityProps.enumDescriptions', spec.description);
|
|
480
484
|
}
|
|
481
|
-
else if (spec.properties) {
|
|
485
|
+
else if (spec.properties && Object.keys(spec.properties).length) {
|
|
482
486
|
(0, set_1.default)(mutableSchema, 'nodeParameters.entityProps.toggler.nodeParameters.entityProps.enumDescriptions', Object.fromEntries(Object.entries(spec.properties).map(([key, childSpec]) => [
|
|
483
487
|
key,
|
|
484
488
|
childSpec.viewSpec.layoutTitle || key,
|
|
@@ -514,7 +518,7 @@ const viewSpecRules = {
|
|
|
514
518
|
(0, set_1.default)(mutableSchema, 'nodeParameters.entity', 'file');
|
|
515
519
|
}
|
|
516
520
|
else if (spec.viewSpec.type === 'monaco_input') {
|
|
517
|
-
(0, set_1.default)(mutableSchema, 'nodeParameters.entity', '
|
|
521
|
+
(0, set_1.default)(mutableSchema, 'nodeParameters.entity', 'monaco_input');
|
|
518
522
|
}
|
|
519
523
|
else if (spec.viewSpec.type === 'number_with_scale') {
|
|
520
524
|
(0, set_1.default)(mutableSchema, 'nodeParameters.entity', 'string_number_with_scale');
|
|
@@ -616,7 +620,9 @@ const specRules = {
|
|
|
616
620
|
}
|
|
617
621
|
},
|
|
618
622
|
description: (spec, mutableSchema) => {
|
|
619
|
-
if ('description' in spec &&
|
|
623
|
+
if ('description' in spec &&
|
|
624
|
+
(0, isObject_1.default)(spec.description) &&
|
|
625
|
+
Object.keys(spec.description).length) {
|
|
620
626
|
(0, set_1.default)(mutableSchema, 'nodeParameters.entityProps.enumDescriptions', spec.description);
|
|
621
627
|
}
|
|
622
628
|
},
|
|
@@ -403,7 +403,7 @@ export declare const untypedConfig: {
|
|
|
403
403
|
readonly label: {
|
|
404
404
|
readonly Component: import("../../core").NodeEntity<import("../../core").JsonSchemaString, import("../entities").LabelProps>;
|
|
405
405
|
};
|
|
406
|
-
readonly
|
|
406
|
+
readonly monaco_input: {
|
|
407
407
|
readonly Component: import("../../core").NodeEntity<import("../../core").JsonSchemaString, import("../entities").MonacoProps>;
|
|
408
408
|
};
|
|
409
409
|
readonly password: {
|
|
@@ -467,7 +467,7 @@ export declare const untypedConfig: {
|
|
|
467
467
|
readonly label: {
|
|
468
468
|
readonly Component: import("../../core").NodeEntity<import("../../core").JsonSchemaString, import("../entities").LabelProps>;
|
|
469
469
|
};
|
|
470
|
-
readonly
|
|
470
|
+
readonly monaco_input: {
|
|
471
471
|
readonly Component: import("../../core").NodeEntity<import("../../core").JsonSchemaString, import("../entities").MonacoProps>;
|
|
472
472
|
};
|
|
473
473
|
readonly password: {
|
|
@@ -172,7 +172,7 @@ export const untypedConfig = {
|
|
|
172
172
|
color_picker: { Component: ColorPickerInput },
|
|
173
173
|
file: { Component: FileInput },
|
|
174
174
|
label: { Component: Label },
|
|
175
|
-
|
|
175
|
+
monaco_input: { Component: Monaco },
|
|
176
176
|
password: { Component: PasswordInput },
|
|
177
177
|
radio_group: { Component: RadioGroupInput },
|
|
178
178
|
segmented_radio_group: { Component: SegmentedRadioGroupInput },
|
|
@@ -196,7 +196,7 @@ export const untypedConfig = {
|
|
|
196
196
|
color_picker: { Component: ColorPickerValue },
|
|
197
197
|
file: { Component: StringValue },
|
|
198
198
|
label: { Component: Label },
|
|
199
|
-
|
|
199
|
+
monaco_input: { Component: Monaco },
|
|
200
200
|
password: { Component: StringValue },
|
|
201
201
|
radio_group: { Component: StringValue },
|
|
202
202
|
segmented_radio_group: { Component: StringValue },
|
|
@@ -153,12 +153,16 @@ const viewSpecRules = {
|
|
|
153
153
|
}
|
|
154
154
|
},
|
|
155
155
|
order: (spec, mutableSchema) => {
|
|
156
|
-
if (spec.type === SpecTypes.Object &&
|
|
156
|
+
if (spec.type === SpecTypes.Object &&
|
|
157
|
+
spec.viewSpec.order &&
|
|
158
|
+
Object.keys(spec.viewSpec.order).length) {
|
|
157
159
|
set(mutableSchema, 'nodeParameters.entityProps.order', spec.viewSpec.order);
|
|
158
160
|
}
|
|
159
161
|
},
|
|
160
162
|
delimiter: (spec, mutableSchema) => {
|
|
161
|
-
if (spec.type === SpecTypes.Object &&
|
|
163
|
+
if (spec.type === SpecTypes.Object &&
|
|
164
|
+
spec.viewSpec.delimiter &&
|
|
165
|
+
Object.keys(spec.viewSpec.delimiter).length) {
|
|
162
166
|
set(mutableSchema, 'nodeParameters.entityProps.delimiter', spec.viewSpec.delimiter);
|
|
163
167
|
}
|
|
164
168
|
},
|
|
@@ -303,7 +307,7 @@ const viewSpecRules = {
|
|
|
303
307
|
if (spec.description && Object.keys(spec.description).length) {
|
|
304
308
|
set(mutableSchema, 'nodeParameters.entityProps.toggler.nodeParameters.entityProps.enumDescriptions', spec.description);
|
|
305
309
|
}
|
|
306
|
-
else if (spec.properties) {
|
|
310
|
+
else if (spec.properties && Object.keys(spec.properties).length) {
|
|
307
311
|
set(mutableSchema, 'nodeParameters.entityProps.toggler.nodeParameters.entityProps.enumDescriptions', Object.fromEntries(Object.entries(spec.properties).map(([key, childSpec]) => [
|
|
308
312
|
key,
|
|
309
313
|
childSpec.viewSpec.layoutTitle || key,
|
|
@@ -348,7 +352,7 @@ const viewSpecRules = {
|
|
|
348
352
|
if (spec.description && Object.keys(spec.description).length) {
|
|
349
353
|
set(mutableSchema, 'nodeParameters.entityProps.toggler.nodeParameters.entityProps.enumDescriptions', spec.description);
|
|
350
354
|
}
|
|
351
|
-
else if (spec.properties) {
|
|
355
|
+
else if (spec.properties && Object.keys(spec.properties).length) {
|
|
352
356
|
set(mutableSchema, 'nodeParameters.entityProps.toggler.nodeParameters.entityProps.enumDescriptions', Object.fromEntries(Object.entries(spec.properties).map(([key, childSpec]) => [
|
|
353
357
|
key,
|
|
354
358
|
childSpec.viewSpec.layoutTitle || key,
|
|
@@ -393,7 +397,7 @@ const viewSpecRules = {
|
|
|
393
397
|
if (spec.description && Object.keys(spec.description).length) {
|
|
394
398
|
set(mutableSchema, 'nodeParameters.entityProps.toggler.nodeParameters.entityProps.enumDescriptions', spec.description);
|
|
395
399
|
}
|
|
396
|
-
else if (spec.properties) {
|
|
400
|
+
else if (spec.properties && Object.keys(spec.properties).length) {
|
|
397
401
|
set(mutableSchema, 'nodeParameters.entityProps.toggler.nodeParameters.entityProps.enumDescriptions', Object.fromEntries(Object.entries(spec.properties).map(([key, childSpec]) => [
|
|
398
402
|
key,
|
|
399
403
|
childSpec.viewSpec.layoutTitle || key,
|
|
@@ -439,7 +443,7 @@ const viewSpecRules = {
|
|
|
439
443
|
if (spec.description && Object.keys(spec.description).length) {
|
|
440
444
|
set(mutableSchema, 'nodeParameters.entityProps.toggler.nodeParameters.entityProps.enumDescriptions', spec.description);
|
|
441
445
|
}
|
|
442
|
-
else if (spec.properties) {
|
|
446
|
+
else if (spec.properties && Object.keys(spec.properties).length) {
|
|
443
447
|
set(mutableSchema, 'nodeParameters.entityProps.toggler.nodeParameters.entityProps.enumDescriptions', Object.fromEntries(Object.entries(spec.properties).map(([key, childSpec]) => [
|
|
444
448
|
key,
|
|
445
449
|
childSpec.viewSpec.layoutTitle || key,
|
|
@@ -474,7 +478,7 @@ const viewSpecRules = {
|
|
|
474
478
|
if (spec.description && Object.keys(spec.description).length) {
|
|
475
479
|
set(mutableSchema, 'nodeParameters.entityProps.toggler.nodeParameters.entityProps.enumDescriptions', spec.description);
|
|
476
480
|
}
|
|
477
|
-
else if (spec.properties) {
|
|
481
|
+
else if (spec.properties && Object.keys(spec.properties).length) {
|
|
478
482
|
set(mutableSchema, 'nodeParameters.entityProps.toggler.nodeParameters.entityProps.enumDescriptions', Object.fromEntries(Object.entries(spec.properties).map(([key, childSpec]) => [
|
|
479
483
|
key,
|
|
480
484
|
childSpec.viewSpec.layoutTitle || key,
|
|
@@ -510,7 +514,7 @@ const viewSpecRules = {
|
|
|
510
514
|
set(mutableSchema, 'nodeParameters.entity', 'file');
|
|
511
515
|
}
|
|
512
516
|
else if (spec.viewSpec.type === 'monaco_input') {
|
|
513
|
-
set(mutableSchema, 'nodeParameters.entity', '
|
|
517
|
+
set(mutableSchema, 'nodeParameters.entity', 'monaco_input');
|
|
514
518
|
}
|
|
515
519
|
else if (spec.viewSpec.type === 'number_with_scale') {
|
|
516
520
|
set(mutableSchema, 'nodeParameters.entity', 'string_number_with_scale');
|
|
@@ -612,7 +616,9 @@ const specRules = {
|
|
|
612
616
|
}
|
|
613
617
|
},
|
|
614
618
|
description: (spec, mutableSchema) => {
|
|
615
|
-
if ('description' in spec &&
|
|
619
|
+
if ('description' in spec &&
|
|
620
|
+
isObject(spec.description) &&
|
|
621
|
+
Object.keys(spec.description).length) {
|
|
616
622
|
set(mutableSchema, 'nodeParameters.entityProps.enumDescriptions', spec.description);
|
|
617
623
|
}
|
|
618
624
|
},
|