@@ -44,6 +44,7 @@ const PluralLinkedSelect = ({
4444 headerIcons,
4545 titles,
4646 values,
47+ valueIcons,
4748 primaryKey,
4849 secondaryKey,
4950 data,
@@ -55,6 +56,7 @@ const PluralLinkedSelect = ({
5556 addMessage,
5657 customRenderPrimary,
5758 customRenderSecondary,
59+ valueIcons,
5860} ) => {
5961 const renderValue = i => {
6062 const primary = values [ i ] ?. [ primaryKey ]
@@ -65,6 +67,7 @@ const PluralLinkedSelect = ({
6567 className = { `${ i > 0 ? 'mt-2' : '' } ` }
6668 callback = { ( [ _k , _v ] ) => callback ( i , { [ primaryKey ] : _k , [ secondaryKey ] : _v } ) }
6769 data = { data . filter ( d => primary === d || ! values . map ( v => v [ primaryKey ] ) . includes ( d ) ) }
70+ { ...( valueIcons && { icons : valueIcons } ) }
6871 init = { primary }
6972 subData = { subData }
7073 subInit = { values [ i ] ?. [ secondaryKey ] }
@@ -139,23 +142,27 @@ PluralLinkedSelect.propTypes = {
139142 callback : PropTypes . func . isRequired ,
140143 deleteCallback : PropTypes . func ,
141144 values : PropTypes . arrayOf ( PropTypes . object ) . isRequired ,
145+ valueIcons : PropTypes . array ,
142146 disableSubs : PropTypes . bool ,
143147 disableSubMessage : PropTypes . string ,
144148 addMessage : PropTypes . string ,
145149 customRenderPrimary : PropTypes . func ,
146150 customRenderSecondary : PropTypes . func ,
151+ valueIcons : PropTypes . array ,
147152}
148153
149154PluralLinkedSelect . defaultProps = {
150155 staticQuantity : null ,
151156 titles : [ ] ,
152157 headerIcons : [ ] ,
153158 deleteCallback : ( ) => { } ,
159+ valueIcons : null ,
154160 disableSubs : false ,
155161 disableSubMessage : '' ,
156162 addMessage : 'Add' ,
157163 customRenderPrimary : null ,
158164 customRenderSecondary : null ,
165+ valueIcons : null ,
159166}
160167
161168export default PluralLinkedSelect
0 commit comments