@gravity-ui/dynamic-forms 5.1.0 → 5.2.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/DynamicField.js +7 -2
- package/build/cjs/lib/core/components/Form/hooks/useIntegrationFF.js +3 -2
- package/build/cjs/lib/core/components/Form/types/value.js +0 -1
- package/build/cjs/lib/kit/components/Inputs/CheckboxGroup/CheckboxGroup.js +1 -1
- package/build/cjs/lib/kit/components/Inputs/TableArrayInput/TableArrayInput.js +1 -1
- package/build/cjs/lib/kit/components/Inputs/TextContent/TextContent.js +1 -1
- package/build/cjs/lib/kit/components/Inputs/TimeRangeSelector/components/TimeRangeSelect/TimeRangeSelect.js +1 -1
- package/build/cjs/lib/kit/components/Layouts/Column/Column.js +1 -1
- package/build/cjs/lib/kit/components/Layouts/Row/Row.js +1 -1
- package/build/cjs/lib/kit/components/Layouts/Section/Section.js +1 -1
- package/build/cjs/lib/kit/components/LongValue/LongValue.js +2 -4
- package/build/cjs/lib/kit/components/TogglerCard/TogglerCard.js +1 -1
- package/build/cjs/lib/kit/components/ViewLayouts/ViewColumn/ViewColumn.js +1 -1
- package/build/cjs/lib/kit/components/ViewLayouts/ViewRow/ViewRow.js +1 -1
- package/build/cjs/lib/kit/components/Views/DateView/DateView.js +1 -1
- package/build/cjs/lib/kit/components/Views/MultiOneOfView/MultiOneOfView.js +1 -1
- package/build/cjs/lib/kit/components/Views/MultiSelectView/MultiSelectView.js +1 -1
- package/build/cjs/lib/kit/components/Views/ObjectBaseView/ObjectBaseView.js +1 -1
- package/build/cjs/lib/kit/components/Views/TableArrayView/TableArrayView.js +1 -1
- package/build/cjs/lib/kit/utils/common.js +1 -1
- package/build/esm/lib/core/components/Form/Controller/Controller.d.ts +2 -2
- package/build/esm/lib/core/components/Form/Controller/types.d.ts +2 -2
- package/build/esm/lib/core/components/Form/Controller/utils.d.ts +3 -3
- package/build/esm/lib/core/components/Form/DynamicField.d.ts +3 -2
- package/build/esm/lib/core/components/Form/DynamicField.js +7 -2
- package/build/esm/lib/core/components/Form/hooks/useControllerMirror.d.ts +1 -1
- package/build/esm/lib/core/components/Form/hooks/useCreateContext.d.ts +1 -1
- package/build/esm/lib/core/components/Form/hooks/useCreateSearchContext.d.ts +1 -1
- package/build/esm/lib/core/components/Form/hooks/useDynamicFieldMirror.d.ts +1 -1
- package/build/esm/lib/core/components/Form/hooks/useIntegrationFF.d.ts +9 -2
- package/build/esm/lib/core/components/Form/hooks/useIntegrationFF.js +3 -2
- package/build/esm/lib/core/components/Form/hooks/useMutators.d.ts +1 -1
- package/build/esm/lib/core/components/Form/hooks/useSearch/useSearch.d.ts +2 -2
- package/build/esm/lib/core/components/Form/hooks/useStore.d.ts +1 -1
- package/build/esm/lib/core/components/Form/types/array.d.ts +2 -2
- package/build/esm/lib/core/components/Form/types/boolean.d.ts +2 -2
- package/build/esm/lib/core/components/Form/types/config.d.ts +2 -2
- package/build/esm/lib/core/components/Form/types/context.d.ts +3 -3
- package/build/esm/lib/core/components/Form/types/field.d.ts +2 -2
- package/build/esm/lib/core/components/Form/types/input.d.ts +3 -3
- package/build/esm/lib/core/components/Form/types/layout.d.ts +3 -3
- package/build/esm/lib/core/components/Form/types/mirror.d.ts +2 -2
- package/build/esm/lib/core/components/Form/types/mutators.d.ts +2 -2
- package/build/esm/lib/core/components/Form/types/number.d.ts +2 -2
- package/build/esm/lib/core/components/Form/types/object.d.ts +2 -2
- package/build/esm/lib/core/components/Form/types/search.d.ts +2 -2
- package/build/esm/lib/core/components/Form/types/store.d.ts +1 -1
- package/build/esm/lib/core/components/Form/types/string.d.ts +2 -2
- package/build/esm/lib/core/components/Form/types/validators.d.ts +1 -1
- package/build/esm/lib/core/components/Form/types/value.d.ts +1 -1
- package/build/esm/lib/core/components/Form/types/value.js +1 -1
- package/build/esm/lib/core/components/Form/utils/common.d.ts +1 -1
- package/build/esm/lib/core/components/Form/utils/search.d.ts +1 -1
- package/build/esm/lib/core/components/View/DynamicView.d.ts +2 -2
- package/build/esm/lib/core/components/View/ViewController.d.ts +1 -1
- package/build/esm/lib/core/components/View/hooks/useComponents.d.ts +2 -2
- package/build/esm/lib/core/components/View/hooks/useCreateContext.d.ts +1 -1
- package/build/esm/lib/core/components/View/hooks/useRender.d.ts +2 -2
- package/build/esm/lib/core/components/View/types/array.d.ts +2 -2
- package/build/esm/lib/core/components/View/types/boolean.d.ts +2 -2
- package/build/esm/lib/core/components/View/types/config.d.ts +2 -2
- package/build/esm/lib/core/components/View/types/context.d.ts +3 -3
- package/build/esm/lib/core/components/View/types/layout.d.ts +3 -3
- package/build/esm/lib/core/components/View/types/number.d.ts +2 -2
- package/build/esm/lib/core/components/View/types/object.d.ts +2 -2
- package/build/esm/lib/core/components/View/types/string.d.ts +2 -2
- package/build/esm/lib/core/components/View/types/views.d.ts +3 -3
- package/build/esm/lib/core/helpers.d.ts +1 -1
- package/build/esm/lib/core/types/specs.d.ts +3 -3
- package/build/esm/lib/kit/components/CopyButton/CopyButton.d.ts +1 -1
- package/build/esm/lib/kit/components/ErrorWrapper/ErrorWrapper.d.ts +1 -1
- package/build/esm/lib/kit/components/GenerateRandomValueButton/GenerateRandomValueButton.d.ts +1 -1
- package/build/esm/lib/kit/components/Inputs/ArrayBase/ArrayBase.d.ts +1 -1
- package/build/esm/lib/kit/components/Inputs/CardOneOf/CardOneOf.d.ts +1 -1
- package/build/esm/lib/kit/components/Inputs/CardOneOf/CardOneOf.js +1 -1
- package/build/esm/lib/kit/components/Inputs/Checkbox/Checkbox.d.ts +2 -2
- package/build/esm/lib/kit/components/Inputs/CheckboxGroup/CheckboxGroup.d.ts +1 -1
- package/build/esm/lib/kit/components/Inputs/CheckboxGroup/CheckboxGroup.js +1 -1
- package/build/esm/lib/kit/components/Inputs/DateInput/DateInput.d.ts +2 -2
- package/build/esm/lib/kit/components/Inputs/FileInput/FileInput.d.ts +1 -1
- package/build/esm/lib/kit/components/Inputs/FileInput/utils.d.ts +1 -1
- package/build/esm/lib/kit/components/Inputs/MonacoInput/MonacoInputBase.d.ts +1 -1
- package/build/esm/lib/kit/components/Inputs/MultiOneOf/MultiOneOf.d.ts +1 -1
- package/build/esm/lib/kit/components/Inputs/MultiOneOf/MultiOneOf.js +1 -1
- package/build/esm/lib/kit/components/Inputs/MultiSelect/MultiSelect.d.ts +2 -2
- package/build/esm/lib/kit/components/Inputs/NumberWithScale/NumberWithScale.d.ts +1 -1
- package/build/esm/lib/kit/components/Inputs/NumberWithScale/useInitial.d.ts +1 -1
- package/build/esm/lib/kit/components/Inputs/ObjectBase/ObjectBase.d.ts +1 -1
- package/build/esm/lib/kit/components/Inputs/ObjectBase/ObjectBase.js +1 -1
- package/build/esm/lib/kit/components/Inputs/ObjectValueInput/ObjectValueInput.d.ts +1 -1
- package/build/esm/lib/kit/components/Inputs/OneOf/OneOf.d.ts +1 -1
- package/build/esm/lib/kit/components/Inputs/OneOf/OneOf.js +1 -1
- package/build/esm/lib/kit/components/Inputs/Secret/Secret.d.ts +1 -1
- package/build/esm/lib/kit/components/Inputs/Select/Select.d.ts +2 -2
- package/build/esm/lib/kit/components/Inputs/Switch/Switch.d.ts +1 -1
- package/build/esm/lib/kit/components/Inputs/TableArrayInput/TableArrayInput.d.ts +1 -1
- package/build/esm/lib/kit/components/Inputs/TableArrayInput/TableArrayInput.js +1 -1
- package/build/esm/lib/kit/components/Inputs/Text/Text.d.ts +2 -2
- package/build/esm/lib/kit/components/Inputs/TextArea/TextArea.d.ts +2 -2
- package/build/esm/lib/kit/components/Inputs/TextContent/TextContent.d.ts +1 -1
- package/build/esm/lib/kit/components/Inputs/TextContent/TextContent.js +1 -1
- package/build/esm/lib/kit/components/Inputs/TextLink/TextLink.d.ts +1 -1
- package/build/esm/lib/kit/components/Inputs/TextLink/TextLink.js +1 -1
- package/build/esm/lib/kit/components/Inputs/TimeRangeSelector/TimeRangeSelector.d.ts +1 -1
- package/build/esm/lib/kit/components/Inputs/TimeRangeSelector/TimeRangeSelector.js +1 -1
- package/build/esm/lib/kit/components/Inputs/TimeRangeSelector/components/TimeRangeSelect/TimeRangeSelect.d.ts +1 -1
- package/build/esm/lib/kit/components/Inputs/TimeRangeSelector/components/TimeRangeSelect/TimeRangeSelect.js +1 -1
- package/build/esm/lib/kit/components/Layouts/Accordeon/Accordeon.d.ts +2 -2
- package/build/esm/lib/kit/components/Layouts/AccordeonCard/AccordeonCardForm.d.ts +1 -1
- package/build/esm/lib/kit/components/Layouts/CardAccordeon.d.ts +1 -1
- package/build/esm/lib/kit/components/Layouts/CardSection.d.ts +1 -1
- package/build/esm/lib/kit/components/Layouts/Column/Column.d.ts +1 -1
- package/build/esm/lib/kit/components/Layouts/Column/Column.js +2 -2
- package/build/esm/lib/kit/components/Layouts/Row/Row.d.ts +1 -1
- package/build/esm/lib/kit/components/Layouts/Row/Row.js +2 -2
- package/build/esm/lib/kit/components/Layouts/Section/Section.d.ts +1 -1
- package/build/esm/lib/kit/components/Layouts/Section/Section.js +2 -2
- package/build/esm/lib/kit/components/Layouts/TableCell/TableCell.d.ts +1 -1
- package/build/esm/lib/kit/components/Layouts/Transparent/Transparent.d.ts +1 -1
- package/build/esm/lib/kit/components/Layouts/Transparent/Transparent.js +1 -1
- package/build/esm/lib/kit/components/LongValue/LongValue.js +2 -4
- package/build/esm/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.d.ts +1 -1
- package/build/esm/lib/kit/components/TogglerCard/TogglerCard.js +1 -1
- package/build/esm/lib/kit/components/ViewLayouts/ViewAccordeon/ViewAccordeon.d.ts +2 -2
- package/build/esm/lib/kit/components/ViewLayouts/ViewAccordeonCard/ViewAccordeonCard.d.ts +1 -1
- package/build/esm/lib/kit/components/ViewLayouts/ViewCardAccordeon.d.ts +1 -1
- package/build/esm/lib/kit/components/ViewLayouts/ViewCardSection.d.ts +1 -1
- package/build/esm/lib/kit/components/ViewLayouts/ViewColumn/ViewColumn.d.ts +1 -1
- package/build/esm/lib/kit/components/ViewLayouts/ViewColumn/ViewColumn.js +1 -1
- package/build/esm/lib/kit/components/ViewLayouts/ViewRow/ViewRow.d.ts +1 -1
- package/build/esm/lib/kit/components/ViewLayouts/ViewRow/ViewRow.js +1 -1
- package/build/esm/lib/kit/components/ViewLayouts/ViewSection/ViewSection.d.ts +1 -1
- package/build/esm/lib/kit/components/ViewLayouts/ViewTableCell/ViewTableCell.d.ts +1 -1
- package/build/esm/lib/kit/components/ViewLayouts/ViewTransparent/ViewTransparent.d.ts +1 -1
- package/build/esm/lib/kit/components/Views/ArrayBaseView/ArrayBaseView.d.ts +1 -1
- package/build/esm/lib/kit/components/Views/BaseView/BaseView.d.ts +1 -1
- package/build/esm/lib/kit/components/Views/CardOneOfView.d.ts +1 -1
- package/build/esm/lib/kit/components/Views/CheckboxGroupView/CheckboxGroupView.d.ts +1 -1
- package/build/esm/lib/kit/components/Views/DateView/DateView.d.ts +1 -1
- package/build/esm/lib/kit/components/Views/DateView/DateView.js +1 -1
- package/build/esm/lib/kit/components/Views/FileInputView/FileInputView.d.ts +1 -1
- package/build/esm/lib/kit/components/Views/MonacoInputView/MonacoBaseView.d.ts +1 -1
- package/build/esm/lib/kit/components/Views/MultiOneOfView/MultiOneOfView.d.ts +1 -1
- package/build/esm/lib/kit/components/Views/MultiOneOfView/MultiOneOfView.js +1 -1
- package/build/esm/lib/kit/components/Views/MultiSelectView/MultiSelectView.d.ts +1 -1
- package/build/esm/lib/kit/components/Views/MultiSelectView/MultiSelectView.js +1 -1
- package/build/esm/lib/kit/components/Views/NumberWithScaleView/NumberWithScaleView.d.ts +1 -1
- package/build/esm/lib/kit/components/Views/ObjectBaseView/ObjectBaseView.d.ts +1 -1
- package/build/esm/lib/kit/components/Views/ObjectBaseView/ObjectBaseView.js +1 -1
- package/build/esm/lib/kit/components/Views/ObjectValueInputView/ObjectValueInputView.d.ts +1 -1
- package/build/esm/lib/kit/components/Views/OneOfView/OneOfView.d.ts +1 -1
- package/build/esm/lib/kit/components/Views/TableArrayView/TableArrayView.d.ts +1 -1
- package/build/esm/lib/kit/components/Views/TableArrayView/TableArrayView.js +1 -1
- package/build/esm/lib/kit/components/Views/TextAreaView/TextAreaView.d.ts +1 -1
- package/build/esm/lib/kit/components/Views/TextContentView.d.ts +1 -1
- package/build/esm/lib/kit/components/Views/TextLinkView/TextLinkView.d.ts +1 -1
- package/build/esm/lib/kit/components/Views/TimeRangeSelectorView/TimeRangeSelectorView.d.ts +1 -1
- package/build/esm/lib/kit/constants/config.d.ts +1 -1
- package/build/esm/lib/kit/hooks/useErrorChecker.d.ts +1 -1
- package/build/esm/lib/kit/hooks/useOneOf/useOneOf.d.ts +1 -1
- package/build/esm/lib/kit/utils/common.d.ts +1 -1
- package/build/esm/lib/kit/utils/common.js +2 -2
- package/build/esm/lib/kit/utils/objectInline.d.ts +1 -1
- package/build/esm/lib/kit/validators/validators.d.ts +2 -2
- package/package.json +10 -9
|
@@ -11,11 +11,16 @@ const helpers_1 = require("../../helpers");
|
|
|
11
11
|
const Controller_1 = require("./Controller");
|
|
12
12
|
const hooks_1 = require("./hooks");
|
|
13
13
|
const utils_1 = require("./utils");
|
|
14
|
-
const DynamicField = ({ name, spec, config, Monaco, generateRandomValue, search, withoutInsertFFDebounce, destroyOnUnregister = true, mutators: externalMutators, shared: externalShared, __mirror, }) => {
|
|
14
|
+
const DynamicField = ({ name, spec, config, Monaco, generateRandomValue, search, withoutInsertFFDebounce, destroyOnUnregister = true, mutators: externalMutators, shared: externalShared, storeSubscriber, __mirror, }) => {
|
|
15
15
|
const DynamicFormsCtx = (0, hooks_1.useCreateContext)();
|
|
16
16
|
const SearchContext = (0, hooks_1.useCreateSearchContext)();
|
|
17
17
|
const { tools, store } = (0, hooks_1.useStore)(name);
|
|
18
|
-
const watcher = (0, hooks_1.useIntegrationFF)(
|
|
18
|
+
const watcher = (0, hooks_1.useIntegrationFF)({
|
|
19
|
+
store,
|
|
20
|
+
withoutDebounce: withoutInsertFFDebounce,
|
|
21
|
+
destroyOnUnregister,
|
|
22
|
+
storeSubscriber,
|
|
23
|
+
});
|
|
19
24
|
const { mutatorsStore, mutateDFState } = (0, hooks_1.useMutators)(externalMutators);
|
|
20
25
|
const { store: searchStore, setField, removeField, isHiddenField } = (0, hooks_1.useSearchStore)();
|
|
21
26
|
const shared = (0, hooks_1.useFormSharedStore)(externalShared);
|
|
@@ -10,7 +10,7 @@ const isFunction_1 = tslib_1.__importDefault(require("lodash/isFunction"));
|
|
|
10
10
|
const values_1 = tslib_1.__importDefault(require("lodash/values"));
|
|
11
11
|
const react_final_form_1 = require("react-final-form");
|
|
12
12
|
const utils_1 = require("../utils");
|
|
13
|
-
const useIntegrationFF = (store, withoutDebounce, destroyOnUnregister) => {
|
|
13
|
+
const useIntegrationFF = ({ store, withoutDebounce, destroyOnUnregister, storeSubscriber, }) => {
|
|
14
14
|
const form = (0, react_final_form_1.useForm)();
|
|
15
15
|
const watcher = react_1.default.useMemo(() => {
|
|
16
16
|
const props = {
|
|
@@ -43,13 +43,14 @@ const useIntegrationFF = (store, withoutDebounce, destroyOnUnregister) => {
|
|
|
43
43
|
const cb = (value) => {
|
|
44
44
|
if (store.name) {
|
|
45
45
|
form.change(store.name, (0, get_1.default)((0, utils_1.transformArrOut)(value), store.name));
|
|
46
|
+
storeSubscriber === null || storeSubscriber === void 0 ? void 0 : storeSubscriber((0, get_1.default)(value, store.name));
|
|
46
47
|
}
|
|
47
48
|
};
|
|
48
49
|
if (withoutDebounce) {
|
|
49
50
|
return cb;
|
|
50
51
|
}
|
|
51
52
|
return (0, debounce_1.default)(cb, 100);
|
|
52
|
-
}, [form.change, store.name, withoutDebounce]);
|
|
53
|
+
}, [form.change, store.name, withoutDebounce, storeSubscriber]);
|
|
53
54
|
react_1.default.useEffect(() => {
|
|
54
55
|
change(store.values);
|
|
55
56
|
}, [store.values]);
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CheckboxGroup = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const core_1 = require("../../../../core");
|
|
7
6
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
7
|
+
const core_1 = require("../../../../core");
|
|
8
8
|
const utils_1 = require("../../../utils");
|
|
9
9
|
const b = (0, utils_1.block)('checkbox-group');
|
|
10
10
|
const CheckboxGroup = ({ name, input, spec, inputProps }) => {
|
|
@@ -9,8 +9,8 @@ const noop_1 = tslib_1.__importDefault(require("lodash/noop"));
|
|
|
9
9
|
const set_1 = tslib_1.__importDefault(require("lodash/set"));
|
|
10
10
|
const core_1 = require("../../../../core");
|
|
11
11
|
const hooks_1 = require("../../../../core/components/Form/hooks");
|
|
12
|
-
const utils_1 = require("../../../utils");
|
|
13
12
|
const common_1 = require("../../../constants/common");
|
|
13
|
+
const utils_1 = require("../../../utils");
|
|
14
14
|
const b = (0, utils_1.block)('table-array');
|
|
15
15
|
const TableArrayInput = ({ spec, name, arrayInput, input }) => {
|
|
16
16
|
const { isHiddenField } = (0, hooks_1.useSearchContext)();
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TextContent = exports.TextContentComponent = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const lodash_1 = require("lodash");
|
|
7
6
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
7
|
+
const lodash_1 = require("lodash");
|
|
8
8
|
const cloneDeep_1 = tslib_1.__importDefault(require("lodash/cloneDeep"));
|
|
9
9
|
const utils_1 = require("../../../utils");
|
|
10
10
|
const LazyLoader_1 = require("../../LazyLoader");
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TimeRangeSelect = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const isString_1 = tslib_1.__importDefault(require("lodash/isString"));
|
|
7
6
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
7
|
+
const isString_1 = tslib_1.__importDefault(require("lodash/isString"));
|
|
8
8
|
const utils_1 = require("../../../../../utils");
|
|
9
9
|
const Row_1 = require("../../../../Layouts/Row");
|
|
10
10
|
const b = (0, utils_1.block)('time-range-select');
|
|
@@ -7,8 +7,8 @@ const icons_1 = require("@gravity-ui/icons");
|
|
|
7
7
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
8
8
|
const core_1 = require("../../../../core");
|
|
9
9
|
const components_1 = require("../../../components");
|
|
10
|
-
const utils_1 = require("../../../utils");
|
|
11
10
|
const common_1 = require("../../../constants/common");
|
|
11
|
+
const utils_1 = require("../../../utils");
|
|
12
12
|
const b = (0, utils_1.block)('column');
|
|
13
13
|
const ColumnBase = ({ name, spec, input, meta, children, }) => {
|
|
14
14
|
const arrayItem = react_1.default.useMemo(() => (0, core_1.isArrayItem)(name), [name]);
|
|
@@ -7,8 +7,8 @@ const icons_1 = require("@gravity-ui/icons");
|
|
|
7
7
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
8
8
|
const core_1 = require("../../../../core");
|
|
9
9
|
const components_1 = require("../../../components");
|
|
10
|
-
const utils_1 = require("../../../utils");
|
|
11
10
|
const common_1 = require("../../../constants/common");
|
|
11
|
+
const utils_1 = require("../../../utils");
|
|
12
12
|
const b = (0, utils_1.block)('row');
|
|
13
13
|
const RowBase = ({ name, spec, input, meta, verboseDescription, children, }) => {
|
|
14
14
|
const arrayItem = react_1.default.useMemo(() => (0, core_1.isArrayItem)(name), [name]);
|
|
@@ -5,10 +5,10 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
7
7
|
const __1 = require("../../");
|
|
8
|
-
const RemoveButton_1 = require("../../RemoveButton");
|
|
9
8
|
const __2 = require("../../../");
|
|
10
9
|
const core_1 = require("../../../../core");
|
|
11
10
|
const utils_1 = require("../../../utils");
|
|
11
|
+
const RemoveButton_1 = require("../../RemoveButton");
|
|
12
12
|
const b = (0, utils_1.block)('section');
|
|
13
13
|
const SectionBase = (_a) => {
|
|
14
14
|
var _b;
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.LongValue = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const once_1 = tslib_1.__importDefault(require("lodash/once"));
|
|
7
6
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
7
|
+
const once_1 = tslib_1.__importDefault(require("lodash/once"));
|
|
8
8
|
const utils_1 = require("../../utils");
|
|
9
9
|
const b = (0, utils_1.block)('long-value');
|
|
10
10
|
const LongValue = (_a) => {
|
|
@@ -56,8 +56,6 @@ const LongValue = (_a) => {
|
|
|
56
56
|
}
|
|
57
57
|
return;
|
|
58
58
|
}, [value]);
|
|
59
|
-
return (react_1.default.createElement(uikit_1.Text, Object.assign({ as: "div" }, restProps, { ref: ref, className: b({ open, long }, className),
|
|
60
|
-
// @ts-ignore
|
|
61
|
-
onClick: long ? handleClick : undefined }), value));
|
|
59
|
+
return (react_1.default.createElement(uikit_1.Text, Object.assign({ as: "div" }, restProps, { ref: ref, className: b({ open, long }, className), onClick: long ? handleClick : undefined }), value));
|
|
62
60
|
};
|
|
63
61
|
exports.LongValue = LongValue;
|
|
@@ -4,8 +4,8 @@ exports.TogglerCard = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
7
|
-
const utils_1 = require("../../utils");
|
|
8
7
|
const common_1 = require("../../constants/common");
|
|
8
|
+
const utils_1 = require("../../utils");
|
|
9
9
|
const b = (0, utils_1.block)('toggler-card');
|
|
10
10
|
const TogglerCard = ({ description, title, text, onClick, disabled, selected, }) => {
|
|
11
11
|
return (react_1.default.createElement(uikit_1.Card, { onClick: onClick, type: "selection", disabled: disabled ? !selected : disabled, selected: selected, size: "m", className: b() },
|
|
@@ -6,8 +6,8 @@ const react_1 = tslib_1.__importDefault(require("react"));
|
|
|
6
6
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
7
7
|
const core_1 = require("../../../../core");
|
|
8
8
|
const kit_1 = require("../../../../kit");
|
|
9
|
-
const utils_1 = require("../../../utils");
|
|
10
9
|
const common_1 = require("../../../constants/common");
|
|
10
|
+
const utils_1 = require("../../../utils");
|
|
11
11
|
const b = (0, utils_1.block)('view-column');
|
|
12
12
|
const ViewColumn = ({ value, spec, children, }) => {
|
|
13
13
|
const { showLayoutDescription } = (0, core_1.useDynamicFormsCtx)();
|
|
@@ -6,8 +6,8 @@ const react_1 = tslib_1.__importDefault(require("react"));
|
|
|
6
6
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
7
7
|
const core_1 = require("../../../../core");
|
|
8
8
|
const kit_1 = require("../../../../kit");
|
|
9
|
-
const utils_1 = require("../../../utils");
|
|
10
9
|
const common_1 = require("../../../constants/common");
|
|
10
|
+
const utils_1 = require("../../../utils");
|
|
11
11
|
const b = (0, utils_1.block)('view-row');
|
|
12
12
|
const ViewRow = ({ value, spec, children, }) => {
|
|
13
13
|
const { showLayoutDescription } = (0, core_1.useDynamicFormsCtx)();
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DateView = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const components_1 = require("../../../components");
|
|
7
6
|
const date_utils_1 = require("@gravity-ui/date-utils");
|
|
8
7
|
const isObject_1 = tslib_1.__importDefault(require("lodash/isObject"));
|
|
8
|
+
const components_1 = require("../../../components");
|
|
9
9
|
const DateView = (_a) => {
|
|
10
10
|
var { value, spec } = _a, restProps = tslib_1.__rest(_a, ["value", "spec"]);
|
|
11
11
|
const { printFormat = components_1.DEFAULT_DATE_FORMAT, outputFormat, timeZone, } = spec.viewSpec.dateInput || {};
|
|
@@ -6,9 +6,9 @@ const react_1 = tslib_1.__importDefault(require("react"));
|
|
|
6
6
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
7
7
|
const isObjectLike_1 = tslib_1.__importDefault(require("lodash/isObjectLike"));
|
|
8
8
|
const core_1 = require("../../../../core");
|
|
9
|
+
const common_1 = require("../../../constants/common");
|
|
9
10
|
const utils_1 = require("../../../utils");
|
|
10
11
|
const GroupIndent_1 = require("../../GroupIndent");
|
|
11
|
-
const common_1 = require("../../../constants/common");
|
|
12
12
|
const b = (0, utils_1.block)('multi-oneof-view');
|
|
13
13
|
const MultiOneOfView = (props) => {
|
|
14
14
|
const { name, value, Layout, spec, withoutIndent } = props;
|
|
@@ -4,8 +4,8 @@ exports.MultiSelectView = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
7
|
-
const utils_1 = require("../../../utils");
|
|
8
7
|
const common_1 = require("../../../constants/common");
|
|
8
|
+
const utils_1 = require("../../../utils");
|
|
9
9
|
const b = (0, utils_1.block)('multiselect-view');
|
|
10
10
|
const MultiSelectView = ({ spec, value = [] }) => {
|
|
11
11
|
const _value = value;
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ObjectInlineView = exports.ObjectBaseView = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const isObjectLike_1 = tslib_1.__importDefault(require("lodash/isObjectLike"));
|
|
7
6
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
7
|
+
const isObjectLike_1 = tslib_1.__importDefault(require("lodash/isObjectLike"));
|
|
8
8
|
const core_1 = require("../../../../core");
|
|
9
9
|
const utils_1 = require("../../../utils");
|
|
10
10
|
const b = (0, utils_1.block)('object-base-view');
|
|
@@ -5,8 +5,8 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
7
7
|
const core_1 = require("../../../../core");
|
|
8
|
-
const utils_1 = require("../../../utils");
|
|
9
8
|
const common_1 = require("../../../constants/common");
|
|
9
|
+
const utils_1 = require("../../../utils");
|
|
10
10
|
const b = (0, utils_1.block)('table-array-view');
|
|
11
11
|
const TableArrayView = ({ value = [], spec, name }) => {
|
|
12
12
|
const { showLayoutDescription } = (0, core_1.useDynamicFormsCtx)();
|
|
@@ -4,11 +4,11 @@ exports.isCorrectSizeParams = exports.prepareSpec = exports.isNotEmptyValue = vo
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const cloneDeep_1 = tslib_1.__importDefault(require("lodash/cloneDeep"));
|
|
6
6
|
const isArray_1 = tslib_1.__importDefault(require("lodash/isArray"));
|
|
7
|
+
const isEmpty_1 = tslib_1.__importDefault(require("lodash/isEmpty"));
|
|
7
8
|
const isNil_1 = tslib_1.__importDefault(require("lodash/isNil"));
|
|
8
9
|
const isObject_1 = tslib_1.__importDefault(require("lodash/isObject"));
|
|
9
10
|
const isObjectLike_1 = tslib_1.__importDefault(require("lodash/isObjectLike"));
|
|
10
11
|
const isString_1 = tslib_1.__importDefault(require("lodash/isString"));
|
|
11
|
-
const isEmpty_1 = tslib_1.__importDefault(require("lodash/isEmpty"));
|
|
12
12
|
const core_1 = require("../../core");
|
|
13
13
|
const helpers_1 = require("../validators/helpers");
|
|
14
14
|
const bigIntMath_1 = require("./bigIntMath");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FormValue, Spec } from '../../../types';
|
|
2
|
-
import { FieldValue, ValidateError } from '../types';
|
|
1
|
+
import type { FormValue, Spec } from '../../../types';
|
|
2
|
+
import type { FieldValue, ValidateError } from '../types';
|
|
3
3
|
export interface ControllerProps<DirtyValue extends FieldValue, SpecType extends Spec> {
|
|
4
4
|
spec: SpecType;
|
|
5
5
|
name: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { FormValue, Spec } from '../../../types';
|
|
3
|
-
import { DynamicFormConfig, DynamicFormMutatorsStore, DynamicFormsContext, FieldRenderProps, FieldValue, IndependentInputEntity, InputEntity, LayoutType, ValidateError } from '../types';
|
|
2
|
+
import type { FormValue, Spec } from '../../../types';
|
|
3
|
+
import type { DynamicFormConfig, DynamicFormMutatorsStore, DynamicFormsContext, FieldRenderProps, FieldValue, IndependentInputEntity, InputEntity, LayoutType, ValidateError } from '../types';
|
|
4
4
|
export interface GetSpecParams<SpecType extends Spec> {
|
|
5
5
|
name: string;
|
|
6
6
|
spec: SpecType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FormValue, Spec } from '../../../types';
|
|
2
|
-
import { BaseValidateError, FieldRenderProps, FieldValue, ValidateError } from '../types';
|
|
3
|
-
import { ControllerStore, GetComponentsParams, GetComponentsReturn, GetFieldInitialsParams, GetFieldMethodsReturn, GetRenderParams, GetSpecParams, GetValidateParams, InitializeStoreParams, UpdateStoreParams } from './types';
|
|
1
|
+
import type { FormValue, Spec } from '../../../types';
|
|
2
|
+
import type { BaseValidateError, FieldRenderProps, FieldValue, ValidateError } from '../types';
|
|
3
|
+
import type { ControllerStore, GetComponentsParams, GetComponentsReturn, GetFieldInitialsParams, GetFieldMethodsReturn, GetRenderParams, GetSpecParams, GetValidateParams, InitializeStoreParams, UpdateStoreParams } from './types';
|
|
4
4
|
export declare const updateParentStore: <DirtyValue extends FieldValue, Value extends FormValue, SpecType extends Spec<any, undefined, undefined>>(store: ControllerStore<DirtyValue, Value, SpecType>) => void;
|
|
5
5
|
export declare const callUnmout: <DirtyValue extends FieldValue, Value extends FormValue, SpecType extends Spec<any, undefined, undefined>>(store: ControllerStore<DirtyValue, Value, SpecType>) => void;
|
|
6
6
|
export declare const getSpec: <SpecType extends Spec<any, undefined, undefined>>({ name, spec, mutatorsStore, }: GetSpecParams<SpecType>) => SpecType;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MonacoEditorProps } from 'react-monaco-editor/lib/types';
|
|
3
|
-
import { Spec, StringSpec } from '../../types';
|
|
4
|
-
import { DynamicFormConfig, DynamicFormMutators, FieldValue, WonderMirror } from './types';
|
|
3
|
+
import type { Spec, StringSpec } from '../../types';
|
|
4
|
+
import type { DynamicFormConfig, DynamicFormMutators, FieldValue, WonderMirror } from './types';
|
|
5
5
|
export interface DynamicFieldProps {
|
|
6
6
|
name: string;
|
|
7
7
|
spec: Spec;
|
|
@@ -13,6 +13,7 @@ export interface DynamicFieldProps {
|
|
|
13
13
|
destroyOnUnregister?: boolean;
|
|
14
14
|
mutators?: DynamicFormMutators;
|
|
15
15
|
shared?: Record<string, any>;
|
|
16
|
+
storeSubscriber?: (store: FieldValue) => void;
|
|
16
17
|
__mirror?: WonderMirror;
|
|
17
18
|
}
|
|
18
19
|
export declare const DynamicField: React.FC<DynamicFieldProps>;
|
|
@@ -7,11 +7,16 @@ import { isCorrectSpec } from '../../helpers';
|
|
|
7
7
|
import { Controller } from './Controller';
|
|
8
8
|
import { useCreateContext, useCreateSearchContext, useDynamicFieldMirror, useFormSharedStore, useIntegrationFF, useMutators, useSearchStore, useStore, } from './hooks';
|
|
9
9
|
import { getDefaultSearchFunction, isCorrectConfig } from './utils';
|
|
10
|
-
export const DynamicField = ({ name, spec, config, Monaco, generateRandomValue, search, withoutInsertFFDebounce, destroyOnUnregister = true, mutators: externalMutators, shared: externalShared, __mirror, }) => {
|
|
10
|
+
export const DynamicField = ({ name, spec, config, Monaco, generateRandomValue, search, withoutInsertFFDebounce, destroyOnUnregister = true, mutators: externalMutators, shared: externalShared, storeSubscriber, __mirror, }) => {
|
|
11
11
|
const DynamicFormsCtx = useCreateContext();
|
|
12
12
|
const SearchContext = useCreateSearchContext();
|
|
13
13
|
const { tools, store } = useStore(name);
|
|
14
|
-
const watcher = useIntegrationFF(
|
|
14
|
+
const watcher = useIntegrationFF({
|
|
15
|
+
store,
|
|
16
|
+
withoutDebounce: withoutInsertFFDebounce,
|
|
17
|
+
destroyOnUnregister,
|
|
18
|
+
storeSubscriber,
|
|
19
|
+
});
|
|
15
20
|
const { mutatorsStore, mutateDFState } = useMutators(externalMutators);
|
|
16
21
|
const { store: searchStore, setField, removeField, isHiddenField } = useSearchStore();
|
|
17
22
|
const shared = useFormSharedStore(externalShared);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ControllerMirror, WonderMirror } from '../types';
|
|
1
|
+
import type { ControllerMirror, WonderMirror } from '../types';
|
|
2
2
|
export declare const useControllerMirror: (name: string, params: ControllerMirror, __mirror?: WonderMirror) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DynamicFieldMirror, WonderMirror } from '../types';
|
|
1
|
+
import type { DynamicFieldMirror, WonderMirror } from '../types';
|
|
2
2
|
export declare const useDynamicFieldMirror: (params: DynamicFieldMirror, __mirror?: WonderMirror) => void;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
import { DynamicFieldStore } from '../types';
|
|
2
|
-
|
|
1
|
+
import type { DynamicFieldStore, FieldValue } from '../types';
|
|
2
|
+
interface UseIntegrationFFParams {
|
|
3
|
+
store: DynamicFieldStore;
|
|
4
|
+
withoutDebounce?: boolean;
|
|
5
|
+
destroyOnUnregister?: boolean;
|
|
6
|
+
storeSubscriber?: (store: FieldValue) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const useIntegrationFF: ({ store, withoutDebounce, destroyOnUnregister, storeSubscriber, }: UseIntegrationFFParams) => JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -6,7 +6,7 @@ import isFunction from 'lodash/isFunction';
|
|
|
6
6
|
import values from 'lodash/values';
|
|
7
7
|
import { Field as FinalFormField, useForm } from 'react-final-form';
|
|
8
8
|
import { transformArrOut } from '../utils';
|
|
9
|
-
export const useIntegrationFF = (store, withoutDebounce, destroyOnUnregister) => {
|
|
9
|
+
export const useIntegrationFF = ({ store, withoutDebounce, destroyOnUnregister, storeSubscriber, }) => {
|
|
10
10
|
const form = useForm();
|
|
11
11
|
const watcher = React.useMemo(() => {
|
|
12
12
|
const props = {
|
|
@@ -39,13 +39,14 @@ export const useIntegrationFF = (store, withoutDebounce, destroyOnUnregister) =>
|
|
|
39
39
|
const cb = (value) => {
|
|
40
40
|
if (store.name) {
|
|
41
41
|
form.change(store.name, get(transformArrOut(value), store.name));
|
|
42
|
+
storeSubscriber === null || storeSubscriber === void 0 ? void 0 : storeSubscriber(get(value, store.name));
|
|
42
43
|
}
|
|
43
44
|
};
|
|
44
45
|
if (withoutDebounce) {
|
|
45
46
|
return cb;
|
|
46
47
|
}
|
|
47
48
|
return debounce(cb, 100);
|
|
48
|
-
}, [form.change, store.name, withoutDebounce]);
|
|
49
|
+
}, [form.change, store.name, withoutDebounce, storeSubscriber]);
|
|
49
50
|
React.useEffect(() => {
|
|
50
51
|
change(store.values);
|
|
51
52
|
}, [store.values]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DynamicFormMutators, DynamicFormMutatorsStore } from '../types';
|
|
1
|
+
import type { DynamicFormMutators, DynamicFormMutatorsStore } from '../types';
|
|
2
2
|
export declare const useMutators: (externalMutators?: DynamicFormMutators) => {
|
|
3
3
|
mutatorsStore: DynamicFormMutatorsStore;
|
|
4
4
|
mutateDFState: (mutators: DynamicFormMutators) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Spec } from '../../../../types';
|
|
2
|
-
import { FieldValue } from '../../types';
|
|
1
|
+
import type { Spec } from '../../../../types';
|
|
2
|
+
import type { FieldValue } from '../../types';
|
|
3
3
|
import './useSearch.css';
|
|
4
4
|
export declare const useSearch: (spec: Spec, value: FieldValue, name: string) => (children: JSX.Element | null) => JSX.Element | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DynamicFieldStore, FieldObjectValue, FieldValue, ValidateError } from '../types';
|
|
1
|
+
import type { DynamicFieldStore, FieldObjectValue, FieldValue, ValidateError } from '../types';
|
|
2
2
|
export declare const useStore: (name: string) => {
|
|
3
3
|
tools: {
|
|
4
4
|
initialValue: FieldObjectValue;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ArraySpec, ArrayValue } from '../../../types';
|
|
2
|
-
import { FieldArrayValue, IndependentInputEntity, IndependentInputProps, IndependentInputType, InputEntity, InputProps, InputType, InputsMap, LayoutProps, LayoutType, LayoutsMap, TypeConfig, ValidatorsMap } from './';
|
|
1
|
+
import type { ArraySpec, ArrayValue } from '../../../types';
|
|
2
|
+
import type { FieldArrayValue, IndependentInputEntity, IndependentInputProps, IndependentInputType, InputEntity, InputProps, InputType, InputsMap, LayoutProps, LayoutType, LayoutsMap, TypeConfig, ValidatorsMap } from './';
|
|
3
3
|
export type ArrayInputProps<InputComponentProps extends Record<string, any> | undefined = undefined> = InputProps<FieldArrayValue, InputComponentProps, undefined, ArraySpec<undefined, InputComponentProps, undefined>>;
|
|
4
4
|
export type ArrayIndependentInputProps<InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined> = IndependentInputProps<FieldArrayValue, InputComponentProps, LayoutComponentProps, ArraySpec<undefined, InputComponentProps, LayoutComponentProps>>;
|
|
5
5
|
export type ArrayLayoutProps<InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined> = LayoutProps<FieldArrayValue, InputComponentProps, LayoutComponentProps, ArraySpec<undefined, InputComponentProps, LayoutComponentProps>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BooleanSpec } from '../../../types';
|
|
2
|
-
import { IndependentInputEntity, IndependentInputProps, IndependentInputType, InputEntity, InputProps, InputType, InputsMap, LayoutProps, LayoutType, LayoutsMap, TypeConfig, ValidatorsMap } from './';
|
|
1
|
+
import type { BooleanSpec } from '../../../types';
|
|
2
|
+
import type { IndependentInputEntity, IndependentInputProps, IndependentInputType, InputEntity, InputProps, InputType, InputsMap, LayoutProps, LayoutType, LayoutsMap, TypeConfig, ValidatorsMap } from './';
|
|
3
3
|
export type BooleanInputProps<InputComponentProps extends Record<string, any> | undefined = undefined> = InputProps<boolean, InputComponentProps, undefined, BooleanSpec<undefined, InputComponentProps, undefined>>;
|
|
4
4
|
export type BooleanIndependentInputProps<InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined> = IndependentInputProps<boolean, InputComponentProps, LayoutComponentProps, BooleanSpec<undefined, InputComponentProps, LayoutComponentProps>>;
|
|
5
5
|
export type BooleanLayoutProps<InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined> = LayoutProps<boolean, InputComponentProps, LayoutComponentProps, BooleanSpec<undefined, InputComponentProps, LayoutComponentProps>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FormValue, Spec } from '../../../types';
|
|
2
|
-
import { ArrayConfig, BooleanConfig, FieldValue, InputsMap, LayoutsMap, NumberConfig, ObjectConfig, StringConfig, ValidatorsMap } from './';
|
|
1
|
+
import type { FormValue, Spec } from '../../../types';
|
|
2
|
+
import type { ArrayConfig, BooleanConfig, FieldValue, InputsMap, LayoutsMap, NumberConfig, ObjectConfig, StringConfig, ValidatorsMap } from './';
|
|
3
3
|
export interface TypeConfig<DirtyValue extends FieldValue, Value extends FormValue, SpecType extends Spec<undefined, any, any>> {
|
|
4
4
|
inputs: InputsMap<DirtyValue, SpecType>;
|
|
5
5
|
layouts: LayoutsMap<DirtyValue, SpecType>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import type React from 'react';
|
|
2
2
|
import type { MonacoEditorProps } from 'react-monaco-editor/lib/types';
|
|
3
|
-
import { StringSpec } from '../../../types';
|
|
4
|
-
import { DynamicFieldStore, DynamicFormConfig, DynamicFormMutators, DynamicFormMutatorsStore, FieldValue, ValidateError, WonderMirror } from './';
|
|
3
|
+
import type { StringSpec } from '../../../types';
|
|
4
|
+
import type { DynamicFieldStore, DynamicFormConfig, DynamicFormMutators, DynamicFormMutatorsStore, FieldValue, ValidateError, WonderMirror } from './';
|
|
5
5
|
export interface DynamicFormsContext {
|
|
6
6
|
config: DynamicFormConfig;
|
|
7
7
|
Monaco?: React.ComponentType<MonacoEditorProps>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Spec } from '../../../types';
|
|
3
|
-
import { FieldRenderProps, FieldValue, LayoutType } from './';
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { Spec } from '../../../types';
|
|
3
|
+
import type { FieldRenderProps, FieldValue, LayoutType } from './';
|
|
4
4
|
export type InputProps<Value extends FieldValue, InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined, SpecType extends Spec<undefined, InputComponentProps, LayoutComponentProps> = Spec> = {
|
|
5
5
|
spec: SpecType;
|
|
6
6
|
name: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Spec } from '../../../types';
|
|
3
|
-
import { FieldValue, InputProps } from './';
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { Spec } from '../../../types';
|
|
3
|
+
import type { FieldValue, InputProps } from './';
|
|
4
4
|
export type LayoutProps<Value extends FieldValue, InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined, SpecType extends Spec<undefined, InputComponentProps, LayoutComponentProps> = Spec> = {
|
|
5
5
|
children: React.ReactElement;
|
|
6
6
|
layoutProps?: LayoutComponentProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useIntegrationFF, useSearch, useSearchStore, useStore } from '../hooks';
|
|
2
|
-
import { FieldRenderProps } from './field';
|
|
1
|
+
import type { useIntegrationFF, useSearch, useSearchStore, useStore } from '../hooks';
|
|
2
|
+
import type { FieldRenderProps } from './field';
|
|
3
3
|
export interface ControllerMirror {
|
|
4
4
|
useField?: FieldRenderProps<any>;
|
|
5
5
|
useSearch?: ReturnType<typeof useSearch>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ArraySpec, BooleanSpec, FormValue, NumberSpec, ObjectSpec, StringSpec } from '../../../types';
|
|
2
|
-
import { BaseValidateError } from './';
|
|
1
|
+
import type { ArraySpec, BooleanSpec, FormValue, NumberSpec, ObjectSpec, StringSpec } from '../../../types';
|
|
2
|
+
import type { BaseValidateError } from './';
|
|
3
3
|
export type SpecMutator = Partial<(Omit<ArraySpec, 'viewSpec'> & {
|
|
4
4
|
viewSpec: Partial<ArraySpec['viewSpec']>;
|
|
5
5
|
}) | (Omit<BooleanSpec, 'viewSpec'> & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NumberSpec } from '../../../types';
|
|
2
|
-
import { IndependentInputEntity, IndependentInputProps, IndependentInputType, InputEntity, InputProps, InputType, InputsMap, LayoutProps, LayoutType, LayoutsMap, TypeConfig, ValidatorsMap } from './';
|
|
1
|
+
import type { NumberSpec } from '../../../types';
|
|
2
|
+
import type { IndependentInputEntity, IndependentInputProps, IndependentInputType, InputEntity, InputProps, InputType, InputsMap, LayoutProps, LayoutType, LayoutsMap, TypeConfig, ValidatorsMap } from './';
|
|
3
3
|
export type NumberInputProps<InputComponentProps extends Record<string, any> | undefined = undefined> = InputProps<number, InputComponentProps, undefined, NumberSpec<undefined, InputComponentProps, undefined>>;
|
|
4
4
|
export type NumberIndependentInputProps<InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined> = IndependentInputProps<number, InputComponentProps, LayoutComponentProps, NumberSpec<undefined, InputComponentProps, LayoutComponentProps>>;
|
|
5
5
|
export type NumberLayoutProps<InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined> = LayoutProps<number, InputComponentProps, LayoutComponentProps, NumberSpec<undefined, InputComponentProps, LayoutComponentProps>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ObjectSpec, ObjectValue } from '../../../types';
|
|
2
|
-
import { FieldObjectValue, IndependentInputEntity, IndependentInputProps, IndependentInputType, InputEntity, InputProps, InputType, InputsMap, LayoutProps, LayoutType, LayoutsMap, TypeConfig, ValidatorsMap } from './';
|
|
1
|
+
import type { ObjectSpec, ObjectValue } from '../../../types';
|
|
2
|
+
import type { FieldObjectValue, IndependentInputEntity, IndependentInputProps, IndependentInputType, InputEntity, InputProps, InputType, InputsMap, LayoutProps, LayoutType, LayoutsMap, TypeConfig, ValidatorsMap } from './';
|
|
3
3
|
export type ObjectInputProps<InputComponentProps extends Record<string, any> | undefined = undefined> = InputProps<FieldObjectValue, InputComponentProps, undefined, ObjectSpec<undefined, InputComponentProps, undefined>>;
|
|
4
4
|
export type ObjectIndependentInputProps<InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined> = IndependentInputProps<FieldObjectValue, InputComponentProps, LayoutComponentProps, ObjectSpec<undefined, InputComponentProps, LayoutComponentProps>>;
|
|
5
5
|
export type ObjectLayoutProps<InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined> = LayoutProps<FieldObjectValue, InputComponentProps, LayoutComponentProps, ObjectSpec<undefined, InputComponentProps, LayoutComponentProps>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Spec } from '../../../types';
|
|
2
|
-
import { FieldValue } from './value';
|
|
1
|
+
import type { Spec } from '../../../types';
|
|
2
|
+
import type { FieldValue } from './value';
|
|
3
3
|
export interface SearchContext {
|
|
4
4
|
setField: (name: string, search: boolean) => void;
|
|
5
5
|
removeField: (name: string) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StringSpec } from '../../../types';
|
|
2
|
-
import { IndependentInputEntity, IndependentInputProps, IndependentInputType, InputEntity, InputProps, InputType, InputsMap, LayoutProps, LayoutType, LayoutsMap, TypeConfig, ValidatorsMap } from './';
|
|
1
|
+
import type { StringSpec } from '../../../types';
|
|
2
|
+
import type { IndependentInputEntity, IndependentInputProps, IndependentInputType, InputEntity, InputProps, InputType, InputsMap, LayoutProps, LayoutType, LayoutsMap, TypeConfig, ValidatorsMap } from './';
|
|
3
3
|
export type StringInputProps<InputComponentProps extends Record<string, any> | undefined = undefined> = InputProps<string, InputComponentProps, undefined, StringSpec<undefined, InputComponentProps, undefined>>;
|
|
4
4
|
export type StringIndependentInputProps<InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined> = IndependentInputProps<string, InputComponentProps, LayoutComponentProps, StringSpec<undefined, InputComponentProps, LayoutComponentProps>>;
|
|
5
5
|
export type StringLayoutProps<InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined> = LayoutProps<string, InputComponentProps, LayoutComponentProps, StringSpec<undefined, InputComponentProps, LayoutComponentProps>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormValue, Spec } from '../../../types';
|
|
1
|
+
import type { FormValue, Spec } from '../../../types';
|
|
2
2
|
export type BaseValidateError = string | boolean | undefined;
|
|
3
3
|
export type AsyncValidateError = Promise<BaseValidateError>;
|
|
4
4
|
export type ValidateError = BaseValidateError | AsyncValidateError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OBJECT_ARRAY_CNT, OBJECT_ARRAY_FLAG } from '../constants';
|
|
1
|
+
import type { OBJECT_ARRAY_CNT, OBJECT_ARRAY_FLAG } from '../constants';
|
|
2
2
|
export interface FieldArrayValue extends Record<string, FieldValue> {
|
|
3
3
|
[OBJECT_ARRAY_FLAG]: true;
|
|
4
4
|
[OBJECT_ARRAY_CNT]: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormValue, Spec } from '../../../types';
|
|
1
|
+
import type { FormValue, Spec } from '../../../types';
|
|
2
2
|
export declare const isCorrectConfig: (candidate: any) => boolean;
|
|
3
3
|
export declare const transformArrIn: <Type extends FormValue, ReturnType_1 extends FormValue = Type>(value: Type) => ReturnType_1;
|
|
4
4
|
export declare const transformArrOut: <Type extends FormValue, ReturnType_1 extends FormValue = Type>(value: Type) => ReturnType_1;
|