@dxc-technology/halstack-react 10.1.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BackgroundColorContext.d.ts +1 -10
- package/BackgroundColorContext.js +4 -21
- package/HalstackContext.d.ts +45 -143
- package/HalstackContext.js +10 -35
- package/accordion/Accordion.accessibility.test.js +71 -0
- package/accordion/Accordion.js +33 -84
- 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 -123
- 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 +46 -144
- package/common/variables.js +120 -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 +53 -100
- 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 +63 -130
- 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 +180 -284
- package/file-input/FileInput.stories.tsx +1 -1
- package/file-input/FileInput.test.js +279 -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 +58 -2
- 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 +2 -2
- package/image/Image.js +17 -32
- package/image/Image.stories.tsx +3 -1
- package/image/types.d.ts +2 -2
- package/inset/Inset.js +13 -21
- package/inset/types.d.ts +2 -2
- package/layout/ApplicationLayout.d.ts +2 -2
- package/layout/ApplicationLayout.js +23 -60
- package/layout/Icons.d.ts +4 -5
- package/layout/Icons.js +2 -16
- 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 +8 -4
- package/main.js +39 -60
- 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 +41 -37
- 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 -54
- package/radio-group/RadioGroup.accessibility.test.js +97 -0
- package/radio-group/RadioGroup.js +38 -83
- package/radio-group/RadioGroup.stories.tsx +10 -10
- package/radio-group/RadioGroup.test.js +504 -470
- 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 +40 -54
- package/select/Option.js +28 -36
- package/select/Select.accessibility.test.js +228 -0
- package/select/Select.js +107 -171
- 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 +70 -126
- 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 -97
- 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 +203 -289
- 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 +68 -109
- 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 -64
- package/toggle-group/ToggleGroup.stories.tsx +4 -4
- 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 +43 -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/slider/Slider.stories.tsx +0 -240
- 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/file-input/FileInput.js
CHANGED
|
@@ -1,249 +1,181 @@
|
|
|
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 _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
17
|
-
|
|
18
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
19
|
-
|
|
20
13
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
21
|
-
|
|
22
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
23
|
-
|
|
24
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
25
|
-
|
|
15
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
26
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
27
|
-
|
|
28
17
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
29
|
-
|
|
30
18
|
var _uuid = require("uuid");
|
|
31
|
-
|
|
32
19
|
var _variables = require("../common/variables");
|
|
33
|
-
|
|
34
20
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
35
|
-
|
|
36
21
|
var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
|
|
37
|
-
|
|
38
22
|
var _Button = _interopRequireDefault(require("../button/Button"));
|
|
39
|
-
|
|
40
23
|
var _FileItem = _interopRequireDefault(require("./FileItem"));
|
|
41
|
-
|
|
42
24
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
43
|
-
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
function
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
});else return fileIcon;
|
|
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; }
|
|
27
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
29
|
+
var getFilePreview = /*#__PURE__*/function () {
|
|
30
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(file) {
|
|
31
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
32
|
+
while (1) switch (_context.prev = _context.next) {
|
|
33
|
+
case 0:
|
|
34
|
+
if (!file.type.includes("video")) {
|
|
35
|
+
_context.next = 4;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
return _context.abrupt("return", "filled_movie");
|
|
39
|
+
case 4:
|
|
40
|
+
if (!file.type.includes("audio")) {
|
|
41
|
+
_context.next = 8;
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
return _context.abrupt("return", "music_video");
|
|
45
|
+
case 8:
|
|
46
|
+
if (!file.type.includes("image")) {
|
|
47
|
+
_context.next = 12;
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
return _context.abrupt("return", new Promise(function (resolve) {
|
|
51
|
+
var reader = new FileReader();
|
|
52
|
+
reader.readAsDataURL(file);
|
|
53
|
+
reader.onload = function (e) {
|
|
54
|
+
resolve(e.target.result);
|
|
55
|
+
};
|
|
56
|
+
}));
|
|
57
|
+
case 12:
|
|
58
|
+
return _context.abrupt("return", "draft");
|
|
59
|
+
case 13:
|
|
60
|
+
case "end":
|
|
61
|
+
return _context.stop();
|
|
62
|
+
}
|
|
63
|
+
}, _callee);
|
|
64
|
+
}));
|
|
65
|
+
return function getFilePreview(_x) {
|
|
66
|
+
return _ref.apply(this, arguments);
|
|
67
|
+
};
|
|
68
|
+
}();
|
|
69
|
+
var isFileIncluded = function isFileIncluded(file, fileList) {
|
|
70
|
+
var fileListInfo = fileList.map(function (existingFile) {
|
|
71
|
+
return existingFile.file;
|
|
72
|
+
});
|
|
73
|
+
return fileListInfo.some(function (_ref2) {
|
|
74
|
+
var name = _ref2.name,
|
|
75
|
+
size = _ref2.size,
|
|
76
|
+
type = _ref2.type,
|
|
77
|
+
lastModified = _ref2.lastModified,
|
|
78
|
+
webkitRelativePath = _ref2.webkitRelativePath;
|
|
79
|
+
return name === file.file.name && size === file.file.size && type === file.file.type && lastModified === file.file.lastModified && webkitRelativePath === file.file.webkitRelativePath;
|
|
80
|
+
});
|
|
100
81
|
};
|
|
101
|
-
|
|
102
|
-
var
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
127
|
-
|
|
82
|
+
var DxcFileInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref3, ref) {
|
|
83
|
+
var _ref3$name = _ref3.name,
|
|
84
|
+
name = _ref3$name === void 0 ? "" : _ref3$name,
|
|
85
|
+
_ref3$mode = _ref3.mode,
|
|
86
|
+
mode = _ref3$mode === void 0 ? "file" : _ref3$mode,
|
|
87
|
+
_ref3$label = _ref3.label,
|
|
88
|
+
label = _ref3$label === void 0 ? "" : _ref3$label,
|
|
89
|
+
buttonLabel = _ref3.buttonLabel,
|
|
90
|
+
dropAreaLabel = _ref3.dropAreaLabel,
|
|
91
|
+
_ref3$helperText = _ref3.helperText,
|
|
92
|
+
helperText = _ref3$helperText === void 0 ? "" : _ref3$helperText,
|
|
93
|
+
accept = _ref3.accept,
|
|
94
|
+
minSize = _ref3.minSize,
|
|
95
|
+
maxSize = _ref3.maxSize,
|
|
96
|
+
_ref3$showPreview = _ref3.showPreview,
|
|
97
|
+
showPreview = _ref3$showPreview === void 0 ? false : _ref3$showPreview,
|
|
98
|
+
_ref3$multiple = _ref3.multiple,
|
|
99
|
+
multiple = _ref3$multiple === void 0 ? true : _ref3$multiple,
|
|
100
|
+
_ref3$disabled = _ref3.disabled,
|
|
101
|
+
disabled = _ref3$disabled === void 0 ? false : _ref3$disabled,
|
|
102
|
+
callbackFile = _ref3.callbackFile,
|
|
103
|
+
value = _ref3.value,
|
|
104
|
+
margin = _ref3.margin,
|
|
105
|
+
_ref3$tabIndex = _ref3.tabIndex,
|
|
106
|
+
tabIndex = _ref3$tabIndex === void 0 ? 0 : _ref3$tabIndex;
|
|
128
107
|
var _useState = (0, _react.useState)(false),
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
108
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
109
|
+
isDragging = _useState2[0],
|
|
110
|
+
setIsDragging = _useState2[1];
|
|
133
111
|
var _useState3 = (0, _react.useState)([]),
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
112
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
113
|
+
files = _useState4[0],
|
|
114
|
+
setFiles = _useState4[1];
|
|
138
115
|
var _useState5 = (0, _react.useState)("file-input-".concat((0, _uuid.v4)())),
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
116
|
+
_useState6 = (0, _slicedToArray2["default"])(_useState5, 1),
|
|
117
|
+
fileInputId = _useState6[0];
|
|
142
118
|
var colorsTheme = (0, _useTheme["default"])();
|
|
143
119
|
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
144
|
-
|
|
145
120
|
var checkFileSize = function checkFileSize(file) {
|
|
146
121
|
if (file.size < minSize) return translatedLabels.fileInput.fileSizeGreaterThanErrorMessage;else if (file.size > maxSize) return translatedLabels.fileInput.fileSizeLessThanErrorMessage;
|
|
147
122
|
};
|
|
148
|
-
|
|
149
123
|
var getFilesToAdd = /*#__PURE__*/function () {
|
|
150
|
-
var
|
|
124
|
+
var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(selectedFiles) {
|
|
151
125
|
var filesToAdd;
|
|
152
|
-
return _regenerator["default"].wrap(function
|
|
153
|
-
while (1) {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
return
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
return fileInfo;
|
|
167
|
-
});
|
|
126
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
127
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
128
|
+
case 0:
|
|
129
|
+
_context2.next = 2;
|
|
130
|
+
return Promise.all(selectedFiles.map(function (selectedFile) {
|
|
131
|
+
return getFilePreview(selectedFile);
|
|
132
|
+
})).then(function (previews) {
|
|
133
|
+
return selectedFiles.map(function (file, index) {
|
|
134
|
+
var fileInfo = {
|
|
135
|
+
file: file,
|
|
136
|
+
error: checkFileSize(file),
|
|
137
|
+
preview: previews[index]
|
|
138
|
+
};
|
|
139
|
+
return fileInfo;
|
|
168
140
|
});
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
141
|
+
});
|
|
142
|
+
case 2:
|
|
143
|
+
filesToAdd = _context2.sent;
|
|
144
|
+
return _context2.abrupt("return", filesToAdd.filter(function (file) {
|
|
145
|
+
return !isFileIncluded(file, files);
|
|
146
|
+
}));
|
|
147
|
+
case 4:
|
|
148
|
+
case "end":
|
|
149
|
+
return _context2.stop();
|
|
178
150
|
}
|
|
179
|
-
},
|
|
151
|
+
}, _callee2);
|
|
180
152
|
}));
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
return _ref2.apply(this, arguments);
|
|
153
|
+
return function getFilesToAdd(_x2) {
|
|
154
|
+
return _ref4.apply(this, arguments);
|
|
184
155
|
};
|
|
185
156
|
}();
|
|
186
|
-
|
|
187
157
|
var addFile = /*#__PURE__*/function () {
|
|
188
|
-
var
|
|
189
|
-
var filesToAdd, finalFiles
|
|
190
|
-
return _regenerator["default"].wrap(function
|
|
191
|
-
while (1) {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
case 3:
|
|
203
|
-
filesToAdd = _context2.sent;
|
|
204
|
-
finalFiles = [].concat((0, _toConsumableArray2["default"])(files), (0, _toConsumableArray2["default"])(filesToAdd));
|
|
205
|
-
callbackFile === null || callbackFile === void 0 ? void 0 : callbackFile(finalFiles);
|
|
206
|
-
_context2.next = 19;
|
|
207
|
-
break;
|
|
208
|
-
|
|
209
|
-
case 8:
|
|
210
|
-
if (!(selectedFiles.length === 1)) {
|
|
211
|
-
_context2.next = 14;
|
|
212
|
-
break;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
_context2.next = 11;
|
|
216
|
-
return getFilesToAdd(selectedFiles);
|
|
217
|
-
|
|
218
|
-
case 11:
|
|
219
|
-
_context2.t0 = _context2.sent;
|
|
220
|
-
_context2.next = 17;
|
|
221
|
-
break;
|
|
222
|
-
|
|
223
|
-
case 14:
|
|
224
|
-
_context2.next = 16;
|
|
225
|
-
return getFilesToAdd([selectedFiles[0]]);
|
|
226
|
-
|
|
227
|
-
case 16:
|
|
228
|
-
_context2.t0 = _context2.sent;
|
|
229
|
-
|
|
230
|
-
case 17:
|
|
231
|
-
fileToAdd = _context2.t0;
|
|
232
|
-
callbackFile === null || callbackFile === void 0 ? void 0 : callbackFile(fileToAdd);
|
|
233
|
-
|
|
234
|
-
case 19:
|
|
235
|
-
case "end":
|
|
236
|
-
return _context2.stop();
|
|
237
|
-
}
|
|
158
|
+
var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(selectedFiles) {
|
|
159
|
+
var filesToAdd, finalFiles;
|
|
160
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
161
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
162
|
+
case 0:
|
|
163
|
+
_context3.next = 2;
|
|
164
|
+
return getFilesToAdd(multiple ? selectedFiles : selectedFiles.length === 1 ? selectedFiles : [selectedFiles[0]]);
|
|
165
|
+
case 2:
|
|
166
|
+
filesToAdd = _context3.sent;
|
|
167
|
+
finalFiles = multiple ? [].concat((0, _toConsumableArray2["default"])(files), (0, _toConsumableArray2["default"])(filesToAdd)) : filesToAdd;
|
|
168
|
+
callbackFile === null || callbackFile === void 0 ? void 0 : callbackFile(finalFiles);
|
|
169
|
+
case 5:
|
|
170
|
+
case "end":
|
|
171
|
+
return _context3.stop();
|
|
238
172
|
}
|
|
239
|
-
},
|
|
173
|
+
}, _callee3);
|
|
240
174
|
}));
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
return _ref3.apply(this, arguments);
|
|
175
|
+
return function addFile(_x3) {
|
|
176
|
+
return _ref5.apply(this, arguments);
|
|
244
177
|
};
|
|
245
178
|
}();
|
|
246
|
-
|
|
247
179
|
var selectFiles = function selectFiles(e) {
|
|
248
180
|
var selectedFiles = e.target.files;
|
|
249
181
|
var filesArray = Object.keys(selectedFiles).map(function (key) {
|
|
@@ -252,7 +184,6 @@ var DxcFileInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
252
184
|
addFile(filesArray);
|
|
253
185
|
e.target.value = null;
|
|
254
186
|
};
|
|
255
|
-
|
|
256
187
|
var onDelete = (0, _react.useCallback)(function (fileName) {
|
|
257
188
|
var filesCopy = (0, _toConsumableArray2["default"])(files);
|
|
258
189
|
var fileToRemove = filesCopy.find(function (file) {
|
|
@@ -262,33 +193,26 @@ var DxcFileInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
262
193
|
filesCopy.splice(fileIndex, 1);
|
|
263
194
|
callbackFile === null || callbackFile === void 0 ? void 0 : callbackFile(filesCopy);
|
|
264
195
|
}, [files, callbackFile]);
|
|
265
|
-
|
|
266
196
|
var handleClick = function handleClick() {
|
|
267
197
|
document.getElementById(fileInputId).click();
|
|
268
198
|
};
|
|
269
|
-
|
|
270
199
|
var handleDrag = function handleDrag(e) {
|
|
271
200
|
e.preventDefault();
|
|
272
201
|
e.stopPropagation();
|
|
273
202
|
};
|
|
274
|
-
|
|
275
203
|
var handleDragIn = function handleDragIn(e) {
|
|
276
204
|
var _e$dataTransfer$items;
|
|
277
|
-
|
|
278
205
|
if (((_e$dataTransfer$items = e.dataTransfer.items) === null || _e$dataTransfer$items === void 0 ? void 0 : _e$dataTransfer$items.length) > 0) setIsDragging(true);
|
|
279
206
|
};
|
|
280
|
-
|
|
281
207
|
var handleDragOut = function handleDragOut(e) {
|
|
282
208
|
// only if dragged items leave container (outside, not to childs)
|
|
283
209
|
if (!e.currentTarget.contains(e.relatedTarget)) setIsDragging(false);
|
|
284
210
|
};
|
|
285
|
-
|
|
286
211
|
var handleDrop = function handleDrop(e) {
|
|
287
212
|
e.preventDefault();
|
|
288
213
|
e.stopPropagation();
|
|
289
214
|
setIsDragging(false);
|
|
290
215
|
var filesObject = e.dataTransfer.files;
|
|
291
|
-
|
|
292
216
|
if ((filesObject === null || filesObject === void 0 ? void 0 : filesObject.length) > 0) {
|
|
293
217
|
var filesArray = Object.keys(filesObject).map(function (key) {
|
|
294
218
|
return filesObject[key];
|
|
@@ -296,75 +220,60 @@ var DxcFileInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
296
220
|
addFile(filesArray);
|
|
297
221
|
}
|
|
298
222
|
};
|
|
299
|
-
|
|
300
223
|
(0, _react.useEffect)(function () {
|
|
301
224
|
var getFiles = /*#__PURE__*/function () {
|
|
302
|
-
var
|
|
225
|
+
var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
|
303
226
|
var valueFiles;
|
|
304
|
-
return _regenerator["default"].wrap(function
|
|
305
|
-
while (1) {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
if (!file.preview) {
|
|
322
|
-
_context3.next = 4;
|
|
323
|
-
break;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
return _context3.abrupt("return", file);
|
|
327
|
-
|
|
328
|
-
case 4:
|
|
329
|
-
_context3.next = 6;
|
|
330
|
-
return getFilePreview(file.file);
|
|
331
|
-
|
|
332
|
-
case 6:
|
|
333
|
-
preview = _context3.sent;
|
|
334
|
-
return _context3.abrupt("return", _objectSpread(_objectSpread({}, file), {}, {
|
|
335
|
-
preview: preview
|
|
336
|
-
}));
|
|
337
|
-
|
|
338
|
-
case 8:
|
|
339
|
-
case "end":
|
|
340
|
-
return _context3.stop();
|
|
227
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
228
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
229
|
+
case 0:
|
|
230
|
+
if (!value) {
|
|
231
|
+
_context5.next = 5;
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
_context5.next = 3;
|
|
235
|
+
return Promise.all(value.map( /*#__PURE__*/function () {
|
|
236
|
+
var _ref7 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(file) {
|
|
237
|
+
var preview;
|
|
238
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
239
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
240
|
+
case 0:
|
|
241
|
+
if (!file.preview) {
|
|
242
|
+
_context4.next = 4;
|
|
243
|
+
break;
|
|
341
244
|
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
return
|
|
358
|
-
|
|
245
|
+
return _context4.abrupt("return", file);
|
|
246
|
+
case 4:
|
|
247
|
+
_context4.next = 6;
|
|
248
|
+
return getFilePreview(file.file);
|
|
249
|
+
case 6:
|
|
250
|
+
preview = _context4.sent;
|
|
251
|
+
return _context4.abrupt("return", _objectSpread(_objectSpread({}, file), {}, {
|
|
252
|
+
preview: preview
|
|
253
|
+
}));
|
|
254
|
+
case 8:
|
|
255
|
+
case "end":
|
|
256
|
+
return _context4.stop();
|
|
257
|
+
}
|
|
258
|
+
}, _callee4);
|
|
259
|
+
}));
|
|
260
|
+
return function (_x4) {
|
|
261
|
+
return _ref7.apply(this, arguments);
|
|
262
|
+
};
|
|
263
|
+
}()));
|
|
264
|
+
case 3:
|
|
265
|
+
valueFiles = _context5.sent;
|
|
266
|
+
setFiles(valueFiles);
|
|
267
|
+
case 5:
|
|
268
|
+
case "end":
|
|
269
|
+
return _context5.stop();
|
|
359
270
|
}
|
|
360
|
-
},
|
|
271
|
+
}, _callee5);
|
|
361
272
|
}));
|
|
362
|
-
|
|
363
273
|
return function getFiles() {
|
|
364
|
-
return
|
|
274
|
+
return _ref6.apply(this, arguments);
|
|
365
275
|
};
|
|
366
276
|
}();
|
|
367
|
-
|
|
368
277
|
getFiles();
|
|
369
278
|
}, [value]);
|
|
370
279
|
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
@@ -446,7 +355,6 @@ var DxcFileInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
446
355
|
});
|
|
447
356
|
}))), mode === "file" && !multiple && files.length === 1 && files[0].error && /*#__PURE__*/_react["default"].createElement(ErrorMessage, null, files[0].error)));
|
|
448
357
|
});
|
|
449
|
-
|
|
450
358
|
var FileInputContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n width: fit-content;\n"])), function (props) {
|
|
451
359
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
452
360
|
}, function (props) {
|
|
@@ -458,7 +366,6 @@ var FileInputContainer = _styledComponents["default"].div(_templateObject || (_t
|
|
|
458
366
|
}, function (props) {
|
|
459
367
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
460
368
|
});
|
|
461
|
-
|
|
462
369
|
var Label = _styledComponents["default"].label(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), function (props) {
|
|
463
370
|
return props.disabled ? props.theme.disabledLabelFontColor : props.theme.labelFontColor;
|
|
464
371
|
}, function (props) {
|
|
@@ -470,7 +377,6 @@ var Label = _styledComponents["default"].label(_templateObject2 || (_templateObj
|
|
|
470
377
|
}, function (props) {
|
|
471
378
|
return props.theme.labelLineHeight;
|
|
472
379
|
});
|
|
473
|
-
|
|
474
380
|
var HelperText = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), function (props) {
|
|
475
381
|
return props.disabled ? props.theme.disabledHelperTextFontcolor : props.theme.helperTextFontColor;
|
|
476
382
|
}, function (props) {
|
|
@@ -482,17 +388,12 @@ var HelperText = _styledComponents["default"].span(_templateObject3 || (_templat
|
|
|
482
388
|
}, function (props) {
|
|
483
389
|
return props.theme.helperTextLineHeight;
|
|
484
390
|
});
|
|
485
|
-
|
|
486
391
|
var FileContainer = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n ", "\n margin-top: 0.25rem;\n"])), function (props) {
|
|
487
392
|
return props.singleFileMode ? "flex-direction: row; column-gap: 0.25rem;" : "flex-direction: column; row-gap: 0.25rem;";
|
|
488
393
|
});
|
|
489
|
-
|
|
490
394
|
var ValueInput = _styledComponents["default"].input(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: none;\n"])));
|
|
491
|
-
|
|
492
395
|
var FileItemListContainer = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n row-gap: 0.25rem;\n"])));
|
|
493
|
-
|
|
494
396
|
var Container = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n row-gap: 0.25rem;\n margin-top: 0.25rem;\n"])));
|
|
495
|
-
|
|
496
397
|
var DragDropArea = _styledComponents["default"].div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n display: flex;\n ", "\n align-items: center;\n width: 320px;\n padding: ", ";\n overflow: hidden;\n box-shadow: 0 0 0 2px transparent;\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n ", "\n cursor: ", ";\n"])), function (props) {
|
|
497
398
|
return props.mode === "filedrop" ? "flex-direction: row; column-gap: 0.75rem; height: 48px;" : "justify-content: center; flex-direction: column; row-gap: 0.5rem; height: 160px;";
|
|
498
399
|
}, function (props) {
|
|
@@ -510,7 +411,6 @@ var DragDropArea = _styledComponents["default"].div(_templateObject8 || (_templa
|
|
|
510
411
|
}, function (props) {
|
|
511
412
|
return props.disabled && "not-allowed";
|
|
512
413
|
});
|
|
513
|
-
|
|
514
414
|
var DropzoneLabel = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n display: -webkit-box;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n -webkit-line-clamp: 3;\n text-align: center;\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n"])), function (props) {
|
|
515
415
|
return props.disabled ? props.theme.disabledDropLabelFontColor : props.theme.dropLabelFontColor;
|
|
516
416
|
}, function (props) {
|
|
@@ -520,7 +420,6 @@ var DropzoneLabel = _styledComponents["default"].div(_templateObject9 || (_templ
|
|
|
520
420
|
}, function (props) {
|
|
521
421
|
return props.theme.dropLabelFontWeight;
|
|
522
422
|
});
|
|
523
|
-
|
|
524
423
|
var FiledropLabel = _styledComponents["default"].span(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n"])), function (props) {
|
|
525
424
|
return props.disabled ? props.theme.disabledDropLabelFontColor : props.theme.dropLabelFontColor;
|
|
526
425
|
}, function (props) {
|
|
@@ -530,7 +429,6 @@ var FiledropLabel = _styledComponents["default"].span(_templateObject10 || (_tem
|
|
|
530
429
|
}, function (props) {
|
|
531
430
|
return props.theme.dropLabelFontWeight;
|
|
532
431
|
});
|
|
533
|
-
|
|
534
432
|
var ErrorMessage = _styledComponents["default"].div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-top: 0.25rem;\n"])), function (props) {
|
|
535
433
|
return props.theme.errorMessageFontColor;
|
|
536
434
|
}, function (props) {
|
|
@@ -542,6 +440,4 @@ var ErrorMessage = _styledComponents["default"].div(_templateObject11 || (_templ
|
|
|
542
440
|
}, function (props) {
|
|
543
441
|
return props.theme.errorMessageLineHeight;
|
|
544
442
|
});
|
|
545
|
-
|
|
546
|
-
var _default = DxcFileInput;
|
|
547
|
-
exports["default"] = _default;
|
|
443
|
+
var _default = exports["default"] = DxcFileInput;
|