Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React from 'react';
import merge from 'lodash/merge';
import { Widgets, Operators, BasicConfig } from 'react-awesome-query-builder';
import en_US from 'antd/lib/locale-provider/en_US';
import ru_RU from 'antd/lib/locale-provider/ru_RU';
const {
FieldSelect,
FieldDropdown,
FieldCascader,
VanillaFieldSelect
} = Widgets;
const conjunctions = {
...BasicConfig.conjunctions
};
const operators = {
...BasicConfig.operators,
// examples of overriding
between: {
...BasicConfig.operators.between,
valueLabels: [
'Value from',
'Value to'
],
textSeparators: [
'from',
'to'
],
},
import {
Widgets, BasicConfig,
// types:
Operators, Fields, Config, Types, Conjunctions, Settings, LocaleSettings, OperatorProximity, Funcs,
} from 'react-awesome-query-builder';
import en_US from 'antd/lib/locale-provider/en_US';
import ru_RU from 'antd/lib/locale-provider/ru_RU';
const {
FieldSelect,
FieldDropdown,
FieldCascader,
VanillaFieldSelect,
} = Widgets;
const conjunctions: Conjunctions = {
...BasicConfig.conjunctions,
};
const proximity: OperatorProximity = {
...BasicConfig.operators.proximity,
valueLabels: [
{ label: 'Word 1', placeholder: 'Enter first word' },
{ label: 'Word 2', placeholder: 'Enter second word' },
],
textSeparators: [
//'Word 1',
//'Word 2'
],
options: {
...BasicConfig.operators.proximity.options,
optionLabel: "Near", // label on top of "near" selectbox (for config.settings.showLabels==true)
optionTextBefore: "Near", // label before "near" selectbox (for config.settings.showLabels==false)