@dxc-technology/halstack-react 0.0.0-570929a → 0.0.0-58f12a2
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.
- package/BackgroundColorContext.d.ts +10 -0
- package/BackgroundColorContext.js +47 -0
- package/ThemeContext.d.ts +15 -0
- package/ThemeContext.js +243 -0
- package/V3Select/V3Select.js +455 -0
- package/V3Select/index.d.ts +27 -0
- package/{dist/textarea/Textarea.js → V3Textarea/V3Textarea.js} +41 -41
- package/V3Textarea/index.d.ts +27 -0
- package/accordion/Accordion.d.ts +4 -0
- package/accordion/Accordion.js +258 -0
- package/accordion/Accordion.stories.tsx +300 -0
- package/accordion/types.d.ts +68 -0
- package/accordion/types.js +5 -0
- package/accordion-group/AccordionGroup.d.ts +7 -0
- package/accordion-group/AccordionGroup.js +170 -0
- package/accordion-group/AccordionGroup.stories.tsx +225 -0
- package/accordion-group/types.d.ts +72 -0
- package/accordion-group/types.js +5 -0
- package/alert/Alert.d.ts +4 -0
- package/alert/Alert.js +290 -0
- package/alert/Alert.stories.tsx +170 -0
- package/alert/types.d.ts +49 -0
- package/alert/types.js +5 -0
- package/badge/Badge.js +59 -0
- package/box/Box.d.ts +4 -0
- package/{dist/box → box}/Box.js +15 -53
- package/box/Box.stories.tsx +132 -0
- package/box/types.d.ts +43 -0
- package/box/types.js +5 -0
- package/button/Button.d.ts +4 -0
- package/button/Button.js +179 -0
- package/button/Button.stories.tsx +276 -0
- package/button/types.d.ts +57 -0
- package/button/types.js +5 -0
- package/card/Card.d.ts +4 -0
- package/{dist/card → card}/Card.js +34 -126
- package/card/Card.stories.tsx +201 -0
- package/card/ice-cream.jpg +0 -0
- package/card/types.d.ts +67 -0
- package/card/types.js +5 -0
- package/checkbox/Checkbox.d.ts +4 -0
- package/{dist/checkbox → checkbox}/Checkbox.js +46 -84
- package/checkbox/Checkbox.stories.tsx +192 -0
- package/checkbox/types.d.ts +60 -0
- package/checkbox/types.js +5 -0
- package/chip/Chip.d.ts +4 -0
- package/{dist/chip → chip}/Chip.js +44 -108
- package/chip/Chip.stories.tsx +121 -0
- package/chip/types.d.ts +53 -0
- package/chip/types.js +5 -0
- package/{dist/common → common}/OpenSans.css +0 -0
- package/{dist/common → common}/RequiredComponent.js +3 -11
- package/{dist/common → common}/fonts/OpenSans-Bold.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-BoldItalic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-ExtraBold.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-Italic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-Light.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-LightItalic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-Regular.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-SemiBold.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
- package/{dist/common → common}/utils.js +0 -0
- package/common/variables.js +1605 -0
- package/{dist/date → date}/Date.js +34 -52
- package/date/index.d.ts +27 -0
- package/date-input/DateInput.d.ts +4 -0
- package/date-input/DateInput.js +358 -0
- package/date-input/DateInput.stories.tsx +138 -0
- package/date-input/types.d.ts +100 -0
- package/date-input/types.js +5 -0
- package/dialog/Dialog.d.ts +4 -0
- package/{dist/dialog → dialog}/Dialog.js +32 -102
- package/dialog/Dialog.stories.tsx +212 -0
- package/dialog/types.d.ts +43 -0
- package/dialog/types.js +5 -0
- package/dropdown/Dropdown.d.ts +4 -0
- package/dropdown/Dropdown.js +417 -0
- package/dropdown/Dropdown.stories.tsx +247 -0
- package/dropdown/types.d.ts +89 -0
- package/dropdown/types.js +5 -0
- package/file-input/FileInput.d.ts +4 -0
- package/file-input/FileInput.js +590 -0
- package/file-input/FileInput.stories.tsx +506 -0
- package/file-input/FileItem.d.ts +14 -0
- package/file-input/FileItem.js +184 -0
- package/file-input/types.d.ts +112 -0
- package/file-input/types.js +5 -0
- package/footer/Footer.d.ts +4 -0
- package/footer/Footer.js +260 -0
- package/footer/Footer.stories.tsx +130 -0
- package/footer/Icons.d.ts +2 -0
- package/footer/Icons.js +77 -0
- package/footer/types.d.ts +65 -0
- package/footer/types.js +5 -0
- package/header/Header.d.ts +7 -0
- package/header/Header.js +324 -0
- package/header/Header.stories.tsx +162 -0
- package/header/Icons.d.ts +2 -0
- package/header/Icons.js +34 -0
- package/header/types.d.ts +47 -0
- package/header/types.js +5 -0
- package/heading/Heading.d.ts +4 -0
- package/{dist/heading → heading}/Heading.js +31 -94
- package/heading/Heading.stories.tsx +53 -0
- package/heading/types.d.ts +33 -0
- package/heading/types.js +5 -0
- package/input-text/Icons.js +22 -0
- package/{dist/input-text → input-text}/InputText.js +121 -179
- package/input-text/index.d.ts +36 -0
- package/layout/ApplicationLayout.d.ts +10 -0
- package/{dist/layout → layout}/ApplicationLayout.js +43 -149
- package/layout/ApplicationLayout.stories.tsx +171 -0
- package/layout/Icons.js +55 -0
- package/layout/types.d.ts +57 -0
- package/layout/types.js +5 -0
- package/link/Link.d.ts +3 -0
- package/link/Link.js +161 -0
- package/link/Link.stories.tsx +146 -0
- package/link/types.d.ts +74 -0
- package/link/types.js +5 -0
- package/list/List.d.ts +8 -0
- package/list/List.js +47 -0
- package/list/List.stories.tsx +95 -0
- package/main.d.ts +48 -0
- package/{dist/main.js → main.js} +142 -58
- package/number-input/NumberInput.d.ts +4 -0
- package/number-input/NumberInput.js +83 -0
- package/number-input/NumberInput.stories.tsx +115 -0
- package/number-input/NumberInputContext.d.ts +4 -0
- package/number-input/NumberInputContext.js +19 -0
- package/number-input/numberInputContextTypes.d.ts +19 -0
- package/number-input/numberInputContextTypes.js +5 -0
- package/number-input/types.d.ts +117 -0
- package/number-input/types.js +5 -0
- package/package.json +36 -25
- package/paginator/Icons.js +66 -0
- package/paginator/Paginator.d.ts +4 -0
- package/paginator/Paginator.js +192 -0
- package/paginator/Paginator.stories.tsx +63 -0
- package/paginator/types.d.ts +38 -0
- package/paginator/types.js +5 -0
- package/password-input/PasswordInput.d.ts +4 -0
- package/password-input/PasswordInput.js +163 -0
- package/password-input/PasswordInput.stories.tsx +131 -0
- package/password-input/types.d.ts +107 -0
- package/password-input/types.js +5 -0
- package/progress-bar/ProgressBar.d.ts +4 -0
- package/progress-bar/ProgressBar.js +170 -0
- package/progress-bar/ProgressBar.stories.jsx +58 -0
- package/progress-bar/types.d.ts +37 -0
- package/progress-bar/types.js +5 -0
- package/radio/Radio.d.ts +4 -0
- package/{dist/radio → radio}/Radio.js +17 -52
- package/radio/Radio.stories.tsx +192 -0
- package/radio/types.d.ts +54 -0
- package/radio/types.js +5 -0
- package/radio-group/Radio.d.ts +4 -0
- package/radio-group/Radio.js +117 -0
- package/radio-group/RadioGroup.d.ts +4 -0
- package/radio-group/RadioGroup.js +231 -0
- package/radio-group/RadioGroup.stories.tsx +57 -0
- package/radio-group/types.d.ts +31 -0
- package/radio-group/types.js +5 -0
- package/resultsetTable/ResultsetTable.d.ts +4 -0
- package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +39 -163
- package/resultsetTable/ResultsetTable.stories.tsx +276 -0
- package/resultsetTable/types.d.ts +67 -0
- package/resultsetTable/types.js +5 -0
- package/row/Row.d.ts +11 -0
- package/row/Row.js +127 -0
- package/row/Row.stories.tsx +239 -0
- package/select/Select.d.ts +4 -0
- package/select/Select.js +863 -0
- package/select/Select.stories.tsx +572 -0
- package/select/types.d.ts +170 -0
- package/select/types.js +5 -0
- package/sidenav/Sidenav.d.ts +9 -0
- package/sidenav/Sidenav.js +136 -0
- package/sidenav/Sidenav.stories.tsx +165 -0
- package/sidenav/types.d.ts +50 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.d.ts +4 -0
- package/slider/Slider.js +317 -0
- package/slider/Slider.stories.tsx +177 -0
- package/slider/types.d.ts +78 -0
- package/slider/types.js +5 -0
- package/spinner/Spinner.d.ts +4 -0
- package/spinner/Spinner.js +250 -0
- package/spinner/Spinner.stories.jsx +102 -0
- package/spinner/types.d.ts +32 -0
- package/spinner/types.js +5 -0
- package/stack/Stack.d.ts +10 -0
- package/stack/Stack.js +97 -0
- package/stack/Stack.stories.tsx +166 -0
- package/switch/Switch.d.ts +4 -0
- package/{dist/switch → switch}/Switch.js +30 -73
- package/switch/Switch.stories.tsx +160 -0
- package/switch/types.d.ts +58 -0
- package/switch/types.js +5 -0
- package/table/Table.d.ts +4 -0
- package/{dist/table → table}/Table.js +14 -24
- package/table/Table.stories.jsx +276 -0
- package/table/types.d.ts +21 -0
- package/table/types.js +5 -0
- package/tabs/Tabs.d.ts +4 -0
- package/tabs/Tabs.js +213 -0
- package/tabs/Tabs.stories.tsx +121 -0
- package/tabs/types.d.ts +70 -0
- package/tabs/types.js +5 -0
- package/tag/Tag.d.ts +4 -0
- package/tag/Tag.js +193 -0
- package/tag/Tag.stories.tsx +145 -0
- package/tag/types.d.ts +60 -0
- package/tag/types.js +5 -0
- package/text/Text.d.ts +7 -0
- package/text/Text.js +30 -0
- package/text/Text.stories.tsx +19 -0
- package/text-input/TextInput.d.ts +4 -0
- package/text-input/TextInput.js +786 -0
- package/text-input/TextInput.stories.tsx +456 -0
- package/text-input/types.d.ts +159 -0
- package/text-input/types.js +5 -0
- package/textarea/Textarea.d.ts +4 -0
- package/textarea/Textarea.js +284 -0
- package/textarea/Textarea.stories.jsx +135 -0
- package/textarea/types.d.ts +130 -0
- package/textarea/types.js +5 -0
- package/{dist/toggle → toggle}/Toggle.js +16 -50
- package/toggle/index.d.ts +21 -0
- package/toggle-group/ToggleGroup.d.ts +4 -0
- package/toggle-group/ToggleGroup.js +214 -0
- package/toggle-group/ToggleGroup.stories.tsx +173 -0
- package/toggle-group/types.d.ts +97 -0
- package/toggle-group/types.js +5 -0
- package/{dist/upload → upload}/Upload.js +11 -15
- package/upload/buttons-upload/ButtonsUpload.js +111 -0
- package/upload/buttons-upload/Icons.js +40 -0
- package/upload/dragAndDropArea/DragAndDropArea.js +225 -0
- package/upload/dragAndDropArea/Icons.js +39 -0
- package/upload/file-upload/FileToUpload.js +115 -0
- package/upload/file-upload/Icons.js +66 -0
- package/{dist/upload → upload}/files-upload/FilesToUpload.js +13 -27
- package/upload/index.d.ts +15 -0
- package/upload/transaction/Icons.js +160 -0
- package/upload/transaction/Transaction.js +104 -0
- package/upload/transactions/Transactions.js +94 -0
- package/useTheme.d.ts +2 -0
- package/{dist/useTheme.js → useTheme.js} +1 -1
- package/wizard/Wizard.d.ts +4 -0
- package/wizard/Wizard.js +281 -0
- package/wizard/Wizard.stories.tsx +224 -0
- package/wizard/types.d.ts +60 -0
- package/wizard/types.js +5 -0
- package/README.md +0 -66
- package/babel.config.js +0 -8
- package/dist/BackgroundColorContext.js +0 -46
- package/dist/ThemeContext.js +0 -216
- package/dist/accordion/Accordion.js +0 -340
- package/dist/accordion/Accordion.stories.js +0 -207
- package/dist/accordion/readme.md +0 -96
- package/dist/accordion-group/AccordionGroup.js +0 -188
- package/dist/accordion-group/AccordionGroup.stories.js +0 -207
- package/dist/accordion-group/readme.md +0 -70
- package/dist/alert/Alert.js +0 -388
- package/dist/alert/Alert.stories.js +0 -158
- package/dist/alert/close.svg +0 -4
- package/dist/alert/error.svg +0 -4
- package/dist/alert/info.svg +0 -4
- package/dist/alert/readme.md +0 -43
- package/dist/alert/success.svg +0 -4
- package/dist/alert/warning.svg +0 -4
- package/dist/badge/Badge.js +0 -61
- package/dist/button/Button.js +0 -228
- package/dist/button/Button.stories.js +0 -224
- package/dist/button/readme.md +0 -93
- package/dist/checkbox/Checkbox.stories.js +0 -144
- package/dist/checkbox/readme.md +0 -116
- package/dist/common/variables.js +0 -1163
- package/dist/date/Date.stories.js +0 -205
- package/dist/date/calendar.svg +0 -1
- package/dist/date/calendar_dark.svg +0 -1
- package/dist/date/readme.md +0 -73
- package/dist/dialog/Dialog.stories.js +0 -217
- package/dist/dialog/readme.md +0 -32
- package/dist/dropdown/Dropdown.js +0 -492
- package/dist/dropdown/Dropdown.stories.js +0 -249
- package/dist/dropdown/baseline-arrow_drop_down.svg +0 -1
- package/dist/dropdown/baseline-arrow_drop_down_wh.svg +0 -4
- package/dist/dropdown/baseline-arrow_drop_up.svg +0 -1
- package/dist/dropdown/baseline-arrow_drop_up_wh.svg +0 -4
- package/dist/dropdown/readme.md +0 -69
- package/dist/footer/Footer.js +0 -405
- package/dist/footer/Footer.stories.js +0 -94
- package/dist/footer/dxc_logo_wht.png +0 -0
- package/dist/footer/readme.md +0 -41
- package/dist/header/Header.js +0 -431
- package/dist/header/Header.stories.js +0 -176
- package/dist/header/close_icon.svg +0 -1
- package/dist/header/dxc_logo_black.png +0 -0
- package/dist/header/dxc_logo_blk_rgb.svg +0 -6
- package/dist/header/dxc_logo_white.png +0 -0
- package/dist/header/hamb_menu_black.svg +0 -1
- package/dist/header/hamb_menu_white.svg +0 -1
- package/dist/header/readme.md +0 -33
- package/dist/input-text/InputText.stories.js +0 -209
- package/dist/input-text/error.svg +0 -1
- package/dist/input-text/readme.md +0 -91
- package/dist/layout/facebook.svg +0 -45
- package/dist/layout/linkedin.svg +0 -50
- package/dist/layout/twitter.svg +0 -53
- package/dist/link/Link.js +0 -240
- package/dist/link/readme.md +0 -51
- package/dist/paginator/Paginator.js +0 -283
- package/dist/paginator/images/next.svg +0 -3
- package/dist/paginator/images/nextPage.svg +0 -3
- package/dist/paginator/images/previous.svg +0 -3
- package/dist/paginator/images/previousPage.svg +0 -3
- package/dist/paginator/readme.md +0 -50
- package/dist/progress-bar/ProgressBar.js +0 -206
- package/dist/progress-bar/ProgressBar.stories.js +0 -280
- package/dist/progress-bar/readme.md +0 -63
- package/dist/radio/Radio.stories.js +0 -166
- package/dist/radio/readme.md +0 -70
- package/dist/resultsetTable/arrow_downward-24px_wht.svg +0 -1
- package/dist/resultsetTable/arrow_upward-24px_wht.svg +0 -1
- package/dist/resultsetTable/unfold_more-24px_wht.svg +0 -1
- package/dist/select/Select.js +0 -545
- package/dist/select/Select.stories.js +0 -235
- package/dist/select/readme.md +0 -72
- package/dist/sidenav/Sidenav.js +0 -183
- package/dist/slider/Slider.js +0 -315
- package/dist/slider/Slider.stories.js +0 -241
- package/dist/slider/readme.md +0 -64
- package/dist/spinner/Spinner.js +0 -214
- package/dist/spinner/Spinner.stories.js +0 -183
- package/dist/spinner/readme.md +0 -65
- package/dist/switch/Switch.stories.js +0 -134
- package/dist/switch/readme.md +0 -133
- package/dist/tabs/Tabs.js +0 -347
- package/dist/tabs/Tabs.stories.js +0 -130
- package/dist/tabs/readme.md +0 -78
- package/dist/tabs-for-sections/TabsForSections.js +0 -92
- package/dist/tabs-for-sections/readme.md +0 -78
- package/dist/tag/Tag.js +0 -280
- package/dist/toggle/Toggle.stories.js +0 -297
- package/dist/toggle/readme.md +0 -80
- package/dist/toggle-group/ToggleGroup.js +0 -241
- package/dist/toggle-group/readme.md +0 -82
- package/dist/upload/Upload.stories.js +0 -72
- package/dist/upload/buttons-upload/ButtonsUpload.js +0 -135
- package/dist/upload/buttons-upload/drag-drop-icon.svg +0 -4
- package/dist/upload/buttons-upload/upload-button.svg +0 -1
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +0 -325
- package/dist/upload/dragAndDropArea/upload_drop.svg +0 -4
- package/dist/upload/dragAndDropArea/upload_file.svg +0 -4
- package/dist/upload/file-upload/FileToUpload.js +0 -184
- package/dist/upload/file-upload/audio-icon.svg +0 -4
- package/dist/upload/file-upload/close.svg +0 -4
- package/dist/upload/file-upload/file-icon.svg +0 -4
- package/dist/upload/file-upload/video-icon.svg +0 -4
- package/dist/upload/readme.md +0 -37
- package/dist/upload/transaction/Transaction.js +0 -171
- package/dist/upload/transaction/audio-icon-err.svg +0 -4
- package/dist/upload/transaction/audio-icon.svg +0 -4
- package/dist/upload/transaction/error-icon.svg +0 -4
- package/dist/upload/transaction/file-icon-err.svg +0 -4
- package/dist/upload/transaction/file-icon.svg +0 -4
- package/dist/upload/transaction/image-icon-err.svg +0 -4
- package/dist/upload/transaction/image-icon.svg +0 -4
- package/dist/upload/transaction/success-icon.svg +0 -4
- package/dist/upload/transaction/video-icon-err.svg +0 -4
- package/dist/upload/transaction/video-icon.svg +0 -4
- package/dist/upload/transactions/Transactions.js +0 -138
- package/dist/wizard/Wizard.js +0 -383
- package/dist/wizard/invalid_icon.svg +0 -6
- package/dist/wizard/valid_icon.svg +0 -6
- package/dist/wizard/validation-wrong.svg +0 -6
- package/test/Accordion.test.js +0 -33
- package/test/AccordionGroup.test.js +0 -125
- package/test/Alert.test.js +0 -53
- package/test/Box.test.js +0 -10
- package/test/Button.test.js +0 -18
- package/test/Card.test.js +0 -30
- package/test/Checkbox.test.js +0 -45
- package/test/Chip.test.js +0 -25
- package/test/Date.test.js +0 -393
- package/test/Dialog.test.js +0 -23
- package/test/Dropdown.test.js +0 -130
- package/test/Footer.test.js +0 -99
- package/test/Header.test.js +0 -39
- package/test/Heading.test.js +0 -35
- package/test/InputText.test.js +0 -240
- package/test/Link.test.js +0 -43
- package/test/Paginator.test.js +0 -177
- package/test/ProgressBar.test.js +0 -35
- package/test/Radio.test.js +0 -37
- package/test/ResultsetTable.test.js +0 -330
- package/test/Select.test.js +0 -192
- package/test/Sidenav.test.js +0 -45
- package/test/Slider.test.js +0 -82
- package/test/Spinner.test.js +0 -27
- package/test/Switch.test.js +0 -45
- package/test/Table.test.js +0 -36
- package/test/Tabs.test.js +0 -109
- package/test/TabsForSections.test.js +0 -34
- package/test/Tag.test.js +0 -32
- package/test/TextArea.test.js +0 -52
- package/test/ToggleGroup.test.js +0 -81
- package/test/Upload.test.js +0 -60
- package/test/Wizard.test.js +0 -130
- package/test/mocks/pngMock.js +0 -1
- package/test/mocks/svgMock.js +0 -1
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
5
|
+
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
10
|
exports["default"] = void 0;
|
|
11
11
|
|
|
12
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
|
|
14
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
13
|
|
|
16
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -21,105 +19,19 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
21
19
|
|
|
22
20
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
23
21
|
|
|
24
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
|
-
|
|
26
22
|
var _variables = require("../common/variables.js");
|
|
27
23
|
|
|
28
24
|
var _Table = _interopRequireDefault(require("../table/Table"));
|
|
29
25
|
|
|
30
26
|
var _Paginator = _interopRequireDefault(require("../paginator/Paginator"));
|
|
31
27
|
|
|
32
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
33
|
-
|
|
34
|
-
function _templateObject9() {
|
|
35
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n overflow-y: hidden;\n overflow-x: auto;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n &::-webkit-scrollbar {\n height: 6px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 6px;\n }\n\n &::-webkit-scrollbar-track {\n background-color: ", ";\n border-radius: 6px;\n }\n"]);
|
|
36
|
-
|
|
37
|
-
_templateObject9 = function _templateObject9() {
|
|
38
|
-
return data;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
return data;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function _templateObject8() {
|
|
45
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: 60px;\n"]);
|
|
46
|
-
|
|
47
|
-
_templateObject8 = function _templateObject8() {
|
|
48
|
-
return data;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
return data;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function _templateObject7() {
|
|
55
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: ", ";\n width: 100%;\n"]);
|
|
56
|
-
|
|
57
|
-
_templateObject7 = function _templateObject7() {
|
|
58
|
-
return data;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
return data;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function _templateObject6() {
|
|
65
|
-
var data = (0, _taggedTemplateLiteral2["default"])([""]);
|
|
66
|
-
|
|
67
|
-
_templateObject6 = function _templateObject6() {
|
|
68
|
-
return data;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
return data;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function _templateObject5() {
|
|
75
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n cursor: ", ";\n"]);
|
|
76
|
-
|
|
77
|
-
_templateObject5 = function _templateObject5() {
|
|
78
|
-
return data;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
return data;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function _templateObject4() {
|
|
85
|
-
var data = (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"]);
|
|
86
|
-
|
|
87
|
-
_templateObject4 = function _templateObject4() {
|
|
88
|
-
return data;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
return data;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function _templateObject3() {
|
|
95
|
-
var data = (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"]);
|
|
96
|
-
|
|
97
|
-
_templateObject3 = function _templateObject3() {
|
|
98
|
-
return data;
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
return data;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function _templateObject2() {
|
|
105
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: ", ";\n margin-right: ", ";\n"]);
|
|
106
|
-
|
|
107
|
-
_templateObject2 = function _templateObject2() {
|
|
108
|
-
return data;
|
|
109
|
-
};
|
|
28
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
110
29
|
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function _templateObject() {
|
|
115
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n & table {\n table-layout: auto;\n }\n"]);
|
|
30
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
116
31
|
|
|
117
|
-
|
|
118
|
-
return data;
|
|
119
|
-
};
|
|
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); }
|
|
120
33
|
|
|
121
|
-
|
|
122
|
-
}
|
|
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; }
|
|
123
35
|
|
|
124
36
|
function normalizeSortValue(sortValue) {
|
|
125
37
|
return typeof sortValue === "string" ? sortValue.toUpperCase() : sortValue;
|
|
@@ -154,46 +66,46 @@ var getMaxItemsPerPageIndex = function getMaxItemsPerPageIndex(minItemsPerPageIn
|
|
|
154
66
|
};
|
|
155
67
|
|
|
156
68
|
var ArrowUp = function ArrowUp() {
|
|
157
|
-
return _react["default"].createElement("svg", {
|
|
69
|
+
return /*#__PURE__*/_react["default"].createElement("svg", {
|
|
158
70
|
xmlns: "http://www.w3.org/2000/svg",
|
|
159
71
|
height: "24",
|
|
160
72
|
viewBox: "0 0 24 24",
|
|
161
73
|
width: "24",
|
|
162
74
|
fill: "currentColor"
|
|
163
|
-
}, _react["default"].createElement("path", {
|
|
75
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
164
76
|
d: "M0 0h24v24H0V0z",
|
|
165
77
|
fill: "none"
|
|
166
|
-
}), _react["default"].createElement("path", {
|
|
78
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
167
79
|
d: "M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"
|
|
168
80
|
}));
|
|
169
81
|
};
|
|
170
82
|
|
|
171
83
|
var ArrowDown = function ArrowDown() {
|
|
172
|
-
return _react["default"].createElement("svg", {
|
|
84
|
+
return /*#__PURE__*/_react["default"].createElement("svg", {
|
|
173
85
|
xmlns: "http://www.w3.org/2000/svg",
|
|
174
86
|
height: "24",
|
|
175
87
|
viewBox: "0 0 24 24",
|
|
176
88
|
width: "24",
|
|
177
89
|
fill: "currentColor"
|
|
178
|
-
}, _react["default"].createElement("path", {
|
|
90
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
179
91
|
d: "M0 0h24v24H0V0z",
|
|
180
92
|
fill: "none"
|
|
181
|
-
}), _react["default"].createElement("path", {
|
|
93
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
182
94
|
d: "M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
|
|
183
95
|
}));
|
|
184
96
|
};
|
|
185
97
|
|
|
186
98
|
var BothArrows = function BothArrows() {
|
|
187
|
-
return _react["default"].createElement("svg", {
|
|
99
|
+
return /*#__PURE__*/_react["default"].createElement("svg", {
|
|
188
100
|
xmlns: "http://www.w3.org/2000/svg",
|
|
189
101
|
height: "24",
|
|
190
102
|
viewBox: "0 0 24 24",
|
|
191
103
|
width: "24",
|
|
192
104
|
fill: "currentColor"
|
|
193
|
-
}, _react["default"].createElement("path", {
|
|
105
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
194
106
|
d: "M0 0h24v24H0z",
|
|
195
107
|
fill: "none"
|
|
196
|
-
}), _react["default"].createElement("path", {
|
|
108
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
197
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"
|
|
198
110
|
}));
|
|
199
111
|
};
|
|
@@ -201,6 +113,8 @@ var BothArrows = function BothArrows() {
|
|
|
201
113
|
var DxcResultsetTable = function DxcResultsetTable(_ref) {
|
|
202
114
|
var columns = _ref.columns,
|
|
203
115
|
rows = _ref.rows,
|
|
116
|
+
_ref$showGoToPage = _ref.showGoToPage,
|
|
117
|
+
showGoToPage = _ref$showGoToPage === void 0 ? true : _ref$showGoToPage,
|
|
204
118
|
_ref$itemsPerPage = _ref.itemsPerPage,
|
|
205
119
|
itemsPerPage = _ref$itemsPerPage === void 0 ? 5 : _ref$itemsPerPage,
|
|
206
120
|
itemsPerPageOptions = _ref.itemsPerPageOptions,
|
|
@@ -243,7 +157,7 @@ var DxcResultsetTable = function DxcResultsetTable(_ref) {
|
|
|
243
157
|
};
|
|
244
158
|
|
|
245
159
|
var getIconForSortableColumn = function getIconForSortableColumn(clickedColumnIndex) {
|
|
246
|
-
return sortColumnIndex === clickedColumnIndex ? sortOrder === "asc" ? _react["default"].createElement(ArrowUp, null) : _react["default"].createElement(ArrowDown, null) : _react["default"].createElement(BothArrows, null);
|
|
160
|
+
return sortColumnIndex === clickedColumnIndex ? sortOrder === "asc" ? /*#__PURE__*/_react["default"].createElement(ArrowUp, null) : /*#__PURE__*/_react["default"].createElement(ArrowDown, null) : /*#__PURE__*/_react["default"].createElement(BothArrows, null);
|
|
247
161
|
};
|
|
248
162
|
|
|
249
163
|
(0, _react.useEffect)(function () {
|
|
@@ -259,80 +173,67 @@ var DxcResultsetTable = function DxcResultsetTable(_ref) {
|
|
|
259
173
|
var filteredResultset = (0, _react.useMemo)(function () {
|
|
260
174
|
return sortedResultset && sortedResultset.slice(minItemsPerPageIndex, maxItemsPerPageIndex + 1);
|
|
261
175
|
}, [sortedResultset, minItemsPerPageIndex, maxItemsPerPageIndex]);
|
|
262
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
176
|
+
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
263
177
|
theme: colorsTheme.table
|
|
264
|
-
}, _react["default"].createElement(DxcResultsetTableContainer, {
|
|
178
|
+
}, /*#__PURE__*/_react["default"].createElement(DxcResultsetTableContainer, {
|
|
265
179
|
margin: margin
|
|
266
|
-
}, _react["default"].createElement(TableContainer, null, _react["default"].createElement(_Table["default"], {
|
|
267
|
-
|
|
268
|
-
top: margin,
|
|
269
|
-
right: margin,
|
|
270
|
-
bottom: "0px",
|
|
271
|
-
left: margin
|
|
272
|
-
}
|
|
273
|
-
}, _react["default"].createElement(HeaderRow, null, _react["default"].createElement("tr", null, columns.map(function (column, index) {
|
|
274
|
-
return _react["default"].createElement(TableHeader, {
|
|
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, {
|
|
275
182
|
key: "tableHeader_".concat(index)
|
|
276
|
-
}, _react["default"].createElement(HeaderContainer, {
|
|
183
|
+
}, /*#__PURE__*/_react["default"].createElement(HeaderContainer, {
|
|
277
184
|
key: "headerContainer_".concat(index),
|
|
278
185
|
onClick: function onClick() {
|
|
279
186
|
return column.isSortable && changeSorting(index);
|
|
280
187
|
},
|
|
281
188
|
tabIndex: column.isSortable ? tabIndex : -1
|
|
282
|
-
}, _react["default"].createElement(TitleDiv, {
|
|
189
|
+
}, /*#__PURE__*/_react["default"].createElement(TitleDiv, {
|
|
283
190
|
isSortable: column.isSortable
|
|
284
|
-
}, column.displayValue), column.isSortable && _react["default"].createElement(SortIcon, null, getIconForSortableColumn(index))));
|
|
285
|
-
}))), _react["default"].createElement(TableRowGroup, null, filteredResultset.map(function (cells, index) {
|
|
286
|
-
return _react["default"].createElement("tr", {
|
|
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", {
|
|
287
194
|
key: "resultSetTableCell_".concat(index)
|
|
288
195
|
}, cells.map(function (cellContent, index) {
|
|
289
|
-
return _react["default"].createElement("td", {
|
|
196
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
290
197
|
key: "resultSetTableCellContent_".concat(index)
|
|
291
198
|
}, cellContent.displayValue);
|
|
292
199
|
}));
|
|
293
|
-
})))), _react["default"].createElement(PaginatorContainer, {
|
|
294
|
-
margin: margin
|
|
295
|
-
}, _react["default"].createElement(_Paginator["default"], {
|
|
200
|
+
})))), /*#__PURE__*/_react["default"].createElement(PaginatorContainer, null, /*#__PURE__*/_react["default"].createElement(_Paginator["default"], {
|
|
296
201
|
totalItems: rows.length,
|
|
297
202
|
itemsPerPage: itemsPerPage,
|
|
298
203
|
itemsPerPageOptions: itemsPerPageOptions,
|
|
299
204
|
itemsPerPageFunction: itemsPerPageFunction,
|
|
300
205
|
currentPage: page,
|
|
301
|
-
showGoToPage:
|
|
206
|
+
showGoToPage: showGoToPage,
|
|
302
207
|
onPageChange: goToPage,
|
|
303
208
|
tabIndex: tabIndex
|
|
304
209
|
}))));
|
|
305
210
|
};
|
|
306
211
|
|
|
307
|
-
var TableContainer = _styledComponents["default"].div(_templateObject());
|
|
212
|
+
var TableContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n & table {\n table-layout: auto;\n }\n"])));
|
|
308
213
|
|
|
309
|
-
var PaginatorContainer = _styledComponents["default"].div(_templateObject2(
|
|
310
|
-
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
311
|
-
}, function (props) {
|
|
312
|
-
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
313
|
-
});
|
|
214
|
+
var PaginatorContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])([""])));
|
|
314
215
|
|
|
315
|
-
var TableRowGroup = _styledComponents["default"].tbody(_templateObject3(), function (props) {
|
|
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) {
|
|
316
217
|
return props.theme.rowHeight || "70px";
|
|
317
218
|
});
|
|
318
219
|
|
|
319
|
-
var SortIcon = _styledComponents["default"].div(_templateObject4(), function (props) {
|
|
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) {
|
|
320
221
|
return props.theme.sortIconColor;
|
|
321
222
|
});
|
|
322
223
|
|
|
323
|
-
var TitleDiv = _styledComponents["default"].div(_templateObject5(), function (props) {
|
|
224
|
+
var TitleDiv = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n cursor: ", ";\n"])), function (props) {
|
|
324
225
|
return props.isSortable && "pointer" || "default";
|
|
325
226
|
});
|
|
326
227
|
|
|
327
|
-
var TableHeader = _styledComponents["default"].th(_templateObject6());
|
|
228
|
+
var TableHeader = _styledComponents["default"].th(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])([""])));
|
|
328
229
|
|
|
329
|
-
var HeaderContainer = _styledComponents["default"].div(_templateObject7(), function (props) {
|
|
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) {
|
|
330
231
|
return props.theme.headerTextAlign === "center" ? "center" : props.theme.headerTextAlign === "right" ? "flex-end" : "flex-start";
|
|
331
232
|
});
|
|
332
233
|
|
|
333
|
-
var HeaderRow = _styledComponents["default"].thead(_templateObject8());
|
|
234
|
+
var HeaderRow = _styledComponents["default"].thead(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n height: 60px;\n"])));
|
|
334
235
|
|
|
335
|
-
var DxcResultsetTableContainer = _styledComponents["default"].div(_templateObject9(), function (props) {
|
|
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) {
|
|
336
237
|
return props.theme.fontSizeBase;
|
|
337
238
|
}, function (props) {
|
|
338
239
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
@@ -344,32 +245,7 @@ var DxcResultsetTableContainer = _styledComponents["default"].div(_templateObjec
|
|
|
344
245
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
345
246
|
}, function (props) {
|
|
346
247
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
347
|
-
}, function (props) {
|
|
348
|
-
return props.theme.scrollBarThumbColor;
|
|
349
|
-
}, function (props) {
|
|
350
|
-
return props.theme.scrollBarTrackColor;
|
|
351
248
|
});
|
|
352
249
|
|
|
353
|
-
DxcResultsetTable.propTypes = {
|
|
354
|
-
rows: _propTypes["default"].array,
|
|
355
|
-
columns: _propTypes["default"].array,
|
|
356
|
-
itemsPerPage: _propTypes["default"].number,
|
|
357
|
-
itemsPerPageOptions: _propTypes["default"].arrayOf(_propTypes["default"].number),
|
|
358
|
-
itemsPerPageFunction: _propTypes["default"].func,
|
|
359
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
360
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
361
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
362
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
363
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
364
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
365
|
-
tabIndex: _propTypes["default"].number
|
|
366
|
-
};
|
|
367
|
-
DxcResultsetTable.defaultProps = {
|
|
368
|
-
rows: [],
|
|
369
|
-
columns: [],
|
|
370
|
-
itemsPerPage: 5,
|
|
371
|
-
itemsPerPageOptions: null,
|
|
372
|
-
itemsPerPageFunction: null
|
|
373
|
-
};
|
|
374
250
|
var _default = DxcResultsetTable;
|
|
375
251
|
exports["default"] = _default;
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import DxcResultsetTable from "./ResultsetTable";
|
|
3
|
+
import DxcButton from "../button/Button";
|
|
4
|
+
import Title from "../../.storybook/components/Title";
|
|
5
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
6
|
+
import { userEvent, within } from "@storybook/testing-library";
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: "Resultset Table",
|
|
10
|
+
component: DxcResultsetTable,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const deleteIcon = () => {
|
|
14
|
+
return (
|
|
15
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">
|
|
16
|
+
<path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" />
|
|
17
|
+
<path d="M0 0h24v24H0z" fill="none" />
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const columns = [{ displayValue: "Id" }, { displayValue: "Name" }, { displayValue: "City" }];
|
|
23
|
+
|
|
24
|
+
const rows = [
|
|
25
|
+
[{ displayValue: "001" }, { displayValue: "Peter" }, { displayValue: "Miami" }],
|
|
26
|
+
[{ displayValue: "002" }, { displayValue: "Louis" }, { displayValue: "London" }],
|
|
27
|
+
[{ displayValue: "003" }, { displayValue: "Lana" }, { displayValue: "Amsterdam" }],
|
|
28
|
+
[{ displayValue: "004" }, { displayValue: "Rick" }, { displayValue: "London" }],
|
|
29
|
+
[{ displayValue: "005" }, { displayValue: "Mark" }, { displayValue: "Miami" }],
|
|
30
|
+
[{ displayValue: "006" }, { displayValue: "Cris" }, { displayValue: "Paris" }],
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const rowsIcon = [
|
|
34
|
+
[
|
|
35
|
+
{ displayValue: "001", sortValue: "001" },
|
|
36
|
+
{ displayValue: "Peter" },
|
|
37
|
+
{ displayValue: <DxcButton icon={deleteIcon} /> },
|
|
38
|
+
],
|
|
39
|
+
[{ displayValue: "002", sortValue: "002" }, { displayValue: "Louis" }, { displayValue: "" }],
|
|
40
|
+
[
|
|
41
|
+
{ displayValue: "003", sortValue: "003" },
|
|
42
|
+
{ displayValue: "Mark" },
|
|
43
|
+
{ displayValue: <DxcButton icon={deleteIcon} /> },
|
|
44
|
+
],
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
const columnsSortable = [
|
|
48
|
+
{ displayValue: "Id", isSortable: true },
|
|
49
|
+
{ displayValue: "Name", isSortable: true },
|
|
50
|
+
{ displayValue: "City", isSortable: false },
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
const rowsSortable = [
|
|
54
|
+
[
|
|
55
|
+
{ displayValue: "001", sortValue: "001" },
|
|
56
|
+
{ displayValue: "Peter", sortValue: "Peter" },
|
|
57
|
+
{ displayValue: "Miami", sortValue: "Miami" },
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
{ displayValue: "002", sortValue: "002" },
|
|
61
|
+
{ displayValue: "Louis", sortValue: "Louis" },
|
|
62
|
+
{ displayValue: "London", sortValue: "London" },
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
{ displayValue: "003", sortValue: "003" },
|
|
66
|
+
{ displayValue: "Aida", sortValue: "Aida" },
|
|
67
|
+
{ displayValue: "Wroclaw", sortValue: "Wroclaw" },
|
|
68
|
+
],
|
|
69
|
+
[
|
|
70
|
+
{ displayValue: "004", sortValue: "004" },
|
|
71
|
+
{ displayValue: "Lana", sortValue: "Lana" },
|
|
72
|
+
{ displayValue: "Amsterdam", sortValue: "Amsterdam" },
|
|
73
|
+
],
|
|
74
|
+
];
|
|
75
|
+
|
|
76
|
+
const longColumns = [
|
|
77
|
+
{ displayValue: "Column1" },
|
|
78
|
+
{ displayValue: "Column2" },
|
|
79
|
+
{ displayValue: "Column3" },
|
|
80
|
+
{ displayValue: "Column4" },
|
|
81
|
+
{ displayValue: "Column5" },
|
|
82
|
+
{ displayValue: "Column6" },
|
|
83
|
+
{ displayValue: "Column7" },
|
|
84
|
+
{ displayValue: "Column8" },
|
|
85
|
+
{ displayValue: "Column9" },
|
|
86
|
+
{ displayValue: "Column10" },
|
|
87
|
+
{ displayValue: "Column11" },
|
|
88
|
+
{ displayValue: "Column12" },
|
|
89
|
+
{ displayValue: "Column13" },
|
|
90
|
+
{ displayValue: "Column14" },
|
|
91
|
+
{ displayValue: "Column15" },
|
|
92
|
+
{ displayValue: "Column16" },
|
|
93
|
+
{ displayValue: "Column17" },
|
|
94
|
+
{ displayValue: "Column18" },
|
|
95
|
+
{ displayValue: "Column19" },
|
|
96
|
+
{ displayValue: "Column20" },
|
|
97
|
+
];
|
|
98
|
+
|
|
99
|
+
const longRows = [
|
|
100
|
+
[
|
|
101
|
+
{ displayValue: "001", sortValue: "001" },
|
|
102
|
+
{ displayValue: "Peter", sortValue: "Peter" },
|
|
103
|
+
{ displayValue: "Miami", sortValue: "Miami" },
|
|
104
|
+
{ displayValue: "001", sortValue: "001" },
|
|
105
|
+
{ displayValue: "Peter", sortValue: "Peter" },
|
|
106
|
+
{ displayValue: "Miami", sortValue: "Miami" },
|
|
107
|
+
{ displayValue: "Miami", sortValue: "Miami" },
|
|
108
|
+
{ displayValue: "001", sortValue: "001" },
|
|
109
|
+
{ displayValue: "Peter", sortValue: "Peter" },
|
|
110
|
+
{ displayValue: "Miami", sortValue: "Miami" },
|
|
111
|
+
{ displayValue: "002", sortValue: "002" },
|
|
112
|
+
{ displayValue: "Louis", sortValue: "Louis" },
|
|
113
|
+
{ displayValue: "London", sortValue: "London" },
|
|
114
|
+
{ displayValue: "002", sortValue: "002" },
|
|
115
|
+
{ displayValue: "Louis", sortValue: "Louis" },
|
|
116
|
+
{ displayValue: "London", sortValue: "London" },
|
|
117
|
+
{ displayValue: "002", sortValue: "002" },
|
|
118
|
+
{ displayValue: "Louis", sortValue: "Louis" },
|
|
119
|
+
{ displayValue: "London", sortValue: "London" },
|
|
120
|
+
{ displayValue: "London", sortValue: "London" },
|
|
121
|
+
],
|
|
122
|
+
[
|
|
123
|
+
{ displayValue: "002", sortValue: "002" },
|
|
124
|
+
{ displayValue: "Louis", sortValue: "Louis" },
|
|
125
|
+
{ displayValue: "London", sortValue: "London" },
|
|
126
|
+
{ displayValue: "002", sortValue: "002" },
|
|
127
|
+
{ displayValue: "Louis", sortValue: "Louis" },
|
|
128
|
+
{ displayValue: "London", sortValue: "London" },
|
|
129
|
+
{ displayValue: "002", sortValue: "002" },
|
|
130
|
+
{ displayValue: "Louis", sortValue: "Louis" },
|
|
131
|
+
{ displayValue: "London", sortValue: "London" },
|
|
132
|
+
{ displayValue: "London", sortValue: "London" },
|
|
133
|
+
{ displayValue: "002", sortValue: "002" },
|
|
134
|
+
{ displayValue: "Louis", sortValue: "Louis" },
|
|
135
|
+
{ displayValue: "London", sortValue: "London" },
|
|
136
|
+
{ displayValue: "002", sortValue: "002" },
|
|
137
|
+
{ displayValue: "Louis", sortValue: "Louis" },
|
|
138
|
+
{ displayValue: "London", sortValue: "London" },
|
|
139
|
+
{ displayValue: "002", sortValue: "002" },
|
|
140
|
+
{ displayValue: "Louis", sortValue: "Louis" },
|
|
141
|
+
{ displayValue: "London", sortValue: "London" },
|
|
142
|
+
{ displayValue: "London", sortValue: "London" },
|
|
143
|
+
],
|
|
144
|
+
[
|
|
145
|
+
{ displayValue: "002", sortValue: "002" },
|
|
146
|
+
{ displayValue: "Louis", sortValue: "Louis" },
|
|
147
|
+
{ displayValue: "London", sortValue: "London" },
|
|
148
|
+
{ displayValue: "002", sortValue: "002" },
|
|
149
|
+
{ displayValue: "Louis", sortValue: "Louis" },
|
|
150
|
+
{ displayValue: "London", sortValue: "London" },
|
|
151
|
+
{ displayValue: "002", sortValue: "002" },
|
|
152
|
+
{ displayValue: "Louis", sortValue: "Louis" },
|
|
153
|
+
{ displayValue: "London", sortValue: "London" },
|
|
154
|
+
{ displayValue: "London", sortValue: "London" },
|
|
155
|
+
{ displayValue: "002", sortValue: "002" },
|
|
156
|
+
{ displayValue: "Louis", sortValue: "Louis" },
|
|
157
|
+
{ displayValue: "London", sortValue: "London" },
|
|
158
|
+
{ displayValue: "002", sortValue: "002" },
|
|
159
|
+
{ displayValue: "Louis", sortValue: "Louis" },
|
|
160
|
+
{ displayValue: "London", sortValue: "London" },
|
|
161
|
+
{ displayValue: "002", sortValue: "002" },
|
|
162
|
+
{ displayValue: "Louis", sortValue: "Louis" },
|
|
163
|
+
{ displayValue: "London", sortValue: "London" },
|
|
164
|
+
{ displayValue: "London", sortValue: "London" },
|
|
165
|
+
],
|
|
166
|
+
];
|
|
167
|
+
|
|
168
|
+
export const Chromatic = () => (
|
|
169
|
+
<>
|
|
170
|
+
<ExampleContainer>
|
|
171
|
+
<Title title="Sortable table" theme="light" level={4} />
|
|
172
|
+
<DxcResultsetTable columns={columnsSortable} rows={rowsSortable}></DxcResultsetTable>
|
|
173
|
+
</ExampleContainer>
|
|
174
|
+
<ExampleContainer>
|
|
175
|
+
<Title title="With action" theme="light" level={4} />
|
|
176
|
+
<DxcResultsetTable columns={columns} rows={rowsIcon}></DxcResultsetTable>
|
|
177
|
+
</ExampleContainer>
|
|
178
|
+
<ExampleContainer>
|
|
179
|
+
<Title title="With items per page option" theme="light" level={4} />
|
|
180
|
+
<DxcResultsetTable
|
|
181
|
+
columns={columns}
|
|
182
|
+
rows={rows}
|
|
183
|
+
itemsPerPage={2}
|
|
184
|
+
itemsPerPageOptions={[2, 3]}
|
|
185
|
+
></DxcResultsetTable>
|
|
186
|
+
</ExampleContainer>
|
|
187
|
+
<ExampleContainer>
|
|
188
|
+
<Title title="Scroll resultset table" theme="light" level={4} />
|
|
189
|
+
<DxcResultsetTable columns={longColumns} rows={longRows}></DxcResultsetTable>
|
|
190
|
+
</ExampleContainer>
|
|
191
|
+
<Title title="Margins" theme="light" level={2} />
|
|
192
|
+
<ExampleContainer>
|
|
193
|
+
<Title title="Xxsmall" theme="light" level={4} />
|
|
194
|
+
<DxcResultsetTable columns={columns} rows={rows} margin={"xxsmall"}></DxcResultsetTable>
|
|
195
|
+
</ExampleContainer>
|
|
196
|
+
<ExampleContainer>
|
|
197
|
+
<Title title="Xsmall" theme="light" level={4} />
|
|
198
|
+
<DxcResultsetTable columns={columns} rows={rows} margin={"xsmall"}></DxcResultsetTable>
|
|
199
|
+
</ExampleContainer>
|
|
200
|
+
<ExampleContainer>
|
|
201
|
+
<Title title="Small" theme="light" level={4} />
|
|
202
|
+
<DxcResultsetTable columns={columns} rows={rows} margin={"small"}></DxcResultsetTable>
|
|
203
|
+
</ExampleContainer>
|
|
204
|
+
<ExampleContainer>
|
|
205
|
+
<Title title="Medium" theme="light" level={4} />
|
|
206
|
+
<DxcResultsetTable columns={columns} rows={rows} margin={"medium"}></DxcResultsetTable>
|
|
207
|
+
</ExampleContainer>
|
|
208
|
+
<ExampleContainer>
|
|
209
|
+
<Title title="Large" theme="light" level={4} />
|
|
210
|
+
<DxcResultsetTable columns={columns} rows={rows} margin={"large"}></DxcResultsetTable>
|
|
211
|
+
</ExampleContainer>
|
|
212
|
+
<ExampleContainer>
|
|
213
|
+
<Title title="Xlarge" theme="light" level={4} />
|
|
214
|
+
<DxcResultsetTable columns={columns} rows={rows} margin={"xlarge"}></DxcResultsetTable>
|
|
215
|
+
</ExampleContainer>
|
|
216
|
+
<ExampleContainer>
|
|
217
|
+
<Title title="Xxlarge" theme="light" level={4} />
|
|
218
|
+
<DxcResultsetTable columns={columns} rows={rows} margin={"xxlarge"}></DxcResultsetTable>
|
|
219
|
+
</ExampleContainer>
|
|
220
|
+
</>
|
|
221
|
+
);
|
|
222
|
+
|
|
223
|
+
const ResultsetTableAsc = () => (
|
|
224
|
+
<ExampleContainer>
|
|
225
|
+
<Title title="Ascendant sorting" theme="light" level={4} />
|
|
226
|
+
<DxcResultsetTable columns={columnsSortable} rows={rowsSortable}></DxcResultsetTable>
|
|
227
|
+
</ExampleContainer>
|
|
228
|
+
);
|
|
229
|
+
|
|
230
|
+
export const AscendentSorting = ResultsetTableAsc.bind({});
|
|
231
|
+
AscendentSorting.play = async ({ canvasElement }) => {
|
|
232
|
+
const canvas = within(canvasElement);
|
|
233
|
+
await userEvent.click(canvas.queryByText("Name"));
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
const ResultsetTableDesc = () => (
|
|
237
|
+
<ExampleContainer>
|
|
238
|
+
<Title title="Descendant sorting" theme="light" level={4} />
|
|
239
|
+
<DxcResultsetTable columns={columnsSortable} rows={rowsSortable}></DxcResultsetTable>
|
|
240
|
+
</ExampleContainer>
|
|
241
|
+
);
|
|
242
|
+
|
|
243
|
+
export const DescendantSorting = ResultsetTableDesc.bind({});
|
|
244
|
+
DescendantSorting.play = async ({ canvasElement }) => {
|
|
245
|
+
const canvas = within(canvasElement);
|
|
246
|
+
await userEvent.click(canvas.queryByText("Name"));
|
|
247
|
+
await userEvent.click(canvas.queryByText("Name"));
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
const ResultsetTableMiddle = () => (
|
|
251
|
+
<ExampleContainer>
|
|
252
|
+
<Title title="Middle page" theme="light" level={4} />
|
|
253
|
+
<DxcResultsetTable columns={columns} rows={rows} itemsPerPage={2}></DxcResultsetTable>
|
|
254
|
+
</ExampleContainer>
|
|
255
|
+
);
|
|
256
|
+
|
|
257
|
+
export const MiddlePage = ResultsetTableMiddle.bind({});
|
|
258
|
+
MiddlePage.play = async ({ canvasElement }) => {
|
|
259
|
+
const canvas = within(canvasElement);
|
|
260
|
+
const nextButton = canvas.getAllByRole("button")[2];
|
|
261
|
+
await userEvent.click(nextButton);
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
const ResultsetTableLast = () => (
|
|
265
|
+
<ExampleContainer>
|
|
266
|
+
<Title title="Last page" theme="light" level={4} />
|
|
267
|
+
<DxcResultsetTable columns={columns} rows={rows} itemsPerPage={2}></DxcResultsetTable>
|
|
268
|
+
</ExampleContainer>
|
|
269
|
+
);
|
|
270
|
+
|
|
271
|
+
export const LastPage = ResultsetTableLast.bind({});
|
|
272
|
+
LastPage.play = async ({ canvasElement }) => {
|
|
273
|
+
const canvas = within(canvasElement);
|
|
274
|
+
const nextButton = canvas.getAllByRole("button")[3];
|
|
275
|
+
await userEvent.click(nextButton);
|
|
276
|
+
};
|