2016-04-16 18:06:27 +02:00
|
|
|
export const addItem = (value, label, id, optionId) => {
|
2016-03-30 16:04:21 +02:00
|
|
|
return {
|
|
|
|
type: 'ADD_ITEM',
|
2016-04-17 13:02:28 +02:00
|
|
|
value,
|
|
|
|
label,
|
|
|
|
id,
|
|
|
|
optionId,
|
2016-03-30 16:04:21 +02:00
|
|
|
}
|
2016-04-04 00:07:10 +02:00
|
|
|
};
|
2016-03-30 16:04:21 +02:00
|
|
|
|
2016-04-14 15:43:36 +02:00
|
|
|
export const removeItem = (id, optionId) => {
|
2016-03-30 16:04:21 +02:00
|
|
|
return {
|
|
|
|
type: 'REMOVE_ITEM',
|
2016-04-17 13:02:28 +02:00
|
|
|
id,
|
|
|
|
optionId,
|
2016-03-30 16:04:21 +02:00
|
|
|
}
|
2016-04-04 00:07:10 +02:00
|
|
|
};
|
2016-03-30 16:04:21 +02:00
|
|
|
|
2016-04-12 21:16:36 +02:00
|
|
|
export const selectItem = (id, selected) => {
|
2016-03-30 16:04:21 +02:00
|
|
|
return {
|
2016-04-04 00:07:10 +02:00
|
|
|
type: 'SELECT_ITEM',
|
2016-04-17 13:02:28 +02:00
|
|
|
id,
|
|
|
|
selected,
|
2016-03-30 16:04:21 +02:00
|
|
|
}
|
2016-04-12 15:31:07 +02:00
|
|
|
};
|
|
|
|
|
2016-04-28 16:30:43 +02:00
|
|
|
export const addOption = (value, label, id, groupId, disabled) => {
|
2016-04-12 15:31:07 +02:00
|
|
|
return {
|
|
|
|
type: 'ADD_OPTION',
|
2016-04-17 13:02:28 +02:00
|
|
|
value,
|
|
|
|
label,
|
|
|
|
id,
|
|
|
|
groupId,
|
2016-04-26 15:36:02 +02:00
|
|
|
disabled,
|
2016-04-12 21:16:36 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-04-22 20:45:50 +02:00
|
|
|
export const filterOptions = (results) => {
|
|
|
|
return {
|
|
|
|
type: 'FILTER_OPTIONS',
|
|
|
|
results,
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export const activateOptions = (active = true) => {
|
|
|
|
return {
|
|
|
|
type: 'ACTIVATE_OPTIONS',
|
|
|
|
active,
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export const addGroup = (value, id, active, disabled) => {
|
2016-04-16 18:06:27 +02:00
|
|
|
return {
|
|
|
|
type: 'ADD_GROUP',
|
2016-04-17 13:02:28 +02:00
|
|
|
value,
|
|
|
|
id,
|
2016-04-22 20:45:50 +02:00
|
|
|
active,
|
|
|
|
disabled,
|
2016-04-16 18:06:27 +02:00
|
|
|
}
|
2016-04-04 00:07:10 +02:00
|
|
|
};
|