@dxc-technology/halstack-react 0.0.0-227874a → 0.0.0-22b474c
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 +8 -7
- package/HalstackContext.d.ts +1339 -0
- package/HalstackContext.js +335 -0
- package/accordion/Accordion.d.ts +4 -0
- package/accordion/Accordion.js +124 -243
- package/accordion/Accordion.stories.tsx +395 -0
- package/accordion/Accordion.test.js +71 -0
- package/accordion/types.d.ts +69 -0
- package/accordion/types.js +5 -0
- package/accordion-group/AccordionGroup.d.ts +7 -0
- package/accordion-group/AccordionGroup.js +70 -107
- package/accordion-group/AccordionGroup.stories.tsx +251 -0
- package/accordion-group/AccordionGroup.test.js +126 -0
- package/accordion-group/types.d.ts +79 -0
- package/accordion-group/types.js +5 -0
- package/alert/Alert.d.ts +4 -0
- package/alert/Alert.js +45 -157
- package/alert/Alert.stories.tsx +198 -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 +15 -17
- package/badge/types.d.ts +5 -0
- package/badge/types.js +5 -0
- package/bleed/Bleed.d.ts +3 -0
- package/bleed/Bleed.js +51 -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/box/Box.js +39 -81
- package/box/Box.stories.tsx +147 -0
- package/box/Box.test.js +18 -0
- package/box/types.d.ts +44 -0
- package/box/types.js +5 -0
- package/bulleted-list/BulletedList.d.ts +7 -0
- package/bulleted-list/BulletedList.js +123 -0
- package/bulleted-list/BulletedList.stories.tsx +200 -0
- package/bulleted-list/types.d.ts +11 -0
- package/bulleted-list/types.js +5 -0
- package/button/Button.d.ts +4 -0
- package/button/Button.js +60 -145
- package/button/Button.stories.tsx +425 -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/card/Card.js +53 -147
- package/card/Card.stories.tsx +200 -0
- package/card/Card.test.js +50 -0
- package/card/ice-cream.jpg +0 -0
- package/card/types.d.ts +68 -0
- package/card/types.js +5 -0
- package/checkbox/Checkbox.d.ts +4 -0
- package/checkbox/Checkbox.js +112 -161
- package/checkbox/Checkbox.stories.tsx +260 -0
- package/checkbox/Checkbox.test.js +155 -0
- package/checkbox/types.d.ts +68 -0
- package/checkbox/types.js +5 -0
- package/chip/Chip.d.ts +4 -0
- package/chip/Chip.js +32 -144
- package/chip/Chip.stories.tsx +206 -0
- package/chip/Chip.test.js +54 -0
- package/chip/types.d.ts +45 -0
- package/chip/types.js +5 -0
- package/common/utils.d.ts +1 -0
- package/common/utils.js +4 -4
- package/common/variables.d.ts +1625 -0
- package/common/variables.js +582 -644
- package/date-input/Calendar.d.ts +4 -0
- package/date-input/Calendar.js +258 -0
- package/date-input/DateInput.d.ts +4 -0
- package/date-input/DateInput.js +179 -310
- package/date-input/DateInput.stories.tsx +304 -0
- package/date-input/DateInput.test.js +835 -0
- package/date-input/DatePicker.d.ts +4 -0
- package/date-input/DatePicker.js +146 -0
- package/date-input/Icons.d.ts +6 -0
- package/date-input/Icons.js +75 -0
- package/date-input/YearPicker.d.ts +4 -0
- package/date-input/YearPicker.js +126 -0
- package/date-input/types.d.ts +158 -0
- package/date-input/types.js +5 -0
- package/dialog/Dialog.d.ts +4 -0
- package/dialog/Dialog.js +81 -150
- package/dialog/Dialog.stories.tsx +319 -0
- package/dialog/Dialog.test.js +369 -0
- package/dialog/types.d.ts +44 -0
- package/dialog/types.js +5 -0
- package/dropdown/Dropdown.d.ts +4 -0
- package/dropdown/Dropdown.js +246 -402
- package/dropdown/Dropdown.stories.tsx +438 -0
- package/dropdown/Dropdown.test.js +586 -0
- package/dropdown/DropdownMenu.d.ts +4 -0
- package/dropdown/DropdownMenu.js +70 -0
- package/dropdown/DropdownMenuItem.d.ts +4 -0
- package/dropdown/DropdownMenuItem.js +79 -0
- package/dropdown/types.d.ts +100 -0
- package/dropdown/types.js +5 -0
- package/file-input/FileInput.d.ts +4 -0
- package/file-input/FileInput.js +210 -307
- package/file-input/FileInput.stories.tsx +618 -0
- package/file-input/FileInput.test.js +457 -0
- package/file-input/FileItem.d.ts +4 -0
- package/file-input/FileItem.js +58 -183
- package/file-input/types.d.ts +129 -0
- package/file-input/types.js +5 -0
- package/flex/Flex.d.ts +4 -0
- package/flex/Flex.js +69 -0
- package/flex/Flex.stories.tsx +98 -0
- package/flex/types.d.ts +32 -0
- package/flex/types.js +5 -0
- package/footer/Footer.d.ts +4 -0
- package/footer/Footer.js +51 -289
- package/footer/Footer.stories.tsx +228 -0
- package/footer/Footer.test.js +97 -0
- package/footer/Icons.d.ts +2 -0
- package/footer/Icons.js +16 -16
- package/footer/types.d.ts +66 -0
- package/footer/types.js +5 -0
- package/grid/Grid.d.ts +7 -0
- package/grid/Grid.js +91 -0
- package/grid/Grid.stories.tsx +219 -0
- package/grid/types.d.ts +115 -0
- package/grid/types.js +5 -0
- package/header/Header.d.ts +8 -0
- package/header/Header.js +136 -303
- package/header/Header.stories.tsx +315 -0
- package/header/Header.test.js +79 -0
- package/header/Icons.d.ts +2 -0
- package/header/Icons.js +9 -34
- package/header/types.d.ts +48 -0
- package/header/types.js +5 -0
- package/heading/Heading.d.ts +4 -0
- package/heading/Heading.js +26 -97
- 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 +51 -0
- package/inset/Inset.stories.tsx +230 -0
- package/inset/types.d.ts +37 -0
- package/inset/types.js +5 -0
- package/layout/ApplicationLayout.d.ts +20 -0
- package/layout/ApplicationLayout.js +77 -233
- package/layout/ApplicationLayout.stories.tsx +162 -0
- package/layout/Icons.d.ts +5 -0
- package/layout/Icons.js +19 -8
- package/layout/SidenavContext.d.ts +5 -0
- package/layout/SidenavContext.js +19 -0
- package/layout/types.d.ts +41 -0
- package/layout/types.js +5 -0
- package/link/Link.d.ts +4 -0
- package/link/Link.js +66 -167
- package/link/Link.stories.tsx +253 -0
- package/link/Link.test.js +81 -0
- package/link/types.d.ts +54 -0
- package/link/types.js +5 -0
- package/main.d.ts +45 -40
- package/main.js +122 -104
- package/nav-tabs/NavTabs.d.ts +8 -0
- package/nav-tabs/NavTabs.js +125 -0
- package/nav-tabs/NavTabs.stories.tsx +260 -0
- package/nav-tabs/NavTabs.test.js +82 -0
- package/nav-tabs/Tab.d.ts +4 -0
- package/nav-tabs/Tab.js +150 -0
- package/nav-tabs/types.d.ts +53 -0
- package/nav-tabs/types.js +5 -0
- package/number-input/NumberInput.d.ts +4 -0
- package/number-input/NumberInput.js +21 -81
- package/number-input/NumberInput.stories.tsx +115 -0
- package/number-input/NumberInput.test.js +542 -0
- package/number-input/NumberInputContext.d.ts +4 -0
- package/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 +124 -0
- package/number-input/types.js +5 -0
- package/package.json +35 -33
- package/paginator/Icons.d.ts +5 -0
- package/paginator/Icons.js +25 -37
- package/paginator/Paginator.d.ts +4 -0
- package/paginator/Paginator.js +30 -172
- package/paginator/Paginator.stories.tsx +87 -0
- package/paginator/Paginator.test.js +305 -0
- package/paginator/types.d.ts +38 -0
- package/paginator/types.js +5 -0
- package/paragraph/Paragraph.d.ts +5 -0
- package/paragraph/Paragraph.js +38 -0
- package/paragraph/Paragraph.stories.tsx +44 -0
- package/password-input/PasswordInput.d.ts +4 -0
- package/password-input/PasswordInput.js +40 -77
- package/password-input/PasswordInput.stories.tsx +131 -0
- package/password-input/PasswordInput.test.js +181 -0
- package/password-input/types.d.ts +110 -0
- package/password-input/types.js +5 -0
- package/progress-bar/ProgressBar.d.ts +4 -0
- package/progress-bar/ProgressBar.js +76 -142
- package/progress-bar/ProgressBar.stories.jsx +93 -0
- package/progress-bar/ProgressBar.test.js +110 -0
- package/progress-bar/types.d.ts +37 -0
- package/progress-bar/types.js +5 -0
- package/quick-nav/QuickNav.d.ts +4 -0
- package/quick-nav/QuickNav.js +117 -0
- package/quick-nav/QuickNav.stories.tsx +356 -0
- package/quick-nav/types.d.ts +21 -0
- package/quick-nav/types.js +5 -0
- package/radio-group/Radio.d.ts +4 -0
- package/radio-group/Radio.js +156 -0
- package/radio-group/RadioGroup.d.ts +4 -0
- package/radio-group/RadioGroup.js +283 -0
- package/radio-group/RadioGroup.stories.tsx +214 -0
- package/radio-group/RadioGroup.test.js +722 -0
- package/radio-group/types.d.ts +114 -0
- package/radio-group/types.js +5 -0
- package/resultsetTable/Icons.d.ts +7 -0
- package/resultsetTable/Icons.js +51 -0
- package/resultsetTable/ResultsetTable.d.ts +4 -0
- package/resultsetTable/ResultsetTable.js +61 -224
- package/resultsetTable/ResultsetTable.stories.tsx +300 -0
- package/resultsetTable/ResultsetTable.test.js +325 -0
- package/resultsetTable/types.d.ts +67 -0
- package/resultsetTable/types.js +5 -0
- package/select/Icons.d.ts +10 -0
- package/select/Icons.js +93 -0
- package/select/Listbox.d.ts +4 -0
- package/select/Listbox.js +169 -0
- package/select/Option.d.ts +4 -0
- package/select/Option.js +97 -0
- package/select/Select.d.ts +4 -0
- package/select/Select.js +281 -751
- package/select/Select.stories.tsx +971 -0
- package/select/Select.test.js +2228 -0
- package/select/types.d.ts +210 -0
- package/select/types.js +5 -0
- package/sidenav/Icons.d.ts +7 -0
- package/sidenav/Icons.js +51 -0
- package/sidenav/Sidenav.d.ts +10 -0
- package/sidenav/Sidenav.js +155 -94
- package/sidenav/Sidenav.stories.tsx +282 -0
- package/sidenav/Sidenav.test.js +44 -0
- package/sidenav/types.d.ts +76 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.d.ts +4 -0
- package/slider/Slider.js +167 -229
- package/slider/Slider.stories.tsx +240 -0
- package/slider/Slider.test.js +250 -0
- package/slider/types.d.ts +86 -0
- package/slider/types.js +5 -0
- package/spinner/Spinner.d.ts +4 -0
- package/spinner/Spinner.js +57 -194
- package/spinner/Spinner.stories.jsx +129 -0
- package/spinner/Spinner.test.js +64 -0
- package/spinner/types.d.ts +32 -0
- package/spinner/types.js +5 -0
- package/switch/Switch.d.ts +4 -0
- package/switch/Switch.js +163 -123
- package/switch/Switch.stories.tsx +171 -0
- package/switch/Switch.test.js +225 -0
- package/switch/types.d.ts +66 -0
- package/switch/types.js +5 -0
- package/table/Table.d.ts +4 -0
- package/table/Table.js +14 -28
- package/table/Table.stories.jsx +356 -0
- package/table/Table.test.js +26 -0
- package/table/types.d.ts +21 -0
- package/table/types.js +5 -0
- package/tabs/Tab.d.ts +4 -0
- package/tabs/Tab.js +132 -0
- package/tabs/Tabs.d.ts +4 -0
- package/tabs/Tabs.js +351 -233
- package/tabs/Tabs.stories.tsx +226 -0
- package/tabs/Tabs.test.js +350 -0
- package/tabs/types.d.ts +92 -0
- package/tabs/types.js +5 -0
- package/tag/Tag.d.ts +4 -0
- package/tag/Tag.js +47 -148
- package/tag/Tag.stories.tsx +155 -0
- package/tag/Tag.test.js +60 -0
- package/tag/types.d.ts +69 -0
- package/tag/types.js +5 -0
- package/text-input/Icons.d.ts +8 -0
- package/text-input/Icons.js +60 -0
- package/text-input/Suggestion.d.ts +4 -0
- package/text-input/Suggestion.js +84 -0
- package/text-input/Suggestions.d.ts +4 -0
- package/text-input/Suggestions.js +134 -0
- package/text-input/TextInput.d.ts +4 -0
- package/text-input/TextInput.js +262 -579
- package/text-input/TextInput.stories.tsx +569 -0
- package/text-input/TextInput.test.js +1723 -0
- package/text-input/types.d.ts +197 -0
- package/text-input/types.js +5 -0
- package/textarea/Textarea.d.ts +4 -0
- package/textarea/Textarea.js +51 -144
- package/textarea/Textarea.stories.jsx +216 -0
- package/textarea/Textarea.test.js +435 -0
- package/textarea/types.d.ts +137 -0
- package/textarea/types.js +5 -0
- package/toggle-group/ToggleGroup.d.ts +4 -0
- package/toggle-group/ToggleGroup.js +42 -151
- package/toggle-group/ToggleGroup.stories.tsx +215 -0
- package/toggle-group/ToggleGroup.test.js +156 -0
- package/toggle-group/types.d.ts +105 -0
- package/toggle-group/types.js +5 -0
- package/typography/Typography.d.ts +4 -0
- package/typography/Typography.js +32 -0
- package/typography/Typography.stories.tsx +198 -0
- package/typography/types.d.ts +18 -0
- package/typography/types.js +5 -0
- package/useTheme.d.ts +1235 -0
- package/useTheme.js +3 -3
- package/useTranslatedLabels.d.ts +85 -0
- package/useTranslatedLabels.js +20 -0
- package/utils/BaseTypography.d.ts +21 -0
- package/utils/BaseTypography.js +108 -0
- package/utils/FocusLock.d.ts +13 -0
- package/utils/FocusLock.js +139 -0
- package/wizard/Wizard.d.ts +4 -0
- package/wizard/Wizard.js +134 -254
- package/wizard/Wizard.stories.tsx +253 -0
- package/wizard/Wizard.test.js +141 -0
- package/wizard/types.d.ts +64 -0
- package/wizard/types.js +5 -0
- package/ThemeContext.js +0 -250
- package/V3Select/V3Select.js +0 -549
- package/V3Select/index.d.ts +0 -27
- package/V3Textarea/V3Textarea.js +0 -264
- package/V3Textarea/index.d.ts +0 -27
- package/accordion/index.d.ts +0 -28
- package/accordion-group/index.d.ts +0 -16
- package/alert/index.d.ts +0 -51
- package/box/index.d.ts +0 -25
- package/button/Button.stories.js +0 -27
- package/button/index.d.ts +0 -24
- package/card/index.d.ts +0 -22
- package/checkbox/index.d.ts +0 -24
- package/chip/index.d.ts +0 -22
- package/common/RequiredComponent.js +0 -40
- package/date/Date.js +0 -379
- package/date/index.d.ts +0 -27
- package/date-input/index.d.ts +0 -95
- package/dialog/index.d.ts +0 -18
- package/dropdown/index.d.ts +0 -26
- package/file-input/index.d.ts +0 -81
- package/footer/index.d.ts +0 -25
- package/header/index.d.ts +0 -25
- package/heading/index.d.ts +0 -17
- package/input-text/Icons.js +0 -22
- package/input-text/InputText.js +0 -705
- package/input-text/index.d.ts +0 -36
- package/link/index.d.ts +0 -23
- package/number-input/index.d.ts +0 -113
- package/paginator/index.d.ts +0 -20
- package/password-input/index.d.ts +0 -94
- package/progress-bar/index.d.ts +0 -18
- package/radio/Radio.js +0 -209
- package/radio/index.d.ts +0 -23
- package/resultsetTable/index.d.ts +0 -19
- package/select/index.d.ts +0 -131
- package/sidenav/index.d.ts +0 -13
- package/slider/index.d.ts +0 -29
- package/spinner/index.d.ts +0 -17
- package/switch/index.d.ts +0 -24
- package/table/index.d.ts +0 -13
- package/tabs/index.d.ts +0 -19
- package/tag/index.d.ts +0 -24
- package/text-input/index.d.ts +0 -135
- package/textarea/index.d.ts +0 -117
- package/toggle/Toggle.js +0 -220
- package/toggle/index.d.ts +0 -21
- package/toggle-group/index.d.ts +0 -21
- package/upload/Upload.js +0 -205
- package/upload/buttons-upload/ButtonsUpload.js +0 -135
- package/upload/buttons-upload/Icons.js +0 -40
- package/upload/dragAndDropArea/DragAndDropArea.js +0 -329
- package/upload/dragAndDropArea/Icons.js +0 -39
- package/upload/file-upload/FileToUpload.js +0 -189
- package/upload/file-upload/Icons.js +0 -66
- package/upload/files-upload/FilesToUpload.js +0 -123
- package/upload/index.d.ts +0 -15
- package/upload/transaction/Icons.js +0 -160
- package/upload/transaction/Transaction.js +0 -148
- package/upload/transactions/Transactions.js +0 -138
- package/wizard/Icons.js +0 -65
- package/wizard/index.d.ts +0 -18
package/text-input/TextInput.js
CHANGED
|
@@ -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,246 +19,48 @@ 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"));
|
|
27
|
-
|
|
28
|
-
var _variables = require("../common/variables.js");
|
|
29
|
-
|
|
30
|
-
var _utils = require("../common/utils.js");
|
|
31
|
-
|
|
32
|
-
var _uuid = require("uuid");
|
|
33
|
-
|
|
34
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
|
|
35
|
-
|
|
36
|
-
var _NumberInputContext = _interopRequireDefault(require("../number-input/NumberInputContext.js"));
|
|
37
|
-
|
|
38
|
-
function _templateObject18() {
|
|
39
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 0.25rem 1rem;\n align-items: center;\n line-height: 1.715em;\n color: ", ";\n"]);
|
|
40
|
-
|
|
41
|
-
_templateObject18 = function _templateObject18() {
|
|
42
|
-
return data;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
return data;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function _templateObject17() {
|
|
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"]);
|
|
50
|
-
|
|
51
|
-
_templateObject17 = function _templateObject17() {
|
|
52
|
-
return data;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
return data;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function _templateObject16() {
|
|
59
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 0.25rem 1rem;\n color: ", ";\n line-height: 1.715em;\n"]);
|
|
60
|
-
|
|
61
|
-
_templateObject16 = function _templateObject16() {
|
|
62
|
-
return data;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
return data;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function _templateObject15() {
|
|
69
|
-
var data = (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"]);
|
|
70
|
-
|
|
71
|
-
_templateObject15 = function _templateObject15() {
|
|
72
|
-
return data;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
return data;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function _templateObject14() {
|
|
79
|
-
var data = (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"]);
|
|
80
|
-
|
|
81
|
-
_templateObject14 = function _templateObject14() {
|
|
82
|
-
return data;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
return data;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function _templateObject13() {
|
|
89
|
-
var data = (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"]);
|
|
90
|
-
|
|
91
|
-
_templateObject13 = function _templateObject13() {
|
|
92
|
-
return data;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
return data;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function _templateObject12() {
|
|
99
|
-
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"]);
|
|
100
|
-
|
|
101
|
-
_templateObject12 = function _templateObject12() {
|
|
102
|
-
return data;
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
return data;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function _templateObject11() {
|
|
109
|
-
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"]);
|
|
110
|
-
|
|
111
|
-
_templateObject11 = function _templateObject11() {
|
|
112
|
-
return data;
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
return data;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function _templateObject10() {
|
|
119
|
-
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"]);
|
|
120
|
-
|
|
121
|
-
_templateObject10 = function _templateObject10() {
|
|
122
|
-
return data;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
return data;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function _templateObject9() {
|
|
129
|
-
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"]);
|
|
130
|
-
|
|
131
|
-
_templateObject9 = function _templateObject9() {
|
|
132
|
-
return data;
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
return data;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
function _templateObject8() {
|
|
139
|
-
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"]);
|
|
22
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
140
23
|
|
|
141
|
-
|
|
142
|
-
return data;
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
return data;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
function _templateObject7() {
|
|
149
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: 16px;\n height: 16px;\n"]);
|
|
24
|
+
var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
|
|
150
25
|
|
|
151
|
-
|
|
152
|
-
return data;
|
|
153
|
-
};
|
|
26
|
+
var _variables = require("../common/variables");
|
|
154
27
|
|
|
155
|
-
|
|
156
|
-
}
|
|
28
|
+
var _utils = require("../common/utils");
|
|
157
29
|
|
|
158
|
-
|
|
159
|
-
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"]);
|
|
30
|
+
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
160
31
|
|
|
161
|
-
|
|
162
|
-
return data;
|
|
163
|
-
};
|
|
32
|
+
var _NumberInputContext = _interopRequireDefault(require("../number-input/NumberInputContext"));
|
|
164
33
|
|
|
165
|
-
|
|
166
|
-
}
|
|
34
|
+
var _Suggestions = _interopRequireDefault(require("./Suggestions"));
|
|
167
35
|
|
|
168
|
-
|
|
169
|
-
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"]);
|
|
36
|
+
var Popover = _interopRequireWildcard(require("@radix-ui/react-popover"));
|
|
170
37
|
|
|
171
|
-
|
|
172
|
-
return data;
|
|
173
|
-
};
|
|
38
|
+
var _Icons = _interopRequireDefault(require("./Icons"));
|
|
174
39
|
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
function _templateObject4() {
|
|
179
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"]);
|
|
180
|
-
|
|
181
|
-
_templateObject4 = function _templateObject4() {
|
|
182
|
-
return data;
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
return data;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
function _templateObject3() {
|
|
189
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-weight: ", ";\n"]);
|
|
190
|
-
|
|
191
|
-
_templateObject3 = function _templateObject3() {
|
|
192
|
-
return data;
|
|
193
|
-
};
|
|
40
|
+
var _uuid = require("uuid");
|
|
194
41
|
|
|
195
|
-
|
|
196
|
-
}
|
|
42
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
197
43
|
|
|
198
|
-
function
|
|
199
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"]);
|
|
44
|
+
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); }
|
|
200
45
|
|
|
201
|
-
|
|
202
|
-
return data;
|
|
203
|
-
};
|
|
46
|
+
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; }
|
|
204
47
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
48
|
+
var sizes = {
|
|
49
|
+
small: "240px",
|
|
50
|
+
medium: "360px",
|
|
51
|
+
large: "480px",
|
|
52
|
+
fillParent: "100%"
|
|
53
|
+
};
|
|
210
54
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
55
|
+
var AutosuggestWrapper = function AutosuggestWrapper(_ref) {
|
|
56
|
+
var condition = _ref.condition,
|
|
57
|
+
wrapper = _ref.wrapper,
|
|
58
|
+
children = _ref.children;
|
|
59
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, condition ? wrapper(children) : children);
|
|
60
|
+
};
|
|
214
61
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
var textInputIcons = {
|
|
219
|
-
error: _react["default"].createElement("svg", {
|
|
220
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
221
|
-
height: "24px",
|
|
222
|
-
viewBox: "0 0 24 24",
|
|
223
|
-
width: "24px",
|
|
224
|
-
fill: "currentColor"
|
|
225
|
-
}, _react["default"].createElement("path", {
|
|
226
|
-
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"
|
|
227
|
-
})),
|
|
228
|
-
clear: _react["default"].createElement("svg", {
|
|
229
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
230
|
-
width: "24",
|
|
231
|
-
height: "24",
|
|
232
|
-
viewBox: "0 0 24 24",
|
|
233
|
-
fill: "currentColor"
|
|
234
|
-
}, _react["default"].createElement("path", {
|
|
235
|
-
d: "M0 0h24v24H0V0z",
|
|
236
|
-
fill: "none"
|
|
237
|
-
}), _react["default"].createElement("path", {
|
|
238
|
-
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"
|
|
239
|
-
})),
|
|
240
|
-
increment: _react["default"].createElement("svg", {
|
|
241
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
242
|
-
height: "24px",
|
|
243
|
-
viewBox: "0 0 24 24",
|
|
244
|
-
width: "24px",
|
|
245
|
-
fill: "currentColor"
|
|
246
|
-
}, _react["default"].createElement("path", {
|
|
247
|
-
d: "M0 0h24v24H0z",
|
|
248
|
-
fill: "none"
|
|
249
|
-
}), _react["default"].createElement("path", {
|
|
250
|
-
d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
|
|
251
|
-
})),
|
|
252
|
-
decrement: _react["default"].createElement("svg", {
|
|
253
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
254
|
-
height: "24px",
|
|
255
|
-
viewBox: "0 0 24 24",
|
|
256
|
-
width: "24px",
|
|
257
|
-
fill: "currentColor"
|
|
258
|
-
}, _react["default"].createElement("path", {
|
|
259
|
-
d: "M0 0h24v24H0z",
|
|
260
|
-
fill: "none"
|
|
261
|
-
}), _react["default"].createElement("path", {
|
|
262
|
-
d: "M19 13H5v-2h14v2z"
|
|
263
|
-
}))
|
|
62
|
+
var calculateWidth = function calculateWidth(margin, size) {
|
|
63
|
+
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
264
64
|
};
|
|
265
65
|
|
|
266
66
|
var makeCancelable = function makeCancelable(promise) {
|
|
@@ -284,65 +84,70 @@ var makeCancelable = function makeCancelable(promise) {
|
|
|
284
84
|
};
|
|
285
85
|
};
|
|
286
86
|
|
|
287
|
-
var
|
|
288
|
-
return "
|
|
87
|
+
var hasSuggestions = function hasSuggestions(suggestions) {
|
|
88
|
+
return typeof suggestions === "function" || (suggestions === null || suggestions === void 0 ? void 0 : suggestions.length) > 0;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
var isNotOptional = function isNotOptional(value, optional) {
|
|
92
|
+
return value === "" && !optional;
|
|
289
93
|
};
|
|
290
94
|
|
|
291
|
-
var
|
|
292
|
-
return
|
|
95
|
+
var isLengthIncorrect = function isLengthIncorrect(value, minLength, maxLength) {
|
|
96
|
+
return value && minLength && maxLength && (value.length < minLength || value.length > maxLength);
|
|
293
97
|
};
|
|
294
98
|
|
|
295
|
-
var
|
|
296
|
-
return
|
|
99
|
+
var isNumberIncorrect = function isNumberIncorrect(value, minNumber, maxNumber) {
|
|
100
|
+
return minNumber && parseInt(value) < minNumber || maxNumber && parseInt(value) > maxNumber;
|
|
297
101
|
};
|
|
298
102
|
|
|
299
|
-
var
|
|
300
|
-
return new RegExp(pattern).test(value);
|
|
103
|
+
var patternMissmatch = function patternMissmatch(pattern, value) {
|
|
104
|
+
return pattern && !new RegExp(pattern).test(value);
|
|
301
105
|
};
|
|
302
106
|
|
|
303
|
-
var DxcTextInput = _react["default"].forwardRef(function (
|
|
304
|
-
var
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
_ref$tabIndex = _ref.tabIndex,
|
|
339
|
-
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
107
|
+
var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, ref) {
|
|
108
|
+
var label = _ref2.label,
|
|
109
|
+
_ref2$name = _ref2.name,
|
|
110
|
+
name = _ref2$name === void 0 ? "" : _ref2$name,
|
|
111
|
+
_ref2$defaultValue = _ref2.defaultValue,
|
|
112
|
+
defaultValue = _ref2$defaultValue === void 0 ? "" : _ref2$defaultValue,
|
|
113
|
+
value = _ref2.value,
|
|
114
|
+
helperText = _ref2.helperText,
|
|
115
|
+
_ref2$placeholder = _ref2.placeholder,
|
|
116
|
+
placeholder = _ref2$placeholder === void 0 ? "" : _ref2$placeholder,
|
|
117
|
+
action = _ref2.action,
|
|
118
|
+
_ref2$clearable = _ref2.clearable,
|
|
119
|
+
clearable = _ref2$clearable === void 0 ? false : _ref2$clearable,
|
|
120
|
+
_ref2$disabled = _ref2.disabled,
|
|
121
|
+
disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
|
|
122
|
+
_ref2$optional = _ref2.optional,
|
|
123
|
+
optional = _ref2$optional === void 0 ? false : _ref2$optional,
|
|
124
|
+
_ref2$prefix = _ref2.prefix,
|
|
125
|
+
prefix = _ref2$prefix === void 0 ? "" : _ref2$prefix,
|
|
126
|
+
_ref2$suffix = _ref2.suffix,
|
|
127
|
+
suffix = _ref2$suffix === void 0 ? "" : _ref2$suffix,
|
|
128
|
+
onChange = _ref2.onChange,
|
|
129
|
+
onBlur = _ref2.onBlur,
|
|
130
|
+
error = _ref2.error,
|
|
131
|
+
suggestions = _ref2.suggestions,
|
|
132
|
+
pattern = _ref2.pattern,
|
|
133
|
+
minLength = _ref2.minLength,
|
|
134
|
+
maxLength = _ref2.maxLength,
|
|
135
|
+
_ref2$autocomplete = _ref2.autocomplete,
|
|
136
|
+
autocomplete = _ref2$autocomplete === void 0 ? "off" : _ref2$autocomplete,
|
|
137
|
+
margin = _ref2.margin,
|
|
138
|
+
_ref2$size = _ref2.size,
|
|
139
|
+
size = _ref2$size === void 0 ? "medium" : _ref2$size,
|
|
140
|
+
_ref2$tabIndex = _ref2.tabIndex,
|
|
141
|
+
tabIndex = _ref2$tabIndex === void 0 ? 0 : _ref2$tabIndex;
|
|
340
142
|
|
|
341
143
|
var _useState = (0, _react.useState)("input-".concat((0, _uuid.v4)())),
|
|
342
144
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 1),
|
|
343
145
|
inputId = _useState2[0];
|
|
344
146
|
|
|
345
|
-
var
|
|
147
|
+
var autosuggestId = "suggestions-".concat(inputId);
|
|
148
|
+
var errorId = "error-".concat(inputId);
|
|
149
|
+
|
|
150
|
+
var _useState3 = (0, _react.useState)(defaultValue),
|
|
346
151
|
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
347
152
|
innerValue = _useState4[0],
|
|
348
153
|
setInnerValue = _useState4[1];
|
|
@@ -369,71 +174,55 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
369
174
|
|
|
370
175
|
var _useState13 = (0, _react.useState)(-1),
|
|
371
176
|
_useState14 = (0, _slicedToArray2["default"])(_useState13, 2),
|
|
372
|
-
|
|
373
|
-
|
|
177
|
+
visualFocusIndex = _useState14[0],
|
|
178
|
+
changeVisualFocusIndex = _useState14[1];
|
|
374
179
|
|
|
375
|
-
var suggestionsRef = (0, _react.useRef)(null);
|
|
376
180
|
var inputRef = (0, _react.useRef)(null);
|
|
377
181
|
var actionRef = (0, _react.useRef)(null);
|
|
378
182
|
var colorsTheme = (0, _useTheme["default"])();
|
|
183
|
+
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
379
184
|
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
380
|
-
var autosuggestId = "".concat(inputId, "-listBox");
|
|
381
|
-
var errorId = "error-message-".concat(inputId);
|
|
382
185
|
var numberInputContext = (0, _react.useContext)(_NumberInputContext["default"]);
|
|
383
186
|
|
|
384
|
-
var isNotOptional = function isNotOptional(value) {
|
|
385
|
-
return value === "" && !optional;
|
|
386
|
-
};
|
|
387
|
-
|
|
388
|
-
var isLengthIncorrect = function isLengthIncorrect(value) {
|
|
389
|
-
return value !== "" && length && length.min && length.max && (value.length < length.min || value.length > length.max);
|
|
390
|
-
};
|
|
391
|
-
|
|
392
|
-
var isNumberIncorrect = function isNumberIncorrect(value) {
|
|
393
|
-
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);
|
|
394
|
-
};
|
|
395
|
-
|
|
396
|
-
var isTextInputType = function isTextInputType() {
|
|
397
|
-
var _inputRef$current, _inputRef$current2;
|
|
398
|
-
|
|
399
|
-
return !(inputRef !== null && inputRef !== void 0 && (_inputRef$current = inputRef.current) !== null && _inputRef$current !== void 0 && _inputRef$current.getAttribute("type")) || (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.getAttribute("type")) === "text";
|
|
400
|
-
};
|
|
401
|
-
|
|
402
187
|
var getNumberErrorMessage = function getNumberErrorMessage(value) {
|
|
403
|
-
if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && parseInt(value) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) return
|
|
188
|
+
if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && parseInt(value) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) return translatedLabels.numberInput.valueGreaterThanOrEqualToErrorMessage(numberInputContext.minNumber);else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.maxNumber && parseInt(value) > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) return translatedLabels.numberInput.valueLessThanOrEqualToErrorMessage(numberInputContext.maxNumber);
|
|
404
189
|
};
|
|
405
190
|
|
|
406
|
-
var
|
|
407
|
-
|
|
408
|
-
|
|
191
|
+
var getTextInputWidth = (0, _react.useCallback)(function () {
|
|
192
|
+
var _inputRef$current, _inputRef$current$par;
|
|
193
|
+
|
|
194
|
+
var rect = inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : (_inputRef$current$par = _inputRef$current.parentElement) === null || _inputRef$current$par === void 0 ? void 0 : _inputRef$current$par.getBoundingClientRect();
|
|
195
|
+
return rect === null || rect === void 0 ? void 0 : rect.width;
|
|
196
|
+
}, []);
|
|
409
197
|
|
|
410
198
|
var openSuggestions = function openSuggestions() {
|
|
411
|
-
|
|
199
|
+
hasSuggestions(suggestions) && changeIsOpen(true);
|
|
412
200
|
};
|
|
413
201
|
|
|
414
202
|
var closeSuggestions = function closeSuggestions() {
|
|
415
|
-
|
|
416
|
-
|
|
203
|
+
if (hasSuggestions(suggestions)) {
|
|
204
|
+
changeIsOpen(false);
|
|
205
|
+
changeVisualFocusIndex(-1);
|
|
206
|
+
}
|
|
417
207
|
};
|
|
418
208
|
|
|
419
209
|
var changeValue = function changeValue(newValue) {
|
|
420
210
|
value !== null && value !== void 0 ? value : setInnerValue(newValue);
|
|
421
211
|
var changedValue = typeof newValue === "number" ? newValue.toString() : newValue;
|
|
422
|
-
if (isNotOptional(newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
212
|
+
if (isNotOptional(newValue, optional)) onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
423
213
|
value: changedValue,
|
|
424
|
-
error:
|
|
425
|
-
});else if (isLengthIncorrect(newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
214
|
+
error: translatedLabels.formFields.requiredValueErrorMessage
|
|
215
|
+
});else if (isLengthIncorrect(newValue, minLength, maxLength)) onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
426
216
|
value: changedValue,
|
|
427
|
-
error:
|
|
428
|
-
});else if (
|
|
217
|
+
error: translatedLabels.formFields.lengthErrorMessage(minLength, maxLength)
|
|
218
|
+
});else if (patternMissmatch(pattern, newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
429
219
|
value: changedValue,
|
|
430
|
-
error:
|
|
431
|
-
});else if (newValue
|
|
220
|
+
error: translatedLabels.formFields.formatRequestedErrorMessage
|
|
221
|
+
});else if (isNumberIncorrect(newValue, numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber, numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
432
222
|
value: changedValue,
|
|
433
223
|
error: getNumberErrorMessage(newValue)
|
|
434
224
|
});else onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
435
|
-
value: changedValue
|
|
436
|
-
error: null
|
|
225
|
+
value: changedValue
|
|
437
226
|
});
|
|
438
227
|
};
|
|
439
228
|
|
|
@@ -441,52 +230,48 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
441
230
|
document.activeElement !== actionRef.current && inputRef.current.focus();
|
|
442
231
|
};
|
|
443
232
|
|
|
444
|
-
var
|
|
445
|
-
|
|
446
|
-
|
|
233
|
+
var handleInputContainerOnMouseDown = function handleInputContainerOnMouseDown(event) {
|
|
234
|
+
// Avoid input to lose the focus when the container is pressed
|
|
235
|
+
document.activeElement === inputRef.current && event.preventDefault();
|
|
447
236
|
};
|
|
448
237
|
|
|
449
|
-
var
|
|
238
|
+
var handleInputOnChange = function handleInputOnChange(event) {
|
|
450
239
|
openSuggestions();
|
|
240
|
+
changeValue(event.target.value);
|
|
451
241
|
};
|
|
452
242
|
|
|
453
|
-
var
|
|
454
|
-
|
|
455
|
-
if (isNotOptional(event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
243
|
+
var handleInputOnBlur = function handleInputOnBlur(event) {
|
|
244
|
+
closeSuggestions();
|
|
245
|
+
if (isNotOptional(event.target.value, optional)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
456
246
|
value: event.target.value,
|
|
457
|
-
error:
|
|
458
|
-
});else if (isLengthIncorrect(event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
247
|
+
error: translatedLabels.formFields.requiredValueErrorMessage
|
|
248
|
+
});else if (isLengthIncorrect(event.target.value, minLength, maxLength)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
459
249
|
value: event.target.value,
|
|
460
|
-
error:
|
|
461
|
-
});else if (
|
|
250
|
+
error: translatedLabels.formFields.lengthErrorMessage(minLength, maxLength)
|
|
251
|
+
});else if (patternMissmatch(pattern, event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
462
252
|
value: event.target.value,
|
|
463
|
-
error:
|
|
464
|
-
});else if (event.target.value
|
|
253
|
+
error: translatedLabels.formFields.formatRequestedErrorMessage
|
|
254
|
+
});else if (isNumberIncorrect(event.target.value, numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber, numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
465
255
|
value: event.target.value,
|
|
466
256
|
error: getNumberErrorMessage(event.target.value)
|
|
467
257
|
});else onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
468
|
-
value: event.target.value
|
|
469
|
-
error: null
|
|
258
|
+
value: event.target.value
|
|
470
259
|
});
|
|
471
260
|
};
|
|
472
261
|
|
|
473
|
-
var
|
|
474
|
-
|
|
475
|
-
|
|
262
|
+
var handleInputOnKeyDown = function handleInputOnKeyDown(event) {
|
|
263
|
+
switch (event.key) {
|
|
264
|
+
case "Down":
|
|
265
|
+
case "ArrowDown":
|
|
266
|
+
event.preventDefault();
|
|
476
267
|
|
|
477
|
-
|
|
478
|
-
switch (event.keyCode) {
|
|
479
|
-
case 40:
|
|
480
|
-
// Arrow Down
|
|
481
|
-
if (numberInputContext) {
|
|
268
|
+
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number") {
|
|
482
269
|
decrementNumber();
|
|
483
|
-
event.preventDefault();
|
|
484
270
|
} else {
|
|
485
|
-
event.preventDefault();
|
|
486
271
|
openSuggestions();
|
|
487
272
|
|
|
488
273
|
if (!isAutosuggestError && !isSearching && filteredSuggestions.length > 0) {
|
|
489
|
-
|
|
274
|
+
changeVisualFocusIndex(function (visualFocusedSuggIndex) {
|
|
490
275
|
if (visualFocusedSuggIndex < filteredSuggestions.length - 1) return visualFocusedSuggIndex + 1;else if (visualFocusedSuggIndex === filteredSuggestions.length - 1) return 0;
|
|
491
276
|
});
|
|
492
277
|
}
|
|
@@ -494,17 +279,17 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
494
279
|
|
|
495
280
|
break;
|
|
496
281
|
|
|
497
|
-
case
|
|
498
|
-
|
|
499
|
-
|
|
282
|
+
case "Up":
|
|
283
|
+
case "ArrowUp":
|
|
284
|
+
event.preventDefault();
|
|
285
|
+
|
|
286
|
+
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number") {
|
|
500
287
|
incrementNumber();
|
|
501
|
-
event.preventDefault();
|
|
502
288
|
} else {
|
|
503
|
-
event.preventDefault();
|
|
504
289
|
openSuggestions();
|
|
505
290
|
|
|
506
291
|
if (!isAutosuggestError && !isSearching && filteredSuggestions.length > 0) {
|
|
507
|
-
|
|
292
|
+
changeVisualFocusIndex(function (visualFocusedSuggIndex) {
|
|
508
293
|
if (visualFocusedSuggIndex === 0 || visualFocusedSuggIndex === -1) return filteredSuggestions.length > 0 ? filteredSuggestions.length - 1 : suggestions.length - 1;else return visualFocusedSuggIndex - 1;
|
|
509
294
|
});
|
|
510
295
|
}
|
|
@@ -512,22 +297,21 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
512
297
|
|
|
513
298
|
break;
|
|
514
299
|
|
|
515
|
-
case
|
|
516
|
-
|
|
300
|
+
case "Esc":
|
|
301
|
+
case "Escape":
|
|
517
302
|
event.preventDefault();
|
|
518
303
|
|
|
519
|
-
if (hasSuggestions()) {
|
|
304
|
+
if (hasSuggestions(suggestions)) {
|
|
520
305
|
changeValue("");
|
|
521
306
|
isOpen && closeSuggestions();
|
|
522
307
|
}
|
|
523
308
|
|
|
524
309
|
break;
|
|
525
310
|
|
|
526
|
-
case
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
validFocusedSuggestion && changeValue(filteredSuggestions[visualFocusedSuggIndex]);
|
|
311
|
+
case "Enter":
|
|
312
|
+
if (hasSuggestions(suggestions) && !isSearching) {
|
|
313
|
+
var validFocusedSuggestion = filteredSuggestions.length > 0 && visualFocusIndex >= 0 && visualFocusIndex < filteredSuggestions.length;
|
|
314
|
+
validFocusedSuggestion && changeValue(filteredSuggestions[visualFocusIndex]);
|
|
531
315
|
isOpen && closeSuggestions();
|
|
532
316
|
}
|
|
533
317
|
|
|
@@ -552,12 +336,12 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
552
336
|
};
|
|
553
337
|
|
|
554
338
|
var setNumberProps = function setNumberProps(type, min, max, step) {
|
|
555
|
-
var _inputRef$
|
|
339
|
+
var _inputRef$current2, _inputRef$current3, _inputRef$current4, _inputRef$current5;
|
|
556
340
|
|
|
557
|
-
type && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$
|
|
558
|
-
min && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$
|
|
559
|
-
max && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$
|
|
560
|
-
step && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$
|
|
341
|
+
type && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.setAttribute("type", type));
|
|
342
|
+
min && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.setAttribute("min", min));
|
|
343
|
+
max && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.setAttribute("max", max));
|
|
344
|
+
step && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current5 = inputRef.current) === null || _inputRef$current5 === void 0 ? void 0 : _inputRef$current5.setAttribute("step", step));
|
|
561
345
|
};
|
|
562
346
|
|
|
563
347
|
var decrementNumber = function decrementNumber() {
|
|
@@ -600,15 +384,6 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
600
384
|
}
|
|
601
385
|
};
|
|
602
386
|
|
|
603
|
-
(0, _react.useLayoutEffect)(function () {
|
|
604
|
-
var _suggestionsRef$curre, _visualFocusedOptionE;
|
|
605
|
-
|
|
606
|
-
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];
|
|
607
|
-
visualFocusedOptionEl === null || visualFocusedOptionEl === void 0 ? void 0 : (_visualFocusedOptionE = visualFocusedOptionEl.scrollIntoView) === null || _visualFocusedOptionE === void 0 ? void 0 : _visualFocusedOptionE.call(visualFocusedOptionEl, {
|
|
608
|
-
block: "nearest",
|
|
609
|
-
inline: "start"
|
|
610
|
-
});
|
|
611
|
-
}, [visualFocusedSuggIndex]);
|
|
612
387
|
(0, _react.useEffect)(function () {
|
|
613
388
|
if (typeof suggestions === "function") {
|
|
614
389
|
changeIsSearching(true);
|
|
@@ -632,173 +407,159 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
632
407
|
changeFilteredSuggestions(suggestions.filter(function (suggestion) {
|
|
633
408
|
return suggestion.toUpperCase().startsWith((value !== null && value !== void 0 ? value : innerValue).toUpperCase());
|
|
634
409
|
}));
|
|
635
|
-
|
|
410
|
+
changeVisualFocusIndex(-1);
|
|
636
411
|
}
|
|
637
412
|
|
|
638
|
-
numberInputContext && setNumberProps(numberInputContext.typeNumber, numberInputContext.minNumber, numberInputContext.maxNumber, numberInputContext.stepNumber);
|
|
639
|
-
}, [value, innerValue, suggestions]);
|
|
640
|
-
|
|
641
|
-
if (filteredSuggestions.length === 0 && !isSearching && !isAutosuggestError) closeSuggestions();
|
|
642
|
-
}, [filteredSuggestions]);
|
|
643
|
-
|
|
644
|
-
var getLastOptionIndex = function getLastOptionIndex() {
|
|
645
|
-
var last = 0;
|
|
646
|
-
|
|
647
|
-
var reducer = function reducer(acc, current) {
|
|
648
|
-
var _current$options;
|
|
649
|
-
|
|
650
|
-
return acc + ((_current$options = current.options) === null || _current$options === void 0 ? void 0 : _current$options.length);
|
|
651
|
-
};
|
|
652
|
-
|
|
653
|
-
if (filteredSuggestions.length > 0) filteredSuggestions[0].options ? last = filteredSuggestions.reduce(reducer, 0) - 1 : last = filteredSuggestions.length - 1;
|
|
654
|
-
return last;
|
|
655
|
-
};
|
|
656
|
-
|
|
657
|
-
var lastOptionIndex = (0, _react.useMemo)(function () {
|
|
658
|
-
return getLastOptionIndex();
|
|
659
|
-
}, [filteredSuggestions]);
|
|
660
|
-
|
|
661
|
-
var HighlightedSuggestion = function HighlightedSuggestion(_ref2) {
|
|
662
|
-
var suggestion = _ref2.suggestion,
|
|
663
|
-
index = _ref2.index;
|
|
664
|
-
var regEx = new RegExp(value !== null && value !== void 0 ? value : innerValue, "i");
|
|
665
|
-
var matchedWords = suggestion.match(regEx);
|
|
666
|
-
var noMatchedWords = suggestion.replace(regEx, "");
|
|
667
|
-
var isLastOption = index === lastOptionIndex;
|
|
668
|
-
return _react["default"].createElement(Suggestion, {
|
|
669
|
-
id: "suggestion-".concat(index),
|
|
670
|
-
onClick: function onClick() {
|
|
671
|
-
changeValue(suggestion);
|
|
672
|
-
closeSuggestions();
|
|
673
|
-
},
|
|
674
|
-
role: "option",
|
|
675
|
-
"aria-selected": visualFocusedSuggIndex === index && "true",
|
|
676
|
-
visualFocused: visualFocusedSuggIndex === index
|
|
677
|
-
}, _react["default"].createElement(StyledSuggestion, {
|
|
678
|
-
last: isLastOption,
|
|
679
|
-
visualFocused: visualFocusedSuggIndex === index
|
|
680
|
-
}, typeof suggestions === "function" ? suggestion : _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement("strong", null, matchedWords), noMatchedWords)));
|
|
681
|
-
};
|
|
682
|
-
|
|
683
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
413
|
+
(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" && setNumberProps(numberInputContext.typeNumber, numberInputContext.minNumber, numberInputContext.maxNumber, numberInputContext.stepNumber);
|
|
414
|
+
}, [value, innerValue, suggestions, numberInputContext]);
|
|
415
|
+
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
684
416
|
theme: colorsTheme.textInput
|
|
685
|
-
}, _react["default"].createElement(
|
|
417
|
+
}, /*#__PURE__*/_react["default"].createElement(TextInputContainer, {
|
|
686
418
|
margin: margin,
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
}, _react["default"].createElement(Label, {
|
|
419
|
+
size: size,
|
|
420
|
+
ref: ref
|
|
421
|
+
}, label && /*#__PURE__*/_react["default"].createElement(Label, {
|
|
690
422
|
htmlFor: inputId,
|
|
691
423
|
disabled: disabled,
|
|
692
|
-
backgroundType: backgroundType
|
|
693
|
-
|
|
424
|
+
backgroundType: backgroundType,
|
|
425
|
+
hasHelperText: helperText ? true : false
|
|
426
|
+
}, label, " ", optional && /*#__PURE__*/_react["default"].createElement(OptionalLabel, null, translatedLabels.formFields.optionalLabel)), helperText && /*#__PURE__*/_react["default"].createElement(HelperText, {
|
|
694
427
|
disabled: disabled,
|
|
695
428
|
backgroundType: backgroundType
|
|
696
|
-
}, helperText), _react["default"].createElement(InputContainer, {
|
|
697
|
-
error: error,
|
|
429
|
+
}, helperText), /*#__PURE__*/_react["default"].createElement(InputContainer, {
|
|
430
|
+
error: error ? true : false,
|
|
698
431
|
disabled: disabled,
|
|
699
432
|
backgroundType: backgroundType,
|
|
700
|
-
onClick: handleInputContainerOnClick
|
|
701
|
-
|
|
433
|
+
onClick: handleInputContainerOnClick,
|
|
434
|
+
onMouseDown: handleInputContainerOnMouseDown
|
|
435
|
+
}, prefix && /*#__PURE__*/_react["default"].createElement(Prefix, {
|
|
702
436
|
disabled: disabled,
|
|
703
437
|
backgroundType: backgroundType
|
|
704
|
-
}, prefix), _react["default"].createElement(
|
|
438
|
+
}, prefix), /*#__PURE__*/_react["default"].createElement(AutosuggestWrapper, {
|
|
439
|
+
condition: hasSuggestions(suggestions),
|
|
440
|
+
wrapper: function wrapper(children) {
|
|
441
|
+
return /*#__PURE__*/_react["default"].createElement(Popover.Root, {
|
|
442
|
+
open: isOpen && (filteredSuggestions.length > 0 || isSearching || isAutosuggestError)
|
|
443
|
+
}, /*#__PURE__*/_react["default"].createElement(Popover.Trigger, {
|
|
444
|
+
asChild: true,
|
|
445
|
+
"aria-controls": undefined
|
|
446
|
+
}, children), /*#__PURE__*/_react["default"].createElement(Popover.Content, {
|
|
447
|
+
sideOffset: 5,
|
|
448
|
+
onOpenAutoFocus: function onOpenAutoFocus(event) {
|
|
449
|
+
// Avoid select to lose focus when the list is opened
|
|
450
|
+
event.preventDefault();
|
|
451
|
+
},
|
|
452
|
+
onCloseAutoFocus: function onCloseAutoFocus(event) {
|
|
453
|
+
// Avoid select to lose focus when the list is closed
|
|
454
|
+
event.preventDefault();
|
|
455
|
+
}
|
|
456
|
+
}, /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], {
|
|
457
|
+
id: autosuggestId,
|
|
458
|
+
value: value !== null && value !== void 0 ? value : innerValue,
|
|
459
|
+
suggestions: filteredSuggestions,
|
|
460
|
+
visualFocusIndex: visualFocusIndex,
|
|
461
|
+
highlightedSuggestions: typeof suggestions !== "function",
|
|
462
|
+
searchHasErrors: isAutosuggestError,
|
|
463
|
+
isSearching: isSearching,
|
|
464
|
+
suggestionOnClick: function suggestionOnClick(suggestion) {
|
|
465
|
+
changeValue(suggestion);
|
|
466
|
+
closeSuggestions();
|
|
467
|
+
},
|
|
468
|
+
getTextInputWidth: getTextInputWidth
|
|
469
|
+
})));
|
|
470
|
+
}
|
|
471
|
+
}, /*#__PURE__*/_react["default"].createElement(Input, {
|
|
705
472
|
id: inputId,
|
|
706
473
|
name: name,
|
|
707
474
|
value: value !== null && value !== void 0 ? value : innerValue,
|
|
708
475
|
placeholder: placeholder,
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
476
|
+
onBlur: handleInputOnBlur,
|
|
477
|
+
onChange: handleInputOnChange,
|
|
478
|
+
onFocus: openSuggestions,
|
|
479
|
+
onKeyDown: handleInputOnKeyDown,
|
|
480
|
+
onMouseDown: function onMouseDown(event) {
|
|
481
|
+
event.stopPropagation();
|
|
482
|
+
},
|
|
714
483
|
disabled: disabled,
|
|
715
484
|
ref: inputRef,
|
|
716
485
|
backgroundType: backgroundType,
|
|
717
486
|
pattern: pattern,
|
|
718
|
-
minLength:
|
|
719
|
-
maxLength:
|
|
720
|
-
autoComplete: autocomplete,
|
|
487
|
+
minLength: minLength,
|
|
488
|
+
maxLength: maxLength,
|
|
489
|
+
autoComplete: autocomplete === "off" ? "nope" : autocomplete,
|
|
721
490
|
tabIndex: tabIndex,
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
"aria-
|
|
725
|
-
"aria-
|
|
726
|
-
"aria-
|
|
727
|
-
"aria-
|
|
728
|
-
"aria-
|
|
729
|
-
"aria-
|
|
730
|
-
|
|
491
|
+
type: "text",
|
|
492
|
+
role: hasSuggestions(suggestions) ? "combobox" : undefined,
|
|
493
|
+
"aria-autocomplete": hasSuggestions(suggestions) ? "list" : undefined,
|
|
494
|
+
"aria-controls": hasSuggestions(suggestions) ? autosuggestId : undefined,
|
|
495
|
+
"aria-expanded": hasSuggestions(suggestions) ? isOpen : undefined,
|
|
496
|
+
"aria-haspopup": hasSuggestions(suggestions) ? "listbox" : undefined,
|
|
497
|
+
"aria-activedescendant": hasSuggestions(suggestions) && isOpen && visualFocusIndex !== -1 ? "suggestion-".concat(visualFocusIndex) : undefined,
|
|
498
|
+
"aria-invalid": error ? true : false,
|
|
499
|
+
"aria-errormessage": error ? errorId : undefined,
|
|
500
|
+
"aria-required": optional ? false : true
|
|
501
|
+
})), !disabled && error && /*#__PURE__*/_react["default"].createElement(ErrorIcon, {
|
|
731
502
|
backgroundType: backgroundType,
|
|
732
503
|
"aria-label": "Error"
|
|
733
|
-
},
|
|
504
|
+
}, _Icons["default"].error), !disabled && clearable && (value !== null && value !== void 0 ? value : innerValue).length > 0 && /*#__PURE__*/_react["default"].createElement(Action, {
|
|
734
505
|
onClick: handleClearActionOnClick,
|
|
506
|
+
onMouseDown: function onMouseDown(event) {
|
|
507
|
+
event.stopPropagation();
|
|
508
|
+
},
|
|
735
509
|
backgroundType: backgroundType,
|
|
736
510
|
tabIndex: tabIndex,
|
|
737
|
-
|
|
738
|
-
|
|
511
|
+
title: translatedLabels.textInput.clearFieldActionTitle,
|
|
512
|
+
"aria-label": translatedLabels.textInput.clearFieldActionTitle,
|
|
513
|
+
type: "button"
|
|
514
|
+
}, _Icons["default"].clear), (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(Action, {
|
|
739
515
|
ref: actionRef,
|
|
740
516
|
disabled: disabled,
|
|
741
517
|
onClick: handleDecrementActionOnClick,
|
|
518
|
+
onMouseDown: function onMouseDown(event) {
|
|
519
|
+
event.stopPropagation();
|
|
520
|
+
},
|
|
742
521
|
backgroundType: backgroundType,
|
|
743
522
|
tabIndex: tabIndex,
|
|
744
|
-
|
|
745
|
-
|
|
523
|
+
title: translatedLabels.numberInput.decrementValueTitle,
|
|
524
|
+
"aria-label": translatedLabels.numberInput.decrementValueTitle,
|
|
525
|
+
type: "button"
|
|
526
|
+
}, _Icons["default"].decrement), /*#__PURE__*/_react["default"].createElement(Action, {
|
|
746
527
|
ref: actionRef,
|
|
747
528
|
disabled: disabled,
|
|
748
529
|
onClick: handleIncrementActionOnClick,
|
|
530
|
+
onMouseDown: function onMouseDown(event) {
|
|
531
|
+
event.stopPropagation();
|
|
532
|
+
},
|
|
749
533
|
backgroundType: backgroundType,
|
|
750
534
|
tabIndex: tabIndex,
|
|
751
|
-
|
|
752
|
-
|
|
535
|
+
title: translatedLabels.numberInput.incrementValueTitle,
|
|
536
|
+
"aria-label": translatedLabels.numberInput.incrementValueTitle,
|
|
537
|
+
type: "button"
|
|
538
|
+
}, _Icons["default"].increment)), action && /*#__PURE__*/_react["default"].createElement(Action, {
|
|
753
539
|
ref: actionRef,
|
|
754
540
|
disabled: disabled,
|
|
755
541
|
onClick: action.onClick,
|
|
756
|
-
|
|
542
|
+
onMouseDown: function onMouseDown(event) {
|
|
543
|
+
event.stopPropagation();
|
|
544
|
+
},
|
|
545
|
+
title: action.title,
|
|
546
|
+
"aria-label": action.title,
|
|
757
547
|
backgroundType: backgroundType,
|
|
758
|
-
tabIndex: tabIndex
|
|
759
|
-
|
|
548
|
+
tabIndex: tabIndex,
|
|
549
|
+
type: "button"
|
|
550
|
+
}, typeof action.icon === "string" ? /*#__PURE__*/_react["default"].createElement("img", {
|
|
760
551
|
src: action.icon
|
|
761
|
-
}) : action.icon), suffix && _react["default"].createElement(Suffix, {
|
|
552
|
+
}) : action.icon), suffix && /*#__PURE__*/_react["default"].createElement(Suffix, {
|
|
762
553
|
disabled: disabled,
|
|
763
554
|
backgroundType: backgroundType
|
|
764
|
-
}, suffix),
|
|
765
|
-
id: autosuggestId,
|
|
766
|
-
isError: isAutosuggestError,
|
|
767
|
-
onMouseDown: function onMouseDown(event) {
|
|
768
|
-
event.preventDefault();
|
|
769
|
-
},
|
|
770
|
-
onMouseLeave: function onMouseLeave() {
|
|
771
|
-
changeVisualFocusedSuggIndex(-1);
|
|
772
|
-
},
|
|
773
|
-
ref: suggestionsRef,
|
|
774
|
-
role: "listbox",
|
|
775
|
-
"aria-label": label
|
|
776
|
-
}, !isSearching && !isAutosuggestError && filteredSuggestions.length > 0 && filteredSuggestions.map(function (suggestion, index) {
|
|
777
|
-
return _react["default"].createElement(HighlightedSuggestion, {
|
|
778
|
-
key: "suggestion-".concat((0, _uuid.v4)()),
|
|
779
|
-
suggestion: suggestion,
|
|
780
|
-
index: index
|
|
781
|
-
});
|
|
782
|
-
}), isSearching && _react["default"].createElement(SuggestionsSystemMessage, null, "Searching..."), isAutosuggestError && _react["default"].createElement(SuggestionsError, null, _react["default"].createElement(SuggestionsErrorIcon, {
|
|
783
|
-
backgroundType: backgroundType
|
|
784
|
-
}, textInputIcons.error), "Error fetching data"))), !disabled && _react["default"].createElement(Error, {
|
|
555
|
+
}, suffix)), !disabled && typeof error === "string" && /*#__PURE__*/_react["default"].createElement(Error, {
|
|
785
556
|
id: errorId,
|
|
786
|
-
backgroundType: backgroundType
|
|
557
|
+
backgroundType: backgroundType,
|
|
558
|
+
"aria-live": error ? "assertive" : "off"
|
|
787
559
|
}, error)));
|
|
788
560
|
});
|
|
789
561
|
|
|
790
|
-
var
|
|
791
|
-
small: "240px",
|
|
792
|
-
medium: "360px",
|
|
793
|
-
large: "480px",
|
|
794
|
-
fillParent: "100%"
|
|
795
|
-
};
|
|
796
|
-
|
|
797
|
-
var calculateWidth = function calculateWidth(margin, size) {
|
|
798
|
-
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
799
|
-
};
|
|
800
|
-
|
|
801
|
-
var DxcInput = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
562
|
+
var TextInputContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
802
563
|
return calculateWidth(props.margin, props.size);
|
|
803
564
|
}, function (props) {
|
|
804
565
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
@@ -812,7 +573,7 @@ var DxcInput = _styledComponents["default"].div(_templateObject(), function (pro
|
|
|
812
573
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
813
574
|
});
|
|
814
575
|
|
|
815
|
-
var Label = _styledComponents["default"].label(_templateObject2(), function (props) {
|
|
576
|
+
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) {
|
|
816
577
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledLabelFontColorOnDark : props.theme.disabledLabelFontColor : props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
817
578
|
}, function (props) {
|
|
818
579
|
return props.theme.fontFamily;
|
|
@@ -824,13 +585,15 @@ var Label = _styledComponents["default"].label(_templateObject2(), function (pro
|
|
|
824
585
|
return props.theme.labelFontWeight;
|
|
825
586
|
}, function (props) {
|
|
826
587
|
return props.theme.labelLineHeight;
|
|
588
|
+
}, function (props) {
|
|
589
|
+
return !props.hasHelperText && "margin-bottom: 0.25rem";
|
|
827
590
|
});
|
|
828
591
|
|
|
829
|
-
var OptionalLabel = _styledComponents["default"].span(_templateObject3(), function (props) {
|
|
592
|
+
var OptionalLabel = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n font-weight: ", ";\n"])), function (props) {
|
|
830
593
|
return props.theme.optionalLabelFontWeight;
|
|
831
594
|
});
|
|
832
595
|
|
|
833
|
-
var HelperText = _styledComponents["default"].span(_templateObject4(), function (props) {
|
|
596
|
+
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) {
|
|
834
597
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledHelperTextFontColorOnDark : props.theme.disabledHelperTextFontColor : props.backgroundType === "dark" ? props.theme.helperTextFontColorOnDark : props.theme.helperTextFontColor;
|
|
835
598
|
}, function (props) {
|
|
836
599
|
return props.theme.fontFamily;
|
|
@@ -844,7 +607,7 @@ var HelperText = _styledComponents["default"].span(_templateObject4(), function
|
|
|
844
607
|
return props.theme.helperTextLineHeight;
|
|
845
608
|
});
|
|
846
609
|
|
|
847
|
-
var InputContainer = _styledComponents["default"].div(_templateObject5(), function (props) {
|
|
610
|
+
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) {
|
|
848
611
|
if (props.disabled) return props.backgroundType === "dark" ? "background-color: ".concat(props.theme.disabledContainerFillColorOnDark, ";") : "background-color: ".concat(props.theme.disabledContainerFillColor, ";");
|
|
849
612
|
}, function (props) {
|
|
850
613
|
if (props.disabled) return props.backgroundType === "dark" ? props.theme.disabledBorderColorOnDark : props.theme.disabledBorderColor;else return props.backgroundType === "dark" ? props.theme.enabledBorderColorOnDark : props.theme.enabledBorderColor;
|
|
@@ -853,10 +616,10 @@ var InputContainer = _styledComponents["default"].div(_templateObject5(), functi
|
|
|
853
616
|
}, function (props) {
|
|
854
617
|
return props.disabled && "cursor: not-allowed;";
|
|
855
618
|
}, function (props) {
|
|
856
|
-
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
|
|
619
|
+
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 ");
|
|
857
620
|
});
|
|
858
621
|
|
|
859
|
-
var Input = _styledComponents["default"].input(_templateObject6(), function (props) {
|
|
622
|
+
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) {
|
|
860
623
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledValueFontColorOnDark : props.theme.disabledValueFontColor : props.backgroundType === "dark" ? props.theme.valueFontColorOnDark : props.theme.valueFontColor;
|
|
861
624
|
}, function (props) {
|
|
862
625
|
return props.theme.fontFamily;
|
|
@@ -872,11 +635,7 @@ var Input = _styledComponents["default"].input(_templateObject6(), function (pro
|
|
|
872
635
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPlaceholderFontColorOnDark : props.theme.disabledPlaceholderFontColor : props.backgroundType === "dark" ? props.theme.placeholderFontColorOnDark : props.theme.placeholderFontColor;
|
|
873
636
|
});
|
|
874
637
|
|
|
875
|
-
var
|
|
876
|
-
|
|
877
|
-
var Action = _styledComponents["default"].button(_templateObject8(), function (props) {
|
|
878
|
-
return props.theme.fontFamily;
|
|
879
|
-
}, function (props) {
|
|
638
|
+
var Action = _styledComponents["default"].button(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n border: 1px solid transparent;\n border-radius: 2px;\n width: 24px;\n height: 24px;\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 img, svg {\n width: 16px;\n height: 16px;\n }\n"])), function (props) {
|
|
880
639
|
return props.disabled ? "cursor: not-allowed;" : "cursor: pointer;";
|
|
881
640
|
}, function (props) {
|
|
882
641
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledActionBackgroundColorOnDark : props.theme.disabledActionBackgroundColor : props.backgroundType === "dark" ? props.theme.actionBackgroundColorOnDark : props.theme.actionBackgroundColor;
|
|
@@ -886,105 +645,29 @@ var Action = _styledComponents["default"].button(_templateObject8(), function (p
|
|
|
886
645
|
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 ");
|
|
887
646
|
});
|
|
888
647
|
|
|
889
|
-
var Prefix = _styledComponents["default"].span(
|
|
648
|
+
var Prefix = _styledComponents["default"].span(_templateObject8 || (_templateObject8 = (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) {
|
|
890
649
|
var color = props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPrefixColorOnDark : props.theme.disabledPrefixColor : props.backgroundType === "dark" ? props.theme.prefixColorOnDark : props.theme.prefixColor;
|
|
891
650
|
return "color: ".concat(color, "; border-right: 1px solid ").concat(color, ";");
|
|
892
651
|
}, function (props) {
|
|
893
652
|
return props.theme.fontFamily;
|
|
894
653
|
});
|
|
895
654
|
|
|
896
|
-
var Suffix = _styledComponents["default"].span(
|
|
655
|
+
var Suffix = _styledComponents["default"].span(_templateObject9 || (_templateObject9 = (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) {
|
|
897
656
|
var color = props.disabled ? props.backgroundType === "dark" ? props.theme.disabledSuffixColorOnDark : props.theme.disabledSuffixColor : props.backgroundType === "dark" ? props.theme.suffixColorOnDark : props.theme.suffixColor;
|
|
898
657
|
return "color: ".concat(color, "; border-left: 1px solid ").concat(color, ";");
|
|
899
658
|
}, function (props) {
|
|
900
659
|
return props.theme.fontFamily;
|
|
901
660
|
});
|
|
902
661
|
|
|
903
|
-
var ErrorIcon = _styledComponents["default"].span(
|
|
662
|
+
var ErrorIcon = _styledComponents["default"].span(_templateObject10 || (_templateObject10 = (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) {
|
|
904
663
|
return props.backgroundType === "dark" ? props.theme.errorIconColorOnDark : props.theme.errorIconColor;
|
|
905
664
|
});
|
|
906
665
|
|
|
907
|
-
var Error = _styledComponents["default"].span(
|
|
666
|
+
var Error = _styledComponents["default"].span(_templateObject11 || (_templateObject11 = (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) {
|
|
908
667
|
return props.backgroundType === "dark" ? props.theme.errorMessageColorOnDark : props.theme.errorMessageColor;
|
|
909
668
|
}, function (props) {
|
|
910
669
|
return props.theme.fontFamily;
|
|
911
670
|
});
|
|
912
671
|
|
|
913
|
-
var Suggestions = _styledComponents["default"].ul(_templateObject13(), function (props) {
|
|
914
|
-
return props.isError ? props.theme.errorListDialogBackgroundColor : props.theme.listDialogBackgroundColor;
|
|
915
|
-
}, function (props) {
|
|
916
|
-
return props.isError ? props.theme.errorListDialogBorderColor : props.theme.listDialogBorderColor;
|
|
917
|
-
}, function (props) {
|
|
918
|
-
return props.theme.listOptionFontColor;
|
|
919
|
-
}, function (props) {
|
|
920
|
-
return props.theme.fontFamily;
|
|
921
|
-
}, function (props) {
|
|
922
|
-
return props.theme.listOptionFontSize;
|
|
923
|
-
}, function (props) {
|
|
924
|
-
return props.theme.listOptionFontStyle;
|
|
925
|
-
}, function (props) {
|
|
926
|
-
return props.theme.listOptionFontWeight;
|
|
927
|
-
});
|
|
928
|
-
|
|
929
|
-
var Suggestion = _styledComponents["default"].li(_templateObject14(), function (props) {
|
|
930
|
-
return props.visualFocused ? props.theme.focusListOptionBorderColor : "transparent";
|
|
931
|
-
}, function (props) {
|
|
932
|
-
return props.theme.hoverListOptionBackgroundColor;
|
|
933
|
-
}, function (props) {
|
|
934
|
-
return props.theme.activeListOptionBackgroundColor;
|
|
935
|
-
});
|
|
936
|
-
|
|
937
|
-
var StyledSuggestion = _styledComponents["default"].span(_templateObject15(), function (props) {
|
|
938
|
-
return props.last || props.visualFocused ? "border-bottom: 1px solid transparent" : "border-bottom: 1px solid ".concat(props.theme.listOptionDividerColor);
|
|
939
|
-
});
|
|
940
|
-
|
|
941
|
-
var SuggestionsSystemMessage = _styledComponents["default"].span(_templateObject16(), function (props) {
|
|
942
|
-
return props.theme.systemMessageFontColor;
|
|
943
|
-
});
|
|
944
|
-
|
|
945
|
-
var SuggestionsErrorIcon = _styledComponents["default"].span(_templateObject17(), function (props) {
|
|
946
|
-
return props.backgroundType === "dark" ? props.theme.errorIconColorOnDark : props.theme.errorIconColor;
|
|
947
|
-
});
|
|
948
|
-
|
|
949
|
-
var SuggestionsError = _styledComponents["default"].span(_templateObject18(), function (props) {
|
|
950
|
-
return props.theme.errorListDialogFontColor;
|
|
951
|
-
});
|
|
952
|
-
|
|
953
|
-
DxcTextInput.propTypes = {
|
|
954
|
-
label: _propTypes["default"].string,
|
|
955
|
-
name: _propTypes["default"].string,
|
|
956
|
-
value: _propTypes["default"].string,
|
|
957
|
-
helperText: _propTypes["default"].string,
|
|
958
|
-
placeholder: _propTypes["default"].string,
|
|
959
|
-
action: _propTypes["default"].shape({
|
|
960
|
-
onClick: _propTypes["default"].func.isRequired,
|
|
961
|
-
icon: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
962
|
-
type: _propTypes["default"].oneOf(["svg"])
|
|
963
|
-
}), _propTypes["default"].string]).isRequired
|
|
964
|
-
}),
|
|
965
|
-
clearable: _propTypes["default"].bool,
|
|
966
|
-
disabled: _propTypes["default"].bool,
|
|
967
|
-
optional: _propTypes["default"].bool,
|
|
968
|
-
prefix: _propTypes["default"].string,
|
|
969
|
-
suffix: _propTypes["default"].string,
|
|
970
|
-
onChange: _propTypes["default"].func,
|
|
971
|
-
onBlur: _propTypes["default"].func,
|
|
972
|
-
error: _propTypes["default"].string,
|
|
973
|
-
autocomplete: _propTypes["default"].string,
|
|
974
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
975
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
976
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
977
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
978
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
979
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
980
|
-
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
981
|
-
suggestions: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].array]),
|
|
982
|
-
pattern: _propTypes["default"].string,
|
|
983
|
-
length: _propTypes["default"].shape({
|
|
984
|
-
min: _propTypes["default"].number,
|
|
985
|
-
max: _propTypes["default"].number
|
|
986
|
-
}),
|
|
987
|
-
tabIndex: _propTypes["default"].number
|
|
988
|
-
};
|
|
989
672
|
var _default = DxcTextInput;
|
|
990
673
|
exports["default"] = _default;
|