@scania/tegel 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/tds-dropdown.cjs.entry.js +17 -13
- package/dist/cjs/tds-header-cell.cjs.entry.js +2 -2
- package/dist/cjs/tds-icon.cjs.entry.js +3 -2
- package/dist/cjs/tds-modal.cjs.entry.js +1 -1
- package/dist/cjs/tegel.cjs.js +1 -1
- package/dist/collection/components/dropdown/dropdown.css +1 -0
- package/dist/collection/components/dropdown/dropdown.js +16 -12
- package/dist/collection/components/icon/icon.js +23 -5
- package/dist/collection/components/modal/modal.css +1 -1
- package/dist/collection/components/table/table-header-cell/table-header-cell.js +13 -10
- package/dist/components/icon.js +4 -2
- package/dist/components/tds-dropdown.js +17 -13
- package/dist/components/tds-header-cell.js +2 -2
- package/dist/components/tds-modal.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tds-dropdown.entry.js +17 -13
- package/dist/esm/tds-header-cell.entry.js +2 -2
- package/dist/esm/tds-icon.entry.js +3 -2
- package/dist/esm/tds-modal.entry.js +1 -1
- package/dist/esm/tegel.js +1 -1
- package/dist/tegel/p-15f8ac46.entry.js +1 -0
- package/dist/tegel/p-3b597a64.entry.js +1 -0
- package/dist/tegel/{p-6dc8f2dd.entry.js → p-78853c02.entry.js} +1 -1
- package/dist/tegel/p-7d93c35b.entry.js +1 -0
- package/dist/tegel/tegel.esm.js +1 -1
- package/dist/types/components/dropdown/dropdown.d.ts +2 -0
- package/dist/types/components/icon/icon.d.ts +6 -3
- package/dist/types/components/table/table-header-cell/table-header-cell.d.ts +14 -8
- package/dist/types/components.d.ts +20 -12
- package/package.json +1 -1
- package/dist/collection/components/accordion/accordion.stories.js +0 -100
- package/dist/collection/components/accordion/test/basic/accordion.e2e.js +0 -19
- package/dist/collection/components/accordion/test/disabled/accordion.e2e.js +0 -19
- package/dist/collection/components/accordion/test/expanded/accordion.e2e.js +0 -24
- package/dist/collection/components/accordion/test/padding-reset/accordion.e2e.js +0 -24
- package/dist/collection/components/badge/badge.stories.js +0 -106
- package/dist/collection/components/badge/test/basic/badge.e2e.js +0 -10
- package/dist/collection/components/badge/test/value/badge.e2e.js +0 -11
- package/dist/collection/components/banner/banner.stories.js +0 -92
- package/dist/collection/components/banner/test/basic/banner.e2e.js +0 -15
- package/dist/collection/components/banner/test/default/banner.e2e.js +0 -37
- package/dist/collection/components/banner/test/error/banner.e2e.js +0 -15
- package/dist/collection/components/banner/test/information/banner.e2e.js +0 -15
- package/dist/collection/components/block/block.stories.js +0 -49
- package/dist/collection/components/breadcrumbs/breadcrumbs.stories.js +0 -36
- package/dist/collection/components/breadcrumbs/test/default/breadcrumbs.e2e.js +0 -33
- package/dist/collection/components/button/button.stories.js +0 -185
- package/dist/collection/components/button/test/basic/button.e2e.js +0 -35
- package/dist/collection/components/button/test/danger/button.e2e.js +0 -18
- package/dist/collection/components/button/test/disabled/button.e2e.js +0 -24
- package/dist/collection/components/button/test/ghost/button.e2e.js +0 -18
- package/dist/collection/components/button/test/icon/button.e2e.js +0 -38
- package/dist/collection/components/button/test/secondary/button.e2e.js +0 -18
- package/dist/collection/components/card/card.stories.js +0 -163
- package/dist/collection/components/card/test/basic/card.e2e.js +0 -10
- package/dist/collection/components/card/test/clickable/card.e2e.js +0 -21
- package/dist/collection/components/card/test/default/card.e2e.js +0 -33
- package/dist/collection/components/checkbox/checkbox.stories.js +0 -93
- package/dist/collection/components/chip/chip.stories.js +0 -230
- package/dist/collection/components/datetime/datetime.stories.js +0 -219
- package/dist/collection/components/divider/divider.stories.js +0 -62
- package/dist/collection/components/dropdown/dropdown.stories.js +0 -260
- package/dist/collection/components/dropdown/test/basic/dropdown.e2e.js +0 -41
- package/dist/collection/components/dropdown/test/default/dropdown.e2e.js +0 -76
- package/dist/collection/components/dropdown/test/error/dropdown.e2e.js +0 -36
- package/dist/collection/components/dropdown/test/filter/dropdown.e2e.js +0 -56
- package/dist/collection/components/dropdown/test/filter/hide-no-result-message/dropdown.e2e.js +0 -23
- package/dist/collection/components/dropdown/test/filter/normalize-text-false/dropdown.e2e.js +0 -43
- package/dist/collection/components/dropdown/test/multiselect/dropdown.e2e.js +0 -81
- package/dist/collection/components/footer/footer.stories.js +0 -145
- package/dist/collection/components/footer/test/default/footer.e2e.js +0 -34
- package/dist/collection/components/header/header.stories.js +0 -82
- package/dist/collection/components/header/test/default/header.e2e.js +0 -44
- package/dist/collection/components/icon/icon.stories.js +0 -48
- package/dist/collection/components/link/link.stories.js +0 -59
- package/dist/collection/components/message/message.stories.js +0 -109
- package/dist/collection/components/message/test/basic/message.e2e.js +0 -16
- package/dist/collection/components/message/test/error/message.e2e.js +0 -28
- package/dist/collection/components/message/test/information/message.e2e.js +0 -10
- package/dist/collection/components/message/test/success/message.e2e.js +0 -10
- package/dist/collection/components/message/test/warning/message.e2e.js +0 -10
- package/dist/collection/components/modal/modal.stories.js +0 -119
- package/dist/collection/components/modal/test/default/modal.e2e.js +0 -28
- package/dist/collection/components/modal/test/open-close/modal.e2e.js +0 -63
- package/dist/collection/components/modal/test/prevent-true/modal.e2e.js +0 -13
- package/dist/collection/components/popover-canvas/popover-canvas.stories.js +0 -92
- package/dist/collection/components/popover-canvas/test/default/popover-canvas.e2e.js +0 -30
- package/dist/collection/components/popover-canvas/test/show-false/popover-canvas.e2e.js +0 -30
- package/dist/collection/components/popover-canvas/test/show-true/popover-canvas.e2e.js +0 -30
- package/dist/collection/components/popover-menu/popover-menu.stories.js +0 -146
- package/dist/collection/components/popover-menu/test/default/popover-menu.e2e.js +0 -60
- package/dist/collection/components/popover-menu/test/icons-fluid/popover-menu.e2e.js +0 -27
- package/dist/collection/components/popover-menu/test/show/popover-menu.e2e.js +0 -20
- package/dist/collection/components/popover-menu/test/show-false/popover-menu.e2e.js +0 -20
- package/dist/collection/components/radio-button/radio-button.stories.js +0 -91
- package/dist/collection/components/side-menu/side-menu.stories.js +0 -224
- package/dist/collection/components/side-menu/test/collapsible/side-menu.e2e.js +0 -28
- package/dist/collection/components/side-menu/test/default/side-menu.e2e.js +0 -38
- package/dist/collection/components/slider/slider.stories.js +0 -243
- package/dist/collection/components/spinner/spinner.stories.js +0 -61
- package/dist/collection/components/stepper/stepper.stories.js +0 -95
- package/dist/collection/components/table/table/test/batch/table.e2e.js +0 -24
- package/dist/collection/components/table/table/test/default/table.e2e.js +0 -46
- package/dist/collection/components/table/table/test/expandable-row/table.e2e.js +0 -64
- package/dist/collection/components/table/table/test/filtering/table.e2e.js +0 -41
- package/dist/collection/components/table/table/test/multiselect/table.e2e.js +0 -47
- package/dist/collection/components/table/table/test/pagination/table.e2e.js +0 -53
- package/dist/collection/components/table/table/test/sorting/table.e2e.js +0 -36
- package/dist/collection/components/table/table-component-basic.stories.js +0 -184
- package/dist/collection/components/table/table-component-batch-actions.stories.js +0 -188
- package/dist/collection/components/table/table-component-custom-width.stories.js +0 -174
- package/dist/collection/components/table/table-component-expandable-rows.stories.js +0 -160
- package/dist/collection/components/table/table-component-filtering.stories.js +0 -195
- package/dist/collection/components/table/table-component-multiselect.stories.js +0 -211
- package/dist/collection/components/table/table-component-pagination.stories.js +0 -196
- package/dist/collection/components/table/table-component-sorting.stories.js +0 -240
- package/dist/collection/components/tabs/folder-tabs/folder-tabs.stories.js +0 -105
- package/dist/collection/components/tabs/inline-tabs/inline-tabs.stories.js +0 -99
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.stories.js +0 -101
- package/dist/collection/components/text-field/text-field.stories.js +0 -247
- package/dist/collection/components/textarea/test/basic/textarea.e2e.js +0 -26
- package/dist/collection/components/textarea/test/default/textarea.e2e.js +0 -34
- package/dist/collection/components/textarea/test/read-only/textarea.e2e.js +0 -26
- package/dist/collection/components/textarea/textarea.stories.js +0 -188
- package/dist/collection/components/toast/toast.stories.js +0 -90
- package/dist/collection/components/toggle/toggle.stories.js +0 -95
- package/dist/collection/components/tooltip/tooltip.stories.js +0 -126
- package/dist/collection/stories/Installation/angular.stories.js +0 -111
- package/dist/collection/stories/Installation/javascript.stories.js +0 -99
- package/dist/collection/stories/Installation/react.stories.js +0 -117
- package/dist/collection/stories/announcements/announce-tegel.stories.js +0 -262
- package/dist/collection/stories/announcements/prefix-change.stories.js +0 -93
- package/dist/collection/stories/formatHtmlPreview.js +0 -10
- package/dist/collection/stories/foundations/color/color-brand.stories.js +0 -38
- package/dist/collection/stories/foundations/color/color-scales.stories.js +0 -71
- package/dist/collection/stories/foundations/color/color-semantic.stories.js +0 -40
- package/dist/collection/stories/foundations/grid/grid.stories.js +0 -386
- package/dist/collection/stories/foundations/spacing/spacing-element.stories.js +0 -100
- package/dist/collection/stories/foundations/spacing/spacing-layout.stories.js +0 -94
- package/dist/collection/stories/foundations/typography/typography-body.stories.js +0 -16
- package/dist/collection/stories/foundations/typography/typography-detail.stories.js +0 -17
- package/dist/collection/stories/foundations/typography/typography-headline.stories.js +0 -39
- package/dist/collection/stories/foundations/typography/typography-paragraph.stories.js +0 -12
- package/dist/collection/stories/patterns/navigation/navigation-basic.stories.js +0 -85
- package/dist/collection/stories/patterns/navigation/navigation-fewitems.stories.js +0 -259
- package/dist/collection/stories/patterns/navigation/navigation-manyitems.stories.js +0 -247
- package/dist/collection/stories/patterns/navigation/navigation-user-menu.stories.js +0 -140
- package/dist/collection/stories/tegel.stories.js +0 -283
- package/dist/collection/stories/utility/color/background-color.stories.js +0 -96
- package/dist/collection/stories/utility/color/text-color.stories.js +0 -94
- package/dist/tegel/p-556600b1.entry.js +0 -1
- package/dist/tegel/p-c6553022.entry.js +0 -1
- package/dist/tegel/p-f801cf0e.entry.js +0 -1
- package/dist/types/components/accordion/accordion.stories.d.ts +0 -77
- package/dist/types/components/badge/badge.stories.d.ts +0 -73
- package/dist/types/components/banner/banner.stories.d.ts +0 -69
- package/dist/types/components/block/block.stories.d.ts +0 -32
- package/dist/types/components/breadcrumbs/breadcrumbs.stories.d.ts +0 -16
- package/dist/types/components/button/button.stories.d.ts +0 -147
- package/dist/types/components/card/card.stories.d.ts +0 -128
- package/dist/types/components/checkbox/checkbox.stories.d.ts +0 -65
- package/dist/types/components/chip/chip.stories.d.ts +0 -99
- package/dist/types/components/datetime/datetime.stories.d.ts +0 -151
- package/dist/types/components/divider/divider.stories.d.ts +0 -58
- package/dist/types/components/dropdown/dropdown.stories.d.ts +0 -205
- package/dist/types/components/footer/footer.stories.d.ts +0 -44
- package/dist/types/components/header/header.stories.d.ts +0 -32
- package/dist/types/components/icon/icon.stories.d.ts +0 -36
- package/dist/types/components/link/link.stories.d.ts +0 -44
- package/dist/types/components/message/message.stories.d.ts +0 -88
- package/dist/types/components/modal/modal.stories.d.ts +0 -78
- package/dist/types/components/popover-canvas/popover-canvas.stories.d.ts +0 -27
- package/dist/types/components/popover-menu/popover-menu.stories.d.ts +0 -51
- package/dist/types/components/radio-button/radio-button.stories.d.ts +0 -39
- package/dist/types/components/side-menu/side-menu.stories.d.ts +0 -65
- package/dist/types/components/slider/slider.stories.d.ts +0 -235
- package/dist/types/components/spinner/spinner.stories.d.ts +0 -46
- package/dist/types/components/stepper/stepper.stories.d.ts +0 -80
- package/dist/types/components/table/table-component-basic.stories.d.ts +0 -144
- package/dist/types/components/table/table-component-batch-actions.stories.d.ts +0 -139
- package/dist/types/components/table/table-component-custom-width.stories.d.ts +0 -131
- package/dist/types/components/table/table-component-expandable-rows.stories.d.ts +0 -131
- package/dist/types/components/table/table-component-filtering.stories.d.ts +0 -131
- package/dist/types/components/table/table-component-multiselect.stories.d.ts +0 -147
- package/dist/types/components/table/table-component-pagination.stories.d.ts +0 -131
- package/dist/types/components/table/table-component-sorting.stories.d.ts +0 -183
- package/dist/types/components/tabs/folder-tabs/folder-tabs.stories.d.ts +0 -69
- package/dist/types/components/tabs/inline-tabs/inline-tabs.stories.d.ts +0 -61
- package/dist/types/components/tabs/navigation-tabs/navigation-tabs.stories.d.ts +0 -61
- package/dist/types/components/text-field/text-field.stories.d.ts +0 -201
- package/dist/types/components/textarea/textarea.stories.d.ts +0 -139
- package/dist/types/components/toast/toast.stories.d.ts +0 -64
- package/dist/types/components/toggle/toggle.stories.d.ts +0 -74
- package/dist/types/components/tooltip/tooltip.stories.d.ts +0 -66
- package/dist/types/stories/Installation/angular.stories.d.ts +0 -6
- package/dist/types/stories/Installation/javascript.stories.d.ts +0 -7
- package/dist/types/stories/Installation/react.stories.d.ts +0 -6
- package/dist/types/stories/announcements/announce-tegel.stories.d.ts +0 -6
- package/dist/types/stories/announcements/prefix-change.stories.d.ts +0 -6
- package/dist/types/stories/formatHtmlPreview.d.ts +0 -2
- package/dist/types/stories/foundations/color/color-brand.stories.d.ts +0 -13
- package/dist/types/stories/foundations/color/color-scales.stories.d.ts +0 -30
- package/dist/types/stories/foundations/color/color-semantic.stories.d.ts +0 -13
- package/dist/types/stories/foundations/grid/grid.stories.d.ts +0 -35
- package/dist/types/stories/foundations/spacing/spacing-element.stories.d.ts +0 -8
- package/dist/types/stories/foundations/spacing/spacing-layout.stories.d.ts +0 -8
- package/dist/types/stories/foundations/typography/typography-body.stories.d.ts +0 -8
- package/dist/types/stories/foundations/typography/typography-detail.stories.d.ts +0 -8
- package/dist/types/stories/foundations/typography/typography-headline.stories.d.ts +0 -21
- package/dist/types/stories/foundations/typography/typography-paragraph.stories.d.ts +0 -8
- package/dist/types/stories/patterns/navigation/navigation-basic.stories.d.ts +0 -23
- package/dist/types/stories/patterns/navigation/navigation-fewitems.stories.d.ts +0 -23
- package/dist/types/stories/patterns/navigation/navigation-manyitems.stories.d.ts +0 -38
- package/dist/types/stories/patterns/navigation/navigation-user-menu.stories.d.ts +0 -33
- package/dist/types/stories/tegel.stories.d.ts +0 -6
- package/dist/types/stories/utility/color/background-color.stories.d.ts +0 -64
- package/dist/types/stories/utility/color/text-color.stories.d.ts +0 -64
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import formatHtmlPreview from "../../stories/formatHtmlPreview";
|
|
2
|
-
import readme from "./readme.md";
|
|
3
|
-
import { ComponentsFolder } from "../../utils/constants";
|
|
4
|
-
export default {
|
|
5
|
-
title: `${ComponentsFolder}/Spinner`,
|
|
6
|
-
parameters: {
|
|
7
|
-
layout: 'centered',
|
|
8
|
-
notes: readme,
|
|
9
|
-
design: [
|
|
10
|
-
{
|
|
11
|
-
name: 'Figma',
|
|
12
|
-
type: 'figma',
|
|
13
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=10259%3A29263&t=Ne6myqwca5m00de7-1',
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: 'Link',
|
|
17
|
-
type: 'link',
|
|
18
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=10259%3A29263&t=Ne6myqwca5m00de7-1',
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
},
|
|
22
|
-
argTypes: {
|
|
23
|
-
variant: {
|
|
24
|
-
name: 'Variant',
|
|
25
|
-
description: 'Switches the variant of the Spinner.',
|
|
26
|
-
control: {
|
|
27
|
-
type: 'radio',
|
|
28
|
-
},
|
|
29
|
-
options: ['Standard', 'Inverted'],
|
|
30
|
-
table: {
|
|
31
|
-
defaultValue: { summary: 'standard' },
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
size: {
|
|
35
|
-
name: 'Size',
|
|
36
|
-
description: 'Sets the size of the Spinner.',
|
|
37
|
-
control: {
|
|
38
|
-
type: 'radio',
|
|
39
|
-
},
|
|
40
|
-
options: ['Large', 'Medium', 'Small', 'Extra small'],
|
|
41
|
-
table: {
|
|
42
|
-
defaultValue: { summary: 'lg' },
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
args: {
|
|
47
|
-
variant: 'Standard',
|
|
48
|
-
size: 'Large',
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
const Template = ({ size, variant }) => {
|
|
52
|
-
const sizeLookup = { 'Large': 'lg', 'Medium': 'md', 'Small': 'sm', 'Extra small': 'xs' };
|
|
53
|
-
const variantLookup = { Standard: 'standard', Inverted: 'inverted' };
|
|
54
|
-
return formatHtmlPreview(`
|
|
55
|
-
<tds-spinner
|
|
56
|
-
size="${sizeLookup[size]}"
|
|
57
|
-
variant="${variantLookup[variant]}">
|
|
58
|
-
</tds-spinner>
|
|
59
|
-
`);
|
|
60
|
-
};
|
|
61
|
-
export const Default = Template.bind({});
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import formatHtmlPreview from "../../stories/formatHtmlPreview";
|
|
2
|
-
import readmeStepper from "./readme.md";
|
|
3
|
-
import readmeStep from "./step/readme.md";
|
|
4
|
-
import { ComponentsFolder } from "../../utils/constants";
|
|
5
|
-
export default {
|
|
6
|
-
title: `${ComponentsFolder}/Stepper`,
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: 'centered',
|
|
9
|
-
design: [
|
|
10
|
-
{
|
|
11
|
-
name: 'Figma',
|
|
12
|
-
type: 'figma',
|
|
13
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=10508%3A32221&t=Ne6myqwca5m00de7-1',
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: 'Link',
|
|
17
|
-
type: 'link',
|
|
18
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=10508%3A32221&t=Ne6myqwca5m00de7-1',
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
notes: { Stepper: readmeStepper, Step: readmeStep },
|
|
22
|
-
},
|
|
23
|
-
argTypes: {
|
|
24
|
-
size: {
|
|
25
|
-
name: 'Size',
|
|
26
|
-
description: 'Sets the size of the Stepper.',
|
|
27
|
-
control: {
|
|
28
|
-
type: 'radio',
|
|
29
|
-
},
|
|
30
|
-
options: ['Large', 'Small'],
|
|
31
|
-
table: {
|
|
32
|
-
defaultValue: { summary: 'lg' },
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
orientation: {
|
|
36
|
-
name: 'Orientation',
|
|
37
|
-
description: 'Sets the orientation which the Stepper is displayed.',
|
|
38
|
-
control: {
|
|
39
|
-
type: 'radio',
|
|
40
|
-
},
|
|
41
|
-
options: ['Horizontal', 'Vertical'],
|
|
42
|
-
table: {
|
|
43
|
-
defaultValue: { summary: 'horizontal' },
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
labelPosition: {
|
|
47
|
-
name: 'Text position',
|
|
48
|
-
description: 'Sets the position of the text, only available when the orientation is horizontal.',
|
|
49
|
-
control: {
|
|
50
|
-
type: 'radio',
|
|
51
|
-
},
|
|
52
|
-
options: ['Below', 'Aside'],
|
|
53
|
-
if: { arg: 'orientation', neq: 'Vertical' },
|
|
54
|
-
table: {
|
|
55
|
-
defaultValue: { summary: 'below' },
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
hideLabels: {
|
|
59
|
-
name: 'Hide labels',
|
|
60
|
-
description: 'Hides the labels for all Stepper Items.',
|
|
61
|
-
control: {
|
|
62
|
-
type: 'boolean',
|
|
63
|
-
},
|
|
64
|
-
table: {
|
|
65
|
-
defaultValue: { summary: false },
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
args: {
|
|
70
|
-
size: 'Large',
|
|
71
|
-
orientation: 'Horizontal',
|
|
72
|
-
labelPosition: 'Below',
|
|
73
|
-
hideLabels: false,
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
const sizeLookUp = {
|
|
77
|
-
Large: 'lg',
|
|
78
|
-
Small: 'sm',
|
|
79
|
-
};
|
|
80
|
-
const Template = ({ size, orientation, labelPosition, hideLabels }) => formatHtmlPreview(`<tds-stepper ${hideLabels ? 'hide-labels' : ''} size="${sizeLookUp[size]}" ${orientation === 'Horizontal' ? `label-position="${labelPosition === null || labelPosition === void 0 ? void 0 : labelPosition.toLowerCase()}"` : ''} orientation="${orientation.toLowerCase()}">
|
|
81
|
-
<tds-step state="success" index="1">
|
|
82
|
-
<div slot="label">Success step</div>
|
|
83
|
-
</tds-step>
|
|
84
|
-
<tds-step state="error" index="2">
|
|
85
|
-
<div slot="label">Error step</div>
|
|
86
|
-
</tds-step>
|
|
87
|
-
<tds-step state="current" index="3">
|
|
88
|
-
<div slot="label">Current step</div>
|
|
89
|
-
</tds-step>
|
|
90
|
-
<tds-step index="4">
|
|
91
|
-
<div slot="label">Upcoming step</div>
|
|
92
|
-
</tds-step>
|
|
93
|
-
</tds-stepper>
|
|
94
|
-
`);
|
|
95
|
-
export const Default = Template.bind({});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { test } from "stencil-playwright";
|
|
2
|
-
import { expect } from "@playwright/test";
|
|
3
|
-
const componentTestPath = 'src/components/table/table/test/batch/index.html';
|
|
4
|
-
test.describe('tds-table-batch', () => {
|
|
5
|
-
test('renders batch table correctly', async ({ page }) => {
|
|
6
|
-
await page.goto(componentTestPath);
|
|
7
|
-
const tableComponent = page.getByRole('table');
|
|
8
|
-
await expect(tableComponent).toHaveCount(1);
|
|
9
|
-
/* Check diff on screenshot */
|
|
10
|
-
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
|
|
11
|
-
});
|
|
12
|
-
test('table has a settings button', async ({ page }) => {
|
|
13
|
-
await page.goto(componentTestPath);
|
|
14
|
-
const tdsTableToolbarSettings = page.getByRole('img');
|
|
15
|
-
await expect(tdsTableToolbarSettings).toHaveCount(1);
|
|
16
|
-
await expect(tdsTableToolbarSettings).toBeVisible();
|
|
17
|
-
});
|
|
18
|
-
test('table has a [Download] button', async ({ page }) => {
|
|
19
|
-
await page.goto(componentTestPath);
|
|
20
|
-
const tdsTableToolbarDownloadButton = page.getByRole('button', { name: /Download/ });
|
|
21
|
-
await expect(tdsTableToolbarDownloadButton).toHaveCount(1);
|
|
22
|
-
await expect(tdsTableToolbarDownloadButton).toBeVisible();
|
|
23
|
-
});
|
|
24
|
-
});
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { test } from "stencil-playwright";
|
|
2
|
-
import { expect } from "@playwright/test";
|
|
3
|
-
const componentTestPath = 'src/components/table/table/test/default/index.html';
|
|
4
|
-
test.describe('tds-table-default', () => {
|
|
5
|
-
test('renders default table correctly', async ({ page }) => {
|
|
6
|
-
await page.goto(componentTestPath);
|
|
7
|
-
const tableComponent = page.getByRole('table');
|
|
8
|
-
await expect(tableComponent).toHaveCount(1);
|
|
9
|
-
/** Check screenshot diff */
|
|
10
|
-
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
|
|
11
|
-
});
|
|
12
|
-
test('table has four columns', async ({ page }) => {
|
|
13
|
-
await page.goto(componentTestPath);
|
|
14
|
-
const tableHeaderCells = page.locator('tds-header-cell');
|
|
15
|
-
await expect(tableHeaderCells).toHaveCount(4);
|
|
16
|
-
});
|
|
17
|
-
test('columns are: Truck type, Driver name, Country, Mileage', async ({ page }) => {
|
|
18
|
-
await page.goto(componentTestPath);
|
|
19
|
-
/* Expect each header to be visible */
|
|
20
|
-
await expect(page.getByText('Truck type')).toBeVisible();
|
|
21
|
-
await expect(page.getByText('Driver name')).toBeVisible();
|
|
22
|
-
await expect(page.getByText('Country')).toBeVisible();
|
|
23
|
-
await expect(page.getByText('Mileage')).toBeVisible();
|
|
24
|
-
});
|
|
25
|
-
test('Row should contain the correct number of rows with', async ({ page }) => {
|
|
26
|
-
await page.goto(componentTestPath);
|
|
27
|
-
/* Expect the number of rows to be correct amount */
|
|
28
|
-
const tableBodyRows = page.locator('tds-table-body-row');
|
|
29
|
-
await expect(tableBodyRows).toHaveCount(6);
|
|
30
|
-
});
|
|
31
|
-
test('table has the correct text inside each cell', async ({ page }) => {
|
|
32
|
-
await page.goto(componentTestPath);
|
|
33
|
-
/* Checks all rows to see that they have the correct amount of tds-body-cells with values provided */
|
|
34
|
-
const promises = [];
|
|
35
|
-
for (let i = 1; i <= 8; i++) {
|
|
36
|
-
const tableBodyCellHasText = page
|
|
37
|
-
.locator('tds-body-cell')
|
|
38
|
-
.filter({ hasText: `Test value ${i}` });
|
|
39
|
-
promises.push(expect(tableBodyCellHasText).toHaveCount(3));
|
|
40
|
-
promises.push(expect(tableBodyCellHasText.first()).toBeVisible());
|
|
41
|
-
promises.push(expect(tableBodyCellHasText.nth(1)).toBeVisible());
|
|
42
|
-
promises.push(expect(tableBodyCellHasText.nth(2)).toBeVisible());
|
|
43
|
-
}
|
|
44
|
-
await Promise.all(promises);
|
|
45
|
-
});
|
|
46
|
-
});
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { test } from "stencil-playwright";
|
|
2
|
-
import { expect } from "@playwright/test";
|
|
3
|
-
const componentTestPath = 'src/components/table/table/test/expandable-row/index.html';
|
|
4
|
-
test.describe('tds-table-expandable-row', () => {
|
|
5
|
-
test('render expandable-row table correctly', async ({ page }) => {
|
|
6
|
-
await page.goto(componentTestPath);
|
|
7
|
-
const tableComponent = page.getByRole('table');
|
|
8
|
-
await expect(tableComponent).toHaveCount(1);
|
|
9
|
-
/* check of diff in component screenshot */
|
|
10
|
-
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
|
|
11
|
-
});
|
|
12
|
-
test('each row has expand checkbox', async ({ page }) => {
|
|
13
|
-
await page.goto(componentTestPath);
|
|
14
|
-
const tableBodyRowsExpandInput = page.getByRole('cell').getByRole('checkbox');
|
|
15
|
-
await expect(tableBodyRowsExpandInput).toHaveCount(3);
|
|
16
|
-
});
|
|
17
|
-
test('under first row opened expanded row with text "Hello world 1"', async ({ page }) => {
|
|
18
|
-
await page.goto(componentTestPath);
|
|
19
|
-
const tableBodyRowFirstInput = page.getByRole('cell').nth(1);
|
|
20
|
-
const tableBodyExpandableRowSlot = page.getByText(/Hello world 1/);
|
|
21
|
-
await expect(tableBodyRowFirstInput).toHaveCount(1);
|
|
22
|
-
await expect(tableBodyExpandableRowSlot).toHaveCount(1);
|
|
23
|
-
await expect(tableBodyExpandableRowSlot).toBeHidden();
|
|
24
|
-
await tableBodyRowFirstInput.click();
|
|
25
|
-
await expect(tableBodyExpandableRowSlot).toBeVisible();
|
|
26
|
-
/* check input screenshot diff */
|
|
27
|
-
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
|
|
28
|
-
});
|
|
29
|
-
test('under second row opened expanded row with text "Hello to you too"', async ({ page }) => {
|
|
30
|
-
await page.goto(componentTestPath);
|
|
31
|
-
const tableBodyRowSecondInput = page.getByRole('cell').nth(2);
|
|
32
|
-
const tableBodyExpandableRowSlot = page.getByText(/Hello to you too/);
|
|
33
|
-
await expect(tableBodyRowSecondInput).toHaveCount(1);
|
|
34
|
-
await expect(tableBodyExpandableRowSlot).toHaveCount(1);
|
|
35
|
-
await expect(tableBodyExpandableRowSlot).toBeHidden();
|
|
36
|
-
await tableBodyRowSecondInput.click();
|
|
37
|
-
await expect(tableBodyExpandableRowSlot).toBeVisible();
|
|
38
|
-
/* check input screenshot diff */
|
|
39
|
-
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
|
|
40
|
-
});
|
|
41
|
-
test('under third row opened expanded row with a button with text "Call to action"', async ({ page, }) => {
|
|
42
|
-
await page.goto(componentTestPath);
|
|
43
|
-
const tableBodyRowThirdInput = page.getByRole('cell').nth(3);
|
|
44
|
-
const tableBodyRowButton = page.getByText(/Call to action/);
|
|
45
|
-
await expect(tableBodyRowThirdInput).toHaveCount(1);
|
|
46
|
-
await expect(tableBodyRowButton).toHaveCount(1);
|
|
47
|
-
await expect(tableBodyRowButton).toBeHidden();
|
|
48
|
-
await tableBodyRowThirdInput.click();
|
|
49
|
-
await expect(tableBodyRowButton).toBeVisible();
|
|
50
|
-
/* check input screenshot diff */
|
|
51
|
-
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
|
|
52
|
-
});
|
|
53
|
-
test('double click on expand button in first row -> expanded row should be closed', async ({ page, }) => {
|
|
54
|
-
await page.goto(componentTestPath);
|
|
55
|
-
const tableBodyRowFirstInput = page.getByRole('cell').nth(1);
|
|
56
|
-
await tableBodyRowFirstInput.dblclick();
|
|
57
|
-
const tableBodyFirstExpandableRowSlot = page.getByText(/Hello world 1/);
|
|
58
|
-
const tableBodySecondExpandableRowSlot = page.getByText(/Hello to you too/);
|
|
59
|
-
const tableBodyThirdExpandableRowSlot = page.getByText(/Call to action/);
|
|
60
|
-
await expect(tableBodyFirstExpandableRowSlot).toBeHidden();
|
|
61
|
-
await expect(tableBodySecondExpandableRowSlot).toBeHidden();
|
|
62
|
-
await expect(tableBodyThirdExpandableRowSlot).toBeHidden();
|
|
63
|
-
});
|
|
64
|
-
});
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { test } from "stencil-playwright";
|
|
2
|
-
import { expect } from "@playwright/test";
|
|
3
|
-
const componentTestPath = 'src/components/table/table/test/filtering/index.html';
|
|
4
|
-
test.describe('tds-table-filtering', () => {
|
|
5
|
-
test('renders filtering table correctly', async ({ page }) => {
|
|
6
|
-
await page.goto(componentTestPath);
|
|
7
|
-
const tableComponent = page.getByRole('table');
|
|
8
|
-
await expect(tableComponent).toHaveCount(1);
|
|
9
|
-
/* Check diff of screenshot */
|
|
10
|
-
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
|
|
11
|
-
});
|
|
12
|
-
test('table has header "Filter"', async ({ page }) => {
|
|
13
|
-
await page.goto(componentTestPath);
|
|
14
|
-
/* Search for header by text and see if it exists */
|
|
15
|
-
const tdsTableToolbarCaption = page.getByText('Filter');
|
|
16
|
-
await expect(tdsTableToolbarCaption).toHaveCount(1);
|
|
17
|
-
await expect(tdsTableToolbarCaption).toBeVisible();
|
|
18
|
-
});
|
|
19
|
-
test('search button inside the header exists', async ({ page }) => {
|
|
20
|
-
await page.goto(componentTestPath);
|
|
21
|
-
const tdsTableToolbarSearchIcon = page.getByRole('img');
|
|
22
|
-
await expect(tdsTableToolbarSearchIcon).toHaveCount(1);
|
|
23
|
-
await expect(tdsTableToolbarSearchIcon).toBeVisible();
|
|
24
|
-
});
|
|
25
|
-
test('look for textbox and click it', async ({ page }) => {
|
|
26
|
-
await page.goto(componentTestPath);
|
|
27
|
-
const tdsTableToolbarSearchInput = page.getByRole('textbox');
|
|
28
|
-
await tdsTableToolbarSearchInput.click();
|
|
29
|
-
/* Check diff of screenshot after click */
|
|
30
|
-
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
|
|
31
|
-
});
|
|
32
|
-
test('clicking on search button opens field for entering data', async ({ page }) => {
|
|
33
|
-
await page.goto(componentTestPath);
|
|
34
|
-
const tdsTableToolbarSearchInput = page.getByRole('textbox');
|
|
35
|
-
await expect(tdsTableToolbarSearchInput).toHaveCount(1);
|
|
36
|
-
await expect(tdsTableToolbarSearchInput).toBeVisible();
|
|
37
|
-
await tdsTableToolbarSearchInput.fill('Some test text');
|
|
38
|
-
/* Check diff of screenshot after filled */
|
|
39
|
-
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
|
|
40
|
-
});
|
|
41
|
-
});
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { test } from "stencil-playwright";
|
|
2
|
-
import { expect } from "@playwright/test";
|
|
3
|
-
const componentTestPath = 'src/components/table/table/test/multiselect/index.html';
|
|
4
|
-
test.describe('tds-table-multiselect', () => {
|
|
5
|
-
test('renders multiselect table correctly', async ({ page }) => {
|
|
6
|
-
await page.goto(componentTestPath);
|
|
7
|
-
const tableComponent = page.getByRole('table');
|
|
8
|
-
await expect(tableComponent).toHaveCount(1);
|
|
9
|
-
/* Check diff on screenshot for component */
|
|
10
|
-
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
|
|
11
|
-
});
|
|
12
|
-
test('table header contains checkbox', async ({ page }) => {
|
|
13
|
-
await page.goto(componentTestPath);
|
|
14
|
-
const tableHeaderCheckbox = page.getByRole('checkbox').first();
|
|
15
|
-
await expect(tableHeaderCheckbox).toHaveCount(1);
|
|
16
|
-
await expect(tableHeaderCheckbox).toBeVisible();
|
|
17
|
-
});
|
|
18
|
-
test('row should contain the correct number of checkboxes in each row', async ({ page }) => {
|
|
19
|
-
await page.goto(componentTestPath);
|
|
20
|
-
const tableBodyRowCheckboxes = page.getByRole('checkbox');
|
|
21
|
-
await expect(tableBodyRowCheckboxes).toHaveCount(5);
|
|
22
|
-
/* Check if each checkbox is visible */
|
|
23
|
-
const promises = [];
|
|
24
|
-
for (let i = 0; i < 5; i++) {
|
|
25
|
-
promises.push(expect(tableBodyRowCheckboxes.nth(i)).toBeVisible());
|
|
26
|
-
}
|
|
27
|
-
await Promise.all(promises);
|
|
28
|
-
});
|
|
29
|
-
test('can check every checkbox in the table', async ({ page }) => {
|
|
30
|
-
await page.goto(componentTestPath);
|
|
31
|
-
const tableCheckboxes = page.getByRole('cell');
|
|
32
|
-
await expect(tableCheckboxes).toHaveCount(5);
|
|
33
|
-
const myEventSpyAll = await page.spyOnEvent('tdsSelectAll');
|
|
34
|
-
const myEventSpy = await page.spyOnEvent('tdsSelect');
|
|
35
|
-
/* Click each one */
|
|
36
|
-
await tableCheckboxes.first().click();
|
|
37
|
-
await tableCheckboxes.nth(1).click();
|
|
38
|
-
await tableCheckboxes.nth(2).click();
|
|
39
|
-
await tableCheckboxes.nth(3).click();
|
|
40
|
-
await tableCheckboxes.last().click();
|
|
41
|
-
/* check so correct events have been called */
|
|
42
|
-
expect(myEventSpyAll).toHaveReceivedEventTimes(1);
|
|
43
|
-
expect(myEventSpy).toHaveReceivedEventTimes(4);
|
|
44
|
-
/* Check diff on screenshot for component */
|
|
45
|
-
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
|
|
46
|
-
});
|
|
47
|
-
});
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { test } from "stencil-playwright";
|
|
2
|
-
import { expect } from "@playwright/test";
|
|
3
|
-
const componentTestPath = 'src/components/table/table/test/pagination/index.html';
|
|
4
|
-
test.describe('tds-table-pagination', () => {
|
|
5
|
-
test('renders pagination table correctly', async ({ page }) => {
|
|
6
|
-
await page.goto(componentTestPath);
|
|
7
|
-
const tableComponent = page.getByRole('table');
|
|
8
|
-
await expect(tableComponent).toHaveCount(1);
|
|
9
|
-
/* Check screenshots for diffs */
|
|
10
|
-
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
|
|
11
|
-
});
|
|
12
|
-
test('table has a footer', async ({ page }) => {
|
|
13
|
-
await page.goto(componentTestPath);
|
|
14
|
-
const tableFooter = page.locator('tds-table-footer');
|
|
15
|
-
await expect(tableFooter).toHaveCount(1);
|
|
16
|
-
});
|
|
17
|
-
test('footer has field for number of page, value = 1', async ({ page }) => {
|
|
18
|
-
await page.goto(componentTestPath);
|
|
19
|
-
const tableFooterPaginationSpinbutton = page.getByRole('spinbutton');
|
|
20
|
-
await expect(tableFooterPaginationSpinbutton).toHaveCount(1);
|
|
21
|
-
await expect(tableFooterPaginationSpinbutton).toBeVisible();
|
|
22
|
-
await expect(tableFooterPaginationSpinbutton).toHaveValue('1');
|
|
23
|
-
});
|
|
24
|
-
test('footer contains text "of 4 pages"', async ({ page }) => {
|
|
25
|
-
await page.goto(componentTestPath);
|
|
26
|
-
const tableFooterOfPagesText = page.getByText(/of 4 pages/);
|
|
27
|
-
await expect(tableFooterOfPagesText).toHaveCount(1);
|
|
28
|
-
await expect(tableFooterOfPagesText).toBeVisible();
|
|
29
|
-
});
|
|
30
|
-
test('Footer contains left chevron button, it is disabled', async ({ page }) => {
|
|
31
|
-
await page.goto(componentTestPath);
|
|
32
|
-
const tableFooterLeftChevronButton = page.getByRole('button').first();
|
|
33
|
-
await expect(tableFooterLeftChevronButton).toBeVisible();
|
|
34
|
-
await expect(tableFooterLeftChevronButton).toHaveAttribute('disabled');
|
|
35
|
-
});
|
|
36
|
-
test('Footer contains right chevron button, it is not disabled', async ({ page }) => {
|
|
37
|
-
await page.goto(componentTestPath);
|
|
38
|
-
const tableFooterRightChevronButton = page.getByRole('button').last();
|
|
39
|
-
await expect(tableFooterRightChevronButton).toBeVisible();
|
|
40
|
-
await expect(tableFooterRightChevronButton).not.toHaveAttribute('disabled');
|
|
41
|
-
});
|
|
42
|
-
test('footer contains buttons that are clickable and change value in input', async ({ page }) => {
|
|
43
|
-
await page.goto(componentTestPath);
|
|
44
|
-
const tableFooterPaginationSpinbutton = page.getByRole('spinbutton');
|
|
45
|
-
await expect(tableFooterPaginationSpinbutton).toHaveValue('1');
|
|
46
|
-
const tableFooterRightChevronButton = page.getByRole('button').last();
|
|
47
|
-
await tableFooterRightChevronButton.click();
|
|
48
|
-
await expect(tableFooterPaginationSpinbutton).toHaveValue('2');
|
|
49
|
-
const tableFooterLeftChevronButton = page.getByRole('button').first();
|
|
50
|
-
await tableFooterLeftChevronButton.click();
|
|
51
|
-
await expect(tableFooterPaginationSpinbutton).toHaveValue('1');
|
|
52
|
-
});
|
|
53
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { test } from "stencil-playwright";
|
|
2
|
-
import { expect } from "@playwright/test";
|
|
3
|
-
const componentTestPath = 'src/components/table/table/test/sorting/index.html';
|
|
4
|
-
test.describe('tds-table-sorting', () => {
|
|
5
|
-
test('renders sorting table correctly', async ({ page }) => {
|
|
6
|
-
await page.goto(componentTestPath);
|
|
7
|
-
const tableComponent = page.getByRole('table');
|
|
8
|
-
await expect(tableComponent).toHaveCount(1);
|
|
9
|
-
/* Check for diffs in screenshot */
|
|
10
|
-
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
|
|
11
|
-
});
|
|
12
|
-
test('table has header "Sorting"', async ({ page }) => {
|
|
13
|
-
await page.goto(componentTestPath);
|
|
14
|
-
/* Search for header by text and see if it exists */
|
|
15
|
-
const tdsTableToolbarCaption = page.getByText('Sorting');
|
|
16
|
-
await expect(tdsTableToolbarCaption).toHaveCount(1);
|
|
17
|
-
await expect(tdsTableToolbarCaption).toBeVisible();
|
|
18
|
-
});
|
|
19
|
-
test('column headers are clickable', async ({ page }) => {
|
|
20
|
-
await page.goto(componentTestPath);
|
|
21
|
-
const myEventSpy = await page.spyOnEvent('tdsSort');
|
|
22
|
-
const truckTypeHeader = page.getByText('Truck type');
|
|
23
|
-
await truckTypeHeader.click();
|
|
24
|
-
expect(myEventSpy).toHaveReceivedEventTimes(1);
|
|
25
|
-
const driverNameHeader = page.getByText('Driver name');
|
|
26
|
-
await driverNameHeader.click();
|
|
27
|
-
expect(myEventSpy).toHaveReceivedEventTimes(2);
|
|
28
|
-
const countryHeader = page.getByText('Country');
|
|
29
|
-
await countryHeader.click();
|
|
30
|
-
expect(myEventSpy).toHaveReceivedEventTimes(3);
|
|
31
|
-
const mileageHeader = page.getByText('Mileage');
|
|
32
|
-
await mileageHeader.click();
|
|
33
|
-
expect(myEventSpy).toHaveReceivedEventTimes(4);
|
|
34
|
-
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
|
|
35
|
-
});
|
|
36
|
-
});
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import tdsTable from "./table/readme.md";
|
|
2
|
-
import tdsTableToolbar from "./table-toolbar/readme.md";
|
|
3
|
-
import tdsHeader from "./table-header/readme.md";
|
|
4
|
-
import tdsHeaderCell from "./table-header-cell/readme.md";
|
|
5
|
-
import tdsTableBody from "./table-body/readme.md";
|
|
6
|
-
import tdsBodyRow from "./table-body-row/readme.md";
|
|
7
|
-
import tdsBodyRowExpandable from "./table-body-row-expandable/readme.md";
|
|
8
|
-
import tdsBodyCell from "./table-body-cell/readme.md";
|
|
9
|
-
import tdsTableFooter from "./table-footer/readme.md";
|
|
10
|
-
import { ComponentsFolder } from "../../utils/constants";
|
|
11
|
-
import formatHtmlPreview from "../../stories/formatHtmlPreview";
|
|
12
|
-
export default {
|
|
13
|
-
title: `${ComponentsFolder}/Table`,
|
|
14
|
-
parameters: {
|
|
15
|
-
notes: {
|
|
16
|
-
'tds-table': tdsTable,
|
|
17
|
-
'tds-table-toolbar': tdsTableToolbar,
|
|
18
|
-
'tds-header': tdsHeader,
|
|
19
|
-
'tds-header-cell': tdsHeaderCell,
|
|
20
|
-
'tds-table-body': tdsTableBody,
|
|
21
|
-
'tds-body-row': tdsBodyRow,
|
|
22
|
-
'tds-body-row-expandable': tdsBodyRowExpandable,
|
|
23
|
-
'tds-body-cell': tdsBodyCell,
|
|
24
|
-
'tds-table-footer': tdsTableFooter,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
argTypes: {
|
|
28
|
-
modeVariant: {
|
|
29
|
-
name: 'Mode variant',
|
|
30
|
-
description: 'Mode variant adjusts component colors to have better visibility depending on global mode and background.',
|
|
31
|
-
control: {
|
|
32
|
-
type: 'radio',
|
|
33
|
-
},
|
|
34
|
-
options: ['Inherit from parent', 'Primary', 'Secondary'],
|
|
35
|
-
table: {
|
|
36
|
-
defaultValue: { summary: 'Inherit from parent' },
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
compactDesign: {
|
|
40
|
-
name: 'Compact design',
|
|
41
|
-
description: 'Enables compact design of the Table, rows with less height.',
|
|
42
|
-
control: {
|
|
43
|
-
type: 'boolean',
|
|
44
|
-
},
|
|
45
|
-
table: {
|
|
46
|
-
defaultValue: { summary: false },
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
responsiveDesign: {
|
|
50
|
-
name: 'Responsive Table',
|
|
51
|
-
description: 'Enables Table to take 100% of available width. For column values less than 192px, "No minimum width" has to be enabled too.',
|
|
52
|
-
control: {
|
|
53
|
-
type: 'boolean',
|
|
54
|
-
},
|
|
55
|
-
table: {
|
|
56
|
-
defaultValue: { summary: false },
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
disablePadding: {
|
|
60
|
-
name: 'Disable cell padding',
|
|
61
|
-
description: 'By default each cell comes with padding. Disabling padding rule can be useful when a users want to insert another HTML element in cell, eg. input.',
|
|
62
|
-
control: {
|
|
63
|
-
type: 'boolean',
|
|
64
|
-
},
|
|
65
|
-
table: {
|
|
66
|
-
defaultValue: { summary: false },
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
verticalDivider: {
|
|
70
|
-
name: 'Vertical dividers',
|
|
71
|
-
description: 'Enables vertical dividers between Table columns.',
|
|
72
|
-
control: {
|
|
73
|
-
type: 'boolean',
|
|
74
|
-
},
|
|
75
|
-
table: {
|
|
76
|
-
defaultValue: { summary: false },
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
noMinWidth: {
|
|
80
|
-
name: 'No minimum width',
|
|
81
|
-
description: 'Resets min-width rule and enables setting column width value to less than 192px which is the default. When enabled, controls for column width will show here.',
|
|
82
|
-
control: {
|
|
83
|
-
type: 'boolean',
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
column1Width: {
|
|
87
|
-
name: 'Column 1 width',
|
|
88
|
-
description: 'Value of width for column 1. In order to work correctly "No minimum width" has to be enabled too. When editing please provide a unit next to the value, eg. 200px.',
|
|
89
|
-
control: {
|
|
90
|
-
type: 'text',
|
|
91
|
-
},
|
|
92
|
-
if: { arg: 'noMinWidth', eq: true },
|
|
93
|
-
},
|
|
94
|
-
column2Width: {
|
|
95
|
-
name: 'Column 2 width',
|
|
96
|
-
description: 'Value of width for column 2. In order to work correctly "No minimum width" has to be enabled too. When editing please provide a unit next to the value, eg. 200px.',
|
|
97
|
-
control: {
|
|
98
|
-
type: 'text',
|
|
99
|
-
},
|
|
100
|
-
if: { arg: 'noMinWidth', eq: true },
|
|
101
|
-
},
|
|
102
|
-
column3Width: {
|
|
103
|
-
name: 'Column 3 width',
|
|
104
|
-
description: 'Value of width for column 3. In order to work correctly "No minimum width" has to be enabled too. When editing please provide a unit next to the value, eg. 200px.',
|
|
105
|
-
control: {
|
|
106
|
-
type: 'text',
|
|
107
|
-
},
|
|
108
|
-
if: { arg: 'noMinWidth', eq: true },
|
|
109
|
-
},
|
|
110
|
-
column4Width: {
|
|
111
|
-
name: 'Column 4 width',
|
|
112
|
-
description: 'Value of width for column 4. In order to work correctly "No minimum width" has to be enabled too. When editing please provide a unit next to the value, eg. 200px.',
|
|
113
|
-
control: {
|
|
114
|
-
type: 'text',
|
|
115
|
-
},
|
|
116
|
-
if: { arg: 'noMinWidth', eq: true },
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
args: {
|
|
120
|
-
modeVariant: 'Inherit from parent',
|
|
121
|
-
compactDesign: false,
|
|
122
|
-
responsiveDesign: false,
|
|
123
|
-
disablePadding: false,
|
|
124
|
-
verticalDivider: false,
|
|
125
|
-
noMinWidth: false,
|
|
126
|
-
column1Width: '',
|
|
127
|
-
column2Width: '',
|
|
128
|
-
column3Width: '',
|
|
129
|
-
column4Width: '',
|
|
130
|
-
},
|
|
131
|
-
};
|
|
132
|
-
const BasicTemplate = ({ modeVariant, compactDesign, responsiveDesign, disablePadding, verticalDivider, noMinWidth, column1Width, column2Width, column3Width, column4Width, }) => formatHtmlPreview(`
|
|
133
|
-
<tds-table
|
|
134
|
-
vertical-dividers="${verticalDivider}"
|
|
135
|
-
compact-design="${compactDesign}"
|
|
136
|
-
responsive="${responsiveDesign}"
|
|
137
|
-
${noMinWidth ? 'no-min-width' : ''}
|
|
138
|
-
${modeVariant !== 'Inherit from parent' ? `mode-variant="${modeVariant.toLowerCase()}"` : ''}>
|
|
139
|
-
<tds-table-header>
|
|
140
|
-
<tds-header-cell cell-key='truck' cell-value='Truck type' ${column1Width ? `custom-width="${column1Width}"` : ''}></tds-header-cell>
|
|
141
|
-
<tds-header-cell cell-key='driver' cell-value='Driver name' ${column2Width ? `custom-width="${column2Width}"` : ''}></tds-header-cell>
|
|
142
|
-
<tds-header-cell cell-key='country' cell-value='Country' ${column3Width ? `custom-width="${column3Width}"` : ''}></tds-header-cell>
|
|
143
|
-
<tds-header-cell cell-key='mileage' cell-value='Mileage' text-align='right' ${column4Width ? `custom-width="${column4Width}"` : ''}></tds-header-cell>
|
|
144
|
-
</tds-table-header>
|
|
145
|
-
<tds-table-body>
|
|
146
|
-
<tds-table-body-row>
|
|
147
|
-
<tds-body-cell cell-value="Test value 1" cell-key="truck" disable-padding="${disablePadding}"></tds-body-cell>
|
|
148
|
-
<tds-body-cell cell-value="Test value 2" cell-key="driver" disable-padding="${disablePadding}"></tds-body-cell>
|
|
149
|
-
<tds-body-cell cell-value="Test value 3" cell-key="country" disable-padding="${disablePadding}"></tds-body-cell>
|
|
150
|
-
<tds-body-cell cell-value="Test value 4" cell-key="mileage" disable-padding="${disablePadding}"></tds-body-cell>
|
|
151
|
-
</tds-table-body-row>
|
|
152
|
-
<tds-table-body-row>
|
|
153
|
-
<tds-body-cell cell-value="Test value 5" cell-key="truck" disable-padding="${disablePadding}"></tds-body-cell>
|
|
154
|
-
<tds-body-cell cell-value="Test value 6" cell-key="driver" disable-padding="${disablePadding}"></tds-body-cell>
|
|
155
|
-
<tds-body-cell cell-value="Test value 7" cell-key="country" disable-padding="${disablePadding}"></tds-body-cell>
|
|
156
|
-
<tds-body-cell cell-value="Test value 8" cell-key="mileage" disable-padding="${disablePadding}"></tds-body-cell>
|
|
157
|
-
</tds-table-body-row>
|
|
158
|
-
<tds-table-body-row>
|
|
159
|
-
<tds-body-cell cell-value="Test value 1" cell-key="truck" disable-padding="${disablePadding}"></tds-body-cell>
|
|
160
|
-
<tds-body-cell cell-value="Test value 2" cell-key="driver" disable-padding="${disablePadding}"></tds-body-cell>
|
|
161
|
-
<tds-body-cell cell-value="Test value 3" cell-key="country" disable-padding="${disablePadding}"></tds-body-cell>
|
|
162
|
-
<tds-body-cell cell-value="Test value 4" cell-key="mileage" disable-padding="${disablePadding}"></tds-body-cell>
|
|
163
|
-
</tds-table-body-row>
|
|
164
|
-
<tds-table-body-row>
|
|
165
|
-
<tds-body-cell cell-value="Test value 5" cell-key="truck" disable-padding="${disablePadding}"></tds-body-cell>
|
|
166
|
-
<tds-body-cell cell-value="Test value 6" cell-key="driver" disable-padding="${disablePadding}"></tds-body-cell>
|
|
167
|
-
<tds-body-cell cell-value="Test value 7" cell-key="country" disable-padding="${disablePadding}"></tds-body-cell>
|
|
168
|
-
<tds-body-cell cell-value="Test value 8" cell-key="mileage" disable-padding="${disablePadding}"></tds-body-cell>
|
|
169
|
-
</tds-table-body-row>
|
|
170
|
-
<tds-table-body-row>
|
|
171
|
-
<tds-body-cell cell-value="Test value 1" cell-key="truck" disable-padding="${disablePadding}"></tds-body-cell>
|
|
172
|
-
<tds-body-cell cell-value="Test value 2" cell-key="driver" disable-padding="${disablePadding}"></tds-body-cell>
|
|
173
|
-
<tds-body-cell cell-value="Test value 3" cell-key="country" disable-padding="${disablePadding}"></tds-body-cell>
|
|
174
|
-
<tds-body-cell cell-value="Test value 4" cell-key="mileage" disable-padding="${disablePadding}"></tds-body-cell>
|
|
175
|
-
</tds-table-body-row>
|
|
176
|
-
<tds-table-body-row>
|
|
177
|
-
<tds-body-cell cell-value="Test value 5" cell-key="truck" disable-padding="${disablePadding}"></tds-body-cell>
|
|
178
|
-
<tds-body-cell cell-value="Test value 6" cell-key="driver" disable-padding="${disablePadding}"></tds-body-cell>
|
|
179
|
-
<tds-body-cell cell-value="Test value 7" cell-key="country" disable-padding="${disablePadding}"></tds-body-cell>
|
|
180
|
-
<tds-body-cell cell-value="Test value 8" cell-key="mileage" disable-padding="${disablePadding}"></tds-body-cell>
|
|
181
|
-
</tds-table-body-row>
|
|
182
|
-
</tds-table-body>
|
|
183
|
-
</tds-table>`);
|
|
184
|
-
export const Basic = BasicTemplate.bind({});
|