@scania/tegel 0.0.1-beta.2 → 0.0.1-beta.3

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 (275) hide show
  1. package/dist/components/dropdown-option.js +1 -0
  2. package/dist/components/dropdown.js +1 -0
  3. package/dist/components/icon.js +1 -0
  4. package/dist/components/sdds-accordion-item.js +1 -0
  5. package/dist/components/sdds-accordion.js +1 -0
  6. package/dist/components/sdds-badges.js +1 -0
  7. package/dist/components/sdds-button.js +1 -0
  8. package/dist/components/sdds-datetime.js +1 -0
  9. package/dist/components/sdds-dropdown-filter.js +1 -0
  10. package/dist/components/sdds-header-cell.js +1 -0
  11. package/dist/components/sdds-inline-tabs-fullbleed.js +1 -0
  12. package/dist/components/sdds-inline-tabs.js +1 -0
  13. package/dist/components/sdds-modal.js +1 -0
  14. package/dist/components/sdds-navigation-tabs.js +1 -0
  15. package/dist/components/sdds-popover-canvas.js +1 -0
  16. package/dist/components/sdds-popover-menu.js +1 -0
  17. package/dist/components/sdds-slider.js +1 -0
  18. package/dist/components/sdds-spinner.js +1 -0
  19. package/dist/components/sdds-table-body-row-expandable.js +1 -0
  20. package/dist/components/sdds-table-body.js +1 -0
  21. package/dist/components/sdds-table-footer.js +1 -0
  22. package/dist/components/sdds-table-header.js +1 -0
  23. package/dist/components/sdds-table-toolbar.js +1 -0
  24. package/dist/components/sdds-table.js +1 -0
  25. package/dist/components/sdds-textarea.js +1 -0
  26. package/dist/components/sdds-textfield.js +1 -0
  27. package/dist/components/sdds-tooltip.js +1 -0
  28. package/dist/components/table-body-cell.js +1 -0
  29. package/dist/components/table-body-row.js +1 -0
  30. package/package.json +2 -2
  31. package/dist/cjs/index-e1c79686.js +0 -1912
  32. package/dist/cjs/index.cjs.js +0 -2
  33. package/dist/cjs/loader.cjs.js +0 -21
  34. package/dist/cjs/popper-11d5f714.js +0 -1801
  35. package/dist/cjs/sdds-accordion-item.cjs.entry.js +0 -34
  36. package/dist/cjs/sdds-accordion.cjs.entry.js +0 -21
  37. package/dist/cjs/sdds-badges.cjs.entry.js +0 -55
  38. package/dist/cjs/sdds-body-cell_2.cjs.entry.js +0 -173
  39. package/dist/cjs/sdds-button.cjs.entry.js +0 -36
  40. package/dist/cjs/sdds-datetime.cjs.entry.js +0 -66
  41. package/dist/cjs/sdds-dropdown-filter.cjs.entry.js +0 -92
  42. package/dist/cjs/sdds-dropdown_2.cjs.entry.js +0 -335
  43. package/dist/cjs/sdds-header-cell.cjs.entry.js +0 -141
  44. package/dist/cjs/sdds-icon.cjs.entry.js +0 -42
  45. package/dist/cjs/sdds-inline-tabs-fullbleed.cjs.entry.js +0 -96
  46. package/dist/cjs/sdds-inline-tabs.cjs.entry.js +0 -211
  47. package/dist/cjs/sdds-modal.cjs.entry.js +0 -49
  48. package/dist/cjs/sdds-navigation-tabs.cjs.entry.js +0 -95
  49. package/dist/cjs/sdds-popover-canvas.cjs.entry.js +0 -76
  50. package/dist/cjs/sdds-popover-menu.cjs.entry.js +0 -75
  51. package/dist/cjs/sdds-slider.cjs.entry.js +0 -336
  52. package/dist/cjs/sdds-spinner.cjs.entry.js +0 -21
  53. package/dist/cjs/sdds-table-body-row-expandable.cjs.entry.js +0 -81
  54. package/dist/cjs/sdds-table-body.cjs.entry.js +0 -289
  55. package/dist/cjs/sdds-table-footer.cjs.entry.js +0 -165
  56. package/dist/cjs/sdds-table-header.cjs.entry.js +0 -100
  57. package/dist/cjs/sdds-table-toolbar.cjs.entry.js +0 -66
  58. package/dist/cjs/sdds-table.cjs.entry.js +0 -69
  59. package/dist/cjs/sdds-textarea.cjs.entry.js +0 -61
  60. package/dist/cjs/sdds-textfield.cjs.entry.js +0 -82
  61. package/dist/cjs/sdds-tooltip.cjs.entry.js +0 -95
  62. package/dist/cjs/tegel.cjs.js +0 -19
  63. package/dist/collection/collection-manifest.json +0 -40
  64. package/dist/collection/components/accordion/accordion-item/accordion-item.css +0 -134
  65. package/dist/collection/components/accordion/accordion-item/accordion-item.js +0 -146
  66. package/dist/collection/components/accordion/accordion.css +0 -77
  67. package/dist/collection/components/accordion/accordion.js +0 -62
  68. package/dist/collection/components/accordion/accordion.stories.js +0 -91
  69. package/dist/collection/components/badge/badge.stories.js +0 -101
  70. package/dist/collection/components/badge/badges.css +0 -42
  71. package/dist/collection/components/badge/badges.js +0 -150
  72. package/dist/collection/components/banner/banner.stories.js +0 -93
  73. package/dist/collection/components/block/block.stories.js +0 -46
  74. package/dist/collection/components/breadcrumb/breadcrumb.stories.js +0 -26
  75. package/dist/collection/components/button/button-component.js +0 -154
  76. package/dist/collection/components/button/button-native.stories.js +0 -183
  77. package/dist/collection/components/button/button-webcomponent.stories.js +0 -182
  78. package/dist/collection/components/button/button.css +0 -658
  79. package/dist/collection/components/card/card.stories.js +0 -181
  80. package/dist/collection/components/checkbox/checkbox.stories.js +0 -54
  81. package/dist/collection/components/chips/chips.stories.js +0 -124
  82. package/dist/collection/components/data-table/native-table.stories.js +0 -182
  83. package/dist/collection/components/data-table/table/table.css +0 -15
  84. package/dist/collection/components/data-table/table/table.js +0 -253
  85. package/dist/collection/components/data-table/table-body/table-body.css +0 -22
  86. package/dist/collection/components/data-table/table-body/table-body.js +0 -425
  87. package/dist/collection/components/data-table/table-body-cell/table-body-cell.css +0 -40
  88. package/dist/collection/components/data-table/table-body-cell/table-body-cell.js +0 -169
  89. package/dist/collection/components/data-table/table-body-row/table-body-row.css +0 -196
  90. package/dist/collection/components/data-table/table-body-row/table-body-row.js +0 -164
  91. package/dist/collection/components/data-table/table-body-row-expandable/table-body-row-expandable.css +0 -79
  92. package/dist/collection/components/data-table/table-body-row-expandable/table-body-row-expandable.js +0 -155
  93. package/dist/collection/components/data-table/table-component-basic.stories.js +0 -163
  94. package/dist/collection/components/data-table/table-component-batch-actions.stories.js +0 -129
  95. package/dist/collection/components/data-table/table-component-bodydata.stories.js +0 -58
  96. package/dist/collection/components/data-table/table-component-custom-width.stories.js +0 -198
  97. package/dist/collection/components/data-table/table-component-event-listeners.stories.js +0 -153
  98. package/dist/collection/components/data-table/table-component-expandable-rows.stories.js +0 -137
  99. package/dist/collection/components/data-table/table-component-filtering.stories.js +0 -139
  100. package/dist/collection/components/data-table/table-component-multiselect.stories.js +0 -160
  101. package/dist/collection/components/data-table/table-component-pagination.stories.js +0 -129
  102. package/dist/collection/components/data-table/table-component-sorting.stories.js +0 -107
  103. package/dist/collection/components/data-table/table-footer/table-footer.css +0 -93
  104. package/dist/collection/components/data-table/table-footer/table-footer.js +0 -355
  105. package/dist/collection/components/data-table/table-header/table-header.css +0 -204
  106. package/dist/collection/components/data-table/table-header/table-header.js +0 -153
  107. package/dist/collection/components/data-table/table-header-cell/table-header-cell.css +0 -126
  108. package/dist/collection/components/data-table/table-header-cell/table-header-cell.js +0 -320
  109. package/dist/collection/components/data-table/table-toolbar/table-toolbar.css +0 -92
  110. package/dist/collection/components/data-table/table-toolbar/table-toolbar.js +0 -142
  111. package/dist/collection/components/datetime/datetime.css +0 -375
  112. package/dist/collection/components/datetime/datetime.js +0 -251
  113. package/dist/collection/components/datetime/datetime.stories.js +0 -149
  114. package/dist/collection/components/divider/divider.stories.js +0 -116
  115. package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.js +0 -339
  116. package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.stories.js +0 -130
  117. package/dist/collection/components/dropdown/dropdown-native.stories.js +0 -90
  118. package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +0 -185
  119. package/dist/collection/components/dropdown/dropdown-wc-default.stories.js +0 -151
  120. package/dist/collection/components/dropdown/dropdown-wc-multiselect.stories.js +0 -146
  121. package/dist/collection/components/dropdown/dropdown.css +0 -891
  122. package/dist/collection/components/dropdown/dropdown.js +0 -554
  123. package/dist/collection/components/footer/footer.stories.js +0 -100
  124. package/dist/collection/components/header/header-all.stories.js +0 -217
  125. package/dist/collection/components/header/header-default.stories.js +0 -47
  126. package/dist/collection/components/header/header-inline.stories.js +0 -113
  127. package/dist/collection/components/header/header-search.stories.js +0 -263
  128. package/dist/collection/components/header/header-toolbar.stories.js +0 -204
  129. package/dist/collection/components/icon/icon-font.stories.js +0 -57
  130. package/dist/collection/components/icon/icon-web-component.stories.js +0 -51
  131. package/dist/collection/components/icon/icon.css +0 -16
  132. package/dist/collection/components/icon/icon.js +0 -89
  133. package/dist/collection/components/icon/iconsArray.js +0 -2
  134. package/dist/collection/components/link/link.stories.js +0 -45
  135. package/dist/collection/components/message/message.stories.js +0 -117
  136. package/dist/collection/components/modal/modal-native.stories.js +0 -121
  137. package/dist/collection/components/modal/modal-webcomponent.stories.js +0 -78
  138. package/dist/collection/components/modal/modal.css +0 -324
  139. package/dist/collection/components/modal/modal.js +0 -146
  140. package/dist/collection/components/popover-canvas/popover-canvas.css +0 -20
  141. package/dist/collection/components/popover-canvas/popover-canvas.js +0 -190
  142. package/dist/collection/components/popover-canvas/popover-canvas.stories.js +0 -87
  143. package/dist/collection/components/popover-menu/popover-menu-icons.stories.js +0 -132
  144. package/dist/collection/components/popover-menu/popover-menu.css +0 -19
  145. package/dist/collection/components/popover-menu/popover-menu.js +0 -189
  146. package/dist/collection/components/popover-menu/popover-menu.stories.js +0 -109
  147. package/dist/collection/components/radio-button/radio-button.stories.js +0 -68
  148. package/dist/collection/components/side-menu/side-menu.stories.js +0 -182
  149. package/dist/collection/components/slider/slider.css +0 -260
  150. package/dist/collection/components/slider/slider.js +0 -682
  151. package/dist/collection/components/slider/slider.stories.js +0 -251
  152. package/dist/collection/components/spinner/spinner.css +0 -79
  153. package/dist/collection/components/spinner/spinner.js +0 -61
  154. package/dist/collection/components/spinner/spinner.stories.js +0 -59
  155. package/dist/collection/components/stepper/stepper.stories.js +0 -139
  156. package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.css +0 -159
  157. package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.js +0 -302
  158. package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.stories.js +0 -65
  159. package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.css +0 -172
  160. package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.js +0 -126
  161. package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.stories.js +0 -43
  162. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.css +0 -153
  163. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +0 -103
  164. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.stories.js +0 -32
  165. package/dist/collection/components/textarea/textarea.css +0 -283
  166. package/dist/collection/components/textarea/textarea.js +0 -336
  167. package/dist/collection/components/textarea/textarea.stories.js +0 -149
  168. package/dist/collection/components/textfield/textfield.css +0 -494
  169. package/dist/collection/components/textfield/textfield.js +0 -359
  170. package/dist/collection/components/textfield/textfield.stories.js +0 -222
  171. package/dist/collection/components/toast/toast.stories.js +0 -119
  172. package/dist/collection/components/toggle/toggle.stories.js +0 -62
  173. package/dist/collection/components/tooltip/tooltip.css +0 -46
  174. package/dist/collection/components/tooltip/tooltip.js +0 -200
  175. package/dist/collection/components/tooltip/tooltip.stories.js +0 -113
  176. package/dist/collection/components/utility/colour/background-color.stories.js +0 -96
  177. package/dist/collection/components/utility/colour/text-color.stories.js +0 -94
  178. package/dist/collection/foundations-stories/colour/colour-brand.stories.js +0 -38
  179. package/dist/collection/foundations-stories/colour/colour-scales.stories.js +0 -71
  180. package/dist/collection/foundations-stories/colour/colour-semantic.stories.js +0 -40
  181. package/dist/collection/foundations-stories/grid/grid.stories.js +0 -386
  182. package/dist/collection/foundations-stories/spacing/spacing-element.stories.js +0 -100
  183. package/dist/collection/foundations-stories/spacing/spacing-layout.stories.js +0 -94
  184. package/dist/collection/foundations-stories/typography/typography-body.stories.js +0 -16
  185. package/dist/collection/foundations-stories/typography/typography-detail.stories.js +0 -17
  186. package/dist/collection/foundations-stories/typography/typography-headline.stories.js +0 -39
  187. package/dist/collection/foundations-stories/typography/typography-paragraph.stories.js +0 -12
  188. package/dist/collection/index.js +0 -1
  189. package/dist/collection/stories/assets/code-brackets.svg +0 -1
  190. package/dist/collection/stories/assets/colors.svg +0 -1
  191. package/dist/collection/stories/assets/comments.svg +0 -1
  192. package/dist/collection/stories/assets/direction.svg +0 -1
  193. package/dist/collection/stories/assets/flow.svg +0 -1
  194. package/dist/collection/stories/assets/plugin.svg +0 -1
  195. package/dist/collection/stories/assets/repo.svg +0 -1
  196. package/dist/collection/stories/assets/stackalt.svg +0 -1
  197. package/dist/collection/utils/utils.js +0 -12
  198. package/dist/esm/index-b67b15a6.js +0 -1884
  199. package/dist/esm/index.js +0 -1
  200. package/dist/esm/loader.js +0 -17
  201. package/dist/esm/polyfills/core-js.js +0 -11
  202. package/dist/esm/polyfills/css-shim.js +0 -1
  203. package/dist/esm/polyfills/dom.js +0 -79
  204. package/dist/esm/polyfills/es5-html-element.js +0 -1
  205. package/dist/esm/polyfills/index.js +0 -34
  206. package/dist/esm/polyfills/system.js +0 -6
  207. package/dist/esm/popper-f860750c.js +0 -1799
  208. package/dist/esm/sdds-accordion-item.entry.js +0 -30
  209. package/dist/esm/sdds-accordion.entry.js +0 -17
  210. package/dist/esm/sdds-badges.entry.js +0 -51
  211. package/dist/esm/sdds-body-cell_2.entry.js +0 -168
  212. package/dist/esm/sdds-button.entry.js +0 -32
  213. package/dist/esm/sdds-datetime.entry.js +0 -62
  214. package/dist/esm/sdds-dropdown-filter.entry.js +0 -88
  215. package/dist/esm/sdds-dropdown_2.entry.js +0 -330
  216. package/dist/esm/sdds-header-cell.entry.js +0 -137
  217. package/dist/esm/sdds-icon.entry.js +0 -38
  218. package/dist/esm/sdds-inline-tabs-fullbleed.entry.js +0 -92
  219. package/dist/esm/sdds-inline-tabs.entry.js +0 -207
  220. package/dist/esm/sdds-modal.entry.js +0 -45
  221. package/dist/esm/sdds-navigation-tabs.entry.js +0 -91
  222. package/dist/esm/sdds-popover-canvas.entry.js +0 -72
  223. package/dist/esm/sdds-popover-menu.entry.js +0 -71
  224. package/dist/esm/sdds-slider.entry.js +0 -332
  225. package/dist/esm/sdds-spinner.entry.js +0 -17
  226. package/dist/esm/sdds-table-body-row-expandable.entry.js +0 -77
  227. package/dist/esm/sdds-table-body.entry.js +0 -285
  228. package/dist/esm/sdds-table-footer.entry.js +0 -161
  229. package/dist/esm/sdds-table-header.entry.js +0 -96
  230. package/dist/esm/sdds-table-toolbar.entry.js +0 -62
  231. package/dist/esm/sdds-table.entry.js +0 -65
  232. package/dist/esm/sdds-textarea.entry.js +0 -57
  233. package/dist/esm/sdds-textfield.entry.js +0 -78
  234. package/dist/esm/sdds-tooltip.entry.js +0 -91
  235. package/dist/esm/tegel.js +0 -17
  236. package/dist/index.cjs.js +0 -1
  237. package/dist/index.js +0 -1
  238. package/dist/tegel/index.esm.js +0 -0
  239. package/dist/tegel/p-040efb32.entry.js +0 -1
  240. package/dist/tegel/p-12ca5cfa.entry.js +0 -1
  241. package/dist/tegel/p-157e1618.js +0 -2
  242. package/dist/tegel/p-1fe61cf6.entry.js +0 -1
  243. package/dist/tegel/p-2f376504.entry.js +0 -1
  244. package/dist/tegel/p-44ced895.entry.js +0 -1
  245. package/dist/tegel/p-4880f03d.entry.js +0 -1
  246. package/dist/tegel/p-4aba73a3.entry.js +0 -1
  247. package/dist/tegel/p-4b58a02c.entry.js +0 -1
  248. package/dist/tegel/p-4cb85347.entry.js +0 -1
  249. package/dist/tegel/p-52031b5a.entry.js +0 -1
  250. package/dist/tegel/p-677baf7f.entry.js +0 -1
  251. package/dist/tegel/p-71797eaf.entry.js +0 -1
  252. package/dist/tegel/p-7373284c.entry.js +0 -1
  253. package/dist/tegel/p-7451779b.entry.js +0 -1
  254. package/dist/tegel/p-77aeea3b.entry.js +0 -1
  255. package/dist/tegel/p-8582d6a7.entry.js +0 -1
  256. package/dist/tegel/p-96021bd0.entry.js +0 -1
  257. package/dist/tegel/p-9d8caf51.entry.js +0 -1
  258. package/dist/tegel/p-a5919930.entry.js +0 -1
  259. package/dist/tegel/p-b01cface.entry.js +0 -1
  260. package/dist/tegel/p-bf896643.entry.js +0 -1
  261. package/dist/tegel/p-c311725c.entry.js +0 -1
  262. package/dist/tegel/p-cf72dfd9.entry.js +0 -1
  263. package/dist/tegel/p-d91caec6.entry.js +0 -1
  264. package/dist/tegel/p-e10eec33.entry.js +0 -1
  265. package/dist/tegel/p-ec26fc38.js +0 -1
  266. package/dist/tegel/p-f2262a69.entry.js +0 -1
  267. package/dist/tegel/p-f2f7aa45.entry.js +0 -1
  268. package/dist/tegel/tegel.css +0 -101
  269. package/dist/tegel/tegel.esm.js +0 -1
  270. package/loader/cdn.js +0 -3
  271. package/loader/index.cjs.js +0 -3
  272. package/loader/index.d.ts +0 -12
  273. package/loader/index.es2017.js +0 -3
  274. package/loader/index.js +0 -4
  275. package/loader/package.json +0 -11
@@ -1,153 +0,0 @@
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
- }
@@ -1,126 +0,0 @@
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
- }
@@ -1,320 +0,0 @@
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
- }
@@ -1,92 +0,0 @@
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
- }