@scania/tegel 0.0.1-beta.7 → 0.0.1-beta.9

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 (281) hide show
  1. package/package.json +1 -1
  2. package/readme.md +7 -8
  3. package/dist/cjs/index-e1c79686.js +0 -1912
  4. package/dist/cjs/index.cjs.js +0 -2
  5. package/dist/cjs/loader.cjs.js +0 -21
  6. package/dist/cjs/popper-11d5f714.js +0 -1801
  7. package/dist/cjs/sdds-accordion-item.cjs.entry.js +0 -34
  8. package/dist/cjs/sdds-accordion.cjs.entry.js +0 -21
  9. package/dist/cjs/sdds-badges.cjs.entry.js +0 -55
  10. package/dist/cjs/sdds-body-cell_2.cjs.entry.js +0 -173
  11. package/dist/cjs/sdds-button.cjs.entry.js +0 -36
  12. package/dist/cjs/sdds-datetime.cjs.entry.js +0 -66
  13. package/dist/cjs/sdds-dropdown-filter.cjs.entry.js +0 -92
  14. package/dist/cjs/sdds-dropdown_2.cjs.entry.js +0 -335
  15. package/dist/cjs/sdds-header-cell.cjs.entry.js +0 -141
  16. package/dist/cjs/sdds-icon.cjs.entry.js +0 -42
  17. package/dist/cjs/sdds-inline-tabs-fullbleed.cjs.entry.js +0 -96
  18. package/dist/cjs/sdds-inline-tabs.cjs.entry.js +0 -211
  19. package/dist/cjs/sdds-modal.cjs.entry.js +0 -49
  20. package/dist/cjs/sdds-navigation-tabs.cjs.entry.js +0 -95
  21. package/dist/cjs/sdds-popover-canvas.cjs.entry.js +0 -76
  22. package/dist/cjs/sdds-popover-menu.cjs.entry.js +0 -75
  23. package/dist/cjs/sdds-slider.cjs.entry.js +0 -336
  24. package/dist/cjs/sdds-spinner.cjs.entry.js +0 -21
  25. package/dist/cjs/sdds-table-body-row-expandable.cjs.entry.js +0 -81
  26. package/dist/cjs/sdds-table-body.cjs.entry.js +0 -289
  27. package/dist/cjs/sdds-table-footer.cjs.entry.js +0 -165
  28. package/dist/cjs/sdds-table-header.cjs.entry.js +0 -100
  29. package/dist/cjs/sdds-table-toolbar.cjs.entry.js +0 -66
  30. package/dist/cjs/sdds-table.cjs.entry.js +0 -69
  31. package/dist/cjs/sdds-textarea.cjs.entry.js +0 -61
  32. package/dist/cjs/sdds-textfield.cjs.entry.js +0 -82
  33. package/dist/cjs/sdds-tooltip.cjs.entry.js +0 -95
  34. package/dist/cjs/tegel.cjs.js +0 -19
  35. package/dist/collection/collection-manifest.json +0 -40
  36. package/dist/collection/components/accordion/accordion-item/accordion-item.css +0 -134
  37. package/dist/collection/components/accordion/accordion-item/accordion-item.js +0 -146
  38. package/dist/collection/components/accordion/accordion.css +0 -77
  39. package/dist/collection/components/accordion/accordion.js +0 -62
  40. package/dist/collection/components/badge/badges.css +0 -42
  41. package/dist/collection/components/badge/badges.js +0 -150
  42. package/dist/collection/components/button/button-component.js +0 -154
  43. package/dist/collection/components/button/button.css +0 -658
  44. package/dist/collection/components/data-table/table/table.css +0 -15
  45. package/dist/collection/components/data-table/table/table.js +0 -253
  46. package/dist/collection/components/data-table/table-body/table-body.css +0 -22
  47. package/dist/collection/components/data-table/table-body/table-body.js +0 -425
  48. package/dist/collection/components/data-table/table-body-cell/table-body-cell.css +0 -40
  49. package/dist/collection/components/data-table/table-body-cell/table-body-cell.js +0 -169
  50. package/dist/collection/components/data-table/table-body-row/table-body-row.css +0 -196
  51. package/dist/collection/components/data-table/table-body-row/table-body-row.js +0 -164
  52. package/dist/collection/components/data-table/table-body-row-expandable/table-body-row-expandable.css +0 -79
  53. package/dist/collection/components/data-table/table-body-row-expandable/table-body-row-expandable.js +0 -155
  54. package/dist/collection/components/data-table/table-footer/table-footer.css +0 -93
  55. package/dist/collection/components/data-table/table-footer/table-footer.js +0 -355
  56. package/dist/collection/components/data-table/table-header/table-header.css +0 -204
  57. package/dist/collection/components/data-table/table-header/table-header.js +0 -153
  58. package/dist/collection/components/data-table/table-header-cell/table-header-cell.css +0 -126
  59. package/dist/collection/components/data-table/table-header-cell/table-header-cell.js +0 -320
  60. package/dist/collection/components/data-table/table-toolbar/table-toolbar.css +0 -92
  61. package/dist/collection/components/data-table/table-toolbar/table-toolbar.js +0 -142
  62. package/dist/collection/components/datetime/datetime.css +0 -375
  63. package/dist/collection/components/datetime/datetime.js +0 -251
  64. package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.js +0 -339
  65. package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +0 -185
  66. package/dist/collection/components/dropdown/dropdown.css +0 -891
  67. package/dist/collection/components/dropdown/dropdown.js +0 -554
  68. package/dist/collection/components/icon/icon.css +0 -16
  69. package/dist/collection/components/icon/icon.js +0 -89
  70. package/dist/collection/components/icon/iconsArray.js +0 -2
  71. package/dist/collection/components/modal/modal.css +0 -324
  72. package/dist/collection/components/modal/modal.js +0 -146
  73. package/dist/collection/components/popover-canvas/popover-canvas.css +0 -20
  74. package/dist/collection/components/popover-canvas/popover-canvas.js +0 -190
  75. package/dist/collection/components/popover-menu/popover-menu.css +0 -19
  76. package/dist/collection/components/popover-menu/popover-menu.js +0 -189
  77. package/dist/collection/components/slider/slider.css +0 -260
  78. package/dist/collection/components/slider/slider.js +0 -682
  79. package/dist/collection/components/spinner/spinner.css +0 -79
  80. package/dist/collection/components/spinner/spinner.js +0 -61
  81. package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.css +0 -159
  82. package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.js +0 -302
  83. package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.css +0 -172
  84. package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.js +0 -126
  85. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.css +0 -153
  86. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +0 -103
  87. package/dist/collection/components/textarea/textarea.css +0 -283
  88. package/dist/collection/components/textarea/textarea.js +0 -336
  89. package/dist/collection/components/textfield/textfield.css +0 -494
  90. package/dist/collection/components/textfield/textfield.js +0 -359
  91. package/dist/collection/components/tooltip/tooltip.css +0 -46
  92. package/dist/collection/components/tooltip/tooltip.js +0 -200
  93. package/dist/collection/index.js +0 -1
  94. package/dist/collection/stories/assets/code-brackets.svg +0 -1
  95. package/dist/collection/stories/assets/colors.svg +0 -1
  96. package/dist/collection/stories/assets/comments.svg +0 -1
  97. package/dist/collection/stories/assets/direction.svg +0 -1
  98. package/dist/collection/stories/assets/flow.svg +0 -1
  99. package/dist/collection/stories/assets/plugin.svg +0 -1
  100. package/dist/collection/stories/assets/repo.svg +0 -1
  101. package/dist/collection/stories/assets/stackalt.svg +0 -1
  102. package/dist/collection/utils/utils.js +0 -12
  103. package/dist/components/dropdown-option.js +0 -100
  104. package/dist/components/dropdown.js +0 -296
  105. package/dist/components/icon.js +0 -58
  106. package/dist/components/index.d.ts +0 -50
  107. package/dist/components/index.js +0 -30
  108. package/dist/components/popper.js +0 -1799
  109. package/dist/components/sdds-accordion-item.d.ts +0 -11
  110. package/dist/components/sdds-accordion-item.js +0 -60
  111. package/dist/components/sdds-accordion.d.ts +0 -11
  112. package/dist/components/sdds-accordion.js +0 -38
  113. package/dist/components/sdds-badges.d.ts +0 -11
  114. package/dist/components/sdds-badges.js +0 -76
  115. package/dist/components/sdds-body-cell.d.ts +0 -11
  116. package/dist/components/sdds-body-cell.js +0 -6
  117. package/dist/components/sdds-button.d.ts +0 -11
  118. package/dist/components/sdds-button.js +0 -58
  119. package/dist/components/sdds-datetime.d.ts +0 -11
  120. package/dist/components/sdds-datetime.js +0 -90
  121. package/dist/components/sdds-dropdown-filter.d.ts +0 -11
  122. package/dist/components/sdds-dropdown-filter.js +0 -138
  123. package/dist/components/sdds-dropdown-option.d.ts +0 -11
  124. package/dist/components/sdds-dropdown-option.js +0 -6
  125. package/dist/components/sdds-dropdown.d.ts +0 -11
  126. package/dist/components/sdds-dropdown.js +0 -6
  127. package/dist/components/sdds-header-cell.d.ts +0 -11
  128. package/dist/components/sdds-header-cell.js +0 -173
  129. package/dist/components/sdds-icon.d.ts +0 -11
  130. package/dist/components/sdds-icon.js +0 -6
  131. package/dist/components/sdds-inline-tabs-fullbleed.d.ts +0 -11
  132. package/dist/components/sdds-inline-tabs-fullbleed.js +0 -115
  133. package/dist/components/sdds-inline-tabs.d.ts +0 -11
  134. package/dist/components/sdds-inline-tabs.js +0 -235
  135. package/dist/components/sdds-modal.d.ts +0 -11
  136. package/dist/components/sdds-modal.js +0 -69
  137. package/dist/components/sdds-navigation-tabs.d.ts +0 -11
  138. package/dist/components/sdds-navigation-tabs.js +0 -113
  139. package/dist/components/sdds-popover-canvas.d.ts +0 -11
  140. package/dist/components/sdds-popover-canvas.js +0 -97
  141. package/dist/components/sdds-popover-menu.d.ts +0 -11
  142. package/dist/components/sdds-popover-menu.js +0 -96
  143. package/dist/components/sdds-slider.d.ts +0 -11
  144. package/dist/components/sdds-slider.js +0 -366
  145. package/dist/components/sdds-spinner.d.ts +0 -11
  146. package/dist/components/sdds-spinner.js +0 -37
  147. package/dist/components/sdds-table-body-row-expandable.d.ts +0 -11
  148. package/dist/components/sdds-table-body-row-expandable.js +0 -104
  149. package/dist/components/sdds-table-body-row.d.ts +0 -11
  150. package/dist/components/sdds-table-body-row.js +0 -6
  151. package/dist/components/sdds-table-body.d.ts +0 -11
  152. package/dist/components/sdds-table-body.js +0 -337
  153. package/dist/components/sdds-table-footer.d.ts +0 -11
  154. package/dist/components/sdds-table-footer.js +0 -196
  155. package/dist/components/sdds-table-header.d.ts +0 -11
  156. package/dist/components/sdds-table-header.js +0 -125
  157. package/dist/components/sdds-table-toolbar.d.ts +0 -11
  158. package/dist/components/sdds-table-toolbar.js +0 -88
  159. package/dist/components/sdds-table.d.ts +0 -11
  160. package/dist/components/sdds-table.js +0 -92
  161. package/dist/components/sdds-textarea.d.ts +0 -11
  162. package/dist/components/sdds-textarea.js +0 -90
  163. package/dist/components/sdds-textfield.d.ts +0 -11
  164. package/dist/components/sdds-textfield.js +0 -111
  165. package/dist/components/sdds-tooltip.d.ts +0 -11
  166. package/dist/components/sdds-tooltip.js +0 -116
  167. package/dist/components/table-body-cell.js +0 -102
  168. package/dist/components/table-body-row.js +0 -119
  169. package/dist/esm/index-b67b15a6.js +0 -1884
  170. package/dist/esm/index.js +0 -1
  171. package/dist/esm/loader.js +0 -17
  172. package/dist/esm/polyfills/core-js.js +0 -11
  173. package/dist/esm/polyfills/css-shim.js +0 -1
  174. package/dist/esm/polyfills/dom.js +0 -79
  175. package/dist/esm/polyfills/es5-html-element.js +0 -1
  176. package/dist/esm/polyfills/index.js +0 -34
  177. package/dist/esm/polyfills/system.js +0 -6
  178. package/dist/esm/popper-f860750c.js +0 -1799
  179. package/dist/esm/sdds-accordion-item.entry.js +0 -30
  180. package/dist/esm/sdds-accordion.entry.js +0 -17
  181. package/dist/esm/sdds-badges.entry.js +0 -51
  182. package/dist/esm/sdds-body-cell_2.entry.js +0 -168
  183. package/dist/esm/sdds-button.entry.js +0 -32
  184. package/dist/esm/sdds-datetime.entry.js +0 -62
  185. package/dist/esm/sdds-dropdown-filter.entry.js +0 -88
  186. package/dist/esm/sdds-dropdown_2.entry.js +0 -330
  187. package/dist/esm/sdds-header-cell.entry.js +0 -137
  188. package/dist/esm/sdds-icon.entry.js +0 -38
  189. package/dist/esm/sdds-inline-tabs-fullbleed.entry.js +0 -92
  190. package/dist/esm/sdds-inline-tabs.entry.js +0 -207
  191. package/dist/esm/sdds-modal.entry.js +0 -45
  192. package/dist/esm/sdds-navigation-tabs.entry.js +0 -91
  193. package/dist/esm/sdds-popover-canvas.entry.js +0 -72
  194. package/dist/esm/sdds-popover-menu.entry.js +0 -71
  195. package/dist/esm/sdds-slider.entry.js +0 -332
  196. package/dist/esm/sdds-spinner.entry.js +0 -17
  197. package/dist/esm/sdds-table-body-row-expandable.entry.js +0 -77
  198. package/dist/esm/sdds-table-body.entry.js +0 -285
  199. package/dist/esm/sdds-table-footer.entry.js +0 -161
  200. package/dist/esm/sdds-table-header.entry.js +0 -96
  201. package/dist/esm/sdds-table-toolbar.entry.js +0 -62
  202. package/dist/esm/sdds-table.entry.js +0 -65
  203. package/dist/esm/sdds-textarea.entry.js +0 -57
  204. package/dist/esm/sdds-textfield.entry.js +0 -78
  205. package/dist/esm/sdds-tooltip.entry.js +0 -91
  206. package/dist/esm/tegel.js +0 -17
  207. package/dist/index.cjs.js +0 -1
  208. package/dist/index.js +0 -1
  209. package/dist/node_modules/@types/jest/index.d.ts +0 -1512
  210. package/dist/tegel/index.esm.js +0 -0
  211. package/dist/tegel/p-040efb32.entry.js +0 -1
  212. package/dist/tegel/p-12ca5cfa.entry.js +0 -1
  213. package/dist/tegel/p-157e1618.js +0 -2
  214. package/dist/tegel/p-1fe61cf6.entry.js +0 -1
  215. package/dist/tegel/p-2f376504.entry.js +0 -1
  216. package/dist/tegel/p-44ced895.entry.js +0 -1
  217. package/dist/tegel/p-4880f03d.entry.js +0 -1
  218. package/dist/tegel/p-4aba73a3.entry.js +0 -1
  219. package/dist/tegel/p-4b58a02c.entry.js +0 -1
  220. package/dist/tegel/p-4cb85347.entry.js +0 -1
  221. package/dist/tegel/p-52031b5a.entry.js +0 -1
  222. package/dist/tegel/p-677baf7f.entry.js +0 -1
  223. package/dist/tegel/p-71797eaf.entry.js +0 -1
  224. package/dist/tegel/p-7373284c.entry.js +0 -1
  225. package/dist/tegel/p-7451779b.entry.js +0 -1
  226. package/dist/tegel/p-77aeea3b.entry.js +0 -1
  227. package/dist/tegel/p-8582d6a7.entry.js +0 -1
  228. package/dist/tegel/p-96021bd0.entry.js +0 -1
  229. package/dist/tegel/p-9d8caf51.entry.js +0 -1
  230. package/dist/tegel/p-a5919930.entry.js +0 -1
  231. package/dist/tegel/p-b01cface.entry.js +0 -1
  232. package/dist/tegel/p-bf896643.entry.js +0 -1
  233. package/dist/tegel/p-c311725c.entry.js +0 -1
  234. package/dist/tegel/p-cf72dfd9.entry.js +0 -1
  235. package/dist/tegel/p-d91caec6.entry.js +0 -1
  236. package/dist/tegel/p-e10eec33.entry.js +0 -1
  237. package/dist/tegel/p-ec26fc38.js +0 -1
  238. package/dist/tegel/p-f2262a69.entry.js +0 -1
  239. package/dist/tegel/p-f2f7aa45.entry.js +0 -1
  240. package/dist/tegel/tegel.css +0 -101
  241. package/dist/tegel/tegel.esm.js +0 -1
  242. package/dist/types/components/accordion/accordion-item/accordion-item.d.ts +0 -17
  243. package/dist/types/components/accordion/accordion.d.ts +0 -7
  244. package/dist/types/components/badge/badges.d.ts +0 -16
  245. package/dist/types/components/button/button-component.d.ts +0 -15
  246. package/dist/types/components/data-table/table/table.d.ts +0 -47
  247. package/dist/types/components/data-table/table-body/table-body.d.ts +0 -54
  248. package/dist/types/components/data-table/table-body-cell/table-body-cell.d.ts +0 -24
  249. package/dist/types/components/data-table/table-body-row/table-body-row.d.ts +0 -27
  250. package/dist/types/components/data-table/table-body-row-expandable/table-body-row-expandable.d.ts +0 -27
  251. package/dist/types/components/data-table/table-footer/table-footer.d.ts +0 -50
  252. package/dist/types/components/data-table/table-header/table-header.d.ts +0 -27
  253. package/dist/types/components/data-table/table-header-cell/table-header-cell.d.ts +0 -45
  254. package/dist/types/components/data-table/table-toolbar/table-toolbar.d.ts +0 -22
  255. package/dist/types/components/datetime/datetime.d.ts +0 -32
  256. package/dist/types/components/dropdown/dropdown-filter/dropdown-filter.d.ts +0 -42
  257. package/dist/types/components/dropdown/dropdown-option/dropdown-option.d.ts +0 -19
  258. package/dist/types/components/dropdown/dropdown.d.ts +0 -56
  259. package/dist/types/components/icon/icon.d.ts +0 -12
  260. package/dist/types/components/modal/modal.d.ts +0 -16
  261. package/dist/types/components/popover-canvas/popover-canvas.d.ts +0 -18
  262. package/dist/types/components/popover-menu/popover-menu.d.ts +0 -18
  263. package/dist/types/components/slider/slider.d.ts +0 -82
  264. package/dist/types/components/spinner/spinner.d.ts +0 -7
  265. package/dist/types/components/tabs/inline-tabs-default/inline-tabs.d.ts +0 -41
  266. package/dist/types/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.d.ts +0 -20
  267. package/dist/types/components/tabs/navigation-tabs/navigation-tabs.d.ts +0 -18
  268. package/dist/types/components/textarea/textarea.d.ts +0 -41
  269. package/dist/types/components/textfield/textfield.d.ts +0 -42
  270. package/dist/types/components/tooltip/tooltip.d.ts +0 -20
  271. package/dist/types/components.d.ts +0 -1752
  272. package/dist/types/global.d.ts +0 -2
  273. package/dist/types/index.d.ts +0 -1
  274. package/dist/types/stencil-public-runtime.d.ts +0 -1581
  275. package/dist/types/utils/utils.d.ts +0 -2
  276. package/loader/cdn.js +0 -3
  277. package/loader/index.cjs.js +0 -3
  278. package/loader/index.d.ts +0 -12
  279. package/loader/index.es2017.js +0 -3
  280. package/loader/index.js +0 -4
  281. package/loader/package.json +0 -11
@@ -1,155 +0,0 @@
1
- import { h, Host, } from '@stencil/core';
2
- const relevantTableProps = [
3
- 'verticalDividers',
4
- 'compactDesign',
5
- 'noMinWidth',
6
- 'whiteBackground',
7
- ];
8
- export class TableBodyRowExpandable {
9
- constructor() {
10
- this.colSpan = null;
11
- this.isExpanded = false;
12
- this.tableId = '';
13
- this.columnsNumber = null;
14
- this.verticalDividers = false;
15
- this.compactDesign = false;
16
- this.noMinWidth = false;
17
- this.whiteBackground = false;
18
- }
19
- tablePropsChangedEventListener(event) {
20
- if (this.tableId === event.detail.tableId) {
21
- event.detail.changed
22
- .filter((changedProp) => relevantTableProps.includes(changedProp))
23
- .forEach((changedProp) => {
24
- if (typeof this[changedProp] === 'undefined') {
25
- throw new Error(`Table prop is not supported: ${changedProp}`);
26
- }
27
- this[changedProp] = event.detail[changedProp];
28
- });
29
- }
30
- }
31
- connectedCallback() {
32
- this.tableEl = this.host.closest('sdds-table');
33
- this.tableId = this.tableEl.tableId;
34
- }
35
- componentWillLoad() {
36
- relevantTableProps.forEach((tablePropName) => {
37
- this[tablePropName] = this.tableEl[tablePropName];
38
- });
39
- }
40
- componentDidLoad() {
41
- this.runPaginationEvent.emit(this.tableId);
42
- }
43
- componentWillRender() {
44
- if (this.colSpan !== null) {
45
- this.columnsNumber = this.colSpan;
46
- }
47
- else {
48
- this.columnsNumber = this.tableEl.querySelector('sdds-table-header').childElementCount + 1;
49
- }
50
- }
51
- sendValue() {
52
- this.singleRowExpandedEvent.emit([this.tableId, this.isExpanded]);
53
- }
54
- onChangeHandler(event) {
55
- this.isExpanded = event.currentTarget.checked === true;
56
- this.sendValue();
57
- }
58
- render() {
59
- return (h(Host, { class: {
60
- 'sdds-table__row': true,
61
- 'sdds-table__row-expand--active': this.isExpanded,
62
- 'sdds-table__compact': this.compactDesign,
63
- 'sdds-table--divider': this.verticalDividers,
64
- 'sdds-table--on-white-bg': this.whiteBackground,
65
- } }, h("tr", { class: "sdds-table__row" }, h("td", { class: "sdds-table__cell sdds-table__cell--expand" }, h("label", { class: "sdds-table__expand-control-container" }, h("input", { class: "sdds-table__expand-input", type: "checkbox", onChange: (event) => this.onChangeHandler(event), checked: this.isExpanded }), h("span", { class: "sdds-expendable-row-icon" }, h("svg", { fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M4.273 9.783a1 1 0 0 1 1.415 0l9.888 9.888a.6.6 0 0 0 .848 0l9.888-9.888a1 1 0 1 1 1.415 1.414l-9.889 9.889a2.6 2.6 0 0 1-3.677 0l-9.888-9.889a1 1 0 0 1 0-1.414Z", fill: "currentColor" }))))), h("slot", null)), h("tr", { class: "sdds-table__row-expand" }, h("td", { class: "sdds-table__cell-expand", colSpan: this.columnsNumber }, h("slot", { name: "expand-row" })))));
66
- }
67
- static get is() { return "sdds-table-body-row-expandable"; }
68
- static get encapsulation() { return "shadow"; }
69
- static get originalStyleUrls() {
70
- return {
71
- "$": ["table-body-row-expandable.scss"]
72
- };
73
- }
74
- static get styleUrls() {
75
- return {
76
- "$": ["table-body-row-expandable.css"]
77
- };
78
- }
79
- static get properties() {
80
- return {
81
- "colSpan": {
82
- "type": "number",
83
- "mutable": false,
84
- "complexType": {
85
- "original": "number",
86
- "resolved": "number",
87
- "references": {}
88
- },
89
- "required": false,
90
- "optional": false,
91
- "docs": {
92
- "tags": [],
93
- "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"
94
- },
95
- "attribute": "col-span",
96
- "reflect": false,
97
- "defaultValue": "null"
98
- }
99
- };
100
- }
101
- static get states() {
102
- return {
103
- "isExpanded": {},
104
- "tableId": {},
105
- "columnsNumber": {},
106
- "verticalDividers": {},
107
- "compactDesign": {},
108
- "noMinWidth": {},
109
- "whiteBackground": {}
110
- };
111
- }
112
- static get events() {
113
- return [{
114
- "method": "singleRowExpandedEvent",
115
- "name": "singleRowExpandedEvent",
116
- "bubbles": true,
117
- "cancelable": true,
118
- "composed": true,
119
- "docs": {
120
- "tags": [],
121
- "text": "Sends out status of itw own expended status feature to table header component"
122
- },
123
- "complexType": {
124
- "original": "any",
125
- "resolved": "any",
126
- "references": {}
127
- }
128
- }, {
129
- "method": "runPaginationEvent",
130
- "name": "runPaginationEvent",
131
- "bubbles": true,
132
- "cancelable": true,
133
- "composed": true,
134
- "docs": {
135
- "tags": [],
136
- "text": "Event that triggers pagination function. Needed as first rows have to be rendered in order for pagination to run"
137
- },
138
- "complexType": {
139
- "original": "string",
140
- "resolved": "string",
141
- "references": {}
142
- }
143
- }];
144
- }
145
- static get elementRef() { return "host"; }
146
- static get listeners() {
147
- return [{
148
- "name": "tablePropsChangedEvent",
149
- "method": "tablePropsChangedEventListener",
150
- "target": "body",
151
- "capture": false,
152
- "passive": false
153
- }];
154
- }
155
- }
@@ -1,93 +0,0 @@
1
- :host {
2
- box-sizing: border-box;
3
- display: table-footer-group;
4
- height: 48px;
5
- }
6
- :host * {
7
- box-sizing: border-box;
8
- }
9
- :host .sdds-table__footer-row {
10
- background-color: var(--sdds-grey-100);
11
- }
12
- :host .sdds-table__footer-cell {
13
- padding: 0 16px;
14
- }
15
- :host .sdds-table__footer-cell .sdds-table__pagination {
16
- height: 48px;
17
- display: flex;
18
- align-items: center;
19
- justify-content: space-between;
20
- }
21
- :host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__row-selector,
22
- :host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__page-selector {
23
- display: flex;
24
- align-items: center;
25
- }
26
- :host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__page-selector-input {
27
- font: var(--sdds-detail-02);
28
- letter-spacing: var(--sdds-detail-02-ls);
29
- background-color: var(--sdds-grey-50);
30
- width: 36px;
31
- height: 30px;
32
- border: none;
33
- border-radius: 4px;
34
- transition: background-color 250ms ease;
35
- margin-right: 4px;
36
- padding-right: 8px;
37
- }
38
- :host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__page-selector-input:hover {
39
- background-color: var(--sdds-white);
40
- }
41
- :host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__page-selector-input:disabled {
42
- color: var(--sdds-grey-600);
43
- }
44
- :host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__page-selector-input--shake {
45
- animation: sdds-shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
46
- transform: translate3d(0, 0, 0);
47
- backface-visibility: hidden;
48
- perspective: 1000px;
49
- }
50
- :host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__footer-text {
51
- font: var(--sdds-detail-02);
52
- letter-spacing: var(--sdds-detail-02-ls);
53
- padding: 1px 8px 0 0;
54
- }
55
- :host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__footer-btn {
56
- display: flex;
57
- justify-content: center;
58
- align-items: center;
59
- border: none;
60
- background-color: transparent;
61
- cursor: pointer;
62
- height: 32px;
63
- width: 32px;
64
- border-radius: 4px;
65
- transition: background-color 250ms ease;
66
- }
67
- :host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__footer-btn:hover {
68
- background-color: var(--sdds-grey-300);
69
- }
70
- :host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__footer-btn:disabled {
71
- cursor: default;
72
- }
73
- :host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__footer-btn:disabled:hover {
74
- background-color: transparent;
75
- }
76
- :host .sdds-table__footer-cell .sdds-table__pagination .sdds-table__footer-btn-svg {
77
- height: 20px;
78
- width: 20px;
79
- }
80
-
81
- :host(.sdds-table--compact) {
82
- height: 32px;
83
- }
84
- :host(.sdds-table--compact) .sdds-table__footer-cell .sdds-table__pagination {
85
- height: 32px;
86
- }
87
- :host(.sdds-table--compact) .sdds-table__footer-cell .sdds-table__pagination .sdds-table__page-selector-input {
88
- height: 24px;
89
- }
90
- :host(.sdds-table--compact) .sdds-table__footer-cell .sdds-table__pagination .sdds-table__footer-btn {
91
- height: 28px;
92
- width: 28px;
93
- }
@@ -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
- }