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

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