@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,195 +0,0 @@
|
|
|
1
|
-
import formatHtmlPreview from "../../stories/formatHtmlPreview";
|
|
2
|
-
import tdsTable from "./table/readme.md";
|
|
3
|
-
import tdsTableToolbar from "./table-toolbar/readme.md";
|
|
4
|
-
import tdsHeader from "./table-header/readme.md";
|
|
5
|
-
import tdsHeaderCell from "./table-header-cell/readme.md";
|
|
6
|
-
import tdsTableBody from "./table-body/readme.md";
|
|
7
|
-
import tdsBodyRow from "./table-body-row/readme.md";
|
|
8
|
-
import tdsBodyRowExpandable from "./table-body-row-expandable/readme.md";
|
|
9
|
-
import tdsBodyCell from "./table-body-cell/readme.md";
|
|
10
|
-
import tdsTableFooter from "./table-footer/readme.md";
|
|
11
|
-
import { ComponentsFolder } from "../../utils/constants";
|
|
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
|
-
verticalDivider: {
|
|
60
|
-
name: 'Vertical dividers',
|
|
61
|
-
description: 'Enables vertical dividers between Table columns.',
|
|
62
|
-
control: {
|
|
63
|
-
type: 'boolean',
|
|
64
|
-
},
|
|
65
|
-
table: {
|
|
66
|
-
defaultValue: { summary: false },
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
noMinWidth: {
|
|
70
|
-
name: 'No minimum width',
|
|
71
|
-
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.',
|
|
72
|
-
control: {
|
|
73
|
-
type: 'boolean',
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
column1Width: {
|
|
77
|
-
name: 'Column 1 width',
|
|
78
|
-
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.',
|
|
79
|
-
control: {
|
|
80
|
-
type: 'text',
|
|
81
|
-
},
|
|
82
|
-
if: { arg: 'noMinWidth', eq: true },
|
|
83
|
-
},
|
|
84
|
-
column2Width: {
|
|
85
|
-
name: 'Column 2 width',
|
|
86
|
-
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.',
|
|
87
|
-
control: {
|
|
88
|
-
type: 'text',
|
|
89
|
-
},
|
|
90
|
-
if: { arg: 'noMinWidth', eq: true },
|
|
91
|
-
},
|
|
92
|
-
column3Width: {
|
|
93
|
-
name: 'Column 3 width',
|
|
94
|
-
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.',
|
|
95
|
-
control: {
|
|
96
|
-
type: 'text',
|
|
97
|
-
},
|
|
98
|
-
if: { arg: 'noMinWidth', eq: true },
|
|
99
|
-
},
|
|
100
|
-
column4Width: {
|
|
101
|
-
name: 'Column 4 width',
|
|
102
|
-
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.',
|
|
103
|
-
control: {
|
|
104
|
-
type: 'text',
|
|
105
|
-
},
|
|
106
|
-
if: { arg: 'noMinWidth', eq: true },
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
args: {
|
|
110
|
-
modeVariant: 'Inherit from parent',
|
|
111
|
-
compactDesign: false,
|
|
112
|
-
responsiveDesign: true,
|
|
113
|
-
verticalDivider: false,
|
|
114
|
-
noMinWidth: false,
|
|
115
|
-
column1Width: '',
|
|
116
|
-
column2Width: '',
|
|
117
|
-
column3Width: '',
|
|
118
|
-
column4Width: '',
|
|
119
|
-
},
|
|
120
|
-
};
|
|
121
|
-
const FilteringTemplate = ({ modeVariant, compactDesign, responsiveDesign, verticalDivider, noMinWidth, column1Width, column2Width, column3Width, column4Width, }) => formatHtmlPreview(`
|
|
122
|
-
<tds-table
|
|
123
|
-
vertical-dividers="${verticalDivider}"
|
|
124
|
-
compact-design="${compactDesign}"
|
|
125
|
-
${responsiveDesign ? 'responsive' : ''}
|
|
126
|
-
${noMinWidth ? 'no-min-width' : ''}
|
|
127
|
-
${modeVariant !== 'Inherit from parent' ? `mode-variant="${modeVariant.toLowerCase()}"` : ''}
|
|
128
|
-
>
|
|
129
|
-
<tds-table-toolbar table-title="Filter" filter></tds-table-toolbar>
|
|
130
|
-
<tds-table-header>
|
|
131
|
-
<tds-header-cell cell-key='truck' cell-value='Truck type' ${column1Width ? `custom-width="${column1Width}"` : ''}></tds-header-cell>
|
|
132
|
-
<tds-header-cell cell-key='driver' cell-value='Driver name' ${column2Width ? `custom-width="${column2Width}"` : ''}></tds-header-cell>
|
|
133
|
-
<tds-header-cell cell-key='country' cell-value='Country' ${column3Width ? `custom-width="${column3Width}"` : ''}></tds-header-cell>
|
|
134
|
-
<tds-header-cell cell-key='mileage' cell-value='Mileage' text-align='right' ${column4Width ? `custom-width="${column4Width}"` : ''}></tds-header-cell>
|
|
135
|
-
</tds-table-header>
|
|
136
|
-
<tds-table-body>
|
|
137
|
-
<tds-table-body-row>
|
|
138
|
-
<tds-body-cell cell-value="Test value 1" cell-key="truck"></tds-body-cell>
|
|
139
|
-
<tds-body-cell cell-value="Test value 2" cell-key="driver"></tds-body-cell>
|
|
140
|
-
<tds-body-cell cell-value="Test value 3" cell-key="country"></tds-body-cell>
|
|
141
|
-
<tds-body-cell cell-value="Test value 4" cell-key="mileage"></tds-body-cell>
|
|
142
|
-
</tds-table-body-row>
|
|
143
|
-
<tds-table-body-row>
|
|
144
|
-
<tds-body-cell cell-value="Test value 5" cell-key="truck"></tds-body-cell>
|
|
145
|
-
<tds-body-cell cell-value="Test value 6" cell-key="driver"></tds-body-cell>
|
|
146
|
-
<tds-body-cell cell-value="Test value 7" cell-key="country"></tds-body-cell>
|
|
147
|
-
<tds-body-cell cell-value="Test value 8" cell-key="mileage"></tds-body-cell>
|
|
148
|
-
</tds-table-body-row>
|
|
149
|
-
<tds-table-body-row>
|
|
150
|
-
<tds-body-cell cell-value="Test value 1" cell-key="truck"></tds-body-cell>
|
|
151
|
-
<tds-body-cell cell-value="Test value 2" cell-key="driver"></tds-body-cell>
|
|
152
|
-
<tds-body-cell cell-value="Test value 3" cell-key="country"></tds-body-cell>
|
|
153
|
-
<tds-body-cell cell-value="Test value 4" cell-key="mileage"></tds-body-cell>
|
|
154
|
-
</tds-table-body-row>
|
|
155
|
-
<tds-table-body-row>
|
|
156
|
-
<tds-body-cell cell-value="Test value 5" cell-key="truck"></tds-body-cell>
|
|
157
|
-
<tds-body-cell cell-value="Test value 6" cell-key="driver"></tds-body-cell>
|
|
158
|
-
<tds-body-cell cell-value="Test value 7" cell-key="country"></tds-body-cell>
|
|
159
|
-
<tds-body-cell cell-value="Test value 8" cell-key="mileage"></tds-body-cell>
|
|
160
|
-
</tds-table-body-row>
|
|
161
|
-
<tds-table-body-row>
|
|
162
|
-
<tds-body-cell cell-value="Test value 1" cell-key="truck"></tds-body-cell>
|
|
163
|
-
<tds-body-cell cell-value="Test value 2" cell-key="driver"></tds-body-cell>
|
|
164
|
-
<tds-body-cell cell-value="Test value 3" cell-key="country"></tds-body-cell>
|
|
165
|
-
<tds-body-cell cell-value="Test value 4" cell-key="mileage"></tds-body-cell>
|
|
166
|
-
</tds-table-body-row>
|
|
167
|
-
<tds-table-body-row>
|
|
168
|
-
<tds-body-cell cell-value="Test value 5" cell-key="truck"></tds-body-cell>
|
|
169
|
-
<tds-body-cell cell-value="Test value 6" cell-key="driver"></tds-body-cell>
|
|
170
|
-
<tds-body-cell cell-value="Test value 7" cell-key="country"></tds-body-cell>
|
|
171
|
-
<tds-body-cell cell-value="Test value 8" cell-key="mileage"></tds-body-cell>
|
|
172
|
-
</tds-table-body-row>
|
|
173
|
-
</tds-table-body>
|
|
174
|
-
<tds-table-footer>
|
|
175
|
-
</tds-table-footer>
|
|
176
|
-
</tds-table>
|
|
177
|
-
<!-- Note: Code below is just for demo purposes -->
|
|
178
|
-
<div class="tds-u-mt1" style="width: 500px; background-color: lightblue; padding: 16px;">
|
|
179
|
-
<p class="tds-u-mt0">Note: This box works only in "Canvas" tab.</p>
|
|
180
|
-
<h5 class="tds-u-mt0 tds-u-mb0">Event test box</h5>
|
|
181
|
-
<h6 class="tds-u-mt1 tds-u-mb0">Event name:</h6>
|
|
182
|
-
<textarea id="event-name-textarea" rows="1" cols="50" readonly></textarea>
|
|
183
|
-
<h6 class="tds-u-mt0 tds-u-mb0">Events value (aka detail)</h6>
|
|
184
|
-
<br>
|
|
185
|
-
<textarea id="event-value-textarea" rows="4" cols="50" readonly></textarea>
|
|
186
|
-
</div>
|
|
187
|
-
|
|
188
|
-
<script>
|
|
189
|
-
|
|
190
|
-
window.addEventListener('tdsFilter', e => {
|
|
191
|
-
document.getElementById('event-name-textarea').value = e.type;
|
|
192
|
-
document.getElementById('event-value-textarea').value = JSON.stringify(e.detail, null, 2);
|
|
193
|
-
});
|
|
194
|
-
</script>`);
|
|
195
|
-
export const Filtering = FilteringTemplate.bind({});
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
import formatHtmlPreview from "../../stories/formatHtmlPreview";
|
|
2
|
-
import tdsTable from "./table/readme.md";
|
|
3
|
-
import tdsTableToolbar from "./table-toolbar/readme.md";
|
|
4
|
-
import tdsHeader from "./table-header/readme.md";
|
|
5
|
-
import tdsHeaderCell from "./table-header-cell/readme.md";
|
|
6
|
-
import tdsTableBody from "./table-body/readme.md";
|
|
7
|
-
import tdsBodyRow from "./table-body-row/readme.md";
|
|
8
|
-
import tdsBodyRowExpandable from "./table-body-row-expandable/readme.md";
|
|
9
|
-
import tdsBodyCell from "./table-body-cell/readme.md";
|
|
10
|
-
import tdsTableFooter from "./table-footer/readme.md";
|
|
11
|
-
import { ComponentsFolder } from "../../utils/constants";
|
|
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
|
-
allSelected: {
|
|
40
|
-
name: 'All selected',
|
|
41
|
-
description: `Controls the checked state of the "all-selected"-checkbox.`,
|
|
42
|
-
control: {
|
|
43
|
-
type: 'boolean',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
allIndeterminate: {
|
|
47
|
-
name: 'All indeterminate',
|
|
48
|
-
description: `Controls the indeterminate state of the "all-selected"-checkbox.`,
|
|
49
|
-
control: {
|
|
50
|
-
type: 'boolean',
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
compactDesign: {
|
|
54
|
-
name: 'Compact design',
|
|
55
|
-
description: 'Enables compact design of the Table, rows with less height.',
|
|
56
|
-
control: {
|
|
57
|
-
type: 'boolean',
|
|
58
|
-
},
|
|
59
|
-
table: {
|
|
60
|
-
defaultValue: { summary: false },
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
responsiveDesign: {
|
|
64
|
-
name: 'Responsive Table',
|
|
65
|
-
description: 'Enables Table to take 100% of available width. For column values less than 192px, "No minimum width" has to be enabled too.',
|
|
66
|
-
control: {
|
|
67
|
-
type: 'boolean',
|
|
68
|
-
},
|
|
69
|
-
table: {
|
|
70
|
-
defaultValue: { summary: false },
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
verticalDivider: {
|
|
74
|
-
name: 'Vertical dividers',
|
|
75
|
-
description: 'Enables vertical dividers between Table columns.',
|
|
76
|
-
control: {
|
|
77
|
-
type: 'boolean',
|
|
78
|
-
},
|
|
79
|
-
table: {
|
|
80
|
-
defaultValue: { summary: false },
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
noMinWidth: {
|
|
84
|
-
name: 'No minimum width',
|
|
85
|
-
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.',
|
|
86
|
-
control: {
|
|
87
|
-
type: 'boolean',
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
column1Width: {
|
|
91
|
-
name: 'Column 1 width',
|
|
92
|
-
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.',
|
|
93
|
-
control: {
|
|
94
|
-
type: 'text',
|
|
95
|
-
},
|
|
96
|
-
if: { arg: 'noMinWidth', eq: true },
|
|
97
|
-
},
|
|
98
|
-
column2Width: {
|
|
99
|
-
name: 'Column 2 width',
|
|
100
|
-
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.',
|
|
101
|
-
control: {
|
|
102
|
-
type: 'text',
|
|
103
|
-
},
|
|
104
|
-
if: { arg: 'noMinWidth', eq: true },
|
|
105
|
-
},
|
|
106
|
-
column3Width: {
|
|
107
|
-
name: 'Column 3 width',
|
|
108
|
-
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.',
|
|
109
|
-
control: {
|
|
110
|
-
type: 'text',
|
|
111
|
-
},
|
|
112
|
-
if: { arg: 'noMinWidth', eq: true },
|
|
113
|
-
},
|
|
114
|
-
column4Width: {
|
|
115
|
-
name: 'Column 4 width',
|
|
116
|
-
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.',
|
|
117
|
-
control: {
|
|
118
|
-
type: 'text',
|
|
119
|
-
},
|
|
120
|
-
if: { arg: 'noMinWidth', eq: true },
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
args: {
|
|
124
|
-
modeVariant: 'Inherit from parent',
|
|
125
|
-
allSelected: false,
|
|
126
|
-
allIndeterminate: false,
|
|
127
|
-
compactDesign: false,
|
|
128
|
-
responsiveDesign: false,
|
|
129
|
-
verticalDivider: false,
|
|
130
|
-
noMinWidth: false,
|
|
131
|
-
column1Width: '',
|
|
132
|
-
column2Width: '',
|
|
133
|
-
column3Width: '',
|
|
134
|
-
column4Width: '',
|
|
135
|
-
},
|
|
136
|
-
};
|
|
137
|
-
const MultiselectTemplate = ({ modeVariant, allSelected, allIndeterminate, compactDesign, responsiveDesign, verticalDivider, noMinWidth, column1Width, column2Width, column3Width, column4Width, }) => formatHtmlPreview(`
|
|
138
|
-
<tds-table
|
|
139
|
-
table-id="multiselect-table"
|
|
140
|
-
multiselect
|
|
141
|
-
vertical-dividers="${verticalDivider}"
|
|
142
|
-
compact-design="${compactDesign}"
|
|
143
|
-
responsive="${responsiveDesign}"
|
|
144
|
-
${noMinWidth ? 'no-min-width' : ''}
|
|
145
|
-
${modeVariant !== 'Inherit from parent' ? `mode-variant="${modeVariant.toLowerCase()}"` : ''}
|
|
146
|
-
>
|
|
147
|
-
<tds-table-header ${allSelected ? 'selected' : ''} ${allIndeterminate ? 'indeterminate' : ''}>
|
|
148
|
-
<tds-header-cell cell-key='truck' cell-value='Truck type' ${column1Width ? `custom-width="${column1Width}"` : ''}></tds-header-cell>
|
|
149
|
-
<tds-header-cell cell-key='driver' cell-value='Driver name' ${column2Width ? `custom-width="${column2Width}"` : ''}></tds-header-cell>
|
|
150
|
-
<tds-header-cell cell-key='country' cell-value='Country' ${column3Width ? `custom-width="${column3Width}"` : ''}></tds-header-cell>
|
|
151
|
-
<tds-header-cell cell-key='mileage' cell-value='Mileage' text-align='right' ${column4Width ? `custom-width="${column4Width}"` : ''}></tds-header-cell>
|
|
152
|
-
</tds-table-header>
|
|
153
|
-
<tds-table-body>
|
|
154
|
-
<tds-table-body-row>
|
|
155
|
-
<tds-body-cell cell-key="truck" cell-value="L-series"> </tds-body-cell
|
|
156
|
-
><tds-body-cell cell-key="driver" cell-value="Sonya Bruce"></tds-body-cell
|
|
157
|
-
><tds-body-cell cell-key="country" cell-value="Brazil"></tds-body-cell
|
|
158
|
-
><tds-body-cell cell-key="mileage" cell-value="123987"></tds-body-cell>
|
|
159
|
-
</tds-table-body-row>
|
|
160
|
-
<tds-table-body-row
|
|
161
|
-
><tds-body-cell cell-key="truck" cell-value="P-series"></tds-body-cell
|
|
162
|
-
><tds-body-cell cell-key="driver" cell-value="Guerra Bowman"></tds-body-cell
|
|
163
|
-
><tds-body-cell cell-key="country" cell-value="Sweden"></tds-body-cell
|
|
164
|
-
><tds-body-cell cell-key="mileage" cell-value="2000852"></tds-body-cell>
|
|
165
|
-
</tds-table-body-row>
|
|
166
|
-
<tds-table-body-row
|
|
167
|
-
><tds-body-cell cell-key="truck" cell-value="G-series"></tds-body-cell
|
|
168
|
-
><tds-body-cell cell-key="driver" cell-value="Ferrell Wallace"></tds-body-cell
|
|
169
|
-
><tds-body-cell cell-key="country" cell-value="Germany"></tds-body-cell
|
|
170
|
-
><tds-body-cell cell-key="mileage" cell-value="564"></tds-body-cell>
|
|
171
|
-
</tds-table-body-row>
|
|
172
|
-
<tds-table-body-row
|
|
173
|
-
><tds-body-cell cell-key="truck" cell-value="R-series"></tds-body-cell
|
|
174
|
-
><tds-body-cell cell-key="driver" cell-value="Cox Burris"></tds-body-cell
|
|
175
|
-
><tds-body-cell cell-key="country" cell-value="Spain"></tds-body-cell
|
|
176
|
-
><tds-body-cell cell-key="mileage" cell-value="1789357"></tds-body-cell>
|
|
177
|
-
</tds-table-body-row>
|
|
178
|
-
</tds-table-body>
|
|
179
|
-
</tds-table>
|
|
180
|
-
<!-- Note: Code below is just for demo purposes -->
|
|
181
|
-
<div class="tds-u-mt1" style="width: 500px; background-color: lightblue; padding: 16px;">
|
|
182
|
-
<p class="tds-u-mt0">Note: This box works only in "Canvas" tab.</p>
|
|
183
|
-
<h5 class="tds-u-mt0 tds-u-mb0">Event test box</h5>
|
|
184
|
-
<h6 class="tds-u-mt1 tds-u-mb0">Event name:</h6>
|
|
185
|
-
<textarea id="event-name-textarea" rows="1" cols="50" readonly></textarea>
|
|
186
|
-
<br><br>
|
|
187
|
-
<h6 class="tds-u-mt0 tds-u-mb0">Events value (aka detail)</h6>
|
|
188
|
-
<textarea id="event-value-textarea" rows="4" cols="50" readonly></textarea>
|
|
189
|
-
<br><br>
|
|
190
|
-
<h6 class="tds-u-mt0 tds-u-mb0">Selected rows</h6>
|
|
191
|
-
<textarea id="selected-rows-textarea" rows="4" cols="50" readonly></textarea>
|
|
192
|
-
</div>
|
|
193
|
-
<script>
|
|
194
|
-
// Note: Script here is only for demo purposes
|
|
195
|
-
|
|
196
|
-
window.addEventListener('tdsSelectAll', e => {
|
|
197
|
-
console.log(e)
|
|
198
|
-
document.getElementById('event-name-textarea').value = e.type;
|
|
199
|
-
document.getElementById('event-value-textarea').value = JSON.stringify(e.detail, null, 2);
|
|
200
|
-
document.getElementById('selected-rows-textarea').value = JSON.stringify(e.detail.selectedRows,null, 2);
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
window.addEventListener('tdsSelect', e => {
|
|
204
|
-
console.log(e)
|
|
205
|
-
document.getElementById('event-name-textarea').value = e.type;
|
|
206
|
-
document.getElementById('event-value-textarea').value = JSON.stringify(e.detail, null, 2);
|
|
207
|
-
document.getElementById('selected-rows-textarea').value = JSON.stringify(e.detail.selectedRows,null, 2);
|
|
208
|
-
});
|
|
209
|
-
</script>
|
|
210
|
-
`);
|
|
211
|
-
export const Multiselect = MultiselectTemplate.bind({});
|
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import formatHtmlPreview from "../../stories/formatHtmlPreview";
|
|
2
|
-
import tdsTable from "./table/readme.md";
|
|
3
|
-
import tdsTableToolbar from "./table-toolbar/readme.md";
|
|
4
|
-
import tdsHeader from "./table-header/readme.md";
|
|
5
|
-
import tdsHeaderCell from "./table-header-cell/readme.md";
|
|
6
|
-
import tdsTableBody from "./table-body/readme.md";
|
|
7
|
-
import tdsBodyRow from "./table-body-row/readme.md";
|
|
8
|
-
import tdsBodyRowExpandable from "./table-body-row-expandable/readme.md";
|
|
9
|
-
import tdsBodyCell from "./table-body-cell/readme.md";
|
|
10
|
-
import tdsTableFooter from "./table-footer/readme.md";
|
|
11
|
-
import { ComponentsFolder } from "../../utils/constants";
|
|
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
|
-
verticalDivider: {
|
|
60
|
-
name: 'Vertical dividers',
|
|
61
|
-
description: 'Enables vertical dividers between Table columns.',
|
|
62
|
-
control: {
|
|
63
|
-
type: 'boolean',
|
|
64
|
-
},
|
|
65
|
-
table: {
|
|
66
|
-
defaultValue: { summary: false },
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
noMinWidth: {
|
|
70
|
-
name: 'No minimum width',
|
|
71
|
-
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.',
|
|
72
|
-
control: {
|
|
73
|
-
type: 'boolean',
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
column1Width: {
|
|
77
|
-
name: 'Column 1 width',
|
|
78
|
-
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.',
|
|
79
|
-
control: {
|
|
80
|
-
type: 'text',
|
|
81
|
-
},
|
|
82
|
-
if: { arg: 'noMinWidth', eq: true },
|
|
83
|
-
},
|
|
84
|
-
column2Width: {
|
|
85
|
-
name: 'Column 2 width',
|
|
86
|
-
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.',
|
|
87
|
-
control: {
|
|
88
|
-
type: 'text',
|
|
89
|
-
},
|
|
90
|
-
if: { arg: 'noMinWidth', eq: true },
|
|
91
|
-
},
|
|
92
|
-
column3Width: {
|
|
93
|
-
name: 'Column 3 width',
|
|
94
|
-
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.',
|
|
95
|
-
control: {
|
|
96
|
-
type: 'text',
|
|
97
|
-
},
|
|
98
|
-
if: { arg: 'noMinWidth', eq: true },
|
|
99
|
-
},
|
|
100
|
-
column4Width: {
|
|
101
|
-
name: 'Column 4 width',
|
|
102
|
-
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.',
|
|
103
|
-
control: {
|
|
104
|
-
type: 'text',
|
|
105
|
-
},
|
|
106
|
-
if: { arg: 'noMinWidth', eq: true },
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
args: {
|
|
110
|
-
modeVariant: 'Inherit from parent',
|
|
111
|
-
compactDesign: false,
|
|
112
|
-
responsiveDesign: false,
|
|
113
|
-
verticalDivider: false,
|
|
114
|
-
noMinWidth: false,
|
|
115
|
-
column1Width: '',
|
|
116
|
-
column2Width: '',
|
|
117
|
-
column3Width: '',
|
|
118
|
-
column4Width: '',
|
|
119
|
-
},
|
|
120
|
-
};
|
|
121
|
-
const PaginationTemplate = ({ modeVariant, compactDesign, responsiveDesign, verticalDivider, noMinWidth, column1Width, column2Width, column3Width, column4Width, }) => formatHtmlPreview(`
|
|
122
|
-
<tds-table
|
|
123
|
-
table-id='pagination-table'
|
|
124
|
-
vertical-dividers="${verticalDivider}"
|
|
125
|
-
compact-design="${compactDesign}"
|
|
126
|
-
responsive="${responsiveDesign}"
|
|
127
|
-
${noMinWidth ? 'no-min-width' : ''}
|
|
128
|
-
${modeVariant !== 'Inherit from parent' ? `mode-variant="${modeVariant.toLowerCase()}"` : ''}
|
|
129
|
-
>
|
|
130
|
-
<tds-table-header>
|
|
131
|
-
<tds-header-cell cell-key='truck' cell-value='Truck type' ${column1Width ? `custom-width="${column1Width}"` : ''}></tds-header-cell>
|
|
132
|
-
<tds-header-cell cell-key='driver' cell-value='Driver name' ${column2Width ? `custom-width="${column2Width}"` : ''}></tds-header-cell>
|
|
133
|
-
<tds-header-cell cell-key='country' cell-value='Country' ${column3Width ? `custom-width="${column3Width}"` : ''}></tds-header-cell>
|
|
134
|
-
<tds-header-cell cell-key='mileage' cell-value='Mileage' text-align='right' ${column4Width ? `custom-width="${column4Width}"` : ''}></tds-header-cell>
|
|
135
|
-
</tds-table-header>
|
|
136
|
-
<tds-table-body>
|
|
137
|
-
<tds-table-body-row>
|
|
138
|
-
<tds-body-cell cell-value="Test value 1" cell-key="truck"></tds-body-cell>
|
|
139
|
-
<tds-body-cell cell-value="Test value 2" cell-key="driver"></tds-body-cell>
|
|
140
|
-
<tds-body-cell cell-value="Test value 3" cell-key="country"></tds-body-cell>
|
|
141
|
-
<tds-body-cell cell-value="Test value 4" cell-key="mileage"></tds-body-cell>
|
|
142
|
-
</tds-table-body-row>
|
|
143
|
-
<tds-table-body-row>
|
|
144
|
-
<tds-body-cell cell-value="Test value 5" cell-key="truck"></tds-body-cell>
|
|
145
|
-
<tds-body-cell cell-value="Test value 6" cell-key="driver"></tds-body-cell>
|
|
146
|
-
<tds-body-cell cell-value="Test value 7" cell-key="country"></tds-body-cell>
|
|
147
|
-
<tds-body-cell cell-value="Test value 8" cell-key="mileage"></tds-body-cell>
|
|
148
|
-
</tds-table-body-row>
|
|
149
|
-
<tds-table-body-row>
|
|
150
|
-
<tds-body-cell cell-value="Test value 1" cell-key="truck"></tds-body-cell>
|
|
151
|
-
<tds-body-cell cell-value="Test value 2" cell-key="driver"></tds-body-cell>
|
|
152
|
-
<tds-body-cell cell-value="Test value 3" cell-key="country"></tds-body-cell>
|
|
153
|
-
<tds-body-cell cell-value="Test value 4" cell-key="mileage"></tds-body-cell>
|
|
154
|
-
</tds-table-body-row>
|
|
155
|
-
<tds-table-body-row>
|
|
156
|
-
<tds-body-cell cell-value="Test value 5" cell-key="truck"></tds-body-cell>
|
|
157
|
-
<tds-body-cell cell-value="Test value 6" cell-key="driver"></tds-body-cell>
|
|
158
|
-
<tds-body-cell cell-value="Test value 7" cell-key="country"></tds-body-cell>
|
|
159
|
-
<tds-body-cell cell-value="Test value 8" cell-key="mileage"></tds-body-cell>
|
|
160
|
-
</tds-table-body-row>
|
|
161
|
-
<tds-table-body-row>
|
|
162
|
-
<tds-body-cell cell-value="Test value 1" cell-key="truck"></tds-body-cell>
|
|
163
|
-
<tds-body-cell cell-value="Test value 2" cell-key="driver"></tds-body-cell>
|
|
164
|
-
<tds-body-cell cell-value="Test value 3" cell-key="country"></tds-body-cell>
|
|
165
|
-
<tds-body-cell cell-value="Test value 4" cell-key="mileage"></tds-body-cell>
|
|
166
|
-
</tds-table-body-row>
|
|
167
|
-
<tds-table-body-row>
|
|
168
|
-
<tds-body-cell cell-value="Test value 5" cell-key="truck"></tds-body-cell>
|
|
169
|
-
<tds-body-cell cell-value="Test value 6" cell-key="driver"></tds-body-cell>
|
|
170
|
-
<tds-body-cell cell-value="Test value 7" cell-key="country"></tds-body-cell>
|
|
171
|
-
<tds-body-cell cell-value="Test value 8" cell-key="mileage"></tds-body-cell>
|
|
172
|
-
</tds-table-body-row>
|
|
173
|
-
</tds-table-body>
|
|
174
|
-
<tds-table-footer pages="4" pagination></tds-table-footer>
|
|
175
|
-
</tds-table>
|
|
176
|
-
<!-- Note: Code below is just for demo purposes -->
|
|
177
|
-
<div class="tds-u-mt1" style="width: 500px; background-color: lightblue; padding: 16px;">
|
|
178
|
-
<p class="tds-u-mt0">Note: This box works only in "Canvas" tab.</p>
|
|
179
|
-
<h5 class="tds-u-mt0 tds-u-mb0">Event test box</h5>
|
|
180
|
-
<h6 class="tds-u-mt1 tds-u-mb0">Event name:</h6>
|
|
181
|
-
<textarea id="event-name-textarea" rows="1" cols="50" readonly></textarea>
|
|
182
|
-
<h6 class="tds-u-mt0 tds-u-mb0">Events value (aka detail)</h6>
|
|
183
|
-
<br>
|
|
184
|
-
<textarea id="event-value-textarea" rows="4" cols="50" readonly></textarea>
|
|
185
|
-
</div>
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
<script>
|
|
189
|
-
window.addEventListener('tdsPagination', e => {
|
|
190
|
-
document.getElementById('event-name-textarea').value = e.type;
|
|
191
|
-
document.getElementById('event-value-textarea').value = JSON.stringify(e.detail, null, 2);
|
|
192
|
-
});
|
|
193
|
-
</script>
|
|
194
|
-
|
|
195
|
-
`);
|
|
196
|
-
export const Pagination = PaginationTemplate.bind({});
|