forked from ukrbublik/react-awesome-query-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrule.js
More file actions
74 lines (69 loc) · 1.66 KB
/
rule.js
File metadata and controls
74 lines (69 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import * as constants from "../stores/constants";
import {toImmutableList} from "../utils/stuff";
/**
* @param {object} config
* @param {Immutable.List} path
* @param {string} field
*/
export const setField = (config, path, field) => ({
type: constants.SET_FIELD,
path: toImmutableList(path),
field: field,
config: config
});
/**
* @param {object} config
* @param {Immutable.List} path
* @param {string} operator
*/
export const setOperator = (config, path, operator) => ({
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
* @param {boolean} __isInternal
*/
export const setValue = (config, path, delta, value, valueType, asyncListValues, __isInternal) => ({
type: constants.SET_VALUE,
path: toImmutableList(path),
delta: delta,
value: value,
valueType: valueType,
asyncListValues: asyncListValues,
config: config,
__isInternal: __isInternal
});
/**
* @param {object} config
* @param {Immutable.List} path
* @param {integer} delta
* @param {*} srcKey
*/
export const setValueSrc = (config, path, delta, srcKey) => ({
type: constants.SET_VALUE_SRC,
path: toImmutableList(path),
delta: delta,
srcKey: srcKey,
config: config
});
/**
* @param {object} config
* @param {Immutable.List} path
* @param {string} name
* @param {*} value
*/
export const setOperatorOption = (config, path, name, value) => ({
type: constants.SET_OPERATOR_OPTION,
path: toImmutableList(path),
name: name,
value: value,
config: config
});