From 584e5399beedd0b6ee9d2517755e3ce2a1132a42 Mon Sep 17 00:00:00 2001 From: NasgulNexus Date: Wed, 13 Sep 2023 17:37:25 +0200 Subject: [PATCH 1/2] fix(stylesTransperantAndArrayBaseView): fixedstyles --- src/lib/kit/components/Layouts/Transparent/Transparent.scss | 1 + src/lib/kit/components/Views/ArrayBaseView/ArrayBaseView.scss | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/kit/components/Layouts/Transparent/Transparent.scss b/src/lib/kit/components/Layouts/Transparent/Transparent.scss index 70f10346..67b00f63 100644 --- a/src/lib/kit/components/Layouts/Transparent/Transparent.scss +++ b/src/lib/kit/components/Layouts/Transparent/Transparent.scss @@ -11,6 +11,7 @@ &_array-item { max-width: 338px; + min-width: 338px; } &_without-max-width { diff --git a/src/lib/kit/components/Views/ArrayBaseView/ArrayBaseView.scss b/src/lib/kit/components/Views/ArrayBaseView/ArrayBaseView.scss index cddcb994..bae12b88 100644 --- a/src/lib/kit/components/Views/ArrayBaseView/ArrayBaseView.scss +++ b/src/lib/kit/components/Views/ArrayBaseView/ArrayBaseView.scss @@ -2,7 +2,7 @@ .#{$ns}array-base-view { &__item-prefix { - margin-top: -10px; + margin-top: 9px; margin-bottom: 15px; } } From c6fafc724b1064bc8c28f2cf0604e9305ef32080 Mon Sep 17 00:00:00 2001 From: NasgulNexus Date: Thu, 14 Sep 2023 15:08:34 +0200 Subject: [PATCH 2/2] fix: fix styles --- src/lib/kit/components/Inputs/ArrayBase/ArrayBase.scss | 8 ++++++++ src/lib/kit/components/Inputs/ArrayBase/ArrayBase.tsx | 8 ++++++++ .../kit/components/Layouts/Transparent/Transparent.scss | 1 - .../kit/components/Views/ArrayBaseView/ArrayBaseView.scss | 3 +-- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/lib/kit/components/Inputs/ArrayBase/ArrayBase.scss b/src/lib/kit/components/Inputs/ArrayBase/ArrayBase.scss index c1c2e417..86479c4d 100644 --- a/src/lib/kit/components/Inputs/ArrayBase/ArrayBase.scss +++ b/src/lib/kit/components/Inputs/ArrayBase/ArrayBase.scss @@ -10,6 +10,14 @@ &_add-button-down { margin-bottom: 15px; } + + &_items-primitive { + min-width: 100%; + + &:empty { + min-width: unset; + } + } } &__item-prefix { diff --git a/src/lib/kit/components/Inputs/ArrayBase/ArrayBase.tsx b/src/lib/kit/components/Inputs/ArrayBase/ArrayBase.tsx index ab51b056..dd2a0922 100644 --- a/src/lib/kit/components/Inputs/ArrayBase/ArrayBase.tsx +++ b/src/lib/kit/components/Inputs/ArrayBase/ArrayBase.tsx @@ -14,7 +14,10 @@ import { OBJECT_ARRAY_FLAG, Spec, ValidateError, + isBooleanSpec, isCorrectSpec, + isNumberSpec, + isStringSpec, transformArrIn, } from '../../../../core'; import {block} from '../../../utils'; @@ -35,6 +38,10 @@ export const ArrayBase: ArrayInput = ({spec, name, arrayInput, input}) => { const itemSpecCorrect = React.useMemo(() => isCorrectSpec(spec.items), [spec.items]); + const itemsPrimitive = React.useMemo(() => { + return isBooleanSpec(spec.items) || isNumberSpec(spec.items) || isStringSpec(spec.items); + }, [spec.items]); + const getItemSpec = React.useCallback( (idx: number): typeof spec.items | null => { if (!itemSpecCorrect) { @@ -155,6 +162,7 @@ export const ArrayBase: ArrayInput = ({spec, name, arrayInput, input}) => { className={b('items-wrapper', { 'add-button-down': spec.viewSpec.addButtonPosition !== 'right' && keys.length > 0, + 'items-primitive': itemsPrimitive, })} > {items} diff --git a/src/lib/kit/components/Layouts/Transparent/Transparent.scss b/src/lib/kit/components/Layouts/Transparent/Transparent.scss index 67b00f63..70f10346 100644 --- a/src/lib/kit/components/Layouts/Transparent/Transparent.scss +++ b/src/lib/kit/components/Layouts/Transparent/Transparent.scss @@ -11,7 +11,6 @@ &_array-item { max-width: 338px; - min-width: 338px; } &_without-max-width { diff --git a/src/lib/kit/components/Views/ArrayBaseView/ArrayBaseView.scss b/src/lib/kit/components/Views/ArrayBaseView/ArrayBaseView.scss index bae12b88..ce456227 100644 --- a/src/lib/kit/components/Views/ArrayBaseView/ArrayBaseView.scss +++ b/src/lib/kit/components/Views/ArrayBaseView/ArrayBaseView.scss @@ -2,7 +2,6 @@ .#{$ns}array-base-view { &__item-prefix { - margin-top: 9px; - margin-bottom: 15px; + margin-bottom: 6px; } }