@dxc-technology/halstack-react 0.0.0-9e83fd2 → 0.0.0-9f6fced
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 +1 -10
- package/BackgroundColorContext.js +4 -21
- package/HalstackContext.d.ts +53 -143
- package/HalstackContext.js +10 -35
- package/README.md +47 -0
- package/accordion/Accordion.accessibility.test.js +71 -0
- package/accordion/Accordion.js +33 -87
- package/accordion/Accordion.stories.tsx +8 -64
- package/accordion/Accordion.test.js +18 -33
- package/accordion/types.d.ts +6 -6
- package/accordion-group/AccordionGroup.accessibility.test.js +88 -0
- package/accordion-group/AccordionGroup.d.ts +2 -3
- package/accordion-group/AccordionGroup.js +17 -44
- package/accordion-group/AccordionGroup.stories.tsx +24 -24
- package/accordion-group/AccordionGroup.test.js +42 -60
- package/accordion-group/AccordionGroupAccordion.js +11 -23
- package/accordion-group/AccordionGroupContext.d.ts +3 -0
- package/accordion-group/AccordionGroupContext.js +8 -0
- package/accordion-group/types.d.ts +7 -7
- package/action-icon/ActionIcon.accessibility.test.js +63 -0
- package/action-icon/ActionIcon.d.ts +4 -0
- package/action-icon/ActionIcon.js +48 -0
- package/action-icon/ActionIcon.stories.tsx +41 -0
- package/action-icon/ActionIcon.test.js +64 -0
- package/action-icon/types.d.ts +26 -0
- package/alert/Alert.accessibility.test.js +95 -0
- package/alert/Alert.js +34 -120
- package/alert/Alert.test.js +28 -45
- package/alert/types.d.ts +5 -5
- package/badge/Badge.accessibility.test.js +129 -0
- package/badge/Badge.d.ts +1 -1
- package/badge/Badge.js +142 -42
- package/badge/Badge.stories.tsx +210 -0
- package/badge/Badge.test.js +30 -0
- package/badge/types.d.ts +52 -3
- package/bleed/Bleed.js +13 -21
- package/bleed/types.d.ts +2 -2
- package/box/Box.accessibility.test.js +33 -0
- package/box/Box.js +11 -33
- package/box/Box.test.js +1 -6
- package/box/types.d.ts +3 -3
- package/breadcrumbs/Breadcrumbs.accessibility.test.d.ts +1 -0
- package/breadcrumbs/Breadcrumbs.accessibility.test.js +96 -0
- package/breadcrumbs/Breadcrumbs.d.ts +4 -0
- package/breadcrumbs/Breadcrumbs.js +79 -0
- package/breadcrumbs/Breadcrumbs.stories.tsx +194 -0
- package/breadcrumbs/Breadcrumbs.test.d.ts +1 -0
- package/breadcrumbs/Breadcrumbs.test.js +169 -0
- package/breadcrumbs/Item.d.ts +4 -0
- package/breadcrumbs/Item.js +52 -0
- package/breadcrumbs/dropdownTheme.d.ts +53 -0
- package/breadcrumbs/dropdownTheme.js +62 -0
- package/breadcrumbs/types.d.ts +16 -0
- package/breadcrumbs/types.js +5 -0
- package/bulleted-list/BulletedList.accessibility.test.js +119 -0
- package/bulleted-list/BulletedList.js +22 -55
- package/bulleted-list/BulletedList.stories.tsx +2 -93
- package/bulleted-list/types.d.ts +5 -5
- package/button/Button.accessibility.test.js +127 -0
- package/button/Button.js +36 -59
- package/button/Button.stories.tsx +35 -135
- package/button/Button.test.js +13 -21
- package/button/types.d.ts +5 -5
- package/card/Card.accessibility.test.js +36 -0
- package/card/Card.js +23 -45
- package/card/Card.test.js +10 -21
- package/card/types.d.ts +5 -5
- package/checkbox/Checkbox.accessibility.test.js +87 -0
- package/checkbox/Checkbox.js +88 -126
- package/checkbox/Checkbox.stories.tsx +16 -54
- package/checkbox/Checkbox.test.js +107 -63
- package/checkbox/types.d.ts +8 -4
- package/chip/Chip.accessibility.test.js +67 -0
- package/chip/Chip.js +22 -36
- package/chip/Chip.stories.tsx +10 -25
- package/chip/Chip.test.js +17 -30
- package/chip/types.d.ts +4 -4
- package/common/coreTokens.d.ts +105 -14
- package/common/coreTokens.js +40 -23
- package/common/utils.js +2 -8
- package/common/variables.d.ts +54 -144
- package/common/variables.js +128 -225
- package/container/Container.d.ts +4 -0
- package/container/Container.js +194 -0
- package/container/Container.stories.tsx +214 -0
- package/container/types.d.ts +74 -0
- package/container/types.js +5 -0
- package/contextual-menu/ContextualMenu.accessibility.test.js +97 -0
- package/contextual-menu/ContextualMenu.d.ts +5 -0
- package/contextual-menu/ContextualMenu.js +88 -0
- package/contextual-menu/ContextualMenu.stories.tsx +232 -0
- package/contextual-menu/ContextualMenu.test.js +205 -0
- package/contextual-menu/GroupItem.d.ts +4 -0
- package/contextual-menu/GroupItem.js +67 -0
- package/contextual-menu/ItemAction.d.ts +4 -0
- package/contextual-menu/ItemAction.js +51 -0
- package/contextual-menu/MenuItem.d.ts +4 -0
- package/contextual-menu/MenuItem.js +29 -0
- package/contextual-menu/SingleItem.d.ts +4 -0
- package/contextual-menu/SingleItem.js +38 -0
- package/contextual-menu/types.d.ts +58 -0
- package/contextual-menu/types.js +5 -0
- package/date-input/Calendar.js +13 -57
- package/date-input/DateInput.accessibility.test.js +228 -0
- package/date-input/DateInput.js +54 -104
- package/date-input/DateInput.stories.tsx +19 -31
- package/date-input/DateInput.test.js +674 -701
- package/date-input/DatePicker.js +23 -48
- package/date-input/YearPicker.js +8 -34
- package/date-input/types.d.ts +28 -22
- package/dialog/Dialog.accessibility.test.js +69 -0
- package/dialog/Dialog.js +21 -59
- package/dialog/Dialog.stories.tsx +176 -0
- package/dialog/Dialog.test.js +126 -188
- package/dialog/types.d.ts +18 -13
- package/divider/Divider.accessibility.test.js +33 -0
- package/divider/Divider.d.ts +4 -0
- package/divider/Divider.js +36 -0
- package/divider/Divider.stories.tsx +223 -0
- package/divider/Divider.test.js +38 -0
- package/divider/types.d.ts +21 -0
- package/divider/types.js +5 -0
- package/dropdown/Dropdown.accessibility.test.js +180 -0
- package/dropdown/Dropdown.js +66 -135
- package/dropdown/Dropdown.stories.tsx +15 -26
- package/dropdown/Dropdown.test.js +402 -389
- package/dropdown/DropdownMenu.js +12 -23
- package/dropdown/DropdownMenuItem.js +13 -21
- package/dropdown/types.d.ts +20 -24
- package/file-input/FileInput.accessibility.test.js +160 -0
- package/file-input/FileInput.js +179 -286
- package/file-input/FileInput.stories.tsx +1 -1
- package/file-input/FileInput.test.js +293 -354
- package/file-input/FileItem.js +29 -66
- package/file-input/types.d.ts +9 -9
- package/flex/Flex.js +25 -39
- package/flex/types.d.ts +6 -6
- package/footer/Footer.accessibility.test.js +125 -0
- package/footer/Footer.d.ts +1 -1
- package/footer/Footer.js +43 -68
- package/footer/Footer.stories.tsx +66 -9
- package/footer/Footer.test.js +18 -32
- package/footer/Icons.d.ts +3 -2
- package/footer/Icons.js +53 -22
- package/footer/types.d.ts +17 -17
- package/grid/Grid.js +1 -16
- package/grid/types.d.ts +10 -10
- package/header/Header.accessibility.test.js +93 -0
- package/header/Header.d.ts +1 -1
- package/header/Header.js +38 -104
- package/header/Header.stories.tsx +16 -0
- package/header/Header.test.js +12 -25
- package/header/Icons.d.ts +2 -2
- package/header/Icons.js +3 -13
- package/header/types.d.ts +7 -8
- package/heading/Heading.accessibility.test.js +33 -0
- package/heading/Heading.js +9 -31
- package/heading/Heading.test.js +70 -87
- package/heading/types.d.ts +7 -7
- package/icon/Icon.accessibility.test.js +30 -0
- package/icon/Icon.d.ts +4 -0
- package/icon/Icon.js +33 -0
- package/icon/Icon.stories.tsx +28 -0
- package/icon/types.d.ts +4 -0
- package/icon/types.js +5 -0
- package/image/Image.accessibility.test.js +56 -0
- package/image/Image.d.ts +4 -0
- package/image/Image.js +70 -0
- package/image/Image.stories.tsx +129 -0
- package/image/types.d.ts +72 -0
- package/image/types.js +5 -0
- package/inset/Inset.js +13 -21
- package/inset/types.d.ts +2 -2
- package/layout/ApplicationLayout.d.ts +2 -2
- package/layout/ApplicationLayout.js +32 -69
- package/layout/ApplicationLayout.stories.tsx +1 -1
- package/layout/Icons.d.ts +7 -5
- package/layout/Icons.js +41 -59
- package/layout/types.d.ts +3 -3
- package/link/Link.accessibility.test.js +108 -0
- package/link/Link.js +28 -47
- package/link/Link.stories.tsx +4 -4
- package/link/Link.test.js +23 -41
- package/link/types.d.ts +14 -14
- package/main.d.ts +9 -4
- package/main.js +46 -59
- package/nav-tabs/NavTabs.accessibility.test.js +44 -0
- package/nav-tabs/NavTabs.d.ts +1 -2
- package/nav-tabs/NavTabs.js +19 -48
- package/nav-tabs/NavTabs.stories.tsx +30 -25
- package/nav-tabs/NavTabs.test.js +45 -50
- package/nav-tabs/NavTabsContext.d.ts +3 -0
- package/nav-tabs/NavTabsContext.js +8 -0
- package/nav-tabs/Tab.js +38 -67
- package/nav-tabs/types.d.ts +10 -10
- package/number-input/NumberInput.accessibility.test.js +228 -0
- package/number-input/NumberInput.d.ts +0 -7
- package/number-input/NumberInput.js +47 -39
- package/number-input/NumberInput.stories.tsx +42 -26
- package/number-input/NumberInput.test.js +839 -575
- package/number-input/NumberInputContext.d.ts +3 -0
- package/number-input/NumberInputContext.js +8 -0
- package/number-input/types.d.ts +17 -5
- package/package.json +42 -40
- package/paginator/Paginator.accessibility.test.js +79 -0
- package/paginator/Paginator.js +27 -52
- package/paginator/Paginator.test.js +224 -207
- package/paginator/types.d.ts +3 -3
- package/paragraph/Paragraph.accessibility.test.js +28 -0
- package/paragraph/Paragraph.js +3 -19
- package/paragraph/Paragraph.stories.tsx +0 -17
- package/password-input/PasswordInput.accessibility.test.js +153 -0
- package/password-input/PasswordInput.js +32 -54
- package/password-input/PasswordInput.stories.tsx +1 -34
- package/password-input/PasswordInput.test.js +153 -129
- package/password-input/types.d.ts +8 -7
- package/progress-bar/ProgressBar.accessibility.test.js +35 -0
- package/progress-bar/ProgressBar.js +26 -56
- package/progress-bar/{ProgressBar.stories.jsx → ProgressBar.stories.tsx} +1 -1
- package/progress-bar/ProgressBar.test.js +35 -52
- package/progress-bar/types.d.ts +3 -3
- package/quick-nav/QuickNav.accessibility.test.js +57 -0
- package/quick-nav/QuickNav.js +4 -27
- package/quick-nav/QuickNav.stories.tsx +1 -1
- package/quick-nav/types.d.ts +10 -10
- package/radio-group/Radio.d.ts +1 -1
- package/radio-group/Radio.js +22 -57
- package/radio-group/RadioGroup.accessibility.test.js +97 -0
- package/radio-group/RadioGroup.js +40 -88
- package/radio-group/RadioGroup.stories.tsx +10 -10
- package/radio-group/RadioGroup.test.js +504 -472
- package/radio-group/types.d.ts +8 -8
- package/resultset-table/Icons.d.ts +7 -0
- package/{resultsetTable → resultset-table}/Icons.js +1 -5
- package/resultset-table/ResultsetTable.accessibility.test.js +285 -0
- package/resultset-table/ResultsetTable.d.ts +7 -0
- package/{resultsetTable → resultset-table}/ResultsetTable.js +45 -69
- package/{resultsetTable → resultset-table}/ResultsetTable.stories.tsx +118 -5
- package/{resultsetTable → resultset-table}/ResultsetTable.test.js +148 -92
- package/{resultsetTable → resultset-table}/types.d.ts +44 -11
- package/resultset-table/types.js +5 -0
- package/select/Listbox.js +36 -54
- package/select/Option.js +28 -36
- package/select/Select.accessibility.test.js +228 -0
- package/select/Select.js +110 -177
- package/select/Select.stories.tsx +59 -111
- package/select/Select.test.js +1895 -1858
- package/select/types.d.ts +15 -16
- package/sidenav/Sidenav.accessibility.test.js +59 -0
- package/sidenav/Sidenav.js +44 -81
- package/sidenav/Sidenav.stories.tsx +4 -9
- package/sidenav/Sidenav.test.js +3 -10
- package/{layout → sidenav}/SidenavContext.d.ts +1 -1
- package/{layout → sidenav}/SidenavContext.js +3 -9
- package/sidenav/types.d.ts +20 -20
- package/slider/Slider.accessibility.test.js +104 -0
- package/slider/Slider.js +66 -125
- package/slider/Slider.stories.tsx +0 -60
- package/slider/Slider.test.js +107 -103
- package/slider/types.d.ts +4 -4
- package/spinner/Spinner.accessibility.test.js +96 -0
- package/spinner/Spinner.js +21 -55
- package/spinner/Spinner.test.js +25 -34
- package/spinner/types.d.ts +3 -3
- package/status-light/StatusLight.accessibility.test.js +157 -0
- package/status-light/StatusLight.d.ts +4 -0
- package/status-light/StatusLight.js +51 -0
- package/status-light/StatusLight.stories.tsx +74 -0
- package/status-light/StatusLight.test.js +25 -0
- package/status-light/types.d.ts +17 -0
- package/status-light/types.js +5 -0
- package/switch/Switch.accessibility.test.js +98 -0
- package/switch/Switch.js +49 -100
- package/switch/Switch.stories.tsx +12 -34
- package/switch/Switch.test.js +51 -96
- package/switch/types.d.ts +4 -4
- package/table/DropdownTheme.js +62 -0
- package/table/Table.accessibility.test.js +93 -0
- package/table/Table.d.ts +6 -2
- package/table/Table.js +76 -33
- package/table/{Table.stories.jsx → Table.stories.tsx} +309 -2
- package/table/Table.test.js +93 -6
- package/table/types.d.ts +34 -6
- package/tabs/Tab.js +22 -37
- package/tabs/Tabs.accessibility.test.js +56 -0
- package/tabs/Tabs.js +59 -147
- package/tabs/Tabs.stories.tsx +8 -4
- package/tabs/Tabs.test.js +57 -131
- package/tabs/types.d.ts +21 -21
- package/tag/Tag.accessibility.test.js +69 -0
- package/tag/Tag.js +27 -57
- package/tag/Tag.stories.tsx +4 -7
- package/tag/Tag.test.js +17 -36
- package/tag/types.d.ts +9 -9
- package/text-input/Suggestion.js +9 -26
- package/text-input/Suggestions.d.ts +1 -1
- package/text-input/Suggestions.js +30 -70
- package/text-input/TextInput.accessibility.test.js +321 -0
- package/text-input/TextInput.js +197 -286
- package/text-input/TextInput.stories.tsx +65 -160
- package/text-input/TextInput.test.js +1227 -1194
- package/text-input/types.d.ts +25 -17
- package/textarea/Textarea.accessibility.test.js +155 -0
- package/textarea/Textarea.js +67 -111
- package/textarea/{Textarea.stories.jsx → Textarea.stories.tsx} +58 -100
- package/textarea/Textarea.test.js +150 -179
- package/textarea/types.d.ts +9 -5
- package/toggle-group/ToggleGroup.accessibility.test.js +107 -0
- package/toggle-group/ToggleGroup.js +25 -67
- package/toggle-group/ToggleGroup.stories.tsx +7 -7
- package/toggle-group/ToggleGroup.test.js +48 -81
- package/toggle-group/types.d.ts +12 -12
- package/typography/Typography.accessibility.test.js +339 -0
- package/typography/Typography.js +4 -13
- package/typography/types.d.ts +1 -1
- package/useTheme.d.ts +51 -141
- package/useTheme.js +1 -8
- package/useTranslatedLabels.js +1 -7
- package/utils/BaseTypography.d.ts +2 -2
- package/utils/BaseTypography.js +16 -30
- package/utils/FocusLock.js +25 -39
- package/wizard/Wizard.accessibility.test.js +55 -0
- package/wizard/Wizard.js +27 -73
- package/wizard/Wizard.stories.tsx +19 -0
- package/wizard/Wizard.test.js +53 -80
- package/wizard/types.d.ts +8 -8
- package/common/OpenSans.css +0 -69
- package/common/fonts/OpenSans-Bold.ttf +0 -0
- package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
- package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
- package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
- package/common/fonts/OpenSans-Italic.ttf +0 -0
- package/common/fonts/OpenSans-Light.ttf +0 -0
- package/common/fonts/OpenSans-LightItalic.ttf +0 -0
- package/common/fonts/OpenSans-Regular.ttf +0 -0
- package/common/fonts/OpenSans-SemiBold.ttf +0 -0
- package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
- package/date-input/Icons.d.ts +0 -6
- package/date-input/Icons.js +0 -75
- package/paginator/Icons.d.ts +0 -5
- package/paginator/Icons.js +0 -54
- package/password-input/Icons.d.ts +0 -6
- package/password-input/Icons.js +0 -39
- package/resultsetTable/Icons.d.ts +0 -7
- package/resultsetTable/ResultsetTable.d.ts +0 -4
- package/select/Icons.d.ts +0 -10
- package/select/Icons.js +0 -93
- package/sidenav/Icons.d.ts +0 -7
- package/sidenav/Icons.js +0 -51
- package/text-input/Icons.d.ts +0 -8
- package/text-input/Icons.js +0 -60
- /package/{resultsetTable → action-icon}/types.js +0 -0
- /package/spinner/{Spinner.stories.jsx → Spinner.stories.tsx} +0 -0
package/text-input/TextInput.js
CHANGED
|
@@ -1,68 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports["default"] = void 0;
|
|
11
|
-
|
|
12
9
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
|
-
|
|
14
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
-
|
|
16
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
|
-
|
|
18
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
-
|
|
20
13
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
|
-
|
|
22
14
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
23
|
-
|
|
24
15
|
var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
|
|
25
|
-
|
|
26
16
|
var _variables = require("../common/variables");
|
|
27
|
-
|
|
28
17
|
var _utils = require("../common/utils");
|
|
29
|
-
|
|
30
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
31
|
-
|
|
32
|
-
var _NumberInput = require("../number-input/NumberInput");
|
|
33
|
-
|
|
34
18
|
var _Suggestions = _interopRequireDefault(require("./Suggestions"));
|
|
35
|
-
|
|
36
19
|
var Popover = _interopRequireWildcard(require("@radix-ui/react-popover"));
|
|
37
|
-
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
45
|
-
|
|
46
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
47
|
-
|
|
20
|
+
var _ActionIcon = _interopRequireDefault(require("../action-icon/ActionIcon"));
|
|
21
|
+
var _Flex = _interopRequireDefault(require("../flex/Flex"));
|
|
22
|
+
var _NumberInputContext = require("../number-input/NumberInputContext");
|
|
23
|
+
var _Icon = _interopRequireDefault(require("../icon/Icon"));
|
|
24
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
25
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
26
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
48
27
|
var sizes = {
|
|
49
28
|
small: "240px",
|
|
50
29
|
medium: "360px",
|
|
51
30
|
large: "480px",
|
|
52
31
|
fillParent: "100%"
|
|
53
32
|
};
|
|
54
|
-
|
|
55
33
|
var AutosuggestWrapper = function AutosuggestWrapper(_ref) {
|
|
56
34
|
var condition = _ref.condition,
|
|
57
|
-
|
|
58
|
-
|
|
35
|
+
wrapper = _ref.wrapper,
|
|
36
|
+
children = _ref.children;
|
|
59
37
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, condition ? wrapper(children) : children);
|
|
60
38
|
};
|
|
61
|
-
|
|
62
39
|
var calculateWidth = function calculateWidth(margin, size) {
|
|
63
40
|
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
64
41
|
};
|
|
65
|
-
|
|
66
42
|
var makeCancelable = function makeCancelable(promise) {
|
|
67
43
|
var hasCanceled_ = false;
|
|
68
44
|
var wrappedPromise = new Promise(function (resolve, reject) {
|
|
@@ -83,129 +59,124 @@ var makeCancelable = function makeCancelable(promise) {
|
|
|
83
59
|
}
|
|
84
60
|
};
|
|
85
61
|
};
|
|
86
|
-
|
|
87
62
|
var hasSuggestions = function hasSuggestions(suggestions) {
|
|
88
63
|
return typeof suggestions === "function" || (suggestions === null || suggestions === void 0 ? void 0 : suggestions.length) > 0;
|
|
89
64
|
};
|
|
90
|
-
|
|
91
65
|
var isRequired = function isRequired(value, optional) {
|
|
92
66
|
return value === "" && !optional;
|
|
93
67
|
};
|
|
94
|
-
|
|
95
68
|
var isLengthIncorrect = function isLengthIncorrect(value, minLength, maxLength) {
|
|
96
69
|
return value != null && (value.length < minLength || value.length > maxLength);
|
|
97
70
|
};
|
|
98
|
-
|
|
99
71
|
var isNumberIncorrect = function isNumberIncorrect(value, minNumber, maxNumber) {
|
|
100
72
|
return value < minNumber || value > maxNumber;
|
|
101
73
|
};
|
|
102
|
-
|
|
103
74
|
var patternMismatch = function patternMismatch(pattern, value) {
|
|
104
75
|
return pattern != null && !new RegExp(pattern).test(value);
|
|
105
76
|
};
|
|
106
|
-
|
|
77
|
+
var useWidth = function useWidth(target) {
|
|
78
|
+
var _useState = (0, _react.useState)(0),
|
|
79
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
80
|
+
width = _useState2[0],
|
|
81
|
+
setWidth = _useState2[1];
|
|
82
|
+
(0, _react.useEffect)(function () {
|
|
83
|
+
if (target != null) {
|
|
84
|
+
setWidth(target.getBoundingClientRect().width);
|
|
85
|
+
var triggerObserver = new ResizeObserver(function (entries) {
|
|
86
|
+
var rect = entries[0].target.getBoundingClientRect();
|
|
87
|
+
setWidth(rect === null || rect === void 0 ? void 0 : rect.width);
|
|
88
|
+
});
|
|
89
|
+
triggerObserver.observe(target);
|
|
90
|
+
return function () {
|
|
91
|
+
triggerObserver.unobserve(target);
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}, [target]);
|
|
95
|
+
return width;
|
|
96
|
+
};
|
|
107
97
|
var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, ref) {
|
|
108
98
|
var label = _ref2.label,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
inputId = _useState2[0];
|
|
146
|
-
|
|
99
|
+
_ref2$name = _ref2.name,
|
|
100
|
+
name = _ref2$name === void 0 ? "" : _ref2$name,
|
|
101
|
+
_ref2$defaultValue = _ref2.defaultValue,
|
|
102
|
+
defaultValue = _ref2$defaultValue === void 0 ? "" : _ref2$defaultValue,
|
|
103
|
+
value = _ref2.value,
|
|
104
|
+
helperText = _ref2.helperText,
|
|
105
|
+
_ref2$placeholder = _ref2.placeholder,
|
|
106
|
+
placeholder = _ref2$placeholder === void 0 ? "" : _ref2$placeholder,
|
|
107
|
+
action = _ref2.action,
|
|
108
|
+
_ref2$clearable = _ref2.clearable,
|
|
109
|
+
clearable = _ref2$clearable === void 0 ? false : _ref2$clearable,
|
|
110
|
+
_ref2$disabled = _ref2.disabled,
|
|
111
|
+
disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
|
|
112
|
+
_ref2$readOnly = _ref2.readOnly,
|
|
113
|
+
readOnly = _ref2$readOnly === void 0 ? false : _ref2$readOnly,
|
|
114
|
+
_ref2$optional = _ref2.optional,
|
|
115
|
+
optional = _ref2$optional === void 0 ? false : _ref2$optional,
|
|
116
|
+
_ref2$prefix = _ref2.prefix,
|
|
117
|
+
prefix = _ref2$prefix === void 0 ? "" : _ref2$prefix,
|
|
118
|
+
_ref2$suffix = _ref2.suffix,
|
|
119
|
+
suffix = _ref2$suffix === void 0 ? "" : _ref2$suffix,
|
|
120
|
+
onChange = _ref2.onChange,
|
|
121
|
+
onBlur = _ref2.onBlur,
|
|
122
|
+
error = _ref2.error,
|
|
123
|
+
suggestions = _ref2.suggestions,
|
|
124
|
+
pattern = _ref2.pattern,
|
|
125
|
+
minLength = _ref2.minLength,
|
|
126
|
+
maxLength = _ref2.maxLength,
|
|
127
|
+
_ref2$autocomplete = _ref2.autocomplete,
|
|
128
|
+
autocomplete = _ref2$autocomplete === void 0 ? "off" : _ref2$autocomplete,
|
|
129
|
+
margin = _ref2.margin,
|
|
130
|
+
_ref2$size = _ref2.size,
|
|
131
|
+
size = _ref2$size === void 0 ? "medium" : _ref2$size,
|
|
132
|
+
_ref2$tabIndex = _ref2.tabIndex,
|
|
133
|
+
tabIndex = _ref2$tabIndex === void 0 ? 0 : _ref2$tabIndex;
|
|
134
|
+
var inputId = "input-".concat((0, _react.useId)());
|
|
147
135
|
var autosuggestId = "suggestions-".concat(inputId);
|
|
148
136
|
var errorId = "error-".concat(inputId);
|
|
149
|
-
|
|
150
137
|
var _useState3 = (0, _react.useState)(defaultValue),
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
138
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
139
|
+
innerValue = _useState4[0],
|
|
140
|
+
setInnerValue = _useState4[1];
|
|
155
141
|
var _useState5 = (0, _react.useState)(false),
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
142
|
+
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
143
|
+
isOpen = _useState6[0],
|
|
144
|
+
changeIsOpen = _useState6[1];
|
|
160
145
|
var _useState7 = (0, _react.useState)(false),
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
146
|
+
_useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
|
|
147
|
+
isSearching = _useState8[0],
|
|
148
|
+
changeIsSearching = _useState8[1];
|
|
165
149
|
var _useState9 = (0, _react.useState)(false),
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
150
|
+
_useState10 = (0, _slicedToArray2["default"])(_useState9, 2),
|
|
151
|
+
isAutosuggestError = _useState10[0],
|
|
152
|
+
changeIsAutosuggestError = _useState10[1];
|
|
170
153
|
var _useState11 = (0, _react.useState)([]),
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
154
|
+
_useState12 = (0, _slicedToArray2["default"])(_useState11, 2),
|
|
155
|
+
filteredSuggestions = _useState12[0],
|
|
156
|
+
changeFilteredSuggestions = _useState12[1];
|
|
175
157
|
var _useState13 = (0, _react.useState)(-1),
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
158
|
+
_useState14 = (0, _slicedToArray2["default"])(_useState13, 2),
|
|
159
|
+
visualFocusIndex = _useState14[0],
|
|
160
|
+
changeVisualFocusIndex = _useState14[1];
|
|
180
161
|
var inputRef = (0, _react.useRef)(null);
|
|
162
|
+
var inputContainerRef = (0, _react.useRef)(null);
|
|
181
163
|
var actionRef = (0, _react.useRef)(null);
|
|
164
|
+
var width = useWidth(inputContainerRef.current);
|
|
182
165
|
var colorsTheme = (0, _useTheme["default"])();
|
|
183
166
|
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
184
|
-
var
|
|
185
|
-
var numberInputContext = (0, _react.useContext)(_NumberInput.NumberInputContext);
|
|
186
|
-
|
|
167
|
+
var numberInputContext = (0, _react.useContext)(_NumberInputContext.NumberInputContext);
|
|
187
168
|
var getNumberErrorMessage = function getNumberErrorMessage(value) {
|
|
188
169
|
if (value < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) return translatedLabels.numberInput.valueGreaterThanOrEqualToErrorMessage(numberInputContext.minNumber);else if (value > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) return translatedLabels.numberInput.valueLessThanOrEqualToErrorMessage(numberInputContext.maxNumber);
|
|
189
170
|
};
|
|
190
|
-
|
|
191
|
-
var getTextInputWidth = (0, _react.useCallback)(function () {
|
|
192
|
-
var _inputRef$current, _inputRef$current$par;
|
|
193
|
-
|
|
194
|
-
var rect = inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : (_inputRef$current$par = _inputRef$current.parentElement) === null || _inputRef$current$par === void 0 ? void 0 : _inputRef$current$par.getBoundingClientRect();
|
|
195
|
-
return rect === null || rect === void 0 ? void 0 : rect.width;
|
|
196
|
-
}, []);
|
|
197
|
-
|
|
198
171
|
var openSuggestions = function openSuggestions() {
|
|
199
172
|
hasSuggestions(suggestions) && changeIsOpen(true);
|
|
200
173
|
};
|
|
201
|
-
|
|
202
174
|
var closeSuggestions = function closeSuggestions() {
|
|
203
175
|
if (hasSuggestions(suggestions)) {
|
|
204
176
|
changeIsOpen(false);
|
|
205
177
|
changeVisualFocusIndex(-1);
|
|
206
178
|
}
|
|
207
179
|
};
|
|
208
|
-
|
|
209
180
|
var changeValue = function changeValue(newValue) {
|
|
210
181
|
var formattedValue = typeof newValue === "number" ? newValue.toString() : newValue;
|
|
211
182
|
value !== null && value !== void 0 ? value : setInnerValue(formattedValue);
|
|
@@ -225,21 +196,41 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
225
196
|
value: formattedValue
|
|
226
197
|
});
|
|
227
198
|
};
|
|
228
|
-
|
|
199
|
+
var decrementNumber = function decrementNumber() {
|
|
200
|
+
var currentValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : value !== null && value !== void 0 ? value : innerValue;
|
|
201
|
+
if (!disabled && !readOnly) {
|
|
202
|
+
var numberValue = Number(currentValue);
|
|
203
|
+
var steppedValue = Math.round((numberValue - (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) + Number.EPSILON) * 100) / 100;
|
|
204
|
+
if (currentValue !== "") {
|
|
205
|
+
if (numberValue < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) || steppedValue < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) changeValue(numberValue);else if (numberValue > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);else if (numberValue === (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);else changeValue(steppedValue);
|
|
206
|
+
} else {
|
|
207
|
+
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) >= 0) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);else if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) < 0) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);else changeValue(-numberInputContext.stepNumber);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
var incrementNumber = function incrementNumber() {
|
|
212
|
+
var currentValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : value !== null && value !== void 0 ? value : innerValue;
|
|
213
|
+
if (!disabled && !readOnly) {
|
|
214
|
+
var numberValue = Number(currentValue);
|
|
215
|
+
var steppedValue = Math.round((numberValue + (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) + Number.EPSILON) * 100) / 100;
|
|
216
|
+
if (currentValue !== "") {
|
|
217
|
+
if (numberValue > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) || steppedValue > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) changeValue(numberValue);else if (numberValue < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);else if (numberValue === (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);else changeValue(steppedValue);
|
|
218
|
+
} else {
|
|
219
|
+
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) > 0) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);else if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) <= 0) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);else changeValue(numberInputContext.stepNumber);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
};
|
|
229
223
|
var handleInputContainerOnClick = function handleInputContainerOnClick() {
|
|
230
224
|
document.activeElement !== actionRef.current && inputRef.current.focus();
|
|
231
225
|
};
|
|
232
|
-
|
|
233
226
|
var handleInputContainerOnMouseDown = function handleInputContainerOnMouseDown(event) {
|
|
234
227
|
// Avoid input to lose the focus when the container is pressed
|
|
235
228
|
document.activeElement === inputRef.current && event.preventDefault();
|
|
236
229
|
};
|
|
237
|
-
|
|
238
230
|
var handleInputOnChange = function handleInputOnChange(event) {
|
|
239
231
|
openSuggestions();
|
|
240
232
|
changeValue(event.target.value);
|
|
241
233
|
};
|
|
242
|
-
|
|
243
234
|
var handleInputOnBlur = function handleInputOnBlur(event) {
|
|
244
235
|
closeSuggestions();
|
|
245
236
|
if (isRequired(event.target.value, optional)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
@@ -258,116 +249,72 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
258
249
|
value: event.target.value
|
|
259
250
|
});
|
|
260
251
|
};
|
|
261
|
-
|
|
262
252
|
var handleInputOnKeyDown = function handleInputOnKeyDown(event) {
|
|
263
253
|
switch (event.key) {
|
|
264
254
|
case "Down":
|
|
265
255
|
case "ArrowDown":
|
|
266
256
|
event.preventDefault();
|
|
267
|
-
|
|
268
|
-
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number") {
|
|
269
|
-
decrementNumber();
|
|
270
|
-
} else {
|
|
257
|
+
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number") decrementNumber();else {
|
|
271
258
|
openSuggestions();
|
|
272
|
-
|
|
273
259
|
if (!isAutosuggestError && !isSearching && filteredSuggestions.length > 0) {
|
|
274
260
|
changeVisualFocusIndex(function (visualFocusedSuggIndex) {
|
|
275
261
|
if (visualFocusedSuggIndex < filteredSuggestions.length - 1) return visualFocusedSuggIndex + 1;else if (visualFocusedSuggIndex === filteredSuggestions.length - 1) return 0;
|
|
276
262
|
});
|
|
277
263
|
}
|
|
278
264
|
}
|
|
279
|
-
|
|
280
265
|
break;
|
|
281
|
-
|
|
282
266
|
case "Up":
|
|
283
267
|
case "ArrowUp":
|
|
284
268
|
event.preventDefault();
|
|
285
|
-
|
|
286
|
-
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number") {
|
|
287
|
-
incrementNumber();
|
|
288
|
-
} else {
|
|
269
|
+
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number") incrementNumber();else {
|
|
289
270
|
openSuggestions();
|
|
290
|
-
|
|
291
271
|
if (!isAutosuggestError && !isSearching && filteredSuggestions.length > 0) {
|
|
292
272
|
changeVisualFocusIndex(function (visualFocusedSuggIndex) {
|
|
293
273
|
if (visualFocusedSuggIndex === 0 || visualFocusedSuggIndex === -1) return filteredSuggestions.length > 0 ? filteredSuggestions.length - 1 : suggestions.length - 1;else return visualFocusedSuggIndex - 1;
|
|
294
274
|
});
|
|
295
275
|
}
|
|
296
276
|
}
|
|
297
|
-
|
|
298
277
|
break;
|
|
299
|
-
|
|
300
278
|
case "Esc":
|
|
301
279
|
case "Escape":
|
|
302
280
|
event.preventDefault();
|
|
303
|
-
|
|
304
281
|
if (hasSuggestions(suggestions)) {
|
|
305
282
|
changeValue("");
|
|
306
283
|
isOpen && closeSuggestions();
|
|
307
284
|
}
|
|
308
|
-
|
|
309
285
|
break;
|
|
310
|
-
|
|
311
286
|
case "Enter":
|
|
312
287
|
if (hasSuggestions(suggestions) && !isSearching) {
|
|
313
288
|
var validFocusedSuggestion = filteredSuggestions.length > 0 && visualFocusIndex >= 0 && visualFocusIndex < filteredSuggestions.length;
|
|
314
289
|
validFocusedSuggestion && changeValue(filteredSuggestions[visualFocusIndex]);
|
|
315
290
|
isOpen && closeSuggestions();
|
|
316
291
|
}
|
|
317
|
-
|
|
318
292
|
break;
|
|
319
293
|
}
|
|
320
294
|
};
|
|
321
|
-
|
|
295
|
+
var handleNumberInputWheel = function handleNumberInputWheel(event) {
|
|
296
|
+
if (document.activeElement === inputRef.current) event.deltaY < 0 ? incrementNumber(inputRef.current.value) : decrementNumber(inputRef.current.value);
|
|
297
|
+
};
|
|
322
298
|
var handleClearActionOnClick = function handleClearActionOnClick() {
|
|
323
299
|
changeValue("");
|
|
324
300
|
inputRef.current.focus();
|
|
325
301
|
suggestions && closeSuggestions();
|
|
326
302
|
};
|
|
327
|
-
|
|
328
303
|
var handleDecrementActionOnClick = function handleDecrementActionOnClick() {
|
|
329
304
|
decrementNumber();
|
|
330
305
|
inputRef.current.focus();
|
|
331
306
|
};
|
|
332
|
-
|
|
333
307
|
var handleIncrementActionOnClick = function handleIncrementActionOnClick() {
|
|
334
308
|
incrementNumber();
|
|
335
309
|
inputRef.current.focus();
|
|
336
310
|
};
|
|
337
|
-
|
|
338
311
|
var setNumberProps = function setNumberProps(type, min, max, step) {
|
|
339
|
-
var _inputRef$
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.setAttribute("
|
|
344
|
-
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current5 = inputRef.current) === null || _inputRef$current5 === void 0 ? void 0 : _inputRef$current5.setAttribute("type", type);
|
|
345
|
-
};
|
|
346
|
-
|
|
347
|
-
var decrementNumber = function decrementNumber() {
|
|
348
|
-
var currentValue = value !== null && value !== void 0 ? value : innerValue;
|
|
349
|
-
var numberValue = Number(currentValue);
|
|
350
|
-
var steppedValue = Math.round((numberValue - (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) + Number.EPSILON) * 100) / 100;
|
|
351
|
-
|
|
352
|
-
if (currentValue !== "") {
|
|
353
|
-
if (numberValue < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) || steppedValue < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) changeValue(numberValue);else if (numberValue > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);else if (numberValue === (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);else changeValue(steppedValue);
|
|
354
|
-
} else {
|
|
355
|
-
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) >= 0) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);else if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) < 0) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);else changeValue(-numberInputContext.stepNumber);
|
|
356
|
-
}
|
|
357
|
-
};
|
|
358
|
-
|
|
359
|
-
var incrementNumber = function incrementNumber() {
|
|
360
|
-
var currentValue = value !== null && value !== void 0 ? value : innerValue;
|
|
361
|
-
var numberValue = Number(currentValue);
|
|
362
|
-
var steppedValue = Math.round((numberValue + (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) + Number.EPSILON) * 100) / 100;
|
|
363
|
-
|
|
364
|
-
if (currentValue !== "") {
|
|
365
|
-
if (numberValue > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) || steppedValue > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) changeValue(numberValue);else if (numberValue < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);else if (numberValue === (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);else changeValue(steppedValue);
|
|
366
|
-
} else {
|
|
367
|
-
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) > 0) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);else if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) <= 0) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);else changeValue(numberInputContext.stepNumber);
|
|
368
|
-
}
|
|
312
|
+
var _inputRef$current, _inputRef$current2, _inputRef$current3, _inputRef$current4;
|
|
313
|
+
min && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.setAttribute("min", min));
|
|
314
|
+
max && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.setAttribute("max", max));
|
|
315
|
+
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.setAttribute("step", step);
|
|
316
|
+
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.setAttribute("type", type);
|
|
369
317
|
};
|
|
370
|
-
|
|
371
318
|
(0, _react.useEffect)(function () {
|
|
372
319
|
if (typeof suggestions === "function") {
|
|
373
320
|
changeIsSearching(true);
|
|
@@ -393,7 +340,6 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
393
340
|
}));
|
|
394
341
|
changeVisualFocusIndex(-1);
|
|
395
342
|
}
|
|
396
|
-
|
|
397
343
|
numberInputContext != null && setNumberProps(numberInputContext.typeNumber, numberInputContext.minNumber, numberInputContext.maxNumber, numberInputContext.stepNumber);
|
|
398
344
|
}, [value, innerValue, suggestions, numberInputContext]);
|
|
399
345
|
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
@@ -405,30 +351,25 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
405
351
|
}, label && /*#__PURE__*/_react["default"].createElement(Label, {
|
|
406
352
|
htmlFor: inputId,
|
|
407
353
|
disabled: disabled,
|
|
408
|
-
backgroundType: backgroundType,
|
|
409
354
|
hasHelperText: helperText ? true : false
|
|
410
355
|
}, label, " ", optional && /*#__PURE__*/_react["default"].createElement(OptionalLabel, null, translatedLabels.formFields.optionalLabel)), helperText && /*#__PURE__*/_react["default"].createElement(HelperText, {
|
|
411
|
-
disabled: disabled
|
|
412
|
-
|
|
413
|
-
}, helperText), /*#__PURE__*/_react["default"].createElement(InputContainer, {
|
|
414
|
-
error: error ? true : false,
|
|
415
|
-
disabled: disabled,
|
|
416
|
-
backgroundType: backgroundType,
|
|
417
|
-
onClick: handleInputContainerOnClick,
|
|
418
|
-
onMouseDown: handleInputContainerOnMouseDown
|
|
419
|
-
}, prefix && /*#__PURE__*/_react["default"].createElement(Prefix, {
|
|
420
|
-
disabled: disabled,
|
|
421
|
-
backgroundType: backgroundType
|
|
422
|
-
}, prefix), /*#__PURE__*/_react["default"].createElement(AutosuggestWrapper, {
|
|
356
|
+
disabled: disabled
|
|
357
|
+
}, helperText), /*#__PURE__*/_react["default"].createElement(AutosuggestWrapper, {
|
|
423
358
|
condition: hasSuggestions(suggestions),
|
|
424
359
|
wrapper: function wrapper(children) {
|
|
425
360
|
return /*#__PURE__*/_react["default"].createElement(Popover.Root, {
|
|
426
361
|
open: isOpen && (filteredSuggestions.length > 0 || isSearching || isAutosuggestError)
|
|
427
362
|
}, /*#__PURE__*/_react["default"].createElement(Popover.Trigger, {
|
|
428
363
|
asChild: true,
|
|
429
|
-
|
|
430
|
-
|
|
364
|
+
type: undefined,
|
|
365
|
+
"aria-controls": undefined,
|
|
366
|
+
"aria-haspopup": undefined,
|
|
367
|
+
"aria-expanded": undefined
|
|
368
|
+
}, children), /*#__PURE__*/_react["default"].createElement(Popover.Portal, null, /*#__PURE__*/_react["default"].createElement(Popover.Content, {
|
|
431
369
|
sideOffset: 5,
|
|
370
|
+
style: {
|
|
371
|
+
zIndex: "2147483647"
|
|
372
|
+
},
|
|
432
373
|
onOpenAutoFocus: function onOpenAutoFocus(event) {
|
|
433
374
|
// Avoid select to lose focus when the list is opened
|
|
434
375
|
event.preventDefault();
|
|
@@ -449,9 +390,24 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
449
390
|
changeValue(suggestion);
|
|
450
391
|
closeSuggestions();
|
|
451
392
|
},
|
|
452
|
-
|
|
453
|
-
|
|
393
|
+
styles: {
|
|
394
|
+
width: width
|
|
395
|
+
}
|
|
396
|
+
}))));
|
|
454
397
|
}
|
|
398
|
+
}, /*#__PURE__*/_react["default"].createElement(InputContainer, {
|
|
399
|
+
error: error ? true : false,
|
|
400
|
+
disabled: disabled,
|
|
401
|
+
readOnly: readOnly,
|
|
402
|
+
onClick: handleInputContainerOnClick,
|
|
403
|
+
onMouseDown: handleInputContainerOnMouseDown,
|
|
404
|
+
ref: inputContainerRef
|
|
405
|
+
}, prefix && /*#__PURE__*/_react["default"].createElement(Prefix, {
|
|
406
|
+
disabled: disabled
|
|
407
|
+
}, prefix), /*#__PURE__*/_react["default"].createElement(_Flex["default"], {
|
|
408
|
+
gap: "0.25rem",
|
|
409
|
+
alignItems: "center",
|
|
410
|
+
grow: 1
|
|
455
411
|
}, /*#__PURE__*/_react["default"].createElement(Input, {
|
|
456
412
|
id: inputId,
|
|
457
413
|
name: name,
|
|
@@ -459,14 +415,15 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
459
415
|
placeholder: placeholder,
|
|
460
416
|
onBlur: handleInputOnBlur,
|
|
461
417
|
onChange: handleInputOnChange,
|
|
462
|
-
onFocus: openSuggestions,
|
|
463
|
-
onKeyDown: handleInputOnKeyDown,
|
|
418
|
+
onFocus: !readOnly ? openSuggestions : undefined,
|
|
419
|
+
onKeyDown: !readOnly ? handleInputOnKeyDown : undefined,
|
|
464
420
|
onMouseDown: function onMouseDown(event) {
|
|
465
421
|
event.stopPropagation();
|
|
466
422
|
},
|
|
423
|
+
onWheel: (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" ? handleNumberInputWheel : undefined,
|
|
467
424
|
disabled: disabled,
|
|
425
|
+
readOnly: readOnly,
|
|
468
426
|
ref: inputRef,
|
|
469
|
-
backgroundType: backgroundType,
|
|
470
427
|
pattern: pattern,
|
|
471
428
|
minLength: minLength,
|
|
472
429
|
maxLength: maxLength,
|
|
@@ -481,68 +438,45 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
481
438
|
"aria-activedescendant": hasSuggestions(suggestions) && isOpen && visualFocusIndex !== -1 ? "suggestion-".concat(visualFocusIndex) : undefined,
|
|
482
439
|
"aria-invalid": error ? true : false,
|
|
483
440
|
"aria-errormessage": error ? errorId : undefined,
|
|
484
|
-
"aria-required":
|
|
485
|
-
})
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
441
|
+
"aria-required": !disabled && !optional
|
|
442
|
+
}), !disabled && error && /*#__PURE__*/_react["default"].createElement(ErrorIcon, {
|
|
443
|
+
"aria-hidden": "true"
|
|
444
|
+
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
445
|
+
icon: "filled_error"
|
|
446
|
+
})), !disabled && !readOnly && clearable && (value !== null && value !== void 0 ? value : innerValue).length > 0 && /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
|
|
490
447
|
onClick: handleClearActionOnClick,
|
|
491
|
-
|
|
492
|
-
event.stopPropagation();
|
|
493
|
-
},
|
|
448
|
+
icon: "close",
|
|
494
449
|
tabIndex: tabIndex,
|
|
495
|
-
title: translatedLabels.textInput.clearFieldActionTitle
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
"aria-label": translatedLabels.numberInput.decrementValueTitle,
|
|
500
|
-
disabled: disabled,
|
|
501
|
-
onClick: handleDecrementActionOnClick,
|
|
502
|
-
onMouseDown: function onMouseDown(event) {
|
|
503
|
-
event.stopPropagation();
|
|
504
|
-
},
|
|
505
|
-
ref: actionRef,
|
|
450
|
+
title: translatedLabels.textInput.clearFieldActionTitle
|
|
451
|
+
}), (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
|
|
452
|
+
onClick: !readOnly ? handleDecrementActionOnClick : undefined,
|
|
453
|
+
icon: "remove",
|
|
506
454
|
tabIndex: tabIndex,
|
|
507
|
-
title: translatedLabels.numberInput.decrementValueTitle,
|
|
508
|
-
type: "button",
|
|
509
|
-
backgroundType: backgroundType
|
|
510
|
-
}, _Icons["default"].decrement), /*#__PURE__*/_react["default"].createElement(Action, {
|
|
511
|
-
"aria-label": translatedLabels.numberInput.incrementValueTitle,
|
|
512
|
-
disabled: disabled,
|
|
513
|
-
onClick: handleIncrementActionOnClick,
|
|
514
|
-
onMouseDown: function onMouseDown(event) {
|
|
515
|
-
event.stopPropagation();
|
|
516
|
-
},
|
|
517
455
|
ref: actionRef,
|
|
456
|
+
title: translatedLabels.numberInput.decrementValueTitle,
|
|
457
|
+
disabled: disabled
|
|
458
|
+
}), /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
|
|
459
|
+
onClick: !readOnly ? handleIncrementActionOnClick : undefined,
|
|
460
|
+
icon: "add",
|
|
518
461
|
tabIndex: tabIndex,
|
|
519
|
-
title: translatedLabels.numberInput.incrementValueTitle,
|
|
520
|
-
type: "button",
|
|
521
|
-
backgroundType: backgroundType
|
|
522
|
-
}, _Icons["default"].increment)), action && /*#__PURE__*/_react["default"].createElement(Action, {
|
|
523
|
-
"aria-label": action.title,
|
|
524
|
-
disabled: disabled,
|
|
525
|
-
onClick: action.onClick,
|
|
526
|
-
onMouseDown: function onMouseDown(event) {
|
|
527
|
-
event.stopPropagation();
|
|
528
|
-
},
|
|
529
462
|
ref: actionRef,
|
|
463
|
+
title: translatedLabels.numberInput.incrementValueTitle,
|
|
464
|
+
disabled: disabled
|
|
465
|
+
})), action && /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
|
|
466
|
+
onClick: !readOnly ? action.onClick : undefined,
|
|
467
|
+
icon: action.icon,
|
|
530
468
|
tabIndex: tabIndex,
|
|
469
|
+
ref: actionRef,
|
|
531
470
|
title: action.title,
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
}) : action.icon), suffix && /*#__PURE__*/_react["default"].createElement(Suffix, {
|
|
537
|
-
disabled: disabled,
|
|
538
|
-
backgroundType: backgroundType
|
|
539
|
-
}, suffix)), !disabled && typeof error === "string" && /*#__PURE__*/_react["default"].createElement(Error, {
|
|
471
|
+
disabled: disabled
|
|
472
|
+
})), suffix && /*#__PURE__*/_react["default"].createElement(Suffix, {
|
|
473
|
+
disabled: disabled
|
|
474
|
+
}, suffix))), !disabled && typeof error === "string" && /*#__PURE__*/_react["default"].createElement(Error, {
|
|
540
475
|
id: errorId,
|
|
541
|
-
|
|
476
|
+
role: "alert",
|
|
542
477
|
"aria-live": error ? "assertive" : "off"
|
|
543
478
|
}, error)));
|
|
544
479
|
});
|
|
545
|
-
|
|
546
480
|
var TextInputContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
547
481
|
return calculateWidth(props.margin, props.size);
|
|
548
482
|
}, function (props) {
|
|
@@ -556,9 +490,8 @@ var TextInputContainer = _styledComponents["default"].div(_templateObject || (_t
|
|
|
556
490
|
}, function (props) {
|
|
557
491
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
558
492
|
});
|
|
559
|
-
|
|
560
493
|
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) {
|
|
561
|
-
return props.disabled ? props.
|
|
494
|
+
return props.disabled ? props.theme.disabledLabelFontColor : props.theme.labelFontColor;
|
|
562
495
|
}, function (props) {
|
|
563
496
|
return props.theme.fontFamily;
|
|
564
497
|
}, function (props) {
|
|
@@ -572,13 +505,11 @@ var Label = _styledComponents["default"].label(_templateObject2 || (_templateObj
|
|
|
572
505
|
}, function (props) {
|
|
573
506
|
return !props.hasHelperText && "margin-bottom: 0.25rem";
|
|
574
507
|
});
|
|
575
|
-
|
|
576
508
|
var OptionalLabel = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n font-weight: ", ";\n"])), function (props) {
|
|
577
509
|
return props.theme.optionalLabelFontWeight;
|
|
578
510
|
});
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledHelperTextFontColorOnDark : props.theme.disabledHelperTextFontColor : props.backgroundType === "dark" ? props.theme.helperTextFontColorOnDark : props.theme.helperTextFontColor;
|
|
511
|
+
var HelperText = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-bottom: 0.25rem;\n"])), function (props) {
|
|
512
|
+
return props.disabled ? props.theme.disabledHelperTextFontColor : props.theme.helperTextFontColor;
|
|
582
513
|
}, function (props) {
|
|
583
514
|
return props.theme.fontFamily;
|
|
584
515
|
}, function (props) {
|
|
@@ -590,21 +521,17 @@ var HelperText = _styledComponents["default"].span(_templateObject4 || (_templat
|
|
|
590
521
|
}, function (props) {
|
|
591
522
|
return props.theme.helperTextLineHeight;
|
|
592
523
|
});
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
if (props.disabled) return props.backgroundType === "dark" ? "background-color: ".concat(props.theme.disabledContainerFillColorOnDark, ";") : "background-color: ".concat(props.theme.disabledContainerFillColor, ";");
|
|
524
|
+
var InputContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n display: flex;\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"])), function (props) {
|
|
525
|
+
if (props.disabled) return "background-color: ".concat(props.theme.disabledContainerFillColor, ";");
|
|
596
526
|
}, function (props) {
|
|
597
|
-
if (props.disabled) return props.
|
|
527
|
+
if (props.disabled) return props.theme.disabledBorderColor;else if (props.readOnly) return props.theme.readOnlyBorderColor;else return props.theme.enabledBorderColor;
|
|
598
528
|
}, function (props) {
|
|
599
|
-
return props.error && !props.disabled && "border-color: transparent;\n box-shadow: 0 0 0 2px ".concat(props.
|
|
529
|
+
return props.error && !props.disabled && "border-color: transparent;\n box-shadow: 0 0 0 2px ".concat(props.theme.errorBorderColor, ";\n ");
|
|
600
530
|
}, function (props) {
|
|
601
|
-
return props.disabled
|
|
602
|
-
}, function (props) {
|
|
603
|
-
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 ");
|
|
531
|
+
return !props.disabled ? "\n &:hover {\n border-color: ".concat(props.error ? "transparent" : props.readOnly ? props.theme.hoverReadOnlyBorderColor : props.theme.hoverBorderColor, ";\n ").concat(props.error ? "box-shadow: 0 0 0 2px ".concat(props.theme.hoverErrorBorderColor, ";") : "", "\n }\n &:focus-within {\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(props.theme.focusBorderColor, ";\n }\n ") : "cursor: not-allowed;";
|
|
604
532
|
});
|
|
605
|
-
|
|
606
533
|
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) {
|
|
607
|
-
return props.disabled ? props.
|
|
534
|
+
return props.disabled ? props.theme.disabledValueFontColor : props.theme.valueFontColor;
|
|
608
535
|
}, function (props) {
|
|
609
536
|
return props.theme.fontFamily;
|
|
610
537
|
}, function (props) {
|
|
@@ -616,42 +543,26 @@ var Input = _styledComponents["default"].input(_templateObject6 || (_templateObj
|
|
|
616
543
|
}, function (props) {
|
|
617
544
|
return props.disabled && "cursor: not-allowed;";
|
|
618
545
|
}, function (props) {
|
|
619
|
-
return props.disabled ? props.
|
|
620
|
-
});
|
|
621
|
-
|
|
622
|
-
var Action = _styledComponents["default"].button(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n border: 1px solid transparent;\n border-radius: 2px;\n width: 24px;\n height: 24px;\n padding: 3px;\n margin-left: 0.25rem;\n ", "\n\n box-shadow: 0 0 0 2px transparent;\n background-color: ", ";\n\n color: ", ";\n\n ", "\n\n img, svg {\n width: 16px;\n height: 16px;\n }\n"])), function (props) {
|
|
623
|
-
return props.disabled ? "cursor: not-allowed;" : "cursor: pointer;";
|
|
624
|
-
}, function (props) {
|
|
625
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledActionBackgroundColorOnDark : props.theme.disabledActionBackgroundColor : props.backgroundType === "dark" ? props.theme.actionBackgroundColorOnDark : props.theme.actionBackgroundColor;
|
|
626
|
-
}, function (props) {
|
|
627
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledActionIconColorOnDark : props.theme.disabledActionIconColor : props.backgroundType === "dark" ? props.theme.actionIconColorOnDark : props.theme.actionIconColor;
|
|
628
|
-
}, function (props) {
|
|
629
|
-
return !props.disabled && "\n &:focus, \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 ");
|
|
546
|
+
return props.disabled ? props.theme.disabledPlaceholderFontColor : props.theme.placeholderFontColor;
|
|
630
547
|
});
|
|
631
|
-
|
|
632
|
-
var
|
|
633
|
-
var color = props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPrefixColorOnDark : props.theme.disabledPrefixColor : props.backgroundType === "dark" ? props.theme.prefixColorOnDark : props.theme.prefixColor;
|
|
548
|
+
var Prefix = _styledComponents["default"].span(_templateObject7 || (_templateObject7 = (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) {
|
|
549
|
+
var color = props.disabled ? props.theme.disabledPrefixColor : props.theme.prefixColor;
|
|
634
550
|
return "color: ".concat(color, "; border-right: 1px solid ").concat(color, ";");
|
|
635
551
|
}, function (props) {
|
|
636
552
|
return props.theme.fontFamily;
|
|
637
553
|
});
|
|
638
|
-
|
|
639
|
-
var
|
|
640
|
-
var color = props.disabled ? props.backgroundType === "dark" ? props.theme.disabledSuffixColorOnDark : props.theme.disabledSuffixColor : props.backgroundType === "dark" ? props.theme.suffixColorOnDark : props.theme.suffixColor;
|
|
554
|
+
var Suffix = _styledComponents["default"].span(_templateObject8 || (_templateObject8 = (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) {
|
|
555
|
+
var color = props.disabled ? props.theme.disabledSuffixColor : props.theme.suffixColor;
|
|
641
556
|
return "color: ".concat(color, "; border-left: 1px solid ").concat(color, ";");
|
|
642
557
|
}, function (props) {
|
|
643
558
|
return props.theme.fontFamily;
|
|
644
559
|
});
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
return props.backgroundType === "dark" ? props.theme.errorIconColorOnDark : props.theme.errorIconColor;
|
|
560
|
+
var ErrorIcon = _styledComponents["default"].span(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n padding: 3px;\n height: 18px;\n width: 18px;\n font-size: 18px;\n color: ", ";\n\n svg {\n line-height: 18px;\n font-size: 1.25rem;\n }\n"])), function (props) {
|
|
561
|
+
return props.theme.errorIconColor;
|
|
648
562
|
});
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
return props.backgroundType === "dark" ? props.theme.errorMessageColorOnDark : props.theme.errorMessageColor;
|
|
563
|
+
var Error = _styledComponents["default"].span(_templateObject10 || (_templateObject10 = (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) {
|
|
564
|
+
return props.theme.errorMessageColor;
|
|
652
565
|
}, function (props) {
|
|
653
566
|
return props.theme.fontFamily;
|
|
654
567
|
});
|
|
655
|
-
|
|
656
|
-
var _default = DxcTextInput;
|
|
657
|
-
exports["default"] = _default;
|
|
568
|
+
var _default = exports["default"] = DxcTextInput;
|