@gravity-ui/dynamic-forms 5.18.0 → 5.19.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/core/Entity/Entity.js +78 -0
- package/build/cjs/lib/unstable/core/Entity/index.js +5 -0
- package/build/cjs/lib/unstable/core/Entity/types.js +2 -0
- package/build/cjs/lib/unstable/core/Entity/utils.js +40 -0
- package/build/cjs/lib/unstable/core/SchemaRenderer/SchemaRenderer.js +12 -0
- package/build/cjs/lib/unstable/core/SchemaRenderer/index.js +5 -0
- package/build/cjs/lib/unstable/core/constants.js +28 -0
- package/build/cjs/lib/unstable/core/index.js +15 -0
- package/build/cjs/lib/unstable/core/types/components.js +2 -0
- package/build/cjs/lib/unstable/core/types/config.js +2 -0
- package/build/cjs/lib/unstable/core/types/helpers.js +2 -0
- package/build/cjs/lib/unstable/core/types/index.js +8 -0
- package/build/cjs/lib/unstable/core/types/schema.js +2 -0
- package/build/cjs/lib/unstable/core/types/validation.js +2 -0
- package/build/cjs/lib/unstable/core/types/values.js +2 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/constants.js +4 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/hooks/index.js +7 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/hooks/useEntitiesState.js +25 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/hooks/useSchemaRendererMutators.js +17 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/index.js +10 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/async-validation/async-validation.js +35 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/async-validation/index.js +5 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/async-validation/types.js +2 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/external-errors/external-errors.js +60 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/external-errors/index.js +5 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/external-errors/types.js +2 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/index.js +16 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/schema-mutators/index.js +5 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/schema-mutators/schema-mutators.js +81 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/schema-mutators/types.js +2 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/trigger-fields/index.js +5 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/trigger-fields/trigger-fields.js +12 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/trigger-fields/types.js +2 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/types.js +2 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/useSchemaRenderer.js +86 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/common.js +11 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/get-ajv-validate.js +39 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/get-validate.js +67 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/index.js +7 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/process-ajv-error.js +51 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/process-ajv-validate-errors.js +43 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/process-entity-parameters-error.js +36 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/process-errors-state.js +17 -0
- package/build/cjs/lib/unstable/core/utils/common.js +180 -0
- package/build/cjs/lib/unstable/core/utils/index.js +4 -0
- package/build/cjs/lib/unstable/kit/Accordeon.js +31 -0
- package/build/cjs/lib/unstable/kit/Any.js +21 -0
- package/build/cjs/lib/unstable/kit/ArrayBase.css +23 -0
- package/build/cjs/lib/unstable/kit/ArrayBase.js +101 -0
- package/build/cjs/lib/unstable/kit/MultiSelect.css +6 -0
- package/build/cjs/lib/unstable/kit/MultiSelect.js +66 -0
- package/build/cjs/lib/unstable/kit/ObjectBase.css +10 -0
- package/build/cjs/lib/unstable/kit/ObjectBase.js +71 -0
- package/build/cjs/lib/unstable/kit/Row.css +73 -0
- package/build/cjs/lib/unstable/kit/Row.js +50 -0
- package/build/cjs/lib/unstable/kit/Text.js +259 -0
- package/build/cjs/lib/unstable/kit/components/ArrayRemoveButton/ArrayRemoveButton.js +29 -0
- package/build/cjs/lib/unstable/kit/components/ArrayRemoveButton/index.js +5 -0
- package/build/cjs/lib/unstable/kit/components/ControlError/ControlError.css +33 -0
- package/build/cjs/lib/unstable/kit/components/ControlError/ControlError.js +15 -0
- package/build/cjs/lib/unstable/kit/components/ControlError/index.js +5 -0
- package/build/cjs/lib/unstable/kit/components/HTMLContent/HTMLContent.js +11 -0
- package/build/cjs/lib/unstable/kit/components/HTMLContent/index.js +5 -0
- package/build/cjs/lib/unstable/kit/components/index.js +9 -0
- package/build/cjs/lib/unstable/kit/config.js +68 -0
- package/build/cjs/lib/unstable/kit/constants/config.js +62 -0
- package/build/cjs/lib/unstable/kit/constants/index.js +6 -0
- package/build/cjs/lib/unstable/kit/controls/ArrayBase/ArrayBase.js +46 -0
- package/build/cjs/lib/unstable/kit/controls/ArrayBase/index.js +4 -0
- package/build/cjs/lib/unstable/kit/controls/Checkbox/Checkbox.css +5 -0
- package/build/cjs/lib/unstable/kit/controls/Checkbox/Checkbox.js +16 -0
- package/build/cjs/lib/unstable/kit/controls/Checkbox/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/CheckboxGroup/CheckboxGroup.css +3 -0
- package/build/cjs/lib/unstable/kit/controls/CheckboxGroup/CheckboxGroup.js +37 -0
- package/build/cjs/lib/unstable/kit/controls/CheckboxGroup/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/ColorPicker/ColorPicker.js +24 -0
- package/build/cjs/lib/unstable/kit/controls/ColorPicker/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/DateInput/DateInput.css +3 -0
- package/build/cjs/lib/unstable/kit/controls/DateInput/DateInput.js +55 -0
- package/build/cjs/lib/unstable/kit/controls/DateInput/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/MultiSelect/MultiSelect.js +35 -0
- package/build/cjs/lib/unstable/kit/controls/MultiSelect/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/NumberBase/Number.js +12 -0
- package/build/cjs/lib/unstable/kit/controls/NumberBase/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/ObjectBase/ObjectBase.js +33 -0
- package/build/cjs/lib/unstable/kit/controls/ObjectBase/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/Password/Password.js +12 -0
- package/build/cjs/lib/unstable/kit/controls/Password/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/RadioGroup/RadioGroup.css +3 -0
- package/build/cjs/lib/unstable/kit/controls/RadioGroup/RadioGroup.js +24 -0
- package/build/cjs/lib/unstable/kit/controls/RadioGroup/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/RangeSlider/RangeSlider.css +3 -0
- package/build/cjs/lib/unstable/kit/controls/RangeSlider/RangeSlider.js +33 -0
- package/build/cjs/lib/unstable/kit/controls/RangeSlider/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/Select/Select.js +32 -0
- package/build/cjs/lib/unstable/kit/controls/Select/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/Slider/Slider.css +3 -0
- package/build/cjs/lib/unstable/kit/controls/Slider/Slider.js +19 -0
- package/build/cjs/lib/unstable/kit/controls/Slider/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/StringBase/StringBase.js +12 -0
- package/build/cjs/lib/unstable/kit/controls/StringBase/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/Switch/Switch.css +5 -0
- package/build/cjs/lib/unstable/kit/controls/Switch/Switch.js +16 -0
- package/build/cjs/lib/unstable/kit/controls/Switch/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/TextArea/TextArea.js +12 -0
- package/build/cjs/lib/unstable/kit/controls/TextArea/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/index.js +35 -0
- package/build/cjs/lib/unstable/kit/styles/functions.css +0 -0
- package/build/cjs/lib/unstable/kit/styles/variables.css +0 -0
- package/build/cjs/lib/unstable/kit/utils/cn.js +6 -0
- package/build/cjs/lib/unstable/kit/utils/common.js +27 -0
- package/build/cjs/lib/unstable/kit/utils/index.js +11 -0
- package/build/cjs/lib/unstable/kit/wrappers/Row/Row.css +27 -0
- package/build/cjs/lib/unstable/kit/wrappers/Row/Row.js +34 -0
- package/build/cjs/lib/unstable/kit/wrappers/Row/index.js +5 -0
- package/build/cjs/lib/unstable/kit/wrappers/Transparent/Transparent.css +6 -0
- package/build/cjs/lib/unstable/kit/wrappers/Transparent/Transparent.js +15 -0
- package/build/cjs/lib/unstable/kit/wrappers/Transparent/index.js +5 -0
- package/build/cjs/lib/unstable/kit/wrappers/index.js +7 -0
- package/build/cjs/unstable.js +10 -0
- package/build/esm/lib/unstable/core/Entity/Entity.d.ts +10 -0
- package/build/esm/lib/unstable/core/Entity/Entity.js +74 -0
- package/build/esm/lib/unstable/core/Entity/index.d.ts +2 -0
- package/build/esm/lib/unstable/core/Entity/index.js +1 -0
- package/build/esm/lib/unstable/core/Entity/types.d.ts +27 -0
- package/build/esm/lib/unstable/core/Entity/types.js +1 -0
- package/build/esm/lib/unstable/core/Entity/utils.d.ts +3 -0
- package/build/esm/lib/unstable/core/Entity/utils.js +35 -0
- package/build/esm/lib/unstable/core/SchemaRenderer/SchemaRenderer.d.ts +5 -0
- package/build/esm/lib/unstable/core/SchemaRenderer/SchemaRenderer.js +8 -0
- package/build/esm/lib/unstable/core/SchemaRenderer/index.d.ts +1 -0
- package/build/esm/lib/unstable/core/SchemaRenderer/index.js +1 -0
- package/build/esm/lib/unstable/core/constants.d.ts +22 -0
- package/build/esm/lib/unstable/core/constants.js +25 -0
- package/build/esm/lib/unstable/core/index.d.ts +5 -0
- package/build/esm/lib/unstable/core/index.js +4 -0
- package/build/esm/lib/unstable/core/types/components.d.ts +29 -0
- package/build/esm/lib/unstable/core/types/components.js +1 -0
- package/build/esm/lib/unstable/core/types/config.d.ts +36 -0
- package/build/esm/lib/unstable/core/types/config.js +1 -0
- package/build/esm/lib/unstable/core/types/helpers.d.ts +18 -0
- package/build/esm/lib/unstable/core/types/helpers.js +1 -0
- package/build/esm/lib/unstable/core/types/index.d.ts +5 -0
- package/build/esm/lib/unstable/core/types/index.js +5 -0
- package/build/esm/lib/unstable/core/types/schema.d.ts +1186 -0
- package/build/esm/lib/unstable/core/types/schema.js +1 -0
- package/build/esm/lib/unstable/core/types/validation.d.ts +39 -0
- package/build/esm/lib/unstable/core/types/validation.js +1 -0
- package/build/esm/lib/unstable/core/types/values.d.ts +4 -0
- package/build/esm/lib/unstable/core/types/values.js +1 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/constants.d.ts +1 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/constants.js +1 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/hooks/index.d.ts +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/hooks/index.js +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/hooks/useEntitiesState.d.ts +7 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/hooks/useEntitiesState.js +20 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/hooks/useSchemaRendererMutators.d.ts +10 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/hooks/useSchemaRendererMutators.js +13 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/index.d.ts +3 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/index.js +3 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/async-validation/async-validation.d.ts +3 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/async-validation/async-validation.js +29 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/async-validation/index.d.ts +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/async-validation/index.js +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/async-validation/types.d.ts +34 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/async-validation/types.js +1 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/external-errors/external-errors.d.ts +3 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/external-errors/external-errors.js +54 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/external-errors/index.d.ts +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/external-errors/index.js +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/external-errors/types.d.ts +25 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/external-errors/types.js +1 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/index.d.ts +13 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/index.js +13 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/schema-mutators/index.d.ts +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/schema-mutators/index.js +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/schema-mutators/schema-mutators.d.ts +3 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/schema-mutators/schema-mutators.js +75 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/schema-mutators/types.d.ts +26 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/schema-mutators/types.js +1 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/trigger-fields/index.d.ts +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/trigger-fields/index.js +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/trigger-fields/trigger-fields.d.ts +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/trigger-fields/trigger-fields.js +8 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/trigger-fields/types.d.ts +6 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/trigger-fields/types.js +1 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/types.d.ts +22 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/types.js +1 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/useSchemaRenderer.d.ts +37 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/useSchemaRenderer.js +81 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/common.d.ts +1 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/common.js +7 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/get-ajv-validate.d.ts +11 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/get-ajv-validate.js +34 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/get-validate.d.ts +14 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/get-validate.js +62 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/index.d.ts +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/index.js +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/process-ajv-error.d.ts +10 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/process-ajv-error.js +46 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/process-ajv-validate-errors.d.ts +20 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/process-ajv-validate-errors.js +39 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/process-entity-parameters-error.d.ts +15 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/process-entity-parameters-error.js +31 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/process-errors-state.d.ts +12 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/process-errors-state.js +12 -0
- package/build/esm/lib/unstable/core/utils/common.d.ts +49 -0
- package/build/esm/lib/unstable/core/utils/common.js +165 -0
- package/build/esm/lib/unstable/core/utils/index.d.ts +1 -0
- package/build/esm/lib/unstable/core/utils/index.js +1 -0
- package/build/esm/lib/unstable/kit/Accordeon.d.ts +3 -0
- package/build/esm/lib/unstable/kit/Accordeon.js +26 -0
- package/build/esm/lib/unstable/kit/Any.d.ts +2 -0
- package/build/esm/lib/unstable/kit/Any.js +16 -0
- package/build/esm/lib/unstable/kit/ArrayBase.css +23 -0
- package/build/esm/lib/unstable/kit/ArrayBase.d.ts +3 -0
- package/build/esm/lib/unstable/kit/ArrayBase.js +97 -0
- package/build/esm/lib/unstable/kit/MultiSelect.css +6 -0
- package/build/esm/lib/unstable/kit/MultiSelect.d.ts +7 -0
- package/build/esm/lib/unstable/kit/MultiSelect.js +62 -0
- package/build/esm/lib/unstable/kit/ObjectBase.css +10 -0
- package/build/esm/lib/unstable/kit/ObjectBase.d.ts +8 -0
- package/build/esm/lib/unstable/kit/ObjectBase.js +66 -0
- package/build/esm/lib/unstable/kit/Row.css +73 -0
- package/build/esm/lib/unstable/kit/Row.d.ts +11 -0
- package/build/esm/lib/unstable/kit/Row.js +47 -0
- package/build/esm/lib/unstable/kit/Text.d.ts +6 -0
- package/build/esm/lib/unstable/kit/Text.js +255 -0
- package/build/esm/lib/unstable/kit/components/ArrayRemoveButton/ArrayRemoveButton.d.ts +5 -0
- package/build/esm/lib/unstable/kit/components/ArrayRemoveButton/ArrayRemoveButton.js +24 -0
- package/build/esm/lib/unstable/kit/components/ArrayRemoveButton/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/components/ArrayRemoveButton/index.js +1 -0
- package/build/esm/lib/unstable/kit/components/ControlError/ControlError.css +33 -0
- package/build/esm/lib/unstable/kit/components/ControlError/ControlError.d.ts +9 -0
- package/build/esm/lib/unstable/kit/components/ControlError/ControlError.js +11 -0
- package/build/esm/lib/unstable/kit/components/ControlError/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/components/ControlError/index.js +1 -0
- package/build/esm/lib/unstable/kit/components/HTMLContent/HTMLContent.d.ts +6 -0
- package/build/esm/lib/unstable/kit/components/HTMLContent/HTMLContent.js +7 -0
- package/build/esm/lib/unstable/kit/components/HTMLContent/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/components/HTMLContent/index.js +1 -0
- package/build/esm/lib/unstable/kit/components/index.d.ts +3 -0
- package/build/esm/lib/unstable/kit/components/index.js +3 -0
- package/build/esm/lib/unstable/kit/config.d.ts +95 -0
- package/build/esm/lib/unstable/kit/config.js +65 -0
- package/build/esm/lib/unstable/kit/constants/config.d.ts +112 -0
- package/build/esm/lib/unstable/kit/constants/config.js +59 -0
- package/build/esm/lib/unstable/kit/constants/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/constants/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/ArrayBase/ArrayBase.d.ts +8 -0
- package/build/esm/lib/unstable/kit/controls/ArrayBase/ArrayBase.js +42 -0
- package/build/esm/lib/unstable/kit/controls/ArrayBase/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/ArrayBase/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/Checkbox/Checkbox.css +5 -0
- package/build/esm/lib/unstable/kit/controls/Checkbox/Checkbox.d.ts +7 -0
- package/build/esm/lib/unstable/kit/controls/Checkbox/Checkbox.js +13 -0
- package/build/esm/lib/unstable/kit/controls/Checkbox/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/Checkbox/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/CheckboxGroup/CheckboxGroup.css +3 -0
- package/build/esm/lib/unstable/kit/controls/CheckboxGroup/CheckboxGroup.d.ts +10 -0
- package/build/esm/lib/unstable/kit/controls/CheckboxGroup/CheckboxGroup.js +34 -0
- package/build/esm/lib/unstable/kit/controls/CheckboxGroup/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/CheckboxGroup/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/ColorPicker/ColorPicker.d.ts +6 -0
- package/build/esm/lib/unstable/kit/controls/ColorPicker/ColorPicker.js +21 -0
- package/build/esm/lib/unstable/kit/controls/ColorPicker/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/ColorPicker/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/DateInput/DateInput.css +3 -0
- package/build/esm/lib/unstable/kit/controls/DateInput/DateInput.d.ts +9 -0
- package/build/esm/lib/unstable/kit/controls/DateInput/DateInput.js +53 -0
- package/build/esm/lib/unstable/kit/controls/DateInput/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/DateInput/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/MultiSelect/MultiSelect.d.ts +8 -0
- package/build/esm/lib/unstable/kit/controls/MultiSelect/MultiSelect.js +32 -0
- package/build/esm/lib/unstable/kit/controls/MultiSelect/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/MultiSelect/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/NumberBase/Number.d.ts +6 -0
- package/build/esm/lib/unstable/kit/controls/NumberBase/Number.js +8 -0
- package/build/esm/lib/unstable/kit/controls/NumberBase/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/NumberBase/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/ObjectBase/ObjectBase.d.ts +8 -0
- package/build/esm/lib/unstable/kit/controls/ObjectBase/ObjectBase.js +29 -0
- package/build/esm/lib/unstable/kit/controls/ObjectBase/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/ObjectBase/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/Password/Password.d.ts +6 -0
- package/build/esm/lib/unstable/kit/controls/Password/Password.js +8 -0
- package/build/esm/lib/unstable/kit/controls/Password/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/Password/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/RadioGroup/RadioGroup.css +3 -0
- package/build/esm/lib/unstable/kit/controls/RadioGroup/RadioGroup.d.ts +9 -0
- package/build/esm/lib/unstable/kit/controls/RadioGroup/RadioGroup.js +22 -0
- package/build/esm/lib/unstable/kit/controls/RadioGroup/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/RadioGroup/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/RangeSlider/RangeSlider.css +3 -0
- package/build/esm/lib/unstable/kit/controls/RangeSlider/RangeSlider.d.ts +8 -0
- package/build/esm/lib/unstable/kit/controls/RangeSlider/RangeSlider.js +31 -0
- package/build/esm/lib/unstable/kit/controls/RangeSlider/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/RangeSlider/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/Select/Select.d.ts +9 -0
- package/build/esm/lib/unstable/kit/controls/Select/Select.js +29 -0
- package/build/esm/lib/unstable/kit/controls/Select/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/Select/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/Slider/Slider.css +3 -0
- package/build/esm/lib/unstable/kit/controls/Slider/Slider.d.ts +7 -0
- package/build/esm/lib/unstable/kit/controls/Slider/Slider.js +16 -0
- package/build/esm/lib/unstable/kit/controls/Slider/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/Slider/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/StringBase/StringBase.d.ts +6 -0
- package/build/esm/lib/unstable/kit/controls/StringBase/StringBase.js +8 -0
- package/build/esm/lib/unstable/kit/controls/StringBase/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/StringBase/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/Switch/Switch.css +5 -0
- package/build/esm/lib/unstable/kit/controls/Switch/Switch.d.ts +7 -0
- package/build/esm/lib/unstable/kit/controls/Switch/Switch.js +13 -0
- package/build/esm/lib/unstable/kit/controls/Switch/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/Switch/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/TextArea/TextArea.d.ts +6 -0
- package/build/esm/lib/unstable/kit/controls/TextArea/TextArea.js +8 -0
- package/build/esm/lib/unstable/kit/controls/TextArea/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/TextArea/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/index.d.ts +16 -0
- package/build/esm/lib/unstable/kit/controls/index.js +16 -0
- package/build/esm/lib/unstable/kit/styles/functions.css +0 -0
- package/build/esm/lib/unstable/kit/styles/variables.css +0 -0
- package/build/esm/lib/unstable/kit/utils/cn.d.ts +1 -0
- package/build/esm/lib/unstable/kit/utils/cn.js +3 -0
- package/build/esm/lib/unstable/kit/utils/common.d.ts +7 -0
- package/build/esm/lib/unstable/kit/utils/common.js +19 -0
- package/build/esm/lib/unstable/kit/utils/index.d.ts +2 -0
- package/build/esm/lib/unstable/kit/utils/index.js +2 -0
- package/build/esm/lib/unstable/kit/wrappers/Row/Row.css +27 -0
- package/build/esm/lib/unstable/kit/wrappers/Row/Row.d.ts +7 -0
- package/build/esm/lib/unstable/kit/wrappers/Row/Row.js +31 -0
- package/build/esm/lib/unstable/kit/wrappers/Row/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/wrappers/Row/index.js +1 -0
- package/build/esm/lib/unstable/kit/wrappers/Transparent/Transparent.css +6 -0
- package/build/esm/lib/unstable/kit/wrappers/Transparent/Transparent.d.ts +4 -0
- package/build/esm/lib/unstable/kit/wrappers/Transparent/Transparent.js +12 -0
- package/build/esm/lib/unstable/kit/wrappers/Transparent/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/wrappers/Transparent/index.js +1 -0
- package/build/esm/lib/unstable/kit/wrappers/index.d.ts +2 -0
- package/build/esm/lib/unstable/kit/wrappers/index.js +2 -0
- package/build/esm/unstable.d.ts +4 -0
- package/build/esm/unstable.js +4 -0
- package/package.json +24 -2
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Flex, RadioGroup as RadioGroupBase, } from '@gravity-ui/uikit';
|
|
4
|
+
import { ControlError } from '../../components';
|
|
5
|
+
import { block, getValidationState } from '../../utils';
|
|
6
|
+
import './RadioGroup.css';
|
|
7
|
+
const b = block('radio-group');
|
|
8
|
+
const Component = ({ controlProps, input, meta, schema, }) => {
|
|
9
|
+
const { enumDescriptions, optionsDisabled } = controlProps, restControlProps = __rest(controlProps, ["enumDescriptions", "optionsDisabled"]);
|
|
10
|
+
const options = React.useMemo(() => {
|
|
11
|
+
var _a;
|
|
12
|
+
return (_a = schema.enum) === null || _a === void 0 ? void 0 : _a.map((value) => ({
|
|
13
|
+
value,
|
|
14
|
+
content: (enumDescriptions === null || enumDescriptions === void 0 ? void 0 : enumDescriptions[value]) || value,
|
|
15
|
+
disabled: optionsDisabled === null || optionsDisabled === void 0 ? void 0 : optionsDisabled[value],
|
|
16
|
+
}));
|
|
17
|
+
}, [enumDescriptions, optionsDisabled, schema.enum]);
|
|
18
|
+
return (React.createElement(ControlError, { errorMessage: meta.error, validationState: getValidationState(meta) },
|
|
19
|
+
React.createElement(Flex, { className: b(), alignItems: "center" },
|
|
20
|
+
React.createElement(RadioGroupBase, Object.assign({ options: options, disabled: schema.readOnly }, restControlProps, { value: input.value, onFocus: input.onFocus, onBlur: input.onBlur, onUpdate: input.onChange, qa: input.name })))));
|
|
21
|
+
};
|
|
22
|
+
export const RadioGroup = React.memo(Component);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RadioGroup, type RadioGroupProps } from './RadioGroup';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RadioGroup } from './RadioGroup';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type SliderProps as SliderBaseProps } from '@gravity-ui/uikit';
|
|
3
|
+
import type { JsonSchemaObject } from '../../../core';
|
|
4
|
+
import './RangeSlider.css';
|
|
5
|
+
export interface RangeSliderProps extends Omit<SliderBaseProps, 'value' | 'onFocus' | 'onBlur' | 'onChange' | 'onUpdate' | 'qa'> {
|
|
6
|
+
propertyKeys?: [string, string];
|
|
7
|
+
}
|
|
8
|
+
export declare const RangeSlider: React.NamedExoticComponent<import("../../../core").ControlProps<JsonSchemaObject<any>, RangeSliderProps, {}>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Slider as SliderBase } from '@gravity-ui/uikit';
|
|
4
|
+
import { block, getValidationState } from '../../utils';
|
|
5
|
+
import './RangeSlider.css';
|
|
6
|
+
const b = block('range-slider');
|
|
7
|
+
const Component = ({ controlProps, input, meta, schema, }) => {
|
|
8
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
9
|
+
const { propertyKeys } = controlProps, restControlProps = __rest(controlProps, ["propertyKeys"]);
|
|
10
|
+
const [fromKey, toKey] = propertyKeys || ['from', 'to'];
|
|
11
|
+
const min = ((_a = schema.properties) === null || _a === void 0 ? void 0 : _a[fromKey]) && 'minimum' in schema.properties[fromKey]
|
|
12
|
+
? (_c = (_b = schema.properties) === null || _b === void 0 ? void 0 : _b[fromKey]) === null || _c === void 0 ? void 0 : _c.minimum
|
|
13
|
+
: undefined;
|
|
14
|
+
const max = ((_d = schema.properties) === null || _d === void 0 ? void 0 : _d[toKey]) && 'maximum' in schema.properties[toKey]
|
|
15
|
+
? (_f = (_e = schema.properties) === null || _e === void 0 ? void 0 : _e[toKey]) === null || _f === void 0 ? void 0 : _f.maximum
|
|
16
|
+
: undefined;
|
|
17
|
+
const value = isNaN(Number((_g = input.value) === null || _g === void 0 ? void 0 : _g[fromKey])) || isNaN(Number((_h = input.value) === null || _h === void 0 ? void 0 : _h[toKey]))
|
|
18
|
+
? undefined
|
|
19
|
+
: [Number((_j = input.value) === null || _j === void 0 ? void 0 : _j[fromKey]), Number((_k = input.value) === null || _k === void 0 ? void 0 : _k[toKey])];
|
|
20
|
+
const defaultValue = isNaN(Number((_l = schema.default) === null || _l === void 0 ? void 0 : _l[fromKey])) || isNaN(Number((_m = schema.default) === null || _m === void 0 ? void 0 : _m[toKey]))
|
|
21
|
+
? undefined
|
|
22
|
+
: [Number((_o = schema.default) === null || _o === void 0 ? void 0 : _o[fromKey]), Number((_p = schema.default) === null || _p === void 0 ? void 0 : _p[toKey])];
|
|
23
|
+
const onUpdate = React.useCallback((next) => {
|
|
24
|
+
if (!Array.isArray(next)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
input.onChange({ [fromKey]: next[0], [toKey]: next[1] });
|
|
28
|
+
}, [fromKey, toKey, input.onChange]);
|
|
29
|
+
return (React.createElement(SliderBase, Object.assign({ className: b(), min: min, max: max, step: 1, marks: 2, disabled: schema.readOnly, tooltipDisplay: "on" }, restControlProps, { defaultValue: defaultValue, value: value, onFocus: input.onFocus, onBlur: input.onBlur, onUpdate: onUpdate, errorMessage: meta.error, validationState: getValidationState(meta), qa: input.name })));
|
|
30
|
+
};
|
|
31
|
+
export const RangeSlider = React.memo(Component);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RangeSlider, type RangeSliderProps } from './RangeSlider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RangeSlider } from './RangeSlider';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type SelectProps as SelectBaseProps } from '@gravity-ui/uikit';
|
|
3
|
+
import type { JsonSchemaString } from '../../../core';
|
|
4
|
+
export interface SelectProps extends Omit<SelectBaseProps, 'value' | 'onFocus' | 'onBlur' | 'onChange' | 'onUpdate' | 'onOpenChange' | 'multiple' | 'qa'> {
|
|
5
|
+
enumDescriptions?: Record<string, string>;
|
|
6
|
+
optionsMeta?: Record<string, string>;
|
|
7
|
+
options?: SelectBaseProps['options'];
|
|
8
|
+
}
|
|
9
|
+
export declare const Select: React.NamedExoticComponent<import("../../../core").ControlProps<JsonSchemaString<any>, SelectProps, {}>>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Flex, Select as SelectBase, Text, } from '@gravity-ui/uikit';
|
|
4
|
+
import isString from 'lodash/isString';
|
|
5
|
+
import { getValidationState } from '../../utils';
|
|
6
|
+
const Component = ({ controlProps, input, meta, schema }) => {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
const { enumDescriptions, optionsMeta } = controlProps, restControlProps = __rest(controlProps, ["enumDescriptions", "optionsMeta"]);
|
|
9
|
+
const value = React.useMemo(() => (isString(input.value) ? [input.value] : undefined), [input.value]);
|
|
10
|
+
const onUpdate = React.useCallback((v) => input.onChange(v[0]), [input.onChange]);
|
|
11
|
+
const options = React.useMemo(() => {
|
|
12
|
+
var _a;
|
|
13
|
+
return (_a = schema.enum) === null || _a === void 0 ? void 0 : _a.map((value) => {
|
|
14
|
+
const optionMeta = optionsMeta === null || optionsMeta === void 0 ? void 0 : optionsMeta[value];
|
|
15
|
+
const text = (enumDescriptions === null || enumDescriptions === void 0 ? void 0 : enumDescriptions[value]) || value;
|
|
16
|
+
let content = text;
|
|
17
|
+
if (optionMeta) {
|
|
18
|
+
content = (React.createElement(Flex, { direction: "column", gap: "0.5" },
|
|
19
|
+
React.createElement(Text, null, text),
|
|
20
|
+
React.createElement(Text, { color: "secondary" }, optionMeta)));
|
|
21
|
+
}
|
|
22
|
+
return { value, text, content, key: value, data: { optionMeta } };
|
|
23
|
+
});
|
|
24
|
+
}, [enumDescriptions, optionsMeta, schema.enum]);
|
|
25
|
+
const renderOption = React.useCallback((option) => (React.createElement(React.Fragment, { key: option.value }, option.content || option.text || option.value)), []);
|
|
26
|
+
const getOptionHeight = React.useCallback((option) => { var _a; return (((_a = option.data) === null || _a === void 0 ? void 0 : _a.optionMeta) ? 44 : 28); }, []);
|
|
27
|
+
return (React.createElement(SelectBase, Object.assign({ width: "max", options: options, filterable: (((_a = schema.enum) === null || _a === void 0 ? void 0 : _a.length) || 0) > 9, renderOption: renderOption, getOptionHeight: getOptionHeight, disabled: schema.readOnly }, restControlProps, { value: value, onFocus: input.onFocus, onBlur: input.onBlur, onUpdate: onUpdate, errorMessage: meta.error, validationState: getValidationState(meta), placeholder: (_b = schema.examples) === null || _b === void 0 ? void 0 : _b[0], qa: input.name })));
|
|
28
|
+
};
|
|
29
|
+
export const Select = React.memo(Component);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Select, type SelectProps } from './Select';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Select } from './Select';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type SliderProps as SliderBaseProps } from '@gravity-ui/uikit';
|
|
3
|
+
import type { JsonSchemaNumber } from '../../../core';
|
|
4
|
+
import './Slider.css';
|
|
5
|
+
export interface SliderProps extends Omit<SliderBaseProps, 'value' | 'onFocus' | 'onBlur' | 'onChange' | 'onUpdate' | 'errorMessage' | 'validationState' | 'qa'> {
|
|
6
|
+
}
|
|
7
|
+
export declare const Slider: React.NamedExoticComponent<import("../../../core").ControlProps<JsonSchemaNumber<any>, SliderProps, {}>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Slider as SliderBase } from '@gravity-ui/uikit';
|
|
3
|
+
import { block, getValidationState } from '../../utils';
|
|
4
|
+
import './Slider.css';
|
|
5
|
+
const b = block('slider');
|
|
6
|
+
const Component = ({ controlProps, input, meta, schema }) => {
|
|
7
|
+
const value = isNaN(Number(input.value)) ? undefined : Number(input.value);
|
|
8
|
+
const onUpdate = React.useCallback((next) => {
|
|
9
|
+
if (Array.isArray(next)) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
input.onChange(next);
|
|
13
|
+
}, [input.onChange]);
|
|
14
|
+
return (React.createElement(SliderBase, Object.assign({ className: b(), min: schema.minimum, max: schema.maximum, step: 1, marks: 2, disabled: schema.readOnly, tooltipDisplay: "on" }, controlProps, { value: value, onFocus: input.onFocus, onBlur: input.onBlur, onUpdate: onUpdate, errorMessage: meta.error, validationState: getValidationState(meta), qa: `${input.name}` })));
|
|
15
|
+
};
|
|
16
|
+
export const Slider = React.memo(Component);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Slider, type SliderProps } from './Slider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Slider } from './Slider';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type TextInputProps } from '@gravity-ui/uikit';
|
|
3
|
+
import type { JsonSchemaString } from '../../../core';
|
|
4
|
+
export interface StringBaseProps extends Omit<TextInputProps, 'type' | 'value' | 'onFocus' | 'onBlur' | 'onChange' | 'onUpdate' | 'errorMessage' | 'validationState' | 'placeholder' | 'qa'> {
|
|
5
|
+
}
|
|
6
|
+
export declare const StringBase: React.NamedExoticComponent<import("../../../core").ControlProps<JsonSchemaString<any>, StringBaseProps, {}>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextInput } from '@gravity-ui/uikit';
|
|
3
|
+
import { getValidationState } from '../../utils';
|
|
4
|
+
const Component = ({ controlProps, input, meta, schema, }) => {
|
|
5
|
+
var _a, _b;
|
|
6
|
+
return (React.createElement(TextInput, Object.assign({ hasClear: true, disabled: schema.readOnly }, controlProps, { value: (_a = input.value) !== null && _a !== void 0 ? _a : '', onFocus: input.onFocus, onBlur: input.onBlur, onUpdate: input.onChange, errorMessage: meta.error, validationState: getValidationState(meta), placeholder: (_b = schema.examples) === null || _b === void 0 ? void 0 : _b[0], qa: input.name, type: "text" })));
|
|
7
|
+
};
|
|
8
|
+
export const StringBase = React.memo(Component);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { StringBase, type StringBaseProps } from './StringBase';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { StringBase } from './StringBase';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type SwitchProps as SwitchBaseProps } from '@gravity-ui/uikit';
|
|
3
|
+
import type { JsonSchemaBoolean } from '../../../core';
|
|
4
|
+
import './Switch.css';
|
|
5
|
+
export interface SwitchProps extends Omit<SwitchBaseProps, 'checked' | 'onFocus' | 'onBlur' | 'onChange' | 'onUpdate' | 'qa'> {
|
|
6
|
+
}
|
|
7
|
+
export declare const Switch: React.NamedExoticComponent<import("../../../core").ControlProps<JsonSchemaBoolean<any>, SwitchProps, {}>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Switch as SwitchBase } from '@gravity-ui/uikit';
|
|
3
|
+
import { ControlError } from '../../components';
|
|
4
|
+
import { block, getValidationState } from '../../utils';
|
|
5
|
+
import './Switch.css';
|
|
6
|
+
const b = block('switch');
|
|
7
|
+
const Component = ({ controlProps, input, schema, meta, }) => {
|
|
8
|
+
var _a;
|
|
9
|
+
return (React.createElement(ControlError, { errorMessage: meta.error, validationState: getValidationState(meta) },
|
|
10
|
+
React.createElement("div", { className: b() },
|
|
11
|
+
React.createElement(SwitchBase, Object.assign({ disabled: schema.readOnly }, controlProps, { checked: (_a = input.value) !== null && _a !== void 0 ? _a : false, onFocus: input.onFocus, onBlur: input.onBlur, onUpdate: input.onChange, qa: input.name })))));
|
|
12
|
+
};
|
|
13
|
+
export const Switch = React.memo(Component);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Switch, type SwitchProps } from './Switch';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Switch } from './Switch';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type TextAreaProps as TextAreaBaseProps } from '@gravity-ui/uikit';
|
|
3
|
+
import type { JsonSchemaString } from '../../../core';
|
|
4
|
+
export interface TextAreaProps extends Omit<TextAreaBaseProps, 'value' | 'onFocus' | 'onBlur' | 'onChange' | 'onUpdate' | 'errorMessage' | 'validationState' | 'placeholder' | 'qa'> {
|
|
5
|
+
}
|
|
6
|
+
export declare const TextArea: React.NamedExoticComponent<import("../../../core").ControlProps<JsonSchemaString<any>, TextAreaProps, {}>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextArea as TextAreaBase } from '@gravity-ui/uikit';
|
|
3
|
+
import { getValidationState } from '../../utils';
|
|
4
|
+
const Component = ({ controlProps, input, meta, schema, }) => {
|
|
5
|
+
var _a, _b;
|
|
6
|
+
return (React.createElement(TextAreaBase, Object.assign({ maxRows: 20, minRows: 0, hasClear: true, disabled: schema.readOnly }, controlProps, { value: (_a = input.value) !== null && _a !== void 0 ? _a : '', onFocus: input.onFocus, onBlur: input.onBlur, onUpdate: input.onChange, errorMessage: meta.error, validationState: getValidationState(meta), placeholder: (_b = schema.examples) === null || _b === void 0 ? void 0 : _b[0], qa: input.name })));
|
|
7
|
+
};
|
|
8
|
+
export const TextArea = React.memo(Component);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TextArea, type TextAreaProps } from './TextArea';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TextArea } from './TextArea';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { ArrayBase, type ArrayBaseProps } from './ArrayBase';
|
|
2
|
+
export { Checkbox, type CheckboxProps } from './Checkbox';
|
|
3
|
+
export { CheckboxGroup, type CheckboxGroupProps } from './CheckboxGroup';
|
|
4
|
+
export { ColorPicker, type ColorPickerProps } from './ColorPicker';
|
|
5
|
+
export { DateInput, type DateInputProps } from './DateInput';
|
|
6
|
+
export { MultiSelect, type MultiSelectProps } from './MultiSelect';
|
|
7
|
+
export { NumberBase, type NumberBaseProps } from './NumberBase';
|
|
8
|
+
export { ObjectBase, type ObjectBaseProps } from './ObjectBase';
|
|
9
|
+
export { Password, type PasswordProps } from './Password';
|
|
10
|
+
export { RadioGroup, type RadioGroupProps } from './RadioGroup';
|
|
11
|
+
export { RangeSlider, type RangeSliderProps } from './RangeSlider';
|
|
12
|
+
export { Select, type SelectProps } from './Select';
|
|
13
|
+
export { Slider, type SliderProps } from './Slider';
|
|
14
|
+
export { StringBase, type StringBaseProps } from './StringBase';
|
|
15
|
+
export { Switch, type SwitchProps } from './Switch';
|
|
16
|
+
export { TextArea, type TextAreaProps } from './TextArea';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { ArrayBase } from './ArrayBase';
|
|
2
|
+
export { Checkbox } from './Checkbox';
|
|
3
|
+
export { CheckboxGroup } from './CheckboxGroup';
|
|
4
|
+
export { ColorPicker } from './ColorPicker';
|
|
5
|
+
export { DateInput } from './DateInput';
|
|
6
|
+
export { MultiSelect } from './MultiSelect';
|
|
7
|
+
export { NumberBase } from './NumberBase';
|
|
8
|
+
export { ObjectBase } from './ObjectBase';
|
|
9
|
+
export { Password } from './Password';
|
|
10
|
+
export { RadioGroup } from './RadioGroup';
|
|
11
|
+
export { RangeSlider } from './RangeSlider';
|
|
12
|
+
export { Select } from './Select';
|
|
13
|
+
export { Slider } from './Slider';
|
|
14
|
+
export { StringBase } from './StringBase';
|
|
15
|
+
export { Switch } from './Switch';
|
|
16
|
+
export { TextArea } from './TextArea';
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const block: import("@bem-react/classname").ClassNameInitilizer;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FormApi } from 'final-form';
|
|
2
|
+
import type { FieldMetaState } from 'react-final-form';
|
|
3
|
+
export declare const getValidationState: (meta: FieldMetaState<any>) => "invalid" | undefined;
|
|
4
|
+
export declare const getArrayItemParentName: (name: string) => string;
|
|
5
|
+
export declare const getArrayItemIndex: (name: string) => string;
|
|
6
|
+
export declare const isArrayItem: (name: string) => boolean;
|
|
7
|
+
export declare const isTupleItem: (name: string, form: FormApi) => boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const getValidationState = (meta) => {
|
|
2
|
+
if ((meta.touched || meta.submitFailed) && meta.error) {
|
|
3
|
+
return 'invalid';
|
|
4
|
+
}
|
|
5
|
+
return undefined;
|
|
6
|
+
};
|
|
7
|
+
export const getArrayItemParentName = (name) => name.slice(0, name.lastIndexOf('['));
|
|
8
|
+
export const getArrayItemIndex = (name) => name.slice(name.lastIndexOf('[') + 1, -1);
|
|
9
|
+
export const isArrayItem = (name) => name.endsWith(']');
|
|
10
|
+
export const isTupleItem = (name, form) => {
|
|
11
|
+
var _a;
|
|
12
|
+
if (!isArrayItem(name)) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
const parentName = getArrayItemParentName(name);
|
|
16
|
+
const parentField = form.getFieldState(parentName);
|
|
17
|
+
const parentSchema = (_a = parentField === null || parentField === void 0 ? void 0 : parentField.data) === null || _a === void 0 ? void 0 : _a.schema;
|
|
18
|
+
return Array.isArray(parentSchema === null || parentSchema === void 0 ? void 0 : parentSchema.items);
|
|
19
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.sr-row {
|
|
2
|
+
margin-bottom: calc(var(--g-spacing-base) * 4);
|
|
3
|
+
}
|
|
4
|
+
.sr-row:last-child {
|
|
5
|
+
margin-bottom: 0;
|
|
6
|
+
}
|
|
7
|
+
.sr-row__left {
|
|
8
|
+
display: inline;
|
|
9
|
+
width: 180px;
|
|
10
|
+
min-height: 28px;
|
|
11
|
+
padding-top: 5.5px;
|
|
12
|
+
}
|
|
13
|
+
.sr-row__title {
|
|
14
|
+
min-height: 18px;
|
|
15
|
+
margin-right: calc(var(--g-spacing-base) * 1);
|
|
16
|
+
}
|
|
17
|
+
.sr-row__title_required::after {
|
|
18
|
+
content: "*";
|
|
19
|
+
margin-left: calc(var(--g-spacing-base) * 1);
|
|
20
|
+
color: var(--g-color-text-danger);
|
|
21
|
+
}
|
|
22
|
+
.sr-row__right {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
flex-grow: 1;
|
|
26
|
+
gap: calc(var(--g-spacing-base) * 0.5);
|
|
27
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { JsonSchema } from '../../../core';
|
|
3
|
+
import './Row.css';
|
|
4
|
+
export interface RowProps {
|
|
5
|
+
descriptionType?: 'tooltip' | 'bottom';
|
|
6
|
+
}
|
|
7
|
+
export declare const Row: React.NamedExoticComponent<import("../../../core").WrapperProps<JsonSchema, RowProps>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Flex, HelpMark, Text } from '@gravity-ui/uikit';
|
|
3
|
+
import { ArrayRemoveButton, HTMLContent } from '../../components';
|
|
4
|
+
import { block } from '../../utils';
|
|
5
|
+
import './Row.css';
|
|
6
|
+
const b = block('row');
|
|
7
|
+
const Component = ({ children, input, schema, wrapperProps }) => {
|
|
8
|
+
const tooltip = React.useMemo(() => {
|
|
9
|
+
if (!schema.description || wrapperProps.descriptionType === 'bottom') {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
return (React.createElement(HelpMark, null,
|
|
13
|
+
React.createElement(HTMLContent, { html: schema.description })));
|
|
14
|
+
}, [schema.description, wrapperProps.descriptionType]);
|
|
15
|
+
const bottomDescription = React.useMemo(() => {
|
|
16
|
+
if (!schema.description || wrapperProps.descriptionType !== 'bottom') {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return React.createElement(HTMLContent, { html: schema.description, color: "secondary" });
|
|
20
|
+
}, [schema.description, wrapperProps.descriptionType]);
|
|
21
|
+
return (React.createElement(Flex, { className: b(), alignItems: "flex-start", gap: 2 },
|
|
22
|
+
React.createElement("div", { className: b('left') },
|
|
23
|
+
React.createElement(Text, { className: b('title', { required: wrapperProps.required }), wordBreak: "break-word" }, schema.title),
|
|
24
|
+
tooltip),
|
|
25
|
+
React.createElement("div", { className: b('right') },
|
|
26
|
+
React.createElement(Flex, { gap: 2 },
|
|
27
|
+
children,
|
|
28
|
+
React.createElement(ArrayRemoveButton, { name: input.name })),
|
|
29
|
+
bottomDescription)));
|
|
30
|
+
};
|
|
31
|
+
export const Row = React.memo(Component);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Row, type RowProps } from './Row';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Row } from './Row';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Flex } from '@gravity-ui/uikit';
|
|
3
|
+
import { ArrayRemoveButton } from '../../components';
|
|
4
|
+
import { block } from '../../utils';
|
|
5
|
+
import './Transparent.css';
|
|
6
|
+
const b = block('transparent');
|
|
7
|
+
const Component = ({ children, input }) => {
|
|
8
|
+
return (React.createElement(Flex, { className: b(), gap: 2 },
|
|
9
|
+
children,
|
|
10
|
+
React.createElement(ArrayRemoveButton, { name: input.name })));
|
|
11
|
+
};
|
|
12
|
+
export const Transparent = React.memo(Component);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Transparent } from './Transparent';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Transparent } from './Transparent';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/dynamic-forms",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.19.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "build/cjs/index.js",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"@gravity-ui/date-utils": "^2.5.5",
|
|
50
50
|
"@gravity-ui/i18n": "^1.2.0",
|
|
51
51
|
"@gravity-ui/icons": "^2.12.0",
|
|
52
|
+
"ajv": "^8.20.0",
|
|
52
53
|
"lodash": "^4.17.20"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
@@ -80,7 +81,6 @@
|
|
|
80
81
|
"@types/react-is": "^17.0.3",
|
|
81
82
|
"@types/uuid": "^9.0.4",
|
|
82
83
|
"@vitejs/plugin-react": "^4.2.0",
|
|
83
|
-
"ajv": "^8.20.0",
|
|
84
84
|
"css-loader": "^5.2.6",
|
|
85
85
|
"eslint": "^8.49.0",
|
|
86
86
|
"final-form": "^4.20.2",
|
|
@@ -133,5 +133,27 @@
|
|
|
133
133
|
"*.md": [
|
|
134
134
|
"prettier --write"
|
|
135
135
|
]
|
|
136
|
+
},
|
|
137
|
+
"exports": {
|
|
138
|
+
".": {
|
|
139
|
+
"import": {
|
|
140
|
+
"types": "./build/esm/index.d.ts",
|
|
141
|
+
"default": "./build/esm/index.js"
|
|
142
|
+
},
|
|
143
|
+
"require": {
|
|
144
|
+
"types": "./build/cjs/index.d.ts",
|
|
145
|
+
"default": "./build/cjs/index.js"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"./unstable": {
|
|
149
|
+
"import": {
|
|
150
|
+
"types": "./build/esm/unstable.d.ts",
|
|
151
|
+
"default": "./build/esm/unstable.js"
|
|
152
|
+
},
|
|
153
|
+
"require": {
|
|
154
|
+
"types": "./build/cjs/unstable.d.ts",
|
|
155
|
+
"default": "./build/cjs/unstable.js"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
136
158
|
}
|
|
137
159
|
}
|