Skip to content

Commit

Permalink
Replace customValueEditor with validator
Browse files Browse the repository at this point in the history
  • Loading branch information
toptalwadiibasmi committed Sep 23, 2024
1 parent ae52873 commit 77b2bd6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ type Props = {
onSubmit?: (query: RuleGroupTypeAny) => void
/** Defines a component that allows possibility to customize value editor that is used in QB. By default, QB provides default set of editors (text inputs, dropdowns, etc.). */
valueEditor?: ValueEditorComponentProps
/** Defines a component that allows possibility to customize value editor that is used in QB. By default, QB provides default set of editors (text inputs, dropdowns, etc.). */
/** @deprecated. */
customValueEditor?: ValueEditorComponentProps
/** Defines the loading state. */
loading?: boolean
/** Defines padded layout. */
Expand Down Expand Up @@ -90,7 +87,6 @@ const QueryBuilder = ({
loading = false,
onSubmit,
valueEditor = ValueEditor,
customValueEditor = ValueEditor,
footer,
hideControls,
header,
Expand Down Expand Up @@ -220,7 +216,7 @@ const QueryBuilder = ({
} as QueryBuilderContext
}
controlElements={{
valueEditor: valueEditor || customValueEditor,
valueEditor,
}}
enableDragAndDrop={enableDragAndDrop}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react'
import type { ValueEditorProps } from '@toptal/picasso-query-builder'
import {
QueryBuilder,
import { QueryBuilder } from '@toptal/picasso-query-builder'
import type {
ValueEditorProps,
type RuleGroupTypeAny,
} from '@toptal/picasso-query-builder'
import { Input, Select } from '@toptal/picasso'
Expand Down Expand Up @@ -67,7 +67,7 @@ const Example = () => {
query={query}
onQueryChange={handleQueryChange}
fields={fields}
customValueEditor={CustomValueEditor}
valueEditor={CustomValueEditor}
/>
)
}
Expand Down

0 comments on commit 77b2bd6

Please sign in to comment.