@scania/tegel 0.0.1-beta.3 → 0.0.1-beta.5
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/components/dropdown-option.js +0 -1
- package/dist/components/dropdown.js +0 -1
- package/dist/components/icon.js +0 -1
- package/dist/components/sdds-accordion-item.js +0 -1
- package/dist/components/sdds-accordion.js +0 -1
- package/dist/components/sdds-badges.js +0 -1
- package/dist/components/sdds-button.js +0 -1
- package/dist/components/sdds-datetime.js +0 -1
- package/dist/components/sdds-dropdown-filter.js +0 -1
- package/dist/components/sdds-header-cell.js +0 -1
- package/dist/components/sdds-inline-tabs-fullbleed.js +0 -1
- package/dist/components/sdds-inline-tabs.js +0 -1
- package/dist/components/sdds-modal.js +0 -1
- package/dist/components/sdds-navigation-tabs.js +0 -1
- package/dist/components/sdds-popover-canvas.js +0 -1
- package/dist/components/sdds-popover-menu.js +0 -1
- package/dist/components/sdds-slider.js +0 -1
- package/dist/components/sdds-spinner.js +0 -1
- package/dist/components/sdds-table-body-row-expandable.js +0 -1
- package/dist/components/sdds-table-body.js +0 -1
- package/dist/components/sdds-table-footer.js +0 -1
- package/dist/components/sdds-table-header.js +0 -1
- package/dist/components/sdds-table-toolbar.js +0 -1
- package/dist/components/sdds-table.js +0 -1
- package/dist/components/sdds-textarea.js +0 -1
- package/dist/components/sdds-textfield.js +0 -1
- package/dist/components/sdds-tooltip.js +0 -1
- package/dist/components/table-body-cell.js +0 -1
- package/dist/components/table-body-row.js +0 -1
- 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 +4 -4
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { h, Host } from '@stencil/core';
|
|
2
|
+
const relevantTableProps = [
|
|
3
|
+
'enableMultiselect',
|
|
4
|
+
'enableExpandableRows',
|
|
5
|
+
'verticalDividers',
|
|
6
|
+
'compactDesign',
|
|
7
|
+
'noMinWidth',
|
|
8
|
+
'whiteBackground',
|
|
9
|
+
];
|
|
10
|
+
export class TableHeaderRow {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.enableMultiselect = false;
|
|
13
|
+
this.enableExpandableRows = false;
|
|
14
|
+
this.mainCheckboxSelected = false;
|
|
15
|
+
this.mainExpendSelected = false;
|
|
16
|
+
this.verticalDividers = false;
|
|
17
|
+
this.compactDesign = false;
|
|
18
|
+
this.noMinWidth = false;
|
|
19
|
+
this.whiteBackground = false;
|
|
20
|
+
this.enableToolbarDesign = false;
|
|
21
|
+
this.tableId = '';
|
|
22
|
+
}
|
|
23
|
+
tablePropsChangedEventListener(event) {
|
|
24
|
+
if (this.tableId === event.detail.tableId) {
|
|
25
|
+
event.detail.changed
|
|
26
|
+
.filter((changedProp) => relevantTableProps.includes(changedProp))
|
|
27
|
+
.forEach((changedProp) => {
|
|
28
|
+
if (typeof this[changedProp] === 'undefined') {
|
|
29
|
+
throw new Error(`Table prop is not supported: ${changedProp}`);
|
|
30
|
+
}
|
|
31
|
+
this[changedProp] = event.detail[changedProp];
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
updateMainCheckboxEventListener(event) {
|
|
36
|
+
const [receivedID, receivedMainCheckboxStatus] = event.detail;
|
|
37
|
+
if (this.tableId === receivedID) {
|
|
38
|
+
this.mainCheckboxSelected = receivedMainCheckboxStatus;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
singleRowExpandedEventListener(event) {
|
|
42
|
+
if (this.tableId === event.detail[0]) {
|
|
43
|
+
// TODO: Improve this logic. Why we get late repose in DOM?
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
this.bodyExpandClicked();
|
|
46
|
+
}, 100);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
bodyExpandClicked() {
|
|
50
|
+
const numberOfExtendRowsActive = this.host.parentElement
|
|
51
|
+
.querySelector('sdds-table-body')
|
|
52
|
+
.getElementsByClassName('sdds-table__row-extend--active').length;
|
|
53
|
+
const numberOfExtendRows = this.host.parentElement
|
|
54
|
+
.querySelector('sdds-table-body')
|
|
55
|
+
.getElementsByTagName('sdds-table-body-row-expendable').length;
|
|
56
|
+
if (numberOfExtendRows === numberOfExtendRowsActive) {
|
|
57
|
+
this.mainExpendSelected = true;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
this.mainExpendSelected = false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
connectedCallback() {
|
|
64
|
+
this.tableEl = this.host.closest('sdds-table');
|
|
65
|
+
this.tableId = this.tableEl.tableId;
|
|
66
|
+
}
|
|
67
|
+
componentWillLoad() {
|
|
68
|
+
relevantTableProps.forEach((tablePropName) => {
|
|
69
|
+
this[tablePropName] = this.tableEl[tablePropName];
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
componentWillRender() {
|
|
73
|
+
this.enableToolbarDesign =
|
|
74
|
+
this.host.closest('sdds-table').getElementsByTagName('sdds-table-toolbar').length >= 1;
|
|
75
|
+
}
|
|
76
|
+
headCheckBoxClicked(event) {
|
|
77
|
+
this.mainCheckboxSelected = event.currentTarget.checked;
|
|
78
|
+
this.mainCheckboxSelectedEvent.emit([this.tableId, this.mainCheckboxSelected]);
|
|
79
|
+
}
|
|
80
|
+
render() {
|
|
81
|
+
return (h(Host, { class: {
|
|
82
|
+
'sdds-table--compact': this.compactDesign,
|
|
83
|
+
'sdds-table--divider': this.verticalDividers,
|
|
84
|
+
'sdds-table--toolbar-available': this.enableToolbarDesign,
|
|
85
|
+
} }, h("tr", null, this.enableMultiselect && (h("th", { class: "sdds-table__header-cell sdds-table__header-cell--checkbox" }, h("div", { class: "sdds-checkbox-item" }, h("label", { class: "sdds-form-label sdds-form-label--data-table" }, h("input", { class: "sdds-form-input", type: "checkbox", onChange: (e) => this.headCheckBoxClicked(e), checked: this.mainCheckboxSelected }))))), this.enableExpandableRows && (h("th", { class: "sdds-table__header-cell sdds-table__header-cell--checkbox" })), h("slot", null))));
|
|
86
|
+
}
|
|
87
|
+
static get is() { return "sdds-table-header"; }
|
|
88
|
+
static get encapsulation() { return "shadow"; }
|
|
89
|
+
static get originalStyleUrls() {
|
|
90
|
+
return {
|
|
91
|
+
"$": ["table-header.scss"]
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
static get styleUrls() {
|
|
95
|
+
return {
|
|
96
|
+
"$": ["table-header.css"]
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
static get states() {
|
|
100
|
+
return {
|
|
101
|
+
"enableMultiselect": {},
|
|
102
|
+
"enableExpandableRows": {},
|
|
103
|
+
"mainCheckboxSelected": {},
|
|
104
|
+
"mainExpendSelected": {},
|
|
105
|
+
"verticalDividers": {},
|
|
106
|
+
"compactDesign": {},
|
|
107
|
+
"noMinWidth": {},
|
|
108
|
+
"whiteBackground": {},
|
|
109
|
+
"enableToolbarDesign": {},
|
|
110
|
+
"tableId": {}
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
static get events() {
|
|
114
|
+
return [{
|
|
115
|
+
"method": "mainCheckboxSelectedEvent",
|
|
116
|
+
"name": "mainCheckboxSelectedEvent",
|
|
117
|
+
"bubbles": true,
|
|
118
|
+
"cancelable": true,
|
|
119
|
+
"composed": true,
|
|
120
|
+
"docs": {
|
|
121
|
+
"tags": [],
|
|
122
|
+
"text": "Send status of main checkbox in header to the parent, sdds-table component"
|
|
123
|
+
},
|
|
124
|
+
"complexType": {
|
|
125
|
+
"original": "any",
|
|
126
|
+
"resolved": "any",
|
|
127
|
+
"references": {}
|
|
128
|
+
}
|
|
129
|
+
}];
|
|
130
|
+
}
|
|
131
|
+
static get elementRef() { return "host"; }
|
|
132
|
+
static get listeners() {
|
|
133
|
+
return [{
|
|
134
|
+
"name": "tablePropsChangedEvent",
|
|
135
|
+
"method": "tablePropsChangedEventListener",
|
|
136
|
+
"target": "body",
|
|
137
|
+
"capture": false,
|
|
138
|
+
"passive": false
|
|
139
|
+
}, {
|
|
140
|
+
"name": "updateMainCheckboxEvent",
|
|
141
|
+
"method": "updateMainCheckboxEventListener",
|
|
142
|
+
"target": "body",
|
|
143
|
+
"capture": false,
|
|
144
|
+
"passive": false
|
|
145
|
+
}, {
|
|
146
|
+
"name": "singleRowExpandedEvent",
|
|
147
|
+
"method": "singleRowExpandedEventListener",
|
|
148
|
+
"target": "body",
|
|
149
|
+
"capture": false,
|
|
150
|
+
"passive": false
|
|
151
|
+
}];
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
:host(.sdds-table__header-cell) {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
font: var(--sdds-headline-07);
|
|
4
|
+
letter-spacing: var(--sdds-headline-07-ls);
|
|
5
|
+
display: table-cell;
|
|
6
|
+
text-align: left;
|
|
7
|
+
color: var(--sdds-grey-958);
|
|
8
|
+
background-color: var(--sdds-grey-300);
|
|
9
|
+
border-bottom: 1px solid var(--sdds-grey-400);
|
|
10
|
+
padding: 0;
|
|
11
|
+
height: 48px;
|
|
12
|
+
min-width: 192px;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
vertical-align: middle;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
transition: background-color 200ms ease;
|
|
17
|
+
}
|
|
18
|
+
:host(.sdds-table__header-cell) * {
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
}
|
|
21
|
+
:host(.sdds-table__header-cell) .sdds-table__header-text {
|
|
22
|
+
padding: 0 16px;
|
|
23
|
+
margin: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host(.sdds-table__header-cell--sortable) .sdds-table__header-button {
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
gap: 8px;
|
|
30
|
+
justify-content: start;
|
|
31
|
+
flex-direction: row;
|
|
32
|
+
width: 100%;
|
|
33
|
+
height: 100%;
|
|
34
|
+
padding: 0 16px;
|
|
35
|
+
background-color: transparent;
|
|
36
|
+
border: none;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
transition: background-color 200ms ease;
|
|
39
|
+
}
|
|
40
|
+
:host(.sdds-table__header-cell--sortable) .sdds-table__header-button:focus {
|
|
41
|
+
outline: 2px solid var(--sdds-blue-400);
|
|
42
|
+
outline-offset: -2px;
|
|
43
|
+
}
|
|
44
|
+
:host(.sdds-table__header-cell--sortable) .sdds-table__header-button:focus .sdds-table__header-button-icon {
|
|
45
|
+
opacity: 1;
|
|
46
|
+
}
|
|
47
|
+
:host(.sdds-table__header-cell--sortable) .sdds-table__header-button .sdds-table__header-button-text {
|
|
48
|
+
font: var(--sdds-headline-07);
|
|
49
|
+
letter-spacing: var(--sdds-headline-07-ls);
|
|
50
|
+
text-align: left;
|
|
51
|
+
color: var(--sdds-grey-958);
|
|
52
|
+
}
|
|
53
|
+
:host(.sdds-table__header-cell--sortable) .sdds-table__header-button .sdds-table__header-button-icon {
|
|
54
|
+
/* not to shrink on lot of text */
|
|
55
|
+
flex: 0 0 16px;
|
|
56
|
+
height: 16px;
|
|
57
|
+
opacity: 0;
|
|
58
|
+
transform-origin: center;
|
|
59
|
+
transition: opacity 200ms ease-in, transform 200ms ease;
|
|
60
|
+
}
|
|
61
|
+
:host(.sdds-table__header-cell--sortable) .sdds-table__header-button:hover .sdds-table__header-button-icon {
|
|
62
|
+
opacity: 1;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:host(.sdds-table__header-cell--right-align) .sdds-table__header-button {
|
|
66
|
+
text-align: right;
|
|
67
|
+
justify-content: end;
|
|
68
|
+
flex-direction: row-reverse;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:host(.sdds-table__header-cell--is-sorted) .sdds-table__header-button {
|
|
72
|
+
background-color: var(--sdds-grey-500);
|
|
73
|
+
}
|
|
74
|
+
:host(.sdds-table__header-cell--is-sorted) .sdds-table__header-button:hover {
|
|
75
|
+
background-color: var(--sdds-grey-400);
|
|
76
|
+
}
|
|
77
|
+
:host(.sdds-table__header-cell--is-sorted) .sdds-table__header-button .sdds-table__header-button-icon {
|
|
78
|
+
opacity: 1;
|
|
79
|
+
}
|
|
80
|
+
:host(.sdds-table__header-cell--is-sorted) .sdds-table__header-button .sdds-table__header-button-icon--rotate {
|
|
81
|
+
transform: rotate(180deg);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:host(.sdds-table--compact) {
|
|
85
|
+
height: 33px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:host(.sdds-table--divider) {
|
|
89
|
+
border-right: 1px solid var(--sdds-grey-400);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:host(.sdds-table--divider:last-of-type) {
|
|
93
|
+
border-right: none;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
:host(.sdds-table--no-min-width) {
|
|
97
|
+
min-width: unset;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:host(.sdds-table__header-cell:first-of-type) {
|
|
101
|
+
border-top-left-radius: 4px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
:host(.sdds-table__header-cell:last-of-type) {
|
|
105
|
+
border-top-right-radius: 4px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:host(.sdds-table--extra-column:first-of-type) {
|
|
109
|
+
border-top-left-radius: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
:host(.sdds-table--toolbar-available) {
|
|
113
|
+
border-radius: 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
:host(.sdds-table--extra-column.sdds-table--toolbar-available) {
|
|
117
|
+
border-radius: 0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
:host(.sdds-table__header-cell.sdds-table--toolbar-available:first-of-type) {
|
|
121
|
+
border-top-left-radius: 0;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
:host(.sdds-table__header-cell.sdds-table--toolbar-available:last-of-type) {
|
|
125
|
+
border-top-right-radius: 0;
|
|
126
|
+
}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import { h, Host, } from '@stencil/core';
|
|
2
|
+
const relevantTableProps = [
|
|
3
|
+
'enableMultiselect',
|
|
4
|
+
'enableExpandableRows',
|
|
5
|
+
'compactDesign',
|
|
6
|
+
'noMinWidth',
|
|
7
|
+
'verticalDividers',
|
|
8
|
+
'whiteBackground',
|
|
9
|
+
];
|
|
10
|
+
export class TableHeaderCell {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.sortButtonClick = (key) => {
|
|
13
|
+
// Toggling direction of sorting as we only use one button for sorting
|
|
14
|
+
if (this.sortingDirection !== 'asc') {
|
|
15
|
+
this.sortingDirection = 'asc';
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
this.sortingDirection = 'desc';
|
|
19
|
+
}
|
|
20
|
+
// Setting to true we can set enable CSS class for "active" state of column
|
|
21
|
+
this.sortedByMyKey = true;
|
|
22
|
+
// Use array to send both key and sorting direction
|
|
23
|
+
this.sortColumnDataEvent.emit([this.tableId, key, this.sortingDirection]);
|
|
24
|
+
};
|
|
25
|
+
this.headerCellContent = () => {
|
|
26
|
+
if (this.sortable && !this.disableSortingBtn) {
|
|
27
|
+
return (h("button", { class: "sdds-table__header-button", onClick: () => this.sortButtonClick(this.columnKey) }, h("span", { class: "sdds-table__header-button-text", style: { textAlign: this.textAlignState } }, this.columnTitle), this.sortingDirection === '' && (h("svg", { class: "sdds-table__header-button-icon", fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 12 15" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M8.45 13.67V4.62a.5.5 0 0 1 1 0v9.05h-1Z", fill: "currentColor" }), h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M6.07 10.28a.5.5 0 0 1 .7.08l2.1 2.66a.1.1 0 0 0 .15 0l2.09-2.66a.5.5 0 1 1 .78.62l-2.08 2.66a1.1 1.1 0 0 1-1.73 0l-2.1-2.66a.5.5 0 0 1 .1-.7ZM3.55.4v9.04a.5.5 0 1 1-1 0V.39h1Z", fill: "currentColor" }), h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M5.93 3.78a.5.5 0 0 1-.7-.08l-2.1-2.66a.1.1 0 0 0-.15 0L.89 3.7a.5.5 0 0 1-.78-.62L2.19.42a1.1 1.1 0 0 1 1.73 0l2.1 2.66a.5.5 0 0 1-.1.7Z", fill: "currentColor" }))), this.sortingDirection !== '' && (h("svg", { class: `sdds-table__header-button-icon ${this.sortingDirection === 'desc' ? 'sdds-table__header-button-icon--rotate' : ''}`, fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M17 2.974a1 1 0 0 0-2 0v24.3l-9.312-9.312a1 1 0 0 0-1.414 1.414l9.887 9.888a2.6 2.6 0 0 0 3.677 0l9.888-9.888a1 1 0 0 0-1.414-1.414L17 27.274v-24.3Z", fill: "currentColor" })))));
|
|
28
|
+
}
|
|
29
|
+
return (h("p", { class: "sdds-table__header-text", style: { textAlign: this.textAlignState } }, this.columnTitle));
|
|
30
|
+
};
|
|
31
|
+
this.onHeadCellHover = (key) => {
|
|
32
|
+
this.headCellHoverEvent.emit([this.tableId, key]);
|
|
33
|
+
};
|
|
34
|
+
this.columnKey = undefined;
|
|
35
|
+
this.columnTitle = undefined;
|
|
36
|
+
this.customWidth = undefined;
|
|
37
|
+
this.sortable = false;
|
|
38
|
+
this.textAlign = undefined;
|
|
39
|
+
this.textAlignState = undefined;
|
|
40
|
+
this.sortingDirection = '';
|
|
41
|
+
this.sortedByMyKey = false;
|
|
42
|
+
this.disableSortingBtn = false;
|
|
43
|
+
this.verticalDividers = false;
|
|
44
|
+
this.compactDesign = false;
|
|
45
|
+
this.noMinWidth = false;
|
|
46
|
+
this.whiteBackground = false;
|
|
47
|
+
this.enableMultiselect = false;
|
|
48
|
+
this.enableToolbarDesign = false;
|
|
49
|
+
this.tableId = '';
|
|
50
|
+
this.enableExpandableRows = false;
|
|
51
|
+
}
|
|
52
|
+
tablePropsChangedEventListener(event) {
|
|
53
|
+
if (this.tableId === event.detail.tableId) {
|
|
54
|
+
event.detail.changed
|
|
55
|
+
.filter((changedProp) => relevantTableProps.includes(changedProp))
|
|
56
|
+
.forEach((changedProp) => {
|
|
57
|
+
if (typeof this[changedProp] === 'undefined') {
|
|
58
|
+
throw new Error(`Table prop is not supported: ${changedProp}`);
|
|
59
|
+
}
|
|
60
|
+
this[changedProp] = event.detail[changedProp];
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// Listen to parent data-table if sorting is allowed
|
|
65
|
+
sortingSwitcherEventListener(event) {
|
|
66
|
+
const [receivedID, receivedSortingStatus] = event.detail;
|
|
67
|
+
if (this.tableId === receivedID) {
|
|
68
|
+
this.disableSortingBtn = receivedSortingStatus;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// target is set to body so other instances of same component "listen" and react to the change
|
|
72
|
+
updateOptionsContent(event) {
|
|
73
|
+
if (this.tableId === event.detail[0]) {
|
|
74
|
+
// grab only value at position 1 as it is the "key"
|
|
75
|
+
if (this.columnKey !== event.detail[1]) {
|
|
76
|
+
this.sortedByMyKey = false;
|
|
77
|
+
// To sync with CSS transition timing
|
|
78
|
+
setTimeout(() => {
|
|
79
|
+
this.sortingDirection = '';
|
|
80
|
+
}, 200);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
enableMultiselectEventListener(event) {
|
|
85
|
+
if (this.tableId === event.detail[0])
|
|
86
|
+
[, this.enableMultiselect] = event.detail;
|
|
87
|
+
}
|
|
88
|
+
connectedCallback() {
|
|
89
|
+
this.tableEl = this.host.closest('sdds-table');
|
|
90
|
+
this.tableId = this.tableEl.tableId;
|
|
91
|
+
}
|
|
92
|
+
componentWillLoad() {
|
|
93
|
+
relevantTableProps.forEach((tablePropName) => {
|
|
94
|
+
this[tablePropName] = this.tableEl[tablePropName];
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
componentWillRender() {
|
|
98
|
+
// enable only right or left text align
|
|
99
|
+
if (this.textAlign === 'right' || this.textAlign === 'end') {
|
|
100
|
+
this.textAlignState = 'right';
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
this.textAlignState = 'left';
|
|
104
|
+
}
|
|
105
|
+
// To enable body cells text align per rules set in head cell
|
|
106
|
+
this.textAlignEvent.emit([this.tableId, this.columnKey, this.textAlignState]);
|
|
107
|
+
this.enableToolbarDesign =
|
|
108
|
+
this.host.closest('sdds-table').getElementsByTagName('sdds-table-toolbar').length >= 1;
|
|
109
|
+
}
|
|
110
|
+
render() {
|
|
111
|
+
return (h(Host, { class: {
|
|
112
|
+
'sdds-table__header-cell': true,
|
|
113
|
+
'sdds-table__header-cell--sortable': this.sortable,
|
|
114
|
+
'sdds-table__header-cell--is-sorted': this.sortedByMyKey,
|
|
115
|
+
'sdds-table__header-cell--custom-width': this.customWidth !== '',
|
|
116
|
+
'sdds-table__header-cell--right-align': this.textAlignState === 'right',
|
|
117
|
+
'sdds-table--compact': this.compactDesign,
|
|
118
|
+
'sdds-table--divider': this.verticalDividers,
|
|
119
|
+
'sdds-table--no-min-width': this.noMinWidth,
|
|
120
|
+
'sdds-table--extra-column': this.enableMultiselect || this.enableExpandableRows,
|
|
121
|
+
'sdds-table--toolbar-available': this.enableToolbarDesign,
|
|
122
|
+
}, style: { width: this.customWidth },
|
|
123
|
+
// Calling actions from here to enable hover functionality for both sortable and un-sortable tables
|
|
124
|
+
onMouseOver: () => this.onHeadCellHover(this.columnKey), onMouseLeave: () => this.onHeadCellHover('') }, this.headerCellContent()));
|
|
125
|
+
}
|
|
126
|
+
static get is() { return "sdds-header-cell"; }
|
|
127
|
+
static get encapsulation() { return "shadow"; }
|
|
128
|
+
static get originalStyleUrls() {
|
|
129
|
+
return {
|
|
130
|
+
"$": ["table-header-cell.scss"]
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
static get styleUrls() {
|
|
134
|
+
return {
|
|
135
|
+
"$": ["table-header-cell.css"]
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
static get properties() {
|
|
139
|
+
return {
|
|
140
|
+
"columnKey": {
|
|
141
|
+
"type": "string",
|
|
142
|
+
"mutable": false,
|
|
143
|
+
"complexType": {
|
|
144
|
+
"original": "string",
|
|
145
|
+
"resolved": "string",
|
|
146
|
+
"references": {}
|
|
147
|
+
},
|
|
148
|
+
"required": false,
|
|
149
|
+
"optional": false,
|
|
150
|
+
"docs": {
|
|
151
|
+
"tags": [],
|
|
152
|
+
"text": "Value of column key, usually comes from JSON, needed for sorting"
|
|
153
|
+
},
|
|
154
|
+
"attribute": "column-key",
|
|
155
|
+
"reflect": true
|
|
156
|
+
},
|
|
157
|
+
"columnTitle": {
|
|
158
|
+
"type": "string",
|
|
159
|
+
"mutable": false,
|
|
160
|
+
"complexType": {
|
|
161
|
+
"original": "string",
|
|
162
|
+
"resolved": "string",
|
|
163
|
+
"references": {}
|
|
164
|
+
},
|
|
165
|
+
"required": false,
|
|
166
|
+
"optional": false,
|
|
167
|
+
"docs": {
|
|
168
|
+
"tags": [],
|
|
169
|
+
"text": "Text that displays in column cell"
|
|
170
|
+
},
|
|
171
|
+
"attribute": "column-title",
|
|
172
|
+
"reflect": true
|
|
173
|
+
},
|
|
174
|
+
"customWidth": {
|
|
175
|
+
"type": "string",
|
|
176
|
+
"mutable": false,
|
|
177
|
+
"complexType": {
|
|
178
|
+
"original": "string",
|
|
179
|
+
"resolved": "string",
|
|
180
|
+
"references": {}
|
|
181
|
+
},
|
|
182
|
+
"required": false,
|
|
183
|
+
"optional": false,
|
|
184
|
+
"docs": {
|
|
185
|
+
"tags": [],
|
|
186
|
+
"text": "In case noMinWidth setting, user has to specify width value for each column, for example \"150px\""
|
|
187
|
+
},
|
|
188
|
+
"attribute": "custom-width",
|
|
189
|
+
"reflect": true
|
|
190
|
+
},
|
|
191
|
+
"sortable": {
|
|
192
|
+
"type": "boolean",
|
|
193
|
+
"mutable": false,
|
|
194
|
+
"complexType": {
|
|
195
|
+
"original": "boolean",
|
|
196
|
+
"resolved": "boolean",
|
|
197
|
+
"references": {}
|
|
198
|
+
},
|
|
199
|
+
"required": false,
|
|
200
|
+
"optional": false,
|
|
201
|
+
"docs": {
|
|
202
|
+
"tags": [],
|
|
203
|
+
"text": "If passed as prop, enables sorting on that column"
|
|
204
|
+
},
|
|
205
|
+
"attribute": "sortable",
|
|
206
|
+
"reflect": false,
|
|
207
|
+
"defaultValue": "false"
|
|
208
|
+
},
|
|
209
|
+
"textAlign": {
|
|
210
|
+
"type": "string",
|
|
211
|
+
"mutable": false,
|
|
212
|
+
"complexType": {
|
|
213
|
+
"original": "string",
|
|
214
|
+
"resolved": "string",
|
|
215
|
+
"references": {}
|
|
216
|
+
},
|
|
217
|
+
"required": false,
|
|
218
|
+
"optional": false,
|
|
219
|
+
"docs": {
|
|
220
|
+
"tags": [],
|
|
221
|
+
"text": "Setting for text align, default is left, but user can pass \"right\" as string - useful for numeric values"
|
|
222
|
+
},
|
|
223
|
+
"attribute": "text-align",
|
|
224
|
+
"reflect": true
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
static get states() {
|
|
229
|
+
return {
|
|
230
|
+
"textAlignState": {},
|
|
231
|
+
"sortingDirection": {},
|
|
232
|
+
"sortedByMyKey": {},
|
|
233
|
+
"disableSortingBtn": {},
|
|
234
|
+
"verticalDividers": {},
|
|
235
|
+
"compactDesign": {},
|
|
236
|
+
"noMinWidth": {},
|
|
237
|
+
"whiteBackground": {},
|
|
238
|
+
"enableMultiselect": {},
|
|
239
|
+
"enableToolbarDesign": {},
|
|
240
|
+
"tableId": {},
|
|
241
|
+
"enableExpandableRows": {}
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
static get events() {
|
|
245
|
+
return [{
|
|
246
|
+
"method": "sortColumnDataEvent",
|
|
247
|
+
"name": "sortColumnDataEvent",
|
|
248
|
+
"bubbles": true,
|
|
249
|
+
"cancelable": true,
|
|
250
|
+
"composed": true,
|
|
251
|
+
"docs": {
|
|
252
|
+
"tags": [],
|
|
253
|
+
"text": "Sends unique table identifier,column key and sorting direction to the sdds-table-body component"
|
|
254
|
+
},
|
|
255
|
+
"complexType": {
|
|
256
|
+
"original": "any",
|
|
257
|
+
"resolved": "any",
|
|
258
|
+
"references": {}
|
|
259
|
+
}
|
|
260
|
+
}, {
|
|
261
|
+
"method": "textAlignEvent",
|
|
262
|
+
"name": "textAlignEvent",
|
|
263
|
+
"bubbles": true,
|
|
264
|
+
"cancelable": true,
|
|
265
|
+
"composed": true,
|
|
266
|
+
"docs": {
|
|
267
|
+
"tags": [],
|
|
268
|
+
"text": "Sends unique table identifier, column key and text align value so the body cells with same key take the same text alignment as header cell"
|
|
269
|
+
},
|
|
270
|
+
"complexType": {
|
|
271
|
+
"original": "any",
|
|
272
|
+
"resolved": "any",
|
|
273
|
+
"references": {}
|
|
274
|
+
}
|
|
275
|
+
}, {
|
|
276
|
+
"method": "headCellHoverEvent",
|
|
277
|
+
"name": "headCellHoverEvent",
|
|
278
|
+
"bubbles": true,
|
|
279
|
+
"cancelable": true,
|
|
280
|
+
"composed": true,
|
|
281
|
+
"docs": {
|
|
282
|
+
"tags": [],
|
|
283
|
+
"text": "Sends unique table identifier, column key so the body cells with the same key change background when user hovers over header cell"
|
|
284
|
+
},
|
|
285
|
+
"complexType": {
|
|
286
|
+
"original": "any",
|
|
287
|
+
"resolved": "any",
|
|
288
|
+
"references": {}
|
|
289
|
+
}
|
|
290
|
+
}];
|
|
291
|
+
}
|
|
292
|
+
static get elementRef() { return "host"; }
|
|
293
|
+
static get listeners() {
|
|
294
|
+
return [{
|
|
295
|
+
"name": "tablePropsChangedEvent",
|
|
296
|
+
"method": "tablePropsChangedEventListener",
|
|
297
|
+
"target": "body",
|
|
298
|
+
"capture": false,
|
|
299
|
+
"passive": false
|
|
300
|
+
}, {
|
|
301
|
+
"name": "sortingSwitcherEvent",
|
|
302
|
+
"method": "sortingSwitcherEventListener",
|
|
303
|
+
"target": "body",
|
|
304
|
+
"capture": false,
|
|
305
|
+
"passive": false
|
|
306
|
+
}, {
|
|
307
|
+
"name": "sortColumnDataEvent",
|
|
308
|
+
"method": "updateOptionsContent",
|
|
309
|
+
"target": "body",
|
|
310
|
+
"capture": false,
|
|
311
|
+
"passive": false
|
|
312
|
+
}, {
|
|
313
|
+
"name": "enableMultiselectEvent",
|
|
314
|
+
"method": "enableMultiselectEventListener",
|
|
315
|
+
"target": "body",
|
|
316
|
+
"capture": false,
|
|
317
|
+
"passive": false
|
|
318
|
+
}];
|
|
319
|
+
}
|
|
320
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
display: table-caption;
|
|
4
|
+
position: relative;
|
|
5
|
+
background-color: var(--sdds-grey-400);
|
|
6
|
+
color: var(--sdds-grey-958);
|
|
7
|
+
padding: 0 var(--sdds-spacing-element-16);
|
|
8
|
+
height: 64px;
|
|
9
|
+
border-top-left-radius: 4px;
|
|
10
|
+
border-top-right-radius: 4px;
|
|
11
|
+
}
|
|
12
|
+
:host * {
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
}
|
|
15
|
+
:host .sdds-table__upper-bar-flex {
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
}
|
|
21
|
+
:host .sdds-table__title {
|
|
22
|
+
font: var(--sdds-headline-07);
|
|
23
|
+
letter-spacing: var(--sdds-headline-07-ls);
|
|
24
|
+
padding-top: var(--sdds-spacing-element-16);
|
|
25
|
+
text-align: left;
|
|
26
|
+
}
|
|
27
|
+
:host .sdds-table__actionbar {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-self: center;
|
|
30
|
+
gap: 8px;
|
|
31
|
+
}
|
|
32
|
+
:host .sdds-table__searchbar {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-self: center;
|
|
35
|
+
position: relative;
|
|
36
|
+
height: 40px;
|
|
37
|
+
width: 40px;
|
|
38
|
+
border-radius: 4px 4px 0 0;
|
|
39
|
+
transition: background-color 250ms ease, width 250ms ease;
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
background-color: transparent;
|
|
42
|
+
}
|
|
43
|
+
:host .sdds-table__searchbar::after {
|
|
44
|
+
content: "";
|
|
45
|
+
width: 100%;
|
|
46
|
+
height: 2px;
|
|
47
|
+
position: absolute;
|
|
48
|
+
bottom: 0;
|
|
49
|
+
background-color: var(--sdds-blue-400);
|
|
50
|
+
transform: scaleX(0);
|
|
51
|
+
transition: transform 150ms ease;
|
|
52
|
+
}
|
|
53
|
+
:host .sdds-table__searchbar:focus-within::after {
|
|
54
|
+
transform: scaleX(100%);
|
|
55
|
+
}
|
|
56
|
+
:host .sdds-table__searchbar:focus-within, :host .sdds-table__searchbar.sdds-table__searchbar--active {
|
|
57
|
+
width: 208px;
|
|
58
|
+
background-color: var(--sdds-grey-50);
|
|
59
|
+
}
|
|
60
|
+
:host .sdds-table__searchbar:focus-within:hover, :host .sdds-table__searchbar.sdds-table__searchbar--active:hover {
|
|
61
|
+
background-color: var(--sdds-grey-50);
|
|
62
|
+
}
|
|
63
|
+
:host .sdds-table__searchbar .sdds-table__searchbar-input {
|
|
64
|
+
font: var(--sdds-detail-02);
|
|
65
|
+
letter-spacing: var(--sdds-detail-02-ls);
|
|
66
|
+
z-index: 1;
|
|
67
|
+
width: 100%;
|
|
68
|
+
height: 100%;
|
|
69
|
+
border: none;
|
|
70
|
+
padding: 0 36px 0 16px;
|
|
71
|
+
background-color: transparent;
|
|
72
|
+
outline: none;
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
}
|
|
75
|
+
:host .sdds-table__searchbar .sdds-table__searchbar-input :focus {
|
|
76
|
+
background-color: var(--sdds-grey-50);
|
|
77
|
+
}
|
|
78
|
+
:host .sdds-table__searchbar:hover {
|
|
79
|
+
background-color: var(--sdds-grey-300);
|
|
80
|
+
}
|
|
81
|
+
:host .sdds-table__searchbar .sdds-table__searchbar-icon {
|
|
82
|
+
z-index: 0;
|
|
83
|
+
position: absolute;
|
|
84
|
+
right: 9px;
|
|
85
|
+
top: 9px;
|
|
86
|
+
width: 20px;
|
|
87
|
+
height: 20px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:host(.sdds-table--compact) {
|
|
91
|
+
height: 56px;
|
|
92
|
+
}
|