@dxc-technology/halstack-react 0.0.0-9427b76 → 0.0.0-9439a0d
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.js +50 -0
- package/ThemeContext.js +246 -0
- package/{dist/select/Select.js → V3Select/V3Select.js} +38 -132
- package/V3Select/index.d.ts +27 -0
- package/{dist/textarea/Textarea.js → V3Textarea/V3Textarea.js} +14 -18
- package/V3Textarea/index.d.ts +27 -0
- package/accordion/Accordion.d.ts +4 -0
- package/{dist/accordion → accordion}/Accordion.js +35 -130
- 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/types.d.ts +72 -0
- package/accordion-group/types.js +5 -0
- package/alert/Alert.d.ts +4 -0
- package/{dist/alert → alert}/Alert.js +41 -154
- 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 +13 -43
- 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/{dist/button → button}/Button.js +23 -84
- 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 +33 -123
- package/card/Card.stories.tsx +201 -0
- package/card/ice-cream.jpg +0 -0
- package/card/types.d.ts +69 -0
- package/card/types.js +5 -0
- package/checkbox/Checkbox.d.ts +4 -0
- package/{dist/checkbox → checkbox}/Checkbox.js +16 -63
- package/checkbox/Checkbox.stories.tsx +192 -0
- package/checkbox/types.d.ts +60 -0
- package/checkbox/types.js +5 -0
- package/{dist/chip → chip}/Chip.js +17 -61
- package/chip/Chip.stories.tsx +121 -0
- package/chip/index.d.ts +22 -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/{dist/common → common}/variables.js +240 -107
- package/{dist/date → date}/Date.js +16 -22
- package/date/index.d.ts +27 -0
- package/date-input/DateInput.d.ts +4 -0
- package/{dist/new-date/NewDate.js → date-input/DateInput.js} +55 -94
- 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 +20 -73
- 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/{dist/dropdown → dropdown}/Dropdown.js +44 -171
- package/dropdown/types.d.ts +89 -0
- package/dropdown/types.js +5 -0
- package/file-input/FileInput.d.ts +4 -0
- package/{dist/file-input → file-input}/FileInput.js +60 -190
- package/file-input/FileItem.d.ts +14 -0
- package/file-input/FileItem.js +182 -0
- package/file-input/types.d.ts +87 -0
- package/file-input/types.js +5 -0
- package/footer/Footer.d.ts +4 -0
- package/footer/Footer.js +266 -0
- package/footer/Footer.stories.jsx +151 -0
- package/footer/Icons.js +77 -0
- package/footer/types.d.ts +61 -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.js +34 -0
- package/header/types.d.ts +45 -0
- package/header/types.js +5 -0
- package/heading/Heading.d.ts +4 -0
- package/{dist/heading → heading}/Heading.js +30 -89
- 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 +37 -133
- package/input-text/index.d.ts +36 -0
- package/{dist/layout → layout}/ApplicationLayout.js +35 -131
- package/layout/Icons.js +55 -0
- package/link/Link.d.ts +3 -0
- package/{dist/link → link}/Link.js +18 -94
- package/link/Link.stories.tsx +146 -0
- package/link/types.d.ts +74 -0
- package/link/types.js +5 -0
- package/main.d.ts +44 -0
- package/{dist/main.js → main.js} +100 -96
- package/number-input/NumberInput.d.ts +4 -0
- package/number-input/NumberInput.js +86 -0
- package/number-input/NumberInput.stories.tsx +115 -0
- package/{dist/number/NumberContext.js → number-input/NumberInputContext.js} +2 -2
- package/number-input/types.d.ts +117 -0
- package/number-input/types.js +5 -0
- package/package.json +32 -25
- package/paginator/Icons.js +66 -0
- package/paginator/Paginator.d.ts +4 -0
- package/paginator/Paginator.js +198 -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/{dist/password/Password.js → password-input/PasswordInput.js} +26 -64
- package/password-input/PasswordInput.stories.tsx +131 -0
- package/password-input/types.d.ts +100 -0
- package/password-input/types.js +5 -0
- package/progress-bar/ProgressBar.d.ts +4 -0
- package/{dist/progress-bar → progress-bar}/ProgressBar.js +20 -92
- 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 +15 -50
- package/radio/Radio.stories.tsx +192 -0
- package/radio/types.d.ts +54 -0
- package/radio/types.js +5 -0
- package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +35 -119
- package/resultsetTable/index.d.ts +19 -0
- package/select/Select.js +865 -0
- package/select/Select.stories.tsx +572 -0
- package/select/index.d.ts +131 -0
- package/sidenav/Sidenav.d.ts +9 -0
- package/{dist/sidenav → sidenav}/Sidenav.js +19 -62
- 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/switch/Switch.d.ts +4 -0
- package/{dist/switch → switch}/Switch.js +26 -69
- 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 +10 -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 +211 -0
- package/tabs/types.d.ts +71 -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/{dist/new-input-text/NewInputText.js → text-input/TextInput.js} +270 -409
- package/{dist/new-input-text → text-input}/index.d.ts +3 -3
- package/{dist/new-textarea/NewTextarea.js → textarea/Textarea.js} +31 -76
- package/textarea/Textarea.stories.jsx +135 -0
- package/{dist/new-textarea → textarea}/index.d.ts +1 -1
- package/{dist/toggle → toggle}/Toggle.js +15 -49
- package/toggle/index.d.ts +21 -0
- package/toggle-group/ToggleGroup.js +243 -0
- package/toggle-group/ToggleGroup.stories.tsx +178 -0
- package/toggle-group/index.d.ts +21 -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 +12 -26
- 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/{dist/useTheme.js → useTheme.js} +0 -0
- package/wizard/Icons.js +65 -0
- package/wizard/Wizard.d.ts +4 -0
- package/{dist/wizard → wizard}/Wizard.js +33 -213
- package/wizard/Wizard.stories.jsx +224 -0
- package/wizard/types.d.ts +64 -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 -248
- package/dist/accordion-group/AccordionGroup.js +0 -186
- package/dist/alert/index.d.ts +0 -51
- package/dist/badge/Badge.js +0 -63
- package/dist/checkbox/Checkbox.stories.js +0 -144
- package/dist/checkbox/readme.md +0 -116
- package/dist/date/Date.stories.js +0 -205
- package/dist/date/readme.md +0 -73
- package/dist/file-input/FileItem.js +0 -280
- package/dist/file-input/index.d.ts +0 -81
- package/dist/footer/Footer.js +0 -395
- package/dist/footer/Footer.stories.js +0 -94
- package/dist/footer/dxc_logo.svg +0 -15
- package/dist/footer/readme.md +0 -41
- package/dist/header/Header.js +0 -403
- package/dist/header/Header.stories.js +0 -176
- package/dist/header/close_icon.svg +0 -1
- package/dist/header/dxc_logo_black.svg +0 -8
- 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/readme.md +0 -51
- package/dist/main.d.ts +0 -7
- package/dist/new-date/index.d.ts +0 -95
- package/dist/number/Number.js +0 -136
- package/dist/number/index.d.ts +0 -113
- package/dist/paginator/Paginator.js +0 -289
- 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/password/index.d.ts +0 -94
- package/dist/password/styles.css +0 -3
- 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/slider/Slider.js +0 -319
- package/dist/slider/Slider.stories.js +0 -241
- package/dist/slider/readme.md +0 -64
- package/dist/spinner/Spinner.js +0 -381
- 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 -343
- 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 -282
- package/dist/toggle/Toggle.stories.js +0 -297
- package/dist/toggle/readme.md +0 -80
- package/dist/toggle-group/ToggleGroup.js +0 -223
- package/dist/upload/Upload.stories.js +0 -72
- package/dist/upload/buttons-upload/ButtonsUpload.js +0 -139
- 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 -329
- 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 -175
- 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/invalid_icon.svg +0 -5
- package/dist/wizard/valid_icon.svg +0 -5
- 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 -145
- package/test/FileInput.test.js +0 -201
- 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/NewDate.test.js +0 -232
- package/test/NewInputText.test.js +0 -734
- package/test/NewTextarea.test.js +0 -195
- package/test/Number.test.js +0 -257
- package/test/Paginator.test.js +0 -177
- package/test/Password.test.js +0 -83
- package/test/ProgressBar.test.js +0 -35
- package/test/Radio.test.js +0 -37
- package/test/ResultsetTable.test.js +0 -329
- package/test/Select.test.js +0 -212
- package/test/Sidenav.test.js +0 -45
- package/test/Slider.test.js +0 -82
- package/test/Spinner.test.js +0 -32
- 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,9 +1,9 @@
|
|
|
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
|
});
|
|
@@ -33,177 +33,61 @@ var _uuid = require("uuid");
|
|
|
33
33
|
|
|
34
34
|
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
|
|
35
35
|
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
function _templateObject17() {
|
|
39
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: calc((39px - 1.75em) / 2) 0 calc((39px - 1.75em) / 2) 1em;\n align-items: center;\n font-size: 0.875rem;\n line-height: 1.75em;\n"]);
|
|
40
|
-
|
|
41
|
-
_templateObject17 = function _templateObject17() {
|
|
42
|
-
return data;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
return data;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function _templateObject16() {
|
|
49
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n margin-right: 0.5rem;\n height: 18px;\n width: 18px;\n color: ", ";\n\n svg {\n line-height: 1.75em;\n font-size: 0.875rem;\n }\n"]);
|
|
50
|
-
|
|
51
|
-
_templateObject16 = function _templateObject16() {
|
|
52
|
-
return data;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
return data;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function _templateObject15() {
|
|
59
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: calc((39px - 1.75em) / 2) 0 calc((39px - 1.75em) / 2) 1em;\n color: ", ";\n font-size: 0.875rem;\n line-height: 1.75em;\n"]);
|
|
60
|
-
|
|
61
|
-
_templateObject15 = function _templateObject15() {
|
|
62
|
-
return data;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
return data;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function _templateObject14() {
|
|
69
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n padding: calc((39px - 1.75em) / 2) 0 calc((39px - 1.75em) / 2) 1em;\n line-height: 1.75em;\n list-style-type: none;\n cursor: pointer;\n\n ", "\n"]);
|
|
70
|
-
|
|
71
|
-
_templateObject14 = function _templateObject14() {
|
|
72
|
-
return data;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
return data;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function _templateObject13() {
|
|
79
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n position: absolute;\n z-index: 1;\n max-height: 160px;\n overflow: auto;\n top: calc(100% + 4px);\n left: 0;\n margin: 0;\n padding: 0;\n width: 100%;\n box-sizing: border-box;\n cursor: default;\n border-radius: 4px;\n border: 1px solid ", ";\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n"]);
|
|
80
|
-
|
|
81
|
-
_templateObject13 = function _templateObject13() {
|
|
82
|
-
return data;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
return data;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function _templateObject12() {
|
|
89
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n min-height: 1.5em;\n color: ", ";\n font-family: ", ";\n font-size: 0.75rem;\n font-weight: 400;\n line-height: 1.5em;\n"]);
|
|
90
|
-
|
|
91
|
-
_templateObject12 = function _templateObject12() {
|
|
92
|
-
return data;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
return data;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function _templateObject11() {
|
|
99
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n padding: 3px;\n height: 18px;\n width: 18px;\n margin-left: calc(1rem * 0.25);\n color: ", ";\n\n svg {\n line-height: 18px;\n font-size: 1.25rem;\n }\n"]);
|
|
100
|
-
|
|
101
|
-
_templateObject11 = function _templateObject11() {
|
|
102
|
-
return data;
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
return data;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function _templateObject10() {
|
|
109
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: calc(1rem * 1.5);\n line-height: calc(1rem * 1.5);\n margin: 0 calc(1rem * 0.25);\n padding: 0 0 0 calc(1rem * 0.5);\n ", ";\n font-family: ", ";\n font-size: 1rem;\n pointer-events: none;\n"]);
|
|
110
|
-
|
|
111
|
-
_templateObject10 = function _templateObject10() {
|
|
112
|
-
return data;
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
return data;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function _templateObject9() {
|
|
119
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: calc(1rem * 1.5);\n line-height: calc(1rem * 1.5);\n margin-left: calc(1rem * 0.25);\n padding: 0 calc(1rem * 0.5) 0 0;\n ", ";\n font-family: ", ";\n font-size: 1rem;\n pointer-events: none;\n"]);
|
|
120
|
-
|
|
121
|
-
_templateObject9 = function _templateObject9() {
|
|
122
|
-
return data;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
return data;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function _templateObject8() {
|
|
129
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n font-size: 1rem;\n font-family: ", ";\n border: 1px solid transparent;\n border-radius: 4px;\n padding: 3px;\n margin-left: calc(1rem * 0.25);\n ", "\n\n box-shadow: 0 0 0 2px transparent;\n background-color: ", ";\n\n color: ", ";\n\n ", "\n\n svg {\n line-height: 18px;\n }\n"]);
|
|
130
|
-
|
|
131
|
-
_templateObject8 = function _templateObject8() {
|
|
132
|
-
return data;
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
return data;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
function _templateObject7() {
|
|
139
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: 16px;\n height: 16px;\n"]);
|
|
140
|
-
|
|
141
|
-
_templateObject7 = function _templateObject7() {
|
|
142
|
-
return data;
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
return data;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
function _templateObject6() {
|
|
149
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: calc(calc(1rem * 2.5) - calc(1px * 2));\n width: 100%;\n background: none;\n border: none;\n outline: none;\n padding: 0 calc(1rem * 0.5);\n\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.5em;\n ", "\n\n ::placeholder {\n color: ", ";\n }\n"]);
|
|
150
|
-
|
|
151
|
-
_templateObject6 = function _templateObject6() {
|
|
152
|
-
return data;
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
return data;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function _templateObject5() {
|
|
159
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n position: relative;\n align-items: center;\n height: calc(calc(1rem * 2.5) - calc(1px * 2));\n margin: calc(1rem * 0.25) 0;\n padding: 0 calc(1rem * 0.5);\n\n ", "\n box-shadow: 0 0 0 2px transparent;\n border-radius: 4px;\n border: 1px solid\n ", ";\n ", "\n ", ";\n\n ", ";\n"]);
|
|
160
|
-
|
|
161
|
-
_templateObject5 = function _templateObject5() {
|
|
162
|
-
return data;
|
|
163
|
-
};
|
|
36
|
+
var _NumberInputContext = _interopRequireDefault(require("../number-input/NumberInputContext.js"));
|
|
164
37
|
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function _templateObject4() {
|
|
169
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.5em;\n"]);
|
|
170
|
-
|
|
171
|
-
_templateObject4 = function _templateObject4() {
|
|
172
|
-
return data;
|
|
173
|
-
};
|
|
38
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18;
|
|
174
39
|
|
|
175
|
-
|
|
176
|
-
}
|
|
40
|
+
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); }
|
|
177
41
|
|
|
178
|
-
function
|
|
179
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-weight: ", ";\n"]);
|
|
180
|
-
|
|
181
|
-
_templateObject3 = function _templateObject3() {
|
|
182
|
-
return data;
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
return data;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
function _templateObject2() {
|
|
189
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.75em;\n"]);
|
|
190
|
-
|
|
191
|
-
_templateObject2 = function _templateObject2() {
|
|
192
|
-
return data;
|
|
193
|
-
};
|
|
42
|
+
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; }
|
|
194
43
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
44
|
+
var textInputIcons = {
|
|
45
|
+
error: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
46
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
47
|
+
height: "24px",
|
|
48
|
+
viewBox: "0 0 24 24",
|
|
49
|
+
width: "24px",
|
|
50
|
+
fill: "currentColor"
|
|
51
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
52
|
+
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"
|
|
53
|
+
})),
|
|
54
|
+
clear: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
55
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
56
|
+
width: "24",
|
|
57
|
+
height: "24",
|
|
58
|
+
viewBox: "0 0 24 24",
|
|
59
|
+
fill: "currentColor"
|
|
60
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
61
|
+
d: "M0 0h24v24H0V0z",
|
|
62
|
+
fill: "none"
|
|
63
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
64
|
+
d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
|
|
65
|
+
})),
|
|
66
|
+
increment: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
67
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
68
|
+
height: "24px",
|
|
69
|
+
viewBox: "0 0 24 24",
|
|
70
|
+
width: "24px",
|
|
71
|
+
fill: "currentColor"
|
|
72
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
73
|
+
d: "M0 0h24v24H0z",
|
|
74
|
+
fill: "none"
|
|
75
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
76
|
+
d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
|
|
77
|
+
})),
|
|
78
|
+
decrement: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
79
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
80
|
+
height: "24px",
|
|
81
|
+
viewBox: "0 0 24 24",
|
|
82
|
+
width: "24px",
|
|
83
|
+
fill: "currentColor"
|
|
84
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
85
|
+
d: "M0 0h24v24H0z",
|
|
86
|
+
fill: "none"
|
|
87
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
88
|
+
d: "M19 13H5v-2h14v2z"
|
|
89
|
+
}))
|
|
90
|
+
};
|
|
207
91
|
|
|
208
92
|
var makeCancelable = function makeCancelable(promise) {
|
|
209
93
|
var hasCanceled_ = false;
|
|
@@ -242,7 +126,22 @@ var patternMatch = function patternMatch(pattern, value) {
|
|
|
242
126
|
return new RegExp(pattern).test(value);
|
|
243
127
|
};
|
|
244
128
|
|
|
245
|
-
var
|
|
129
|
+
var getLastOptionIndex = function getLastOptionIndex(filteredSuggestions) {
|
|
130
|
+
var last = 0;
|
|
131
|
+
|
|
132
|
+
var reducer = function reducer(acc, current) {
|
|
133
|
+
var _current$options;
|
|
134
|
+
|
|
135
|
+
return acc + ((_current$options = current.options) === null || _current$options === void 0 ? void 0 : _current$options.length);
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
if (filteredSuggestions.length > 0) filteredSuggestions[0].options ? last = filteredSuggestions.reduce(reducer, 0) - 1 : last = filteredSuggestions.length - 1;
|
|
139
|
+
return last;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
143
|
+
var _action$title;
|
|
144
|
+
|
|
246
145
|
var _ref$label = _ref.label,
|
|
247
146
|
label = _ref$label === void 0 ? "" : _ref$label,
|
|
248
147
|
_ref$name = _ref.name,
|
|
@@ -278,66 +177,62 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
278
177
|
_ref$tabIndex = _ref.tabIndex,
|
|
279
178
|
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
280
179
|
|
|
281
|
-
var _useState = (0, _react.useState)(""),
|
|
282
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState,
|
|
283
|
-
|
|
284
|
-
setInnerValue = _useState2[1];
|
|
180
|
+
var _useState = (0, _react.useState)("input-".concat((0, _uuid.v4)())),
|
|
181
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 1),
|
|
182
|
+
inputId = _useState2[0];
|
|
285
183
|
|
|
286
|
-
var _useState3 = (0, _react.useState)(
|
|
184
|
+
var _useState3 = (0, _react.useState)(""),
|
|
287
185
|
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
288
|
-
|
|
289
|
-
|
|
186
|
+
innerValue = _useState4[0],
|
|
187
|
+
setInnerValue = _useState4[1];
|
|
290
188
|
|
|
291
189
|
var _useState5 = (0, _react.useState)(false),
|
|
292
190
|
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
293
|
-
|
|
294
|
-
|
|
191
|
+
isOpen = _useState6[0],
|
|
192
|
+
changeIsOpen = _useState6[1];
|
|
295
193
|
|
|
296
194
|
var _useState7 = (0, _react.useState)(false),
|
|
297
195
|
_useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
|
|
298
|
-
|
|
299
|
-
|
|
196
|
+
isSearching = _useState8[0],
|
|
197
|
+
changeIsSearching = _useState8[1];
|
|
300
198
|
|
|
301
199
|
var _useState9 = (0, _react.useState)(false),
|
|
302
200
|
_useState10 = (0, _slicedToArray2["default"])(_useState9, 2),
|
|
303
|
-
|
|
304
|
-
|
|
201
|
+
isAutosuggestError = _useState10[0],
|
|
202
|
+
changeIsAutosuggestError = _useState10[1];
|
|
305
203
|
|
|
306
|
-
var _useState11 = (0, _react.useState)(
|
|
204
|
+
var _useState11 = (0, _react.useState)([]),
|
|
307
205
|
_useState12 = (0, _slicedToArray2["default"])(_useState11, 2),
|
|
308
|
-
|
|
309
|
-
|
|
206
|
+
filteredSuggestions = _useState12[0],
|
|
207
|
+
changeFilteredSuggestions = _useState12[1];
|
|
310
208
|
|
|
311
|
-
var _useState13 = (0, _react.useState)(
|
|
209
|
+
var _useState13 = (0, _react.useState)(-1),
|
|
312
210
|
_useState14 = (0, _slicedToArray2["default"])(_useState13, 2),
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
var _useState15 = (0, _react.useState)(-1),
|
|
317
|
-
_useState16 = (0, _slicedToArray2["default"])(_useState15, 2),
|
|
318
|
-
visualFocusedSuggIndex = _useState16[0],
|
|
319
|
-
changeVisualFocusedSuggIndex = _useState16[1];
|
|
211
|
+
visualFocusedSuggIndex = _useState14[0],
|
|
212
|
+
changeVisualFocusedSuggIndex = _useState14[1];
|
|
320
213
|
|
|
321
214
|
var suggestionsRef = (0, _react.useRef)(null);
|
|
322
215
|
var inputRef = (0, _react.useRef)(null);
|
|
323
216
|
var actionRef = (0, _react.useRef)(null);
|
|
324
217
|
var colorsTheme = (0, _useTheme["default"])();
|
|
325
218
|
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
326
|
-
var inputId = "input-".concat((0, _uuid.v4)());
|
|
327
219
|
var autosuggestId = "".concat(inputId, "-listBox");
|
|
328
220
|
var errorId = "error-message-".concat(inputId);
|
|
329
|
-
var
|
|
221
|
+
var numberInputContext = (0, _react.useContext)(_NumberInputContext["default"]);
|
|
222
|
+
var lastOptionIndex = (0, _react.useMemo)(function () {
|
|
223
|
+
return getLastOptionIndex(filteredSuggestions);
|
|
224
|
+
}, [filteredSuggestions]);
|
|
330
225
|
|
|
331
226
|
var isNotOptional = function isNotOptional(value) {
|
|
332
227
|
return value === "" && !optional;
|
|
333
228
|
};
|
|
334
229
|
|
|
335
230
|
var isLengthIncorrect = function isLengthIncorrect(value) {
|
|
336
|
-
return value
|
|
231
|
+
return value && (length === null || length === void 0 ? void 0 : length.min) && (length === null || length === void 0 ? void 0 : length.max) && (value.length < length.min || value.length > length.max);
|
|
337
232
|
};
|
|
338
233
|
|
|
339
234
|
var isNumberIncorrect = function isNumberIncorrect(value) {
|
|
340
|
-
return (
|
|
235
|
+
return (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) && parseInt(value) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) || (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) && parseInt(value) > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);
|
|
341
236
|
};
|
|
342
237
|
|
|
343
238
|
var isTextInputType = function isTextInputType() {
|
|
@@ -347,15 +242,15 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
347
242
|
};
|
|
348
243
|
|
|
349
244
|
var getNumberErrorMessage = function getNumberErrorMessage(value) {
|
|
350
|
-
if (
|
|
245
|
+
if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && parseInt(value) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) return "Value must be greater than or equal to ".concat(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber, ".");else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.maxNumber && parseInt(value) > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) return "Value must be less than or equal to ".concat(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber, ".");
|
|
351
246
|
};
|
|
352
247
|
|
|
353
|
-
var
|
|
354
|
-
return typeof suggestions === "function" || suggestions
|
|
248
|
+
var hasSuggestions = function hasSuggestions() {
|
|
249
|
+
return typeof suggestions === "function" || (suggestions === null || suggestions === void 0 ? void 0 : suggestions.length) > 0;
|
|
355
250
|
};
|
|
356
251
|
|
|
357
252
|
var openSuggestions = function openSuggestions() {
|
|
358
|
-
|
|
253
|
+
hasSuggestions() && changeIsOpen(true);
|
|
359
254
|
};
|
|
360
255
|
|
|
361
256
|
var closeSuggestions = function closeSuggestions() {
|
|
@@ -388,13 +283,14 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
388
283
|
document.activeElement !== actionRef.current && inputRef.current.focus();
|
|
389
284
|
};
|
|
390
285
|
|
|
391
|
-
var
|
|
392
|
-
|
|
393
|
-
|
|
286
|
+
var handleInputContainerOnMouseDown = function handleInputContainerOnMouseDown(event) {
|
|
287
|
+
// Avoid input to lose the focus when the container is pressed
|
|
288
|
+
document.activeElement === inputRef.current && event.preventDefault();
|
|
394
289
|
};
|
|
395
290
|
|
|
396
|
-
var
|
|
291
|
+
var handleIOnChange = function handleIOnChange(event) {
|
|
397
292
|
openSuggestions();
|
|
293
|
+
changeValue(event.target.value);
|
|
398
294
|
};
|
|
399
295
|
|
|
400
296
|
var handleIOnBlur = function handleIOnBlur(event) {
|
|
@@ -417,15 +313,11 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
417
313
|
});
|
|
418
314
|
};
|
|
419
315
|
|
|
420
|
-
var handleIOnFocus = function handleIOnFocus() {
|
|
421
|
-
openSuggestions();
|
|
422
|
-
};
|
|
423
|
-
|
|
424
316
|
var handleIOnKeyDown = function handleIOnKeyDown(event) {
|
|
425
317
|
switch (event.keyCode) {
|
|
426
318
|
case 40:
|
|
427
319
|
// Arrow Down
|
|
428
|
-
if (
|
|
320
|
+
if (numberInputContext) {
|
|
429
321
|
decrementNumber();
|
|
430
322
|
event.preventDefault();
|
|
431
323
|
} else {
|
|
@@ -436,8 +328,6 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
436
328
|
changeVisualFocusedSuggIndex(function (visualFocusedSuggIndex) {
|
|
437
329
|
if (visualFocusedSuggIndex < filteredSuggestions.length - 1) return visualFocusedSuggIndex + 1;else if (visualFocusedSuggIndex === filteredSuggestions.length - 1) return 0;
|
|
438
330
|
});
|
|
439
|
-
changeIsScrollable(true);
|
|
440
|
-
changeIsActiveSuggestion(false);
|
|
441
331
|
}
|
|
442
332
|
}
|
|
443
333
|
|
|
@@ -445,7 +335,7 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
445
335
|
|
|
446
336
|
case 38:
|
|
447
337
|
// Arrow Up
|
|
448
|
-
if (
|
|
338
|
+
if (numberInputContext) {
|
|
449
339
|
incrementNumber();
|
|
450
340
|
event.preventDefault();
|
|
451
341
|
} else {
|
|
@@ -456,8 +346,6 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
456
346
|
changeVisualFocusedSuggIndex(function (visualFocusedSuggIndex) {
|
|
457
347
|
if (visualFocusedSuggIndex === 0 || visualFocusedSuggIndex === -1) return filteredSuggestions.length > 0 ? filteredSuggestions.length - 1 : suggestions.length - 1;else return visualFocusedSuggIndex - 1;
|
|
458
348
|
});
|
|
459
|
-
changeIsScrollable(true);
|
|
460
|
-
changeIsActiveSuggestion(false);
|
|
461
349
|
}
|
|
462
350
|
}
|
|
463
351
|
|
|
@@ -467,7 +355,7 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
467
355
|
// Esc
|
|
468
356
|
event.preventDefault();
|
|
469
357
|
|
|
470
|
-
if (
|
|
358
|
+
if (hasSuggestions()) {
|
|
471
359
|
changeValue("");
|
|
472
360
|
isOpen && closeSuggestions();
|
|
473
361
|
}
|
|
@@ -476,7 +364,7 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
476
364
|
|
|
477
365
|
case 13:
|
|
478
366
|
// Enter
|
|
479
|
-
if (
|
|
367
|
+
if (hasSuggestions() && !isSearching) {
|
|
480
368
|
var validFocusedSuggestion = filteredSuggestions.length > 0 && visualFocusedSuggIndex >= 0 && visualFocusedSuggIndex < filteredSuggestions.length;
|
|
481
369
|
validFocusedSuggestion && changeValue(filteredSuggestions[visualFocusedSuggIndex]);
|
|
482
370
|
isOpen && closeSuggestions();
|
|
@@ -486,6 +374,22 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
486
374
|
}
|
|
487
375
|
};
|
|
488
376
|
|
|
377
|
+
var handleClearActionOnClick = function handleClearActionOnClick() {
|
|
378
|
+
changeValue("");
|
|
379
|
+
inputRef.current.focus();
|
|
380
|
+
suggestions && closeSuggestions();
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
var handleDecrementActionOnClick = function handleDecrementActionOnClick() {
|
|
384
|
+
decrementNumber();
|
|
385
|
+
inputRef.current.focus();
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
var handleIncrementActionOnClick = function handleIncrementActionOnClick() {
|
|
389
|
+
incrementNumber();
|
|
390
|
+
inputRef.current.focus();
|
|
391
|
+
};
|
|
392
|
+
|
|
489
393
|
var setNumberProps = function setNumberProps(type, min, max, step) {
|
|
490
394
|
var _inputRef$current3, _inputRef$current4, _inputRef$current5, _inputRef$current6;
|
|
491
395
|
|
|
@@ -495,14 +399,55 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
495
399
|
step && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current6 = inputRef.current) === null || _inputRef$current6 === void 0 ? void 0 : _inputRef$current6.setAttribute("step", step));
|
|
496
400
|
};
|
|
497
401
|
|
|
402
|
+
var decrementNumber = function decrementNumber() {
|
|
403
|
+
var numberValue = value !== null && value !== void 0 ? value : innerValue;
|
|
404
|
+
|
|
405
|
+
if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && parseInt(numberValue) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) {
|
|
406
|
+
changeValue(parseInt(numberValue));
|
|
407
|
+
} else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.maxNumber && parseInt(numberValue) > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) {
|
|
408
|
+
changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);
|
|
409
|
+
} else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && (parseInt(numberValue) === (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) || numberValue === "" || numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && parseInt(numberValue) - (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber))) {
|
|
410
|
+
changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);
|
|
411
|
+
} else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && parseInt(numberValue) - (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) >= (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) || numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberValue !== "") {
|
|
412
|
+
changeValue(parseInt(numberValue) - (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber));
|
|
413
|
+
} else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberValue == "") {
|
|
414
|
+
changeValue(-(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber));
|
|
415
|
+
} else if (numberValue === "") {
|
|
416
|
+
changeValue(-1);
|
|
417
|
+
} else {
|
|
418
|
+
changeValue(parseInt(numberValue) - 1);
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
var incrementNumber = function incrementNumber() {
|
|
423
|
+
var numberValue = value !== null && value !== void 0 ? value : innerValue;
|
|
424
|
+
|
|
425
|
+
if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.maxNumber && parseInt(numberValue) > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) {
|
|
426
|
+
changeValue(parseInt(numberValue));
|
|
427
|
+
} else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && (parseInt(numberValue) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) || numberValue === "")) {
|
|
428
|
+
changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);
|
|
429
|
+
} else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.maxNumber && (parseInt(numberValue) === (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) || numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && parseInt(numberValue) + (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber))) {
|
|
430
|
+
changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);
|
|
431
|
+
} else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.maxNumber && parseInt(numberValue) + (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) <= (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) || numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberValue !== "") {
|
|
432
|
+
changeValue(parseInt(numberValue) + (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber));
|
|
433
|
+
} else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberValue == "") {
|
|
434
|
+
changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber);
|
|
435
|
+
} else if (numberValue === "") {
|
|
436
|
+
changeValue(1);
|
|
437
|
+
} else {
|
|
438
|
+
changeValue(parseInt(numberValue) + 1);
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
|
|
498
442
|
(0, _react.useLayoutEffect)(function () {
|
|
499
|
-
var _suggestionsRef$curre;
|
|
443
|
+
var _suggestionsRef$curre, _visualFocusedOptionE;
|
|
500
444
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
445
|
+
var visualFocusedOptionEl = suggestionsRef === null || suggestionsRef === void 0 ? void 0 : (_suggestionsRef$curre = suggestionsRef.current) === null || _suggestionsRef$curre === void 0 ? void 0 : _suggestionsRef$curre.querySelectorAll("[role='option']")[visualFocusedSuggIndex];
|
|
446
|
+
visualFocusedOptionEl === null || visualFocusedOptionEl === void 0 ? void 0 : (_visualFocusedOptionE = visualFocusedOptionEl.scrollIntoView) === null || _visualFocusedOptionE === void 0 ? void 0 : _visualFocusedOptionE.call(visualFocusedOptionEl, {
|
|
447
|
+
block: "nearest",
|
|
448
|
+
inline: "start"
|
|
449
|
+
});
|
|
450
|
+
}, [visualFocusedSuggIndex]);
|
|
506
451
|
(0, _react.useEffect)(function () {
|
|
507
452
|
if (typeof suggestions === "function") {
|
|
508
453
|
changeIsSearching(true);
|
|
@@ -522,121 +467,15 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
522
467
|
return function () {
|
|
523
468
|
cancelablePromise.cancel();
|
|
524
469
|
};
|
|
525
|
-
} else if (suggestions
|
|
470
|
+
} else if ((suggestions === null || suggestions === void 0 ? void 0 : suggestions.length) > 0) {
|
|
526
471
|
changeFilteredSuggestions(suggestions.filter(function (suggestion) {
|
|
527
472
|
return suggestion.toUpperCase().startsWith((value !== null && value !== void 0 ? value : innerValue).toUpperCase());
|
|
528
473
|
}));
|
|
529
474
|
changeVisualFocusedSuggIndex(-1);
|
|
530
475
|
}
|
|
531
476
|
|
|
532
|
-
|
|
533
|
-
}, [value, innerValue, suggestions]);
|
|
534
|
-
var defaultClearAction = {
|
|
535
|
-
onClick: function onClick() {
|
|
536
|
-
changeValue("");
|
|
537
|
-
inputRef.current.focus();
|
|
538
|
-
suggestions && closeSuggestions();
|
|
539
|
-
},
|
|
540
|
-
icon: _react["default"].createElement("svg", {
|
|
541
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
542
|
-
width: "24",
|
|
543
|
-
height: "24",
|
|
544
|
-
viewBox: "0 0 24 24",
|
|
545
|
-
fill: "currentColor"
|
|
546
|
-
}, _react["default"].createElement("path", {
|
|
547
|
-
d: "M0 0h24v24H0V0z",
|
|
548
|
-
fill: "none"
|
|
549
|
-
}), _react["default"].createElement("path", {
|
|
550
|
-
d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
|
|
551
|
-
}))
|
|
552
|
-
};
|
|
553
|
-
|
|
554
|
-
var errorIcon = _react["default"].createElement("svg", {
|
|
555
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
556
|
-
height: "24px",
|
|
557
|
-
viewBox: "0 0 24 24",
|
|
558
|
-
width: "24px",
|
|
559
|
-
fill: "currentColor"
|
|
560
|
-
}, _react["default"].createElement("path", {
|
|
561
|
-
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"
|
|
562
|
-
}));
|
|
563
|
-
|
|
564
|
-
var decrementNumber = function decrementNumber() {
|
|
565
|
-
var numberValue = value !== null && value !== void 0 ? value : innerValue;
|
|
566
|
-
|
|
567
|
-
if (numberContext !== null && numberContext !== void 0 && numberContext.minNumber && parseInt(numberValue) < (numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber)) {
|
|
568
|
-
changeValue(parseInt(numberValue));
|
|
569
|
-
} else if (numberContext !== null && numberContext !== void 0 && numberContext.maxNumber && parseInt(numberValue) > (numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber)) {
|
|
570
|
-
changeValue(numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber);
|
|
571
|
-
} else if (numberContext !== null && numberContext !== void 0 && numberContext.minNumber && (parseInt(numberValue) === (numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber) || numberValue === "" || numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && parseInt(numberValue) - (numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber) < (numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber))) {
|
|
572
|
-
changeValue(numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber);
|
|
573
|
-
} else if (numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && numberContext !== null && numberContext !== void 0 && numberContext.minNumber && parseInt(numberValue) - (numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber) >= (numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber) || numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && numberValue !== "") {
|
|
574
|
-
changeValue(parseInt(numberValue) - (numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber));
|
|
575
|
-
} else if (numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && numberValue == "") {
|
|
576
|
-
changeValue(-(numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber));
|
|
577
|
-
} else if (numberValue === "") {
|
|
578
|
-
changeValue(-1);
|
|
579
|
-
} else {
|
|
580
|
-
changeValue(parseInt(numberValue) - 1);
|
|
581
|
-
}
|
|
582
|
-
};
|
|
583
|
-
|
|
584
|
-
var incrementNumber = function incrementNumber() {
|
|
585
|
-
var numberValue = value !== null && value !== void 0 ? value : innerValue;
|
|
586
|
-
|
|
587
|
-
if (numberContext !== null && numberContext !== void 0 && numberContext.maxNumber && parseInt(numberValue) > (numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber)) {
|
|
588
|
-
changeValue(parseInt(numberValue));
|
|
589
|
-
} else if (numberContext !== null && numberContext !== void 0 && numberContext.minNumber && (parseInt(numberValue) < (numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber) || numberValue === "")) {
|
|
590
|
-
changeValue(numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber);
|
|
591
|
-
} else if (numberContext !== null && numberContext !== void 0 && numberContext.maxNumber && (parseInt(numberValue) === (numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber) || numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && parseInt(numberValue) + (numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber) > (numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber))) {
|
|
592
|
-
changeValue(numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber);
|
|
593
|
-
} else if (numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && numberContext !== null && numberContext !== void 0 && numberContext.maxNumber && parseInt(numberValue) + (numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber) <= (numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber) || numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && numberValue !== "") {
|
|
594
|
-
changeValue(parseInt(numberValue) + (numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber));
|
|
595
|
-
} else if (numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && numberValue == "") {
|
|
596
|
-
changeValue(numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber);
|
|
597
|
-
} else if (numberValue === "") {
|
|
598
|
-
changeValue(1);
|
|
599
|
-
} else {
|
|
600
|
-
changeValue(parseInt(numberValue) + 1);
|
|
601
|
-
}
|
|
602
|
-
};
|
|
603
|
-
|
|
604
|
-
var decrementAction = {
|
|
605
|
-
onClick: function onClick() {
|
|
606
|
-
decrementNumber();
|
|
607
|
-
inputRef.current.focus();
|
|
608
|
-
},
|
|
609
|
-
icon: _react["default"].createElement("svg", {
|
|
610
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
611
|
-
height: "24px",
|
|
612
|
-
viewBox: "0 0 24 24",
|
|
613
|
-
width: "24px",
|
|
614
|
-
fill: "currentColor"
|
|
615
|
-
}, _react["default"].createElement("path", {
|
|
616
|
-
d: "M0 0h24v24H0z",
|
|
617
|
-
fill: "none"
|
|
618
|
-
}), _react["default"].createElement("path", {
|
|
619
|
-
d: "M19 13H5v-2h14v2z"
|
|
620
|
-
}))
|
|
621
|
-
};
|
|
622
|
-
var incrementAction = {
|
|
623
|
-
onClick: function onClick() {
|
|
624
|
-
incrementNumber();
|
|
625
|
-
inputRef.current.focus();
|
|
626
|
-
},
|
|
627
|
-
icon: _react["default"].createElement("svg", {
|
|
628
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
629
|
-
height: "24px",
|
|
630
|
-
viewBox: "0 0 24 24",
|
|
631
|
-
width: "24px",
|
|
632
|
-
fill: "currentColor"
|
|
633
|
-
}, _react["default"].createElement("path", {
|
|
634
|
-
d: "M0 0h24v24H0z",
|
|
635
|
-
fill: "none"
|
|
636
|
-
}), _react["default"].createElement("path", {
|
|
637
|
-
d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
|
|
638
|
-
}))
|
|
639
|
-
};
|
|
477
|
+
numberInputContext && setNumberProps(numberInputContext.typeNumber, numberInputContext.minNumber, numberInputContext.maxNumber, numberInputContext.stepNumber);
|
|
478
|
+
}, [value, innerValue, suggestions, numberInputContext]);
|
|
640
479
|
|
|
641
480
|
var HighlightedSuggestion = function HighlightedSuggestion(_ref2) {
|
|
642
481
|
var suggestion = _ref2.suggestion,
|
|
@@ -644,62 +483,58 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
644
483
|
var regEx = new RegExp(value !== null && value !== void 0 ? value : innerValue, "i");
|
|
645
484
|
var matchedWords = suggestion.match(regEx);
|
|
646
485
|
var noMatchedWords = suggestion.replace(regEx, "");
|
|
647
|
-
|
|
486
|
+
var isLastOption = index === lastOptionIndex;
|
|
487
|
+
return /*#__PURE__*/_react["default"].createElement(Suggestion, {
|
|
648
488
|
id: "suggestion-".concat(index),
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
onMouseUp: function onMouseUp() {
|
|
653
|
-
if (isActiveSuggestion) {
|
|
654
|
-
changeValue(suggestion);
|
|
655
|
-
changeIsActiveSuggestion(false);
|
|
656
|
-
closeSuggestions();
|
|
657
|
-
}
|
|
658
|
-
},
|
|
659
|
-
onMouseEnter: function onMouseEnter() {
|
|
660
|
-
changeVisualFocusedSuggIndex(index);
|
|
661
|
-
},
|
|
662
|
-
onMouseLeave: function onMouseLeave() {
|
|
663
|
-
changeIsActiveSuggestion(false);
|
|
489
|
+
onClick: function onClick() {
|
|
490
|
+
changeValue(suggestion);
|
|
491
|
+
closeSuggestions();
|
|
664
492
|
},
|
|
665
493
|
visualFocused: visualFocusedSuggIndex === index,
|
|
666
|
-
active: visualFocusedSuggIndex === index && isActiveSuggestion,
|
|
667
494
|
role: "option",
|
|
668
495
|
"aria-selected": visualFocusedSuggIndex === index && "true"
|
|
669
|
-
},
|
|
496
|
+
}, /*#__PURE__*/_react["default"].createElement(StyledSuggestion, {
|
|
497
|
+
last: isLastOption,
|
|
498
|
+
visualFocused: visualFocusedSuggIndex === index
|
|
499
|
+
}, typeof suggestions === "function" ? suggestion : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("strong", null, matchedWords), noMatchedWords)));
|
|
670
500
|
};
|
|
671
501
|
|
|
672
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
673
|
-
theme: colorsTheme.
|
|
674
|
-
}, _react["default"].createElement(DxcInput, {
|
|
502
|
+
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
503
|
+
theme: colorsTheme.textInput
|
|
504
|
+
}, /*#__PURE__*/_react["default"].createElement(DxcInput, {
|
|
675
505
|
margin: margin,
|
|
676
506
|
ref: ref,
|
|
677
507
|
size: size
|
|
678
|
-
}, _react["default"].createElement(Label, {
|
|
508
|
+
}, /*#__PURE__*/_react["default"].createElement(Label, {
|
|
679
509
|
htmlFor: inputId,
|
|
680
510
|
disabled: disabled,
|
|
681
511
|
backgroundType: backgroundType
|
|
682
|
-
}, label, " ", optional && _react["default"].createElement(OptionalLabel, null, "(Optional)")), _react["default"].createElement(HelperText, {
|
|
512
|
+
}, label, " ", optional && /*#__PURE__*/_react["default"].createElement(OptionalLabel, null, "(Optional)")), /*#__PURE__*/_react["default"].createElement(HelperText, {
|
|
683
513
|
disabled: disabled,
|
|
684
514
|
backgroundType: backgroundType
|
|
685
|
-
}, helperText), _react["default"].createElement(InputContainer, {
|
|
515
|
+
}, helperText), /*#__PURE__*/_react["default"].createElement(InputContainer, {
|
|
686
516
|
error: error,
|
|
687
517
|
disabled: disabled,
|
|
688
518
|
backgroundType: backgroundType,
|
|
689
|
-
onClick: handleInputContainerOnClick
|
|
690
|
-
|
|
519
|
+
onClick: handleInputContainerOnClick,
|
|
520
|
+
onMouseDown: handleInputContainerOnMouseDown
|
|
521
|
+
}, prefix && /*#__PURE__*/_react["default"].createElement(Prefix, {
|
|
691
522
|
disabled: disabled,
|
|
692
523
|
backgroundType: backgroundType
|
|
693
|
-
}, prefix), _react["default"].createElement(Input, {
|
|
524
|
+
}, prefix), /*#__PURE__*/_react["default"].createElement(Input, {
|
|
694
525
|
id: inputId,
|
|
695
526
|
name: name,
|
|
696
527
|
value: value !== null && value !== void 0 ? value : innerValue,
|
|
697
528
|
placeholder: placeholder,
|
|
698
|
-
onChange: handleIOnChange,
|
|
699
|
-
onClick: handleIOnClick,
|
|
700
529
|
onBlur: handleIOnBlur,
|
|
701
|
-
|
|
530
|
+
onChange: handleIOnChange,
|
|
531
|
+
onFocus: function onFocus() {
|
|
532
|
+
openSuggestions();
|
|
533
|
+
},
|
|
702
534
|
onKeyDown: handleIOnKeyDown,
|
|
535
|
+
onMouseDown: function onMouseDown(event) {
|
|
536
|
+
event.stopPropagation();
|
|
537
|
+
},
|
|
703
538
|
disabled: disabled,
|
|
704
539
|
ref: inputRef,
|
|
705
540
|
backgroundType: backgroundType,
|
|
@@ -708,68 +543,78 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
708
543
|
maxLength: length === null || length === void 0 ? void 0 : length.max,
|
|
709
544
|
autoComplete: autocomplete,
|
|
710
545
|
tabIndex: tabIndex,
|
|
711
|
-
role: isTextInputType() &&
|
|
712
|
-
"aria-autocomplete": isTextInputType() &&
|
|
713
|
-
"aria-controls": isTextInputType() &&
|
|
714
|
-
"aria-expanded": isTextInputType() &&
|
|
715
|
-
"aria-activedescendant": isTextInputType() &&
|
|
546
|
+
role: isTextInputType() && hasSuggestions() ? "combobox" : "textbox",
|
|
547
|
+
"aria-autocomplete": isTextInputType() && hasSuggestions() ? "list" : undefined,
|
|
548
|
+
"aria-controls": isTextInputType() && hasSuggestions() ? autosuggestId : undefined,
|
|
549
|
+
"aria-expanded": isTextInputType() && hasSuggestions() ? isOpen ? "true" : "false" : undefined,
|
|
550
|
+
"aria-activedescendant": isTextInputType() && hasSuggestions() && isOpen && visualFocusedSuggIndex !== -1 ? "suggestion-".concat(visualFocusedSuggIndex) : undefined,
|
|
716
551
|
"aria-invalid": error ? "true" : "false",
|
|
717
552
|
"aria-describedby": error ? errorId : undefined,
|
|
718
553
|
"aria-required": optional ? "false" : "true"
|
|
719
|
-
}), !disabled && error && _react["default"].createElement(ErrorIcon, {
|
|
554
|
+
}), !disabled && error && /*#__PURE__*/_react["default"].createElement(ErrorIcon, {
|
|
720
555
|
backgroundType: backgroundType,
|
|
721
556
|
"aria-label": "Error"
|
|
722
|
-
},
|
|
723
|
-
onClick:
|
|
557
|
+
}, textInputIcons.error), !disabled && clearable && (value !== null && value !== void 0 ? value : innerValue).length > 0 && /*#__PURE__*/_react["default"].createElement(Action, {
|
|
558
|
+
onClick: handleClearActionOnClick,
|
|
559
|
+
onMouseDown: function onMouseDown(event) {
|
|
560
|
+
event.stopPropagation();
|
|
561
|
+
},
|
|
724
562
|
backgroundType: backgroundType,
|
|
725
563
|
tabIndex: tabIndex,
|
|
726
564
|
"aria-label": "Clear"
|
|
727
|
-
},
|
|
565
|
+
}, textInputIcons.clear), (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(Action, {
|
|
728
566
|
ref: actionRef,
|
|
729
567
|
disabled: disabled,
|
|
730
|
-
onClick:
|
|
568
|
+
onClick: handleDecrementActionOnClick,
|
|
569
|
+
onMouseDown: function onMouseDown(event) {
|
|
570
|
+
event.stopPropagation();
|
|
571
|
+
},
|
|
731
572
|
backgroundType: backgroundType,
|
|
732
573
|
tabIndex: tabIndex,
|
|
733
574
|
"aria-label": "Decrement"
|
|
734
|
-
},
|
|
575
|
+
}, textInputIcons.decrement), /*#__PURE__*/_react["default"].createElement(Action, {
|
|
735
576
|
ref: actionRef,
|
|
736
577
|
disabled: disabled,
|
|
737
|
-
onClick:
|
|
578
|
+
onClick: handleIncrementActionOnClick,
|
|
579
|
+
onMouseDown: function onMouseDown(event) {
|
|
580
|
+
event.stopPropagation();
|
|
581
|
+
},
|
|
738
582
|
backgroundType: backgroundType,
|
|
739
583
|
tabIndex: tabIndex,
|
|
740
584
|
"aria-label": "Increment"
|
|
741
|
-
},
|
|
585
|
+
}, textInputIcons.increment)) : action && /*#__PURE__*/_react["default"].createElement(Action, {
|
|
742
586
|
ref: actionRef,
|
|
743
587
|
disabled: disabled,
|
|
744
588
|
onClick: action.onClick,
|
|
589
|
+
onMouseDown: function onMouseDown(event) {
|
|
590
|
+
event.stopPropagation();
|
|
591
|
+
},
|
|
592
|
+
title: (_action$title = action.title) !== null && _action$title !== void 0 ? _action$title : action.title,
|
|
745
593
|
backgroundType: backgroundType,
|
|
746
594
|
tabIndex: tabIndex
|
|
747
|
-
}, typeof action.icon === "string" ? _react["default"].createElement(ActionIcon, {
|
|
595
|
+
}, typeof action.icon === "string" ? /*#__PURE__*/_react["default"].createElement(ActionIcon, {
|
|
748
596
|
src: action.icon
|
|
749
|
-
}) : action.icon), suffix && _react["default"].createElement(Suffix, {
|
|
597
|
+
}) : action.icon), suffix && /*#__PURE__*/_react["default"].createElement(Suffix, {
|
|
750
598
|
disabled: disabled,
|
|
751
599
|
backgroundType: backgroundType
|
|
752
|
-
}, suffix), isOpen && _react["default"].createElement(Suggestions, {
|
|
600
|
+
}, suffix), isOpen && (filteredSuggestions.length > 0 || isSearching || isAutosuggestError) && /*#__PURE__*/_react["default"].createElement(Suggestions, {
|
|
753
601
|
id: autosuggestId,
|
|
754
602
|
isError: isAutosuggestError,
|
|
755
603
|
onMouseDown: function onMouseDown(event) {
|
|
756
604
|
event.preventDefault();
|
|
757
605
|
},
|
|
758
|
-
onMouseLeave: function onMouseLeave() {
|
|
759
|
-
changeVisualFocusedSuggIndex(-1);
|
|
760
|
-
},
|
|
761
606
|
ref: suggestionsRef,
|
|
762
607
|
role: "listbox",
|
|
763
608
|
"aria-label": label
|
|
764
|
-
}, !isSearching && !isAutosuggestError && filteredSuggestions.length
|
|
765
|
-
return _react["default"].createElement(HighlightedSuggestion, {
|
|
609
|
+
}, !isSearching && !isAutosuggestError && filteredSuggestions.length > 0 && filteredSuggestions.map(function (suggestion, index) {
|
|
610
|
+
return /*#__PURE__*/_react["default"].createElement(HighlightedSuggestion, {
|
|
766
611
|
key: "suggestion-".concat((0, _uuid.v4)()),
|
|
767
612
|
suggestion: suggestion,
|
|
768
613
|
index: index
|
|
769
614
|
});
|
|
770
|
-
}), isSearching && _react["default"].createElement(SuggestionsSystemMessage, null, "Searching..."), isAutosuggestError && _react["default"].createElement(SuggestionsError, null, _react["default"].createElement(SuggestionsErrorIcon, {
|
|
615
|
+
}), isSearching && /*#__PURE__*/_react["default"].createElement(SuggestionsSystemMessage, null, "Searching..."), isAutosuggestError && /*#__PURE__*/_react["default"].createElement(SuggestionsError, null, /*#__PURE__*/_react["default"].createElement(SuggestionsErrorIcon, {
|
|
771
616
|
backgroundType: backgroundType
|
|
772
|
-
},
|
|
617
|
+
}, textInputIcons.error), "Error fetching data"))), !disabled && /*#__PURE__*/_react["default"].createElement(Error, {
|
|
773
618
|
id: errorId,
|
|
774
619
|
backgroundType: backgroundType
|
|
775
620
|
}, error)));
|
|
@@ -786,7 +631,7 @@ var calculateWidth = function calculateWidth(margin, size) {
|
|
|
786
631
|
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
787
632
|
};
|
|
788
633
|
|
|
789
|
-
var DxcInput = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
634
|
+
var DxcInput = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
790
635
|
return calculateWidth(props.margin, props.size);
|
|
791
636
|
}, function (props) {
|
|
792
637
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
@@ -800,7 +645,7 @@ var DxcInput = _styledComponents["default"].div(_templateObject(), function (pro
|
|
|
800
645
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
801
646
|
});
|
|
802
647
|
|
|
803
|
-
var Label = _styledComponents["default"].label(_templateObject2(), function (props) {
|
|
648
|
+
var Label = _styledComponents["default"].label(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), function (props) {
|
|
804
649
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledLabelFontColorOnDark : props.theme.disabledLabelFontColor : props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
805
650
|
}, function (props) {
|
|
806
651
|
return props.theme.fontFamily;
|
|
@@ -810,13 +655,15 @@ var Label = _styledComponents["default"].label(_templateObject2(), function (pro
|
|
|
810
655
|
return props.theme.labelFontStyle;
|
|
811
656
|
}, function (props) {
|
|
812
657
|
return props.theme.labelFontWeight;
|
|
658
|
+
}, function (props) {
|
|
659
|
+
return props.theme.labelLineHeight;
|
|
813
660
|
});
|
|
814
661
|
|
|
815
|
-
var OptionalLabel = _styledComponents["default"].span(_templateObject3(), function (props) {
|
|
662
|
+
var OptionalLabel = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n font-weight: ", ";\n"])), function (props) {
|
|
816
663
|
return props.theme.optionalLabelFontWeight;
|
|
817
664
|
});
|
|
818
665
|
|
|
819
|
-
var HelperText = _styledComponents["default"].span(_templateObject4(), function (props) {
|
|
666
|
+
var HelperText = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), function (props) {
|
|
820
667
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledHelperTextFontColorOnDark : props.theme.disabledHelperTextFontColor : props.backgroundType === "dark" ? props.theme.helperTextFontColorOnDark : props.theme.helperTextFontColor;
|
|
821
668
|
}, function (props) {
|
|
822
669
|
return props.theme.fontFamily;
|
|
@@ -826,9 +673,13 @@ var HelperText = _styledComponents["default"].span(_templateObject4(), function
|
|
|
826
673
|
return props.theme.helperTextFontStyle;
|
|
827
674
|
}, function (props) {
|
|
828
675
|
return props.theme.helperTextFontWeight;
|
|
676
|
+
}, function (props) {
|
|
677
|
+
return props.theme.helperTextLineHeight;
|
|
829
678
|
});
|
|
830
679
|
|
|
831
|
-
var InputContainer = _styledComponents["default"].div(_templateObject5(), function (props) {
|
|
680
|
+
var InputContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n position: relative;\n align-items: center;\n height: calc(2.5rem - 2px);\n margin: ", ";\n padding: 0 0.5rem;\n\n ", "\n box-shadow: 0 0 0 2px transparent;\n border-radius: 4px;\n border: 1px solid\n ", ";\n ", "\n ", ";\n\n ", ";\n"])), function (props) {
|
|
681
|
+
return "".concat(props.theme.inputMarginTop, " 0 ").concat(props.theme.inputMarginBottom, " 0");
|
|
682
|
+
}, function (props) {
|
|
832
683
|
if (props.disabled) return props.backgroundType === "dark" ? "background-color: ".concat(props.theme.disabledContainerFillColorOnDark, ";") : "background-color: ".concat(props.theme.disabledContainerFillColor, ";");
|
|
833
684
|
}, function (props) {
|
|
834
685
|
if (props.disabled) return props.backgroundType === "dark" ? props.theme.disabledBorderColorOnDark : props.theme.disabledBorderColor;else return props.backgroundType === "dark" ? props.theme.enabledBorderColorOnDark : props.theme.enabledBorderColor;
|
|
@@ -840,7 +691,7 @@ var InputContainer = _styledComponents["default"].div(_templateObject5(), functi
|
|
|
840
691
|
return !props.disabled && "\n &:hover {\n border-color: ".concat(props.error ? "transparent" : props.backgroundType === "dark" ? props.theme.hoverBorderColorOnDark : props.theme.hoverBorderColor, ";\n ").concat(props.error && "box-shadow: 0 0 0 2px ".concat(props.backgroundType === "dark" ? props.theme.hoverErrorBorderColorOnDark : props.theme.hoverErrorBorderColor, ";"), "\n }\n &:focus-within {\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(props.backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor, ";\n }\n ");
|
|
841
692
|
});
|
|
842
693
|
|
|
843
|
-
var Input = _styledComponents["default"].input(_templateObject6(), function (props) {
|
|
694
|
+
var Input = _styledComponents["default"].input(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n height: calc(2.5rem - 2px);\n width: 100%;\n background: none;\n border: none;\n outline: none;\n padding: 0 0.5rem;\n\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.5em;\n ", "\n\n ::placeholder {\n color: ", ";\n }\n"])), function (props) {
|
|
844
695
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledValueFontColorOnDark : props.theme.disabledValueFontColor : props.backgroundType === "dark" ? props.theme.valueFontColorOnDark : props.theme.valueFontColor;
|
|
845
696
|
}, function (props) {
|
|
846
697
|
return props.theme.fontFamily;
|
|
@@ -856,9 +707,9 @@ var Input = _styledComponents["default"].input(_templateObject6(), function (pro
|
|
|
856
707
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPlaceholderFontColorOnDark : props.theme.disabledPlaceholderFontColor : props.backgroundType === "dark" ? props.theme.placeholderFontColorOnDark : props.theme.placeholderFontColor;
|
|
857
708
|
});
|
|
858
709
|
|
|
859
|
-
var ActionIcon = _styledComponents["default"].img(_templateObject7());
|
|
710
|
+
var ActionIcon = _styledComponents["default"].img(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n width: 16px;\n height: 16px;\n"])));
|
|
860
711
|
|
|
861
|
-
var Action = _styledComponents["default"].button(_templateObject8(), function (props) {
|
|
712
|
+
var Action = _styledComponents["default"].button(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n font-size: 1rem;\n font-family: ", ";\n border: 1px solid transparent;\n border-radius: 2px;\n padding: 3px;\n margin-left: 0.25rem;\n ", "\n\n box-shadow: 0 0 0 2px transparent;\n background-color: ", ";\n\n color: ", ";\n\n ", "\n\n svg {\n line-height: 18px;\n }\n"])), function (props) {
|
|
862
713
|
return props.theme.fontFamily;
|
|
863
714
|
}, function (props) {
|
|
864
715
|
return props.disabled ? "cursor: not-allowed;" : "cursor: pointer;";
|
|
@@ -867,37 +718,37 @@ var Action = _styledComponents["default"].button(_templateObject8(), function (p
|
|
|
867
718
|
}, function (props) {
|
|
868
719
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledActionIconColorOnDark : props.theme.disabledActionIconColor : props.backgroundType === "dark" ? props.theme.actionIconColorOnDark : props.theme.actionIconColor;
|
|
869
720
|
}, function (props) {
|
|
870
|
-
return !props.disabled && "\n &:
|
|
721
|
+
return !props.disabled && "\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px ".concat(props.backgroundType === "dark" ? props.theme.focusActionBorderColorOnDark : props.theme.focusActionBorderColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.focusActionIconColorOnDark : props.theme.focusActionIconColor, ";\n }\n &:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px ").concat(props.backgroundType === "dark" ? props.theme.focusActionBorderColorOnDark : props.theme.focusActionBorderColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.focusActionIconColorOnDark : props.theme.focusActionIconColor, ";\n }\n &:hover {\n background-color: ").concat(props.backgroundType === "dark" ? props.theme.hoverActionBackgroundColorOnDark : props.theme.hoverActionBackgroundColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.hoverActionIconColorOnDark : props.theme.hoverActionIconColor, ";\n }\n &:active {\n background-color: ").concat(props.backgroundType === "dark" ? props.theme.activeActionBackgroundColorOnDark : props.theme.activeActionBackgroundColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.activeActionIconColorOnDark : props.theme.activeActionIconColor, ";\n }\n ");
|
|
871
722
|
});
|
|
872
723
|
|
|
873
|
-
var Prefix = _styledComponents["default"].span(_templateObject9(), function (props) {
|
|
724
|
+
var Prefix = _styledComponents["default"].span(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n height: 1.5rem;\n line-height: 1.5rem;\n margin-left: 0.25rem;\n padding: 0 0.5rem 0 0;\n ", ";\n font-family: ", ";\n font-size: 1rem;\n pointer-events: none;\n"])), function (props) {
|
|
874
725
|
var color = props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPrefixColorOnDark : props.theme.disabledPrefixColor : props.backgroundType === "dark" ? props.theme.prefixColorOnDark : props.theme.prefixColor;
|
|
875
726
|
return "color: ".concat(color, "; border-right: 1px solid ").concat(color, ";");
|
|
876
727
|
}, function (props) {
|
|
877
728
|
return props.theme.fontFamily;
|
|
878
729
|
});
|
|
879
730
|
|
|
880
|
-
var Suffix = _styledComponents["default"].span(_templateObject10(), function (props) {
|
|
731
|
+
var Suffix = _styledComponents["default"].span(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n height: 1.5rem;\n line-height: 1.5rem;\n margin: 0 0.25rem;\n padding: 0 0 0 0.5rem;\n ", ";\n font-family: ", ";\n font-size: 1rem;\n pointer-events: none;\n"])), function (props) {
|
|
881
732
|
var color = props.disabled ? props.backgroundType === "dark" ? props.theme.disabledSuffixColorOnDark : props.theme.disabledSuffixColor : props.backgroundType === "dark" ? props.theme.suffixColorOnDark : props.theme.suffixColor;
|
|
882
733
|
return "color: ".concat(color, "; border-left: 1px solid ").concat(color, ";");
|
|
883
734
|
}, function (props) {
|
|
884
735
|
return props.theme.fontFamily;
|
|
885
736
|
});
|
|
886
737
|
|
|
887
|
-
var ErrorIcon = _styledComponents["default"].span(_templateObject11(), function (props) {
|
|
738
|
+
var ErrorIcon = _styledComponents["default"].span(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n padding: 3px;\n height: 18px;\n width: 18px;\n margin-left: 0.25rem;\n color: ", ";\n\n svg {\n line-height: 18px;\n font-size: 1.25rem;\n }\n"])), function (props) {
|
|
888
739
|
return props.backgroundType === "dark" ? props.theme.errorIconColorOnDark : props.theme.errorIconColor;
|
|
889
740
|
});
|
|
890
741
|
|
|
891
|
-
var Error = _styledComponents["default"].span(_templateObject12(), function (props) {
|
|
742
|
+
var Error = _styledComponents["default"].span(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["\n min-height: 1.5em;\n color: ", ";\n font-family: ", ";\n font-size: 0.75rem;\n font-weight: 400;\n line-height: 1.5em;\n"])), function (props) {
|
|
892
743
|
return props.backgroundType === "dark" ? props.theme.errorMessageColorOnDark : props.theme.errorMessageColor;
|
|
893
744
|
}, function (props) {
|
|
894
745
|
return props.theme.fontFamily;
|
|
895
746
|
});
|
|
896
747
|
|
|
897
|
-
var Suggestions = _styledComponents["default"].ul(_templateObject13(), function (props) {
|
|
898
|
-
return props.isError ? props.theme.
|
|
748
|
+
var Suggestions = _styledComponents["default"].ul(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n z-index: 1;\n max-height: 304px;\n overflow-y: auto;\n top: calc(100% + 4px);\n left: 0;\n margin: 0;\n padding: 0.25rem 0;\n width: 100%;\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: 0.25rem;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);\n cursor: default;\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n"])), function (props) {
|
|
749
|
+
return props.isError ? props.theme.errorListDialogBackgroundColor : props.theme.listDialogBackgroundColor;
|
|
899
750
|
}, function (props) {
|
|
900
|
-
return props.isError ? props.theme.
|
|
751
|
+
return props.isError ? props.theme.errorListDialogBorderColor : props.theme.listDialogBorderColor;
|
|
901
752
|
}, function (props) {
|
|
902
753
|
return props.theme.listOptionFontColor;
|
|
903
754
|
}, function (props) {
|
|
@@ -910,21 +761,31 @@ var Suggestions = _styledComponents["default"].ul(_templateObject13(), function
|
|
|
910
761
|
return props.theme.listOptionFontWeight;
|
|
911
762
|
});
|
|
912
763
|
|
|
913
|
-
var Suggestion = _styledComponents["default"].li(_templateObject14(), function (props) {
|
|
914
|
-
return props.
|
|
764
|
+
var Suggestion = _styledComponents["default"].li(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2["default"])(["\n padding: 0 0.5rem;\n line-height: 1.715em;\n cursor: pointer;\n\n box-shadow: inset 0 0 0 2px\n ", ";\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n"])), function (props) {
|
|
765
|
+
return props.visualFocused ? props.theme.focusListOptionBorderColor : "transparent";
|
|
766
|
+
}, function (props) {
|
|
767
|
+
return props.theme.hoverListOptionBackgroundColor;
|
|
768
|
+
}, function (props) {
|
|
769
|
+
return props.theme.activeListOptionBackgroundColor;
|
|
770
|
+
});
|
|
771
|
+
|
|
772
|
+
var StyledSuggestion = _styledComponents["default"].span(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 0.25rem 0.5rem 0.188rem 0.5rem;\n ", ";\n"])), function (props) {
|
|
773
|
+
return props.last || props.visualFocused ? "border-bottom: 1px solid transparent" : "border-bottom: 1px solid ".concat(props.theme.listOptionDividerColor);
|
|
915
774
|
});
|
|
916
775
|
|
|
917
|
-
var SuggestionsSystemMessage = _styledComponents["default"].span(
|
|
776
|
+
var SuggestionsSystemMessage = _styledComponents["default"].span(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 0.25rem 1rem;\n color: ", ";\n line-height: 1.715em;\n"])), function (props) {
|
|
918
777
|
return props.theme.systemMessageFontColor;
|
|
919
778
|
});
|
|
920
779
|
|
|
921
|
-
var SuggestionsErrorIcon = _styledComponents["default"].span(
|
|
780
|
+
var SuggestionsErrorIcon = _styledComponents["default"].span(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n margin-right: 0.5rem;\n height: 18px;\n width: 18px;\n color: ", ";\n"])), function (props) {
|
|
922
781
|
return props.backgroundType === "dark" ? props.theme.errorIconColorOnDark : props.theme.errorIconColor;
|
|
923
782
|
});
|
|
924
783
|
|
|
925
|
-
var SuggestionsError = _styledComponents["default"].span(
|
|
784
|
+
var SuggestionsError = _styledComponents["default"].span(_templateObject18 || (_templateObject18 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 0.25rem 1rem;\n align-items: center;\n line-height: 1.715em;\n color: ", ";\n"])), function (props) {
|
|
785
|
+
return props.theme.errorListDialogFontColor;
|
|
786
|
+
});
|
|
926
787
|
|
|
927
|
-
|
|
788
|
+
DxcTextInput.propTypes = {
|
|
928
789
|
label: _propTypes["default"].string,
|
|
929
790
|
name: _propTypes["default"].string,
|
|
930
791
|
value: _propTypes["default"].string,
|
|
@@ -960,5 +821,5 @@ DxcNewInputText.propTypes = {
|
|
|
960
821
|
}),
|
|
961
822
|
tabIndex: _propTypes["default"].number
|
|
962
823
|
};
|
|
963
|
-
var _default =
|
|
824
|
+
var _default = DxcTextInput;
|
|
964
825
|
exports["default"] = _default;
|