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