@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.
Files changed (246) hide show
  1. package/dist/cjs/index-e1c79686.js +1912 -0
  2. package/dist/cjs/index.cjs.js +2 -0
  3. package/dist/cjs/loader.cjs.js +21 -0
  4. package/dist/cjs/popper-11d5f714.js +1801 -0
  5. package/dist/cjs/sdds-accordion-item.cjs.entry.js +34 -0
  6. package/dist/cjs/sdds-accordion.cjs.entry.js +21 -0
  7. package/dist/cjs/sdds-badges.cjs.entry.js +55 -0
  8. package/dist/cjs/sdds-body-cell_2.cjs.entry.js +173 -0
  9. package/dist/cjs/sdds-button.cjs.entry.js +36 -0
  10. package/dist/cjs/sdds-datetime.cjs.entry.js +66 -0
  11. package/dist/cjs/sdds-dropdown-filter.cjs.entry.js +92 -0
  12. package/dist/cjs/sdds-dropdown_2.cjs.entry.js +335 -0
  13. package/dist/cjs/sdds-header-cell.cjs.entry.js +141 -0
  14. package/dist/cjs/sdds-icon.cjs.entry.js +42 -0
  15. package/dist/cjs/sdds-inline-tabs-fullbleed.cjs.entry.js +96 -0
  16. package/dist/cjs/sdds-inline-tabs.cjs.entry.js +211 -0
  17. package/dist/cjs/sdds-modal.cjs.entry.js +49 -0
  18. package/dist/cjs/sdds-navigation-tabs.cjs.entry.js +95 -0
  19. package/dist/cjs/sdds-popover-canvas.cjs.entry.js +76 -0
  20. package/dist/cjs/sdds-popover-menu.cjs.entry.js +75 -0
  21. package/dist/cjs/sdds-slider.cjs.entry.js +336 -0
  22. package/dist/cjs/sdds-spinner.cjs.entry.js +21 -0
  23. package/dist/cjs/sdds-table-body-row-expandable.cjs.entry.js +81 -0
  24. package/dist/cjs/sdds-table-body.cjs.entry.js +289 -0
  25. package/dist/cjs/sdds-table-footer.cjs.entry.js +165 -0
  26. package/dist/cjs/sdds-table-header.cjs.entry.js +100 -0
  27. package/dist/cjs/sdds-table-toolbar.cjs.entry.js +66 -0
  28. package/dist/cjs/sdds-table.cjs.entry.js +69 -0
  29. package/dist/cjs/sdds-textarea.cjs.entry.js +61 -0
  30. package/dist/cjs/sdds-textfield.cjs.entry.js +82 -0
  31. package/dist/cjs/sdds-tooltip.cjs.entry.js +95 -0
  32. package/dist/cjs/tegel.cjs.js +19 -0
  33. package/dist/collection/collection-manifest.json +40 -0
  34. package/dist/collection/components/accordion/accordion-item/accordion-item.css +134 -0
  35. package/dist/collection/components/accordion/accordion-item/accordion-item.js +146 -0
  36. package/dist/collection/components/accordion/accordion.css +77 -0
  37. package/dist/collection/components/accordion/accordion.js +62 -0
  38. package/dist/collection/components/accordion/accordion.stories.js +91 -0
  39. package/dist/collection/components/badge/badge.stories.js +101 -0
  40. package/dist/collection/components/badge/badges.css +42 -0
  41. package/dist/collection/components/badge/badges.js +150 -0
  42. package/dist/collection/components/banner/banner.stories.js +93 -0
  43. package/dist/collection/components/block/block.stories.js +46 -0
  44. package/dist/collection/components/breadcrumb/breadcrumb.stories.js +26 -0
  45. package/dist/collection/components/button/button-component.js +154 -0
  46. package/dist/collection/components/button/button-native.stories.js +183 -0
  47. package/dist/collection/components/button/button-webcomponent.stories.js +182 -0
  48. package/dist/collection/components/button/button.css +658 -0
  49. package/dist/collection/components/card/card.stories.js +181 -0
  50. package/dist/collection/components/checkbox/checkbox.stories.js +54 -0
  51. package/dist/collection/components/chips/chips.stories.js +124 -0
  52. package/dist/collection/components/data-table/native-table.stories.js +182 -0
  53. package/dist/collection/components/data-table/table/table.css +15 -0
  54. package/dist/collection/components/data-table/table/table.js +253 -0
  55. package/dist/collection/components/data-table/table-body/table-body.css +22 -0
  56. package/dist/collection/components/data-table/table-body/table-body.js +425 -0
  57. package/dist/collection/components/data-table/table-body-cell/table-body-cell.css +40 -0
  58. package/dist/collection/components/data-table/table-body-cell/table-body-cell.js +169 -0
  59. package/dist/collection/components/data-table/table-body-row/table-body-row.css +196 -0
  60. package/dist/collection/components/data-table/table-body-row/table-body-row.js +164 -0
  61. package/dist/collection/components/data-table/table-body-row-expandable/table-body-row-expandable.css +79 -0
  62. package/dist/collection/components/data-table/table-body-row-expandable/table-body-row-expandable.js +155 -0
  63. package/dist/collection/components/data-table/table-component-basic.stories.js +163 -0
  64. package/dist/collection/components/data-table/table-component-batch-actions.stories.js +129 -0
  65. package/dist/collection/components/data-table/table-component-bodydata.stories.js +58 -0
  66. package/dist/collection/components/data-table/table-component-custom-width.stories.js +198 -0
  67. package/dist/collection/components/data-table/table-component-event-listeners.stories.js +153 -0
  68. package/dist/collection/components/data-table/table-component-expandable-rows.stories.js +137 -0
  69. package/dist/collection/components/data-table/table-component-filtering.stories.js +139 -0
  70. package/dist/collection/components/data-table/table-component-multiselect.stories.js +160 -0
  71. package/dist/collection/components/data-table/table-component-pagination.stories.js +129 -0
  72. package/dist/collection/components/data-table/table-component-sorting.stories.js +107 -0
  73. package/dist/collection/components/data-table/table-footer/table-footer.css +93 -0
  74. package/dist/collection/components/data-table/table-footer/table-footer.js +355 -0
  75. package/dist/collection/components/data-table/table-header/table-header.css +204 -0
  76. package/dist/collection/components/data-table/table-header/table-header.js +153 -0
  77. package/dist/collection/components/data-table/table-header-cell/table-header-cell.css +126 -0
  78. package/dist/collection/components/data-table/table-header-cell/table-header-cell.js +320 -0
  79. package/dist/collection/components/data-table/table-toolbar/table-toolbar.css +92 -0
  80. package/dist/collection/components/data-table/table-toolbar/table-toolbar.js +142 -0
  81. package/dist/collection/components/datetime/datetime.css +375 -0
  82. package/dist/collection/components/datetime/datetime.js +251 -0
  83. package/dist/collection/components/datetime/datetime.stories.js +149 -0
  84. package/dist/collection/components/divider/divider.stories.js +116 -0
  85. package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.js +339 -0
  86. package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.stories.js +130 -0
  87. package/dist/collection/components/dropdown/dropdown-native.stories.js +90 -0
  88. package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +185 -0
  89. package/dist/collection/components/dropdown/dropdown-wc-default.stories.js +151 -0
  90. package/dist/collection/components/dropdown/dropdown-wc-multiselect.stories.js +146 -0
  91. package/dist/collection/components/dropdown/dropdown.css +891 -0
  92. package/dist/collection/components/dropdown/dropdown.js +554 -0
  93. package/dist/collection/components/footer/footer.stories.js +100 -0
  94. package/dist/collection/components/header/header-all.stories.js +217 -0
  95. package/dist/collection/components/header/header-default.stories.js +47 -0
  96. package/dist/collection/components/header/header-inline.stories.js +113 -0
  97. package/dist/collection/components/header/header-search.stories.js +263 -0
  98. package/dist/collection/components/header/header-toolbar.stories.js +204 -0
  99. package/dist/collection/components/icon/icon-font.stories.js +57 -0
  100. package/dist/collection/components/icon/icon-web-component.stories.js +51 -0
  101. package/dist/collection/components/icon/icon.css +16 -0
  102. package/dist/collection/components/icon/icon.js +89 -0
  103. package/dist/collection/components/icon/iconsArray.js +2 -0
  104. package/dist/collection/components/link/link.stories.js +45 -0
  105. package/dist/collection/components/message/message.stories.js +117 -0
  106. package/dist/collection/components/modal/modal-native.stories.js +121 -0
  107. package/dist/collection/components/modal/modal-webcomponent.stories.js +78 -0
  108. package/dist/collection/components/modal/modal.css +324 -0
  109. package/dist/collection/components/modal/modal.js +146 -0
  110. package/dist/collection/components/popover-canvas/popover-canvas.css +20 -0
  111. package/dist/collection/components/popover-canvas/popover-canvas.js +190 -0
  112. package/dist/collection/components/popover-canvas/popover-canvas.stories.js +87 -0
  113. package/dist/collection/components/popover-menu/popover-menu-icons.stories.js +132 -0
  114. package/dist/collection/components/popover-menu/popover-menu.css +19 -0
  115. package/dist/collection/components/popover-menu/popover-menu.js +189 -0
  116. package/dist/collection/components/popover-menu/popover-menu.stories.js +109 -0
  117. package/dist/collection/components/radio-button/radio-button.stories.js +68 -0
  118. package/dist/collection/components/side-menu/side-menu.stories.js +182 -0
  119. package/dist/collection/components/slider/slider.css +260 -0
  120. package/dist/collection/components/slider/slider.js +682 -0
  121. package/dist/collection/components/slider/slider.stories.js +251 -0
  122. package/dist/collection/components/spinner/spinner.css +79 -0
  123. package/dist/collection/components/spinner/spinner.js +61 -0
  124. package/dist/collection/components/spinner/spinner.stories.js +59 -0
  125. package/dist/collection/components/stepper/stepper.stories.js +139 -0
  126. package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.css +159 -0
  127. package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.js +302 -0
  128. package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.stories.js +65 -0
  129. package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.css +172 -0
  130. package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.js +126 -0
  131. package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.stories.js +43 -0
  132. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.css +153 -0
  133. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +103 -0
  134. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.stories.js +32 -0
  135. package/dist/collection/components/textarea/textarea.css +283 -0
  136. package/dist/collection/components/textarea/textarea.js +336 -0
  137. package/dist/collection/components/textarea/textarea.stories.js +149 -0
  138. package/dist/collection/components/textfield/textfield.css +494 -0
  139. package/dist/collection/components/textfield/textfield.js +359 -0
  140. package/dist/collection/components/textfield/textfield.stories.js +222 -0
  141. package/dist/collection/components/toast/toast.stories.js +119 -0
  142. package/dist/collection/components/toggle/toggle.stories.js +62 -0
  143. package/dist/collection/components/tooltip/tooltip.css +46 -0
  144. package/dist/collection/components/tooltip/tooltip.js +200 -0
  145. package/dist/collection/components/tooltip/tooltip.stories.js +113 -0
  146. package/dist/collection/components/utility/colour/background-color.stories.js +96 -0
  147. package/dist/collection/components/utility/colour/text-color.stories.js +94 -0
  148. package/dist/collection/foundations-stories/colour/colour-brand.stories.js +38 -0
  149. package/dist/collection/foundations-stories/colour/colour-scales.stories.js +71 -0
  150. package/dist/collection/foundations-stories/colour/colour-semantic.stories.js +40 -0
  151. package/dist/collection/foundations-stories/grid/grid.stories.js +386 -0
  152. package/dist/collection/foundations-stories/spacing/spacing-element.stories.js +100 -0
  153. package/dist/collection/foundations-stories/spacing/spacing-layout.stories.js +94 -0
  154. package/dist/collection/foundations-stories/typography/typography-body.stories.js +16 -0
  155. package/dist/collection/foundations-stories/typography/typography-detail.stories.js +17 -0
  156. package/dist/collection/foundations-stories/typography/typography-headline.stories.js +39 -0
  157. package/dist/collection/foundations-stories/typography/typography-paragraph.stories.js +12 -0
  158. package/dist/collection/index.js +1 -0
  159. package/dist/collection/stories/assets/code-brackets.svg +1 -0
  160. package/dist/collection/stories/assets/colors.svg +1 -0
  161. package/dist/collection/stories/assets/comments.svg +1 -0
  162. package/dist/collection/stories/assets/direction.svg +1 -0
  163. package/dist/collection/stories/assets/flow.svg +1 -0
  164. package/dist/collection/stories/assets/plugin.svg +1 -0
  165. package/dist/collection/stories/assets/repo.svg +1 -0
  166. package/dist/collection/stories/assets/stackalt.svg +1 -0
  167. package/dist/collection/utils/utils.js +12 -0
  168. package/dist/esm/index-b67b15a6.js +1884 -0
  169. package/dist/esm/index.js +1 -0
  170. package/dist/esm/loader.js +17 -0
  171. package/dist/esm/polyfills/core-js.js +11 -0
  172. package/dist/esm/polyfills/css-shim.js +1 -0
  173. package/dist/esm/polyfills/dom.js +79 -0
  174. package/dist/esm/polyfills/es5-html-element.js +1 -0
  175. package/dist/esm/polyfills/index.js +34 -0
  176. package/dist/esm/polyfills/system.js +6 -0
  177. package/dist/esm/popper-f860750c.js +1799 -0
  178. package/dist/esm/sdds-accordion-item.entry.js +30 -0
  179. package/dist/esm/sdds-accordion.entry.js +17 -0
  180. package/dist/esm/sdds-badges.entry.js +51 -0
  181. package/dist/esm/sdds-body-cell_2.entry.js +168 -0
  182. package/dist/esm/sdds-button.entry.js +32 -0
  183. package/dist/esm/sdds-datetime.entry.js +62 -0
  184. package/dist/esm/sdds-dropdown-filter.entry.js +88 -0
  185. package/dist/esm/sdds-dropdown_2.entry.js +330 -0
  186. package/dist/esm/sdds-header-cell.entry.js +137 -0
  187. package/dist/esm/sdds-icon.entry.js +38 -0
  188. package/dist/esm/sdds-inline-tabs-fullbleed.entry.js +92 -0
  189. package/dist/esm/sdds-inline-tabs.entry.js +207 -0
  190. package/dist/esm/sdds-modal.entry.js +45 -0
  191. package/dist/esm/sdds-navigation-tabs.entry.js +91 -0
  192. package/dist/esm/sdds-popover-canvas.entry.js +72 -0
  193. package/dist/esm/sdds-popover-menu.entry.js +71 -0
  194. package/dist/esm/sdds-slider.entry.js +332 -0
  195. package/dist/esm/sdds-spinner.entry.js +17 -0
  196. package/dist/esm/sdds-table-body-row-expandable.entry.js +77 -0
  197. package/dist/esm/sdds-table-body.entry.js +285 -0
  198. package/dist/esm/sdds-table-footer.entry.js +161 -0
  199. package/dist/esm/sdds-table-header.entry.js +96 -0
  200. package/dist/esm/sdds-table-toolbar.entry.js +62 -0
  201. package/dist/esm/sdds-table.entry.js +65 -0
  202. package/dist/esm/sdds-textarea.entry.js +57 -0
  203. package/dist/esm/sdds-textfield.entry.js +78 -0
  204. package/dist/esm/sdds-tooltip.entry.js +91 -0
  205. package/dist/esm/tegel.js +17 -0
  206. package/dist/index.cjs.js +1 -0
  207. package/dist/index.js +1 -0
  208. package/dist/tegel/index.esm.js +0 -0
  209. package/dist/tegel/p-040efb32.entry.js +1 -0
  210. package/dist/tegel/p-12ca5cfa.entry.js +1 -0
  211. package/dist/tegel/p-157e1618.js +2 -0
  212. package/dist/tegel/p-1fe61cf6.entry.js +1 -0
  213. package/dist/tegel/p-2f376504.entry.js +1 -0
  214. package/dist/tegel/p-44ced895.entry.js +1 -0
  215. package/dist/tegel/p-4880f03d.entry.js +1 -0
  216. package/dist/tegel/p-4aba73a3.entry.js +1 -0
  217. package/dist/tegel/p-4b58a02c.entry.js +1 -0
  218. package/dist/tegel/p-4cb85347.entry.js +1 -0
  219. package/dist/tegel/p-52031b5a.entry.js +1 -0
  220. package/dist/tegel/p-677baf7f.entry.js +1 -0
  221. package/dist/tegel/p-71797eaf.entry.js +1 -0
  222. package/dist/tegel/p-7373284c.entry.js +1 -0
  223. package/dist/tegel/p-7451779b.entry.js +1 -0
  224. package/dist/tegel/p-77aeea3b.entry.js +1 -0
  225. package/dist/tegel/p-8582d6a7.entry.js +1 -0
  226. package/dist/tegel/p-96021bd0.entry.js +1 -0
  227. package/dist/tegel/p-9d8caf51.entry.js +1 -0
  228. package/dist/tegel/p-a5919930.entry.js +1 -0
  229. package/dist/tegel/p-b01cface.entry.js +1 -0
  230. package/dist/tegel/p-bf896643.entry.js +1 -0
  231. package/dist/tegel/p-c311725c.entry.js +1 -0
  232. package/dist/tegel/p-cf72dfd9.entry.js +1 -0
  233. package/dist/tegel/p-d91caec6.entry.js +1 -0
  234. package/dist/tegel/p-e10eec33.entry.js +1 -0
  235. package/dist/tegel/p-ec26fc38.js +1 -0
  236. package/dist/tegel/p-f2262a69.entry.js +1 -0
  237. package/dist/tegel/p-f2f7aa45.entry.js +1 -0
  238. package/dist/tegel/tegel.css +101 -0
  239. package/dist/tegel/tegel.esm.js +1 -0
  240. package/loader/cdn.js +3 -0
  241. package/loader/index.cjs.js +3 -0
  242. package/loader/index.d.ts +12 -0
  243. package/loader/index.es2017.js +3 -0
  244. package/loader/index.js +4 -0
  245. package/loader/package.json +11 -0
  246. package/package.json +1 -1
@@ -0,0 +1,40 @@
1
+ :host(.sdds-table__body-cell) {
2
+ box-sizing: border-box;
3
+ font: var(--sdds-detail-02);
4
+ letter-spacing: var(--sdds-detail-02-ls);
5
+ display: table-cell;
6
+ box-sizing: border-box;
7
+ color: var(--sdds-grey-958);
8
+ padding: var(--sdds-spacing-element-16);
9
+ min-width: 192px;
10
+ vertical-align: top;
11
+ background-color: transparent;
12
+ transition: background-color 200ms ease;
13
+ }
14
+ :host(.sdds-table__body-cell) * {
15
+ box-sizing: border-box;
16
+ }
17
+
18
+ :host(.sdds-table__body-cell--no-padding) {
19
+ padding: 0;
20
+ }
21
+
22
+ :host(.sdds-table__body-cell--hover) {
23
+ background-color: var(--sdds-grey-200);
24
+ }
25
+
26
+ :host(.sdds-table__compact) {
27
+ padding: var(--sdds-spacing-element-8) var(--sdds-spacing-element-16);
28
+ }
29
+
30
+ :host(.sdds-table--divider) {
31
+ border-right: 1px solid var(--sdds-grey-400);
32
+ }
33
+
34
+ :host(.sdds-table--divider:last-of-type) {
35
+ border-right: none;
36
+ }
37
+
38
+ :host(.sdds-table--no-min-width) {
39
+ min-width: unset;
40
+ }
@@ -0,0 +1,169 @@
1
+ import { h, Host } from '@stencil/core';
2
+ const relevantTableProps = [
3
+ 'verticalDividers',
4
+ 'compactDesign',
5
+ 'noMinWidth',
6
+ 'whiteBackground',
7
+ ];
8
+ export class TableBodyCell {
9
+ constructor() {
10
+ this.cellValue = undefined;
11
+ this.cellKey = undefined;
12
+ this.disablePadding = false;
13
+ this.textAlignState = undefined;
14
+ this.activeSorting = false;
15
+ this.verticalDividers = false;
16
+ this.compactDesign = false;
17
+ this.noMinWidth = false;
18
+ this.whiteBackground = false;
19
+ this.tableId = '';
20
+ }
21
+ tablePropsChangedEventListener(event) {
22
+ if (this.tableId === event.detail.tableId) {
23
+ event.detail.changed
24
+ .filter((changedProp) => relevantTableProps.includes(changedProp))
25
+ .forEach((changedProp) => {
26
+ if (typeof this[changedProp] === 'undefined') {
27
+ throw new Error(`Table prop is not supported: ${changedProp}`);
28
+ }
29
+ this[changedProp] = event.detail[changedProp];
30
+ });
31
+ }
32
+ }
33
+ // Listen to headKey from data-table-header-element
34
+ headCellHoverEventListener(event) {
35
+ const [receivedID, receivedKeyValue] = event.detail;
36
+ if (this.tableId === receivedID) {
37
+ this.activeSorting = this.cellKey === receivedKeyValue;
38
+ }
39
+ }
40
+ // Listen to textAlignEvent from data-table-header-element
41
+ textAlignEventListener(event) {
42
+ const [receivedID, receivedKey, receivedTextAlign] = event.detail;
43
+ if (this.tableId === receivedID) {
44
+ if (this.cellKey === receivedKey) {
45
+ this.textAlignState = receivedTextAlign;
46
+ }
47
+ }
48
+ }
49
+ connectedCallback() {
50
+ this.tableEl = this.host.closest('sdds-table');
51
+ this.tableId = this.tableEl.tableId;
52
+ }
53
+ componentWillLoad() {
54
+ relevantTableProps.forEach((tablePropName) => {
55
+ this[tablePropName] = this.tableEl[tablePropName];
56
+ });
57
+ }
58
+ render() {
59
+ return (h(Host, { class: {
60
+ 'sdds-table__body-cell': true,
61
+ 'sdds-table__body-cell--hover': this.activeSorting,
62
+ 'sdds-table__compact': this.compactDesign,
63
+ 'sdds-table--divider': this.verticalDividers,
64
+ 'sdds-table--no-min-width': this.noMinWidth,
65
+ 'sdds-table__body-cell--no-padding': this.disablePadding,
66
+ }, style: { textAlign: this.textAlignState } }, this.cellValue, h("slot", null)));
67
+ }
68
+ static get is() { return "sdds-body-cell"; }
69
+ static get encapsulation() { return "shadow"; }
70
+ static get originalStyleUrls() {
71
+ return {
72
+ "$": ["table-body-cell.scss"]
73
+ };
74
+ }
75
+ static get styleUrls() {
76
+ return {
77
+ "$": ["table-body-cell.css"]
78
+ };
79
+ }
80
+ static get properties() {
81
+ return {
82
+ "cellValue": {
83
+ "type": "any",
84
+ "mutable": false,
85
+ "complexType": {
86
+ "original": "string | number",
87
+ "resolved": "number | string",
88
+ "references": {}
89
+ },
90
+ "required": false,
91
+ "optional": false,
92
+ "docs": {
93
+ "tags": [],
94
+ "text": "Value that will be presented as text inside a cell"
95
+ },
96
+ "attribute": "cell-value",
97
+ "reflect": true
98
+ },
99
+ "cellKey": {
100
+ "type": "any",
101
+ "mutable": false,
102
+ "complexType": {
103
+ "original": "any",
104
+ "resolved": "any",
105
+ "references": {}
106
+ },
107
+ "required": false,
108
+ "optional": false,
109
+ "docs": {
110
+ "tags": [],
111
+ "text": "Passing same cell key for all body cells which is used in head cell enables features of text align and hovering"
112
+ },
113
+ "attribute": "cell-key",
114
+ "reflect": true
115
+ },
116
+ "disablePadding": {
117
+ "type": "boolean",
118
+ "mutable": false,
119
+ "complexType": {
120
+ "original": "boolean",
121
+ "resolved": "boolean",
122
+ "references": {}
123
+ },
124
+ "required": false,
125
+ "optional": false,
126
+ "docs": {
127
+ "tags": [],
128
+ "text": "Disables internal padding. Useful when passing other components to cell."
129
+ },
130
+ "attribute": "disable-padding",
131
+ "reflect": true,
132
+ "defaultValue": "false"
133
+ }
134
+ };
135
+ }
136
+ static get states() {
137
+ return {
138
+ "textAlignState": {},
139
+ "activeSorting": {},
140
+ "verticalDividers": {},
141
+ "compactDesign": {},
142
+ "noMinWidth": {},
143
+ "whiteBackground": {},
144
+ "tableId": {}
145
+ };
146
+ }
147
+ static get elementRef() { return "host"; }
148
+ static get listeners() {
149
+ return [{
150
+ "name": "tablePropsChangedEvent",
151
+ "method": "tablePropsChangedEventListener",
152
+ "target": "body",
153
+ "capture": false,
154
+ "passive": false
155
+ }, {
156
+ "name": "headCellHoverEvent",
157
+ "method": "headCellHoverEventListener",
158
+ "target": "body",
159
+ "capture": false,
160
+ "passive": false
161
+ }, {
162
+ "name": "textAlignEvent",
163
+ "method": "textAlignEventListener",
164
+ "target": "body",
165
+ "capture": false,
166
+ "passive": false
167
+ }];
168
+ }
169
+ }
@@ -0,0 +1,196 @@
1
+ /* As checkbox is not a web component, we have to import them here in order to have styles available - shadow DOM is a reason */
2
+ :root,
3
+ .sdds-theme-light {
4
+ --sdds-checkbox-color: var(--sdds-grey-900);
5
+ --sdds-checkbox-interaction-01: var(--sdds-blue-800);
6
+ --sdds-checkbox-interaction-02: var(--sdds-white);
7
+ --sdds-checkbox-bg-hover: var(--sdds-blue-800);
8
+ --sdds-checkbox-bg-focus: var(--sdds-blue-800);
9
+ --sdds-checkbox-disabled: var(--sdds-grey-400);
10
+ --sdds-checkbox-bg-img: url("data:image/svg+xml;utf8,<svg width='8' height='6' viewBox='0 0 8 6' fill='none' xmlns='http://www.w3.org/2000/svg'> <path d='M1 2.33333L3.4 5C4.80589 3.4379 5.59411 2.5621 7 1' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round'/></svg>");
11
+ --sdds-checkbox-bg-img-disabled: url("data:image/svg+xml;utf8,<svg width='8' height='6' viewBox='0 0 8 6' fill='none' xmlns='http://www.w3.org/2000/svg'> <path d='M1 2.33333L3.4 5C4.80589 3.4379 5.59411 2.5621 7 1' stroke='%23b0b7c4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
12
+ --sdds-checkbox-border-color-disabled-after: var(--sdds-grey-500);
13
+ --sdds-checkbox-color-disabled-after: var(--sdds-grey-500);
14
+ }
15
+ :root .sdds-theme-dark,
16
+ .sdds-theme-light .sdds-theme-dark {
17
+ --sdds-checkbox-color: var(--sdds-white);
18
+ --sdds-checkbox-interaction-01: var(--sdds-white);
19
+ --sdds-checkbox-interaction-02: var(--sdds-grey-958);
20
+ --sdds-checkbox-bg-hover: white;
21
+ --sdds-checkbox-bg-focus: white;
22
+ --sdds-checkbox-disabled: white;
23
+ --sdds-checkbox-bg-img: url("data:image/svg+xml;utf8,<svg width='8' height='6' viewBox='0 0 8 6' fill='none' xmlns='http://www.w3.org/2000/svg'> <path d='M1 2.33333L3.4 5C4.80589 3.4379 5.59411 2.5621 7 1' stroke='%230D0F13' stroke-linecap='round' stroke-linejoin='round'/></svg>");
24
+ --sdds-checkbox-bg-img-disabled: url("data:image/svg+xml;utf8,<svg width='8' height='6' viewBox='0 0 8 6' fill='none' xmlns='http://www.w3.org/2000/svg'> <path d='M1 2.33333L3.4 5C4.80589 3.4379 5.59411 2.5621 7 1' stroke='%2356657A' stroke-linecap='round' stroke-linejoin='round'/></svg>");
25
+ --sdds-checkbox-border-color-disabled-after: var(--sdds-grey-700);
26
+ --sdds-checkbox-color-disabled-after: var(--sdds-grey-700);
27
+ }
28
+
29
+ .sdds-checkbox-item {
30
+ box-sizing: border-box;
31
+ font: var(--sdds-detail-02);
32
+ letter-spacing: var(--sdds-detail-02-ls);
33
+ color: var(--sdds-checkbox-text);
34
+ display: flex;
35
+ align-items: center;
36
+ margin-left: -4px;
37
+ }
38
+ .sdds-checkbox-item * {
39
+ box-sizing: border-box;
40
+ }
41
+ .sdds-checkbox-item .sdds-form-input[type=checkbox] {
42
+ appearance: none;
43
+ outline: none;
44
+ margin: 0;
45
+ border: 0;
46
+ border-radius: 2px;
47
+ width: 24px;
48
+ height: 24px;
49
+ position: relative;
50
+ cursor: pointer;
51
+ }
52
+ .sdds-checkbox-item .sdds-form-input[type=checkbox] + label {
53
+ color: var(--sdds-checkbox-color);
54
+ padding-left: var(--sdds-spacing-element-8);
55
+ padding-top: var(--sdds-spacing-element-4);
56
+ padding-bottom: var(--sdds-spacing-element-4);
57
+ cursor: pointer;
58
+ }
59
+ .sdds-checkbox-item .sdds-form-input[type=checkbox]::before, .sdds-checkbox-item .sdds-form-input[type=checkbox]::after {
60
+ content: "";
61
+ position: absolute;
62
+ box-sizing: border-box;
63
+ border-radius: 2px;
64
+ }
65
+ .sdds-checkbox-item .sdds-form-input[type=checkbox]::before {
66
+ width: 24px;
67
+ height: 24px;
68
+ left: 0;
69
+ top: 0;
70
+ }
71
+ .sdds-checkbox-item .sdds-form-input[type=checkbox]::after {
72
+ border: 1px solid var(--sdds-checkbox-interaction-01);
73
+ background-color: var(--sdds-checkbox-interaction-02);
74
+ width: 16px;
75
+ height: 16px;
76
+ left: 4px;
77
+ top: 4px;
78
+ }
79
+ .sdds-checkbox-item .sdds-form-input[type=checkbox]:hover::before {
80
+ background-color: var(--sdds-checkbox-bg-hover);
81
+ opacity: 0.12;
82
+ }
83
+ .sdds-checkbox-item .sdds-form-input[type=checkbox]:focus::before {
84
+ background-color: var(--sdds-checkbox-bg-focus);
85
+ opacity: 0.24;
86
+ animation: cb-focus 0.4s cubic-bezier(0.65, 0.05, 0.38, 0.95) forwards;
87
+ }
88
+ .sdds-checkbox-item .sdds-form-input[type=checkbox]:disabled, .sdds-checkbox-item .sdds-form-input[type=checkbox].disabled {
89
+ cursor: not-allowed;
90
+ }
91
+ .sdds-checkbox-item .sdds-form-input[type=checkbox]:disabled::after, .sdds-checkbox-item .sdds-form-input[type=checkbox].disabled::after {
92
+ border-color: var(--sdds-checkbox-border-color-disabled-after);
93
+ }
94
+ .sdds-checkbox-item .sdds-form-input[type=checkbox]:disabled + label, .sdds-checkbox-item .sdds-form-input[type=checkbox].disabled + label {
95
+ color: var(--sdds-grey-600);
96
+ cursor: not-allowed;
97
+ }
98
+ .sdds-checkbox-item .sdds-form-input[type=checkbox]:disabled:hover::before, .sdds-checkbox-item .sdds-form-input[type=checkbox].disabled:hover::before {
99
+ display: none;
100
+ }
101
+
102
+ .sdds-form-input[type=checkbox]:checked::after {
103
+ background-image: var(--sdds-checkbox-bg-img);
104
+ background-color: var(--sdds-checkbox-interaction-01);
105
+ background-repeat: no-repeat;
106
+ background-position: center;
107
+ }
108
+ .sdds-form-input[type=checkbox]:checked:disabled:hover::before, .sdds-form-input[type=checkbox]:checked:disabled::before, .sdds-form-input[type=checkbox]:checked.disabled:hover::before, .sdds-form-input[type=checkbox]:checked.disabled::before {
109
+ display: block;
110
+ width: 16px;
111
+ height: 16px;
112
+ left: 4px;
113
+ top: 4px;
114
+ border: 1px solid #b0b7c4;
115
+ }
116
+ .sdds-form-input[type=checkbox]:checked:disabled::after, .sdds-form-input[type=checkbox]:checked.disabled::after {
117
+ background-image: var(--sdds-checkbox-bg-img-disabled);
118
+ background-color: var(--sdds-checkbox-interaction-02);
119
+ color: var(--sdds-checkbox-color-disabled-after);
120
+ }
121
+
122
+ @keyframes cb-focus {
123
+ 0% {
124
+ transform: scale(0);
125
+ opacity: 0;
126
+ }
127
+ 50% {
128
+ transform: scale(1);
129
+ opacity: 1;
130
+ }
131
+ 100% {
132
+ transform: scale(1);
133
+ opacity: 0;
134
+ }
135
+ }
136
+ :host(.sdds-table__row) {
137
+ box-sizing: border-box;
138
+ display: table-row;
139
+ border-bottom: 1px solid var(--sdds-grey-400);
140
+ background-color: var(--sdds-white);
141
+ transition: background-color 200ms ease;
142
+ }
143
+ :host(.sdds-table__row) * {
144
+ box-sizing: border-box;
145
+ }
146
+ :host(.sdds-table__row) .sdds-table__body-cell--checkbox {
147
+ min-width: 48px;
148
+ width: 48px;
149
+ padding: 0;
150
+ }
151
+
152
+ :host(.sdds-table__row:hover) {
153
+ background-color: var(--sdds-grey-100);
154
+ }
155
+
156
+ :host(.sdds-table__row--selected) {
157
+ background-color: var(--sdds-grey-300);
158
+ }
159
+
160
+ :host(.sdds-table__row--selected:hover) {
161
+ background-color: var(--sdds-grey-400);
162
+ }
163
+
164
+ :host(.sdds-table__row--hidden) {
165
+ display: none;
166
+ }
167
+
168
+ :host(.sdds-table__row--expended) {
169
+ width: 100%;
170
+ background-color: pink;
171
+ }
172
+
173
+ :host .sdds-form-label--data-table {
174
+ width: 100%;
175
+ height: 48px;
176
+ display: flex;
177
+ justify-content: center;
178
+ align-items: center;
179
+ cursor: pointer;
180
+ }
181
+
182
+ :host(.sdds-table__compact) .sdds-form-label--data-table {
183
+ height: 32px;
184
+ }
185
+
186
+ :host(.sdds-table--divider) .sdds-table__body-cell--checkbox {
187
+ border-right: 1px solid var(--sdds-grey-400);
188
+ }
189
+
190
+ :host(.sdds-table--on-white-bg) {
191
+ background-color: var(--sdds-grey-50);
192
+ }
193
+
194
+ :host(.sdds-table--on-white-bg:hover) {
195
+ background-color: var(--sdds-grey-200);
196
+ }
@@ -0,0 +1,164 @@
1
+ import { h, Host } from '@stencil/core';
2
+ const relevantTableProps = [
3
+ 'enableMultiselect',
4
+ 'verticalDividers',
5
+ 'compactDesign',
6
+ 'whiteBackground',
7
+ ];
8
+ export class TableBodyRow {
9
+ constructor() {
10
+ this.enableMultiselect = false;
11
+ this.bodyCheckBoxStatus = false;
12
+ this.mainCheckBoxStatus = false;
13
+ this.verticalDividers = false;
14
+ this.compactDesign = false;
15
+ this.noMinWidth = false;
16
+ this.whiteBackground = false;
17
+ this.tableId = '';
18
+ }
19
+ bodyCheckBoxClicked(event) {
20
+ const row = this.host;
21
+ this.bodyCheckBoxStatus = event.currentTarget.checked;
22
+ if (this.bodyCheckBoxStatus === true) {
23
+ row.classList.add('sdds-table__row--selected');
24
+ }
25
+ else {
26
+ row.classList.remove('sdds-table__row--selected');
27
+ }
28
+ this.bodyRowToTable.emit(this.bodyCheckBoxStatus);
29
+ }
30
+ bodyCheckBoxStatusUpdater(status) {
31
+ this.mainCheckBoxStatus = status;
32
+ this.bodyCheckBoxStatus = this.mainCheckBoxStatus;
33
+ const row = this.host;
34
+ if (this.bodyCheckBoxStatus === true) {
35
+ row.classList.add('sdds-table__row--selected');
36
+ }
37
+ else {
38
+ row.classList.remove('sdds-table__row--selected');
39
+ }
40
+ this.bodyRowToTable.emit(this.bodyCheckBoxStatus);
41
+ }
42
+ tablePropsChangedEventListener(event) {
43
+ if (this.tableId === event.detail.tableId) {
44
+ event.detail.changed
45
+ .filter((changedProp) => relevantTableProps.includes(changedProp))
46
+ .forEach((changedProp) => {
47
+ if (typeof this[changedProp] === 'undefined') {
48
+ throw new Error(`Table prop is not supported: ${changedProp}`);
49
+ }
50
+ this[changedProp] = event.detail[changedProp];
51
+ });
52
+ }
53
+ }
54
+ headCheckboxListener(event) {
55
+ if (this.tableId === event.detail[0]) {
56
+ this.bodyCheckBoxStatusUpdater(event.detail[1]);
57
+ }
58
+ }
59
+ updateBodyCheckboxesEventListener(event) {
60
+ const [receivedID, receivedBodyCheckboxStatus] = event.detail;
61
+ if (this.tableId === receivedID) {
62
+ this.bodyCheckBoxStatusUpdater(receivedBodyCheckboxStatus);
63
+ }
64
+ }
65
+ connectedCallback() {
66
+ this.tableEl = this.host.closest('sdds-table');
67
+ this.tableId = this.tableEl.tableId;
68
+ }
69
+ componentWillLoad() {
70
+ relevantTableProps.forEach((tablePropName) => {
71
+ this[tablePropName] = this.tableEl[tablePropName];
72
+ });
73
+ }
74
+ componentDidLoad() {
75
+ this.runPaginationEvent.emit(this.tableId);
76
+ }
77
+ render() {
78
+ return (h(Host, { class: {
79
+ 'sdds-table__row': true,
80
+ 'sdds-table__compact': this.compactDesign,
81
+ 'sdds-table--divider': this.verticalDividers,
82
+ 'sdds-table--on-white-bg': this.whiteBackground,
83
+ } }, this.enableMultiselect && (h("td", { class: "sdds-table__body-cell sdds-table__body-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: (event) => this.bodyCheckBoxClicked(event), checked: this.bodyCheckBoxStatus }))))), h("slot", null)));
84
+ }
85
+ static get is() { return "sdds-table-body-row"; }
86
+ static get encapsulation() { return "shadow"; }
87
+ static get originalStyleUrls() {
88
+ return {
89
+ "$": ["table-body-row.scss"]
90
+ };
91
+ }
92
+ static get styleUrls() {
93
+ return {
94
+ "$": ["table-body-row.css"]
95
+ };
96
+ }
97
+ static get states() {
98
+ return {
99
+ "enableMultiselect": {},
100
+ "bodyCheckBoxStatus": {},
101
+ "mainCheckBoxStatus": {},
102
+ "verticalDividers": {},
103
+ "compactDesign": {},
104
+ "noMinWidth": {},
105
+ "whiteBackground": {},
106
+ "tableId": {}
107
+ };
108
+ }
109
+ static get events() {
110
+ return [{
111
+ "method": "bodyRowToTable",
112
+ "name": "bodyRowToTable",
113
+ "bubbles": true,
114
+ "cancelable": true,
115
+ "composed": true,
116
+ "docs": {
117
+ "tags": [],
118
+ "text": "Send status of single row to the parent, sdds-table component that hold logic for data export and main checkbox control"
119
+ },
120
+ "complexType": {
121
+ "original": "boolean",
122
+ "resolved": "boolean",
123
+ "references": {}
124
+ }
125
+ }, {
126
+ "method": "runPaginationEvent",
127
+ "name": "runPaginationEvent",
128
+ "bubbles": true,
129
+ "cancelable": true,
130
+ "composed": true,
131
+ "docs": {
132
+ "tags": [],
133
+ "text": "Event that triggers pagination function. Needed as first rows have to be rendered in order for pagination to run"
134
+ },
135
+ "complexType": {
136
+ "original": "string",
137
+ "resolved": "string",
138
+ "references": {}
139
+ }
140
+ }];
141
+ }
142
+ static get elementRef() { return "host"; }
143
+ static get listeners() {
144
+ return [{
145
+ "name": "tablePropsChangedEvent",
146
+ "method": "tablePropsChangedEventListener",
147
+ "target": "body",
148
+ "capture": false,
149
+ "passive": false
150
+ }, {
151
+ "name": "mainCheckboxSelectedEvent",
152
+ "method": "headCheckboxListener",
153
+ "target": "body",
154
+ "capture": false,
155
+ "passive": false
156
+ }, {
157
+ "name": "updateBodyCheckboxesEvent",
158
+ "method": "updateBodyCheckboxesEventListener",
159
+ "target": "body",
160
+ "capture": false,
161
+ "passive": false
162
+ }];
163
+ }
164
+ }
@@ -0,0 +1,79 @@
1
+ :host {
2
+ box-sizing: border-box;
3
+ display: contents;
4
+ }
5
+ :host * {
6
+ box-sizing: border-box;
7
+ }
8
+ :host .sdds-table__row,
9
+ :host .sdds-table__row-extend {
10
+ display: table-row;
11
+ border-bottom: 1px solid var(--sdds-grey-400);
12
+ background-color: var(--sdds-white);
13
+ transition: background-color 200ms ease;
14
+ }
15
+ :host .sdds-table__row:hover,
16
+ :host .sdds-table__row-extend:hover {
17
+ background-color: var(--sdds-grey-100);
18
+ }
19
+ :host .sdds-table__expand-control-container {
20
+ display: flex;
21
+ justify-content: center;
22
+ align-items: center;
23
+ height: 46px;
24
+ cursor: pointer;
25
+ padding: 0 16px;
26
+ }
27
+ :host .sdds-table__expand-control-container .sdds-table__expand-input {
28
+ display: none;
29
+ }
30
+ :host .sdds-table__expand-control-container .sdds-expendable-row-icon {
31
+ height: 16px;
32
+ width: 16px;
33
+ transition: transform 200ms ease;
34
+ transform: rotate(0);
35
+ }
36
+ :host .sdds-table__row-expand {
37
+ visibility: collapse;
38
+ transition: background-color 200ms ease;
39
+ }
40
+ :host .sdds-table__row-expand .sdds-table__cell-expand {
41
+ padding: 16px 16px 16px 66px;
42
+ }
43
+
44
+ :host(.sdds-table__row-expand--active) .sdds-table__row {
45
+ background-color: var(--sdds-grey-300);
46
+ }
47
+ :host(.sdds-table__row-expand--active) .sdds-table__expand-control-container .sdds-expendable-row-icon {
48
+ transform: rotate(180deg);
49
+ }
50
+ :host(.sdds-table__row-expand--active) .sdds-table__row-expand {
51
+ background-color: var(--sdds-grey-300);
52
+ visibility: visible;
53
+ }
54
+
55
+ :host(.sdds-table__compact) .sdds-table__expand-control-container {
56
+ height: 30px;
57
+ }
58
+ :host(.sdds-table__compact) .sdds-table__row-expand .sdds-table__cell-expand {
59
+ padding: 8px 16px 8px 66px;
60
+ }
61
+
62
+ :host(.sdds-table--divider) .sdds-table__cell--expand {
63
+ border-right: 1px solid var(--sdds-grey-400);
64
+ }
65
+
66
+ :host(.sdds-table--on-white-bg) .sdds-table__row,
67
+ :host(.sdds-table--on-white-bg) .sdds-table__row-extend {
68
+ background-color: var(--sdds-grey-50);
69
+ }
70
+
71
+ :host(.sdds-table--on-white-bg:hover) .sdds-table__row,
72
+ :host(.sdds-table--on-white-bg:hover) .sdds-table__row-extend {
73
+ background-color: var(--sdds-grey-200);
74
+ }
75
+
76
+ :host(.sdds-table__row-expand--active.sdds-table--on-white-bg) .sdds-table__row,
77
+ :host(.sdds-table__row-expand--active.sdds-table--on-white-bg) .sdds-table__row-extend {
78
+ background-color: var(--sdds-grey-300);
79
+ }