@react-awesome-query-builder/core
Version:
User-friendly query builder for React. Core
125 lines (118 loc) • 2.89 kB
JavaScript
import * as constants from "../stores/constants";
import { toImmutableList } from "../utils/stuff";
/**
* @param {object} config
* @param {Immutable.List} path
* @param {string} field
*/
export var setField = function setField(config, path, field, asyncListValues, _meta) {
return {
type: constants.SET_FIELD,
path: toImmutableList(path),
field: field,
config: config,
asyncListValues: asyncListValues,
_meta: _meta
};
};
/**
* @param {object} config
* @param {Immutable.List} path
* @param {*} srcKey
*/
export var setFieldSrc = function setFieldSrc(config, path, srcKey) {
return {
type: constants.SET_FIELD_SRC,
path: toImmutableList(path),
srcKey: srcKey,
config: config
};
};
/**
* @param {object} config
* @param {Immutable.List} path
* @param {string} operator
*/
export var setOperator = function setOperator(config, path, operator) {
return {
type: constants.SET_OPERATOR,
path: toImmutableList(path),
operator: operator,
config: config
};
};
/**
* @param {object} config
* @param {Immutable.List} path
* @param {integer} delta
* @param {*} value
* @param {string} valueType
* @param {*} asyncListValues
*/
export var setValue = function setValue(config, path, delta, value, valueType, asyncListValues, _meta) {
return {
type: constants.SET_VALUE,
path: toImmutableList(path),
delta: delta,
value: value,
valueType: valueType,
asyncListValues: asyncListValues,
config: config,
_meta: _meta
};
};
/**
* @param {object} config
* @param {Immutable.List} path
* @param {integer} delta
* @param {*} srcKey
*/
export var setValueSrc = function setValueSrc(config, path, delta, srcKey, _meta) {
return {
type: constants.SET_VALUE_SRC,
path: toImmutableList(path),
delta: delta,
srcKey: srcKey,
config: config,
_meta: _meta
};
};
/**
* @param {object} config
* @param {Immutable.List} path
* @param {integer} delta
* @param {Array} parentFuncs
* @param {string | null} argKey
* @param {*} value
* @param {string | "!valueSrc"} valueType
* @param {*} asyncListValues
*/
export var setFuncValue = function setFuncValue(config, path, delta, parentFuncs, argKey, value, valueType, asyncListValues, _meta) {
return {
type: constants.SET_FUNC_VALUE,
path: toImmutableList(path),
delta: delta,
parentFuncs: parentFuncs,
argKey: argKey,
value: value,
valueType: valueType,
asyncListValues: asyncListValues,
config: config,
_meta: _meta
};
};
/**
* @param {object} config
* @param {Immutable.List} path
* @param {string} name
* @param {*} value
*/
export var setOperatorOption = function setOperatorOption(config, path, name, value) {
return {
type: constants.SET_OPERATOR_OPTION,
path: toImmutableList(path),
name: name,
value: value,
config: config
};
};