@gravity-ui/dynamic-forms 3.4.1 → 3.6.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/core/components/Form/Controller/utils.js +7 -8
- package/build/cjs/lib/kit/components/AccordeonCard/AccordeonCard.css +13 -11
- package/build/cjs/lib/kit/components/AccordeonCard/AccordeonCard.js +12 -5
- package/build/cjs/lib/kit/components/Card/Card.css +0 -6
- package/build/cjs/lib/kit/components/Card/Card.js +1 -1
- package/build/cjs/lib/kit/components/Inputs/CardOneOf/CardOneOf.js +1 -1
- package/build/cjs/lib/kit/components/Inputs/FileInput/FileInput.css +0 -4
- package/build/cjs/lib/kit/components/Inputs/FileInput/FileInput.js +1 -1
- package/build/cjs/lib/kit/components/Inputs/MonacoInput/MonacoHeader.css +0 -5
- package/build/cjs/lib/kit/components/Inputs/MonacoInput/MonacoHeader.js +1 -1
- package/build/cjs/lib/kit/components/Inputs/MultiSelect/MultiSelect.js +23 -14
- package/build/cjs/lib/kit/components/Inputs/Select/Select.js +23 -14
- package/build/cjs/lib/kit/components/Inputs/Text/Text.js +2 -11
- package/build/cjs/lib/kit/components/Inputs/TextArea/TextArea.js +2 -2
- package/build/cjs/lib/kit/components/Inputs/TextContent/TextContent.js +1 -1
- package/build/cjs/lib/kit/components/Layouts/Accordeon/Accordeon.js +1 -1
- package/build/cjs/lib/kit/components/Layouts/AccordeonCard/AccordeonCardForm.css +3 -0
- package/build/cjs/lib/kit/components/Layouts/AccordeonCard/AccordeonCardForm.js +29 -0
- package/build/cjs/lib/kit/components/Layouts/AccordeonCard/index.js +4 -0
- package/build/cjs/lib/kit/components/Layouts/CardAccordeon.js +1 -1
- package/build/cjs/lib/kit/components/Layouts/CardSection.js +1 -1
- package/build/cjs/lib/kit/components/Layouts/Row/Row.js +2 -2
- package/build/cjs/lib/kit/components/Layouts/Section/Section.js +1 -1
- package/build/cjs/lib/kit/components/Layouts/index.js +1 -0
- package/build/cjs/lib/kit/components/LongValue/LongValue.css +0 -6
- package/build/cjs/lib/kit/components/LongValue/LongValue.js +12 -1
- package/build/cjs/lib/kit/components/{Layouts/Accordeon → RemoveButton}/RemoveButton.js +1 -1
- package/build/cjs/lib/kit/components/RemoveButton/index.js +4 -0
- package/build/cjs/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.css +0 -15
- package/build/cjs/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.js +14 -3
- package/build/cjs/lib/kit/components/ViewLayouts/ViewAccordeonCard/ViewAccordeonCard.js +16 -0
- package/build/cjs/lib/kit/components/ViewLayouts/ViewAccordeonCard/index.js +4 -0
- package/build/cjs/lib/kit/components/ViewLayouts/ViewRow/ViewRow.css +0 -6
- package/build/cjs/lib/kit/components/ViewLayouts/ViewRow/ViewRow.js +2 -1
- package/build/cjs/lib/kit/components/ViewLayouts/index.js +1 -0
- package/build/cjs/lib/kit/components/Views/NumberWithScaleView/NumberWithScaleView.js +1 -3
- package/build/cjs/lib/kit/components/Views/TextAreaView/TextAreaView.css +0 -8
- package/build/cjs/lib/kit/components/Views/TextAreaView/TextAreaView.js +1 -1
- package/build/cjs/lib/kit/constants/config.js +4 -0
- package/build/esm/lib/core/components/Form/Controller/utils.js +7 -8
- package/build/esm/lib/core/components/Form/hooks/useGenerateRandomValue.d.ts +1 -1
- package/build/esm/lib/core/components/Form/types/array.d.ts +6 -6
- package/build/esm/lib/core/components/Form/types/boolean.d.ts +6 -6
- package/build/esm/lib/core/components/Form/types/input.d.ts +2 -0
- package/build/esm/lib/core/components/Form/types/layout.d.ts +1 -0
- package/build/esm/lib/core/components/Form/types/number.d.ts +6 -6
- package/build/esm/lib/core/components/Form/types/object.d.ts +6 -6
- package/build/esm/lib/core/components/Form/types/string.d.ts +6 -6
- package/build/esm/lib/core/helpers.d.ts +5 -5
- package/build/esm/lib/core/types/specs.d.ts +15 -5
- package/build/esm/lib/kit/components/AccordeonCard/AccordeonCard.css +13 -11
- package/build/esm/lib/kit/components/AccordeonCard/AccordeonCard.d.ts +1 -0
- package/build/esm/lib/kit/components/AccordeonCard/AccordeonCard.js +13 -6
- package/build/esm/lib/kit/components/Card/Card.css +0 -6
- package/build/esm/lib/kit/components/Card/Card.js +2 -2
- package/build/esm/lib/kit/components/Inputs/CardOneOf/CardOneOf.js +1 -1
- package/build/esm/lib/kit/components/Inputs/FileInput/FileInput.css +0 -4
- package/build/esm/lib/kit/components/Inputs/FileInput/FileInput.js +2 -2
- package/build/esm/lib/kit/components/Inputs/MonacoInput/MonacoHeader.css +0 -5
- package/build/esm/lib/kit/components/Inputs/MonacoInput/MonacoHeader.js +2 -2
- package/build/esm/lib/kit/components/Inputs/MultiSelect/MultiSelect.d.ts +5 -1
- package/build/esm/lib/kit/components/Inputs/MultiSelect/MultiSelect.js +23 -14
- package/build/esm/lib/kit/components/Inputs/Select/Select.d.ts +5 -1
- package/build/esm/lib/kit/components/Inputs/Select/Select.js +23 -14
- package/build/esm/lib/kit/components/Inputs/Text/Text.d.ts +4 -1
- package/build/esm/lib/kit/components/Inputs/Text/Text.js +2 -11
- package/build/esm/lib/kit/components/Inputs/TextArea/TextArea.d.ts +4 -1
- package/build/esm/lib/kit/components/Inputs/TextArea/TextArea.js +2 -2
- package/build/esm/lib/kit/components/Inputs/TextContent/TextContent.js +1 -1
- package/build/esm/lib/kit/components/Layouts/Accordeon/Accordeon.d.ts +1 -1
- package/build/esm/lib/kit/components/Layouts/Accordeon/Accordeon.js +1 -1
- package/build/esm/lib/kit/components/Layouts/AccordeonCard/AccordeonCardForm.css +3 -0
- package/build/esm/lib/kit/components/Layouts/AccordeonCard/AccordeonCardForm.d.ts +3 -0
- package/build/esm/lib/kit/components/Layouts/AccordeonCard/AccordeonCardForm.js +25 -0
- package/build/esm/lib/kit/components/Layouts/AccordeonCard/index.d.ts +1 -0
- package/build/esm/lib/kit/components/Layouts/AccordeonCard/index.js +1 -0
- package/build/esm/lib/kit/components/Layouts/CardAccordeon.js +1 -1
- package/build/esm/lib/kit/components/Layouts/CardSection.js +1 -1
- package/build/esm/lib/kit/components/Layouts/Row/Row.js +3 -3
- package/build/esm/lib/kit/components/Layouts/Section/Section.js +2 -2
- package/build/esm/lib/kit/components/Layouts/index.d.ts +1 -0
- package/build/esm/lib/kit/components/Layouts/index.js +1 -0
- package/build/esm/lib/kit/components/LongValue/LongValue.css +0 -6
- package/build/esm/lib/kit/components/LongValue/LongValue.js +12 -1
- package/build/esm/lib/kit/components/{Layouts/Accordeon → RemoveButton}/RemoveButton.js +1 -1
- package/build/esm/lib/kit/components/RemoveButton/index.d.ts +1 -0
- package/build/esm/lib/kit/components/RemoveButton/index.js +1 -0
- package/build/esm/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.css +0 -15
- package/build/esm/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.d.ts +1 -0
- package/build/esm/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.js +15 -4
- package/build/esm/lib/kit/components/ViewLayouts/ViewAccordeonCard/ViewAccordeonCard.d.ts +2 -0
- package/build/esm/lib/kit/components/ViewLayouts/ViewAccordeonCard/ViewAccordeonCard.js +11 -0
- package/build/esm/lib/kit/components/ViewLayouts/ViewAccordeonCard/index.d.ts +1 -0
- package/build/esm/lib/kit/components/ViewLayouts/ViewAccordeonCard/index.js +1 -0
- package/build/esm/lib/kit/components/ViewLayouts/ViewRow/ViewRow.css +0 -6
- package/build/esm/lib/kit/components/ViewLayouts/ViewRow/ViewRow.js +2 -1
- package/build/esm/lib/kit/components/ViewLayouts/index.d.ts +1 -0
- package/build/esm/lib/kit/components/ViewLayouts/index.js +1 -0
- package/build/esm/lib/kit/components/Views/NumberWithScaleView/NumberWithScaleView.js +2 -4
- package/build/esm/lib/kit/components/Views/TextAreaView/TextAreaView.css +0 -8
- package/build/esm/lib/kit/components/Views/TextAreaView/TextAreaView.js +2 -2
- package/build/esm/lib/kit/constants/config.js +5 -1
- package/package.json +1 -1
- /package/build/esm/lib/kit/components/{Layouts/Accordeon → RemoveButton}/RemoveButton.d.ts +0 -0
|
@@ -14,12 +14,6 @@
|
|
|
14
14
|
align-items: baseline;
|
|
15
15
|
overflow: hidden;
|
|
16
16
|
}
|
|
17
|
-
.df-view-row__title {
|
|
18
|
-
white-space: nowrap;
|
|
19
|
-
overflow: hidden;
|
|
20
|
-
text-overflow: ellipsis;
|
|
21
|
-
color: var(--g-color-text-secondary);
|
|
22
|
-
}
|
|
23
17
|
.df-view-row__dots {
|
|
24
18
|
min-width: 40px;
|
|
25
19
|
flex-grow: 1;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ViewRow = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const uikit_1 = require("@gravity-ui/uikit");
|
|
6
7
|
const kit_1 = require("../../../../kit");
|
|
7
8
|
const utils_1 = require("../../../utils");
|
|
8
9
|
const b = (0, utils_1.block)('view-row');
|
|
@@ -12,7 +13,7 @@ const ViewRow = ({ value, spec, children, }) => {
|
|
|
12
13
|
}
|
|
13
14
|
return (react_1.default.createElement("div", { className: b() },
|
|
14
15
|
react_1.default.createElement("div", { className: b('left') },
|
|
15
|
-
react_1.default.createElement(
|
|
16
|
+
react_1.default.createElement(uikit_1.Text, { whiteSpace: "nowrap", color: "secondary", ellipsis: true }, spec.viewSpec.layoutTitle),
|
|
16
17
|
react_1.default.createElement("div", { className: b('dots') })),
|
|
17
18
|
react_1.default.createElement("div", { className: b('right') }, children),
|
|
18
19
|
react_1.default.createElement(kit_1.CopyButton, { spec: spec, value: value })));
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./ViewAccordeon"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./ViewCardAccordeon"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./ViewAccordeonCard"), exports);
|
|
6
7
|
tslib_1.__exportStar(require("./ViewCardSection"), exports);
|
|
7
8
|
tslib_1.__exportStar(require("./ViewRow"), exports);
|
|
8
9
|
tslib_1.__exportStar(require("./ViewSection"), exports);
|
|
@@ -12,9 +12,7 @@ const NumberWithScaleViewBase = ({ spec, value }) => {
|
|
|
12
12
|
const { scale } = spec.viewSpec.sizeParams;
|
|
13
13
|
return (react_1.default.createElement("div", { className: b() },
|
|
14
14
|
react_1.default.createElement(uikit_1.Popover, { placement: ['bottom', 'top'], content: initialValue, className: b('tooltip-container'), contentClassName: b('tooltip'), disabled: initialValue.length < 26 }, initialValue),
|
|
15
|
-
react_1.default.createElement(
|
|
16
|
-
" ",
|
|
17
|
-
scale[initialType].title)));
|
|
15
|
+
react_1.default.createElement(uikit_1.Text, { className: b('size') }, scale[initialType].title)));
|
|
18
16
|
};
|
|
19
17
|
const NumberWithScaleView = (props) => (0, utils_1.isCorrectSizeParams)(props.spec) && props.value ? react_1.default.createElement(NumberWithScaleViewBase, Object.assign({}, props)) : null;
|
|
20
18
|
exports.NumberWithScaleView = NumberWithScaleView;
|
|
@@ -4,14 +4,6 @@
|
|
|
4
4
|
.df-text-area-view_active {
|
|
5
5
|
cursor: pointer;
|
|
6
6
|
}
|
|
7
|
-
.df-text-area-view__text-view {
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
text-overflow: ellipsis;
|
|
10
|
-
}
|
|
11
|
-
.df-text-area-view__text-view_open {
|
|
12
|
-
white-space: pre-wrap;
|
|
13
|
-
overflow-wrap: break-word;
|
|
14
|
-
}
|
|
15
7
|
.df-text-area-view__chevron {
|
|
16
8
|
margin: 3px;
|
|
17
9
|
}
|
|
@@ -14,7 +14,7 @@ const TextAreaView = ({ value = '' }) => {
|
|
|
14
14
|
setIsOpen(!isOpen);
|
|
15
15
|
}, [isOpen]);
|
|
16
16
|
return (react_1.default.createElement("div", { className: b({ active: isValueLong }), onClick: isValueLong ? handleClick : undefined },
|
|
17
|
-
react_1.default.createElement(
|
|
17
|
+
react_1.default.createElement(uikit_1.Text, { ellipsis: true, whiteSpace: isOpen ? 'break-spaces' : undefined }, value),
|
|
18
18
|
isValueLong ? (react_1.default.createElement("div", null,
|
|
19
19
|
react_1.default.createElement(uikit_1.Icon, { data: icons_1.ChevronDown, className: b('chevron', { open: isOpen }), size: 16 }))) : null));
|
|
20
20
|
};
|
|
@@ -22,6 +22,7 @@ exports.dynamicConfig = {
|
|
|
22
22
|
transparent: components_1.Transparent,
|
|
23
23
|
card_accordeon: components_1.CardAccordeon,
|
|
24
24
|
card_section: components_1.CardSection,
|
|
25
|
+
accordeon_card: components_1.AccordeonCardForm,
|
|
25
26
|
},
|
|
26
27
|
validators: {
|
|
27
28
|
base: (0, validators_1.getArrayValidator)(),
|
|
@@ -79,6 +80,7 @@ exports.dynamicConfig = {
|
|
|
79
80
|
transparent: components_1.Transparent,
|
|
80
81
|
card_accordeon: components_1.CardAccordeon,
|
|
81
82
|
card_section: components_1.CardSection,
|
|
83
|
+
accordeon_card: components_1.AccordeonCardForm,
|
|
82
84
|
},
|
|
83
85
|
validators: {
|
|
84
86
|
base: (0, validators_1.getObjectValidator)(),
|
|
@@ -131,6 +133,7 @@ exports.dynamicViewConfig = {
|
|
|
131
133
|
transparent: components_1.ViewTransparent,
|
|
132
134
|
card_accordeon: components_1.ViewCardAccordeon,
|
|
133
135
|
card_section: components_1.ViewCardSection,
|
|
136
|
+
accordeon_card: components_1.ViewAccordeonCard,
|
|
134
137
|
},
|
|
135
138
|
},
|
|
136
139
|
boolean: {
|
|
@@ -179,6 +182,7 @@ exports.dynamicViewConfig = {
|
|
|
179
182
|
transparent: components_1.ViewTransparent,
|
|
180
183
|
card_accordeon: components_1.ViewCardAccordeon,
|
|
181
184
|
card_section: components_1.ViewCardSection,
|
|
185
|
+
accordeon_card: components_1.ViewAccordeonCard,
|
|
182
186
|
},
|
|
183
187
|
},
|
|
184
188
|
string: {
|
|
@@ -52,14 +52,15 @@ export const getRender = ({ name, spec, inputEntity, Layout, }) => {
|
|
|
52
52
|
const render = (props) => {
|
|
53
53
|
if (inputEntity && isCorrectSpec(spec) && _.isString(name)) {
|
|
54
54
|
if (!spec.viewSpec.hidden) {
|
|
55
|
+
const { layoutProps, inputProps } = spec.viewSpec;
|
|
55
56
|
if (inputEntity.independent) {
|
|
56
57
|
const InputComponent = inputEntity.Component;
|
|
57
|
-
return React.createElement(InputComponent, Object.assign({ spec: spec, name: name, Layout: Layout }, props));
|
|
58
|
+
return (React.createElement(InputComponent, Object.assign({ spec: spec, name: name, Layout: Layout, inputProps: inputProps, layoutProps: layoutProps }, props)));
|
|
58
59
|
}
|
|
59
60
|
const InputComponent = inputEntity.Component;
|
|
60
|
-
const input = React.createElement(InputComponent, Object.assign({ spec: spec, name: name }, props));
|
|
61
|
+
const input = (React.createElement(InputComponent, Object.assign({ spec: spec, name: name, inputProps: inputProps }, props)));
|
|
61
62
|
if (Layout) {
|
|
62
|
-
return (React.createElement(Layout, Object.assign({ spec: spec, name: name }, props), input));
|
|
63
|
+
return (React.createElement(Layout, Object.assign({ spec: spec, name: name, layoutProps: layoutProps }, props), input));
|
|
63
64
|
}
|
|
64
65
|
return input;
|
|
65
66
|
}
|
|
@@ -275,11 +276,9 @@ export const updateStore = ({ store, setStore, spec: _spec, name, parentOnChange
|
|
|
275
276
|
parentOnChange,
|
|
276
277
|
parentOnUnmount,
|
|
277
278
|
})), { state: store.state });
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
: {})));
|
|
282
|
-
}
|
|
279
|
+
nextStore = methodOnChange(nextStore, Object.assign({ valOrSetter: (value) => valueMutatorUpdated ? valueMutator.value : value }, (errorMutatorUpdated
|
|
280
|
+
? { errorMutator: errorMutator.value }
|
|
281
|
+
: {})));
|
|
283
282
|
setStore(nextStore);
|
|
284
283
|
}
|
|
285
284
|
else if (updateNonCritical) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useGenerateRandomValue: () => ((spec: import("../../..").StringSpec<any>) => string) | undefined;
|
|
1
|
+
export declare const useGenerateRandomValue: () => ((spec: import("../../..").StringSpec<any, {}, {}>) => string) | undefined;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ArraySpec, ArrayValue } from '../../../types';
|
|
2
2
|
import { FieldArrayValue, IndependentInputEntity, IndependentInputProps, IndependentInputType, InputEntity, InputProps, InputType, InputsMap, LayoutProps, LayoutType, LayoutsMap, TypeConfig, ValidatorsMap } from './';
|
|
3
|
-
export type ArrayInputProps = InputProps<FieldArrayValue, ArraySpec
|
|
4
|
-
export type ArrayIndependentInputProps = IndependentInputProps<FieldArrayValue, ArraySpec
|
|
5
|
-
export type ArrayLayoutProps = LayoutProps<FieldArrayValue, ArraySpec
|
|
6
|
-
export type ArrayInput = InputType<FieldArrayValue, ArraySpec
|
|
7
|
-
export type ArrayIndependentInput = IndependentInputType<FieldArrayValue, ArraySpec
|
|
8
|
-
export type ArrayLayout = LayoutType<FieldArrayValue, ArraySpec
|
|
3
|
+
export type ArrayInputProps<InputComponentProps extends Record<string, any> = {}> = InputProps<FieldArrayValue, ArraySpec<undefined, InputComponentProps>>;
|
|
4
|
+
export type ArrayIndependentInputProps<InputComponentProps extends Record<string, any> = {}, LayoutComponentProps extends Record<string, any> = {}> = IndependentInputProps<FieldArrayValue, ArraySpec<undefined, InputComponentProps, LayoutComponentProps>>;
|
|
5
|
+
export type ArrayLayoutProps<LayoutComponentProps extends Record<string, any> = {}> = LayoutProps<FieldArrayValue, ArraySpec<undefined, any, LayoutComponentProps>>;
|
|
6
|
+
export type ArrayInput<InputComponentProps extends Record<string, any> = {}> = InputType<FieldArrayValue, ArraySpec<undefined, InputComponentProps>>;
|
|
7
|
+
export type ArrayIndependentInput<InputComponentProps extends Record<string, any> = {}, LayoutComponentProps extends Record<string, any> = {}> = IndependentInputType<FieldArrayValue, ArraySpec<undefined, InputComponentProps, LayoutComponentProps>>;
|
|
8
|
+
export type ArrayLayout<LayoutComponentProps extends Record<string, any> = {}> = LayoutType<FieldArrayValue, ArraySpec<undefined, any, LayoutComponentProps>>;
|
|
9
9
|
export type ArrayInputEntity = InputEntity<FieldArrayValue, ArraySpec>;
|
|
10
10
|
export type ArrayIndependentInputEntity = IndependentInputEntity<FieldArrayValue, ArraySpec>;
|
|
11
11
|
export type ArrayInputsMap = InputsMap<FieldArrayValue, ArraySpec>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { BooleanSpec } from '../../../types';
|
|
2
2
|
import { IndependentInputEntity, IndependentInputProps, IndependentInputType, InputEntity, InputProps, InputType, InputsMap, LayoutProps, LayoutType, LayoutsMap, TypeConfig, ValidatorsMap } from './';
|
|
3
|
-
export type BooleanInputProps = InputProps<boolean, BooleanSpec
|
|
4
|
-
export type BooleanIndependentInputProps = IndependentInputProps<boolean, BooleanSpec
|
|
5
|
-
export type BooleanLayoutProps = LayoutProps<boolean, BooleanSpec
|
|
6
|
-
export type BooleanInput = InputType<boolean, BooleanSpec
|
|
7
|
-
export type BooleanIndependentInput = IndependentInputType<boolean, BooleanSpec
|
|
8
|
-
export type BooleanLayout = LayoutType<boolean, BooleanSpec
|
|
3
|
+
export type BooleanInputProps<InputComponentProps extends Record<string, any> = {}> = InputProps<boolean, BooleanSpec<undefined, InputComponentProps>>;
|
|
4
|
+
export type BooleanIndependentInputProps<InputComponentProps extends Record<string, any> = {}, LayoutComponentProps extends Record<string, any> = {}> = IndependentInputProps<boolean, BooleanSpec<undefined, InputComponentProps, LayoutComponentProps>>;
|
|
5
|
+
export type BooleanLayoutProps<LayoutComponentProps extends Record<string, any> = {}> = LayoutProps<boolean, BooleanSpec<undefined, any, LayoutComponentProps>>;
|
|
6
|
+
export type BooleanInput<InputComponentProps extends Record<string, any> = {}> = InputType<boolean, BooleanSpec<undefined, InputComponentProps>>;
|
|
7
|
+
export type BooleanIndependentInput<InputComponentProps extends Record<string, any> = {}, LayoutComponentProps extends Record<string, any> = {}> = IndependentInputType<boolean, BooleanSpec<undefined, InputComponentProps, LayoutComponentProps>>;
|
|
8
|
+
export type BooleanLayout<LayoutComponentProps extends Record<string, any> = {}> = LayoutType<boolean, BooleanSpec<undefined, any, LayoutComponentProps>>;
|
|
9
9
|
export type BooleanInputEntity = InputEntity<boolean, BooleanSpec>;
|
|
10
10
|
export type BooleanIndependentInputEntity = IndependentInputEntity<boolean, BooleanSpec>;
|
|
11
11
|
export type BooleanInputsMap = InputsMap<boolean, BooleanSpec>;
|
|
@@ -4,9 +4,11 @@ import { FieldRenderProps, FieldValue, LayoutType } from './';
|
|
|
4
4
|
export type InputProps<Value extends FieldValue, SpecType extends Spec> = {
|
|
5
5
|
spec: SpecType;
|
|
6
6
|
name: string;
|
|
7
|
+
inputProps?: SpecType['viewSpec']['inputProps'];
|
|
7
8
|
} & FieldRenderProps<Value>;
|
|
8
9
|
export type IndependentInputProps<Value extends FieldValue, SpecType extends Spec> = {
|
|
9
10
|
Layout: LayoutType<Value, SpecType> | undefined;
|
|
11
|
+
layoutProps?: SpecType['viewSpec']['layoutProps'];
|
|
10
12
|
} & InputProps<Value, SpecType>;
|
|
11
13
|
export type InputType<Value extends FieldValue, SpecType extends Spec> = (props: InputProps<Value, SpecType>) => React.ReactElement | null;
|
|
12
14
|
export type IndependentInputType<Value extends FieldValue, SpecType extends Spec> = (props: IndependentInputProps<Value, SpecType>) => React.ReactElement | null;
|
|
@@ -3,6 +3,7 @@ import { Spec } from '../../../types';
|
|
|
3
3
|
import { FieldValue, InputProps } from './';
|
|
4
4
|
export type LayoutProps<Value extends FieldValue, SpecType extends Spec> = {
|
|
5
5
|
children: React.ReactElement;
|
|
6
|
+
layoutProps?: SpecType['viewSpec']['layoutProps'];
|
|
6
7
|
} & InputProps<Value, SpecType>;
|
|
7
8
|
export type LayoutType<Value extends FieldValue, SpecType extends Spec> = (props: LayoutProps<Value, SpecType>) => React.ReactElement | null;
|
|
8
9
|
export type LayoutsMap<Value extends FieldValue, SpecType extends Spec> = Record<string, LayoutType<Value, SpecType> | undefined>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { NumberSpec } from '../../../types';
|
|
2
2
|
import { IndependentInputEntity, IndependentInputProps, IndependentInputType, InputEntity, InputProps, InputType, InputsMap, LayoutProps, LayoutType, LayoutsMap, TypeConfig, ValidatorsMap } from './';
|
|
3
|
-
export type NumberInputProps = InputProps<number, NumberSpec
|
|
4
|
-
export type NumberIndependentInputProps = IndependentInputProps<number, NumberSpec
|
|
5
|
-
export type NumberLayoutProps = LayoutProps<number, NumberSpec
|
|
6
|
-
export type NumberInput = InputType<number, NumberSpec
|
|
7
|
-
export type NumberIndependentInput = IndependentInputType<number, NumberSpec
|
|
8
|
-
export type NumberLayout = LayoutType<number, NumberSpec
|
|
3
|
+
export type NumberInputProps<InputComponentProps extends Record<string, any> = {}> = InputProps<number, NumberSpec<undefined, InputComponentProps>>;
|
|
4
|
+
export type NumberIndependentInputProps<InputComponentProps extends Record<string, any> = {}, LayoutComponentProps extends Record<string, any> = {}> = IndependentInputProps<number, NumberSpec<undefined, InputComponentProps, LayoutComponentProps>>;
|
|
5
|
+
export type NumberLayoutProps<LayoutComponentProps extends Record<string, any> = {}> = LayoutProps<number, NumberSpec<undefined, any, LayoutComponentProps>>;
|
|
6
|
+
export type NumberInput<InputComponentProps extends Record<string, any> = {}> = InputType<number, NumberSpec<undefined, InputComponentProps>>;
|
|
7
|
+
export type NumberIndependentInput<InputComponentProps extends Record<string, any> = {}, LayoutComponentProps extends Record<string, any> = {}> = IndependentInputType<number, NumberSpec<undefined, InputComponentProps, LayoutComponentProps>>;
|
|
8
|
+
export type NumberLayout<LayoutComponentProps extends Record<string, any> = {}> = LayoutType<number, NumberSpec<undefined, any, LayoutComponentProps>>;
|
|
9
9
|
export type NumberInputEntity = InputEntity<number, NumberSpec>;
|
|
10
10
|
export type NumberIndependentInputEntity = IndependentInputEntity<number, NumberSpec>;
|
|
11
11
|
export type NumberInputsMap = InputsMap<number, NumberSpec>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ObjectSpec, ObjectValue } from '../../../types';
|
|
2
2
|
import { FieldObjectValue, IndependentInputEntity, IndependentInputProps, IndependentInputType, InputEntity, InputProps, InputType, InputsMap, LayoutProps, LayoutType, LayoutsMap, TypeConfig, ValidatorsMap } from './';
|
|
3
|
-
export type ObjectInputProps = InputProps<FieldObjectValue, ObjectSpec
|
|
4
|
-
export type ObjectIndependentInputProps = IndependentInputProps<FieldObjectValue, ObjectSpec
|
|
5
|
-
export type ObjectLayoutProps = LayoutProps<FieldObjectValue, ObjectSpec
|
|
6
|
-
export type ObjectInput = InputType<FieldObjectValue, ObjectSpec
|
|
7
|
-
export type ObjectIndependentInput = IndependentInputType<FieldObjectValue, ObjectSpec
|
|
8
|
-
export type ObjectLayout = LayoutType<FieldObjectValue, ObjectSpec
|
|
3
|
+
export type ObjectInputProps<InputComponentProps extends Record<string, any> = {}> = InputProps<FieldObjectValue, ObjectSpec<undefined, InputComponentProps>>;
|
|
4
|
+
export type ObjectIndependentInputProps<InputComponentProps extends Record<string, any> = {}, LayoutComponentProps extends Record<string, any> = {}> = IndependentInputProps<FieldObjectValue, ObjectSpec<undefined, InputComponentProps, LayoutComponentProps>>;
|
|
5
|
+
export type ObjectLayoutProps<LayoutComponentProps extends Record<string, any> = {}> = LayoutProps<FieldObjectValue, ObjectSpec<undefined, any, LayoutComponentProps>>;
|
|
6
|
+
export type ObjectInput<InputComponentProps extends Record<string, any> = {}> = InputType<FieldObjectValue, ObjectSpec<undefined, InputComponentProps>>;
|
|
7
|
+
export type ObjectIndependentInput<InputComponentProps extends Record<string, any> = {}, LayoutComponentProps extends Record<string, any> = {}> = IndependentInputType<FieldObjectValue, ObjectSpec<undefined, InputComponentProps, LayoutComponentProps>>;
|
|
8
|
+
export type ObjectLayout<LayoutComponentProps extends Record<string, any> = {}> = LayoutType<FieldObjectValue, ObjectSpec<undefined, any, LayoutComponentProps>>;
|
|
9
9
|
export type ObjectInputEntity = InputEntity<FieldObjectValue, ObjectSpec>;
|
|
10
10
|
export type ObjectIndependentInputEntity = IndependentInputEntity<FieldObjectValue, ObjectSpec>;
|
|
11
11
|
export type ObjectInputsMap = InputsMap<FieldObjectValue, ObjectSpec>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { StringSpec } from '../../../types';
|
|
2
2
|
import { IndependentInputEntity, IndependentInputProps, IndependentInputType, InputEntity, InputProps, InputType, InputsMap, LayoutProps, LayoutType, LayoutsMap, TypeConfig, ValidatorsMap } from './';
|
|
3
|
-
export type StringInputProps = InputProps<string, StringSpec
|
|
4
|
-
export type StringIndependentInputProps = IndependentInputProps<string, StringSpec
|
|
5
|
-
export type StringLayoutProps = LayoutProps<string, StringSpec
|
|
6
|
-
export type StringInput = InputType<string, StringSpec
|
|
7
|
-
export type StringIndependentInput = IndependentInputType<string, StringSpec
|
|
8
|
-
export type StringLayout = LayoutType<string, StringSpec
|
|
3
|
+
export type StringInputProps<InputComponentProps extends Record<string, any> = {}> = InputProps<string, StringSpec<undefined, InputComponentProps>>;
|
|
4
|
+
export type StringIndependentInputProps<InputComponentProps extends Record<string, any> = {}, LayoutComponentProps extends Record<string, any> = {}> = IndependentInputProps<string, StringSpec<undefined, InputComponentProps, LayoutComponentProps>>;
|
|
5
|
+
export type StringLayoutProps<LayoutComponentProps extends Record<string, any> = {}> = LayoutProps<string, StringSpec<undefined, any, LayoutComponentProps>>;
|
|
6
|
+
export type StringInput<InputComponentProps extends Record<string, any> = {}> = InputType<string, StringSpec<undefined, InputComponentProps>>;
|
|
7
|
+
export type StringIndependentInput<InputComponentProps extends Record<string, any> = {}, LayoutComponentProps extends Record<string, any> = {}> = IndependentInputType<string, StringSpec<undefined, InputComponentProps, LayoutComponentProps>>;
|
|
8
|
+
export type StringLayout<LayoutComponentProps extends Record<string, any> = {}> = LayoutType<string, StringSpec<undefined, any, LayoutComponentProps>>;
|
|
9
9
|
export type StringInputEntity = InputEntity<string, StringSpec>;
|
|
10
10
|
export type StringIndependentInputEntity = IndependentInputEntity<string, StringSpec>;
|
|
11
11
|
export type StringInputsMap = InputsMap<string, StringSpec>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ArraySpec, BooleanSpec, NumberSpec, ObjectSpec, StringSpec } from './types';
|
|
2
2
|
export declare const isCorrectSpec: (candidate: any) => boolean;
|
|
3
|
-
export declare const isArraySpec: (candidate: any) => candidate is ArraySpec<any>;
|
|
4
|
-
export declare const isBooleanSpec: (candidate: any) => candidate is BooleanSpec<any>;
|
|
5
|
-
export declare const isNumberSpec: (candidate: any) => candidate is NumberSpec<any>;
|
|
6
|
-
export declare const isObjectSpec: (candidate: any) => candidate is ObjectSpec<any>;
|
|
7
|
-
export declare const isStringSpec: (candidate: any) => candidate is StringSpec<any>;
|
|
3
|
+
export declare const isArraySpec: (candidate: any) => candidate is ArraySpec<any, {}, {}>;
|
|
4
|
+
export declare const isBooleanSpec: (candidate: any) => candidate is BooleanSpec<any, {}, {}>;
|
|
5
|
+
export declare const isNumberSpec: (candidate: any) => candidate is NumberSpec<any, {}, {}>;
|
|
6
|
+
export declare const isObjectSpec: (candidate: any) => candidate is ObjectSpec<any, {}, {}>;
|
|
7
|
+
export declare const isStringSpec: (candidate: any) => candidate is StringSpec<any, {}, {}>;
|
|
@@ -2,7 +2,7 @@ import { LabelProps } from '@gravity-ui/uikit';
|
|
|
2
2
|
import { ColorTextBaseProps } from '@gravity-ui/uikit/build/esm/components/Text/colorText/colorText';
|
|
3
3
|
import { ReadAsMethod, SpecTypes } from '../constants';
|
|
4
4
|
import { ArrayValue, ObjectValue } from './';
|
|
5
|
-
export interface ArraySpec<LinkType = any> {
|
|
5
|
+
export interface ArraySpec<LinkType = any, InputComponentProps extends Record<string, any> = {}, LayoutComponentProps extends Record<string, any> = {}> {
|
|
6
6
|
defaultValue?: ArrayValue;
|
|
7
7
|
type: SpecTypes.Array;
|
|
8
8
|
required?: boolean;
|
|
@@ -33,9 +33,11 @@ export interface ArraySpec<LinkType = any> {
|
|
|
33
33
|
filterPlaceholder?: string;
|
|
34
34
|
meta?: Record<string, string>;
|
|
35
35
|
};
|
|
36
|
+
inputProps?: InputComponentProps;
|
|
37
|
+
layoutProps?: LayoutComponentProps;
|
|
36
38
|
};
|
|
37
39
|
}
|
|
38
|
-
export interface BooleanSpec<LinkType = any> {
|
|
40
|
+
export interface BooleanSpec<LinkType = any, InputComponentProps extends Record<string, any> = {}, LayoutComponentProps extends Record<string, any> = {}> {
|
|
39
41
|
defaultValue?: boolean;
|
|
40
42
|
type: SpecTypes.Boolean;
|
|
41
43
|
required?: boolean;
|
|
@@ -49,9 +51,11 @@ export interface BooleanSpec<LinkType = any> {
|
|
|
49
51
|
layoutOpen?: boolean;
|
|
50
52
|
link?: LinkType;
|
|
51
53
|
hidden?: boolean;
|
|
54
|
+
inputProps?: InputComponentProps;
|
|
55
|
+
layoutProps?: LayoutComponentProps;
|
|
52
56
|
};
|
|
53
57
|
}
|
|
54
|
-
export interface NumberSpec<LinkType = any> {
|
|
58
|
+
export interface NumberSpec<LinkType = any, InputComponentProps extends Record<string, any> = {}, LayoutComponentProps extends Record<string, any> = {}> {
|
|
55
59
|
defaultValue?: number;
|
|
56
60
|
type: SpecTypes.Number;
|
|
57
61
|
required?: boolean;
|
|
@@ -70,9 +74,11 @@ export interface NumberSpec<LinkType = any> {
|
|
|
70
74
|
placeholder?: string;
|
|
71
75
|
copy?: boolean;
|
|
72
76
|
hidden?: boolean;
|
|
77
|
+
inputProps?: InputComponentProps;
|
|
78
|
+
layoutProps?: LayoutComponentProps;
|
|
73
79
|
};
|
|
74
80
|
}
|
|
75
|
-
export interface ObjectSpec<LinkType = any> {
|
|
81
|
+
export interface ObjectSpec<LinkType = any, InputComponentProps extends Record<string, any> = {}, LayoutComponentProps extends Record<string, any> = {}> {
|
|
76
82
|
defaultValue?: ObjectValue;
|
|
77
83
|
type: SpecTypes.Object;
|
|
78
84
|
required?: boolean;
|
|
@@ -93,9 +99,11 @@ export interface ObjectSpec<LinkType = any> {
|
|
|
93
99
|
};
|
|
94
100
|
placeholder?: string;
|
|
95
101
|
hidden?: boolean;
|
|
102
|
+
inputProps?: InputComponentProps;
|
|
103
|
+
layoutProps?: LayoutComponentProps;
|
|
96
104
|
};
|
|
97
105
|
}
|
|
98
|
-
export interface StringSpec<LinkType = any> {
|
|
106
|
+
export interface StringSpec<LinkType = any, InputComponentProps extends Record<string, any> = {}, LayoutComponentProps extends Record<string, any> = {}> {
|
|
99
107
|
defaultValue?: string;
|
|
100
108
|
type: SpecTypes.String;
|
|
101
109
|
required?: boolean;
|
|
@@ -145,6 +153,8 @@ export interface StringSpec<LinkType = any> {
|
|
|
145
153
|
filterPlaceholder?: string;
|
|
146
154
|
meta?: Record<string, string>;
|
|
147
155
|
};
|
|
156
|
+
inputProps?: InputComponentProps;
|
|
157
|
+
layoutProps?: LayoutComponentProps;
|
|
148
158
|
generateRandomValueButton?: boolean;
|
|
149
159
|
};
|
|
150
160
|
}
|
|
@@ -3,12 +3,24 @@
|
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
justify-content: space-between;
|
|
5
5
|
box-sizing: border-box;
|
|
6
|
-
max-width: 750px;
|
|
7
6
|
box-shadow: 0 1px 5px var(--g-color-sfx-shadow);
|
|
8
7
|
border-radius: 5px;
|
|
9
8
|
color: var(--g-color-text-primary);
|
|
10
9
|
background-color: var(--g-color-base-float);
|
|
11
10
|
}
|
|
11
|
+
.df-accordeon-card .df-row {
|
|
12
|
+
width: 100%;
|
|
13
|
+
max-width: unset;
|
|
14
|
+
}
|
|
15
|
+
.df-accordeon-card .df-row .df-select,
|
|
16
|
+
.df-accordeon-card .df-row .df-multi-select,
|
|
17
|
+
.df-accordeon-card .df-row .df-transparent_array-item {
|
|
18
|
+
max-width: unset;
|
|
19
|
+
}
|
|
20
|
+
.df-accordeon-card .df-monaco-input,
|
|
21
|
+
.df-accordeon-card .df-monaco-base-view {
|
|
22
|
+
width: 100%;
|
|
23
|
+
}
|
|
12
24
|
.df-accordeon-card:hover {
|
|
13
25
|
box-shadow: 0 3px 10px var(--g-color-sfx-shadow);
|
|
14
26
|
}
|
|
@@ -47,15 +59,6 @@
|
|
|
47
59
|
justify-content: center;
|
|
48
60
|
order: -1;
|
|
49
61
|
}
|
|
50
|
-
.df-accordeon-card__header-content-title {
|
|
51
|
-
font-weight: 700;
|
|
52
|
-
}
|
|
53
|
-
.df-accordeon-card__header-content-title_size_s {
|
|
54
|
-
font-size: 13px;
|
|
55
|
-
}
|
|
56
|
-
.df-accordeon-card__header-content-title_size_m {
|
|
57
|
-
font-size: 16px;
|
|
58
|
-
}
|
|
59
62
|
.df-accordeon-card__header-content-description {
|
|
60
63
|
margin-top: 12px;
|
|
61
64
|
color: var(--g-color-text-complementary);
|
|
@@ -73,7 +76,6 @@
|
|
|
73
76
|
}
|
|
74
77
|
.df-accordeon-card__body {
|
|
75
78
|
display: none;
|
|
76
|
-
margin-top: -10px 0 8px;
|
|
77
79
|
padding: 16px;
|
|
78
80
|
}
|
|
79
81
|
.df-accordeon-card__body_open {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ChevronDown } from '@gravity-ui/icons';
|
|
3
|
-
import { Button, Icon } from '@gravity-ui/uikit';
|
|
3
|
+
import { Button, Icon, Text } from '@gravity-ui/uikit';
|
|
4
4
|
import _ from 'lodash';
|
|
5
5
|
import { block } from '../../utils';
|
|
6
6
|
import './AccordeonCard.css';
|
|
7
7
|
const b = block('accordeon-card');
|
|
8
|
-
export const AccordeonCard = ({ className, name, header, description, open: propsOpen, onToggle, headerActionsTemplate, ignoreHeaderToggle, titleSize = 'm', alwaysOpen, children, }) => {
|
|
8
|
+
export const AccordeonCard = ({ className, name, header, description, open: propsOpen, onToggle, headerActionsTemplate, ignoreHeaderToggle, titleSize = 'm', alwaysOpen, children, classNameBody, }) => {
|
|
9
9
|
const accordeonRef = React.useRef(null);
|
|
10
10
|
const bodyRef = React.useRef(null);
|
|
11
11
|
const [open, setOpen] = React.useState(alwaysOpen || propsOpen || false);
|
|
@@ -28,19 +28,26 @@ export const AccordeonCard = ({ className, name, header, description, open: prop
|
|
|
28
28
|
accordeonRef.current.classList.add('df-accordeon-card_empty');
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
+
const currentHeaderVariant = React.useMemo(() => {
|
|
32
|
+
if (!_.isString(header)) {
|
|
33
|
+
return 'body-1';
|
|
34
|
+
}
|
|
35
|
+
if (titleSize === 'm') {
|
|
36
|
+
return 'subheader-2';
|
|
37
|
+
}
|
|
38
|
+
return 'subheader-1';
|
|
39
|
+
}, [titleSize]);
|
|
31
40
|
return (React.createElement("div", { ref: accordeonRef, className: b({ empty: Boolean(emptyBody) }, className) },
|
|
32
41
|
React.createElement("div", { className: b('header', {
|
|
33
42
|
open: open && !emptyBody,
|
|
34
43
|
'without-action': ignoreHeaderToggle || alwaysOpen,
|
|
35
44
|
}), onClick: !ignoreHeaderToggle && !alwaysOpen ? handleToggle : undefined },
|
|
36
45
|
React.createElement("div", { className: b('header-content') },
|
|
37
|
-
React.createElement(
|
|
38
|
-
? b('header-content-title', { size: titleSize })
|
|
39
|
-
: undefined }, header),
|
|
46
|
+
React.createElement(Text, { variant: currentHeaderVariant }, header),
|
|
40
47
|
description ? (React.createElement("span", { className: b('header-content-description'), dangerouslySetInnerHTML: { __html: description } })) : null),
|
|
41
48
|
!emptyBody && !alwaysOpen ? (React.createElement("div", { className: b('header-toggle-btn'), onClick: preventEvent },
|
|
42
49
|
headerActionsTemplate ? (React.createElement("div", { className: b('interal-actions') }, headerActionsTemplate)) : null,
|
|
43
50
|
React.createElement(Button, { view: "flat", onClick: handleToggle, qa: `${name}-accordeon-toggler` },
|
|
44
51
|
React.createElement(Icon, { className: b('toggle-icon', { open }), data: ChevronDown, size: 16 })))) : null),
|
|
45
|
-
React.createElement("div", { ref: bodyRef, className: b('body', { open: open && !emptyBody }) }, children)));
|
|
52
|
+
React.createElement("div", { ref: bodyRef, className: b('body', { open: open && !emptyBody }, classNameBody) }, children)));
|
|
46
53
|
};
|
|
@@ -48,12 +48,6 @@
|
|
|
48
48
|
margin-left: 10px;
|
|
49
49
|
}
|
|
50
50
|
.df-card__title {
|
|
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
|
-
white-space: nowrap;
|
|
55
|
-
overflow: hidden;
|
|
56
|
-
text-overflow: ellipsis;
|
|
57
51
|
max-width: 533px;
|
|
58
52
|
}
|
|
59
53
|
.df-card__note {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { HelpPopover } from '@gravity-ui/components';
|
|
3
3
|
import { ChevronDown } from '@gravity-ui/icons';
|
|
4
|
-
import { Button, Card as CardBase, Icon, Popover } from '@gravity-ui/uikit';
|
|
4
|
+
import { Button, Card as CardBase, Icon, Popover, Text } from '@gravity-ui/uikit';
|
|
5
5
|
import _ from 'lodash';
|
|
6
6
|
import { COMMON_POPOVER_PLACEMENT, COMMON_TITLE_MAX_WIDTH } from '../../constants/common';
|
|
7
7
|
import { block } from '../../utils';
|
|
@@ -35,7 +35,7 @@ export const Card = ({ name, title: propsTitle, description, actions, open: prop
|
|
|
35
35
|
if (_.isString(propsTitle)) {
|
|
36
36
|
return (React.createElement(React.Fragment, null,
|
|
37
37
|
React.createElement(Popover, { content: propsTitle, disabled: titlePopoverDisabled, placement: COMMON_POPOVER_PLACEMENT },
|
|
38
|
-
React.createElement(
|
|
38
|
+
React.createElement(Text, { className: b('title'), ellipsis: true, ref: titleRef, variant: "subheader-2" }, propsTitle)),
|
|
39
39
|
description ? (React.createElement("div", { className: b('note') },
|
|
40
40
|
React.createElement(HelpPopover, { htmlContent: description, placement: COMMON_POPOVER_PLACEMENT }))) : null));
|
|
41
41
|
}
|
|
@@ -4,7 +4,7 @@ import { Card } from '../../';
|
|
|
4
4
|
import { Controller, isArrayItem, } from '../../../../core';
|
|
5
5
|
import { useErrorChecker, useOneOf } from '../../../hooks';
|
|
6
6
|
import { Row } from '../../Layouts';
|
|
7
|
-
import { RemoveButton } from '../../
|
|
7
|
+
import { RemoveButton } from '../../RemoveButton';
|
|
8
8
|
export const CardOneOf = (props) => {
|
|
9
9
|
var _a;
|
|
10
10
|
const { input, meta, spec, name } = props;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Xmark } from '@gravity-ui/icons';
|
|
3
|
-
import { Button, Icon, Label } from '@gravity-ui/uikit';
|
|
3
|
+
import { Button, Icon, Label, Text } from '@gravity-ui/uikit';
|
|
4
4
|
import i18n from '../../../../kit/i18n';
|
|
5
5
|
import { block } from '../../../utils';
|
|
6
6
|
import { readFile } from './utils';
|
|
@@ -40,7 +40,7 @@ export const FileInput = ({ name, input, spec }) => {
|
|
|
40
40
|
return (React.createElement("div", { className: b() },
|
|
41
41
|
React.createElement(Button, { disabled: spec.viewSpec.disabled, onClick: handleClick, qa: `${name}-file-upload` }, i18n('button-upload_file')),
|
|
42
42
|
React.createElement("input", { type: "file", ref: inputRef, autoComplete: "off", disabled: spec.viewSpec.disabled, onChange: handleInputChange, className: b('input'), tabIndex: -1, accept: (_b = spec.viewSpec.fileInput) === null || _b === void 0 ? void 0 : _b.accept }),
|
|
43
|
-
React.createElement(
|
|
43
|
+
React.createElement(Text, { className: b('file-name'), ellipsis: true, color: "secondary" }, fileNameContent),
|
|
44
44
|
value ? (React.createElement(Button, { view: "flat", onClick: handleReset, disabled: spec.viewSpec.disabled, qa: `${name}-file-remove` },
|
|
45
45
|
React.createElement(Icon, { data: Xmark, size: 16 }))) : null));
|
|
46
46
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { File } from '@gravity-ui/icons';
|
|
3
|
-
import { Icon } from '@gravity-ui/uikit';
|
|
3
|
+
import { Icon, Text } from '@gravity-ui/uikit';
|
|
4
4
|
import { block } from '../../../utils';
|
|
5
5
|
import './MonacoHeader.css';
|
|
6
6
|
const b = block('monaco-header');
|
|
7
7
|
export const MonacoHeader = ({ language, editButton }) => (React.createElement("div", { className: b() },
|
|
8
8
|
React.createElement("div", null,
|
|
9
9
|
React.createElement(Icon, { data: File, size: 18 }),
|
|
10
|
-
React.createElement(
|
|
10
|
+
React.createElement(Text, { variant: "body-3" }, language)), editButton !== null && editButton !== void 0 ? editButton : null));
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { SelectProps as SelectBaseProps } from '@gravity-ui/uikit';
|
|
1
2
|
import { ArrayInput } from '../../../../core';
|
|
2
3
|
import './MultiSelect.css';
|
|
3
|
-
export
|
|
4
|
+
export interface MultiSelectProps extends Omit<SelectBaseProps, 'onUpdate' | 'value' | 'onOpenChange' | 'disabled' | 'placeholder' | 'filterPlaceholder' | 'multiple' | 'qa'> {
|
|
5
|
+
withCustomOptions?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const MultiSelect: ArrayInput<MultiSelectProps>;
|