@gravity-ui/dynamic-forms 5.19.1 → 5.20.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/index.d.ts +1 -0
- package/build/cjs/lib/unstable/core/Entity/index.js +3 -1
- package/build/cjs/lib/unstable/core/index.d.ts +2 -2
- package/build/cjs/lib/unstable/core/index.js +3 -1
- package/build/cjs/lib/unstable/kit/components/ArrayRemoveButton/ArrayRemoveButton.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/components/ArrayRemoveButton/ArrayRemoveButton.js +12 -5
- package/build/cjs/lib/unstable/kit/components/ControlContainer/ControlContainer.css +20 -0
- package/build/cjs/lib/unstable/kit/components/ControlContainer/ControlContainer.d.ts +7 -0
- package/build/cjs/lib/unstable/kit/components/ControlContainer/ControlContainer.js +14 -0
- package/build/cjs/lib/unstable/kit/components/ControlContainer/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/components/ControlContainer/index.js +5 -0
- package/build/cjs/lib/unstable/kit/components/ControlError/ControlError.css +2 -32
- package/build/cjs/lib/unstable/kit/components/ControlError/ControlError.d.ts +0 -2
- package/build/cjs/lib/unstable/kit/components/ControlError/ControlError.js +5 -5
- package/build/cjs/lib/unstable/kit/components/WrapperContainer/WrapperContainer.css +8 -0
- package/build/cjs/lib/unstable/kit/components/WrapperContainer/WrapperContainer.d.ts +6 -0
- package/build/cjs/lib/unstable/kit/components/WrapperContainer/WrapperContainer.js +13 -0
- package/build/cjs/lib/unstable/kit/components/WrapperContainer/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/components/WrapperContainer/index.js +5 -0
- package/build/cjs/lib/unstable/kit/components/index.d.ts +2 -0
- package/build/cjs/lib/unstable/kit/components/index.js +5 -1
- package/build/cjs/lib/unstable/kit/constants/config.d.ts +43 -0
- package/build/cjs/lib/unstable/kit/constants/config.js +45 -6
- package/build/cjs/lib/unstable/kit/controls/Alert/Alert.d.ts +9 -0
- package/build/cjs/lib/unstable/kit/controls/Alert/Alert.js +27 -0
- package/build/cjs/lib/unstable/kit/controls/Alert/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/Alert/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/ArrayBase/ArrayBase.js +20 -17
- package/build/cjs/lib/unstable/kit/controls/ArrayTable/ArrayTable.css +39 -0
- package/build/cjs/lib/unstable/kit/controls/ArrayTable/ArrayTable.d.ts +8 -0
- package/build/cjs/lib/unstable/kit/controls/ArrayTable/ArrayTable.js +88 -0
- package/build/cjs/lib/unstable/kit/controls/ArrayTable/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/ArrayTable/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/Checkbox/Checkbox.css +7 -1
- package/build/cjs/lib/unstable/kit/controls/Checkbox/Checkbox.d.ts +2 -2
- package/build/cjs/lib/unstable/kit/controls/Checkbox/Checkbox.js +8 -4
- package/build/cjs/lib/unstable/kit/controls/CheckboxGroup/CheckboxGroup.css +8 -2
- package/build/cjs/lib/unstable/kit/controls/CheckboxGroup/CheckboxGroup.js +11 -6
- package/build/cjs/lib/unstable/kit/controls/ColorPicker/ColorPicker.css +6 -0
- package/build/cjs/lib/unstable/kit/controls/ColorPicker/ColorPicker.d.ts +2 -2
- package/build/cjs/lib/unstable/kit/controls/ColorPicker/ColorPicker.js +7 -6
- package/build/cjs/lib/unstable/kit/controls/DateInput/DateInput.css +2 -2
- package/build/cjs/lib/unstable/kit/controls/DateInput/DateInput.d.ts +2 -2
- package/build/cjs/lib/unstable/kit/controls/DateInput/DateInput.js +14 -13
- package/build/cjs/lib/unstable/kit/controls/DotValue/DotValue.d.ts +5 -0
- package/build/cjs/lib/unstable/kit/controls/DotValue/DotValue.js +30 -0
- package/build/cjs/lib/unstable/kit/controls/DotValue/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/DotValue/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/FewOfNested/FewOfNested.css +14 -0
- package/build/cjs/lib/unstable/kit/controls/FewOfNested/FewOfNested.d.ts +8 -0
- package/build/cjs/lib/unstable/kit/controls/FewOfNested/FewOfNested.js +63 -0
- package/build/cjs/lib/unstable/kit/controls/FewOfNested/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/FewOfNested/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/FileInput/FileInput.d.ts +7 -0
- package/build/cjs/lib/unstable/kit/controls/FileInput/FileInput.js +53 -0
- package/build/cjs/lib/unstable/kit/controls/FileInput/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/FileInput/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/Label/Label.d.ts +9 -0
- package/build/cjs/lib/unstable/kit/controls/Label/Label.js +28 -0
- package/build/cjs/lib/unstable/kit/controls/Label/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/Label/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/MultiSelect/MultiSelect.d.ts +2 -2
- package/build/cjs/lib/unstable/kit/controls/MultiSelect/MultiSelect.js +5 -2
- package/build/cjs/lib/unstable/kit/controls/NumberBase/NumberBase.css +3 -0
- package/build/{esm/lib/unstable/kit/controls/NumberBase/Number.d.ts → cjs/lib/unstable/kit/controls/NumberBase/NumberBase.d.ts} +1 -1
- package/build/cjs/lib/unstable/kit/controls/NumberBase/NumberBase.js +16 -0
- package/build/cjs/lib/unstable/kit/controls/NumberBase/index.d.ts +1 -1
- package/build/cjs/lib/unstable/kit/controls/NumberBase/index.js +2 -2
- package/build/cjs/lib/unstable/kit/controls/ObjectBase/ObjectBase.d.ts +0 -1
- package/build/cjs/lib/unstable/kit/controls/ObjectBase/ObjectBase.js +6 -24
- package/build/cjs/lib/unstable/kit/controls/ObjectInline/ObjectInline.css +8 -0
- package/build/cjs/lib/unstable/kit/controls/ObjectInline/ObjectInline.d.ts +8 -0
- package/build/cjs/lib/unstable/kit/controls/ObjectInline/ObjectInline.js +25 -0
- package/build/cjs/lib/unstable/kit/controls/ObjectInline/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/ObjectInline/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/OneOfNested/OneOfNested.css +14 -0
- package/build/cjs/lib/unstable/kit/controls/OneOfNested/OneOfNested.d.ts +12 -0
- package/build/cjs/lib/unstable/kit/controls/OneOfNested/OneOfNested.js +64 -0
- package/build/cjs/lib/unstable/kit/controls/OneOfNested/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/OneOfNested/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/Password/Password.css +3 -0
- package/build/cjs/lib/unstable/kit/controls/Password/Password.d.ts +1 -1
- package/build/cjs/lib/unstable/kit/controls/Password/Password.js +6 -2
- package/build/cjs/lib/unstable/kit/controls/RadioGroup/RadioGroup.css +12 -2
- package/build/cjs/lib/unstable/kit/controls/RadioGroup/RadioGroup.d.ts +2 -2
- package/build/cjs/lib/unstable/kit/controls/RadioGroup/RadioGroup.js +4 -4
- package/build/cjs/lib/unstable/kit/controls/RangeSlider/RangeSlider.d.ts +2 -2
- package/build/cjs/lib/unstable/kit/controls/RangeSlider/RangeSlider.js +11 -9
- package/build/cjs/lib/unstable/kit/controls/SegmentedRadioGroup/SegmentedRadioGroup.css +6 -0
- package/build/cjs/lib/unstable/kit/controls/SegmentedRadioGroup/SegmentedRadioGroup.d.ts +8 -0
- package/build/cjs/lib/unstable/kit/controls/SegmentedRadioGroup/SegmentedRadioGroup.js +29 -0
- package/build/cjs/lib/unstable/kit/controls/SegmentedRadioGroup/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/SegmentedRadioGroup/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/Select/Select.d.ts +3 -3
- package/build/cjs/lib/unstable/kit/controls/Select/Select.js +6 -3
- package/build/cjs/lib/unstable/kit/controls/Slider/Slider.d.ts +2 -2
- package/build/cjs/lib/unstable/kit/controls/Slider/Slider.js +7 -5
- package/build/cjs/lib/unstable/kit/controls/StringBase/StringBase.css +3 -0
- package/build/cjs/lib/unstable/kit/controls/StringBase/StringBase.d.ts +1 -1
- package/build/cjs/lib/unstable/kit/controls/StringBase/StringBase.js +4 -1
- package/build/cjs/lib/unstable/kit/controls/Switch/Switch.css +8 -2
- package/build/cjs/lib/unstable/kit/controls/Switch/Switch.d.ts +2 -2
- package/build/cjs/lib/unstable/kit/controls/Switch/Switch.js +8 -4
- package/build/cjs/lib/unstable/kit/controls/TextArea/TextArea.css +3 -0
- package/build/cjs/lib/unstable/kit/controls/TextArea/TextArea.d.ts +2 -2
- package/build/cjs/lib/unstable/kit/controls/TextArea/TextArea.js +4 -1
- package/build/cjs/lib/unstable/kit/controls/TextContent/TextContent.css +10 -0
- package/build/cjs/lib/unstable/kit/controls/TextContent/TextContent.d.ts +9 -0
- package/build/cjs/lib/unstable/kit/controls/TextContent/TextContent.js +29 -0
- package/build/cjs/lib/unstable/kit/controls/TextContent/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/TextContent/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/index.d.ts +10 -0
- package/build/cjs/lib/unstable/kit/controls/index.js +21 -1
- package/build/cjs/lib/unstable/kit/utils/common.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/utils/common.js +5 -1
- package/build/cjs/lib/unstable/kit/utils/index.d.ts +1 -1
- package/build/cjs/lib/unstable/kit/utils/index.js +2 -1
- package/build/cjs/lib/unstable/kit/wrappers/Accordeon/Accordeon.css +35 -0
- package/build/cjs/lib/unstable/kit/wrappers/Accordeon/Accordeon.d.ts +10 -0
- package/build/cjs/lib/unstable/kit/wrappers/Accordeon/Accordeon.js +39 -0
- package/build/cjs/lib/unstable/kit/wrappers/Accordeon/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/wrappers/Accordeon/index.js +5 -0
- package/build/cjs/lib/unstable/kit/wrappers/Row/Row.css +3 -6
- package/build/cjs/lib/unstable/kit/wrappers/Row/Row.js +7 -6
- package/build/cjs/lib/unstable/kit/wrappers/Section/Section.css +23 -0
- package/build/cjs/lib/unstable/kit/wrappers/Section/Section.d.ts +8 -0
- package/build/cjs/lib/unstable/kit/wrappers/Section/Section.js +36 -0
- package/build/cjs/lib/unstable/kit/wrappers/Section/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/wrappers/Section/index.js +5 -0
- package/build/cjs/lib/unstable/kit/wrappers/Transparent/Transparent.js +6 -4
- package/build/cjs/lib/unstable/kit/wrappers/index.d.ts +2 -0
- package/build/cjs/lib/unstable/kit/wrappers/index.js +5 -1
- package/build/esm/lib/unstable/core/Entity/index.d.ts +1 -0
- package/build/esm/lib/unstable/core/Entity/index.js +1 -0
- package/build/esm/lib/unstable/core/index.d.ts +2 -2
- package/build/esm/lib/unstable/core/index.js +2 -2
- package/build/esm/lib/unstable/kit/components/ArrayRemoveButton/ArrayRemoveButton.d.ts +1 -0
- package/build/esm/lib/unstable/kit/components/ArrayRemoveButton/ArrayRemoveButton.js +12 -5
- package/build/esm/lib/unstable/kit/components/ControlContainer/ControlContainer.css +20 -0
- package/build/esm/lib/unstable/kit/components/ControlContainer/ControlContainer.d.ts +8 -0
- package/build/esm/lib/unstable/kit/components/ControlContainer/ControlContainer.js +12 -0
- package/build/esm/lib/unstable/kit/components/ControlContainer/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/components/ControlContainer/index.js +1 -0
- package/build/esm/lib/unstable/kit/components/ControlError/ControlError.css +2 -32
- package/build/esm/lib/unstable/kit/components/ControlError/ControlError.d.ts +0 -2
- package/build/esm/lib/unstable/kit/components/ControlError/ControlError.js +6 -6
- package/build/esm/lib/unstable/kit/components/WrapperContainer/WrapperContainer.css +8 -0
- package/build/esm/lib/unstable/kit/components/WrapperContainer/WrapperContainer.d.ts +7 -0
- package/build/esm/lib/unstable/kit/components/WrapperContainer/WrapperContainer.js +11 -0
- package/build/esm/lib/unstable/kit/components/WrapperContainer/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/components/WrapperContainer/index.js +1 -0
- package/build/esm/lib/unstable/kit/components/index.d.ts +2 -0
- package/build/esm/lib/unstable/kit/components/index.js +2 -0
- package/build/esm/lib/unstable/kit/constants/config.d.ts +43 -0
- package/build/esm/lib/unstable/kit/constants/config.js +47 -8
- package/build/esm/lib/unstable/kit/controls/Alert/Alert.d.ts +9 -0
- package/build/esm/lib/unstable/kit/controls/Alert/Alert.js +24 -0
- package/build/esm/lib/unstable/kit/controls/Alert/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/Alert/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/ArrayBase/ArrayBase.js +21 -18
- package/build/esm/lib/unstable/kit/controls/ArrayTable/ArrayTable.css +39 -0
- package/build/esm/lib/unstable/kit/controls/ArrayTable/ArrayTable.d.ts +9 -0
- package/build/esm/lib/unstable/kit/controls/ArrayTable/ArrayTable.js +85 -0
- package/build/esm/lib/unstable/kit/controls/ArrayTable/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/ArrayTable/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/Checkbox/Checkbox.css +7 -1
- package/build/esm/lib/unstable/kit/controls/Checkbox/Checkbox.d.ts +2 -2
- package/build/esm/lib/unstable/kit/controls/Checkbox/Checkbox.js +11 -7
- package/build/esm/lib/unstable/kit/controls/CheckboxGroup/CheckboxGroup.css +8 -2
- package/build/esm/lib/unstable/kit/controls/CheckboxGroup/CheckboxGroup.js +13 -8
- package/build/esm/lib/unstable/kit/controls/ColorPicker/ColorPicker.css +6 -0
- package/build/esm/lib/unstable/kit/controls/ColorPicker/ColorPicker.d.ts +3 -2
- package/build/esm/lib/unstable/kit/controls/ColorPicker/ColorPicker.js +11 -9
- package/build/esm/lib/unstable/kit/controls/DateInput/DateInput.css +2 -2
- package/build/esm/lib/unstable/kit/controls/DateInput/DateInput.d.ts +2 -2
- package/build/esm/lib/unstable/kit/controls/DateInput/DateInput.js +16 -15
- package/build/esm/lib/unstable/kit/controls/DotValue/DotValue.d.ts +5 -0
- package/build/esm/lib/unstable/kit/controls/DotValue/DotValue.js +26 -0
- package/build/esm/lib/unstable/kit/controls/DotValue/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/DotValue/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/FewOfNested/FewOfNested.css +14 -0
- package/build/esm/lib/unstable/kit/controls/FewOfNested/FewOfNested.d.ts +9 -0
- package/build/esm/lib/unstable/kit/controls/FewOfNested/FewOfNested.js +60 -0
- package/build/esm/lib/unstable/kit/controls/FewOfNested/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/FewOfNested/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/FileInput/FileInput.d.ts +7 -0
- package/build/esm/lib/unstable/kit/controls/FileInput/FileInput.js +50 -0
- package/build/esm/lib/unstable/kit/controls/FileInput/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/FileInput/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/Label/Label.d.ts +9 -0
- package/build/esm/lib/unstable/kit/controls/Label/Label.js +25 -0
- package/build/esm/lib/unstable/kit/controls/Label/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/Label/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/MultiSelect/MultiSelect.d.ts +2 -2
- package/build/esm/lib/unstable/kit/controls/MultiSelect/MultiSelect.js +6 -3
- package/build/esm/lib/unstable/kit/controls/NumberBase/NumberBase.css +3 -0
- package/build/{cjs/lib/unstable/kit/controls/NumberBase/Number.d.ts → esm/lib/unstable/kit/controls/NumberBase/NumberBase.d.ts} +2 -1
- package/build/esm/lib/unstable/kit/controls/NumberBase/NumberBase.js +13 -0
- package/build/esm/lib/unstable/kit/controls/NumberBase/index.d.ts +1 -1
- package/build/esm/lib/unstable/kit/controls/NumberBase/index.js +1 -1
- package/build/esm/lib/unstable/kit/controls/ObjectBase/ObjectBase.d.ts +0 -1
- package/build/esm/lib/unstable/kit/controls/ObjectBase/ObjectBase.js +7 -25
- package/build/esm/lib/unstable/kit/controls/ObjectInline/ObjectInline.css +8 -0
- package/build/esm/lib/unstable/kit/controls/ObjectInline/ObjectInline.d.ts +9 -0
- package/build/esm/lib/unstable/kit/controls/ObjectInline/ObjectInline.js +22 -0
- package/build/esm/lib/unstable/kit/controls/ObjectInline/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/ObjectInline/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/OneOfNested/OneOfNested.css +14 -0
- package/build/esm/lib/unstable/kit/controls/OneOfNested/OneOfNested.d.ts +13 -0
- package/build/esm/lib/unstable/kit/controls/OneOfNested/OneOfNested.js +61 -0
- package/build/esm/lib/unstable/kit/controls/OneOfNested/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/OneOfNested/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/Password/Password.css +3 -0
- package/build/esm/lib/unstable/kit/controls/Password/Password.d.ts +2 -1
- package/build/esm/lib/unstable/kit/controls/Password/Password.js +8 -3
- package/build/esm/lib/unstable/kit/controls/RadioGroup/RadioGroup.css +12 -2
- package/build/esm/lib/unstable/kit/controls/RadioGroup/RadioGroup.d.ts +2 -2
- package/build/esm/lib/unstable/kit/controls/RadioGroup/RadioGroup.js +7 -7
- package/build/esm/lib/unstable/kit/controls/RangeSlider/RangeSlider.d.ts +2 -3
- package/build/esm/lib/unstable/kit/controls/RangeSlider/RangeSlider.js +13 -12
- package/build/esm/lib/unstable/kit/controls/SegmentedRadioGroup/SegmentedRadioGroup.css +6 -0
- package/build/esm/lib/unstable/kit/controls/SegmentedRadioGroup/SegmentedRadioGroup.d.ts +9 -0
- package/build/esm/lib/unstable/kit/controls/SegmentedRadioGroup/SegmentedRadioGroup.js +27 -0
- package/build/esm/lib/unstable/kit/controls/SegmentedRadioGroup/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/SegmentedRadioGroup/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/Select/Select.d.ts +3 -3
- package/build/esm/lib/unstable/kit/controls/Select/Select.js +7 -4
- package/build/esm/lib/unstable/kit/controls/Slider/Slider.d.ts +2 -3
- package/build/esm/lib/unstable/kit/controls/Slider/Slider.js +9 -8
- package/build/esm/lib/unstable/kit/controls/StringBase/StringBase.css +3 -0
- package/build/esm/lib/unstable/kit/controls/StringBase/StringBase.d.ts +2 -1
- package/build/esm/lib/unstable/kit/controls/StringBase/StringBase.js +6 -2
- package/build/esm/lib/unstable/kit/controls/Switch/Switch.css +8 -2
- package/build/esm/lib/unstable/kit/controls/Switch/Switch.d.ts +2 -2
- package/build/esm/lib/unstable/kit/controls/Switch/Switch.js +11 -7
- package/build/esm/lib/unstable/kit/controls/TextArea/TextArea.css +3 -0
- package/build/esm/lib/unstable/kit/controls/TextArea/TextArea.d.ts +3 -2
- package/build/esm/lib/unstable/kit/controls/TextArea/TextArea.js +7 -3
- package/build/esm/lib/unstable/kit/controls/TextContent/TextContent.css +10 -0
- package/build/esm/lib/unstable/kit/controls/TextContent/TextContent.d.ts +10 -0
- package/build/esm/lib/unstable/kit/controls/TextContent/TextContent.js +27 -0
- package/build/esm/lib/unstable/kit/controls/TextContent/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/TextContent/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/index.d.ts +10 -0
- package/build/esm/lib/unstable/kit/controls/index.js +10 -0
- package/build/esm/lib/unstable/kit/utils/common.d.ts +1 -0
- package/build/esm/lib/unstable/kit/utils/common.js +3 -0
- package/build/esm/lib/unstable/kit/utils/index.d.ts +1 -1
- package/build/esm/lib/unstable/kit/utils/index.js +1 -1
- package/build/esm/lib/unstable/kit/wrappers/Accordeon/Accordeon.css +35 -0
- package/build/esm/lib/unstable/kit/wrappers/Accordeon/Accordeon.d.ts +11 -0
- package/build/esm/lib/unstable/kit/wrappers/Accordeon/Accordeon.js +37 -0
- package/build/esm/lib/unstable/kit/wrappers/Accordeon/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/wrappers/Accordeon/index.js +1 -0
- package/build/esm/lib/unstable/kit/wrappers/Row/Row.css +3 -6
- package/build/esm/lib/unstable/kit/wrappers/Row/Row.js +9 -8
- package/build/esm/lib/unstable/kit/wrappers/Section/Section.css +23 -0
- package/build/esm/lib/unstable/kit/wrappers/Section/Section.d.ts +9 -0
- package/build/esm/lib/unstable/kit/wrappers/Section/Section.js +34 -0
- package/build/esm/lib/unstable/kit/wrappers/Section/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/wrappers/Section/index.js +1 -0
- package/build/esm/lib/unstable/kit/wrappers/Transparent/Transparent.js +8 -6
- package/build/esm/lib/unstable/kit/wrappers/index.d.ts +2 -0
- package/build/esm/lib/unstable/kit/wrappers/index.js +2 -0
- package/package.json +1 -1
- package/build/cjs/lib/unstable/kit/Accordeon.d.ts +0 -3
- package/build/cjs/lib/unstable/kit/Accordeon.js +0 -31
- package/build/cjs/lib/unstable/kit/Any.d.ts +0 -2
- package/build/cjs/lib/unstable/kit/Any.js +0 -21
- package/build/cjs/lib/unstable/kit/ArrayBase.css +0 -23
- package/build/cjs/lib/unstable/kit/ArrayBase.d.ts +0 -2
- package/build/cjs/lib/unstable/kit/ArrayBase.js +0 -101
- package/build/cjs/lib/unstable/kit/MultiSelect.css +0 -6
- package/build/cjs/lib/unstable/kit/MultiSelect.d.ts +0 -6
- package/build/cjs/lib/unstable/kit/MultiSelect.js +0 -66
- package/build/cjs/lib/unstable/kit/ObjectBase.css +0 -10
- package/build/cjs/lib/unstable/kit/ObjectBase.d.ts +0 -7
- package/build/cjs/lib/unstable/kit/ObjectBase.js +0 -71
- package/build/cjs/lib/unstable/kit/Row.css +0 -73
- package/build/cjs/lib/unstable/kit/Row.d.ts +0 -10
- package/build/cjs/lib/unstable/kit/Row.js +0 -50
- package/build/cjs/lib/unstable/kit/Text.d.ts +0 -6
- package/build/cjs/lib/unstable/kit/Text.js +0 -259
- package/build/cjs/lib/unstable/kit/config.d.ts +0 -95
- package/build/cjs/lib/unstable/kit/config.js +0 -68
- package/build/cjs/lib/unstable/kit/controls/NumberBase/Number.js +0 -12
- package/build/cjs/lib/unstable/kit/controls/RangeSlider/RangeSlider.css +0 -3
- package/build/cjs/lib/unstable/kit/controls/Slider/Slider.css +0 -3
- package/build/esm/lib/unstable/kit/Accordeon.d.ts +0 -3
- package/build/esm/lib/unstable/kit/Accordeon.js +0 -26
- package/build/esm/lib/unstable/kit/Any.d.ts +0 -2
- package/build/esm/lib/unstable/kit/Any.js +0 -16
- package/build/esm/lib/unstable/kit/ArrayBase.css +0 -23
- package/build/esm/lib/unstable/kit/ArrayBase.d.ts +0 -3
- package/build/esm/lib/unstable/kit/ArrayBase.js +0 -97
- package/build/esm/lib/unstable/kit/MultiSelect.css +0 -6
- package/build/esm/lib/unstable/kit/MultiSelect.d.ts +0 -7
- package/build/esm/lib/unstable/kit/MultiSelect.js +0 -62
- package/build/esm/lib/unstable/kit/ObjectBase.css +0 -10
- package/build/esm/lib/unstable/kit/ObjectBase.d.ts +0 -8
- package/build/esm/lib/unstable/kit/ObjectBase.js +0 -66
- package/build/esm/lib/unstable/kit/Row.css +0 -73
- package/build/esm/lib/unstable/kit/Row.d.ts +0 -11
- package/build/esm/lib/unstable/kit/Row.js +0 -47
- package/build/esm/lib/unstable/kit/Text.d.ts +0 -6
- package/build/esm/lib/unstable/kit/Text.js +0 -255
- package/build/esm/lib/unstable/kit/config.d.ts +0 -95
- package/build/esm/lib/unstable/kit/config.js +0 -65
- package/build/esm/lib/unstable/kit/controls/NumberBase/Number.js +0 -8
- package/build/esm/lib/unstable/kit/controls/RangeSlider/RangeSlider.css +0 -3
- package/build/esm/lib/unstable/kit/controls/Slider/Slider.css +0 -3
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
.sr-array-table__row {
|
|
2
|
+
width: 100%;
|
|
3
|
+
display: grid;
|
|
4
|
+
align-items: start;
|
|
5
|
+
grid-template-columns: 28px repeat(var(--columns-count), 1fr);
|
|
6
|
+
gap: calc(var(--g-spacing-base) * 3);
|
|
7
|
+
padding: calc(var(--g-spacing-base) * 2) 0;
|
|
8
|
+
border-bottom: 1px solid var(--g-color-line-generic);
|
|
9
|
+
}
|
|
10
|
+
.sr-array-table__row_head {
|
|
11
|
+
align-items: center;
|
|
12
|
+
}
|
|
13
|
+
.sr-array-table__row_with-remove-button {
|
|
14
|
+
grid-template-columns: 28px repeat(var(--columns-count), 1fr) 28px;
|
|
15
|
+
}
|
|
16
|
+
.sr-array-table__row:last-of-type {
|
|
17
|
+
border-bottom: none;
|
|
18
|
+
}
|
|
19
|
+
.sr-array-table__cell {
|
|
20
|
+
width: 100%;
|
|
21
|
+
min-height: 28px;
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
}
|
|
25
|
+
.sr-array-table__index {
|
|
26
|
+
margin: 0 auto;
|
|
27
|
+
}
|
|
28
|
+
.sr-array-table__column-title {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
gap: 0 calc(var(--g-spacing-base) * 0.5);
|
|
32
|
+
flex-wrap: wrap;
|
|
33
|
+
}
|
|
34
|
+
.sr-array-table__column-title-word {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
gap: 0 calc(var(--g-spacing-base) * 1);
|
|
38
|
+
flex-wrap: wrap;
|
|
39
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type JsonSchemaArray } from '../../../core';
|
|
3
|
+
export interface ArrayTableProps {
|
|
4
|
+
order?: string[];
|
|
5
|
+
addButtonText?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const ArrayTable: React.NamedExoticComponent<import("../../../core").ControlProps<JsonSchemaArray<any>, ArrayTableProps, {}>>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArrayTable = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const icons_1 = require("@gravity-ui/icons");
|
|
7
|
+
const uikit_1 = require("@gravity-ui/uikit");
|
|
8
|
+
const core_1 = require("../../../core");
|
|
9
|
+
const components_1 = require("../../components");
|
|
10
|
+
const utils_1 = require("../../utils");
|
|
11
|
+
const b = (0, utils_1.block)('array-table');
|
|
12
|
+
const Component = ({ controlProps, input, schema }) => {
|
|
13
|
+
const { name, onBlur, onChange, onFocus, value } = input;
|
|
14
|
+
const addButton = react_1.default.useMemo(() => {
|
|
15
|
+
const itemsSchema = schema.items;
|
|
16
|
+
if (Array.isArray(itemsSchema)) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
const onClick = () => {
|
|
20
|
+
onFocus();
|
|
21
|
+
onChange([...(value || []), itemsSchema === null || itemsSchema === void 0 ? void 0 : itemsSchema.default]);
|
|
22
|
+
onBlur();
|
|
23
|
+
};
|
|
24
|
+
return (react_1.default.createElement(uikit_1.Button, { onClick: onClick, disabled: controlProps.disabled || schema.readOnly, qa: `${name}-add-button` },
|
|
25
|
+
react_1.default.createElement(uikit_1.Icon, { data: icons_1.Plus, size: 14 }),
|
|
26
|
+
controlProps.addButtonText || null));
|
|
27
|
+
}, [
|
|
28
|
+
controlProps.addButtonText,
|
|
29
|
+
controlProps.disabled,
|
|
30
|
+
name,
|
|
31
|
+
onBlur,
|
|
32
|
+
onChange,
|
|
33
|
+
onFocus,
|
|
34
|
+
schema.items,
|
|
35
|
+
schema.readOnly,
|
|
36
|
+
value,
|
|
37
|
+
]);
|
|
38
|
+
const columns = react_1.default.useMemo(() => {
|
|
39
|
+
const columns = [];
|
|
40
|
+
const itemsSchema = schema.items;
|
|
41
|
+
if (itemsSchema) {
|
|
42
|
+
const itemSchema = Array.isArray(itemsSchema) ? itemsSchema[0] : itemsSchema;
|
|
43
|
+
if ('properties' in itemSchema &&
|
|
44
|
+
itemSchema.properties &&
|
|
45
|
+
Object.keys(itemSchema.properties).length > 0) {
|
|
46
|
+
const properties = itemSchema.properties;
|
|
47
|
+
(controlProps.order || Object.keys(properties)).forEach((columnKey) => {
|
|
48
|
+
columns.push({ name: columnKey, schema: properties[columnKey] || {} });
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
columns.push({ name: undefined, schema: itemSchema });
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return columns;
|
|
56
|
+
}, [controlProps.order, schema.items]);
|
|
57
|
+
const { head, rows } = react_1.default.useMemo(() => {
|
|
58
|
+
let rowsCount = value === null || value === void 0 ? void 0 : value.length;
|
|
59
|
+
let withRemoveButton = true;
|
|
60
|
+
if (Array.isArray(schema.items)) {
|
|
61
|
+
rowsCount = schema.items.length;
|
|
62
|
+
withRemoveButton = false;
|
|
63
|
+
}
|
|
64
|
+
const head = (react_1.default.createElement("div", { className: b('row', { 'with-remove-button': withRemoveButton }), style: { '--columns-count': columns.length } },
|
|
65
|
+
react_1.default.createElement("div", { className: b('cell') },
|
|
66
|
+
react_1.default.createElement(uikit_1.Text, { className: b('index'), variant: "subheader-1" }, "#")),
|
|
67
|
+
columns.map((column, cIndex) => {
|
|
68
|
+
var _a;
|
|
69
|
+
return (react_1.default.createElement("div", { className: b('cell'), key: cIndex },
|
|
70
|
+
react_1.default.createElement("div", { className: b('column-title') }, (_a = column.schema.title) === null || _a === void 0 ? void 0 : _a.split(' ').map((word, wIndex, array) => (react_1.default.createElement("div", { className: b('column-title-word'), key: word },
|
|
71
|
+
react_1.default.createElement(uikit_1.Text, { variant: "subheader-1" }, word),
|
|
72
|
+
wIndex + 1 === array.length && column.schema.description ? (react_1.default.createElement(uikit_1.HelpMark, null, column.schema.description)) : null))))));
|
|
73
|
+
})));
|
|
74
|
+
const rows = new Array(rowsCount).fill(null).map((_, rIndex) => (react_1.default.createElement("div", { className: b('row', { 'with-remove-button': withRemoveButton }), style: { '--columns-count': columns.length }, key: rIndex },
|
|
75
|
+
react_1.default.createElement("div", { className: b('cell') },
|
|
76
|
+
react_1.default.createElement(uikit_1.Text, { className: b('index'), variant: "subheader-1" }, rIndex + 1)),
|
|
77
|
+
columns.map((column, cIndex) => (react_1.default.createElement("div", { className: b('cell'), key: cIndex },
|
|
78
|
+
react_1.default.createElement(core_1.Entity, { name: `${name}[${rIndex}]${column.name === undefined ? '' : `.${column.name}`}`, schema: column.schema })))),
|
|
79
|
+
withRemoveButton ? (react_1.default.createElement("div", { className: b('cell') },
|
|
80
|
+
react_1.default.createElement(components_1.ArrayRemoveButton, { name: `${name}[${rIndex}]` }))) : null)));
|
|
81
|
+
return { head, rows };
|
|
82
|
+
}, [columns, name, schema.items, value === null || value === void 0 ? void 0 : value.length]);
|
|
83
|
+
return (react_1.default.createElement(components_1.ControlContainer, { stretch: "by-child", gap: 2 },
|
|
84
|
+
head,
|
|
85
|
+
rows,
|
|
86
|
+
addButton));
|
|
87
|
+
};
|
|
88
|
+
exports.ArrayTable = react_1.default.memo(Component);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ArrayTable, type ArrayTableProps } from './ArrayTable';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArrayTable = void 0;
|
|
4
|
+
var ArrayTable_1 = require("./ArrayTable");
|
|
5
|
+
Object.defineProperty(exports, "ArrayTable", { enumerable: true, get: function () { return ArrayTable_1.ArrayTable; } });
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
.sr-checkbox {
|
|
2
2
|
min-height: 28px;
|
|
3
3
|
display: flex;
|
|
4
|
-
|
|
4
|
+
justify-content: center;
|
|
5
|
+
}
|
|
6
|
+
.sr-checkbox_error .g-control-label .g-checkbox__indicator:hover::before {
|
|
7
|
+
border: 1px solid var(--g-color-text-danger);
|
|
8
|
+
}
|
|
9
|
+
.sr-checkbox_error .g-control-label .g-checkbox__indicator::before {
|
|
10
|
+
border: 1px solid var(--g-color-text-danger);
|
|
5
11
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type
|
|
2
|
+
import { type CheckboxProps as UIKitCheckboxProps } from '@gravity-ui/uikit';
|
|
3
3
|
import type { JsonSchemaBoolean } from '../../../core';
|
|
4
|
-
export interface CheckboxProps extends Omit<
|
|
4
|
+
export interface CheckboxProps extends Omit<UIKitCheckboxProps, 'checked' | 'onFocus' | 'onBlur' | 'onChange' | 'onUpdate' | 'qa'> {
|
|
5
5
|
}
|
|
6
6
|
export declare const Checkbox: React.NamedExoticComponent<import("../../../core").ControlProps<JsonSchemaBoolean<any>, CheckboxProps, {}>>;
|
|
@@ -8,9 +8,13 @@ const components_1 = require("../../components");
|
|
|
8
8
|
const utils_1 = require("../../utils");
|
|
9
9
|
const b = (0, utils_1.block)('checkbox');
|
|
10
10
|
const Component = ({ controlProps, input, meta, schema, }) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
const { name, onBlur, onChange, onFocus, value } = input;
|
|
12
|
+
const onUpdate = react_1.default.useCallback((value) => {
|
|
13
|
+
onFocus();
|
|
14
|
+
onChange(value);
|
|
15
|
+
onBlur();
|
|
16
|
+
}, [onBlur, onChange, onFocus]);
|
|
17
|
+
return (react_1.default.createElement(components_1.ControlContainer, { stretch: "fit", className: b({ error: (0, utils_1.getBooleanValidationState)(meta) }) },
|
|
18
|
+
react_1.default.createElement(uikit_1.Checkbox, Object.assign({ disabled: schema.readOnly }, controlProps, { checked: value !== null && value !== void 0 ? value : false, onFocus: onFocus, onBlur: onBlur, onUpdate: onUpdate, qa: name }))));
|
|
15
19
|
};
|
|
16
20
|
exports.Checkbox = react_1.default.memo(Component);
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
.sr-checkbox-
|
|
2
|
-
|
|
1
|
+
.sr-checkbox-group__checkbox {
|
|
2
|
+
min-height: 28px;
|
|
3
|
+
}
|
|
4
|
+
.sr-checkbox-group__checkbox_error .g-control-label .g-checkbox__indicator:hover::before {
|
|
5
|
+
border: 1px solid var(--g-color-text-danger);
|
|
6
|
+
}
|
|
7
|
+
.sr-checkbox-group__checkbox_error .g-control-label .g-checkbox__indicator::before {
|
|
8
|
+
border: 1px solid var(--g-color-text-danger);
|
|
3
9
|
}
|
|
@@ -8,8 +8,9 @@ const components_1 = require("../../components");
|
|
|
8
8
|
const utils_1 = require("../../utils");
|
|
9
9
|
const b = (0, utils_1.block)('checkbox-group');
|
|
10
10
|
const Component = ({ controlProps, input, meta, schema, }) => {
|
|
11
|
+
const { name, onBlur, onChange, onFocus, value: inputValue } = input;
|
|
11
12
|
const { direction, disabled, enumDescriptions, optionsDisabled } = controlProps;
|
|
12
|
-
const value = react_1.default.useMemo(() => (Array.isArray(
|
|
13
|
+
const value = react_1.default.useMemo(() => (Array.isArray(inputValue) ? inputValue : []), [inputValue]);
|
|
13
14
|
const options = react_1.default.useMemo(() => {
|
|
14
15
|
var _a, _b;
|
|
15
16
|
if (schema.items && 'enum' in schema.items) {
|
|
@@ -24,14 +25,18 @@ const Component = ({ controlProps, input, meta, schema, }) => {
|
|
|
24
25
|
return;
|
|
25
26
|
}, [enumDescriptions, schema]);
|
|
26
27
|
const onUpdate = react_1.default.useCallback((optionValue, selected) => {
|
|
28
|
+
onFocus();
|
|
27
29
|
if (selected) {
|
|
28
|
-
|
|
30
|
+
onChange([...value, optionValue]);
|
|
29
31
|
}
|
|
30
32
|
else {
|
|
31
|
-
|
|
33
|
+
onChange(value.filter((el) => el !== optionValue));
|
|
32
34
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
onBlur();
|
|
36
|
+
}, [onBlur, onChange, onFocus, value]);
|
|
37
|
+
return (react_1.default.createElement(components_1.ControlContainer, { stretch: "fit", direction: direction, gap: direction === 'row' ? 2 : undefined }, options === null || options === void 0 ? void 0 : options.map(({ value: optionValue, text }) => (react_1.default.createElement(uikit_1.Flex, { className: b('checkbox', {
|
|
38
|
+
error: value.includes(optionValue) && (0, utils_1.getBooleanValidationState)(meta),
|
|
39
|
+
}), alignItems: "center", key: optionValue },
|
|
40
|
+
react_1.default.createElement(uikit_1.Checkbox, { checked: value.includes(optionValue), onFocus: onFocus, onBlur: onBlur, onUpdate: (checked) => onUpdate(optionValue, checked), content: text, disabled: disabled || (optionsDisabled === null || optionsDisabled === void 0 ? void 0 : optionsDisabled[optionValue]) || schema.readOnly, qa: `${name}-${optionValue}` }))))));
|
|
36
41
|
};
|
|
37
42
|
exports.CheckboxGroup = react_1.default.memo(Component);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type unstable_ColorPickerProps as
|
|
2
|
+
import { type unstable_ColorPickerProps as UIKitColorPickerProps } from '@gravity-ui/uikit/unstable';
|
|
3
3
|
import type { JsonSchemaString } from '../../../core';
|
|
4
|
-
export interface ColorPickerProps extends Omit<
|
|
4
|
+
export interface ColorPickerProps extends Omit<UIKitColorPickerProps, 'value' | 'onUpdate'> {
|
|
5
5
|
}
|
|
6
6
|
export declare const ColorPicker: React.NamedExoticComponent<import("../../../core").ControlProps<JsonSchemaString<any>, ColorPickerProps, {}>>;
|
|
@@ -6,19 +6,20 @@ const react_1 = tslib_1.__importDefault(require("react"));
|
|
|
6
6
|
const unstable_1 = require("@gravity-ui/uikit/unstable");
|
|
7
7
|
const components_1 = require("../../components");
|
|
8
8
|
const utils_1 = require("../../utils");
|
|
9
|
+
const b = (0, utils_1.block)('color-picker');
|
|
9
10
|
const Component = ({ controlProps, input, meta, schema, }) => {
|
|
10
|
-
|
|
11
|
+
const { name, onBlur, onChange, onFocus, value } = input;
|
|
11
12
|
const { onOpenChange: onOpenChangeProps } = controlProps, restControlProps = tslib_1.__rest(controlProps, ["onOpenChange"]);
|
|
12
13
|
const onOpenChange = react_1.default.useCallback((open) => {
|
|
13
14
|
onOpenChangeProps === null || onOpenChangeProps === void 0 ? void 0 : onOpenChangeProps(open);
|
|
14
15
|
if (open) {
|
|
15
|
-
|
|
16
|
+
onFocus();
|
|
16
17
|
}
|
|
17
18
|
else {
|
|
18
|
-
|
|
19
|
+
onBlur();
|
|
19
20
|
}
|
|
20
|
-
}, [
|
|
21
|
-
return (react_1.default.createElement(components_1.
|
|
22
|
-
react_1.default.createElement(unstable_1.unstable_ColorPicker, Object.assign({ disabled: schema.readOnly }, restControlProps, { value:
|
|
21
|
+
}, [onBlur, onFocus, onOpenChangeProps]);
|
|
22
|
+
return (react_1.default.createElement(components_1.ControlContainer, { stretch: "max", className: b({ error: (0, utils_1.getBooleanValidationState)(meta) }) },
|
|
23
|
+
react_1.default.createElement(unstable_1.unstable_ColorPicker, Object.assign({ disabled: schema.readOnly }, restControlProps, { value: value !== null && value !== void 0 ? value : '', onUpdate: onChange, onOpenChange: onOpenChange, "data-qa": name }))));
|
|
23
24
|
};
|
|
24
25
|
exports.ColorPicker = react_1.default.memo(Component);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
.sr-date-
|
|
2
|
-
|
|
1
|
+
.sr-date-input_error .g-date-date-picker .g-text-input__content {
|
|
2
|
+
border: 1px solid var(--g-color-text-danger);
|
|
3
3
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type
|
|
2
|
+
import { type DatePickerProps } from '@gravity-ui/date-components';
|
|
3
3
|
import type { JsonSchemaAny } from '../../../core';
|
|
4
4
|
export declare const DEFAULT_DATE_FORMAT = "DD.MM.YYYY HH:mm";
|
|
5
|
-
export interface DateInputProps extends Omit<DatePickerProps, 'value' | 'onFocus' | 'onBlur' | 'onChange' | 'onUpdate' | '
|
|
5
|
+
export interface DateInputProps extends Omit<DatePickerProps, 'value' | 'onFocus' | 'onBlur' | 'onChange' | 'onUpdate' | 'errorMessage' | 'validationState'> {
|
|
6
6
|
outputFormat?: string;
|
|
7
7
|
}
|
|
8
8
|
export declare const DateInput: React.NamedExoticComponent<import("../../../core").ControlProps<JsonSchemaAny<any>, DateInputProps, {}>>;
|
|
@@ -7,49 +7,50 @@ const date_components_1 = require("@gravity-ui/date-components");
|
|
|
7
7
|
const date_utils_1 = require("@gravity-ui/date-utils");
|
|
8
8
|
const components_1 = require("../../components");
|
|
9
9
|
const utils_1 = require("../../utils");
|
|
10
|
-
exports.DEFAULT_DATE_FORMAT = 'DD.MM.YYYY HH:mm';
|
|
11
10
|
const b = (0, utils_1.block)('date-input');
|
|
11
|
+
exports.DEFAULT_DATE_FORMAT = 'DD.MM.YYYY HH:mm';
|
|
12
12
|
const Component = ({ controlProps, input, meta, schema }) => {
|
|
13
13
|
var _a;
|
|
14
|
+
const { name, onBlur, onChange, onFocus, value: inputValue } = input;
|
|
14
15
|
const { outputFormat, timeZone: timeZoneProp } = controlProps, restControlProps = tslib_1.__rest(controlProps, ["outputFormat", "timeZone"]);
|
|
15
16
|
const timeZone = timeZoneProp && (0, date_utils_1.isValidTimeZone)(timeZoneProp) ? timeZoneProp : undefined;
|
|
16
17
|
const onUpdate = react_1.default.useCallback((date) => {
|
|
17
18
|
if (!date) {
|
|
18
|
-
|
|
19
|
+
onChange(undefined);
|
|
19
20
|
return;
|
|
20
21
|
}
|
|
21
22
|
if (outputFormat === 'date_time') {
|
|
22
|
-
|
|
23
|
+
onChange(date);
|
|
23
24
|
return;
|
|
24
25
|
}
|
|
25
26
|
if (outputFormat === 'date') {
|
|
26
|
-
|
|
27
|
+
onChange(date.toDate());
|
|
27
28
|
return;
|
|
28
29
|
}
|
|
29
30
|
if (outputFormat === 'timestamp') {
|
|
30
|
-
|
|
31
|
+
onChange({
|
|
31
32
|
seconds: Math.floor(date.toDate().getTime() / 1000),
|
|
32
33
|
nanos: 0,
|
|
33
34
|
});
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
36
37
|
if (outputFormat === 'string' || !outputFormat) {
|
|
37
|
-
|
|
38
|
+
onChange(date.toISOString());
|
|
38
39
|
return;
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
-
}, [outputFormat,
|
|
41
|
+
onChange(date.format(outputFormat));
|
|
42
|
+
}, [outputFormat, onChange]);
|
|
42
43
|
const value = react_1.default.useMemo(() => {
|
|
43
|
-
if (!
|
|
44
|
+
if (!inputValue) {
|
|
44
45
|
return null;
|
|
45
46
|
}
|
|
46
|
-
let raw =
|
|
47
|
+
let raw = inputValue;
|
|
47
48
|
if (typeof raw === 'object' && raw !== null && 'seconds' in raw && raw.seconds) {
|
|
48
49
|
raw = raw.seconds * 1000;
|
|
49
50
|
}
|
|
50
51
|
return (0, date_utils_1.dateTimeParse)(raw, { format: outputFormat, timeZone }) || null;
|
|
51
|
-
}, [
|
|
52
|
-
return (react_1.default.createElement(components_1.
|
|
53
|
-
react_1.default.createElement(date_components_1.DatePicker, Object.assign({
|
|
52
|
+
}, [inputValue, outputFormat, timeZone]);
|
|
53
|
+
return (react_1.default.createElement(components_1.ControlContainer, { stretch: "max", className: b({ error: (0, utils_1.getBooleanValidationState)(meta) }) },
|
|
54
|
+
react_1.default.createElement(date_components_1.DatePicker, Object.assign({ format: exports.DEFAULT_DATE_FORMAT, popupPlacement: "bottom-start", placeholder: `${(_a = schema.examples) === null || _a === void 0 ? void 0 : _a[0]}`, disabled: schema.readOnly, hasClear: true }, restControlProps, { value: value, onFocus: onFocus, onBlur: onBlur, onUpdate: onUpdate, timeZone: timeZone, errorMessage: undefined, validationState: undefined, "data-qa": name }))));
|
|
54
55
|
};
|
|
55
56
|
exports.DateInput = react_1.default.memo(Component);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DotValue = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const get_1 = tslib_1.__importDefault(require("lodash/get"));
|
|
7
|
+
const isString_1 = tslib_1.__importDefault(require("lodash/isString"));
|
|
8
|
+
const core_1 = require("../../../core");
|
|
9
|
+
const components_1 = require("../../components");
|
|
10
|
+
const Component = ({ input, schema }) => {
|
|
11
|
+
var _a;
|
|
12
|
+
const { name, onBlur, onChange, onFocus, value } = input;
|
|
13
|
+
const childKey = 'value';
|
|
14
|
+
react_1.default.useLayoutEffect(() => {
|
|
15
|
+
if (value) {
|
|
16
|
+
const childValue = (0, get_1.default)(value, childKey);
|
|
17
|
+
if (childValue === null ||
|
|
18
|
+
childValue === undefined ||
|
|
19
|
+
childValue === '' ||
|
|
20
|
+
((0, isString_1.default)(childValue) && childValue.endsWith('_UNSPECIFIED'))) {
|
|
21
|
+
onFocus();
|
|
22
|
+
onChange(undefined);
|
|
23
|
+
onBlur();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}, [value]);
|
|
27
|
+
return (react_1.default.createElement(components_1.ControlContainer, { stretch: "by-child" },
|
|
28
|
+
react_1.default.createElement(core_1.Entity, { name: `${name ? name + '.' : ''}${childKey}`, schema: (_a = schema.properties) === null || _a === void 0 ? void 0 : _a[childKey] })));
|
|
29
|
+
};
|
|
30
|
+
exports.DotValue = react_1.default.memo(Component);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DotValue, type DotValueProps } from './DotValue';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
.sr-few-of-nested__content_with-indent {
|
|
2
|
+
position: relative;
|
|
3
|
+
padding-left: calc(var(--g-spacing-base) * 7);
|
|
4
|
+
}
|
|
5
|
+
.sr-few-of-nested__content_with-indent:before {
|
|
6
|
+
content: "";
|
|
7
|
+
display: block;
|
|
8
|
+
width: 1px;
|
|
9
|
+
height: calc(100% + var(--g-spacing-base) * 2);
|
|
10
|
+
background-color: var(--g-color-line-generic);
|
|
11
|
+
position: absolute;
|
|
12
|
+
left: calc(var(--g-spacing-base) * 3 + 1.5px);
|
|
13
|
+
bottom: 0;
|
|
14
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type JsonSchema, type JsonSchemaObject } from '../../../core';
|
|
3
|
+
export interface FewOfNestedProps {
|
|
4
|
+
toggler: JsonSchema;
|
|
5
|
+
withIndent?: boolean;
|
|
6
|
+
togglerArrayRemoveButton?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const FewOfNested: React.NamedExoticComponent<import("../../../core").ControlProps<JsonSchemaObject<any>, FewOfNestedProps, {}>>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FewOfNested = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const isString_1 = tslib_1.__importDefault(require("lodash/isString"));
|
|
7
|
+
const core_1 = require("../../../core");
|
|
8
|
+
const components_1 = require("../../components");
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
const b = (0, utils_1.block)('one-of-nested');
|
|
11
|
+
const Component = ({ controlProps, input, meta, schema, Wrapper, wrapperProps, }) => {
|
|
12
|
+
const { name, value } = input;
|
|
13
|
+
const { togglerArrayRemoveButton = false, toggler: togglerSchema = {}, withIndent = false, } = controlProps;
|
|
14
|
+
const { config } = (0, core_1.useEntitiesState)(name);
|
|
15
|
+
const [togglerValues, setTogglerValues] = react_1.default.useState(() => {
|
|
16
|
+
if (value && Object.keys(value).length) {
|
|
17
|
+
return Object.keys(value);
|
|
18
|
+
}
|
|
19
|
+
if (schema.properties && Object.keys(schema.properties).length) {
|
|
20
|
+
return [Object.keys(schema.properties)[0]];
|
|
21
|
+
}
|
|
22
|
+
return [];
|
|
23
|
+
});
|
|
24
|
+
const toggler = react_1.default.useMemo(() => {
|
|
25
|
+
let result = null;
|
|
26
|
+
const formKit = (0, core_1.getRenderKit)({ config, schema: togglerSchema })[core_1.SchemaRendererMode.Form];
|
|
27
|
+
const togglerInput = Object.assign(Object.assign({}, input), { name: togglerArrayRemoveButton ? name : `${name}._____toggler`, value: togglerValues, onChange: (value) => {
|
|
28
|
+
if (Array.isArray(value)) {
|
|
29
|
+
setTogglerValues(value.filter(isString_1.default));
|
|
30
|
+
}
|
|
31
|
+
} });
|
|
32
|
+
const togglerMeta = Object.assign(Object.assign({}, meta), { error: undefined });
|
|
33
|
+
if (formKit.Component) {
|
|
34
|
+
if (formKit.independent) {
|
|
35
|
+
result = (react_1.default.createElement(formKit.Component, { input: togglerInput, meta: togglerMeta, schema: togglerSchema, controlProps: formKit.props, Wrapper: formKit.Wrapper, wrapperProps: formKit.wrapperProps }));
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
result = (react_1.default.createElement(formKit.Component, { input: togglerInput, meta: togglerMeta, schema: togglerSchema, controlProps: formKit.props }));
|
|
39
|
+
if (formKit.Wrapper) {
|
|
40
|
+
result = (react_1.default.createElement(formKit.Wrapper, { input: togglerInput, meta: togglerMeta, schema: togglerSchema, wrapperProps: formKit.wrapperProps }, result));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return result;
|
|
45
|
+
}, [config, name, input, meta, togglerArrayRemoveButton, togglerSchema, togglerValues]);
|
|
46
|
+
const wrapperInput = react_1.default.useMemo(() => {
|
|
47
|
+
if (!togglerArrayRemoveButton) {
|
|
48
|
+
return input;
|
|
49
|
+
}
|
|
50
|
+
return Object.assign(Object.assign({}, input), { name: `${name}._____wrapper` });
|
|
51
|
+
}, [name, input, togglerArrayRemoveButton]);
|
|
52
|
+
let content = (react_1.default.createElement(components_1.ControlContainer, { stretch: "by-child" },
|
|
53
|
+
toggler,
|
|
54
|
+
togglerValues.length ? (react_1.default.createElement("div", { className: b('content', { 'with-indent': withIndent }) }, togglerValues.map((togglerValue) => {
|
|
55
|
+
var _a;
|
|
56
|
+
return (react_1.default.createElement(core_1.Entity, { key: togglerValue, name: `${name}.${togglerValue}`, schema: (_a = schema.properties) === null || _a === void 0 ? void 0 : _a[togglerValue] }));
|
|
57
|
+
}))) : null));
|
|
58
|
+
if (Wrapper) {
|
|
59
|
+
content = (react_1.default.createElement(Wrapper, { input: wrapperInput, meta: meta, schema: schema, wrapperProps: wrapperProps || {} }, content));
|
|
60
|
+
}
|
|
61
|
+
return content;
|
|
62
|
+
};
|
|
63
|
+
exports.FewOfNested = react_1.default.memo(Component);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FewOfNested, type FewOfNestedProps } from './FewOfNested';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FewOfNested = void 0;
|
|
4
|
+
var FewOfNested_1 = require("./FewOfNested");
|
|
5
|
+
Object.defineProperty(exports, "FewOfNested", { enumerable: true, get: function () { return FewOfNested_1.FewOfNested; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FileDropZoneProps } from '@gravity-ui/uikit/unstable';
|
|
3
|
+
import type { JsonSchemaString } from '../../../core';
|
|
4
|
+
export interface FileInputProps extends Omit<FileDropZoneProps, 'multiple' | 'onUpdate' | 'errorMessage' | 'validationState'> {
|
|
5
|
+
readAsMethod?: 'readAsBinaryString' | 'readAsDataURL' | 'readAsText';
|
|
6
|
+
}
|
|
7
|
+
export declare const FileInput: React.NamedExoticComponent<import("../../../core").ControlProps<JsonSchemaString<any>, FileInputProps, {}>>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileInput = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const icons_1 = require("@gravity-ui/icons");
|
|
7
|
+
const uikit_1 = require("@gravity-ui/uikit");
|
|
8
|
+
const unstable_1 = require("@gravity-ui/uikit/unstable");
|
|
9
|
+
const components_1 = require("../../components");
|
|
10
|
+
const utils_1 = require("../../utils");
|
|
11
|
+
const Component = ({ controlProps, input, meta, schema, }) => {
|
|
12
|
+
const { onBlur, onChange, onFocus } = input;
|
|
13
|
+
const { readAsMethod = 'readAsBinaryString' } = controlProps, restControlProps = tslib_1.__rest(controlProps, ["readAsMethod"]);
|
|
14
|
+
const counterRef = react_1.default.useRef(0);
|
|
15
|
+
const [file, setFile] = react_1.default.useState(null);
|
|
16
|
+
const actions = react_1.default.useMemo(() => [
|
|
17
|
+
{
|
|
18
|
+
id: 'remove',
|
|
19
|
+
title: '',
|
|
20
|
+
icon: react_1.default.createElement(icons_1.Xmark, { width: 14, height: 14 }),
|
|
21
|
+
onClick: () => {
|
|
22
|
+
onChange(undefined);
|
|
23
|
+
setFile(null);
|
|
24
|
+
},
|
|
25
|
+
tooltipExtraProps: { disabled: true },
|
|
26
|
+
},
|
|
27
|
+
], [onChange]);
|
|
28
|
+
const onUpdate = react_1.default.useCallback((files) => {
|
|
29
|
+
if (files.length) {
|
|
30
|
+
const reader = new FileReader();
|
|
31
|
+
if (typeof reader[readAsMethod] !== 'function') {
|
|
32
|
+
throw new Error(`Unknown parameter: ${readAsMethod}`);
|
|
33
|
+
}
|
|
34
|
+
const counter = ++counterRef.current;
|
|
35
|
+
reader.addEventListener('load', () => {
|
|
36
|
+
if (counter === counterRef.current) {
|
|
37
|
+
onFocus();
|
|
38
|
+
onChange(reader.result);
|
|
39
|
+
onBlur();
|
|
40
|
+
setFile(files[0]);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
reader[readAsMethod](files[0]);
|
|
44
|
+
}
|
|
45
|
+
}, [onBlur, onChange, onFocus, readAsMethod]);
|
|
46
|
+
if (file) {
|
|
47
|
+
return (react_1.default.createElement(components_1.ControlContainer, { stretch: "fit" },
|
|
48
|
+
react_1.default.createElement(uikit_1.FilePreview, { file: file, actions: actions })));
|
|
49
|
+
}
|
|
50
|
+
return (react_1.default.createElement(components_1.ControlContainer, { stretch: "max" },
|
|
51
|
+
react_1.default.createElement(unstable_1.unstable_FileDropZone, Object.assign({ disabled: schema.readOnly, accept: [] }, restControlProps, { onUpdate: onUpdate, errorMessage: undefined, validationState: (0, utils_1.getValidationState)(meta), multiple: false }))));
|
|
52
|
+
};
|
|
53
|
+
exports.FileInput = react_1.default.memo(Component);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FileInput, type FileInputProps } from './FileInput';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileInput = void 0;
|
|
4
|
+
var FileInput_1 = require("./FileInput");
|
|
5
|
+
Object.defineProperty(exports, "FileInput", { enumerable: true, get: function () { return FileInput_1.FileInput; } });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as icons from '@gravity-ui/icons';
|
|
3
|
+
import { type IconProps, type LabelProps as UIKitLabelProps } from '@gravity-ui/uikit';
|
|
4
|
+
import type { JsonSchemaString } from '../../../core';
|
|
5
|
+
export interface LabelProps extends UIKitLabelProps {
|
|
6
|
+
iconName?: keyof typeof icons;
|
|
7
|
+
iconProps?: Partial<IconProps>;
|
|
8
|
+
}
|
|
9
|
+
export declare const Label: React.NamedExoticComponent<import("../../../core").ControlProps<JsonSchemaString<any>, LabelProps, {}>>;
|