forked from microsoft/BotFramework-Composer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Design tweaks to Skill Manifest Generation Wizard (microsoft#3864)
* manifest generation changes * fixed styling
- Loading branch information
Showing
16 changed files
with
301 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
Composer/packages/client/src/pages/design/exportSkillModal/content/SelectItems.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
/** @jsx jsx */ | ||
import { css, jsx } from '@emotion/core'; | ||
import React from 'react'; | ||
import { | ||
CheckboxVisibility, | ||
DetailsList, | ||
DetailsListLayoutMode, | ||
IDetailsRowProps, | ||
SelectionMode, | ||
IColumn, | ||
SelectAllVisibility, | ||
} from 'office-ui-fabric-react/lib/DetailsList'; | ||
import { Checkbox } from 'office-ui-fabric-react/lib/Checkbox'; | ||
import { IRenderFunction, ISelection, IObjectWithKey } from 'office-ui-fabric-react/lib/Utilities'; | ||
import { Sticky, StickyPositionType } from 'office-ui-fabric-react/lib/Sticky'; | ||
import { ScrollablePane, ScrollbarVisibility } from 'office-ui-fabric-react/lib/ScrollablePane'; | ||
import { TooltipHost } from 'office-ui-fabric-react/lib/Tooltip'; | ||
import formatMessage from 'format-message'; | ||
|
||
const styles = { | ||
detailListContainer: css` | ||
flex-grow: 1; | ||
height: 350px; | ||
position: relative; | ||
overflow: hidden; | ||
`, | ||
}; | ||
|
||
interface SelectItemsProps { | ||
items: any[]; | ||
selection: ISelection<IObjectWithKey>; | ||
tableColumns: IColumn[]; | ||
} | ||
|
||
export const SelectItems: React.FC<SelectItemsProps> = ({ items, selection, tableColumns }) => { | ||
const onRenderDetailsHeader = (props, defaultRender) => { | ||
return ( | ||
<Sticky isScrollSynced stickyPosition={StickyPositionType.Header}> | ||
{defaultRender({ | ||
...props, | ||
selectAllVisibility: SelectAllVisibility.hidden, | ||
onRenderColumnHeaderTooltip: (tooltipHostProps) => <TooltipHost {...tooltipHostProps} />, | ||
})} | ||
</Sticky> | ||
); | ||
}; | ||
|
||
const onRenderRow = (props?: IDetailsRowProps, defaultRender?: IRenderFunction<IDetailsRowProps>): JSX.Element => { | ||
return <div data-selection-toggle>{defaultRender && defaultRender(props)}</div>; | ||
}; | ||
|
||
const handleToggleSelectAll = () => { | ||
selection.setAllSelected(!selection.isAllSelected()); | ||
}; | ||
|
||
return ( | ||
<React.Fragment> | ||
<div css={styles.detailListContainer}> | ||
<ScrollablePane scrollbarVisibility={ScrollbarVisibility.auto}> | ||
<DetailsList | ||
checkboxVisibility={CheckboxVisibility.always} | ||
columns={tableColumns} | ||
compact={false} | ||
getKey={(item) => item.id} | ||
items={items} | ||
layoutMode={DetailsListLayoutMode.justified} | ||
selection={selection} | ||
selectionMode={SelectionMode.multiple} | ||
onRenderDetailsHeader={onRenderDetailsHeader} | ||
onRenderRow={onRenderRow} | ||
/> | ||
</ScrollablePane> | ||
</div> | ||
<Checkbox | ||
checked={selection.isAllSelected()} | ||
label={formatMessage('Select all')} | ||
styles={{ root: { marginTop: '10px' } }} | ||
onChange={handleToggleSelectAll} | ||
/> | ||
</React.Fragment> | ||
); | ||
}; |
Oops, something went wrong.