@scania/tegel 0.0.1-beta.3 → 0.0.1-beta.4
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/index-e1c79686.js +1912 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/cjs/popper-11d5f714.js +1801 -0
- package/dist/cjs/sdds-accordion-item.cjs.entry.js +34 -0
- package/dist/cjs/sdds-accordion.cjs.entry.js +21 -0
- package/dist/cjs/sdds-badges.cjs.entry.js +55 -0
- package/dist/cjs/sdds-body-cell_2.cjs.entry.js +173 -0
- package/dist/cjs/sdds-button.cjs.entry.js +36 -0
- package/dist/cjs/sdds-datetime.cjs.entry.js +66 -0
- package/dist/cjs/sdds-dropdown-filter.cjs.entry.js +92 -0
- package/dist/cjs/sdds-dropdown_2.cjs.entry.js +335 -0
- package/dist/cjs/sdds-header-cell.cjs.entry.js +141 -0
- package/dist/cjs/sdds-icon.cjs.entry.js +42 -0
- package/dist/cjs/sdds-inline-tabs-fullbleed.cjs.entry.js +96 -0
- package/dist/cjs/sdds-inline-tabs.cjs.entry.js +211 -0
- package/dist/cjs/sdds-modal.cjs.entry.js +49 -0
- package/dist/cjs/sdds-navigation-tabs.cjs.entry.js +95 -0
- package/dist/cjs/sdds-popover-canvas.cjs.entry.js +76 -0
- package/dist/cjs/sdds-popover-menu.cjs.entry.js +75 -0
- package/dist/cjs/sdds-slider.cjs.entry.js +336 -0
- package/dist/cjs/sdds-spinner.cjs.entry.js +21 -0
- package/dist/cjs/sdds-table-body-row-expandable.cjs.entry.js +81 -0
- package/dist/cjs/sdds-table-body.cjs.entry.js +289 -0
- package/dist/cjs/sdds-table-footer.cjs.entry.js +165 -0
- package/dist/cjs/sdds-table-header.cjs.entry.js +100 -0
- package/dist/cjs/sdds-table-toolbar.cjs.entry.js +66 -0
- package/dist/cjs/sdds-table.cjs.entry.js +69 -0
- package/dist/cjs/sdds-textarea.cjs.entry.js +61 -0
- package/dist/cjs/sdds-textfield.cjs.entry.js +82 -0
- package/dist/cjs/sdds-tooltip.cjs.entry.js +95 -0
- package/dist/cjs/tegel.cjs.js +19 -0
- package/dist/collection/collection-manifest.json +40 -0
- package/dist/collection/components/accordion/accordion-item/accordion-item.css +134 -0
- package/dist/collection/components/accordion/accordion-item/accordion-item.js +146 -0
- package/dist/collection/components/accordion/accordion.css +77 -0
- package/dist/collection/components/accordion/accordion.js +62 -0
- package/dist/collection/components/accordion/accordion.stories.js +91 -0
- package/dist/collection/components/badge/badge.stories.js +101 -0
- package/dist/collection/components/badge/badges.css +42 -0
- package/dist/collection/components/badge/badges.js +150 -0
- package/dist/collection/components/banner/banner.stories.js +93 -0
- package/dist/collection/components/block/block.stories.js +46 -0
- package/dist/collection/components/breadcrumb/breadcrumb.stories.js +26 -0
- package/dist/collection/components/button/button-component.js +154 -0
- package/dist/collection/components/button/button-native.stories.js +183 -0
- package/dist/collection/components/button/button-webcomponent.stories.js +182 -0
- package/dist/collection/components/button/button.css +658 -0
- package/dist/collection/components/card/card.stories.js +181 -0
- package/dist/collection/components/checkbox/checkbox.stories.js +54 -0
- package/dist/collection/components/chips/chips.stories.js +124 -0
- package/dist/collection/components/data-table/native-table.stories.js +182 -0
- package/dist/collection/components/data-table/table/table.css +15 -0
- package/dist/collection/components/data-table/table/table.js +253 -0
- package/dist/collection/components/data-table/table-body/table-body.css +22 -0
- package/dist/collection/components/data-table/table-body/table-body.js +425 -0
- package/dist/collection/components/data-table/table-body-cell/table-body-cell.css +40 -0
- package/dist/collection/components/data-table/table-body-cell/table-body-cell.js +169 -0
- package/dist/collection/components/data-table/table-body-row/table-body-row.css +196 -0
- package/dist/collection/components/data-table/table-body-row/table-body-row.js +164 -0
- package/dist/collection/components/data-table/table-body-row-expandable/table-body-row-expandable.css +79 -0
- package/dist/collection/components/data-table/table-body-row-expandable/table-body-row-expandable.js +155 -0
- package/dist/collection/components/data-table/table-component-basic.stories.js +163 -0
- package/dist/collection/components/data-table/table-component-batch-actions.stories.js +129 -0
- package/dist/collection/components/data-table/table-component-bodydata.stories.js +58 -0
- package/dist/collection/components/data-table/table-component-custom-width.stories.js +198 -0
- package/dist/collection/components/data-table/table-component-event-listeners.stories.js +153 -0
- package/dist/collection/components/data-table/table-component-expandable-rows.stories.js +137 -0
- package/dist/collection/components/data-table/table-component-filtering.stories.js +139 -0
- package/dist/collection/components/data-table/table-component-multiselect.stories.js +160 -0
- package/dist/collection/components/data-table/table-component-pagination.stories.js +129 -0
- package/dist/collection/components/data-table/table-component-sorting.stories.js +107 -0
- package/dist/collection/components/data-table/table-footer/table-footer.css +93 -0
- package/dist/collection/components/data-table/table-footer/table-footer.js +355 -0
- package/dist/collection/components/data-table/table-header/table-header.css +204 -0
- package/dist/collection/components/data-table/table-header/table-header.js +153 -0
- package/dist/collection/components/data-table/table-header-cell/table-header-cell.css +126 -0
- package/dist/collection/components/data-table/table-header-cell/table-header-cell.js +320 -0
- package/dist/collection/components/data-table/table-toolbar/table-toolbar.css +92 -0
- package/dist/collection/components/data-table/table-toolbar/table-toolbar.js +142 -0
- package/dist/collection/components/datetime/datetime.css +375 -0
- package/dist/collection/components/datetime/datetime.js +251 -0
- package/dist/collection/components/datetime/datetime.stories.js +149 -0
- package/dist/collection/components/divider/divider.stories.js +116 -0
- package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.js +339 -0
- package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.stories.js +130 -0
- package/dist/collection/components/dropdown/dropdown-native.stories.js +90 -0
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +185 -0
- package/dist/collection/components/dropdown/dropdown-wc-default.stories.js +151 -0
- package/dist/collection/components/dropdown/dropdown-wc-multiselect.stories.js +146 -0
- package/dist/collection/components/dropdown/dropdown.css +891 -0
- package/dist/collection/components/dropdown/dropdown.js +554 -0
- package/dist/collection/components/footer/footer.stories.js +100 -0
- package/dist/collection/components/header/header-all.stories.js +217 -0
- package/dist/collection/components/header/header-default.stories.js +47 -0
- package/dist/collection/components/header/header-inline.stories.js +113 -0
- package/dist/collection/components/header/header-search.stories.js +263 -0
- package/dist/collection/components/header/header-toolbar.stories.js +204 -0
- package/dist/collection/components/icon/icon-font.stories.js +57 -0
- package/dist/collection/components/icon/icon-web-component.stories.js +51 -0
- package/dist/collection/components/icon/icon.css +16 -0
- package/dist/collection/components/icon/icon.js +89 -0
- package/dist/collection/components/icon/iconsArray.js +2 -0
- package/dist/collection/components/link/link.stories.js +45 -0
- package/dist/collection/components/message/message.stories.js +117 -0
- package/dist/collection/components/modal/modal-native.stories.js +121 -0
- package/dist/collection/components/modal/modal-webcomponent.stories.js +78 -0
- package/dist/collection/components/modal/modal.css +324 -0
- package/dist/collection/components/modal/modal.js +146 -0
- package/dist/collection/components/popover-canvas/popover-canvas.css +20 -0
- package/dist/collection/components/popover-canvas/popover-canvas.js +190 -0
- package/dist/collection/components/popover-canvas/popover-canvas.stories.js +87 -0
- package/dist/collection/components/popover-menu/popover-menu-icons.stories.js +132 -0
- package/dist/collection/components/popover-menu/popover-menu.css +19 -0
- package/dist/collection/components/popover-menu/popover-menu.js +189 -0
- package/dist/collection/components/popover-menu/popover-menu.stories.js +109 -0
- package/dist/collection/components/radio-button/radio-button.stories.js +68 -0
- package/dist/collection/components/side-menu/side-menu.stories.js +182 -0
- package/dist/collection/components/slider/slider.css +260 -0
- package/dist/collection/components/slider/slider.js +682 -0
- package/dist/collection/components/slider/slider.stories.js +251 -0
- package/dist/collection/components/spinner/spinner.css +79 -0
- package/dist/collection/components/spinner/spinner.js +61 -0
- package/dist/collection/components/spinner/spinner.stories.js +59 -0
- package/dist/collection/components/stepper/stepper.stories.js +139 -0
- package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.css +159 -0
- package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.js +302 -0
- package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.stories.js +65 -0
- package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.css +172 -0
- package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.js +126 -0
- package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.stories.js +43 -0
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.css +153 -0
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +103 -0
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.stories.js +32 -0
- package/dist/collection/components/textarea/textarea.css +283 -0
- package/dist/collection/components/textarea/textarea.js +336 -0
- package/dist/collection/components/textarea/textarea.stories.js +149 -0
- package/dist/collection/components/textfield/textfield.css +494 -0
- package/dist/collection/components/textfield/textfield.js +359 -0
- package/dist/collection/components/textfield/textfield.stories.js +222 -0
- package/dist/collection/components/toast/toast.stories.js +119 -0
- package/dist/collection/components/toggle/toggle.stories.js +62 -0
- package/dist/collection/components/tooltip/tooltip.css +46 -0
- package/dist/collection/components/tooltip/tooltip.js +200 -0
- package/dist/collection/components/tooltip/tooltip.stories.js +113 -0
- package/dist/collection/components/utility/colour/background-color.stories.js +96 -0
- package/dist/collection/components/utility/colour/text-color.stories.js +94 -0
- package/dist/collection/foundations-stories/colour/colour-brand.stories.js +38 -0
- package/dist/collection/foundations-stories/colour/colour-scales.stories.js +71 -0
- package/dist/collection/foundations-stories/colour/colour-semantic.stories.js +40 -0
- package/dist/collection/foundations-stories/grid/grid.stories.js +386 -0
- package/dist/collection/foundations-stories/spacing/spacing-element.stories.js +100 -0
- package/dist/collection/foundations-stories/spacing/spacing-layout.stories.js +94 -0
- package/dist/collection/foundations-stories/typography/typography-body.stories.js +16 -0
- package/dist/collection/foundations-stories/typography/typography-detail.stories.js +17 -0
- package/dist/collection/foundations-stories/typography/typography-headline.stories.js +39 -0
- package/dist/collection/foundations-stories/typography/typography-paragraph.stories.js +12 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/stories/assets/code-brackets.svg +1 -0
- package/dist/collection/stories/assets/colors.svg +1 -0
- package/dist/collection/stories/assets/comments.svg +1 -0
- package/dist/collection/stories/assets/direction.svg +1 -0
- package/dist/collection/stories/assets/flow.svg +1 -0
- package/dist/collection/stories/assets/plugin.svg +1 -0
- package/dist/collection/stories/assets/repo.svg +1 -0
- package/dist/collection/stories/assets/stackalt.svg +1 -0
- package/dist/collection/utils/utils.js +12 -0
- package/dist/esm/index-b67b15a6.js +1884 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/popper-f860750c.js +1799 -0
- package/dist/esm/sdds-accordion-item.entry.js +30 -0
- package/dist/esm/sdds-accordion.entry.js +17 -0
- package/dist/esm/sdds-badges.entry.js +51 -0
- package/dist/esm/sdds-body-cell_2.entry.js +168 -0
- package/dist/esm/sdds-button.entry.js +32 -0
- package/dist/esm/sdds-datetime.entry.js +62 -0
- package/dist/esm/sdds-dropdown-filter.entry.js +88 -0
- package/dist/esm/sdds-dropdown_2.entry.js +330 -0
- package/dist/esm/sdds-header-cell.entry.js +137 -0
- package/dist/esm/sdds-icon.entry.js +38 -0
- package/dist/esm/sdds-inline-tabs-fullbleed.entry.js +92 -0
- package/dist/esm/sdds-inline-tabs.entry.js +207 -0
- package/dist/esm/sdds-modal.entry.js +45 -0
- package/dist/esm/sdds-navigation-tabs.entry.js +91 -0
- package/dist/esm/sdds-popover-canvas.entry.js +72 -0
- package/dist/esm/sdds-popover-menu.entry.js +71 -0
- package/dist/esm/sdds-slider.entry.js +332 -0
- package/dist/esm/sdds-spinner.entry.js +17 -0
- package/dist/esm/sdds-table-body-row-expandable.entry.js +77 -0
- package/dist/esm/sdds-table-body.entry.js +285 -0
- package/dist/esm/sdds-table-footer.entry.js +161 -0
- package/dist/esm/sdds-table-header.entry.js +96 -0
- package/dist/esm/sdds-table-toolbar.entry.js +62 -0
- package/dist/esm/sdds-table.entry.js +65 -0
- package/dist/esm/sdds-textarea.entry.js +57 -0
- package/dist/esm/sdds-textfield.entry.js +78 -0
- package/dist/esm/sdds-tooltip.entry.js +91 -0
- package/dist/esm/tegel.js +17 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/tegel/index.esm.js +0 -0
- package/dist/tegel/p-040efb32.entry.js +1 -0
- package/dist/tegel/p-12ca5cfa.entry.js +1 -0
- package/dist/tegel/p-157e1618.js +2 -0
- package/dist/tegel/p-1fe61cf6.entry.js +1 -0
- package/dist/tegel/p-2f376504.entry.js +1 -0
- package/dist/tegel/p-44ced895.entry.js +1 -0
- package/dist/tegel/p-4880f03d.entry.js +1 -0
- package/dist/tegel/p-4aba73a3.entry.js +1 -0
- package/dist/tegel/p-4b58a02c.entry.js +1 -0
- package/dist/tegel/p-4cb85347.entry.js +1 -0
- package/dist/tegel/p-52031b5a.entry.js +1 -0
- package/dist/tegel/p-677baf7f.entry.js +1 -0
- package/dist/tegel/p-71797eaf.entry.js +1 -0
- package/dist/tegel/p-7373284c.entry.js +1 -0
- package/dist/tegel/p-7451779b.entry.js +1 -0
- package/dist/tegel/p-77aeea3b.entry.js +1 -0
- package/dist/tegel/p-8582d6a7.entry.js +1 -0
- package/dist/tegel/p-96021bd0.entry.js +1 -0
- package/dist/tegel/p-9d8caf51.entry.js +1 -0
- package/dist/tegel/p-a5919930.entry.js +1 -0
- package/dist/tegel/p-b01cface.entry.js +1 -0
- package/dist/tegel/p-bf896643.entry.js +1 -0
- package/dist/tegel/p-c311725c.entry.js +1 -0
- package/dist/tegel/p-cf72dfd9.entry.js +1 -0
- package/dist/tegel/p-d91caec6.entry.js +1 -0
- package/dist/tegel/p-e10eec33.entry.js +1 -0
- package/dist/tegel/p-ec26fc38.js +1 -0
- package/dist/tegel/p-f2262a69.entry.js +1 -0
- package/dist/tegel/p-f2f7aa45.entry.js +1 -0
- package/dist/tegel/tegel.css +101 -0
- package/dist/tegel/tegel.esm.js +1 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { formatHtmlPreview } from '../../utils/utils';
|
|
2
|
+
import sddsTable from './table/readme.md';
|
|
3
|
+
import sddsTableToolbar from './table-toolbar/readme.md';
|
|
4
|
+
import sddsHeader from './table-header/readme.md';
|
|
5
|
+
import sddsHeaderCell from './table-header-cell/readme.md';
|
|
6
|
+
import sddsTableBody from './table-body/readme.md';
|
|
7
|
+
import sddsBodyRow from './table-body-row/readme.md';
|
|
8
|
+
import sddsBodyRowExpandable from './table-body-row-expandable/readme.md';
|
|
9
|
+
import sddsBodyCell from './table-body-cell/readme.md';
|
|
10
|
+
import sddsTableFooter from './table-footer/readme.md';
|
|
11
|
+
export default {
|
|
12
|
+
title: 'Components/Data Table/Web Component',
|
|
13
|
+
parameters: {
|
|
14
|
+
notes: {
|
|
15
|
+
'sdds-table': sddsTable,
|
|
16
|
+
'sdds-table-toolbar': sddsTableToolbar,
|
|
17
|
+
'sdds-header': sddsHeader,
|
|
18
|
+
'sdds-header-cell': sddsHeaderCell,
|
|
19
|
+
'sdds-table-body': sddsTableBody,
|
|
20
|
+
'sdds-body-row': sddsBodyRow,
|
|
21
|
+
'sdds-body-row-expandable': sddsBodyRowExpandable,
|
|
22
|
+
'sdds-body-cell': sddsBodyCell,
|
|
23
|
+
'sdds-table-footer': sddsTableFooter,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
argTypes: {
|
|
27
|
+
enableMultiselect: {
|
|
28
|
+
name: 'Enable multiselect',
|
|
29
|
+
description: 'Enable row selection.',
|
|
30
|
+
control: {
|
|
31
|
+
type: 'boolean',
|
|
32
|
+
},
|
|
33
|
+
table: {
|
|
34
|
+
defaultValue: {
|
|
35
|
+
summary: true,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
verticalDivider: {
|
|
40
|
+
name: 'Vertical dividers',
|
|
41
|
+
description: 'When enabled, table has vertical dividers between columns.',
|
|
42
|
+
control: {
|
|
43
|
+
type: 'boolean',
|
|
44
|
+
},
|
|
45
|
+
table: {
|
|
46
|
+
defaultValue: {
|
|
47
|
+
summary: false,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
compactDesign: {
|
|
52
|
+
name: 'Compact design',
|
|
53
|
+
description: 'Enables compact design of the table, rows with less height.',
|
|
54
|
+
control: {
|
|
55
|
+
type: 'boolean',
|
|
56
|
+
},
|
|
57
|
+
table: {
|
|
58
|
+
defaultValue: {
|
|
59
|
+
summary: false,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
onWhiteBackground: {
|
|
64
|
+
name: 'On white background',
|
|
65
|
+
description: 'Changes BG color of table element to grey variation for better visibility on white layouts',
|
|
66
|
+
control: {
|
|
67
|
+
type: 'boolean',
|
|
68
|
+
},
|
|
69
|
+
table: {
|
|
70
|
+
defaultValue: {
|
|
71
|
+
summary: false,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
responsiveDesign: {
|
|
76
|
+
name: 'Responsive table',
|
|
77
|
+
description: 'Table takes 100% of available width. For column values less then 192px, "No minimum width" has to be enabled too. ',
|
|
78
|
+
control: {
|
|
79
|
+
type: 'boolean',
|
|
80
|
+
},
|
|
81
|
+
table: {
|
|
82
|
+
defaultValue: {
|
|
83
|
+
summary: false,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
noMinWidth: {
|
|
88
|
+
name: 'No column minimum width limitation',
|
|
89
|
+
description: 'If columns should be able to shrink below 192px width.',
|
|
90
|
+
control: {
|
|
91
|
+
type: 'boolean',
|
|
92
|
+
},
|
|
93
|
+
table: {
|
|
94
|
+
defaultValue: {
|
|
95
|
+
summary: 'false',
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
args: {
|
|
101
|
+
compactDesign: false,
|
|
102
|
+
onWhiteBackground: false,
|
|
103
|
+
verticalDivider: false,
|
|
104
|
+
responsiveDesign: false,
|
|
105
|
+
noMinWidth: false,
|
|
106
|
+
enableMultiselect: true,
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
const MultiselectTemplate = ({ verticalDivider, compactDesign, onWhiteBackground, responsiveDesign, enableMultiselect, noMinWidth, }) => formatHtmlPreview(`
|
|
110
|
+
<script>
|
|
111
|
+
// Note: Script here is only for demo purposes
|
|
112
|
+
function getValue() {
|
|
113
|
+
const element = document.querySelector('#multiselect-table > sdds-table-body');
|
|
114
|
+
const textArea = document.getElementById('selected-rows-value-textarea');
|
|
115
|
+
const observer = new MutationObserver(mutations => {
|
|
116
|
+
mutations.forEach(mutation => {
|
|
117
|
+
if (mutation.type === 'attributes') {
|
|
118
|
+
textArea.value = element.getAttribute('data-selected-rows');
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
observer.observe(element, {
|
|
123
|
+
attributes: true,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
window.addEventListener('click', () => {
|
|
127
|
+
getValue();
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
</script>
|
|
131
|
+
|
|
132
|
+
<h3>Multiselect</h3>
|
|
133
|
+
<sdds-table
|
|
134
|
+
id="multiselect-table"
|
|
135
|
+
${enableMultiselect ? 'enable-multiselect' : ''}
|
|
136
|
+
vertical-dividers="${verticalDivider}"
|
|
137
|
+
compact-design="${compactDesign}"
|
|
138
|
+
white-background="${onWhiteBackground}"
|
|
139
|
+
enable-responsive="${responsiveDesign}"
|
|
140
|
+
${noMinWidth ? 'no-min-width' : ''}
|
|
141
|
+
>
|
|
142
|
+
<sdds-table-header>
|
|
143
|
+
<sdds-header-cell column-key='truck' column-title='Truck type'></sdds-header-cell>
|
|
144
|
+
<sdds-header-cell column-key='driver' column-title='Driver name'></sdds-header-cell>
|
|
145
|
+
<sdds-header-cell column-key='country' column-title='Country'></sdds-header-cell>
|
|
146
|
+
<sdds-header-cell column-key='mileage' column-title='Mileage' text-align='right'></sdds-header-cell>
|
|
147
|
+
</sdds-table-header>
|
|
148
|
+
<sdds-table-body enable-dummy-data>
|
|
149
|
+
</sdds-table-body>
|
|
150
|
+
</sdds-table>
|
|
151
|
+
|
|
152
|
+
<!-- Note: Code below is just for demo purposes -->
|
|
153
|
+
<div class="sdds-u-mt1" style="width: 450px; background-color: lightblue; padding: 16px;">
|
|
154
|
+
<p class="sdds-u-mt0">Note: This box works only in "Canvas" tab.</p>
|
|
155
|
+
<h6 class="sdds-u-pb0 sdds-u-mb0 sdds-u-mt0">Selected rows data</h6>
|
|
156
|
+
<small>Values here are values found in data-selected-rows attribute of sdds-table-body element. They are shown here just for presentation purposes.</small>
|
|
157
|
+
<textarea id="selected-rows-value-textarea" rows="5" cols="50" readonly></textarea>
|
|
158
|
+
</div>`);
|
|
159
|
+
export const Multiselect = MultiselectTemplate.bind({});
|
|
160
|
+
Multiselect.args = {};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { formatHtmlPreview } from '../../utils/utils';
|
|
2
|
+
import sddsTable from './table/readme.md';
|
|
3
|
+
import sddsTableToolbar from './table-toolbar/readme.md';
|
|
4
|
+
import sddsHeader from './table-header/readme.md';
|
|
5
|
+
import sddsHeaderCell from './table-header-cell/readme.md';
|
|
6
|
+
import sddsTableBody from './table-body/readme.md';
|
|
7
|
+
import sddsBodyRow from './table-body-row/readme.md';
|
|
8
|
+
import sddsBodyRowExpandable from './table-body-row-expandable/readme.md';
|
|
9
|
+
import sddsBodyCell from './table-body-cell/readme.md';
|
|
10
|
+
import sddsTableFooter from './table-footer/readme.md';
|
|
11
|
+
export default {
|
|
12
|
+
title: 'Components/Data Table/Web Component',
|
|
13
|
+
parameters: {
|
|
14
|
+
notes: {
|
|
15
|
+
'sdds-table': sddsTable,
|
|
16
|
+
'sdds-table-toolbar': sddsTableToolbar,
|
|
17
|
+
'sdds-header': sddsHeader,
|
|
18
|
+
'sdds-header-cell': sddsHeaderCell,
|
|
19
|
+
'sdds-table-body': sddsTableBody,
|
|
20
|
+
'sdds-body-row': sddsBodyRow,
|
|
21
|
+
'sdds-body-row-expandable': sddsBodyRowExpandable,
|
|
22
|
+
'sdds-body-cell': sddsBodyCell,
|
|
23
|
+
'sdds-table-footer': sddsTableFooter,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
argTypes: {
|
|
27
|
+
verticalDivider: {
|
|
28
|
+
name: 'Vertical dividers',
|
|
29
|
+
description: 'When enabled, table has vertical dividers between columns.',
|
|
30
|
+
control: {
|
|
31
|
+
type: 'boolean',
|
|
32
|
+
},
|
|
33
|
+
table: {
|
|
34
|
+
defaultValue: {
|
|
35
|
+
summary: false,
|
|
36
|
+
},
|
|
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: {
|
|
47
|
+
summary: false,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
onWhiteBackground: {
|
|
52
|
+
name: 'On white background',
|
|
53
|
+
description: 'Changes BG color of table element to grey variation for better visibility on white layouts',
|
|
54
|
+
control: {
|
|
55
|
+
type: 'boolean',
|
|
56
|
+
},
|
|
57
|
+
table: {
|
|
58
|
+
defaultValue: {
|
|
59
|
+
summary: false,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
responsiveDesign: {
|
|
64
|
+
name: 'Responsive table',
|
|
65
|
+
description: 'Table takes 100% of available width. For column values less then 192px, "No minimum width" has to be enabled too. ',
|
|
66
|
+
control: {
|
|
67
|
+
type: 'boolean',
|
|
68
|
+
},
|
|
69
|
+
table: {
|
|
70
|
+
defaultValue: {
|
|
71
|
+
summary: false,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
noMinWidth: {
|
|
76
|
+
name: 'No column minimum width limitation',
|
|
77
|
+
description: 'If columns should be able to shrink below 192px width.',
|
|
78
|
+
control: {
|
|
79
|
+
type: 'boolean',
|
|
80
|
+
},
|
|
81
|
+
table: {
|
|
82
|
+
defaultValue: {
|
|
83
|
+
summary: 'false',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
rowsPerPageControl: {
|
|
88
|
+
name: 'Rows per page',
|
|
89
|
+
description: 'Specify how many rows per page user would like to see',
|
|
90
|
+
control: {
|
|
91
|
+
type: 'number',
|
|
92
|
+
},
|
|
93
|
+
table: {
|
|
94
|
+
defaultValue: {
|
|
95
|
+
summary: 4,
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
args: {
|
|
101
|
+
compactDesign: false,
|
|
102
|
+
onWhiteBackground: false,
|
|
103
|
+
verticalDivider: false,
|
|
104
|
+
responsiveDesign: false,
|
|
105
|
+
rowsPerPageControl: 4,
|
|
106
|
+
noMinWidth: false,
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
const PaginationTemplate = ({ verticalDivider, compactDesign, onWhiteBackground, rowsPerPageControl, responsiveDesign, noMinWidth, }) => formatHtmlPreview(`
|
|
110
|
+
<h3>Pagination</h3>
|
|
111
|
+
<sdds-table
|
|
112
|
+
vertical-dividers="${verticalDivider}"
|
|
113
|
+
compact-design="${compactDesign}"
|
|
114
|
+
white-background="${onWhiteBackground}"
|
|
115
|
+
enable-responsive="${responsiveDesign}"
|
|
116
|
+
${noMinWidth ? 'no-min-width' : ''}
|
|
117
|
+
>
|
|
118
|
+
<sdds-table-header>
|
|
119
|
+
<sdds-header-cell column-key='truck' column-title='Truck type'></sdds-header-cell>
|
|
120
|
+
<sdds-header-cell column-key='driver' column-title='Driver name'></sdds-header-cell>
|
|
121
|
+
<sdds-header-cell column-key='country' column-title='Country'></sdds-header-cell>
|
|
122
|
+
<sdds-header-cell column-key='mileage' column-title='Mileage' text-align='right'></sdds-header-cell>
|
|
123
|
+
</sdds-table-header>
|
|
124
|
+
<sdds-table-body enable-dummy-data>
|
|
125
|
+
</sdds-table-body>
|
|
126
|
+
<sdds-table-footer enable-pagination rows-per-page="${rowsPerPageControl}"></sdds-table-footer>
|
|
127
|
+
</sdds-table>`);
|
|
128
|
+
export const Pagination = PaginationTemplate.bind({});
|
|
129
|
+
Pagination.args = {};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { formatHtmlPreview } from '../../utils/utils';
|
|
2
|
+
import sddsTable from './table/readme.md';
|
|
3
|
+
import sddsTableToolbar from './table-toolbar/readme.md';
|
|
4
|
+
import sddsHeader from './table-header/readme.md';
|
|
5
|
+
import sddsHeaderCell from './table-header-cell/readme.md';
|
|
6
|
+
import sddsTableBody from './table-body/readme.md';
|
|
7
|
+
import sddsBodyRow from './table-body-row/readme.md';
|
|
8
|
+
import sddsBodyRowExpandable from './table-body-row-expandable/readme.md';
|
|
9
|
+
import sddsBodyCell from './table-body-cell/readme.md';
|
|
10
|
+
import sddsTableFooter from './table-footer/readme.md';
|
|
11
|
+
export default {
|
|
12
|
+
title: 'Components/Data Table/Web Component',
|
|
13
|
+
parameters: {
|
|
14
|
+
notes: {
|
|
15
|
+
'sdds-table': sddsTable,
|
|
16
|
+
'sdds-table-toolbar': sddsTableToolbar,
|
|
17
|
+
'sdds-header': sddsHeader,
|
|
18
|
+
'sdds-header-cell': sddsHeaderCell,
|
|
19
|
+
'sdds-table-body': sddsTableBody,
|
|
20
|
+
'sdds-body-row': sddsBodyRow,
|
|
21
|
+
'sdds-body-row-expandable': sddsBodyRowExpandable,
|
|
22
|
+
'sdds-body-cell': sddsBodyCell,
|
|
23
|
+
'sdds-table-footer': sddsTableFooter,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
argTypes: {
|
|
27
|
+
verticalDivider: {
|
|
28
|
+
name: 'Vertical dividers',
|
|
29
|
+
control: {
|
|
30
|
+
type: 'boolean',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
compactDesign: {
|
|
34
|
+
name: 'Compact Design',
|
|
35
|
+
control: {
|
|
36
|
+
type: 'boolean',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
onWhiteBackground: {
|
|
40
|
+
name: 'On white background',
|
|
41
|
+
control: {
|
|
42
|
+
type: 'boolean',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
responsiveDesign: {
|
|
46
|
+
name: 'Responsive design',
|
|
47
|
+
control: {
|
|
48
|
+
type: 'boolean',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
column1sortable: {
|
|
52
|
+
name: 'Column 1 is sortable',
|
|
53
|
+
control: {
|
|
54
|
+
type: 'boolean',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
column2sortable: {
|
|
58
|
+
name: 'Column 2 is sortable',
|
|
59
|
+
control: {
|
|
60
|
+
type: 'boolean',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
column3sortable: {
|
|
64
|
+
name: 'Column 3 is sortable',
|
|
65
|
+
control: {
|
|
66
|
+
type: 'boolean',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
column4sortable: {
|
|
70
|
+
name: 'Column 4 is sortable',
|
|
71
|
+
control: {
|
|
72
|
+
type: 'boolean',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
args: {
|
|
77
|
+
verticalDivider: false,
|
|
78
|
+
compactDesign: false,
|
|
79
|
+
onWhiteBackground: false,
|
|
80
|
+
responsiveDesign: false,
|
|
81
|
+
column1sortable: true,
|
|
82
|
+
column2sortable: true,
|
|
83
|
+
column3sortable: true,
|
|
84
|
+
column4sortable: true,
|
|
85
|
+
noMinWidth: false,
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
const SortingTemplate = ({ verticalDivider, compactDesign, onWhiteBackground, responsiveDesign, column1sortable, column2sortable, column3sortable, column4sortable, noMinWidth, }) => formatHtmlPreview(`
|
|
89
|
+
<h3>Sorting example</h3>
|
|
90
|
+
<sdds-table
|
|
91
|
+
vertical-dividers="${verticalDivider}"
|
|
92
|
+
compact-design="${compactDesign}"
|
|
93
|
+
white-background="${onWhiteBackground}"
|
|
94
|
+
enable-responsive="${responsiveDesign}"
|
|
95
|
+
${noMinWidth ? 'no-min-width' : ''}
|
|
96
|
+
>
|
|
97
|
+
<sdds-table-header>
|
|
98
|
+
<sdds-header-cell column-key='truck' column-title='Truck type' sortable="${column1sortable}"></sdds-header-cell>
|
|
99
|
+
<sdds-header-cell column-key='driver' column-title='Driver name' sortable="${column2sortable}"></sdds-header-cell>
|
|
100
|
+
<sdds-header-cell column-key='country' column-title='Country' sortable="${column3sortable}"></sdds-header-cell>
|
|
101
|
+
<sdds-header-cell column-key='mileage' column-title='Mileage' sortable="${column4sortable}" text-align='right'></sdds-header-cell>
|
|
102
|
+
</sdds-table-header>
|
|
103
|
+
<sdds-table-body enable-dummy-data>
|
|
104
|
+
</sdds-table-body>
|
|
105
|
+
</sdds-table>`);
|
|
106
|
+
export const Sorting = SortingTemplate.bind({});
|
|
107
|
+
Sorting.args = {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
display: table-footer-group;
|
|
4
|
+
height: 48px;
|
|
5
|
+
}
|
|
6
|
+
:host * {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
}
|
|
9
|
+
:host .sdds-table__footer-row {
|
|
10
|
+
background-color: var(--sdds-grey-100);
|
|
11
|
+
}
|
|
12
|
+
:host .sdds-table__footer-cell {
|
|
13
|
+
padding: 0 16px;
|
|
14
|
+
}
|
|
15
|
+
:host .sdds-table__footer-cell .sdds-table__pagination {
|
|
16
|
+
height: 48px;
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
}
|
|
21
|
+
:host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__row-selector,
|
|
22
|
+
:host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__page-selector {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
}
|
|
26
|
+
:host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__page-selector-input {
|
|
27
|
+
font: var(--sdds-detail-02);
|
|
28
|
+
letter-spacing: var(--sdds-detail-02-ls);
|
|
29
|
+
background-color: var(--sdds-grey-50);
|
|
30
|
+
width: 36px;
|
|
31
|
+
height: 30px;
|
|
32
|
+
border: none;
|
|
33
|
+
border-radius: 4px;
|
|
34
|
+
transition: background-color 250ms ease;
|
|
35
|
+
margin-right: 4px;
|
|
36
|
+
padding-right: 8px;
|
|
37
|
+
}
|
|
38
|
+
:host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__page-selector-input:hover {
|
|
39
|
+
background-color: var(--sdds-white);
|
|
40
|
+
}
|
|
41
|
+
:host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__page-selector-input:disabled {
|
|
42
|
+
color: var(--sdds-grey-600);
|
|
43
|
+
}
|
|
44
|
+
:host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__page-selector-input--shake {
|
|
45
|
+
animation: sdds-shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
|
|
46
|
+
transform: translate3d(0, 0, 0);
|
|
47
|
+
backface-visibility: hidden;
|
|
48
|
+
perspective: 1000px;
|
|
49
|
+
}
|
|
50
|
+
:host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__footer-text {
|
|
51
|
+
font: var(--sdds-detail-02);
|
|
52
|
+
letter-spacing: var(--sdds-detail-02-ls);
|
|
53
|
+
padding: 1px 8px 0 0;
|
|
54
|
+
}
|
|
55
|
+
:host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__footer-btn {
|
|
56
|
+
display: flex;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
align-items: center;
|
|
59
|
+
border: none;
|
|
60
|
+
background-color: transparent;
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
height: 32px;
|
|
63
|
+
width: 32px;
|
|
64
|
+
border-radius: 4px;
|
|
65
|
+
transition: background-color 250ms ease;
|
|
66
|
+
}
|
|
67
|
+
:host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__footer-btn:hover {
|
|
68
|
+
background-color: var(--sdds-grey-300);
|
|
69
|
+
}
|
|
70
|
+
:host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__footer-btn:disabled {
|
|
71
|
+
cursor: default;
|
|
72
|
+
}
|
|
73
|
+
:host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__footer-btn:disabled:hover {
|
|
74
|
+
background-color: transparent;
|
|
75
|
+
}
|
|
76
|
+
:host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__footer-btn-svg {
|
|
77
|
+
height: 20px;
|
|
78
|
+
width: 20px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:host(.sdds-table--compact) {
|
|
82
|
+
height: 32px;
|
|
83
|
+
}
|
|
84
|
+
:host(.sdds-table--compact) .sdds-table__footer-cell .sdds-table__pagination {
|
|
85
|
+
height: 32px;
|
|
86
|
+
}
|
|
87
|
+
:host(.sdds-table--compact) .sdds-table__footer-cell .sdds-table__pagination .sdds-table__page-selector-input {
|
|
88
|
+
height: 24px;
|
|
89
|
+
}
|
|
90
|
+
:host(.sdds-table--compact) .sdds-table__footer-cell .sdds-table__pagination .sdds-table__footer-btn {
|
|
91
|
+
height: 28px;
|
|
92
|
+
width: 28px;
|
|
93
|
+
}
|