Choices/assets/scripts/src/actions/index.js

79 lines
1.2 KiB
JavaScript
Raw Normal View History

2017-07-19 19:48:46 +02:00
export const addItem = (value, label, id, choiceId, groupId, customProperties, keyCode) => {
return {
type: 'ADD_ITEM',
value,
label,
id,
choiceId,
2016-10-18 20:23:07 +02:00
groupId,
2017-07-19 19:48:46 +02:00
customProperties,
keyCode
};
};
2016-03-30 16:04:21 +02:00
export const removeItem = (id, choiceId) => {
return {
type: 'REMOVE_ITEM',
id,
choiceId,
};
};
2016-03-30 16:04:21 +02:00
export const highlightItem = (id, highlighted) => {
return {
type: 'HIGHLIGHT_ITEM',
id,
highlighted,
};
2016-04-12 15:31:07 +02:00
};
2017-07-19 19:48:46 +02:00
export const addChoice = (value, label, id, groupId, disabled, elementId, customProperties, keyCode) => {
return {
type: 'ADD_CHOICE',
value,
label,
id,
groupId,
disabled,
elementId: elementId,
2017-07-19 19:48:46 +02:00
customProperties,
keyCode
};
};
export const filterChoices = (results) => {
return {
type: 'FILTER_CHOICES',
results,
};
};
export const activateChoices = (active = true) => {
return {
type: 'ACTIVATE_CHOICES',
active,
};
};
2016-09-26 18:11:32 +02:00
export const clearChoices = () => {
return {
type: 'CLEAR_CHOICES',
};
};
export const addGroup = (value, id, active, disabled) => {
return {
type: 'ADD_GROUP',
value,
id,
active,
disabled,
};
};
export const clearAll = () => {
return {
type: 'CLEAR_ALL',
};
2016-10-18 20:23:07 +02:00
};