-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stephane Comeau
committed
Sep 1, 2021
1 parent
1563c7d
commit 7fb0932
Showing
7 changed files
with
98 additions
and
8 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
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
28 changes: 27 additions & 1 deletion
28
packages/web-components/fast-components/src/picker/picker.stories.ts
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 |
---|---|---|
@@ -1,7 +1,33 @@ | ||
import { html, ViewTemplate } from "@microsoft/fast-element"; | ||
import addons from "@storybook/addons"; | ||
import { STORY_RENDERED } from "@storybook/core-events"; | ||
import { Picker } from "@microsoft/fast-foundation"; | ||
import PickerTemplate from "./fixtures/picker.html"; | ||
|
||
const optionContentsTemplate: ViewTemplate = html` | ||
<div style="background: blue"> | ||
${x => x.value} | ||
</div> | ||
`; | ||
|
||
const itemContentsTemplate: ViewTemplate = html` | ||
<div style="background: purple"> | ||
${x => x.value} | ||
</div> | ||
`; | ||
|
||
addons.getChannel().addListener(STORY_RENDERED, (name: string) => { | ||
if (name.toLowerCase().startsWith("picker")) { | ||
const customTemplatePicker = document.getElementById( | ||
"customtemplatepicker" | ||
) as Picker; | ||
customTemplatePicker.menuOptionContentsTemplate = optionContentsTemplate; | ||
customTemplatePicker.listItemContentsTemplate = itemContentsTemplate; | ||
} | ||
}); | ||
|
||
export default { | ||
title: "Picker", | ||
}; | ||
|
||
export const Picker = () => PickerTemplate; | ||
export const picker = () => PickerTemplate; |
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