Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}]);
return FormsyDropdown;
}(_react.Component);
FormsyDropdown.propTypes = {
id: _propTypes2['default'].string,
name: _propTypes2['default'].string.isRequired,
as: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].node]),
width: _propTypes2['default'].number,
className: _propTypes2['default'].string,
inputClassName: _propTypes2['default'].string,
disabled: _propTypes2['default'].bool,
inline: _propTypes2['default'].bool,
passRequiredToField: _propTypes2['default'].bool,
inputAs: _propTypes2['default'].oneOf([_semanticUiReact.Dropdown, _semanticUiReact.Select, _semanticUiReact.Form.Dropdown, _semanticUiReact.Form.Select]),
defaultValue: _propTypes2['default'].oneOfType([_propTypes2['default'].number, _propTypes2['default'].string, _propTypes2['default'].arrayOf(_propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].number]))]),
required: _propTypes2['default'].bool,
label: _propTypes2['default'].string,
errorLabel: _propTypes2['default'].element,
isValid: _propTypes2['default'].func.isRequired,
isPristine: _propTypes2['default'].func.isRequired,
setValue: _propTypes2['default'].func.isRequired,
onBlur: _propTypes2['default'].func,
getValue: _propTypes2['default'].func.isRequired,
multiple: _propTypes2['default'].bool,
isFormSubmitted: _propTypes2['default'].func.isRequired,
getErrorMessage: _propTypes2['default'].func.isRequired,
onChange: _propTypes2['default'].func,
validationError: _propTypes2['default'].string,
validationErrors: _propTypes2['default'].object,
validations: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].object])
})
)
),
_react2.default.createElement(
_semanticUiReact.Dropdown,
{
as: _semanticUiReact.Grid.Column,
text: 'NAVIGATION MENU',
floating: true,
labeled: true,
button: true,
className: 'icon mobile-nav',
only: 'tablet mobile'
},
_react2.default.createElement(
_semanticUiReact.Dropdown.Menu,
null,
items.map(function (item, idx) {
return _react2.default.createElement(_semanticUiReact.Dropdown.Item, {
key: idx,
text: item.label,
onClick: function onClick(e) {
return handleMenuClick(e, { name: item.label });
}
});
})
)
)
);
}
}]);
} else if (fields[propName].inputControl === 'selection') {
var options = this.state[propName];
var hasOwnAPI = false;
if (Object.keys(fields[propName].list.resolvers.find.args).length !== 0 && (fields[propName].list.resolvers.create && Object.keys(fields[propName].list.resolvers.create.args).length !== 0 || fields[propName].list.resolvers.update && Object.keys(fields[propName].list.resolvers.update.args).length !== 0)) {
hasOwnAPI = true;
}
DOM = _react2.default.createElement(
'div',
{ className: 'file-form', key: idx },
_react2.default.createElement(
'label',
null,
fields[propName].label
),
!hasOwnAPI ? this.generateModal(fields, propName) : null,
options && Array.isArray(this.state[propName + 'DefaultValue']) ? _react2.default.createElement(_semanticUiReact.Dropdown, {
ref: propName,
placeholder: fields[propName].label,
id: '' + pr + propName,
fluid: true,
multiple: true,
selection: true,
search: true,
defaultValue: this.state[propName + 'DefaultValue'],
options: options
}) : null
);
} else if (type === 'markdown') {
DOM = _react2.default.createElement(_Markdown2.default, {
key: idx,
id: '' + pr + propName,
value: value,
items.map(function (item, idx) {
return _react2.default.createElement(_semanticUiReact.Dropdown.Item, {
key: idx,
text: item.label,
onClick: function onClick(e) {
return handleMenuClick(e, { name: item.label });
}
});
})
)
errorLabel: _propTypes2['default'].element,
isValid: _propTypes2['default'].func.isRequired,
isPristine: _propTypes2['default'].func.isRequired,
setValue: _propTypes2['default'].func.isRequired,
onBlur: _propTypes2['default'].func,
getValue: _propTypes2['default'].func.isRequired,
multiple: _propTypes2['default'].bool,
isFormSubmitted: _propTypes2['default'].func.isRequired,
getErrorMessage: _propTypes2['default'].func.isRequired,
onChange: _propTypes2['default'].func,
validationError: _propTypes2['default'].string,
validationErrors: _propTypes2['default'].object,
validations: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].object])
};
FormsyDropdown.defaultProps = {
inputAs: _semanticUiReact.Dropdown,
passRequiredToField: true
};
exports['default'] = (0, _formsyReact.withFormsy)(FormsyDropdown);