@scania/tegel 0.0.1-beta.1 → 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 +3 -3
  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,253 +0,0 @@
1
- // https://stackoverflow.com/questions/63051941/how-to-pass-data-as-array-of-object-in-stencil-js
2
- // https://medium.com/@scottmgerstl/passing-an-object-or-array-to-stencil-dd62b7d92641
3
- import { h, Host } from '@stencil/core';
4
- export class Table {
5
- constructor() {
6
- this.verticalDividers = false;
7
- this.compactDesign = false;
8
- this.noMinWidth = undefined;
9
- this.whiteBackground = false;
10
- this.enableMultiselect = false;
11
- this.enableExpandableRows = false;
12
- this.enableResponsive = false;
13
- this.tableId = crypto.randomUUID();
14
- }
15
- emitTablePropsChangedEvent(changedValueName, changedValue) {
16
- this.tablePropsChangedEvent.emit({
17
- tableId: this.tableId,
18
- changed: [changedValueName],
19
- [changedValueName]: changedValue,
20
- });
21
- }
22
- enableMultiselectChanged(newValue) {
23
- this.emitTablePropsChangedEvent('enableMultiselect', newValue);
24
- }
25
- enableExpandableRowsChanged(newValue) {
26
- this.emitTablePropsChangedEvent('enableExpandableRows', newValue);
27
- }
28
- compactDesignChanged(newValue) {
29
- this.emitTablePropsChangedEvent('compactDesign', newValue);
30
- }
31
- verticalDividersChanged(newValue) {
32
- this.emitTablePropsChangedEvent('verticalDividers', newValue);
33
- }
34
- noMinWidthChanged(newValue) {
35
- this.emitTablePropsChangedEvent('noMinWidth', newValue);
36
- }
37
- whiteBackgroundChanged(newValue) {
38
- this.emitTablePropsChangedEvent('whiteBackground', newValue);
39
- }
40
- render() {
41
- return (h(Host, { class: { 'sdds-table--responsive': this.enableResponsive } }, h("table", { class: {
42
- 'sdds-table': true,
43
- 'sdds-table--compact': this.compactDesign,
44
- 'sdds-table--divider': this.verticalDividers,
45
- 'sdds-table--no-min-width': this.noMinWidth,
46
- 'sdds-table--on-white-bg': this.whiteBackground,
47
- 'sdds-table--responsive': this.enableResponsive,
48
- } }, h("slot", null))));
49
- }
50
- static get is() { return "sdds-table"; }
51
- static get encapsulation() { return "shadow"; }
52
- static get originalStyleUrls() {
53
- return {
54
- "$": ["table.scss"]
55
- };
56
- }
57
- static get styleUrls() {
58
- return {
59
- "$": ["table.css"]
60
- };
61
- }
62
- static get properties() {
63
- return {
64
- "verticalDividers": {
65
- "type": "boolean",
66
- "mutable": false,
67
- "complexType": {
68
- "original": "boolean",
69
- "resolved": "boolean",
70
- "references": {}
71
- },
72
- "required": false,
73
- "optional": false,
74
- "docs": {
75
- "tags": [],
76
- "text": "Enables style with vertical dividers between columns"
77
- },
78
- "attribute": "vertical-dividers",
79
- "reflect": true,
80
- "defaultValue": "false"
81
- },
82
- "compactDesign": {
83
- "type": "boolean",
84
- "mutable": false,
85
- "complexType": {
86
- "original": "boolean",
87
- "resolved": "boolean",
88
- "references": {}
89
- },
90
- "required": false,
91
- "optional": false,
92
- "docs": {
93
- "tags": [],
94
- "text": "Enables style where data-table toolbar, rows and footer are less high"
95
- },
96
- "attribute": "compact-design",
97
- "reflect": true,
98
- "defaultValue": "false"
99
- },
100
- "noMinWidth": {
101
- "type": "boolean",
102
- "mutable": false,
103
- "complexType": {
104
- "original": "boolean",
105
- "resolved": "boolean",
106
- "references": {}
107
- },
108
- "required": false,
109
- "optional": false,
110
- "docs": {
111
- "tags": [],
112
- "text": "Enables to customise width on data-table columns"
113
- },
114
- "attribute": "no-min-width",
115
- "reflect": true
116
- },
117
- "whiteBackground": {
118
- "type": "boolean",
119
- "mutable": false,
120
- "complexType": {
121
- "original": "boolean",
122
- "resolved": "boolean",
123
- "references": {}
124
- },
125
- "required": false,
126
- "optional": false,
127
- "docs": {
128
- "tags": [],
129
- "text": "Changes a colors of data data-table when used on white background"
130
- },
131
- "attribute": "white-background",
132
- "reflect": true,
133
- "defaultValue": "false"
134
- },
135
- "enableMultiselect": {
136
- "type": "boolean",
137
- "mutable": false,
138
- "complexType": {
139
- "original": "boolean",
140
- "resolved": "boolean",
141
- "references": {}
142
- },
143
- "required": false,
144
- "optional": false,
145
- "docs": {
146
- "tags": [],
147
- "text": "Enables multiselect feature of data-table"
148
- },
149
- "attribute": "enable-multiselect",
150
- "reflect": true,
151
- "defaultValue": "false"
152
- },
153
- "enableExpandableRows": {
154
- "type": "boolean",
155
- "mutable": false,
156
- "complexType": {
157
- "original": "boolean",
158
- "resolved": "boolean",
159
- "references": {}
160
- },
161
- "required": false,
162
- "optional": false,
163
- "docs": {
164
- "tags": [],
165
- "text": "Enables extended row feature of data-table"
166
- },
167
- "attribute": "enable-expandable-rows",
168
- "reflect": true,
169
- "defaultValue": "false"
170
- },
171
- "enableResponsive": {
172
- "type": "boolean",
173
- "mutable": false,
174
- "complexType": {
175
- "original": "boolean",
176
- "resolved": "boolean",
177
- "references": {}
178
- },
179
- "required": false,
180
- "optional": false,
181
- "docs": {
182
- "tags": [],
183
- "text": "Enables table to take 100% available width with equal spacing of columns"
184
- },
185
- "attribute": "enable-responsive",
186
- "reflect": true,
187
- "defaultValue": "false"
188
- },
189
- "tableId": {
190
- "type": "string",
191
- "mutable": false,
192
- "complexType": {
193
- "original": "string",
194
- "resolved": "string",
195
- "references": {}
196
- },
197
- "required": false,
198
- "optional": false,
199
- "docs": {
200
- "tags": [],
201
- "text": "ID used for internal table functionality and events, must be unique.\n\n**NOTE**: If you're listening for table events you need to set this ID yourself to identify the table, as the default ID is random and will be different every time."
202
- },
203
- "attribute": "table-id",
204
- "reflect": false,
205
- "defaultValue": "crypto.randomUUID()"
206
- }
207
- };
208
- }
209
- static get events() {
210
- return [{
211
- "method": "tablePropsChangedEvent",
212
- "name": "tablePropsChangedEvent",
213
- "bubbles": true,
214
- "cancelable": true,
215
- "composed": true,
216
- "docs": {
217
- "tags": [],
218
- "text": "Broadcasts changes to the tables props"
219
- },
220
- "complexType": {
221
- "original": "TablePropsChangedEvent",
222
- "resolved": "{ tableId: string; changed: (keyof Props)[]; } & Partial<Props>",
223
- "references": {
224
- "TablePropsChangedEvent": {
225
- "location": "local"
226
- }
227
- }
228
- }
229
- }];
230
- }
231
- static get elementRef() { return "host"; }
232
- static get watchers() {
233
- return [{
234
- "propName": "enableMultiselect",
235
- "methodName": "enableMultiselectChanged"
236
- }, {
237
- "propName": "enableExpandableRows",
238
- "methodName": "enableExpandableRowsChanged"
239
- }, {
240
- "propName": "compactDesign",
241
- "methodName": "compactDesignChanged"
242
- }, {
243
- "propName": "verticalDividers",
244
- "methodName": "verticalDividersChanged"
245
- }, {
246
- "propName": "noMinWidth",
247
- "methodName": "noMinWidthChanged"
248
- }, {
249
- "propName": "whiteBackground",
250
- "methodName": "whiteBackgroundChanged"
251
- }];
252
- }
253
- }
@@ -1,22 +0,0 @@
1
- :host,
2
- sdds-table-body {
3
- box-sizing: border-box;
4
- display: table-row-group;
5
- }
6
- :host *,
7
- sdds-table-body * {
8
- box-sizing: border-box;
9
- }
10
- :host .sdds-table__info-message,
11
- sdds-table-body .sdds-table__info-message {
12
- font: var(--sdds-detail-02);
13
- letter-spacing: var(--sdds-detail-02-ls);
14
- display: table-cell;
15
- box-sizing: border-box;
16
- color: var(--sdds-grey-958);
17
- padding: var(--sdds-spacing-element-16);
18
- min-width: 192px;
19
- vertical-align: top;
20
- background-color: transparent;
21
- transition: background-color 200ms ease;
22
- }
@@ -1,425 +0,0 @@
1
- import { h, Host, } from '@stencil/core';
2
- import dummyData from './dummy-data.json';
3
- const relevantTableProps = [
4
- 'enableMultiselect',
5
- 'enableExpandableRows',
6
- ];
7
- export class TableBody {
8
- constructor() {
9
- this.uncheckAll = () => {
10
- this.mainCheckboxStatus = false;
11
- this.updateMainCheckboxEvent.emit([this.tableId, this.mainCheckboxStatus]);
12
- this.updateBodyCheckboxesEvent.emit([this.tableId, this.mainCheckboxStatus]);
13
- };
14
- this.selectedDataExporter = () => {
15
- const selectedRows = this.host.getElementsByClassName('sdds-table__row--selected');
16
- this.multiselectArray = [];
17
- for (let j = 0; j < selectedRows.length; j++) {
18
- const rowCells = selectedRows[j].getElementsByTagName('sdds-body-cell');
19
- const selectedObject = {};
20
- for (let i = 0; i < rowCells.length; i++) {
21
- const currentCellKey = rowCells[i].getAttribute('cell-key');
22
- const currentCellValue = rowCells[i].getAttribute('cell-value');
23
- selectedObject[currentCellKey] = currentCellValue;
24
- }
25
- this.multiselectArray.push(selectedObject);
26
- }
27
- this.multiselectArrayJSON = JSON.stringify(this.multiselectArray);
28
- };
29
- this.bodyCheckBoxClicked = () => {
30
- const numberOfRows = this.host.getElementsByClassName('sdds-table__row').length;
31
- const numberOfRowsSelected = this.host.getElementsByClassName('sdds-table__row--selected').length;
32
- this.mainCheckboxStatus = numberOfRows === numberOfRowsSelected;
33
- this.updateMainCheckboxEvent.emit([this.tableId, this.mainCheckboxStatus]);
34
- this.selectedDataExporter();
35
- };
36
- this.disableFilteringFunction = false;
37
- this.disableSortingFunction = false;
38
- this.bodyData = undefined;
39
- this.enableDummyData = false;
40
- this.dummyData = JSON.stringify(dummyData);
41
- this.rowsPerPage = 1;
42
- this.enableMultiselect = false;
43
- this.enablePaginationTableBody = false;
44
- this.enableExpandableRows = true;
45
- this.innerBodyData = [];
46
- this.bodyDataManipulated = [];
47
- this.bodyDataOriginal = [];
48
- this.multiselectArray = [];
49
- this.multiselectArrayJSON = undefined;
50
- this.mainCheckboxStatus = false;
51
- this.columnsNumber = 0;
52
- this.disableAllSorting = false;
53
- this.numberOfPages = 0;
54
- this.paginationValue = 1;
55
- this.tempPaginationDisable = false;
56
- this.showNoResultsMessage = false;
57
- this.tableId = '';
58
- }
59
- arrayDataWatcher(newValue) {
60
- if (typeof newValue === 'string') {
61
- this.innerBodyData = JSON.parse(newValue);
62
- }
63
- else {
64
- this.innerBodyData = newValue;
65
- }
66
- this.bodyDataManipulated = [...this.innerBodyData];
67
- this.bodyDataOriginal = [...this.innerBodyData];
68
- }
69
- tablePropsChangedEventListener(event) {
70
- if (this.tableId === event.detail.tableId) {
71
- event.detail.changed
72
- .filter((changedProp) => relevantTableProps.includes(changedProp))
73
- .forEach((changedProp) => {
74
- if (typeof this[changedProp] === 'undefined') {
75
- throw new Error(`Table prop is not supported: ${changedProp}`);
76
- }
77
- this[changedProp] = event.detail[changedProp];
78
- });
79
- }
80
- }
81
- static compareValues(key, order = 'asc') {
82
- return function innerSort(a, b) {
83
- // eslint-disable-next-line no-prototype-builtins
84
- if (!a.hasOwnProperty(key) || !b.hasOwnProperty(key)) {
85
- // property doesn't exist on either object
86
- return 0;
87
- }
88
- const varA = typeof a[key] === 'string' ? a[key].toUpperCase() : a[key];
89
- const varB = typeof b[key] === 'string' ? b[key].toUpperCase() : b[key];
90
- let comparison = 0;
91
- if (varA > varB) {
92
- comparison = 1;
93
- }
94
- else if (varA < varB) {
95
- comparison = -1;
96
- }
97
- return order === 'desc' ? comparison * -1 : comparison;
98
- };
99
- }
100
- sortData(keyValue, sortingDirection) {
101
- if (!this.disableSortingFunction) {
102
- if (this.enableMultiselect) {
103
- // Uncheck all checkboxes as state of checkbox is lost on sorting. Do it only in case multiSelect is True.
104
- this.uncheckAll();
105
- }
106
- // use spread operator to make enable sorting and modifying array, same as using .slice()
107
- this.bodyDataManipulated = [...this.bodyDataManipulated];
108
- this.bodyDataManipulated.sort(TableBody.compareValues(keyValue, sortingDirection));
109
- }
110
- }
111
- // Listen to sortColumnData from data-table-header-element
112
- updateOptionsContent(event) {
113
- const [receivedID, receivedKeyValue, receivedSortingDirection] = event.detail;
114
- if (this.tableId === receivedID) {
115
- this.sortData(receivedKeyValue, receivedSortingDirection);
116
- }
117
- }
118
- headCheckboxListener(event) {
119
- if (this.tableId === event.detail[0]) {
120
- [, this.mainCheckboxStatus] = event.detail;
121
- this.selectedDataExporter();
122
- }
123
- }
124
- // No need to read the value, event is here just to trigger another function
125
- bodyCheckboxListener() {
126
- this.bodyCheckBoxClicked();
127
- }
128
- searchFunction(searchTerm) {
129
- if (!this.disableFilteringFunction) {
130
- /*
131
- // Logic for filtering JSON data on all columns
132
- // Really nice solution, do not delete, might be needed in future
133
- // Reason to go with upper one is not to lose selected state on checkboxes
134
- if (searchTerm.length > 0) {
135
- this.bodyDataManipulated = this.bodyDataOriginal.filter((option) =>
136
- Object.keys(option).some(
137
- (key) =>
138
- String(option[key] ?? '')
139
- .toLowerCase()
140
- .indexOf(searchTerm) >= 0
141
- )
142
- );
143
- } else {
144
- this.bodyDataManipulated = this.bodyDataOriginal;
145
- }
146
- */
147
- // grab all rows in body
148
- const dataRowsFiltering = this.host.querySelectorAll('sdds-table-body-row');
149
- if (searchTerm.length > 0) {
150
- if (this.enablePaginationTableBody) {
151
- this.tempPaginationDisable = true;
152
- }
153
- dataRowsFiltering.forEach((item) => {
154
- const cells = item.querySelectorAll('sdds-body-cell');
155
- const cellValuesArray = [];
156
- // go through cells and save cell-values in array
157
- cells.forEach((cellItem) => {
158
- const cellValue = cellItem.getAttribute('cell-value').toLowerCase();
159
- cellValuesArray.push(cellValue);
160
- });
161
- // iterate over array of values and see if one matches search string
162
- const matchCounter = cellValuesArray.find((element) => element.includes(searchTerm));
163
- // if matches, show parent row, otherwise hide the row
164
- if (matchCounter) {
165
- item.classList.remove('sdds-table__row--hidden');
166
- }
167
- else {
168
- item.classList.add('sdds-table__row--hidden');
169
- }
170
- });
171
- this.disableAllSorting = true;
172
- this.sortingSwitcherEvent.emit([this.tableId, this.disableAllSorting]);
173
- const dataRowsHidden = this.host.querySelectorAll('.sdds-table__row--hidden');
174
- // If same, info message will be shown
175
- this.showNoResultsMessage = dataRowsHidden.length === dataRowsFiltering.length;
176
- }
177
- else {
178
- if (this.enablePaginationTableBody) {
179
- this.tempPaginationDisable = false;
180
- }
181
- // Check if pagination is ON in order to prevent showing all rows
182
- if (this.enablePaginationTableBody) {
183
- // TODO: EMIT PAGINATION
184
- }
185
- else {
186
- dataRowsFiltering.forEach((item) => {
187
- item.classList.remove('sdds-table__row--hidden');
188
- });
189
- }
190
- this.disableAllSorting = false;
191
- this.sortingSwitcherEvent.emit([this.tableId, this.disableAllSorting]);
192
- }
193
- }
194
- }
195
- // Listen to tableFilteringTerm from tableToolbar component
196
- tableFilteringTermListener(event) {
197
- if (this.tableId === event.detail[0]) {
198
- this.searchFunction(event.detail[1]);
199
- }
200
- }
201
- connectedCallback() {
202
- this.tableEl = this.host.closest('sdds-table');
203
- this.tableId = this.tableEl.tableId;
204
- }
205
- componentWillLoad() {
206
- relevantTableProps.forEach((tablePropName) => {
207
- this[tablePropName] = this.tableEl[tablePropName];
208
- });
209
- if (this.enableDummyData) {
210
- this.bodyData = this.dummyData;
211
- }
212
- else if (this.bodyData) {
213
- this.arrayDataWatcher(this.bodyData);
214
- }
215
- }
216
- componentWillRender() {
217
- const headerColumnsNo = this.host.parentElement.querySelector('sdds-table-header').children.length;
218
- // multiselect and expended features requires one extra column for controls...
219
- if (this.enableMultiselect || this.enableExpandableRows) {
220
- this.columnsNumber = headerColumnsNo + 1;
221
- }
222
- else {
223
- this.columnsNumber = headerColumnsNo;
224
- }
225
- }
226
- render() {
227
- return (h(Host, { "data-selected-rows": this.multiselectArrayJSON }, this.bodyDataManipulated.map((row) => (h("sdds-table-body-row", null, Object.keys(row).map((cellData) => (h("sdds-body-cell", { "cell-key": cellData, "cell-value": row[cellData] })))))), this.showNoResultsMessage && (h("tr", null, h("td", { class: "sdds-table__info-message", colSpan: this.columnsNumber }, "Unfortunately, no data matches your search term \uD83D\uDE15"))), h("slot", null)));
228
- }
229
- static get is() { return "sdds-table-body"; }
230
- static get originalStyleUrls() {
231
- return {
232
- "$": ["table-body.scss"]
233
- };
234
- }
235
- static get styleUrls() {
236
- return {
237
- "$": ["table-body.css"]
238
- };
239
- }
240
- static get properties() {
241
- return {
242
- "disableFilteringFunction": {
243
- "type": "boolean",
244
- "mutable": false,
245
- "complexType": {
246
- "original": "boolean",
247
- "resolved": "boolean",
248
- "references": {}
249
- },
250
- "required": false,
251
- "optional": false,
252
- "docs": {
253
- "tags": [],
254
- "text": "Disables inbuilt filtering logic, leaving user an option to create own filter functionality while listening to events from sdds-table-toolbar component for search term"
255
- },
256
- "attribute": "disable-filtering-function",
257
- "reflect": false,
258
- "defaultValue": "false"
259
- },
260
- "disableSortingFunction": {
261
- "type": "boolean",
262
- "mutable": false,
263
- "complexType": {
264
- "original": "boolean",
265
- "resolved": "boolean",
266
- "references": {}
267
- },
268
- "required": false,
269
- "optional": false,
270
- "docs": {
271
- "tags": [],
272
- "text": "Disables inbuilt sorting logic, leaving user an option to create own sorting functionality while listening to events from sdds-header-cell component for sorting"
273
- },
274
- "attribute": "disable-sorting-function",
275
- "reflect": false,
276
- "defaultValue": "false"
277
- },
278
- "bodyData": {
279
- "type": "any",
280
- "mutable": false,
281
- "complexType": {
282
- "original": "any",
283
- "resolved": "any",
284
- "references": {}
285
- },
286
- "required": false,
287
- "optional": false,
288
- "docs": {
289
- "tags": [],
290
- "text": "Prop to pass JSON string which enables automatic rendering of table rows and cells"
291
- },
292
- "attribute": "body-data",
293
- "reflect": false
294
- },
295
- "enableDummyData": {
296
- "type": "boolean",
297
- "mutable": false,
298
- "complexType": {
299
- "original": "boolean",
300
- "resolved": "boolean",
301
- "references": {}
302
- },
303
- "required": false,
304
- "optional": false,
305
- "docs": {
306
- "tags": [],
307
- "text": "Prop for showcase of rendering JSON in body-data, just for presentation purposes"
308
- },
309
- "attribute": "enable-dummy-data",
310
- "reflect": false,
311
- "defaultValue": "false"
312
- }
313
- };
314
- }
315
- static get states() {
316
- return {
317
- "dummyData": {},
318
- "rowsPerPage": {},
319
- "enableMultiselect": {},
320
- "enablePaginationTableBody": {},
321
- "enableExpandableRows": {},
322
- "innerBodyData": {},
323
- "bodyDataManipulated": {},
324
- "bodyDataOriginal": {},
325
- "multiselectArray": {},
326
- "multiselectArrayJSON": {},
327
- "mainCheckboxStatus": {},
328
- "columnsNumber": {},
329
- "disableAllSorting": {},
330
- "numberOfPages": {},
331
- "paginationValue": {},
332
- "tempPaginationDisable": {},
333
- "showNoResultsMessage": {},
334
- "tableId": {}
335
- };
336
- }
337
- static get events() {
338
- return [{
339
- "method": "sortingSwitcherEvent",
340
- "name": "sortingSwitcherEvent",
341
- "bubbles": true,
342
- "cancelable": true,
343
- "composed": true,
344
- "docs": {
345
- "tags": [],
346
- "text": "Event that sends unique table identifier and enable/disable status for sorting functionality"
347
- },
348
- "complexType": {
349
- "original": "any",
350
- "resolved": "any",
351
- "references": {}
352
- }
353
- }, {
354
- "method": "updateBodyCheckboxesEvent",
355
- "name": "updateBodyCheckboxesEvent",
356
- "bubbles": true,
357
- "cancelable": true,
358
- "composed": true,
359
- "docs": {
360
- "tags": [],
361
- "text": "Sends unique table identifier and mainCheckbox status to all rows when multiselect feature is enabled"
362
- },
363
- "complexType": {
364
- "original": "any",
365
- "resolved": "any",
366
- "references": {}
367
- }
368
- }, {
369
- "method": "updateMainCheckboxEvent",
370
- "name": "updateMainCheckboxEvent",
371
- "bubbles": true,
372
- "cancelable": true,
373
- "composed": true,
374
- "docs": {
375
- "tags": [],
376
- "text": "Sends unique table identifier and status if mainCheckbox should change its state based on selection status of single rows when multiselect feature is used"
377
- },
378
- "complexType": {
379
- "original": "any",
380
- "resolved": "any",
381
- "references": {}
382
- }
383
- }];
384
- }
385
- static get elementRef() { return "host"; }
386
- static get watchers() {
387
- return [{
388
- "propName": "bodyData",
389
- "methodName": "arrayDataWatcher"
390
- }];
391
- }
392
- static get listeners() {
393
- return [{
394
- "name": "tablePropsChangedEvent",
395
- "method": "tablePropsChangedEventListener",
396
- "target": "body",
397
- "capture": false,
398
- "passive": false
399
- }, {
400
- "name": "sortColumnDataEvent",
401
- "method": "updateOptionsContent",
402
- "target": "body",
403
- "capture": false,
404
- "passive": false
405
- }, {
406
- "name": "mainCheckboxSelectedEvent",
407
- "method": "headCheckboxListener",
408
- "target": "body",
409
- "capture": false,
410
- "passive": false
411
- }, {
412
- "name": "bodyRowToTable",
413
- "method": "bodyCheckboxListener",
414
- "target": "body",
415
- "capture": false,
416
- "passive": false
417
- }, {
418
- "name": "tableFilteringTerm",
419
- "method": "tableFilteringTermListener",
420
- "target": "body",
421
- "capture": false,
422
- "passive": false
423
- }];
424
- }
425
- }