Merge branch 'master' into react-list-form
This commit is contained in:
commit
a88446b088
|
@ -58,7 +58,6 @@ Version|Date|Comments
|
|||
1.5|September 1, 2020|Adds ability to click on expanded section headers to collapse accordions
|
||||
1.6|September 2, 2020|Added Web Part Title, and ability to expand multiple sections
|
||||
|
||||
|
||||
## Disclaimer
|
||||
|
||||
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
|
||||
|
|
|
@ -54,7 +54,8 @@ export default class ReactAccordion extends React.Component<IReactAccordionProps
|
|||
this.getListItems();
|
||||
}
|
||||
|
||||
if (prevProps.allowMultipleExpanded !== this.props.allowMultipleExpanded || prevProps.allowZeroExpanded !== this.props.allowZeroExpanded) {
|
||||
|
||||
if(prevProps.allowMultipleExpanded !== this.props.allowMultipleExpanded || prevProps.allowZeroExpanded !== this.props.allowZeroExpanded) {
|
||||
this.setState({
|
||||
allowMultipleExpanded: this.props.allowMultipleExpanded,
|
||||
allowZeroExpanded: this.props.allowZeroExpanded
|
||||
|
@ -63,7 +64,7 @@ export default class ReactAccordion extends React.Component<IReactAccordionProps
|
|||
}
|
||||
|
||||
public render(): React.ReactElement<IReactAccordionProps> {
|
||||
const listSelected: boolean = typeof this.props.listId !== "undefined" && this.props.listId.length > 0;
|
||||
const listSelected:boolean = typeof this.props.listId !== "undefined" && this.props.listId.length > 0;
|
||||
const { allowMultipleExpanded, allowZeroExpanded } = this.state;
|
||||
return (
|
||||
<div className={styles.reactAccordion}>
|
||||
|
@ -76,29 +77,29 @@ export default class ReactAccordion extends React.Component<IReactAccordionProps
|
|||
onConfigure={this.props.onConfigure} />
|
||||
}
|
||||
{listSelected &&
|
||||
<div>
|
||||
<WebPartTitle displayMode={this.props.displayMode}
|
||||
title={this.props.accordionTitle}
|
||||
updateProperty={this.props.updateProperty}
|
||||
/>
|
||||
<Accordion allowZeroExpanded={allowZeroExpanded} allowMultipleExpanded={allowMultipleExpanded}>
|
||||
{this.state.items.map((item: any) => {
|
||||
return (
|
||||
<AccordionItem>
|
||||
<AccordionItemHeading>
|
||||
<AccordionItemButton>
|
||||
{item.Title}
|
||||
</AccordionItemButton>
|
||||
</AccordionItemHeading>
|
||||
<div>
|
||||
<WebPartTitle displayMode={this.props.displayMode}
|
||||
title={this.props.accordionTitle}
|
||||
updateProperty={this.props.updateProperty}
|
||||
/>
|
||||
<Accordion allowZeroExpanded={allowZeroExpanded} allowMultipleExpanded={allowMultipleExpanded}>
|
||||
{this.state.items.map((item:any) => {
|
||||
return (
|
||||
<AccordionItem>
|
||||
<AccordionItemHeading>
|
||||
<AccordionItemButton>
|
||||
{item.Title}
|
||||
</AccordionItemButton>
|
||||
</AccordionItemHeading>
|
||||
<AccordionItemPanel>
|
||||
<p dangerouslySetInnerHTML={{ __html: item.Content }} />
|
||||
</AccordionItemPanel>
|
||||
</AccordionItem>
|
||||
);
|
||||
})
|
||||
}
|
||||
</Accordion>
|
||||
</div>
|
||||
}
|
||||
</Accordion>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue