@dxc-technology/halstack-react 4.0.0 → 6.0.0
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 +7 -6
- package/HalstackContext.d.ts +12 -0
- package/HalstackContext.js +295 -0
- package/accordion/Accordion.d.ts +4 -0
- package/accordion/Accordion.js +35 -162
- 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 +68 -85
- package/accordion-group/AccordionGroup.stories.tsx +225 -0
- package/accordion-group/AccordionGroup.test.js +151 -0
- package/accordion-group/types.d.ts +72 -0
- package/accordion-group/types.js +5 -0
- package/alert/Alert.d.ts +4 -0
- package/alert/Alert.js +43 -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 +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 +341 -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 +36 -76
- 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/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 +33 -97
- 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/card/Card.js +44 -137
- 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/checkbox/Checkbox.js +52 -94
- package/checkbox/Checkbox.stories.tsx +188 -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 +26 -130
- 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/common/RequiredComponent.js +3 -11
- package/common/variables.js +301 -373
- package/date-input/DateInput.d.ts +4 -0
- package/date-input/DateInput.js +80 -108
- package/date-input/DateInput.stories.tsx +138 -0
- package/date-input/DateInput.test.js +479 -0
- package/date-input/types.d.ts +107 -0
- package/date-input/types.js +5 -0
- package/dialog/Dialog.d.ts +4 -0
- package/dialog/Dialog.js +25 -105
- 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/dropdown/Dropdown.js +54 -207
- 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 +200 -251
- 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 +44 -145
- package/file-input/types.d.ts +112 -0
- package/file-input/types.js +5 -0
- package/flex/Flex.d.ts +4 -0
- package/flex/Flex.js +57 -0
- package/flex/Flex.stories.tsx +103 -0
- package/flex/types.d.ts +21 -0
- package/flex/types.js +5 -0
- package/footer/Footer.d.ts +4 -0
- package/footer/Footer.js +50 -286
- package/footer/Footer.stories.tsx +130 -0
- package/footer/Footer.test.js +109 -0
- package/footer/Icons.d.ts +2 -0
- package/footer/Icons.js +16 -16
- package/footer/types.d.ts +65 -0
- package/footer/types.js +5 -0
- package/header/Header.d.ts +7 -0
- package/header/Header.js +82 -249
- package/header/Header.stories.tsx +172 -0
- package/header/Header.test.js +79 -0
- package/header/Icons.d.ts +2 -0
- package/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/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 +51 -0
- package/inset/Inset.stories.tsx +229 -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 +76 -232
- package/layout/ApplicationLayout.stories.tsx +161 -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 +42 -0
- package/layout/types.js +5 -0
- package/link/Link.d.ts +4 -0
- package/link/Link.js +64 -165
- package/link/Link.stories.tsx +186 -0
- package/link/Link.test.js +83 -0
- package/link/types.d.ts +54 -0
- package/link/types.js +5 -0
- package/main.d.ts +44 -40
- package/main.js +114 -104
- 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 +506 -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 +23 -16
- package/paginator/Icons.js +9 -9
- package/paginator/Paginator.d.ts +4 -0
- package/paginator/Paginator.js +32 -166
- package/paginator/Paginator.stories.tsx +63 -0
- package/paginator/Paginator.test.js +308 -0
- package/paginator/types.d.ts +38 -0
- package/paginator/types.js +5 -0
- package/paragraph/Paragraph.d.ts +6 -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 +180 -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 +23 -95
- 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/quick-nav/QuickNav.d.ts +4 -0
- package/quick-nav/QuickNav.js +118 -0
- package/quick-nav/QuickNav.stories.tsx +264 -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 +141 -0
- package/radio-group/RadioGroup.d.ts +4 -0
- package/radio-group/RadioGroup.js +283 -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/resultsetTable/ResultsetTable.js +43 -147
- package/resultsetTable/ResultsetTable.stories.tsx +275 -0
- package/resultsetTable/ResultsetTable.test.js +348 -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 +175 -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 +231 -709
- package/select/Select.stories.tsx +626 -0
- package/select/Select.test.js +2162 -0
- package/select/types.d.ts +212 -0
- package/select/types.js +5 -0
- package/sidenav/Sidenav.d.ts +10 -0
- package/sidenav/Sidenav.js +182 -105
- package/sidenav/Sidenav.stories.tsx +180 -0
- package/sidenav/Sidenav.test.js +44 -0
- package/sidenav/types.d.ts +73 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.d.ts +4 -0
- package/slider/Slider.js +76 -162
- package/slider/Slider.stories.tsx +177 -0
- package/slider/Slider.test.js +150 -0
- package/slider/types.d.ts +82 -0
- package/slider/types.js +5 -0
- package/spinner/Spinner.d.ts +4 -0
- package/spinner/Spinner.js +46 -177
- 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/switch/Switch.d.ts +4 -0
- package/switch/Switch.js +55 -82
- 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/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 +43 -175
- package/tabs/Tabs.stories.tsx +112 -0
- package/tabs/Tabs.test.js +140 -0
- package/tabs/types.d.ts +82 -0
- package/tabs/types.js +5 -0
- package/tabs-nav/NavTabs.d.ts +8 -0
- package/tabs-nav/NavTabs.js +125 -0
- package/tabs-nav/NavTabs.stories.tsx +170 -0
- package/tabs-nav/NavTabs.test.js +82 -0
- package/tabs-nav/Tab.d.ts +4 -0
- package/tabs-nav/Tab.js +132 -0
- package/tabs-nav/types.d.ts +53 -0
- package/tabs-nav/types.js +5 -0
- package/tag/Tag.d.ts +4 -0
- package/tag/Tag.js +44 -143
- 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-input/Suggestion.d.ts +4 -0
- package/text-input/Suggestion.js +55 -0
- package/text-input/TextInput.d.ts +4 -0
- package/text-input/TextInput.js +169 -391
- package/text-input/TextInput.stories.tsx +474 -0
- package/text-input/TextInput.test.js +1712 -0
- package/text-input/types.d.ts +178 -0
- package/text-input/types.js +5 -0
- package/textarea/Textarea.d.ts +4 -0
- package/textarea/Textarea.js +50 -142
- package/textarea/Textarea.stories.jsx +157 -0
- package/textarea/Textarea.test.js +437 -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 +36 -148
- package/toggle-group/ToggleGroup.stories.tsx +173 -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 +131 -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 +2 -0
- package/useTheme.js +2 -2
- package/useTranslatedLabels.d.ts +2 -0
- package/useTranslatedLabels.js +20 -0
- package/wizard/Wizard.d.ts +4 -0
- package/wizard/Wizard.js +132 -252
- package/wizard/Wizard.stories.tsx +233 -0
- package/wizard/Wizard.test.js +141 -0
- package/wizard/types.d.ts +65 -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/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,9 +19,9 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
21
19
|
|
|
22
20
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
23
21
|
|
|
24
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
22
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
25
23
|
|
|
26
|
-
var
|
|
24
|
+
var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
|
|
27
25
|
|
|
28
26
|
var _variables = require("../common/variables.js");
|
|
29
27
|
|
|
@@ -31,234 +29,62 @@ var _utils = require("../common/utils.js");
|
|
|
31
29
|
|
|
32
30
|
var _uuid = require("uuid");
|
|
33
31
|
|
|
34
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext
|
|
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"]);
|
|
32
|
+
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
40
33
|
|
|
41
|
-
|
|
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
|
-
};
|
|
34
|
+
var _NumberInputContext = _interopRequireDefault(require("../number-input/NumberInputContext"));
|
|
54
35
|
|
|
55
|
-
|
|
56
|
-
}
|
|
36
|
+
var _Suggestion = _interopRequireDefault(require("./Suggestion"));
|
|
57
37
|
|
|
58
|
-
|
|
59
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 0.25rem 1rem;\n color: ", ";\n line-height: 1.715em;\n"]);
|
|
38
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16;
|
|
60
39
|
|
|
61
|
-
|
|
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
|
-
};
|
|
40
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
84
41
|
|
|
85
|
-
|
|
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: 0.25rem;\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: 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"]);
|
|
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: 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"]);
|
|
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: 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"]);
|
|
140
|
-
|
|
141
|
-
_templateObject8 = function _templateObject8() {
|
|
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"]);
|
|
150
|
-
|
|
151
|
-
_templateObject7 = function _templateObject7() {
|
|
152
|
-
return data;
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
return data;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function _templateObject6() {
|
|
159
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: calc(2.5rem - 2px);\n width: 100%;\n background: none;\n border: none;\n outline: none;\n padding: 0 0.5rem;\n\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.5em;\n ", "\n\n ::placeholder {\n color: ", ";\n }\n"]);
|
|
160
|
-
|
|
161
|
-
_templateObject6 = function _templateObject6() {
|
|
162
|
-
return data;
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
return data;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function _templateObject5() {
|
|
169
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n position: relative;\n align-items: center;\n height: calc(2.5rem - 2px);\n margin: ", ";\n padding: 0 0.5rem;\n\n ", "\n box-shadow: 0 0 0 2px transparent;\n border-radius: 4px;\n border: 1px solid\n ", ";\n ", "\n ", ";\n\n ", ";\n"]);
|
|
170
|
-
|
|
171
|
-
_templateObject5 = function _templateObject5() {
|
|
172
|
-
return data;
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
return data;
|
|
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
|
-
};
|
|
194
|
-
|
|
195
|
-
return data;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
function _templateObject2() {
|
|
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"]);
|
|
200
|
-
|
|
201
|
-
_templateObject2 = function _templateObject2() {
|
|
202
|
-
return data;
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
return data;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
function _templateObject() {
|
|
209
|
-
var data = (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"]);
|
|
210
|
-
|
|
211
|
-
_templateObject = function _templateObject() {
|
|
212
|
-
return data;
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
return data;
|
|
216
|
-
}
|
|
42
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
217
43
|
|
|
218
44
|
var textInputIcons = {
|
|
219
|
-
error: _react["default"].createElement("svg", {
|
|
45
|
+
error: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
220
46
|
xmlns: "http://www.w3.org/2000/svg",
|
|
221
47
|
height: "24px",
|
|
222
48
|
viewBox: "0 0 24 24",
|
|
223
49
|
width: "24px",
|
|
224
50
|
fill: "currentColor"
|
|
225
|
-
}, _react["default"].createElement("path", {
|
|
51
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
226
52
|
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"
|
|
227
53
|
})),
|
|
228
|
-
clear: _react["default"].createElement("svg", {
|
|
54
|
+
clear: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
229
55
|
xmlns: "http://www.w3.org/2000/svg",
|
|
230
56
|
width: "24",
|
|
231
57
|
height: "24",
|
|
232
58
|
viewBox: "0 0 24 24",
|
|
233
59
|
fill: "currentColor"
|
|
234
|
-
}, _react["default"].createElement("path", {
|
|
60
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
235
61
|
d: "M0 0h24v24H0V0z",
|
|
236
62
|
fill: "none"
|
|
237
|
-
}), _react["default"].createElement("path", {
|
|
63
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
238
64
|
d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
|
|
239
65
|
})),
|
|
240
|
-
increment: _react["default"].createElement("svg", {
|
|
66
|
+
increment: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
241
67
|
xmlns: "http://www.w3.org/2000/svg",
|
|
242
68
|
height: "24px",
|
|
243
69
|
viewBox: "0 0 24 24",
|
|
244
70
|
width: "24px",
|
|
245
71
|
fill: "currentColor"
|
|
246
|
-
}, _react["default"].createElement("path", {
|
|
72
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
247
73
|
d: "M0 0h24v24H0z",
|
|
248
74
|
fill: "none"
|
|
249
|
-
}), _react["default"].createElement("path", {
|
|
75
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
250
76
|
d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
|
|
251
77
|
})),
|
|
252
|
-
decrement: _react["default"].createElement("svg", {
|
|
78
|
+
decrement: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
253
79
|
xmlns: "http://www.w3.org/2000/svg",
|
|
254
80
|
height: "24px",
|
|
255
81
|
viewBox: "0 0 24 24",
|
|
256
82
|
width: "24px",
|
|
257
83
|
fill: "currentColor"
|
|
258
|
-
}, _react["default"].createElement("path", {
|
|
84
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
259
85
|
d: "M0 0h24v24H0z",
|
|
260
86
|
fill: "none"
|
|
261
|
-
}), _react["default"].createElement("path", {
|
|
87
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
262
88
|
d: "M19 13H5v-2h14v2z"
|
|
263
89
|
}))
|
|
264
90
|
};
|
|
@@ -288,10 +114,6 @@ var getNotOptionalErrorMessage = function getNotOptionalErrorMessage() {
|
|
|
288
114
|
return "This field is required. Please, enter a value.";
|
|
289
115
|
};
|
|
290
116
|
|
|
291
|
-
var getLengthErrorMessage = function getLengthErrorMessage(length) {
|
|
292
|
-
return "Min length ".concat(length.min, ", max length ").concat(length.max, ".");
|
|
293
|
-
};
|
|
294
|
-
|
|
295
117
|
var getPatternErrorMessage = function getPatternErrorMessage() {
|
|
296
118
|
return "Please match the format requested.";
|
|
297
119
|
};
|
|
@@ -300,16 +122,27 @@ var patternMatch = function patternMatch(pattern, value) {
|
|
|
300
122
|
return new RegExp(pattern).test(value);
|
|
301
123
|
};
|
|
302
124
|
|
|
303
|
-
var
|
|
304
|
-
var
|
|
125
|
+
var getLastOptionIndex = function getLastOptionIndex(filteredSuggestions) {
|
|
126
|
+
var last = 0;
|
|
305
127
|
|
|
306
|
-
var
|
|
307
|
-
|
|
128
|
+
var reducer = function reducer(acc, current) {
|
|
129
|
+
var _current$options;
|
|
130
|
+
|
|
131
|
+
return acc + ((_current$options = current.options) === null || _current$options === void 0 ? void 0 : _current$options.length);
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
if (filteredSuggestions.length > 0) filteredSuggestions[0].options ? last = filteredSuggestions.reduce(reducer, 0) - 1 : last = filteredSuggestions.length - 1;
|
|
135
|
+
return last;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
139
|
+
var label = _ref.label,
|
|
308
140
|
_ref$name = _ref.name,
|
|
309
141
|
name = _ref$name === void 0 ? "" : _ref$name,
|
|
142
|
+
_ref$defaultValue = _ref.defaultValue,
|
|
143
|
+
defaultValue = _ref$defaultValue === void 0 ? "" : _ref$defaultValue,
|
|
310
144
|
value = _ref.value,
|
|
311
|
-
|
|
312
|
-
helperText = _ref$helperText === void 0 ? "" : _ref$helperText,
|
|
145
|
+
helperText = _ref.helperText,
|
|
313
146
|
_ref$placeholder = _ref.placeholder,
|
|
314
147
|
placeholder = _ref$placeholder === void 0 ? "" : _ref$placeholder,
|
|
315
148
|
action = _ref.action,
|
|
@@ -325,11 +158,11 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
325
158
|
suffix = _ref$suffix === void 0 ? "" : _ref$suffix,
|
|
326
159
|
onChange = _ref.onChange,
|
|
327
160
|
onBlur = _ref.onBlur,
|
|
328
|
-
|
|
329
|
-
error = _ref$error === void 0 ? "" : _ref$error,
|
|
161
|
+
error = _ref.error,
|
|
330
162
|
suggestions = _ref.suggestions,
|
|
331
163
|
pattern = _ref.pattern,
|
|
332
|
-
|
|
164
|
+
minLength = _ref.minLength,
|
|
165
|
+
maxLength = _ref.maxLength,
|
|
333
166
|
_ref$autocomplete = _ref.autocomplete,
|
|
334
167
|
autocomplete = _ref$autocomplete === void 0 ? "off" : _ref$autocomplete,
|
|
335
168
|
margin = _ref.margin,
|
|
@@ -342,7 +175,7 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
342
175
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 1),
|
|
343
176
|
inputId = _useState2[0];
|
|
344
177
|
|
|
345
|
-
var _useState3 = (0, _react.useState)(
|
|
178
|
+
var _useState3 = (0, _react.useState)(defaultValue),
|
|
346
179
|
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
347
180
|
innerValue = _useState4[0],
|
|
348
181
|
setInnerValue = _useState4[1];
|
|
@@ -376,17 +209,21 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
376
209
|
var inputRef = (0, _react.useRef)(null);
|
|
377
210
|
var actionRef = (0, _react.useRef)(null);
|
|
378
211
|
var colorsTheme = (0, _useTheme["default"])();
|
|
212
|
+
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
379
213
|
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
380
214
|
var autosuggestId = "".concat(inputId, "-listBox");
|
|
381
|
-
var errorId = "error-
|
|
215
|
+
var errorId = "error-".concat(inputId);
|
|
382
216
|
var numberInputContext = (0, _react.useContext)(_NumberInputContext["default"]);
|
|
217
|
+
var lastOptionIndex = (0, _react.useMemo)(function () {
|
|
218
|
+
return getLastOptionIndex(filteredSuggestions);
|
|
219
|
+
}, [filteredSuggestions]);
|
|
383
220
|
|
|
384
221
|
var isNotOptional = function isNotOptional(value) {
|
|
385
222
|
return value === "" && !optional;
|
|
386
223
|
};
|
|
387
224
|
|
|
388
225
|
var isLengthIncorrect = function isLengthIncorrect(value) {
|
|
389
|
-
return value
|
|
226
|
+
return value && minLength && maxLength && (value.length < minLength || value.length > maxLength);
|
|
390
227
|
};
|
|
391
228
|
|
|
392
229
|
var isNumberIncorrect = function isNumberIncorrect(value) {
|
|
@@ -400,15 +237,15 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
400
237
|
};
|
|
401
238
|
|
|
402
239
|
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
|
|
240
|
+
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
241
|
};
|
|
405
242
|
|
|
406
243
|
var hasSuggestions = function hasSuggestions() {
|
|
407
|
-
return typeof suggestions === "function" || suggestions
|
|
244
|
+
return typeof suggestions === "function" || (suggestions === null || suggestions === void 0 ? void 0 : suggestions.length) > 0;
|
|
408
245
|
};
|
|
409
246
|
|
|
410
247
|
var openSuggestions = function openSuggestions() {
|
|
411
|
-
|
|
248
|
+
hasSuggestions() && changeIsOpen(true);
|
|
412
249
|
};
|
|
413
250
|
|
|
414
251
|
var closeSuggestions = function closeSuggestions() {
|
|
@@ -421,19 +258,18 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
421
258
|
var changedValue = typeof newValue === "number" ? newValue.toString() : newValue;
|
|
422
259
|
if (isNotOptional(newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
423
260
|
value: changedValue,
|
|
424
|
-
error:
|
|
261
|
+
error: translatedLabels.formFields.requiredValueErrorMessage
|
|
425
262
|
});else if (isLengthIncorrect(newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
426
263
|
value: changedValue,
|
|
427
|
-
error:
|
|
264
|
+
error: translatedLabels.formFields.lengthErrorMessage(minLength, maxLength)
|
|
428
265
|
});else if (newValue && pattern && !patternMatch(pattern, newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
429
266
|
value: changedValue,
|
|
430
|
-
error:
|
|
267
|
+
error: translatedLabels.formFields.formatRequestedErrorMessage
|
|
431
268
|
});else if (newValue && isNumberIncorrect(newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
432
269
|
value: changedValue,
|
|
433
270
|
error: getNumberErrorMessage(newValue)
|
|
434
271
|
});else onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
435
|
-
value: changedValue
|
|
436
|
-
error: null
|
|
272
|
+
value: changedValue
|
|
437
273
|
});
|
|
438
274
|
};
|
|
439
275
|
|
|
@@ -441,44 +277,40 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
441
277
|
document.activeElement !== actionRef.current && inputRef.current.focus();
|
|
442
278
|
};
|
|
443
279
|
|
|
444
|
-
var
|
|
445
|
-
|
|
446
|
-
|
|
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();
|
|
447
283
|
};
|
|
448
284
|
|
|
449
|
-
var
|
|
285
|
+
var handleIOnChange = function handleIOnChange(event) {
|
|
450
286
|
openSuggestions();
|
|
287
|
+
changeValue(event.target.value);
|
|
451
288
|
};
|
|
452
289
|
|
|
453
290
|
var handleIOnBlur = function handleIOnBlur(event) {
|
|
454
291
|
suggestions && closeSuggestions();
|
|
455
292
|
if (isNotOptional(event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
456
293
|
value: event.target.value,
|
|
457
|
-
error:
|
|
294
|
+
error: translatedLabels.formFields.requiredValueErrorMessage
|
|
458
295
|
});else if (isLengthIncorrect(event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
459
296
|
value: event.target.value,
|
|
460
|
-
error:
|
|
297
|
+
error: translatedLabels.formFields.lengthErrorMessage(minLength, maxLength)
|
|
461
298
|
});else if (event.target.value && pattern && !patternMatch(pattern, event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
462
299
|
value: event.target.value,
|
|
463
|
-
error:
|
|
300
|
+
error: translatedLabels.formFields.formatRequestedErrorMessage
|
|
464
301
|
});else if (event.target.value && isNumberIncorrect(event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
465
302
|
value: event.target.value,
|
|
466
303
|
error: getNumberErrorMessage(event.target.value)
|
|
467
304
|
});else onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
468
|
-
value: event.target.value
|
|
469
|
-
error: null
|
|
305
|
+
value: event.target.value
|
|
470
306
|
});
|
|
471
307
|
};
|
|
472
308
|
|
|
473
|
-
var handleIOnFocus = function handleIOnFocus() {
|
|
474
|
-
openSuggestions();
|
|
475
|
-
};
|
|
476
|
-
|
|
477
309
|
var handleIOnKeyDown = function handleIOnKeyDown(event) {
|
|
478
310
|
switch (event.keyCode) {
|
|
479
311
|
case 40:
|
|
480
312
|
// Arrow Down
|
|
481
|
-
if (numberInputContext) {
|
|
313
|
+
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number") {
|
|
482
314
|
decrementNumber();
|
|
483
315
|
event.preventDefault();
|
|
484
316
|
} else {
|
|
@@ -496,7 +328,7 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
496
328
|
|
|
497
329
|
case 38:
|
|
498
330
|
// Arrow Up
|
|
499
|
-
if (numberInputContext) {
|
|
331
|
+
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number") {
|
|
500
332
|
incrementNumber();
|
|
501
333
|
event.preventDefault();
|
|
502
334
|
} else {
|
|
@@ -635,155 +467,149 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
635
467
|
changeVisualFocusedSuggIndex(-1);
|
|
636
468
|
}
|
|
637
469
|
|
|
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, {
|
|
470
|
+
(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" && setNumberProps(numberInputContext.typeNumber, numberInputContext.minNumber, numberInputContext.maxNumber, numberInputContext.stepNumber);
|
|
471
|
+
}, [value, innerValue, suggestions, numberInputContext]);
|
|
472
|
+
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
684
473
|
theme: colorsTheme.textInput
|
|
685
|
-
}, _react["default"].createElement(
|
|
474
|
+
}, /*#__PURE__*/_react["default"].createElement(TextInputContainer, {
|
|
686
475
|
margin: margin,
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
}, _react["default"].createElement(Label, {
|
|
476
|
+
size: size,
|
|
477
|
+
ref: ref
|
|
478
|
+
}, label && /*#__PURE__*/_react["default"].createElement(Label, {
|
|
690
479
|
htmlFor: inputId,
|
|
691
480
|
disabled: disabled,
|
|
692
|
-
backgroundType: backgroundType
|
|
693
|
-
|
|
481
|
+
backgroundType: backgroundType,
|
|
482
|
+
hasHelperText: helperText ? true : false
|
|
483
|
+
}, label, " ", optional && /*#__PURE__*/_react["default"].createElement(OptionalLabel, null, translatedLabels.formFields.optionalLabel)), helperText && /*#__PURE__*/_react["default"].createElement(HelperText, {
|
|
694
484
|
disabled: disabled,
|
|
695
485
|
backgroundType: backgroundType
|
|
696
|
-
}, helperText), _react["default"].createElement(InputContainer, {
|
|
697
|
-
error: error,
|
|
486
|
+
}, helperText), /*#__PURE__*/_react["default"].createElement(InputContainer, {
|
|
487
|
+
error: error ? true : false,
|
|
698
488
|
disabled: disabled,
|
|
699
489
|
backgroundType: backgroundType,
|
|
700
|
-
onClick: handleInputContainerOnClick
|
|
701
|
-
|
|
490
|
+
onClick: handleInputContainerOnClick,
|
|
491
|
+
onMouseDown: handleInputContainerOnMouseDown
|
|
492
|
+
}, prefix && /*#__PURE__*/_react["default"].createElement(Prefix, {
|
|
702
493
|
disabled: disabled,
|
|
703
494
|
backgroundType: backgroundType
|
|
704
|
-
}, prefix), _react["default"].createElement(Input, {
|
|
495
|
+
}, prefix), /*#__PURE__*/_react["default"].createElement(Input, {
|
|
705
496
|
id: inputId,
|
|
706
497
|
name: name,
|
|
707
498
|
value: value !== null && value !== void 0 ? value : innerValue,
|
|
708
499
|
placeholder: placeholder,
|
|
709
|
-
onChange: handleIOnChange,
|
|
710
|
-
onClick: handleIOnClick,
|
|
711
500
|
onBlur: handleIOnBlur,
|
|
712
|
-
|
|
501
|
+
onChange: handleIOnChange,
|
|
502
|
+
onFocus: function onFocus() {
|
|
503
|
+
openSuggestions();
|
|
504
|
+
},
|
|
713
505
|
onKeyDown: handleIOnKeyDown,
|
|
506
|
+
onMouseDown: function onMouseDown(event) {
|
|
507
|
+
event.stopPropagation();
|
|
508
|
+
},
|
|
714
509
|
disabled: disabled,
|
|
715
510
|
ref: inputRef,
|
|
716
511
|
backgroundType: backgroundType,
|
|
717
512
|
pattern: pattern,
|
|
718
|
-
minLength:
|
|
719
|
-
maxLength:
|
|
513
|
+
minLength: minLength,
|
|
514
|
+
maxLength: maxLength,
|
|
720
515
|
autoComplete: autocomplete,
|
|
721
516
|
tabIndex: tabIndex,
|
|
722
517
|
role: isTextInputType() && hasSuggestions() ? "combobox" : "textbox",
|
|
723
518
|
"aria-autocomplete": isTextInputType() && hasSuggestions() ? "list" : undefined,
|
|
724
519
|
"aria-controls": isTextInputType() && hasSuggestions() ? autosuggestId : undefined,
|
|
520
|
+
"aria-disabled": disabled,
|
|
725
521
|
"aria-expanded": isTextInputType() && hasSuggestions() ? isOpen ? "true" : "false" : undefined,
|
|
726
522
|
"aria-activedescendant": isTextInputType() && hasSuggestions() && isOpen && visualFocusedSuggIndex !== -1 ? "suggestion-".concat(visualFocusedSuggIndex) : undefined,
|
|
727
523
|
"aria-invalid": error ? "true" : "false",
|
|
728
|
-
"aria-
|
|
524
|
+
"aria-errormessage": error ? errorId : undefined,
|
|
729
525
|
"aria-required": optional ? "false" : "true"
|
|
730
|
-
}), !disabled && error && _react["default"].createElement(ErrorIcon, {
|
|
526
|
+
}), !disabled && error && /*#__PURE__*/_react["default"].createElement(ErrorIcon, {
|
|
731
527
|
backgroundType: backgroundType,
|
|
732
528
|
"aria-label": "Error"
|
|
733
|
-
}, textInputIcons.error), !disabled && clearable && (value !== null && value !== void 0 ? value : innerValue).length > 0 && _react["default"].createElement(Action, {
|
|
734
|
-
onClick:
|
|
529
|
+
}, textInputIcons.error), !disabled && clearable && (value !== null && value !== void 0 ? value : innerValue).length > 0 && /*#__PURE__*/_react["default"].createElement(Action, {
|
|
530
|
+
onClick: function onClick() {
|
|
531
|
+
return handleClearActionOnClick();
|
|
532
|
+
},
|
|
533
|
+
onMouseDown: function onMouseDown(event) {
|
|
534
|
+
event.stopPropagation();
|
|
535
|
+
},
|
|
735
536
|
backgroundType: backgroundType,
|
|
736
537
|
tabIndex: tabIndex,
|
|
737
|
-
|
|
738
|
-
|
|
538
|
+
title: translatedLabels.textInput.clearFieldActionTitle,
|
|
539
|
+
"aria-label": translatedLabels.textInput.clearFieldActionTitle
|
|
540
|
+
}, 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, {
|
|
739
541
|
ref: actionRef,
|
|
740
542
|
disabled: disabled,
|
|
741
|
-
onClick:
|
|
543
|
+
onClick: function onClick() {
|
|
544
|
+
return handleDecrementActionOnClick();
|
|
545
|
+
},
|
|
546
|
+
onMouseDown: function onMouseDown(event) {
|
|
547
|
+
event.stopPropagation();
|
|
548
|
+
},
|
|
742
549
|
backgroundType: backgroundType,
|
|
743
550
|
tabIndex: tabIndex,
|
|
744
|
-
|
|
745
|
-
|
|
551
|
+
title: translatedLabels.numberInput.decrementValueTitle,
|
|
552
|
+
"aria-label": translatedLabels.numberInput.decrementValueTitle
|
|
553
|
+
}, textInputIcons.decrement), /*#__PURE__*/_react["default"].createElement(Action, {
|
|
746
554
|
ref: actionRef,
|
|
747
555
|
disabled: disabled,
|
|
748
|
-
onClick:
|
|
556
|
+
onClick: function onClick() {
|
|
557
|
+
return handleIncrementActionOnClick();
|
|
558
|
+
},
|
|
559
|
+
onMouseDown: function onMouseDown(event) {
|
|
560
|
+
event.stopPropagation();
|
|
561
|
+
},
|
|
749
562
|
backgroundType: backgroundType,
|
|
750
563
|
tabIndex: tabIndex,
|
|
751
|
-
|
|
752
|
-
|
|
564
|
+
title: translatedLabels.numberInput.incrementValueTitle,
|
|
565
|
+
"aria-label": translatedLabels.numberInput.incrementValueTitle
|
|
566
|
+
}, textInputIcons.increment)) : action && /*#__PURE__*/_react["default"].createElement(Action, {
|
|
753
567
|
ref: actionRef,
|
|
754
568
|
disabled: disabled,
|
|
755
|
-
onClick:
|
|
756
|
-
|
|
569
|
+
onClick: function onClick() {
|
|
570
|
+
return action.onClick();
|
|
571
|
+
},
|
|
572
|
+
onMouseDown: function onMouseDown(event) {
|
|
573
|
+
event.stopPropagation();
|
|
574
|
+
},
|
|
575
|
+
title: action.title,
|
|
576
|
+
"aria-label": action.title,
|
|
757
577
|
backgroundType: backgroundType,
|
|
758
578
|
tabIndex: tabIndex
|
|
759
|
-
}, typeof action.icon === "string" ? _react["default"].createElement(ActionIcon, {
|
|
579
|
+
}, typeof action.icon === "string" ? /*#__PURE__*/_react["default"].createElement(ActionIcon, {
|
|
760
580
|
src: action.icon
|
|
761
|
-
}) : action.icon), suffix && _react["default"].createElement(Suffix, {
|
|
581
|
+
}) : action.icon), suffix && /*#__PURE__*/_react["default"].createElement(Suffix, {
|
|
762
582
|
disabled: disabled,
|
|
763
583
|
backgroundType: backgroundType
|
|
764
|
-
}, suffix), isOpen && _react["default"].createElement(Suggestions, {
|
|
584
|
+
}, suffix), isOpen && (filteredSuggestions.length > 0 || isSearching || isAutosuggestError) && /*#__PURE__*/_react["default"].createElement(Suggestions, {
|
|
765
585
|
id: autosuggestId,
|
|
766
|
-
|
|
586
|
+
error: isAutosuggestError ? true : false,
|
|
767
587
|
onMouseDown: function onMouseDown(event) {
|
|
768
588
|
event.preventDefault();
|
|
769
589
|
},
|
|
770
|
-
onMouseLeave: function onMouseLeave() {
|
|
771
|
-
changeVisualFocusedSuggIndex(-1);
|
|
772
|
-
},
|
|
773
590
|
ref: suggestionsRef,
|
|
774
591
|
role: "listbox",
|
|
775
592
|
"aria-label": label
|
|
776
593
|
}, !isSearching && !isAutosuggestError && filteredSuggestions.length > 0 && filteredSuggestions.map(function (suggestion, index) {
|
|
777
|
-
return _react["default"].createElement(
|
|
778
|
-
key: "suggestion-".concat(
|
|
594
|
+
return /*#__PURE__*/_react["default"].createElement(_Suggestion["default"], {
|
|
595
|
+
key: "suggestion-".concat(index),
|
|
596
|
+
id: "suggestion-".concat(index),
|
|
597
|
+
value: value !== null && value !== void 0 ? value : innerValue,
|
|
598
|
+
onClick: function onClick() {
|
|
599
|
+
changeValue(suggestion);
|
|
600
|
+
closeSuggestions();
|
|
601
|
+
},
|
|
779
602
|
suggestion: suggestion,
|
|
780
|
-
|
|
603
|
+
isLast: index === lastOptionIndex,
|
|
604
|
+
visuallyFocused: visualFocusedSuggIndex === index,
|
|
605
|
+
highlighted: typeof suggestions === "function"
|
|
781
606
|
});
|
|
782
|
-
}), isSearching && _react["default"].createElement(SuggestionsSystemMessage, null,
|
|
607
|
+
}), isSearching && /*#__PURE__*/_react["default"].createElement(SuggestionsSystemMessage, null, translatedLabels.textInput.searchingMessage), isAutosuggestError && /*#__PURE__*/_react["default"].createElement(SuggestionsError, null, /*#__PURE__*/_react["default"].createElement(SuggestionsErrorIcon, {
|
|
783
608
|
backgroundType: backgroundType
|
|
784
|
-
}, textInputIcons.error),
|
|
609
|
+
}, textInputIcons.error), translatedLabels.textInput.fetchingDataErrorMessage))), !disabled && typeof error === "string" && /*#__PURE__*/_react["default"].createElement(Error, {
|
|
785
610
|
id: errorId,
|
|
786
|
-
backgroundType: backgroundType
|
|
611
|
+
backgroundType: backgroundType,
|
|
612
|
+
"aria-live": error ? "assertive" : "off"
|
|
787
613
|
}, error)));
|
|
788
614
|
});
|
|
789
615
|
|
|
@@ -798,7 +624,7 @@ var calculateWidth = function calculateWidth(margin, size) {
|
|
|
798
624
|
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
799
625
|
};
|
|
800
626
|
|
|
801
|
-
var
|
|
627
|
+
var TextInputContainer = _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) {
|
|
802
628
|
return calculateWidth(props.margin, props.size);
|
|
803
629
|
}, function (props) {
|
|
804
630
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
@@ -812,7 +638,7 @@ var DxcInput = _styledComponents["default"].div(_templateObject(), function (pro
|
|
|
812
638
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
813
639
|
});
|
|
814
640
|
|
|
815
|
-
var Label = _styledComponents["default"].label(_templateObject2(), function (props) {
|
|
641
|
+
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
642
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledLabelFontColorOnDark : props.theme.disabledLabelFontColor : props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
817
643
|
}, function (props) {
|
|
818
644
|
return props.theme.fontFamily;
|
|
@@ -824,13 +650,15 @@ var Label = _styledComponents["default"].label(_templateObject2(), function (pro
|
|
|
824
650
|
return props.theme.labelFontWeight;
|
|
825
651
|
}, function (props) {
|
|
826
652
|
return props.theme.labelLineHeight;
|
|
653
|
+
}, function (props) {
|
|
654
|
+
return !props.hasHelperText && "margin-bottom: 0.25rem";
|
|
827
655
|
});
|
|
828
656
|
|
|
829
|
-
var OptionalLabel = _styledComponents["default"].span(_templateObject3(), function (props) {
|
|
657
|
+
var OptionalLabel = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n font-weight: ", ";\n"])), function (props) {
|
|
830
658
|
return props.theme.optionalLabelFontWeight;
|
|
831
659
|
});
|
|
832
660
|
|
|
833
|
-
var HelperText = _styledComponents["default"].span(_templateObject4(), function (props) {
|
|
661
|
+
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
662
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledHelperTextFontColorOnDark : props.theme.disabledHelperTextFontColor : props.backgroundType === "dark" ? props.theme.helperTextFontColorOnDark : props.theme.helperTextFontColor;
|
|
835
663
|
}, function (props) {
|
|
836
664
|
return props.theme.fontFamily;
|
|
@@ -844,9 +672,7 @@ var HelperText = _styledComponents["default"].span(_templateObject4(), function
|
|
|
844
672
|
return props.theme.helperTextLineHeight;
|
|
845
673
|
});
|
|
846
674
|
|
|
847
|
-
var InputContainer = _styledComponents["default"].div(_templateObject5(), function (props) {
|
|
848
|
-
return "".concat(props.theme.inputMarginTop, " 0 ").concat(props.theme.inputMarginBottom, " 0");
|
|
849
|
-
}, function (props) {
|
|
675
|
+
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) {
|
|
850
676
|
if (props.disabled) return props.backgroundType === "dark" ? "background-color: ".concat(props.theme.disabledContainerFillColorOnDark, ";") : "background-color: ".concat(props.theme.disabledContainerFillColor, ";");
|
|
851
677
|
}, function (props) {
|
|
852
678
|
if (props.disabled) return props.backgroundType === "dark" ? props.theme.disabledBorderColorOnDark : props.theme.disabledBorderColor;else return props.backgroundType === "dark" ? props.theme.enabledBorderColorOnDark : props.theme.enabledBorderColor;
|
|
@@ -858,7 +684,7 @@ var InputContainer = _styledComponents["default"].div(_templateObject5(), functi
|
|
|
858
684
|
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 ");
|
|
859
685
|
});
|
|
860
686
|
|
|
861
|
-
var Input = _styledComponents["default"].input(_templateObject6(), function (props) {
|
|
687
|
+
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) {
|
|
862
688
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledValueFontColorOnDark : props.theme.disabledValueFontColor : props.backgroundType === "dark" ? props.theme.valueFontColorOnDark : props.theme.valueFontColor;
|
|
863
689
|
}, function (props) {
|
|
864
690
|
return props.theme.fontFamily;
|
|
@@ -874,9 +700,9 @@ var Input = _styledComponents["default"].input(_templateObject6(), function (pro
|
|
|
874
700
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPlaceholderFontColorOnDark : props.theme.disabledPlaceholderFontColor : props.backgroundType === "dark" ? props.theme.placeholderFontColorOnDark : props.theme.placeholderFontColor;
|
|
875
701
|
});
|
|
876
702
|
|
|
877
|
-
var ActionIcon = _styledComponents["default"].img(_templateObject7());
|
|
703
|
+
var ActionIcon = _styledComponents["default"].img(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n width: 16px;\n height: 16px;\n"])));
|
|
878
704
|
|
|
879
|
-
var Action = _styledComponents["default"].button(_templateObject8(), function (props) {
|
|
705
|
+
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) {
|
|
880
706
|
return props.theme.fontFamily;
|
|
881
707
|
}, function (props) {
|
|
882
708
|
return props.disabled ? "cursor: not-allowed;" : "cursor: pointer;";
|
|
@@ -888,34 +714,34 @@ var Action = _styledComponents["default"].button(_templateObject8(), function (p
|
|
|
888
714
|
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 ");
|
|
889
715
|
});
|
|
890
716
|
|
|
891
|
-
var Prefix = _styledComponents["default"].span(_templateObject9(), function (props) {
|
|
717
|
+
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) {
|
|
892
718
|
var color = props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPrefixColorOnDark : props.theme.disabledPrefixColor : props.backgroundType === "dark" ? props.theme.prefixColorOnDark : props.theme.prefixColor;
|
|
893
719
|
return "color: ".concat(color, "; border-right: 1px solid ").concat(color, ";");
|
|
894
720
|
}, function (props) {
|
|
895
721
|
return props.theme.fontFamily;
|
|
896
722
|
});
|
|
897
723
|
|
|
898
|
-
var Suffix = _styledComponents["default"].span(_templateObject10(), function (props) {
|
|
724
|
+
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) {
|
|
899
725
|
var color = props.disabled ? props.backgroundType === "dark" ? props.theme.disabledSuffixColorOnDark : props.theme.disabledSuffixColor : props.backgroundType === "dark" ? props.theme.suffixColorOnDark : props.theme.suffixColor;
|
|
900
726
|
return "color: ".concat(color, "; border-left: 1px solid ").concat(color, ";");
|
|
901
727
|
}, function (props) {
|
|
902
728
|
return props.theme.fontFamily;
|
|
903
729
|
});
|
|
904
730
|
|
|
905
|
-
var ErrorIcon = _styledComponents["default"].span(_templateObject11(), function (props) {
|
|
731
|
+
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) {
|
|
906
732
|
return props.backgroundType === "dark" ? props.theme.errorIconColorOnDark : props.theme.errorIconColor;
|
|
907
733
|
});
|
|
908
734
|
|
|
909
|
-
var Error = _styledComponents["default"].span(_templateObject12(), function (props) {
|
|
735
|
+
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) {
|
|
910
736
|
return props.backgroundType === "dark" ? props.theme.errorMessageColorOnDark : props.theme.errorMessageColor;
|
|
911
737
|
}, function (props) {
|
|
912
738
|
return props.theme.fontFamily;
|
|
913
739
|
});
|
|
914
740
|
|
|
915
|
-
var Suggestions = _styledComponents["default"].ul(_templateObject13(), function (props) {
|
|
916
|
-
return props.
|
|
741
|
+
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) {
|
|
742
|
+
return props.error ? props.theme.errorListDialogBackgroundColor : props.theme.listDialogBackgroundColor;
|
|
917
743
|
}, function (props) {
|
|
918
|
-
return props.
|
|
744
|
+
return props.error ? props.theme.errorListDialogBorderColor : props.theme.listDialogBorderColor;
|
|
919
745
|
}, function (props) {
|
|
920
746
|
return props.theme.listOptionFontColor;
|
|
921
747
|
}, function (props) {
|
|
@@ -928,65 +754,17 @@ var Suggestions = _styledComponents["default"].ul(_templateObject13(), function
|
|
|
928
754
|
return props.theme.listOptionFontWeight;
|
|
929
755
|
});
|
|
930
756
|
|
|
931
|
-
var
|
|
932
|
-
return props.visualFocused ? props.theme.focusListOptionBorderColor : "transparent";
|
|
933
|
-
}, function (props) {
|
|
934
|
-
return props.theme.hoverListOptionBackgroundColor;
|
|
935
|
-
}, function (props) {
|
|
936
|
-
return props.theme.activeListOptionBackgroundColor;
|
|
937
|
-
});
|
|
938
|
-
|
|
939
|
-
var StyledSuggestion = _styledComponents["default"].span(_templateObject15(), function (props) {
|
|
940
|
-
return props.last || props.visualFocused ? "border-bottom: 1px solid transparent" : "border-bottom: 1px solid ".concat(props.theme.listOptionDividerColor);
|
|
941
|
-
});
|
|
942
|
-
|
|
943
|
-
var SuggestionsSystemMessage = _styledComponents["default"].span(_templateObject16(), function (props) {
|
|
757
|
+
var SuggestionsSystemMessage = _styledComponents["default"].span(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 0.25rem 1rem;\n color: ", ";\n line-height: 1.715em;\n"])), function (props) {
|
|
944
758
|
return props.theme.systemMessageFontColor;
|
|
945
759
|
});
|
|
946
760
|
|
|
947
|
-
var SuggestionsErrorIcon = _styledComponents["default"].span(
|
|
761
|
+
var SuggestionsErrorIcon = _styledComponents["default"].span(_templateObject15 || (_templateObject15 = (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) {
|
|
948
762
|
return props.backgroundType === "dark" ? props.theme.errorIconColorOnDark : props.theme.errorIconColor;
|
|
949
763
|
});
|
|
950
764
|
|
|
951
|
-
var SuggestionsError = _styledComponents["default"].span(
|
|
765
|
+
var SuggestionsError = _styledComponents["default"].span(_templateObject16 || (_templateObject16 = (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) {
|
|
952
766
|
return props.theme.errorListDialogFontColor;
|
|
953
767
|
});
|
|
954
768
|
|
|
955
|
-
DxcTextInput.propTypes = {
|
|
956
|
-
label: _propTypes["default"].string,
|
|
957
|
-
name: _propTypes["default"].string,
|
|
958
|
-
value: _propTypes["default"].string,
|
|
959
|
-
helperText: _propTypes["default"].string,
|
|
960
|
-
placeholder: _propTypes["default"].string,
|
|
961
|
-
action: _propTypes["default"].shape({
|
|
962
|
-
onClick: _propTypes["default"].func.isRequired,
|
|
963
|
-
icon: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
964
|
-
type: _propTypes["default"].oneOf(["svg"])
|
|
965
|
-
}), _propTypes["default"].string]).isRequired
|
|
966
|
-
}),
|
|
967
|
-
clearable: _propTypes["default"].bool,
|
|
968
|
-
disabled: _propTypes["default"].bool,
|
|
969
|
-
optional: _propTypes["default"].bool,
|
|
970
|
-
prefix: _propTypes["default"].string,
|
|
971
|
-
suffix: _propTypes["default"].string,
|
|
972
|
-
onChange: _propTypes["default"].func,
|
|
973
|
-
onBlur: _propTypes["default"].func,
|
|
974
|
-
error: _propTypes["default"].string,
|
|
975
|
-
autocomplete: _propTypes["default"].string,
|
|
976
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
977
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
978
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
979
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
980
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
981
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
982
|
-
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
983
|
-
suggestions: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].array]),
|
|
984
|
-
pattern: _propTypes["default"].string,
|
|
985
|
-
length: _propTypes["default"].shape({
|
|
986
|
-
min: _propTypes["default"].number,
|
|
987
|
-
max: _propTypes["default"].number
|
|
988
|
-
}),
|
|
989
|
-
tabIndex: _propTypes["default"].number
|
|
990
|
-
};
|
|
991
769
|
var _default = DxcTextInput;
|
|
992
770
|
exports["default"] = _default;
|