@dxc-technology/halstack-react 0.0.0-b061aa1 → 0.0.0-b08b8e8

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 (227) hide show
  1. package/README.md +46 -0
  2. package/dist/index.d.mts +3914 -0
  3. package/dist/index.d.ts +3914 -0
  4. package/dist/index.js +14224 -0
  5. package/dist/index.mjs +14136 -0
  6. package/package.json +86 -69
  7. package/BackgroundColorContext.js +0 -50
  8. package/ThemeContext.js +0 -246
  9. package/V3Select/V3Select.js +0 -455
  10. package/V3Select/index.d.ts +0 -27
  11. package/V3Textarea/V3Textarea.js +0 -260
  12. package/V3Textarea/index.d.ts +0 -27
  13. package/accordion/Accordion.d.ts +0 -4
  14. package/accordion/Accordion.js +0 -258
  15. package/accordion/types.d.ts +0 -68
  16. package/accordion/types.js +0 -5
  17. package/accordion-group/AccordionGroup.d.ts +0 -7
  18. package/accordion-group/AccordionGroup.js +0 -170
  19. package/accordion-group/AccordionGroup.stories.tsx +0 -225
  20. package/accordion-group/types.d.ts +0 -72
  21. package/accordion-group/types.js +0 -5
  22. package/alert/Alert.d.ts +0 -4
  23. package/alert/Alert.js +0 -290
  24. package/alert/Alert.stories.tsx +0 -170
  25. package/alert/types.d.ts +0 -49
  26. package/alert/types.js +0 -5
  27. package/badge/Badge.js +0 -59
  28. package/box/Box.d.ts +0 -4
  29. package/box/Box.js +0 -126
  30. package/box/Box.stories.tsx +0 -132
  31. package/box/types.d.ts +0 -43
  32. package/box/types.js +0 -5
  33. package/button/Button.d.ts +0 -4
  34. package/button/Button.js +0 -179
  35. package/button/Button.stories.tsx +0 -276
  36. package/button/types.d.ts +0 -57
  37. package/button/types.js +0 -5
  38. package/card/Card.d.ts +0 -4
  39. package/card/Card.js +0 -164
  40. package/card/Card.stories.tsx +0 -201
  41. package/card/ice-cream.jpg +0 -0
  42. package/card/types.d.ts +0 -67
  43. package/card/types.js +0 -5
  44. package/checkbox/Checkbox.d.ts +0 -4
  45. package/checkbox/Checkbox.js +0 -253
  46. package/checkbox/Checkbox.stories.tsx +0 -192
  47. package/checkbox/types.d.ts +0 -60
  48. package/checkbox/types.js +0 -5
  49. package/chip/Chip.d.ts +0 -4
  50. package/chip/Chip.js +0 -199
  51. package/chip/Chip.stories.tsx +0 -121
  52. package/chip/types.d.ts +0 -53
  53. package/chip/types.js +0 -5
  54. package/common/OpenSans.css +0 -81
  55. package/common/RequiredComponent.js +0 -32
  56. package/common/fonts/OpenSans-Bold.ttf +0 -0
  57. package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
  58. package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
  59. package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  60. package/common/fonts/OpenSans-Italic.ttf +0 -0
  61. package/common/fonts/OpenSans-Light.ttf +0 -0
  62. package/common/fonts/OpenSans-LightItalic.ttf +0 -0
  63. package/common/fonts/OpenSans-Regular.ttf +0 -0
  64. package/common/fonts/OpenSans-SemiBold.ttf +0 -0
  65. package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  66. package/common/utils.js +0 -22
  67. package/common/variables.js +0 -1578
  68. package/date/Date.js +0 -373
  69. package/date/index.d.ts +0 -27
  70. package/date-input/DateInput.d.ts +0 -4
  71. package/date-input/DateInput.js +0 -361
  72. package/date-input/DateInput.stories.tsx +0 -138
  73. package/date-input/types.d.ts +0 -100
  74. package/date-input/types.js +0 -5
  75. package/dialog/Dialog.d.ts +0 -4
  76. package/dialog/Dialog.js +0 -165
  77. package/dialog/Dialog.stories.tsx +0 -212
  78. package/dialog/types.d.ts +0 -43
  79. package/dialog/types.js +0 -5
  80. package/dropdown/Dropdown.d.ts +0 -4
  81. package/dropdown/Dropdown.js +0 -417
  82. package/dropdown/types.d.ts +0 -89
  83. package/dropdown/types.js +0 -5
  84. package/file-input/FileInput.d.ts +0 -4
  85. package/file-input/FileInput.js +0 -511
  86. package/file-input/FileItem.d.ts +0 -14
  87. package/file-input/FileItem.js +0 -184
  88. package/file-input/types.d.ts +0 -87
  89. package/file-input/types.js +0 -5
  90. package/footer/Footer.d.ts +0 -4
  91. package/footer/Footer.js +0 -266
  92. package/footer/Footer.stories.jsx +0 -151
  93. package/footer/Icons.js +0 -77
  94. package/footer/types.d.ts +0 -69
  95. package/footer/types.js +0 -5
  96. package/header/Header.d.ts +0 -7
  97. package/header/Header.js +0 -324
  98. package/header/Header.stories.tsx +0 -162
  99. package/header/Icons.js +0 -34
  100. package/header/types.d.ts +0 -47
  101. package/header/types.js +0 -5
  102. package/heading/Heading.d.ts +0 -4
  103. package/heading/Heading.js +0 -159
  104. package/heading/Heading.stories.tsx +0 -53
  105. package/heading/types.d.ts +0 -33
  106. package/heading/types.js +0 -5
  107. package/input-text/Icons.js +0 -22
  108. package/input-text/InputText.js +0 -611
  109. package/input-text/index.d.ts +0 -36
  110. package/layout/ApplicationLayout.d.ts +0 -10
  111. package/layout/ApplicationLayout.js +0 -224
  112. package/layout/Icons.js +0 -55
  113. package/layout/types.d.ts +0 -57
  114. package/layout/types.js +0 -5
  115. package/link/Link.d.ts +0 -3
  116. package/link/Link.js +0 -161
  117. package/link/Link.stories.tsx +0 -146
  118. package/link/types.d.ts +0 -74
  119. package/link/types.js +0 -5
  120. package/main.d.ts +0 -44
  121. package/main.js +0 -363
  122. package/number-input/NumberInput.d.ts +0 -4
  123. package/number-input/NumberInput.js +0 -86
  124. package/number-input/NumberInput.stories.tsx +0 -115
  125. package/number-input/NumberInputContext.d.ts +0 -4
  126. package/number-input/NumberInputContext.js +0 -19
  127. package/number-input/numberInputContextTypes.d.ts +0 -19
  128. package/number-input/numberInputContextTypes.js +0 -5
  129. package/number-input/types.d.ts +0 -117
  130. package/number-input/types.js +0 -5
  131. package/paginator/Icons.js +0 -66
  132. package/paginator/Paginator.d.ts +0 -4
  133. package/paginator/Paginator.js +0 -198
  134. package/paginator/Paginator.stories.tsx +0 -63
  135. package/paginator/types.d.ts +0 -38
  136. package/paginator/types.js +0 -5
  137. package/password-input/PasswordInput.d.ts +0 -4
  138. package/password-input/PasswordInput.js +0 -164
  139. package/password-input/PasswordInput.stories.tsx +0 -131
  140. package/password-input/types.d.ts +0 -107
  141. package/password-input/types.js +0 -5
  142. package/progress-bar/ProgressBar.d.ts +0 -4
  143. package/progress-bar/ProgressBar.js +0 -170
  144. package/progress-bar/ProgressBar.stories.jsx +0 -58
  145. package/progress-bar/types.d.ts +0 -37
  146. package/progress-bar/types.js +0 -5
  147. package/radio/Radio.d.ts +0 -4
  148. package/radio/Radio.js +0 -174
  149. package/radio/Radio.stories.tsx +0 -192
  150. package/radio/types.d.ts +0 -54
  151. package/radio/types.js +0 -5
  152. package/resultsetTable/ResultsetTable.d.ts +0 -4
  153. package/resultsetTable/ResultsetTable.js +0 -251
  154. package/resultsetTable/types.d.ts +0 -67
  155. package/resultsetTable/types.js +0 -5
  156. package/select/Select.js +0 -865
  157. package/select/Select.stories.tsx +0 -572
  158. package/select/index.d.ts +0 -131
  159. package/sidenav/Sidenav.d.ts +0 -9
  160. package/sidenav/Sidenav.js +0 -136
  161. package/sidenav/Sidenav.stories.tsx +0 -165
  162. package/sidenav/types.d.ts +0 -50
  163. package/sidenav/types.js +0 -5
  164. package/slider/Slider.d.ts +0 -4
  165. package/slider/Slider.js +0 -317
  166. package/slider/Slider.stories.tsx +0 -177
  167. package/slider/types.d.ts +0 -78
  168. package/slider/types.js +0 -5
  169. package/spinner/Spinner.d.ts +0 -4
  170. package/spinner/Spinner.js +0 -250
  171. package/spinner/Spinner.stories.jsx +0 -102
  172. package/spinner/types.d.ts +0 -32
  173. package/spinner/types.js +0 -5
  174. package/switch/Switch.d.ts +0 -4
  175. package/switch/Switch.js +0 -179
  176. package/switch/Switch.stories.tsx +0 -160
  177. package/switch/types.d.ts +0 -58
  178. package/switch/types.js +0 -5
  179. package/table/Table.d.ts +0 -4
  180. package/table/Table.js +0 -118
  181. package/table/Table.stories.jsx +0 -276
  182. package/table/types.d.ts +0 -21
  183. package/table/types.js +0 -5
  184. package/tabs/Tabs.d.ts +0 -4
  185. package/tabs/Tabs.js +0 -213
  186. package/tabs/Tabs.stories.tsx +0 -121
  187. package/tabs/types.d.ts +0 -70
  188. package/tabs/types.js +0 -5
  189. package/tag/Tag.d.ts +0 -4
  190. package/tag/Tag.js +0 -193
  191. package/tag/Tag.stories.tsx +0 -145
  192. package/tag/types.d.ts +0 -60
  193. package/tag/types.js +0 -5
  194. package/text-input/TextInput.d.ts +0 -4
  195. package/text-input/TextInput.js +0 -788
  196. package/text-input/TextInput.stories.tsx +0 -456
  197. package/text-input/types.d.ts +0 -159
  198. package/text-input/types.js +0 -5
  199. package/textarea/Textarea.js +0 -316
  200. package/textarea/Textarea.stories.jsx +0 -135
  201. package/textarea/index.d.ts +0 -127
  202. package/toggle/Toggle.js +0 -186
  203. package/toggle/index.d.ts +0 -21
  204. package/toggle-group/ToggleGroup.d.ts +0 -4
  205. package/toggle-group/ToggleGroup.js +0 -217
  206. package/toggle-group/ToggleGroup.stories.tsx +0 -178
  207. package/toggle-group/types.d.ts +0 -84
  208. package/toggle-group/types.js +0 -5
  209. package/upload/Upload.js +0 -201
  210. package/upload/buttons-upload/ButtonsUpload.js +0 -111
  211. package/upload/buttons-upload/Icons.js +0 -40
  212. package/upload/dragAndDropArea/DragAndDropArea.js +0 -225
  213. package/upload/dragAndDropArea/Icons.js +0 -39
  214. package/upload/file-upload/FileToUpload.js +0 -115
  215. package/upload/file-upload/Icons.js +0 -66
  216. package/upload/files-upload/FilesToUpload.js +0 -109
  217. package/upload/index.d.ts +0 -15
  218. package/upload/transaction/Icons.js +0 -160
  219. package/upload/transaction/Transaction.js +0 -104
  220. package/upload/transactions/Transactions.js +0 -94
  221. package/useTheme.js +0 -22
  222. package/wizard/Icons.js +0 -65
  223. package/wizard/Wizard.d.ts +0 -4
  224. package/wizard/Wizard.js +0 -231
  225. package/wizard/Wizard.stories.jsx +0 -224
  226. package/wizard/types.d.ts +0 -64
  227. package/wizard/types.js +0 -5
package/radio/types.d.ts DELETED
@@ -1,54 +0,0 @@
1
- declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
- declare type Margin = {
3
- top?: Space;
4
- bottom?: Space;
5
- left?: Space;
6
- right?: Space;
7
- };
8
- declare type Props = {
9
- /**
10
- * If true, the radio is selected. If undefined the component will be uncontrolled
11
- * and the value will be managed internally by the component.
12
- */
13
- checked?: boolean;
14
- /**
15
- * Will be passed to the value attribute of the html input element. When inside a
16
- * form, this value will be only submitted if the radio is checked.
17
- */
18
- value?: string;
19
- /**
20
- * Text to be placed next to the radio.
21
- */
22
- label: string;
23
- /**
24
- * Whether the label should appear after or before the radio.
25
- */
26
- labelPosition?: "before" | "after";
27
- /**
28
- * Name attribute of the input element.
29
- */
30
- name?: string;
31
- /**
32
- * If true, the component will be disabled.
33
- */
34
- disabled?: boolean;
35
- /**
36
- * If true, the radio will change its appearence, showing that the value is required.
37
- */
38
- required?: boolean;
39
- /**
40
- * This function will be called when the user clicks the radio. The new value will
41
- * be passed as a parameter.
42
- */
43
- onClick?: (val: boolean) => void;
44
- /**
45
- * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
46
- * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
47
- */
48
- margin?: Space | Margin;
49
- /**
50
- * Size of the component.
51
- */
52
- size?: "small" | "medium" | "large" | "fillParent" | "fitContent";
53
- };
54
- export default Props;
package/radio/types.js DELETED
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import ResultsetTablePropsType from "./types";
3
- declare const DxcResultsetTable: ({ columns, rows, showGoToPage, itemsPerPage, itemsPerPageOptions, itemsPerPageFunction, margin, tabIndex, }: ResultsetTablePropsType) => JSX.Element;
4
- export default DxcResultsetTable;
@@ -1,251 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _typeof3 = require("@babel/runtime/helpers/typeof");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports["default"] = void 0;
11
-
12
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
13
-
14
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
15
-
16
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
17
-
18
- var _react = _interopRequireWildcard(require("react"));
19
-
20
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
21
-
22
- var _variables = require("../common/variables.js");
23
-
24
- var _Table = _interopRequireDefault(require("../table/Table"));
25
-
26
- var _Paginator = _interopRequireDefault(require("../paginator/Paginator"));
27
-
28
- var _useTheme = _interopRequireDefault(require("../useTheme.js"));
29
-
30
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
31
-
32
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
33
-
34
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
-
36
- function normalizeSortValue(sortValue) {
37
- return typeof sortValue === "string" ? sortValue.toUpperCase() : sortValue;
38
- }
39
-
40
- function sortArray(index, order, resultset) {
41
- return resultset.slice().sort(function (element1, element2) {
42
- var sortValueA = normalizeSortValue(element1[index].sortValue || element1[index].displayValue);
43
- var sortValueB = normalizeSortValue(element2[index].sortValue || element2[index].displayValue);
44
- var comparison = 0;
45
-
46
- if ((0, _typeof2["default"])(sortValueA) === "object") {
47
- comparison = -1;
48
- } else if ((0, _typeof2["default"])(sortValueB) === "object") {
49
- comparison = 1;
50
- } else if (sortValueA > sortValueB) {
51
- comparison = 1;
52
- } else if (sortValueA < sortValueB) {
53
- comparison = -1;
54
- }
55
-
56
- return order === "desc" ? comparison * -1 : comparison;
57
- });
58
- }
59
-
60
- var getMinItemsPerPageIndex = function getMinItemsPerPageIndex(currentPageInternal, itemsPerPage, page) {
61
- return currentPageInternal === 1 ? 0 : itemsPerPage * (page - 1);
62
- };
63
-
64
- var getMaxItemsPerPageIndex = function getMaxItemsPerPageIndex(minItemsPerPageIndex, itemsPerPage, resultset, page) {
65
- return minItemsPerPageIndex + itemsPerPage > resultset.length ? resultset.length : itemsPerPage * page - 1;
66
- };
67
-
68
- var ArrowUp = function ArrowUp() {
69
- return /*#__PURE__*/_react["default"].createElement("svg", {
70
- xmlns: "http://www.w3.org/2000/svg",
71
- height: "24",
72
- viewBox: "0 0 24 24",
73
- width: "24",
74
- fill: "currentColor"
75
- }, /*#__PURE__*/_react["default"].createElement("path", {
76
- d: "M0 0h24v24H0V0z",
77
- fill: "none"
78
- }), /*#__PURE__*/_react["default"].createElement("path", {
79
- d: "M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"
80
- }));
81
- };
82
-
83
- var ArrowDown = function ArrowDown() {
84
- return /*#__PURE__*/_react["default"].createElement("svg", {
85
- xmlns: "http://www.w3.org/2000/svg",
86
- height: "24",
87
- viewBox: "0 0 24 24",
88
- width: "24",
89
- fill: "currentColor"
90
- }, /*#__PURE__*/_react["default"].createElement("path", {
91
- d: "M0 0h24v24H0V0z",
92
- fill: "none"
93
- }), /*#__PURE__*/_react["default"].createElement("path", {
94
- d: "M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
95
- }));
96
- };
97
-
98
- var BothArrows = function BothArrows() {
99
- return /*#__PURE__*/_react["default"].createElement("svg", {
100
- xmlns: "http://www.w3.org/2000/svg",
101
- height: "24",
102
- viewBox: "0 0 24 24",
103
- width: "24",
104
- fill: "currentColor"
105
- }, /*#__PURE__*/_react["default"].createElement("path", {
106
- d: "M0 0h24v24H0z",
107
- fill: "none"
108
- }), /*#__PURE__*/_react["default"].createElement("path", {
109
- d: "M12 5.83L15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z"
110
- }));
111
- };
112
-
113
- var DxcResultsetTable = function DxcResultsetTable(_ref) {
114
- var columns = _ref.columns,
115
- rows = _ref.rows,
116
- _ref$showGoToPage = _ref.showGoToPage,
117
- showGoToPage = _ref$showGoToPage === void 0 ? true : _ref$showGoToPage,
118
- _ref$itemsPerPage = _ref.itemsPerPage,
119
- itemsPerPage = _ref$itemsPerPage === void 0 ? 5 : _ref$itemsPerPage,
120
- itemsPerPageOptions = _ref.itemsPerPageOptions,
121
- itemsPerPageFunction = _ref.itemsPerPageFunction,
122
- margin = _ref.margin,
123
- _ref$tabIndex = _ref.tabIndex,
124
- tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
125
- var colorsTheme = (0, _useTheme["default"])();
126
-
127
- var _useState = (0, _react.useState)(1),
128
- _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
129
- page = _useState2[0],
130
- changePage = _useState2[1];
131
-
132
- var _useState3 = (0, _react.useState)(""),
133
- _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
134
- sortColumnIndex = _useState4[0],
135
- changeSortColumnIndex = _useState4[1];
136
-
137
- var _useState5 = (0, _react.useState)("asc"),
138
- _useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
139
- sortOrder = _useState6[0],
140
- changeSortOrder = _useState6[1];
141
-
142
- var minItemsPerPageIndex = (0, _react.useMemo)(function () {
143
- return getMinItemsPerPageIndex(page, itemsPerPage, page);
144
- }, [itemsPerPage, page]);
145
- var maxItemsPerPageIndex = (0, _react.useMemo)(function () {
146
- return getMaxItemsPerPageIndex(minItemsPerPageIndex, itemsPerPage, rows, page);
147
- }, [itemsPerPage, minItemsPerPageIndex, page, rows]);
148
-
149
- var goToPage = function goToPage(newPage) {
150
- changePage(newPage);
151
- };
152
-
153
- var changeSorting = function changeSorting(columnIndex) {
154
- changePage(1);
155
- changeSortColumnIndex(columnIndex);
156
- changeSortOrder(sortColumnIndex === "" || sortColumnIndex !== columnIndex ? "asc" : sortOrder === "asc" ? "desc" : "asc");
157
- };
158
-
159
- var getIconForSortableColumn = function getIconForSortableColumn(clickedColumnIndex) {
160
- return sortColumnIndex === clickedColumnIndex ? sortOrder === "asc" ? /*#__PURE__*/_react["default"].createElement(ArrowUp, null) : /*#__PURE__*/_react["default"].createElement(ArrowDown, null) : /*#__PURE__*/_react["default"].createElement(BothArrows, null);
161
- };
162
-
163
- (0, _react.useEffect)(function () {
164
- if (rows.length > 0) {
165
- changePage(1);
166
- } else {
167
- changePage(0);
168
- }
169
- }, [rows.length, itemsPerPage]);
170
- var sortedResultset = (0, _react.useMemo)(function () {
171
- return sortColumnIndex !== "" ? sortArray(sortColumnIndex, sortOrder, rows) : rows;
172
- }, [sortColumnIndex, sortOrder, rows]);
173
- var filteredResultset = (0, _react.useMemo)(function () {
174
- return sortedResultset && sortedResultset.slice(minItemsPerPageIndex, maxItemsPerPageIndex + 1);
175
- }, [sortedResultset, minItemsPerPageIndex, maxItemsPerPageIndex]);
176
- return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
177
- theme: colorsTheme.table
178
- }, /*#__PURE__*/_react["default"].createElement(DxcResultsetTableContainer, {
179
- margin: margin
180
- }, /*#__PURE__*/_react["default"].createElement(TableContainer, null, /*#__PURE__*/_react["default"].createElement(_Table["default"], null, /*#__PURE__*/_react["default"].createElement(HeaderRow, null, /*#__PURE__*/_react["default"].createElement("tr", null, columns.map(function (column, index) {
181
- return /*#__PURE__*/_react["default"].createElement(TableHeader, {
182
- key: "tableHeader_".concat(index)
183
- }, /*#__PURE__*/_react["default"].createElement(HeaderContainer, {
184
- key: "headerContainer_".concat(index),
185
- onClick: function onClick() {
186
- return column.isSortable && changeSorting(index);
187
- },
188
- tabIndex: column.isSortable ? tabIndex : -1
189
- }, /*#__PURE__*/_react["default"].createElement(TitleDiv, {
190
- isSortable: column.isSortable
191
- }, column.displayValue), column.isSortable && /*#__PURE__*/_react["default"].createElement(SortIcon, null, getIconForSortableColumn(index))));
192
- }))), /*#__PURE__*/_react["default"].createElement(TableRowGroup, null, filteredResultset.map(function (cells, index) {
193
- return /*#__PURE__*/_react["default"].createElement("tr", {
194
- key: "resultSetTableCell_".concat(index)
195
- }, cells.map(function (cellContent, index) {
196
- return /*#__PURE__*/_react["default"].createElement("td", {
197
- key: "resultSetTableCellContent_".concat(index)
198
- }, cellContent.displayValue);
199
- }));
200
- })))), /*#__PURE__*/_react["default"].createElement(PaginatorContainer, null, /*#__PURE__*/_react["default"].createElement(_Paginator["default"], {
201
- totalItems: rows.length,
202
- itemsPerPage: itemsPerPage,
203
- itemsPerPageOptions: itemsPerPageOptions,
204
- itemsPerPageFunction: itemsPerPageFunction,
205
- currentPage: page,
206
- showGoToPage: showGoToPage,
207
- onPageChange: goToPage,
208
- tabIndex: tabIndex
209
- }))));
210
- };
211
-
212
- var TableContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n & table {\n table-layout: auto;\n }\n"])));
213
-
214
- var PaginatorContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])([""])));
215
-
216
- var TableRowGroup = _styledComponents["default"].tbody(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n > div:nth-child(1) {\n position: absolute;\n left: calc(50% - 68.5px);\n bottom: calc(50% - 68.5px - 30px);\n }\n & tr {\n height: ", ";\n }\n"])), function (props) {
217
- return props.theme.rowHeight || "70px";
218
- });
219
-
220
- var SortIcon = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n top: 409px;\n left: 390px;\n height: 14px;\n cursor: pointer;\n color: ", ";\n\n svg {\n height: 100%;\n width: 100%;\n }\n"])), function (props) {
221
- return props.theme.sortIconColor;
222
- });
223
-
224
- var TitleDiv = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n cursor: ", ";\n"])), function (props) {
225
- return props.isSortable && "pointer" || "default";
226
- });
227
-
228
- var TableHeader = _styledComponents["default"].th(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])([""])));
229
-
230
- var HeaderContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: ", ";\n width: 100%;\n"])), function (props) {
231
- return props.theme.headerTextAlign === "center" ? "center" : props.theme.headerTextAlign === "right" ? "flex-end" : "flex-start";
232
- });
233
-
234
- var HeaderRow = _styledComponents["default"].thead(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n height: 60px;\n"])));
235
-
236
- var DxcResultsetTableContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
237
- return props.theme.fontSizeBase;
238
- }, function (props) {
239
- return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
240
- }, function (props) {
241
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
242
- }, function (props) {
243
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
244
- }, function (props) {
245
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
246
- }, function (props) {
247
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
248
- });
249
-
250
- var _default = DxcResultsetTable;
251
- exports["default"] = _default;
@@ -1,67 +0,0 @@
1
- /// <reference types="react" />
2
- declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
- declare type Margin = {
4
- top?: Space;
5
- bottom?: Space;
6
- left?: Space;
7
- right?: Space;
8
- };
9
- declare type Column = {
10
- /**
11
- * Column display value.
12
- */
13
- displayValue: React.ReactNode;
14
- /**
15
- * Boolean value to indicate whether the column is sortable or not.
16
- */
17
- isSortable?: boolean;
18
- };
19
- declare type Row = {
20
- /**
21
- * Value to be displayed in the cell.
22
- */
23
- displayValue: React.ReactNode;
24
- /**
25
- * Value to be used when sorting the table by that
26
- * column. If not indicated displayValue will be used for sorting.
27
- */
28
- sortValue?: string;
29
- };
30
- declare type Props = {
31
- /**
32
- * An array of objects representing the columns of the table.
33
- */
34
- columns: Column[];
35
- /**
36
- * An array of objects representing the rows of the table, you will have
37
- * as many objects as columns in the table.
38
- */
39
- rows: Row[];
40
- /**
41
- * If true, a select component for navigation between pages will be displayed.
42
- */
43
- showGoToPage?: boolean;
44
- /**
45
- * Number of items per page.
46
- */
47
- itemsPerPage?: number;
48
- /**
49
- * An array of numbers representing the items per page options.
50
- */
51
- itemsPerPageOptions?: number[];
52
- /**
53
- * This function will be called when the user selects an item per page
54
- * option. The value selected will be passed as a parameter.
55
- */
56
- itemsPerPageFunction?: (newValue: number) => void;
57
- /**
58
- * Size of the margin to be applied to the component. You can pass an object with 'top',
59
- * 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
60
- */
61
- margin?: Space | Margin;
62
- /**
63
- * Value of the tabindex attribute given to the sortable icon.
64
- */
65
- tabIndex?: number;
66
- };
67
- export default Props;
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });