1
- import '.' ;
2
-
3
- import { Story } from '@storybook/web-components' ;
1
+ import { Meta , StoryFn } from '@storybook/web-components' ;
4
2
import { html } from 'lit' ;
5
3
6
4
import { ArrayOfUmbracoWords } from '../../../storyhelpers/UmbracoWordGenerator' ;
5
+ import type { UUITableRowElement } from './uui-table-row.element' ;
6
+
7
+ import '@umbraco-ui/uui-input/lib' ;
8
+ import './uui-table-row.element' ;
7
9
8
- export default {
10
+ const meta : Meta < typeof UUITableRowElement > = {
9
11
title : 'Layout/Table/Table Row' ,
10
12
component : 'uui-table-row' ,
11
13
id : 'uui-table-row' ,
12
14
} ;
13
15
14
- export const AAAOverview : Story = ( ) =>
15
- html `
16
- < uui-table
17
- aria-label ="Random Umbraco Words "
18
- aria-describedby ="table-description ">
19
- < uui-table-row >
20
- ${ ArrayOfUmbracoWords ( 3 ) . map (
16
+ export default meta ;
17
+
18
+ const Template : StoryFn < UUITableRowElement > = props => {
19
+ return html `
20
+ < uui-table >
21
+ < uui-table-row
22
+ ?selectable =${ props . selectable }
23
+ ?selectOnly =${ props . selectOnly } >
24
+ ${ ArrayOfUmbracoWords ( 5 ) . map (
25
+ el => html `< uui-table-cell > ${ el } </ uui-table-cell > `
26
+ ) }
27
+ </ uui-table-row >
28
+ < uui-table-row
29
+ ?selectable =${ props . selectable }
30
+ ?selectOnly =${ props . selectOnly } >
31
+ < uui-table-cell >
32
+ < uui-input placeholder ="Type your own thing "> </ uui-input >
33
+ </ uui-table-cell >
34
+ ${ ArrayOfUmbracoWords ( 5 ) . map (
21
35
el => html `< uui-table-cell > ${ el } </ uui-table-cell > `
22
36
) }
23
37
</ uui-table-row >
24
38
</ uui-table >
25
39
` ;
40
+ } ;
41
+
42
+ export const AAAOverview = Template . bind ( { } ) ;
26
43
AAAOverview . storyName = 'Overview' ;
27
44
28
45
AAAOverview . parameters = {
@@ -43,24 +60,10 @@ AAAOverview.parameters = {
43
60
} ,
44
61
} ;
45
62
46
- export const SelectableRows : Story = ( ) =>
47
- html `
48
- < div style ="width: 100%; ">
49
- < uui-table >
50
- < uui-table-row selectable >
51
- ${ ArrayOfUmbracoWords ( 5 ) . map (
52
- el => html `< uui-table-cell > ${ el } </ uui-table-cell > `
53
- ) }
54
- </ uui-table-row >
55
- < uui-table-row selectable >
56
- ${ ArrayOfUmbracoWords ( 5 ) . map (
57
- el => html `< uui-table-cell > ${ el } </ uui-table-cell > `
58
- ) }
59
- </ uui-table-row >
60
- </ uui-table >
61
- </ div >
62
- ` ;
63
-
63
+ export const SelectableRows = Template . bind ( { } ) ;
64
+ SelectableRows . args = {
65
+ selectable : true ,
66
+ } ;
64
67
SelectableRows . parameters = {
65
68
docs : {
66
69
source : {
0 commit comments