@dxc-technology/halstack-react 0.0.0-f77ec3a → 0.0.0-f7c9808
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 +10 -0
- package/ThemeContext.js +243 -0
- package/accordion/Accordion.d.ts +4 -0
- package/accordion/Accordion.js +248 -0
- package/accordion/Accordion.stories.tsx +307 -0
- package/accordion/Accordion.test.js +72 -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/AccordionGroup.test.js +133 -0
- package/accordion-group/types.d.ts +68 -0
- package/accordion-group/types.js +5 -0
- package/alert/Alert.d.ts +4 -0
- package/{dist/alert → alert}/Alert.js +40 -153
- package/alert/Alert.stories.tsx +170 -0
- package/alert/Alert.test.js +92 -0
- package/alert/types.d.ts +49 -0
- package/alert/types.js +5 -0
- package/badge/Badge.d.ts +4 -0
- package/badge/Badge.js +59 -0
- package/badge/types.d.ts +4 -0
- package/badge/types.js +5 -0
- package/bleed/Bleed.d.ts +3 -0
- package/bleed/Bleed.js +84 -0
- package/bleed/Bleed.stories.tsx +342 -0
- package/bleed/types.d.ts +37 -0
- package/bleed/types.js +5 -0
- package/box/Box.d.ts +4 -0
- package/{dist/box → box}/Box.js +15 -45
- package/box/Box.stories.tsx +132 -0
- package/box/Box.test.js +18 -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 +26 -93
- package/button/Button.stories.tsx +274 -0
- package/button/Button.test.js +35 -0
- package/button/types.d.ts +53 -0
- package/button/types.js +5 -0
- package/card/Card.d.ts +4 -0
- package/{dist/card → card}/Card.js +34 -124
- package/card/Card.stories.tsx +201 -0
- package/card/Card.test.js +50 -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 +21 -73
- package/checkbox/Checkbox.stories.tsx +192 -0
- package/checkbox/Checkbox.test.js +78 -0
- package/checkbox/types.d.ts +64 -0
- package/checkbox/types.js +5 -0
- package/chip/Chip.d.ts +4 -0
- package/chip/Chip.js +161 -0
- package/chip/Chip.stories.tsx +119 -0
- package/chip/Chip.test.js +56 -0
- package/chip/types.d.ts +45 -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/{dist/common → common}/variables.js +125 -326
- package/date-input/DateInput.d.ts +4 -0
- package/{dist/date-input → date-input}/DateInput.js +47 -93
- package/date-input/DateInput.stories.tsx +138 -0
- package/date-input/DateInput.test.js +492 -0
- package/date-input/types.d.ts +104 -0
- package/date-input/types.js +5 -0
- package/dialog/Dialog.d.ts +4 -0
- package/{dist/dialog → dialog}/Dialog.js +24 -76
- package/dialog/Dialog.stories.tsx +212 -0
- package/dialog/Dialog.test.js +40 -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 +48 -197
- package/dropdown/Dropdown.stories.tsx +249 -0
- package/dropdown/Dropdown.test.js +189 -0
- package/dropdown/types.d.ts +80 -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 +507 -0
- package/file-input/FileInput.test.js +457 -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 +258 -0
- package/footer/Footer.stories.tsx +130 -0
- package/footer/Footer.test.js +109 -0
- package/footer/Icons.d.ts +2 -0
- package/{dist/footer → footer}/Icons.js +15 -15
- package/footer/types.d.ts +65 -0
- package/footer/types.js +5 -0
- package/header/Header.d.ts +7 -0
- package/{dist/header → header}/Header.js +58 -204
- package/header/Header.stories.tsx +162 -0
- package/header/Header.test.js +63 -0
- package/header/Icons.d.ts +2 -0
- package/{dist/header → header}/Icons.js +7 -32
- 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 +25 -96
- package/heading/Heading.stories.tsx +54 -0
- package/heading/Heading.test.js +186 -0
- package/heading/types.d.ts +33 -0
- package/heading/types.js +5 -0
- package/inset/Inset.d.ts +3 -0
- package/inset/Inset.js +84 -0
- package/inset/Inset.stories.tsx +229 -0
- package/inset/types.d.ts +13 -0
- package/inset/types.js +5 -0
- package/layout/ApplicationLayout.d.ts +10 -0
- package/{dist/layout → layout}/ApplicationLayout.js +47 -143
- package/layout/ApplicationLayout.stories.tsx +171 -0
- package/{dist/layout → layout}/Icons.js +7 -7
- package/layout/types.d.ts +57 -0
- package/layout/types.js +5 -0
- package/link/Link.d.ts +3 -0
- package/{dist/link → link}/Link.js +22 -106
- package/link/Link.stories.tsx +151 -0
- package/link/Link.test.js +91 -0
- package/link/types.d.ts +70 -0
- package/link/types.js +5 -0
- package/list/List.d.ts +4 -0
- package/list/List.js +47 -0
- package/list/List.stories.tsx +95 -0
- package/list/types.d.ts +7 -0
- package/list/types.js +5 -0
- package/main.d.ts +46 -0
- package/{dist/main.js → main.js} +116 -96
- package/number-input/NumberInput.d.ts +4 -0
- package/number-input/NumberInput.js +76 -0
- package/number-input/NumberInput.stories.tsx +115 -0
- package/number-input/NumberInput.test.js +508 -0
- package/number-input/NumberInputContext.d.ts +4 -0
- package/{dist/number-input → number-input}/NumberInputContext.js +5 -2
- package/number-input/numberInputContextTypes.d.ts +19 -0
- package/number-input/numberInputContextTypes.js +5 -0
- package/number-input/types.d.ts +121 -0
- package/number-input/types.js +5 -0
- package/package.json +22 -17
- package/{dist/paginator → paginator}/Icons.js +9 -9
- package/paginator/Paginator.d.ts +4 -0
- package/paginator/Paginator.js +192 -0
- package/paginator/Paginator.stories.tsx +63 -0
- package/paginator/Paginator.test.js +266 -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-input → password-input}/PasswordInput.js +37 -77
- package/password-input/PasswordInput.stories.tsx +131 -0
- package/password-input/PasswordInput.test.js +183 -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/{dist/progress-bar → progress-bar}/ProgressBar.js +22 -94
- package/progress-bar/ProgressBar.stories.jsx +58 -0
- package/progress-bar/ProgressBar.test.js +65 -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/Radio.test.js +71 -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 +141 -0
- package/radio-group/RadioGroup.d.ts +4 -0
- package/radio-group/RadioGroup.js +280 -0
- package/radio-group/RadioGroup.stories.tsx +100 -0
- package/radio-group/RadioGroup.test.js +695 -0
- package/radio-group/types.d.ts +114 -0
- package/radio-group/types.js +5 -0
- package/resultsetTable/ResultsetTable.d.ts +4 -0
- package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +43 -147
- package/resultsetTable/ResultsetTable.stories.tsx +275 -0
- package/resultsetTable/ResultsetTable.test.js +306 -0
- package/resultsetTable/types.d.ts +67 -0
- package/resultsetTable/types.js +5 -0
- package/row/Row.d.ts +3 -0
- package/row/Row.js +127 -0
- package/row/Row.stories.tsx +237 -0
- package/row/types.d.ts +28 -0
- package/row/types.js +5 -0
- package/select/Icons.d.ts +10 -0
- package/select/Icons.js +93 -0
- package/select/Option.d.ts +4 -0
- package/select/Option.js +110 -0
- package/select/Select.d.ts +4 -0
- package/select/Select.js +740 -0
- package/select/Select.stories.tsx +582 -0
- package/select/Select.test.js +2016 -0
- package/select/types.d.ts +191 -0
- package/select/types.js +5 -0
- package/sidenav/Sidenav.d.ts +9 -0
- package/{dist/sidenav → sidenav}/Sidenav.js +21 -64
- package/sidenav/Sidenav.stories.tsx +182 -0
- package/sidenav/Sidenav.test.js +56 -0
- package/sidenav/types.d.ts +50 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.d.ts +4 -0
- package/{dist/slider → slider}/Slider.js +74 -161
- package/slider/Slider.stories.tsx +177 -0
- package/slider/Slider.test.js +129 -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 +103 -0
- package/spinner/Spinner.test.js +64 -0
- package/spinner/types.d.ts +32 -0
- package/spinner/types.js +5 -0
- package/stack/Stack.d.ts +3 -0
- package/stack/Stack.js +97 -0
- package/stack/Stack.stories.tsx +164 -0
- package/stack/types.d.ts +24 -0
- package/stack/types.js +5 -0
- package/switch/Switch.d.ts +4 -0
- package/{dist/switch → switch}/Switch.js +45 -75
- package/switch/Switch.stories.tsx +160 -0
- package/switch/Switch.test.js +98 -0
- package/switch/types.d.ts +62 -0
- package/switch/types.js +5 -0
- package/table/Table.d.ts +4 -0
- package/{dist/table → table}/Table.js +12 -26
- package/table/Table.stories.jsx +277 -0
- package/table/Table.test.js +26 -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 +120 -0
- package/tabs/Tabs.test.js +123 -0
- package/tabs/types.d.ts +78 -0
- package/tabs/types.js +5 -0
- package/tag/Tag.d.ts +4 -0
- package/tag/Tag.js +186 -0
- package/tag/Tag.stories.tsx +142 -0
- package/tag/Tag.test.js +60 -0
- package/tag/types.d.ts +69 -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/{dist/text-input → text-input}/TextInput.js +285 -461
- package/text-input/TextInput.stories.tsx +474 -0
- package/text-input/TextInput.test.js +1725 -0
- package/text-input/types.d.ts +163 -0
- package/text-input/types.js +5 -0
- package/textarea/Textarea.d.ts +4 -0
- package/{dist/textarea → textarea}/Textarea.js +48 -131
- package/textarea/Textarea.stories.jsx +157 -0
- package/textarea/Textarea.test.js +437 -0
- package/textarea/types.d.ts +134 -0
- package/textarea/types.js +5 -0
- package/toggle-group/ToggleGroup.d.ts +4 -0
- package/{dist/toggle-group → toggle-group}/ToggleGroup.js +35 -148
- package/toggle-group/ToggleGroup.stories.tsx +173 -0
- package/toggle-group/ToggleGroup.test.js +125 -0
- package/toggle-group/types.d.ts +97 -0
- package/toggle-group/types.js +5 -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 +286 -0
- package/wizard/Wizard.stories.tsx +214 -0
- package/wizard/Wizard.test.js +141 -0
- package/wizard/types.d.ts +64 -0
- package/wizard/types.js +5 -0
- package/README.md +0 -66
- package/babel.config.js +0 -7
- package/dist/BackgroundColorContext.js +0 -46
- package/dist/ThemeContext.js +0 -250
- package/dist/V3Select/V3Select.js +0 -549
- package/dist/V3Select/index.d.ts +0 -27
- package/dist/V3Textarea/V3Textarea.js +0 -264
- package/dist/V3Textarea/index.d.ts +0 -27
- package/dist/accordion/Accordion.js +0 -353
- package/dist/accordion/index.d.ts +0 -28
- package/dist/accordion-group/AccordionGroup.js +0 -186
- package/dist/accordion-group/index.d.ts +0 -16
- package/dist/alert/index.d.ts +0 -51
- package/dist/badge/Badge.js +0 -63
- package/dist/box/index.d.ts +0 -25
- package/dist/button/index.d.ts +0 -24
- package/dist/card/index.d.ts +0 -22
- package/dist/checkbox/index.d.ts +0 -24
- package/dist/chip/Chip.js +0 -265
- package/dist/chip/index.d.ts +0 -22
- package/dist/date/Date.js +0 -379
- package/dist/date/index.d.ts +0 -27
- package/dist/date-input/index.d.ts +0 -95
- package/dist/dialog/index.d.ts +0 -18
- package/dist/dropdown/index.d.ts +0 -26
- package/dist/file-input/FileInput.js +0 -644
- package/dist/file-input/FileItem.js +0 -287
- package/dist/file-input/index.d.ts +0 -81
- package/dist/footer/Footer.js +0 -421
- package/dist/footer/index.d.ts +0 -25
- package/dist/header/index.d.ts +0 -25
- package/dist/heading/index.d.ts +0 -17
- package/dist/input-text/Icons.js +0 -22
- package/dist/input-text/InputText.js +0 -705
- package/dist/input-text/index.d.ts +0 -36
- package/dist/link/index.d.ts +0 -23
- package/dist/main.d.ts +0 -40
- package/dist/number-input/NumberInput.js +0 -136
- package/dist/number-input/index.d.ts +0 -113
- package/dist/paginator/Paginator.js +0 -305
- package/dist/paginator/index.d.ts +0 -20
- package/dist/password-input/index.d.ts +0 -94
- package/dist/progress-bar/index.d.ts +0 -18
- package/dist/radio/index.d.ts +0 -23
- package/dist/resultsetTable/index.d.ts +0 -19
- package/dist/select/Select.js +0 -1096
- package/dist/select/index.d.ts +0 -53
- package/dist/sidenav/index.d.ts +0 -13
- package/dist/slider/index.d.ts +0 -29
- package/dist/spinner/Spinner.js +0 -381
- package/dist/spinner/index.d.ts +0 -17
- package/dist/stories/Button.js +0 -71
- package/dist/stories/Button.stories.js +0 -55
- package/dist/stories/Header.js +0 -67
- package/dist/stories/Header.stories.js +0 -31
- package/dist/stories/Introduction.stories.mdx +0 -211
- package/dist/stories/Page.js +0 -68
- package/dist/stories/Page.stories.js +0 -39
- package/dist/stories/assets/code-brackets.svg +0 -1
- package/dist/stories/assets/colors.svg +0 -1
- package/dist/stories/assets/comments.svg +0 -1
- package/dist/stories/assets/direction.svg +0 -1
- package/dist/stories/assets/flow.svg +0 -1
- package/dist/stories/assets/plugin.svg +0 -1
- package/dist/stories/assets/repo.svg +0 -1
- package/dist/stories/assets/stackalt.svg +0 -1
- package/dist/stories/button.css +0 -30
- package/dist/stories/header.css +0 -26
- package/dist/stories/page.css +0 -69
- package/dist/switch/index.d.ts +0 -24
- package/dist/table/index.d.ts +0 -13
- package/dist/tabs/Tabs.js +0 -343
- package/dist/tabs/index.d.ts +0 -19
- package/dist/tag/Tag.js +0 -282
- package/dist/tag/index.d.ts +0 -24
- package/dist/text-input/index.d.ts +0 -135
- package/dist/textarea/index.d.ts +0 -117
- package/dist/toggle/Toggle.js +0 -220
- package/dist/toggle/index.d.ts +0 -21
- package/dist/toggle-group/index.d.ts +0 -21
- package/dist/upload/Upload.js +0 -205
- package/dist/upload/buttons-upload/ButtonsUpload.js +0 -135
- package/dist/upload/buttons-upload/Icons.js +0 -40
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +0 -329
- package/dist/upload/dragAndDropArea/Icons.js +0 -39
- package/dist/upload/file-upload/FileToUpload.js +0 -189
- package/dist/upload/file-upload/Icons.js +0 -66
- package/dist/upload/files-upload/FilesToUpload.js +0 -123
- package/dist/upload/index.d.ts +0 -15
- package/dist/upload/transaction/Icons.js +0 -160
- package/dist/upload/transaction/Transaction.js +0 -148
- package/dist/upload/transactions/Transactions.js +0 -138
- package/dist/wizard/Icons.js +0 -65
- package/dist/wizard/Wizard.js +0 -405
- package/dist/wizard/index.d.ts +0 -18
- 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 -395
- package/test/DateInput.test.js +0 -242
- 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 -94
- package/test/Header.test.js +0 -34
- package/test/Heading.test.js +0 -83
- package/test/InputText.test.js +0 -239
- package/test/Link.test.js +0 -43
- package/test/NumberInput.test.js +0 -259
- package/test/Paginator.test.js +0 -181
- package/test/PasswordInput.test.js +0 -83
- 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 -415
- package/test/Sidenav.test.js +0 -45
- package/test/Slider.test.js +0 -74
- 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/Tag.test.js +0 -32
- package/test/TextInput.test.js +0 -732
- package/test/Textarea.test.js +0 -193
- package/test/ToggleGroup.test.js +0 -85
- package/test/Upload.test.js +0 -60
- package/test/V3Select.test.js +0 -212
- package/test/V3TextArea.test.js +0 -51
- 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 _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
15
13
|
|
|
16
14
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
@@ -21,9 +19,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
21
19
|
|
|
22
20
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
23
21
|
|
|
24
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
25
|
-
|
|
26
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
22
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
27
23
|
|
|
28
24
|
var _variables = require("../common/variables.js");
|
|
29
25
|
|
|
@@ -31,179 +27,63 @@ var _utils = require("../common/utils.js");
|
|
|
31
27
|
|
|
32
28
|
var _uuid = require("uuid");
|
|
33
29
|
|
|
34
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext
|
|
35
|
-
|
|
36
|
-
var _NumberInputContext = _interopRequireDefault(require("../number-input/NumberInputContext.js"));
|
|
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
|
-
};
|
|
30
|
+
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
44
31
|
|
|
45
|
-
|
|
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
|
-
};
|
|
32
|
+
var _NumberInputContext = _interopRequireDefault(require("../number-input/NumberInputContext"));
|
|
64
33
|
|
|
65
|
-
|
|
66
|
-
}
|
|
34
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18;
|
|
67
35
|
|
|
68
|
-
function
|
|
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: 2px;\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
|
-
};
|
|
164
|
-
|
|
165
|
-
return data;
|
|
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: ", ";\n"]);
|
|
170
|
-
|
|
171
|
-
_templateObject4 = function _templateObject4() {
|
|
172
|
-
return data;
|
|
173
|
-
};
|
|
36
|
+
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); }
|
|
174
37
|
|
|
175
|
-
|
|
176
|
-
}
|
|
38
|
+
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; }
|
|
177
39
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
40
|
+
var textInputIcons = {
|
|
41
|
+
error: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
42
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
43
|
+
height: "24px",
|
|
44
|
+
viewBox: "0 0 24 24",
|
|
45
|
+
width: "24px",
|
|
46
|
+
fill: "currentColor"
|
|
47
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
48
|
+
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"
|
|
49
|
+
})),
|
|
50
|
+
clear: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
51
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
52
|
+
width: "24",
|
|
53
|
+
height: "24",
|
|
54
|
+
viewBox: "0 0 24 24",
|
|
55
|
+
fill: "currentColor"
|
|
56
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
57
|
+
d: "M0 0h24v24H0V0z",
|
|
58
|
+
fill: "none"
|
|
59
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
60
|
+
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"
|
|
61
|
+
})),
|
|
62
|
+
increment: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
63
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
64
|
+
height: "24px",
|
|
65
|
+
viewBox: "0 0 24 24",
|
|
66
|
+
width: "24px",
|
|
67
|
+
fill: "currentColor"
|
|
68
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
69
|
+
d: "M0 0h24v24H0z",
|
|
70
|
+
fill: "none"
|
|
71
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
72
|
+
d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
|
|
73
|
+
})),
|
|
74
|
+
decrement: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
75
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
76
|
+
height: "24px",
|
|
77
|
+
viewBox: "0 0 24 24",
|
|
78
|
+
width: "24px",
|
|
79
|
+
fill: "currentColor"
|
|
80
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
81
|
+
d: "M0 0h24v24H0z",
|
|
82
|
+
fill: "none"
|
|
83
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
84
|
+
d: "M19 13H5v-2h14v2z"
|
|
85
|
+
}))
|
|
86
|
+
};
|
|
207
87
|
|
|
208
88
|
var makeCancelable = function makeCancelable(promise) {
|
|
209
89
|
var hasCanceled_ = false;
|
|
@@ -230,10 +110,6 @@ var getNotOptionalErrorMessage = function getNotOptionalErrorMessage() {
|
|
|
230
110
|
return "This field is required. Please, enter a value.";
|
|
231
111
|
};
|
|
232
112
|
|
|
233
|
-
var getLengthErrorMessage = function getLengthErrorMessage(length) {
|
|
234
|
-
return "Min length ".concat(length.min, ", max length ").concat(length.max, ".");
|
|
235
|
-
};
|
|
236
|
-
|
|
237
113
|
var getPatternErrorMessage = function getPatternErrorMessage() {
|
|
238
114
|
return "Please match the format requested.";
|
|
239
115
|
};
|
|
@@ -242,16 +118,27 @@ var patternMatch = function patternMatch(pattern, value) {
|
|
|
242
118
|
return new RegExp(pattern).test(value);
|
|
243
119
|
};
|
|
244
120
|
|
|
245
|
-
var
|
|
246
|
-
var
|
|
121
|
+
var getLastOptionIndex = function getLastOptionIndex(filteredSuggestions) {
|
|
122
|
+
var last = 0;
|
|
123
|
+
|
|
124
|
+
var reducer = function reducer(acc, current) {
|
|
125
|
+
var _current$options;
|
|
126
|
+
|
|
127
|
+
return acc + ((_current$options = current.options) === null || _current$options === void 0 ? void 0 : _current$options.length);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
if (filteredSuggestions.length > 0) filteredSuggestions[0].options ? last = filteredSuggestions.reduce(reducer, 0) - 1 : last = filteredSuggestions.length - 1;
|
|
131
|
+
return last;
|
|
132
|
+
};
|
|
247
133
|
|
|
248
|
-
|
|
249
|
-
|
|
134
|
+
var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
135
|
+
var label = _ref.label,
|
|
250
136
|
_ref$name = _ref.name,
|
|
251
137
|
name = _ref$name === void 0 ? "" : _ref$name,
|
|
138
|
+
_ref$defaultValue = _ref.defaultValue,
|
|
139
|
+
defaultValue = _ref$defaultValue === void 0 ? "" : _ref$defaultValue,
|
|
252
140
|
value = _ref.value,
|
|
253
|
-
|
|
254
|
-
helperText = _ref$helperText === void 0 ? "" : _ref$helperText,
|
|
141
|
+
helperText = _ref.helperText,
|
|
255
142
|
_ref$placeholder = _ref.placeholder,
|
|
256
143
|
placeholder = _ref$placeholder === void 0 ? "" : _ref$placeholder,
|
|
257
144
|
action = _ref.action,
|
|
@@ -267,11 +154,11 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
267
154
|
suffix = _ref$suffix === void 0 ? "" : _ref$suffix,
|
|
268
155
|
onChange = _ref.onChange,
|
|
269
156
|
onBlur = _ref.onBlur,
|
|
270
|
-
|
|
271
|
-
error = _ref$error === void 0 ? "" : _ref$error,
|
|
157
|
+
error = _ref.error,
|
|
272
158
|
suggestions = _ref.suggestions,
|
|
273
159
|
pattern = _ref.pattern,
|
|
274
|
-
|
|
160
|
+
minLength = _ref.minLength,
|
|
161
|
+
maxLength = _ref.maxLength,
|
|
275
162
|
_ref$autocomplete = _ref.autocomplete,
|
|
276
163
|
autocomplete = _ref$autocomplete === void 0 ? "off" : _ref$autocomplete,
|
|
277
164
|
margin = _ref.margin,
|
|
@@ -280,49 +167,39 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
280
167
|
_ref$tabIndex = _ref.tabIndex,
|
|
281
168
|
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
282
169
|
|
|
283
|
-
var _useState = (0, _react.useState)(""),
|
|
284
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState,
|
|
285
|
-
|
|
286
|
-
setInnerValue = _useState2[1];
|
|
170
|
+
var _useState = (0, _react.useState)("input-".concat((0, _uuid.v4)())),
|
|
171
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 1),
|
|
172
|
+
inputId = _useState2[0];
|
|
287
173
|
|
|
288
|
-
var _useState3 = (0, _react.useState)(
|
|
174
|
+
var _useState3 = (0, _react.useState)(defaultValue),
|
|
289
175
|
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
290
|
-
|
|
291
|
-
|
|
176
|
+
innerValue = _useState4[0],
|
|
177
|
+
setInnerValue = _useState4[1];
|
|
292
178
|
|
|
293
179
|
var _useState5 = (0, _react.useState)(false),
|
|
294
180
|
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
295
|
-
|
|
296
|
-
|
|
181
|
+
isOpen = _useState6[0],
|
|
182
|
+
changeIsOpen = _useState6[1];
|
|
297
183
|
|
|
298
184
|
var _useState7 = (0, _react.useState)(false),
|
|
299
185
|
_useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
|
|
300
|
-
|
|
301
|
-
|
|
186
|
+
isSearching = _useState8[0],
|
|
187
|
+
changeIsSearching = _useState8[1];
|
|
302
188
|
|
|
303
189
|
var _useState9 = (0, _react.useState)(false),
|
|
304
190
|
_useState10 = (0, _slicedToArray2["default"])(_useState9, 2),
|
|
305
|
-
|
|
306
|
-
|
|
191
|
+
isAutosuggestError = _useState10[0],
|
|
192
|
+
changeIsAutosuggestError = _useState10[1];
|
|
307
193
|
|
|
308
|
-
var _useState11 = (0, _react.useState)(
|
|
194
|
+
var _useState11 = (0, _react.useState)([]),
|
|
309
195
|
_useState12 = (0, _slicedToArray2["default"])(_useState11, 2),
|
|
310
|
-
|
|
311
|
-
|
|
196
|
+
filteredSuggestions = _useState12[0],
|
|
197
|
+
changeFilteredSuggestions = _useState12[1];
|
|
312
198
|
|
|
313
|
-
var _useState13 = (0, _react.useState)(
|
|
199
|
+
var _useState13 = (0, _react.useState)(-1),
|
|
314
200
|
_useState14 = (0, _slicedToArray2["default"])(_useState13, 2),
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
var _useState15 = (0, _react.useState)(-1),
|
|
319
|
-
_useState16 = (0, _slicedToArray2["default"])(_useState15, 2),
|
|
320
|
-
visualFocusedSuggIndex = _useState16[0],
|
|
321
|
-
changeVisualFocusedSuggIndex = _useState16[1];
|
|
322
|
-
|
|
323
|
-
var _useState17 = (0, _react.useState)("input-".concat((0, _uuid.v4)())),
|
|
324
|
-
_useState18 = (0, _slicedToArray2["default"])(_useState17, 1),
|
|
325
|
-
inputId = _useState18[0];
|
|
201
|
+
visualFocusedSuggIndex = _useState14[0],
|
|
202
|
+
changeVisualFocusedSuggIndex = _useState14[1];
|
|
326
203
|
|
|
327
204
|
var suggestionsRef = (0, _react.useRef)(null);
|
|
328
205
|
var inputRef = (0, _react.useRef)(null);
|
|
@@ -330,15 +207,22 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
330
207
|
var colorsTheme = (0, _useTheme["default"])();
|
|
331
208
|
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
332
209
|
var autosuggestId = "".concat(inputId, "-listBox");
|
|
333
|
-
var errorId = "error-
|
|
210
|
+
var errorId = "error-".concat(inputId);
|
|
334
211
|
var numberInputContext = (0, _react.useContext)(_NumberInputContext["default"]);
|
|
212
|
+
var lastOptionIndex = (0, _react.useMemo)(function () {
|
|
213
|
+
return getLastOptionIndex(filteredSuggestions);
|
|
214
|
+
}, [filteredSuggestions]);
|
|
335
215
|
|
|
336
216
|
var isNotOptional = function isNotOptional(value) {
|
|
337
217
|
return value === "" && !optional;
|
|
338
218
|
};
|
|
339
219
|
|
|
340
220
|
var isLengthIncorrect = function isLengthIncorrect(value) {
|
|
341
|
-
return value
|
|
221
|
+
return value && minLength && maxLength && (value.length < minLength || value.length > maxLength);
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
var getLengthErrorMessage = function getLengthErrorMessage() {
|
|
225
|
+
return "Min length ".concat(minLength, ", max length ").concat(maxLength, ".");
|
|
342
226
|
};
|
|
343
227
|
|
|
344
228
|
var isNumberIncorrect = function isNumberIncorrect(value) {
|
|
@@ -355,12 +239,12 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
355
239
|
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, ".");
|
|
356
240
|
};
|
|
357
241
|
|
|
358
|
-
var
|
|
359
|
-
return typeof suggestions === "function" || suggestions
|
|
242
|
+
var hasSuggestions = function hasSuggestions() {
|
|
243
|
+
return typeof suggestions === "function" || (suggestions === null || suggestions === void 0 ? void 0 : suggestions.length) > 0;
|
|
360
244
|
};
|
|
361
245
|
|
|
362
246
|
var openSuggestions = function openSuggestions() {
|
|
363
|
-
|
|
247
|
+
hasSuggestions() && changeIsOpen(true);
|
|
364
248
|
};
|
|
365
249
|
|
|
366
250
|
var closeSuggestions = function closeSuggestions() {
|
|
@@ -376,7 +260,7 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
376
260
|
error: getNotOptionalErrorMessage()
|
|
377
261
|
});else if (isLengthIncorrect(newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
378
262
|
value: changedValue,
|
|
379
|
-
error: getLengthErrorMessage(
|
|
263
|
+
error: getLengthErrorMessage()
|
|
380
264
|
});else if (newValue && pattern && !patternMatch(pattern, newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
381
265
|
value: changedValue,
|
|
382
266
|
error: getPatternErrorMessage()
|
|
@@ -393,13 +277,14 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
393
277
|
document.activeElement !== actionRef.current && inputRef.current.focus();
|
|
394
278
|
};
|
|
395
279
|
|
|
396
|
-
var
|
|
397
|
-
|
|
398
|
-
|
|
280
|
+
var handleInputContainerOnMouseDown = function handleInputContainerOnMouseDown(event) {
|
|
281
|
+
// Avoid input to lose the focus when the container is pressed
|
|
282
|
+
document.activeElement === inputRef.current && event.preventDefault();
|
|
399
283
|
};
|
|
400
284
|
|
|
401
|
-
var
|
|
285
|
+
var handleIOnChange = function handleIOnChange(event) {
|
|
402
286
|
openSuggestions();
|
|
287
|
+
changeValue(event.target.value);
|
|
403
288
|
};
|
|
404
289
|
|
|
405
290
|
var handleIOnBlur = function handleIOnBlur(event) {
|
|
@@ -409,7 +294,7 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
409
294
|
error: getNotOptionalErrorMessage()
|
|
410
295
|
});else if (isLengthIncorrect(event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
411
296
|
value: event.target.value,
|
|
412
|
-
error: getLengthErrorMessage(
|
|
297
|
+
error: getLengthErrorMessage()
|
|
413
298
|
});else if (event.target.value && pattern && !patternMatch(pattern, event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
414
299
|
value: event.target.value,
|
|
415
300
|
error: getPatternErrorMessage()
|
|
@@ -422,15 +307,11 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
422
307
|
});
|
|
423
308
|
};
|
|
424
309
|
|
|
425
|
-
var handleIOnFocus = function handleIOnFocus() {
|
|
426
|
-
openSuggestions();
|
|
427
|
-
};
|
|
428
|
-
|
|
429
310
|
var handleIOnKeyDown = function handleIOnKeyDown(event) {
|
|
430
311
|
switch (event.keyCode) {
|
|
431
312
|
case 40:
|
|
432
313
|
// Arrow Down
|
|
433
|
-
if (numberInputContext) {
|
|
314
|
+
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number") {
|
|
434
315
|
decrementNumber();
|
|
435
316
|
event.preventDefault();
|
|
436
317
|
} else {
|
|
@@ -441,8 +322,6 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
441
322
|
changeVisualFocusedSuggIndex(function (visualFocusedSuggIndex) {
|
|
442
323
|
if (visualFocusedSuggIndex < filteredSuggestions.length - 1) return visualFocusedSuggIndex + 1;else if (visualFocusedSuggIndex === filteredSuggestions.length - 1) return 0;
|
|
443
324
|
});
|
|
444
|
-
changeIsScrollable(true);
|
|
445
|
-
changeIsActiveSuggestion(false);
|
|
446
325
|
}
|
|
447
326
|
}
|
|
448
327
|
|
|
@@ -450,7 +329,7 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
450
329
|
|
|
451
330
|
case 38:
|
|
452
331
|
// Arrow Up
|
|
453
|
-
if (numberInputContext) {
|
|
332
|
+
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number") {
|
|
454
333
|
incrementNumber();
|
|
455
334
|
event.preventDefault();
|
|
456
335
|
} else {
|
|
@@ -461,8 +340,6 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
461
340
|
changeVisualFocusedSuggIndex(function (visualFocusedSuggIndex) {
|
|
462
341
|
if (visualFocusedSuggIndex === 0 || visualFocusedSuggIndex === -1) return filteredSuggestions.length > 0 ? filteredSuggestions.length - 1 : suggestions.length - 1;else return visualFocusedSuggIndex - 1;
|
|
463
342
|
});
|
|
464
|
-
changeIsScrollable(true);
|
|
465
|
-
changeIsActiveSuggestion(false);
|
|
466
343
|
}
|
|
467
344
|
}
|
|
468
345
|
|
|
@@ -472,7 +349,7 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
472
349
|
// Esc
|
|
473
350
|
event.preventDefault();
|
|
474
351
|
|
|
475
|
-
if (
|
|
352
|
+
if (hasSuggestions()) {
|
|
476
353
|
changeValue("");
|
|
477
354
|
isOpen && closeSuggestions();
|
|
478
355
|
}
|
|
@@ -481,7 +358,7 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
481
358
|
|
|
482
359
|
case 13:
|
|
483
360
|
// Enter
|
|
484
|
-
if (
|
|
361
|
+
if (hasSuggestions() && !isSearching) {
|
|
485
362
|
var validFocusedSuggestion = filteredSuggestions.length > 0 && visualFocusedSuggIndex >= 0 && visualFocusedSuggIndex < filteredSuggestions.length;
|
|
486
363
|
validFocusedSuggestion && changeValue(filteredSuggestions[visualFocusedSuggIndex]);
|
|
487
364
|
isOpen && closeSuggestions();
|
|
@@ -491,6 +368,22 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
491
368
|
}
|
|
492
369
|
};
|
|
493
370
|
|
|
371
|
+
var handleClearActionOnClick = function handleClearActionOnClick() {
|
|
372
|
+
changeValue("");
|
|
373
|
+
inputRef.current.focus();
|
|
374
|
+
suggestions && closeSuggestions();
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
var handleDecrementActionOnClick = function handleDecrementActionOnClick() {
|
|
378
|
+
decrementNumber();
|
|
379
|
+
inputRef.current.focus();
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
var handleIncrementActionOnClick = function handleIncrementActionOnClick() {
|
|
383
|
+
incrementNumber();
|
|
384
|
+
inputRef.current.focus();
|
|
385
|
+
};
|
|
386
|
+
|
|
494
387
|
var setNumberProps = function setNumberProps(type, min, max, step) {
|
|
495
388
|
var _inputRef$current3, _inputRef$current4, _inputRef$current5, _inputRef$current6;
|
|
496
389
|
|
|
@@ -500,72 +393,6 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
500
393
|
step && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current6 = inputRef.current) === null || _inputRef$current6 === void 0 ? void 0 : _inputRef$current6.setAttribute("step", step));
|
|
501
394
|
};
|
|
502
395
|
|
|
503
|
-
(0, _react.useLayoutEffect)(function () {
|
|
504
|
-
var _suggestionsRef$curre;
|
|
505
|
-
|
|
506
|
-
isScrollable && (suggestionsRef === null || suggestionsRef === void 0 ? void 0 : (_suggestionsRef$curre = suggestionsRef.current) === null || _suggestionsRef$curre === void 0 ? void 0 : _suggestionsRef$curre.scrollTo({
|
|
507
|
-
top: visualFocusedSuggIndex * 39
|
|
508
|
-
}));
|
|
509
|
-
return changeIsScrollable(false);
|
|
510
|
-
}, [isScrollable, visualFocusedSuggIndex]);
|
|
511
|
-
(0, _react.useEffect)(function () {
|
|
512
|
-
if (typeof suggestions === "function") {
|
|
513
|
-
changeIsSearching(true);
|
|
514
|
-
changeIsAutosuggestError(false);
|
|
515
|
-
changeFilteredSuggestions([]);
|
|
516
|
-
var cancelablePromise = makeCancelable(suggestions(value !== null && value !== void 0 ? value : innerValue));
|
|
517
|
-
cancelablePromise.promise.then(function (promiseResponse) {
|
|
518
|
-
changeIsSearching(false);
|
|
519
|
-
changeIsAutosuggestError(false);
|
|
520
|
-
changeFilteredSuggestions(promiseResponse);
|
|
521
|
-
})["catch"](function (err) {
|
|
522
|
-
if (!err.isCanceled) {
|
|
523
|
-
changeIsSearching(false);
|
|
524
|
-
changeIsAutosuggestError(true);
|
|
525
|
-
}
|
|
526
|
-
});
|
|
527
|
-
return function () {
|
|
528
|
-
cancelablePromise.cancel();
|
|
529
|
-
};
|
|
530
|
-
} else if (suggestions && suggestions.length) {
|
|
531
|
-
changeFilteredSuggestions(suggestions.filter(function (suggestion) {
|
|
532
|
-
return suggestion.toUpperCase().startsWith((value !== null && value !== void 0 ? value : innerValue).toUpperCase());
|
|
533
|
-
}));
|
|
534
|
-
changeVisualFocusedSuggIndex(-1);
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
numberInputContext && setNumberProps(numberInputContext.typeNumber, numberInputContext.minNumber, numberInputContext.maxNumber, numberInputContext.stepNumber);
|
|
538
|
-
}, [value, innerValue, suggestions]);
|
|
539
|
-
var defaultClearAction = {
|
|
540
|
-
onClick: function onClick() {
|
|
541
|
-
changeValue("");
|
|
542
|
-
inputRef.current.focus();
|
|
543
|
-
suggestions && closeSuggestions();
|
|
544
|
-
},
|
|
545
|
-
icon: _react["default"].createElement("svg", {
|
|
546
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
547
|
-
width: "24",
|
|
548
|
-
height: "24",
|
|
549
|
-
viewBox: "0 0 24 24",
|
|
550
|
-
fill: "currentColor"
|
|
551
|
-
}, _react["default"].createElement("path", {
|
|
552
|
-
d: "M0 0h24v24H0V0z",
|
|
553
|
-
fill: "none"
|
|
554
|
-
}), _react["default"].createElement("path", {
|
|
555
|
-
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"
|
|
556
|
-
}))
|
|
557
|
-
};
|
|
558
|
-
|
|
559
|
-
var errorIcon = _react["default"].createElement("svg", {
|
|
560
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
561
|
-
height: "24px",
|
|
562
|
-
viewBox: "0 0 24 24",
|
|
563
|
-
width: "24px",
|
|
564
|
-
fill: "currentColor"
|
|
565
|
-
}, _react["default"].createElement("path", {
|
|
566
|
-
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"
|
|
567
|
-
}));
|
|
568
|
-
|
|
569
396
|
var decrementNumber = function decrementNumber() {
|
|
570
397
|
var numberValue = value !== null && value !== void 0 ? value : innerValue;
|
|
571
398
|
|
|
@@ -606,42 +433,43 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
606
433
|
}
|
|
607
434
|
};
|
|
608
435
|
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
436
|
+
(0, _react.useLayoutEffect)(function () {
|
|
437
|
+
var _suggestionsRef$curre, _visualFocusedOptionE;
|
|
438
|
+
|
|
439
|
+
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];
|
|
440
|
+
visualFocusedOptionEl === null || visualFocusedOptionEl === void 0 ? void 0 : (_visualFocusedOptionE = visualFocusedOptionEl.scrollIntoView) === null || _visualFocusedOptionE === void 0 ? void 0 : _visualFocusedOptionE.call(visualFocusedOptionEl, {
|
|
441
|
+
block: "nearest",
|
|
442
|
+
inline: "start"
|
|
443
|
+
});
|
|
444
|
+
}, [visualFocusedSuggIndex]);
|
|
445
|
+
(0, _react.useEffect)(function () {
|
|
446
|
+
if (typeof suggestions === "function") {
|
|
447
|
+
changeIsSearching(true);
|
|
448
|
+
changeIsAutosuggestError(false);
|
|
449
|
+
changeFilteredSuggestions([]);
|
|
450
|
+
var cancelablePromise = makeCancelable(suggestions(value !== null && value !== void 0 ? value : innerValue));
|
|
451
|
+
cancelablePromise.promise.then(function (promiseResponse) {
|
|
452
|
+
changeIsSearching(false);
|
|
453
|
+
changeIsAutosuggestError(false);
|
|
454
|
+
changeFilteredSuggestions(promiseResponse);
|
|
455
|
+
})["catch"](function (err) {
|
|
456
|
+
if (!err.isCanceled) {
|
|
457
|
+
changeIsSearching(false);
|
|
458
|
+
changeIsAutosuggestError(true);
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
return function () {
|
|
462
|
+
cancelablePromise.cancel();
|
|
463
|
+
};
|
|
464
|
+
} else if ((suggestions === null || suggestions === void 0 ? void 0 : suggestions.length) > 0) {
|
|
465
|
+
changeFilteredSuggestions(suggestions.filter(function (suggestion) {
|
|
466
|
+
return suggestion.toUpperCase().startsWith((value !== null && value !== void 0 ? value : innerValue).toUpperCase());
|
|
467
|
+
}));
|
|
468
|
+
changeVisualFocusedSuggIndex(-1);
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" && setNumberProps(numberInputContext.typeNumber, numberInputContext.minNumber, numberInputContext.maxNumber, numberInputContext.stepNumber);
|
|
472
|
+
}, [value, innerValue, suggestions, numberInputContext]);
|
|
645
473
|
|
|
646
474
|
var HighlightedSuggestion = function HighlightedSuggestion(_ref2) {
|
|
647
475
|
var suggestion = _ref2.suggestion,
|
|
@@ -649,135 +477,155 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
649
477
|
var regEx = new RegExp(value !== null && value !== void 0 ? value : innerValue, "i");
|
|
650
478
|
var matchedWords = suggestion.match(regEx);
|
|
651
479
|
var noMatchedWords = suggestion.replace(regEx, "");
|
|
652
|
-
|
|
480
|
+
var isLastOption = index === lastOptionIndex;
|
|
481
|
+
return /*#__PURE__*/_react["default"].createElement(Suggestion, {
|
|
653
482
|
id: "suggestion-".concat(index),
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
onMouseUp: function onMouseUp(event) {
|
|
658
|
-
if (event.button === 0 && isActiveSuggestion) {
|
|
659
|
-
changeValue(suggestion);
|
|
660
|
-
changeIsActiveSuggestion(false);
|
|
661
|
-
closeSuggestions();
|
|
662
|
-
}
|
|
663
|
-
},
|
|
664
|
-
onMouseEnter: function onMouseEnter() {
|
|
665
|
-
changeVisualFocusedSuggIndex(index);
|
|
666
|
-
},
|
|
667
|
-
onMouseLeave: function onMouseLeave() {
|
|
668
|
-
changeIsActiveSuggestion(false);
|
|
483
|
+
onClick: function onClick() {
|
|
484
|
+
changeValue(suggestion);
|
|
485
|
+
closeSuggestions();
|
|
669
486
|
},
|
|
670
487
|
visualFocused: visualFocusedSuggIndex === index,
|
|
671
|
-
active: visualFocusedSuggIndex === index && isActiveSuggestion,
|
|
672
488
|
role: "option",
|
|
673
489
|
"aria-selected": visualFocusedSuggIndex === index && "true"
|
|
674
|
-
},
|
|
490
|
+
}, /*#__PURE__*/_react["default"].createElement(StyledSuggestion, {
|
|
491
|
+
last: isLastOption,
|
|
492
|
+
visualFocused: visualFocusedSuggIndex === index
|
|
493
|
+
}, typeof suggestions === "function" ? suggestion : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("strong", null, matchedWords), noMatchedWords)));
|
|
675
494
|
};
|
|
676
495
|
|
|
677
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
496
|
+
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
678
497
|
theme: colorsTheme.textInput
|
|
679
|
-
}, _react["default"].createElement(DxcInput, {
|
|
498
|
+
}, /*#__PURE__*/_react["default"].createElement(DxcInput, {
|
|
680
499
|
margin: margin,
|
|
681
500
|
ref: ref,
|
|
682
501
|
size: size
|
|
683
|
-
}, _react["default"].createElement(Label, {
|
|
502
|
+
}, label && /*#__PURE__*/_react["default"].createElement(Label, {
|
|
684
503
|
htmlFor: inputId,
|
|
685
504
|
disabled: disabled,
|
|
686
|
-
backgroundType: backgroundType
|
|
687
|
-
|
|
505
|
+
backgroundType: backgroundType,
|
|
506
|
+
helperText: helperText
|
|
507
|
+
}, label, " ", optional && /*#__PURE__*/_react["default"].createElement(OptionalLabel, null, "(Optional)")), helperText && /*#__PURE__*/_react["default"].createElement(HelperText, {
|
|
688
508
|
disabled: disabled,
|
|
689
509
|
backgroundType: backgroundType
|
|
690
|
-
}, helperText), _react["default"].createElement(InputContainer, {
|
|
510
|
+
}, helperText), /*#__PURE__*/_react["default"].createElement(InputContainer, {
|
|
691
511
|
error: error,
|
|
692
512
|
disabled: disabled,
|
|
693
513
|
backgroundType: backgroundType,
|
|
694
|
-
onClick: handleInputContainerOnClick
|
|
695
|
-
|
|
514
|
+
onClick: handleInputContainerOnClick,
|
|
515
|
+
onMouseDown: handleInputContainerOnMouseDown
|
|
516
|
+
}, prefix && /*#__PURE__*/_react["default"].createElement(Prefix, {
|
|
696
517
|
disabled: disabled,
|
|
697
518
|
backgroundType: backgroundType
|
|
698
|
-
}, prefix), _react["default"].createElement(Input, {
|
|
519
|
+
}, prefix), /*#__PURE__*/_react["default"].createElement(Input, {
|
|
699
520
|
id: inputId,
|
|
700
521
|
name: name,
|
|
701
522
|
value: value !== null && value !== void 0 ? value : innerValue,
|
|
702
523
|
placeholder: placeholder,
|
|
703
|
-
onChange: handleIOnChange,
|
|
704
|
-
onClick: handleIOnClick,
|
|
705
524
|
onBlur: handleIOnBlur,
|
|
706
|
-
|
|
525
|
+
onChange: handleIOnChange,
|
|
526
|
+
onFocus: function onFocus() {
|
|
527
|
+
openSuggestions();
|
|
528
|
+
},
|
|
707
529
|
onKeyDown: handleIOnKeyDown,
|
|
530
|
+
onMouseDown: function onMouseDown(event) {
|
|
531
|
+
event.stopPropagation();
|
|
532
|
+
},
|
|
708
533
|
disabled: disabled,
|
|
709
534
|
ref: inputRef,
|
|
710
535
|
backgroundType: backgroundType,
|
|
711
536
|
pattern: pattern,
|
|
712
|
-
minLength:
|
|
713
|
-
maxLength:
|
|
537
|
+
minLength: minLength,
|
|
538
|
+
maxLength: maxLength,
|
|
714
539
|
autoComplete: autocomplete,
|
|
715
540
|
tabIndex: tabIndex,
|
|
716
|
-
role: isTextInputType() &&
|
|
717
|
-
"aria-autocomplete": isTextInputType() &&
|
|
718
|
-
"aria-controls": isTextInputType() &&
|
|
719
|
-
"aria-
|
|
720
|
-
"aria-
|
|
541
|
+
role: isTextInputType() && hasSuggestions() ? "combobox" : "textbox",
|
|
542
|
+
"aria-autocomplete": isTextInputType() && hasSuggestions() ? "list" : undefined,
|
|
543
|
+
"aria-controls": isTextInputType() && hasSuggestions() ? autosuggestId : undefined,
|
|
544
|
+
"aria-disabled": disabled,
|
|
545
|
+
"aria-expanded": isTextInputType() && hasSuggestions() ? isOpen ? "true" : "false" : undefined,
|
|
546
|
+
"aria-activedescendant": isTextInputType() && hasSuggestions() && isOpen && visualFocusedSuggIndex !== -1 ? "suggestion-".concat(visualFocusedSuggIndex) : undefined,
|
|
721
547
|
"aria-invalid": error ? "true" : "false",
|
|
722
|
-
"aria-
|
|
548
|
+
"aria-errormessage": error ? errorId : undefined,
|
|
723
549
|
"aria-required": optional ? "false" : "true"
|
|
724
|
-
}), !disabled && error && _react["default"].createElement(ErrorIcon, {
|
|
550
|
+
}), !disabled && error && /*#__PURE__*/_react["default"].createElement(ErrorIcon, {
|
|
725
551
|
backgroundType: backgroundType,
|
|
726
552
|
"aria-label": "Error"
|
|
727
|
-
},
|
|
728
|
-
onClick:
|
|
553
|
+
}, textInputIcons.error), !disabled && clearable && (value !== null && value !== void 0 ? value : innerValue).length > 0 && /*#__PURE__*/_react["default"].createElement(Action, {
|
|
554
|
+
onClick: function onClick() {
|
|
555
|
+
return handleClearActionOnClick();
|
|
556
|
+
},
|
|
557
|
+
onMouseDown: function onMouseDown(event) {
|
|
558
|
+
event.stopPropagation();
|
|
559
|
+
},
|
|
729
560
|
backgroundType: backgroundType,
|
|
730
561
|
tabIndex: tabIndex,
|
|
731
|
-
|
|
732
|
-
|
|
562
|
+
title: "Clear field",
|
|
563
|
+
"aria-label": "Clear field"
|
|
564
|
+
}, 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, {
|
|
733
565
|
ref: actionRef,
|
|
734
566
|
disabled: disabled,
|
|
735
|
-
onClick:
|
|
567
|
+
onClick: function onClick() {
|
|
568
|
+
return handleDecrementActionOnClick();
|
|
569
|
+
},
|
|
570
|
+
onMouseDown: function onMouseDown(event) {
|
|
571
|
+
event.stopPropagation();
|
|
572
|
+
},
|
|
736
573
|
backgroundType: backgroundType,
|
|
737
574
|
tabIndex: tabIndex,
|
|
738
|
-
|
|
739
|
-
|
|
575
|
+
title: "Decrement value",
|
|
576
|
+
"aria-label": "Decrement value"
|
|
577
|
+
}, textInputIcons.decrement), /*#__PURE__*/_react["default"].createElement(Action, {
|
|
740
578
|
ref: actionRef,
|
|
741
579
|
disabled: disabled,
|
|
742
|
-
onClick:
|
|
580
|
+
onClick: function onClick() {
|
|
581
|
+
return handleIncrementActionOnClick();
|
|
582
|
+
},
|
|
583
|
+
onMouseDown: function onMouseDown(event) {
|
|
584
|
+
event.stopPropagation();
|
|
585
|
+
},
|
|
743
586
|
backgroundType: backgroundType,
|
|
744
587
|
tabIndex: tabIndex,
|
|
745
|
-
|
|
746
|
-
|
|
588
|
+
title: "Increment value",
|
|
589
|
+
"aria-label": "Increment value"
|
|
590
|
+
}, textInputIcons.increment)) : action && /*#__PURE__*/_react["default"].createElement(Action, {
|
|
747
591
|
ref: actionRef,
|
|
748
592
|
disabled: disabled,
|
|
749
|
-
onClick:
|
|
750
|
-
|
|
593
|
+
onClick: function onClick() {
|
|
594
|
+
return action.onClick();
|
|
595
|
+
},
|
|
596
|
+
onMouseDown: function onMouseDown(event) {
|
|
597
|
+
event.stopPropagation();
|
|
598
|
+
},
|
|
599
|
+
title: action.title,
|
|
600
|
+
"aria-label": action.title,
|
|
751
601
|
backgroundType: backgroundType,
|
|
752
602
|
tabIndex: tabIndex
|
|
753
|
-
}, typeof action.icon === "string" ? _react["default"].createElement(ActionIcon, {
|
|
603
|
+
}, typeof action.icon === "string" ? /*#__PURE__*/_react["default"].createElement(ActionIcon, {
|
|
754
604
|
src: action.icon
|
|
755
|
-
}) : action.icon), suffix && _react["default"].createElement(Suffix, {
|
|
605
|
+
}) : action.icon), suffix && /*#__PURE__*/_react["default"].createElement(Suffix, {
|
|
756
606
|
disabled: disabled,
|
|
757
607
|
backgroundType: backgroundType
|
|
758
|
-
}, suffix), isOpen && _react["default"].createElement(Suggestions, {
|
|
608
|
+
}, suffix), isOpen && (filteredSuggestions.length > 0 || isSearching || isAutosuggestError) && /*#__PURE__*/_react["default"].createElement(Suggestions, {
|
|
759
609
|
id: autosuggestId,
|
|
760
610
|
isError: isAutosuggestError,
|
|
761
611
|
onMouseDown: function onMouseDown(event) {
|
|
762
612
|
event.preventDefault();
|
|
763
613
|
},
|
|
764
|
-
onMouseLeave: function onMouseLeave() {
|
|
765
|
-
changeVisualFocusedSuggIndex(-1);
|
|
766
|
-
},
|
|
767
614
|
ref: suggestionsRef,
|
|
768
615
|
role: "listbox",
|
|
769
616
|
"aria-label": label
|
|
770
|
-
}, !isSearching && !isAutosuggestError && filteredSuggestions.length
|
|
771
|
-
return _react["default"].createElement(HighlightedSuggestion, {
|
|
617
|
+
}, !isSearching && !isAutosuggestError && filteredSuggestions.length > 0 && filteredSuggestions.map(function (suggestion, index) {
|
|
618
|
+
return /*#__PURE__*/_react["default"].createElement(HighlightedSuggestion, {
|
|
772
619
|
key: "suggestion-".concat((0, _uuid.v4)()),
|
|
773
620
|
suggestion: suggestion,
|
|
774
621
|
index: index
|
|
775
622
|
});
|
|
776
|
-
}), isSearching && _react["default"].createElement(SuggestionsSystemMessage, null, "Searching..."), isAutosuggestError && _react["default"].createElement(SuggestionsError, null, _react["default"].createElement(SuggestionsErrorIcon, {
|
|
623
|
+
}), isSearching && /*#__PURE__*/_react["default"].createElement(SuggestionsSystemMessage, null, "Searching..."), isAutosuggestError && /*#__PURE__*/_react["default"].createElement(SuggestionsError, null, /*#__PURE__*/_react["default"].createElement(SuggestionsErrorIcon, {
|
|
777
624
|
backgroundType: backgroundType
|
|
778
|
-
},
|
|
625
|
+
}, textInputIcons.error), "Error fetching data"))), !disabled && typeof error === "string" && /*#__PURE__*/_react["default"].createElement(Error, {
|
|
779
626
|
id: errorId,
|
|
780
|
-
backgroundType: backgroundType
|
|
627
|
+
backgroundType: backgroundType,
|
|
628
|
+
"aria-live": error ? "assertive" : "off"
|
|
781
629
|
}, error)));
|
|
782
630
|
});
|
|
783
631
|
|
|
@@ -792,7 +640,7 @@ var calculateWidth = function calculateWidth(margin, size) {
|
|
|
792
640
|
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
793
641
|
};
|
|
794
642
|
|
|
795
|
-
var DxcInput = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
643
|
+
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) {
|
|
796
644
|
return calculateWidth(props.margin, props.size);
|
|
797
645
|
}, function (props) {
|
|
798
646
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
@@ -806,7 +654,7 @@ var DxcInput = _styledComponents["default"].div(_templateObject(), function (pro
|
|
|
806
654
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
807
655
|
});
|
|
808
656
|
|
|
809
|
-
var Label = _styledComponents["default"].label(_templateObject2(), function (props) {
|
|
657
|
+
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 ", "\n"])), function (props) {
|
|
810
658
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledLabelFontColorOnDark : props.theme.disabledLabelFontColor : props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
811
659
|
}, function (props) {
|
|
812
660
|
return props.theme.fontFamily;
|
|
@@ -818,13 +666,15 @@ var Label = _styledComponents["default"].label(_templateObject2(), function (pro
|
|
|
818
666
|
return props.theme.labelFontWeight;
|
|
819
667
|
}, function (props) {
|
|
820
668
|
return props.theme.labelLineHeight;
|
|
669
|
+
}, function (props) {
|
|
670
|
+
return !props.helperText && "margin-bottom: 0.25rem";
|
|
821
671
|
});
|
|
822
672
|
|
|
823
|
-
var OptionalLabel = _styledComponents["default"].span(_templateObject3(), function (props) {
|
|
673
|
+
var OptionalLabel = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n font-weight: ", ";\n"])), function (props) {
|
|
824
674
|
return props.theme.optionalLabelFontWeight;
|
|
825
675
|
});
|
|
826
676
|
|
|
827
|
-
var HelperText = _styledComponents["default"].span(_templateObject4(), function (props) {
|
|
677
|
+
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 margin-bottom: 0.25rem;\n"])), function (props) {
|
|
828
678
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledHelperTextFontColorOnDark : props.theme.disabledHelperTextFontColor : props.backgroundType === "dark" ? props.theme.helperTextFontColorOnDark : props.theme.helperTextFontColor;
|
|
829
679
|
}, function (props) {
|
|
830
680
|
return props.theme.fontFamily;
|
|
@@ -838,7 +688,7 @@ var HelperText = _styledComponents["default"].span(_templateObject4(), function
|
|
|
838
688
|
return props.theme.helperTextLineHeight;
|
|
839
689
|
});
|
|
840
690
|
|
|
841
|
-
var InputContainer = _styledComponents["default"].div(_templateObject5(), function (props) {
|
|
691
|
+
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 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) {
|
|
842
692
|
if (props.disabled) return props.backgroundType === "dark" ? "background-color: ".concat(props.theme.disabledContainerFillColorOnDark, ";") : "background-color: ".concat(props.theme.disabledContainerFillColor, ";");
|
|
843
693
|
}, function (props) {
|
|
844
694
|
if (props.disabled) return props.backgroundType === "dark" ? props.theme.disabledBorderColorOnDark : props.theme.disabledBorderColor;else return props.backgroundType === "dark" ? props.theme.enabledBorderColorOnDark : props.theme.enabledBorderColor;
|
|
@@ -850,7 +700,7 @@ var InputContainer = _styledComponents["default"].div(_templateObject5(), functi
|
|
|
850
700
|
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 ");
|
|
851
701
|
});
|
|
852
702
|
|
|
853
|
-
var Input = _styledComponents["default"].input(_templateObject6(), function (props) {
|
|
703
|
+
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 overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\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) {
|
|
854
704
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledValueFontColorOnDark : props.theme.disabledValueFontColor : props.backgroundType === "dark" ? props.theme.valueFontColorOnDark : props.theme.valueFontColor;
|
|
855
705
|
}, function (props) {
|
|
856
706
|
return props.theme.fontFamily;
|
|
@@ -866,9 +716,9 @@ var Input = _styledComponents["default"].input(_templateObject6(), function (pro
|
|
|
866
716
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPlaceholderFontColorOnDark : props.theme.disabledPlaceholderFontColor : props.backgroundType === "dark" ? props.theme.placeholderFontColorOnDark : props.theme.placeholderFontColor;
|
|
867
717
|
});
|
|
868
718
|
|
|
869
|
-
var ActionIcon = _styledComponents["default"].img(_templateObject7());
|
|
719
|
+
var ActionIcon = _styledComponents["default"].img(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n width: 16px;\n height: 16px;\n"])));
|
|
870
720
|
|
|
871
|
-
var Action = _styledComponents["default"].button(_templateObject8(), function (props) {
|
|
721
|
+
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) {
|
|
872
722
|
return props.theme.fontFamily;
|
|
873
723
|
}, function (props) {
|
|
874
724
|
return props.disabled ? "cursor: not-allowed;" : "cursor: pointer;";
|
|
@@ -877,37 +727,37 @@ var Action = _styledComponents["default"].button(_templateObject8(), function (p
|
|
|
877
727
|
}, function (props) {
|
|
878
728
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledActionIconColorOnDark : props.theme.disabledActionIconColor : props.backgroundType === "dark" ? props.theme.actionIconColorOnDark : props.theme.actionIconColor;
|
|
879
729
|
}, function (props) {
|
|
880
|
-
return !props.disabled && "\n &:
|
|
730
|
+
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 ");
|
|
881
731
|
});
|
|
882
732
|
|
|
883
|
-
var Prefix = _styledComponents["default"].span(_templateObject9(), function (props) {
|
|
733
|
+
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) {
|
|
884
734
|
var color = props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPrefixColorOnDark : props.theme.disabledPrefixColor : props.backgroundType === "dark" ? props.theme.prefixColorOnDark : props.theme.prefixColor;
|
|
885
735
|
return "color: ".concat(color, "; border-right: 1px solid ").concat(color, ";");
|
|
886
736
|
}, function (props) {
|
|
887
737
|
return props.theme.fontFamily;
|
|
888
738
|
});
|
|
889
739
|
|
|
890
|
-
var Suffix = _styledComponents["default"].span(_templateObject10(), function (props) {
|
|
740
|
+
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) {
|
|
891
741
|
var color = props.disabled ? props.backgroundType === "dark" ? props.theme.disabledSuffixColorOnDark : props.theme.disabledSuffixColor : props.backgroundType === "dark" ? props.theme.suffixColorOnDark : props.theme.suffixColor;
|
|
892
742
|
return "color: ".concat(color, "; border-left: 1px solid ").concat(color, ";");
|
|
893
743
|
}, function (props) {
|
|
894
744
|
return props.theme.fontFamily;
|
|
895
745
|
});
|
|
896
746
|
|
|
897
|
-
var ErrorIcon = _styledComponents["default"].span(_templateObject11(), function (props) {
|
|
747
|
+
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) {
|
|
898
748
|
return props.backgroundType === "dark" ? props.theme.errorIconColorOnDark : props.theme.errorIconColor;
|
|
899
749
|
});
|
|
900
750
|
|
|
901
|
-
var Error = _styledComponents["default"].span(_templateObject12(), function (props) {
|
|
751
|
+
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 margin-top: 0.25rem;\n"])), function (props) {
|
|
902
752
|
return props.backgroundType === "dark" ? props.theme.errorMessageColorOnDark : props.theme.errorMessageColor;
|
|
903
753
|
}, function (props) {
|
|
904
754
|
return props.theme.fontFamily;
|
|
905
755
|
});
|
|
906
756
|
|
|
907
|
-
var Suggestions = _styledComponents["default"].ul(_templateObject13(), function (props) {
|
|
908
|
-
return props.isError ? props.theme.
|
|
757
|
+
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) {
|
|
758
|
+
return props.isError ? props.theme.errorListDialogBackgroundColor : props.theme.listDialogBackgroundColor;
|
|
909
759
|
}, function (props) {
|
|
910
|
-
return props.isError ? props.theme.
|
|
760
|
+
return props.isError ? props.theme.errorListDialogBorderColor : props.theme.listDialogBorderColor;
|
|
911
761
|
}, function (props) {
|
|
912
762
|
return props.theme.listOptionFontColor;
|
|
913
763
|
}, function (props) {
|
|
@@ -920,55 +770,29 @@ var Suggestions = _styledComponents["default"].ul(_templateObject13(), function
|
|
|
920
770
|
return props.theme.listOptionFontWeight;
|
|
921
771
|
});
|
|
922
772
|
|
|
923
|
-
var Suggestion = _styledComponents["default"].li(_templateObject14(), function (props) {
|
|
924
|
-
return props.
|
|
773
|
+
var Suggestion = _styledComponents["default"].li(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\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) {
|
|
774
|
+
return props.visualFocused ? props.theme.focusListOptionBorderColor : "transparent";
|
|
775
|
+
}, function (props) {
|
|
776
|
+
return props.theme.hoverListOptionBackgroundColor;
|
|
777
|
+
}, function (props) {
|
|
778
|
+
return props.theme.activeListOptionBackgroundColor;
|
|
779
|
+
});
|
|
780
|
+
|
|
781
|
+
var StyledSuggestion = _styledComponents["default"].span(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2["default"])(["\n width: 100%;\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) {
|
|
782
|
+
return props.last || props.visualFocused ? "border-bottom: 1px solid transparent" : "border-bottom: 1px solid ".concat(props.theme.listOptionDividerColor);
|
|
925
783
|
});
|
|
926
784
|
|
|
927
|
-
var SuggestionsSystemMessage = _styledComponents["default"].span(
|
|
785
|
+
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) {
|
|
928
786
|
return props.theme.systemMessageFontColor;
|
|
929
787
|
});
|
|
930
788
|
|
|
931
|
-
var SuggestionsErrorIcon = _styledComponents["default"].span(
|
|
789
|
+
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) {
|
|
932
790
|
return props.backgroundType === "dark" ? props.theme.errorIconColorOnDark : props.theme.errorIconColor;
|
|
933
791
|
});
|
|
934
792
|
|
|
935
|
-
var SuggestionsError = _styledComponents["default"].span(
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
name: _propTypes["default"].string,
|
|
940
|
-
value: _propTypes["default"].string,
|
|
941
|
-
helperText: _propTypes["default"].string,
|
|
942
|
-
placeholder: _propTypes["default"].string,
|
|
943
|
-
action: _propTypes["default"].shape({
|
|
944
|
-
onClick: _propTypes["default"].func.isRequired,
|
|
945
|
-
icon: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
946
|
-
type: _propTypes["default"].oneOf(["svg"])
|
|
947
|
-
}), _propTypes["default"].string]).isRequired
|
|
948
|
-
}),
|
|
949
|
-
clearable: _propTypes["default"].bool,
|
|
950
|
-
disabled: _propTypes["default"].bool,
|
|
951
|
-
optional: _propTypes["default"].bool,
|
|
952
|
-
prefix: _propTypes["default"].string,
|
|
953
|
-
suffix: _propTypes["default"].string,
|
|
954
|
-
onChange: _propTypes["default"].func,
|
|
955
|
-
onBlur: _propTypes["default"].func,
|
|
956
|
-
error: _propTypes["default"].string,
|
|
957
|
-
autocomplete: _propTypes["default"].string,
|
|
958
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
959
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
960
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
961
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
962
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
963
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
964
|
-
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
965
|
-
suggestions: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].array]),
|
|
966
|
-
pattern: _propTypes["default"].string,
|
|
967
|
-
length: _propTypes["default"].shape({
|
|
968
|
-
min: _propTypes["default"].number,
|
|
969
|
-
max: _propTypes["default"].number
|
|
970
|
-
}),
|
|
971
|
-
tabIndex: _propTypes["default"].number
|
|
972
|
-
};
|
|
793
|
+
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) {
|
|
794
|
+
return props.theme.errorListDialogFontColor;
|
|
795
|
+
});
|
|
796
|
+
|
|
973
797
|
var _default = DxcTextInput;
|
|
974
798
|
exports["default"] = _default;
|