@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,355 +0,0 @@
1
- import { h, Host, } from '@stencil/core';
2
- const relevantTableProps = [
3
- 'compactDesign',
4
- 'noMinWidth',
5
- 'verticalDividers',
6
- 'whiteBackground',
7
- ];
8
- function removeShakeAnimation(e) {
9
- e.target.classList.remove('sdds-table__page-selector-input--shake');
10
- }
11
- export class TableFooter {
12
- constructor() {
13
- this.paginationPrev = (event) => {
14
- event.preventDefault();
15
- // Enable lowering until 1st page
16
- if (this.paginationValue >= 2) {
17
- this.paginationValue--;
18
- this.runPagination();
19
- }
20
- };
21
- this.paginationNext = (event) => {
22
- event.preventDefault();
23
- // Enable increasing until the max number of pages
24
- if (this.paginationValue <= this.numberOfPages) {
25
- this.paginationValue++;
26
- this.runPagination();
27
- }
28
- };
29
- this.runPagination = () => {
30
- if (!this.disablePaginationFunction) {
31
- // grab all rows in body
32
- const dataRowsPagination = this.host.parentNode
33
- .querySelector('sdds-table-body')
34
- .querySelectorAll('.sdds-table__row');
35
- dataRowsPagination.forEach((item, i) => {
36
- // for making logic easier 1st result, 2nd result...
37
- const index = i + 1;
38
- if (this.tempPaginationDisable) {
39
- this.paginationValue = 1;
40
- }
41
- else {
42
- const lastResult = this.rowsPerPage * this.paginationValue;
43
- const firstResult = lastResult - this.rowsPerPage;
44
- if (index > firstResult && index <= lastResult) {
45
- item.classList.remove('sdds-table__row--hidden');
46
- }
47
- else {
48
- item.classList.add('sdds-table__row--hidden');
49
- }
50
- }
51
- });
52
- }
53
- };
54
- this.clientPaginationPrev = (event) => {
55
- event.preventDefault();
56
- // Enable lowering until 1st page
57
- if (this.clientPaginationValue >= 2) {
58
- this.clientPaginationValue--;
59
- this.sendPaginationValue(this.clientPaginationValue);
60
- }
61
- };
62
- this.clientPaginationNext = (event) => {
63
- event.preventDefault();
64
- // Enable increasing until the max number of pages
65
- if (this.clientPaginationValue <= this.clientMaxPages) {
66
- this.clientPaginationValue++;
67
- this.sendPaginationValue(this.clientPaginationValue);
68
- }
69
- };
70
- this.enablePagination = false;
71
- this.rowsPerPage = 5;
72
- this.enableClientPagination = false;
73
- this.clientPaginationValue = 1;
74
- this.clientMaxPages = 1;
75
- this.clientSetColumnsNumber = null;
76
- this.disablePaginationFunction = false;
77
- this.columnsNumber = 0;
78
- this.numberOfPages = 0;
79
- this.paginationValue = 1;
80
- this.tempPaginationDisable = false;
81
- this.verticalDividers = false;
82
- this.compactDesign = false;
83
- this.noMinWidth = false;
84
- this.whiteBackground = false;
85
- this.tableId = '';
86
- }
87
- tablePropsChangedEventListener(event) {
88
- if (this.tableId === event.detail.tableId) {
89
- event.detail.changed
90
- .filter((changedProp) => relevantTableProps.includes(changedProp))
91
- .forEach((changedProp) => {
92
- if (typeof this[changedProp] === 'undefined') {
93
- throw new Error(`Table prop is not supported: ${changedProp}`);
94
- }
95
- this[changedProp] = event.detail[changedProp];
96
- });
97
- }
98
- }
99
- connectedCallback() {
100
- this.tableEl = this.host.closest('sdds-table');
101
- this.tableId = this.tableEl.tableId;
102
- }
103
- componentWillLoad() {
104
- relevantTableProps.forEach((tablePropName) => {
105
- this[tablePropName] = this.tableEl[tablePropName];
106
- });
107
- const numberOfRows = this.host.parentElement.querySelector('sdds-table-body').childElementCount;
108
- const numberOfColumns = this.host.parentElement.querySelector('sdds-table-header').childElementCount;
109
- this.numberOfPages = Math.ceil(numberOfRows / this.rowsPerPage);
110
- if (this.clientSetColumnsNumber !== null) {
111
- this.columnsNumber = this.clientSetColumnsNumber;
112
- }
113
- else {
114
- this.columnsNumber = numberOfColumns;
115
- }
116
- this.enablePaginationEvent.emit(this.tableId);
117
- }
118
- paginationInputChange(event) {
119
- const insertedValue = event.target.value;
120
- if (insertedValue > this.numberOfPages || insertedValue < 1) {
121
- event.target.classList.add('sdds-table__page-selector-input--shake');
122
- this.paginationValue = event.target.max;
123
- }
124
- else {
125
- this.paginationValue = event.target.value;
126
- }
127
- this.runPagination();
128
- }
129
- runPaginationEventListener(event) {
130
- if (this.tableId === event.detail) {
131
- this.runPagination();
132
- }
133
- }
134
- sendPaginationValue(value) {
135
- this.currentPageValueEvent.emit([this.tableId, value]);
136
- }
137
- clientPaginationInputChange(event) {
138
- const insertedValue = event.target.value;
139
- if (insertedValue > this.clientMaxPages || insertedValue < 1) {
140
- event.target.classList.add('sdds-table__page-selector-input--shake');
141
- this.clientPaginationValue = event.target.max;
142
- }
143
- else {
144
- this.clientPaginationValue = event.target.value;
145
- }
146
- this.sendPaginationValue(this.clientPaginationValue);
147
- }
148
- render() {
149
- return (h(Host, { class: this.compactDesign ? 'sdds-table--compact' : '' }, h("tr", { class: "sdds-table__footer-row" }, h("td", { class: "sdds-table__footer-cell", colSpan: this.columnsNumber }, this.enablePagination && !this.enableClientPagination && (h("div", { class: "sdds-table__pagination" }, h("div", { class: "sdds-table__row-selector" }), h("div", { class: "sdds-table__page-selector" }, h("input", { class: "sdds-table__page-selector-input", type: "number", min: "1", max: this.numberOfPages, value: this.paginationValue, pattern: "[0-9]+", dir: "rtl", onChange: (event) => this.paginationInputChange(event), onFocusout: (event) => this.paginationInputChange(event), onAnimationEnd: removeShakeAnimation, disabled: this.tempPaginationDisable }), h("p", { class: "sdds-table__footer-text" }, "of ", h("span", null, this.tempPaginationDisable ? 1 : this.numberOfPages), " pages"), h("button", { class: "sdds-table__footer-btn", disabled: this.paginationValue <= 1 || this.tempPaginationDisable, onClick: (event) => this.paginationPrev(event) }, h("svg", { class: "sdds-table__footer-btn-svg", fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M22.217 4.273a1 1 0 0 1 0 1.415l-9.888 9.888a.6.6 0 0 0 0 .848l9.888 9.888a1 1 0 0 1-1.414 1.415l-9.889-9.889a2.6 2.6 0 0 1 0-3.677l9.889-9.888a1 1 0 0 1 1.414 0Z", fill: "currentColor" }))), h("button", { class: "sdds-table__footer-btn", disabled: this.paginationValue >= this.numberOfPages || this.tempPaginationDisable, onClick: (event) => this.paginationNext(event) }, h("svg", { class: "sdds-table__footer-btn-svg", fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M9.783 27.727a1 1 0 0 1 0-1.415l9.888-9.888a.6.6 0 0 0 0-.848L9.783 5.688a1 1 0 0 1 1.414-1.415l9.889 9.889a2.6 2.6 0 0 1 0 3.676l-9.889 9.889a1 1 0 0 1-1.414 0Z", fill: "currentColor" })))))), this.enableClientPagination && !this.enablePagination && (h("div", { class: "sdds-table__pagination" }, h("div", { class: "sdds-table__row-selector" }), h("div", { class: "sdds-table__page-selector" }, h("input", { class: "sdds-table__page-selector-input", type: "number", min: "1", max: this.clientMaxPages, value: this.clientPaginationValue, pattern: "[0-9]+", dir: "rtl", onChange: (event) => this.clientPaginationInputChange(event), onFocusout: (event) => this.clientPaginationInputChange(event), onAnimationEnd: removeShakeAnimation }), h("p", { class: "sdds-table__footer-text" }, "of ", h("span", null, this.clientMaxPages), " pages"), h("button", { class: "sdds-table__footer-btn", disabled: this.clientPaginationValue <= 1, onClick: (event) => this.clientPaginationPrev(event) }, h("svg", { class: "sdds-table__footer-btn-svg", fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M22.217 4.273a1 1 0 0 1 0 1.415l-9.888 9.888a.6.6 0 0 0 0 .848l9.888 9.888a1 1 0 0 1-1.414 1.415l-9.889-9.889a2.6 2.6 0 0 1 0-3.677l9.889-9.888a1 1 0 0 1 1.414 0Z", fill: "currentColor" }))), h("button", { class: "sdds-table__footer-btn", disabled: this.clientPaginationValue >= this.clientMaxPages, onClick: (event) => this.clientPaginationNext(event) }, h("svg", { class: "sdds-table__footer-btn-svg", fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M9.783 27.727a1 1 0 0 1 0-1.415l9.888-9.888a.6.6 0 0 0 0-.848L9.783 5.688a1 1 0 0 1 1.414-1.415l9.889 9.889a2.6 2.6 0 0 1 0 3.676l-9.889 9.889a1 1 0 0 1-1.414 0Z", fill: "currentColor" }))))))))));
150
- }
151
- static get is() { return "sdds-table-footer"; }
152
- static get encapsulation() { return "shadow"; }
153
- static get originalStyleUrls() {
154
- return {
155
- "$": ["table-footer.scss"]
156
- };
157
- }
158
- static get styleUrls() {
159
- return {
160
- "$": ["table-footer.css"]
161
- };
162
- }
163
- static get properties() {
164
- return {
165
- "enablePagination": {
166
- "type": "boolean",
167
- "mutable": false,
168
- "complexType": {
169
- "original": "boolean",
170
- "resolved": "boolean",
171
- "references": {}
172
- },
173
- "required": false,
174
- "optional": false,
175
- "docs": {
176
- "tags": [],
177
- "text": "Enable pagination and show pagination controls"
178
- },
179
- "attribute": "enable-pagination",
180
- "reflect": true,
181
- "defaultValue": "false"
182
- },
183
- "rowsPerPage": {
184
- "type": "number",
185
- "mutable": false,
186
- "complexType": {
187
- "original": "number",
188
- "resolved": "number",
189
- "references": {}
190
- },
191
- "required": false,
192
- "optional": false,
193
- "docs": {
194
- "tags": [],
195
- "text": "Sets how many rows to display when pagination is enabled"
196
- },
197
- "attribute": "rows-per-page",
198
- "reflect": true,
199
- "defaultValue": "5"
200
- },
201
- "enableClientPagination": {
202
- "type": "boolean",
203
- "mutable": false,
204
- "complexType": {
205
- "original": "boolean",
206
- "resolved": "boolean",
207
- "references": {}
208
- },
209
- "required": false,
210
- "optional": false,
211
- "docs": {
212
- "tags": [],
213
- "text": "Prop to enable client controlled pagination"
214
- },
215
- "attribute": "enable-client-pagination",
216
- "reflect": true,
217
- "defaultValue": "false"
218
- },
219
- "clientPaginationValue": {
220
- "type": "number",
221
- "mutable": false,
222
- "complexType": {
223
- "original": "number",
224
- "resolved": "number",
225
- "references": {}
226
- },
227
- "required": false,
228
- "optional": false,
229
- "docs": {
230
- "tags": [],
231
- "text": "Prop for client to set current page number"
232
- },
233
- "attribute": "client-pagination-value",
234
- "reflect": true,
235
- "defaultValue": "1"
236
- },
237
- "clientMaxPages": {
238
- "type": "number",
239
- "mutable": false,
240
- "complexType": {
241
- "original": "number",
242
- "resolved": "number",
243
- "references": {}
244
- },
245
- "required": false,
246
- "optional": false,
247
- "docs": {
248
- "tags": [],
249
- "text": "Prop for client to set max number of pages"
250
- },
251
- "attribute": "client-max-pages",
252
- "reflect": true,
253
- "defaultValue": "1"
254
- },
255
- "clientSetColumnsNumber": {
256
- "type": "number",
257
- "mutable": false,
258
- "complexType": {
259
- "original": "number",
260
- "resolved": "number",
261
- "references": {}
262
- },
263
- "required": false,
264
- "optional": false,
265
- "docs": {
266
- "tags": [],
267
- "text": "In case that automatic count of columns does not work, user can manually set this one. Take in mind that expandable control is column too"
268
- },
269
- "attribute": "client-set-columns-number",
270
- "reflect": false,
271
- "defaultValue": "null"
272
- },
273
- "disablePaginationFunction": {
274
- "type": "boolean",
275
- "mutable": false,
276
- "complexType": {
277
- "original": "boolean",
278
- "resolved": "boolean",
279
- "references": {}
280
- },
281
- "required": false,
282
- "optional": false,
283
- "docs": {
284
- "tags": [],
285
- "text": "Disables inbuilt pagination logic, leaving user an option to create own pagination functionality while listening to events from sdds-table-footer component"
286
- },
287
- "attribute": "disable-pagination-function",
288
- "reflect": false,
289
- "defaultValue": "false"
290
- }
291
- };
292
- }
293
- static get states() {
294
- return {
295
- "columnsNumber": {},
296
- "numberOfPages": {},
297
- "paginationValue": {},
298
- "tempPaginationDisable": {},
299
- "verticalDividers": {},
300
- "compactDesign": {},
301
- "noMinWidth": {},
302
- "whiteBackground": {},
303
- "tableId": {}
304
- };
305
- }
306
- static get events() {
307
- return [{
308
- "method": "enablePaginationEvent",
309
- "name": "enablePaginationEvent",
310
- "bubbles": true,
311
- "cancelable": true,
312
- "composed": true,
313
- "docs": {
314
- "tags": [],
315
- "text": "Event that footer sends out in order to receive other necessary information from other subcomponents"
316
- },
317
- "complexType": {
318
- "original": "any",
319
- "resolved": "any",
320
- "references": {}
321
- }
322
- }, {
323
- "method": "currentPageValueEvent",
324
- "name": "currentPageValueEvent",
325
- "bubbles": true,
326
- "cancelable": true,
327
- "composed": true,
328
- "docs": {
329
- "tags": [],
330
- "text": "Event to send current page value back to sdds-table-body component"
331
- },
332
- "complexType": {
333
- "original": "any",
334
- "resolved": "any",
335
- "references": {}
336
- }
337
- }];
338
- }
339
- static get elementRef() { return "host"; }
340
- static get listeners() {
341
- return [{
342
- "name": "tablePropsChangedEvent",
343
- "method": "tablePropsChangedEventListener",
344
- "target": "body",
345
- "capture": false,
346
- "passive": false
347
- }, {
348
- "name": "runPaginationEvent",
349
- "method": "runPaginationEventListener",
350
- "target": "body",
351
- "capture": false,
352
- "passive": false
353
- }];
354
- }
355
- }
@@ -1,204 +0,0 @@
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 {
137
- box-sizing: border-box;
138
- display: table-header-group;
139
- }
140
- :host * {
141
- box-sizing: border-box;
142
- }
143
- :host .sdds-table__header-cell--checkbox {
144
- font: var(--sdds-headline-07);
145
- letter-spacing: var(--sdds-headline-07-ls);
146
- display: table-cell;
147
- text-align: left;
148
- color: var(--sdds-grey-958);
149
- background-color: var(--sdds-grey-300);
150
- border-bottom: 1px solid var(--sdds-grey-400);
151
- height: 48px;
152
- box-sizing: border-box;
153
- overflow: hidden;
154
- transition: background-color 200ms ease;
155
- min-width: unset;
156
- width: 48px;
157
- padding: 0;
158
- border-top-left-radius: 4px;
159
- }
160
- :host .sdds-form-label--data-table {
161
- width: 100%;
162
- height: 48px;
163
- display: flex;
164
- justify-content: center;
165
- align-items: center;
166
- cursor: pointer;
167
- }
168
- :host .sdds-table__expand-control-container {
169
- display: flex;
170
- justify-content: center;
171
- align-items: center;
172
- height: 48px;
173
- cursor: pointer;
174
- }
175
- :host .sdds-table__expand-control-container .sdds-table__expand-input {
176
- display: none;
177
- }
178
- :host .sdds-table__expand-control-container .sdds-expandable-row-icon {
179
- height: 20px;
180
- width: 20px;
181
- transition: transform 200ms ease;
182
- transform: rotate(0);
183
- }
184
- :host .sdds-table__expand-control-container .sdds-expandable-row-icon--opened {
185
- transform: rotate(180deg);
186
- }
187
- :host ::slotted(sdds-header-cell:hover) {
188
- background-color: var(--sdds-grey-400);
189
- }
190
-
191
- :host(.sdds-table--compact) .sdds-table__header-cell--checkbox {
192
- height: 32px;
193
- }
194
- :host(.sdds-table--compact) .sdds-form-label--data-table {
195
- height: 32px;
196
- }
197
-
198
- :host(.sdds-table--divider) .sdds-table__header-cell--checkbox {
199
- border-right: 1px solid var(--sdds-grey-400);
200
- }
201
-
202
- :host(.sdds-table--toolbar-available) .sdds-table__header-cell--checkbox {
203
- border-top-left-radius: 0;
204
- }