Skip to content

Commit b859136

Browse files
authored
feat(BooleanOneOf): add new input BooleanOneOf (#182)
1 parent 5012d5d commit b859136

31 files changed

+368
-14
lines changed

docs/spec.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,10 @@ type Spec = ArraySpec | BooleanSpec | NumberSpec | ObjectSpec | StringSpec;
145145

146146
#### OneOfParams
147147

148-
| Property | Type | Required | Description |
149-
| :------- | :---------------------------- | :------: | :---------- |
150-
| toggler | `'select'` `'radio'` `'card'` | | Switch type |
148+
| Property | Type | Required | Description |
149+
| :--------- | :----------------------------------------- | :------: | :--------------------------------------------- |
150+
| toggler | `'select'` `'radio'` `'card'` `'checkbox'` | | Switch type |
151+
| booleanMap | `Record<'true' 'false', string>` | | Special object for oneof toggler type checkbox |
151152

152153
#### FileInput
153154

src/lib/core/types/specs.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ export interface ObjectSpec<
117117
order?: string[];
118118
link?: LinkType;
119119
oneOfParams?: {
120-
toggler?: 'select' | 'radio' | 'card';
120+
toggler?: 'select' | 'radio' | 'card' | 'checkbox';
121+
booleanMap?: Record<'true' | 'false', string>;
121122
};
122123
placeholder?: string;
123124
hidden?: boolean;

src/lib/kit/components/Inputs/ObjectValueInput/ObjectValueInput.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import cloneDeep from 'lodash/cloneDeep';
44
import set from 'lodash/set';
55

66
import {Controller, FieldValue, ObjectIndependentInput, ValidateError} from '../../../../core';
7-
8-
const OBJECT_VALUE_PROPERTY_NAME = 'value';
7+
import {OBJECT_VALUE_PROPERTY_NAME} from '../../../constants/common';
98

109
export const ObjectValueInput: ObjectIndependentInput = (props) => {
1110
const {spec, input, name, Layout} = props;
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)